summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Modules
diff options
context:
space:
mode:
authorAlexSm <[email protected]>2024-03-05 10:40:59 +0100
committerGitHub <[email protected]>2024-03-05 12:40:59 +0300
commit1ac13c847b5358faba44dbb638a828e24369467b (patch)
tree07672b4dd3604ad3dee540a02c6494cb7d10dc3d /contrib/tools/python3/Modules
parentffcca3e7f7958ddc6487b91d3df8c01054bd0638 (diff)
Library import 16 (#2433)
Co-authored-by: robot-piglet <[email protected]> Co-authored-by: deshevoy <[email protected]> Co-authored-by: robot-contrib <[email protected]> Co-authored-by: thegeorg <[email protected]> Co-authored-by: robot-ya-builder <[email protected]> Co-authored-by: svidyuk <[email protected]> Co-authored-by: shadchin <[email protected]> Co-authored-by: robot-ratatosk <[email protected]> Co-authored-by: innokentii <[email protected]> Co-authored-by: arkady-e1ppa <[email protected]> Co-authored-by: snermolaev <[email protected]> Co-authored-by: dimdim11 <[email protected]> Co-authored-by: kickbutt <[email protected]> Co-authored-by: abdullinsaid <[email protected]> Co-authored-by: korsunandrei <[email protected]> Co-authored-by: petrk <[email protected]> Co-authored-by: miroslav2 <[email protected]> Co-authored-by: serjflint <[email protected]> Co-authored-by: akhropov <[email protected]> Co-authored-by: prettyboy <[email protected]> Co-authored-by: ilikepugs <[email protected]> Co-authored-by: hiddenpath <[email protected]> Co-authored-by: mikhnenko <[email protected]> Co-authored-by: spreis <[email protected]> Co-authored-by: andreyshspb <[email protected]> Co-authored-by: dimaandreev <[email protected]> Co-authored-by: rashid <[email protected]> Co-authored-by: robot-ydb-importer <[email protected]> Co-authored-by: r-vetrov <[email protected]> Co-authored-by: ypodlesov <[email protected]> Co-authored-by: zaverden <[email protected]> Co-authored-by: vpozdyayev <[email protected]> Co-authored-by: robot-cozmo <[email protected]> Co-authored-by: v-korovin <[email protected]> Co-authored-by: arikon <[email protected]> Co-authored-by: khoden <[email protected]> Co-authored-by: psydmm <[email protected]> Co-authored-by: robot-javacom <[email protected]> Co-authored-by: dtorilov <[email protected]> Co-authored-by: sennikovmv <[email protected]> Co-authored-by: hcpp <[email protected]>
Diffstat (limited to 'contrib/tools/python3/Modules')
-rw-r--r--contrib/tools/python3/Modules/README2
-rw-r--r--contrib/tools/python3/Modules/_abc.c967
-rw-r--r--contrib/tools/python3/Modules/_asynciomodule.c3815
-rw-r--r--contrib/tools/python3/Modules/_bisectmodule.c479
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2b_impl.c416
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2module.c159
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2module.h43
-rw-r--r--contrib/tools/python3/Modules/_blake2/blake2s_impl.c416
-rw-r--r--contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h279
-rw-r--r--contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h279
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2-config.h71
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h162
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2.h177
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h68
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h402
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c379
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h160
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2b.c436
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h59
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h229
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h189
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c368
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h91
-rw-r--r--contrib/tools/python3/Modules/_blake2/impl/blake2s.c415
-rw-r--r--contrib/tools/python3/Modules/_bz2module.c820
-rw-r--r--contrib/tools/python3/Modules/_codecsmodule.c1072
-rw-r--r--contrib/tools/python3/Modules/_collectionsmodule.c2594
-rw-r--r--contrib/tools/python3/Modules/_contextvarsmodule.c67
-rw-r--r--contrib/tools/python3/Modules/_cryptmodule.c81
-rw-r--r--contrib/tools/python3/Modules/_csv.c1822
-rw-r--r--contrib/tools/python3/Modules/_ctypes/_ctypes.c5835
-rw-r--r--contrib/tools/python3/Modules/_ctypes/callbacks.c612
-rw-r--r--contrib/tools/python3/Modules/_ctypes/callproc.c2038
-rw-r--r--contrib/tools/python3/Modules/_ctypes/cfield.c1585
-rw-r--r--contrib/tools/python3/Modules/_ctypes/ctypes.h414
-rw-r--r--contrib/tools/python3/Modules/_ctypes/stgdict.c963
-rw-r--r--contrib/tools/python3/Modules/_datetimemodule.c7138
-rw-r--r--contrib/tools/python3/Modules/_decimal/_decimal.c6056
-rw-r--r--contrib/tools/python3/Modules/_decimal/docstrings.h884
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c655
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h218
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/bits.h188
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/constants.c130
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/constants.h89
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/context.c286
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c171
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h49
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/crt.c180
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/crt.h46
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c173
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h47
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c79
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h47
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c259
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h47
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/io.c1598
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c349
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h53
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h62
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c9015
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h847
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c967
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c132
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h76
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c214
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h47
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c276
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h61
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h668
-rw-r--r--contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h648
-rw-r--r--contrib/tools/python3/Modules/_elementtree.c4458
-rw-r--r--contrib/tools/python3/Modules/_functoolsmodule.c1543
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c1472
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h65
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c508
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h65
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c1345
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h204
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c824
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h130
-rw-r--r--contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h83
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h346
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h107
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h68
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h266
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h231
-rw-r--r--contrib/tools/python3/Modules/_hacl/include/krml/types.h14
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h61
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h61
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h184
-rw-r--r--contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h65
-rw-r--r--contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h86
-rw-r--r--contrib/tools/python3/Modules/_hashopenssl.c2290
-rw-r--r--contrib/tools/python3/Modules/_heapqmodule.c705
-rw-r--r--contrib/tools/python3/Modules/_io/_iomodule.c739
-rw-r--r--contrib/tools/python3/Modules/_io/_iomodule.h197
-rw-r--r--contrib/tools/python3/Modules/_io/bufferedio.c2692
-rw-r--r--contrib/tools/python3/Modules/_io/bytesio.c1133
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h410
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h1101
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/bytesio.c.h541
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/fileio.c.h539
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/iobase.c.h444
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/stringio.c.h370
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/textio.c.h985
-rw-r--r--contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h468
-rw-r--r--contrib/tools/python3/Modules/_io/fileio.c1230
-rw-r--r--contrib/tools/python3/Modules/_io/iobase.c1061
-rw-r--r--contrib/tools/python3/Modules/_io/stringio.c1037
-rw-r--r--contrib/tools/python3/Modules/_io/textio.c3352
-rw-r--r--contrib/tools/python3/Modules/_io/winconsoleio.c1179
-rw-r--r--contrib/tools/python3/Modules/_json.c1820
-rw-r--r--contrib/tools/python3/Modules/_localemodule.c926
-rw-r--r--contrib/tools/python3/Modules/_lsprof.c1027
-rw-r--r--contrib/tools/python3/Modules/_lzmamodule.c1663
-rw-r--r--contrib/tools/python3/Modules/_math.h25
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h175
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h175
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h545
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c295
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h97
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/posixshmem.c133
-rw-r--r--contrib/tools/python3/Modules/_multiprocessing/semaphore.c790
-rw-r--r--contrib/tools/python3/Modules/_opcode.c115
-rw-r--r--contrib/tools/python3/Modules/_operator.c1877
-rw-r--r--contrib/tools/python3/Modules/_pickle.c7986
-rw-r--r--contrib/tools/python3/Modules/_posixsubprocess.c1249
-rw-r--r--contrib/tools/python3/Modules/_queuemodule.c456
-rw-r--r--contrib/tools/python3/Modules/_randommodule.c668
-rw-r--r--contrib/tools/python3/Modules/_scproxy.c264
-rw-r--r--contrib/tools/python3/Modules/_sqlite/blob.c617
-rw-r--r--contrib/tools/python3/Modules/_sqlite/blob.h24
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h222
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h1668
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h322
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/module.c.h214
-rw-r--r--contrib/tools/python3/Modules/_sqlite/clinic/row.c.h63
-rw-r--r--contrib/tools/python3/Modules/_sqlite/connection.c2659
-rw-r--r--contrib/tools/python3/Modules/_sqlite/connection.h114
-rw-r--r--contrib/tools/python3/Modules/_sqlite/cursor.c1366
-rw-r--r--contrib/tools/python3/Modules/_sqlite/cursor.h53
-rw-r--r--contrib/tools/python3/Modules/_sqlite/microprotocols.c144
-rw-r--r--contrib/tools/python3/Modules/_sqlite/microprotocols.h43
-rw-r--r--contrib/tools/python3/Modules/_sqlite/module.c807
-rw-r--r--contrib/tools/python3/Modules/_sqlite/module.h99
-rw-r--r--contrib/tools/python3/Modules/_sqlite/prepare_protocol.c77
-rw-r--r--contrib/tools/python3/Modules/_sqlite/prepare_protocol.h35
-rw-r--r--contrib/tools/python3/Modules/_sqlite/row.c276
-rw-r--r--contrib/tools/python3/Modules/_sqlite/row.h38
-rw-r--r--contrib/tools/python3/Modules/_sqlite/statement.c205
-rw-r--r--contrib/tools/python3/Modules/_sqlite/statement.h43
-rw-r--r--contrib/tools/python3/Modules/_sqlite/util.c167
-rw-r--r--contrib/tools/python3/Modules/_sqlite/util.h40
-rw-r--r--contrib/tools/python3/Modules/_sqlite/ya.make47
-rw-r--r--contrib/tools/python3/Modules/_sre/clinic/sre.c.h1463
-rw-r--r--contrib/tools/python3/Modules/_sre/sre.c3249
-rw-r--r--contrib/tools/python3/Modules/_sre/sre.h107
-rw-r--r--contrib/tools/python3/Modules/_sre/sre_constants.h99
-rw-r--r--contrib/tools/python3/Modules/_sre/sre_lib.h1818
-rw-r--r--contrib/tools/python3/Modules/_sre/sre_targets.h58
-rw-r--r--contrib/tools/python3/Modules/_ssl.c6294
-rw-r--r--contrib/tools/python3/Modules/_ssl.h80
-rw-r--r--contrib/tools/python3/Modules/_ssl/cert.c245
-rw-r--r--contrib/tools/python3/Modules/_ssl/clinic/cert.c.h89
-rw-r--r--contrib/tools/python3/Modules/_ssl/debughelpers.c206
-rw-r--r--contrib/tools/python3/Modules/_ssl/misc.c34
-rw-r--r--contrib/tools/python3/Modules/_ssl_data.h6323
-rw-r--r--contrib/tools/python3/Modules/_ssl_data_111.h6540
-rw-r--r--contrib/tools/python3/Modules/_ssl_data_300.h8585
-rw-r--r--contrib/tools/python3/Modules/_ssl_data_31.h8605
-rw-r--r--contrib/tools/python3/Modules/_stat.c638
-rw-r--r--contrib/tools/python3/Modules/_statisticsmodule.c152
-rw-r--r--contrib/tools/python3/Modules/_struct.c2596
-rw-r--r--contrib/tools/python3/Modules/_threadmodule.c1788
-rw-r--r--contrib/tools/python3/Modules/_tracemalloc.c228
-rw-r--r--contrib/tools/python3/Modules/_typingmodule.c90
-rw-r--r--contrib/tools/python3/Modules/_weakref.c197
-rw-r--r--contrib/tools/python3/Modules/_winapi.c2590
-rw-r--r--contrib/tools/python3/Modules/_xxinterpchannelsmodule.c2479
-rw-r--r--contrib/tools/python3/Modules/_xxsubinterpretersmodule.c862
-rw-r--r--contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c48
-rw-r--r--contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c569
-rw-r--r--contrib/tools/python3/Modules/_zoneinfo.c2784
-rw-r--r--contrib/tools/python3/Modules/addrinfo.h170
-rw-r--r--contrib/tools/python3/Modules/arraymodule.c3138
-rw-r--r--contrib/tools/python3/Modules/atexitmodule.c335
-rw-r--r--contrib/tools/python3/Modules/audioop.c2003
-rw-r--r--contrib/tools/python3/Modules/binascii.c1346
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c470
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c190
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c1150
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c765
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c468
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c143
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h65
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h525
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h693
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h54
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h4104
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h2379
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h60
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h4766
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h3253
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h2635
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c2084
-rw-r--r--contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h150
-rw-r--r--contrib/tools/python3/Modules/clinic/_abc.c.h168
-rw-r--r--contrib/tools/python3/Modules/clinic/_asynciomodule.c.h1490
-rw-r--r--contrib/tools/python3/Modules/clinic/_bisectmodule.c.h436
-rw-r--r--contrib/tools/python3/Modules/clinic/_bz2module.c.h244
-rw-r--r--contrib/tools/python3/Modules/clinic/_codecsmodule.c.h2872
-rw-r--r--contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h78
-rw-r--r--contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h27
-rw-r--r--contrib/tools/python3/Modules/clinic/_cryptmodule.c.h69
-rw-r--r--contrib/tools/python3/Modules/clinic/_csv.c.h209
-rw-r--r--contrib/tools/python3/Modules/clinic/_datetimemodule.c.h149
-rw-r--r--contrib/tools/python3/Modules/clinic/_elementtree.c.h1221
-rw-r--r--contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h104
-rw-r--r--contrib/tools/python3/Modules/clinic/_hashopenssl.c.h1854
-rw-r--r--contrib/tools/python3/Modules/clinic/_heapqmodule.c.h274
-rw-r--r--contrib/tools/python3/Modules/clinic/_localemodule.c.h611
-rw-r--r--contrib/tools/python3/Modules/clinic/_lsprof.c.h54
-rw-r--r--contrib/tools/python3/Modules/clinic/_lzmamodule.c.h341
-rw-r--r--contrib/tools/python3/Modules/clinic/_opcode.c.h106
-rw-r--r--contrib/tools/python3/Modules/clinic/_operator.c.h1495
-rw-r--r--contrib/tools/python3/Modules/clinic/_pickle.c.h1037
-rw-r--r--contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h162
-rw-r--r--contrib/tools/python3/Modules/clinic/_queuemodule.c.h334
-rw-r--r--contrib/tools/python3/Modules/clinic/_randommodule.c.h118
-rw-r--r--contrib/tools/python3/Modules/clinic/_ssl.c.h1545
-rw-r--r--contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h74
-rw-r--r--contrib/tools/python3/Modules/clinic/_struct.c.h454
-rw-r--r--contrib/tools/python3/Modules/clinic/_tracemalloc.c.h221
-rw-r--r--contrib/tools/python3/Modules/clinic/_typingmodule.c.h18
-rw-r--r--contrib/tools/python3/Modules/clinic/_weakref.c.h119
-rw-r--r--contrib/tools/python3/Modules/clinic/_winapi.c.h1485
-rw-r--r--contrib/tools/python3/Modules/clinic/_zoneinfo.c.h375
-rw-r--r--contrib/tools/python3/Modules/clinic/arraymodule.c.h683
-rw-r--r--contrib/tools/python3/Modules/clinic/audioop.c.h1318
-rw-r--r--contrib/tools/python3/Modules/clinic/binascii.c.h798
-rw-r--r--contrib/tools/python3/Modules/clinic/cmathmodule.c.h985
-rw-r--r--contrib/tools/python3/Modules/clinic/fcntlmodule.c.h252
-rw-r--r--contrib/tools/python3/Modules/clinic/gcmodule.c.h427
-rw-r--r--contrib/tools/python3/Modules/clinic/grpmodule.c.h152
-rw-r--r--contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h916
-rw-r--r--contrib/tools/python3/Modules/clinic/mathmodule.c.h953
-rw-r--r--contrib/tools/python3/Modules/clinic/md5module.c.h151
-rw-r--r--contrib/tools/python3/Modules/clinic/overlapped.c.h1265
-rw-r--r--contrib/tools/python3/Modules/clinic/posixmodule.c.h12002
-rw-r--r--contrib/tools/python3/Modules/clinic/pwdmodule.c.h83
-rw-r--r--contrib/tools/python3/Modules/clinic/pyexpat.c.h501
-rw-r--r--contrib/tools/python3/Modules/clinic/resource.c.h181
-rw-r--r--contrib/tools/python3/Modules/clinic/selectmodule.c.h1312
-rw-r--r--contrib/tools/python3/Modules/clinic/sha1module.c.h151
-rw-r--r--contrib/tools/python3/Modules/clinic/sha2module.c.h440
-rw-r--r--contrib/tools/python3/Modules/clinic/sha3module.c.h196
-rw-r--r--contrib/tools/python3/Modules/clinic/signalmodule.c.h708
-rw-r--r--contrib/tools/python3/Modules/clinic/socketmodule.c.h94
-rw-r--r--contrib/tools/python3/Modules/clinic/spwdmodule.c.h80
-rw-r--r--contrib/tools/python3/Modules/clinic/symtablemodule.c.h57
-rw-r--r--contrib/tools/python3/Modules/clinic/syslogmodule.c.h257
-rw-r--r--contrib/tools/python3/Modules/clinic/termios.c.h295
-rw-r--r--contrib/tools/python3/Modules/clinic/unicodedata.c.h568
-rw-r--r--contrib/tools/python3/Modules/clinic/zlibmodule.c.h1132
-rw-r--r--contrib/tools/python3/Modules/cmathmodule.c1381
-rw-r--r--contrib/tools/python3/Modules/config.c315
-rw-r--r--contrib/tools/python3/Modules/errnomodule.c977
-rw-r--r--contrib/tools/python3/Modules/faulthandler.c1394
-rw-r--r--contrib/tools/python3/Modules/fcntlmodule.c707
-rw-r--r--contrib/tools/python3/Modules/gcmodule.c2444
-rw-r--r--contrib/tools/python3/Modules/getaddrinfo.c647
-rw-r--r--contrib/tools/python3/Modules/getbuildinfo.c74
-rw-r--r--contrib/tools/python3/Modules/getnameinfo.c217
-rw-r--r--contrib/tools/python3/Modules/getpath.c953
-rw-r--r--contrib/tools/python3/Modules/grpmodule.c370
-rw-r--r--contrib/tools/python3/Modules/hashlib.h66
-rw-r--r--contrib/tools/python3/Modules/itertoolsmodule.c4773
-rw-r--r--contrib/tools/python3/Modules/main.c769
-rw-r--r--contrib/tools/python3/Modules/mathmodule.c4160
-rw-r--r--contrib/tools/python3/Modules/md5module.c394
-rw-r--r--contrib/tools/python3/Modules/mmapmodule.c1763
-rw-r--r--contrib/tools/python3/Modules/overlapped.c2069
-rw-r--r--contrib/tools/python3/Modules/posixmodule.c17017
-rw-r--r--contrib/tools/python3/Modules/posixmodule.h32
-rw-r--r--contrib/tools/python3/Modules/pwdmodule.c372
-rw-r--r--contrib/tools/python3/Modules/pyexpat.c2148
-rw-r--r--contrib/tools/python3/Modules/resource.c556
-rw-r--r--contrib/tools/python3/Modules/rotatingtree.c121
-rw-r--r--contrib/tools/python3/Modules/rotatingtree.h27
-rw-r--r--contrib/tools/python3/Modules/selectmodule.c2807
-rw-r--r--contrib/tools/python3/Modules/sha1module.c397
-rw-r--r--contrib/tools/python3/Modules/sha2module.c889
-rw-r--r--contrib/tools/python3/Modules/sha3module.c623
-rw-r--r--contrib/tools/python3/Modules/signalmodule.c2062
-rw-r--r--contrib/tools/python3/Modules/socketmodule.c8938
-rw-r--r--contrib/tools/python3/Modules/socketmodule.h391
-rw-r--r--contrib/tools/python3/Modules/spwdmodule.c268
-rw-r--r--contrib/tools/python3/Modules/symtablemodule.c127
-rw-r--r--contrib/tools/python3/Modules/syslogmodule.c427
-rw-r--r--contrib/tools/python3/Modules/termios.c1290
-rw-r--r--contrib/tools/python3/Modules/timemodule.c2320
-rw-r--r--contrib/tools/python3/Modules/unicodedata.c1544
-rw-r--r--contrib/tools/python3/Modules/unicodedata_db.h7791
-rw-r--r--contrib/tools/python3/Modules/unicodename_db.h31070
-rw-r--r--contrib/tools/python3/Modules/winreparse.h59
-rw-r--r--contrib/tools/python3/Modules/ya.make188
-rw-r--r--contrib/tools/python3/Modules/zlibmodule.c2140
307 files changed, 362547 insertions, 0 deletions
diff --git a/contrib/tools/python3/Modules/README b/contrib/tools/python3/Modules/README
new file mode 100644
index 00000000000..9b79f538892
--- /dev/null
+++ b/contrib/tools/python3/Modules/README
@@ -0,0 +1,2 @@
+Source files for standard library extension modules,
+and former extension modules that are now builtin modules.
diff --git a/contrib/tools/python3/Modules/_abc.c b/contrib/tools/python3/Modules/_abc.c
new file mode 100644
index 00000000000..d3e405dadb6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_abc.c
@@ -0,0 +1,967 @@
+/* ABCMeta implementation */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_object.h" // _PyType_GetSubclasses()
+#include "pycore_runtime.h" // _Py_ID()
+#include "pycore_typeobject.h" // _PyType_GetMRO()
+#include "clinic/_abc.c.h"
+
+/*[clinic input]
+module _abc
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=964f5328e1aefcda]*/
+
+PyDoc_STRVAR(_abc__doc__,
+"Module contains faster C implementation of abc.ABCMeta");
+
+typedef struct {
+ PyTypeObject *_abc_data_type;
+ unsigned long long abc_invalidation_counter;
+} _abcmodule_state;
+
+static inline _abcmodule_state*
+get_abc_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_abcmodule_state *)state;
+}
+
+/* This object stores internal state for ABCs.
+ Note that we can use normal sets for caches,
+ since they are never iterated over. */
+typedef struct {
+ PyObject_HEAD
+ PyObject *_abc_registry;
+ PyObject *_abc_cache; /* Normal set of weak references. */
+ PyObject *_abc_negative_cache; /* Normal set of weak references. */
+ unsigned long long _abc_negative_cache_version;
+} _abc_data;
+
+static int
+abc_data_traverse(_abc_data *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->_abc_registry);
+ Py_VISIT(self->_abc_cache);
+ Py_VISIT(self->_abc_negative_cache);
+ return 0;
+}
+
+static int
+abc_data_clear(_abc_data *self)
+{
+ Py_CLEAR(self->_abc_registry);
+ Py_CLEAR(self->_abc_cache);
+ Py_CLEAR(self->_abc_negative_cache);
+ return 0;
+}
+
+static void
+abc_data_dealloc(_abc_data *self)
+{
+ PyObject_GC_UnTrack(self);
+ PyTypeObject *tp = Py_TYPE(self);
+ (void)abc_data_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+abc_data_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ _abc_data *self = (_abc_data *) type->tp_alloc(type, 0);
+ _abcmodule_state *state = NULL;
+ if (self == NULL) {
+ return NULL;
+ }
+
+ state = _PyType_GetModuleState(type);
+ if (state == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ self->_abc_registry = NULL;
+ self->_abc_cache = NULL;
+ self->_abc_negative_cache = NULL;
+ self->_abc_negative_cache_version = state->abc_invalidation_counter;
+ return (PyObject *) self;
+}
+
+PyDoc_STRVAR(abc_data_doc,
+"Internal state held by ABC machinery.");
+
+static PyType_Slot _abc_data_type_spec_slots[] = {
+ {Py_tp_doc, (void *)abc_data_doc},
+ {Py_tp_new, abc_data_new},
+ {Py_tp_dealloc, abc_data_dealloc},
+ {Py_tp_traverse, abc_data_traverse},
+ {Py_tp_clear, abc_data_clear},
+ {0, 0}
+};
+
+static PyType_Spec _abc_data_type_spec = {
+ .name = "_abc._abc_data",
+ .basicsize = sizeof(_abc_data),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
+ .slots = _abc_data_type_spec_slots,
+};
+
+static _abc_data *
+_get_impl(PyObject *module, PyObject *self)
+{
+ _abcmodule_state *state = get_abc_state(module);
+ PyObject *impl = PyObject_GetAttr(self, &_Py_ID(_abc_impl));
+ if (impl == NULL) {
+ return NULL;
+ }
+ if (!Py_IS_TYPE(impl, state->_abc_data_type)) {
+ PyErr_SetString(PyExc_TypeError, "_abc_impl is set to a wrong type");
+ Py_DECREF(impl);
+ return NULL;
+ }
+ return (_abc_data *)impl;
+}
+
+static int
+_in_weak_set(PyObject *set, PyObject *obj)
+{
+ if (set == NULL || PySet_GET_SIZE(set) == 0) {
+ return 0;
+ }
+ PyObject *ref = PyWeakref_NewRef(obj, NULL);
+ if (ref == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_Clear();
+ return 0;
+ }
+ return -1;
+ }
+ int res = PySet_Contains(set, ref);
+ Py_DECREF(ref);
+ return res;
+}
+
+static PyObject *
+_destroy(PyObject *setweakref, PyObject *objweakref)
+{
+ PyObject *set;
+ set = PyWeakref_GET_OBJECT(setweakref);
+ if (set == Py_None) {
+ Py_RETURN_NONE;
+ }
+ Py_INCREF(set);
+ if (PySet_Discard(set, objweakref) < 0) {
+ Py_DECREF(set);
+ return NULL;
+ }
+ Py_DECREF(set);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef _destroy_def = {
+ "_destroy", (PyCFunction) _destroy, METH_O
+};
+
+static int
+_add_to_weak_set(PyObject **pset, PyObject *obj)
+{
+ if (*pset == NULL) {
+ *pset = PySet_New(NULL);
+ if (*pset == NULL) {
+ return -1;
+ }
+ }
+
+ PyObject *set = *pset;
+ PyObject *ref, *wr;
+ PyObject *destroy_cb;
+ wr = PyWeakref_NewRef(set, NULL);
+ if (wr == NULL) {
+ return -1;
+ }
+ destroy_cb = PyCFunction_NewEx(&_destroy_def, wr, NULL);
+ if (destroy_cb == NULL) {
+ Py_DECREF(wr);
+ return -1;
+ }
+ ref = PyWeakref_NewRef(obj, destroy_cb);
+ Py_DECREF(destroy_cb);
+ if (ref == NULL) {
+ Py_DECREF(wr);
+ return -1;
+ }
+ int ret = PySet_Add(set, ref);
+ Py_DECREF(wr);
+ Py_DECREF(ref);
+ return ret;
+}
+
+/*[clinic input]
+_abc._reset_registry
+
+ self: object
+ /
+
+Internal ABC helper to reset registry of a given class.
+
+Should be only used by refleak.py
+[clinic start generated code]*/
+
+static PyObject *
+_abc__reset_registry(PyObject *module, PyObject *self)
+/*[clinic end generated code: output=92d591a43566cc10 input=12a0b7eb339ac35c]*/
+{
+ _abc_data *impl = _get_impl(module, self);
+ if (impl == NULL) {
+ return NULL;
+ }
+ if (impl->_abc_registry != NULL && PySet_Clear(impl->_abc_registry) < 0) {
+ Py_DECREF(impl);
+ return NULL;
+ }
+ Py_DECREF(impl);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_abc._reset_caches
+
+ self: object
+ /
+
+Internal ABC helper to reset both caches of a given class.
+
+Should be only used by refleak.py
+[clinic start generated code]*/
+
+static PyObject *
+_abc__reset_caches(PyObject *module, PyObject *self)
+/*[clinic end generated code: output=f296f0d5c513f80c input=c0ac616fd8acfb6f]*/
+{
+ _abc_data *impl = _get_impl(module, self);
+ if (impl == NULL) {
+ return NULL;
+ }
+ if (impl->_abc_cache != NULL && PySet_Clear(impl->_abc_cache) < 0) {
+ Py_DECREF(impl);
+ return NULL;
+ }
+ /* also the second cache */
+ if (impl->_abc_negative_cache != NULL &&
+ PySet_Clear(impl->_abc_negative_cache) < 0) {
+ Py_DECREF(impl);
+ return NULL;
+ }
+ Py_DECREF(impl);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_abc._get_dump
+
+ self: object
+ /
+
+Internal ABC helper for cache and registry debugging.
+
+Return shallow copies of registry, of both caches, and
+negative cache version. Don't call this function directly,
+instead use ABC._dump_registry() for a nice repr.
+[clinic start generated code]*/
+
+static PyObject *
+_abc__get_dump(PyObject *module, PyObject *self)
+/*[clinic end generated code: output=9d9569a8e2c1c443 input=2c5deb1bfe9e3c79]*/
+{
+ _abc_data *impl = _get_impl(module, self);
+ if (impl == NULL) {
+ return NULL;
+ }
+ PyObject *res = Py_BuildValue("NNNK",
+ PySet_New(impl->_abc_registry),
+ PySet_New(impl->_abc_cache),
+ PySet_New(impl->_abc_negative_cache),
+ impl->_abc_negative_cache_version);
+ Py_DECREF(impl);
+ return res;
+}
+
+// Compute set of abstract method names.
+static int
+compute_abstract_methods(PyObject *self)
+{
+ int ret = -1;
+ PyObject *abstracts = PyFrozenSet_New(NULL);
+ if (abstracts == NULL) {
+ return -1;
+ }
+
+ PyObject *ns = NULL, *items = NULL, *bases = NULL; // Py_XDECREF()ed on error.
+
+ /* Stage 1: direct abstract methods. */
+ ns = PyObject_GetAttr(self, &_Py_ID(__dict__));
+ if (!ns) {
+ goto error;
+ }
+
+ // We can't use PyDict_Next(ns) even when ns is dict because
+ // _PyObject_IsAbstract() can mutate ns.
+ items = PyMapping_Items(ns);
+ if (!items) {
+ goto error;
+ }
+ assert(PyList_Check(items));
+ for (Py_ssize_t pos = 0; pos < PyList_GET_SIZE(items); pos++) {
+ PyObject *it = PySequence_Fast(
+ PyList_GET_ITEM(items, pos),
+ "items() returned non-iterable");
+ if (!it) {
+ goto error;
+ }
+ if (PySequence_Fast_GET_SIZE(it) != 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "items() returned item which size is not 2");
+ Py_DECREF(it);
+ goto error;
+ }
+
+ // borrowed
+ PyObject *key = PySequence_Fast_GET_ITEM(it, 0);
+ PyObject *value = PySequence_Fast_GET_ITEM(it, 1);
+ // items or it may be cleared while accessing __abstractmethod__
+ // So we need to keep strong reference for key
+ Py_INCREF(key);
+ int is_abstract = _PyObject_IsAbstract(value);
+ if (is_abstract < 0 ||
+ (is_abstract && PySet_Add(abstracts, key) < 0)) {
+ Py_DECREF(it);
+ Py_DECREF(key);
+ goto error;
+ }
+ Py_DECREF(key);
+ Py_DECREF(it);
+ }
+
+ /* Stage 2: inherited abstract methods. */
+ bases = PyObject_GetAttr(self, &_Py_ID(__bases__));
+ if (!bases) {
+ goto error;
+ }
+ if (!PyTuple_Check(bases)) {
+ PyErr_SetString(PyExc_TypeError, "__bases__ is not tuple");
+ goto error;
+ }
+
+ for (Py_ssize_t pos = 0; pos < PyTuple_GET_SIZE(bases); pos++) {
+ PyObject *item = PyTuple_GET_ITEM(bases, pos); // borrowed
+ PyObject *base_abstracts, *iter;
+
+ if (_PyObject_LookupAttr(item, &_Py_ID(__abstractmethods__),
+ &base_abstracts) < 0) {
+ goto error;
+ }
+ if (base_abstracts == NULL) {
+ continue;
+ }
+ if (!(iter = PyObject_GetIter(base_abstracts))) {
+ Py_DECREF(base_abstracts);
+ goto error;
+ }
+ Py_DECREF(base_abstracts);
+ PyObject *key, *value;
+ while ((key = PyIter_Next(iter))) {
+ if (_PyObject_LookupAttr(self, key, &value) < 0) {
+ Py_DECREF(key);
+ Py_DECREF(iter);
+ goto error;
+ }
+ if (value == NULL) {
+ Py_DECREF(key);
+ continue;
+ }
+
+ int is_abstract = _PyObject_IsAbstract(value);
+ Py_DECREF(value);
+ if (is_abstract < 0 ||
+ (is_abstract && PySet_Add(abstracts, key) < 0))
+ {
+ Py_DECREF(key);
+ Py_DECREF(iter);
+ goto error;
+ }
+ Py_DECREF(key);
+ }
+ Py_DECREF(iter);
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ }
+
+ if (PyObject_SetAttr(self, &_Py_ID(__abstractmethods__), abstracts) < 0) {
+ goto error;
+ }
+
+ ret = 0;
+error:
+ Py_DECREF(abstracts);
+ Py_XDECREF(ns);
+ Py_XDECREF(items);
+ Py_XDECREF(bases);
+ return ret;
+}
+
+#define COLLECTION_FLAGS (Py_TPFLAGS_SEQUENCE | Py_TPFLAGS_MAPPING)
+
+/*[clinic input]
+_abc._abc_init
+
+ self: object
+ /
+
+Internal ABC helper for class set-up. Should be never used outside abc module.
+[clinic start generated code]*/
+
+static PyObject *
+_abc__abc_init(PyObject *module, PyObject *self)
+/*[clinic end generated code: output=594757375714cda1 input=8d7fe470ff77f029]*/
+{
+ _abcmodule_state *state = get_abc_state(module);
+ PyObject *data;
+ if (compute_abstract_methods(self) < 0) {
+ return NULL;
+ }
+
+ /* Set up inheritance registry. */
+ data = abc_data_new(state->_abc_data_type, NULL, NULL);
+ if (data == NULL) {
+ return NULL;
+ }
+ if (PyObject_SetAttr(self, &_Py_ID(_abc_impl), data) < 0) {
+ Py_DECREF(data);
+ return NULL;
+ }
+ Py_DECREF(data);
+ /* If __abc_tpflags__ & COLLECTION_FLAGS is set, then set the corresponding bit(s)
+ * in the new class.
+ * Used by collections.abc.Sequence and collections.abc.Mapping to indicate
+ * their special status w.r.t. pattern matching. */
+ if (PyType_Check(self)) {
+ PyTypeObject *cls = (PyTypeObject *)self;
+ PyObject *dict = _PyType_GetDict(cls);
+ PyObject *flags = PyDict_GetItemWithError(dict,
+ &_Py_ID(__abc_tpflags__));
+ if (flags == NULL) {
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ else {
+ if (PyLong_CheckExact(flags)) {
+ long val = PyLong_AsLong(flags);
+ if (val == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ if ((val & COLLECTION_FLAGS) == COLLECTION_FLAGS) {
+ PyErr_SetString(PyExc_TypeError, "__abc_tpflags__ cannot be both Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING");
+ return NULL;
+ }
+ ((PyTypeObject *)self)->tp_flags |= (val & COLLECTION_FLAGS);
+ }
+ if (PyDict_DelItem(dict, &_Py_ID(__abc_tpflags__)) < 0) {
+ return NULL;
+ }
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+static void
+set_collection_flag_recursive(PyTypeObject *child, unsigned long flag)
+{
+ assert(flag == Py_TPFLAGS_MAPPING || flag == Py_TPFLAGS_SEQUENCE);
+ if (PyType_HasFeature(child, Py_TPFLAGS_IMMUTABLETYPE) ||
+ (child->tp_flags & COLLECTION_FLAGS) == flag)
+ {
+ return;
+ }
+
+ child->tp_flags &= ~COLLECTION_FLAGS;
+ child->tp_flags |= flag;
+
+ PyObject *grandchildren = _PyType_GetSubclasses(child);
+ if (grandchildren == NULL) {
+ return;
+ }
+
+ for (Py_ssize_t i = 0; i < PyList_GET_SIZE(grandchildren); i++) {
+ PyObject *grandchild = PyList_GET_ITEM(grandchildren, i);
+ set_collection_flag_recursive((PyTypeObject *)grandchild, flag);
+ }
+ Py_DECREF(grandchildren);
+}
+
+/*[clinic input]
+_abc._abc_register
+
+ self: object
+ subclass: object
+ /
+
+Internal ABC helper for subclasss registration. Should be never used outside abc module.
+[clinic start generated code]*/
+
+static PyObject *
+_abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass)
+/*[clinic end generated code: output=7851e7668c963524 input=ca589f8c3080e67f]*/
+{
+ if (!PyType_Check(subclass)) {
+ PyErr_SetString(PyExc_TypeError, "Can only register classes");
+ return NULL;
+ }
+ int result = PyObject_IsSubclass(subclass, self);
+ if (result > 0) {
+ return Py_NewRef(subclass); /* Already a subclass. */
+ }
+ if (result < 0) {
+ return NULL;
+ }
+ /* Subtle: test for cycles *after* testing for "already a subclass";
+ this means we allow X.register(X) and interpret it as a no-op. */
+ result = PyObject_IsSubclass(self, subclass);
+ if (result > 0) {
+ /* This would create a cycle, which is bad for the algorithm below. */
+ PyErr_SetString(PyExc_RuntimeError, "Refusing to create an inheritance cycle");
+ return NULL;
+ }
+ if (result < 0) {
+ return NULL;
+ }
+ _abc_data *impl = _get_impl(module, self);
+ if (impl == NULL) {
+ return NULL;
+ }
+ if (_add_to_weak_set(&impl->_abc_registry, subclass) < 0) {
+ Py_DECREF(impl);
+ return NULL;
+ }
+ Py_DECREF(impl);
+
+ /* Invalidate negative cache */
+ get_abc_state(module)->abc_invalidation_counter++;
+
+ /* Set Py_TPFLAGS_SEQUENCE or Py_TPFLAGS_MAPPING flag */
+ if (PyType_Check(self)) {
+ unsigned long collection_flag = ((PyTypeObject *)self)->tp_flags & COLLECTION_FLAGS;
+ if (collection_flag) {
+ set_collection_flag_recursive((PyTypeObject *)subclass, collection_flag);
+ }
+ }
+ return Py_NewRef(subclass);
+}
+
+
+/*[clinic input]
+_abc._abc_instancecheck
+
+ self: object
+ instance: object
+ /
+
+Internal ABC helper for instance checks. Should be never used outside abc module.
+[clinic start generated code]*/
+
+static PyObject *
+_abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
+ PyObject *instance)
+/*[clinic end generated code: output=b8b5148f63b6b56f input=a4f4525679261084]*/
+{
+ PyObject *subtype, *result = NULL, *subclass = NULL;
+ _abc_data *impl = _get_impl(module, self);
+ if (impl == NULL) {
+ return NULL;
+ }
+
+ subclass = PyObject_GetAttr(instance, &_Py_ID(__class__));
+ if (subclass == NULL) {
+ Py_DECREF(impl);
+ return NULL;
+ }
+ /* Inline the cache checking. */
+ int incache = _in_weak_set(impl->_abc_cache, subclass);
+ if (incache < 0) {
+ goto end;
+ }
+ if (incache > 0) {
+ result = Py_NewRef(Py_True);
+ goto end;
+ }
+ subtype = (PyObject *)Py_TYPE(instance);
+ if (subtype == subclass) {
+ if (impl->_abc_negative_cache_version == get_abc_state(module)->abc_invalidation_counter) {
+ incache = _in_weak_set(impl->_abc_negative_cache, subclass);
+ if (incache < 0) {
+ goto end;
+ }
+ if (incache > 0) {
+ result = Py_NewRef(Py_False);
+ goto end;
+ }
+ }
+ /* Fall back to the subclass check. */
+ result = PyObject_CallMethodOneArg(self, &_Py_ID(__subclasscheck__),
+ subclass);
+ goto end;
+ }
+ result = PyObject_CallMethodOneArg(self, &_Py_ID(__subclasscheck__),
+ subclass);
+ if (result == NULL) {
+ goto end;
+ }
+
+ switch (PyObject_IsTrue(result)) {
+ case -1:
+ Py_SETREF(result, NULL);
+ break;
+ case 0:
+ Py_DECREF(result);
+ result = PyObject_CallMethodOneArg(self, &_Py_ID(__subclasscheck__),
+ subtype);
+ break;
+ case 1: // Nothing to do.
+ break;
+ default:
+ Py_UNREACHABLE();
+ }
+
+end:
+ Py_XDECREF(impl);
+ Py_XDECREF(subclass);
+ return result;
+}
+
+
+// Return -1 when exception occurred.
+// Return 1 when result is set.
+// Return 0 otherwise.
+static int subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
+ PyObject **result);
+
+/*[clinic input]
+_abc._abc_subclasscheck
+
+ self: object
+ subclass: object
+ /
+
+Internal ABC helper for subclasss checks. Should be never used outside abc module.
+[clinic start generated code]*/
+
+static PyObject *
+_abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
+ PyObject *subclass)
+/*[clinic end generated code: output=b56c9e4a530e3894 input=1d947243409d10b8]*/
+{
+ if (!PyType_Check(subclass)) {
+ PyErr_SetString(PyExc_TypeError, "issubclass() arg 1 must be a class");
+ return NULL;
+ }
+
+ PyObject *ok, *subclasses = NULL, *result = NULL;
+ _abcmodule_state *state = NULL;
+ Py_ssize_t pos;
+ int incache;
+ _abc_data *impl = _get_impl(module, self);
+ if (impl == NULL) {
+ return NULL;
+ }
+
+ /* 1. Check cache. */
+ incache = _in_weak_set(impl->_abc_cache, subclass);
+ if (incache < 0) {
+ goto end;
+ }
+ if (incache > 0) {
+ result = Py_True;
+ goto end;
+ }
+
+ state = get_abc_state(module);
+ /* 2. Check negative cache; may have to invalidate. */
+ if (impl->_abc_negative_cache_version < state->abc_invalidation_counter) {
+ /* Invalidate the negative cache. */
+ if (impl->_abc_negative_cache != NULL &&
+ PySet_Clear(impl->_abc_negative_cache) < 0)
+ {
+ goto end;
+ }
+ impl->_abc_negative_cache_version = state->abc_invalidation_counter;
+ }
+ else {
+ incache = _in_weak_set(impl->_abc_negative_cache, subclass);
+ if (incache < 0) {
+ goto end;
+ }
+ if (incache > 0) {
+ result = Py_False;
+ goto end;
+ }
+ }
+
+ /* 3. Check the subclass hook. */
+ ok = PyObject_CallMethodOneArg(
+ (PyObject *)self, &_Py_ID(__subclasshook__), subclass);
+ if (ok == NULL) {
+ goto end;
+ }
+ if (ok == Py_True) {
+ Py_DECREF(ok);
+ if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) {
+ goto end;
+ }
+ result = Py_True;
+ goto end;
+ }
+ if (ok == Py_False) {
+ Py_DECREF(ok);
+ if (_add_to_weak_set(&impl->_abc_negative_cache, subclass) < 0) {
+ goto end;
+ }
+ result = Py_False;
+ goto end;
+ }
+ if (ok != Py_NotImplemented) {
+ Py_DECREF(ok);
+ PyErr_SetString(PyExc_AssertionError, "__subclasshook__ must return either"
+ " False, True, or NotImplemented");
+ goto end;
+ }
+ Py_DECREF(ok);
+
+ /* 4. Check if it's a direct subclass. */
+ PyObject *mro = _PyType_GetMRO((PyTypeObject *)subclass);
+ assert(PyTuple_Check(mro));
+ for (pos = 0; pos < PyTuple_GET_SIZE(mro); pos++) {
+ PyObject *mro_item = PyTuple_GET_ITEM(mro, pos);
+ assert(mro_item != NULL);
+ if ((PyObject *)self == mro_item) {
+ if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) {
+ goto end;
+ }
+ result = Py_True;
+ goto end;
+ }
+ }
+
+ /* 5. Check if it's a subclass of a registered class (recursive). */
+ if (subclasscheck_check_registry(impl, subclass, &result)) {
+ // Exception occurred or result is set.
+ goto end;
+ }
+
+ /* 6. Check if it's a subclass of a subclass (recursive). */
+ subclasses = PyObject_CallMethod(self, "__subclasses__", NULL);
+ if (subclasses == NULL) {
+ goto end;
+ }
+ if (!PyList_Check(subclasses)) {
+ PyErr_SetString(PyExc_TypeError, "__subclasses__() must return a list");
+ goto end;
+ }
+ for (pos = 0; pos < PyList_GET_SIZE(subclasses); pos++) {
+ PyObject *scls = PyList_GET_ITEM(subclasses, pos);
+ Py_INCREF(scls);
+ int r = PyObject_IsSubclass(subclass, scls);
+ Py_DECREF(scls);
+ if (r > 0) {
+ if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) {
+ goto end;
+ }
+ result = Py_True;
+ goto end;
+ }
+ if (r < 0) {
+ goto end;
+ }
+ }
+
+ /* No dice; update negative cache. */
+ if (_add_to_weak_set(&impl->_abc_negative_cache, subclass) < 0) {
+ goto end;
+ }
+ result = Py_False;
+
+end:
+ Py_DECREF(impl);
+ Py_XDECREF(subclasses);
+ return Py_XNewRef(result);
+}
+
+
+static int
+subclasscheck_check_registry(_abc_data *impl, PyObject *subclass,
+ PyObject **result)
+{
+ // Fast path: check subclass is in weakref directly.
+ int ret = _in_weak_set(impl->_abc_registry, subclass);
+ if (ret < 0) {
+ *result = NULL;
+ return -1;
+ }
+ if (ret > 0) {
+ *result = Py_True;
+ return 1;
+ }
+
+ if (impl->_abc_registry == NULL) {
+ return 0;
+ }
+ Py_ssize_t registry_size = PySet_Size(impl->_abc_registry);
+ if (registry_size == 0) {
+ return 0;
+ }
+ // Weakref callback may remove entry from set.
+ // So we take snapshot of registry first.
+ PyObject **copy = PyMem_Malloc(sizeof(PyObject*) * registry_size);
+ if (copy == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ PyObject *key;
+ Py_ssize_t pos = 0;
+ Py_hash_t hash;
+ Py_ssize_t i = 0;
+
+ while (_PySet_NextEntry(impl->_abc_registry, &pos, &key, &hash)) {
+ copy[i++] = Py_NewRef(key);
+ }
+ assert(i == registry_size);
+
+ for (i = 0; i < registry_size; i++) {
+ PyObject *rkey = PyWeakref_GetObject(copy[i]);
+ if (rkey == NULL) {
+ // Someone inject non-weakref type in the registry.
+ ret = -1;
+ break;
+ }
+ if (rkey == Py_None) {
+ continue;
+ }
+ Py_INCREF(rkey);
+ int r = PyObject_IsSubclass(subclass, rkey);
+ Py_DECREF(rkey);
+ if (r < 0) {
+ ret = -1;
+ break;
+ }
+ if (r > 0) {
+ if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) {
+ ret = -1;
+ break;
+ }
+ *result = Py_True;
+ ret = 1;
+ break;
+ }
+ }
+
+ for (i = 0; i < registry_size; i++) {
+ Py_DECREF(copy[i]);
+ }
+ PyMem_Free(copy);
+ return ret;
+}
+
+/*[clinic input]
+_abc.get_cache_token
+
+Returns the current ABC cache token.
+
+The token is an opaque object (supporting equality testing) identifying the
+current version of the ABC cache for virtual subclasses. The token changes
+with every call to register() on any ABC.
+[clinic start generated code]*/
+
+static PyObject *
+_abc_get_cache_token_impl(PyObject *module)
+/*[clinic end generated code: output=c7d87841e033dacc input=70413d1c423ad9f9]*/
+{
+ _abcmodule_state *state = get_abc_state(module);
+ return PyLong_FromUnsignedLongLong(state->abc_invalidation_counter);
+}
+
+static struct PyMethodDef _abcmodule_methods[] = {
+ _ABC_GET_CACHE_TOKEN_METHODDEF
+ _ABC__ABC_INIT_METHODDEF
+ _ABC__RESET_REGISTRY_METHODDEF
+ _ABC__RESET_CACHES_METHODDEF
+ _ABC__GET_DUMP_METHODDEF
+ _ABC__ABC_REGISTER_METHODDEF
+ _ABC__ABC_INSTANCECHECK_METHODDEF
+ _ABC__ABC_SUBCLASSCHECK_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+_abcmodule_exec(PyObject *module)
+{
+ _abcmodule_state *state = get_abc_state(module);
+ state->abc_invalidation_counter = 0;
+ state->_abc_data_type = (PyTypeObject *)PyType_FromModuleAndSpec(module, &_abc_data_type_spec, NULL);
+ if (state->_abc_data_type == NULL) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+_abcmodule_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _abcmodule_state *state = get_abc_state(module);
+ Py_VISIT(state->_abc_data_type);
+ return 0;
+}
+
+static int
+_abcmodule_clear(PyObject *module)
+{
+ _abcmodule_state *state = get_abc_state(module);
+ Py_CLEAR(state->_abc_data_type);
+ return 0;
+}
+
+static void
+_abcmodule_free(void *module)
+{
+ _abcmodule_clear((PyObject *)module);
+}
+
+static PyModuleDef_Slot _abcmodule_slots[] = {
+ {Py_mod_exec, _abcmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _abcmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_abc",
+ .m_doc = _abc__doc__,
+ .m_size = sizeof(_abcmodule_state),
+ .m_methods = _abcmodule_methods,
+ .m_slots = _abcmodule_slots,
+ .m_traverse = _abcmodule_traverse,
+ .m_clear = _abcmodule_clear,
+ .m_free = _abcmodule_free,
+};
+
+PyMODINIT_FUNC
+PyInit__abc(void)
+{
+ return PyModuleDef_Init(&_abcmodule);
+}
diff --git a/contrib/tools/python3/Modules/_asynciomodule.c b/contrib/tools/python3/Modules/_asynciomodule.c
new file mode 100644
index 00000000000..a465090bfaa
--- /dev/null
+++ b/contrib/tools/python3/Modules/_asynciomodule.c
@@ -0,0 +1,3815 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_runtime_init.h" // _Py_ID()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "structmember.h" // PyMemberDef
+#include <stddef.h> // offsetof()
+
+
+/*[clinic input]
+module _asyncio
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=8fd17862aa989c69]*/
+
+
+#define FI_FREELIST_MAXLEN 255
+
+typedef struct futureiterobject futureiterobject;
+
+/* State of the _asyncio module */
+typedef struct {
+ PyTypeObject *FutureIterType;
+ PyTypeObject *TaskStepMethWrapper_Type;
+ PyTypeObject *FutureType;
+ PyTypeObject *TaskType;
+
+ PyObject *asyncio_mod;
+ PyObject *context_kwname;
+
+ /* Dictionary containing tasks that are currently active in
+ all running event loops. {EventLoop: Task} */
+ PyObject *current_tasks;
+
+ /* WeakSet containing all tasks scheduled to run on event loops. */
+ PyObject *scheduled_tasks;
+
+ /* Set containing all eagerly executing tasks. */
+ PyObject *eager_tasks;
+
+ /* An isinstance type cache for the 'is_coroutine()' function. */
+ PyObject *iscoroutine_typecache;
+
+ /* Imports from asyncio.events. */
+ PyObject *asyncio_get_event_loop_policy;
+
+ /* Imports from asyncio.base_futures. */
+ PyObject *asyncio_future_repr_func;
+
+ /* Imports from asyncio.exceptions. */
+ PyObject *asyncio_CancelledError;
+ PyObject *asyncio_InvalidStateError;
+
+ /* Imports from asyncio.base_tasks. */
+ PyObject *asyncio_task_get_stack_func;
+ PyObject *asyncio_task_print_stack_func;
+ PyObject *asyncio_task_repr_func;
+
+ /* Imports from asyncio.coroutines. */
+ PyObject *asyncio_iscoroutine_func;
+
+ /* Imports from traceback. */
+ PyObject *traceback_extract_stack;
+
+ PyObject *cached_running_loop; // Borrowed reference
+ volatile uint64_t cached_running_loop_tsid;
+
+ /* Counter for autogenerated Task names */
+ uint64_t task_name_counter;
+
+ futureiterobject *fi_freelist;
+ Py_ssize_t fi_freelist_len;
+} asyncio_state;
+
+static inline asyncio_state *
+get_asyncio_state(PyObject *mod)
+{
+ asyncio_state *state = _PyModule_GetState(mod);
+ assert(state != NULL);
+ return state;
+}
+
+static inline asyncio_state *
+get_asyncio_state_by_cls(PyTypeObject *cls)
+{
+ asyncio_state *state = (asyncio_state *)_PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return state;
+}
+
+static struct PyModuleDef _asynciomodule;
+
+static inline asyncio_state *
+get_asyncio_state_by_def(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject *mod = PyType_GetModuleByDef(tp, &_asynciomodule);
+ assert(mod != NULL);
+ return get_asyncio_state(mod);
+}
+
+typedef enum {
+ STATE_PENDING,
+ STATE_CANCELLED,
+ STATE_FINISHED
+} fut_state;
+
+#define FutureObj_HEAD(prefix) \
+ PyObject_HEAD \
+ PyObject *prefix##_loop; \
+ PyObject *prefix##_callback0; \
+ PyObject *prefix##_context0; \
+ PyObject *prefix##_callbacks; \
+ PyObject *prefix##_exception; \
+ PyObject *prefix##_exception_tb; \
+ PyObject *prefix##_result; \
+ PyObject *prefix##_source_tb; \
+ PyObject *prefix##_cancel_msg; \
+ fut_state prefix##_state; \
+ int prefix##_log_tb; \
+ int prefix##_blocking; \
+ PyObject *dict; \
+ PyObject *prefix##_weakreflist; \
+ PyObject *prefix##_cancelled_exc;
+
+typedef struct {
+ FutureObj_HEAD(fut)
+} FutureObj;
+
+typedef struct {
+ FutureObj_HEAD(task)
+ PyObject *task_fut_waiter;
+ PyObject *task_coro;
+ PyObject *task_name;
+ PyObject *task_context;
+ int task_must_cancel;
+ int task_log_destroy_pending;
+ int task_num_cancels_requested;
+} TaskObj;
+
+typedef struct {
+ PyObject_HEAD
+ TaskObj *sw_task;
+ PyObject *sw_arg;
+} TaskStepMethWrapper;
+
+
+#define Future_CheckExact(state, obj) Py_IS_TYPE(obj, state->FutureType)
+#define Task_CheckExact(state, obj) Py_IS_TYPE(obj, state->TaskType)
+
+#define Future_Check(state, obj) PyObject_TypeCheck(obj, state->FutureType)
+#define Task_Check(state, obj) PyObject_TypeCheck(obj, state->TaskType)
+
+#include "clinic/_asynciomodule.c.h"
+
+
+/*[clinic input]
+class _asyncio.Future "FutureObj *" "&Future_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=00d3e4abca711e0f]*/
+
+
+/* Get FutureIter from Future */
+static PyObject * future_new_iter(PyObject *);
+
+static PyObject *
+task_step_handle_result_impl(asyncio_state *state, TaskObj *task, PyObject *result);
+
+
+static int
+_is_coroutine(asyncio_state *state, PyObject *coro)
+{
+ /* 'coro' is not a native coroutine, call asyncio.iscoroutine()
+ to check if it's another coroutine flavour.
+
+ Do this check after 'future_init()'; in case we need to raise
+ an error, __del__ needs a properly initialized object.
+ */
+ PyObject *res = PyObject_CallOneArg(state->asyncio_iscoroutine_func, coro);
+ if (res == NULL) {
+ return -1;
+ }
+
+ int is_res_true = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (is_res_true <= 0) {
+ return is_res_true;
+ }
+
+ if (PySet_GET_SIZE(state->iscoroutine_typecache) < 100) {
+ /* Just in case we don't want to cache more than 100
+ positive types. That shouldn't ever happen, unless
+ someone stressing the system on purpose.
+ */
+ if (PySet_Add(state->iscoroutine_typecache, (PyObject*) Py_TYPE(coro))) {
+ return -1;
+ }
+ }
+
+ return 1;
+}
+
+
+static inline int
+is_coroutine(asyncio_state *state, PyObject *coro)
+{
+ if (PyCoro_CheckExact(coro)) {
+ return 1;
+ }
+
+ /* Check if `type(coro)` is in the cache.
+ Caching makes is_coroutine() function almost as fast as
+ PyCoro_CheckExact() for non-native coroutine-like objects
+ (like coroutines compiled with Cython).
+
+ asyncio.iscoroutine() has its own type caching mechanism.
+ This cache allows us to avoid the cost of even calling
+ a pure-Python function in 99.9% cases.
+ */
+ int has_it = PySet_Contains(
+ state->iscoroutine_typecache, (PyObject*) Py_TYPE(coro));
+ if (has_it == 0) {
+ /* type(coro) is not in iscoroutine_typecache */
+ return _is_coroutine(state, coro);
+ }
+
+ /* either an error has occurred or
+ type(coro) is in iscoroutine_typecache
+ */
+ return has_it;
+}
+
+
+static PyObject *
+get_future_loop(asyncio_state *state, PyObject *fut)
+{
+ /* Implementation of `asyncio.futures._get_loop` */
+
+ PyObject *getloop;
+
+ if (Future_CheckExact(state, fut) || Task_CheckExact(state, fut)) {
+ PyObject *loop = ((FutureObj *)fut)->fut_loop;
+ return Py_NewRef(loop);
+ }
+
+ if (_PyObject_LookupAttr(fut, &_Py_ID(get_loop), &getloop) < 0) {
+ return NULL;
+ }
+ if (getloop != NULL) {
+ PyObject *res = PyObject_CallNoArgs(getloop);
+ Py_DECREF(getloop);
+ return res;
+ }
+
+ return PyObject_GetAttr(fut, &_Py_ID(_loop));
+}
+
+
+static int
+get_running_loop(asyncio_state *state, PyObject **loop)
+{
+ PyObject *rl;
+
+ PyThreadState *ts = _PyThreadState_GET();
+ uint64_t ts_id = PyThreadState_GetID(ts);
+ if (state->cached_running_loop_tsid == ts_id &&
+ state->cached_running_loop != NULL)
+ {
+ // Fast path, check the cache.
+ rl = state->cached_running_loop;
+ }
+ else {
+ PyObject *ts_dict = _PyThreadState_GetDict(ts); // borrowed
+ if (ts_dict == NULL) {
+ goto not_found;
+ }
+
+ rl = PyDict_GetItemWithError(
+ ts_dict, &_Py_ID(__asyncio_running_event_loop__)); // borrowed
+ if (rl == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ else {
+ goto not_found;
+ }
+ }
+
+ state->cached_running_loop = rl;
+ state->cached_running_loop_tsid = ts_id;
+ }
+
+
+ if (rl == Py_None) {
+ goto not_found;
+ }
+
+ *loop = Py_NewRef(rl);
+ return 0;
+
+not_found:
+ *loop = NULL;
+ return 0;
+
+error:
+ *loop = NULL;
+ return -1;
+}
+
+
+static int
+set_running_loop(asyncio_state *state, PyObject *loop)
+{
+ PyObject *ts_dict = NULL;
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (tstate != NULL) {
+ ts_dict = _PyThreadState_GetDict(tstate); // borrowed
+ }
+
+ if (ts_dict == NULL) {
+ PyErr_SetString(
+ PyExc_RuntimeError, "thread-local storage is not available");
+ return -1;
+ }
+ if (PyDict_SetItem(
+ ts_dict, &_Py_ID(__asyncio_running_event_loop__), loop) < 0)
+ {
+ return -1;
+ }
+
+ state->cached_running_loop = loop; // borrowed, kept alive by ts_dict
+ state->cached_running_loop_tsid = PyThreadState_GetID(tstate);
+
+ return 0;
+}
+
+
+static PyObject *
+get_event_loop(asyncio_state *state)
+{
+ PyObject *loop;
+ PyObject *policy;
+
+ if (get_running_loop(state, &loop)) {
+ return NULL;
+ }
+ if (loop != NULL) {
+ return loop;
+ }
+
+ policy = PyObject_CallNoArgs(state->asyncio_get_event_loop_policy);
+ if (policy == NULL) {
+ return NULL;
+ }
+
+ loop = PyObject_CallMethodNoArgs(policy, &_Py_ID(get_event_loop));
+ Py_DECREF(policy);
+ return loop;
+}
+
+
+static int
+call_soon(asyncio_state *state, PyObject *loop, PyObject *func, PyObject *arg,
+ PyObject *ctx)
+{
+ PyObject *handle;
+
+ if (ctx == NULL) {
+ PyObject *stack[] = {loop, func, arg};
+ size_t nargsf = 3 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ handle = PyObject_VectorcallMethod(&_Py_ID(call_soon), stack, nargsf, NULL);
+ }
+ else {
+ /* All refs in 'stack' are borrowed. */
+ PyObject *stack[4];
+ size_t nargs = 2;
+ stack[0] = loop;
+ stack[1] = func;
+ if (arg != NULL) {
+ stack[2] = arg;
+ nargs++;
+ }
+ stack[nargs] = (PyObject *)ctx;
+ size_t nargsf = nargs | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ handle = PyObject_VectorcallMethod(&_Py_ID(call_soon), stack, nargsf,
+ state->context_kwname);
+ }
+
+ if (handle == NULL) {
+ return -1;
+ }
+ Py_DECREF(handle);
+ return 0;
+}
+
+
+static inline int
+future_is_alive(FutureObj *fut)
+{
+ return fut->fut_loop != NULL;
+}
+
+
+static inline int
+future_ensure_alive(FutureObj *fut)
+{
+ if (!future_is_alive(fut)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Future object is not initialized.");
+ return -1;
+ }
+ return 0;
+}
+
+
+#define ENSURE_FUTURE_ALIVE(state, fut) \
+ do { \
+ assert(Future_Check(state, fut) || Task_Check(state, fut)); \
+ (void)state; \
+ if (future_ensure_alive((FutureObj*)fut)) { \
+ return NULL; \
+ } \
+ } while(0);
+
+
+static int
+future_schedule_callbacks(asyncio_state *state, FutureObj *fut)
+{
+ Py_ssize_t len;
+ Py_ssize_t i;
+
+ if (fut->fut_callback0 != NULL) {
+ /* There's a 1st callback */
+
+ int ret = call_soon(state,
+ fut->fut_loop, fut->fut_callback0,
+ (PyObject *)fut, fut->fut_context0);
+
+ Py_CLEAR(fut->fut_callback0);
+ Py_CLEAR(fut->fut_context0);
+ if (ret) {
+ /* If an error occurs in pure-Python implementation,
+ all callbacks are cleared. */
+ Py_CLEAR(fut->fut_callbacks);
+ return ret;
+ }
+
+ /* we called the first callback, now try calling
+ callbacks from the 'fut_callbacks' list. */
+ }
+
+ if (fut->fut_callbacks == NULL) {
+ /* No more callbacks, return. */
+ return 0;
+ }
+
+ len = PyList_GET_SIZE(fut->fut_callbacks);
+ if (len == 0) {
+ /* The list of callbacks was empty; clear it and return. */
+ Py_CLEAR(fut->fut_callbacks);
+ return 0;
+ }
+
+ for (i = 0; i < len; i++) {
+ PyObject *cb_tup = PyList_GET_ITEM(fut->fut_callbacks, i);
+ PyObject *cb = PyTuple_GET_ITEM(cb_tup, 0);
+ PyObject *ctx = PyTuple_GET_ITEM(cb_tup, 1);
+
+ if (call_soon(state, fut->fut_loop, cb, (PyObject *)fut, ctx)) {
+ /* If an error occurs in pure-Python implementation,
+ all callbacks are cleared. */
+ Py_CLEAR(fut->fut_callbacks);
+ return -1;
+ }
+ }
+
+ Py_CLEAR(fut->fut_callbacks);
+ return 0;
+}
+
+
+static int
+future_init(FutureObj *fut, PyObject *loop)
+{
+ PyObject *res;
+ int is_true;
+
+ // Same to FutureObj_clear() but not clearing fut->dict
+ Py_CLEAR(fut->fut_loop);
+ Py_CLEAR(fut->fut_callback0);
+ Py_CLEAR(fut->fut_context0);
+ Py_CLEAR(fut->fut_callbacks);
+ Py_CLEAR(fut->fut_result);
+ Py_CLEAR(fut->fut_exception);
+ Py_CLEAR(fut->fut_exception_tb);
+ Py_CLEAR(fut->fut_source_tb);
+ Py_CLEAR(fut->fut_cancel_msg);
+ Py_CLEAR(fut->fut_cancelled_exc);
+
+ fut->fut_state = STATE_PENDING;
+ fut->fut_log_tb = 0;
+ fut->fut_blocking = 0;
+
+ if (loop == Py_None) {
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ loop = get_event_loop(state);
+ if (loop == NULL) {
+ return -1;
+ }
+ }
+ else {
+ Py_INCREF(loop);
+ }
+ fut->fut_loop = loop;
+
+ res = PyObject_CallMethodNoArgs(fut->fut_loop, &_Py_ID(get_debug));
+ if (res == NULL) {
+ return -1;
+ }
+ is_true = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (is_true < 0) {
+ return -1;
+ }
+ if (is_true && !_Py_IsInterpreterFinalizing(PyInterpreterState_Get())) {
+ /* Only try to capture the traceback if the interpreter is not being
+ finalized. The original motivation to add a `_Py_IsFinalizing()`
+ call was to prevent SIGSEGV when a Future is created in a __del__
+ method, which is called during the interpreter shutdown and the
+ traceback module is already unloaded.
+ */
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ fut->fut_source_tb = PyObject_CallNoArgs(state->traceback_extract_stack);
+ if (fut->fut_source_tb == NULL) {
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static PyObject *
+future_set_result(asyncio_state *state, FutureObj *fut, PyObject *res)
+{
+ if (future_ensure_alive(fut)) {
+ return NULL;
+ }
+
+ if (fut->fut_state != STATE_PENDING) {
+ PyErr_SetString(state->asyncio_InvalidStateError, "invalid state");
+ return NULL;
+ }
+
+ assert(!fut->fut_result);
+ fut->fut_result = Py_NewRef(res);
+ fut->fut_state = STATE_FINISHED;
+
+ if (future_schedule_callbacks(state, fut) == -1) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+future_set_exception(asyncio_state *state, FutureObj *fut, PyObject *exc)
+{
+ PyObject *exc_val = NULL;
+
+ if (fut->fut_state != STATE_PENDING) {
+ PyErr_SetString(state->asyncio_InvalidStateError, "invalid state");
+ return NULL;
+ }
+
+ if (PyExceptionClass_Check(exc)) {
+ exc_val = PyObject_CallNoArgs(exc);
+ if (exc_val == NULL) {
+ return NULL;
+ }
+ if (fut->fut_state != STATE_PENDING) {
+ Py_DECREF(exc_val);
+ PyErr_SetString(state->asyncio_InvalidStateError, "invalid state");
+ return NULL;
+ }
+ }
+ else {
+ exc_val = Py_NewRef(exc);
+ }
+ if (!PyExceptionInstance_Check(exc_val)) {
+ Py_DECREF(exc_val);
+ PyErr_SetString(PyExc_TypeError, "invalid exception object");
+ return NULL;
+ }
+ if (Py_IS_TYPE(exc_val, (PyTypeObject *)PyExc_StopIteration)) {
+ Py_DECREF(exc_val);
+ PyErr_SetString(PyExc_TypeError,
+ "StopIteration interacts badly with generators "
+ "and cannot be raised into a Future");
+ return NULL;
+ }
+
+ assert(!fut->fut_exception);
+ assert(!fut->fut_exception_tb);
+ fut->fut_exception = exc_val;
+ fut->fut_exception_tb = PyException_GetTraceback(exc_val);
+ fut->fut_state = STATE_FINISHED;
+
+ if (future_schedule_callbacks(state, fut) == -1) {
+ return NULL;
+ }
+
+ fut->fut_log_tb = 1;
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+create_cancelled_error(asyncio_state *state, FutureObj *fut)
+{
+ PyObject *exc;
+ if (fut->fut_cancelled_exc != NULL) {
+ /* transfer ownership */
+ exc = fut->fut_cancelled_exc;
+ fut->fut_cancelled_exc = NULL;
+ return exc;
+ }
+ PyObject *msg = fut->fut_cancel_msg;
+ if (msg == NULL || msg == Py_None) {
+ exc = PyObject_CallNoArgs(state->asyncio_CancelledError);
+ } else {
+ exc = PyObject_CallOneArg(state->asyncio_CancelledError, msg);
+ }
+ return exc;
+}
+
+static void
+future_set_cancelled_error(asyncio_state *state, FutureObj *fut)
+{
+ PyObject *exc = create_cancelled_error(state, fut);
+ if (exc == NULL) {
+ return;
+ }
+ PyErr_SetObject(state->asyncio_CancelledError, exc);
+ Py_DECREF(exc);
+}
+
+static int
+future_get_result(asyncio_state *state, FutureObj *fut, PyObject **result)
+{
+ if (fut->fut_state == STATE_CANCELLED) {
+ future_set_cancelled_error(state, fut);
+ return -1;
+ }
+
+ if (fut->fut_state != STATE_FINISHED) {
+ PyErr_SetString(state->asyncio_InvalidStateError,
+ "Result is not set.");
+ return -1;
+ }
+
+ fut->fut_log_tb = 0;
+ if (fut->fut_exception != NULL) {
+ PyObject *tb = fut->fut_exception_tb;
+ if (tb == NULL) {
+ tb = Py_None;
+ }
+ if (PyException_SetTraceback(fut->fut_exception, tb) < 0) {
+ return -1;
+ }
+ *result = Py_NewRef(fut->fut_exception);
+ Py_CLEAR(fut->fut_exception_tb);
+ return 1;
+ }
+
+ *result = Py_NewRef(fut->fut_result);
+ return 0;
+}
+
+static PyObject *
+future_add_done_callback(asyncio_state *state, FutureObj *fut, PyObject *arg,
+ PyObject *ctx)
+{
+ if (!future_is_alive(fut)) {
+ PyErr_SetString(PyExc_RuntimeError, "uninitialized Future object");
+ return NULL;
+ }
+
+ if (fut->fut_state != STATE_PENDING) {
+ /* The future is done/cancelled, so schedule the callback
+ right away. */
+ if (call_soon(state, fut->fut_loop, arg, (PyObject*) fut, ctx)) {
+ return NULL;
+ }
+ }
+ else {
+ /* The future is pending, add a callback.
+
+ Callbacks in the future object are stored as follows:
+
+ callback0 -- a pointer to the first callback
+ callbacks -- a list of 2nd, 3rd, ... callbacks
+
+ Invariants:
+
+ * callbacks != NULL:
+ There are some callbacks in in the list. Just
+ add the new callback to it.
+
+ * callbacks == NULL and callback0 == NULL:
+ This is the first callback. Set it to callback0.
+
+ * callbacks == NULL and callback0 != NULL:
+ This is a second callback. Initialize callbacks
+ with a new list and add the new callback to it.
+ */
+
+ if (fut->fut_callbacks == NULL && fut->fut_callback0 == NULL) {
+ fut->fut_callback0 = Py_NewRef(arg);
+ fut->fut_context0 = Py_NewRef(ctx);
+ }
+ else {
+ PyObject *tup = PyTuple_New(2);
+ if (tup == NULL) {
+ return NULL;
+ }
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(tup, 0, arg);
+ Py_INCREF(ctx);
+ PyTuple_SET_ITEM(tup, 1, (PyObject *)ctx);
+
+ if (fut->fut_callbacks != NULL) {
+ int err = PyList_Append(fut->fut_callbacks, tup);
+ if (err) {
+ Py_DECREF(tup);
+ return NULL;
+ }
+ Py_DECREF(tup);
+ }
+ else {
+ fut->fut_callbacks = PyList_New(1);
+ if (fut->fut_callbacks == NULL) {
+ Py_DECREF(tup);
+ return NULL;
+ }
+
+ PyList_SET_ITEM(fut->fut_callbacks, 0, tup); /* borrow */
+ }
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+future_cancel(asyncio_state *state, FutureObj *fut, PyObject *msg)
+{
+ fut->fut_log_tb = 0;
+
+ if (fut->fut_state != STATE_PENDING) {
+ Py_RETURN_FALSE;
+ }
+ fut->fut_state = STATE_CANCELLED;
+
+ Py_XINCREF(msg);
+ Py_XSETREF(fut->fut_cancel_msg, msg);
+
+ if (future_schedule_callbacks(state, fut) == -1) {
+ return NULL;
+ }
+
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_asyncio.Future.__init__
+
+ *
+ loop: object = None
+
+This class is *almost* compatible with concurrent.futures.Future.
+
+ Differences:
+
+ - result() and exception() do not take a timeout argument and
+ raise an exception when the future isn't done yet.
+
+ - Callbacks registered with add_done_callback() are always called
+ via the event loop's call_soon_threadsafe().
+
+ - This class is not compatible with the wait() and as_completed()
+ methods in the concurrent.futures package.
+[clinic start generated code]*/
+
+static int
+_asyncio_Future___init___impl(FutureObj *self, PyObject *loop)
+/*[clinic end generated code: output=9ed75799eaccb5d6 input=89af317082bc0bf8]*/
+
+{
+ return future_init(self, loop);
+}
+
+static int
+FutureObj_clear(FutureObj *fut)
+{
+ Py_CLEAR(fut->fut_loop);
+ Py_CLEAR(fut->fut_callback0);
+ Py_CLEAR(fut->fut_context0);
+ Py_CLEAR(fut->fut_callbacks);
+ Py_CLEAR(fut->fut_result);
+ Py_CLEAR(fut->fut_exception);
+ Py_CLEAR(fut->fut_exception_tb);
+ Py_CLEAR(fut->fut_source_tb);
+ Py_CLEAR(fut->fut_cancel_msg);
+ Py_CLEAR(fut->fut_cancelled_exc);
+ Py_CLEAR(fut->dict);
+ return 0;
+}
+
+static int
+FutureObj_traverse(FutureObj *fut, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(fut));
+ Py_VISIT(fut->fut_loop);
+ Py_VISIT(fut->fut_callback0);
+ Py_VISIT(fut->fut_context0);
+ Py_VISIT(fut->fut_callbacks);
+ Py_VISIT(fut->fut_result);
+ Py_VISIT(fut->fut_exception);
+ Py_VISIT(fut->fut_exception_tb);
+ Py_VISIT(fut->fut_source_tb);
+ Py_VISIT(fut->fut_cancel_msg);
+ Py_VISIT(fut->fut_cancelled_exc);
+ Py_VISIT(fut->dict);
+ return 0;
+}
+
+/*[clinic input]
+_asyncio.Future.result
+
+Return the result this future represents.
+
+If the future has been cancelled, raises CancelledError. If the
+future's result isn't yet available, raises InvalidStateError. If
+the future is done and has an exception set, this exception is raised.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_result_impl(FutureObj *self)
+/*[clinic end generated code: output=f35f940936a4b1e5 input=49ecf9cf5ec50dc5]*/
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)self);
+ PyObject *result;
+
+ if (!future_is_alive(self)) {
+ PyErr_SetString(state->asyncio_InvalidStateError,
+ "Future object is not initialized.");
+ return NULL;
+ }
+
+ int res = future_get_result(state, self, &result);
+
+ if (res == -1) {
+ return NULL;
+ }
+
+ if (res == 0) {
+ return result;
+ }
+
+ assert(res == 1);
+
+ PyErr_SetObject(PyExceptionInstance_Class(result), result);
+ Py_DECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+_asyncio.Future.exception
+
+ cls: defining_class
+ /
+
+Return the exception that was set on this future.
+
+The exception (or None if no exception was set) is returned only if
+the future is done. If the future has been cancelled, raises
+CancelledError. If the future isn't done yet, raises
+InvalidStateError.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_exception_impl(FutureObj *self, PyTypeObject *cls)
+/*[clinic end generated code: output=ce75576b187c905b input=3faf15c22acdb60d]*/
+{
+ if (!future_is_alive(self)) {
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ PyErr_SetString(state->asyncio_InvalidStateError,
+ "Future object is not initialized.");
+ return NULL;
+ }
+
+ if (self->fut_state == STATE_CANCELLED) {
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ future_set_cancelled_error(state, self);
+ return NULL;
+ }
+
+ if (self->fut_state != STATE_FINISHED) {
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ PyErr_SetString(state->asyncio_InvalidStateError,
+ "Exception is not set.");
+ return NULL;
+ }
+
+ if (self->fut_exception != NULL) {
+ self->fut_log_tb = 0;
+ return Py_NewRef(self->fut_exception);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_asyncio.Future.set_result
+
+ cls: defining_class
+ result: object
+ /
+
+Mark the future done and set its result.
+
+If the future is already done when this method is called, raises
+InvalidStateError.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_set_result_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *result)
+/*[clinic end generated code: output=99afbbe78f99c32d input=d5a41c1e353acc2e]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ ENSURE_FUTURE_ALIVE(state, self)
+ return future_set_result(state, self, result);
+}
+
+/*[clinic input]
+_asyncio.Future.set_exception
+
+ cls: defining_class
+ exception: object
+ /
+
+Mark the future done and set an exception.
+
+If the future is already done when this method is called, raises
+InvalidStateError.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_set_exception_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *exception)
+/*[clinic end generated code: output=0a5e8b5a52f058d6 input=a245cd49d3df939b]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ ENSURE_FUTURE_ALIVE(state, self)
+ return future_set_exception(state, self, exception);
+}
+
+/*[clinic input]
+_asyncio.Future.add_done_callback
+
+ cls: defining_class
+ fn: object
+ /
+ *
+ context: object = NULL
+
+Add a callback to be run when the future becomes done.
+
+The callback is called with a single argument - the future object. If
+the future is already done when this is called, the callback is
+scheduled with call_soon.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_add_done_callback_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *fn, PyObject *context)
+/*[clinic end generated code: output=922e9a4cbd601167 input=599261c521458cc2]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ if (context == NULL) {
+ context = PyContext_CopyCurrent();
+ if (context == NULL) {
+ return NULL;
+ }
+ PyObject *res = future_add_done_callback(state, self, fn, context);
+ Py_DECREF(context);
+ return res;
+ }
+ return future_add_done_callback(state, self, fn, context);
+}
+
+/*[clinic input]
+_asyncio.Future.remove_done_callback
+
+ cls: defining_class
+ fn: object
+ /
+
+Remove all instances of a callback from the "call when done" list.
+
+Returns the number of callbacks removed.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_remove_done_callback_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *fn)
+/*[clinic end generated code: output=2da35ccabfe41b98 input=c7518709b86fc747]*/
+{
+ PyObject *newlist;
+ Py_ssize_t len, i, j=0;
+ Py_ssize_t cleared_callback0 = 0;
+
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ ENSURE_FUTURE_ALIVE(state, self)
+
+ if (self->fut_callback0 != NULL) {
+ int cmp = PyObject_RichCompareBool(self->fut_callback0, fn, Py_EQ);
+ if (cmp == -1) {
+ return NULL;
+ }
+ if (cmp == 1) {
+ /* callback0 == fn */
+ Py_CLEAR(self->fut_callback0);
+ Py_CLEAR(self->fut_context0);
+ cleared_callback0 = 1;
+ }
+ }
+
+ if (self->fut_callbacks == NULL) {
+ return PyLong_FromSsize_t(cleared_callback0);
+ }
+
+ len = PyList_GET_SIZE(self->fut_callbacks);
+ if (len == 0) {
+ Py_CLEAR(self->fut_callbacks);
+ return PyLong_FromSsize_t(cleared_callback0);
+ }
+
+ if (len == 1) {
+ PyObject *cb_tup = PyList_GET_ITEM(self->fut_callbacks, 0);
+ int cmp = PyObject_RichCompareBool(
+ PyTuple_GET_ITEM(cb_tup, 0), fn, Py_EQ);
+ if (cmp == -1) {
+ return NULL;
+ }
+ if (cmp == 1) {
+ /* callbacks[0] == fn */
+ Py_CLEAR(self->fut_callbacks);
+ return PyLong_FromSsize_t(1 + cleared_callback0);
+ }
+ /* callbacks[0] != fn and len(callbacks) == 1 */
+ return PyLong_FromSsize_t(cleared_callback0);
+ }
+
+ newlist = PyList_New(len);
+ if (newlist == NULL) {
+ return NULL;
+ }
+
+ // Beware: PyObject_RichCompareBool below may change fut_callbacks.
+ // See GH-97592.
+ for (i = 0;
+ self->fut_callbacks != NULL && i < PyList_GET_SIZE(self->fut_callbacks);
+ i++) {
+ int ret;
+ PyObject *item = PyList_GET_ITEM(self->fut_callbacks, i);
+ Py_INCREF(item);
+ ret = PyObject_RichCompareBool(PyTuple_GET_ITEM(item, 0), fn, Py_EQ);
+ if (ret == 0) {
+ if (j < len) {
+ PyList_SET_ITEM(newlist, j, item);
+ j++;
+ continue;
+ }
+ ret = PyList_Append(newlist, item);
+ }
+ Py_DECREF(item);
+ if (ret < 0) {
+ goto fail;
+ }
+ }
+
+ // Note: fut_callbacks may have been cleared.
+ if (j == 0 || self->fut_callbacks == NULL) {
+ Py_CLEAR(self->fut_callbacks);
+ Py_DECREF(newlist);
+ return PyLong_FromSsize_t(len + cleared_callback0);
+ }
+
+ if (j < len) {
+ Py_SET_SIZE(newlist, j);
+ }
+ j = PyList_GET_SIZE(newlist);
+ len = PyList_GET_SIZE(self->fut_callbacks);
+ if (j != len) {
+ if (PyList_SetSlice(self->fut_callbacks, 0, len, newlist) < 0) {
+ goto fail;
+ }
+ }
+ Py_DECREF(newlist);
+ return PyLong_FromSsize_t(len - j + cleared_callback0);
+
+fail:
+ Py_DECREF(newlist);
+ return NULL;
+}
+
+/*[clinic input]
+_asyncio.Future.cancel
+
+ cls: defining_class
+ /
+ msg: object = None
+
+Cancel the future and schedule callbacks.
+
+If the future is already done or cancelled, return False. Otherwise,
+change the future's state to cancelled, schedule the callbacks and
+return True.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_cancel_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *msg)
+/*[clinic end generated code: output=074956f35904b034 input=bba8f8b786941a94]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ ENSURE_FUTURE_ALIVE(state, self)
+ return future_cancel(state, self, msg);
+}
+
+/*[clinic input]
+_asyncio.Future.cancelled
+
+Return True if the future was cancelled.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_cancelled_impl(FutureObj *self)
+/*[clinic end generated code: output=145197ced586357d input=943ab8b7b7b17e45]*/
+{
+ if (future_is_alive(self) && self->fut_state == STATE_CANCELLED) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+/*[clinic input]
+_asyncio.Future.done
+
+Return True if the future is done.
+
+Done means either that a result / exception are available, or that the
+future was cancelled.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_done_impl(FutureObj *self)
+/*[clinic end generated code: output=244c5ac351145096 input=28d7b23fdb65d2ac]*/
+{
+ if (!future_is_alive(self) || self->fut_state == STATE_PENDING) {
+ Py_RETURN_FALSE;
+ }
+ else {
+ Py_RETURN_TRUE;
+ }
+}
+
+/*[clinic input]
+_asyncio.Future.get_loop
+
+ cls: defining_class
+ /
+
+Return the event loop the Future is bound to.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future_get_loop_impl(FutureObj *self, PyTypeObject *cls)
+/*[clinic end generated code: output=f50ea6c374d9ee97 input=163c2c498b45a1f0]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ ENSURE_FUTURE_ALIVE(state, self)
+ return Py_NewRef(self->fut_loop);
+}
+
+static PyObject *
+FutureObj_get_blocking(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ if (future_is_alive(fut) && fut->fut_blocking) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static int
+FutureObj_set_blocking(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored))
+{
+ if (future_ensure_alive(fut)) {
+ return -1;
+ }
+ if (val == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+
+ int is_true = PyObject_IsTrue(val);
+ if (is_true < 0) {
+ return -1;
+ }
+ fut->fut_blocking = is_true;
+ return 0;
+}
+
+static PyObject *
+FutureObj_get_log_traceback(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ ENSURE_FUTURE_ALIVE(state, fut)
+ if (fut->fut_log_tb) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static int
+FutureObj_set_log_traceback(FutureObj *fut, PyObject *val, void *Py_UNUSED(ignored))
+{
+ if (val == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ int is_true = PyObject_IsTrue(val);
+ if (is_true < 0) {
+ return -1;
+ }
+ if (is_true) {
+ PyErr_SetString(PyExc_ValueError,
+ "_log_traceback can only be set to False");
+ return -1;
+ }
+ fut->fut_log_tb = is_true;
+ return 0;
+}
+
+static PyObject *
+FutureObj_get_loop(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ if (!future_is_alive(fut)) {
+ Py_RETURN_NONE;
+ }
+ return Py_NewRef(fut->fut_loop);
+}
+
+static PyObject *
+FutureObj_get_callbacks(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ Py_ssize_t i;
+
+ ENSURE_FUTURE_ALIVE(state, fut)
+
+ if (fut->fut_callback0 == NULL) {
+ if (fut->fut_callbacks == NULL) {
+ Py_RETURN_NONE;
+ }
+
+ return Py_NewRef(fut->fut_callbacks);
+ }
+
+ Py_ssize_t len = 1;
+ if (fut->fut_callbacks != NULL) {
+ len += PyList_GET_SIZE(fut->fut_callbacks);
+ }
+
+
+ PyObject *new_list = PyList_New(len);
+ if (new_list == NULL) {
+ return NULL;
+ }
+
+ PyObject *tup0 = PyTuple_New(2);
+ if (tup0 == NULL) {
+ Py_DECREF(new_list);
+ return NULL;
+ }
+
+ Py_INCREF(fut->fut_callback0);
+ PyTuple_SET_ITEM(tup0, 0, fut->fut_callback0);
+ assert(fut->fut_context0 != NULL);
+ Py_INCREF(fut->fut_context0);
+ PyTuple_SET_ITEM(tup0, 1, (PyObject *)fut->fut_context0);
+
+ PyList_SET_ITEM(new_list, 0, tup0);
+
+ if (fut->fut_callbacks != NULL) {
+ for (i = 0; i < PyList_GET_SIZE(fut->fut_callbacks); i++) {
+ PyObject *cb = PyList_GET_ITEM(fut->fut_callbacks, i);
+ Py_INCREF(cb);
+ PyList_SET_ITEM(new_list, i + 1, cb);
+ }
+ }
+
+ return new_list;
+}
+
+static PyObject *
+FutureObj_get_result(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ ENSURE_FUTURE_ALIVE(state, fut)
+ if (fut->fut_result == NULL) {
+ Py_RETURN_NONE;
+ }
+ return Py_NewRef(fut->fut_result);
+}
+
+static PyObject *
+FutureObj_get_exception(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ ENSURE_FUTURE_ALIVE(state, fut)
+ if (fut->fut_exception == NULL) {
+ Py_RETURN_NONE;
+ }
+ return Py_NewRef(fut->fut_exception);
+}
+
+static PyObject *
+FutureObj_get_source_traceback(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ if (!future_is_alive(fut) || fut->fut_source_tb == NULL) {
+ Py_RETURN_NONE;
+ }
+ return Py_NewRef(fut->fut_source_tb);
+}
+
+static PyObject *
+FutureObj_get_cancel_message(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ if (fut->fut_cancel_msg == NULL) {
+ Py_RETURN_NONE;
+ }
+ return Py_NewRef(fut->fut_cancel_msg);
+}
+
+static int
+FutureObj_set_cancel_message(FutureObj *fut, PyObject *msg,
+ void *Py_UNUSED(ignored))
+{
+ if (msg == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ Py_INCREF(msg);
+ Py_XSETREF(fut->fut_cancel_msg, msg);
+ return 0;
+}
+
+static PyObject *
+FutureObj_get_state(FutureObj *fut, void *Py_UNUSED(ignored))
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ PyObject *ret = NULL;
+
+ ENSURE_FUTURE_ALIVE(state, fut)
+
+ switch (fut->fut_state) {
+ case STATE_PENDING:
+ ret = &_Py_ID(PENDING);
+ break;
+ case STATE_CANCELLED:
+ ret = &_Py_ID(CANCELLED);
+ break;
+ case STATE_FINISHED:
+ ret = &_Py_ID(FINISHED);
+ break;
+ default:
+ assert (0);
+ }
+ return Py_XNewRef(ret);
+}
+
+static PyObject *
+FutureObj_repr(FutureObj *fut)
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ ENSURE_FUTURE_ALIVE(state, fut)
+ return PyObject_CallOneArg(state->asyncio_future_repr_func, (PyObject *)fut);
+}
+
+/*[clinic input]
+_asyncio.Future._make_cancelled_error
+
+Create the CancelledError to raise if the Future is cancelled.
+
+This should only be called once when handling a cancellation since
+it erases the context exception value.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Future__make_cancelled_error_impl(FutureObj *self)
+/*[clinic end generated code: output=a5df276f6c1213de input=ac6effe4ba795ecc]*/
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)self);
+ return create_cancelled_error(state, self);
+}
+
+static void
+FutureObj_finalize(FutureObj *fut)
+{
+ PyObject *context;
+ PyObject *message = NULL;
+ PyObject *func;
+
+ if (!fut->fut_log_tb) {
+ return;
+ }
+ assert(fut->fut_exception != NULL);
+ fut->fut_log_tb = 0;
+
+ /* Save the current exception, if any. */
+ PyObject *exc = PyErr_GetRaisedException();
+
+ context = PyDict_New();
+ if (context == NULL) {
+ goto finally;
+ }
+
+ message = PyUnicode_FromFormat(
+ "%s exception was never retrieved", _PyType_Name(Py_TYPE(fut)));
+ if (message == NULL) {
+ goto finally;
+ }
+
+ if (PyDict_SetItem(context, &_Py_ID(message), message) < 0 ||
+ PyDict_SetItem(context, &_Py_ID(exception), fut->fut_exception) < 0 ||
+ PyDict_SetItem(context, &_Py_ID(future), (PyObject*)fut) < 0) {
+ goto finally;
+ }
+ if (fut->fut_source_tb != NULL) {
+ if (PyDict_SetItem(context, &_Py_ID(source_traceback),
+ fut->fut_source_tb) < 0) {
+ goto finally;
+ }
+ }
+
+ func = PyObject_GetAttr(fut->fut_loop, &_Py_ID(call_exception_handler));
+ if (func != NULL) {
+ PyObject *res = PyObject_CallOneArg(func, context);
+ if (res == NULL) {
+ PyErr_WriteUnraisable(func);
+ }
+ else {
+ Py_DECREF(res);
+ }
+ Py_DECREF(func);
+ }
+
+finally:
+ Py_XDECREF(context);
+ Py_XDECREF(message);
+
+ /* Restore the saved exception. */
+ PyErr_SetRaisedException(exc);
+}
+
+static PyMethodDef FutureType_methods[] = {
+ _ASYNCIO_FUTURE_RESULT_METHODDEF
+ _ASYNCIO_FUTURE_EXCEPTION_METHODDEF
+ _ASYNCIO_FUTURE_SET_RESULT_METHODDEF
+ _ASYNCIO_FUTURE_SET_EXCEPTION_METHODDEF
+ _ASYNCIO_FUTURE_ADD_DONE_CALLBACK_METHODDEF
+ _ASYNCIO_FUTURE_REMOVE_DONE_CALLBACK_METHODDEF
+ _ASYNCIO_FUTURE_CANCEL_METHODDEF
+ _ASYNCIO_FUTURE_CANCELLED_METHODDEF
+ _ASYNCIO_FUTURE_DONE_METHODDEF
+ _ASYNCIO_FUTURE_GET_LOOP_METHODDEF
+ _ASYNCIO_FUTURE__MAKE_CANCELLED_ERROR_METHODDEF
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* Sentinel */
+};
+
+static PyMemberDef FutureType_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(FutureObj, fut_weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(FutureObj, dict), READONLY},
+ {NULL},
+};
+
+#define FUTURE_COMMON_GETSETLIST \
+ {"_state", (getter)FutureObj_get_state, NULL, NULL}, \
+ {"_asyncio_future_blocking", (getter)FutureObj_get_blocking, \
+ (setter)FutureObj_set_blocking, NULL}, \
+ {"_loop", (getter)FutureObj_get_loop, NULL, NULL}, \
+ {"_callbacks", (getter)FutureObj_get_callbacks, NULL, NULL}, \
+ {"_result", (getter)FutureObj_get_result, NULL, NULL}, \
+ {"_exception", (getter)FutureObj_get_exception, NULL, NULL}, \
+ {"_log_traceback", (getter)FutureObj_get_log_traceback, \
+ (setter)FutureObj_set_log_traceback, NULL}, \
+ {"_source_traceback", (getter)FutureObj_get_source_traceback, \
+ NULL, NULL}, \
+ {"_cancel_message", (getter)FutureObj_get_cancel_message, \
+ (setter)FutureObj_set_cancel_message, NULL},
+
+static PyGetSetDef FutureType_getsetlist[] = {
+ FUTURE_COMMON_GETSETLIST
+ {NULL} /* Sentinel */
+};
+
+static void FutureObj_dealloc(PyObject *self);
+
+static PyType_Slot Future_slots[] = {
+ {Py_tp_dealloc, FutureObj_dealloc},
+ {Py_tp_repr, (reprfunc)FutureObj_repr},
+ {Py_tp_doc, (void *)_asyncio_Future___init____doc__},
+ {Py_tp_traverse, (traverseproc)FutureObj_traverse},
+ {Py_tp_clear, (inquiry)FutureObj_clear},
+ {Py_tp_iter, (getiterfunc)future_new_iter},
+ {Py_tp_methods, FutureType_methods},
+ {Py_tp_members, FutureType_members},
+ {Py_tp_getset, FutureType_getsetlist},
+ {Py_tp_init, (initproc)_asyncio_Future___init__},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_finalize, (destructor)FutureObj_finalize},
+
+ // async slots
+ {Py_am_await, (unaryfunc)future_new_iter},
+ {0, NULL},
+};
+
+static PyType_Spec Future_spec = {
+ .name = "_asyncio.Future",
+ .basicsize = sizeof(FutureObj),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = Future_slots,
+};
+
+static void
+FutureObj_dealloc(PyObject *self)
+{
+ FutureObj *fut = (FutureObj *)self;
+
+ if (PyObject_CallFinalizerFromDealloc(self) < 0) {
+ // resurrected.
+ return;
+ }
+
+ PyTypeObject *tp = Py_TYPE(fut);
+ PyObject_GC_UnTrack(self);
+
+ if (fut->fut_weakreflist != NULL) {
+ PyObject_ClearWeakRefs(self);
+ }
+
+ (void)FutureObj_clear(fut);
+ tp->tp_free(fut);
+ Py_DECREF(tp);
+}
+
+
+/*********************** Future Iterator **************************/
+
+typedef struct futureiterobject {
+ PyObject_HEAD
+ FutureObj *future;
+} futureiterobject;
+
+
+static void
+FutureIter_dealloc(futureiterobject *it)
+{
+ PyTypeObject *tp = Py_TYPE(it);
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)it);
+ PyObject_GC_UnTrack(it);
+ tp->tp_clear((PyObject *)it);
+
+ if (state->fi_freelist_len < FI_FREELIST_MAXLEN) {
+ state->fi_freelist_len++;
+ it->future = (FutureObj*) state->fi_freelist;
+ state->fi_freelist = it;
+ }
+ else {
+ PyObject_GC_Del(it);
+ Py_DECREF(tp);
+ }
+}
+
+static PySendResult
+FutureIter_am_send(futureiterobject *it,
+ PyObject *Py_UNUSED(arg),
+ PyObject **result)
+{
+ /* arg is unused, see the comment on FutureIter_send for clarification */
+
+ PyObject *res;
+ FutureObj *fut = it->future;
+
+ *result = NULL;
+ if (fut == NULL) {
+ return PYGEN_ERROR;
+ }
+
+ if (fut->fut_state == STATE_PENDING) {
+ if (!fut->fut_blocking) {
+ fut->fut_blocking = 1;
+ *result = Py_NewRef(fut);
+ return PYGEN_NEXT;
+ }
+ PyErr_SetString(PyExc_RuntimeError,
+ "await wasn't used with future");
+ return PYGEN_ERROR;
+ }
+
+ it->future = NULL;
+ res = _asyncio_Future_result_impl(fut);
+ if (res != NULL) {
+ Py_DECREF(fut);
+ *result = res;
+ return PYGEN_RETURN;
+ }
+
+ Py_DECREF(fut);
+ return PYGEN_ERROR;
+}
+
+static PyObject *
+FutureIter_iternext(futureiterobject *it)
+{
+ PyObject *result;
+ switch (FutureIter_am_send(it, Py_None, &result)) {
+ case PYGEN_RETURN:
+ (void)_PyGen_SetStopIterationValue(result);
+ Py_DECREF(result);
+ return NULL;
+ case PYGEN_NEXT:
+ return result;
+ case PYGEN_ERROR:
+ return NULL;
+ default:
+ Py_UNREACHABLE();
+ }
+}
+
+static PyObject *
+FutureIter_send(futureiterobject *self, PyObject *unused)
+{
+ /* Future.__iter__ doesn't care about values that are pushed to the
+ * generator, it just returns self.result().
+ */
+ return FutureIter_iternext(self);
+}
+
+static PyObject *
+FutureIter_throw(futureiterobject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *type, *val = NULL, *tb = NULL;
+ if (!_PyArg_CheckPositional("throw", nargs, 1, 3)) {
+ return NULL;
+ }
+ if (nargs > 1) {
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "the (type, exc, tb) signature of throw() is deprecated, "
+ "use the single-arg signature instead.",
+ 1) < 0) {
+ return NULL;
+ }
+ }
+
+ type = args[0];
+ if (nargs == 3) {
+ val = args[1];
+ tb = args[2];
+ }
+ else if (nargs == 2) {
+ val = args[1];
+ }
+
+ if (val == Py_None) {
+ val = NULL;
+ }
+ if (tb == Py_None ) {
+ tb = NULL;
+ } else if (tb != NULL && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError, "throw() third argument must be a traceback");
+ return NULL;
+ }
+
+ Py_INCREF(type);
+ Py_XINCREF(val);
+ Py_XINCREF(tb);
+
+ if (PyExceptionClass_Check(type)) {
+ PyErr_NormalizeException(&type, &val, &tb);
+ /* No need to call PyException_SetTraceback since we'll be calling
+ PyErr_Restore for `type`, `val`, and `tb`. */
+ } else if (PyExceptionInstance_Check(type)) {
+ if (val) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto fail;
+ }
+ val = type;
+ type = PyExceptionInstance_Class(type);
+ Py_INCREF(type);
+ if (tb == NULL)
+ tb = PyException_GetTraceback(val);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exceptions must be classes deriving BaseException or "
+ "instances of such a class");
+ goto fail;
+ }
+
+ Py_CLEAR(self->future);
+
+ PyErr_Restore(type, val, tb);
+
+ return NULL;
+
+ fail:
+ Py_DECREF(type);
+ Py_XDECREF(val);
+ Py_XDECREF(tb);
+ return NULL;
+}
+
+static int
+FutureIter_clear(futureiterobject *it)
+{
+ Py_CLEAR(it->future);
+ return 0;
+}
+
+static PyObject *
+FutureIter_close(futureiterobject *self, PyObject *arg)
+{
+ (void)FutureIter_clear(self);
+ Py_RETURN_NONE;
+}
+
+static int
+FutureIter_traverse(futureiterobject *it, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(it));
+ Py_VISIT(it->future);
+ return 0;
+}
+
+static PyMethodDef FutureIter_methods[] = {
+ {"send", (PyCFunction)FutureIter_send, METH_O, NULL},
+ {"throw", _PyCFunction_CAST(FutureIter_throw), METH_FASTCALL, NULL},
+ {"close", (PyCFunction)FutureIter_close, METH_NOARGS, NULL},
+ {NULL, NULL} /* Sentinel */
+};
+
+static PyType_Slot FutureIter_slots[] = {
+ {Py_tp_dealloc, (destructor)FutureIter_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, (traverseproc)FutureIter_traverse},
+ {Py_tp_clear, FutureIter_clear},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, (iternextfunc)FutureIter_iternext},
+ {Py_tp_methods, FutureIter_methods},
+
+ // async methods
+ {Py_am_send, (sendfunc)FutureIter_am_send},
+ {0, NULL},
+};
+
+static PyType_Spec FutureIter_spec = {
+ .name = "_asyncio.FutureIter",
+ .basicsize = sizeof(futureiterobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = FutureIter_slots,
+};
+
+static PyObject *
+future_new_iter(PyObject *fut)
+{
+ futureiterobject *it;
+
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)fut);
+ ENSURE_FUTURE_ALIVE(state, fut)
+
+ if (state->fi_freelist_len) {
+ state->fi_freelist_len--;
+ it = state->fi_freelist;
+ state->fi_freelist = (futureiterobject*) it->future;
+ it->future = NULL;
+ _Py_NewReference((PyObject*) it);
+ }
+ else {
+ it = PyObject_GC_New(futureiterobject, state->FutureIterType);
+ if (it == NULL) {
+ return NULL;
+ }
+ }
+
+ it->future = (FutureObj*)Py_NewRef(fut);
+ PyObject_GC_Track(it);
+ return (PyObject*)it;
+}
+
+
+/*********************** Task **************************/
+
+
+/*[clinic input]
+class _asyncio.Task "TaskObj *" "&Task_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=719dcef0fcc03b37]*/
+
+static int task_call_step_soon(asyncio_state *state, TaskObj *, PyObject *);
+static PyObject * task_wakeup(TaskObj *, PyObject *);
+static PyObject * task_step(asyncio_state *, TaskObj *, PyObject *);
+static int task_eager_start(asyncio_state *state, TaskObj *task);
+
+/* ----- Task._step wrapper */
+
+static int
+TaskStepMethWrapper_clear(TaskStepMethWrapper *o)
+{
+ Py_CLEAR(o->sw_task);
+ Py_CLEAR(o->sw_arg);
+ return 0;
+}
+
+static void
+TaskStepMethWrapper_dealloc(TaskStepMethWrapper *o)
+{
+ PyTypeObject *tp = Py_TYPE(o);
+ PyObject_GC_UnTrack(o);
+ (void)TaskStepMethWrapper_clear(o);
+ Py_TYPE(o)->tp_free(o);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+TaskStepMethWrapper_call(TaskStepMethWrapper *o,
+ PyObject *args, PyObject *kwds)
+{
+ if (kwds != NULL && PyDict_GET_SIZE(kwds) != 0) {
+ PyErr_SetString(PyExc_TypeError, "function takes no keyword arguments");
+ return NULL;
+ }
+ if (args != NULL && PyTuple_GET_SIZE(args) != 0) {
+ PyErr_SetString(PyExc_TypeError, "function takes no positional arguments");
+ return NULL;
+ }
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)o);
+ return task_step(state, o->sw_task, o->sw_arg);
+}
+
+static int
+TaskStepMethWrapper_traverse(TaskStepMethWrapper *o,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(o));
+ Py_VISIT(o->sw_task);
+ Py_VISIT(o->sw_arg);
+ return 0;
+}
+
+static PyObject *
+TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored))
+{
+ if (o->sw_task) {
+ return Py_NewRef(o->sw_task);
+ }
+ Py_RETURN_NONE;
+}
+
+static PyGetSetDef TaskStepMethWrapper_getsetlist[] = {
+ {"__self__", (getter)TaskStepMethWrapper_get___self__, NULL, NULL},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot TaskStepMethWrapper_slots[] = {
+ {Py_tp_getset, TaskStepMethWrapper_getsetlist},
+ {Py_tp_dealloc, (destructor)TaskStepMethWrapper_dealloc},
+ {Py_tp_call, (ternaryfunc)TaskStepMethWrapper_call},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, (traverseproc)TaskStepMethWrapper_traverse},
+ {Py_tp_clear, (inquiry)TaskStepMethWrapper_clear},
+ {0, NULL},
+};
+
+static PyType_Spec TaskStepMethWrapper_spec = {
+ .name = "_asyncio.TaskStepMethWrapper",
+ .basicsize = sizeof(TaskStepMethWrapper),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = TaskStepMethWrapper_slots,
+};
+
+static PyObject *
+TaskStepMethWrapper_new(TaskObj *task, PyObject *arg)
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)task);
+ TaskStepMethWrapper *o;
+ o = PyObject_GC_New(TaskStepMethWrapper, state->TaskStepMethWrapper_Type);
+ if (o == NULL) {
+ return NULL;
+ }
+
+ o->sw_task = (TaskObj*)Py_NewRef(task);
+ o->sw_arg = Py_XNewRef(arg);
+
+ PyObject_GC_Track(o);
+ return (PyObject*) o;
+}
+
+/* ----- Task._wakeup implementation */
+
+static PyMethodDef TaskWakeupDef = {
+ "task_wakeup",
+ (PyCFunction)task_wakeup,
+ METH_O,
+ NULL
+};
+
+/* ----- Task introspection helpers */
+
+static int
+register_task(asyncio_state *state, PyObject *task)
+{
+ PyObject *res = PyObject_CallMethodOneArg(state->scheduled_tasks,
+ &_Py_ID(add), task);
+ if (res == NULL) {
+ return -1;
+ }
+ Py_DECREF(res);
+ return 0;
+}
+
+static int
+register_eager_task(asyncio_state *state, PyObject *task)
+{
+ return PySet_Add(state->eager_tasks, task);
+}
+
+static int
+unregister_task(asyncio_state *state, PyObject *task)
+{
+ PyObject *res = PyObject_CallMethodOneArg(state->scheduled_tasks,
+ &_Py_ID(discard), task);
+ if (res == NULL) {
+ return -1;
+ }
+ Py_DECREF(res);
+ return 0;
+}
+
+static int
+unregister_eager_task(asyncio_state *state, PyObject *task)
+{
+ return PySet_Discard(state->eager_tasks, task);
+}
+
+static int
+enter_task(asyncio_state *state, PyObject *loop, PyObject *task)
+{
+ PyObject *item;
+ Py_hash_t hash;
+ hash = PyObject_Hash(loop);
+ if (hash == -1) {
+ return -1;
+ }
+ item = _PyDict_GetItem_KnownHash(state->current_tasks, loop, hash);
+ if (item != NULL) {
+ Py_INCREF(item);
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "Cannot enter into task %R while another " \
+ "task %R is being executed.",
+ task, item, NULL);
+ Py_DECREF(item);
+ return -1;
+ }
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return _PyDict_SetItem_KnownHash(state->current_tasks, loop, task, hash);
+}
+
+
+static int
+leave_task(asyncio_state *state, PyObject *loop, PyObject *task)
+/*[clinic end generated code: output=0ebf6db4b858fb41 input=51296a46313d1ad8]*/
+{
+ PyObject *item;
+ Py_hash_t hash;
+ hash = PyObject_Hash(loop);
+ if (hash == -1) {
+ return -1;
+ }
+ item = _PyDict_GetItem_KnownHash(state->current_tasks, loop, hash);
+ if (item != task) {
+ if (item == NULL) {
+ /* Not entered, replace with None */
+ item = Py_None;
+ }
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "Leaving task %R does not match the current task %R.",
+ task, item, NULL);
+ return -1;
+ }
+ return _PyDict_DelItem_KnownHash(state->current_tasks, loop, hash);
+}
+
+static PyObject *
+swap_current_task(asyncio_state *state, PyObject *loop, PyObject *task)
+{
+ PyObject *prev_task;
+ Py_hash_t hash;
+ hash = PyObject_Hash(loop);
+ if (hash == -1) {
+ return NULL;
+ }
+
+ prev_task = _PyDict_GetItem_KnownHash(state->current_tasks, loop, hash);
+ if (prev_task == NULL) {
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ prev_task = Py_None;
+ }
+ Py_INCREF(prev_task);
+
+ if (task == Py_None) {
+ if (_PyDict_DelItem_KnownHash(state->current_tasks, loop, hash) == -1) {
+ goto error;
+ }
+ } else {
+ if (_PyDict_SetItem_KnownHash(state->current_tasks, loop, task, hash) == -1) {
+ goto error;
+ }
+ }
+
+ return prev_task;
+
+error:
+ Py_DECREF(prev_task);
+ return NULL;
+}
+
+/* ----- Task */
+
+/*[clinic input]
+_asyncio.Task.__init__
+
+ coro: object
+ *
+ loop: object = None
+ name: object = None
+ context: object = None
+ eager_start: bool = False
+
+A coroutine wrapped in a Future.
+[clinic start generated code]*/
+
+static int
+_asyncio_Task___init___impl(TaskObj *self, PyObject *coro, PyObject *loop,
+ PyObject *name, PyObject *context,
+ int eager_start)
+/*[clinic end generated code: output=7aced2d27836f1a1 input=18e3f113a51b829d]*/
+{
+ if (future_init((FutureObj*)self, loop)) {
+ return -1;
+ }
+
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)self);
+ int is_coro = is_coroutine(state, coro);
+ if (is_coro == -1) {
+ return -1;
+ }
+ if (is_coro == 0) {
+ self->task_log_destroy_pending = 0;
+ PyErr_Format(PyExc_TypeError,
+ "a coroutine was expected, got %R",
+ coro, NULL);
+ return -1;
+ }
+
+ if (context == Py_None) {
+ Py_XSETREF(self->task_context, PyContext_CopyCurrent());
+ if (self->task_context == NULL) {
+ return -1;
+ }
+ } else {
+ self->task_context = Py_NewRef(context);
+ }
+
+ Py_CLEAR(self->task_fut_waiter);
+ self->task_must_cancel = 0;
+ self->task_log_destroy_pending = 1;
+ self->task_num_cancels_requested = 0;
+ Py_INCREF(coro);
+ Py_XSETREF(self->task_coro, coro);
+
+ if (name == Py_None) {
+ // optimization: defer task name formatting
+ // store the task counter as PyLong in the name
+ // for deferred formatting in get_name
+ name = PyLong_FromUnsignedLongLong(++state->task_name_counter);
+ } else if (!PyUnicode_CheckExact(name)) {
+ name = PyObject_Str(name);
+ } else {
+ Py_INCREF(name);
+ }
+ Py_XSETREF(self->task_name, name);
+ if (self->task_name == NULL) {
+ return -1;
+ }
+
+ if (eager_start) {
+ PyObject *res = PyObject_CallMethodNoArgs(loop, &_Py_ID(is_running));
+ if (res == NULL) {
+ return -1;
+ }
+ int is_loop_running = Py_IsTrue(res);
+ Py_DECREF(res);
+ if (is_loop_running) {
+ if (task_eager_start(state, self)) {
+ return -1;
+ }
+ return 0;
+ }
+ }
+
+ if (task_call_step_soon(state, self, NULL)) {
+ return -1;
+ }
+ return register_task(state, (PyObject*)self);
+}
+
+static int
+TaskObj_clear(TaskObj *task)
+{
+ (void)FutureObj_clear((FutureObj*) task);
+ Py_CLEAR(task->task_context);
+ Py_CLEAR(task->task_coro);
+ Py_CLEAR(task->task_name);
+ Py_CLEAR(task->task_fut_waiter);
+ return 0;
+}
+
+static int
+TaskObj_traverse(TaskObj *task, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(task));
+ Py_VISIT(task->task_context);
+ Py_VISIT(task->task_coro);
+ Py_VISIT(task->task_name);
+ Py_VISIT(task->task_fut_waiter);
+ FutureObj *fut = (FutureObj *)task;
+ Py_VISIT(fut->fut_loop);
+ Py_VISIT(fut->fut_callback0);
+ Py_VISIT(fut->fut_context0);
+ Py_VISIT(fut->fut_callbacks);
+ Py_VISIT(fut->fut_result);
+ Py_VISIT(fut->fut_exception);
+ Py_VISIT(fut->fut_exception_tb);
+ Py_VISIT(fut->fut_source_tb);
+ Py_VISIT(fut->fut_cancel_msg);
+ Py_VISIT(fut->fut_cancelled_exc);
+ Py_VISIT(fut->dict);
+ return 0;
+}
+
+static PyObject *
+TaskObj_get_log_destroy_pending(TaskObj *task, void *Py_UNUSED(ignored))
+{
+ if (task->task_log_destroy_pending) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static int
+TaskObj_set_log_destroy_pending(TaskObj *task, PyObject *val, void *Py_UNUSED(ignored))
+{
+ if (val == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ int is_true = PyObject_IsTrue(val);
+ if (is_true < 0) {
+ return -1;
+ }
+ task->task_log_destroy_pending = is_true;
+ return 0;
+}
+
+static PyObject *
+TaskObj_get_must_cancel(TaskObj *task, void *Py_UNUSED(ignored))
+{
+ if (task->task_must_cancel) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static PyObject *
+TaskObj_get_coro(TaskObj *task, void *Py_UNUSED(ignored))
+{
+ if (task->task_coro) {
+ return Py_NewRef(task->task_coro);
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+TaskObj_get_fut_waiter(TaskObj *task, void *Py_UNUSED(ignored))
+{
+ if (task->task_fut_waiter) {
+ return Py_NewRef(task->task_fut_waiter);
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+TaskObj_repr(TaskObj *task)
+{
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)task);
+ return PyObject_CallOneArg(state->asyncio_task_repr_func,
+ (PyObject *)task);
+}
+
+
+/*[clinic input]
+_asyncio.Task._make_cancelled_error
+
+Create the CancelledError to raise if the Task is cancelled.
+
+This should only be called once when handling a cancellation since
+it erases the context exception value.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task__make_cancelled_error_impl(TaskObj *self)
+/*[clinic end generated code: output=55a819e8b4276fab input=52c0e32de8e2f840]*/
+{
+ FutureObj *fut = (FutureObj*)self;
+ return _asyncio_Future__make_cancelled_error_impl(fut);
+}
+
+
+/*[clinic input]
+_asyncio.Task.cancel
+
+ msg: object = None
+
+Request that this task cancel itself.
+
+This arranges for a CancelledError to be thrown into the
+wrapped coroutine on the next cycle through the event loop.
+The coroutine then has a chance to clean up or even deny
+the request using try/except/finally.
+
+Unlike Future.cancel, this does not guarantee that the
+task will be cancelled: the exception might be caught and
+acted upon, delaying cancellation of the task or preventing
+cancellation completely. The task may also return a value or
+raise a different exception.
+
+Immediately after this method is called, Task.cancelled() will
+not return True (unless the task was already cancelled). A
+task will be marked as cancelled when the wrapped coroutine
+terminates with a CancelledError exception (even if cancel()
+was not called).
+
+This also increases the task's count of cancellation requests.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_cancel_impl(TaskObj *self, PyObject *msg)
+/*[clinic end generated code: output=c66b60d41c74f9f1 input=7bb51bf25974c783]*/
+{
+ self->task_log_tb = 0;
+
+ if (self->task_state != STATE_PENDING) {
+ Py_RETURN_FALSE;
+ }
+
+ self->task_num_cancels_requested += 1;
+
+ // These three lines are controversial. See discussion starting at
+ // https://github.com/python/cpython/pull/31394#issuecomment-1053545331
+ // and corresponding code in tasks.py.
+ // if (self->task_num_cancels_requested > 1) {
+ // Py_RETURN_FALSE;
+ // }
+
+ if (self->task_fut_waiter) {
+ PyObject *res;
+ int is_true;
+
+ res = PyObject_CallMethodOneArg(self->task_fut_waiter,
+ &_Py_ID(cancel), msg);
+ if (res == NULL) {
+ return NULL;
+ }
+
+ is_true = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (is_true < 0) {
+ return NULL;
+ }
+
+ if (is_true) {
+ Py_RETURN_TRUE;
+ }
+ }
+
+ self->task_must_cancel = 1;
+ Py_XINCREF(msg);
+ Py_XSETREF(self->task_cancel_msg, msg);
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_asyncio.Task.cancelling
+
+Return the count of the task's cancellation requests.
+
+This count is incremented when .cancel() is called
+and may be decremented using .uncancel().
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_cancelling_impl(TaskObj *self)
+/*[clinic end generated code: output=803b3af96f917d7e input=b625224d310cbb17]*/
+/*[clinic end generated code]*/
+{
+ return PyLong_FromLong(self->task_num_cancels_requested);
+}
+
+/*[clinic input]
+_asyncio.Task.uncancel
+
+Decrement the task's count of cancellation requests.
+
+This should be used by tasks that catch CancelledError
+and wish to continue indefinitely until they are cancelled again.
+
+Returns the remaining number of cancellation requests.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_uncancel_impl(TaskObj *self)
+/*[clinic end generated code: output=58184d236a817d3c input=68f81a4b90b46be2]*/
+/*[clinic end generated code]*/
+{
+ if (self->task_num_cancels_requested > 0) {
+ self->task_num_cancels_requested -= 1;
+ }
+ return PyLong_FromLong(self->task_num_cancels_requested);
+}
+
+/*[clinic input]
+_asyncio.Task.get_stack
+
+ cls: defining_class
+ /
+ *
+ limit: object = None
+
+Return the list of stack frames for this task's coroutine.
+
+If the coroutine is not done, this returns the stack where it is
+suspended. If the coroutine has completed successfully or was
+cancelled, this returns an empty list. If the coroutine was
+terminated by an exception, this returns the list of traceback
+frames.
+
+The frames are always ordered from oldest to newest.
+
+The optional limit gives the maximum number of frames to
+return; by default all available frames are returned. Its
+meaning differs depending on whether a stack or a traceback is
+returned: the newest frames of a stack are returned, but the
+oldest frames of a traceback are returned. (This matches the
+behavior of the traceback module.)
+
+For reasons beyond our control, only one stack frame is
+returned for a suspended coroutine.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_get_stack_impl(TaskObj *self, PyTypeObject *cls,
+ PyObject *limit)
+/*[clinic end generated code: output=6774dfc10d3857fa input=8e01c9b2618ae953]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ PyObject *stack[] = {(PyObject *)self, limit};
+ return PyObject_Vectorcall(state->asyncio_task_get_stack_func,
+ stack, 2, NULL);
+}
+
+/*[clinic input]
+_asyncio.Task.print_stack
+
+ cls: defining_class
+ /
+ *
+ limit: object = None
+ file: object = None
+
+Print the stack or traceback for this task's coroutine.
+
+This produces output similar to that of the traceback module,
+for the frames retrieved by get_stack(). The limit argument
+is passed to get_stack(). The file argument is an I/O stream
+to which the output is written; by default output is written
+to sys.stderr.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_print_stack_impl(TaskObj *self, PyTypeObject *cls,
+ PyObject *limit, PyObject *file)
+/*[clinic end generated code: output=b38affe9289ec826 input=150b35ba2d3a7dee]*/
+{
+ asyncio_state *state = get_asyncio_state_by_cls(cls);
+ PyObject *stack[] = {(PyObject *)self, limit, file};
+ return PyObject_Vectorcall(state->asyncio_task_print_stack_func,
+ stack, 3, NULL);
+}
+
+/*[clinic input]
+_asyncio.Task.set_result
+
+ result: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_set_result(TaskObj *self, PyObject *result)
+/*[clinic end generated code: output=1dcae308bfcba318 input=9d1a00c07be41bab]*/
+{
+ PyErr_SetString(PyExc_RuntimeError,
+ "Task does not support set_result operation");
+ return NULL;
+}
+
+/*[clinic input]
+_asyncio.Task.set_exception
+
+ exception: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_set_exception(TaskObj *self, PyObject *exception)
+/*[clinic end generated code: output=bc377fc28067303d input=9a8f65c83dcf893a]*/
+{
+ PyErr_SetString(PyExc_RuntimeError,
+ "Task does not support set_exception operation");
+ return NULL;
+}
+
+/*[clinic input]
+_asyncio.Task.get_coro
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_get_coro_impl(TaskObj *self)
+/*[clinic end generated code: output=bcac27c8cc6c8073 input=d2e8606c42a7b403]*/
+{
+ return Py_NewRef(self->task_coro);
+}
+
+/*[clinic input]
+_asyncio.Task.get_context
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_get_context_impl(TaskObj *self)
+/*[clinic end generated code: output=6996f53d3dc01aef input=87c0b209b8fceeeb]*/
+{
+ return Py_NewRef(self->task_context);
+}
+
+/*[clinic input]
+_asyncio.Task.get_name
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_get_name_impl(TaskObj *self)
+/*[clinic end generated code: output=0ecf1570c3b37a8f input=a4a6595d12f4f0f8]*/
+{
+ if (self->task_name) {
+ if (PyLong_CheckExact(self->task_name)) {
+ PyObject *name = PyUnicode_FromFormat("Task-%S", self->task_name);
+ if (name == NULL) {
+ return NULL;
+ }
+ Py_SETREF(self->task_name, name);
+ }
+ return Py_NewRef(self->task_name);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_asyncio.Task.set_name
+
+ value: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_Task_set_name(TaskObj *self, PyObject *value)
+/*[clinic end generated code: output=138a8d51e32057d6 input=a8359b6e65f8fd31]*/
+{
+ if (!PyUnicode_CheckExact(value)) {
+ value = PyObject_Str(value);
+ if (value == NULL) {
+ return NULL;
+ }
+ } else {
+ Py_INCREF(value);
+ }
+
+ Py_XSETREF(self->task_name, value);
+ Py_RETURN_NONE;
+}
+
+static void
+TaskObj_finalize(TaskObj *task)
+{
+ PyObject *context;
+ PyObject *message = NULL;
+ PyObject *func;
+
+ if (task->task_state != STATE_PENDING || !task->task_log_destroy_pending) {
+ goto done;
+ }
+
+ /* Save the current exception, if any. */
+ PyObject *exc = PyErr_GetRaisedException();
+
+ context = PyDict_New();
+ if (context == NULL) {
+ goto finally;
+ }
+
+ message = PyUnicode_FromString("Task was destroyed but it is pending!");
+ if (message == NULL) {
+ goto finally;
+ }
+
+ if (PyDict_SetItem(context, &_Py_ID(message), message) < 0 ||
+ PyDict_SetItem(context, &_Py_ID(task), (PyObject*)task) < 0)
+ {
+ goto finally;
+ }
+
+ if (task->task_source_tb != NULL) {
+ if (PyDict_SetItem(context, &_Py_ID(source_traceback),
+ task->task_source_tb) < 0)
+ {
+ goto finally;
+ }
+ }
+
+ func = PyObject_GetAttr(task->task_loop, &_Py_ID(call_exception_handler));
+ if (func != NULL) {
+ PyObject *res = PyObject_CallOneArg(func, context);
+ if (res == NULL) {
+ PyErr_WriteUnraisable(func);
+ }
+ else {
+ Py_DECREF(res);
+ }
+ Py_DECREF(func);
+ }
+
+finally:
+ Py_XDECREF(context);
+ Py_XDECREF(message);
+
+ /* Restore the saved exception. */
+ PyErr_SetRaisedException(exc);
+
+done:
+ FutureObj_finalize((FutureObj*)task);
+}
+
+static void TaskObj_dealloc(PyObject *); /* Needs Task_CheckExact */
+
+static PyMethodDef TaskType_methods[] = {
+ _ASYNCIO_FUTURE_RESULT_METHODDEF
+ _ASYNCIO_FUTURE_EXCEPTION_METHODDEF
+ _ASYNCIO_FUTURE_ADD_DONE_CALLBACK_METHODDEF
+ _ASYNCIO_FUTURE_REMOVE_DONE_CALLBACK_METHODDEF
+ _ASYNCIO_FUTURE_CANCELLED_METHODDEF
+ _ASYNCIO_FUTURE_DONE_METHODDEF
+ _ASYNCIO_TASK_SET_RESULT_METHODDEF
+ _ASYNCIO_TASK_SET_EXCEPTION_METHODDEF
+ _ASYNCIO_TASK_CANCEL_METHODDEF
+ _ASYNCIO_TASK_CANCELLING_METHODDEF
+ _ASYNCIO_TASK_UNCANCEL_METHODDEF
+ _ASYNCIO_TASK_GET_STACK_METHODDEF
+ _ASYNCIO_TASK_PRINT_STACK_METHODDEF
+ _ASYNCIO_TASK__MAKE_CANCELLED_ERROR_METHODDEF
+ _ASYNCIO_TASK_GET_NAME_METHODDEF
+ _ASYNCIO_TASK_SET_NAME_METHODDEF
+ _ASYNCIO_TASK_GET_CORO_METHODDEF
+ _ASYNCIO_TASK_GET_CONTEXT_METHODDEF
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* Sentinel */
+};
+
+static PyMemberDef TaskType_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(TaskObj, task_weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(TaskObj, dict), READONLY},
+ {NULL},
+};
+
+static PyGetSetDef TaskType_getsetlist[] = {
+ FUTURE_COMMON_GETSETLIST
+ {"_log_destroy_pending", (getter)TaskObj_get_log_destroy_pending,
+ (setter)TaskObj_set_log_destroy_pending, NULL},
+ {"_must_cancel", (getter)TaskObj_get_must_cancel, NULL, NULL},
+ {"_coro", (getter)TaskObj_get_coro, NULL, NULL},
+ {"_fut_waiter", (getter)TaskObj_get_fut_waiter, NULL, NULL},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot Task_slots[] = {
+ {Py_tp_dealloc, TaskObj_dealloc},
+ {Py_tp_repr, (reprfunc)TaskObj_repr},
+ {Py_tp_doc, (void *)_asyncio_Task___init____doc__},
+ {Py_tp_traverse, (traverseproc)TaskObj_traverse},
+ {Py_tp_clear, (inquiry)TaskObj_clear},
+ {Py_tp_iter, (getiterfunc)future_new_iter},
+ {Py_tp_methods, TaskType_methods},
+ {Py_tp_members, TaskType_members},
+ {Py_tp_getset, TaskType_getsetlist},
+ {Py_tp_init, (initproc)_asyncio_Task___init__},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_finalize, (destructor)TaskObj_finalize},
+
+ // async slots
+ {Py_am_await, (unaryfunc)future_new_iter},
+ {0, NULL},
+};
+
+static PyType_Spec Task_spec = {
+ .name = "_asyncio.Task",
+ .basicsize = sizeof(TaskObj),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = Task_slots,
+};
+
+static void
+TaskObj_dealloc(PyObject *self)
+{
+ TaskObj *task = (TaskObj *)self;
+
+ if (PyObject_CallFinalizerFromDealloc(self) < 0) {
+ // resurrected.
+ return;
+ }
+
+ PyTypeObject *tp = Py_TYPE(task);
+ PyObject_GC_UnTrack(self);
+
+ if (task->task_weakreflist != NULL) {
+ PyObject_ClearWeakRefs(self);
+ }
+
+ (void)TaskObj_clear(task);
+ tp->tp_free(task);
+ Py_DECREF(tp);
+}
+
+static int
+task_call_step_soon(asyncio_state *state, TaskObj *task, PyObject *arg)
+{
+ PyObject *cb = TaskStepMethWrapper_new(task, arg);
+ if (cb == NULL) {
+ return -1;
+ }
+
+ int ret = call_soon(state, task->task_loop, cb, NULL, task->task_context);
+ Py_DECREF(cb);
+ return ret;
+}
+
+static PyObject *
+task_set_error_soon(asyncio_state *state, TaskObj *task, PyObject *et,
+ const char *format, ...)
+{
+ PyObject* msg;
+
+ va_list vargs;
+ va_start(vargs, format);
+ msg = PyUnicode_FromFormatV(format, vargs);
+ va_end(vargs);
+
+ if (msg == NULL) {
+ return NULL;
+ }
+
+ PyObject *e = PyObject_CallOneArg(et, msg);
+ Py_DECREF(msg);
+ if (e == NULL) {
+ return NULL;
+ }
+
+ if (task_call_step_soon(state, task, e) == -1) {
+ Py_DECREF(e);
+ return NULL;
+ }
+
+ Py_DECREF(e);
+ Py_RETURN_NONE;
+}
+
+static inline int
+gen_status_from_result(PyObject **result)
+{
+ if (*result != NULL) {
+ return PYGEN_NEXT;
+ }
+ if (_PyGen_FetchStopIterationValue(result) == 0) {
+ return PYGEN_RETURN;
+ }
+
+ assert(PyErr_Occurred());
+ return PYGEN_ERROR;
+}
+
+static PyObject *
+task_step_impl(asyncio_state *state, TaskObj *task, PyObject *exc)
+{
+ int res;
+ int clear_exc = 0;
+ PyObject *result = NULL;
+ PyObject *coro;
+ PyObject *o;
+
+ if (task->task_state != STATE_PENDING) {
+ PyErr_Format(state->asyncio_InvalidStateError,
+ "_step(): already done: %R %R",
+ task,
+ exc ? exc : Py_None);
+ goto fail;
+ }
+
+ if (task->task_must_cancel) {
+ assert(exc != Py_None);
+
+ if (exc) {
+ /* Check if exc is a CancelledError */
+ res = PyObject_IsInstance(exc, state->asyncio_CancelledError);
+ if (res == -1) {
+ /* An error occurred, abort */
+ goto fail;
+ }
+ if (res == 0) {
+ /* exc is not CancelledError; reset it to NULL */
+ exc = NULL;
+ }
+ }
+
+ if (!exc) {
+ /* exc was not a CancelledError */
+ exc = create_cancelled_error(state, (FutureObj*)task);
+
+ if (!exc) {
+ goto fail;
+ }
+ clear_exc = 1;
+ }
+
+ task->task_must_cancel = 0;
+ }
+
+ Py_CLEAR(task->task_fut_waiter);
+
+ coro = task->task_coro;
+ if (coro == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "uninitialized Task object");
+ if (clear_exc) {
+ /* We created 'exc' during this call */
+ Py_DECREF(exc);
+ }
+ return NULL;
+ }
+
+ int gen_status = PYGEN_ERROR;
+ if (exc == NULL) {
+ gen_status = PyIter_Send(coro, Py_None, &result);
+ }
+ else {
+ result = PyObject_CallMethodOneArg(coro, &_Py_ID(throw), exc);
+ gen_status = gen_status_from_result(&result);
+ if (clear_exc) {
+ /* We created 'exc' during this call */
+ Py_DECREF(exc);
+ }
+ }
+
+ if (gen_status == PYGEN_RETURN || gen_status == PYGEN_ERROR) {
+ if (result != NULL) {
+ /* The error is StopIteration and that means that
+ the underlying coroutine has resolved */
+
+ PyObject *tmp;
+ if (task->task_must_cancel) {
+ // Task is cancelled right before coro stops.
+ task->task_must_cancel = 0;
+ tmp = future_cancel(state, (FutureObj*)task,
+ task->task_cancel_msg);
+ }
+ else {
+ tmp = future_set_result(state, (FutureObj*)task, result);
+ }
+
+ Py_DECREF(result);
+
+ if (tmp == NULL) {
+ return NULL;
+ }
+ Py_DECREF(tmp);
+ Py_RETURN_NONE;
+ }
+
+ if (PyErr_ExceptionMatches(state->asyncio_CancelledError)) {
+ /* CancelledError */
+
+ PyObject *exc = PyErr_GetRaisedException();
+ assert(exc);
+
+ FutureObj *fut = (FutureObj*)task;
+ /* transfer ownership */
+ fut->fut_cancelled_exc = exc;
+
+ return future_cancel(state, fut, NULL);
+ }
+
+ /* Some other exception; pop it and call Task.set_exception() */
+ PyObject *exc = PyErr_GetRaisedException();
+ assert(exc);
+
+ o = future_set_exception(state, (FutureObj*)task, exc);
+ if (!o) {
+ /* An exception in Task.set_exception() */
+ Py_DECREF(exc);
+ goto fail;
+ }
+ assert(o == Py_None);
+ Py_DECREF(o);
+
+ if (PyErr_GivenExceptionMatches(exc, PyExc_KeyboardInterrupt) ||
+ PyErr_GivenExceptionMatches(exc, PyExc_SystemExit))
+ {
+ /* We've got a KeyboardInterrupt or a SystemError; re-raise it */
+ PyErr_SetRaisedException(exc);
+ goto fail;
+ }
+
+ Py_DECREF(exc);
+
+ Py_RETURN_NONE;
+ }
+
+ PyObject *ret = task_step_handle_result_impl(state, task, result);
+ return ret;
+
+fail:
+ return NULL;
+}
+
+
+static PyObject *
+task_step_handle_result_impl(asyncio_state *state, TaskObj *task, PyObject *result)
+{
+ int res;
+ PyObject *o;
+
+ if (result == (PyObject*)task) {
+ /* We have a task that wants to await on itself */
+ goto self_await;
+ }
+
+ /* Check if `result` is FutureObj or TaskObj (and not a subclass) */
+ if (Future_CheckExact(state, result) || Task_CheckExact(state, result)) {
+ PyObject *wrapper;
+ PyObject *tmp;
+ FutureObj *fut = (FutureObj*)result;
+
+ /* Check if `result` future is attached to a different loop */
+ if (fut->fut_loop != task->task_loop) {
+ goto different_loop;
+ }
+
+ if (!fut->fut_blocking) {
+ goto yield_insteadof_yf;
+ }
+
+ fut->fut_blocking = 0;
+
+ /* result.add_done_callback(task._wakeup) */
+ wrapper = PyCFunction_New(&TaskWakeupDef, (PyObject *)task);
+ if (wrapper == NULL) {
+ goto fail;
+ }
+ tmp = future_add_done_callback(state,
+ (FutureObj*)result, wrapper, task->task_context);
+ Py_DECREF(wrapper);
+ if (tmp == NULL) {
+ goto fail;
+ }
+ Py_DECREF(tmp);
+
+ /* task._fut_waiter = result */
+ task->task_fut_waiter = result; /* no incref is necessary */
+
+ if (task->task_must_cancel) {
+ PyObject *r;
+ int is_true;
+ r = PyObject_CallMethodOneArg(result, &_Py_ID(cancel),
+ task->task_cancel_msg);
+ if (r == NULL) {
+ return NULL;
+ }
+ is_true = PyObject_IsTrue(r);
+ Py_DECREF(r);
+ if (is_true < 0) {
+ return NULL;
+ }
+ else if (is_true) {
+ task->task_must_cancel = 0;
+ }
+ }
+
+ Py_RETURN_NONE;
+ }
+
+ /* Check if `result` is None */
+ if (result == Py_None) {
+ /* Bare yield relinquishes control for one event loop iteration. */
+ if (task_call_step_soon(state, task, NULL)) {
+ goto fail;
+ }
+ return result;
+ }
+
+ /* Check if `result` is a Future-compatible object */
+ if (_PyObject_LookupAttr(result, &_Py_ID(_asyncio_future_blocking), &o) < 0) {
+ goto fail;
+ }
+ if (o != NULL && o != Py_None) {
+ /* `result` is a Future-compatible object */
+ PyObject *wrapper;
+ PyObject *tmp;
+
+ int blocking = PyObject_IsTrue(o);
+ Py_DECREF(o);
+ if (blocking < 0) {
+ goto fail;
+ }
+
+ /* Check if `result` future is attached to a different loop */
+ PyObject *oloop = get_future_loop(state, result);
+ if (oloop == NULL) {
+ goto fail;
+ }
+ if (oloop != task->task_loop) {
+ Py_DECREF(oloop);
+ goto different_loop;
+ }
+ Py_DECREF(oloop);
+
+ if (!blocking) {
+ goto yield_insteadof_yf;
+ }
+
+ /* result._asyncio_future_blocking = False */
+ if (PyObject_SetAttr(
+ result, &_Py_ID(_asyncio_future_blocking), Py_False) == -1) {
+ goto fail;
+ }
+
+ wrapper = PyCFunction_New(&TaskWakeupDef, (PyObject *)task);
+ if (wrapper == NULL) {
+ goto fail;
+ }
+
+ /* result.add_done_callback(task._wakeup) */
+ PyObject *add_cb = PyObject_GetAttr(
+ result, &_Py_ID(add_done_callback));
+ if (add_cb == NULL) {
+ Py_DECREF(wrapper);
+ goto fail;
+ }
+ PyObject *stack[2];
+ stack[0] = wrapper;
+ stack[1] = (PyObject *)task->task_context;
+ EVAL_CALL_STAT_INC_IF_FUNCTION(EVAL_CALL_API, add_cb);
+ tmp = PyObject_Vectorcall(add_cb, stack, 1, state->context_kwname);
+ Py_DECREF(add_cb);
+ Py_DECREF(wrapper);
+ if (tmp == NULL) {
+ goto fail;
+ }
+ Py_DECREF(tmp);
+
+ /* task._fut_waiter = result */
+ task->task_fut_waiter = result; /* no incref is necessary */
+
+ if (task->task_must_cancel) {
+ PyObject *r;
+ int is_true;
+ r = PyObject_CallMethodOneArg(result, &_Py_ID(cancel),
+ task->task_cancel_msg);
+ if (r == NULL) {
+ return NULL;
+ }
+ is_true = PyObject_IsTrue(r);
+ Py_DECREF(r);
+ if (is_true < 0) {
+ return NULL;
+ }
+ else if (is_true) {
+ task->task_must_cancel = 0;
+ }
+ }
+
+ Py_RETURN_NONE;
+ }
+
+ Py_XDECREF(o);
+ /* Check if `result` is a generator */
+ res = PyObject_IsInstance(result, (PyObject*)&PyGen_Type);
+ if (res < 0) {
+ goto fail;
+ }
+ if (res) {
+ /* `result` is a generator */
+ o = task_set_error_soon(
+ state, task, PyExc_RuntimeError,
+ "yield was used instead of yield from for "
+ "generator in task %R with %R", task, result);
+ Py_DECREF(result);
+ return o;
+ }
+
+ /* The `result` is none of the above */
+ o = task_set_error_soon(
+ state, task, PyExc_RuntimeError, "Task got bad yield: %R", result);
+ Py_DECREF(result);
+ return o;
+
+self_await:
+ o = task_set_error_soon(
+ state, task, PyExc_RuntimeError,
+ "Task cannot await on itself: %R", task);
+ Py_DECREF(result);
+ return o;
+
+yield_insteadof_yf:
+ o = task_set_error_soon(
+ state, task, PyExc_RuntimeError,
+ "yield was used instead of yield from "
+ "in task %R with %R",
+ task, result);
+ Py_DECREF(result);
+ return o;
+
+different_loop:
+ o = task_set_error_soon(
+ state, task, PyExc_RuntimeError,
+ "Task %R got Future %R attached to a different loop",
+ task, result);
+ Py_DECREF(result);
+ return o;
+
+fail:
+ Py_XDECREF(result);
+ return NULL;
+}
+
+static PyObject *
+task_step(asyncio_state *state, TaskObj *task, PyObject *exc)
+{
+ PyObject *res;
+
+ if (enter_task(state, task->task_loop, (PyObject*)task) < 0) {
+ return NULL;
+ }
+
+ res = task_step_impl(state, task, exc);
+
+ if (res == NULL) {
+ PyObject *exc = PyErr_GetRaisedException();
+ leave_task(state, task->task_loop, (PyObject*)task);
+ _PyErr_ChainExceptions1(exc);
+ return NULL;
+ }
+ else {
+ if (leave_task(state, task->task_loop, (PyObject*)task) < 0) {
+ Py_DECREF(res);
+ return NULL;
+ }
+ else {
+ return res;
+ }
+ }
+}
+
+static int
+task_eager_start(asyncio_state *state, TaskObj *task)
+{
+ assert(task != NULL);
+ PyObject *prevtask = swap_current_task(state, task->task_loop, (PyObject *)task);
+ if (prevtask == NULL) {
+ return -1;
+ }
+
+ if (register_eager_task(state, (PyObject *)task) == -1) {
+ Py_DECREF(prevtask);
+ return -1;
+ }
+
+ if (PyContext_Enter(task->task_context) == -1) {
+ Py_DECREF(prevtask);
+ return -1;
+ }
+
+ int retval = 0;
+
+ PyObject *stepres = task_step_impl(state, task, NULL);
+ if (stepres == NULL) {
+ PyObject *exc = PyErr_GetRaisedException();
+ _PyErr_ChainExceptions1(exc);
+ retval = -1;
+ } else {
+ Py_DECREF(stepres);
+ }
+
+ PyObject *curtask = swap_current_task(state, task->task_loop, prevtask);
+ Py_DECREF(prevtask);
+ if (curtask == NULL) {
+ retval = -1;
+ } else {
+ assert(curtask == (PyObject *)task);
+ Py_DECREF(curtask);
+ }
+
+ if (unregister_eager_task(state, (PyObject *)task) == -1) {
+ retval = -1;
+ }
+
+ if (PyContext_Exit(task->task_context) == -1) {
+ retval = -1;
+ }
+
+ if (task->task_state == STATE_PENDING) {
+ if (register_task(state, (PyObject *)task) == -1) {
+ retval = -1;
+ }
+ } else {
+ // This seems to really help performance on pyperformance benchmarks
+ Py_CLEAR(task->task_coro);
+ }
+
+ return retval;
+}
+
+static PyObject *
+task_wakeup(TaskObj *task, PyObject *o)
+{
+ PyObject *result;
+ assert(o);
+
+ asyncio_state *state = get_asyncio_state_by_def((PyObject *)task);
+ if (Future_CheckExact(state, o) || Task_CheckExact(state, o)) {
+ PyObject *fut_result = NULL;
+ int res = future_get_result(state, (FutureObj*)o, &fut_result);
+
+ switch(res) {
+ case -1:
+ assert(fut_result == NULL);
+ break; /* exception raised */
+ case 0:
+ Py_DECREF(fut_result);
+ return task_step(state, task, NULL);
+ default:
+ assert(res == 1);
+ result = task_step(state, task, fut_result);
+ Py_DECREF(fut_result);
+ return result;
+ }
+ }
+ else {
+ PyObject *fut_result = PyObject_CallMethod(o, "result", NULL);
+ if (fut_result != NULL) {
+ Py_DECREF(fut_result);
+ return task_step(state, task, NULL);
+ }
+ /* exception raised */
+ }
+
+ PyObject *exc = PyErr_GetRaisedException();
+ assert(exc);
+
+ result = task_step(state, task, exc);
+
+ Py_DECREF(exc);
+
+ return result;
+}
+
+
+/*********************** Functions **************************/
+
+
+/*[clinic input]
+_asyncio._get_running_loop
+
+Return the running event loop or None.
+
+This is a low-level function intended to be used by event loops.
+This function is thread-specific.
+
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__get_running_loop_impl(PyObject *module)
+/*[clinic end generated code: output=b4390af721411a0a input=0a21627e25a4bd43]*/
+{
+ PyObject *loop;
+ asyncio_state *state = get_asyncio_state(module);
+ if (get_running_loop(state, &loop)) {
+ return NULL;
+ }
+ if (loop == NULL) {
+ /* There's no currently running event loop */
+ Py_RETURN_NONE;
+ }
+ return loop;
+}
+
+/*[clinic input]
+_asyncio._set_running_loop
+ loop: 'O'
+ /
+
+Set the running event loop.
+
+This is a low-level function intended to be used by event loops.
+This function is thread-specific.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__set_running_loop(PyObject *module, PyObject *loop)
+/*[clinic end generated code: output=ae56bf7a28ca189a input=4c9720233d606604]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (set_running_loop(state, loop)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_asyncio.get_event_loop
+
+Return an asyncio event loop.
+
+When called from a coroutine or a callback (e.g. scheduled with
+call_soon or similar API), this function will always return the
+running event loop.
+
+If there is no running event loop set, the function will return
+the result of `get_event_loop_policy().get_event_loop()` call.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_get_event_loop_impl(PyObject *module)
+/*[clinic end generated code: output=2a2d8b2f824c648b input=9364bf2916c8655d]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ return get_event_loop(state);
+}
+
+/*[clinic input]
+_asyncio.get_running_loop
+
+Return the running event loop. Raise a RuntimeError if there is none.
+
+This function is thread-specific.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_get_running_loop_impl(PyObject *module)
+/*[clinic end generated code: output=c247b5f9e529530e input=2a3bf02ba39f173d]*/
+{
+ PyObject *loop;
+ asyncio_state *state = get_asyncio_state(module);
+ if (get_running_loop(state, &loop)) {
+ return NULL;
+ }
+ if (loop == NULL) {
+ /* There's no currently running event loop */
+ PyErr_SetString(
+ PyExc_RuntimeError, "no running event loop");
+ }
+ return loop;
+}
+
+/*[clinic input]
+_asyncio._register_task
+
+ task: object
+
+Register a new task in asyncio as executed by loop.
+
+Returns None.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__register_task_impl(PyObject *module, PyObject *task)
+/*[clinic end generated code: output=8672dadd69a7d4e2 input=21075aaea14dfbad]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (register_task(state, task) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_asyncio._register_eager_task
+
+ task: object
+
+Register a new task in asyncio as executed by loop.
+
+Returns None.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__register_eager_task_impl(PyObject *module, PyObject *task)
+/*[clinic end generated code: output=dfe1d45367c73f1a input=237f684683398c51]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (register_eager_task(state, task) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_asyncio._unregister_task
+
+ task: object
+
+Unregister a task.
+
+Returns None.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__unregister_task_impl(PyObject *module, PyObject *task)
+/*[clinic end generated code: output=6e5585706d568a46 input=28fb98c3975f7bdc]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (unregister_task(state, task) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_asyncio._unregister_eager_task
+
+ task: object
+
+Unregister a task.
+
+Returns None.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__unregister_eager_task_impl(PyObject *module, PyObject *task)
+/*[clinic end generated code: output=a426922bd07f23d1 input=9d07401ef14ee048]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (unregister_eager_task(state, task) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_asyncio._enter_task
+
+ loop: object
+ task: object
+
+Enter into task execution or resume suspended task.
+
+Task belongs to loop.
+
+Returns None.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__enter_task_impl(PyObject *module, PyObject *loop, PyObject *task)
+/*[clinic end generated code: output=a22611c858035b73 input=de1b06dca70d8737]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (enter_task(state, loop, task) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_asyncio._leave_task
+
+ loop: object
+ task: object
+
+Leave task execution or suspend a task.
+
+Task belongs to loop.
+
+Returns None.
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__leave_task_impl(PyObject *module, PyObject *loop, PyObject *task)
+/*[clinic end generated code: output=0ebf6db4b858fb41 input=51296a46313d1ad8]*/
+{
+ asyncio_state *state = get_asyncio_state(module);
+ if (leave_task(state, loop, task) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_asyncio._swap_current_task
+
+ loop: object
+ task: object
+
+Temporarily swap in the supplied task and return the original one (or None).
+
+This is intended for use during eager coroutine execution.
+
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio__swap_current_task_impl(PyObject *module, PyObject *loop,
+ PyObject *task)
+/*[clinic end generated code: output=9f88de958df74c7e input=c9c72208d3d38b6c]*/
+{
+ return swap_current_task(get_asyncio_state(module), loop, task);
+}
+
+
+/*[clinic input]
+_asyncio.current_task
+
+ loop: object = None
+
+Return a currently executed task.
+
+[clinic start generated code]*/
+
+static PyObject *
+_asyncio_current_task_impl(PyObject *module, PyObject *loop)
+/*[clinic end generated code: output=fe15ac331a7f981a input=58910f61a5627112]*/
+{
+ PyObject *ret;
+ asyncio_state *state = get_asyncio_state(module);
+
+ if (loop == Py_None) {
+ loop = _asyncio_get_running_loop_impl(module);
+ if (loop == NULL) {
+ return NULL;
+ }
+ } else {
+ Py_INCREF(loop);
+ }
+
+ ret = PyDict_GetItemWithError(state->current_tasks, loop);
+ Py_DECREF(loop);
+ if (ret == NULL && PyErr_Occurred()) {
+ return NULL;
+ }
+ else if (ret == NULL) {
+ Py_RETURN_NONE;
+ }
+ Py_INCREF(ret);
+ return ret;
+}
+
+
+/*********************** Module **************************/
+
+
+static void
+module_free_freelists(asyncio_state *state)
+{
+ PyObject *next;
+ PyObject *current;
+
+ next = (PyObject*) state->fi_freelist;
+ while (next != NULL) {
+ assert(state->fi_freelist_len > 0);
+ state->fi_freelist_len--;
+
+ current = next;
+ next = (PyObject*) ((futureiterobject*) current)->future;
+ PyObject_GC_Del(current);
+ }
+ assert(state->fi_freelist_len == 0);
+ state->fi_freelist = NULL;
+}
+
+static int
+module_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ asyncio_state *state = get_asyncio_state(mod);
+
+ Py_VISIT(state->FutureIterType);
+ Py_VISIT(state->TaskStepMethWrapper_Type);
+ Py_VISIT(state->FutureType);
+ Py_VISIT(state->TaskType);
+
+ Py_VISIT(state->asyncio_mod);
+ Py_VISIT(state->traceback_extract_stack);
+ Py_VISIT(state->asyncio_future_repr_func);
+ Py_VISIT(state->asyncio_get_event_loop_policy);
+ Py_VISIT(state->asyncio_iscoroutine_func);
+ Py_VISIT(state->asyncio_task_get_stack_func);
+ Py_VISIT(state->asyncio_task_print_stack_func);
+ Py_VISIT(state->asyncio_task_repr_func);
+ Py_VISIT(state->asyncio_InvalidStateError);
+ Py_VISIT(state->asyncio_CancelledError);
+
+ Py_VISIT(state->scheduled_tasks);
+ Py_VISIT(state->eager_tasks);
+ Py_VISIT(state->current_tasks);
+ Py_VISIT(state->iscoroutine_typecache);
+
+ Py_VISIT(state->context_kwname);
+
+ // Visit freelist.
+ PyObject *next = (PyObject*) state->fi_freelist;
+ while (next != NULL) {
+ PyObject *current = next;
+ Py_VISIT(current);
+ next = (PyObject*) ((futureiterobject*) current)->future;
+ }
+ return 0;
+}
+
+static int
+module_clear(PyObject *mod)
+{
+ asyncio_state *state = get_asyncio_state(mod);
+
+ Py_CLEAR(state->FutureIterType);
+ Py_CLEAR(state->TaskStepMethWrapper_Type);
+ Py_CLEAR(state->FutureType);
+ Py_CLEAR(state->TaskType);
+
+ Py_CLEAR(state->asyncio_mod);
+ Py_CLEAR(state->traceback_extract_stack);
+ Py_CLEAR(state->asyncio_future_repr_func);
+ Py_CLEAR(state->asyncio_get_event_loop_policy);
+ Py_CLEAR(state->asyncio_iscoroutine_func);
+ Py_CLEAR(state->asyncio_task_get_stack_func);
+ Py_CLEAR(state->asyncio_task_print_stack_func);
+ Py_CLEAR(state->asyncio_task_repr_func);
+ Py_CLEAR(state->asyncio_InvalidStateError);
+ Py_CLEAR(state->asyncio_CancelledError);
+
+ Py_CLEAR(state->scheduled_tasks);
+ Py_CLEAR(state->eager_tasks);
+ Py_CLEAR(state->current_tasks);
+ Py_CLEAR(state->iscoroutine_typecache);
+
+ Py_CLEAR(state->context_kwname);
+
+ module_free_freelists(state);
+
+ return 0;
+}
+
+static void
+module_free(void *mod)
+{
+ (void)module_clear((PyObject *)mod);
+}
+
+static int
+module_init(asyncio_state *state)
+{
+ PyObject *module = NULL;
+
+ state->asyncio_mod = PyImport_ImportModule("asyncio");
+ if (state->asyncio_mod == NULL) {
+ goto fail;
+ }
+
+ state->current_tasks = PyDict_New();
+ if (state->current_tasks == NULL) {
+ goto fail;
+ }
+
+ state->iscoroutine_typecache = PySet_New(NULL);
+ if (state->iscoroutine_typecache == NULL) {
+ goto fail;
+ }
+
+
+ state->context_kwname = Py_BuildValue("(s)", "context");
+ if (state->context_kwname == NULL) {
+ goto fail;
+ }
+
+#define WITH_MOD(NAME) \
+ Py_CLEAR(module); \
+ module = PyImport_ImportModule(NAME); \
+ if (module == NULL) { \
+ goto fail; \
+ }
+
+#define GET_MOD_ATTR(VAR, NAME) \
+ VAR = PyObject_GetAttrString(module, NAME); \
+ if (VAR == NULL) { \
+ goto fail; \
+ }
+
+ WITH_MOD("asyncio.events")
+ GET_MOD_ATTR(state->asyncio_get_event_loop_policy, "get_event_loop_policy")
+
+ WITH_MOD("asyncio.base_futures")
+ GET_MOD_ATTR(state->asyncio_future_repr_func, "_future_repr")
+
+ WITH_MOD("asyncio.exceptions")
+ GET_MOD_ATTR(state->asyncio_InvalidStateError, "InvalidStateError")
+ GET_MOD_ATTR(state->asyncio_CancelledError, "CancelledError")
+
+ WITH_MOD("asyncio.base_tasks")
+ GET_MOD_ATTR(state->asyncio_task_repr_func, "_task_repr")
+ GET_MOD_ATTR(state->asyncio_task_get_stack_func, "_task_get_stack")
+ GET_MOD_ATTR(state->asyncio_task_print_stack_func, "_task_print_stack")
+
+ WITH_MOD("asyncio.coroutines")
+ GET_MOD_ATTR(state->asyncio_iscoroutine_func, "iscoroutine")
+
+ WITH_MOD("traceback")
+ GET_MOD_ATTR(state->traceback_extract_stack, "extract_stack")
+
+ PyObject *weak_set;
+ WITH_MOD("weakref")
+ GET_MOD_ATTR(weak_set, "WeakSet");
+ state->scheduled_tasks = PyObject_CallNoArgs(weak_set);
+ Py_CLEAR(weak_set);
+ if (state->scheduled_tasks == NULL) {
+ goto fail;
+ }
+
+ state->eager_tasks = PySet_New(NULL);
+ if (state->eager_tasks == NULL) {
+ goto fail;
+ }
+
+ Py_DECREF(module);
+ return 0;
+
+fail:
+ Py_CLEAR(module);
+ return -1;
+
+#undef WITH_MOD
+#undef GET_MOD_ATTR
+}
+
+PyDoc_STRVAR(module_doc, "Accelerator module for asyncio");
+
+static PyMethodDef asyncio_methods[] = {
+ _ASYNCIO_CURRENT_TASK_METHODDEF
+ _ASYNCIO_GET_EVENT_LOOP_METHODDEF
+ _ASYNCIO_GET_RUNNING_LOOP_METHODDEF
+ _ASYNCIO__GET_RUNNING_LOOP_METHODDEF
+ _ASYNCIO__SET_RUNNING_LOOP_METHODDEF
+ _ASYNCIO__REGISTER_TASK_METHODDEF
+ _ASYNCIO__REGISTER_EAGER_TASK_METHODDEF
+ _ASYNCIO__UNREGISTER_TASK_METHODDEF
+ _ASYNCIO__UNREGISTER_EAGER_TASK_METHODDEF
+ _ASYNCIO__ENTER_TASK_METHODDEF
+ _ASYNCIO__LEAVE_TASK_METHODDEF
+ _ASYNCIO__SWAP_CURRENT_TASK_METHODDEF
+ {NULL, NULL}
+};
+
+static int
+module_exec(PyObject *mod)
+{
+ asyncio_state *state = get_asyncio_state(mod);
+
+#define CREATE_TYPE(m, tp, spec, base) \
+ do { \
+ tp = (PyTypeObject *)PyType_FromMetaclass(NULL, m, spec, \
+ (PyObject *)base); \
+ if (tp == NULL) { \
+ return -1; \
+ } \
+ } while (0)
+
+ CREATE_TYPE(mod, state->TaskStepMethWrapper_Type, &TaskStepMethWrapper_spec, NULL);
+ CREATE_TYPE(mod, state->FutureIterType, &FutureIter_spec, NULL);
+ CREATE_TYPE(mod, state->FutureType, &Future_spec, NULL);
+ CREATE_TYPE(mod, state->TaskType, &Task_spec, state->FutureType);
+
+#undef CREATE_TYPE
+
+ if (PyModule_AddType(mod, state->FutureType) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddType(mod, state->TaskType) < 0) {
+ return -1;
+ }
+ // Must be done after types are added to avoid a circular dependency
+ if (module_init(state) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddObjectRef(mod, "_scheduled_tasks", state->scheduled_tasks) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddObjectRef(mod, "_eager_tasks", state->eager_tasks) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddObjectRef(mod, "_current_tasks", state->current_tasks) < 0) {
+ return -1;
+ }
+
+
+ return 0;
+}
+
+static struct PyModuleDef_Slot module_slots[] = {
+ {Py_mod_exec, module_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static struct PyModuleDef _asynciomodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_asyncio",
+ .m_doc = module_doc,
+ .m_size = sizeof(asyncio_state),
+ .m_methods = asyncio_methods,
+ .m_slots = module_slots,
+ .m_traverse = module_traverse,
+ .m_clear = module_clear,
+ .m_free = (freefunc)module_free,
+};
+
+PyMODINIT_FUNC
+PyInit__asyncio(void)
+{
+ return PyModuleDef_Init(&_asynciomodule);
+}
diff --git a/contrib/tools/python3/Modules/_bisectmodule.c b/contrib/tools/python3/Modules/_bisectmodule.c
new file mode 100644
index 00000000000..0773bbd1919
--- /dev/null
+++ b/contrib/tools/python3/Modules/_bisectmodule.c
@@ -0,0 +1,479 @@
+/* Bisection algorithms. Drop in replacement for bisect.py
+
+Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
+*/
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+/*[clinic input]
+module _bisect
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4d56a2b2033b462b]*/
+
+#include "clinic/_bisectmodule.c.h"
+
+typedef struct {
+ PyObject *str_insert;
+} bisect_state;
+
+static inline bisect_state*
+get_bisect_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (bisect_state *)state;
+}
+
+static ssizeargfunc
+get_sq_item(PyObject *s)
+{
+ // The parts of PySequence_GetItem that we only need to do once
+ PyTypeObject *tp = Py_TYPE(s);
+ PySequenceMethods *m = tp->tp_as_sequence;
+ if (m && m->sq_item) {
+ return m->sq_item;
+ }
+ const char *msg;
+ if (tp->tp_as_mapping && tp->tp_as_mapping->mp_subscript) {
+ msg = "%.200s is not a sequence";
+ }
+ else {
+ msg = "'%.200s' object does not support indexing";
+ }
+ PyErr_Format(PyExc_TypeError, msg, tp->tp_name);
+ return NULL;
+}
+
+static inline Py_ssize_t
+internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi,
+ PyObject* key)
+{
+ PyObject *litem;
+ Py_ssize_t mid;
+ int res;
+
+ if (lo < 0) {
+ PyErr_SetString(PyExc_ValueError, "lo must be non-negative");
+ return -1;
+ }
+ if (hi == -1) {
+ hi = PySequence_Size(list);
+ if (hi < 0)
+ return -1;
+ }
+ ssizeargfunc sq_item = get_sq_item(list);
+ if (sq_item == NULL) {
+ return -1;
+ }
+ if (Py_EnterRecursiveCall("in _bisect.bisect_right")) {
+ return -1;
+ }
+ PyTypeObject *tp = Py_TYPE(item);
+ richcmpfunc compare = tp->tp_richcompare;
+ while (lo < hi) {
+ /* The (size_t)cast ensures that the addition and subsequent division
+ are performed as unsigned operations, avoiding difficulties from
+ signed overflow. (See issue 13496.) */
+ mid = ((size_t)lo + hi) / 2;
+ assert(mid >= 0);
+ // PySequence_GetItem, but we already checked the types.
+ litem = sq_item(list, mid);
+ assert((PyErr_Occurred() == NULL) ^ (litem == NULL));
+ if (litem == NULL) {
+ goto error;
+ }
+ if (key != Py_None) {
+ PyObject *newitem = PyObject_CallOneArg(key, litem);
+ if (newitem == NULL) {
+ goto error;
+ }
+ Py_SETREF(litem, newitem);
+ }
+ /* if item < key(list[mid]):
+ * hi = mid
+ * else:
+ * lo = mid + 1
+ */
+ if (compare != NULL && Py_IS_TYPE(litem, tp)) {
+ // A fast path for comparing objects of the same type
+ PyObject *res_obj = compare(item, litem, Py_LT);
+ if (res_obj == Py_True) {
+ Py_DECREF(res_obj);
+ Py_DECREF(litem);
+ hi = mid;
+ continue;
+ }
+ if (res_obj == Py_False) {
+ Py_DECREF(res_obj);
+ Py_DECREF(litem);
+ lo = mid + 1;
+ continue;
+ }
+ if (res_obj == NULL) {
+ goto error;
+ }
+ if (res_obj == Py_NotImplemented) {
+ Py_DECREF(res_obj);
+ compare = NULL;
+ res = PyObject_RichCompareBool(item, litem, Py_LT);
+ }
+ else {
+ res = PyObject_IsTrue(res_obj);
+ Py_DECREF(res_obj);
+ }
+ }
+ else {
+ // A default path for comparing arbitrary objects
+ res = PyObject_RichCompareBool(item, litem, Py_LT);
+ }
+ if (res < 0) {
+ goto error;
+ }
+ Py_DECREF(litem);
+ if (res)
+ hi = mid;
+ else
+ lo = mid + 1;
+ }
+ Py_LeaveRecursiveCall();
+ return lo;
+error:
+ Py_LeaveRecursiveCall();
+ Py_XDECREF(litem);
+ return -1;
+}
+
+/*[clinic input]
+_bisect.bisect_right -> Py_ssize_t
+
+ a: object
+ x: object
+ lo: Py_ssize_t = 0
+ hi: Py_ssize_t(c_default='-1', accept={int, NoneType}) = None
+ *
+ key: object = None
+
+Return the index where to insert item x in list a, assuming a is sorted.
+
+The return value i is such that all e in a[:i] have e <= x, and all e in
+a[i:] have e > x. So if x already appears in the list, a.insert(i, x) will
+insert just after the rightmost x already there.
+
+Optional args lo (default 0) and hi (default len(a)) bound the
+slice of a to be searched.
+
+A custom key function can be supplied to customize the sort order.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_bisect_bisect_right_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
+/*[clinic end generated code: output=3a4bc09cc7c8a73d input=43071869772dd53a]*/
+{
+ return internal_bisect_right(a, x, lo, hi, key);
+}
+
+/*[clinic input]
+_bisect.insort_right
+
+ a: object
+ x: object
+ lo: Py_ssize_t = 0
+ hi: Py_ssize_t(c_default='-1', accept={int, NoneType}) = None
+ *
+ key: object = None
+
+Insert item x in list a, and keep it sorted assuming a is sorted.
+
+If x is already in a, insert it to the right of the rightmost x.
+
+Optional args lo (default 0) and hi (default len(a)) bound the
+slice of a to be searched.
+
+A custom key function can be supplied to customize the sort order.
+[clinic start generated code]*/
+
+static PyObject *
+_bisect_insort_right_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
+/*[clinic end generated code: output=ac3bf26d07aedda2 input=f60777d2b6ddb239]*/
+{
+ PyObject *result, *key_x;
+ Py_ssize_t index;
+
+ if (key == Py_None) {
+ index = internal_bisect_right(a, x, lo, hi, key);
+ } else {
+ key_x = PyObject_CallOneArg(key, x);
+ if (key_x == NULL) {
+ return NULL;
+ }
+ index = internal_bisect_right(a, key_x, lo, hi, key);
+ Py_DECREF(key_x);
+ }
+ if (index < 0)
+ return NULL;
+ if (PyList_CheckExact(a)) {
+ if (PyList_Insert(a, index, x) < 0)
+ return NULL;
+ }
+ else {
+ bisect_state *state = get_bisect_state(module);
+ result = _PyObject_CallMethod(a, state->str_insert, "nO", index, x);
+ if (result == NULL)
+ return NULL;
+ Py_DECREF(result);
+ }
+
+ Py_RETURN_NONE;
+}
+
+static inline Py_ssize_t
+internal_bisect_left(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi,
+ PyObject *key)
+{
+ PyObject *litem;
+ Py_ssize_t mid;
+ int res;
+
+ if (lo < 0) {
+ PyErr_SetString(PyExc_ValueError, "lo must be non-negative");
+ return -1;
+ }
+ if (hi == -1) {
+ hi = PySequence_Size(list);
+ if (hi < 0)
+ return -1;
+ }
+ ssizeargfunc sq_item = get_sq_item(list);
+ if (sq_item == NULL) {
+ return -1;
+ }
+ if (Py_EnterRecursiveCall("in _bisect.bisect_left")) {
+ return -1;
+ }
+ PyTypeObject *tp = Py_TYPE(item);
+ richcmpfunc compare = tp->tp_richcompare;
+ while (lo < hi) {
+ /* The (size_t)cast ensures that the addition and subsequent division
+ are performed as unsigned operations, avoiding difficulties from
+ signed overflow. (See issue 13496.) */
+ mid = ((size_t)lo + hi) / 2;
+ assert(mid >= 0);
+ // PySequence_GetItem, but we already checked the types.
+ litem = sq_item(list, mid);
+ assert((PyErr_Occurred() == NULL) ^ (litem == NULL));
+ if (litem == NULL) {
+ goto error;
+ }
+ if (key != Py_None) {
+ PyObject *newitem = PyObject_CallOneArg(key, litem);
+ if (newitem == NULL) {
+ goto error;
+ }
+ Py_SETREF(litem, newitem);
+ }
+ /* if key(list[mid]) < item:
+ * lo = mid + 1
+ * else:
+ * hi = mid
+ */
+ if (compare != NULL && Py_IS_TYPE(litem, tp)) {
+ // A fast path for comparing objects of the same type
+ PyObject *res_obj = compare(litem, item, Py_LT);
+ if (res_obj == Py_True) {
+ Py_DECREF(res_obj);
+ Py_DECREF(litem);
+ lo = mid + 1;
+ continue;
+ }
+ if (res_obj == Py_False) {
+ Py_DECREF(res_obj);
+ Py_DECREF(litem);
+ hi = mid;
+ continue;
+ }
+ if (res_obj == NULL) {
+ goto error;
+ }
+ if (res_obj == Py_NotImplemented) {
+ Py_DECREF(res_obj);
+ compare = NULL;
+ res = PyObject_RichCompareBool(litem, item, Py_LT);
+ }
+ else {
+ res = PyObject_IsTrue(res_obj);
+ Py_DECREF(res_obj);
+ }
+ }
+ else {
+ // A default path for comparing arbitrary objects
+ res = PyObject_RichCompareBool(litem, item, Py_LT);
+ }
+ if (res < 0) {
+ goto error;
+ }
+ Py_DECREF(litem);
+ if (res)
+ lo = mid + 1;
+ else
+ hi = mid;
+ }
+ Py_LeaveRecursiveCall();
+ return lo;
+error:
+ Py_LeaveRecursiveCall();
+ Py_XDECREF(litem);
+ return -1;
+}
+
+
+/*[clinic input]
+_bisect.bisect_left -> Py_ssize_t
+
+ a: object
+ x: object
+ lo: Py_ssize_t = 0
+ hi: Py_ssize_t(c_default='-1', accept={int, NoneType}) = None
+ *
+ key: object = None
+
+Return the index where to insert item x in list a, assuming a is sorted.
+
+The return value i is such that all e in a[:i] have e < x, and all e in
+a[i:] have e >= x. So if x already appears in the list, a.insert(i, x) will
+insert just before the leftmost x already there.
+
+Optional args lo (default 0) and hi (default len(a)) bound the
+slice of a to be searched.
+
+A custom key function can be supplied to customize the sort order.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_bisect_bisect_left_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
+/*[clinic end generated code: output=70749d6e5cae9284 input=f29c4fe7f9b797c7]*/
+{
+ return internal_bisect_left(a, x, lo, hi, key);
+}
+
+
+/*[clinic input]
+_bisect.insort_left
+
+ a: object
+ x: object
+ lo: Py_ssize_t = 0
+ hi: Py_ssize_t(c_default='-1', accept={int, NoneType}) = None
+ *
+ key: object = None
+
+Insert item x in list a, and keep it sorted assuming a is sorted.
+
+If x is already in a, insert it to the left of the leftmost x.
+
+Optional args lo (default 0) and hi (default len(a)) bound the
+slice of a to be searched.
+
+A custom key function can be supplied to customize the sort order.
+[clinic start generated code]*/
+
+static PyObject *
+_bisect_insort_left_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key)
+/*[clinic end generated code: output=b1d33e5e7ffff11e input=0a700a82edbd472c]*/
+{
+ PyObject *result, *key_x;
+ Py_ssize_t index;
+
+ if (key == Py_None) {
+ index = internal_bisect_left(a, x, lo, hi, key);
+ } else {
+ key_x = PyObject_CallOneArg(key, x);
+ if (key_x == NULL) {
+ return NULL;
+ }
+ index = internal_bisect_left(a, key_x, lo, hi, key);
+ Py_DECREF(key_x);
+ }
+ if (index < 0)
+ return NULL;
+ if (PyList_CheckExact(a)) {
+ if (PyList_Insert(a, index, x) < 0)
+ return NULL;
+ } else {
+ bisect_state *state = get_bisect_state(module);
+ result = _PyObject_CallMethod(a, state->str_insert, "nO", index, x);
+ if (result == NULL)
+ return NULL;
+ Py_DECREF(result);
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef bisect_methods[] = {
+ _BISECT_BISECT_RIGHT_METHODDEF
+ _BISECT_INSORT_RIGHT_METHODDEF
+ _BISECT_BISECT_LEFT_METHODDEF
+ _BISECT_INSORT_LEFT_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(module_doc,
+"Bisection algorithms.\n\
+\n\
+This module provides support for maintaining a list in sorted order without\n\
+having to sort the list after each insertion. For long lists of items with\n\
+expensive comparison operations, this can be an improvement over the more\n\
+common approach.\n");
+
+static int
+bisect_clear(PyObject *module)
+{
+ bisect_state *state = get_bisect_state(module);
+ Py_CLEAR(state->str_insert);
+ return 0;
+}
+
+static void
+bisect_free(void *module)
+{
+ bisect_clear((PyObject *)module);
+}
+
+static int
+bisect_modexec(PyObject *m)
+{
+ bisect_state *state = get_bisect_state(m);
+ state->str_insert = PyUnicode_InternFromString("insert");
+ if (state->str_insert == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot bisect_slots[] = {
+ {Py_mod_exec, bisect_modexec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _bisectmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_bisect",
+ .m_size = sizeof(bisect_state),
+ .m_doc = module_doc,
+ .m_methods = bisect_methods,
+ .m_slots = bisect_slots,
+ .m_clear = bisect_clear,
+ .m_free = bisect_free,
+};
+
+PyMODINIT_FUNC
+PyInit__bisect(void)
+{
+ return PyModuleDef_Init(&_bisectmodule);
+}
diff --git a/contrib/tools/python3/Modules/_blake2/blake2b_impl.c b/contrib/tools/python3/Modules/_blake2/blake2b_impl.c
new file mode 100644
index 00000000000..c2cac98c752
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/blake2b_impl.c
@@ -0,0 +1,416 @@
+/*
+ * Written in 2013 by Dmitry Chestnykh <[email protected]>
+ * Modified for CPython by Christian Heimes <[email protected]>
+ *
+ * To the extent possible under law, the author have dedicated all
+ * copyright and related and neighboring rights to this software to
+ * the public domain worldwide. This software is distributed without
+ * any warranty. http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+/* WARNING: autogenerated file!
+ *
+ * The blake2s_impl.c is autogenerated from blake2b_impl.c.
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_strhex.h" // _Py_strhex()
+
+#include "../hashlib.h"
+#include "blake2module.h"
+
+#ifndef HAVE_LIBB2
+/* pure SSE2 implementation is very slow, so only use the more optimized SSSE3+
+ * https://bugs.python.org/issue31834 */
+#if defined(__SSSE3__) || defined(__SSE4_1__) || defined(__AVX__) || defined(__XOP__)
+#include "impl/blake2b.c"
+#else
+#include "impl/blake2b-ref.c"
+#endif
+#endif // !HAVE_LIBB2
+
+#define HAVE_BLAKE2B 1
+
+extern PyType_Spec blake2b_type_spec;
+
+
+typedef struct {
+ PyObject_HEAD
+ blake2b_param param;
+ blake2b_state state;
+ PyThread_type_lock lock;
+} BLAKE2bObject;
+
+#include "clinic/blake2b_impl.c.h"
+
+/*[clinic input]
+module _blake2
+class _blake2.blake2b "BLAKE2bObject *" "&PyBlake2_BLAKE2bType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d47b0527b39c673f]*/
+
+
+static BLAKE2bObject *
+new_BLAKE2bObject(PyTypeObject *type)
+{
+ BLAKE2bObject *self;
+ self = (BLAKE2bObject *)type->tp_alloc(type, 0);
+ if (self != NULL) {
+ self->lock = NULL;
+ }
+ return self;
+}
+
+/*[clinic input]
+@classmethod
+_blake2.blake2b.__new__ as py_blake2b_new
+ data: object(c_default="NULL") = b''
+ /
+ *
+ digest_size: int(c_default="BLAKE2B_OUTBYTES") = _blake2.blake2b.MAX_DIGEST_SIZE
+ key: Py_buffer(c_default="NULL", py_default="b''") = None
+ salt: Py_buffer(c_default="NULL", py_default="b''") = None
+ person: Py_buffer(c_default="NULL", py_default="b''") = None
+ fanout: int = 1
+ depth: int = 1
+ leaf_size: unsigned_long = 0
+ node_offset: unsigned_long_long = 0
+ node_depth: int = 0
+ inner_size: int = 0
+ last_node: bool = False
+ usedforsecurity: bool = True
+
+Return a new BLAKE2b hash object.
+[clinic start generated code]*/
+
+static PyObject *
+py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
+ Py_buffer *key, Py_buffer *salt, Py_buffer *person,
+ int fanout, int depth, unsigned long leaf_size,
+ unsigned long long node_offset, int node_depth,
+ int inner_size, int last_node, int usedforsecurity)
+/*[clinic end generated code: output=32bfd8f043c6896f input=b947312abff46977]*/
+{
+ BLAKE2bObject *self = NULL;
+ Py_buffer buf;
+
+ self = new_BLAKE2bObject(type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ /* Zero parameter block. */
+ memset(&self->param, 0, sizeof(self->param));
+
+ /* Set digest size. */
+ if (digest_size <= 0 || digest_size > BLAKE2B_OUTBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "digest_size must be between 1 and %d bytes",
+ BLAKE2B_OUTBYTES);
+ goto error;
+ }
+ self->param.digest_length = digest_size;
+
+ /* Set salt parameter. */
+ if ((salt->obj != NULL) && salt->len) {
+ if (salt->len > BLAKE2B_SALTBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "maximum salt length is %d bytes",
+ BLAKE2B_SALTBYTES);
+ goto error;
+ }
+ memcpy(self->param.salt, salt->buf, salt->len);
+ }
+
+ /* Set personalization parameter. */
+ if ((person->obj != NULL) && person->len) {
+ if (person->len > BLAKE2B_PERSONALBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "maximum person length is %d bytes",
+ BLAKE2B_PERSONALBYTES);
+ goto error;
+ }
+ memcpy(self->param.personal, person->buf, person->len);
+ }
+
+ /* Set tree parameters. */
+ if (fanout < 0 || fanout > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "fanout must be between 0 and 255");
+ goto error;
+ }
+ self->param.fanout = (uint8_t)fanout;
+
+ if (depth <= 0 || depth > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "depth must be between 1 and 255");
+ goto error;
+ }
+ self->param.depth = (uint8_t)depth;
+
+ if (leaf_size > 0xFFFFFFFFU) {
+ PyErr_SetString(PyExc_OverflowError, "leaf_size is too large");
+ goto error;
+ }
+ // NB: Simple assignment here would be incorrect on big endian platforms.
+ store32(&(self->param.leaf_length), leaf_size);
+
+#ifdef HAVE_BLAKE2S
+ if (node_offset > 0xFFFFFFFFFFFFULL) {
+ /* maximum 2**48 - 1 */
+ PyErr_SetString(PyExc_OverflowError, "node_offset is too large");
+ goto error;
+ }
+ store48(&(self->param.node_offset), node_offset);
+#else
+ // NB: Simple assignment here would be incorrect on big endian platforms.
+ store64(&(self->param.node_offset), node_offset);
+#endif
+
+ if (node_depth < 0 || node_depth > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "node_depth must be between 0 and 255");
+ goto error;
+ }
+ self->param.node_depth = node_depth;
+
+ if (inner_size < 0 || inner_size > BLAKE2B_OUTBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "inner_size must be between 0 and is %d",
+ BLAKE2B_OUTBYTES);
+ goto error;
+ }
+ self->param.inner_length = inner_size;
+
+ /* Set key length. */
+ if ((key->obj != NULL) && key->len) {
+ if (key->len > BLAKE2B_KEYBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "maximum key length is %d bytes",
+ BLAKE2B_KEYBYTES);
+ goto error;
+ }
+ self->param.key_length = (uint8_t)key->len;
+ }
+
+ /* Initialize hash state. */
+ if (blake2b_init_param(&self->state, &self->param) < 0) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "error initializing hash state");
+ goto error;
+ }
+
+ /* Set last node flag (must come after initialization). */
+ self->state.last_node = last_node;
+
+ /* Process key block if any. */
+ if (self->param.key_length) {
+ uint8_t block[BLAKE2B_BLOCKBYTES];
+ memset(block, 0, sizeof(block));
+ memcpy(block, key->buf, key->len);
+ blake2b_update(&self->state, block, sizeof(block));
+ secure_zero_memory(block, sizeof(block));
+ }
+
+ /* Process initial data if any. */
+ if (data != NULL) {
+ GET_BUFFER_VIEW_OR_ERROR(data, &buf, goto error);
+
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ Py_BEGIN_ALLOW_THREADS
+ blake2b_update(&self->state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ blake2b_update(&self->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)self;
+
+ error:
+ if (self != NULL) {
+ Py_DECREF(self);
+ }
+ return NULL;
+}
+
+/*[clinic input]
+_blake2.blake2b.copy
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2b_copy_impl(BLAKE2bObject *self)
+/*[clinic end generated code: output=ff6acee5f93656ae input=e383c2d199fd8a2e]*/
+{
+ BLAKE2bObject *cpy;
+
+ if ((cpy = new_BLAKE2bObject(Py_TYPE(self))) == NULL)
+ return NULL;
+
+ ENTER_HASHLIB(self);
+ cpy->param = self->param;
+ cpy->state = self->state;
+ LEAVE_HASHLIB(self);
+ return (PyObject *)cpy;
+}
+
+/*[clinic input]
+_blake2.blake2b.update
+
+ data: object
+ /
+
+Update this hash object's state with the provided bytes-like object.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2b_update(BLAKE2bObject *self, PyObject *data)
+/*[clinic end generated code: output=010dfcbe22654359 input=ffc4aa6a6a225d31]*/
+{
+ Py_buffer buf;
+
+ GET_BUFFER_VIEW_OR_ERROUT(data, &buf);
+
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE)
+ self->lock = PyThread_allocate_lock();
+
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ blake2b_update(&self->state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ blake2b_update(&self->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_blake2.blake2b.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2b_digest_impl(BLAKE2bObject *self)
+/*[clinic end generated code: output=a5864660f4bfc61a input=7d21659e9c5fff02]*/
+{
+ uint8_t digest[BLAKE2B_OUTBYTES];
+ blake2b_state state_cpy;
+
+ ENTER_HASHLIB(self);
+ state_cpy = self->state;
+ blake2b_final(&state_cpy, digest, self->param.digest_length);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest,
+ self->param.digest_length);
+}
+
+/*[clinic input]
+_blake2.blake2b.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2b_hexdigest_impl(BLAKE2bObject *self)
+/*[clinic end generated code: output=b5598a87d8794a60 input=76930f6946351f56]*/
+{
+ uint8_t digest[BLAKE2B_OUTBYTES];
+ blake2b_state state_cpy;
+
+ ENTER_HASHLIB(self);
+ state_cpy = self->state;
+ blake2b_final(&state_cpy, digest, self->param.digest_length);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char *)digest, self->param.digest_length);
+}
+
+
+static PyMethodDef py_blake2b_methods[] = {
+ _BLAKE2_BLAKE2B_COPY_METHODDEF
+ _BLAKE2_BLAKE2B_DIGEST_METHODDEF
+ _BLAKE2_BLAKE2B_HEXDIGEST_METHODDEF
+ _BLAKE2_BLAKE2B_UPDATE_METHODDEF
+ {NULL, NULL}
+};
+
+
+
+static PyObject *
+py_blake2b_get_name(BLAKE2bObject *self, void *closure)
+{
+ return PyUnicode_FromString("blake2b");
+}
+
+
+
+static PyObject *
+py_blake2b_get_block_size(BLAKE2bObject *self, void *closure)
+{
+ return PyLong_FromLong(BLAKE2B_BLOCKBYTES);
+}
+
+
+
+static PyObject *
+py_blake2b_get_digest_size(BLAKE2bObject *self, void *closure)
+{
+ return PyLong_FromLong(self->param.digest_length);
+}
+
+
+static PyGetSetDef py_blake2b_getsetters[] = {
+ {"name", (getter)py_blake2b_get_name,
+ NULL, NULL, NULL},
+ {"block_size", (getter)py_blake2b_get_block_size,
+ NULL, NULL, NULL},
+ {"digest_size", (getter)py_blake2b_get_digest_size,
+ NULL, NULL, NULL},
+ {NULL}
+};
+
+
+static void
+py_blake2b_dealloc(PyObject *self)
+{
+ BLAKE2bObject *obj = (BLAKE2bObject *)self;
+
+ /* Try not to leave state in memory. */
+ secure_zero_memory(&obj->param, sizeof(obj->param));
+ secure_zero_memory(&obj->state, sizeof(obj->state));
+ if (obj->lock) {
+ PyThread_free_lock(obj->lock);
+ obj->lock = NULL;
+ }
+
+ PyTypeObject *type = Py_TYPE(self);
+ PyObject_Free(self);
+ Py_DECREF(type);
+}
+
+static PyType_Slot blake2b_type_slots[] = {
+ {Py_tp_dealloc, py_blake2b_dealloc},
+ {Py_tp_doc, (char *)py_blake2b_new__doc__},
+ {Py_tp_methods, py_blake2b_methods},
+ {Py_tp_getset, py_blake2b_getsetters},
+ {Py_tp_new, py_blake2b_new},
+ {0,0}
+};
+
+PyType_Spec blake2b_type_spec = {
+ .name = "_blake2.blake2b",
+ .basicsize = sizeof(BLAKE2bObject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = blake2b_type_slots
+};
diff --git a/contrib/tools/python3/Modules/_blake2/blake2module.c b/contrib/tools/python3/Modules/_blake2/blake2module.c
new file mode 100644
index 00000000000..5df9fd3df49
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/blake2module.c
@@ -0,0 +1,159 @@
+/*
+ * Written in 2013 by Dmitry Chestnykh <[email protected]>
+ * Modified for CPython by Christian Heimes <[email protected]>
+ *
+ * To the extent possible under law, the author have dedicated all
+ * copyright and related and neighboring rights to this software to
+ * the public domain worldwide. This software is distributed without
+ * any warranty. http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "blake2module.h"
+
+extern PyType_Spec blake2b_type_spec;
+extern PyType_Spec blake2s_type_spec;
+
+PyDoc_STRVAR(blake2mod__doc__,
+"_blake2b provides BLAKE2b for hashlib\n"
+);
+
+typedef struct {
+ PyTypeObject* blake2b_type;
+ PyTypeObject* blake2s_type;
+} Blake2State;
+
+static inline Blake2State*
+blake2_get_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (Blake2State *)state;
+}
+
+static struct PyMethodDef blake2mod_functions[] = {
+ {NULL, NULL}
+};
+
+static int
+_blake2_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ Blake2State *state = blake2_get_state(module);
+ Py_VISIT(state->blake2b_type);
+ Py_VISIT(state->blake2s_type);
+ return 0;
+}
+
+static int
+_blake2_clear(PyObject *module)
+{
+ Blake2State *state = blake2_get_state(module);
+ Py_CLEAR(state->blake2b_type);
+ Py_CLEAR(state->blake2s_type);
+ return 0;
+}
+
+static void
+_blake2_free(void *module)
+{
+ _blake2_clear((PyObject *)module);
+}
+
+#define ADD_INT(d, name, value) do { \
+ PyObject *x = PyLong_FromLong(value); \
+ if (!x) \
+ return -1; \
+ if (PyDict_SetItemString(d, name, x) < 0) { \
+ Py_DECREF(x); \
+ return -1; \
+ } \
+ Py_DECREF(x); \
+} while(0)
+
+#define ADD_INT_CONST(NAME, VALUE) do { \
+ if (PyModule_AddIntConstant(m, NAME, VALUE) < 0) { \
+ return -1; \
+ } \
+} while (0)
+
+static int
+blake2_exec(PyObject *m)
+{
+ Blake2State* st = blake2_get_state(m);
+
+ st->blake2b_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &blake2b_type_spec, NULL);
+
+ if (NULL == st->blake2b_type)
+ return -1;
+ /* BLAKE2b */
+ if (PyModule_AddType(m, st->blake2b_type) < 0) {
+ return -1;
+ }
+
+ PyObject *d = st->blake2b_type->tp_dict;
+ ADD_INT(d, "SALT_SIZE", BLAKE2B_SALTBYTES);
+ ADD_INT(d, "PERSON_SIZE", BLAKE2B_PERSONALBYTES);
+ ADD_INT(d, "MAX_KEY_SIZE", BLAKE2B_KEYBYTES);
+ ADD_INT(d, "MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES);
+
+ ADD_INT_CONST("BLAKE2B_SALT_SIZE", BLAKE2B_SALTBYTES);
+ ADD_INT_CONST("BLAKE2B_PERSON_SIZE", BLAKE2B_PERSONALBYTES);
+ ADD_INT_CONST("BLAKE2B_MAX_KEY_SIZE", BLAKE2B_KEYBYTES);
+ ADD_INT_CONST("BLAKE2B_MAX_DIGEST_SIZE", BLAKE2B_OUTBYTES);
+
+ /* BLAKE2s */
+ st->blake2s_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &blake2s_type_spec, NULL);
+
+ if (NULL == st->blake2s_type)
+ return -1;
+
+ if (PyModule_AddType(m, st->blake2s_type) < 0) {
+ return -1;
+ }
+
+ d = st->blake2s_type->tp_dict;
+ ADD_INT(d, "SALT_SIZE", BLAKE2S_SALTBYTES);
+ ADD_INT(d, "PERSON_SIZE", BLAKE2S_PERSONALBYTES);
+ ADD_INT(d, "MAX_KEY_SIZE", BLAKE2S_KEYBYTES);
+ ADD_INT(d, "MAX_DIGEST_SIZE", BLAKE2S_OUTBYTES);
+
+ ADD_INT_CONST("BLAKE2S_SALT_SIZE", BLAKE2S_SALTBYTES);
+ ADD_INT_CONST("BLAKE2S_PERSON_SIZE", BLAKE2S_PERSONALBYTES);
+ ADD_INT_CONST("BLAKE2S_MAX_KEY_SIZE", BLAKE2S_KEYBYTES);
+ ADD_INT_CONST("BLAKE2S_MAX_DIGEST_SIZE", BLAKE2S_OUTBYTES);
+
+ return 0;
+}
+
+#undef ADD_INT
+#undef ADD_INT_CONST
+
+static PyModuleDef_Slot _blake2_slots[] = {
+ {Py_mod_exec, blake2_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef blake2_module = {
+ PyModuleDef_HEAD_INIT,
+ "_blake2",
+ .m_doc = blake2mod__doc__,
+ .m_size = sizeof(Blake2State),
+ .m_methods = blake2mod_functions,
+ .m_slots = _blake2_slots,
+ .m_traverse = _blake2_traverse,
+ .m_clear = _blake2_clear,
+ .m_free = _blake2_free,
+};
+
+PyMODINIT_FUNC
+PyInit__blake2(void)
+{
+ return PyModuleDef_Init(&blake2_module);
+}
diff --git a/contrib/tools/python3/Modules/_blake2/blake2module.h b/contrib/tools/python3/Modules/_blake2/blake2module.h
new file mode 100644
index 00000000000..3a19478eaf6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/blake2module.h
@@ -0,0 +1,43 @@
+#ifndef Py_BLAKE2MODULE_H
+#define Py_BLAKE2MODULE_H
+
+#ifdef HAVE_LIBB2
+#error #include <blake2.h>
+
+#else
+// use vendored copy of blake2
+
+// Prefix all public blake2 symbols with PyBlake2_
+#define blake2b PyBlake2_blake2b
+#define blake2b_compress PyBlake2_blake2b_compress
+#define blake2b_final PyBlake2_blake2b_final
+#define blake2b_init PyBlake2_blake2b_init
+#define blake2b_init_key PyBlake2_blake2b_init_key
+#define blake2b_init_param PyBlake2_blake2b_init_param
+#define blake2b_update PyBlake2_blake2b_update
+#define blake2bp PyBlake2_blake2bp
+#define blake2bp_final PyBlake2_blake2bp_final
+#define blake2bp_init PyBlake2_blake2bp_init
+#define blake2bp_init_key PyBlake2_blake2bp_init_key
+#define blake2bp_update PyBlake2_blake2bp_update
+#define blake2s PyBlake2_blake2s
+#define blake2s_compress PyBlake2_blake2s_compress
+#define blake2s_final PyBlake2_blake2s_final
+#define blake2s_init PyBlake2_blake2s_init
+#define blake2s_init_key PyBlake2_blake2s_init_key
+#define blake2s_init_param PyBlake2_blake2s_init_param
+#define blake2s_update PyBlake2_blake2s_update
+#define blake2sp PyBlake2_blake2sp
+#define blake2sp_final PyBlake2_blake2sp_final
+#define blake2sp_init PyBlake2_blake2sp_init
+#define blake2sp_init_key PyBlake2_blake2sp_init_key
+#define blake2sp_update PyBlake2_blake2sp_update
+
+#include "impl/blake2.h"
+
+#endif // HAVE_LIBB2
+
+// for secure_zero_memory(), store32(), store48(), and store64()
+#include "impl/blake2-impl.h"
+
+#endif // Py_BLAKE2MODULE_H
diff --git a/contrib/tools/python3/Modules/_blake2/blake2s_impl.c b/contrib/tools/python3/Modules/_blake2/blake2s_impl.c
new file mode 100644
index 00000000000..1c47328ece1
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/blake2s_impl.c
@@ -0,0 +1,416 @@
+/*
+ * Written in 2013 by Dmitry Chestnykh <[email protected]>
+ * Modified for CPython by Christian Heimes <[email protected]>
+ *
+ * To the extent possible under law, the author have dedicated all
+ * copyright and related and neighboring rights to this software to
+ * the public domain worldwide. This software is distributed without
+ * any warranty. http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+/* WARNING: autogenerated file!
+ *
+ * The blake2s_impl.c is autogenerated from blake2s_impl.c.
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_strhex.h" // _Py_strhex()
+
+#include "../hashlib.h"
+#include "blake2module.h"
+
+#ifndef HAVE_LIBB2
+/* pure SSE2 implementation is very slow, so only use the more optimized SSSE3+
+ * https://bugs.python.org/issue31834 */
+#if defined(__SSSE3__) || defined(__SSE4_1__) || defined(__AVX__) || defined(__XOP__)
+#include "impl/blake2s.c"
+#else
+#include "impl/blake2s-ref.c"
+#endif
+#endif // !HAVE_LIBB2
+
+#define HAVE_BLAKE2S 1
+
+extern PyType_Spec blake2s_type_spec;
+
+
+typedef struct {
+ PyObject_HEAD
+ blake2s_param param;
+ blake2s_state state;
+ PyThread_type_lock lock;
+} BLAKE2sObject;
+
+#include "clinic/blake2s_impl.c.h"
+
+/*[clinic input]
+module _blake2
+class _blake2.blake2s "BLAKE2sObject *" "&PyBlake2_BLAKE2sType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4b79d7ffe07286ce]*/
+
+
+static BLAKE2sObject *
+new_BLAKE2sObject(PyTypeObject *type)
+{
+ BLAKE2sObject *self;
+ self = (BLAKE2sObject *)type->tp_alloc(type, 0);
+ if (self != NULL) {
+ self->lock = NULL;
+ }
+ return self;
+}
+
+/*[clinic input]
+@classmethod
+_blake2.blake2s.__new__ as py_blake2s_new
+ data: object(c_default="NULL") = b''
+ /
+ *
+ digest_size: int(c_default="BLAKE2S_OUTBYTES") = _blake2.blake2s.MAX_DIGEST_SIZE
+ key: Py_buffer(c_default="NULL", py_default="b''") = None
+ salt: Py_buffer(c_default="NULL", py_default="b''") = None
+ person: Py_buffer(c_default="NULL", py_default="b''") = None
+ fanout: int = 1
+ depth: int = 1
+ leaf_size: unsigned_long = 0
+ node_offset: unsigned_long_long = 0
+ node_depth: int = 0
+ inner_size: int = 0
+ last_node: bool = False
+ usedforsecurity: bool = True
+
+Return a new BLAKE2s hash object.
+[clinic start generated code]*/
+
+static PyObject *
+py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
+ Py_buffer *key, Py_buffer *salt, Py_buffer *person,
+ int fanout, int depth, unsigned long leaf_size,
+ unsigned long long node_offset, int node_depth,
+ int inner_size, int last_node, int usedforsecurity)
+/*[clinic end generated code: output=556181f73905c686 input=4dda87723f23abb0]*/
+{
+ BLAKE2sObject *self = NULL;
+ Py_buffer buf;
+
+ self = new_BLAKE2sObject(type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ /* Zero parameter block. */
+ memset(&self->param, 0, sizeof(self->param));
+
+ /* Set digest size. */
+ if (digest_size <= 0 || digest_size > BLAKE2S_OUTBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "digest_size must be between 1 and %d bytes",
+ BLAKE2S_OUTBYTES);
+ goto error;
+ }
+ self->param.digest_length = digest_size;
+
+ /* Set salt parameter. */
+ if ((salt->obj != NULL) && salt->len) {
+ if (salt->len > BLAKE2S_SALTBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "maximum salt length is %d bytes",
+ BLAKE2S_SALTBYTES);
+ goto error;
+ }
+ memcpy(self->param.salt, salt->buf, salt->len);
+ }
+
+ /* Set personalization parameter. */
+ if ((person->obj != NULL) && person->len) {
+ if (person->len > BLAKE2S_PERSONALBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "maximum person length is %d bytes",
+ BLAKE2S_PERSONALBYTES);
+ goto error;
+ }
+ memcpy(self->param.personal, person->buf, person->len);
+ }
+
+ /* Set tree parameters. */
+ if (fanout < 0 || fanout > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "fanout must be between 0 and 255");
+ goto error;
+ }
+ self->param.fanout = (uint8_t)fanout;
+
+ if (depth <= 0 || depth > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "depth must be between 1 and 255");
+ goto error;
+ }
+ self->param.depth = (uint8_t)depth;
+
+ if (leaf_size > 0xFFFFFFFFU) {
+ PyErr_SetString(PyExc_OverflowError, "leaf_size is too large");
+ goto error;
+ }
+ // NB: Simple assignment here would be incorrect on big endian platforms.
+ store32(&(self->param.leaf_length), leaf_size);
+
+#ifdef HAVE_BLAKE2S
+ if (node_offset > 0xFFFFFFFFFFFFULL) {
+ /* maximum 2**48 - 1 */
+ PyErr_SetString(PyExc_OverflowError, "node_offset is too large");
+ goto error;
+ }
+ store48(&(self->param.node_offset), node_offset);
+#else
+ // NB: Simple assignment here would be incorrect on big endian platforms.
+ store64(&(self->param.node_offset), node_offset);
+#endif
+
+ if (node_depth < 0 || node_depth > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "node_depth must be between 0 and 255");
+ goto error;
+ }
+ self->param.node_depth = node_depth;
+
+ if (inner_size < 0 || inner_size > BLAKE2S_OUTBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "inner_size must be between 0 and is %d",
+ BLAKE2S_OUTBYTES);
+ goto error;
+ }
+ self->param.inner_length = inner_size;
+
+ /* Set key length. */
+ if ((key->obj != NULL) && key->len) {
+ if (key->len > BLAKE2S_KEYBYTES) {
+ PyErr_Format(PyExc_ValueError,
+ "maximum key length is %d bytes",
+ BLAKE2S_KEYBYTES);
+ goto error;
+ }
+ self->param.key_length = (uint8_t)key->len;
+ }
+
+ /* Initialize hash state. */
+ if (blake2s_init_param(&self->state, &self->param) < 0) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "error initializing hash state");
+ goto error;
+ }
+
+ /* Set last node flag (must come after initialization). */
+ self->state.last_node = last_node;
+
+ /* Process key block if any. */
+ if (self->param.key_length) {
+ uint8_t block[BLAKE2S_BLOCKBYTES];
+ memset(block, 0, sizeof(block));
+ memcpy(block, key->buf, key->len);
+ blake2s_update(&self->state, block, sizeof(block));
+ secure_zero_memory(block, sizeof(block));
+ }
+
+ /* Process initial data if any. */
+ if (data != NULL) {
+ GET_BUFFER_VIEW_OR_ERROR(data, &buf, goto error);
+
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ Py_BEGIN_ALLOW_THREADS
+ blake2s_update(&self->state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ blake2s_update(&self->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)self;
+
+ error:
+ if (self != NULL) {
+ Py_DECREF(self);
+ }
+ return NULL;
+}
+
+/*[clinic input]
+_blake2.blake2s.copy
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2s_copy_impl(BLAKE2sObject *self)
+/*[clinic end generated code: output=5b90131c4eae275e input=0b9d44942f0fe4b2]*/
+{
+ BLAKE2sObject *cpy;
+
+ if ((cpy = new_BLAKE2sObject(Py_TYPE(self))) == NULL)
+ return NULL;
+
+ ENTER_HASHLIB(self);
+ cpy->param = self->param;
+ cpy->state = self->state;
+ LEAVE_HASHLIB(self);
+ return (PyObject *)cpy;
+}
+
+/*[clinic input]
+_blake2.blake2s.update
+
+ data: object
+ /
+
+Update this hash object's state with the provided bytes-like object.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2s_update(BLAKE2sObject *self, PyObject *data)
+/*[clinic end generated code: output=757dc087fec37815 input=97500db2f9de4aaa]*/
+{
+ Py_buffer buf;
+
+ GET_BUFFER_VIEW_OR_ERROUT(data, &buf);
+
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE)
+ self->lock = PyThread_allocate_lock();
+
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ blake2s_update(&self->state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ blake2s_update(&self->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_blake2.blake2s.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2s_digest_impl(BLAKE2sObject *self)
+/*[clinic end generated code: output=40c566ca4bc6bc51 input=f41e0b8d6d937454]*/
+{
+ uint8_t digest[BLAKE2S_OUTBYTES];
+ blake2s_state state_cpy;
+
+ ENTER_HASHLIB(self);
+ state_cpy = self->state;
+ blake2s_final(&state_cpy, digest, self->param.digest_length);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest,
+ self->param.digest_length);
+}
+
+/*[clinic input]
+_blake2.blake2s.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+_blake2_blake2s_hexdigest_impl(BLAKE2sObject *self)
+/*[clinic end generated code: output=15153eb5e59c52eb input=c77a1321567e8952]*/
+{
+ uint8_t digest[BLAKE2S_OUTBYTES];
+ blake2s_state state_cpy;
+
+ ENTER_HASHLIB(self);
+ state_cpy = self->state;
+ blake2s_final(&state_cpy, digest, self->param.digest_length);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char *)digest, self->param.digest_length);
+}
+
+
+static PyMethodDef py_blake2s_methods[] = {
+ _BLAKE2_BLAKE2S_COPY_METHODDEF
+ _BLAKE2_BLAKE2S_DIGEST_METHODDEF
+ _BLAKE2_BLAKE2S_HEXDIGEST_METHODDEF
+ _BLAKE2_BLAKE2S_UPDATE_METHODDEF
+ {NULL, NULL}
+};
+
+
+
+static PyObject *
+py_blake2s_get_name(BLAKE2sObject *self, void *closure)
+{
+ return PyUnicode_FromString("blake2s");
+}
+
+
+
+static PyObject *
+py_blake2s_get_block_size(BLAKE2sObject *self, void *closure)
+{
+ return PyLong_FromLong(BLAKE2S_BLOCKBYTES);
+}
+
+
+
+static PyObject *
+py_blake2s_get_digest_size(BLAKE2sObject *self, void *closure)
+{
+ return PyLong_FromLong(self->param.digest_length);
+}
+
+
+static PyGetSetDef py_blake2s_getsetters[] = {
+ {"name", (getter)py_blake2s_get_name,
+ NULL, NULL, NULL},
+ {"block_size", (getter)py_blake2s_get_block_size,
+ NULL, NULL, NULL},
+ {"digest_size", (getter)py_blake2s_get_digest_size,
+ NULL, NULL, NULL},
+ {NULL}
+};
+
+
+static void
+py_blake2s_dealloc(PyObject *self)
+{
+ BLAKE2sObject *obj = (BLAKE2sObject *)self;
+
+ /* Try not to leave state in memory. */
+ secure_zero_memory(&obj->param, sizeof(obj->param));
+ secure_zero_memory(&obj->state, sizeof(obj->state));
+ if (obj->lock) {
+ PyThread_free_lock(obj->lock);
+ obj->lock = NULL;
+ }
+
+ PyTypeObject *type = Py_TYPE(self);
+ PyObject_Free(self);
+ Py_DECREF(type);
+}
+
+static PyType_Slot blake2s_type_slots[] = {
+ {Py_tp_dealloc, py_blake2s_dealloc},
+ {Py_tp_doc, (char *)py_blake2s_new__doc__},
+ {Py_tp_methods, py_blake2s_methods},
+ {Py_tp_getset, py_blake2s_getsetters},
+ {Py_tp_new, py_blake2s_new},
+ {0,0}
+};
+
+PyType_Spec blake2s_type_spec = {
+ .name = "_blake2.blake2s",
+ .basicsize = sizeof(BLAKE2sObject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = blake2s_type_slots
+};
diff --git a/contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h b/contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h
new file mode 100644
index 00000000000..99b0f098cc2
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/clinic/blake2b_impl.c.h
@@ -0,0 +1,279 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(py_blake2b_new__doc__,
+"blake2b(data=b\'\', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,\n"
+" key=b\'\', salt=b\'\', person=b\'\', fanout=1, depth=1, leaf_size=0,\n"
+" node_offset=0, node_depth=0, inner_size=0, last_node=False,\n"
+" usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new BLAKE2b hash object.");
+
+static PyObject *
+py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
+ Py_buffer *key, Py_buffer *salt, Py_buffer *person,
+ int fanout, int depth, unsigned long leaf_size,
+ unsigned long long node_offset, int node_depth,
+ int inner_size, int last_node, int usedforsecurity);
+
+static PyObject *
+py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 12
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(digest_size), &_Py_ID(key), &_Py_ID(salt), &_Py_ID(person), &_Py_ID(fanout), &_Py_ID(depth), &_Py_ID(leaf_size), &_Py_ID(node_offset), &_Py_ID(node_depth), &_Py_ID(inner_size), &_Py_ID(last_node), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "blake2b",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[13];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *data = NULL;
+ int digest_size = BLAKE2B_OUTBYTES;
+ Py_buffer key = {NULL, NULL};
+ Py_buffer salt = {NULL, NULL};
+ Py_buffer person = {NULL, NULL};
+ int fanout = 1;
+ int depth = 1;
+ unsigned long leaf_size = 0;
+ unsigned long long node_offset = 0;
+ int node_depth = 0;
+ int inner_size = 0;
+ int last_node = 0;
+ int usedforsecurity = 1;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ noptargs--;
+ data = fastargs[0];
+skip_optional_posonly:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (fastargs[1]) {
+ digest_size = _PyLong_AsInt(fastargs[1]);
+ if (digest_size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[2]) {
+ if (PyObject_GetBuffer(fastargs[2], &key, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&key, 'C')) {
+ _PyArg_BadArgument("blake2b", "argument 'key'", "contiguous buffer", fastargs[2]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[3]) {
+ if (PyObject_GetBuffer(fastargs[3], &salt, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&salt, 'C')) {
+ _PyArg_BadArgument("blake2b", "argument 'salt'", "contiguous buffer", fastargs[3]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[4]) {
+ if (PyObject_GetBuffer(fastargs[4], &person, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&person, 'C')) {
+ _PyArg_BadArgument("blake2b", "argument 'person'", "contiguous buffer", fastargs[4]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[5]) {
+ fanout = _PyLong_AsInt(fastargs[5]);
+ if (fanout == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[6]) {
+ depth = _PyLong_AsInt(fastargs[6]);
+ if (depth == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[7]) {
+ if (!_PyLong_UnsignedLong_Converter(fastargs[7], &leaf_size)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[8]) {
+ if (!_PyLong_UnsignedLongLong_Converter(fastargs[8], &node_offset)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[9]) {
+ node_depth = _PyLong_AsInt(fastargs[9]);
+ if (node_depth == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[10]) {
+ inner_size = _PyLong_AsInt(fastargs[10]);
+ if (inner_size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[11]) {
+ last_node = PyObject_IsTrue(fastargs[11]);
+ if (last_node < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ usedforsecurity = PyObject_IsTrue(fastargs[12]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = py_blake2b_new_impl(type, data, digest_size, &key, &salt, &person, fanout, depth, leaf_size, node_offset, node_depth, inner_size, last_node, usedforsecurity);
+
+exit:
+ /* Cleanup for key */
+ if (key.obj) {
+ PyBuffer_Release(&key);
+ }
+ /* Cleanup for salt */
+ if (salt.obj) {
+ PyBuffer_Release(&salt);
+ }
+ /* Cleanup for person */
+ if (person.obj) {
+ PyBuffer_Release(&person);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_blake2_blake2b_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define _BLAKE2_BLAKE2B_COPY_METHODDEF \
+ {"copy", (PyCFunction)_blake2_blake2b_copy, METH_NOARGS, _blake2_blake2b_copy__doc__},
+
+static PyObject *
+_blake2_blake2b_copy_impl(BLAKE2bObject *self);
+
+static PyObject *
+_blake2_blake2b_copy(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _blake2_blake2b_copy_impl(self);
+}
+
+PyDoc_STRVAR(_blake2_blake2b_update__doc__,
+"update($self, data, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided bytes-like object.");
+
+#define _BLAKE2_BLAKE2B_UPDATE_METHODDEF \
+ {"update", (PyCFunction)_blake2_blake2b_update, METH_O, _blake2_blake2b_update__doc__},
+
+PyDoc_STRVAR(_blake2_blake2b_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define _BLAKE2_BLAKE2B_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)_blake2_blake2b_digest, METH_NOARGS, _blake2_blake2b_digest__doc__},
+
+static PyObject *
+_blake2_blake2b_digest_impl(BLAKE2bObject *self);
+
+static PyObject *
+_blake2_blake2b_digest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _blake2_blake2b_digest_impl(self);
+}
+
+PyDoc_STRVAR(_blake2_blake2b_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define _BLAKE2_BLAKE2B_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)_blake2_blake2b_hexdigest, METH_NOARGS, _blake2_blake2b_hexdigest__doc__},
+
+static PyObject *
+_blake2_blake2b_hexdigest_impl(BLAKE2bObject *self);
+
+static PyObject *
+_blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _blake2_blake2b_hexdigest_impl(self);
+}
+/*[clinic end generated code: output=996b4fe396824797 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h b/contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h
new file mode 100644
index 00000000000..9b821fbcd62
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/clinic/blake2s_impl.c.h
@@ -0,0 +1,279 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(py_blake2s_new__doc__,
+"blake2s(data=b\'\', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,\n"
+" key=b\'\', salt=b\'\', person=b\'\', fanout=1, depth=1, leaf_size=0,\n"
+" node_offset=0, node_depth=0, inner_size=0, last_node=False,\n"
+" usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new BLAKE2s hash object.");
+
+static PyObject *
+py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
+ Py_buffer *key, Py_buffer *salt, Py_buffer *person,
+ int fanout, int depth, unsigned long leaf_size,
+ unsigned long long node_offset, int node_depth,
+ int inner_size, int last_node, int usedforsecurity);
+
+static PyObject *
+py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 12
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(digest_size), &_Py_ID(key), &_Py_ID(salt), &_Py_ID(person), &_Py_ID(fanout), &_Py_ID(depth), &_Py_ID(leaf_size), &_Py_ID(node_offset), &_Py_ID(node_depth), &_Py_ID(inner_size), &_Py_ID(last_node), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "digest_size", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "blake2s",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[13];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *data = NULL;
+ int digest_size = BLAKE2S_OUTBYTES;
+ Py_buffer key = {NULL, NULL};
+ Py_buffer salt = {NULL, NULL};
+ Py_buffer person = {NULL, NULL};
+ int fanout = 1;
+ int depth = 1;
+ unsigned long leaf_size = 0;
+ unsigned long long node_offset = 0;
+ int node_depth = 0;
+ int inner_size = 0;
+ int last_node = 0;
+ int usedforsecurity = 1;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ noptargs--;
+ data = fastargs[0];
+skip_optional_posonly:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (fastargs[1]) {
+ digest_size = _PyLong_AsInt(fastargs[1]);
+ if (digest_size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[2]) {
+ if (PyObject_GetBuffer(fastargs[2], &key, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&key, 'C')) {
+ _PyArg_BadArgument("blake2s", "argument 'key'", "contiguous buffer", fastargs[2]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[3]) {
+ if (PyObject_GetBuffer(fastargs[3], &salt, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&salt, 'C')) {
+ _PyArg_BadArgument("blake2s", "argument 'salt'", "contiguous buffer", fastargs[3]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[4]) {
+ if (PyObject_GetBuffer(fastargs[4], &person, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&person, 'C')) {
+ _PyArg_BadArgument("blake2s", "argument 'person'", "contiguous buffer", fastargs[4]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[5]) {
+ fanout = _PyLong_AsInt(fastargs[5]);
+ if (fanout == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[6]) {
+ depth = _PyLong_AsInt(fastargs[6]);
+ if (depth == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[7]) {
+ if (!_PyLong_UnsignedLong_Converter(fastargs[7], &leaf_size)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[8]) {
+ if (!_PyLong_UnsignedLongLong_Converter(fastargs[8], &node_offset)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[9]) {
+ node_depth = _PyLong_AsInt(fastargs[9]);
+ if (node_depth == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[10]) {
+ inner_size = _PyLong_AsInt(fastargs[10]);
+ if (inner_size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[11]) {
+ last_node = PyObject_IsTrue(fastargs[11]);
+ if (last_node < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ usedforsecurity = PyObject_IsTrue(fastargs[12]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = py_blake2s_new_impl(type, data, digest_size, &key, &salt, &person, fanout, depth, leaf_size, node_offset, node_depth, inner_size, last_node, usedforsecurity);
+
+exit:
+ /* Cleanup for key */
+ if (key.obj) {
+ PyBuffer_Release(&key);
+ }
+ /* Cleanup for salt */
+ if (salt.obj) {
+ PyBuffer_Release(&salt);
+ }
+ /* Cleanup for person */
+ if (person.obj) {
+ PyBuffer_Release(&person);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_blake2_blake2s_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define _BLAKE2_BLAKE2S_COPY_METHODDEF \
+ {"copy", (PyCFunction)_blake2_blake2s_copy, METH_NOARGS, _blake2_blake2s_copy__doc__},
+
+static PyObject *
+_blake2_blake2s_copy_impl(BLAKE2sObject *self);
+
+static PyObject *
+_blake2_blake2s_copy(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _blake2_blake2s_copy_impl(self);
+}
+
+PyDoc_STRVAR(_blake2_blake2s_update__doc__,
+"update($self, data, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided bytes-like object.");
+
+#define _BLAKE2_BLAKE2S_UPDATE_METHODDEF \
+ {"update", (PyCFunction)_blake2_blake2s_update, METH_O, _blake2_blake2s_update__doc__},
+
+PyDoc_STRVAR(_blake2_blake2s_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define _BLAKE2_BLAKE2S_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)_blake2_blake2s_digest, METH_NOARGS, _blake2_blake2s_digest__doc__},
+
+static PyObject *
+_blake2_blake2s_digest_impl(BLAKE2sObject *self);
+
+static PyObject *
+_blake2_blake2s_digest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _blake2_blake2s_digest_impl(self);
+}
+
+PyDoc_STRVAR(_blake2_blake2s_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define _BLAKE2_BLAKE2S_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)_blake2_blake2s_hexdigest, METH_NOARGS, _blake2_blake2s_hexdigest__doc__},
+
+static PyObject *
+_blake2_blake2s_hexdigest_impl(BLAKE2sObject *self);
+
+static PyObject *
+_blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _blake2_blake2s_hexdigest_impl(self);
+}
+/*[clinic end generated code: output=bd0fb7639e450618 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2-config.h b/contrib/tools/python3/Modules/_blake2/impl/blake2-config.h
new file mode 100644
index 00000000000..c09cb4bcf06
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2-config.h
@@ -0,0 +1,71 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2_CONFIG_H__
+#define __BLAKE2_CONFIG_H__
+
+#if defined(__SSE2__)
+#define HAVE_SSE2
+#endif
+
+#if defined(__SSSE3__)
+#define HAVE_SSSE3
+#endif
+
+#if defined(__SSE4_1__)
+#define HAVE_SSE4_1
+#endif
+
+#if defined(__AVX__)
+#define HAVE_AVX
+#endif
+
+#if defined(__XOP__)
+#define HAVE_XOP
+#endif
+
+
+#ifdef HAVE_AVX2
+#ifndef HAVE_AVX
+#define HAVE_AVX
+#endif
+#endif
+
+#ifdef HAVE_XOP
+#ifndef HAVE_AVX
+#define HAVE_AVX
+#endif
+#endif
+
+#ifdef HAVE_AVX
+#ifndef HAVE_SSE4_1
+#define HAVE_SSE4_1
+#endif
+#endif
+
+#ifdef HAVE_SSE4_1
+#ifndef HAVE_SSSE3
+#define HAVE_SSSE3
+#endif
+#endif
+
+#ifdef HAVE_SSSE3
+#define HAVE_SSE2
+#endif
+
+#if !defined(HAVE_SSE2)
+#error "This code requires at least SSE2."
+#endif
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h b/contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h
new file mode 100644
index 00000000000..9d2fbb72fc1
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2-impl.h
@@ -0,0 +1,162 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2_IMPL_H__
+#define __BLAKE2_IMPL_H__
+
+#if defined(_WIN32) || defined(WIN32)
+#include <windows.h>
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#define BLAKE2_IMPL_CAT(x,y) x ## y
+#define BLAKE2_IMPL_EVAL(x,y) BLAKE2_IMPL_CAT(x,y)
+#define BLAKE2_IMPL_NAME(fun) BLAKE2_IMPL_EVAL(fun, SUFFIX)
+
+static inline uint32_t load32( const void *src )
+{
+#if defined(NATIVE_LITTLE_ENDIAN)
+ uint32_t w;
+ memcpy( &w, src, sizeof( w ) );
+ return w;
+#else
+ const uint8_t *p = ( uint8_t * )src;
+ uint32_t w = *p++;
+ w |= ( uint32_t )( *p++ ) << 8;
+ w |= ( uint32_t )( *p++ ) << 16;
+ w |= ( uint32_t )( *p++ ) << 24;
+ return w;
+#endif
+}
+
+static inline uint64_t load64( const void *src )
+{
+#if defined(NATIVE_LITTLE_ENDIAN)
+ uint64_t w;
+ memcpy( &w, src, sizeof( w ) );
+ return w;
+#else
+ const uint8_t *p = ( uint8_t * )src;
+ uint64_t w = *p++;
+ w |= ( uint64_t )( *p++ ) << 8;
+ w |= ( uint64_t )( *p++ ) << 16;
+ w |= ( uint64_t )( *p++ ) << 24;
+ w |= ( uint64_t )( *p++ ) << 32;
+ w |= ( uint64_t )( *p++ ) << 40;
+ w |= ( uint64_t )( *p++ ) << 48;
+ w |= ( uint64_t )( *p++ ) << 56;
+ return w;
+#endif
+}
+
+static inline void store32( void *dst, uint32_t w )
+{
+#if defined(NATIVE_LITTLE_ENDIAN)
+ memcpy( dst, &w, sizeof( w ) );
+#else
+ uint8_t *p = ( uint8_t * )dst;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w;
+#endif
+}
+
+static inline void store64( void *dst, uint64_t w )
+{
+#if defined(NATIVE_LITTLE_ENDIAN)
+ memcpy( dst, &w, sizeof( w ) );
+#else
+ uint8_t *p = ( uint8_t * )dst;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w;
+#endif
+}
+
+static inline uint64_t load48( const void *src )
+{
+ const uint8_t *p = ( const uint8_t * )src;
+ uint64_t w = *p++;
+ w |= ( uint64_t )( *p++ ) << 8;
+ w |= ( uint64_t )( *p++ ) << 16;
+ w |= ( uint64_t )( *p++ ) << 24;
+ w |= ( uint64_t )( *p++ ) << 32;
+ w |= ( uint64_t )( *p++ ) << 40;
+ return w;
+}
+
+static inline void store48( void *dst, uint64_t w )
+{
+ uint8_t *p = ( uint8_t * )dst;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w; w >>= 8;
+ *p++ = ( uint8_t )w;
+}
+
+static inline uint32_t rotl32( const uint32_t w, const unsigned c )
+{
+ return ( w << c ) | ( w >> ( 32 - c ) );
+}
+
+static inline uint64_t rotl64( const uint64_t w, const unsigned c )
+{
+ return ( w << c ) | ( w >> ( 64 - c ) );
+}
+
+static inline uint32_t rotr32( const uint32_t w, const unsigned c )
+{
+ return ( w >> c ) | ( w << ( 32 - c ) );
+}
+
+static inline uint64_t rotr64( const uint64_t w, const unsigned c )
+{
+ return ( w >> c ) | ( w << ( 64 - c ) );
+}
+
+/* prevents compiler optimizing out memset() */
+static inline void secure_zero_memory(void *v, size_t n)
+{
+#if defined(_WIN32) || defined(WIN32)
+ SecureZeroMemory(v, n);
+#elif defined(__hpux)
+ static void *(*const volatile memset_v)(void *, int, size_t) = &memset;
+ memset_v(v, 0, n);
+#else
+// prioritize first the general C11 call
+#if defined(HAVE_MEMSET_S)
+ memset_s(v, n, 0, n);
+#elif defined(HAVE_EXPLICIT_BZERO)
+ explicit_bzero(v, n);
+#elif defined(HAVE_EXPLICIT_MEMSET)
+ explicit_memset(v, 0, n);
+#else
+ memset(v, 0, n);
+ __asm__ __volatile__("" :: "r"(v) : "memory");
+#endif
+#endif
+}
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2.h b/contrib/tools/python3/Modules/_blake2/impl/blake2.h
new file mode 100644
index 00000000000..a08d82efefe
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2.h
@@ -0,0 +1,177 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2_H__
+#define __BLAKE2_H__
+
+#include <stddef.h>
+#include <stdint.h>
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+ #define BLAKE2_DLL_IMPORT __declspec(dllimport)
+ #define BLAKE2_DLL_EXPORT __declspec(dllexport)
+ #define BLAKE2_DLL_PRIVATE
+#elif __GNUC__ >= 4
+ #define BLAKE2_DLL_IMPORT __attribute__ ((visibility ("default")))
+ #define BLAKE2_DLL_EXPORT __attribute__ ((visibility ("default")))
+ #define BLAKE2_DLL_PRIVATE __attribute__ ((visibility ("hidden")))
+#else
+ #define BLAKE2_DLL_IMPORT
+ #define BLAKE2_DLL_EXPORT
+ #define BLAKE2_DLL_PRIVATE
+#endif
+
+#if defined(BLAKE2_DLL)
+ #if defined(BLAKE2_DLL_EXPORTS) // defined if we are building the DLL
+ #define BLAKE2_API BLAKE2_DLL_EXPORT
+ #else
+ #define BLAKE2_API BLAKE2_DLL_IMPORT
+ #endif
+ #define BLAKE2_PRIVATE BLAKE2_DLL_PRIVATE // must only be used by hidden logic
+#else
+ #define BLAKE2_API
+ #define BLAKE2_PRIVATE
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#elif defined(_MSC_VER) && !defined(inline)
+#define inline __inline
+#endif
+
+ enum blake2s_constant
+ {
+ BLAKE2S_BLOCKBYTES = 64,
+ BLAKE2S_OUTBYTES = 32,
+ BLAKE2S_KEYBYTES = 32,
+ BLAKE2S_SALTBYTES = 8,
+ BLAKE2S_PERSONALBYTES = 8
+ };
+
+ enum blake2b_constant
+ {
+ BLAKE2B_BLOCKBYTES = 128,
+ BLAKE2B_OUTBYTES = 64,
+ BLAKE2B_KEYBYTES = 64,
+ BLAKE2B_SALTBYTES = 16,
+ BLAKE2B_PERSONALBYTES = 16
+ };
+
+#pragma pack(push, 1)
+ typedef struct __blake2s_param
+ {
+ uint8_t digest_length; // 1
+ uint8_t key_length; // 2
+ uint8_t fanout; // 3
+ uint8_t depth; // 4
+ uint32_t leaf_length; // 8
+ uint8_t node_offset[6];// 14
+ uint8_t node_depth; // 15
+ uint8_t inner_length; // 16
+ // uint8_t reserved[0];
+ uint8_t salt[BLAKE2S_SALTBYTES]; // 24
+ uint8_t personal[BLAKE2S_PERSONALBYTES]; // 32
+ } blake2s_param;
+
+ typedef struct __blake2s_state
+ {
+ uint32_t h[8];
+ uint32_t t[2];
+ uint32_t f[2];
+ uint8_t buf[2 * BLAKE2S_BLOCKBYTES];
+ uint32_t buflen;
+ uint8_t outlen;
+ uint8_t last_node;
+ } blake2s_state;
+
+ typedef struct __blake2b_param
+ {
+ uint8_t digest_length; // 1
+ uint8_t key_length; // 2
+ uint8_t fanout; // 3
+ uint8_t depth; // 4
+ uint32_t leaf_length; // 8
+ uint64_t node_offset; // 16
+ uint8_t node_depth; // 17
+ uint8_t inner_length; // 18
+ uint8_t reserved[14]; // 32
+ uint8_t salt[BLAKE2B_SALTBYTES]; // 48
+ uint8_t personal[BLAKE2B_PERSONALBYTES]; // 64
+ } blake2b_param;
+
+ typedef struct __blake2b_state
+ {
+ uint64_t h[8];
+ uint64_t t[2];
+ uint64_t f[2];
+ uint8_t buf[2 * BLAKE2B_BLOCKBYTES];
+ uint32_t buflen;
+ uint8_t outlen;
+ uint8_t last_node;
+ } blake2b_state;
+
+ typedef struct __blake2sp_state
+ {
+ blake2s_state S[8][1];
+ blake2s_state R[1];
+ uint8_t buf[8 * BLAKE2S_BLOCKBYTES];
+ uint32_t buflen;
+ uint8_t outlen;
+ } blake2sp_state;
+
+ typedef struct __blake2bp_state
+ {
+ blake2b_state S[4][1];
+ blake2b_state R[1];
+ uint8_t buf[4 * BLAKE2B_BLOCKBYTES];
+ uint32_t buflen;
+ uint8_t outlen;
+ } blake2bp_state;
+#pragma pack(pop)
+
+ // Streaming API
+ BLAKE2_API int blake2s_init( blake2s_state *S, size_t outlen );
+ BLAKE2_API int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
+ BLAKE2_API int blake2s_init_param( blake2s_state *S, const blake2s_param *P );
+ BLAKE2_API int blake2s_update( blake2s_state *S, const uint8_t *in, size_t inlen );
+ BLAKE2_API int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen );
+
+ BLAKE2_API int blake2b_init( blake2b_state *S, size_t outlen );
+ BLAKE2_API int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
+ BLAKE2_API int blake2b_init_param( blake2b_state *S, const blake2b_param *P );
+ BLAKE2_API int blake2b_update( blake2b_state *S, const uint8_t *in, size_t inlen );
+ BLAKE2_API int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen );
+
+ BLAKE2_API int blake2sp_init( blake2sp_state *S, size_t outlen );
+ BLAKE2_API int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen );
+ BLAKE2_API int blake2sp_update( blake2sp_state *S, const uint8_t *in, size_t inlen );
+ BLAKE2_API int blake2sp_final( blake2sp_state *S, uint8_t *out, size_t outlen );
+
+ BLAKE2_API int blake2bp_init( blake2bp_state *S, size_t outlen );
+ BLAKE2_API int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen );
+ BLAKE2_API int blake2bp_update( blake2bp_state *S, const uint8_t *in, size_t inlen );
+ BLAKE2_API int blake2bp_final( blake2bp_state *S, uint8_t *out, size_t outlen );
+
+ // Simple API
+ BLAKE2_API int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+ BLAKE2_API int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+
+ BLAKE2_API int blake2sp( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+ BLAKE2_API int blake2bp( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h
new file mode 100644
index 00000000000..1ba153c87d7
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse2.h
@@ -0,0 +1,68 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2B_LOAD_SSE2_H__
+#define __BLAKE2B_LOAD_SSE2_H__
+
+#define LOAD_MSG_0_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4)
+#define LOAD_MSG_0_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5)
+#define LOAD_MSG_0_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12)
+#define LOAD_MSG_0_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13)
+#define LOAD_MSG_1_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9)
+#define LOAD_MSG_1_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15)
+#define LOAD_MSG_1_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11)
+#define LOAD_MSG_1_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7)
+#define LOAD_MSG_2_1(b0, b1) b0 = _mm_set_epi64x(m12, m11); b1 = _mm_set_epi64x(m15, m5)
+#define LOAD_MSG_2_2(b0, b1) b0 = _mm_set_epi64x(m0, m8); b1 = _mm_set_epi64x(m13, m2)
+#define LOAD_MSG_2_3(b0, b1) b0 = _mm_set_epi64x(m3, m10); b1 = _mm_set_epi64x(m9, m7)
+#define LOAD_MSG_2_4(b0, b1) b0 = _mm_set_epi64x(m6, m14); b1 = _mm_set_epi64x(m4, m1)
+#define LOAD_MSG_3_1(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m13)
+#define LOAD_MSG_3_2(b0, b1) b0 = _mm_set_epi64x(m1, m9); b1 = _mm_set_epi64x(m14, m12)
+#define LOAD_MSG_3_3(b0, b1) b0 = _mm_set_epi64x(m5, m2); b1 = _mm_set_epi64x(m15, m4)
+#define LOAD_MSG_3_4(b0, b1) b0 = _mm_set_epi64x(m10, m6); b1 = _mm_set_epi64x(m8, m0)
+#define LOAD_MSG_4_1(b0, b1) b0 = _mm_set_epi64x(m5, m9); b1 = _mm_set_epi64x(m10, m2)
+#define LOAD_MSG_4_2(b0, b1) b0 = _mm_set_epi64x(m7, m0); b1 = _mm_set_epi64x(m15, m4)
+#define LOAD_MSG_4_3(b0, b1) b0 = _mm_set_epi64x(m11, m14); b1 = _mm_set_epi64x(m3, m6)
+#define LOAD_MSG_4_4(b0, b1) b0 = _mm_set_epi64x(m12, m1); b1 = _mm_set_epi64x(m13, m8)
+#define LOAD_MSG_5_1(b0, b1) b0 = _mm_set_epi64x(m6, m2); b1 = _mm_set_epi64x(m8, m0)
+#define LOAD_MSG_5_2(b0, b1) b0 = _mm_set_epi64x(m10, m12); b1 = _mm_set_epi64x(m3, m11)
+#define LOAD_MSG_5_3(b0, b1) b0 = _mm_set_epi64x(m7, m4); b1 = _mm_set_epi64x(m1, m15)
+#define LOAD_MSG_5_4(b0, b1) b0 = _mm_set_epi64x(m5, m13); b1 = _mm_set_epi64x(m9, m14)
+#define LOAD_MSG_6_1(b0, b1) b0 = _mm_set_epi64x(m1, m12); b1 = _mm_set_epi64x(m4, m14)
+#define LOAD_MSG_6_2(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m10, m13)
+#define LOAD_MSG_6_3(b0, b1) b0 = _mm_set_epi64x(m6, m0); b1 = _mm_set_epi64x(m8, m9)
+#define LOAD_MSG_6_4(b0, b1) b0 = _mm_set_epi64x(m3, m7); b1 = _mm_set_epi64x(m11, m2)
+#define LOAD_MSG_7_1(b0, b1) b0 = _mm_set_epi64x(m7, m13); b1 = _mm_set_epi64x(m3, m12)
+#define LOAD_MSG_7_2(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m9, m1)
+#define LOAD_MSG_7_3(b0, b1) b0 = _mm_set_epi64x(m15, m5); b1 = _mm_set_epi64x(m2, m8)
+#define LOAD_MSG_7_4(b0, b1) b0 = _mm_set_epi64x(m4, m0); b1 = _mm_set_epi64x(m10, m6)
+#define LOAD_MSG_8_1(b0, b1) b0 = _mm_set_epi64x(m14, m6); b1 = _mm_set_epi64x(m0, m11)
+#define LOAD_MSG_8_2(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m8, m3)
+#define LOAD_MSG_8_3(b0, b1) b0 = _mm_set_epi64x(m13, m12); b1 = _mm_set_epi64x(m10, m1)
+#define LOAD_MSG_8_4(b0, b1) b0 = _mm_set_epi64x(m7, m2); b1 = _mm_set_epi64x(m5, m4)
+#define LOAD_MSG_9_1(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m1, m7)
+#define LOAD_MSG_9_2(b0, b1) b0 = _mm_set_epi64x(m4, m2); b1 = _mm_set_epi64x(m5, m6)
+#define LOAD_MSG_9_3(b0, b1) b0 = _mm_set_epi64x(m9, m15); b1 = _mm_set_epi64x(m13, m3)
+#define LOAD_MSG_9_4(b0, b1) b0 = _mm_set_epi64x(m14, m11); b1 = _mm_set_epi64x(m0, m12)
+#define LOAD_MSG_10_1(b0, b1) b0 = _mm_set_epi64x(m2, m0); b1 = _mm_set_epi64x(m6, m4)
+#define LOAD_MSG_10_2(b0, b1) b0 = _mm_set_epi64x(m3, m1); b1 = _mm_set_epi64x(m7, m5)
+#define LOAD_MSG_10_3(b0, b1) b0 = _mm_set_epi64x(m10, m8); b1 = _mm_set_epi64x(m14, m12)
+#define LOAD_MSG_10_4(b0, b1) b0 = _mm_set_epi64x(m11, m9); b1 = _mm_set_epi64x(m15, m13)
+#define LOAD_MSG_11_1(b0, b1) b0 = _mm_set_epi64x(m4, m14); b1 = _mm_set_epi64x(m13, m9)
+#define LOAD_MSG_11_2(b0, b1) b0 = _mm_set_epi64x(m8, m10); b1 = _mm_set_epi64x(m6, m15)
+#define LOAD_MSG_11_3(b0, b1) b0 = _mm_set_epi64x(m0, m1); b1 = _mm_set_epi64x(m5, m11)
+#define LOAD_MSG_11_4(b0, b1) b0 = _mm_set_epi64x(m2, m12); b1 = _mm_set_epi64x(m3, m7)
+
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h
new file mode 100644
index 00000000000..f6c1bc8393f
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-load-sse41.h
@@ -0,0 +1,402 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2B_LOAD_SSE41_H__
+#define __BLAKE2B_LOAD_SSE41_H__
+
+#define LOAD_MSG_0_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m0, m1); \
+b1 = _mm_unpacklo_epi64(m2, m3); \
+} while(0)
+
+
+#define LOAD_MSG_0_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m0, m1); \
+b1 = _mm_unpackhi_epi64(m2, m3); \
+} while(0)
+
+
+#define LOAD_MSG_0_3(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m4, m5); \
+b1 = _mm_unpacklo_epi64(m6, m7); \
+} while(0)
+
+
+#define LOAD_MSG_0_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m4, m5); \
+b1 = _mm_unpackhi_epi64(m6, m7); \
+} while(0)
+
+
+#define LOAD_MSG_1_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m7, m2); \
+b1 = _mm_unpackhi_epi64(m4, m6); \
+} while(0)
+
+
+#define LOAD_MSG_1_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m5, m4); \
+b1 = _mm_alignr_epi8(m3, m7, 8); \
+} while(0)
+
+
+#define LOAD_MSG_1_3(b0, b1) \
+do \
+{ \
+b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \
+b1 = _mm_unpackhi_epi64(m5, m2); \
+} while(0)
+
+
+#define LOAD_MSG_1_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m6, m1); \
+b1 = _mm_unpackhi_epi64(m3, m1); \
+} while(0)
+
+
+#define LOAD_MSG_2_1(b0, b1) \
+do \
+{ \
+b0 = _mm_alignr_epi8(m6, m5, 8); \
+b1 = _mm_unpackhi_epi64(m2, m7); \
+} while(0)
+
+
+#define LOAD_MSG_2_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m4, m0); \
+b1 = _mm_blend_epi16(m1, m6, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_2_3(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m5, m1, 0xF0); \
+b1 = _mm_unpackhi_epi64(m3, m4); \
+} while(0)
+
+
+#define LOAD_MSG_2_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m7, m3); \
+b1 = _mm_alignr_epi8(m2, m0, 8); \
+} while(0)
+
+
+#define LOAD_MSG_3_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m3, m1); \
+b1 = _mm_unpackhi_epi64(m6, m5); \
+} while(0)
+
+
+#define LOAD_MSG_3_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m4, m0); \
+b1 = _mm_unpacklo_epi64(m6, m7); \
+} while(0)
+
+
+#define LOAD_MSG_3_3(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m1, m2, 0xF0); \
+b1 = _mm_blend_epi16(m2, m7, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_3_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m3, m5); \
+b1 = _mm_unpacklo_epi64(m0, m4); \
+} while(0)
+
+
+#define LOAD_MSG_4_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m4, m2); \
+b1 = _mm_unpacklo_epi64(m1, m5); \
+} while(0)
+
+
+#define LOAD_MSG_4_2(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m0, m3, 0xF0); \
+b1 = _mm_blend_epi16(m2, m7, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_4_3(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m7, m5, 0xF0); \
+b1 = _mm_blend_epi16(m3, m1, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_4_4(b0, b1) \
+do \
+{ \
+b0 = _mm_alignr_epi8(m6, m0, 8); \
+b1 = _mm_blend_epi16(m4, m6, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_5_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m1, m3); \
+b1 = _mm_unpacklo_epi64(m0, m4); \
+} while(0)
+
+
+#define LOAD_MSG_5_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m6, m5); \
+b1 = _mm_unpackhi_epi64(m5, m1); \
+} while(0)
+
+
+#define LOAD_MSG_5_3(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m2, m3, 0xF0); \
+b1 = _mm_unpackhi_epi64(m7, m0); \
+} while(0)
+
+
+#define LOAD_MSG_5_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m6, m2); \
+b1 = _mm_blend_epi16(m7, m4, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_6_1(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m6, m0, 0xF0); \
+b1 = _mm_unpacklo_epi64(m7, m2); \
+} while(0)
+
+
+#define LOAD_MSG_6_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m2, m7); \
+b1 = _mm_alignr_epi8(m5, m6, 8); \
+} while(0)
+
+
+#define LOAD_MSG_6_3(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m0, m3); \
+b1 = _mm_shuffle_epi32(m4, _MM_SHUFFLE(1,0,3,2)); \
+} while(0)
+
+
+#define LOAD_MSG_6_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m3, m1); \
+b1 = _mm_blend_epi16(m1, m5, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_7_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m6, m3); \
+b1 = _mm_blend_epi16(m6, m1, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_7_2(b0, b1) \
+do \
+{ \
+b0 = _mm_alignr_epi8(m7, m5, 8); \
+b1 = _mm_unpackhi_epi64(m0, m4); \
+} while(0)
+
+
+#define LOAD_MSG_7_3(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m2, m7); \
+b1 = _mm_unpacklo_epi64(m4, m1); \
+} while(0)
+
+
+#define LOAD_MSG_7_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m0, m2); \
+b1 = _mm_unpacklo_epi64(m3, m5); \
+} while(0)
+
+
+#define LOAD_MSG_8_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m3, m7); \
+b1 = _mm_alignr_epi8(m0, m5, 8); \
+} while(0)
+
+
+#define LOAD_MSG_8_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m7, m4); \
+b1 = _mm_alignr_epi8(m4, m1, 8); \
+} while(0)
+
+
+#define LOAD_MSG_8_3(b0, b1) \
+do \
+{ \
+b0 = m6; \
+b1 = _mm_alignr_epi8(m5, m0, 8); \
+} while(0)
+
+
+#define LOAD_MSG_8_4(b0, b1) \
+do \
+{ \
+b0 = _mm_blend_epi16(m1, m3, 0xF0); \
+b1 = m2; \
+} while(0)
+
+
+#define LOAD_MSG_9_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m5, m4); \
+b1 = _mm_unpackhi_epi64(m3, m0); \
+} while(0)
+
+
+#define LOAD_MSG_9_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m1, m2); \
+b1 = _mm_blend_epi16(m3, m2, 0xF0); \
+} while(0)
+
+
+#define LOAD_MSG_9_3(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m7, m4); \
+b1 = _mm_unpackhi_epi64(m1, m6); \
+} while(0)
+
+
+#define LOAD_MSG_9_4(b0, b1) \
+do \
+{ \
+b0 = _mm_alignr_epi8(m7, m5, 8); \
+b1 = _mm_unpacklo_epi64(m6, m0); \
+} while(0)
+
+
+#define LOAD_MSG_10_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m0, m1); \
+b1 = _mm_unpacklo_epi64(m2, m3); \
+} while(0)
+
+
+#define LOAD_MSG_10_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m0, m1); \
+b1 = _mm_unpackhi_epi64(m2, m3); \
+} while(0)
+
+
+#define LOAD_MSG_10_3(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m4, m5); \
+b1 = _mm_unpacklo_epi64(m6, m7); \
+} while(0)
+
+
+#define LOAD_MSG_10_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpackhi_epi64(m4, m5); \
+b1 = _mm_unpackhi_epi64(m6, m7); \
+} while(0)
+
+
+#define LOAD_MSG_11_1(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m7, m2); \
+b1 = _mm_unpackhi_epi64(m4, m6); \
+} while(0)
+
+
+#define LOAD_MSG_11_2(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m5, m4); \
+b1 = _mm_alignr_epi8(m3, m7, 8); \
+} while(0)
+
+
+#define LOAD_MSG_11_3(b0, b1) \
+do \
+{ \
+b0 = _mm_shuffle_epi32(m0, _MM_SHUFFLE(1,0,3,2)); \
+b1 = _mm_unpackhi_epi64(m5, m2); \
+} while(0)
+
+
+#define LOAD_MSG_11_4(b0, b1) \
+do \
+{ \
+b0 = _mm_unpacklo_epi64(m6, m1); \
+b1 = _mm_unpackhi_epi64(m3, m1); \
+} while(0)
+
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c b/contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c
new file mode 100644
index 00000000000..e58c43659d9
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-ref.c
@@ -0,0 +1,379 @@
+/*
+ BLAKE2 reference source code package - reference C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "blake2.h"
+#include "blake2-impl.h"
+
+static const uint64_t blake2b_IV[8] =
+{
+ 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL,
+ 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL,
+ 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,
+ 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL
+};
+
+static const uint8_t blake2b_sigma[12][16] =
+{
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
+ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
+ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
+ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
+ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
+ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
+ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
+ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
+ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
+};
+
+
+static inline int blake2b_set_lastnode( blake2b_state *S )
+{
+ S->f[1] = ~0ULL;
+ return 0;
+}
+
+static inline int blake2b_clear_lastnode( blake2b_state *S )
+{
+ S->f[1] = 0ULL;
+ return 0;
+}
+
+/* Some helper functions, not necessarily useful */
+static inline int blake2b_set_lastblock( blake2b_state *S )
+{
+ if( S->last_node ) blake2b_set_lastnode( S );
+
+ S->f[0] = ~0ULL;
+ return 0;
+}
+
+static inline int blake2b_clear_lastblock( blake2b_state *S )
+{
+ if( S->last_node ) blake2b_clear_lastnode( S );
+
+ S->f[0] = 0ULL;
+ return 0;
+}
+
+static inline int blake2b_increment_counter( blake2b_state *S, const uint64_t inc )
+{
+ S->t[0] += inc;
+ S->t[1] += ( S->t[0] < inc );
+ return 0;
+}
+
+
+
+// Parameter-related functions
+static inline int blake2b_param_set_digest_length( blake2b_param *P, const uint8_t digest_length )
+{
+ P->digest_length = digest_length;
+ return 0;
+}
+
+static inline int blake2b_param_set_fanout( blake2b_param *P, const uint8_t fanout )
+{
+ P->fanout = fanout;
+ return 0;
+}
+
+static inline int blake2b_param_set_max_depth( blake2b_param *P, const uint8_t depth )
+{
+ P->depth = depth;
+ return 0;
+}
+
+static inline int blake2b_param_set_leaf_length( blake2b_param *P, const uint32_t leaf_length )
+{
+ store32( &P->leaf_length, leaf_length );
+ return 0;
+}
+
+static inline int blake2b_param_set_node_offset( blake2b_param *P, const uint64_t node_offset )
+{
+ store64( &P->node_offset, node_offset );
+ return 0;
+}
+
+static inline int blake2b_param_set_node_depth( blake2b_param *P, const uint8_t node_depth )
+{
+ P->node_depth = node_depth;
+ return 0;
+}
+
+static inline int blake2b_param_set_inner_length( blake2b_param *P, const uint8_t inner_length )
+{
+ P->inner_length = inner_length;
+ return 0;
+}
+
+static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] )
+{
+ memcpy( P->salt, salt, BLAKE2B_SALTBYTES );
+ return 0;
+}
+
+static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
+{
+ memcpy( P->personal, personal, BLAKE2B_PERSONALBYTES );
+ return 0;
+}
+
+static inline int blake2b_init0( blake2b_state *S )
+{
+ memset( S, 0, sizeof( blake2b_state ) );
+
+ for( int i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i];
+
+ return 0;
+}
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+ int blake2b_init( blake2b_state *S, size_t outlen );
+ int blake2b_init_param( blake2b_state *S, const blake2b_param *P );
+ int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
+ int blake2b_update( blake2b_state *S, const uint8_t *in, size_t inlen );
+ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen );
+ int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+#if defined(__cplusplus)
+}
+#endif
+
+/* init xors IV with input parameter block */
+int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
+{
+ blake2b_init0( S );
+ uint8_t *p = ( uint8_t * )( P );
+
+ /* IV XOR ParamBlock */
+ for( size_t i = 0; i < 8; ++i )
+ S->h[i] ^= load64( p + sizeof( S->h[i] ) * i );
+
+ S->outlen = P->digest_length;
+ return 0;
+}
+
+
+
+int blake2b_init( blake2b_state *S, size_t outlen )
+{
+ blake2b_param P[1];
+
+ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
+
+ P->digest_length = ( uint8_t ) outlen;
+ P->key_length = 0;
+ P->fanout = 1;
+ P->depth = 1;
+ store32( &P->leaf_length, 0 );
+ store64( &P->node_offset, 0 );
+ P->node_depth = 0;
+ P->inner_length = 0;
+ memset( P->reserved, 0, sizeof( P->reserved ) );
+ memset( P->salt, 0, sizeof( P->salt ) );
+ memset( P->personal, 0, sizeof( P->personal ) );
+ return blake2b_init_param( S, P );
+}
+
+
+int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen )
+{
+ blake2b_param P[1];
+
+ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
+
+ if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1;
+
+ P->digest_length = ( uint8_t ) outlen;
+ P->key_length = ( uint8_t ) keylen;
+ P->fanout = 1;
+ P->depth = 1;
+ store32( &P->leaf_length, 0 );
+ store64( &P->node_offset, 0 );
+ P->node_depth = 0;
+ P->inner_length = 0;
+ memset( P->reserved, 0, sizeof( P->reserved ) );
+ memset( P->salt, 0, sizeof( P->salt ) );
+ memset( P->personal, 0, sizeof( P->personal ) );
+
+ if( blake2b_init_param( S, P ) < 0 ) return -1;
+
+ {
+ uint8_t block[BLAKE2B_BLOCKBYTES];
+ memset( block, 0, BLAKE2B_BLOCKBYTES );
+ memcpy( block, key, keylen );
+ blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
+ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */
+ }
+ return 0;
+}
+
+static int blake2b_compress( blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES] )
+{
+ uint64_t m[16];
+ uint64_t v[16];
+ size_t i;
+
+ for( i = 0; i < 16; ++i )
+ m[i] = load64( block + i * sizeof( m[i] ) );
+
+ for( i = 0; i < 8; ++i )
+ v[i] = S->h[i];
+
+ v[ 8] = blake2b_IV[0];
+ v[ 9] = blake2b_IV[1];
+ v[10] = blake2b_IV[2];
+ v[11] = blake2b_IV[3];
+ v[12] = S->t[0] ^ blake2b_IV[4];
+ v[13] = S->t[1] ^ blake2b_IV[5];
+ v[14] = S->f[0] ^ blake2b_IV[6];
+ v[15] = S->f[1] ^ blake2b_IV[7];
+#define G(r,i,a,b,c,d) \
+ do { \
+ a = a + b + m[blake2b_sigma[r][2*i+0]]; \
+ d = rotr64(d ^ a, 32); \
+ c = c + d; \
+ b = rotr64(b ^ c, 24); \
+ a = a + b + m[blake2b_sigma[r][2*i+1]]; \
+ d = rotr64(d ^ a, 16); \
+ c = c + d; \
+ b = rotr64(b ^ c, 63); \
+ } while(0)
+#define ROUND(r) \
+ do { \
+ G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
+ G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
+ G(r,2,v[ 2],v[ 6],v[10],v[14]); \
+ G(r,3,v[ 3],v[ 7],v[11],v[15]); \
+ G(r,4,v[ 0],v[ 5],v[10],v[15]); \
+ G(r,5,v[ 1],v[ 6],v[11],v[12]); \
+ G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
+ G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
+ } while(0)
+ ROUND( 0 );
+ ROUND( 1 );
+ ROUND( 2 );
+ ROUND( 3 );
+ ROUND( 4 );
+ ROUND( 5 );
+ ROUND( 6 );
+ ROUND( 7 );
+ ROUND( 8 );
+ ROUND( 9 );
+ ROUND( 10 );
+ ROUND( 11 );
+
+ for( i = 0; i < 8; ++i )
+ S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
+
+#undef G
+#undef ROUND
+ return 0;
+}
+
+
+int blake2b_update( blake2b_state *S, const uint8_t *in, size_t inlen )
+{
+ while( inlen > 0 )
+ {
+ uint32_t left = S->buflen;
+ uint32_t fill = 2 * BLAKE2B_BLOCKBYTES - left;
+
+ if( inlen > fill )
+ {
+ memcpy( S->buf + left, in, fill ); // Fill buffer
+ S->buflen += fill;
+ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
+ blake2b_compress( S, S->buf ); // Compress
+ memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); // Shift buffer left
+ S->buflen -= BLAKE2B_BLOCKBYTES;
+ in += fill;
+ inlen -= fill;
+ }
+ else // inlen <= fill
+ {
+ memcpy( S->buf + left, in, inlen );
+ S->buflen += ( uint32_t ) inlen; // Be lazy, do not compress
+ in += inlen;
+ inlen -= inlen;
+ }
+ }
+
+ return 0;
+}
+
+int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen )
+{
+ uint8_t buffer[BLAKE2B_OUTBYTES];
+ size_t i;
+
+ if(S->outlen != outlen) return -1;
+
+ if( S->buflen > BLAKE2B_BLOCKBYTES )
+ {
+ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
+ blake2b_compress( S, S->buf );
+ S->buflen -= BLAKE2B_BLOCKBYTES;
+ memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen );
+ }
+
+ blake2b_increment_counter( S, S->buflen );
+ blake2b_set_lastblock( S );
+ memset( S->buf + S->buflen, 0, 2 * BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */
+ blake2b_compress( S, S->buf );
+
+ for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
+ store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );
+
+ memcpy( out, buffer, outlen );
+ return 0;
+}
+
+int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
+{
+ blake2b_state S[1];
+
+ /* Verify parameters */
+ if ( NULL == in && inlen > 0 ) return -1;
+
+ if ( NULL == out ) return -1;
+
+ if( NULL == key && keylen > 0 ) return -1;
+
+ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1;
+
+ if( keylen > BLAKE2B_KEYBYTES ) return -1;
+
+ if( keylen > 0 )
+ {
+ if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1;
+ }
+ else
+ {
+ if( blake2b_init( S, outlen ) < 0 ) return -1;
+ }
+
+ if( blake2b_update( S, ( uint8_t * )in, inlen ) < 0 ) return -1;
+ return blake2b_final( S, out, outlen );
+}
+
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h b/contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h
new file mode 100644
index 00000000000..5b452c4d63b
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b-round.h
@@ -0,0 +1,160 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2B_ROUND_H__
+#define __BLAKE2B_ROUND_H__
+
+#define LOAD(p) _mm_load_si128( (__m128i *)(p) )
+#define STORE(p,r) _mm_store_si128((__m128i *)(p), r)
+
+#define LOADU(p) _mm_loadu_si128( (__m128i *)(p) )
+#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r)
+
+#define TOF(reg) _mm_castsi128_ps((reg))
+#define TOI(reg) _mm_castps_si128((reg))
+
+#define LIKELY(x) __builtin_expect((x),1)
+
+
+/* Microarchitecture-specific macros */
+#ifndef HAVE_XOP
+#ifdef HAVE_SSSE3
+#define _mm_roti_epi64(x, c) \
+ (-(c) == 32) ? _mm_shuffle_epi32((x), _MM_SHUFFLE(2,3,0,1)) \
+ : (-(c) == 24) ? _mm_shuffle_epi8((x), r24) \
+ : (-(c) == 16) ? _mm_shuffle_epi8((x), r16) \
+ : (-(c) == 63) ? _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_add_epi64((x), (x))) \
+ : _mm_xor_si128(_mm_srli_epi64((x), -(c)), _mm_slli_epi64((x), 64-(-(c))))
+#else
+#define _mm_roti_epi64(r, c) _mm_xor_si128(_mm_srli_epi64( (r), -(c) ),_mm_slli_epi64( (r), 64-(-(c)) ))
+#endif
+#else
+/* ... */
+#endif
+
+
+
+#define G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \
+ row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \
+ row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \
+ \
+ row4l = _mm_xor_si128(row4l, row1l); \
+ row4h = _mm_xor_si128(row4h, row1h); \
+ \
+ row4l = _mm_roti_epi64(row4l, -32); \
+ row4h = _mm_roti_epi64(row4h, -32); \
+ \
+ row3l = _mm_add_epi64(row3l, row4l); \
+ row3h = _mm_add_epi64(row3h, row4h); \
+ \
+ row2l = _mm_xor_si128(row2l, row3l); \
+ row2h = _mm_xor_si128(row2h, row3h); \
+ \
+ row2l = _mm_roti_epi64(row2l, -24); \
+ row2h = _mm_roti_epi64(row2h, -24); \
+
+#define G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1) \
+ row1l = _mm_add_epi64(_mm_add_epi64(row1l, b0), row2l); \
+ row1h = _mm_add_epi64(_mm_add_epi64(row1h, b1), row2h); \
+ \
+ row4l = _mm_xor_si128(row4l, row1l); \
+ row4h = _mm_xor_si128(row4h, row1h); \
+ \
+ row4l = _mm_roti_epi64(row4l, -16); \
+ row4h = _mm_roti_epi64(row4h, -16); \
+ \
+ row3l = _mm_add_epi64(row3l, row4l); \
+ row3h = _mm_add_epi64(row3h, row4h); \
+ \
+ row2l = _mm_xor_si128(row2l, row3l); \
+ row2h = _mm_xor_si128(row2h, row3h); \
+ \
+ row2l = _mm_roti_epi64(row2l, -63); \
+ row2h = _mm_roti_epi64(row2h, -63); \
+
+#if defined(HAVE_SSSE3)
+#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \
+ t0 = _mm_alignr_epi8(row2h, row2l, 8); \
+ t1 = _mm_alignr_epi8(row2l, row2h, 8); \
+ row2l = t0; \
+ row2h = t1; \
+ \
+ t0 = row3l; \
+ row3l = row3h; \
+ row3h = t0; \
+ \
+ t0 = _mm_alignr_epi8(row4h, row4l, 8); \
+ t1 = _mm_alignr_epi8(row4l, row4h, 8); \
+ row4l = t1; \
+ row4h = t0;
+
+#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \
+ t0 = _mm_alignr_epi8(row2l, row2h, 8); \
+ t1 = _mm_alignr_epi8(row2h, row2l, 8); \
+ row2l = t0; \
+ row2h = t1; \
+ \
+ t0 = row3l; \
+ row3l = row3h; \
+ row3h = t0; \
+ \
+ t0 = _mm_alignr_epi8(row4l, row4h, 8); \
+ t1 = _mm_alignr_epi8(row4h, row4l, 8); \
+ row4l = t1; \
+ row4h = t0;
+#else
+
+#define DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \
+ t0 = row4l;\
+ t1 = row2l;\
+ row4l = row3l;\
+ row3l = row3h;\
+ row3h = row4l;\
+ row4l = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t0, t0)); \
+ row4h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row4h, row4h)); \
+ row2l = _mm_unpackhi_epi64(row2l, _mm_unpacklo_epi64(row2h, row2h)); \
+ row2h = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(t1, t1))
+
+#define UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h) \
+ t0 = row3l;\
+ row3l = row3h;\
+ row3h = t0;\
+ t0 = row2l;\
+ t1 = row4l;\
+ row2l = _mm_unpackhi_epi64(row2h, _mm_unpacklo_epi64(row2l, row2l)); \
+ row2h = _mm_unpackhi_epi64(t0, _mm_unpacklo_epi64(row2h, row2h)); \
+ row4l = _mm_unpackhi_epi64(row4l, _mm_unpacklo_epi64(row4h, row4h)); \
+ row4h = _mm_unpackhi_epi64(row4h, _mm_unpacklo_epi64(t1, t1))
+
+#endif
+
+#if defined(HAVE_SSE4_1)
+#include "blake2b-load-sse41.h"
+#else
+#include "blake2b-load-sse2.h"
+#endif
+
+#define ROUND(r) \
+ LOAD_MSG_ ##r ##_1(b0, b1); \
+ G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
+ LOAD_MSG_ ##r ##_2(b0, b1); \
+ G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
+ DIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h); \
+ LOAD_MSG_ ##r ##_3(b0, b1); \
+ G1(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
+ LOAD_MSG_ ##r ##_4(b0, b1); \
+ G2(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h,b0,b1); \
+ UNDIAGONALIZE(row1l,row2l,row3l,row4l,row1h,row2h,row3h,row4h);
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2b.c b/contrib/tools/python3/Modules/_blake2/impl/blake2b.c
new file mode 100644
index 00000000000..cef22838917
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2b.c
@@ -0,0 +1,436 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "blake2.h"
+#include "blake2-impl.h"
+
+#include "blake2-config.h"
+
+#if defined(_MSC_VER)
+#include <intrin.h>
+#endif
+
+#if defined(HAVE_SSE2)
+#include <emmintrin.h>
+// MSVC only defines _mm_set_epi64x for x86_64...
+#if defined(_MSC_VER) && !defined(_M_X64) && !defined(__clang__)
+static inline __m128i _mm_set_epi64x( const uint64_t u1, const uint64_t u0 )
+{
+ return _mm_set_epi32( u1 >> 32, u1, u0 >> 32, u0 );
+}
+#endif
+#endif
+
+#if defined(HAVE_SSSE3)
+#include <tmmintrin.h>
+#endif
+#if defined(HAVE_SSE4_1)
+#include <smmintrin.h>
+#endif
+#if defined(HAVE_AVX)
+#include <immintrin.h>
+#endif
+#if defined(HAVE_XOP) && !defined(_MSC_VER)
+#include <x86intrin.h>
+#endif
+
+
+
+#include "blake2b-round.h"
+
+static const uint64_t blake2b_IV[8] =
+{
+ 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL,
+ 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL,
+ 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,
+ 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL
+};
+
+static const uint8_t blake2b_sigma[12][16] =
+{
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
+ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
+ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
+ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
+ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
+ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
+ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
+ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
+ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
+};
+
+
+/* Some helper functions, not necessarily useful */
+static inline int blake2b_set_lastnode( blake2b_state *S )
+{
+ S->f[1] = ~0ULL;
+ return 0;
+}
+
+static inline int blake2b_clear_lastnode( blake2b_state *S )
+{
+ S->f[1] = 0ULL;
+ return 0;
+}
+
+static inline int blake2b_set_lastblock( blake2b_state *S )
+{
+ if( S->last_node ) blake2b_set_lastnode( S );
+
+ S->f[0] = ~0ULL;
+ return 0;
+}
+
+static inline int blake2b_clear_lastblock( blake2b_state *S )
+{
+ if( S->last_node ) blake2b_clear_lastnode( S );
+
+ S->f[0] = 0ULL;
+ return 0;
+}
+
+
+static inline int blake2b_increment_counter( blake2b_state *S, const uint64_t inc )
+{
+#if defined(__x86_64__) && (defined(__GNUC__) || defined(__clang__))
+ // ADD/ADC chain
+ __uint128_t t = ( ( __uint128_t )S->t[1] << 64 ) | S->t[0];
+ t += inc;
+ S->t[0] = ( uint64_t )( t >> 0 );
+ S->t[1] = ( uint64_t )( t >> 64 );
+#else
+ S->t[0] += inc;
+ S->t[1] += ( S->t[0] < inc );
+#endif
+ return 0;
+}
+
+
+// Parameter-related functions
+static inline int blake2b_param_set_digest_length( blake2b_param *P, const uint8_t digest_length )
+{
+ P->digest_length = digest_length;
+ return 0;
+}
+
+static inline int blake2b_param_set_fanout( blake2b_param *P, const uint8_t fanout )
+{
+ P->fanout = fanout;
+ return 0;
+}
+
+static inline int blake2b_param_set_max_depth( blake2b_param *P, const uint8_t depth )
+{
+ P->depth = depth;
+ return 0;
+}
+
+static inline int blake2b_param_set_leaf_length( blake2b_param *P, const uint32_t leaf_length )
+{
+ P->leaf_length = leaf_length;
+ return 0;
+}
+
+static inline int blake2b_param_set_node_offset( blake2b_param *P, const uint64_t node_offset )
+{
+ P->node_offset = node_offset;
+ return 0;
+}
+
+static inline int blake2b_param_set_node_depth( blake2b_param *P, const uint8_t node_depth )
+{
+ P->node_depth = node_depth;
+ return 0;
+}
+
+static inline int blake2b_param_set_inner_length( blake2b_param *P, const uint8_t inner_length )
+{
+ P->inner_length = inner_length;
+ return 0;
+}
+
+static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] )
+{
+ memcpy( P->salt, salt, BLAKE2B_SALTBYTES );
+ return 0;
+}
+
+static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
+{
+ memcpy( P->personal, personal, BLAKE2B_PERSONALBYTES );
+ return 0;
+}
+
+static inline int blake2b_init0( blake2b_state *S )
+{
+ memset( S, 0, sizeof( blake2b_state ) );
+
+ for( int i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i];
+
+ return 0;
+}
+
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+ int blake2b_init( blake2b_state *S, size_t outlen );
+ int blake2b_init_param( blake2b_state *S, const blake2b_param *P );
+ int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen );
+ int blake2b_update( blake2b_state *S, const uint8_t *in, size_t inlen );
+ int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen );
+ int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+#if defined(__cplusplus)
+}
+#endif
+
+/* init xors IV with input parameter block */
+int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
+{
+ uint8_t *p, *h, *v;
+ //blake2b_init0( S );
+ v = ( uint8_t * )( blake2b_IV );
+ h = ( uint8_t * )( S->h );
+ p = ( uint8_t * )( P );
+ /* IV XOR ParamBlock */
+ memset( S, 0, sizeof( blake2b_state ) );
+
+ for( int i = 0; i < BLAKE2B_OUTBYTES; ++i ) h[i] = v[i] ^ p[i];
+
+ S->outlen = P->digest_length;
+ return 0;
+}
+
+
+/* Some sort of default parameter block initialization, for sequential blake2b */
+
+int blake2b_init( blake2b_state *S, size_t outlen )
+{
+ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
+
+ const blake2b_param P =
+ {
+ ( uint8_t ) outlen,
+ 0,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ {0},
+ {0},
+ {0}
+ };
+ return blake2b_init_param( S, &P );
+}
+
+int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen )
+{
+ if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;
+
+ if ( ( !keylen ) || keylen > BLAKE2B_KEYBYTES ) return -1;
+
+ const blake2b_param P =
+ {
+ ( uint8_t ) outlen,
+ ( uint8_t ) keylen,
+ 1,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ {0},
+ {0},
+ {0}
+ };
+
+ if( blake2b_init_param( S, &P ) < 0 )
+ return 0;
+
+ {
+ uint8_t block[BLAKE2B_BLOCKBYTES];
+ memset( block, 0, BLAKE2B_BLOCKBYTES );
+ memcpy( block, key, keylen );
+ blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
+ secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */
+ }
+ return 0;
+}
+
+static inline int blake2b_compress( blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES] )
+{
+ __m128i row1l, row1h;
+ __m128i row2l, row2h;
+ __m128i row3l, row3h;
+ __m128i row4l, row4h;
+ __m128i b0, b1;
+ __m128i t0, t1;
+#if defined(HAVE_SSSE3) && !defined(HAVE_XOP)
+ const __m128i r16 = _mm_setr_epi8( 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9 );
+ const __m128i r24 = _mm_setr_epi8( 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10 );
+#endif
+#if defined(HAVE_SSE4_1)
+ const __m128i m0 = LOADU( block + 00 );
+ const __m128i m1 = LOADU( block + 16 );
+ const __m128i m2 = LOADU( block + 32 );
+ const __m128i m3 = LOADU( block + 48 );
+ const __m128i m4 = LOADU( block + 64 );
+ const __m128i m5 = LOADU( block + 80 );
+ const __m128i m6 = LOADU( block + 96 );
+ const __m128i m7 = LOADU( block + 112 );
+#else
+ const uint64_t m0 = ( ( uint64_t * )block )[ 0];
+ const uint64_t m1 = ( ( uint64_t * )block )[ 1];
+ const uint64_t m2 = ( ( uint64_t * )block )[ 2];
+ const uint64_t m3 = ( ( uint64_t * )block )[ 3];
+ const uint64_t m4 = ( ( uint64_t * )block )[ 4];
+ const uint64_t m5 = ( ( uint64_t * )block )[ 5];
+ const uint64_t m6 = ( ( uint64_t * )block )[ 6];
+ const uint64_t m7 = ( ( uint64_t * )block )[ 7];
+ const uint64_t m8 = ( ( uint64_t * )block )[ 8];
+ const uint64_t m9 = ( ( uint64_t * )block )[ 9];
+ const uint64_t m10 = ( ( uint64_t * )block )[10];
+ const uint64_t m11 = ( ( uint64_t * )block )[11];
+ const uint64_t m12 = ( ( uint64_t * )block )[12];
+ const uint64_t m13 = ( ( uint64_t * )block )[13];
+ const uint64_t m14 = ( ( uint64_t * )block )[14];
+ const uint64_t m15 = ( ( uint64_t * )block )[15];
+#endif
+ row1l = LOADU( &S->h[0] );
+ row1h = LOADU( &S->h[2] );
+ row2l = LOADU( &S->h[4] );
+ row2h = LOADU( &S->h[6] );
+ row3l = LOADU( &blake2b_IV[0] );
+ row3h = LOADU( &blake2b_IV[2] );
+ row4l = _mm_xor_si128( LOADU( &blake2b_IV[4] ), LOADU( &S->t[0] ) );
+ row4h = _mm_xor_si128( LOADU( &blake2b_IV[6] ), LOADU( &S->f[0] ) );
+ ROUND( 0 );
+ ROUND( 1 );
+ ROUND( 2 );
+ ROUND( 3 );
+ ROUND( 4 );
+ ROUND( 5 );
+ ROUND( 6 );
+ ROUND( 7 );
+ ROUND( 8 );
+ ROUND( 9 );
+ ROUND( 10 );
+ ROUND( 11 );
+ row1l = _mm_xor_si128( row3l, row1l );
+ row1h = _mm_xor_si128( row3h, row1h );
+ STOREU( &S->h[0], _mm_xor_si128( LOADU( &S->h[0] ), row1l ) );
+ STOREU( &S->h[2], _mm_xor_si128( LOADU( &S->h[2] ), row1h ) );
+ row2l = _mm_xor_si128( row4l, row2l );
+ row2h = _mm_xor_si128( row4h, row2h );
+ STOREU( &S->h[4], _mm_xor_si128( LOADU( &S->h[4] ), row2l ) );
+ STOREU( &S->h[6], _mm_xor_si128( LOADU( &S->h[6] ), row2h ) );
+ return 0;
+}
+
+
+int blake2b_update( blake2b_state *S, const uint8_t *in, size_t inlen )
+{
+ while( inlen > 0 )
+ {
+ uint32_t left = S->buflen;
+ uint32_t fill = 2 * BLAKE2B_BLOCKBYTES - left;
+
+ if( inlen > fill )
+ {
+ memcpy( S->buf + left, in, fill ); // Fill buffer
+ S->buflen += fill;
+ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
+ blake2b_compress( S, S->buf ); // Compress
+ memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); // Shift buffer left
+ S->buflen -= BLAKE2B_BLOCKBYTES;
+ in += fill;
+ inlen -= fill;
+ }
+ else // inlen <= fill
+ {
+ memcpy( S->buf + left, in, inlen );
+ S->buflen += ( uint32_t ) inlen; // Be lazy, do not compress
+ in += inlen;
+ inlen -= inlen;
+ }
+ }
+
+ return 0;
+}
+
+
+int blake2b_final( blake2b_state *S, uint8_t *out, size_t outlen )
+{
+ if(S->outlen != outlen) return -1;
+
+ if( S->buflen > BLAKE2B_BLOCKBYTES )
+ {
+ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
+ blake2b_compress( S, S->buf );
+ S->buflen -= BLAKE2B_BLOCKBYTES;
+ memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen );
+ }
+
+ blake2b_increment_counter( S, S->buflen );
+ blake2b_set_lastblock( S );
+ memset( S->buf + S->buflen, 0, 2 * BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */
+ blake2b_compress( S, S->buf );
+ memcpy( out, &S->h[0], outlen );
+ return 0;
+}
+
+
+int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
+{
+ blake2b_state S[1];
+
+ /* Verify parameters */
+ if ( NULL == in && inlen > 0 ) return -1;
+
+ if ( NULL == out ) return -1;
+
+ if( NULL == key && keylen > 0 ) return -1;
+
+ if( !outlen || outlen > BLAKE2B_OUTBYTES ) return -1;
+
+ if( keylen > BLAKE2B_KEYBYTES ) return -1;
+
+ if( keylen )
+ {
+ if( blake2b_init_key( S, outlen, key, keylen ) < 0 ) return -1;
+ }
+ else
+ {
+ if( blake2b_init( S, outlen ) < 0 ) return -1;
+ }
+
+ if( blake2b_update( S, ( uint8_t * )in, inlen ) < 0) return -1;
+ return blake2b_final( S, out, outlen );
+}
+
+#if defined(SUPERCOP)
+int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen )
+{
+ return blake2b( out, in, NULL, BLAKE2B_OUTBYTES, inlen, 0 );
+}
+#endif
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h
new file mode 100644
index 00000000000..b24483cf931
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse2.h
@@ -0,0 +1,59 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2S_LOAD_SSE2_H__
+#define __BLAKE2S_LOAD_SSE2_H__
+
+#define LOAD_MSG_0_1(buf) buf = _mm_set_epi32(m6,m4,m2,m0)
+#define LOAD_MSG_0_2(buf) buf = _mm_set_epi32(m7,m5,m3,m1)
+#define LOAD_MSG_0_3(buf) buf = _mm_set_epi32(m14,m12,m10,m8)
+#define LOAD_MSG_0_4(buf) buf = _mm_set_epi32(m15,m13,m11,m9)
+#define LOAD_MSG_1_1(buf) buf = _mm_set_epi32(m13,m9,m4,m14)
+#define LOAD_MSG_1_2(buf) buf = _mm_set_epi32(m6,m15,m8,m10)
+#define LOAD_MSG_1_3(buf) buf = _mm_set_epi32(m5,m11,m0,m1)
+#define LOAD_MSG_1_4(buf) buf = _mm_set_epi32(m3,m7,m2,m12)
+#define LOAD_MSG_2_1(buf) buf = _mm_set_epi32(m15,m5,m12,m11)
+#define LOAD_MSG_2_2(buf) buf = _mm_set_epi32(m13,m2,m0,m8)
+#define LOAD_MSG_2_3(buf) buf = _mm_set_epi32(m9,m7,m3,m10)
+#define LOAD_MSG_2_4(buf) buf = _mm_set_epi32(m4,m1,m6,m14)
+#define LOAD_MSG_3_1(buf) buf = _mm_set_epi32(m11,m13,m3,m7)
+#define LOAD_MSG_3_2(buf) buf = _mm_set_epi32(m14,m12,m1,m9)
+#define LOAD_MSG_3_3(buf) buf = _mm_set_epi32(m15,m4,m5,m2)
+#define LOAD_MSG_3_4(buf) buf = _mm_set_epi32(m8,m0,m10,m6)
+#define LOAD_MSG_4_1(buf) buf = _mm_set_epi32(m10,m2,m5,m9)
+#define LOAD_MSG_4_2(buf) buf = _mm_set_epi32(m15,m4,m7,m0)
+#define LOAD_MSG_4_3(buf) buf = _mm_set_epi32(m3,m6,m11,m14)
+#define LOAD_MSG_4_4(buf) buf = _mm_set_epi32(m13,m8,m12,m1)
+#define LOAD_MSG_5_1(buf) buf = _mm_set_epi32(m8,m0,m6,m2)
+#define LOAD_MSG_5_2(buf) buf = _mm_set_epi32(m3,m11,m10,m12)
+#define LOAD_MSG_5_3(buf) buf = _mm_set_epi32(m1,m15,m7,m4)
+#define LOAD_MSG_5_4(buf) buf = _mm_set_epi32(m9,m14,m5,m13)
+#define LOAD_MSG_6_1(buf) buf = _mm_set_epi32(m4,m14,m1,m12)
+#define LOAD_MSG_6_2(buf) buf = _mm_set_epi32(m10,m13,m15,m5)
+#define LOAD_MSG_6_3(buf) buf = _mm_set_epi32(m8,m9,m6,m0)
+#define LOAD_MSG_6_4(buf) buf = _mm_set_epi32(m11,m2,m3,m7)
+#define LOAD_MSG_7_1(buf) buf = _mm_set_epi32(m3,m12,m7,m13)
+#define LOAD_MSG_7_2(buf) buf = _mm_set_epi32(m9,m1,m14,m11)
+#define LOAD_MSG_7_3(buf) buf = _mm_set_epi32(m2,m8,m15,m5)
+#define LOAD_MSG_7_4(buf) buf = _mm_set_epi32(m10,m6,m4,m0)
+#define LOAD_MSG_8_1(buf) buf = _mm_set_epi32(m0,m11,m14,m6)
+#define LOAD_MSG_8_2(buf) buf = _mm_set_epi32(m8,m3,m9,m15)
+#define LOAD_MSG_8_3(buf) buf = _mm_set_epi32(m10,m1,m13,m12)
+#define LOAD_MSG_8_4(buf) buf = _mm_set_epi32(m5,m4,m7,m2)
+#define LOAD_MSG_9_1(buf) buf = _mm_set_epi32(m1,m7,m8,m10)
+#define LOAD_MSG_9_2(buf) buf = _mm_set_epi32(m5,m6,m4,m2)
+#define LOAD_MSG_9_3(buf) buf = _mm_set_epi32(m13,m3,m9,m15)
+#define LOAD_MSG_9_4(buf) buf = _mm_set_epi32(m0,m12,m14,m11)
+
+
+#endif
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h
new file mode 100644
index 00000000000..3ac12eb6f5d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-sse41.h
@@ -0,0 +1,229 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2S_LOAD_SSE41_H__
+#define __BLAKE2S_LOAD_SSE41_H__
+
+#define LOAD_MSG_0_1(buf) \
+buf = TOI(_mm_shuffle_ps(TOF(m0), TOF(m1), _MM_SHUFFLE(2,0,2,0)));
+
+#define LOAD_MSG_0_2(buf) \
+buf = TOI(_mm_shuffle_ps(TOF(m0), TOF(m1), _MM_SHUFFLE(3,1,3,1)));
+
+#define LOAD_MSG_0_3(buf) \
+buf = TOI(_mm_shuffle_ps(TOF(m2), TOF(m3), _MM_SHUFFLE(2,0,2,0)));
+
+#define LOAD_MSG_0_4(buf) \
+buf = TOI(_mm_shuffle_ps(TOF(m2), TOF(m3), _MM_SHUFFLE(3,1,3,1)));
+
+#define LOAD_MSG_1_1(buf) \
+t0 = _mm_blend_epi16(m1, m2, 0x0C); \
+t1 = _mm_slli_si128(m3, 4); \
+t2 = _mm_blend_epi16(t0, t1, 0xF0); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,1,0,3));
+
+#define LOAD_MSG_1_2(buf) \
+t0 = _mm_shuffle_epi32(m2,_MM_SHUFFLE(0,0,2,0)); \
+t1 = _mm_blend_epi16(m1,m3,0xC0); \
+t2 = _mm_blend_epi16(t0, t1, 0xF0); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1));
+
+#define LOAD_MSG_1_3(buf) \
+t0 = _mm_slli_si128(m1, 4); \
+t1 = _mm_blend_epi16(m2, t0, 0x30); \
+t2 = _mm_blend_epi16(m0, t1, 0xF0); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1));
+
+#define LOAD_MSG_1_4(buf) \
+t0 = _mm_unpackhi_epi32(m0,m1); \
+t1 = _mm_slli_si128(m3, 4); \
+t2 = _mm_blend_epi16(t0, t1, 0x0C); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,3,0,1));
+
+#define LOAD_MSG_2_1(buf) \
+t0 = _mm_unpackhi_epi32(m2,m3); \
+t1 = _mm_blend_epi16(m3,m1,0x0C); \
+t2 = _mm_blend_epi16(t0, t1, 0x0F); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(3,1,0,2));
+
+#define LOAD_MSG_2_2(buf) \
+t0 = _mm_unpacklo_epi32(m2,m0); \
+t1 = _mm_blend_epi16(t0, m0, 0xF0); \
+t2 = _mm_slli_si128(m3, 8); \
+buf = _mm_blend_epi16(t1, t2, 0xC0);
+
+#define LOAD_MSG_2_3(buf) \
+t0 = _mm_blend_epi16(m0, m2, 0x3C); \
+t1 = _mm_srli_si128(m1, 12); \
+t2 = _mm_blend_epi16(t0,t1,0x03); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,0,3,2));
+
+#define LOAD_MSG_2_4(buf) \
+t0 = _mm_slli_si128(m3, 4); \
+t1 = _mm_blend_epi16(m0, m1, 0x33); \
+t2 = _mm_blend_epi16(t1, t0, 0xC0); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(0,1,2,3));
+
+#define LOAD_MSG_3_1(buf) \
+t0 = _mm_unpackhi_epi32(m0,m1); \
+t1 = _mm_unpackhi_epi32(t0, m2); \
+t2 = _mm_blend_epi16(t1, m3, 0x0C); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(3,1,0,2));
+
+#define LOAD_MSG_3_2(buf) \
+t0 = _mm_slli_si128(m2, 8); \
+t1 = _mm_blend_epi16(m3,m0,0x0C); \
+t2 = _mm_blend_epi16(t1, t0, 0xC0); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,0,1,3));
+
+#define LOAD_MSG_3_3(buf) \
+t0 = _mm_blend_epi16(m0,m1,0x0F); \
+t1 = _mm_blend_epi16(t0, m3, 0xC0); \
+buf = _mm_shuffle_epi32(t1, _MM_SHUFFLE(3,0,1,2));
+
+#define LOAD_MSG_3_4(buf) \
+t0 = _mm_unpacklo_epi32(m0,m2); \
+t1 = _mm_unpackhi_epi32(m1,m2); \
+buf = _mm_unpacklo_epi64(t1,t0);
+
+#define LOAD_MSG_4_1(buf) \
+t0 = _mm_unpacklo_epi64(m1,m2); \
+t1 = _mm_unpackhi_epi64(m0,m2); \
+t2 = _mm_blend_epi16(t0,t1,0x33); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,0,1,3));
+
+#define LOAD_MSG_4_2(buf) \
+t0 = _mm_unpackhi_epi64(m1,m3); \
+t1 = _mm_unpacklo_epi64(m0,m1); \
+buf = _mm_blend_epi16(t0,t1,0x33);
+
+#define LOAD_MSG_4_3(buf) \
+t0 = _mm_unpackhi_epi64(m3,m1); \
+t1 = _mm_unpackhi_epi64(m2,m0); \
+buf = _mm_blend_epi16(t1,t0,0x33);
+
+#define LOAD_MSG_4_4(buf) \
+t0 = _mm_blend_epi16(m0,m2,0x03); \
+t1 = _mm_slli_si128(t0, 8); \
+t2 = _mm_blend_epi16(t1,m3,0x0F); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,2,0,3));
+
+#define LOAD_MSG_5_1(buf) \
+t0 = _mm_unpackhi_epi32(m0,m1); \
+t1 = _mm_unpacklo_epi32(m0,m2); \
+buf = _mm_unpacklo_epi64(t0,t1);
+
+#define LOAD_MSG_5_2(buf) \
+t0 = _mm_srli_si128(m2, 4); \
+t1 = _mm_blend_epi16(m0,m3,0x03); \
+buf = _mm_blend_epi16(t1,t0,0x3C);
+
+#define LOAD_MSG_5_3(buf) \
+t0 = _mm_blend_epi16(m1,m0,0x0C); \
+t1 = _mm_srli_si128(m3, 4); \
+t2 = _mm_blend_epi16(t0,t1,0x30); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,2,3,0));
+
+#define LOAD_MSG_5_4(buf) \
+t0 = _mm_unpacklo_epi64(m1,m2); \
+t1= _mm_shuffle_epi32(m3, _MM_SHUFFLE(0,2,0,1)); \
+buf = _mm_blend_epi16(t0,t1,0x33);
+
+#define LOAD_MSG_6_1(buf) \
+t0 = _mm_slli_si128(m1, 12); \
+t1 = _mm_blend_epi16(m0,m3,0x33); \
+buf = _mm_blend_epi16(t1,t0,0xC0);
+
+#define LOAD_MSG_6_2(buf) \
+t0 = _mm_blend_epi16(m3,m2,0x30); \
+t1 = _mm_srli_si128(m1, 4); \
+t2 = _mm_blend_epi16(t0,t1,0x03); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(2,1,3,0));
+
+#define LOAD_MSG_6_3(buf) \
+t0 = _mm_unpacklo_epi64(m0,m2); \
+t1 = _mm_srli_si128(m1, 4); \
+buf = _mm_shuffle_epi32(_mm_blend_epi16(t0,t1,0x0C), _MM_SHUFFLE(2,3,1,0));
+
+#define LOAD_MSG_6_4(buf) \
+t0 = _mm_unpackhi_epi32(m1,m2); \
+t1 = _mm_unpackhi_epi64(m0,t0); \
+buf = _mm_shuffle_epi32(t1, _MM_SHUFFLE(3,0,1,2));
+
+#define LOAD_MSG_7_1(buf) \
+t0 = _mm_unpackhi_epi32(m0,m1); \
+t1 = _mm_blend_epi16(t0,m3,0x0F); \
+buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(2,0,3,1));
+
+#define LOAD_MSG_7_2(buf) \
+t0 = _mm_blend_epi16(m2,m3,0x30); \
+t1 = _mm_srli_si128(m0,4); \
+t2 = _mm_blend_epi16(t0,t1,0x03); \
+buf = _mm_shuffle_epi32(t2, _MM_SHUFFLE(1,0,2,3));
+
+#define LOAD_MSG_7_3(buf) \
+t0 = _mm_unpackhi_epi64(m0,m3); \
+t1 = _mm_unpacklo_epi64(m1,m2); \
+t2 = _mm_blend_epi16(t0,t1,0x3C); \
+buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(0,2,3,1));
+
+#define LOAD_MSG_7_4(buf) \
+t0 = _mm_unpacklo_epi32(m0,m1); \
+t1 = _mm_unpackhi_epi32(m1,m2); \
+buf = _mm_unpacklo_epi64(t0,t1);
+
+#define LOAD_MSG_8_1(buf) \
+t0 = _mm_unpackhi_epi32(m1,m3); \
+t1 = _mm_unpacklo_epi64(t0,m0); \
+t2 = _mm_blend_epi16(t1,m2,0xC0); \
+buf = _mm_shufflehi_epi16(t2,_MM_SHUFFLE(1,0,3,2));
+
+#define LOAD_MSG_8_2(buf) \
+t0 = _mm_unpackhi_epi32(m0,m3); \
+t1 = _mm_blend_epi16(m2,t0,0xF0); \
+buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(0,2,1,3));
+
+#define LOAD_MSG_8_3(buf) \
+t0 = _mm_blend_epi16(m2,m0,0x0C); \
+t1 = _mm_slli_si128(t0,4); \
+buf = _mm_blend_epi16(t1,m3,0x0F);
+
+#define LOAD_MSG_8_4(buf) \
+t0 = _mm_blend_epi16(m1,m0,0x30); \
+buf = _mm_shuffle_epi32(t0,_MM_SHUFFLE(1,0,3,2));
+
+#define LOAD_MSG_9_1(buf) \
+t0 = _mm_blend_epi16(m0,m2,0x03); \
+t1 = _mm_blend_epi16(m1,m2,0x30); \
+t2 = _mm_blend_epi16(t1,t0,0x0F); \
+buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(1,3,0,2));
+
+#define LOAD_MSG_9_2(buf) \
+t0 = _mm_slli_si128(m0,4); \
+t1 = _mm_blend_epi16(m1,t0,0xC0); \
+buf = _mm_shuffle_epi32(t1,_MM_SHUFFLE(1,2,0,3));
+
+#define LOAD_MSG_9_3(buf) \
+t0 = _mm_unpackhi_epi32(m0,m3); \
+t1 = _mm_unpacklo_epi32(m2,m3); \
+t2 = _mm_unpackhi_epi64(t0,t1); \
+buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(3,0,2,1));
+
+#define LOAD_MSG_9_4(buf) \
+t0 = _mm_blend_epi16(m3,m2,0xC0); \
+t1 = _mm_unpacklo_epi32(m0,m3); \
+t2 = _mm_blend_epi16(t0,t1,0x0F); \
+buf = _mm_shuffle_epi32(t2,_MM_SHUFFLE(0,1,2,3));
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h
new file mode 100644
index 00000000000..14d9e7f7640
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-load-xop.h
@@ -0,0 +1,189 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2S_LOAD_XOP_H__
+#define __BLAKE2S_LOAD_XOP_H__
+
+#define TOB(x) ((x)*4*0x01010101 + 0x03020100) // ..or not TOB
+
+/* Basic VPPERM emulation, for testing purposes */
+/*static __m128i _mm_perm_epi8(const __m128i src1, const __m128i src2, const __m128i sel)
+{
+ const __m128i sixteen = _mm_set1_epi8(16);
+ const __m128i t0 = _mm_shuffle_epi8(src1, sel);
+ const __m128i s1 = _mm_shuffle_epi8(src2, _mm_sub_epi8(sel, sixteen));
+ const __m128i mask = _mm_or_si128(_mm_cmpeq_epi8(sel, sixteen),
+ _mm_cmpgt_epi8(sel, sixteen)); // (>=16) = 0xff : 00
+ return _mm_blendv_epi8(t0, s1, mask);
+}*/
+
+#define LOAD_MSG_0_1(buf) \
+buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) );
+
+#define LOAD_MSG_0_2(buf) \
+buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(7),TOB(5),TOB(3),TOB(1)) );
+
+#define LOAD_MSG_0_3(buf) \
+buf = _mm_perm_epi8(m2, m3, _mm_set_epi32(TOB(6),TOB(4),TOB(2),TOB(0)) );
+
+#define LOAD_MSG_0_4(buf) \
+buf = _mm_perm_epi8(m2, m3, _mm_set_epi32(TOB(7),TOB(5),TOB(3),TOB(1)) );
+
+#define LOAD_MSG_1_1(buf) \
+t0 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(0),TOB(5),TOB(0),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(6)) );
+
+#define LOAD_MSG_1_2(buf) \
+t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(2),TOB(0),TOB(4),TOB(6)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_1_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(0),TOB(0),TOB(1)) ); \
+buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_1_4(buf) \
+t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(7),TOB(2),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(4)) );
+
+#define LOAD_MSG_2_1(buf) \
+t0 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(0),TOB(1),TOB(0),TOB(7)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(4),TOB(0)) );
+
+#define LOAD_MSG_2_2(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(2),TOB(0),TOB(4)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_2_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(7),TOB(3),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(6)) );
+
+#define LOAD_MSG_2_4(buf) \
+t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(4),TOB(1),TOB(6),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(6)) );
+
+#define LOAD_MSG_3_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(3),TOB(7)) ); \
+t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(5),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_3_2(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(0),TOB(1),TOB(5)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(6),TOB(4),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_3_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(4),TOB(5),TOB(2)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_3_4(buf) \
+t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(6)) ); \
+buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(4),TOB(2),TOB(6),TOB(0)) );
+
+#define LOAD_MSG_4_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(2),TOB(5),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(6),TOB(2),TOB(1),TOB(5)) );
+
+#define LOAD_MSG_4_2(buf) \
+t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(4),TOB(7),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_4_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(6),TOB(0),TOB(0)) ); \
+t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(2),TOB(7),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(6)) );
+
+#define LOAD_MSG_4_4(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(4),TOB(0),TOB(1)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(4),TOB(0)) );
+
+#define LOAD_MSG_5_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(6),TOB(2)) ); \
+buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(4),TOB(2),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_5_2(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(6),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(4)) );
+
+#define LOAD_MSG_5_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(1),TOB(0),TOB(7),TOB(4)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_5_4(buf) \
+t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(5),TOB(0),TOB(1),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(6),TOB(1),TOB(5)) );
+
+#define LOAD_MSG_6_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(4),TOB(0),TOB(1),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(6),TOB(1),TOB(4)) );
+
+#define LOAD_MSG_6_2(buf) \
+t1 = _mm_perm_epi8(m1, m2, _mm_set_epi32(TOB(6),TOB(0),TOB(0),TOB(1)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(5),TOB(7),TOB(0)) );
+
+#define LOAD_MSG_6_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(6),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(4),TOB(5),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_6_4(buf) \
+t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(2),TOB(3),TOB(7)) ); \
+buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(7),TOB(2),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_7_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(3),TOB(0),TOB(7),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(4),TOB(1),TOB(5)) );
+
+#define LOAD_MSG_7_2(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(5),TOB(1),TOB(0),TOB(7)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(6),TOB(0)) );
+
+#define LOAD_MSG_7_3(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(2),TOB(0),TOB(0),TOB(5)) ); \
+t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(4),TOB(1),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(7),TOB(0)) );
+
+#define LOAD_MSG_7_4(buf) \
+t1 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(6),TOB(4),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m2, _mm_set_epi32(TOB(6),TOB(2),TOB(1),TOB(0)) );
+
+#define LOAD_MSG_8_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(6)) ); \
+t0 = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(7),TOB(1),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(6),TOB(0)) );
+
+#define LOAD_MSG_8_2(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(4),TOB(3),TOB(5),TOB(0)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(1),TOB(7)) );
+
+#define LOAD_MSG_8_3(buf) \
+t0 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(6),TOB(1),TOB(0),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(3),TOB(2),TOB(5),TOB(4)) ); \
+
+#define LOAD_MSG_8_4(buf) \
+buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(4),TOB(7),TOB(2)) );
+
+#define LOAD_MSG_9_1(buf) \
+t0 = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(1),TOB(7),TOB(0),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m2, _mm_set_epi32(TOB(3),TOB(2),TOB(4),TOB(6)) );
+
+#define LOAD_MSG_9_2(buf) \
+buf = _mm_perm_epi8(m0, m1, _mm_set_epi32(TOB(5),TOB(6),TOB(4),TOB(2)) );
+
+#define LOAD_MSG_9_3(buf) \
+t0 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(3),TOB(5),TOB(0)) ); \
+buf = _mm_perm_epi8(t0, m3, _mm_set_epi32(TOB(5),TOB(2),TOB(1),TOB(7)) );
+
+#define LOAD_MSG_9_4(buf) \
+t1 = _mm_perm_epi8(m0, m2, _mm_set_epi32(TOB(0),TOB(0),TOB(0),TOB(7)) ); \
+buf = _mm_perm_epi8(t1, m3, _mm_set_epi32(TOB(3),TOB(4),TOB(6),TOB(0)) );
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c b/contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c
new file mode 100644
index 00000000000..ab86cc1b34e
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-ref.c
@@ -0,0 +1,368 @@
+/*
+ BLAKE2 reference source code package - reference C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "blake2.h"
+#include "blake2-impl.h"
+
+static const uint32_t blake2s_IV[8] =
+{
+ 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
+ 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
+};
+
+static const uint8_t blake2s_sigma[10][16] =
+{
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
+ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
+ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
+ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
+ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
+ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
+ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
+ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
+ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
+};
+
+static inline int blake2s_set_lastnode( blake2s_state *S )
+{
+ S->f[1] = ~0U;
+ return 0;
+}
+
+static inline int blake2s_clear_lastnode( blake2s_state *S )
+{
+ S->f[1] = 0U;
+ return 0;
+}
+
+/* Some helper functions, not necessarily useful */
+static inline int blake2s_set_lastblock( blake2s_state *S )
+{
+ if( S->last_node ) blake2s_set_lastnode( S );
+
+ S->f[0] = ~0U;
+ return 0;
+}
+
+static inline int blake2s_clear_lastblock( blake2s_state *S )
+{
+ if( S->last_node ) blake2s_clear_lastnode( S );
+
+ S->f[0] = 0U;
+ return 0;
+}
+
+static inline int blake2s_increment_counter( blake2s_state *S, const uint32_t inc )
+{
+ S->t[0] += inc;
+ S->t[1] += ( S->t[0] < inc );
+ return 0;
+}
+
+// Parameter-related functions
+static inline int blake2s_param_set_digest_length( blake2s_param *P, const uint8_t digest_length )
+{
+ P->digest_length = digest_length;
+ return 0;
+}
+
+static inline int blake2s_param_set_fanout( blake2s_param *P, const uint8_t fanout )
+{
+ P->fanout = fanout;
+ return 0;
+}
+
+static inline int blake2s_param_set_max_depth( blake2s_param *P, const uint8_t depth )
+{
+ P->depth = depth;
+ return 0;
+}
+
+static inline int blake2s_param_set_leaf_length( blake2s_param *P, const uint32_t leaf_length )
+{
+ store32( &P->leaf_length, leaf_length );
+ return 0;
+}
+
+static inline int blake2s_param_set_node_offset( blake2s_param *P, const uint64_t node_offset )
+{
+ store48( P->node_offset, node_offset );
+ return 0;
+}
+
+static inline int blake2s_param_set_node_depth( blake2s_param *P, const uint8_t node_depth )
+{
+ P->node_depth = node_depth;
+ return 0;
+}
+
+static inline int blake2s_param_set_inner_length( blake2s_param *P, const uint8_t inner_length )
+{
+ P->inner_length = inner_length;
+ return 0;
+}
+
+static inline int blake2s_param_set_salt( blake2s_param *P, const uint8_t salt[BLAKE2S_SALTBYTES] )
+{
+ memcpy( P->salt, salt, BLAKE2S_SALTBYTES );
+ return 0;
+}
+
+static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] )
+{
+ memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES );
+ return 0;
+}
+
+static inline int blake2s_init0( blake2s_state *S )
+{
+ memset( S, 0, sizeof( blake2s_state ) );
+
+ for( int i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
+
+ return 0;
+}
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+ int blake2s_init( blake2s_state *S, size_t outlen );
+ int blake2s_init_param( blake2s_state *S, const blake2s_param *P );
+ int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
+ int blake2s_update( blake2s_state *S, const uint8_t *in, size_t inlen );
+ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen );
+ int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+#if defined(__cplusplus)
+}
+#endif
+
+/* init2 xors IV with input parameter block */
+int blake2s_init_param( blake2s_state *S, const blake2s_param *P )
+{
+ blake2s_init0( S );
+ uint32_t *p = ( uint32_t * )( P );
+
+ /* IV XOR ParamBlock */
+ for( size_t i = 0; i < 8; ++i )
+ S->h[i] ^= load32( &p[i] );
+
+ S->outlen = P->digest_length;
+ return 0;
+}
+
+
+// Sequential blake2s initialization
+int blake2s_init( blake2s_state *S, size_t outlen )
+{
+ blake2s_param P[1];
+
+ /* Move interval verification here? */
+ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1;
+
+ P->digest_length = ( uint8_t) outlen;
+ P->key_length = 0;
+ P->fanout = 1;
+ P->depth = 1;
+ store32( &P->leaf_length, 0 );
+ store48( &P->node_offset, 0 );
+ P->node_depth = 0;
+ P->inner_length = 0;
+ // memset(P->reserved, 0, sizeof(P->reserved) );
+ memset( P->salt, 0, sizeof( P->salt ) );
+ memset( P->personal, 0, sizeof( P->personal ) );
+ return blake2s_init_param( S, P );
+}
+
+int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen )
+{
+ blake2s_param P[1];
+
+ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1;
+
+ if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1;
+
+ P->digest_length = ( uint8_t ) outlen;
+ P->key_length = ( uint8_t ) keylen;
+ P->fanout = 1;
+ P->depth = 1;
+ store32( &P->leaf_length, 0 );
+ store48( &P->node_offset, 0 );
+ P->node_depth = 0;
+ P->inner_length = 0;
+ // memset(P->reserved, 0, sizeof(P->reserved) );
+ memset( P->salt, 0, sizeof( P->salt ) );
+ memset( P->personal, 0, sizeof( P->personal ) );
+
+ if( blake2s_init_param( S, P ) < 0 ) return -1;
+
+ {
+ uint8_t block[BLAKE2S_BLOCKBYTES];
+ memset( block, 0, BLAKE2S_BLOCKBYTES );
+ memcpy( block, key, keylen );
+ blake2s_update( S, block, BLAKE2S_BLOCKBYTES );
+ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */
+ }
+ return 0;
+}
+
+static int blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCKBYTES] )
+{
+ uint32_t m[16];
+ uint32_t v[16];
+
+ for( size_t i = 0; i < 16; ++i )
+ m[i] = load32( block + i * sizeof( m[i] ) );
+
+ for( size_t i = 0; i < 8; ++i )
+ v[i] = S->h[i];
+
+ v[ 8] = blake2s_IV[0];
+ v[ 9] = blake2s_IV[1];
+ v[10] = blake2s_IV[2];
+ v[11] = blake2s_IV[3];
+ v[12] = S->t[0] ^ blake2s_IV[4];
+ v[13] = S->t[1] ^ blake2s_IV[5];
+ v[14] = S->f[0] ^ blake2s_IV[6];
+ v[15] = S->f[1] ^ blake2s_IV[7];
+#define G(r,i,a,b,c,d) \
+ do { \
+ a = a + b + m[blake2s_sigma[r][2*i+0]]; \
+ d = rotr32(d ^ a, 16); \
+ c = c + d; \
+ b = rotr32(b ^ c, 12); \
+ a = a + b + m[blake2s_sigma[r][2*i+1]]; \
+ d = rotr32(d ^ a, 8); \
+ c = c + d; \
+ b = rotr32(b ^ c, 7); \
+ } while(0)
+#define ROUND(r) \
+ do { \
+ G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \
+ G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \
+ G(r,2,v[ 2],v[ 6],v[10],v[14]); \
+ G(r,3,v[ 3],v[ 7],v[11],v[15]); \
+ G(r,4,v[ 0],v[ 5],v[10],v[15]); \
+ G(r,5,v[ 1],v[ 6],v[11],v[12]); \
+ G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \
+ G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \
+ } while(0)
+ ROUND( 0 );
+ ROUND( 1 );
+ ROUND( 2 );
+ ROUND( 3 );
+ ROUND( 4 );
+ ROUND( 5 );
+ ROUND( 6 );
+ ROUND( 7 );
+ ROUND( 8 );
+ ROUND( 9 );
+
+ for( size_t i = 0; i < 8; ++i )
+ S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];
+
+#undef G
+#undef ROUND
+ return 0;
+}
+
+
+int blake2s_update( blake2s_state *S, const uint8_t *in, size_t inlen )
+{
+ while( inlen > 0 )
+ {
+ uint32_t left = S->buflen;
+ uint32_t fill = 2 * BLAKE2S_BLOCKBYTES - left;
+
+ if( inlen > fill )
+ {
+ memcpy( S->buf + left, in, fill ); // Fill buffer
+ S->buflen += fill;
+ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
+ blake2s_compress( S, S->buf ); // Compress
+ memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
+ S->buflen -= BLAKE2S_BLOCKBYTES;
+ in += fill;
+ inlen -= fill;
+ }
+ else // inlen <= fill
+ {
+ memcpy( S->buf + left, in, inlen );
+ S->buflen += ( uint32_t ) inlen; // Be lazy, do not compress
+ in += inlen;
+ inlen -= inlen;
+ }
+ }
+
+ return 0;
+}
+
+int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen )
+{
+ uint8_t buffer[BLAKE2S_OUTBYTES];
+ size_t i;
+
+ if(S->outlen != outlen) return -1;
+
+ if( S->buflen > BLAKE2S_BLOCKBYTES )
+ {
+ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
+ blake2s_compress( S, S->buf );
+ S->buflen -= BLAKE2S_BLOCKBYTES;
+ memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen );
+ }
+
+ blake2s_increment_counter( S, ( uint32_t )S->buflen );
+ blake2s_set_lastblock( S );
+ memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */
+ blake2s_compress( S, S->buf );
+
+ for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
+ store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
+
+ memcpy( out, buffer, outlen );
+ return 0;
+}
+
+int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
+{
+ blake2s_state S[1];
+
+ /* Verify parameters */
+ if ( NULL == in && inlen > 0 ) return -1;
+
+ if ( NULL == out ) return -1;
+
+ if ( NULL == key && keylen > 0 ) return -1;
+
+ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1;
+
+ if( keylen > BLAKE2S_KEYBYTES ) return -1;
+
+ if( keylen > 0 )
+ {
+ if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1;
+ }
+ else
+ {
+ if( blake2s_init( S, outlen ) < 0 ) return -1;
+ }
+
+ if( blake2s_update( S, ( uint8_t * )in, inlen ) < 0) return -1;
+ return blake2s_final( S, out, outlen );
+}
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h b/contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h
new file mode 100644
index 00000000000..3af4be35bee
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s-round.h
@@ -0,0 +1,91 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+#pragma once
+#ifndef __BLAKE2S_ROUND_H__
+#define __BLAKE2S_ROUND_H__
+
+#define LOAD(p) _mm_load_si128( (__m128i *)(p) )
+#define STORE(p,r) _mm_store_si128((__m128i *)(p), r)
+
+#define LOADU(p) _mm_loadu_si128( (__m128i *)(p) )
+#define STOREU(p,r) _mm_storeu_si128((__m128i *)(p), r)
+
+#define TOF(reg) _mm_castsi128_ps((reg))
+#define TOI(reg) _mm_castps_si128((reg))
+
+#define LIKELY(x) __builtin_expect((x),1)
+
+
+/* Microarchitecture-specific macros */
+#ifndef HAVE_XOP
+#ifdef HAVE_SSSE3
+#define _mm_roti_epi32(r, c) ( \
+ (8==-(c)) ? _mm_shuffle_epi8(r,r8) \
+ : (16==-(c)) ? _mm_shuffle_epi8(r,r16) \
+ : _mm_xor_si128(_mm_srli_epi32( (r), -(c) ),_mm_slli_epi32( (r), 32-(-(c)) )) )
+#else
+#define _mm_roti_epi32(r, c) _mm_xor_si128(_mm_srli_epi32( (r), -(c) ),_mm_slli_epi32( (r), 32-(-(c)) ))
+#endif
+#else
+/* ... */
+#endif
+
+
+#define G1(row1,row2,row3,row4,buf) \
+ row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \
+ row4 = _mm_xor_si128( row4, row1 ); \
+ row4 = _mm_roti_epi32(row4, -16); \
+ row3 = _mm_add_epi32( row3, row4 ); \
+ row2 = _mm_xor_si128( row2, row3 ); \
+ row2 = _mm_roti_epi32(row2, -12);
+
+#define G2(row1,row2,row3,row4,buf) \
+ row1 = _mm_add_epi32( _mm_add_epi32( row1, buf), row2 ); \
+ row4 = _mm_xor_si128( row4, row1 ); \
+ row4 = _mm_roti_epi32(row4, -8); \
+ row3 = _mm_add_epi32( row3, row4 ); \
+ row2 = _mm_xor_si128( row2, row3 ); \
+ row2 = _mm_roti_epi32(row2, -7);
+
+#define DIAGONALIZE(row1,row2,row3,row4) \
+ row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(2,1,0,3) ); \
+ row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \
+ row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(0,3,2,1) );
+
+#define UNDIAGONALIZE(row1,row2,row3,row4) \
+ row4 = _mm_shuffle_epi32( row4, _MM_SHUFFLE(0,3,2,1) ); \
+ row3 = _mm_shuffle_epi32( row3, _MM_SHUFFLE(1,0,3,2) ); \
+ row2 = _mm_shuffle_epi32( row2, _MM_SHUFFLE(2,1,0,3) );
+
+#if defined(HAVE_XOP)
+#include "blake2s-load-xop.h"
+#elif defined(HAVE_SSE4_1)
+#include "blake2s-load-sse41.h"
+#else
+#include "blake2s-load-sse2.h"
+#endif
+
+#define ROUND(r) \
+ LOAD_MSG_ ##r ##_1(buf1); \
+ G1(row1,row2,row3,row4,buf1); \
+ LOAD_MSG_ ##r ##_2(buf2); \
+ G2(row1,row2,row3,row4,buf2); \
+ DIAGONALIZE(row1,row2,row3,row4); \
+ LOAD_MSG_ ##r ##_3(buf3); \
+ G1(row1,row2,row3,row4,buf3); \
+ LOAD_MSG_ ##r ##_4(buf4); \
+ G2(row1,row2,row3,row4,buf4); \
+ UNDIAGONALIZE(row1,row2,row3,row4); \
+
+#endif
+
diff --git a/contrib/tools/python3/Modules/_blake2/impl/blake2s.c b/contrib/tools/python3/Modules/_blake2/impl/blake2s.c
new file mode 100644
index 00000000000..e7f63fd274f
--- /dev/null
+++ b/contrib/tools/python3/Modules/_blake2/impl/blake2s.c
@@ -0,0 +1,415 @@
+/*
+ BLAKE2 reference source code package - optimized C implementations
+
+ Written in 2012 by Samuel Neves <[email protected]>
+
+ To the extent possible under law, the author(s) have dedicated all copyright
+ and related and neighboring rights to this software to the public domain
+ worldwide. This software is distributed without any warranty.
+
+ You should have received a copy of the CC0 Public Domain Dedication along with
+ this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+*/
+
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "blake2.h"
+#include "blake2-impl.h"
+
+#include "blake2-config.h"
+
+#if defined(_MSC_VER)
+#include <intrin.h>
+#endif
+
+#if defined(HAVE_SSE2)
+#include <emmintrin.h>
+// MSVC only defines _mm_set_epi64x for x86_64...
+#if defined(_MSC_VER) && !defined(_M_X64) && !defined(__clang__)
+static inline __m128i _mm_set_epi64x( const uint64_t u1, const uint64_t u0 )
+{
+ return _mm_set_epi32( u1 >> 32, u1, u0 >> 32, u0 );
+}
+#endif
+#endif
+
+
+#if defined(HAVE_SSSE3)
+#include <tmmintrin.h>
+#endif
+#if defined(HAVE_SSE4_1)
+#include <smmintrin.h>
+#endif
+#if defined(HAVE_AVX)
+#include <immintrin.h>
+#endif
+#if defined(HAVE_XOP) && !defined(_MSC_VER)
+#include <x86intrin.h>
+#endif
+
+#include "blake2s-round.h"
+
+static const uint32_t blake2s_IV[8] =
+{
+ 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
+ 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
+};
+
+static const uint8_t blake2s_sigma[10][16] =
+{
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } ,
+ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } ,
+ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } ,
+ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } ,
+ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } ,
+ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } ,
+ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } ,
+ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } ,
+ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } ,
+ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } ,
+};
+
+
+/* Some helper functions, not necessarily useful */
+static inline int blake2s_set_lastnode( blake2s_state *S )
+{
+ S->f[1] = ~0U;
+ return 0;
+}
+
+static inline int blake2s_clear_lastnode( blake2s_state *S )
+{
+ S->f[1] = 0U;
+ return 0;
+}
+
+static inline int blake2s_set_lastblock( blake2s_state *S )
+{
+ if( S->last_node ) blake2s_set_lastnode( S );
+
+ S->f[0] = ~0U;
+ return 0;
+}
+
+static inline int blake2s_clear_lastblock( blake2s_state *S )
+{
+ if( S->last_node ) blake2s_clear_lastnode( S );
+
+ S->f[0] = 0U;
+ return 0;
+}
+
+static inline int blake2s_increment_counter( blake2s_state *S, const uint32_t inc )
+{
+ uint64_t t = ( ( uint64_t )S->t[1] << 32 ) | S->t[0];
+ t += inc;
+ S->t[0] = ( uint32_t )( t >> 0 );
+ S->t[1] = ( uint32_t )( t >> 32 );
+ return 0;
+}
+
+
+// Parameter-related functions
+static inline int blake2s_param_set_digest_length( blake2s_param *P, const uint8_t digest_length )
+{
+ P->digest_length = digest_length;
+ return 0;
+}
+
+static inline int blake2s_param_set_fanout( blake2s_param *P, const uint8_t fanout )
+{
+ P->fanout = fanout;
+ return 0;
+}
+
+static inline int blake2s_param_set_max_depth( blake2s_param *P, const uint8_t depth )
+{
+ P->depth = depth;
+ return 0;
+}
+
+static inline int blake2s_param_set_leaf_length( blake2s_param *P, const uint32_t leaf_length )
+{
+ P->leaf_length = leaf_length;
+ return 0;
+}
+
+static inline int blake2s_param_set_node_offset( blake2s_param *P, const uint64_t node_offset )
+{
+ store48( P->node_offset, node_offset );
+ return 0;
+}
+
+static inline int blake2s_param_set_node_depth( blake2s_param *P, const uint8_t node_depth )
+{
+ P->node_depth = node_depth;
+ return 0;
+}
+
+static inline int blake2s_param_set_inner_length( blake2s_param *P, const uint8_t inner_length )
+{
+ P->inner_length = inner_length;
+ return 0;
+}
+
+static inline int blake2s_param_set_salt( blake2s_param *P, const uint8_t salt[BLAKE2S_SALTBYTES] )
+{
+ memcpy( P->salt, salt, BLAKE2S_SALTBYTES );
+ return 0;
+}
+
+static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] )
+{
+ memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES );
+ return 0;
+}
+
+static inline int blake2s_init0( blake2s_state *S )
+{
+ memset( S, 0, sizeof( blake2s_state ) );
+
+ for( int i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
+
+ return 0;
+}
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+ int blake2s_init( blake2s_state *S, size_t outlen );
+ int blake2s_init_param( blake2s_state *S, const blake2s_param *P );
+ int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen );
+ int blake2s_update( blake2s_state *S, const uint8_t *in, size_t inlen );
+ int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen );
+ int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen );
+#if defined(__cplusplus)
+}
+#endif
+
+
+/* init2 xors IV with input parameter block */
+int blake2s_init_param( blake2s_state *S, const blake2s_param *P )
+{
+ uint8_t *p, *h, *v;
+ //blake2s_init0( S );
+ v = ( uint8_t * )( blake2s_IV );
+ h = ( uint8_t * )( S->h );
+ p = ( uint8_t * )( P );
+ /* IV XOR ParamBlock */
+ memset( S, 0, sizeof( blake2s_state ) );
+
+ for( int i = 0; i < BLAKE2S_OUTBYTES; ++i ) h[i] = v[i] ^ p[i];
+
+ S->outlen = P->digest_length;
+ return 0;
+}
+
+
+/* Some sort of default parameter block initialization, for sequential blake2s */
+int blake2s_init( blake2s_state *S, size_t outlen )
+{
+ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1;
+
+ const blake2s_param P =
+ {
+ outlen,
+ 0,
+ 1,
+ 1,
+ 0,
+ {0},
+ 0,
+ 0,
+ {0},
+ {0}
+ };
+ return blake2s_init_param( S, &P );
+}
+
+
+int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen )
+{
+ if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1;
+
+ if ( ( !key ) || ( !keylen ) || keylen > BLAKE2S_KEYBYTES ) return -1;
+
+ const blake2s_param P =
+ {
+ outlen,
+ keylen,
+ 1,
+ 1,
+ 0,
+ {0},
+ 0,
+ 0,
+ {0},
+ {0}
+ };
+
+ if( blake2s_init_param( S, &P ) < 0 )
+ return -1;
+
+ {
+ uint8_t block[BLAKE2S_BLOCKBYTES];
+ memset( block, 0, BLAKE2S_BLOCKBYTES );
+ memcpy( block, key, keylen );
+ blake2s_update( S, block, BLAKE2S_BLOCKBYTES );
+ secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */
+ }
+ return 0;
+}
+
+
+static inline int blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCKBYTES] )
+{
+ __m128i row1, row2, row3, row4;
+ __m128i buf1, buf2, buf3, buf4;
+#if defined(HAVE_SSE4_1)
+ __m128i t0, t1;
+#if !defined(HAVE_XOP)
+ __m128i t2;
+#endif
+#endif
+ __m128i ff0, ff1;
+#if defined(HAVE_SSSE3) && !defined(HAVE_XOP)
+ const __m128i r8 = _mm_set_epi8( 12, 15, 14, 13, 8, 11, 10, 9, 4, 7, 6, 5, 0, 3, 2, 1 );
+ const __m128i r16 = _mm_set_epi8( 13, 12, 15, 14, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2 );
+#endif
+#if defined(HAVE_SSE4_1)
+ const __m128i m0 = LOADU( block + 00 );
+ const __m128i m1 = LOADU( block + 16 );
+ const __m128i m2 = LOADU( block + 32 );
+ const __m128i m3 = LOADU( block + 48 );
+#else
+ const uint32_t m0 = ( ( uint32_t * )block )[ 0];
+ const uint32_t m1 = ( ( uint32_t * )block )[ 1];
+ const uint32_t m2 = ( ( uint32_t * )block )[ 2];
+ const uint32_t m3 = ( ( uint32_t * )block )[ 3];
+ const uint32_t m4 = ( ( uint32_t * )block )[ 4];
+ const uint32_t m5 = ( ( uint32_t * )block )[ 5];
+ const uint32_t m6 = ( ( uint32_t * )block )[ 6];
+ const uint32_t m7 = ( ( uint32_t * )block )[ 7];
+ const uint32_t m8 = ( ( uint32_t * )block )[ 8];
+ const uint32_t m9 = ( ( uint32_t * )block )[ 9];
+ const uint32_t m10 = ( ( uint32_t * )block )[10];
+ const uint32_t m11 = ( ( uint32_t * )block )[11];
+ const uint32_t m12 = ( ( uint32_t * )block )[12];
+ const uint32_t m13 = ( ( uint32_t * )block )[13];
+ const uint32_t m14 = ( ( uint32_t * )block )[14];
+ const uint32_t m15 = ( ( uint32_t * )block )[15];
+#endif
+ row1 = ff0 = LOADU( &S->h[0] );
+ row2 = ff1 = LOADU( &S->h[4] );
+ row3 = _mm_setr_epi32( 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A );
+ row4 = _mm_xor_si128( _mm_setr_epi32( 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 ), LOADU( &S->t[0] ) );
+ ROUND( 0 );
+ ROUND( 1 );
+ ROUND( 2 );
+ ROUND( 3 );
+ ROUND( 4 );
+ ROUND( 5 );
+ ROUND( 6 );
+ ROUND( 7 );
+ ROUND( 8 );
+ ROUND( 9 );
+ STOREU( &S->h[0], _mm_xor_si128( ff0, _mm_xor_si128( row1, row3 ) ) );
+ STOREU( &S->h[4], _mm_xor_si128( ff1, _mm_xor_si128( row2, row4 ) ) );
+ return 0;
+}
+
+
+int blake2s_update( blake2s_state *S, const uint8_t *in, size_t inlen )
+{
+ while( inlen > 0 )
+ {
+ size_t left = S->buflen;
+ size_t fill = 2 * BLAKE2S_BLOCKBYTES - left;
+
+ if( inlen > fill )
+ {
+ memcpy( S->buf + left, in, fill ); // Fill buffer
+ S->buflen += fill;
+ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
+ blake2s_compress( S, S->buf ); // Compress
+ memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
+ S->buflen -= BLAKE2S_BLOCKBYTES;
+ in += fill;
+ inlen -= fill;
+ }
+ else /* inlen <= fill */
+ {
+ memcpy( S->buf + left, in, inlen );
+ S->buflen += inlen; // Be lazy, do not compress
+ in += inlen;
+ inlen -= inlen;
+ }
+ }
+
+ return 0;
+}
+
+
+int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen )
+{
+ uint8_t buffer[BLAKE2S_OUTBYTES];
+
+ if(outlen != S->outlen ) return -1;
+
+ if( S->buflen > BLAKE2S_BLOCKBYTES )
+ {
+ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
+ blake2s_compress( S, S->buf );
+ S->buflen -= BLAKE2S_BLOCKBYTES;
+ memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen );
+ }
+
+ blake2s_increment_counter( S, ( uint32_t )S->buflen );
+ blake2s_set_lastblock( S );
+ memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */
+ blake2s_compress( S, S->buf );
+
+ for( int i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
+ store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
+
+ memcpy( out, buffer, outlen );
+ return 0;
+}
+
+int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
+{
+ blake2s_state S[1];
+
+ /* Verify parameters */
+ if ( NULL == in && inlen > 0 ) return -1;
+
+ if ( NULL == out ) return -1;
+
+ if ( NULL == key && keylen > 0) return -1;
+
+ if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1;
+
+ if( keylen > BLAKE2S_KEYBYTES ) return -1;
+
+ if( keylen > 0 )
+ {
+ if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1;
+ }
+ else
+ {
+ if( blake2s_init( S, outlen ) < 0 ) return -1;
+ }
+
+ if( blake2s_update( S, ( uint8_t * )in, inlen ) < 0) return -1;
+ return blake2s_final( S, out, outlen );
+}
+
+#if defined(SUPERCOP)
+int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen )
+{
+ return blake2s( out, in, NULL, BLAKE2S_OUTBYTES, (size_t)inlen, 0 );
+}
+#endif
+
diff --git a/contrib/tools/python3/Modules/_bz2module.c b/contrib/tools/python3/Modules/_bz2module.c
new file mode 100644
index 00000000000..97bd44b4ac9
--- /dev/null
+++ b/contrib/tools/python3/Modules/_bz2module.c
@@ -0,0 +1,820 @@
+/* _bz2 - Low-level Python interface to libbzip2. */
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+
+#include <bzlib.h>
+#include <stdio.h>
+
+// Blocks output buffer wrappers
+#include "pycore_blocks_output_buffer.h"
+
+#if OUTPUT_BUFFER_MAX_BLOCK_SIZE > UINT32_MAX
+ #error "The maximum block size accepted by libbzip2 is UINT32_MAX."
+#endif
+
+typedef struct {
+ PyTypeObject *bz2_compressor_type;
+ PyTypeObject *bz2_decompressor_type;
+} _bz2_state;
+
+static inline _bz2_state *
+get_module_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_bz2_state *)state;
+}
+
+static struct PyModuleDef _bz2module;
+
+static inline _bz2_state *
+find_module_state_by_def(PyTypeObject *type)
+{
+ PyObject *module = PyType_GetModuleByDef(type, &_bz2module);
+ assert(module != NULL);
+ return get_module_state(module);
+}
+
+/* On success, return value >= 0
+ On failure, return -1 */
+static inline Py_ssize_t
+OutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, Py_ssize_t max_length,
+ char **next_out, uint32_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ allocated = _BlocksOutputBuffer_InitAndGrow(
+ buffer, max_length, (void**) next_out);
+ *avail_out = (uint32_t) allocated;
+ return allocated;
+}
+
+/* On success, return value >= 0
+ On failure, return -1 */
+static inline Py_ssize_t
+OutputBuffer_Grow(_BlocksOutputBuffer *buffer,
+ char **next_out, uint32_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ allocated = _BlocksOutputBuffer_Grow(
+ buffer, (void**) next_out, (Py_ssize_t) *avail_out);
+ *avail_out = (uint32_t) allocated;
+ return allocated;
+}
+
+static inline Py_ssize_t
+OutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, uint32_t avail_out)
+{
+ return _BlocksOutputBuffer_GetDataSize(buffer, (Py_ssize_t) avail_out);
+}
+
+static inline PyObject *
+OutputBuffer_Finish(_BlocksOutputBuffer *buffer, uint32_t avail_out)
+{
+ return _BlocksOutputBuffer_Finish(buffer, (Py_ssize_t) avail_out);
+}
+
+static inline void
+OutputBuffer_OnError(_BlocksOutputBuffer *buffer)
+{
+ _BlocksOutputBuffer_OnError(buffer);
+}
+
+
+#ifndef BZ_CONFIG_ERROR
+#define BZ2_bzCompress bzCompress
+#define BZ2_bzCompressInit bzCompressInit
+#define BZ2_bzCompressEnd bzCompressEnd
+#define BZ2_bzDecompress bzDecompress
+#define BZ2_bzDecompressInit bzDecompressInit
+#define BZ2_bzDecompressEnd bzDecompressEnd
+#endif /* ! BZ_CONFIG_ERROR */
+
+
+#define ACQUIRE_LOCK(obj) do { \
+ if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+ Py_BEGIN_ALLOW_THREADS \
+ PyThread_acquire_lock((obj)->lock, 1); \
+ Py_END_ALLOW_THREADS \
+ } } while (0)
+#define RELEASE_LOCK(obj) PyThread_release_lock((obj)->lock)
+
+
+typedef struct {
+ PyObject_HEAD
+ bz_stream bzs;
+ int flushed;
+ PyThread_type_lock lock;
+} BZ2Compressor;
+
+typedef struct {
+ PyObject_HEAD
+ bz_stream bzs;
+ char eof; /* T_BOOL expects a char */
+ PyObject *unused_data;
+ char needs_input;
+ char *input_buffer;
+ size_t input_buffer_size;
+
+ /* bzs->avail_in is only 32 bit, so we store the true length
+ separately. Conversion and looping is encapsulated in
+ decompress_buf() */
+ size_t bzs_avail_in_real;
+ PyThread_type_lock lock;
+} BZ2Decompressor;
+
+/* Helper functions. */
+
+static int
+catch_bz2_error(int bzerror)
+{
+ switch(bzerror) {
+ case BZ_OK:
+ case BZ_RUN_OK:
+ case BZ_FLUSH_OK:
+ case BZ_FINISH_OK:
+ case BZ_STREAM_END:
+ return 0;
+
+#ifdef BZ_CONFIG_ERROR
+ case BZ_CONFIG_ERROR:
+ PyErr_SetString(PyExc_SystemError,
+ "libbzip2 was not compiled correctly");
+ return 1;
+#endif
+ case BZ_PARAM_ERROR:
+ PyErr_SetString(PyExc_ValueError,
+ "Internal error - "
+ "invalid parameters passed to libbzip2");
+ return 1;
+ case BZ_MEM_ERROR:
+ PyErr_NoMemory();
+ return 1;
+ case BZ_DATA_ERROR:
+ case BZ_DATA_ERROR_MAGIC:
+ PyErr_SetString(PyExc_OSError, "Invalid data stream");
+ return 1;
+ case BZ_IO_ERROR:
+ PyErr_SetString(PyExc_OSError, "Unknown I/O error");
+ return 1;
+ case BZ_UNEXPECTED_EOF:
+ PyErr_SetString(PyExc_EOFError,
+ "Compressed file ended before the logical "
+ "end-of-stream was detected");
+ return 1;
+ case BZ_SEQUENCE_ERROR:
+ PyErr_SetString(PyExc_RuntimeError,
+ "Internal error - "
+ "Invalid sequence of commands sent to libbzip2");
+ return 1;
+ default:
+ PyErr_Format(PyExc_OSError,
+ "Unrecognized error from libbzip2: %d", bzerror);
+ return 1;
+ }
+}
+
+
+/* BZ2Compressor class. */
+
+static PyObject *
+compress(BZ2Compressor *c, char *data, size_t len, int action)
+{
+ PyObject *result;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+
+ if (OutputBuffer_InitAndGrow(&buffer, -1, &c->bzs.next_out, &c->bzs.avail_out) < 0) {
+ goto error;
+ }
+ c->bzs.next_in = data;
+ c->bzs.avail_in = 0;
+
+ for (;;) {
+ int bzerror;
+
+ /* On a 64-bit system, len might not fit in avail_in (an unsigned int).
+ Do compression in chunks of no more than UINT_MAX bytes each. */
+ if (c->bzs.avail_in == 0 && len > 0) {
+ c->bzs.avail_in = (unsigned int)Py_MIN(len, UINT_MAX);
+ len -= c->bzs.avail_in;
+ }
+
+ /* In regular compression mode, stop when input data is exhausted. */
+ if (action == BZ_RUN && c->bzs.avail_in == 0)
+ break;
+
+ if (c->bzs.avail_out == 0) {
+ if (OutputBuffer_Grow(&buffer, &c->bzs.next_out, &c->bzs.avail_out) < 0) {
+ goto error;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ bzerror = BZ2_bzCompress(&c->bzs, action);
+ Py_END_ALLOW_THREADS
+
+ if (catch_bz2_error(bzerror))
+ goto error;
+
+ /* In flushing mode, stop when all buffered data has been flushed. */
+ if (action == BZ_FINISH && bzerror == BZ_STREAM_END)
+ break;
+ }
+
+ result = OutputBuffer_Finish(&buffer, c->bzs.avail_out);
+ if (result != NULL) {
+ return result;
+ }
+
+error:
+ OutputBuffer_OnError(&buffer);
+ return NULL;
+}
+
+/*[clinic input]
+module _bz2
+class _bz2.BZ2Compressor "BZ2Compressor *" "clinic_state()->bz2_compressor_type"
+class _bz2.BZ2Decompressor "BZ2Decompressor *" "clinic_state()->bz2_decompressor_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=92348121632b94c4]*/
+
+#define clinic_state() (find_module_state_by_def(type))
+#include "clinic/_bz2module.c.h"
+#undef clinic_state
+
+/*[clinic input]
+_bz2.BZ2Compressor.compress
+
+ data: Py_buffer
+ /
+
+Provide data to the compressor object.
+
+Returns a chunk of compressed data if possible, or b'' otherwise.
+
+When you have finished providing data to the compressor, call the
+flush() method to finish the compression process.
+[clinic start generated code]*/
+
+static PyObject *
+_bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data)
+/*[clinic end generated code: output=59365426e941fbcc input=85c963218070fc4c]*/
+{
+ PyObject *result = NULL;
+
+ ACQUIRE_LOCK(self);
+ if (self->flushed)
+ PyErr_SetString(PyExc_ValueError, "Compressor has been flushed");
+ else
+ result = compress(self, data->buf, data->len, BZ_RUN);
+ RELEASE_LOCK(self);
+ return result;
+}
+
+/*[clinic input]
+_bz2.BZ2Compressor.flush
+
+Finish the compression process.
+
+Returns the compressed data left in internal buffers.
+
+The compressor object may not be used after this method is called.
+[clinic start generated code]*/
+
+static PyObject *
+_bz2_BZ2Compressor_flush_impl(BZ2Compressor *self)
+/*[clinic end generated code: output=3ef03fc1b092a701 input=d64405d3c6f76691]*/
+{
+ PyObject *result = NULL;
+
+ ACQUIRE_LOCK(self);
+ if (self->flushed)
+ PyErr_SetString(PyExc_ValueError, "Repeated call to flush()");
+ else {
+ self->flushed = 1;
+ result = compress(self, NULL, 0, BZ_FINISH);
+ }
+ RELEASE_LOCK(self);
+ return result;
+}
+
+static void*
+BZ2_Malloc(void* ctx, int items, int size)
+{
+ if (items < 0 || size < 0)
+ return NULL;
+ if (size != 0 && (size_t)items > (size_t)PY_SSIZE_T_MAX / (size_t)size)
+ return NULL;
+ /* PyMem_Malloc() cannot be used: compress() and decompress()
+ release the GIL */
+ return PyMem_RawMalloc((size_t)items * (size_t)size);
+}
+
+static void
+BZ2_Free(void* ctx, void *ptr)
+{
+ PyMem_RawFree(ptr);
+}
+
+/*[clinic input]
+@classmethod
+_bz2.BZ2Compressor.__new__
+
+ compresslevel: int = 9
+ Compression level, as a number between 1 and 9.
+ /
+
+Create a compressor object for compressing data incrementally.
+
+For one-shot compression, use the compress() function instead.
+[clinic start generated code]*/
+
+static PyObject *
+_bz2_BZ2Compressor_impl(PyTypeObject *type, int compresslevel)
+/*[clinic end generated code: output=83346c96beaacad7 input=d4500d2a52c8b263]*/
+{
+ int bzerror;
+ BZ2Compressor *self;
+
+ if (!(1 <= compresslevel && compresslevel <= 9)) {
+ PyErr_SetString(PyExc_ValueError,
+ "compresslevel must be between 1 and 9");
+ return NULL;
+ }
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (BZ2Compressor *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
+
+ self->bzs.opaque = NULL;
+ self->bzs.bzalloc = BZ2_Malloc;
+ self->bzs.bzfree = BZ2_Free;
+ bzerror = BZ2_bzCompressInit(&self->bzs, compresslevel, 0, 0);
+ if (catch_bz2_error(bzerror))
+ goto error;
+
+ return (PyObject *)self;
+
+error:
+ Py_DECREF(self);
+ return NULL;
+}
+
+static void
+BZ2Compressor_dealloc(BZ2Compressor *self)
+{
+ BZ2_bzCompressEnd(&self->bzs);
+ if (self->lock != NULL) {
+ PyThread_free_lock(self->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+BZ2Compressor_traverse(BZ2Compressor *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static PyMethodDef BZ2Compressor_methods[] = {
+ _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF
+ _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF
+ {NULL}
+};
+
+static PyType_Slot bz2_compressor_type_slots[] = {
+ {Py_tp_dealloc, BZ2Compressor_dealloc},
+ {Py_tp_methods, BZ2Compressor_methods},
+ {Py_tp_new, _bz2_BZ2Compressor},
+ {Py_tp_doc, (char *)_bz2_BZ2Compressor__doc__},
+ {Py_tp_traverse, BZ2Compressor_traverse},
+ {0, 0}
+};
+
+static PyType_Spec bz2_compressor_type_spec = {
+ .name = "_bz2.BZ2Compressor",
+ .basicsize = sizeof(BZ2Compressor),
+ // Calling PyType_GetModuleState() on a subclass is not safe.
+ // bz2_compressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
+ // which prevents to create a subclass.
+ // So calling PyType_GetModuleState() in this file is always safe.
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bz2_compressor_type_slots,
+};
+
+/* BZ2Decompressor class. */
+
+/* Decompress data of length d->bzs_avail_in_real in d->bzs.next_in. The output
+ buffer is allocated dynamically and returned. At most max_length bytes are
+ returned, so some of the input may not be consumed. d->bzs.next_in and
+ d->bzs_avail_in_real are updated to reflect the consumed input. */
+static PyObject*
+decompress_buf(BZ2Decompressor *d, Py_ssize_t max_length)
+{
+ /* data_size is strictly positive, but because we repeatedly have to
+ compare against max_length and PyBytes_GET_SIZE we declare it as
+ signed */
+ PyObject *result;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+ bz_stream *bzs = &d->bzs;
+
+ if (OutputBuffer_InitAndGrow(&buffer, max_length, &bzs->next_out, &bzs->avail_out) < 0) {
+ goto error;
+ }
+
+ for (;;) {
+ int bzret;
+ /* On a 64-bit system, buffer length might not fit in avail_out, so we
+ do decompression in chunks of no more than UINT_MAX bytes
+ each. Note that the expression for `avail` is guaranteed to be
+ positive, so the cast is safe. */
+ bzs->avail_in = (unsigned int)Py_MIN(d->bzs_avail_in_real, UINT_MAX);
+ d->bzs_avail_in_real -= bzs->avail_in;
+
+ Py_BEGIN_ALLOW_THREADS
+ bzret = BZ2_bzDecompress(bzs);
+ Py_END_ALLOW_THREADS
+
+ d->bzs_avail_in_real += bzs->avail_in;
+
+ if (catch_bz2_error(bzret))
+ goto error;
+ if (bzret == BZ_STREAM_END) {
+ d->eof = 1;
+ break;
+ } else if (d->bzs_avail_in_real == 0) {
+ break;
+ } else if (bzs->avail_out == 0) {
+ if (OutputBuffer_GetDataSize(&buffer, bzs->avail_out) == max_length) {
+ break;
+ }
+ if (OutputBuffer_Grow(&buffer, &bzs->next_out, &bzs->avail_out) < 0) {
+ goto error;
+ }
+ }
+ }
+
+ result = OutputBuffer_Finish(&buffer, bzs->avail_out);
+ if (result != NULL) {
+ return result;
+ }
+
+error:
+ OutputBuffer_OnError(&buffer);
+ return NULL;
+}
+
+
+static PyObject *
+decompress(BZ2Decompressor *d, char *data, size_t len, Py_ssize_t max_length)
+{
+ char input_buffer_in_use;
+ PyObject *result;
+ bz_stream *bzs = &d->bzs;
+
+ /* Prepend unconsumed input if necessary */
+ if (bzs->next_in != NULL) {
+ size_t avail_now, avail_total;
+
+ /* Number of bytes we can append to input buffer */
+ avail_now = (d->input_buffer + d->input_buffer_size)
+ - (bzs->next_in + d->bzs_avail_in_real);
+
+ /* Number of bytes we can append if we move existing
+ contents to beginning of buffer (overwriting
+ consumed input) */
+ avail_total = d->input_buffer_size - d->bzs_avail_in_real;
+
+ if (avail_total < len) {
+ size_t offset = bzs->next_in - d->input_buffer;
+ char *tmp;
+ size_t new_size = d->input_buffer_size + len - avail_now;
+
+ /* Assign to temporary variable first, so we don't
+ lose address of allocated buffer if realloc fails */
+ tmp = PyMem_Realloc(d->input_buffer, new_size);
+ if (tmp == NULL) {
+ PyErr_SetNone(PyExc_MemoryError);
+ return NULL;
+ }
+ d->input_buffer = tmp;
+ d->input_buffer_size = new_size;
+
+ bzs->next_in = d->input_buffer + offset;
+ }
+ else if (avail_now < len) {
+ memmove(d->input_buffer, bzs->next_in,
+ d->bzs_avail_in_real);
+ bzs->next_in = d->input_buffer;
+ }
+ memcpy((void*)(bzs->next_in + d->bzs_avail_in_real), data, len);
+ d->bzs_avail_in_real += len;
+ input_buffer_in_use = 1;
+ }
+ else {
+ bzs->next_in = data;
+ d->bzs_avail_in_real = len;
+ input_buffer_in_use = 0;
+ }
+
+ result = decompress_buf(d, max_length);
+ if(result == NULL) {
+ bzs->next_in = NULL;
+ return NULL;
+ }
+
+ if (d->eof) {
+ d->needs_input = 0;
+ if (d->bzs_avail_in_real > 0) {
+ Py_XSETREF(d->unused_data,
+ PyBytes_FromStringAndSize(bzs->next_in, d->bzs_avail_in_real));
+ if (d->unused_data == NULL)
+ goto error;
+ }
+ }
+ else if (d->bzs_avail_in_real == 0) {
+ bzs->next_in = NULL;
+ d->needs_input = 1;
+ }
+ else {
+ d->needs_input = 0;
+
+ /* If we did not use the input buffer, we now have
+ to copy the tail from the caller's buffer into the
+ input buffer */
+ if (!input_buffer_in_use) {
+
+ /* Discard buffer if it's too small
+ (resizing it may needlessly copy the current contents) */
+ if (d->input_buffer != NULL &&
+ d->input_buffer_size < d->bzs_avail_in_real) {
+ PyMem_Free(d->input_buffer);
+ d->input_buffer = NULL;
+ }
+
+ /* Allocate if necessary */
+ if (d->input_buffer == NULL) {
+ d->input_buffer = PyMem_Malloc(d->bzs_avail_in_real);
+ if (d->input_buffer == NULL) {
+ PyErr_SetNone(PyExc_MemoryError);
+ goto error;
+ }
+ d->input_buffer_size = d->bzs_avail_in_real;
+ }
+
+ /* Copy tail */
+ memcpy(d->input_buffer, bzs->next_in, d->bzs_avail_in_real);
+ bzs->next_in = d->input_buffer;
+ }
+ }
+
+ return result;
+
+error:
+ Py_XDECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+_bz2.BZ2Decompressor.decompress
+
+ data: Py_buffer
+ max_length: Py_ssize_t=-1
+
+Decompress *data*, returning uncompressed data as bytes.
+
+If *max_length* is nonnegative, returns at most *max_length* bytes of
+decompressed data. If this limit is reached and further output can be
+produced, *self.needs_input* will be set to ``False``. In this case, the next
+call to *decompress()* may provide *data* as b'' to obtain more of the output.
+
+If all of the input data was decompressed and returned (either because this
+was less than *max_length* bytes, or because *max_length* was negative),
+*self.needs_input* will be set to True.
+
+Attempting to decompress data after the end of stream is reached raises an
+EOFError. Any data found after the end of the stream is ignored and saved in
+the unused_data attribute.
+[clinic start generated code]*/
+
+static PyObject *
+_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
+ Py_ssize_t max_length)
+/*[clinic end generated code: output=23e41045deb240a3 input=52e1ffc66a8ea624]*/
+{
+ PyObject *result = NULL;
+
+ ACQUIRE_LOCK(self);
+ if (self->eof)
+ PyErr_SetString(PyExc_EOFError, "End of stream already reached");
+ else
+ result = decompress(self, data->buf, data->len, max_length);
+ RELEASE_LOCK(self);
+ return result;
+}
+
+/*[clinic input]
+@classmethod
+_bz2.BZ2Decompressor.__new__
+
+Create a decompressor object for decompressing data incrementally.
+
+For one-shot decompression, use the decompress() function instead.
+[clinic start generated code]*/
+
+static PyObject *
+_bz2_BZ2Decompressor_impl(PyTypeObject *type)
+/*[clinic end generated code: output=5150d51ccaab220e input=b87413ce51853528]*/
+{
+ BZ2Decompressor *self;
+ int bzerror;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (BZ2Decompressor *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
+
+ self->needs_input = 1;
+ self->bzs_avail_in_real = 0;
+ self->input_buffer = NULL;
+ self->input_buffer_size = 0;
+ self->unused_data = PyBytes_FromStringAndSize(NULL, 0);
+ if (self->unused_data == NULL)
+ goto error;
+
+ bzerror = BZ2_bzDecompressInit(&self->bzs, 0, 0);
+ if (catch_bz2_error(bzerror))
+ goto error;
+
+ return (PyObject *)self;
+
+error:
+ Py_DECREF(self);
+ return NULL;
+}
+
+static void
+BZ2Decompressor_dealloc(BZ2Decompressor *self)
+{
+ if(self->input_buffer != NULL) {
+ PyMem_Free(self->input_buffer);
+ }
+ BZ2_bzDecompressEnd(&self->bzs);
+ Py_CLEAR(self->unused_data);
+ if (self->lock != NULL) {
+ PyThread_free_lock(self->lock);
+ }
+
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+BZ2Decompressor_traverse(BZ2Decompressor *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static PyMethodDef BZ2Decompressor_methods[] = {
+ _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF
+ {NULL}
+};
+
+PyDoc_STRVAR(BZ2Decompressor_eof__doc__,
+"True if the end-of-stream marker has been reached.");
+
+PyDoc_STRVAR(BZ2Decompressor_unused_data__doc__,
+"Data found after the end of the compressed stream.");
+
+PyDoc_STRVAR(BZ2Decompressor_needs_input_doc,
+"True if more input is needed before more decompressed data can be produced.");
+
+static PyMemberDef BZ2Decompressor_members[] = {
+ {"eof", T_BOOL, offsetof(BZ2Decompressor, eof),
+ READONLY, BZ2Decompressor_eof__doc__},
+ {"unused_data", T_OBJECT_EX, offsetof(BZ2Decompressor, unused_data),
+ READONLY, BZ2Decompressor_unused_data__doc__},
+ {"needs_input", T_BOOL, offsetof(BZ2Decompressor, needs_input), READONLY,
+ BZ2Decompressor_needs_input_doc},
+ {NULL}
+};
+
+static PyType_Slot bz2_decompressor_type_slots[] = {
+ {Py_tp_dealloc, BZ2Decompressor_dealloc},
+ {Py_tp_methods, BZ2Decompressor_methods},
+ {Py_tp_doc, (char *)_bz2_BZ2Decompressor__doc__},
+ {Py_tp_members, BZ2Decompressor_members},
+ {Py_tp_new, _bz2_BZ2Decompressor},
+ {Py_tp_traverse, BZ2Decompressor_traverse},
+ {0, 0}
+};
+
+static PyType_Spec bz2_decompressor_type_spec = {
+ .name = "_bz2.BZ2Decompressor",
+ .basicsize = sizeof(BZ2Decompressor),
+ // Calling PyType_GetModuleState() on a subclass is not safe.
+ // bz2_decompressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
+ // which prevents to create a subclass.
+ // So calling PyType_GetModuleState() in this file is always safe.
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bz2_decompressor_type_slots,
+};
+
+/* Module initialization. */
+
+static int
+_bz2_exec(PyObject *module)
+{
+ _bz2_state *state = get_module_state(module);
+ state->bz2_compressor_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
+ &bz2_compressor_type_spec, NULL);
+ if (state->bz2_compressor_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->bz2_compressor_type) < 0) {
+ return -1;
+ }
+
+ state->bz2_decompressor_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
+ &bz2_decompressor_type_spec, NULL);
+ if (state->bz2_decompressor_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->bz2_decompressor_type) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+_bz2_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _bz2_state *state = get_module_state(module);
+ Py_VISIT(state->bz2_compressor_type);
+ Py_VISIT(state->bz2_decompressor_type);
+ return 0;
+}
+
+static int
+_bz2_clear(PyObject *module)
+{
+ _bz2_state *state = get_module_state(module);
+ Py_CLEAR(state->bz2_compressor_type);
+ Py_CLEAR(state->bz2_decompressor_type);
+ return 0;
+}
+
+static void
+_bz2_free(void *module)
+{
+ (void)_bz2_clear((PyObject *)module);
+}
+
+static struct PyModuleDef_Slot _bz2_slots[] = {
+ {Py_mod_exec, _bz2_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _bz2module = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_bz2",
+ .m_size = sizeof(_bz2_state),
+ .m_traverse = _bz2_traverse,
+ .m_clear = _bz2_clear,
+ .m_free = _bz2_free,
+ .m_slots = _bz2_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__bz2(void)
+{
+ return PyModuleDef_Init(&_bz2module);
+}
diff --git a/contrib/tools/python3/Modules/_codecsmodule.c b/contrib/tools/python3/Modules/_codecsmodule.c
new file mode 100644
index 00000000000..777c753bd7c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_codecsmodule.c
@@ -0,0 +1,1072 @@
+/* ------------------------------------------------------------------------
+
+ _codecs -- Provides access to the codec registry and the builtin
+ codecs.
+
+ This module should never be imported directly. The standard library
+ module "codecs" wraps this builtin module for use within Python.
+
+ The codec registry is accessible via:
+
+ register(search_function) -> None
+
+ lookup(encoding) -> CodecInfo object
+
+ The builtin Unicode codecs use the following interface:
+
+ <encoding>_encode(Unicode_object[,errors='strict']) ->
+ (string object, bytes consumed)
+
+ <encoding>_decode(char_buffer_obj[,errors='strict']) ->
+ (Unicode object, bytes consumed)
+
+ These <encoding>s are available: utf_8, unicode_escape,
+ raw_unicode_escape, latin_1, ascii (7-bit), mbcs (on win32).
+
+
+Written by Marc-Andre Lemburg ([email protected]).
+
+Copyright (c) Corporation for National Research Initiatives.
+
+ ------------------------------------------------------------------------ */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+#ifdef MS_WINDOWS
+#include <windows.h>
+#endif
+
+/*[clinic input]
+module _codecs
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e1390e3da3cb9deb]*/
+
+#include "pycore_runtime.h"
+#include "clinic/_codecsmodule.c.h"
+
+/* --- Registry ----------------------------------------------------------- */
+
+/*[clinic input]
+_codecs.register
+ search_function: object
+ /
+
+Register a codec search function.
+
+Search functions are expected to take one argument, the encoding name in
+all lower case letters, and either return None, or a tuple of functions
+(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object).
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_register(PyObject *module, PyObject *search_function)
+/*[clinic end generated code: output=d1bf21e99db7d6d3 input=369578467955cae4]*/
+{
+ if (PyCodec_Register(search_function))
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_codecs.unregister
+ search_function: object
+ /
+
+Unregister a codec search function and clear the registry's cache.
+
+If the search function is not registered, do nothing.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_unregister(PyObject *module, PyObject *search_function)
+/*[clinic end generated code: output=1f0edee9cf246399 input=dd7c004c652d345e]*/
+{
+ if (PyCodec_Unregister(search_function) < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_codecs.lookup
+ encoding: str
+ /
+
+Looks up a codec tuple in the Python codec registry and returns a CodecInfo object.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_lookup_impl(PyObject *module, const char *encoding)
+/*[clinic end generated code: output=9f0afa572080c36d input=3c572c0db3febe9c]*/
+{
+ return _PyCodec_Lookup(encoding);
+}
+
+/*[clinic input]
+_codecs.encode
+ obj: object
+ encoding: str(c_default="NULL") = "utf-8"
+ errors: str(c_default="NULL") = "strict"
+
+Encodes obj using the codec registered for encoding.
+
+The default encoding is 'utf-8'. errors may be given to set a
+different error handling scheme. Default is 'strict' meaning that encoding
+errors raise a ValueError. Other possible values are 'ignore', 'replace'
+and 'backslashreplace' as well as any other name registered with
+codecs.register_error that can handle ValueErrors.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_encode_impl(PyObject *module, PyObject *obj, const char *encoding,
+ const char *errors)
+/*[clinic end generated code: output=385148eb9a067c86 input=cd5b685040ff61f0]*/
+{
+ if (encoding == NULL)
+ encoding = PyUnicode_GetDefaultEncoding();
+
+ /* Encode via the codec registry */
+ return PyCodec_Encode(obj, encoding, errors);
+}
+
+/*[clinic input]
+_codecs.decode
+ obj: object
+ encoding: str(c_default="NULL") = "utf-8"
+ errors: str(c_default="NULL") = "strict"
+
+Decodes obj using the codec registered for encoding.
+
+Default encoding is 'utf-8'. errors may be given to set a
+different error handling scheme. Default is 'strict' meaning that encoding
+errors raise a ValueError. Other possible values are 'ignore', 'replace'
+and 'backslashreplace' as well as any other name registered with
+codecs.register_error that can handle ValueErrors.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_decode_impl(PyObject *module, PyObject *obj, const char *encoding,
+ const char *errors)
+/*[clinic end generated code: output=679882417dc3a0bd input=7702c0cc2fa1add6]*/
+{
+ if (encoding == NULL)
+ encoding = PyUnicode_GetDefaultEncoding();
+
+ /* Decode via the codec registry */
+ return PyCodec_Decode(obj, encoding, errors);
+}
+
+/* --- Helpers ------------------------------------------------------------ */
+
+static
+PyObject *codec_tuple(PyObject *decoded,
+ Py_ssize_t len)
+{
+ if (decoded == NULL)
+ return NULL;
+ return Py_BuildValue("Nn", decoded, len);
+}
+
+/* --- String codecs ------------------------------------------------------ */
+/*[clinic input]
+_codecs.escape_decode
+ data: Py_buffer(accept={str, buffer})
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_escape_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors)
+/*[clinic end generated code: output=505200ba8056979a input=77298a561c90bd82]*/
+{
+ PyObject *decoded = PyBytes_DecodeEscape(data->buf, data->len,
+ errors, 0, NULL);
+ return codec_tuple(decoded, data->len);
+}
+
+/*[clinic input]
+_codecs.escape_encode
+ data: object(subclass_of='&PyBytes_Type')
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_escape_encode_impl(PyObject *module, PyObject *data,
+ const char *errors)
+/*[clinic end generated code: output=4af1d477834bab34 input=8f4b144799a94245]*/
+{
+ Py_ssize_t size;
+ Py_ssize_t newsize;
+ PyObject *v;
+
+ size = PyBytes_GET_SIZE(data);
+ if (size > PY_SSIZE_T_MAX / 4) {
+ PyErr_SetString(PyExc_OverflowError,
+ "string is too large to encode");
+ return NULL;
+ }
+ newsize = 4*size;
+ v = PyBytes_FromStringAndSize(NULL, newsize);
+
+ if (v == NULL) {
+ return NULL;
+ }
+ else {
+ Py_ssize_t i;
+ char c;
+ char *p = PyBytes_AS_STRING(v);
+
+ for (i = 0; i < size; i++) {
+ /* There's at least enough room for a hex escape */
+ assert(newsize - (p - PyBytes_AS_STRING(v)) >= 4);
+ c = PyBytes_AS_STRING(data)[i];
+ if (c == '\'' || c == '\\')
+ *p++ = '\\', *p++ = c;
+ else if (c == '\t')
+ *p++ = '\\', *p++ = 't';
+ else if (c == '\n')
+ *p++ = '\\', *p++ = 'n';
+ else if (c == '\r')
+ *p++ = '\\', *p++ = 'r';
+ else if (c < ' ' || c >= 0x7f) {
+ *p++ = '\\';
+ *p++ = 'x';
+ *p++ = Py_hexdigits[(c & 0xf0) >> 4];
+ *p++ = Py_hexdigits[c & 0xf];
+ }
+ else
+ *p++ = c;
+ }
+ *p = '\0';
+ if (_PyBytes_Resize(&v, (p - PyBytes_AS_STRING(v)))) {
+ return NULL;
+ }
+ }
+
+ return codec_tuple(v, size);
+}
+
+/* --- Decoder ------------------------------------------------------------ */
+/*[clinic input]
+_codecs.utf_7_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_7_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=0cd3a944a32a4089 input=dbf8c8998102dc7d]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF7Stateful(data->buf, data->len,
+ errors,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.utf_8_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_8_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=10f74dec8d9bb8bf input=ca06bc8a9c970e25]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF8Stateful(data->buf, data->len,
+ errors,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.utf_16_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=783b442abcbcc2d0 input=5b0f52071ba6cadc]*/
+{
+ int byteorder = 0;
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF16Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.utf_16_le_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_le_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=899b9e6364379dcd input=115bd8c7b783d0bf]*/
+{
+ int byteorder = -1;
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF16Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.utf_16_be_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_be_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=49f6465ea07669c8 input=63131422b01f9cb4]*/
+{
+ int byteorder = 1;
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF16Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/* This non-standard version also provides access to the byteorder
+ parameter of the builtin UTF-16 codec.
+
+ It returns a tuple (unicode, bytesread, byteorder) with byteorder
+ being the value in effect at the end of data.
+
+*/
+/*[clinic input]
+_codecs.utf_16_ex_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ byteorder: int = 0
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_ex_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int byteorder, int final)
+/*[clinic end generated code: output=0f385f251ecc1988 input=f368a51cf384bf4c]*/
+{
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+
+ PyObject *decoded = PyUnicode_DecodeUTF16Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ if (decoded == NULL)
+ return NULL;
+ return Py_BuildValue("Nni", decoded, consumed, byteorder);
+}
+
+/*[clinic input]
+_codecs.utf_32_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=2fc961807f7b145f input=fcdf3658c5e9b5f3]*/
+{
+ int byteorder = 0;
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF32Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.utf_32_le_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_le_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=ec8f46b67a94f3e6 input=12220556e885f817]*/
+{
+ int byteorder = -1;
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF32Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.utf_32_be_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_be_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=ff82bae862c92c4e input=2bc669b4781598db]*/
+{
+ int byteorder = 1;
+ /* This is overwritten unless final is true. */
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF32Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/* This non-standard version also provides access to the byteorder
+ parameter of the builtin UTF-32 codec.
+
+ It returns a tuple (unicode, bytesread, byteorder) with byteorder
+ being the value in effect at the end of data.
+
+*/
+/*[clinic input]
+_codecs.utf_32_ex_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ byteorder: int = 0
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_ex_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int byteorder, int final)
+/*[clinic end generated code: output=6bfb177dceaf4848 input=4a2323d0013620df]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeUTF32Stateful(data->buf, data->len,
+ errors, &byteorder,
+ final ? NULL : &consumed);
+ if (decoded == NULL)
+ return NULL;
+ return Py_BuildValue("Nni", decoded, consumed, byteorder);
+}
+
+/*[clinic input]
+_codecs.unicode_escape_decode
+ data: Py_buffer(accept={str, buffer})
+ errors: str(accept={str, NoneType}) = None
+ final: bool = True
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_unicode_escape_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=b284f97b12c635ee input=15019f081ffe272b]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = _PyUnicode_DecodeUnicodeEscapeStateful(data->buf, data->len,
+ errors,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.raw_unicode_escape_decode
+ data: Py_buffer(accept={str, buffer})
+ errors: str(accept={str, NoneType}) = None
+ final: bool = True
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_raw_unicode_escape_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=11dbd96301e2879e input=b93f823aa8c343ad]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = _PyUnicode_DecodeRawUnicodeEscapeStateful(data->buf, data->len,
+ errors,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.latin_1_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_latin_1_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors)
+/*[clinic end generated code: output=07f3dfa3f72c7d8f input=76ca58fd6dcd08c7]*/
+{
+ PyObject *decoded = PyUnicode_DecodeLatin1(data->buf, data->len, errors);
+ return codec_tuple(decoded, data->len);
+}
+
+/*[clinic input]
+_codecs.ascii_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_ascii_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors)
+/*[clinic end generated code: output=2627d72058d42429 input=e428a267a04b4481]*/
+{
+ PyObject *decoded = PyUnicode_DecodeASCII(data->buf, data->len, errors);
+ return codec_tuple(decoded, data->len);
+}
+
+/*[clinic input]
+_codecs.charmap_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ mapping: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_charmap_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, PyObject *mapping)
+/*[clinic end generated code: output=2c335b09778cf895 input=15b69df43458eb40]*/
+{
+ PyObject *decoded;
+
+ if (mapping == Py_None)
+ mapping = NULL;
+
+ decoded = PyUnicode_DecodeCharmap(data->buf, data->len, mapping, errors);
+ return codec_tuple(decoded, data->len);
+}
+
+#ifdef MS_WINDOWS
+
+/*[clinic input]
+_codecs.mbcs_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_mbcs_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=39b65b8598938c4b input=f144ad1ed6d8f5a6]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeMBCSStateful(data->buf, data->len,
+ errors, final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.oem_decode
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_oem_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final)
+/*[clinic end generated code: output=da1617612f3fcad8 input=629bf87376d211b4]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeCodePageStateful(CP_OEMCP,
+ data->buf, data->len, errors, final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+/*[clinic input]
+_codecs.code_page_decode
+ codepage: int
+ data: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+ final: bool = False
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_code_page_decode_impl(PyObject *module, int codepage,
+ Py_buffer *data, const char *errors, int final)
+/*[clinic end generated code: output=53008ea967da3fff input=6a32589b0658c277]*/
+{
+ Py_ssize_t consumed = data->len;
+ PyObject *decoded = PyUnicode_DecodeCodePageStateful(codepage,
+ data->buf, data->len,
+ errors,
+ final ? NULL : &consumed);
+ return codec_tuple(decoded, consumed);
+}
+
+#endif /* MS_WINDOWS */
+
+/* --- Encoder ------------------------------------------------------------ */
+
+/*[clinic input]
+_codecs.readbuffer_encode
+ data: Py_buffer(accept={str, buffer})
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_readbuffer_encode_impl(PyObject *module, Py_buffer *data,
+ const char *errors)
+/*[clinic end generated code: output=c645ea7cdb3d6e86 input=aa10cfdf252455c5]*/
+{
+ PyObject *result = PyBytes_FromStringAndSize(data->buf, data->len);
+ return codec_tuple(result, data->len);
+}
+
+/*[clinic input]
+_codecs.utf_7_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_7_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=0feda21ffc921bc8 input=2546dbbb3fa53114]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF7(str, 0, 0, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.utf_8_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_8_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=02bf47332b9c796c input=a3e71ae01c3f93f3]*/
+{
+ return codec_tuple(_PyUnicode_AsUTF8String(str, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/* This version provides access to the byteorder parameter of the
+ builtin UTF-16 codecs as optional third argument. It defaults to 0
+ which means: use the native byte order and prepend the data with a
+ BOM mark.
+
+*/
+
+/*[clinic input]
+_codecs.utf_16_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ byteorder: int = 0
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_encode_impl(PyObject *module, PyObject *str,
+ const char *errors, int byteorder)
+/*[clinic end generated code: output=c654e13efa2e64e4 input=68cdc2eb8338555d]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF16(str, errors, byteorder),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.utf_16_le_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_le_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=431b01e55f2d4995 input=83d042706eed6798]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF16(str, errors, -1),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.utf_16_be_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_16_be_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=96886a6fd54dcae3 input=6f1e9e623b03071b]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF16(str, errors, +1),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/* This version provides access to the byteorder parameter of the
+ builtin UTF-32 codecs as optional third argument. It defaults to 0
+ which means: use the native byte order and prepend the data with a
+ BOM mark.
+
+*/
+
+/*[clinic input]
+_codecs.utf_32_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ byteorder: int = 0
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_encode_impl(PyObject *module, PyObject *str,
+ const char *errors, int byteorder)
+/*[clinic end generated code: output=5c760da0c09a8b83 input=8ec4c64d983bc52b]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF32(str, errors, byteorder),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.utf_32_le_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_le_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=b65cd176de8e36d6 input=f0918d41de3eb1b1]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF32(str, errors, -1),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.utf_32_be_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_utf_32_be_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=1d9e71a9358709e9 input=967a99a95748b557]*/
+{
+ return codec_tuple(_PyUnicode_EncodeUTF32(str, errors, +1),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.unicode_escape_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_unicode_escape_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=66271b30bc4f7a3c input=8c4de07597054e33]*/
+{
+ return codec_tuple(PyUnicode_AsUnicodeEscapeString(str),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.raw_unicode_escape_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_raw_unicode_escape_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=a66a806ed01c830a input=4aa6f280d78e4574]*/
+{
+ return codec_tuple(PyUnicode_AsRawUnicodeEscapeString(str),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.latin_1_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_latin_1_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=2c28c83a27884e08 input=ec3ef74bf85c5c5d]*/
+{
+ return codec_tuple(_PyUnicode_AsLatin1String(str, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.ascii_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_ascii_encode_impl(PyObject *module, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=b5e035182d33befc input=93e6e602838bd3de]*/
+{
+ return codec_tuple(_PyUnicode_AsASCIIString(str, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.charmap_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ mapping: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_charmap_encode_impl(PyObject *module, PyObject *str,
+ const char *errors, PyObject *mapping)
+/*[clinic end generated code: output=047476f48495a9e9 input=2a98feae73dadce8]*/
+{
+ if (mapping == Py_None)
+ mapping = NULL;
+
+ return codec_tuple(_PyUnicode_EncodeCharmap(str, mapping, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.charmap_build
+ map: unicode
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_charmap_build_impl(PyObject *module, PyObject *map)
+/*[clinic end generated code: output=bb073c27031db9ac input=d91a91d1717dbc6d]*/
+{
+ return PyUnicode_BuildEncodingMap(map);
+}
+
+#ifdef MS_WINDOWS
+
+/*[clinic input]
+_codecs.mbcs_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_mbcs_encode_impl(PyObject *module, PyObject *str, const char *errors)
+/*[clinic end generated code: output=76e2e170c966c080 input=2e932fc289ea5a5b]*/
+{
+ return codec_tuple(PyUnicode_EncodeCodePage(CP_ACP, str, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.oem_encode
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_oem_encode_impl(PyObject *module, PyObject *str, const char *errors)
+/*[clinic end generated code: output=65d5982c737de649 input=9eac86dc21eb14f2]*/
+{
+ return codec_tuple(PyUnicode_EncodeCodePage(CP_OEMCP, str, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+/*[clinic input]
+_codecs.code_page_encode
+ code_page: int
+ str: unicode
+ errors: str(accept={str, NoneType}) = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_code_page_encode_impl(PyObject *module, int code_page, PyObject *str,
+ const char *errors)
+/*[clinic end generated code: output=45673f6085657a9e input=7d18a33bc8cd0f94]*/
+{
+ return codec_tuple(PyUnicode_EncodeCodePage(code_page, str, errors),
+ PyUnicode_GET_LENGTH(str));
+}
+
+#endif /* MS_WINDOWS */
+
+/* --- Error handler registry --------------------------------------------- */
+
+/*[clinic input]
+_codecs.register_error
+ errors: str
+ handler: object
+ /
+
+Register the specified error handler under the name errors.
+
+handler must be a callable object, that will be called with an exception
+instance containing information about the location of the encoding/decoding
+error and must return a (replacement, new position) tuple.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_register_error_impl(PyObject *module, const char *errors,
+ PyObject *handler)
+/*[clinic end generated code: output=fa2f7d1879b3067d input=5e6709203c2e33fe]*/
+{
+ if (PyCodec_RegisterError(errors, handler))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_codecs.lookup_error
+ name: str
+ /
+
+lookup_error(errors) -> handler
+
+Return the error handler for the specified error handling name or raise a
+LookupError, if no handler exists under this name.
+[clinic start generated code]*/
+
+static PyObject *
+_codecs_lookup_error_impl(PyObject *module, const char *name)
+/*[clinic end generated code: output=087f05dc0c9a98cc input=4775dd65e6235aba]*/
+{
+ return PyCodec_LookupError(name);
+}
+
+/* --- Module API --------------------------------------------------------- */
+
+static PyMethodDef _codecs_functions[] = {
+ _CODECS_REGISTER_METHODDEF
+ _CODECS_UNREGISTER_METHODDEF
+ _CODECS_LOOKUP_METHODDEF
+ _CODECS_ENCODE_METHODDEF
+ _CODECS_DECODE_METHODDEF
+ _CODECS_ESCAPE_ENCODE_METHODDEF
+ _CODECS_ESCAPE_DECODE_METHODDEF
+ _CODECS_UTF_8_ENCODE_METHODDEF
+ _CODECS_UTF_8_DECODE_METHODDEF
+ _CODECS_UTF_7_ENCODE_METHODDEF
+ _CODECS_UTF_7_DECODE_METHODDEF
+ _CODECS_UTF_16_ENCODE_METHODDEF
+ _CODECS_UTF_16_LE_ENCODE_METHODDEF
+ _CODECS_UTF_16_BE_ENCODE_METHODDEF
+ _CODECS_UTF_16_DECODE_METHODDEF
+ _CODECS_UTF_16_LE_DECODE_METHODDEF
+ _CODECS_UTF_16_BE_DECODE_METHODDEF
+ _CODECS_UTF_16_EX_DECODE_METHODDEF
+ _CODECS_UTF_32_ENCODE_METHODDEF
+ _CODECS_UTF_32_LE_ENCODE_METHODDEF
+ _CODECS_UTF_32_BE_ENCODE_METHODDEF
+ _CODECS_UTF_32_DECODE_METHODDEF
+ _CODECS_UTF_32_LE_DECODE_METHODDEF
+ _CODECS_UTF_32_BE_DECODE_METHODDEF
+ _CODECS_UTF_32_EX_DECODE_METHODDEF
+ _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF
+ _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF
+ _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF
+ _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF
+ _CODECS_LATIN_1_ENCODE_METHODDEF
+ _CODECS_LATIN_1_DECODE_METHODDEF
+ _CODECS_ASCII_ENCODE_METHODDEF
+ _CODECS_ASCII_DECODE_METHODDEF
+ _CODECS_CHARMAP_ENCODE_METHODDEF
+ _CODECS_CHARMAP_DECODE_METHODDEF
+ _CODECS_CHARMAP_BUILD_METHODDEF
+ _CODECS_READBUFFER_ENCODE_METHODDEF
+ _CODECS_MBCS_ENCODE_METHODDEF
+ _CODECS_MBCS_DECODE_METHODDEF
+ _CODECS_OEM_ENCODE_METHODDEF
+ _CODECS_OEM_DECODE_METHODDEF
+ _CODECS_CODE_PAGE_ENCODE_METHODDEF
+ _CODECS_CODE_PAGE_DECODE_METHODDEF
+ _CODECS_REGISTER_ERROR_METHODDEF
+ _CODECS_LOOKUP_ERROR_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyModuleDef_Slot _codecs_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef codecsmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_codecs",
+ NULL,
+ 0,
+ _codecs_functions,
+ _codecs_slots,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__codecs(void)
+{
+ return PyModuleDef_Init(&codecsmodule);
+}
diff --git a/contrib/tools/python3/Modules/_collectionsmodule.c b/contrib/tools/python3/Modules/_collectionsmodule.c
new file mode 100644
index 00000000000..9a81531bdff
--- /dev/null
+++ b/contrib/tools/python3/Modules/_collectionsmodule.c
@@ -0,0 +1,2594 @@
+#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+#include "structmember.h" // PyMemberDef
+#include <stddef.h>
+
+typedef struct {
+ PyTypeObject *deque_type;
+ PyTypeObject *defdict_type;
+ PyTypeObject *dequeiter_type;
+ PyTypeObject *dequereviter_type;
+ PyTypeObject *tuplegetter_type;
+} collections_state;
+
+static inline collections_state *
+get_module_state(PyObject *mod)
+{
+ void *state = _PyModule_GetState(mod);
+ assert(state != NULL);
+ return (collections_state *)state;
+}
+
+static inline collections_state *
+get_module_state_by_cls(PyTypeObject *cls)
+{
+ void *state = _PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return (collections_state *)state;
+}
+
+static struct PyModuleDef _collectionsmodule;
+
+static inline collections_state *
+find_module_state_by_def(PyTypeObject *type)
+{
+ PyObject *mod = PyType_GetModuleByDef(type, &_collectionsmodule);
+ assert(mod != NULL);
+ return get_module_state(mod);
+}
+
+/*[clinic input]
+module _collections
+class _tuplegetter "_tuplegetterobject *" "clinic_state()->tuplegetter_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7356042a89862e0e]*/
+
+/* We can safely assume type to be the defining class,
+ * since tuplegetter is not a base type */
+#define clinic_state() (get_module_state_by_cls(type))
+#include "clinic/_collectionsmodule.c.h"
+#undef clinic_state
+
+/* collections module implementation of a deque() datatype
+ Written and maintained by Raymond D. Hettinger <[email protected]>
+*/
+
+/* The block length may be set to any number over 1. Larger numbers
+ * reduce the number of calls to the memory allocator, give faster
+ * indexing and rotation, and reduce the link to data overhead ratio.
+ * Making the block length a power of two speeds-up the modulo
+ * and division calculations in deque_item() and deque_ass_item().
+ */
+
+#define BLOCKLEN 64
+#define CENTER ((BLOCKLEN - 1) / 2)
+#define MAXFREEBLOCKS 16
+
+/* Data for deque objects is stored in a doubly-linked list of fixed
+ * length blocks. This assures that appends or pops never move any
+ * other data elements besides the one being appended or popped.
+ *
+ * Another advantage is that it completely avoids use of realloc(),
+ * resulting in more predictable performance.
+ *
+ * Textbook implementations of doubly-linked lists store one datum
+ * per link, but that gives them a 200% memory overhead (a prev and
+ * next link for each datum) and it costs one malloc() call per data
+ * element. By using fixed-length blocks, the link to data ratio is
+ * significantly improved and there are proportionally fewer calls
+ * to malloc() and free(). The data blocks of consecutive pointers
+ * also improve cache locality.
+ *
+ * The list of blocks is never empty, so d.leftblock and d.rightblock
+ * are never equal to NULL. The list is not circular.
+ *
+ * A deque d's first element is at d.leftblock[leftindex]
+ * and its last element is at d.rightblock[rightindex].
+ *
+ * Unlike Python slice indices, these indices are inclusive on both
+ * ends. This makes the algorithms for left and right operations
+ * more symmetrical and it simplifies the design.
+ *
+ * The indices, d.leftindex and d.rightindex are always in the range:
+ * 0 <= index < BLOCKLEN
+ *
+ * And their exact relationship is:
+ * (d.leftindex + d.len - 1) % BLOCKLEN == d.rightindex
+ *
+ * Whenever d.leftblock == d.rightblock, then:
+ * d.leftindex + d.len - 1 == d.rightindex
+ *
+ * However, when d.leftblock != d.rightblock, the d.leftindex and
+ * d.rightindex become indices into distinct blocks and either may
+ * be larger than the other.
+ *
+ * Empty deques have:
+ * d.len == 0
+ * d.leftblock == d.rightblock
+ * d.leftindex == CENTER + 1
+ * d.rightindex == CENTER
+ *
+ * Checking for d.len == 0 is the intended way to see whether d is empty.
+ */
+
+typedef struct BLOCK {
+ struct BLOCK *leftlink;
+ PyObject *data[BLOCKLEN];
+ struct BLOCK *rightlink;
+} block;
+
+typedef struct {
+ PyObject_VAR_HEAD
+ block *leftblock;
+ block *rightblock;
+ Py_ssize_t leftindex; /* 0 <= leftindex < BLOCKLEN */
+ Py_ssize_t rightindex; /* 0 <= rightindex < BLOCKLEN */
+ size_t state; /* incremented whenever the indices move */
+ Py_ssize_t maxlen; /* maxlen is -1 for unbounded deques */
+ Py_ssize_t numfreeblocks;
+ block *freeblocks[MAXFREEBLOCKS];
+ PyObject *weakreflist;
+} dequeobject;
+
+/* For debug builds, add error checking to track the endpoints
+ * in the chain of links. The goal is to make sure that link
+ * assignments only take place at endpoints so that links already
+ * in use do not get overwritten.
+ *
+ * CHECK_END should happen before each assignment to a block's link field.
+ * MARK_END should happen whenever a link field becomes a new endpoint.
+ * This happens when new blocks are added or whenever an existing
+ * block is freed leaving another existing block as the new endpoint.
+ */
+
+#ifndef NDEBUG
+#define MARK_END(link) link = NULL;
+#define CHECK_END(link) assert(link == NULL);
+#define CHECK_NOT_END(link) assert(link != NULL);
+#else
+#define MARK_END(link)
+#define CHECK_END(link)
+#define CHECK_NOT_END(link)
+#endif
+
+/* A simple freelisting scheme is used to minimize calls to the memory
+ allocator. It accommodates common use cases where new blocks are being
+ added at about the same rate as old blocks are being freed.
+ */
+
+static inline block *
+newblock(dequeobject *deque) {
+ block *b;
+ if (deque->numfreeblocks) {
+ deque->numfreeblocks--;
+ return deque->freeblocks[deque->numfreeblocks];
+ }
+ b = PyMem_Malloc(sizeof(block));
+ if (b != NULL) {
+ return b;
+ }
+ PyErr_NoMemory();
+ return NULL;
+}
+
+static inline void
+freeblock(dequeobject *deque, block *b)
+{
+ if (deque->numfreeblocks < MAXFREEBLOCKS) {
+ deque->freeblocks[deque->numfreeblocks] = b;
+ deque->numfreeblocks++;
+ } else {
+ PyMem_Free(b);
+ }
+}
+
+static PyObject *
+deque_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ dequeobject *deque;
+ block *b;
+
+ /* create dequeobject structure */
+ deque = (dequeobject *)type->tp_alloc(type, 0);
+ if (deque == NULL)
+ return NULL;
+
+ b = newblock(deque);
+ if (b == NULL) {
+ Py_DECREF(deque);
+ return NULL;
+ }
+ MARK_END(b->leftlink);
+ MARK_END(b->rightlink);
+
+ assert(BLOCKLEN >= 2);
+ Py_SET_SIZE(deque, 0);
+ deque->leftblock = b;
+ deque->rightblock = b;
+ deque->leftindex = CENTER + 1;
+ deque->rightindex = CENTER;
+ deque->state = 0;
+ deque->maxlen = -1;
+ deque->numfreeblocks = 0;
+ deque->weakreflist = NULL;
+
+ return (PyObject *)deque;
+}
+
+static PyObject *
+deque_pop(dequeobject *deque, PyObject *unused)
+{
+ PyObject *item;
+ block *prevblock;
+
+ if (Py_SIZE(deque) == 0) {
+ PyErr_SetString(PyExc_IndexError, "pop from an empty deque");
+ return NULL;
+ }
+ item = deque->rightblock->data[deque->rightindex];
+ deque->rightindex--;
+ Py_SET_SIZE(deque, Py_SIZE(deque) - 1);
+ deque->state++;
+
+ if (deque->rightindex < 0) {
+ if (Py_SIZE(deque)) {
+ prevblock = deque->rightblock->leftlink;
+ assert(deque->leftblock != deque->rightblock);
+ freeblock(deque, deque->rightblock);
+ CHECK_NOT_END(prevblock);
+ MARK_END(prevblock->rightlink);
+ deque->rightblock = prevblock;
+ deque->rightindex = BLOCKLEN - 1;
+ } else {
+ assert(deque->leftblock == deque->rightblock);
+ assert(deque->leftindex == deque->rightindex+1);
+ /* re-center instead of freeing a block */
+ deque->leftindex = CENTER + 1;
+ deque->rightindex = CENTER;
+ }
+ }
+ return item;
+}
+
+PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element.");
+
+static PyObject *
+deque_popleft(dequeobject *deque, PyObject *unused)
+{
+ PyObject *item;
+ block *prevblock;
+
+ if (Py_SIZE(deque) == 0) {
+ PyErr_SetString(PyExc_IndexError, "pop from an empty deque");
+ return NULL;
+ }
+ assert(deque->leftblock != NULL);
+ item = deque->leftblock->data[deque->leftindex];
+ deque->leftindex++;
+ Py_SET_SIZE(deque, Py_SIZE(deque) - 1);
+ deque->state++;
+
+ if (deque->leftindex == BLOCKLEN) {
+ if (Py_SIZE(deque)) {
+ assert(deque->leftblock != deque->rightblock);
+ prevblock = deque->leftblock->rightlink;
+ freeblock(deque, deque->leftblock);
+ CHECK_NOT_END(prevblock);
+ MARK_END(prevblock->leftlink);
+ deque->leftblock = prevblock;
+ deque->leftindex = 0;
+ } else {
+ assert(deque->leftblock == deque->rightblock);
+ assert(deque->leftindex == deque->rightindex+1);
+ /* re-center instead of freeing a block */
+ deque->leftindex = CENTER + 1;
+ deque->rightindex = CENTER;
+ }
+ }
+ return item;
+}
+
+PyDoc_STRVAR(popleft_doc, "Remove and return the leftmost element.");
+
+/* The deque's size limit is d.maxlen. The limit can be zero or positive.
+ * If there is no limit, then d.maxlen == -1.
+ *
+ * After an item is added to a deque, we check to see if the size has
+ * grown past the limit. If it has, we get the size back down to the limit
+ * by popping an item off of the opposite end. The methods that can
+ * trigger this are append(), appendleft(), extend(), and extendleft().
+ *
+ * The macro to check whether a deque needs to be trimmed uses a single
+ * unsigned test that returns true whenever 0 <= maxlen < Py_SIZE(deque).
+ */
+
+#define NEEDS_TRIM(deque, maxlen) ((size_t)(maxlen) < (size_t)(Py_SIZE(deque)))
+
+static inline int
+deque_append_internal(dequeobject *deque, PyObject *item, Py_ssize_t maxlen)
+{
+ if (deque->rightindex == BLOCKLEN - 1) {
+ block *b = newblock(deque);
+ if (b == NULL)
+ return -1;
+ b->leftlink = deque->rightblock;
+ CHECK_END(deque->rightblock->rightlink);
+ deque->rightblock->rightlink = b;
+ deque->rightblock = b;
+ MARK_END(b->rightlink);
+ deque->rightindex = -1;
+ }
+ Py_SET_SIZE(deque, Py_SIZE(deque) + 1);
+ deque->rightindex++;
+ deque->rightblock->data[deque->rightindex] = item;
+ if (NEEDS_TRIM(deque, maxlen)) {
+ PyObject *olditem = deque_popleft(deque, NULL);
+ Py_DECREF(olditem);
+ } else {
+ deque->state++;
+ }
+ return 0;
+}
+
+static PyObject *
+deque_append(dequeobject *deque, PyObject *item)
+{
+ if (deque_append_internal(deque, Py_NewRef(item), deque->maxlen) < 0)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(append_doc, "Add an element to the right side of the deque.");
+
+static inline int
+deque_appendleft_internal(dequeobject *deque, PyObject *item, Py_ssize_t maxlen)
+{
+ if (deque->leftindex == 0) {
+ block *b = newblock(deque);
+ if (b == NULL)
+ return -1;
+ b->rightlink = deque->leftblock;
+ CHECK_END(deque->leftblock->leftlink);
+ deque->leftblock->leftlink = b;
+ deque->leftblock = b;
+ MARK_END(b->leftlink);
+ deque->leftindex = BLOCKLEN;
+ }
+ Py_SET_SIZE(deque, Py_SIZE(deque) + 1);
+ deque->leftindex--;
+ deque->leftblock->data[deque->leftindex] = item;
+ if (NEEDS_TRIM(deque, deque->maxlen)) {
+ PyObject *olditem = deque_pop(deque, NULL);
+ Py_DECREF(olditem);
+ } else {
+ deque->state++;
+ }
+ return 0;
+}
+
+static PyObject *
+deque_appendleft(dequeobject *deque, PyObject *item)
+{
+ if (deque_appendleft_internal(deque, Py_NewRef(item), deque->maxlen) < 0)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(appendleft_doc, "Add an element to the left side of the deque.");
+
+static PyObject*
+finalize_iterator(PyObject *it)
+{
+ if (PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_StopIteration))
+ PyErr_Clear();
+ else {
+ Py_DECREF(it);
+ return NULL;
+ }
+ }
+ Py_DECREF(it);
+ Py_RETURN_NONE;
+}
+
+/* Run an iterator to exhaustion. Shortcut for
+ the extend/extendleft methods when maxlen == 0. */
+static PyObject*
+consume_iterator(PyObject *it)
+{
+ PyObject *(*iternext)(PyObject *);
+ PyObject *item;
+
+ iternext = *Py_TYPE(it)->tp_iternext;
+ while ((item = iternext(it)) != NULL) {
+ Py_DECREF(item);
+ }
+ return finalize_iterator(it);
+}
+
+static PyObject *
+deque_extend(dequeobject *deque, PyObject *iterable)
+{
+ PyObject *it, *item;
+ PyObject *(*iternext)(PyObject *);
+ Py_ssize_t maxlen = deque->maxlen;
+
+ /* Handle case where id(deque) == id(iterable) */
+ if ((PyObject *)deque == iterable) {
+ PyObject *result;
+ PyObject *s = PySequence_List(iterable);
+ if (s == NULL)
+ return NULL;
+ result = deque_extend(deque, s);
+ Py_DECREF(s);
+ return result;
+ }
+
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ if (maxlen == 0)
+ return consume_iterator(it);
+
+ /* Space saving heuristic. Start filling from the left */
+ if (Py_SIZE(deque) == 0) {
+ assert(deque->leftblock == deque->rightblock);
+ assert(deque->leftindex == deque->rightindex+1);
+ deque->leftindex = 1;
+ deque->rightindex = 0;
+ }
+
+ iternext = *Py_TYPE(it)->tp_iternext;
+ while ((item = iternext(it)) != NULL) {
+ if (deque_append_internal(deque, item, maxlen) == -1) {
+ Py_DECREF(item);
+ Py_DECREF(it);
+ return NULL;
+ }
+ }
+ return finalize_iterator(it);
+}
+
+PyDoc_STRVAR(extend_doc,
+"Extend the right side of the deque with elements from the iterable");
+
+static PyObject *
+deque_extendleft(dequeobject *deque, PyObject *iterable)
+{
+ PyObject *it, *item;
+ PyObject *(*iternext)(PyObject *);
+ Py_ssize_t maxlen = deque->maxlen;
+
+ /* Handle case where id(deque) == id(iterable) */
+ if ((PyObject *)deque == iterable) {
+ PyObject *result;
+ PyObject *s = PySequence_List(iterable);
+ if (s == NULL)
+ return NULL;
+ result = deque_extendleft(deque, s);
+ Py_DECREF(s);
+ return result;
+ }
+
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ if (maxlen == 0)
+ return consume_iterator(it);
+
+ /* Space saving heuristic. Start filling from the right */
+ if (Py_SIZE(deque) == 0) {
+ assert(deque->leftblock == deque->rightblock);
+ assert(deque->leftindex == deque->rightindex+1);
+ deque->leftindex = BLOCKLEN - 1;
+ deque->rightindex = BLOCKLEN - 2;
+ }
+
+ iternext = *Py_TYPE(it)->tp_iternext;
+ while ((item = iternext(it)) != NULL) {
+ if (deque_appendleft_internal(deque, item, maxlen) == -1) {
+ Py_DECREF(item);
+ Py_DECREF(it);
+ return NULL;
+ }
+ }
+ return finalize_iterator(it);
+}
+
+PyDoc_STRVAR(extendleft_doc,
+"Extend the left side of the deque with elements from the iterable");
+
+static PyObject *
+deque_inplace_concat(dequeobject *deque, PyObject *other)
+{
+ PyObject *result;
+
+ result = deque_extend(deque, other);
+ if (result == NULL)
+ return result;
+ Py_INCREF(deque);
+ Py_DECREF(result);
+ return (PyObject *)deque;
+}
+
+static PyObject *
+deque_copy(PyObject *deque, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *result;
+ dequeobject *old_deque = (dequeobject *)deque;
+ collections_state *state = find_module_state_by_def(Py_TYPE(deque));
+ if (Py_IS_TYPE(deque, state->deque_type)) {
+ dequeobject *new_deque;
+ PyObject *rv;
+
+ new_deque = (dequeobject *)deque_new(state->deque_type,
+ (PyObject *)NULL, (PyObject *)NULL);
+ if (new_deque == NULL)
+ return NULL;
+ new_deque->maxlen = old_deque->maxlen;
+ /* Fast path for the deque_repeat() common case where len(deque) == 1 */
+ if (Py_SIZE(deque) == 1) {
+ PyObject *item = old_deque->leftblock->data[old_deque->leftindex];
+ rv = deque_append(new_deque, item);
+ } else {
+ rv = deque_extend(new_deque, deque);
+ }
+ if (rv != NULL) {
+ Py_DECREF(rv);
+ return (PyObject *)new_deque;
+ }
+ Py_DECREF(new_deque);
+ return NULL;
+ }
+ if (old_deque->maxlen < 0)
+ result = PyObject_CallOneArg((PyObject *)(Py_TYPE(deque)), deque);
+ else
+ result = PyObject_CallFunction((PyObject *)(Py_TYPE(deque)), "Oi",
+ deque, old_deque->maxlen, NULL);
+ if (result != NULL && !PyObject_TypeCheck(result, state->deque_type)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() must return a deque, not %.200s",
+ Py_TYPE(deque)->tp_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+}
+
+PyDoc_STRVAR(copy_doc, "Return a shallow copy of a deque.");
+
+static PyObject *
+deque_concat(dequeobject *deque, PyObject *other)
+{
+ PyObject *new_deque, *result;
+ int rv;
+
+ collections_state *state = find_module_state_by_def(Py_TYPE(deque));
+ rv = PyObject_IsInstance(other, (PyObject *)state->deque_type);
+ if (rv <= 0) {
+ if (rv == 0) {
+ PyErr_Format(PyExc_TypeError,
+ "can only concatenate deque (not \"%.200s\") to deque",
+ Py_TYPE(other)->tp_name);
+ }
+ return NULL;
+ }
+
+ new_deque = deque_copy((PyObject *)deque, NULL);
+ if (new_deque == NULL)
+ return NULL;
+ result = deque_extend((dequeobject *)new_deque, other);
+ if (result == NULL) {
+ Py_DECREF(new_deque);
+ return NULL;
+ }
+ Py_DECREF(result);
+ return new_deque;
+}
+
+static int
+deque_clear(dequeobject *deque)
+{
+ block *b;
+ block *prevblock;
+ block *leftblock;
+ Py_ssize_t leftindex;
+ Py_ssize_t n, m;
+ PyObject *item;
+ PyObject **itemptr, **limit;
+
+ if (Py_SIZE(deque) == 0)
+ return 0;
+
+ /* During the process of clearing a deque, decrefs can cause the
+ deque to mutate. To avoid fatal confusion, we have to make the
+ deque empty before clearing the blocks and never refer to
+ anything via deque->ref while clearing. (This is the same
+ technique used for clearing lists, sets, and dicts.)
+
+ Making the deque empty requires allocating a new empty block. In
+ the unlikely event that memory is full, we fall back to an
+ alternate method that doesn't require a new block. Repeating
+ pops in a while-loop is slower, possibly re-entrant (and a clever
+ adversary could cause it to never terminate).
+ */
+
+ b = newblock(deque);
+ if (b == NULL) {
+ PyErr_Clear();
+ goto alternate_method;
+ }
+
+ /* Remember the old size, leftblock, and leftindex */
+ n = Py_SIZE(deque);
+ leftblock = deque->leftblock;
+ leftindex = deque->leftindex;
+
+ /* Set the deque to be empty using the newly allocated block */
+ MARK_END(b->leftlink);
+ MARK_END(b->rightlink);
+ Py_SET_SIZE(deque, 0);
+ deque->leftblock = b;
+ deque->rightblock = b;
+ deque->leftindex = CENTER + 1;
+ deque->rightindex = CENTER;
+ deque->state++;
+
+ /* Now the old size, leftblock, and leftindex are disconnected from
+ the empty deque and we can use them to decref the pointers.
+ */
+ m = (BLOCKLEN - leftindex > n) ? n : BLOCKLEN - leftindex;
+ itemptr = &leftblock->data[leftindex];
+ limit = itemptr + m;
+ n -= m;
+ while (1) {
+ if (itemptr == limit) {
+ if (n == 0)
+ break;
+ CHECK_NOT_END(leftblock->rightlink);
+ prevblock = leftblock;
+ leftblock = leftblock->rightlink;
+ m = (n > BLOCKLEN) ? BLOCKLEN : n;
+ itemptr = leftblock->data;
+ limit = itemptr + m;
+ n -= m;
+ freeblock(deque, prevblock);
+ }
+ item = *(itemptr++);
+ Py_DECREF(item);
+ }
+ CHECK_END(leftblock->rightlink);
+ freeblock(deque, leftblock);
+ return 0;
+
+ alternate_method:
+ while (Py_SIZE(deque)) {
+ item = deque_pop(deque, NULL);
+ assert (item != NULL);
+ Py_DECREF(item);
+ }
+ return 0;
+}
+
+static PyObject *
+deque_clearmethod(dequeobject *deque, PyObject *Py_UNUSED(ignored))
+{
+ deque_clear(deque);
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(clear_doc, "Remove all elements from the deque.");
+
+static PyObject *
+deque_inplace_repeat(dequeobject *deque, Py_ssize_t n)
+{
+ Py_ssize_t i, m, size;
+ PyObject *seq;
+ PyObject *rv;
+
+ size = Py_SIZE(deque);
+ if (size == 0 || n == 1) {
+ return Py_NewRef(deque);
+ }
+
+ if (n <= 0) {
+ deque_clear(deque);
+ return Py_NewRef(deque);
+ }
+
+ if (size == 1) {
+ /* common case, repeating a single element */
+ PyObject *item = deque->leftblock->data[deque->leftindex];
+
+ if (deque->maxlen >= 0 && n > deque->maxlen)
+ n = deque->maxlen;
+
+ deque->state++;
+ for (i = 0 ; i < n-1 ; ) {
+ if (deque->rightindex == BLOCKLEN - 1) {
+ block *b = newblock(deque);
+ if (b == NULL) {
+ Py_SET_SIZE(deque, Py_SIZE(deque) + i);
+ return NULL;
+ }
+ b->leftlink = deque->rightblock;
+ CHECK_END(deque->rightblock->rightlink);
+ deque->rightblock->rightlink = b;
+ deque->rightblock = b;
+ MARK_END(b->rightlink);
+ deque->rightindex = -1;
+ }
+ m = n - 1 - i;
+ if (m > BLOCKLEN - 1 - deque->rightindex)
+ m = BLOCKLEN - 1 - deque->rightindex;
+ i += m;
+ while (m--) {
+ deque->rightindex++;
+ deque->rightblock->data[deque->rightindex] = Py_NewRef(item);
+ }
+ }
+ Py_SET_SIZE(deque, Py_SIZE(deque) + i);
+ return Py_NewRef(deque);
+ }
+
+ if ((size_t)size > PY_SSIZE_T_MAX / (size_t)n) {
+ return PyErr_NoMemory();
+ }
+
+ seq = PySequence_List((PyObject *)deque);
+ if (seq == NULL)
+ return seq;
+
+ /* Reduce the number of repetitions when maxlen would be exceeded */
+ if (deque->maxlen >= 0 && n * size > deque->maxlen)
+ n = (deque->maxlen + size - 1) / size;
+
+ for (i = 0 ; i < n-1 ; i++) {
+ rv = deque_extend(deque, seq);
+ if (rv == NULL) {
+ Py_DECREF(seq);
+ return NULL;
+ }
+ Py_DECREF(rv);
+ }
+ Py_INCREF(deque);
+ Py_DECREF(seq);
+ return (PyObject *)deque;
+}
+
+static PyObject *
+deque_repeat(dequeobject *deque, Py_ssize_t n)
+{
+ dequeobject *new_deque;
+ PyObject *rv;
+
+ new_deque = (dequeobject *)deque_copy((PyObject *) deque, NULL);
+ if (new_deque == NULL)
+ return NULL;
+ rv = deque_inplace_repeat(new_deque, n);
+ Py_DECREF(new_deque);
+ return rv;
+}
+
+/* The rotate() method is part of the public API and is used internally
+as a primitive for other methods.
+
+Rotation by 1 or -1 is a common case, so any optimizations for high
+volume rotations should take care not to penalize the common case.
+
+Conceptually, a rotate by one is equivalent to a pop on one side and an
+append on the other. However, a pop/append pair is unnecessarily slow
+because it requires an incref/decref pair for an object located randomly
+in memory. It is better to just move the object pointer from one block
+to the next without changing the reference count.
+
+When moving batches of pointers, it is tempting to use memcpy() but that
+proved to be slower than a simple loop for a variety of reasons.
+Memcpy() cannot know in advance that we're copying pointers instead of
+bytes, that the source and destination are pointer aligned and
+non-overlapping, that moving just one pointer is a common case, that we
+never need to move more than BLOCKLEN pointers, and that at least one
+pointer is always moved.
+
+For high volume rotations, newblock() and freeblock() are never called
+more than once. Previously emptied blocks are immediately reused as a
+destination block. If a block is left-over at the end, it is freed.
+*/
+
+static int
+_deque_rotate(dequeobject *deque, Py_ssize_t n)
+{
+ block *b = NULL;
+ block *leftblock = deque->leftblock;
+ block *rightblock = deque->rightblock;
+ Py_ssize_t leftindex = deque->leftindex;
+ Py_ssize_t rightindex = deque->rightindex;
+ Py_ssize_t len=Py_SIZE(deque), halflen=len>>1;
+ int rv = -1;
+
+ if (len <= 1)
+ return 0;
+ if (n > halflen || n < -halflen) {
+ n %= len;
+ if (n > halflen)
+ n -= len;
+ else if (n < -halflen)
+ n += len;
+ }
+ assert(len > 1);
+ assert(-halflen <= n && n <= halflen);
+
+ deque->state++;
+ while (n > 0) {
+ if (leftindex == 0) {
+ if (b == NULL) {
+ b = newblock(deque);
+ if (b == NULL)
+ goto done;
+ }
+ b->rightlink = leftblock;
+ CHECK_END(leftblock->leftlink);
+ leftblock->leftlink = b;
+ leftblock = b;
+ MARK_END(b->leftlink);
+ leftindex = BLOCKLEN;
+ b = NULL;
+ }
+ assert(leftindex > 0);
+ {
+ PyObject **src, **dest;
+ Py_ssize_t m = n;
+
+ if (m > rightindex + 1)
+ m = rightindex + 1;
+ if (m > leftindex)
+ m = leftindex;
+ assert (m > 0 && m <= len);
+ rightindex -= m;
+ leftindex -= m;
+ src = &rightblock->data[rightindex + 1];
+ dest = &leftblock->data[leftindex];
+ n -= m;
+ do {
+ *(dest++) = *(src++);
+ } while (--m);
+ }
+ if (rightindex < 0) {
+ assert(leftblock != rightblock);
+ assert(b == NULL);
+ b = rightblock;
+ CHECK_NOT_END(rightblock->leftlink);
+ rightblock = rightblock->leftlink;
+ MARK_END(rightblock->rightlink);
+ rightindex = BLOCKLEN - 1;
+ }
+ }
+ while (n < 0) {
+ if (rightindex == BLOCKLEN - 1) {
+ if (b == NULL) {
+ b = newblock(deque);
+ if (b == NULL)
+ goto done;
+ }
+ b->leftlink = rightblock;
+ CHECK_END(rightblock->rightlink);
+ rightblock->rightlink = b;
+ rightblock = b;
+ MARK_END(b->rightlink);
+ rightindex = -1;
+ b = NULL;
+ }
+ assert (rightindex < BLOCKLEN - 1);
+ {
+ PyObject **src, **dest;
+ Py_ssize_t m = -n;
+
+ if (m > BLOCKLEN - leftindex)
+ m = BLOCKLEN - leftindex;
+ if (m > BLOCKLEN - 1 - rightindex)
+ m = BLOCKLEN - 1 - rightindex;
+ assert (m > 0 && m <= len);
+ src = &leftblock->data[leftindex];
+ dest = &rightblock->data[rightindex + 1];
+ leftindex += m;
+ rightindex += m;
+ n += m;
+ do {
+ *(dest++) = *(src++);
+ } while (--m);
+ }
+ if (leftindex == BLOCKLEN) {
+ assert(leftblock != rightblock);
+ assert(b == NULL);
+ b = leftblock;
+ CHECK_NOT_END(leftblock->rightlink);
+ leftblock = leftblock->rightlink;
+ MARK_END(leftblock->leftlink);
+ leftindex = 0;
+ }
+ }
+ rv = 0;
+done:
+ if (b != NULL)
+ freeblock(deque, b);
+ deque->leftblock = leftblock;
+ deque->rightblock = rightblock;
+ deque->leftindex = leftindex;
+ deque->rightindex = rightindex;
+
+ return rv;
+}
+
+static PyObject *
+deque_rotate(dequeobject *deque, PyObject *const *args, Py_ssize_t nargs)
+{
+ Py_ssize_t n=1;
+
+ if (!_PyArg_CheckPositional("deque.rotate", nargs, 0, 1)) {
+ return NULL;
+ }
+ if (nargs) {
+ PyObject *index = _PyNumber_Index(args[0]);
+ if (index == NULL) {
+ return NULL;
+ }
+ n = PyLong_AsSsize_t(index);
+ Py_DECREF(index);
+ if (n == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+
+ if (!_deque_rotate(deque, n))
+ Py_RETURN_NONE;
+ return NULL;
+}
+
+PyDoc_STRVAR(rotate_doc,
+"Rotate the deque n steps to the right (default n=1). If n is negative, rotates left.");
+
+static PyObject *
+deque_reverse(dequeobject *deque, PyObject *unused)
+{
+ block *leftblock = deque->leftblock;
+ block *rightblock = deque->rightblock;
+ Py_ssize_t leftindex = deque->leftindex;
+ Py_ssize_t rightindex = deque->rightindex;
+ Py_ssize_t n = Py_SIZE(deque) >> 1;
+ PyObject *tmp;
+
+ while (--n >= 0) {
+ /* Validate that pointers haven't met in the middle */
+ assert(leftblock != rightblock || leftindex < rightindex);
+ CHECK_NOT_END(leftblock);
+ CHECK_NOT_END(rightblock);
+
+ /* Swap */
+ tmp = leftblock->data[leftindex];
+ leftblock->data[leftindex] = rightblock->data[rightindex];
+ rightblock->data[rightindex] = tmp;
+
+ /* Advance left block/index pair */
+ leftindex++;
+ if (leftindex == BLOCKLEN) {
+ leftblock = leftblock->rightlink;
+ leftindex = 0;
+ }
+
+ /* Step backwards with the right block/index pair */
+ rightindex--;
+ if (rightindex < 0) {
+ rightblock = rightblock->leftlink;
+ rightindex = BLOCKLEN - 1;
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(reverse_doc,
+"D.reverse() -- reverse *IN PLACE*");
+
+static PyObject *
+deque_count(dequeobject *deque, PyObject *v)
+{
+ block *b = deque->leftblock;
+ Py_ssize_t index = deque->leftindex;
+ Py_ssize_t n = Py_SIZE(deque);
+ Py_ssize_t count = 0;
+ size_t start_state = deque->state;
+ PyObject *item;
+ int cmp;
+
+ while (--n >= 0) {
+ CHECK_NOT_END(b);
+ item = Py_NewRef(b->data[index]);
+ cmp = PyObject_RichCompareBool(item, v, Py_EQ);
+ Py_DECREF(item);
+ if (cmp < 0)
+ return NULL;
+ count += cmp;
+
+ if (start_state != deque->state) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return NULL;
+ }
+
+ /* Advance left block/index pair */
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
+ }
+ }
+ return PyLong_FromSsize_t(count);
+}
+
+PyDoc_STRVAR(count_doc,
+"D.count(value) -- return number of occurrences of value");
+
+static int
+deque_contains(dequeobject *deque, PyObject *v)
+{
+ block *b = deque->leftblock;
+ Py_ssize_t index = deque->leftindex;
+ Py_ssize_t n = Py_SIZE(deque);
+ size_t start_state = deque->state;
+ PyObject *item;
+ int cmp;
+
+ while (--n >= 0) {
+ CHECK_NOT_END(b);
+ item = Py_NewRef(b->data[index]);
+ cmp = PyObject_RichCompareBool(item, v, Py_EQ);
+ Py_DECREF(item);
+ if (cmp) {
+ return cmp;
+ }
+ if (start_state != deque->state) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return -1;
+ }
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
+ }
+ }
+ return 0;
+}
+
+static Py_ssize_t
+deque_len(dequeobject *deque)
+{
+ return Py_SIZE(deque);
+}
+
+static PyObject *
+deque_index(dequeobject *deque, PyObject *const *args, Py_ssize_t nargs)
+{
+ Py_ssize_t i, n, start=0, stop=Py_SIZE(deque);
+ PyObject *v, *item;
+ block *b = deque->leftblock;
+ Py_ssize_t index = deque->leftindex;
+ size_t start_state = deque->state;
+ int cmp;
+
+ if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index", &v,
+ _PyEval_SliceIndexNotNone, &start,
+ _PyEval_SliceIndexNotNone, &stop)) {
+ return NULL;
+ }
+
+ if (start < 0) {
+ start += Py_SIZE(deque);
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0) {
+ stop += Py_SIZE(deque);
+ if (stop < 0)
+ stop = 0;
+ }
+ if (stop > Py_SIZE(deque))
+ stop = Py_SIZE(deque);
+ if (start > stop)
+ start = stop;
+ assert(0 <= start && start <= stop && stop <= Py_SIZE(deque));
+
+ for (i=0 ; i < start - BLOCKLEN ; i += BLOCKLEN) {
+ b = b->rightlink;
+ }
+ for ( ; i < start ; i++) {
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
+ }
+ }
+
+ n = stop - i;
+ while (--n >= 0) {
+ CHECK_NOT_END(b);
+ item = b->data[index];
+ cmp = PyObject_RichCompareBool(item, v, Py_EQ);
+ if (cmp > 0)
+ return PyLong_FromSsize_t(stop - n - 1);
+ if (cmp < 0)
+ return NULL;
+ if (start_state != deque->state) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return NULL;
+ }
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
+ }
+ }
+ PyErr_Format(PyExc_ValueError, "%R is not in deque", v);
+ return NULL;
+}
+
+PyDoc_STRVAR(index_doc,
+"D.index(value, [start, [stop]]) -- return first index of value.\n"
+"Raises ValueError if the value is not present.");
+
+/* insert(), remove(), and delitem() are implemented in terms of
+ rotate() for simplicity and reasonable performance near the end
+ points. If for some reason these methods become popular, it is not
+ hard to re-implement this using direct data movement (similar to
+ the code used in list slice assignments) and achieve a performance
+ boost (by moving each pointer only once instead of twice).
+*/
+
+static PyObject *
+deque_insert(dequeobject *deque, PyObject *const *args, Py_ssize_t nargs)
+{
+ Py_ssize_t index;
+ Py_ssize_t n = Py_SIZE(deque);
+ PyObject *value;
+ PyObject *rv;
+
+ if (!_PyArg_ParseStack(args, nargs, "nO:insert", &index, &value)) {
+ return NULL;
+ }
+
+ if (deque->maxlen == Py_SIZE(deque)) {
+ PyErr_SetString(PyExc_IndexError, "deque already at its maximum size");
+ return NULL;
+ }
+ if (index >= n)
+ return deque_append(deque, value);
+ if (index <= -n || index == 0)
+ return deque_appendleft(deque, value);
+ if (_deque_rotate(deque, -index))
+ return NULL;
+ if (index < 0)
+ rv = deque_append(deque, value);
+ else
+ rv = deque_appendleft(deque, value);
+ if (rv == NULL)
+ return NULL;
+ Py_DECREF(rv);
+ if (_deque_rotate(deque, index))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(insert_doc,
+"D.insert(index, object) -- insert object before index");
+
+PyDoc_STRVAR(remove_doc,
+"D.remove(value) -- remove first occurrence of value.");
+
+static int
+valid_index(Py_ssize_t i, Py_ssize_t limit)
+{
+ /* The cast to size_t lets us use just a single comparison
+ to check whether i is in the range: 0 <= i < limit */
+ return (size_t) i < (size_t) limit;
+}
+
+static PyObject *
+deque_item(dequeobject *deque, Py_ssize_t i)
+{
+ block *b;
+ PyObject *item;
+ Py_ssize_t n, index=i;
+
+ if (!valid_index(i, Py_SIZE(deque))) {
+ PyErr_SetString(PyExc_IndexError, "deque index out of range");
+ return NULL;
+ }
+
+ if (i == 0) {
+ i = deque->leftindex;
+ b = deque->leftblock;
+ } else if (i == Py_SIZE(deque) - 1) {
+ i = deque->rightindex;
+ b = deque->rightblock;
+ } else {
+ i += deque->leftindex;
+ n = (Py_ssize_t)((size_t) i / BLOCKLEN);
+ i = (Py_ssize_t)((size_t) i % BLOCKLEN);
+ if (index < (Py_SIZE(deque) >> 1)) {
+ b = deque->leftblock;
+ while (--n >= 0)
+ b = b->rightlink;
+ } else {
+ n = (Py_ssize_t)(
+ ((size_t)(deque->leftindex + Py_SIZE(deque) - 1))
+ / BLOCKLEN - n);
+ b = deque->rightblock;
+ while (--n >= 0)
+ b = b->leftlink;
+ }
+ }
+ item = b->data[i];
+ return Py_NewRef(item);
+}
+
+static int
+deque_del_item(dequeobject *deque, Py_ssize_t i)
+{
+ PyObject *item;
+ int rv;
+
+ assert (i >= 0 && i < Py_SIZE(deque));
+ if (_deque_rotate(deque, -i))
+ return -1;
+ item = deque_popleft(deque, NULL);
+ rv = _deque_rotate(deque, i);
+ assert (item != NULL);
+ Py_DECREF(item);
+ return rv;
+}
+
+static PyObject *
+deque_remove(dequeobject *deque, PyObject *value)
+{
+ PyObject *item;
+ block *b = deque->leftblock;
+ Py_ssize_t i, n = Py_SIZE(deque), index = deque->leftindex;
+ size_t start_state = deque->state;
+ int cmp, rv;
+
+ for (i = 0 ; i < n; i++) {
+ item = Py_NewRef(b->data[index]);
+ cmp = PyObject_RichCompareBool(item, value, Py_EQ);
+ Py_DECREF(item);
+ if (cmp < 0) {
+ return NULL;
+ }
+ if (start_state != deque->state) {
+ PyErr_SetString(PyExc_IndexError,
+ "deque mutated during iteration");
+ return NULL;
+ }
+ if (cmp > 0) {
+ break;
+ }
+ index++;
+ if (index == BLOCKLEN) {
+ b = b->rightlink;
+ index = 0;
+ }
+ }
+ if (i == n) {
+ PyErr_Format(PyExc_ValueError, "%R is not in deque", value);
+ return NULL;
+ }
+ rv = deque_del_item(deque, i);
+ if (rv == -1) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static int
+deque_ass_item(dequeobject *deque, Py_ssize_t i, PyObject *v)
+{
+ block *b;
+ Py_ssize_t n, len=Py_SIZE(deque), halflen=(len+1)>>1, index=i;
+
+ if (!valid_index(i, len)) {
+ PyErr_SetString(PyExc_IndexError, "deque index out of range");
+ return -1;
+ }
+ if (v == NULL)
+ return deque_del_item(deque, i);
+
+ i += deque->leftindex;
+ n = (Py_ssize_t)((size_t) i / BLOCKLEN);
+ i = (Py_ssize_t)((size_t) i % BLOCKLEN);
+ if (index <= halflen) {
+ b = deque->leftblock;
+ while (--n >= 0)
+ b = b->rightlink;
+ } else {
+ n = (Py_ssize_t)(
+ ((size_t)(deque->leftindex + Py_SIZE(deque) - 1))
+ / BLOCKLEN - n);
+ b = deque->rightblock;
+ while (--n >= 0)
+ b = b->leftlink;
+ }
+ Py_SETREF(b->data[i], Py_NewRef(v));
+ return 0;
+}
+
+static void
+deque_dealloc(dequeobject *deque)
+{
+ PyTypeObject *tp = Py_TYPE(deque);
+ Py_ssize_t i;
+
+ PyObject_GC_UnTrack(deque);
+ if (deque->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) deque);
+ if (deque->leftblock != NULL) {
+ deque_clear(deque);
+ assert(deque->leftblock != NULL);
+ freeblock(deque, deque->leftblock);
+ }
+ deque->leftblock = NULL;
+ deque->rightblock = NULL;
+ for (i=0 ; i < deque->numfreeblocks ; i++) {
+ PyMem_Free(deque->freeblocks[i]);
+ }
+ tp->tp_free(deque);
+ Py_DECREF(tp);
+}
+
+static int
+deque_traverse(dequeobject *deque, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(deque));
+
+ block *b;
+ PyObject *item;
+ Py_ssize_t index;
+ Py_ssize_t indexlo = deque->leftindex;
+ Py_ssize_t indexhigh;
+
+ for (b = deque->leftblock; b != deque->rightblock; b = b->rightlink) {
+ for (index = indexlo; index < BLOCKLEN ; index++) {
+ item = b->data[index];
+ Py_VISIT(item);
+ }
+ indexlo = 0;
+ }
+ indexhigh = deque->rightindex;
+ for (index = indexlo; index <= indexhigh; index++) {
+ item = b->data[index];
+ Py_VISIT(item);
+ }
+ return 0;
+}
+
+static PyObject *
+deque_reduce(dequeobject *deque, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *state, *it;
+
+ state = _PyObject_GetState((PyObject *)deque);
+ if (state == NULL) {
+ return NULL;
+ }
+
+ it = PyObject_GetIter((PyObject *)deque);
+ if (it == NULL) {
+ Py_DECREF(state);
+ return NULL;
+ }
+
+ if (deque->maxlen < 0) {
+ return Py_BuildValue("O()NN", Py_TYPE(deque), state, it);
+ }
+ else {
+ return Py_BuildValue("O(()n)NN", Py_TYPE(deque), deque->maxlen, state, it);
+ }
+}
+
+PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
+
+static PyObject *
+deque_repr(PyObject *deque)
+{
+ PyObject *aslist, *result;
+ int i;
+
+ i = Py_ReprEnter(deque);
+ if (i != 0) {
+ if (i < 0)
+ return NULL;
+ return PyUnicode_FromString("[...]");
+ }
+
+ aslist = PySequence_List(deque);
+ if (aslist == NULL) {
+ Py_ReprLeave(deque);
+ return NULL;
+ }
+ if (((dequeobject *)deque)->maxlen >= 0)
+ result = PyUnicode_FromFormat("%s(%R, maxlen=%zd)",
+ _PyType_Name(Py_TYPE(deque)), aslist,
+ ((dequeobject *)deque)->maxlen);
+ else
+ result = PyUnicode_FromFormat("%s(%R)",
+ _PyType_Name(Py_TYPE(deque)), aslist);
+ Py_ReprLeave(deque);
+ Py_DECREF(aslist);
+ return result;
+}
+
+static PyObject *
+deque_richcompare(PyObject *v, PyObject *w, int op)
+{
+ PyObject *it1=NULL, *it2=NULL, *x, *y;
+ Py_ssize_t vs, ws;
+ int b, cmp=-1;
+
+ collections_state *state = find_module_state_by_def(Py_TYPE(v));
+ if (!PyObject_TypeCheck(v, state->deque_type) ||
+ !PyObject_TypeCheck(w, state->deque_type)) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+ /* Shortcuts */
+ vs = Py_SIZE((dequeobject *)v);
+ ws = Py_SIZE((dequeobject *)w);
+ if (op == Py_EQ) {
+ if (v == w)
+ Py_RETURN_TRUE;
+ if (vs != ws)
+ Py_RETURN_FALSE;
+ }
+ if (op == Py_NE) {
+ if (v == w)
+ Py_RETURN_FALSE;
+ if (vs != ws)
+ Py_RETURN_TRUE;
+ }
+
+ /* Search for the first index where items are different */
+ it1 = PyObject_GetIter(v);
+ if (it1 == NULL)
+ goto done;
+ it2 = PyObject_GetIter(w);
+ if (it2 == NULL)
+ goto done;
+ for (;;) {
+ x = PyIter_Next(it1);
+ if (x == NULL && PyErr_Occurred())
+ goto done;
+ y = PyIter_Next(it2);
+ if (x == NULL || y == NULL)
+ break;
+ b = PyObject_RichCompareBool(x, y, Py_EQ);
+ if (b == 0) {
+ cmp = PyObject_RichCompareBool(x, y, op);
+ Py_DECREF(x);
+ Py_DECREF(y);
+ goto done;
+ }
+ Py_DECREF(x);
+ Py_DECREF(y);
+ if (b < 0)
+ goto done;
+ }
+ /* We reached the end of one deque or both */
+ Py_XDECREF(x);
+ Py_XDECREF(y);
+ if (PyErr_Occurred())
+ goto done;
+ switch (op) {
+ case Py_LT: cmp = y != NULL; break; /* if w was longer */
+ case Py_LE: cmp = x == NULL; break; /* if v was not longer */
+ case Py_EQ: cmp = x == y; break; /* if we reached the end of both */
+ case Py_NE: cmp = x != y; break; /* if one deque continues */
+ case Py_GT: cmp = x != NULL; break; /* if v was longer */
+ case Py_GE: cmp = y == NULL; break; /* if w was not longer */
+ }
+
+done:
+ Py_XDECREF(it1);
+ Py_XDECREF(it2);
+ if (cmp == 1)
+ Py_RETURN_TRUE;
+ if (cmp == 0)
+ Py_RETURN_FALSE;
+ return NULL;
+}
+
+static int
+deque_init(dequeobject *deque, PyObject *args, PyObject *kwdargs)
+{
+ PyObject *iterable = NULL;
+ PyObject *maxlenobj = NULL;
+ Py_ssize_t maxlen = -1;
+ char *kwlist[] = {"iterable", "maxlen", 0};
+
+ if (kwdargs == NULL && PyTuple_GET_SIZE(args) <= 2) {
+ if (PyTuple_GET_SIZE(args) > 0) {
+ iterable = PyTuple_GET_ITEM(args, 0);
+ }
+ if (PyTuple_GET_SIZE(args) > 1) {
+ maxlenobj = PyTuple_GET_ITEM(args, 1);
+ }
+ } else {
+ if (!PyArg_ParseTupleAndKeywords(args, kwdargs, "|OO:deque", kwlist,
+ &iterable, &maxlenobj))
+ return -1;
+ }
+ if (maxlenobj != NULL && maxlenobj != Py_None) {
+ maxlen = PyLong_AsSsize_t(maxlenobj);
+ if (maxlen == -1 && PyErr_Occurred())
+ return -1;
+ if (maxlen < 0) {
+ PyErr_SetString(PyExc_ValueError, "maxlen must be non-negative");
+ return -1;
+ }
+ }
+ deque->maxlen = maxlen;
+ if (Py_SIZE(deque) > 0)
+ deque_clear(deque);
+ if (iterable != NULL) {
+ PyObject *rv = deque_extend(deque, iterable);
+ if (rv == NULL)
+ return -1;
+ Py_DECREF(rv);
+ }
+ return 0;
+}
+
+static PyObject *
+deque_sizeof(dequeobject *deque, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(deque));
+ size_t blocks;
+ blocks = (size_t)(deque->leftindex + Py_SIZE(deque) + BLOCKLEN - 1) / BLOCKLEN;
+ assert(((size_t)deque->leftindex + (size_t)Py_SIZE(deque) - 1) ==
+ ((blocks - 1) * BLOCKLEN + (size_t)deque->rightindex));
+ res += blocks * sizeof(block);
+ return PyLong_FromSize_t(res);
+}
+
+PyDoc_STRVAR(sizeof_doc,
+"D.__sizeof__() -- size of D in memory, in bytes");
+
+static PyObject *
+deque_get_maxlen(dequeobject *deque, void *Py_UNUSED(ignored))
+{
+ if (deque->maxlen < 0)
+ Py_RETURN_NONE;
+ return PyLong_FromSsize_t(deque->maxlen);
+}
+
+
+/* deque object ********************************************************/
+
+static PyGetSetDef deque_getset[] = {
+ {"maxlen", (getter)deque_get_maxlen, (setter)NULL,
+ "maximum size of a deque or None if unbounded"},
+ {0}
+};
+
+static PyObject *deque_iter(dequeobject *deque);
+static PyObject *deque_reviter(dequeobject *deque, PyObject *Py_UNUSED(ignored));
+PyDoc_STRVAR(reversed_doc,
+ "D.__reversed__() -- return a reverse iterator over the deque");
+
+static PyMethodDef deque_methods[] = {
+ {"append", (PyCFunction)deque_append,
+ METH_O, append_doc},
+ {"appendleft", (PyCFunction)deque_appendleft,
+ METH_O, appendleft_doc},
+ {"clear", (PyCFunction)deque_clearmethod,
+ METH_NOARGS, clear_doc},
+ {"__copy__", deque_copy,
+ METH_NOARGS, copy_doc},
+ {"copy", deque_copy,
+ METH_NOARGS, copy_doc},
+ {"count", (PyCFunction)deque_count,
+ METH_O, count_doc},
+ {"extend", (PyCFunction)deque_extend,
+ METH_O, extend_doc},
+ {"extendleft", (PyCFunction)deque_extendleft,
+ METH_O, extendleft_doc},
+ {"index", _PyCFunction_CAST(deque_index),
+ METH_FASTCALL, index_doc},
+ {"insert", _PyCFunction_CAST(deque_insert),
+ METH_FASTCALL, insert_doc},
+ {"pop", (PyCFunction)deque_pop,
+ METH_NOARGS, pop_doc},
+ {"popleft", (PyCFunction)deque_popleft,
+ METH_NOARGS, popleft_doc},
+ {"__reduce__", (PyCFunction)deque_reduce,
+ METH_NOARGS, reduce_doc},
+ {"remove", (PyCFunction)deque_remove,
+ METH_O, remove_doc},
+ {"__reversed__", (PyCFunction)deque_reviter,
+ METH_NOARGS, reversed_doc},
+ {"reverse", (PyCFunction)deque_reverse,
+ METH_NOARGS, reverse_doc},
+ {"rotate", _PyCFunction_CAST(deque_rotate),
+ METH_FASTCALL, rotate_doc},
+ {"__sizeof__", (PyCFunction)deque_sizeof,
+ METH_NOARGS, sizeof_doc},
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyMemberDef deque_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(dequeobject, weakreflist), READONLY},
+ {NULL},
+};
+
+PyDoc_STRVAR(deque_doc,
+"deque([iterable[, maxlen]]) --> deque object\n\
+\n\
+A list-like sequence optimized for data accesses near its endpoints.");
+
+static PyType_Slot deque_slots[] = {
+ {Py_tp_dealloc, deque_dealloc},
+ {Py_tp_repr, deque_repr},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)deque_doc},
+ {Py_tp_traverse, deque_traverse},
+ {Py_tp_clear, deque_clear},
+ {Py_tp_richcompare, deque_richcompare},
+ {Py_tp_iter, deque_iter},
+ {Py_tp_getset, deque_getset},
+ {Py_tp_init, deque_init},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, deque_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {Py_tp_methods, deque_methods},
+ {Py_tp_members, deque_members},
+
+ // Sequence protocol
+ {Py_sq_length, deque_len},
+ {Py_sq_concat, deque_concat},
+ {Py_sq_repeat, deque_repeat},
+ {Py_sq_item, deque_item},
+ {Py_sq_ass_item, deque_ass_item},
+ {Py_sq_contains, deque_contains},
+ {Py_sq_inplace_concat, deque_inplace_concat},
+ {Py_sq_inplace_repeat, deque_inplace_repeat},
+ {0, NULL},
+};
+
+static PyType_Spec deque_spec = {
+ .name = "collections.deque",
+ .basicsize = sizeof(dequeobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_SEQUENCE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = deque_slots,
+};
+
+/*********************** Deque Iterator **************************/
+
+typedef struct {
+ PyObject_HEAD
+ block *b;
+ Py_ssize_t index;
+ dequeobject *deque;
+ size_t state; /* state when the iterator is created */
+ Py_ssize_t counter; /* number of items remaining for iteration */
+} dequeiterobject;
+
+static PyObject *
+deque_iter(dequeobject *deque)
+{
+ dequeiterobject *it;
+
+ collections_state *state = find_module_state_by_def(Py_TYPE(deque));
+ it = PyObject_GC_New(dequeiterobject, state->dequeiter_type);
+ if (it == NULL)
+ return NULL;
+ it->b = deque->leftblock;
+ it->index = deque->leftindex;
+ it->deque = (dequeobject*)Py_NewRef(deque);
+ it->state = deque->state;
+ it->counter = Py_SIZE(deque);
+ PyObject_GC_Track(it);
+ return (PyObject *)it;
+}
+
+static int
+dequeiter_traverse(dequeiterobject *dio, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(dio));
+ Py_VISIT(dio->deque);
+ return 0;
+}
+
+static int
+dequeiter_clear(dequeiterobject *dio)
+{
+ Py_CLEAR(dio->deque);
+ return 0;
+}
+
+static void
+dequeiter_dealloc(dequeiterobject *dio)
+{
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyTypeObject *tp = Py_TYPE(dio);
+ PyObject_GC_UnTrack(dio);
+ (void)dequeiter_clear(dio);
+ PyObject_GC_Del(dio);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+dequeiter_next(dequeiterobject *it)
+{
+ PyObject *item;
+
+ if (it->deque->state != it->state) {
+ it->counter = 0;
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return NULL;
+ }
+ if (it->counter == 0)
+ return NULL;
+ assert (!(it->b == it->deque->rightblock &&
+ it->index > it->deque->rightindex));
+
+ item = it->b->data[it->index];
+ it->index++;
+ it->counter--;
+ if (it->index == BLOCKLEN && it->counter > 0) {
+ CHECK_NOT_END(it->b->rightlink);
+ it->b = it->b->rightlink;
+ it->index = 0;
+ }
+ return Py_NewRef(item);
+}
+
+static PyObject *
+dequeiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ Py_ssize_t i, index=0;
+ PyObject *deque;
+ dequeiterobject *it;
+ collections_state *state = get_module_state_by_cls(type);
+ if (!PyArg_ParseTuple(args, "O!|n", state->deque_type, &deque, &index))
+ return NULL;
+ assert(type == state->dequeiter_type);
+
+ it = (dequeiterobject*)deque_iter((dequeobject *)deque);
+ if (!it)
+ return NULL;
+ /* consume items from the queue */
+ for(i=0; i<index; i++) {
+ PyObject *item = dequeiter_next(it);
+ if (item) {
+ Py_DECREF(item);
+ } else {
+ if (it->counter) {
+ Py_DECREF(it);
+ return NULL;
+ } else
+ break;
+ }
+ }
+ return (PyObject*)it;
+}
+
+static PyObject *
+dequeiter_len(dequeiterobject *it, PyObject *Py_UNUSED(ignored))
+{
+ return PyLong_FromSsize_t(it->counter);
+}
+
+PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
+
+static PyObject *
+dequeiter_reduce(dequeiterobject *it, PyObject *Py_UNUSED(ignored))
+{
+ return Py_BuildValue("O(On)", Py_TYPE(it), it->deque, Py_SIZE(it->deque) - it->counter);
+}
+
+static PyMethodDef dequeiter_methods[] = {
+ {"__length_hint__", (PyCFunction)dequeiter_len, METH_NOARGS, length_hint_doc},
+ {"__reduce__", (PyCFunction)dequeiter_reduce, METH_NOARGS, reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot dequeiter_slots[] = {
+ {Py_tp_dealloc, dequeiter_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, dequeiter_traverse},
+ {Py_tp_clear, dequeiter_clear},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, dequeiter_next},
+ {Py_tp_methods, dequeiter_methods},
+ {Py_tp_new, dequeiter_new},
+ {0, NULL},
+};
+
+static PyType_Spec dequeiter_spec = {
+ .name = "collections._deque_iterator",
+ .basicsize = sizeof(dequeiterobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = dequeiter_slots,
+};
+
+/*********************** Deque Reverse Iterator **************************/
+
+static PyObject *
+deque_reviter(dequeobject *deque, PyObject *Py_UNUSED(ignored))
+{
+ dequeiterobject *it;
+ collections_state *state = find_module_state_by_def(Py_TYPE(deque));
+
+ it = PyObject_GC_New(dequeiterobject, state->dequereviter_type);
+ if (it == NULL)
+ return NULL;
+ it->b = deque->rightblock;
+ it->index = deque->rightindex;
+ it->deque = (dequeobject*)Py_NewRef(deque);
+ it->state = deque->state;
+ it->counter = Py_SIZE(deque);
+ PyObject_GC_Track(it);
+ return (PyObject *)it;
+}
+
+static PyObject *
+dequereviter_next(dequeiterobject *it)
+{
+ PyObject *item;
+ if (it->counter == 0)
+ return NULL;
+
+ if (it->deque->state != it->state) {
+ it->counter = 0;
+ PyErr_SetString(PyExc_RuntimeError,
+ "deque mutated during iteration");
+ return NULL;
+ }
+ assert (!(it->b == it->deque->leftblock &&
+ it->index < it->deque->leftindex));
+
+ item = it->b->data[it->index];
+ it->index--;
+ it->counter--;
+ if (it->index < 0 && it->counter > 0) {
+ CHECK_NOT_END(it->b->leftlink);
+ it->b = it->b->leftlink;
+ it->index = BLOCKLEN - 1;
+ }
+ return Py_NewRef(item);
+}
+
+static PyObject *
+dequereviter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ Py_ssize_t i, index=0;
+ PyObject *deque;
+ dequeiterobject *it;
+ collections_state *state = get_module_state_by_cls(type);
+ if (!PyArg_ParseTuple(args, "O!|n", state->deque_type, &deque, &index))
+ return NULL;
+ assert(type == state->dequereviter_type);
+
+ it = (dequeiterobject*)deque_reviter((dequeobject *)deque, NULL);
+ if (!it)
+ return NULL;
+ /* consume items from the queue */
+ for(i=0; i<index; i++) {
+ PyObject *item = dequereviter_next(it);
+ if (item) {
+ Py_DECREF(item);
+ } else {
+ if (it->counter) {
+ Py_DECREF(it);
+ return NULL;
+ } else
+ break;
+ }
+ }
+ return (PyObject*)it;
+}
+
+static PyType_Slot dequereviter_slots[] = {
+ {Py_tp_dealloc, dequeiter_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, dequeiter_traverse},
+ {Py_tp_clear, dequeiter_clear},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, dequereviter_next},
+ {Py_tp_methods, dequeiter_methods},
+ {Py_tp_new, dequereviter_new},
+ {0, NULL},
+};
+
+static PyType_Spec dequereviter_spec = {
+ .name = "collections._deque_reverse_iterator",
+ .basicsize = sizeof(dequeiterobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = dequereviter_slots,
+};
+
+/* defaultdict type *********************************************************/
+
+typedef struct {
+ PyDictObject dict;
+ PyObject *default_factory;
+} defdictobject;
+
+PyDoc_STRVAR(defdict_missing_doc,
+"__missing__(key) # Called by __getitem__ for missing key; pseudo-code:\n\
+ if self.default_factory is None: raise KeyError((key,))\n\
+ self[key] = value = self.default_factory()\n\
+ return value\n\
+");
+
+static PyObject *
+defdict_missing(defdictobject *dd, PyObject *key)
+{
+ PyObject *factory = dd->default_factory;
+ PyObject *value;
+ if (factory == NULL || factory == Py_None) {
+ /* XXX Call dict.__missing__(key) */
+ PyObject *tup;
+ tup = PyTuple_Pack(1, key);
+ if (!tup) return NULL;
+ PyErr_SetObject(PyExc_KeyError, tup);
+ Py_DECREF(tup);
+ return NULL;
+ }
+ value = _PyObject_CallNoArgs(factory);
+ if (value == NULL)
+ return value;
+ if (PyObject_SetItem((PyObject *)dd, key, value) < 0) {
+ Py_DECREF(value);
+ return NULL;
+ }
+ return value;
+}
+
+static inline PyObject*
+new_defdict(defdictobject *dd, PyObject *arg)
+{
+ return PyObject_CallFunctionObjArgs((PyObject*)Py_TYPE(dd),
+ dd->default_factory ? dd->default_factory : Py_None, arg, NULL);
+}
+
+PyDoc_STRVAR(defdict_copy_doc, "D.copy() -> a shallow copy of D.");
+
+static PyObject *
+defdict_copy(defdictobject *dd, PyObject *Py_UNUSED(ignored))
+{
+ /* This calls the object's class. That only works for subclasses
+ whose class constructor has the same signature. Subclasses that
+ define a different constructor signature must override copy().
+ */
+ return new_defdict(dd, (PyObject*)dd);
+}
+
+static PyObject *
+defdict_reduce(defdictobject *dd, PyObject *Py_UNUSED(ignored))
+{
+ /* __reduce__ must return a 5-tuple as follows:
+
+ - factory function
+ - tuple of args for the factory function
+ - additional state (here None)
+ - sequence iterator (here None)
+ - dictionary iterator (yielding successive (key, value) pairs
+
+ This API is used by pickle.py and copy.py.
+
+ For this to be useful with pickle.py, the default_factory
+ must be picklable; e.g., None, a built-in, or a global
+ function in a module or package.
+
+ Both shallow and deep copying are supported, but for deep
+ copying, the default_factory must be deep-copyable; e.g. None,
+ or a built-in (functions are not copyable at this time).
+
+ This only works for subclasses as long as their constructor
+ signature is compatible; the first argument must be the
+ optional default_factory, defaulting to None.
+ */
+ PyObject *args;
+ PyObject *items;
+ PyObject *iter;
+ PyObject *result;
+
+ if (dd->default_factory == NULL || dd->default_factory == Py_None)
+ args = PyTuple_New(0);
+ else
+ args = PyTuple_Pack(1, dd->default_factory);
+ if (args == NULL)
+ return NULL;
+ items = PyObject_CallMethodNoArgs((PyObject *)dd, &_Py_ID(items));
+ if (items == NULL) {
+ Py_DECREF(args);
+ return NULL;
+ }
+ iter = PyObject_GetIter(items);
+ if (iter == NULL) {
+ Py_DECREF(items);
+ Py_DECREF(args);
+ return NULL;
+ }
+ result = PyTuple_Pack(5, Py_TYPE(dd), args,
+ Py_None, Py_None, iter);
+ Py_DECREF(iter);
+ Py_DECREF(items);
+ Py_DECREF(args);
+ return result;
+}
+
+static PyMethodDef defdict_methods[] = {
+ {"__missing__", (PyCFunction)defdict_missing, METH_O,
+ defdict_missing_doc},
+ {"copy", (PyCFunction)defdict_copy, METH_NOARGS,
+ defdict_copy_doc},
+ {"__copy__", (PyCFunction)defdict_copy, METH_NOARGS,
+ defdict_copy_doc},
+ {"__reduce__", (PyCFunction)defdict_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS,
+ PyDoc_STR("See PEP 585")},
+ {NULL}
+};
+
+static PyMemberDef defdict_members[] = {
+ {"default_factory", T_OBJECT,
+ offsetof(defdictobject, default_factory), 0,
+ PyDoc_STR("Factory for default value called by __missing__().")},
+ {NULL}
+};
+
+static void
+defdict_dealloc(defdictobject *dd)
+{
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyTypeObject *tp = Py_TYPE(dd);
+ PyObject_GC_UnTrack(dd);
+ Py_CLEAR(dd->default_factory);
+ PyDict_Type.tp_dealloc((PyObject *)dd);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+defdict_repr(defdictobject *dd)
+{
+ PyObject *baserepr;
+ PyObject *defrepr;
+ PyObject *result;
+ baserepr = PyDict_Type.tp_repr((PyObject *)dd);
+ if (baserepr == NULL)
+ return NULL;
+ if (dd->default_factory == NULL)
+ defrepr = PyUnicode_FromString("None");
+ else
+ {
+ int status = Py_ReprEnter(dd->default_factory);
+ if (status != 0) {
+ if (status < 0) {
+ Py_DECREF(baserepr);
+ return NULL;
+ }
+ defrepr = PyUnicode_FromString("...");
+ }
+ else
+ defrepr = PyObject_Repr(dd->default_factory);
+ Py_ReprLeave(dd->default_factory);
+ }
+ if (defrepr == NULL) {
+ Py_DECREF(baserepr);
+ return NULL;
+ }
+ result = PyUnicode_FromFormat("%s(%U, %U)",
+ _PyType_Name(Py_TYPE(dd)),
+ defrepr, baserepr);
+ Py_DECREF(defrepr);
+ Py_DECREF(baserepr);
+ return result;
+}
+
+static PyObject*
+defdict_or(PyObject* left, PyObject* right)
+{
+ PyObject *self, *other;
+
+ // Find module state
+ PyTypeObject *tp = Py_TYPE(left);
+ PyObject *mod = PyType_GetModuleByDef(tp, &_collectionsmodule);
+ if (mod == NULL) {
+ PyErr_Clear();
+ tp = Py_TYPE(right);
+ mod = PyType_GetModuleByDef(tp, &_collectionsmodule);
+ }
+ assert(mod != NULL);
+ collections_state *state = get_module_state(mod);
+
+ if (PyObject_TypeCheck(left, state->defdict_type)) {
+ self = left;
+ other = right;
+ }
+ else {
+ assert(PyObject_TypeCheck(right, state->defdict_type));
+ self = right;
+ other = left;
+ }
+ if (!PyDict_Check(other)) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ // Like copy(), this calls the object's class.
+ // Override __or__/__ror__ for subclasses with different constructors.
+ PyObject *new = new_defdict((defdictobject*)self, left);
+ if (!new) {
+ return NULL;
+ }
+ if (PyDict_Update(new, right)) {
+ Py_DECREF(new);
+ return NULL;
+ }
+ return new;
+}
+
+static int
+defdict_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(((defdictobject *)self)->default_factory);
+ return PyDict_Type.tp_traverse(self, visit, arg);
+}
+
+static int
+defdict_tp_clear(defdictobject *dd)
+{
+ Py_CLEAR(dd->default_factory);
+ return PyDict_Type.tp_clear((PyObject *)dd);
+}
+
+static int
+defdict_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ defdictobject *dd = (defdictobject *)self;
+ PyObject *olddefault = dd->default_factory;
+ PyObject *newdefault = NULL;
+ PyObject *newargs;
+ int result;
+ if (args == NULL || !PyTuple_Check(args))
+ newargs = PyTuple_New(0);
+ else {
+ Py_ssize_t n = PyTuple_GET_SIZE(args);
+ if (n > 0) {
+ newdefault = PyTuple_GET_ITEM(args, 0);
+ if (!PyCallable_Check(newdefault) && newdefault != Py_None) {
+ PyErr_SetString(PyExc_TypeError,
+ "first argument must be callable or None");
+ return -1;
+ }
+ }
+ newargs = PySequence_GetSlice(args, 1, n);
+ }
+ if (newargs == NULL)
+ return -1;
+ dd->default_factory = Py_XNewRef(newdefault);
+ result = PyDict_Type.tp_init(self, newargs, kwds);
+ Py_DECREF(newargs);
+ Py_XDECREF(olddefault);
+ return result;
+}
+
+PyDoc_STRVAR(defdict_doc,
+"defaultdict(default_factory=None, /, [...]) --> dict with default factory\n\
+\n\
+The default factory is called without arguments to produce\n\
+a new value when a key is not present, in __getitem__ only.\n\
+A defaultdict compares equal to a dict with the same items.\n\
+All remaining arguments are treated the same as if they were\n\
+passed to the dict constructor, including keyword arguments.\n\
+");
+
+/* See comment in xxsubtype.c */
+#define DEFERRED_ADDRESS(ADDR) 0
+
+static PyType_Slot defdict_slots[] = {
+ {Py_tp_dealloc, defdict_dealloc},
+ {Py_tp_repr, defdict_repr},
+ {Py_nb_or, defdict_or},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)defdict_doc},
+ {Py_tp_traverse, defdict_traverse},
+ {Py_tp_clear, defdict_tp_clear},
+ {Py_tp_methods, defdict_methods},
+ {Py_tp_members, defdict_members},
+ {Py_tp_init, defdict_init},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec defdict_spec = {
+ .name = "collections.defaultdict",
+ .basicsize = sizeof(defdictobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = defdict_slots,
+};
+
+/* helper function for Counter *********************************************/
+
+/*[clinic input]
+_collections._count_elements
+
+ mapping: object
+ iterable: object
+ /
+
+Count elements in the iterable, updating the mapping
+[clinic start generated code]*/
+
+static PyObject *
+_collections__count_elements_impl(PyObject *module, PyObject *mapping,
+ PyObject *iterable)
+/*[clinic end generated code: output=7e0c1789636b3d8f input=e79fad04534a0b45]*/
+{
+ PyObject *it, *oldval;
+ PyObject *newval = NULL;
+ PyObject *key = NULL;
+ PyObject *bound_get = NULL;
+ PyObject *mapping_get;
+ PyObject *dict_get;
+ PyObject *mapping_setitem;
+ PyObject *dict_setitem;
+ PyObject *one = _PyLong_GetOne(); // borrowed reference
+
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ /* Only take the fast path when get() and __setitem__()
+ * have not been overridden.
+ */
+ mapping_get = _PyType_Lookup(Py_TYPE(mapping), &_Py_ID(get));
+ dict_get = _PyType_Lookup(&PyDict_Type, &_Py_ID(get));
+ mapping_setitem = _PyType_Lookup(Py_TYPE(mapping), &_Py_ID(__setitem__));
+ dict_setitem = _PyType_Lookup(&PyDict_Type, &_Py_ID(__setitem__));
+
+ if (mapping_get != NULL && mapping_get == dict_get &&
+ mapping_setitem != NULL && mapping_setitem == dict_setitem &&
+ PyDict_Check(mapping))
+ {
+ while (1) {
+ /* Fast path advantages:
+ 1. Eliminate double hashing
+ (by re-using the same hash for both the get and set)
+ 2. Avoid argument overhead of PyObject_CallFunctionObjArgs
+ (argument tuple creation and parsing)
+ 3. Avoid indirection through a bound method object
+ (creates another argument tuple)
+ 4. Avoid initial increment from zero
+ (reuse an existing one-object instead)
+ */
+ Py_hash_t hash;
+
+ key = PyIter_Next(it);
+ if (key == NULL)
+ break;
+
+ if (!PyUnicode_CheckExact(key) ||
+ (hash = _PyASCIIObject_CAST(key)->hash) == -1)
+ {
+ hash = PyObject_Hash(key);
+ if (hash == -1)
+ goto done;
+ }
+
+ oldval = _PyDict_GetItem_KnownHash(mapping, key, hash);
+ if (oldval == NULL) {
+ if (PyErr_Occurred())
+ goto done;
+ if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) < 0)
+ goto done;
+ } else {
+ newval = PyNumber_Add(oldval, one);
+ if (newval == NULL)
+ goto done;
+ if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) < 0)
+ goto done;
+ Py_CLEAR(newval);
+ }
+ Py_DECREF(key);
+ }
+ }
+ else {
+ bound_get = PyObject_GetAttr(mapping, &_Py_ID(get));
+ if (bound_get == NULL)
+ goto done;
+
+ PyObject *zero = _PyLong_GetZero(); // borrowed reference
+ while (1) {
+ key = PyIter_Next(it);
+ if (key == NULL)
+ break;
+ oldval = PyObject_CallFunctionObjArgs(bound_get, key, zero, NULL);
+ if (oldval == NULL)
+ break;
+ newval = PyNumber_Add(oldval, one);
+ Py_DECREF(oldval);
+ if (newval == NULL)
+ break;
+ if (PyObject_SetItem(mapping, key, newval) < 0)
+ break;
+ Py_CLEAR(newval);
+ Py_DECREF(key);
+ }
+ }
+
+done:
+ Py_DECREF(it);
+ Py_XDECREF(key);
+ Py_XDECREF(newval);
+ Py_XDECREF(bound_get);
+ if (PyErr_Occurred())
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/* Helper function for namedtuple() ************************************/
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t index;
+ PyObject* doc;
+} _tuplegetterobject;
+
+/*[clinic input]
+@classmethod
+_tuplegetter.__new__ as tuplegetter_new
+
+ index: Py_ssize_t
+ doc: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+tuplegetter_new_impl(PyTypeObject *type, Py_ssize_t index, PyObject *doc)
+/*[clinic end generated code: output=014be444ad80263f input=87c576a5bdbc0bbb]*/
+{
+ _tuplegetterobject* self;
+ self = (_tuplegetterobject *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+ self->index = index;
+ self->doc = Py_NewRef(doc);
+ return (PyObject *)self;
+}
+
+static PyObject *
+tuplegetter_descr_get(PyObject *self, PyObject *obj, PyObject *type)
+{
+ Py_ssize_t index = ((_tuplegetterobject*)self)->index;
+ PyObject *result;
+
+ if (obj == NULL) {
+ return Py_NewRef(self);
+ }
+ if (!PyTuple_Check(obj)) {
+ if (obj == Py_None) {
+ return Py_NewRef(self);
+ }
+ PyErr_Format(PyExc_TypeError,
+ "descriptor for index '%zd' for tuple subclasses "
+ "doesn't apply to '%s' object",
+ index,
+ Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+
+ if (!valid_index(index, PyTuple_GET_SIZE(obj))) {
+ PyErr_SetString(PyExc_IndexError, "tuple index out of range");
+ return NULL;
+ }
+
+ result = PyTuple_GET_ITEM(obj, index);
+ return Py_NewRef(result);
+}
+
+static int
+tuplegetter_descr_set(PyObject *self, PyObject *obj, PyObject *value)
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
+ } else {
+ PyErr_SetString(PyExc_AttributeError, "can't set attribute");
+ }
+ return -1;
+}
+
+static int
+tuplegetter_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ _tuplegetterobject *tuplegetter = (_tuplegetterobject *)self;
+ Py_VISIT(Py_TYPE(tuplegetter));
+ Py_VISIT(tuplegetter->doc);
+ return 0;
+}
+
+static int
+tuplegetter_clear(PyObject *self)
+{
+ _tuplegetterobject *tuplegetter = (_tuplegetterobject *)self;
+ Py_CLEAR(tuplegetter->doc);
+ return 0;
+}
+
+static void
+tuplegetter_dealloc(_tuplegetterobject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tuplegetter_clear((PyObject*)self);
+ tp->tp_free((PyObject*)self);
+ Py_DECREF(tp);
+}
+
+static PyObject*
+tuplegetter_reduce(_tuplegetterobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return Py_BuildValue("(O(nO))", (PyObject*) Py_TYPE(self), self->index, self->doc);
+}
+
+static PyObject*
+tuplegetter_repr(_tuplegetterobject *self)
+{
+ return PyUnicode_FromFormat("%s(%zd, %R)",
+ _PyType_Name(Py_TYPE(self)),
+ self->index, self->doc);
+}
+
+
+static PyMemberDef tuplegetter_members[] = {
+ {"__doc__", T_OBJECT, offsetof(_tuplegetterobject, doc), 0},
+ {0}
+};
+
+static PyMethodDef tuplegetter_methods[] = {
+ {"__reduce__", (PyCFunction)tuplegetter_reduce, METH_NOARGS, NULL},
+ {NULL},
+};
+
+static PyType_Slot tuplegetter_slots[] = {
+ {Py_tp_dealloc, tuplegetter_dealloc},
+ {Py_tp_repr, tuplegetter_repr},
+ {Py_tp_traverse, tuplegetter_traverse},
+ {Py_tp_clear, tuplegetter_clear},
+ {Py_tp_methods, tuplegetter_methods},
+ {Py_tp_members, tuplegetter_members},
+ {Py_tp_descr_get, tuplegetter_descr_get},
+ {Py_tp_descr_set, tuplegetter_descr_set},
+ {Py_tp_new, tuplegetter_new},
+ {0, NULL},
+};
+
+static PyType_Spec tuplegetter_spec = {
+ .name = "collections._tuplegetter",
+ .basicsize = sizeof(_tuplegetterobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = tuplegetter_slots,
+};
+
+
+/* module level code ********************************************************/
+
+static int
+collections_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ collections_state *state = get_module_state(mod);
+ Py_VISIT(state->deque_type);
+ Py_VISIT(state->defdict_type);
+ Py_VISIT(state->dequeiter_type);
+ Py_VISIT(state->dequereviter_type);
+ Py_VISIT(state->tuplegetter_type);
+ return 0;
+}
+
+static int
+collections_clear(PyObject *mod)
+{
+ collections_state *state = get_module_state(mod);
+ Py_CLEAR(state->deque_type);
+ Py_CLEAR(state->defdict_type);
+ Py_CLEAR(state->dequeiter_type);
+ Py_CLEAR(state->dequereviter_type);
+ Py_CLEAR(state->tuplegetter_type);
+ return 0;
+}
+
+static void
+collections_free(void *module)
+{
+ collections_clear((PyObject *)module);
+}
+
+PyDoc_STRVAR(collections_doc,
+"High performance data structures.\n\
+- deque: ordered collection accessible from endpoints only\n\
+- defaultdict: dict subclass with a default value factory\n\
+");
+
+static struct PyMethodDef collections_methods[] = {
+ _COLLECTIONS__COUNT_ELEMENTS_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+#define ADD_TYPE(MOD, SPEC, TYPE, BASE) do { \
+ TYPE = (PyTypeObject *)PyType_FromMetaclass(NULL, MOD, SPEC, \
+ (PyObject *)BASE); \
+ if (TYPE == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddType(MOD, TYPE) < 0) { \
+ return -1; \
+ } \
+} while (0)
+
+static int
+collections_exec(PyObject *module) {
+ collections_state *state = get_module_state(module);
+ ADD_TYPE(module, &deque_spec, state->deque_type, NULL);
+ ADD_TYPE(module, &defdict_spec, state->defdict_type, &PyDict_Type);
+ ADD_TYPE(module, &dequeiter_spec, state->dequeiter_type, NULL);
+ ADD_TYPE(module, &dequereviter_spec, state->dequereviter_type, NULL);
+ ADD_TYPE(module, &tuplegetter_spec, state->tuplegetter_type, NULL);
+
+ if (PyModule_AddType(module, &PyODict_Type) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+#undef ADD_TYPE
+
+static struct PyModuleDef_Slot collections_slots[] = {
+ {Py_mod_exec, collections_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _collectionsmodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_collections",
+ .m_doc = collections_doc,
+ .m_size = sizeof(collections_state),
+ .m_methods = collections_methods,
+ .m_slots = collections_slots,
+ .m_traverse = collections_traverse,
+ .m_clear = collections_clear,
+ .m_free = collections_free,
+};
+
+PyMODINIT_FUNC
+PyInit__collections(void)
+{
+ return PyModuleDef_Init(&_collectionsmodule);
+}
diff --git a/contrib/tools/python3/Modules/_contextvarsmodule.c b/contrib/tools/python3/Modules/_contextvarsmodule.c
new file mode 100644
index 00000000000..f621c1de6d4
--- /dev/null
+++ b/contrib/tools/python3/Modules/_contextvarsmodule.c
@@ -0,0 +1,67 @@
+#include "Python.h"
+
+#include "clinic/_contextvarsmodule.c.h"
+
+/*[clinic input]
+module _contextvars
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=a0955718c8b8cea6]*/
+
+
+/*[clinic input]
+_contextvars.copy_context
+[clinic start generated code]*/
+
+static PyObject *
+_contextvars_copy_context_impl(PyObject *module)
+/*[clinic end generated code: output=1fcd5da7225c4fa9 input=89bb9ae485888440]*/
+{
+ return PyContext_CopyCurrent();
+}
+
+
+PyDoc_STRVAR(module_doc, "Context Variables");
+
+static PyMethodDef _contextvars_methods[] = {
+ _CONTEXTVARS_COPY_CONTEXT_METHODDEF
+ {NULL, NULL}
+};
+
+static int
+_contextvars_exec(PyObject *m)
+{
+ if (PyModule_AddType(m, &PyContext_Type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(m, &PyContextVar_Type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(m, &PyContextToken_Type) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static struct PyModuleDef_Slot _contextvars_slots[] = {
+ {Py_mod_exec, _contextvars_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _contextvarsmodule = {
+ PyModuleDef_HEAD_INIT, /* m_base */
+ "_contextvars", /* m_name */
+ module_doc, /* m_doc */
+ 0, /* m_size */
+ _contextvars_methods, /* m_methods */
+ _contextvars_slots, /* m_slots */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
+};
+
+PyMODINIT_FUNC
+PyInit__contextvars(void)
+{
+ return PyModuleDef_Init(&_contextvarsmodule);
+}
diff --git a/contrib/tools/python3/Modules/_cryptmodule.c b/contrib/tools/python3/Modules/_cryptmodule.c
new file mode 100644
index 00000000000..75035084c9c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_cryptmodule.c
@@ -0,0 +1,81 @@
+/* cryptmodule.c - by Steve Majewski
+ */
+
+#include "Python.h"
+
+#include <sys/types.h>
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
+
+/* Module crypt */
+
+/*[clinic input]
+module crypt
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c6252cf4f2f2ae81]*/
+
+#include "clinic/_cryptmodule.c.h"
+
+/*[clinic input]
+crypt.crypt
+
+ word: str
+ salt: str
+ /
+
+Hash a *word* with the given *salt* and return the hashed password.
+
+*word* will usually be a user's password. *salt* (either a random 2 or 16
+character string, possibly prefixed with $digit$ to indicate the method)
+will be used to perturb the encryption algorithm and produce distinct
+results for a given *word*.
+
+[clinic start generated code]*/
+
+static PyObject *
+crypt_crypt_impl(PyObject *module, const char *word, const char *salt)
+/*[clinic end generated code: output=0512284a03d2803c input=0e8edec9c364352b]*/
+{
+ char *crypt_result;
+#ifdef HAVE_CRYPT_R
+ struct crypt_data data;
+ memset(&data, 0, sizeof(data));
+ crypt_result = crypt_r(word, salt, &data);
+#else
+ crypt_result = crypt(word, salt);
+#endif
+ if (crypt_result == NULL) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ return Py_BuildValue("s", crypt_result);
+}
+
+
+static PyMethodDef crypt_methods[] = {
+ CRYPT_CRYPT_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyModuleDef_Slot _crypt_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef cryptmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_crypt",
+ NULL,
+ 0,
+ crypt_methods,
+ _crypt_slots,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__crypt(void)
+{
+ return PyModuleDef_Init(&cryptmodule);
+}
diff --git a/contrib/tools/python3/Modules/_csv.c b/contrib/tools/python3/Modules/_csv.c
new file mode 100644
index 00000000000..91cb63628a1
--- /dev/null
+++ b/contrib/tools/python3/Modules/_csv.c
@@ -0,0 +1,1822 @@
+/* csv module */
+
+/*
+
+This module provides the low-level underpinnings of a CSV reading/writing
+module. Users should not use this module directly, but import the csv.py
+module instead.
+
+*/
+
+#define MODULE_VERSION "1.0"
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+#include <stdbool.h>
+
+/*[clinic input]
+module _csv
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=385118b71aa43706]*/
+
+#include "clinic/_csv.c.h"
+#define NOT_SET ((Py_UCS4)-1)
+#define EOL ((Py_UCS4)-2)
+
+
+typedef struct {
+ PyObject *error_obj; /* CSV exception */
+ PyObject *dialects; /* Dialect registry */
+ PyTypeObject *dialect_type;
+ PyTypeObject *reader_type;
+ PyTypeObject *writer_type;
+ long field_limit; /* max parsed field size */
+ PyObject *str_write;
+} _csvstate;
+
+static struct PyModuleDef _csvmodule;
+
+static inline _csvstate*
+get_csv_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_csvstate *)state;
+}
+
+static int
+_csv_clear(PyObject *module)
+{
+ _csvstate *module_state = PyModule_GetState(module);
+ Py_CLEAR(module_state->error_obj);
+ Py_CLEAR(module_state->dialects);
+ Py_CLEAR(module_state->dialect_type);
+ Py_CLEAR(module_state->reader_type);
+ Py_CLEAR(module_state->writer_type);
+ Py_CLEAR(module_state->str_write);
+ return 0;
+}
+
+static int
+_csv_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _csvstate *module_state = PyModule_GetState(module);
+ Py_VISIT(module_state->error_obj);
+ Py_VISIT(module_state->dialects);
+ Py_VISIT(module_state->dialect_type);
+ Py_VISIT(module_state->reader_type);
+ Py_VISIT(module_state->writer_type);
+ return 0;
+}
+
+static void
+_csv_free(void *module)
+{
+ _csv_clear((PyObject *)module);
+}
+
+typedef enum {
+ START_RECORD, START_FIELD, ESCAPED_CHAR, IN_FIELD,
+ IN_QUOTED_FIELD, ESCAPE_IN_QUOTED_FIELD, QUOTE_IN_QUOTED_FIELD,
+ EAT_CRNL,AFTER_ESCAPED_CRNL
+} ParserState;
+
+typedef enum {
+ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE,
+ QUOTE_STRINGS, QUOTE_NOTNULL
+} QuoteStyle;
+
+typedef struct {
+ QuoteStyle style;
+ const char *name;
+} StyleDesc;
+
+static const StyleDesc quote_styles[] = {
+ { QUOTE_MINIMAL, "QUOTE_MINIMAL" },
+ { QUOTE_ALL, "QUOTE_ALL" },
+ { QUOTE_NONNUMERIC, "QUOTE_NONNUMERIC" },
+ { QUOTE_NONE, "QUOTE_NONE" },
+ { QUOTE_STRINGS, "QUOTE_STRINGS" },
+ { QUOTE_NOTNULL, "QUOTE_NOTNULL" },
+ { 0 }
+};
+
+typedef struct {
+ PyObject_HEAD
+
+ char doublequote; /* is " represented by ""? */
+ char skipinitialspace; /* ignore spaces following delimiter? */
+ char strict; /* raise exception on bad CSV */
+ int quoting; /* style of quoting to write */
+ Py_UCS4 delimiter; /* field separator */
+ Py_UCS4 quotechar; /* quote character */
+ Py_UCS4 escapechar; /* escape character */
+ PyObject *lineterminator; /* string to write between records */
+
+} DialectObj;
+
+typedef struct {
+ PyObject_HEAD
+
+ PyObject *input_iter; /* iterate over this for input lines */
+
+ DialectObj *dialect; /* parsing dialect */
+
+ PyObject *fields; /* field list for current record */
+ ParserState state; /* current CSV parse state */
+ Py_UCS4 *field; /* temporary buffer */
+ Py_ssize_t field_size; /* size of allocated buffer */
+ Py_ssize_t field_len; /* length of current field */
+ int numeric_field; /* treat field as numeric */
+ unsigned long line_num; /* Source-file line number */
+} ReaderObj;
+
+typedef struct {
+ PyObject_HEAD
+
+ PyObject *write; /* write output lines to this file */
+
+ DialectObj *dialect; /* parsing dialect */
+
+ Py_UCS4 *rec; /* buffer for parser.join */
+ Py_ssize_t rec_size; /* size of allocated record */
+ Py_ssize_t rec_len; /* length of record */
+ int num_fields; /* number of fields in record */
+
+ PyObject *error_obj; /* cached error object */
+} WriterObj;
+
+/*
+ * DIALECT class
+ */
+
+static PyObject *
+get_dialect_from_registry(PyObject *name_obj, _csvstate *module_state)
+{
+ PyObject *dialect_obj;
+
+ dialect_obj = PyDict_GetItemWithError(module_state->dialects, name_obj);
+ if (dialect_obj == NULL) {
+ if (!PyErr_Occurred())
+ PyErr_Format(module_state->error_obj, "unknown dialect");
+ }
+ else
+ Py_INCREF(dialect_obj);
+
+ return dialect_obj;
+}
+
+static PyObject *
+get_char_or_None(Py_UCS4 c)
+{
+ if (c == NOT_SET) {
+ Py_RETURN_NONE;
+ }
+ else
+ return PyUnicode_FromOrdinal(c);
+}
+
+static PyObject *
+Dialect_get_lineterminator(DialectObj *self, void *Py_UNUSED(ignored))
+{
+ return Py_XNewRef(self->lineterminator);
+}
+
+static PyObject *
+Dialect_get_delimiter(DialectObj *self, void *Py_UNUSED(ignored))
+{
+ return get_char_or_None(self->delimiter);
+}
+
+static PyObject *
+Dialect_get_escapechar(DialectObj *self, void *Py_UNUSED(ignored))
+{
+ return get_char_or_None(self->escapechar);
+}
+
+static PyObject *
+Dialect_get_quotechar(DialectObj *self, void *Py_UNUSED(ignored))
+{
+ return get_char_or_None(self->quotechar);
+}
+
+static PyObject *
+Dialect_get_quoting(DialectObj *self, void *Py_UNUSED(ignored))
+{
+ return PyLong_FromLong(self->quoting);
+}
+
+static int
+_set_bool(const char *name, char *target, PyObject *src, bool dflt)
+{
+ if (src == NULL)
+ *target = dflt;
+ else {
+ int b = PyObject_IsTrue(src);
+ if (b < 0)
+ return -1;
+ *target = (char)b;
+ }
+ return 0;
+}
+
+static int
+_set_int(const char *name, int *target, PyObject *src, int dflt)
+{
+ if (src == NULL)
+ *target = dflt;
+ else {
+ int value;
+ if (!PyLong_CheckExact(src)) {
+ PyErr_Format(PyExc_TypeError,
+ "\"%s\" must be an integer", name);
+ return -1;
+ }
+ value = _PyLong_AsInt(src);
+ if (value == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *target = value;
+ }
+ return 0;
+}
+
+static int
+_set_char_or_none(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt)
+{
+ if (src == NULL) {
+ *target = dflt;
+ }
+ else {
+ *target = NOT_SET;
+ if (src != Py_None) {
+ if (!PyUnicode_Check(src)) {
+ PyErr_Format(PyExc_TypeError,
+ "\"%s\" must be string or None, not %.200s", name,
+ Py_TYPE(src)->tp_name);
+ return -1;
+ }
+ Py_ssize_t len = PyUnicode_GetLength(src);
+ if (len < 0) {
+ return -1;
+ }
+ if (len != 1) {
+ PyErr_Format(PyExc_TypeError,
+ "\"%s\" must be a 1-character string",
+ name);
+ return -1;
+ }
+ /* PyUnicode_READY() is called in PyUnicode_GetLength() */
+ *target = PyUnicode_READ_CHAR(src, 0);
+ }
+ }
+ return 0;
+}
+
+static int
+_set_char(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt)
+{
+ if (src == NULL) {
+ *target = dflt;
+ }
+ else {
+ if (!PyUnicode_Check(src)) {
+ PyErr_Format(PyExc_TypeError,
+ "\"%s\" must be string, not %.200s", name,
+ Py_TYPE(src)->tp_name);
+ return -1;
+ }
+ Py_ssize_t len = PyUnicode_GetLength(src);
+ if (len < 0) {
+ return -1;
+ }
+ if (len != 1) {
+ PyErr_Format(PyExc_TypeError,
+ "\"%s\" must be a 1-character string",
+ name);
+ return -1;
+ }
+ /* PyUnicode_READY() is called in PyUnicode_GetLength() */
+ *target = PyUnicode_READ_CHAR(src, 0);
+ }
+ return 0;
+}
+
+static int
+_set_str(const char *name, PyObject **target, PyObject *src, const char *dflt)
+{
+ if (src == NULL)
+ *target = PyUnicode_DecodeASCII(dflt, strlen(dflt), NULL);
+ else {
+ if (src == Py_None)
+ *target = NULL;
+ else if (!PyUnicode_Check(src)) {
+ PyErr_Format(PyExc_TypeError,
+ "\"%s\" must be a string", name);
+ return -1;
+ }
+ else {
+ if (PyUnicode_READY(src) == -1)
+ return -1;
+ Py_XSETREF(*target, Py_NewRef(src));
+ }
+ }
+ return 0;
+}
+
+static int
+dialect_check_quoting(int quoting)
+{
+ const StyleDesc *qs;
+
+ for (qs = quote_styles; qs->name; qs++) {
+ if ((int)qs->style == quoting)
+ return 0;
+ }
+ PyErr_Format(PyExc_TypeError, "bad \"quoting\" value");
+ return -1;
+}
+
+#define D_OFF(x) offsetof(DialectObj, x)
+
+static struct PyMemberDef Dialect_memberlist[] = {
+ { "skipinitialspace", T_BOOL, D_OFF(skipinitialspace), READONLY },
+ { "doublequote", T_BOOL, D_OFF(doublequote), READONLY },
+ { "strict", T_BOOL, D_OFF(strict), READONLY },
+ { NULL }
+};
+
+static PyGetSetDef Dialect_getsetlist[] = {
+ { "delimiter", (getter)Dialect_get_delimiter},
+ { "escapechar", (getter)Dialect_get_escapechar},
+ { "lineterminator", (getter)Dialect_get_lineterminator},
+ { "quotechar", (getter)Dialect_get_quotechar},
+ { "quoting", (getter)Dialect_get_quoting},
+ {NULL},
+};
+
+static void
+Dialect_dealloc(DialectObj *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tp->tp_clear((PyObject *)self);
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static char *dialect_kws[] = {
+ "dialect",
+ "delimiter",
+ "doublequote",
+ "escapechar",
+ "lineterminator",
+ "quotechar",
+ "quoting",
+ "skipinitialspace",
+ "strict",
+ NULL
+};
+
+static _csvstate *
+_csv_state_from_type(PyTypeObject *type, const char *name)
+{
+ PyObject *module = PyType_GetModuleByDef(type, &_csvmodule);
+ if (module == NULL) {
+ return NULL;
+ }
+ _csvstate *module_state = PyModule_GetState(module);
+ if (module_state == NULL) {
+ PyErr_Format(PyExc_SystemError,
+ "%s: No _csv module state found", name);
+ return NULL;
+ }
+ return module_state;
+}
+
+static PyObject *
+dialect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ DialectObj *self;
+ PyObject *ret = NULL;
+ PyObject *dialect = NULL;
+ PyObject *delimiter = NULL;
+ PyObject *doublequote = NULL;
+ PyObject *escapechar = NULL;
+ PyObject *lineterminator = NULL;
+ PyObject *quotechar = NULL;
+ PyObject *quoting = NULL;
+ PyObject *skipinitialspace = NULL;
+ PyObject *strict = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "|OOOOOOOOO", dialect_kws,
+ &dialect,
+ &delimiter,
+ &doublequote,
+ &escapechar,
+ &lineterminator,
+ &quotechar,
+ &quoting,
+ &skipinitialspace,
+ &strict))
+ return NULL;
+
+ _csvstate *module_state = _csv_state_from_type(type, "dialect_new");
+ if (module_state == NULL) {
+ return NULL;
+ }
+
+ if (dialect != NULL) {
+ if (PyUnicode_Check(dialect)) {
+ dialect = get_dialect_from_registry(dialect, module_state);
+ if (dialect == NULL)
+ return NULL;
+ }
+ else
+ Py_INCREF(dialect);
+ /* Can we reuse this instance? */
+ if (PyObject_TypeCheck(dialect, module_state->dialect_type) &&
+ delimiter == NULL &&
+ doublequote == NULL &&
+ escapechar == NULL &&
+ lineterminator == NULL &&
+ quotechar == NULL &&
+ quoting == NULL &&
+ skipinitialspace == NULL &&
+ strict == NULL)
+ return dialect;
+ }
+
+ self = (DialectObj *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ Py_CLEAR(dialect);
+ return NULL;
+ }
+ self->lineterminator = NULL;
+
+ Py_XINCREF(delimiter);
+ Py_XINCREF(doublequote);
+ Py_XINCREF(escapechar);
+ Py_XINCREF(lineterminator);
+ Py_XINCREF(quotechar);
+ Py_XINCREF(quoting);
+ Py_XINCREF(skipinitialspace);
+ Py_XINCREF(strict);
+ if (dialect != NULL) {
+#define DIALECT_GETATTR(v, n) \
+ do { \
+ if (v == NULL) { \
+ v = PyObject_GetAttrString(dialect, n); \
+ if (v == NULL) \
+ PyErr_Clear(); \
+ } \
+ } while (0)
+ DIALECT_GETATTR(delimiter, "delimiter");
+ DIALECT_GETATTR(doublequote, "doublequote");
+ DIALECT_GETATTR(escapechar, "escapechar");
+ DIALECT_GETATTR(lineterminator, "lineterminator");
+ DIALECT_GETATTR(quotechar, "quotechar");
+ DIALECT_GETATTR(quoting, "quoting");
+ DIALECT_GETATTR(skipinitialspace, "skipinitialspace");
+ DIALECT_GETATTR(strict, "strict");
+ }
+
+ /* check types and convert to C values */
+#define DIASET(meth, name, target, src, dflt) \
+ if (meth(name, target, src, dflt)) \
+ goto err
+ DIASET(_set_char, "delimiter", &self->delimiter, delimiter, ',');
+ DIASET(_set_bool, "doublequote", &self->doublequote, doublequote, true);
+ DIASET(_set_char_or_none, "escapechar", &self->escapechar, escapechar, NOT_SET);
+ DIASET(_set_str, "lineterminator", &self->lineterminator, lineterminator, "\r\n");
+ DIASET(_set_char_or_none, "quotechar", &self->quotechar, quotechar, '"');
+ DIASET(_set_int, "quoting", &self->quoting, quoting, QUOTE_MINIMAL);
+ DIASET(_set_bool, "skipinitialspace", &self->skipinitialspace, skipinitialspace, false);
+ DIASET(_set_bool, "strict", &self->strict, strict, false);
+
+ /* validate options */
+ if (dialect_check_quoting(self->quoting))
+ goto err;
+ if (self->delimiter == NOT_SET) {
+ PyErr_SetString(PyExc_TypeError,
+ "\"delimiter\" must be a 1-character string");
+ goto err;
+ }
+ if (quotechar == Py_None && quoting == NULL)
+ self->quoting = QUOTE_NONE;
+ if (self->quoting != QUOTE_NONE && self->quotechar == NOT_SET) {
+ PyErr_SetString(PyExc_TypeError,
+ "quotechar must be set if quoting enabled");
+ goto err;
+ }
+ if (self->lineterminator == NULL) {
+ PyErr_SetString(PyExc_TypeError, "lineterminator must be set");
+ goto err;
+ }
+
+ ret = Py_NewRef(self);
+err:
+ Py_CLEAR(self);
+ Py_CLEAR(dialect);
+ Py_CLEAR(delimiter);
+ Py_CLEAR(doublequote);
+ Py_CLEAR(escapechar);
+ Py_CLEAR(lineterminator);
+ Py_CLEAR(quotechar);
+ Py_CLEAR(quoting);
+ Py_CLEAR(skipinitialspace);
+ Py_CLEAR(strict);
+ return ret;
+}
+
+/* Since dialect is now a heap type, it inherits pickling method for
+ * protocol 0 and 1 from object, therefore it needs to be overridden */
+
+PyDoc_STRVAR(dialect_reduce_doc, "raises an exception to avoid pickling");
+
+static PyObject *
+Dialect_reduce(PyObject *self, PyObject *args) {
+ PyErr_Format(PyExc_TypeError,
+ "cannot pickle '%.100s' instances", _PyType_Name(Py_TYPE(self)));
+ return NULL;
+}
+
+static struct PyMethodDef dialect_methods[] = {
+ {"__reduce__", Dialect_reduce, METH_VARARGS, dialect_reduce_doc},
+ {"__reduce_ex__", Dialect_reduce, METH_VARARGS, dialect_reduce_doc},
+ {NULL, NULL}
+};
+
+PyDoc_STRVAR(Dialect_Type_doc,
+"CSV dialect\n"
+"\n"
+"The Dialect type records CSV parsing and generation options.\n");
+
+static int
+Dialect_clear(DialectObj *self)
+{
+ Py_CLEAR(self->lineterminator);
+ return 0;
+}
+
+static int
+Dialect_traverse(DialectObj *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->lineterminator);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static PyType_Slot Dialect_Type_slots[] = {
+ {Py_tp_doc, (char*)Dialect_Type_doc},
+ {Py_tp_members, Dialect_memberlist},
+ {Py_tp_getset, Dialect_getsetlist},
+ {Py_tp_new, dialect_new},
+ {Py_tp_methods, dialect_methods},
+ {Py_tp_dealloc, Dialect_dealloc},
+ {Py_tp_clear, Dialect_clear},
+ {Py_tp_traverse, Dialect_traverse},
+ {0, NULL}
+};
+
+PyType_Spec Dialect_Type_spec = {
+ .name = "_csv.Dialect",
+ .basicsize = sizeof(DialectObj),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = Dialect_Type_slots,
+};
+
+
+/*
+ * Return an instance of the dialect type, given a Python instance or kwarg
+ * description of the dialect
+ */
+static PyObject *
+_call_dialect(_csvstate *module_state, PyObject *dialect_inst, PyObject *kwargs)
+{
+ PyObject *type = (PyObject *)module_state->dialect_type;
+ if (dialect_inst) {
+ return PyObject_VectorcallDict(type, &dialect_inst, 1, kwargs);
+ }
+ else {
+ return PyObject_VectorcallDict(type, NULL, 0, kwargs);
+ }
+}
+
+/*
+ * READER
+ */
+static int
+parse_save_field(ReaderObj *self)
+{
+ PyObject *field;
+
+ field = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND,
+ (void *) self->field, self->field_len);
+ if (field == NULL)
+ return -1;
+ self->field_len = 0;
+ if (self->numeric_field) {
+ PyObject *tmp;
+
+ self->numeric_field = 0;
+ tmp = PyNumber_Float(field);
+ Py_DECREF(field);
+ if (tmp == NULL)
+ return -1;
+ field = tmp;
+ }
+ if (PyList_Append(self->fields, field) < 0) {
+ Py_DECREF(field);
+ return -1;
+ }
+ Py_DECREF(field);
+ return 0;
+}
+
+static int
+parse_grow_buff(ReaderObj *self)
+{
+ assert((size_t)self->field_size <= PY_SSIZE_T_MAX / sizeof(Py_UCS4));
+
+ Py_ssize_t field_size_new = self->field_size ? 2 * self->field_size : 4096;
+ Py_UCS4 *field_new = self->field;
+ PyMem_Resize(field_new, Py_UCS4, field_size_new);
+ if (field_new == NULL) {
+ PyErr_NoMemory();
+ return 0;
+ }
+ self->field = field_new;
+ self->field_size = field_size_new;
+ return 1;
+}
+
+static int
+parse_add_char(ReaderObj *self, _csvstate *module_state, Py_UCS4 c)
+{
+ if (self->field_len >= module_state->field_limit) {
+ PyErr_Format(module_state->error_obj,
+ "field larger than field limit (%ld)",
+ module_state->field_limit);
+ return -1;
+ }
+ if (self->field_len == self->field_size && !parse_grow_buff(self))
+ return -1;
+ self->field[self->field_len++] = c;
+ return 0;
+}
+
+static int
+parse_process_char(ReaderObj *self, _csvstate *module_state, Py_UCS4 c)
+{
+ DialectObj *dialect = self->dialect;
+
+ switch (self->state) {
+ case START_RECORD:
+ /* start of record */
+ if (c == EOL)
+ /* empty line - return [] */
+ break;
+ else if (c == '\n' || c == '\r') {
+ self->state = EAT_CRNL;
+ break;
+ }
+ /* normal character - handle as START_FIELD */
+ self->state = START_FIELD;
+ /* fallthru */
+ case START_FIELD:
+ /* expecting field */
+ if (c == '\n' || c == '\r' || c == EOL) {
+ /* save empty field - return [fields] */
+ if (parse_save_field(self) < 0)
+ return -1;
+ self->state = (c == EOL ? START_RECORD : EAT_CRNL);
+ }
+ else if (c == dialect->quotechar &&
+ dialect->quoting != QUOTE_NONE) {
+ /* start quoted field */
+ self->state = IN_QUOTED_FIELD;
+ }
+ else if (c == dialect->escapechar) {
+ /* possible escaped character */
+ self->state = ESCAPED_CHAR;
+ }
+ else if (c == ' ' && dialect->skipinitialspace)
+ /* ignore spaces at start of field */
+ ;
+ else if (c == dialect->delimiter) {
+ /* save empty field */
+ if (parse_save_field(self) < 0)
+ return -1;
+ }
+ else {
+ /* begin new unquoted field */
+ if (dialect->quoting == QUOTE_NONNUMERIC)
+ self->numeric_field = 1;
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ self->state = IN_FIELD;
+ }
+ break;
+
+ case ESCAPED_CHAR:
+ if (c == '\n' || c=='\r') {
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ self->state = AFTER_ESCAPED_CRNL;
+ break;
+ }
+ if (c == EOL)
+ c = '\n';
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ self->state = IN_FIELD;
+ break;
+
+ case AFTER_ESCAPED_CRNL:
+ if (c == EOL)
+ break;
+ /*fallthru*/
+
+ case IN_FIELD:
+ /* in unquoted field */
+ if (c == '\n' || c == '\r' || c == EOL) {
+ /* end of line - return [fields] */
+ if (parse_save_field(self) < 0)
+ return -1;
+ self->state = (c == EOL ? START_RECORD : EAT_CRNL);
+ }
+ else if (c == dialect->escapechar) {
+ /* possible escaped character */
+ self->state = ESCAPED_CHAR;
+ }
+ else if (c == dialect->delimiter) {
+ /* save field - wait for new field */
+ if (parse_save_field(self) < 0)
+ return -1;
+ self->state = START_FIELD;
+ }
+ else {
+ /* normal character - save in field */
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ }
+ break;
+
+ case IN_QUOTED_FIELD:
+ /* in quoted field */
+ if (c == EOL)
+ ;
+ else if (c == dialect->escapechar) {
+ /* Possible escape character */
+ self->state = ESCAPE_IN_QUOTED_FIELD;
+ }
+ else if (c == dialect->quotechar &&
+ dialect->quoting != QUOTE_NONE) {
+ if (dialect->doublequote) {
+ /* doublequote; " represented by "" */
+ self->state = QUOTE_IN_QUOTED_FIELD;
+ }
+ else {
+ /* end of quote part of field */
+ self->state = IN_FIELD;
+ }
+ }
+ else {
+ /* normal character - save in field */
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ }
+ break;
+
+ case ESCAPE_IN_QUOTED_FIELD:
+ if (c == EOL)
+ c = '\n';
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ self->state = IN_QUOTED_FIELD;
+ break;
+
+ case QUOTE_IN_QUOTED_FIELD:
+ /* doublequote - seen a quote in a quoted field */
+ if (dialect->quoting != QUOTE_NONE &&
+ c == dialect->quotechar) {
+ /* save "" as " */
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ self->state = IN_QUOTED_FIELD;
+ }
+ else if (c == dialect->delimiter) {
+ /* save field - wait for new field */
+ if (parse_save_field(self) < 0)
+ return -1;
+ self->state = START_FIELD;
+ }
+ else if (c == '\n' || c == '\r' || c == EOL) {
+ /* end of line - return [fields] */
+ if (parse_save_field(self) < 0)
+ return -1;
+ self->state = (c == EOL ? START_RECORD : EAT_CRNL);
+ }
+ else if (!dialect->strict) {
+ if (parse_add_char(self, module_state, c) < 0)
+ return -1;
+ self->state = IN_FIELD;
+ }
+ else {
+ /* illegal */
+ PyErr_Format(module_state->error_obj, "'%c' expected after '%c'",
+ dialect->delimiter,
+ dialect->quotechar);
+ return -1;
+ }
+ break;
+
+ case EAT_CRNL:
+ if (c == '\n' || c == '\r')
+ ;
+ else if (c == EOL)
+ self->state = START_RECORD;
+ else {
+ PyErr_Format(module_state->error_obj,
+ "new-line character seen in unquoted field - "
+ "do you need to open the file with newline=''?");
+ return -1;
+ }
+ break;
+
+ }
+ return 0;
+}
+
+static int
+parse_reset(ReaderObj *self)
+{
+ Py_XSETREF(self->fields, PyList_New(0));
+ if (self->fields == NULL)
+ return -1;
+ self->field_len = 0;
+ self->state = START_RECORD;
+ self->numeric_field = 0;
+ return 0;
+}
+
+static PyObject *
+Reader_iternext(ReaderObj *self)
+{
+ PyObject *fields = NULL;
+ Py_UCS4 c;
+ Py_ssize_t pos, linelen;
+ int kind;
+ const void *data;
+ PyObject *lineobj;
+
+ _csvstate *module_state = _csv_state_from_type(Py_TYPE(self),
+ "Reader.__next__");
+ if (module_state == NULL) {
+ return NULL;
+ }
+
+ if (parse_reset(self) < 0)
+ return NULL;
+ do {
+ lineobj = PyIter_Next(self->input_iter);
+ if (lineobj == NULL) {
+ /* End of input OR exception */
+ if (!PyErr_Occurred() && (self->field_len != 0 ||
+ self->state == IN_QUOTED_FIELD)) {
+ if (self->dialect->strict)
+ PyErr_SetString(module_state->error_obj,
+ "unexpected end of data");
+ else if (parse_save_field(self) >= 0)
+ break;
+ }
+ return NULL;
+ }
+ if (!PyUnicode_Check(lineobj)) {
+ PyErr_Format(module_state->error_obj,
+ "iterator should return strings, "
+ "not %.200s "
+ "(the file should be opened in text mode)",
+ Py_TYPE(lineobj)->tp_name
+ );
+ Py_DECREF(lineobj);
+ return NULL;
+ }
+ if (PyUnicode_READY(lineobj) == -1) {
+ Py_DECREF(lineobj);
+ return NULL;
+ }
+ ++self->line_num;
+ kind = PyUnicode_KIND(lineobj);
+ data = PyUnicode_DATA(lineobj);
+ pos = 0;
+ linelen = PyUnicode_GET_LENGTH(lineobj);
+ while (linelen--) {
+ c = PyUnicode_READ(kind, data, pos);
+ if (parse_process_char(self, module_state, c) < 0) {
+ Py_DECREF(lineobj);
+ goto err;
+ }
+ pos++;
+ }
+ Py_DECREF(lineobj);
+ if (parse_process_char(self, module_state, EOL) < 0)
+ goto err;
+ } while (self->state != START_RECORD);
+
+ fields = self->fields;
+ self->fields = NULL;
+err:
+ return fields;
+}
+
+static void
+Reader_dealloc(ReaderObj *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tp->tp_clear((PyObject *)self);
+ if (self->field != NULL) {
+ PyMem_Free(self->field);
+ self->field = NULL;
+ }
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static int
+Reader_traverse(ReaderObj *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->dialect);
+ Py_VISIT(self->input_iter);
+ Py_VISIT(self->fields);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+Reader_clear(ReaderObj *self)
+{
+ Py_CLEAR(self->dialect);
+ Py_CLEAR(self->input_iter);
+ Py_CLEAR(self->fields);
+ return 0;
+}
+
+PyDoc_STRVAR(Reader_Type_doc,
+"CSV reader\n"
+"\n"
+"Reader objects are responsible for reading and parsing tabular data\n"
+"in CSV format.\n"
+);
+
+static struct PyMethodDef Reader_methods[] = {
+ { NULL, NULL }
+};
+#define R_OFF(x) offsetof(ReaderObj, x)
+
+static struct PyMemberDef Reader_memberlist[] = {
+ { "dialect", T_OBJECT, R_OFF(dialect), READONLY },
+ { "line_num", T_ULONG, R_OFF(line_num), READONLY },
+ { NULL }
+};
+
+
+static PyType_Slot Reader_Type_slots[] = {
+ {Py_tp_doc, (char*)Reader_Type_doc},
+ {Py_tp_traverse, Reader_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, Reader_iternext},
+ {Py_tp_methods, Reader_methods},
+ {Py_tp_members, Reader_memberlist},
+ {Py_tp_clear, Reader_clear},
+ {Py_tp_dealloc, Reader_dealloc},
+ {0, NULL}
+};
+
+PyType_Spec Reader_Type_spec = {
+ .name = "_csv.reader",
+ .basicsize = sizeof(ReaderObj),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = Reader_Type_slots
+};
+
+
+static PyObject *
+csv_reader(PyObject *module, PyObject *args, PyObject *keyword_args)
+{
+ PyObject * iterator, * dialect = NULL;
+ _csvstate *module_state = get_csv_state(module);
+ ReaderObj * self = PyObject_GC_New(
+ ReaderObj,
+ module_state->reader_type);
+
+ if (!self)
+ return NULL;
+
+ self->dialect = NULL;
+ self->fields = NULL;
+ self->input_iter = NULL;
+ self->field = NULL;
+ self->field_size = 0;
+ self->line_num = 0;
+
+ if (parse_reset(self) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ if (!PyArg_UnpackTuple(args, "", 1, 2, &iterator, &dialect)) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->input_iter = PyObject_GetIter(iterator);
+ if (self->input_iter == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->dialect = (DialectObj *)_call_dialect(module_state, dialect,
+ keyword_args);
+ if (self->dialect == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*
+ * WRITER
+ */
+/* ---------------------------------------------------------------- */
+static void
+join_reset(WriterObj *self)
+{
+ self->rec_len = 0;
+ self->num_fields = 0;
+}
+
+#define MEM_INCR 32768
+
+/* Calculate new record length or append field to record. Return new
+ * record length.
+ */
+static Py_ssize_t
+join_append_data(WriterObj *self, int field_kind, const void *field_data,
+ Py_ssize_t field_len, int *quoted,
+ int copy_phase)
+{
+ DialectObj *dialect = self->dialect;
+ int i;
+ Py_ssize_t rec_len;
+
+#define INCLEN \
+ do {\
+ if (!copy_phase && rec_len == PY_SSIZE_T_MAX) { \
+ goto overflow; \
+ } \
+ rec_len++; \
+ } while(0)
+
+#define ADDCH(c) \
+ do {\
+ if (copy_phase) \
+ self->rec[rec_len] = c;\
+ INCLEN;\
+ } while(0)
+
+ rec_len = self->rec_len;
+
+ /* If this is not the first field we need a field separator */
+ if (self->num_fields > 0)
+ ADDCH(dialect->delimiter);
+
+ /* Handle preceding quote */
+ if (copy_phase && *quoted)
+ ADDCH(dialect->quotechar);
+
+ /* Copy/count field data */
+ /* If field is null just pass over */
+ for (i = 0; field_data && (i < field_len); i++) {
+ Py_UCS4 c = PyUnicode_READ(field_kind, field_data, i);
+ int want_escape = 0;
+
+ if (c == dialect->delimiter ||
+ c == dialect->escapechar ||
+ c == dialect->quotechar ||
+ PyUnicode_FindChar(
+ dialect->lineterminator, c, 0,
+ PyUnicode_GET_LENGTH(dialect->lineterminator), 1) >= 0) {
+ if (dialect->quoting == QUOTE_NONE)
+ want_escape = 1;
+ else {
+ if (c == dialect->quotechar) {
+ if (dialect->doublequote)
+ ADDCH(dialect->quotechar);
+ else
+ want_escape = 1;
+ }
+ else if (c == dialect->escapechar) {
+ want_escape = 1;
+ }
+ if (!want_escape)
+ *quoted = 1;
+ }
+ if (want_escape) {
+ if (dialect->escapechar == NOT_SET) {
+ PyErr_Format(self->error_obj,
+ "need to escape, but no escapechar set");
+ return -1;
+ }
+ ADDCH(dialect->escapechar);
+ }
+ }
+ /* Copy field character into record buffer.
+ */
+ ADDCH(c);
+ }
+
+ if (*quoted) {
+ if (copy_phase)
+ ADDCH(dialect->quotechar);
+ else {
+ INCLEN; /* starting quote */
+ INCLEN; /* ending quote */
+ }
+ }
+ return rec_len;
+
+ overflow:
+ PyErr_NoMemory();
+ return -1;
+#undef ADDCH
+#undef INCLEN
+}
+
+static int
+join_check_rec_size(WriterObj *self, Py_ssize_t rec_len)
+{
+ assert(rec_len >= 0);
+
+ if (rec_len > self->rec_size) {
+ size_t rec_size_new = (size_t)(rec_len / MEM_INCR + 1) * MEM_INCR;
+ Py_UCS4 *rec_new = self->rec;
+ PyMem_Resize(rec_new, Py_UCS4, rec_size_new);
+ if (rec_new == NULL) {
+ PyErr_NoMemory();
+ return 0;
+ }
+ self->rec = rec_new;
+ self->rec_size = (Py_ssize_t)rec_size_new;
+ }
+ return 1;
+}
+
+static int
+join_append(WriterObj *self, PyObject *field, int quoted)
+{
+ int field_kind = -1;
+ const void *field_data = NULL;
+ Py_ssize_t field_len = 0;
+ Py_ssize_t rec_len;
+
+ if (field != NULL) {
+ if (PyUnicode_READY(field) == -1)
+ return 0;
+ field_kind = PyUnicode_KIND(field);
+ field_data = PyUnicode_DATA(field);
+ field_len = PyUnicode_GET_LENGTH(field);
+ }
+ rec_len = join_append_data(self, field_kind, field_data, field_len,
+ &quoted, 0);
+ if (rec_len < 0)
+ return 0;
+
+ /* grow record buffer if necessary */
+ if (!join_check_rec_size(self, rec_len))
+ return 0;
+
+ self->rec_len = join_append_data(self, field_kind, field_data, field_len,
+ &quoted, 1);
+ self->num_fields++;
+
+ return 1;
+}
+
+static int
+join_append_lineterminator(WriterObj *self)
+{
+ Py_ssize_t terminator_len, i;
+ int term_kind;
+ const void *term_data;
+
+ terminator_len = PyUnicode_GET_LENGTH(self->dialect->lineterminator);
+ if (terminator_len == -1)
+ return 0;
+
+ /* grow record buffer if necessary */
+ if (!join_check_rec_size(self, self->rec_len + terminator_len))
+ return 0;
+
+ term_kind = PyUnicode_KIND(self->dialect->lineterminator);
+ term_data = PyUnicode_DATA(self->dialect->lineterminator);
+ for (i = 0; i < terminator_len; i++)
+ self->rec[self->rec_len + i] = PyUnicode_READ(term_kind, term_data, i);
+ self->rec_len += terminator_len;
+
+ return 1;
+}
+
+PyDoc_STRVAR(csv_writerow_doc,
+"writerow(iterable)\n"
+"\n"
+"Construct and write a CSV record from an iterable of fields. Non-string\n"
+"elements will be converted to string.");
+
+static PyObject *
+csv_writerow(WriterObj *self, PyObject *seq)
+{
+ DialectObj *dialect = self->dialect;
+ PyObject *iter, *field, *line, *result;
+
+ iter = PyObject_GetIter(seq);
+ if (iter == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_Format(self->error_obj,
+ "iterable expected, not %.200s",
+ Py_TYPE(seq)->tp_name);
+ }
+ return NULL;
+ }
+
+ /* Join all fields in internal buffer.
+ */
+ join_reset(self);
+ while ((field = PyIter_Next(iter))) {
+ int append_ok;
+ int quoted;
+
+ switch (dialect->quoting) {
+ case QUOTE_NONNUMERIC:
+ quoted = !PyNumber_Check(field);
+ break;
+ case QUOTE_ALL:
+ quoted = 1;
+ break;
+ case QUOTE_STRINGS:
+ quoted = PyUnicode_Check(field);
+ break;
+ case QUOTE_NOTNULL:
+ quoted = field != Py_None;
+ break;
+ default:
+ quoted = 0;
+ break;
+ }
+
+ if (PyUnicode_Check(field)) {
+ append_ok = join_append(self, field, quoted);
+ Py_DECREF(field);
+ }
+ else if (field == Py_None) {
+ append_ok = join_append(self, NULL, quoted);
+ Py_DECREF(field);
+ }
+ else {
+ PyObject *str;
+
+ str = PyObject_Str(field);
+ Py_DECREF(field);
+ if (str == NULL) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ append_ok = join_append(self, str, quoted);
+ Py_DECREF(str);
+ }
+ if (!append_ok) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ }
+ Py_DECREF(iter);
+ if (PyErr_Occurred())
+ return NULL;
+
+ if (self->num_fields > 0 && self->rec_len == 0) {
+ if (dialect->quoting == QUOTE_NONE) {
+ PyErr_Format(self->error_obj,
+ "single empty field record must be quoted");
+ return NULL;
+ }
+ self->num_fields--;
+ if (!join_append(self, NULL, 1))
+ return NULL;
+ }
+
+ /* Add line terminator.
+ */
+ if (!join_append_lineterminator(self)) {
+ return NULL;
+ }
+
+ line = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND,
+ (void *) self->rec, self->rec_len);
+ if (line == NULL) {
+ return NULL;
+ }
+ result = PyObject_CallOneArg(self->write, line);
+ Py_DECREF(line);
+ return result;
+}
+
+PyDoc_STRVAR(csv_writerows_doc,
+"writerows(iterable of iterables)\n"
+"\n"
+"Construct and write a series of iterables to a csv file. Non-string\n"
+"elements will be converted to string.");
+
+static PyObject *
+csv_writerows(WriterObj *self, PyObject *seqseq)
+{
+ PyObject *row_iter, *row_obj, *result;
+
+ row_iter = PyObject_GetIter(seqseq);
+ if (row_iter == NULL) {
+ return NULL;
+ }
+ while ((row_obj = PyIter_Next(row_iter))) {
+ result = csv_writerow(self, row_obj);
+ Py_DECREF(row_obj);
+ if (!result) {
+ Py_DECREF(row_iter);
+ return NULL;
+ }
+ else
+ Py_DECREF(result);
+ }
+ Py_DECREF(row_iter);
+ if (PyErr_Occurred())
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+static struct PyMethodDef Writer_methods[] = {
+ { "writerow", (PyCFunction)csv_writerow, METH_O, csv_writerow_doc},
+ { "writerows", (PyCFunction)csv_writerows, METH_O, csv_writerows_doc},
+ { NULL, NULL }
+};
+
+#define W_OFF(x) offsetof(WriterObj, x)
+
+static struct PyMemberDef Writer_memberlist[] = {
+ { "dialect", T_OBJECT, W_OFF(dialect), READONLY },
+ { NULL }
+};
+
+static int
+Writer_traverse(WriterObj *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->dialect);
+ Py_VISIT(self->write);
+ Py_VISIT(self->error_obj);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+Writer_clear(WriterObj *self)
+{
+ Py_CLEAR(self->dialect);
+ Py_CLEAR(self->write);
+ Py_CLEAR(self->error_obj);
+ return 0;
+}
+
+static void
+Writer_dealloc(WriterObj *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tp->tp_clear((PyObject *)self);
+ if (self->rec != NULL) {
+ PyMem_Free(self->rec);
+ }
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+PyDoc_STRVAR(Writer_Type_doc,
+"CSV writer\n"
+"\n"
+"Writer objects are responsible for generating tabular data\n"
+"in CSV format from sequence input.\n"
+);
+
+static PyType_Slot Writer_Type_slots[] = {
+ {Py_tp_doc, (char*)Writer_Type_doc},
+ {Py_tp_traverse, Writer_traverse},
+ {Py_tp_clear, Writer_clear},
+ {Py_tp_dealloc, Writer_dealloc},
+ {Py_tp_methods, Writer_methods},
+ {Py_tp_members, Writer_memberlist},
+ {0, NULL}
+};
+
+PyType_Spec Writer_Type_spec = {
+ .name = "_csv.writer",
+ .basicsize = sizeof(WriterObj),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = Writer_Type_slots,
+};
+
+
+static PyObject *
+csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
+{
+ PyObject * output_file, * dialect = NULL;
+ _csvstate *module_state = get_csv_state(module);
+ WriterObj * self = PyObject_GC_New(WriterObj, module_state->writer_type);
+
+ if (!self)
+ return NULL;
+
+ self->dialect = NULL;
+ self->write = NULL;
+
+ self->rec = NULL;
+ self->rec_size = 0;
+ self->rec_len = 0;
+ self->num_fields = 0;
+
+ self->error_obj = Py_NewRef(module_state->error_obj);
+
+ if (!PyArg_UnpackTuple(args, "", 1, 2, &output_file, &dialect)) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (_PyObject_LookupAttr(output_file,
+ module_state->str_write,
+ &self->write) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (self->write == NULL || !PyCallable_Check(self->write)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument 1 must have a \"write\" method");
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->dialect = (DialectObj *)_call_dialect(module_state, dialect,
+ keyword_args);
+ if (self->dialect == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*
+ * DIALECT REGISTRY
+ */
+
+/*[clinic input]
+_csv.list_dialects
+
+Return a list of all known dialect names.
+
+ names = csv.list_dialects()
+[clinic start generated code]*/
+
+static PyObject *
+_csv_list_dialects_impl(PyObject *module)
+/*[clinic end generated code: output=a5b92b215b006a6d input=8953943eb17d98ab]*/
+{
+ return PyDict_Keys(get_csv_state(module)->dialects);
+}
+
+static PyObject *
+csv_register_dialect(PyObject *module, PyObject *args, PyObject *kwargs)
+{
+ PyObject *name_obj, *dialect_obj = NULL;
+ _csvstate *module_state = get_csv_state(module);
+ PyObject *dialect;
+
+ if (!PyArg_UnpackTuple(args, "", 1, 2, &name_obj, &dialect_obj))
+ return NULL;
+ if (!PyUnicode_Check(name_obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "dialect name must be a string");
+ return NULL;
+ }
+ if (PyUnicode_READY(name_obj) == -1)
+ return NULL;
+ dialect = _call_dialect(module_state, dialect_obj, kwargs);
+ if (dialect == NULL)
+ return NULL;
+ if (PyDict_SetItem(module_state->dialects, name_obj, dialect) < 0) {
+ Py_DECREF(dialect);
+ return NULL;
+ }
+ Py_DECREF(dialect);
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_csv.unregister_dialect
+
+ name: object
+
+Delete the name/dialect mapping associated with a string name.
+
+ csv.unregister_dialect(name)
+[clinic start generated code]*/
+
+static PyObject *
+_csv_unregister_dialect_impl(PyObject *module, PyObject *name)
+/*[clinic end generated code: output=0813ebca6c058df4 input=6b5c1557bf60c7e7]*/
+{
+ _csvstate *module_state = get_csv_state(module);
+ if (PyDict_DelItem(module_state->dialects, name) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError)) {
+ PyErr_Format(module_state->error_obj, "unknown dialect");
+ }
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_csv.get_dialect
+
+ name: object
+
+Return the dialect instance associated with name.
+
+ dialect = csv.get_dialect(name)
+[clinic start generated code]*/
+
+static PyObject *
+_csv_get_dialect_impl(PyObject *module, PyObject *name)
+/*[clinic end generated code: output=aa988cd573bebebb input=edf9ddab32e448fb]*/
+{
+ return get_dialect_from_registry(name, get_csv_state(module));
+}
+
+/*[clinic input]
+_csv.field_size_limit
+
+ new_limit: object = NULL
+
+Sets an upper limit on parsed fields.
+
+ csv.field_size_limit([limit])
+
+Returns old limit. If limit is not given, no new limit is set and
+the old limit is returned
+[clinic start generated code]*/
+
+static PyObject *
+_csv_field_size_limit_impl(PyObject *module, PyObject *new_limit)
+/*[clinic end generated code: output=f2799ecd908e250b input=cec70e9226406435]*/
+{
+ _csvstate *module_state = get_csv_state(module);
+ long old_limit = module_state->field_limit;
+ if (new_limit != NULL) {
+ if (!PyLong_CheckExact(new_limit)) {
+ PyErr_Format(PyExc_TypeError,
+ "limit must be an integer");
+ return NULL;
+ }
+ module_state->field_limit = PyLong_AsLong(new_limit);
+ if (module_state->field_limit == -1 && PyErr_Occurred()) {
+ module_state->field_limit = old_limit;
+ return NULL;
+ }
+ }
+ return PyLong_FromLong(old_limit);
+}
+
+static PyType_Slot error_slots[] = {
+ {0, NULL},
+};
+
+PyType_Spec error_spec = {
+ .name = "_csv.Error",
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ .slots = error_slots,
+};
+
+/*
+ * MODULE
+ */
+
+PyDoc_STRVAR(csv_module_doc,
+"CSV parsing and writing.\n"
+"\n"
+"This module provides classes that assist in the reading and writing\n"
+"of Comma Separated Value (CSV) files, and implements the interface\n"
+"described by PEP 305. Although many CSV files are simple to parse,\n"
+"the format is not formally defined by a stable specification and\n"
+"is subtle enough that parsing lines of a CSV file with something\n"
+"like line.split(\",\") is bound to fail. The module supports three\n"
+"basic APIs: reading, writing, and registration of dialects.\n"
+"\n"
+"\n"
+"DIALECT REGISTRATION:\n"
+"\n"
+"Readers and writers support a dialect argument, which is a convenient\n"
+"handle on a group of settings. When the dialect argument is a string,\n"
+"it identifies one of the dialects previously registered with the module.\n"
+"If it is a class or instance, the attributes of the argument are used as\n"
+"the settings for the reader or writer:\n"
+"\n"
+" class excel:\n"
+" delimiter = ','\n"
+" quotechar = '\"'\n"
+" escapechar = None\n"
+" doublequote = True\n"
+" skipinitialspace = False\n"
+" lineterminator = '\\r\\n'\n"
+" quoting = QUOTE_MINIMAL\n"
+"\n"
+"SETTINGS:\n"
+"\n"
+" * quotechar - specifies a one-character string to use as the\n"
+" quoting character. It defaults to '\"'.\n"
+" * delimiter - specifies a one-character string to use as the\n"
+" field separator. It defaults to ','.\n"
+" * skipinitialspace - specifies how to interpret spaces which\n"
+" immediately follow a delimiter. It defaults to False, which\n"
+" means that spaces immediately following a delimiter is part\n"
+" of the following field.\n"
+" * lineterminator - specifies the character sequence which should\n"
+" terminate rows.\n"
+" * quoting - controls when quotes should be generated by the writer.\n"
+" It can take on any of the following module constants:\n"
+"\n"
+" csv.QUOTE_MINIMAL means only when required, for example, when a\n"
+" field contains either the quotechar or the delimiter\n"
+" csv.QUOTE_ALL means that quotes are always placed around fields.\n"
+" csv.QUOTE_NONNUMERIC means that quotes are always placed around\n"
+" fields which do not parse as integers or floating point\n"
+" numbers.\n"
+" csv.QUOTE_STRINGS means that quotes are always placed around\n"
+" fields which are strings. Note that the Python value None\n"
+" is not a string.\n"
+" csv.QUOTE_NOTNULL means that quotes are only placed around fields\n"
+" that are not the Python value None.\n"
+" csv.QUOTE_NONE means that quotes are never placed around fields.\n"
+" * escapechar - specifies a one-character string used to escape\n"
+" the delimiter when quoting is set to QUOTE_NONE.\n"
+" * doublequote - controls the handling of quotes inside fields. When\n"
+" True, two consecutive quotes are interpreted as one during read,\n"
+" and when writing, each quote character embedded in the data is\n"
+" written as two quotes\n");
+
+PyDoc_STRVAR(csv_reader_doc,
+" csv_reader = reader(iterable [, dialect='excel']\n"
+" [optional keyword args])\n"
+" for row in csv_reader:\n"
+" process(row)\n"
+"\n"
+"The \"iterable\" argument can be any object that returns a line\n"
+"of input for each iteration, such as a file object or a list. The\n"
+"optional \"dialect\" parameter is discussed below. The function\n"
+"also accepts optional keyword arguments which override settings\n"
+"provided by the dialect.\n"
+"\n"
+"The returned object is an iterator. Each iteration returns a row\n"
+"of the CSV file (which can span multiple input lines).\n");
+
+PyDoc_STRVAR(csv_writer_doc,
+" csv_writer = csv.writer(fileobj [, dialect='excel']\n"
+" [optional keyword args])\n"
+" for row in sequence:\n"
+" csv_writer.writerow(row)\n"
+"\n"
+" [or]\n"
+"\n"
+" csv_writer = csv.writer(fileobj [, dialect='excel']\n"
+" [optional keyword args])\n"
+" csv_writer.writerows(rows)\n"
+"\n"
+"The \"fileobj\" argument can be any object that supports the file API.\n");
+
+PyDoc_STRVAR(csv_register_dialect_doc,
+"Create a mapping from a string name to a dialect class.\n"
+" dialect = csv.register_dialect(name[, dialect[, **fmtparams]])");
+
+static struct PyMethodDef csv_methods[] = {
+ { "reader", _PyCFunction_CAST(csv_reader),
+ METH_VARARGS | METH_KEYWORDS, csv_reader_doc},
+ { "writer", _PyCFunction_CAST(csv_writer),
+ METH_VARARGS | METH_KEYWORDS, csv_writer_doc},
+ { "register_dialect", _PyCFunction_CAST(csv_register_dialect),
+ METH_VARARGS | METH_KEYWORDS, csv_register_dialect_doc},
+ _CSV_LIST_DIALECTS_METHODDEF
+ _CSV_UNREGISTER_DIALECT_METHODDEF
+ _CSV_GET_DIALECT_METHODDEF
+ _CSV_FIELD_SIZE_LIMIT_METHODDEF
+ { NULL, NULL }
+};
+
+static int
+csv_exec(PyObject *module) {
+ const StyleDesc *style;
+ PyObject *temp;
+ _csvstate *module_state = get_csv_state(module);
+
+ temp = PyType_FromModuleAndSpec(module, &Dialect_Type_spec, NULL);
+ module_state->dialect_type = (PyTypeObject *)temp;
+ if (PyModule_AddObjectRef(module, "Dialect", temp) < 0) {
+ return -1;
+ }
+
+ temp = PyType_FromModuleAndSpec(module, &Reader_Type_spec, NULL);
+ module_state->reader_type = (PyTypeObject *)temp;
+ if (PyModule_AddObjectRef(module, "Reader", temp) < 0) {
+ return -1;
+ }
+
+ temp = PyType_FromModuleAndSpec(module, &Writer_Type_spec, NULL);
+ module_state->writer_type = (PyTypeObject *)temp;
+ if (PyModule_AddObjectRef(module, "Writer", temp) < 0) {
+ return -1;
+ }
+
+ /* Add version to the module. */
+ if (PyModule_AddStringConstant(module, "__version__",
+ MODULE_VERSION) == -1) {
+ return -1;
+ }
+
+ /* Set the field limit */
+ module_state->field_limit = 128 * 1024;
+
+ /* Add _dialects dictionary */
+ module_state->dialects = PyDict_New();
+ if (PyModule_AddObjectRef(module, "_dialects", module_state->dialects) < 0) {
+ return -1;
+ }
+
+ /* Add quote styles into dictionary */
+ for (style = quote_styles; style->name; style++) {
+ if (PyModule_AddIntConstant(module, style->name,
+ style->style) == -1)
+ return -1;
+ }
+
+ /* Add the CSV exception object to the module. */
+ PyObject *bases = PyTuple_Pack(1, PyExc_Exception);
+ if (bases == NULL) {
+ return -1;
+ }
+ module_state->error_obj = PyType_FromModuleAndSpec(module, &error_spec,
+ bases);
+ Py_DECREF(bases);
+ if (module_state->error_obj == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, (PyTypeObject *)module_state->error_obj) != 0) {
+ return -1;
+ }
+
+ module_state->str_write = PyUnicode_InternFromString("write");
+ if (module_state->str_write == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot csv_slots[] = {
+ {Py_mod_exec, csv_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _csvmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_csv",
+ csv_module_doc,
+ sizeof(_csvstate),
+ csv_methods,
+ csv_slots,
+ _csv_traverse,
+ _csv_clear,
+ _csv_free
+};
+
+PyMODINIT_FUNC
+PyInit__csv(void)
+{
+ return PyModuleDef_Init(&_csvmodule);
+}
diff --git a/contrib/tools/python3/Modules/_ctypes/_ctypes.c b/contrib/tools/python3/Modules/_ctypes/_ctypes.c
new file mode 100644
index 00000000000..c5157560f6e
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/_ctypes.c
@@ -0,0 +1,5835 @@
+/*
+ ToDo:
+
+ Get rid of the checker (and also the converters) field in PyCFuncPtrObject and
+ StgDictObject, and replace them by slot functions in StgDictObject.
+
+ think about a buffer-like object (memory? bytes?)
+
+ Should POINTER(c_char) and POINTER(c_wchar) have a .value property?
+ What about c_char and c_wchar arrays then?
+
+ Add from_mmap, from_file, from_string metaclass methods.
+
+ Maybe we can get away with from_file (calls read) and with a from_buffer
+ method?
+
+ And what about the to_mmap, to_file, to_str(?) methods? They would clobber
+ the namespace, probably. So, functions instead? And we already have memmove...
+*/
+
+/*
+
+Name methods, members, getsets
+==============================================================================
+
+PyCStructType_Type __new__(), from_address(), __mul__(), from_param()
+UnionType_Type __new__(), from_address(), __mul__(), from_param()
+PyCPointerType_Type __new__(), from_address(), __mul__(), from_param(), set_type()
+PyCArrayType_Type __new__(), from_address(), __mul__(), from_param()
+PyCSimpleType_Type __new__(), from_address(), __mul__(), from_param()
+
+PyCData_Type
+ Struct_Type __new__(), __init__()
+ PyCPointer_Type __new__(), __init__(), _as_parameter_, contents
+ PyCArray_Type __new__(), __init__(), _as_parameter_, __get/setitem__(), __len__()
+ Simple_Type __new__(), __init__(), _as_parameter_
+
+PyCField_Type
+PyCStgDict_Type
+
+==============================================================================
+
+class methods
+-------------
+
+It has some similarity to the byref() construct compared to pointer()
+from_address(addr)
+ - construct an instance from a given memory block (sharing this memory block)
+
+from_param(obj)
+ - typecheck and convert a Python object into a C function call parameter
+ The result may be an instance of the type, or an integer or tuple
+ (typecode, value[, obj])
+
+instance methods/properties
+---------------------------
+
+_as_parameter_
+ - convert self into a C function call parameter
+ This is either an integer, or a 3-tuple (typecode, value, obj)
+
+functions
+---------
+
+sizeof(cdata)
+ - return the number of bytes the buffer contains
+
+sizeof(ctype)
+ - return the number of bytes the buffer of an instance would contain
+
+byref(cdata)
+
+addressof(cdata)
+
+pointer(cdata)
+
+POINTER(ctype)
+
+bytes(cdata)
+ - return the buffer contents as a sequence of bytes (which is currently a string)
+
+*/
+
+/*
+ * PyCStgDict_Type
+ * PyCStructType_Type
+ * UnionType_Type
+ * PyCPointerType_Type
+ * PyCArrayType_Type
+ * PyCSimpleType_Type
+ *
+ * PyCData_Type
+ * Struct_Type
+ * Union_Type
+ * PyCArray_Type
+ * Simple_Type
+ * PyCPointer_Type
+ * PyCField_Type
+ *
+ */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#include "structmember.h" // PyMemberDef
+
+#include <ffi.h>
+#ifdef MS_WIN32
+#include <malloc.h>
+#ifndef IS_INTRESOURCE
+#define IS_INTRESOURCE(x) (((size_t)(x) >> 16) == 0)
+#endif
+#else
+#include <dlfcn.h>
+#endif
+#include "ctypes.h"
+
+#include "pycore_long.h" // _PyLong_GetZero()
+
+ctypes_state global_state;
+
+PyObject *PyExc_ArgError = NULL;
+
+/* This dict maps ctypes types to POINTER types */
+PyObject *_ctypes_ptrtype_cache = NULL;
+
+static PyTypeObject Simple_Type;
+
+/* a callable object used for unpickling:
+ strong reference to _ctypes._unpickle() function */
+static PyObject *_unpickle;
+
+
+/****************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *key;
+ PyObject *dict;
+} DictRemoverObject;
+
+static int
+_DictRemover_traverse(DictRemoverObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->key);
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static int
+_DictRemover_clear(DictRemoverObject *self)
+{
+ Py_CLEAR(self->key);
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+_DictRemover_dealloc(PyObject *myself)
+{
+ PyTypeObject *tp = Py_TYPE(myself);
+ DictRemoverObject *self = (DictRemoverObject *)myself;
+ PyObject_GC_UnTrack(myself);
+ (void)_DictRemover_clear(self);
+ tp->tp_free(myself);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+_DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw)
+{
+ DictRemoverObject *self = (DictRemoverObject *)myself;
+ if (self->key && self->dict) {
+ if (-1 == PyDict_DelItem(self->dict, self->key)) {
+ _PyErr_WriteUnraisableMsg("on calling _ctypes.DictRemover", NULL);
+ }
+ Py_CLEAR(self->key);
+ Py_CLEAR(self->dict);
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(dictremover_doc, "deletes a key from a dictionary");
+
+static PyType_Slot dictremover_slots[] = {
+ {Py_tp_dealloc, _DictRemover_dealloc},
+ {Py_tp_traverse, _DictRemover_traverse},
+ {Py_tp_clear, _DictRemover_clear},
+ {Py_tp_call, _DictRemover_call},
+ {Py_tp_doc, (void *)dictremover_doc},
+ {0, NULL},
+};
+
+static PyType_Spec dictremover_spec = {
+ .name = "_ctypes.DictRemover",
+ .basicsize = sizeof(DictRemoverObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = dictremover_slots,
+};
+
+int
+PyDict_SetItemProxy(PyObject *dict, PyObject *key, PyObject *item)
+{
+ PyObject *obj;
+ DictRemoverObject *remover;
+ PyObject *proxy;
+ int result;
+
+ ctypes_state *st = GLOBAL_STATE();
+ obj = _PyObject_CallNoArgs((PyObject *)st->DictRemover_Type);
+ if (obj == NULL)
+ return -1;
+
+ remover = (DictRemoverObject *)obj;
+ assert(remover->key == NULL);
+ assert(remover->dict == NULL);
+ remover->key = Py_NewRef(key);
+ remover->dict = Py_NewRef(dict);
+
+ proxy = PyWeakref_NewProxy(item, obj);
+ Py_DECREF(obj);
+ if (proxy == NULL)
+ return -1;
+
+ result = PyDict_SetItem(dict, key, proxy);
+ Py_DECREF(proxy);
+ return result;
+}
+
+PyObject *
+PyDict_GetItemProxy(PyObject *dict, PyObject *key)
+{
+ PyObject *result;
+ PyObject *item = PyDict_GetItemWithError(dict, key);
+
+ if (item == NULL)
+ return NULL;
+ if (!PyWeakref_CheckProxy(item))
+ return item;
+ result = PyWeakref_GET_OBJECT(item);
+ if (result == Py_None)
+ return NULL;
+ return result;
+}
+
+/******************************************************************/
+
+/*
+ Allocate a memory block for a pep3118 format string, filled with
+ a suitable PEP 3118 type code corresponding to the given ctypes
+ type. Returns NULL on failure, with the error indicator set.
+
+ This produces type codes in the standard size mode (cf. struct module),
+ since the endianness may need to be swapped to a non-native one
+ later on.
+ */
+static char *
+_ctypes_alloc_format_string_for_type(char code, int big_endian)
+{
+ char *result;
+ char pep_code = '\0';
+
+ switch (code) {
+#if SIZEOF_INT == 2
+ case 'i': pep_code = 'h'; break;
+ case 'I': pep_code = 'H'; break;
+#elif SIZEOF_INT == 4
+ case 'i': pep_code = 'i'; break;
+ case 'I': pep_code = 'I'; break;
+#elif SIZEOF_INT == 8
+ case 'i': pep_code = 'q'; break;
+ case 'I': pep_code = 'Q'; break;
+#else
+# error SIZEOF_INT has an unexpected value
+#endif /* SIZEOF_INT */
+#if SIZEOF_LONG == 4
+ case 'l': pep_code = 'l'; break;
+ case 'L': pep_code = 'L'; break;
+#elif SIZEOF_LONG == 8
+ case 'l': pep_code = 'q'; break;
+ case 'L': pep_code = 'Q'; break;
+#else
+# error SIZEOF_LONG has an unexpected value
+#endif /* SIZEOF_LONG */
+#if SIZEOF__BOOL == 1
+ case '?': pep_code = '?'; break;
+#elif SIZEOF__BOOL == 2
+ case '?': pep_code = 'H'; break;
+#elif SIZEOF__BOOL == 4
+ case '?': pep_code = 'L'; break;
+#elif SIZEOF__BOOL == 8
+ case '?': pep_code = 'Q'; break;
+#else
+# error SIZEOF__BOOL has an unexpected value
+#endif /* SIZEOF__BOOL */
+ default:
+ /* The standard-size code is the same as the ctypes one */
+ pep_code = code;
+ break;
+ }
+
+ result = PyMem_Malloc(3);
+ if (result == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ result[0] = big_endian ? '>' : '<';
+ result[1] = pep_code;
+ result[2] = '\0';
+ return result;
+}
+
+/*
+ Allocate a memory block for a pep3118 format string, copy prefix (if
+ non-null) and suffix into it. Returns NULL on failure, with the error
+ indicator set. If called with a suffix of NULL the error indicator must
+ already be set.
+ */
+char *
+_ctypes_alloc_format_string(const char *prefix, const char *suffix)
+{
+ size_t len;
+ char *result;
+
+ if (suffix == NULL) {
+ assert(PyErr_Occurred());
+ return NULL;
+ }
+ len = strlen(suffix);
+ if (prefix)
+ len += strlen(prefix);
+ result = PyMem_Malloc(len + 1);
+ if (result == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ if (prefix)
+ strcpy(result, prefix);
+ else
+ result[0] = '\0';
+ strcat(result, suffix);
+ return result;
+}
+
+/*
+ Allocate a memory block for a pep3118 format string, adding
+ the given prefix (if non-null), an additional shape prefix, and a suffix.
+ Returns NULL on failure, with the error indicator set. If called with
+ a suffix of NULL the error indicator must already be set.
+ */
+char *
+_ctypes_alloc_format_string_with_shape(int ndim, const Py_ssize_t *shape,
+ const char *prefix, const char *suffix)
+{
+ char *new_prefix;
+ char *result;
+ char buf[32];
+ Py_ssize_t prefix_len;
+ int k;
+
+ prefix_len = 32 * ndim + 3;
+ if (prefix)
+ prefix_len += strlen(prefix);
+ new_prefix = PyMem_Malloc(prefix_len);
+ if (new_prefix == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ new_prefix[0] = '\0';
+ if (prefix)
+ strcpy(new_prefix, prefix);
+ if (ndim > 0) {
+ /* Add the prefix "(shape[0],shape[1],...,shape[ndim-1])" */
+ strcat(new_prefix, "(");
+ for (k = 0; k < ndim; ++k) {
+ if (k < ndim-1) {
+ sprintf(buf, "%zd,", shape[k]);
+ } else {
+ sprintf(buf, "%zd)", shape[k]);
+ }
+ strcat(new_prefix, buf);
+ }
+ }
+ result = _ctypes_alloc_format_string(new_prefix, suffix);
+ PyMem_Free(new_prefix);
+ return result;
+}
+
+/* StructParamObject and StructParam_Type are used in _ctypes_callproc()
+ for argument.keep to call PyMem_Free(ptr) on Py_DECREF(argument).
+
+ StructUnionType_paramfunc() creates such object when a ctypes Structure is
+ passed by copy to a C function. */
+typedef struct {
+ PyObject_HEAD
+ void *ptr;
+ PyObject *keep; // If set, a reference to the original CDataObject.
+} StructParamObject;
+
+static int
+StructParam_traverse(StructParamObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+StructParam_clear(StructParamObject *self)
+{
+ Py_CLEAR(self->keep);
+ return 0;
+}
+
+static void
+StructParam_dealloc(PyObject *myself)
+{
+ StructParamObject *self = (StructParamObject *)myself;
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(myself);
+ (void)StructParam_clear(self);
+ PyMem_Free(self->ptr);
+ tp->tp_free(myself);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot structparam_slots[] = {
+ {Py_tp_traverse, StructParam_traverse},
+ {Py_tp_clear, StructParam_clear},
+ {Py_tp_dealloc, StructParam_dealloc},
+ {0, NULL},
+};
+
+static PyType_Spec structparam_spec = {
+ .name = "_ctypes.StructParam_Type",
+ .basicsize = sizeof(StructParamObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = structparam_slots,
+};
+
+
+/*
+ PyCStructType_Type - a meta type/class. Creating a new class using this one as
+ __metaclass__ will call the constructor StructUnionType_new. It replaces the
+ tp_dict member with a new instance of StgDict, and initializes the C
+ accessible fields somehow.
+*/
+
+static PyCArgObject *
+StructUnionType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *parg;
+ PyObject *obj;
+ StgDictObject *stgdict;
+ void *ptr;
+
+ if ((size_t)self->b_size > sizeof(void*)) {
+ ptr = PyMem_Malloc(self->b_size);
+ if (ptr == NULL) {
+ return NULL;
+ }
+ memcpy(ptr, self->b_ptr, self->b_size);
+
+ /* Create a Python object which calls PyMem_Free(ptr) in
+ its deallocator. The object will be destroyed
+ at _ctypes_callproc() cleanup. */
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *tp = st->StructParam_Type;
+ obj = tp->tp_alloc(tp, 0);
+ if (obj == NULL) {
+ PyMem_Free(ptr);
+ return NULL;
+ }
+
+ StructParamObject *struct_param = (StructParamObject *)obj;
+ struct_param->ptr = ptr;
+ struct_param->keep = Py_NewRef(self);
+ } else {
+ ptr = self->b_ptr;
+ obj = Py_NewRef(self);
+ }
+
+ parg = PyCArgObject_new();
+ if (parg == NULL) {
+ Py_DECREF(obj);
+ return NULL;
+ }
+
+ parg->tag = 'V';
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for structure/union instances */
+ parg->pffi_type = &stgdict->ffi_type_pointer;
+ parg->value.p = ptr;
+ parg->size = self->b_size;
+ parg->obj = obj;
+ return parg;
+}
+
+static PyObject *
+StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isStruct)
+{
+ PyTypeObject *result;
+ PyObject *fields;
+ StgDictObject *dict;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (!result)
+ return NULL;
+
+ /* keep this for bw compatibility */
+ int r = PyDict_Contains(result->tp_dict, &_Py_ID(_abstract_));
+ if (r > 0)
+ return (PyObject *)result;
+ if (r < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ dict = (StgDictObject *)_PyObject_CallNoArgs((PyObject *)&PyCStgDict_Type);
+ if (!dict) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (!isStruct) {
+ dict->flags |= TYPEFLAG_HASUNION;
+ }
+ /* replace the class dict by our updated stgdict, which holds info
+ about storage requirements of the instances */
+ if (-1 == PyDict_Update((PyObject *)dict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)dict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)dict);
+ dict->format = _ctypes_alloc_format_string(NULL, "B");
+ if (dict->format == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ dict->paramfunc = StructUnionType_paramfunc;
+
+ fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
+ if (fields) {
+ if (PyObject_SetAttr((PyObject *)result, &_Py_ID(_fields_), fields) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return (PyObject *)result;
+ }
+ else if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ else {
+ StgDictObject *basedict = PyType_stgdict((PyObject *)result->tp_base);
+
+ if (basedict == NULL)
+ return (PyObject *)result;
+ /* copy base dict */
+ if (-1 == PyCStgDict_clone(dict, basedict)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ dict->flags &= ~DICTFLAG_FINAL; /* clear the 'final' flag in the subclass dict */
+ basedict->flags |= DICTFLAG_FINAL; /* set the 'final' flag in the baseclass dict */
+ return (PyObject *)result;
+ }
+}
+
+static PyObject *
+PyCStructType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ return StructUnionType_new(type, args, kwds, 1);
+}
+
+static PyObject *
+UnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ return StructUnionType_new(type, args, kwds, 0);
+}
+
+PyDoc_STRVAR(from_address_doc,
+"C.from_address(integer) -> C instance\naccess a C instance at the specified address");
+
+static PyObject *
+CDataType_from_address(PyObject *type, PyObject *value)
+{
+ void *buf;
+ if (!PyLong_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "integer expected");
+ return NULL;
+ }
+ buf = (void *)PyLong_AsVoidPtr(value);
+ if (PyErr_Occurred())
+ return NULL;
+ return PyCData_AtAddress(type, buf);
+}
+
+PyDoc_STRVAR(from_buffer_doc,
+"C.from_buffer(object, offset=0) -> C instance\ncreate a C instance from a writeable buffer");
+
+static int
+KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep);
+
+static PyObject *
+CDataType_from_buffer(PyObject *type, PyObject *args)
+{
+ PyObject *obj;
+ PyObject *mv;
+ PyObject *result;
+ Py_buffer *buffer;
+ Py_ssize_t offset = 0;
+
+ StgDictObject *dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError, "abstract class");
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args, "O|n:from_buffer", &obj, &offset))
+ return NULL;
+
+ mv = PyMemoryView_FromObject(obj);
+ if (mv == NULL)
+ return NULL;
+
+ buffer = PyMemoryView_GET_BUFFER(mv);
+
+ if (buffer->readonly) {
+ PyErr_SetString(PyExc_TypeError,
+ "underlying buffer is not writable");
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (!PyBuffer_IsContiguous(buffer, 'C')) {
+ PyErr_SetString(PyExc_TypeError,
+ "underlying buffer is not C contiguous");
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (offset < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "offset cannot be negative");
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (dict->size > buffer->len - offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer size too small "
+ "(%zd instead of at least %zd bytes)",
+ buffer->len, dict->size + offset);
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (PySys_Audit("ctypes.cdata/buffer", "nnn",
+ (Py_ssize_t)buffer->buf, buffer->len, offset) < 0) {
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ result = PyCData_AtAddress(type, (char *)buffer->buf + offset);
+ if (result == NULL) {
+ Py_DECREF(mv);
+ return NULL;
+ }
+
+ if (-1 == KeepRef((CDataObject *)result, -1, mv)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+PyDoc_STRVAR(from_buffer_copy_doc,
+"C.from_buffer_copy(object, offset=0) -> C instance\ncreate a C instance from a readable buffer");
+
+static PyObject *
+GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
+
+static PyObject *
+CDataType_from_buffer_copy(PyObject *type, PyObject *args)
+{
+ Py_buffer buffer;
+ Py_ssize_t offset = 0;
+ PyObject *result;
+ StgDictObject *dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError, "abstract class");
+ return NULL;
+ }
+
+ if (!PyArg_ParseTuple(args, "y*|n:from_buffer_copy", &buffer, &offset))
+ return NULL;
+
+ if (offset < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "offset cannot be negative");
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ if (dict->size > buffer.len - offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer size too small (%zd instead of at least %zd bytes)",
+ buffer.len, dict->size + offset);
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ if (PySys_Audit("ctypes.cdata/buffer", "nnn",
+ (Py_ssize_t)buffer.buf, buffer.len, offset) < 0) {
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ result = GenericPyCData_new((PyTypeObject *)type, NULL, NULL);
+ if (result != NULL) {
+ memcpy(((CDataObject *)result)->b_ptr,
+ (char *)buffer.buf + offset, dict->size);
+ }
+ PyBuffer_Release(&buffer);
+ return result;
+}
+
+PyDoc_STRVAR(in_dll_doc,
+"C.in_dll(dll, name) -> C instance\naccess a C instance in a dll");
+
+static PyObject *
+CDataType_in_dll(PyObject *type, PyObject *args)
+{
+ PyObject *dll;
+ char *name;
+ PyObject *obj;
+ void *handle;
+ void *address;
+
+ if (!PyArg_ParseTuple(args, "Os:in_dll", &dll, &name))
+ return NULL;
+ if (PySys_Audit("ctypes.dlsym", "O", args) < 0) {
+ return NULL;
+ }
+
+ obj = PyObject_GetAttrString(dll, "_handle");
+ if (!obj)
+ return NULL;
+ if (!PyLong_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the _handle attribute of the second argument must be an integer");
+ Py_DECREF(obj);
+ return NULL;
+ }
+ handle = (void *)PyLong_AsVoidPtr(obj);
+ Py_DECREF(obj);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert the _handle attribute to a pointer");
+ return NULL;
+ }
+
+#ifdef MS_WIN32
+ Py_BEGIN_ALLOW_THREADS
+ address = (void *)GetProcAddress(handle, name);
+ Py_END_ALLOW_THREADS
+ if (!address) {
+ PyErr_Format(PyExc_ValueError,
+ "symbol '%s' not found",
+ name);
+ return NULL;
+ }
+#else
+ address = (void *)dlsym(handle, name);
+ if (!address) {
+#ifdef __CYGWIN__
+/* dlerror() isn't very helpful on cygwin */
+ PyErr_Format(PyExc_ValueError,
+ "symbol '%s' not found",
+ name);
+#else
+ PyErr_SetString(PyExc_ValueError, dlerror());
+#endif
+ return NULL;
+ }
+#endif
+ return PyCData_AtAddress(type, address);
+}
+
+PyDoc_STRVAR(from_param_doc,
+"Convert a Python object into a function call parameter.");
+
+static PyObject *
+CDataType_from_param(PyObject *type, PyObject *value)
+{
+ PyObject *as_parameter;
+ int res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ PyCArgObject *p = (PyCArgObject *)value;
+ PyObject *ob = p->obj;
+ const char *ob_name;
+ StgDictObject *dict;
+ dict = PyType_stgdict(type);
+
+ /* If we got a PyCArgObject, we must check if the object packed in it
+ is an instance of the type's dict->proto */
+ if(dict && ob) {
+ res = PyObject_IsInstance(ob, dict->proto);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ }
+ ob_name = (ob) ? Py_TYPE(ob)->tp_name : "???";
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instance instead of pointer to %s",
+ ((PyTypeObject *)type)->tp_name, ob_name);
+ return NULL;
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = CDataType_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instance instead of %s",
+ ((PyTypeObject *)type)->tp_name,
+ Py_TYPE(value)->tp_name);
+ return NULL;
+}
+
+static PyMethodDef CDataType_methods[] = {
+ { "from_param", CDataType_from_param, METH_O, from_param_doc },
+ { "from_address", CDataType_from_address, METH_O, from_address_doc },
+ { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
+ { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
+ { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc },
+ { NULL, NULL },
+};
+
+static PyObject *
+CDataType_repeat(PyObject *self, Py_ssize_t length)
+{
+ if (length < 0)
+ return PyErr_Format(PyExc_ValueError,
+ "Array length must be >= 0, not %zd",
+ length);
+ return PyCArrayType_from_ctype(self, length);
+}
+
+static PySequenceMethods CDataType_as_sequence = {
+ 0, /* inquiry sq_length; */
+ 0, /* binaryfunc sq_concat; */
+ CDataType_repeat, /* intargfunc sq_repeat; */
+ 0, /* intargfunc sq_item; */
+ 0, /* intintargfunc sq_slice; */
+ 0, /* intobjargproc sq_ass_item; */
+ 0, /* intintobjargproc sq_ass_slice; */
+ 0, /* objobjproc sq_contains; */
+
+ 0, /* binaryfunc sq_inplace_concat; */
+ 0, /* intargfunc sq_inplace_repeat; */
+};
+
+static int
+CDataType_clear(PyTypeObject *self)
+{
+ StgDictObject *dict = PyType_stgdict((PyObject *)self);
+ if (dict)
+ Py_CLEAR(dict->proto);
+ return PyType_Type.tp_clear((PyObject *)self);
+}
+
+static int
+CDataType_traverse(PyTypeObject *self, visitproc visit, void *arg)
+{
+ StgDictObject *dict = PyType_stgdict((PyObject *)self);
+ if (dict)
+ Py_VISIT(dict->proto);
+ return PyType_Type.tp_traverse((PyObject *)self, visit, arg);
+}
+
+static int
+PyCStructType_setattro(PyObject *self, PyObject *key, PyObject *value)
+{
+ /* XXX Should we disallow deleting _fields_? */
+ if (-1 == PyType_Type.tp_setattro(self, key, value))
+ return -1;
+
+ if (value && PyUnicode_Check(key) &&
+ _PyUnicode_EqualToASCIIString(key, "_fields_"))
+ return PyCStructUnionType_update_stgdict(self, value, 1);
+ return 0;
+}
+
+
+static int
+UnionType_setattro(PyObject *self, PyObject *key, PyObject *value)
+{
+ /* XXX Should we disallow deleting _fields_? */
+ if (-1 == PyObject_GenericSetAttr(self, key, value))
+ return -1;
+
+ if (PyUnicode_Check(key) &&
+ _PyUnicode_EqualToASCIIString(key, "_fields_"))
+ return PyCStructUnionType_update_stgdict(self, value, 0);
+ return 0;
+}
+
+
+PyTypeObject PyCStructType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCStructType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ PyCStructType_setattro, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for the CData Objects"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCStructType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+static PyTypeObject UnionType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.UnionType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ UnionType_setattro, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for the CData Objects"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ UnionType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+
+/*
+
+The PyCPointerType_Type metaclass must ensure that the subclass of Pointer can be
+created. It must check for a _type_ attribute in the class. Since are no
+runtime created properties, a CField is probably *not* needed ?
+
+class IntPointer(Pointer):
+ _type_ = "i"
+
+The PyCPointer_Type provides the functionality: a contents method/property, a
+size property/method, and the sequence protocol.
+
+*/
+
+static int
+PyCPointerType_SetProto(StgDictObject *stgdict, PyObject *proto)
+{
+ if (!proto || !PyType_Check(proto)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_type_ must be a type");
+ return -1;
+ }
+ if (!PyType_stgdict(proto)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_type_ must have storage info");
+ return -1;
+ }
+ Py_INCREF(proto);
+ Py_XSETREF(stgdict->proto, proto);
+ return 0;
+}
+
+static PyCArgObject *
+PyCPointerType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *parg;
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = Py_NewRef(self);
+ parg->value.p = *(void **)self->b_ptr;
+ return parg;
+}
+
+static PyObject *
+PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ PyObject *proto;
+ PyObject *typedict;
+
+
+ typedict = PyTuple_GetItem(args, 2);
+ if (!typedict)
+ return NULL;
+/*
+ stgdict items size, align, length contain info about pointers itself,
+ stgdict->proto has info about the pointed to type!
+*/
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ return NULL;
+ stgdict->size = sizeof(void *);
+ stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
+ stgdict->length = 1;
+ stgdict->ffi_type_pointer = ffi_type_pointer;
+ stgdict->paramfunc = PyCPointerType_paramfunc;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+
+ proto = PyDict_GetItemWithError(typedict, &_Py_ID(_type_)); /* Borrowed ref */
+ if (proto) {
+ StgDictObject *itemdict;
+ const char *current_format;
+ if (-1 == PyCPointerType_SetProto(stgdict, proto)) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ itemdict = PyType_stgdict(proto);
+ /* PyCPointerType_SetProto has verified proto has a stgdict. */
+ assert(itemdict);
+ /* If itemdict->format is NULL, then this is a pointer to an
+ incomplete type. We create a generic format string
+ 'pointer to bytes' in this case. XXX Better would be to
+ fix the format string later...
+ */
+ current_format = itemdict->format ? itemdict->format : "B";
+ if (itemdict->shape != NULL) {
+ /* pointer to an array: the shape needs to be prefixed */
+ stgdict->format = _ctypes_alloc_format_string_with_shape(
+ itemdict->ndim, itemdict->shape, "&", current_format);
+ } else {
+ stgdict->format = _ctypes_alloc_format_string("&", current_format);
+ }
+ if (stgdict->format == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ }
+ else if (PyErr_Occurred()) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ return (PyObject *)result;
+}
+
+
+static PyObject *
+PyCPointerType_set_type(PyTypeObject *self, PyObject *type)
+{
+ StgDictObject *dict;
+
+
+ dict = PyType_stgdict((PyObject *)self);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+
+ if (-1 == PyCPointerType_SetProto(dict, type))
+ return NULL;
+
+ if (-1 == PyDict_SetItem((PyObject *)dict, &_Py_ID(_type_), type))
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *_byref(PyObject *);
+
+static PyObject *
+PyCPointerType_from_param(PyObject *type, PyObject *value)
+{
+ StgDictObject *typedict;
+
+ if (value == Py_None) {
+ /* ConvParam will convert to a NULL pointer later */
+ return Py_NewRef(value);
+ }
+
+ typedict = PyType_stgdict(type);
+ if (!typedict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+
+ /* If we expect POINTER(<type>), but receive a <type> instance, accept
+ it by calling byref(<type>).
+ */
+ switch (PyObject_IsInstance(value, typedict->proto)) {
+ case 1:
+ Py_INCREF(value); /* _byref steals a refcount */
+ return _byref(value);
+ case -1:
+ return NULL;
+ default:
+ break;
+ }
+
+ if (PointerObject_Check(value) || ArrayObject_Check(value)) {
+ /* Array instances are also pointers when
+ the item types are the same.
+ */
+ StgDictObject *v = PyObject_stgdict(value);
+ assert(v); /* Cannot be NULL for pointer or array objects */
+ int ret = PyObject_IsSubclass(v->proto, typedict->proto);
+ if (ret < 0) {
+ return NULL;
+ }
+ if (ret) {
+ return Py_NewRef(value);
+ }
+ }
+ return CDataType_from_param(type, value);
+}
+
+static PyMethodDef PyCPointerType_methods[] = {
+ { "from_address", CDataType_from_address, METH_O, from_address_doc },
+ { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
+ { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
+ { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc},
+ { "from_param", (PyCFunction)PyCPointerType_from_param, METH_O, from_param_doc},
+ { "set_type", (PyCFunction)PyCPointerType_set_type, METH_O },
+ { NULL, NULL },
+};
+
+PyTypeObject PyCPointerType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCPointerType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for the Pointer Objects"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCPointerType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCPointerType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ PyCArrayType_Type
+*/
+/*
+ PyCArrayType_new ensures that the new Array subclass created has a _length_
+ attribute, and a _type_ attribute.
+*/
+
+static int
+CharArray_set_raw(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ char *ptr;
+ Py_ssize_t size;
+ Py_buffer view;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ if (PyObject_GetBuffer(value, &view, PyBUF_SIMPLE) < 0)
+ return -1;
+ size = view.len;
+ ptr = view.buf;
+ if (size > self->b_size) {
+ PyErr_SetString(PyExc_ValueError,
+ "byte string too long");
+ goto fail;
+ }
+
+ memcpy(self->b_ptr, ptr, size);
+
+ PyBuffer_Release(&view);
+ return 0;
+ fail:
+ PyBuffer_Release(&view);
+ return -1;
+}
+
+static PyObject *
+CharArray_get_raw(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ return PyBytes_FromStringAndSize(self->b_ptr, self->b_size);
+}
+
+static PyObject *
+CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ Py_ssize_t i;
+ char *ptr = self->b_ptr;
+ for (i = 0; i < self->b_size; ++i)
+ if (*ptr++ == '\0')
+ break;
+ return PyBytes_FromStringAndSize(self->b_ptr, i);
+}
+
+static int
+CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ const char *ptr;
+ Py_ssize_t size;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+
+ if (!PyBytes_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "bytes expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ } else
+ Py_INCREF(value);
+ size = PyBytes_GET_SIZE(value);
+ if (size > self->b_size) {
+ PyErr_SetString(PyExc_ValueError,
+ "byte string too long");
+ Py_DECREF(value);
+ return -1;
+ }
+
+ ptr = PyBytes_AS_STRING(value);
+ memcpy(self->b_ptr, ptr, size);
+ if (size < self->b_size)
+ self->b_ptr[size] = '\0';
+ Py_DECREF(value);
+
+ return 0;
+}
+
+static PyGetSetDef CharArray_getsets[] = {
+ { "raw", (getter)CharArray_get_raw, (setter)CharArray_set_raw,
+ "value", NULL },
+ { "value", (getter)CharArray_get_value, (setter)CharArray_set_value,
+ "string value"},
+ { NULL, NULL }
+};
+
+static PyObject *
+WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ Py_ssize_t i;
+ wchar_t *ptr = (wchar_t *)self->b_ptr;
+ for (i = 0; i < self->b_size/(Py_ssize_t)sizeof(wchar_t); ++i)
+ if (*ptr++ == (wchar_t)0)
+ break;
+ return PyUnicode_FromWideChar((wchar_t *)self->b_ptr, i);
+}
+
+static int
+WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+
+ Py_ssize_t size = self->b_size / sizeof(wchar_t);
+ Py_ssize_t len = PyUnicode_AsWideChar(value, NULL, 0);
+ if (len < 0) {
+ return -1;
+ }
+ // PyUnicode_AsWideChar() returns number of wchars including trailing null byte,
+ // when it is called with NULL.
+ assert(len > 0);
+ if (len - 1 > size) {
+ PyErr_SetString(PyExc_ValueError, "string too long");
+ return -1;
+ }
+ if (PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyGetSetDef WCharArray_getsets[] = {
+ { "value", (getter)WCharArray_get_value, (setter)WCharArray_set_value,
+ "string value"},
+ { NULL, NULL }
+};
+
+/*
+ The next function is copied from Python's typeobject.c.
+
+ It is used to attach getsets to a type *after* it
+ has been created: Arrays of characters have additional getsets to treat them
+ as strings.
+ */
+
+static int
+add_getset(PyTypeObject *type, PyGetSetDef *gsp)
+{
+ PyObject *dict = type->tp_dict;
+ for (; gsp->name != NULL; gsp++) {
+ PyObject *descr;
+ descr = PyDescr_NewGetSet(type, gsp);
+ if (descr == NULL)
+ return -1;
+ if (PyDict_SetItemString(dict, gsp->name, descr) < 0) {
+ Py_DECREF(descr);
+ return -1;
+ }
+ Py_DECREF(descr);
+ }
+ return 0;
+}
+
+static PyCArgObject *
+PyCArrayType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *p = PyCArgObject_new();
+ if (p == NULL)
+ return NULL;
+ p->tag = 'P';
+ p->pffi_type = &ffi_type_pointer;
+ p->value.p = (char *)self->b_ptr;
+ p->obj = Py_NewRef(self);
+ return p;
+}
+
+static PyObject *
+PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ StgDictObject *itemdict;
+ PyObject *length_attr, *type_attr;
+ Py_ssize_t length;
+ Py_ssize_t itemsize, itemalign;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL)
+ return NULL;
+
+ /* Initialize these variables to NULL so that we can simplify error
+ handling by using Py_XDECREF. */
+ stgdict = NULL;
+ type_attr = NULL;
+
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_length_), &length_attr) < 0) {
+ goto error;
+ }
+ if (!length_attr) {
+ PyErr_SetString(PyExc_AttributeError,
+ "class must define a '_length_' attribute");
+ goto error;
+ }
+
+ if (!PyLong_Check(length_attr)) {
+ Py_DECREF(length_attr);
+ PyErr_SetString(PyExc_TypeError,
+ "The '_length_' attribute must be an integer");
+ goto error;
+ }
+
+ if (_PyLong_Sign(length_attr) == -1) {
+ Py_DECREF(length_attr);
+ PyErr_SetString(PyExc_ValueError,
+ "The '_length_' attribute must not be negative");
+ goto error;
+ }
+
+ length = PyLong_AsSsize_t(length_attr);
+ Py_DECREF(length_attr);
+ if (length == -1 && PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "The '_length_' attribute is too large");
+ }
+ goto error;
+ }
+
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &type_attr) < 0) {
+ goto error;
+ }
+ if (!type_attr) {
+ PyErr_SetString(PyExc_AttributeError,
+ "class must define a '_type_' attribute");
+ goto error;
+ }
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ goto error;
+
+ itemdict = PyType_stgdict(type_attr);
+ if (!itemdict) {
+ PyErr_SetString(PyExc_TypeError,
+ "_type_ must have storage info");
+ goto error;
+ }
+
+ assert(itemdict->format);
+ stgdict->format = _ctypes_alloc_format_string(NULL, itemdict->format);
+ if (stgdict->format == NULL)
+ goto error;
+ stgdict->ndim = itemdict->ndim + 1;
+ stgdict->shape = PyMem_Malloc(sizeof(Py_ssize_t) * stgdict->ndim);
+ if (stgdict->shape == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ stgdict->shape[0] = length;
+ if (stgdict->ndim > 1) {
+ memmove(&stgdict->shape[1], itemdict->shape,
+ sizeof(Py_ssize_t) * (stgdict->ndim - 1));
+ }
+
+ itemsize = itemdict->size;
+ if (itemsize != 0 && length > PY_SSIZE_T_MAX / itemsize) {
+ PyErr_SetString(PyExc_OverflowError,
+ "array too large");
+ goto error;
+ }
+
+ itemalign = itemdict->align;
+
+ if (itemdict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
+ stgdict->flags |= TYPEFLAG_HASPOINTER;
+
+ stgdict->size = itemsize * length;
+ stgdict->align = itemalign;
+ stgdict->length = length;
+ stgdict->proto = type_attr;
+ type_attr = NULL;
+
+ stgdict->paramfunc = &PyCArrayType_paramfunc;
+
+ /* Arrays are passed as pointers to function calls. */
+ stgdict->ffi_type_pointer = ffi_type_pointer;
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict))
+ goto error;
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict); /* steal the reference */
+ stgdict = NULL;
+
+ /* Special case for character arrays.
+ A permanent annoyance: char arrays are also strings!
+ */
+ if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ if (-1 == add_getset(result, CharArray_getsets))
+ goto error;
+ }
+ else if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ if (-1 == add_getset(result, WCharArray_getsets))
+ goto error;
+ }
+
+ return (PyObject *)result;
+error:
+ Py_XDECREF((PyObject*)stgdict);
+ Py_XDECREF(type_attr);
+ Py_DECREF(result);
+ return NULL;
+}
+
+PyTypeObject PyCArrayType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCArrayType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("metatype for the Array Objects"), /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCArrayType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ PyCSimpleType_Type
+*/
+/*
+
+PyCSimpleType_new ensures that the new Simple_Type subclass created has a valid
+_type_ attribute.
+
+*/
+
+static const char SIMPLE_TYPE_CHARS[] = "cbBhHiIlLdfuzZqQPXOv?g";
+
+static PyObject *
+c_wchar_p_from_param(PyObject *type, PyObject *value)
+{
+ PyObject *as_parameter;
+ int res;
+ if (value == Py_None) {
+ Py_RETURN_NONE;
+ }
+ if (PyUnicode_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("Z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'Z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ if (ArrayObject_Check(value) || PointerObject_Check(value)) {
+ /* c_wchar array instance or pointer(c_wchar(...)) */
+ StgDictObject *dt = PyObject_stgdict(value);
+ StgDictObject *dict;
+ assert(dt); /* Cannot be NULL for pointer or array objects */
+ dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL;
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("u")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ /* byref(c_char(...)) */
+ PyCArgObject *a = (PyCArgObject *)value;
+ StgDictObject *dict = PyObject_stgdict(a->obj);
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("u")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = c_wchar_p_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ /* XXX better message */
+ PyErr_SetString(PyExc_TypeError,
+ "wrong type");
+ return NULL;
+}
+
+static PyObject *
+c_char_p_from_param(PyObject *type, PyObject *value)
+{
+ PyObject *as_parameter;
+ int res;
+ if (value == Py_None) {
+ Py_RETURN_NONE;
+ }
+ if (PyBytes_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+ if (ArrayObject_Check(value) || PointerObject_Check(value)) {
+ /* c_char array instance or pointer(c_char(...)) */
+ StgDictObject *dt = PyObject_stgdict(value);
+ StgDictObject *dict;
+ assert(dt); /* Cannot be NULL for pointer or array objects */
+ dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL;
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("c")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ /* byref(c_char(...)) */
+ PyCArgObject *a = (PyCArgObject *)value;
+ StgDictObject *dict = PyObject_stgdict(a->obj);
+ if (dict && (dict->setfunc == _ctypes_get_fielddesc("c")->setfunc)) {
+ return Py_NewRef(value);
+ }
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = c_char_p_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ /* XXX better message */
+ PyErr_SetString(PyExc_TypeError,
+ "wrong type");
+ return NULL;
+}
+
+static PyObject *
+c_void_p_from_param(PyObject *type, PyObject *value)
+{
+ StgDictObject *stgd;
+ PyObject *as_parameter;
+ int res;
+
+/* None */
+ if (value == Py_None) {
+ Py_RETURN_NONE;
+ }
+ /* Should probably allow buffer interface as well */
+/* int, long */
+ if (PyLong_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("P");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'P';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+ /* XXX struni: remove later */
+/* bytes */
+ if (PyBytes_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+/* unicode */
+ if (PyUnicode_Check(value)) {
+ PyCArgObject *parg;
+ struct fielddesc *fd = _ctypes_get_fielddesc("Z");
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'Z';
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj == NULL) {
+ Py_DECREF(parg);
+ return NULL;
+ }
+ return (PyObject *)parg;
+ }
+/* c_void_p instance (or subclass) */
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ /* c_void_p instances */
+ return Py_NewRef(value);
+ }
+/* ctypes array or pointer instance */
+ if (ArrayObject_Check(value) || PointerObject_Check(value)) {
+ /* Any array or pointer is accepted */
+ return Py_NewRef(value);
+ }
+/* byref(...) */
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, value)) {
+ /* byref(c_xxx()) */
+ PyCArgObject *a = (PyCArgObject *)value;
+ if (a->tag == 'P') {
+ return Py_NewRef(value);
+ }
+ }
+/* function pointer */
+ if (PyCFuncPtrObject_Check(value)) {
+ PyCArgObject *parg;
+ PyCFuncPtrObject *func;
+ func = (PyCFuncPtrObject *)value;
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'P';
+ Py_INCREF(value);
+ parg->value.p = *(void **)func->b_ptr;
+ parg->obj = value;
+ return (PyObject *)parg;
+ }
+/* c_char_p, c_wchar_p */
+ stgd = PyObject_stgdict(value);
+ if (stgd && CDataObject_Check(value) && stgd->proto && PyUnicode_Check(stgd->proto)) {
+ PyCArgObject *parg;
+
+ switch (PyUnicode_AsUTF8(stgd->proto)[0]) {
+ case 'z': /* c_char_p */
+ case 'Z': /* c_wchar_p */
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+ parg->pffi_type = &ffi_type_pointer;
+ parg->tag = 'Z';
+ parg->obj = Py_NewRef(value);
+ /* Remember: b_ptr points to where the pointer is stored! */
+ parg->value.p = *(void **)(((CDataObject *)value)->b_ptr);
+ return (PyObject *)parg;
+ }
+ }
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ return NULL;
+ }
+ if (as_parameter) {
+ value = c_void_p_from_param(type, as_parameter);
+ Py_DECREF(as_parameter);
+ return value;
+ }
+ /* XXX better message */
+ PyErr_SetString(PyExc_TypeError,
+ "wrong type");
+ return NULL;
+}
+
+static PyMethodDef c_void_p_method = { "from_param", c_void_p_from_param, METH_O };
+static PyMethodDef c_char_p_method = { "from_param", c_char_p_from_param, METH_O };
+static PyMethodDef c_wchar_p_method = { "from_param", c_wchar_p_from_param, METH_O };
+
+static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject *kwds,
+ PyObject *proto, struct fielddesc *fmt)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ PyObject *name = PyTuple_GET_ITEM(args, 0);
+ PyObject *newname;
+ PyObject *swapped_args;
+ static PyObject *suffix;
+ Py_ssize_t i;
+
+ swapped_args = PyTuple_New(PyTuple_GET_SIZE(args));
+ if (!swapped_args)
+ return NULL;
+
+ if (suffix == NULL)
+#ifdef WORDS_BIGENDIAN
+ suffix = PyUnicode_InternFromString("_le");
+#else
+ suffix = PyUnicode_InternFromString("_be");
+#endif
+ if (suffix == NULL) {
+ Py_DECREF(swapped_args);
+ return NULL;
+ }
+
+ newname = PyUnicode_Concat(name, suffix);
+ if (newname == NULL) {
+ Py_DECREF(swapped_args);
+ return NULL;
+ }
+
+ PyTuple_SET_ITEM(swapped_args, 0, newname);
+ for (i=1; i<PyTuple_GET_SIZE(args); ++i) {
+ PyObject *v = PyTuple_GET_ITEM(args, i);
+ Py_INCREF(v);
+ PyTuple_SET_ITEM(swapped_args, i, v);
+ }
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, swapped_args, kwds);
+ Py_DECREF(swapped_args);
+ if (result == NULL)
+ return NULL;
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ stgdict->ffi_type_pointer = *fmt->pffi_type;
+ stgdict->align = fmt->pffi_type->alignment;
+ stgdict->length = 0;
+ stgdict->size = fmt->pffi_type->size;
+ stgdict->setfunc = fmt->setfunc_swapped;
+ stgdict->getfunc = fmt->getfunc_swapped;
+
+ stgdict->proto = Py_NewRef(proto);
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ return (PyObject *)result;
+}
+
+static PyCArgObject *
+PyCSimpleType_paramfunc(CDataObject *self)
+{
+ StgDictObject *dict;
+ const char *fmt;
+ PyCArgObject *parg;
+ struct fielddesc *fd;
+
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for CDataObject instances */
+ fmt = PyUnicode_AsUTF8(dict->proto);
+ assert(fmt);
+
+ fd = _ctypes_get_fielddesc(fmt);
+ assert(fd);
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = fmt[0];
+ parg->pffi_type = fd->pffi_type;
+ parg->obj = Py_NewRef(self);
+ memcpy(&parg->value, self->b_ptr, self->b_size);
+ return parg;
+}
+
+static PyObject *
+PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+ PyObject *proto;
+ const char *proto_str;
+ Py_ssize_t proto_len;
+ PyMethodDef *ml;
+ struct fielddesc *fmt;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL)
+ return NULL;
+
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &proto) < 0) {
+ return NULL;
+ }
+ if (!proto) {
+ PyErr_SetString(PyExc_AttributeError,
+ "class must define a '_type_' attribute");
+ error:
+ Py_XDECREF(proto);
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (PyUnicode_Check(proto)) {
+ proto_str = PyUnicode_AsUTF8AndSize(proto, &proto_len);
+ if (!proto_str)
+ goto error;
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "class must define a '_type_' string attribute");
+ goto error;
+ }
+ if (proto_len != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "class must define a '_type_' attribute "
+ "which must be a string of length 1");
+ goto error;
+ }
+ if (!strchr(SIMPLE_TYPE_CHARS, *proto_str)) {
+ PyErr_Format(PyExc_AttributeError,
+ "class must define a '_type_' attribute which must be\n"
+ "a single character string containing one of '%s'.",
+ SIMPLE_TYPE_CHARS);
+ goto error;
+ }
+ fmt = _ctypes_get_fielddesc(proto_str);
+ if (fmt == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "_type_ '%s' not supported", proto_str);
+ goto error;
+ }
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ goto error;
+
+ stgdict->ffi_type_pointer = *fmt->pffi_type;
+ stgdict->align = fmt->pffi_type->alignment;
+ stgdict->length = 0;
+ stgdict->size = fmt->pffi_type->size;
+ stgdict->setfunc = fmt->setfunc;
+ stgdict->getfunc = fmt->getfunc;
+#ifdef WORDS_BIGENDIAN
+ stgdict->format = _ctypes_alloc_format_string_for_type(proto_str[0], 1);
+#else
+ stgdict->format = _ctypes_alloc_format_string_for_type(proto_str[0], 0);
+#endif
+ if (stgdict->format == NULL) {
+ Py_DECREF(result);
+ Py_DECREF(proto);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ stgdict->paramfunc = PyCSimpleType_paramfunc;
+/*
+ if (result->tp_base != &Simple_Type) {
+ stgdict->setfunc = NULL;
+ stgdict->getfunc = NULL;
+ }
+*/
+
+ /* This consumes the refcount on proto which we have */
+ stgdict->proto = proto;
+
+ /* replace the class dict by our updated spam dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ /* Install from_param class methods in ctypes base classes.
+ Overrides the PyCSimpleType_from_param generic method.
+ */
+ if (result->tp_base == &Simple_Type) {
+ switch (*proto_str) {
+ case 'z': /* c_char_p */
+ ml = &c_char_p_method;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ case 'Z': /* c_wchar_p */
+ ml = &c_wchar_p_method;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ case 'P': /* c_void_p */
+ ml = &c_void_p_method;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ case 's':
+ case 'X':
+ case 'O':
+ ml = NULL;
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+ break;
+ default:
+ ml = NULL;
+ break;
+ }
+
+ if (ml) {
+ PyObject *meth;
+ int x;
+ meth = PyDescr_NewClassMethod(result, ml);
+ if (!meth) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ x = PyDict_SetItemString(result->tp_dict,
+ ml->ml_name,
+ meth);
+ Py_DECREF(meth);
+ if (x == -1) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ }
+
+ if (type == &PyCSimpleType_Type && fmt->setfunc_swapped && fmt->getfunc_swapped) {
+ PyObject *swapped = CreateSwappedType(type, args, kwds,
+ proto, fmt);
+ StgDictObject *sw_dict;
+ if (swapped == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ sw_dict = PyType_stgdict(swapped);
+#ifdef WORDS_BIGENDIAN
+ PyObject_SetAttrString((PyObject *)result, "__ctype_le__", swapped);
+ PyObject_SetAttrString((PyObject *)result, "__ctype_be__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_be__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_le__", swapped);
+ /* We are creating the type for the OTHER endian */
+ sw_dict->format = _ctypes_alloc_format_string("<", stgdict->format+1);
+#else
+ PyObject_SetAttrString((PyObject *)result, "__ctype_be__", swapped);
+ PyObject_SetAttrString((PyObject *)result, "__ctype_le__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_le__", (PyObject *)result);
+ PyObject_SetAttrString(swapped, "__ctype_be__", swapped);
+ /* We are creating the type for the OTHER endian */
+ sw_dict->format = _ctypes_alloc_format_string(">", stgdict->format+1);
+#endif
+ Py_DECREF(swapped);
+ if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ };
+
+ return (PyObject *)result;
+}
+
+/*
+ * This is a *class method*.
+ * Convert a parameter into something that ConvParam can handle.
+ */
+static PyObject *
+PyCSimpleType_from_param(PyObject *type, PyObject *value)
+{
+ StgDictObject *dict;
+ const char *fmt;
+ PyCArgObject *parg;
+ struct fielddesc *fd;
+ PyObject *as_parameter;
+ int res;
+
+ /* If the value is already an instance of the requested type,
+ we can use it as is */
+ res = PyObject_IsInstance(value, type);
+ if (res == -1)
+ return NULL;
+ if (res) {
+ return Py_NewRef(value);
+ }
+
+ dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+
+ /* I think we can rely on this being a one-character string */
+ fmt = PyUnicode_AsUTF8(dict->proto);
+ assert(fmt);
+
+ fd = _ctypes_get_fielddesc(fmt);
+ assert(fd);
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = fmt[0];
+ parg->pffi_type = fd->pffi_type;
+ parg->obj = fd->setfunc(&parg->value, value, 0);
+ if (parg->obj)
+ return (PyObject *)parg;
+ PyObject *exc = PyErr_GetRaisedException();
+ Py_DECREF(parg);
+
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
+ Py_XDECREF(exc);
+ return NULL;
+ }
+ if (as_parameter) {
+ if (_Py_EnterRecursiveCall("while processing _as_parameter_")) {
+ Py_DECREF(as_parameter);
+ Py_XDECREF(exc);
+ return NULL;
+ }
+ value = PyCSimpleType_from_param(type, as_parameter);
+ _Py_LeaveRecursiveCall();
+ Py_DECREF(as_parameter);
+ Py_XDECREF(exc);
+ return value;
+ }
+ if (exc) {
+ PyErr_SetRaisedException(exc);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError, "wrong type");
+ }
+ return NULL;
+}
+
+static PyMethodDef PyCSimpleType_methods[] = {
+ { "from_param", PyCSimpleType_from_param, METH_O, from_param_doc },
+ { "from_address", CDataType_from_address, METH_O, from_address_doc },
+ { "from_buffer", CDataType_from_buffer, METH_VARARGS, from_buffer_doc, },
+ { "from_buffer_copy", CDataType_from_buffer_copy, METH_VARARGS, from_buffer_copy_doc, },
+ { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc},
+ { NULL, NULL },
+};
+
+PyTypeObject PyCSimpleType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCSimpleType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("metatype for the PyCSimpleType Objects"), /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCSimpleType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCSimpleType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/******************************************************************/
+/*
+ PyCFuncPtrType_Type
+ */
+
+static PyObject *
+converters_from_argtypes(PyObject *ob)
+{
+ PyObject *converters;
+ Py_ssize_t i;
+
+ ob = PySequence_Tuple(ob); /* new reference */
+ if (!ob) {
+ PyErr_SetString(PyExc_TypeError,
+ "_argtypes_ must be a sequence of types");
+ return NULL;
+ }
+
+ Py_ssize_t nArgs = PyTuple_GET_SIZE(ob);
+ if (nArgs > CTYPES_MAX_ARGCOUNT) {
+ Py_DECREF(ob);
+ PyErr_Format(PyExc_ArgError,
+ "_argtypes_ has too many arguments (%zi), maximum is %i",
+ nArgs, CTYPES_MAX_ARGCOUNT);
+ return NULL;
+ }
+
+ converters = PyTuple_New(nArgs);
+ if (!converters) {
+ Py_DECREF(ob);
+ return NULL;
+ }
+
+ /* I have to check if this is correct. Using c_char, which has a size
+ of 1, will be assumed to be pushed as only one byte!
+ Aren't these promoted to integers by the C compiler and pushed as 4 bytes?
+ */
+
+ for (i = 0; i < nArgs; ++i) {
+ PyObject *cnv;
+ PyObject *tp = PyTuple_GET_ITEM(ob, i);
+/*
+ * The following checks, relating to bpo-16575 and bpo-16576, have been
+ * disabled. The reason is that, although there is a definite problem with
+ * how libffi handles unions (https://github.com/libffi/libffi/issues/33),
+ * there are numerous libraries which pass structures containing unions
+ * by values - especially on Windows but examples also exist on Linux
+ * (https://bugs.python.org/msg359834).
+ *
+ * It may not be possible to get proper support for unions and bitfields
+ * until support is forthcoming in libffi, but for now, adding the checks
+ * has caused problems in otherwise-working software, which suggests it
+ * is better to disable the checks.
+ *
+ * Although specific examples reported relate specifically to unions and
+ * not bitfields, the bitfields check is also being disabled as a
+ * precaution.
+
+ StgDictObject *stgdict = PyType_stgdict(tp);
+
+ if (stgdict != NULL) {
+ if (stgdict->flags & TYPEFLAG_HASUNION) {
+ Py_DECREF(converters);
+ Py_DECREF(ob);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "item %zd in _argtypes_ passes a union by "
+ "value, which is unsupported.",
+ i + 1);
+ }
+ return NULL;
+ }
+ if (stgdict->flags & TYPEFLAG_HASBITFIELD) {
+ Py_DECREF(converters);
+ Py_DECREF(ob);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "item %zd in _argtypes_ passes a struct/"
+ "union with a bitfield by value, which is "
+ "unsupported.",
+ i + 1);
+ }
+ return NULL;
+ }
+ }
+ */
+
+ if (_PyObject_LookupAttr(tp, &_Py_ID(from_param), &cnv) <= 0) {
+ Py_DECREF(converters);
+ Py_DECREF(ob);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_TypeError,
+ "item %zd in _argtypes_ has no from_param method",
+ i+1);
+ }
+ return NULL;
+ }
+ PyTuple_SET_ITEM(converters, i, cnv);
+ }
+ Py_DECREF(ob);
+ return converters;
+}
+
+static int
+make_funcptrtype_dict(StgDictObject *stgdict)
+{
+ PyObject *ob;
+ PyObject *converters = NULL;
+
+ stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
+ stgdict->length = 1;
+ stgdict->size = sizeof(void *);
+ stgdict->setfunc = NULL;
+ stgdict->getfunc = NULL;
+ stgdict->ffi_type_pointer = ffi_type_pointer;
+
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_flags_));
+ if (!ob || !PyLong_Check(ob)) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "class must define _flags_ which must be an integer");
+ }
+ return -1;
+ }
+ stgdict->flags = PyLong_AsUnsignedLongMask(ob) | TYPEFLAG_ISPOINTER;
+
+ /* _argtypes_ is optional... */
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_argtypes_));
+ if (ob) {
+ converters = converters_from_argtypes(ob);
+ if (!converters)
+ return -1;
+ stgdict->argtypes = Py_NewRef(ob);
+ stgdict->converters = converters;
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_restype_));
+ if (ob) {
+ if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_restype_ must be a type, a callable, or None");
+ return -1;
+ }
+ stgdict->restype = Py_NewRef(ob);
+ if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_),
+ &stgdict->checker) < 0)
+ {
+ return -1;
+ }
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+/* XXX later, maybe.
+ ob = _PyDict_GetItemIdWithError((PyObject *)stgdict, &PyId__errcheck_);
+ if (ob) {
+ if (!PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_errcheck_ must be callable");
+ return -1;
+ }
+ stgdict->errcheck = Py_NewRef(ob);
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+*/
+ return 0;
+}
+
+static PyCArgObject *
+PyCFuncPtrType_paramfunc(CDataObject *self)
+{
+ PyCArgObject *parg;
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = Py_NewRef(self);
+ parg->value.p = *(void **)self->b_ptr;
+ return parg;
+}
+
+static PyObject *
+PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyTypeObject *result;
+ StgDictObject *stgdict;
+
+ stgdict = (StgDictObject *)_PyObject_CallNoArgs(
+ (PyObject *)&PyCStgDict_Type);
+ if (!stgdict)
+ return NULL;
+
+ stgdict->paramfunc = PyCFuncPtrType_paramfunc;
+ /* We do NOT expose the function signature in the format string. It
+ is impossible, generally, because the only requirement for the
+ argtypes items is that they have a .from_param method - we do not
+ know the types of the arguments (although, in practice, most
+ argtypes would be a ctypes type).
+ */
+ stgdict->format = _ctypes_alloc_format_string(NULL, "X{}");
+ if (stgdict->format == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ stgdict->flags |= TYPEFLAG_ISPOINTER;
+
+ /* create the new instance (which is a class,
+ since we are a metatype!) */
+ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds);
+ if (result == NULL) {
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+
+ /* replace the class dict by our updated storage dict */
+ if (-1 == PyDict_Update((PyObject *)stgdict, result->tp_dict)) {
+ Py_DECREF(result);
+ Py_DECREF((PyObject *)stgdict);
+ return NULL;
+ }
+ Py_SETREF(result->tp_dict, (PyObject *)stgdict);
+
+ if (-1 == make_funcptrtype_dict(stgdict)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return (PyObject *)result;
+}
+
+PyTypeObject PyCFuncPtrType_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.PyCFuncPtrType", /* tp_name */
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &CDataType_as_sequence, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */
+ PyDoc_STR("metatype for C function pointers"), /* tp_doc */
+ (traverseproc)CDataType_traverse, /* tp_traverse */
+ (inquiry)CDataType_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ CDataType_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCFuncPtrType_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/*****************************************************************
+ * Code to keep needed objects alive
+ */
+
+static CDataObject *
+PyCData_GetContainer(CDataObject *self)
+{
+ while (self->b_base)
+ self = self->b_base;
+ if (self->b_objects == NULL) {
+ if (self->b_length) {
+ self->b_objects = PyDict_New();
+ if (self->b_objects == NULL)
+ return NULL;
+ } else {
+ self->b_objects = Py_NewRef(Py_None);
+ }
+ }
+ return self;
+}
+
+static PyObject *
+GetKeepedObjects(CDataObject *target)
+{
+ CDataObject *container;
+ container = PyCData_GetContainer(target);
+ if (container == NULL)
+ return NULL;
+ return container->b_objects;
+}
+
+static PyObject *
+unique_key(CDataObject *target, Py_ssize_t index)
+{
+ char string[256];
+ char *cp = string;
+ size_t bytes_left;
+
+ Py_BUILD_ASSERT(sizeof(string) - 1 > sizeof(Py_ssize_t) * 2);
+ cp += sprintf(cp, "%x", Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
+ while (target->b_base) {
+ bytes_left = sizeof(string) - (cp - string) - 1;
+ /* Hex format needs 2 characters per byte */
+ if (bytes_left < sizeof(Py_ssize_t) * 2) {
+ PyErr_SetString(PyExc_ValueError,
+ "ctypes object structure too deep");
+ return NULL;
+ }
+ cp += sprintf(cp, ":%x", Py_SAFE_DOWNCAST(target->b_index, Py_ssize_t, int));
+ target = target->b_base;
+ }
+ return PyUnicode_FromStringAndSize(string, cp-string);
+}
+
+/*
+ * Keep a reference to 'keep' in the 'target', at index 'index'.
+ *
+ * If 'keep' is None, do nothing.
+ *
+ * Otherwise create a dictionary (if it does not yet exist) id the root
+ * objects 'b_objects' item, which will store the 'keep' object under a unique
+ * key.
+ *
+ * The unique_key helper travels the target's b_base pointer down to the root,
+ * building a string containing hex-formatted indexes found during traversal,
+ * separated by colons.
+ *
+ * The index tuple is used as a key into the root object's b_objects dict.
+ *
+ * Note: This function steals a refcount of the third argument, even if it
+ * fails!
+ */
+static int
+KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep)
+{
+ int result;
+ CDataObject *ob;
+ PyObject *key;
+
+/* Optimization: no need to store None */
+ if (keep == Py_None) {
+ Py_DECREF(Py_None);
+ return 0;
+ }
+ ob = PyCData_GetContainer(target);
+ if (ob == NULL) {
+ Py_DECREF(keep);
+ return -1;
+ }
+ if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
+ Py_XSETREF(ob->b_objects, keep); /* refcount consumed */
+ return 0;
+ }
+ key = unique_key(target, index);
+ if (key == NULL) {
+ Py_DECREF(keep);
+ return -1;
+ }
+ result = PyDict_SetItem(ob->b_objects, key, keep);
+ Py_DECREF(key);
+ Py_DECREF(keep);
+ return result;
+}
+
+/******************************************************************/
+/*
+ PyCData_Type
+ */
+static int
+PyCData_traverse(CDataObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->b_objects);
+ Py_VISIT((PyObject *)self->b_base);
+ return 0;
+}
+
+static int
+PyCData_clear(CDataObject *self)
+{
+ Py_CLEAR(self->b_objects);
+ if ((self->b_needsfree)
+ && _CDataObject_HasExternalBuffer(self))
+ PyMem_Free(self->b_ptr);
+ self->b_ptr = NULL;
+ Py_CLEAR(self->b_base);
+ return 0;
+}
+
+static void
+PyCData_dealloc(PyObject *self)
+{
+ PyCData_clear((CDataObject *)self);
+ Py_TYPE(self)->tp_free(self);
+}
+
+static PyMemberDef PyCData_members[] = {
+ { "_b_base_", T_OBJECT,
+ offsetof(CDataObject, b_base), READONLY,
+ "the base object" },
+ { "_b_needsfree_", T_INT,
+ offsetof(CDataObject, b_needsfree), READONLY,
+ "whether the object owns the memory or not" },
+ { "_objects", T_OBJECT,
+ offsetof(CDataObject, b_objects), READONLY,
+ "internal objects tree (NEVER CHANGE THIS OBJECT!)"},
+ { NULL },
+};
+
+/* Find the innermost type of an array type, returning a borrowed reference */
+static PyObject *
+PyCData_item_type(PyObject *type)
+{
+ if (PyCArrayTypeObject_Check(type)) {
+ StgDictObject *stg_dict;
+ PyObject *elem_type;
+
+ /* asserts used here as these are all guaranteed by construction */
+ stg_dict = PyType_stgdict(type);
+ assert(stg_dict);
+ elem_type = stg_dict->proto;
+ assert(elem_type);
+ return PyCData_item_type(elem_type);
+ }
+ else {
+ return type;
+ }
+}
+
+static int
+PyCData_NewGetBuffer(PyObject *myself, Py_buffer *view, int flags)
+{
+ CDataObject *self = (CDataObject *)myself;
+ StgDictObject *dict = PyObject_stgdict(myself);
+ PyObject *item_type = PyCData_item_type((PyObject*)Py_TYPE(myself));
+ StgDictObject *item_dict = PyType_stgdict(item_type);
+
+ if (view == NULL) return 0;
+
+ view->buf = self->b_ptr;
+ view->obj = Py_NewRef(myself);
+ view->len = self->b_size;
+ view->readonly = 0;
+ /* use default format character if not set */
+ view->format = dict->format ? dict->format : "B";
+ view->ndim = dict->ndim;
+ view->shape = dict->shape;
+ view->itemsize = item_dict->size;
+ view->strides = NULL;
+ view->suboffsets = NULL;
+ view->internal = NULL;
+ return 0;
+}
+
+static PyBufferProcs PyCData_as_buffer = {
+ PyCData_NewGetBuffer,
+ NULL,
+};
+
+/*
+ * CData objects are mutable, so they cannot be hashable!
+ */
+static Py_hash_t
+PyCData_nohash(PyObject *self)
+{
+ PyErr_SetString(PyExc_TypeError, "unhashable type");
+ return -1;
+}
+
+static PyObject *
+PyCData_reduce(PyObject *myself, PyObject *args)
+{
+ CDataObject *self = (CDataObject *)myself;
+
+ if (PyObject_stgdict(myself)->flags & (TYPEFLAG_ISPOINTER|TYPEFLAG_HASPOINTER)) {
+ PyErr_SetString(PyExc_ValueError,
+ "ctypes objects containing pointers cannot be pickled");
+ return NULL;
+ }
+ PyObject *dict = PyObject_GetAttrString(myself, "__dict__");
+ if (dict == NULL) {
+ return NULL;
+ }
+ return Py_BuildValue("O(O(NN))", _unpickle, Py_TYPE(myself), dict,
+ PyBytes_FromStringAndSize(self->b_ptr, self->b_size));
+}
+
+static PyObject *
+PyCData_setstate(PyObject *myself, PyObject *args)
+{
+ void *data;
+ Py_ssize_t len;
+ int res;
+ PyObject *dict, *mydict;
+ CDataObject *self = (CDataObject *)myself;
+ if (!PyArg_ParseTuple(args, "O!s#",
+ &PyDict_Type, &dict, &data, &len))
+ {
+ return NULL;
+ }
+ if (len > self->b_size)
+ len = self->b_size;
+ memmove(self->b_ptr, data, len);
+ mydict = PyObject_GetAttrString(myself, "__dict__");
+ if (mydict == NULL) {
+ return NULL;
+ }
+ if (!PyDict_Check(mydict)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__dict__ must be a dictionary, not %.200s",
+ Py_TYPE(myself)->tp_name, Py_TYPE(mydict)->tp_name);
+ Py_DECREF(mydict);
+ return NULL;
+ }
+ res = PyDict_Update(mydict, dict);
+ Py_DECREF(mydict);
+ if (res == -1)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*
+ * default __ctypes_from_outparam__ method returns self.
+ */
+static PyObject *
+PyCData_from_outparam(PyObject *self, PyObject *args)
+{
+ return Py_NewRef(self);
+}
+
+static PyMethodDef PyCData_methods[] = {
+ { "__ctypes_from_outparam__", PyCData_from_outparam, METH_NOARGS, },
+ { "__reduce__", PyCData_reduce, METH_NOARGS, },
+ { "__setstate__", PyCData_setstate, METH_VARARGS, },
+ { NULL, NULL },
+};
+
+PyTypeObject PyCData_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes._CData",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ PyCData_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ PyCData_nohash, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCData_methods, /* tp_methods */
+ PyCData_members, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+};
+
+static int PyCData_MallocBuffer(CDataObject *obj, StgDictObject *dict)
+{
+ if ((size_t)dict->size <= sizeof(obj->b_value)) {
+ /* No need to call malloc, can use the default buffer */
+ obj->b_ptr = (char *)&obj->b_value;
+ /* The b_needsfree flag does not mean that we actually did
+ call PyMem_Malloc to allocate the memory block; instead it
+ means we are the *owner* of the memory and are responsible
+ for freeing resources associated with the memory. This is
+ also the reason that b_needsfree is exposed to Python.
+ */
+ obj->b_needsfree = 1;
+ } else {
+ /* In python 2.4, and ctypes 0.9.6, the malloc call took about
+ 33% of the creation time for c_int().
+ */
+ obj->b_ptr = (char *)PyMem_Malloc(dict->size);
+ if (obj->b_ptr == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ obj->b_needsfree = 1;
+ memset(obj->b_ptr, 0, dict->size);
+ }
+ obj->b_size = dict->size;
+ return 0;
+}
+
+PyObject *
+PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr)
+{
+ CDataObject *cmem;
+ StgDictObject *dict;
+
+ assert(PyType_Check(type));
+ dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+ dict->flags |= DICTFLAG_FINAL;
+ cmem = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
+ if (cmem == NULL)
+ return NULL;
+ assert(CDataObject_Check(cmem));
+
+ cmem->b_length = dict->length;
+ cmem->b_size = dict->size;
+ if (base) { /* use base's buffer */
+ assert(CDataObject_Check(base));
+ cmem->b_ptr = adr;
+ cmem->b_needsfree = 0;
+ cmem->b_base = (CDataObject *)Py_NewRef(base);
+ cmem->b_index = index;
+ } else { /* copy contents of adr */
+ if (-1 == PyCData_MallocBuffer(cmem, dict)) {
+ Py_DECREF(cmem);
+ return NULL;
+ }
+ memcpy(cmem->b_ptr, adr, dict->size);
+ cmem->b_index = index;
+ }
+ return (PyObject *)cmem;
+}
+
+/*
+ Box a memory block into a CData instance.
+*/
+PyObject *
+PyCData_AtAddress(PyObject *type, void *buf)
+{
+ CDataObject *pd;
+ StgDictObject *dict;
+
+ if (PySys_Audit("ctypes.cdata", "n", (Py_ssize_t)buf) < 0) {
+ return NULL;
+ }
+
+ assert(PyType_Check(type));
+ dict = PyType_stgdict(type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+ dict->flags |= DICTFLAG_FINAL;
+
+ pd = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
+ if (!pd)
+ return NULL;
+ assert(CDataObject_Check(pd));
+ pd->b_ptr = (char *)buf;
+ pd->b_length = dict->length;
+ pd->b_size = dict->size;
+ return (PyObject *)pd;
+}
+
+/*
+ This function returns TRUE for c_int, c_void_p, and these kind of
+ classes. FALSE otherwise FALSE also for subclasses of c_int and
+ such.
+*/
+int _ctypes_simple_instance(PyObject *obj)
+{
+ PyTypeObject *type = (PyTypeObject *)obj;
+
+ if (PyCSimpleTypeObject_Check(type))
+ return type->tp_base != &Simple_Type;
+ return 0;
+}
+
+PyObject *
+PyCData_get(PyObject *type, GETFUNC getfunc, PyObject *src,
+ Py_ssize_t index, Py_ssize_t size, char *adr)
+{
+ StgDictObject *dict;
+ if (getfunc)
+ return getfunc(adr, size);
+ assert(type);
+ dict = PyType_stgdict(type);
+ if (dict && dict->getfunc && !_ctypes_simple_instance(type))
+ return dict->getfunc(adr, size);
+ return PyCData_FromBaseObj(type, src, index, adr);
+}
+
+/*
+ Helper function for PyCData_set below.
+*/
+static PyObject *
+_PyCData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
+ Py_ssize_t size, char *ptr)
+{
+ CDataObject *src;
+ int err;
+
+ if (setfunc)
+ return setfunc(ptr, value, size);
+
+ if (!CDataObject_Check(value)) {
+ StgDictObject *dict = PyType_stgdict(type);
+ if (dict && dict->setfunc)
+ return dict->setfunc(ptr, value, size);
+ /*
+ If value is a tuple, we try to call the type with the tuple
+ and use the result!
+ */
+ assert(PyType_Check(type));
+ if (PyTuple_Check(value)) {
+ PyObject *ob;
+ PyObject *result;
+ ob = PyObject_CallObject(type, value);
+ if (ob == NULL) {
+ _ctypes_extend_error(PyExc_RuntimeError, "(%s) ",
+ ((PyTypeObject *)type)->tp_name);
+ return NULL;
+ }
+ result = _PyCData_set(dst, type, setfunc, ob,
+ size, ptr);
+ Py_DECREF(ob);
+ return result;
+ } else if (value == Py_None && PyCPointerTypeObject_Check(type)) {
+ *(void **)ptr = NULL;
+ Py_RETURN_NONE;
+ } else {
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instance, got %s",
+ ((PyTypeObject *)type)->tp_name,
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+ }
+ src = (CDataObject *)value;
+
+ err = PyObject_IsInstance(value, type);
+ if (err == -1)
+ return NULL;
+ if (err) {
+ memcpy(ptr,
+ src->b_ptr,
+ size);
+
+ if (PyCPointerTypeObject_Check(type)) {
+ /* XXX */
+ }
+
+ value = GetKeepedObjects(src);
+ if (value == NULL)
+ return NULL;
+
+ return Py_NewRef(value);
+ }
+
+ if (PyCPointerTypeObject_Check(type)
+ && ArrayObject_Check(value)) {
+ StgDictObject *p1, *p2;
+ PyObject *keep;
+ p1 = PyObject_stgdict(value);
+ assert(p1); /* Cannot be NULL for array instances */
+ p2 = PyType_stgdict(type);
+ assert(p2); /* Cannot be NULL for pointer types */
+
+ if (p1->proto != p2->proto) {
+ PyErr_Format(PyExc_TypeError,
+ "incompatible types, %s instance instead of %s instance",
+ Py_TYPE(value)->tp_name,
+ ((PyTypeObject *)type)->tp_name);
+ return NULL;
+ }
+ *(void **)ptr = src->b_ptr;
+
+ keep = GetKeepedObjects(src);
+ if (keep == NULL)
+ return NULL;
+
+ /*
+ We are assigning an array object to a field which represents
+ a pointer. This has the same effect as converting an array
+ into a pointer. So, again, we have to keep the whole object
+ pointed to (which is the array in this case) alive, and not
+ only it's object list. So we create a tuple, containing
+ b_objects list PLUS the array itself, and return that!
+ */
+ return PyTuple_Pack(2, keep, value);
+ }
+ PyErr_Format(PyExc_TypeError,
+ "incompatible types, %s instance instead of %s instance",
+ Py_TYPE(value)->tp_name,
+ ((PyTypeObject *)type)->tp_name);
+ return NULL;
+}
+
+/*
+ * Set a slice in object 'dst', which has the type 'type',
+ * to the value 'value'.
+ */
+int
+PyCData_set(PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
+ Py_ssize_t index, Py_ssize_t size, char *ptr)
+{
+ CDataObject *mem = (CDataObject *)dst;
+ PyObject *result;
+
+ if (!CDataObject_Check(dst)) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctype instance");
+ return -1;
+ }
+
+ result = _PyCData_set(mem, type, setfunc, value,
+ size, ptr);
+ if (result == NULL)
+ return -1;
+
+ /* KeepRef steals a refcount from it's last argument */
+ /* If KeepRef fails, we are stumped. The dst memory block has already
+ been changed */
+ return KeepRef(mem, index, result);
+}
+
+
+/******************************************************************/
+static PyObject *
+GenericPyCData_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ CDataObject *obj;
+ StgDictObject *dict;
+
+ dict = PyType_stgdict((PyObject *)type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return NULL;
+ }
+ dict->flags |= DICTFLAG_FINAL;
+
+ obj = (CDataObject *)type->tp_alloc(type, 0);
+ if (!obj)
+ return NULL;
+
+ obj->b_base = NULL;
+ obj->b_index = 0;
+ obj->b_objects = NULL;
+ obj->b_length = dict->length;
+
+ if (-1 == PyCData_MallocBuffer(obj, dict)) {
+ Py_DECREF(obj);
+ return NULL;
+ }
+ return (PyObject *)obj;
+}
+/*****************************************************************/
+/*
+ PyCFuncPtr_Type
+*/
+
+static int
+PyCFuncPtr_set_errcheck(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ if (ob && !PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the errcheck attribute must be callable");
+ return -1;
+ }
+ Py_XINCREF(ob);
+ Py_XSETREF(self->errcheck, ob);
+ return 0;
+}
+
+static PyObject *
+PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->errcheck) {
+ return Py_NewRef(self->errcheck);
+ }
+ Py_RETURN_NONE;
+}
+
+static int
+PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ PyObject *checker, *oldchecker;
+ if (ob == NULL) {
+ oldchecker = self->checker;
+ self->checker = NULL;
+ Py_CLEAR(self->restype);
+ Py_XDECREF(oldchecker);
+ return 0;
+ }
+ if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
+ PyErr_SetString(PyExc_TypeError,
+ "restype must be a type, a callable, or None");
+ return -1;
+ }
+ if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_), &checker) < 0) {
+ return -1;
+ }
+ oldchecker = self->checker;
+ self->checker = checker;
+ Py_INCREF(ob);
+ Py_XSETREF(self->restype, ob);
+ Py_XDECREF(oldchecker);
+ return 0;
+}
+
+static PyObject *
+PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict;
+ if (self->restype) {
+ return Py_NewRef(self->restype);
+ }
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->restype) {
+ return Py_NewRef(dict->restype);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static int
+PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
+{
+ PyObject *converters;
+
+ if (ob == NULL || ob == Py_None) {
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->argtypes);
+ } else {
+ converters = converters_from_argtypes(ob);
+ if (!converters)
+ return -1;
+ Py_XSETREF(self->converters, converters);
+ Py_INCREF(ob);
+ Py_XSETREF(self->argtypes, ob);
+ }
+ return 0;
+}
+
+static PyObject *
+PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict;
+ if (self->argtypes) {
+ return Py_NewRef(self->argtypes);
+ }
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ if (dict->argtypes) {
+ return Py_NewRef(dict->argtypes);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static PyGetSetDef PyCFuncPtr_getsets[] = {
+ { "errcheck", (getter)PyCFuncPtr_get_errcheck, (setter)PyCFuncPtr_set_errcheck,
+ "a function to check for errors", NULL },
+ { "restype", (getter)PyCFuncPtr_get_restype, (setter)PyCFuncPtr_set_restype,
+ "specify the result type", NULL },
+ { "argtypes", (getter)PyCFuncPtr_get_argtypes,
+ (setter)PyCFuncPtr_set_argtypes,
+ "specify the argument types", NULL },
+ { NULL, NULL }
+};
+
+#ifdef MS_WIN32
+static PPROC FindAddress(void *handle, const char *name, PyObject *type)
+{
+ PPROC address;
+#ifdef MS_WIN64
+ /* win64 has no stdcall calling conv, so it should
+ also not have the name mangling of it.
+ */
+ Py_BEGIN_ALLOW_THREADS
+ address = (PPROC)GetProcAddress(handle, name);
+ Py_END_ALLOW_THREADS
+ return address;
+#else
+ char *mangled_name;
+ int i;
+ StgDictObject *dict;
+
+ Py_BEGIN_ALLOW_THREADS
+ address = (PPROC)GetProcAddress(handle, name);
+ Py_END_ALLOW_THREADS
+ if (address)
+ return address;
+ if (((size_t)name & ~0xFFFF) == 0) {
+ return NULL;
+ }
+
+ dict = PyType_stgdict((PyObject *)type);
+ /* It should not happen that dict is NULL, but better be safe */
+ if (dict==NULL || dict->flags & FUNCFLAG_CDECL)
+ return address;
+
+ /* for stdcall, try mangled names:
+ funcname -> _funcname@<n>
+ where n is 0, 4, 8, 12, ..., 128
+ */
+ mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */
+ if (!mangled_name)
+ return NULL;
+ for (i = 0; i < 32; ++i) {
+ sprintf(mangled_name, "_%s@%d", name, i*4);
+ Py_BEGIN_ALLOW_THREADS
+ address = (PPROC)GetProcAddress(handle, mangled_name);
+ Py_END_ALLOW_THREADS
+ if (address)
+ return address;
+ }
+ return NULL;
+#endif
+}
+#endif
+
+/* Return 1 if usable, 0 else and exception set. */
+static int
+_check_outarg_type(PyObject *arg, Py_ssize_t index)
+{
+ StgDictObject *dict;
+
+ if (PyCPointerTypeObject_Check(arg))
+ return 1;
+
+ if (PyCArrayTypeObject_Check(arg))
+ return 1;
+
+ dict = PyType_stgdict(arg);
+ if (dict
+ /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */
+ && PyUnicode_Check(dict->proto)
+/* We only allow c_void_p, c_char_p and c_wchar_p as a simple output parameter type */
+ && (strchr("PzZ", PyUnicode_AsUTF8(dict->proto)[0]))) {
+ return 1;
+ }
+
+ PyErr_Format(PyExc_TypeError,
+ "'out' parameter %d must be a pointer type, not %s",
+ Py_SAFE_DOWNCAST(index, Py_ssize_t, int),
+ PyType_Check(arg) ?
+ ((PyTypeObject *)arg)->tp_name :
+ Py_TYPE(arg)->tp_name);
+ return 0;
+}
+
+/* Returns 1 on success, 0 on error */
+static int
+_validate_paramflags(PyTypeObject *type, PyObject *paramflags)
+{
+ Py_ssize_t i, len;
+ StgDictObject *dict;
+ PyObject *argtypes;
+
+ dict = PyType_stgdict((PyObject *)type);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "abstract class");
+ return 0;
+ }
+ argtypes = dict->argtypes;
+
+ if (paramflags == NULL || dict->argtypes == NULL)
+ return 1;
+
+ if (!PyTuple_Check(paramflags)) {
+ PyErr_SetString(PyExc_TypeError,
+ "paramflags must be a tuple or None");
+ return 0;
+ }
+
+ len = PyTuple_GET_SIZE(paramflags);
+ if (len != PyTuple_GET_SIZE(dict->argtypes)) {
+ PyErr_SetString(PyExc_ValueError,
+ "paramflags must have the same length as argtypes");
+ return 0;
+ }
+
+ for (i = 0; i < len; ++i) {
+ PyObject *item = PyTuple_GET_ITEM(paramflags, i);
+ int flag;
+ PyObject *name = Py_None;
+ PyObject *defval;
+ PyObject *typ;
+ if (!PyArg_ParseTuple(item, "i|OO", &flag, &name, &defval) ||
+ !(name == Py_None || PyUnicode_Check(name)))
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "paramflags must be a sequence of (int [,string [,value]]) tuples");
+ return 0;
+ }
+ typ = PyTuple_GET_ITEM(argtypes, i);
+ switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
+ case 0:
+ case PARAMFLAG_FIN:
+ case PARAMFLAG_FIN | PARAMFLAG_FLCID:
+ case PARAMFLAG_FIN | PARAMFLAG_FOUT:
+ break;
+ case PARAMFLAG_FOUT:
+ if (!_check_outarg_type(typ, i+1))
+ return 0;
+ break;
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "paramflag value %d not supported",
+ flag);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+_get_name(PyObject *obj, const char **pname)
+{
+#ifdef MS_WIN32
+ if (PyLong_Check(obj)) {
+ /* We have to use MAKEINTRESOURCEA for Windows CE.
+ Works on Windows as well, of course.
+ */
+ *pname = MAKEINTRESOURCEA(PyLong_AsUnsignedLongMask(obj) & 0xFFFF);
+ return 1;
+ }
+#endif
+ if (PyBytes_Check(obj)) {
+ *pname = PyBytes_AS_STRING(obj);
+ return *pname ? 1 : 0;
+ }
+ if (PyUnicode_Check(obj)) {
+ *pname = PyUnicode_AsUTF8(obj);
+ return *pname ? 1 : 0;
+ }
+ PyErr_SetString(PyExc_TypeError,
+ "function name must be string, bytes object or integer");
+ return 0;
+}
+
+
+static PyObject *
+PyCFuncPtr_FromDll(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ const char *name;
+ int (* address)(void);
+ PyObject *ftuple;
+ PyObject *dll;
+ PyObject *obj;
+ PyCFuncPtrObject *self;
+ void *handle;
+ PyObject *paramflags = NULL;
+
+ if (!PyArg_ParseTuple(args, "O|O", &ftuple, &paramflags))
+ return NULL;
+ if (paramflags == Py_None)
+ paramflags = NULL;
+
+ ftuple = PySequence_Tuple(ftuple);
+ if (!ftuple)
+ /* Here ftuple is a borrowed reference */
+ return NULL;
+
+ if (!PyArg_ParseTuple(ftuple, "O&O;illegal func_spec argument",
+ _get_name, &name, &dll))
+ {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+#ifdef MS_WIN32
+ if (PySys_Audit("ctypes.dlsym",
+ ((uintptr_t)name & ~0xFFFF) ? "Os" : "On",
+ dll, name) < 0) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#else
+ if (PySys_Audit("ctypes.dlsym", "Os", dll, name) < 0) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#endif
+
+ obj = PyObject_GetAttrString(dll, "_handle");
+ if (!obj) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+ if (!PyLong_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the _handle attribute of the second argument must be an integer");
+ Py_DECREF(ftuple);
+ Py_DECREF(obj);
+ return NULL;
+ }
+ handle = (void *)PyLong_AsVoidPtr(obj);
+ Py_DECREF(obj);
+ if (PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert the _handle attribute to a pointer");
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+#ifdef MS_WIN32
+ address = FindAddress(handle, name, (PyObject *)type);
+ if (!address) {
+ if (!IS_INTRESOURCE(name))
+ PyErr_Format(PyExc_AttributeError,
+ "function '%s' not found",
+ name);
+ else
+ PyErr_Format(PyExc_AttributeError,
+ "function ordinal %d not found",
+ (WORD)(size_t)name);
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#else
+ address = (PPROC)dlsym(handle, name);
+ if (!address) {
+#ifdef __CYGWIN__
+/* dlerror() isn't very helpful on cygwin */
+ PyErr_Format(PyExc_AttributeError,
+ "function '%s' not found",
+ name);
+#else
+ PyErr_SetString(PyExc_AttributeError, dlerror());
+#endif
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+#endif
+ if (!_validate_paramflags(type, paramflags)) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+ self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
+ if (!self) {
+ Py_DECREF(ftuple);
+ return NULL;
+ }
+
+ self->paramflags = Py_XNewRef(paramflags);
+
+ *(void **)self->b_ptr = address;
+ Py_INCREF(dll);
+ Py_DECREF(ftuple);
+ if (-1 == KeepRef((CDataObject *)self, 0, dll)) {
+ Py_DECREF((PyObject *)self);
+ return NULL;
+ }
+
+ self->callable = Py_NewRef(self);
+ return (PyObject *)self;
+}
+
+#ifdef MS_WIN32
+static PyObject *
+PyCFuncPtr_FromVtblIndex(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyCFuncPtrObject *self;
+ int index;
+ char *name = NULL;
+ PyObject *paramflags = NULL;
+ GUID *iid = NULL;
+ Py_ssize_t iid_len = 0;
+
+ if (!PyArg_ParseTuple(args, "is|Oz#", &index, &name, &paramflags, &iid, &iid_len))
+ return NULL;
+ if (paramflags == Py_None)
+ paramflags = NULL;
+
+ if (!_validate_paramflags(type, paramflags))
+ return NULL;
+
+ self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
+ self->index = index + 0x1000;
+ self->paramflags = Py_XNewRef(paramflags);
+ if (iid_len == sizeof(GUID))
+ self->iid = iid;
+ return (PyObject *)self;
+}
+#endif
+
+/*
+ PyCFuncPtr_new accepts different argument lists in addition to the standard
+ _basespec_ keyword arg:
+
+ one argument form
+ "i" - function address
+ "O" - must be a callable, creates a C callable function
+
+ two or more argument forms (the third argument is a paramflags tuple)
+ "(sO)|..." - (function name, dll object (with an integer handle)), paramflags
+ "(iO)|..." - (function ordinal, dll object (with an integer handle)), paramflags
+ "is|..." - vtable index, method name, creates callable calling COM vtbl
+*/
+static PyObject *
+PyCFuncPtr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyCFuncPtrObject *self;
+ PyObject *callable;
+ StgDictObject *dict;
+ CThunkObject *thunk;
+
+ if (PyTuple_GET_SIZE(args) == 0)
+ return GenericPyCData_new(type, args, kwds);
+
+ if (1 <= PyTuple_GET_SIZE(args) && PyTuple_Check(PyTuple_GET_ITEM(args, 0)))
+ return PyCFuncPtr_FromDll(type, args, kwds);
+
+#ifdef MS_WIN32
+ if (2 <= PyTuple_GET_SIZE(args) && PyLong_Check(PyTuple_GET_ITEM(args, 0)))
+ return PyCFuncPtr_FromVtblIndex(type, args, kwds);
+#endif
+
+ if (1 == PyTuple_GET_SIZE(args)
+ && (PyLong_Check(PyTuple_GET_ITEM(args, 0)))) {
+ CDataObject *ob;
+ void *ptr = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, 0));
+ if (ptr == NULL && PyErr_Occurred())
+ return NULL;
+ ob = (CDataObject *)GenericPyCData_new(type, args, kwds);
+ if (ob == NULL)
+ return NULL;
+ *(void **)ob->b_ptr = ptr;
+ return (PyObject *)ob;
+ }
+
+ if (!PyArg_ParseTuple(args, "O", &callable))
+ return NULL;
+ if (!PyCallable_Check(callable)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must be callable or integer function address");
+ return NULL;
+ }
+
+ /* XXX XXX This would allow passing additional options. For COM
+ method *implementations*, we would probably want different
+ behaviour than in 'normal' callback functions: return a HRESULT if
+ an exception occurs in the callback, and print the traceback not
+ only on the console, but also to OutputDebugString() or something
+ like that.
+ */
+/*
+ if (kwds && _PyDict_GetItemIdWithError(kwds, &PyId_options)) {
+ ...
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+*/
+
+ dict = PyType_stgdict((PyObject *)type);
+ /* XXXX Fails if we do: 'PyCFuncPtr(lambda x: x)' */
+ if (!dict || !dict->argtypes) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot construct instance of this class:"
+ " no argtypes");
+ return NULL;
+ }
+
+ thunk = _ctypes_alloc_callback(callable,
+ dict->argtypes,
+ dict->restype,
+ dict->flags);
+ if (!thunk)
+ return NULL;
+
+ self = (PyCFuncPtrObject *)GenericPyCData_new(type, args, kwds);
+ if (self == NULL) {
+ Py_DECREF(thunk);
+ return NULL;
+ }
+
+ self->callable = Py_NewRef(callable);
+
+ self->thunk = thunk;
+ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
+
+ Py_INCREF((PyObject *)thunk); /* for KeepRef */
+ if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
+ Py_DECREF((PyObject *)self);
+ return NULL;
+ }
+ return (PyObject *)self;
+}
+
+
+/*
+ _byref consumes a refcount to its argument
+*/
+static PyObject *
+_byref(PyObject *obj)
+{
+ PyCArgObject *parg;
+ if (!CDataObject_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "expected CData instance");
+ return NULL;
+ }
+
+ parg = PyCArgObject_new();
+ if (parg == NULL) {
+ Py_DECREF(obj);
+ return NULL;
+ }
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = obj;
+ parg->value.p = ((CDataObject *)obj)->b_ptr;
+ return (PyObject *)parg;
+}
+
+static PyObject *
+_get_arg(int *pindex, PyObject *name, PyObject *defval, PyObject *inargs, PyObject *kwds)
+{
+ PyObject *v;
+
+ if (*pindex < PyTuple_GET_SIZE(inargs)) {
+ v = PyTuple_GET_ITEM(inargs, *pindex);
+ ++*pindex;
+ return Py_NewRef(v);
+ }
+ if (kwds && name) {
+ v = PyDict_GetItemWithError(kwds, name);
+ if (v) {
+ ++*pindex;
+ return Py_NewRef(v);
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ if (defval) {
+ return Py_NewRef(defval);
+ }
+ /* we can't currently emit a better error message */
+ if (name)
+ PyErr_Format(PyExc_TypeError,
+ "required argument '%S' missing", name);
+ else
+ PyErr_Format(PyExc_TypeError,
+ "not enough arguments");
+ return NULL;
+}
+
+/*
+ This function implements higher level functionality plus the ability to call
+ functions with keyword arguments by looking at parameter flags. parameter
+ flags is a tuple of 1, 2 or 3-tuples. The first entry in each is an integer
+ specifying the direction of the data transfer for this parameter - 'in',
+ 'out' or 'inout' (zero means the same as 'in'). The second entry is the
+ parameter name, and the third is the default value if the parameter is
+ missing in the function call.
+
+ This function builds and returns a new tuple 'callargs' which contains the
+ parameters to use in the call. Items on this tuple are copied from the
+ 'inargs' tuple for 'in' and 'in, out' parameters, and constructed from the
+ 'argtypes' tuple for 'out' parameters. It also calculates numretvals which
+ is the number of return values for the function, outmask/inoutmask are
+ bitmasks containing indexes into the callargs tuple specifying which
+ parameters have to be returned. _build_result builds the return value of the
+ function.
+*/
+static PyObject *
+_build_callargs(PyCFuncPtrObject *self, PyObject *argtypes,
+ PyObject *inargs, PyObject *kwds,
+ int *poutmask, int *pinoutmask, unsigned int *pnumretvals)
+{
+ PyObject *paramflags = self->paramflags;
+ PyObject *callargs;
+ StgDictObject *dict;
+ Py_ssize_t i, len;
+ int inargs_index = 0;
+ /* It's a little bit difficult to determine how many arguments the
+ function call requires/accepts. For simplicity, we count the consumed
+ args and compare this to the number of supplied args. */
+ Py_ssize_t actual_args;
+
+ *poutmask = 0;
+ *pinoutmask = 0;
+ *pnumretvals = 0;
+
+ /* Trivial cases, where we either return inargs itself, or a slice of it. */
+ if (argtypes == NULL || paramflags == NULL || PyTuple_GET_SIZE(argtypes) == 0) {
+#ifdef MS_WIN32
+ if (self->index)
+ return PyTuple_GetSlice(inargs, 1, PyTuple_GET_SIZE(inargs));
+#endif
+ return Py_NewRef(inargs);
+ }
+
+ len = PyTuple_GET_SIZE(argtypes);
+ callargs = PyTuple_New(len); /* the argument tuple we build */
+ if (callargs == NULL)
+ return NULL;
+
+#ifdef MS_WIN32
+ /* For a COM method, skip the first arg */
+ if (self->index) {
+ inargs_index = 1;
+ }
+#endif
+ for (i = 0; i < len; ++i) {
+ PyObject *item = PyTuple_GET_ITEM(paramflags, i);
+ PyObject *ob;
+ unsigned int flag;
+ PyObject *name = NULL;
+ PyObject *defval = NULL;
+
+ /* This way seems to be ~2 us faster than the PyArg_ParseTuple
+ calls below. */
+ /* We HAVE already checked that the tuple can be parsed with "i|ZO", so... */
+ Py_ssize_t tsize = PyTuple_GET_SIZE(item);
+ flag = PyLong_AsUnsignedLongMask(PyTuple_GET_ITEM(item, 0));
+ name = tsize > 1 ? PyTuple_GET_ITEM(item, 1) : NULL;
+ defval = tsize > 2 ? PyTuple_GET_ITEM(item, 2) : NULL;
+
+ switch (flag & (PARAMFLAG_FIN | PARAMFLAG_FOUT | PARAMFLAG_FLCID)) {
+ case PARAMFLAG_FIN | PARAMFLAG_FLCID:
+ /* ['in', 'lcid'] parameter. Always taken from defval,
+ if given, else the integer 0. */
+ if (defval == NULL) {
+ defval = _PyLong_GetZero();
+ }
+ Py_INCREF(defval);
+ PyTuple_SET_ITEM(callargs, i, defval);
+ break;
+ case (PARAMFLAG_FIN | PARAMFLAG_FOUT):
+ *pinoutmask |= (1 << i); /* mark as inout arg */
+ (*pnumretvals)++;
+ /* fall through */
+ case 0:
+ case PARAMFLAG_FIN:
+ /* 'in' parameter. Copy it from inargs. */
+ ob =_get_arg(&inargs_index, name, defval, inargs, kwds);
+ if (ob == NULL)
+ goto error;
+ PyTuple_SET_ITEM(callargs, i, ob);
+ break;
+ case PARAMFLAG_FOUT:
+ /* XXX Refactor this code into a separate function. */
+ /* 'out' parameter.
+ argtypes[i] must be a POINTER to a c type.
+
+ Cannot by supplied in inargs, but a defval will be used
+ if available. XXX Should we support getting it from kwds?
+ */
+ if (defval) {
+ /* XXX Using mutable objects as defval will
+ make the function non-threadsafe, unless we
+ copy the object in each invocation */
+ Py_INCREF(defval);
+ PyTuple_SET_ITEM(callargs, i, defval);
+ *poutmask |= (1 << i); /* mark as out arg */
+ (*pnumretvals)++;
+ break;
+ }
+ ob = PyTuple_GET_ITEM(argtypes, i);
+ dict = PyType_stgdict(ob);
+ if (dict == NULL) {
+ /* Cannot happen: _validate_paramflags()
+ would not accept such an object */
+ PyErr_Format(PyExc_RuntimeError,
+ "NULL stgdict unexpected");
+ goto error;
+ }
+ if (PyUnicode_Check(dict->proto)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s 'out' parameter must be passed as default value",
+ ((PyTypeObject *)ob)->tp_name);
+ goto error;
+ }
+ if (PyCArrayTypeObject_Check(ob))
+ ob = _PyObject_CallNoArgs(ob);
+ else
+ /* Create an instance of the pointed-to type */
+ ob = _PyObject_CallNoArgs(dict->proto);
+ /*
+ XXX Is the following correct any longer?
+ We must not pass a byref() to the array then but
+ the array instance itself. Then, we cannot retrieve
+ the result from the PyCArgObject.
+ */
+ if (ob == NULL)
+ goto error;
+ /* The .from_param call that will occur later will pass this
+ as a byref parameter. */
+ PyTuple_SET_ITEM(callargs, i, ob);
+ *poutmask |= (1 << i); /* mark as out arg */
+ (*pnumretvals)++;
+ break;
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "paramflag %u not yet implemented", flag);
+ goto error;
+ break;
+ }
+ }
+
+ /* We have counted the arguments we have consumed in 'inargs_index'. This
+ must be the same as len(inargs) + len(kwds), otherwise we have
+ either too much or not enough arguments. */
+
+ actual_args = PyTuple_GET_SIZE(inargs) + (kwds ? PyDict_GET_SIZE(kwds) : 0);
+ if (actual_args != inargs_index) {
+ /* When we have default values or named parameters, this error
+ message is misleading. See unittests/test_paramflags.py
+ */
+ PyErr_Format(PyExc_TypeError,
+ "call takes exactly %d arguments (%zd given)",
+ inargs_index, actual_args);
+ goto error;
+ }
+
+ /* outmask is a bitmask containing indexes into callargs. Items at
+ these indexes contain values to return.
+ */
+ return callargs;
+ error:
+ Py_DECREF(callargs);
+ return NULL;
+}
+
+/* See also:
+ http://msdn.microsoft.com/library/en-us/com/html/769127a1-1a14-4ed4-9d38-7cf3e571b661.asp
+*/
+/*
+ Build return value of a function.
+
+ Consumes the refcount on result and callargs.
+*/
+static PyObject *
+_build_result(PyObject *result, PyObject *callargs,
+ int outmask, int inoutmask, unsigned int numretvals)
+{
+ unsigned int i, index;
+ int bit;
+ PyObject *tup = NULL;
+
+ if (callargs == NULL)
+ return result;
+ if (result == NULL || numretvals == 0) {
+ Py_DECREF(callargs);
+ return result;
+ }
+ Py_DECREF(result);
+
+ /* tup will not be allocated if numretvals == 1 */
+ /* allocate tuple to hold the result */
+ if (numretvals > 1) {
+ tup = PyTuple_New(numretvals);
+ if (tup == NULL) {
+ Py_DECREF(callargs);
+ return NULL;
+ }
+ }
+
+ index = 0;
+ for (bit = 1, i = 0; i < 32; ++i, bit <<= 1) {
+ PyObject *v;
+ if (bit & inoutmask) {
+ v = PyTuple_GET_ITEM(callargs, i);
+ Py_INCREF(v);
+ if (numretvals == 1) {
+ Py_DECREF(callargs);
+ return v;
+ }
+ PyTuple_SET_ITEM(tup, index, v);
+ index++;
+ } else if (bit & outmask) {
+
+ v = PyTuple_GET_ITEM(callargs, i);
+ v = PyObject_CallMethodNoArgs(v, &_Py_ID(__ctypes_from_outparam__));
+ if (v == NULL || numretvals == 1) {
+ Py_DECREF(callargs);
+ return v;
+ }
+ PyTuple_SET_ITEM(tup, index, v);
+ index++;
+ }
+ if (index == numretvals)
+ break;
+ }
+
+ Py_DECREF(callargs);
+ return tup;
+}
+
+static PyObject *
+PyCFuncPtr_call(PyCFuncPtrObject *self, PyObject *inargs, PyObject *kwds)
+{
+ PyObject *restype;
+ PyObject *converters;
+ PyObject *checker;
+ PyObject *argtypes;
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+ PyObject *result;
+ PyObject *callargs;
+ PyObject *errcheck;
+#ifdef MS_WIN32
+ IUnknown *piunk = NULL;
+#endif
+ void *pProc = NULL;
+
+ int inoutmask;
+ int outmask;
+ unsigned int numretvals;
+
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
+ restype = self->restype ? self->restype : dict->restype;
+ converters = self->converters ? self->converters : dict->converters;
+ checker = self->checker ? self->checker : dict->checker;
+ argtypes = self->argtypes ? self->argtypes : dict->argtypes;
+/* later, we probably want to have an errcheck field in stgdict */
+ errcheck = self->errcheck /* ? self->errcheck : dict->errcheck */;
+
+
+ pProc = *(void **)self->b_ptr;
+#ifdef MS_WIN32
+ if (self->index) {
+ /* It's a COM method */
+ CDataObject *this;
+ this = (CDataObject *)PyTuple_GetItem(inargs, 0); /* borrowed ref! */
+ if (!this) {
+ PyErr_SetString(PyExc_ValueError,
+ "native com method call without 'this' parameter");
+ return NULL;
+ }
+ if (!CDataObject_Check(this)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Expected a COM this pointer as first argument");
+ return NULL;
+ }
+ /* there should be more checks? No, in Python */
+ /* First arg is a pointer to an interface instance */
+ if (!this->b_ptr || *(void **)this->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL COM pointer access");
+ return NULL;
+ }
+ piunk = *(IUnknown **)this->b_ptr;
+ if (NULL == piunk->lpVtbl) {
+ PyErr_SetString(PyExc_ValueError,
+ "COM method call without VTable");
+ return NULL;
+ }
+ pProc = ((void **)piunk->lpVtbl)[self->index - 0x1000];
+ }
+#endif
+ callargs = _build_callargs(self, argtypes,
+ inargs, kwds,
+ &outmask, &inoutmask, &numretvals);
+ if (callargs == NULL)
+ return NULL;
+
+ if (converters) {
+ int required = Py_SAFE_DOWNCAST(PyTuple_GET_SIZE(converters),
+ Py_ssize_t, int);
+ int actual = Py_SAFE_DOWNCAST(PyTuple_GET_SIZE(callargs),
+ Py_ssize_t, int);
+
+ if ((dict->flags & FUNCFLAG_CDECL) == FUNCFLAG_CDECL) {
+ /* For cdecl functions, we allow more actual arguments
+ than the length of the argtypes tuple.
+ */
+ if (required > actual) {
+ Py_DECREF(callargs);
+ PyErr_Format(PyExc_TypeError,
+ "this function takes at least %d argument%s (%d given)",
+ required,
+ required == 1 ? "" : "s",
+ actual);
+ return NULL;
+ }
+ } else if (required != actual) {
+ Py_DECREF(callargs);
+ PyErr_Format(PyExc_TypeError,
+ "this function takes %d argument%s (%d given)",
+ required,
+ required == 1 ? "" : "s",
+ actual);
+ return NULL;
+ }
+ }
+
+ result = _ctypes_callproc(pProc,
+ callargs,
+#ifdef MS_WIN32
+ piunk,
+ self->iid,
+#endif
+ dict->flags,
+ converters,
+ restype,
+ checker);
+/* The 'errcheck' protocol */
+ if (result != NULL && errcheck) {
+ PyObject *v = PyObject_CallFunctionObjArgs(errcheck,
+ result,
+ self,
+ callargs,
+ NULL);
+ /* If the errcheck function failed, return NULL.
+ If the errcheck function returned callargs unchanged,
+ continue normal processing.
+ If the errcheck function returned something else,
+ use that as result.
+ */
+ if (v == NULL || v != callargs) {
+ Py_DECREF(result);
+ Py_DECREF(callargs);
+ return v;
+ }
+ Py_DECREF(v);
+ }
+
+ return _build_result(result, callargs,
+ outmask, inoutmask, numretvals);
+}
+
+static int
+PyCFuncPtr_traverse(PyCFuncPtrObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->callable);
+ Py_VISIT(self->restype);
+ Py_VISIT(self->checker);
+ Py_VISIT(self->errcheck);
+ Py_VISIT(self->argtypes);
+ Py_VISIT(self->converters);
+ Py_VISIT(self->paramflags);
+ Py_VISIT(self->thunk);
+ return PyCData_traverse((CDataObject *)self, visit, arg);
+}
+
+static int
+PyCFuncPtr_clear(PyCFuncPtrObject *self)
+{
+ Py_CLEAR(self->callable);
+ Py_CLEAR(self->restype);
+ Py_CLEAR(self->checker);
+ Py_CLEAR(self->errcheck);
+ Py_CLEAR(self->argtypes);
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->paramflags);
+ Py_CLEAR(self->thunk);
+ return PyCData_clear((CDataObject *)self);
+}
+
+static void
+PyCFuncPtr_dealloc(PyCFuncPtrObject *self)
+{
+ PyCFuncPtr_clear(self);
+ Py_TYPE(self)->tp_free((PyObject *)self);
+}
+
+static PyObject *
+PyCFuncPtr_repr(PyCFuncPtrObject *self)
+{
+#ifdef MS_WIN32
+ if (self->index)
+ return PyUnicode_FromFormat("<COM method offset %d: %s at %p>",
+ self->index - 0x1000,
+ Py_TYPE(self)->tp_name,
+ self);
+#endif
+ return PyUnicode_FromFormat("<%s object at %p>",
+ Py_TYPE(self)->tp_name,
+ self);
+}
+
+static int
+PyCFuncPtr_bool(PyCFuncPtrObject *self)
+{
+ return ((*(void **)self->b_ptr != NULL)
+#ifdef MS_WIN32
+ || (self->index != 0)
+#endif
+ );
+}
+
+static PyNumberMethods PyCFuncPtr_as_number = {
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ (inquiry)PyCFuncPtr_bool, /* nb_bool */
+};
+
+PyTypeObject PyCFuncPtr_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.CFuncPtr",
+ sizeof(PyCFuncPtrObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)PyCFuncPtr_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)PyCFuncPtr_repr, /* tp_repr */
+ &PyCFuncPtr_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ (ternaryfunc)PyCFuncPtr_call, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("Function Pointer"), /* tp_doc */
+ (traverseproc)PyCFuncPtr_traverse, /* tp_traverse */
+ (inquiry)PyCFuncPtr_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ PyCFuncPtr_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyCFuncPtr_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/*****************************************************************/
+/*
+ Struct_Type
+*/
+/*
+ This function is called to initialize a Structure or Union with positional
+ arguments. It calls itself recursively for all Structure or Union base
+ classes, then retrieves the _fields_ member to associate the argument
+ position with the correct field name.
+
+ Returns -1 on error, or the index of next argument on success.
+ */
+static Py_ssize_t
+_init_pos_args(PyObject *self, PyTypeObject *type,
+ PyObject *args, PyObject *kwds,
+ Py_ssize_t index)
+{
+ StgDictObject *dict;
+ PyObject *fields;
+ Py_ssize_t i;
+
+ if (PyType_stgdict((PyObject *)type->tp_base)) {
+ index = _init_pos_args(self, type->tp_base,
+ args, kwds,
+ index);
+ if (index == -1)
+ return -1;
+ }
+
+ dict = PyType_stgdict((PyObject *)type);
+ fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
+ if (fields == NULL) {
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return index;
+ }
+
+ for (i = index;
+ i < dict->length && i < PyTuple_GET_SIZE(args);
+ ++i) {
+ PyObject *pair = PySequence_GetItem(fields, i - index);
+ PyObject *name, *val;
+ int res;
+ if (!pair)
+ return -1;
+ name = PySequence_GetItem(pair, 0);
+ if (!name) {
+ Py_DECREF(pair);
+ return -1;
+ }
+ val = PyTuple_GET_ITEM(args, i);
+ if (kwds) {
+ res = PyDict_Contains(kwds, name);
+ if (res != 0) {
+ if (res > 0) {
+ PyErr_Format(PyExc_TypeError,
+ "duplicate values for field %R",
+ name);
+ }
+ Py_DECREF(pair);
+ Py_DECREF(name);
+ return -1;
+ }
+ }
+
+ res = PyObject_SetAttr(self, name, val);
+ Py_DECREF(pair);
+ Py_DECREF(name);
+ if (res == -1)
+ return -1;
+ }
+ return dict->length;
+}
+
+static int
+Struct_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+/* Optimization possible: Store the attribute names _fields_[x][0]
+ * in C accessible fields somewhere ?
+ */
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "args not a tuple?");
+ return -1;
+ }
+ if (PyTuple_GET_SIZE(args)) {
+ Py_ssize_t res = _init_pos_args(self, Py_TYPE(self),
+ args, kwds, 0);
+ if (res == -1)
+ return -1;
+ if (res < PyTuple_GET_SIZE(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "too many initializers");
+ return -1;
+ }
+ }
+
+ if (kwds) {
+ PyObject *key, *value;
+ Py_ssize_t pos = 0;
+ while(PyDict_Next(kwds, &pos, &key, &value)) {
+ if (-1 == PyObject_SetAttr(self, key, value))
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyTypeObject Struct_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.Structure",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("Structure base class"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ Struct_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+static PyTypeObject Union_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.Union",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("Union base class"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ Struct_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ PyCArray_Type
+*/
+static int
+Array_init(CDataObject *self, PyObject *args, PyObject *kw)
+{
+ Py_ssize_t i;
+ Py_ssize_t n;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "args not a tuple?");
+ return -1;
+ }
+ n = PyTuple_GET_SIZE(args);
+ for (i = 0; i < n; ++i) {
+ PyObject *v;
+ v = PyTuple_GET_ITEM(args, i);
+ if (-1 == PySequence_SetItem((PyObject *)self, i, v))
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+Array_item(PyObject *myself, Py_ssize_t index)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t offset, size;
+ StgDictObject *stgdict;
+
+
+ if (index < 0 || index >= self->b_length) {
+ PyErr_SetString(PyExc_IndexError,
+ "invalid index");
+ return NULL;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for array instances */
+ /* Would it be clearer if we got the item size from
+ stgdict->proto's stgdict?
+ */
+ size = stgdict->size / stgdict->length;
+ offset = index * size;
+
+ return PyCData_get(stgdict->proto, stgdict->getfunc, (PyObject *)self,
+ index, size, self->b_ptr + offset);
+}
+
+static PyObject *
+Array_subscript(PyObject *myself, PyObject *item)
+{
+ CDataObject *self = (CDataObject *)myself;
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred())
+ return NULL;
+ if (i < 0)
+ i += self->b_length;
+ return Array_item(myself, i);
+ }
+ else if (PySlice_Check(item)) {
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+ PyObject *np;
+ Py_ssize_t start, stop, step, slicelen, i;
+ size_t cur;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return NULL;
+ }
+ slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step);
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for array object instances */
+ proto = stgdict->proto;
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* proto is the item type of the array, a
+ ctypes type, so this cannot be NULL */
+
+ if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ char *ptr = (char *)self->b_ptr;
+ char *dest;
+
+ if (slicelen <= 0)
+ return PyBytes_FromStringAndSize("", 0);
+ if (step == 1) {
+ return PyBytes_FromStringAndSize(ptr + start,
+ slicelen);
+ }
+ dest = (char *)PyMem_Malloc(slicelen);
+
+ if (dest == NULL)
+ return PyErr_NoMemory();
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+
+ np = PyBytes_FromStringAndSize(dest, slicelen);
+ PyMem_Free(dest);
+ return np;
+ }
+ if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ wchar_t *ptr = (wchar_t *)self->b_ptr;
+ wchar_t *dest;
+
+ if (slicelen <= 0)
+ return PyUnicode_New(0, 0);
+ if (step == 1) {
+ return PyUnicode_FromWideChar(ptr + start,
+ slicelen);
+ }
+
+ dest = PyMem_New(wchar_t, slicelen);
+ if (dest == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+
+ np = PyUnicode_FromWideChar(dest, slicelen);
+ PyMem_Free(dest);
+ return np;
+ }
+
+ np = PyList_New(slicelen);
+ if (np == NULL)
+ return NULL;
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ PyObject *v = Array_item(myself, cur);
+ if (v == NULL) {
+ Py_DECREF(np);
+ return NULL;
+ }
+ PyList_SET_ITEM(np, i, v);
+ }
+ return np;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "indices must be integers");
+ return NULL;
+ }
+
+}
+
+static int
+Array_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t size, offset;
+ StgDictObject *stgdict;
+ char *ptr;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Array does not support item deletion");
+ return -1;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for array object instances */
+ if (index < 0 || index >= stgdict->length) {
+ PyErr_SetString(PyExc_IndexError,
+ "invalid index");
+ return -1;
+ }
+ size = stgdict->size / stgdict->length;
+ offset = index * size;
+ ptr = self->b_ptr + offset;
+
+ return PyCData_set((PyObject *)self, stgdict->proto, stgdict->setfunc, value,
+ index, size, ptr);
+}
+
+static int
+Array_ass_subscript(PyObject *myself, PyObject *item, PyObject *value)
+{
+ CDataObject *self = (CDataObject *)myself;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Array does not support item deletion");
+ return -1;
+ }
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred())
+ return -1;
+ if (i < 0)
+ i += self->b_length;
+ return Array_ass_item(myself, i, value);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen, otherlen, i;
+ size_t cur;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return -1;
+ }
+ slicelen = PySlice_AdjustIndices(self->b_length, &start, &stop, step);
+ if ((step < 0 && start < stop) ||
+ (step > 0 && start > stop))
+ stop = start;
+
+ otherlen = PySequence_Length(value);
+ if (otherlen != slicelen) {
+ PyErr_SetString(PyExc_ValueError,
+ "Can only assign sequence of same size");
+ return -1;
+ }
+ for (cur = start, i = 0; i < otherlen; cur += step, i++) {
+ PyObject *item = PySequence_GetItem(value, i);
+ int result;
+ if (item == NULL)
+ return -1;
+ result = Array_ass_item(myself, cur, item);
+ Py_DECREF(item);
+ if (result == -1)
+ return -1;
+ }
+ return 0;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "indices must be integer");
+ return -1;
+ }
+}
+
+static Py_ssize_t
+Array_length(PyObject *myself)
+{
+ CDataObject *self = (CDataObject *)myself;
+ return self->b_length;
+}
+
+static PyMethodDef Array_methods[] = {
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ { NULL, NULL }
+};
+
+static PySequenceMethods Array_as_sequence = {
+ Array_length, /* sq_length; */
+ 0, /* sq_concat; */
+ 0, /* sq_repeat; */
+ Array_item, /* sq_item; */
+ 0, /* sq_slice; */
+ Array_ass_item, /* sq_ass_item; */
+ 0, /* sq_ass_slice; */
+ 0, /* sq_contains; */
+
+ 0, /* sq_inplace_concat; */
+ 0, /* sq_inplace_repeat; */
+};
+
+static PyMappingMethods Array_as_mapping = {
+ Array_length,
+ Array_subscript,
+ Array_ass_subscript,
+};
+
+PyTypeObject PyCArray_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes.Array",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ &Array_as_sequence, /* tp_as_sequence */
+ &Array_as_mapping, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ Array_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Array_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+PyObject *
+PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length)
+{
+ static PyObject *cache;
+ PyObject *key;
+ PyObject *result;
+ char name[256];
+ PyObject *len;
+
+ if (cache == NULL) {
+ cache = PyDict_New();
+ if (cache == NULL)
+ return NULL;
+ }
+ len = PyLong_FromSsize_t(length);
+ if (len == NULL)
+ return NULL;
+ key = PyTuple_Pack(2, itemtype, len);
+ Py_DECREF(len);
+ if (!key)
+ return NULL;
+ result = PyDict_GetItemProxy(cache, key);
+ if (result) {
+ Py_INCREF(result);
+ Py_DECREF(key);
+ return result;
+ }
+ else if (PyErr_Occurred()) {
+ Py_DECREF(key);
+ return NULL;
+ }
+
+ if (!PyType_Check(itemtype)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Expected a type object");
+ Py_DECREF(key);
+ return NULL;
+ }
+#ifdef MS_WIN64
+ sprintf(name, "%.200s_Array_%Id",
+ ((PyTypeObject *)itemtype)->tp_name, length);
+#else
+ sprintf(name, "%.200s_Array_%ld",
+ ((PyTypeObject *)itemtype)->tp_name, (long)length);
+#endif
+
+ result = PyObject_CallFunction((PyObject *)&PyCArrayType_Type,
+ "s(O){s:n,s:O}",
+ name,
+ &PyCArray_Type,
+ "_length_",
+ length,
+ "_type_",
+ itemtype
+ );
+ if (result == NULL) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ if (-1 == PyDict_SetItemProxy(cache, key, result)) {
+ Py_DECREF(key);
+ Py_DECREF(result);
+ return NULL;
+ }
+ Py_DECREF(key);
+ return result;
+}
+
+
+/******************************************************************/
+/*
+ Simple_Type
+*/
+
+static int
+Simple_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ PyObject *result;
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+ assert(dict); /* Cannot be NULL for CDataObject instances */
+ assert(dict->setfunc);
+ result = dict->setfunc(self->b_ptr, value, dict->size);
+ if (!result)
+ return -1;
+
+ /* consumes the refcount the setfunc returns */
+ return KeepRef(self, 0, result);
+}
+
+static int
+Simple_init(CDataObject *self, PyObject *args, PyObject *kw)
+{
+ PyObject *value = NULL;
+ if (!PyArg_UnpackTuple(args, "__init__", 0, 1, &value))
+ return -1;
+ if (value)
+ return Simple_set_value(self, value, NULL);
+ return 0;
+}
+
+static PyObject *
+Simple_get_value(CDataObject *self, void *Py_UNUSED(ignored))
+{
+ StgDictObject *dict;
+ dict = PyObject_stgdict((PyObject *)self);
+ assert(dict); /* Cannot be NULL for CDataObject instances */
+ assert(dict->getfunc);
+ return dict->getfunc(self->b_ptr, self->b_size);
+}
+
+static PyGetSetDef Simple_getsets[] = {
+ { "value", (getter)Simple_get_value, (setter)Simple_set_value,
+ "current value", NULL },
+ { NULL, NULL }
+};
+
+static PyObject *
+Simple_from_outparm(PyObject *self, PyObject *args)
+{
+ if (_ctypes_simple_instance((PyObject *)Py_TYPE(self))) {
+ return Py_NewRef(self);
+ }
+ /* call stgdict->getfunc */
+ return Simple_get_value((CDataObject *)self, NULL);
+}
+
+static PyMethodDef Simple_methods[] = {
+ { "__ctypes_from_outparam__", Simple_from_outparm, METH_NOARGS, },
+ { NULL, NULL },
+};
+
+static int Simple_bool(CDataObject *self)
+{
+ return memcmp(self->b_ptr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", self->b_size);
+}
+
+static PyNumberMethods Simple_as_number = {
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ (inquiry)Simple_bool, /* nb_bool */
+};
+
+/* "%s(%s)" % (self.__class__.__name__, self.value) */
+static PyObject *
+Simple_repr(CDataObject *self)
+{
+ PyObject *val, *result;
+
+ if (Py_TYPE(self)->tp_base != &Simple_Type) {
+ return PyUnicode_FromFormat("<%s object at %p>",
+ Py_TYPE(self)->tp_name, self);
+ }
+
+ val = Simple_get_value(self, NULL);
+ if (val == NULL)
+ return NULL;
+
+ result = PyUnicode_FromFormat("%s(%R)",
+ Py_TYPE(self)->tp_name, val);
+ Py_DECREF(val);
+ return result;
+}
+
+static PyTypeObject Simple_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes._SimpleCData",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)&Simple_repr, /* tp_repr */
+ &Simple_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ Simple_methods, /* tp_methods */
+ 0, /* tp_members */
+ Simple_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Simple_init, /* tp_init */
+ 0, /* tp_alloc */
+ GenericPyCData_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/******************************************************************/
+/*
+ PyCPointer_Type
+*/
+static PyObject *
+Pointer_item(PyObject *myself, Py_ssize_t index)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t size;
+ Py_ssize_t offset;
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+
+ if (*(void **)self->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL pointer access");
+ return NULL;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer object instances */
+
+ proto = stgdict->proto;
+ assert(proto);
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* proto is the item type of the pointer, a ctypes
+ type, so this cannot be NULL */
+
+ size = itemdict->size;
+ offset = index * itemdict->size;
+
+ return PyCData_get(proto, stgdict->getfunc, (PyObject *)self,
+ index, size, (*(char **)self->b_ptr) + offset);
+}
+
+static int
+Pointer_ass_item(PyObject *myself, Py_ssize_t index, PyObject *value)
+{
+ CDataObject *self = (CDataObject *)myself;
+ Py_ssize_t size;
+ Py_ssize_t offset;
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Pointer does not support item deletion");
+ return -1;
+ }
+
+ if (*(void **)self->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL pointer access");
+ return -1;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+
+ proto = stgdict->proto;
+ assert(proto);
+
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict); /* Cannot be NULL because the itemtype of a pointer
+ is always a ctypes type */
+
+ size = itemdict->size;
+ offset = index * itemdict->size;
+
+ return PyCData_set((PyObject *)self, proto, stgdict->setfunc, value,
+ index, size, (*(char **)self->b_ptr) + offset);
+}
+
+static PyObject *
+Pointer_get_contents(CDataObject *self, void *closure)
+{
+ StgDictObject *stgdict;
+
+ if (*(void **)self->b_ptr == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "NULL pointer access");
+ return NULL;
+ }
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+ return PyCData_FromBaseObj(stgdict->proto,
+ (PyObject *)self, 0,
+ *(void **)self->b_ptr);
+}
+
+static int
+Pointer_set_contents(CDataObject *self, PyObject *value, void *closure)
+{
+ StgDictObject *stgdict;
+ CDataObject *dst;
+ PyObject *keep;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Pointer does not support item deletion");
+ return -1;
+ }
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+ assert(stgdict->proto);
+ if (!CDataObject_Check(value)) {
+ int res = PyObject_IsInstance(value, stgdict->proto);
+ if (res == -1)
+ return -1;
+ if (!res) {
+ PyErr_Format(PyExc_TypeError,
+ "expected %s instead of %s",
+ ((PyTypeObject *)(stgdict->proto))->tp_name,
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ }
+
+ dst = (CDataObject *)value;
+ *(void **)self->b_ptr = dst->b_ptr;
+
+ /*
+ A Pointer instance must keep the value it points to alive. So, a
+ pointer instance has b_length set to 2 instead of 1, and we set
+ 'value' itself as the second item of the b_objects list, additionally.
+ */
+ Py_INCREF(value);
+ if (-1 == KeepRef(self, 1, value))
+ return -1;
+
+ keep = GetKeepedObjects(dst);
+ if (keep == NULL)
+ return -1;
+
+ Py_INCREF(keep);
+ return KeepRef(self, 0, keep);
+}
+
+static PyGetSetDef Pointer_getsets[] = {
+ { "contents", (getter)Pointer_get_contents,
+ (setter)Pointer_set_contents,
+ "the object this pointer points to (read-write)", NULL },
+ { NULL, NULL }
+};
+
+static int
+Pointer_init(CDataObject *self, PyObject *args, PyObject *kw)
+{
+ PyObject *value = NULL;
+
+ if (!PyArg_UnpackTuple(args, "POINTER", 0, 1, &value))
+ return -1;
+ if (value == NULL)
+ return 0;
+ return Pointer_set_contents(self, value, NULL);
+}
+
+static PyObject *
+Pointer_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ StgDictObject *dict = PyType_stgdict((PyObject *)type);
+ if (!dict || !dict->proto) {
+ PyErr_SetString(PyExc_TypeError,
+ "Cannot create instance: has no _type_");
+ return NULL;
+ }
+ return GenericPyCData_new(type, args, kw);
+}
+
+static PyObject *
+Pointer_subscript(PyObject *myself, PyObject *item)
+{
+ CDataObject *self = (CDataObject *)myself;
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred())
+ return NULL;
+ return Pointer_item(myself, i);
+ }
+ else if (PySlice_Check(item)) {
+ PySliceObject *slice = (PySliceObject *)item;
+ Py_ssize_t start, stop, step;
+ PyObject *np;
+ StgDictObject *stgdict, *itemdict;
+ PyObject *proto;
+ Py_ssize_t i, len;
+ size_t cur;
+
+ /* Since pointers have no length, and we want to apply
+ different semantics to negative indices than normal
+ slicing, we have to dissect the slice object ourselves.*/
+ if (slice->step == Py_None) {
+ step = 1;
+ }
+ else {
+ step = PyNumber_AsSsize_t(slice->step,
+ PyExc_ValueError);
+ if (step == -1 && PyErr_Occurred())
+ return NULL;
+ if (step == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice step cannot be zero");
+ return NULL;
+ }
+ }
+ if (slice->start == Py_None) {
+ if (step < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice start is required "
+ "for step < 0");
+ return NULL;
+ }
+ start = 0;
+ }
+ else {
+ start = PyNumber_AsSsize_t(slice->start,
+ PyExc_ValueError);
+ if (start == -1 && PyErr_Occurred())
+ return NULL;
+ }
+ if (slice->stop == Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "slice stop is required");
+ return NULL;
+ }
+ stop = PyNumber_AsSsize_t(slice->stop,
+ PyExc_ValueError);
+ if (stop == -1 && PyErr_Occurred())
+ return NULL;
+ if ((step > 0 && start > stop) ||
+ (step < 0 && start < stop))
+ len = 0;
+ else if (step > 0)
+ len = (stop - start - 1) / step + 1;
+ else
+ len = (stop - start + 1) / step + 1;
+
+ stgdict = PyObject_stgdict((PyObject *)self);
+ assert(stgdict); /* Cannot be NULL for pointer instances */
+ proto = stgdict->proto;
+ assert(proto);
+ itemdict = PyType_stgdict(proto);
+ assert(itemdict);
+ if (itemdict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ char *ptr = *(char **)self->b_ptr;
+ char *dest;
+
+ if (len <= 0)
+ return PyBytes_FromStringAndSize("", 0);
+ if (step == 1) {
+ return PyBytes_FromStringAndSize(ptr + start,
+ len);
+ }
+ dest = (char *)PyMem_Malloc(len);
+ if (dest == NULL)
+ return PyErr_NoMemory();
+ for (cur = start, i = 0; i < len; cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+ np = PyBytes_FromStringAndSize(dest, len);
+ PyMem_Free(dest);
+ return np;
+ }
+ if (itemdict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ wchar_t *ptr = *(wchar_t **)self->b_ptr;
+ wchar_t *dest;
+
+ if (len <= 0)
+ return PyUnicode_New(0, 0);
+ if (step == 1) {
+ return PyUnicode_FromWideChar(ptr + start,
+ len);
+ }
+ dest = PyMem_New(wchar_t, len);
+ if (dest == NULL)
+ return PyErr_NoMemory();
+ for (cur = start, i = 0; i < len; cur += step, i++) {
+ dest[i] = ptr[cur];
+ }
+ np = PyUnicode_FromWideChar(dest, len);
+ PyMem_Free(dest);
+ return np;
+ }
+
+ np = PyList_New(len);
+ if (np == NULL)
+ return NULL;
+
+ for (cur = start, i = 0; i < len; cur += step, i++) {
+ PyObject *v = Pointer_item(myself, cur);
+ PyList_SET_ITEM(np, i, v);
+ }
+ return np;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "Pointer indices must be integer");
+ return NULL;
+ }
+}
+
+static PySequenceMethods Pointer_as_sequence = {
+ 0, /* inquiry sq_length; */
+ 0, /* binaryfunc sq_concat; */
+ 0, /* intargfunc sq_repeat; */
+ Pointer_item, /* intargfunc sq_item; */
+ 0, /* intintargfunc sq_slice; */
+ Pointer_ass_item, /* intobjargproc sq_ass_item; */
+ 0, /* intintobjargproc sq_ass_slice; */
+ 0, /* objobjproc sq_contains; */
+ /* Added in release 2.0 */
+ 0, /* binaryfunc sq_inplace_concat; */
+ 0, /* intargfunc sq_inplace_repeat; */
+};
+
+static PyMappingMethods Pointer_as_mapping = {
+ 0,
+ Pointer_subscript,
+};
+
+static int
+Pointer_bool(CDataObject *self)
+{
+ return (*(void **)self->b_ptr != NULL);
+}
+
+static PyNumberMethods Pointer_as_number = {
+ 0, /* nb_add */
+ 0, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ (inquiry)Pointer_bool, /* nb_bool */
+};
+
+PyTypeObject PyCPointer_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "_ctypes._Pointer",
+ sizeof(CDataObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ &Pointer_as_number, /* tp_as_number */
+ &Pointer_as_sequence, /* tp_as_sequence */
+ &Pointer_as_mapping, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ &PyCData_as_buffer, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ PyDoc_STR("XXX to be provided"), /* tp_doc */
+ (traverseproc)PyCData_traverse, /* tp_traverse */
+ (inquiry)PyCData_clear, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ Pointer_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)Pointer_init, /* tp_init */
+ 0, /* tp_alloc */
+ Pointer_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+
+/******************************************************************/
+/*
+ * Module initialization.
+ */
+
+PyDoc_STRVAR(_ctypes__doc__,
+"Create and manipulate C compatible data types in Python.");
+
+#ifdef MS_WIN32
+
+PyDoc_STRVAR(comerror_doc, "Raised when a COM method call failed.");
+
+int
+comerror_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *hresult, *text, *details;
+ PyObject *a;
+ int status;
+
+ if (!_PyArg_NoKeywords(Py_TYPE(self)->tp_name, kwds))
+ return -1;
+
+ if (!PyArg_ParseTuple(args, "OOO:COMError", &hresult, &text, &details))
+ return -1;
+
+ a = PySequence_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+ if (!a)
+ return -1;
+ status = PyObject_SetAttrString(self, "args", a);
+ Py_DECREF(a);
+ if (status < 0)
+ return -1;
+
+ if (PyObject_SetAttrString(self, "hresult", hresult) < 0)
+ return -1;
+
+ if (PyObject_SetAttrString(self, "text", text) < 0)
+ return -1;
+
+ if (PyObject_SetAttrString(self, "details", details) < 0)
+ return -1;
+
+ Py_INCREF(args);
+ Py_SETREF(((PyBaseExceptionObject *)self)->args, args);
+
+ return 0;
+}
+
+static int
+comerror_clear(PyObject *self)
+{
+ return ((PyTypeObject *)PyExc_BaseException)->tp_clear(self);
+}
+
+static int
+comerror_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return ((PyTypeObject *)PyExc_BaseException)->tp_traverse(self, visit, arg);
+}
+
+static void
+comerror_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)comerror_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot comerror_slots[] = {
+ {Py_tp_doc, (void *)PyDoc_STR(comerror_doc)},
+ {Py_tp_init, comerror_init},
+ {Py_tp_traverse, comerror_traverse},
+ {Py_tp_dealloc, comerror_dealloc},
+ {Py_tp_clear, comerror_clear},
+ {0, NULL},
+};
+
+static PyType_Spec comerror_spec = {
+ .name = "_ctypes.COMError",
+ .basicsize = sizeof(PyBaseExceptionObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = comerror_slots,
+};
+
+#endif // MS_WIN32
+
+static PyObject *
+string_at(const char *ptr, int size)
+{
+ if (PySys_Audit("ctypes.string_at", "ni", (Py_ssize_t)ptr, size) < 0) {
+ return NULL;
+ }
+ if (size == -1)
+ return PyBytes_FromStringAndSize(ptr, strlen(ptr));
+ return PyBytes_FromStringAndSize(ptr, size);
+}
+
+static int
+cast_check_pointertype(PyObject *arg)
+{
+ StgDictObject *dict;
+
+ if (PyCPointerTypeObject_Check(arg))
+ return 1;
+ if (PyCFuncPtrTypeObject_Check(arg))
+ return 1;
+ dict = PyType_stgdict(arg);
+ if (dict != NULL && dict->proto != NULL) {
+ if (PyUnicode_Check(dict->proto)
+ && (strchr("sPzUZXO", PyUnicode_AsUTF8(dict->proto)[0]))) {
+ /* simple pointer types, c_void_p, c_wchar_p, BSTR, ... */
+ return 1;
+ }
+ }
+ PyErr_Format(PyExc_TypeError,
+ "cast() argument 2 must be a pointer type, not %s",
+ PyType_Check(arg)
+ ? ((PyTypeObject *)arg)->tp_name
+ : Py_TYPE(arg)->tp_name);
+ return 0;
+}
+
+static PyObject *
+cast(void *ptr, PyObject *src, PyObject *ctype)
+{
+ CDataObject *result;
+ if (0 == cast_check_pointertype(ctype))
+ return NULL;
+ result = (CDataObject *)_PyObject_CallNoArgs(ctype);
+ if (result == NULL)
+ return NULL;
+
+ /*
+ The casted objects '_objects' member:
+
+ It must certainly contain the source objects one.
+ It must contain the source object itself.
+ */
+ if (CDataObject_Check(src)) {
+ CDataObject *obj = (CDataObject *)src;
+ CDataObject *container;
+
+ /* PyCData_GetContainer will initialize src.b_objects, we need
+ this so it can be shared */
+ container = PyCData_GetContainer(obj);
+ if (container == NULL)
+ goto failed;
+
+ /* But we need a dictionary! */
+ if (obj->b_objects == Py_None) {
+ Py_DECREF(Py_None);
+ obj->b_objects = PyDict_New();
+ if (obj->b_objects == NULL)
+ goto failed;
+ }
+ result->b_objects = Py_XNewRef(obj->b_objects);
+ if (result->b_objects && PyDict_CheckExact(result->b_objects)) {
+ PyObject *index;
+ int rc;
+ index = PyLong_FromVoidPtr((void *)src);
+ if (index == NULL)
+ goto failed;
+ rc = PyDict_SetItem(result->b_objects, index, src);
+ Py_DECREF(index);
+ if (rc == -1)
+ goto failed;
+ }
+ }
+ /* Should we assert that result is a pointer type? */
+ memcpy(result->b_ptr, &ptr, sizeof(void *));
+ return (PyObject *)result;
+
+ failed:
+ Py_DECREF(result);
+ return NULL;
+}
+
+
+static PyObject *
+wstring_at(const wchar_t *ptr, int size)
+{
+ Py_ssize_t ssize = size;
+ if (PySys_Audit("ctypes.wstring_at", "nn", (Py_ssize_t)ptr, ssize) < 0) {
+ return NULL;
+ }
+ if (ssize == -1)
+ ssize = wcslen(ptr);
+ return PyUnicode_FromWideChar(ptr, ssize);
+}
+
+
+static struct PyModuleDef _ctypesmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_ctypes",
+ .m_doc = _ctypes__doc__,
+ .m_size = -1,
+ .m_methods = _ctypes_module_methods,
+};
+
+
+static int
+_ctypes_add_types(PyObject *mod)
+{
+#define TYPE_READY(TYPE) \
+ if (PyType_Ready(TYPE) < 0) { \
+ return -1; \
+ }
+
+#define TYPE_READY_BASE(TYPE_EXPR, TP_BASE) \
+ do { \
+ PyTypeObject *type = (TYPE_EXPR); \
+ type->tp_base = (TP_BASE); \
+ TYPE_READY(type); \
+ } while (0)
+
+#define MOD_ADD_TYPE(TYPE_EXPR, TP_TYPE, TP_BASE) \
+ do { \
+ PyTypeObject *type = (TYPE_EXPR); \
+ Py_SET_TYPE(type, TP_TYPE); \
+ type->tp_base = TP_BASE; \
+ if (PyModule_AddType(mod, type) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+#define CREATE_TYPE(MOD, TP, SPEC, BASE) do { \
+ PyObject *type = PyType_FromMetaclass(NULL, MOD, SPEC, \
+ (PyObject *)BASE); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+ TP = (PyTypeObject *)type; \
+} while (0)
+
+ ctypes_state *st = GLOBAL_STATE();
+
+ /* Note:
+ ob_type is the metatype (the 'type'), defaults to PyType_Type,
+ tp_base is the base type, defaults to 'object' aka PyBaseObject_Type.
+ */
+ CREATE_TYPE(mod, st->PyCArg_Type, &carg_spec, NULL);
+ CREATE_TYPE(mod, st->PyCThunk_Type, &cthunk_spec, NULL);
+ TYPE_READY(&PyCData_Type);
+ /* StgDict is derived from PyDict_Type */
+ TYPE_READY_BASE(&PyCStgDict_Type, &PyDict_Type);
+
+ /*************************************************
+ *
+ * Metaclasses
+ */
+ TYPE_READY_BASE(&PyCStructType_Type, &PyType_Type);
+ TYPE_READY_BASE(&UnionType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCPointerType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCArrayType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCSimpleType_Type, &PyType_Type);
+ TYPE_READY_BASE(&PyCFuncPtrType_Type, &PyType_Type);
+
+ /*************************************************
+ *
+ * Classes using a custom metaclass
+ */
+
+ MOD_ADD_TYPE(&Struct_Type, &PyCStructType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&Union_Type, &UnionType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&PyCPointer_Type, &PyCPointerType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&PyCArray_Type, &PyCArrayType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&Simple_Type, &PyCSimpleType_Type, &PyCData_Type);
+ MOD_ADD_TYPE(&PyCFuncPtr_Type, &PyCFuncPtrType_Type, &PyCData_Type);
+
+ /*************************************************
+ *
+ * Simple classes
+ */
+
+ CREATE_TYPE(mod, st->PyCField_Type, &cfield_spec, NULL);
+
+ /*************************************************
+ *
+ * Other stuff
+ */
+
+ CREATE_TYPE(mod, st->DictRemover_Type, &dictremover_spec, NULL);
+ CREATE_TYPE(mod, st->StructParam_Type, &structparam_spec, NULL);
+
+#ifdef MS_WIN32
+ CREATE_TYPE(mod, st->PyComError_Type, &comerror_spec, PyExc_Exception);
+#endif
+
+#undef TYPE_READY
+#undef TYPE_READY_BASE
+#undef MOD_ADD_TYPE
+#undef CREATE_TYPE
+ return 0;
+}
+
+
+static int
+_ctypes_add_objects(PyObject *mod)
+{
+#define MOD_ADD(name, expr) \
+ do { \
+ PyObject *obj = (expr); \
+ if (obj == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddObjectRef(mod, name, obj) < 0) { \
+ Py_DECREF(obj); \
+ return -1; \
+ } \
+ Py_DECREF(obj); \
+ } while (0)
+
+ MOD_ADD("_pointer_type_cache", Py_NewRef(_ctypes_ptrtype_cache));
+
+#ifdef MS_WIN32
+ ctypes_state *st = GLOBAL_STATE();
+ MOD_ADD("COMError", Py_NewRef(st->PyComError_Type));
+ MOD_ADD("FUNCFLAG_HRESULT", PyLong_FromLong(FUNCFLAG_HRESULT));
+ MOD_ADD("FUNCFLAG_STDCALL", PyLong_FromLong(FUNCFLAG_STDCALL));
+#endif
+ MOD_ADD("FUNCFLAG_CDECL", PyLong_FromLong(FUNCFLAG_CDECL));
+ MOD_ADD("FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
+ MOD_ADD("FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
+ MOD_ADD("FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
+ MOD_ADD("__version__", PyUnicode_FromString("1.1.0"));
+
+ MOD_ADD("_memmove_addr", PyLong_FromVoidPtr(memmove));
+ MOD_ADD("_memset_addr", PyLong_FromVoidPtr(memset));
+ MOD_ADD("_string_at_addr", PyLong_FromVoidPtr(string_at));
+ MOD_ADD("_cast_addr", PyLong_FromVoidPtr(cast));
+ MOD_ADD("_wstring_at_addr", PyLong_FromVoidPtr(wstring_at));
+
+/* If RTLD_LOCAL is not defined (Windows!), set it to zero. */
+#if !HAVE_DECL_RTLD_LOCAL
+# define RTLD_LOCAL 0
+#endif
+
+/* If RTLD_GLOBAL is not defined (cygwin), set it to the same value as
+ RTLD_LOCAL. */
+#if !HAVE_DECL_RTLD_GLOBAL
+# define RTLD_GLOBAL RTLD_LOCAL
+#endif
+ MOD_ADD("RTLD_LOCAL", PyLong_FromLong(RTLD_LOCAL));
+ MOD_ADD("RTLD_GLOBAL", PyLong_FromLong(RTLD_GLOBAL));
+ MOD_ADD("CTYPES_MAX_ARGCOUNT", PyLong_FromLong(CTYPES_MAX_ARGCOUNT));
+ MOD_ADD("ArgumentError", Py_NewRef(PyExc_ArgError));
+ MOD_ADD("SIZEOF_TIME_T", PyLong_FromSsize_t(SIZEOF_TIME_T));
+ return 0;
+#undef MOD_ADD
+}
+
+
+static int
+_ctypes_mod_exec(PyObject *mod)
+{
+ _unpickle = PyObject_GetAttrString(mod, "_unpickle");
+ if (_unpickle == NULL) {
+ return -1;
+ }
+
+ _ctypes_ptrtype_cache = PyDict_New();
+ if (_ctypes_ptrtype_cache == NULL) {
+ return -1;
+ }
+
+ PyExc_ArgError = PyErr_NewException("ctypes.ArgumentError", NULL, NULL);
+ if (!PyExc_ArgError) {
+ return -1;
+ }
+
+ if (_ctypes_add_types(mod) < 0) {
+ return -1;
+ }
+
+ if (_ctypes_add_objects(mod) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+
+PyMODINIT_FUNC
+PyInit__ctypes(void)
+{
+ PyObject *mod = PyModule_Create(&_ctypesmodule);
+ if (!mod) {
+ return NULL;
+ }
+
+ if (_ctypes_mod_exec(mod) < 0) {
+ Py_DECREF(mod);
+ return NULL;
+ }
+ return mod;
+}
+
+/*
+ Local Variables:
+ compile-command: "cd .. && python setup.py -q build -g && python setup.py -q build install --home ~"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/callbacks.c b/contrib/tools/python3/Modules/_ctypes/callbacks.c
new file mode 100644
index 00000000000..d71297f9c5c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/callbacks.c
@@ -0,0 +1,612 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_runtime.h" // _PyRuntime
+#include "pycore_global_objects.h" // _Py_ID()
+
+#include <stdbool.h>
+
+#ifdef MS_WIN32
+# include <malloc.h>
+#endif
+
+#include <ffi.h>
+#include "ctypes.h"
+
+#ifdef HAVE_ALLOCA_H
+/* AIX needs alloca.h for alloca() */
+#include <alloca.h>
+#endif
+
+/**************************************************************/
+
+static int
+CThunkObject_traverse(PyObject *myself, visitproc visit, void *arg)
+{
+ CThunkObject *self = (CThunkObject *)myself;
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->converters);
+ Py_VISIT(self->callable);
+ Py_VISIT(self->restype);
+ return 0;
+}
+
+static int
+CThunkObject_clear(PyObject *myself)
+{
+ CThunkObject *self = (CThunkObject *)myself;
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->callable);
+ Py_CLEAR(self->restype);
+ return 0;
+}
+
+static void
+CThunkObject_dealloc(PyObject *myself)
+{
+ CThunkObject *self = (CThunkObject *)myself;
+ PyTypeObject *tp = Py_TYPE(myself);
+ PyObject_GC_UnTrack(self);
+ (void)CThunkObject_clear(myself);
+ if (self->pcl_write) {
+ Py_ffi_closure_free(self->pcl_write);
+ }
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot cthunk_slots[] = {
+ {Py_tp_doc, (void *)PyDoc_STR("CThunkObject")},
+ {Py_tp_dealloc, CThunkObject_dealloc},
+ {Py_tp_traverse, CThunkObject_traverse},
+ {Py_tp_clear, CThunkObject_clear},
+ {0, NULL},
+};
+
+PyType_Spec cthunk_spec = {
+ .name = "_ctypes.CThunkObject",
+ .basicsize = sizeof(CThunkObject),
+ .itemsize = sizeof(ffi_type),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = cthunk_slots,
+};
+
+/**************************************************************/
+
+static void
+PrintError(const char *msg, ...)
+{
+ char buf[512];
+ PyObject *f = PySys_GetObject("stderr");
+ va_list marker;
+
+ va_start(marker, msg);
+ PyOS_vsnprintf(buf, sizeof(buf), msg, marker);
+ va_end(marker);
+ if (f != NULL && f != Py_None)
+ PyFile_WriteString(buf, f);
+ PyErr_Print();
+}
+
+
+#ifdef MS_WIN32
+/*
+ * We must call AddRef() on non-NULL COM pointers we receive as arguments
+ * to callback functions - these functions are COM method implementations.
+ * The Python instances we create have a __del__ method which calls Release().
+ *
+ * The presence of a class attribute named '_needs_com_addref_' triggers this
+ * behaviour. It would also be possible to call the AddRef() Python method,
+ * after checking for PyObject_IsTrue(), but this would probably be somewhat
+ * slower.
+ */
+static void
+TryAddRef(StgDictObject *dict, CDataObject *obj)
+{
+ IUnknown *punk;
+ int r = PyDict_Contains((PyObject *)dict, &_Py_ID(_needs_com_addref_));
+ if (r <= 0) {
+ if (r < 0) {
+ PrintError("getting _needs_com_addref_");
+ }
+ return;
+ }
+
+ punk = *(IUnknown **)obj->b_ptr;
+ if (punk)
+ punk->lpVtbl->AddRef(punk);
+ return;
+}
+#endif
+
+/******************************************************************************
+ *
+ * Call the python object with all arguments
+ *
+ */
+static void _CallPythonObject(void *mem,
+ ffi_type *restype,
+ SETFUNC setfunc,
+ PyObject *callable,
+ PyObject *converters,
+ int flags,
+ void **pArgs)
+{
+ PyObject *result = NULL;
+ Py_ssize_t i = 0, j = 0, nargs = 0;
+ PyObject *error_object = NULL;
+ int *space;
+ PyGILState_STATE state = PyGILState_Ensure();
+
+ assert(PyTuple_Check(converters));
+ nargs = PyTuple_GET_SIZE(converters);
+ assert(nargs <= CTYPES_MAX_ARGCOUNT);
+ PyObject **args = alloca(nargs * sizeof(PyObject *));
+ PyObject **cnvs = PySequence_Fast_ITEMS(converters);
+ for (i = 0; i < nargs; i++) {
+ PyObject *cnv = cnvs[i]; // borrowed ref
+ StgDictObject *dict;
+ dict = PyType_stgdict(cnv);
+
+ if (dict && dict->getfunc && !_ctypes_simple_instance(cnv)) {
+ PyObject *v = dict->getfunc(*pArgs, dict->size);
+ if (!v) {
+ PrintError("create argument %zd:\n", i);
+ goto Done;
+ }
+ args[i] = v;
+ /* XXX XXX XX
+ We have the problem that c_byte or c_short have dict->size of
+ 1 resp. 4, but these parameters are pushed as sizeof(int) bytes.
+ BTW, the same problem occurs when they are pushed as parameters
+ */
+ } else if (dict) {
+ /* Hm, shouldn't we use PyCData_AtAddress() or something like that instead? */
+ CDataObject *obj = (CDataObject *)_PyObject_CallNoArgs(cnv);
+ if (!obj) {
+ PrintError("create argument %zd:\n", i);
+ goto Done;
+ }
+ if (!CDataObject_Check(obj)) {
+ Py_DECREF(obj);
+ PrintError("unexpected result of create argument %zd:\n", i);
+ goto Done;
+ }
+ memcpy(obj->b_ptr, *pArgs, dict->size);
+ args[i] = (PyObject *)obj;
+#ifdef MS_WIN32
+ TryAddRef(dict, obj);
+#endif
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot build parameter");
+ PrintError("Parsing argument %zd\n", i);
+ goto Done;
+ }
+ /* XXX error handling! */
+ pArgs++;
+ }
+
+ if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
+ error_object = _ctypes_get_errobj(&space);
+ if (error_object == NULL)
+ goto Done;
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+#ifdef MS_WIN32
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#endif
+ }
+
+ result = PyObject_Vectorcall(callable, args, nargs, NULL);
+ if (result == NULL) {
+ _PyErr_WriteUnraisableMsg("on calling ctypes callback function",
+ callable);
+ }
+
+#ifdef MS_WIN32
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#endif
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+ Py_XDECREF(error_object);
+
+ if (restype != &ffi_type_void && result) {
+ assert(setfunc);
+
+#ifdef WORDS_BIGENDIAN
+ /* See the corresponding code in _ctypes_callproc():
+ in callproc.c, around line 1219. */
+ if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) {
+ mem = (char *)mem + sizeof(ffi_arg) - restype->size;
+ }
+#endif
+
+ /* keep is an object we have to keep alive so that the result
+ stays valid. If there is no such object, the setfunc will
+ have returned Py_None.
+
+ If there is such an object, we have no choice than to keep
+ it alive forever - but a refcount and/or memory leak will
+ be the result. EXCEPT when restype is py_object - Python
+ itself knows how to manage the refcount of these objects.
+ */
+ PyObject *keep = setfunc(mem, result, 0);
+
+ if (keep == NULL) {
+ /* Could not convert callback result. */
+ _PyErr_WriteUnraisableMsg("on converting result "
+ "of ctypes callback function",
+ callable);
+ }
+ else if (setfunc != _ctypes_get_fielddesc("O")->setfunc) {
+ if (keep == Py_None) {
+ /* Nothing to keep */
+ Py_DECREF(keep);
+ }
+ else if (PyErr_WarnEx(PyExc_RuntimeWarning,
+ "memory leak in callback function.",
+ 1) == -1) {
+ _PyErr_WriteUnraisableMsg("on converting result "
+ "of ctypes callback function",
+ callable);
+ }
+ }
+ }
+
+ Py_XDECREF(result);
+
+ Done:
+ for (j = 0; j < i; j++) {
+ Py_DECREF(args[j]);
+ }
+ PyGILState_Release(state);
+}
+
+static void closure_fcn(ffi_cif *cif,
+ void *resp,
+ void **args,
+ void *userdata)
+{
+ CThunkObject *p = (CThunkObject *)userdata;
+
+ _CallPythonObject(resp,
+ p->ffi_restype,
+ p->setfunc,
+ p->callable,
+ p->converters,
+ p->flags,
+ args);
+}
+
+static CThunkObject* CThunkObject_new(Py_ssize_t nargs)
+{
+ CThunkObject *p;
+ Py_ssize_t i;
+
+ ctypes_state *st = GLOBAL_STATE();
+ p = PyObject_GC_NewVar(CThunkObject, st->PyCThunk_Type, nargs);
+ if (p == NULL) {
+ return NULL;
+ }
+
+ p->pcl_write = NULL;
+ p->pcl_exec = NULL;
+ memset(&p->cif, 0, sizeof(p->cif));
+ p->flags = 0;
+ p->converters = NULL;
+ p->callable = NULL;
+ p->restype = NULL;
+ p->setfunc = NULL;
+ p->ffi_restype = NULL;
+
+ for (i = 0; i < nargs + 1; ++i)
+ p->atypes[i] = NULL;
+ PyObject_GC_Track((PyObject *)p);
+ return p;
+}
+
+CThunkObject *_ctypes_alloc_callback(PyObject *callable,
+ PyObject *converters,
+ PyObject *restype,
+ int flags)
+{
+ int result;
+ CThunkObject *p;
+ Py_ssize_t nargs, i;
+ ffi_abi cc;
+
+ assert(PyTuple_Check(converters));
+ nargs = PyTuple_GET_SIZE(converters);
+ p = CThunkObject_new(nargs);
+ if (p == NULL)
+ return NULL;
+
+#ifdef Py_DEBUG
+ ctypes_state *st = GLOBAL_STATE();
+ assert(CThunk_CheckExact(st, (PyObject *)p));
+#endif
+
+ p->pcl_write = Py_ffi_closure_alloc(sizeof(ffi_closure), &p->pcl_exec);
+ if (p->pcl_write == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ p->flags = flags;
+ PyObject **cnvs = PySequence_Fast_ITEMS(converters);
+ for (i = 0; i < nargs; ++i) {
+ PyObject *cnv = cnvs[i]; // borrowed ref
+ p->atypes[i] = _ctypes_get_ffi_type(cnv);
+ }
+ p->atypes[i] = NULL;
+
+ p->restype = Py_NewRef(restype);
+ if (restype == Py_None) {
+ p->setfunc = NULL;
+ p->ffi_restype = &ffi_type_void;
+ } else {
+ StgDictObject *dict = PyType_stgdict(restype);
+ if (dict == NULL || dict->setfunc == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "invalid result type for callback function");
+ goto error;
+ }
+ p->setfunc = dict->setfunc;
+ p->ffi_restype = &dict->ffi_type_pointer;
+ }
+
+ cc = FFI_DEFAULT_ABI;
+#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64) && !defined(_M_ARM)
+ if ((flags & FUNCFLAG_CDECL) == 0)
+ cc = FFI_STDCALL;
+#endif
+ result = ffi_prep_cif(&p->cif, cc,
+ Py_SAFE_DOWNCAST(nargs, Py_ssize_t, int),
+ p->ffi_restype,
+ &p->atypes[0]);
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_cif failed with %d", result);
+ goto error;
+ }
+
+
+#if HAVE_FFI_PREP_CLOSURE_LOC
+# ifdef USING_APPLE_OS_LIBFFI
+# ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
+# else
+# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME (ffi_prep_closure_loc != NULL)
+# endif
+# else
+# define HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME 1
+# endif
+ if (HAVE_FFI_PREP_CLOSURE_LOC_RUNTIME) {
+ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
+ p,
+ p->pcl_exec);
+ } else
+#endif
+ {
+#if defined(USING_APPLE_OS_LIBFFI) && defined(__arm64__)
+ PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
+ goto error;
+#else
+#if defined(__clang__)
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
+
+#if defined(__clang__)
+ #pragma clang diagnostic pop
+#endif
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
+ #pragma GCC diagnostic pop
+#endif
+
+#endif
+ }
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_closure failed with %d", result);
+ goto error;
+ }
+
+ p->converters = Py_NewRef(converters);
+ p->callable = Py_NewRef(callable);
+ return p;
+
+ error:
+ Py_XDECREF(p);
+ return NULL;
+}
+
+#ifdef MS_WIN32
+
+static void LoadPython(void)
+{
+ if (!Py_IsInitialized()) {
+ Py_Initialize();
+ }
+}
+
+/******************************************************************/
+
+long Call_GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
+{
+ PyObject *func, *result;
+ long retval;
+ static PyObject *context;
+
+ if (context == NULL)
+ context = PyUnicode_InternFromString("_ctypes.DllGetClassObject");
+
+ func = _PyImport_GetModuleAttrString("ctypes", "DllGetClassObject");
+ if (!func) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ /* There has been a warning before about this already */
+ return E_FAIL;
+ }
+
+ {
+ PyObject *py_rclsid = PyLong_FromVoidPtr((void *)rclsid);
+ if (py_rclsid == NULL) {
+ Py_DECREF(func);
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+ PyObject *py_riid = PyLong_FromVoidPtr((void *)riid);
+ if (py_riid == NULL) {
+ Py_DECREF(func);
+ Py_DECREF(py_rclsid);
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+ PyObject *py_ppv = PyLong_FromVoidPtr(ppv);
+ if (py_ppv == NULL) {
+ Py_DECREF(py_rclsid);
+ Py_DECREF(py_riid);
+ Py_DECREF(func);
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+ result = PyObject_CallFunctionObjArgs(func,
+ py_rclsid,
+ py_riid,
+ py_ppv,
+ NULL);
+ Py_DECREF(py_rclsid);
+ Py_DECREF(py_riid);
+ Py_DECREF(py_ppv);
+ }
+ Py_DECREF(func);
+ if (!result) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+
+ retval = PyLong_AsLong(result);
+ if (PyErr_Occurred()) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ retval = E_FAIL;
+ }
+ Py_DECREF(result);
+ return retval;
+}
+
+STDAPI DllGetClassObject(REFCLSID rclsid,
+ REFIID riid,
+ LPVOID *ppv)
+{
+ long result;
+ PyGILState_STATE state;
+
+ LoadPython();
+ state = PyGILState_Ensure();
+ result = Call_GetClassObject(rclsid, riid, ppv);
+ PyGILState_Release(state);
+ return result;
+}
+
+long Call_CanUnloadNow(void)
+{
+ PyObject *mod, *func, *result;
+ long retval;
+ static PyObject *context;
+
+ if (context == NULL)
+ context = PyUnicode_InternFromString("_ctypes.DllCanUnloadNow");
+
+ mod = PyImport_ImportModule("ctypes");
+ if (!mod) {
+/* OutputDebugString("Could not import ctypes"); */
+ /* We assume that this error can only occur when shutting
+ down, so we silently ignore it */
+ PyErr_Clear();
+ return E_FAIL;
+ }
+ /* Other errors cannot be raised, but are printed to stderr */
+ func = PyObject_GetAttrString(mod, "DllCanUnloadNow");
+ Py_DECREF(mod);
+ if (!func) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+
+ result = _PyObject_CallNoArgs(func);
+ Py_DECREF(func);
+ if (!result) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ return E_FAIL;
+ }
+
+ retval = PyLong_AsLong(result);
+ if (PyErr_Occurred()) {
+ PyErr_WriteUnraisable(context ? context : Py_None);
+ retval = E_FAIL;
+ }
+ Py_DECREF(result);
+ return retval;
+}
+
+/*
+ DllRegisterServer and DllUnregisterServer still missing
+*/
+
+STDAPI DllCanUnloadNow(void)
+{
+ long result;
+ PyGILState_STATE state = PyGILState_Ensure();
+ result = Call_CanUnloadNow();
+ PyGILState_Release(state);
+ return result;
+}
+
+#ifndef Py_NO_ENABLE_SHARED
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRes)
+{
+ switch(fdwReason) {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+ }
+ return TRUE;
+}
+#endif
+
+#endif
+
+/*
+ Local Variables:
+ compile-command: "cd .. && python setup.py -q build_ext"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/callproc.c b/contrib/tools/python3/Modules/_ctypes/callproc.c
new file mode 100644
index 00000000000..d2fe525dd4d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/callproc.c
@@ -0,0 +1,2038 @@
+/*
+ * History: First version dated from 3/97, derived from my SCMLIB version
+ * for win16.
+ */
+/*
+ * Related Work:
+ * - calldll http://www.nightmare.com/software.html
+ * - libffi http://sourceware.cygnus.com/libffi/
+ * - ffcall http://clisp.cons.org/~haible/packages-ffcall.html
+ * and, of course, Don Beaudry's MESS package, but this is more ctypes
+ * related.
+ */
+
+
+/*
+ How are functions called, and how are parameters converted to C ?
+
+ 1. _ctypes.c::PyCFuncPtr_call receives an argument tuple 'inargs' and a
+ keyword dictionary 'kwds'.
+
+ 2. After several checks, _build_callargs() is called which returns another
+ tuple 'callargs'. This may be the same tuple as 'inargs', a slice of
+ 'inargs', or a completely fresh tuple, depending on several things (is it a
+ COM method?, are 'paramflags' available?).
+
+ 3. _build_callargs also calculates bitarrays containing indexes into
+ the callargs tuple, specifying how to build the return value(s) of
+ the function.
+
+ 4. _ctypes_callproc is then called with the 'callargs' tuple. _ctypes_callproc first
+ allocates two arrays. The first is an array of 'struct argument' items, the
+ second array has 'void *' entries.
+
+ 5. If 'converters' are present (converters is a sequence of argtypes'
+ from_param methods), for each item in 'callargs' converter is called and the
+ result passed to ConvParam. If 'converters' are not present, each argument
+ is directly passed to ConvParm.
+
+ 6. For each arg, ConvParam stores the contained C data (or a pointer to it,
+ for structures) into the 'struct argument' array.
+
+ 7. Finally, a loop fills the 'void *' array so that each item points to the
+ data contained in or pointed to by the 'struct argument' array.
+
+ 8. The 'void *' argument array is what _call_function_pointer
+ expects. _call_function_pointer then has very little to do - only some
+ libffi specific stuff, then it calls ffi_call.
+
+ So, there are 4 data structures holding processed arguments:
+ - the inargs tuple (in PyCFuncPtr_call)
+ - the callargs tuple (in PyCFuncPtr_call)
+ - the 'struct arguments' array
+ - the 'void *' array
+
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+
+#include <stdbool.h>
+
+#ifdef MS_WIN32
+#include <windows.h>
+#include <tchar.h>
+#else
+#include <dlfcn.h>
+#endif
+
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
+#endif
+
+#ifdef MS_WIN32
+#include <malloc.h>
+#endif
+
+#include <ffi.h>
+#include "ctypes.h"
+#ifdef HAVE_ALLOCA_H
+/* AIX needs alloca.h for alloca() */
+#include <alloca.h>
+#endif
+
+#ifdef _Py_MEMORY_SANITIZER
+#include <sanitizer/msan_interface.h>
+#endif
+
+#if defined(_DEBUG) || defined(__MINGW32__)
+/* Don't use structured exception handling on Windows if this is defined.
+ MingW, AFAIK, doesn't support it.
+*/
+#define DONT_USE_SEH
+#endif
+
+#include "pycore_runtime.h" // _PyRuntime
+#include "pycore_global_objects.h" // _Py_ID()
+
+#define CTYPES_CAPSULE_NAME_PYMEM "_ctypes pymem"
+
+
+static void pymem_destructor(PyObject *ptr)
+{
+ void *p = PyCapsule_GetPointer(ptr, CTYPES_CAPSULE_NAME_PYMEM);
+ if (p) {
+ PyMem_Free(p);
+ }
+}
+
+/*
+ ctypes maintains thread-local storage that has space for two error numbers:
+ private copies of the system 'errno' value and, on Windows, the system error code
+ accessed by the GetLastError() and SetLastError() api functions.
+
+ Foreign functions created with CDLL(..., use_errno=True), when called, swap
+ the system 'errno' value with the private copy just before the actual
+ function call, and swapped again immediately afterwards. The 'use_errno'
+ parameter defaults to False, in this case 'ctypes_errno' is not touched.
+
+ On Windows, foreign functions created with CDLL(..., use_last_error=True) or
+ WinDLL(..., use_last_error=True) swap the system LastError value with the
+ ctypes private copy.
+
+ The values are also swapped immediately before and after ctypes callback
+ functions are called, if the callbacks are constructed using the new
+ optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
+ WINFUNCTYPE(..., use_errno=True).
+
+ New ctypes functions are provided to access the ctypes private copies from
+ Python:
+
+ - ctypes.set_errno(value) and ctypes.set_last_error(value) store 'value' in
+ the private copy and returns the previous value.
+
+ - ctypes.get_errno() and ctypes.get_last_error() returns the current ctypes
+ private copies value.
+*/
+
+/*
+ This function creates and returns a thread-local Python object that has
+ space to store two integer error numbers; once created the Python object is
+ kept alive in the thread state dictionary as long as the thread itself.
+*/
+PyObject *
+_ctypes_get_errobj(int **pspace)
+{
+ PyObject *dict = PyThreadState_GetDict();
+ PyObject *errobj;
+ static PyObject *error_object_name;
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot get thread state");
+ return NULL;
+ }
+ if (error_object_name == NULL) {
+ error_object_name = PyUnicode_InternFromString("ctypes.error_object");
+ if (error_object_name == NULL)
+ return NULL;
+ }
+ errobj = PyDict_GetItemWithError(dict, error_object_name);
+ if (errobj) {
+ if (!PyCapsule_IsValid(errobj, CTYPES_CAPSULE_NAME_PYMEM)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ctypes.error_object is an invalid capsule");
+ return NULL;
+ }
+ Py_INCREF(errobj);
+ }
+ else if (!PyErr_Occurred()) {
+ void *space = PyMem_Calloc(2, sizeof(int));
+ if (space == NULL)
+ return NULL;
+ errobj = PyCapsule_New(space, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
+ if (errobj == NULL) {
+ PyMem_Free(space);
+ return NULL;
+ }
+ if (-1 == PyDict_SetItem(dict, error_object_name,
+ errobj)) {
+ Py_DECREF(errobj);
+ return NULL;
+ }
+ }
+ else {
+ return NULL;
+ }
+ *pspace = (int *)PyCapsule_GetPointer(errobj, CTYPES_CAPSULE_NAME_PYMEM);
+ return errobj;
+}
+
+static PyObject *
+get_error_internal(PyObject *self, PyObject *args, int index)
+{
+ int *space;
+ PyObject *errobj = _ctypes_get_errobj(&space);
+ PyObject *result;
+
+ if (errobj == NULL)
+ return NULL;
+ result = PyLong_FromLong(space[index]);
+ Py_DECREF(errobj);
+ return result;
+}
+
+static PyObject *
+set_error_internal(PyObject *self, PyObject *args, int index)
+{
+ int new_errno, old_errno;
+ PyObject *errobj;
+ int *space;
+
+ if (!PyArg_ParseTuple(args, "i", &new_errno)) {
+ return NULL;
+ }
+ errobj = _ctypes_get_errobj(&space);
+ if (errobj == NULL)
+ return NULL;
+ old_errno = space[index];
+ space[index] = new_errno;
+ Py_DECREF(errobj);
+ return PyLong_FromLong(old_errno);
+}
+
+static PyObject *
+get_errno(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.get_errno", NULL) < 0) {
+ return NULL;
+ }
+ return get_error_internal(self, args, 0);
+}
+
+static PyObject *
+set_errno(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.set_errno", "O", args) < 0) {
+ return NULL;
+ }
+ return set_error_internal(self, args, 0);
+}
+
+#ifdef MS_WIN32
+
+static PyObject *
+get_last_error(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.get_last_error", NULL) < 0) {
+ return NULL;
+ }
+ return get_error_internal(self, args, 1);
+}
+
+static PyObject *
+set_last_error(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("ctypes.set_last_error", "O", args) < 0) {
+ return NULL;
+ }
+ return set_error_internal(self, args, 1);
+}
+
+static WCHAR *FormatError(DWORD code)
+{
+ WCHAR *lpMsgBuf;
+ DWORD n;
+ n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ code,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
+ (LPWSTR) &lpMsgBuf,
+ 0,
+ NULL);
+ if (n) {
+ while (iswspace(lpMsgBuf[n-1]))
+ --n;
+ lpMsgBuf[n] = L'\0'; /* rstrip() */
+ }
+ return lpMsgBuf;
+}
+
+#ifndef DONT_USE_SEH
+static void SetException(DWORD code, EXCEPTION_RECORD *pr)
+{
+ if (PySys_Audit("ctypes.set_exception", "I", code) < 0) {
+ /* An exception was set by the audit hook */
+ return;
+ }
+
+ /* The 'code' is a normal win32 error code so it could be handled by
+ PyErr_SetFromWindowsErr(). However, for some errors, we have additional
+ information not included in the error code. We handle those here and
+ delegate all others to the generic function. */
+ switch (code) {
+ case EXCEPTION_ACCESS_VIOLATION:
+ /* The thread attempted to read from or write
+ to a virtual address for which it does not
+ have the appropriate access. */
+ if (pr->ExceptionInformation[0] == 0)
+ PyErr_Format(PyExc_OSError,
+ "exception: access violation reading %p",
+ pr->ExceptionInformation[1]);
+ else
+ PyErr_Format(PyExc_OSError,
+ "exception: access violation writing %p",
+ pr->ExceptionInformation[1]);
+ break;
+
+ case EXCEPTION_BREAKPOINT:
+ /* A breakpoint was encountered. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: breakpoint encountered");
+ break;
+
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ /* The thread attempted to read or write data that is
+ misaligned on hardware that does not provide
+ alignment. For example, 16-bit values must be
+ aligned on 2-byte boundaries, 32-bit values on
+ 4-byte boundaries, and so on. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: datatype misalignment");
+ break;
+
+ case EXCEPTION_SINGLE_STEP:
+ /* A trace trap or other single-instruction mechanism
+ signaled that one instruction has been executed. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: single step");
+ break;
+
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ /* The thread attempted to access an array element
+ that is out of bounds, and the underlying hardware
+ supports bounds checking. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: array bounds exceeded");
+ break;
+
+ case EXCEPTION_FLT_DENORMAL_OPERAND:
+ /* One of the operands in a floating-point operation
+ is denormal. A denormal value is one that is too
+ small to represent as a standard floating-point
+ value. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: floating-point operand denormal");
+ break;
+
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO:
+ /* The thread attempted to divide a floating-point
+ value by a floating-point divisor of zero. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float divide by zero");
+ break;
+
+ case EXCEPTION_FLT_INEXACT_RESULT:
+ /* The result of a floating-point operation cannot be
+ represented exactly as a decimal fraction. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float inexact");
+ break;
+
+ case EXCEPTION_FLT_INVALID_OPERATION:
+ /* This exception represents any floating-point
+ exception not included in this list. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float invalid operation");
+ break;
+
+ case EXCEPTION_FLT_OVERFLOW:
+ /* The exponent of a floating-point operation is
+ greater than the magnitude allowed by the
+ corresponding type. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float overflow");
+ break;
+
+ case EXCEPTION_FLT_STACK_CHECK:
+ /* The stack overflowed or underflowed as the result
+ of a floating-point operation. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: stack over/underflow");
+ break;
+
+ case EXCEPTION_STACK_OVERFLOW:
+ /* The stack overflowed or underflowed as the result
+ of a floating-point operation. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: stack overflow");
+ break;
+
+ case EXCEPTION_FLT_UNDERFLOW:
+ /* The exponent of a floating-point operation is less
+ than the magnitude allowed by the corresponding
+ type. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: float underflow");
+ break;
+
+ case EXCEPTION_INT_DIVIDE_BY_ZERO:
+ /* The thread attempted to divide an integer value by
+ an integer divisor of zero. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: integer divide by zero");
+ break;
+
+ case EXCEPTION_INT_OVERFLOW:
+ /* The result of an integer operation caused a carry
+ out of the most significant bit of the result. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: integer overflow");
+ break;
+
+ case EXCEPTION_PRIV_INSTRUCTION:
+ /* The thread attempted to execute an instruction
+ whose operation is not allowed in the current
+ machine mode. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: privileged instruction");
+ break;
+
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ /* The thread attempted to continue execution after a
+ noncontinuable exception occurred. */
+ PyErr_SetString(PyExc_OSError,
+ "exception: nocontinuable");
+ break;
+
+ default:
+ PyErr_SetFromWindowsErr(code);
+ break;
+ }
+}
+
+static DWORD HandleException(EXCEPTION_POINTERS *ptrs,
+ DWORD *pdw, EXCEPTION_RECORD *record)
+{
+ *pdw = ptrs->ExceptionRecord->ExceptionCode;
+ *record = *ptrs->ExceptionRecord;
+ /* We don't want to catch breakpoint exceptions, they are used to attach
+ * a debugger to the process.
+ */
+ if (*pdw == EXCEPTION_BREAKPOINT)
+ return EXCEPTION_CONTINUE_SEARCH;
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+#endif
+
+static PyObject *
+check_hresult(PyObject *self, PyObject *args)
+{
+ HRESULT hr;
+ if (!PyArg_ParseTuple(args, "i", &hr))
+ return NULL;
+ if (FAILED(hr))
+ return PyErr_SetFromWindowsErr(hr);
+ return PyLong_FromLong(hr);
+}
+
+#endif
+
+/**************************************************************/
+
+PyCArgObject *
+PyCArgObject_new(void)
+{
+ PyCArgObject *p;
+ ctypes_state *st = GLOBAL_STATE();
+ p = PyObject_GC_New(PyCArgObject, st->PyCArg_Type);
+ if (p == NULL)
+ return NULL;
+ p->pffi_type = NULL;
+ p->tag = '\0';
+ p->obj = NULL;
+ memset(&p->value, 0, sizeof(p->value));
+ PyObject_GC_Track(p);
+ return p;
+}
+
+static int
+PyCArg_traverse(PyCArgObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->obj);
+ return 0;
+}
+
+static int
+PyCArg_clear(PyCArgObject *self)
+{
+ Py_CLEAR(self->obj);
+ return 0;
+}
+
+static void
+PyCArg_dealloc(PyCArgObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)PyCArg_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+is_literal_char(unsigned char c)
+{
+ return c < 128 && _PyUnicode_IsPrintable(c) && c != '\\' && c != '\'';
+}
+
+static PyObject *
+PyCArg_repr(PyCArgObject *self)
+{
+ switch(self->tag) {
+ case 'b':
+ case 'B':
+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
+ self->tag, self->value.b);
+ case 'h':
+ case 'H':
+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
+ self->tag, self->value.h);
+ case 'i':
+ case 'I':
+ return PyUnicode_FromFormat("<cparam '%c' (%d)>",
+ self->tag, self->value.i);
+ case 'l':
+ case 'L':
+ return PyUnicode_FromFormat("<cparam '%c' (%ld)>",
+ self->tag, self->value.l);
+
+ case 'q':
+ case 'Q':
+ return PyUnicode_FromFormat("<cparam '%c' (%lld)>",
+ self->tag, self->value.q);
+ case 'd':
+ case 'f': {
+ PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d);
+ if (f == NULL) {
+ return NULL;
+ }
+ PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f);
+ Py_DECREF(f);
+ return result;
+ }
+ case 'c':
+ if (is_literal_char((unsigned char)self->value.c)) {
+ return PyUnicode_FromFormat("<cparam '%c' ('%c')>",
+ self->tag, self->value.c);
+ }
+ else {
+ return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>",
+ self->tag, (unsigned char)self->value.c);
+ }
+
+/* Hm, are these 'z' and 'Z' codes useful at all?
+ Shouldn't they be replaced by the functionality of create_string_buffer()
+ and c_wstring() ?
+*/
+ case 'z':
+ case 'Z':
+ case 'P':
+ return PyUnicode_FromFormat("<cparam '%c' (%p)>",
+ self->tag, self->value.p);
+ break;
+
+ default:
+ if (is_literal_char((unsigned char)self->tag)) {
+ return PyUnicode_FromFormat("<cparam '%c' at %p>",
+ (unsigned char)self->tag, (void *)self);
+ }
+ else {
+ return PyUnicode_FromFormat("<cparam 0x%02x at %p>",
+ (unsigned char)self->tag, (void *)self);
+ }
+ }
+}
+
+static PyMemberDef PyCArgType_members[] = {
+ { "_obj", T_OBJECT,
+ offsetof(PyCArgObject, obj), READONLY,
+ "the wrapped object" },
+ { NULL },
+};
+
+static PyType_Slot carg_slots[] = {
+ {Py_tp_dealloc, PyCArg_dealloc},
+ {Py_tp_traverse, PyCArg_traverse},
+ {Py_tp_clear, PyCArg_clear},
+ {Py_tp_repr, PyCArg_repr},
+ {Py_tp_members, PyCArgType_members},
+ {0, NULL},
+};
+
+PyType_Spec carg_spec = {
+ .name = "_ctypes.CArgObject",
+ .basicsize = sizeof(PyCArgObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = carg_slots,
+};
+
+/****************************************************************/
+/*
+ * Convert a PyObject * into a parameter suitable to pass to an
+ * C function call.
+ *
+ * 1. Python integers are converted to C int and passed by value.
+ * Py_None is converted to a C NULL pointer.
+ *
+ * 2. 3-tuples are expected to have a format character in the first
+ * item, which must be 'i', 'f', 'd', 'q', or 'P'.
+ * The second item will have to be an integer, float, double, long long
+ * or integer (denoting an address void *), will be converted to the
+ * corresponding C data type and passed by value.
+ *
+ * 3. Other Python objects are tested for an '_as_parameter_' attribute.
+ * The value of this attribute must be an integer which will be passed
+ * by value, or a 2-tuple or 3-tuple which will be used according
+ * to point 2 above. The third item (if any), is ignored. It is normally
+ * used to keep the object alive where this parameter refers to.
+ * XXX This convention is dangerous - you can construct arbitrary tuples
+ * in Python and pass them. Would it be safer to use a custom container
+ * datatype instead of a tuple?
+ *
+ * 4. Other Python objects cannot be passed as parameters - an exception is raised.
+ *
+ * 5. ConvParam will store the converted result in a struct containing format
+ * and value.
+ */
+
+union result {
+ char c;
+ char b;
+ short h;
+ int i;
+ long l;
+ long long q;
+ long double D;
+ double d;
+ float f;
+ void *p;
+};
+
+struct argument {
+ ffi_type *ffi_type;
+ PyObject *keep;
+ union result value;
+};
+
+/*
+ * Convert a single Python object into a PyCArgObject and return it.
+ */
+static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
+{
+ StgDictObject *dict;
+ pa->keep = NULL; /* so we cannot forget it later */
+
+ dict = PyObject_stgdict(obj);
+ if (dict) {
+ PyCArgObject *carg;
+ assert(dict->paramfunc);
+ /* If it has an stgdict, it is a CDataObject */
+ carg = dict->paramfunc((CDataObject *)obj);
+ if (carg == NULL)
+ return -1;
+ pa->ffi_type = carg->pffi_type;
+ memcpy(&pa->value, &carg->value, sizeof(pa->value));
+ pa->keep = (PyObject *)carg;
+ return 0;
+ }
+
+ ctypes_state *st = GLOBAL_STATE();
+ if (PyCArg_CheckExact(st, obj)) {
+ PyCArgObject *carg = (PyCArgObject *)obj;
+ pa->ffi_type = carg->pffi_type;
+ pa->keep = Py_NewRef(obj);
+ memcpy(&pa->value, &carg->value, sizeof(pa->value));
+ return 0;
+ }
+
+ /* check for None, integer, string or unicode and use directly if successful */
+ if (obj == Py_None) {
+ pa->ffi_type = &ffi_type_pointer;
+ pa->value.p = NULL;
+ return 0;
+ }
+
+ if (PyLong_Check(obj)) {
+ pa->ffi_type = &ffi_type_sint;
+ pa->value.i = (long)PyLong_AsUnsignedLong(obj);
+ if (pa->value.i == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ pa->value.i = PyLong_AsLong(obj);
+ if (pa->value.i == -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_OverflowError,
+ "int too long to convert");
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ if (PyBytes_Check(obj)) {
+ pa->ffi_type = &ffi_type_pointer;
+ pa->value.p = PyBytes_AsString(obj);
+ pa->keep = Py_NewRef(obj);
+ return 0;
+ }
+
+ if (PyUnicode_Check(obj)) {
+ pa->ffi_type = &ffi_type_pointer;
+ pa->value.p = PyUnicode_AsWideCharString(obj, NULL);
+ if (pa->value.p == NULL)
+ return -1;
+ pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
+ if (!pa->keep) {
+ PyMem_Free(pa->value.p);
+ return -1;
+ }
+ return 0;
+ }
+
+ {
+ PyObject *arg;
+ if (_PyObject_LookupAttr(obj, &_Py_ID(_as_parameter_), &arg) < 0) {
+ return -1;
+ }
+ /* Which types should we exactly allow here?
+ integers are required for using Python classes
+ as parameters (they have to expose the '_as_parameter_'
+ attribute)
+ */
+ if (arg) {
+ int result;
+ result = ConvParam(arg, index, pa);
+ Py_DECREF(arg);
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "Don't know how to convert parameter %d",
+ Py_SAFE_DOWNCAST(index, Py_ssize_t, int));
+ return -1;
+ }
+}
+
+#if defined(MS_WIN32) && !defined(_WIN32_WCE)
+/*
+Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx
+To be returned by value in RAX, user-defined types must have a length
+of 1, 2, 4, 8, 16, 32, or 64 bits
+*/
+int can_return_struct_as_int(size_t s)
+{
+ return s == 1 || s == 2 || s == 4;
+}
+
+int can_return_struct_as_sint64(size_t s)
+{
+#ifdef _M_ARM
+ // 8 byte structs cannot be returned in a register on ARM32
+ return 0;
+#else
+ return s == 8;
+#endif
+}
+#endif
+
+
+ffi_type *_ctypes_get_ffi_type(PyObject *obj)
+{
+ StgDictObject *dict;
+ if (obj == NULL)
+ return &ffi_type_sint;
+ dict = PyType_stgdict(obj);
+ if (dict == NULL)
+ return &ffi_type_sint;
+#if defined(MS_WIN32) && !defined(_WIN32_WCE)
+ /* This little trick works correctly with MSVC.
+ It returns small structures in registers
+ */
+ if (dict->ffi_type_pointer.type == FFI_TYPE_STRUCT) {
+ if (can_return_struct_as_int(dict->ffi_type_pointer.size))
+ return &ffi_type_sint32;
+ else if (can_return_struct_as_sint64 (dict->ffi_type_pointer.size))
+ return &ffi_type_sint64;
+ }
+#endif
+ return &dict->ffi_type_pointer;
+}
+
+
+/*
+ * libffi uses:
+ *
+ * ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi,
+ * unsigned int nargs,
+ * ffi_type *rtype,
+ * ffi_type **atypes);
+ *
+ * and then
+ *
+ * void ffi_call(ffi_cif *cif, void *fn, void *rvalue, void **avalues);
+ */
+static int _call_function_pointer(int flags,
+ PPROC pProc,
+ void **avalues,
+ ffi_type **atypes,
+ ffi_type *restype,
+ void *resmem,
+ int argcount,
+ int argtypecount)
+{
+ PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
+ PyObject *error_object = NULL;
+ int *space;
+ ffi_cif cif;
+ int cc;
+#if defined(MS_WIN32) && !defined(DONT_USE_SEH)
+ DWORD dwExceptionCode = 0;
+ EXCEPTION_RECORD record;
+#endif
+ /* XXX check before here */
+ if (restype == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "No ffi_type for result");
+ return -1;
+ }
+
+ cc = FFI_DEFAULT_ABI;
+#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE) && !defined(_M_ARM)
+ if ((flags & FUNCFLAG_CDECL) == 0)
+ cc = FFI_STDCALL;
+#endif
+
+# ifdef USING_APPLE_OS_LIBFFI
+# ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME __builtin_available(macos 10.15, ios 13, watchos 6, tvos 13, *)
+# else
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME (ffi_prep_cif_var != NULL)
+# endif
+# elif HAVE_FFI_PREP_CIF_VAR
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME true
+# else
+# define HAVE_FFI_PREP_CIF_VAR_RUNTIME false
+# endif
+
+ /* Even on Apple-arm64 the calling convention for variadic functions coincides
+ * with the standard calling convention in the case that the function called
+ * only with its fixed arguments. Thus, we do not need a special flag to be
+ * set on variadic functions. We treat a function as variadic if it is called
+ * with a nonzero number of variadic arguments */
+ bool is_variadic = (argtypecount != 0 && argcount > argtypecount);
+ (void) is_variadic;
+
+#if defined(__APPLE__) && defined(__arm64__)
+ if (is_variadic) {
+ if (HAVE_FFI_PREP_CIF_VAR_RUNTIME) {
+ } else {
+ PyErr_SetString(PyExc_NotImplementedError, "ffi_prep_cif_var() is missing");
+ return -1;
+ }
+ }
+#endif
+
+#if HAVE_FFI_PREP_CIF_VAR
+ if (is_variadic) {
+ if (HAVE_FFI_PREP_CIF_VAR_RUNTIME) {
+ if (FFI_OK != ffi_prep_cif_var(&cif,
+ cc,
+ argtypecount,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif_var failed");
+ return -1;
+ }
+ } else {
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+ }
+ } else
+#endif
+
+ {
+ if (FFI_OK != ffi_prep_cif(&cif,
+ cc,
+ argcount,
+ restype,
+ atypes)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ffi_prep_cif failed");
+ return -1;
+ }
+ }
+
+ if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
+ error_object = _ctypes_get_errobj(&space);
+ if (error_object == NULL)
+ return -1;
+ }
+ if ((flags & FUNCFLAG_PYTHONAPI) == 0)
+ Py_UNBLOCK_THREADS
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+#ifdef MS_WIN32
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#ifndef DONT_USE_SEH
+ __try {
+#endif
+#endif
+ ffi_call(&cif, (void *)pProc, resmem, avalues);
+#ifdef MS_WIN32
+#ifndef DONT_USE_SEH
+ }
+ __except (HandleException(GetExceptionInformation(),
+ &dwExceptionCode, &record)) {
+ ;
+ }
+#endif
+ if (flags & FUNCFLAG_USE_LASTERROR) {
+ int temp = space[1];
+ space[1] = GetLastError();
+ SetLastError(temp);
+ }
+#endif
+ if (flags & FUNCFLAG_USE_ERRNO) {
+ int temp = space[0];
+ space[0] = errno;
+ errno = temp;
+ }
+ if ((flags & FUNCFLAG_PYTHONAPI) == 0)
+ Py_BLOCK_THREADS
+ Py_XDECREF(error_object);
+#ifdef MS_WIN32
+#ifndef DONT_USE_SEH
+ if (dwExceptionCode) {
+ SetException(dwExceptionCode, &record);
+ return -1;
+ }
+#endif
+#endif
+ if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred())
+ return -1;
+ return 0;
+}
+
+/*
+ * Convert the C value in result into a Python object, depending on restype.
+ *
+ * - If restype is NULL, return a Python integer.
+ * - If restype is None, return None.
+ * - If restype is a simple ctypes type (c_int, c_void_p), call the type's getfunc,
+ * pass the result to checker and return the result.
+ * - If restype is another ctypes type, return an instance of that.
+ * - Otherwise, call restype and return the result.
+ */
+static PyObject *GetResult(PyObject *restype, void *result, PyObject *checker)
+{
+ StgDictObject *dict;
+ PyObject *retval, *v;
+
+ if (restype == NULL)
+ return PyLong_FromLong(*(int *)result);
+
+ if (restype == Py_None) {
+ Py_RETURN_NONE;
+ }
+
+ dict = PyType_stgdict(restype);
+ if (dict == NULL)
+ return PyObject_CallFunction(restype, "i", *(int *)result);
+
+ if (dict->getfunc && !_ctypes_simple_instance(restype)) {
+ retval = dict->getfunc(result, dict->size);
+ /* If restype is py_object (detected by comparing getfunc with
+ O_get), we have to call Py_DECREF because O_get has already
+ called Py_INCREF.
+ */
+ if (dict->getfunc == _ctypes_get_fielddesc("O")->getfunc) {
+ Py_DECREF(retval);
+ }
+ } else
+ retval = PyCData_FromBaseObj(restype, NULL, 0, result);
+
+ if (!checker || !retval)
+ return retval;
+
+ v = PyObject_CallOneArg(checker, retval);
+ if (v == NULL)
+ _PyTraceback_Add("GetResult", "_ctypes/callproc.c", __LINE__-2);
+ Py_DECREF(retval);
+ return v;
+}
+
+/*
+ * Raise a new exception 'exc_class', adding additional text to the original
+ * exception string.
+ */
+void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...)
+{
+ va_list vargs;
+
+ va_start(vargs, fmt);
+ PyObject *s = PyUnicode_FromFormatV(fmt, vargs);
+ va_end(vargs);
+ if (s == NULL) {
+ return;
+ }
+
+ assert(PyErr_Occurred());
+ PyObject *exc = PyErr_GetRaisedException();
+ assert(exc != NULL);
+ PyObject *cls_str = PyType_GetName(Py_TYPE(exc));
+ if (cls_str) {
+ PyUnicode_AppendAndDel(&s, cls_str);
+ PyUnicode_AppendAndDel(&s, PyUnicode_FromString(": "));
+ if (s == NULL) {
+ goto error;
+ }
+ }
+ else {
+ PyErr_Clear();
+ }
+
+ PyObject *msg_str = PyObject_Str(exc);
+ if (msg_str) {
+ PyUnicode_AppendAndDel(&s, msg_str);
+ }
+ else {
+ PyErr_Clear();
+ PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
+ }
+ if (s == NULL) {
+ goto error;
+ }
+ PyErr_SetObject(exc_class, s);
+error:
+ Py_XDECREF(exc);
+ Py_XDECREF(s);
+}
+
+
+#ifdef MS_WIN32
+
+static PyObject *
+GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
+{
+ HRESULT hr;
+ ISupportErrorInfo *psei = NULL;
+ IErrorInfo *pei = NULL;
+ BSTR descr=NULL, helpfile=NULL, source=NULL;
+ GUID guid;
+ DWORD helpcontext=0;
+ LPOLESTR progid;
+ PyObject *obj;
+ LPOLESTR text;
+
+ /* We absolutely have to release the GIL during COM method calls,
+ otherwise we may get a deadlock!
+ */
+ Py_BEGIN_ALLOW_THREADS
+
+ hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei);
+ if (FAILED(hr))
+ goto failed;
+
+ hr = psei->lpVtbl->InterfaceSupportsErrorInfo(psei, riid);
+ psei->lpVtbl->Release(psei);
+ if (FAILED(hr))
+ goto failed;
+
+ hr = GetErrorInfo(0, &pei);
+ if (hr != S_OK)
+ goto failed;
+
+ pei->lpVtbl->GetDescription(pei, &descr);
+ pei->lpVtbl->GetGUID(pei, &guid);
+ pei->lpVtbl->GetHelpContext(pei, &helpcontext);
+ pei->lpVtbl->GetHelpFile(pei, &helpfile);
+ pei->lpVtbl->GetSource(pei, &source);
+
+ pei->lpVtbl->Release(pei);
+
+ failed:
+ Py_END_ALLOW_THREADS
+
+ progid = NULL;
+ ProgIDFromCLSID(&guid, &progid);
+
+ text = FormatError(errcode);
+ obj = Py_BuildValue(
+ "iu(uuuiu)",
+ errcode,
+ text,
+ descr, source, helpfile, helpcontext,
+ progid);
+ if (obj) {
+ ctypes_state *st = GLOBAL_STATE();
+ PyErr_SetObject((PyObject *)st->PyComError_Type, obj);
+ Py_DECREF(obj);
+ }
+ LocalFree(text);
+
+ if (descr)
+ SysFreeString(descr);
+ if (helpfile)
+ SysFreeString(helpfile);
+ if (source)
+ SysFreeString(source);
+
+ return NULL;
+}
+#endif
+
+#if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
+ defined(__aarch64__) || defined(__riscv)
+#define CTYPES_PASS_BY_REF_HACK
+#define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
+#define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))
+#endif
+
+/*
+ * Requirements, must be ensured by the caller:
+ * - argtuple is tuple of arguments
+ * - argtypes is either NULL, or a tuple of the same size as argtuple
+ *
+ * - XXX various requirements for restype, not yet collected
+ */
+PyObject *_ctypes_callproc(PPROC pProc,
+ PyObject *argtuple,
+#ifdef MS_WIN32
+ IUnknown *pIunk,
+ GUID *iid,
+#endif
+ int flags,
+ PyObject *argtypes, /* misleading name: This is a tuple of
+ methods, not types: the .from_param
+ class methods of the types */
+ PyObject *restype,
+ PyObject *checker)
+{
+ Py_ssize_t i, n, argcount, argtype_count;
+ void *resbuf;
+ struct argument *args, *pa;
+ ffi_type **atypes;
+ ffi_type *rtype;
+ void **avalues;
+ PyObject *retval = NULL;
+
+ n = argcount = PyTuple_GET_SIZE(argtuple);
+#ifdef MS_WIN32
+ /* an optional COM object this pointer */
+ if (pIunk)
+ ++argcount;
+#endif
+
+ if (argcount > CTYPES_MAX_ARGCOUNT)
+ {
+ PyErr_Format(PyExc_ArgError, "too many arguments (%zi), maximum is %i",
+ argcount, CTYPES_MAX_ARGCOUNT);
+ return NULL;
+ }
+
+ args = alloca(sizeof(struct argument) * argcount);
+ memset(args, 0, sizeof(struct argument) * argcount);
+ argtype_count = argtypes ? PyTuple_GET_SIZE(argtypes) : 0;
+#ifdef MS_WIN32
+ if (pIunk) {
+ args[0].ffi_type = &ffi_type_pointer;
+ args[0].value.p = pIunk;
+ pa = &args[1];
+ } else
+#endif
+ pa = &args[0];
+
+ /* Convert the arguments */
+ for (i = 0; i < n; ++i, ++pa) {
+ PyObject *converter;
+ PyObject *arg;
+ int err;
+
+ arg = PyTuple_GET_ITEM(argtuple, i); /* borrowed ref */
+ /* For cdecl functions, we allow more actual arguments
+ than the length of the argtypes tuple.
+ This is checked in _ctypes::PyCFuncPtr_Call
+ */
+ if (argtypes && argtype_count > i) {
+ PyObject *v;
+ converter = PyTuple_GET_ITEM(argtypes, i);
+ v = PyObject_CallOneArg(converter, arg);
+ if (v == NULL) {
+ _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
+ goto cleanup;
+ }
+
+ err = ConvParam(v, i+1, pa);
+ Py_DECREF(v);
+ if (-1 == err) {
+ _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
+ goto cleanup;
+ }
+ } else {
+ err = ConvParam(arg, i+1, pa);
+ if (-1 == err) {
+ _ctypes_extend_error(PyExc_ArgError, "argument %zd: ", i+1);
+ goto cleanup; /* leaking ? */
+ }
+ }
+ }
+
+ if (restype == Py_None) {
+ rtype = &ffi_type_void;
+ } else {
+ rtype = _ctypes_get_ffi_type(restype);
+ }
+
+ resbuf = alloca(max(rtype->size, sizeof(ffi_arg)));
+
+#ifdef _Py_MEMORY_SANITIZER
+ /* ffi_call actually initializes resbuf, but from asm, which
+ * MemorySanitizer can't detect. Avoid false positives from MSan. */
+ if (resbuf != NULL) {
+ __msan_unpoison(resbuf, max(rtype->size, sizeof(ffi_arg)));
+ }
+#endif
+ avalues = (void **)alloca(sizeof(void *) * argcount);
+ atypes = (ffi_type **)alloca(sizeof(ffi_type *) * argcount);
+ if (!resbuf || !avalues || !atypes) {
+ PyErr_NoMemory();
+ goto cleanup;
+ }
+ for (i = 0; i < argcount; ++i) {
+ atypes[i] = args[i].ffi_type;
+#ifdef CTYPES_PASS_BY_REF_HACK
+ size_t size = atypes[i]->size;
+ if (IS_PASS_BY_REF(size)) {
+ void *tmp = alloca(size);
+ if (atypes[i]->type == FFI_TYPE_STRUCT)
+ memcpy(tmp, args[i].value.p, size);
+ else
+ memcpy(tmp, (void*)&args[i].value, size);
+
+ avalues[i] = tmp;
+ }
+ else
+#endif
+ if (atypes[i]->type == FFI_TYPE_STRUCT)
+ avalues[i] = (void *)args[i].value.p;
+ else
+ avalues[i] = (void *)&args[i].value;
+ }
+
+ if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
+ rtype, resbuf,
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
+ goto cleanup;
+
+#ifdef WORDS_BIGENDIAN
+ /* libffi returns the result in a buffer with sizeof(ffi_arg). This
+ causes problems on big endian machines, since the result buffer
+ address cannot simply be used as result pointer, instead we must
+ adjust the pointer value:
+ */
+ /*
+ XXX I should find out and clarify why this is needed at all,
+ especially why adjusting for ffi_type_float must be avoided on
+ 64-bit platforms.
+ */
+ if (rtype->type != FFI_TYPE_FLOAT
+ && rtype->type != FFI_TYPE_STRUCT
+ && rtype->size < sizeof(ffi_arg))
+ {
+ resbuf = (char *)resbuf + sizeof(ffi_arg) - rtype->size;
+ }
+#endif
+
+#ifdef MS_WIN32
+ if (iid && pIunk) {
+ if (*(int *)resbuf & 0x80000000)
+ retval = GetComError(*(HRESULT *)resbuf, iid, pIunk);
+ else
+ retval = PyLong_FromLong(*(int *)resbuf);
+ } else if (flags & FUNCFLAG_HRESULT) {
+ if (*(int *)resbuf & 0x80000000)
+ retval = PyErr_SetFromWindowsErr(*(int *)resbuf);
+ else
+ retval = PyLong_FromLong(*(int *)resbuf);
+ } else
+#endif
+ retval = GetResult(restype, resbuf, checker);
+ cleanup:
+ for (i = 0; i < argcount; ++i)
+ Py_XDECREF(args[i].keep);
+ return retval;
+}
+
+static int
+_parse_voidp(PyObject *obj, void **address)
+{
+ *address = PyLong_AsVoidPtr(obj);
+ if (*address == NULL)
+ return 0;
+ return 1;
+}
+
+#ifdef MS_WIN32
+
+PyDoc_STRVAR(format_error_doc,
+"FormatError([integer]) -> string\n\
+\n\
+Convert a win32 error code into a string. If the error code is not\n\
+given, the return value of a call to GetLastError() is used.\n");
+static PyObject *format_error(PyObject *self, PyObject *args)
+{
+ PyObject *result;
+ wchar_t *lpMsgBuf;
+ DWORD code = 0;
+ if (!PyArg_ParseTuple(args, "|i:FormatError", &code))
+ return NULL;
+ if (code == 0)
+ code = GetLastError();
+ lpMsgBuf = FormatError(code);
+ if (lpMsgBuf) {
+ result = PyUnicode_FromWideChar(lpMsgBuf, wcslen(lpMsgBuf));
+ LocalFree(lpMsgBuf);
+ } else {
+ result = PyUnicode_FromString("<no description>");
+ }
+ return result;
+}
+
+PyDoc_STRVAR(load_library_doc,
+"LoadLibrary(name, load_flags) -> handle\n\
+\n\
+Load an executable (usually a DLL), and return a handle to it.\n\
+The handle may be used to locate exported functions in this\n\
+module. load_flags are as defined for LoadLibraryEx in the\n\
+Windows API.\n");
+static PyObject *load_library(PyObject *self, PyObject *args)
+{
+ PyObject *nameobj;
+ int load_flags = 0;
+ HMODULE hMod;
+ DWORD err;
+
+ if (!PyArg_ParseTuple(args, "U|i:LoadLibrary", &nameobj, &load_flags))
+ return NULL;
+
+ if (PySys_Audit("ctypes.dlopen", "O", nameobj) < 0) {
+ return NULL;
+ }
+
+ WCHAR *name = PyUnicode_AsWideCharString(nameobj, NULL);
+ if (!name)
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* bpo-36085: Limit DLL search directories to avoid pre-loading
+ * attacks and enable use of the AddDllDirectory function.
+ */
+ hMod = LoadLibraryExW(name, NULL, (DWORD)load_flags);
+ err = hMod ? 0 : GetLastError();
+ Py_END_ALLOW_THREADS
+
+ PyMem_Free(name);
+ if (err == ERROR_MOD_NOT_FOUND) {
+ PyErr_Format(PyExc_FileNotFoundError,
+ ("Could not find module '%.500S' (or one of its "
+ "dependencies). Try using the full path with "
+ "constructor syntax."),
+ nameobj);
+ return NULL;
+ } else if (err) {
+ return PyErr_SetFromWindowsErr(err);
+ }
+#ifdef _WIN64
+ return PyLong_FromVoidPtr(hMod);
+#else
+ return Py_BuildValue("i", hMod);
+#endif
+}
+
+PyDoc_STRVAR(free_library_doc,
+"FreeLibrary(handle) -> void\n\
+\n\
+Free the handle of an executable previously loaded by LoadLibrary.\n");
+static PyObject *free_library(PyObject *self, PyObject *args)
+{
+ void *hMod;
+ BOOL result;
+ DWORD err;
+ if (!PyArg_ParseTuple(args, "O&:FreeLibrary", &_parse_voidp, &hMod))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = FreeLibrary((HMODULE)hMod);
+ err = result ? 0 : GetLastError();
+ Py_END_ALLOW_THREADS
+
+ if (!result) {
+ return PyErr_SetFromWindowsErr(err);
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(copy_com_pointer_doc,
+"CopyComPointer(src, dst) -> HRESULT value\n");
+
+static PyObject *
+copy_com_pointer(PyObject *self, PyObject *args)
+{
+ PyObject *p1, *p2, *r = NULL;
+ struct argument a, b;
+ IUnknown *src, **pdst;
+ if (!PyArg_ParseTuple(args, "OO:CopyComPointer", &p1, &p2))
+ return NULL;
+ a.keep = b.keep = NULL;
+
+ if (-1 == ConvParam(p1, 0, &a) || -1 == ConvParam(p2, 1, &b))
+ goto done;
+ src = (IUnknown *)a.value.p;
+ pdst = (IUnknown **)b.value.p;
+
+ if (pdst == NULL)
+ r = PyLong_FromLong(E_POINTER);
+ else {
+ if (src)
+ src->lpVtbl->AddRef(src);
+ *pdst = src;
+ r = PyLong_FromLong(S_OK);
+ }
+ done:
+ Py_XDECREF(a.keep);
+ Py_XDECREF(b.keep);
+ return r;
+}
+#else
+#ifdef __APPLE__
+#ifdef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH
+# ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
+ __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
+# else
+# define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
+ (_dyld_shared_cache_contains_path != NULL)
+# endif
+#else
+// Support the deprecated case of compiling on an older macOS version
+static void *libsystem_b_handle;
+static bool (*_dyld_shared_cache_contains_path)(const char *path);
+
+__attribute__((constructor)) void load_dyld_shared_cache_contains_path(void) {
+ libsystem_b_handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY);
+ if (libsystem_b_handle != NULL) {
+ _dyld_shared_cache_contains_path = dlsym(libsystem_b_handle, "_dyld_shared_cache_contains_path");
+ }
+}
+
+__attribute__((destructor)) void unload_dyld_shared_cache_contains_path(void) {
+ if (libsystem_b_handle != NULL) {
+ dlclose(libsystem_b_handle);
+ }
+}
+#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \
+ _dyld_shared_cache_contains_path != NULL
+#endif
+
+static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *args)
+{
+ PyObject *name, *name2;
+ char *name_str;
+
+ if (HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME) {
+ int r;
+
+ if (!PyArg_ParseTuple(args, "O", &name))
+ return NULL;
+
+ if (name == Py_None)
+ Py_RETURN_FALSE;
+
+ if (PyUnicode_FSConverter(name, &name2) == 0)
+ return NULL;
+ name_str = PyBytes_AS_STRING(name2);
+
+ r = _dyld_shared_cache_contains_path(name_str);
+ Py_DECREF(name2);
+
+ if (r) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+
+ } else {
+ PyErr_SetString(PyExc_NotImplementedError, "_dyld_shared_cache_contains_path symbol is missing");
+ return NULL;
+ }
+
+ }
+#endif
+
+static PyObject *py_dl_open(PyObject *self, PyObject *args)
+{
+ PyObject *name, *name2;
+ const char *name_str;
+ void * handle;
+#if HAVE_DECL_RTLD_LOCAL
+ int mode = RTLD_NOW | RTLD_LOCAL;
+#else
+ /* cygwin doesn't define RTLD_LOCAL */
+ int mode = RTLD_NOW;
+#endif
+ if (!PyArg_ParseTuple(args, "O|i:dlopen", &name, &mode))
+ return NULL;
+ mode |= RTLD_NOW;
+ if (name != Py_None) {
+ if (PyUnicode_FSConverter(name, &name2) == 0)
+ return NULL;
+ name_str = PyBytes_AS_STRING(name2);
+ } else {
+ name_str = NULL;
+ name2 = NULL;
+ }
+ if (PySys_Audit("ctypes.dlopen", "O", name) < 0) {
+ return NULL;
+ }
+ handle = dlopen(name_str, mode);
+ Py_XDECREF(name2);
+ if (!handle) {
+ const char *errmsg = dlerror();
+ if (!errmsg)
+ errmsg = "dlopen() error";
+ PyErr_SetString(PyExc_OSError,
+ errmsg);
+ return NULL;
+ }
+ return PyLong_FromVoidPtr(handle);
+}
+
+static PyObject *py_dl_close(PyObject *self, PyObject *args)
+{
+ void *handle;
+
+ if (!PyArg_ParseTuple(args, "O&:dlclose", &_parse_voidp, &handle))
+ return NULL;
+ if (dlclose(handle)) {
+ PyErr_SetString(PyExc_OSError,
+ dlerror());
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *py_dl_sym(PyObject *self, PyObject *args)
+{
+ char *name;
+ void *handle;
+ void *ptr;
+
+ if (!PyArg_ParseTuple(args, "O&s:dlsym",
+ &_parse_voidp, &handle, &name))
+ return NULL;
+ if (PySys_Audit("ctypes.dlsym/handle", "O", args) < 0) {
+ return NULL;
+ }
+ ptr = dlsym((void*)handle, name);
+ if (!ptr) {
+ PyErr_SetString(PyExc_OSError,
+ dlerror());
+ return NULL;
+ }
+ return PyLong_FromVoidPtr(ptr);
+}
+#endif
+
+/*
+ * Only for debugging so far: So that we can call CFunction instances
+ *
+ * XXX Needs to accept more arguments: flags, argtypes, restype
+ */
+static PyObject *
+call_function(PyObject *self, PyObject *args)
+{
+ void *func;
+ PyObject *arguments;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args,
+ "O&O!",
+ &_parse_voidp, &func,
+ &PyTuple_Type, &arguments))
+ return NULL;
+ if (PySys_Audit("ctypes.call_function", "nO",
+ (Py_ssize_t)func, arguments) < 0) {
+ return NULL;
+ }
+
+ result = _ctypes_callproc((PPROC)func,
+ arguments,
+#ifdef MS_WIN32
+ NULL,
+ NULL,
+#endif
+ 0, /* flags */
+ NULL, /* self->argtypes */
+ NULL, /* self->restype */
+ NULL); /* checker */
+ return result;
+}
+
+/*
+ * Only for debugging so far: So that we can call CFunction instances
+ *
+ * XXX Needs to accept more arguments: flags, argtypes, restype
+ */
+static PyObject *
+call_cdeclfunction(PyObject *self, PyObject *args)
+{
+ void *func;
+ PyObject *arguments;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args,
+ "O&O!",
+ &_parse_voidp, &func,
+ &PyTuple_Type, &arguments))
+ return NULL;
+ if (PySys_Audit("ctypes.call_function", "nO",
+ (Py_ssize_t)func, arguments) < 0) {
+ return NULL;
+ }
+
+ result = _ctypes_callproc((PPROC)func,
+ arguments,
+#ifdef MS_WIN32
+ NULL,
+ NULL,
+#endif
+ FUNCFLAG_CDECL, /* flags */
+ NULL, /* self->argtypes */
+ NULL, /* self->restype */
+ NULL); /* checker */
+ return result;
+}
+
+/*****************************************************************
+ * functions
+ */
+PyDoc_STRVAR(sizeof_doc,
+"sizeof(C type) -> integer\n"
+"sizeof(C instance) -> integer\n"
+"Return the size in bytes of a C instance");
+
+static PyObject *
+sizeof_func(PyObject *self, PyObject *obj)
+{
+ StgDictObject *dict;
+
+ dict = PyType_stgdict(obj);
+ if (dict)
+ return PyLong_FromSsize_t(dict->size);
+
+ if (CDataObject_Check(obj))
+ return PyLong_FromSsize_t(((CDataObject *)obj)->b_size);
+ PyErr_SetString(PyExc_TypeError,
+ "this type has no size");
+ return NULL;
+}
+
+PyDoc_STRVAR(alignment_doc,
+"alignment(C type) -> integer\n"
+"alignment(C instance) -> integer\n"
+"Return the alignment requirements of a C instance");
+
+static PyObject *
+align_func(PyObject *self, PyObject *obj)
+{
+ StgDictObject *dict;
+
+ dict = PyType_stgdict(obj);
+ if (dict)
+ return PyLong_FromSsize_t(dict->align);
+
+ dict = PyObject_stgdict(obj);
+ if (dict)
+ return PyLong_FromSsize_t(dict->align);
+
+ PyErr_SetString(PyExc_TypeError,
+ "no alignment info");
+ return NULL;
+}
+
+PyDoc_STRVAR(byref_doc,
+"byref(C instance[, offset=0]) -> byref-object\n"
+"Return a pointer lookalike to a C instance, only usable\n"
+"as function argument");
+
+/*
+ * We must return something which can be converted to a parameter,
+ * but still has a reference to self.
+ */
+static PyObject *
+byref(PyObject *self, PyObject *args)
+{
+ PyCArgObject *parg;
+ PyObject *obj;
+ PyObject *pyoffset = NULL;
+ Py_ssize_t offset = 0;
+
+ if (!PyArg_UnpackTuple(args, "byref", 1, 2,
+ &obj, &pyoffset))
+ return NULL;
+ if (pyoffset) {
+ offset = PyNumber_AsSsize_t(pyoffset, NULL);
+ if (offset == -1 && PyErr_Occurred())
+ return NULL;
+ }
+ if (!CDataObject_Check(obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "byref() argument must be a ctypes instance, not '%s'",
+ Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+
+ parg = PyCArgObject_new();
+ if (parg == NULL)
+ return NULL;
+
+ parg->tag = 'P';
+ parg->pffi_type = &ffi_type_pointer;
+ parg->obj = Py_NewRef(obj);
+ parg->value.p = (char *)((CDataObject *)obj)->b_ptr + offset;
+ return (PyObject *)parg;
+}
+
+PyDoc_STRVAR(addressof_doc,
+"addressof(C instance) -> integer\n"
+"Return the address of the C instance internal buffer");
+
+static PyObject *
+addressof(PyObject *self, PyObject *obj)
+{
+ if (!CDataObject_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError,
+ "invalid type");
+ return NULL;
+ }
+ if (PySys_Audit("ctypes.addressof", "(O)", obj) < 0) {
+ return NULL;
+ }
+ return PyLong_FromVoidPtr(((CDataObject *)obj)->b_ptr);
+}
+
+static int
+converter(PyObject *obj, void **address)
+{
+ *address = PyLong_AsVoidPtr(obj);
+ return *address != NULL;
+}
+
+static PyObject *
+My_PyObj_FromPtr(PyObject *self, PyObject *args)
+{
+ PyObject *ob;
+ if (!PyArg_ParseTuple(args, "O&:PyObj_FromPtr", converter, &ob)) {
+ return NULL;
+ }
+ if (PySys_Audit("ctypes.PyObj_FromPtr", "(O)", ob) < 0) {
+ return NULL;
+ }
+ return Py_NewRef(ob);
+}
+
+static PyObject *
+My_Py_INCREF(PyObject *self, PyObject *arg)
+{
+ Py_INCREF(arg); /* that's what this function is for */
+ Py_INCREF(arg); /* that for returning it */
+ return arg;
+}
+
+static PyObject *
+My_Py_DECREF(PyObject *self, PyObject *arg)
+{
+ Py_DECREF(arg); /* that's what this function is for */
+ Py_INCREF(arg); /* that's for returning it */
+ return arg;
+}
+
+static PyObject *
+resize(PyObject *self, PyObject *args)
+{
+ CDataObject *obj;
+ StgDictObject *dict;
+ Py_ssize_t size;
+
+ if (!PyArg_ParseTuple(args,
+ "On:resize",
+ &obj, &size))
+ return NULL;
+
+ dict = PyObject_stgdict((PyObject *)obj);
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "expected ctypes instance");
+ return NULL;
+ }
+ if (size < dict->size) {
+ PyErr_Format(PyExc_ValueError,
+ "minimum size is %zd",
+ dict->size);
+ return NULL;
+ }
+ if (obj->b_needsfree == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Memory cannot be resized because this object doesn't own it");
+ return NULL;
+ }
+ if ((size_t)size <= sizeof(obj->b_value)) {
+ /* internal default buffer is large enough */
+ obj->b_size = size;
+ goto done;
+ }
+ if (!_CDataObject_HasExternalBuffer(obj)) {
+ /* We are currently using the objects default buffer, but it
+ isn't large enough any more. */
+ void *ptr = PyMem_Calloc(1, size);
+ if (ptr == NULL)
+ return PyErr_NoMemory();
+ memmove(ptr, obj->b_ptr, obj->b_size);
+ obj->b_ptr = ptr;
+ obj->b_size = size;
+ } else {
+ void * ptr = PyMem_Realloc(obj->b_ptr, size);
+ if (ptr == NULL)
+ return PyErr_NoMemory();
+ obj->b_ptr = ptr;
+ obj->b_size = size;
+ }
+ done:
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+unpickle(PyObject *self, PyObject *args)
+{
+ PyObject *typ, *state, *meth, *obj, *result;
+
+ if (!PyArg_ParseTuple(args, "OO!", &typ, &PyTuple_Type, &state))
+ return NULL;
+ obj = PyObject_CallMethodOneArg(typ, &_Py_ID(__new__), typ);
+ if (obj == NULL)
+ return NULL;
+
+ meth = PyObject_GetAttr(obj, &_Py_ID(__setstate__));
+ if (meth == NULL) {
+ goto error;
+ }
+
+ result = PyObject_Call(meth, state, NULL);
+ Py_DECREF(meth);
+ if (result == NULL) {
+ goto error;
+ }
+ Py_DECREF(result);
+
+ return obj;
+
+error:
+ Py_DECREF(obj);
+ return NULL;
+}
+
+static PyObject *
+POINTER(PyObject *self, PyObject *cls)
+{
+ PyObject *result;
+ PyTypeObject *typ;
+ PyObject *key;
+
+ result = PyDict_GetItemWithError(_ctypes_ptrtype_cache, cls);
+ if (result) {
+ return Py_NewRef(result);
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ if (PyUnicode_CheckExact(cls)) {
+ PyObject *name = PyUnicode_FromFormat("LP_%U", cls);
+ result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
+ "N(O){}",
+ name,
+ &PyCPointer_Type);
+ if (result == NULL)
+ return result;
+ key = PyLong_FromVoidPtr(result);
+ if (key == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ } else if (PyType_Check(cls)) {
+ typ = (PyTypeObject *)cls;
+ PyObject *name = PyUnicode_FromFormat("LP_%s", typ->tp_name);
+ result = PyObject_CallFunction((PyObject *)Py_TYPE(&PyCPointer_Type),
+ "N(O){sO}",
+ name,
+ &PyCPointer_Type,
+ "_type_", cls);
+ if (result == NULL)
+ return result;
+ key = Py_NewRef(cls);
+ } else {
+ PyErr_SetString(PyExc_TypeError, "must be a ctypes type");
+ return NULL;
+ }
+ if (-1 == PyDict_SetItem(_ctypes_ptrtype_cache, key, result)) {
+ Py_DECREF(result);
+ Py_DECREF(key);
+ return NULL;
+ }
+ Py_DECREF(key);
+ return result;
+}
+
+static PyObject *
+pointer(PyObject *self, PyObject *arg)
+{
+ PyObject *result;
+ PyObject *typ;
+
+ typ = PyDict_GetItemWithError(_ctypes_ptrtype_cache, (PyObject *)Py_TYPE(arg));
+ if (typ) {
+ return PyObject_CallOneArg(typ, arg);
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ typ = POINTER(NULL, (PyObject *)Py_TYPE(arg));
+ if (typ == NULL)
+ return NULL;
+ result = PyObject_CallOneArg(typ, arg);
+ Py_DECREF(typ);
+ return result;
+}
+
+static PyObject *
+buffer_info(PyObject *self, PyObject *arg)
+{
+ StgDictObject *dict = PyType_stgdict(arg);
+ PyObject *shape;
+ Py_ssize_t i;
+
+ if (dict == NULL)
+ dict = PyObject_stgdict(arg);
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctypes type or object");
+ return NULL;
+ }
+ shape = PyTuple_New(dict->ndim);
+ if (shape == NULL)
+ return NULL;
+ for (i = 0; i < (int)dict->ndim; ++i)
+ PyTuple_SET_ITEM(shape, i, PyLong_FromSsize_t(dict->shape[i]));
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(shape);
+ return NULL;
+ }
+ return Py_BuildValue("siN", dict->format, dict->ndim, shape);
+}
+
+
+
+PyMethodDef _ctypes_module_methods[] = {
+ {"get_errno", get_errno, METH_NOARGS},
+ {"set_errno", set_errno, METH_VARARGS},
+ {"POINTER", POINTER, METH_O },
+ {"pointer", pointer, METH_O },
+ {"_unpickle", unpickle, METH_VARARGS },
+ {"buffer_info", buffer_info, METH_O, "Return buffer interface information"},
+ {"resize", resize, METH_VARARGS, "Resize the memory buffer of a ctypes instance"},
+#ifdef MS_WIN32
+ {"get_last_error", get_last_error, METH_NOARGS},
+ {"set_last_error", set_last_error, METH_VARARGS},
+ {"CopyComPointer", copy_com_pointer, METH_VARARGS, copy_com_pointer_doc},
+ {"FormatError", format_error, METH_VARARGS, format_error_doc},
+ {"LoadLibrary", load_library, METH_VARARGS, load_library_doc},
+ {"FreeLibrary", free_library, METH_VARARGS, free_library_doc},
+ {"_check_HRESULT", check_hresult, METH_VARARGS},
+#else
+ {"dlopen", py_dl_open, METH_VARARGS,
+ "dlopen(name, flag={RTLD_GLOBAL|RTLD_LOCAL}) open a shared library"},
+ {"dlclose", py_dl_close, METH_VARARGS, "dlclose a library"},
+ {"dlsym", py_dl_sym, METH_VARARGS, "find symbol in shared library"},
+#endif
+#ifdef __APPLE__
+ {"_dyld_shared_cache_contains_path", py_dyld_shared_cache_contains_path, METH_VARARGS, "check if path is in the shared cache"},
+#endif
+ {"alignment", align_func, METH_O, alignment_doc},
+ {"sizeof", sizeof_func, METH_O, sizeof_doc},
+ {"byref", byref, METH_VARARGS, byref_doc},
+ {"addressof", addressof, METH_O, addressof_doc},
+ {"call_function", call_function, METH_VARARGS },
+ {"call_cdeclfunction", call_cdeclfunction, METH_VARARGS },
+ {"PyObj_FromPtr", My_PyObj_FromPtr, METH_VARARGS },
+ {"Py_INCREF", My_Py_INCREF, METH_O },
+ {"Py_DECREF", My_Py_DECREF, METH_O },
+ {NULL, NULL} /* Sentinel */
+};
+
+/*
+ Local Variables:
+ compile-command: "cd .. && python setup.py -q build -g && python setup.py -q build install --home ~"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/cfield.c b/contrib/tools/python3/Modules/_ctypes/cfield.c
new file mode 100644
index 00000000000..128506a9eed
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/cfield.c
@@ -0,0 +1,1585 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_bitutils.h" // _Py_bswap32()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+
+#include <ffi.h>
+#include "ctypes.h"
+
+
+#define CTYPES_CFIELD_CAPSULE_NAME_PYMEM "_ctypes/cfield.c pymem"
+
+static void pymem_destructor(PyObject *ptr)
+{
+ void *p = PyCapsule_GetPointer(ptr, CTYPES_CFIELD_CAPSULE_NAME_PYMEM);
+ if (p) {
+ PyMem_Free(p);
+ }
+}
+
+
+/******************************************************************/
+/*
+ PyCField_Type
+*/
+
+/*
+ * Expects the size, index and offset for the current field in *psize and
+ * *poffset, stores the total size so far in *psize, the offset for the next
+ * field in *poffset, the alignment requirements for the current field in
+ * *palign, and returns a field descriptor for this field.
+ */
+/*
+ * bitfields extension:
+ * bitsize != 0: this is a bit field.
+ * pbitofs points to the current bit offset, this will be updated.
+ * prev_desc points to the type of the previous bitfield, if any.
+ */
+PyObject *
+PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
+ Py_ssize_t *pfield_size, int bitsize, int *pbitofs,
+ Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign,
+ int pack, int big_endian)
+{
+ CFieldObject *self;
+ PyObject *proto;
+ Py_ssize_t size, align;
+ SETFUNC setfunc = NULL;
+ GETFUNC getfunc = NULL;
+ StgDictObject *dict;
+ int fieldtype;
+#define NO_BITFIELD 0
+#define NEW_BITFIELD 1
+#define CONT_BITFIELD 2
+#define EXPAND_BITFIELD 3
+
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *tp = st->PyCField_Type;
+ self = (CFieldObject *)tp->tp_alloc(tp, 0);
+ if (self == NULL)
+ return NULL;
+ dict = PyType_stgdict(desc);
+ if (!dict) {
+ PyErr_SetString(PyExc_TypeError,
+ "has no _stginfo_");
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (bitsize /* this is a bitfield request */
+ && *pfield_size /* we have a bitfield open */
+#ifdef MS_WIN32
+ /* MSVC, GCC with -mms-bitfields */
+ && dict->size * 8 == *pfield_size
+#else
+ /* GCC */
+ && dict->size * 8 <= *pfield_size
+#endif
+ && (*pbitofs + bitsize) <= *pfield_size) {
+ /* continue bit field */
+ fieldtype = CONT_BITFIELD;
+#ifndef MS_WIN32
+ } else if (bitsize /* this is a bitfield request */
+ && *pfield_size /* we have a bitfield open */
+ && dict->size * 8 >= *pfield_size
+ && (*pbitofs + bitsize) <= dict->size * 8) {
+ /* expand bit field */
+ fieldtype = EXPAND_BITFIELD;
+#endif
+ } else if (bitsize) {
+ /* start new bitfield */
+ fieldtype = NEW_BITFIELD;
+ *pbitofs = 0;
+ *pfield_size = dict->size * 8;
+ } else {
+ /* not a bit field */
+ fieldtype = NO_BITFIELD;
+ *pbitofs = 0;
+ *pfield_size = 0;
+ }
+
+ size = dict->size;
+ proto = desc;
+
+ /* Field descriptors for 'c_char * n' are be scpecial cased to
+ return a Python string instead of an Array object instance...
+ */
+ if (PyCArrayTypeObject_Check(proto)) {
+ StgDictObject *adict = PyType_stgdict(proto);
+ StgDictObject *idict;
+ if (adict && adict->proto) {
+ idict = PyType_stgdict(adict->proto);
+ if (!idict) {
+ PyErr_SetString(PyExc_TypeError,
+ "has no _stginfo_");
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (idict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
+ struct fielddesc *fd = _ctypes_get_fielddesc("s");
+ getfunc = fd->getfunc;
+ setfunc = fd->setfunc;
+ }
+ if (idict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
+ struct fielddesc *fd = _ctypes_get_fielddesc("U");
+ getfunc = fd->getfunc;
+ setfunc = fd->setfunc;
+ }
+ }
+ }
+
+ self->setfunc = setfunc;
+ self->getfunc = getfunc;
+ self->index = index;
+
+ self->proto = Py_NewRef(proto);
+
+ switch (fieldtype) {
+ case NEW_BITFIELD:
+ if (big_endian)
+ self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
+ else
+ self->size = (bitsize << 16) + *pbitofs;
+ *pbitofs = bitsize;
+ /* fall through */
+ case NO_BITFIELD:
+ if (pack)
+ align = min(pack, dict->align);
+ else
+ align = dict->align;
+ if (align && *poffset % align) {
+ Py_ssize_t delta = align - (*poffset % align);
+ *psize += delta;
+ *poffset += delta;
+ }
+
+ if (bitsize == 0)
+ self->size = size;
+ *psize += size;
+
+ self->offset = *poffset;
+ *poffset += size;
+
+ *palign = align;
+ break;
+
+ case EXPAND_BITFIELD:
+ *poffset += dict->size - *pfield_size/8;
+ *psize += dict->size - *pfield_size/8;
+
+ *pfield_size = dict->size * 8;
+
+ if (big_endian)
+ self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
+ else
+ self->size = (bitsize << 16) + *pbitofs;
+
+ self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
+ *pbitofs += bitsize;
+ break;
+
+ case CONT_BITFIELD:
+ if (big_endian)
+ self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
+ else
+ self->size = (bitsize << 16) + *pbitofs;
+
+ self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
+ *pbitofs += bitsize;
+ break;
+ }
+
+ return (PyObject *)self;
+}
+
+static int
+PyCField_set(CFieldObject *self, PyObject *inst, PyObject *value)
+{
+ CDataObject *dst;
+ char *ptr;
+ if (!CDataObject_Check(inst)) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctype instance");
+ return -1;
+ }
+ dst = (CDataObject *)inst;
+ ptr = dst->b_ptr + self->offset;
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't delete attribute");
+ return -1;
+ }
+ return PyCData_set(inst, self->proto, self->setfunc, value,
+ self->index, self->size, ptr);
+}
+
+static PyObject *
+PyCField_get(CFieldObject *self, PyObject *inst, PyTypeObject *type)
+{
+ CDataObject *src;
+ if (inst == NULL) {
+ return Py_NewRef(self);
+ }
+ if (!CDataObject_Check(inst)) {
+ PyErr_SetString(PyExc_TypeError,
+ "not a ctype instance");
+ return NULL;
+ }
+ src = (CDataObject *)inst;
+ return PyCData_get(self->proto, self->getfunc, inst,
+ self->index, self->size, src->b_ptr + self->offset);
+}
+
+static PyObject *
+PyCField_get_offset(PyObject *self, void *data)
+{
+ return PyLong_FromSsize_t(((CFieldObject *)self)->offset);
+}
+
+static PyObject *
+PyCField_get_size(PyObject *self, void *data)
+{
+ return PyLong_FromSsize_t(((CFieldObject *)self)->size);
+}
+
+static PyGetSetDef PyCField_getset[] = {
+ { "offset", PyCField_get_offset, NULL, "offset in bytes of this field" },
+ { "size", PyCField_get_size, NULL, "size in bytes of this field" },
+ { NULL, NULL, NULL, NULL },
+};
+
+static int
+PyCField_traverse(CFieldObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->proto);
+ return 0;
+}
+
+static int
+PyCField_clear(CFieldObject *self)
+{
+ Py_CLEAR(self->proto);
+ return 0;
+}
+
+static void
+PyCField_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)PyCField_clear((CFieldObject *)self);
+ Py_TYPE(self)->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+PyCField_repr(CFieldObject *self)
+{
+ PyObject *result;
+ Py_ssize_t bits = self->size >> 16;
+ Py_ssize_t size = self->size & 0xFFFF;
+ const char *name;
+
+ name = ((PyTypeObject *)self->proto)->tp_name;
+
+ if (bits)
+ result = PyUnicode_FromFormat(
+ "<Field type=%s, ofs=%zd:%zd, bits=%zd>",
+ name, self->offset, size, bits);
+ else
+ result = PyUnicode_FromFormat(
+ "<Field type=%s, ofs=%zd, size=%zd>",
+ name, self->offset, size);
+ return result;
+}
+
+static PyType_Slot cfield_slots[] = {
+ {Py_tp_dealloc, PyCField_dealloc},
+ {Py_tp_repr, PyCField_repr},
+ {Py_tp_doc, (void *)PyDoc_STR("Structure/Union member")},
+ {Py_tp_traverse, PyCField_traverse},
+ {Py_tp_clear, PyCField_clear},
+ {Py_tp_getset, PyCField_getset},
+ {Py_tp_descr_get, PyCField_get},
+ {Py_tp_descr_set, PyCField_set},
+ {0, NULL},
+};
+
+PyType_Spec cfield_spec = {
+ .name = "_ctypes.CField",
+ .basicsize = sizeof(CFieldObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = cfield_slots,
+};
+
+
+/******************************************************************/
+/*
+ Accessor functions
+*/
+
+/* Derived from Modules/structmodule.c:
+ Helper routine to get a Python integer and raise the appropriate error
+ if it isn't one */
+
+static int
+get_long(PyObject *v, long *p)
+{
+ long x = PyLong_AsUnsignedLongMask(v);
+ if (x == -1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling unsigned long */
+
+static int
+get_ulong(PyObject *v, unsigned long *p)
+{
+ unsigned long x = PyLong_AsUnsignedLongMask(v);
+ if (x == (unsigned long)-1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling native long long. */
+
+static int
+get_longlong(PyObject *v, long long *p)
+{
+ long long x = PyLong_AsUnsignedLongLongMask(v);
+ if (x == -1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling native unsigned long long. */
+
+static int
+get_ulonglong(PyObject *v, unsigned long long *p)
+{
+ unsigned long long x = PyLong_AsUnsignedLongLongMask(v);
+ if (x == (unsigned long long)-1 && PyErr_Occurred())
+ return -1;
+ *p = x;
+ return 0;
+}
+
+/*****************************************************************
+ * Integer fields, with bitfield support
+ */
+
+/* how to decode the size field, for integer get/set functions */
+#define LOW_BIT(x) ((x) & 0xFFFF)
+#define NUM_BITS(x) ((x) >> 16)
+
+/* Doesn't work if NUM_BITS(size) == 0, but it never happens in SET() call. */
+#define BIT_MASK(type, size) (((((type)1 << (NUM_BITS(size) - 1)) - 1) << 1) + 1)
+
+/* This macro CHANGES the first parameter IN PLACE. For proper sign handling,
+ we must first shift left, then right.
+*/
+#define GET_BITFIELD(v, size) \
+ if (NUM_BITS(size)) { \
+ v <<= (sizeof(v)*8 - LOW_BIT(size) - NUM_BITS(size)); \
+ v >>= (sizeof(v)*8 - NUM_BITS(size)); \
+ }
+
+/* This macro RETURNS the first parameter with the bit field CHANGED. */
+#define SET(type, x, v, size) \
+ (NUM_BITS(size) ? \
+ ( ( (type)x & ~(BIT_MASK(type, size) << LOW_BIT(size)) ) | ( ((type)v & BIT_MASK(type, size)) << LOW_BIT(size) ) ) \
+ : (type)v)
+
+#if SIZEOF_SHORT == 2
+# define SWAP_SHORT _Py_bswap16
+#else
+# error "unsupported short size"
+#endif
+
+#if SIZEOF_INT == 4
+# define SWAP_INT _Py_bswap32
+#else
+# error "unsupported int size"
+#endif
+
+#if SIZEOF_LONG == 4
+# define SWAP_LONG _Py_bswap32
+#elif SIZEOF_LONG == 8
+# define SWAP_LONG _Py_bswap64
+#else
+# error "unsupported long size"
+#endif
+
+#if SIZEOF_LONG_LONG == 8
+# define SWAP_LONG_LONG _Py_bswap64
+#else
+# error "unsupported long long size"
+#endif
+
+/*****************************************************************
+ * The setter methods return an object which must be kept alive, to keep the
+ * data valid which has been stored in the memory block. The ctypes object
+ * instance inserts this object into its 'b_objects' list.
+ *
+ * For simple Python types like integers or characters, there is nothing that
+ * has to been kept alive, so Py_None is returned in these cases. But this
+ * makes inspecting the 'b_objects' list, which is accessible from Python for
+ * debugging, less useful.
+ *
+ * So, defining the _CTYPES_DEBUG_KEEP symbol returns the original value
+ * instead of Py_None.
+ */
+
+#ifdef _CTYPES_DEBUG_KEEP
+#define _RET(x) Py_INCREF(x); return x
+#else
+#define _RET(X) Py_RETURN_NONE
+#endif
+
+/*****************************************************************
+ * integer accessor methods, supporting bit fields
+ */
+
+static PyObject *
+b_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ *(signed char *)ptr = SET(signed char, *(signed char *)ptr, val, size);
+ _RET(value);
+}
+
+
+static PyObject *
+b_get(void *ptr, Py_ssize_t size)
+{
+ signed char val = *(signed char *)ptr;
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+B_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ *(unsigned char *)ptr = SET(unsigned char, *(unsigned char*)ptr, val, size);
+ _RET(value);
+}
+
+
+static PyObject *
+B_get(void *ptr, Py_ssize_t size)
+{
+ unsigned char val = *(unsigned char *)ptr;
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+h_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ short x;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(short, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+
+static PyObject *
+h_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ short field;
+ if (get_long(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_SHORT(field);
+ field = SET(short, field, val, size);
+ field = SWAP_SHORT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+static PyObject *
+h_get(void *ptr, Py_ssize_t size)
+{
+ short val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong((long)val);
+}
+
+static PyObject *
+h_get_sw(void *ptr, Py_ssize_t size)
+{
+ short val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_SHORT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+H_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned short x;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(unsigned short, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+H_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned short field;
+ if (get_ulong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_SHORT(field);
+ field = SET(unsigned short, field, val, size);
+ field = SWAP_SHORT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+H_get(void *ptr, Py_ssize_t size)
+{
+ unsigned short val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+H_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned short val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_SHORT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+i_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ int x;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(int, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+i_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ int field;
+ if (get_long(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_INT(field);
+ field = SET(int, field, val, size);
+ field = SWAP_INT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+i_get(void *ptr, Py_ssize_t size)
+{
+ int val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+i_get_sw(void *ptr, Py_ssize_t size)
+{
+ int val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_INT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+#ifndef MS_WIN32
+/* http://msdn.microsoft.com/en-us/library/cc237864.aspx */
+#define VARIANT_FALSE 0x0000
+#define VARIANT_TRUE 0xFFFF
+#endif
+/* short BOOL - VARIANT_BOOL */
+static PyObject *
+vBOOL_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ switch (PyObject_IsTrue(value)) {
+ case -1:
+ return NULL;
+ case 0:
+ *(short int *)ptr = VARIANT_FALSE;
+ _RET(value);
+ default:
+ *(short int *)ptr = VARIANT_TRUE;
+ _RET(value);
+ }
+}
+
+static PyObject *
+vBOOL_get(void *ptr, Py_ssize_t size)
+{
+ return PyBool_FromLong((long)*(short int *)ptr);
+}
+
+static PyObject *
+bool_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ switch (PyObject_IsTrue(value)) {
+ case -1:
+ return NULL;
+ case 0:
+ *(_Bool *)ptr = 0;
+ _RET(value);
+ default:
+ *(_Bool *)ptr = 1;
+ _RET(value);
+ }
+}
+
+static PyObject *
+bool_get(void *ptr, Py_ssize_t size)
+{
+ return PyBool_FromLong((long)*(_Bool *)ptr);
+}
+
+static PyObject *
+I_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned int x;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(unsigned int, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+I_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned int field;
+ if (get_ulong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_INT(field);
+ field = SET(unsigned int, field, (unsigned int)val, size);
+ field = SWAP_INT(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+I_get(void *ptr, Py_ssize_t size)
+{
+ unsigned int val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+I_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned int val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_INT(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+l_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ long x;
+ if (get_long(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+l_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long val;
+ long field;
+ if (get_long(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG(field);
+ field = SET(long, field, val, size);
+ field = SWAP_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+l_get(void *ptr, Py_ssize_t size)
+{
+ long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+l_get_sw(void *ptr, Py_ssize_t size)
+{
+ long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLong(val);
+}
+
+static PyObject *
+L_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned long x;
+ if (get_ulong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(unsigned long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+L_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long val;
+ unsigned long field;
+ if (get_ulong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG(field);
+ field = SET(unsigned long, field, val, size);
+ field = SWAP_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+
+static PyObject *
+L_get(void *ptr, Py_ssize_t size)
+{
+ unsigned long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+L_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLong(val);
+}
+
+static PyObject *
+q_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long long val;
+ long long x;
+ if (get_longlong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(long long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long long val;
+ long long field;
+ if (get_longlong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG_LONG(field);
+ field = SET(long long, field, val, size);
+ field = SWAP_LONG_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+static PyObject *
+q_get(void *ptr, Py_ssize_t size)
+{
+ long long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromLongLong(val);
+}
+
+static PyObject *
+q_get_sw(void *ptr, Py_ssize_t size)
+{
+ long long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromLongLong(val);
+}
+
+static PyObject *
+Q_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long long val;
+ unsigned long long x;
+ if (get_ulonglong(value, &val) < 0)
+ return NULL;
+ memcpy(&x, ptr, sizeof(x));
+ x = SET(long long, x, val, size);
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+Q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ unsigned long long val;
+ unsigned long long field;
+ if (get_ulonglong(value, &val) < 0) {
+ return NULL;
+ }
+ memcpy(&field, ptr, sizeof(field));
+ field = SWAP_LONG_LONG(field);
+ field = SET(unsigned long long, field, val, size);
+ field = SWAP_LONG_LONG(field);
+ memcpy(ptr, &field, sizeof(field));
+ _RET(value);
+}
+
+static PyObject *
+Q_get(void *ptr, Py_ssize_t size)
+{
+ unsigned long long val;
+ memcpy(&val, ptr, sizeof(val));
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLongLong(val);
+}
+
+static PyObject *
+Q_get_sw(void *ptr, Py_ssize_t size)
+{
+ unsigned long long val;
+ memcpy(&val, ptr, sizeof(val));
+ val = SWAP_LONG_LONG(val);
+ GET_BITFIELD(val, size);
+ return PyLong_FromUnsignedLongLong(val);
+}
+
+/*****************************************************************
+ * non-integer accessor methods, not supporting bit fields
+ */
+
+
+static PyObject *
+g_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ long double x;
+
+ x = PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+ memcpy(ptr, &x, sizeof(long double));
+ _RET(value);
+}
+
+static PyObject *
+g_get(void *ptr, Py_ssize_t size)
+{
+ long double val;
+ memcpy(&val, ptr, sizeof(long double));
+ return PyFloat_FromDouble(val);
+}
+
+static PyObject *
+d_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ double x;
+
+ x = PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+ memcpy(ptr, &x, sizeof(double));
+ _RET(value);
+}
+
+static PyObject *
+d_get(void *ptr, Py_ssize_t size)
+{
+ double val;
+ memcpy(&val, ptr, sizeof(val));
+ return PyFloat_FromDouble(val);
+}
+
+static PyObject *
+d_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ double x;
+
+ x = PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+#ifdef WORDS_BIGENDIAN
+ if (PyFloat_Pack8(x, ptr, 1))
+ return NULL;
+#else
+ if (PyFloat_Pack8(x, ptr, 0))
+ return NULL;
+#endif
+ _RET(value);
+}
+
+static PyObject *
+d_get_sw(void *ptr, Py_ssize_t size)
+{
+#ifdef WORDS_BIGENDIAN
+ return PyFloat_FromDouble(PyFloat_Unpack8(ptr, 1));
+#else
+ return PyFloat_FromDouble(PyFloat_Unpack8(ptr, 0));
+#endif
+}
+
+static PyObject *
+f_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ float x;
+
+ x = (float)PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+ memcpy(ptr, &x, sizeof(x));
+ _RET(value);
+}
+
+static PyObject *
+f_get(void *ptr, Py_ssize_t size)
+{
+ float val;
+ memcpy(&val, ptr, sizeof(val));
+ return PyFloat_FromDouble(val);
+}
+
+static PyObject *
+f_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ float x;
+
+ x = (float)PyFloat_AsDouble(value);
+ if (x == -1 && PyErr_Occurred())
+ return NULL;
+#ifdef WORDS_BIGENDIAN
+ if (PyFloat_Pack4(x, ptr, 1))
+ return NULL;
+#else
+ if (PyFloat_Pack4(x, ptr, 0))
+ return NULL;
+#endif
+ _RET(value);
+}
+
+static PyObject *
+f_get_sw(void *ptr, Py_ssize_t size)
+{
+#ifdef WORDS_BIGENDIAN
+ return PyFloat_FromDouble(PyFloat_Unpack4(ptr, 1));
+#else
+ return PyFloat_FromDouble(PyFloat_Unpack4(ptr, 0));
+#endif
+}
+
+/*
+ py_object refcounts:
+
+ 1. If we have a py_object instance, O_get must Py_INCREF the returned
+ object, of course. If O_get is called from a function result, no py_object
+ instance is created - so callproc.c::GetResult has to call Py_DECREF.
+
+ 2. The memory block in py_object owns a refcount. So, py_object must call
+ Py_DECREF on destruction. Maybe only when b_needsfree is non-zero.
+*/
+static PyObject *
+O_get(void *ptr, Py_ssize_t size)
+{
+ PyObject *ob = *(PyObject **)ptr;
+ if (ob == NULL) {
+ if (!PyErr_Occurred())
+ /* Set an error if not yet set */
+ PyErr_SetString(PyExc_ValueError,
+ "PyObject is NULL");
+ return NULL;
+ }
+ return Py_NewRef(ob);
+}
+
+static PyObject *
+O_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ /* Hm, does the memory block need it's own refcount or not? */
+ *(PyObject **)ptr = value;
+ return Py_NewRef(value);
+}
+
+
+static PyObject *
+c_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ if (PyBytes_Check(value) && PyBytes_GET_SIZE(value) == 1) {
+ *(char *)ptr = PyBytes_AS_STRING(value)[0];
+ _RET(value);
+ }
+ if (PyByteArray_Check(value) && PyByteArray_GET_SIZE(value) == 1) {
+ *(char *)ptr = PyByteArray_AS_STRING(value)[0];
+ _RET(value);
+ }
+ if (PyLong_Check(value))
+ {
+ long longval = PyLong_AsLong(value);
+ if (longval < 0 || longval >= 256)
+ goto error;
+ *(char *)ptr = (char)longval;
+ _RET(value);
+ }
+ error:
+ PyErr_Format(PyExc_TypeError,
+ "one character bytes, bytearray or integer expected");
+ return NULL;
+}
+
+
+static PyObject *
+c_get(void *ptr, Py_ssize_t size)
+{
+ return PyBytes_FromStringAndSize((char *)ptr, 1);
+}
+
+/* u - a single wchar_t character */
+static PyObject *
+u_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ Py_ssize_t len;
+ wchar_t chars[2];
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ } else
+ Py_INCREF(value);
+
+ len = PyUnicode_AsWideChar(value, chars, 2);
+ if (len != 1) {
+ Py_DECREF(value);
+ PyErr_SetString(PyExc_TypeError,
+ "one character unicode string expected");
+ return NULL;
+ }
+
+ *(wchar_t *)ptr = chars[0];
+ Py_DECREF(value);
+
+ _RET(value);
+}
+
+
+static PyObject *
+u_get(void *ptr, Py_ssize_t size)
+{
+ return PyUnicode_FromWideChar((wchar_t *)ptr, 1);
+}
+
+/* U - a unicode string */
+static PyObject *
+U_get(void *ptr, Py_ssize_t size)
+{
+ Py_ssize_t len;
+ wchar_t *p;
+
+ size /= sizeof(wchar_t); /* we count character units here, not bytes */
+
+ /* We need 'result' to be able to count the characters with wcslen,
+ since ptr may not be NUL terminated. If the length is smaller (if
+ it was actually NUL terminated, we construct a new one and throw
+ away the result.
+ */
+ /* chop off at the first NUL character, if any. */
+ p = (wchar_t*)ptr;
+ for (len = 0; len < size; ++len) {
+ if (!p[len])
+ break;
+ }
+
+ return PyUnicode_FromWideChar((wchar_t *)ptr, len);
+}
+
+static PyObject *
+U_set(void *ptr, PyObject *value, Py_ssize_t length)
+{
+ /* It's easier to calculate in characters than in bytes */
+ length /= sizeof(wchar_t);
+
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ Py_ssize_t size = PyUnicode_AsWideChar(value, NULL, 0);
+ if (size < 0) {
+ return NULL;
+ }
+ // PyUnicode_AsWideChar() returns number of wchars including trailing null byte,
+ // when it is called with NULL.
+ size--;
+ assert(size >= 0);
+ if (size > length) {
+ PyErr_Format(PyExc_ValueError,
+ "string too long (%zd, maximum length %zd)",
+ size, length);
+ return NULL;
+ }
+ if (PyUnicode_AsWideChar(value, (wchar_t *)ptr, length) == -1) {
+ return NULL;
+ }
+
+ return Py_NewRef(value);
+}
+
+
+static PyObject *
+s_get(void *ptr, Py_ssize_t size)
+{
+ Py_ssize_t i;
+ char *p;
+
+ p = (char *)ptr;
+ for (i = 0; i < size; ++i) {
+ if (*p++ == '\0')
+ break;
+ }
+
+ return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i);
+}
+
+static PyObject *
+s_set(void *ptr, PyObject *value, Py_ssize_t length)
+{
+ const char *data;
+ Py_ssize_t size;
+
+ if(!PyBytes_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "expected bytes, %s found",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ data = PyBytes_AS_STRING(value);
+ // bpo-39593: Use strlen() to truncate the string at the first null character.
+ size = strlen(data);
+
+ if (size < length) {
+ /* This will copy the terminating NUL character
+ * if there is space for it.
+ */
+ ++size;
+ } else if (size > length) {
+ PyErr_Format(PyExc_ValueError,
+ "bytes too long (%zd, maximum length %zd)",
+ size, length);
+ return NULL;
+ }
+ /* Also copy the terminating NUL character if there is space */
+ memcpy((char *)ptr, data, size);
+
+ _RET(value);
+}
+
+static PyObject *
+z_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ if (value == Py_None) {
+ *(char **)ptr = NULL;
+ return Py_NewRef(value);
+ }
+ if (PyBytes_Check(value)) {
+ *(const char **)ptr = PyBytes_AsString(value);
+ return Py_NewRef(value);
+ } else if (PyLong_Check(value)) {
+#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
+ *(char **)ptr = (char *)PyLong_AsUnsignedLongLongMask(value);
+#else
+ *(char **)ptr = (char *)PyLong_AsUnsignedLongMask(value);
+#endif
+ _RET(value);
+ }
+ PyErr_Format(PyExc_TypeError,
+ "bytes or integer address expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+}
+
+static PyObject *
+z_get(void *ptr, Py_ssize_t size)
+{
+ /* XXX What about invalid pointers ??? */
+ if (*(void **)ptr) {
+ return PyBytes_FromStringAndSize(*(char **)ptr,
+ strlen(*(char **)ptr));
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static PyObject *
+Z_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ PyObject *keep;
+ wchar_t *buffer;
+ Py_ssize_t bsize;
+
+ if (value == Py_None) {
+ *(wchar_t **)ptr = NULL;
+ return Py_NewRef(value);
+ }
+ if (PyLong_Check(value)) {
+#if SIZEOF_VOID_P == SIZEOF_LONG_LONG
+ *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongLongMask(value);
+#else
+ *(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongMask(value);
+#endif
+ Py_RETURN_NONE;
+ }
+ if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string or integer address expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ /* We must create a wchar_t* buffer from the unicode object,
+ and keep it alive */
+ buffer = PyUnicode_AsWideCharString(value, &bsize);
+ if (!buffer)
+ return NULL;
+ keep = PyCapsule_New(buffer, CTYPES_CFIELD_CAPSULE_NAME_PYMEM, pymem_destructor);
+ if (!keep) {
+ PyMem_Free(buffer);
+ return NULL;
+ }
+ *(wchar_t **)ptr = buffer;
+ return keep;
+}
+
+static PyObject *
+Z_get(void *ptr, Py_ssize_t size)
+{
+ wchar_t *p;
+ p = *(wchar_t **)ptr;
+ if (p) {
+ return PyUnicode_FromWideChar(p, wcslen(p));
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+
+#ifdef MS_WIN32
+static PyObject *
+BSTR_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ BSTR bstr;
+
+ /* convert value into a PyUnicodeObject or NULL */
+ if (Py_None == value) {
+ value = NULL;
+ } else if (!PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "unicode string expected instead of %s instance",
+ Py_TYPE(value)->tp_name);
+ return NULL;
+ }
+
+ /* create a BSTR from value */
+ if (value) {
+ Py_ssize_t wsize;
+ wchar_t *wvalue = PyUnicode_AsWideCharString(value, &wsize);
+ if (wvalue == NULL) {
+ return NULL;
+ }
+ if ((unsigned) wsize != wsize) {
+ PyErr_SetString(PyExc_ValueError, "String too long for BSTR");
+ PyMem_Free(wvalue);
+ return NULL;
+ }
+ bstr = SysAllocStringLen(wvalue, (unsigned)wsize);
+ PyMem_Free(wvalue);
+ } else
+ bstr = NULL;
+
+ /* free the previous contents, if any */
+ if (*(BSTR *)ptr)
+ SysFreeString(*(BSTR *)ptr);
+
+ /* and store it */
+ *(BSTR *)ptr = bstr;
+
+ /* We don't need to keep any other object */
+ _RET(value);
+}
+
+
+static PyObject *
+BSTR_get(void *ptr, Py_ssize_t size)
+{
+ BSTR p;
+ p = *(BSTR *)ptr;
+ if (p)
+ return PyUnicode_FromWideChar(p, SysStringLen(p));
+ else {
+ /* Hm, it seems NULL pointer and zero length string are the
+ same in BSTR, see Don Box, p 81
+ */
+ Py_RETURN_NONE;
+ }
+}
+#endif
+
+static PyObject *
+P_set(void *ptr, PyObject *value, Py_ssize_t size)
+{
+ void *v;
+ if (value == Py_None) {
+ *(void **)ptr = NULL;
+ _RET(value);
+ }
+
+ if (!PyLong_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot be converted to pointer");
+ return NULL;
+ }
+
+#if SIZEOF_VOID_P <= SIZEOF_LONG
+ v = (void *)PyLong_AsUnsignedLongMask(value);
+#else
+#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
+# error "PyLong_AsVoidPtr: sizeof(long long) < sizeof(void*)"
+#endif
+ v = (void *)PyLong_AsUnsignedLongLongMask(value);
+#endif
+
+ if (PyErr_Occurred())
+ return NULL;
+
+ *(void **)ptr = v;
+ _RET(value);
+}
+
+static PyObject *
+P_get(void *ptr, Py_ssize_t size)
+{
+ if (*(void **)ptr == NULL) {
+ Py_RETURN_NONE;
+ }
+ return PyLong_FromVoidPtr(*(void **)ptr);
+}
+
+static struct fielddesc formattable[] = {
+ { 's', s_set, s_get, NULL},
+ { 'b', b_set, b_get, NULL},
+ { 'B', B_set, B_get, NULL},
+ { 'c', c_set, c_get, NULL},
+ { 'd', d_set, d_get, NULL, d_set_sw, d_get_sw},
+ { 'g', g_set, g_get, NULL},
+ { 'f', f_set, f_get, NULL, f_set_sw, f_get_sw},
+ { 'h', h_set, h_get, NULL, h_set_sw, h_get_sw},
+ { 'H', H_set, H_get, NULL, H_set_sw, H_get_sw},
+ { 'i', i_set, i_get, NULL, i_set_sw, i_get_sw},
+ { 'I', I_set, I_get, NULL, I_set_sw, I_get_sw},
+ { 'l', l_set, l_get, NULL, l_set_sw, l_get_sw},
+ { 'L', L_set, L_get, NULL, L_set_sw, L_get_sw},
+ { 'q', q_set, q_get, NULL, q_set_sw, q_get_sw},
+ { 'Q', Q_set, Q_get, NULL, Q_set_sw, Q_get_sw},
+ { 'P', P_set, P_get, NULL},
+ { 'z', z_set, z_get, NULL},
+ { 'u', u_set, u_get, NULL},
+ { 'U', U_set, U_get, NULL},
+ { 'Z', Z_set, Z_get, NULL},
+#ifdef MS_WIN32
+ { 'X', BSTR_set, BSTR_get, NULL},
+#endif
+ { 'v', vBOOL_set, vBOOL_get, NULL},
+#if SIZEOF__BOOL == SIZEOF_INT
+ { '?', bool_set, bool_get, NULL, I_set_sw, I_get_sw},
+#elif SIZEOF__BOOL == SIZEOF_LONG
+ { '?', bool_set, bool_get, NULL, L_set_sw, L_get_sw},
+#elif SIZEOF__BOOL == SIZEOF_LONG_LONG
+ { '?', bool_set, bool_get, NULL, Q_set_sw, Q_get_sw},
+#else
+ { '?', bool_set, bool_get, NULL},
+#endif /* SIZEOF__BOOL */
+ { 'O', O_set, O_get, NULL},
+ { 0, NULL, NULL, NULL},
+};
+
+/*
+ Ideas: Implement VARIANT in this table, using 'V' code.
+ Use '?' as code for BOOL.
+*/
+
+/* Delayed initialization. Windows cannot statically reference dynamically
+ loaded addresses from DLLs. */
+void
+_ctypes_init_fielddesc(void)
+{
+ struct fielddesc *fd = formattable;
+ for (; fd->code; ++fd) {
+ switch (fd->code) {
+ case 's': fd->pffi_type = &ffi_type_pointer; break;
+ case 'b': fd->pffi_type = &ffi_type_schar; break;
+ case 'B': fd->pffi_type = &ffi_type_uchar; break;
+ case 'c': fd->pffi_type = &ffi_type_schar; break;
+ case 'd': fd->pffi_type = &ffi_type_double; break;
+ case 'g': fd->pffi_type = &ffi_type_longdouble; break;
+ case 'f': fd->pffi_type = &ffi_type_float; break;
+ case 'h': fd->pffi_type = &ffi_type_sshort; break;
+ case 'H': fd->pffi_type = &ffi_type_ushort; break;
+ case 'i': fd->pffi_type = &ffi_type_sint; break;
+ case 'I': fd->pffi_type = &ffi_type_uint; break;
+ /* XXX Hm, sizeof(int) == sizeof(long) doesn't hold on every platform */
+ /* As soon as we can get rid of the type codes, this is no longer a problem */
+ #if SIZEOF_LONG == 4
+ case 'l': fd->pffi_type = &ffi_type_sint32; break;
+ case 'L': fd->pffi_type = &ffi_type_uint32; break;
+ #elif SIZEOF_LONG == 8
+ case 'l': fd->pffi_type = &ffi_type_sint64; break;
+ case 'L': fd->pffi_type = &ffi_type_uint64; break;
+ #else
+ #error
+ #endif
+ #if SIZEOF_LONG_LONG == 8
+ case 'q': fd->pffi_type = &ffi_type_sint64; break;
+ case 'Q': fd->pffi_type = &ffi_type_uint64; break;
+ #else
+ #error
+ #endif
+ case 'P': fd->pffi_type = &ffi_type_pointer; break;
+ case 'z': fd->pffi_type = &ffi_type_pointer; break;
+ case 'u':
+ if (sizeof(wchar_t) == sizeof(short))
+ fd->pffi_type = &ffi_type_sshort;
+ else if (sizeof(wchar_t) == sizeof(int))
+ fd->pffi_type = &ffi_type_sint;
+ else if (sizeof(wchar_t) == sizeof(long))
+ fd->pffi_type = &ffi_type_slong;
+ else
+ Py_UNREACHABLE();
+ break;
+ case 'U': fd->pffi_type = &ffi_type_pointer; break;
+ case 'Z': fd->pffi_type = &ffi_type_pointer; break;
+ #ifdef MS_WIN32
+ case 'X': fd->pffi_type = &ffi_type_pointer; break;
+ #endif
+ case 'v': fd->pffi_type = &ffi_type_sshort; break;
+ #if SIZEOF__BOOL == 1
+ case '?': fd->pffi_type = &ffi_type_uchar; break; /* Also fallback for no native _Bool support */
+ #elif SIZEOF__BOOL == SIZEOF_SHORT
+ case '?': fd->pffi_type = &ffi_type_ushort; break;
+ #elif SIZEOF__BOOL == SIZEOF_INT
+ case '?': fd->pffi_type = &ffi_type_uint; break;
+ #elif SIZEOF__BOOL == SIZEOF_LONG
+ case '?': fd->pffi_type = &ffi_type_ulong; break;
+ #elif SIZEOF__BOOL == SIZEOF_LONG_LONG
+ case '?': fd->pffi_type = &ffi_type_ulong; break;
+ #endif /* SIZEOF__BOOL */
+ case 'O': fd->pffi_type = &ffi_type_pointer; break;
+ default:
+ Py_UNREACHABLE();
+ }
+ }
+
+}
+
+struct fielddesc *
+_ctypes_get_fielddesc(const char *fmt)
+{
+ static int initialized = 0;
+ struct fielddesc *table = formattable;
+
+ if (!initialized) {
+ initialized = 1;
+ _ctypes_init_fielddesc();
+ }
+
+ for (; table->code; ++table) {
+ if (table->code == fmt[0])
+ return table;
+ }
+ return NULL;
+}
+
+/*---------------- EOF ----------------*/
diff --git a/contrib/tools/python3/Modules/_ctypes/ctypes.h b/contrib/tools/python3/Modules/_ctypes/ctypes.h
new file mode 100644
index 00000000000..aed4dffe074
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/ctypes.h
@@ -0,0 +1,414 @@
+#if defined (__SVR4) && defined (__sun)
+# include <alloca.h>
+#endif
+
+#ifndef MS_WIN32
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+#define PARAMFLAG_FIN 0x1
+#define PARAMFLAG_FOUT 0x2
+#define PARAMFLAG_FLCID 0x4
+#endif
+
+/*
+ * bpo-13097: Max number of arguments CFuncPtr._argtypes_ and
+ * _ctypes_callproc() will accept.
+ *
+ * This limit is enforced for the `alloca()` call in `_ctypes_callproc`,
+ * to avoid allocating a massive buffer on the stack.
+ */
+#ifndef CTYPES_MAX_ARGCOUNT
+ #ifdef __EMSCRIPTEN__
+ #define CTYPES_MAX_ARGCOUNT 1000
+ #else
+ #define CTYPES_MAX_ARGCOUNT 1024
+ #endif
+#endif
+
+#if defined(__has_builtin)
+#if __has_builtin(__builtin_available)
+#define HAVE_BUILTIN_AVAILABLE 1
+#endif
+#endif
+
+#ifdef MS_WIN32
+#include <Unknwn.h> // for IUnknown interface
+#endif
+
+typedef struct {
+ PyTypeObject *DictRemover_Type;
+ PyTypeObject *PyCArg_Type;
+ PyTypeObject *PyCField_Type;
+ PyTypeObject *PyCThunk_Type;
+#ifdef MS_WIN32
+ PyTypeObject *PyComError_Type;
+#endif
+ PyTypeObject *StructParam_Type;
+} ctypes_state;
+
+extern ctypes_state global_state;
+
+#define GLOBAL_STATE() (&global_state)
+
+extern PyType_Spec carg_spec;
+extern PyType_Spec cfield_spec;
+extern PyType_Spec cthunk_spec;
+
+typedef struct tagPyCArgObject PyCArgObject;
+typedef struct tagCDataObject CDataObject;
+typedef PyObject *(* GETFUNC)(void *, Py_ssize_t size);
+typedef PyObject *(* SETFUNC)(void *, PyObject *value, Py_ssize_t size);
+typedef PyCArgObject *(* PARAMFUNC)(CDataObject *obj);
+
+/* A default buffer in CDataObject, which can be used for small C types. If
+this buffer is too small, PyMem_Malloc will be called to create a larger one,
+and this one is not used.
+
+Making CDataObject a variable size object would be a better solution, but more
+difficult in the presence of PyCFuncPtrObject. Maybe later.
+*/
+union value {
+ char c[16];
+ short s;
+ int i;
+ long l;
+ float f;
+ double d;
+ long long ll;
+ long double D;
+};
+
+/*
+ Hm. Are there CDataObject's which do not need the b_objects member? In
+ this case we probably should introduce b_flags to mark it as present... If
+ b_objects is not present/unused b_length is unneeded as well.
+*/
+
+struct tagCDataObject {
+ PyObject_HEAD
+ char *b_ptr; /* pointer to memory block */
+ int b_needsfree; /* need _we_ free the memory? */
+ CDataObject *b_base; /* pointer to base object or NULL */
+ Py_ssize_t b_size; /* size of memory block in bytes */
+ Py_ssize_t b_length; /* number of references we need */
+ Py_ssize_t b_index; /* index of this object into base's
+ b_object list */
+ PyObject *b_objects; /* dictionary of references we need to keep, or Py_None */
+ union value b_value;
+};
+
+typedef struct {
+ PyObject_VAR_HEAD
+ ffi_closure *pcl_write; /* the C callable, writeable */
+ void *pcl_exec; /* the C callable, executable */
+ ffi_cif cif;
+ int flags;
+ PyObject *converters;
+ PyObject *callable;
+ PyObject *restype;
+ SETFUNC setfunc;
+ ffi_type *ffi_restype;
+ ffi_type *atypes[1];
+} CThunkObject;
+#define CThunk_CheckExact(st, v) Py_IS_TYPE(v, st->PyCThunk_Type)
+
+typedef struct {
+ /* First part identical to tagCDataObject */
+ PyObject_HEAD
+ char *b_ptr; /* pointer to memory block */
+ int b_needsfree; /* need _we_ free the memory? */
+ CDataObject *b_base; /* pointer to base object or NULL */
+ Py_ssize_t b_size; /* size of memory block in bytes */
+ Py_ssize_t b_length; /* number of references we need */
+ Py_ssize_t b_index; /* index of this object into base's
+ b_object list */
+ PyObject *b_objects; /* list of references we need to keep */
+ union value b_value;
+ /* end of tagCDataObject, additional fields follow */
+
+ CThunkObject *thunk;
+ PyObject *callable;
+
+ /* These two fields will override the ones in the type's stgdict if
+ they are set */
+ PyObject *converters;
+ PyObject *argtypes;
+ PyObject *restype;
+ PyObject *checker;
+ PyObject *errcheck;
+#ifdef MS_WIN32
+ int index;
+ GUID *iid;
+#endif
+ PyObject *paramflags;
+} PyCFuncPtrObject;
+
+extern PyTypeObject PyCStgDict_Type;
+#define PyCStgDict_CheckExact(v) Py_IS_TYPE(v, &PyCStgDict_Type)
+#define PyCStgDict_Check(v) PyObject_TypeCheck(v, &PyCStgDict_Type)
+
+extern int PyCStructUnionType_update_stgdict(PyObject *fields, PyObject *type, int isStruct);
+extern int PyType_stginfo(PyTypeObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength);
+extern int PyObject_stginfo(PyObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength);
+
+
+
+extern PyTypeObject PyCData_Type;
+#define CDataObject_CheckExact(v) Py_IS_TYPE(v, &PyCData_Type)
+#define CDataObject_Check(v) PyObject_TypeCheck(v, &PyCData_Type)
+#define _CDataObject_HasExternalBuffer(v) ((v)->b_ptr != (char *)&(v)->b_value)
+
+extern PyTypeObject PyCSimpleType_Type;
+#define PyCSimpleTypeObject_CheckExact(v) Py_IS_TYPE(v, &PyCSimpleType_Type)
+#define PyCSimpleTypeObject_Check(v) PyObject_TypeCheck(v, &PyCSimpleType_Type)
+
+extern struct fielddesc *_ctypes_get_fielddesc(const char *fmt);
+
+
+extern PyObject *
+PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
+ Py_ssize_t *pfield_size, int bitsize, int *pbitofs,
+ Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign,
+ int pack, int is_big_endian);
+
+extern PyObject *PyCData_AtAddress(PyObject *type, void *buf);
+extern PyObject *PyCData_FromBytes(PyObject *type, char *data, Py_ssize_t length);
+
+extern PyTypeObject PyCArrayType_Type;
+extern PyTypeObject PyCArray_Type;
+extern PyTypeObject PyCPointerType_Type;
+extern PyTypeObject PyCPointer_Type;
+extern PyTypeObject PyCFuncPtr_Type;
+extern PyTypeObject PyCFuncPtrType_Type;
+extern PyTypeObject PyCStructType_Type;
+
+#define PyCArrayTypeObject_Check(v) PyObject_TypeCheck(v, &PyCArrayType_Type)
+#define ArrayObject_Check(v) PyObject_TypeCheck(v, &PyCArray_Type)
+#define PointerObject_Check(v) PyObject_TypeCheck(v, &PyCPointer_Type)
+#define PyCPointerTypeObject_Check(v) PyObject_TypeCheck(v, &PyCPointerType_Type)
+#define PyCFuncPtrObject_Check(v) PyObject_TypeCheck(v, &PyCFuncPtr_Type)
+#define PyCFuncPtrTypeObject_Check(v) PyObject_TypeCheck(v, &PyCFuncPtrType_Type)
+#define PyCStructTypeObject_Check(v) PyObject_TypeCheck(v, &PyCStructType_Type)
+
+extern PyObject *
+PyCArrayType_from_ctype(PyObject *itemtype, Py_ssize_t length);
+
+extern PyMethodDef _ctypes_module_methods[];
+
+extern CThunkObject *_ctypes_alloc_callback(PyObject *callable,
+ PyObject *converters,
+ PyObject *restype,
+ int flags);
+/* a table entry describing a predefined ctypes type */
+struct fielddesc {
+ char code;
+ SETFUNC setfunc;
+ GETFUNC getfunc;
+ ffi_type *pffi_type; /* always statically allocated */
+ SETFUNC setfunc_swapped;
+ GETFUNC getfunc_swapped;
+};
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t offset;
+ Py_ssize_t size;
+ Py_ssize_t index; /* Index into CDataObject's
+ object array */
+ PyObject *proto; /* a type or NULL */
+ GETFUNC getfunc; /* getter function if proto is NULL */
+ SETFUNC setfunc; /* setter function if proto is NULL */
+ int anonymous;
+} CFieldObject;
+
+/* A subclass of PyDictObject, used as the instance dictionary of ctypes
+ metatypes */
+typedef struct {
+ PyDictObject dict; /* first part identical to PyDictObject */
+/* The size and align fields are unneeded, they are in ffi_type as well. As
+ an experiment shows, it's trivial to get rid of them, the only thing to
+ remember is that in PyCArrayType_new the ffi_type fields must be filled in -
+ so far it was unneeded because libffi doesn't support arrays at all
+ (because they are passed as pointers to function calls anyway). But it's
+ too much risk to change that now, and there are other fields which doesn't
+ belong into this structure anyway. Maybe in ctypes 2.0... (ctypes 2000?)
+*/
+ Py_ssize_t size; /* number of bytes */
+ Py_ssize_t align; /* alignment requirements */
+ Py_ssize_t length; /* number of fields */
+ ffi_type ffi_type_pointer;
+ PyObject *proto; /* Only for Pointer/ArrayObject */
+ SETFUNC setfunc; /* Only for simple objects */
+ GETFUNC getfunc; /* Only for simple objects */
+ PARAMFUNC paramfunc;
+
+ /* Following fields only used by PyCFuncPtrType_Type instances */
+ PyObject *argtypes; /* tuple of CDataObjects */
+ PyObject *converters; /* tuple([t.from_param for t in argtypes]) */
+ PyObject *restype; /* CDataObject or NULL */
+ PyObject *checker;
+ int flags; /* calling convention and such */
+
+ /* pep3118 fields, pointers need PyMem_Free */
+ char *format;
+ int ndim;
+ Py_ssize_t *shape;
+/* Py_ssize_t *strides; */ /* unused in ctypes */
+/* Py_ssize_t *suboffsets; */ /* unused in ctypes */
+
+} StgDictObject;
+
+/****************************************************************
+ StgDictObject fields
+
+ setfunc and getfunc is only set for simple data types, it is copied from the
+ corresponding fielddesc entry. These are functions to set and get the value
+ in a memory block.
+ They should probably by used by other types as well.
+
+ proto is only used for Pointer and Array types - it points to the item type
+ object.
+
+ Probably all the magic ctypes methods (like from_param) should have C
+ callable wrappers in the StgDictObject. For simple data type, for example,
+ the fielddesc table could have entries for C codec from_param functions or
+ other methods as well, if a subtype overrides this method in Python at
+ construction time, or assigns to it later, tp_setattro should update the
+ StgDictObject function to a generic one.
+
+ Currently, PyCFuncPtr types have 'converters' and 'checker' entries in their
+ type dict. They are only used to cache attributes from other entries, which
+ is wrong.
+
+ One use case is the .value attribute that all simple types have. But some
+ complex structures, like VARIANT, represent a single value also, and should
+ have this attribute.
+
+ Another use case is a _check_retval_ function, which is called when a ctypes
+ type is used as return type of a function to validate and compute the return
+ value.
+
+ Common ctypes protocol:
+
+ - setfunc: store a python value in a memory block
+ - getfunc: convert data from a memory block into a python value
+
+ - checkfunc: validate and convert a return value from a function call
+ - toparamfunc: convert a python value into a function argument
+
+*****************************************************************/
+
+/* May return NULL, but does not set an exception! */
+extern StgDictObject *PyType_stgdict(PyObject *obj);
+
+/* May return NULL, but does not set an exception! */
+extern StgDictObject *PyObject_stgdict(PyObject *self);
+
+extern int PyCStgDict_clone(StgDictObject *src, StgDictObject *dst);
+
+typedef int(* PPROC)(void);
+
+PyObject *_ctypes_callproc(PPROC pProc,
+ PyObject *arguments,
+#ifdef MS_WIN32
+ IUnknown *pIUnk,
+ GUID *iid,
+#endif
+ int flags,
+ PyObject *argtypes,
+ PyObject *restype,
+ PyObject *checker);
+
+
+#define FUNCFLAG_STDCALL 0x0
+#define FUNCFLAG_CDECL 0x1
+#define FUNCFLAG_HRESULT 0x2
+#define FUNCFLAG_PYTHONAPI 0x4
+#define FUNCFLAG_USE_ERRNO 0x8
+#define FUNCFLAG_USE_LASTERROR 0x10
+
+#define TYPEFLAG_ISPOINTER 0x100
+#define TYPEFLAG_HASPOINTER 0x200
+#define TYPEFLAG_HASUNION 0x400
+#define TYPEFLAG_HASBITFIELD 0x800
+
+#define DICTFLAG_FINAL 0x1000
+
+struct tagPyCArgObject {
+ PyObject_HEAD
+ ffi_type *pffi_type;
+ char tag;
+ union {
+ char c;
+ char b;
+ short h;
+ int i;
+ long l;
+ long long q;
+ long double D;
+ double d;
+ float f;
+ void *p;
+ } value;
+ PyObject *obj;
+ Py_ssize_t size; /* for the 'V' tag */
+};
+
+#define PyCArg_CheckExact(st, v) Py_IS_TYPE(v, st->PyCArg_Type)
+extern PyCArgObject *PyCArgObject_new(void);
+
+extern PyObject *
+PyCData_get(PyObject *type, GETFUNC getfunc, PyObject *src,
+ Py_ssize_t index, Py_ssize_t size, char *ptr);
+
+extern int
+PyCData_set(PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
+ Py_ssize_t index, Py_ssize_t size, char *ptr);
+
+extern void _ctypes_extend_error(PyObject *exc_class, const char *fmt, ...);
+
+struct basespec {
+ CDataObject *base;
+ Py_ssize_t index;
+ char *adr;
+};
+
+extern char basespec_string[];
+
+extern ffi_type *_ctypes_get_ffi_type(PyObject *obj);
+
+/* exception classes */
+extern PyObject *PyExc_ArgError;
+
+extern char *_ctypes_conversion_encoding;
+extern char *_ctypes_conversion_errors;
+
+
+extern void _ctypes_free_closure(void *);
+extern void *_ctypes_alloc_closure(void);
+
+extern PyObject *PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr);
+extern char *_ctypes_alloc_format_string(const char *prefix, const char *suffix);
+extern char *_ctypes_alloc_format_string_with_shape(int ndim,
+ const Py_ssize_t *shape,
+ const char *prefix, const char *suffix);
+
+extern int _ctypes_simple_instance(PyObject *obj);
+
+extern PyObject *_ctypes_ptrtype_cache;
+PyObject *_ctypes_get_errobj(int **pspace);
+
+#ifdef USING_MALLOC_CLOSURE_DOT_C
+void Py_ffi_closure_free(void *p);
+void *Py_ffi_closure_alloc(size_t size, void** codeloc);
+#else
+#define Py_ffi_closure_free ffi_closure_free
+#define Py_ffi_closure_alloc ffi_closure_alloc
+#endif
+
+/*
+ Local Variables:
+ compile-command: "python setup.py -q build install --home ~"
+ End:
+*/
diff --git a/contrib/tools/python3/Modules/_ctypes/stgdict.c b/contrib/tools/python3/Modules/_ctypes/stgdict.c
new file mode 100644
index 00000000000..ae3f356c2e0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ctypes/stgdict.c
@@ -0,0 +1,963 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+// windows.h must be included before pycore internal headers
+#ifdef MS_WIN32
+# include <windows.h>
+#endif
+
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include <ffi.h>
+#ifdef MS_WIN32
+# include <malloc.h>
+#endif
+#include "ctypes.h"
+
+/******************************************************************/
+/*
+ StdDict - a dictionary subclass, containing additional C accessible fields
+
+ XXX blabla more
+*/
+
+/* Seems we need this, otherwise we get problems when calling
+ * PyDict_SetItem() (ma_lookup is NULL)
+ */
+static int
+PyCStgDict_init(StgDictObject *self, PyObject *args, PyObject *kwds)
+{
+ if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0)
+ return -1;
+ self->format = NULL;
+ self->ndim = 0;
+ self->shape = NULL;
+ return 0;
+}
+
+static int
+PyCStgDict_clear(StgDictObject *self)
+{
+ Py_CLEAR(self->proto);
+ Py_CLEAR(self->argtypes);
+ Py_CLEAR(self->converters);
+ Py_CLEAR(self->restype);
+ Py_CLEAR(self->checker);
+ return 0;
+}
+
+static void
+PyCStgDict_dealloc(StgDictObject *self)
+{
+ PyCStgDict_clear(self);
+ PyMem_Free(self->format);
+ PyMem_Free(self->shape);
+ PyMem_Free(self->ffi_type_pointer.elements);
+ PyDict_Type.tp_dealloc((PyObject *)self);
+}
+
+static PyObject *
+PyCStgDict_sizeof(StgDictObject *self, void *unused)
+{
+ Py_ssize_t res;
+
+ res = _PyDict_SizeOf((PyDictObject *)self);
+ res += sizeof(StgDictObject) - sizeof(PyDictObject);
+ if (self->format)
+ res += strlen(self->format) + 1;
+ res += self->ndim * sizeof(Py_ssize_t);
+ if (self->ffi_type_pointer.elements)
+ res += (self->length + 1) * sizeof(ffi_type *);
+ return PyLong_FromSsize_t(res);
+}
+
+int
+PyCStgDict_clone(StgDictObject *dst, StgDictObject *src)
+{
+ char *d, *s;
+ Py_ssize_t size;
+
+ PyCStgDict_clear(dst);
+ PyMem_Free(dst->ffi_type_pointer.elements);
+ PyMem_Free(dst->format);
+ dst->format = NULL;
+ PyMem_Free(dst->shape);
+ dst->shape = NULL;
+ dst->ffi_type_pointer.elements = NULL;
+
+ d = (char *)dst;
+ s = (char *)src;
+ memcpy(d + sizeof(PyDictObject),
+ s + sizeof(PyDictObject),
+ sizeof(StgDictObject) - sizeof(PyDictObject));
+
+ Py_XINCREF(dst->proto);
+ Py_XINCREF(dst->argtypes);
+ Py_XINCREF(dst->converters);
+ Py_XINCREF(dst->restype);
+ Py_XINCREF(dst->checker);
+
+ if (src->format) {
+ dst->format = PyMem_Malloc(strlen(src->format) + 1);
+ if (dst->format == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ strcpy(dst->format, src->format);
+ }
+ if (src->shape) {
+ dst->shape = PyMem_Malloc(sizeof(Py_ssize_t) * src->ndim);
+ if (dst->shape == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memcpy(dst->shape, src->shape,
+ sizeof(Py_ssize_t) * src->ndim);
+ }
+
+ if (src->ffi_type_pointer.elements == NULL)
+ return 0;
+ size = sizeof(ffi_type *) * (src->length + 1);
+ dst->ffi_type_pointer.elements = PyMem_Malloc(size);
+ if (dst->ffi_type_pointer.elements == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memcpy(dst->ffi_type_pointer.elements,
+ src->ffi_type_pointer.elements,
+ size);
+ return 0;
+}
+
+static struct PyMethodDef PyCStgDict_methods[] = {
+ {"__sizeof__", (PyCFunction)PyCStgDict_sizeof, METH_NOARGS},
+ {NULL, NULL} /* sentinel */
+};
+
+PyTypeObject PyCStgDict_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "StgDict",
+ sizeof(StgDictObject),
+ 0,
+ (destructor)PyCStgDict_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyCStgDict_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)PyCStgDict_init, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+};
+
+/* May return NULL, but does not set an exception! */
+StgDictObject *
+PyType_stgdict(PyObject *obj)
+{
+ PyTypeObject *type;
+
+ if (!PyType_Check(obj))
+ return NULL;
+ type = (PyTypeObject *)obj;
+ if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
+ return NULL;
+ return (StgDictObject *)type->tp_dict;
+}
+
+/* May return NULL, but does not set an exception! */
+/*
+ This function should be as fast as possible, so we don't call PyType_stgdict
+ above but inline the code, and avoid the PyType_Check().
+*/
+StgDictObject *
+PyObject_stgdict(PyObject *self)
+{
+ PyTypeObject *type = Py_TYPE(self);
+ if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
+ return NULL;
+ return (StgDictObject *)type->tp_dict;
+}
+
+/* descr is the descriptor for a field marked as anonymous. Get all the
+ _fields_ descriptors from descr->proto, create new descriptors with offset
+ and index adjusted, and stuff them into type.
+ */
+static int
+MakeFields(PyObject *type, CFieldObject *descr,
+ Py_ssize_t index, Py_ssize_t offset)
+{
+ Py_ssize_t i;
+ PyObject *fields;
+ PyObject *fieldlist;
+
+ fields = PyObject_GetAttrString(descr->proto, "_fields_");
+ if (fields == NULL)
+ return -1;
+ fieldlist = PySequence_Fast(fields, "_fields_ must be a sequence");
+ Py_DECREF(fields);
+ if (fieldlist == NULL)
+ return -1;
+
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *cfield_tp = st->PyCField_Type;
+ for (i = 0; i < PySequence_Fast_GET_SIZE(fieldlist); ++i) {
+ PyObject *pair = PySequence_Fast_GET_ITEM(fieldlist, i); /* borrowed */
+ PyObject *fname, *ftype, *bits;
+ CFieldObject *fdescr;
+ CFieldObject *new_descr;
+ /* Convert to PyArg_UnpackTuple... */
+ if (!PyArg_ParseTuple(pair, "OO|O", &fname, &ftype, &bits)) {
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ fdescr = (CFieldObject *)PyObject_GetAttr(descr->proto, fname);
+ if (fdescr == NULL) {
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ if (!Py_IS_TYPE(fdescr, cfield_tp)) {
+ PyErr_SetString(PyExc_TypeError, "unexpected type");
+ Py_DECREF(fdescr);
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ if (fdescr->anonymous) {
+ int rc = MakeFields(type, fdescr,
+ index + fdescr->index,
+ offset + fdescr->offset);
+ Py_DECREF(fdescr);
+ if (rc == -1) {
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ continue;
+ }
+ new_descr = (CFieldObject *)cfield_tp->tp_alloc(cfield_tp, 0);
+ if (new_descr == NULL) {
+ Py_DECREF(fdescr);
+ Py_DECREF(fieldlist);
+ return -1;
+ }
+ assert(Py_IS_TYPE(new_descr, cfield_tp));
+ new_descr->size = fdescr->size;
+ new_descr->offset = fdescr->offset + offset;
+ new_descr->index = fdescr->index + index;
+ new_descr->proto = Py_XNewRef(fdescr->proto);
+ new_descr->getfunc = fdescr->getfunc;
+ new_descr->setfunc = fdescr->setfunc;
+
+ Py_DECREF(fdescr);
+
+ if (-1 == PyObject_SetAttr(type, fname, (PyObject *)new_descr)) {
+ Py_DECREF(fieldlist);
+ Py_DECREF(new_descr);
+ return -1;
+ }
+ Py_DECREF(new_descr);
+ }
+ Py_DECREF(fieldlist);
+ return 0;
+}
+
+/* Iterate over the names in the type's _anonymous_ attribute, if present,
+ */
+static int
+MakeAnonFields(PyObject *type)
+{
+ PyObject *anon;
+ PyObject *anon_names;
+ Py_ssize_t i;
+
+ if (_PyObject_LookupAttr(type, &_Py_ID(_anonymous_), &anon) < 0) {
+ return -1;
+ }
+ if (anon == NULL) {
+ return 0;
+ }
+ anon_names = PySequence_Fast(anon, "_anonymous_ must be a sequence");
+ Py_DECREF(anon);
+ if (anon_names == NULL)
+ return -1;
+
+ ctypes_state *st = GLOBAL_STATE();
+ PyTypeObject *cfield_tp = st->PyCField_Type;
+ for (i = 0; i < PySequence_Fast_GET_SIZE(anon_names); ++i) {
+ PyObject *fname = PySequence_Fast_GET_ITEM(anon_names, i); /* borrowed */
+ CFieldObject *descr = (CFieldObject *)PyObject_GetAttr(type, fname);
+ if (descr == NULL) {
+ Py_DECREF(anon_names);
+ return -1;
+ }
+ if (!Py_IS_TYPE(descr, cfield_tp)) {
+ PyErr_Format(PyExc_AttributeError,
+ "'%U' is specified in _anonymous_ but not in "
+ "_fields_",
+ fname);
+ Py_DECREF(anon_names);
+ Py_DECREF(descr);
+ return -1;
+ }
+ descr->anonymous = 1;
+
+ /* descr is in the field descriptor. */
+ if (-1 == MakeFields(type, (CFieldObject *)descr,
+ ((CFieldObject *)descr)->index,
+ ((CFieldObject *)descr)->offset)) {
+ Py_DECREF(descr);
+ Py_DECREF(anon_names);
+ return -1;
+ }
+ Py_DECREF(descr);
+ }
+
+ Py_DECREF(anon_names);
+ return 0;
+}
+
+/*
+ Allocate a memory block for a pep3118 format string, copy prefix (if
+ non-null) into it and append `{padding}x` to the end.
+ Returns NULL on failure, with the error indicator set.
+*/
+char *
+_ctypes_alloc_format_padding(const char *prefix, Py_ssize_t padding)
+{
+ /* int64 decimal characters + x + null */
+ char buf[19 + 1 + 1];
+
+ assert(padding > 0);
+
+ if (padding == 1) {
+ /* Use x instead of 1x, for brevity */
+ return _ctypes_alloc_format_string(prefix, "x");
+ }
+
+ int ret = PyOS_snprintf(buf, sizeof(buf), "%zdx", padding); (void)ret;
+ assert(0 <= ret && ret < (Py_ssize_t)sizeof(buf));
+ return _ctypes_alloc_format_string(prefix, buf);
+}
+
+/*
+ Retrieve the (optional) _pack_ attribute from a type, the _fields_ attribute,
+ and create an StgDictObject. Used for Structure and Union subclasses.
+*/
+int
+PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct)
+{
+ StgDictObject *stgdict, *basedict;
+ Py_ssize_t len, offset, size, align, i;
+ Py_ssize_t union_size, total_align, aligned_size;
+ Py_ssize_t field_size = 0;
+ int bitofs;
+ PyObject *tmp;
+ int pack;
+ Py_ssize_t ffi_ofs;
+ int big_endian;
+ int arrays_seen = 0;
+
+ if (fields == NULL)
+ return 0;
+
+ if (_PyObject_LookupAttr(type, &_Py_ID(_swappedbytes_), &tmp) < 0) {
+ return -1;
+ }
+ if (tmp) {
+ Py_DECREF(tmp);
+ big_endian = !PY_BIG_ENDIAN;
+ }
+ else {
+ big_endian = PY_BIG_ENDIAN;
+ }
+
+ if (_PyObject_LookupAttr(type, &_Py_ID(_pack_), &tmp) < 0) {
+ return -1;
+ }
+ if (tmp) {
+ pack = _PyLong_AsInt(tmp);
+ Py_DECREF(tmp);
+ if (pack < 0) {
+ if (!PyErr_Occurred() ||
+ PyErr_ExceptionMatches(PyExc_TypeError) ||
+ PyErr_ExceptionMatches(PyExc_OverflowError))
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "_pack_ must be a non-negative integer");
+ }
+ return -1;
+ }
+ }
+ else {
+ /* Setting `_pack_ = 0` amounts to using the default alignment */
+ pack = 0;
+ }
+
+ len = PySequence_Size(fields);
+ if (len == -1) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of pairs");
+ }
+ return -1;
+ }
+
+ stgdict = PyType_stgdict(type);
+ if (!stgdict) {
+ PyErr_SetString(PyExc_TypeError,
+ "ctypes state is not initialized");
+ return -1;
+ }
+ /* If this structure/union is already marked final we cannot assign
+ _fields_ anymore. */
+
+ if (stgdict->flags & DICTFLAG_FINAL) {/* is final ? */
+ PyErr_SetString(PyExc_AttributeError,
+ "_fields_ is final");
+ return -1;
+ }
+
+ if (stgdict->format) {
+ PyMem_Free(stgdict->format);
+ stgdict->format = NULL;
+ }
+
+ if (stgdict->ffi_type_pointer.elements)
+ PyMem_Free(stgdict->ffi_type_pointer.elements);
+
+ basedict = PyType_stgdict((PyObject *)((PyTypeObject *)type)->tp_base);
+ if (basedict) {
+ stgdict->flags |= (basedict->flags &
+ (TYPEFLAG_HASUNION | TYPEFLAG_HASBITFIELD));
+ }
+ if (!isStruct) {
+ stgdict->flags |= TYPEFLAG_HASUNION;
+ }
+ if (basedict) {
+ size = offset = basedict->size;
+ align = basedict->align;
+ union_size = 0;
+ total_align = align ? align : 1;
+ stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
+ stgdict->ffi_type_pointer.elements = PyMem_New(ffi_type *, basedict->length + len + 1);
+ if (stgdict->ffi_type_pointer.elements == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memset(stgdict->ffi_type_pointer.elements, 0,
+ sizeof(ffi_type *) * (basedict->length + len + 1));
+ if (basedict->length > 0) {
+ memcpy(stgdict->ffi_type_pointer.elements,
+ basedict->ffi_type_pointer.elements,
+ sizeof(ffi_type *) * (basedict->length));
+ }
+ ffi_ofs = basedict->length;
+ } else {
+ offset = 0;
+ size = 0;
+ align = 0;
+ union_size = 0;
+ total_align = 1;
+ stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
+ stgdict->ffi_type_pointer.elements = PyMem_New(ffi_type *, len + 1);
+ if (stgdict->ffi_type_pointer.elements == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memset(stgdict->ffi_type_pointer.elements, 0,
+ sizeof(ffi_type *) * (len + 1));
+ ffi_ofs = 0;
+ }
+
+ assert(stgdict->format == NULL);
+ if (isStruct) {
+ stgdict->format = _ctypes_alloc_format_string(NULL, "T{");
+ } else {
+ /* PEP3118 doesn't support union. Use 'B' for bytes. */
+ stgdict->format = _ctypes_alloc_format_string(NULL, "B");
+ }
+ if (stgdict->format == NULL)
+ return -1;
+
+ for (i = 0; i < len; ++i) {
+ PyObject *name = NULL, *desc = NULL;
+ PyObject *pair = PySequence_GetItem(fields, i);
+ PyObject *prop;
+ StgDictObject *dict;
+ int bitsize = 0;
+
+ if (!pair || !PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of (name, C type) pairs");
+ Py_XDECREF(pair);
+ return -1;
+ }
+ if (PyCArrayTypeObject_Check(desc))
+ arrays_seen = 1;
+ dict = PyType_stgdict(desc);
+ if (dict == NULL) {
+ Py_DECREF(pair);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ stgdict->ffi_type_pointer.elements[ffi_ofs + i] = &dict->ffi_type_pointer;
+ if (dict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
+ stgdict->flags |= TYPEFLAG_HASPOINTER;
+ stgdict->flags |= dict->flags & (TYPEFLAG_HASUNION | TYPEFLAG_HASBITFIELD);
+ dict->flags |= DICTFLAG_FINAL; /* mark field type final */
+ if (PyTuple_Size(pair) == 3) { /* bits specified */
+ stgdict->flags |= TYPEFLAG_HASBITFIELD;
+ switch(dict->ffi_type_pointer.type) {
+ case FFI_TYPE_UINT8:
+ case FFI_TYPE_UINT16:
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_SINT64:
+ case FFI_TYPE_UINT64:
+ break;
+
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_SINT32:
+ if (dict->getfunc != _ctypes_get_fielddesc("c")->getfunc
+ && dict->getfunc != _ctypes_get_fielddesc("u")->getfunc
+ )
+ break;
+ /* else fall through */
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "bit fields not allowed for type %s",
+ ((PyTypeObject *)desc)->tp_name);
+ Py_DECREF(pair);
+ return -1;
+ }
+ if (bitsize <= 0 || bitsize > dict->size * 8) {
+ PyErr_SetString(PyExc_ValueError,
+ "number of bits invalid for bit field");
+ Py_DECREF(pair);
+ return -1;
+ }
+ } else
+ bitsize = 0;
+
+ if (isStruct) {
+ const char *fieldfmt = dict->format ? dict->format : "B";
+ const char *fieldname = PyUnicode_AsUTF8(name);
+ char *ptr;
+ Py_ssize_t len;
+ char *buf;
+ Py_ssize_t last_size = size;
+ Py_ssize_t padding;
+
+ if (fieldname == NULL)
+ {
+ Py_DECREF(pair);
+ return -1;
+ }
+
+ /* construct the field now, as `prop->offset` is `offset` with
+ corrected alignment */
+ prop = PyCField_FromDesc(desc, i,
+ &field_size, bitsize, &bitofs,
+ &size, &offset, &align,
+ pack, big_endian);
+ if (prop == NULL) {
+ Py_DECREF(pair);
+ return -1;
+ }
+
+ /* number of bytes between the end of the last field and the start
+ of this one */
+ padding = ((CFieldObject *)prop)->offset - last_size;
+
+ if (padding > 0) {
+ ptr = stgdict->format;
+ stgdict->format = _ctypes_alloc_format_padding(ptr, padding);
+ PyMem_Free(ptr);
+ if (stgdict->format == NULL) {
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ return -1;
+ }
+ }
+
+ len = strlen(fieldname) + strlen(fieldfmt);
+
+ buf = PyMem_Malloc(len + 2 + 1);
+ if (buf == NULL) {
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ PyErr_NoMemory();
+ return -1;
+ }
+ sprintf(buf, "%s:%s:", fieldfmt, fieldname);
+
+ ptr = stgdict->format;
+ if (dict->shape != NULL) {
+ stgdict->format = _ctypes_alloc_format_string_with_shape(
+ dict->ndim, dict->shape, stgdict->format, buf);
+ } else {
+ stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
+ }
+ PyMem_Free(ptr);
+ PyMem_Free(buf);
+
+ if (stgdict->format == NULL) {
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ return -1;
+ }
+ } else /* union */ {
+ size = 0;
+ offset = 0;
+ align = 0;
+ prop = PyCField_FromDesc(desc, i,
+ &field_size, bitsize, &bitofs,
+ &size, &offset, &align,
+ pack, big_endian);
+ if (prop == NULL) {
+ Py_DECREF(pair);
+ return -1;
+ }
+ union_size = max(size, union_size);
+ }
+ total_align = max(align, total_align);
+
+ if (-1 == PyObject_SetAttr(type, name, prop)) {
+ Py_DECREF(prop);
+ Py_DECREF(pair);
+ return -1;
+ }
+ Py_DECREF(pair);
+ Py_DECREF(prop);
+ }
+
+ if (!isStruct) {
+ size = union_size;
+ }
+
+ /* Adjust the size according to the alignment requirements */
+ aligned_size = ((size + total_align - 1) / total_align) * total_align;
+
+ if (isStruct) {
+ char *ptr;
+ Py_ssize_t padding;
+
+ /* Pad up to the full size of the struct */
+ padding = aligned_size - size;
+ if (padding > 0) {
+ ptr = stgdict->format;
+ stgdict->format = _ctypes_alloc_format_padding(ptr, padding);
+ PyMem_Free(ptr);
+ if (stgdict->format == NULL) {
+ return -1;
+ }
+ }
+
+ ptr = stgdict->format;
+ stgdict->format = _ctypes_alloc_format_string(stgdict->format, "}");
+ PyMem_Free(ptr);
+ if (stgdict->format == NULL)
+ return -1;
+ }
+
+ stgdict->ffi_type_pointer.alignment = Py_SAFE_DOWNCAST(total_align,
+ Py_ssize_t,
+ unsigned short);
+ stgdict->ffi_type_pointer.size = aligned_size;
+
+ stgdict->size = aligned_size;
+ stgdict->align = total_align;
+ stgdict->length = ffi_ofs + len;
+
+/*
+ * The value of MAX_STRUCT_SIZE depends on the platform Python is running on.
+ */
+#if defined(__aarch64__) || defined(__arm__) || defined(_M_ARM64)
+# define MAX_STRUCT_SIZE 32
+#elif defined(__powerpc64__)
+# define MAX_STRUCT_SIZE 64
+#else
+# define MAX_STRUCT_SIZE 16
+#endif
+
+ if (arrays_seen && (size <= MAX_STRUCT_SIZE)) {
+ /*
+ * See bpo-22273 and gh-110190. Arrays are normally treated as
+ * pointers, which is fine when an array name is being passed as
+ * parameter, but not when passing structures by value that contain
+ * arrays.
+ * Small structures passed by value are passed in registers, and in
+ * order to do this, libffi needs to know the true type of the array
+ * members of structs. Treating them as pointers breaks things.
+ *
+ * Small structures have different sizes depending on the platform
+ * where Python is running on:
+ *
+ * * x86-64: 16 bytes or less
+ * * Arm platforms (both 32 and 64 bit): 32 bytes or less
+ * * PowerPC 64 Little Endian: 64 bytes or less
+ *
+ * In that case, there can't be more than 16, 32 or 64 elements after
+ * unrolling arrays, as we (will) disallow bitfields.
+ * So we can collect the true ffi_type values in a fixed-size local
+ * array on the stack and, if any arrays were seen, replace the
+ * ffi_type_pointer.elements with a more accurate set, to allow
+ * libffi to marshal them into registers correctly.
+ * It means one more loop over the fields, but if we got here,
+ * the structure is small, so there aren't too many of those.
+ *
+ * Although the passing in registers is specific to the above
+ * platforms, the array-in-struct vs. pointer problem is general.
+ * But we restrict the type transformation to small structs
+ * nonetheless.
+ *
+ * Note that although a union may be small in terms of memory usage, it
+ * could contain many overlapping declarations of arrays, e.g.
+ *
+ * union {
+ * unsigned int_8 foo [16];
+ * unsigned uint_8 bar [16];
+ * unsigned int_16 baz[8];
+ * unsigned uint_16 bozz[8];
+ * unsigned int_32 fizz[4];
+ * unsigned uint_32 buzz[4];
+ * }
+ *
+ * which is still only 16 bytes in size. We need to convert this into
+ * the following equivalent for libffi:
+ *
+ * union {
+ * struct { int_8 e1; int_8 e2; ... int_8 e_16; } f1;
+ * struct { uint_8 e1; uint_8 e2; ... uint_8 e_16; } f2;
+ * struct { int_16 e1; int_16 e2; ... int_16 e_8; } f3;
+ * struct { uint_16 e1; uint_16 e2; ... uint_16 e_8; } f4;
+ * struct { int_32 e1; int_32 e2; ... int_32 e_4; } f5;
+ * struct { uint_32 e1; uint_32 e2; ... uint_32 e_4; } f6;
+ * }
+ *
+ * The same principle applies for a struct 32 or 64 bytes in size.
+ *
+ * So the struct/union needs setting up as follows: all non-array
+ * elements copied across as is, and all array elements replaced with
+ * an equivalent struct which has as many fields as the array has
+ * elements, plus one NULL pointer.
+ */
+
+ Py_ssize_t num_ffi_type_pointers = 0; /* for the dummy fields */
+ Py_ssize_t num_ffi_types = 0; /* for the dummy structures */
+ size_t alloc_size; /* total bytes to allocate */
+ void *type_block; /* to hold all the type information needed */
+ ffi_type **element_types; /* of this struct/union */
+ ffi_type **dummy_types; /* of the dummy struct elements */
+ ffi_type *structs; /* point to struct aliases of arrays */
+ Py_ssize_t element_index; /* index into element_types for this */
+ Py_ssize_t dummy_index = 0; /* index into dummy field pointers */
+ Py_ssize_t struct_index = 0; /* index into dummy structs */
+
+ /* first pass to see how much memory to allocate */
+ for (i = 0; i < len; ++i) {
+ PyObject *name, *desc;
+ PyObject *pair = PySequence_GetItem(fields, i);
+ StgDictObject *dict;
+ int bitsize = 0;
+
+ if (pair == NULL) {
+ return -1;
+ }
+ if (!PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of (name, C type) pairs");
+ Py_DECREF(pair);
+ return -1;
+ }
+ dict = PyType_stgdict(desc);
+ if (dict == NULL) {
+ Py_DECREF(pair);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ if (!PyCArrayTypeObject_Check(desc)) {
+ /* Not an array. Just need an ffi_type pointer. */
+ num_ffi_type_pointers++;
+ }
+ else {
+ /* It's an array. */
+ Py_ssize_t length = dict->length;
+ StgDictObject *edict;
+
+ edict = PyType_stgdict(dict->proto);
+ if (edict == NULL) {
+ Py_DECREF(pair);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ /*
+ * We need one extra ffi_type to hold the struct, and one
+ * ffi_type pointer per array element + one for a NULL to
+ * mark the end.
+ */
+ num_ffi_types++;
+ num_ffi_type_pointers += length + 1;
+ }
+ Py_DECREF(pair);
+ }
+
+ /*
+ * At this point, we know we need storage for some ffi_types and some
+ * ffi_type pointers. We'll allocate these in one block.
+ * There are three sub-blocks of information: the ffi_type pointers to
+ * this structure/union's elements, the ffi_type_pointers to the
+ * dummy fields standing in for array elements, and the
+ * ffi_types representing the dummy structures.
+ */
+ alloc_size = (ffi_ofs + 1 + len + num_ffi_type_pointers) * sizeof(ffi_type *) +
+ num_ffi_types * sizeof(ffi_type);
+ type_block = PyMem_Malloc(alloc_size);
+
+ if (type_block == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ /*
+ * the first block takes up ffi_ofs + len + 1 which is the pointers *
+ * for this struct/union. The second block takes up
+ * num_ffi_type_pointers, so the sum of these is ffi_ofs + len + 1 +
+ * num_ffi_type_pointers as allocated above. The last bit is the
+ * num_ffi_types structs.
+ */
+ element_types = (ffi_type **) type_block;
+ dummy_types = &element_types[ffi_ofs + len + 1];
+ structs = (ffi_type *) &dummy_types[num_ffi_type_pointers];
+
+ if (num_ffi_types > 0) {
+ memset(structs, 0, num_ffi_types * sizeof(ffi_type));
+ }
+ if (ffi_ofs && (basedict != NULL)) {
+ memcpy(element_types,
+ basedict->ffi_type_pointer.elements,
+ ffi_ofs * sizeof(ffi_type *));
+ }
+ element_index = ffi_ofs;
+
+ /* second pass to actually set the type pointers */
+ for (i = 0; i < len; ++i) {
+ PyObject *name, *desc;
+ PyObject *pair = PySequence_GetItem(fields, i);
+ StgDictObject *dict;
+ int bitsize = 0;
+
+ if (pair == NULL) {
+ PyMem_Free(type_block);
+ return -1;
+ }
+ /* In theory, we made this call in the first pass, so it *shouldn't*
+ * fail. However, you never know, and the code above might change
+ * later - keeping the check in here is a tad defensive but it
+ * will affect program size only slightly and performance hardly at
+ * all.
+ */
+ if (!PyArg_ParseTuple(pair, "UO|i", &name, &desc, &bitsize)) {
+ PyErr_SetString(PyExc_TypeError,
+ "'_fields_' must be a sequence of (name, C type) pairs");
+ Py_DECREF(pair);
+ PyMem_Free(type_block);
+ return -1;
+ }
+ dict = PyType_stgdict(desc);
+ /* Possibly this check could be avoided, but see above comment. */
+ if (dict == NULL) {
+ Py_DECREF(pair);
+ PyMem_Free(type_block);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ assert(element_index < (ffi_ofs + len)); /* will be used below */
+ if (!PyCArrayTypeObject_Check(desc)) {
+ /* Not an array. Just copy over the element ffi_type. */
+ element_types[element_index++] = &dict->ffi_type_pointer;
+ }
+ else {
+ Py_ssize_t length = dict->length;
+ StgDictObject *edict;
+
+ edict = PyType_stgdict(dict->proto);
+ if (edict == NULL) {
+ Py_DECREF(pair);
+ PyMem_Free(type_block);
+ PyErr_Format(PyExc_TypeError,
+ "second item in _fields_ tuple (index %zd) must be a C type",
+ i);
+ return -1;
+ }
+ element_types[element_index++] = &structs[struct_index];
+ structs[struct_index].size = length * edict->ffi_type_pointer.size;
+ structs[struct_index].alignment = edict->ffi_type_pointer.alignment;
+ structs[struct_index].type = FFI_TYPE_STRUCT;
+ structs[struct_index].elements = &dummy_types[dummy_index];
+ ++struct_index;
+ /* Copy over the element's type, length times. */
+ while (length > 0) {
+ assert(dummy_index < (num_ffi_type_pointers));
+ dummy_types[dummy_index++] = &edict->ffi_type_pointer;
+ length--;
+ }
+ assert(dummy_index < (num_ffi_type_pointers));
+ dummy_types[dummy_index++] = NULL;
+ }
+ Py_DECREF(pair);
+ }
+
+ element_types[element_index] = NULL;
+ /*
+ * Replace the old elements with the new, taking into account
+ * base class elements where necessary.
+ */
+ assert(stgdict->ffi_type_pointer.elements);
+ PyMem_Free(stgdict->ffi_type_pointer.elements);
+ stgdict->ffi_type_pointer.elements = element_types;
+ }
+
+ /* We did check that this flag was NOT set above, it must not
+ have been set until now. */
+ if (stgdict->flags & DICTFLAG_FINAL) {
+ PyErr_SetString(PyExc_AttributeError,
+ "Structure or union cannot contain itself");
+ return -1;
+ }
+ stgdict->flags |= DICTFLAG_FINAL;
+
+ return MakeAnonFields(type);
+}
diff --git a/contrib/tools/python3/Modules/_datetimemodule.c b/contrib/tools/python3/Modules/_datetimemodule.c
new file mode 100644
index 00000000000..c8dbc750b0e
--- /dev/null
+++ b/contrib/tools/python3/Modules/_datetimemodule.c
@@ -0,0 +1,7138 @@
+/* C implementation for the date/time type documented at
+ * https://www.zope.dev/Members/fdrake/DateTimeWiki/FrontPage
+ */
+
+/* bpo-35081: Defining this prevents including the C API capsule;
+ * internal versions of the Py*_Check macros which do not require
+ * the capsule are defined below */
+#define _PY_DATETIME_IMPL
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_long.h" // _PyLong_GetOne()
+#include "pycore_object.h" // _PyObject_Init()
+#include "datetime.h"
+#include "structmember.h" // PyMemberDef
+
+#include <time.h>
+
+#ifdef MS_WINDOWS
+# include <winsock2.h> /* struct timeval */
+#endif
+
+#define PyDate_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateType)
+#define PyDate_CheckExact(op) Py_IS_TYPE(op, &PyDateTime_DateType)
+
+#define PyDateTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_DateTimeType)
+#define PyDateTime_CheckExact(op) Py_IS_TYPE(op, &PyDateTime_DateTimeType)
+
+#define PyTime_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeType)
+#define PyTime_CheckExact(op) Py_IS_TYPE(op, &PyDateTime_TimeType)
+
+#define PyDelta_Check(op) PyObject_TypeCheck(op, &PyDateTime_DeltaType)
+#define PyDelta_CheckExact(op) Py_IS_TYPE(op, &PyDateTime_DeltaType)
+
+#define PyTZInfo_Check(op) PyObject_TypeCheck(op, &PyDateTime_TZInfoType)
+#define PyTZInfo_CheckExact(op) Py_IS_TYPE(op, &PyDateTime_TZInfoType)
+
+#define PyTimezone_Check(op) PyObject_TypeCheck(op, &PyDateTime_TimeZoneType)
+
+/*[clinic input]
+module datetime
+class datetime.datetime "PyDateTime_DateTime *" "&PyDateTime_DateTimeType"
+class datetime.date "PyDateTime_Date *" "&PyDateTime_DateType"
+class datetime.IsoCalendarDate "PyDateTime_IsoCalendarDate *" "&PyDateTime_IsoCalendarDateType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=81bec0fa19837f63]*/
+
+#include "clinic/_datetimemodule.c.h"
+
+/* We require that C int be at least 32 bits, and use int virtually
+ * everywhere. In just a few cases we use a temp long, where a Python
+ * API returns a C long. In such cases, we have to ensure that the
+ * final result fits in a C int (this can be an issue on 64-bit boxes).
+ */
+#if SIZEOF_INT < 4
+# error "_datetime.c requires that C int have at least 32 bits"
+#endif
+
+#define MINYEAR 1
+#define MAXYEAR 9999
+#define MAXORDINAL 3652059 /* date(9999,12,31).toordinal() */
+
+/* Nine decimal digits is easy to communicate, and leaves enough room
+ * so that two delta days can be added w/o fear of overflowing a signed
+ * 32-bit int, and with plenty of room left over to absorb any possible
+ * carries from adding seconds.
+ */
+#define MAX_DELTA_DAYS 999999999
+
+/* Rename the long macros in datetime.h to more reasonable short names. */
+#define GET_YEAR PyDateTime_GET_YEAR
+#define GET_MONTH PyDateTime_GET_MONTH
+#define GET_DAY PyDateTime_GET_DAY
+#define DATE_GET_HOUR PyDateTime_DATE_GET_HOUR
+#define DATE_GET_MINUTE PyDateTime_DATE_GET_MINUTE
+#define DATE_GET_SECOND PyDateTime_DATE_GET_SECOND
+#define DATE_GET_MICROSECOND PyDateTime_DATE_GET_MICROSECOND
+#define DATE_GET_FOLD PyDateTime_DATE_GET_FOLD
+
+/* Date accessors for date and datetime. */
+#define SET_YEAR(o, v) (((o)->data[0] = ((v) & 0xff00) >> 8), \
+ ((o)->data[1] = ((v) & 0x00ff)))
+#define SET_MONTH(o, v) (PyDateTime_GET_MONTH(o) = (v))
+#define SET_DAY(o, v) (PyDateTime_GET_DAY(o) = (v))
+
+/* Date/Time accessors for datetime. */
+#define DATE_SET_HOUR(o, v) (PyDateTime_DATE_GET_HOUR(o) = (v))
+#define DATE_SET_MINUTE(o, v) (PyDateTime_DATE_GET_MINUTE(o) = (v))
+#define DATE_SET_SECOND(o, v) (PyDateTime_DATE_GET_SECOND(o) = (v))
+#define DATE_SET_MICROSECOND(o, v) \
+ (((o)->data[7] = ((v) & 0xff0000) >> 16), \
+ ((o)->data[8] = ((v) & 0x00ff00) >> 8), \
+ ((o)->data[9] = ((v) & 0x0000ff)))
+#define DATE_SET_FOLD(o, v) (PyDateTime_DATE_GET_FOLD(o) = (v))
+
+/* Time accessors for time. */
+#define TIME_GET_HOUR PyDateTime_TIME_GET_HOUR
+#define TIME_GET_MINUTE PyDateTime_TIME_GET_MINUTE
+#define TIME_GET_SECOND PyDateTime_TIME_GET_SECOND
+#define TIME_GET_MICROSECOND PyDateTime_TIME_GET_MICROSECOND
+#define TIME_GET_FOLD PyDateTime_TIME_GET_FOLD
+#define TIME_SET_HOUR(o, v) (PyDateTime_TIME_GET_HOUR(o) = (v))
+#define TIME_SET_MINUTE(o, v) (PyDateTime_TIME_GET_MINUTE(o) = (v))
+#define TIME_SET_SECOND(o, v) (PyDateTime_TIME_GET_SECOND(o) = (v))
+#define TIME_SET_MICROSECOND(o, v) \
+ (((o)->data[3] = ((v) & 0xff0000) >> 16), \
+ ((o)->data[4] = ((v) & 0x00ff00) >> 8), \
+ ((o)->data[5] = ((v) & 0x0000ff)))
+#define TIME_SET_FOLD(o, v) (PyDateTime_TIME_GET_FOLD(o) = (v))
+
+/* Delta accessors for timedelta. */
+#define GET_TD_DAYS(o) (((PyDateTime_Delta *)(o))->days)
+#define GET_TD_SECONDS(o) (((PyDateTime_Delta *)(o))->seconds)
+#define GET_TD_MICROSECONDS(o) (((PyDateTime_Delta *)(o))->microseconds)
+
+#define SET_TD_DAYS(o, v) ((o)->days = (v))
+#define SET_TD_SECONDS(o, v) ((o)->seconds = (v))
+#define SET_TD_MICROSECONDS(o, v) ((o)->microseconds = (v))
+
+#define HASTZINFO _PyDateTime_HAS_TZINFO
+#define GET_TIME_TZINFO PyDateTime_TIME_GET_TZINFO
+#define GET_DT_TZINFO PyDateTime_DATE_GET_TZINFO
+/* M is a char or int claiming to be a valid month. The macro is equivalent
+ * to the two-sided Python test
+ * 1 <= M <= 12
+ */
+#define MONTH_IS_SANE(M) ((unsigned int)(M) - 1 < 12)
+
+/* Forward declarations. */
+static PyTypeObject PyDateTime_DateType;
+static PyTypeObject PyDateTime_DateTimeType;
+static PyTypeObject PyDateTime_DeltaType;
+static PyTypeObject PyDateTime_IsoCalendarDateType;
+static PyTypeObject PyDateTime_TimeType;
+static PyTypeObject PyDateTime_TZInfoType;
+static PyTypeObject PyDateTime_TimeZoneType;
+
+static int check_tzinfo_subclass(PyObject *p);
+
+
+/* ---------------------------------------------------------------------------
+ * Math utilities.
+ */
+
+/* k = i+j overflows iff k differs in sign from both inputs,
+ * iff k^i has sign bit set and k^j has sign bit set,
+ * iff (k^i)&(k^j) has sign bit set.
+ */
+#define SIGNED_ADD_OVERFLOWED(RESULT, I, J) \
+ ((((RESULT) ^ (I)) & ((RESULT) ^ (J))) < 0)
+
+/* Compute Python divmod(x, y), returning the quotient and storing the
+ * remainder into *r. The quotient is the floor of x/y, and that's
+ * the real point of this. C will probably truncate instead (C99
+ * requires truncation; C89 left it implementation-defined).
+ * Simplification: we *require* that y > 0 here. That's appropriate
+ * for all the uses made of it. This simplifies the code and makes
+ * the overflow case impossible (divmod(LONG_MIN, -1) is the only
+ * overflow case).
+ */
+static int
+divmod(int x, int y, int *r)
+{
+ int quo;
+
+ assert(y > 0);
+ quo = x / y;
+ *r = x - quo * y;
+ if (*r < 0) {
+ --quo;
+ *r += y;
+ }
+ assert(0 <= *r && *r < y);
+ return quo;
+}
+
+/* Nearest integer to m / n for integers m and n. Half-integer results
+ * are rounded to even.
+ */
+static PyObject *
+divide_nearest(PyObject *m, PyObject *n)
+{
+ PyObject *result;
+ PyObject *temp;
+
+ temp = _PyLong_DivmodNear(m, n);
+ if (temp == NULL)
+ return NULL;
+ result = Py_NewRef(PyTuple_GET_ITEM(temp, 0));
+ Py_DECREF(temp);
+
+ return result;
+}
+
+/* ---------------------------------------------------------------------------
+ * General calendrical helper functions
+ */
+
+/* For each month ordinal in 1..12, the number of days in that month,
+ * and the number of days before that month in the same year. These
+ * are correct for non-leap years only.
+ */
+static const int _days_in_month[] = {
+ 0, /* unused; this vector uses 1-based indexing */
+ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+};
+
+static const int _days_before_month[] = {
+ 0, /* unused; this vector uses 1-based indexing */
+ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
+};
+
+/* year -> 1 if leap year, else 0. */
+static int
+is_leap(int year)
+{
+ /* Cast year to unsigned. The result is the same either way, but
+ * C can generate faster code for unsigned mod than for signed
+ * mod (especially for % 4 -- a good compiler should just grab
+ * the last 2 bits when the LHS is unsigned).
+ */
+ const unsigned int ayear = (unsigned int)year;
+ return ayear % 4 == 0 && (ayear % 100 != 0 || ayear % 400 == 0);
+}
+
+/* year, month -> number of days in that month in that year */
+static int
+days_in_month(int year, int month)
+{
+ assert(month >= 1);
+ assert(month <= 12);
+ if (month == 2 && is_leap(year))
+ return 29;
+ else
+ return _days_in_month[month];
+}
+
+/* year, month -> number of days in year preceding first day of month */
+static int
+days_before_month(int year, int month)
+{
+ int days;
+
+ assert(month >= 1);
+ assert(month <= 12);
+ days = _days_before_month[month];
+ if (month > 2 && is_leap(year))
+ ++days;
+ return days;
+}
+
+/* year -> number of days before January 1st of year. Remember that we
+ * start with year 1, so days_before_year(1) == 0.
+ */
+static int
+days_before_year(int year)
+{
+ int y = year - 1;
+ /* This is incorrect if year <= 0; we really want the floor
+ * here. But so long as MINYEAR is 1, the smallest year this
+ * can see is 1.
+ */
+ assert (year >= 1);
+ return y*365 + y/4 - y/100 + y/400;
+}
+
+/* Number of days in 4, 100, and 400 year cycles. That these have
+ * the correct values is asserted in the module init function.
+ */
+#define DI4Y 1461 /* days_before_year(5); days in 4 years */
+#define DI100Y 36524 /* days_before_year(101); days in 100 years */
+#define DI400Y 146097 /* days_before_year(401); days in 400 years */
+
+/* ordinal -> year, month, day, considering 01-Jan-0001 as day 1. */
+static void
+ord_to_ymd(int ordinal, int *year, int *month, int *day)
+{
+ int n, n1, n4, n100, n400, leapyear, preceding;
+
+ /* ordinal is a 1-based index, starting at 1-Jan-1. The pattern of
+ * leap years repeats exactly every 400 years. The basic strategy is
+ * to find the closest 400-year boundary at or before ordinal, then
+ * work with the offset from that boundary to ordinal. Life is much
+ * clearer if we subtract 1 from ordinal first -- then the values
+ * of ordinal at 400-year boundaries are exactly those divisible
+ * by DI400Y:
+ *
+ * D M Y n n-1
+ * -- --- ---- ---------- ----------------
+ * 31 Dec -400 -DI400Y -DI400Y -1
+ * 1 Jan -399 -DI400Y +1 -DI400Y 400-year boundary
+ * ...
+ * 30 Dec 000 -1 -2
+ * 31 Dec 000 0 -1
+ * 1 Jan 001 1 0 400-year boundary
+ * 2 Jan 001 2 1
+ * 3 Jan 001 3 2
+ * ...
+ * 31 Dec 400 DI400Y DI400Y -1
+ * 1 Jan 401 DI400Y +1 DI400Y 400-year boundary
+ */
+ assert(ordinal >= 1);
+ --ordinal;
+ n400 = ordinal / DI400Y;
+ n = ordinal % DI400Y;
+ *year = n400 * 400 + 1;
+
+ /* Now n is the (non-negative) offset, in days, from January 1 of
+ * year, to the desired date. Now compute how many 100-year cycles
+ * precede n.
+ * Note that it's possible for n100 to equal 4! In that case 4 full
+ * 100-year cycles precede the desired day, which implies the
+ * desired day is December 31 at the end of a 400-year cycle.
+ */
+ n100 = n / DI100Y;
+ n = n % DI100Y;
+
+ /* Now compute how many 4-year cycles precede it. */
+ n4 = n / DI4Y;
+ n = n % DI4Y;
+
+ /* And now how many single years. Again n1 can be 4, and again
+ * meaning that the desired day is December 31 at the end of the
+ * 4-year cycle.
+ */
+ n1 = n / 365;
+ n = n % 365;
+
+ *year += n100 * 100 + n4 * 4 + n1;
+ if (n1 == 4 || n100 == 4) {
+ assert(n == 0);
+ *year -= 1;
+ *month = 12;
+ *day = 31;
+ return;
+ }
+
+ /* Now the year is correct, and n is the offset from January 1. We
+ * find the month via an estimate that's either exact or one too
+ * large.
+ */
+ leapyear = n1 == 3 && (n4 != 24 || n100 == 3);
+ assert(leapyear == is_leap(*year));
+ *month = (n + 50) >> 5;
+ preceding = (_days_before_month[*month] + (*month > 2 && leapyear));
+ if (preceding > n) {
+ /* estimate is too large */
+ *month -= 1;
+ preceding -= days_in_month(*year, *month);
+ }
+ n -= preceding;
+ assert(0 <= n);
+ assert(n < days_in_month(*year, *month));
+
+ *day = n + 1;
+}
+
+/* year, month, day -> ordinal, considering 01-Jan-0001 as day 1. */
+static int
+ymd_to_ord(int year, int month, int day)
+{
+ return days_before_year(year) + days_before_month(year, month) + day;
+}
+
+/* Day of week, where Monday==0, ..., Sunday==6. 1/1/1 was a Monday. */
+static int
+weekday(int year, int month, int day)
+{
+ return (ymd_to_ord(year, month, day) + 6) % 7;
+}
+
+/* Ordinal of the Monday starting week 1 of the ISO year. Week 1 is the
+ * first calendar week containing a Thursday.
+ */
+static int
+iso_week1_monday(int year)
+{
+ int first_day = ymd_to_ord(year, 1, 1); /* ord of 1/1 */
+ /* 0 if 1/1 is a Monday, 1 if a Tue, etc. */
+ int first_weekday = (first_day + 6) % 7;
+ /* ordinal of closest Monday at or before 1/1 */
+ int week1_monday = first_day - first_weekday;
+
+ if (first_weekday > 3) /* if 1/1 was Fri, Sat, Sun */
+ week1_monday += 7;
+ return week1_monday;
+}
+
+static int
+iso_to_ymd(const int iso_year, const int iso_week, const int iso_day,
+ int *year, int *month, int *day) {
+ if (iso_week <= 0 || iso_week >= 53) {
+ int out_of_range = 1;
+ if (iso_week == 53) {
+ // ISO years have 53 weeks in it on years starting with a Thursday
+ // and on leap years starting on Wednesday
+ int first_weekday = weekday(iso_year, 1, 1);
+ if (first_weekday == 3 || (first_weekday == 2 && is_leap(iso_year))) {
+ out_of_range = 0;
+ }
+ }
+
+ if (out_of_range) {
+ return -2;
+ }
+ }
+
+ if (iso_day <= 0 || iso_day >= 8) {
+ return -3;
+ }
+
+ // Convert (Y, W, D) to (Y, M, D) in-place
+ int day_1 = iso_week1_monday(iso_year);
+
+ int day_offset = (iso_week - 1)*7 + iso_day - 1;
+
+ ord_to_ymd(day_1 + day_offset, year, month, day);
+ return 0;
+}
+
+
+/* ---------------------------------------------------------------------------
+ * Range checkers.
+ */
+
+/* Check that -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS. If so, return 0.
+ * If not, raise OverflowError and return -1.
+ */
+static int
+check_delta_day_range(int days)
+{
+ if (-MAX_DELTA_DAYS <= days && days <= MAX_DELTA_DAYS)
+ return 0;
+ PyErr_Format(PyExc_OverflowError,
+ "days=%d; must have magnitude <= %d",
+ days, MAX_DELTA_DAYS);
+ return -1;
+}
+
+/* Check that date arguments are in range. Return 0 if they are. If they
+ * aren't, raise ValueError and return -1.
+ */
+static int
+check_date_args(int year, int month, int day)
+{
+
+ if (year < MINYEAR || year > MAXYEAR) {
+ PyErr_Format(PyExc_ValueError, "year %i is out of range", year);
+ return -1;
+ }
+ if (month < 1 || month > 12) {
+ PyErr_SetString(PyExc_ValueError,
+ "month must be in 1..12");
+ return -1;
+ }
+ if (day < 1 || day > days_in_month(year, month)) {
+ PyErr_SetString(PyExc_ValueError,
+ "day is out of range for month");
+ return -1;
+ }
+ return 0;
+}
+
+/* Check that time arguments are in range. Return 0 if they are. If they
+ * aren't, raise ValueError and return -1.
+ */
+static int
+check_time_args(int h, int m, int s, int us, int fold)
+{
+ if (h < 0 || h > 23) {
+ PyErr_SetString(PyExc_ValueError,
+ "hour must be in 0..23");
+ return -1;
+ }
+ if (m < 0 || m > 59) {
+ PyErr_SetString(PyExc_ValueError,
+ "minute must be in 0..59");
+ return -1;
+ }
+ if (s < 0 || s > 59) {
+ PyErr_SetString(PyExc_ValueError,
+ "second must be in 0..59");
+ return -1;
+ }
+ if (us < 0 || us > 999999) {
+ PyErr_SetString(PyExc_ValueError,
+ "microsecond must be in 0..999999");
+ return -1;
+ }
+ if (fold != 0 && fold != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "fold must be either 0 or 1");
+ return -1;
+ }
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------
+ * Normalization utilities.
+ */
+
+/* One step of a mixed-radix conversion. A "hi" unit is equivalent to
+ * factor "lo" units. factor must be > 0. If *lo is less than 0, or
+ * at least factor, enough of *lo is converted into "hi" units so that
+ * 0 <= *lo < factor. The input values must be such that int overflow
+ * is impossible.
+ */
+static void
+normalize_pair(int *hi, int *lo, int factor)
+{
+ assert(factor > 0);
+ assert(lo != hi);
+ if (*lo < 0 || *lo >= factor) {
+ const int num_hi = divmod(*lo, factor, lo);
+ const int new_hi = *hi + num_hi;
+ assert(! SIGNED_ADD_OVERFLOWED(new_hi, *hi, num_hi));
+ *hi = new_hi;
+ }
+ assert(0 <= *lo && *lo < factor);
+}
+
+/* Fiddle days (d), seconds (s), and microseconds (us) so that
+ * 0 <= *s < 24*3600
+ * 0 <= *us < 1000000
+ * The input values must be such that the internals don't overflow.
+ * The way this routine is used, we don't get close.
+ */
+static void
+normalize_d_s_us(int *d, int *s, int *us)
+{
+ if (*us < 0 || *us >= 1000000) {
+ normalize_pair(s, us, 1000000);
+ /* |s| can't be bigger than about
+ * |original s| + |original us|/1000000 now.
+ */
+
+ }
+ if (*s < 0 || *s >= 24*3600) {
+ normalize_pair(d, s, 24*3600);
+ /* |d| can't be bigger than about
+ * |original d| +
+ * (|original s| + |original us|/1000000) / (24*3600) now.
+ */
+ }
+ assert(0 <= *s && *s < 24*3600);
+ assert(0 <= *us && *us < 1000000);
+}
+
+/* Fiddle years (y), months (m), and days (d) so that
+ * 1 <= *m <= 12
+ * 1 <= *d <= days_in_month(*y, *m)
+ * The input values must be such that the internals don't overflow.
+ * The way this routine is used, we don't get close.
+ */
+static int
+normalize_y_m_d(int *y, int *m, int *d)
+{
+ int dim; /* # of days in month */
+
+ /* In actual use, m is always the month component extracted from a
+ * date/datetime object. Therefore it is always in [1, 12] range.
+ */
+
+ assert(1 <= *m && *m <= 12);
+
+ /* Now only day can be out of bounds (year may also be out of bounds
+ * for a datetime object, but we don't care about that here).
+ * If day is out of bounds, what to do is arguable, but at least the
+ * method here is principled and explainable.
+ */
+ dim = days_in_month(*y, *m);
+ if (*d < 1 || *d > dim) {
+ /* Move day-1 days from the first of the month. First try to
+ * get off cheap if we're only one day out of range
+ * (adjustments for timezone alone can't be worse than that).
+ */
+ if (*d == 0) {
+ --*m;
+ if (*m > 0)
+ *d = days_in_month(*y, *m);
+ else {
+ --*y;
+ *m = 12;
+ *d = 31;
+ }
+ }
+ else if (*d == dim + 1) {
+ /* move forward a day */
+ ++*m;
+ *d = 1;
+ if (*m > 12) {
+ *m = 1;
+ ++*y;
+ }
+ }
+ else {
+ int ordinal = ymd_to_ord(*y, *m, 1) +
+ *d - 1;
+ if (ordinal < 1 || ordinal > MAXORDINAL) {
+ goto error;
+ } else {
+ ord_to_ymd(ordinal, y, m, d);
+ return 0;
+ }
+ }
+ }
+ assert(*m > 0);
+ assert(*d > 0);
+ if (MINYEAR <= *y && *y <= MAXYEAR)
+ return 0;
+ error:
+ PyErr_SetString(PyExc_OverflowError,
+ "date value out of range");
+ return -1;
+
+}
+
+/* Fiddle out-of-bounds months and days so that the result makes some kind
+ * of sense. The parameters are both inputs and outputs. Returns < 0 on
+ * failure, where failure means the adjusted year is out of bounds.
+ */
+static int
+normalize_date(int *year, int *month, int *day)
+{
+ return normalize_y_m_d(year, month, day);
+}
+
+/* Force all the datetime fields into range. The parameters are both
+ * inputs and outputs. Returns < 0 on error.
+ */
+static int
+normalize_datetime(int *year, int *month, int *day,
+ int *hour, int *minute, int *second,
+ int *microsecond)
+{
+ normalize_pair(second, microsecond, 1000000);
+ normalize_pair(minute, second, 60);
+ normalize_pair(hour, minute, 60);
+ normalize_pair(day, hour, 24);
+ return normalize_date(year, month, day);
+}
+
+/* ---------------------------------------------------------------------------
+ * Basic object allocation: tp_alloc implementations. These allocate
+ * Python objects of the right size and type, and do the Python object-
+ * initialization bit. If there's not enough memory, they return NULL after
+ * setting MemoryError. All data members remain uninitialized trash.
+ *
+ * We abuse the tp_alloc "nitems" argument to communicate whether a tzinfo
+ * member is needed. This is ugly, imprecise, and possibly insecure.
+ * tp_basicsize for the time and datetime types is set to the size of the
+ * struct that has room for the tzinfo member, so subclasses in Python will
+ * allocate enough space for a tzinfo member whether or not one is actually
+ * needed. That's the "ugly and imprecise" parts. The "possibly insecure"
+ * part is that PyType_GenericAlloc() (which subclasses in Python end up
+ * using) just happens today to effectively ignore the nitems argument
+ * when tp_itemsize is 0, which it is for these type objects. If that
+ * changes, perhaps the callers of tp_alloc slots in this file should
+ * be changed to force a 0 nitems argument unless the type being allocated
+ * is a base type implemented in this file (so that tp_alloc is time_alloc
+ * or datetime_alloc below, which know about the nitems abuse).
+ */
+
+static PyObject *
+time_alloc(PyTypeObject *type, Py_ssize_t aware)
+{
+ size_t size = aware ? sizeof(PyDateTime_Time) : sizeof(_PyDateTime_BaseTime);
+ PyObject *self = (PyObject *)PyObject_Malloc(size);
+ if (self == NULL) {
+ return PyErr_NoMemory();
+ }
+ _PyObject_Init(self, type);
+ return self;
+}
+
+static PyObject *
+datetime_alloc(PyTypeObject *type, Py_ssize_t aware)
+{
+ size_t size = aware ? sizeof(PyDateTime_DateTime) : sizeof(_PyDateTime_BaseDateTime);
+ PyObject *self = (PyObject *)PyObject_Malloc(size);
+ if (self == NULL) {
+ return PyErr_NoMemory();
+ }
+ _PyObject_Init(self, type);
+ return self;
+}
+
+/* ---------------------------------------------------------------------------
+ * Helpers for setting object fields. These work on pointers to the
+ * appropriate base class.
+ */
+
+/* For date and datetime. */
+static void
+set_date_fields(PyDateTime_Date *self, int y, int m, int d)
+{
+ self->hashcode = -1;
+ SET_YEAR(self, y);
+ SET_MONTH(self, m);
+ SET_DAY(self, d);
+}
+
+/* ---------------------------------------------------------------------------
+ * String parsing utilities and helper functions
+ */
+
+static unsigned char
+is_digit(const char c) {
+ return ((unsigned int)(c - '0')) < 10;
+}
+
+static const char *
+parse_digits(const char *ptr, int *var, size_t num_digits)
+{
+ for (size_t i = 0; i < num_digits; ++i) {
+ unsigned int tmp = (unsigned int)(*(ptr++) - '0');
+ if (tmp > 9) {
+ return NULL;
+ }
+ *var *= 10;
+ *var += (signed int)tmp;
+ }
+
+ return ptr;
+}
+
+static int
+parse_isoformat_date(const char *dtstr, const size_t len, int *year, int *month, int *day)
+{
+ /* Parse the date components of the result of date.isoformat()
+ *
+ * Return codes:
+ * 0: Success
+ * -1: Failed to parse date component
+ * -2: Inconsistent date separator usage
+ * -3: Failed to parse ISO week.
+ * -4: Failed to parse ISO day.
+ * -5, -6: Failure in iso_to_ymd
+ */
+ const char *p = dtstr;
+ p = parse_digits(p, year, 4);
+ if (NULL == p) {
+ return -1;
+ }
+
+ const unsigned char uses_separator = (*p == '-');
+ if (uses_separator) {
+ ++p;
+ }
+
+ if(*p == 'W') {
+ // This is an isocalendar-style date string
+ p++;
+ int iso_week = 0;
+ int iso_day = 0;
+
+ p = parse_digits(p, &iso_week, 2);
+ if (NULL == p) {
+ return -3;
+ }
+
+ assert(p > dtstr);
+ if ((size_t)(p - dtstr) < len) {
+ if (uses_separator && *(p++) != '-') {
+ return -2;
+ }
+
+ p = parse_digits(p, &iso_day, 1);
+ if (NULL == p) {
+ return -4;
+ }
+ } else {
+ iso_day = 1;
+ }
+
+ int rv = iso_to_ymd(*year, iso_week, iso_day, year, month, day);
+ if (rv) {
+ return -3 + rv;
+ } else {
+ return 0;
+ }
+ }
+
+ p = parse_digits(p, month, 2);
+ if (NULL == p) {
+ return -1;
+ }
+
+ if (uses_separator && *(p++) != '-') {
+ return -2;
+ }
+ p = parse_digits(p, day, 2);
+ if (p == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+parse_hh_mm_ss_ff(const char *tstr, const char *tstr_end, int *hour,
+ int *minute, int *second, int *microsecond)
+{
+ *hour = *minute = *second = *microsecond = 0;
+ const char *p = tstr;
+ const char *p_end = tstr_end;
+ int *vals[3] = {hour, minute, second};
+ // This is initialized to satisfy an erroneous compiler warning.
+ unsigned char has_separator = 1;
+
+ // Parse [HH[:?MM[:?SS]]]
+ for (size_t i = 0; i < 3; ++i) {
+ p = parse_digits(p, vals[i], 2);
+ if (NULL == p) {
+ return -3;
+ }
+
+ char c = *(p++);
+ if (i == 0) {
+ has_separator = (c == ':');
+ }
+
+ if (p >= p_end) {
+ return c != '\0';
+ }
+ else if (has_separator && (c == ':')) {
+ continue;
+ }
+ else if (c == '.' || c == ',') {
+ break;
+ } else if (!has_separator) {
+ --p;
+ } else {
+ return -4; // Malformed time separator
+ }
+ }
+
+ // Parse fractional components
+ size_t len_remains = p_end - p;
+ size_t to_parse = len_remains;
+ if (len_remains >= 6) {
+ to_parse = 6;
+ }
+
+ p = parse_digits(p, microsecond, to_parse);
+ if (NULL == p) {
+ return -3;
+ }
+
+ static int correction[] = {
+ 100000, 10000, 1000, 100, 10
+ };
+
+ if (to_parse < 6) {
+ *microsecond *= correction[to_parse-1];
+ }
+
+ while (is_digit(*p)){
+ ++p; // skip truncated digits
+ }
+
+ // Return 1 if it's not the end of the string
+ return *p != '\0';
+}
+
+static int
+parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute,
+ int *second, int *microsecond, int *tzoffset,
+ int *tzmicrosecond)
+{
+ // Parse the time portion of a datetime.isoformat() string
+ //
+ // Return codes:
+ // 0: Success (no tzoffset)
+ // 1: Success (with tzoffset)
+ // -3: Failed to parse time component
+ // -4: Failed to parse time separator
+ // -5: Malformed timezone string
+
+ const char *p = dtstr;
+ const char *p_end = dtstr + dtlen;
+
+ const char *tzinfo_pos = p;
+ do {
+ if (*tzinfo_pos == 'Z' || *tzinfo_pos == '+' || *tzinfo_pos == '-') {
+ break;
+ }
+ } while (++tzinfo_pos < p_end);
+
+ int rv = parse_hh_mm_ss_ff(dtstr, tzinfo_pos, hour, minute, second,
+ microsecond);
+
+ if (rv < 0) {
+ return rv;
+ }
+ else if (tzinfo_pos == p_end) {
+ // We know that there's no time zone, so if there's stuff at the
+ // end of the string it's an error.
+ if (rv == 1) {
+ return -5;
+ }
+ else {
+ return 0;
+ }
+ }
+
+ // Special case UTC / Zulu time.
+ if (*tzinfo_pos == 'Z') {
+ *tzoffset = 0;
+ *tzmicrosecond = 0;
+
+ if (*(tzinfo_pos + 1) != '\0') {
+ return -5;
+ } else {
+ return 1;
+ }
+ }
+
+ int tzsign = (*tzinfo_pos == '-') ? -1 : 1;
+ tzinfo_pos++;
+ int tzhour = 0, tzminute = 0, tzsecond = 0;
+ rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, &tzhour, &tzminute, &tzsecond,
+ tzmicrosecond);
+
+ *tzoffset = tzsign * ((tzhour * 3600) + (tzminute * 60) + tzsecond);
+ *tzmicrosecond *= tzsign;
+
+ return rv ? -5 : 1;
+}
+
+/* ---------------------------------------------------------------------------
+ * Create various objects, mostly without range checking.
+ */
+
+/* Create a date instance with no range checking. */
+static PyObject *
+new_date_ex(int year, int month, int day, PyTypeObject *type)
+{
+ PyDateTime_Date *self;
+
+ if (check_date_args(year, month, day) < 0) {
+ return NULL;
+ }
+
+ self = (PyDateTime_Date *)(type->tp_alloc(type, 0));
+ if (self != NULL)
+ set_date_fields(self, year, month, day);
+ return (PyObject *)self;
+}
+
+#define new_date(year, month, day) \
+ new_date_ex(year, month, day, &PyDateTime_DateType)
+
+// Forward declaration
+static PyObject *
+new_datetime_ex(int, int, int, int, int, int, int, PyObject *, PyTypeObject *);
+
+/* Create date instance with no range checking, or call subclass constructor */
+static PyObject *
+new_date_subclass_ex(int year, int month, int day, PyObject *cls)
+{
+ PyObject *result;
+ // We have "fast path" constructors for two subclasses: date and datetime
+ if ((PyTypeObject *)cls == &PyDateTime_DateType) {
+ result = new_date_ex(year, month, day, (PyTypeObject *)cls);
+ }
+ else if ((PyTypeObject *)cls == &PyDateTime_DateTimeType) {
+ result = new_datetime_ex(year, month, day, 0, 0, 0, 0, Py_None,
+ (PyTypeObject *)cls);
+ }
+ else {
+ result = PyObject_CallFunction(cls, "iii", year, month, day);
+ }
+
+ return result;
+}
+
+/* Create a datetime instance with no range checking. */
+static PyObject *
+new_datetime_ex2(int year, int month, int day, int hour, int minute,
+ int second, int usecond, PyObject *tzinfo, int fold, PyTypeObject *type)
+{
+ PyDateTime_DateTime *self;
+ char aware = tzinfo != Py_None;
+
+ if (check_date_args(year, month, day) < 0) {
+ return NULL;
+ }
+ if (check_time_args(hour, minute, second, usecond, fold) < 0) {
+ return NULL;
+ }
+ if (check_tzinfo_subclass(tzinfo) < 0) {
+ return NULL;
+ }
+
+ self = (PyDateTime_DateTime *) (type->tp_alloc(type, aware));
+ if (self != NULL) {
+ self->hastzinfo = aware;
+ set_date_fields((PyDateTime_Date *)self, year, month, day);
+ DATE_SET_HOUR(self, hour);
+ DATE_SET_MINUTE(self, minute);
+ DATE_SET_SECOND(self, second);
+ DATE_SET_MICROSECOND(self, usecond);
+ if (aware) {
+ self->tzinfo = Py_NewRef(tzinfo);
+ }
+ DATE_SET_FOLD(self, fold);
+ }
+ return (PyObject *)self;
+}
+
+static PyObject *
+new_datetime_ex(int year, int month, int day, int hour, int minute,
+ int second, int usecond, PyObject *tzinfo, PyTypeObject *type)
+{
+ return new_datetime_ex2(year, month, day, hour, minute, second, usecond,
+ tzinfo, 0, type);
+}
+
+#define new_datetime(y, m, d, hh, mm, ss, us, tzinfo, fold) \
+ new_datetime_ex2(y, m, d, hh, mm, ss, us, tzinfo, fold, \
+ &PyDateTime_DateTimeType)
+
+static PyObject *
+new_datetime_subclass_fold_ex(int year, int month, int day, int hour, int minute,
+ int second, int usecond, PyObject *tzinfo,
+ int fold, PyObject *cls) {
+ PyObject* dt;
+ if ((PyTypeObject*)cls == &PyDateTime_DateTimeType) {
+ // Use the fast path constructor
+ dt = new_datetime(year, month, day, hour, minute, second, usecond,
+ tzinfo, fold);
+ } else {
+ // Subclass
+ dt = PyObject_CallFunction(cls, "iiiiiiiO",
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ usecond,
+ tzinfo);
+ }
+
+ return dt;
+}
+
+static PyObject *
+new_datetime_subclass_ex(int year, int month, int day, int hour, int minute,
+ int second, int usecond, PyObject *tzinfo,
+ PyObject *cls) {
+ return new_datetime_subclass_fold_ex(year, month, day, hour, minute,
+ second, usecond, tzinfo, 0,
+ cls);
+}
+
+/* Create a time instance with no range checking. */
+static PyObject *
+new_time_ex2(int hour, int minute, int second, int usecond,
+ PyObject *tzinfo, int fold, PyTypeObject *type)
+{
+ PyDateTime_Time *self;
+ char aware = tzinfo != Py_None;
+
+ if (check_time_args(hour, minute, second, usecond, fold) < 0) {
+ return NULL;
+ }
+ if (check_tzinfo_subclass(tzinfo) < 0) {
+ return NULL;
+ }
+
+ self = (PyDateTime_Time *) (type->tp_alloc(type, aware));
+ if (self != NULL) {
+ self->hastzinfo = aware;
+ self->hashcode = -1;
+ TIME_SET_HOUR(self, hour);
+ TIME_SET_MINUTE(self, minute);
+ TIME_SET_SECOND(self, second);
+ TIME_SET_MICROSECOND(self, usecond);
+ if (aware) {
+ self->tzinfo = Py_NewRef(tzinfo);
+ }
+ TIME_SET_FOLD(self, fold);
+ }
+ return (PyObject *)self;
+}
+
+static PyObject *
+new_time_ex(int hour, int minute, int second, int usecond,
+ PyObject *tzinfo, PyTypeObject *type)
+{
+ return new_time_ex2(hour, minute, second, usecond, tzinfo, 0, type);
+}
+
+#define new_time(hh, mm, ss, us, tzinfo, fold) \
+ new_time_ex2(hh, mm, ss, us, tzinfo, fold, &PyDateTime_TimeType)
+
+/* Create a timedelta instance. Normalize the members iff normalize is
+ * true. Passing false is a speed optimization, if you know for sure
+ * that seconds and microseconds are already in their proper ranges. In any
+ * case, raises OverflowError and returns NULL if the normalized days is out
+ * of range.
+ */
+static PyObject *
+new_delta_ex(int days, int seconds, int microseconds, int normalize,
+ PyTypeObject *type)
+{
+ PyDateTime_Delta *self;
+
+ if (normalize)
+ normalize_d_s_us(&days, &seconds, &microseconds);
+ assert(0 <= seconds && seconds < 24*3600);
+ assert(0 <= microseconds && microseconds < 1000000);
+
+ if (check_delta_day_range(days) < 0)
+ return NULL;
+
+ self = (PyDateTime_Delta *) (type->tp_alloc(type, 0));
+ if (self != NULL) {
+ self->hashcode = -1;
+ SET_TD_DAYS(self, days);
+ SET_TD_SECONDS(self, seconds);
+ SET_TD_MICROSECONDS(self, microseconds);
+ }
+ return (PyObject *) self;
+}
+
+#define new_delta(d, s, us, normalize) \
+ new_delta_ex(d, s, us, normalize, &PyDateTime_DeltaType)
+
+
+typedef struct
+{
+ PyObject_HEAD
+ PyObject *offset;
+ PyObject *name;
+} PyDateTime_TimeZone;
+
+/* The interned UTC timezone instance */
+static PyObject *PyDateTime_TimeZone_UTC;
+/* The interned Epoch datetime instance */
+static PyObject *PyDateTime_Epoch;
+
+/* Create new timezone instance checking offset range. This
+ function does not check the name argument. Caller must assure
+ that offset is a timedelta instance and name is either NULL
+ or a unicode object. */
+static PyObject *
+create_timezone(PyObject *offset, PyObject *name)
+{
+ PyDateTime_TimeZone *self;
+ PyTypeObject *type = &PyDateTime_TimeZoneType;
+
+ assert(offset != NULL);
+ assert(PyDelta_Check(offset));
+ assert(name == NULL || PyUnicode_Check(name));
+
+ self = (PyDateTime_TimeZone *)(type->tp_alloc(type, 0));
+ if (self == NULL) {
+ return NULL;
+ }
+ self->offset = Py_NewRef(offset);
+ self->name = Py_XNewRef(name);
+ return (PyObject *)self;
+}
+
+static int delta_bool(PyDateTime_Delta *self);
+
+static PyObject *
+new_timezone(PyObject *offset, PyObject *name)
+{
+ assert(offset != NULL);
+ assert(PyDelta_Check(offset));
+ assert(name == NULL || PyUnicode_Check(name));
+
+ if (name == NULL && delta_bool((PyDateTime_Delta *)offset) == 0) {
+ return Py_NewRef(PyDateTime_TimeZone_UTC);
+ }
+ if ((GET_TD_DAYS(offset) == -1 &&
+ GET_TD_SECONDS(offset) == 0 &&
+ GET_TD_MICROSECONDS(offset) < 1) ||
+ GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
+ PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
+ " strictly between -timedelta(hours=24) and"
+ " timedelta(hours=24),"
+ " not %R.", offset);
+ return NULL;
+ }
+
+ return create_timezone(offset, name);
+}
+
+/* ---------------------------------------------------------------------------
+ * tzinfo helpers.
+ */
+
+/* Ensure that p is None or of a tzinfo subclass. Return 0 if OK; if not
+ * raise TypeError and return -1.
+ */
+static int
+check_tzinfo_subclass(PyObject *p)
+{
+ if (p == Py_None || PyTZInfo_Check(p))
+ return 0;
+ PyErr_Format(PyExc_TypeError,
+ "tzinfo argument must be None or of a tzinfo subclass, "
+ "not type '%s'",
+ Py_TYPE(p)->tp_name);
+ return -1;
+}
+
+/* If self has a tzinfo member, return a BORROWED reference to it. Else
+ * return NULL, which is NOT AN ERROR. There are no error returns here,
+ * and the caller must not decref the result.
+ */
+static PyObject *
+get_tzinfo_member(PyObject *self)
+{
+ PyObject *tzinfo = NULL;
+
+ if (PyDateTime_Check(self) && HASTZINFO(self))
+ tzinfo = ((PyDateTime_DateTime *)self)->tzinfo;
+ else if (PyTime_Check(self) && HASTZINFO(self))
+ tzinfo = ((PyDateTime_Time *)self)->tzinfo;
+
+ return tzinfo;
+}
+
+/* Call getattr(tzinfo, name)(tzinfoarg), and check the result. tzinfo must
+ * be an instance of the tzinfo class. If the method returns None, this
+ * returns None. If the method doesn't return None or timedelta, TypeError is
+ * raised and this returns NULL. If it returns a timedelta and the value is
+ * out of range or isn't a whole number of minutes, ValueError is raised and
+ * this returns NULL. Else result is returned.
+ */
+static PyObject *
+call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
+{
+ PyObject *offset;
+
+ assert(tzinfo != NULL);
+ assert(PyTZInfo_Check(tzinfo) || tzinfo == Py_None);
+ assert(tzinfoarg != NULL);
+
+ if (tzinfo == Py_None)
+ Py_RETURN_NONE;
+ offset = PyObject_CallMethod(tzinfo, name, "O", tzinfoarg);
+ if (offset == Py_None || offset == NULL)
+ return offset;
+ if (PyDelta_Check(offset)) {
+ if ((GET_TD_DAYS(offset) == -1 &&
+ GET_TD_SECONDS(offset) == 0 &&
+ GET_TD_MICROSECONDS(offset) < 1) ||
+ GET_TD_DAYS(offset) < -1 || GET_TD_DAYS(offset) >= 1) {
+ Py_DECREF(offset);
+ PyErr_Format(PyExc_ValueError, "offset must be a timedelta"
+ " strictly between -timedelta(hours=24) and"
+ " timedelta(hours=24).");
+ return NULL;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "tzinfo.%s() must return None or "
+ "timedelta, not '%.200s'",
+ name, Py_TYPE(offset)->tp_name);
+ Py_DECREF(offset);
+ return NULL;
+ }
+
+ return offset;
+}
+
+/* Call tzinfo.utcoffset(tzinfoarg), and extract an integer from the
+ * result. tzinfo must be an instance of the tzinfo class. If utcoffset()
+ * returns None, call_utcoffset returns 0 and sets *none to 1. If uctoffset()
+ * doesn't return None or timedelta, TypeError is raised and this returns -1.
+ * If utcoffset() returns an out of range timedelta,
+ * ValueError is raised and this returns -1. Else *none is
+ * set to 0 and the offset is returned (as timedelta, positive east of UTC).
+ */
+static PyObject *
+call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg)
+{
+ return call_tzinfo_method(tzinfo, "utcoffset", tzinfoarg);
+}
+
+/* Call tzinfo.dst(tzinfoarg), and extract an integer from the
+ * result. tzinfo must be an instance of the tzinfo class. If dst()
+ * returns None, call_dst returns 0 and sets *none to 1. If dst()
+ * doesn't return None or timedelta, TypeError is raised and this
+ * returns -1. If dst() returns an invalid timedelta for a UTC offset,
+ * ValueError is raised and this returns -1. Else *none is set to 0 and
+ * the offset is returned (as timedelta, positive east of UTC).
+ */
+static PyObject *
+call_dst(PyObject *tzinfo, PyObject *tzinfoarg)
+{
+ return call_tzinfo_method(tzinfo, "dst", tzinfoarg);
+}
+
+/* Call tzinfo.tzname(tzinfoarg), and return the result. tzinfo must be
+ * an instance of the tzinfo class or None. If tzinfo isn't None, and
+ * tzname() doesn't return None or a string, TypeError is raised and this
+ * returns NULL. If the result is a string, we ensure it is a Unicode
+ * string.
+ */
+static PyObject *
+call_tzname(PyObject *tzinfo, PyObject *tzinfoarg)
+{
+ PyObject *result;
+ assert(tzinfo != NULL);
+ assert(check_tzinfo_subclass(tzinfo) >= 0);
+ assert(tzinfoarg != NULL);
+
+ if (tzinfo == Py_None)
+ Py_RETURN_NONE;
+
+ result = PyObject_CallMethodOneArg(tzinfo, &_Py_ID(tzname), tzinfoarg);
+
+ if (result == NULL || result == Py_None)
+ return result;
+
+ if (!PyUnicode_Check(result)) {
+ PyErr_Format(PyExc_TypeError, "tzinfo.tzname() must "
+ "return None or a string, not '%s'",
+ Py_TYPE(result)->tp_name);
+ Py_SETREF(result, NULL);
+ }
+
+ return result;
+}
+
+/* repr is like "someclass(arg1, arg2)". If tzinfo isn't None,
+ * stuff
+ * ", tzinfo=" + repr(tzinfo)
+ * before the closing ")".
+ */
+static PyObject *
+append_keyword_tzinfo(PyObject *repr, PyObject *tzinfo)
+{
+ PyObject *temp;
+
+ assert(PyUnicode_Check(repr));
+ assert(tzinfo);
+ if (tzinfo == Py_None)
+ return repr;
+ /* Get rid of the trailing ')'. */
+ assert(PyUnicode_READ_CHAR(repr, PyUnicode_GET_LENGTH(repr)-1) == ')');
+ temp = PyUnicode_Substring(repr, 0, PyUnicode_GET_LENGTH(repr) - 1);
+ Py_DECREF(repr);
+ if (temp == NULL)
+ return NULL;
+ repr = PyUnicode_FromFormat("%U, tzinfo=%R)", temp, tzinfo);
+ Py_DECREF(temp);
+ return repr;
+}
+
+/* repr is like "someclass(arg1, arg2)". If fold isn't 0,
+ * stuff
+ * ", fold=" + repr(tzinfo)
+ * before the closing ")".
+ */
+static PyObject *
+append_keyword_fold(PyObject *repr, int fold)
+{
+ PyObject *temp;
+
+ assert(PyUnicode_Check(repr));
+ if (fold == 0)
+ return repr;
+ /* Get rid of the trailing ')'. */
+ assert(PyUnicode_READ_CHAR(repr, PyUnicode_GET_LENGTH(repr)-1) == ')');
+ temp = PyUnicode_Substring(repr, 0, PyUnicode_GET_LENGTH(repr) - 1);
+ Py_DECREF(repr);
+ if (temp == NULL)
+ return NULL;
+ repr = PyUnicode_FromFormat("%U, fold=%d)", temp, fold);
+ Py_DECREF(temp);
+ return repr;
+}
+
+static inline PyObject *
+tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds)
+{
+ PyObject *tzinfo;
+ if (rv == 1) {
+ // Create a timezone from offset in seconds (0 returns UTC)
+ if (tzoffset == 0) {
+ return Py_NewRef(PyDateTime_TimeZone_UTC);
+ }
+
+ PyObject *delta = new_delta(0, tzoffset, tz_useconds, 1);
+ if (delta == NULL) {
+ return NULL;
+ }
+ tzinfo = new_timezone(delta, NULL);
+ Py_DECREF(delta);
+ }
+ else {
+ tzinfo = Py_NewRef(Py_None);
+ }
+
+ return tzinfo;
+}
+
+/* ---------------------------------------------------------------------------
+ * String format helpers.
+ */
+
+static PyObject *
+format_ctime(PyDateTime_Date *date, int hours, int minutes, int seconds)
+{
+ static const char * const DayNames[] = {
+ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"
+ };
+ static const char * const MonthNames[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+
+ int wday = weekday(GET_YEAR(date), GET_MONTH(date), GET_DAY(date));
+
+ return PyUnicode_FromFormat("%s %s %2d %02d:%02d:%02d %04d",
+ DayNames[wday], MonthNames[GET_MONTH(date)-1],
+ GET_DAY(date), hours, minutes, seconds,
+ GET_YEAR(date));
+}
+
+static PyObject *delta_negative(PyDateTime_Delta *self);
+
+/* Add formatted UTC offset string to buf. buf has no more than
+ * buflen bytes remaining. The UTC offset is gotten by calling
+ * tzinfo.uctoffset(tzinfoarg). If that returns None, \0 is stored into
+ * *buf, and that's all. Else the returned value is checked for sanity (an
+ * integer in range), and if that's OK it's converted to an hours & minutes
+ * string of the form
+ * sign HH sep MM [sep SS [. UUUUUU]]
+ * Returns 0 if everything is OK. If the return value from utcoffset() is
+ * bogus, an appropriate exception is set and -1 is returned.
+ */
+static int
+format_utcoffset(char *buf, size_t buflen, const char *sep,
+ PyObject *tzinfo, PyObject *tzinfoarg)
+{
+ PyObject *offset;
+ int hours, minutes, seconds, microseconds;
+ char sign;
+
+ assert(buflen >= 1);
+
+ offset = call_utcoffset(tzinfo, tzinfoarg);
+ if (offset == NULL)
+ return -1;
+ if (offset == Py_None) {
+ Py_DECREF(offset);
+ *buf = '\0';
+ return 0;
+ }
+ /* Offset is normalized, so it is negative if days < 0 */
+ if (GET_TD_DAYS(offset) < 0) {
+ sign = '-';
+ Py_SETREF(offset, delta_negative((PyDateTime_Delta *)offset));
+ if (offset == NULL)
+ return -1;
+ }
+ else {
+ sign = '+';
+ }
+ /* Offset is not negative here. */
+ microseconds = GET_TD_MICROSECONDS(offset);
+ seconds = GET_TD_SECONDS(offset);
+ Py_DECREF(offset);
+ minutes = divmod(seconds, 60, &seconds);
+ hours = divmod(minutes, 60, &minutes);
+ if (microseconds) {
+ PyOS_snprintf(buf, buflen, "%c%02d%s%02d%s%02d.%06d", sign,
+ hours, sep, minutes, sep, seconds, microseconds);
+ return 0;
+ }
+ if (seconds) {
+ PyOS_snprintf(buf, buflen, "%c%02d%s%02d%s%02d", sign, hours,
+ sep, minutes, sep, seconds);
+ return 0;
+ }
+ PyOS_snprintf(buf, buflen, "%c%02d%s%02d", sign, hours, sep, minutes);
+ return 0;
+}
+
+static PyObject *
+make_somezreplacement(PyObject *object, char *sep, PyObject *tzinfoarg)
+{
+ char buf[100];
+ PyObject *tzinfo = get_tzinfo_member(object);
+
+ if (tzinfo == Py_None || tzinfo == NULL) {
+ return PyBytes_FromStringAndSize(NULL, 0);
+ }
+
+ assert(tzinfoarg != NULL);
+ if (format_utcoffset(buf,
+ sizeof(buf),
+ sep,
+ tzinfo,
+ tzinfoarg) < 0)
+ return NULL;
+
+ return PyBytes_FromStringAndSize(buf, strlen(buf));
+}
+
+static PyObject *
+make_Zreplacement(PyObject *object, PyObject *tzinfoarg)
+{
+ PyObject *temp;
+ PyObject *tzinfo = get_tzinfo_member(object);
+ PyObject *Zreplacement = PyUnicode_FromStringAndSize(NULL, 0);
+
+ if (Zreplacement == NULL)
+ return NULL;
+ if (tzinfo == Py_None || tzinfo == NULL)
+ return Zreplacement;
+
+ assert(tzinfoarg != NULL);
+ temp = call_tzname(tzinfo, tzinfoarg);
+ if (temp == NULL)
+ goto Error;
+ if (temp == Py_None) {
+ Py_DECREF(temp);
+ return Zreplacement;
+ }
+
+ assert(PyUnicode_Check(temp));
+ /* Since the tzname is getting stuffed into the
+ * format, we have to double any % signs so that
+ * strftime doesn't treat them as format codes.
+ */
+ Py_DECREF(Zreplacement);
+ Zreplacement = PyObject_CallMethod(temp, "replace", "ss", "%", "%%");
+ Py_DECREF(temp);
+ if (Zreplacement == NULL)
+ return NULL;
+ if (!PyUnicode_Check(Zreplacement)) {
+ PyErr_SetString(PyExc_TypeError,
+ "tzname.replace() did not return a string");
+ goto Error;
+ }
+ return Zreplacement;
+
+ Error:
+ Py_DECREF(Zreplacement);
+ return NULL;
+}
+
+static PyObject *
+make_freplacement(PyObject *object)
+{
+ char freplacement[64];
+ if (PyTime_Check(object))
+ sprintf(freplacement, "%06d", TIME_GET_MICROSECOND(object));
+ else if (PyDateTime_Check(object))
+ sprintf(freplacement, "%06d", DATE_GET_MICROSECOND(object));
+ else
+ sprintf(freplacement, "%06d", 0);
+
+ return PyBytes_FromStringAndSize(freplacement, strlen(freplacement));
+}
+
+/* I sure don't want to reproduce the strftime code from the time module,
+ * so this imports the module and calls it. All the hair is due to
+ * giving special meanings to the %z, %:z, %Z and %f format codes via a
+ * preprocessing step on the format string.
+ * tzinfoarg is the argument to pass to the object's tzinfo method, if
+ * needed.
+ */
+static PyObject *
+wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
+ PyObject *tzinfoarg)
+{
+ PyObject *result = NULL; /* guilty until proved innocent */
+
+ PyObject *zreplacement = NULL; /* py string, replacement for %z */
+ PyObject *colonzreplacement = NULL; /* py string, replacement for %:z */
+ PyObject *Zreplacement = NULL; /* py string, replacement for %Z */
+ PyObject *freplacement = NULL; /* py string, replacement for %f */
+
+ const char *pin; /* pointer to next char in input format */
+ Py_ssize_t flen; /* length of input format */
+ char ch; /* next char in input format */
+
+ PyObject *newfmt = NULL; /* py string, the output format */
+ char *pnew; /* pointer to available byte in output format */
+ size_t totalnew; /* number bytes total in output format buffer,
+ exclusive of trailing \0 */
+ size_t usednew; /* number bytes used so far in output format buffer */
+
+ const char *ptoappend; /* ptr to string to append to output buffer */
+ Py_ssize_t ntoappend; /* # of bytes to append to output buffer */
+
+ assert(object && format && timetuple);
+ assert(PyUnicode_Check(format));
+ /* Convert the input format to a C string and size */
+ pin = PyUnicode_AsUTF8AndSize(format, &flen);
+ if (!pin)
+ return NULL;
+
+ /* Scan the input format, looking for %z/%Z/%f escapes, building
+ * a new format. Since computing the replacements for those codes
+ * is expensive, don't unless they're actually used.
+ */
+ if (flen > INT_MAX - 1) {
+ PyErr_NoMemory();
+ goto Done;
+ }
+
+ totalnew = flen + 1; /* realistic if no %z/%Z */
+ newfmt = PyBytes_FromStringAndSize(NULL, totalnew);
+ if (newfmt == NULL) goto Done;
+ pnew = PyBytes_AsString(newfmt);
+ usednew = 0;
+
+ while ((ch = *pin++) != '\0') {
+ if (ch != '%') {
+ ptoappend = pin - 1;
+ ntoappend = 1;
+ }
+ else if ((ch = *pin++) == '\0') {
+ /* Null byte follows %, copy only '%'.
+ *
+ * Back the pin up one char so that we catch the null check
+ * the next time through the loop.*/
+ pin--;
+ ptoappend = pin - 1;
+ ntoappend = 1;
+ }
+ /* A % has been seen and ch is the character after it. */
+ else if (ch == 'z') {
+ /* %z -> +HHMM */
+ if (zreplacement == NULL) {
+ zreplacement = make_somezreplacement(object, "", tzinfoarg);
+ if (zreplacement == NULL)
+ goto Done;
+ }
+ assert(zreplacement != NULL);
+ assert(PyBytes_Check(zreplacement));
+ ptoappend = PyBytes_AS_STRING(zreplacement);
+ ntoappend = PyBytes_GET_SIZE(zreplacement);
+ }
+ else if (ch == ':' && *pin == 'z' && pin++) {
+ /* %:z -> +HH:MM */
+ if (colonzreplacement == NULL) {
+ colonzreplacement = make_somezreplacement(object, ":", tzinfoarg);
+ if (colonzreplacement == NULL)
+ goto Done;
+ }
+ assert(colonzreplacement != NULL);
+ assert(PyBytes_Check(colonzreplacement));
+ ptoappend = PyBytes_AS_STRING(colonzreplacement);
+ ntoappend = PyBytes_GET_SIZE(colonzreplacement);
+ }
+ else if (ch == 'Z') {
+ /* format tzname */
+ if (Zreplacement == NULL) {
+ Zreplacement = make_Zreplacement(object,
+ tzinfoarg);
+ if (Zreplacement == NULL)
+ goto Done;
+ }
+ assert(Zreplacement != NULL);
+ assert(PyUnicode_Check(Zreplacement));
+ ptoappend = PyUnicode_AsUTF8AndSize(Zreplacement,
+ &ntoappend);
+ if (ptoappend == NULL)
+ goto Done;
+ }
+ else if (ch == 'f') {
+ /* format microseconds */
+ if (freplacement == NULL) {
+ freplacement = make_freplacement(object);
+ if (freplacement == NULL)
+ goto Done;
+ }
+ assert(freplacement != NULL);
+ assert(PyBytes_Check(freplacement));
+ ptoappend = PyBytes_AS_STRING(freplacement);
+ ntoappend = PyBytes_GET_SIZE(freplacement);
+ }
+ else {
+ /* percent followed by something else */
+ ptoappend = pin - 2;
+ ntoappend = 2;
+ }
+
+ /* Append the ntoappend chars starting at ptoappend to
+ * the new format.
+ */
+ if (ntoappend == 0)
+ continue;
+ assert(ptoappend != NULL);
+ assert(ntoappend > 0);
+ while (usednew + ntoappend > totalnew) {
+ if (totalnew > (PY_SSIZE_T_MAX >> 1)) { /* overflow */
+ PyErr_NoMemory();
+ goto Done;
+ }
+ totalnew <<= 1;
+ if (_PyBytes_Resize(&newfmt, totalnew) < 0)
+ goto Done;
+ pnew = PyBytes_AsString(newfmt) + usednew;
+ }
+ memcpy(pnew, ptoappend, ntoappend);
+ pnew += ntoappend;
+ usednew += ntoappend;
+ assert(usednew <= totalnew);
+ } /* end while() */
+
+ if (_PyBytes_Resize(&newfmt, usednew) < 0)
+ goto Done;
+ {
+ PyObject *format;
+ PyObject *strftime = _PyImport_GetModuleAttrString("time", "strftime");
+
+ if (strftime == NULL)
+ goto Done;
+ format = PyUnicode_FromString(PyBytes_AS_STRING(newfmt));
+ if (format != NULL) {
+ result = PyObject_CallFunctionObjArgs(strftime,
+ format, timetuple, NULL);
+ Py_DECREF(format);
+ }
+ Py_DECREF(strftime);
+ }
+ Done:
+ Py_XDECREF(freplacement);
+ Py_XDECREF(zreplacement);
+ Py_XDECREF(colonzreplacement);
+ Py_XDECREF(Zreplacement);
+ Py_XDECREF(newfmt);
+ return result;
+}
+
+/* ---------------------------------------------------------------------------
+ * Wrap functions from the time module. These aren't directly available
+ * from C. Perhaps they should be.
+ */
+
+/* Call time.time() and return its result (a Python float). */
+static PyObject *
+time_time(void)
+{
+ PyObject *result = NULL;
+ PyObject *time = _PyImport_GetModuleAttrString("time", "time");
+
+ if (time != NULL) {
+ result = PyObject_CallNoArgs(time);
+ Py_DECREF(time);
+ }
+ return result;
+}
+
+/* Build a time.struct_time. The weekday and day number are automatically
+ * computed from the y,m,d args.
+ */
+static PyObject *
+build_struct_time(int y, int m, int d, int hh, int mm, int ss, int dstflag)
+{
+ PyObject *struct_time;
+ PyObject *result;
+
+ struct_time = _PyImport_GetModuleAttrString("time", "struct_time");
+ if (struct_time == NULL) {
+ return NULL;
+ }
+
+ result = PyObject_CallFunction(struct_time, "((iiiiiiiii))",
+ y, m, d,
+ hh, mm, ss,
+ weekday(y, m, d),
+ days_before_month(y, m) + d,
+ dstflag);
+ Py_DECREF(struct_time);
+ return result;
+}
+
+/* ---------------------------------------------------------------------------
+ * Miscellaneous helpers.
+ */
+
+/* The comparisons here all most naturally compute a cmp()-like result.
+ * This little helper turns that into a bool result for rich comparisons.
+ */
+static PyObject *
+diff_to_bool(int diff, int op)
+{
+ Py_RETURN_RICHCOMPARE(diff, 0, op);
+}
+
+/* Raises a "can't compare" TypeError and returns NULL. */
+static PyObject *
+cmperror(PyObject *a, PyObject *b)
+{
+ PyErr_Format(PyExc_TypeError,
+ "can't compare %s to %s",
+ Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
+ return NULL;
+}
+
+/* ---------------------------------------------------------------------------
+ * Cached Python objects; these are set by the module init function.
+ */
+
+/* Conversion factors. */
+static PyObject *us_per_ms = NULL; /* 1000 */
+static PyObject *us_per_second = NULL; /* 1000000 */
+static PyObject *us_per_minute = NULL; /* 1e6 * 60 as Python int */
+static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python int */
+static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python int */
+static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python int */
+static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
+
+/* ---------------------------------------------------------------------------
+ * Class implementations.
+ */
+
+/*
+ * PyDateTime_Delta implementation.
+ */
+
+/* Convert a timedelta to a number of us,
+ * (24*3600*self.days + self.seconds)*1000000 + self.microseconds
+ * as a Python int.
+ * Doing mixed-radix arithmetic by hand instead is excruciating in C,
+ * due to ubiquitous overflow possibilities.
+ */
+static PyObject *
+delta_to_microseconds(PyDateTime_Delta *self)
+{
+ PyObject *x1 = NULL;
+ PyObject *x2 = NULL;
+ PyObject *x3 = NULL;
+ PyObject *result = NULL;
+
+ x1 = PyLong_FromLong(GET_TD_DAYS(self));
+ if (x1 == NULL)
+ goto Done;
+ x2 = PyNumber_Multiply(x1, seconds_per_day); /* days in seconds */
+ if (x2 == NULL)
+ goto Done;
+ Py_SETREF(x1, NULL);
+
+ /* x2 has days in seconds */
+ x1 = PyLong_FromLong(GET_TD_SECONDS(self)); /* seconds */
+ if (x1 == NULL)
+ goto Done;
+ x3 = PyNumber_Add(x1, x2); /* days and seconds in seconds */
+ if (x3 == NULL)
+ goto Done;
+ Py_DECREF(x1);
+ Py_DECREF(x2);
+ /* x1 = */ x2 = NULL;
+
+ /* x3 has days+seconds in seconds */
+ x1 = PyNumber_Multiply(x3, us_per_second); /* us */
+ if (x1 == NULL)
+ goto Done;
+ Py_SETREF(x3, NULL);
+
+ /* x1 has days+seconds in us */
+ x2 = PyLong_FromLong(GET_TD_MICROSECONDS(self));
+ if (x2 == NULL)
+ goto Done;
+ result = PyNumber_Add(x1, x2);
+ assert(result == NULL || PyLong_CheckExact(result));
+
+Done:
+ Py_XDECREF(x1);
+ Py_XDECREF(x2);
+ Py_XDECREF(x3);
+ return result;
+}
+
+static PyObject *
+checked_divmod(PyObject *a, PyObject *b)
+{
+ PyObject *result = PyNumber_Divmod(a, b);
+ if (result != NULL) {
+ if (!PyTuple_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "divmod() returned non-tuple (type %.200s)",
+ Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (PyTuple_GET_SIZE(result) != 2) {
+ PyErr_Format(PyExc_TypeError,
+ "divmod() returned a tuple of size %zd",
+ PyTuple_GET_SIZE(result));
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ return result;
+}
+
+/* Convert a number of us (as a Python int) to a timedelta.
+ */
+static PyObject *
+microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type)
+{
+ int us;
+ int s;
+ int d;
+
+ PyObject *tuple = NULL;
+ PyObject *num = NULL;
+ PyObject *result = NULL;
+
+ tuple = checked_divmod(pyus, us_per_second);
+ if (tuple == NULL) {
+ goto Done;
+ }
+
+ num = PyTuple_GET_ITEM(tuple, 1); /* us */
+ us = _PyLong_AsInt(num);
+ num = NULL;
+ if (us == -1 && PyErr_Occurred()) {
+ goto Done;
+ }
+ if (!(0 <= us && us < 1000000)) {
+ goto BadDivmod;
+ }
+
+ num = Py_NewRef(PyTuple_GET_ITEM(tuple, 0)); /* leftover seconds */
+ Py_DECREF(tuple);
+
+ tuple = checked_divmod(num, seconds_per_day);
+ if (tuple == NULL)
+ goto Done;
+ Py_DECREF(num);
+
+ num = PyTuple_GET_ITEM(tuple, 1); /* seconds */
+ s = _PyLong_AsInt(num);
+ num = NULL;
+ if (s == -1 && PyErr_Occurred()) {
+ goto Done;
+ }
+ if (!(0 <= s && s < 24*3600)) {
+ goto BadDivmod;
+ }
+
+ num = Py_NewRef(PyTuple_GET_ITEM(tuple, 0)); /* leftover days */
+ d = _PyLong_AsInt(num);
+ if (d == -1 && PyErr_Occurred()) {
+ goto Done;
+ }
+ result = new_delta_ex(d, s, us, 0, type);
+
+Done:
+ Py_XDECREF(tuple);
+ Py_XDECREF(num);
+ return result;
+
+BadDivmod:
+ PyErr_SetString(PyExc_TypeError,
+ "divmod() returned a value out of range");
+ goto Done;
+}
+
+#define microseconds_to_delta(pymicros) \
+ microseconds_to_delta_ex(pymicros, &PyDateTime_DeltaType)
+
+static PyObject *
+multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta)
+{
+ PyObject *pyus_in;
+ PyObject *pyus_out;
+ PyObject *result;
+
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+
+ pyus_out = PyNumber_Multiply(intobj, pyus_in);
+ Py_DECREF(pyus_in);
+ if (pyus_out == NULL)
+ return NULL;
+
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+ return result;
+}
+
+static PyObject *
+get_float_as_integer_ratio(PyObject *floatobj)
+{
+ PyObject *ratio;
+
+ assert(floatobj && PyFloat_Check(floatobj));
+ ratio = PyObject_CallMethodNoArgs(floatobj, &_Py_ID(as_integer_ratio));
+ if (ratio == NULL) {
+ return NULL;
+ }
+ if (!PyTuple_Check(ratio)) {
+ PyErr_Format(PyExc_TypeError,
+ "unexpected return type from as_integer_ratio(): "
+ "expected tuple, got '%.200s'",
+ Py_TYPE(ratio)->tp_name);
+ Py_DECREF(ratio);
+ return NULL;
+ }
+ if (PyTuple_Size(ratio) != 2) {
+ PyErr_SetString(PyExc_ValueError,
+ "as_integer_ratio() must return a 2-tuple");
+ Py_DECREF(ratio);
+ return NULL;
+ }
+ return ratio;
+}
+
+/* op is 0 for multiplication, 1 for division */
+static PyObject *
+multiply_truedivide_timedelta_float(PyDateTime_Delta *delta, PyObject *floatobj, int op)
+{
+ PyObject *result = NULL;
+ PyObject *pyus_in = NULL, *temp, *pyus_out;
+ PyObject *ratio = NULL;
+
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+ ratio = get_float_as_integer_ratio(floatobj);
+ if (ratio == NULL) {
+ goto error;
+ }
+ temp = PyNumber_Multiply(pyus_in, PyTuple_GET_ITEM(ratio, op));
+ Py_SETREF(pyus_in, NULL);
+ if (temp == NULL)
+ goto error;
+ pyus_out = divide_nearest(temp, PyTuple_GET_ITEM(ratio, !op));
+ Py_DECREF(temp);
+ if (pyus_out == NULL)
+ goto error;
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+ error:
+ Py_XDECREF(pyus_in);
+ Py_XDECREF(ratio);
+
+ return result;
+}
+
+static PyObject *
+divide_timedelta_int(PyDateTime_Delta *delta, PyObject *intobj)
+{
+ PyObject *pyus_in;
+ PyObject *pyus_out;
+ PyObject *result;
+
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+
+ pyus_out = PyNumber_FloorDivide(pyus_in, intobj);
+ Py_DECREF(pyus_in);
+ if (pyus_out == NULL)
+ return NULL;
+
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+ return result;
+}
+
+static PyObject *
+divide_timedelta_timedelta(PyDateTime_Delta *left, PyDateTime_Delta *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *result;
+
+ pyus_left = delta_to_microseconds(left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds(right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ result = PyNumber_FloorDivide(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ return result;
+}
+
+static PyObject *
+truedivide_timedelta_timedelta(PyDateTime_Delta *left, PyDateTime_Delta *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *result;
+
+ pyus_left = delta_to_microseconds(left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds(right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ result = PyNumber_TrueDivide(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ return result;
+}
+
+static PyObject *
+truedivide_timedelta_int(PyDateTime_Delta *delta, PyObject *i)
+{
+ PyObject *result;
+ PyObject *pyus_in, *pyus_out;
+ pyus_in = delta_to_microseconds(delta);
+ if (pyus_in == NULL)
+ return NULL;
+ pyus_out = divide_nearest(pyus_in, i);
+ Py_DECREF(pyus_in);
+ if (pyus_out == NULL)
+ return NULL;
+ result = microseconds_to_delta(pyus_out);
+ Py_DECREF(pyus_out);
+
+ return result;
+}
+
+static PyObject *
+delta_add(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDelta_Check(left) && PyDelta_Check(right)) {
+ /* delta + delta */
+ /* The C-level additions can't overflow because of the
+ * invariant bounds.
+ */
+ int days = GET_TD_DAYS(left) + GET_TD_DAYS(right);
+ int seconds = GET_TD_SECONDS(left) + GET_TD_SECONDS(right);
+ int microseconds = GET_TD_MICROSECONDS(left) +
+ GET_TD_MICROSECONDS(right);
+ result = new_delta(days, seconds, microseconds, 1);
+ }
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+static PyObject *
+delta_negative(PyDateTime_Delta *self)
+{
+ return new_delta(-GET_TD_DAYS(self),
+ -GET_TD_SECONDS(self),
+ -GET_TD_MICROSECONDS(self),
+ 1);
+}
+
+static PyObject *
+delta_positive(PyDateTime_Delta *self)
+{
+ /* Could optimize this (by returning self) if this isn't a
+ * subclass -- but who uses unary + ? Approximately nobody.
+ */
+ return new_delta(GET_TD_DAYS(self),
+ GET_TD_SECONDS(self),
+ GET_TD_MICROSECONDS(self),
+ 0);
+}
+
+static PyObject *
+delta_abs(PyDateTime_Delta *self)
+{
+ PyObject *result;
+
+ assert(GET_TD_MICROSECONDS(self) >= 0);
+ assert(GET_TD_SECONDS(self) >= 0);
+
+ if (GET_TD_DAYS(self) < 0)
+ result = delta_negative(self);
+ else
+ result = delta_positive(self);
+
+ return result;
+}
+
+static PyObject *
+delta_subtract(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDelta_Check(left) && PyDelta_Check(right)) {
+ /* delta - delta */
+ /* The C-level additions can't overflow because of the
+ * invariant bounds.
+ */
+ int days = GET_TD_DAYS(left) - GET_TD_DAYS(right);
+ int seconds = GET_TD_SECONDS(left) - GET_TD_SECONDS(right);
+ int microseconds = GET_TD_MICROSECONDS(left) -
+ GET_TD_MICROSECONDS(right);
+ result = new_delta(days, seconds, microseconds, 1);
+ }
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+static int
+delta_cmp(PyObject *self, PyObject *other)
+{
+ int diff = GET_TD_DAYS(self) - GET_TD_DAYS(other);
+ if (diff == 0) {
+ diff = GET_TD_SECONDS(self) - GET_TD_SECONDS(other);
+ if (diff == 0)
+ diff = GET_TD_MICROSECONDS(self) -
+ GET_TD_MICROSECONDS(other);
+ }
+ return diff;
+}
+
+static PyObject *
+delta_richcompare(PyObject *self, PyObject *other, int op)
+{
+ if (PyDelta_Check(other)) {
+ int diff = delta_cmp(self, other);
+ return diff_to_bool(diff, op);
+ }
+ else {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+}
+
+static PyObject *delta_getstate(PyDateTime_Delta *self);
+
+static Py_hash_t
+delta_hash(PyDateTime_Delta *self)
+{
+ if (self->hashcode == -1) {
+ PyObject *temp = delta_getstate(self);
+ if (temp != NULL) {
+ self->hashcode = PyObject_Hash(temp);
+ Py_DECREF(temp);
+ }
+ }
+ return self->hashcode;
+}
+
+static PyObject *
+delta_multiply(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDelta_Check(left)) {
+ /* delta * ??? */
+ if (PyLong_Check(right))
+ result = multiply_int_timedelta(right,
+ (PyDateTime_Delta *) left);
+ else if (PyFloat_Check(right))
+ result = multiply_truedivide_timedelta_float(
+ (PyDateTime_Delta *) left, right, 0);
+ }
+ else if (PyLong_Check(left))
+ result = multiply_int_timedelta(left,
+ (PyDateTime_Delta *) right);
+ else if (PyFloat_Check(left))
+ result = multiply_truedivide_timedelta_float(
+ (PyDateTime_Delta *) right, left, 0);
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+static PyObject *
+delta_divide(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDelta_Check(left)) {
+ /* delta * ??? */
+ if (PyLong_Check(right))
+ result = divide_timedelta_int(
+ (PyDateTime_Delta *)left,
+ right);
+ else if (PyDelta_Check(right))
+ result = divide_timedelta_timedelta(
+ (PyDateTime_Delta *)left,
+ (PyDateTime_Delta *)right);
+ }
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+static PyObject *
+delta_truedivide(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDelta_Check(left)) {
+ if (PyDelta_Check(right))
+ result = truedivide_timedelta_timedelta(
+ (PyDateTime_Delta *)left,
+ (PyDateTime_Delta *)right);
+ else if (PyFloat_Check(right))
+ result = multiply_truedivide_timedelta_float(
+ (PyDateTime_Delta *)left, right, 1);
+ else if (PyLong_Check(right))
+ result = truedivide_timedelta_int(
+ (PyDateTime_Delta *)left, right);
+ }
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+static PyObject *
+delta_remainder(PyObject *left, PyObject *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *pyus_remainder;
+ PyObject *remainder;
+
+ if (!PyDelta_Check(left) || !PyDelta_Check(right))
+ Py_RETURN_NOTIMPLEMENTED;
+
+ pyus_left = delta_to_microseconds((PyDateTime_Delta *)left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds((PyDateTime_Delta *)right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ pyus_remainder = PyNumber_Remainder(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ if (pyus_remainder == NULL)
+ return NULL;
+
+ remainder = microseconds_to_delta(pyus_remainder);
+ Py_DECREF(pyus_remainder);
+ if (remainder == NULL)
+ return NULL;
+
+ return remainder;
+}
+
+static PyObject *
+delta_divmod(PyObject *left, PyObject *right)
+{
+ PyObject *pyus_left;
+ PyObject *pyus_right;
+ PyObject *divmod;
+ PyObject *delta;
+ PyObject *result;
+
+ if (!PyDelta_Check(left) || !PyDelta_Check(right))
+ Py_RETURN_NOTIMPLEMENTED;
+
+ pyus_left = delta_to_microseconds((PyDateTime_Delta *)left);
+ if (pyus_left == NULL)
+ return NULL;
+
+ pyus_right = delta_to_microseconds((PyDateTime_Delta *)right);
+ if (pyus_right == NULL) {
+ Py_DECREF(pyus_left);
+ return NULL;
+ }
+
+ divmod = checked_divmod(pyus_left, pyus_right);
+ Py_DECREF(pyus_left);
+ Py_DECREF(pyus_right);
+ if (divmod == NULL)
+ return NULL;
+
+ delta = microseconds_to_delta(PyTuple_GET_ITEM(divmod, 1));
+ if (delta == NULL) {
+ Py_DECREF(divmod);
+ return NULL;
+ }
+ result = PyTuple_Pack(2, PyTuple_GET_ITEM(divmod, 0), delta);
+ Py_DECREF(delta);
+ Py_DECREF(divmod);
+ return result;
+}
+
+/* Fold in the value of the tag ("seconds", "weeks", etc) component of a
+ * timedelta constructor. sofar is the # of microseconds accounted for
+ * so far, and there are factor microseconds per current unit, the number
+ * of which is given by num. num * factor is added to sofar in a
+ * numerically careful way, and that's the result. Any fractional
+ * microseconds left over (this can happen if num is a float type) are
+ * added into *leftover.
+ * Note that there are many ways this can give an error (NULL) return.
+ */
+static PyObject *
+accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
+ double *leftover)
+{
+ PyObject *prod;
+ PyObject *sum;
+
+ assert(num != NULL);
+
+ if (PyLong_Check(num)) {
+ prod = PyNumber_Multiply(num, factor);
+ if (prod == NULL)
+ return NULL;
+ sum = PyNumber_Add(sofar, prod);
+ Py_DECREF(prod);
+ return sum;
+ }
+
+ if (PyFloat_Check(num)) {
+ double dnum;
+ double fracpart;
+ double intpart;
+ PyObject *x;
+ PyObject *y;
+
+ /* The Plan: decompose num into an integer part and a
+ * fractional part, num = intpart + fracpart.
+ * Then num * factor ==
+ * intpart * factor + fracpart * factor
+ * and the LHS can be computed exactly in long arithmetic.
+ * The RHS is again broken into an int part and frac part.
+ * and the frac part is added into *leftover.
+ */
+ dnum = PyFloat_AsDouble(num);
+ if (dnum == -1.0 && PyErr_Occurred())
+ return NULL;
+ fracpart = modf(dnum, &intpart);
+ x = PyLong_FromDouble(intpart);
+ if (x == NULL)
+ return NULL;
+
+ prod = PyNumber_Multiply(x, factor);
+ Py_DECREF(x);
+ if (prod == NULL)
+ return NULL;
+
+ sum = PyNumber_Add(sofar, prod);
+ Py_DECREF(prod);
+ if (sum == NULL)
+ return NULL;
+
+ if (fracpart == 0.0)
+ return sum;
+ /* So far we've lost no information. Dealing with the
+ * fractional part requires float arithmetic, and may
+ * lose a little info.
+ */
+ assert(PyLong_CheckExact(factor));
+ dnum = PyLong_AsDouble(factor);
+
+ dnum *= fracpart;
+ fracpart = modf(dnum, &intpart);
+ x = PyLong_FromDouble(intpart);
+ if (x == NULL) {
+ Py_DECREF(sum);
+ return NULL;
+ }
+
+ y = PyNumber_Add(sum, x);
+ Py_DECREF(sum);
+ Py_DECREF(x);
+ *leftover += fracpart;
+ return y;
+ }
+
+ PyErr_Format(PyExc_TypeError,
+ "unsupported type for timedelta %s component: %s",
+ tag, Py_TYPE(num)->tp_name);
+ return NULL;
+}
+
+static PyObject *
+delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *self = NULL;
+
+ /* Argument objects. */
+ PyObject *day = NULL;
+ PyObject *second = NULL;
+ PyObject *us = NULL;
+ PyObject *ms = NULL;
+ PyObject *minute = NULL;
+ PyObject *hour = NULL;
+ PyObject *week = NULL;
+
+ PyObject *x = NULL; /* running sum of microseconds */
+ PyObject *y = NULL; /* temp sum of microseconds */
+ double leftover_us = 0.0;
+
+ static char *keywords[] = {
+ "days", "seconds", "microseconds", "milliseconds",
+ "minutes", "hours", "weeks", NULL
+ };
+
+ if (PyArg_ParseTupleAndKeywords(args, kw, "|OOOOOOO:__new__",
+ keywords,
+ &day, &second, &us,
+ &ms, &minute, &hour, &week) == 0)
+ goto Done;
+
+ x = PyLong_FromLong(0);
+ if (x == NULL)
+ goto Done;
+
+#define CLEANUP \
+ Py_DECREF(x); \
+ x = y; \
+ if (x == NULL) \
+ goto Done
+
+ if (us) {
+ y = accum("microseconds", x, us, _PyLong_GetOne(), &leftover_us);
+ CLEANUP;
+ }
+ if (ms) {
+ y = accum("milliseconds", x, ms, us_per_ms, &leftover_us);
+ CLEANUP;
+ }
+ if (second) {
+ y = accum("seconds", x, second, us_per_second, &leftover_us);
+ CLEANUP;
+ }
+ if (minute) {
+ y = accum("minutes", x, minute, us_per_minute, &leftover_us);
+ CLEANUP;
+ }
+ if (hour) {
+ y = accum("hours", x, hour, us_per_hour, &leftover_us);
+ CLEANUP;
+ }
+ if (day) {
+ y = accum("days", x, day, us_per_day, &leftover_us);
+ CLEANUP;
+ }
+ if (week) {
+ y = accum("weeks", x, week, us_per_week, &leftover_us);
+ CLEANUP;
+ }
+ if (leftover_us) {
+ /* Round to nearest whole # of us, and add into x. */
+ double whole_us = round(leftover_us);
+ int x_is_odd;
+ PyObject *temp;
+
+ if (fabs(whole_us - leftover_us) == 0.5) {
+ /* We're exactly halfway between two integers. In order
+ * to do round-half-to-even, we must determine whether x
+ * is odd. Note that x is odd when it's last bit is 1. The
+ * code below uses bitwise and operation to check the last
+ * bit. */
+ temp = PyNumber_And(x, _PyLong_GetOne()); /* temp <- x & 1 */
+ if (temp == NULL) {
+ Py_DECREF(x);
+ goto Done;
+ }
+ x_is_odd = PyObject_IsTrue(temp);
+ Py_DECREF(temp);
+ if (x_is_odd == -1) {
+ Py_DECREF(x);
+ goto Done;
+ }
+ whole_us = 2.0 * round((leftover_us + x_is_odd) * 0.5) - x_is_odd;
+ }
+
+ temp = PyLong_FromLong((long)whole_us);
+
+ if (temp == NULL) {
+ Py_DECREF(x);
+ goto Done;
+ }
+ y = PyNumber_Add(x, temp);
+ Py_DECREF(temp);
+ CLEANUP;
+ }
+
+ self = microseconds_to_delta_ex(x, type);
+ Py_DECREF(x);
+Done:
+ return self;
+
+#undef CLEANUP
+}
+
+static int
+delta_bool(PyDateTime_Delta *self)
+{
+ return (GET_TD_DAYS(self) != 0
+ || GET_TD_SECONDS(self) != 0
+ || GET_TD_MICROSECONDS(self) != 0);
+}
+
+static PyObject *
+delta_repr(PyDateTime_Delta *self)
+{
+ PyObject *args = PyUnicode_FromString("");
+
+ if (args == NULL) {
+ return NULL;
+ }
+
+ const char *sep = "";
+
+ if (GET_TD_DAYS(self) != 0) {
+ Py_SETREF(args, PyUnicode_FromFormat("days=%d", GET_TD_DAYS(self)));
+ if (args == NULL) {
+ return NULL;
+ }
+ sep = ", ";
+ }
+
+ if (GET_TD_SECONDS(self) != 0) {
+ Py_SETREF(args, PyUnicode_FromFormat("%U%sseconds=%d", args, sep,
+ GET_TD_SECONDS(self)));
+ if (args == NULL) {
+ return NULL;
+ }
+ sep = ", ";
+ }
+
+ if (GET_TD_MICROSECONDS(self) != 0) {
+ Py_SETREF(args, PyUnicode_FromFormat("%U%smicroseconds=%d", args, sep,
+ GET_TD_MICROSECONDS(self)));
+ if (args == NULL) {
+ return NULL;
+ }
+ }
+
+ if (PyUnicode_GET_LENGTH(args) == 0) {
+ Py_SETREF(args, PyUnicode_FromString("0"));
+ if (args == NULL) {
+ return NULL;
+ }
+ }
+
+ PyObject *repr = PyUnicode_FromFormat("%s(%S)", Py_TYPE(self)->tp_name,
+ args);
+ Py_DECREF(args);
+ return repr;
+}
+
+static PyObject *
+delta_str(PyDateTime_Delta *self)
+{
+ int us = GET_TD_MICROSECONDS(self);
+ int seconds = GET_TD_SECONDS(self);
+ int minutes = divmod(seconds, 60, &seconds);
+ int hours = divmod(minutes, 60, &minutes);
+ int days = GET_TD_DAYS(self);
+
+ if (days) {
+ if (us)
+ return PyUnicode_FromFormat("%d day%s, %d:%02d:%02d.%06d",
+ days, (days == 1 || days == -1) ? "" : "s",
+ hours, minutes, seconds, us);
+ else
+ return PyUnicode_FromFormat("%d day%s, %d:%02d:%02d",
+ days, (days == 1 || days == -1) ? "" : "s",
+ hours, minutes, seconds);
+ } else {
+ if (us)
+ return PyUnicode_FromFormat("%d:%02d:%02d.%06d",
+ hours, minutes, seconds, us);
+ else
+ return PyUnicode_FromFormat("%d:%02d:%02d",
+ hours, minutes, seconds);
+ }
+
+}
+
+/* Pickle support, a simple use of __reduce__. */
+
+/* __getstate__ isn't exposed */
+static PyObject *
+delta_getstate(PyDateTime_Delta *self)
+{
+ return Py_BuildValue("iii", GET_TD_DAYS(self),
+ GET_TD_SECONDS(self),
+ GET_TD_MICROSECONDS(self));
+}
+
+static PyObject *
+delta_total_seconds(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *total_seconds;
+ PyObject *total_microseconds;
+
+ total_microseconds = delta_to_microseconds((PyDateTime_Delta *)self);
+ if (total_microseconds == NULL)
+ return NULL;
+
+ total_seconds = PyNumber_TrueDivide(total_microseconds, us_per_second);
+
+ Py_DECREF(total_microseconds);
+ return total_seconds;
+}
+
+static PyObject *
+delta_reduce(PyDateTime_Delta* self, PyObject *Py_UNUSED(ignored))
+{
+ return Py_BuildValue("ON", Py_TYPE(self), delta_getstate(self));
+}
+
+#define OFFSET(field) offsetof(PyDateTime_Delta, field)
+
+static PyMemberDef delta_members[] = {
+
+ {"days", T_INT, OFFSET(days), READONLY,
+ PyDoc_STR("Number of days.")},
+
+ {"seconds", T_INT, OFFSET(seconds), READONLY,
+ PyDoc_STR("Number of seconds (>= 0 and less than 1 day).")},
+
+ {"microseconds", T_INT, OFFSET(microseconds), READONLY,
+ PyDoc_STR("Number of microseconds (>= 0 and less than 1 second).")},
+ {NULL}
+};
+
+static PyMethodDef delta_methods[] = {
+ {"total_seconds", delta_total_seconds, METH_NOARGS,
+ PyDoc_STR("Total seconds in the duration.")},
+
+ {"__reduce__", (PyCFunction)delta_reduce, METH_NOARGS,
+ PyDoc_STR("__reduce__() -> (cls, state)")},
+
+ {NULL, NULL},
+};
+
+static const char delta_doc[] =
+PyDoc_STR("Difference between two datetime values.\n\n"
+ "timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, "
+ "minutes=0, hours=0, weeks=0)\n\n"
+ "All arguments are optional and default to 0.\n"
+ "Arguments may be integers or floats, and may be positive or negative.");
+
+static PyNumberMethods delta_as_number = {
+ delta_add, /* nb_add */
+ delta_subtract, /* nb_subtract */
+ delta_multiply, /* nb_multiply */
+ delta_remainder, /* nb_remainder */
+ delta_divmod, /* nb_divmod */
+ 0, /* nb_power */
+ (unaryfunc)delta_negative, /* nb_negative */
+ (unaryfunc)delta_positive, /* nb_positive */
+ (unaryfunc)delta_abs, /* nb_absolute */
+ (inquiry)delta_bool, /* nb_bool */
+ 0, /*nb_invert*/
+ 0, /*nb_lshift*/
+ 0, /*nb_rshift*/
+ 0, /*nb_and*/
+ 0, /*nb_xor*/
+ 0, /*nb_or*/
+ 0, /*nb_int*/
+ 0, /*nb_reserved*/
+ 0, /*nb_float*/
+ 0, /*nb_inplace_add*/
+ 0, /*nb_inplace_subtract*/
+ 0, /*nb_inplace_multiply*/
+ 0, /*nb_inplace_remainder*/
+ 0, /*nb_inplace_power*/
+ 0, /*nb_inplace_lshift*/
+ 0, /*nb_inplace_rshift*/
+ 0, /*nb_inplace_and*/
+ 0, /*nb_inplace_xor*/
+ 0, /*nb_inplace_or*/
+ delta_divide, /* nb_floor_divide */
+ delta_truedivide, /* nb_true_divide */
+ 0, /* nb_inplace_floor_divide */
+ 0, /* nb_inplace_true_divide */
+};
+
+static PyTypeObject PyDateTime_DeltaType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.timedelta", /* tp_name */
+ sizeof(PyDateTime_Delta), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)delta_repr, /* tp_repr */
+ &delta_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)delta_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc)delta_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ delta_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ delta_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ delta_methods, /* tp_methods */
+ delta_members, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ delta_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/*
+ * PyDateTime_Date implementation.
+ */
+
+/* Accessor properties. */
+
+static PyObject *
+date_year(PyDateTime_Date *self, void *unused)
+{
+ return PyLong_FromLong(GET_YEAR(self));
+}
+
+static PyObject *
+date_month(PyDateTime_Date *self, void *unused)
+{
+ return PyLong_FromLong(GET_MONTH(self));
+}
+
+static PyObject *
+date_day(PyDateTime_Date *self, void *unused)
+{
+ return PyLong_FromLong(GET_DAY(self));
+}
+
+static PyGetSetDef date_getset[] = {
+ {"year", (getter)date_year},
+ {"month", (getter)date_month},
+ {"day", (getter)date_day},
+ {NULL}
+};
+
+/* Constructors. */
+
+static char *date_kws[] = {"year", "month", "day", NULL};
+
+static PyObject *
+date_from_pickle(PyTypeObject *type, PyObject *state)
+{
+ PyDateTime_Date *me;
+
+ me = (PyDateTime_Date *) (type->tp_alloc(type, 0));
+ if (me != NULL) {
+ const char *pdata = PyBytes_AS_STRING(state);
+ memcpy(me->data, pdata, _PyDateTime_DATE_DATASIZE);
+ me->hashcode = -1;
+ }
+ return (PyObject *)me;
+}
+
+static PyObject *
+date_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *self = NULL;
+ int year;
+ int month;
+ int day;
+
+ /* Check for invocation from pickle with __getstate__ state */
+ if (PyTuple_GET_SIZE(args) == 1) {
+ PyObject *state = PyTuple_GET_ITEM(args, 0);
+ if (PyBytes_Check(state)) {
+ if (PyBytes_GET_SIZE(state) == _PyDateTime_DATE_DATASIZE &&
+ MONTH_IS_SANE(PyBytes_AS_STRING(state)[2]))
+ {
+ return date_from_pickle(type, state);
+ }
+ }
+ else if (PyUnicode_Check(state)) {
+ if (PyUnicode_READY(state)) {
+ return NULL;
+ }
+ if (PyUnicode_GET_LENGTH(state) == _PyDateTime_DATE_DATASIZE &&
+ MONTH_IS_SANE(PyUnicode_READ_CHAR(state, 2)))
+ {
+ state = PyUnicode_AsLatin1String(state);
+ if (state == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ /* More informative error message. */
+ PyErr_SetString(PyExc_ValueError,
+ "Failed to encode latin1 string when unpickling "
+ "a date object. "
+ "pickle.load(data, encoding='latin1') is assumed.");
+ }
+ return NULL;
+ }
+ self = date_from_pickle(type, state);
+ Py_DECREF(state);
+ return self;
+ }
+ }
+ }
+
+ if (PyArg_ParseTupleAndKeywords(args, kw, "iii", date_kws,
+ &year, &month, &day)) {
+ self = new_date_ex(year, month, day, type);
+ }
+ return self;
+}
+
+static PyObject *
+date_fromtimestamp(PyObject *cls, PyObject *obj)
+{
+ struct tm tm;
+ time_t t;
+
+ if (_PyTime_ObjectToTime_t(obj, &t, _PyTime_ROUND_FLOOR) == -1)
+ return NULL;
+
+ if (_PyTime_localtime(t, &tm) != 0)
+ return NULL;
+
+ return new_date_subclass_ex(tm.tm_year + 1900,
+ tm.tm_mon + 1,
+ tm.tm_mday,
+ cls);
+}
+
+/* Return new date from current time.
+ * We say this is equivalent to fromtimestamp(time.time()), and the
+ * only way to be sure of that is to *call* time.time(). That's not
+ * generally the same as calling C's time.
+ */
+static PyObject *
+date_today(PyObject *cls, PyObject *dummy)
+{
+ PyObject *time;
+ PyObject *result;
+ time = time_time();
+ if (time == NULL)
+ return NULL;
+
+ /* Note well: today() is a class method, so this may not call
+ * date.fromtimestamp. For example, it may call
+ * datetime.fromtimestamp. That's why we need all the accuracy
+ * time.time() delivers; if someone were gonzo about optimization,
+ * date.today() could get away with plain C time().
+ */
+ result = PyObject_CallMethodOneArg(cls, &_Py_ID(fromtimestamp), time);
+ Py_DECREF(time);
+ return result;
+}
+
+/*[clinic input]
+@classmethod
+datetime.date.fromtimestamp
+
+ timestamp: object
+ /
+
+Create a date from a POSIX timestamp.
+
+The timestamp is a number, e.g. created via time.time(), that is interpreted
+as local time.
+[clinic start generated code]*/
+
+static PyObject *
+datetime_date_fromtimestamp(PyTypeObject *type, PyObject *timestamp)
+/*[clinic end generated code: output=fd045fda58168869 input=eabb3fe7f40491fe]*/
+{
+ return date_fromtimestamp((PyObject *) type, timestamp);
+}
+
+/* bpo-36025: This is a wrapper for API compatibility with the public C API,
+ * which expects a function that takes an *args tuple, whereas the argument
+ * clinic generates code that takes METH_O.
+ */
+static PyObject *
+datetime_date_fromtimestamp_capi(PyObject *cls, PyObject *args)
+{
+ PyObject *timestamp;
+ PyObject *result = NULL;
+
+ if (PyArg_UnpackTuple(args, "fromtimestamp", 1, 1, &timestamp)) {
+ result = date_fromtimestamp(cls, timestamp);
+ }
+
+ return result;
+}
+
+/* Return new date from proleptic Gregorian ordinal. Raises ValueError if
+ * the ordinal is out of range.
+ */
+static PyObject *
+date_fromordinal(PyObject *cls, PyObject *args)
+{
+ PyObject *result = NULL;
+ int ordinal;
+
+ if (PyArg_ParseTuple(args, "i:fromordinal", &ordinal)) {
+ int year;
+ int month;
+ int day;
+
+ if (ordinal < 1)
+ PyErr_SetString(PyExc_ValueError, "ordinal must be "
+ ">= 1");
+ else {
+ ord_to_ymd(ordinal, &year, &month, &day);
+ result = new_date_subclass_ex(year, month, day, cls);
+ }
+ }
+ return result;
+}
+
+/* Return the new date from a string as generated by date.isoformat() */
+static PyObject *
+date_fromisoformat(PyObject *cls, PyObject *dtstr)
+{
+ assert(dtstr != NULL);
+
+ if (!PyUnicode_Check(dtstr)) {
+ PyErr_SetString(PyExc_TypeError,
+ "fromisoformat: argument must be str");
+ return NULL;
+ }
+
+ Py_ssize_t len;
+
+ const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len);
+ if (dt_ptr == NULL) {
+ goto invalid_string_error;
+ }
+
+ int year = 0, month = 0, day = 0;
+
+ int rv;
+ if (len == 7 || len == 8 || len == 10) {
+ rv = parse_isoformat_date(dt_ptr, len, &year, &month, &day);
+ }
+ else {
+ rv = -1;
+ }
+
+ if (rv < 0) {
+ goto invalid_string_error;
+ }
+
+ return new_date_subclass_ex(year, month, day, cls);
+
+invalid_string_error:
+ PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dtstr);
+ return NULL;
+}
+
+
+static PyObject *
+date_fromisocalendar(PyObject *cls, PyObject *args, PyObject *kw)
+{
+ static char *keywords[] = {
+ "year", "week", "day", NULL
+ };
+
+ int year, week, day;
+ if (PyArg_ParseTupleAndKeywords(args, kw, "iii:fromisocalendar",
+ keywords,
+ &year, &week, &day) == 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Format(PyExc_ValueError,
+ "ISO calendar component out of range");
+
+ }
+ return NULL;
+ }
+
+ // Year is bounded to 0 < year < 10000 because 9999-12-31 is (9999, 52, 5)
+ if (year < MINYEAR || year > MAXYEAR) {
+ PyErr_Format(PyExc_ValueError, "Year is out of range: %d", year);
+ return NULL;
+ }
+
+ int month;
+ int rv = iso_to_ymd(year, week, day, &year, &month, &day);
+
+
+ if (rv == -2) {
+ PyErr_Format(PyExc_ValueError, "Invalid week: %d", week);
+ return NULL;
+ }
+
+ if (rv == -3) {
+ PyErr_Format(PyExc_ValueError, "Invalid day: %d (range is [1, 7])",
+ day);
+ return NULL;
+ }
+
+ return new_date_subclass_ex(year, month, day, cls);
+}
+
+
+/*
+ * Date arithmetic.
+ */
+
+/* date + timedelta -> date. If arg negate is true, subtract the timedelta
+ * instead.
+ */
+static PyObject *
+add_date_timedelta(PyDateTime_Date *date, PyDateTime_Delta *delta, int negate)
+{
+ PyObject *result = NULL;
+ int year = GET_YEAR(date);
+ int month = GET_MONTH(date);
+ int deltadays = GET_TD_DAYS(delta);
+ /* C-level overflow is impossible because |deltadays| < 1e9. */
+ int day = GET_DAY(date) + (negate ? -deltadays : deltadays);
+
+ if (normalize_date(&year, &month, &day) >= 0)
+ result = new_date_subclass_ex(year, month, day,
+ (PyObject* )Py_TYPE(date));
+ return result;
+}
+
+static PyObject *
+date_add(PyObject *left, PyObject *right)
+{
+ if (PyDateTime_Check(left) || PyDateTime_Check(right))
+ Py_RETURN_NOTIMPLEMENTED;
+
+ if (PyDate_Check(left)) {
+ /* date + ??? */
+ if (PyDelta_Check(right))
+ /* date + delta */
+ return add_date_timedelta((PyDateTime_Date *) left,
+ (PyDateTime_Delta *) right,
+ 0);
+ }
+ else {
+ /* ??? + date
+ * 'right' must be one of us, or we wouldn't have been called
+ */
+ if (PyDelta_Check(left))
+ /* delta + date */
+ return add_date_timedelta((PyDateTime_Date *) right,
+ (PyDateTime_Delta *) left,
+ 0);
+ }
+ Py_RETURN_NOTIMPLEMENTED;
+}
+
+static PyObject *
+date_subtract(PyObject *left, PyObject *right)
+{
+ if (PyDateTime_Check(left) || PyDateTime_Check(right))
+ Py_RETURN_NOTIMPLEMENTED;
+
+ if (PyDate_Check(left)) {
+ if (PyDate_Check(right)) {
+ /* date - date */
+ int left_ord = ymd_to_ord(GET_YEAR(left),
+ GET_MONTH(left),
+ GET_DAY(left));
+ int right_ord = ymd_to_ord(GET_YEAR(right),
+ GET_MONTH(right),
+ GET_DAY(right));
+ return new_delta(left_ord - right_ord, 0, 0, 0);
+ }
+ if (PyDelta_Check(right)) {
+ /* date - delta */
+ return add_date_timedelta((PyDateTime_Date *) left,
+ (PyDateTime_Delta *) right,
+ 1);
+ }
+ }
+ Py_RETURN_NOTIMPLEMENTED;
+}
+
+
+/* Various ways to turn a date into a string. */
+
+static PyObject *
+date_repr(PyDateTime_Date *self)
+{
+ return PyUnicode_FromFormat("%s(%d, %d, %d)",
+ Py_TYPE(self)->tp_name,
+ GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
+}
+
+static PyObject *
+date_isoformat(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ return PyUnicode_FromFormat("%04d-%02d-%02d",
+ GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
+}
+
+/* str() calls the appropriate isoformat() method. */
+static PyObject *
+date_str(PyDateTime_Date *self)
+{
+ return PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(isoformat));
+}
+
+
+static PyObject *
+date_ctime(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ return format_ctime(self, 0, 0, 0);
+}
+
+static PyObject *
+date_strftime(PyDateTime_Date *self, PyObject *args, PyObject *kw)
+{
+ /* This method can be inherited, and needs to call the
+ * timetuple() method appropriate to self's class.
+ */
+ PyObject *result;
+ PyObject *tuple;
+ PyObject *format;
+ static char *keywords[] = {"format", NULL};
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "U:strftime", keywords,
+ &format))
+ return NULL;
+
+ tuple = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(timetuple));
+ if (tuple == NULL)
+ return NULL;
+ result = wrap_strftime((PyObject *)self, format, tuple,
+ (PyObject *)self);
+ Py_DECREF(tuple);
+ return result;
+}
+
+static PyObject *
+date_format(PyDateTime_Date *self, PyObject *args)
+{
+ PyObject *format;
+
+ if (!PyArg_ParseTuple(args, "U:__format__", &format))
+ return NULL;
+
+ /* if the format is zero length, return str(self) */
+ if (PyUnicode_GetLength(format) == 0)
+ return PyObject_Str((PyObject *)self);
+
+ return PyObject_CallMethodOneArg((PyObject *)self, &_Py_ID(strftime),
+ format);
+}
+
+/* ISO methods. */
+
+static PyObject *
+date_isoweekday(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ int dow = weekday(GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
+
+ return PyLong_FromLong(dow + 1);
+}
+
+PyDoc_STRVAR(iso_calendar_date__doc__,
+"The result of date.isocalendar() or datetime.isocalendar()\n\n\
+This object may be accessed either as a tuple of\n\
+ ((year, week, weekday)\n\
+or via the object attributes as named in the above tuple.");
+
+typedef struct {
+ PyTupleObject tuple;
+} PyDateTime_IsoCalendarDate;
+
+static PyObject *
+iso_calendar_date_repr(PyDateTime_IsoCalendarDate *self)
+{
+ PyObject* year = PyTuple_GetItem((PyObject *)self, 0);
+ if (year == NULL) {
+ return NULL;
+ }
+ PyObject* week = PyTuple_GetItem((PyObject *)self, 1);
+ if (week == NULL) {
+ return NULL;
+ }
+ PyObject* weekday = PyTuple_GetItem((PyObject *)self, 2);
+ if (weekday == NULL) {
+ return NULL;
+ }
+
+ return PyUnicode_FromFormat("%.200s(year=%S, week=%S, weekday=%S)",
+ Py_TYPE(self)->tp_name, year, week, weekday);
+}
+
+static PyObject *
+iso_calendar_date_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ // Construct the tuple that this reduces to
+ PyObject * reduce_tuple = Py_BuildValue(
+ "O((OOO))", &PyTuple_Type,
+ PyTuple_GET_ITEM(self, 0),
+ PyTuple_GET_ITEM(self, 1),
+ PyTuple_GET_ITEM(self, 2)
+ );
+
+ return reduce_tuple;
+}
+
+static PyObject *
+iso_calendar_date_year(PyDateTime_IsoCalendarDate *self, void *unused)
+{
+ PyObject *year = PyTuple_GetItem((PyObject *)self, 0);
+ if (year == NULL) {
+ return NULL;
+ }
+ return Py_NewRef(year);
+}
+
+static PyObject *
+iso_calendar_date_week(PyDateTime_IsoCalendarDate *self, void *unused)
+{
+ PyObject *week = PyTuple_GetItem((PyObject *)self, 1);
+ if (week == NULL) {
+ return NULL;
+ }
+ return Py_NewRef(week);
+}
+
+static PyObject *
+iso_calendar_date_weekday(PyDateTime_IsoCalendarDate *self, void *unused)
+{
+ PyObject *weekday = PyTuple_GetItem((PyObject *)self, 2);
+ if (weekday == NULL) {
+ return NULL;
+ }
+ return Py_NewRef(weekday);
+}
+
+static PyGetSetDef iso_calendar_date_getset[] = {
+ {"year", (getter)iso_calendar_date_year},
+ {"week", (getter)iso_calendar_date_week},
+ {"weekday", (getter)iso_calendar_date_weekday},
+ {NULL}
+};
+
+static PyMethodDef iso_calendar_date_methods[] = {
+ {"__reduce__", (PyCFunction)iso_calendar_date_reduce, METH_NOARGS,
+ PyDoc_STR("__reduce__() -> (cls, state)")},
+ {NULL, NULL},
+};
+
+static PyTypeObject PyDateTime_IsoCalendarDateType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ .tp_name = "datetime.IsoCalendarDate",
+ .tp_basicsize = sizeof(PyDateTime_IsoCalendarDate),
+ .tp_repr = (reprfunc) iso_calendar_date_repr,
+ .tp_flags = Py_TPFLAGS_DEFAULT,
+ .tp_doc = iso_calendar_date__doc__,
+ .tp_methods = iso_calendar_date_methods,
+ .tp_getset = iso_calendar_date_getset,
+ // .tp_base = &PyTuple_Type, // filled in PyInit__datetime
+ .tp_new = iso_calendar_date_new,
+};
+
+/*[clinic input]
+@classmethod
+datetime.IsoCalendarDate.__new__ as iso_calendar_date_new
+ year: int
+ week: int
+ weekday: int
+[clinic start generated code]*/
+
+static PyObject *
+iso_calendar_date_new_impl(PyTypeObject *type, int year, int week,
+ int weekday)
+/*[clinic end generated code: output=383d33d8dc7183a2 input=4f2c663c9d19c4ee]*/
+
+{
+ PyDateTime_IsoCalendarDate *self;
+ self = (PyDateTime_IsoCalendarDate *) type->tp_alloc(type, 3);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ PyTuple_SET_ITEM(self, 0, PyLong_FromLong(year));
+ PyTuple_SET_ITEM(self, 1, PyLong_FromLong(week));
+ PyTuple_SET_ITEM(self, 2, PyLong_FromLong(weekday));
+
+ return (PyObject *)self;
+}
+
+static PyObject *
+date_isocalendar(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ int year = GET_YEAR(self);
+ int week1_monday = iso_week1_monday(year);
+ int today = ymd_to_ord(year, GET_MONTH(self), GET_DAY(self));
+ int week;
+ int day;
+
+ week = divmod(today - week1_monday, 7, &day);
+ if (week < 0) {
+ --year;
+ week1_monday = iso_week1_monday(year);
+ week = divmod(today - week1_monday, 7, &day);
+ }
+ else if (week >= 52 && today >= iso_week1_monday(year + 1)) {
+ ++year;
+ week = 0;
+ }
+
+ PyObject* v = iso_calendar_date_new_impl(&PyDateTime_IsoCalendarDateType,
+ year, week + 1, day + 1);
+ if (v == NULL) {
+ return NULL;
+ }
+ return v;
+}
+
+/* Miscellaneous methods. */
+
+static PyObject *
+date_richcompare(PyObject *self, PyObject *other, int op)
+{
+ if (PyDate_Check(other)) {
+ int diff = memcmp(((PyDateTime_Date *)self)->data,
+ ((PyDateTime_Date *)other)->data,
+ _PyDateTime_DATE_DATASIZE);
+ return diff_to_bool(diff, op);
+ }
+ else
+ Py_RETURN_NOTIMPLEMENTED;
+}
+
+static PyObject *
+date_timetuple(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ return build_struct_time(GET_YEAR(self),
+ GET_MONTH(self),
+ GET_DAY(self),
+ 0, 0, 0, -1);
+}
+
+static PyObject *
+date_replace(PyDateTime_Date *self, PyObject *args, PyObject *kw)
+{
+ PyObject *clone;
+ PyObject *tuple;
+ int year = GET_YEAR(self);
+ int month = GET_MONTH(self);
+ int day = GET_DAY(self);
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "|iii:replace", date_kws,
+ &year, &month, &day))
+ return NULL;
+ tuple = Py_BuildValue("iii", year, month, day);
+ if (tuple == NULL)
+ return NULL;
+ clone = date_new(Py_TYPE(self), tuple, NULL);
+ Py_DECREF(tuple);
+ return clone;
+}
+
+static Py_hash_t
+generic_hash(unsigned char *data, int len)
+{
+ return _Py_HashBytes(data, len);
+}
+
+
+static PyObject *date_getstate(PyDateTime_Date *self);
+
+static Py_hash_t
+date_hash(PyDateTime_Date *self)
+{
+ if (self->hashcode == -1) {
+ self->hashcode = generic_hash(
+ (unsigned char *)self->data, _PyDateTime_DATE_DATASIZE);
+ }
+
+ return self->hashcode;
+}
+
+static PyObject *
+date_toordinal(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ return PyLong_FromLong(ymd_to_ord(GET_YEAR(self), GET_MONTH(self),
+ GET_DAY(self)));
+}
+
+static PyObject *
+date_weekday(PyDateTime_Date *self, PyObject *Py_UNUSED(ignored))
+{
+ int dow = weekday(GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
+
+ return PyLong_FromLong(dow);
+}
+
+/* Pickle support, a simple use of __reduce__. */
+
+/* __getstate__ isn't exposed */
+static PyObject *
+date_getstate(PyDateTime_Date *self)
+{
+ PyObject* field;
+ field = PyBytes_FromStringAndSize((char*)self->data,
+ _PyDateTime_DATE_DATASIZE);
+ return Py_BuildValue("(N)", field);
+}
+
+static PyObject *
+date_reduce(PyDateTime_Date *self, PyObject *arg)
+{
+ return Py_BuildValue("(ON)", Py_TYPE(self), date_getstate(self));
+}
+
+static PyMethodDef date_methods[] = {
+
+ /* Class methods: */
+ DATETIME_DATE_FROMTIMESTAMP_METHODDEF
+
+ {"fromordinal", (PyCFunction)date_fromordinal, METH_VARARGS |
+ METH_CLASS,
+ PyDoc_STR("int -> date corresponding to a proleptic Gregorian "
+ "ordinal.")},
+
+ {"fromisoformat", (PyCFunction)date_fromisoformat, METH_O |
+ METH_CLASS,
+ PyDoc_STR("str -> Construct a date from a string in ISO 8601 format.")},
+
+ {"fromisocalendar", _PyCFunction_CAST(date_fromisocalendar),
+ METH_VARARGS | METH_KEYWORDS | METH_CLASS,
+ PyDoc_STR("int, int, int -> Construct a date from the ISO year, week "
+ "number and weekday.\n\n"
+ "This is the inverse of the date.isocalendar() function")},
+
+ {"today", (PyCFunction)date_today, METH_NOARGS | METH_CLASS,
+ PyDoc_STR("Current date or datetime: same as "
+ "self.__class__.fromtimestamp(time.time()).")},
+
+ /* Instance methods: */
+
+ {"ctime", (PyCFunction)date_ctime, METH_NOARGS,
+ PyDoc_STR("Return ctime() style string.")},
+
+ {"strftime", _PyCFunction_CAST(date_strftime), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("format -> strftime() style string.")},
+
+ {"__format__", (PyCFunction)date_format, METH_VARARGS,
+ PyDoc_STR("Formats self with strftime.")},
+
+ {"timetuple", (PyCFunction)date_timetuple, METH_NOARGS,
+ PyDoc_STR("Return time tuple, compatible with time.localtime().")},
+
+ {"isocalendar", (PyCFunction)date_isocalendar, METH_NOARGS,
+ PyDoc_STR("Return a named tuple containing ISO year, week number, and "
+ "weekday.")},
+
+ {"isoformat", (PyCFunction)date_isoformat, METH_NOARGS,
+ PyDoc_STR("Return string in ISO 8601 format, YYYY-MM-DD.")},
+
+ {"isoweekday", (PyCFunction)date_isoweekday, METH_NOARGS,
+ PyDoc_STR("Return the day of the week represented by the date.\n"
+ "Monday == 1 ... Sunday == 7")},
+
+ {"toordinal", (PyCFunction)date_toordinal, METH_NOARGS,
+ PyDoc_STR("Return proleptic Gregorian ordinal. January 1 of year "
+ "1 is day 1.")},
+
+ {"weekday", (PyCFunction)date_weekday, METH_NOARGS,
+ PyDoc_STR("Return the day of the week represented by the date.\n"
+ "Monday == 0 ... Sunday == 6")},
+
+ {"replace", _PyCFunction_CAST(date_replace), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("Return date with new specified fields.")},
+
+ {"__reduce__", (PyCFunction)date_reduce, METH_NOARGS,
+ PyDoc_STR("__reduce__() -> (cls, state)")},
+
+ {NULL, NULL}
+};
+
+static const char date_doc[] =
+PyDoc_STR("date(year, month, day) --> date object");
+
+static PyNumberMethods date_as_number = {
+ date_add, /* nb_add */
+ date_subtract, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ 0, /* nb_bool */
+};
+
+static PyTypeObject PyDateTime_DateType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.date", /* tp_name */
+ sizeof(PyDateTime_Date), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)date_repr, /* tp_repr */
+ &date_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)date_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc)date_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ date_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ date_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ date_methods, /* tp_methods */
+ 0, /* tp_members */
+ date_getset, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ date_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/*
+ * PyDateTime_TZInfo implementation.
+ */
+
+/* This is a pure abstract base class, so doesn't do anything beyond
+ * raising NotImplemented exceptions. Real tzinfo classes need
+ * to derive from this. This is mostly for clarity, and for efficiency in
+ * datetime and time constructors (their tzinfo arguments need to
+ * be subclasses of this tzinfo class, which is easy and quick to check).
+ *
+ * Note: For reasons having to do with pickling of subclasses, we have
+ * to allow tzinfo objects to be instantiated. This wasn't an issue
+ * in the Python implementation (__init__() could raise NotImplementedError
+ * there without ill effect), but doing so in the C implementation hit a
+ * brick wall.
+ */
+
+static PyObject *
+tzinfo_nogo(const char* methodname)
+{
+ PyErr_Format(PyExc_NotImplementedError,
+ "a tzinfo subclass must implement %s()",
+ methodname);
+ return NULL;
+}
+
+/* Methods. A subclass must implement these. */
+
+static PyObject *
+tzinfo_tzname(PyDateTime_TZInfo *self, PyObject *dt)
+{
+ return tzinfo_nogo("tzname");
+}
+
+static PyObject *
+tzinfo_utcoffset(PyDateTime_TZInfo *self, PyObject *dt)
+{
+ return tzinfo_nogo("utcoffset");
+}
+
+static PyObject *
+tzinfo_dst(PyDateTime_TZInfo *self, PyObject *dt)
+{
+ return tzinfo_nogo("dst");
+}
+
+
+static PyObject *add_datetime_timedelta(PyDateTime_DateTime *date,
+ PyDateTime_Delta *delta,
+ int factor);
+static PyObject *datetime_utcoffset(PyObject *self, PyObject *);
+static PyObject *datetime_dst(PyObject *self, PyObject *);
+
+static PyObject *
+tzinfo_fromutc(PyDateTime_TZInfo *self, PyObject *dt)
+{
+ PyObject *result = NULL;
+ PyObject *off = NULL, *dst = NULL;
+ PyDateTime_Delta *delta = NULL;
+
+ if (!PyDateTime_Check(dt)) {
+ PyErr_SetString(PyExc_TypeError,
+ "fromutc: argument must be a datetime");
+ return NULL;
+ }
+ if (GET_DT_TZINFO(dt) != (PyObject *)self) {
+ PyErr_SetString(PyExc_ValueError, "fromutc: dt.tzinfo "
+ "is not self");
+ return NULL;
+ }
+
+ off = datetime_utcoffset(dt, NULL);
+ if (off == NULL)
+ return NULL;
+ if (off == Py_None) {
+ PyErr_SetString(PyExc_ValueError, "fromutc: non-None "
+ "utcoffset() result required");
+ goto Fail;
+ }
+
+ dst = datetime_dst(dt, NULL);
+ if (dst == NULL)
+ goto Fail;
+ if (dst == Py_None) {
+ PyErr_SetString(PyExc_ValueError, "fromutc: non-None "
+ "dst() result required");
+ goto Fail;
+ }
+
+ delta = (PyDateTime_Delta *)delta_subtract(off, dst);
+ if (delta == NULL)
+ goto Fail;
+ result = add_datetime_timedelta((PyDateTime_DateTime *)dt, delta, 1);
+ if (result == NULL)
+ goto Fail;
+
+ Py_DECREF(dst);
+ dst = call_dst(GET_DT_TZINFO(dt), result);
+ if (dst == NULL)
+ goto Fail;
+ if (dst == Py_None)
+ goto Inconsistent;
+ if (delta_bool((PyDateTime_Delta *)dst) != 0) {
+ Py_SETREF(result, add_datetime_timedelta((PyDateTime_DateTime *)result,
+ (PyDateTime_Delta *)dst, 1));
+ if (result == NULL)
+ goto Fail;
+ }
+ Py_DECREF(delta);
+ Py_DECREF(dst);
+ Py_DECREF(off);
+ return result;
+
+Inconsistent:
+ PyErr_SetString(PyExc_ValueError, "fromutc: tz.dst() gave "
+ "inconsistent results; cannot convert");
+
+ /* fall through to failure */
+Fail:
+ Py_XDECREF(off);
+ Py_XDECREF(dst);
+ Py_XDECREF(delta);
+ Py_XDECREF(result);
+ return NULL;
+}
+
+/*
+ * Pickle support. This is solely so that tzinfo subclasses can use
+ * pickling -- tzinfo itself is supposed to be uninstantiable.
+ */
+
+static PyObject *
+tzinfo_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *args, *state;
+ PyObject *getinitargs;
+
+ if (_PyObject_LookupAttr(self, &_Py_ID(__getinitargs__), &getinitargs) < 0) {
+ return NULL;
+ }
+ if (getinitargs != NULL) {
+ args = PyObject_CallNoArgs(getinitargs);
+ Py_DECREF(getinitargs);
+ }
+ else {
+ args = PyTuple_New(0);
+ }
+ if (args == NULL) {
+ return NULL;
+ }
+
+ state = _PyObject_GetState(self);
+ if (state == NULL) {
+ Py_DECREF(args);
+ return NULL;
+ }
+
+ return Py_BuildValue("(ONN)", Py_TYPE(self), args, state);
+}
+
+static PyMethodDef tzinfo_methods[] = {
+
+ {"tzname", (PyCFunction)tzinfo_tzname, METH_O,
+ PyDoc_STR("datetime -> string name of time zone.")},
+
+ {"utcoffset", (PyCFunction)tzinfo_utcoffset, METH_O,
+ PyDoc_STR("datetime -> timedelta showing offset from UTC, negative "
+ "values indicating West of UTC")},
+
+ {"dst", (PyCFunction)tzinfo_dst, METH_O,
+ PyDoc_STR("datetime -> DST offset as timedelta positive east of UTC.")},
+
+ {"fromutc", (PyCFunction)tzinfo_fromutc, METH_O,
+ PyDoc_STR("datetime in UTC -> datetime in local time.")},
+
+ {"__reduce__", tzinfo_reduce, METH_NOARGS,
+ PyDoc_STR("-> (cls, state)")},
+
+ {NULL, NULL}
+};
+
+static const char tzinfo_doc[] =
+PyDoc_STR("Abstract base class for time zone info objects.");
+
+static PyTypeObject PyDateTime_TZInfoType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.tzinfo", /* tp_name */
+ sizeof(PyDateTime_TZInfo), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ tzinfo_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ tzinfo_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ PyType_GenericNew, /* tp_new */
+ 0, /* tp_free */
+};
+
+static char *timezone_kws[] = {"offset", "name", NULL};
+
+static PyObject *
+timezone_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *offset;
+ PyObject *name = NULL;
+ if (PyArg_ParseTupleAndKeywords(args, kw, "O!|U:timezone", timezone_kws,
+ &PyDateTime_DeltaType, &offset, &name))
+ return new_timezone(offset, name);
+
+ return NULL;
+}
+
+static void
+timezone_dealloc(PyDateTime_TimeZone *self)
+{
+ Py_CLEAR(self->offset);
+ Py_CLEAR(self->name);
+ Py_TYPE(self)->tp_free((PyObject *)self);
+}
+
+static PyObject *
+timezone_richcompare(PyDateTime_TimeZone *self,
+ PyDateTime_TimeZone *other, int op)
+{
+ if (op != Py_EQ && op != Py_NE)
+ Py_RETURN_NOTIMPLEMENTED;
+ if (!PyTimezone_Check(other)) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ return delta_richcompare(self->offset, other->offset, op);
+}
+
+static Py_hash_t
+timezone_hash(PyDateTime_TimeZone *self)
+{
+ return delta_hash((PyDateTime_Delta *)self->offset);
+}
+
+/* Check argument type passed to tzname, utcoffset, or dst methods.
+ Returns 0 for good argument. Returns -1 and sets exception info
+ otherwise.
+ */
+static int
+_timezone_check_argument(PyObject *dt, const char *meth)
+{
+ if (dt == Py_None || PyDateTime_Check(dt))
+ return 0;
+ PyErr_Format(PyExc_TypeError, "%s(dt) argument must be a datetime instance"
+ " or None, not %.200s", meth, Py_TYPE(dt)->tp_name);
+ return -1;
+}
+
+static PyObject *
+timezone_repr(PyDateTime_TimeZone *self)
+{
+ /* Note that although timezone is not subclassable, it is convenient
+ to use Py_TYPE(self)->tp_name here. */
+ const char *type_name = Py_TYPE(self)->tp_name;
+
+ if (((PyObject *)self) == PyDateTime_TimeZone_UTC)
+ return PyUnicode_FromFormat("%s.utc", type_name);
+
+ if (self->name == NULL)
+ return PyUnicode_FromFormat("%s(%R)", type_name, self->offset);
+
+ return PyUnicode_FromFormat("%s(%R, %R)", type_name, self->offset,
+ self->name);
+}
+
+
+static PyObject *
+timezone_str(PyDateTime_TimeZone *self)
+{
+ int hours, minutes, seconds, microseconds;
+ PyObject *offset;
+ char sign;
+
+ if (self->name != NULL) {
+ return Py_NewRef(self->name);
+ }
+ if ((PyObject *)self == PyDateTime_TimeZone_UTC ||
+ (GET_TD_DAYS(self->offset) == 0 &&
+ GET_TD_SECONDS(self->offset) == 0 &&
+ GET_TD_MICROSECONDS(self->offset) == 0))
+ return PyUnicode_FromString("UTC");
+ /* Offset is normalized, so it is negative if days < 0 */
+ if (GET_TD_DAYS(self->offset) < 0) {
+ sign = '-';
+ offset = delta_negative((PyDateTime_Delta *)self->offset);
+ if (offset == NULL)
+ return NULL;
+ }
+ else {
+ sign = '+';
+ offset = Py_NewRef(self->offset);
+ }
+ /* Offset is not negative here. */
+ microseconds = GET_TD_MICROSECONDS(offset);
+ seconds = GET_TD_SECONDS(offset);
+ Py_DECREF(offset);
+ minutes = divmod(seconds, 60, &seconds);
+ hours = divmod(minutes, 60, &minutes);
+ if (microseconds != 0) {
+ return PyUnicode_FromFormat("UTC%c%02d:%02d:%02d.%06d",
+ sign, hours, minutes,
+ seconds, microseconds);
+ }
+ if (seconds != 0) {
+ return PyUnicode_FromFormat("UTC%c%02d:%02d:%02d",
+ sign, hours, minutes, seconds);
+ }
+ return PyUnicode_FromFormat("UTC%c%02d:%02d", sign, hours, minutes);
+}
+
+static PyObject *
+timezone_tzname(PyDateTime_TimeZone *self, PyObject *dt)
+{
+ if (_timezone_check_argument(dt, "tzname") == -1)
+ return NULL;
+
+ return timezone_str(self);
+}
+
+static PyObject *
+timezone_utcoffset(PyDateTime_TimeZone *self, PyObject *dt)
+{
+ if (_timezone_check_argument(dt, "utcoffset") == -1)
+ return NULL;
+
+ return Py_NewRef(self->offset);
+}
+
+static PyObject *
+timezone_dst(PyObject *self, PyObject *dt)
+{
+ if (_timezone_check_argument(dt, "dst") == -1)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+timezone_fromutc(PyDateTime_TimeZone *self, PyDateTime_DateTime *dt)
+{
+ if (!PyDateTime_Check(dt)) {
+ PyErr_SetString(PyExc_TypeError,
+ "fromutc: argument must be a datetime");
+ return NULL;
+ }
+ if (!HASTZINFO(dt) || dt->tzinfo != (PyObject *)self) {
+ PyErr_SetString(PyExc_ValueError, "fromutc: dt.tzinfo "
+ "is not self");
+ return NULL;
+ }
+
+ return add_datetime_timedelta(dt, (PyDateTime_Delta *)self->offset, 1);
+}
+
+static PyObject *
+timezone_getinitargs(PyDateTime_TimeZone *self, PyObject *Py_UNUSED(ignored))
+{
+ if (self->name == NULL)
+ return Py_BuildValue("(O)", self->offset);
+ return Py_BuildValue("(OO)", self->offset, self->name);
+}
+
+static PyMethodDef timezone_methods[] = {
+ {"tzname", (PyCFunction)timezone_tzname, METH_O,
+ PyDoc_STR("If name is specified when timezone is created, returns the name."
+ " Otherwise returns offset as 'UTC(+|-)HH:MM'.")},
+
+ {"utcoffset", (PyCFunction)timezone_utcoffset, METH_O,
+ PyDoc_STR("Return fixed offset.")},
+
+ {"dst", (PyCFunction)timezone_dst, METH_O,
+ PyDoc_STR("Return None.")},
+
+ {"fromutc", (PyCFunction)timezone_fromutc, METH_O,
+ PyDoc_STR("datetime in UTC -> datetime in local time.")},
+
+ {"__getinitargs__", (PyCFunction)timezone_getinitargs, METH_NOARGS,
+ PyDoc_STR("pickle support")},
+
+ {NULL, NULL}
+};
+
+static const char timezone_doc[] =
+PyDoc_STR("Fixed offset from UTC implementation of tzinfo.");
+
+static PyTypeObject PyDateTime_TimeZoneType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.timezone", /* tp_name */
+ sizeof(PyDateTime_TimeZone), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)timezone_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)timezone_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)timezone_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc)timezone_str, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ timezone_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ (richcmpfunc)timezone_richcompare,/* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ timezone_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base; filled in PyInit__datetime */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ timezone_new, /* tp_new */
+};
+
+/*
+ * PyDateTime_Time implementation.
+ */
+
+/* Accessor properties.
+ */
+
+static PyObject *
+time_hour(PyDateTime_Time *self, void *unused)
+{
+ return PyLong_FromLong(TIME_GET_HOUR(self));
+}
+
+static PyObject *
+time_minute(PyDateTime_Time *self, void *unused)
+{
+ return PyLong_FromLong(TIME_GET_MINUTE(self));
+}
+
+/* The name time_second conflicted with some platform header file. */
+static PyObject *
+py_time_second(PyDateTime_Time *self, void *unused)
+{
+ return PyLong_FromLong(TIME_GET_SECOND(self));
+}
+
+static PyObject *
+time_microsecond(PyDateTime_Time *self, void *unused)
+{
+ return PyLong_FromLong(TIME_GET_MICROSECOND(self));
+}
+
+static PyObject *
+time_tzinfo(PyDateTime_Time *self, void *unused)
+{
+ PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None;
+ return Py_NewRef(result);
+}
+
+static PyObject *
+time_fold(PyDateTime_Time *self, void *unused)
+{
+ return PyLong_FromLong(TIME_GET_FOLD(self));
+}
+
+static PyGetSetDef time_getset[] = {
+ {"hour", (getter)time_hour},
+ {"minute", (getter)time_minute},
+ {"second", (getter)py_time_second},
+ {"microsecond", (getter)time_microsecond},
+ {"tzinfo", (getter)time_tzinfo},
+ {"fold", (getter)time_fold},
+ {NULL}
+};
+
+/*
+ * Constructors.
+ */
+
+static char *time_kws[] = {"hour", "minute", "second", "microsecond",
+ "tzinfo", "fold", NULL};
+
+static PyObject *
+time_from_pickle(PyTypeObject *type, PyObject *state, PyObject *tzinfo)
+{
+ PyDateTime_Time *me;
+ char aware = (char)(tzinfo != Py_None);
+
+ if (aware && check_tzinfo_subclass(tzinfo) < 0) {
+ PyErr_SetString(PyExc_TypeError, "bad tzinfo state arg");
+ return NULL;
+ }
+
+ me = (PyDateTime_Time *) (type->tp_alloc(type, aware));
+ if (me != NULL) {
+ const char *pdata = PyBytes_AS_STRING(state);
+
+ memcpy(me->data, pdata, _PyDateTime_TIME_DATASIZE);
+ me->hashcode = -1;
+ me->hastzinfo = aware;
+ if (aware) {
+ me->tzinfo = Py_NewRef(tzinfo);
+ }
+ if (pdata[0] & (1 << 7)) {
+ me->data[0] -= 128;
+ me->fold = 1;
+ }
+ else {
+ me->fold = 0;
+ }
+ }
+ return (PyObject *)me;
+}
+
+static PyObject *
+time_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *self = NULL;
+ int hour = 0;
+ int minute = 0;
+ int second = 0;
+ int usecond = 0;
+ PyObject *tzinfo = Py_None;
+ int fold = 0;
+
+ /* Check for invocation from pickle with __getstate__ state */
+ if (PyTuple_GET_SIZE(args) >= 1 && PyTuple_GET_SIZE(args) <= 2) {
+ PyObject *state = PyTuple_GET_ITEM(args, 0);
+ if (PyTuple_GET_SIZE(args) == 2) {
+ tzinfo = PyTuple_GET_ITEM(args, 1);
+ }
+ if (PyBytes_Check(state)) {
+ if (PyBytes_GET_SIZE(state) == _PyDateTime_TIME_DATASIZE &&
+ (0x7F & ((unsigned char) (PyBytes_AS_STRING(state)[0]))) < 24)
+ {
+ return time_from_pickle(type, state, tzinfo);
+ }
+ }
+ else if (PyUnicode_Check(state)) {
+ if (PyUnicode_READY(state)) {
+ return NULL;
+ }
+ if (PyUnicode_GET_LENGTH(state) == _PyDateTime_TIME_DATASIZE &&
+ (0x7F & PyUnicode_READ_CHAR(state, 0)) < 24)
+ {
+ state = PyUnicode_AsLatin1String(state);
+ if (state == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ /* More informative error message. */
+ PyErr_SetString(PyExc_ValueError,
+ "Failed to encode latin1 string when unpickling "
+ "a time object. "
+ "pickle.load(data, encoding='latin1') is assumed.");
+ }
+ return NULL;
+ }
+ self = time_from_pickle(type, state, tzinfo);
+ Py_DECREF(state);
+ return self;
+ }
+ }
+ tzinfo = Py_None;
+ }
+
+ if (PyArg_ParseTupleAndKeywords(args, kw, "|iiiiO$i", time_kws,
+ &hour, &minute, &second, &usecond,
+ &tzinfo, &fold)) {
+ self = new_time_ex2(hour, minute, second, usecond, tzinfo, fold,
+ type);
+ }
+ return self;
+}
+
+/*
+ * Destructor.
+ */
+
+static void
+time_dealloc(PyDateTime_Time *self)
+{
+ if (HASTZINFO(self)) {
+ Py_XDECREF(self->tzinfo);
+ }
+ Py_TYPE(self)->tp_free((PyObject *)self);
+}
+
+/*
+ * Indirect access to tzinfo methods.
+ */
+
+/* These are all METH_NOARGS, so don't need to check the arglist. */
+static PyObject *
+time_utcoffset(PyObject *self, PyObject *unused) {
+ return call_utcoffset(GET_TIME_TZINFO(self), Py_None);
+}
+
+static PyObject *
+time_dst(PyObject *self, PyObject *unused) {
+ return call_dst(GET_TIME_TZINFO(self), Py_None);
+}
+
+static PyObject *
+time_tzname(PyDateTime_Time *self, PyObject *unused) {
+ return call_tzname(GET_TIME_TZINFO(self), Py_None);
+}
+
+/*
+ * Various ways to turn a time into a string.
+ */
+
+static PyObject *
+time_repr(PyDateTime_Time *self)
+{
+ const char *type_name = Py_TYPE(self)->tp_name;
+ int h = TIME_GET_HOUR(self);
+ int m = TIME_GET_MINUTE(self);
+ int s = TIME_GET_SECOND(self);
+ int us = TIME_GET_MICROSECOND(self);
+ int fold = TIME_GET_FOLD(self);
+ PyObject *result = NULL;
+
+ if (us)
+ result = PyUnicode_FromFormat("%s(%d, %d, %d, %d)",
+ type_name, h, m, s, us);
+ else if (s)
+ result = PyUnicode_FromFormat("%s(%d, %d, %d)",
+ type_name, h, m, s);
+ else
+ result = PyUnicode_FromFormat("%s(%d, %d)", type_name, h, m);
+ if (result != NULL && HASTZINFO(self))
+ result = append_keyword_tzinfo(result, self->tzinfo);
+ if (result != NULL && fold)
+ result = append_keyword_fold(result, fold);
+ return result;
+}
+
+static PyObject *
+time_str(PyDateTime_Time *self)
+{
+ return PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(isoformat));
+}
+
+static PyObject *
+time_isoformat(PyDateTime_Time *self, PyObject *args, PyObject *kw)
+{
+ char buf[100];
+ const char *timespec = NULL;
+ static char *keywords[] = {"timespec", NULL};
+ PyObject *result;
+ int us = TIME_GET_MICROSECOND(self);
+ static const char *specs[][2] = {
+ {"hours", "%02d"},
+ {"minutes", "%02d:%02d"},
+ {"seconds", "%02d:%02d:%02d"},
+ {"milliseconds", "%02d:%02d:%02d.%03d"},
+ {"microseconds", "%02d:%02d:%02d.%06d"},
+ };
+ size_t given_spec;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "|s:isoformat", keywords, &timespec))
+ return NULL;
+
+ if (timespec == NULL || strcmp(timespec, "auto") == 0) {
+ if (us == 0) {
+ /* seconds */
+ given_spec = 2;
+ }
+ else {
+ /* microseconds */
+ given_spec = 4;
+ }
+ }
+ else {
+ for (given_spec = 0; given_spec < Py_ARRAY_LENGTH(specs); given_spec++) {
+ if (strcmp(timespec, specs[given_spec][0]) == 0) {
+ if (given_spec == 3) {
+ /* milliseconds */
+ us = us / 1000;
+ }
+ break;
+ }
+ }
+ }
+
+ if (given_spec == Py_ARRAY_LENGTH(specs)) {
+ PyErr_Format(PyExc_ValueError, "Unknown timespec value");
+ return NULL;
+ }
+ else {
+ result = PyUnicode_FromFormat(specs[given_spec][1],
+ TIME_GET_HOUR(self), TIME_GET_MINUTE(self),
+ TIME_GET_SECOND(self), us);
+ }
+
+ if (result == NULL || !HASTZINFO(self) || self->tzinfo == Py_None)
+ return result;
+
+ /* We need to append the UTC offset. */
+ if (format_utcoffset(buf, sizeof(buf), ":", self->tzinfo,
+ Py_None) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyUnicode_AppendAndDel(&result, PyUnicode_FromString(buf));
+ return result;
+}
+
+static PyObject *
+time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw)
+{
+ PyObject *result;
+ PyObject *tuple;
+ PyObject *format;
+ static char *keywords[] = {"format", NULL};
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "U:strftime", keywords,
+ &format))
+ return NULL;
+
+ /* Python's strftime does insane things with the year part of the
+ * timetuple. The year is forced to (the otherwise nonsensical)
+ * 1900 to work around that.
+ */
+ tuple = Py_BuildValue("iiiiiiiii",
+ 1900, 1, 1, /* year, month, day */
+ TIME_GET_HOUR(self),
+ TIME_GET_MINUTE(self),
+ TIME_GET_SECOND(self),
+ 0, 1, -1); /* weekday, daynum, dst */
+ if (tuple == NULL)
+ return NULL;
+ assert(PyTuple_Size(tuple) == 9);
+ result = wrap_strftime((PyObject *)self, format, tuple,
+ Py_None);
+ Py_DECREF(tuple);
+ return result;
+}
+
+/*
+ * Miscellaneous methods.
+ */
+
+static PyObject *
+time_richcompare(PyObject *self, PyObject *other, int op)
+{
+ PyObject *result = NULL;
+ PyObject *offset1, *offset2;
+ int diff;
+
+ if (! PyTime_Check(other))
+ Py_RETURN_NOTIMPLEMENTED;
+
+ if (GET_TIME_TZINFO(self) == GET_TIME_TZINFO(other)) {
+ diff = memcmp(((PyDateTime_Time *)self)->data,
+ ((PyDateTime_Time *)other)->data,
+ _PyDateTime_TIME_DATASIZE);
+ return diff_to_bool(diff, op);
+ }
+ offset1 = time_utcoffset(self, NULL);
+ if (offset1 == NULL)
+ return NULL;
+ offset2 = time_utcoffset(other, NULL);
+ if (offset2 == NULL)
+ goto done;
+ /* If they're both naive, or both aware and have the same offsets,
+ * we get off cheap. Note that if they're both naive, offset1 ==
+ * offset2 == Py_None at this point.
+ */
+ if ((offset1 == offset2) ||
+ (PyDelta_Check(offset1) && PyDelta_Check(offset2) &&
+ delta_cmp(offset1, offset2) == 0)) {
+ diff = memcmp(((PyDateTime_Time *)self)->data,
+ ((PyDateTime_Time *)other)->data,
+ _PyDateTime_TIME_DATASIZE);
+ result = diff_to_bool(diff, op);
+ }
+ /* The hard case: both aware with different UTC offsets */
+ else if (offset1 != Py_None && offset2 != Py_None) {
+ int offsecs1, offsecs2;
+ assert(offset1 != offset2); /* else last "if" handled it */
+ offsecs1 = TIME_GET_HOUR(self) * 3600 +
+ TIME_GET_MINUTE(self) * 60 +
+ TIME_GET_SECOND(self) -
+ GET_TD_DAYS(offset1) * 86400 -
+ GET_TD_SECONDS(offset1);
+ offsecs2 = TIME_GET_HOUR(other) * 3600 +
+ TIME_GET_MINUTE(other) * 60 +
+ TIME_GET_SECOND(other) -
+ GET_TD_DAYS(offset2) * 86400 -
+ GET_TD_SECONDS(offset2);
+ diff = offsecs1 - offsecs2;
+ if (diff == 0)
+ diff = TIME_GET_MICROSECOND(self) -
+ TIME_GET_MICROSECOND(other);
+ result = diff_to_bool(diff, op);
+ }
+ else if (op == Py_EQ) {
+ result = Py_NewRef(Py_False);
+ }
+ else if (op == Py_NE) {
+ result = Py_NewRef(Py_True);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "can't compare offset-naive and "
+ "offset-aware times");
+ }
+ done:
+ Py_DECREF(offset1);
+ Py_XDECREF(offset2);
+ return result;
+}
+
+static Py_hash_t
+time_hash(PyDateTime_Time *self)
+{
+ if (self->hashcode == -1) {
+ PyObject *offset, *self0;
+ if (TIME_GET_FOLD(self)) {
+ self0 = new_time_ex2(TIME_GET_HOUR(self),
+ TIME_GET_MINUTE(self),
+ TIME_GET_SECOND(self),
+ TIME_GET_MICROSECOND(self),
+ HASTZINFO(self) ? self->tzinfo : Py_None,
+ 0, Py_TYPE(self));
+ if (self0 == NULL)
+ return -1;
+ }
+ else {
+ self0 = Py_NewRef(self);
+ }
+ offset = time_utcoffset(self0, NULL);
+ Py_DECREF(self0);
+
+ if (offset == NULL)
+ return -1;
+
+ /* Reduce this to a hash of another object. */
+ if (offset == Py_None)
+ self->hashcode = generic_hash(
+ (unsigned char *)self->data, _PyDateTime_TIME_DATASIZE);
+ else {
+ PyObject *temp1, *temp2;
+ int seconds, microseconds;
+ assert(HASTZINFO(self));
+ seconds = TIME_GET_HOUR(self) * 3600 +
+ TIME_GET_MINUTE(self) * 60 +
+ TIME_GET_SECOND(self);
+ microseconds = TIME_GET_MICROSECOND(self);
+ temp1 = new_delta(0, seconds, microseconds, 1);
+ if (temp1 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ temp2 = delta_subtract(temp1, offset);
+ Py_DECREF(temp1);
+ if (temp2 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ self->hashcode = PyObject_Hash(temp2);
+ Py_DECREF(temp2);
+ }
+ Py_DECREF(offset);
+ }
+ return self->hashcode;
+}
+
+static PyObject *
+time_replace(PyDateTime_Time *self, PyObject *args, PyObject *kw)
+{
+ PyObject *clone;
+ PyObject *tuple;
+ int hh = TIME_GET_HOUR(self);
+ int mm = TIME_GET_MINUTE(self);
+ int ss = TIME_GET_SECOND(self);
+ int us = TIME_GET_MICROSECOND(self);
+ PyObject *tzinfo = HASTZINFO(self) ? self->tzinfo : Py_None;
+ int fold = TIME_GET_FOLD(self);
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "|iiiiO$i:replace",
+ time_kws,
+ &hh, &mm, &ss, &us, &tzinfo, &fold))
+ return NULL;
+ if (fold != 0 && fold != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "fold must be either 0 or 1");
+ return NULL;
+ }
+ tuple = Py_BuildValue("iiiiO", hh, mm, ss, us, tzinfo);
+ if (tuple == NULL)
+ return NULL;
+ clone = time_new(Py_TYPE(self), tuple, NULL);
+ if (clone != NULL) {
+ TIME_SET_FOLD(clone, fold);
+ }
+ Py_DECREF(tuple);
+ return clone;
+}
+
+static PyObject *
+time_fromisoformat(PyObject *cls, PyObject *tstr) {
+ assert(tstr != NULL);
+
+ if (!PyUnicode_Check(tstr)) {
+ PyErr_SetString(PyExc_TypeError, "fromisoformat: argument must be str");
+ return NULL;
+ }
+
+ Py_ssize_t len;
+ const char *p = PyUnicode_AsUTF8AndSize(tstr, &len);
+
+ if (p == NULL) {
+ goto invalid_string_error;
+ }
+
+ // The spec actually requires that time-only ISO 8601 strings start with
+ // T, but the extended format allows this to be omitted as long as there
+ // is no ambiguity with date strings.
+ if (*p == 'T') {
+ ++p;
+ len -= 1;
+ }
+
+ int hour = 0, minute = 0, second = 0, microsecond = 0;
+ int tzoffset = 0, tzimicrosecond = 0;
+ int rv = parse_isoformat_time(p, len,
+ &hour, &minute, &second, &microsecond,
+ &tzoffset, &tzimicrosecond);
+
+ if (rv < 0) {
+ goto invalid_string_error;
+ }
+
+ PyObject *tzinfo = tzinfo_from_isoformat_results(rv, tzoffset,
+ tzimicrosecond);
+
+ if (tzinfo == NULL) {
+ return NULL;
+ }
+
+ PyObject *t;
+ if ( (PyTypeObject *)cls == &PyDateTime_TimeType ) {
+ t = new_time(hour, minute, second, microsecond, tzinfo, 0);
+ } else {
+ t = PyObject_CallFunction(cls, "iiiiO",
+ hour, minute, second, microsecond, tzinfo);
+ }
+
+ Py_DECREF(tzinfo);
+ return t;
+
+invalid_string_error:
+ PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", tstr);
+ return NULL;
+}
+
+
+/* Pickle support, a simple use of __reduce__. */
+
+/* Let basestate be the non-tzinfo data string.
+ * If tzinfo is None, this returns (basestate,), else (basestate, tzinfo).
+ * So it's a tuple in any (non-error) case.
+ * __getstate__ isn't exposed.
+ */
+static PyObject *
+time_getstate(PyDateTime_Time *self, int proto)
+{
+ PyObject *basestate;
+ PyObject *result = NULL;
+
+ basestate = PyBytes_FromStringAndSize((char *)self->data,
+ _PyDateTime_TIME_DATASIZE);
+ if (basestate != NULL) {
+ if (proto > 3 && TIME_GET_FOLD(self))
+ /* Set the first bit of the first byte */
+ PyBytes_AS_STRING(basestate)[0] |= (1 << 7);
+ if (! HASTZINFO(self) || self->tzinfo == Py_None)
+ result = PyTuple_Pack(1, basestate);
+ else
+ result = PyTuple_Pack(2, basestate, self->tzinfo);
+ Py_DECREF(basestate);
+ }
+ return result;
+}
+
+static PyObject *
+time_reduce_ex(PyDateTime_Time *self, PyObject *args)
+{
+ int proto;
+ if (!PyArg_ParseTuple(args, "i:__reduce_ex__", &proto))
+ return NULL;
+
+ return Py_BuildValue("(ON)", Py_TYPE(self), time_getstate(self, proto));
+}
+
+static PyObject *
+time_reduce(PyDateTime_Time *self, PyObject *arg)
+{
+ return Py_BuildValue("(ON)", Py_TYPE(self), time_getstate(self, 2));
+}
+
+static PyMethodDef time_methods[] = {
+
+ {"isoformat", _PyCFunction_CAST(time_isoformat), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]]"
+ "[+HH:MM].\n\n"
+ "The optional argument timespec specifies the number "
+ "of additional terms\nof the time to include. Valid "
+ "options are 'auto', 'hours', 'minutes',\n'seconds', "
+ "'milliseconds' and 'microseconds'.\n")},
+
+ {"strftime", _PyCFunction_CAST(time_strftime), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("format -> strftime() style string.")},
+
+ {"__format__", (PyCFunction)date_format, METH_VARARGS,
+ PyDoc_STR("Formats self with strftime.")},
+
+ {"utcoffset", (PyCFunction)time_utcoffset, METH_NOARGS,
+ PyDoc_STR("Return self.tzinfo.utcoffset(self).")},
+
+ {"tzname", (PyCFunction)time_tzname, METH_NOARGS,
+ PyDoc_STR("Return self.tzinfo.tzname(self).")},
+
+ {"dst", (PyCFunction)time_dst, METH_NOARGS,
+ PyDoc_STR("Return self.tzinfo.dst(self).")},
+
+ {"replace", _PyCFunction_CAST(time_replace), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("Return time with new specified fields.")},
+
+ {"fromisoformat", (PyCFunction)time_fromisoformat, METH_O | METH_CLASS,
+ PyDoc_STR("string -> time from a string in ISO 8601 format")},
+
+ {"__reduce_ex__", (PyCFunction)time_reduce_ex, METH_VARARGS,
+ PyDoc_STR("__reduce_ex__(proto) -> (cls, state)")},
+
+ {"__reduce__", (PyCFunction)time_reduce, METH_NOARGS,
+ PyDoc_STR("__reduce__() -> (cls, state)")},
+
+ {NULL, NULL}
+};
+
+static const char time_doc[] =
+PyDoc_STR("time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object\n\
+\n\
+All arguments are optional. tzinfo may be None, or an instance of\n\
+a tzinfo subclass. The remaining arguments may be ints.\n");
+
+static PyTypeObject PyDateTime_TimeType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.time", /* tp_name */
+ sizeof(PyDateTime_Time), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)time_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)time_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)time_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc)time_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ time_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ time_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ time_methods, /* tp_methods */
+ 0, /* tp_members */
+ time_getset, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ time_alloc, /* tp_alloc */
+ time_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/*
+ * PyDateTime_DateTime implementation.
+ */
+
+/* Accessor properties. Properties for day, month, and year are inherited
+ * from date.
+ */
+
+static PyObject *
+datetime_hour(PyDateTime_DateTime *self, void *unused)
+{
+ return PyLong_FromLong(DATE_GET_HOUR(self));
+}
+
+static PyObject *
+datetime_minute(PyDateTime_DateTime *self, void *unused)
+{
+ return PyLong_FromLong(DATE_GET_MINUTE(self));
+}
+
+static PyObject *
+datetime_second(PyDateTime_DateTime *self, void *unused)
+{
+ return PyLong_FromLong(DATE_GET_SECOND(self));
+}
+
+static PyObject *
+datetime_microsecond(PyDateTime_DateTime *self, void *unused)
+{
+ return PyLong_FromLong(DATE_GET_MICROSECOND(self));
+}
+
+static PyObject *
+datetime_tzinfo(PyDateTime_DateTime *self, void *unused)
+{
+ PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None;
+ return Py_NewRef(result);
+}
+
+static PyObject *
+datetime_fold(PyDateTime_DateTime *self, void *unused)
+{
+ return PyLong_FromLong(DATE_GET_FOLD(self));
+}
+
+static PyGetSetDef datetime_getset[] = {
+ {"hour", (getter)datetime_hour},
+ {"minute", (getter)datetime_minute},
+ {"second", (getter)datetime_second},
+ {"microsecond", (getter)datetime_microsecond},
+ {"tzinfo", (getter)datetime_tzinfo},
+ {"fold", (getter)datetime_fold},
+ {NULL}
+};
+
+/*
+ * Constructors.
+ */
+
+static char *datetime_kws[] = {
+ "year", "month", "day", "hour", "minute", "second",
+ "microsecond", "tzinfo", "fold", NULL
+};
+
+static PyObject *
+datetime_from_pickle(PyTypeObject *type, PyObject *state, PyObject *tzinfo)
+{
+ PyDateTime_DateTime *me;
+ char aware = (char)(tzinfo != Py_None);
+
+ if (aware && check_tzinfo_subclass(tzinfo) < 0) {
+ PyErr_SetString(PyExc_TypeError, "bad tzinfo state arg");
+ return NULL;
+ }
+
+ me = (PyDateTime_DateTime *) (type->tp_alloc(type , aware));
+ if (me != NULL) {
+ const char *pdata = PyBytes_AS_STRING(state);
+
+ memcpy(me->data, pdata, _PyDateTime_DATETIME_DATASIZE);
+ me->hashcode = -1;
+ me->hastzinfo = aware;
+ if (aware) {
+ me->tzinfo = Py_NewRef(tzinfo);
+ }
+ if (pdata[2] & (1 << 7)) {
+ me->data[2] -= 128;
+ me->fold = 1;
+ }
+ else {
+ me->fold = 0;
+ }
+ }
+ return (PyObject *)me;
+}
+
+static PyObject *
+datetime_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *self = NULL;
+ int year;
+ int month;
+ int day;
+ int hour = 0;
+ int minute = 0;
+ int second = 0;
+ int usecond = 0;
+ int fold = 0;
+ PyObject *tzinfo = Py_None;
+
+ /* Check for invocation from pickle with __getstate__ state */
+ if (PyTuple_GET_SIZE(args) >= 1 && PyTuple_GET_SIZE(args) <= 2) {
+ PyObject *state = PyTuple_GET_ITEM(args, 0);
+ if (PyTuple_GET_SIZE(args) == 2) {
+ tzinfo = PyTuple_GET_ITEM(args, 1);
+ }
+ if (PyBytes_Check(state)) {
+ if (PyBytes_GET_SIZE(state) == _PyDateTime_DATETIME_DATASIZE &&
+ MONTH_IS_SANE(PyBytes_AS_STRING(state)[2] & 0x7F))
+ {
+ return datetime_from_pickle(type, state, tzinfo);
+ }
+ }
+ else if (PyUnicode_Check(state)) {
+ if (PyUnicode_READY(state)) {
+ return NULL;
+ }
+ if (PyUnicode_GET_LENGTH(state) == _PyDateTime_DATETIME_DATASIZE &&
+ MONTH_IS_SANE(PyUnicode_READ_CHAR(state, 2) & 0x7F))
+ {
+ state = PyUnicode_AsLatin1String(state);
+ if (state == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ /* More informative error message. */
+ PyErr_SetString(PyExc_ValueError,
+ "Failed to encode latin1 string when unpickling "
+ "a datetime object. "
+ "pickle.load(data, encoding='latin1') is assumed.");
+ }
+ return NULL;
+ }
+ self = datetime_from_pickle(type, state, tzinfo);
+ Py_DECREF(state);
+ return self;
+ }
+ }
+ tzinfo = Py_None;
+ }
+
+ if (PyArg_ParseTupleAndKeywords(args, kw, "iii|iiiiO$i", datetime_kws,
+ &year, &month, &day, &hour, &minute,
+ &second, &usecond, &tzinfo, &fold)) {
+ self = new_datetime_ex2(year, month, day,
+ hour, minute, second, usecond,
+ tzinfo, fold, type);
+ }
+ return self;
+}
+
+/* TM_FUNC is the shared type of _PyTime_localtime() and
+ * _PyTime_gmtime(). */
+typedef int (*TM_FUNC)(time_t timer, struct tm*);
+
+/* As of version 2015f max fold in IANA database is
+ * 23 hours at 1969-09-30 13:00:00 in Kwajalein. */
+static long long max_fold_seconds = 24 * 3600;
+/* NB: date(1970,1,1).toordinal() == 719163 */
+static long long epoch = 719163LL * 24 * 60 * 60;
+
+static long long
+utc_to_seconds(int year, int month, int day,
+ int hour, int minute, int second)
+{
+ long long ordinal;
+
+ /* ymd_to_ord() doesn't support year <= 0 */
+ if (year < MINYEAR || year > MAXYEAR) {
+ PyErr_Format(PyExc_ValueError, "year %i is out of range", year);
+ return -1;
+ }
+
+ ordinal = ymd_to_ord(year, month, day);
+ return ((ordinal * 24 + hour) * 60 + minute) * 60 + second;
+}
+
+static long long
+local(long long u)
+{
+ struct tm local_time;
+ time_t t;
+ u -= epoch;
+ t = u;
+ if (t != u) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timestamp out of range for platform time_t");
+ return -1;
+ }
+ if (_PyTime_localtime(t, &local_time) != 0)
+ return -1;
+ return utc_to_seconds(local_time.tm_year + 1900,
+ local_time.tm_mon + 1,
+ local_time.tm_mday,
+ local_time.tm_hour,
+ local_time.tm_min,
+ local_time.tm_sec);
+}
+
+/* Internal helper.
+ * Build datetime from a time_t and a distinct count of microseconds.
+ * Pass localtime or gmtime for f, to control the interpretation of timet.
+ */
+static PyObject *
+datetime_from_timet_and_us(PyObject *cls, TM_FUNC f, time_t timet, int us,
+ PyObject *tzinfo)
+{
+ struct tm tm;
+ int year, month, day, hour, minute, second, fold = 0;
+
+ if (f(timet, &tm) != 0)
+ return NULL;
+
+ year = tm.tm_year + 1900;
+ month = tm.tm_mon + 1;
+ day = tm.tm_mday;
+ hour = tm.tm_hour;
+ minute = tm.tm_min;
+ /* The platform localtime/gmtime may insert leap seconds,
+ * indicated by tm.tm_sec > 59. We don't care about them,
+ * except to the extent that passing them on to the datetime
+ * constructor would raise ValueError for a reason that
+ * made no sense to the user.
+ */
+ second = Py_MIN(59, tm.tm_sec);
+
+ /* local timezone requires to compute fold */
+ if (tzinfo == Py_None && f == _PyTime_localtime
+ /* On Windows, passing a negative value to local results
+ * in an OSError because localtime_s on Windows does
+ * not support negative timestamps. Unfortunately this
+ * means that fold detection for time values between
+ * 0 and max_fold_seconds will result in an identical
+ * error since we subtract max_fold_seconds to detect a
+ * fold. However, since we know there haven't been any
+ * folds in the interval [0, max_fold_seconds) in any
+ * timezone, we can hackily just forego fold detection
+ * for this time range.
+ */
+#ifdef MS_WINDOWS
+ && (timet - max_fold_seconds > 0)
+#endif
+ ) {
+ long long probe_seconds, result_seconds, transition;
+
+ result_seconds = utc_to_seconds(year, month, day,
+ hour, minute, second);
+ if (result_seconds == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ /* Probe max_fold_seconds to detect a fold. */
+ probe_seconds = local(epoch + timet - max_fold_seconds);
+ if (probe_seconds == -1)
+ return NULL;
+ transition = result_seconds - probe_seconds - max_fold_seconds;
+ if (transition < 0) {
+ probe_seconds = local(epoch + timet + transition);
+ if (probe_seconds == -1)
+ return NULL;
+ if (probe_seconds == result_seconds)
+ fold = 1;
+ }
+ }
+ return new_datetime_subclass_fold_ex(year, month, day, hour, minute,
+ second, us, tzinfo, fold, cls);
+}
+
+/* Internal helper.
+ * Build datetime from a Python timestamp. Pass localtime or gmtime for f,
+ * to control the interpretation of the timestamp. Since a double doesn't
+ * have enough bits to cover a datetime's full range of precision, it's
+ * better to call datetime_from_timet_and_us provided you have a way
+ * to get that much precision (e.g., C time() isn't good enough).
+ */
+static PyObject *
+datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp,
+ PyObject *tzinfo)
+{
+ time_t timet;
+ long us;
+
+ if (_PyTime_ObjectToTimeval(timestamp,
+ &timet, &us, _PyTime_ROUND_HALF_EVEN) == -1)
+ return NULL;
+
+ return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo);
+}
+
+/* Internal helper.
+ * Build most accurate possible datetime for current time. Pass localtime or
+ * gmtime for f as appropriate.
+ */
+static PyObject *
+datetime_best_possible(PyObject *cls, TM_FUNC f, PyObject *tzinfo)
+{
+ _PyTime_t ts = _PyTime_GetSystemClock();
+ time_t secs;
+ int us;
+
+ if (_PyTime_AsTimevalTime_t(ts, &secs, &us, _PyTime_ROUND_FLOOR) < 0)
+ return NULL;
+ assert(0 <= us && us <= 999999);
+
+ return datetime_from_timet_and_us(cls, f, secs, us, tzinfo);
+}
+
+/*[clinic input]
+
+@classmethod
+datetime.datetime.now
+
+ tz: object = None
+ Timezone object.
+
+Returns new datetime object representing current time local to tz.
+
+If no tz is specified, uses local timezone.
+[clinic start generated code]*/
+
+static PyObject *
+datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz)
+/*[clinic end generated code: output=b3386e5345e2b47a input=80d09869c5267d00]*/
+{
+ PyObject *self;
+
+ /* Return best possible local time -- this isn't constrained by the
+ * precision of a timestamp.
+ */
+ if (check_tzinfo_subclass(tz) < 0)
+ return NULL;
+
+ self = datetime_best_possible((PyObject *)type,
+ tz == Py_None ? _PyTime_localtime :
+ _PyTime_gmtime,
+ tz);
+ if (self != NULL && tz != Py_None) {
+ /* Convert UTC to tzinfo's zone. */
+ PyObject *res = PyObject_CallMethodOneArg(tz, &_Py_ID(fromutc), self);
+ Py_DECREF(self);
+ return res;
+ }
+ return self;
+}
+
+/* Return best possible UTC time -- this isn't constrained by the
+ * precision of a timestamp.
+ */
+static PyObject *
+datetime_utcnow(PyObject *cls, PyObject *dummy)
+{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "datetime.datetime.utcnow() is deprecated and scheduled for removal in a "
+ "future version. Use timezone-aware objects to represent datetimes "
+ "in UTC: datetime.datetime.now(datetime.UTC).", 1))
+ {
+ return NULL;
+ }
+ return datetime_best_possible(cls, _PyTime_gmtime, Py_None);
+}
+
+/* Return new local datetime from timestamp (Python timestamp -- a double). */
+static PyObject *
+datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw)
+{
+ PyObject *self;
+ PyObject *timestamp;
+ PyObject *tzinfo = Py_None;
+ static char *keywords[] = {"timestamp", "tz", NULL};
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "O|O:fromtimestamp",
+ keywords, &timestamp, &tzinfo))
+ return NULL;
+ if (check_tzinfo_subclass(tzinfo) < 0)
+ return NULL;
+
+ self = datetime_from_timestamp(cls,
+ tzinfo == Py_None ? _PyTime_localtime :
+ _PyTime_gmtime,
+ timestamp,
+ tzinfo);
+ if (self != NULL && tzinfo != Py_None) {
+ /* Convert UTC to tzinfo's zone. */
+ PyObject *res = PyObject_CallMethodOneArg(tzinfo, &_Py_ID(fromutc), self);
+ Py_DECREF(self);
+ return res;
+ }
+ return self;
+}
+
+/* Return new UTC datetime from timestamp (Python timestamp -- a double). */
+static PyObject *
+datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
+{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal "
+ "in a future version. Use timezone-aware objects to represent "
+ "datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).", 1))
+ {
+ return NULL;
+ }
+ PyObject *timestamp;
+ PyObject *result = NULL;
+
+ if (PyArg_ParseTuple(args, "O:utcfromtimestamp", &timestamp))
+ result = datetime_from_timestamp(cls, _PyTime_gmtime, timestamp,
+ Py_None);
+ return result;
+}
+
+/* Return new datetime from _strptime.strptime_datetime(). */
+static PyObject *
+datetime_strptime(PyObject *cls, PyObject *args)
+{
+ static PyObject *module = NULL;
+ PyObject *string, *format;
+
+ if (!PyArg_ParseTuple(args, "UU:strptime", &string, &format))
+ return NULL;
+
+ if (module == NULL) {
+ module = PyImport_ImportModule("_strptime");
+ if (module == NULL)
+ return NULL;
+ }
+ return PyObject_CallMethodObjArgs(module, &_Py_ID(_strptime_datetime),
+ cls, string, format, NULL);
+}
+
+/* Return new datetime from date/datetime and time arguments. */
+static PyObject *
+datetime_combine(PyObject *cls, PyObject *args, PyObject *kw)
+{
+ static char *keywords[] = {"date", "time", "tzinfo", NULL};
+ PyObject *date;
+ PyObject *time;
+ PyObject *tzinfo = NULL;
+ PyObject *result = NULL;
+
+ if (PyArg_ParseTupleAndKeywords(args, kw, "O!O!|O:combine", keywords,
+ &PyDateTime_DateType, &date,
+ &PyDateTime_TimeType, &time, &tzinfo)) {
+ if (tzinfo == NULL) {
+ if (HASTZINFO(time))
+ tzinfo = ((PyDateTime_Time *)time)->tzinfo;
+ else
+ tzinfo = Py_None;
+ }
+ result = new_datetime_subclass_fold_ex(GET_YEAR(date),
+ GET_MONTH(date),
+ GET_DAY(date),
+ TIME_GET_HOUR(time),
+ TIME_GET_MINUTE(time),
+ TIME_GET_SECOND(time),
+ TIME_GET_MICROSECOND(time),
+ tzinfo,
+ TIME_GET_FOLD(time),
+ cls);
+ }
+ return result;
+}
+
+static PyObject *
+_sanitize_isoformat_str(PyObject *dtstr)
+{
+ Py_ssize_t len = PyUnicode_GetLength(dtstr);
+ if (len < 7) { // All valid ISO 8601 strings are at least 7 characters long
+ return NULL;
+ }
+
+ // `fromisoformat` allows surrogate characters in exactly one position,
+ // the separator; to allow datetime_fromisoformat to make the simplifying
+ // assumption that all valid strings can be encoded in UTF-8, this function
+ // replaces any surrogate character separators with `T`.
+ //
+ // The result of this, if not NULL, returns a new reference
+ const void* const unicode_data = PyUnicode_DATA(dtstr);
+ const int kind = PyUnicode_KIND(dtstr);
+
+ // Depending on the format of the string, the separator can only ever be
+ // in positions 7, 8 or 10. We'll check each of these for a surrogate and
+ // if we find one, replace it with `T`. If there is more than one surrogate,
+ // we don't have to bother sanitizing it, because the function will later
+ // fail when we try to encode the string as ASCII.
+ static const size_t potential_separators[3] = {7, 8, 10};
+ size_t surrogate_separator = 0;
+ for(size_t idx = 0;
+ idx < sizeof(potential_separators) / sizeof(*potential_separators);
+ ++idx) {
+ size_t pos = potential_separators[idx];
+ if (pos > (size_t)len) {
+ break;
+ }
+
+ if(Py_UNICODE_IS_SURROGATE(PyUnicode_READ(kind, unicode_data, pos))) {
+ surrogate_separator = pos;
+ break;
+ }
+ }
+
+ if (surrogate_separator == 0) {
+ return Py_NewRef(dtstr);
+ }
+
+ PyObject *str_out = _PyUnicode_Copy(dtstr);
+ if (str_out == NULL) {
+ return NULL;
+ }
+
+ if (PyUnicode_WriteChar(str_out, surrogate_separator, (Py_UCS4)'T')) {
+ Py_DECREF(str_out);
+ return NULL;
+ }
+
+ return str_out;
+}
+
+
+static Py_ssize_t
+_find_isoformat_datetime_separator(const char *dtstr, Py_ssize_t len) {
+ // The valid date formats can all be distinguished by characters 4 and 5
+ // and further narrowed down by character
+ // which tells us where to look for the separator character.
+ // Format | As-rendered | Position
+ // ---------------------------------------
+ // %Y-%m-%d | YYYY-MM-DD | 10
+ // %Y%m%d | YYYYMMDD | 8
+ // %Y-W%V | YYYY-Www | 8
+ // %YW%V | YYYYWww | 7
+ // %Y-W%V-%u | YYYY-Www-d | 10
+ // %YW%V%u | YYYYWwwd | 8
+ // %Y-%j | YYYY-DDD | 8
+ // %Y%j | YYYYDDD | 7
+ //
+ // Note that because we allow *any* character for the separator, in the
+ // case where character 4 is W, it's not straightforward to determine where
+ // the separator is — in the case of YYYY-Www-d, you have actual ambiguity,
+ // e.g. 2020-W01-0000 could be YYYY-Www-D0HH or YYYY-Www-HHMM, when the
+ // separator character is a number in the former case or a hyphen in the
+ // latter case.
+ //
+ // The case of YYYYWww can be distinguished from YYYYWwwd by tracking ahead
+ // to either the end of the string or the first non-numeric character —
+ // since the time components all come in pairs YYYYWww#HH can be
+ // distinguished from YYYYWwwd#HH by the fact that there will always be an
+ // odd number of digits before the first non-digit character in the former
+ // case.
+ static const char date_separator = '-';
+ static const char week_indicator = 'W';
+
+ if (len == 7) {
+ return 7;
+ }
+
+ if (dtstr[4] == date_separator) {
+ // YYYY-???
+
+ if (dtstr[5] == week_indicator) {
+ // YYYY-W??
+
+ if (len < 8) {
+ return -1;
+ }
+
+ if (len > 8 && dtstr[8] == date_separator) {
+ // YYYY-Www-D (10) or YYYY-Www-HH (8)
+ if (len == 9) { return -1; }
+ if (len > 10 && is_digit(dtstr[10])) {
+ // This is as far as we'll try to go to resolve the
+ // ambiguity for the moment — if we have YYYY-Www-##, the
+ // separator is either a hyphen at 8 or a number at 10.
+ //
+ // We'll assume it's a hyphen at 8 because it's way more
+ // likely that someone will use a hyphen as a separator
+ // than a number, but at this point it's really best effort
+ // because this is an extension of the spec anyway.
+ return 8;
+ }
+
+ return 10;
+ } else {
+ // YYYY-Www (8)
+ return 8;
+ }
+ } else {
+ // YYYY-MM-DD (10)
+ return 10;
+ }
+ } else {
+ // YYYY???
+ if (dtstr[4] == week_indicator) {
+ // YYYYWww (7) or YYYYWwwd (8)
+ size_t idx = 7;
+ for (; idx < (size_t)len; ++idx) {
+ // Keep going until we run out of digits.
+ if (!is_digit(dtstr[idx])) {
+ break;
+ }
+ }
+
+ if (idx < 9) {
+ return idx;
+ }
+
+ if (idx % 2 == 0) {
+ // If the index of the last number is even, it's YYYYWww
+ return 7;
+ } else {
+ return 8;
+ }
+ } else {
+ // YYYYMMDD (8)
+ return 8;
+ }
+ }
+}
+
+static PyObject *
+datetime_fromisoformat(PyObject *cls, PyObject *dtstr)
+{
+ assert(dtstr != NULL);
+
+ if (!PyUnicode_Check(dtstr)) {
+ PyErr_SetString(PyExc_TypeError,
+ "fromisoformat: argument must be str");
+ return NULL;
+ }
+
+ // We only need to sanitize this string if the separator is a surrogate
+ // character. In the situation where the separator location is ambiguous,
+ // we don't have to sanitize it anything because that can only happen when
+ // the separator is either '-' or a number. This should mostly be a noop
+ // but it makes the reference counting easier if we still sanitize.
+ PyObject *dtstr_clean = _sanitize_isoformat_str(dtstr);
+ if (dtstr_clean == NULL) {
+ goto invalid_string_error;
+ }
+
+ Py_ssize_t len;
+ const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr_clean, &len);
+
+ if (dt_ptr == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ // Encoding errors are invalid string errors at this point
+ goto invalid_string_error;
+ }
+ else {
+ goto error;
+ }
+ }
+
+ const Py_ssize_t separator_location = _find_isoformat_datetime_separator(
+ dt_ptr, len);
+
+
+ const char *p = dt_ptr;
+
+ int year = 0, month = 0, day = 0;
+ int hour = 0, minute = 0, second = 0, microsecond = 0;
+ int tzoffset = 0, tzusec = 0;
+
+ // date runs up to separator_location
+ int rv = parse_isoformat_date(p, separator_location, &year, &month, &day);
+
+ if (!rv && len > separator_location) {
+ // In UTF-8, the length of multi-byte characters is encoded in the MSB
+ p += separator_location;
+ if ((p[0] & 0x80) == 0) {
+ p += 1;
+ }
+ else {
+ switch (p[0] & 0xf0) {
+ case 0xe0:
+ p += 3;
+ break;
+ case 0xf0:
+ p += 4;
+ break;
+ default:
+ p += 2;
+ break;
+ }
+ }
+
+ len -= (p - dt_ptr);
+ rv = parse_isoformat_time(p, len, &hour, &minute, &second,
+ &microsecond, &tzoffset, &tzusec);
+ }
+ if (rv < 0) {
+ goto invalid_string_error;
+ }
+
+ PyObject *tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, tzusec);
+ if (tzinfo == NULL) {
+ goto error;
+ }
+
+ PyObject *dt = new_datetime_subclass_ex(year, month, day, hour, minute,
+ second, microsecond, tzinfo, cls);
+
+ Py_DECREF(tzinfo);
+ Py_DECREF(dtstr_clean);
+ return dt;
+
+invalid_string_error:
+ PyErr_Format(PyExc_ValueError, "Invalid isoformat string: %R", dtstr);
+
+error:
+ Py_XDECREF(dtstr_clean);
+
+ return NULL;
+}
+
+/*
+ * Destructor.
+ */
+
+static void
+datetime_dealloc(PyDateTime_DateTime *self)
+{
+ if (HASTZINFO(self)) {
+ Py_XDECREF(self->tzinfo);
+ }
+ Py_TYPE(self)->tp_free((PyObject *)self);
+}
+
+/*
+ * Indirect access to tzinfo methods.
+ */
+
+/* These are all METH_NOARGS, so don't need to check the arglist. */
+static PyObject *
+datetime_utcoffset(PyObject *self, PyObject *unused) {
+ return call_utcoffset(GET_DT_TZINFO(self), self);
+}
+
+static PyObject *
+datetime_dst(PyObject *self, PyObject *unused) {
+ return call_dst(GET_DT_TZINFO(self), self);
+}
+
+static PyObject *
+datetime_tzname(PyObject *self, PyObject *unused) {
+ return call_tzname(GET_DT_TZINFO(self), self);
+}
+
+/*
+ * datetime arithmetic.
+ */
+
+/* factor must be 1 (to add) or -1 (to subtract). The result inherits
+ * the tzinfo state of date.
+ */
+static PyObject *
+add_datetime_timedelta(PyDateTime_DateTime *date, PyDateTime_Delta *delta,
+ int factor)
+{
+ /* Note that the C-level additions can't overflow, because of
+ * invariant bounds on the member values.
+ */
+ int year = GET_YEAR(date);
+ int month = GET_MONTH(date);
+ int day = GET_DAY(date) + GET_TD_DAYS(delta) * factor;
+ int hour = DATE_GET_HOUR(date);
+ int minute = DATE_GET_MINUTE(date);
+ int second = DATE_GET_SECOND(date) + GET_TD_SECONDS(delta) * factor;
+ int microsecond = DATE_GET_MICROSECOND(date) +
+ GET_TD_MICROSECONDS(delta) * factor;
+
+ assert(factor == 1 || factor == -1);
+ if (normalize_datetime(&year, &month, &day,
+ &hour, &minute, &second, &microsecond) < 0) {
+ return NULL;
+ }
+
+ return new_datetime_subclass_ex(year, month, day,
+ hour, minute, second, microsecond,
+ HASTZINFO(date) ? date->tzinfo : Py_None,
+ (PyObject *)Py_TYPE(date));
+}
+
+static PyObject *
+datetime_add(PyObject *left, PyObject *right)
+{
+ if (PyDateTime_Check(left)) {
+ /* datetime + ??? */
+ if (PyDelta_Check(right))
+ /* datetime + delta */
+ return add_datetime_timedelta(
+ (PyDateTime_DateTime *)left,
+ (PyDateTime_Delta *)right,
+ 1);
+ }
+ else if (PyDelta_Check(left)) {
+ /* delta + datetime */
+ return add_datetime_timedelta((PyDateTime_DateTime *) right,
+ (PyDateTime_Delta *) left,
+ 1);
+ }
+ Py_RETURN_NOTIMPLEMENTED;
+}
+
+static PyObject *
+datetime_subtract(PyObject *left, PyObject *right)
+{
+ PyObject *result = Py_NotImplemented;
+
+ if (PyDateTime_Check(left)) {
+ /* datetime - ??? */
+ if (PyDateTime_Check(right)) {
+ /* datetime - datetime */
+ PyObject *offset1, *offset2, *offdiff = NULL;
+ int delta_d, delta_s, delta_us;
+
+ if (GET_DT_TZINFO(left) == GET_DT_TZINFO(right)) {
+ offset1 = Py_NewRef(Py_None);
+ offset2 = Py_NewRef(Py_None);
+ }
+ else {
+ offset1 = datetime_utcoffset(left, NULL);
+ if (offset1 == NULL)
+ return NULL;
+ offset2 = datetime_utcoffset(right, NULL);
+ if (offset2 == NULL) {
+ Py_DECREF(offset1);
+ return NULL;
+ }
+ if ((offset1 != Py_None) != (offset2 != Py_None)) {
+ PyErr_SetString(PyExc_TypeError,
+ "can't subtract offset-naive and "
+ "offset-aware datetimes");
+ Py_DECREF(offset1);
+ Py_DECREF(offset2);
+ return NULL;
+ }
+ }
+ if ((offset1 != offset2) &&
+ delta_cmp(offset1, offset2) != 0) {
+ offdiff = delta_subtract(offset1, offset2);
+ if (offdiff == NULL) {
+ Py_DECREF(offset1);
+ Py_DECREF(offset2);
+ return NULL;
+ }
+ }
+ Py_DECREF(offset1);
+ Py_DECREF(offset2);
+ delta_d = ymd_to_ord(GET_YEAR(left),
+ GET_MONTH(left),
+ GET_DAY(left)) -
+ ymd_to_ord(GET_YEAR(right),
+ GET_MONTH(right),
+ GET_DAY(right));
+ /* These can't overflow, since the values are
+ * normalized. At most this gives the number of
+ * seconds in one day.
+ */
+ delta_s = (DATE_GET_HOUR(left) -
+ DATE_GET_HOUR(right)) * 3600 +
+ (DATE_GET_MINUTE(left) -
+ DATE_GET_MINUTE(right)) * 60 +
+ (DATE_GET_SECOND(left) -
+ DATE_GET_SECOND(right));
+ delta_us = DATE_GET_MICROSECOND(left) -
+ DATE_GET_MICROSECOND(right);
+ result = new_delta(delta_d, delta_s, delta_us, 1);
+ if (result == NULL)
+ return NULL;
+
+ if (offdiff != NULL) {
+ Py_SETREF(result, delta_subtract(result, offdiff));
+ Py_DECREF(offdiff);
+ }
+ }
+ else if (PyDelta_Check(right)) {
+ /* datetime - delta */
+ result = add_datetime_timedelta(
+ (PyDateTime_DateTime *)left,
+ (PyDateTime_Delta *)right,
+ -1);
+ }
+ }
+
+ if (result == Py_NotImplemented)
+ Py_INCREF(result);
+ return result;
+}
+
+/* Various ways to turn a datetime into a string. */
+
+static PyObject *
+datetime_repr(PyDateTime_DateTime *self)
+{
+ const char *type_name = Py_TYPE(self)->tp_name;
+ PyObject *baserepr;
+
+ if (DATE_GET_MICROSECOND(self)) {
+ baserepr = PyUnicode_FromFormat(
+ "%s(%d, %d, %d, %d, %d, %d, %d)",
+ type_name,
+ GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
+ DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self),
+ DATE_GET_MICROSECOND(self));
+ }
+ else if (DATE_GET_SECOND(self)) {
+ baserepr = PyUnicode_FromFormat(
+ "%s(%d, %d, %d, %d, %d, %d)",
+ type_name,
+ GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
+ DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self));
+ }
+ else {
+ baserepr = PyUnicode_FromFormat(
+ "%s(%d, %d, %d, %d, %d)",
+ type_name,
+ GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
+ DATE_GET_HOUR(self), DATE_GET_MINUTE(self));
+ }
+ if (baserepr != NULL && DATE_GET_FOLD(self) != 0)
+ baserepr = append_keyword_fold(baserepr, DATE_GET_FOLD(self));
+ if (baserepr == NULL || ! HASTZINFO(self))
+ return baserepr;
+ return append_keyword_tzinfo(baserepr, self->tzinfo);
+}
+
+static PyObject *
+datetime_str(PyDateTime_DateTime *self)
+{
+ PyObject *space = PyUnicode_FromString(" ");
+ if (space == NULL) {
+ return NULL;
+ }
+ PyObject *res = PyObject_CallMethodOneArg((PyObject *)self,
+ &_Py_ID(isoformat), space);
+ Py_DECREF(space);
+ return res;
+}
+
+static PyObject *
+datetime_isoformat(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
+{
+ int sep = 'T';
+ char *timespec = NULL;
+ static char *keywords[] = {"sep", "timespec", NULL};
+ char buffer[100];
+ PyObject *result = NULL;
+ int us = DATE_GET_MICROSECOND(self);
+ static const char *specs[][2] = {
+ {"hours", "%04d-%02d-%02d%c%02d"},
+ {"minutes", "%04d-%02d-%02d%c%02d:%02d"},
+ {"seconds", "%04d-%02d-%02d%c%02d:%02d:%02d"},
+ {"milliseconds", "%04d-%02d-%02d%c%02d:%02d:%02d.%03d"},
+ {"microseconds", "%04d-%02d-%02d%c%02d:%02d:%02d.%06d"},
+ };
+ size_t given_spec;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "|Cs:isoformat", keywords, &sep, &timespec))
+ return NULL;
+
+ if (timespec == NULL || strcmp(timespec, "auto") == 0) {
+ if (us == 0) {
+ /* seconds */
+ given_spec = 2;
+ }
+ else {
+ /* microseconds */
+ given_spec = 4;
+ }
+ }
+ else {
+ for (given_spec = 0; given_spec < Py_ARRAY_LENGTH(specs); given_spec++) {
+ if (strcmp(timespec, specs[given_spec][0]) == 0) {
+ if (given_spec == 3) {
+ us = us / 1000;
+ }
+ break;
+ }
+ }
+ }
+
+ if (given_spec == Py_ARRAY_LENGTH(specs)) {
+ PyErr_Format(PyExc_ValueError, "Unknown timespec value");
+ return NULL;
+ }
+ else {
+ result = PyUnicode_FromFormat(specs[given_spec][1],
+ GET_YEAR(self), GET_MONTH(self),
+ GET_DAY(self), (int)sep,
+ DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self), us);
+ }
+
+ if (!result || !HASTZINFO(self))
+ return result;
+
+ /* We need to append the UTC offset. */
+ if (format_utcoffset(buffer, sizeof(buffer), ":", self->tzinfo,
+ (PyObject *)self) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyUnicode_AppendAndDel(&result, PyUnicode_FromString(buffer));
+ return result;
+}
+
+static PyObject *
+datetime_ctime(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ return format_ctime((PyDateTime_Date *)self,
+ DATE_GET_HOUR(self),
+ DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self));
+}
+
+/* Miscellaneous methods. */
+
+static PyObject *
+flip_fold(PyObject *dt)
+{
+ return new_datetime_ex2(GET_YEAR(dt),
+ GET_MONTH(dt),
+ GET_DAY(dt),
+ DATE_GET_HOUR(dt),
+ DATE_GET_MINUTE(dt),
+ DATE_GET_SECOND(dt),
+ DATE_GET_MICROSECOND(dt),
+ HASTZINFO(dt) ?
+ ((PyDateTime_DateTime *)dt)->tzinfo : Py_None,
+ !DATE_GET_FOLD(dt),
+ Py_TYPE(dt));
+}
+
+static PyObject *
+get_flip_fold_offset(PyObject *dt)
+{
+ PyObject *result, *flip_dt;
+
+ flip_dt = flip_fold(dt);
+ if (flip_dt == NULL)
+ return NULL;
+ result = datetime_utcoffset(flip_dt, NULL);
+ Py_DECREF(flip_dt);
+ return result;
+}
+
+/* PEP 495 exception: Whenever one or both of the operands in
+ * inter-zone comparison is such that its utcoffset() depends
+ * on the value of its fold attribute, the result is False.
+ *
+ * Return 1 if exception applies, 0 if not, and -1 on error.
+ */
+static int
+pep495_eq_exception(PyObject *self, PyObject *other,
+ PyObject *offset_self, PyObject *offset_other)
+{
+ int result = 0;
+ PyObject *flip_offset;
+
+ flip_offset = get_flip_fold_offset(self);
+ if (flip_offset == NULL)
+ return -1;
+ if (flip_offset != offset_self &&
+ delta_cmp(flip_offset, offset_self))
+ {
+ result = 1;
+ goto done;
+ }
+ Py_DECREF(flip_offset);
+
+ flip_offset = get_flip_fold_offset(other);
+ if (flip_offset == NULL)
+ return -1;
+ if (flip_offset != offset_other &&
+ delta_cmp(flip_offset, offset_other))
+ result = 1;
+ done:
+ Py_DECREF(flip_offset);
+ return result;
+}
+
+static PyObject *
+datetime_richcompare(PyObject *self, PyObject *other, int op)
+{
+ PyObject *result = NULL;
+ PyObject *offset1, *offset2;
+ int diff;
+
+ if (! PyDateTime_Check(other)) {
+ if (PyDate_Check(other)) {
+ /* Prevent invocation of date_richcompare. We want to
+ return NotImplemented here to give the other object
+ a chance. But since DateTime is a subclass of
+ Date, if the other object is a Date, it would
+ compute an ordering based on the date part alone,
+ and we don't want that. So force unequal or
+ uncomparable here in that case. */
+ if (op == Py_EQ)
+ Py_RETURN_FALSE;
+ if (op == Py_NE)
+ Py_RETURN_TRUE;
+ return cmperror(self, other);
+ }
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+ if (GET_DT_TZINFO(self) == GET_DT_TZINFO(other)) {
+ diff = memcmp(((PyDateTime_DateTime *)self)->data,
+ ((PyDateTime_DateTime *)other)->data,
+ _PyDateTime_DATETIME_DATASIZE);
+ return diff_to_bool(diff, op);
+ }
+ offset1 = datetime_utcoffset(self, NULL);
+ if (offset1 == NULL)
+ return NULL;
+ offset2 = datetime_utcoffset(other, NULL);
+ if (offset2 == NULL)
+ goto done;
+ /* If they're both naive, or both aware and have the same offsets,
+ * we get off cheap. Note that if they're both naive, offset1 ==
+ * offset2 == Py_None at this point.
+ */
+ if ((offset1 == offset2) ||
+ (PyDelta_Check(offset1) && PyDelta_Check(offset2) &&
+ delta_cmp(offset1, offset2) == 0)) {
+ diff = memcmp(((PyDateTime_DateTime *)self)->data,
+ ((PyDateTime_DateTime *)other)->data,
+ _PyDateTime_DATETIME_DATASIZE);
+ if ((op == Py_EQ || op == Py_NE) && diff == 0) {
+ int ex = pep495_eq_exception(self, other, offset1, offset2);
+ if (ex == -1)
+ goto done;
+ if (ex)
+ diff = 1;
+ }
+ result = diff_to_bool(diff, op);
+ }
+ else if (offset1 != Py_None && offset2 != Py_None) {
+ PyDateTime_Delta *delta;
+
+ assert(offset1 != offset2); /* else last "if" handled it */
+ delta = (PyDateTime_Delta *)datetime_subtract((PyObject *)self,
+ other);
+ if (delta == NULL)
+ goto done;
+ diff = GET_TD_DAYS(delta);
+ if (diff == 0)
+ diff = GET_TD_SECONDS(delta) |
+ GET_TD_MICROSECONDS(delta);
+ Py_DECREF(delta);
+ if ((op == Py_EQ || op == Py_NE) && diff == 0) {
+ int ex = pep495_eq_exception(self, other, offset1, offset2);
+ if (ex == -1)
+ goto done;
+ if (ex)
+ diff = 1;
+ }
+ result = diff_to_bool(diff, op);
+ }
+ else if (op == Py_EQ) {
+ result = Py_NewRef(Py_False);
+ }
+ else if (op == Py_NE) {
+ result = Py_NewRef(Py_True);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "can't compare offset-naive and "
+ "offset-aware datetimes");
+ }
+ done:
+ Py_DECREF(offset1);
+ Py_XDECREF(offset2);
+ return result;
+}
+
+static Py_hash_t
+datetime_hash(PyDateTime_DateTime *self)
+{
+ if (self->hashcode == -1) {
+ PyObject *offset, *self0;
+ if (DATE_GET_FOLD(self)) {
+ self0 = new_datetime_ex2(GET_YEAR(self),
+ GET_MONTH(self),
+ GET_DAY(self),
+ DATE_GET_HOUR(self),
+ DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self),
+ DATE_GET_MICROSECOND(self),
+ HASTZINFO(self) ? self->tzinfo : Py_None,
+ 0, Py_TYPE(self));
+ if (self0 == NULL)
+ return -1;
+ }
+ else {
+ self0 = Py_NewRef(self);
+ }
+ offset = datetime_utcoffset(self0, NULL);
+ Py_DECREF(self0);
+
+ if (offset == NULL)
+ return -1;
+
+ /* Reduce this to a hash of another object. */
+ if (offset == Py_None)
+ self->hashcode = generic_hash(
+ (unsigned char *)self->data, _PyDateTime_DATETIME_DATASIZE);
+ else {
+ PyObject *temp1, *temp2;
+ int days, seconds;
+
+ assert(HASTZINFO(self));
+ days = ymd_to_ord(GET_YEAR(self),
+ GET_MONTH(self),
+ GET_DAY(self));
+ seconds = DATE_GET_HOUR(self) * 3600 +
+ DATE_GET_MINUTE(self) * 60 +
+ DATE_GET_SECOND(self);
+ temp1 = new_delta(days, seconds,
+ DATE_GET_MICROSECOND(self),
+ 1);
+ if (temp1 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ temp2 = delta_subtract(temp1, offset);
+ Py_DECREF(temp1);
+ if (temp2 == NULL) {
+ Py_DECREF(offset);
+ return -1;
+ }
+ self->hashcode = PyObject_Hash(temp2);
+ Py_DECREF(temp2);
+ }
+ Py_DECREF(offset);
+ }
+ return self->hashcode;
+}
+
+static PyObject *
+datetime_replace(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
+{
+ PyObject *clone;
+ PyObject *tuple;
+ int y = GET_YEAR(self);
+ int m = GET_MONTH(self);
+ int d = GET_DAY(self);
+ int hh = DATE_GET_HOUR(self);
+ int mm = DATE_GET_MINUTE(self);
+ int ss = DATE_GET_SECOND(self);
+ int us = DATE_GET_MICROSECOND(self);
+ PyObject *tzinfo = HASTZINFO(self) ? self->tzinfo : Py_None;
+ int fold = DATE_GET_FOLD(self);
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "|iiiiiiiO$i:replace",
+ datetime_kws,
+ &y, &m, &d, &hh, &mm, &ss, &us,
+ &tzinfo, &fold))
+ return NULL;
+ if (fold != 0 && fold != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "fold must be either 0 or 1");
+ return NULL;
+ }
+ tuple = Py_BuildValue("iiiiiiiO", y, m, d, hh, mm, ss, us, tzinfo);
+ if (tuple == NULL)
+ return NULL;
+ clone = datetime_new(Py_TYPE(self), tuple, NULL);
+ if (clone != NULL) {
+ DATE_SET_FOLD(clone, fold);
+ }
+ Py_DECREF(tuple);
+ return clone;
+}
+
+static PyObject *
+local_timezone_from_timestamp(time_t timestamp)
+{
+ PyObject *result = NULL;
+ PyObject *delta;
+ struct tm local_time_tm;
+ PyObject *nameo = NULL;
+ const char *zone = NULL;
+
+ if (_PyTime_localtime(timestamp, &local_time_tm) != 0)
+ return NULL;
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ zone = local_time_tm.tm_zone;
+ delta = new_delta(0, local_time_tm.tm_gmtoff, 0, 1);
+#else /* HAVE_STRUCT_TM_TM_ZONE */
+ {
+ PyObject *local_time, *utc_time;
+ struct tm utc_time_tm;
+ char buf[100];
+ strftime(buf, sizeof(buf), "%Z", &local_time_tm);
+ zone = buf;
+ local_time = new_datetime(local_time_tm.tm_year + 1900,
+ local_time_tm.tm_mon + 1,
+ local_time_tm.tm_mday,
+ local_time_tm.tm_hour,
+ local_time_tm.tm_min,
+ local_time_tm.tm_sec, 0, Py_None, 0);
+ if (local_time == NULL) {
+ return NULL;
+ }
+ if (_PyTime_gmtime(timestamp, &utc_time_tm) != 0)
+ return NULL;
+ utc_time = new_datetime(utc_time_tm.tm_year + 1900,
+ utc_time_tm.tm_mon + 1,
+ utc_time_tm.tm_mday,
+ utc_time_tm.tm_hour,
+ utc_time_tm.tm_min,
+ utc_time_tm.tm_sec, 0, Py_None, 0);
+ if (utc_time == NULL) {
+ Py_DECREF(local_time);
+ return NULL;
+ }
+ delta = datetime_subtract(local_time, utc_time);
+ Py_DECREF(local_time);
+ Py_DECREF(utc_time);
+ }
+#endif /* HAVE_STRUCT_TM_TM_ZONE */
+ if (delta == NULL) {
+ return NULL;
+ }
+ if (zone != NULL) {
+ nameo = PyUnicode_DecodeLocale(zone, "surrogateescape");
+ if (nameo == NULL)
+ goto error;
+ }
+ result = new_timezone(delta, nameo);
+ Py_XDECREF(nameo);
+ error:
+ Py_DECREF(delta);
+ return result;
+}
+
+static PyObject *
+local_timezone(PyDateTime_DateTime *utc_time)
+{
+ time_t timestamp;
+ PyObject *delta;
+ PyObject *one_second;
+ PyObject *seconds;
+
+ delta = datetime_subtract((PyObject *)utc_time, PyDateTime_Epoch);
+ if (delta == NULL)
+ return NULL;
+ one_second = new_delta(0, 1, 0, 0);
+ if (one_second == NULL) {
+ Py_DECREF(delta);
+ return NULL;
+ }
+ seconds = divide_timedelta_timedelta((PyDateTime_Delta *)delta,
+ (PyDateTime_Delta *)one_second);
+ Py_DECREF(one_second);
+ Py_DECREF(delta);
+ if (seconds == NULL)
+ return NULL;
+ timestamp = _PyLong_AsTime_t(seconds);
+ Py_DECREF(seconds);
+ if (timestamp == -1 && PyErr_Occurred())
+ return NULL;
+ return local_timezone_from_timestamp(timestamp);
+}
+
+static long long
+local_to_seconds(int year, int month, int day,
+ int hour, int minute, int second, int fold);
+
+static PyObject *
+local_timezone_from_local(PyDateTime_DateTime *local_dt)
+{
+ long long seconds, seconds2;
+ time_t timestamp;
+ int fold = DATE_GET_FOLD(local_dt);
+ seconds = local_to_seconds(GET_YEAR(local_dt),
+ GET_MONTH(local_dt),
+ GET_DAY(local_dt),
+ DATE_GET_HOUR(local_dt),
+ DATE_GET_MINUTE(local_dt),
+ DATE_GET_SECOND(local_dt),
+ fold);
+ if (seconds == -1)
+ return NULL;
+ seconds2 = local_to_seconds(GET_YEAR(local_dt),
+ GET_MONTH(local_dt),
+ GET_DAY(local_dt),
+ DATE_GET_HOUR(local_dt),
+ DATE_GET_MINUTE(local_dt),
+ DATE_GET_SECOND(local_dt),
+ !fold);
+ if (seconds2 == -1)
+ return NULL;
+ /* Detect gap */
+ if (seconds2 != seconds && (seconds2 > seconds) == fold)
+ seconds = seconds2;
+
+ /* XXX: add bounds check */
+ timestamp = seconds - epoch;
+ return local_timezone_from_timestamp(timestamp);
+}
+
+static PyDateTime_DateTime *
+datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
+{
+ PyDateTime_DateTime *result;
+ PyObject *offset;
+ PyObject *temp;
+ PyObject *self_tzinfo;
+ PyObject *tzinfo = Py_None;
+ static char *keywords[] = {"tz", NULL};
+
+ if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:astimezone", keywords,
+ &tzinfo))
+ return NULL;
+
+ if (check_tzinfo_subclass(tzinfo) == -1)
+ return NULL;
+
+ if (!HASTZINFO(self) || self->tzinfo == Py_None) {
+ naive:
+ self_tzinfo = local_timezone_from_local(self);
+ if (self_tzinfo == NULL)
+ return NULL;
+ } else {
+ self_tzinfo = Py_NewRef(self->tzinfo);
+ }
+
+ /* Conversion to self's own time zone is a NOP. */
+ if (self_tzinfo == tzinfo) {
+ Py_DECREF(self_tzinfo);
+ return (PyDateTime_DateTime*)Py_NewRef(self);
+ }
+
+ /* Convert self to UTC. */
+ offset = call_utcoffset(self_tzinfo, (PyObject *)self);
+ Py_DECREF(self_tzinfo);
+ if (offset == NULL)
+ return NULL;
+ else if(offset == Py_None) {
+ Py_DECREF(offset);
+ goto naive;
+ }
+ else if (!PyDelta_Check(offset)) {
+ Py_DECREF(offset);
+ PyErr_Format(PyExc_TypeError, "utcoffset() returned %.200s,"
+ " expected timedelta or None", Py_TYPE(offset)->tp_name);
+ return NULL;
+ }
+ /* result = self - offset */
+ result = (PyDateTime_DateTime *)add_datetime_timedelta(self,
+ (PyDateTime_Delta *)offset, -1);
+ Py_DECREF(offset);
+ if (result == NULL)
+ return NULL;
+
+ /* Make sure result is aware and UTC. */
+ if (!HASTZINFO(result)) {
+ temp = (PyObject *)result;
+ result = (PyDateTime_DateTime *)
+ new_datetime_ex2(GET_YEAR(result),
+ GET_MONTH(result),
+ GET_DAY(result),
+ DATE_GET_HOUR(result),
+ DATE_GET_MINUTE(result),
+ DATE_GET_SECOND(result),
+ DATE_GET_MICROSECOND(result),
+ PyDateTime_TimeZone_UTC,
+ DATE_GET_FOLD(result),
+ Py_TYPE(result));
+ Py_DECREF(temp);
+ if (result == NULL)
+ return NULL;
+ }
+ else {
+ /* Result is already aware - just replace tzinfo. */
+ Py_SETREF(result->tzinfo, Py_NewRef(PyDateTime_TimeZone_UTC));
+ }
+
+ /* Attach new tzinfo and let fromutc() do the rest. */
+ if (tzinfo == Py_None) {
+ tzinfo = local_timezone(result);
+ if (tzinfo == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ else
+ Py_INCREF(tzinfo);
+ Py_SETREF(result->tzinfo, tzinfo);
+
+ temp = (PyObject *)result;
+ result = (PyDateTime_DateTime *)
+ PyObject_CallMethodOneArg(tzinfo, &_Py_ID(fromutc), temp);
+ Py_DECREF(temp);
+
+ return result;
+}
+
+static PyObject *
+datetime_timetuple(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ int dstflag = -1;
+
+ if (HASTZINFO(self) && self->tzinfo != Py_None) {
+ PyObject * dst;
+
+ dst = call_dst(self->tzinfo, (PyObject *)self);
+ if (dst == NULL)
+ return NULL;
+
+ if (dst != Py_None)
+ dstflag = delta_bool((PyDateTime_Delta *)dst);
+ Py_DECREF(dst);
+ }
+ return build_struct_time(GET_YEAR(self),
+ GET_MONTH(self),
+ GET_DAY(self),
+ DATE_GET_HOUR(self),
+ DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self),
+ dstflag);
+}
+
+static long long
+local_to_seconds(int year, int month, int day,
+ int hour, int minute, int second, int fold)
+{
+ long long t, a, b, u1, u2, t1, t2, lt;
+ t = utc_to_seconds(year, month, day, hour, minute, second);
+ /* Our goal is to solve t = local(u) for u. */
+ lt = local(t);
+ if (lt == -1)
+ return -1;
+ a = lt - t;
+ u1 = t - a;
+ t1 = local(u1);
+ if (t1 == -1)
+ return -1;
+ if (t1 == t) {
+ /* We found one solution, but it may not be the one we need.
+ * Look for an earlier solution (if `fold` is 0), or a
+ * later one (if `fold` is 1). */
+ if (fold)
+ u2 = u1 + max_fold_seconds;
+ else
+ u2 = u1 - max_fold_seconds;
+ lt = local(u2);
+ if (lt == -1)
+ return -1;
+ b = lt - u2;
+ if (a == b)
+ return u1;
+ }
+ else {
+ b = t1 - u1;
+ assert(a != b);
+ }
+ u2 = t - b;
+ t2 = local(u2);
+ if (t2 == -1)
+ return -1;
+ if (t2 == t)
+ return u2;
+ if (t1 == t)
+ return u1;
+ /* We have found both offsets a and b, but neither t - a nor t - b is
+ * a solution. This means t is in the gap. */
+ return fold?Py_MIN(u1, u2):Py_MAX(u1, u2);
+}
+
+/* date(1970,1,1).toordinal() == 719163 */
+#define EPOCH_SECONDS (719163LL * 24 * 60 * 60)
+
+static PyObject *
+datetime_timestamp(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *result;
+
+ if (HASTZINFO(self) && self->tzinfo != Py_None) {
+ PyObject *delta;
+ delta = datetime_subtract((PyObject *)self, PyDateTime_Epoch);
+ if (delta == NULL)
+ return NULL;
+ result = delta_total_seconds(delta, NULL);
+ Py_DECREF(delta);
+ }
+ else {
+ long long seconds;
+ seconds = local_to_seconds(GET_YEAR(self),
+ GET_MONTH(self),
+ GET_DAY(self),
+ DATE_GET_HOUR(self),
+ DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self),
+ DATE_GET_FOLD(self));
+ if (seconds == -1)
+ return NULL;
+ result = PyFloat_FromDouble(seconds - EPOCH_SECONDS +
+ DATE_GET_MICROSECOND(self) / 1e6);
+ }
+ return result;
+}
+
+static PyObject *
+datetime_getdate(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ return new_date(GET_YEAR(self),
+ GET_MONTH(self),
+ GET_DAY(self));
+}
+
+static PyObject *
+datetime_gettime(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ return new_time(DATE_GET_HOUR(self),
+ DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self),
+ DATE_GET_MICROSECOND(self),
+ Py_None,
+ DATE_GET_FOLD(self));
+}
+
+static PyObject *
+datetime_gettimetz(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ return new_time(DATE_GET_HOUR(self),
+ DATE_GET_MINUTE(self),
+ DATE_GET_SECOND(self),
+ DATE_GET_MICROSECOND(self),
+ GET_DT_TZINFO(self),
+ DATE_GET_FOLD(self));
+}
+
+static PyObject *
+datetime_utctimetuple(PyDateTime_DateTime *self, PyObject *Py_UNUSED(ignored))
+{
+ int y, m, d, hh, mm, ss;
+ PyObject *tzinfo;
+ PyDateTime_DateTime *utcself;
+
+ tzinfo = GET_DT_TZINFO(self);
+ if (tzinfo == Py_None) {
+ utcself = (PyDateTime_DateTime*)Py_NewRef(self);
+ }
+ else {
+ PyObject *offset;
+ offset = call_utcoffset(tzinfo, (PyObject *)self);
+ if (offset == NULL)
+ return NULL;
+ if (offset == Py_None) {
+ Py_DECREF(offset);
+ utcself = (PyDateTime_DateTime*)Py_NewRef(self);
+ }
+ else {
+ utcself = (PyDateTime_DateTime *)add_datetime_timedelta(self,
+ (PyDateTime_Delta *)offset, -1);
+ Py_DECREF(offset);
+ if (utcself == NULL)
+ return NULL;
+ }
+ }
+ y = GET_YEAR(utcself);
+ m = GET_MONTH(utcself);
+ d = GET_DAY(utcself);
+ hh = DATE_GET_HOUR(utcself);
+ mm = DATE_GET_MINUTE(utcself);
+ ss = DATE_GET_SECOND(utcself);
+
+ Py_DECREF(utcself);
+ return build_struct_time(y, m, d, hh, mm, ss, 0);
+}
+
+/* Pickle support, a simple use of __reduce__. */
+
+/* Let basestate be the non-tzinfo data string.
+ * If tzinfo is None, this returns (basestate,), else (basestate, tzinfo).
+ * So it's a tuple in any (non-error) case.
+ * __getstate__ isn't exposed.
+ */
+static PyObject *
+datetime_getstate(PyDateTime_DateTime *self, int proto)
+{
+ PyObject *basestate;
+ PyObject *result = NULL;
+
+ basestate = PyBytes_FromStringAndSize((char *)self->data,
+ _PyDateTime_DATETIME_DATASIZE);
+ if (basestate != NULL) {
+ if (proto > 3 && DATE_GET_FOLD(self))
+ /* Set the first bit of the third byte */
+ PyBytes_AS_STRING(basestate)[2] |= (1 << 7);
+ if (! HASTZINFO(self) || self->tzinfo == Py_None)
+ result = PyTuple_Pack(1, basestate);
+ else
+ result = PyTuple_Pack(2, basestate, self->tzinfo);
+ Py_DECREF(basestate);
+ }
+ return result;
+}
+
+static PyObject *
+datetime_reduce_ex(PyDateTime_DateTime *self, PyObject *args)
+{
+ int proto;
+ if (!PyArg_ParseTuple(args, "i:__reduce_ex__", &proto))
+ return NULL;
+
+ return Py_BuildValue("(ON)", Py_TYPE(self), datetime_getstate(self, proto));
+}
+
+static PyObject *
+datetime_reduce(PyDateTime_DateTime *self, PyObject *arg)
+{
+ return Py_BuildValue("(ON)", Py_TYPE(self), datetime_getstate(self, 2));
+}
+
+static PyMethodDef datetime_methods[] = {
+
+ /* Class methods: */
+
+ DATETIME_DATETIME_NOW_METHODDEF
+
+ {"utcnow", (PyCFunction)datetime_utcnow,
+ METH_NOARGS | METH_CLASS,
+ PyDoc_STR("Return a new datetime representing UTC day and time.")},
+
+ {"fromtimestamp", _PyCFunction_CAST(datetime_fromtimestamp),
+ METH_VARARGS | METH_KEYWORDS | METH_CLASS,
+ PyDoc_STR("timestamp[, tz] -> tz's local time from POSIX timestamp.")},
+
+ {"utcfromtimestamp", (PyCFunction)datetime_utcfromtimestamp,
+ METH_VARARGS | METH_CLASS,
+ PyDoc_STR("Construct a naive UTC datetime from a POSIX timestamp.")},
+
+ {"strptime", (PyCFunction)datetime_strptime,
+ METH_VARARGS | METH_CLASS,
+ PyDoc_STR("string, format -> new datetime parsed from a string "
+ "(like time.strptime()).")},
+
+ {"combine", _PyCFunction_CAST(datetime_combine),
+ METH_VARARGS | METH_KEYWORDS | METH_CLASS,
+ PyDoc_STR("date, time -> datetime with same date and time fields")},
+
+ {"fromisoformat", (PyCFunction)datetime_fromisoformat,
+ METH_O | METH_CLASS,
+ PyDoc_STR("string -> datetime from a string in most ISO 8601 formats")},
+
+ /* Instance methods: */
+
+ {"date", (PyCFunction)datetime_getdate, METH_NOARGS,
+ PyDoc_STR("Return date object with same year, month and day.")},
+
+ {"time", (PyCFunction)datetime_gettime, METH_NOARGS,
+ PyDoc_STR("Return time object with same time but with tzinfo=None.")},
+
+ {"timetz", (PyCFunction)datetime_gettimetz, METH_NOARGS,
+ PyDoc_STR("Return time object with same time and tzinfo.")},
+
+ {"ctime", (PyCFunction)datetime_ctime, METH_NOARGS,
+ PyDoc_STR("Return ctime() style string.")},
+
+ {"timetuple", (PyCFunction)datetime_timetuple, METH_NOARGS,
+ PyDoc_STR("Return time tuple, compatible with time.localtime().")},
+
+ {"timestamp", (PyCFunction)datetime_timestamp, METH_NOARGS,
+ PyDoc_STR("Return POSIX timestamp as float.")},
+
+ {"utctimetuple", (PyCFunction)datetime_utctimetuple, METH_NOARGS,
+ PyDoc_STR("Return UTC time tuple, compatible with time.localtime().")},
+
+ {"isoformat", _PyCFunction_CAST(datetime_isoformat), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("[sep] -> string in ISO 8601 format, "
+ "YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n"
+ "sep is used to separate the year from the time, and "
+ "defaults to 'T'.\n"
+ "The optional argument timespec specifies the number "
+ "of additional terms\nof the time to include. Valid "
+ "options are 'auto', 'hours', 'minutes',\n'seconds', "
+ "'milliseconds' and 'microseconds'.\n")},
+
+ {"utcoffset", (PyCFunction)datetime_utcoffset, METH_NOARGS,
+ PyDoc_STR("Return self.tzinfo.utcoffset(self).")},
+
+ {"tzname", (PyCFunction)datetime_tzname, METH_NOARGS,
+ PyDoc_STR("Return self.tzinfo.tzname(self).")},
+
+ {"dst", (PyCFunction)datetime_dst, METH_NOARGS,
+ PyDoc_STR("Return self.tzinfo.dst(self).")},
+
+ {"replace", _PyCFunction_CAST(datetime_replace), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("Return datetime with new specified fields.")},
+
+ {"astimezone", _PyCFunction_CAST(datetime_astimezone), METH_VARARGS | METH_KEYWORDS,
+ PyDoc_STR("tz -> convert to local time in new timezone tz\n")},
+
+ {"__reduce_ex__", (PyCFunction)datetime_reduce_ex, METH_VARARGS,
+ PyDoc_STR("__reduce_ex__(proto) -> (cls, state)")},
+
+ {"__reduce__", (PyCFunction)datetime_reduce, METH_NOARGS,
+ PyDoc_STR("__reduce__() -> (cls, state)")},
+
+ {NULL, NULL}
+};
+
+static const char datetime_doc[] =
+PyDoc_STR("datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\
+\n\
+The year, month and day arguments are required. tzinfo may be None, or an\n\
+instance of a tzinfo subclass. The remaining arguments may be ints.\n");
+
+static PyNumberMethods datetime_as_number = {
+ datetime_add, /* nb_add */
+ datetime_subtract, /* nb_subtract */
+ 0, /* nb_multiply */
+ 0, /* nb_remainder */
+ 0, /* nb_divmod */
+ 0, /* nb_power */
+ 0, /* nb_negative */
+ 0, /* nb_positive */
+ 0, /* nb_absolute */
+ 0, /* nb_bool */
+};
+
+static PyTypeObject PyDateTime_DateTimeType = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "datetime.datetime", /* tp_name */
+ sizeof(PyDateTime_DateTime), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)datetime_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc)datetime_repr, /* tp_repr */
+ &datetime_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)datetime_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc)datetime_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ datetime_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ datetime_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ datetime_methods, /* tp_methods */
+ 0, /* tp_members */
+ datetime_getset, /* tp_getset */
+ 0, /* tp_base; filled in
+ PyInit__datetime */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ datetime_alloc, /* tp_alloc */
+ datetime_new, /* tp_new */
+ 0, /* tp_free */
+};
+
+/* ---------------------------------------------------------------------------
+ * Module methods and initialization.
+ */
+
+static PyMethodDef module_methods[] = {
+ {NULL, NULL}
+};
+
+/* Get a new C API by calling this function.
+ * Clients get at C API via PyDateTime_IMPORT, defined in datetime.h.
+ */
+static inline PyDateTime_CAPI *
+get_datetime_capi(void)
+{
+ PyDateTime_CAPI *capi = PyMem_Malloc(sizeof(PyDateTime_CAPI));
+ if (capi == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ capi->DateType = &PyDateTime_DateType;
+ capi->DateTimeType = &PyDateTime_DateTimeType;
+ capi->TimeType = &PyDateTime_TimeType;
+ capi->DeltaType = &PyDateTime_DeltaType;
+ capi->TZInfoType = &PyDateTime_TZInfoType;
+ capi->Date_FromDate = new_date_ex;
+ capi->DateTime_FromDateAndTime = new_datetime_ex;
+ capi->Time_FromTime = new_time_ex;
+ capi->Delta_FromDelta = new_delta_ex;
+ capi->TimeZone_FromTimeZone = new_timezone;
+ capi->DateTime_FromTimestamp = datetime_fromtimestamp;
+ capi->Date_FromTimestamp = datetime_date_fromtimestamp_capi;
+ capi->DateTime_FromDateAndTimeAndFold = new_datetime_ex2;
+ capi->Time_FromTimeAndFold = new_time_ex2;
+ // Make sure this function is called after PyDateTime_TimeZone_UTC has
+ // been initialized.
+ assert(PyDateTime_TimeZone_UTC != NULL);
+ capi->TimeZone_UTC = PyDateTime_TimeZone_UTC; // borrowed ref
+ return capi;
+}
+
+static void
+datetime_destructor(PyObject *op)
+{
+ void *ptr = PyCapsule_GetPointer(op, PyDateTime_CAPSULE_NAME);
+ PyMem_Free(ptr);
+}
+
+static int
+_datetime_exec(PyObject *module)
+{
+ // `&...` is not a constant expression according to a strict reading
+ // of C standards. Fill tp_base at run-time rather than statically.
+ // See https://bugs.python.org/issue40777
+ PyDateTime_IsoCalendarDateType.tp_base = &PyTuple_Type;
+ PyDateTime_TimeZoneType.tp_base = &PyDateTime_TZInfoType;
+ PyDateTime_DateTimeType.tp_base = &PyDateTime_DateType;
+
+ PyTypeObject *types[] = {
+ &PyDateTime_DateType,
+ &PyDateTime_DateTimeType,
+ &PyDateTime_TimeType,
+ &PyDateTime_DeltaType,
+ &PyDateTime_TZInfoType,
+ &PyDateTime_TimeZoneType,
+ };
+
+ for (size_t i = 0; i < Py_ARRAY_LENGTH(types); i++) {
+ if (PyModule_AddType(module, types[i]) < 0) {
+ return -1;
+ }
+ }
+
+ if (PyType_Ready(&PyDateTime_IsoCalendarDateType) < 0) {
+ return -1;
+ }
+
+#define DATETIME_ADD_MACRO(dict, c, value_expr) \
+ do { \
+ PyObject *value = (value_expr); \
+ if (value == NULL) { \
+ return -1; \
+ } \
+ if (PyDict_SetItemString(dict, c, value) < 0) { \
+ Py_DECREF(value); \
+ return -1; \
+ } \
+ Py_DECREF(value); \
+ } while(0)
+
+ /* timedelta values */
+ PyObject *d = PyDateTime_DeltaType.tp_dict;
+ DATETIME_ADD_MACRO(d, "resolution", new_delta(0, 0, 1, 0));
+ DATETIME_ADD_MACRO(d, "min", new_delta(-MAX_DELTA_DAYS, 0, 0, 0));
+ DATETIME_ADD_MACRO(d, "max",
+ new_delta(MAX_DELTA_DAYS, 24*3600-1, 1000000-1, 0));
+
+ /* date values */
+ d = PyDateTime_DateType.tp_dict;
+ DATETIME_ADD_MACRO(d, "min", new_date(1, 1, 1));
+ DATETIME_ADD_MACRO(d, "max", new_date(MAXYEAR, 12, 31));
+ DATETIME_ADD_MACRO(d, "resolution", new_delta(1, 0, 0, 0));
+
+ /* time values */
+ d = PyDateTime_TimeType.tp_dict;
+ DATETIME_ADD_MACRO(d, "min", new_time(0, 0, 0, 0, Py_None, 0));
+ DATETIME_ADD_MACRO(d, "max", new_time(23, 59, 59, 999999, Py_None, 0));
+ DATETIME_ADD_MACRO(d, "resolution", new_delta(0, 0, 1, 0));
+
+ /* datetime values */
+ d = PyDateTime_DateTimeType.tp_dict;
+ DATETIME_ADD_MACRO(d, "min",
+ new_datetime(1, 1, 1, 0, 0, 0, 0, Py_None, 0));
+ DATETIME_ADD_MACRO(d, "max", new_datetime(MAXYEAR, 12, 31, 23, 59, 59,
+ 999999, Py_None, 0));
+ DATETIME_ADD_MACRO(d, "resolution", new_delta(0, 0, 1, 0));
+
+ /* timezone values */
+ d = PyDateTime_TimeZoneType.tp_dict;
+ PyObject *delta = new_delta(0, 0, 0, 0);
+ if (delta == NULL) {
+ return -1;
+ }
+
+ PyObject *x = create_timezone(delta, NULL);
+ Py_DECREF(delta);
+ if (x == NULL) {
+ return -1;
+ }
+ if (PyDict_SetItemString(d, "utc", x) < 0) {
+ Py_DECREF(x);
+ return -1;
+ }
+
+ PyDateTime_TimeZone_UTC = x;
+
+ /* bpo-37642: These attributes are rounded to the nearest minute for backwards
+ * compatibility, even though the constructor will accept a wider range of
+ * values. This may change in the future.*/
+ delta = new_delta(-1, 60, 0, 1); /* -23:59 */
+ if (delta == NULL) {
+ return -1;
+ }
+
+ x = create_timezone(delta, NULL);
+ Py_DECREF(delta);
+ DATETIME_ADD_MACRO(d, "min", x);
+
+ delta = new_delta(0, (23 * 60 + 59) * 60, 0, 0); /* +23:59 */
+ if (delta == NULL) {
+ return -1;
+ }
+
+ x = create_timezone(delta, NULL);
+ Py_DECREF(delta);
+ DATETIME_ADD_MACRO(d, "max", x);
+
+ /* Epoch */
+ PyDateTime_Epoch = new_datetime(1970, 1, 1, 0, 0, 0, 0,
+ PyDateTime_TimeZone_UTC, 0);
+ if (PyDateTime_Epoch == NULL) {
+ return -1;
+ }
+
+ /* module initialization */
+ if (PyModule_AddIntMacro(module, MINYEAR) < 0) {
+ return -1;
+ }
+ if (PyModule_AddIntMacro(module, MAXYEAR) < 0) {
+ return -1;
+ }
+
+ PyDateTime_CAPI *capi = get_datetime_capi();
+ if (capi == NULL) {
+ return -1;
+ }
+ x = PyCapsule_New(capi, PyDateTime_CAPSULE_NAME, datetime_destructor);
+ if (x == NULL) {
+ PyMem_Free(capi);
+ return -1;
+ }
+
+ if (PyModule_AddObject(module, "datetime_CAPI", x) < 0) {
+ Py_DECREF(x);
+ return -1;
+ }
+
+ if (PyModule_AddObjectRef(module, "UTC", PyDateTime_TimeZone_UTC) < 0) {
+ return -1;
+ }
+
+ /* A 4-year cycle has an extra leap day over what we'd get from
+ * pasting together 4 single years.
+ */
+ static_assert(DI4Y == 4 * 365 + 1, "DI4Y");
+ assert(DI4Y == days_before_year(4+1));
+
+ /* Similarly, a 400-year cycle has an extra leap day over what we'd
+ * get from pasting together 4 100-year cycles.
+ */
+ static_assert(DI400Y == 4 * DI100Y + 1, "DI400Y");
+ assert(DI400Y == days_before_year(400+1));
+
+ /* OTOH, a 100-year cycle has one fewer leap day than we'd get from
+ * pasting together 25 4-year cycles.
+ */
+ static_assert(DI100Y == 25 * DI4Y - 1, "DI100Y");
+ assert(DI100Y == days_before_year(100+1));
+
+ us_per_ms = PyLong_FromLong(1000);
+ if (us_per_ms == NULL) {
+ goto error;
+ }
+ us_per_second = PyLong_FromLong(1000000);
+ if (us_per_second == NULL) {
+ goto error;
+ }
+ us_per_minute = PyLong_FromLong(60000000);
+ if (us_per_minute == NULL) {
+ goto error;
+ }
+ seconds_per_day = PyLong_FromLong(24 * 3600);
+ if (seconds_per_day == NULL) {
+ goto error;
+ }
+
+ /* The rest are too big for 32-bit ints, but even
+ * us_per_week fits in 40 bits, so doubles should be exact.
+ */
+ us_per_hour = PyLong_FromDouble(3600000000.0);
+ if (us_per_hour == NULL) {
+ goto error;
+ }
+ us_per_day = PyLong_FromDouble(86400000000.0);
+ if (us_per_day == NULL) {
+ goto error;
+ }
+ us_per_week = PyLong_FromDouble(604800000000.0);
+ if (us_per_week == NULL) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ Py_XDECREF(us_per_ms);
+ Py_XDECREF(us_per_second);
+ Py_XDECREF(us_per_minute);
+ Py_XDECREF(us_per_hour);
+ Py_XDECREF(us_per_day);
+ Py_XDECREF(us_per_week);
+ Py_XDECREF(seconds_per_day);
+ return -1;
+}
+
+static struct PyModuleDef datetimemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_datetime",
+ .m_doc = "Fast implementation of the datetime type.",
+ .m_size = -1,
+ .m_methods = module_methods,
+};
+
+PyMODINIT_FUNC
+PyInit__datetime(void)
+{
+ PyObject *mod = PyModule_Create(&datetimemodule);
+ if (mod == NULL)
+ return NULL;
+
+ if (_datetime_exec(mod) < 0) {
+ Py_DECREF(mod);
+ return NULL;
+ }
+
+ return mod;
+}
+
+/* ---------------------------------------------------------------------------
+Some time zone algebra. For a datetime x, let
+ x.n = x stripped of its timezone -- its naive time.
+ x.o = x.utcoffset(), and assuming that doesn't raise an exception or
+ return None
+ x.d = x.dst(), and assuming that doesn't raise an exception or
+ return None
+ x.s = x's standard offset, x.o - x.d
+
+Now some derived rules, where k is a duration (timedelta).
+
+1. x.o = x.s + x.d
+ This follows from the definition of x.s.
+
+2. If x and y have the same tzinfo member, x.s = y.s.
+ This is actually a requirement, an assumption we need to make about
+ sane tzinfo classes.
+
+3. The naive UTC time corresponding to x is x.n - x.o.
+ This is again a requirement for a sane tzinfo class.
+
+4. (x+k).s = x.s
+ This follows from #2, and that datimetimetz+timedelta preserves tzinfo.
+
+5. (x+k).n = x.n + k
+ Again follows from how arithmetic is defined.
+
+Now we can explain tz.fromutc(x). Let's assume it's an interesting case
+(meaning that the various tzinfo methods exist, and don't blow up or return
+None when called).
+
+The function wants to return a datetime y with timezone tz, equivalent to x.
+x is already in UTC.
+
+By #3, we want
+
+ y.n - y.o = x.n [1]
+
+The algorithm starts by attaching tz to x.n, and calling that y. So
+x.n = y.n at the start. Then it wants to add a duration k to y, so that [1]
+becomes true; in effect, we want to solve [2] for k:
+
+ (y+k).n - (y+k).o = x.n [2]
+
+By #1, this is the same as
+
+ (y+k).n - ((y+k).s + (y+k).d) = x.n [3]
+
+By #5, (y+k).n = y.n + k, which equals x.n + k because x.n=y.n at the start.
+Substituting that into [3],
+
+ x.n + k - (y+k).s - (y+k).d = x.n; the x.n terms cancel, leaving
+ k - (y+k).s - (y+k).d = 0; rearranging,
+ k = (y+k).s - (y+k).d; by #4, (y+k).s == y.s, so
+ k = y.s - (y+k).d
+
+On the RHS, (y+k).d can't be computed directly, but y.s can be, and we
+approximate k by ignoring the (y+k).d term at first. Note that k can't be
+very large, since all offset-returning methods return a duration of magnitude
+less than 24 hours. For that reason, if y is firmly in std time, (y+k).d must
+be 0, so ignoring it has no consequence then.
+
+In any case, the new value is
+
+ z = y + y.s [4]
+
+It's helpful to step back at look at [4] from a higher level: it's simply
+mapping from UTC to tz's standard time.
+
+At this point, if
+
+ z.n - z.o = x.n [5]
+
+we have an equivalent time, and are almost done. The insecurity here is
+at the start of daylight time. Picture US Eastern for concreteness. The wall
+time jumps from 1:59 to 3:00, and wall hours of the form 2:MM don't make good
+sense then. The docs ask that an Eastern tzinfo class consider such a time to
+be EDT (because it's "after 2"), which is a redundant spelling of 1:MM EST
+on the day DST starts. We want to return the 1:MM EST spelling because that's
+the only spelling that makes sense on the local wall clock.
+
+In fact, if [5] holds at this point, we do have the standard-time spelling,
+but that takes a bit of proof. We first prove a stronger result. What's the
+difference between the LHS and RHS of [5]? Let
+
+ diff = x.n - (z.n - z.o) [6]
+
+Now
+ z.n = by [4]
+ (y + y.s).n = by #5
+ y.n + y.s = since y.n = x.n
+ x.n + y.s = since z and y are have the same tzinfo member,
+ y.s = z.s by #2
+ x.n + z.s
+
+Plugging that back into [6] gives
+
+ diff =
+ x.n - ((x.n + z.s) - z.o) = expanding
+ x.n - x.n - z.s + z.o = cancelling
+ - z.s + z.o = by #2
+ z.d
+
+So diff = z.d.
+
+If [5] is true now, diff = 0, so z.d = 0 too, and we have the standard-time
+spelling we wanted in the endcase described above. We're done. Contrarily,
+if z.d = 0, then we have a UTC equivalent, and are also done.
+
+If [5] is not true now, diff = z.d != 0, and z.d is the offset we need to
+add to z (in effect, z is in tz's standard time, and we need to shift the
+local clock into tz's daylight time).
+
+Let
+
+ z' = z + z.d = z + diff [7]
+
+and we can again ask whether
+
+ z'.n - z'.o = x.n [8]
+
+If so, we're done. If not, the tzinfo class is insane, according to the
+assumptions we've made. This also requires a bit of proof. As before, let's
+compute the difference between the LHS and RHS of [8] (and skipping some of
+the justifications for the kinds of substitutions we've done several times
+already):
+
+ diff' = x.n - (z'.n - z'.o) = replacing z'.n via [7]
+ x.n - (z.n + diff - z'.o) = replacing diff via [6]
+ x.n - (z.n + x.n - (z.n - z.o) - z'.o) =
+ x.n - z.n - x.n + z.n - z.o + z'.o = cancel x.n
+ - z.n + z.n - z.o + z'.o = cancel z.n
+ - z.o + z'.o = #1 twice
+ -z.s - z.d + z'.s + z'.d = z and z' have same tzinfo
+ z'.d - z.d
+
+So z' is UTC-equivalent to x iff z'.d = z.d at this point. If they are equal,
+we've found the UTC-equivalent so are done. In fact, we stop with [7] and
+return z', not bothering to compute z'.d.
+
+How could z.d and z'd differ? z' = z + z.d [7], so merely moving z' by
+a dst() offset, and starting *from* a time already in DST (we know z.d != 0),
+would have to change the result dst() returns: we start in DST, and moving
+a little further into it takes us out of DST.
+
+There isn't a sane case where this can happen. The closest it gets is at
+the end of DST, where there's an hour in UTC with no spelling in a hybrid
+tzinfo class. In US Eastern, that's 5:MM UTC = 0:MM EST = 1:MM EDT. During
+that hour, on an Eastern clock 1:MM is taken as being in standard time (6:MM
+UTC) because the docs insist on that, but 0:MM is taken as being in daylight
+time (4:MM UTC). There is no local time mapping to 5:MM UTC. The local
+clock jumps from 1:59 back to 1:00 again, and repeats the 1:MM hour in
+standard time. Since that's what the local clock *does*, we want to map both
+UTC hours 5:MM and 6:MM to 1:MM Eastern. The result is ambiguous
+in local time, but so it goes -- it's the way the local clock works.
+
+When x = 5:MM UTC is the input to this algorithm, x.o=0, y.o=-5 and y.d=0,
+so z=0:MM. z.d=60 (minutes) then, so [5] doesn't hold and we keep going.
+z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8]
+(correctly) concludes that z' is not UTC-equivalent to x.
+
+Because we know z.d said z was in daylight time (else [5] would have held and
+we would have stopped then), and we know z.d != z'.d (else [8] would have held
+and we would have stopped then), and there are only 2 possible values dst() can
+return in Eastern, it follows that z'.d must be 0 (which it is in the example,
+but the reasoning doesn't depend on the example -- it depends on there being
+two possible dst() outcomes, one zero and the other non-zero). Therefore
+z' must be in standard time, and is the spelling we want in this case.
+
+Note again that z' is not UTC-equivalent as far as the hybrid tzinfo class is
+concerned (because it takes z' as being in standard time rather than the
+daylight time we intend here), but returning it gives the real-life "local
+clock repeats an hour" behavior when mapping the "unspellable" UTC hour into
+tz.
+
+When the input is 6:MM, z=1:MM and z.d=0, and we stop at once, again with
+the 1:MM standard time spelling we want.
+
+So how can this break? One of the assumptions must be violated. Two
+possibilities:
+
+1) [2] effectively says that y.s is invariant across all y belong to a given
+ time zone. This isn't true if, for political reasons or continental drift,
+ a region decides to change its base offset from UTC.
+
+2) There may be versions of "double daylight" time where the tail end of
+ the analysis gives up a step too early. I haven't thought about that
+ enough to say.
+
+In any case, it's clear that the default fromutc() is strong enough to handle
+"almost all" time zones: so long as the standard offset is invariant, it
+doesn't matter if daylight time transition points change from year to year, or
+if daylight time is skipped in some years; it doesn't matter how large or
+small dst() may get within its bounds; and it doesn't even matter if some
+perverse time zone returns a negative dst()). So a breaking case must be
+pretty bizarre, and a tzinfo subclass can override fromutc() if it is.
+--------------------------------------------------------------------------- */
diff --git a/contrib/tools/python3/Modules/_decimal/_decimal.c b/contrib/tools/python3/Modules/_decimal/_decimal.c
new file mode 100644
index 00000000000..70b13982bb0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/_decimal.c
@@ -0,0 +1,6056 @@
+/*
+ * Copyright (c) 2008-2012 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include <Python.h>
+#include "pycore_long.h" // _PyLong_IsZero()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "complexobject.h"
+#include "mpdecimal.h"
+
+#include <stdlib.h>
+
+#include "docstrings.h"
+
+
+#if !defined(MPD_VERSION_HEX) || MPD_VERSION_HEX < 0x02050000
+ #error "libmpdec version >= 2.5.0 required"
+#endif
+
+
+/*
+ * Type sizes with assertions in mpdecimal.h and pyport.h:
+ * sizeof(size_t) == sizeof(Py_ssize_t)
+ * sizeof(size_t) == sizeof(mpd_uint_t) == sizeof(mpd_ssize_t)
+ */
+
+#ifdef TEST_COVERAGE
+ #undef Py_LOCAL_INLINE
+ #define Py_LOCAL_INLINE Py_LOCAL
+#endif
+
+#define MPD_Float_operation MPD_Not_implemented
+
+#define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x
+
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+ #define UNUSED __attribute__((unused))
+#else
+ #define UNUSED
+#endif
+
+/* _Py_DEC_MINALLOC >= MPD_MINALLOC */
+#define _Py_DEC_MINALLOC 4
+
+typedef struct {
+ PyObject_HEAD
+ Py_hash_t hash;
+ mpd_t dec;
+ mpd_uint_t data[_Py_DEC_MINALLOC];
+} PyDecObject;
+
+typedef struct {
+ PyObject_HEAD
+ uint32_t *flags;
+} PyDecSignalDictObject;
+
+typedef struct {
+ PyObject_HEAD
+ mpd_context_t ctx;
+ PyObject *traps;
+ PyObject *flags;
+ int capitals;
+ PyThreadState *tstate;
+} PyDecContextObject;
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *local;
+ PyObject *global;
+} PyDecContextManagerObject;
+
+
+#undef MPD
+#undef CTX
+static PyTypeObject PyDec_Type;
+static PyTypeObject *PyDecSignalDict_Type;
+static PyTypeObject PyDecContext_Type;
+static PyTypeObject PyDecContextManager_Type;
+#define PyDec_CheckExact(v) Py_IS_TYPE(v, &PyDec_Type)
+#define PyDec_Check(v) PyObject_TypeCheck(v, &PyDec_Type)
+#define PyDecSignalDict_Check(v) Py_IS_TYPE(v, PyDecSignalDict_Type)
+#define PyDecContext_Check(v) PyObject_TypeCheck(v, &PyDecContext_Type)
+#define MPD(v) (&((PyDecObject *)v)->dec)
+#define SdFlagAddr(v) (((PyDecSignalDictObject *)v)->flags)
+#define SdFlags(v) (*((PyDecSignalDictObject *)v)->flags)
+#define CTX(v) (&((PyDecContextObject *)v)->ctx)
+#define CtxCaps(v) (((PyDecContextObject *)v)->capitals)
+
+
+Py_LOCAL_INLINE(PyObject *)
+incr_true(void)
+{
+ return Py_NewRef(Py_True);
+}
+
+Py_LOCAL_INLINE(PyObject *)
+incr_false(void)
+{
+ return Py_NewRef(Py_False);
+}
+
+
+#ifndef WITH_DECIMAL_CONTEXTVAR
+/* Key for thread state dictionary */
+static PyObject *tls_context_key = NULL;
+/* Invariant: NULL or the most recently accessed thread local context */
+static PyDecContextObject *cached_context = NULL;
+#else
+static PyObject *current_context_var = NULL;
+#endif
+
+/* Template for creating new thread contexts, calling Context() without
+ * arguments and initializing the module_context on first access. */
+static PyObject *default_context_template = NULL;
+/* Basic and extended context templates */
+static PyObject *basic_context_template = NULL;
+static PyObject *extended_context_template = NULL;
+
+
+/* Error codes for functions that return signals or conditions */
+#define DEC_INVALID_SIGNALS (MPD_Max_status+1U)
+#define DEC_ERR_OCCURRED (DEC_INVALID_SIGNALS<<1)
+#define DEC_ERRORS (DEC_INVALID_SIGNALS|DEC_ERR_OCCURRED)
+
+typedef struct {
+ const char *name; /* condition or signal name */
+ const char *fqname; /* fully qualified name */
+ uint32_t flag; /* libmpdec flag */
+ PyObject *ex; /* corresponding exception */
+} DecCondMap;
+
+/* Top level Exception; inherits from ArithmeticError */
+static PyObject *DecimalException = NULL;
+
+/* Exceptions that correspond to IEEE signals */
+#define SUBNORMAL 5
+#define INEXACT 6
+#define ROUNDED 7
+#define SIGNAL_MAP_LEN 9
+static DecCondMap signal_map[] = {
+ {"InvalidOperation", "decimal.InvalidOperation", MPD_IEEE_Invalid_operation, NULL},
+ {"FloatOperation", "decimal.FloatOperation", MPD_Float_operation, NULL},
+ {"DivisionByZero", "decimal.DivisionByZero", MPD_Division_by_zero, NULL},
+ {"Overflow", "decimal.Overflow", MPD_Overflow, NULL},
+ {"Underflow", "decimal.Underflow", MPD_Underflow, NULL},
+ {"Subnormal", "decimal.Subnormal", MPD_Subnormal, NULL},
+ {"Inexact", "decimal.Inexact", MPD_Inexact, NULL},
+ {"Rounded", "decimal.Rounded", MPD_Rounded, NULL},
+ {"Clamped", "decimal.Clamped", MPD_Clamped, NULL},
+ {NULL}
+};
+
+/* Exceptions that inherit from InvalidOperation */
+static DecCondMap cond_map[] = {
+ {"InvalidOperation", "decimal.InvalidOperation", MPD_Invalid_operation, NULL},
+ {"ConversionSyntax", "decimal.ConversionSyntax", MPD_Conversion_syntax, NULL},
+ {"DivisionImpossible", "decimal.DivisionImpossible", MPD_Division_impossible, NULL},
+ {"DivisionUndefined", "decimal.DivisionUndefined", MPD_Division_undefined, NULL},
+ {"InvalidContext", "decimal.InvalidContext", MPD_Invalid_context, NULL},
+#ifdef EXTRA_FUNCTIONALITY
+ {"MallocError", "decimal.MallocError", MPD_Malloc_error, NULL},
+#endif
+ {NULL}
+};
+
+static const char *dec_signal_string[MPD_NUM_FLAGS] = {
+ "Clamped",
+ "InvalidOperation",
+ "DivisionByZero",
+ "InvalidOperation",
+ "InvalidOperation",
+ "InvalidOperation",
+ "Inexact",
+ "InvalidOperation",
+ "InvalidOperation",
+ "InvalidOperation",
+ "FloatOperation",
+ "Overflow",
+ "Rounded",
+ "Subnormal",
+ "Underflow",
+};
+
+#ifdef EXTRA_FUNCTIONALITY
+ #define _PY_DEC_ROUND_GUARD MPD_ROUND_GUARD
+#else
+ #define _PY_DEC_ROUND_GUARD (MPD_ROUND_GUARD-1)
+#endif
+static PyObject *round_map[_PY_DEC_ROUND_GUARD];
+
+static const char *invalid_rounding_err =
+"valid values for rounding are:\n\
+ [ROUND_CEILING, ROUND_FLOOR, ROUND_UP, ROUND_DOWN,\n\
+ ROUND_HALF_UP, ROUND_HALF_DOWN, ROUND_HALF_EVEN,\n\
+ ROUND_05UP]";
+
+static const char *invalid_signals_err =
+"valid values for signals are:\n\
+ [InvalidOperation, FloatOperation, DivisionByZero,\n\
+ Overflow, Underflow, Subnormal, Inexact, Rounded,\n\
+ Clamped]";
+
+#ifdef EXTRA_FUNCTIONALITY
+static const char *invalid_flags_err =
+"valid values for _flags or _traps are:\n\
+ signals:\n\
+ [DecIEEEInvalidOperation, DecFloatOperation, DecDivisionByZero,\n\
+ DecOverflow, DecUnderflow, DecSubnormal, DecInexact, DecRounded,\n\
+ DecClamped]\n\
+ conditions which trigger DecIEEEInvalidOperation:\n\
+ [DecInvalidOperation, DecConversionSyntax, DecDivisionImpossible,\n\
+ DecDivisionUndefined, DecFpuError, DecInvalidContext, DecMallocError]";
+#endif
+
+static int
+value_error_int(const char *mesg)
+{
+ PyErr_SetString(PyExc_ValueError, mesg);
+ return -1;
+}
+
+static PyObject *
+value_error_ptr(const char *mesg)
+{
+ PyErr_SetString(PyExc_ValueError, mesg);
+ return NULL;
+}
+
+static int
+type_error_int(const char *mesg)
+{
+ PyErr_SetString(PyExc_TypeError, mesg);
+ return -1;
+}
+
+static int
+runtime_error_int(const char *mesg)
+{
+ PyErr_SetString(PyExc_RuntimeError, mesg);
+ return -1;
+}
+#define INTERNAL_ERROR_INT(funcname) \
+ return runtime_error_int("internal error in " funcname)
+
+static PyObject *
+runtime_error_ptr(const char *mesg)
+{
+ PyErr_SetString(PyExc_RuntimeError, mesg);
+ return NULL;
+}
+#define INTERNAL_ERROR_PTR(funcname) \
+ return runtime_error_ptr("internal error in " funcname)
+
+static void
+dec_traphandler(mpd_context_t *ctx UNUSED) /* GCOV_NOT_REACHED */
+{ /* GCOV_NOT_REACHED */
+ return; /* GCOV_NOT_REACHED */
+}
+
+static PyObject *
+flags_as_exception(uint32_t flags)
+{
+ DecCondMap *cm;
+
+ for (cm = signal_map; cm->name != NULL; cm++) {
+ if (flags&cm->flag) {
+ return cm->ex;
+ }
+ }
+
+ INTERNAL_ERROR_PTR("flags_as_exception"); /* GCOV_NOT_REACHED */
+}
+
+Py_LOCAL_INLINE(uint32_t)
+exception_as_flag(PyObject *ex)
+{
+ DecCondMap *cm;
+
+ for (cm = signal_map; cm->name != NULL; cm++) {
+ if (cm->ex == ex) {
+ return cm->flag;
+ }
+ }
+
+ PyErr_SetString(PyExc_KeyError, invalid_signals_err);
+ return DEC_INVALID_SIGNALS;
+}
+
+static PyObject *
+flags_as_list(uint32_t flags)
+{
+ PyObject *list;
+ DecCondMap *cm;
+
+ list = PyList_New(0);
+ if (list == NULL) {
+ return NULL;
+ }
+
+ for (cm = cond_map; cm->name != NULL; cm++) {
+ if (flags&cm->flag) {
+ if (PyList_Append(list, cm->ex) < 0) {
+ goto error;
+ }
+ }
+ }
+ for (cm = signal_map+1; cm->name != NULL; cm++) {
+ if (flags&cm->flag) {
+ if (PyList_Append(list, cm->ex) < 0) {
+ goto error;
+ }
+ }
+ }
+
+ return list;
+
+error:
+ Py_DECREF(list);
+ return NULL;
+}
+
+static PyObject *
+signals_as_list(uint32_t flags)
+{
+ PyObject *list;
+ DecCondMap *cm;
+
+ list = PyList_New(0);
+ if (list == NULL) {
+ return NULL;
+ }
+
+ for (cm = signal_map; cm->name != NULL; cm++) {
+ if (flags&cm->flag) {
+ if (PyList_Append(list, cm->ex) < 0) {
+ Py_DECREF(list);
+ return NULL;
+ }
+ }
+ }
+
+ return list;
+}
+
+static uint32_t
+list_as_flags(PyObject *list)
+{
+ PyObject *item;
+ uint32_t flags, x;
+ Py_ssize_t n, j;
+
+ assert(PyList_Check(list));
+
+ n = PyList_Size(list);
+ flags = 0;
+ for (j = 0; j < n; j++) {
+ item = PyList_GetItem(list, j);
+ x = exception_as_flag(item);
+ if (x & DEC_ERRORS) {
+ return x;
+ }
+ flags |= x;
+ }
+
+ return flags;
+}
+
+static PyObject *
+flags_as_dict(uint32_t flags)
+{
+ DecCondMap *cm;
+ PyObject *dict;
+
+ dict = PyDict_New();
+ if (dict == NULL) {
+ return NULL;
+ }
+
+ for (cm = signal_map; cm->name != NULL; cm++) {
+ PyObject *b = flags&cm->flag ? Py_True : Py_False;
+ if (PyDict_SetItem(dict, cm->ex, b) < 0) {
+ Py_DECREF(dict);
+ return NULL;
+ }
+ }
+
+ return dict;
+}
+
+static uint32_t
+dict_as_flags(PyObject *val)
+{
+ PyObject *b;
+ DecCondMap *cm;
+ uint32_t flags = 0;
+ int x;
+
+ if (!PyDict_Check(val)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must be a signal dict");
+ return DEC_INVALID_SIGNALS;
+ }
+
+ if (PyDict_Size(val) != SIGNAL_MAP_LEN) {
+ PyErr_SetString(PyExc_KeyError,
+ "invalid signal dict");
+ return DEC_INVALID_SIGNALS;
+ }
+
+ for (cm = signal_map; cm->name != NULL; cm++) {
+ b = PyDict_GetItemWithError(val, cm->ex);
+ if (b == NULL) {
+ if (PyErr_Occurred()) {
+ return DEC_ERR_OCCURRED;
+ }
+ PyErr_SetString(PyExc_KeyError,
+ "invalid signal dict");
+ return DEC_INVALID_SIGNALS;
+ }
+
+ x = PyObject_IsTrue(b);
+ if (x < 0) {
+ return DEC_ERR_OCCURRED;
+ }
+ if (x == 1) {
+ flags |= cm->flag;
+ }
+ }
+
+ return flags;
+}
+
+#ifdef EXTRA_FUNCTIONALITY
+static uint32_t
+long_as_flags(PyObject *v)
+{
+ long x;
+
+ x = PyLong_AsLong(v);
+ if (x == -1 && PyErr_Occurred()) {
+ return DEC_ERR_OCCURRED;
+ }
+ if (x < 0 || x > (long)MPD_Max_status) {
+ PyErr_SetString(PyExc_TypeError, invalid_flags_err);
+ return DEC_INVALID_SIGNALS;
+ }
+
+ return x;
+}
+#endif
+
+static int
+dec_addstatus(PyObject *context, uint32_t status)
+{
+ mpd_context_t *ctx = CTX(context);
+
+ ctx->status |= status;
+ if (status & (ctx->traps|MPD_Malloc_error)) {
+ PyObject *ex, *siglist;
+
+ if (status & MPD_Malloc_error) {
+ PyErr_NoMemory();
+ return 1;
+ }
+
+ ex = flags_as_exception(ctx->traps&status);
+ if (ex == NULL) {
+ return 1; /* GCOV_NOT_REACHED */
+ }
+ siglist = flags_as_list(ctx->traps&status);
+ if (siglist == NULL) {
+ return 1;
+ }
+
+ PyErr_SetObject(ex, siglist);
+ Py_DECREF(siglist);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+getround(PyObject *v)
+{
+ int i;
+
+ if (PyUnicode_Check(v)) {
+ for (i = 0; i < _PY_DEC_ROUND_GUARD; i++) {
+ if (v == round_map[i]) {
+ return i;
+ }
+ }
+ for (i = 0; i < _PY_DEC_ROUND_GUARD; i++) {
+ if (PyUnicode_Compare(v, round_map[i]) == 0) {
+ return i;
+ }
+ }
+ }
+
+ return type_error_int(invalid_rounding_err);
+}
+
+
+/******************************************************************************/
+/* SignalDict Object */
+/******************************************************************************/
+
+/* The SignalDict is a MutableMapping that provides access to the
+ mpd_context_t flags, which reside in the context object. When a
+ new context is created, context.traps and context.flags are
+ initialized to new SignalDicts. Once a SignalDict is tied to
+ a context, it cannot be deleted. */
+
+static const char *INVALID_SIGNALDICT_ERROR_MSG = "invalid signal dict";
+
+static int
+signaldict_init(PyObject *self, PyObject *args UNUSED, PyObject *kwds UNUSED)
+{
+ SdFlagAddr(self) = NULL;
+ return 0;
+}
+
+static Py_ssize_t
+signaldict_len(PyObject *self)
+{
+ if (SdFlagAddr(self) == NULL) {
+ return value_error_int(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+ return SIGNAL_MAP_LEN;
+}
+
+static PyObject *SignalTuple;
+static PyObject *
+signaldict_iter(PyObject *self UNUSED)
+{
+ if (SdFlagAddr(self) == NULL) {
+ return value_error_ptr(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+ return PyTuple_Type.tp_iter(SignalTuple);
+}
+
+static PyObject *
+signaldict_getitem(PyObject *self, PyObject *key)
+{
+ uint32_t flag;
+ if (SdFlagAddr(self) == NULL) {
+ return value_error_ptr(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+
+ flag = exception_as_flag(key);
+ if (flag & DEC_ERRORS) {
+ return NULL;
+ }
+
+ return SdFlags(self)&flag ? incr_true() : incr_false();
+}
+
+static int
+signaldict_setitem(PyObject *self, PyObject *key, PyObject *value)
+{
+ uint32_t flag;
+ int x;
+
+ if (SdFlagAddr(self) == NULL) {
+ return value_error_int(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+
+ if (value == NULL) {
+ return value_error_int("signal keys cannot be deleted");
+ }
+
+ flag = exception_as_flag(key);
+ if (flag & DEC_ERRORS) {
+ return -1;
+ }
+
+ x = PyObject_IsTrue(value);
+ if (x < 0) {
+ return -1;
+ }
+
+ if (x == 1) {
+ SdFlags(self) |= flag;
+ }
+ else {
+ SdFlags(self) &= ~flag;
+ }
+
+ return 0;
+}
+
+static PyObject *
+signaldict_repr(PyObject *self)
+{
+ DecCondMap *cm;
+ const char *n[SIGNAL_MAP_LEN]; /* name */
+ const char *b[SIGNAL_MAP_LEN]; /* bool */
+ int i;
+
+ if (SdFlagAddr(self) == NULL) {
+ return value_error_ptr(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+
+ assert(SIGNAL_MAP_LEN == 9);
+
+ for (cm=signal_map, i=0; cm->name != NULL; cm++, i++) {
+ n[i] = cm->fqname;
+ b[i] = SdFlags(self)&cm->flag ? "True" : "False";
+ }
+ return PyUnicode_FromFormat(
+ "{<class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, "
+ "<class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, "
+ "<class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s}",
+ n[0], b[0], n[1], b[1], n[2], b[2],
+ n[3], b[3], n[4], b[4], n[5], b[5],
+ n[6], b[6], n[7], b[7], n[8], b[8]);
+}
+
+static PyObject *
+signaldict_richcompare(PyObject *v, PyObject *w, int op)
+{
+ PyObject *res = Py_NotImplemented;
+
+ assert(PyDecSignalDict_Check(v));
+ if ((SdFlagAddr(v) == NULL) || (SdFlagAddr(w) == NULL)) {
+ return value_error_ptr(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+
+ if (op == Py_EQ || op == Py_NE) {
+ if (PyDecSignalDict_Check(w)) {
+ res = (SdFlags(v)==SdFlags(w)) ^ (op==Py_NE) ? Py_True : Py_False;
+ }
+ else if (PyDict_Check(w)) {
+ uint32_t flags = dict_as_flags(w);
+ if (flags & DEC_ERRORS) {
+ if (flags & DEC_INVALID_SIGNALS) {
+ /* non-comparable: Py_NotImplemented */
+ PyErr_Clear();
+ }
+ else {
+ return NULL;
+ }
+ }
+ else {
+ res = (SdFlags(v)==flags) ^ (op==Py_NE) ? Py_True : Py_False;
+ }
+ }
+ }
+
+ return Py_NewRef(res);
+}
+
+static PyObject *
+signaldict_copy(PyObject *self, PyObject *args UNUSED)
+{
+ if (SdFlagAddr(self) == NULL) {
+ return value_error_ptr(INVALID_SIGNALDICT_ERROR_MSG);
+ }
+ return flags_as_dict(SdFlags(self));
+}
+
+
+static PyMappingMethods signaldict_as_mapping = {
+ (lenfunc)signaldict_len, /* mp_length */
+ (binaryfunc)signaldict_getitem, /* mp_subscript */
+ (objobjargproc)signaldict_setitem /* mp_ass_subscript */
+};
+
+static PyMethodDef signaldict_methods[] = {
+ { "copy", (PyCFunction)signaldict_copy, METH_NOARGS, NULL},
+ {NULL, NULL}
+};
+
+
+static PyTypeObject PyDecSignalDictMixin_Type =
+{
+ PyVarObject_HEAD_INIT(0, 0)
+ "decimal.SignalDictMixin", /* tp_name */
+ sizeof(PyDecSignalDictObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ 0, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ (getattrfunc) 0, /* tp_getattr */
+ (setattrfunc) 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc) signaldict_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ &signaldict_as_mapping, /* tp_as_mapping */
+ PyObject_HashNotImplemented, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc) 0, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ (setattrofunc) 0, /* tp_setattro */
+ (PyBufferProcs *) 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ signaldict_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ (getiterfunc)signaldict_iter, /* tp_iter */
+ 0, /* tp_iternext */
+ signaldict_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ (initproc)signaldict_init, /* tp_init */
+ 0, /* tp_alloc */
+ PyType_GenericNew, /* tp_new */
+};
+
+
+/******************************************************************************/
+/* Context Object, Part 1 */
+/******************************************************************************/
+
+#define Dec_CONTEXT_GET_SSIZE(mem) \
+static PyObject * \
+context_get##mem(PyObject *self, void *closure UNUSED) \
+{ \
+ return PyLong_FromSsize_t(mpd_get##mem(CTX(self))); \
+}
+
+#define Dec_CONTEXT_GET_ULONG(mem) \
+static PyObject * \
+context_get##mem(PyObject *self, void *closure UNUSED) \
+{ \
+ return PyLong_FromUnsignedLong(mpd_get##mem(CTX(self))); \
+}
+
+Dec_CONTEXT_GET_SSIZE(prec)
+Dec_CONTEXT_GET_SSIZE(emax)
+Dec_CONTEXT_GET_SSIZE(emin)
+Dec_CONTEXT_GET_SSIZE(clamp)
+
+#ifdef EXTRA_FUNCTIONALITY
+Dec_CONTEXT_GET_ULONG(traps)
+Dec_CONTEXT_GET_ULONG(status)
+#endif
+
+static PyObject *
+context_getround(PyObject *self, void *closure UNUSED)
+{
+ int i = mpd_getround(CTX(self));
+
+ return Py_NewRef(round_map[i]);
+}
+
+static PyObject *
+context_getcapitals(PyObject *self, void *closure UNUSED)
+{
+ return PyLong_FromLong(CtxCaps(self));
+}
+
+#ifdef EXTRA_FUNCTIONALITY
+static PyObject *
+context_getallcr(PyObject *self, void *closure UNUSED)
+{
+ return PyLong_FromLong(mpd_getcr(CTX(self)));
+}
+#endif
+
+static PyObject *
+context_getetiny(PyObject *self, PyObject *dummy UNUSED)
+{
+ return PyLong_FromSsize_t(mpd_etiny(CTX(self)));
+}
+
+static PyObject *
+context_getetop(PyObject *self, PyObject *dummy UNUSED)
+{
+ return PyLong_FromSsize_t(mpd_etop(CTX(self)));
+}
+
+static int
+context_setprec(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetprec(ctx, x)) {
+ return value_error_int(
+ "valid range for prec is [1, MAX_PREC]");
+ }
+
+ return 0;
+}
+
+static int
+context_setemin(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetemin(ctx, x)) {
+ return value_error_int(
+ "valid range for Emin is [MIN_EMIN, 0]");
+ }
+
+ return 0;
+}
+
+static int
+context_setemax(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetemax(ctx, x)) {
+ return value_error_int(
+ "valid range for Emax is [0, MAX_EMAX]");
+ }
+
+ return 0;
+}
+
+#ifdef CONFIG_32
+static PyObject *
+context_unsafe_setprec(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx = CTX(self);
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ if (x < 1 || x > 1070000000L) {
+ return value_error_ptr(
+ "valid range for unsafe prec is [1, 1070000000]");
+ }
+
+ ctx->prec = x;
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+context_unsafe_setemin(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx = CTX(self);
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ if (x < -1070000000L || x > 0) {
+ return value_error_ptr(
+ "valid range for unsafe emin is [-1070000000, 0]");
+ }
+
+ ctx->emin = x;
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+context_unsafe_setemax(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx = CTX(self);
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ if (x < 0 || x > 1070000000L) {
+ return value_error_ptr(
+ "valid range for unsafe emax is [0, 1070000000]");
+ }
+
+ ctx->emax = x;
+ Py_RETURN_NONE;
+}
+#endif
+
+static int
+context_setround(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ int x;
+
+ x = getround(value);
+ if (x == -1) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetround(ctx, x)) {
+ INTERNAL_ERROR_INT("context_setround"); /* GCOV_NOT_REACHED */
+ }
+
+ return 0;
+}
+
+static int
+context_setcapitals(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+
+ if (x != 0 && x != 1) {
+ return value_error_int(
+ "valid values for capitals are 0 or 1");
+ }
+ CtxCaps(self) = (int)x;
+
+ return 0;
+}
+
+#ifdef EXTRA_FUNCTIONALITY
+static int
+context_settraps(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ uint32_t flags;
+
+ flags = long_as_flags(value);
+ if (flags & DEC_ERRORS) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsettraps(ctx, flags)) {
+ INTERNAL_ERROR_INT("context_settraps");
+ }
+
+ return 0;
+}
+#endif
+
+static int
+context_settraps_list(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx;
+ uint32_t flags;
+
+ flags = list_as_flags(value);
+ if (flags & DEC_ERRORS) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsettraps(ctx, flags)) {
+ INTERNAL_ERROR_INT("context_settraps_list");
+ }
+
+ return 0;
+}
+
+static int
+context_settraps_dict(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx;
+ uint32_t flags;
+
+ if (PyDecSignalDict_Check(value)) {
+ flags = SdFlags(value);
+ }
+ else {
+ flags = dict_as_flags(value);
+ if (flags & DEC_ERRORS) {
+ return -1;
+ }
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsettraps(ctx, flags)) {
+ INTERNAL_ERROR_INT("context_settraps_dict");
+ }
+
+ return 0;
+}
+
+#ifdef EXTRA_FUNCTIONALITY
+static int
+context_setstatus(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ uint32_t flags;
+
+ flags = long_as_flags(value);
+ if (flags & DEC_ERRORS) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetstatus(ctx, flags)) {
+ INTERNAL_ERROR_INT("context_setstatus");
+ }
+
+ return 0;
+}
+#endif
+
+static int
+context_setstatus_list(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx;
+ uint32_t flags;
+
+ flags = list_as_flags(value);
+ if (flags & DEC_ERRORS) {
+ return -1;
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetstatus(ctx, flags)) {
+ INTERNAL_ERROR_INT("context_setstatus_list");
+ }
+
+ return 0;
+}
+
+static int
+context_setstatus_dict(PyObject *self, PyObject *value)
+{
+ mpd_context_t *ctx;
+ uint32_t flags;
+
+ if (PyDecSignalDict_Check(value)) {
+ flags = SdFlags(value);
+ }
+ else {
+ flags = dict_as_flags(value);
+ if (flags & DEC_ERRORS) {
+ return -1;
+ }
+ }
+
+ ctx = CTX(self);
+ if (!mpd_qsetstatus(ctx, flags)) {
+ INTERNAL_ERROR_INT("context_setstatus_dict");
+ }
+
+ return 0;
+}
+
+static int
+context_setclamp(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ BOUNDS_CHECK(x, INT_MIN, INT_MAX);
+
+ ctx = CTX(self);
+ if (!mpd_qsetclamp(ctx, (int)x)) {
+ return value_error_int("valid values for clamp are 0 or 1");
+ }
+
+ return 0;
+}
+
+#ifdef EXTRA_FUNCTIONALITY
+static int
+context_setallcr(PyObject *self, PyObject *value, void *closure UNUSED)
+{
+ mpd_context_t *ctx;
+ mpd_ssize_t x;
+
+ x = PyLong_AsSsize_t(value);
+ if (x == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ BOUNDS_CHECK(x, INT_MIN, INT_MAX);
+
+ ctx = CTX(self);
+ if (!mpd_qsetcr(ctx, (int)x)) {
+ return value_error_int("valid values for _allcr are 0 or 1");
+ }
+
+ return 0;
+}
+#endif
+
+static PyObject *
+context_getattr(PyObject *self, PyObject *name)
+{
+ PyObject *retval;
+
+ if (PyUnicode_Check(name)) {
+ if (PyUnicode_CompareWithASCIIString(name, "traps") == 0) {
+ retval = ((PyDecContextObject *)self)->traps;
+ return Py_NewRef(retval);
+ }
+ if (PyUnicode_CompareWithASCIIString(name, "flags") == 0) {
+ retval = ((PyDecContextObject *)self)->flags;
+ return Py_NewRef(retval);
+ }
+ }
+
+ return PyObject_GenericGetAttr(self, name);
+}
+
+static int
+context_setattr(PyObject *self, PyObject *name, PyObject *value)
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_AttributeError,
+ "context attributes cannot be deleted");
+ return -1;
+ }
+
+ if (PyUnicode_Check(name)) {
+ if (PyUnicode_CompareWithASCIIString(name, "traps") == 0) {
+ return context_settraps_dict(self, value);
+ }
+ if (PyUnicode_CompareWithASCIIString(name, "flags") == 0) {
+ return context_setstatus_dict(self, value);
+ }
+ }
+
+ return PyObject_GenericSetAttr(self, name, value);
+}
+
+static int
+context_setattrs(PyObject *self, PyObject *prec, PyObject *rounding,
+ PyObject *emin, PyObject *emax, PyObject *capitals,
+ PyObject *clamp, PyObject *status, PyObject *traps) {
+
+ int ret;
+ if (prec != Py_None && context_setprec(self, prec, NULL) < 0) {
+ return -1;
+ }
+ if (rounding != Py_None && context_setround(self, rounding, NULL) < 0) {
+ return -1;
+ }
+ if (emin != Py_None && context_setemin(self, emin, NULL) < 0) {
+ return -1;
+ }
+ if (emax != Py_None && context_setemax(self, emax, NULL) < 0) {
+ return -1;
+ }
+ if (capitals != Py_None && context_setcapitals(self, capitals, NULL) < 0) {
+ return -1;
+ }
+ if (clamp != Py_None && context_setclamp(self, clamp, NULL) < 0) {
+ return -1;
+ }
+
+ if (traps != Py_None) {
+ if (PyList_Check(traps)) {
+ ret = context_settraps_list(self, traps);
+ }
+#ifdef EXTRA_FUNCTIONALITY
+ else if (PyLong_Check(traps)) {
+ ret = context_settraps(self, traps, NULL);
+ }
+#endif
+ else {
+ ret = context_settraps_dict(self, traps);
+ }
+ if (ret < 0) {
+ return ret;
+ }
+ }
+ if (status != Py_None) {
+ if (PyList_Check(status)) {
+ ret = context_setstatus_list(self, status);
+ }
+#ifdef EXTRA_FUNCTIONALITY
+ else if (PyLong_Check(status)) {
+ ret = context_setstatus(self, status, NULL);
+ }
+#endif
+ else {
+ ret = context_setstatus_dict(self, status);
+ }
+ if (ret < 0) {
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static PyObject *
+context_clear_traps(PyObject *self, PyObject *dummy UNUSED)
+{
+ CTX(self)->traps = 0;
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+context_clear_flags(PyObject *self, PyObject *dummy UNUSED)
+{
+ CTX(self)->status = 0;
+ Py_RETURN_NONE;
+}
+
+#define DEC_DFLT_EMAX 999999
+#define DEC_DFLT_EMIN -999999
+
+static mpd_context_t dflt_ctx = {
+ 28, DEC_DFLT_EMAX, DEC_DFLT_EMIN,
+ MPD_IEEE_Invalid_operation|MPD_Division_by_zero|MPD_Overflow,
+ 0, 0, MPD_ROUND_HALF_EVEN, 0, 1
+};
+
+static PyObject *
+context_new(PyTypeObject *type, PyObject *args UNUSED, PyObject *kwds UNUSED)
+{
+ PyDecContextObject *self = NULL;
+ mpd_context_t *ctx;
+
+ if (type == &PyDecContext_Type) {
+ self = PyObject_New(PyDecContextObject, &PyDecContext_Type);
+ }
+ else {
+ self = (PyDecContextObject *)type->tp_alloc(type, 0);
+ }
+
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->traps = PyObject_CallObject((PyObject *)PyDecSignalDict_Type, NULL);
+ if (self->traps == NULL) {
+ self->flags = NULL;
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->flags = PyObject_CallObject((PyObject *)PyDecSignalDict_Type, NULL);
+ if (self->flags == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ ctx = CTX(self);
+
+ if (default_context_template) {
+ *ctx = *CTX(default_context_template);
+ }
+ else {
+ *ctx = dflt_ctx;
+ }
+
+ SdFlagAddr(self->traps) = &ctx->traps;
+ SdFlagAddr(self->flags) = &ctx->status;
+
+ CtxCaps(self) = 1;
+ self->tstate = NULL;
+
+ return (PyObject *)self;
+}
+
+static void
+context_dealloc(PyDecContextObject *self)
+{
+#ifndef WITH_DECIMAL_CONTEXTVAR
+ if (self == cached_context) {
+ cached_context = NULL;
+ }
+#endif
+
+ Py_XDECREF(self->traps);
+ Py_XDECREF(self->flags);
+ Py_TYPE(self)->tp_free(self);
+}
+
+static int
+context_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {
+ "prec", "rounding", "Emin", "Emax", "capitals", "clamp",
+ "flags", "traps", NULL
+ };
+ PyObject *prec = Py_None;
+ PyObject *rounding = Py_None;
+ PyObject *emin = Py_None;
+ PyObject *emax = Py_None;
+ PyObject *capitals = Py_None;
+ PyObject *clamp = Py_None;
+ PyObject *status = Py_None;
+ PyObject *traps = Py_None;
+
+ assert(PyTuple_Check(args));
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kwds,
+ "|OOOOOOOO", kwlist,
+ &prec, &rounding, &emin, &emax, &capitals, &clamp, &status, &traps
+ )) {
+ return -1;
+ }
+
+ return context_setattrs(
+ self, prec, rounding,
+ emin, emax, capitals,
+ clamp, status, traps
+ );
+}
+
+static PyObject *
+context_repr(PyDecContextObject *self)
+{
+ mpd_context_t *ctx;
+ char flags[MPD_MAX_SIGNAL_LIST];
+ char traps[MPD_MAX_SIGNAL_LIST];
+ int n, mem;
+
+ assert(PyDecContext_Check(self));
+ ctx = CTX(self);
+
+ mem = MPD_MAX_SIGNAL_LIST;
+ n = mpd_lsnprint_signals(flags, mem, ctx->status, dec_signal_string);
+ if (n < 0 || n >= mem) {
+ INTERNAL_ERROR_PTR("context_repr");
+ }
+
+ n = mpd_lsnprint_signals(traps, mem, ctx->traps, dec_signal_string);
+ if (n < 0 || n >= mem) {
+ INTERNAL_ERROR_PTR("context_repr");
+ }
+
+ return PyUnicode_FromFormat(
+ "Context(prec=%zd, rounding=%s, Emin=%zd, Emax=%zd, "
+ "capitals=%d, clamp=%d, flags=%s, traps=%s)",
+ ctx->prec, mpd_round_string[ctx->round], ctx->emin, ctx->emax,
+ self->capitals, ctx->clamp, flags, traps);
+}
+
+static void
+init_basic_context(PyObject *v)
+{
+ mpd_context_t ctx = dflt_ctx;
+
+ ctx.prec = 9;
+ ctx.traps |= (MPD_Underflow|MPD_Clamped);
+ ctx.round = MPD_ROUND_HALF_UP;
+
+ *CTX(v) = ctx;
+ CtxCaps(v) = 1;
+}
+
+static void
+init_extended_context(PyObject *v)
+{
+ mpd_context_t ctx = dflt_ctx;
+
+ ctx.prec = 9;
+ ctx.traps = 0;
+
+ *CTX(v) = ctx;
+ CtxCaps(v) = 1;
+}
+
+#ifdef EXTRA_FUNCTIONALITY
+/* Factory function for creating IEEE interchange format contexts */
+static PyObject *
+ieee_context(PyObject *dummy UNUSED, PyObject *v)
+{
+ PyObject *context;
+ mpd_ssize_t bits;
+ mpd_context_t ctx;
+
+ bits = PyLong_AsSsize_t(v);
+ if (bits == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ if (bits <= 0 || bits > INT_MAX) {
+ goto error;
+ }
+ if (mpd_ieee_context(&ctx, (int)bits) < 0) {
+ goto error;
+ }
+
+ context = PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL);
+ if (context == NULL) {
+ return NULL;
+ }
+ *CTX(context) = ctx;
+
+ return context;
+
+error:
+ PyErr_Format(PyExc_ValueError,
+ "argument must be a multiple of 32, with a maximum of %d",
+ MPD_IEEE_CONTEXT_MAX_BITS);
+
+ return NULL;
+}
+#endif
+
+static PyObject *
+context_copy(PyObject *self, PyObject *args UNUSED)
+{
+ PyObject *copy;
+
+ copy = PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL);
+ if (copy == NULL) {
+ return NULL;
+ }
+
+ *CTX(copy) = *CTX(self);
+ CTX(copy)->newtrap = 0;
+ CtxCaps(copy) = CtxCaps(self);
+
+ return copy;
+}
+
+static PyObject *
+context_reduce(PyObject *self, PyObject *args UNUSED)
+{
+ PyObject *flags;
+ PyObject *traps;
+ PyObject *ret;
+ mpd_context_t *ctx;
+
+ ctx = CTX(self);
+
+ flags = signals_as_list(ctx->status);
+ if (flags == NULL) {
+ return NULL;
+ }
+ traps = signals_as_list(ctx->traps);
+ if (traps == NULL) {
+ Py_DECREF(flags);
+ return NULL;
+ }
+
+ ret = Py_BuildValue(
+ "O(nsnniiOO)",
+ Py_TYPE(self),
+ ctx->prec, mpd_round_string[ctx->round], ctx->emin, ctx->emax,
+ CtxCaps(self), ctx->clamp, flags, traps
+ );
+
+ Py_DECREF(flags);
+ Py_DECREF(traps);
+ return ret;
+}
+
+
+static PyGetSetDef context_getsets [] =
+{
+ { "prec", (getter)context_getprec, (setter)context_setprec, NULL, NULL},
+ { "Emax", (getter)context_getemax, (setter)context_setemax, NULL, NULL},
+ { "Emin", (getter)context_getemin, (setter)context_setemin, NULL, NULL},
+ { "rounding", (getter)context_getround, (setter)context_setround, NULL, NULL},
+ { "capitals", (getter)context_getcapitals, (setter)context_setcapitals, NULL, NULL},
+ { "clamp", (getter)context_getclamp, (setter)context_setclamp, NULL, NULL},
+#ifdef EXTRA_FUNCTIONALITY
+ { "_allcr", (getter)context_getallcr, (setter)context_setallcr, NULL, NULL},
+ { "_traps", (getter)context_gettraps, (setter)context_settraps, NULL, NULL},
+ { "_flags", (getter)context_getstatus, (setter)context_setstatus, NULL, NULL},
+#endif
+ {NULL}
+};
+
+
+#define CONTEXT_CHECK(obj) \
+ if (!PyDecContext_Check(obj)) { \
+ PyErr_SetString(PyExc_TypeError, \
+ "argument must be a context"); \
+ return NULL; \
+ }
+
+#define CONTEXT_CHECK_VA(obj) \
+ if (obj == Py_None) { \
+ CURRENT_CONTEXT(obj); \
+ } \
+ else if (!PyDecContext_Check(obj)) { \
+ PyErr_SetString(PyExc_TypeError, \
+ "optional argument must be a context"); \
+ return NULL; \
+ }
+
+
+/******************************************************************************/
+/* Global, thread local and temporary contexts */
+/******************************************************************************/
+
+/*
+ * Thread local storage currently has a speed penalty of about 4%.
+ * All functions that map Python's arithmetic operators to mpdecimal
+ * functions have to look up the current context for each and every
+ * operation.
+ */
+
+#ifndef WITH_DECIMAL_CONTEXTVAR
+/* Get the context from the thread state dictionary. */
+static PyObject *
+current_context_from_dict(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+#ifdef Py_DEBUG
+ // The caller must hold the GIL
+ _Py_EnsureTstateNotNULL(tstate);
+#endif
+
+ PyObject *dict = _PyThreadState_GetDict(tstate);
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot get thread state");
+ return NULL;
+ }
+
+ PyObject *tl_context = PyDict_GetItemWithError(dict, tls_context_key);
+ if (tl_context != NULL) {
+ /* We already have a thread local context. */
+ CONTEXT_CHECK(tl_context);
+ }
+ else {
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
+ /* Set up a new thread local context. */
+ tl_context = context_copy(default_context_template, NULL);
+ if (tl_context == NULL) {
+ return NULL;
+ }
+ CTX(tl_context)->status = 0;
+
+ if (PyDict_SetItem(dict, tls_context_key, tl_context) < 0) {
+ Py_DECREF(tl_context);
+ return NULL;
+ }
+ Py_DECREF(tl_context);
+ }
+
+ /* Cache the context of the current thread, assuming that it
+ * will be accessed several times before a thread switch. */
+ cached_context = (PyDecContextObject *)tl_context;
+ cached_context->tstate = tstate;
+
+ /* Borrowed reference with refcount==1 */
+ return tl_context;
+}
+
+/* Return borrowed reference to thread local context. */
+static PyObject *
+current_context(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (cached_context && cached_context->tstate == tstate) {
+ return (PyObject *)cached_context;
+ }
+
+ return current_context_from_dict();
+}
+
+/* ctxobj := borrowed reference to the current context */
+#define CURRENT_CONTEXT(ctxobj) \
+ ctxobj = current_context(); \
+ if (ctxobj == NULL) { \
+ return NULL; \
+ }
+
+/* Return a new reference to the current context */
+static PyObject *
+PyDec_GetCurrentContext(PyObject *self UNUSED, PyObject *args UNUSED)
+{
+ PyObject *context;
+
+ context = current_context();
+ if (context == NULL) {
+ return NULL;
+ }
+
+ return Py_NewRef(context);
+}
+
+/* Set the thread local context to a new context, decrement old reference */
+static PyObject *
+PyDec_SetCurrentContext(PyObject *self UNUSED, PyObject *v)
+{
+ PyObject *dict;
+
+ CONTEXT_CHECK(v);
+
+ dict = PyThreadState_GetDict();
+ if (dict == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot get thread state");
+ return NULL;
+ }
+
+ /* If the new context is one of the templates, make a copy.
+ * This is the current behavior of decimal.py. */
+ if (v == default_context_template ||
+ v == basic_context_template ||
+ v == extended_context_template) {
+ v = context_copy(v, NULL);
+ if (v == NULL) {
+ return NULL;
+ }
+ CTX(v)->status = 0;
+ }
+ else {
+ Py_INCREF(v);
+ }
+
+ cached_context = NULL;
+ if (PyDict_SetItem(dict, tls_context_key, v) < 0) {
+ Py_DECREF(v);
+ return NULL;
+ }
+
+ Py_DECREF(v);
+ Py_RETURN_NONE;
+}
+#else
+static PyObject *
+init_current_context(void)
+{
+ PyObject *tl_context = context_copy(default_context_template, NULL);
+ if (tl_context == NULL) {
+ return NULL;
+ }
+ CTX(tl_context)->status = 0;
+
+ PyObject *tok = PyContextVar_Set(current_context_var, tl_context);
+ if (tok == NULL) {
+ Py_DECREF(tl_context);
+ return NULL;
+ }
+ Py_DECREF(tok);
+
+ return tl_context;
+}
+
+static inline PyObject *
+current_context(void)
+{
+ PyObject *tl_context;
+ if (PyContextVar_Get(current_context_var, NULL, &tl_context) < 0) {
+ return NULL;
+ }
+
+ if (tl_context != NULL) {
+ return tl_context;
+ }
+
+ return init_current_context();
+}
+
+/* ctxobj := borrowed reference to the current context */
+#define CURRENT_CONTEXT(ctxobj) \
+ ctxobj = current_context(); \
+ if (ctxobj == NULL) { \
+ return NULL; \
+ } \
+ Py_DECREF(ctxobj);
+
+/* Return a new reference to the current context */
+static PyObject *
+PyDec_GetCurrentContext(PyObject *self UNUSED, PyObject *args UNUSED)
+{
+ return current_context();
+}
+
+/* Set the thread local context to a new context, decrement old reference */
+static PyObject *
+PyDec_SetCurrentContext(PyObject *self UNUSED, PyObject *v)
+{
+ CONTEXT_CHECK(v);
+
+ /* If the new context is one of the templates, make a copy.
+ * This is the current behavior of decimal.py. */
+ if (v == default_context_template ||
+ v == basic_context_template ||
+ v == extended_context_template) {
+ v = context_copy(v, NULL);
+ if (v == NULL) {
+ return NULL;
+ }
+ CTX(v)->status = 0;
+ }
+ else {
+ Py_INCREF(v);
+ }
+
+ PyObject *tok = PyContextVar_Set(current_context_var, v);
+ Py_DECREF(v);
+ if (tok == NULL) {
+ return NULL;
+ }
+ Py_DECREF(tok);
+
+ Py_RETURN_NONE;
+}
+#endif
+
+/* Context manager object for the 'with' statement. The manager
+ * owns one reference to the global (outer) context and one
+ * to the local (inner) context. */
+static PyObject *
+ctxmanager_new(PyTypeObject *type UNUSED, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {
+ "ctx", "prec", "rounding",
+ "Emin", "Emax", "capitals",
+ "clamp", "flags", "traps",
+ NULL
+ };
+ PyDecContextManagerObject *self;
+ PyObject *local = Py_None;
+ PyObject *global;
+
+ PyObject *prec = Py_None;
+ PyObject *rounding = Py_None;
+ PyObject *Emin = Py_None;
+ PyObject *Emax = Py_None;
+ PyObject *capitals = Py_None;
+ PyObject *clamp = Py_None;
+ PyObject *flags = Py_None;
+ PyObject *traps = Py_None;
+
+ CURRENT_CONTEXT(global);
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOOOOOOOO", kwlist, &local,
+ &prec, &rounding, &Emin, &Emax, &capitals, &clamp, &flags, &traps)) {
+ return NULL;
+ }
+ if (local == Py_None) {
+ local = global;
+ }
+ else if (!PyDecContext_Check(local)) {
+ PyErr_SetString(PyExc_TypeError,
+ "optional argument must be a context");
+ return NULL;
+ }
+
+ self = PyObject_New(PyDecContextManagerObject,
+ &PyDecContextManager_Type);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->local = context_copy(local, NULL);
+ if (self->local == NULL) {
+ self->global = NULL;
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->global = Py_NewRef(global);
+
+ int ret = context_setattrs(
+ self->local, prec, rounding,
+ Emin, Emax, capitals,
+ clamp, flags, traps
+ );
+
+ if (ret < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ return (PyObject *)self;
+}
+
+static void
+ctxmanager_dealloc(PyDecContextManagerObject *self)
+{
+ Py_XDECREF(self->local);
+ Py_XDECREF(self->global);
+ PyObject_Free(self);
+}
+
+static PyObject *
+ctxmanager_set_local(PyDecContextManagerObject *self, PyObject *args UNUSED)
+{
+ PyObject *ret;
+
+ ret = PyDec_SetCurrentContext(NULL, self->local);
+ if (ret == NULL) {
+ return NULL;
+ }
+ Py_DECREF(ret);
+
+ return Py_NewRef(self->local);
+}
+
+static PyObject *
+ctxmanager_restore_global(PyDecContextManagerObject *self,
+ PyObject *args UNUSED)
+{
+ PyObject *ret;
+
+ ret = PyDec_SetCurrentContext(NULL, self->global);
+ if (ret == NULL) {
+ return NULL;
+ }
+ Py_DECREF(ret);
+
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef ctxmanager_methods[] = {
+ {"__enter__", (PyCFunction)ctxmanager_set_local, METH_NOARGS, NULL},
+ {"__exit__", (PyCFunction)ctxmanager_restore_global, METH_VARARGS, NULL},
+ {NULL, NULL}
+};
+
+static PyTypeObject PyDecContextManager_Type =
+{
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "decimal.ContextManager", /* tp_name */
+ sizeof(PyDecContextManagerObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor) ctxmanager_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ (getattrfunc) 0, /* tp_getattr */
+ (setattrfunc) 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc) 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ (getattrofunc) PyObject_GenericGetAttr, /* tp_getattro */
+ (setattrofunc) 0, /* tp_setattro */
+ (PyBufferProcs *) 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ ctxmanager_methods, /* tp_methods */
+};
+
+
+/******************************************************************************/
+/* New Decimal Object */
+/******************************************************************************/
+
+static PyObject *
+PyDecType_New(PyTypeObject *type)
+{
+ PyDecObject *dec;
+
+ if (type == &PyDec_Type) {
+ dec = PyObject_New(PyDecObject, &PyDec_Type);
+ }
+ else {
+ dec = (PyDecObject *)type->tp_alloc(type, 0);
+ }
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ dec->hash = -1;
+
+ MPD(dec)->flags = MPD_STATIC|MPD_STATIC_DATA;
+ MPD(dec)->exp = 0;
+ MPD(dec)->digits = 0;
+ MPD(dec)->len = 0;
+ MPD(dec)->alloc = _Py_DEC_MINALLOC;
+ MPD(dec)->data = dec->data;
+
+ return (PyObject *)dec;
+}
+#define dec_alloc() PyDecType_New(&PyDec_Type)
+
+static void
+dec_dealloc(PyObject *dec)
+{
+ mpd_del(MPD(dec));
+ Py_TYPE(dec)->tp_free(dec);
+}
+
+
+/******************************************************************************/
+/* Conversions to Decimal */
+/******************************************************************************/
+
+Py_LOCAL_INLINE(int)
+is_space(int kind, const void *data, Py_ssize_t pos)
+{
+ Py_UCS4 ch = PyUnicode_READ(kind, data, pos);
+ return Py_UNICODE_ISSPACE(ch);
+}
+
+/* Return the ASCII representation of a numeric Unicode string. The numeric
+ string may contain ascii characters in the range [1, 127], any Unicode
+ space and any unicode digit. If strip_ws is true, leading and trailing
+ whitespace is stripped. If ignore_underscores is true, underscores are
+ ignored.
+
+ Return NULL if malloc fails and an empty string if invalid characters
+ are found. */
+static char *
+numeric_as_ascii(PyObject *u, int strip_ws, int ignore_underscores)
+{
+ int kind;
+ const void *data;
+ Py_UCS4 ch;
+ char *res, *cp;
+ Py_ssize_t j, len;
+ int d;
+
+ if (PyUnicode_READY(u) == -1) {
+ return NULL;
+ }
+
+ kind = PyUnicode_KIND(u);
+ data = PyUnicode_DATA(u);
+ len = PyUnicode_GET_LENGTH(u);
+
+ cp = res = PyMem_Malloc(len+1);
+ if (res == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ j = 0;
+ if (strip_ws) {
+ while (len > 0 && is_space(kind, data, len-1)) {
+ len--;
+ }
+ while (j < len && is_space(kind, data, j)) {
+ j++;
+ }
+ }
+
+ for (; j < len; j++) {
+ ch = PyUnicode_READ(kind, data, j);
+ if (ignore_underscores && ch == '_') {
+ continue;
+ }
+ if (0 < ch && ch <= 127) {
+ *cp++ = ch;
+ continue;
+ }
+ if (Py_UNICODE_ISSPACE(ch)) {
+ *cp++ = ' ';
+ continue;
+ }
+ d = Py_UNICODE_TODECIMAL(ch);
+ if (d < 0) {
+ /* empty string triggers ConversionSyntax */
+ *res = '\0';
+ return res;
+ }
+ *cp++ = '0' + d;
+ }
+ *cp = '\0';
+ return res;
+}
+
+/* Return a new PyDecObject or a subtype from a C string. Use the context
+ during conversion. */
+static PyObject *
+PyDecType_FromCString(PyTypeObject *type, const char *s,
+ PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ mpd_qset_string(MPD(dec), s, CTX(context), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+ return dec;
+}
+
+/* Return a new PyDecObject or a subtype from a C string. Attempt exact
+ conversion. If the operand cannot be converted exactly, set
+ InvalidOperation. */
+static PyObject *
+PyDecType_FromCStringExact(PyTypeObject *type, const char *s,
+ PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+ mpd_context_t maxctx;
+
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ mpd_maxcontext(&maxctx);
+
+ mpd_qset_string(MPD(dec), s, &maxctx, &status);
+ if (status & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ /* we want exact results */
+ mpd_seterror(MPD(dec), MPD_Invalid_operation, &status);
+ }
+ status &= MPD_Errors;
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+
+ return dec;
+}
+
+/* Return a new PyDecObject or a subtype from a PyUnicodeObject. */
+static PyObject *
+PyDecType_FromUnicode(PyTypeObject *type, PyObject *u,
+ PyObject *context)
+{
+ PyObject *dec;
+ char *s;
+
+ s = numeric_as_ascii(u, 0, 0);
+ if (s == NULL) {
+ return NULL;
+ }
+
+ dec = PyDecType_FromCString(type, s, context);
+ PyMem_Free(s);
+ return dec;
+}
+
+/* Return a new PyDecObject or a subtype from a PyUnicodeObject. Attempt exact
+ * conversion. If the conversion is not exact, fail with InvalidOperation.
+ * Allow leading and trailing whitespace in the input operand. */
+static PyObject *
+PyDecType_FromUnicodeExactWS(PyTypeObject *type, PyObject *u,
+ PyObject *context)
+{
+ PyObject *dec;
+ char *s;
+
+ s = numeric_as_ascii(u, 1, 1);
+ if (s == NULL) {
+ return NULL;
+ }
+
+ dec = PyDecType_FromCStringExact(type, s, context);
+ PyMem_Free(s);
+ return dec;
+}
+
+/* Set PyDecObject from triple without any error checking. */
+Py_LOCAL_INLINE(void)
+_dec_settriple(PyObject *dec, uint8_t sign, uint32_t v, mpd_ssize_t exp)
+{
+
+#ifdef CONFIG_64
+ MPD(dec)->data[0] = v;
+ MPD(dec)->len = 1;
+#else
+ uint32_t q, r;
+ q = v / MPD_RADIX;
+ r = v - q * MPD_RADIX;
+ MPD(dec)->data[1] = q;
+ MPD(dec)->data[0] = r;
+ MPD(dec)->len = q ? 2 : 1;
+#endif
+ mpd_set_flags(MPD(dec), sign);
+ MPD(dec)->exp = exp;
+ mpd_setdigits(MPD(dec));
+}
+
+/* Return a new PyDecObject from an mpd_ssize_t. */
+static PyObject *
+PyDecType_FromSsize(PyTypeObject *type, mpd_ssize_t v, PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ mpd_qset_ssize(MPD(dec), v, CTX(context), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+ return dec;
+}
+
+/* Return a new PyDecObject from an mpd_ssize_t. Conversion is exact. */
+static PyObject *
+PyDecType_FromSsizeExact(PyTypeObject *type, mpd_ssize_t v, PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+ mpd_context_t maxctx;
+
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ mpd_maxcontext(&maxctx);
+
+ mpd_qset_ssize(MPD(dec), v, &maxctx, &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+ return dec;
+}
+
+/* Convert from a PyLongObject. The context is not modified; flags set
+ during conversion are accumulated in the status parameter. */
+static PyObject *
+dec_from_long(PyTypeObject *type, PyObject *v,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ PyObject *dec;
+ PyLongObject *l = (PyLongObject *)v;
+
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ if (_PyLong_IsZero(l)) {
+ _dec_settriple(dec, MPD_POS, 0, 0);
+ return dec;
+ }
+
+ uint8_t sign = _PyLong_IsNegative(l) ? MPD_NEG : MPD_POS;
+
+ if (_PyLong_IsCompact(l)) {
+ _dec_settriple(dec, sign, l->long_value.ob_digit[0], 0);
+ mpd_qfinalize(MPD(dec), ctx, status);
+ return dec;
+ }
+ size_t len = _PyLong_DigitCount(l);
+
+#if PYLONG_BITS_IN_DIGIT == 30
+ mpd_qimport_u32(MPD(dec), l->long_value.ob_digit, len, sign, PyLong_BASE,
+ ctx, status);
+#elif PYLONG_BITS_IN_DIGIT == 15
+ mpd_qimport_u16(MPD(dec), l->long_value.ob_digit, len, sign, PyLong_BASE,
+ ctx, status);
+#else
+ #error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
+#endif
+
+ return dec;
+}
+
+/* Return a new PyDecObject from a PyLongObject. Use the context for
+ conversion. */
+static PyObject *
+PyDecType_FromLong(PyTypeObject *type, PyObject *v, PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+
+ if (!PyLong_Check(v)) {
+ PyErr_SetString(PyExc_TypeError, "argument must be an integer");
+ return NULL;
+ }
+
+ dec = dec_from_long(type, v, CTX(context), &status);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+
+ return dec;
+}
+
+/* Return a new PyDecObject from a PyLongObject. Use a maximum context
+ for conversion. If the conversion is not exact, set InvalidOperation. */
+static PyObject *
+PyDecType_FromLongExact(PyTypeObject *type, PyObject *v,
+ PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+ mpd_context_t maxctx;
+
+ if (!PyLong_Check(v)) {
+ PyErr_SetString(PyExc_TypeError, "argument must be an integer");
+ return NULL;
+ }
+
+ mpd_maxcontext(&maxctx);
+ dec = dec_from_long(type, v, &maxctx, &status);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ if (status & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ /* we want exact results */
+ mpd_seterror(MPD(dec), MPD_Invalid_operation, &status);
+ }
+ status &= MPD_Errors;
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+
+ return dec;
+}
+
+/* External C-API functions */
+static binaryfunc _py_long_multiply;
+static binaryfunc _py_long_floor_divide;
+static ternaryfunc _py_long_power;
+static unaryfunc _py_float_abs;
+static PyCFunction _py_long_bit_length;
+static PyCFunction _py_float_as_integer_ratio;
+
+/* Return a PyDecObject or a subtype from a PyFloatObject.
+ Conversion is exact. */
+static PyObject *
+PyDecType_FromFloatExact(PyTypeObject *type, PyObject *v,
+ PyObject *context)
+{
+ PyObject *dec, *tmp;
+ PyObject *n, *d, *n_d;
+ mpd_ssize_t k;
+ double x;
+ int sign;
+ mpd_t *d1, *d2;
+ uint32_t status = 0;
+ mpd_context_t maxctx;
+
+
+ assert(PyType_IsSubtype(type, &PyDec_Type));
+
+ if (PyLong_Check(v)) {
+ return PyDecType_FromLongExact(type, v, context);
+ }
+ if (!PyFloat_Check(v)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must be int or float");
+ return NULL;
+ }
+
+ x = PyFloat_AsDouble(v);
+ if (x == -1.0 && PyErr_Occurred()) {
+ return NULL;
+ }
+ sign = (copysign(1.0, x) == 1.0) ? 0 : 1;
+
+ if (Py_IS_NAN(x) || Py_IS_INFINITY(x)) {
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+ if (Py_IS_NAN(x)) {
+ /* decimal.py calls repr(float(+-nan)),
+ * which always gives a positive result. */
+ mpd_setspecial(MPD(dec), MPD_POS, MPD_NAN);
+ }
+ else {
+ mpd_setspecial(MPD(dec), sign, MPD_INF);
+ }
+ return dec;
+ }
+
+ /* absolute value of the float */
+ tmp = _py_float_abs(v);
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ /* float as integer ratio: numerator/denominator */
+ n_d = _py_float_as_integer_ratio(tmp, NULL);
+ Py_DECREF(tmp);
+ if (n_d == NULL) {
+ return NULL;
+ }
+ n = PyTuple_GET_ITEM(n_d, 0);
+ d = PyTuple_GET_ITEM(n_d, 1);
+
+ tmp = _py_long_bit_length(d, NULL);
+ if (tmp == NULL) {
+ Py_DECREF(n_d);
+ return NULL;
+ }
+ k = PyLong_AsSsize_t(tmp);
+ Py_DECREF(tmp);
+ if (k == -1 && PyErr_Occurred()) {
+ Py_DECREF(n_d);
+ return NULL;
+ }
+ k--;
+
+ dec = PyDecType_FromLongExact(type, n, context);
+ Py_DECREF(n_d);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ d1 = mpd_qnew();
+ if (d1 == NULL) {
+ Py_DECREF(dec);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ d2 = mpd_qnew();
+ if (d2 == NULL) {
+ mpd_del(d1);
+ Py_DECREF(dec);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ mpd_maxcontext(&maxctx);
+ mpd_qset_uint(d1, 5, &maxctx, &status);
+ mpd_qset_ssize(d2, k, &maxctx, &status);
+ mpd_qpow(d1, d1, d2, &maxctx, &status);
+ if (dec_addstatus(context, status)) {
+ mpd_del(d1);
+ mpd_del(d2);
+ Py_DECREF(dec);
+ return NULL;
+ }
+
+ /* result = n * 5**k */
+ mpd_qmul(MPD(dec), MPD(dec), d1, &maxctx, &status);
+ mpd_del(d1);
+ mpd_del(d2);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+ /* result = +- n * 5**k * 10**-k */
+ mpd_set_sign(MPD(dec), sign);
+ MPD(dec)->exp = -k;
+
+ return dec;
+}
+
+static PyObject *
+PyDecType_FromFloat(PyTypeObject *type, PyObject *v,
+ PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+
+ dec = PyDecType_FromFloatExact(type, v, context);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ mpd_qfinalize(MPD(dec), CTX(context), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+
+ return dec;
+}
+
+/* Return a new PyDecObject or a subtype from a Decimal. */
+static PyObject *
+PyDecType_FromDecimalExact(PyTypeObject *type, PyObject *v, PyObject *context)
+{
+ PyObject *dec;
+ uint32_t status = 0;
+
+ if (type == &PyDec_Type && PyDec_CheckExact(v)) {
+ return Py_NewRef(v);
+ }
+
+ dec = PyDecType_New(type);
+ if (dec == NULL) {
+ return NULL;
+ }
+
+ mpd_qcopy(MPD(dec), MPD(v), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(dec);
+ return NULL;
+ }
+
+ return dec;
+}
+
+static PyObject *
+sequence_as_tuple(PyObject *v, PyObject *ex, const char *mesg)
+{
+ if (PyTuple_Check(v)) {
+ return Py_NewRef(v);
+ }
+ if (PyList_Check(v)) {
+ return PyList_AsTuple(v);
+ }
+
+ PyErr_SetString(ex, mesg);
+ return NULL;
+}
+
+/* Return a new C string representation of a DecimalTuple. */
+static char *
+dectuple_as_str(PyObject *dectuple)
+{
+ PyObject *digits = NULL, *tmp;
+ char *decstring = NULL;
+ char sign_special[6];
+ char *cp;
+ long sign, l;
+ mpd_ssize_t exp = 0;
+ Py_ssize_t i, mem, tsize;
+ int is_infinite = 0;
+ int n;
+
+ assert(PyTuple_Check(dectuple));
+
+ if (PyTuple_Size(dectuple) != 3) {
+ PyErr_SetString(PyExc_ValueError,
+ "argument must be a sequence of length 3");
+ goto error;
+ }
+
+ /* sign */
+ tmp = PyTuple_GET_ITEM(dectuple, 0);
+ if (!PyLong_Check(tmp)) {
+ PyErr_SetString(PyExc_ValueError,
+ "sign must be an integer with the value 0 or 1");
+ goto error;
+ }
+ sign = PyLong_AsLong(tmp);
+ if (sign == -1 && PyErr_Occurred()) {
+ goto error;
+ }
+ if (sign != 0 && sign != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "sign must be an integer with the value 0 or 1");
+ goto error;
+ }
+ sign_special[0] = sign ? '-' : '+';
+ sign_special[1] = '\0';
+
+ /* exponent or encoding for a special number */
+ tmp = PyTuple_GET_ITEM(dectuple, 2);
+ if (PyUnicode_Check(tmp)) {
+ /* special */
+ if (PyUnicode_CompareWithASCIIString(tmp, "F") == 0) {
+ strcat(sign_special, "Inf");
+ is_infinite = 1;
+ }
+ else if (PyUnicode_CompareWithASCIIString(tmp, "n") == 0) {
+ strcat(sign_special, "NaN");
+ }
+ else if (PyUnicode_CompareWithASCIIString(tmp, "N") == 0) {
+ strcat(sign_special, "sNaN");
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "string argument in the third position "
+ "must be 'F', 'n' or 'N'");
+ goto error;
+ }
+ }
+ else {
+ /* exponent */
+ if (!PyLong_Check(tmp)) {
+ PyErr_SetString(PyExc_ValueError,
+ "exponent must be an integer");
+ goto error;
+ }
+ exp = PyLong_AsSsize_t(tmp);
+ if (exp == -1 && PyErr_Occurred()) {
+ goto error;
+ }
+ }
+
+ /* coefficient */
+ digits = sequence_as_tuple(PyTuple_GET_ITEM(dectuple, 1), PyExc_ValueError,
+ "coefficient must be a tuple of digits");
+ if (digits == NULL) {
+ goto error;
+ }
+
+ tsize = PyTuple_Size(digits);
+ /* [sign][coeffdigits+1][E][-][expdigits+1]['\0'] */
+ mem = 1 + tsize + 3 + MPD_EXPDIGITS + 2;
+ cp = decstring = PyMem_Malloc(mem);
+ if (decstring == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ n = snprintf(cp, mem, "%s", sign_special);
+ if (n < 0 || n >= mem) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "internal error in dec_sequence_as_str");
+ goto error;
+ }
+ cp += n;
+
+ if (tsize == 0 && sign_special[1] == '\0') {
+ /* empty tuple: zero coefficient, except for special numbers */
+ *cp++ = '0';
+ }
+ for (i = 0; i < tsize; i++) {
+ tmp = PyTuple_GET_ITEM(digits, i);
+ if (!PyLong_Check(tmp)) {
+ PyErr_SetString(PyExc_ValueError,
+ "coefficient must be a tuple of digits");
+ goto error;
+ }
+ l = PyLong_AsLong(tmp);
+ if (l == -1 && PyErr_Occurred()) {
+ goto error;
+ }
+ if (l < 0 || l > 9) {
+ PyErr_SetString(PyExc_ValueError,
+ "coefficient must be a tuple of digits");
+ goto error;
+ }
+ if (is_infinite) {
+ /* accept but ignore any well-formed coefficient for compatibility
+ with decimal.py */
+ continue;
+ }
+ *cp++ = (char)l + '0';
+ }
+ *cp = '\0';
+
+ if (sign_special[1] == '\0') {
+ /* not a special number */
+ *cp++ = 'E';
+ n = snprintf(cp, MPD_EXPDIGITS+2, "%" PRI_mpd_ssize_t, exp);
+ if (n < 0 || n >= MPD_EXPDIGITS+2) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "internal error in dec_sequence_as_str");
+ goto error;
+ }
+ }
+
+ Py_XDECREF(digits);
+ return decstring;
+
+
+error:
+ Py_XDECREF(digits);
+ if (decstring) PyMem_Free(decstring);
+ return NULL;
+}
+
+/* Currently accepts tuples and lists. */
+static PyObject *
+PyDecType_FromSequence(PyTypeObject *type, PyObject *v,
+ PyObject *context)
+{
+ PyObject *dectuple;
+ PyObject *dec;
+ char *s;
+
+ dectuple = sequence_as_tuple(v, PyExc_TypeError,
+ "argument must be a tuple or list");
+ if (dectuple == NULL) {
+ return NULL;
+ }
+
+ s = dectuple_as_str(dectuple);
+ Py_DECREF(dectuple);
+ if (s == NULL) {
+ return NULL;
+ }
+
+ dec = PyDecType_FromCString(type, s, context);
+
+ PyMem_Free(s);
+ return dec;
+}
+
+/* Currently accepts tuples and lists. */
+static PyObject *
+PyDecType_FromSequenceExact(PyTypeObject *type, PyObject *v,
+ PyObject *context)
+{
+ PyObject *dectuple;
+ PyObject *dec;
+ char *s;
+
+ dectuple = sequence_as_tuple(v, PyExc_TypeError,
+ "argument must be a tuple or list");
+ if (dectuple == NULL) {
+ return NULL;
+ }
+
+ s = dectuple_as_str(dectuple);
+ Py_DECREF(dectuple);
+ if (s == NULL) {
+ return NULL;
+ }
+
+ dec = PyDecType_FromCStringExact(type, s, context);
+
+ PyMem_Free(s);
+ return dec;
+}
+
+#define PyDec_FromCString(str, context) \
+ PyDecType_FromCString(&PyDec_Type, str, context)
+#define PyDec_FromCStringExact(str, context) \
+ PyDecType_FromCStringExact(&PyDec_Type, str, context)
+
+#define PyDec_FromUnicode(unicode, context) \
+ PyDecType_FromUnicode(&PyDec_Type, unicode, context)
+#define PyDec_FromUnicodeExact(unicode, context) \
+ PyDecType_FromUnicodeExact(&PyDec_Type, unicode, context)
+#define PyDec_FromUnicodeExactWS(unicode, context) \
+ PyDecType_FromUnicodeExactWS(&PyDec_Type, unicode, context)
+
+#define PyDec_FromSsize(v, context) \
+ PyDecType_FromSsize(&PyDec_Type, v, context)
+#define PyDec_FromSsizeExact(v, context) \
+ PyDecType_FromSsizeExact(&PyDec_Type, v, context)
+
+#define PyDec_FromLong(pylong, context) \
+ PyDecType_FromLong(&PyDec_Type, pylong, context)
+#define PyDec_FromLongExact(pylong, context) \
+ PyDecType_FromLongExact(&PyDec_Type, pylong, context)
+
+#define PyDec_FromFloat(pyfloat, context) \
+ PyDecType_FromFloat(&PyDec_Type, pyfloat, context)
+#define PyDec_FromFloatExact(pyfloat, context) \
+ PyDecType_FromFloatExact(&PyDec_Type, pyfloat, context)
+
+#define PyDec_FromSequence(sequence, context) \
+ PyDecType_FromSequence(&PyDec_Type, sequence, context)
+#define PyDec_FromSequenceExact(sequence, context) \
+ PyDecType_FromSequenceExact(&PyDec_Type, sequence, context)
+
+/* class method */
+static PyObject *
+dec_from_float(PyObject *type, PyObject *pyfloat)
+{
+ PyObject *context;
+ PyObject *result;
+
+ CURRENT_CONTEXT(context);
+ result = PyDecType_FromFloatExact(&PyDec_Type, pyfloat, context);
+ if (type != (PyObject *)&PyDec_Type && result != NULL) {
+ Py_SETREF(result, PyObject_CallFunctionObjArgs(type, result, NULL));
+ }
+
+ return result;
+}
+
+/* create_decimal_from_float */
+static PyObject *
+ctx_from_float(PyObject *context, PyObject *v)
+{
+ return PyDec_FromFloat(v, context);
+}
+
+/* Apply the context to the input operand. Return a new PyDecObject. */
+static PyObject *
+dec_apply(PyObject *v, PyObject *context)
+{
+ PyObject *result;
+ uint32_t status = 0;
+
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+
+ mpd_qcopy(MPD(result), MPD(v), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ mpd_qfinalize(MPD(result), CTX(context), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+/* 'v' can have any type accepted by the Decimal constructor. Attempt
+ an exact conversion. If the result does not meet the restrictions
+ for an mpd_t, fail with InvalidOperation. */
+static PyObject *
+PyDecType_FromObjectExact(PyTypeObject *type, PyObject *v, PyObject *context)
+{
+ if (v == NULL) {
+ return PyDecType_FromSsizeExact(type, 0, context);
+ }
+ else if (PyDec_Check(v)) {
+ return PyDecType_FromDecimalExact(type, v, context);
+ }
+ else if (PyUnicode_Check(v)) {
+ return PyDecType_FromUnicodeExactWS(type, v, context);
+ }
+ else if (PyLong_Check(v)) {
+ return PyDecType_FromLongExact(type, v, context);
+ }
+ else if (PyTuple_Check(v) || PyList_Check(v)) {
+ return PyDecType_FromSequenceExact(type, v, context);
+ }
+ else if (PyFloat_Check(v)) {
+ if (dec_addstatus(context, MPD_Float_operation)) {
+ return NULL;
+ }
+ return PyDecType_FromFloatExact(type, v, context);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "conversion from %s to Decimal is not supported",
+ Py_TYPE(v)->tp_name);
+ return NULL;
+ }
+}
+
+/* The context is used during conversion. This function is the
+ equivalent of context.create_decimal(). */
+static PyObject *
+PyDec_FromObject(PyObject *v, PyObject *context)
+{
+ if (v == NULL) {
+ return PyDec_FromSsize(0, context);
+ }
+ else if (PyDec_Check(v)) {
+ mpd_context_t *ctx = CTX(context);
+ if (mpd_isnan(MPD(v)) &&
+ MPD(v)->digits > ctx->prec - ctx->clamp) {
+ /* Special case: too many NaN payload digits */
+ PyObject *result;
+ if (dec_addstatus(context, MPD_Conversion_syntax)) {
+ return NULL;
+ }
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+ mpd_setspecial(MPD(result), MPD_POS, MPD_NAN);
+ return result;
+ }
+ return dec_apply(v, context);
+ }
+ else if (PyUnicode_Check(v)) {
+ return PyDec_FromUnicode(v, context);
+ }
+ else if (PyLong_Check(v)) {
+ return PyDec_FromLong(v, context);
+ }
+ else if (PyTuple_Check(v) || PyList_Check(v)) {
+ return PyDec_FromSequence(v, context);
+ }
+ else if (PyFloat_Check(v)) {
+ if (dec_addstatus(context, MPD_Float_operation)) {
+ return NULL;
+ }
+ return PyDec_FromFloat(v, context);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "conversion from %s to Decimal is not supported",
+ Py_TYPE(v)->tp_name);
+ return NULL;
+ }
+}
+
+static PyObject *
+dec_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"value", "context", NULL};
+ PyObject *v = NULL;
+ PyObject *context = Py_None;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist,
+ &v, &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+
+ return PyDecType_FromObjectExact(type, v, context);
+}
+
+static PyObject *
+ctx_create_decimal(PyObject *context, PyObject *args)
+{
+ PyObject *v = NULL;
+
+ if (!PyArg_ParseTuple(args, "|O", &v)) {
+ return NULL;
+ }
+
+ return PyDec_FromObject(v, context);
+}
+
+
+/******************************************************************************/
+/* Implicit conversions to Decimal */
+/******************************************************************************/
+
+/* Try to convert PyObject v to a new PyDecObject conv. If the conversion
+ fails, set conv to NULL (exception is set). If the conversion is not
+ implemented, set conv to Py_NotImplemented. */
+#define NOT_IMPL 0
+#define TYPE_ERR 1
+Py_LOCAL_INLINE(int)
+convert_op(int type_err, PyObject **conv, PyObject *v, PyObject *context)
+{
+
+ if (PyDec_Check(v)) {
+ *conv = Py_NewRef(v);
+ return 1;
+ }
+ if (PyLong_Check(v)) {
+ *conv = PyDec_FromLongExact(v, context);
+ if (*conv == NULL) {
+ return 0;
+ }
+ return 1;
+ }
+
+ if (type_err) {
+ PyErr_Format(PyExc_TypeError,
+ "conversion from %s to Decimal is not supported",
+ Py_TYPE(v)->tp_name);
+ }
+ else {
+ *conv = Py_NewRef(Py_NotImplemented);
+ }
+ return 0;
+}
+
+/* Return NotImplemented for unsupported types. */
+#define CONVERT_OP(a, v, context) \
+ if (!convert_op(NOT_IMPL, a, v, context)) { \
+ return *(a); \
+ }
+
+#define CONVERT_BINOP(a, b, v, w, context) \
+ if (!convert_op(NOT_IMPL, a, v, context)) { \
+ return *(a); \
+ } \
+ if (!convert_op(NOT_IMPL, b, w, context)) { \
+ Py_DECREF(*(a)); \
+ return *(b); \
+ }
+
+#define CONVERT_TERNOP(a, b, c, v, w, x, context) \
+ if (!convert_op(NOT_IMPL, a, v, context)) { \
+ return *(a); \
+ } \
+ if (!convert_op(NOT_IMPL, b, w, context)) { \
+ Py_DECREF(*(a)); \
+ return *(b); \
+ } \
+ if (!convert_op(NOT_IMPL, c, x, context)) { \
+ Py_DECREF(*(a)); \
+ Py_DECREF(*(b)); \
+ return *(c); \
+ }
+
+/* Raise TypeError for unsupported types. */
+#define CONVERT_OP_RAISE(a, v, context) \
+ if (!convert_op(TYPE_ERR, a, v, context)) { \
+ return NULL; \
+ }
+
+#define CONVERT_BINOP_RAISE(a, b, v, w, context) \
+ if (!convert_op(TYPE_ERR, a, v, context)) { \
+ return NULL; \
+ } \
+ if (!convert_op(TYPE_ERR, b, w, context)) { \
+ Py_DECREF(*(a)); \
+ return NULL; \
+ }
+
+#define CONVERT_TERNOP_RAISE(a, b, c, v, w, x, context) \
+ if (!convert_op(TYPE_ERR, a, v, context)) { \
+ return NULL; \
+ } \
+ if (!convert_op(TYPE_ERR, b, w, context)) { \
+ Py_DECREF(*(a)); \
+ return NULL; \
+ } \
+ if (!convert_op(TYPE_ERR, c, x, context)) { \
+ Py_DECREF(*(a)); \
+ Py_DECREF(*(b)); \
+ return NULL; \
+ }
+
+
+/******************************************************************************/
+/* Implicit conversions to Decimal for comparison */
+/******************************************************************************/
+
+/* Convert rationals for comparison */
+static PyObject *Rational = NULL;
+static PyObject *
+multiply_by_denominator(PyObject *v, PyObject *r, PyObject *context)
+{
+ PyObject *result;
+ PyObject *tmp = NULL;
+ PyObject *denom = NULL;
+ uint32_t status = 0;
+ mpd_context_t maxctx;
+ mpd_ssize_t exp;
+ mpd_t *vv;
+
+ /* v is not special, r is a rational */
+ tmp = PyObject_GetAttrString(r, "denominator");
+ if (tmp == NULL) {
+ return NULL;
+ }
+ denom = PyDec_FromLongExact(tmp, context);
+ Py_DECREF(tmp);
+ if (denom == NULL) {
+ return NULL;
+ }
+
+ vv = mpd_qncopy(MPD(v));
+ if (vv == NULL) {
+ Py_DECREF(denom);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(denom);
+ mpd_del(vv);
+ return NULL;
+ }
+
+ mpd_maxcontext(&maxctx);
+ /* Prevent Overflow in the following multiplication. The result of
+ the multiplication is only used in mpd_qcmp, which can handle
+ values that are technically out of bounds, like (for 32-bit)
+ 99999999999999999999...99999999e+425000000. */
+ exp = vv->exp;
+ vv->exp = 0;
+ mpd_qmul(MPD(result), vv, MPD(denom), &maxctx, &status);
+ MPD(result)->exp = exp;
+
+ Py_DECREF(denom);
+ mpd_del(vv);
+ /* If any status has been accumulated during the multiplication,
+ the result is invalid. This is very unlikely, since even the
+ 32-bit version supports 425000000 digits. */
+ if (status) {
+ PyErr_SetString(PyExc_ValueError,
+ "exact conversion for comparison failed");
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+static PyObject *
+numerator_as_decimal(PyObject *r, PyObject *context)
+{
+ PyObject *tmp, *num;
+
+ tmp = PyObject_GetAttrString(r, "numerator");
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ num = PyDec_FromLongExact(tmp, context);
+ Py_DECREF(tmp);
+ return num;
+}
+
+/* Convert v and w for comparison. v is a Decimal. If w is a Rational, both
+ v and w have to be transformed. Return 1 for success, with new references
+ to the converted objects in vcmp and wcmp. Return 0 for failure. In that
+ case wcmp is either NULL or Py_NotImplemented (new reference) and vcmp
+ is undefined. */
+static int
+convert_op_cmp(PyObject **vcmp, PyObject **wcmp, PyObject *v, PyObject *w,
+ int op, PyObject *context)
+{
+ mpd_context_t *ctx = CTX(context);
+
+ *vcmp = v;
+
+ if (PyDec_Check(w)) {
+ *wcmp = Py_NewRef(w);
+ }
+ else if (PyLong_Check(w)) {
+ *wcmp = PyDec_FromLongExact(w, context);
+ }
+ else if (PyFloat_Check(w)) {
+ if (op != Py_EQ && op != Py_NE &&
+ dec_addstatus(context, MPD_Float_operation)) {
+ *wcmp = NULL;
+ }
+ else {
+ ctx->status |= MPD_Float_operation;
+ *wcmp = PyDec_FromFloatExact(w, context);
+ }
+ }
+ else if (PyComplex_Check(w) && (op == Py_EQ || op == Py_NE)) {
+ Py_complex c = PyComplex_AsCComplex(w);
+ if (c.real == -1.0 && PyErr_Occurred()) {
+ *wcmp = NULL;
+ }
+ else if (c.imag == 0.0) {
+ PyObject *tmp = PyFloat_FromDouble(c.real);
+ if (tmp == NULL) {
+ *wcmp = NULL;
+ }
+ else {
+ ctx->status |= MPD_Float_operation;
+ *wcmp = PyDec_FromFloatExact(tmp, context);
+ Py_DECREF(tmp);
+ }
+ }
+ else {
+ *wcmp = Py_NewRef(Py_NotImplemented);
+ }
+ }
+ else {
+ int is_rational = PyObject_IsInstance(w, Rational);
+ if (is_rational < 0) {
+ *wcmp = NULL;
+ }
+ else if (is_rational > 0) {
+ *wcmp = numerator_as_decimal(w, context);
+ if (*wcmp && !mpd_isspecial(MPD(v))) {
+ *vcmp = multiply_by_denominator(v, w, context);
+ if (*vcmp == NULL) {
+ Py_CLEAR(*wcmp);
+ }
+ }
+ }
+ else {
+ *wcmp = Py_NewRef(Py_NotImplemented);
+ }
+ }
+
+ if (*wcmp == NULL || *wcmp == Py_NotImplemented) {
+ return 0;
+ }
+ if (*vcmp == v) {
+ Py_INCREF(v);
+ }
+ return 1;
+}
+
+#define CONVERT_BINOP_CMP(vcmp, wcmp, v, w, op, ctx) \
+ if (!convert_op_cmp(vcmp, wcmp, v, w, op, ctx)) { \
+ return *(wcmp); \
+ } \
+
+
+/******************************************************************************/
+/* Conversions from decimal */
+/******************************************************************************/
+
+static PyObject *
+unicode_fromascii(const char *s, Py_ssize_t size)
+{
+ PyObject *res;
+
+ res = PyUnicode_New(size, 127);
+ if (res == NULL) {
+ return NULL;
+ }
+
+ memcpy(PyUnicode_1BYTE_DATA(res), s, size);
+ return res;
+}
+
+/* PyDecObject as a string. The default module context is only used for
+ the value of 'capitals'. */
+static PyObject *
+dec_str(PyObject *dec)
+{
+ PyObject *res, *context;
+ mpd_ssize_t size;
+ char *cp;
+
+ CURRENT_CONTEXT(context);
+ size = mpd_to_sci_size(&cp, MPD(dec), CtxCaps(context));
+ if (size < 0) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ res = unicode_fromascii(cp, size);
+ mpd_free(cp);
+ return res;
+}
+
+/* Representation of a PyDecObject. */
+static PyObject *
+dec_repr(PyObject *dec)
+{
+ PyObject *res, *context;
+ char *cp;
+
+ CURRENT_CONTEXT(context);
+ cp = mpd_to_sci(MPD(dec), CtxCaps(context));
+ if (cp == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ res = PyUnicode_FromFormat("Decimal('%s')", cp);
+ mpd_free(cp);
+ return res;
+}
+
+/* Return a duplicate of src, copy embedded null characters. */
+static char *
+dec_strdup(const char *src, Py_ssize_t size)
+{
+ char *dest = PyMem_Malloc(size+1);
+ if (dest == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ memcpy(dest, src, size);
+ dest[size] = '\0';
+ return dest;
+}
+
+static void
+dec_replace_fillchar(char *dest)
+{
+ while (*dest != '\0') {
+ if (*dest == '\xff') *dest = '\0';
+ dest++;
+ }
+}
+
+/* Convert decimal_point or thousands_sep, which may be multibyte or in
+ the range [128, 255], to a UTF8 string. */
+static PyObject *
+dotsep_as_utf8(const char *s)
+{
+ PyObject *utf8;
+ PyObject *tmp;
+ wchar_t buf[2];
+ size_t n;
+
+ n = mbstowcs(buf, s, 2);
+ if (n != 1) { /* Issue #7442 */
+ PyErr_SetString(PyExc_ValueError,
+ "invalid decimal point or unsupported "
+ "combination of LC_CTYPE and LC_NUMERIC");
+ return NULL;
+ }
+ tmp = PyUnicode_FromWideChar(buf, n);
+ if (tmp == NULL) {
+ return NULL;
+ }
+ utf8 = PyUnicode_AsUTF8String(tmp);
+ Py_DECREF(tmp);
+ return utf8;
+}
+
+/* copy of libmpdec _mpd_round() */
+static void
+_mpd_round(mpd_t *result, const mpd_t *a, mpd_ssize_t prec,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t exp = a->exp + a->digits - prec;
+
+ if (prec <= 0) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isspecial(a) || mpd_iszero(a)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+ mpd_qrescale_fmt(result, a, exp, ctx, status);
+ if (result->digits > prec) {
+ mpd_qrescale_fmt(result, result, exp+1, ctx, status);
+ }
+}
+
+/* Locate negative zero "z" option within a UTF-8 format spec string.
+ * Returns pointer to "z", else NULL.
+ * The portion of the spec we're working with is [[fill]align][sign][z] */
+static const char *
+format_spec_z_search(char const *fmt, Py_ssize_t size) {
+ char const *pos = fmt;
+ char const *fmt_end = fmt + size;
+ /* skip over [[fill]align] (fill may be multi-byte character) */
+ pos += 1;
+ while (pos < fmt_end && *pos & 0x80) {
+ pos += 1;
+ }
+ if (pos < fmt_end && strchr("<>=^", *pos) != NULL) {
+ pos += 1;
+ } else {
+ /* fill not present-- skip over [align] */
+ pos = fmt;
+ if (pos < fmt_end && strchr("<>=^", *pos) != NULL) {
+ pos += 1;
+ }
+ }
+ /* skip over [sign] */
+ if (pos < fmt_end && strchr("+- ", *pos) != NULL) {
+ pos += 1;
+ }
+ return pos < fmt_end && *pos == 'z' ? pos : NULL;
+}
+
+static int
+dict_get_item_string(PyObject *dict, const char *key, PyObject **valueobj, const char **valuestr)
+{
+ *valueobj = NULL;
+ PyObject *keyobj = PyUnicode_FromString(key);
+ if (keyobj == NULL) {
+ return -1;
+ }
+ PyObject *value = PyDict_GetItemWithError(dict, keyobj);
+ Py_DECREF(keyobj);
+ if (value == NULL) {
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return 0;
+ }
+ value = PyUnicode_AsUTF8String(value);
+ if (value == NULL) {
+ return -1;
+ }
+ *valueobj = value;
+ *valuestr = PyBytes_AS_STRING(value);
+ return 0;
+}
+
+/* Formatted representation of a PyDecObject. */
+static PyObject *
+dec_format(PyObject *dec, PyObject *args)
+{
+ PyObject *result = NULL;
+ PyObject *override = NULL;
+ PyObject *dot = NULL;
+ PyObject *sep = NULL;
+ PyObject *grouping = NULL;
+ PyObject *fmtarg;
+ PyObject *context;
+ mpd_spec_t spec;
+ char const *fmt;
+ char *fmt_copy = NULL;
+ char *decstring = NULL;
+ uint32_t status = 0;
+ int replace_fillchar = 0;
+ int no_neg_0 = 0;
+ Py_ssize_t size;
+ mpd_t *mpd = MPD(dec);
+ mpd_uint_t dt[MPD_MINALLOC_MAX];
+ mpd_t tmp = {MPD_STATIC|MPD_STATIC_DATA,0,0,0,MPD_MINALLOC_MAX,dt};
+
+
+ CURRENT_CONTEXT(context);
+ if (!PyArg_ParseTuple(args, "O|O", &fmtarg, &override)) {
+ return NULL;
+ }
+
+ if (PyUnicode_Check(fmtarg)) {
+ fmt = PyUnicode_AsUTF8AndSize(fmtarg, &size);
+ if (fmt == NULL) {
+ return NULL;
+ }
+ /* NOTE: If https://github.com/python/cpython/pull/29438 lands, the
+ * format string manipulation below can be eliminated by enhancing
+ * the forked mpd_parse_fmt_str(). */
+ if (size > 0 && fmt[0] == '\0') {
+ /* NUL fill character: must be replaced with a valid UTF-8 char
+ before calling mpd_parse_fmt_str(). */
+ replace_fillchar = 1;
+ fmt = fmt_copy = dec_strdup(fmt, size);
+ if (fmt_copy == NULL) {
+ return NULL;
+ }
+ fmt_copy[0] = '_';
+ }
+ /* Strip 'z' option, which isn't understood by mpd_parse_fmt_str().
+ * NOTE: fmt is always null terminated by PyUnicode_AsUTF8AndSize() */
+ char const *z_position = format_spec_z_search(fmt, size);
+ if (z_position != NULL) {
+ no_neg_0 = 1;
+ size_t z_index = z_position - fmt;
+ if (fmt_copy == NULL) {
+ fmt = fmt_copy = dec_strdup(fmt, size);
+ if (fmt_copy == NULL) {
+ return NULL;
+ }
+ }
+ /* Shift characters (including null terminator) left,
+ overwriting the 'z' option. */
+ memmove(fmt_copy + z_index, fmt_copy + z_index + 1, size - z_index);
+ size -= 1;
+ }
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "format arg must be str");
+ return NULL;
+ }
+
+ if (!mpd_parse_fmt_str(&spec, fmt, CtxCaps(context))) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid format string");
+ goto finish;
+ }
+ if (replace_fillchar) {
+ /* In order to avoid clobbering parts of UTF-8 thousands separators or
+ decimal points when the substitution is reversed later, the actual
+ placeholder must be an invalid UTF-8 byte. */
+ spec.fill[0] = '\xff';
+ spec.fill[1] = '\0';
+ }
+
+ if (override) {
+ /* Values for decimal_point, thousands_sep and grouping can
+ be explicitly specified in the override dict. These values
+ take precedence over the values obtained from localeconv()
+ in mpd_parse_fmt_str(). The feature is not documented and
+ is only used in test_decimal. */
+ if (!PyDict_Check(override)) {
+ PyErr_SetString(PyExc_TypeError,
+ "optional argument must be a dict");
+ goto finish;
+ }
+ if (dict_get_item_string(override, "decimal_point", &dot, &spec.dot) ||
+ dict_get_item_string(override, "thousands_sep", &sep, &spec.sep) ||
+ dict_get_item_string(override, "grouping", &grouping, &spec.grouping))
+ {
+ goto finish;
+ }
+ if (mpd_validate_lconv(&spec) < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid override dict");
+ goto finish;
+ }
+ }
+ else {
+ size_t n = strlen(spec.dot);
+ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) {
+ /* fix locale dependent non-ascii characters */
+ dot = dotsep_as_utf8(spec.dot);
+ if (dot == NULL) {
+ goto finish;
+ }
+ spec.dot = PyBytes_AS_STRING(dot);
+ }
+ n = strlen(spec.sep);
+ if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) {
+ /* fix locale dependent non-ascii characters */
+ sep = dotsep_as_utf8(spec.sep);
+ if (sep == NULL) {
+ goto finish;
+ }
+ spec.sep = PyBytes_AS_STRING(sep);
+ }
+ }
+
+ if (no_neg_0 && mpd_isnegative(mpd) && !mpd_isspecial(mpd)) {
+ /* Round into a temporary (carefully mirroring the rounding
+ of mpd_qformat_spec()), and check if the result is negative zero.
+ If so, clear the sign and format the resulting positive zero. */
+ mpd_ssize_t prec;
+ mpd_qcopy(&tmp, mpd, &status);
+ if (spec.prec >= 0) {
+ switch (spec.type) {
+ case 'f':
+ mpd_qrescale(&tmp, &tmp, -spec.prec, CTX(context), &status);
+ break;
+ case '%':
+ tmp.exp += 2;
+ mpd_qrescale(&tmp, &tmp, -spec.prec, CTX(context), &status);
+ break;
+ case 'g':
+ prec = (spec.prec == 0) ? 1 : spec.prec;
+ if (tmp.digits > prec) {
+ _mpd_round(&tmp, &tmp, prec, CTX(context), &status);
+ }
+ break;
+ case 'e':
+ if (!mpd_iszero(&tmp)) {
+ _mpd_round(&tmp, &tmp, spec.prec+1, CTX(context), &status);
+ }
+ break;
+ }
+ }
+ if (status & MPD_Errors) {
+ PyErr_SetString(PyExc_ValueError, "unexpected error when rounding");
+ goto finish;
+ }
+ if (mpd_iszero(&tmp)) {
+ mpd_set_positive(&tmp);
+ mpd = &tmp;
+ }
+ }
+
+ decstring = mpd_qformat_spec(mpd, &spec, CTX(context), &status);
+ if (decstring == NULL) {
+ if (status & MPD_Malloc_error) {
+ PyErr_NoMemory();
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "format specification exceeds internal limits of _decimal");
+ }
+ goto finish;
+ }
+ size = strlen(decstring);
+ if (replace_fillchar) {
+ dec_replace_fillchar(decstring);
+ }
+
+ result = PyUnicode_DecodeUTF8(decstring, size, NULL);
+
+
+finish:
+ Py_XDECREF(grouping);
+ Py_XDECREF(sep);
+ Py_XDECREF(dot);
+ if (fmt_copy) PyMem_Free(fmt_copy);
+ if (decstring) mpd_free(decstring);
+ return result;
+}
+
+/* Return a PyLongObject from a PyDecObject, using the specified rounding
+ * mode. The context precision is not observed. */
+static PyObject *
+dec_as_long(PyObject *dec, PyObject *context, int round)
+{
+ PyLongObject *pylong;
+ digit *ob_digit;
+ size_t n;
+ mpd_t *x;
+ mpd_context_t workctx;
+ uint32_t status = 0;
+
+ if (mpd_isspecial(MPD(dec))) {
+ if (mpd_isnan(MPD(dec))) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot convert NaN to integer");
+ }
+ else {
+ PyErr_SetString(PyExc_OverflowError,
+ "cannot convert Infinity to integer");
+ }
+ return NULL;
+ }
+
+ x = mpd_qnew();
+ if (x == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ workctx = *CTX(context);
+ workctx.round = round;
+ mpd_qround_to_int(x, MPD(dec), &workctx, &status);
+ if (dec_addstatus(context, status)) {
+ mpd_del(x);
+ return NULL;
+ }
+
+ status = 0;
+ ob_digit = NULL;
+#if PYLONG_BITS_IN_DIGIT == 30
+ n = mpd_qexport_u32(&ob_digit, 0, PyLong_BASE, x, &status);
+#elif PYLONG_BITS_IN_DIGIT == 15
+ n = mpd_qexport_u16(&ob_digit, 0, PyLong_BASE, x, &status);
+#else
+ #error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
+#endif
+
+ if (n == SIZE_MAX) {
+ PyErr_NoMemory();
+ mpd_del(x);
+ return NULL;
+ }
+
+ if (n == 1) {
+ sdigit val = mpd_arith_sign(x) * ob_digit[0];
+ mpd_free(ob_digit);
+ mpd_del(x);
+ return PyLong_FromLong(val);
+ }
+
+ assert(n > 0);
+ assert(!mpd_iszero(x));
+ pylong = _PyLong_FromDigits(mpd_isnegative(x), n, ob_digit);
+ mpd_free(ob_digit);
+ mpd_del(x);
+ return (PyObject *) pylong;
+}
+
+/* Convert a Decimal to its exact integer ratio representation. */
+static PyObject *
+dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
+{
+ PyObject *numerator = NULL;
+ PyObject *denominator = NULL;
+ PyObject *exponent = NULL;
+ PyObject *result = NULL;
+ PyObject *tmp;
+ mpd_ssize_t exp;
+ PyObject *context;
+ uint32_t status = 0;
+
+ if (mpd_isspecial(MPD(self))) {
+ if (mpd_isnan(MPD(self))) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot convert NaN to integer ratio");
+ }
+ else {
+ PyErr_SetString(PyExc_OverflowError,
+ "cannot convert Infinity to integer ratio");
+ }
+ return NULL;
+ }
+
+ CURRENT_CONTEXT(context);
+
+ tmp = dec_alloc();
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ if (!mpd_qcopy(MPD(tmp), MPD(self), &status)) {
+ Py_DECREF(tmp);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ exp = mpd_iszero(MPD(tmp)) ? 0 : MPD(tmp)->exp;
+ MPD(tmp)->exp = 0;
+
+ /* context and rounding are unused here: the conversion is exact */
+ numerator = dec_as_long(tmp, context, MPD_ROUND_FLOOR);
+ Py_DECREF(tmp);
+ if (numerator == NULL) {
+ goto error;
+ }
+
+ exponent = PyLong_FromSsize_t(exp < 0 ? -exp : exp);
+ if (exponent == NULL) {
+ goto error;
+ }
+
+ tmp = PyLong_FromLong(10);
+ if (tmp == NULL) {
+ goto error;
+ }
+
+ Py_SETREF(exponent, _py_long_power(tmp, exponent, Py_None));
+ Py_DECREF(tmp);
+ if (exponent == NULL) {
+ goto error;
+ }
+
+ if (exp >= 0) {
+ Py_SETREF(numerator, _py_long_multiply(numerator, exponent));
+ if (numerator == NULL) {
+ goto error;
+ }
+ denominator = PyLong_FromLong(1);
+ if (denominator == NULL) {
+ goto error;
+ }
+ }
+ else {
+ denominator = exponent;
+ exponent = NULL;
+ tmp = _PyLong_GCD(numerator, denominator);
+ if (tmp == NULL) {
+ goto error;
+ }
+ Py_SETREF(numerator, _py_long_floor_divide(numerator, tmp));
+ if (numerator == NULL) {
+ Py_DECREF(tmp);
+ goto error;
+ }
+ Py_SETREF(denominator, _py_long_floor_divide(denominator, tmp));
+ Py_DECREF(tmp);
+ if (denominator == NULL) {
+ goto error;
+ }
+ }
+
+ result = PyTuple_Pack(2, numerator, denominator);
+
+
+error:
+ Py_XDECREF(exponent);
+ Py_XDECREF(denominator);
+ Py_XDECREF(numerator);
+ return result;
+}
+
+static PyObject *
+PyDec_ToIntegralValue(PyObject *dec, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"rounding", "context", NULL};
+ PyObject *result;
+ PyObject *rounding = Py_None;
+ PyObject *context = Py_None;
+ uint32_t status = 0;
+ mpd_context_t workctx;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist,
+ &rounding, &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+
+ workctx = *CTX(context);
+ if (rounding != Py_None) {
+ int round = getround(rounding);
+ if (round < 0) {
+ return NULL;
+ }
+ if (!mpd_qsetround(&workctx, round)) {
+ INTERNAL_ERROR_PTR("PyDec_ToIntegralValue"); /* GCOV_NOT_REACHED */
+ }
+ }
+
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+
+ mpd_qround_to_int(MPD(result), MPD(dec), &workctx, &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+static PyObject *
+PyDec_ToIntegralExact(PyObject *dec, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"rounding", "context", NULL};
+ PyObject *result;
+ PyObject *rounding = Py_None;
+ PyObject *context = Py_None;
+ uint32_t status = 0;
+ mpd_context_t workctx;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist,
+ &rounding, &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+
+ workctx = *CTX(context);
+ if (rounding != Py_None) {
+ int round = getround(rounding);
+ if (round < 0) {
+ return NULL;
+ }
+ if (!mpd_qsetround(&workctx, round)) {
+ INTERNAL_ERROR_PTR("PyDec_ToIntegralExact"); /* GCOV_NOT_REACHED */
+ }
+ }
+
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+
+ mpd_qround_to_intx(MPD(result), MPD(dec), &workctx, &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+static PyObject *
+PyDec_AsFloat(PyObject *dec)
+{
+ PyObject *f, *s;
+
+ if (mpd_isnan(MPD(dec))) {
+ if (mpd_issnan(MPD(dec))) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot convert signaling NaN to float");
+ return NULL;
+ }
+ if (mpd_isnegative(MPD(dec))) {
+ s = PyUnicode_FromString("-nan");
+ }
+ else {
+ s = PyUnicode_FromString("nan");
+ }
+ }
+ else {
+ s = dec_str(dec);
+ }
+
+ if (s == NULL) {
+ return NULL;
+ }
+
+ f = PyFloat_FromString(s);
+ Py_DECREF(s);
+
+ return f;
+}
+
+static PyObject *
+PyDec_Round(PyObject *dec, PyObject *args)
+{
+ PyObject *result;
+ PyObject *x = NULL;
+ uint32_t status = 0;
+ PyObject *context;
+
+
+ CURRENT_CONTEXT(context);
+ if (!PyArg_ParseTuple(args, "|O", &x)) {
+ return NULL;
+ }
+
+ if (x) {
+ mpd_uint_t dq[1] = {1};
+ mpd_t q = {MPD_STATIC|MPD_CONST_DATA,0,1,1,1,dq};
+ mpd_ssize_t y;
+
+ if (!PyLong_Check(x)) {
+ PyErr_SetString(PyExc_TypeError,
+ "optional arg must be an integer");
+ return NULL;
+ }
+
+ y = PyLong_AsSsize_t(x);
+ if (y == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+
+ q.exp = (y == MPD_SSIZE_MIN) ? MPD_SSIZE_MAX : -y;
+ mpd_qquantize(MPD(result), MPD(dec), &q, CTX(context), &status);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+ }
+ else {
+ return dec_as_long(dec, context, MPD_ROUND_HALF_EVEN);
+ }
+}
+
+static PyTypeObject *DecimalTuple = NULL;
+/* Return the DecimalTuple representation of a PyDecObject. */
+static PyObject *
+PyDec_AsTuple(PyObject *dec, PyObject *dummy UNUSED)
+{
+ PyObject *result = NULL;
+ PyObject *sign = NULL;
+ PyObject *coeff = NULL;
+ PyObject *expt = NULL;
+ PyObject *tmp = NULL;
+ mpd_t *x = NULL;
+ char *intstring = NULL;
+ Py_ssize_t intlen, i;
+
+
+ x = mpd_qncopy(MPD(dec));
+ if (x == NULL) {
+ PyErr_NoMemory();
+ goto out;
+ }
+
+ sign = PyLong_FromUnsignedLong(mpd_sign(MPD(dec)));
+ if (sign == NULL) {
+ goto out;
+ }
+
+ if (mpd_isinfinite(x)) {
+ expt = PyUnicode_FromString("F");
+ if (expt == NULL) {
+ goto out;
+ }
+ /* decimal.py has non-compliant infinity payloads. */
+ coeff = Py_BuildValue("(i)", 0);
+ if (coeff == NULL) {
+ goto out;
+ }
+ }
+ else {
+ if (mpd_isnan(x)) {
+ expt = PyUnicode_FromString(mpd_isqnan(x)?"n":"N");
+ }
+ else {
+ expt = PyLong_FromSsize_t(MPD(dec)->exp);
+ }
+ if (expt == NULL) {
+ goto out;
+ }
+
+ /* coefficient is defined */
+ if (x->len > 0) {
+
+ /* make an integer */
+ x->exp = 0;
+ /* clear NaN and sign */
+ mpd_clear_flags(x);
+ intstring = mpd_to_sci(x, 1);
+ if (intstring == NULL) {
+ PyErr_NoMemory();
+ goto out;
+ }
+
+ intlen = strlen(intstring);
+ coeff = PyTuple_New(intlen);
+ if (coeff == NULL) {
+ goto out;
+ }
+
+ for (i = 0; i < intlen; i++) {
+ tmp = PyLong_FromLong(intstring[i]-'0');
+ if (tmp == NULL) {
+ goto out;
+ }
+ PyTuple_SET_ITEM(coeff, i, tmp);
+ }
+ }
+ else {
+ coeff = PyTuple_New(0);
+ if (coeff == NULL) {
+ goto out;
+ }
+ }
+ }
+
+ result = PyObject_CallFunctionObjArgs((PyObject *)DecimalTuple,
+ sign, coeff, expt, NULL);
+
+out:
+ if (x) mpd_del(x);
+ if (intstring) mpd_free(intstring);
+ Py_XDECREF(sign);
+ Py_XDECREF(coeff);
+ Py_XDECREF(expt);
+ return result;
+}
+
+
+/******************************************************************************/
+/* Macros for converting mpdecimal functions to Decimal methods */
+/******************************************************************************/
+
+/* Unary number method that uses the default module context. */
+#define Dec_UnaryNumberMethod(MPDFUNC) \
+static PyObject * \
+nm_##MPDFUNC(PyObject *self) \
+{ \
+ PyObject *result; \
+ PyObject *context; \
+ uint32_t status = 0; \
+ \
+ CURRENT_CONTEXT(context); \
+ if ((result = dec_alloc()) == NULL) { \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(self), CTX(context), &status); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+/* Binary number method that uses default module context. */
+#define Dec_BinaryNumberMethod(MPDFUNC) \
+static PyObject * \
+nm_##MPDFUNC(PyObject *self, PyObject *other) \
+{ \
+ PyObject *a, *b; \
+ PyObject *result; \
+ PyObject *context; \
+ uint32_t status = 0; \
+ \
+ CURRENT_CONTEXT(context) ; \
+ CONVERT_BINOP(&a, &b, self, other, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b), CTX(context), &status); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+/* Boolean function without a context arg. */
+#define Dec_BoolFunc(MPDFUNC) \
+static PyObject * \
+dec_##MPDFUNC(PyObject *self, PyObject *dummy UNUSED) \
+{ \
+ return MPDFUNC(MPD(self)) ? incr_true() : incr_false(); \
+}
+
+/* Boolean function with an optional context arg. */
+#define Dec_BoolFuncVA(MPDFUNC) \
+static PyObject * \
+dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
+{ \
+ static char *kwlist[] = {"context", NULL}; \
+ PyObject *context = Py_None; \
+ \
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, \
+ &context)) { \
+ return NULL; \
+ } \
+ CONTEXT_CHECK_VA(context); \
+ \
+ return MPDFUNC(MPD(self), CTX(context)) ? incr_true() : incr_false(); \
+}
+
+/* Unary function with an optional context arg. */
+#define Dec_UnaryFuncVA(MPDFUNC) \
+static PyObject * \
+dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
+{ \
+ static char *kwlist[] = {"context", NULL}; \
+ PyObject *result; \
+ PyObject *context = Py_None; \
+ uint32_t status = 0; \
+ \
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, \
+ &context)) { \
+ return NULL; \
+ } \
+ CONTEXT_CHECK_VA(context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(self), CTX(context), &status); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+/* Binary function with an optional context arg. */
+#define Dec_BinaryFuncVA(MPDFUNC) \
+static PyObject * \
+dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
+{ \
+ static char *kwlist[] = {"other", "context", NULL}; \
+ PyObject *other; \
+ PyObject *a, *b; \
+ PyObject *result; \
+ PyObject *context = Py_None; \
+ uint32_t status = 0; \
+ \
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist, \
+ &other, &context)) { \
+ return NULL; \
+ } \
+ CONTEXT_CHECK_VA(context); \
+ CONVERT_BINOP_RAISE(&a, &b, self, other, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b), CTX(context), &status); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+/* Binary function with an optional context arg. Actual MPDFUNC does
+ NOT take a context. The context is used to record InvalidOperation
+ if the second operand cannot be converted exactly. */
+#define Dec_BinaryFuncVA_NO_CTX(MPDFUNC) \
+static PyObject * \
+dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
+{ \
+ static char *kwlist[] = {"other", "context", NULL}; \
+ PyObject *context = Py_None; \
+ PyObject *other; \
+ PyObject *a, *b; \
+ PyObject *result; \
+ \
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist, \
+ &other, &context)) { \
+ return NULL; \
+ } \
+ CONTEXT_CHECK_VA(context); \
+ CONVERT_BINOP_RAISE(&a, &b, self, other, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b)); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ \
+ return result; \
+}
+
+/* Ternary function with an optional context arg. */
+#define Dec_TernaryFuncVA(MPDFUNC) \
+static PyObject * \
+dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
+{ \
+ static char *kwlist[] = {"other", "third", "context", NULL}; \
+ PyObject *other, *third; \
+ PyObject *a, *b, *c; \
+ PyObject *result; \
+ PyObject *context = Py_None; \
+ uint32_t status = 0; \
+ \
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|O", kwlist, \
+ &other, &third, &context)) { \
+ return NULL; \
+ } \
+ CONTEXT_CHECK_VA(context); \
+ CONVERT_TERNOP_RAISE(&a, &b, &c, self, other, third, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ Py_DECREF(c); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b), MPD(c), CTX(context), &status); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ Py_DECREF(c); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+
+/**********************************************/
+/* Number methods */
+/**********************************************/
+
+Dec_UnaryNumberMethod(mpd_qminus)
+Dec_UnaryNumberMethod(mpd_qplus)
+Dec_UnaryNumberMethod(mpd_qabs)
+
+Dec_BinaryNumberMethod(mpd_qadd)
+Dec_BinaryNumberMethod(mpd_qsub)
+Dec_BinaryNumberMethod(mpd_qmul)
+Dec_BinaryNumberMethod(mpd_qdiv)
+Dec_BinaryNumberMethod(mpd_qrem)
+Dec_BinaryNumberMethod(mpd_qdivint)
+
+static PyObject *
+nm_dec_as_long(PyObject *dec)
+{
+ PyObject *context;
+
+ CURRENT_CONTEXT(context);
+ return dec_as_long(dec, context, MPD_ROUND_DOWN);
+}
+
+static int
+nm_nonzero(PyObject *v)
+{
+ return !mpd_iszero(MPD(v));
+}
+
+static PyObject *
+nm_mpd_qdivmod(PyObject *v, PyObject *w)
+{
+ PyObject *a, *b;
+ PyObject *q, *r;
+ PyObject *context;
+ uint32_t status = 0;
+ PyObject *ret;
+
+ CURRENT_CONTEXT(context);
+ CONVERT_BINOP(&a, &b, v, w, context);
+
+ q = dec_alloc();
+ if (q == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return NULL;
+ }
+ r = dec_alloc();
+ if (r == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ Py_DECREF(q);
+ return NULL;
+ }
+
+ mpd_qdivmod(MPD(q), MPD(r), MPD(a), MPD(b), CTX(context), &status);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(r);
+ Py_DECREF(q);
+ return NULL;
+ }
+
+ ret = Py_BuildValue("(OO)", q, r);
+ Py_DECREF(r);
+ Py_DECREF(q);
+ return ret;
+}
+
+static PyObject *
+nm_mpd_qpow(PyObject *base, PyObject *exp, PyObject *mod)
+{
+ PyObject *a, *b, *c = NULL;
+ PyObject *result;
+ PyObject *context;
+ uint32_t status = 0;
+
+ CURRENT_CONTEXT(context);
+ CONVERT_BINOP(&a, &b, base, exp, context);
+
+ if (mod != Py_None) {
+ if (!convert_op(NOT_IMPL, &c, mod, context)) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return c;
+ }
+ }
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ Py_XDECREF(c);
+ return NULL;
+ }
+
+ if (c == NULL) {
+ mpd_qpow(MPD(result), MPD(a), MPD(b),
+ CTX(context), &status);
+ }
+ else {
+ mpd_qpowmod(MPD(result), MPD(a), MPD(b), MPD(c),
+ CTX(context), &status);
+ Py_DECREF(c);
+ }
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+
+/******************************************************************************/
+/* Decimal Methods */
+/******************************************************************************/
+
+/* Unary arithmetic functions, optional context arg */
+Dec_UnaryFuncVA(mpd_qexp)
+Dec_UnaryFuncVA(mpd_qln)
+Dec_UnaryFuncVA(mpd_qlog10)
+Dec_UnaryFuncVA(mpd_qnext_minus)
+Dec_UnaryFuncVA(mpd_qnext_plus)
+Dec_UnaryFuncVA(mpd_qreduce)
+Dec_UnaryFuncVA(mpd_qsqrt)
+
+/* Binary arithmetic functions, optional context arg */
+Dec_BinaryFuncVA(mpd_qcompare)
+Dec_BinaryFuncVA(mpd_qcompare_signal)
+Dec_BinaryFuncVA(mpd_qmax)
+Dec_BinaryFuncVA(mpd_qmax_mag)
+Dec_BinaryFuncVA(mpd_qmin)
+Dec_BinaryFuncVA(mpd_qmin_mag)
+Dec_BinaryFuncVA(mpd_qnext_toward)
+Dec_BinaryFuncVA(mpd_qrem_near)
+
+/* Ternary arithmetic functions, optional context arg */
+Dec_TernaryFuncVA(mpd_qfma)
+
+/* Boolean functions, no context arg */
+Dec_BoolFunc(mpd_iscanonical)
+Dec_BoolFunc(mpd_isfinite)
+Dec_BoolFunc(mpd_isinfinite)
+Dec_BoolFunc(mpd_isnan)
+Dec_BoolFunc(mpd_isqnan)
+Dec_BoolFunc(mpd_issnan)
+Dec_BoolFunc(mpd_issigned)
+Dec_BoolFunc(mpd_iszero)
+
+/* Boolean functions, optional context arg */
+Dec_BoolFuncVA(mpd_isnormal)
+Dec_BoolFuncVA(mpd_issubnormal)
+
+/* Unary functions, no context arg */
+static PyObject *
+dec_mpd_adjexp(PyObject *self, PyObject *dummy UNUSED)
+{
+ mpd_ssize_t retval;
+
+ if (mpd_isspecial(MPD(self))) {
+ retval = 0;
+ }
+ else {
+ retval = mpd_adjexp(MPD(self));
+ }
+
+ return PyLong_FromSsize_t(retval);
+}
+
+static PyObject *
+dec_canonical(PyObject *self, PyObject *dummy UNUSED)
+{
+ return Py_NewRef(self);
+}
+
+static PyObject *
+dec_conjugate(PyObject *self, PyObject *dummy UNUSED)
+{
+ return Py_NewRef(self);
+}
+
+static PyObject *
+dec_mpd_radix(PyObject *self UNUSED, PyObject *dummy UNUSED)
+{
+ PyObject *result;
+
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+
+ _dec_settriple(result, MPD_POS, 10, 0);
+ return result;
+}
+
+static PyObject *
+dec_mpd_qcopy_abs(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *result;
+ uint32_t status = 0;
+
+ if ((result = dec_alloc()) == NULL) {
+ return NULL;
+ }
+
+ mpd_qcopy_abs(MPD(result), MPD(self), &status);
+ if (status & MPD_Malloc_error) {
+ Py_DECREF(result);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ return result;
+}
+
+static PyObject *
+dec_mpd_qcopy_negate(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *result;
+ uint32_t status = 0;
+
+ if ((result = dec_alloc()) == NULL) {
+ return NULL;
+ }
+
+ mpd_qcopy_negate(MPD(result), MPD(self), &status);
+ if (status & MPD_Malloc_error) {
+ Py_DECREF(result);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ return result;
+}
+
+/* Unary functions, optional context arg */
+Dec_UnaryFuncVA(mpd_qinvert)
+Dec_UnaryFuncVA(mpd_qlogb)
+
+static PyObject *
+dec_mpd_class(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"context", NULL};
+ PyObject *context = Py_None;
+ const char *cp;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist,
+ &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+
+ cp = mpd_class(MPD(self), CTX(context));
+ return PyUnicode_FromString(cp);
+}
+
+static PyObject *
+dec_mpd_to_eng(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"context", NULL};
+ PyObject *result;
+ PyObject *context = Py_None;
+ mpd_ssize_t size;
+ char *s;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist,
+ &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+
+ size = mpd_to_eng_size(&s, MPD(self), CtxCaps(context));
+ if (size < 0) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ result = unicode_fromascii(s, size);
+ mpd_free(s);
+
+ return result;
+}
+
+/* Binary functions, optional context arg for conversion errors */
+Dec_BinaryFuncVA_NO_CTX(mpd_compare_total)
+Dec_BinaryFuncVA_NO_CTX(mpd_compare_total_mag)
+
+static PyObject *
+dec_mpd_qcopy_sign(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"other", "context", NULL};
+ PyObject *other;
+ PyObject *a, *b;
+ PyObject *result;
+ PyObject *context = Py_None;
+ uint32_t status = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist,
+ &other, &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+ CONVERT_BINOP_RAISE(&a, &b, self, other, context);
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return NULL;
+ }
+
+ mpd_qcopy_sign(MPD(result), MPD(a), MPD(b), &status);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+static PyObject *
+dec_mpd_same_quantum(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"other", "context", NULL};
+ PyObject *other;
+ PyObject *a, *b;
+ PyObject *result;
+ PyObject *context = Py_None;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist,
+ &other, &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+ CONVERT_BINOP_RAISE(&a, &b, self, other, context);
+
+ result = mpd_same_quantum(MPD(a), MPD(b)) ? incr_true() : incr_false();
+ Py_DECREF(a);
+ Py_DECREF(b);
+
+ return result;
+}
+
+/* Binary functions, optional context arg */
+Dec_BinaryFuncVA(mpd_qand)
+Dec_BinaryFuncVA(mpd_qor)
+Dec_BinaryFuncVA(mpd_qxor)
+
+Dec_BinaryFuncVA(mpd_qrotate)
+Dec_BinaryFuncVA(mpd_qscaleb)
+Dec_BinaryFuncVA(mpd_qshift)
+
+static PyObject *
+dec_mpd_qquantize(PyObject *v, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"exp", "rounding", "context", NULL};
+ PyObject *rounding = Py_None;
+ PyObject *context = Py_None;
+ PyObject *w, *a, *b;
+ PyObject *result;
+ uint32_t status = 0;
+ mpd_context_t workctx;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO", kwlist,
+ &w, &rounding, &context)) {
+ return NULL;
+ }
+ CONTEXT_CHECK_VA(context);
+
+ workctx = *CTX(context);
+ if (rounding != Py_None) {
+ int round = getround(rounding);
+ if (round < 0) {
+ return NULL;
+ }
+ if (!mpd_qsetround(&workctx, round)) {
+ INTERNAL_ERROR_PTR("dec_mpd_qquantize"); /* GCOV_NOT_REACHED */
+ }
+ }
+
+ CONVERT_BINOP_RAISE(&a, &b, v, w, context);
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return NULL;
+ }
+
+ mpd_qquantize(MPD(result), MPD(a), MPD(b), &workctx, &status);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+/* Special methods */
+static PyObject *
+dec_richcompare(PyObject *v, PyObject *w, int op)
+{
+ PyObject *a;
+ PyObject *b;
+ PyObject *context;
+ uint32_t status = 0;
+ int a_issnan, b_issnan;
+ int r;
+
+ assert(PyDec_Check(v));
+
+ CURRENT_CONTEXT(context);
+ CONVERT_BINOP_CMP(&a, &b, v, w, op, context);
+
+ a_issnan = mpd_issnan(MPD(a));
+ b_issnan = mpd_issnan(MPD(b));
+
+ r = mpd_qcmp(MPD(a), MPD(b), &status);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (r == INT_MAX) {
+ /* sNaNs or op={le,ge,lt,gt} always signal. */
+ if (a_issnan || b_issnan || (op != Py_EQ && op != Py_NE)) {
+ if (dec_addstatus(context, status)) {
+ return NULL;
+ }
+ }
+ /* qNaN comparison with op={eq,ne} or comparison
+ * with InvalidOperation disabled. */
+ return (op == Py_NE) ? incr_true() : incr_false();
+ }
+
+ switch (op) {
+ case Py_EQ:
+ r = (r == 0);
+ break;
+ case Py_NE:
+ r = (r != 0);
+ break;
+ case Py_LE:
+ r = (r <= 0);
+ break;
+ case Py_GE:
+ r = (r >= 0);
+ break;
+ case Py_LT:
+ r = (r == -1);
+ break;
+ case Py_GT:
+ r = (r == 1);
+ break;
+ }
+
+ return PyBool_FromLong(r);
+}
+
+/* __ceil__ */
+static PyObject *
+dec_ceil(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *context;
+
+ CURRENT_CONTEXT(context);
+ return dec_as_long(self, context, MPD_ROUND_CEILING);
+}
+
+/* __complex__ */
+static PyObject *
+dec_complex(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *f;
+ double x;
+
+ f = PyDec_AsFloat(self);
+ if (f == NULL) {
+ return NULL;
+ }
+
+ x = PyFloat_AsDouble(f);
+ Py_DECREF(f);
+ if (x == -1.0 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ return PyComplex_FromDoubles(x, 0);
+}
+
+/* __copy__ and __deepcopy__ */
+static PyObject *
+dec_copy(PyObject *self, PyObject *dummy UNUSED)
+{
+ return Py_NewRef(self);
+}
+
+/* __floor__ */
+static PyObject *
+dec_floor(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *context;
+
+ CURRENT_CONTEXT(context);
+ return dec_as_long(self, context, MPD_ROUND_FLOOR);
+}
+
+/* Always uses the module context */
+static Py_hash_t
+_dec_hash(PyDecObject *v)
+{
+#if defined(CONFIG_64) && _PyHASH_BITS == 61
+ /* 2**61 - 1 */
+ mpd_uint_t p_data[1] = {2305843009213693951ULL};
+ mpd_t p = {MPD_POS|MPD_STATIC|MPD_CONST_DATA, 0, 19, 1, 1, p_data};
+ /* Inverse of 10 modulo p */
+ mpd_uint_t inv10_p_data[1] = {2075258708292324556ULL};
+ mpd_t inv10_p = {MPD_POS|MPD_STATIC|MPD_CONST_DATA,
+ 0, 19, 1, 1, inv10_p_data};
+#elif defined(CONFIG_32) && _PyHASH_BITS == 31
+ /* 2**31 - 1 */
+ mpd_uint_t p_data[2] = {147483647UL, 2};
+ mpd_t p = {MPD_POS|MPD_STATIC|MPD_CONST_DATA, 0, 10, 2, 2, p_data};
+ /* Inverse of 10 modulo p */
+ mpd_uint_t inv10_p_data[2] = {503238553UL, 1};
+ mpd_t inv10_p = {MPD_POS|MPD_STATIC|MPD_CONST_DATA,
+ 0, 10, 2, 2, inv10_p_data};
+#else
+ #error "No valid combination of CONFIG_64, CONFIG_32 and _PyHASH_BITS"
+#endif
+ const Py_hash_t py_hash_inf = 314159;
+ mpd_uint_t ten_data[1] = {10};
+ mpd_t ten = {MPD_POS|MPD_STATIC|MPD_CONST_DATA,
+ 0, 2, 1, 1, ten_data};
+ Py_hash_t result;
+ mpd_t *exp_hash = NULL;
+ mpd_t *tmp = NULL;
+ mpd_ssize_t exp;
+ uint32_t status = 0;
+ mpd_context_t maxctx;
+
+
+ if (mpd_isspecial(MPD(v))) {
+ if (mpd_issnan(MPD(v))) {
+ PyErr_SetString(PyExc_TypeError,
+ "Cannot hash a signaling NaN value");
+ return -1;
+ }
+ else if (mpd_isnan(MPD(v))) {
+ return _Py_HashPointer(v);
+ }
+ else {
+ return py_hash_inf * mpd_arith_sign(MPD(v));
+ }
+ }
+
+ mpd_maxcontext(&maxctx);
+ exp_hash = mpd_qnew();
+ if (exp_hash == NULL) {
+ goto malloc_error;
+ }
+ tmp = mpd_qnew();
+ if (tmp == NULL) {
+ goto malloc_error;
+ }
+
+ /*
+ * exp(v): exponent of v
+ * int(v): coefficient of v
+ */
+ exp = MPD(v)->exp;
+ if (exp >= 0) {
+ /* 10**exp(v) % p */
+ mpd_qsset_ssize(tmp, exp, &maxctx, &status);
+ mpd_qpowmod(exp_hash, &ten, tmp, &p, &maxctx, &status);
+ }
+ else {
+ /* inv10_p**(-exp(v)) % p */
+ mpd_qsset_ssize(tmp, -exp, &maxctx, &status);
+ mpd_qpowmod(exp_hash, &inv10_p, tmp, &p, &maxctx, &status);
+ }
+
+ /* hash = (int(v) * exp_hash) % p */
+ if (!mpd_qcopy(tmp, MPD(v), &status)) {
+ goto malloc_error;
+ }
+ tmp->exp = 0;
+ mpd_set_positive(tmp);
+
+ maxctx.prec = MPD_MAX_PREC + 21;
+ maxctx.emax = MPD_MAX_EMAX + 21;
+ maxctx.emin = MPD_MIN_EMIN - 21;
+
+ mpd_qmul(tmp, tmp, exp_hash, &maxctx, &status);
+ mpd_qrem(tmp, tmp, &p, &maxctx, &status);
+
+ result = mpd_qget_ssize(tmp, &status);
+ result = mpd_ispositive(MPD(v)) ? result : -result;
+ result = (result == -1) ? -2 : result;
+
+ if (status != 0) {
+ if (status & MPD_Malloc_error) {
+ goto malloc_error;
+ }
+ else {
+ PyErr_SetString(PyExc_RuntimeError, /* GCOV_NOT_REACHED */
+ "dec_hash: internal error: please report"); /* GCOV_NOT_REACHED */
+ }
+ result = -1; /* GCOV_NOT_REACHED */
+ }
+
+
+finish:
+ if (exp_hash) mpd_del(exp_hash);
+ if (tmp) mpd_del(tmp);
+ return result;
+
+malloc_error:
+ PyErr_NoMemory();
+ result = -1;
+ goto finish;
+}
+
+static Py_hash_t
+dec_hash(PyDecObject *self)
+{
+ if (self->hash == -1) {
+ self->hash = _dec_hash(self);
+ }
+
+ return self->hash;
+}
+
+/* __reduce__ */
+static PyObject *
+dec_reduce(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *result, *str;
+
+ str = dec_str(self);
+ if (str == NULL) {
+ return NULL;
+ }
+
+ result = Py_BuildValue("O(O)", Py_TYPE(self), str);
+ Py_DECREF(str);
+
+ return result;
+}
+
+/* __sizeof__ */
+static PyObject *
+dec_sizeof(PyObject *v, PyObject *dummy UNUSED)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(v));
+ if (mpd_isdynamic_data(MPD(v))) {
+ res += (size_t)MPD(v)->alloc * sizeof(mpd_uint_t);
+ }
+ return PyLong_FromSize_t(res);
+}
+
+/* __trunc__ */
+static PyObject *
+dec_trunc(PyObject *self, PyObject *dummy UNUSED)
+{
+ PyObject *context;
+
+ CURRENT_CONTEXT(context);
+ return dec_as_long(self, context, MPD_ROUND_DOWN);
+}
+
+/* real and imag */
+static PyObject *
+dec_real(PyObject *self, void *closure UNUSED)
+{
+ return Py_NewRef(self);
+}
+
+static PyObject *
+dec_imag(PyObject *self UNUSED, void *closure UNUSED)
+{
+ PyObject *result;
+
+ result = dec_alloc();
+ if (result == NULL) {
+ return NULL;
+ }
+
+ _dec_settriple(result, MPD_POS, 0, 0);
+ return result;
+}
+
+
+static PyGetSetDef dec_getsets [] =
+{
+ { "real", (getter)dec_real, NULL, NULL, NULL},
+ { "imag", (getter)dec_imag, NULL, NULL, NULL},
+ {NULL}
+};
+
+static PyNumberMethods dec_number_methods =
+{
+ (binaryfunc) nm_mpd_qadd,
+ (binaryfunc) nm_mpd_qsub,
+ (binaryfunc) nm_mpd_qmul,
+ (binaryfunc) nm_mpd_qrem,
+ (binaryfunc) nm_mpd_qdivmod,
+ (ternaryfunc) nm_mpd_qpow,
+ (unaryfunc) nm_mpd_qminus,
+ (unaryfunc) nm_mpd_qplus,
+ (unaryfunc) nm_mpd_qabs,
+ (inquiry) nm_nonzero,
+ (unaryfunc) 0, /* no bit-complement */
+ (binaryfunc) 0, /* no shiftl */
+ (binaryfunc) 0, /* no shiftr */
+ (binaryfunc) 0, /* no bit-and */
+ (binaryfunc) 0, /* no bit-xor */
+ (binaryfunc) 0, /* no bit-ior */
+ (unaryfunc) nm_dec_as_long,
+ 0, /* nb_reserved */
+ (unaryfunc) PyDec_AsFloat,
+ 0, /* binaryfunc nb_inplace_add; */
+ 0, /* binaryfunc nb_inplace_subtract; */
+ 0, /* binaryfunc nb_inplace_multiply; */
+ 0, /* binaryfunc nb_inplace_remainder; */
+ 0, /* ternaryfunc nb_inplace_power; */
+ 0, /* binaryfunc nb_inplace_lshift; */
+ 0, /* binaryfunc nb_inplace_rshift; */
+ 0, /* binaryfunc nb_inplace_and; */
+ 0, /* binaryfunc nb_inplace_xor; */
+ 0, /* binaryfunc nb_inplace_or; */
+ (binaryfunc) nm_mpd_qdivint, /* binaryfunc nb_floor_divide; */
+ (binaryfunc) nm_mpd_qdiv, /* binaryfunc nb_true_divide; */
+ 0, /* binaryfunc nb_inplace_floor_divide; */
+ 0, /* binaryfunc nb_inplace_true_divide; */
+};
+
+static PyMethodDef dec_methods [] =
+{
+ /* Unary arithmetic functions, optional context arg */
+ { "exp", _PyCFunction_CAST(dec_mpd_qexp), METH_VARARGS|METH_KEYWORDS, doc_exp },
+ { "ln", _PyCFunction_CAST(dec_mpd_qln), METH_VARARGS|METH_KEYWORDS, doc_ln },
+ { "log10", _PyCFunction_CAST(dec_mpd_qlog10), METH_VARARGS|METH_KEYWORDS, doc_log10 },
+ { "next_minus", _PyCFunction_CAST(dec_mpd_qnext_minus), METH_VARARGS|METH_KEYWORDS, doc_next_minus },
+ { "next_plus", _PyCFunction_CAST(dec_mpd_qnext_plus), METH_VARARGS|METH_KEYWORDS, doc_next_plus },
+ { "normalize", _PyCFunction_CAST(dec_mpd_qreduce), METH_VARARGS|METH_KEYWORDS, doc_normalize },
+ { "to_integral", _PyCFunction_CAST(PyDec_ToIntegralValue), METH_VARARGS|METH_KEYWORDS, doc_to_integral },
+ { "to_integral_exact", _PyCFunction_CAST(PyDec_ToIntegralExact), METH_VARARGS|METH_KEYWORDS, doc_to_integral_exact },
+ { "to_integral_value", _PyCFunction_CAST(PyDec_ToIntegralValue), METH_VARARGS|METH_KEYWORDS, doc_to_integral_value },
+ { "sqrt", _PyCFunction_CAST(dec_mpd_qsqrt), METH_VARARGS|METH_KEYWORDS, doc_sqrt },
+
+ /* Binary arithmetic functions, optional context arg */
+ { "compare", _PyCFunction_CAST(dec_mpd_qcompare), METH_VARARGS|METH_KEYWORDS, doc_compare },
+ { "compare_signal", _PyCFunction_CAST(dec_mpd_qcompare_signal), METH_VARARGS|METH_KEYWORDS, doc_compare_signal },
+ { "max", _PyCFunction_CAST(dec_mpd_qmax), METH_VARARGS|METH_KEYWORDS, doc_max },
+ { "max_mag", _PyCFunction_CAST(dec_mpd_qmax_mag), METH_VARARGS|METH_KEYWORDS, doc_max_mag },
+ { "min", _PyCFunction_CAST(dec_mpd_qmin), METH_VARARGS|METH_KEYWORDS, doc_min },
+ { "min_mag", _PyCFunction_CAST(dec_mpd_qmin_mag), METH_VARARGS|METH_KEYWORDS, doc_min_mag },
+ { "next_toward", _PyCFunction_CAST(dec_mpd_qnext_toward), METH_VARARGS|METH_KEYWORDS, doc_next_toward },
+ { "quantize", _PyCFunction_CAST(dec_mpd_qquantize), METH_VARARGS|METH_KEYWORDS, doc_quantize },
+ { "remainder_near", _PyCFunction_CAST(dec_mpd_qrem_near), METH_VARARGS|METH_KEYWORDS, doc_remainder_near },
+
+ /* Ternary arithmetic functions, optional context arg */
+ { "fma", _PyCFunction_CAST(dec_mpd_qfma), METH_VARARGS|METH_KEYWORDS, doc_fma },
+
+ /* Boolean functions, no context arg */
+ { "is_canonical", dec_mpd_iscanonical, METH_NOARGS, doc_is_canonical },
+ { "is_finite", dec_mpd_isfinite, METH_NOARGS, doc_is_finite },
+ { "is_infinite", dec_mpd_isinfinite, METH_NOARGS, doc_is_infinite },
+ { "is_nan", dec_mpd_isnan, METH_NOARGS, doc_is_nan },
+ { "is_qnan", dec_mpd_isqnan, METH_NOARGS, doc_is_qnan },
+ { "is_snan", dec_mpd_issnan, METH_NOARGS, doc_is_snan },
+ { "is_signed", dec_mpd_issigned, METH_NOARGS, doc_is_signed },
+ { "is_zero", dec_mpd_iszero, METH_NOARGS, doc_is_zero },
+
+ /* Boolean functions, optional context arg */
+ { "is_normal", _PyCFunction_CAST(dec_mpd_isnormal), METH_VARARGS|METH_KEYWORDS, doc_is_normal },
+ { "is_subnormal", _PyCFunction_CAST(dec_mpd_issubnormal), METH_VARARGS|METH_KEYWORDS, doc_is_subnormal },
+
+ /* Unary functions, no context arg */
+ { "adjusted", dec_mpd_adjexp, METH_NOARGS, doc_adjusted },
+ { "canonical", dec_canonical, METH_NOARGS, doc_canonical },
+ { "conjugate", dec_conjugate, METH_NOARGS, doc_conjugate },
+ { "radix", dec_mpd_radix, METH_NOARGS, doc_radix },
+
+ /* Unary functions, optional context arg for conversion errors */
+ { "copy_abs", dec_mpd_qcopy_abs, METH_NOARGS, doc_copy_abs },
+ { "copy_negate", dec_mpd_qcopy_negate, METH_NOARGS, doc_copy_negate },
+
+ /* Unary functions, optional context arg */
+ { "logb", _PyCFunction_CAST(dec_mpd_qlogb), METH_VARARGS|METH_KEYWORDS, doc_logb },
+ { "logical_invert", _PyCFunction_CAST(dec_mpd_qinvert), METH_VARARGS|METH_KEYWORDS, doc_logical_invert },
+ { "number_class", _PyCFunction_CAST(dec_mpd_class), METH_VARARGS|METH_KEYWORDS, doc_number_class },
+ { "to_eng_string", _PyCFunction_CAST(dec_mpd_to_eng), METH_VARARGS|METH_KEYWORDS, doc_to_eng_string },
+
+ /* Binary functions, optional context arg for conversion errors */
+ { "compare_total", _PyCFunction_CAST(dec_mpd_compare_total), METH_VARARGS|METH_KEYWORDS, doc_compare_total },
+ { "compare_total_mag", _PyCFunction_CAST(dec_mpd_compare_total_mag), METH_VARARGS|METH_KEYWORDS, doc_compare_total_mag },
+ { "copy_sign", _PyCFunction_CAST(dec_mpd_qcopy_sign), METH_VARARGS|METH_KEYWORDS, doc_copy_sign },
+ { "same_quantum", _PyCFunction_CAST(dec_mpd_same_quantum), METH_VARARGS|METH_KEYWORDS, doc_same_quantum },
+
+ /* Binary functions, optional context arg */
+ { "logical_and", _PyCFunction_CAST(dec_mpd_qand), METH_VARARGS|METH_KEYWORDS, doc_logical_and },
+ { "logical_or", _PyCFunction_CAST(dec_mpd_qor), METH_VARARGS|METH_KEYWORDS, doc_logical_or },
+ { "logical_xor", _PyCFunction_CAST(dec_mpd_qxor), METH_VARARGS|METH_KEYWORDS, doc_logical_xor },
+ { "rotate", _PyCFunction_CAST(dec_mpd_qrotate), METH_VARARGS|METH_KEYWORDS, doc_rotate },
+ { "scaleb", _PyCFunction_CAST(dec_mpd_qscaleb), METH_VARARGS|METH_KEYWORDS, doc_scaleb },
+ { "shift", _PyCFunction_CAST(dec_mpd_qshift), METH_VARARGS|METH_KEYWORDS, doc_shift },
+
+ /* Miscellaneous */
+ { "from_float", dec_from_float, METH_O|METH_CLASS, doc_from_float },
+ { "as_tuple", PyDec_AsTuple, METH_NOARGS, doc_as_tuple },
+ { "as_integer_ratio", dec_as_integer_ratio, METH_NOARGS, doc_as_integer_ratio },
+
+ /* Special methods */
+ { "__copy__", dec_copy, METH_NOARGS, NULL },
+ { "__deepcopy__", dec_copy, METH_O, NULL },
+ { "__format__", dec_format, METH_VARARGS, NULL },
+ { "__reduce__", dec_reduce, METH_NOARGS, NULL },
+ { "__round__", PyDec_Round, METH_VARARGS, NULL },
+ { "__ceil__", dec_ceil, METH_NOARGS, NULL },
+ { "__floor__", dec_floor, METH_NOARGS, NULL },
+ { "__trunc__", dec_trunc, METH_NOARGS, NULL },
+ { "__complex__", dec_complex, METH_NOARGS, NULL },
+ { "__sizeof__", dec_sizeof, METH_NOARGS, NULL },
+
+ { NULL, NULL, 1 }
+};
+
+static PyTypeObject PyDec_Type =
+{
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "decimal.Decimal", /* tp_name */
+ sizeof(PyDecObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor) dec_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ (getattrfunc) 0, /* tp_getattr */
+ (setattrfunc) 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc) dec_repr, /* tp_repr */
+ &dec_number_methods, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc) dec_hash, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc) dec_str, /* tp_str */
+ (getattrofunc) PyObject_GenericGetAttr, /* tp_getattro */
+ (setattrofunc) 0, /* tp_setattro */
+ (PyBufferProcs *) 0, /* tp_as_buffer */
+ (Py_TPFLAGS_DEFAULT|
+ Py_TPFLAGS_BASETYPE), /* tp_flags */
+ doc_decimal, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ dec_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ dec_methods, /* tp_methods */
+ 0, /* tp_members */
+ dec_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ dec_new, /* tp_new */
+ PyObject_Del, /* tp_free */
+};
+
+
+/******************************************************************************/
+/* Context Object, Part 2 */
+/******************************************************************************/
+
+
+/************************************************************************/
+/* Macros for converting mpdecimal functions to Context methods */
+/************************************************************************/
+
+/* Boolean context method. */
+#define DecCtx_BoolFunc(MPDFUNC) \
+static PyObject * \
+ctx_##MPDFUNC(PyObject *context, PyObject *v) \
+{ \
+ PyObject *ret; \
+ PyObject *a; \
+ \
+ CONVERT_OP_RAISE(&a, v, context); \
+ \
+ ret = MPDFUNC(MPD(a), CTX(context)) ? incr_true() : incr_false(); \
+ Py_DECREF(a); \
+ return ret; \
+}
+
+/* Boolean context method. MPDFUNC does NOT use a context. */
+#define DecCtx_BoolFunc_NO_CTX(MPDFUNC) \
+static PyObject * \
+ctx_##MPDFUNC(PyObject *context, PyObject *v) \
+{ \
+ PyObject *ret; \
+ PyObject *a; \
+ \
+ CONVERT_OP_RAISE(&a, v, context); \
+ \
+ ret = MPDFUNC(MPD(a)) ? incr_true() : incr_false(); \
+ Py_DECREF(a); \
+ return ret; \
+}
+
+/* Unary context method. */
+#define DecCtx_UnaryFunc(MPDFUNC) \
+static PyObject * \
+ctx_##MPDFUNC(PyObject *context, PyObject *v) \
+{ \
+ PyObject *result, *a; \
+ uint32_t status = 0; \
+ \
+ CONVERT_OP_RAISE(&a, v, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), CTX(context), &status); \
+ Py_DECREF(a); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+/* Binary context method. */
+#define DecCtx_BinaryFunc(MPDFUNC) \
+static PyObject * \
+ctx_##MPDFUNC(PyObject *context, PyObject *args) \
+{ \
+ PyObject *v, *w; \
+ PyObject *a, *b; \
+ PyObject *result; \
+ uint32_t status = 0; \
+ \
+ if (!PyArg_ParseTuple(args, "OO", &v, &w)) { \
+ return NULL; \
+ } \
+ \
+ CONVERT_BINOP_RAISE(&a, &b, v, w, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b), CTX(context), &status); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+/*
+ * Binary context method. The context is only used for conversion.
+ * The actual MPDFUNC does NOT take a context arg.
+ */
+#define DecCtx_BinaryFunc_NO_CTX(MPDFUNC) \
+static PyObject * \
+ctx_##MPDFUNC(PyObject *context, PyObject *args) \
+{ \
+ PyObject *v, *w; \
+ PyObject *a, *b; \
+ PyObject *result; \
+ \
+ if (!PyArg_ParseTuple(args, "OO", &v, &w)) { \
+ return NULL; \
+ } \
+ \
+ CONVERT_BINOP_RAISE(&a, &b, v, w, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b)); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ \
+ return result; \
+}
+
+/* Ternary context method. */
+#define DecCtx_TernaryFunc(MPDFUNC) \
+static PyObject * \
+ctx_##MPDFUNC(PyObject *context, PyObject *args) \
+{ \
+ PyObject *v, *w, *x; \
+ PyObject *a, *b, *c; \
+ PyObject *result; \
+ uint32_t status = 0; \
+ \
+ if (!PyArg_ParseTuple(args, "OOO", &v, &w, &x)) { \
+ return NULL; \
+ } \
+ \
+ CONVERT_TERNOP_RAISE(&a, &b, &c, v, w, x, context); \
+ \
+ if ((result = dec_alloc()) == NULL) { \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ Py_DECREF(c); \
+ return NULL; \
+ } \
+ \
+ MPDFUNC(MPD(result), MPD(a), MPD(b), MPD(c), CTX(context), &status); \
+ Py_DECREF(a); \
+ Py_DECREF(b); \
+ Py_DECREF(c); \
+ if (dec_addstatus(context, status)) { \
+ Py_DECREF(result); \
+ return NULL; \
+ } \
+ \
+ return result; \
+}
+
+
+/* Unary arithmetic functions */
+DecCtx_UnaryFunc(mpd_qabs)
+DecCtx_UnaryFunc(mpd_qexp)
+DecCtx_UnaryFunc(mpd_qln)
+DecCtx_UnaryFunc(mpd_qlog10)
+DecCtx_UnaryFunc(mpd_qminus)
+DecCtx_UnaryFunc(mpd_qnext_minus)
+DecCtx_UnaryFunc(mpd_qnext_plus)
+DecCtx_UnaryFunc(mpd_qplus)
+DecCtx_UnaryFunc(mpd_qreduce)
+DecCtx_UnaryFunc(mpd_qround_to_int)
+DecCtx_UnaryFunc(mpd_qround_to_intx)
+DecCtx_UnaryFunc(mpd_qsqrt)
+
+/* Binary arithmetic functions */
+DecCtx_BinaryFunc(mpd_qadd)
+DecCtx_BinaryFunc(mpd_qcompare)
+DecCtx_BinaryFunc(mpd_qcompare_signal)
+DecCtx_BinaryFunc(mpd_qdiv)
+DecCtx_BinaryFunc(mpd_qdivint)
+DecCtx_BinaryFunc(mpd_qmax)
+DecCtx_BinaryFunc(mpd_qmax_mag)
+DecCtx_BinaryFunc(mpd_qmin)
+DecCtx_BinaryFunc(mpd_qmin_mag)
+DecCtx_BinaryFunc(mpd_qmul)
+DecCtx_BinaryFunc(mpd_qnext_toward)
+DecCtx_BinaryFunc(mpd_qquantize)
+DecCtx_BinaryFunc(mpd_qrem)
+DecCtx_BinaryFunc(mpd_qrem_near)
+DecCtx_BinaryFunc(mpd_qsub)
+
+static PyObject *
+ctx_mpd_qdivmod(PyObject *context, PyObject *args)
+{
+ PyObject *v, *w;
+ PyObject *a, *b;
+ PyObject *q, *r;
+ uint32_t status = 0;
+ PyObject *ret;
+
+ if (!PyArg_ParseTuple(args, "OO", &v, &w)) {
+ return NULL;
+ }
+
+ CONVERT_BINOP_RAISE(&a, &b, v, w, context);
+
+ q = dec_alloc();
+ if (q == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return NULL;
+ }
+ r = dec_alloc();
+ if (r == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ Py_DECREF(q);
+ return NULL;
+ }
+
+ mpd_qdivmod(MPD(q), MPD(r), MPD(a), MPD(b), CTX(context), &status);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(r);
+ Py_DECREF(q);
+ return NULL;
+ }
+
+ ret = Py_BuildValue("(OO)", q, r);
+ Py_DECREF(r);
+ Py_DECREF(q);
+ return ret;
+}
+
+/* Binary or ternary arithmetic functions */
+static PyObject *
+ctx_mpd_qpow(PyObject *context, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"a", "b", "modulo", NULL};
+ PyObject *base, *exp, *mod = Py_None;
+ PyObject *a, *b, *c = NULL;
+ PyObject *result;
+ uint32_t status = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|O", kwlist,
+ &base, &exp, &mod)) {
+ return NULL;
+ }
+
+ CONVERT_BINOP_RAISE(&a, &b, base, exp, context);
+
+ if (mod != Py_None) {
+ if (!convert_op(TYPE_ERR, &c, mod, context)) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return c;
+ }
+ }
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ Py_XDECREF(c);
+ return NULL;
+ }
+
+ if (c == NULL) {
+ mpd_qpow(MPD(result), MPD(a), MPD(b),
+ CTX(context), &status);
+ }
+ else {
+ mpd_qpowmod(MPD(result), MPD(a), MPD(b), MPD(c),
+ CTX(context), &status);
+ Py_DECREF(c);
+ }
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+/* Ternary arithmetic functions */
+DecCtx_TernaryFunc(mpd_qfma)
+
+/* No argument */
+static PyObject *
+ctx_mpd_radix(PyObject *context, PyObject *dummy)
+{
+ return dec_mpd_radix(context, dummy);
+}
+
+/* Boolean functions: single decimal argument */
+DecCtx_BoolFunc(mpd_isnormal)
+DecCtx_BoolFunc(mpd_issubnormal)
+DecCtx_BoolFunc_NO_CTX(mpd_isfinite)
+DecCtx_BoolFunc_NO_CTX(mpd_isinfinite)
+DecCtx_BoolFunc_NO_CTX(mpd_isnan)
+DecCtx_BoolFunc_NO_CTX(mpd_isqnan)
+DecCtx_BoolFunc_NO_CTX(mpd_issigned)
+DecCtx_BoolFunc_NO_CTX(mpd_issnan)
+DecCtx_BoolFunc_NO_CTX(mpd_iszero)
+
+static PyObject *
+ctx_iscanonical(PyObject *context UNUSED, PyObject *v)
+{
+ if (!PyDec_Check(v)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must be a Decimal");
+ return NULL;
+ }
+
+ return mpd_iscanonical(MPD(v)) ? incr_true() : incr_false();
+}
+
+/* Functions with a single decimal argument */
+static PyObject *
+PyDecContext_Apply(PyObject *context, PyObject *v)
+{
+ PyObject *result, *a;
+
+ CONVERT_OP_RAISE(&a, v, context);
+
+ result = dec_apply(a, context);
+ Py_DECREF(a);
+ return result;
+}
+
+static PyObject *
+ctx_canonical(PyObject *context UNUSED, PyObject *v)
+{
+ if (!PyDec_Check(v)) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must be a Decimal");
+ return NULL;
+ }
+
+ return Py_NewRef(v);
+}
+
+static PyObject *
+ctx_mpd_qcopy_abs(PyObject *context, PyObject *v)
+{
+ PyObject *result, *a;
+ uint32_t status = 0;
+
+ CONVERT_OP_RAISE(&a, v, context);
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ return NULL;
+ }
+
+ mpd_qcopy_abs(MPD(result), MPD(a), &status);
+ Py_DECREF(a);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+static PyObject *
+ctx_copy_decimal(PyObject *context, PyObject *v)
+{
+ PyObject *result;
+
+ CONVERT_OP_RAISE(&result, v, context);
+ return result;
+}
+
+static PyObject *
+ctx_mpd_qcopy_negate(PyObject *context, PyObject *v)
+{
+ PyObject *result, *a;
+ uint32_t status = 0;
+
+ CONVERT_OP_RAISE(&a, v, context);
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ return NULL;
+ }
+
+ mpd_qcopy_negate(MPD(result), MPD(a), &status);
+ Py_DECREF(a);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+DecCtx_UnaryFunc(mpd_qlogb)
+DecCtx_UnaryFunc(mpd_qinvert)
+
+static PyObject *
+ctx_mpd_class(PyObject *context, PyObject *v)
+{
+ PyObject *a;
+ const char *cp;
+
+ CONVERT_OP_RAISE(&a, v, context);
+
+ cp = mpd_class(MPD(a), CTX(context));
+ Py_DECREF(a);
+
+ return PyUnicode_FromString(cp);
+}
+
+static PyObject *
+ctx_mpd_to_sci(PyObject *context, PyObject *v)
+{
+ PyObject *result;
+ PyObject *a;
+ mpd_ssize_t size;
+ char *s;
+
+ CONVERT_OP_RAISE(&a, v, context);
+
+ size = mpd_to_sci_size(&s, MPD(a), CtxCaps(context));
+ Py_DECREF(a);
+ if (size < 0) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ result = unicode_fromascii(s, size);
+ mpd_free(s);
+
+ return result;
+}
+
+static PyObject *
+ctx_mpd_to_eng(PyObject *context, PyObject *v)
+{
+ PyObject *result;
+ PyObject *a;
+ mpd_ssize_t size;
+ char *s;
+
+ CONVERT_OP_RAISE(&a, v, context);
+
+ size = mpd_to_eng_size(&s, MPD(a), CtxCaps(context));
+ Py_DECREF(a);
+ if (size < 0) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ result = unicode_fromascii(s, size);
+ mpd_free(s);
+
+ return result;
+}
+
+/* Functions with two decimal arguments */
+DecCtx_BinaryFunc_NO_CTX(mpd_compare_total)
+DecCtx_BinaryFunc_NO_CTX(mpd_compare_total_mag)
+
+static PyObject *
+ctx_mpd_qcopy_sign(PyObject *context, PyObject *args)
+{
+ PyObject *v, *w;
+ PyObject *a, *b;
+ PyObject *result;
+ uint32_t status = 0;
+
+ if (!PyArg_ParseTuple(args, "OO", &v, &w)) {
+ return NULL;
+ }
+
+ CONVERT_BINOP_RAISE(&a, &b, v, w, context);
+
+ result = dec_alloc();
+ if (result == NULL) {
+ Py_DECREF(a);
+ Py_DECREF(b);
+ return NULL;
+ }
+
+ mpd_qcopy_sign(MPD(result), MPD(a), MPD(b), &status);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (dec_addstatus(context, status)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+
+DecCtx_BinaryFunc(mpd_qand)
+DecCtx_BinaryFunc(mpd_qor)
+DecCtx_BinaryFunc(mpd_qxor)
+
+DecCtx_BinaryFunc(mpd_qrotate)
+DecCtx_BinaryFunc(mpd_qscaleb)
+DecCtx_BinaryFunc(mpd_qshift)
+
+static PyObject *
+ctx_mpd_same_quantum(PyObject *context, PyObject *args)
+{
+ PyObject *v, *w;
+ PyObject *a, *b;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args, "OO", &v, &w)) {
+ return NULL;
+ }
+
+ CONVERT_BINOP_RAISE(&a, &b, v, w, context);
+
+ result = mpd_same_quantum(MPD(a), MPD(b)) ? incr_true() : incr_false();
+ Py_DECREF(a);
+ Py_DECREF(b);
+
+ return result;
+}
+
+
+static PyMethodDef context_methods [] =
+{
+ /* Unary arithmetic functions */
+ { "abs", ctx_mpd_qabs, METH_O, doc_ctx_abs },
+ { "exp", ctx_mpd_qexp, METH_O, doc_ctx_exp },
+ { "ln", ctx_mpd_qln, METH_O, doc_ctx_ln },
+ { "log10", ctx_mpd_qlog10, METH_O, doc_ctx_log10 },
+ { "minus", ctx_mpd_qminus, METH_O, doc_ctx_minus },
+ { "next_minus", ctx_mpd_qnext_minus, METH_O, doc_ctx_next_minus },
+ { "next_plus", ctx_mpd_qnext_plus, METH_O, doc_ctx_next_plus },
+ { "normalize", ctx_mpd_qreduce, METH_O, doc_ctx_normalize },
+ { "plus", ctx_mpd_qplus, METH_O, doc_ctx_plus },
+ { "to_integral", ctx_mpd_qround_to_int, METH_O, doc_ctx_to_integral },
+ { "to_integral_exact", ctx_mpd_qround_to_intx, METH_O, doc_ctx_to_integral_exact },
+ { "to_integral_value", ctx_mpd_qround_to_int, METH_O, doc_ctx_to_integral_value },
+ { "sqrt", ctx_mpd_qsqrt, METH_O, doc_ctx_sqrt },
+
+ /* Binary arithmetic functions */
+ { "add", ctx_mpd_qadd, METH_VARARGS, doc_ctx_add },
+ { "compare", ctx_mpd_qcompare, METH_VARARGS, doc_ctx_compare },
+ { "compare_signal", ctx_mpd_qcompare_signal, METH_VARARGS, doc_ctx_compare_signal },
+ { "divide", ctx_mpd_qdiv, METH_VARARGS, doc_ctx_divide },
+ { "divide_int", ctx_mpd_qdivint, METH_VARARGS, doc_ctx_divide_int },
+ { "divmod", ctx_mpd_qdivmod, METH_VARARGS, doc_ctx_divmod },
+ { "max", ctx_mpd_qmax, METH_VARARGS, doc_ctx_max },
+ { "max_mag", ctx_mpd_qmax_mag, METH_VARARGS, doc_ctx_max_mag },
+ { "min", ctx_mpd_qmin, METH_VARARGS, doc_ctx_min },
+ { "min_mag", ctx_mpd_qmin_mag, METH_VARARGS, doc_ctx_min_mag },
+ { "multiply", ctx_mpd_qmul, METH_VARARGS, doc_ctx_multiply },
+ { "next_toward", ctx_mpd_qnext_toward, METH_VARARGS, doc_ctx_next_toward },
+ { "quantize", ctx_mpd_qquantize, METH_VARARGS, doc_ctx_quantize },
+ { "remainder", ctx_mpd_qrem, METH_VARARGS, doc_ctx_remainder },
+ { "remainder_near", ctx_mpd_qrem_near, METH_VARARGS, doc_ctx_remainder_near },
+ { "subtract", ctx_mpd_qsub, METH_VARARGS, doc_ctx_subtract },
+
+ /* Binary or ternary arithmetic functions */
+ { "power", _PyCFunction_CAST(ctx_mpd_qpow), METH_VARARGS|METH_KEYWORDS, doc_ctx_power },
+
+ /* Ternary arithmetic functions */
+ { "fma", ctx_mpd_qfma, METH_VARARGS, doc_ctx_fma },
+
+ /* No argument */
+ { "Etiny", context_getetiny, METH_NOARGS, doc_ctx_Etiny },
+ { "Etop", context_getetop, METH_NOARGS, doc_ctx_Etop },
+ { "radix", ctx_mpd_radix, METH_NOARGS, doc_ctx_radix },
+
+ /* Boolean functions */
+ { "is_canonical", ctx_iscanonical, METH_O, doc_ctx_is_canonical },
+ { "is_finite", ctx_mpd_isfinite, METH_O, doc_ctx_is_finite },
+ { "is_infinite", ctx_mpd_isinfinite, METH_O, doc_ctx_is_infinite },
+ { "is_nan", ctx_mpd_isnan, METH_O, doc_ctx_is_nan },
+ { "is_normal", ctx_mpd_isnormal, METH_O, doc_ctx_is_normal },
+ { "is_qnan", ctx_mpd_isqnan, METH_O, doc_ctx_is_qnan },
+ { "is_signed", ctx_mpd_issigned, METH_O, doc_ctx_is_signed },
+ { "is_snan", ctx_mpd_issnan, METH_O, doc_ctx_is_snan },
+ { "is_subnormal", ctx_mpd_issubnormal, METH_O, doc_ctx_is_subnormal },
+ { "is_zero", ctx_mpd_iszero, METH_O, doc_ctx_is_zero },
+
+ /* Functions with a single decimal argument */
+ { "_apply", PyDecContext_Apply, METH_O, NULL }, /* alias for apply */
+#ifdef EXTRA_FUNCTIONALITY
+ { "apply", PyDecContext_Apply, METH_O, doc_ctx_apply },
+#endif
+ { "canonical", ctx_canonical, METH_O, doc_ctx_canonical },
+ { "copy_abs", ctx_mpd_qcopy_abs, METH_O, doc_ctx_copy_abs },
+ { "copy_decimal", ctx_copy_decimal, METH_O, doc_ctx_copy_decimal },
+ { "copy_negate", ctx_mpd_qcopy_negate, METH_O, doc_ctx_copy_negate },
+ { "logb", ctx_mpd_qlogb, METH_O, doc_ctx_logb },
+ { "logical_invert", ctx_mpd_qinvert, METH_O, doc_ctx_logical_invert },
+ { "number_class", ctx_mpd_class, METH_O, doc_ctx_number_class },
+ { "to_sci_string", ctx_mpd_to_sci, METH_O, doc_ctx_to_sci_string },
+ { "to_eng_string", ctx_mpd_to_eng, METH_O, doc_ctx_to_eng_string },
+
+ /* Functions with two decimal arguments */
+ { "compare_total", ctx_mpd_compare_total, METH_VARARGS, doc_ctx_compare_total },
+ { "compare_total_mag", ctx_mpd_compare_total_mag, METH_VARARGS, doc_ctx_compare_total_mag },
+ { "copy_sign", ctx_mpd_qcopy_sign, METH_VARARGS, doc_ctx_copy_sign },
+ { "logical_and", ctx_mpd_qand, METH_VARARGS, doc_ctx_logical_and },
+ { "logical_or", ctx_mpd_qor, METH_VARARGS, doc_ctx_logical_or },
+ { "logical_xor", ctx_mpd_qxor, METH_VARARGS, doc_ctx_logical_xor },
+ { "rotate", ctx_mpd_qrotate, METH_VARARGS, doc_ctx_rotate },
+ { "same_quantum", ctx_mpd_same_quantum, METH_VARARGS, doc_ctx_same_quantum },
+ { "scaleb", ctx_mpd_qscaleb, METH_VARARGS, doc_ctx_scaleb },
+ { "shift", ctx_mpd_qshift, METH_VARARGS, doc_ctx_shift },
+
+ /* Set context values */
+ { "clear_flags", context_clear_flags, METH_NOARGS, doc_ctx_clear_flags },
+ { "clear_traps", context_clear_traps, METH_NOARGS, doc_ctx_clear_traps },
+
+#ifdef CONFIG_32
+ /* Unsafe set functions with relaxed range checks */
+ { "_unsafe_setprec", context_unsafe_setprec, METH_O, NULL },
+ { "_unsafe_setemin", context_unsafe_setemin, METH_O, NULL },
+ { "_unsafe_setemax", context_unsafe_setemax, METH_O, NULL },
+#endif
+
+ /* Miscellaneous */
+ { "__copy__", (PyCFunction)context_copy, METH_NOARGS, NULL },
+ { "__reduce__", context_reduce, METH_NOARGS, NULL },
+ { "copy", (PyCFunction)context_copy, METH_NOARGS, doc_ctx_copy },
+ { "create_decimal", ctx_create_decimal, METH_VARARGS, doc_ctx_create_decimal },
+ { "create_decimal_from_float", ctx_from_float, METH_O, doc_ctx_create_decimal_from_float },
+
+ { NULL, NULL, 1 }
+};
+
+static PyTypeObject PyDecContext_Type =
+{
+ PyVarObject_HEAD_INIT(NULL, 0)
+ "decimal.Context", /* tp_name */
+ sizeof(PyDecContextObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor) context_dealloc, /* tp_dealloc */
+ 0, /* tp_vectorcall_offset */
+ (getattrfunc) 0, /* tp_getattr */
+ (setattrfunc) 0, /* tp_setattr */
+ 0, /* tp_as_async */
+ (reprfunc) context_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc) 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ (getattrofunc) context_getattr, /* tp_getattro */
+ (setattrofunc) context_setattr, /* tp_setattro */
+ (PyBufferProcs *) 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
+ doc_context, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ context_methods, /* tp_methods */
+ 0, /* tp_members */
+ context_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ context_init, /* tp_init */
+ 0, /* tp_alloc */
+ context_new, /* tp_new */
+ PyObject_Del, /* tp_free */
+};
+
+
+static PyMethodDef _decimal_methods [] =
+{
+ { "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext},
+ { "setcontext", (PyCFunction)PyDec_SetCurrentContext, METH_O, doc_setcontext},
+ { "localcontext", _PyCFunction_CAST(ctxmanager_new), METH_VARARGS|METH_KEYWORDS, doc_localcontext},
+#ifdef EXTRA_FUNCTIONALITY
+ { "IEEEContext", (PyCFunction)ieee_context, METH_O, doc_ieee_context},
+#endif
+ { NULL, NULL, 1, NULL }
+};
+
+static struct PyModuleDef _decimal_module = {
+ PyModuleDef_HEAD_INIT,
+ "decimal",
+ doc__decimal,
+ -1,
+ _decimal_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+struct ssize_constmap { const char *name; mpd_ssize_t val; };
+static struct ssize_constmap ssize_constants [] = {
+ {"MAX_PREC", MPD_MAX_PREC},
+ {"MAX_EMAX", MPD_MAX_EMAX},
+ {"MIN_EMIN", MPD_MIN_EMIN},
+ {"MIN_ETINY", MPD_MIN_ETINY},
+ {NULL}
+};
+
+struct int_constmap { const char *name; int val; };
+static struct int_constmap int_constants [] = {
+ /* int constants */
+#ifdef EXTRA_FUNCTIONALITY
+ {"DECIMAL32", MPD_DECIMAL32},
+ {"DECIMAL64", MPD_DECIMAL64},
+ {"DECIMAL128", MPD_DECIMAL128},
+ {"IEEE_CONTEXT_MAX_BITS", MPD_IEEE_CONTEXT_MAX_BITS},
+ /* int condition flags */
+ {"DecClamped", MPD_Clamped},
+ {"DecConversionSyntax", MPD_Conversion_syntax},
+ {"DecDivisionByZero", MPD_Division_by_zero},
+ {"DecDivisionImpossible", MPD_Division_impossible},
+ {"DecDivisionUndefined", MPD_Division_undefined},
+ {"DecFpuError", MPD_Fpu_error},
+ {"DecInexact", MPD_Inexact},
+ {"DecInvalidContext", MPD_Invalid_context},
+ {"DecInvalidOperation", MPD_Invalid_operation},
+ {"DecIEEEInvalidOperation", MPD_IEEE_Invalid_operation},
+ {"DecMallocError", MPD_Malloc_error},
+ {"DecFloatOperation", MPD_Float_operation},
+ {"DecOverflow", MPD_Overflow},
+ {"DecRounded", MPD_Rounded},
+ {"DecSubnormal", MPD_Subnormal},
+ {"DecUnderflow", MPD_Underflow},
+ {"DecErrors", MPD_Errors},
+ {"DecTraps", MPD_Traps},
+#endif
+ {NULL}
+};
+
+
+#define CHECK_INT(expr) \
+ do { if ((expr) < 0) goto error; } while (0)
+#define ASSIGN_PTR(result, expr) \
+ do { result = (expr); if (result == NULL) goto error; } while (0)
+#define CHECK_PTR(expr) \
+ do { if ((expr) == NULL) goto error; } while (0)
+
+
+static PyCFunction
+cfunc_noargs(PyTypeObject *t, const char *name)
+{
+ struct PyMethodDef *m;
+
+ if (t->tp_methods == NULL) {
+ goto error;
+ }
+
+ for (m = t->tp_methods; m->ml_name != NULL; m++) {
+ if (strcmp(name, m->ml_name) == 0) {
+ if (!(m->ml_flags & METH_NOARGS)) {
+ goto error;
+ }
+ return m->ml_meth;
+ }
+ }
+
+error:
+ PyErr_Format(PyExc_RuntimeError,
+ "internal error: could not find method %s", name);
+ return NULL;
+}
+
+
+PyMODINIT_FUNC
+PyInit__decimal(void)
+{
+ PyObject *m = NULL;
+ PyObject *numbers = NULL;
+ PyObject *Number = NULL;
+ PyObject *collections = NULL;
+ PyObject *collections_abc = NULL;
+ PyObject *MutableMapping = NULL;
+ PyObject *obj = NULL;
+ DecCondMap *cm;
+ struct ssize_constmap *ssize_cm;
+ struct int_constmap *int_cm;
+ int i;
+
+
+ /* Init libmpdec */
+ mpd_traphandler = dec_traphandler;
+ mpd_mallocfunc = PyMem_Malloc;
+ mpd_reallocfunc = PyMem_Realloc;
+ mpd_callocfunc = mpd_callocfunc_em;
+ mpd_free = PyMem_Free;
+ mpd_setminalloc(_Py_DEC_MINALLOC);
+
+
+ /* Init external C-API functions */
+ _py_long_multiply = PyLong_Type.tp_as_number->nb_multiply;
+ _py_long_floor_divide = PyLong_Type.tp_as_number->nb_floor_divide;
+ _py_long_power = PyLong_Type.tp_as_number->nb_power;
+ _py_float_abs = PyFloat_Type.tp_as_number->nb_absolute;
+ ASSIGN_PTR(_py_float_as_integer_ratio, cfunc_noargs(&PyFloat_Type,
+ "as_integer_ratio"));
+ ASSIGN_PTR(_py_long_bit_length, cfunc_noargs(&PyLong_Type, "bit_length"));
+
+
+ /* Init types */
+ PyDec_Type.tp_base = &PyBaseObject_Type;
+ PyDecContext_Type.tp_base = &PyBaseObject_Type;
+ PyDecContextManager_Type.tp_base = &PyBaseObject_Type;
+ PyDecSignalDictMixin_Type.tp_base = &PyBaseObject_Type;
+
+ CHECK_INT(PyType_Ready(&PyDec_Type));
+ CHECK_INT(PyType_Ready(&PyDecContext_Type));
+ CHECK_INT(PyType_Ready(&PyDecSignalDictMixin_Type));
+ CHECK_INT(PyType_Ready(&PyDecContextManager_Type));
+
+ ASSIGN_PTR(obj, PyUnicode_FromString("decimal"));
+ CHECK_INT(PyDict_SetItemString(PyDec_Type.tp_dict, "__module__", obj));
+ CHECK_INT(PyDict_SetItemString(PyDecContext_Type.tp_dict,
+ "__module__", obj));
+ Py_CLEAR(obj);
+
+
+ /* Numeric abstract base classes */
+ ASSIGN_PTR(numbers, PyImport_ImportModule("numbers"));
+ ASSIGN_PTR(Number, PyObject_GetAttrString(numbers, "Number"));
+ /* Register Decimal with the Number abstract base class */
+ ASSIGN_PTR(obj, PyObject_CallMethod(Number, "register", "(O)",
+ (PyObject *)&PyDec_Type));
+ Py_CLEAR(obj);
+ /* Rational is a global variable used for fraction comparisons. */
+ ASSIGN_PTR(Rational, PyObject_GetAttrString(numbers, "Rational"));
+ /* Done with numbers, Number */
+ Py_CLEAR(numbers);
+ Py_CLEAR(Number);
+
+ /* DecimalTuple */
+ ASSIGN_PTR(collections, PyImport_ImportModule("collections"));
+ ASSIGN_PTR(DecimalTuple, (PyTypeObject *)PyObject_CallMethod(collections,
+ "namedtuple", "(ss)", "DecimalTuple",
+ "sign digits exponent"));
+
+ ASSIGN_PTR(obj, PyUnicode_FromString("decimal"));
+ CHECK_INT(PyDict_SetItemString(DecimalTuple->tp_dict, "__module__", obj));
+ Py_CLEAR(obj);
+
+ /* MutableMapping */
+ ASSIGN_PTR(collections_abc, PyImport_ImportModule("collections.abc"));
+ ASSIGN_PTR(MutableMapping, PyObject_GetAttrString(collections_abc,
+ "MutableMapping"));
+ /* Create SignalDict type */
+ ASSIGN_PTR(PyDecSignalDict_Type,
+ (PyTypeObject *)PyObject_CallFunction(
+ (PyObject *)&PyType_Type, "s(OO){}",
+ "SignalDict", &PyDecSignalDictMixin_Type,
+ MutableMapping));
+
+ /* Done with collections, MutableMapping */
+ Py_CLEAR(collections);
+ Py_CLEAR(collections_abc);
+ Py_CLEAR(MutableMapping);
+
+
+ /* Create the module */
+ ASSIGN_PTR(m, PyModule_Create(&_decimal_module));
+
+ /* Add types to the module */
+ CHECK_INT(PyModule_AddObjectRef(m, "Decimal", (PyObject *)&PyDec_Type));
+ CHECK_INT(PyModule_AddObjectRef(m, "Context", (PyObject *)&PyDecContext_Type));
+ CHECK_INT(PyModule_AddObjectRef(m, "DecimalTuple", (PyObject *)DecimalTuple));
+
+ /* Create top level exception */
+ ASSIGN_PTR(DecimalException, PyErr_NewException(
+ "decimal.DecimalException",
+ PyExc_ArithmeticError, NULL));
+ CHECK_INT(PyModule_AddObjectRef(m, "DecimalException", DecimalException));
+
+ /* Create signal tuple */
+ ASSIGN_PTR(SignalTuple, PyTuple_New(SIGNAL_MAP_LEN));
+
+ /* Add exceptions that correspond to IEEE signals */
+ for (i = SIGNAL_MAP_LEN-1; i >= 0; i--) {
+ PyObject *base;
+
+ cm = signal_map + i;
+
+ switch (cm->flag) {
+ case MPD_Float_operation:
+ base = PyTuple_Pack(2, DecimalException, PyExc_TypeError);
+ break;
+ case MPD_Division_by_zero:
+ base = PyTuple_Pack(2, DecimalException, PyExc_ZeroDivisionError);
+ break;
+ case MPD_Overflow:
+ base = PyTuple_Pack(2, signal_map[INEXACT].ex,
+ signal_map[ROUNDED].ex);
+ break;
+ case MPD_Underflow:
+ base = PyTuple_Pack(3, signal_map[INEXACT].ex,
+ signal_map[ROUNDED].ex,
+ signal_map[SUBNORMAL].ex);
+ break;
+ default:
+ base = PyTuple_Pack(1, DecimalException);
+ break;
+ }
+
+ if (base == NULL) {
+ goto error; /* GCOV_NOT_REACHED */
+ }
+
+ ASSIGN_PTR(cm->ex, PyErr_NewException(cm->fqname, base, NULL));
+ Py_DECREF(base);
+
+ /* add to module */
+ CHECK_INT(PyModule_AddObjectRef(m, cm->name, cm->ex));
+
+ /* add to signal tuple */
+ PyTuple_SET_ITEM(SignalTuple, i, Py_NewRef(cm->ex));
+ }
+
+ /*
+ * Unfortunately, InvalidOperation is a signal that comprises
+ * several conditions, including InvalidOperation! Naming the
+ * signal IEEEInvalidOperation would prevent the confusion.
+ */
+ cond_map[0].ex = signal_map[0].ex;
+
+ /* Add remaining exceptions, inherit from InvalidOperation */
+ for (cm = cond_map+1; cm->name != NULL; cm++) {
+ PyObject *base;
+ if (cm->flag == MPD_Division_undefined) {
+ base = PyTuple_Pack(2, signal_map[0].ex, PyExc_ZeroDivisionError);
+ }
+ else {
+ base = PyTuple_Pack(1, signal_map[0].ex);
+ }
+ if (base == NULL) {
+ goto error; /* GCOV_NOT_REACHED */
+ }
+
+ ASSIGN_PTR(cm->ex, PyErr_NewException(cm->fqname, base, NULL));
+ Py_DECREF(base);
+
+ CHECK_INT(PyModule_AddObjectRef(m, cm->name, cm->ex));
+ }
+
+
+ /* Init default context template first */
+ ASSIGN_PTR(default_context_template,
+ PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL));
+ CHECK_INT(PyModule_AddObjectRef(m, "DefaultContext",
+ default_context_template));
+
+#ifndef WITH_DECIMAL_CONTEXTVAR
+ ASSIGN_PTR(tls_context_key, PyUnicode_FromString("___DECIMAL_CTX__"));
+ CHECK_INT(PyModule_AddObjectRef(m, "HAVE_CONTEXTVAR", Py_False));
+#else
+ ASSIGN_PTR(current_context_var, PyContextVar_New("decimal_context", NULL));
+ CHECK_INT(PyModule_AddObjectRef(m, "HAVE_CONTEXTVAR", Py_True));
+#endif
+ CHECK_INT(PyModule_AddObjectRef(m, "HAVE_THREADS", Py_True));
+
+ /* Init basic context template */
+ ASSIGN_PTR(basic_context_template,
+ PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL));
+ init_basic_context(basic_context_template);
+ CHECK_INT(PyModule_AddObjectRef(m, "BasicContext",
+ basic_context_template));
+
+ /* Init extended context template */
+ ASSIGN_PTR(extended_context_template,
+ PyObject_CallObject((PyObject *)&PyDecContext_Type, NULL));
+ init_extended_context(extended_context_template);
+ CHECK_INT(PyModule_AddObjectRef(m, "ExtendedContext",
+ extended_context_template));
+
+
+ /* Init mpd_ssize_t constants */
+ for (ssize_cm = ssize_constants; ssize_cm->name != NULL; ssize_cm++) {
+ ASSIGN_PTR(obj, PyLong_FromSsize_t(ssize_cm->val));
+ CHECK_INT(PyModule_AddObject(m, ssize_cm->name, obj));
+ obj = NULL;
+ }
+
+ /* Init int constants */
+ for (int_cm = int_constants; int_cm->name != NULL; int_cm++) {
+ CHECK_INT(PyModule_AddIntConstant(m, int_cm->name,
+ int_cm->val));
+ }
+
+ /* Init string constants */
+ for (i = 0; i < _PY_DEC_ROUND_GUARD; i++) {
+ ASSIGN_PTR(round_map[i], PyUnicode_InternFromString(mpd_round_string[i]));
+ CHECK_INT(PyModule_AddObjectRef(m, mpd_round_string[i], round_map[i]));
+ }
+
+ /* Add specification version number */
+ CHECK_INT(PyModule_AddStringConstant(m, "__version__", "1.70"));
+ CHECK_INT(PyModule_AddStringConstant(m, "__libmpdec_version__", mpd_version()));
+
+
+ return m;
+
+
+error:
+ Py_CLEAR(obj); /* GCOV_NOT_REACHED */
+ Py_CLEAR(numbers); /* GCOV_NOT_REACHED */
+ Py_CLEAR(Number); /* GCOV_NOT_REACHED */
+ Py_CLEAR(Rational); /* GCOV_NOT_REACHED */
+ Py_CLEAR(collections); /* GCOV_NOT_REACHED */
+ Py_CLEAR(collections_abc); /* GCOV_NOT_REACHED */
+ Py_CLEAR(MutableMapping); /* GCOV_NOT_REACHED */
+ Py_CLEAR(SignalTuple); /* GCOV_NOT_REACHED */
+ Py_CLEAR(DecimalTuple); /* GCOV_NOT_REACHED */
+ Py_CLEAR(default_context_template); /* GCOV_NOT_REACHED */
+#ifndef WITH_DECIMAL_CONTEXTVAR
+ Py_CLEAR(tls_context_key); /* GCOV_NOT_REACHED */
+#else
+ Py_CLEAR(current_context_var); /* GCOV_NOT_REACHED */
+#endif
+ Py_CLEAR(basic_context_template); /* GCOV_NOT_REACHED */
+ Py_CLEAR(extended_context_template); /* GCOV_NOT_REACHED */
+ Py_CLEAR(m); /* GCOV_NOT_REACHED */
+
+ return NULL; /* GCOV_NOT_REACHED */
+}
diff --git a/contrib/tools/python3/Modules/_decimal/docstrings.h b/contrib/tools/python3/Modules/_decimal/docstrings.h
new file mode 100644
index 00000000000..a1823cdd32b
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/docstrings.h
@@ -0,0 +1,884 @@
+/*
+ * Copyright (c) 2001-2012 Python Software Foundation. All Rights Reserved.
+ * Modified and extended by Stefan Krah.
+ */
+
+
+#ifndef DOCSTRINGS_H
+#define DOCSTRINGS_H
+
+
+#include "pymacro.h"
+
+
+/******************************************************************************/
+/* Module */
+/******************************************************************************/
+
+
+PyDoc_STRVAR(doc__decimal,
+"C decimal arithmetic module");
+
+PyDoc_STRVAR(doc_getcontext,
+"getcontext($module, /)\n--\n\n\
+Get the current default context.\n\
+\n");
+
+PyDoc_STRVAR(doc_setcontext,
+"setcontext($module, context, /)\n--\n\n\
+Set a new default context.\n\
+\n");
+
+PyDoc_STRVAR(doc_localcontext,
+"localcontext($module, /, ctx=None, **kwargs)\n--\n\n\
+Return a context manager that will set the default context to a copy of ctx\n\
+on entry to the with-statement and restore the previous default context when\n\
+exiting the with-statement. If no context is specified, a copy of the current\n\
+default context is used.\n\
+\n");
+
+#ifdef EXTRA_FUNCTIONALITY
+PyDoc_STRVAR(doc_ieee_context,
+"IEEEContext($module, bits, /)\n--\n\n\
+Return a context object initialized to the proper values for one of the\n\
+IEEE interchange formats. The argument must be a multiple of 32 and less\n\
+than IEEE_CONTEXT_MAX_BITS. For the most common values, the constants\n\
+DECIMAL32, DECIMAL64 and DECIMAL128 are provided.\n\
+\n");
+#endif
+
+
+/******************************************************************************/
+/* Decimal Object and Methods */
+/******************************************************************************/
+
+PyDoc_STRVAR(doc_decimal,
+"Decimal(value=\"0\", context=None)\n--\n\n\
+Construct a new Decimal object. 'value' can be an integer, string, tuple,\n\
+or another Decimal object. If no value is given, return Decimal('0'). The\n\
+context does not affect the conversion and is only passed to determine if\n\
+the InvalidOperation trap is active.\n\
+\n");
+
+PyDoc_STRVAR(doc_adjusted,
+"adjusted($self, /)\n--\n\n\
+Return the adjusted exponent of the number. Defined as exp + digits - 1.\n\
+\n");
+
+PyDoc_STRVAR(doc_as_tuple,
+"as_tuple($self, /)\n--\n\n\
+Return a tuple representation of the number.\n\
+\n");
+
+PyDoc_STRVAR(doc_as_integer_ratio,
+"as_integer_ratio($self, /)\n--\n\n\
+Decimal.as_integer_ratio() -> (int, int)\n\
+\n\
+Return a pair of integers, whose ratio is exactly equal to the original\n\
+Decimal and with a positive denominator. The ratio is in lowest terms.\n\
+Raise OverflowError on infinities and a ValueError on NaNs.\n\
+\n");
+
+PyDoc_STRVAR(doc_canonical,
+"canonical($self, /)\n--\n\n\
+Return the canonical encoding of the argument. Currently, the encoding\n\
+of a Decimal instance is always canonical, so this operation returns its\n\
+argument unchanged.\n\
+\n");
+
+PyDoc_STRVAR(doc_compare,
+"compare($self, /, other, context=None)\n--\n\n\
+Compare self to other. Return a decimal value:\n\
+\n\
+ a or b is a NaN ==> Decimal('NaN')\n\
+ a < b ==> Decimal('-1')\n\
+ a == b ==> Decimal('0')\n\
+ a > b ==> Decimal('1')\n\
+\n");
+
+PyDoc_STRVAR(doc_compare_signal,
+"compare_signal($self, /, other, context=None)\n--\n\n\
+Identical to compare, except that all NaNs signal.\n\
+\n");
+
+PyDoc_STRVAR(doc_compare_total,
+"compare_total($self, /, other, context=None)\n--\n\n\
+Compare two operands using their abstract representation rather than\n\
+their numerical value. Similar to the compare() method, but the result\n\
+gives a total ordering on Decimal instances. Two Decimal instances with\n\
+the same numeric value but different representations compare unequal\n\
+in this ordering:\n\
+\n\
+ >>> Decimal('12.0').compare_total(Decimal('12'))\n\
+ Decimal('-1')\n\
+\n\
+Quiet and signaling NaNs are also included in the total ordering. The result\n\
+of this function is Decimal('0') if both operands have the same representation,\n\
+Decimal('-1') if the first operand is lower in the total order than the second,\n\
+and Decimal('1') if the first operand is higher in the total order than the\n\
+second operand. See the specification for details of the total order.\n\
+\n\
+This operation is unaffected by context and is quiet: no flags are changed\n\
+and no rounding is performed. As an exception, the C version may raise\n\
+InvalidOperation if the second operand cannot be converted exactly.\n\
+\n");
+
+PyDoc_STRVAR(doc_compare_total_mag,
+"compare_total_mag($self, /, other, context=None)\n--\n\n\
+Compare two operands using their abstract representation rather than their\n\
+value as in compare_total(), but ignoring the sign of each operand.\n\
+\n\
+x.compare_total_mag(y) is equivalent to x.copy_abs().compare_total(y.copy_abs()).\n\
+\n\
+This operation is unaffected by context and is quiet: no flags are changed\n\
+and no rounding is performed. As an exception, the C version may raise\n\
+InvalidOperation if the second operand cannot be converted exactly.\n\
+\n");
+
+PyDoc_STRVAR(doc_conjugate,
+"conjugate($self, /)\n--\n\n\
+Return self.\n\
+\n");
+
+PyDoc_STRVAR(doc_copy_abs,
+"copy_abs($self, /)\n--\n\n\
+Return the absolute value of the argument. This operation is unaffected by\n\
+context and is quiet: no flags are changed and no rounding is performed.\n\
+\n");
+
+PyDoc_STRVAR(doc_copy_negate,
+"copy_negate($self, /)\n--\n\n\
+Return the negation of the argument. This operation is unaffected by context\n\
+and is quiet: no flags are changed and no rounding is performed.\n\
+\n");
+
+PyDoc_STRVAR(doc_copy_sign,
+"copy_sign($self, /, other, context=None)\n--\n\n\
+Return a copy of the first operand with the sign set to be the same as the\n\
+sign of the second operand. For example:\n\
+\n\
+ >>> Decimal('2.3').copy_sign(Decimal('-1.5'))\n\
+ Decimal('-2.3')\n\
+\n\
+This operation is unaffected by context and is quiet: no flags are changed\n\
+and no rounding is performed. As an exception, the C version may raise\n\
+InvalidOperation if the second operand cannot be converted exactly.\n\
+\n");
+
+PyDoc_STRVAR(doc_exp,
+"exp($self, /, context=None)\n--\n\n\
+Return the value of the (natural) exponential function e**x at the given\n\
+number. The function always uses the ROUND_HALF_EVEN mode and the result\n\
+is correctly rounded.\n\
+\n");
+
+PyDoc_STRVAR(doc_from_float,
+"from_float($type, f, /)\n--\n\n\
+Class method that converts a float to a decimal number, exactly.\n\
+Since 0.1 is not exactly representable in binary floating point,\n\
+Decimal.from_float(0.1) is not the same as Decimal('0.1').\n\
+\n\
+ >>> Decimal.from_float(0.1)\n\
+ Decimal('0.1000000000000000055511151231257827021181583404541015625')\n\
+ >>> Decimal.from_float(float('nan'))\n\
+ Decimal('NaN')\n\
+ >>> Decimal.from_float(float('inf'))\n\
+ Decimal('Infinity')\n\
+ >>> Decimal.from_float(float('-inf'))\n\
+ Decimal('-Infinity')\n\
+\n\
+\n");
+
+PyDoc_STRVAR(doc_fma,
+"fma($self, /, other, third, context=None)\n--\n\n\
+Fused multiply-add. Return self*other+third with no rounding of the\n\
+intermediate product self*other.\n\
+\n\
+ >>> Decimal(2).fma(3, 5)\n\
+ Decimal('11')\n\
+\n\
+\n");
+
+PyDoc_STRVAR(doc_is_canonical,
+"is_canonical($self, /)\n--\n\n\
+Return True if the argument is canonical and False otherwise. Currently,\n\
+a Decimal instance is always canonical, so this operation always returns\n\
+True.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_finite,
+"is_finite($self, /)\n--\n\n\
+Return True if the argument is a finite number, and False if the argument\n\
+is infinite or a NaN.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_infinite,
+"is_infinite($self, /)\n--\n\n\
+Return True if the argument is either positive or negative infinity and\n\
+False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_nan,
+"is_nan($self, /)\n--\n\n\
+Return True if the argument is a (quiet or signaling) NaN and False\n\
+otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_normal,
+"is_normal($self, /, context=None)\n--\n\n\
+Return True if the argument is a normal finite non-zero number with an\n\
+adjusted exponent greater than or equal to Emin. Return False if the\n\
+argument is zero, subnormal, infinite or a NaN.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_qnan,
+"is_qnan($self, /)\n--\n\n\
+Return True if the argument is a quiet NaN, and False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_signed,
+"is_signed($self, /)\n--\n\n\
+Return True if the argument has a negative sign and False otherwise.\n\
+Note that both zeros and NaNs can carry signs.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_snan,
+"is_snan($self, /)\n--\n\n\
+Return True if the argument is a signaling NaN and False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_subnormal,
+"is_subnormal($self, /, context=None)\n--\n\n\
+Return True if the argument is subnormal, and False otherwise. A number is\n\
+subnormal if it is non-zero, finite, and has an adjusted exponent less\n\
+than Emin.\n\
+\n");
+
+PyDoc_STRVAR(doc_is_zero,
+"is_zero($self, /)\n--\n\n\
+Return True if the argument is a (positive or negative) zero and False\n\
+otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ln,
+"ln($self, /, context=None)\n--\n\n\
+Return the natural (base e) logarithm of the operand. The function always\n\
+uses the ROUND_HALF_EVEN mode and the result is correctly rounded.\n\
+\n");
+
+PyDoc_STRVAR(doc_log10,
+"log10($self, /, context=None)\n--\n\n\
+Return the base ten logarithm of the operand. The function always uses the\n\
+ROUND_HALF_EVEN mode and the result is correctly rounded.\n\
+\n");
+
+PyDoc_STRVAR(doc_logb,
+"logb($self, /, context=None)\n--\n\n\
+For a non-zero number, return the adjusted exponent of the operand as a\n\
+Decimal instance. If the operand is a zero, then Decimal('-Infinity') is\n\
+returned and the DivisionByZero condition is raised. If the operand is\n\
+an infinity then Decimal('Infinity') is returned.\n\
+\n");
+
+PyDoc_STRVAR(doc_logical_and,
+"logical_and($self, /, other, context=None)\n--\n\n\
+Return the digit-wise 'and' of the two (logical) operands.\n\
+\n");
+
+PyDoc_STRVAR(doc_logical_invert,
+"logical_invert($self, /, context=None)\n--\n\n\
+Return the digit-wise inversion of the (logical) operand.\n\
+\n");
+
+PyDoc_STRVAR(doc_logical_or,
+"logical_or($self, /, other, context=None)\n--\n\n\
+Return the digit-wise 'or' of the two (logical) operands.\n\
+\n");
+
+PyDoc_STRVAR(doc_logical_xor,
+"logical_xor($self, /, other, context=None)\n--\n\n\
+Return the digit-wise 'exclusive or' of the two (logical) operands.\n\
+\n");
+
+PyDoc_STRVAR(doc_max,
+"max($self, /, other, context=None)\n--\n\n\
+Maximum of self and other. If one operand is a quiet NaN and the other is\n\
+numeric, the numeric operand is returned.\n\
+\n");
+
+PyDoc_STRVAR(doc_max_mag,
+"max_mag($self, /, other, context=None)\n--\n\n\
+Similar to the max() method, but the comparison is done using the absolute\n\
+values of the operands.\n\
+\n");
+
+PyDoc_STRVAR(doc_min,
+"min($self, /, other, context=None)\n--\n\n\
+Minimum of self and other. If one operand is a quiet NaN and the other is\n\
+numeric, the numeric operand is returned.\n\
+\n");
+
+PyDoc_STRVAR(doc_min_mag,
+"min_mag($self, /, other, context=None)\n--\n\n\
+Similar to the min() method, but the comparison is done using the absolute\n\
+values of the operands.\n\
+\n");
+
+PyDoc_STRVAR(doc_next_minus,
+"next_minus($self, /, context=None)\n--\n\n\
+Return the largest number representable in the given context (or in the\n\
+current default context if no context is given) that is smaller than the\n\
+given operand.\n\
+\n");
+
+PyDoc_STRVAR(doc_next_plus,
+"next_plus($self, /, context=None)\n--\n\n\
+Return the smallest number representable in the given context (or in the\n\
+current default context if no context is given) that is larger than the\n\
+given operand.\n\
+\n");
+
+PyDoc_STRVAR(doc_next_toward,
+"next_toward($self, /, other, context=None)\n--\n\n\
+If the two operands are unequal, return the number closest to the first\n\
+operand in the direction of the second operand. If both operands are\n\
+numerically equal, return a copy of the first operand with the sign set\n\
+to be the same as the sign of the second operand.\n\
+\n");
+
+PyDoc_STRVAR(doc_normalize,
+"normalize($self, /, context=None)\n--\n\n\
+Normalize the number by stripping the rightmost trailing zeros and\n\
+converting any result equal to Decimal('0') to Decimal('0e0'). Used\n\
+for producing canonical values for members of an equivalence class.\n\
+For example, Decimal('32.100') and Decimal('0.321000e+2') both normalize\n\
+to the equivalent value Decimal('32.1').\n\
+\n");
+
+PyDoc_STRVAR(doc_number_class,
+"number_class($self, /, context=None)\n--\n\n\
+Return a string describing the class of the operand. The returned value\n\
+is one of the following ten strings:\n\
+\n\
+ * '-Infinity', indicating that the operand is negative infinity.\n\
+ * '-Normal', indicating that the operand is a negative normal number.\n\
+ * '-Subnormal', indicating that the operand is negative and subnormal.\n\
+ * '-Zero', indicating that the operand is a negative zero.\n\
+ * '+Zero', indicating that the operand is a positive zero.\n\
+ * '+Subnormal', indicating that the operand is positive and subnormal.\n\
+ * '+Normal', indicating that the operand is a positive normal number.\n\
+ * '+Infinity', indicating that the operand is positive infinity.\n\
+ * 'NaN', indicating that the operand is a quiet NaN (Not a Number).\n\
+ * 'sNaN', indicating that the operand is a signaling NaN.\n\
+\n\
+\n");
+
+PyDoc_STRVAR(doc_quantize,
+"quantize($self, /, exp, rounding=None, context=None)\n--\n\n\
+Return a value equal to the first operand after rounding and having the\n\
+exponent of the second operand.\n\
+\n\
+ >>> Decimal('1.41421356').quantize(Decimal('1.000'))\n\
+ Decimal('1.414')\n\
+\n\
+Unlike other operations, if the length of the coefficient after the quantize\n\
+operation would be greater than precision, then an InvalidOperation is signaled.\n\
+This guarantees that, unless there is an error condition, the quantized exponent\n\
+is always equal to that of the right-hand operand.\n\
+\n\
+Also unlike other operations, quantize never signals Underflow, even if the\n\
+result is subnormal and inexact.\n\
+\n\
+If the exponent of the second operand is larger than that of the first, then\n\
+rounding may be necessary. In this case, the rounding mode is determined by the\n\
+rounding argument if given, else by the given context argument; if neither\n\
+argument is given, the rounding mode of the current thread's context is used.\n\
+\n");
+
+PyDoc_STRVAR(doc_radix,
+"radix($self, /)\n--\n\n\
+Return Decimal(10), the radix (base) in which the Decimal class does\n\
+all its arithmetic. Included for compatibility with the specification.\n\
+\n");
+
+PyDoc_STRVAR(doc_remainder_near,
+"remainder_near($self, /, other, context=None)\n--\n\n\
+Return the remainder from dividing self by other. This differs from\n\
+self % other in that the sign of the remainder is chosen so as to minimize\n\
+its absolute value. More precisely, the return value is self - n * other\n\
+where n is the integer nearest to the exact value of self / other, and\n\
+if two integers are equally near then the even one is chosen.\n\
+\n\
+If the result is zero then its sign will be the sign of self.\n\
+\n");
+
+PyDoc_STRVAR(doc_rotate,
+"rotate($self, /, other, context=None)\n--\n\n\
+Return the result of rotating the digits of the first operand by an amount\n\
+specified by the second operand. The second operand must be an integer in\n\
+the range -precision through precision. The absolute value of the second\n\
+operand gives the number of places to rotate. If the second operand is\n\
+positive then rotation is to the left; otherwise rotation is to the right.\n\
+The coefficient of the first operand is padded on the left with zeros to\n\
+length precision if necessary. The sign and exponent of the first operand are\n\
+unchanged.\n\
+\n");
+
+PyDoc_STRVAR(doc_same_quantum,
+"same_quantum($self, /, other, context=None)\n--\n\n\
+Test whether self and other have the same exponent or whether both are NaN.\n\
+\n\
+This operation is unaffected by context and is quiet: no flags are changed\n\
+and no rounding is performed. As an exception, the C version may raise\n\
+InvalidOperation if the second operand cannot be converted exactly.\n\
+\n");
+
+PyDoc_STRVAR(doc_scaleb,
+"scaleb($self, /, other, context=None)\n--\n\n\
+Return the first operand with the exponent adjusted the second. Equivalently,\n\
+return the first operand multiplied by 10**other. The second operand must be\n\
+an integer.\n\
+\n");
+
+PyDoc_STRVAR(doc_shift,
+"shift($self, /, other, context=None)\n--\n\n\
+Return the result of shifting the digits of the first operand by an amount\n\
+specified by the second operand. The second operand must be an integer in\n\
+the range -precision through precision. The absolute value of the second\n\
+operand gives the number of places to shift. If the second operand is\n\
+positive, then the shift is to the left; otherwise the shift is to the\n\
+right. Digits shifted into the coefficient are zeros. The sign and exponent\n\
+of the first operand are unchanged.\n\
+\n");
+
+PyDoc_STRVAR(doc_sqrt,
+"sqrt($self, /, context=None)\n--\n\n\
+Return the square root of the argument to full precision. The result is\n\
+correctly rounded using the ROUND_HALF_EVEN rounding mode.\n\
+\n");
+
+PyDoc_STRVAR(doc_to_eng_string,
+"to_eng_string($self, /, context=None)\n--\n\n\
+Convert to an engineering-type string. Engineering notation has an exponent\n\
+which is a multiple of 3, so there are up to 3 digits left of the decimal\n\
+place. For example, Decimal('123E+1') is converted to Decimal('1.23E+3').\n\
+\n\
+The value of context.capitals determines whether the exponent sign is lower\n\
+or upper case. Otherwise, the context does not affect the operation.\n\
+\n");
+
+PyDoc_STRVAR(doc_to_integral,
+"to_integral($self, /, rounding=None, context=None)\n--\n\n\
+Identical to the to_integral_value() method. The to_integral() name has been\n\
+kept for compatibility with older versions.\n\
+\n");
+
+PyDoc_STRVAR(doc_to_integral_exact,
+"to_integral_exact($self, /, rounding=None, context=None)\n--\n\n\
+Round to the nearest integer, signaling Inexact or Rounded as appropriate if\n\
+rounding occurs. The rounding mode is determined by the rounding parameter\n\
+if given, else by the given context. If neither parameter is given, then the\n\
+rounding mode of the current default context is used.\n\
+\n");
+
+PyDoc_STRVAR(doc_to_integral_value,
+"to_integral_value($self, /, rounding=None, context=None)\n--\n\n\
+Round to the nearest integer without signaling Inexact or Rounded. The\n\
+rounding mode is determined by the rounding parameter if given, else by\n\
+the given context. If neither parameter is given, then the rounding mode\n\
+of the current default context is used.\n\
+\n");
+
+
+/******************************************************************************/
+/* Context Object and Methods */
+/******************************************************************************/
+
+PyDoc_STRVAR(doc_context,
+"Context(prec=None, rounding=None, Emin=None, Emax=None, capitals=None, clamp=None, flags=None, traps=None)\n--\n\n\
+The context affects almost all operations and controls rounding,\n\
+Over/Underflow, raising of exceptions and much more. A new context\n\
+can be constructed as follows:\n\
+\n\
+ >>> c = Context(prec=28, Emin=-425000000, Emax=425000000,\n\
+ ... rounding=ROUND_HALF_EVEN, capitals=1, clamp=1,\n\
+ ... traps=[InvalidOperation, DivisionByZero, Overflow],\n\
+ ... flags=[])\n\
+ >>>\n\
+\n\
+\n");
+
+#ifdef EXTRA_FUNCTIONALITY
+PyDoc_STRVAR(doc_ctx_apply,
+"apply($self, x, /)\n--\n\n\
+Apply self to Decimal x.\n\
+\n");
+#endif
+
+PyDoc_STRVAR(doc_ctx_clear_flags,
+"clear_flags($self, /)\n--\n\n\
+Reset all flags to False.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_clear_traps,
+"clear_traps($self, /)\n--\n\n\
+Set all traps to False.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_copy,
+"copy($self, /)\n--\n\n\
+Return a duplicate of the context with all flags cleared.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_copy_decimal,
+"copy_decimal($self, x, /)\n--\n\n\
+Return a copy of Decimal x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_create_decimal,
+"create_decimal($self, num=\"0\", /)\n--\n\n\
+Create a new Decimal instance from num, using self as the context. Unlike the\n\
+Decimal constructor, this function observes the context limits.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_create_decimal_from_float,
+"create_decimal_from_float($self, f, /)\n--\n\n\
+Create a new Decimal instance from float f. Unlike the Decimal.from_float()\n\
+class method, this function observes the context limits.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_Etiny,
+"Etiny($self, /)\n--\n\n\
+Return a value equal to Emin - prec + 1, which is the minimum exponent value\n\
+for subnormal results. When underflow occurs, the exponent is set to Etiny.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_Etop,
+"Etop($self, /)\n--\n\n\
+Return a value equal to Emax - prec + 1. This is the maximum exponent\n\
+if the _clamp field of the context is set to 1 (IEEE clamp mode). Etop()\n\
+must not be negative.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_abs,
+"abs($self, x, /)\n--\n\n\
+Return the absolute value of x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_add,
+"add($self, x, y, /)\n--\n\n\
+Return the sum of x and y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_canonical,
+"canonical($self, x, /)\n--\n\n\
+Return a new instance of x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_compare,
+"compare($self, x, y, /)\n--\n\n\
+Compare x and y numerically.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_compare_signal,
+"compare_signal($self, x, y, /)\n--\n\n\
+Compare x and y numerically. All NaNs signal.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_compare_total,
+"compare_total($self, x, y, /)\n--\n\n\
+Compare x and y using their abstract representation.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_compare_total_mag,
+"compare_total_mag($self, x, y, /)\n--\n\n\
+Compare x and y using their abstract representation, ignoring sign.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_copy_abs,
+"copy_abs($self, x, /)\n--\n\n\
+Return a copy of x with the sign set to 0.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_copy_negate,
+"copy_negate($self, x, /)\n--\n\n\
+Return a copy of x with the sign inverted.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_copy_sign,
+"copy_sign($self, x, y, /)\n--\n\n\
+Copy the sign from y to x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_divide,
+"divide($self, x, y, /)\n--\n\n\
+Return x divided by y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_divide_int,
+"divide_int($self, x, y, /)\n--\n\n\
+Return x divided by y, truncated to an integer.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_divmod,
+"divmod($self, x, y, /)\n--\n\n\
+Return quotient and remainder of the division x / y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_exp,
+"exp($self, x, /)\n--\n\n\
+Return e ** x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_fma,
+"fma($self, x, y, z, /)\n--\n\n\
+Return x multiplied by y, plus z.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_canonical,
+"is_canonical($self, x, /)\n--\n\n\
+Return True if x is canonical, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_finite,
+"is_finite($self, x, /)\n--\n\n\
+Return True if x is finite, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_infinite,
+"is_infinite($self, x, /)\n--\n\n\
+Return True if x is infinite, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_nan,
+"is_nan($self, x, /)\n--\n\n\
+Return True if x is a qNaN or sNaN, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_normal,
+"is_normal($self, x, /)\n--\n\n\
+Return True if x is a normal number, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_qnan,
+"is_qnan($self, x, /)\n--\n\n\
+Return True if x is a quiet NaN, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_signed,
+"is_signed($self, x, /)\n--\n\n\
+Return True if x is negative, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_snan,
+"is_snan($self, x, /)\n--\n\n\
+Return True if x is a signaling NaN, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_subnormal,
+"is_subnormal($self, x, /)\n--\n\n\
+Return True if x is subnormal, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_is_zero,
+"is_zero($self, x, /)\n--\n\n\
+Return True if x is a zero, False otherwise.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_ln,
+"ln($self, x, /)\n--\n\n\
+Return the natural (base e) logarithm of x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_log10,
+"log10($self, x, /)\n--\n\n\
+Return the base 10 logarithm of x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_logb,
+"logb($self, x, /)\n--\n\n\
+Return the exponent of the magnitude of the operand's MSD.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_logical_and,
+"logical_and($self, x, y, /)\n--\n\n\
+Digit-wise and of x and y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_logical_invert,
+"logical_invert($self, x, /)\n--\n\n\
+Invert all digits of x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_logical_or,
+"logical_or($self, x, y, /)\n--\n\n\
+Digit-wise or of x and y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_logical_xor,
+"logical_xor($self, x, y, /)\n--\n\n\
+Digit-wise xor of x and y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_max,
+"max($self, x, y, /)\n--\n\n\
+Compare the values numerically and return the maximum.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_max_mag,
+"max_mag($self, x, y, /)\n--\n\n\
+Compare the values numerically with their sign ignored.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_min,
+"min($self, x, y, /)\n--\n\n\
+Compare the values numerically and return the minimum.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_min_mag,
+"min_mag($self, x, y, /)\n--\n\n\
+Compare the values numerically with their sign ignored.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_minus,
+"minus($self, x, /)\n--\n\n\
+Minus corresponds to the unary prefix minus operator in Python, but applies\n\
+the context to the result.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_multiply,
+"multiply($self, x, y, /)\n--\n\n\
+Return the product of x and y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_next_minus,
+"next_minus($self, x, /)\n--\n\n\
+Return the largest representable number smaller than x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_next_plus,
+"next_plus($self, x, /)\n--\n\n\
+Return the smallest representable number larger than x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_next_toward,
+"next_toward($self, x, y, /)\n--\n\n\
+Return the number closest to x, in the direction towards y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_normalize,
+"normalize($self, x, /)\n--\n\n\
+Reduce x to its simplest form. Alias for reduce(x).\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_number_class,
+"number_class($self, x, /)\n--\n\n\
+Return an indication of the class of x.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_plus,
+"plus($self, x, /)\n--\n\n\
+Plus corresponds to the unary prefix plus operator in Python, but applies\n\
+the context to the result.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_power,
+"power($self, /, a, b, modulo=None)\n--\n\n\
+Compute a**b. If 'a' is negative, then 'b' must be integral. The result\n\
+will be inexact unless 'a' is integral and the result is finite and can\n\
+be expressed exactly in 'precision' digits. In the Python version the\n\
+result is always correctly rounded, in the C version the result is almost\n\
+always correctly rounded.\n\
+\n\
+If modulo is given, compute (a**b) % modulo. The following restrictions\n\
+hold:\n\
+\n\
+ * all three arguments must be integral\n\
+ * 'b' must be nonnegative\n\
+ * at least one of 'a' or 'b' must be nonzero\n\
+ * modulo must be nonzero and less than 10**prec in absolute value\n\
+\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_quantize,
+"quantize($self, x, y, /)\n--\n\n\
+Return a value equal to x (rounded), having the exponent of y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_radix,
+"radix($self, /)\n--\n\n\
+Return 10.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_remainder,
+"remainder($self, x, y, /)\n--\n\n\
+Return the remainder from integer division. The sign of the result,\n\
+if non-zero, is the same as that of the original dividend.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_remainder_near,
+"remainder_near($self, x, y, /)\n--\n\n\
+Return x - y * n, where n is the integer nearest the exact value of x / y\n\
+(if the result is 0 then its sign will be the sign of x).\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_rotate,
+"rotate($self, x, y, /)\n--\n\n\
+Return a copy of x, rotated by y places.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_same_quantum,
+"same_quantum($self, x, y, /)\n--\n\n\
+Return True if the two operands have the same exponent.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_scaleb,
+"scaleb($self, x, y, /)\n--\n\n\
+Return the first operand after adding the second value to its exp.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_shift,
+"shift($self, x, y, /)\n--\n\n\
+Return a copy of x, shifted by y places.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_sqrt,
+"sqrt($self, x, /)\n--\n\n\
+Square root of a non-negative number to context precision.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_subtract,
+"subtract($self, x, y, /)\n--\n\n\
+Return the difference between x and y.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_to_eng_string,
+"to_eng_string($self, x, /)\n--\n\n\
+Convert a number to a string, using engineering notation.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_to_integral,
+"to_integral($self, x, /)\n--\n\n\
+Identical to to_integral_value(x).\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_to_integral_exact,
+"to_integral_exact($self, x, /)\n--\n\n\
+Round to an integer. Signal if the result is rounded or inexact.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_to_integral_value,
+"to_integral_value($self, x, /)\n--\n\n\
+Round to an integer.\n\
+\n");
+
+PyDoc_STRVAR(doc_ctx_to_sci_string,
+"to_sci_string($self, x, /)\n--\n\n\
+Convert a number to a string using scientific notation.\n\
+\n");
+
+
+#endif /* DOCSTRINGS_H */
+
+
+
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c
new file mode 100644
index 00000000000..85c608fadf5
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.c
@@ -0,0 +1,655 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <stdio.h>
+
+#include "basearith.h"
+#include "constants.h"
+#include "typearith.h"
+
+
+/*********************************************************************/
+/* Calculations in base MPD_RADIX */
+/*********************************************************************/
+
+
+/*
+ * Knuth, TAOCP, Volume 2, 4.3.1:
+ * w := sum of u (len m) and v (len n)
+ * n > 0 and m >= n
+ * The calling function has to handle a possible final carry.
+ */
+mpd_uint_t
+_mpd_baseadd(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t m, mpd_size_t n)
+{
+ mpd_uint_t s;
+ mpd_uint_t carry = 0;
+ mpd_size_t i;
+
+ assert(n > 0 && m >= n);
+
+ /* add n members of u and v */
+ for (i = 0; i < n; i++) {
+ s = u[i] + (v[i] + carry);
+ carry = (s < u[i]) | (s >= MPD_RADIX);
+ w[i] = carry ? s-MPD_RADIX : s;
+ }
+ /* if there is a carry, propagate it */
+ for (; carry && i < m; i++) {
+ s = u[i] + carry;
+ carry = (s == MPD_RADIX);
+ w[i] = carry ? 0 : s;
+ }
+ /* copy the rest of u */
+ for (; i < m; i++) {
+ w[i] = u[i];
+ }
+
+ return carry;
+}
+
+/*
+ * Add the contents of u to w. Carries are propagated further. The caller
+ * has to make sure that w is big enough.
+ */
+void
+_mpd_baseaddto(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n)
+{
+ mpd_uint_t s;
+ mpd_uint_t carry = 0;
+ mpd_size_t i;
+
+ if (n == 0) return;
+
+ /* add n members of u to w */
+ for (i = 0; i < n; i++) {
+ s = w[i] + (u[i] + carry);
+ carry = (s < w[i]) | (s >= MPD_RADIX);
+ w[i] = carry ? s-MPD_RADIX : s;
+ }
+ /* if there is a carry, propagate it */
+ for (; carry; i++) {
+ s = w[i] + carry;
+ carry = (s == MPD_RADIX);
+ w[i] = carry ? 0 : s;
+ }
+}
+
+/*
+ * Add v to w (len m). The calling function has to handle a possible
+ * final carry. Assumption: m > 0.
+ */
+mpd_uint_t
+_mpd_shortadd(mpd_uint_t *w, mpd_size_t m, mpd_uint_t v)
+{
+ mpd_uint_t s;
+ mpd_uint_t carry;
+ mpd_size_t i;
+
+ assert(m > 0);
+
+ /* add v to w */
+ s = w[0] + v;
+ carry = (s < v) | (s >= MPD_RADIX);
+ w[0] = carry ? s-MPD_RADIX : s;
+
+ /* if there is a carry, propagate it */
+ for (i = 1; carry && i < m; i++) {
+ s = w[i] + carry;
+ carry = (s == MPD_RADIX);
+ w[i] = carry ? 0 : s;
+ }
+
+ return carry;
+}
+
+/* Increment u. The calling function has to handle a possible carry. */
+mpd_uint_t
+_mpd_baseincr(mpd_uint_t *u, mpd_size_t n)
+{
+ mpd_uint_t s;
+ mpd_uint_t carry = 1;
+ mpd_size_t i;
+
+ assert(n > 0);
+
+ /* if there is a carry, propagate it */
+ for (i = 0; carry && i < n; i++) {
+ s = u[i] + carry;
+ carry = (s == MPD_RADIX);
+ u[i] = carry ? 0 : s;
+ }
+
+ return carry;
+}
+
+/*
+ * Knuth, TAOCP, Volume 2, 4.3.1:
+ * w := difference of u (len m) and v (len n).
+ * number in u >= number in v;
+ */
+void
+_mpd_basesub(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t m, mpd_size_t n)
+{
+ mpd_uint_t d;
+ mpd_uint_t borrow = 0;
+ mpd_size_t i;
+
+ assert(m > 0 && n > 0);
+
+ /* subtract n members of v from u */
+ for (i = 0; i < n; i++) {
+ d = u[i] - (v[i] + borrow);
+ borrow = (u[i] < d);
+ w[i] = borrow ? d + MPD_RADIX : d;
+ }
+ /* if there is a borrow, propagate it */
+ for (; borrow && i < m; i++) {
+ d = u[i] - borrow;
+ borrow = (u[i] == 0);
+ w[i] = borrow ? MPD_RADIX-1 : d;
+ }
+ /* copy the rest of u */
+ for (; i < m; i++) {
+ w[i] = u[i];
+ }
+}
+
+/*
+ * Subtract the contents of u from w. w is larger than u. Borrows are
+ * propagated further, but eventually w can absorb the final borrow.
+ */
+void
+_mpd_basesubfrom(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n)
+{
+ mpd_uint_t d;
+ mpd_uint_t borrow = 0;
+ mpd_size_t i;
+
+ if (n == 0) return;
+
+ /* subtract n members of u from w */
+ for (i = 0; i < n; i++) {
+ d = w[i] - (u[i] + borrow);
+ borrow = (w[i] < d);
+ w[i] = borrow ? d + MPD_RADIX : d;
+ }
+ /* if there is a borrow, propagate it */
+ for (; borrow; i++) {
+ d = w[i] - borrow;
+ borrow = (w[i] == 0);
+ w[i] = borrow ? MPD_RADIX-1 : d;
+ }
+}
+
+/* w := product of u (len n) and v (single word) */
+void
+_mpd_shortmul(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n, mpd_uint_t v)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t carry = 0;
+ mpd_size_t i;
+
+ assert(n > 0);
+
+ for (i=0; i < n; i++) {
+
+ _mpd_mul_words(&hi, &lo, u[i], v);
+ lo = carry + lo;
+ if (lo < carry) hi++;
+
+ _mpd_div_words_r(&carry, &w[i], hi, lo);
+ }
+ w[i] = carry;
+}
+
+/*
+ * Knuth, TAOCP, Volume 2, 4.3.1:
+ * w := product of u (len m) and v (len n)
+ * w must be initialized to zero
+ */
+void
+_mpd_basemul(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t m, mpd_size_t n)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t carry;
+ mpd_size_t i, j;
+
+ assert(m > 0 && n > 0);
+
+ for (j=0; j < n; j++) {
+ carry = 0;
+ for (i=0; i < m; i++) {
+
+ _mpd_mul_words(&hi, &lo, u[i], v[j]);
+ lo = w[i+j] + lo;
+ if (lo < w[i+j]) hi++;
+ lo = carry + lo;
+ if (lo < carry) hi++;
+
+ _mpd_div_words_r(&carry, &w[i+j], hi, lo);
+ }
+ w[j+m] = carry;
+ }
+}
+
+/*
+ * Knuth, TAOCP Volume 2, 4.3.1, exercise 16:
+ * w := quotient of u (len n) divided by a single word v
+ */
+mpd_uint_t
+_mpd_shortdiv(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n, mpd_uint_t v)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t rem = 0;
+ mpd_size_t i;
+
+ assert(n > 0);
+
+ for (i=n-1; i != MPD_SIZE_MAX; i--) {
+
+ _mpd_mul_words(&hi, &lo, rem, MPD_RADIX);
+ lo = u[i] + lo;
+ if (lo < u[i]) hi++;
+
+ _mpd_div_words(&w[i], &rem, hi, lo, v);
+ }
+
+ return rem;
+}
+
+/*
+ * Knuth, TAOCP Volume 2, 4.3.1:
+ * q, r := quotient and remainder of uconst (len nplusm)
+ * divided by vconst (len n)
+ * nplusm >= n
+ *
+ * If r is not NULL, r will contain the remainder. If r is NULL, the
+ * return value indicates if there is a remainder: 1 for true, 0 for
+ * false. A return value of -1 indicates an error.
+ */
+int
+_mpd_basedivmod(mpd_uint_t *q, mpd_uint_t *r,
+ const mpd_uint_t *uconst, const mpd_uint_t *vconst,
+ mpd_size_t nplusm, mpd_size_t n)
+{
+ mpd_uint_t ustatic[MPD_MINALLOC_MAX];
+ mpd_uint_t vstatic[MPD_MINALLOC_MAX];
+ mpd_uint_t *u = ustatic;
+ mpd_uint_t *v = vstatic;
+ mpd_uint_t d, qhat, rhat, w2[2];
+ mpd_uint_t hi, lo, x;
+ mpd_uint_t carry;
+ mpd_size_t i, j, m;
+ int retval = 0;
+
+ assert(n > 1 && nplusm >= n);
+ m = sub_size_t(nplusm, n);
+
+ /* D1: normalize */
+ d = MPD_RADIX / (vconst[n-1] + 1);
+
+ if (nplusm >= MPD_MINALLOC_MAX) {
+ if ((u = mpd_alloc(nplusm+1, sizeof *u)) == NULL) {
+ return -1;
+ }
+ }
+ if (n >= MPD_MINALLOC_MAX) {
+ if ((v = mpd_alloc(n+1, sizeof *v)) == NULL) {
+ mpd_free(u);
+ return -1;
+ }
+ }
+
+ _mpd_shortmul(u, uconst, nplusm, d);
+ _mpd_shortmul(v, vconst, n, d);
+
+ /* D2: loop */
+ for (j=m; j != MPD_SIZE_MAX; j--) {
+ assert(2 <= j+n && j+n <= nplusm); /* annotation for scan-build */
+
+ /* D3: calculate qhat and rhat */
+ rhat = _mpd_shortdiv(w2, u+j+n-1, 2, v[n-1]);
+ qhat = w2[1] * MPD_RADIX + w2[0];
+
+ while (1) {
+ if (qhat < MPD_RADIX) {
+ _mpd_singlemul(w2, qhat, v[n-2]);
+ if (w2[1] <= rhat) {
+ if (w2[1] != rhat || w2[0] <= u[j+n-2]) {
+ break;
+ }
+ }
+ }
+ qhat -= 1;
+ rhat += v[n-1];
+ if (rhat < v[n-1] || rhat >= MPD_RADIX) {
+ break;
+ }
+ }
+ /* D4: multiply and subtract */
+ carry = 0;
+ for (i=0; i <= n; i++) {
+
+ _mpd_mul_words(&hi, &lo, qhat, v[i]);
+
+ lo = carry + lo;
+ if (lo < carry) hi++;
+
+ _mpd_div_words_r(&hi, &lo, hi, lo);
+
+ x = u[i+j] - lo;
+ carry = (u[i+j] < x);
+ u[i+j] = carry ? x+MPD_RADIX : x;
+ carry += hi;
+ }
+ q[j] = qhat;
+ /* D5: test remainder */
+ if (carry) {
+ q[j] -= 1;
+ /* D6: add back */
+ (void)_mpd_baseadd(u+j, u+j, v, n+1, n);
+ }
+ }
+
+ /* D8: unnormalize */
+ if (r != NULL) {
+ _mpd_shortdiv(r, u, n, d);
+ /* we are not interested in the return value here */
+ retval = 0;
+ }
+ else {
+ retval = !_mpd_isallzero(u, n);
+ }
+
+
+if (u != ustatic) mpd_free(u);
+if (v != vstatic) mpd_free(v);
+return retval;
+}
+
+/*
+ * Left shift of src by 'shift' digits; src may equal dest.
+ *
+ * dest := area of n mpd_uint_t with space for srcdigits+shift digits.
+ * src := coefficient with length m.
+ *
+ * The case splits in the function are non-obvious. The following
+ * equations might help:
+ *
+ * Let msdigits denote the number of digits in the most significant
+ * word of src. Then 1 <= msdigits <= rdigits.
+ *
+ * 1) shift = q * rdigits + r
+ * 2) srcdigits = qsrc * rdigits + msdigits
+ * 3) destdigits = shift + srcdigits
+ * = q * rdigits + r + qsrc * rdigits + msdigits
+ * = q * rdigits + (qsrc * rdigits + (r + msdigits))
+ *
+ * The result has q zero words, followed by the coefficient that
+ * is left-shifted by r. The case r == 0 is trivial. For r > 0, it
+ * is important to keep in mind that we always read m source words,
+ * but write m+1 destination words if r + msdigits > rdigits, m words
+ * otherwise.
+ */
+void
+_mpd_baseshiftl(mpd_uint_t *dest, mpd_uint_t *src, mpd_size_t n, mpd_size_t m,
+ mpd_size_t shift)
+{
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
+ /* spurious uninitialized warnings */
+ mpd_uint_t l=l, lprev=lprev, h=h;
+#else
+ mpd_uint_t l, lprev, h;
+#endif
+ mpd_uint_t q, r;
+ mpd_uint_t ph;
+
+ assert(m > 0 && n >= m);
+
+ _mpd_div_word(&q, &r, (mpd_uint_t)shift, MPD_RDIGITS);
+
+ if (r != 0) {
+
+ ph = mpd_pow10[r];
+
+ --m; --n;
+ _mpd_divmod_pow10(&h, &lprev, src[m--], MPD_RDIGITS-r);
+ if (h != 0) { /* r + msdigits > rdigits <==> h != 0 */
+ dest[n--] = h;
+ }
+ /* write m-1 shifted words */
+ for (; m != MPD_SIZE_MAX; m--,n--) {
+ _mpd_divmod_pow10(&h, &l, src[m], MPD_RDIGITS-r);
+ dest[n] = ph * lprev + h;
+ lprev = l;
+ }
+ /* write least significant word */
+ dest[q] = ph * lprev;
+ }
+ else {
+ while (--m != MPD_SIZE_MAX) {
+ dest[m+q] = src[m];
+ }
+ }
+
+ mpd_uint_zero(dest, q);
+}
+
+/*
+ * Right shift of src by 'shift' digits; src may equal dest.
+ * Assumption: srcdigits-shift > 0.
+ *
+ * dest := area with space for srcdigits-shift digits.
+ * src := coefficient with length 'slen'.
+ *
+ * The case splits in the function rely on the following equations:
+ *
+ * Let msdigits denote the number of digits in the most significant
+ * word of src. Then 1 <= msdigits <= rdigits.
+ *
+ * 1) shift = q * rdigits + r
+ * 2) srcdigits = qsrc * rdigits + msdigits
+ * 3) destdigits = srcdigits - shift
+ * = qsrc * rdigits + msdigits - (q * rdigits + r)
+ * = (qsrc - q) * rdigits + msdigits - r
+ *
+ * Since destdigits > 0 and 1 <= msdigits <= rdigits:
+ *
+ * 4) qsrc >= q
+ * 5) qsrc == q ==> msdigits > r
+ *
+ * The result has slen-q words if msdigits > r, slen-q-1 words otherwise.
+ */
+mpd_uint_t
+_mpd_baseshiftr(mpd_uint_t *dest, mpd_uint_t *src, mpd_size_t slen,
+ mpd_size_t shift)
+{
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
+ /* spurious uninitialized warnings */
+ mpd_uint_t l=l, h=h, hprev=hprev; /* low, high, previous high */
+#else
+ mpd_uint_t l, h, hprev; /* low, high, previous high */
+#endif
+ mpd_uint_t rnd, rest; /* rounding digit, rest */
+ mpd_uint_t q, r;
+ mpd_size_t i, j;
+ mpd_uint_t ph;
+
+ assert(slen > 0);
+
+ _mpd_div_word(&q, &r, (mpd_uint_t)shift, MPD_RDIGITS);
+
+ rnd = rest = 0;
+ if (r != 0) {
+
+ ph = mpd_pow10[MPD_RDIGITS-r];
+
+ _mpd_divmod_pow10(&hprev, &rest, src[q], r);
+ _mpd_divmod_pow10(&rnd, &rest, rest, r-1);
+
+ if (rest == 0 && q > 0) {
+ rest = !_mpd_isallzero(src, q);
+ }
+ /* write slen-q-1 words */
+ for (j=0,i=q+1; i<slen; i++,j++) {
+ _mpd_divmod_pow10(&h, &l, src[i], r);
+ dest[j] = ph * l + hprev;
+ hprev = h;
+ }
+ /* write most significant word */
+ if (hprev != 0) { /* always the case if slen==q-1 */
+ dest[j] = hprev;
+ }
+ }
+ else {
+ if (q > 0) {
+ _mpd_divmod_pow10(&rnd, &rest, src[q-1], MPD_RDIGITS-1);
+ /* is there any non-zero digit below rnd? */
+ if (rest == 0) rest = !_mpd_isallzero(src, q-1);
+ }
+ for (j = 0; j < slen-q; j++) {
+ dest[j] = src[q+j];
+ }
+ }
+
+ /* 0-4 ==> rnd+rest < 0.5 */
+ /* 5 ==> rnd+rest == 0.5 */
+ /* 6-9 ==> rnd+rest > 0.5 */
+ return (rnd == 0 || rnd == 5) ? rnd + !!rest : rnd;
+}
+
+
+/*********************************************************************/
+/* Calculations in base b */
+/*********************************************************************/
+
+/*
+ * Add v to w (len m). The calling function has to handle a possible
+ * final carry. Assumption: m > 0.
+ */
+mpd_uint_t
+_mpd_shortadd_b(mpd_uint_t *w, mpd_size_t m, mpd_uint_t v, mpd_uint_t b)
+{
+ mpd_uint_t s;
+ mpd_uint_t carry;
+ mpd_size_t i;
+
+ assert(m > 0);
+
+ /* add v to w */
+ s = w[0] + v;
+ carry = (s < v) | (s >= b);
+ w[0] = carry ? s-b : s;
+
+ /* if there is a carry, propagate it */
+ for (i = 1; carry && i < m; i++) {
+ s = w[i] + carry;
+ carry = (s == b);
+ w[i] = carry ? 0 : s;
+ }
+
+ return carry;
+}
+
+/* w := product of u (len n) and v (single word). Return carry. */
+mpd_uint_t
+_mpd_shortmul_c(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n, mpd_uint_t v)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t carry = 0;
+ mpd_size_t i;
+
+ assert(n > 0);
+
+ for (i=0; i < n; i++) {
+
+ _mpd_mul_words(&hi, &lo, u[i], v);
+ lo = carry + lo;
+ if (lo < carry) hi++;
+
+ _mpd_div_words_r(&carry, &w[i], hi, lo);
+ }
+
+ return carry;
+}
+
+/* w := product of u (len n) and v (single word) */
+mpd_uint_t
+_mpd_shortmul_b(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v, mpd_uint_t b)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t carry = 0;
+ mpd_size_t i;
+
+ assert(n > 0);
+
+ for (i=0; i < n; i++) {
+
+ _mpd_mul_words(&hi, &lo, u[i], v);
+ lo = carry + lo;
+ if (lo < carry) hi++;
+
+ _mpd_div_words(&carry, &w[i], hi, lo, b);
+ }
+
+ return carry;
+}
+
+/*
+ * Knuth, TAOCP Volume 2, 4.3.1, exercise 16:
+ * w := quotient of u (len n) divided by a single word v
+ */
+mpd_uint_t
+_mpd_shortdiv_b(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v, mpd_uint_t b)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t rem = 0;
+ mpd_size_t i;
+
+ assert(n > 0);
+
+ for (i=n-1; i != MPD_SIZE_MAX; i--) {
+
+ _mpd_mul_words(&hi, &lo, rem, b);
+ lo = u[i] + lo;
+ if (lo < u[i]) hi++;
+
+ _mpd_div_words(&w[i], &rem, hi, lo, v);
+ }
+
+ return rem;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h
new file mode 100644
index 00000000000..d35925aaddb
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/basearith.h
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_BASEARITH_H_
+#define LIBMPDEC_BASEARITH_H_
+
+
+#include "mpdecimal.h"
+#include "typearith.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+mpd_uint_t _mpd_baseadd(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t m, mpd_size_t n);
+void _mpd_baseaddto(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n);
+mpd_uint_t _mpd_shortadd(mpd_uint_t *w, mpd_size_t m, mpd_uint_t v);
+mpd_uint_t _mpd_shortadd_b(mpd_uint_t *w, mpd_size_t m, mpd_uint_t v,
+ mpd_uint_t b);
+mpd_uint_t _mpd_baseincr(mpd_uint_t *u, mpd_size_t n);
+void _mpd_basesub(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t m, mpd_size_t n);
+void _mpd_basesubfrom(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n);
+void _mpd_basemul(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t m, mpd_size_t n);
+void _mpd_shortmul(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v);
+mpd_uint_t _mpd_shortmul_c(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v);
+mpd_uint_t _mpd_shortmul_b(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v, mpd_uint_t b);
+mpd_uint_t _mpd_shortdiv(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v);
+mpd_uint_t _mpd_shortdiv_b(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n,
+ mpd_uint_t v, mpd_uint_t b);
+int _mpd_basedivmod(mpd_uint_t *q, mpd_uint_t *r, const mpd_uint_t *uconst,
+ const mpd_uint_t *vconst, mpd_size_t nplusm, mpd_size_t n);
+void _mpd_baseshiftl(mpd_uint_t *dest, mpd_uint_t *src, mpd_size_t n,
+ mpd_size_t m, mpd_size_t shift);
+mpd_uint_t _mpd_baseshiftr(mpd_uint_t *dest, mpd_uint_t *src, mpd_size_t slen,
+ mpd_size_t shift);
+
+
+
+#ifdef CONFIG_64
+extern const mpd_uint_t mprime_rdx;
+
+/*
+ * Algorithm from: Division by Invariant Integers using Multiplication,
+ * T. Granlund and P. L. Montgomery, Proceedings of the SIGPLAN '94
+ * Conference on Programming Language Design and Implementation.
+ *
+ * http://gmplib.org/~tege/divcnst-pldi94.pdf
+ *
+ * Variables from the paper and their translations (See section 8):
+ *
+ * N := 64
+ * d := MPD_RADIX
+ * l := 64
+ * m' := floor((2**(64+64) - 1)/MPD_RADIX) - 2**64
+ *
+ * Since N-l == 0:
+ *
+ * dnorm := d
+ * n2 := hi
+ * n10 := lo
+ *
+ * ACL2 proof: mpd-div-words-r-correct
+ */
+static inline void
+_mpd_div_words_r(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo)
+{
+ mpd_uint_t n_adj, h, l, t;
+ mpd_uint_t n1_neg;
+
+ /* n1_neg = if lo >= 2**63 then MPD_UINT_MAX else 0 */
+ n1_neg = (lo & (1ULL<<63)) ? MPD_UINT_MAX : 0;
+ /* n_adj = if lo >= 2**63 then lo+MPD_RADIX else lo */
+ n_adj = lo + (n1_neg & MPD_RADIX);
+
+ /* (h, l) = if lo >= 2**63 then m'*(hi+1) else m'*hi */
+ _mpd_mul_words(&h, &l, mprime_rdx, hi-n1_neg);
+ l = l + n_adj;
+ if (l < n_adj) h++;
+ t = h + hi;
+ /* At this point t == qest, with q == qest or q == qest+1:
+ * 1) 0 <= 2**64*hi + lo - qest*MPD_RADIX < 2*MPD_RADIX
+ */
+
+ /* t = 2**64-1 - qest = 2**64 - (qest+1) */
+ t = MPD_UINT_MAX - t;
+
+ /* (h, l) = 2**64*MPD_RADIX - (qest+1)*MPD_RADIX */
+ _mpd_mul_words(&h, &l, t, MPD_RADIX);
+ l = l + lo;
+ if (l < lo) h++;
+ h += hi;
+ h -= MPD_RADIX;
+ /* (h, l) = 2**64*hi + lo - (qest+1)*MPD_RADIX (mod 2**128)
+ * Case q == qest+1:
+ * a) h == 0, l == r
+ * b) q := h - t == qest+1
+ * c) r := l
+ * Case q == qest:
+ * a) h == MPD_UINT_MAX, l == 2**64-(MPD_RADIX-r)
+ * b) q := h - t == qest
+ * c) r := l + MPD_RADIX = r
+ */
+
+ *q = (h - t);
+ *r = l + (MPD_RADIX & h);
+}
+#else
+static inline void
+_mpd_div_words_r(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo)
+{
+ _mpd_div_words(q, r, hi, lo, MPD_RADIX);
+}
+#endif
+
+
+/* Multiply two single base MPD_RADIX words, store result in array w[2]. */
+static inline void
+_mpd_singlemul(mpd_uint_t w[2], mpd_uint_t u, mpd_uint_t v)
+{
+ mpd_uint_t hi, lo;
+
+ _mpd_mul_words(&hi, &lo, u, v);
+ _mpd_div_words_r(&w[1], &w[0], hi, lo);
+}
+
+/* Multiply u (len 2) and v (len m, 1 <= m <= 2). */
+static inline void
+_mpd_mul_2_le2(mpd_uint_t w[4], mpd_uint_t u[2], mpd_uint_t v[2], mpd_ssize_t m)
+{
+ mpd_uint_t hi, lo;
+
+ _mpd_mul_words(&hi, &lo, u[0], v[0]);
+ _mpd_div_words_r(&w[1], &w[0], hi, lo);
+
+ _mpd_mul_words(&hi, &lo, u[1], v[0]);
+ lo = w[1] + lo;
+ if (lo < w[1]) hi++;
+ _mpd_div_words_r(&w[2], &w[1], hi, lo);
+ if (m == 1) return;
+
+ _mpd_mul_words(&hi, &lo, u[0], v[1]);
+ lo = w[1] + lo;
+ if (lo < w[1]) hi++;
+ _mpd_div_words_r(&w[3], &w[1], hi, lo);
+
+ _mpd_mul_words(&hi, &lo, u[1], v[1]);
+ lo = w[2] + lo;
+ if (lo < w[2]) hi++;
+ lo = w[3] + lo;
+ if (lo < w[3]) hi++;
+ _mpd_div_words_r(&w[3], &w[2], hi, lo);
+}
+
+
+/*
+ * Test if all words from data[len-1] to data[0] are zero. If len is 0, nothing
+ * is tested and the coefficient is regarded as "all zero".
+ */
+static inline int
+_mpd_isallzero(const mpd_uint_t *data, mpd_ssize_t len)
+{
+ while (--len >= 0) {
+ if (data[len] != 0) return 0;
+ }
+ return 1;
+}
+
+/*
+ * Test if all full words from data[len-1] to data[0] are MPD_RADIX-1
+ * (all nines). Return true if len == 0.
+ */
+static inline int
+_mpd_isallnine(const mpd_uint_t *data, mpd_ssize_t len)
+{
+ while (--len >= 0) {
+ if (data[len] != MPD_RADIX-1) return 0;
+ }
+ return 1;
+}
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_BASEARITH_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/bits.h b/contrib/tools/python3/Modules/_decimal/libmpdec/bits.h
new file mode 100644
index 00000000000..aa9c3e77980
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/bits.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_BITS_H_
+#define LIBMPDEC_BITS_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Check if n is a power of 2. */
+static inline int
+ispower2(mpd_size_t n)
+{
+ return n != 0 && (n & (n-1)) == 0;
+}
+
+#if defined(ANSI)
+/*
+ * Return the most significant bit position of n from 0 to 31 (63).
+ * Assumptions: n != 0.
+ */
+static inline int
+mpd_bsr(mpd_size_t n)
+{
+ int pos = 0;
+ mpd_size_t tmp;
+
+#ifdef CONFIG_64
+ tmp = n >> 32;
+ if (tmp != 0) { n = tmp; pos += 32; }
+#endif
+ tmp = n >> 16;
+ if (tmp != 0) { n = tmp; pos += 16; }
+ tmp = n >> 8;
+ if (tmp != 0) { n = tmp; pos += 8; }
+ tmp = n >> 4;
+ if (tmp != 0) { n = tmp; pos += 4; }
+ tmp = n >> 2;
+ if (tmp != 0) { n = tmp; pos += 2; }
+ tmp = n >> 1;
+ if (tmp != 0) { n = tmp; pos += 1; }
+
+ return pos + (int)n - 1;
+}
+
+/*
+ * Return the least significant bit position of n from 0 to 31 (63).
+ * Assumptions: n != 0.
+ */
+static inline int
+mpd_bsf(mpd_size_t n)
+{
+ int pos;
+
+#ifdef CONFIG_64
+ pos = 63;
+ if (n & 0x00000000FFFFFFFFULL) { pos -= 32; } else { n >>= 32; }
+ if (n & 0x000000000000FFFFULL) { pos -= 16; } else { n >>= 16; }
+ if (n & 0x00000000000000FFULL) { pos -= 8; } else { n >>= 8; }
+ if (n & 0x000000000000000FULL) { pos -= 4; } else { n >>= 4; }
+ if (n & 0x0000000000000003ULL) { pos -= 2; } else { n >>= 2; }
+ if (n & 0x0000000000000001ULL) { pos -= 1; }
+#else
+ pos = 31;
+ if (n & 0x000000000000FFFFUL) { pos -= 16; } else { n >>= 16; }
+ if (n & 0x00000000000000FFUL) { pos -= 8; } else { n >>= 8; }
+ if (n & 0x000000000000000FUL) { pos -= 4; } else { n >>= 4; }
+ if (n & 0x0000000000000003UL) { pos -= 2; } else { n >>= 2; }
+ if (n & 0x0000000000000001UL) { pos -= 1; }
+#endif
+ return pos;
+}
+/* END ANSI */
+
+#elif defined(ASM)
+/*
+ * Bit scan reverse. Assumptions: a != 0.
+ */
+static inline int
+mpd_bsr(mpd_size_t a)
+{
+ mpd_size_t retval;
+
+ __asm__ (
+#ifdef CONFIG_64
+ "bsrq %1, %0\n\t"
+#else
+ "bsr %1, %0\n\t"
+#endif
+ :"=r" (retval)
+ :"r" (a)
+ :"cc"
+ );
+
+ return (int)retval;
+}
+
+/*
+ * Bit scan forward. Assumptions: a != 0.
+ */
+static inline int
+mpd_bsf(mpd_size_t a)
+{
+ mpd_size_t retval;
+
+ __asm__ (
+#ifdef CONFIG_64
+ "bsfq %1, %0\n\t"
+#else
+ "bsf %1, %0\n\t"
+#endif
+ :"=r" (retval)
+ :"r" (a)
+ :"cc"
+ );
+
+ return (int)retval;
+}
+/* END ASM */
+
+#elif defined(MASM)
+#include <intrin.h>
+/*
+ * Bit scan reverse. Assumptions: a != 0.
+ */
+static inline int __cdecl
+mpd_bsr(mpd_size_t a)
+{
+ unsigned long retval;
+
+#ifdef CONFIG_64
+ _BitScanReverse64(&retval, a);
+#else
+ _BitScanReverse(&retval, a);
+#endif
+
+ return (int)retval;
+}
+
+/*
+ * Bit scan forward. Assumptions: a != 0.
+ */
+static inline int __cdecl
+mpd_bsf(mpd_size_t a)
+{
+ unsigned long retval;
+
+#ifdef CONFIG_64
+ _BitScanForward64(&retval, a);
+#else
+ _BitScanForward(&retval, a);
+#endif
+
+ return (int)retval;
+}
+/* END MASM (_MSC_VER) */
+#else
+ #error "missing preprocessor definitions"
+#endif /* BSR/BSF */
+
+
+#endif /* LIBMPDEC_BITS_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/constants.c b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.c
new file mode 100644
index 00000000000..ed074fa81c6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+#include "basearith.h"
+#include "constants.h"
+
+
+#if defined(CONFIG_64)
+
+ /* number-theory.c */
+ const mpd_uint_t mpd_moduli[3] = {
+ 18446744069414584321ULL, 18446744056529682433ULL, 18446742974197923841ULL
+ };
+ const mpd_uint_t mpd_roots[3] = {7ULL, 10ULL, 19ULL};
+
+ /* crt.c */
+ const mpd_uint_t INV_P1_MOD_P2 = 18446744055098026669ULL;
+ const mpd_uint_t INV_P1P2_MOD_P3 = 287064143708160ULL;
+ const mpd_uint_t LH_P1P2 = 18446744052234715137ULL; /* (P1*P2) % 2^64 */
+ const mpd_uint_t UH_P1P2 = 18446744052234715141ULL; /* (P1*P2) / 2^64 */
+
+ /* transpose.c */
+ const mpd_size_t mpd_bits[64] = {
+ 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384,
+ 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608,
+ 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824,
+ 2147483648ULL, 4294967296ULL, 8589934592ULL, 17179869184ULL, 34359738368ULL,
+ 68719476736ULL, 137438953472ULL, 274877906944ULL, 549755813888ULL,
+ 1099511627776ULL, 2199023255552ULL, 4398046511104, 8796093022208ULL,
+ 17592186044416ULL, 35184372088832ULL, 70368744177664ULL, 140737488355328ULL,
+ 281474976710656ULL, 562949953421312ULL, 1125899906842624ULL,
+ 2251799813685248ULL, 4503599627370496ULL, 9007199254740992ULL,
+ 18014398509481984ULL, 36028797018963968ULL, 72057594037927936ULL,
+ 144115188075855872ULL, 288230376151711744ULL, 576460752303423488ULL,
+ 1152921504606846976ULL, 2305843009213693952ULL, 4611686018427387904ULL,
+ 9223372036854775808ULL
+ };
+
+ /* mpdecimal.c */
+ const mpd_uint_t mpd_pow10[MPD_RDIGITS+1] = {
+ 1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,
+ 10000000000ULL,100000000000ULL,1000000000000ULL,10000000000000ULL,
+ 100000000000000ULL,1000000000000000ULL,10000000000000000ULL,
+ 100000000000000000ULL,1000000000000000000ULL,10000000000000000000ULL
+ };
+
+ /* magic number for constant division by MPD_RADIX */
+ const mpd_uint_t mprime_rdx = 15581492618384294730ULL;
+
+#elif defined(CONFIG_32)
+
+ /* number-theory.c */
+ const mpd_uint_t mpd_moduli[3] = {2113929217UL, 2013265921UL, 1811939329UL};
+ const mpd_uint_t mpd_roots[3] = {5UL, 31UL, 13UL};
+
+ /* PentiumPro modular multiplication: These constants have to be loaded as
+ * 80 bit long doubles, which are not supported by certain compilers. */
+ const uint32_t mpd_invmoduli[3][3] = {
+ {4293885170U, 2181570688U, 16352U}, /* ((long double) 1 / 2113929217UL) */
+ {1698898177U, 2290649223U, 16352U}, /* ((long double) 1 / 2013265921UL) */
+ {2716021846U, 2545165803U, 16352U} /* ((long double) 1 / 1811939329UL) */
+ };
+
+ const float MPD_TWO63 = 9223372036854775808.0; /* 2^63 */
+
+ /* crt.c */
+ const mpd_uint_t INV_P1_MOD_P2 = 2013265901UL;
+ const mpd_uint_t INV_P1P2_MOD_P3 = 54UL;
+ const mpd_uint_t LH_P1P2 = 4127195137UL; /* (P1*P2) % 2^32 */
+ const mpd_uint_t UH_P1P2 = 990904320UL; /* (P1*P2) / 2^32 */
+
+ /* transpose.c */
+ const mpd_size_t mpd_bits[32] = {
+ 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384,
+ 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608,
+ 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824,
+ 2147483648UL
+ };
+
+ /* mpdecimal.c */
+ const mpd_uint_t mpd_pow10[MPD_RDIGITS+1] = {
+ 1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000
+ };
+
+#else
+ #error "CONFIG_64 or CONFIG_32 must be defined."
+#endif
+
+const char * const mpd_round_string[MPD_ROUND_GUARD] = {
+ "ROUND_UP", /* round away from 0 */
+ "ROUND_DOWN", /* round toward 0 (truncate) */
+ "ROUND_CEILING", /* round toward +infinity */
+ "ROUND_FLOOR", /* round toward -infinity */
+ "ROUND_HALF_UP", /* 0.5 is rounded up */
+ "ROUND_HALF_DOWN", /* 0.5 is rounded down */
+ "ROUND_HALF_EVEN", /* 0.5 is rounded to even */
+ "ROUND_05UP", /* round zero or five away from 0 */
+ "ROUND_TRUNC", /* truncate, but set infinity */
+};
+
+const char * const mpd_clamp_string[MPD_CLAMP_GUARD] = {
+ "CLAMP_DEFAULT",
+ "CLAMP_IEEE_754"
+};
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/constants.h b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.h
new file mode 100644
index 00000000000..7c1db839c20
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/constants.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_CONSTANTS_H_
+#define LIBMPDEC_CONSTANTS_H_
+
+
+#include "mpdecimal.h"
+
+#include <stdint.h>
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+/* choice of optimized functions */
+#if defined(CONFIG_64)
+/* x64 */
+ #define MULMOD(a, b) x64_mulmod(a, b, umod)
+ #define MULMOD2C(a0, a1, w) x64_mulmod2c(a0, a1, w, umod)
+ #define MULMOD2(a0, b0, a1, b1) x64_mulmod2(a0, b0, a1, b1, umod)
+ #define POWMOD(base, exp) x64_powmod(base, exp, umod)
+ #define SETMODULUS(modnum) std_setmodulus(modnum, &umod)
+ #define SIZE3_NTT(x0, x1, x2, w3table) std_size3_ntt(x0, x1, x2, w3table, umod)
+#elif defined(PPRO)
+/* PentiumPro (or later) gcc inline asm */
+ #define MULMOD(a, b) ppro_mulmod(a, b, &dmod, dinvmod)
+ #define MULMOD2C(a0, a1, w) ppro_mulmod2c(a0, a1, w, &dmod, dinvmod)
+ #define MULMOD2(a0, b0, a1, b1) ppro_mulmod2(a0, b0, a1, b1, &dmod, dinvmod)
+ #define POWMOD(base, exp) ppro_powmod(base, exp, &dmod, dinvmod)
+ #define SETMODULUS(modnum) ppro_setmodulus(modnum, &umod, &dmod, dinvmod)
+ #define SIZE3_NTT(x0, x1, x2, w3table) ppro_size3_ntt(x0, x1, x2, w3table, umod, &dmod, dinvmod)
+#else
+ /* ANSI C99 */
+ #define MULMOD(a, b) std_mulmod(a, b, umod)
+ #define MULMOD2C(a0, a1, w) std_mulmod2c(a0, a1, w, umod)
+ #define MULMOD2(a0, b0, a1, b1) std_mulmod2(a0, b0, a1, b1, umod)
+ #define POWMOD(base, exp) std_powmod(base, exp, umod)
+ #define SETMODULUS(modnum) std_setmodulus(modnum, &umod)
+ #define SIZE3_NTT(x0, x1, x2, w3table) std_size3_ntt(x0, x1, x2, w3table, umod)
+#endif
+
+/* PentiumPro (or later) gcc inline asm */
+extern const float MPD_TWO63;
+extern const uint32_t mpd_invmoduli[3][3];
+
+enum {P1, P2, P3};
+
+extern const mpd_uint_t mpd_moduli[];
+extern const mpd_uint_t mpd_roots[];
+extern const mpd_size_t mpd_bits[];
+extern const mpd_uint_t mpd_pow10[];
+
+extern const mpd_uint_t INV_P1_MOD_P2;
+extern const mpd_uint_t INV_P1P2_MOD_P3;
+extern const mpd_uint_t LH_P1P2;
+extern const mpd_uint_t UH_P1P2;
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_CONSTANTS_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/context.c b/contrib/tools/python3/Modules/_decimal/libmpdec/context.c
new file mode 100644
index 00000000000..172794b67d8
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/context.c
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+
+
+void
+mpd_dflt_traphandler(mpd_context_t *ctx)
+{
+ (void)ctx;
+ raise(SIGFPE);
+}
+
+void (* mpd_traphandler)(mpd_context_t *) = mpd_dflt_traphandler;
+
+
+/* Set guaranteed minimum number of coefficient words. The function may
+ be used once at program start. Setting MPD_MINALLOC to out-of-bounds
+ values is a catastrophic error, so in that case the function exits rather
+ than relying on the user to check a return value. */
+void
+mpd_setminalloc(mpd_ssize_t n)
+{
+ static int minalloc_is_set = 0;
+
+ if (minalloc_is_set) {
+ mpd_err_warn("mpd_setminalloc: ignoring request to set "
+ "MPD_MINALLOC a second time\n");
+ return;
+ }
+ if (n < MPD_MINALLOC_MIN || n > MPD_MINALLOC_MAX) {
+ mpd_err_fatal("illegal value for MPD_MINALLOC"); /* GCOV_NOT_REACHED */
+ }
+ MPD_MINALLOC = n;
+ minalloc_is_set = 1;
+}
+
+void
+mpd_init(mpd_context_t *ctx, mpd_ssize_t prec)
+{
+ mpd_ssize_t ideal_minalloc;
+
+ mpd_defaultcontext(ctx);
+
+ if (!mpd_qsetprec(ctx, prec)) {
+ mpd_addstatus_raise(ctx, MPD_Invalid_context);
+ return;
+ }
+
+ ideal_minalloc = 2 * ((prec+MPD_RDIGITS-1) / MPD_RDIGITS);
+ if (ideal_minalloc < MPD_MINALLOC_MIN) ideal_minalloc = MPD_MINALLOC_MIN;
+ if (ideal_minalloc > MPD_MINALLOC_MAX) ideal_minalloc = MPD_MINALLOC_MAX;
+
+ mpd_setminalloc(ideal_minalloc);
+}
+
+void
+mpd_maxcontext(mpd_context_t *ctx)
+{
+ ctx->prec=MPD_MAX_PREC;
+ ctx->emax=MPD_MAX_EMAX;
+ ctx->emin=MPD_MIN_EMIN;
+ ctx->round=MPD_ROUND_HALF_EVEN;
+ ctx->traps=MPD_Traps;
+ ctx->status=0;
+ ctx->newtrap=0;
+ ctx->clamp=0;
+ ctx->allcr=1;
+}
+
+void
+mpd_defaultcontext(mpd_context_t *ctx)
+{
+ ctx->prec=2*MPD_RDIGITS;
+ ctx->emax=MPD_MAX_EMAX;
+ ctx->emin=MPD_MIN_EMIN;
+ ctx->round=MPD_ROUND_HALF_UP;
+ ctx->traps=MPD_Traps;
+ ctx->status=0;
+ ctx->newtrap=0;
+ ctx->clamp=0;
+ ctx->allcr=1;
+}
+
+void
+mpd_basiccontext(mpd_context_t *ctx)
+{
+ ctx->prec=9;
+ ctx->emax=MPD_MAX_EMAX;
+ ctx->emin=MPD_MIN_EMIN;
+ ctx->round=MPD_ROUND_HALF_UP;
+ ctx->traps=MPD_Traps|MPD_Clamped;
+ ctx->status=0;
+ ctx->newtrap=0;
+ ctx->clamp=0;
+ ctx->allcr=1;
+}
+
+int
+mpd_ieee_context(mpd_context_t *ctx, int bits)
+{
+ if (bits <= 0 || bits > MPD_IEEE_CONTEXT_MAX_BITS || bits % 32) {
+ return -1;
+ }
+
+ ctx->prec = 9 * (bits/32) - 2;
+ ctx->emax = 3 * ((mpd_ssize_t)1<<(bits/16+3));
+ ctx->emin = 1 - ctx->emax;
+ ctx->round=MPD_ROUND_HALF_EVEN;
+ ctx->traps=0;
+ ctx->status=0;
+ ctx->newtrap=0;
+ ctx->clamp=1;
+ ctx->allcr=1;
+
+ return 0;
+}
+
+mpd_ssize_t
+mpd_getprec(const mpd_context_t *ctx)
+{
+ return ctx->prec;
+}
+
+mpd_ssize_t
+mpd_getemax(const mpd_context_t *ctx)
+{
+ return ctx->emax;
+}
+
+mpd_ssize_t
+mpd_getemin(const mpd_context_t *ctx)
+{
+ return ctx->emin;
+}
+
+int
+mpd_getround(const mpd_context_t *ctx)
+{
+ return ctx->round;
+}
+
+uint32_t
+mpd_gettraps(const mpd_context_t *ctx)
+{
+ return ctx->traps;
+}
+
+uint32_t
+mpd_getstatus(const mpd_context_t *ctx)
+{
+ return ctx->status;
+}
+
+int
+mpd_getclamp(const mpd_context_t *ctx)
+{
+ return ctx->clamp;
+}
+
+int
+mpd_getcr(const mpd_context_t *ctx)
+{
+ return ctx->allcr;
+}
+
+
+int
+mpd_qsetprec(mpd_context_t *ctx, mpd_ssize_t prec)
+{
+ if (prec <= 0 || prec > MPD_MAX_PREC) {
+ return 0;
+ }
+ ctx->prec = prec;
+ return 1;
+}
+
+int
+mpd_qsetemax(mpd_context_t *ctx, mpd_ssize_t emax)
+{
+ if (emax < 0 || emax > MPD_MAX_EMAX) {
+ return 0;
+ }
+ ctx->emax = emax;
+ return 1;
+}
+
+int
+mpd_qsetemin(mpd_context_t *ctx, mpd_ssize_t emin)
+{
+ if (emin > 0 || emin < MPD_MIN_EMIN) {
+ return 0;
+ }
+ ctx->emin = emin;
+ return 1;
+}
+
+int
+mpd_qsetround(mpd_context_t *ctx, int round)
+{
+ if (!(0 <= round && round < MPD_ROUND_GUARD)) {
+ return 0;
+ }
+ ctx->round = round;
+ return 1;
+}
+
+int
+mpd_qsettraps(mpd_context_t *ctx, uint32_t flags)
+{
+ if (flags > MPD_Max_status) {
+ return 0;
+ }
+ ctx->traps = flags;
+ return 1;
+}
+
+int
+mpd_qsetstatus(mpd_context_t *ctx, uint32_t flags)
+{
+ if (flags > MPD_Max_status) {
+ return 0;
+ }
+ ctx->status = flags;
+ return 1;
+}
+
+int
+mpd_qsetclamp(mpd_context_t *ctx, int c)
+{
+ if (c != 0 && c != 1) {
+ return 0;
+ }
+ ctx->clamp = c;
+ return 1;
+}
+
+int
+mpd_qsetcr(mpd_context_t *ctx, int c)
+{
+ if (c != 0 && c != 1) {
+ return 0;
+ }
+ ctx->allcr = c;
+ return 1;
+}
+
+
+void
+mpd_addstatus_raise(mpd_context_t *ctx, uint32_t flags)
+{
+ ctx->status |= flags;
+ if (flags&ctx->traps) {
+ ctx->newtrap = (flags&ctx->traps);
+ mpd_traphandler(ctx);
+ }
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c
new file mode 100644
index 00000000000..4bc8e8b5fd3
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+#include "bits.h"
+#include "constants.h"
+#include "convolute.h"
+#include "fnt.h"
+#include "fourstep.h"
+#include "numbertheory.h"
+#include "sixstep.h"
+#include "umodarith.h"
+
+
+/* Bignum: Fast convolution using the Number Theoretic Transform. Used for
+ the multiplication of very large coefficients. */
+
+
+/* Convolute the data in c1 and c2. Result is in c1. */
+int
+fnt_convolute(mpd_uint_t *c1, mpd_uint_t *c2, mpd_size_t n, int modnum)
+{
+ int (*fnt)(mpd_uint_t *, mpd_size_t, int);
+ int (*inv_fnt)(mpd_uint_t *, mpd_size_t, int);
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t n_inv, umod;
+ mpd_size_t i;
+
+
+ SETMODULUS(modnum);
+ n_inv = POWMOD(n, (umod-2));
+
+ if (ispower2(n)) {
+ if (n > SIX_STEP_THRESHOLD) {
+ fnt = six_step_fnt;
+ inv_fnt = inv_six_step_fnt;
+ }
+ else {
+ fnt = std_fnt;
+ inv_fnt = std_inv_fnt;
+ }
+ }
+ else {
+ fnt = four_step_fnt;
+ inv_fnt = inv_four_step_fnt;
+ }
+
+ if (!fnt(c1, n, modnum)) {
+ return 0;
+ }
+ if (!fnt(c2, n, modnum)) {
+ return 0;
+ }
+ for (i = 0; i < n-1; i += 2) {
+ mpd_uint_t x0 = c1[i];
+ mpd_uint_t y0 = c2[i];
+ mpd_uint_t x1 = c1[i+1];
+ mpd_uint_t y1 = c2[i+1];
+ MULMOD2(&x0, y0, &x1, y1);
+ c1[i] = x0;
+ c1[i+1] = x1;
+ }
+
+ if (!inv_fnt(c1, n, modnum)) {
+ return 0;
+ }
+ for (i = 0; i < n-3; i += 4) {
+ mpd_uint_t x0 = c1[i];
+ mpd_uint_t x1 = c1[i+1];
+ mpd_uint_t x2 = c1[i+2];
+ mpd_uint_t x3 = c1[i+3];
+ MULMOD2C(&x0, &x1, n_inv);
+ MULMOD2C(&x2, &x3, n_inv);
+ c1[i] = x0;
+ c1[i+1] = x1;
+ c1[i+2] = x2;
+ c1[i+3] = x3;
+ }
+
+ return 1;
+}
+
+/* Autoconvolute the data in c1. Result is in c1. */
+int
+fnt_autoconvolute(mpd_uint_t *c1, mpd_size_t n, int modnum)
+{
+ int (*fnt)(mpd_uint_t *, mpd_size_t, int);
+ int (*inv_fnt)(mpd_uint_t *, mpd_size_t, int);
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t n_inv, umod;
+ mpd_size_t i;
+
+
+ SETMODULUS(modnum);
+ n_inv = POWMOD(n, (umod-2));
+
+ if (ispower2(n)) {
+ if (n > SIX_STEP_THRESHOLD) {
+ fnt = six_step_fnt;
+ inv_fnt = inv_six_step_fnt;
+ }
+ else {
+ fnt = std_fnt;
+ inv_fnt = std_inv_fnt;
+ }
+ }
+ else {
+ fnt = four_step_fnt;
+ inv_fnt = inv_four_step_fnt;
+ }
+
+ if (!fnt(c1, n, modnum)) {
+ return 0;
+ }
+ for (i = 0; i < n-1; i += 2) {
+ mpd_uint_t x0 = c1[i];
+ mpd_uint_t x1 = c1[i+1];
+ MULMOD2(&x0, x0, &x1, x1);
+ c1[i] = x0;
+ c1[i+1] = x1;
+ }
+
+ if (!inv_fnt(c1, n, modnum)) {
+ return 0;
+ }
+ for (i = 0; i < n-3; i += 4) {
+ mpd_uint_t x0 = c1[i];
+ mpd_uint_t x1 = c1[i+1];
+ mpd_uint_t x2 = c1[i+2];
+ mpd_uint_t x3 = c1[i+3];
+ MULMOD2C(&x0, &x1, n_inv);
+ MULMOD2C(&x2, &x3, n_inv);
+ c1[i] = x0;
+ c1[i+1] = x1;
+ c1[i+2] = x2;
+ c1[i+3] = x3;
+ }
+
+ return 1;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h
new file mode 100644
index 00000000000..62edb3e4573
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/convolute.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_CONVOLUTE_H_
+#define LIBMPDEC_CONVOLUTE_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+#define SIX_STEP_THRESHOLD 4096
+
+int fnt_convolute(mpd_uint_t *c1, mpd_uint_t *c2, mpd_size_t n, int modnum);
+int fnt_autoconvolute(mpd_uint_t *c1, mpd_size_t n, int modnum);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_CONVOLUTE_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/crt.c b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.c
new file mode 100644
index 00000000000..babcce41bf6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+
+#include "constants.h"
+#include "crt.h"
+#include "numbertheory.h"
+#include "typearith.h"
+#include "umodarith.h"
+
+
+/* Bignum: Chinese Remainder Theorem, extends the maximum transform length. */
+
+
+/* Multiply P1P2 by v, store result in w. */
+static inline void
+_crt_mulP1P2_3(mpd_uint_t w[3], mpd_uint_t v)
+{
+ mpd_uint_t hi1, hi2, lo;
+
+ _mpd_mul_words(&hi1, &lo, LH_P1P2, v);
+ w[0] = lo;
+
+ _mpd_mul_words(&hi2, &lo, UH_P1P2, v);
+ lo = hi1 + lo;
+ if (lo < hi1) hi2++;
+
+ w[1] = lo;
+ w[2] = hi2;
+}
+
+/* Add 3 words from v to w. The result is known to fit in w. */
+static inline void
+_crt_add3(mpd_uint_t w[3], mpd_uint_t v[3])
+{
+ mpd_uint_t carry;
+
+ w[0] = w[0] + v[0];
+ carry = (w[0] < v[0]);
+
+ w[1] = w[1] + v[1];
+ if (w[1] < v[1]) w[2]++;
+
+ w[1] = w[1] + carry;
+ if (w[1] < carry) w[2]++;
+
+ w[2] += v[2];
+}
+
+/* Divide 3 words in u by v, store result in w, return remainder. */
+static inline mpd_uint_t
+_crt_div3(mpd_uint_t *w, const mpd_uint_t *u, mpd_uint_t v)
+{
+ mpd_uint_t r1 = u[2];
+ mpd_uint_t r2;
+
+ if (r1 < v) {
+ w[2] = 0;
+ }
+ else {
+ _mpd_div_word(&w[2], &r1, u[2], v); /* GCOV_NOT_REACHED */
+ }
+
+ _mpd_div_words(&w[1], &r2, r1, u[1], v);
+ _mpd_div_words(&w[0], &r1, r2, u[0], v);
+
+ return r1;
+}
+
+
+/*
+ * Chinese Remainder Theorem:
+ * Algorithm from Joerg Arndt, "Matters Computational",
+ * Chapter 37.4.1 [http://www.jjj.de/fxt/]
+ *
+ * See also Knuth, TAOCP, Volume 2, 4.3.2, exercise 7.
+ */
+
+/*
+ * CRT with carry: x1, x2, x3 contain numbers modulo p1, p2, p3. For each
+ * triple of members of the arrays, find the unique z modulo p1*p2*p3, with
+ * zmax = p1*p2*p3 - 1.
+ *
+ * In each iteration of the loop, split z into result[i] = z % MPD_RADIX
+ * and carry = z / MPD_RADIX. Let N be the size of carry[] and cmax the
+ * maximum carry.
+ *
+ * Limits for the 32-bit build:
+ *
+ * N = 2**96
+ * cmax = 7711435591312380274
+ *
+ * Limits for the 64 bit build:
+ *
+ * N = 2**192
+ * cmax = 627710135393475385904124401220046371710
+ *
+ * The following statements hold for both versions:
+ *
+ * 1) cmax + zmax < N, so the addition does not overflow.
+ *
+ * 2) (cmax + zmax) / MPD_RADIX == cmax.
+ *
+ * 3) If c <= cmax, then c_next = (c + zmax) / MPD_RADIX <= cmax.
+ */
+void
+crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t rsize)
+{
+ mpd_uint_t p1 = mpd_moduli[P1];
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t a1, a2, a3;
+ mpd_uint_t s;
+ mpd_uint_t z[3], t[3];
+ mpd_uint_t carry[3] = {0,0,0};
+ mpd_uint_t hi, lo;
+ mpd_size_t i;
+
+ for (i = 0; i < rsize; i++) {
+
+ a1 = x1[i];
+ a2 = x2[i];
+ a3 = x3[i];
+
+ SETMODULUS(P2);
+ s = ext_submod(a2, a1, umod);
+ s = MULMOD(s, INV_P1_MOD_P2);
+
+ _mpd_mul_words(&hi, &lo, s, p1);
+ lo = lo + a1;
+ if (lo < a1) hi++;
+
+ SETMODULUS(P3);
+ s = dw_submod(a3, hi, lo, umod);
+ s = MULMOD(s, INV_P1P2_MOD_P3);
+
+ z[0] = lo;
+ z[1] = hi;
+ z[2] = 0;
+
+ _crt_mulP1P2_3(t, s);
+ _crt_add3(z, t);
+ _crt_add3(carry, z);
+
+ x1[i] = _crt_div3(carry, carry, MPD_RADIX);
+ }
+
+ assert(carry[0] == 0 && carry[1] == 0 && carry[2] == 0);
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/crt.h b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.h
new file mode 100644
index 00000000000..ed66753c251
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/crt.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_CRT_H_
+#define LIBMPDEC_CRT_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t rsize);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_CRT_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c
new file mode 100644
index 00000000000..049ecff65b6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+
+#include "bits.h"
+#include "constants.h"
+#include "difradix2.h"
+#include "numbertheory.h"
+#include "umodarith.h"
+
+
+/* Bignum: The actual transform routine (decimation in frequency). */
+
+
+/*
+ * Generate index pairs (x, bitreverse(x)) and carry out the permutation.
+ * n must be a power of two.
+ * Algorithm due to Brent/Lehmann, see Joerg Arndt, "Matters Computational",
+ * Chapter 1.14.4. [http://www.jjj.de/fxt/]
+ */
+static inline void
+bitreverse_permute(mpd_uint_t a[], mpd_size_t n)
+{
+ mpd_size_t x = 0;
+ mpd_size_t r = 0;
+ mpd_uint_t t;
+
+ do { /* Invariant: r = bitreverse(x) */
+ if (r > x) {
+ t = a[x];
+ a[x] = a[r];
+ a[r] = t;
+ }
+ /* Flip trailing consecutive 1 bits and the first zero bit
+ * that absorbs a possible carry. */
+ x += 1;
+ /* Mirror the operation on r: Flip n_trailing_zeros(x)+1
+ high bits of r. */
+ r ^= (n - (n >> (mpd_bsf(x)+1)));
+ /* The loop invariant is preserved. */
+ } while (x < n);
+}
+
+
+/* Fast Number Theoretic Transform, decimation in frequency. */
+void
+fnt_dif2(mpd_uint_t a[], mpd_size_t n, struct fnt_params *tparams)
+{
+ mpd_uint_t *wtable = tparams->wtable;
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t u0, u1, v0, v1;
+ mpd_uint_t w, w0, w1, wstep;
+ mpd_size_t m, mhalf;
+ mpd_size_t j, r;
+
+
+ assert(ispower2(n));
+ assert(n >= 4);
+
+ SETMODULUS(tparams->modnum);
+
+ /* m == n */
+ mhalf = n / 2;
+ for (j = 0; j < mhalf; j += 2) {
+
+ w0 = wtable[j];
+ w1 = wtable[j+1];
+
+ u0 = a[j];
+ v0 = a[j+mhalf];
+
+ u1 = a[j+1];
+ v1 = a[j+1+mhalf];
+
+ a[j] = addmod(u0, v0, umod);
+ v0 = submod(u0, v0, umod);
+
+ a[j+1] = addmod(u1, v1, umod);
+ v1 = submod(u1, v1, umod);
+
+ MULMOD2(&v0, w0, &v1, w1);
+
+ a[j+mhalf] = v0;
+ a[j+1+mhalf] = v1;
+
+ }
+
+ wstep = 2;
+ for (m = n/2; m >= 2; m>>=1, wstep<<=1) {
+
+ mhalf = m / 2;
+
+ /* j == 0 */
+ for (r = 0; r < n; r += 2*m) {
+
+ u0 = a[r];
+ v0 = a[r+mhalf];
+
+ u1 = a[m+r];
+ v1 = a[m+r+mhalf];
+
+ a[r] = addmod(u0, v0, umod);
+ v0 = submod(u0, v0, umod);
+
+ a[m+r] = addmod(u1, v1, umod);
+ v1 = submod(u1, v1, umod);
+
+ a[r+mhalf] = v0;
+ a[m+r+mhalf] = v1;
+ }
+
+ for (j = 1; j < mhalf; j++) {
+
+ w = wtable[j*wstep];
+
+ for (r = 0; r < n; r += 2*m) {
+
+ u0 = a[r+j];
+ v0 = a[r+j+mhalf];
+
+ u1 = a[m+r+j];
+ v1 = a[m+r+j+mhalf];
+
+ a[r+j] = addmod(u0, v0, umod);
+ v0 = submod(u0, v0, umod);
+
+ a[m+r+j] = addmod(u1, v1, umod);
+ v1 = submod(u1, v1, umod);
+
+ MULMOD2C(&v0, &v1, w);
+
+ a[r+j+mhalf] = v0;
+ a[m+r+j+mhalf] = v1;
+ }
+
+ }
+
+ }
+
+ bitreverse_permute(a, n);
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h
new file mode 100644
index 00000000000..cdcbcf9a710
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/difradix2.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_DIFRADIX2_H_
+#define LIBMPDEC_DIFRADIX2_H_
+
+
+#include "mpdecimal.h"
+#include "numbertheory.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+void fnt_dif2(mpd_uint_t a[], mpd_size_t n, struct fnt_params *tparams);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_DIFRADIX2_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c
new file mode 100644
index 00000000000..0dbe98fc71c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <stdio.h>
+
+#include "bits.h"
+#include "difradix2.h"
+#include "fnt.h"
+#include "numbertheory.h"
+
+
+/* Bignum: Fast transform for medium-sized coefficients. */
+
+
+/* forward transform, sign = -1 */
+int
+std_fnt(mpd_uint_t *a, mpd_size_t n, int modnum)
+{
+ struct fnt_params *tparams;
+
+ assert(ispower2(n));
+ assert(n >= 4);
+ assert(n <= 3*MPD_MAXTRANSFORM_2N);
+
+ if ((tparams = _mpd_init_fnt_params(n, -1, modnum)) == NULL) {
+ return 0;
+ }
+ fnt_dif2(a, n, tparams);
+
+ mpd_free(tparams);
+ return 1;
+}
+
+/* reverse transform, sign = 1 */
+int
+std_inv_fnt(mpd_uint_t *a, mpd_size_t n, int modnum)
+{
+ struct fnt_params *tparams;
+
+ assert(ispower2(n));
+ assert(n >= 4);
+ assert(n <= 3*MPD_MAXTRANSFORM_2N);
+
+ if ((tparams = _mpd_init_fnt_params(n, 1, modnum)) == NULL) {
+ return 0;
+ }
+ fnt_dif2(a, n, tparams);
+
+ mpd_free(tparams);
+ return 1;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h
new file mode 100644
index 00000000000..5222c476a3a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fnt.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_FNT_H_
+#define LIBMPDEC_FNT_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+int std_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
+int std_inv_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_FNT_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c
new file mode 100644
index 00000000000..fb173ed5a52
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.c
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+
+#include "constants.h"
+#include "fourstep.h"
+#include "numbertheory.h"
+#include "sixstep.h"
+#include "umodarith.h"
+
+
+/* Bignum: Cache efficient Matrix Fourier Transform for arrays of the
+ form 3 * 2**n (See literature/matrix-transform.txt). */
+
+
+#ifndef PPRO
+static inline void
+std_size3_ntt(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3,
+ mpd_uint_t w3table[3], mpd_uint_t umod)
+{
+ mpd_uint_t r1, r2;
+ mpd_uint_t w;
+ mpd_uint_t s, tmp;
+
+
+ /* k = 0 -> w = 1 */
+ s = *x1;
+ s = addmod(s, *x2, umod);
+ s = addmod(s, *x3, umod);
+
+ r1 = s;
+
+ /* k = 1 */
+ s = *x1;
+
+ w = w3table[1];
+ tmp = MULMOD(*x2, w);
+ s = addmod(s, tmp, umod);
+
+ w = w3table[2];
+ tmp = MULMOD(*x3, w);
+ s = addmod(s, tmp, umod);
+
+ r2 = s;
+
+ /* k = 2 */
+ s = *x1;
+
+ w = w3table[2];
+ tmp = MULMOD(*x2, w);
+ s = addmod(s, tmp, umod);
+
+ w = w3table[1];
+ tmp = MULMOD(*x3, w);
+ s = addmod(s, tmp, umod);
+
+ *x3 = s;
+ *x2 = r2;
+ *x1 = r1;
+}
+#else /* PPRO */
+static inline void
+ppro_size3_ntt(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_uint_t w3table[3],
+ mpd_uint_t umod, double *dmod, uint32_t dinvmod[3])
+{
+ mpd_uint_t r1, r2;
+ mpd_uint_t w;
+ mpd_uint_t s, tmp;
+
+
+ /* k = 0 -> w = 1 */
+ s = *x1;
+ s = addmod(s, *x2, umod);
+ s = addmod(s, *x3, umod);
+
+ r1 = s;
+
+ /* k = 1 */
+ s = *x1;
+
+ w = w3table[1];
+ tmp = ppro_mulmod(*x2, w, dmod, dinvmod);
+ s = addmod(s, tmp, umod);
+
+ w = w3table[2];
+ tmp = ppro_mulmod(*x3, w, dmod, dinvmod);
+ s = addmod(s, tmp, umod);
+
+ r2 = s;
+
+ /* k = 2 */
+ s = *x1;
+
+ w = w3table[2];
+ tmp = ppro_mulmod(*x2, w, dmod, dinvmod);
+ s = addmod(s, tmp, umod);
+
+ w = w3table[1];
+ tmp = ppro_mulmod(*x3, w, dmod, dinvmod);
+ s = addmod(s, tmp, umod);
+
+ *x3 = s;
+ *x2 = r2;
+ *x1 = r1;
+}
+#endif
+
+
+/* forward transform, sign = -1; transform length = 3 * 2**n */
+int
+four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum)
+{
+ mpd_size_t R = 3; /* number of rows */
+ mpd_size_t C = n / 3; /* number of columns */
+ mpd_uint_t w3table[3];
+ mpd_uint_t kernel, w0, w1, wstep;
+ mpd_uint_t *s, *p0, *p1, *p2;
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_size_t i, k;
+
+
+ assert(n >= 48);
+ assert(n <= 3*MPD_MAXTRANSFORM_2N);
+
+
+ /* Length R transform on the columns. */
+ SETMODULUS(modnum);
+ _mpd_init_w3table(w3table, -1, modnum);
+ for (p0=a, p1=p0+C, p2=p0+2*C; p0<a+C; p0++,p1++,p2++) {
+
+ SIZE3_NTT(p0, p1, p2, w3table);
+ }
+
+ /* Multiply each matrix element (addressed by i*C+k) by r**(i*k). */
+ kernel = _mpd_getkernel(n, -1, modnum);
+ for (i = 1; i < R; i++) {
+ w0 = 1; /* r**(i*0): initial value for k=0 */
+ w1 = POWMOD(kernel, i); /* r**(i*1): initial value for k=1 */
+ wstep = MULMOD(w1, w1); /* r**(2*i) */
+ for (k = 0; k < C-1; k += 2) {
+ mpd_uint_t x0 = a[i*C+k];
+ mpd_uint_t x1 = a[i*C+k+1];
+ MULMOD2(&x0, w0, &x1, w1);
+ MULMOD2C(&w0, &w1, wstep); /* r**(i*(k+2)) = r**(i*k) * r**(2*i) */
+ a[i*C+k] = x0;
+ a[i*C+k+1] = x1;
+ }
+ }
+
+ /* Length C transform on the rows. */
+ for (s = a; s < a+n; s += C) {
+ if (!six_step_fnt(s, C, modnum)) {
+ return 0;
+ }
+ }
+
+#if 0
+ /* An unordered transform is sufficient for convolution. */
+ /* Transpose the matrix. */
+ #include "transpose.h"
+ transpose_3xpow2(a, R, C);
+#endif
+
+ return 1;
+}
+
+/* backward transform, sign = 1; transform length = 3 * 2**n */
+int
+inv_four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum)
+{
+ mpd_size_t R = 3; /* number of rows */
+ mpd_size_t C = n / 3; /* number of columns */
+ mpd_uint_t w3table[3];
+ mpd_uint_t kernel, w0, w1, wstep;
+ mpd_uint_t *s, *p0, *p1, *p2;
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_size_t i, k;
+
+
+ assert(n >= 48);
+ assert(n <= 3*MPD_MAXTRANSFORM_2N);
+
+
+#if 0
+ /* An unordered transform is sufficient for convolution. */
+ /* Transpose the matrix, producing an R*C matrix. */
+ #include "transpose.h"
+ transpose_3xpow2(a, C, R);
+#endif
+
+ /* Length C transform on the rows. */
+ for (s = a; s < a+n; s += C) {
+ if (!inv_six_step_fnt(s, C, modnum)) {
+ return 0;
+ }
+ }
+
+ /* Multiply each matrix element (addressed by i*C+k) by r**(i*k). */
+ SETMODULUS(modnum);
+ kernel = _mpd_getkernel(n, 1, modnum);
+ for (i = 1; i < R; i++) {
+ w0 = 1;
+ w1 = POWMOD(kernel, i);
+ wstep = MULMOD(w1, w1);
+ for (k = 0; k < C; k += 2) {
+ mpd_uint_t x0 = a[i*C+k];
+ mpd_uint_t x1 = a[i*C+k+1];
+ MULMOD2(&x0, w0, &x1, w1);
+ MULMOD2C(&w0, &w1, wstep);
+ a[i*C+k] = x0;
+ a[i*C+k+1] = x1;
+ }
+ }
+
+ /* Length R transform on the columns. */
+ _mpd_init_w3table(w3table, 1, modnum);
+ for (p0=a, p1=p0+C, p2=p0+2*C; p0<a+C; p0++,p1++,p2++) {
+
+ SIZE3_NTT(p0, p1, p2, w3table);
+ }
+
+ return 1;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h
new file mode 100644
index 00000000000..5ffb6fcc8ec
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/fourstep.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_FOURSTEP_H_
+#define LIBMPDEC_FOURSTEP_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+int four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+int inv_four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_FOURSTEP_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/io.c b/contrib/tools/python3/Modules/_decimal/libmpdec/io.c
new file mode 100644
index 00000000000..ecebe82e1f5
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/io.c
@@ -0,0 +1,1598 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "mpd_io.h"
+#include "typearith.h"
+
+
+/* This file contains functions for decimal <-> string conversions, including
+ PEP-3101 formatting for numeric types. */
+
+
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7
+ #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+ #pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
+
+
+/*
+ * Work around the behavior of tolower() and strcasecmp() in certain
+ * locales. For example, in tr_TR.utf8:
+ *
+ * tolower((unsigned char)'I') == 'I'
+ *
+ * u is the exact uppercase version of l; n is strlen(l) or strlen(l)+1
+ */
+static inline int
+_mpd_strneq(const char *s, const char *l, const char *u, size_t n)
+{
+ while (--n != SIZE_MAX) {
+ if (*s != *l && *s != *u) {
+ return 0;
+ }
+ s++; u++; l++;
+ }
+
+ return 1;
+}
+
+static mpd_ssize_t
+strtoexp(const char *s)
+{
+ char *end;
+ mpd_ssize_t retval;
+
+ errno = 0;
+ retval = mpd_strtossize(s, &end, 10);
+ if (errno == 0 && !(*s != '\0' && *end == '\0'))
+ errno = EINVAL;
+
+ return retval;
+}
+
+/*
+ * Scan 'len' words. The most significant word contains 'r' digits,
+ * the remaining words are full words. Skip dpoint. The string 's' must
+ * consist of digits and an optional single decimal point at 'dpoint'.
+ */
+static void
+string_to_coeff(mpd_uint_t *data, const char *s, const char *dpoint, int r,
+ size_t len)
+{
+ int j;
+
+ if (r > 0) {
+ data[--len] = 0;
+ for (j = 0; j < r; j++, s++) {
+ if (s == dpoint) s++;
+ data[len] = 10 * data[len] + (*s - '0');
+ }
+ }
+
+ while (--len != SIZE_MAX) {
+ data[len] = 0;
+ for (j = 0; j < MPD_RDIGITS; j++, s++) {
+ if (s == dpoint) s++;
+ data[len] = 10 * data[len] + (*s - '0');
+ }
+ }
+}
+
+/*
+ * Partially verify a numeric string of the form:
+ *
+ * [cdigits][.][cdigits][eE][+-][edigits]
+ *
+ * If successful, return a pointer to the location of the first
+ * relevant coefficient digit. This digit is either non-zero or
+ * part of one of the following patterns:
+ *
+ * ["0\x00", "0.\x00", "0.E", "0.e", "0E", "0e"]
+ *
+ * The locations of a single optional dot or indicator are stored
+ * in 'dpoint' and 'exp'.
+ *
+ * The end of the string is stored in 'end'. If an indicator [eE]
+ * occurs without trailing [edigits], the condition is caught
+ * later by strtoexp().
+ */
+static const char *
+scan_dpoint_exp(const char *s, const char **dpoint, const char **exp,
+ const char **end)
+{
+ const char *coeff = NULL;
+
+ *dpoint = NULL;
+ *exp = NULL;
+ for (; *s != '\0'; s++) {
+ switch (*s) {
+ case '.':
+ if (*dpoint != NULL || *exp != NULL)
+ return NULL;
+ *dpoint = s;
+ break;
+ case 'E': case 'e':
+ if (*exp != NULL)
+ return NULL;
+ *exp = s;
+ if (*(s+1) == '+' || *(s+1) == '-')
+ s++;
+ break;
+ default:
+ if (!isdigit((unsigned char)*s))
+ return NULL;
+ if (coeff == NULL && *exp == NULL) {
+ if (*s == '0') {
+ if (!isdigit((unsigned char)*(s+1)))
+ if (!(*(s+1) == '.' &&
+ isdigit((unsigned char)*(s+2))))
+ coeff = s;
+ }
+ else {
+ coeff = s;
+ }
+ }
+ break;
+
+ }
+ }
+
+ *end = s;
+ return coeff;
+}
+
+/* scan the payload of a NaN */
+static const char *
+scan_payload(const char *s, const char **end)
+{
+ const char *coeff;
+
+ while (*s == '0')
+ s++;
+ coeff = s;
+
+ while (isdigit((unsigned char)*s))
+ s++;
+ *end = s;
+
+ return (*s == '\0') ? coeff : NULL;
+}
+
+/* convert a character string to a decimal */
+void
+mpd_qset_string(mpd_t *dec, const char *s, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_ssize_t q, r, len;
+ const char *coeff, *end;
+ const char *dpoint = NULL, *exp = NULL;
+ size_t digits;
+ uint8_t sign = MPD_POS;
+
+ mpd_set_flags(dec, 0);
+ dec->len = 0;
+ dec->exp = 0;
+
+ /* sign */
+ if (*s == '+') {
+ s++;
+ }
+ else if (*s == '-') {
+ mpd_set_negative(dec);
+ sign = MPD_NEG;
+ s++;
+ }
+
+ if (_mpd_strneq(s, "nan", "NAN", 3)) { /* NaN */
+ s += 3;
+ mpd_setspecial(dec, sign, MPD_NAN);
+ if (*s == '\0')
+ return;
+ /* validate payload: digits only */
+ if ((coeff = scan_payload(s, &end)) == NULL)
+ goto conversion_error;
+ /* payload consists entirely of zeros */
+ if (*coeff == '\0')
+ return;
+ digits = end - coeff;
+ /* prec >= 1, clamp is 0 or 1 */
+ if (digits > (size_t)(ctx->prec-ctx->clamp))
+ goto conversion_error;
+ } /* sNaN */
+ else if (_mpd_strneq(s, "snan", "SNAN", 4)) {
+ s += 4;
+ mpd_setspecial(dec, sign, MPD_SNAN);
+ if (*s == '\0')
+ return;
+ /* validate payload: digits only */
+ if ((coeff = scan_payload(s, &end)) == NULL)
+ goto conversion_error;
+ /* payload consists entirely of zeros */
+ if (*coeff == '\0')
+ return;
+ digits = end - coeff;
+ if (digits > (size_t)(ctx->prec-ctx->clamp))
+ goto conversion_error;
+ }
+ else if (_mpd_strneq(s, "inf", "INF", 3)) {
+ s += 3;
+ if (*s == '\0' || _mpd_strneq(s, "inity", "INITY", 6)) {
+ /* numeric-value: infinity */
+ mpd_setspecial(dec, sign, MPD_INF);
+ return;
+ }
+ goto conversion_error;
+ }
+ else {
+ /* scan for start of coefficient, decimal point, indicator, end */
+ if ((coeff = scan_dpoint_exp(s, &dpoint, &exp, &end)) == NULL)
+ goto conversion_error;
+
+ /* numeric-value: [exponent-part] */
+ if (exp) {
+ /* exponent-part */
+ end = exp; exp++;
+ dec->exp = strtoexp(exp);
+ if (errno) {
+ if (!(errno == ERANGE &&
+ (dec->exp == MPD_SSIZE_MAX ||
+ dec->exp == MPD_SSIZE_MIN)))
+ goto conversion_error;
+ }
+ }
+
+ digits = end - coeff;
+ if (dpoint) {
+ size_t fracdigits = end-dpoint-1;
+ if (dpoint > coeff) digits--;
+
+ if (fracdigits > MPD_MAX_PREC) {
+ goto conversion_error;
+ }
+ if (dec->exp < MPD_SSIZE_MIN+(mpd_ssize_t)fracdigits) {
+ dec->exp = MPD_SSIZE_MIN;
+ }
+ else {
+ dec->exp -= (mpd_ssize_t)fracdigits;
+ }
+ }
+ if (digits > MPD_MAX_PREC) {
+ goto conversion_error;
+ }
+ if (dec->exp > MPD_EXP_INF) {
+ dec->exp = MPD_EXP_INF;
+ }
+ if (dec->exp == MPD_SSIZE_MIN) {
+ dec->exp = MPD_SSIZE_MIN+1;
+ }
+ }
+
+ _mpd_idiv_word(&q, &r, (mpd_ssize_t)digits, MPD_RDIGITS);
+
+ len = (r == 0) ? q : q+1;
+ if (len == 0) {
+ goto conversion_error; /* GCOV_NOT_REACHED */
+ }
+ if (!mpd_qresize(dec, len, status)) {
+ mpd_seterror(dec, MPD_Malloc_error, status);
+ return;
+ }
+ dec->len = len;
+
+ string_to_coeff(dec->data, coeff, dpoint, (int)r, len);
+
+ mpd_setdigits(dec);
+ mpd_qfinalize(dec, ctx, status);
+ return;
+
+conversion_error:
+ /* standard wants a positive NaN */
+ mpd_seterror(dec, MPD_Conversion_syntax, status);
+}
+
+/* convert a character string to a decimal, use a maxcontext for conversion */
+void
+mpd_qset_string_exact(mpd_t *dec, const char *s, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_string(dec, s, &maxcontext, status);
+
+ if (*status & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ /* we want exact results */
+ mpd_seterror(dec, MPD_Invalid_operation, status);
+ }
+ *status &= MPD_Errors;
+}
+
+/* Print word x with n decimal digits to string s. dot is either NULL
+ or the location of a decimal point. */
+#define EXTRACT_DIGIT(s, x, d, dot) \
+ if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
+static inline char *
+word_to_string(char *s, mpd_uint_t x, int n, char *dot)
+{
+ switch(n) {
+#ifdef CONFIG_64
+ case 20: EXTRACT_DIGIT(s, x, 10000000000000000000ULL, dot); /* GCOV_NOT_REACHED */
+ case 19: EXTRACT_DIGIT(s, x, 1000000000000000000ULL, dot);
+ case 18: EXTRACT_DIGIT(s, x, 100000000000000000ULL, dot);
+ case 17: EXTRACT_DIGIT(s, x, 10000000000000000ULL, dot);
+ case 16: EXTRACT_DIGIT(s, x, 1000000000000000ULL, dot);
+ case 15: EXTRACT_DIGIT(s, x, 100000000000000ULL, dot);
+ case 14: EXTRACT_DIGIT(s, x, 10000000000000ULL, dot);
+ case 13: EXTRACT_DIGIT(s, x, 1000000000000ULL, dot);
+ case 12: EXTRACT_DIGIT(s, x, 100000000000ULL, dot);
+ case 11: EXTRACT_DIGIT(s, x, 10000000000ULL, dot);
+#endif
+ case 10: EXTRACT_DIGIT(s, x, 1000000000UL, dot);
+ case 9: EXTRACT_DIGIT(s, x, 100000000UL, dot);
+ case 8: EXTRACT_DIGIT(s, x, 10000000UL, dot);
+ case 7: EXTRACT_DIGIT(s, x, 1000000UL, dot);
+ case 6: EXTRACT_DIGIT(s, x, 100000UL, dot);
+ case 5: EXTRACT_DIGIT(s, x, 10000UL, dot);
+ case 4: EXTRACT_DIGIT(s, x, 1000UL, dot);
+ case 3: EXTRACT_DIGIT(s, x, 100UL, dot);
+ case 2: EXTRACT_DIGIT(s, x, 10UL, dot);
+ default: if (s == dot) *s++ = '.'; *s++ = '0' + (char)x;
+ }
+
+ *s = '\0';
+ return s;
+}
+
+/* Print exponent x to string s. Undefined for MPD_SSIZE_MIN. */
+static inline char *
+exp_to_string(char *s, mpd_ssize_t x)
+{
+ char sign = '+';
+
+ if (x < 0) {
+ sign = '-';
+ x = -x;
+ }
+ *s++ = sign;
+
+ return word_to_string(s, x, mpd_word_digits(x), NULL);
+}
+
+/* Print the coefficient of dec to string s. len(dec) > 0. */
+static inline char *
+coeff_to_string(char *s, const mpd_t *dec)
+{
+ mpd_uint_t x;
+ mpd_ssize_t i;
+
+ /* most significant word */
+ x = mpd_msword(dec);
+ s = word_to_string(s, x, mpd_word_digits(x), NULL);
+
+ /* remaining full words */
+ for (i=dec->len-2; i >= 0; --i) {
+ x = dec->data[i];
+ s = word_to_string(s, x, MPD_RDIGITS, NULL);
+ }
+
+ return s;
+}
+
+/* Print the coefficient of dec to string s. len(dec) > 0. dot is either
+ NULL or a pointer to the location of a decimal point. */
+static inline char *
+coeff_to_string_dot(char *s, char *dot, const mpd_t *dec)
+{
+ mpd_uint_t x;
+ mpd_ssize_t i;
+
+ /* most significant word */
+ x = mpd_msword(dec);
+ s = word_to_string(s, x, mpd_word_digits(x), dot);
+
+ /* remaining full words */
+ for (i=dec->len-2; i >= 0; --i) {
+ x = dec->data[i];
+ s = word_to_string(s, x, MPD_RDIGITS, dot);
+ }
+
+ return s;
+}
+
+/* Format type */
+#define MPD_FMT_LOWER 0x00000000
+#define MPD_FMT_UPPER 0x00000001
+#define MPD_FMT_TOSCI 0x00000002
+#define MPD_FMT_TOENG 0x00000004
+#define MPD_FMT_EXP 0x00000008
+#define MPD_FMT_FIXED 0x00000010
+#define MPD_FMT_PERCENT 0x00000020
+#define MPD_FMT_SIGN_SPACE 0x00000040
+#define MPD_FMT_SIGN_PLUS 0x00000080
+
+/* Default place of the decimal point for MPD_FMT_TOSCI, MPD_FMT_EXP */
+#define MPD_DEFAULT_DOTPLACE 1
+
+/*
+ * Set *result to the string representation of a decimal. Return the length
+ * of *result, not including the terminating '\0' character.
+ *
+ * Formatting is done according to 'flags'. A return value of -1 with *result
+ * set to NULL indicates MPD_Malloc_error.
+ *
+ * 'dplace' is the default place of the decimal point. It is always set to
+ * MPD_DEFAULT_DOTPLACE except for zeros in combination with MPD_FMT_EXP.
+ */
+static mpd_ssize_t
+_mpd_to_string(char **result, const mpd_t *dec, int flags, mpd_ssize_t dplace)
+{
+ char *decstring = NULL, *cp = NULL;
+ mpd_ssize_t ldigits;
+ mpd_ssize_t mem = 0, k;
+
+ if (mpd_isspecial(dec)) {
+
+ mem = sizeof "-Infinity%";
+ if (mpd_isnan(dec) && dec->len > 0) {
+ /* diagnostic code */
+ mem += dec->digits;
+ }
+ cp = decstring = mpd_alloc(mem, sizeof *decstring);
+ if (cp == NULL) {
+ *result = NULL;
+ return -1;
+ }
+
+ if (mpd_isnegative(dec)) {
+ *cp++ = '-';
+ }
+ else if (flags&MPD_FMT_SIGN_SPACE) {
+ *cp++ = ' ';
+ }
+ else if (flags&MPD_FMT_SIGN_PLUS) {
+ *cp++ = '+';
+ }
+
+ if (mpd_isnan(dec)) {
+ if (mpd_isqnan(dec)) {
+ strcpy(cp, "NaN");
+ cp += 3;
+ }
+ else {
+ strcpy(cp, "sNaN");
+ cp += 4;
+ }
+ if (dec->len > 0) { /* diagnostic code */
+ cp = coeff_to_string(cp, dec);
+ }
+ }
+ else if (mpd_isinfinite(dec)) {
+ strcpy(cp, "Infinity");
+ cp += 8;
+ }
+ else { /* debug */
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ }
+ else {
+ assert(dec->len > 0);
+
+ /*
+ * For easier manipulation of the decimal point's location
+ * and the exponent that is finally printed, the number is
+ * rescaled to a virtual representation with exp = 0. Here
+ * ldigits denotes the number of decimal digits to the left
+ * of the decimal point and remains constant once initialized.
+ *
+ * dplace is the location of the decimal point relative to
+ * the start of the coefficient. Note that 3) always holds
+ * when dplace is shifted.
+ *
+ * 1) ldigits := dec->digits - dec->exp
+ * 2) dplace := ldigits (initially)
+ * 3) exp := ldigits - dplace (initially exp = 0)
+ *
+ * 0.00000_.____._____000000.
+ * ^ ^ ^ ^
+ * | | | |
+ * | | | `- dplace >= digits
+ * | | `- dplace in the middle of the coefficient
+ * | ` dplace = 1 (after the first coefficient digit)
+ * `- dplace <= 0
+ */
+
+ ldigits = dec->digits + dec->exp;
+
+ if (flags&MPD_FMT_EXP) {
+ ;
+ }
+ else if (flags&MPD_FMT_FIXED || (dec->exp <= 0 && ldigits > -6)) {
+ /* MPD_FMT_FIXED: always use fixed point notation.
+ * MPD_FMT_TOSCI, MPD_FMT_TOENG: for a certain range,
+ * override exponent notation. */
+ dplace = ldigits;
+ }
+ else if (flags&MPD_FMT_TOENG) {
+ if (mpd_iszero(dec)) {
+ /* If the exponent is divisible by three,
+ * dplace = 1. Otherwise, move dplace one
+ * or two places to the left. */
+ dplace = -1 + mod_mpd_ssize_t(dec->exp+2, 3);
+ }
+ else { /* ldigits-1 is the adjusted exponent, which
+ * should be divisible by three. If not, move
+ * dplace one or two places to the right. */
+ dplace += mod_mpd_ssize_t(ldigits-1, 3);
+ }
+ }
+
+ /*
+ * Basic space requirements:
+ *
+ * [-][.][coeffdigits][E][-][expdigits+1][%]['\0']
+ *
+ * If the decimal point lies outside of the coefficient digits,
+ * space is adjusted accordingly.
+ */
+ if (dplace <= 0) {
+ mem = -dplace + dec->digits + 2;
+ }
+ else if (dplace >= dec->digits) {
+ mem = dplace;
+ }
+ else {
+ mem = dec->digits;
+ }
+ mem += (MPD_EXPDIGITS+1+6);
+
+ cp = decstring = mpd_alloc(mem, sizeof *decstring);
+ if (cp == NULL) {
+ *result = NULL;
+ return -1;
+ }
+
+
+ if (mpd_isnegative(dec)) {
+ *cp++ = '-';
+ }
+ else if (flags&MPD_FMT_SIGN_SPACE) {
+ *cp++ = ' ';
+ }
+ else if (flags&MPD_FMT_SIGN_PLUS) {
+ *cp++ = '+';
+ }
+
+ if (dplace <= 0) {
+ /* space: -dplace+dec->digits+2 */
+ *cp++ = '0';
+ *cp++ = '.';
+ for (k = 0; k < -dplace; k++) {
+ *cp++ = '0';
+ }
+ cp = coeff_to_string(cp, dec);
+ }
+ else if (dplace >= dec->digits) {
+ /* space: dplace */
+ cp = coeff_to_string(cp, dec);
+ for (k = 0; k < dplace-dec->digits; k++) {
+ *cp++ = '0';
+ }
+ }
+ else {
+ /* space: dec->digits+1 */
+ cp = coeff_to_string_dot(cp, cp+dplace, dec);
+ }
+
+ /*
+ * Conditions for printing an exponent:
+ *
+ * MPD_FMT_TOSCI, MPD_FMT_TOENG: only if ldigits != dplace
+ * MPD_FMT_FIXED: never (ldigits == dplace)
+ * MPD_FMT_EXP: always
+ */
+ if (ldigits != dplace || flags&MPD_FMT_EXP) {
+ /* space: expdigits+2 */
+ *cp++ = (flags&MPD_FMT_UPPER) ? 'E' : 'e';
+ cp = exp_to_string(cp, ldigits-dplace);
+ }
+ }
+
+ if (flags&MPD_FMT_PERCENT) {
+ *cp++ = '%';
+ }
+
+ assert(cp < decstring+mem);
+ assert(cp-decstring < MPD_SSIZE_MAX);
+
+ *cp = '\0';
+ *result = decstring;
+ return (mpd_ssize_t)(cp-decstring);
+}
+
+char *
+mpd_to_sci(const mpd_t *dec, int fmt)
+{
+ char *res;
+ int flags = MPD_FMT_TOSCI;
+
+ flags |= fmt ? MPD_FMT_UPPER : MPD_FMT_LOWER;
+ (void)_mpd_to_string(&res, dec, flags, MPD_DEFAULT_DOTPLACE);
+ return res;
+}
+
+char *
+mpd_to_eng(const mpd_t *dec, int fmt)
+{
+ char *res;
+ int flags = MPD_FMT_TOENG;
+
+ flags |= fmt ? MPD_FMT_UPPER : MPD_FMT_LOWER;
+ (void)_mpd_to_string(&res, dec, flags, MPD_DEFAULT_DOTPLACE);
+ return res;
+}
+
+mpd_ssize_t
+mpd_to_sci_size(char **res, const mpd_t *dec, int fmt)
+{
+ int flags = MPD_FMT_TOSCI;
+
+ flags |= fmt ? MPD_FMT_UPPER : MPD_FMT_LOWER;
+ return _mpd_to_string(res, dec, flags, MPD_DEFAULT_DOTPLACE);
+}
+
+mpd_ssize_t
+mpd_to_eng_size(char **res, const mpd_t *dec, int fmt)
+{
+ int flags = MPD_FMT_TOENG;
+
+ flags |= fmt ? MPD_FMT_UPPER : MPD_FMT_LOWER;
+ return _mpd_to_string(res, dec, flags, MPD_DEFAULT_DOTPLACE);
+}
+
+/* Copy a single UTF-8 char to dest. See: The Unicode Standard, version 5.2,
+ chapter 3.9: Well-formed UTF-8 byte sequences. */
+static int
+_mpd_copy_utf8(char dest[5], const char *s)
+{
+ const unsigned char *cp = (const unsigned char *)s;
+ unsigned char lb, ub;
+ int count, i;
+
+
+ if (*cp == 0) {
+ /* empty string */
+ dest[0] = '\0';
+ return 0;
+ }
+ else if (*cp <= 0x7f) {
+ /* ascii */
+ dest[0] = *cp;
+ dest[1] = '\0';
+ return 1;
+ }
+ else if (0xc2 <= *cp && *cp <= 0xdf) {
+ lb = 0x80; ub = 0xbf;
+ count = 2;
+ }
+ else if (*cp == 0xe0) {
+ lb = 0xa0; ub = 0xbf;
+ count = 3;
+ }
+ else if (*cp <= 0xec) {
+ lb = 0x80; ub = 0xbf;
+ count = 3;
+ }
+ else if (*cp == 0xed) {
+ lb = 0x80; ub = 0x9f;
+ count = 3;
+ }
+ else if (*cp <= 0xef) {
+ lb = 0x80; ub = 0xbf;
+ count = 3;
+ }
+ else if (*cp == 0xf0) {
+ lb = 0x90; ub = 0xbf;
+ count = 4;
+ }
+ else if (*cp <= 0xf3) {
+ lb = 0x80; ub = 0xbf;
+ count = 4;
+ }
+ else if (*cp == 0xf4) {
+ lb = 0x80; ub = 0x8f;
+ count = 4;
+ }
+ else {
+ /* invalid */
+ goto error;
+ }
+
+ dest[0] = *cp++;
+ if (*cp < lb || ub < *cp) {
+ goto error;
+ }
+ dest[1] = *cp++;
+ for (i = 2; i < count; i++) {
+ if (*cp < 0x80 || 0xbf < *cp) {
+ goto error;
+ }
+ dest[i] = *cp++;
+ }
+ dest[i] = '\0';
+
+ return count;
+
+error:
+ dest[0] = '\0';
+ return -1;
+}
+
+int
+mpd_validate_lconv(mpd_spec_t *spec)
+{
+ size_t n;
+#if CHAR_MAX == SCHAR_MAX
+ const char *cp = spec->grouping;
+ while (*cp != '\0') {
+ if (*cp++ < 0) {
+ return -1;
+ }
+ }
+#endif
+ n = strlen(spec->dot);
+ if (n == 0 || n > 4) {
+ return -1;
+ }
+ if (strlen(spec->sep) > 4) {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+mpd_parse_fmt_str(mpd_spec_t *spec, const char *fmt, int caps)
+{
+ char *cp = (char *)fmt;
+ int have_align = 0, n;
+
+ /* defaults */
+ spec->min_width = 0;
+ spec->prec = -1;
+ spec->type = caps ? 'G' : 'g';
+ spec->align = '>';
+ spec->sign = '-';
+ spec->dot = "";
+ spec->sep = "";
+ spec->grouping = "";
+
+
+ /* presume that the first character is a UTF-8 fill character */
+ if ((n = _mpd_copy_utf8(spec->fill, cp)) < 0) {
+ return 0;
+ }
+
+ /* alignment directive, prefixed by a fill character */
+ if (*cp && (*(cp+n) == '<' || *(cp+n) == '>' ||
+ *(cp+n) == '=' || *(cp+n) == '^')) {
+ cp += n;
+ spec->align = *cp++;
+ have_align = 1;
+ } /* alignment directive */
+ else {
+ /* default fill character */
+ spec->fill[0] = ' ';
+ spec->fill[1] = '\0';
+ if (*cp == '<' || *cp == '>' ||
+ *cp == '=' || *cp == '^') {
+ spec->align = *cp++;
+ have_align = 1;
+ }
+ }
+
+ /* sign formatting */
+ if (*cp == '+' || *cp == '-' || *cp == ' ') {
+ spec->sign = *cp++;
+ }
+
+ /* zero padding */
+ if (*cp == '0') {
+ /* zero padding implies alignment, which should not be
+ * specified twice. */
+ if (have_align) {
+ return 0;
+ }
+ spec->align = 'z';
+ spec->fill[0] = *cp++;
+ spec->fill[1] = '\0';
+ }
+
+ /* minimum width */
+ if (isdigit((unsigned char)*cp)) {
+ if (*cp == '0') {
+ return 0;
+ }
+ errno = 0;
+ spec->min_width = mpd_strtossize(cp, &cp, 10);
+ if (errno == ERANGE || errno == EINVAL) {
+ return 0;
+ }
+ }
+
+ /* thousands separator */
+ if (*cp == ',') {
+ spec->dot = ".";
+ spec->sep = ",";
+ spec->grouping = "\003\003";
+ cp++;
+ }
+
+ /* fraction digits or significant digits */
+ if (*cp == '.') {
+ cp++;
+ if (!isdigit((unsigned char)*cp)) {
+ return 0;
+ }
+ errno = 0;
+ spec->prec = mpd_strtossize(cp, &cp, 10);
+ if (errno == ERANGE || errno == EINVAL) {
+ return 0;
+ }
+ }
+
+ /* type */
+ if (*cp == 'E' || *cp == 'e' || *cp == 'F' || *cp == 'f' ||
+ *cp == 'G' || *cp == 'g' || *cp == '%') {
+ spec->type = *cp++;
+ }
+ else if (*cp == 'N' || *cp == 'n') {
+ /* locale specific conversion */
+ struct lconv *lc;
+ /* separator has already been specified */
+ if (*spec->sep) {
+ return 0;
+ }
+ spec->type = *cp++;
+ spec->type = (spec->type == 'N') ? 'G' : 'g';
+ lc = localeconv();
+ spec->dot = lc->decimal_point;
+ spec->sep = lc->thousands_sep;
+ spec->grouping = lc->grouping;
+ if (mpd_validate_lconv(spec) < 0) {
+ return 0; /* GCOV_NOT_REACHED */
+ }
+ }
+
+ /* check correctness */
+ if (*cp != '\0') {
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * The following functions assume that spec->min_width <= MPD_MAX_PREC, which
+ * is made sure in mpd_qformat_spec. Then, even with a spec that inserts a
+ * four-byte separator after each digit, nbytes in the following struct
+ * cannot overflow.
+ */
+
+/* Multibyte string */
+typedef struct {
+ mpd_ssize_t nbytes; /* length in bytes */
+ mpd_ssize_t nchars; /* length in chars */
+ mpd_ssize_t cur; /* current write index */
+ char *data;
+} mpd_mbstr_t;
+
+static inline void
+_mpd_bcopy(char *dest, const char *src, mpd_ssize_t n)
+{
+ while (--n >= 0) {
+ dest[n] = src[n];
+ }
+}
+
+static inline void
+_mbstr_copy_char(mpd_mbstr_t *dest, const char *src, mpd_ssize_t n)
+{
+ dest->nbytes += n;
+ dest->nchars += (n > 0 ? 1 : 0);
+ dest->cur -= n;
+
+ if (dest->data != NULL) {
+ _mpd_bcopy(dest->data+dest->cur, src, n);
+ }
+}
+
+static inline void
+_mbstr_copy_ascii(mpd_mbstr_t *dest, const char *src, mpd_ssize_t n)
+{
+ dest->nbytes += n;
+ dest->nchars += n;
+ dest->cur -= n;
+
+ if (dest->data != NULL) {
+ _mpd_bcopy(dest->data+dest->cur, src, n);
+ }
+}
+
+static inline void
+_mbstr_copy_pad(mpd_mbstr_t *dest, mpd_ssize_t n)
+{
+ dest->nbytes += n;
+ dest->nchars += n;
+ dest->cur -= n;
+
+ if (dest->data != NULL) {
+ char *cp = dest->data + dest->cur;
+ while (--n >= 0) {
+ cp[n] = '0';
+ }
+ }
+}
+
+/*
+ * Copy a numeric string to dest->data, adding separators in the integer
+ * part according to spec->grouping. If leading zero padding is enabled
+ * and the result is smaller than spec->min_width, continue adding zeros
+ * and separators until the minimum width is reached.
+ *
+ * The final length of dest->data is stored in dest->nbytes. The number
+ * of UTF-8 characters is stored in dest->nchars.
+ *
+ * First run (dest->data == NULL): determine the length of the result
+ * string and store it in dest->nbytes.
+ *
+ * Second run (write to dest->data): data is written in chunks and in
+ * reverse order, starting with the rest of the numeric string.
+ */
+static void
+_mpd_add_sep_dot(mpd_mbstr_t *dest,
+ const char *sign, /* location of optional sign */
+ const char *src, mpd_ssize_t n_src, /* integer part and length */
+ const char *dot, /* location of optional decimal point */
+ const char *rest, mpd_ssize_t n_rest, /* remaining part and length */
+ const mpd_spec_t *spec)
+{
+ mpd_ssize_t n_sep, n_sign, consume;
+ const char *g;
+ int pad = 0;
+
+ n_sign = sign ? 1 : 0;
+ n_sep = (mpd_ssize_t)strlen(spec->sep);
+ /* Initial write index: set to location of '\0' in the output string.
+ * Irrelevant for the first run. */
+ dest->cur = dest->nbytes;
+ dest->nbytes = dest->nchars = 0;
+
+ _mbstr_copy_ascii(dest, rest, n_rest);
+
+ if (dot) {
+ _mbstr_copy_char(dest, dot, (mpd_ssize_t)strlen(dot));
+ }
+
+ g = spec->grouping;
+ consume = *g;
+ while (1) {
+ /* If the group length is 0 or CHAR_MAX or greater than the
+ * number of source bytes, consume all remaining bytes. */
+ if (*g == 0 || *g == CHAR_MAX || consume > n_src) {
+ consume = n_src;
+ }
+ n_src -= consume;
+ if (pad) {
+ _mbstr_copy_pad(dest, consume);
+ }
+ else {
+ _mbstr_copy_ascii(dest, src+n_src, consume);
+ }
+
+ if (n_src == 0) {
+ /* Either the real source of intpart digits or the virtual
+ * source of padding zeros is exhausted. */
+ if (spec->align == 'z' &&
+ dest->nchars + n_sign < spec->min_width) {
+ /* Zero padding is set and length < min_width:
+ * Generate n_src additional characters. */
+ n_src = spec->min_width - (dest->nchars + n_sign);
+ /* Next iteration:
+ * case *g == 0 || *g == CHAR_MAX:
+ * consume all padding characters
+ * case consume < g*:
+ * fill remainder of current group
+ * case consume == g*
+ * copying is a no-op */
+ consume = *g - consume;
+ /* Switch on virtual source of zeros. */
+ pad = 1;
+ continue;
+ }
+ break;
+ }
+
+ if (n_sep > 0) {
+ /* If padding is switched on, separators are counted
+ * as padding characters. This rule does not apply if
+ * the separator would be the first character of the
+ * result string. */
+ if (pad && n_src > 1) n_src -= 1;
+ _mbstr_copy_char(dest, spec->sep, n_sep);
+ }
+
+ /* If non-NUL, use the next value for grouping. */
+ if (*g && *(g+1)) g++;
+ consume = *g;
+ }
+
+ if (sign) {
+ _mbstr_copy_ascii(dest, sign, 1);
+ }
+
+ if (dest->data) {
+ dest->data[dest->nbytes] = '\0';
+ }
+}
+
+/*
+ * Convert a numeric-string to its locale-specific appearance.
+ * The string must have one of these forms:
+ *
+ * 1) [sign] digits [exponent-part]
+ * 2) [sign] digits '.' [digits] [exponent-part]
+ *
+ * Not allowed, since _mpd_to_string() never returns this form:
+ *
+ * 3) [sign] '.' digits [exponent-part]
+ *
+ * Input: result->data := original numeric string (ASCII)
+ * result->bytes := strlen(result->data)
+ * result->nchars := strlen(result->data)
+ *
+ * Output: result->data := modified or original string
+ * result->bytes := strlen(result->data)
+ * result->nchars := number of characters (possibly UTF-8)
+ */
+static int
+_mpd_apply_lconv(mpd_mbstr_t *result, const mpd_spec_t *spec, uint32_t *status)
+{
+ const char *sign = NULL, *intpart = NULL, *dot = NULL;
+ const char *rest, *dp;
+ char *decstring;
+ mpd_ssize_t n_int, n_rest;
+
+ /* original numeric string */
+ dp = result->data;
+
+ /* sign */
+ if (*dp == '+' || *dp == '-' || *dp == ' ') {
+ sign = dp++;
+ }
+ /* integer part */
+ assert(isdigit((unsigned char)*dp));
+ intpart = dp++;
+ while (isdigit((unsigned char)*dp)) {
+ dp++;
+ }
+ n_int = (mpd_ssize_t)(dp-intpart);
+ /* decimal point */
+ if (*dp == '.') {
+ dp++; dot = spec->dot;
+ }
+ /* rest */
+ rest = dp;
+ n_rest = result->nbytes - (mpd_ssize_t)(dp-result->data);
+
+ if (dot == NULL && (*spec->sep == '\0' || *spec->grouping == '\0')) {
+ /* _mpd_add_sep_dot() would not change anything */
+ return 1;
+ }
+
+ /* Determine the size of the new decimal string after inserting the
+ * decimal point, optional separators and optional padding. */
+ decstring = result->data;
+ result->data = NULL;
+ _mpd_add_sep_dot(result, sign, intpart, n_int, dot,
+ rest, n_rest, spec);
+
+ result->data = mpd_alloc(result->nbytes+1, 1);
+ if (result->data == NULL) {
+ *status |= MPD_Malloc_error;
+ mpd_free(decstring);
+ return 0;
+ }
+
+ /* Perform actual writes. */
+ _mpd_add_sep_dot(result, sign, intpart, n_int, dot,
+ rest, n_rest, spec);
+
+ mpd_free(decstring);
+ return 1;
+}
+
+/* Add padding to the formatted string if necessary. */
+static int
+_mpd_add_pad(mpd_mbstr_t *result, const mpd_spec_t *spec, uint32_t *status)
+{
+ if (result->nchars < spec->min_width) {
+ mpd_ssize_t add_chars, add_bytes;
+ size_t lpad = 0, rpad = 0;
+ size_t n_fill, len, i, j;
+ char align = spec->align;
+ uint8_t err = 0;
+ char *cp;
+
+ n_fill = strlen(spec->fill);
+ add_chars = (spec->min_width - result->nchars);
+ /* max value: MPD_MAX_PREC * 4 */
+ add_bytes = add_chars * (mpd_ssize_t)n_fill;
+
+ cp = result->data = mpd_realloc(result->data,
+ result->nbytes+add_bytes+1,
+ sizeof *result->data, &err);
+ if (err) {
+ *status |= MPD_Malloc_error;
+ mpd_free(result->data);
+ return 0;
+ }
+
+ if (align == 'z') {
+ align = '=';
+ }
+
+ if (align == '<') {
+ rpad = add_chars;
+ }
+ else if (align == '>' || align == '=') {
+ lpad = add_chars;
+ }
+ else { /* align == '^' */
+ lpad = add_chars/2;
+ rpad = add_chars-lpad;
+ }
+
+ len = result->nbytes;
+ if (align == '=' && (*cp == '-' || *cp == '+' || *cp == ' ')) {
+ /* leave sign in the leading position */
+ cp++; len--;
+ }
+
+ memmove(cp+n_fill*lpad, cp, len);
+ for (i = 0; i < lpad; i++) {
+ for (j = 0; j < n_fill; j++) {
+ cp[i*n_fill+j] = spec->fill[j];
+ }
+ }
+ cp += (n_fill*lpad + len);
+ for (i = 0; i < rpad; i++) {
+ for (j = 0; j < n_fill; j++) {
+ cp[i*n_fill+j] = spec->fill[j];
+ }
+ }
+
+ result->nbytes += add_bytes;
+ result->nchars += add_chars;
+ result->data[result->nbytes] = '\0';
+ }
+
+ return 1;
+}
+
+/* Round a number to prec digits. The adjusted exponent stays the same
+ or increases by one if rounding up crosses a power of ten boundary.
+ If result->digits would exceed MPD_MAX_PREC+1, MPD_Invalid_operation
+ is set and the result is NaN. */
+static inline void
+_mpd_round(mpd_t *result, const mpd_t *a, mpd_ssize_t prec,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t exp = a->exp + a->digits - prec;
+
+ if (prec <= 0) {
+ mpd_seterror(result, MPD_Invalid_operation, status); /* GCOV_NOT_REACHED */
+ return; /* GCOV_NOT_REACHED */
+ }
+ if (mpd_isspecial(a) || mpd_iszero(a)) {
+ mpd_qcopy(result, a, status); /* GCOV_NOT_REACHED */
+ return; /* GCOV_NOT_REACHED */
+ }
+
+ mpd_qrescale_fmt(result, a, exp, ctx, status);
+ if (result->digits > prec) {
+ mpd_qrescale_fmt(result, result, exp+1, ctx, status);
+ }
+}
+
+/*
+ * Return the string representation of an mpd_t, formatted according to 'spec'.
+ * The format specification is assumed to be valid. Memory errors are indicated
+ * as usual. This function is quiet.
+ */
+char *
+mpd_qformat_spec(const mpd_t *dec, const mpd_spec_t *spec,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_uint_t dt[MPD_MINALLOC_MAX];
+ mpd_t tmp = {MPD_STATIC|MPD_STATIC_DATA,0,0,0,MPD_MINALLOC_MAX,dt};
+ mpd_ssize_t dplace = MPD_DEFAULT_DOTPLACE;
+ mpd_mbstr_t result;
+ mpd_spec_t stackspec;
+ char type = spec->type;
+ int flags = 0;
+
+
+ if (spec->min_width > MPD_MAX_PREC) {
+ *status |= MPD_Invalid_operation;
+ return NULL;
+ }
+
+ if (isupper((unsigned char)type)) {
+ type = (char)tolower((unsigned char)type);
+ flags |= MPD_FMT_UPPER;
+ }
+ if (spec->sign == ' ') {
+ flags |= MPD_FMT_SIGN_SPACE;
+ }
+ else if (spec->sign == '+') {
+ flags |= MPD_FMT_SIGN_PLUS;
+ }
+
+ if (mpd_isspecial(dec)) {
+ if (spec->align == 'z') {
+ stackspec = *spec;
+ stackspec.fill[0] = ' ';
+ stackspec.fill[1] = '\0';
+ stackspec.align = '>';
+ spec = &stackspec;
+ }
+ assert(strlen(spec->fill) == 1); /* annotation for scan-build */
+ if (type == '%') {
+ flags |= MPD_FMT_PERCENT;
+ }
+ }
+ else {
+ uint32_t workstatus = 0;
+ mpd_ssize_t prec;
+
+ switch (type) {
+ case 'g': flags |= MPD_FMT_TOSCI; break;
+ case 'e': flags |= MPD_FMT_EXP; break;
+ case '%': flags |= MPD_FMT_PERCENT;
+ if (!mpd_qcopy(&tmp, dec, status)) {
+ return NULL;
+ }
+ tmp.exp += 2;
+ dec = &tmp;
+ type = 'f'; /* fall through */
+ case 'f': flags |= MPD_FMT_FIXED; break;
+ default: abort(); /* debug: GCOV_NOT_REACHED */
+ }
+
+ if (spec->prec >= 0) {
+ if (spec->prec > MPD_MAX_PREC) {
+ *status |= MPD_Invalid_operation;
+ goto error;
+ }
+
+ switch (type) {
+ case 'g':
+ prec = (spec->prec == 0) ? 1 : spec->prec;
+ if (dec->digits > prec) {
+ _mpd_round(&tmp, dec, prec, ctx,
+ &workstatus);
+ dec = &tmp;
+ }
+ break;
+ case 'e':
+ if (mpd_iszero(dec)) {
+ dplace = 1-spec->prec;
+ }
+ else {
+ _mpd_round(&tmp, dec, spec->prec+1, ctx,
+ &workstatus);
+ dec = &tmp;
+ }
+ break;
+ case 'f':
+ mpd_qrescale(&tmp, dec, -spec->prec, ctx,
+ &workstatus);
+ dec = &tmp;
+ break;
+ }
+ }
+
+ if (type == 'f') {
+ if (mpd_iszero(dec) && dec->exp > 0) {
+ mpd_qrescale(&tmp, dec, 0, ctx, &workstatus);
+ dec = &tmp;
+ }
+ }
+
+ if (workstatus&MPD_Errors) {
+ *status |= (workstatus&MPD_Errors);
+ goto error;
+ }
+ }
+
+ /*
+ * At this point, for all scaled or non-scaled decimals:
+ * 1) 1 <= digits <= MAX_PREC+1
+ * 2) adjexp(scaled) = adjexp(orig) [+1]
+ * 3) case 'g': MIN_ETINY <= exp <= MAX_EMAX+1
+ * case 'e': MIN_ETINY-MAX_PREC <= exp <= MAX_EMAX+1
+ * case 'f': MIN_ETINY <= exp <= MAX_EMAX+1
+ * 4) max memory alloc in _mpd_to_string:
+ * case 'g': MAX_PREC+36
+ * case 'e': MAX_PREC+36
+ * case 'f': 2*MPD_MAX_PREC+30
+ */
+ result.nbytes = _mpd_to_string(&result.data, dec, flags, dplace);
+ result.nchars = result.nbytes;
+ if (result.nbytes < 0) {
+ *status |= MPD_Malloc_error;
+ goto error;
+ }
+
+ if (*spec->dot != '\0' && !mpd_isspecial(dec)) {
+ if (result.nchars > MPD_MAX_PREC+36) {
+ /* Since a group length of one is not explicitly
+ * disallowed, ensure that it is always possible to
+ * insert a four byte separator after each digit. */
+ *status |= MPD_Invalid_operation;
+ mpd_free(result.data);
+ goto error;
+ }
+ if (!_mpd_apply_lconv(&result, spec, status)) {
+ goto error;
+ }
+ }
+
+ if (spec->min_width) {
+ if (!_mpd_add_pad(&result, spec, status)) {
+ goto error;
+ }
+ }
+
+ mpd_del(&tmp);
+ return result.data;
+
+error:
+ mpd_del(&tmp);
+ return NULL;
+}
+
+char *
+mpd_qformat(const mpd_t *dec, const char *fmt, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_spec_t spec;
+
+ if (!mpd_parse_fmt_str(&spec, fmt, 1)) {
+ *status |= MPD_Invalid_operation;
+ return NULL;
+ }
+
+ return mpd_qformat_spec(dec, &spec, ctx, status);
+}
+
+/*
+ * The specification has a *condition* called Invalid_operation and an
+ * IEEE *signal* called Invalid_operation. The former corresponds to
+ * MPD_Invalid_operation, the latter to MPD_IEEE_Invalid_operation.
+ * MPD_IEEE_Invalid_operation comprises the following conditions:
+ *
+ * [MPD_Conversion_syntax, MPD_Division_impossible, MPD_Division_undefined,
+ * MPD_Fpu_error, MPD_Invalid_context, MPD_Invalid_operation,
+ * MPD_Malloc_error]
+ *
+ * In the following functions, 'flag' denotes the condition, 'signal'
+ * denotes the IEEE signal.
+ */
+
+static const char *mpd_flag_string[MPD_NUM_FLAGS] = {
+ "Clamped",
+ "Conversion_syntax",
+ "Division_by_zero",
+ "Division_impossible",
+ "Division_undefined",
+ "Fpu_error",
+ "Inexact",
+ "Invalid_context",
+ "Invalid_operation",
+ "Malloc_error",
+ "Not_implemented",
+ "Overflow",
+ "Rounded",
+ "Subnormal",
+ "Underflow",
+};
+
+static const char *mpd_signal_string[MPD_NUM_FLAGS] = {
+ "Clamped",
+ "IEEE_Invalid_operation",
+ "Division_by_zero",
+ "IEEE_Invalid_operation",
+ "IEEE_Invalid_operation",
+ "IEEE_Invalid_operation",
+ "Inexact",
+ "IEEE_Invalid_operation",
+ "IEEE_Invalid_operation",
+ "IEEE_Invalid_operation",
+ "Not_implemented",
+ "Overflow",
+ "Rounded",
+ "Subnormal",
+ "Underflow",
+};
+
+/* print conditions to buffer, separated by spaces */
+int
+mpd_snprint_flags(char *dest, int nmemb, uint32_t flags)
+{
+ char *cp;
+ int n, j;
+
+ assert(nmemb >= MPD_MAX_FLAG_STRING);
+
+ *dest = '\0'; cp = dest;
+ for (j = 0; j < MPD_NUM_FLAGS; j++) {
+ if (flags & (1U<<j)) {
+ n = snprintf(cp, nmemb, "%s ", mpd_flag_string[j]);
+ if (n < 0 || n >= nmemb) return -1;
+ cp += n; nmemb -= n;
+ }
+ }
+
+ if (cp != dest) {
+ *(--cp) = '\0';
+ }
+
+ return (int)(cp-dest);
+}
+
+/* print conditions to buffer, in list form */
+int
+mpd_lsnprint_flags(char *dest, int nmemb, uint32_t flags, const char *flag_string[])
+{
+ char *cp;
+ int n, j;
+
+ assert(nmemb >= MPD_MAX_FLAG_LIST);
+ if (flag_string == NULL) {
+ flag_string = mpd_flag_string;
+ }
+
+ *dest = '[';
+ *(dest+1) = '\0';
+ cp = dest+1;
+ --nmemb;
+
+ for (j = 0; j < MPD_NUM_FLAGS; j++) {
+ if (flags & (1U<<j)) {
+ n = snprintf(cp, nmemb, "%s, ", flag_string[j]);
+ if (n < 0 || n >= nmemb) return -1;
+ cp += n; nmemb -= n;
+ }
+ }
+
+ /* erase the last ", " */
+ if (cp != dest+1) {
+ cp -= 2;
+ }
+
+ *cp++ = ']';
+ *cp = '\0';
+
+ return (int)(cp-dest); /* strlen, without NUL terminator */
+}
+
+/* print signals to buffer, in list form */
+int
+mpd_lsnprint_signals(char *dest, int nmemb, uint32_t flags, const char *signal_string[])
+{
+ char *cp;
+ int n, j;
+ int ieee_invalid_done = 0;
+
+ assert(nmemb >= MPD_MAX_SIGNAL_LIST);
+ if (signal_string == NULL) {
+ signal_string = mpd_signal_string;
+ }
+
+ *dest = '[';
+ *(dest+1) = '\0';
+ cp = dest+1;
+ --nmemb;
+
+ for (j = 0; j < MPD_NUM_FLAGS; j++) {
+ uint32_t f = flags & (1U<<j);
+ if (f) {
+ if (f&MPD_IEEE_Invalid_operation) {
+ if (ieee_invalid_done) {
+ continue;
+ }
+ ieee_invalid_done = 1;
+ }
+ n = snprintf(cp, nmemb, "%s, ", signal_string[j]);
+ if (n < 0 || n >= nmemb) return -1;
+ cp += n; nmemb -= n;
+ }
+ }
+
+ /* erase the last ", " */
+ if (cp != dest+1) {
+ cp -= 2;
+ }
+
+ *cp++ = ']';
+ *cp = '\0';
+
+ return (int)(cp-dest); /* strlen, without NUL terminator */
+}
+
+/* The following two functions are mainly intended for debugging. */
+void
+mpd_fprint(FILE *file, const mpd_t *dec)
+{
+ char *decstring;
+
+ decstring = mpd_to_sci(dec, 1);
+ if (decstring != NULL) {
+ fprintf(file, "%s\n", decstring);
+ mpd_free(decstring);
+ }
+ else {
+ fputs("mpd_fprint: output error\n", file); /* GCOV_NOT_REACHED */
+ }
+}
+
+void
+mpd_print(const mpd_t *dec)
+{
+ char *decstring;
+
+ decstring = mpd_to_sci(dec, 1);
+ if (decstring != NULL) {
+ printf("%s\n", decstring);
+ mpd_free(decstring);
+ }
+ else {
+ fputs("mpd_fprint: output error\n", stderr); /* GCOV_NOT_REACHED */
+ }
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c
new file mode 100644
index 00000000000..5871d5c0f53
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.c
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "mpalloc.h"
+#include "typearith.h"
+
+
+#if defined(_MSC_VER)
+ #pragma warning(disable : 4232)
+#endif
+
+
+/* Guaranteed minimum allocation for a coefficient. May be changed once
+ at program start using mpd_setminalloc(). */
+mpd_ssize_t MPD_MINALLOC = MPD_MINALLOC_MIN;
+
+/* Custom allocation and free functions */
+void *(* mpd_mallocfunc)(size_t size) = malloc;
+void *(* mpd_reallocfunc)(void *ptr, size_t size) = realloc;
+void *(* mpd_callocfunc)(size_t nmemb, size_t size) = calloc;
+void (* mpd_free)(void *ptr) = free;
+
+
+/* emulate calloc if it is not available */
+void *
+mpd_callocfunc_em(size_t nmemb, size_t size)
+{
+ void *ptr;
+ size_t req;
+ mpd_size_t overflow;
+
+ req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size,
+ &overflow);
+ if (overflow) {
+ return NULL;
+ }
+
+ ptr = mpd_mallocfunc(req);
+ if (ptr == NULL) {
+ return NULL;
+ }
+ /* used on uint32_t or uint64_t */
+ memset(ptr, 0, req);
+
+ return ptr;
+}
+
+
+/* malloc with overflow checking */
+void *
+mpd_alloc(mpd_size_t nmemb, mpd_size_t size)
+{
+ mpd_size_t req, overflow;
+
+ req = mul_size_t_overflow(nmemb, size, &overflow);
+ if (overflow) {
+ return NULL;
+ }
+
+ return mpd_mallocfunc(req);
+}
+
+/* calloc with overflow checking */
+void *
+mpd_calloc(mpd_size_t nmemb, mpd_size_t size)
+{
+ mpd_size_t overflow;
+
+ (void)mul_size_t_overflow(nmemb, size, &overflow);
+ if (overflow) {
+ return NULL;
+ }
+
+ return mpd_callocfunc(nmemb, size);
+}
+
+/* realloc with overflow checking */
+void *
+mpd_realloc(void *ptr, mpd_size_t nmemb, mpd_size_t size, uint8_t *err)
+{
+ void *new;
+ mpd_size_t req, overflow;
+
+ req = mul_size_t_overflow(nmemb, size, &overflow);
+ if (overflow) {
+ *err = 1;
+ return ptr;
+ }
+
+ new = mpd_reallocfunc(ptr, req);
+ if (new == NULL) {
+ *err = 1;
+ return ptr;
+ }
+
+ return new;
+}
+
+/* struct hack malloc with overflow checking */
+void *
+mpd_sh_alloc(mpd_size_t struct_size, mpd_size_t nmemb, mpd_size_t size)
+{
+ mpd_size_t req, overflow;
+
+ req = mul_size_t_overflow(nmemb, size, &overflow);
+ if (overflow) {
+ return NULL;
+ }
+
+ req = add_size_t_overflow(req, struct_size, &overflow);
+ if (overflow) {
+ return NULL;
+ }
+
+ return mpd_mallocfunc(req);
+}
+
+
+/* Allocate a new decimal with a coefficient of length 'nwords'. In case
+ of an error the return value is NULL. */
+mpd_t *
+mpd_qnew_size(mpd_ssize_t nwords)
+{
+ mpd_t *result;
+
+ nwords = (nwords < MPD_MINALLOC) ? MPD_MINALLOC : nwords;
+
+ result = mpd_alloc(1, sizeof *result);
+ if (result == NULL) {
+ return NULL;
+ }
+
+ result->data = mpd_alloc(nwords, sizeof *result->data);
+ if (result->data == NULL) {
+ mpd_free(result);
+ return NULL;
+ }
+
+ result->flags = 0;
+ result->exp = 0;
+ result->digits = 0;
+ result->len = 0;
+ result->alloc = nwords;
+
+ return result;
+}
+
+/* Allocate a new decimal with a coefficient of length MPD_MINALLOC.
+ In case of an error the return value is NULL. */
+mpd_t *
+mpd_qnew(void)
+{
+ return mpd_qnew_size(MPD_MINALLOC);
+}
+
+/* Allocate new decimal. Caller can check for NULL or MPD_Malloc_error.
+ Raises on error. */
+mpd_t *
+mpd_new(mpd_context_t *ctx)
+{
+ mpd_t *result;
+
+ result = mpd_qnew();
+ if (result == NULL) {
+ mpd_addstatus_raise(ctx, MPD_Malloc_error);
+ }
+ return result;
+}
+
+/*
+ * Input: 'result' is a static mpd_t with a static coefficient.
+ * Assumption: 'nwords' >= result->alloc.
+ *
+ * Resize the static coefficient to a larger dynamic one and copy the
+ * existing data. If successful, the value of 'result' is unchanged.
+ * Otherwise, set 'result' to NaN and update 'status' with MPD_Malloc_error.
+ */
+int
+mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status)
+{
+ mpd_uint_t *p = result->data;
+
+ assert(nwords >= result->alloc);
+
+ result->data = mpd_alloc(nwords, sizeof *result->data);
+ if (result->data == NULL) {
+ result->data = p;
+ mpd_set_qnan(result);
+ mpd_set_positive(result);
+ result->exp = result->digits = result->len = 0;
+ *status |= MPD_Malloc_error;
+ return 0;
+ }
+
+ memcpy(result->data, p, result->alloc * (sizeof *result->data));
+ result->alloc = nwords;
+ mpd_set_dynamic_data(result);
+ return 1;
+}
+
+/*
+ * Input: 'result' is a static mpd_t with a static coefficient.
+ *
+ * Convert the coefficient to a dynamic one that is initialized to zero. If
+ * malloc fails, set 'result' to NaN and update 'status' with MPD_Malloc_error.
+ */
+int
+mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status)
+{
+ mpd_uint_t *p = result->data;
+
+ result->data = mpd_calloc(nwords, sizeof *result->data);
+ if (result->data == NULL) {
+ result->data = p;
+ mpd_set_qnan(result);
+ mpd_set_positive(result);
+ result->exp = result->digits = result->len = 0;
+ *status |= MPD_Malloc_error;
+ return 0;
+ }
+
+ result->alloc = nwords;
+ mpd_set_dynamic_data(result);
+
+ return 1;
+}
+
+/*
+ * Input: 'result' is a static or a dynamic mpd_t with a dynamic coefficient.
+ * Resize the coefficient to length 'nwords':
+ * Case nwords > result->alloc:
+ * If realloc is successful:
+ * 'result' has a larger coefficient but the same value. Return 1.
+ * Otherwise:
+ * Set 'result' to NaN, update status with MPD_Malloc_error and return 0.
+ * Case nwords < result->alloc:
+ * If realloc is successful:
+ * 'result' has a smaller coefficient. result->len is undefined. Return 1.
+ * Otherwise (unlikely):
+ * 'result' is unchanged. Reuse the now oversized coefficient. Return 1.
+ */
+int
+mpd_realloc_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status)
+{
+ uint8_t err = 0;
+
+ result->data = mpd_realloc(result->data, nwords, sizeof *result->data, &err);
+ if (!err) {
+ result->alloc = nwords;
+ }
+ else if (nwords > result->alloc) {
+ mpd_set_qnan(result);
+ mpd_set_positive(result);
+ result->exp = result->digits = result->len = 0;
+ *status |= MPD_Malloc_error;
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * Input: 'result' is a static mpd_t with a static coefficient.
+ * Assumption: 'nwords' >= result->alloc.
+ *
+ * Resize the static coefficient to a larger dynamic one and copy the
+ * existing data.
+ *
+ * On failure the value of 'result' is unchanged.
+ */
+int
+mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t nwords)
+{
+ assert(nwords >= result->alloc);
+
+ mpd_uint_t *data = mpd_alloc(nwords, sizeof *result->data);
+ if (data == NULL) {
+ return 0;
+ }
+
+ memcpy(data, result->data, result->alloc * (sizeof *result->data));
+ result->data = data;
+ result->alloc = nwords;
+ mpd_set_dynamic_data(result);
+ return 1;
+}
+
+/*
+ * Input: 'result' is a static or a dynamic mpd_t with a dynamic coefficient.
+ * Resize the coefficient to length 'nwords':
+ * Case nwords > result->alloc:
+ * If realloc is successful:
+ * 'result' has a larger coefficient but the same value. Return 1.
+ * Otherwise:
+ * 'result' has a the same coefficient. Return 0.
+ * Case nwords < result->alloc:
+ * If realloc is successful:
+ * 'result' has a smaller coefficient. result->len is undefined. Return 1.
+ * Otherwise (unlikely):
+ * 'result' is unchanged. Reuse the now oversized coefficient. Return 1.
+ */
+int
+mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t nwords)
+{
+ uint8_t err = 0;
+
+ mpd_uint_t *p = mpd_realloc(result->data, nwords, sizeof *result->data, &err);
+ if (!err) {
+ result->data = p;
+ result->alloc = nwords;
+ }
+ else if (nwords > result->alloc) {
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h
new file mode 100644
index 00000000000..22650044218
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpalloc.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_MPALLOC_H_
+#define LIBMPDEC_MPALLOC_H_
+
+
+#include "mpdecimal.h"
+
+#include <stdint.h>
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+
+int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t nwords);
+int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t nwords);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_MPALLOC_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h b/contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h
new file mode 100644
index 00000000000..79d7c05ce36
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpd_io.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_IO_H_
+#define LIBMPDEC_IO_H_
+
+
+#include "mpdecimal.h"
+
+#include <stdint.h>
+
+
+#if SIZE_MAX == MPD_SIZE_MAX
+ #define mpd_strtossize _mpd_strtossize
+#else
+#include <errno.h>
+
+static inline mpd_ssize_t
+mpd_strtossize(const char *s, char **end, int base)
+{
+ int64_t retval;
+
+ errno = 0;
+ retval = _mpd_strtossize(s, end, base);
+ if (errno == 0 && (retval > MPD_SSIZE_MAX || retval < MPD_SSIZE_MIN)) {
+ errno = ERANGE;
+ }
+ if (errno == ERANGE) {
+ return (retval < 0) ? MPD_SSIZE_MIN : MPD_SSIZE_MAX;
+ }
+
+ return (mpd_ssize_t)retval;
+}
+#endif
+
+
+#endif /* LIBMPDEC_IO_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c
new file mode 100644
index 00000000000..959934bda7a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.c
@@ -0,0 +1,9015 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "basearith.h"
+#include "bits.h"
+#include "constants.h"
+#include "convolute.h"
+#include "crt.h"
+#include "mpalloc.h"
+#include "typearith.h"
+
+#ifdef PPRO
+ #if defined(_MSC_VER)
+ #include <float.h>
+ #pragma float_control(precise, on)
+ #pragma fenv_access(on)
+ #elif !defined(__OpenBSD__) && !defined(__NetBSD__)
+ /* C99 */
+ #include <fenv.h>
+ #pragma STDC FENV_ACCESS ON
+ #endif
+#endif
+
+
+/* Disable warning that is part of -Wextra since gcc 7.0. */
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7
+ #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#endif
+
+
+#if defined(_MSC_VER)
+ #define ALWAYS_INLINE __forceinline
+#elif defined (__IBMC__) || defined(LEGACY_COMPILER)
+ #define ALWAYS_INLINE
+ #undef inline
+ #define inline
+#else
+ #ifdef TEST_COVERAGE
+ #define ALWAYS_INLINE
+ #else
+ #define ALWAYS_INLINE inline __attribute__ ((always_inline))
+ #endif
+#endif
+
+/* ClangCL claims to support 128-bit int, but doesn't */
+#if defined(__SIZEOF_INT128__) && defined(__clang__) && defined(_MSC_VER)
+#undef __SIZEOF_INT128__
+#endif
+
+
+
+#define MPD_NEWTONDIV_CUTOFF 1024L
+
+#define MPD_NEW_STATIC(name, flags, exp, digits, len) \
+ mpd_uint_t name##_data[MPD_MINALLOC_MAX]; \
+ mpd_t name = {flags|MPD_STATIC|MPD_STATIC_DATA, exp, digits, \
+ len, MPD_MINALLOC_MAX, name##_data}
+
+#define MPD_NEW_CONST(name, flags, exp, digits, len, alloc, initval) \
+ mpd_uint_t name##_data[alloc] = {initval}; \
+ mpd_t name = {flags|MPD_STATIC|MPD_CONST_DATA, exp, digits, \
+ len, alloc, name##_data}
+
+#define MPD_NEW_SHARED(name, a) \
+ mpd_t name = {(a->flags&~MPD_DATAFLAGS)|MPD_STATIC|MPD_SHARED_DATA, \
+ a->exp, a->digits, a->len, a->alloc, a->data}
+
+
+static mpd_uint_t data_one[1] = {1};
+static mpd_uint_t data_zero[1] = {0};
+static const mpd_t one = {MPD_STATIC|MPD_CONST_DATA, 0, 1, 1, 1, data_one};
+static const mpd_t minus_one = {MPD_NEG|MPD_STATIC|MPD_CONST_DATA, 0, 1, 1, 1,
+ data_one};
+static const mpd_t zero = {MPD_STATIC|MPD_CONST_DATA, 0, 1, 1, 1, data_zero};
+
+static inline void _mpd_check_exp(mpd_t *dec, const mpd_context_t *ctx,
+ uint32_t *status);
+static void _settriple(mpd_t *result, uint8_t sign, mpd_uint_t a,
+ mpd_ssize_t exp);
+static inline mpd_ssize_t _mpd_real_size(mpd_uint_t *data, mpd_ssize_t size);
+
+static int _mpd_cmp_abs(const mpd_t *a, const mpd_t *b);
+
+static void _mpd_qadd(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status);
+static inline void _mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status);
+static void _mpd_base_ndivmod(mpd_t *q, mpd_t *r, const mpd_t *a,
+ const mpd_t *b, uint32_t *status);
+static inline void _mpd_qpow_uint(mpd_t *result, const mpd_t *base,
+ mpd_uint_t exp, uint8_t resultsign,
+ const mpd_context_t *ctx, uint32_t *status);
+
+static mpd_uint_t mpd_qsshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n);
+
+
+/******************************************************************************/
+/* Version */
+/******************************************************************************/
+
+const char *
+mpd_version(void)
+{
+ return MPD_VERSION;
+}
+
+
+/******************************************************************************/
+/* Performance critical inline functions */
+/******************************************************************************/
+
+#ifdef CONFIG_64
+/* Digits in a word, primarily useful for the most significant word. */
+ALWAYS_INLINE int
+mpd_word_digits(mpd_uint_t word)
+{
+ if (word < mpd_pow10[9]) {
+ if (word < mpd_pow10[4]) {
+ if (word < mpd_pow10[2]) {
+ return (word < mpd_pow10[1]) ? 1 : 2;
+ }
+ return (word < mpd_pow10[3]) ? 3 : 4;
+ }
+ if (word < mpd_pow10[6]) {
+ return (word < mpd_pow10[5]) ? 5 : 6;
+ }
+ if (word < mpd_pow10[8]) {
+ return (word < mpd_pow10[7]) ? 7 : 8;
+ }
+ return 9;
+ }
+ if (word < mpd_pow10[14]) {
+ if (word < mpd_pow10[11]) {
+ return (word < mpd_pow10[10]) ? 10 : 11;
+ }
+ if (word < mpd_pow10[13]) {
+ return (word < mpd_pow10[12]) ? 12 : 13;
+ }
+ return 14;
+ }
+ if (word < mpd_pow10[18]) {
+ if (word < mpd_pow10[16]) {
+ return (word < mpd_pow10[15]) ? 15 : 16;
+ }
+ return (word < mpd_pow10[17]) ? 17 : 18;
+ }
+
+ return (word < mpd_pow10[19]) ? 19 : 20;
+}
+#else
+ALWAYS_INLINE int
+mpd_word_digits(mpd_uint_t word)
+{
+ if (word < mpd_pow10[4]) {
+ if (word < mpd_pow10[2]) {
+ return (word < mpd_pow10[1]) ? 1 : 2;
+ }
+ return (word < mpd_pow10[3]) ? 3 : 4;
+ }
+ if (word < mpd_pow10[6]) {
+ return (word < mpd_pow10[5]) ? 5 : 6;
+ }
+ if (word < mpd_pow10[8]) {
+ return (word < mpd_pow10[7]) ? 7 : 8;
+ }
+
+ return (word < mpd_pow10[9]) ? 9 : 10;
+}
+#endif
+
+
+/* Adjusted exponent */
+ALWAYS_INLINE mpd_ssize_t
+mpd_adjexp(const mpd_t *dec)
+{
+ return (dec->exp + dec->digits) - 1;
+}
+
+/* Etiny */
+ALWAYS_INLINE mpd_ssize_t
+mpd_etiny(const mpd_context_t *ctx)
+{
+ return ctx->emin - (ctx->prec - 1);
+}
+
+/* Etop: used for folding down in IEEE clamping */
+ALWAYS_INLINE mpd_ssize_t
+mpd_etop(const mpd_context_t *ctx)
+{
+ return ctx->emax - (ctx->prec - 1);
+}
+
+/* Most significant word */
+ALWAYS_INLINE mpd_uint_t
+mpd_msword(const mpd_t *dec)
+{
+ assert(dec->len > 0);
+ return dec->data[dec->len-1];
+}
+
+/* Most significant digit of a word */
+inline mpd_uint_t
+mpd_msd(mpd_uint_t word)
+{
+ int n;
+
+ n = mpd_word_digits(word);
+ return word / mpd_pow10[n-1];
+}
+
+/* Least significant digit of a word */
+ALWAYS_INLINE mpd_uint_t
+mpd_lsd(mpd_uint_t word)
+{
+ return word % 10;
+}
+
+/* Coefficient size needed to store 'digits' */
+mpd_ssize_t
+mpd_digits_to_size(mpd_ssize_t digits)
+{
+ mpd_ssize_t q, r;
+
+ _mpd_idiv_word(&q, &r, digits, MPD_RDIGITS);
+ return (r == 0) ? q : q+1;
+}
+
+/* Number of digits in the exponent. Not defined for MPD_SSIZE_MIN. */
+inline int
+mpd_exp_digits(mpd_ssize_t exp)
+{
+ exp = (exp < 0) ? -exp : exp;
+ return mpd_word_digits(exp);
+}
+
+/* Canonical */
+ALWAYS_INLINE int
+mpd_iscanonical(const mpd_t *dec)
+{
+ (void)dec;
+ return 1;
+}
+
+/* Finite */
+ALWAYS_INLINE int
+mpd_isfinite(const mpd_t *dec)
+{
+ return !(dec->flags & MPD_SPECIAL);
+}
+
+/* Infinite */
+ALWAYS_INLINE int
+mpd_isinfinite(const mpd_t *dec)
+{
+ return dec->flags & MPD_INF;
+}
+
+/* NaN */
+ALWAYS_INLINE int
+mpd_isnan(const mpd_t *dec)
+{
+ return dec->flags & (MPD_NAN|MPD_SNAN);
+}
+
+/* Negative */
+ALWAYS_INLINE int
+mpd_isnegative(const mpd_t *dec)
+{
+ return dec->flags & MPD_NEG;
+}
+
+/* Positive */
+ALWAYS_INLINE int
+mpd_ispositive(const mpd_t *dec)
+{
+ return !(dec->flags & MPD_NEG);
+}
+
+/* qNaN */
+ALWAYS_INLINE int
+mpd_isqnan(const mpd_t *dec)
+{
+ return dec->flags & MPD_NAN;
+}
+
+/* Signed */
+ALWAYS_INLINE int
+mpd_issigned(const mpd_t *dec)
+{
+ return dec->flags & MPD_NEG;
+}
+
+/* sNaN */
+ALWAYS_INLINE int
+mpd_issnan(const mpd_t *dec)
+{
+ return dec->flags & MPD_SNAN;
+}
+
+/* Special */
+ALWAYS_INLINE int
+mpd_isspecial(const mpd_t *dec)
+{
+ return dec->flags & MPD_SPECIAL;
+}
+
+/* Zero */
+ALWAYS_INLINE int
+mpd_iszero(const mpd_t *dec)
+{
+ return !mpd_isspecial(dec) && mpd_msword(dec) == 0;
+}
+
+/* Test for zero when specials have been ruled out already */
+ALWAYS_INLINE int
+mpd_iszerocoeff(const mpd_t *dec)
+{
+ return mpd_msword(dec) == 0;
+}
+
+/* Normal */
+inline int
+mpd_isnormal(const mpd_t *dec, const mpd_context_t *ctx)
+{
+ if (mpd_isspecial(dec)) return 0;
+ if (mpd_iszerocoeff(dec)) return 0;
+
+ return mpd_adjexp(dec) >= ctx->emin;
+}
+
+/* Subnormal */
+inline int
+mpd_issubnormal(const mpd_t *dec, const mpd_context_t *ctx)
+{
+ if (mpd_isspecial(dec)) return 0;
+ if (mpd_iszerocoeff(dec)) return 0;
+
+ return mpd_adjexp(dec) < ctx->emin;
+}
+
+/* Odd word */
+ALWAYS_INLINE int
+mpd_isoddword(mpd_uint_t word)
+{
+ return word & 1;
+}
+
+/* Odd coefficient */
+ALWAYS_INLINE int
+mpd_isoddcoeff(const mpd_t *dec)
+{
+ return mpd_isoddword(dec->data[0]);
+}
+
+/* 0 if dec is positive, 1 if dec is negative */
+ALWAYS_INLINE uint8_t
+mpd_sign(const mpd_t *dec)
+{
+ return dec->flags & MPD_NEG;
+}
+
+/* 1 if dec is positive, -1 if dec is negative */
+ALWAYS_INLINE int
+mpd_arith_sign(const mpd_t *dec)
+{
+ return 1 - 2 * mpd_isnegative(dec);
+}
+
+/* Radix */
+ALWAYS_INLINE long
+mpd_radix(void)
+{
+ return 10;
+}
+
+/* Dynamic decimal */
+ALWAYS_INLINE int
+mpd_isdynamic(const mpd_t *dec)
+{
+ return !(dec->flags & MPD_STATIC);
+}
+
+/* Static decimal */
+ALWAYS_INLINE int
+mpd_isstatic(const mpd_t *dec)
+{
+ return dec->flags & MPD_STATIC;
+}
+
+/* Data of decimal is dynamic */
+ALWAYS_INLINE int
+mpd_isdynamic_data(const mpd_t *dec)
+{
+ return !(dec->flags & MPD_DATAFLAGS);
+}
+
+/* Data of decimal is static */
+ALWAYS_INLINE int
+mpd_isstatic_data(const mpd_t *dec)
+{
+ return dec->flags & MPD_STATIC_DATA;
+}
+
+/* Data of decimal is shared */
+ALWAYS_INLINE int
+mpd_isshared_data(const mpd_t *dec)
+{
+ return dec->flags & MPD_SHARED_DATA;
+}
+
+/* Data of decimal is const */
+ALWAYS_INLINE int
+mpd_isconst_data(const mpd_t *dec)
+{
+ return dec->flags & MPD_CONST_DATA;
+}
+
+
+/******************************************************************************/
+/* Inline memory handling */
+/******************************************************************************/
+
+/* Fill destination with zeros */
+ALWAYS_INLINE void
+mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len)
+{
+ mpd_size_t i;
+
+ for (i = 0; i < len; i++) {
+ dest[i] = 0;
+ }
+}
+
+/* Free a decimal */
+ALWAYS_INLINE void
+mpd_del(mpd_t *dec)
+{
+ if (mpd_isdynamic_data(dec)) {
+ mpd_free(dec->data);
+ }
+ if (mpd_isdynamic(dec)) {
+ mpd_free(dec);
+ }
+}
+
+/*
+ * Resize the coefficient. Existing data up to 'nwords' is left untouched.
+ * Return 1 on success, 0 otherwise.
+ *
+ * Input invariant: MPD_MINALLOC <= result->alloc.
+ *
+ * Case nwords == result->alloc:
+ * 'result' is unchanged. Return 1.
+ *
+ * Case nwords > result->alloc:
+ * Case realloc success:
+ * The value of 'result' does not change. Return 1.
+ * Case realloc failure:
+ * 'result' is NaN, status is updated with MPD_Malloc_error. Return 0.
+ *
+ * Case nwords < result->alloc:
+ * Case is_static_data or realloc failure [1]:
+ * 'result' is unchanged. Return 1.
+ * Case realloc success:
+ * The value of result is undefined (expected). Return 1.
+ *
+ *
+ * [1] In that case the old (now oversized) area is still valid.
+ */
+ALWAYS_INLINE int
+mpd_qresize(mpd_t *result, mpd_ssize_t nwords, uint32_t *status)
+{
+ assert(!mpd_isconst_data(result)); /* illegal operation for a const */
+ assert(!mpd_isshared_data(result)); /* illegal operation for a shared */
+ assert(MPD_MINALLOC <= result->alloc);
+
+ nwords = (nwords <= MPD_MINALLOC) ? MPD_MINALLOC : nwords;
+ if (nwords == result->alloc) {
+ return 1;
+ }
+ if (mpd_isstatic_data(result)) {
+ if (nwords > result->alloc) {
+ return mpd_switch_to_dyn(result, nwords, status);
+ }
+ return 1;
+ }
+
+ return mpd_realloc_dyn(result, nwords, status);
+}
+
+/* Same as mpd_qresize, but do not set the result no NaN on failure. */
+static ALWAYS_INLINE int
+mpd_qresize_cxx(mpd_t *result, mpd_ssize_t nwords)
+{
+ assert(!mpd_isconst_data(result)); /* illegal operation for a const */
+ assert(!mpd_isshared_data(result)); /* illegal operation for a shared */
+ assert(MPD_MINALLOC <= result->alloc);
+
+ nwords = (nwords <= MPD_MINALLOC) ? MPD_MINALLOC : nwords;
+ if (nwords == result->alloc) {
+ return 1;
+ }
+ if (mpd_isstatic_data(result)) {
+ if (nwords > result->alloc) {
+ return mpd_switch_to_dyn_cxx(result, nwords);
+ }
+ return 1;
+ }
+
+ return mpd_realloc_dyn_cxx(result, nwords);
+}
+
+/* Same as mpd_qresize, but the complete coefficient (including the old
+ * memory area!) is initialized to zero. */
+ALWAYS_INLINE int
+mpd_qresize_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status)
+{
+ assert(!mpd_isconst_data(result)); /* illegal operation for a const */
+ assert(!mpd_isshared_data(result)); /* illegal operation for a shared */
+ assert(MPD_MINALLOC <= result->alloc);
+
+ nwords = (nwords <= MPD_MINALLOC) ? MPD_MINALLOC : nwords;
+ if (nwords != result->alloc) {
+ if (mpd_isstatic_data(result)) {
+ if (nwords > result->alloc) {
+ return mpd_switch_to_dyn_zero(result, nwords, status);
+ }
+ }
+ else if (!mpd_realloc_dyn(result, nwords, status)) {
+ return 0;
+ }
+ }
+
+ mpd_uint_zero(result->data, nwords);
+ return 1;
+}
+
+/*
+ * Reduce memory size for the coefficient to MPD_MINALLOC. In theory,
+ * realloc may fail even when reducing the memory size. But in that case
+ * the old memory area is always big enough, so checking for MPD_Malloc_error
+ * is not imperative.
+ */
+ALWAYS_INLINE void
+mpd_minalloc(mpd_t *result)
+{
+ assert(!mpd_isconst_data(result)); /* illegal operation for a const */
+ assert(!mpd_isshared_data(result)); /* illegal operation for a shared */
+
+ if (!mpd_isstatic_data(result) && result->alloc > MPD_MINALLOC) {
+ uint8_t err = 0;
+ result->data = mpd_realloc(result->data, MPD_MINALLOC,
+ sizeof *result->data, &err);
+ if (!err) {
+ result->alloc = MPD_MINALLOC;
+ }
+ }
+}
+
+int
+mpd_resize(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qresize(result, nwords, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ return 0;
+ }
+ return 1;
+}
+
+int
+mpd_resize_zero(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qresize_zero(result, nwords, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ return 0;
+ }
+ return 1;
+}
+
+
+/******************************************************************************/
+/* Set attributes of a decimal */
+/******************************************************************************/
+
+/* Set digits. Assumption: result->len is initialized and > 0. */
+inline void
+mpd_setdigits(mpd_t *result)
+{
+ mpd_ssize_t wdigits = mpd_word_digits(mpd_msword(result));
+ result->digits = wdigits + (result->len-1) * MPD_RDIGITS;
+}
+
+/* Set sign */
+ALWAYS_INLINE void
+mpd_set_sign(mpd_t *result, uint8_t sign)
+{
+ result->flags &= ~MPD_NEG;
+ result->flags |= sign;
+}
+
+/* Copy sign from another decimal */
+ALWAYS_INLINE void
+mpd_signcpy(mpd_t *result, const mpd_t *a)
+{
+ uint8_t sign = a->flags&MPD_NEG;
+
+ result->flags &= ~MPD_NEG;
+ result->flags |= sign;
+}
+
+/* Set infinity */
+ALWAYS_INLINE void
+mpd_set_infinity(mpd_t *result)
+{
+ result->flags &= ~MPD_SPECIAL;
+ result->flags |= MPD_INF;
+}
+
+/* Set qNaN */
+ALWAYS_INLINE void
+mpd_set_qnan(mpd_t *result)
+{
+ result->flags &= ~MPD_SPECIAL;
+ result->flags |= MPD_NAN;
+}
+
+/* Set sNaN */
+ALWAYS_INLINE void
+mpd_set_snan(mpd_t *result)
+{
+ result->flags &= ~MPD_SPECIAL;
+ result->flags |= MPD_SNAN;
+}
+
+/* Set to negative */
+ALWAYS_INLINE void
+mpd_set_negative(mpd_t *result)
+{
+ result->flags |= MPD_NEG;
+}
+
+/* Set to positive */
+ALWAYS_INLINE void
+mpd_set_positive(mpd_t *result)
+{
+ result->flags &= ~MPD_NEG;
+}
+
+/* Set to dynamic */
+ALWAYS_INLINE void
+mpd_set_dynamic(mpd_t *result)
+{
+ result->flags &= ~MPD_STATIC;
+}
+
+/* Set to static */
+ALWAYS_INLINE void
+mpd_set_static(mpd_t *result)
+{
+ result->flags |= MPD_STATIC;
+}
+
+/* Set data to dynamic */
+ALWAYS_INLINE void
+mpd_set_dynamic_data(mpd_t *result)
+{
+ result->flags &= ~MPD_DATAFLAGS;
+}
+
+/* Set data to static */
+ALWAYS_INLINE void
+mpd_set_static_data(mpd_t *result)
+{
+ result->flags &= ~MPD_DATAFLAGS;
+ result->flags |= MPD_STATIC_DATA;
+}
+
+/* Set data to shared */
+ALWAYS_INLINE void
+mpd_set_shared_data(mpd_t *result)
+{
+ result->flags &= ~MPD_DATAFLAGS;
+ result->flags |= MPD_SHARED_DATA;
+}
+
+/* Set data to const */
+ALWAYS_INLINE void
+mpd_set_const_data(mpd_t *result)
+{
+ result->flags &= ~MPD_DATAFLAGS;
+ result->flags |= MPD_CONST_DATA;
+}
+
+/* Clear flags, preserving memory attributes. */
+ALWAYS_INLINE void
+mpd_clear_flags(mpd_t *result)
+{
+ result->flags &= (MPD_STATIC|MPD_DATAFLAGS);
+}
+
+/* Set flags, preserving memory attributes. */
+ALWAYS_INLINE void
+mpd_set_flags(mpd_t *result, uint8_t flags)
+{
+ result->flags &= (MPD_STATIC|MPD_DATAFLAGS);
+ result->flags |= flags;
+}
+
+/* Copy flags, preserving memory attributes of result. */
+ALWAYS_INLINE void
+mpd_copy_flags(mpd_t *result, const mpd_t *a)
+{
+ uint8_t aflags = a->flags;
+ result->flags &= (MPD_STATIC|MPD_DATAFLAGS);
+ result->flags |= (aflags & ~(MPD_STATIC|MPD_DATAFLAGS));
+}
+
+/* Initialize a workcontext from ctx. Set traps, flags and newtrap to 0. */
+static inline void
+mpd_workcontext(mpd_context_t *workctx, const mpd_context_t *ctx)
+{
+ workctx->prec = ctx->prec;
+ workctx->emax = ctx->emax;
+ workctx->emin = ctx->emin;
+ workctx->round = ctx->round;
+ workctx->traps = 0;
+ workctx->status = 0;
+ workctx->newtrap = 0;
+ workctx->clamp = ctx->clamp;
+ workctx->allcr = ctx->allcr;
+}
+
+
+/******************************************************************************/
+/* Getting and setting parts of decimals */
+/******************************************************************************/
+
+/* Flip the sign of a decimal */
+static inline void
+_mpd_negate(mpd_t *dec)
+{
+ dec->flags ^= MPD_NEG;
+}
+
+/* Set coefficient to zero */
+void
+mpd_zerocoeff(mpd_t *result)
+{
+ mpd_minalloc(result);
+ result->digits = 1;
+ result->len = 1;
+ result->data[0] = 0;
+}
+
+/* Set the coefficient to all nines. */
+void
+mpd_qmaxcoeff(mpd_t *result, const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t len, r;
+
+ _mpd_idiv_word(&len, &r, ctx->prec, MPD_RDIGITS);
+ len = (r == 0) ? len : len+1;
+
+ if (!mpd_qresize(result, len, status)) {
+ return;
+ }
+
+ result->len = len;
+ result->digits = ctx->prec;
+
+ --len;
+ if (r > 0) {
+ result->data[len--] = mpd_pow10[r]-1;
+ }
+ for (; len >= 0; --len) {
+ result->data[len] = MPD_RADIX-1;
+ }
+}
+
+/*
+ * Cut off the most significant digits so that the rest fits in ctx->prec.
+ * Cannot fail.
+ */
+static void
+_mpd_cap(mpd_t *result, const mpd_context_t *ctx)
+{
+ uint32_t dummy;
+ mpd_ssize_t len, r;
+
+ if (result->len > 0 && result->digits > ctx->prec) {
+ _mpd_idiv_word(&len, &r, ctx->prec, MPD_RDIGITS);
+ len = (r == 0) ? len : len+1;
+
+ if (r != 0) {
+ result->data[len-1] %= mpd_pow10[r];
+ }
+
+ len = _mpd_real_size(result->data, len);
+ /* resize to fewer words cannot fail */
+ mpd_qresize(result, len, &dummy);
+ result->len = len;
+ mpd_setdigits(result);
+ }
+ if (mpd_iszero(result)) {
+ _settriple(result, mpd_sign(result), 0, result->exp);
+ }
+}
+
+/*
+ * Cut off the most significant digits of a NaN payload so that the rest
+ * fits in ctx->prec - ctx->clamp. Cannot fail.
+ */
+static void
+_mpd_fix_nan(mpd_t *result, const mpd_context_t *ctx)
+{
+ uint32_t dummy;
+ mpd_ssize_t prec;
+ mpd_ssize_t len, r;
+
+ prec = ctx->prec - ctx->clamp;
+ if (result->len > 0 && result->digits > prec) {
+ if (prec == 0) {
+ mpd_minalloc(result);
+ result->len = result->digits = 0;
+ }
+ else {
+ _mpd_idiv_word(&len, &r, prec, MPD_RDIGITS);
+ len = (r == 0) ? len : len+1;
+
+ if (r != 0) {
+ result->data[len-1] %= mpd_pow10[r];
+ }
+
+ len = _mpd_real_size(result->data, len);
+ /* resize to fewer words cannot fail */
+ mpd_qresize(result, len, &dummy);
+ result->len = len;
+ mpd_setdigits(result);
+ if (mpd_iszerocoeff(result)) {
+ /* NaN0 is not a valid representation */
+ result->len = result->digits = 0;
+ }
+ }
+ }
+}
+
+/*
+ * Get n most significant digits from a decimal, where 0 < n <= MPD_UINT_DIGITS.
+ * Assumes MPD_UINT_DIGITS == MPD_RDIGITS+1, which is true for 32 and 64 bit
+ * machines.
+ *
+ * The result of the operation will be in lo. If the operation is impossible,
+ * hi will be nonzero. This is used to indicate an error.
+ */
+static inline void
+_mpd_get_msdigits(mpd_uint_t *hi, mpd_uint_t *lo, const mpd_t *dec,
+ unsigned int n)
+{
+ mpd_uint_t r, tmp;
+
+ assert(0 < n && n <= MPD_RDIGITS+1);
+
+ _mpd_div_word(&tmp, &r, dec->digits, MPD_RDIGITS);
+ r = (r == 0) ? MPD_RDIGITS : r; /* digits in the most significant word */
+
+ *hi = 0;
+ *lo = dec->data[dec->len-1];
+ if (n <= r) {
+ *lo /= mpd_pow10[r-n];
+ }
+ else if (dec->len > 1) {
+ /* at this point 1 <= r < n <= MPD_RDIGITS+1 */
+ _mpd_mul_words(hi, lo, *lo, mpd_pow10[n-r]);
+ tmp = dec->data[dec->len-2] / mpd_pow10[MPD_RDIGITS-(n-r)];
+ *lo = *lo + tmp;
+ if (*lo < tmp) (*hi)++;
+ }
+}
+
+
+/******************************************************************************/
+/* Gathering information about a decimal */
+/******************************************************************************/
+
+/* The real size of the coefficient without leading zero words. */
+static inline mpd_ssize_t
+_mpd_real_size(mpd_uint_t *data, mpd_ssize_t size)
+{
+ while (size > 1 && data[size-1] == 0) {
+ size--;
+ }
+
+ return size;
+}
+
+/* Return number of trailing zeros. No errors are possible. */
+mpd_ssize_t
+mpd_trail_zeros(const mpd_t *dec)
+{
+ mpd_uint_t word;
+ mpd_ssize_t i, tz = 0;
+
+ for (i=0; i < dec->len; ++i) {
+ if (dec->data[i] != 0) {
+ word = dec->data[i];
+ tz = i * MPD_RDIGITS;
+ while (word % 10 == 0) {
+ word /= 10;
+ tz++;
+ }
+ break;
+ }
+ }
+
+ return tz;
+}
+
+/* Integer: Undefined for specials */
+static int
+_mpd_isint(const mpd_t *dec)
+{
+ mpd_ssize_t tz;
+
+ if (mpd_iszerocoeff(dec)) {
+ return 1;
+ }
+
+ tz = mpd_trail_zeros(dec);
+ return (dec->exp + tz >= 0);
+}
+
+/* Integer */
+int
+mpd_isinteger(const mpd_t *dec)
+{
+ if (mpd_isspecial(dec)) {
+ return 0;
+ }
+ return _mpd_isint(dec);
+}
+
+/* Word is a power of 10 */
+static int
+mpd_word_ispow10(mpd_uint_t word)
+{
+ int n;
+
+ n = mpd_word_digits(word);
+ if (word == mpd_pow10[n-1]) {
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Coefficient is a power of 10 */
+static int
+mpd_coeff_ispow10(const mpd_t *dec)
+{
+ if (mpd_word_ispow10(mpd_msword(dec))) {
+ if (_mpd_isallzero(dec->data, dec->len-1)) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/* All digits of a word are nines */
+static int
+mpd_word_isallnine(mpd_uint_t word)
+{
+ int n;
+
+ n = mpd_word_digits(word);
+ if (word == mpd_pow10[n]-1) {
+ return 1;
+ }
+
+ return 0;
+}
+
+/* All digits of the coefficient are nines */
+static int
+mpd_coeff_isallnine(const mpd_t *dec)
+{
+ if (mpd_word_isallnine(mpd_msword(dec))) {
+ if (_mpd_isallnine(dec->data, dec->len-1)) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/* Odd decimal: Undefined for non-integers! */
+int
+mpd_isodd(const mpd_t *dec)
+{
+ mpd_uint_t q, r;
+ assert(mpd_isinteger(dec));
+ if (mpd_iszerocoeff(dec)) return 0;
+ if (dec->exp < 0) {
+ _mpd_div_word(&q, &r, -dec->exp, MPD_RDIGITS);
+ q = dec->data[q] / mpd_pow10[r];
+ return mpd_isoddword(q);
+ }
+ return dec->exp == 0 && mpd_isoddword(dec->data[0]);
+}
+
+/* Even: Undefined for non-integers! */
+int
+mpd_iseven(const mpd_t *dec)
+{
+ return !mpd_isodd(dec);
+}
+
+/******************************************************************************/
+/* Getting and setting decimals */
+/******************************************************************************/
+
+/* Internal function: Set a static decimal from a triple, no error checking. */
+static void
+_ssettriple(mpd_t *result, uint8_t sign, mpd_uint_t a, mpd_ssize_t exp)
+{
+ mpd_set_flags(result, sign);
+ result->exp = exp;
+ _mpd_div_word(&result->data[1], &result->data[0], a, MPD_RADIX);
+ result->len = (result->data[1] == 0) ? 1 : 2;
+ mpd_setdigits(result);
+}
+
+/* Internal function: Set a decimal from a triple, no error checking. */
+static void
+_settriple(mpd_t *result, uint8_t sign, mpd_uint_t a, mpd_ssize_t exp)
+{
+ mpd_minalloc(result);
+ mpd_set_flags(result, sign);
+ result->exp = exp;
+ _mpd_div_word(&result->data[1], &result->data[0], a, MPD_RADIX);
+ result->len = (result->data[1] == 0) ? 1 : 2;
+ mpd_setdigits(result);
+}
+
+/* Set a special number from a triple */
+void
+mpd_setspecial(mpd_t *result, uint8_t sign, uint8_t type)
+{
+ mpd_minalloc(result);
+ result->flags &= ~(MPD_NEG|MPD_SPECIAL);
+ result->flags |= (sign|type);
+ result->exp = result->digits = result->len = 0;
+}
+
+/* Set result of NaN with an error status */
+void
+mpd_seterror(mpd_t *result, uint32_t flags, uint32_t *status)
+{
+ mpd_minalloc(result);
+ mpd_set_qnan(result);
+ mpd_set_positive(result);
+ result->exp = result->digits = result->len = 0;
+ *status |= flags;
+}
+
+/* quietly set a static decimal from an mpd_ssize_t */
+void
+mpd_qsset_ssize(mpd_t *result, mpd_ssize_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_uint_t u;
+ uint8_t sign = MPD_POS;
+
+ if (a < 0) {
+ if (a == MPD_SSIZE_MIN) {
+ u = (mpd_uint_t)MPD_SSIZE_MAX +
+ (-(MPD_SSIZE_MIN+MPD_SSIZE_MAX));
+ }
+ else {
+ u = -a;
+ }
+ sign = MPD_NEG;
+ }
+ else {
+ u = a;
+ }
+ _ssettriple(result, sign, u, 0);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* quietly set a static decimal from an mpd_uint_t */
+void
+mpd_qsset_uint(mpd_t *result, mpd_uint_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ _ssettriple(result, MPD_POS, a, 0);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* quietly set a static decimal from an int32_t */
+void
+mpd_qsset_i32(mpd_t *result, int32_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_qsset_ssize(result, a, ctx, status);
+}
+
+/* quietly set a static decimal from a uint32_t */
+void
+mpd_qsset_u32(mpd_t *result, uint32_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_qsset_uint(result, a, ctx, status);
+}
+
+#ifdef CONFIG_64
+/* quietly set a static decimal from an int64_t */
+void
+mpd_qsset_i64(mpd_t *result, int64_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_qsset_ssize(result, a, ctx, status);
+}
+
+/* quietly set a static decimal from a uint64_t */
+void
+mpd_qsset_u64(mpd_t *result, uint64_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_qsset_uint(result, a, ctx, status);
+}
+#endif
+
+/* quietly set a decimal from an mpd_ssize_t */
+void
+mpd_qset_ssize(mpd_t *result, mpd_ssize_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_minalloc(result);
+ mpd_qsset_ssize(result, a, ctx, status);
+}
+
+/* quietly set a decimal from an mpd_uint_t */
+void
+mpd_qset_uint(mpd_t *result, mpd_uint_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ _settriple(result, MPD_POS, a, 0);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* quietly set a decimal from an int32_t */
+void
+mpd_qset_i32(mpd_t *result, int32_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_qset_ssize(result, a, ctx, status);
+}
+
+/* quietly set a decimal from a uint32_t */
+void
+mpd_qset_u32(mpd_t *result, uint32_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_qset_uint(result, a, ctx, status);
+}
+
+#if defined(CONFIG_32) && !defined(LEGACY_COMPILER)
+/* set a decimal from a uint64_t */
+static void
+_c32setu64(mpd_t *result, uint64_t u, uint8_t sign, uint32_t *status)
+{
+ mpd_uint_t w[3];
+ uint64_t q;
+ int i, len;
+
+ len = 0;
+ do {
+ q = u / MPD_RADIX;
+ w[len] = (mpd_uint_t)(u - q * MPD_RADIX);
+ u = q; len++;
+ } while (u != 0);
+
+ if (!mpd_qresize(result, len, status)) {
+ return;
+ }
+ for (i = 0; i < len; i++) {
+ result->data[i] = w[i];
+ }
+
+ mpd_set_flags(result, sign);
+ result->exp = 0;
+ result->len = len;
+ mpd_setdigits(result);
+}
+
+static void
+_c32_qset_u64(mpd_t *result, uint64_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ _c32setu64(result, a, MPD_POS, status);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* set a decimal from an int64_t */
+static void
+_c32_qset_i64(mpd_t *result, int64_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ uint64_t u;
+ uint8_t sign = MPD_POS;
+
+ if (a < 0) {
+ if (a == INT64_MIN) {
+ u = (uint64_t)INT64_MAX + (-(INT64_MIN+INT64_MAX));
+ }
+ else {
+ u = -a;
+ }
+ sign = MPD_NEG;
+ }
+ else {
+ u = a;
+ }
+ _c32setu64(result, u, sign, status);
+ mpd_qfinalize(result, ctx, status);
+}
+#endif /* CONFIG_32 && !LEGACY_COMPILER */
+
+#ifndef LEGACY_COMPILER
+/* quietly set a decimal from an int64_t */
+void
+mpd_qset_i64(mpd_t *result, int64_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+#ifdef CONFIG_64
+ mpd_qset_ssize(result, a, ctx, status);
+#else
+ _c32_qset_i64(result, a, ctx, status);
+#endif
+}
+
+/* quietly set a decimal from an int64_t, use a maxcontext for conversion */
+void
+mpd_qset_i64_exact(mpd_t *result, int64_t a, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+
+ mpd_maxcontext(&maxcontext);
+#ifdef CONFIG_64
+ mpd_qset_ssize(result, a, &maxcontext, status);
+#else
+ _c32_qset_i64(result, a, &maxcontext, status);
+#endif
+
+ if (*status & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ /* we want exact results */
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+ *status &= MPD_Errors;
+}
+
+/* quietly set a decimal from a uint64_t */
+void
+mpd_qset_u64(mpd_t *result, uint64_t a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+#ifdef CONFIG_64
+ mpd_qset_uint(result, a, ctx, status);
+#else
+ _c32_qset_u64(result, a, ctx, status);
+#endif
+}
+
+/* quietly set a decimal from a uint64_t, use a maxcontext for conversion */
+void
+mpd_qset_u64_exact(mpd_t *result, uint64_t a, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+
+ mpd_maxcontext(&maxcontext);
+#ifdef CONFIG_64
+ mpd_qset_uint(result, a, &maxcontext, status);
+#else
+ _c32_qset_u64(result, a, &maxcontext, status);
+#endif
+
+ if (*status & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ /* we want exact results */
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+ *status &= MPD_Errors;
+}
+#endif /* !LEGACY_COMPILER */
+
+/*
+ * Quietly get an mpd_uint_t from a decimal. Assumes
+ * MPD_UINT_DIGITS == MPD_RDIGITS+1, which is true for
+ * 32 and 64 bit machines.
+ *
+ * If the operation is impossible, MPD_Invalid_operation is set.
+ */
+static mpd_uint_t
+_mpd_qget_uint(int use_sign, const mpd_t *a, uint32_t *status)
+{
+ mpd_t tmp;
+ mpd_uint_t tmp_data[2];
+ mpd_uint_t lo, hi;
+
+ if (mpd_isspecial(a)) {
+ *status |= MPD_Invalid_operation;
+ return MPD_UINT_MAX;
+ }
+ if (mpd_iszero(a)) {
+ return 0;
+ }
+ if (use_sign && mpd_isnegative(a)) {
+ *status |= MPD_Invalid_operation;
+ return MPD_UINT_MAX;
+ }
+
+ if (a->digits+a->exp > MPD_RDIGITS+1) {
+ *status |= MPD_Invalid_operation;
+ return MPD_UINT_MAX;
+ }
+
+ if (a->exp < 0) {
+ if (!_mpd_isint(a)) {
+ *status |= MPD_Invalid_operation;
+ return MPD_UINT_MAX;
+ }
+ /* At this point a->digits+a->exp <= MPD_RDIGITS+1,
+ * so the shift fits. */
+ tmp.data = tmp_data;
+ tmp.flags = MPD_STATIC|MPD_STATIC_DATA;
+ tmp.alloc = 2;
+ mpd_qsshiftr(&tmp, a, -a->exp);
+ tmp.exp = 0;
+ a = &tmp;
+ }
+
+ _mpd_get_msdigits(&hi, &lo, a, MPD_RDIGITS+1);
+ if (hi) {
+ *status |= MPD_Invalid_operation;
+ return MPD_UINT_MAX;
+ }
+
+ if (a->exp > 0) {
+ _mpd_mul_words(&hi, &lo, lo, mpd_pow10[a->exp]);
+ if (hi) {
+ *status |= MPD_Invalid_operation;
+ return MPD_UINT_MAX;
+ }
+ }
+
+ return lo;
+}
+
+/*
+ * Sets Invalid_operation for:
+ * - specials
+ * - negative numbers (except negative zero)
+ * - non-integers
+ * - overflow
+ */
+mpd_uint_t
+mpd_qget_uint(const mpd_t *a, uint32_t *status)
+{
+ return _mpd_qget_uint(1, a, status);
+}
+
+/* Same as above, but gets the absolute value, i.e. the sign is ignored. */
+mpd_uint_t
+mpd_qabs_uint(const mpd_t *a, uint32_t *status)
+{
+ return _mpd_qget_uint(0, a, status);
+}
+
+/* quietly get an mpd_ssize_t from a decimal */
+mpd_ssize_t
+mpd_qget_ssize(const mpd_t *a, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_uint_t u;
+ int isneg;
+
+ u = mpd_qabs_uint(a, &workstatus);
+ if (workstatus&MPD_Invalid_operation) {
+ *status |= workstatus;
+ return MPD_SSIZE_MAX;
+ }
+
+ isneg = mpd_isnegative(a);
+ if (u <= MPD_SSIZE_MAX) {
+ return isneg ? -((mpd_ssize_t)u) : (mpd_ssize_t)u;
+ }
+ else if (isneg && u+(MPD_SSIZE_MIN+MPD_SSIZE_MAX) == MPD_SSIZE_MAX) {
+ return MPD_SSIZE_MIN;
+ }
+
+ *status |= MPD_Invalid_operation;
+ return MPD_SSIZE_MAX;
+}
+
+#if defined(CONFIG_32) && !defined(LEGACY_COMPILER)
+/*
+ * Quietly get a uint64_t from a decimal. If the operation is impossible,
+ * MPD_Invalid_operation is set.
+ */
+static uint64_t
+_c32_qget_u64(int use_sign, const mpd_t *a, uint32_t *status)
+{
+ MPD_NEW_STATIC(tmp,0,0,20,3);
+ mpd_context_t maxcontext;
+ uint64_t ret;
+
+ tmp_data[0] = 709551615;
+ tmp_data[1] = 446744073;
+ tmp_data[2] = 18;
+
+ if (mpd_isspecial(a)) {
+ *status |= MPD_Invalid_operation;
+ return UINT64_MAX;
+ }
+ if (mpd_iszero(a)) {
+ return 0;
+ }
+ if (use_sign && mpd_isnegative(a)) {
+ *status |= MPD_Invalid_operation;
+ return UINT64_MAX;
+ }
+ if (!_mpd_isint(a)) {
+ *status |= MPD_Invalid_operation;
+ return UINT64_MAX;
+ }
+
+ if (_mpd_cmp_abs(a, &tmp) > 0) {
+ *status |= MPD_Invalid_operation;
+ return UINT64_MAX;
+ }
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qrescale(&tmp, a, 0, &maxcontext, &maxcontext.status);
+ maxcontext.status &= ~MPD_Rounded;
+ if (maxcontext.status != 0) {
+ *status |= (maxcontext.status|MPD_Invalid_operation); /* GCOV_NOT_REACHED */
+ return UINT64_MAX; /* GCOV_NOT_REACHED */
+ }
+
+ ret = 0;
+ switch (tmp.len) {
+ case 3:
+ ret += (uint64_t)tmp_data[2] * 1000000000000000000ULL;
+ case 2:
+ ret += (uint64_t)tmp_data[1] * 1000000000ULL;
+ case 1:
+ ret += tmp_data[0];
+ break;
+ default:
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ return ret;
+}
+
+static int64_t
+_c32_qget_i64(const mpd_t *a, uint32_t *status)
+{
+ uint64_t u;
+ int isneg;
+
+ u = _c32_qget_u64(0, a, status);
+ if (*status&MPD_Invalid_operation) {
+ return INT64_MAX;
+ }
+
+ isneg = mpd_isnegative(a);
+ if (u <= INT64_MAX) {
+ return isneg ? -((int64_t)u) : (int64_t)u;
+ }
+ else if (isneg && u+(INT64_MIN+INT64_MAX) == INT64_MAX) {
+ return INT64_MIN;
+ }
+
+ *status |= MPD_Invalid_operation;
+ return INT64_MAX;
+}
+#endif /* CONFIG_32 && !LEGACY_COMPILER */
+
+#ifdef CONFIG_64
+/* quietly get a uint64_t from a decimal */
+uint64_t
+mpd_qget_u64(const mpd_t *a, uint32_t *status)
+{
+ return mpd_qget_uint(a, status);
+}
+
+/* quietly get an int64_t from a decimal */
+int64_t
+mpd_qget_i64(const mpd_t *a, uint32_t *status)
+{
+ return mpd_qget_ssize(a, status);
+}
+
+/* quietly get a uint32_t from a decimal */
+uint32_t
+mpd_qget_u32(const mpd_t *a, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ uint64_t x = mpd_qget_uint(a, &workstatus);
+
+ if (workstatus&MPD_Invalid_operation) {
+ *status |= workstatus;
+ return UINT32_MAX;
+ }
+ if (x > UINT32_MAX) {
+ *status |= MPD_Invalid_operation;
+ return UINT32_MAX;
+ }
+
+ return (uint32_t)x;
+}
+
+/* quietly get an int32_t from a decimal */
+int32_t
+mpd_qget_i32(const mpd_t *a, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ int64_t x = mpd_qget_ssize(a, &workstatus);
+
+ if (workstatus&MPD_Invalid_operation) {
+ *status |= workstatus;
+ return INT32_MAX;
+ }
+ if (x < INT32_MIN || x > INT32_MAX) {
+ *status |= MPD_Invalid_operation;
+ return INT32_MAX;
+ }
+
+ return (int32_t)x;
+}
+#else
+#ifndef LEGACY_COMPILER
+/* quietly get a uint64_t from a decimal */
+uint64_t
+mpd_qget_u64(const mpd_t *a, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ uint64_t x = _c32_qget_u64(1, a, &workstatus);
+ *status |= workstatus;
+ return x;
+}
+
+/* quietly get an int64_t from a decimal */
+int64_t
+mpd_qget_i64(const mpd_t *a, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ int64_t x = _c32_qget_i64(a, &workstatus);
+ *status |= workstatus;
+ return x;
+}
+#endif
+
+/* quietly get a uint32_t from a decimal */
+uint32_t
+mpd_qget_u32(const mpd_t *a, uint32_t *status)
+{
+ return mpd_qget_uint(a, status);
+}
+
+/* quietly get an int32_t from a decimal */
+int32_t
+mpd_qget_i32(const mpd_t *a, uint32_t *status)
+{
+ return mpd_qget_ssize(a, status);
+}
+#endif
+
+
+/******************************************************************************/
+/* Filtering input of functions, finalizing output of functions */
+/******************************************************************************/
+
+/*
+ * Check if the operand is NaN, copy to result and return 1 if this is
+ * the case. Copying can fail since NaNs are allowed to have a payload that
+ * does not fit in MPD_MINALLOC.
+ */
+int
+mpd_qcheck_nan(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isnan(a)) {
+ *status |= mpd_issnan(a) ? MPD_Invalid_operation : 0;
+ mpd_qcopy(result, a, status);
+ mpd_set_qnan(result);
+ _mpd_fix_nan(result, ctx);
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ * Check if either operand is NaN, copy to result and return 1 if this
+ * is the case. Copying can fail since NaNs are allowed to have a payload
+ * that does not fit in MPD_MINALLOC.
+ */
+int
+mpd_qcheck_nans(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if ((a->flags|b->flags)&(MPD_NAN|MPD_SNAN)) {
+ const mpd_t *choice = b;
+ if (mpd_issnan(a)) {
+ choice = a;
+ *status |= MPD_Invalid_operation;
+ }
+ else if (mpd_issnan(b)) {
+ *status |= MPD_Invalid_operation;
+ }
+ else if (mpd_isqnan(a)) {
+ choice = a;
+ }
+ mpd_qcopy(result, choice, status);
+ mpd_set_qnan(result);
+ _mpd_fix_nan(result, ctx);
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ * Check if one of the operands is NaN, copy to result and return 1 if this
+ * is the case. Copying can fail since NaNs are allowed to have a payload
+ * that does not fit in MPD_MINALLOC.
+ */
+static int
+mpd_qcheck_3nans(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if ((a->flags|b->flags|c->flags)&(MPD_NAN|MPD_SNAN)) {
+ const mpd_t *choice = c;
+ if (mpd_issnan(a)) {
+ choice = a;
+ *status |= MPD_Invalid_operation;
+ }
+ else if (mpd_issnan(b)) {
+ choice = b;
+ *status |= MPD_Invalid_operation;
+ }
+ else if (mpd_issnan(c)) {
+ *status |= MPD_Invalid_operation;
+ }
+ else if (mpd_isqnan(a)) {
+ choice = a;
+ }
+ else if (mpd_isqnan(b)) {
+ choice = b;
+ }
+ mpd_qcopy(result, choice, status);
+ mpd_set_qnan(result);
+ _mpd_fix_nan(result, ctx);
+ return 1;
+ }
+ return 0;
+}
+
+/* Check if rounding digit 'rnd' leads to an increment. */
+static inline int
+_mpd_rnd_incr(const mpd_t *dec, mpd_uint_t rnd, const mpd_context_t *ctx)
+{
+ int ld;
+
+ switch (ctx->round) {
+ case MPD_ROUND_DOWN: case MPD_ROUND_TRUNC:
+ return 0;
+ case MPD_ROUND_HALF_UP:
+ return (rnd >= 5);
+ case MPD_ROUND_HALF_EVEN:
+ return (rnd > 5) || ((rnd == 5) && mpd_isoddcoeff(dec));
+ case MPD_ROUND_CEILING:
+ return !(rnd == 0 || mpd_isnegative(dec));
+ case MPD_ROUND_FLOOR:
+ return !(rnd == 0 || mpd_ispositive(dec));
+ case MPD_ROUND_HALF_DOWN:
+ return (rnd > 5);
+ case MPD_ROUND_UP:
+ return !(rnd == 0);
+ case MPD_ROUND_05UP:
+ ld = (int)mpd_lsd(dec->data[0]);
+ return (!(rnd == 0) && (ld == 0 || ld == 5));
+ default:
+ /* Without a valid context, further results will be undefined. */
+ return 0; /* GCOV_NOT_REACHED */
+ }
+}
+
+/*
+ * Apply rounding to a decimal that has been right-shifted into a full
+ * precision decimal. If an increment leads to an overflow of the precision,
+ * adjust the coefficient and the exponent and check the new exponent for
+ * overflow.
+ */
+static inline void
+_mpd_apply_round(mpd_t *dec, mpd_uint_t rnd, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (_mpd_rnd_incr(dec, rnd, ctx)) {
+ /* We have a number with exactly ctx->prec digits. The increment
+ * can only lead to an overflow if the decimal is all nines. In
+ * that case, the result is a power of ten with prec+1 digits.
+ *
+ * If the precision is a multiple of MPD_RDIGITS, this situation is
+ * detected by _mpd_baseincr returning a carry.
+ * If the precision is not a multiple of MPD_RDIGITS, we have to
+ * check if the result has one digit too many.
+ */
+ mpd_uint_t carry = _mpd_baseincr(dec->data, dec->len);
+ if (carry) {
+ dec->data[dec->len-1] = mpd_pow10[MPD_RDIGITS-1];
+ dec->exp += 1;
+ _mpd_check_exp(dec, ctx, status);
+ return;
+ }
+ mpd_setdigits(dec);
+ if (dec->digits > ctx->prec) {
+ mpd_qshiftr_inplace(dec, 1);
+ dec->exp += 1;
+ dec->digits = ctx->prec;
+ _mpd_check_exp(dec, ctx, status);
+ }
+ }
+}
+
+/*
+ * Apply rounding to a decimal. Allow overflow of the precision.
+ */
+static inline void
+_mpd_apply_round_excess(mpd_t *dec, mpd_uint_t rnd, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (_mpd_rnd_incr(dec, rnd, ctx)) {
+ mpd_uint_t carry = _mpd_baseincr(dec->data, dec->len);
+ if (carry) {
+ if (!mpd_qresize(dec, dec->len+1, status)) {
+ return;
+ }
+ dec->data[dec->len] = 1;
+ dec->len += 1;
+ }
+ mpd_setdigits(dec);
+ }
+}
+
+/*
+ * Apply rounding to a decimal that has been right-shifted into a decimal
+ * with full precision or less. Return failure if an increment would
+ * overflow the precision.
+ */
+static inline int
+_mpd_apply_round_fit(mpd_t *dec, mpd_uint_t rnd, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (_mpd_rnd_incr(dec, rnd, ctx)) {
+ mpd_uint_t carry = _mpd_baseincr(dec->data, dec->len);
+ if (carry) {
+ if (!mpd_qresize(dec, dec->len+1, status)) {
+ return 0;
+ }
+ dec->data[dec->len] = 1;
+ dec->len += 1;
+ }
+ mpd_setdigits(dec);
+ if (dec->digits > ctx->prec) {
+ mpd_seterror(dec, MPD_Invalid_operation, status);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/* Check a normal number for overflow, underflow, clamping. If the operand
+ is modified, it will be zero, special or (sub)normal with a coefficient
+ that fits into the current context precision. */
+static inline void
+_mpd_check_exp(mpd_t *dec, const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t adjexp, etiny, shift;
+ int rnd;
+
+ adjexp = mpd_adjexp(dec);
+ if (adjexp > ctx->emax) {
+
+ if (mpd_iszerocoeff(dec)) {
+ dec->exp = ctx->emax;
+ if (ctx->clamp) {
+ dec->exp -= (ctx->prec-1);
+ }
+ mpd_zerocoeff(dec);
+ *status |= MPD_Clamped;
+ return;
+ }
+
+ switch (ctx->round) {
+ case MPD_ROUND_HALF_UP: case MPD_ROUND_HALF_EVEN:
+ case MPD_ROUND_HALF_DOWN: case MPD_ROUND_UP:
+ case MPD_ROUND_TRUNC:
+ mpd_setspecial(dec, mpd_sign(dec), MPD_INF);
+ break;
+ case MPD_ROUND_DOWN: case MPD_ROUND_05UP:
+ mpd_qmaxcoeff(dec, ctx, status);
+ dec->exp = ctx->emax - ctx->prec + 1;
+ break;
+ case MPD_ROUND_CEILING:
+ if (mpd_isnegative(dec)) {
+ mpd_qmaxcoeff(dec, ctx, status);
+ dec->exp = ctx->emax - ctx->prec + 1;
+ }
+ else {
+ mpd_setspecial(dec, MPD_POS, MPD_INF);
+ }
+ break;
+ case MPD_ROUND_FLOOR:
+ if (mpd_ispositive(dec)) {
+ mpd_qmaxcoeff(dec, ctx, status);
+ dec->exp = ctx->emax - ctx->prec + 1;
+ }
+ else {
+ mpd_setspecial(dec, MPD_NEG, MPD_INF);
+ }
+ break;
+ default: /* debug */
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ *status |= MPD_Overflow|MPD_Inexact|MPD_Rounded;
+
+ } /* fold down */
+ else if (ctx->clamp && dec->exp > mpd_etop(ctx)) {
+ /* At this point adjexp=exp+digits-1 <= emax and exp > etop=emax-prec+1:
+ * (1) shift = exp -emax+prec-1 > 0
+ * (2) digits+shift = exp+digits-1 - emax + prec <= prec */
+ shift = dec->exp - mpd_etop(ctx);
+ if (!mpd_qshiftl(dec, dec, shift, status)) {
+ return;
+ }
+ dec->exp -= shift;
+ *status |= MPD_Clamped;
+ if (!mpd_iszerocoeff(dec) && adjexp < ctx->emin) {
+ /* Underflow is impossible, since exp < etiny=emin-prec+1
+ * and exp > etop=emax-prec+1 would imply emax < emin. */
+ *status |= MPD_Subnormal;
+ }
+ }
+ else if (adjexp < ctx->emin) {
+
+ etiny = mpd_etiny(ctx);
+
+ if (mpd_iszerocoeff(dec)) {
+ if (dec->exp < etiny) {
+ dec->exp = etiny;
+ mpd_zerocoeff(dec);
+ *status |= MPD_Clamped;
+ }
+ return;
+ }
+
+ *status |= MPD_Subnormal;
+ if (dec->exp < etiny) {
+ /* At this point adjexp=exp+digits-1 < emin and exp < etiny=emin-prec+1:
+ * (1) shift = emin-prec+1 - exp > 0
+ * (2) digits-shift = exp+digits-1 - emin + prec < prec */
+ shift = etiny - dec->exp;
+ rnd = (int)mpd_qshiftr_inplace(dec, shift);
+ dec->exp = etiny;
+ /* We always have a spare digit in case of an increment. */
+ _mpd_apply_round_excess(dec, rnd, ctx, status);
+ *status |= MPD_Rounded;
+ if (rnd) {
+ *status |= (MPD_Inexact|MPD_Underflow);
+ if (mpd_iszerocoeff(dec)) {
+ mpd_zerocoeff(dec);
+ *status |= MPD_Clamped;
+ }
+ }
+ }
+ /* Case exp >= etiny=emin-prec+1:
+ * (1) adjexp=exp+digits-1 < emin
+ * (2) digits < emin-exp+1 <= prec */
+ }
+}
+
+/* Transcendental functions do not always set Underflow reliably,
+ * since they only use as much precision as is necessary for correct
+ * rounding. If a result like 1.0000000000e-101 is finalized, there
+ * is no rounding digit that would trigger Underflow. But we can
+ * assume Inexact, so a short check suffices. */
+static inline void
+mpd_check_underflow(mpd_t *dec, const mpd_context_t *ctx, uint32_t *status)
+{
+ if (mpd_adjexp(dec) < ctx->emin && !mpd_iszero(dec) &&
+ dec->exp < mpd_etiny(ctx)) {
+ *status |= MPD_Underflow;
+ }
+}
+
+/* Check if a normal number must be rounded after the exponent has been checked. */
+static inline void
+_mpd_check_round(mpd_t *dec, const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_uint_t rnd;
+ mpd_ssize_t shift;
+
+ /* must handle specials: _mpd_check_exp() can produce infinities or NaNs */
+ if (mpd_isspecial(dec)) {
+ return;
+ }
+
+ if (dec->digits > ctx->prec) {
+ shift = dec->digits - ctx->prec;
+ rnd = mpd_qshiftr_inplace(dec, shift);
+ dec->exp += shift;
+ _mpd_apply_round(dec, rnd, ctx, status);
+ *status |= MPD_Rounded;
+ if (rnd) {
+ *status |= MPD_Inexact;
+ }
+ }
+}
+
+/* Finalize all operations. */
+void
+mpd_qfinalize(mpd_t *result, const mpd_context_t *ctx, uint32_t *status)
+{
+ if (mpd_isspecial(result)) {
+ if (mpd_isnan(result)) {
+ _mpd_fix_nan(result, ctx);
+ }
+ return;
+ }
+
+ _mpd_check_exp(result, ctx, status);
+ _mpd_check_round(result, ctx, status);
+}
+
+
+/******************************************************************************/
+/* Copying */
+/******************************************************************************/
+
+/* Internal function: Copy a decimal, share data with src: USE WITH CARE! */
+static inline void
+_mpd_copy_shared(mpd_t *dest, const mpd_t *src)
+{
+ dest->flags = src->flags;
+ dest->exp = src->exp;
+ dest->digits = src->digits;
+ dest->len = src->len;
+ dest->alloc = src->alloc;
+ dest->data = src->data;
+
+ mpd_set_shared_data(dest);
+}
+
+/*
+ * Copy a decimal. In case of an error, status is set to MPD_Malloc_error.
+ */
+int
+mpd_qcopy(mpd_t *result, const mpd_t *a, uint32_t *status)
+{
+ if (result == a) return 1;
+
+ if (!mpd_qresize(result, a->len, status)) {
+ return 0;
+ }
+
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+ result->digits = a->digits;
+ result->len = a->len;
+ memcpy(result->data, a->data, a->len * (sizeof *result->data));
+
+ return 1;
+}
+
+/* Same as mpd_qcopy, but do not set the result to NaN on failure. */
+int
+mpd_qcopy_cxx(mpd_t *result, const mpd_t *a)
+{
+ if (result == a) return 1;
+
+ if (!mpd_qresize_cxx(result, a->len)) {
+ return 0;
+ }
+
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+ result->digits = a->digits;
+ result->len = a->len;
+ memcpy(result->data, a->data, a->len * (sizeof *result->data));
+
+ return 1;
+}
+
+/*
+ * Copy to a decimal with a static buffer. The caller has to make sure that
+ * the buffer is big enough. Cannot fail.
+ */
+static void
+mpd_qcopy_static(mpd_t *result, const mpd_t *a)
+{
+ if (result == a) return;
+
+ memcpy(result->data, a->data, a->len * (sizeof *result->data));
+
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+ result->digits = a->digits;
+ result->len = a->len;
+}
+
+/*
+ * Return a newly allocated copy of the operand. In case of an error,
+ * status is set to MPD_Malloc_error and the return value is NULL.
+ */
+mpd_t *
+mpd_qncopy(const mpd_t *a)
+{
+ mpd_t *result;
+
+ if ((result = mpd_qnew_size(a->len)) == NULL) {
+ return NULL;
+ }
+ memcpy(result->data, a->data, a->len * (sizeof *result->data));
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+ result->digits = a->digits;
+ result->len = a->len;
+
+ return result;
+}
+
+/*
+ * Copy a decimal and set the sign to positive. In case of an error, the
+ * status is set to MPD_Malloc_error.
+ */
+int
+mpd_qcopy_abs(mpd_t *result, const mpd_t *a, uint32_t *status)
+{
+ if (!mpd_qcopy(result, a, status)) {
+ return 0;
+ }
+ mpd_set_positive(result);
+ return 1;
+}
+
+/*
+ * Copy a decimal and negate the sign. In case of an error, the
+ * status is set to MPD_Malloc_error.
+ */
+int
+mpd_qcopy_negate(mpd_t *result, const mpd_t *a, uint32_t *status)
+{
+ if (!mpd_qcopy(result, a, status)) {
+ return 0;
+ }
+ _mpd_negate(result);
+ return 1;
+}
+
+/*
+ * Copy a decimal, setting the sign of the first operand to the sign of the
+ * second operand. In case of an error, the status is set to MPD_Malloc_error.
+ */
+int
+mpd_qcopy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, uint32_t *status)
+{
+ uint8_t sign_b = mpd_sign(b); /* result may equal b! */
+
+ if (!mpd_qcopy(result, a, status)) {
+ return 0;
+ }
+ mpd_set_sign(result, sign_b);
+ return 1;
+}
+
+
+/******************************************************************************/
+/* Comparisons */
+/******************************************************************************/
+
+/*
+ * For all functions that compare two operands and return an int the usual
+ * convention applies to the return value:
+ *
+ * -1 if op1 < op2
+ * 0 if op1 == op2
+ * 1 if op1 > op2
+ *
+ * INT_MAX for error
+ */
+
+
+/* Convenience macro. If a and b are not equal, return from the calling
+ * function with the correct comparison value. */
+#define CMP_EQUAL_OR_RETURN(a, b) \
+ if (a != b) { \
+ if (a < b) { \
+ return -1; \
+ } \
+ return 1; \
+ }
+
+/*
+ * Compare the data of big and small. This function does the equivalent
+ * of first shifting small to the left and then comparing the data of
+ * big and small, except that no allocation for the left shift is needed.
+ */
+static int
+_mpd_basecmp(mpd_uint_t *big, mpd_uint_t *small, mpd_size_t n, mpd_size_t m,
+ mpd_size_t shift)
+{
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
+ /* spurious uninitialized warnings */
+ mpd_uint_t l=l, lprev=lprev, h=h;
+#else
+ mpd_uint_t l, lprev, h;
+#endif
+ mpd_uint_t q, r;
+ mpd_uint_t ph, x;
+
+ assert(m > 0 && n >= m && shift > 0);
+
+ _mpd_div_word(&q, &r, (mpd_uint_t)shift, MPD_RDIGITS);
+
+ if (r != 0) {
+
+ ph = mpd_pow10[r];
+
+ --m; --n;
+ _mpd_divmod_pow10(&h, &lprev, small[m--], MPD_RDIGITS-r);
+ if (h != 0) {
+ CMP_EQUAL_OR_RETURN(big[n], h)
+ --n;
+ }
+ for (; m != MPD_SIZE_MAX; m--,n--) {
+ _mpd_divmod_pow10(&h, &l, small[m], MPD_RDIGITS-r);
+ x = ph * lprev + h;
+ CMP_EQUAL_OR_RETURN(big[n], x)
+ lprev = l;
+ }
+ x = ph * lprev;
+ CMP_EQUAL_OR_RETURN(big[q], x)
+ }
+ else {
+ while (--m != MPD_SIZE_MAX) {
+ CMP_EQUAL_OR_RETURN(big[m+q], small[m])
+ }
+ }
+
+ return !_mpd_isallzero(big, q);
+}
+
+/* Compare two decimals with the same adjusted exponent. */
+static int
+_mpd_cmp_same_adjexp(const mpd_t *a, const mpd_t *b)
+{
+ mpd_ssize_t shift, i;
+
+ if (a->exp != b->exp) {
+ /* Cannot wrap: a->exp + a->digits = b->exp + b->digits, so
+ * a->exp - b->exp = b->digits - a->digits. */
+ shift = a->exp - b->exp;
+ if (shift > 0) {
+ return -1 * _mpd_basecmp(b->data, a->data, b->len, a->len, shift);
+ }
+ else {
+ return _mpd_basecmp(a->data, b->data, a->len, b->len, -shift);
+ }
+ }
+
+ /*
+ * At this point adjexp(a) == adjexp(b) and a->exp == b->exp,
+ * so a->digits == b->digits, therefore a->len == b->len.
+ */
+ for (i = a->len-1; i >= 0; --i) {
+ CMP_EQUAL_OR_RETURN(a->data[i], b->data[i])
+ }
+
+ return 0;
+}
+
+/* Compare two numerical values. */
+static int
+_mpd_cmp(const mpd_t *a, const mpd_t *b)
+{
+ mpd_ssize_t adjexp_a, adjexp_b;
+
+ /* equal pointers */
+ if (a == b) {
+ return 0;
+ }
+
+ /* infinities */
+ if (mpd_isinfinite(a)) {
+ if (mpd_isinfinite(b)) {
+ return mpd_isnegative(b) - mpd_isnegative(a);
+ }
+ return mpd_arith_sign(a);
+ }
+ if (mpd_isinfinite(b)) {
+ return -mpd_arith_sign(b);
+ }
+
+ /* zeros */
+ if (mpd_iszerocoeff(a)) {
+ if (mpd_iszerocoeff(b)) {
+ return 0;
+ }
+ return -mpd_arith_sign(b);
+ }
+ if (mpd_iszerocoeff(b)) {
+ return mpd_arith_sign(a);
+ }
+
+ /* different signs */
+ if (mpd_sign(a) != mpd_sign(b)) {
+ return mpd_sign(b) - mpd_sign(a);
+ }
+
+ /* different adjusted exponents */
+ adjexp_a = mpd_adjexp(a);
+ adjexp_b = mpd_adjexp(b);
+ if (adjexp_a != adjexp_b) {
+ if (adjexp_a < adjexp_b) {
+ return -1 * mpd_arith_sign(a);
+ }
+ return mpd_arith_sign(a);
+ }
+
+ /* same adjusted exponents */
+ return _mpd_cmp_same_adjexp(a, b) * mpd_arith_sign(a);
+}
+
+/* Compare the absolutes of two numerical values. */
+static int
+_mpd_cmp_abs(const mpd_t *a, const mpd_t *b)
+{
+ mpd_ssize_t adjexp_a, adjexp_b;
+
+ /* equal pointers */
+ if (a == b) {
+ return 0;
+ }
+
+ /* infinities */
+ if (mpd_isinfinite(a)) {
+ if (mpd_isinfinite(b)) {
+ return 0;
+ }
+ return 1;
+ }
+ if (mpd_isinfinite(b)) {
+ return -1;
+ }
+
+ /* zeros */
+ if (mpd_iszerocoeff(a)) {
+ if (mpd_iszerocoeff(b)) {
+ return 0;
+ }
+ return -1;
+ }
+ if (mpd_iszerocoeff(b)) {
+ return 1;
+ }
+
+ /* different adjusted exponents */
+ adjexp_a = mpd_adjexp(a);
+ adjexp_b = mpd_adjexp(b);
+ if (adjexp_a != adjexp_b) {
+ if (adjexp_a < adjexp_b) {
+ return -1;
+ }
+ return 1;
+ }
+
+ /* same adjusted exponents */
+ return _mpd_cmp_same_adjexp(a, b);
+}
+
+/* Compare two values and return an integer result. */
+int
+mpd_qcmp(const mpd_t *a, const mpd_t *b, uint32_t *status)
+{
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_isnan(a) || mpd_isnan(b)) {
+ *status |= MPD_Invalid_operation;
+ return INT_MAX;
+ }
+ }
+
+ return _mpd_cmp(a, b);
+}
+
+/*
+ * Compare a and b, convert the usual integer result to a decimal and
+ * store it in 'result'. For convenience, the integer result of the comparison
+ * is returned. Comparisons involving NaNs return NaN/INT_MAX.
+ */
+int
+mpd_qcompare(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return INT_MAX;
+ }
+ }
+
+ c = _mpd_cmp(a, b);
+ _settriple(result, (c < 0), (c != 0), 0);
+ return c;
+}
+
+/* Same as mpd_compare(), but signal for all NaNs, i.e. also for quiet NaNs. */
+int
+mpd_qcompare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ *status |= MPD_Invalid_operation;
+ return INT_MAX;
+ }
+ }
+
+ c = _mpd_cmp(a, b);
+ _settriple(result, (c < 0), (c != 0), 0);
+ return c;
+}
+
+/* Compare the operands using a total order. */
+int
+mpd_cmp_total(const mpd_t *a, const mpd_t *b)
+{
+ mpd_t aa, bb;
+ int nan_a, nan_b;
+ int c;
+
+ if (mpd_sign(a) != mpd_sign(b)) {
+ return mpd_sign(b) - mpd_sign(a);
+ }
+
+
+ if (mpd_isnan(a)) {
+ c = 1;
+ if (mpd_isnan(b)) {
+ nan_a = (mpd_isqnan(a)) ? 1 : 0;
+ nan_b = (mpd_isqnan(b)) ? 1 : 0;
+ if (nan_b == nan_a) {
+ if (a->len > 0 && b->len > 0) {
+ _mpd_copy_shared(&aa, a);
+ _mpd_copy_shared(&bb, b);
+ aa.exp = bb.exp = 0;
+ /* compare payload */
+ c = _mpd_cmp_abs(&aa, &bb);
+ }
+ else {
+ c = (a->len > 0) - (b->len > 0);
+ }
+ }
+ else {
+ c = nan_a - nan_b;
+ }
+ }
+ }
+ else if (mpd_isnan(b)) {
+ c = -1;
+ }
+ else {
+ c = _mpd_cmp_abs(a, b);
+ if (c == 0 && a->exp != b->exp) {
+ c = (a->exp < b->exp) ? -1 : 1;
+ }
+ }
+
+ return c * mpd_arith_sign(a);
+}
+
+/*
+ * Compare a and b according to a total order, convert the usual integer result
+ * to a decimal and store it in 'result'. For convenience, the integer result
+ * of the comparison is returned.
+ */
+int
+mpd_compare_total(mpd_t *result, const mpd_t *a, const mpd_t *b)
+{
+ int c;
+
+ c = mpd_cmp_total(a, b);
+ _settriple(result, (c < 0), (c != 0), 0);
+ return c;
+}
+
+/* Compare the magnitude of the operands using a total order. */
+int
+mpd_cmp_total_mag(const mpd_t *a, const mpd_t *b)
+{
+ mpd_t aa, bb;
+
+ _mpd_copy_shared(&aa, a);
+ _mpd_copy_shared(&bb, b);
+
+ mpd_set_positive(&aa);
+ mpd_set_positive(&bb);
+
+ return mpd_cmp_total(&aa, &bb);
+}
+
+/*
+ * Compare the magnitude of a and b according to a total order, convert the
+ * the usual integer result to a decimal and store it in 'result'.
+ * For convenience, the integer result of the comparison is returned.
+ */
+int
+mpd_compare_total_mag(mpd_t *result, const mpd_t *a, const mpd_t *b)
+{
+ int c;
+
+ c = mpd_cmp_total_mag(a, b);
+ _settriple(result, (c < 0), (c != 0), 0);
+ return c;
+}
+
+/* Determine an ordering for operands that are numerically equal. */
+static inline int
+_mpd_cmp_numequal(const mpd_t *a, const mpd_t *b)
+{
+ int sign_a, sign_b;
+ int c;
+
+ sign_a = mpd_sign(a);
+ sign_b = mpd_sign(b);
+ if (sign_a != sign_b) {
+ c = sign_b - sign_a;
+ }
+ else {
+ c = (a->exp < b->exp) ? -1 : 1;
+ c *= mpd_arith_sign(a);
+ }
+
+ return c;
+}
+
+
+/******************************************************************************/
+/* Shifting the coefficient */
+/******************************************************************************/
+
+/*
+ * Shift the coefficient of the operand to the left, no check for specials.
+ * Both operands may be the same pointer. If the result length has to be
+ * increased, mpd_qresize() might fail with MPD_Malloc_error.
+ */
+int
+mpd_qshiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, uint32_t *status)
+{
+ mpd_ssize_t size;
+
+ assert(!mpd_isspecial(a));
+ assert(n >= 0);
+
+ if (mpd_iszerocoeff(a) || n == 0) {
+ return mpd_qcopy(result, a, status);
+ }
+
+ size = mpd_digits_to_size(a->digits+n);
+ if (!mpd_qresize(result, size, status)) {
+ return 0; /* result is NaN */
+ }
+
+ _mpd_baseshiftl(result->data, a->data, size, a->len, n);
+
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+ result->digits = a->digits+n;
+ result->len = size;
+
+ return 1;
+}
+
+/* Determine the rounding indicator if all digits of the coefficient are shifted
+ * out of the picture. */
+static mpd_uint_t
+_mpd_get_rnd(const mpd_uint_t *data, mpd_ssize_t len, int use_msd)
+{
+ mpd_uint_t rnd = 0, rest = 0, word;
+
+ word = data[len-1];
+ /* special treatment for the most significant digit if shift == digits */
+ if (use_msd) {
+ _mpd_divmod_pow10(&rnd, &rest, word, mpd_word_digits(word)-1);
+ if (len > 1 && rest == 0) {
+ rest = !_mpd_isallzero(data, len-1);
+ }
+ }
+ else {
+ rest = !_mpd_isallzero(data, len);
+ }
+
+ return (rnd == 0 || rnd == 5) ? rnd + !!rest : rnd;
+}
+
+/*
+ * Same as mpd_qshiftr(), but 'result' is an mpd_t with a static coefficient.
+ * It is the caller's responsibility to ensure that the coefficient is big
+ * enough. The function cannot fail.
+ */
+static mpd_uint_t
+mpd_qsshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n)
+{
+ mpd_uint_t rnd;
+ mpd_ssize_t size;
+
+ assert(!mpd_isspecial(a));
+ assert(n >= 0);
+
+ if (mpd_iszerocoeff(a) || n == 0) {
+ mpd_qcopy_static(result, a);
+ return 0;
+ }
+
+ if (n >= a->digits) {
+ rnd = _mpd_get_rnd(a->data, a->len, (n==a->digits));
+ mpd_zerocoeff(result);
+ }
+ else {
+ result->digits = a->digits-n;
+ size = mpd_digits_to_size(result->digits);
+ rnd = _mpd_baseshiftr(result->data, a->data, a->len, n);
+ result->len = size;
+ }
+
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+
+ return rnd;
+}
+
+/*
+ * Inplace shift of the coefficient to the right, no check for specials.
+ * Returns the rounding indicator for mpd_rnd_incr().
+ * The function cannot fail.
+ */
+mpd_uint_t
+mpd_qshiftr_inplace(mpd_t *result, mpd_ssize_t n)
+{
+ uint32_t dummy;
+ mpd_uint_t rnd;
+ mpd_ssize_t size;
+
+ assert(!mpd_isspecial(result));
+ assert(n >= 0);
+
+ if (mpd_iszerocoeff(result) || n == 0) {
+ return 0;
+ }
+
+ if (n >= result->digits) {
+ rnd = _mpd_get_rnd(result->data, result->len, (n==result->digits));
+ mpd_zerocoeff(result);
+ }
+ else {
+ rnd = _mpd_baseshiftr(result->data, result->data, result->len, n);
+ result->digits -= n;
+ size = mpd_digits_to_size(result->digits);
+ /* reducing the size cannot fail */
+ mpd_qresize(result, size, &dummy);
+ result->len = size;
+ }
+
+ return rnd;
+}
+
+/*
+ * Shift the coefficient of the operand to the right, no check for specials.
+ * Both operands may be the same pointer. Returns the rounding indicator to
+ * be used by mpd_rnd_incr(). If the result length has to be increased,
+ * mpd_qcopy() or mpd_qresize() might fail with MPD_Malloc_error. In those
+ * cases, MPD_UINT_MAX is returned.
+ */
+mpd_uint_t
+mpd_qshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, uint32_t *status)
+{
+ mpd_uint_t rnd;
+ mpd_ssize_t size;
+
+ assert(!mpd_isspecial(a));
+ assert(n >= 0);
+
+ if (mpd_iszerocoeff(a) || n == 0) {
+ if (!mpd_qcopy(result, a, status)) {
+ return MPD_UINT_MAX;
+ }
+ return 0;
+ }
+
+ if (n >= a->digits) {
+ rnd = _mpd_get_rnd(a->data, a->len, (n==a->digits));
+ mpd_zerocoeff(result);
+ }
+ else {
+ result->digits = a->digits-n;
+ size = mpd_digits_to_size(result->digits);
+ if (result == a) {
+ rnd = _mpd_baseshiftr(result->data, a->data, a->len, n);
+ /* reducing the size cannot fail */
+ mpd_qresize(result, size, status);
+ }
+ else {
+ if (!mpd_qresize(result, size, status)) {
+ return MPD_UINT_MAX;
+ }
+ rnd = _mpd_baseshiftr(result->data, a->data, a->len, n);
+ }
+ result->len = size;
+ }
+
+ mpd_copy_flags(result, a);
+ result->exp = a->exp;
+
+ return rnd;
+}
+
+
+/******************************************************************************/
+/* Miscellaneous operations */
+/******************************************************************************/
+
+/* Logical And */
+void
+mpd_qand(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ const mpd_t *big = a, *small = b;
+ mpd_uint_t x, y, z, xbit, ybit;
+ int k, mswdigits;
+ mpd_ssize_t i;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b) ||
+ mpd_isnegative(a) || mpd_isnegative(b) ||
+ a->exp != 0 || b->exp != 0) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (b->digits > a->digits) {
+ big = b;
+ small = a;
+ }
+ if (!mpd_qresize(result, big->len, status)) {
+ return;
+ }
+
+
+ /* full words */
+ for (i = 0; i < small->len-1; i++) {
+ x = small->data[i];
+ y = big->data[i];
+ z = 0;
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ xbit = x % 10;
+ x /= 10;
+ ybit = y % 10;
+ y /= 10;
+ if (xbit > 1 || ybit > 1) {
+ goto invalid_operation;
+ }
+ z += (xbit&ybit) ? mpd_pow10[k] : 0;
+ }
+ result->data[i] = z;
+ }
+ /* most significant word of small */
+ x = small->data[i];
+ y = big->data[i];
+ z = 0;
+ mswdigits = mpd_word_digits(x);
+ for (k = 0; k < mswdigits; k++) {
+ xbit = x % 10;
+ x /= 10;
+ ybit = y % 10;
+ y /= 10;
+ if (xbit > 1 || ybit > 1) {
+ goto invalid_operation;
+ }
+ z += (xbit&ybit) ? mpd_pow10[k] : 0;
+ }
+ result->data[i++] = z;
+
+ /* scan the rest of y for digits > 1 */
+ for (; k < MPD_RDIGITS; k++) {
+ ybit = y % 10;
+ y /= 10;
+ if (ybit > 1) {
+ goto invalid_operation;
+ }
+ }
+ /* scan the rest of big for digits > 1 */
+ for (; i < big->len; i++) {
+ y = big->data[i];
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ ybit = y % 10;
+ y /= 10;
+ if (ybit > 1) {
+ goto invalid_operation;
+ }
+ }
+ }
+
+ mpd_clear_flags(result);
+ result->exp = 0;
+ result->len = _mpd_real_size(result->data, small->len);
+ mpd_qresize(result, result->len, status);
+ mpd_setdigits(result);
+ _mpd_cap(result, ctx);
+ return;
+
+invalid_operation:
+ mpd_seterror(result, MPD_Invalid_operation, status);
+}
+
+/* Class of an operand. Returns a pointer to the constant name. */
+const char *
+mpd_class(const mpd_t *a, const mpd_context_t *ctx)
+{
+ if (mpd_isnan(a)) {
+ if (mpd_isqnan(a))
+ return "NaN";
+ else
+ return "sNaN";
+ }
+ else if (mpd_ispositive(a)) {
+ if (mpd_isinfinite(a))
+ return "+Infinity";
+ else if (mpd_iszero(a))
+ return "+Zero";
+ else if (mpd_isnormal(a, ctx))
+ return "+Normal";
+ else
+ return "+Subnormal";
+ }
+ else {
+ if (mpd_isinfinite(a))
+ return "-Infinity";
+ else if (mpd_iszero(a))
+ return "-Zero";
+ else if (mpd_isnormal(a, ctx))
+ return "-Normal";
+ else
+ return "-Subnormal";
+ }
+}
+
+/* Logical Xor */
+void
+mpd_qinvert(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_uint_t x, z, xbit;
+ mpd_ssize_t i, digits, len;
+ mpd_ssize_t q, r;
+ int k;
+
+ if (mpd_isspecial(a) || mpd_isnegative(a) || a->exp != 0) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ digits = (a->digits < ctx->prec) ? ctx->prec : a->digits;
+ _mpd_idiv_word(&q, &r, digits, MPD_RDIGITS);
+ len = (r == 0) ? q : q+1;
+ if (!mpd_qresize(result, len, status)) {
+ return;
+ }
+
+ for (i = 0; i < len; i++) {
+ x = (i < a->len) ? a->data[i] : 0;
+ z = 0;
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ xbit = x % 10;
+ x /= 10;
+ if (xbit > 1) {
+ goto invalid_operation;
+ }
+ z += !xbit ? mpd_pow10[k] : 0;
+ }
+ result->data[i] = z;
+ }
+
+ mpd_clear_flags(result);
+ result->exp = 0;
+ result->len = _mpd_real_size(result->data, len);
+ mpd_qresize(result, result->len, status);
+ mpd_setdigits(result);
+ _mpd_cap(result, ctx);
+ return;
+
+invalid_operation:
+ mpd_seterror(result, MPD_Invalid_operation, status);
+}
+
+/* Exponent of the magnitude of the most significant digit of the operand. */
+void
+mpd_qlogb(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ mpd_setspecial(result, MPD_POS, MPD_INF);
+ }
+ else if (mpd_iszerocoeff(a)) {
+ mpd_setspecial(result, MPD_NEG, MPD_INF);
+ *status |= MPD_Division_by_zero;
+ }
+ else {
+ mpd_qset_ssize(result, mpd_adjexp(a), ctx, status);
+ }
+}
+
+/* Logical Or */
+void
+mpd_qor(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ const mpd_t *big = a, *small = b;
+ mpd_uint_t x, y, z, xbit, ybit;
+ int k, mswdigits;
+ mpd_ssize_t i;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b) ||
+ mpd_isnegative(a) || mpd_isnegative(b) ||
+ a->exp != 0 || b->exp != 0) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (b->digits > a->digits) {
+ big = b;
+ small = a;
+ }
+ if (!mpd_qresize(result, big->len, status)) {
+ return;
+ }
+
+
+ /* full words */
+ for (i = 0; i < small->len-1; i++) {
+ x = small->data[i];
+ y = big->data[i];
+ z = 0;
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ xbit = x % 10;
+ x /= 10;
+ ybit = y % 10;
+ y /= 10;
+ if (xbit > 1 || ybit > 1) {
+ goto invalid_operation;
+ }
+ z += (xbit|ybit) ? mpd_pow10[k] : 0;
+ }
+ result->data[i] = z;
+ }
+ /* most significant word of small */
+ x = small->data[i];
+ y = big->data[i];
+ z = 0;
+ mswdigits = mpd_word_digits(x);
+ for (k = 0; k < mswdigits; k++) {
+ xbit = x % 10;
+ x /= 10;
+ ybit = y % 10;
+ y /= 10;
+ if (xbit > 1 || ybit > 1) {
+ goto invalid_operation;
+ }
+ z += (xbit|ybit) ? mpd_pow10[k] : 0;
+ }
+
+ /* scan for digits > 1 and copy the rest of y */
+ for (; k < MPD_RDIGITS; k++) {
+ ybit = y % 10;
+ y /= 10;
+ if (ybit > 1) {
+ goto invalid_operation;
+ }
+ z += ybit*mpd_pow10[k];
+ }
+ result->data[i++] = z;
+ /* scan for digits > 1 and copy the rest of big */
+ for (; i < big->len; i++) {
+ y = big->data[i];
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ ybit = y % 10;
+ y /= 10;
+ if (ybit > 1) {
+ goto invalid_operation;
+ }
+ }
+ result->data[i] = big->data[i];
+ }
+
+ mpd_clear_flags(result);
+ result->exp = 0;
+ result->len = _mpd_real_size(result->data, big->len);
+ mpd_qresize(result, result->len, status);
+ mpd_setdigits(result);
+ _mpd_cap(result, ctx);
+ return;
+
+invalid_operation:
+ mpd_seterror(result, MPD_Invalid_operation, status);
+}
+
+/*
+ * Rotate the coefficient of 'a' by 'b' digits. 'b' must be an integer with
+ * exponent 0.
+ */
+void
+mpd_qrotate(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ MPD_NEW_STATIC(tmp,0,0,0,0);
+ MPD_NEW_STATIC(big,0,0,0,0);
+ MPD_NEW_STATIC(small,0,0,0,0);
+ mpd_ssize_t n, lshift, rshift;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ }
+ if (b->exp != 0 || mpd_isinfinite(b)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ n = mpd_qget_ssize(b, &workstatus);
+ if (workstatus&MPD_Invalid_operation) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (n > ctx->prec || n < -ctx->prec) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+ if (n >= 0) {
+ lshift = n;
+ rshift = ctx->prec-n;
+ }
+ else {
+ lshift = ctx->prec+n;
+ rshift = -n;
+ }
+
+ if (a->digits > ctx->prec) {
+ if (!mpd_qcopy(&tmp, a, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto finish;
+ }
+ _mpd_cap(&tmp, ctx);
+ a = &tmp;
+ }
+
+ if (!mpd_qshiftl(&big, a, lshift, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto finish;
+ }
+ _mpd_cap(&big, ctx);
+
+ if (mpd_qshiftr(&small, a, rshift, status) == MPD_UINT_MAX) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto finish;
+ }
+ _mpd_qadd(result, &big, &small, ctx, status);
+
+
+finish:
+ mpd_del(&tmp);
+ mpd_del(&big);
+ mpd_del(&small);
+}
+
+/*
+ * b must be an integer with exponent 0 and in the range +-2*(emax + prec).
+ * XXX: In my opinion +-(2*emax + prec) would be more sensible.
+ * The result is a with the value of b added to its exponent.
+ */
+void
+mpd_qscaleb(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_uint_t n, maxjump;
+#ifndef LEGACY_COMPILER
+ int64_t exp;
+#else
+ mpd_uint_t x;
+ int x_sign, n_sign;
+ mpd_ssize_t exp;
+#endif
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ }
+ if (b->exp != 0 || mpd_isinfinite(b)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ n = mpd_qabs_uint(b, &workstatus);
+ /* the spec demands this */
+ maxjump = 2 * (mpd_uint_t)(ctx->emax + ctx->prec);
+
+ if (n > maxjump || workstatus&MPD_Invalid_operation) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+#ifndef LEGACY_COMPILER
+ exp = a->exp + (int64_t)n * mpd_arith_sign(b);
+ exp = (exp > MPD_EXP_INF) ? MPD_EXP_INF : exp;
+ exp = (exp < MPD_EXP_CLAMP) ? MPD_EXP_CLAMP : exp;
+#else
+ x = (a->exp < 0) ? -a->exp : a->exp;
+ x_sign = (a->exp < 0) ? 1 : 0;
+ n_sign = mpd_isnegative(b) ? 1 : 0;
+
+ if (x_sign == n_sign) {
+ x = x + n;
+ if (x < n) x = MPD_UINT_MAX;
+ }
+ else {
+ x_sign = (x >= n) ? x_sign : n_sign;
+ x = (x >= n) ? x - n : n - x;
+ }
+ if (!x_sign && x > MPD_EXP_INF) x = MPD_EXP_INF;
+ if (x_sign && x > -MPD_EXP_CLAMP) x = -MPD_EXP_CLAMP;
+ exp = x_sign ? -((mpd_ssize_t)x) : (mpd_ssize_t)x;
+#endif
+
+ mpd_qcopy(result, a, status);
+ result->exp = (mpd_ssize_t)exp;
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/*
+ * Shift the coefficient by n digits, positive n is a left shift. In the case
+ * of a left shift, the result is decapitated to fit the context precision. If
+ * you don't want that, use mpd_shiftl().
+ */
+void
+mpd_qshiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+ if (n >= 0 && n <= ctx->prec) {
+ mpd_qshiftl(result, a, n, status);
+ _mpd_cap(result, ctx);
+ }
+ else if (n < 0 && n >= -ctx->prec) {
+ if (!mpd_qcopy(result, a, status)) {
+ return;
+ }
+ _mpd_cap(result, ctx);
+ mpd_qshiftr_inplace(result, -n);
+ }
+ else {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+}
+
+/*
+ * Same as mpd_shiftn(), but the shift is specified by the decimal b, which
+ * must be an integer with a zero exponent. Infinities remain infinities.
+ */
+void
+mpd_qshift(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_ssize_t n;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ }
+ if (b->exp != 0 || mpd_isinfinite(b)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ n = mpd_qget_ssize(b, &workstatus);
+ if (workstatus&MPD_Invalid_operation) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (n > ctx->prec || n < -ctx->prec) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+ if (n >= 0) {
+ mpd_qshiftl(result, a, n, status);
+ _mpd_cap(result, ctx);
+ }
+ else {
+ if (!mpd_qcopy(result, a, status)) {
+ return;
+ }
+ _mpd_cap(result, ctx);
+ mpd_qshiftr_inplace(result, -n);
+ }
+}
+
+/* Logical Xor */
+void
+mpd_qxor(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ const mpd_t *big = a, *small = b;
+ mpd_uint_t x, y, z, xbit, ybit;
+ int k, mswdigits;
+ mpd_ssize_t i;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b) ||
+ mpd_isnegative(a) || mpd_isnegative(b) ||
+ a->exp != 0 || b->exp != 0) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (b->digits > a->digits) {
+ big = b;
+ small = a;
+ }
+ if (!mpd_qresize(result, big->len, status)) {
+ return;
+ }
+
+
+ /* full words */
+ for (i = 0; i < small->len-1; i++) {
+ x = small->data[i];
+ y = big->data[i];
+ z = 0;
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ xbit = x % 10;
+ x /= 10;
+ ybit = y % 10;
+ y /= 10;
+ if (xbit > 1 || ybit > 1) {
+ goto invalid_operation;
+ }
+ z += (xbit^ybit) ? mpd_pow10[k] : 0;
+ }
+ result->data[i] = z;
+ }
+ /* most significant word of small */
+ x = small->data[i];
+ y = big->data[i];
+ z = 0;
+ mswdigits = mpd_word_digits(x);
+ for (k = 0; k < mswdigits; k++) {
+ xbit = x % 10;
+ x /= 10;
+ ybit = y % 10;
+ y /= 10;
+ if (xbit > 1 || ybit > 1) {
+ goto invalid_operation;
+ }
+ z += (xbit^ybit) ? mpd_pow10[k] : 0;
+ }
+
+ /* scan for digits > 1 and copy the rest of y */
+ for (; k < MPD_RDIGITS; k++) {
+ ybit = y % 10;
+ y /= 10;
+ if (ybit > 1) {
+ goto invalid_operation;
+ }
+ z += ybit*mpd_pow10[k];
+ }
+ result->data[i++] = z;
+ /* scan for digits > 1 and copy the rest of big */
+ for (; i < big->len; i++) {
+ y = big->data[i];
+ for (k = 0; k < MPD_RDIGITS; k++) {
+ ybit = y % 10;
+ y /= 10;
+ if (ybit > 1) {
+ goto invalid_operation;
+ }
+ }
+ result->data[i] = big->data[i];
+ }
+
+ mpd_clear_flags(result);
+ result->exp = 0;
+ result->len = _mpd_real_size(result->data, big->len);
+ mpd_qresize(result, result->len, status);
+ mpd_setdigits(result);
+ _mpd_cap(result, ctx);
+ return;
+
+invalid_operation:
+ mpd_seterror(result, MPD_Invalid_operation, status);
+}
+
+
+/******************************************************************************/
+/* Arithmetic operations */
+/******************************************************************************/
+
+/*
+ * The absolute value of a. If a is negative, the result is the same
+ * as the result of the minus operation. Otherwise, the result is the
+ * result of the plus operation.
+ */
+void
+mpd_qabs(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ }
+
+ if (mpd_isnegative(a)) {
+ mpd_qminus(result, a, ctx, status);
+ }
+ else {
+ mpd_qplus(result, a, ctx, status);
+ }
+}
+
+static inline void
+_mpd_ptrswap(const mpd_t **a, const mpd_t **b)
+{
+ const mpd_t *t = *a;
+ *a = *b;
+ *b = t;
+}
+
+/* Add or subtract infinities. */
+static void
+_mpd_qaddsub_inf(mpd_t *result, const mpd_t *a, const mpd_t *b, uint8_t sign_b,
+ uint32_t *status)
+{
+ if (mpd_isinfinite(a)) {
+ if (mpd_sign(a) != sign_b && mpd_isinfinite(b)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+ else {
+ mpd_setspecial(result, mpd_sign(a), MPD_INF);
+ }
+ return;
+ }
+ assert(mpd_isinfinite(b));
+ mpd_setspecial(result, sign_b, MPD_INF);
+}
+
+/* Add or subtract non-special numbers. */
+static void
+_mpd_qaddsub(mpd_t *result, const mpd_t *a, const mpd_t *b, uint8_t sign_b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ const mpd_t *big, *small;
+ MPD_NEW_STATIC(big_aligned,0,0,0,0);
+ MPD_NEW_CONST(tiny,0,0,1,1,1,1);
+ mpd_uint_t carry;
+ mpd_ssize_t newsize, shift;
+ mpd_ssize_t exp, i;
+ int swap = 0;
+
+
+ /* compare exponents */
+ big = a; small = b;
+ if (big->exp != small->exp) {
+ if (small->exp > big->exp) {
+ _mpd_ptrswap(&big, &small);
+ swap++;
+ }
+ /* align the coefficients */
+ if (!mpd_iszerocoeff(big)) {
+ exp = big->exp - 1;
+ exp += (big->digits > ctx->prec) ? 0 : big->digits-ctx->prec-1;
+ if (mpd_adjexp(small) < exp) {
+ /*
+ * Avoid huge shifts by substituting a value for small that is
+ * guaranteed to produce the same results.
+ *
+ * adjexp(small) < exp if and only if:
+ *
+ * bdigits <= prec AND
+ * bdigits+shift >= prec+2+sdigits AND
+ * exp = bexp+bdigits-prec-2
+ *
+ * 1234567000000000 -> bdigits + shift
+ * ----------XX1234 -> sdigits
+ * ----------X1 -> tiny-digits
+ * |- prec -|
+ *
+ * OR
+ *
+ * bdigits > prec AND
+ * shift > sdigits AND
+ * exp = bexp-1
+ *
+ * 1234567892100000 -> bdigits + shift
+ * ----------XX1234 -> sdigits
+ * ----------X1 -> tiny-digits
+ * |- prec -|
+ *
+ * If tiny is zero, adding or subtracting is a no-op.
+ * Otherwise, adding tiny generates a non-zero digit either
+ * below the rounding digit or the least significant digit
+ * of big. When subtracting, tiny is in the same position as
+ * the carry that would be generated by subtracting sdigits.
+ */
+ mpd_copy_flags(&tiny, small);
+ tiny.exp = exp;
+ tiny.digits = 1;
+ tiny.len = 1;
+ tiny.data[0] = mpd_iszerocoeff(small) ? 0 : 1;
+ small = &tiny;
+ }
+ /* This cannot wrap: the difference is positive and <= maxprec */
+ shift = big->exp - small->exp;
+ if (!mpd_qshiftl(&big_aligned, big, shift, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto finish;
+ }
+ big = &big_aligned;
+ }
+ }
+ result->exp = small->exp;
+
+
+ /* compare length of coefficients */
+ if (big->len < small->len) {
+ _mpd_ptrswap(&big, &small);
+ swap++;
+ }
+
+ newsize = big->len;
+ if (!mpd_qresize(result, newsize, status)) {
+ goto finish;
+ }
+
+ if (mpd_sign(a) == sign_b) {
+
+ carry = _mpd_baseadd(result->data, big->data, small->data,
+ big->len, small->len);
+
+ if (carry) {
+ newsize = big->len + 1;
+ if (!mpd_qresize(result, newsize, status)) {
+ goto finish;
+ }
+ result->data[newsize-1] = carry;
+ }
+
+ result->len = newsize;
+ mpd_set_flags(result, sign_b);
+ }
+ else {
+ if (big->len == small->len) {
+ for (i=big->len-1; i >= 0; --i) {
+ if (big->data[i] != small->data[i]) {
+ if (big->data[i] < small->data[i]) {
+ _mpd_ptrswap(&big, &small);
+ swap++;
+ }
+ break;
+ }
+ }
+ }
+
+ _mpd_basesub(result->data, big->data, small->data,
+ big->len, small->len);
+ newsize = _mpd_real_size(result->data, big->len);
+ /* resize to smaller cannot fail */
+ (void)mpd_qresize(result, newsize, status);
+
+ result->len = newsize;
+ sign_b = (swap & 1) ? sign_b : mpd_sign(a);
+ mpd_set_flags(result, sign_b);
+
+ if (mpd_iszerocoeff(result)) {
+ mpd_set_positive(result);
+ if (ctx->round == MPD_ROUND_FLOOR) {
+ mpd_set_negative(result);
+ }
+ }
+ }
+
+ mpd_setdigits(result);
+
+finish:
+ mpd_del(&big_aligned);
+}
+
+/* Add a and b. No specials, no finalizing. */
+static void
+_mpd_qadd(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ _mpd_qaddsub(result, a, b, mpd_sign(b), ctx, status);
+}
+
+/* Subtract b from a. No specials, no finalizing. */
+static void
+_mpd_qsub(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ _mpd_qaddsub(result, a, b, !mpd_sign(b), ctx, status);
+}
+
+/* Add a and b. */
+void
+mpd_qadd(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ _mpd_qaddsub_inf(result, a, b, mpd_sign(b), status);
+ return;
+ }
+
+ _mpd_qaddsub(result, a, b, mpd_sign(b), ctx, status);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* Add a and b. Set NaN/Invalid_operation if the result is inexact. */
+static void
+_mpd_qadd_exact(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+
+ mpd_qadd(result, a, b, ctx, &workstatus);
+ *status |= workstatus;
+ if (workstatus & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+}
+
+/* Subtract b from a. */
+void
+mpd_qsub(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ _mpd_qaddsub_inf(result, a, b, !mpd_sign(b), status);
+ return;
+ }
+
+ _mpd_qaddsub(result, a, b, !mpd_sign(b), ctx, status);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* Subtract b from a. Set NaN/Invalid_operation if the result is inexact. */
+static void
+_mpd_qsub_exact(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+
+ mpd_qsub(result, a, b, ctx, &workstatus);
+ *status |= workstatus;
+ if (workstatus & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+}
+
+/* Add decimal and mpd_ssize_t. */
+void
+mpd_qadd_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_ssize(&bb, b, &maxcontext, status);
+ mpd_qadd(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Add decimal and mpd_uint_t. */
+void
+mpd_qadd_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_uint(&bb, b, &maxcontext, status);
+ mpd_qadd(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Subtract mpd_ssize_t from decimal. */
+void
+mpd_qsub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_ssize(&bb, b, &maxcontext, status);
+ mpd_qsub(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Subtract mpd_uint_t from decimal. */
+void
+mpd_qsub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_uint(&bb, b, &maxcontext, status);
+ mpd_qsub(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Add decimal and int32_t. */
+void
+mpd_qadd_i32(mpd_t *result, const mpd_t *a, int32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qadd_ssize(result, a, b, ctx, status);
+}
+
+/* Add decimal and uint32_t. */
+void
+mpd_qadd_u32(mpd_t *result, const mpd_t *a, uint32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qadd_uint(result, a, b, ctx, status);
+}
+
+#ifdef CONFIG_64
+/* Add decimal and int64_t. */
+void
+mpd_qadd_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qadd_ssize(result, a, b, ctx, status);
+}
+
+/* Add decimal and uint64_t. */
+void
+mpd_qadd_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qadd_uint(result, a, b, ctx, status);
+}
+#elif !defined(LEGACY_COMPILER)
+/* Add decimal and int64_t. */
+void
+mpd_qadd_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_i64(&bb, b, &maxcontext, status);
+ mpd_qadd(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Add decimal and uint64_t. */
+void
+mpd_qadd_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_u64(&bb, b, &maxcontext, status);
+ mpd_qadd(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+#endif
+
+/* Subtract int32_t from decimal. */
+void
+mpd_qsub_i32(mpd_t *result, const mpd_t *a, int32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qsub_ssize(result, a, b, ctx, status);
+}
+
+/* Subtract uint32_t from decimal. */
+void
+mpd_qsub_u32(mpd_t *result, const mpd_t *a, uint32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qsub_uint(result, a, b, ctx, status);
+}
+
+#ifdef CONFIG_64
+/* Subtract int64_t from decimal. */
+void
+mpd_qsub_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qsub_ssize(result, a, b, ctx, status);
+}
+
+/* Subtract uint64_t from decimal. */
+void
+mpd_qsub_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qsub_uint(result, a, b, ctx, status);
+}
+#elif !defined(LEGACY_COMPILER)
+/* Subtract int64_t from decimal. */
+void
+mpd_qsub_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_i64(&bb, b, &maxcontext, status);
+ mpd_qsub(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Subtract uint64_t from decimal. */
+void
+mpd_qsub_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_u64(&bb, b, &maxcontext, status);
+ mpd_qsub(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+#endif
+
+
+/* Divide infinities. */
+static void
+_mpd_qdiv_inf(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if (mpd_isinfinite(a)) {
+ if (mpd_isinfinite(b)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ mpd_setspecial(result, mpd_sign(a)^mpd_sign(b), MPD_INF);
+ return;
+ }
+ assert(mpd_isinfinite(b));
+ _settriple(result, mpd_sign(a)^mpd_sign(b), 0, mpd_etiny(ctx));
+ *status |= MPD_Clamped;
+}
+
+enum {NO_IDEAL_EXP, SET_IDEAL_EXP};
+/* Divide a by b. */
+static void
+_mpd_qdiv(int action, mpd_t *q, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ MPD_NEW_STATIC(aligned,0,0,0,0);
+ mpd_uint_t ld;
+ mpd_ssize_t shift, exp, tz;
+ mpd_ssize_t newsize;
+ mpd_ssize_t ideal_exp;
+ mpd_uint_t rem;
+ uint8_t sign_a = mpd_sign(a);
+ uint8_t sign_b = mpd_sign(b);
+
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(q, a, b, ctx, status)) {
+ return;
+ }
+ _mpd_qdiv_inf(q, a, b, ctx, status);
+ return;
+ }
+ if (mpd_iszerocoeff(b)) {
+ if (mpd_iszerocoeff(a)) {
+ mpd_seterror(q, MPD_Division_undefined, status);
+ }
+ else {
+ mpd_setspecial(q, sign_a^sign_b, MPD_INF);
+ *status |= MPD_Division_by_zero;
+ }
+ return;
+ }
+ if (mpd_iszerocoeff(a)) {
+ exp = a->exp - b->exp;
+ _settriple(q, sign_a^sign_b, 0, exp);
+ mpd_qfinalize(q, ctx, status);
+ return;
+ }
+
+ shift = (b->digits - a->digits) + ctx->prec + 1;
+ ideal_exp = a->exp - b->exp;
+ exp = ideal_exp - shift;
+ if (shift > 0) {
+ if (!mpd_qshiftl(&aligned, a, shift, status)) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ goto finish;
+ }
+ a = &aligned;
+ }
+ else if (shift < 0) {
+ shift = -shift;
+ if (!mpd_qshiftl(&aligned, b, shift, status)) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ goto finish;
+ }
+ b = &aligned;
+ }
+
+
+ newsize = a->len - b->len + 1;
+ if ((q != b && q != a) || (q == b && newsize > b->len)) {
+ if (!mpd_qresize(q, newsize, status)) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ goto finish;
+ }
+ }
+
+
+ if (b->len == 1) {
+ rem = _mpd_shortdiv(q->data, a->data, a->len, b->data[0]);
+ }
+ else if (b->len <= MPD_NEWTONDIV_CUTOFF) {
+ int ret = _mpd_basedivmod(q->data, NULL, a->data, b->data,
+ a->len, b->len);
+ if (ret < 0) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ goto finish;
+ }
+ rem = ret;
+ }
+ else {
+ MPD_NEW_STATIC(r,0,0,0,0);
+ _mpd_base_ndivmod(q, &r, a, b, status);
+ if (mpd_isspecial(q) || mpd_isspecial(&r)) {
+ mpd_setspecial(q, MPD_POS, MPD_NAN);
+ mpd_del(&r);
+ goto finish;
+ }
+ rem = !mpd_iszerocoeff(&r);
+ mpd_del(&r);
+ newsize = q->len;
+ }
+
+ newsize = _mpd_real_size(q->data, newsize);
+ /* resize to smaller cannot fail */
+ mpd_qresize(q, newsize, status);
+ mpd_set_flags(q, sign_a^sign_b);
+ q->len = newsize;
+ mpd_setdigits(q);
+
+ shift = ideal_exp - exp;
+ if (rem) {
+ ld = mpd_lsd(q->data[0]);
+ if (ld == 0 || ld == 5) {
+ q->data[0] += 1;
+ }
+ }
+ else if (action == SET_IDEAL_EXP && shift > 0) {
+ tz = mpd_trail_zeros(q);
+ shift = (tz > shift) ? shift : tz;
+ mpd_qshiftr_inplace(q, shift);
+ exp += shift;
+ }
+
+ q->exp = exp;
+
+
+finish:
+ mpd_del(&aligned);
+ mpd_qfinalize(q, ctx, status);
+}
+
+/* Divide a by b. */
+void
+mpd_qdiv(mpd_t *q, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ MPD_NEW_STATIC(aa,0,0,0,0);
+ MPD_NEW_STATIC(bb,0,0,0,0);
+ uint32_t xstatus = 0;
+
+ if (q == a) {
+ if (!mpd_qcopy(&aa, a, status)) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ goto out;
+ }
+ a = &aa;
+ }
+
+ if (q == b) {
+ if (!mpd_qcopy(&bb, b, status)) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ goto out;
+ }
+ b = &bb;
+ }
+
+ _mpd_qdiv(SET_IDEAL_EXP, q, a, b, ctx, &xstatus);
+
+ if (xstatus & (MPD_Malloc_error|MPD_Division_impossible)) {
+ /* Inexact quotients (the usual case) fill the entire context precision,
+ * which can lead to the above errors for very high precisions. Retry
+ * the operation with a lower precision in case the result is exact.
+ *
+ * We need an upper bound for the number of digits of a_coeff / b_coeff
+ * when the result is exact. If a_coeff' * 1 / b_coeff' is in lowest
+ * terms, then maxdigits(a_coeff') + maxdigits(1 / b_coeff') is a suitable
+ * bound.
+ *
+ * 1 / b_coeff' is exact iff b_coeff' exclusively has prime factors 2 or 5.
+ * The largest amount of digits is generated if b_coeff' is a power of 2 or
+ * a power of 5 and is less than or equal to log5(b_coeff') <= log2(b_coeff').
+ *
+ * We arrive at a total upper bound:
+ *
+ * maxdigits(a_coeff') + maxdigits(1 / b_coeff') <=
+ * log10(a_coeff) + log2(b_coeff) =
+ * log10(a_coeff) + log10(b_coeff) / log10(2) <=
+ * a->digits + b->digits * 4;
+ */
+ mpd_context_t workctx = *ctx;
+ uint32_t ystatus = 0;
+
+ workctx.prec = a->digits + b->digits * 4;
+ if (workctx.prec >= ctx->prec) {
+ *status |= (xstatus&MPD_Errors);
+ goto out; /* No point in retrying, keep the original error. */
+ }
+
+ _mpd_qdiv(SET_IDEAL_EXP, q, a, b, &workctx, &ystatus);
+ if (ystatus != 0) {
+ ystatus = *status | ((ystatus|xstatus)&MPD_Errors);
+ mpd_seterror(q, ystatus, status);
+ }
+ }
+ else {
+ *status |= xstatus;
+ }
+
+
+out:
+ mpd_del(&aa);
+ mpd_del(&bb);
+}
+
+/* Internal function. */
+static void
+_mpd_qdivmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ MPD_NEW_STATIC(aligned,0,0,0,0);
+ mpd_ssize_t qsize, rsize;
+ mpd_ssize_t ideal_exp, expdiff, shift;
+ uint8_t sign_a = mpd_sign(a);
+ uint8_t sign_ab = mpd_sign(a)^mpd_sign(b);
+
+
+ ideal_exp = (a->exp > b->exp) ? b->exp : a->exp;
+ if (mpd_iszerocoeff(a)) {
+ if (!mpd_qcopy(r, a, status)) {
+ goto nanresult; /* GCOV_NOT_REACHED */
+ }
+ r->exp = ideal_exp;
+ _settriple(q, sign_ab, 0, 0);
+ return;
+ }
+
+ expdiff = mpd_adjexp(a) - mpd_adjexp(b);
+ if (expdiff < 0) {
+ if (a->exp > b->exp) {
+ /* positive and less than b->digits - a->digits */
+ shift = a->exp - b->exp;
+ if (!mpd_qshiftl(r, a, shift, status)) {
+ goto nanresult;
+ }
+ r->exp = ideal_exp;
+ }
+ else {
+ if (!mpd_qcopy(r, a, status)) {
+ goto nanresult;
+ }
+ }
+ _settriple(q, sign_ab, 0, 0);
+ return;
+ }
+ if (expdiff > ctx->prec) {
+ *status |= MPD_Division_impossible;
+ goto nanresult;
+ }
+
+
+ /*
+ * At this point we have:
+ * (1) 0 <= a->exp + a->digits - b->exp - b->digits <= prec
+ * (2) a->exp - b->exp >= b->digits - a->digits
+ * (3) a->exp - b->exp <= prec + b->digits - a->digits
+ */
+ if (a->exp != b->exp) {
+ shift = a->exp - b->exp;
+ if (shift > 0) {
+ /* by (3), after the shift a->digits <= prec + b->digits */
+ if (!mpd_qshiftl(&aligned, a, shift, status)) {
+ goto nanresult;
+ }
+ a = &aligned;
+ }
+ else {
+ shift = -shift;
+ /* by (2), after the shift b->digits <= a->digits */
+ if (!mpd_qshiftl(&aligned, b, shift, status)) {
+ goto nanresult;
+ }
+ b = &aligned;
+ }
+ }
+
+
+ qsize = a->len - b->len + 1;
+ if (!(q == a && qsize < a->len) && !(q == b && qsize < b->len)) {
+ if (!mpd_qresize(q, qsize, status)) {
+ goto nanresult;
+ }
+ }
+
+ rsize = b->len;
+ if (!(r == a && rsize < a->len)) {
+ if (!mpd_qresize(r, rsize, status)) {
+ goto nanresult;
+ }
+ }
+
+ if (b->len == 1) {
+ assert(b->data[0] != 0); /* annotation for scan-build */
+ if (a->len == 1) {
+ _mpd_div_word(&q->data[0], &r->data[0], a->data[0], b->data[0]);
+ }
+ else {
+ r->data[0] = _mpd_shortdiv(q->data, a->data, a->len, b->data[0]);
+ }
+ }
+ else if (b->len <= MPD_NEWTONDIV_CUTOFF) {
+ int ret;
+ ret = _mpd_basedivmod(q->data, r->data, a->data, b->data,
+ a->len, b->len);
+ if (ret == -1) {
+ *status |= MPD_Malloc_error;
+ goto nanresult;
+ }
+ }
+ else {
+ _mpd_base_ndivmod(q, r, a, b, status);
+ if (mpd_isspecial(q) || mpd_isspecial(r)) {
+ goto nanresult;
+ }
+ qsize = q->len;
+ rsize = r->len;
+ }
+
+ qsize = _mpd_real_size(q->data, qsize);
+ /* resize to smaller cannot fail */
+ mpd_qresize(q, qsize, status);
+ q->len = qsize;
+ mpd_setdigits(q);
+ mpd_set_flags(q, sign_ab);
+ q->exp = 0;
+ if (q->digits > ctx->prec) {
+ *status |= MPD_Division_impossible;
+ goto nanresult;
+ }
+
+ rsize = _mpd_real_size(r->data, rsize);
+ /* resize to smaller cannot fail */
+ mpd_qresize(r, rsize, status);
+ r->len = rsize;
+ mpd_setdigits(r);
+ mpd_set_flags(r, sign_a);
+ r->exp = ideal_exp;
+
+out:
+ mpd_del(&aligned);
+ return;
+
+nanresult:
+ mpd_setspecial(q, MPD_POS, MPD_NAN);
+ mpd_setspecial(r, MPD_POS, MPD_NAN);
+ goto out;
+}
+
+/* Integer division with remainder. */
+void
+mpd_qdivmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint8_t sign = mpd_sign(a)^mpd_sign(b);
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(q, a, b, ctx, status)) {
+ mpd_qcopy(r, q, status);
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ if (mpd_isinfinite(b)) {
+ mpd_setspecial(q, MPD_POS, MPD_NAN);
+ }
+ else {
+ mpd_setspecial(q, sign, MPD_INF);
+ }
+ mpd_setspecial(r, MPD_POS, MPD_NAN);
+ *status |= MPD_Invalid_operation;
+ return;
+ }
+ if (mpd_isinfinite(b)) {
+ if (!mpd_qcopy(r, a, status)) {
+ mpd_seterror(q, MPD_Malloc_error, status);
+ return;
+ }
+ mpd_qfinalize(r, ctx, status);
+ _settriple(q, sign, 0, 0);
+ return;
+ }
+ /* debug */
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ if (mpd_iszerocoeff(b)) {
+ if (mpd_iszerocoeff(a)) {
+ mpd_setspecial(q, MPD_POS, MPD_NAN);
+ mpd_setspecial(r, MPD_POS, MPD_NAN);
+ *status |= MPD_Division_undefined;
+ }
+ else {
+ mpd_setspecial(q, sign, MPD_INF);
+ mpd_setspecial(r, MPD_POS, MPD_NAN);
+ *status |= (MPD_Division_by_zero|MPD_Invalid_operation);
+ }
+ return;
+ }
+
+ _mpd_qdivmod(q, r, a, b, ctx, status);
+ mpd_qfinalize(q, ctx, status);
+ mpd_qfinalize(r, ctx, status);
+}
+
+void
+mpd_qdivint(mpd_t *q, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ MPD_NEW_STATIC(r,0,0,0,0);
+ uint8_t sign = mpd_sign(a)^mpd_sign(b);
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(q, a, b, ctx, status)) {
+ return;
+ }
+ if (mpd_isinfinite(a) && mpd_isinfinite(b)) {
+ mpd_seterror(q, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ mpd_setspecial(q, sign, MPD_INF);
+ return;
+ }
+ if (mpd_isinfinite(b)) {
+ _settriple(q, sign, 0, 0);
+ return;
+ }
+ /* debug */
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ if (mpd_iszerocoeff(b)) {
+ if (mpd_iszerocoeff(a)) {
+ mpd_seterror(q, MPD_Division_undefined, status);
+ }
+ else {
+ mpd_setspecial(q, sign, MPD_INF);
+ *status |= MPD_Division_by_zero;
+ }
+ return;
+ }
+
+
+ _mpd_qdivmod(q, &r, a, b, ctx, status);
+ mpd_del(&r);
+ mpd_qfinalize(q, ctx, status);
+}
+
+/* Divide decimal by mpd_ssize_t. */
+void
+mpd_qdiv_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_ssize(&bb, b, &maxcontext, status);
+ mpd_qdiv(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Divide decimal by mpd_uint_t. */
+void
+mpd_qdiv_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_uint(&bb, b, &maxcontext, status);
+ mpd_qdiv(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Divide decimal by int32_t. */
+void
+mpd_qdiv_i32(mpd_t *result, const mpd_t *a, int32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qdiv_ssize(result, a, b, ctx, status);
+}
+
+/* Divide decimal by uint32_t. */
+void
+mpd_qdiv_u32(mpd_t *result, const mpd_t *a, uint32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qdiv_uint(result, a, b, ctx, status);
+}
+
+#ifdef CONFIG_64
+/* Divide decimal by int64_t. */
+void
+mpd_qdiv_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qdiv_ssize(result, a, b, ctx, status);
+}
+
+/* Divide decimal by uint64_t. */
+void
+mpd_qdiv_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qdiv_uint(result, a, b, ctx, status);
+}
+#elif !defined(LEGACY_COMPILER)
+/* Divide decimal by int64_t. */
+void
+mpd_qdiv_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_i64(&bb, b, &maxcontext, status);
+ mpd_qdiv(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Divide decimal by uint64_t. */
+void
+mpd_qdiv_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_u64(&bb, b, &maxcontext, status);
+ mpd_qdiv(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+#endif
+
+/* Pad the result with trailing zeros if it has fewer digits than prec. */
+static void
+_mpd_zeropad(mpd_t *result, const mpd_context_t *ctx, uint32_t *status)
+{
+ if (!mpd_isspecial(result) && !mpd_iszero(result) &&
+ result->digits < ctx->prec) {
+ mpd_ssize_t shift = ctx->prec - result->digits;
+ mpd_qshiftl(result, result, shift, status);
+ result->exp -= shift;
+ }
+}
+
+/* Check if the result is guaranteed to be one. */
+static int
+_mpd_qexp_check_one(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ MPD_NEW_CONST(lim,0,-(ctx->prec+1),1,1,1,9);
+ MPD_NEW_SHARED(aa, a);
+
+ mpd_set_positive(&aa);
+
+ /* abs(a) <= 9 * 10**(-prec-1) */
+ if (_mpd_cmp(&aa, &lim) <= 0) {
+ _settriple(result, 0, 1, 0);
+ *status |= MPD_Rounded|MPD_Inexact;
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ * Get the number of iterations for the Horner scheme in _mpd_qexp().
+ */
+static inline mpd_ssize_t
+_mpd_get_exp_iterations(const mpd_t *r, mpd_ssize_t p)
+{
+ mpd_ssize_t log10pbyr; /* lower bound for log10(p / abs(r)) */
+ mpd_ssize_t n;
+
+ assert(p >= 10);
+ assert(!mpd_iszero(r));
+ assert(-p < mpd_adjexp(r) && mpd_adjexp(r) <= -1);
+
+#ifdef CONFIG_64
+ if (p > (mpd_ssize_t)(1ULL<<52)) {
+ return MPD_SSIZE_MAX;
+ }
+#endif
+
+ /*
+ * Lower bound for log10(p / abs(r)): adjexp(p) - (adjexp(r) + 1)
+ * At this point (for CONFIG_64, CONFIG_32 is not problematic):
+ * 1) 10 <= p <= 2**52
+ * 2) -p < adjexp(r) <= -1
+ * 3) 1 <= log10pbyr <= 2**52 + 14
+ */
+ log10pbyr = (mpd_word_digits(p)-1) - (mpd_adjexp(r)+1);
+
+ /*
+ * The numerator in the paper is 1.435 * p - 1.182, calculated
+ * exactly. We compensate for rounding errors by using 1.43503.
+ * ACL2 proofs:
+ * 1) exp-iter-approx-lower-bound: The term below evaluated
+ * in 53-bit floating point arithmetic is greater than or
+ * equal to the exact term used in the paper.
+ * 2) exp-iter-approx-upper-bound: The term below is less than
+ * or equal to 3/2 * p <= 3/2 * 2**52.
+ */
+ n = (mpd_ssize_t)ceil((1.43503*(double)p - 1.182) / (double)log10pbyr);
+ return n >= 3 ? n : 3;
+}
+
+/*
+ * Internal function, specials have been dealt with. Apart from Overflow
+ * and Underflow, two cases must be considered for the error of the result:
+ *
+ * 1) abs(a) <= 9 * 10**(-prec-1) ==> result == 1
+ *
+ * Absolute error: abs(1 - e**x) < 10**(-prec)
+ * -------------------------------------------
+ *
+ * 2) abs(a) > 9 * 10**(-prec-1)
+ *
+ * Relative error: abs(result - e**x) < 0.5 * 10**(-prec) * e**x
+ * -------------------------------------------------------------
+ *
+ * The algorithm is from Hull&Abrham, Variable Precision Exponential Function,
+ * ACM Transactions on Mathematical Software, Vol. 12, No. 2, June 1986.
+ *
+ * Main differences:
+ *
+ * - The number of iterations for the Horner scheme is calculated using
+ * 53-bit floating point arithmetic.
+ *
+ * - In the error analysis for ER (relative error accumulated in the
+ * evaluation of the truncated series) the reduced operand r may
+ * have any number of digits.
+ * ACL2 proof: exponent-relative-error
+ *
+ * - The analysis for early abortion has been adapted for the mpd_t
+ * ranges.
+ */
+static void
+_mpd_qexp(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_STATIC(tmp,0,0,0,0);
+ MPD_NEW_STATIC(sum,0,0,0,0);
+ MPD_NEW_CONST(word,0,0,1,1,1,1);
+ mpd_ssize_t j, n, t;
+
+ assert(!mpd_isspecial(a));
+
+ if (mpd_iszerocoeff(a)) {
+ _settriple(result, MPD_POS, 1, 0);
+ return;
+ }
+
+ /*
+ * We are calculating e^x = e^(r*10^t) = (e^r)^(10^t), where abs(r) < 1 and t >= 0.
+ *
+ * If t > 0, we have:
+ *
+ * (1) 0.1 <= r < 1, so e^0.1 <= e^r. If t > MAX_T, overflow occurs:
+ *
+ * MAX-EMAX+1 < log10(e^(0.1*10*t)) <= log10(e^(r*10^t)) < adjexp(e^(r*10^t))+1
+ *
+ * (2) -1 < r <= -0.1, so e^r <= e^-0.1. If t > MAX_T, underflow occurs:
+ *
+ * adjexp(e^(r*10^t)) <= log10(e^(r*10^t)) <= log10(e^(-0.1*10^t)) < MIN-ETINY
+ */
+#if defined(CONFIG_64)
+ #define MPD_EXP_MAX_T 19
+#elif defined(CONFIG_32)
+ #define MPD_EXP_MAX_T 10
+#endif
+ t = a->digits + a->exp;
+ t = (t > 0) ? t : 0;
+ if (t > MPD_EXP_MAX_T) {
+ if (mpd_ispositive(a)) {
+ mpd_setspecial(result, MPD_POS, MPD_INF);
+ *status |= MPD_Overflow|MPD_Inexact|MPD_Rounded;
+ }
+ else {
+ _settriple(result, MPD_POS, 0, mpd_etiny(ctx));
+ *status |= (MPD_Inexact|MPD_Rounded|MPD_Subnormal|
+ MPD_Underflow|MPD_Clamped);
+ }
+ return;
+ }
+
+ /* abs(a) <= 9 * 10**(-prec-1) */
+ if (_mpd_qexp_check_one(result, a, ctx, status)) {
+ return;
+ }
+
+ mpd_maxcontext(&workctx);
+ workctx.prec = ctx->prec + t + 2;
+ workctx.prec = (workctx.prec < 10) ? 10 : workctx.prec;
+ workctx.round = MPD_ROUND_HALF_EVEN;
+
+ if (!mpd_qcopy(result, a, status)) {
+ return;
+ }
+ result->exp -= t;
+
+ /*
+ * At this point:
+ * 1) 9 * 10**(-prec-1) < abs(a)
+ * 2) 9 * 10**(-prec-t-1) < abs(r)
+ * 3) log10(9) - prec - t - 1 < log10(abs(r)) < adjexp(abs(r)) + 1
+ * 4) - prec - t - 2 < adjexp(abs(r)) <= -1
+ */
+ n = _mpd_get_exp_iterations(result, workctx.prec);
+ if (n == MPD_SSIZE_MAX) {
+ mpd_seterror(result, MPD_Invalid_operation, status); /* GCOV_UNLIKELY */
+ return; /* GCOV_UNLIKELY */
+ }
+
+ _settriple(&sum, MPD_POS, 1, 0);
+
+ for (j = n-1; j >= 1; j--) {
+ word.data[0] = j;
+ mpd_setdigits(&word);
+ mpd_qdiv(&tmp, result, &word, &workctx, &workctx.status);
+ mpd_qfma(&sum, &sum, &tmp, &one, &workctx, &workctx.status);
+ }
+
+#ifdef CONFIG_64
+ _mpd_qpow_uint(result, &sum, mpd_pow10[t], MPD_POS, &workctx, status);
+#else
+ if (t <= MPD_MAX_POW10) {
+ _mpd_qpow_uint(result, &sum, mpd_pow10[t], MPD_POS, &workctx, status);
+ }
+ else {
+ t -= MPD_MAX_POW10;
+ _mpd_qpow_uint(&tmp, &sum, mpd_pow10[MPD_MAX_POW10], MPD_POS,
+ &workctx, status);
+ _mpd_qpow_uint(result, &tmp, mpd_pow10[t], MPD_POS, &workctx, status);
+ }
+#endif
+
+ mpd_del(&tmp);
+ mpd_del(&sum);
+ *status |= (workctx.status&MPD_Errors);
+ *status |= (MPD_Inexact|MPD_Rounded);
+}
+
+/* exp(a) */
+void
+mpd_qexp(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ _settriple(result, MPD_POS, 0, 0);
+ }
+ else {
+ mpd_setspecial(result, MPD_POS, MPD_INF);
+ }
+ return;
+ }
+ if (mpd_iszerocoeff(a)) {
+ _settriple(result, MPD_POS, 1, 0);
+ return;
+ }
+
+ workctx = *ctx;
+ workctx.round = MPD_ROUND_HALF_EVEN;
+
+ if (ctx->allcr) {
+ MPD_NEW_STATIC(t1, 0,0,0,0);
+ MPD_NEW_STATIC(t2, 0,0,0,0);
+ MPD_NEW_STATIC(ulp, 0,0,0,0);
+ MPD_NEW_STATIC(aa, 0,0,0,0);
+ mpd_ssize_t prec;
+ mpd_ssize_t ulpexp;
+ uint32_t workstatus;
+
+ if (result == a) {
+ if (!mpd_qcopy(&aa, a, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ a = &aa;
+ }
+
+ workctx.clamp = 0;
+ prec = ctx->prec + 3;
+ while (1) {
+ workctx.prec = prec;
+ workstatus = 0;
+
+ _mpd_qexp(result, a, &workctx, &workstatus);
+ *status |= workstatus;
+
+ ulpexp = result->exp + result->digits - workctx.prec;
+ if (workstatus & MPD_Underflow) {
+ /* The effective work precision is result->digits. */
+ ulpexp = result->exp;
+ }
+ _ssettriple(&ulp, MPD_POS, 1, ulpexp);
+
+ /*
+ * At this point [1]:
+ * 1) abs(result - e**x) < 0.5 * 10**(-prec) * e**x
+ * 2) result - ulp < e**x < result + ulp
+ * 3) result - ulp < result < result + ulp
+ *
+ * If round(result-ulp)==round(result+ulp), then
+ * round(result)==round(e**x). Therefore the result
+ * is correctly rounded.
+ *
+ * [1] If abs(a) <= 9 * 10**(-prec-1), use the absolute
+ * error for a similar argument.
+ */
+ workctx.prec = ctx->prec;
+ mpd_qadd(&t1, result, &ulp, &workctx, &workctx.status);
+ mpd_qsub(&t2, result, &ulp, &workctx, &workctx.status);
+ if (mpd_isspecial(result) || mpd_iszerocoeff(result) ||
+ mpd_qcmp(&t1, &t2, status) == 0) {
+ workctx.clamp = ctx->clamp;
+ _mpd_zeropad(result, &workctx, status);
+ mpd_check_underflow(result, &workctx, status);
+ mpd_qfinalize(result, &workctx, status);
+ break;
+ }
+ prec += MPD_RDIGITS;
+ }
+ mpd_del(&t1);
+ mpd_del(&t2);
+ mpd_del(&ulp);
+ mpd_del(&aa);
+ }
+ else {
+ _mpd_qexp(result, a, &workctx, status);
+ _mpd_zeropad(result, &workctx, status);
+ mpd_check_underflow(result, &workctx, status);
+ mpd_qfinalize(result, &workctx, status);
+ }
+}
+
+/* Fused multiply-add: (a * b) + c, with a single final rounding. */
+void
+mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_t *cc = NULL;
+
+ if (result == c) {
+ if ((cc = mpd_qncopy(c)) == NULL) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ c = cc;
+ }
+
+ _mpd_qmul(result, a, b, ctx, &workstatus);
+ if (!(workstatus&MPD_Invalid_operation)) {
+ mpd_qadd(result, result, c, ctx, &workstatus);
+ }
+
+ if (cc) mpd_del(cc);
+ *status |= workstatus;
+}
+
+/*
+ * Schedule the optimal precision increase for the Newton iteration.
+ * v := input operand
+ * z_0 := initial approximation
+ * initprec := natural number such that abs(log(v) - z_0) < 10**-initprec
+ * maxprec := target precision
+ *
+ * For convenience the output klist contains the elements in reverse order:
+ * klist := [k_n-1, ..., k_0], where
+ * 1) k_0 <= initprec and
+ * 2) abs(log(v) - result) < 10**(-2*k_n-1 + 1) <= 10**-maxprec.
+ */
+static inline int
+ln_schedule_prec(mpd_ssize_t klist[MPD_MAX_PREC_LOG2], mpd_ssize_t maxprec,
+ mpd_ssize_t initprec)
+{
+ mpd_ssize_t k;
+ int i;
+
+ assert(maxprec >= 2 && initprec >= 2);
+ if (maxprec <= initprec) return -1;
+
+ i = 0; k = maxprec;
+ do {
+ k = (k+2) / 2;
+ klist[i++] = k;
+ } while (k > initprec);
+
+ return i-1;
+}
+
+/* The constants have been verified with both decimal.py and mpfr. */
+#ifdef CONFIG_64
+#if MPD_RDIGITS != 19
+ #error "mpdecimal.c: MPD_RDIGITS must be 19."
+#endif
+static const mpd_uint_t mpd_ln10_data[MPD_MINALLOC_MAX] = {
+ 6983716328982174407ULL, 9089704281976336583ULL, 1515961135648465461ULL,
+ 4416816335727555703ULL, 2900988039194170265ULL, 2307925037472986509ULL,
+ 107598438319191292ULL, 3466624107184669231ULL, 4450099781311469159ULL,
+ 9807828059751193854ULL, 7713456862091670584ULL, 1492198849978748873ULL,
+ 6528728696511086257ULL, 2385392051446341972ULL, 8692180205189339507ULL,
+ 6518769751037497088ULL, 2375253577097505395ULL, 9095610299291824318ULL,
+ 982748238504564801ULL, 5438635917781170543ULL, 7547331541421808427ULL,
+ 752371033310119785ULL, 3171643095059950878ULL, 9785265383207606726ULL,
+ 2932258279850258550ULL, 5497347726624257094ULL, 2976979522110718264ULL,
+ 9221477656763693866ULL, 1979650047149510504ULL, 6674183485704422507ULL,
+ 9702766860595249671ULL, 9278096762712757753ULL, 9314848524948644871ULL,
+ 6826928280848118428ULL, 754403708474699401ULL, 230105703089634572ULL,
+ 1929203337658714166ULL, 7589402567763113569ULL, 4208241314695689016ULL,
+ 2922455440575892572ULL, 9356734206705811364ULL, 2684916746550586856ULL,
+ 644507064800027750ULL, 9476834636167921018ULL, 5659121373450747856ULL,
+ 2835522011480466371ULL, 6470806855677432162ULL, 7141748003688084012ULL,
+ 9619404400222105101ULL, 5504893431493939147ULL, 6674744042432743651ULL,
+ 2287698219886746543ULL, 7773262884616336622ULL, 1985283935053089653ULL,
+ 4680843799894826233ULL, 8168948290720832555ULL, 8067566662873690987ULL,
+ 6248633409525465082ULL, 9829834196778404228ULL, 3524802359972050895ULL,
+ 3327900967572609677ULL, 110148862877297603ULL, 179914546843642076ULL,
+ 2302585092994045684ULL
+};
+#else
+#if MPD_RDIGITS != 9
+ #error "mpdecimal.c: MPD_RDIGITS must be 9."
+#endif
+static const mpd_uint_t mpd_ln10_data[MPD_MINALLOC_MAX] = {
+ 401682692UL, 708474699UL, 720754403UL, 30896345UL, 602301057UL, 765871416UL,
+ 192920333UL, 763113569UL, 589402567UL, 956890167UL, 82413146UL, 589257242UL,
+ 245544057UL, 811364292UL, 734206705UL, 868569356UL, 167465505UL, 775026849UL,
+ 706480002UL, 18064450UL, 636167921UL, 569476834UL, 734507478UL, 156591213UL,
+ 148046637UL, 283552201UL, 677432162UL, 470806855UL, 880840126UL, 417480036UL,
+ 210510171UL, 940440022UL, 939147961UL, 893431493UL, 436515504UL, 440424327UL,
+ 654366747UL, 821988674UL, 622228769UL, 884616336UL, 537773262UL, 350530896UL,
+ 319852839UL, 989482623UL, 468084379UL, 720832555UL, 168948290UL, 736909878UL,
+ 675666628UL, 546508280UL, 863340952UL, 404228624UL, 834196778UL, 508959829UL,
+ 23599720UL, 967735248UL, 96757260UL, 603332790UL, 862877297UL, 760110148UL,
+ 468436420UL, 401799145UL, 299404568UL, 230258509UL
+};
+#endif
+/* _mpd_ln10 is used directly for precisions smaller than MINALLOC_MAX*RDIGITS.
+ Otherwise, it serves as the initial approximation for calculating ln(10). */
+static const mpd_t _mpd_ln10 = {
+ MPD_STATIC|MPD_CONST_DATA, -(MPD_MINALLOC_MAX*MPD_RDIGITS-1),
+ MPD_MINALLOC_MAX*MPD_RDIGITS, MPD_MINALLOC_MAX, MPD_MINALLOC_MAX,
+ (mpd_uint_t *)mpd_ln10_data
+};
+
+/*
+ * Set 'result' to log(10).
+ * Ulp error: abs(result - log(10)) < ulp(log(10))
+ * Relative error: abs(result - log(10)) < 5 * 10**-prec * log(10)
+ *
+ * NOTE: The relative error is not derived from the ulp error, but
+ * calculated separately using the fact that 23/10 < log(10) < 24/10.
+ */
+void
+mpd_qln10(mpd_t *result, mpd_ssize_t prec, uint32_t *status)
+{
+ mpd_context_t varcontext, maxcontext;
+ MPD_NEW_STATIC(tmp, 0,0,0,0);
+ MPD_NEW_CONST(static10, 0,0,2,1,1,10);
+ mpd_ssize_t klist[MPD_MAX_PREC_LOG2];
+ mpd_uint_t rnd;
+ mpd_ssize_t shift;
+ int i;
+
+ assert(prec >= 1);
+
+ shift = MPD_MINALLOC_MAX*MPD_RDIGITS-prec;
+ shift = shift < 0 ? 0 : shift;
+
+ rnd = mpd_qshiftr(result, &_mpd_ln10, shift, status);
+ if (rnd == MPD_UINT_MAX) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ result->exp = -(result->digits-1);
+
+ mpd_maxcontext(&maxcontext);
+ if (prec < MPD_MINALLOC_MAX*MPD_RDIGITS) {
+ maxcontext.prec = prec;
+ _mpd_apply_round_excess(result, rnd, &maxcontext, status);
+ *status |= (MPD_Inexact|MPD_Rounded);
+ return;
+ }
+
+ mpd_maxcontext(&varcontext);
+ varcontext.round = MPD_ROUND_TRUNC;
+
+ i = ln_schedule_prec(klist, prec+2, -result->exp);
+ for (; i >= 0; i--) {
+ varcontext.prec = 2*klist[i]+3;
+ result->flags ^= MPD_NEG;
+ _mpd_qexp(&tmp, result, &varcontext, status);
+ result->flags ^= MPD_NEG;
+ mpd_qmul(&tmp, &static10, &tmp, &varcontext, status);
+ mpd_qsub(&tmp, &tmp, &one, &maxcontext, status);
+ mpd_qadd(result, result, &tmp, &maxcontext, status);
+ if (mpd_isspecial(result)) {
+ break;
+ }
+ }
+
+ mpd_del(&tmp);
+ maxcontext.prec = prec;
+ mpd_qfinalize(result, &maxcontext, status);
+}
+
+/*
+ * Initial approximations for the ln() iteration. The values have the
+ * following properties (established with both decimal.py and mpfr):
+ *
+ * Index 0 - 400, logarithms of x in [1.00, 5.00]:
+ * abs(lnapprox[i] * 10**-3 - log((i+100)/100)) < 10**-2
+ * abs(lnapprox[i] * 10**-3 - log((i+1+100)/100)) < 10**-2
+ *
+ * Index 401 - 899, logarithms of x in (0.500, 0.999]:
+ * abs(-lnapprox[i] * 10**-3 - log((i+100)/1000)) < 10**-2
+ * abs(-lnapprox[i] * 10**-3 - log((i+1+100)/1000)) < 10**-2
+ */
+static const uint16_t lnapprox[900] = {
+ /* index 0 - 400: log((i+100)/100) * 1000 */
+ 0, 10, 20, 30, 39, 49, 58, 68, 77, 86, 95, 104, 113, 122, 131, 140, 148, 157,
+ 166, 174, 182, 191, 199, 207, 215, 223, 231, 239, 247, 255, 262, 270, 278,
+ 285, 293, 300, 308, 315, 322, 329, 336, 344, 351, 358, 365, 372, 378, 385,
+ 392, 399, 406, 412, 419, 425, 432, 438, 445, 451, 457, 464, 470, 476, 482,
+ 489, 495, 501, 507, 513, 519, 525, 531, 536, 542, 548, 554, 560, 565, 571,
+ 577, 582, 588, 593, 599, 604, 610, 615, 621, 626, 631, 637, 642, 647, 652,
+ 658, 663, 668, 673, 678, 683, 688, 693, 698, 703, 708, 713, 718, 723, 728,
+ 732, 737, 742, 747, 751, 756, 761, 766, 770, 775, 779, 784, 788, 793, 798,
+ 802, 806, 811, 815, 820, 824, 829, 833, 837, 842, 846, 850, 854, 859, 863,
+ 867, 871, 876, 880, 884, 888, 892, 896, 900, 904, 908, 912, 916, 920, 924,
+ 928, 932, 936, 940, 944, 948, 952, 956, 959, 963, 967, 971, 975, 978, 982,
+ 986, 990, 993, 997, 1001, 1004, 1008, 1012, 1015, 1019, 1022, 1026, 1030,
+ 1033, 1037, 1040, 1044, 1047, 1051, 1054, 1058, 1061, 1065, 1068, 1072, 1075,
+ 1078, 1082, 1085, 1089, 1092, 1095, 1099, 1102, 1105, 1109, 1112, 1115, 1118,
+ 1122, 1125, 1128, 1131, 1135, 1138, 1141, 1144, 1147, 1151, 1154, 1157, 1160,
+ 1163, 1166, 1169, 1172, 1176, 1179, 1182, 1185, 1188, 1191, 1194, 1197, 1200,
+ 1203, 1206, 1209, 1212, 1215, 1218, 1221, 1224, 1227, 1230, 1233, 1235, 1238,
+ 1241, 1244, 1247, 1250, 1253, 1256, 1258, 1261, 1264, 1267, 1270, 1273, 1275,
+ 1278, 1281, 1284, 1286, 1289, 1292, 1295, 1297, 1300, 1303, 1306, 1308, 1311,
+ 1314, 1316, 1319, 1322, 1324, 1327, 1330, 1332, 1335, 1338, 1340, 1343, 1345,
+ 1348, 1351, 1353, 1356, 1358, 1361, 1364, 1366, 1369, 1371, 1374, 1376, 1379,
+ 1381, 1384, 1386, 1389, 1391, 1394, 1396, 1399, 1401, 1404, 1406, 1409, 1411,
+ 1413, 1416, 1418, 1421, 1423, 1426, 1428, 1430, 1433, 1435, 1437, 1440, 1442,
+ 1445, 1447, 1449, 1452, 1454, 1456, 1459, 1461, 1463, 1466, 1468, 1470, 1472,
+ 1475, 1477, 1479, 1482, 1484, 1486, 1488, 1491, 1493, 1495, 1497, 1500, 1502,
+ 1504, 1506, 1509, 1511, 1513, 1515, 1517, 1520, 1522, 1524, 1526, 1528, 1530,
+ 1533, 1535, 1537, 1539, 1541, 1543, 1545, 1548, 1550, 1552, 1554, 1556, 1558,
+ 1560, 1562, 1564, 1567, 1569, 1571, 1573, 1575, 1577, 1579, 1581, 1583, 1585,
+ 1587, 1589, 1591, 1593, 1595, 1597, 1599, 1601, 1603, 1605, 1607, 1609,
+ /* index 401 - 899: -log((i+100)/1000) * 1000 */
+ 691, 689, 687, 685, 683, 681, 679, 677, 675, 673, 671, 669, 668, 666, 664,
+ 662, 660, 658, 656, 654, 652, 650, 648, 646, 644, 642, 641, 639, 637, 635,
+ 633, 631, 629, 627, 626, 624, 622, 620, 618, 616, 614, 612, 611, 609, 607,
+ 605, 603, 602, 600, 598, 596, 594, 592, 591, 589, 587, 585, 583, 582, 580,
+ 578, 576, 574, 573, 571, 569, 567, 566, 564, 562, 560, 559, 557, 555, 553,
+ 552, 550, 548, 546, 545, 543, 541, 540, 538, 536, 534, 533, 531, 529, 528,
+ 526, 524, 523, 521, 519, 518, 516, 514, 512, 511, 509, 508, 506, 504, 502,
+ 501, 499, 498, 496, 494, 493, 491, 489, 488, 486, 484, 483, 481, 480, 478,
+ 476, 475, 473, 472, 470, 468, 467, 465, 464, 462, 460, 459, 457, 456, 454,
+ 453, 451, 449, 448, 446, 445, 443, 442, 440, 438, 437, 435, 434, 432, 431,
+ 429, 428, 426, 425, 423, 422, 420, 419, 417, 416, 414, 412, 411, 410, 408,
+ 406, 405, 404, 402, 400, 399, 398, 396, 394, 393, 392, 390, 389, 387, 386,
+ 384, 383, 381, 380, 378, 377, 375, 374, 372, 371, 370, 368, 367, 365, 364,
+ 362, 361, 360, 358, 357, 355, 354, 352, 351, 350, 348, 347, 345, 344, 342,
+ 341, 340, 338, 337, 336, 334, 333, 331, 330, 328, 327, 326, 324, 323, 322,
+ 320, 319, 318, 316, 315, 313, 312, 311, 309, 308, 306, 305, 304, 302, 301,
+ 300, 298, 297, 296, 294, 293, 292, 290, 289, 288, 286, 285, 284, 282, 281,
+ 280, 278, 277, 276, 274, 273, 272, 270, 269, 268, 267, 265, 264, 263, 261,
+ 260, 259, 258, 256, 255, 254, 252, 251, 250, 248, 247, 246, 245, 243, 242,
+ 241, 240, 238, 237, 236, 234, 233, 232, 231, 229, 228, 227, 226, 224, 223,
+ 222, 221, 219, 218, 217, 216, 214, 213, 212, 211, 210, 208, 207, 206, 205,
+ 203, 202, 201, 200, 198, 197, 196, 195, 194, 192, 191, 190, 189, 188, 186,
+ 185, 184, 183, 182, 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, 168,
+ 167, 166, 165, 164, 162, 161, 160, 159, 158, 157, 156, 154, 153, 152, 151,
+ 150, 148, 147, 146, 145, 144, 143, 142, 140, 139, 138, 137, 136, 135, 134,
+ 132, 131, 130, 129, 128, 127, 126, 124, 123, 122, 121, 120, 119, 118, 116,
+ 115, 114, 113, 112, 111, 110, 109, 108, 106, 105, 104, 103, 102, 101, 100,
+ 99, 98, 97, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 84, 83, 82, 81, 80, 79,
+ 78, 77, 76, 75, 74, 73, 72, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59,
+ 58, 57, 56, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39,
+ 38, 37, 36, 35, 34, 33, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,
+ 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
+};
+
+/*
+ * Internal ln() function that does not check for specials, zero or one.
+ * Relative error: abs(result - log(a)) < 0.1 * 10**-prec * abs(log(a))
+ */
+static void
+_mpd_qln(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t varcontext, maxcontext;
+ mpd_t *z = result;
+ MPD_NEW_STATIC(v,0,0,0,0);
+ MPD_NEW_STATIC(vtmp,0,0,0,0);
+ MPD_NEW_STATIC(tmp,0,0,0,0);
+ mpd_ssize_t klist[MPD_MAX_PREC_LOG2];
+ mpd_ssize_t maxprec, shift, t;
+ mpd_ssize_t a_digits, a_exp;
+ mpd_uint_t dummy, x;
+ int i;
+
+ assert(!mpd_isspecial(a) && !mpd_iszerocoeff(a));
+
+ /*
+ * We are calculating ln(a) = ln(v * 10^t) = ln(v) + t*ln(10),
+ * where 0.5 < v <= 5.
+ */
+ if (!mpd_qcopy(&v, a, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto finish;
+ }
+
+ /* Initial approximation: we have at least one non-zero digit */
+ _mpd_get_msdigits(&dummy, &x, &v, 3);
+ if (x < 10) x *= 10;
+ if (x < 100) x *= 10;
+ x -= 100;
+
+ /* a may equal z */
+ a_digits = a->digits;
+ a_exp = a->exp;
+
+ mpd_minalloc(z);
+ mpd_clear_flags(z);
+ z->data[0] = lnapprox[x];
+ z->len = 1;
+ z->exp = -3;
+ mpd_setdigits(z);
+
+ if (x <= 400) {
+ /* Reduce the input operand to 1.00 <= v <= 5.00. Let y = x + 100,
+ * so 100 <= y <= 500. Since y contains the most significant digits
+ * of v, y/100 <= v < (y+1)/100 and abs(z - log(v)) < 10**-2. */
+ v.exp = -(a_digits - 1);
+ t = a_exp + a_digits - 1;
+ }
+ else {
+ /* Reduce the input operand to 0.500 < v <= 0.999. Let y = x + 100,
+ * so 500 < y <= 999. Since y contains the most significant digits
+ * of v, y/1000 <= v < (y+1)/1000 and abs(z - log(v)) < 10**-2. */
+ v.exp = -a_digits;
+ t = a_exp + a_digits;
+ mpd_set_negative(z);
+ }
+
+ mpd_maxcontext(&maxcontext);
+ mpd_maxcontext(&varcontext);
+ varcontext.round = MPD_ROUND_TRUNC;
+
+ maxprec = ctx->prec + 2;
+ if (t == 0 && (x <= 15 || x >= 800)) {
+ /* 0.900 <= v <= 1.15: Estimate the magnitude of the logarithm.
+ * If ln(v) will underflow, skip the loop. Otherwise, adjust the
+ * precision upwards in order to obtain a sufficient number of
+ * significant digits.
+ *
+ * Case v > 1:
+ * abs((v-1)/10) < abs((v-1)/v) < abs(ln(v)) < abs(v-1)
+ * Case v < 1:
+ * abs(v-1) < abs(ln(v)) < abs((v-1)/v) < abs((v-1)*10)
+ */
+ int cmp = _mpd_cmp(&v, &one);
+
+ /* Upper bound (assume v > 1): abs(v-1), unrounded */
+ _mpd_qsub(&tmp, &v, &one, &maxcontext, &maxcontext.status);
+ if (maxcontext.status & MPD_Errors) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto finish;
+ }
+
+ if (cmp < 0) {
+ /* v < 1: abs((v-1)*10) */
+ tmp.exp += 1;
+ }
+ if (mpd_adjexp(&tmp) < mpd_etiny(ctx)) {
+ /* The upper bound is less than etiny: Underflow to zero */
+ _settriple(result, (cmp<0), 1, mpd_etiny(ctx)-1);
+ goto finish;
+ }
+ /* Lower bound: abs((v-1)/10) or abs(v-1) */
+ tmp.exp -= 1;
+ if (mpd_adjexp(&tmp) < 0) {
+ /* Absolute error of the loop: abs(z - log(v)) < 10**-p. If
+ * p = ctx->prec+2-adjexp(lower), then the relative error of
+ * the result is (using 10**adjexp(x) <= abs(x)):
+ *
+ * abs(z - log(v)) / abs(log(v)) < 10**-p / abs(log(v))
+ * <= 10**(-ctx->prec-2)
+ */
+ maxprec = maxprec - mpd_adjexp(&tmp);
+ }
+ }
+
+ i = ln_schedule_prec(klist, maxprec, 2);
+ for (; i >= 0; i--) {
+ varcontext.prec = 2*klist[i]+3;
+ z->flags ^= MPD_NEG;
+ _mpd_qexp(&tmp, z, &varcontext, status);
+ z->flags ^= MPD_NEG;
+
+ if (v.digits > varcontext.prec) {
+ shift = v.digits - varcontext.prec;
+ mpd_qshiftr(&vtmp, &v, shift, status);
+ vtmp.exp += shift;
+ mpd_qmul(&tmp, &vtmp, &tmp, &varcontext, status);
+ }
+ else {
+ mpd_qmul(&tmp, &v, &tmp, &varcontext, status);
+ }
+
+ mpd_qsub(&tmp, &tmp, &one, &maxcontext, status);
+ mpd_qadd(z, z, &tmp, &maxcontext, status);
+ if (mpd_isspecial(z)) {
+ break;
+ }
+ }
+
+ /*
+ * Case t == 0:
+ * t * log(10) == 0, the result does not change and the analysis
+ * above applies. If v < 0.900 or v > 1.15, the relative error is
+ * less than 10**(-ctx.prec-1).
+ * Case t != 0:
+ * z := approx(log(v))
+ * y := approx(log(10))
+ * p := maxprec = ctx->prec + 2
+ * Absolute errors:
+ * 1) abs(z - log(v)) < 10**-p
+ * 2) abs(y - log(10)) < 10**-p
+ * The multiplication is exact, so:
+ * 3) abs(t*y - t*log(10)) < t*10**-p
+ * The sum is exact, so:
+ * 4) abs((z + t*y) - (log(v) + t*log(10))) < (abs(t) + 1) * 10**-p
+ * Bounds for log(v) and log(10):
+ * 5) -7/10 < log(v) < 17/10
+ * 6) 23/10 < log(10) < 24/10
+ * Using 4), 5), 6) and t != 0, the relative error is:
+ *
+ * 7) relerr < ((abs(t) + 1)*10**-p) / abs(log(v) + t*log(10))
+ * < 0.5 * 10**(-p + 1) = 0.5 * 10**(-ctx->prec-1)
+ */
+ mpd_qln10(&v, maxprec+1, status);
+ mpd_qmul_ssize(&tmp, &v, t, &maxcontext, status);
+ mpd_qadd(result, &tmp, z, &maxcontext, status);
+
+
+finish:
+ *status |= (MPD_Inexact|MPD_Rounded);
+ mpd_del(&v);
+ mpd_del(&vtmp);
+ mpd_del(&tmp);
+}
+
+/* ln(a) */
+void
+mpd_qln(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+ mpd_ssize_t adjexp, t;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ mpd_setspecial(result, MPD_POS, MPD_INF);
+ return;
+ }
+ if (mpd_iszerocoeff(a)) {
+ mpd_setspecial(result, MPD_NEG, MPD_INF);
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (_mpd_cmp(a, &one) == 0) {
+ _settriple(result, MPD_POS, 0, 0);
+ return;
+ }
+ /*
+ * Check if the result will overflow (0 < x, x != 1):
+ * 1) log10(x) < 0 iff adjexp(x) < 0
+ * 2) 0 < x /\ x <= y ==> adjexp(x) <= adjexp(y)
+ * 3) 0 < x /\ x != 1 ==> 2 * abs(log10(x)) < abs(log(x))
+ * 4) adjexp(x) <= log10(x) < adjexp(x) + 1
+ *
+ * Case adjexp(x) >= 0:
+ * 5) 2 * adjexp(x) < abs(log(x))
+ * Case adjexp(x) > 0:
+ * 6) adjexp(2 * adjexp(x)) <= adjexp(abs(log(x)))
+ * Case adjexp(x) == 0:
+ * mpd_exp_digits(t)-1 == 0 <= emax (the shortcut is not triggered)
+ *
+ * Case adjexp(x) < 0:
+ * 7) 2 * (-adjexp(x) - 1) < abs(log(x))
+ * Case adjexp(x) < -1:
+ * 8) adjexp(2 * (-adjexp(x) - 1)) <= adjexp(abs(log(x)))
+ * Case adjexp(x) == -1:
+ * mpd_exp_digits(t)-1 == 0 <= emax (the shortcut is not triggered)
+ */
+ adjexp = mpd_adjexp(a);
+ t = (adjexp < 0) ? -adjexp-1 : adjexp;
+ t *= 2;
+ if (mpd_exp_digits(t)-1 > ctx->emax) {
+ *status |= MPD_Overflow|MPD_Inexact|MPD_Rounded;
+ mpd_setspecial(result, (adjexp<0), MPD_INF);
+ return;
+ }
+
+ workctx = *ctx;
+ workctx.round = MPD_ROUND_HALF_EVEN;
+
+ if (ctx->allcr) {
+ MPD_NEW_STATIC(t1, 0,0,0,0);
+ MPD_NEW_STATIC(t2, 0,0,0,0);
+ MPD_NEW_STATIC(ulp, 0,0,0,0);
+ MPD_NEW_STATIC(aa, 0,0,0,0);
+ mpd_ssize_t prec;
+
+ if (result == a) {
+ if (!mpd_qcopy(&aa, a, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ a = &aa;
+ }
+
+ workctx.clamp = 0;
+ prec = ctx->prec + 3;
+ while (1) {
+ workctx.prec = prec;
+ _mpd_qln(result, a, &workctx, status);
+ _ssettriple(&ulp, MPD_POS, 1,
+ result->exp + result->digits-workctx.prec);
+
+ workctx.prec = ctx->prec;
+ mpd_qadd(&t1, result, &ulp, &workctx, &workctx.status);
+ mpd_qsub(&t2, result, &ulp, &workctx, &workctx.status);
+ if (mpd_isspecial(result) || mpd_iszerocoeff(result) ||
+ mpd_qcmp(&t1, &t2, status) == 0) {
+ workctx.clamp = ctx->clamp;
+ mpd_check_underflow(result, &workctx, status);
+ mpd_qfinalize(result, &workctx, status);
+ break;
+ }
+ prec += MPD_RDIGITS;
+ }
+ mpd_del(&t1);
+ mpd_del(&t2);
+ mpd_del(&ulp);
+ mpd_del(&aa);
+ }
+ else {
+ _mpd_qln(result, a, &workctx, status);
+ mpd_check_underflow(result, &workctx, status);
+ mpd_qfinalize(result, &workctx, status);
+ }
+}
+
+/*
+ * Internal log10() function that does not check for specials, zero or one.
+ * Case SKIP_FINALIZE:
+ * Relative error: abs(result - log10(a)) < 0.1 * 10**-prec * abs(log10(a))
+ * Case DO_FINALIZE:
+ * Ulp error: abs(result - log10(a)) < ulp(log10(a))
+ */
+enum {SKIP_FINALIZE, DO_FINALIZE};
+static void
+_mpd_qlog10(int action, mpd_t *result, const mpd_t *a,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_STATIC(ln10,0,0,0,0);
+
+ mpd_maxcontext(&workctx);
+ workctx.prec = ctx->prec + 3;
+ /* relative error: 0.1 * 10**(-p-3). The specific underflow shortcut
+ * in _mpd_qln() does not change the final result. */
+ _mpd_qln(result, a, &workctx, status);
+ /* relative error: 5 * 10**(-p-3) */
+ mpd_qln10(&ln10, workctx.prec, status);
+
+ if (action == DO_FINALIZE) {
+ workctx = *ctx;
+ workctx.round = MPD_ROUND_HALF_EVEN;
+ }
+ /* SKIP_FINALIZE: relative error: 5 * 10**(-p-3) */
+ _mpd_qdiv(NO_IDEAL_EXP, result, result, &ln10, &workctx, status);
+
+ mpd_del(&ln10);
+}
+
+/* log10(a) */
+void
+mpd_qlog10(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+ mpd_ssize_t adjexp, t;
+
+ workctx = *ctx;
+ workctx.round = MPD_ROUND_HALF_EVEN;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ mpd_setspecial(result, MPD_POS, MPD_INF);
+ return;
+ }
+ if (mpd_iszerocoeff(a)) {
+ mpd_setspecial(result, MPD_NEG, MPD_INF);
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_coeff_ispow10(a)) {
+ uint8_t sign = 0;
+ adjexp = mpd_adjexp(a);
+ if (adjexp < 0) {
+ sign = 1;
+ adjexp = -adjexp;
+ }
+ _settriple(result, sign, adjexp, 0);
+ mpd_qfinalize(result, &workctx, status);
+ return;
+ }
+ /*
+ * Check if the result will overflow (0 < x, x != 1):
+ * 1) log10(x) < 0 iff adjexp(x) < 0
+ * 2) 0 < x /\ x <= y ==> adjexp(x) <= adjexp(y)
+ * 3) adjexp(x) <= log10(x) < adjexp(x) + 1
+ *
+ * Case adjexp(x) >= 0:
+ * 4) adjexp(x) <= abs(log10(x))
+ * Case adjexp(x) > 0:
+ * 5) adjexp(adjexp(x)) <= adjexp(abs(log10(x)))
+ * Case adjexp(x) == 0:
+ * mpd_exp_digits(t)-1 == 0 <= emax (the shortcut is not triggered)
+ *
+ * Case adjexp(x) < 0:
+ * 6) -adjexp(x) - 1 < abs(log10(x))
+ * Case adjexp(x) < -1:
+ * 7) adjexp(-adjexp(x) - 1) <= adjexp(abs(log(x)))
+ * Case adjexp(x) == -1:
+ * mpd_exp_digits(t)-1 == 0 <= emax (the shortcut is not triggered)
+ */
+ adjexp = mpd_adjexp(a);
+ t = (adjexp < 0) ? -adjexp-1 : adjexp;
+ if (mpd_exp_digits(t)-1 > ctx->emax) {
+ *status |= MPD_Overflow|MPD_Inexact|MPD_Rounded;
+ mpd_setspecial(result, (adjexp<0), MPD_INF);
+ return;
+ }
+
+ if (ctx->allcr) {
+ MPD_NEW_STATIC(t1, 0,0,0,0);
+ MPD_NEW_STATIC(t2, 0,0,0,0);
+ MPD_NEW_STATIC(ulp, 0,0,0,0);
+ MPD_NEW_STATIC(aa, 0,0,0,0);
+ mpd_ssize_t prec;
+
+ if (result == a) {
+ if (!mpd_qcopy(&aa, a, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ a = &aa;
+ }
+
+ workctx.clamp = 0;
+ prec = ctx->prec + 3;
+ while (1) {
+ workctx.prec = prec;
+ _mpd_qlog10(SKIP_FINALIZE, result, a, &workctx, status);
+ _ssettriple(&ulp, MPD_POS, 1,
+ result->exp + result->digits-workctx.prec);
+
+ workctx.prec = ctx->prec;
+ mpd_qadd(&t1, result, &ulp, &workctx, &workctx.status);
+ mpd_qsub(&t2, result, &ulp, &workctx, &workctx.status);
+ if (mpd_isspecial(result) || mpd_iszerocoeff(result) ||
+ mpd_qcmp(&t1, &t2, status) == 0) {
+ workctx.clamp = ctx->clamp;
+ mpd_check_underflow(result, &workctx, status);
+ mpd_qfinalize(result, &workctx, status);
+ break;
+ }
+ prec += MPD_RDIGITS;
+ }
+ mpd_del(&t1);
+ mpd_del(&t2);
+ mpd_del(&ulp);
+ mpd_del(&aa);
+ }
+ else {
+ _mpd_qlog10(DO_FINALIZE, result, a, &workctx, status);
+ mpd_check_underflow(result, &workctx, status);
+ }
+}
+
+/*
+ * Maximum of the two operands. Attention: If one operand is a quiet NaN and the
+ * other is numeric, the numeric operand is returned. This may not be what one
+ * expects.
+ */
+void
+mpd_qmax(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_isqnan(a) && !mpd_isnan(b)) {
+ mpd_qcopy(result, b, status);
+ }
+ else if (mpd_isqnan(b) && !mpd_isnan(a)) {
+ mpd_qcopy(result, a, status);
+ }
+ else if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ else {
+ c = _mpd_cmp(a, b);
+ if (c == 0) {
+ c = _mpd_cmp_numequal(a, b);
+ }
+
+ if (c < 0) {
+ mpd_qcopy(result, b, status);
+ }
+ else {
+ mpd_qcopy(result, a, status);
+ }
+ }
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/*
+ * Maximum magnitude: Same as mpd_max(), but compares the operands with their
+ * sign ignored.
+ */
+void
+mpd_qmax_mag(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_isqnan(a) && !mpd_isnan(b)) {
+ mpd_qcopy(result, b, status);
+ }
+ else if (mpd_isqnan(b) && !mpd_isnan(a)) {
+ mpd_qcopy(result, a, status);
+ }
+ else if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ else {
+ c = _mpd_cmp_abs(a, b);
+ if (c == 0) {
+ c = _mpd_cmp_numequal(a, b);
+ }
+
+ if (c < 0) {
+ mpd_qcopy(result, b, status);
+ }
+ else {
+ mpd_qcopy(result, a, status);
+ }
+ }
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/*
+ * Minimum of the two operands. Attention: If one operand is a quiet NaN and the
+ * other is numeric, the numeric operand is returned. This may not be what one
+ * expects.
+ */
+void
+mpd_qmin(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_isqnan(a) && !mpd_isnan(b)) {
+ mpd_qcopy(result, b, status);
+ }
+ else if (mpd_isqnan(b) && !mpd_isnan(a)) {
+ mpd_qcopy(result, a, status);
+ }
+ else if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ else {
+ c = _mpd_cmp(a, b);
+ if (c == 0) {
+ c = _mpd_cmp_numequal(a, b);
+ }
+
+ if (c < 0) {
+ mpd_qcopy(result, a, status);
+ }
+ else {
+ mpd_qcopy(result, b, status);
+ }
+ }
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/*
+ * Minimum magnitude: Same as mpd_min(), but compares the operands with their
+ * sign ignored.
+ */
+void
+mpd_qmin_mag(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_isqnan(a) && !mpd_isnan(b)) {
+ mpd_qcopy(result, b, status);
+ }
+ else if (mpd_isqnan(b) && !mpd_isnan(a)) {
+ mpd_qcopy(result, a, status);
+ }
+ else if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ else {
+ c = _mpd_cmp_abs(a, b);
+ if (c == 0) {
+ c = _mpd_cmp_numequal(a, b);
+ }
+
+ if (c < 0) {
+ mpd_qcopy(result, a, status);
+ }
+ else {
+ mpd_qcopy(result, b, status);
+ }
+ }
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* Minimum space needed for the result array in _karatsuba_rec(). */
+static inline mpd_size_t
+_kmul_resultsize(mpd_size_t la, mpd_size_t lb)
+{
+ mpd_size_t n, m;
+
+ n = add_size_t(la, lb);
+ n = add_size_t(n, 1);
+
+ m = (la+1)/2 + 1;
+ m = mul_size_t(m, 3);
+
+ return (m > n) ? m : n;
+}
+
+/* Work space needed in _karatsuba_rec(). lim >= 4 */
+static inline mpd_size_t
+_kmul_worksize(mpd_size_t n, mpd_size_t lim)
+{
+ mpd_size_t m;
+
+ if (n <= lim) {
+ return 0;
+ }
+
+ m = (n+1)/2 + 1;
+
+ return add_size_t(mul_size_t(m, 2), _kmul_worksize(m, lim));
+}
+
+
+#define MPD_KARATSUBA_BASECASE 16 /* must be >= 4 */
+
+/*
+ * Add the product of a and b to c.
+ * c must be _kmul_resultsize(la, lb) in size.
+ * w is used as a work array and must be _kmul_worksize(a, lim) in size.
+ * Roman E. Maeder, Storage Allocation for the Karatsuba Integer Multiplication
+ * Algorithm. In "Design and implementation of symbolic computation systems",
+ * Springer, 1993, ISBN 354057235X, 9783540572350.
+ */
+static void
+_karatsuba_rec(mpd_uint_t *c, const mpd_uint_t *a, const mpd_uint_t *b,
+ mpd_uint_t *w, mpd_size_t la, mpd_size_t lb)
+{
+ mpd_size_t m, lt;
+
+ assert(la >= lb && lb > 0);
+ assert(la <= MPD_KARATSUBA_BASECASE || w != NULL);
+
+ if (la <= MPD_KARATSUBA_BASECASE) {
+ _mpd_basemul(c, a, b, la, lb);
+ return;
+ }
+
+ m = (la+1)/2; /* ceil(la/2) */
+
+ /* lb <= m < la */
+ if (lb <= m) {
+
+ /* lb can now be larger than la-m */
+ if (lb > la-m) {
+ lt = lb + lb + 1; /* space needed for result array */
+ mpd_uint_zero(w, lt); /* clear result array */
+ _karatsuba_rec(w, b, a+m, w+lt, lb, la-m); /* b*ah */
+ }
+ else {
+ lt = (la-m) + (la-m) + 1; /* space needed for result array */
+ mpd_uint_zero(w, lt); /* clear result array */
+ _karatsuba_rec(w, a+m, b, w+lt, la-m, lb); /* ah*b */
+ }
+ _mpd_baseaddto(c+m, w, (la-m)+lb); /* add ah*b*B**m */
+
+ lt = m + m + 1; /* space needed for the result array */
+ mpd_uint_zero(w, lt); /* clear result array */
+ _karatsuba_rec(w, a, b, w+lt, m, lb); /* al*b */
+ _mpd_baseaddto(c, w, m+lb); /* add al*b */
+
+ return;
+ }
+
+ /* la >= lb > m */
+ memcpy(w, a, m * sizeof *w);
+ w[m] = 0;
+ _mpd_baseaddto(w, a+m, la-m);
+
+ memcpy(w+(m+1), b, m * sizeof *w);
+ w[m+1+m] = 0;
+ _mpd_baseaddto(w+(m+1), b+m, lb-m);
+
+ _karatsuba_rec(c+m, w, w+(m+1), w+2*(m+1), m+1, m+1);
+
+ lt = (la-m) + (la-m) + 1;
+ mpd_uint_zero(w, lt);
+
+ _karatsuba_rec(w, a+m, b+m, w+lt, la-m, lb-m);
+
+ _mpd_baseaddto(c+2*m, w, (la-m) + (lb-m));
+ _mpd_basesubfrom(c+m, w, (la-m) + (lb-m));
+
+ lt = m + m + 1;
+ mpd_uint_zero(w, lt);
+
+ _karatsuba_rec(w, a, b, w+lt, m, m);
+ _mpd_baseaddto(c, w, m+m);
+ _mpd_basesubfrom(c+m, w, m+m);
+
+ return;
+}
+
+/*
+ * Multiply u and v, using Karatsuba multiplication. Returns a pointer
+ * to the result or NULL in case of failure (malloc error).
+ * Conditions: ulen >= vlen, ulen >= 4
+ */
+static mpd_uint_t *
+_mpd_kmul(const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t ulen, mpd_size_t vlen,
+ mpd_size_t *rsize)
+{
+ mpd_uint_t *result = NULL, *w = NULL;
+ mpd_size_t m;
+
+ assert(ulen >= 4);
+ assert(ulen >= vlen);
+
+ *rsize = _kmul_resultsize(ulen, vlen);
+ if ((result = mpd_calloc(*rsize, sizeof *result)) == NULL) {
+ return NULL;
+ }
+
+ m = _kmul_worksize(ulen, MPD_KARATSUBA_BASECASE);
+ if (m && ((w = mpd_calloc(m, sizeof *w)) == NULL)) {
+ mpd_free(result);
+ return NULL;
+ }
+
+ _karatsuba_rec(result, u, v, w, ulen, vlen);
+
+
+ if (w) mpd_free(w);
+ return result;
+}
+
+
+/*
+ * Determine the minimum length for the number theoretic transform. Valid
+ * transform lengths are 2**n or 3*2**n, where 2**n <= MPD_MAXTRANSFORM_2N.
+ * The function finds the shortest length m such that rsize <= m.
+ */
+static inline mpd_size_t
+_mpd_get_transform_len(mpd_size_t rsize)
+{
+ mpd_size_t log2rsize;
+ mpd_size_t x, step;
+
+ assert(rsize >= 4);
+ log2rsize = mpd_bsr(rsize);
+
+ if (rsize <= 1024) {
+ /* 2**n is faster in this range. */
+ x = ((mpd_size_t)1)<<log2rsize;
+ return (rsize == x) ? x : x<<1;
+ }
+ else if (rsize <= MPD_MAXTRANSFORM_2N) {
+ x = ((mpd_size_t)1)<<log2rsize;
+ if (rsize == x) return x;
+ step = x>>1;
+ x += step;
+ return (rsize <= x) ? x : x + step;
+ }
+ else if (rsize <= MPD_MAXTRANSFORM_2N+MPD_MAXTRANSFORM_2N/2) {
+ return MPD_MAXTRANSFORM_2N+MPD_MAXTRANSFORM_2N/2;
+ }
+ else if (rsize <= 3*MPD_MAXTRANSFORM_2N) {
+ return 3*MPD_MAXTRANSFORM_2N;
+ }
+ else {
+ return MPD_SIZE_MAX;
+ }
+}
+
+#ifdef PPRO
+#ifndef _MSC_VER
+static inline unsigned short
+_mpd_get_control87(void)
+{
+ unsigned short cw;
+
+ __asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
+ return cw;
+}
+
+static inline void
+_mpd_set_control87(unsigned short cw)
+{
+ __asm__ __volatile__ ("fldcw %0" : : "m" (cw));
+}
+#endif
+
+static unsigned int
+mpd_set_fenv(void)
+{
+ unsigned int cw;
+#ifdef _MSC_VER
+ unsigned int flags =
+ _EM_INVALID|_EM_DENORMAL|_EM_ZERODIVIDE|_EM_OVERFLOW|
+ _EM_UNDERFLOW|_EM_INEXACT|_RC_CHOP|_PC_64;
+ unsigned int mask = _MCW_EM|_MCW_RC|_MCW_PC;
+ unsigned int dummy;
+
+ __control87_2(0, 0, &cw, NULL);
+ __control87_2(flags, mask, &dummy, NULL);
+#else
+ cw = _mpd_get_control87();
+ _mpd_set_control87(cw|0xF3F);
+#endif
+ return cw;
+}
+
+static void
+mpd_restore_fenv(unsigned int cw)
+{
+#ifdef _MSC_VER
+ unsigned int mask = _MCW_EM|_MCW_RC|_MCW_PC;
+ unsigned int dummy;
+
+ __control87_2(cw, mask, &dummy, NULL);
+#else
+ _mpd_set_control87((unsigned short)cw);
+#endif
+}
+#endif /* PPRO */
+
+/*
+ * Multiply u and v, using the fast number theoretic transform. Returns
+ * a pointer to the result or NULL in case of failure (malloc error).
+ */
+static mpd_uint_t *
+_mpd_fntmul(const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t ulen, mpd_size_t vlen,
+ mpd_size_t *rsize)
+{
+ mpd_uint_t *c1 = NULL, *c2 = NULL, *c3 = NULL, *vtmp = NULL;
+ mpd_size_t n;
+
+#ifdef PPRO
+ unsigned int cw;
+ cw = mpd_set_fenv();
+#endif
+
+ *rsize = add_size_t(ulen, vlen);
+ if ((n = _mpd_get_transform_len(*rsize)) == MPD_SIZE_MAX) {
+ goto malloc_error;
+ }
+
+ if ((c1 = mpd_calloc(n, sizeof *c1)) == NULL) {
+ goto malloc_error;
+ }
+ if ((c2 = mpd_calloc(n, sizeof *c2)) == NULL) {
+ goto malloc_error;
+ }
+ if ((c3 = mpd_calloc(n, sizeof *c3)) == NULL) {
+ goto malloc_error;
+ }
+
+ memcpy(c1, u, ulen * (sizeof *c1));
+ memcpy(c2, u, ulen * (sizeof *c2));
+ memcpy(c3, u, ulen * (sizeof *c3));
+
+ if (u == v) {
+ if (!fnt_autoconvolute(c1, n, P1) ||
+ !fnt_autoconvolute(c2, n, P2) ||
+ !fnt_autoconvolute(c3, n, P3)) {
+ goto malloc_error;
+ }
+ }
+ else {
+ if ((vtmp = mpd_calloc(n, sizeof *vtmp)) == NULL) {
+ goto malloc_error;
+ }
+
+ memcpy(vtmp, v, vlen * (sizeof *vtmp));
+ if (!fnt_convolute(c1, vtmp, n, P1)) {
+ mpd_free(vtmp);
+ goto malloc_error;
+ }
+
+ memcpy(vtmp, v, vlen * (sizeof *vtmp));
+ mpd_uint_zero(vtmp+vlen, n-vlen);
+ if (!fnt_convolute(c2, vtmp, n, P2)) {
+ mpd_free(vtmp);
+ goto malloc_error;
+ }
+
+ memcpy(vtmp, v, vlen * (sizeof *vtmp));
+ mpd_uint_zero(vtmp+vlen, n-vlen);
+ if (!fnt_convolute(c3, vtmp, n, P3)) {
+ mpd_free(vtmp);
+ goto malloc_error;
+ }
+
+ mpd_free(vtmp);
+ }
+
+ crt3(c1, c2, c3, *rsize);
+
+out:
+#ifdef PPRO
+ mpd_restore_fenv(cw);
+#endif
+ if (c2) mpd_free(c2);
+ if (c3) mpd_free(c3);
+ return c1;
+
+malloc_error:
+ if (c1) mpd_free(c1);
+ c1 = NULL;
+ goto out;
+}
+
+
+/*
+ * Karatsuba multiplication with FNT/basemul as the base case.
+ */
+static int
+_karatsuba_rec_fnt(mpd_uint_t *c, const mpd_uint_t *a, const mpd_uint_t *b,
+ mpd_uint_t *w, mpd_size_t la, mpd_size_t lb)
+{
+ mpd_size_t m, lt;
+
+ assert(la >= lb && lb > 0);
+ assert(la <= 3*(MPD_MAXTRANSFORM_2N/2) || w != NULL);
+
+ if (la <= 3*(MPD_MAXTRANSFORM_2N/2)) {
+
+ if (lb <= 192) {
+ _mpd_basemul(c, b, a, lb, la);
+ }
+ else {
+ mpd_uint_t *result;
+ mpd_size_t dummy;
+
+ if ((result = _mpd_fntmul(a, b, la, lb, &dummy)) == NULL) {
+ return 0;
+ }
+ memcpy(c, result, (la+lb) * (sizeof *result));
+ mpd_free(result);
+ }
+ return 1;
+ }
+
+ m = (la+1)/2; /* ceil(la/2) */
+
+ /* lb <= m < la */
+ if (lb <= m) {
+
+ /* lb can now be larger than la-m */
+ if (lb > la-m) {
+ lt = lb + lb + 1; /* space needed for result array */
+ mpd_uint_zero(w, lt); /* clear result array */
+ if (!_karatsuba_rec_fnt(w, b, a+m, w+lt, lb, la-m)) { /* b*ah */
+ return 0; /* GCOV_UNLIKELY */
+ }
+ }
+ else {
+ lt = (la-m) + (la-m) + 1; /* space needed for result array */
+ mpd_uint_zero(w, lt); /* clear result array */
+ if (!_karatsuba_rec_fnt(w, a+m, b, w+lt, la-m, lb)) { /* ah*b */
+ return 0; /* GCOV_UNLIKELY */
+ }
+ }
+ _mpd_baseaddto(c+m, w, (la-m)+lb); /* add ah*b*B**m */
+
+ lt = m + m + 1; /* space needed for the result array */
+ mpd_uint_zero(w, lt); /* clear result array */
+ if (!_karatsuba_rec_fnt(w, a, b, w+lt, m, lb)) { /* al*b */
+ return 0; /* GCOV_UNLIKELY */
+ }
+ _mpd_baseaddto(c, w, m+lb); /* add al*b */
+
+ return 1;
+ }
+
+ /* la >= lb > m */
+ memcpy(w, a, m * sizeof *w);
+ w[m] = 0;
+ _mpd_baseaddto(w, a+m, la-m);
+
+ memcpy(w+(m+1), b, m * sizeof *w);
+ w[m+1+m] = 0;
+ _mpd_baseaddto(w+(m+1), b+m, lb-m);
+
+ if (!_karatsuba_rec_fnt(c+m, w, w+(m+1), w+2*(m+1), m+1, m+1)) {
+ return 0; /* GCOV_UNLIKELY */
+ }
+
+ lt = (la-m) + (la-m) + 1;
+ mpd_uint_zero(w, lt);
+
+ if (!_karatsuba_rec_fnt(w, a+m, b+m, w+lt, la-m, lb-m)) {
+ return 0; /* GCOV_UNLIKELY */
+ }
+
+ _mpd_baseaddto(c+2*m, w, (la-m) + (lb-m));
+ _mpd_basesubfrom(c+m, w, (la-m) + (lb-m));
+
+ lt = m + m + 1;
+ mpd_uint_zero(w, lt);
+
+ if (!_karatsuba_rec_fnt(w, a, b, w+lt, m, m)) {
+ return 0; /* GCOV_UNLIKELY */
+ }
+ _mpd_baseaddto(c, w, m+m);
+ _mpd_basesubfrom(c+m, w, m+m);
+
+ return 1;
+}
+
+/*
+ * Multiply u and v, using Karatsuba multiplication with the FNT as the
+ * base case. Returns a pointer to the result or NULL in case of failure
+ * (malloc error). Conditions: ulen >= vlen, ulen >= 4.
+ */
+static mpd_uint_t *
+_mpd_kmul_fnt(const mpd_uint_t *u, const mpd_uint_t *v,
+ mpd_size_t ulen, mpd_size_t vlen,
+ mpd_size_t *rsize)
+{
+ mpd_uint_t *result = NULL, *w = NULL;
+ mpd_size_t m;
+
+ assert(ulen >= 4);
+ assert(ulen >= vlen);
+
+ *rsize = _kmul_resultsize(ulen, vlen);
+ if ((result = mpd_calloc(*rsize, sizeof *result)) == NULL) {
+ return NULL;
+ }
+
+ m = _kmul_worksize(ulen, 3*(MPD_MAXTRANSFORM_2N/2));
+ if (m && ((w = mpd_calloc(m, sizeof *w)) == NULL)) {
+ mpd_free(result); /* GCOV_UNLIKELY */
+ return NULL; /* GCOV_UNLIKELY */
+ }
+
+ if (!_karatsuba_rec_fnt(result, u, v, w, ulen, vlen)) {
+ mpd_free(result);
+ result = NULL;
+ }
+
+
+ if (w) mpd_free(w);
+ return result;
+}
+
+
+/* Deal with the special cases of multiplying infinities. */
+static void
+_mpd_qmul_inf(mpd_t *result, const mpd_t *a, const mpd_t *b, uint32_t *status)
+{
+ if (mpd_isinfinite(a)) {
+ if (mpd_iszero(b)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+ else {
+ mpd_setspecial(result, mpd_sign(a)^mpd_sign(b), MPD_INF);
+ }
+ return;
+ }
+ assert(mpd_isinfinite(b));
+ if (mpd_iszero(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+ else {
+ mpd_setspecial(result, mpd_sign(a)^mpd_sign(b), MPD_INF);
+ }
+}
+
+/*
+ * Internal function: Multiply a and b. _mpd_qmul deals with specials but
+ * does NOT finalize the result. This is for use in mpd_fma().
+ */
+static inline void
+_mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ const mpd_t *big = a, *small = b;
+ mpd_uint_t *rdata = NULL;
+ mpd_uint_t rbuf[MPD_MINALLOC_MAX];
+ mpd_size_t rsize, i;
+
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ _mpd_qmul_inf(result, a, b, status);
+ return;
+ }
+
+ if (small->len > big->len) {
+ _mpd_ptrswap(&big, &small);
+ }
+
+ rsize = big->len + small->len;
+
+ if (big->len == 1) {
+ _mpd_singlemul(result->data, big->data[0], small->data[0]);
+ goto finish;
+ }
+ if (rsize <= (mpd_size_t)MPD_MINALLOC_MAX) {
+ if (big->len == 2) {
+ _mpd_mul_2_le2(rbuf, big->data, small->data, small->len);
+ }
+ else {
+ mpd_uint_zero(rbuf, rsize);
+ if (small->len == 1) {
+ _mpd_shortmul(rbuf, big->data, big->len, small->data[0]);
+ }
+ else {
+ _mpd_basemul(rbuf, small->data, big->data, small->len, big->len);
+ }
+ }
+ if (!mpd_qresize(result, rsize, status)) {
+ return;
+ }
+ for(i = 0; i < rsize; i++) {
+ result->data[i] = rbuf[i];
+ }
+ goto finish;
+ }
+
+
+ if (small->len <= 256) {
+ rdata = mpd_calloc(rsize, sizeof *rdata);
+ if (rdata != NULL) {
+ if (small->len == 1) {
+ _mpd_shortmul(rdata, big->data, big->len, small->data[0]);
+ }
+ else {
+ _mpd_basemul(rdata, small->data, big->data, small->len, big->len);
+ }
+ }
+ }
+ else if (rsize <= 1024) {
+ rdata = _mpd_kmul(big->data, small->data, big->len, small->len, &rsize);
+ }
+ else if (rsize <= 3*MPD_MAXTRANSFORM_2N) {
+ rdata = _mpd_fntmul(big->data, small->data, big->len, small->len, &rsize);
+ }
+ else {
+ rdata = _mpd_kmul_fnt(big->data, small->data, big->len, small->len, &rsize);
+ }
+
+ if (rdata == NULL) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+
+ if (mpd_isdynamic_data(result)) {
+ mpd_free(result->data);
+ }
+ result->data = rdata;
+ result->alloc = rsize;
+ mpd_set_dynamic_data(result);
+
+
+finish:
+ mpd_set_flags(result, mpd_sign(a)^mpd_sign(b));
+ result->exp = big->exp + small->exp;
+ result->len = _mpd_real_size(result->data, rsize);
+ /* resize to smaller cannot fail */
+ mpd_qresize(result, result->len, status);
+ mpd_setdigits(result);
+}
+
+/* Multiply a and b. */
+void
+mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ _mpd_qmul(result, a, b, ctx, status);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* Multiply a and b. Set NaN/Invalid_operation if the result is inexact. */
+static void
+_mpd_qmul_exact(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+
+ mpd_qmul(result, a, b, ctx, &workstatus);
+ *status |= workstatus;
+ if (workstatus & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+}
+
+/* Multiply decimal and mpd_ssize_t. */
+void
+mpd_qmul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_ssize(&bb, b, &maxcontext, status);
+ mpd_qmul(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Multiply decimal and mpd_uint_t. */
+void
+mpd_qmul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qsset_uint(&bb, b, &maxcontext, status);
+ mpd_qmul(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+void
+mpd_qmul_i32(mpd_t *result, const mpd_t *a, int32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qmul_ssize(result, a, b, ctx, status);
+}
+
+void
+mpd_qmul_u32(mpd_t *result, const mpd_t *a, uint32_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qmul_uint(result, a, b, ctx, status);
+}
+
+#ifdef CONFIG_64
+void
+mpd_qmul_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qmul_ssize(result, a, b, ctx, status);
+}
+
+void
+mpd_qmul_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_qmul_uint(result, a, b, ctx, status);
+}
+#elif !defined(LEGACY_COMPILER)
+/* Multiply decimal and int64_t. */
+void
+mpd_qmul_i64(mpd_t *result, const mpd_t *a, int64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_i64(&bb, b, &maxcontext, status);
+ mpd_qmul(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+
+/* Multiply decimal and uint64_t. */
+void
+mpd_qmul_u64(mpd_t *result, const mpd_t *a, uint64_t b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(bb,0,0,0,0);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_qset_u64(&bb, b, &maxcontext, status);
+ mpd_qmul(result, a, &bb, ctx, status);
+ mpd_del(&bb);
+}
+#endif
+
+/* Like the minus operator. */
+void
+mpd_qminus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ }
+
+ if (mpd_iszero(a) && ctx->round != MPD_ROUND_FLOOR) {
+ mpd_qcopy_abs(result, a, status);
+ }
+ else {
+ mpd_qcopy_negate(result, a, status);
+ }
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* Like the plus operator. */
+void
+mpd_qplus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ }
+
+ if (mpd_iszero(a) && ctx->round != MPD_ROUND_FLOOR) {
+ mpd_qcopy_abs(result, a, status);
+ }
+ else {
+ mpd_qcopy(result, a, status);
+ }
+
+ mpd_qfinalize(result, ctx, status);
+}
+
+/* The largest representable number that is smaller than the operand. */
+void
+mpd_qnext_minus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_CONST(tiny,MPD_POS,mpd_etiny(ctx)-1,1,1,1,1);
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+
+ assert(mpd_isinfinite(a));
+ if (mpd_isnegative(a)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+ else {
+ mpd_clear_flags(result);
+ mpd_qmaxcoeff(result, ctx, status);
+ if (mpd_isnan(result)) {
+ return;
+ }
+ result->exp = mpd_etop(ctx);
+ return;
+ }
+ }
+
+ mpd_workcontext(&workctx, ctx);
+ workctx.round = MPD_ROUND_FLOOR;
+
+ if (!mpd_qcopy(result, a, status)) {
+ return;
+ }
+
+ mpd_qfinalize(result, &workctx, &workctx.status);
+ if (workctx.status&(MPD_Inexact|MPD_Errors)) {
+ *status |= (workctx.status&MPD_Errors);
+ return;
+ }
+
+ workctx.status = 0;
+ mpd_qsub(result, a, &tiny, &workctx, &workctx.status);
+ *status |= (workctx.status&MPD_Errors);
+}
+
+/* The smallest representable number that is larger than the operand. */
+void
+mpd_qnext_plus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_CONST(tiny,MPD_POS,mpd_etiny(ctx)-1,1,1,1,1);
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+
+ assert(mpd_isinfinite(a));
+ if (mpd_ispositive(a)) {
+ mpd_qcopy(result, a, status);
+ }
+ else {
+ mpd_clear_flags(result);
+ mpd_qmaxcoeff(result, ctx, status);
+ if (mpd_isnan(result)) {
+ return;
+ }
+ mpd_set_flags(result, MPD_NEG);
+ result->exp = mpd_etop(ctx);
+ }
+ return;
+ }
+
+ mpd_workcontext(&workctx, ctx);
+ workctx.round = MPD_ROUND_CEILING;
+
+ if (!mpd_qcopy(result, a, status)) {
+ return;
+ }
+
+ mpd_qfinalize(result, &workctx, &workctx.status);
+ if (workctx.status & (MPD_Inexact|MPD_Errors)) {
+ *status |= (workctx.status&MPD_Errors);
+ return;
+ }
+
+ workctx.status = 0;
+ mpd_qadd(result, a, &tiny, &workctx, &workctx.status);
+ *status |= (workctx.status&MPD_Errors);
+}
+
+/*
+ * The number closest to the first operand that is in the direction towards
+ * the second operand.
+ */
+void
+mpd_qnext_toward(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ int c;
+
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+
+ c = _mpd_cmp(a, b);
+ if (c == 0) {
+ mpd_qcopy_sign(result, a, b, status);
+ return;
+ }
+
+ if (c < 0) {
+ mpd_qnext_plus(result, a, ctx, status);
+ }
+ else {
+ mpd_qnext_minus(result, a, ctx, status);
+ }
+
+ if (mpd_isinfinite(result)) {
+ *status |= (MPD_Overflow|MPD_Rounded|MPD_Inexact);
+ }
+ else if (mpd_adjexp(result) < ctx->emin) {
+ *status |= (MPD_Underflow|MPD_Subnormal|MPD_Rounded|MPD_Inexact);
+ if (mpd_iszero(result)) {
+ *status |= MPD_Clamped;
+ }
+ }
+}
+
+/*
+ * Internal function: Integer power with mpd_uint_t exponent. The function
+ * can fail with MPD_Malloc_error.
+ *
+ * The error is equal to the error incurred in k-1 multiplications. Assuming
+ * the upper bound for the relative error in each operation:
+ *
+ * abs(err) = 5 * 10**-prec
+ * result = x**k * (1 + err)**(k-1)
+ */
+static inline void
+_mpd_qpow_uint(mpd_t *result, const mpd_t *base, mpd_uint_t exp,
+ uint8_t resultsign, const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_uint_t n;
+
+ if (exp == 0) {
+ _settriple(result, resultsign, 1, 0); /* GCOV_NOT_REACHED */
+ return; /* GCOV_NOT_REACHED */
+ }
+
+ if (!mpd_qcopy(result, base, status)) {
+ return;
+ }
+
+ n = mpd_bits[mpd_bsr(exp)];
+ while (n >>= 1) {
+ mpd_qmul(result, result, result, ctx, &workstatus);
+ if (exp & n) {
+ mpd_qmul(result, result, base, ctx, &workstatus);
+ }
+ if (mpd_isspecial(result) ||
+ (mpd_iszerocoeff(result) && (workstatus & MPD_Clamped))) {
+ break;
+ }
+ }
+
+ *status |= workstatus;
+ mpd_set_sign(result, resultsign);
+}
+
+/*
+ * Internal function: Integer power with mpd_t exponent, tbase and texp
+ * are modified!! Function can fail with MPD_Malloc_error.
+ *
+ * The error is equal to the error incurred in k multiplications. Assuming
+ * the upper bound for the relative error in each operation:
+ *
+ * abs(err) = 5 * 10**-prec
+ * result = x**k * (1 + err)**k
+ */
+static inline void
+_mpd_qpow_mpd(mpd_t *result, mpd_t *tbase, mpd_t *texp, uint8_t resultsign,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_context_t maxctx;
+ MPD_NEW_CONST(two,0,0,1,1,1,2);
+
+
+ mpd_maxcontext(&maxctx);
+
+ /* resize to smaller cannot fail */
+ mpd_qcopy(result, &one, status);
+
+ while (!mpd_iszero(texp)) {
+ if (mpd_isodd(texp)) {
+ mpd_qmul(result, result, tbase, ctx, &workstatus);
+ *status |= workstatus;
+ if (mpd_isspecial(result) ||
+ (mpd_iszerocoeff(result) && (workstatus & MPD_Clamped))) {
+ break;
+ }
+ }
+ mpd_qmul(tbase, tbase, tbase, ctx, &workstatus);
+ mpd_qdivint(texp, texp, &two, &maxctx, &workstatus);
+ if (mpd_isnan(tbase) || mpd_isnan(texp)) {
+ mpd_seterror(result, workstatus&MPD_Errors, status);
+ return;
+ }
+ }
+ mpd_set_sign(result, resultsign);
+}
+
+/*
+ * The power function for integer exponents. Relative error _before_ the
+ * final rounding to prec:
+ * abs(result - base**exp) < 0.1 * 10**-prec * abs(base**exp)
+ */
+static void
+_mpd_qpow_int(mpd_t *result, const mpd_t *base, const mpd_t *exp,
+ uint8_t resultsign,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_STATIC(tbase,0,0,0,0);
+ MPD_NEW_STATIC(texp,0,0,0,0);
+ mpd_uint_t n;
+
+
+ mpd_workcontext(&workctx, ctx);
+ workctx.prec += (exp->digits + exp->exp + 2);
+ workctx.round = MPD_ROUND_HALF_EVEN;
+ workctx.clamp = 0;
+ if (mpd_isnegative(exp)) {
+ uint32_t workstatus = 0;
+ workctx.prec += 1;
+ mpd_qdiv(&tbase, &one, base, &workctx, &workstatus);
+ *status |= workstatus;
+ if (workstatus&MPD_Errors) {
+ mpd_setspecial(result, MPD_POS, MPD_NAN);
+ goto finish;
+ }
+ }
+ else {
+ if (!mpd_qcopy(&tbase, base, status)) {
+ mpd_setspecial(result, MPD_POS, MPD_NAN);
+ goto finish;
+ }
+ }
+
+ n = mpd_qabs_uint(exp, &workctx.status);
+ if (workctx.status&MPD_Invalid_operation) {
+ if (!mpd_qcopy(&texp, exp, status)) {
+ mpd_setspecial(result, MPD_POS, MPD_NAN); /* GCOV_UNLIKELY */
+ goto finish; /* GCOV_UNLIKELY */
+ }
+ _mpd_qpow_mpd(result, &tbase, &texp, resultsign, &workctx, status);
+ }
+ else {
+ _mpd_qpow_uint(result, &tbase, n, resultsign, &workctx, status);
+ }
+
+ if (mpd_isinfinite(result)) {
+ /* for ROUND_DOWN, ROUND_FLOOR, etc. */
+ _settriple(result, resultsign, 1, MPD_EXP_INF);
+ }
+
+finish:
+ mpd_del(&tbase);
+ mpd_del(&texp);
+ mpd_qfinalize(result, ctx, status);
+}
+
+/*
+ * If the exponent is infinite and base equals one, the result is one
+ * with a coefficient of length prec. Otherwise, result is undefined.
+ * Return the value of the comparison against one.
+ */
+static int
+_qcheck_pow_one_inf(mpd_t *result, const mpd_t *base, uint8_t resultsign,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t shift;
+ int cmp;
+
+ if ((cmp = _mpd_cmp(base, &one)) == 0) {
+ shift = ctx->prec-1;
+ mpd_qshiftl(result, &one, shift, status);
+ result->exp = -shift;
+ mpd_set_flags(result, resultsign);
+ *status |= (MPD_Inexact|MPD_Rounded);
+ }
+
+ return cmp;
+}
+
+/*
+ * If abs(base) equals one, calculate the correct power of one result.
+ * Otherwise, result is undefined. Return the value of the comparison
+ * against 1.
+ *
+ * This is an internal function that does not check for specials.
+ */
+static int
+_qcheck_pow_one(mpd_t *result, const mpd_t *base, const mpd_t *exp,
+ uint8_t resultsign,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_ssize_t shift;
+ int cmp;
+
+ if ((cmp = _mpd_cmp_abs(base, &one)) == 0) {
+ if (_mpd_isint(exp)) {
+ if (mpd_isnegative(exp)) {
+ _settriple(result, resultsign, 1, 0);
+ return 0;
+ }
+ /* 1.000**3 = 1.000000000 */
+ mpd_qmul_ssize(result, exp, -base->exp, ctx, &workstatus);
+ if (workstatus&MPD_Errors) {
+ *status |= (workstatus&MPD_Errors);
+ return 0;
+ }
+ /* digits-1 after exponentiation */
+ shift = mpd_qget_ssize(result, &workstatus);
+ /* shift is MPD_SSIZE_MAX if result is too large */
+ if (shift > ctx->prec-1) {
+ shift = ctx->prec-1;
+ *status |= MPD_Rounded;
+ }
+ }
+ else if (mpd_ispositive(base)) {
+ shift = ctx->prec-1;
+ *status |= (MPD_Inexact|MPD_Rounded);
+ }
+ else {
+ return -2; /* GCOV_NOT_REACHED */
+ }
+ if (!mpd_qshiftl(result, &one, shift, status)) {
+ return 0;
+ }
+ result->exp = -shift;
+ mpd_set_flags(result, resultsign);
+ }
+
+ return cmp;
+}
+
+/*
+ * Detect certain over/underflow of x**y.
+ * ACL2 proof: pow-bounds.lisp.
+ *
+ * Symbols:
+ *
+ * e: EXP_INF or EXP_CLAMP
+ * x: base
+ * y: exponent
+ *
+ * omega(e) = log10(abs(e))
+ * zeta(x) = log10(abs(log10(x)))
+ * theta(y) = log10(abs(y))
+ *
+ * Upper and lower bounds:
+ *
+ * ub_omega(e) = ceil(log10(abs(e)))
+ * lb_theta(y) = floor(log10(abs(y)))
+ *
+ * | floor(log10(floor(abs(log10(x))))) if x < 1/10 or x >= 10
+ * lb_zeta(x) = | floor(log10(abs(x-1)/10)) if 1/10 <= x < 1
+ * | floor(log10(abs((x-1)/100))) if 1 < x < 10
+ *
+ * ub_omega(e) and lb_theta(y) are obviously upper and lower bounds
+ * for omega(e) and theta(y).
+ *
+ * lb_zeta is a lower bound for zeta(x):
+ *
+ * x < 1/10 or x >= 10:
+ *
+ * abs(log10(x)) >= 1, so the outer log10 is well defined. Since log10
+ * is strictly increasing, the end result is a lower bound.
+ *
+ * 1/10 <= x < 1:
+ *
+ * We use: log10(x) <= (x-1)/log(10)
+ * abs(log10(x)) >= abs(x-1)/log(10)
+ * abs(log10(x)) >= abs(x-1)/10
+ *
+ * 1 < x < 10:
+ *
+ * We use: (x-1)/(x*log(10)) < log10(x)
+ * abs((x-1)/100) < abs(log10(x))
+ *
+ * XXX: abs((x-1)/10) would work, need ACL2 proof.
+ *
+ *
+ * Let (0 < x < 1 and y < 0) or (x > 1 and y > 0). (H1)
+ * Let ub_omega(exp_inf) < lb_zeta(x) + lb_theta(y) (H2)
+ *
+ * Then:
+ * log10(abs(exp_inf)) < log10(abs(log10(x))) + log10(abs(y)). (1)
+ * exp_inf < log10(x) * y (2)
+ * 10**exp_inf < x**y (3)
+ *
+ * Let (0 < x < 1 and y > 0) or (x > 1 and y < 0). (H3)
+ * Let ub_omega(exp_clamp) < lb_zeta(x) + lb_theta(y) (H4)
+ *
+ * Then:
+ * log10(abs(exp_clamp)) < log10(abs(log10(x))) + log10(abs(y)). (4)
+ * log10(x) * y < exp_clamp (5)
+ * x**y < 10**exp_clamp (6)
+ *
+ */
+static mpd_ssize_t
+_lower_bound_zeta(const mpd_t *x, uint32_t *status)
+{
+ mpd_context_t maxctx;
+ MPD_NEW_STATIC(scratch,0,0,0,0);
+ mpd_ssize_t t, u;
+
+ t = mpd_adjexp(x);
+ if (t > 0) {
+ /* x >= 10 -> floor(log10(floor(abs(log10(x))))) */
+ return mpd_exp_digits(t) - 1;
+ }
+ else if (t < -1) {
+ /* x < 1/10 -> floor(log10(floor(abs(log10(x))))) */
+ return mpd_exp_digits(t+1) - 1;
+ }
+ else {
+ mpd_maxcontext(&maxctx);
+ mpd_qsub(&scratch, x, &one, &maxctx, status);
+ if (mpd_isspecial(&scratch)) {
+ mpd_del(&scratch);
+ return MPD_SSIZE_MAX;
+ }
+ u = mpd_adjexp(&scratch);
+ mpd_del(&scratch);
+
+ /* t == -1, 1/10 <= x < 1 -> floor(log10(abs(x-1)/10))
+ * t == 0, 1 < x < 10 -> floor(log10(abs(x-1)/100)) */
+ return (t == 0) ? u-2 : u-1;
+ }
+}
+
+/*
+ * Detect cases of certain overflow/underflow in the power function.
+ * Assumptions: x != 1, y != 0. The proof above is for positive x.
+ * If x is negative and y is an odd integer, x**y == -(abs(x)**y),
+ * so the analysis does not change.
+ */
+static int
+_qcheck_pow_bounds(mpd_t *result, const mpd_t *x, const mpd_t *y,
+ uint8_t resultsign,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ MPD_NEW_SHARED(abs_x, x);
+ mpd_ssize_t ub_omega, lb_zeta, lb_theta;
+ uint8_t sign;
+
+ mpd_set_positive(&abs_x);
+
+ lb_theta = mpd_adjexp(y);
+ lb_zeta = _lower_bound_zeta(&abs_x, status);
+ if (lb_zeta == MPD_SSIZE_MAX) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return 1;
+ }
+
+ sign = (mpd_adjexp(&abs_x) < 0) ^ mpd_sign(y);
+ if (sign == 0) {
+ /* (0 < |x| < 1 and y < 0) or (|x| > 1 and y > 0) */
+ ub_omega = mpd_exp_digits(ctx->emax);
+ if (ub_omega < lb_zeta + lb_theta) {
+ _settriple(result, resultsign, 1, MPD_EXP_INF);
+ mpd_qfinalize(result, ctx, status);
+ return 1;
+ }
+ }
+ else {
+ /* (0 < |x| < 1 and y > 0) or (|x| > 1 and y < 0). */
+ ub_omega = mpd_exp_digits(mpd_etiny(ctx));
+ if (ub_omega < lb_zeta + lb_theta) {
+ _settriple(result, resultsign, 1, mpd_etiny(ctx)-1);
+ mpd_qfinalize(result, ctx, status);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * TODO: Implement algorithm for computing exact powers from decimal.py.
+ * In order to prevent infinite loops, this has to be called before
+ * using Ziv's strategy for correct rounding.
+ */
+/*
+static int
+_mpd_qpow_exact(mpd_t *result, const mpd_t *base, const mpd_t *exp,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ return 0;
+}
+*/
+
+/*
+ * The power function for real exponents.
+ * Relative error: abs(result - e**y) < e**y * 1/5 * 10**(-prec - 1)
+ */
+static void
+_mpd_qpow_real(mpd_t *result, const mpd_t *base, const mpd_t *exp,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_STATIC(texp,0,0,0,0);
+
+ if (!mpd_qcopy(&texp, exp, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+
+ mpd_maxcontext(&workctx);
+ workctx.prec = (base->digits > ctx->prec) ? base->digits : ctx->prec;
+ workctx.prec += (4 + MPD_EXPDIGITS);
+ workctx.round = MPD_ROUND_HALF_EVEN;
+ workctx.allcr = ctx->allcr;
+
+ /*
+ * extra := MPD_EXPDIGITS = MPD_EXP_MAX_T
+ * wp := prec + 4 + extra
+ * abs(err) < 5 * 10**-wp
+ * y := log(base) * exp
+ * Calculate:
+ * 1) e**(y * (1 + err)**2) * (1 + err)
+ * = e**y * e**(y * (2*err + err**2)) * (1 + err)
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ * Relative error of the underlined term:
+ * 2) abs(e**(y * (2*err + err**2)) - 1)
+ * Case abs(y) >= 10**extra:
+ * 3) adjexp(y)+1 > log10(abs(y)) >= extra
+ * This triggers the Overflow/Underflow shortcut in _mpd_qexp(),
+ * so no further analysis is necessary.
+ * Case abs(y) < 10**extra:
+ * 4) abs(y * (2*err + err**2)) < 1/5 * 10**(-prec - 2)
+ * Use (see _mpd_qexp):
+ * 5) abs(x) <= 9/10 * 10**-p ==> abs(e**x - 1) < 10**-p
+ * With 2), 4) and 5):
+ * 6) abs(e**(y * (2*err + err**2)) - 1) < 10**(-prec - 2)
+ * The complete relative error of 1) is:
+ * 7) abs(result - e**y) < e**y * 1/5 * 10**(-prec - 1)
+ */
+ mpd_qln(result, base, &workctx, &workctx.status);
+ mpd_qmul(result, result, &texp, &workctx, &workctx.status);
+ mpd_qexp(result, result, &workctx, status);
+
+ mpd_del(&texp);
+ *status |= (workctx.status&MPD_Errors);
+ *status |= (MPD_Inexact|MPD_Rounded);
+}
+
+/* The power function: base**exp */
+void
+mpd_qpow(mpd_t *result, const mpd_t *base, const mpd_t *exp,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint8_t resultsign = 0;
+ int intexp = 0;
+ int cmp;
+
+ if (mpd_isspecial(base) || mpd_isspecial(exp)) {
+ if (mpd_qcheck_nans(result, base, exp, ctx, status)) {
+ return;
+ }
+ }
+ if (mpd_isinteger(exp)) {
+ intexp = 1;
+ resultsign = mpd_isnegative(base) && mpd_isodd(exp);
+ }
+
+ if (mpd_iszero(base)) {
+ if (mpd_iszero(exp)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ }
+ else if (mpd_isnegative(exp)) {
+ mpd_setspecial(result, resultsign, MPD_INF);
+ }
+ else {
+ _settriple(result, resultsign, 0, 0);
+ }
+ return;
+ }
+ if (mpd_isnegative(base)) {
+ if (!intexp || mpd_isinfinite(exp)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ }
+ if (mpd_isinfinite(exp)) {
+ /* power of one */
+ cmp = _qcheck_pow_one_inf(result, base, resultsign, ctx, status);
+ if (cmp == 0) {
+ return;
+ }
+ else {
+ cmp *= mpd_arith_sign(exp);
+ if (cmp < 0) {
+ _settriple(result, resultsign, 0, 0);
+ }
+ else {
+ mpd_setspecial(result, resultsign, MPD_INF);
+ }
+ }
+ return;
+ }
+ if (mpd_isinfinite(base)) {
+ if (mpd_iszero(exp)) {
+ _settriple(result, resultsign, 1, 0);
+ }
+ else if (mpd_isnegative(exp)) {
+ _settriple(result, resultsign, 0, 0);
+ }
+ else {
+ mpd_setspecial(result, resultsign, MPD_INF);
+ }
+ return;
+ }
+ if (mpd_iszero(exp)) {
+ _settriple(result, resultsign, 1, 0);
+ return;
+ }
+ if (_qcheck_pow_one(result, base, exp, resultsign, ctx, status) == 0) {
+ return;
+ }
+ if (_qcheck_pow_bounds(result, base, exp, resultsign, ctx, status)) {
+ return;
+ }
+
+ if (intexp) {
+ _mpd_qpow_int(result, base, exp, resultsign, ctx, status);
+ }
+ else {
+ _mpd_qpow_real(result, base, exp, ctx, status);
+ if (!mpd_isspecial(result) && _mpd_cmp(result, &one) == 0) {
+ mpd_ssize_t shift = ctx->prec-1;
+ mpd_qshiftl(result, &one, shift, status);
+ result->exp = -shift;
+ }
+ if (mpd_isinfinite(result)) {
+ /* for ROUND_DOWN, ROUND_FLOOR, etc. */
+ _settriple(result, MPD_POS, 1, MPD_EXP_INF);
+ }
+ mpd_qfinalize(result, ctx, status);
+ }
+}
+
+/*
+ * Internal function: Integer powmod with mpd_uint_t exponent, base is modified!
+ * Function can fail with MPD_Malloc_error.
+ */
+static inline void
+_mpd_qpowmod_uint(mpd_t *result, mpd_t *base, mpd_uint_t exp,
+ const mpd_t *mod, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+
+ mpd_maxcontext(&maxcontext);
+
+ /* resize to smaller cannot fail */
+ mpd_qcopy(result, &one, status);
+
+ while (exp > 0) {
+ if (exp & 1) {
+ _mpd_qmul_exact(result, result, base, &maxcontext, status);
+ mpd_qrem(result, result, mod, &maxcontext, status);
+ }
+ _mpd_qmul_exact(base, base, base, &maxcontext, status);
+ mpd_qrem(base, base, mod, &maxcontext, status);
+ exp >>= 1;
+ }
+}
+
+/* The powmod function: (base**exp) % mod */
+void
+mpd_qpowmod(mpd_t *result, const mpd_t *base, const mpd_t *exp,
+ const mpd_t *mod,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(tbase,0,0,0,0);
+ MPD_NEW_STATIC(texp,0,0,0,0);
+ MPD_NEW_STATIC(tmod,0,0,0,0);
+ MPD_NEW_STATIC(tmp,0,0,0,0);
+ MPD_NEW_CONST(two,0,0,1,1,1,2);
+ mpd_ssize_t tbase_exp, texp_exp;
+ mpd_ssize_t i;
+ mpd_t t;
+ mpd_uint_t r;
+ uint8_t sign;
+
+
+ if (mpd_isspecial(base) || mpd_isspecial(exp) || mpd_isspecial(mod)) {
+ if (mpd_qcheck_3nans(result, base, exp, mod, ctx, status)) {
+ return;
+ }
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+
+ if (!_mpd_isint(base) || !_mpd_isint(exp) || !_mpd_isint(mod)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_iszerocoeff(mod)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mod->digits+mod->exp > ctx->prec) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ sign = (mpd_isnegative(base)) && (mpd_isodd(exp));
+ if (mpd_iszerocoeff(exp)) {
+ if (mpd_iszerocoeff(base)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ r = (_mpd_cmp_abs(mod, &one)==0) ? 0 : 1;
+ _settriple(result, sign, r, 0);
+ return;
+ }
+ if (mpd_isnegative(exp)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_iszerocoeff(base)) {
+ _settriple(result, sign, 0, 0);
+ return;
+ }
+
+ mpd_maxcontext(&maxcontext);
+
+ mpd_qrescale(&tmod, mod, 0, &maxcontext, &maxcontext.status);
+ if (maxcontext.status&MPD_Errors) {
+ mpd_seterror(result, maxcontext.status&MPD_Errors, status);
+ goto out;
+ }
+ maxcontext.status = 0;
+ mpd_set_positive(&tmod);
+
+ mpd_qround_to_int(&tbase, base, &maxcontext, status);
+ mpd_set_positive(&tbase);
+ tbase_exp = tbase.exp;
+ tbase.exp = 0;
+
+ mpd_qround_to_int(&texp, exp, &maxcontext, status);
+ texp_exp = texp.exp;
+ texp.exp = 0;
+
+ /* base = (base.int % modulo * pow(10, base.exp, modulo)) % modulo */
+ mpd_qrem(&tbase, &tbase, &tmod, &maxcontext, status);
+ mpd_qshiftl(result, &one, tbase_exp, status);
+ mpd_qrem(result, result, &tmod, &maxcontext, status);
+ _mpd_qmul_exact(&tbase, &tbase, result, &maxcontext, status);
+ mpd_qrem(&tbase, &tbase, &tmod, &maxcontext, status);
+ if (mpd_isspecial(&tbase) ||
+ mpd_isspecial(&texp) ||
+ mpd_isspecial(&tmod)) {
+ goto mpd_errors;
+ }
+
+ for (i = 0; i < texp_exp; i++) {
+ _mpd_qpowmod_uint(&tmp, &tbase, 10, &tmod, status);
+ t = tmp;
+ tmp = tbase;
+ tbase = t;
+ }
+ if (mpd_isspecial(&tbase)) {
+ goto mpd_errors; /* GCOV_UNLIKELY */
+ }
+
+ /* resize to smaller cannot fail */
+ mpd_qcopy(result, &one, status);
+ while (mpd_isfinite(&texp) && !mpd_iszero(&texp)) {
+ if (mpd_isodd(&texp)) {
+ _mpd_qmul_exact(result, result, &tbase, &maxcontext, status);
+ mpd_qrem(result, result, &tmod, &maxcontext, status);
+ }
+ _mpd_qmul_exact(&tbase, &tbase, &tbase, &maxcontext, status);
+ mpd_qrem(&tbase, &tbase, &tmod, &maxcontext, status);
+ mpd_qdivint(&texp, &texp, &two, &maxcontext, status);
+ }
+ if (mpd_isspecial(&texp) || mpd_isspecial(&tbase) ||
+ mpd_isspecial(&tmod) || mpd_isspecial(result)) {
+ /* MPD_Malloc_error */
+ goto mpd_errors;
+ }
+ else {
+ mpd_set_sign(result, sign);
+ }
+
+out:
+ mpd_del(&tbase);
+ mpd_del(&texp);
+ mpd_del(&tmod);
+ mpd_del(&tmp);
+ return;
+
+mpd_errors:
+ mpd_setspecial(result, MPD_POS, MPD_NAN);
+ goto out;
+}
+
+void
+mpd_qquantize(mpd_t *result, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_ssize_t b_exp = b->exp;
+ mpd_ssize_t expdiff, shift;
+ mpd_uint_t rnd;
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(result, a, b, ctx, status)) {
+ return;
+ }
+ if (mpd_isinfinite(a) && mpd_isinfinite(b)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ if (b->exp > ctx->emax || b->exp < mpd_etiny(ctx)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ if (mpd_iszero(a)) {
+ _settriple(result, mpd_sign(a), 0, b->exp);
+ mpd_qfinalize(result, ctx, status);
+ return;
+ }
+
+
+ expdiff = a->exp - b->exp;
+ if (a->digits + expdiff > ctx->prec) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ if (expdiff >= 0) {
+ shift = expdiff;
+ if (!mpd_qshiftl(result, a, shift, status)) {
+ return;
+ }
+ result->exp = b_exp;
+ }
+ else {
+ /* At this point expdiff < 0 and a->digits+expdiff <= prec,
+ * so the shift before an increment will fit in prec. */
+ shift = -expdiff;
+ rnd = mpd_qshiftr(result, a, shift, status);
+ if (rnd == MPD_UINT_MAX) {
+ return;
+ }
+ result->exp = b_exp;
+ if (!_mpd_apply_round_fit(result, rnd, ctx, status)) {
+ return;
+ }
+ workstatus |= MPD_Rounded;
+ if (rnd) {
+ workstatus |= MPD_Inexact;
+ }
+ }
+
+ if (mpd_adjexp(result) > ctx->emax ||
+ mpd_adjexp(result) < mpd_etiny(ctx)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ *status |= workstatus;
+ mpd_qfinalize(result, ctx, status);
+}
+
+void
+mpd_qreduce(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_ssize_t shift, maxexp, maxshift;
+ uint8_t sign_a = mpd_sign(a);
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+ if (!mpd_qcopy(result, a, status)) {
+ return;
+ }
+ mpd_qfinalize(result, ctx, status);
+ if (mpd_isspecial(result)) {
+ return;
+ }
+ if (mpd_iszero(result)) {
+ _settriple(result, sign_a, 0, 0);
+ return;
+ }
+
+ shift = mpd_trail_zeros(result);
+ maxexp = (ctx->clamp) ? mpd_etop(ctx) : ctx->emax;
+ /* After the finalizing above result->exp <= maxexp. */
+ maxshift = maxexp - result->exp;
+ shift = (shift > maxshift) ? maxshift : shift;
+
+ mpd_qshiftr_inplace(result, shift);
+ result->exp += shift;
+}
+
+void
+mpd_qrem(mpd_t *r, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ MPD_NEW_STATIC(q,0,0,0,0);
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(r, a, b, ctx, status)) {
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ mpd_seterror(r, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isinfinite(b)) {
+ mpd_qcopy(r, a, status);
+ mpd_qfinalize(r, ctx, status);
+ return;
+ }
+ /* debug */
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ if (mpd_iszerocoeff(b)) {
+ if (mpd_iszerocoeff(a)) {
+ mpd_seterror(r, MPD_Division_undefined, status);
+ }
+ else {
+ mpd_seterror(r, MPD_Invalid_operation, status);
+ }
+ return;
+ }
+
+ _mpd_qdivmod(&q, r, a, b, ctx, status);
+ mpd_del(&q);
+ mpd_qfinalize(r, ctx, status);
+}
+
+void
+mpd_qrem_near(mpd_t *r, const mpd_t *a, const mpd_t *b,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_context_t workctx;
+ MPD_NEW_STATIC(btmp,0,0,0,0);
+ MPD_NEW_STATIC(q,0,0,0,0);
+ mpd_ssize_t expdiff, qdigits;
+ int cmp, isodd, allnine;
+
+ assert(r != NULL); /* annotation for scan-build */
+
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ if (mpd_qcheck_nans(r, a, b, ctx, status)) {
+ return;
+ }
+ if (mpd_isinfinite(a)) {
+ mpd_seterror(r, MPD_Invalid_operation, status);
+ return;
+ }
+ if (mpd_isinfinite(b)) {
+ mpd_qcopy(r, a, status);
+ mpd_qfinalize(r, ctx, status);
+ return;
+ }
+ /* debug */
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ if (mpd_iszerocoeff(b)) {
+ if (mpd_iszerocoeff(a)) {
+ mpd_seterror(r, MPD_Division_undefined, status);
+ }
+ else {
+ mpd_seterror(r, MPD_Invalid_operation, status);
+ }
+ return;
+ }
+
+ if (r == b) {
+ if (!mpd_qcopy(&btmp, b, status)) {
+ mpd_seterror(r, MPD_Malloc_error, status);
+ return;
+ }
+ b = &btmp;
+ }
+
+ _mpd_qdivmod(&q, r, a, b, ctx, status);
+ if (mpd_isnan(&q) || mpd_isnan(r)) {
+ goto finish;
+ }
+ if (mpd_iszerocoeff(r)) {
+ goto finish;
+ }
+
+ expdiff = mpd_adjexp(b) - mpd_adjexp(r);
+ if (-1 <= expdiff && expdiff <= 1) {
+
+ allnine = mpd_coeff_isallnine(&q);
+ qdigits = q.digits;
+ isodd = mpd_isodd(&q);
+
+ mpd_maxcontext(&workctx);
+ if (mpd_sign(a) == mpd_sign(b)) {
+ /* sign(r) == sign(b) */
+ _mpd_qsub(&q, r, b, &workctx, &workctx.status);
+ }
+ else {
+ /* sign(r) != sign(b) */
+ _mpd_qadd(&q, r, b, &workctx, &workctx.status);
+ }
+
+ if (workctx.status&MPD_Errors) {
+ mpd_seterror(r, workctx.status&MPD_Errors, status);
+ goto finish;
+ }
+
+ cmp = _mpd_cmp_abs(&q, r);
+ if (cmp < 0 || (cmp == 0 && isodd)) {
+ /* abs(r) > abs(b)/2 or abs(r) == abs(b)/2 and isodd(quotient) */
+ if (allnine && qdigits == ctx->prec) {
+ /* abs(quotient) + 1 == 10**prec */
+ mpd_seterror(r, MPD_Division_impossible, status);
+ goto finish;
+ }
+ mpd_qcopy(r, &q, status);
+ }
+ }
+
+
+finish:
+ mpd_del(&btmp);
+ mpd_del(&q);
+ mpd_qfinalize(r, ctx, status);
+}
+
+static void
+_mpd_qrescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t expdiff, shift;
+ mpd_uint_t rnd;
+
+ if (mpd_isspecial(a)) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+
+ if (mpd_iszero(a)) {
+ _settriple(result, mpd_sign(a), 0, exp);
+ return;
+ }
+
+ expdiff = a->exp - exp;
+ if (expdiff >= 0) {
+ shift = expdiff;
+ if (a->digits + shift > MPD_MAX_PREC+1) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ if (!mpd_qshiftl(result, a, shift, status)) {
+ return;
+ }
+ result->exp = exp;
+ }
+ else {
+ shift = -expdiff;
+ rnd = mpd_qshiftr(result, a, shift, status);
+ if (rnd == MPD_UINT_MAX) {
+ return;
+ }
+ result->exp = exp;
+ _mpd_apply_round_excess(result, rnd, ctx, status);
+ *status |= MPD_Rounded;
+ if (rnd) {
+ *status |= MPD_Inexact;
+ }
+ }
+
+ if (mpd_issubnormal(result, ctx)) {
+ *status |= MPD_Subnormal;
+ }
+}
+
+/*
+ * Rescale a number so that it has exponent 'exp'. Does not regard context
+ * precision, emax, emin, but uses the rounding mode. Special numbers are
+ * quietly copied. Restrictions:
+ *
+ * MPD_MIN_ETINY <= exp <= MPD_MAX_EMAX+1
+ * result->digits <= MPD_MAX_PREC+1
+ */
+void
+mpd_qrescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if (exp > MPD_MAX_EMAX+1 || exp < MPD_MIN_ETINY) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ _mpd_qrescale(result, a, exp, ctx, status);
+}
+
+/*
+ * Same as mpd_qrescale, but with relaxed restrictions. The result of this
+ * function should only be used for formatting a number and never as input
+ * for other operations.
+ *
+ * MPD_MIN_ETINY-MPD_MAX_PREC <= exp <= MPD_MAX_EMAX+1
+ * result->digits <= MPD_MAX_PREC+1
+ */
+void
+mpd_qrescale_fmt(mpd_t *result, const mpd_t *a, mpd_ssize_t exp,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ if (exp > MPD_MAX_EMAX+1 || exp < MPD_MIN_ETINY-MPD_MAX_PREC) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ _mpd_qrescale(result, a, exp, ctx, status);
+}
+
+/* Round to an integer according to 'action' and ctx->round. */
+enum {TO_INT_EXACT, TO_INT_SILENT, TO_INT_TRUNC};
+static void
+_mpd_qround_to_integral(int action, mpd_t *result, const mpd_t *a,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_uint_t rnd;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ mpd_qcopy(result, a, status);
+ return;
+ }
+ if (a->exp >= 0) {
+ mpd_qcopy(result, a, status);
+ return;
+ }
+ if (mpd_iszerocoeff(a)) {
+ _settriple(result, mpd_sign(a), 0, 0);
+ return;
+ }
+
+ rnd = mpd_qshiftr(result, a, -a->exp, status);
+ if (rnd == MPD_UINT_MAX) {
+ return;
+ }
+ result->exp = 0;
+
+ if (action == TO_INT_EXACT || action == TO_INT_SILENT) {
+ _mpd_apply_round_excess(result, rnd, ctx, status);
+ if (action == TO_INT_EXACT) {
+ *status |= MPD_Rounded;
+ if (rnd) {
+ *status |= MPD_Inexact;
+ }
+ }
+ }
+}
+
+void
+mpd_qround_to_intx(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ (void)_mpd_qround_to_integral(TO_INT_EXACT, result, a, ctx, status);
+}
+
+void
+mpd_qround_to_int(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ (void)_mpd_qround_to_integral(TO_INT_SILENT, result, a, ctx, status);
+}
+
+void
+mpd_qtrunc(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ if (mpd_isspecial(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ (void)_mpd_qround_to_integral(TO_INT_TRUNC, result, a, ctx, status);
+}
+
+void
+mpd_qfloor(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx = *ctx;
+
+ if (mpd_isspecial(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ workctx.round = MPD_ROUND_FLOOR;
+ (void)_mpd_qround_to_integral(TO_INT_SILENT, result, a,
+ &workctx, status);
+}
+
+void
+mpd_qceil(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx = *ctx;
+
+ if (mpd_isspecial(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ workctx.round = MPD_ROUND_CEILING;
+ (void)_mpd_qround_to_integral(TO_INT_SILENT, result, a,
+ &workctx, status);
+}
+
+int
+mpd_same_quantum(const mpd_t *a, const mpd_t *b)
+{
+ if (mpd_isspecial(a) || mpd_isspecial(b)) {
+ return ((mpd_isnan(a) && mpd_isnan(b)) ||
+ (mpd_isinfinite(a) && mpd_isinfinite(b)));
+ }
+
+ return a->exp == b->exp;
+}
+
+/* Schedule the increase in precision for the Newton iteration. */
+static inline int
+recpr_schedule_prec(mpd_ssize_t klist[MPD_MAX_PREC_LOG2],
+ mpd_ssize_t maxprec, mpd_ssize_t initprec)
+{
+ mpd_ssize_t k;
+ int i;
+
+ assert(maxprec > 0 && initprec > 0);
+ if (maxprec <= initprec) return -1;
+
+ i = 0; k = maxprec;
+ do {
+ k = (k+1) / 2;
+ klist[i++] = k;
+ } while (k > initprec);
+
+ return i-1;
+}
+
+/*
+ * Initial approximation for the reciprocal:
+ * k_0 := MPD_RDIGITS-2
+ * z_0 := 10**(-k_0) * floor(10**(2*k_0 + 2) / floor(v * 10**(k_0 + 2)))
+ * Absolute error:
+ * |1/v - z_0| < 10**(-k_0)
+ * ACL2 proof: maxerror-inverse-approx
+ */
+static void
+_mpd_qreciprocal_approx(mpd_t *z, const mpd_t *v, uint32_t *status)
+{
+ mpd_uint_t p10data[2] = {0, mpd_pow10[MPD_RDIGITS-2]};
+ mpd_uint_t dummy, word;
+ int n;
+
+ assert(v->exp == -v->digits);
+
+ _mpd_get_msdigits(&dummy, &word, v, MPD_RDIGITS);
+ n = mpd_word_digits(word);
+ word *= mpd_pow10[MPD_RDIGITS-n];
+
+ mpd_qresize(z, 2, status);
+ (void)_mpd_shortdiv(z->data, p10data, 2, word);
+
+ mpd_clear_flags(z);
+ z->exp = -(MPD_RDIGITS-2);
+ z->len = (z->data[1] == 0) ? 1 : 2;
+ mpd_setdigits(z);
+}
+
+/*
+ * Reciprocal, calculated with Newton's Method. Assumption: result != a.
+ * NOTE: The comments in the function show that certain operations are
+ * exact. The proof for the maximum error is too long to fit in here.
+ * ACL2 proof: maxerror-inverse-complete
+ */
+static void
+_mpd_qreciprocal(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t varcontext, maxcontext;
+ mpd_t *z = result; /* current approximation */
+ mpd_t *v; /* a, normalized to a number between 0.1 and 1 */
+ MPD_NEW_SHARED(vtmp, a); /* v shares data with a */
+ MPD_NEW_STATIC(s,0,0,0,0); /* temporary variable */
+ MPD_NEW_STATIC(t,0,0,0,0); /* temporary variable */
+ MPD_NEW_CONST(two,0,0,1,1,1,2); /* const 2 */
+ mpd_ssize_t klist[MPD_MAX_PREC_LOG2];
+ mpd_ssize_t adj, maxprec, initprec;
+ uint8_t sign = mpd_sign(a);
+ int i;
+
+ assert(result != a);
+
+ v = &vtmp;
+ mpd_clear_flags(v);
+ adj = v->digits + v->exp;
+ v->exp = -v->digits;
+
+ /* Initial approximation */
+ _mpd_qreciprocal_approx(z, v, status);
+
+ mpd_maxcontext(&varcontext);
+ mpd_maxcontext(&maxcontext);
+ varcontext.round = maxcontext.round = MPD_ROUND_TRUNC;
+ varcontext.emax = maxcontext.emax = MPD_MAX_EMAX + 100;
+ varcontext.emin = maxcontext.emin = MPD_MIN_EMIN - 100;
+ maxcontext.prec = MPD_MAX_PREC + 100;
+
+ maxprec = ctx->prec;
+ maxprec += 2;
+ initprec = MPD_RDIGITS-3;
+
+ i = recpr_schedule_prec(klist, maxprec, initprec);
+ for (; i >= 0; i--) {
+ /* Loop invariant: z->digits <= klist[i]+7 */
+ /* Let s := z**2, exact result */
+ _mpd_qmul_exact(&s, z, z, &maxcontext, status);
+ varcontext.prec = 2*klist[i] + 5;
+ if (v->digits > varcontext.prec) {
+ /* Let t := v, truncated to n >= 2*k+5 fraction digits */
+ mpd_qshiftr(&t, v, v->digits-varcontext.prec, status);
+ t.exp = -varcontext.prec;
+ /* Let t := trunc(v)*s, truncated to n >= 2*k+1 fraction digits */
+ mpd_qmul(&t, &t, &s, &varcontext, status);
+ }
+ else { /* v->digits <= 2*k+5 */
+ /* Let t := v*s, truncated to n >= 2*k+1 fraction digits */
+ mpd_qmul(&t, v, &s, &varcontext, status);
+ }
+ /* Let s := 2*z, exact result */
+ _mpd_qmul_exact(&s, z, &two, &maxcontext, status);
+ /* s.digits < t.digits <= 2*k+5, |adjexp(s)-adjexp(t)| <= 1,
+ * so the subtraction generates at most 2*k+6 <= klist[i+1]+7
+ * digits. The loop invariant is preserved. */
+ _mpd_qsub_exact(z, &s, &t, &maxcontext, status);
+ }
+
+ if (!mpd_isspecial(z)) {
+ z->exp -= adj;
+ mpd_set_flags(z, sign);
+ }
+
+ mpd_del(&s);
+ mpd_del(&t);
+ mpd_qfinalize(z, ctx, status);
+}
+
+/*
+ * Internal function for large numbers:
+ *
+ * q, r = divmod(coeff(a), coeff(b))
+ *
+ * Strategy: Multiply the dividend by the reciprocal of the divisor. The
+ * inexact result is fixed by a small loop, using at most one iteration.
+ *
+ * ACL2 proofs:
+ * ------------
+ * 1) q is a natural number. (ndivmod-quotient-natp)
+ * 2) r is a natural number. (ndivmod-remainder-natp)
+ * 3) a = q * b + r (ndivmod-q*b+r==a)
+ * 4) r < b (ndivmod-remainder-<-b)
+ */
+static void
+_mpd_base_ndivmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+ mpd_t *qq = q, *rr = r;
+ mpd_t aa, bb;
+ int k;
+
+ _mpd_copy_shared(&aa, a);
+ _mpd_copy_shared(&bb, b);
+
+ mpd_set_positive(&aa);
+ mpd_set_positive(&bb);
+ aa.exp = 0;
+ bb.exp = 0;
+
+ if (q == a || q == b) {
+ if ((qq = mpd_qnew()) == NULL) {
+ *status |= MPD_Malloc_error;
+ goto nanresult;
+ }
+ }
+ if (r == a || r == b) {
+ if ((rr = mpd_qnew()) == NULL) {
+ *status |= MPD_Malloc_error;
+ goto nanresult;
+ }
+ }
+
+ mpd_maxcontext(&workctx);
+
+ /* Let prec := adigits - bdigits + 4 */
+ workctx.prec = a->digits - b->digits + 1 + 3;
+ if (a->digits > MPD_MAX_PREC || workctx.prec > MPD_MAX_PREC) {
+ *status |= MPD_Division_impossible;
+ goto nanresult;
+ }
+
+ /* Let x := _mpd_qreciprocal(b, prec)
+ * Then x is bounded by:
+ * 1) 1/b - 10**(-prec - bdigits) < x < 1/b + 10**(-prec - bdigits)
+ * 2) 1/b - 10**(-adigits - 4) < x < 1/b + 10**(-adigits - 4)
+ */
+ _mpd_qreciprocal(rr, &bb, &workctx, &workctx.status);
+
+ /* Get an estimate for the quotient. Let q := a * x
+ * Then q is bounded by:
+ * 3) a/b - 10**-4 < q < a/b + 10**-4
+ */
+ _mpd_qmul(qq, &aa, rr, &workctx, &workctx.status);
+ /* Truncate q to an integer:
+ * 4) a/b - 2 < trunc(q) < a/b + 1
+ */
+ mpd_qtrunc(qq, qq, &workctx, &workctx.status);
+
+ workctx.prec = aa.digits + 3;
+ workctx.emax = MPD_MAX_EMAX + 3;
+ workctx.emin = MPD_MIN_EMIN - 3;
+ /* Multiply the estimate for q by b:
+ * 5) a - 2 * b < trunc(q) * b < a + b
+ */
+ _mpd_qmul(rr, &bb, qq, &workctx, &workctx.status);
+ /* Get the estimate for r such that a = q * b + r. */
+ _mpd_qsub_exact(rr, &aa, rr, &workctx, &workctx.status);
+
+ /* Fix the result. At this point -b < r < 2*b, so the correction loop
+ takes at most one iteration. */
+ for (k = 0;; k++) {
+ if (mpd_isspecial(qq) || mpd_isspecial(rr)) {
+ *status |= (workctx.status&MPD_Errors);
+ goto nanresult;
+ }
+ if (k > 2) { /* Allow two iterations despite the proof. */
+ mpd_err_warn("libmpdec: internal error in " /* GCOV_NOT_REACHED */
+ "_mpd_base_ndivmod: please report"); /* GCOV_NOT_REACHED */
+ *status |= MPD_Invalid_operation; /* GCOV_NOT_REACHED */
+ goto nanresult; /* GCOV_NOT_REACHED */
+ }
+ /* r < 0 */
+ else if (_mpd_cmp(&zero, rr) == 1) {
+ _mpd_qadd_exact(rr, rr, &bb, &workctx, &workctx.status);
+ _mpd_qadd_exact(qq, qq, &minus_one, &workctx, &workctx.status);
+ }
+ /* 0 <= r < b */
+ else if (_mpd_cmp(rr, &bb) == -1) {
+ break;
+ }
+ /* r >= b */
+ else {
+ _mpd_qsub_exact(rr, rr, &bb, &workctx, &workctx.status);
+ _mpd_qadd_exact(qq, qq, &one, &workctx, &workctx.status);
+ }
+ }
+
+ if (qq != q) {
+ if (!mpd_qcopy(q, qq, status)) {
+ goto nanresult; /* GCOV_UNLIKELY */
+ }
+ mpd_del(qq);
+ }
+ if (rr != r) {
+ if (!mpd_qcopy(r, rr, status)) {
+ goto nanresult; /* GCOV_UNLIKELY */
+ }
+ mpd_del(rr);
+ }
+
+ *status |= (workctx.status&MPD_Errors);
+ return;
+
+
+nanresult:
+ if (qq && qq != q) mpd_del(qq);
+ if (rr && rr != r) mpd_del(rr);
+ mpd_setspecial(q, MPD_POS, MPD_NAN);
+ mpd_setspecial(r, MPD_POS, MPD_NAN);
+}
+
+/* LIBMPDEC_ONLY */
+/*
+ * Schedule the optimal precision increase for the Newton iteration.
+ * v := input operand
+ * z_0 := initial approximation
+ * initprec := natural number such that abs(sqrt(v) - z_0) < 10**-initprec
+ * maxprec := target precision
+ *
+ * For convenience the output klist contains the elements in reverse order:
+ * klist := [k_n-1, ..., k_0], where
+ * 1) k_0 <= initprec and
+ * 2) abs(sqrt(v) - result) < 10**(-2*k_n-1 + 2) <= 10**-maxprec.
+ */
+static inline int
+invroot_schedule_prec(mpd_ssize_t klist[MPD_MAX_PREC_LOG2],
+ mpd_ssize_t maxprec, mpd_ssize_t initprec)
+{
+ mpd_ssize_t k;
+ int i;
+
+ assert(maxprec >= 3 && initprec >= 3);
+ if (maxprec <= initprec) return -1;
+
+ i = 0; k = maxprec;
+ do {
+ k = (k+3) / 2;
+ klist[i++] = k;
+ } while (k > initprec);
+
+ return i-1;
+}
+
+/*
+ * Initial approximation for the inverse square root function.
+ * Input:
+ * v := rational number, with 1 <= v < 100
+ * vhat := floor(v * 10**6)
+ * Output:
+ * z := approximation to 1/sqrt(v), such that abs(z - 1/sqrt(v)) < 10**-3.
+ */
+static inline void
+_invroot_init_approx(mpd_t *z, mpd_uint_t vhat)
+{
+ mpd_uint_t lo = 1000;
+ mpd_uint_t hi = 10000;
+ mpd_uint_t a, sq;
+
+ assert(lo*lo <= vhat && vhat < (hi+1)*(hi+1));
+
+ for(;;) {
+ a = (lo + hi) / 2;
+ sq = a * a;
+ if (vhat >= sq) {
+ if (vhat < sq + 2*a + 1) {
+ break;
+ }
+ lo = a + 1;
+ }
+ else {
+ hi = a - 1;
+ }
+ }
+
+ /*
+ * After the binary search we have:
+ * 1) a**2 <= floor(v * 10**6) < (a + 1)**2
+ * This implies:
+ * 2) a**2 <= v * 10**6 < (a + 1)**2
+ * 3) a <= sqrt(v) * 10**3 < a + 1
+ * Since 10**3 <= a:
+ * 4) 0 <= 10**prec/a - 1/sqrt(v) < 10**-prec
+ * We have:
+ * 5) 10**3/a - 10**-3 < floor(10**9/a) * 10**-6 <= 10**3/a
+ * Merging 4) and 5):
+ * 6) abs(floor(10**9/a) * 10**-6 - 1/sqrt(v)) < 10**-3
+ */
+ mpd_minalloc(z);
+ mpd_clear_flags(z);
+ z->data[0] = 1000000000UL / a;
+ z->len = 1;
+ z->exp = -6;
+ mpd_setdigits(z);
+}
+
+/*
+ * Set 'result' to 1/sqrt(a).
+ * Relative error: abs(result - 1/sqrt(a)) < 10**-prec * 1/sqrt(a)
+ */
+static void
+_mpd_qinvroot(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ uint32_t workstatus = 0;
+ mpd_context_t varcontext, maxcontext;
+ mpd_t *z = result; /* current approximation */
+ mpd_t *v; /* a, normalized to a number between 1 and 100 */
+ MPD_NEW_SHARED(vtmp, a); /* by default v will share data with a */
+ MPD_NEW_STATIC(s,0,0,0,0); /* temporary variable */
+ MPD_NEW_STATIC(t,0,0,0,0); /* temporary variable */
+ MPD_NEW_CONST(one_half,0,-1,1,1,1,5);
+ MPD_NEW_CONST(three,0,0,1,1,1,3);
+ mpd_ssize_t klist[MPD_MAX_PREC_LOG2];
+ mpd_ssize_t ideal_exp, shift;
+ mpd_ssize_t adj, tz;
+ mpd_ssize_t maxprec, fracdigits;
+ mpd_uint_t vhat, dummy;
+ int i, n;
+
+
+ ideal_exp = -(a->exp - (a->exp & 1)) / 2;
+
+ v = &vtmp;
+ if (result == a) {
+ if ((v = mpd_qncopy(a)) == NULL) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ }
+
+ /* normalize a to 1 <= v < 100 */
+ if ((v->digits+v->exp) & 1) {
+ fracdigits = v->digits - 1;
+ v->exp = -fracdigits;
+ n = (v->digits > 7) ? 7 : (int)v->digits;
+ /* Let vhat := floor(v * 10**(2*initprec)) */
+ _mpd_get_msdigits(&dummy, &vhat, v, n);
+ if (n < 7) {
+ vhat *= mpd_pow10[7-n];
+ }
+ }
+ else {
+ fracdigits = v->digits - 2;
+ v->exp = -fracdigits;
+ n = (v->digits > 8) ? 8 : (int)v->digits;
+ /* Let vhat := floor(v * 10**(2*initprec)) */
+ _mpd_get_msdigits(&dummy, &vhat, v, n);
+ if (n < 8) {
+ vhat *= mpd_pow10[8-n];
+ }
+ }
+ adj = (a->exp-v->exp) / 2;
+
+ /* initial approximation */
+ _invroot_init_approx(z, vhat);
+
+ mpd_maxcontext(&maxcontext);
+ mpd_maxcontext(&varcontext);
+ varcontext.round = MPD_ROUND_TRUNC;
+ maxprec = ctx->prec + 1;
+
+ /* initprec == 3 */
+ i = invroot_schedule_prec(klist, maxprec, 3);
+ for (; i >= 0; i--) {
+ varcontext.prec = 2*klist[i]+2;
+ mpd_qmul(&s, z, z, &maxcontext, &workstatus);
+ if (v->digits > varcontext.prec) {
+ shift = v->digits - varcontext.prec;
+ mpd_qshiftr(&t, v, shift, &workstatus);
+ t.exp += shift;
+ mpd_qmul(&t, &t, &s, &varcontext, &workstatus);
+ }
+ else {
+ mpd_qmul(&t, v, &s, &varcontext, &workstatus);
+ }
+ mpd_qsub(&t, &three, &t, &maxcontext, &workstatus);
+ mpd_qmul(z, z, &t, &varcontext, &workstatus);
+ mpd_qmul(z, z, &one_half, &maxcontext, &workstatus);
+ }
+
+ z->exp -= adj;
+
+ tz = mpd_trail_zeros(result);
+ shift = ideal_exp - result->exp;
+ shift = (tz > shift) ? shift : tz;
+ if (shift > 0) {
+ mpd_qshiftr_inplace(result, shift);
+ result->exp += shift;
+ }
+
+
+ mpd_del(&s);
+ mpd_del(&t);
+ if (v != &vtmp) mpd_del(v);
+ *status |= (workstatus&MPD_Errors);
+ *status |= (MPD_Rounded|MPD_Inexact);
+}
+
+void
+mpd_qinvroot(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t workctx;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ /* positive infinity */
+ _settriple(result, MPD_POS, 0, mpd_etiny(ctx));
+ *status |= MPD_Clamped;
+ return;
+ }
+ if (mpd_iszero(a)) {
+ mpd_setspecial(result, mpd_sign(a), MPD_INF);
+ *status |= MPD_Division_by_zero;
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ workctx = *ctx;
+ workctx.prec += 2;
+ workctx.round = MPD_ROUND_HALF_EVEN;
+ _mpd_qinvroot(result, a, &workctx, status);
+ mpd_qfinalize(result, ctx, status);
+}
+/* END LIBMPDEC_ONLY */
+
+/* Algorithm from decimal.py */
+static void
+_mpd_qsqrt(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ mpd_context_t maxcontext;
+ MPD_NEW_STATIC(c,0,0,0,0);
+ MPD_NEW_STATIC(q,0,0,0,0);
+ MPD_NEW_STATIC(r,0,0,0,0);
+ MPD_NEW_CONST(two,0,0,1,1,1,2);
+ mpd_ssize_t prec, ideal_exp;
+ mpd_ssize_t l, shift;
+ int exact = 0;
+
+
+ ideal_exp = (a->exp - (a->exp & 1)) / 2;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_qcheck_nan(result, a, ctx, status)) {
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+ mpd_setspecial(result, MPD_POS, MPD_INF);
+ return;
+ }
+ if (mpd_iszero(a)) {
+ _settriple(result, mpd_sign(a), 0, ideal_exp);
+ mpd_qfinalize(result, ctx, status);
+ return;
+ }
+ if (mpd_isnegative(a)) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ mpd_maxcontext(&maxcontext);
+ prec = ctx->prec + 1;
+
+ if (!mpd_qcopy(&c, a, status)) {
+ goto malloc_error;
+ }
+ c.exp = 0;
+
+ if (a->exp & 1) {
+ if (!mpd_qshiftl(&c, &c, 1, status)) {
+ goto malloc_error;
+ }
+ l = (a->digits >> 1) + 1;
+ }
+ else {
+ l = (a->digits + 1) >> 1;
+ }
+
+ shift = prec - l;
+ if (shift >= 0) {
+ if (!mpd_qshiftl(&c, &c, 2*shift, status)) {
+ goto malloc_error;
+ }
+ exact = 1;
+ }
+ else {
+ exact = !mpd_qshiftr_inplace(&c, -2*shift);
+ }
+
+ ideal_exp -= shift;
+
+ /* find result = floor(sqrt(c)) using Newton's method */
+ if (!mpd_qshiftl(result, &one, prec, status)) {
+ goto malloc_error;
+ }
+
+ while (1) {
+ _mpd_qdivmod(&q, &r, &c, result, &maxcontext, &maxcontext.status);
+ if (mpd_isspecial(result) || mpd_isspecial(&q)) {
+ mpd_seterror(result, maxcontext.status&MPD_Errors, status);
+ goto out;
+ }
+ if (_mpd_cmp(result, &q) <= 0) {
+ break;
+ }
+ _mpd_qadd_exact(result, result, &q, &maxcontext, &maxcontext.status);
+ if (mpd_isspecial(result)) {
+ mpd_seterror(result, maxcontext.status&MPD_Errors, status);
+ goto out;
+ }
+ _mpd_qdivmod(result, &r, result, &two, &maxcontext, &maxcontext.status);
+ }
+
+ if (exact) {
+ _mpd_qmul_exact(&r, result, result, &maxcontext, &maxcontext.status);
+ if (mpd_isspecial(&r)) {
+ mpd_seterror(result, maxcontext.status&MPD_Errors, status);
+ goto out;
+ }
+ exact = (_mpd_cmp(&r, &c) == 0);
+ }
+
+ if (exact) {
+ if (shift >= 0) {
+ mpd_qshiftr_inplace(result, shift);
+ }
+ else {
+ if (!mpd_qshiftl(result, result, -shift, status)) {
+ goto malloc_error;
+ }
+ }
+ ideal_exp += shift;
+ }
+ else {
+ int lsd = (int)mpd_lsd(result->data[0]);
+ if (lsd == 0 || lsd == 5) {
+ result->data[0] += 1;
+ }
+ }
+
+ result->exp = ideal_exp;
+
+
+out:
+ mpd_del(&c);
+ mpd_del(&q);
+ mpd_del(&r);
+ maxcontext = *ctx;
+ maxcontext.round = MPD_ROUND_HALF_EVEN;
+ mpd_qfinalize(result, &maxcontext, status);
+ return;
+
+malloc_error:
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto out;
+}
+
+void
+mpd_qsqrt(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx,
+ uint32_t *status)
+{
+ MPD_NEW_STATIC(aa,0,0,0,0);
+ uint32_t xstatus = 0;
+
+ if (result == a) {
+ if (!mpd_qcopy(&aa, a, status)) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ goto out;
+ }
+ a = &aa;
+ }
+
+ _mpd_qsqrt(result, a, ctx, &xstatus);
+
+ if (xstatus & (MPD_Malloc_error|MPD_Division_impossible)) {
+ /* The above conditions can occur at very high context precisions
+ * if intermediate values get too large. Retry the operation with
+ * a lower context precision in case the result is exact.
+ *
+ * If the result is exact, an upper bound for the number of digits
+ * is the number of digits in the input.
+ *
+ * NOTE: sqrt(40e9) = 2.0e+5 /\ digits(40e9) = digits(2.0e+5) = 2
+ */
+ uint32_t ystatus = 0;
+ mpd_context_t workctx = *ctx;
+
+ workctx.prec = a->digits;
+ if (workctx.prec >= ctx->prec) {
+ *status |= (xstatus|MPD_Errors);
+ goto out; /* No point in repeating this, keep the original error. */
+ }
+
+ _mpd_qsqrt(result, a, &workctx, &ystatus);
+ if (ystatus != 0) {
+ ystatus = *status | ((xstatus|ystatus)&MPD_Errors);
+ mpd_seterror(result, ystatus, status);
+ }
+ }
+ else {
+ *status |= xstatus;
+ }
+
+out:
+ mpd_del(&aa);
+}
+
+
+/******************************************************************************/
+/* Base conversions */
+/******************************************************************************/
+
+/* Space needed to represent an integer mpd_t in base 'base'. */
+size_t
+mpd_sizeinbase(const mpd_t *a, uint32_t base)
+{
+ double x;
+ size_t digits;
+ double upper_bound;
+
+ assert(mpd_isinteger(a));
+ assert(base >= 2);
+
+ if (mpd_iszero(a)) {
+ return 1;
+ }
+
+ digits = a->digits+a->exp;
+
+#ifdef CONFIG_64
+ /* ceil(2711437152599294 / log10(2)) + 4 == 2**53 */
+ if (digits > 2711437152599294ULL) {
+ return SIZE_MAX;
+ }
+
+ upper_bound = (double)((1ULL<<53)-1);
+#else
+ upper_bound = (double)(SIZE_MAX-1);
+#endif
+
+ x = (double)digits / log10(base);
+ return (x > upper_bound) ? SIZE_MAX : (size_t)x + 1;
+}
+
+/* Space needed to import a base 'base' integer of length 'srclen'. */
+static mpd_ssize_t
+_mpd_importsize(size_t srclen, uint32_t base)
+{
+ double x;
+ double upper_bound;
+
+ assert(srclen > 0);
+ assert(base >= 2);
+
+#if SIZE_MAX == UINT64_MAX
+ if (srclen > (1ULL<<53)) {
+ return MPD_SSIZE_MAX;
+ }
+
+ assert((1ULL<<53) <= MPD_MAXIMPORT);
+ upper_bound = (double)((1ULL<<53)-1);
+#else
+ upper_bound = MPD_MAXIMPORT-1;
+#endif
+
+ x = (double)srclen * (log10(base)/MPD_RDIGITS);
+ return (x > upper_bound) ? MPD_SSIZE_MAX : (mpd_ssize_t)x + 1;
+}
+
+static uint8_t
+mpd_resize_u16(uint16_t **w, size_t nmemb)
+{
+ uint8_t err = 0;
+ *w = mpd_realloc(*w, nmemb, sizeof **w, &err);
+ return !err;
+}
+
+static uint8_t
+mpd_resize_u32(uint32_t **w, size_t nmemb)
+{
+ uint8_t err = 0;
+ *w = mpd_realloc(*w, nmemb, sizeof **w, &err);
+ return !err;
+}
+
+static size_t
+_baseconv_to_u16(uint16_t **w, size_t wlen, mpd_uint_t wbase,
+ mpd_uint_t *u, mpd_ssize_t ulen)
+{
+ size_t n = 0;
+
+ assert(wlen > 0 && ulen > 0);
+ assert(wbase <= (1U<<16));
+
+ do {
+ if (n >= wlen) {
+ if (!mpd_resize_u16(w, n+1)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ (*w)[n++] = (uint16_t)_mpd_shortdiv(u, u, ulen, wbase);
+ /* ulen is at least 1. u[ulen-1] can only be zero if ulen == 1. */
+ ulen = _mpd_real_size(u, ulen);
+
+ } while (u[ulen-1] != 0);
+
+ return n;
+}
+
+static size_t
+_coeff_from_u16(mpd_t *w, mpd_ssize_t wlen,
+ const mpd_uint_t *u, size_t ulen, uint32_t ubase,
+ uint32_t *status)
+{
+ mpd_ssize_t n = 0;
+ mpd_uint_t carry;
+
+ assert(wlen > 0 && ulen > 0);
+ assert(ubase <= (1U<<16));
+
+ w->data[n++] = u[--ulen];
+ while (--ulen != SIZE_MAX) {
+ carry = _mpd_shortmul_c(w->data, w->data, n, ubase);
+ if (carry) {
+ if (n >= wlen) {
+ if (!mpd_qresize(w, n+1, status)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ w->data[n++] = carry;
+ }
+ carry = _mpd_shortadd(w->data, n, u[ulen]);
+ if (carry) {
+ if (n >= wlen) {
+ if (!mpd_qresize(w, n+1, status)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ w->data[n++] = carry;
+ }
+ }
+
+ return n;
+}
+
+/* target base wbase < source base ubase */
+static size_t
+_baseconv_to_smaller(uint32_t **w, size_t wlen, uint32_t wbase,
+ mpd_uint_t *u, mpd_ssize_t ulen, mpd_uint_t ubase)
+{
+ size_t n = 0;
+
+ assert(wlen > 0 && ulen > 0);
+ assert(wbase < ubase);
+
+ do {
+ if (n >= wlen) {
+ if (!mpd_resize_u32(w, n+1)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ (*w)[n++] = (uint32_t)_mpd_shortdiv_b(u, u, ulen, wbase, ubase);
+ /* ulen is at least 1. u[ulen-1] can only be zero if ulen == 1. */
+ ulen = _mpd_real_size(u, ulen);
+
+ } while (u[ulen-1] != 0);
+
+ return n;
+}
+
+#ifdef CONFIG_32
+/* target base 'wbase' == source base 'ubase' */
+static size_t
+_copy_equal_base(uint32_t **w, size_t wlen,
+ const uint32_t *u, size_t ulen)
+{
+ if (wlen < ulen) {
+ if (!mpd_resize_u32(w, ulen)) {
+ return SIZE_MAX;
+ }
+ }
+
+ memcpy(*w, u, ulen * (sizeof **w));
+ return ulen;
+}
+
+/* target base 'wbase' > source base 'ubase' */
+static size_t
+_baseconv_to_larger(uint32_t **w, size_t wlen, mpd_uint_t wbase,
+ const mpd_uint_t *u, size_t ulen, mpd_uint_t ubase)
+{
+ size_t n = 0;
+ mpd_uint_t carry;
+
+ assert(wlen > 0 && ulen > 0);
+ assert(ubase < wbase);
+
+ (*w)[n++] = u[--ulen];
+ while (--ulen != SIZE_MAX) {
+ carry = _mpd_shortmul_b(*w, *w, n, ubase, wbase);
+ if (carry) {
+ if (n >= wlen) {
+ if (!mpd_resize_u32(w, n+1)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ (*w)[n++] = carry;
+ }
+ carry = _mpd_shortadd_b(*w, n, u[ulen], wbase);
+ if (carry) {
+ if (n >= wlen) {
+ if (!mpd_resize_u32(w, n+1)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ (*w)[n++] = carry;
+ }
+ }
+
+ return n;
+}
+
+/* target base wbase < source base ubase */
+static size_t
+_coeff_from_larger_base(mpd_t *w, size_t wlen, mpd_uint_t wbase,
+ mpd_uint_t *u, mpd_ssize_t ulen, mpd_uint_t ubase,
+ uint32_t *status)
+{
+ size_t n = 0;
+
+ assert(wlen > 0 && ulen > 0);
+ assert(wbase < ubase);
+
+ do {
+ if (n >= wlen) {
+ if (!mpd_qresize(w, n+1, status)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ w->data[n++] = (uint32_t)_mpd_shortdiv_b(u, u, ulen, wbase, ubase);
+ /* ulen is at least 1. u[ulen-1] can only be zero if ulen == 1. */
+ ulen = _mpd_real_size(u, ulen);
+
+ } while (u[ulen-1] != 0);
+
+ return n;
+}
+#endif
+
+/* target base 'wbase' > source base 'ubase' */
+static size_t
+_coeff_from_smaller_base(mpd_t *w, mpd_ssize_t wlen, mpd_uint_t wbase,
+ const uint32_t *u, size_t ulen, mpd_uint_t ubase,
+ uint32_t *status)
+{
+ mpd_ssize_t n = 0;
+ mpd_uint_t carry;
+
+ assert(wlen > 0 && ulen > 0);
+ assert(wbase > ubase);
+
+ w->data[n++] = u[--ulen];
+ while (--ulen != SIZE_MAX) {
+ carry = _mpd_shortmul_b(w->data, w->data, n, ubase, wbase);
+ if (carry) {
+ if (n >= wlen) {
+ if (!mpd_qresize(w, n+1, status)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ w->data[n++] = carry;
+ }
+ carry = _mpd_shortadd_b(w->data, n, u[ulen], wbase);
+ if (carry) {
+ if (n >= wlen) {
+ if (!mpd_qresize(w, n+1, status)) {
+ return SIZE_MAX;
+ }
+ wlen = n+1;
+ }
+ w->data[n++] = carry;
+ }
+ }
+
+ return n;
+}
+
+/*
+ * Convert an integer mpd_t to a multiprecision integer with base <= 2**16.
+ * The least significant word of the result is (*rdata)[0].
+ *
+ * If rdata is NULL, space is allocated by the function and rlen is irrelevant.
+ * In case of an error any allocated storage is freed and rdata is set back to
+ * NULL.
+ *
+ * If rdata is non-NULL, it MUST be allocated by one of libmpdec's allocation
+ * functions and rlen MUST be correct. If necessary, the function will resize
+ * rdata. In case of an error the caller must free rdata.
+ *
+ * Return value: In case of success, the exact length of rdata, SIZE_MAX
+ * otherwise.
+ */
+size_t
+mpd_qexport_u16(uint16_t **rdata, size_t rlen, uint32_t rbase,
+ const mpd_t *src, uint32_t *status)
+{
+ MPD_NEW_STATIC(tsrc,0,0,0,0);
+ int alloc = 0; /* rdata == NULL */
+ size_t n;
+
+ assert(rbase <= (1U<<16));
+
+ if (mpd_isspecial(src) || !_mpd_isint(src)) {
+ *status |= MPD_Invalid_operation;
+ return SIZE_MAX;
+ }
+
+ if (*rdata == NULL) {
+ rlen = mpd_sizeinbase(src, rbase);
+ if (rlen == SIZE_MAX) {
+ *status |= MPD_Invalid_operation;
+ return SIZE_MAX;
+ }
+ *rdata = mpd_alloc(rlen, sizeof **rdata);
+ if (*rdata == NULL) {
+ goto malloc_error;
+ }
+ alloc = 1;
+ }
+
+ if (mpd_iszero(src)) {
+ **rdata = 0;
+ return 1;
+ }
+
+ if (src->exp >= 0) {
+ if (!mpd_qshiftl(&tsrc, src, src->exp, status)) {
+ goto malloc_error;
+ }
+ }
+ else {
+ if (mpd_qshiftr(&tsrc, src, -src->exp, status) == MPD_UINT_MAX) {
+ goto malloc_error;
+ }
+ }
+
+ n = _baseconv_to_u16(rdata, rlen, rbase, tsrc.data, tsrc.len);
+ if (n == SIZE_MAX) {
+ goto malloc_error;
+ }
+
+
+out:
+ mpd_del(&tsrc);
+ return n;
+
+malloc_error:
+ if (alloc) {
+ mpd_free(*rdata);
+ *rdata = NULL;
+ }
+ n = SIZE_MAX;
+ *status |= MPD_Malloc_error;
+ goto out;
+}
+
+/*
+ * Convert an integer mpd_t to a multiprecision integer with base<=UINT32_MAX.
+ * The least significant word of the result is (*rdata)[0].
+ *
+ * If rdata is NULL, space is allocated by the function and rlen is irrelevant.
+ * In case of an error any allocated storage is freed and rdata is set back to
+ * NULL.
+ *
+ * If rdata is non-NULL, it MUST be allocated by one of libmpdec's allocation
+ * functions and rlen MUST be correct. If necessary, the function will resize
+ * rdata. In case of an error the caller must free rdata.
+ *
+ * Return value: In case of success, the exact length of rdata, SIZE_MAX
+ * otherwise.
+ */
+size_t
+mpd_qexport_u32(uint32_t **rdata, size_t rlen, uint32_t rbase,
+ const mpd_t *src, uint32_t *status)
+{
+ MPD_NEW_STATIC(tsrc,0,0,0,0);
+ int alloc = 0; /* rdata == NULL */
+ size_t n;
+
+ if (mpd_isspecial(src) || !_mpd_isint(src)) {
+ *status |= MPD_Invalid_operation;
+ return SIZE_MAX;
+ }
+
+ if (*rdata == NULL) {
+ rlen = mpd_sizeinbase(src, rbase);
+ if (rlen == SIZE_MAX) {
+ *status |= MPD_Invalid_operation;
+ return SIZE_MAX;
+ }
+ *rdata = mpd_alloc(rlen, sizeof **rdata);
+ if (*rdata == NULL) {
+ goto malloc_error;
+ }
+ alloc = 1;
+ }
+
+ if (mpd_iszero(src)) {
+ **rdata = 0;
+ return 1;
+ }
+
+ if (src->exp >= 0) {
+ if (!mpd_qshiftl(&tsrc, src, src->exp, status)) {
+ goto malloc_error;
+ }
+ }
+ else {
+ if (mpd_qshiftr(&tsrc, src, -src->exp, status) == MPD_UINT_MAX) {
+ goto malloc_error;
+ }
+ }
+
+#ifdef CONFIG_64
+ n = _baseconv_to_smaller(rdata, rlen, rbase,
+ tsrc.data, tsrc.len, MPD_RADIX);
+#else
+ if (rbase == MPD_RADIX) {
+ n = _copy_equal_base(rdata, rlen, tsrc.data, tsrc.len);
+ }
+ else if (rbase < MPD_RADIX) {
+ n = _baseconv_to_smaller(rdata, rlen, rbase,
+ tsrc.data, tsrc.len, MPD_RADIX);
+ }
+ else {
+ n = _baseconv_to_larger(rdata, rlen, rbase,
+ tsrc.data, tsrc.len, MPD_RADIX);
+ }
+#endif
+
+ if (n == SIZE_MAX) {
+ goto malloc_error;
+ }
+
+
+out:
+ mpd_del(&tsrc);
+ return n;
+
+malloc_error:
+ if (alloc) {
+ mpd_free(*rdata);
+ *rdata = NULL;
+ }
+ n = SIZE_MAX;
+ *status |= MPD_Malloc_error;
+ goto out;
+}
+
+
+/*
+ * Converts a multiprecision integer with base <= UINT16_MAX+1 to an mpd_t.
+ * The least significant word of the source is srcdata[0].
+ */
+void
+mpd_qimport_u16(mpd_t *result,
+ const uint16_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t srcbase,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_uint_t *usrc; /* uint16_t src copied to an mpd_uint_t array */
+ mpd_ssize_t rlen; /* length of the result */
+ size_t n;
+
+ assert(srclen > 0);
+ assert(srcbase <= (1U<<16));
+
+ rlen = _mpd_importsize(srclen, srcbase);
+ if (rlen == MPD_SSIZE_MAX) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ usrc = mpd_alloc((mpd_size_t)srclen, sizeof *usrc);
+ if (usrc == NULL) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ for (n = 0; n < srclen; n++) {
+ usrc[n] = srcdata[n];
+ }
+
+ if (!mpd_qresize(result, rlen, status)) {
+ goto finish;
+ }
+
+ n = _coeff_from_u16(result, rlen, usrc, srclen, srcbase, status);
+ if (n == SIZE_MAX) {
+ goto finish;
+ }
+
+ mpd_set_flags(result, srcsign);
+ result->exp = 0;
+ result->len = n;
+ mpd_setdigits(result);
+
+ mpd_qresize(result, result->len, status);
+ mpd_qfinalize(result, ctx, status);
+
+
+finish:
+ mpd_free(usrc);
+}
+
+/*
+ * Converts a multiprecision integer with base <= UINT32_MAX to an mpd_t.
+ * The least significant word of the source is srcdata[0].
+ */
+void
+mpd_qimport_u32(mpd_t *result,
+ const uint32_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t srcbase,
+ const mpd_context_t *ctx, uint32_t *status)
+{
+ mpd_ssize_t rlen; /* length of the result */
+ size_t n;
+
+ assert(srclen > 0);
+
+ rlen = _mpd_importsize(srclen, srcbase);
+ if (rlen == MPD_SSIZE_MAX) {
+ mpd_seterror(result, MPD_Invalid_operation, status);
+ return;
+ }
+
+ if (!mpd_qresize(result, rlen, status)) {
+ return;
+ }
+
+#ifdef CONFIG_64
+ n = _coeff_from_smaller_base(result, rlen, MPD_RADIX,
+ srcdata, srclen, srcbase,
+ status);
+#else
+ if (srcbase == MPD_RADIX) {
+ if (!mpd_qresize(result, srclen, status)) {
+ return;
+ }
+ memcpy(result->data, srcdata, srclen * (sizeof *srcdata));
+ n = srclen;
+ }
+ else if (srcbase < MPD_RADIX) {
+ n = _coeff_from_smaller_base(result, rlen, MPD_RADIX,
+ srcdata, srclen, srcbase,
+ status);
+ }
+ else {
+ mpd_uint_t *usrc = mpd_alloc((mpd_size_t)srclen, sizeof *usrc);
+ if (usrc == NULL) {
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return;
+ }
+ for (n = 0; n < srclen; n++) {
+ usrc[n] = srcdata[n];
+ }
+
+ n = _coeff_from_larger_base(result, rlen, MPD_RADIX,
+ usrc, (mpd_ssize_t)srclen, srcbase,
+ status);
+ mpd_free(usrc);
+ }
+#endif
+
+ if (n == SIZE_MAX) {
+ return;
+ }
+
+ mpd_set_flags(result, srcsign);
+ result->exp = 0;
+ result->len = n;
+ mpd_setdigits(result);
+
+ mpd_qresize(result, result->len, status);
+ mpd_qfinalize(result, ctx, status);
+}
+
+
+/******************************************************************************/
+/* From triple */
+/******************************************************************************/
+
+#if defined(CONFIG_64) && defined(__SIZEOF_INT128__)
+static mpd_ssize_t
+_set_coeff(uint64_t data[3], uint64_t hi, uint64_t lo)
+{
+ __uint128_t d = ((__uint128_t)hi << 64) + lo;
+ __uint128_t q, r;
+
+ q = d / MPD_RADIX;
+ r = d % MPD_RADIX;
+ data[0] = (uint64_t)r;
+ d = q;
+
+ q = d / MPD_RADIX;
+ r = d % MPD_RADIX;
+ data[1] = (uint64_t)r;
+ d = q;
+
+ q = d / MPD_RADIX;
+ r = d % MPD_RADIX;
+ data[2] = (uint64_t)r;
+
+ if (q != 0) {
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ return data[2] != 0 ? 3 : (data[1] != 0 ? 2 : 1);
+}
+#else
+static size_t
+_uint_from_u16(mpd_uint_t *w, mpd_ssize_t wlen, const uint16_t *u, size_t ulen)
+{
+ const mpd_uint_t ubase = 1U<<16;
+ mpd_ssize_t n = 0;
+ mpd_uint_t carry;
+
+ assert(wlen > 0 && ulen > 0);
+
+ w[n++] = u[--ulen];
+ while (--ulen != SIZE_MAX) {
+ carry = _mpd_shortmul_c(w, w, n, ubase);
+ if (carry) {
+ if (n >= wlen) {
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ w[n++] = carry;
+ }
+ carry = _mpd_shortadd(w, n, u[ulen]);
+ if (carry) {
+ if (n >= wlen) {
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ w[n++] = carry;
+ }
+ }
+
+ return n;
+}
+
+static mpd_ssize_t
+_set_coeff(mpd_uint_t *data, mpd_ssize_t len, uint64_t hi, uint64_t lo)
+{
+ uint16_t u16[8] = {0};
+
+ u16[7] = (uint16_t)((hi & 0xFFFF000000000000ULL) >> 48);
+ u16[6] = (uint16_t)((hi & 0x0000FFFF00000000ULL) >> 32);
+ u16[5] = (uint16_t)((hi & 0x00000000FFFF0000ULL) >> 16);
+ u16[4] = (uint16_t) (hi & 0x000000000000FFFFULL);
+
+ u16[3] = (uint16_t)((lo & 0xFFFF000000000000ULL) >> 48);
+ u16[2] = (uint16_t)((lo & 0x0000FFFF00000000ULL) >> 32);
+ u16[1] = (uint16_t)((lo & 0x00000000FFFF0000ULL) >> 16);
+ u16[0] = (uint16_t) (lo & 0x000000000000FFFFULL);
+
+ return (mpd_ssize_t)_uint_from_u16(data, len, u16, 8);
+}
+#endif
+
+static int
+_set_uint128_coeff_exp(mpd_t *result, uint64_t hi, uint64_t lo, mpd_ssize_t exp)
+{
+ mpd_uint_t data[5] = {0};
+ uint32_t status = 0;
+ mpd_ssize_t len;
+
+#if defined(CONFIG_64) && defined(__SIZEOF_INT128__)
+ len = _set_coeff(data, hi, lo);
+#else
+ len = _set_coeff(data, 5, hi, lo);
+#endif
+
+ if (!mpd_qresize(result, len, &status)) {
+ return -1;
+ }
+
+ for (mpd_ssize_t i = 0; i < len; i++) {
+ result->data[i] = data[i];
+ }
+
+ result->exp = exp;
+ result->len = len;
+ mpd_setdigits(result);
+
+ return 0;
+}
+
+int
+mpd_from_uint128_triple(mpd_t *result, const mpd_uint128_triple_t *triple, uint32_t *status)
+{
+ static const mpd_context_t maxcontext = {
+ .prec=MPD_MAX_PREC,
+ .emax=MPD_MAX_EMAX,
+ .emin=MPD_MIN_EMIN,
+ .round=MPD_ROUND_HALF_EVEN,
+ .traps=MPD_Traps,
+ .status=0,
+ .newtrap=0,
+ .clamp=0,
+ .allcr=1,
+ };
+ const enum mpd_triple_class tag = triple->tag;
+ const uint8_t sign = triple->sign;
+ const uint64_t hi = triple->hi;
+ const uint64_t lo = triple->lo;
+ mpd_ssize_t exp;
+
+#ifdef CONFIG_32
+ if (triple->exp < MPD_SSIZE_MIN || triple->exp > MPD_SSIZE_MAX) {
+ goto conversion_error;
+ }
+#endif
+ exp = (mpd_ssize_t)triple->exp;
+
+ switch (tag) {
+ case MPD_TRIPLE_QNAN: case MPD_TRIPLE_SNAN: {
+ if (sign > 1 || exp != 0) {
+ goto conversion_error;
+ }
+
+ const uint8_t flags = tag == MPD_TRIPLE_QNAN ? MPD_NAN : MPD_SNAN;
+ mpd_setspecial(result, sign, flags);
+
+ if (hi == 0 && lo == 0) { /* no payload */
+ return 0;
+ }
+
+ if (_set_uint128_coeff_exp(result, hi, lo, exp) < 0) {
+ goto malloc_error;
+ }
+
+ return 0;
+ }
+
+ case MPD_TRIPLE_INF: {
+ if (sign > 1 || hi != 0 || lo != 0 || exp != 0) {
+ goto conversion_error;
+ }
+
+ mpd_setspecial(result, sign, MPD_INF);
+
+ return 0;
+ }
+
+ case MPD_TRIPLE_NORMAL: {
+ if (sign > 1) {
+ goto conversion_error;
+ }
+
+ const uint8_t flags = sign ? MPD_NEG : MPD_POS;
+ mpd_set_flags(result, flags);
+
+ if (exp > MPD_EXP_INF) {
+ exp = MPD_EXP_INF;
+ }
+ if (exp == MPD_SSIZE_MIN) {
+ exp = MPD_SSIZE_MIN+1;
+ }
+
+ if (_set_uint128_coeff_exp(result, hi, lo, exp) < 0) {
+ goto malloc_error;
+ }
+
+ uint32_t workstatus = 0;
+ mpd_qfinalize(result, &maxcontext, &workstatus);
+ if (workstatus & (MPD_Inexact|MPD_Rounded|MPD_Clamped)) {
+ goto conversion_error;
+ }
+
+ return 0;
+ }
+
+ default:
+ goto conversion_error;
+ }
+
+conversion_error:
+ mpd_seterror(result, MPD_Conversion_syntax, status);
+ return -1;
+
+malloc_error:
+ mpd_seterror(result, MPD_Malloc_error, status);
+ return -1;
+}
+
+
+/******************************************************************************/
+/* As triple */
+/******************************************************************************/
+
+#if defined(CONFIG_64) && defined(__SIZEOF_INT128__)
+static void
+_get_coeff(uint64_t *hi, uint64_t *lo, const mpd_t *a)
+{
+ __uint128_t u128 = 0;
+
+ switch (a->len) {
+ case 3:
+ u128 = a->data[2]; /* fall through */
+ case 2:
+ u128 = u128 * MPD_RADIX + a->data[1]; /* fall through */
+ case 1:
+ u128 = u128 * MPD_RADIX + a->data[0];
+ break;
+ default:
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ *hi = u128 >> 64;
+ *lo = (uint64_t)u128;
+}
+#else
+static size_t
+_uint_to_u16(uint16_t w[8], mpd_uint_t *u, mpd_ssize_t ulen)
+{
+ const mpd_uint_t wbase = 1U<<16;
+ size_t n = 0;
+
+ assert(ulen > 0);
+
+ do {
+ if (n >= 8) {
+ abort(); /* GCOV_NOT_REACHED */
+ }
+ w[n++] = (uint16_t)_mpd_shortdiv(u, u, ulen, wbase);
+ /* ulen is at least 1. u[ulen-1] can only be zero if ulen == 1. */
+ ulen = _mpd_real_size(u, ulen);
+
+ } while (u[ulen-1] != 0);
+
+ return n;
+}
+
+static void
+_get_coeff(uint64_t *hi, uint64_t *lo, const mpd_t *a)
+{
+ uint16_t u16[8] = {0};
+ mpd_uint_t data[5] = {0};
+
+ switch (a->len) {
+ case 5:
+ data[4] = a->data[4]; /* fall through */
+ case 4:
+ data[3] = a->data[3]; /* fall through */
+ case 3:
+ data[2] = a->data[2]; /* fall through */
+ case 2:
+ data[1] = a->data[1]; /* fall through */
+ case 1:
+ data[0] = a->data[0];
+ break;
+ default:
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ _uint_to_u16(u16, data, a->len);
+
+ *hi = (uint64_t)u16[7] << 48;
+ *hi |= (uint64_t)u16[6] << 32;
+ *hi |= (uint64_t)u16[5] << 16;
+ *hi |= (uint64_t)u16[4];
+
+ *lo = (uint64_t)u16[3] << 48;
+ *lo |= (uint64_t)u16[2] << 32;
+ *lo |= (uint64_t)u16[1] << 16;
+ *lo |= (uint64_t)u16[0];
+}
+#endif
+
+static enum mpd_triple_class
+_coeff_as_uint128(uint64_t *hi, uint64_t *lo, const mpd_t *a)
+{
+#ifdef CONFIG_64
+ static mpd_uint_t uint128_max_data[3] = { 3374607431768211455ULL, 4028236692093846346ULL, 3ULL };
+ static const mpd_t uint128_max = { MPD_STATIC|MPD_CONST_DATA, 0, 39, 3, 3, uint128_max_data };
+#else
+ static mpd_uint_t uint128_max_data[5] = { 768211455U, 374607431U, 938463463U, 282366920U, 340U };
+ static const mpd_t uint128_max = { MPD_STATIC|MPD_CONST_DATA, 0, 39, 5, 5, uint128_max_data };
+#endif
+ enum mpd_triple_class ret = MPD_TRIPLE_NORMAL;
+ uint32_t status = 0;
+ mpd_t coeff;
+
+ *hi = *lo = 0ULL;
+
+ if (mpd_isspecial(a)) {
+ if (mpd_isinfinite(a)) {
+ return MPD_TRIPLE_INF;
+ }
+
+ ret = mpd_isqnan(a) ? MPD_TRIPLE_QNAN : MPD_TRIPLE_SNAN;
+ if (a->len == 0) { /* no payload */
+ return ret;
+ }
+ }
+ else if (mpd_iszero(a)) {
+ return ret;
+ }
+
+ _mpd_copy_shared(&coeff, a);
+ mpd_set_flags(&coeff, 0);
+ coeff.exp = 0;
+
+ if (mpd_qcmp(&coeff, &uint128_max, &status) > 0) {
+ return MPD_TRIPLE_ERROR;
+ }
+
+ _get_coeff(hi, lo, &coeff);
+ return ret;
+}
+
+mpd_uint128_triple_t
+mpd_as_uint128_triple(const mpd_t *a)
+{
+ mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 };
+
+ triple.tag = _coeff_as_uint128(&triple.hi, &triple.lo, a);
+ if (triple.tag == MPD_TRIPLE_ERROR) {
+ return triple;
+ }
+
+ triple.sign = !!mpd_isnegative(a);
+ if (triple.tag == MPD_TRIPLE_NORMAL) {
+ triple.exp = a->exp;
+ }
+
+ return triple;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h
new file mode 100644
index 00000000000..8a5aa26b7b6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpdecimal.h
@@ -0,0 +1,847 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_MPDECIMAL_H_
+#define LIBMPDEC_MPDECIMAL_H_
+
+
+#ifndef _MSC_VER
+ #include "pyconfig.h"
+#endif
+
+#ifdef __cplusplus
+ #include <cinttypes>
+ #include <climits>
+ #include <cstdint>
+ #include <cstdio>
+ #include <cstdlib>
+ #define MPD_UINT8_C(x) (static_cast<uint8_t>(x))
+extern "C" {
+#else
+ #include <inttypes.h>
+ #include <limits.h>
+ #include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #define MPD_UINT8_C(x) ((uint8_t)x)
+#endif
+
+
+#if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \
+ defined(__GNUC__) && __GNUC__ >= 4 && !defined(__INTEL_COMPILER)
+ #define MPD_PRAGMA(x) _Pragma(x)
+ #define MPD_HIDE_SYMBOLS_START "GCC visibility push(hidden)"
+ #define MPD_HIDE_SYMBOLS_END "GCC visibility pop"
+#else
+ #define MPD_PRAGMA(x)
+ #define MPD_HIDE_SYMBOLS_START
+ #define MPD_HIDE_SYMBOLS_END
+#endif
+
+#if defined(_MSC_VER)
+ #define EXTINLINE extern inline
+#else
+ #define EXTINLINE
+#endif
+
+
+/* This header file is internal for the purpose of building _decimal.so.
+ * All symbols should have local scope in the DSO. */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+/******************************************************************************/
+/* Version */
+/******************************************************************************/
+
+#define MPD_MAJOR_VERSION 2
+#define MPD_MINOR_VERSION 5
+#define MPD_MICRO_VERSION 1
+
+#define MPD_VERSION "2.5.1"
+
+#define MPD_VERSION_HEX ((MPD_MAJOR_VERSION << 24) | \
+ (MPD_MINOR_VERSION << 16) | \
+ (MPD_MICRO_VERSION << 8))
+
+const char *mpd_version(void);
+
+
+/******************************************************************************/
+/* Configuration */
+/******************************************************************************/
+
+#if 1
+ #if defined(CONFIG_64) || defined(CONFIG_32)
+ #error "cannot use CONFIG_64 or CONFIG_32 with UNIVERSAL."
+ #endif
+ #if defined(__powerpc64__) || defined(_M_AMD64) || defined(__aarch64__)
+ #define CONFIG_64
+ #define ANSI
+ #elif defined(__powerpc__)
+ #define CONFIG_32
+ #define ANSI
+ #elif defined(__i386__) || defined(_M_IX86)
+ #define CONFIG_32
+ #define ANSI
+ #elif defined(__x86_64__)
+ #define CONFIG_64
+ #define ASM
+ #elif defined(__arm64__)
+ #define CONFIG_64
+ #define ANSI
+ #else
+ #error "unknown architecture for universal build."
+ #endif
+#endif
+
+
+/* BEGIN CONFIG_64 */
+#if defined(CONFIG_64)
+/* types for modular and base arithmetic */
+#define MPD_UINT_MAX UINT64_MAX
+#define MPD_BITS_PER_UINT 64
+typedef uint64_t mpd_uint_t; /* unsigned mod type */
+
+#define MPD_SIZE_MAX SIZE_MAX
+typedef size_t mpd_size_t; /* unsigned size type */
+
+/* type for exp, digits, len, prec */
+#define MPD_SSIZE_MAX INT64_MAX
+#define MPD_SSIZE_MIN INT64_MIN
+typedef int64_t mpd_ssize_t;
+#define _mpd_strtossize strtoll
+
+/* decimal arithmetic */
+#define MPD_RADIX 10000000000000000000ULL /* 10**19 */
+#define MPD_RDIGITS 19
+#define MPD_MAX_POW10 19
+#define MPD_EXPDIGITS 19 /* MPD_EXPDIGITS <= MPD_RDIGITS+1 */
+
+#define MPD_MAXTRANSFORM_2N 4294967296ULL /* 2**32 */
+#define MPD_MAX_PREC 999999999999999999LL
+#define MPD_MAX_PREC_LOG2 64
+#define MPD_ELIMIT 1000000000000000000LL
+#define MPD_MAX_EMAX 999999999999999999LL /* ELIMIT-1 */
+#define MPD_MIN_EMIN (-999999999999999999LL) /* -EMAX */
+#define MPD_MIN_ETINY (MPD_MIN_EMIN-(MPD_MAX_PREC-1))
+#define MPD_EXP_INF 2000000000000000001LL
+#define MPD_EXP_CLAMP (-4000000000000000001LL)
+#define MPD_MAXIMPORT 105263157894736842L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */
+#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */
+
+/* conversion specifiers */
+#define PRI_mpd_uint_t PRIu64
+#define PRI_mpd_ssize_t PRIi64
+/* END CONFIG_64 */
+
+
+/* BEGIN CONFIG_32 */
+#elif defined(CONFIG_32)
+/* types for modular and base arithmetic */
+#define MPD_UINT_MAX UINT32_MAX
+#define MPD_BITS_PER_UINT 32
+typedef uint32_t mpd_uint_t; /* unsigned mod type */
+
+#ifndef LEGACY_COMPILER
+#define MPD_UUINT_MAX UINT64_MAX
+typedef uint64_t mpd_uuint_t; /* double width unsigned mod type */
+#endif
+
+#define MPD_SIZE_MAX SIZE_MAX
+typedef size_t mpd_size_t; /* unsigned size type */
+
+/* type for dec->len, dec->exp, ctx->prec */
+#define MPD_SSIZE_MAX INT32_MAX
+#define MPD_SSIZE_MIN INT32_MIN
+typedef int32_t mpd_ssize_t;
+#define _mpd_strtossize strtol
+
+/* decimal arithmetic */
+#define MPD_RADIX 1000000000UL /* 10**9 */
+#define MPD_RDIGITS 9
+#define MPD_MAX_POW10 9
+#define MPD_EXPDIGITS 10 /* MPD_EXPDIGITS <= MPD_RDIGITS+1 */
+
+#define MPD_MAXTRANSFORM_2N 33554432UL /* 2**25 */
+#define MPD_MAX_PREC 425000000L
+#define MPD_MAX_PREC_LOG2 32
+#define MPD_ELIMIT 425000001L
+#define MPD_MAX_EMAX 425000000L /* ELIMIT-1 */
+#define MPD_MIN_EMIN (-425000000L) /* -EMAX */
+#define MPD_MIN_ETINY (MPD_MIN_EMIN-(MPD_MAX_PREC-1))
+#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */
+#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */
+#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */
+#define MPD_IEEE_CONTEXT_MAX_BITS 256 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */
+
+/* conversion specifiers */
+#define PRI_mpd_uint_t PRIu32
+#define PRI_mpd_ssize_t PRIi32
+/* END CONFIG_32 */
+
+#else
+ #error "define CONFIG_64 or CONFIG_32"
+#endif
+/* END CONFIG */
+
+
+#if MPD_SIZE_MAX != MPD_UINT_MAX
+ #error "unsupported platform: need mpd_size_t == mpd_uint_t"
+#endif
+
+
+/******************************************************************************/
+/* Context */
+/******************************************************************************/
+
+enum {
+ MPD_ROUND_UP, /* round away from 0 */
+ MPD_ROUND_DOWN, /* round toward 0 (truncate) */
+ MPD_ROUND_CEILING, /* round toward +infinity */
+ MPD_ROUND_FLOOR, /* round toward -infinity */
+ MPD_ROUND_HALF_UP, /* 0.5 is rounded up */
+ MPD_ROUND_HALF_DOWN, /* 0.5 is rounded down */
+ MPD_ROUND_HALF_EVEN, /* 0.5 is rounded to even */
+ MPD_ROUND_05UP, /* round zero or five away from 0 */
+ MPD_ROUND_TRUNC, /* truncate, but set infinity */
+ MPD_ROUND_GUARD
+};
+
+enum { MPD_CLAMP_DEFAULT, MPD_CLAMP_IEEE_754, MPD_CLAMP_GUARD };
+
+extern const char * const mpd_round_string[MPD_ROUND_GUARD];
+extern const char * const mpd_clamp_string[MPD_CLAMP_GUARD];
+
+
+typedef struct mpd_context_t {
+ mpd_ssize_t prec; /* precision */
+ mpd_ssize_t emax; /* max positive exp */
+ mpd_ssize_t emin; /* min negative exp */
+ uint32_t traps; /* status events that should be trapped */
+ uint32_t status; /* status flags */
+ uint32_t newtrap; /* set by mpd_addstatus_raise() */
+ int round; /* rounding mode */
+ int clamp; /* clamp mode */
+ int allcr; /* all functions correctly rounded */
+} mpd_context_t;
+
+
+/* Status flags */
+#define MPD_Clamped 0x00000001U
+#define MPD_Conversion_syntax 0x00000002U
+#define MPD_Division_by_zero 0x00000004U
+#define MPD_Division_impossible 0x00000008U
+#define MPD_Division_undefined 0x00000010U
+#define MPD_Fpu_error 0x00000020U
+#define MPD_Inexact 0x00000040U
+#define MPD_Invalid_context 0x00000080U
+#define MPD_Invalid_operation 0x00000100U
+#define MPD_Malloc_error 0x00000200U
+#define MPD_Not_implemented 0x00000400U
+#define MPD_Overflow 0x00000800U
+#define MPD_Rounded 0x00001000U
+#define MPD_Subnormal 0x00002000U
+#define MPD_Underflow 0x00004000U
+#define MPD_Max_status (0x00008000U-1U)
+
+/* Conditions that result in an IEEE 754 exception */
+#define MPD_IEEE_Invalid_operation (MPD_Conversion_syntax | \
+ MPD_Division_impossible | \
+ MPD_Division_undefined | \
+ MPD_Fpu_error | \
+ MPD_Invalid_context | \
+ MPD_Invalid_operation | \
+ MPD_Malloc_error) \
+
+/* Errors that require the result of an operation to be set to NaN */
+#define MPD_Errors (MPD_IEEE_Invalid_operation | \
+ MPD_Division_by_zero)
+
+/* Default traps */
+#define MPD_Traps (MPD_IEEE_Invalid_operation | \
+ MPD_Division_by_zero | \
+ MPD_Overflow | \
+ MPD_Underflow)
+
+/* Official name */
+#define MPD_Insufficient_storage MPD_Malloc_error
+
+/* IEEE 754 interchange format contexts */
+#define MPD_DECIMAL32 32
+#define MPD_DECIMAL64 64
+#define MPD_DECIMAL128 128
+
+
+#define MPD_MINALLOC_MIN 2
+#define MPD_MINALLOC_MAX 64
+extern mpd_ssize_t MPD_MINALLOC;
+extern void (* mpd_traphandler)(mpd_context_t *);
+void mpd_dflt_traphandler(mpd_context_t *);
+
+void mpd_setminalloc(mpd_ssize_t n);
+void mpd_init(mpd_context_t *ctx, mpd_ssize_t prec);
+
+void mpd_maxcontext(mpd_context_t *ctx);
+void mpd_defaultcontext(mpd_context_t *ctx);
+void mpd_basiccontext(mpd_context_t *ctx);
+int mpd_ieee_context(mpd_context_t *ctx, int bits);
+
+mpd_ssize_t mpd_getprec(const mpd_context_t *ctx);
+mpd_ssize_t mpd_getemax(const mpd_context_t *ctx);
+mpd_ssize_t mpd_getemin(const mpd_context_t *ctx);
+int mpd_getround(const mpd_context_t *ctx);
+uint32_t mpd_gettraps(const mpd_context_t *ctx);
+uint32_t mpd_getstatus(const mpd_context_t *ctx);
+int mpd_getclamp(const mpd_context_t *ctx);
+int mpd_getcr(const mpd_context_t *ctx);
+
+int mpd_qsetprec(mpd_context_t *ctx, mpd_ssize_t prec);
+int mpd_qsetemax(mpd_context_t *ctx, mpd_ssize_t emax);
+int mpd_qsetemin(mpd_context_t *ctx, mpd_ssize_t emin);
+int mpd_qsetround(mpd_context_t *ctx, int newround);
+int mpd_qsettraps(mpd_context_t *ctx, uint32_t flags);
+int mpd_qsetstatus(mpd_context_t *ctx, uint32_t flags);
+int mpd_qsetclamp(mpd_context_t *ctx, int c);
+int mpd_qsetcr(mpd_context_t *ctx, int c);
+void mpd_addstatus_raise(mpd_context_t *ctx, uint32_t flags);
+
+
+/******************************************************************************/
+/* Decimal Arithmetic */
+/******************************************************************************/
+
+/* mpd_t flags */
+#define MPD_POS MPD_UINT8_C(0)
+#define MPD_NEG MPD_UINT8_C(1)
+#define MPD_INF MPD_UINT8_C(2)
+#define MPD_NAN MPD_UINT8_C(4)
+#define MPD_SNAN MPD_UINT8_C(8)
+#define MPD_SPECIAL (MPD_INF|MPD_NAN|MPD_SNAN)
+#define MPD_STATIC MPD_UINT8_C(16)
+#define MPD_STATIC_DATA MPD_UINT8_C(32)
+#define MPD_SHARED_DATA MPD_UINT8_C(64)
+#define MPD_CONST_DATA MPD_UINT8_C(128)
+#define MPD_DATAFLAGS (MPD_STATIC_DATA|MPD_SHARED_DATA|MPD_CONST_DATA)
+
+/* mpd_t */
+typedef struct mpd_t {
+ uint8_t flags;
+ mpd_ssize_t exp;
+ mpd_ssize_t digits;
+ mpd_ssize_t len;
+ mpd_ssize_t alloc;
+ mpd_uint_t *data;
+} mpd_t;
+
+
+/******************************************************************************/
+/* Triple */
+/******************************************************************************/
+
+/* status cases for getting a triple */
+enum mpd_triple_class {
+ MPD_TRIPLE_NORMAL,
+ MPD_TRIPLE_INF,
+ MPD_TRIPLE_QNAN,
+ MPD_TRIPLE_SNAN,
+ MPD_TRIPLE_ERROR,
+};
+
+typedef struct {
+ enum mpd_triple_class tag;
+ uint8_t sign;
+ uint64_t hi;
+ uint64_t lo;
+ int64_t exp;
+} mpd_uint128_triple_t;
+
+int mpd_from_uint128_triple(mpd_t *result, const mpd_uint128_triple_t *triple, uint32_t *status);
+mpd_uint128_triple_t mpd_as_uint128_triple(const mpd_t *a);
+
+
+/******************************************************************************/
+/* Quiet, thread-safe functions */
+/******************************************************************************/
+
+/* format specification */
+typedef struct mpd_spec_t {
+ mpd_ssize_t min_width; /* minimum field width */
+ mpd_ssize_t prec; /* fraction digits or significant digits */
+ char type; /* conversion specifier */
+ char align; /* alignment */
+ char sign; /* sign printing/alignment */
+ char fill[5]; /* fill character */
+ const char *dot; /* decimal point */
+ const char *sep; /* thousands separator */
+ const char *grouping; /* grouping of digits */
+} mpd_spec_t;
+
+/* output to a string */
+char *mpd_to_sci(const mpd_t *dec, int fmt);
+char *mpd_to_eng(const mpd_t *dec, int fmt);
+mpd_ssize_t mpd_to_sci_size(char **res, const mpd_t *dec, int fmt);
+mpd_ssize_t mpd_to_eng_size(char **res, const mpd_t *dec, int fmt);
+int mpd_validate_lconv(mpd_spec_t *spec);
+int mpd_parse_fmt_str(mpd_spec_t *spec, const char *fmt, int caps);
+char *mpd_qformat_spec(const mpd_t *dec, const mpd_spec_t *spec, const mpd_context_t *ctx, uint32_t *status);
+char *mpd_qformat(const mpd_t *dec, const char *fmt, const mpd_context_t *ctx, uint32_t *status);
+
+#define MPD_NUM_FLAGS 15
+#define MPD_MAX_FLAG_STRING 208
+#define MPD_MAX_FLAG_LIST (MPD_MAX_FLAG_STRING+18)
+#define MPD_MAX_SIGNAL_LIST 121
+int mpd_snprint_flags(char *dest, int nmemb, uint32_t flags);
+int mpd_lsnprint_flags(char *dest, int nmemb, uint32_t flags, const char *flag_string[]);
+int mpd_lsnprint_signals(char *dest, int nmemb, uint32_t flags, const char *signal_string[]);
+
+/* output to a file */
+void mpd_fprint(FILE *file, const mpd_t *dec);
+void mpd_print(const mpd_t *dec);
+
+/* assignment from a string */
+void mpd_qset_string(mpd_t *dec, const char *s, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qset_string_exact(mpd_t *dec, const char *s, uint32_t *status);
+
+/* set to NaN with error flags */
+void mpd_seterror(mpd_t *result, uint32_t flags, uint32_t *status);
+/* set a special with sign and type */
+void mpd_setspecial(mpd_t *result, uint8_t sign, uint8_t type);
+/* set coefficient to zero or all nines */
+void mpd_zerocoeff(mpd_t *result);
+void mpd_qmaxcoeff(mpd_t *result, const mpd_context_t *ctx, uint32_t *status);
+
+/* quietly assign a C integer type to an mpd_t */
+void mpd_qset_ssize(mpd_t *result, mpd_ssize_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qset_i32(mpd_t *result, int32_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qset_uint(mpd_t *result, mpd_uint_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qset_u32(mpd_t *result, uint32_t a, const mpd_context_t *ctx, uint32_t *status);
+#ifndef LEGACY_COMPILER
+void mpd_qset_i64(mpd_t *result, int64_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qset_u64(mpd_t *result, uint64_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qset_i64_exact(mpd_t *result, int64_t a, uint32_t *status);
+void mpd_qset_u64_exact(mpd_t *result, uint64_t a, uint32_t *status);
+#endif
+
+/* quietly assign a C integer type to an mpd_t with a static coefficient */
+void mpd_qsset_ssize(mpd_t *result, mpd_ssize_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsset_i32(mpd_t *result, int32_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsset_uint(mpd_t *result, mpd_uint_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsset_u32(mpd_t *result, uint32_t a, const mpd_context_t *ctx, uint32_t *status);
+
+/* quietly get a C integer type from an mpd_t */
+mpd_ssize_t mpd_qget_ssize(const mpd_t *dec, uint32_t *status);
+mpd_uint_t mpd_qget_uint(const mpd_t *dec, uint32_t *status);
+mpd_uint_t mpd_qabs_uint(const mpd_t *dec, uint32_t *status);
+
+int32_t mpd_qget_i32(const mpd_t *dec, uint32_t *status);
+uint32_t mpd_qget_u32(const mpd_t *dec, uint32_t *status);
+#ifndef LEGACY_COMPILER
+int64_t mpd_qget_i64(const mpd_t *dec, uint32_t *status);
+uint64_t mpd_qget_u64(const mpd_t *dec, uint32_t *status);
+#endif
+
+/* quiet functions */
+int mpd_qcheck_nan(mpd_t *nanresult, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+int mpd_qcheck_nans(mpd_t *nanresult, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qfinalize(mpd_t *result, const mpd_context_t *ctx, uint32_t *status);
+
+const char *mpd_class(const mpd_t *a, const mpd_context_t *ctx);
+
+int mpd_qcopy(mpd_t *result, const mpd_t *a, uint32_t *status);
+int mpd_qcopy_cxx(mpd_t *result, const mpd_t *a);
+mpd_t *mpd_qncopy(const mpd_t *a);
+int mpd_qcopy_abs(mpd_t *result, const mpd_t *a, uint32_t *status);
+int mpd_qcopy_negate(mpd_t *result, const mpd_t *a, uint32_t *status);
+int mpd_qcopy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, uint32_t *status);
+
+void mpd_qand(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qinvert(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qlogb(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qor(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qscaleb(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qxor(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+int mpd_same_quantum(const mpd_t *a, const mpd_t *b);
+
+void mpd_qrotate(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+int mpd_qshiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, uint32_t *status);
+mpd_uint_t mpd_qshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, uint32_t *status);
+mpd_uint_t mpd_qshiftr_inplace(mpd_t *result, mpd_ssize_t n);
+void mpd_qshift(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qshiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, const mpd_context_t *ctx, uint32_t *status);
+
+int mpd_qcmp(const mpd_t *a, const mpd_t *b, uint32_t *status);
+int mpd_qcompare(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+int mpd_qcompare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+int mpd_cmp_total(const mpd_t *a, const mpd_t *b);
+int mpd_cmp_total_mag(const mpd_t *a, const mpd_t *b);
+int mpd_compare_total(mpd_t *result, const mpd_t *a, const mpd_t *b);
+int mpd_compare_total_mag(mpd_t *result, const mpd_t *a, const mpd_t *b);
+
+void mpd_qround_to_intx(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qround_to_int(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qtrunc(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qfloor(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qceil(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+
+void mpd_qabs(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmax(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmax_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmin(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmin_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qminus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qplus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qnext_minus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qnext_plus(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qnext_toward(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qquantize(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qrescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qrescale_fmt(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qreduce(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qadd(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qadd_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qadd_i32(mpd_t *result, const mpd_t *a, int32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qadd_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qadd_u32(mpd_t *result, const mpd_t *a, uint32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub_i32(mpd_t *result, const mpd_t *a, int32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub_u32(mpd_t *result, const mpd_t *a, uint32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul_i32(mpd_t *result, const mpd_t *a, int32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul_u32(mpd_t *result, const mpd_t *a, uint32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv(mpd_t *q, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv_i32(mpd_t *result, const mpd_t *a, int32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv_u32(mpd_t *result, const mpd_t *a, uint32_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdivint(mpd_t *q, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qrem(mpd_t *r, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qrem_near(mpd_t *r, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdivmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qpow(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qpowmod(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_t *mod, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qexp(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qln10(mpd_t *result, mpd_ssize_t prec, uint32_t *status);
+void mpd_qln(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qlog10(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsqrt(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qinvroot(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status);
+
+#ifndef LEGACY_COMPILER
+void mpd_qadd_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qadd_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsub_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qmul_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qdiv_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status);
+#endif
+
+
+size_t mpd_sizeinbase(const mpd_t *a, uint32_t base);
+void mpd_qimport_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t srcbase,
+ const mpd_context_t *ctx, uint32_t *status);
+void mpd_qimport_u32(mpd_t *result, const uint32_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t srcbase,
+ const mpd_context_t *ctx, uint32_t *status);
+size_t mpd_qexport_u16(uint16_t **rdata, size_t rlen, uint32_t base,
+ const mpd_t *src, uint32_t *status);
+size_t mpd_qexport_u32(uint32_t **rdata, size_t rlen, uint32_t base,
+ const mpd_t *src, uint32_t *status);
+
+
+/******************************************************************************/
+/* Signalling functions */
+/******************************************************************************/
+
+char *mpd_format(const mpd_t *dec, const char *fmt, mpd_context_t *ctx);
+void mpd_import_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen, uint8_t srcsign, uint32_t base, mpd_context_t *ctx);
+void mpd_import_u32(mpd_t *result, const uint32_t *srcdata, size_t srclen, uint8_t srcsign, uint32_t base, mpd_context_t *ctx);
+size_t mpd_export_u16(uint16_t **rdata, size_t rlen, uint32_t base, const mpd_t *src, mpd_context_t *ctx);
+size_t mpd_export_u32(uint32_t **rdata, size_t rlen, uint32_t base, const mpd_t *src, mpd_context_t *ctx);
+void mpd_finalize(mpd_t *result, mpd_context_t *ctx);
+int mpd_check_nan(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+int mpd_check_nans(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_set_string(mpd_t *result, const char *s, mpd_context_t *ctx);
+void mpd_maxcoeff(mpd_t *result, mpd_context_t *ctx);
+void mpd_sset_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx);
+void mpd_sset_i32(mpd_t *result, int32_t a, mpd_context_t *ctx);
+void mpd_sset_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx);
+void mpd_sset_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx);
+void mpd_set_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx);
+void mpd_set_i32(mpd_t *result, int32_t a, mpd_context_t *ctx);
+void mpd_set_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx);
+void mpd_set_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx);
+#ifndef LEGACY_COMPILER
+void mpd_set_i64(mpd_t *result, int64_t a, mpd_context_t *ctx);
+void mpd_set_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx);
+#endif
+mpd_ssize_t mpd_get_ssize(const mpd_t *a, mpd_context_t *ctx);
+mpd_uint_t mpd_get_uint(const mpd_t *a, mpd_context_t *ctx);
+mpd_uint_t mpd_abs_uint(const mpd_t *a, mpd_context_t *ctx);
+int32_t mpd_get_i32(const mpd_t *a, mpd_context_t *ctx);
+uint32_t mpd_get_u32(const mpd_t *a, mpd_context_t *ctx);
+#ifndef LEGACY_COMPILER
+int64_t mpd_get_i64(const mpd_t *a, mpd_context_t *ctx);
+uint64_t mpd_get_u64(const mpd_t *a, mpd_context_t *ctx);
+#endif
+void mpd_and(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_copy(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_canonical(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_copy_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_copy_negate(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_copy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_invert(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_logb(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_or(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_rotate(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_scaleb(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_shiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx);
+mpd_uint_t mpd_shiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx);
+void mpd_shiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx);
+void mpd_shift(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_xor(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+int mpd_cmp(const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+int mpd_compare(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+int mpd_compare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_add(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_add_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx);
+void mpd_add_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx);
+void mpd_add_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx);
+void mpd_add_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx);
+void mpd_sub(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_sub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx);
+void mpd_sub_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx);
+void mpd_sub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx);
+void mpd_sub_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx);
+void mpd_div(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_div_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx);
+void mpd_div_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx);
+void mpd_div_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx);
+void mpd_div_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx);
+void mpd_divmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_divint(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_exp(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_fma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, mpd_context_t *ctx);
+void mpd_ln(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_log10(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_max(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_max_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_min(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_min_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_mul(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_mul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx);
+void mpd_mul_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx);
+void mpd_mul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx);
+void mpd_mul_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx);
+void mpd_next_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_next_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_next_toward(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_pow(mpd_t *result, const mpd_t *base, const mpd_t *exp, mpd_context_t *ctx);
+void mpd_powmod(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_t *mod, mpd_context_t *ctx);
+void mpd_quantize(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_rescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, mpd_context_t *ctx);
+void mpd_reduce(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_rem(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_rem_near(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx);
+void mpd_round_to_intx(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_round_to_int(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_trunc(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_floor(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_ceil(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_sqrt(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+void mpd_invroot(mpd_t *result, const mpd_t *a, mpd_context_t *ctx);
+
+#ifndef LEGACY_COMPILER
+void mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx);
+void mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx);
+void mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx);
+void mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx);
+void mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx);
+void mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx);
+void mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx);
+void mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx);
+#endif
+
+
+/******************************************************************************/
+/* Configuration specific */
+/******************************************************************************/
+
+#ifdef CONFIG_64
+void mpd_qsset_i64(mpd_t *result, int64_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_qsset_u64(mpd_t *result, uint64_t a, const mpd_context_t *ctx, uint32_t *status);
+void mpd_sset_i64(mpd_t *result, int64_t a, mpd_context_t *ctx);
+void mpd_sset_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx);
+#endif
+
+
+/******************************************************************************/
+/* Get attributes of a decimal */
+/******************************************************************************/
+
+EXTINLINE mpd_ssize_t mpd_adjexp(const mpd_t *dec);
+EXTINLINE mpd_ssize_t mpd_etiny(const mpd_context_t *ctx);
+EXTINLINE mpd_ssize_t mpd_etop(const mpd_context_t *ctx);
+EXTINLINE mpd_uint_t mpd_msword(const mpd_t *dec);
+EXTINLINE int mpd_word_digits(mpd_uint_t word);
+/* most significant digit of a word */
+EXTINLINE mpd_uint_t mpd_msd(mpd_uint_t word);
+/* least significant digit of a word */
+EXTINLINE mpd_uint_t mpd_lsd(mpd_uint_t word);
+/* coefficient size needed to store 'digits' */
+EXTINLINE mpd_ssize_t mpd_digits_to_size(mpd_ssize_t digits);
+/* number of digits in the exponent, undefined for MPD_SSIZE_MIN */
+EXTINLINE int mpd_exp_digits(mpd_ssize_t exp);
+EXTINLINE int mpd_iscanonical(const mpd_t *dec);
+EXTINLINE int mpd_isfinite(const mpd_t *dec);
+EXTINLINE int mpd_isinfinite(const mpd_t *dec);
+EXTINLINE int mpd_isinteger(const mpd_t *dec);
+EXTINLINE int mpd_isnan(const mpd_t *dec);
+EXTINLINE int mpd_isnegative(const mpd_t *dec);
+EXTINLINE int mpd_ispositive(const mpd_t *dec);
+EXTINLINE int mpd_isqnan(const mpd_t *dec);
+EXTINLINE int mpd_issigned(const mpd_t *dec);
+EXTINLINE int mpd_issnan(const mpd_t *dec);
+EXTINLINE int mpd_isspecial(const mpd_t *dec);
+EXTINLINE int mpd_iszero(const mpd_t *dec);
+/* undefined for special numbers */
+EXTINLINE int mpd_iszerocoeff(const mpd_t *dec);
+EXTINLINE int mpd_isnormal(const mpd_t *dec, const mpd_context_t *ctx);
+EXTINLINE int mpd_issubnormal(const mpd_t *dec, const mpd_context_t *ctx);
+/* odd word */
+EXTINLINE int mpd_isoddword(mpd_uint_t word);
+/* odd coefficient */
+EXTINLINE int mpd_isoddcoeff(const mpd_t *dec);
+/* odd decimal, only defined for integers */
+int mpd_isodd(const mpd_t *dec);
+/* even decimal, only defined for integers */
+int mpd_iseven(const mpd_t *dec);
+/* 0 if dec is positive, 1 if dec is negative */
+EXTINLINE uint8_t mpd_sign(const mpd_t *dec);
+/* 1 if dec is positive, -1 if dec is negative */
+EXTINLINE int mpd_arith_sign(const mpd_t *dec);
+EXTINLINE long mpd_radix(void);
+EXTINLINE int mpd_isdynamic(const mpd_t *dec);
+EXTINLINE int mpd_isstatic(const mpd_t *dec);
+EXTINLINE int mpd_isdynamic_data(const mpd_t *dec);
+EXTINLINE int mpd_isstatic_data(const mpd_t *dec);
+EXTINLINE int mpd_isshared_data(const mpd_t *dec);
+EXTINLINE int mpd_isconst_data(const mpd_t *dec);
+EXTINLINE mpd_ssize_t mpd_trail_zeros(const mpd_t *dec);
+
+
+/******************************************************************************/
+/* Set attributes of a decimal */
+/******************************************************************************/
+
+/* set number of decimal digits in the coefficient */
+EXTINLINE void mpd_setdigits(mpd_t *result);
+EXTINLINE void mpd_set_sign(mpd_t *result, uint8_t sign);
+/* copy sign from another decimal */
+EXTINLINE void mpd_signcpy(mpd_t *result, const mpd_t *a);
+EXTINLINE void mpd_set_infinity(mpd_t *result);
+EXTINLINE void mpd_set_qnan(mpd_t *result);
+EXTINLINE void mpd_set_snan(mpd_t *result);
+EXTINLINE void mpd_set_negative(mpd_t *result);
+EXTINLINE void mpd_set_positive(mpd_t *result);
+EXTINLINE void mpd_set_dynamic(mpd_t *result);
+EXTINLINE void mpd_set_static(mpd_t *result);
+EXTINLINE void mpd_set_dynamic_data(mpd_t *result);
+EXTINLINE void mpd_set_static_data(mpd_t *result);
+EXTINLINE void mpd_set_shared_data(mpd_t *result);
+EXTINLINE void mpd_set_const_data(mpd_t *result);
+EXTINLINE void mpd_clear_flags(mpd_t *result);
+EXTINLINE void mpd_set_flags(mpd_t *result, uint8_t flags);
+EXTINLINE void mpd_copy_flags(mpd_t *result, const mpd_t *a);
+
+
+/******************************************************************************/
+/* Error Macros */
+/******************************************************************************/
+
+#define mpd_err_fatal(...) \
+ do {fprintf(stderr, "%s:%d: error: ", __FILE__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); \
+ abort(); \
+ } while (0)
+#define mpd_err_warn(...) \
+ do {fprintf(stderr, "%s:%d: warning: ", __FILE__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); \
+ } while (0)
+
+
+/******************************************************************************/
+/* Memory handling */
+/******************************************************************************/
+
+extern void *(* mpd_mallocfunc)(size_t size);
+extern void *(* mpd_callocfunc)(size_t nmemb, size_t size);
+extern void *(* mpd_reallocfunc)(void *ptr, size_t size);
+extern void (* mpd_free)(void *ptr);
+
+void *mpd_callocfunc_em(size_t nmemb, size_t size);
+
+void *mpd_alloc(mpd_size_t nmemb, mpd_size_t size);
+void *mpd_calloc(mpd_size_t nmemb, mpd_size_t size);
+void *mpd_realloc(void *ptr, mpd_size_t nmemb, mpd_size_t size, uint8_t *err);
+void *mpd_sh_alloc(mpd_size_t struct_size, mpd_size_t nmemb, mpd_size_t size);
+
+mpd_t *mpd_qnew(void);
+mpd_t *mpd_new(mpd_context_t *ctx);
+mpd_t *mpd_qnew_size(mpd_ssize_t nwords);
+EXTINLINE void mpd_del(mpd_t *dec);
+
+EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len);
+EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status);
+EXTINLINE void mpd_minalloc(mpd_t *result);
+
+int mpd_resize(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx);
+int mpd_resize_zero(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#ifdef __cplusplus
+} /* END extern "C" */
+#endif
+
+
+#endif /* LIBMPDEC_MPDECIMAL_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c b/contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c
new file mode 100644
index 00000000000..fc2af48f4f3
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/mpsignal.c
@@ -0,0 +1,967 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <stddef.h>
+#include <stdint.h>
+
+
+/* Signaling wrappers for the quiet functions in mpdecimal.c. */
+
+
+char *
+mpd_format(const mpd_t *dec, const char *fmt, mpd_context_t *ctx)
+{
+ char *ret;
+ uint32_t status = 0;
+ ret = mpd_qformat(dec, fmt, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+void
+mpd_import_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t base, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qimport_u16(result, srcdata, srclen, srcsign, base, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_import_u32(mpd_t *result, const uint32_t *srcdata, size_t srclen,
+ uint8_t srcsign, uint32_t base, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qimport_u32(result, srcdata, srclen, srcsign, base, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+size_t
+mpd_export_u16(uint16_t **rdata, size_t rlen, uint32_t base, const mpd_t *src,
+ mpd_context_t *ctx)
+{
+ size_t n;
+ uint32_t status = 0;
+ n = mpd_qexport_u16(rdata, rlen, base, src, &status);
+ mpd_addstatus_raise(ctx, status);
+ return n;
+}
+
+size_t
+mpd_export_u32(uint32_t **rdata, size_t rlen, uint32_t base, const mpd_t *src,
+ mpd_context_t *ctx)
+{
+ size_t n;
+ uint32_t status = 0;
+ n = mpd_qexport_u32(rdata, rlen, base, src, &status);
+ mpd_addstatus_raise(ctx, status);
+ return n;
+}
+
+void
+mpd_finalize(mpd_t *result, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qfinalize(result, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+int
+mpd_check_nan(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (mpd_qcheck_nan(result, a, ctx, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ return 1;
+ }
+ return 0;
+}
+
+int
+mpd_check_nans(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (mpd_qcheck_nans(result, a, b, ctx, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ return 1;
+ }
+ return 0;
+}
+
+void
+mpd_set_string(mpd_t *result, const char *s, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_string(result, s, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_maxcoeff(mpd_t *result, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmaxcoeff(result, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+/* set static mpd from signed integer */
+void
+mpd_sset_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_ssize(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sset_i32(mpd_t *result, int32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_i32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifdef CONFIG_64
+void
+mpd_sset_i64(mpd_t *result, int64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_i64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* set static mpd from unsigned integer */
+void
+mpd_sset_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_uint(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sset_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_u32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifdef CONFIG_64
+void
+mpd_sset_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsset_u64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* set mpd from signed integer */
+void
+mpd_set_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_ssize(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_set_i32(mpd_t *result, int32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_i32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_set_i64(mpd_t *result, int64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_i64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* set mpd from unsigned integer */
+void
+mpd_set_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_uint(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_set_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_u32(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_set_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qset_u64(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+/* convert mpd to signed integer */
+mpd_ssize_t
+mpd_get_ssize(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_ssize_t ret;
+
+ ret = mpd_qget_ssize(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+int32_t
+mpd_get_i32(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int32_t ret;
+
+ ret = mpd_qget_i32(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+#ifndef LEGACY_COMPILER
+int64_t
+mpd_get_i64(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int64_t ret;
+
+ ret = mpd_qget_i64(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+#endif
+
+mpd_uint_t
+mpd_get_uint(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_uint_t ret;
+
+ ret = mpd_qget_uint(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+mpd_uint_t
+mpd_abs_uint(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_uint_t ret;
+
+ ret = mpd_qabs_uint(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+uint32_t
+mpd_get_u32(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ uint32_t ret;
+
+ ret = mpd_qget_u32(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+
+#ifndef LEGACY_COMPILER
+uint64_t
+mpd_get_u64(const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ uint64_t ret;
+
+ ret = mpd_qget_u64(a, &status);
+ mpd_addstatus_raise(ctx, status);
+ return ret;
+}
+#endif
+
+void
+mpd_and(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qand(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_copy(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy(result, a, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_canonical(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ mpd_copy(result, a, ctx);
+}
+
+void
+mpd_copy_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy_abs(result, a, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_copy_negate(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy_negate(result, a, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_copy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ if (!mpd_qcopy_sign(result, a, b, &status)) {
+ mpd_addstatus_raise(ctx, status);
+ }
+}
+
+void
+mpd_invert(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qinvert(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_logb(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qlogb(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_or(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qor(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rotate(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrotate(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_scaleb(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qscaleb(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_shiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qshiftl(result, a, n, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+mpd_uint_t
+mpd_shiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_uint_t rnd;
+
+ rnd = mpd_qshiftr(result, a, n, &status);
+ mpd_addstatus_raise(ctx, status);
+ return rnd;
+}
+
+void
+mpd_shiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qshiftn(result, a, n, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_shift(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qshift(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_xor(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qxor(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qabs(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+int
+mpd_cmp(const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int c;
+ c = mpd_qcmp(a, b, &status);
+ mpd_addstatus_raise(ctx, status);
+ return c;
+}
+
+int
+mpd_compare(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int c;
+ c = mpd_qcompare(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+ return c;
+}
+
+int
+mpd_compare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ int c;
+ c = mpd_qcompare_signal(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+ return c;
+}
+
+void
+mpd_add(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sub(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_add_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_add_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_add_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_add_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qadd_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_sub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sub_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_sub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sub_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsub_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_div(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv(q, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_div_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_div_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_div_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_div_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdiv_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_divmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdivmod(q, r, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_divint(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qdivint(q, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_exp(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qexp(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_fma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
+ mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qfma(result, a, b, c, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_ln(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qln(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_log10(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qlog10(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_max(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmax(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_max_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmax_mag(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_min(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmin(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_min_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmin_mag(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qminus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_ssize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_i32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_i64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_mul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_uint(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_mul_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_u32(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+#ifndef LEGACY_COMPILER
+void
+mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qmul_u64(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+#endif
+
+void
+mpd_next_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qnext_minus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_next_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qnext_plus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_next_toward(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qnext_toward(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qplus(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_pow(mpd_t *result, const mpd_t *base, const mpd_t *exp, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qpow(result, base, exp, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_powmod(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_t *mod,
+ mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qpowmod(result, base, exp, mod, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_quantize(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qquantize(result, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrescale(result, a, exp, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_reduce(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qreduce(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rem(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrem(r, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_rem_near(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qrem_near(r, a, b, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_round_to_intx(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qround_to_intx(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_round_to_int(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qround_to_int(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_trunc(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qtrunc(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_floor(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qfloor(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_ceil(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qceil(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_sqrt(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qsqrt(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
+
+void
+mpd_invroot(mpd_t *result, const mpd_t *a, mpd_context_t *ctx)
+{
+ uint32_t status = 0;
+ mpd_qinvroot(result, a, ctx, &status);
+ mpd_addstatus_raise(ctx, status);
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c
new file mode 100644
index 00000000000..210e0deb371
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.c
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "bits.h"
+#include "numbertheory.h"
+#include "umodarith.h"
+
+
+/* Bignum: Initialize the Number Theoretic Transform. */
+
+
+/*
+ * Return the nth root of unity in F(p). This corresponds to e**((2*pi*i)/n)
+ * in the Fourier transform. We have w**n == 1 (mod p).
+ * n := transform length.
+ * sign := -1 for forward transform, 1 for backward transform.
+ * modnum := one of {P1, P2, P3}.
+ */
+mpd_uint_t
+_mpd_getkernel(mpd_uint_t n, int sign, int modnum)
+{
+ mpd_uint_t umod, p, r, xi;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+
+ SETMODULUS(modnum);
+ r = mpd_roots[modnum]; /* primitive root of F(p) */
+ p = umod;
+ xi = (p-1) / n;
+
+ if (sign == -1)
+ return POWMOD(r, (p-1-xi));
+ else
+ return POWMOD(r, xi);
+}
+
+/*
+ * Initialize and return transform parameters.
+ * n := transform length.
+ * sign := -1 for forward transform, 1 for backward transform.
+ * modnum := one of {P1, P2, P3}.
+ */
+struct fnt_params *
+_mpd_init_fnt_params(mpd_size_t n, int sign, int modnum)
+{
+ struct fnt_params *tparams;
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t kernel, w;
+ mpd_uint_t i;
+ mpd_size_t nhalf;
+
+ assert(ispower2(n));
+ assert(sign == -1 || sign == 1);
+ assert(P1 <= modnum && modnum <= P3);
+
+ nhalf = n/2;
+ tparams = mpd_sh_alloc(sizeof *tparams, nhalf, sizeof (mpd_uint_t));
+ if (tparams == NULL) {
+ return NULL;
+ }
+
+ SETMODULUS(modnum);
+ kernel = _mpd_getkernel(n, sign, modnum);
+
+ tparams->modnum = modnum;
+ tparams->modulus = umod;
+ tparams->kernel = kernel;
+
+ /* wtable[] := w**0, w**1, ..., w**(nhalf-1) */
+ w = 1;
+ for (i = 0; i < nhalf; i++) {
+ tparams->wtable[i] = w;
+ w = MULMOD(w, kernel);
+ }
+
+ return tparams;
+}
+
+/* Initialize wtable of size three. */
+void
+_mpd_init_w3table(mpd_uint_t w3table[3], int sign, int modnum)
+{
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t kernel;
+
+ SETMODULUS(modnum);
+ kernel = _mpd_getkernel(3, sign, modnum);
+
+ w3table[0] = 1;
+ w3table[1] = kernel;
+ w3table[2] = POWMOD(kernel, 2);
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h
new file mode 100644
index 00000000000..47b7753b831
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/numbertheory.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_NUMBERTHEORY_H_
+#define LIBMPDEC_NUMBERTHEORY_H_
+
+
+#include "mpdecimal.h"
+#include "constants.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+/* transform parameters */
+struct fnt_params {
+ int modnum;
+ mpd_uint_t modulus;
+ mpd_uint_t kernel;
+ mpd_uint_t wtable[];
+};
+
+
+mpd_uint_t _mpd_getkernel(mpd_uint_t n, int sign, int modnum);
+struct fnt_params *_mpd_init_fnt_params(mpd_size_t n, int sign, int modnum);
+void _mpd_init_w3table(mpd_uint_t w3table[3], int sign, int modnum);
+
+
+#ifdef PPRO
+static inline void
+ppro_setmodulus(int modnum, mpd_uint_t *umod, double *dmod, uint32_t dinvmod[3])
+{
+ *dmod = *umod = mpd_moduli[modnum];
+ dinvmod[0] = mpd_invmoduli[modnum][0];
+ dinvmod[1] = mpd_invmoduli[modnum][1];
+ dinvmod[2] = mpd_invmoduli[modnum][2];
+}
+#else
+static inline void
+std_setmodulus(int modnum, mpd_uint_t *umod)
+{
+ *umod = mpd_moduli[modnum];
+}
+#endif
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_NUMBERTHEORY_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c
new file mode 100644
index 00000000000..a4d1dbed781
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <stdio.h>
+
+#include "bits.h"
+#include "constants.h"
+#include "difradix2.h"
+#include "numbertheory.h"
+#include "sixstep.h"
+#include "transpose.h"
+#include "umodarith.h"
+
+
+/* Bignum: Cache efficient Matrix Fourier Transform for arrays of the
+ form 2**n (See literature/six-step.txt). */
+
+
+/* forward transform with sign = -1 */
+int
+six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum)
+{
+ struct fnt_params *tparams;
+ mpd_size_t log2n, C, R;
+ mpd_uint_t kernel;
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t *x, w0, w1, wstep;
+ mpd_size_t i, k;
+
+
+ assert(ispower2(n));
+ assert(n >= 16);
+ assert(n <= MPD_MAXTRANSFORM_2N);
+
+ log2n = mpd_bsr(n);
+ C = ((mpd_size_t)1) << (log2n / 2); /* number of columns */
+ R = ((mpd_size_t)1) << (log2n - (log2n / 2)); /* number of rows */
+
+
+ /* Transpose the matrix. */
+ if (!transpose_pow2(a, R, C)) {
+ return 0;
+ }
+
+ /* Length R transform on the rows. */
+ if ((tparams = _mpd_init_fnt_params(R, -1, modnum)) == NULL) {
+ return 0;
+ }
+ for (x = a; x < a+n; x += R) {
+ fnt_dif2(x, R, tparams);
+ }
+
+ /* Transpose the matrix. */
+ if (!transpose_pow2(a, C, R)) {
+ mpd_free(tparams);
+ return 0;
+ }
+
+ /* Multiply each matrix element (addressed by i*C+k) by r**(i*k). */
+ SETMODULUS(modnum);
+ kernel = _mpd_getkernel(n, -1, modnum);
+ for (i = 1; i < R; i++) {
+ w0 = 1; /* r**(i*0): initial value for k=0 */
+ w1 = POWMOD(kernel, i); /* r**(i*1): initial value for k=1 */
+ wstep = MULMOD(w1, w1); /* r**(2*i) */
+ for (k = 0; k < C; k += 2) {
+ mpd_uint_t x0 = a[i*C+k];
+ mpd_uint_t x1 = a[i*C+k+1];
+ MULMOD2(&x0, w0, &x1, w1);
+ MULMOD2C(&w0, &w1, wstep); /* r**(i*(k+2)) = r**(i*k) * r**(2*i) */
+ a[i*C+k] = x0;
+ a[i*C+k+1] = x1;
+ }
+ }
+
+ /* Length C transform on the rows. */
+ if (C != R) {
+ mpd_free(tparams);
+ if ((tparams = _mpd_init_fnt_params(C, -1, modnum)) == NULL) {
+ return 0;
+ }
+ }
+ for (x = a; x < a+n; x += C) {
+ fnt_dif2(x, C, tparams);
+ }
+ mpd_free(tparams);
+
+#if 0
+ /* An unordered transform is sufficient for convolution. */
+ /* Transpose the matrix. */
+ if (!transpose_pow2(a, R, C)) {
+ return 0;
+ }
+#endif
+
+ return 1;
+}
+
+
+/* reverse transform, sign = 1 */
+int
+inv_six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum)
+{
+ struct fnt_params *tparams;
+ mpd_size_t log2n, C, R;
+ mpd_uint_t kernel;
+ mpd_uint_t umod;
+#ifdef PPRO
+ double dmod;
+ uint32_t dinvmod[3];
+#endif
+ mpd_uint_t *x, w0, w1, wstep;
+ mpd_size_t i, k;
+
+
+ assert(ispower2(n));
+ assert(n >= 16);
+ assert(n <= MPD_MAXTRANSFORM_2N);
+
+ log2n = mpd_bsr(n);
+ C = ((mpd_size_t)1) << (log2n / 2); /* number of columns */
+ R = ((mpd_size_t)1) << (log2n - (log2n / 2)); /* number of rows */
+
+
+#if 0
+ /* An unordered transform is sufficient for convolution. */
+ /* Transpose the matrix, producing an R*C matrix. */
+ if (!transpose_pow2(a, C, R)) {
+ return 0;
+ }
+#endif
+
+ /* Length C transform on the rows. */
+ if ((tparams = _mpd_init_fnt_params(C, 1, modnum)) == NULL) {
+ return 0;
+ }
+ for (x = a; x < a+n; x += C) {
+ fnt_dif2(x, C, tparams);
+ }
+
+ /* Multiply each matrix element (addressed by i*C+k) by r**(i*k). */
+ SETMODULUS(modnum);
+ kernel = _mpd_getkernel(n, 1, modnum);
+ for (i = 1; i < R; i++) {
+ w0 = 1;
+ w1 = POWMOD(kernel, i);
+ wstep = MULMOD(w1, w1);
+ for (k = 0; k < C; k += 2) {
+ mpd_uint_t x0 = a[i*C+k];
+ mpd_uint_t x1 = a[i*C+k+1];
+ MULMOD2(&x0, w0, &x1, w1);
+ MULMOD2C(&w0, &w1, wstep);
+ a[i*C+k] = x0;
+ a[i*C+k+1] = x1;
+ }
+ }
+
+ /* Transpose the matrix. */
+ if (!transpose_pow2(a, R, C)) {
+ mpd_free(tparams);
+ return 0;
+ }
+
+ /* Length R transform on the rows. */
+ if (R != C) {
+ mpd_free(tparams);
+ if ((tparams = _mpd_init_fnt_params(R, 1, modnum)) == NULL) {
+ return 0;
+ }
+ }
+ for (x = a; x < a+n; x += R) {
+ fnt_dif2(x, R, tparams);
+ }
+ mpd_free(tparams);
+
+ /* Transpose the matrix. */
+ if (!transpose_pow2(a, C, R)) {
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h
new file mode 100644
index 00000000000..89b4a33afc7
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/sixstep.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_SIXSTEP_H_
+#define LIBMPDEC_SIXSTEP_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+int six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+int inv_six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_SIXSTEP_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c
new file mode 100644
index 00000000000..56321b5f39a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.c
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "bits.h"
+#include "constants.h"
+#include "transpose.h"
+#include "typearith.h"
+
+
+#define BUFSIZE 4096
+#define SIDE 128
+
+
+/* Bignum: The transpose functions are used for very large transforms
+ in sixstep.c and fourstep.c. */
+
+
+/* Definition of the matrix transpose */
+void
+std_trans(mpd_uint_t dest[], mpd_uint_t src[], mpd_size_t rows, mpd_size_t cols)
+{
+ mpd_size_t idest, isrc;
+ mpd_size_t r, c;
+
+ for (r = 0; r < rows; r++) {
+ isrc = r * cols;
+ idest = r;
+ for (c = 0; c < cols; c++) {
+ dest[idest] = src[isrc];
+ isrc += 1;
+ idest += rows;
+ }
+ }
+}
+
+/*
+ * Swap half-rows of 2^n * (2*2^n) matrix.
+ * FORWARD_CYCLE: even/odd permutation of the halfrows.
+ * BACKWARD_CYCLE: reverse the even/odd permutation.
+ */
+static int
+swap_halfrows_pow2(mpd_uint_t *matrix, mpd_size_t rows, mpd_size_t cols, int dir)
+{
+ mpd_uint_t buf1[BUFSIZE];
+ mpd_uint_t buf2[BUFSIZE];
+ mpd_uint_t *readbuf, *writebuf, *hp;
+ mpd_size_t *done, dbits;
+ mpd_size_t b = BUFSIZE, stride;
+ mpd_size_t hn, hmax; /* halfrow number */
+ mpd_size_t m, r=0;
+ mpd_size_t offset;
+ mpd_size_t next;
+
+
+ assert(cols == mul_size_t(2, rows));
+
+ if (dir == FORWARD_CYCLE) {
+ r = rows;
+ }
+ else if (dir == BACKWARD_CYCLE) {
+ r = 2;
+ }
+ else {
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ m = cols - 1;
+ hmax = rows; /* cycles start at odd halfrows */
+ dbits = 8 * sizeof *done;
+ if ((done = mpd_calloc(hmax/(sizeof *done) + 1, sizeof *done)) == NULL) {
+ return 0;
+ }
+
+ for (hn = 1; hn <= hmax; hn += 2) {
+
+ if (done[hn/dbits] & mpd_bits[hn%dbits]) {
+ continue;
+ }
+
+ readbuf = buf1; writebuf = buf2;
+
+ for (offset = 0; offset < cols/2; offset += b) {
+
+ stride = (offset + b < cols/2) ? b : cols/2-offset;
+
+ hp = matrix + hn*cols/2;
+ memcpy(readbuf, hp+offset, stride*(sizeof *readbuf));
+ pointerswap(&readbuf, &writebuf);
+
+ next = mulmod_size_t(hn, r, m);
+ hp = matrix + next*cols/2;
+
+ while (next != hn) {
+
+ memcpy(readbuf, hp+offset, stride*(sizeof *readbuf));
+ memcpy(hp+offset, writebuf, stride*(sizeof *writebuf));
+ pointerswap(&readbuf, &writebuf);
+
+ done[next/dbits] |= mpd_bits[next%dbits];
+
+ next = mulmod_size_t(next, r, m);
+ hp = matrix + next*cols/2;
+
+ }
+
+ memcpy(hp+offset, writebuf, stride*(sizeof *writebuf));
+
+ done[hn/dbits] |= mpd_bits[hn%dbits];
+ }
+ }
+
+ mpd_free(done);
+ return 1;
+}
+
+/* In-place transpose of a square matrix */
+static inline void
+squaretrans(mpd_uint_t *buf, mpd_size_t cols)
+{
+ mpd_uint_t tmp;
+ mpd_size_t idest, isrc;
+ mpd_size_t r, c;
+
+ for (r = 0; r < cols; r++) {
+ c = r+1;
+ isrc = r*cols + c;
+ idest = c*cols + r;
+ for (c = r+1; c < cols; c++) {
+ tmp = buf[isrc];
+ buf[isrc] = buf[idest];
+ buf[idest] = tmp;
+ isrc += 1;
+ idest += cols;
+ }
+ }
+}
+
+/*
+ * Transpose 2^n * 2^n matrix. For cache efficiency, the matrix is split into
+ * square blocks with side length 'SIDE'. First, the blocks are transposed,
+ * then a square transposition is done on each individual block.
+ */
+static void
+squaretrans_pow2(mpd_uint_t *matrix, mpd_size_t size)
+{
+ mpd_uint_t buf1[SIDE*SIDE];
+ mpd_uint_t buf2[SIDE*SIDE];
+ mpd_uint_t *to, *from;
+ mpd_size_t b = size;
+ mpd_size_t r, c;
+ mpd_size_t i;
+
+ while (b > SIDE) b >>= 1;
+
+ for (r = 0; r < size; r += b) {
+
+ for (c = r; c < size; c += b) {
+
+ from = matrix + r*size + c;
+ to = buf1;
+ for (i = 0; i < b; i++) {
+ memcpy(to, from, b*(sizeof *to));
+ from += size;
+ to += b;
+ }
+ squaretrans(buf1, b);
+
+ if (r == c) {
+ to = matrix + r*size + c;
+ from = buf1;
+ for (i = 0; i < b; i++) {
+ memcpy(to, from, b*(sizeof *to));
+ from += b;
+ to += size;
+ }
+ continue;
+ }
+ else {
+ from = matrix + c*size + r;
+ to = buf2;
+ for (i = 0; i < b; i++) {
+ memcpy(to, from, b*(sizeof *to));
+ from += size;
+ to += b;
+ }
+ squaretrans(buf2, b);
+
+ to = matrix + c*size + r;
+ from = buf1;
+ for (i = 0; i < b; i++) {
+ memcpy(to, from, b*(sizeof *to));
+ from += b;
+ to += size;
+ }
+
+ to = matrix + r*size + c;
+ from = buf2;
+ for (i = 0; i < b; i++) {
+ memcpy(to, from, b*(sizeof *to));
+ from += b;
+ to += size;
+ }
+ }
+ }
+ }
+
+}
+
+/*
+ * In-place transposition of a 2^n x 2^n or a 2^n x (2*2^n)
+ * or a (2*2^n) x 2^n matrix.
+ */
+int
+transpose_pow2(mpd_uint_t *matrix, mpd_size_t rows, mpd_size_t cols)
+{
+ mpd_size_t size = mul_size_t(rows, cols);
+
+ assert(ispower2(rows));
+ assert(ispower2(cols));
+
+ if (cols == rows) {
+ squaretrans_pow2(matrix, rows);
+ }
+ else if (cols == mul_size_t(2, rows)) {
+ if (!swap_halfrows_pow2(matrix, rows, cols, FORWARD_CYCLE)) {
+ return 0;
+ }
+ squaretrans_pow2(matrix, rows);
+ squaretrans_pow2(matrix+(size/2), rows);
+ }
+ else if (rows == mul_size_t(2, cols)) {
+ squaretrans_pow2(matrix, cols);
+ squaretrans_pow2(matrix+(size/2), cols);
+ if (!swap_halfrows_pow2(matrix, cols, rows, BACKWARD_CYCLE)) {
+ return 0;
+ }
+ }
+ else {
+ abort(); /* GCOV_NOT_REACHED */
+ }
+
+ return 1;
+}
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h
new file mode 100644
index 00000000000..e91c18d7435
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/transpose.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_TRANSPOSE_H_
+#define LIBMPDEC_TRANSPOSE_H_
+
+
+#include "mpdecimal.h"
+
+
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+enum {FORWARD_CYCLE, BACKWARD_CYCLE};
+
+
+void std_trans(mpd_uint_t dest[], mpd_uint_t src[], mpd_size_t rows, mpd_size_t cols);
+int transpose_pow2(mpd_uint_t *matrix, mpd_size_t rows, mpd_size_t cols);
+void transpose_3xpow2(mpd_uint_t *matrix, mpd_size_t rows, mpd_size_t cols);
+
+
+static inline void pointerswap(mpd_uint_t **a, mpd_uint_t **b)
+{
+ mpd_uint_t *tmp;
+
+ tmp = *b;
+ *b = *a;
+ *a = tmp;
+}
+
+
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
+#endif /* LIBMPDEC_TRANSPOSE_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h b/contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h
new file mode 100644
index 00000000000..dd3776453d0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/typearith.h
@@ -0,0 +1,668 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_TYPEARITH_H_
+#define LIBMPDEC_TYPEARITH_H_
+
+
+#include "mpdecimal.h"
+
+#include <assert.h>
+
+
+/*****************************************************************************/
+/* Low level native arithmetic on basic types */
+/*****************************************************************************/
+
+
+/** ------------------------------------------------------------
+ ** Double width multiplication and division
+ ** ------------------------------------------------------------
+ */
+
+#if defined(CONFIG_64)
+#if defined(ANSI)
+#if defined(HAVE_UINT128_T)
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ __uint128_t hl;
+
+ hl = (__uint128_t)a * b;
+
+ *hi = hl >> 64;
+ *lo = (mpd_uint_t)hl;
+}
+
+static inline void
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
+ mpd_uint_t d)
+{
+ __uint128_t hl;
+
+ hl = ((__uint128_t)hi<<64) + lo;
+ *q = (mpd_uint_t)(hl / d); /* quotient is known to fit */
+ *r = (mpd_uint_t)(hl - (__uint128_t)(*q) * d);
+}
+#else
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ uint32_t w[4], carry;
+ uint32_t ah, al, bh, bl;
+ uint64_t hl;
+
+ ah = (uint32_t)(a>>32); al = (uint32_t)a;
+ bh = (uint32_t)(b>>32); bl = (uint32_t)b;
+
+ hl = (uint64_t)al * bl;
+ w[0] = (uint32_t)hl;
+ carry = (uint32_t)(hl>>32);
+
+ hl = (uint64_t)ah * bl + carry;
+ w[1] = (uint32_t)hl;
+ w[2] = (uint32_t)(hl>>32);
+
+ hl = (uint64_t)al * bh + w[1];
+ w[1] = (uint32_t)hl;
+ carry = (uint32_t)(hl>>32);
+
+ hl = ((uint64_t)ah * bh + w[2]) + carry;
+ w[2] = (uint32_t)hl;
+ w[3] = (uint32_t)(hl>>32);
+
+ *hi = ((uint64_t)w[3]<<32) + w[2];
+ *lo = ((uint64_t)w[1]<<32) + w[0];
+}
+
+/*
+ * By Henry S. Warren: http://www.hackersdelight.org/HDcode/divlu.c.txt
+ * http://www.hackersdelight.org/permissions.htm:
+ * "You are free to use, copy, and distribute any of the code on this web
+ * site, whether modified by you or not. You need not give attribution."
+ *
+ * Slightly modified, comments are mine.
+ */
+static inline int
+nlz(uint64_t x)
+{
+ int n;
+
+ if (x == 0) return(64);
+
+ n = 0;
+ if (x <= 0x00000000FFFFFFFF) {n = n +32; x = x <<32;}
+ if (x <= 0x0000FFFFFFFFFFFF) {n = n +16; x = x <<16;}
+ if (x <= 0x00FFFFFFFFFFFFFF) {n = n + 8; x = x << 8;}
+ if (x <= 0x0FFFFFFFFFFFFFFF) {n = n + 4; x = x << 4;}
+ if (x <= 0x3FFFFFFFFFFFFFFF) {n = n + 2; x = x << 2;}
+ if (x <= 0x7FFFFFFFFFFFFFFF) {n = n + 1;}
+
+ return n;
+}
+
+static inline void
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t u1, mpd_uint_t u0,
+ mpd_uint_t v)
+{
+ const mpd_uint_t b = 4294967296;
+ mpd_uint_t un1, un0,
+ vn1, vn0,
+ q1, q0,
+ un32, un21, un10,
+ rhat, t;
+ int s;
+
+ assert(u1 < v);
+
+ s = nlz(v);
+ v = v << s;
+ vn1 = v >> 32;
+ vn0 = v & 0xFFFFFFFF;
+
+ t = (s == 0) ? 0 : u0 >> (64 - s);
+ un32 = (u1 << s) | t;
+ un10 = u0 << s;
+
+ un1 = un10 >> 32;
+ un0 = un10 & 0xFFFFFFFF;
+
+ q1 = un32 / vn1;
+ rhat = un32 - q1*vn1;
+again1:
+ if (q1 >= b || q1*vn0 > b*rhat + un1) {
+ q1 = q1 - 1;
+ rhat = rhat + vn1;
+ if (rhat < b) goto again1;
+ }
+
+ /*
+ * Before again1 we had:
+ * (1) q1*vn1 + rhat = un32
+ * (2) q1*vn1*b + rhat*b + un1 = un32*b + un1
+ *
+ * The statements inside the if-clause do not change the value
+ * of the left-hand side of (2), and the loop is only exited
+ * if q1*vn0 <= rhat*b + un1, so:
+ *
+ * (3) q1*vn1*b + q1*vn0 <= un32*b + un1
+ * (4) q1*v <= un32*b + un1
+ * (5) 0 <= un32*b + un1 - q1*v
+ *
+ * By (5) we are certain that the possible add-back step from
+ * Knuth's algorithm D is never required.
+ *
+ * Since the final quotient is less than 2**64, the following
+ * must be true:
+ *
+ * (6) un32*b + un1 - q1*v <= UINT64_MAX
+ *
+ * This means that in the following line, the high words
+ * of un32*b and q1*v can be discarded without any effect
+ * on the result.
+ */
+ un21 = un32*b + un1 - q1*v;
+
+ q0 = un21 / vn1;
+ rhat = un21 - q0*vn1;
+again2:
+ if (q0 >= b || q0*vn0 > b*rhat + un0) {
+ q0 = q0 - 1;
+ rhat = rhat + vn1;
+ if (rhat < b) goto again2;
+ }
+
+ *q = q1*b + q0;
+ *r = (un21*b + un0 - q0*v) >> s;
+}
+#endif
+
+/* END ANSI */
+#elif defined(ASM)
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ mpd_uint_t h, l;
+
+ __asm__ ( "mulq %3\n\t"
+ : "=d" (h), "=a" (l)
+ : "%a" (a), "rm" (b)
+ : "cc"
+ );
+
+ *hi = h;
+ *lo = l;
+}
+
+static inline void
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
+ mpd_uint_t d)
+{
+ mpd_uint_t qq, rr;
+
+ __asm__ ( "divq %4\n\t"
+ : "=a" (qq), "=d" (rr)
+ : "a" (lo), "d" (hi), "rm" (d)
+ : "cc"
+ );
+
+ *q = qq;
+ *r = rr;
+}
+/* END GCC ASM */
+#elif defined(MASM)
+#include <intrin.h>
+#pragma intrinsic(_umul128)
+
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ *lo = _umul128(a, b, hi);
+}
+
+void _mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
+ mpd_uint_t d);
+
+/* END MASM (_MSC_VER) */
+#else
+ #error "need platform specific 128 bit multiplication and division"
+#endif
+
+#define DIVMOD(q, r, v, d) *q = v / d; *r = v - *q * d
+static inline void
+_mpd_divmod_pow10(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t v, mpd_uint_t exp)
+{
+ assert(exp <= 19);
+
+ if (exp <= 9) {
+ if (exp <= 4) {
+ switch (exp) {
+ case 0: *q = v; *r = 0; break;
+ case 1: DIVMOD(q, r, v, 10UL); break;
+ case 2: DIVMOD(q, r, v, 100UL); break;
+ case 3: DIVMOD(q, r, v, 1000UL); break;
+ case 4: DIVMOD(q, r, v, 10000UL); break;
+ }
+ }
+ else {
+ switch (exp) {
+ case 5: DIVMOD(q, r, v, 100000UL); break;
+ case 6: DIVMOD(q, r, v, 1000000UL); break;
+ case 7: DIVMOD(q, r, v, 10000000UL); break;
+ case 8: DIVMOD(q, r, v, 100000000UL); break;
+ case 9: DIVMOD(q, r, v, 1000000000UL); break;
+ }
+ }
+ }
+ else {
+ if (exp <= 14) {
+ switch (exp) {
+ case 10: DIVMOD(q, r, v, 10000000000ULL); break;
+ case 11: DIVMOD(q, r, v, 100000000000ULL); break;
+ case 12: DIVMOD(q, r, v, 1000000000000ULL); break;
+ case 13: DIVMOD(q, r, v, 10000000000000ULL); break;
+ case 14: DIVMOD(q, r, v, 100000000000000ULL); break;
+ }
+ }
+ else {
+ switch (exp) {
+ case 15: DIVMOD(q, r, v, 1000000000000000ULL); break;
+ case 16: DIVMOD(q, r, v, 10000000000000000ULL); break;
+ case 17: DIVMOD(q, r, v, 100000000000000000ULL); break;
+ case 18: DIVMOD(q, r, v, 1000000000000000000ULL); break;
+ case 19: DIVMOD(q, r, v, 10000000000000000000ULL); break; /* GCOV_NOT_REACHED */
+ }
+ }
+ }
+}
+
+/* END CONFIG_64 */
+#elif defined(CONFIG_32)
+#if defined(ANSI)
+#if !defined(LEGACY_COMPILER)
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ mpd_uuint_t hl;
+
+ hl = (mpd_uuint_t)a * b;
+
+ *hi = hl >> 32;
+ *lo = (mpd_uint_t)hl;
+}
+
+static inline void
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
+ mpd_uint_t d)
+{
+ mpd_uuint_t hl;
+
+ hl = ((mpd_uuint_t)hi<<32) + lo;
+ *q = (mpd_uint_t)(hl / d); /* quotient is known to fit */
+ *r = (mpd_uint_t)(hl - (mpd_uuint_t)(*q) * d);
+}
+/* END ANSI + uint64_t */
+#else
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ uint16_t w[4], carry;
+ uint16_t ah, al, bh, bl;
+ uint32_t hl;
+
+ ah = (uint16_t)(a>>16); al = (uint16_t)a;
+ bh = (uint16_t)(b>>16); bl = (uint16_t)b;
+
+ hl = (uint32_t)al * bl;
+ w[0] = (uint16_t)hl;
+ carry = (uint16_t)(hl>>16);
+
+ hl = (uint32_t)ah * bl + carry;
+ w[1] = (uint16_t)hl;
+ w[2] = (uint16_t)(hl>>16);
+
+ hl = (uint32_t)al * bh + w[1];
+ w[1] = (uint16_t)hl;
+ carry = (uint16_t)(hl>>16);
+
+ hl = ((uint32_t)ah * bh + w[2]) + carry;
+ w[2] = (uint16_t)hl;
+ w[3] = (uint16_t)(hl>>16);
+
+ *hi = ((uint32_t)w[3]<<16) + w[2];
+ *lo = ((uint32_t)w[1]<<16) + w[0];
+}
+
+/*
+ * By Henry S. Warren: http://www.hackersdelight.org/HDcode/divlu.c.txt
+ * http://www.hackersdelight.org/permissions.htm:
+ * "You are free to use, copy, and distribute any of the code on this web
+ * site, whether modified by you or not. You need not give attribution."
+ *
+ * Slightly modified, comments are mine.
+ */
+static inline int
+nlz(uint32_t x)
+{
+ int n;
+
+ if (x == 0) return(32);
+
+ n = 0;
+ if (x <= 0x0000FFFF) {n = n +16; x = x <<16;}
+ if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;}
+ if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;}
+ if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;}
+ if (x <= 0x7FFFFFFF) {n = n + 1;}
+
+ return n;
+}
+
+static inline void
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t u1, mpd_uint_t u0,
+ mpd_uint_t v)
+{
+ const mpd_uint_t b = 65536;
+ mpd_uint_t un1, un0,
+ vn1, vn0,
+ q1, q0,
+ un32, un21, un10,
+ rhat, t;
+ int s;
+
+ assert(u1 < v);
+
+ s = nlz(v);
+ v = v << s;
+ vn1 = v >> 16;
+ vn0 = v & 0xFFFF;
+
+ t = (s == 0) ? 0 : u0 >> (32 - s);
+ un32 = (u1 << s) | t;
+ un10 = u0 << s;
+
+ un1 = un10 >> 16;
+ un0 = un10 & 0xFFFF;
+
+ q1 = un32 / vn1;
+ rhat = un32 - q1*vn1;
+again1:
+ if (q1 >= b || q1*vn0 > b*rhat + un1) {
+ q1 = q1 - 1;
+ rhat = rhat + vn1;
+ if (rhat < b) goto again1;
+ }
+
+ /*
+ * Before again1 we had:
+ * (1) q1*vn1 + rhat = un32
+ * (2) q1*vn1*b + rhat*b + un1 = un32*b + un1
+ *
+ * The statements inside the if-clause do not change the value
+ * of the left-hand side of (2), and the loop is only exited
+ * if q1*vn0 <= rhat*b + un1, so:
+ *
+ * (3) q1*vn1*b + q1*vn0 <= un32*b + un1
+ * (4) q1*v <= un32*b + un1
+ * (5) 0 <= un32*b + un1 - q1*v
+ *
+ * By (5) we are certain that the possible add-back step from
+ * Knuth's algorithm D is never required.
+ *
+ * Since the final quotient is less than 2**32, the following
+ * must be true:
+ *
+ * (6) un32*b + un1 - q1*v <= UINT32_MAX
+ *
+ * This means that in the following line, the high words
+ * of un32*b and q1*v can be discarded without any effect
+ * on the result.
+ */
+ un21 = un32*b + un1 - q1*v;
+
+ q0 = un21 / vn1;
+ rhat = un21 - q0*vn1;
+again2:
+ if (q0 >= b || q0*vn0 > b*rhat + un0) {
+ q0 = q0 - 1;
+ rhat = rhat + vn1;
+ if (rhat < b) goto again2;
+ }
+
+ *q = q1*b + q0;
+ *r = (un21*b + un0 - q0*v) >> s;
+}
+#endif /* END ANSI + LEGACY_COMPILER */
+
+/* END ANSI */
+#elif defined(ASM)
+static inline void
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ mpd_uint_t h, l;
+
+ __asm__ ( "mull %3\n\t"
+ : "=d" (h), "=a" (l)
+ : "%a" (a), "rm" (b)
+ : "cc"
+ );
+
+ *hi = h;
+ *lo = l;
+}
+
+static inline void
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
+ mpd_uint_t d)
+{
+ mpd_uint_t qq, rr;
+
+ __asm__ ( "divl %4\n\t"
+ : "=a" (qq), "=d" (rr)
+ : "a" (lo), "d" (hi), "rm" (d)
+ : "cc"
+ );
+
+ *q = qq;
+ *r = rr;
+}
+/* END GCC ASM */
+#elif defined(MASM)
+static inline void __cdecl
+_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
+{
+ mpd_uint_t h, l;
+
+ __asm {
+ mov eax, a
+ mul b
+ mov h, edx
+ mov l, eax
+ }
+
+ *hi = h;
+ *lo = l;
+}
+
+static inline void __cdecl
+_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
+ mpd_uint_t d)
+{
+ mpd_uint_t qq, rr;
+
+ __asm {
+ mov eax, lo
+ mov edx, hi
+ div d
+ mov qq, eax
+ mov rr, edx
+ }
+
+ *q = qq;
+ *r = rr;
+}
+/* END MASM (_MSC_VER) */
+#else
+ #error "need platform specific 64 bit multiplication and division"
+#endif
+
+#define DIVMOD(q, r, v, d) *q = v / d; *r = v - *q * d
+static inline void
+_mpd_divmod_pow10(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t v, mpd_uint_t exp)
+{
+ assert(exp <= 9);
+
+ if (exp <= 4) {
+ switch (exp) {
+ case 0: *q = v; *r = 0; break;
+ case 1: DIVMOD(q, r, v, 10UL); break;
+ case 2: DIVMOD(q, r, v, 100UL); break;
+ case 3: DIVMOD(q, r, v, 1000UL); break;
+ case 4: DIVMOD(q, r, v, 10000UL); break;
+ }
+ }
+ else {
+ switch (exp) {
+ case 5: DIVMOD(q, r, v, 100000UL); break;
+ case 6: DIVMOD(q, r, v, 1000000UL); break;
+ case 7: DIVMOD(q, r, v, 10000000UL); break;
+ case 8: DIVMOD(q, r, v, 100000000UL); break;
+ case 9: DIVMOD(q, r, v, 1000000000UL); break; /* GCOV_NOT_REACHED */
+ }
+ }
+}
+/* END CONFIG_32 */
+
+/* NO CONFIG */
+#else
+ #error "define CONFIG_64 or CONFIG_32"
+#endif /* CONFIG */
+
+
+static inline void
+_mpd_div_word(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t v, mpd_uint_t d)
+{
+ *q = v / d;
+ *r = v - *q * d;
+}
+
+static inline void
+_mpd_idiv_word(mpd_ssize_t *q, mpd_ssize_t *r, mpd_ssize_t v, mpd_ssize_t d)
+{
+ *q = v / d;
+ *r = v - *q * d;
+}
+
+
+/** ------------------------------------------------------------
+ ** Arithmetic with overflow checking
+ ** ------------------------------------------------------------
+ */
+
+/* The following macros do call exit() in case of an overflow.
+ If the library is used correctly (i.e. with valid context
+ parameters), such overflows cannot occur. The macros are used
+ as sanity checks in a couple of strategic places and should
+ be viewed as a handwritten version of gcc's -ftrapv option. */
+
+static inline mpd_size_t
+add_size_t(mpd_size_t a, mpd_size_t b)
+{
+ if (a > MPD_SIZE_MAX - b) {
+ mpd_err_fatal("add_size_t(): overflow: check the context"); /* GCOV_NOT_REACHED */
+ }
+ return a + b;
+}
+
+static inline mpd_size_t
+sub_size_t(mpd_size_t a, mpd_size_t b)
+{
+ if (b > a) {
+ mpd_err_fatal("sub_size_t(): overflow: check the context"); /* GCOV_NOT_REACHED */
+ }
+ return a - b;
+}
+
+#if MPD_SIZE_MAX != MPD_UINT_MAX
+ #error "adapt mul_size_t() and mulmod_size_t()"
+#endif
+
+static inline mpd_size_t
+mul_size_t(mpd_size_t a, mpd_size_t b)
+{
+ mpd_uint_t hi, lo;
+
+ _mpd_mul_words(&hi, &lo, (mpd_uint_t)a, (mpd_uint_t)b);
+ if (hi) {
+ mpd_err_fatal("mul_size_t(): overflow: check the context"); /* GCOV_NOT_REACHED */
+ }
+ return lo;
+}
+
+static inline mpd_size_t
+add_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow)
+{
+ mpd_size_t ret;
+
+ *overflow = 0;
+ ret = a + b;
+ if (ret < a) *overflow = 1;
+ return ret;
+}
+
+static inline mpd_size_t
+mul_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow)
+{
+ mpd_uint_t hi, lo;
+
+ _mpd_mul_words(&hi, &lo, (mpd_uint_t)a, (mpd_uint_t)b);
+ *overflow = (mpd_size_t)hi;
+ return lo;
+}
+
+static inline mpd_ssize_t
+mod_mpd_ssize_t(mpd_ssize_t a, mpd_ssize_t m)
+{
+ mpd_ssize_t r = a % m;
+ return (r < 0) ? r + m : r;
+}
+
+static inline mpd_size_t
+mulmod_size_t(mpd_size_t a, mpd_size_t b, mpd_size_t m)
+{
+ mpd_uint_t hi, lo;
+ mpd_uint_t q, r;
+
+ _mpd_mul_words(&hi, &lo, (mpd_uint_t)a, (mpd_uint_t)b);
+ _mpd_div_words(&q, &r, hi, lo, (mpd_uint_t)m);
+
+ return r;
+}
+
+
+#endif /* LIBMPDEC_TYPEARITH_H_ */
diff --git a/contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h b/contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h
new file mode 100644
index 00000000000..d7dbbbe6a73
--- /dev/null
+++ b/contrib/tools/python3/Modules/_decimal/libmpdec/umodarith.h
@@ -0,0 +1,648 @@
+/*
+ * Copyright (c) 2008-2020 Stefan Krah. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#ifndef LIBMPDEC_UMODARITH_H_
+#define LIBMPDEC_UMODARITH_H_
+
+
+#include "mpdecimal.h"
+
+#include "constants.h"
+#include "typearith.h"
+
+
+/* Bignum: Low level routines for unsigned modular arithmetic. These are
+ used in the fast convolution functions for very large coefficients. */
+
+
+/**************************************************************************/
+/* ANSI modular arithmetic */
+/**************************************************************************/
+
+
+/*
+ * Restrictions: a < m and b < m
+ * ACL2 proof: umodarith.lisp: addmod-correct
+ */
+static inline mpd_uint_t
+addmod(mpd_uint_t a, mpd_uint_t b, mpd_uint_t m)
+{
+ mpd_uint_t s;
+
+ s = a + b;
+ s = (s < a) ? s - m : s;
+ s = (s >= m) ? s - m : s;
+
+ return s;
+}
+
+/*
+ * Restrictions: a < m and b < m
+ * ACL2 proof: umodarith.lisp: submod-2-correct
+ */
+static inline mpd_uint_t
+submod(mpd_uint_t a, mpd_uint_t b, mpd_uint_t m)
+{
+ mpd_uint_t d;
+
+ d = a - b;
+ d = (a < b) ? d + m : d;
+
+ return d;
+}
+
+/*
+ * Restrictions: a < 2m and b < 2m
+ * ACL2 proof: umodarith.lisp: section ext-submod
+ */
+static inline mpd_uint_t
+ext_submod(mpd_uint_t a, mpd_uint_t b, mpd_uint_t m)
+{
+ mpd_uint_t d;
+
+ a = (a >= m) ? a - m : a;
+ b = (b >= m) ? b - m : b;
+
+ d = a - b;
+ d = (a < b) ? d + m : d;
+
+ return d;
+}
+
+/*
+ * Reduce double word modulo m.
+ * Restrictions: m != 0
+ * ACL2 proof: umodarith.lisp: section dw-reduce
+ */
+static inline mpd_uint_t
+dw_reduce(mpd_uint_t hi, mpd_uint_t lo, mpd_uint_t m)
+{
+ mpd_uint_t r1, r2, w;
+
+ _mpd_div_word(&w, &r1, hi, m);
+ _mpd_div_words(&w, &r2, r1, lo, m);
+
+ return r2;
+}
+
+/*
+ * Subtract double word from a.
+ * Restrictions: a < m
+ * ACL2 proof: umodarith.lisp: section dw-submod
+ */
+static inline mpd_uint_t
+dw_submod(mpd_uint_t a, mpd_uint_t hi, mpd_uint_t lo, mpd_uint_t m)
+{
+ mpd_uint_t d, r;
+
+ r = dw_reduce(hi, lo, m);
+ d = a - r;
+ d = (a < r) ? d + m : d;
+
+ return d;
+}
+
+#ifdef CONFIG_64
+
+/**************************************************************************/
+/* 64-bit modular arithmetic */
+/**************************************************************************/
+
+/*
+ * A proof of the algorithm is in literature/mulmod-64.txt. An ACL2
+ * proof is in umodarith.lisp: section "Fast modular reduction".
+ *
+ * Algorithm: calculate (a * b) % p:
+ *
+ * a) hi, lo <- a * b # Calculate a * b.
+ *
+ * b) hi, lo <- R(hi, lo) # Reduce modulo p.
+ *
+ * c) Repeat step b) until 0 <= hi * 2**64 + lo < 2*p.
+ *
+ * d) If the result is less than p, return lo. Otherwise return lo - p.
+ */
+
+static inline mpd_uint_t
+x64_mulmod(mpd_uint_t a, mpd_uint_t b, mpd_uint_t m)
+{
+ mpd_uint_t hi, lo, x, y;
+
+
+ _mpd_mul_words(&hi, &lo, a, b);
+
+ if (m & (1ULL<<32)) { /* P1 */
+
+ /* first reduction */
+ x = y = hi;
+ hi >>= 32;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 32;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ /* second reduction */
+ x = y = hi;
+ hi >>= 32;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 32;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ return (hi || lo >= m ? lo - m : lo);
+ }
+ else if (m & (1ULL<<34)) { /* P2 */
+
+ /* first reduction */
+ x = y = hi;
+ hi >>= 30;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 34;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ /* second reduction */
+ x = y = hi;
+ hi >>= 30;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 34;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ /* third reduction */
+ x = y = hi;
+ hi >>= 30;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 34;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ return (hi || lo >= m ? lo - m : lo);
+ }
+ else { /* P3 */
+
+ /* first reduction */
+ x = y = hi;
+ hi >>= 24;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 40;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ /* second reduction */
+ x = y = hi;
+ hi >>= 24;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 40;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ /* third reduction */
+ x = y = hi;
+ hi >>= 24;
+
+ x = lo - x;
+ if (x > lo) hi--;
+
+ y <<= 40;
+ lo = y + x;
+ if (lo < y) hi++;
+
+ return (hi || lo >= m ? lo - m : lo);
+ }
+}
+
+static inline void
+x64_mulmod2c(mpd_uint_t *a, mpd_uint_t *b, mpd_uint_t w, mpd_uint_t m)
+{
+ *a = x64_mulmod(*a, w, m);
+ *b = x64_mulmod(*b, w, m);
+}
+
+static inline void
+x64_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
+ mpd_uint_t m)
+{
+ *a0 = x64_mulmod(*a0, b0, m);
+ *a1 = x64_mulmod(*a1, b1, m);
+}
+
+static inline mpd_uint_t
+x64_powmod(mpd_uint_t base, mpd_uint_t exp, mpd_uint_t umod)
+{
+ mpd_uint_t r = 1;
+
+ while (exp > 0) {
+ if (exp & 1)
+ r = x64_mulmod(r, base, umod);
+ base = x64_mulmod(base, base, umod);
+ exp >>= 1;
+ }
+
+ return r;
+}
+
+/* END CONFIG_64 */
+#else /* CONFIG_32 */
+
+
+/**************************************************************************/
+/* 32-bit modular arithmetic */
+/**************************************************************************/
+
+#if defined(ANSI)
+#if !defined(LEGACY_COMPILER)
+/* HAVE_UINT64_T */
+static inline mpd_uint_t
+std_mulmod(mpd_uint_t a, mpd_uint_t b, mpd_uint_t m)
+{
+ return ((mpd_uuint_t) a * b) % m;
+}
+
+static inline void
+std_mulmod2c(mpd_uint_t *a, mpd_uint_t *b, mpd_uint_t w, mpd_uint_t m)
+{
+ *a = ((mpd_uuint_t) *a * w) % m;
+ *b = ((mpd_uuint_t) *b * w) % m;
+}
+
+static inline void
+std_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
+ mpd_uint_t m)
+{
+ *a0 = ((mpd_uuint_t) *a0 * b0) % m;
+ *a1 = ((mpd_uuint_t) *a1 * b1) % m;
+}
+/* END HAVE_UINT64_T */
+#else
+/* LEGACY_COMPILER */
+static inline mpd_uint_t
+std_mulmod(mpd_uint_t a, mpd_uint_t b, mpd_uint_t m)
+{
+ mpd_uint_t hi, lo, q, r;
+ _mpd_mul_words(&hi, &lo, a, b);
+ _mpd_div_words(&q, &r, hi, lo, m);
+ return r;
+}
+
+static inline void
+std_mulmod2c(mpd_uint_t *a, mpd_uint_t *b, mpd_uint_t w, mpd_uint_t m)
+{
+ *a = std_mulmod(*a, w, m);
+ *b = std_mulmod(*b, w, m);
+}
+
+static inline void
+std_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
+ mpd_uint_t m)
+{
+ *a0 = std_mulmod(*a0, b0, m);
+ *a1 = std_mulmod(*a1, b1, m);
+}
+/* END LEGACY_COMPILER */
+#endif
+
+static inline mpd_uint_t
+std_powmod(mpd_uint_t base, mpd_uint_t exp, mpd_uint_t umod)
+{
+ mpd_uint_t r = 1;
+
+ while (exp > 0) {
+ if (exp & 1)
+ r = std_mulmod(r, base, umod);
+ base = std_mulmod(base, base, umod);
+ exp >>= 1;
+ }
+
+ return r;
+}
+#endif /* ANSI CONFIG_32 */
+
+
+/**************************************************************************/
+/* Pentium Pro modular arithmetic */
+/**************************************************************************/
+
+/*
+ * A proof of the algorithm is in literature/mulmod-ppro.txt. The FPU
+ * control word must be set to 64-bit precision and truncation mode
+ * prior to using these functions.
+ *
+ * Algorithm: calculate (a * b) % p:
+ *
+ * p := prime < 2**31
+ * pinv := (long double)1.0 / p (precalculated)
+ *
+ * a) n = a * b # Calculate exact product.
+ * b) qest = n * pinv # Calculate estimate for q = n / p.
+ * c) q = (qest+2**63)-2**63 # Truncate qest to the exact quotient.
+ * d) r = n - q * p # Calculate remainder.
+ *
+ * Remarks:
+ *
+ * - p = dmod and pinv = dinvmod.
+ * - dinvmod points to an array of three uint32_t, which is interpreted
+ * as an 80 bit long double by fldt.
+ * - Intel compilers prior to version 11 do not seem to handle the
+ * __GNUC__ inline assembly correctly.
+ * - random tests are provided in tests/extended/ppro_mulmod.c
+ */
+
+#if defined(PPRO)
+#if defined(ASM)
+
+/* Return (a * b) % dmod */
+static inline mpd_uint_t
+ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
+{
+ mpd_uint_t retval;
+
+ __asm__ (
+ "fildl %2\n\t"
+ "fildl %1\n\t"
+ "fmulp %%st, %%st(1)\n\t"
+ "fldt (%4)\n\t"
+ "fmul %%st(1), %%st\n\t"
+ "flds %5\n\t"
+ "fadd %%st, %%st(1)\n\t"
+ "fsubrp %%st, %%st(1)\n\t"
+ "fldl (%3)\n\t"
+ "fmulp %%st, %%st(1)\n\t"
+ "fsubrp %%st, %%st(1)\n\t"
+ "fistpl %0\n\t"
+ : "=m" (retval)
+ : "m" (a), "m" (b), "r" (dmod), "r" (dinvmod), "m" (MPD_TWO63)
+ : "st", "memory"
+ );
+
+ return retval;
+}
+
+/*
+ * Two modular multiplications in parallel:
+ * *a0 = (*a0 * w) % dmod
+ * *a1 = (*a1 * w) % dmod
+ */
+static inline void
+ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
+ double *dmod, uint32_t *dinvmod)
+{
+ __asm__ (
+ "fildl %2\n\t"
+ "fildl (%1)\n\t"
+ "fmul %%st(1), %%st\n\t"
+ "fxch %%st(1)\n\t"
+ "fildl (%0)\n\t"
+ "fmulp %%st, %%st(1) \n\t"
+ "fldt (%4)\n\t"
+ "flds %5\n\t"
+ "fld %%st(2)\n\t"
+ "fmul %%st(2)\n\t"
+ "fadd %%st(1)\n\t"
+ "fsub %%st(1)\n\t"
+ "fmull (%3)\n\t"
+ "fsubrp %%st, %%st(3)\n\t"
+ "fxch %%st(2)\n\t"
+ "fistpl (%0)\n\t"
+ "fmul %%st(2)\n\t"
+ "fadd %%st(1)\n\t"
+ "fsubp %%st, %%st(1)\n\t"
+ "fmull (%3)\n\t"
+ "fsubrp %%st, %%st(1)\n\t"
+ "fistpl (%1)\n\t"
+ : : "r" (a0), "r" (a1), "m" (w),
+ "r" (dmod), "r" (dinvmod),
+ "m" (MPD_TWO63)
+ : "st", "memory"
+ );
+}
+
+/*
+ * Two modular multiplications in parallel:
+ * *a0 = (*a0 * b0) % dmod
+ * *a1 = (*a1 * b1) % dmod
+ */
+static inline void
+ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
+ double *dmod, uint32_t *dinvmod)
+{
+ __asm__ (
+ "fildl %3\n\t"
+ "fildl (%2)\n\t"
+ "fmulp %%st, %%st(1)\n\t"
+ "fildl %1\n\t"
+ "fildl (%0)\n\t"
+ "fmulp %%st, %%st(1)\n\t"
+ "fldt (%5)\n\t"
+ "fld %%st(2)\n\t"
+ "fmul %%st(1), %%st\n\t"
+ "fxch %%st(1)\n\t"
+ "fmul %%st(2), %%st\n\t"
+ "flds %6\n\t"
+ "fldl (%4)\n\t"
+ "fxch %%st(3)\n\t"
+ "fadd %%st(1), %%st\n\t"
+ "fxch %%st(2)\n\t"
+ "fadd %%st(1), %%st\n\t"
+ "fxch %%st(2)\n\t"
+ "fsub %%st(1), %%st\n\t"
+ "fxch %%st(2)\n\t"
+ "fsubp %%st, %%st(1)\n\t"
+ "fxch %%st(1)\n\t"
+ "fmul %%st(2), %%st\n\t"
+ "fxch %%st(1)\n\t"
+ "fmulp %%st, %%st(2)\n\t"
+ "fsubrp %%st, %%st(3)\n\t"
+ "fsubrp %%st, %%st(1)\n\t"
+ "fxch %%st(1)\n\t"
+ "fistpl (%2)\n\t"
+ "fistpl (%0)\n\t"
+ : : "r" (a0), "m" (b0), "r" (a1), "m" (b1),
+ "r" (dmod), "r" (dinvmod),
+ "m" (MPD_TWO63)
+ : "st", "memory"
+ );
+}
+/* END PPRO GCC ASM */
+#elif defined(MASM)
+
+/* Return (a * b) % dmod */
+static inline mpd_uint_t __cdecl
+ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
+{
+ mpd_uint_t retval;
+
+ __asm {
+ mov eax, dinvmod
+ mov edx, dmod
+ fild b
+ fild a
+ fmulp st(1), st
+ fld TBYTE PTR [eax]
+ fmul st, st(1)
+ fld MPD_TWO63
+ fadd st(1), st
+ fsubp st(1), st
+ fld QWORD PTR [edx]
+ fmulp st(1), st
+ fsubp st(1), st
+ fistp retval
+ }
+
+ return retval;
+}
+
+/*
+ * Two modular multiplications in parallel:
+ * *a0 = (*a0 * w) % dmod
+ * *a1 = (*a1 * w) % dmod
+ */
+static inline mpd_uint_t __cdecl
+ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
+ double *dmod, uint32_t *dinvmod)
+{
+ __asm {
+ mov ecx, dmod
+ mov edx, a1
+ mov ebx, dinvmod
+ mov eax, a0
+ fild w
+ fild DWORD PTR [edx]
+ fmul st, st(1)
+ fxch st(1)
+ fild DWORD PTR [eax]
+ fmulp st(1), st
+ fld TBYTE PTR [ebx]
+ fld MPD_TWO63
+ fld st(2)
+ fmul st, st(2)
+ fadd st, st(1)
+ fsub st, st(1)
+ fmul QWORD PTR [ecx]
+ fsubp st(3), st
+ fxch st(2)
+ fistp DWORD PTR [eax]
+ fmul st, st(2)
+ fadd st, st(1)
+ fsubrp st(1), st
+ fmul QWORD PTR [ecx]
+ fsubp st(1), st
+ fistp DWORD PTR [edx]
+ }
+}
+
+/*
+ * Two modular multiplications in parallel:
+ * *a0 = (*a0 * b0) % dmod
+ * *a1 = (*a1 * b1) % dmod
+ */
+static inline void __cdecl
+ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
+ double *dmod, uint32_t *dinvmod)
+{
+ __asm {
+ mov ecx, dmod
+ mov edx, a1
+ mov ebx, dinvmod
+ mov eax, a0
+ fild b1
+ fild DWORD PTR [edx]
+ fmulp st(1), st
+ fild b0
+ fild DWORD PTR [eax]
+ fmulp st(1), st
+ fld TBYTE PTR [ebx]
+ fld st(2)
+ fmul st, st(1)
+ fxch st(1)
+ fmul st, st(2)
+ fld DWORD PTR MPD_TWO63
+ fld QWORD PTR [ecx]
+ fxch st(3)
+ fadd st, st(1)
+ fxch st(2)
+ fadd st, st(1)
+ fxch st(2)
+ fsub st, st(1)
+ fxch st(2)
+ fsubrp st(1), st
+ fxch st(1)
+ fmul st, st(2)
+ fxch st(1)
+ fmulp st(2), st
+ fsubp st(3), st
+ fsubp st(1), st
+ fxch st(1)
+ fistp DWORD PTR [edx]
+ fistp DWORD PTR [eax]
+ }
+}
+#endif /* PPRO MASM (_MSC_VER) */
+
+
+/* Return (base ** exp) % dmod */
+static inline mpd_uint_t
+ppro_powmod(mpd_uint_t base, mpd_uint_t exp, double *dmod, uint32_t *dinvmod)
+{
+ mpd_uint_t r = 1;
+
+ while (exp > 0) {
+ if (exp & 1)
+ r = ppro_mulmod(r, base, dmod, dinvmod);
+ base = ppro_mulmod(base, base, dmod, dinvmod);
+ exp >>= 1;
+ }
+
+ return r;
+}
+#endif /* PPRO */
+#endif /* CONFIG_32 */
+
+
+#endif /* LIBMPDEC_UMODARITH_H_ */
diff --git a/contrib/tools/python3/Modules/_elementtree.c b/contrib/tools/python3/Modules/_elementtree.c
new file mode 100644
index 00000000000..620de8bb4c6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_elementtree.c
@@ -0,0 +1,4458 @@
+/*--------------------------------------------------------------------
+ * Licensed to PSF under a Contributor Agreement.
+ * See https://www.python.org/psf/license for licensing details.
+ *
+ * _elementtree - C accelerator for xml.etree.ElementTree
+ * Copyright (c) 1999-2009 by Secret Labs AB. All rights reserved.
+ * Copyright (c) 1999-2009 by Fredrik Lundh.
+ *
+ * http://www.pythonware.com
+ *--------------------------------------------------------------------
+ */
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+#include "expat.h"
+#include "pyexpat.h"
+
+/* -------------------------------------------------------------------- */
+/* configuration */
+
+/* An element can hold this many children without extra memory
+ allocations. */
+#define STATIC_CHILDREN 4
+
+/* For best performance, chose a value so that 80-90% of all nodes
+ have no more than the given number of children. Set this to zero
+ to minimize the size of the element structure itself (this only
+ helps if you have lots of leaf nodes with attributes). */
+
+/* Also note that pymalloc always allocates blocks in multiples of
+ eight bytes. For the current C version of ElementTree, this means
+ that the number of children should be an even number, at least on
+ 32-bit platforms. */
+
+/* -------------------------------------------------------------------- */
+
+/* compiler tweaks */
+#if defined(_MSC_VER)
+#define LOCAL(type) static __inline type __fastcall
+#else
+#define LOCAL(type) static type
+#endif
+
+/* macros used to store 'join' flags in string object pointers. note
+ that all use of text and tail as object pointers must be wrapped in
+ JOIN_OBJ. see comments in the ElementObject definition for more
+ info. */
+#define JOIN_GET(p) ((uintptr_t) (p) & 1)
+#define JOIN_SET(p, flag) ((void*) ((uintptr_t) (JOIN_OBJ(p)) | (flag)))
+#define JOIN_OBJ(p) ((PyObject*) ((uintptr_t) (p) & ~(uintptr_t)1))
+
+/* Py_SETREF for a PyObject* that uses a join flag. */
+Py_LOCAL_INLINE(void)
+_set_joined_ptr(PyObject **p, PyObject *new_joined_ptr)
+{
+ PyObject *tmp = JOIN_OBJ(*p);
+ *p = new_joined_ptr;
+ Py_DECREF(tmp);
+}
+
+/* Py_CLEAR for a PyObject* that uses a join flag. Pass the pointer by
+ * reference since this function sets it to NULL.
+*/
+static void _clear_joined_ptr(PyObject **p)
+{
+ if (*p) {
+ _set_joined_ptr(p, NULL);
+ }
+}
+
+/* Per-module state; PEP 3121 */
+typedef struct {
+ PyObject *parseerror_obj;
+ PyObject *deepcopy_obj;
+ PyObject *elementpath_obj;
+ PyObject *comment_factory;
+ PyObject *pi_factory;
+ /* Interned strings */
+ PyObject *str_text;
+ PyObject *str_tail;
+ PyObject *str_append;
+ PyObject *str_find;
+ PyObject *str_findtext;
+ PyObject *str_findall;
+ PyObject *str_iterfind;
+ PyObject *str_doctype;
+ /* Types defined by this extension */
+ PyTypeObject *Element_Type;
+ PyTypeObject *ElementIter_Type;
+ PyTypeObject *TreeBuilder_Type;
+ PyTypeObject *XMLParser_Type;
+
+ PyObject *expat_capsule;
+ struct PyExpat_CAPI *expat_capi;
+} elementtreestate;
+
+static struct PyModuleDef elementtreemodule;
+
+/* Given a module object (assumed to be _elementtree), get its per-module
+ * state.
+ */
+static inline elementtreestate*
+get_elementtree_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (elementtreestate *)state;
+}
+
+static inline elementtreestate *
+get_elementtree_state_by_cls(PyTypeObject *cls)
+{
+ void *state = PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return (elementtreestate *)state;
+}
+
+static inline elementtreestate *
+get_elementtree_state_by_type(PyTypeObject *tp)
+{
+ PyObject *mod = PyType_GetModuleByDef(tp, &elementtreemodule);
+ assert(mod != NULL);
+ return get_elementtree_state(mod);
+}
+
+static int
+elementtree_clear(PyObject *m)
+{
+ elementtreestate *st = get_elementtree_state(m);
+ Py_CLEAR(st->parseerror_obj);
+ Py_CLEAR(st->deepcopy_obj);
+ Py_CLEAR(st->elementpath_obj);
+ Py_CLEAR(st->comment_factory);
+ Py_CLEAR(st->pi_factory);
+
+ // Interned strings
+ Py_CLEAR(st->str_append);
+ Py_CLEAR(st->str_find);
+ Py_CLEAR(st->str_findall);
+ Py_CLEAR(st->str_findtext);
+ Py_CLEAR(st->str_iterfind);
+ Py_CLEAR(st->str_tail);
+ Py_CLEAR(st->str_text);
+ Py_CLEAR(st->str_doctype);
+
+ // Heap types
+ Py_CLEAR(st->Element_Type);
+ Py_CLEAR(st->ElementIter_Type);
+ Py_CLEAR(st->TreeBuilder_Type);
+ Py_CLEAR(st->XMLParser_Type);
+ Py_CLEAR(st->expat_capsule);
+
+ st->expat_capi = NULL;
+ return 0;
+}
+
+static int
+elementtree_traverse(PyObject *m, visitproc visit, void *arg)
+{
+ elementtreestate *st = get_elementtree_state(m);
+ Py_VISIT(st->parseerror_obj);
+ Py_VISIT(st->deepcopy_obj);
+ Py_VISIT(st->elementpath_obj);
+ Py_VISIT(st->comment_factory);
+ Py_VISIT(st->pi_factory);
+
+ // Heap types
+ Py_VISIT(st->Element_Type);
+ Py_VISIT(st->ElementIter_Type);
+ Py_VISIT(st->TreeBuilder_Type);
+ Py_VISIT(st->XMLParser_Type);
+ Py_VISIT(st->expat_capsule);
+ return 0;
+}
+
+static void
+elementtree_free(void *m)
+{
+ elementtree_clear((PyObject *)m);
+}
+
+/* helpers */
+
+LOCAL(PyObject*)
+list_join(PyObject* list)
+{
+ /* join list elements */
+ PyObject* joiner;
+ PyObject* result;
+
+ joiner = PyUnicode_FromStringAndSize("", 0);
+ if (!joiner)
+ return NULL;
+ result = PyUnicode_Join(joiner, list);
+ Py_DECREF(joiner);
+ return result;
+}
+
+/* Is the given object an empty dictionary?
+*/
+static int
+is_empty_dict(PyObject *obj)
+{
+ return PyDict_CheckExact(obj) && PyDict_GET_SIZE(obj) == 0;
+}
+
+
+/* -------------------------------------------------------------------- */
+/* the Element type */
+
+typedef struct {
+
+ /* attributes (a dictionary object), or NULL if no attributes */
+ PyObject* attrib;
+
+ /* child elements */
+ Py_ssize_t length; /* actual number of items */
+ Py_ssize_t allocated; /* allocated items */
+
+ /* this either points to _children or to a malloced buffer */
+ PyObject* *children;
+
+ PyObject* _children[STATIC_CHILDREN];
+
+} ElementObjectExtra;
+
+typedef struct {
+ PyObject_HEAD
+
+ /* element tag (a string). */
+ PyObject* tag;
+
+ /* text before first child. note that this is a tagged pointer;
+ use JOIN_OBJ to get the object pointer. the join flag is used
+ to distinguish lists created by the tree builder from lists
+ assigned to the attribute by application code; the former
+ should be joined before being returned to the user, the latter
+ should be left intact. */
+ PyObject* text;
+
+ /* text after this element, in parent. note that this is a tagged
+ pointer; use JOIN_OBJ to get the object pointer. */
+ PyObject* tail;
+
+ ElementObjectExtra* extra;
+
+ PyObject *weakreflist; /* For tp_weaklistoffset */
+
+} ElementObject;
+
+
+#define Element_CheckExact(st, op) Py_IS_TYPE(op, (st)->Element_Type)
+#define Element_Check(st, op) PyObject_TypeCheck(op, (st)->Element_Type)
+
+
+/* -------------------------------------------------------------------- */
+/* Element constructors and destructor */
+
+LOCAL(int)
+create_extra(ElementObject* self, PyObject* attrib)
+{
+ self->extra = PyObject_Malloc(sizeof(ElementObjectExtra));
+ if (!self->extra) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ self->extra->attrib = Py_XNewRef(attrib);
+
+ self->extra->length = 0;
+ self->extra->allocated = STATIC_CHILDREN;
+ self->extra->children = self->extra->_children;
+
+ return 0;
+}
+
+LOCAL(void)
+dealloc_extra(ElementObjectExtra *extra)
+{
+ Py_ssize_t i;
+
+ if (!extra)
+ return;
+
+ Py_XDECREF(extra->attrib);
+
+ for (i = 0; i < extra->length; i++)
+ Py_DECREF(extra->children[i]);
+
+ if (extra->children != extra->_children)
+ PyObject_Free(extra->children);
+
+ PyObject_Free(extra);
+}
+
+LOCAL(void)
+clear_extra(ElementObject* self)
+{
+ ElementObjectExtra *myextra;
+
+ if (!self->extra)
+ return;
+
+ /* Avoid DECREFs calling into this code again (cycles, etc.)
+ */
+ myextra = self->extra;
+ self->extra = NULL;
+
+ dealloc_extra(myextra);
+}
+
+/* Convenience internal function to create new Element objects with the given
+ * tag and attributes.
+*/
+LOCAL(PyObject*)
+create_new_element(elementtreestate *st, PyObject *tag, PyObject *attrib)
+{
+ ElementObject* self;
+
+ self = PyObject_GC_New(ElementObject, st->Element_Type);
+ if (self == NULL)
+ return NULL;
+ self->extra = NULL;
+ self->tag = Py_NewRef(tag);
+ self->text = Py_NewRef(Py_None);
+ self->tail = Py_NewRef(Py_None);
+ self->weakreflist = NULL;
+
+ PyObject_GC_Track(self);
+
+ if (attrib != NULL && !is_empty_dict(attrib)) {
+ if (create_extra(self, attrib) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+
+ return (PyObject*) self;
+}
+
+static PyObject *
+element_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ ElementObject *e = (ElementObject *)type->tp_alloc(type, 0);
+ if (e != NULL) {
+ e->tag = Py_NewRef(Py_None);
+ e->text = Py_NewRef(Py_None);
+ e->tail = Py_NewRef(Py_None);
+ e->extra = NULL;
+ e->weakreflist = NULL;
+ }
+ return (PyObject *)e;
+}
+
+/* Helper function for extracting the attrib dictionary from a keywords dict.
+ * This is required by some constructors/functions in this module that can
+ * either accept attrib as a keyword argument or all attributes splashed
+ * directly into *kwds.
+ *
+ * Return a dictionary with the content of kwds merged into the content of
+ * attrib. If there is no attrib keyword, return a copy of kwds.
+ */
+static PyObject*
+get_attrib_from_keywords(PyObject *kwds)
+{
+ PyObject *attrib_str = PyUnicode_FromString("attrib");
+ if (attrib_str == NULL) {
+ return NULL;
+ }
+ PyObject *attrib = PyDict_GetItemWithError(kwds, attrib_str);
+
+ if (attrib) {
+ /* If attrib was found in kwds, copy its value and remove it from
+ * kwds
+ */
+ if (!PyDict_Check(attrib)) {
+ Py_DECREF(attrib_str);
+ PyErr_Format(PyExc_TypeError, "attrib must be dict, not %.100s",
+ Py_TYPE(attrib)->tp_name);
+ return NULL;
+ }
+ attrib = PyDict_Copy(attrib);
+ if (attrib && PyDict_DelItem(kwds, attrib_str) < 0) {
+ Py_SETREF(attrib, NULL);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ attrib = PyDict_New();
+ }
+
+ Py_DECREF(attrib_str);
+
+ if (attrib != NULL && PyDict_Update(attrib, kwds) < 0) {
+ Py_DECREF(attrib);
+ return NULL;
+ }
+ return attrib;
+}
+
+/*[clinic input]
+module _elementtree
+class _elementtree.Element "ElementObject *" "clinic_state()->Element_Type"
+class _elementtree.TreeBuilder "TreeBuilderObject *" "clinic_state()->TreeBuilder_Type"
+class _elementtree.XMLParser "XMLParserObject *" "clinic_state()->XMLParser_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6c83ea832d2b0ef1]*/
+
+static int
+element_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *tag;
+ PyObject *attrib = NULL;
+ ElementObject *self_elem;
+
+ if (!PyArg_ParseTuple(args, "O|O!:Element", &tag, &PyDict_Type, &attrib))
+ return -1;
+
+ if (attrib) {
+ /* attrib passed as positional arg */
+ attrib = PyDict_Copy(attrib);
+ if (!attrib)
+ return -1;
+ if (kwds) {
+ if (PyDict_Update(attrib, kwds) < 0) {
+ Py_DECREF(attrib);
+ return -1;
+ }
+ }
+ } else if (kwds) {
+ /* have keywords args */
+ attrib = get_attrib_from_keywords(kwds);
+ if (!attrib)
+ return -1;
+ }
+
+ self_elem = (ElementObject *)self;
+
+ if (attrib != NULL && !is_empty_dict(attrib)) {
+ if (create_extra(self_elem, attrib) < 0) {
+ Py_DECREF(attrib);
+ return -1;
+ }
+ }
+
+ /* We own a reference to attrib here and it's no longer needed. */
+ Py_XDECREF(attrib);
+
+ /* Replace the objects already pointed to by tag, text and tail. */
+ Py_XSETREF(self_elem->tag, Py_NewRef(tag));
+
+ _set_joined_ptr(&self_elem->text, Py_NewRef(Py_None));
+ _set_joined_ptr(&self_elem->tail, Py_NewRef(Py_None));
+
+ return 0;
+}
+
+LOCAL(int)
+element_resize(ElementObject* self, Py_ssize_t extra)
+{
+ Py_ssize_t size;
+ PyObject* *children;
+
+ assert(extra >= 0);
+ /* make sure self->children can hold the given number of extra
+ elements. set an exception and return -1 if allocation failed */
+
+ if (!self->extra) {
+ if (create_extra(self, NULL) < 0)
+ return -1;
+ }
+
+ size = self->extra->length + extra; /* never overflows */
+
+ if (size > self->extra->allocated) {
+ /* use Python 2.4's list growth strategy */
+ size = (size >> 3) + (size < 9 ? 3 : 6) + size;
+ /* Coverity CID #182 size_error: Allocating 1 bytes to pointer "children"
+ * which needs at least 4 bytes.
+ * Although it's a false alarm always assume at least one child to
+ * be safe.
+ */
+ size = size ? size : 1;
+ if ((size_t)size > PY_SSIZE_T_MAX/sizeof(PyObject*))
+ goto nomemory;
+ if (self->extra->children != self->extra->_children) {
+ /* Coverity CID #182 size_error: Allocating 1 bytes to pointer
+ * "children", which needs at least 4 bytes. Although it's a
+ * false alarm always assume at least one child to be safe.
+ */
+ children = PyObject_Realloc(self->extra->children,
+ size * sizeof(PyObject*));
+ if (!children)
+ goto nomemory;
+ } else {
+ children = PyObject_Malloc(size * sizeof(PyObject*));
+ if (!children)
+ goto nomemory;
+ /* copy existing children from static area to malloc buffer */
+ memcpy(children, self->extra->children,
+ self->extra->length * sizeof(PyObject*));
+ }
+ self->extra->children = children;
+ self->extra->allocated = size;
+ }
+
+ return 0;
+
+ nomemory:
+ PyErr_NoMemory();
+ return -1;
+}
+
+LOCAL(void)
+raise_type_error(PyObject *element)
+{
+ PyErr_Format(PyExc_TypeError,
+ "expected an Element, not \"%.200s\"",
+ Py_TYPE(element)->tp_name);
+}
+
+LOCAL(int)
+element_add_subelement(elementtreestate *st, ElementObject *self,
+ PyObject *element)
+{
+ /* add a child element to a parent */
+ if (!Element_Check(st, element)) {
+ raise_type_error(element);
+ return -1;
+ }
+
+ if (element_resize(self, 1) < 0)
+ return -1;
+
+ self->extra->children[self->extra->length] = Py_NewRef(element);
+
+ self->extra->length++;
+
+ return 0;
+}
+
+LOCAL(PyObject*)
+element_get_attrib(ElementObject* self)
+{
+ /* return borrowed reference to attrib dictionary */
+ /* note: this function assumes that the extra section exists */
+
+ PyObject* res = self->extra->attrib;
+
+ if (!res) {
+ /* create missing dictionary */
+ res = self->extra->attrib = PyDict_New();
+ }
+
+ return res;
+}
+
+LOCAL(PyObject*)
+element_get_text(ElementObject* self)
+{
+ /* return borrowed reference to text attribute */
+
+ PyObject *res = self->text;
+
+ if (JOIN_GET(res)) {
+ res = JOIN_OBJ(res);
+ if (PyList_CheckExact(res)) {
+ PyObject *tmp = list_join(res);
+ if (!tmp)
+ return NULL;
+ self->text = tmp;
+ Py_SETREF(res, tmp);
+ }
+ }
+
+ return res;
+}
+
+LOCAL(PyObject*)
+element_get_tail(ElementObject* self)
+{
+ /* return borrowed reference to text attribute */
+
+ PyObject *res = self->tail;
+
+ if (JOIN_GET(res)) {
+ res = JOIN_OBJ(res);
+ if (PyList_CheckExact(res)) {
+ PyObject *tmp = list_join(res);
+ if (!tmp)
+ return NULL;
+ self->tail = tmp;
+ Py_SETREF(res, tmp);
+ }
+ }
+
+ return res;
+}
+
+static PyObject*
+subelement(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ PyObject* elem;
+
+ elementtreestate *st = get_elementtree_state(self);
+ ElementObject* parent;
+ PyObject* tag;
+ PyObject* attrib = NULL;
+ if (!PyArg_ParseTuple(args, "O!O|O!:SubElement",
+ st->Element_Type, &parent, &tag,
+ &PyDict_Type, &attrib)) {
+ return NULL;
+ }
+
+ if (attrib) {
+ /* attrib passed as positional arg */
+ attrib = PyDict_Copy(attrib);
+ if (!attrib)
+ return NULL;
+ if (kwds != NULL && PyDict_Update(attrib, kwds) < 0) {
+ Py_DECREF(attrib);
+ return NULL;
+ }
+ } else if (kwds) {
+ /* have keyword args */
+ attrib = get_attrib_from_keywords(kwds);
+ if (!attrib)
+ return NULL;
+ } else {
+ /* no attrib arg, no kwds, so no attribute */
+ }
+
+ elem = create_new_element(st, tag, attrib);
+ Py_XDECREF(attrib);
+ if (elem == NULL)
+ return NULL;
+
+ if (element_add_subelement(st, parent, elem) < 0) {
+ Py_DECREF(elem);
+ return NULL;
+ }
+
+ return elem;
+}
+
+static int
+element_gc_traverse(ElementObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->tag);
+ Py_VISIT(JOIN_OBJ(self->text));
+ Py_VISIT(JOIN_OBJ(self->tail));
+
+ if (self->extra) {
+ Py_ssize_t i;
+ Py_VISIT(self->extra->attrib);
+
+ for (i = 0; i < self->extra->length; ++i)
+ Py_VISIT(self->extra->children[i]);
+ }
+ return 0;
+}
+
+static int
+element_gc_clear(ElementObject *self)
+{
+ Py_CLEAR(self->tag);
+ _clear_joined_ptr(&self->text);
+ _clear_joined_ptr(&self->tail);
+
+ /* After dropping all references from extra, it's no longer valid anyway,
+ * so fully deallocate it.
+ */
+ clear_extra(self);
+ return 0;
+}
+
+static void
+element_dealloc(ElementObject* self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(self);
+ Py_TRASHCAN_BEGIN(self, element_dealloc)
+
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+
+ /* element_gc_clear clears all references and deallocates extra
+ */
+ element_gc_clear(self);
+
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+ Py_TRASHCAN_END
+}
+
+/* -------------------------------------------------------------------- */
+
+/*[clinic input]
+_elementtree.Element.append
+
+ cls: defining_class
+ subelement: object(subclass_of='clinic_state()->Element_Type')
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_append_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *subelement)
+/*[clinic end generated code: output=d00923711ea317fc input=8baf92679f9717b8]*/
+{
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+ if (element_add_subelement(st, self, subelement) < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_elementtree.Element.clear
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_clear_impl(ElementObject *self)
+/*[clinic end generated code: output=8bcd7a51f94cfff6 input=3c719ff94bf45dd6]*/
+{
+ clear_extra(self);
+
+ _set_joined_ptr(&self->text, Py_NewRef(Py_None));
+ _set_joined_ptr(&self->tail, Py_NewRef(Py_None));
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_elementtree.Element.__copy__
+
+ cls: defining_class
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element___copy___impl(ElementObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=da22894421ff2b36 input=91edb92d9f441213]*/
+{
+ Py_ssize_t i;
+ ElementObject* element;
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+
+ element = (ElementObject*) create_new_element(
+ st, self->tag, self->extra ? self->extra->attrib : NULL);
+ if (!element)
+ return NULL;
+
+ Py_INCREF(JOIN_OBJ(self->text));
+ _set_joined_ptr(&element->text, self->text);
+
+ Py_INCREF(JOIN_OBJ(self->tail));
+ _set_joined_ptr(&element->tail, self->tail);
+
+ assert(!element->extra || !element->extra->length);
+ if (self->extra) {
+ if (element_resize(element, self->extra->length) < 0) {
+ Py_DECREF(element);
+ return NULL;
+ }
+
+ for (i = 0; i < self->extra->length; i++) {
+ element->extra->children[i] = Py_NewRef(self->extra->children[i]);
+ }
+
+ assert(!element->extra->length);
+ element->extra->length = self->extra->length;
+ }
+
+ return (PyObject*) element;
+}
+
+/* Helper for a deep copy. */
+LOCAL(PyObject *) deepcopy(elementtreestate *, PyObject *, PyObject *);
+
+/*[clinic input]
+_elementtree.Element.__deepcopy__
+
+ memo: object(subclass_of="&PyDict_Type")
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo)
+/*[clinic end generated code: output=eefc3df50465b642 input=a2d40348c0aade10]*/
+{
+ Py_ssize_t i;
+ ElementObject* element;
+ PyObject* tag;
+ PyObject* attrib;
+ PyObject* text;
+ PyObject* tail;
+ PyObject* id;
+
+ PyTypeObject *tp = Py_TYPE(self);
+ elementtreestate *st = get_elementtree_state_by_type(tp);
+ tag = deepcopy(st, self->tag, memo);
+ if (!tag)
+ return NULL;
+
+ if (self->extra && self->extra->attrib) {
+ attrib = deepcopy(st, self->extra->attrib, memo);
+ if (!attrib) {
+ Py_DECREF(tag);
+ return NULL;
+ }
+ } else {
+ attrib = NULL;
+ }
+
+ element = (ElementObject*) create_new_element(st, tag, attrib);
+
+ Py_DECREF(tag);
+ Py_XDECREF(attrib);
+
+ if (!element)
+ return NULL;
+
+ text = deepcopy(st, JOIN_OBJ(self->text), memo);
+ if (!text)
+ goto error;
+ _set_joined_ptr(&element->text, JOIN_SET(text, JOIN_GET(self->text)));
+
+ tail = deepcopy(st, JOIN_OBJ(self->tail), memo);
+ if (!tail)
+ goto error;
+ _set_joined_ptr(&element->tail, JOIN_SET(tail, JOIN_GET(self->tail)));
+
+ assert(!element->extra || !element->extra->length);
+ if (self->extra) {
+ if (element_resize(element, self->extra->length) < 0)
+ goto error;
+
+ for (i = 0; i < self->extra->length; i++) {
+ PyObject* child = deepcopy(st, self->extra->children[i], memo);
+ if (!child || !Element_Check(st, child)) {
+ if (child) {
+ raise_type_error(child);
+ Py_DECREF(child);
+ }
+ element->extra->length = i;
+ goto error;
+ }
+ element->extra->children[i] = child;
+ }
+
+ assert(!element->extra->length);
+ element->extra->length = self->extra->length;
+ }
+
+ /* add object to memo dictionary (so deepcopy won't visit it again) */
+ id = PyLong_FromSsize_t((uintptr_t) self);
+ if (!id)
+ goto error;
+
+ i = PyDict_SetItem(memo, id, (PyObject*) element);
+
+ Py_DECREF(id);
+
+ if (i < 0)
+ goto error;
+
+ return (PyObject*) element;
+
+ error:
+ Py_DECREF(element);
+ return NULL;
+}
+
+LOCAL(PyObject *)
+deepcopy(elementtreestate *st, PyObject *object, PyObject *memo)
+{
+ /* do a deep copy of the given object */
+ PyObject *stack[2];
+
+ /* Fast paths */
+ if (object == Py_None || PyUnicode_CheckExact(object)) {
+ return Py_NewRef(object);
+ }
+
+ if (Py_REFCNT(object) == 1) {
+ if (PyDict_CheckExact(object)) {
+ PyObject *key, *value;
+ Py_ssize_t pos = 0;
+ int simple = 1;
+ while (PyDict_Next(object, &pos, &key, &value)) {
+ if (!PyUnicode_CheckExact(key) || !PyUnicode_CheckExact(value)) {
+ simple = 0;
+ break;
+ }
+ }
+ if (simple)
+ return PyDict_Copy(object);
+ /* Fall through to general case */
+ }
+ else if (Element_CheckExact(st, object)) {
+ return _elementtree_Element___deepcopy___impl(
+ (ElementObject *)object, memo);
+ }
+ }
+
+ /* General case */
+ if (!st->deepcopy_obj) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "deepcopy helper not found");
+ return NULL;
+ }
+
+ stack[0] = object;
+ stack[1] = memo;
+ return _PyObject_FastCall(st->deepcopy_obj, stack, 2);
+}
+
+
+/*[clinic input]
+_elementtree.Element.__sizeof__ -> size_t
+
+[clinic start generated code]*/
+
+static size_t
+_elementtree_Element___sizeof___impl(ElementObject *self)
+/*[clinic end generated code: output=baae4e7ae9fe04ec input=54e298c501f3e0d0]*/
+{
+ size_t result = _PyObject_SIZE(Py_TYPE(self));
+ if (self->extra) {
+ result += sizeof(ElementObjectExtra);
+ if (self->extra->children != self->extra->_children) {
+ result += (size_t)self->extra->allocated * sizeof(PyObject*);
+ }
+ }
+ return result;
+}
+
+/* dict keys for getstate/setstate. */
+#define PICKLED_TAG "tag"
+#define PICKLED_CHILDREN "_children"
+#define PICKLED_ATTRIB "attrib"
+#define PICKLED_TAIL "tail"
+#define PICKLED_TEXT "text"
+
+/* __getstate__ returns a fabricated instance dict as in the pure-Python
+ * Element implementation, for interoperability/interchangeability. This
+ * makes the pure-Python implementation details an API, but (a) there aren't
+ * any unnecessary structures there; and (b) it buys compatibility with 3.2
+ * pickles. See issue #16076.
+ */
+/*[clinic input]
+_elementtree.Element.__getstate__
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element___getstate___impl(ElementObject *self)
+/*[clinic end generated code: output=37279aeeb6bb5b04 input=f0d16d7ec2f7adc1]*/
+{
+ Py_ssize_t i;
+ PyObject *children, *attrib;
+
+ /* Build a list of children. */
+ children = PyList_New(self->extra ? self->extra->length : 0);
+ if (!children)
+ return NULL;
+ for (i = 0; i < PyList_GET_SIZE(children); i++) {
+ PyObject *child = Py_NewRef(self->extra->children[i]);
+ PyList_SET_ITEM(children, i, child);
+ }
+
+ if (self->extra && self->extra->attrib) {
+ attrib = Py_NewRef(self->extra->attrib);
+ }
+ else {
+ attrib = PyDict_New();
+ if (!attrib) {
+ Py_DECREF(children);
+ return NULL;
+ }
+ }
+
+ return Py_BuildValue("{sOsNsNsOsO}",
+ PICKLED_TAG, self->tag,
+ PICKLED_CHILDREN, children,
+ PICKLED_ATTRIB, attrib,
+ PICKLED_TEXT, JOIN_OBJ(self->text),
+ PICKLED_TAIL, JOIN_OBJ(self->tail));
+}
+
+static PyObject *
+element_setstate_from_attributes(elementtreestate *st,
+ ElementObject *self,
+ PyObject *tag,
+ PyObject *attrib,
+ PyObject *text,
+ PyObject *tail,
+ PyObject *children)
+{
+ Py_ssize_t i, nchildren;
+ ElementObjectExtra *oldextra = NULL;
+
+ if (!tag) {
+ PyErr_SetString(PyExc_TypeError, "tag may not be NULL");
+ return NULL;
+ }
+
+ Py_XSETREF(self->tag, Py_NewRef(tag));
+
+ text = text ? JOIN_SET(text, PyList_CheckExact(text)) : Py_None;
+ Py_INCREF(JOIN_OBJ(text));
+ _set_joined_ptr(&self->text, text);
+
+ tail = tail ? JOIN_SET(tail, PyList_CheckExact(tail)) : Py_None;
+ Py_INCREF(JOIN_OBJ(tail));
+ _set_joined_ptr(&self->tail, tail);
+
+ /* Handle ATTRIB and CHILDREN. */
+ if (!children && !attrib) {
+ Py_RETURN_NONE;
+ }
+
+ /* Compute 'nchildren'. */
+ if (children) {
+ if (!PyList_Check(children)) {
+ PyErr_SetString(PyExc_TypeError, "'_children' is not a list");
+ return NULL;
+ }
+ nchildren = PyList_GET_SIZE(children);
+
+ /* (Re-)allocate 'extra'.
+ Avoid DECREFs calling into this code again (cycles, etc.)
+ */
+ oldextra = self->extra;
+ self->extra = NULL;
+ if (element_resize(self, nchildren)) {
+ assert(!self->extra || !self->extra->length);
+ clear_extra(self);
+ self->extra = oldextra;
+ return NULL;
+ }
+ assert(self->extra);
+ assert(self->extra->allocated >= nchildren);
+ if (oldextra) {
+ assert(self->extra->attrib == NULL);
+ self->extra->attrib = oldextra->attrib;
+ oldextra->attrib = NULL;
+ }
+
+ /* Copy children */
+ for (i = 0; i < nchildren; i++) {
+ PyObject *child = PyList_GET_ITEM(children, i);
+ if (!Element_Check(st, child)) {
+ raise_type_error(child);
+ self->extra->length = i;
+ dealloc_extra(oldextra);
+ return NULL;
+ }
+ self->extra->children[i] = Py_NewRef(child);
+ }
+
+ assert(!self->extra->length);
+ self->extra->length = nchildren;
+ }
+ else {
+ if (element_resize(self, 0)) {
+ return NULL;
+ }
+ }
+
+ /* Stash attrib. */
+ Py_XSETREF(self->extra->attrib, Py_XNewRef(attrib));
+ dealloc_extra(oldextra);
+
+ Py_RETURN_NONE;
+}
+
+/* __setstate__ for Element instance from the Python implementation.
+ * 'state' should be the instance dict.
+ */
+
+static PyObject *
+element_setstate_from_Python(elementtreestate *st, ElementObject *self,
+ PyObject *state)
+{
+ static char *kwlist[] = {PICKLED_TAG, PICKLED_ATTRIB, PICKLED_TEXT,
+ PICKLED_TAIL, PICKLED_CHILDREN, 0};
+ PyObject *args;
+ PyObject *tag, *attrib, *text, *tail, *children;
+ PyObject *retval;
+
+ tag = attrib = text = tail = children = NULL;
+ args = PyTuple_New(0);
+ if (!args)
+ return NULL;
+
+ if (PyArg_ParseTupleAndKeywords(args, state, "|$OOOOO", kwlist, &tag,
+ &attrib, &text, &tail, &children))
+ retval = element_setstate_from_attributes(st, self, tag, attrib, text,
+ tail, children);
+ else
+ retval = NULL;
+
+ Py_DECREF(args);
+ return retval;
+}
+
+/*[clinic input]
+_elementtree.Element.__setstate__
+
+ cls: defining_class
+ state: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element___setstate___impl(ElementObject *self,
+ PyTypeObject *cls, PyObject *state)
+/*[clinic end generated code: output=598bfb5730f71509 input=13830488d35d51f7]*/
+{
+ if (!PyDict_CheckExact(state)) {
+ PyErr_Format(PyExc_TypeError,
+ "Don't know how to unpickle \"%.200R\" as an Element",
+ state);
+ return NULL;
+ }
+ else {
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+ return element_setstate_from_Python(st, self, state);
+ }
+}
+
+LOCAL(int)
+checkpath(PyObject* tag)
+{
+ Py_ssize_t i;
+ int check = 1;
+
+ /* check if a tag contains an xpath character */
+
+#define PATHCHAR(ch) \
+ (ch == '/' || ch == '*' || ch == '[' || ch == '@' || ch == '.')
+
+ if (PyUnicode_Check(tag)) {
+ const Py_ssize_t len = PyUnicode_GET_LENGTH(tag);
+ const void *data = PyUnicode_DATA(tag);
+ int kind = PyUnicode_KIND(tag);
+ if (len >= 3 && PyUnicode_READ(kind, data, 0) == '{' && (
+ PyUnicode_READ(kind, data, 1) == '}' || (
+ PyUnicode_READ(kind, data, 1) == '*' &&
+ PyUnicode_READ(kind, data, 2) == '}'))) {
+ /* wildcard: '{}tag' or '{*}tag' */
+ return 1;
+ }
+ for (i = 0; i < len; i++) {
+ Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+ if (ch == '{')
+ check = 0;
+ else if (ch == '}')
+ check = 1;
+ else if (check && PATHCHAR(ch))
+ return 1;
+ }
+ return 0;
+ }
+ if (PyBytes_Check(tag)) {
+ const char *p = PyBytes_AS_STRING(tag);
+ const Py_ssize_t len = PyBytes_GET_SIZE(tag);
+ if (len >= 3 && p[0] == '{' && (
+ p[1] == '}' || (p[1] == '*' && p[2] == '}'))) {
+ /* wildcard: '{}tag' or '{*}tag' */
+ return 1;
+ }
+ for (i = 0; i < len; i++) {
+ if (p[i] == '{')
+ check = 0;
+ else if (p[i] == '}')
+ check = 1;
+ else if (check && PATHCHAR(p[i]))
+ return 1;
+ }
+ return 0;
+ }
+
+ return 1; /* unknown type; might be path expression */
+}
+
+/*[clinic input]
+_elementtree.Element.extend
+
+ cls: defining_class
+ elements: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_extend_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *elements)
+/*[clinic end generated code: output=3e86d37fac542216 input=6479b1b5379d09ae]*/
+{
+ PyObject* seq;
+ Py_ssize_t i;
+
+ seq = PySequence_Fast(elements, "");
+ if (!seq) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "expected sequence, not \"%.200s\"", Py_TYPE(elements)->tp_name
+ );
+ return NULL;
+ }
+
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+ for (i = 0; i < PySequence_Fast_GET_SIZE(seq); i++) {
+ PyObject* element = Py_NewRef(PySequence_Fast_GET_ITEM(seq, i));
+ if (element_add_subelement(st, self, element) < 0) {
+ Py_DECREF(seq);
+ Py_DECREF(element);
+ return NULL;
+ }
+ Py_DECREF(element);
+ }
+
+ Py_DECREF(seq);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_elementtree.Element.find
+
+ cls: defining_class
+ /
+ path: object
+ namespaces: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_find_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *namespaces)
+/*[clinic end generated code: output=18f77d393c9fef1b input=94df8a83f956acc6]*/
+{
+ Py_ssize_t i;
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+
+ if (checkpath(path) || namespaces != Py_None) {
+ return PyObject_CallMethodObjArgs(
+ st->elementpath_obj, st->str_find, self, path, namespaces, NULL
+ );
+ }
+
+ if (!self->extra)
+ Py_RETURN_NONE;
+
+ for (i = 0; i < self->extra->length; i++) {
+ PyObject* item = self->extra->children[i];
+ int rc;
+ assert(Element_Check(st, item));
+ Py_INCREF(item);
+ rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ);
+ if (rc > 0)
+ return item;
+ Py_DECREF(item);
+ if (rc < 0)
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_elementtree.Element.findtext
+
+ cls: defining_class
+ /
+ path: object
+ default: object = None
+ namespaces: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_findtext_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *default_value,
+ PyObject *namespaces)
+/*[clinic end generated code: output=6af7a2d96aac32cb input=32f252099f62a3d2]*/
+{
+ Py_ssize_t i;
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+
+ if (checkpath(path) || namespaces != Py_None)
+ return PyObject_CallMethodObjArgs(
+ st->elementpath_obj, st->str_findtext,
+ self, path, default_value, namespaces, NULL
+ );
+
+ if (!self->extra) {
+ return Py_NewRef(default_value);
+ }
+
+ for (i = 0; i < self->extra->length; i++) {
+ PyObject *item = self->extra->children[i];
+ int rc;
+ assert(Element_Check(st, item));
+ Py_INCREF(item);
+ rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ);
+ if (rc > 0) {
+ PyObject* text = element_get_text((ElementObject*)item);
+ if (text == Py_None) {
+ Py_DECREF(item);
+ return PyUnicode_New(0, 0);
+ }
+ Py_XINCREF(text);
+ Py_DECREF(item);
+ return text;
+ }
+ Py_DECREF(item);
+ if (rc < 0)
+ return NULL;
+ }
+
+ return Py_NewRef(default_value);
+}
+
+/*[clinic input]
+_elementtree.Element.findall
+
+ cls: defining_class
+ /
+ path: object
+ namespaces: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_findall_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *namespaces)
+/*[clinic end generated code: output=65e39a1208f3b59e input=7aa0db45673fc9a5]*/
+{
+ Py_ssize_t i;
+ PyObject* out;
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+
+ if (checkpath(path) || namespaces != Py_None) {
+ return PyObject_CallMethodObjArgs(
+ st->elementpath_obj, st->str_findall, self, path, namespaces, NULL
+ );
+ }
+
+ out = PyList_New(0);
+ if (!out)
+ return NULL;
+
+ if (!self->extra)
+ return out;
+
+ for (i = 0; i < self->extra->length; i++) {
+ PyObject* item = self->extra->children[i];
+ int rc;
+ assert(Element_Check(st, item));
+ Py_INCREF(item);
+ rc = PyObject_RichCompareBool(((ElementObject*)item)->tag, path, Py_EQ);
+ if (rc != 0 && (rc < 0 || PyList_Append(out, item) < 0)) {
+ Py_DECREF(item);
+ Py_DECREF(out);
+ return NULL;
+ }
+ Py_DECREF(item);
+ }
+
+ return out;
+}
+
+/*[clinic input]
+_elementtree.Element.iterfind
+
+ cls: defining_class
+ /
+ path: object
+ namespaces: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_iterfind_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *namespaces)
+/*[clinic end generated code: output=be5c3f697a14e676 input=88766875a5c9a88b]*/
+{
+ PyObject* tag = path;
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+
+ return PyObject_CallMethodObjArgs(
+ st->elementpath_obj, st->str_iterfind, self, tag, namespaces, NULL);
+}
+
+/*[clinic input]
+_elementtree.Element.get
+
+ key: object
+ default: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_get_impl(ElementObject *self, PyObject *key,
+ PyObject *default_value)
+/*[clinic end generated code: output=523c614142595d75 input=ee153bbf8cdb246e]*/
+{
+ if (self->extra && self->extra->attrib) {
+ PyObject *attrib = Py_NewRef(self->extra->attrib);
+ PyObject *value = Py_XNewRef(PyDict_GetItemWithError(attrib, key));
+ Py_DECREF(attrib);
+ if (value != NULL || PyErr_Occurred()) {
+ return value;
+ }
+ }
+
+ return Py_NewRef(default_value);
+}
+
+static PyObject *
+create_elementiter(elementtreestate *st, ElementObject *self, PyObject *tag,
+ int gettext);
+
+
+/*[clinic input]
+_elementtree.Element.iter
+
+ cls: defining_class
+ /
+ tag: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_iter_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *tag)
+/*[clinic end generated code: output=bff29dc5d4566c68 input=f6944c48d3f84c58]*/
+{
+ if (PyUnicode_Check(tag)) {
+ if (PyUnicode_READY(tag) < 0)
+ return NULL;
+ if (PyUnicode_GET_LENGTH(tag) == 1 && PyUnicode_READ_CHAR(tag, 0) == '*')
+ tag = Py_None;
+ }
+ else if (PyBytes_Check(tag)) {
+ if (PyBytes_GET_SIZE(tag) == 1 && *PyBytes_AS_STRING(tag) == '*')
+ tag = Py_None;
+ }
+
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+ return create_elementiter(st, self, tag, 0);
+}
+
+
+/*[clinic input]
+_elementtree.Element.itertext
+
+ cls: defining_class
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_itertext_impl(ElementObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=fdeb2a3bca0ae063 input=a1ef1f0fc872a586]*/
+{
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+ return create_elementiter(st, self, Py_None, 1);
+}
+
+
+static PyObject*
+element_getitem(PyObject* self_, Py_ssize_t index)
+{
+ ElementObject* self = (ElementObject*) self_;
+
+ if (!self->extra || index < 0 || index >= self->extra->length) {
+ PyErr_SetString(
+ PyExc_IndexError,
+ "child index out of range"
+ );
+ return NULL;
+ }
+
+ return Py_NewRef(self->extra->children[index]);
+}
+
+static int
+element_bool(PyObject* self_)
+{
+ ElementObject* self = (ElementObject*) self_;
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "Testing an element's truth value will raise an exception "
+ "in future versions. Use specific 'len(elem)' or "
+ "'elem is not None' test instead.",
+ 1) < 0) {
+ return -1;
+ };
+ if (self->extra ? self->extra->length : 0) {
+ return 1;
+ }
+ return 0;
+}
+
+/*[clinic input]
+_elementtree.Element.insert
+
+ index: Py_ssize_t
+ subelement: object(subclass_of='clinic_state()->Element_Type')
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index,
+ PyObject *subelement)
+/*[clinic end generated code: output=990adfef4d424c0b input=9530f4905aa401ca]*/
+{
+ Py_ssize_t i;
+
+ if (!self->extra) {
+ if (create_extra(self, NULL) < 0)
+ return NULL;
+ }
+
+ if (index < 0) {
+ index += self->extra->length;
+ if (index < 0)
+ index = 0;
+ }
+ if (index > self->extra->length)
+ index = self->extra->length;
+
+ if (element_resize(self, 1) < 0)
+ return NULL;
+
+ for (i = self->extra->length; i > index; i--)
+ self->extra->children[i] = self->extra->children[i-1];
+
+ self->extra->children[index] = Py_NewRef(subelement);
+
+ self->extra->length++;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_elementtree.Element.items
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_items_impl(ElementObject *self)
+/*[clinic end generated code: output=6db2c778ce3f5a4d input=adbe09aaea474447]*/
+{
+ if (!self->extra || !self->extra->attrib)
+ return PyList_New(0);
+
+ return PyDict_Items(self->extra->attrib);
+}
+
+/*[clinic input]
+_elementtree.Element.keys
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_keys_impl(ElementObject *self)
+/*[clinic end generated code: output=bc5bfabbf20eeb3c input=f02caf5b496b5b0b]*/
+{
+ if (!self->extra || !self->extra->attrib)
+ return PyList_New(0);
+
+ return PyDict_Keys(self->extra->attrib);
+}
+
+static Py_ssize_t
+element_length(ElementObject* self)
+{
+ if (!self->extra)
+ return 0;
+
+ return self->extra->length;
+}
+
+/*[clinic input]
+_elementtree.Element.makeelement
+
+ cls: defining_class
+ tag: object
+ attrib: object(subclass_of='&PyDict_Type')
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_makeelement_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *tag, PyObject *attrib)
+/*[clinic end generated code: output=d50bb17a47077d47 input=589829dab92f26e8]*/
+{
+ PyObject* elem;
+
+ attrib = PyDict_Copy(attrib);
+ if (!attrib)
+ return NULL;
+
+ elementtreestate *st = get_elementtree_state_by_cls(cls);
+ elem = create_new_element(st, tag, attrib);
+
+ Py_DECREF(attrib);
+
+ return elem;
+}
+
+/*[clinic input]
+_elementtree.Element.remove
+
+ subelement: object(subclass_of='clinic_state()->Element_Type')
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement)
+/*[clinic end generated code: output=38fe6c07d6d87d1f input=6133e1d05597d5ee]*/
+{
+ Py_ssize_t i;
+ int rc;
+ PyObject *found;
+
+ if (!self->extra) {
+ /* element has no children, so raise exception */
+ PyErr_SetString(
+ PyExc_ValueError,
+ "list.remove(x): x not in list"
+ );
+ return NULL;
+ }
+
+ for (i = 0; i < self->extra->length; i++) {
+ if (self->extra->children[i] == subelement)
+ break;
+ rc = PyObject_RichCompareBool(self->extra->children[i], subelement, Py_EQ);
+ if (rc > 0)
+ break;
+ if (rc < 0)
+ return NULL;
+ }
+
+ if (i >= self->extra->length) {
+ /* subelement is not in children, so raise exception */
+ PyErr_SetString(
+ PyExc_ValueError,
+ "list.remove(x): x not in list"
+ );
+ return NULL;
+ }
+
+ found = self->extra->children[i];
+
+ self->extra->length--;
+ for (; i < self->extra->length; i++)
+ self->extra->children[i] = self->extra->children[i+1];
+
+ Py_DECREF(found);
+ Py_RETURN_NONE;
+}
+
+static PyObject*
+element_repr(ElementObject* self)
+{
+ int status;
+
+ if (self->tag == NULL)
+ return PyUnicode_FromFormat("<Element at %p>", self);
+
+ status = Py_ReprEnter((PyObject *)self);
+ if (status == 0) {
+ PyObject *res;
+ res = PyUnicode_FromFormat("<Element %R at %p>", self->tag, self);
+ Py_ReprLeave((PyObject *)self);
+ return res;
+ }
+ if (status > 0)
+ PyErr_Format(PyExc_RuntimeError,
+ "reentrant call inside %s.__repr__",
+ Py_TYPE(self)->tp_name);
+ return NULL;
+}
+
+/*[clinic input]
+_elementtree.Element.set
+
+ key: object
+ value: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_Element_set_impl(ElementObject *self, PyObject *key,
+ PyObject *value)
+/*[clinic end generated code: output=fb938806be3c5656 input=1efe90f7d82b3fe9]*/
+{
+ PyObject* attrib;
+
+ if (!self->extra) {
+ if (create_extra(self, NULL) < 0)
+ return NULL;
+ }
+
+ attrib = element_get_attrib(self);
+ if (!attrib)
+ return NULL;
+
+ if (PyDict_SetItem(attrib, key, value) < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static int
+element_setitem(PyObject* self_, Py_ssize_t index, PyObject* item)
+{
+ ElementObject* self = (ElementObject*) self_;
+ Py_ssize_t i;
+ PyObject* old;
+
+ if (!self->extra || index < 0 || index >= self->extra->length) {
+ PyErr_SetString(
+ PyExc_IndexError,
+ "child assignment index out of range");
+ return -1;
+ }
+
+ old = self->extra->children[index];
+
+ if (item) {
+ PyTypeObject *tp = Py_TYPE(self);
+ elementtreestate *st = get_elementtree_state_by_type(tp);
+ if (!Element_Check(st, item)) {
+ raise_type_error(item);
+ return -1;
+ }
+ self->extra->children[index] = Py_NewRef(item);
+ } else {
+ self->extra->length--;
+ for (i = index; i < self->extra->length; i++)
+ self->extra->children[i] = self->extra->children[i+1];
+ }
+
+ Py_DECREF(old);
+
+ return 0;
+}
+
+static PyObject*
+element_subscr(PyObject* self_, PyObject* item)
+{
+ ElementObject* self = (ElementObject*) self_;
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ if (i < 0 && self->extra)
+ i += self->extra->length;
+ return element_getitem(self_, i);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen, i;
+ size_t cur;
+ PyObject* list;
+
+ if (!self->extra)
+ return PyList_New(0);
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return NULL;
+ }
+ slicelen = PySlice_AdjustIndices(self->extra->length, &start, &stop,
+ step);
+
+ if (slicelen <= 0)
+ return PyList_New(0);
+ else {
+ list = PyList_New(slicelen);
+ if (!list)
+ return NULL;
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ PyObject* item = Py_NewRef(self->extra->children[cur]);
+ PyList_SET_ITEM(list, i, item);
+ }
+
+ return list;
+ }
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "element indices must be integers");
+ return NULL;
+ }
+}
+
+static int
+element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value)
+{
+ ElementObject* self = (ElementObject*) self_;
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ if (i < 0 && self->extra)
+ i += self->extra->length;
+ return element_setitem(self_, i, value);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen, newlen, i;
+ size_t cur;
+
+ PyObject* recycle = NULL;
+ PyObject* seq;
+
+ if (!self->extra) {
+ if (create_extra(self, NULL) < 0)
+ return -1;
+ }
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return -1;
+ }
+ slicelen = PySlice_AdjustIndices(self->extra->length, &start, &stop,
+ step);
+
+ if (value == NULL) {
+ /* Delete slice */
+ size_t cur;
+ Py_ssize_t i;
+
+ if (slicelen <= 0)
+ return 0;
+
+ /* Since we're deleting, the direction of the range doesn't matter,
+ * so for simplicity make it always ascending.
+ */
+ if (step < 0) {
+ stop = start + 1;
+ start = stop + step * (slicelen - 1) - 1;
+ step = -step;
+ }
+
+ assert((size_t)slicelen <= SIZE_MAX / sizeof(PyObject *));
+
+ /* recycle is a list that will contain all the children
+ * scheduled for removal.
+ */
+ if (!(recycle = PyList_New(slicelen))) {
+ return -1;
+ }
+
+ /* This loop walks over all the children that have to be deleted,
+ * with cur pointing at them. num_moved is the amount of children
+ * until the next deleted child that have to be "shifted down" to
+ * occupy the deleted's places.
+ * Note that in the ith iteration, shifting is done i+i places down
+ * because i children were already removed.
+ */
+ for (cur = start, i = 0; cur < (size_t)stop; cur += step, ++i) {
+ /* Compute how many children have to be moved, clipping at the
+ * list end.
+ */
+ Py_ssize_t num_moved = step - 1;
+ if (cur + step >= (size_t)self->extra->length) {
+ num_moved = self->extra->length - cur - 1;
+ }
+
+ PyList_SET_ITEM(recycle, i, self->extra->children[cur]);
+
+ memmove(
+ self->extra->children + cur - i,
+ self->extra->children + cur + 1,
+ num_moved * sizeof(PyObject *));
+ }
+
+ /* Leftover "tail" after the last removed child */
+ cur = start + (size_t)slicelen * step;
+ if (cur < (size_t)self->extra->length) {
+ memmove(
+ self->extra->children + cur - slicelen,
+ self->extra->children + cur,
+ (self->extra->length - cur) * sizeof(PyObject *));
+ }
+
+ self->extra->length -= slicelen;
+
+ /* Discard the recycle list with all the deleted sub-elements */
+ Py_DECREF(recycle);
+ return 0;
+ }
+
+ /* A new slice is actually being assigned */
+ seq = PySequence_Fast(value, "");
+ if (!seq) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "expected sequence, not \"%.200s\"", Py_TYPE(value)->tp_name
+ );
+ return -1;
+ }
+ newlen = PySequence_Fast_GET_SIZE(seq);
+
+ if (step != 1 && newlen != slicelen)
+ {
+ Py_DECREF(seq);
+ PyErr_Format(PyExc_ValueError,
+ "attempt to assign sequence of size %zd "
+ "to extended slice of size %zd",
+ newlen, slicelen
+ );
+ return -1;
+ }
+
+ /* Resize before creating the recycle bin, to prevent refleaks. */
+ if (newlen > slicelen) {
+ if (element_resize(self, newlen - slicelen) < 0) {
+ Py_DECREF(seq);
+ return -1;
+ }
+ }
+
+ PyTypeObject *tp = Py_TYPE(self);
+ elementtreestate *st = get_elementtree_state_by_type(tp);
+ for (i = 0; i < newlen; i++) {
+ PyObject *element = PySequence_Fast_GET_ITEM(seq, i);
+ if (!Element_Check(st, element)) {
+ raise_type_error(element);
+ Py_DECREF(seq);
+ return -1;
+ }
+ }
+
+ if (slicelen > 0) {
+ /* to avoid recursive calls to this method (via decref), move
+ old items to the recycle bin here, and get rid of them when
+ we're done modifying the element */
+ recycle = PyList_New(slicelen);
+ if (!recycle) {
+ Py_DECREF(seq);
+ return -1;
+ }
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++)
+ PyList_SET_ITEM(recycle, i, self->extra->children[cur]);
+ }
+
+ if (newlen < slicelen) {
+ /* delete slice */
+ for (i = stop; i < self->extra->length; i++)
+ self->extra->children[i + newlen - slicelen] = self->extra->children[i];
+ } else if (newlen > slicelen) {
+ /* insert slice */
+ for (i = self->extra->length-1; i >= stop; i--)
+ self->extra->children[i + newlen - slicelen] = self->extra->children[i];
+ }
+
+ /* replace the slice */
+ for (cur = start, i = 0; i < newlen;
+ cur += step, i++) {
+ PyObject* element = PySequence_Fast_GET_ITEM(seq, i);
+ self->extra->children[cur] = Py_NewRef(element);
+ }
+
+ self->extra->length += newlen - slicelen;
+
+ Py_DECREF(seq);
+
+ /* discard the recycle bin, and everything in it */
+ Py_XDECREF(recycle);
+
+ return 0;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "element indices must be integers");
+ return -1;
+ }
+}
+
+static PyObject*
+element_tag_getter(ElementObject *self, void *closure)
+{
+ PyObject *res = self->tag;
+ return Py_NewRef(res);
+}
+
+static PyObject*
+element_text_getter(ElementObject *self, void *closure)
+{
+ PyObject *res = element_get_text(self);
+ return Py_XNewRef(res);
+}
+
+static PyObject*
+element_tail_getter(ElementObject *self, void *closure)
+{
+ PyObject *res = element_get_tail(self);
+ return Py_XNewRef(res);
+}
+
+static PyObject*
+element_attrib_getter(ElementObject *self, void *closure)
+{
+ PyObject *res;
+ if (!self->extra) {
+ if (create_extra(self, NULL) < 0)
+ return NULL;
+ }
+ res = element_get_attrib(self);
+ return Py_XNewRef(res);
+}
+
+/* macro for setter validation */
+#define _VALIDATE_ATTR_VALUE(V) \
+ if ((V) == NULL) { \
+ PyErr_SetString( \
+ PyExc_AttributeError, \
+ "can't delete element attribute"); \
+ return -1; \
+ }
+
+static int
+element_tag_setter(ElementObject *self, PyObject *value, void *closure)
+{
+ _VALIDATE_ATTR_VALUE(value);
+ Py_SETREF(self->tag, Py_NewRef(value));
+ return 0;
+}
+
+static int
+element_text_setter(ElementObject *self, PyObject *value, void *closure)
+{
+ _VALIDATE_ATTR_VALUE(value);
+ _set_joined_ptr(&self->text, Py_NewRef(value));
+ return 0;
+}
+
+static int
+element_tail_setter(ElementObject *self, PyObject *value, void *closure)
+{
+ _VALIDATE_ATTR_VALUE(value);
+ _set_joined_ptr(&self->tail, Py_NewRef(value));
+ return 0;
+}
+
+static int
+element_attrib_setter(ElementObject *self, PyObject *value, void *closure)
+{
+ _VALIDATE_ATTR_VALUE(value);
+ if (!PyDict_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "attrib must be dict, not %.200s",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ if (!self->extra) {
+ if (create_extra(self, NULL) < 0)
+ return -1;
+ }
+ Py_XSETREF(self->extra->attrib, Py_NewRef(value));
+ return 0;
+}
+
+/******************************* Element iterator ****************************/
+
+/* ElementIterObject represents the iteration state over an XML element in
+ * pre-order traversal. To keep track of which sub-element should be returned
+ * next, a stack of parents is maintained. This is a standard stack-based
+ * iterative pre-order traversal of a tree.
+ * The stack is managed using a continuous array.
+ * Each stack item contains the saved parent to which we should return after
+ * the current one is exhausted, and the next child to examine in that parent.
+ */
+typedef struct ParentLocator_t {
+ ElementObject *parent;
+ Py_ssize_t child_index;
+} ParentLocator;
+
+typedef struct {
+ PyObject_HEAD
+ ParentLocator *parent_stack;
+ Py_ssize_t parent_stack_used;
+ Py_ssize_t parent_stack_size;
+ ElementObject *root_element;
+ PyObject *sought_tag;
+ int gettext;
+} ElementIterObject;
+
+
+static void
+elementiter_dealloc(ElementIterObject *it)
+{
+ PyTypeObject *tp = Py_TYPE(it);
+ Py_ssize_t i = it->parent_stack_used;
+ it->parent_stack_used = 0;
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(it);
+ while (i--)
+ Py_XDECREF(it->parent_stack[i].parent);
+ PyMem_Free(it->parent_stack);
+
+ Py_XDECREF(it->sought_tag);
+ Py_XDECREF(it->root_element);
+
+ tp->tp_free(it);
+ Py_DECREF(tp);
+}
+
+static int
+elementiter_traverse(ElementIterObject *it, visitproc visit, void *arg)
+{
+ Py_ssize_t i = it->parent_stack_used;
+ while (i--)
+ Py_VISIT(it->parent_stack[i].parent);
+
+ Py_VISIT(it->root_element);
+ Py_VISIT(it->sought_tag);
+ Py_VISIT(Py_TYPE(it));
+ return 0;
+}
+
+/* Helper function for elementiter_next. Add a new parent to the parent stack.
+ */
+static int
+parent_stack_push_new(ElementIterObject *it, ElementObject *parent)
+{
+ ParentLocator *item;
+
+ if (it->parent_stack_used >= it->parent_stack_size) {
+ Py_ssize_t new_size = it->parent_stack_size * 2; /* never overflow */
+ ParentLocator *parent_stack = it->parent_stack;
+ PyMem_Resize(parent_stack, ParentLocator, new_size);
+ if (parent_stack == NULL)
+ return -1;
+ it->parent_stack = parent_stack;
+ it->parent_stack_size = new_size;
+ }
+ item = it->parent_stack + it->parent_stack_used++;
+ item->parent = (ElementObject*)Py_NewRef(parent);
+ item->child_index = 0;
+ return 0;
+}
+
+static PyObject *
+elementiter_next(ElementIterObject *it)
+{
+ /* Sub-element iterator.
+ *
+ * A short note on gettext: this function serves both the iter() and
+ * itertext() methods to avoid code duplication. However, there are a few
+ * small differences in the way these iterations work. Namely:
+ * - itertext() only yields text from nodes that have it, and continues
+ * iterating when a node doesn't have text (so it doesn't return any
+ * node like iter())
+ * - itertext() also has to handle tail, after finishing with all the
+ * children of a node.
+ */
+ int rc;
+ ElementObject *elem;
+ PyObject *text;
+
+ while (1) {
+ /* Handle the case reached in the beginning and end of iteration, where
+ * the parent stack is empty. If root_element is NULL and we're here, the
+ * iterator is exhausted.
+ */
+ if (!it->parent_stack_used) {
+ if (!it->root_element) {
+ PyErr_SetNone(PyExc_StopIteration);
+ return NULL;
+ }
+
+ elem = it->root_element; /* steals a reference */
+ it->root_element = NULL;
+ }
+ else {
+ /* See if there are children left to traverse in the current parent. If
+ * yes, visit the next child. If not, pop the stack and try again.
+ */
+ ParentLocator *item = &it->parent_stack[it->parent_stack_used - 1];
+ Py_ssize_t child_index = item->child_index;
+ ElementObjectExtra *extra;
+ elem = item->parent;
+ extra = elem->extra;
+ if (!extra || child_index >= extra->length) {
+ it->parent_stack_used--;
+ /* Note that extra condition on it->parent_stack_used here;
+ * this is because itertext() is supposed to only return *inner*
+ * text, not text following the element it began iteration with.
+ */
+ if (it->gettext && it->parent_stack_used) {
+ text = element_get_tail(elem);
+ goto gettext;
+ }
+ Py_DECREF(elem);
+ continue;
+ }
+
+#ifndef NDEBUG
+ PyTypeObject *tp = Py_TYPE(it);
+ elementtreestate *st = get_elementtree_state_by_type(tp);
+ assert(Element_Check(st, extra->children[child_index]));
+#endif
+ elem = (ElementObject *)Py_NewRef(extra->children[child_index]);
+ item->child_index++;
+ }
+
+ if (parent_stack_push_new(it, elem) < 0) {
+ Py_DECREF(elem);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ if (it->gettext) {
+ text = element_get_text(elem);
+ goto gettext;
+ }
+
+ if (it->sought_tag == Py_None)
+ return (PyObject *)elem;
+
+ rc = PyObject_RichCompareBool(elem->tag, it->sought_tag, Py_EQ);
+ if (rc > 0)
+ return (PyObject *)elem;
+
+ Py_DECREF(elem);
+ if (rc < 0)
+ return NULL;
+ continue;
+
+gettext:
+ if (!text) {
+ Py_DECREF(elem);
+ return NULL;
+ }
+ if (text == Py_None) {
+ Py_DECREF(elem);
+ }
+ else {
+ Py_INCREF(text);
+ Py_DECREF(elem);
+ rc = PyObject_IsTrue(text);
+ if (rc > 0)
+ return text;
+ Py_DECREF(text);
+ if (rc < 0)
+ return NULL;
+ }
+ }
+
+ return NULL;
+}
+
+static PyType_Slot elementiter_slots[] = {
+ {Py_tp_dealloc, elementiter_dealloc},
+ {Py_tp_traverse, elementiter_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, elementiter_next},
+ {0, NULL},
+};
+
+static PyType_Spec elementiter_spec = {
+ /* Using the module's name since the pure-Python implementation does not
+ have such a type. */
+ .name = "_elementtree._element_iterator",
+ .basicsize = sizeof(ElementIterObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = elementiter_slots,
+};
+
+#define INIT_PARENT_STACK_SIZE 8
+
+static PyObject *
+create_elementiter(elementtreestate *st, ElementObject *self, PyObject *tag,
+ int gettext)
+{
+ ElementIterObject *it;
+
+ it = PyObject_GC_New(ElementIterObject, st->ElementIter_Type);
+ if (!it)
+ return NULL;
+
+ it->sought_tag = Py_NewRef(tag);
+ it->gettext = gettext;
+ it->root_element = (ElementObject*)Py_NewRef(self);
+
+ it->parent_stack = PyMem_New(ParentLocator, INIT_PARENT_STACK_SIZE);
+ if (it->parent_stack == NULL) {
+ Py_DECREF(it);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ it->parent_stack_used = 0;
+ it->parent_stack_size = INIT_PARENT_STACK_SIZE;
+
+ PyObject_GC_Track(it);
+
+ return (PyObject *)it;
+}
+
+
+/* ==================================================================== */
+/* the tree builder type */
+
+typedef struct {
+ PyObject_HEAD
+
+ PyObject *root; /* root node (first created node) */
+
+ PyObject *this; /* current node */
+ PyObject *last; /* most recently created node */
+ PyObject *last_for_tail; /* most recently created node that takes a tail */
+
+ PyObject *data; /* data collector (string or list), or NULL */
+
+ PyObject *stack; /* element stack */
+ Py_ssize_t index; /* current stack size (0 means empty) */
+
+ PyObject *element_factory;
+ PyObject *comment_factory;
+ PyObject *pi_factory;
+
+ /* element tracing */
+ PyObject *events_append; /* the append method of the list of events, or NULL */
+ PyObject *start_event_obj; /* event objects (NULL to ignore) */
+ PyObject *end_event_obj;
+ PyObject *start_ns_event_obj;
+ PyObject *end_ns_event_obj;
+ PyObject *comment_event_obj;
+ PyObject *pi_event_obj;
+
+ char insert_comments;
+ char insert_pis;
+ elementtreestate *state;
+} TreeBuilderObject;
+
+#define TreeBuilder_CheckExact(st, op) Py_IS_TYPE((op), (st)->TreeBuilder_Type)
+
+/* -------------------------------------------------------------------- */
+/* constructor and destructor */
+
+static PyObject *
+treebuilder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ TreeBuilderObject *t = (TreeBuilderObject *)type->tp_alloc(type, 0);
+ if (t != NULL) {
+ t->root = NULL;
+ t->this = Py_NewRef(Py_None);
+ t->last = Py_NewRef(Py_None);
+ t->data = NULL;
+ t->element_factory = NULL;
+ t->comment_factory = NULL;
+ t->pi_factory = NULL;
+ t->stack = PyList_New(20);
+ if (!t->stack) {
+ Py_DECREF(t->this);
+ Py_DECREF(t->last);
+ Py_DECREF((PyObject *) t);
+ return NULL;
+ }
+ t->index = 0;
+
+ t->events_append = NULL;
+ t->start_event_obj = t->end_event_obj = NULL;
+ t->start_ns_event_obj = t->end_ns_event_obj = NULL;
+ t->comment_event_obj = t->pi_event_obj = NULL;
+ t->insert_comments = t->insert_pis = 0;
+ t->state = get_elementtree_state_by_type(type);
+ }
+ return (PyObject *)t;
+}
+
+/*[clinic input]
+_elementtree.TreeBuilder.__init__
+
+ element_factory: object = None
+ *
+ comment_factory: object = None
+ pi_factory: object = None
+ insert_comments: bool = False
+ insert_pis: bool = False
+
+[clinic start generated code]*/
+
+static int
+_elementtree_TreeBuilder___init___impl(TreeBuilderObject *self,
+ PyObject *element_factory,
+ PyObject *comment_factory,
+ PyObject *pi_factory,
+ int insert_comments, int insert_pis)
+/*[clinic end generated code: output=8571d4dcadfdf952 input=ae98a94df20b5cc3]*/
+{
+ if (element_factory != Py_None) {
+ Py_XSETREF(self->element_factory, Py_NewRef(element_factory));
+ } else {
+ Py_CLEAR(self->element_factory);
+ }
+
+ if (comment_factory == Py_None) {
+ elementtreestate *st = self->state;
+ comment_factory = st->comment_factory;
+ }
+ if (comment_factory) {
+ Py_XSETREF(self->comment_factory, Py_NewRef(comment_factory));
+ self->insert_comments = insert_comments;
+ } else {
+ Py_CLEAR(self->comment_factory);
+ self->insert_comments = 0;
+ }
+
+ if (pi_factory == Py_None) {
+ elementtreestate *st = self->state;
+ pi_factory = st->pi_factory;
+ }
+ if (pi_factory) {
+ Py_XSETREF(self->pi_factory, Py_NewRef(pi_factory));
+ self->insert_pis = insert_pis;
+ } else {
+ Py_CLEAR(self->pi_factory);
+ self->insert_pis = 0;
+ }
+
+ return 0;
+}
+
+static int
+treebuilder_gc_traverse(TreeBuilderObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->pi_event_obj);
+ Py_VISIT(self->comment_event_obj);
+ Py_VISIT(self->end_ns_event_obj);
+ Py_VISIT(self->start_ns_event_obj);
+ Py_VISIT(self->end_event_obj);
+ Py_VISIT(self->start_event_obj);
+ Py_VISIT(self->events_append);
+ Py_VISIT(self->root);
+ Py_VISIT(self->this);
+ Py_VISIT(self->last);
+ Py_VISIT(self->last_for_tail);
+ Py_VISIT(self->data);
+ Py_VISIT(self->stack);
+ Py_VISIT(self->pi_factory);
+ Py_VISIT(self->comment_factory);
+ Py_VISIT(self->element_factory);
+ return 0;
+}
+
+static int
+treebuilder_gc_clear(TreeBuilderObject *self)
+{
+ Py_CLEAR(self->pi_event_obj);
+ Py_CLEAR(self->comment_event_obj);
+ Py_CLEAR(self->end_ns_event_obj);
+ Py_CLEAR(self->start_ns_event_obj);
+ Py_CLEAR(self->end_event_obj);
+ Py_CLEAR(self->start_event_obj);
+ Py_CLEAR(self->events_append);
+ Py_CLEAR(self->stack);
+ Py_CLEAR(self->data);
+ Py_CLEAR(self->last);
+ Py_CLEAR(self->last_for_tail);
+ Py_CLEAR(self->this);
+ Py_CLEAR(self->pi_factory);
+ Py_CLEAR(self->comment_factory);
+ Py_CLEAR(self->element_factory);
+ Py_CLEAR(self->root);
+ return 0;
+}
+
+static void
+treebuilder_dealloc(TreeBuilderObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ treebuilder_gc_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+/* -------------------------------------------------------------------- */
+/* helpers for handling of arbitrary element-like objects */
+
+/*[clinic input]
+_elementtree._set_factories
+
+ comment_factory: object
+ pi_factory: object
+ /
+
+Change the factories used to create comments and processing instructions.
+
+For internal use only.
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree__set_factories_impl(PyObject *module, PyObject *comment_factory,
+ PyObject *pi_factory)
+/*[clinic end generated code: output=813b408adee26535 input=99d17627aea7fb3b]*/
+{
+ elementtreestate *st = get_elementtree_state(module);
+ PyObject *old;
+
+ if (!PyCallable_Check(comment_factory) && comment_factory != Py_None) {
+ PyErr_Format(PyExc_TypeError, "Comment factory must be callable, not %.100s",
+ Py_TYPE(comment_factory)->tp_name);
+ return NULL;
+ }
+ if (!PyCallable_Check(pi_factory) && pi_factory != Py_None) {
+ PyErr_Format(PyExc_TypeError, "PI factory must be callable, not %.100s",
+ Py_TYPE(pi_factory)->tp_name);
+ return NULL;
+ }
+
+ old = PyTuple_Pack(2,
+ st->comment_factory ? st->comment_factory : Py_None,
+ st->pi_factory ? st->pi_factory : Py_None);
+
+ if (comment_factory == Py_None) {
+ Py_CLEAR(st->comment_factory);
+ } else {
+ Py_XSETREF(st->comment_factory, Py_NewRef(comment_factory));
+ }
+ if (pi_factory == Py_None) {
+ Py_CLEAR(st->pi_factory);
+ } else {
+ Py_XSETREF(st->pi_factory, Py_NewRef(pi_factory));
+ }
+
+ return old;
+}
+
+static int
+treebuilder_extend_element_text_or_tail(elementtreestate *st, PyObject *element,
+ PyObject **data, PyObject **dest,
+ PyObject *name)
+{
+ /* Fast paths for the "almost always" cases. */
+ if (Element_CheckExact(st, element)) {
+ PyObject *dest_obj = JOIN_OBJ(*dest);
+ if (dest_obj == Py_None) {
+ *dest = JOIN_SET(*data, PyList_CheckExact(*data));
+ *data = NULL;
+ Py_DECREF(dest_obj);
+ return 0;
+ }
+ else if (JOIN_GET(*dest)) {
+ if (PyList_SetSlice(dest_obj, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, *data) < 0) {
+ return -1;
+ }
+ Py_CLEAR(*data);
+ return 0;
+ }
+ }
+
+ /* Fallback for the non-Element / non-trivial cases. */
+ {
+ int r;
+ PyObject* joined;
+ PyObject* previous = PyObject_GetAttr(element, name);
+ if (!previous)
+ return -1;
+ joined = list_join(*data);
+ if (!joined) {
+ Py_DECREF(previous);
+ return -1;
+ }
+ if (previous != Py_None) {
+ PyObject *tmp = PyNumber_Add(previous, joined);
+ Py_DECREF(joined);
+ Py_DECREF(previous);
+ if (!tmp)
+ return -1;
+ joined = tmp;
+ } else {
+ Py_DECREF(previous);
+ }
+
+ r = PyObject_SetAttr(element, name, joined);
+ Py_DECREF(joined);
+ if (r < 0)
+ return -1;
+ Py_CLEAR(*data);
+ return 0;
+ }
+}
+
+LOCAL(int)
+treebuilder_flush_data(TreeBuilderObject* self)
+{
+ if (!self->data) {
+ return 0;
+ }
+ elementtreestate *st = self->state;
+ if (!self->last_for_tail) {
+ PyObject *element = self->last;
+ return treebuilder_extend_element_text_or_tail(
+ st, element, &self->data,
+ &((ElementObject *) element)->text, st->str_text);
+ }
+ else {
+ PyObject *element = self->last_for_tail;
+ return treebuilder_extend_element_text_or_tail(
+ st, element, &self->data,
+ &((ElementObject *) element)->tail, st->str_tail);
+ }
+}
+
+static int
+treebuilder_add_subelement(elementtreestate *st, PyObject *element,
+ PyObject *child)
+{
+ if (Element_CheckExact(st, element)) {
+ ElementObject *elem = (ElementObject *) element;
+ return element_add_subelement(st, elem, child);
+ }
+ else {
+ PyObject *res;
+ res = PyObject_CallMethodOneArg(element, st->str_append, child);
+ if (res == NULL)
+ return -1;
+ Py_DECREF(res);
+ return 0;
+ }
+}
+
+LOCAL(int)
+treebuilder_append_event(TreeBuilderObject *self, PyObject *action,
+ PyObject *node)
+{
+ if (action != NULL) {
+ PyObject *res;
+ PyObject *event = PyTuple_Pack(2, action, node);
+ if (event == NULL)
+ return -1;
+ res = PyObject_CallOneArg(self->events_append, event);
+ Py_DECREF(event);
+ if (res == NULL)
+ return -1;
+ Py_DECREF(res);
+ }
+ return 0;
+}
+
+/* -------------------------------------------------------------------- */
+/* handlers */
+
+LOCAL(PyObject*)
+treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
+ PyObject* attrib)
+{
+ PyObject* node;
+ PyObject* this;
+ elementtreestate *st = self->state;
+
+ if (treebuilder_flush_data(self) < 0) {
+ return NULL;
+ }
+
+ if (!self->element_factory) {
+ node = create_new_element(st, tag, attrib);
+ }
+ else if (attrib == NULL) {
+ attrib = PyDict_New();
+ if (!attrib)
+ return NULL;
+ node = PyObject_CallFunctionObjArgs(self->element_factory,
+ tag, attrib, NULL);
+ Py_DECREF(attrib);
+ }
+ else {
+ node = PyObject_CallFunctionObjArgs(self->element_factory,
+ tag, attrib, NULL);
+ }
+ if (!node) {
+ return NULL;
+ }
+
+ this = self->this;
+ Py_CLEAR(self->last_for_tail);
+
+ if (this != Py_None) {
+ if (treebuilder_add_subelement(st, this, node) < 0) {
+ goto error;
+ }
+ } else {
+ if (self->root) {
+ PyErr_SetString(
+ st->parseerror_obj,
+ "multiple elements on top level"
+ );
+ goto error;
+ }
+ self->root = Py_NewRef(node);
+ }
+
+ if (self->index < PyList_GET_SIZE(self->stack)) {
+ if (PyList_SetItem(self->stack, self->index, this) < 0)
+ goto error;
+ Py_INCREF(this);
+ } else {
+ if (PyList_Append(self->stack, this) < 0)
+ goto error;
+ }
+ self->index++;
+
+ Py_SETREF(self->this, Py_NewRef(node));
+ Py_SETREF(self->last, Py_NewRef(node));
+
+ if (treebuilder_append_event(self, self->start_event_obj, node) < 0)
+ goto error;
+
+ return node;
+
+ error:
+ Py_DECREF(node);
+ return NULL;
+}
+
+LOCAL(PyObject*)
+treebuilder_handle_data(TreeBuilderObject* self, PyObject* data)
+{
+ if (!self->data) {
+ if (self->last == Py_None) {
+ /* ignore calls to data before the first call to start */
+ Py_RETURN_NONE;
+ }
+ /* store the first item as is */
+ self->data = Py_NewRef(data);
+ } else {
+ /* more than one item; use a list to collect items */
+ if (PyBytes_CheckExact(self->data) && Py_REFCNT(self->data) == 1 &&
+ PyBytes_CheckExact(data) && PyBytes_GET_SIZE(data) == 1) {
+ /* XXX this code path unused in Python 3? */
+ /* expat often generates single character data sections; handle
+ the most common case by resizing the existing string... */
+ Py_ssize_t size = PyBytes_GET_SIZE(self->data);
+ if (_PyBytes_Resize(&self->data, size + 1) < 0)
+ return NULL;
+ PyBytes_AS_STRING(self->data)[size] = PyBytes_AS_STRING(data)[0];
+ } else if (PyList_CheckExact(self->data)) {
+ if (PyList_Append(self->data, data) < 0)
+ return NULL;
+ } else {
+ PyObject* list = PyList_New(2);
+ if (!list)
+ return NULL;
+ PyList_SET_ITEM(list, 0, Py_NewRef(self->data));
+ PyList_SET_ITEM(list, 1, Py_NewRef(data));
+ Py_SETREF(self->data, list);
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+LOCAL(PyObject*)
+treebuilder_handle_end(TreeBuilderObject* self, PyObject* tag)
+{
+ PyObject* item;
+
+ if (treebuilder_flush_data(self) < 0) {
+ return NULL;
+ }
+
+ if (self->index == 0) {
+ PyErr_SetString(
+ PyExc_IndexError,
+ "pop from empty stack"
+ );
+ return NULL;
+ }
+
+ item = self->last;
+ self->last = Py_NewRef(self->this);
+ Py_XSETREF(self->last_for_tail, self->last);
+ self->index--;
+ self->this = Py_NewRef(PyList_GET_ITEM(self->stack, self->index));
+ Py_DECREF(item);
+
+ if (treebuilder_append_event(self, self->end_event_obj, self->last) < 0)
+ return NULL;
+
+ return Py_NewRef(self->last);
+}
+
+LOCAL(PyObject*)
+treebuilder_handle_comment(TreeBuilderObject* self, PyObject* text)
+{
+ PyObject* comment;
+ PyObject* this;
+
+ if (treebuilder_flush_data(self) < 0) {
+ return NULL;
+ }
+
+ if (self->comment_factory) {
+ comment = PyObject_CallOneArg(self->comment_factory, text);
+ if (!comment)
+ return NULL;
+
+ this = self->this;
+ if (self->insert_comments && this != Py_None) {
+ if (treebuilder_add_subelement(self->state, this, comment) < 0) {
+ goto error;
+ }
+ Py_XSETREF(self->last_for_tail, Py_NewRef(comment));
+ }
+ } else {
+ comment = Py_NewRef(text);
+ }
+
+ if (self->events_append && self->comment_event_obj) {
+ if (treebuilder_append_event(self, self->comment_event_obj, comment) < 0)
+ goto error;
+ }
+
+ return comment;
+
+ error:
+ Py_DECREF(comment);
+ return NULL;
+}
+
+LOCAL(PyObject*)
+treebuilder_handle_pi(TreeBuilderObject* self, PyObject* target, PyObject* text)
+{
+ PyObject* pi;
+ PyObject* this;
+ PyObject* stack[2] = {target, text};
+
+ if (treebuilder_flush_data(self) < 0) {
+ return NULL;
+ }
+
+ if (self->pi_factory) {
+ pi = _PyObject_FastCall(self->pi_factory, stack, 2);
+ if (!pi) {
+ return NULL;
+ }
+
+ this = self->this;
+ if (self->insert_pis && this != Py_None) {
+ if (treebuilder_add_subelement(self->state, this, pi) < 0) {
+ goto error;
+ }
+ Py_XSETREF(self->last_for_tail, Py_NewRef(pi));
+ }
+ } else {
+ pi = PyTuple_Pack(2, target, text);
+ if (!pi) {
+ return NULL;
+ }
+ }
+
+ if (self->events_append && self->pi_event_obj) {
+ if (treebuilder_append_event(self, self->pi_event_obj, pi) < 0)
+ goto error;
+ }
+
+ return pi;
+
+ error:
+ Py_DECREF(pi);
+ return NULL;
+}
+
+LOCAL(PyObject*)
+treebuilder_handle_start_ns(TreeBuilderObject* self, PyObject* prefix, PyObject* uri)
+{
+ PyObject* parcel;
+
+ if (self->events_append && self->start_ns_event_obj) {
+ parcel = PyTuple_Pack(2, prefix, uri);
+ if (!parcel) {
+ return NULL;
+ }
+
+ if (treebuilder_append_event(self, self->start_ns_event_obj, parcel) < 0) {
+ Py_DECREF(parcel);
+ return NULL;
+ }
+ Py_DECREF(parcel);
+ }
+
+ Py_RETURN_NONE;
+}
+
+LOCAL(PyObject*)
+treebuilder_handle_end_ns(TreeBuilderObject* self, PyObject* prefix)
+{
+ if (self->events_append && self->end_ns_event_obj) {
+ if (treebuilder_append_event(self, self->end_ns_event_obj, prefix) < 0) {
+ return NULL;
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+/* -------------------------------------------------------------------- */
+/* methods (in alphabetical order) */
+
+/*[clinic input]
+_elementtree.TreeBuilder.data
+
+ data: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_TreeBuilder_data(TreeBuilderObject *self, PyObject *data)
+/*[clinic end generated code: output=69144c7100795bb2 input=a0540c532b284d29]*/
+{
+ return treebuilder_handle_data(self, data);
+}
+
+/*[clinic input]
+_elementtree.TreeBuilder.end
+
+ tag: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_TreeBuilder_end(TreeBuilderObject *self, PyObject *tag)
+/*[clinic end generated code: output=9a98727cc691cd9d input=22dc3674236f5745]*/
+{
+ return treebuilder_handle_end(self, tag);
+}
+
+/*[clinic input]
+_elementtree.TreeBuilder.comment
+
+ text: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_TreeBuilder_comment(TreeBuilderObject *self, PyObject *text)
+/*[clinic end generated code: output=22835be41deeaa27 input=47e7ebc48ed01dfa]*/
+{
+ return treebuilder_handle_comment(self, text);
+}
+
+/*[clinic input]
+_elementtree.TreeBuilder.pi
+
+ target: object
+ text: object = None
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_TreeBuilder_pi_impl(TreeBuilderObject *self, PyObject *target,
+ PyObject *text)
+/*[clinic end generated code: output=21eb95ec9d04d1d9 input=349342bd79c35570]*/
+{
+ return treebuilder_handle_pi(self, target, text);
+}
+
+LOCAL(PyObject*)
+treebuilder_done(TreeBuilderObject* self)
+{
+ PyObject* res;
+
+ /* FIXME: check stack size? */
+
+ if (self->root)
+ res = self->root;
+ else
+ res = Py_None;
+
+ return Py_NewRef(res);
+}
+
+/*[clinic input]
+_elementtree.TreeBuilder.close
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_TreeBuilder_close_impl(TreeBuilderObject *self)
+/*[clinic end generated code: output=b441fee3202f61ee input=f7c9c65dc718de14]*/
+{
+ return treebuilder_done(self);
+}
+
+/*[clinic input]
+_elementtree.TreeBuilder.start
+
+ tag: object
+ attrs: object(subclass_of='&PyDict_Type')
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
+ PyObject *attrs)
+/*[clinic end generated code: output=e7e9dc2861349411 input=7288e9e38e63b2b6]*/
+{
+ return treebuilder_handle_start(self, tag, attrs);
+}
+
+/* ==================================================================== */
+/* the expat interface */
+
+#define EXPAT(st, func) ((st)->expat_capi->func)
+
+static XML_Memory_Handling_Suite ExpatMemoryHandler = {
+ PyObject_Malloc, PyObject_Realloc, PyObject_Free};
+
+typedef struct {
+ PyObject_HEAD
+
+ XML_Parser parser;
+
+ PyObject *target;
+ PyObject *entity;
+
+ PyObject *names;
+
+ PyObject *handle_start_ns;
+ PyObject *handle_end_ns;
+ PyObject *handle_start;
+ PyObject *handle_data;
+ PyObject *handle_end;
+
+ PyObject *handle_comment;
+ PyObject *handle_pi;
+ PyObject *handle_doctype;
+
+ PyObject *handle_close;
+
+ elementtreestate *state;
+ PyObject *elementtree_module;
+} XMLParserObject;
+
+/* helpers */
+
+LOCAL(PyObject*)
+makeuniversal(XMLParserObject* self, const char* string)
+{
+ /* convert a UTF-8 tag/attribute name from the expat parser
+ to a universal name string */
+
+ Py_ssize_t size = (Py_ssize_t) strlen(string);
+ PyObject* key;
+ PyObject* value;
+
+ /* look the 'raw' name up in the names dictionary */
+ key = PyBytes_FromStringAndSize(string, size);
+ if (!key)
+ return NULL;
+
+ value = Py_XNewRef(PyDict_GetItemWithError(self->names, key));
+
+ if (value == NULL && !PyErr_Occurred()) {
+ /* new name. convert to universal name, and decode as
+ necessary */
+
+ PyObject* tag;
+ char* p;
+ Py_ssize_t i;
+
+ /* look for namespace separator */
+ for (i = 0; i < size; i++)
+ if (string[i] == '}')
+ break;
+ if (i != size) {
+ /* convert to universal name */
+ tag = PyBytes_FromStringAndSize(NULL, size+1);
+ if (tag == NULL) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ p = PyBytes_AS_STRING(tag);
+ p[0] = '{';
+ memcpy(p+1, string, size);
+ size++;
+ } else {
+ /* plain name; use key as tag */
+ tag = Py_NewRef(key);
+ }
+
+ /* decode universal name */
+ p = PyBytes_AS_STRING(tag);
+ value = PyUnicode_DecodeUTF8(p, size, "strict");
+ Py_DECREF(tag);
+ if (!value) {
+ Py_DECREF(key);
+ return NULL;
+ }
+
+ /* add to names dictionary */
+ if (PyDict_SetItem(self->names, key, value) < 0) {
+ Py_DECREF(key);
+ Py_DECREF(value);
+ return NULL;
+ }
+ }
+
+ Py_DECREF(key);
+ return value;
+}
+
+/* Set the ParseError exception with the given parameters.
+ * If message is not NULL, it's used as the error string. Otherwise, the
+ * message string is the default for the given error_code.
+*/
+static void
+expat_set_error(elementtreestate *st, enum XML_Error error_code,
+ Py_ssize_t line, Py_ssize_t column, const char *message)
+{
+ PyObject *errmsg, *error, *position, *code;
+
+ errmsg = PyUnicode_FromFormat("%s: line %zd, column %zd",
+ message ? message : EXPAT(st, ErrorString)(error_code),
+ line, column);
+ if (errmsg == NULL)
+ return;
+
+ error = PyObject_CallOneArg(st->parseerror_obj, errmsg);
+ Py_DECREF(errmsg);
+ if (!error)
+ return;
+
+ /* Add code and position attributes */
+ code = PyLong_FromLong((long)error_code);
+ if (!code) {
+ Py_DECREF(error);
+ return;
+ }
+ if (PyObject_SetAttrString(error, "code", code) == -1) {
+ Py_DECREF(error);
+ Py_DECREF(code);
+ return;
+ }
+ Py_DECREF(code);
+
+ position = Py_BuildValue("(nn)", line, column);
+ if (!position) {
+ Py_DECREF(error);
+ return;
+ }
+ if (PyObject_SetAttrString(error, "position", position) == -1) {
+ Py_DECREF(error);
+ Py_DECREF(position);
+ return;
+ }
+ Py_DECREF(position);
+
+ PyErr_SetObject(st->parseerror_obj, error);
+ Py_DECREF(error);
+}
+
+/* -------------------------------------------------------------------- */
+/* handlers */
+
+static void
+expat_default_handler(XMLParserObject* self, const XML_Char* data_in,
+ int data_len)
+{
+ PyObject* key;
+ PyObject* value;
+ PyObject* res;
+
+ if (data_len < 2 || data_in[0] != '&')
+ return;
+
+ if (PyErr_Occurred())
+ return;
+
+ key = PyUnicode_DecodeUTF8(data_in + 1, data_len - 2, "strict");
+ if (!key)
+ return;
+
+ value = PyDict_GetItemWithError(self->entity, key);
+
+ elementtreestate *st = self->state;
+ if (value) {
+ if (TreeBuilder_CheckExact(st, self->target))
+ res = treebuilder_handle_data(
+ (TreeBuilderObject*) self->target, value
+ );
+ else if (self->handle_data)
+ res = PyObject_CallOneArg(self->handle_data, value);
+ else
+ res = NULL;
+ Py_XDECREF(res);
+ } else if (!PyErr_Occurred()) {
+ /* Report the first error, not the last */
+ char message[128] = "undefined entity ";
+ strncat(message, data_in, data_len < 100?data_len:100);
+ expat_set_error(
+ st,
+ XML_ERROR_UNDEFINED_ENTITY,
+ EXPAT(st, GetErrorLineNumber)(self->parser),
+ EXPAT(st, GetErrorColumnNumber)(self->parser),
+ message
+ );
+ }
+
+ Py_DECREF(key);
+}
+
+static void
+expat_start_handler(XMLParserObject* self, const XML_Char* tag_in,
+ const XML_Char **attrib_in)
+{
+ PyObject* res;
+ PyObject* tag;
+ PyObject* attrib;
+ int ok;
+
+ if (PyErr_Occurred())
+ return;
+
+ /* tag name */
+ tag = makeuniversal(self, tag_in);
+ if (!tag)
+ return; /* parser will look for errors */
+
+ /* attributes */
+ if (attrib_in[0]) {
+ attrib = PyDict_New();
+ if (!attrib) {
+ Py_DECREF(tag);
+ return;
+ }
+ while (attrib_in[0] && attrib_in[1]) {
+ PyObject* key = makeuniversal(self, attrib_in[0]);
+ if (key == NULL) {
+ Py_DECREF(attrib);
+ Py_DECREF(tag);
+ return;
+ }
+ PyObject* value = PyUnicode_DecodeUTF8(attrib_in[1], strlen(attrib_in[1]), "strict");
+ if (value == NULL) {
+ Py_DECREF(key);
+ Py_DECREF(attrib);
+ Py_DECREF(tag);
+ return;
+ }
+ ok = PyDict_SetItem(attrib, key, value);
+ Py_DECREF(value);
+ Py_DECREF(key);
+ if (ok < 0) {
+ Py_DECREF(attrib);
+ Py_DECREF(tag);
+ return;
+ }
+ attrib_in += 2;
+ }
+ } else {
+ attrib = NULL;
+ }
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target)) {
+ /* shortcut */
+ res = treebuilder_handle_start((TreeBuilderObject*) self->target,
+ tag, attrib);
+ }
+ else if (self->handle_start) {
+ if (attrib == NULL) {
+ attrib = PyDict_New();
+ if (!attrib) {
+ Py_DECREF(tag);
+ return;
+ }
+ }
+ res = PyObject_CallFunctionObjArgs(self->handle_start,
+ tag, attrib, NULL);
+ } else
+ res = NULL;
+
+ Py_DECREF(tag);
+ Py_XDECREF(attrib);
+
+ Py_XDECREF(res);
+}
+
+static void
+expat_data_handler(XMLParserObject* self, const XML_Char* data_in,
+ int data_len)
+{
+ PyObject* data;
+ PyObject* res;
+
+ if (PyErr_Occurred())
+ return;
+
+ data = PyUnicode_DecodeUTF8(data_in, data_len, "strict");
+ if (!data)
+ return; /* parser will look for errors */
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target))
+ /* shortcut */
+ res = treebuilder_handle_data((TreeBuilderObject*) self->target, data);
+ else if (self->handle_data)
+ res = PyObject_CallOneArg(self->handle_data, data);
+ else
+ res = NULL;
+
+ Py_DECREF(data);
+
+ Py_XDECREF(res);
+}
+
+static void
+expat_end_handler(XMLParserObject* self, const XML_Char* tag_in)
+{
+ PyObject* tag;
+ PyObject* res = NULL;
+
+ if (PyErr_Occurred())
+ return;
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target))
+ /* shortcut */
+ /* the standard tree builder doesn't look at the end tag */
+ res = treebuilder_handle_end(
+ (TreeBuilderObject*) self->target, Py_None
+ );
+ else if (self->handle_end) {
+ tag = makeuniversal(self, tag_in);
+ if (tag) {
+ res = PyObject_CallOneArg(self->handle_end, tag);
+ Py_DECREF(tag);
+ }
+ }
+
+ Py_XDECREF(res);
+}
+
+static void
+expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix_in,
+ const XML_Char *uri_in)
+{
+ PyObject* res = NULL;
+ PyObject* uri;
+ PyObject* prefix;
+ PyObject* stack[2];
+
+ if (PyErr_Occurred())
+ return;
+
+ if (!uri_in)
+ uri_in = "";
+ if (!prefix_in)
+ prefix_in = "";
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target)) {
+ /* shortcut - TreeBuilder does not actually implement .start_ns() */
+ TreeBuilderObject *target = (TreeBuilderObject*) self->target;
+
+ if (target->events_append && target->start_ns_event_obj) {
+ prefix = PyUnicode_DecodeUTF8(prefix_in, strlen(prefix_in), "strict");
+ if (!prefix)
+ return;
+ uri = PyUnicode_DecodeUTF8(uri_in, strlen(uri_in), "strict");
+ if (!uri) {
+ Py_DECREF(prefix);
+ return;
+ }
+
+ res = treebuilder_handle_start_ns(target, prefix, uri);
+ Py_DECREF(uri);
+ Py_DECREF(prefix);
+ }
+ } else if (self->handle_start_ns) {
+ prefix = PyUnicode_DecodeUTF8(prefix_in, strlen(prefix_in), "strict");
+ if (!prefix)
+ return;
+ uri = PyUnicode_DecodeUTF8(uri_in, strlen(uri_in), "strict");
+ if (!uri) {
+ Py_DECREF(prefix);
+ return;
+ }
+
+ stack[0] = prefix;
+ stack[1] = uri;
+ res = _PyObject_FastCall(self->handle_start_ns, stack, 2);
+ Py_DECREF(uri);
+ Py_DECREF(prefix);
+ }
+
+ Py_XDECREF(res);
+}
+
+static void
+expat_end_ns_handler(XMLParserObject* self, const XML_Char* prefix_in)
+{
+ PyObject *res = NULL;
+ PyObject* prefix;
+
+ if (PyErr_Occurred())
+ return;
+
+ if (!prefix_in)
+ prefix_in = "";
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target)) {
+ /* shortcut - TreeBuilder does not actually implement .end_ns() */
+ TreeBuilderObject *target = (TreeBuilderObject*) self->target;
+
+ if (target->events_append && target->end_ns_event_obj) {
+ res = treebuilder_handle_end_ns(target, Py_None);
+ }
+ } else if (self->handle_end_ns) {
+ prefix = PyUnicode_DecodeUTF8(prefix_in, strlen(prefix_in), "strict");
+ if (!prefix)
+ return;
+
+ res = PyObject_CallOneArg(self->handle_end_ns, prefix);
+ Py_DECREF(prefix);
+ }
+
+ Py_XDECREF(res);
+}
+
+static void
+expat_comment_handler(XMLParserObject* self, const XML_Char* comment_in)
+{
+ PyObject* comment;
+ PyObject* res;
+
+ if (PyErr_Occurred())
+ return;
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target)) {
+ /* shortcut */
+ TreeBuilderObject *target = (TreeBuilderObject*) self->target;
+
+ comment = PyUnicode_DecodeUTF8(comment_in, strlen(comment_in), "strict");
+ if (!comment)
+ return; /* parser will look for errors */
+
+ res = treebuilder_handle_comment(target, comment);
+ Py_XDECREF(res);
+ Py_DECREF(comment);
+ } else if (self->handle_comment) {
+ comment = PyUnicode_DecodeUTF8(comment_in, strlen(comment_in), "strict");
+ if (!comment)
+ return;
+
+ res = PyObject_CallOneArg(self->handle_comment, comment);
+ Py_XDECREF(res);
+ Py_DECREF(comment);
+ }
+}
+
+static void
+expat_start_doctype_handler(XMLParserObject *self,
+ const XML_Char *doctype_name,
+ const XML_Char *sysid,
+ const XML_Char *pubid,
+ int has_internal_subset)
+{
+ PyObject *doctype_name_obj, *sysid_obj, *pubid_obj;
+ PyObject *res;
+
+ if (PyErr_Occurred())
+ return;
+
+ doctype_name_obj = makeuniversal(self, doctype_name);
+ if (!doctype_name_obj)
+ return;
+
+ if (sysid) {
+ sysid_obj = makeuniversal(self, sysid);
+ if (!sysid_obj) {
+ Py_DECREF(doctype_name_obj);
+ return;
+ }
+ } else {
+ sysid_obj = Py_NewRef(Py_None);
+ }
+
+ if (pubid) {
+ pubid_obj = makeuniversal(self, pubid);
+ if (!pubid_obj) {
+ Py_DECREF(doctype_name_obj);
+ Py_DECREF(sysid_obj);
+ return;
+ }
+ } else {
+ pubid_obj = Py_NewRef(Py_None);
+ }
+
+ elementtreestate *st = self->state;
+ /* If the target has a handler for doctype, call it. */
+ if (self->handle_doctype) {
+ res = PyObject_CallFunctionObjArgs(self->handle_doctype,
+ doctype_name_obj, pubid_obj,
+ sysid_obj, NULL);
+ Py_XDECREF(res);
+ }
+ else if (_PyObject_LookupAttr((PyObject *)self, st->str_doctype, &res) > 0) {
+ (void)PyErr_WarnEx(PyExc_RuntimeWarning,
+ "The doctype() method of XMLParser is ignored. "
+ "Define doctype() method on the TreeBuilder target.",
+ 1);
+ Py_DECREF(res);
+ }
+
+ Py_DECREF(doctype_name_obj);
+ Py_DECREF(pubid_obj);
+ Py_DECREF(sysid_obj);
+}
+
+static void
+expat_pi_handler(XMLParserObject* self, const XML_Char* target_in,
+ const XML_Char* data_in)
+{
+ PyObject* pi_target;
+ PyObject* data;
+ PyObject* res;
+ PyObject* stack[2];
+
+ if (PyErr_Occurred())
+ return;
+
+ elementtreestate *st = self->state;
+ if (TreeBuilder_CheckExact(st, self->target)) {
+ /* shortcut */
+ TreeBuilderObject *target = (TreeBuilderObject*) self->target;
+
+ if ((target->events_append && target->pi_event_obj) || target->insert_pis) {
+ pi_target = PyUnicode_DecodeUTF8(target_in, strlen(target_in), "strict");
+ if (!pi_target)
+ goto error;
+ data = PyUnicode_DecodeUTF8(data_in, strlen(data_in), "strict");
+ if (!data)
+ goto error;
+ res = treebuilder_handle_pi(target, pi_target, data);
+ Py_XDECREF(res);
+ Py_DECREF(data);
+ Py_DECREF(pi_target);
+ }
+ } else if (self->handle_pi) {
+ pi_target = PyUnicode_DecodeUTF8(target_in, strlen(target_in), "strict");
+ if (!pi_target)
+ goto error;
+ data = PyUnicode_DecodeUTF8(data_in, strlen(data_in), "strict");
+ if (!data)
+ goto error;
+
+ stack[0] = pi_target;
+ stack[1] = data;
+ res = _PyObject_FastCall(self->handle_pi, stack, 2);
+ Py_XDECREF(res);
+ Py_DECREF(data);
+ Py_DECREF(pi_target);
+ }
+
+ return;
+
+ error:
+ Py_XDECREF(pi_target);
+ return;
+}
+
+/* -------------------------------------------------------------------- */
+
+static PyObject *
+xmlparser_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ XMLParserObject *self = (XMLParserObject *)type->tp_alloc(type, 0);
+ if (self) {
+ self->parser = NULL;
+ self->target = self->entity = self->names = NULL;
+ self->handle_start_ns = self->handle_end_ns = NULL;
+ self->handle_start = self->handle_data = self->handle_end = NULL;
+ self->handle_comment = self->handle_pi = self->handle_close = NULL;
+ self->handle_doctype = NULL;
+ self->elementtree_module = PyType_GetModuleByDef(type, &elementtreemodule);
+ assert(self->elementtree_module != NULL);
+ Py_INCREF(self->elementtree_module);
+ // See gh-111784 for explanation why is reference to module needed here.
+ self->state = get_elementtree_state(self->elementtree_module);
+ }
+ return (PyObject *)self;
+}
+
+static int
+ignore_attribute_error(PyObject *value)
+{
+ if (value == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ return -1;
+ }
+ PyErr_Clear();
+ }
+ return 0;
+}
+
+/*[clinic input]
+_elementtree.XMLParser.__init__
+
+ *
+ target: object = None
+ encoding: str(accept={str, NoneType}) = None
+
+[clinic start generated code]*/
+
+static int
+_elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target,
+ const char *encoding)
+/*[clinic end generated code: output=3ae45ec6cdf344e4 input=7e716dd6e4f3e439]*/
+{
+ self->entity = PyDict_New();
+ if (!self->entity)
+ return -1;
+
+ self->names = PyDict_New();
+ if (!self->names) {
+ Py_CLEAR(self->entity);
+ return -1;
+ }
+ elementtreestate *st = self->state;
+ self->parser = EXPAT(st, ParserCreate_MM)(encoding, &ExpatMemoryHandler, "}");
+ if (!self->parser) {
+ Py_CLEAR(self->entity);
+ Py_CLEAR(self->names);
+ PyErr_NoMemory();
+ return -1;
+ }
+ /* expat < 2.1.0 has no XML_SetHashSalt() */
+ if (EXPAT(st, SetHashSalt) != NULL) {
+ EXPAT(st, SetHashSalt)(self->parser,
+ (unsigned long)_Py_HashSecret.expat.hashsalt);
+ }
+
+ if (target != Py_None) {
+ Py_INCREF(target);
+ } else {
+ target = treebuilder_new(st->TreeBuilder_Type, NULL, NULL);
+ if (!target) {
+ Py_CLEAR(self->entity);
+ Py_CLEAR(self->names);
+ return -1;
+ }
+ }
+ self->target = target;
+
+ self->handle_start_ns = PyObject_GetAttrString(target, "start_ns");
+ if (ignore_attribute_error(self->handle_start_ns)) {
+ return -1;
+ }
+ self->handle_end_ns = PyObject_GetAttrString(target, "end_ns");
+ if (ignore_attribute_error(self->handle_end_ns)) {
+ return -1;
+ }
+ self->handle_start = PyObject_GetAttrString(target, "start");
+ if (ignore_attribute_error(self->handle_start)) {
+ return -1;
+ }
+ self->handle_data = PyObject_GetAttrString(target, "data");
+ if (ignore_attribute_error(self->handle_data)) {
+ return -1;
+ }
+ self->handle_end = PyObject_GetAttrString(target, "end");
+ if (ignore_attribute_error(self->handle_end)) {
+ return -1;
+ }
+ self->handle_comment = PyObject_GetAttrString(target, "comment");
+ if (ignore_attribute_error(self->handle_comment)) {
+ return -1;
+ }
+ self->handle_pi = PyObject_GetAttrString(target, "pi");
+ if (ignore_attribute_error(self->handle_pi)) {
+ return -1;
+ }
+ self->handle_close = PyObject_GetAttrString(target, "close");
+ if (ignore_attribute_error(self->handle_close)) {
+ return -1;
+ }
+ self->handle_doctype = PyObject_GetAttrString(target, "doctype");
+ if (ignore_attribute_error(self->handle_doctype)) {
+ return -1;
+ }
+
+ /* configure parser */
+ EXPAT(st, SetUserData)(self->parser, self);
+ if (self->handle_start_ns || self->handle_end_ns)
+ EXPAT(st, SetNamespaceDeclHandler)(
+ self->parser,
+ (XML_StartNamespaceDeclHandler) expat_start_ns_handler,
+ (XML_EndNamespaceDeclHandler) expat_end_ns_handler
+ );
+ EXPAT(st, SetElementHandler)(
+ self->parser,
+ (XML_StartElementHandler) expat_start_handler,
+ (XML_EndElementHandler) expat_end_handler
+ );
+ EXPAT(st, SetDefaultHandlerExpand)(
+ self->parser,
+ (XML_DefaultHandler) expat_default_handler
+ );
+ EXPAT(st, SetCharacterDataHandler)(
+ self->parser,
+ (XML_CharacterDataHandler) expat_data_handler
+ );
+ if (self->handle_comment)
+ EXPAT(st, SetCommentHandler)(
+ self->parser,
+ (XML_CommentHandler) expat_comment_handler
+ );
+ if (self->handle_pi)
+ EXPAT(st, SetProcessingInstructionHandler)(
+ self->parser,
+ (XML_ProcessingInstructionHandler) expat_pi_handler
+ );
+ EXPAT(st, SetStartDoctypeDeclHandler)(
+ self->parser,
+ (XML_StartDoctypeDeclHandler) expat_start_doctype_handler
+ );
+ EXPAT(st, SetUnknownEncodingHandler)(
+ self->parser,
+ EXPAT(st, DefaultUnknownEncodingHandler), NULL
+ );
+
+ return 0;
+}
+
+static int
+xmlparser_gc_traverse(XMLParserObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->handle_close);
+ Py_VISIT(self->handle_pi);
+ Py_VISIT(self->handle_comment);
+ Py_VISIT(self->handle_end);
+ Py_VISIT(self->handle_data);
+ Py_VISIT(self->handle_start);
+ Py_VISIT(self->handle_start_ns);
+ Py_VISIT(self->handle_end_ns);
+ Py_VISIT(self->handle_doctype);
+
+ Py_VISIT(self->target);
+ Py_VISIT(self->entity);
+ Py_VISIT(self->names);
+
+ return 0;
+}
+
+static int
+xmlparser_gc_clear(XMLParserObject *self)
+{
+ elementtreestate *st = self->state;
+ if (self->parser != NULL) {
+ XML_Parser parser = self->parser;
+ self->parser = NULL;
+ EXPAT(st, ParserFree)(parser);
+ }
+
+ Py_CLEAR(self->elementtree_module);
+ Py_CLEAR(self->handle_close);
+ Py_CLEAR(self->handle_pi);
+ Py_CLEAR(self->handle_comment);
+ Py_CLEAR(self->handle_end);
+ Py_CLEAR(self->handle_data);
+ Py_CLEAR(self->handle_start);
+ Py_CLEAR(self->handle_start_ns);
+ Py_CLEAR(self->handle_end_ns);
+ Py_CLEAR(self->handle_doctype);
+
+ Py_CLEAR(self->target);
+ Py_CLEAR(self->entity);
+ Py_CLEAR(self->names);
+
+ return 0;
+}
+
+static void
+xmlparser_dealloc(XMLParserObject* self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ xmlparser_gc_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+Py_LOCAL_INLINE(int)
+_check_xmlparser(XMLParserObject* self)
+{
+ if (self->target == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "XMLParser.__init__() wasn't called");
+ return 0;
+ }
+ return 1;
+}
+
+LOCAL(PyObject*)
+expat_parse(elementtreestate *st, XMLParserObject *self, const char *data,
+ int data_len, int final)
+{
+ int ok;
+
+ assert(!PyErr_Occurred());
+ ok = EXPAT(st, Parse)(self->parser, data, data_len, final);
+
+ if (PyErr_Occurred())
+ return NULL;
+
+ if (!ok) {
+ expat_set_error(
+ st,
+ EXPAT(st, GetErrorCode)(self->parser),
+ EXPAT(st, GetErrorLineNumber)(self->parser),
+ EXPAT(st, GetErrorColumnNumber)(self->parser),
+ NULL
+ );
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_elementtree.XMLParser.close
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_XMLParser_close_impl(XMLParserObject *self)
+/*[clinic end generated code: output=d68d375dd23bc7fb input=ca7909ca78c3abfe]*/
+{
+ /* end feeding data to parser */
+
+ PyObject* res;
+
+ if (!_check_xmlparser(self)) {
+ return NULL;
+ }
+ elementtreestate *st = self->state;
+ res = expat_parse(st, self, "", 0, 1);
+ if (!res)
+ return NULL;
+
+ if (TreeBuilder_CheckExact(st, self->target)) {
+ Py_DECREF(res);
+ return treebuilder_done((TreeBuilderObject*) self->target);
+ }
+ else if (self->handle_close) {
+ Py_DECREF(res);
+ return PyObject_CallNoArgs(self->handle_close);
+ }
+ else {
+ return res;
+ }
+}
+
+/*[clinic input]
+_elementtree.XMLParser.feed
+
+ data: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data)
+/*[clinic end generated code: output=e42b6a78eec7446d input=fe231b6b8de3ce1f]*/
+{
+ /* feed data to parser */
+
+ if (!_check_xmlparser(self)) {
+ return NULL;
+ }
+ elementtreestate *st = self->state;
+ if (PyUnicode_Check(data)) {
+ Py_ssize_t data_len;
+ const char *data_ptr = PyUnicode_AsUTF8AndSize(data, &data_len);
+ if (data_ptr == NULL)
+ return NULL;
+ if (data_len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "size does not fit in an int");
+ return NULL;
+ }
+ /* Explicitly set UTF-8 encoding. Return code ignored. */
+ (void)EXPAT(st, SetEncoding)(self->parser, "utf-8");
+
+ return expat_parse(st, self, data_ptr, (int)data_len, 0);
+ }
+ else {
+ Py_buffer view;
+ PyObject *res;
+ if (PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) < 0)
+ return NULL;
+ if (view.len > INT_MAX) {
+ PyBuffer_Release(&view);
+ PyErr_SetString(PyExc_OverflowError, "size does not fit in an int");
+ return NULL;
+ }
+ res = expat_parse(st, self, view.buf, (int)view.len, 0);
+ PyBuffer_Release(&view);
+ return res;
+ }
+}
+
+/*[clinic input]
+_elementtree.XMLParser._parse_whole
+
+ file: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file)
+/*[clinic end generated code: output=f797197bb818dda3 input=19ecc893b6f3e752]*/
+{
+ /* (internal) parse the whole input, until end of stream */
+ PyObject* reader;
+ PyObject* buffer;
+ PyObject* temp;
+ PyObject* res;
+
+ if (!_check_xmlparser(self)) {
+ return NULL;
+ }
+ reader = PyObject_GetAttrString(file, "read");
+ if (!reader)
+ return NULL;
+
+ /* read from open file object */
+ elementtreestate *st = self->state;
+ for (;;) {
+
+ buffer = PyObject_CallFunction(reader, "i", 64*1024);
+
+ if (!buffer) {
+ /* read failed (e.g. due to KeyboardInterrupt) */
+ Py_DECREF(reader);
+ return NULL;
+ }
+
+ if (PyUnicode_CheckExact(buffer)) {
+ /* A unicode object is encoded into bytes using UTF-8 */
+ if (PyUnicode_GET_LENGTH(buffer) == 0) {
+ Py_DECREF(buffer);
+ break;
+ }
+ temp = PyUnicode_AsEncodedString(buffer, "utf-8", "surrogatepass");
+ Py_DECREF(buffer);
+ if (!temp) {
+ /* Propagate exception from PyUnicode_AsEncodedString */
+ Py_DECREF(reader);
+ return NULL;
+ }
+ buffer = temp;
+ }
+ else if (!PyBytes_CheckExact(buffer) || PyBytes_GET_SIZE(buffer) == 0) {
+ Py_DECREF(buffer);
+ break;
+ }
+
+ if (PyBytes_GET_SIZE(buffer) > INT_MAX) {
+ Py_DECREF(buffer);
+ Py_DECREF(reader);
+ PyErr_SetString(PyExc_OverflowError, "size does not fit in an int");
+ return NULL;
+ }
+ res = expat_parse(
+ st, self, PyBytes_AS_STRING(buffer), (int)PyBytes_GET_SIZE(buffer),
+ 0);
+
+ Py_DECREF(buffer);
+
+ if (!res) {
+ Py_DECREF(reader);
+ return NULL;
+ }
+ Py_DECREF(res);
+
+ }
+
+ Py_DECREF(reader);
+
+ res = expat_parse(st, self, "", 0, 1);
+
+ if (res && TreeBuilder_CheckExact(st, self->target)) {
+ Py_DECREF(res);
+ return treebuilder_done((TreeBuilderObject*) self->target);
+ }
+
+ return res;
+}
+
+/*[clinic input]
+_elementtree.XMLParser._setevents
+
+ events_queue: object
+ events_to_report: object = None
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_elementtree_XMLParser__setevents_impl(XMLParserObject *self,
+ PyObject *events_queue,
+ PyObject *events_to_report)
+/*[clinic end generated code: output=1440092922b13ed1 input=abf90830a1c3b0fc]*/
+{
+ /* activate element event reporting */
+ Py_ssize_t i;
+ TreeBuilderObject *target;
+ PyObject *events_append, *events_seq;
+
+ if (!_check_xmlparser(self)) {
+ return NULL;
+ }
+ elementtreestate *st = self->state;
+ if (!TreeBuilder_CheckExact(st, self->target)) {
+ PyErr_SetString(
+ PyExc_TypeError,
+ "event handling only supported for ElementTree.TreeBuilder "
+ "targets"
+ );
+ return NULL;
+ }
+
+ target = (TreeBuilderObject*) self->target;
+
+ events_append = PyObject_GetAttrString(events_queue, "append");
+ if (events_append == NULL)
+ return NULL;
+ Py_XSETREF(target->events_append, events_append);
+
+ /* clear out existing events */
+ Py_CLEAR(target->start_event_obj);
+ Py_CLEAR(target->end_event_obj);
+ Py_CLEAR(target->start_ns_event_obj);
+ Py_CLEAR(target->end_ns_event_obj);
+ Py_CLEAR(target->comment_event_obj);
+ Py_CLEAR(target->pi_event_obj);
+
+ if (events_to_report == Py_None) {
+ /* default is "end" only */
+ target->end_event_obj = PyUnicode_FromString("end");
+ Py_RETURN_NONE;
+ }
+
+ if (!(events_seq = PySequence_Fast(events_to_report,
+ "events must be a sequence"))) {
+ return NULL;
+ }
+
+ for (i = 0; i < PySequence_Fast_GET_SIZE(events_seq); ++i) {
+ PyObject *event_name_obj = PySequence_Fast_GET_ITEM(events_seq, i);
+ const char *event_name = NULL;
+ if (PyUnicode_Check(event_name_obj)) {
+ event_name = PyUnicode_AsUTF8(event_name_obj);
+ } else if (PyBytes_Check(event_name_obj)) {
+ event_name = PyBytes_AS_STRING(event_name_obj);
+ }
+ if (event_name == NULL) {
+ Py_DECREF(events_seq);
+ PyErr_Format(PyExc_ValueError, "invalid events sequence");
+ return NULL;
+ }
+
+ if (strcmp(event_name, "start") == 0) {
+ Py_XSETREF(target->start_event_obj, Py_NewRef(event_name_obj));
+ } else if (strcmp(event_name, "end") == 0) {
+ Py_XSETREF(target->end_event_obj, Py_NewRef(event_name_obj));
+ } else if (strcmp(event_name, "start-ns") == 0) {
+ Py_XSETREF(target->start_ns_event_obj, Py_NewRef(event_name_obj));
+ EXPAT(st, SetNamespaceDeclHandler)(
+ self->parser,
+ (XML_StartNamespaceDeclHandler) expat_start_ns_handler,
+ (XML_EndNamespaceDeclHandler) expat_end_ns_handler
+ );
+ } else if (strcmp(event_name, "end-ns") == 0) {
+ Py_XSETREF(target->end_ns_event_obj, Py_NewRef(event_name_obj));
+ EXPAT(st, SetNamespaceDeclHandler)(
+ self->parser,
+ (XML_StartNamespaceDeclHandler) expat_start_ns_handler,
+ (XML_EndNamespaceDeclHandler) expat_end_ns_handler
+ );
+ } else if (strcmp(event_name, "comment") == 0) {
+ Py_XSETREF(target->comment_event_obj, Py_NewRef(event_name_obj));
+ EXPAT(st, SetCommentHandler)(
+ self->parser,
+ (XML_CommentHandler) expat_comment_handler
+ );
+ } else if (strcmp(event_name, "pi") == 0) {
+ Py_XSETREF(target->pi_event_obj, Py_NewRef(event_name_obj));
+ EXPAT(st, SetProcessingInstructionHandler)(
+ self->parser,
+ (XML_ProcessingInstructionHandler) expat_pi_handler
+ );
+ } else {
+ Py_DECREF(events_seq);
+ PyErr_Format(PyExc_ValueError, "unknown event '%s'", event_name);
+ return NULL;
+ }
+ }
+
+ Py_DECREF(events_seq);
+ Py_RETURN_NONE;
+}
+
+static PyMemberDef xmlparser_members[] = {
+ {"entity", T_OBJECT, offsetof(XMLParserObject, entity), READONLY, NULL},
+ {"target", T_OBJECT, offsetof(XMLParserObject, target), READONLY, NULL},
+ {NULL}
+};
+
+static PyObject*
+xmlparser_version_getter(XMLParserObject *self, void *closure)
+{
+ return PyUnicode_FromFormat(
+ "Expat %d.%d.%d", XML_MAJOR_VERSION,
+ XML_MINOR_VERSION, XML_MICRO_VERSION);
+}
+
+static PyGetSetDef xmlparser_getsetlist[] = {
+ {"version", (getter)xmlparser_version_getter, NULL, NULL},
+ {NULL},
+};
+
+#define clinic_state() (get_elementtree_state_by_type(Py_TYPE(self)))
+#include "clinic/_elementtree.c.h"
+#undef clinic_state
+
+static PyMethodDef element_methods[] = {
+
+ _ELEMENTTREE_ELEMENT_CLEAR_METHODDEF
+
+ _ELEMENTTREE_ELEMENT_GET_METHODDEF
+ _ELEMENTTREE_ELEMENT_SET_METHODDEF
+
+ _ELEMENTTREE_ELEMENT_FIND_METHODDEF
+ _ELEMENTTREE_ELEMENT_FINDTEXT_METHODDEF
+ _ELEMENTTREE_ELEMENT_FINDALL_METHODDEF
+
+ _ELEMENTTREE_ELEMENT_APPEND_METHODDEF
+ _ELEMENTTREE_ELEMENT_EXTEND_METHODDEF
+ _ELEMENTTREE_ELEMENT_INSERT_METHODDEF
+ _ELEMENTTREE_ELEMENT_REMOVE_METHODDEF
+
+ _ELEMENTTREE_ELEMENT_ITER_METHODDEF
+ _ELEMENTTREE_ELEMENT_ITERTEXT_METHODDEF
+ _ELEMENTTREE_ELEMENT_ITERFIND_METHODDEF
+
+ _ELEMENTTREE_ELEMENT_ITEMS_METHODDEF
+ _ELEMENTTREE_ELEMENT_KEYS_METHODDEF
+
+ _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF
+
+ _ELEMENTTREE_ELEMENT___COPY___METHODDEF
+ _ELEMENTTREE_ELEMENT___DEEPCOPY___METHODDEF
+ _ELEMENTTREE_ELEMENT___SIZEOF___METHODDEF
+ _ELEMENTTREE_ELEMENT___GETSTATE___METHODDEF
+ _ELEMENTTREE_ELEMENT___SETSTATE___METHODDEF
+
+ {NULL, NULL}
+};
+
+static struct PyMemberDef element_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(ElementObject, weakreflist), READONLY},
+ {NULL},
+};
+
+static PyGetSetDef element_getsetlist[] = {
+ {"tag",
+ (getter)element_tag_getter,
+ (setter)element_tag_setter,
+ "A string identifying what kind of data this element represents"},
+ {"text",
+ (getter)element_text_getter,
+ (setter)element_text_setter,
+ "A string of text directly after the start tag, or None"},
+ {"tail",
+ (getter)element_tail_getter,
+ (setter)element_tail_setter,
+ "A string of text directly after the end tag, or None"},
+ {"attrib",
+ (getter)element_attrib_getter,
+ (setter)element_attrib_setter,
+ "A dictionary containing the element's attributes"},
+ {NULL},
+};
+
+static PyType_Slot element_slots[] = {
+ {Py_tp_dealloc, element_dealloc},
+ {Py_tp_repr, element_repr},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, element_gc_traverse},
+ {Py_tp_clear, element_gc_clear},
+ {Py_tp_methods, element_methods},
+ {Py_tp_members, element_members},
+ {Py_tp_getset, element_getsetlist},
+ {Py_tp_init, element_init},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, element_new},
+ {Py_sq_length, element_length},
+ {Py_sq_item, element_getitem},
+ {Py_sq_ass_item, element_setitem},
+ {Py_nb_bool, element_bool},
+ {Py_mp_length, element_length},
+ {Py_mp_subscript, element_subscr},
+ {Py_mp_ass_subscript, element_ass_subscr},
+ {0, NULL},
+};
+
+static PyType_Spec element_spec = {
+ .name = "xml.etree.ElementTree.Element",
+ .basicsize = sizeof(ElementObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = element_slots,
+};
+
+static PyMethodDef treebuilder_methods[] = {
+ _ELEMENTTREE_TREEBUILDER_DATA_METHODDEF
+ _ELEMENTTREE_TREEBUILDER_START_METHODDEF
+ _ELEMENTTREE_TREEBUILDER_END_METHODDEF
+ _ELEMENTTREE_TREEBUILDER_COMMENT_METHODDEF
+ _ELEMENTTREE_TREEBUILDER_PI_METHODDEF
+ _ELEMENTTREE_TREEBUILDER_CLOSE_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot treebuilder_slots[] = {
+ {Py_tp_dealloc, treebuilder_dealloc},
+ {Py_tp_traverse, treebuilder_gc_traverse},
+ {Py_tp_clear, treebuilder_gc_clear},
+ {Py_tp_methods, treebuilder_methods},
+ {Py_tp_init, _elementtree_TreeBuilder___init__},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, treebuilder_new},
+ {0, NULL},
+};
+
+static PyType_Spec treebuilder_spec = {
+ .name = "xml.etree.ElementTree.TreeBuilder",
+ .basicsize = sizeof(TreeBuilderObject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = treebuilder_slots,
+};
+
+static PyMethodDef xmlparser_methods[] = {
+ _ELEMENTTREE_XMLPARSER_FEED_METHODDEF
+ _ELEMENTTREE_XMLPARSER_CLOSE_METHODDEF
+ _ELEMENTTREE_XMLPARSER__PARSE_WHOLE_METHODDEF
+ _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot xmlparser_slots[] = {
+ {Py_tp_dealloc, xmlparser_dealloc},
+ {Py_tp_traverse, xmlparser_gc_traverse},
+ {Py_tp_clear, xmlparser_gc_clear},
+ {Py_tp_methods, xmlparser_methods},
+ {Py_tp_members, xmlparser_members},
+ {Py_tp_getset, xmlparser_getsetlist},
+ {Py_tp_init, _elementtree_XMLParser___init__},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, xmlparser_new},
+ {0, NULL},
+};
+
+static PyType_Spec xmlparser_spec = {
+ .name = "xml.etree.ElementTree.XMLParser",
+ .basicsize = sizeof(XMLParserObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = xmlparser_slots,
+};
+
+/* ==================================================================== */
+/* python module interface */
+
+static PyMethodDef _functions[] = {
+ {"SubElement", _PyCFunction_CAST(subelement), METH_VARARGS | METH_KEYWORDS},
+ _ELEMENTTREE__SET_FACTORIES_METHODDEF
+ {NULL, NULL}
+};
+
+#define CREATE_TYPE(module, type, spec) \
+do { \
+ if (type != NULL) { \
+ break; \
+ } \
+ type = (PyTypeObject *)PyType_FromModuleAndSpec(module, spec, NULL); \
+ if (type == NULL) { \
+ goto error; \
+ } \
+} while (0)
+
+static int
+module_exec(PyObject *m)
+{
+ elementtreestate *st = get_elementtree_state(m);
+
+ /* Initialize object types */
+ CREATE_TYPE(m, st->ElementIter_Type, &elementiter_spec);
+ CREATE_TYPE(m, st->TreeBuilder_Type, &treebuilder_spec);
+ CREATE_TYPE(m, st->Element_Type, &element_spec);
+ CREATE_TYPE(m, st->XMLParser_Type, &xmlparser_spec);
+
+ st->deepcopy_obj = _PyImport_GetModuleAttrString("copy", "deepcopy");
+ if (st->deepcopy_obj == NULL) {
+ goto error;
+ }
+
+ assert(!PyErr_Occurred());
+ if (!(st->elementpath_obj = PyImport_ImportModule("xml.etree.ElementPath")))
+ goto error;
+
+ /* link against pyexpat */
+ if (!(st->expat_capsule = _PyImport_GetModuleAttrString("pyexpat", "expat_CAPI")))
+ goto error;
+ if (!(st->expat_capi = PyCapsule_GetPointer(st->expat_capsule, PyExpat_CAPSULE_NAME)))
+ goto error;
+ if (st->expat_capi) {
+ /* check that it's usable */
+ if (strcmp(st->expat_capi->magic, PyExpat_CAPI_MAGIC) != 0 ||
+ (size_t)st->expat_capi->size < sizeof(struct PyExpat_CAPI) ||
+ st->expat_capi->MAJOR_VERSION != XML_MAJOR_VERSION ||
+ st->expat_capi->MINOR_VERSION != XML_MINOR_VERSION ||
+ st->expat_capi->MICRO_VERSION != XML_MICRO_VERSION) {
+ PyErr_SetString(PyExc_ImportError,
+ "pyexpat version is incompatible");
+ goto error;
+ }
+ } else {
+ goto error;
+ }
+
+ st->str_append = PyUnicode_InternFromString("append");
+ if (st->str_append == NULL) {
+ goto error;
+ }
+ st->str_find = PyUnicode_InternFromString("find");
+ if (st->str_find == NULL) {
+ goto error;
+ }
+ st->str_findall = PyUnicode_InternFromString("findall");
+ if (st->str_findall == NULL) {
+ goto error;
+ }
+ st->str_findtext = PyUnicode_InternFromString("findtext");
+ if (st->str_findtext == NULL) {
+ goto error;
+ }
+ st->str_iterfind = PyUnicode_InternFromString("iterfind");
+ if (st->str_iterfind == NULL) {
+ goto error;
+ }
+ st->str_tail = PyUnicode_InternFromString("tail");
+ if (st->str_tail == NULL) {
+ goto error;
+ }
+ st->str_text = PyUnicode_InternFromString("text");
+ if (st->str_text == NULL) {
+ goto error;
+ }
+ st->str_doctype = PyUnicode_InternFromString("doctype");
+ if (st->str_doctype == NULL) {
+ goto error;
+ }
+ st->parseerror_obj = PyErr_NewException(
+ "xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL
+ );
+ if (PyModule_AddObjectRef(m, "ParseError", st->parseerror_obj) < 0) {
+ goto error;
+ }
+
+ PyTypeObject *types[] = {
+ st->Element_Type,
+ st->TreeBuilder_Type,
+ st->XMLParser_Type
+ };
+
+ for (size_t i = 0; i < Py_ARRAY_LENGTH(types); i++) {
+ if (PyModule_AddType(m, types[i]) < 0) {
+ goto error;
+ }
+ }
+
+ return 0;
+
+error:
+ return -1;
+}
+
+static struct PyModuleDef_Slot elementtree_slots[] = {
+ {Py_mod_exec, module_exec},
+ // XXX gh-103092: fix isolation.
+ {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
+ //{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static struct PyModuleDef elementtreemodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_elementtree",
+ .m_size = sizeof(elementtreestate),
+ .m_methods = _functions,
+ .m_slots = elementtree_slots,
+ .m_traverse = elementtree_traverse,
+ .m_clear = elementtree_clear,
+ .m_free = elementtree_free,
+};
+
+PyMODINIT_FUNC
+PyInit__elementtree(void)
+{
+ return PyModuleDef_Init(&elementtreemodule);
+}
diff --git a/contrib/tools/python3/Modules/_functoolsmodule.c b/contrib/tools/python3/Modules/_functoolsmodule.c
new file mode 100644
index 00000000000..a8001d71223
--- /dev/null
+++ b/contrib/tools/python3/Modules/_functoolsmodule.c
@@ -0,0 +1,1543 @@
+#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_dict.h" // _PyDict_Pop_KnownHash()
+#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_object.h" // _PyObject_GC_TRACK
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_tuple.h" // _PyTuple_ITEMS()
+#include "structmember.h" // PyMemberDef
+
+#include "clinic/_functoolsmodule.c.h"
+/*[clinic input]
+module _functools
+class _functools._lru_cache_wrapper "PyObject *" "&lru_cache_type_spec"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=bece4053896b09c0]*/
+
+/* _functools module written and maintained
+ by Hye-Shik Chang <[email protected]>
+ with adaptations by Raymond Hettinger <[email protected]>
+ Copyright (c) 2004, 2005, 2006 Python Software Foundation.
+ All rights reserved.
+*/
+
+typedef struct _functools_state {
+ /* this object is used delimit args and keywords in the cache keys */
+ PyObject *kwd_mark;
+ PyTypeObject *partial_type;
+ PyTypeObject *keyobject_type;
+ PyTypeObject *lru_list_elem_type;
+} _functools_state;
+
+static inline _functools_state *
+get_functools_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_functools_state *)state;
+}
+
+
+/* partial object **********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *fn;
+ PyObject *args;
+ PyObject *kw;
+ PyObject *dict; /* __dict__ */
+ PyObject *weakreflist; /* List of weak references */
+ vectorcallfunc vectorcall;
+} partialobject;
+
+static void partial_setvectorcall(partialobject *pto);
+static struct PyModuleDef _functools_module;
+static PyObject *
+partial_call(partialobject *pto, PyObject *args, PyObject *kwargs);
+
+static inline _functools_state *
+get_functools_state_by_type(PyTypeObject *type)
+{
+ PyObject *module = PyType_GetModuleByDef(type, &_functools_module);
+ if (module == NULL) {
+ return NULL;
+ }
+ return get_functools_state(module);
+}
+
+// Not converted to argument clinic, because of `*args, **kwargs` arguments.
+static PyObject *
+partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *func, *pargs, *nargs, *pkw;
+ partialobject *pto;
+
+ if (PyTuple_GET_SIZE(args) < 1) {
+ PyErr_SetString(PyExc_TypeError,
+ "type 'partial' takes at least one argument");
+ return NULL;
+ }
+
+ pargs = pkw = NULL;
+ func = PyTuple_GET_ITEM(args, 0);
+ if (Py_TYPE(func)->tp_call == (ternaryfunc)partial_call) {
+ // The type of "func" might not be exactly the same type object
+ // as "type", but if it is called using partial_call, it must have the
+ // same memory layout (fn, args and kw members).
+ // We can use its underlying function directly and merge the arguments.
+ partialobject *part = (partialobject *)func;
+ if (part->dict == NULL) {
+ pargs = part->args;
+ pkw = part->kw;
+ func = part->fn;
+ assert(PyTuple_Check(pargs));
+ assert(PyDict_Check(pkw));
+ }
+ }
+ if (!PyCallable_Check(func)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the first argument must be callable");
+ return NULL;
+ }
+
+ /* create partialobject structure */
+ pto = (partialobject *)type->tp_alloc(type, 0);
+ if (pto == NULL)
+ return NULL;
+
+ pto->fn = Py_NewRef(func);
+
+ nargs = PyTuple_GetSlice(args, 1, PY_SSIZE_T_MAX);
+ if (nargs == NULL) {
+ Py_DECREF(pto);
+ return NULL;
+ }
+ if (pargs == NULL) {
+ pto->args = nargs;
+ }
+ else {
+ pto->args = PySequence_Concat(pargs, nargs);
+ Py_DECREF(nargs);
+ if (pto->args == NULL) {
+ Py_DECREF(pto);
+ return NULL;
+ }
+ assert(PyTuple_Check(pto->args));
+ }
+
+ if (pkw == NULL || PyDict_GET_SIZE(pkw) == 0) {
+ if (kw == NULL) {
+ pto->kw = PyDict_New();
+ }
+ else if (Py_REFCNT(kw) == 1) {
+ pto->kw = Py_NewRef(kw);
+ }
+ else {
+ pto->kw = PyDict_Copy(kw);
+ }
+ }
+ else {
+ pto->kw = PyDict_Copy(pkw);
+ if (kw != NULL && pto->kw != NULL) {
+ if (PyDict_Merge(pto->kw, kw, 1) != 0) {
+ Py_DECREF(pto);
+ return NULL;
+ }
+ }
+ }
+ if (pto->kw == NULL) {
+ Py_DECREF(pto);
+ return NULL;
+ }
+
+ partial_setvectorcall(pto);
+ return (PyObject *)pto;
+}
+
+static int
+partial_clear(partialobject *pto)
+{
+ Py_CLEAR(pto->fn);
+ Py_CLEAR(pto->args);
+ Py_CLEAR(pto->kw);
+ Py_CLEAR(pto->dict);
+ return 0;
+}
+
+static int
+partial_traverse(partialobject *pto, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(pto));
+ Py_VISIT(pto->fn);
+ Py_VISIT(pto->args);
+ Py_VISIT(pto->kw);
+ Py_VISIT(pto->dict);
+ return 0;
+}
+
+static void
+partial_dealloc(partialobject *pto)
+{
+ PyTypeObject *tp = Py_TYPE(pto);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(pto);
+ if (pto->weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject *) pto);
+ }
+ (void)partial_clear(pto);
+ tp->tp_free(pto);
+ Py_DECREF(tp);
+}
+
+
+/* Merging keyword arguments using the vectorcall convention is messy, so
+ * if we would need to do that, we stop using vectorcall and fall back
+ * to using partial_call() instead. */
+Py_NO_INLINE static PyObject *
+partial_vectorcall_fallback(PyThreadState *tstate, partialobject *pto,
+ PyObject *const *args, size_t nargsf,
+ PyObject *kwnames)
+{
+ pto->vectorcall = NULL;
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ return _PyObject_MakeTpCall(tstate, (PyObject *)pto,
+ args, nargs, kwnames);
+}
+
+static PyObject *
+partial_vectorcall(partialobject *pto, PyObject *const *args,
+ size_t nargsf, PyObject *kwnames)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+
+ /* pto->kw is mutable, so need to check every time */
+ if (PyDict_GET_SIZE(pto->kw)) {
+ return partial_vectorcall_fallback(tstate, pto, args, nargsf, kwnames);
+ }
+
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ Py_ssize_t nargs_total = nargs;
+ if (kwnames != NULL) {
+ nargs_total += PyTuple_GET_SIZE(kwnames);
+ }
+
+ PyObject **pto_args = _PyTuple_ITEMS(pto->args);
+ Py_ssize_t pto_nargs = PyTuple_GET_SIZE(pto->args);
+
+ /* Fast path if we're called without arguments */
+ if (nargs_total == 0) {
+ return _PyObject_VectorcallTstate(tstate, pto->fn,
+ pto_args, pto_nargs, NULL);
+ }
+
+ /* Fast path using PY_VECTORCALL_ARGUMENTS_OFFSET to prepend a single
+ * positional argument */
+ if (pto_nargs == 1 && (nargsf & PY_VECTORCALL_ARGUMENTS_OFFSET)) {
+ PyObject **newargs = (PyObject **)args - 1;
+ PyObject *tmp = newargs[0];
+ newargs[0] = pto_args[0];
+ PyObject *ret = _PyObject_VectorcallTstate(tstate, pto->fn,
+ newargs, nargs + 1, kwnames);
+ newargs[0] = tmp;
+ return ret;
+ }
+
+ Py_ssize_t newnargs_total = pto_nargs + nargs_total;
+
+ PyObject *small_stack[_PY_FASTCALL_SMALL_STACK];
+ PyObject *ret;
+ PyObject **stack;
+
+ if (newnargs_total <= (Py_ssize_t)Py_ARRAY_LENGTH(small_stack)) {
+ stack = small_stack;
+ }
+ else {
+ stack = PyMem_Malloc(newnargs_total * sizeof(PyObject *));
+ if (stack == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ }
+
+ /* Copy to new stack, using borrowed references */
+ memcpy(stack, pto_args, pto_nargs * sizeof(PyObject*));
+ memcpy(stack + pto_nargs, args, nargs_total * sizeof(PyObject*));
+
+ ret = _PyObject_VectorcallTstate(tstate, pto->fn,
+ stack, pto_nargs + nargs, kwnames);
+ if (stack != small_stack) {
+ PyMem_Free(stack);
+ }
+ return ret;
+}
+
+/* Set pto->vectorcall depending on the parameters of the partial object */
+static void
+partial_setvectorcall(partialobject *pto)
+{
+ if (_PyVectorcall_Function(pto->fn) == NULL) {
+ /* Don't use vectorcall if the underlying function doesn't support it */
+ pto->vectorcall = NULL;
+ }
+ /* We could have a special case if there are no arguments,
+ * but that is unlikely (why use partial without arguments?),
+ * so we don't optimize that */
+ else {
+ pto->vectorcall = (vectorcallfunc)partial_vectorcall;
+ }
+}
+
+
+// Not converted to argument clinic, because of `*args, **kwargs` arguments.
+static PyObject *
+partial_call(partialobject *pto, PyObject *args, PyObject *kwargs)
+{
+ assert(PyCallable_Check(pto->fn));
+ assert(PyTuple_Check(pto->args));
+ assert(PyDict_Check(pto->kw));
+
+ /* Merge keywords */
+ PyObject *kwargs2;
+ if (PyDict_GET_SIZE(pto->kw) == 0) {
+ /* kwargs can be NULL */
+ kwargs2 = Py_XNewRef(kwargs);
+ }
+ else {
+ /* bpo-27840, bpo-29318: dictionary of keyword parameters must be
+ copied, because a function using "**kwargs" can modify the
+ dictionary. */
+ kwargs2 = PyDict_Copy(pto->kw);
+ if (kwargs2 == NULL) {
+ return NULL;
+ }
+
+ if (kwargs != NULL) {
+ if (PyDict_Merge(kwargs2, kwargs, 1) != 0) {
+ Py_DECREF(kwargs2);
+ return NULL;
+ }
+ }
+ }
+
+ /* Merge positional arguments */
+ /* Note: tupleconcat() is optimized for empty tuples */
+ PyObject *args2 = PySequence_Concat(pto->args, args);
+ if (args2 == NULL) {
+ Py_XDECREF(kwargs2);
+ return NULL;
+ }
+
+ PyObject *res = PyObject_Call(pto->fn, args2, kwargs2);
+ Py_DECREF(args2);
+ Py_XDECREF(kwargs2);
+ return res;
+}
+
+PyDoc_STRVAR(partial_doc,
+"partial(func, *args, **keywords) - new function with partial application\n\
+ of the given arguments and keywords.\n");
+
+#define OFF(x) offsetof(partialobject, x)
+static PyMemberDef partial_memberlist[] = {
+ {"func", T_OBJECT, OFF(fn), READONLY,
+ "function object to use in future partial calls"},
+ {"args", T_OBJECT, OFF(args), READONLY,
+ "tuple of arguments to future partial calls"},
+ {"keywords", T_OBJECT, OFF(kw), READONLY,
+ "dictionary of keyword arguments to future partial calls"},
+ {"__weaklistoffset__", T_PYSSIZET,
+ offsetof(partialobject, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET,
+ offsetof(partialobject, dict), READONLY},
+ {"__vectorcalloffset__", T_PYSSIZET,
+ offsetof(partialobject, vectorcall), READONLY},
+ {NULL} /* Sentinel */
+};
+
+static PyGetSetDef partial_getsetlist[] = {
+ {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
+ {NULL} /* Sentinel */
+};
+
+static PyObject *
+partial_repr(partialobject *pto)
+{
+ PyObject *result = NULL;
+ PyObject *arglist;
+ Py_ssize_t i, n;
+ PyObject *key, *value;
+ int status;
+
+ status = Py_ReprEnter((PyObject *)pto);
+ if (status != 0) {
+ if (status < 0)
+ return NULL;
+ return PyUnicode_FromString("...");
+ }
+
+ arglist = PyUnicode_FromString("");
+ if (arglist == NULL)
+ goto done;
+ /* Pack positional arguments */
+ assert (PyTuple_Check(pto->args));
+ n = PyTuple_GET_SIZE(pto->args);
+ for (i = 0; i < n; i++) {
+ Py_SETREF(arglist, PyUnicode_FromFormat("%U, %R", arglist,
+ PyTuple_GET_ITEM(pto->args, i)));
+ if (arglist == NULL)
+ goto done;
+ }
+ /* Pack keyword arguments */
+ assert (PyDict_Check(pto->kw));
+ for (i = 0; PyDict_Next(pto->kw, &i, &key, &value);) {
+ /* Prevent key.__str__ from deleting the value. */
+ Py_INCREF(value);
+ Py_SETREF(arglist, PyUnicode_FromFormat("%U, %S=%R", arglist,
+ key, value));
+ Py_DECREF(value);
+ if (arglist == NULL)
+ goto done;
+ }
+ result = PyUnicode_FromFormat("%s(%R%U)", Py_TYPE(pto)->tp_name,
+ pto->fn, arglist);
+ Py_DECREF(arglist);
+
+ done:
+ Py_ReprLeave((PyObject *)pto);
+ return result;
+}
+
+/* Pickle strategy:
+ __reduce__ by itself doesn't support getting kwargs in the unpickle
+ operation so we define a __setstate__ that replaces all the information
+ about the partial. If we only replaced part of it someone would use
+ it as a hook to do strange things.
+ */
+
+static PyObject *
+partial_reduce(partialobject *pto, PyObject *unused)
+{
+ return Py_BuildValue("O(O)(OOOO)", Py_TYPE(pto), pto->fn, pto->fn,
+ pto->args, pto->kw,
+ pto->dict ? pto->dict : Py_None);
+}
+
+static PyObject *
+partial_setstate(partialobject *pto, PyObject *state)
+{
+ PyObject *fn, *fnargs, *kw, *dict;
+
+ if (!PyTuple_Check(state) ||
+ !PyArg_ParseTuple(state, "OOOO", &fn, &fnargs, &kw, &dict) ||
+ !PyCallable_Check(fn) ||
+ !PyTuple_Check(fnargs) ||
+ (kw != Py_None && !PyDict_Check(kw)))
+ {
+ PyErr_SetString(PyExc_TypeError, "invalid partial state");
+ return NULL;
+ }
+
+ if(!PyTuple_CheckExact(fnargs))
+ fnargs = PySequence_Tuple(fnargs);
+ else
+ Py_INCREF(fnargs);
+ if (fnargs == NULL)
+ return NULL;
+
+ if (kw == Py_None)
+ kw = PyDict_New();
+ else if(!PyDict_CheckExact(kw))
+ kw = PyDict_Copy(kw);
+ else
+ Py_INCREF(kw);
+ if (kw == NULL) {
+ Py_DECREF(fnargs);
+ return NULL;
+ }
+
+ if (dict == Py_None)
+ dict = NULL;
+ else
+ Py_INCREF(dict);
+
+ Py_SETREF(pto->fn, Py_NewRef(fn));
+ Py_SETREF(pto->args, fnargs);
+ Py_SETREF(pto->kw, kw);
+ Py_XSETREF(pto->dict, dict);
+ partial_setvectorcall(pto);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef partial_methods[] = {
+ {"__reduce__", (PyCFunction)partial_reduce, METH_NOARGS},
+ {"__setstate__", (PyCFunction)partial_setstate, METH_O},
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot partial_type_slots[] = {
+ {Py_tp_dealloc, partial_dealloc},
+ {Py_tp_repr, partial_repr},
+ {Py_tp_call, partial_call},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_setattro, PyObject_GenericSetAttr},
+ {Py_tp_doc, (void *)partial_doc},
+ {Py_tp_traverse, partial_traverse},
+ {Py_tp_clear, partial_clear},
+ {Py_tp_methods, partial_methods},
+ {Py_tp_members, partial_memberlist},
+ {Py_tp_getset, partial_getsetlist},
+ {Py_tp_new, partial_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, 0}
+};
+
+static PyType_Spec partial_type_spec = {
+ .name = "functools.partial",
+ .basicsize = sizeof(partialobject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_VECTORCALL |
+ Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = partial_type_slots
+};
+
+
+/* cmp_to_key ***************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *cmp;
+ PyObject *object;
+} keyobject;
+
+static int
+keyobject_clear(keyobject *ko)
+{
+ Py_CLEAR(ko->cmp);
+ Py_CLEAR(ko->object);
+ return 0;
+}
+
+static void
+keyobject_dealloc(keyobject *ko)
+{
+ PyTypeObject *tp = Py_TYPE(ko);
+ PyObject_GC_UnTrack(ko);
+ (void)keyobject_clear(ko);
+ tp->tp_free(ko);
+ Py_DECREF(tp);
+}
+
+static int
+keyobject_traverse(keyobject *ko, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(ko));
+ Py_VISIT(ko->cmp);
+ Py_VISIT(ko->object);
+ return 0;
+}
+
+static PyMemberDef keyobject_members[] = {
+ {"obj", T_OBJECT,
+ offsetof(keyobject, object), 0,
+ PyDoc_STR("Value wrapped by a key function.")},
+ {NULL}
+};
+
+static PyObject *
+keyobject_call(keyobject *ko, PyObject *args, PyObject *kwds);
+
+static PyObject *
+keyobject_richcompare(PyObject *ko, PyObject *other, int op);
+
+static PyType_Slot keyobject_type_slots[] = {
+ {Py_tp_dealloc, keyobject_dealloc},
+ {Py_tp_call, keyobject_call},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, keyobject_traverse},
+ {Py_tp_clear, keyobject_clear},
+ {Py_tp_richcompare, keyobject_richcompare},
+ {Py_tp_members, keyobject_members},
+ {0, 0}
+};
+
+static PyType_Spec keyobject_type_spec = {
+ .name = "functools.KeyWrapper",
+ .basicsize = sizeof(keyobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = keyobject_type_slots
+};
+
+static PyObject *
+keyobject_call(keyobject *ko, PyObject *args, PyObject *kwds)
+{
+ PyObject *object;
+ keyobject *result;
+ static char *kwargs[] = {"obj", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:K", kwargs, &object))
+ return NULL;
+
+ result = PyObject_GC_New(keyobject, Py_TYPE(ko));
+ if (result == NULL) {
+ return NULL;
+ }
+ result->cmp = Py_NewRef(ko->cmp);
+ result->object = Py_NewRef(object);
+ PyObject_GC_Track(result);
+ return (PyObject *)result;
+}
+
+static PyObject *
+keyobject_richcompare(PyObject *ko, PyObject *other, int op)
+{
+ PyObject *res;
+ PyObject *x;
+ PyObject *y;
+ PyObject *compare;
+ PyObject *answer;
+ PyObject* stack[2];
+
+ if (!Py_IS_TYPE(other, Py_TYPE(ko))) {
+ PyErr_Format(PyExc_TypeError, "other argument must be K instance");
+ return NULL;
+ }
+ compare = ((keyobject *) ko)->cmp;
+ assert(compare != NULL);
+ x = ((keyobject *) ko)->object;
+ y = ((keyobject *) other)->object;
+ if (!x || !y){
+ PyErr_Format(PyExc_AttributeError, "object");
+ return NULL;
+ }
+
+ /* Call the user's comparison function and translate the 3-way
+ * result into true or false (or error).
+ */
+ stack[0] = x;
+ stack[1] = y;
+ res = _PyObject_FastCall(compare, stack, 2);
+ if (res == NULL) {
+ return NULL;
+ }
+
+ answer = PyObject_RichCompare(res, _PyLong_GetZero(), op);
+ Py_DECREF(res);
+ return answer;
+}
+
+/*[clinic input]
+_functools.cmp_to_key
+
+ mycmp: object
+ Function that compares two objects.
+
+Convert a cmp= function into a key= function.
+[clinic start generated code]*/
+
+static PyObject *
+_functools_cmp_to_key_impl(PyObject *module, PyObject *mycmp)
+/*[clinic end generated code: output=71eaad0f4fc81f33 input=d1b76f231c0dfeb3]*/
+{
+ keyobject *object;
+ _functools_state *state;
+
+ state = get_functools_state(module);
+ object = PyObject_GC_New(keyobject, state->keyobject_type);
+ if (!object)
+ return NULL;
+ object->cmp = Py_NewRef(mycmp);
+ object->object = NULL;
+ PyObject_GC_Track(object);
+ return (PyObject *)object;
+}
+
+/* reduce (used to be a builtin) ********************************************/
+
+// Not converted to argument clinic, because of `args` in-place modification.
+// AC will affect performance.
+static PyObject *
+functools_reduce(PyObject *self, PyObject *args)
+{
+ PyObject *seq, *func, *result = NULL, *it;
+
+ if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result))
+ return NULL;
+ if (result != NULL)
+ Py_INCREF(result);
+
+ it = PyObject_GetIter(seq);
+ if (it == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError))
+ PyErr_SetString(PyExc_TypeError,
+ "reduce() arg 2 must support iteration");
+ Py_XDECREF(result);
+ return NULL;
+ }
+
+ if ((args = PyTuple_New(2)) == NULL)
+ goto Fail;
+
+ for (;;) {
+ PyObject *op2;
+
+ if (Py_REFCNT(args) > 1) {
+ Py_DECREF(args);
+ if ((args = PyTuple_New(2)) == NULL)
+ goto Fail;
+ }
+
+ op2 = PyIter_Next(it);
+ if (op2 == NULL) {
+ if (PyErr_Occurred())
+ goto Fail;
+ break;
+ }
+
+ if (result == NULL)
+ result = op2;
+ else {
+ /* Update the args tuple in-place */
+ assert(Py_REFCNT(args) == 1);
+ Py_XSETREF(_PyTuple_ITEMS(args)[0], result);
+ Py_XSETREF(_PyTuple_ITEMS(args)[1], op2);
+ if ((result = PyObject_Call(func, args, NULL)) == NULL) {
+ goto Fail;
+ }
+ // bpo-42536: The GC may have untracked this args tuple. Since we're
+ // recycling it, make sure it's tracked again:
+ if (!_PyObject_GC_IS_TRACKED(args)) {
+ _PyObject_GC_TRACK(args);
+ }
+ }
+ }
+
+ Py_DECREF(args);
+
+ if (result == NULL)
+ PyErr_SetString(PyExc_TypeError,
+ "reduce() of empty iterable with no initial value");
+
+ Py_DECREF(it);
+ return result;
+
+Fail:
+ Py_XDECREF(args);
+ Py_XDECREF(result);
+ Py_DECREF(it);
+ return NULL;
+}
+
+PyDoc_STRVAR(functools_reduce_doc,
+"reduce(function, iterable[, initial]) -> value\n\
+\n\
+Apply a function of two arguments cumulatively to the items of a sequence\n\
+or iterable, from left to right, so as to reduce the iterable to a single\n\
+value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates\n\
+((((1+2)+3)+4)+5). If initial is present, it is placed before the items\n\
+of the iterable in the calculation, and serves as a default when the\n\
+iterable is empty.");
+
+/* lru_cache object **********************************************************/
+
+/* There are four principal algorithmic differences from the pure python version:
+
+ 1). The C version relies on the GIL instead of having its own reentrant lock.
+
+ 2). The prev/next link fields use borrowed references.
+
+ 3). For a full cache, the pure python version rotates the location of the
+ root entry so that it never has to move individual links and it can
+ limit updates to just the key and result fields. However, in the C
+ version, links are temporarily removed while the cache dict updates are
+ occurring. Afterwards, they are appended or prepended back into the
+ doubly-linked lists.
+
+ 4) In the Python version, the _HashSeq class is used to prevent __hash__
+ from being called more than once. In the C version, the "known hash"
+ variants of dictionary calls as used to the same effect.
+
+*/
+
+struct lru_list_elem;
+struct lru_cache_object;
+
+typedef struct lru_list_elem {
+ PyObject_HEAD
+ struct lru_list_elem *prev, *next; /* borrowed links */
+ Py_hash_t hash;
+ PyObject *key, *result;
+} lru_list_elem;
+
+static void
+lru_list_elem_dealloc(lru_list_elem *link)
+{
+ PyTypeObject *tp = Py_TYPE(link);
+ Py_XDECREF(link->key);
+ Py_XDECREF(link->result);
+ tp->tp_free(link);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot lru_list_elem_type_slots[] = {
+ {Py_tp_dealloc, lru_list_elem_dealloc},
+ {0, 0}
+};
+
+static PyType_Spec lru_list_elem_type_spec = {
+ .name = "functools._lru_list_elem",
+ .basicsize = sizeof(lru_list_elem),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = lru_list_elem_type_slots
+};
+
+
+typedef PyObject *(*lru_cache_ternaryfunc)(struct lru_cache_object *, PyObject *, PyObject *);
+
+typedef struct lru_cache_object {
+ lru_list_elem root; /* includes PyObject_HEAD */
+ lru_cache_ternaryfunc wrapper;
+ int typed;
+ PyObject *cache;
+ Py_ssize_t hits;
+ PyObject *func;
+ Py_ssize_t maxsize;
+ Py_ssize_t misses;
+ /* the kwd_mark is used delimit args and keywords in the cache keys */
+ PyObject *kwd_mark;
+ PyTypeObject *lru_list_elem_type;
+ PyObject *cache_info_type;
+ PyObject *dict;
+ PyObject *weakreflist;
+} lru_cache_object;
+
+static PyObject *
+lru_cache_make_key(PyObject *kwd_mark, PyObject *args,
+ PyObject *kwds, int typed)
+{
+ PyObject *key, *keyword, *value;
+ Py_ssize_t key_size, pos, key_pos, kwds_size;
+
+ kwds_size = kwds ? PyDict_GET_SIZE(kwds) : 0;
+
+ /* short path, key will match args anyway, which is a tuple */
+ if (!typed && !kwds_size) {
+ if (PyTuple_GET_SIZE(args) == 1) {
+ key = PyTuple_GET_ITEM(args, 0);
+ if (PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) {
+ /* For common scalar keys, save space by
+ dropping the enclosing args tuple */
+ return Py_NewRef(key);
+ }
+ }
+ return Py_NewRef(args);
+ }
+
+ key_size = PyTuple_GET_SIZE(args);
+ if (kwds_size)
+ key_size += kwds_size * 2 + 1;
+ if (typed)
+ key_size += PyTuple_GET_SIZE(args) + kwds_size;
+
+ key = PyTuple_New(key_size);
+ if (key == NULL)
+ return NULL;
+
+ key_pos = 0;
+ for (pos = 0; pos < PyTuple_GET_SIZE(args); ++pos) {
+ PyObject *item = PyTuple_GET_ITEM(args, pos);
+ PyTuple_SET_ITEM(key, key_pos++, Py_NewRef(item));
+ }
+ if (kwds_size) {
+ PyTuple_SET_ITEM(key, key_pos++, Py_NewRef(kwd_mark));
+ for (pos = 0; PyDict_Next(kwds, &pos, &keyword, &value);) {
+ PyTuple_SET_ITEM(key, key_pos++, Py_NewRef(keyword));
+ PyTuple_SET_ITEM(key, key_pos++, Py_NewRef(value));
+ }
+ assert(key_pos == PyTuple_GET_SIZE(args) + kwds_size * 2 + 1);
+ }
+ if (typed) {
+ for (pos = 0; pos < PyTuple_GET_SIZE(args); ++pos) {
+ PyObject *item = (PyObject *)Py_TYPE(PyTuple_GET_ITEM(args, pos));
+ PyTuple_SET_ITEM(key, key_pos++, Py_NewRef(item));
+ }
+ if (kwds_size) {
+ for (pos = 0; PyDict_Next(kwds, &pos, &keyword, &value);) {
+ PyObject *item = (PyObject *)Py_TYPE(value);
+ PyTuple_SET_ITEM(key, key_pos++, Py_NewRef(item));
+ }
+ }
+ }
+ assert(key_pos == key_size);
+ return key;
+}
+
+static PyObject *
+uncached_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *result;
+
+ self->misses++;
+ result = PyObject_Call(self->func, args, kwds);
+ if (!result)
+ return NULL;
+ return result;
+}
+
+static PyObject *
+infinite_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *result;
+ Py_hash_t hash;
+ PyObject *key = lru_cache_make_key(self->kwd_mark, args, kwds, self->typed);
+ if (!key)
+ return NULL;
+ hash = PyObject_Hash(key);
+ if (hash == -1) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ result = _PyDict_GetItem_KnownHash(self->cache, key, hash);
+ if (result) {
+ Py_INCREF(result);
+ self->hits++;
+ Py_DECREF(key);
+ return result;
+ }
+ if (PyErr_Occurred()) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ self->misses++;
+ result = PyObject_Call(self->func, args, kwds);
+ if (!result) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ if (_PyDict_SetItem_KnownHash(self->cache, key, result, hash) < 0) {
+ Py_DECREF(result);
+ Py_DECREF(key);
+ return NULL;
+ }
+ Py_DECREF(key);
+ return result;
+}
+
+static void
+lru_cache_extract_link(lru_list_elem *link)
+{
+ lru_list_elem *link_prev = link->prev;
+ lru_list_elem *link_next = link->next;
+ link_prev->next = link->next;
+ link_next->prev = link->prev;
+}
+
+static void
+lru_cache_append_link(lru_cache_object *self, lru_list_elem *link)
+{
+ lru_list_elem *root = &self->root;
+ lru_list_elem *last = root->prev;
+ last->next = root->prev = link;
+ link->prev = last;
+ link->next = root;
+}
+
+static void
+lru_cache_prepend_link(lru_cache_object *self, lru_list_elem *link)
+{
+ lru_list_elem *root = &self->root;
+ lru_list_elem *first = root->next;
+ first->prev = root->next = link;
+ link->prev = root;
+ link->next = first;
+}
+
+/* General note on reentrancy:
+
+ There are four dictionary calls in the bounded_lru_cache_wrapper():
+ 1) The initial check for a cache match. 2) The post user-function
+ check for a cache match. 3) The deletion of the oldest entry.
+ 4) The addition of the newest entry.
+
+ In all four calls, we have a known hash which lets use avoid a call
+ to __hash__(). That leaves only __eq__ as a possible source of a
+ reentrant call.
+
+ The __eq__ method call is always made for a cache hit (dict access #1).
+ Accordingly, we have make sure not modify the cache state prior to
+ this call.
+
+ The __eq__ method call is never made for the deletion (dict access #3)
+ because it is an identity match.
+
+ For the other two accesses (#2 and #4), calls to __eq__ only occur
+ when some other entry happens to have an exactly matching hash (all
+ 64-bits). Though rare, this can happen, so we have to make sure to
+ either call it at the top of its code path before any cache
+ state modifications (dict access #2) or be prepared to restore
+ invariants at the end of the code path (dict access #4).
+
+ Another possible source of reentrancy is a decref which can trigger
+ arbitrary code execution. To make the code easier to reason about,
+ the decrefs are deferred to the end of the each possible code path
+ so that we know the cache is a consistent state.
+ */
+
+static PyObject *
+bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds)
+{
+ lru_list_elem *link;
+ PyObject *key, *result, *testresult;
+ Py_hash_t hash;
+
+ key = lru_cache_make_key(self->kwd_mark, args, kwds, self->typed);
+ if (!key)
+ return NULL;
+ hash = PyObject_Hash(key);
+ if (hash == -1) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ link = (lru_list_elem *)_PyDict_GetItem_KnownHash(self->cache, key, hash);
+ if (link != NULL) {
+ lru_cache_extract_link(link);
+ lru_cache_append_link(self, link);
+ result = link->result;
+ self->hits++;
+ Py_INCREF(result);
+ Py_DECREF(key);
+ return result;
+ }
+ if (PyErr_Occurred()) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ self->misses++;
+ result = PyObject_Call(self->func, args, kwds);
+ if (!result) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ testresult = _PyDict_GetItem_KnownHash(self->cache, key, hash);
+ if (testresult != NULL) {
+ /* Getting here means that this same key was added to the cache
+ during the PyObject_Call(). Since the link update is already
+ done, we need only return the computed result. */
+ Py_DECREF(key);
+ return result;
+ }
+ if (PyErr_Occurred()) {
+ /* This is an unusual case since this same lookup
+ did not previously trigger an error during lookup.
+ Treat it the same as an error in user function
+ and return with the error set. */
+ Py_DECREF(key);
+ Py_DECREF(result);
+ return NULL;
+ }
+ /* This is the normal case. The new key wasn't found before
+ user function call and it is still not there. So we
+ proceed normally and update the cache with the new result. */
+
+ assert(self->maxsize > 0);
+ if (PyDict_GET_SIZE(self->cache) < self->maxsize ||
+ self->root.next == &self->root)
+ {
+ /* Cache is not full, so put the result in a new link */
+ link = (lru_list_elem *)PyObject_New(lru_list_elem,
+ self->lru_list_elem_type);
+ if (link == NULL) {
+ Py_DECREF(key);
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ link->hash = hash;
+ link->key = key;
+ link->result = result;
+ /* What is really needed here is a SetItem variant with a "no clobber"
+ option. If the __eq__ call triggers a reentrant call that adds
+ this same key, then this setitem call will update the cache dict
+ with this new link, leaving the old link as an orphan (i.e. not
+ having a cache dict entry that refers to it). */
+ if (_PyDict_SetItem_KnownHash(self->cache, key, (PyObject *)link,
+ hash) < 0) {
+ Py_DECREF(link);
+ return NULL;
+ }
+ lru_cache_append_link(self, link);
+ return Py_NewRef(result);
+ }
+ /* Since the cache is full, we need to evict an old key and add
+ a new key. Rather than free the old link and allocate a new
+ one, we reuse the link for the new key and result and move it
+ to front of the cache to mark it as recently used.
+
+ We try to assure all code paths (including errors) leave all
+ of the links in place. Either the link is successfully
+ updated and moved or it is restored to its old position.
+ However if an unrecoverable error is found, it doesn't
+ make sense to reinsert the link, so we leave it out
+ and the cache will no longer register as full.
+ */
+ PyObject *oldkey, *oldresult, *popresult;
+
+ /* Extract the oldest item. */
+ assert(self->root.next != &self->root);
+ link = self->root.next;
+ lru_cache_extract_link(link);
+ /* Remove it from the cache.
+ The cache dict holds one reference to the link.
+ We created one other reference when the link was created.
+ The linked list only has borrowed references. */
+ popresult = _PyDict_Pop_KnownHash(self->cache, link->key,
+ link->hash, Py_None);
+ if (popresult == Py_None) {
+ /* Getting here means that the user function call or another
+ thread has already removed the old key from the dictionary.
+ This link is now an orphan. Since we don't want to leave the
+ cache in an inconsistent state, we don't restore the link. */
+ Py_DECREF(popresult);
+ Py_DECREF(link);
+ Py_DECREF(key);
+ return result;
+ }
+ if (popresult == NULL) {
+ /* An error arose while trying to remove the oldest key (the one
+ being evicted) from the cache. We restore the link to its
+ original position as the oldest link. Then we allow the
+ error propagate upward; treating it the same as an error
+ arising in the user function. */
+ lru_cache_prepend_link(self, link);
+ Py_DECREF(key);
+ Py_DECREF(result);
+ return NULL;
+ }
+ /* Keep a reference to the old key and old result to prevent their
+ ref counts from going to zero during the update. That will
+ prevent potentially arbitrary object clean-up code (i.e. __del__)
+ from running while we're still adjusting the links. */
+ oldkey = link->key;
+ oldresult = link->result;
+
+ link->hash = hash;
+ link->key = key;
+ link->result = result;
+ /* Note: The link is being added to the cache dict without the
+ prev and next fields set to valid values. We have to wait
+ for successful insertion in the cache dict before adding the
+ link to the linked list. Otherwise, the potentially reentrant
+ __eq__ call could cause the then orphan link to be visited. */
+ if (_PyDict_SetItem_KnownHash(self->cache, key, (PyObject *)link,
+ hash) < 0) {
+ /* Somehow the cache dict update failed. We no longer can
+ restore the old link. Let the error propagate upward and
+ leave the cache short one link. */
+ Py_DECREF(popresult);
+ Py_DECREF(link);
+ Py_DECREF(oldkey);
+ Py_DECREF(oldresult);
+ return NULL;
+ }
+ lru_cache_append_link(self, link);
+ Py_INCREF(result); /* for return */
+ Py_DECREF(popresult);
+ Py_DECREF(oldkey);
+ Py_DECREF(oldresult);
+ return result;
+}
+
+static PyObject *
+lru_cache_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *func, *maxsize_O, *cache_info_type, *cachedict;
+ int typed;
+ lru_cache_object *obj;
+ Py_ssize_t maxsize;
+ PyObject *(*wrapper)(lru_cache_object *, PyObject *, PyObject *);
+ _functools_state *state;
+ static char *keywords[] = {"user_function", "maxsize", "typed",
+ "cache_info_type", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "OOpO:lru_cache", keywords,
+ &func, &maxsize_O, &typed,
+ &cache_info_type)) {
+ return NULL;
+ }
+
+ if (!PyCallable_Check(func)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the first argument must be callable");
+ return NULL;
+ }
+
+ state = get_functools_state_by_type(type);
+ if (state == NULL) {
+ return NULL;
+ }
+
+ /* select the caching function, and make/inc maxsize_O */
+ if (maxsize_O == Py_None) {
+ wrapper = infinite_lru_cache_wrapper;
+ /* use this only to initialize lru_cache_object attribute maxsize */
+ maxsize = -1;
+ } else if (PyIndex_Check(maxsize_O)) {
+ maxsize = PyNumber_AsSsize_t(maxsize_O, PyExc_OverflowError);
+ if (maxsize == -1 && PyErr_Occurred())
+ return NULL;
+ if (maxsize < 0) {
+ maxsize = 0;
+ }
+ if (maxsize == 0)
+ wrapper = uncached_lru_cache_wrapper;
+ else
+ wrapper = bounded_lru_cache_wrapper;
+ } else {
+ PyErr_SetString(PyExc_TypeError, "maxsize should be integer or None");
+ return NULL;
+ }
+
+ if (!(cachedict = PyDict_New()))
+ return NULL;
+
+ obj = (lru_cache_object *)type->tp_alloc(type, 0);
+ if (obj == NULL) {
+ Py_DECREF(cachedict);
+ return NULL;
+ }
+
+ obj->root.prev = &obj->root;
+ obj->root.next = &obj->root;
+ obj->wrapper = wrapper;
+ obj->typed = typed;
+ obj->cache = cachedict;
+ obj->func = Py_NewRef(func);
+ obj->misses = obj->hits = 0;
+ obj->maxsize = maxsize;
+ obj->kwd_mark = Py_NewRef(state->kwd_mark);
+ obj->lru_list_elem_type = (PyTypeObject*)Py_NewRef(state->lru_list_elem_type);
+ obj->cache_info_type = Py_NewRef(cache_info_type);
+ obj->dict = NULL;
+ obj->weakreflist = NULL;
+ return (PyObject *)obj;
+}
+
+static lru_list_elem *
+lru_cache_unlink_list(lru_cache_object *self)
+{
+ lru_list_elem *root = &self->root;
+ lru_list_elem *link = root->next;
+ if (link == root)
+ return NULL;
+ root->prev->next = NULL;
+ root->next = root->prev = root;
+ return link;
+}
+
+static void
+lru_cache_clear_list(lru_list_elem *link)
+{
+ while (link != NULL) {
+ lru_list_elem *next = link->next;
+ Py_SETREF(link, next);
+ }
+}
+
+static int
+lru_cache_tp_clear(lru_cache_object *self)
+{
+ lru_list_elem *list = lru_cache_unlink_list(self);
+ Py_CLEAR(self->cache);
+ Py_CLEAR(self->func);
+ Py_CLEAR(self->kwd_mark);
+ Py_CLEAR(self->lru_list_elem_type);
+ Py_CLEAR(self->cache_info_type);
+ Py_CLEAR(self->dict);
+ lru_cache_clear_list(list);
+ return 0;
+}
+
+static void
+lru_cache_dealloc(lru_cache_object *obj)
+{
+ PyTypeObject *tp = Py_TYPE(obj);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(obj);
+ if (obj->weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject*)obj);
+ }
+
+ (void)lru_cache_tp_clear(obj);
+ tp->tp_free(obj);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+lru_cache_call(lru_cache_object *self, PyObject *args, PyObject *kwds)
+{
+ return self->wrapper(self, args, kwds);
+}
+
+static PyObject *
+lru_cache_descr_get(PyObject *self, PyObject *obj, PyObject *type)
+{
+ if (obj == Py_None || obj == NULL) {
+ return Py_NewRef(self);
+ }
+ return PyMethod_New(self, obj);
+}
+
+/*[clinic input]
+_functools._lru_cache_wrapper.cache_info
+
+Report cache statistics
+[clinic start generated code]*/
+
+static PyObject *
+_functools__lru_cache_wrapper_cache_info_impl(PyObject *self)
+/*[clinic end generated code: output=cc796a0b06dbd717 input=f05e5b6ebfe38645]*/
+{
+ lru_cache_object *_self = (lru_cache_object *) self;
+ if (_self->maxsize == -1) {
+ return PyObject_CallFunction(_self->cache_info_type, "nnOn",
+ _self->hits, _self->misses, Py_None,
+ PyDict_GET_SIZE(_self->cache));
+ }
+ return PyObject_CallFunction(_self->cache_info_type, "nnnn",
+ _self->hits, _self->misses, _self->maxsize,
+ PyDict_GET_SIZE(_self->cache));
+}
+
+/*[clinic input]
+_functools._lru_cache_wrapper.cache_clear
+
+Clear the cache and cache statistics
+[clinic start generated code]*/
+
+static PyObject *
+_functools__lru_cache_wrapper_cache_clear_impl(PyObject *self)
+/*[clinic end generated code: output=58423b35efc3e381 input=6ca59dba09b12584]*/
+{
+ lru_cache_object *_self = (lru_cache_object *) self;
+ lru_list_elem *list = lru_cache_unlink_list(_self);
+ _self->hits = _self->misses = 0;
+ PyDict_Clear(_self->cache);
+ lru_cache_clear_list(list);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+lru_cache_reduce(PyObject *self, PyObject *unused)
+{
+ return PyObject_GetAttrString(self, "__qualname__");
+}
+
+static PyObject *
+lru_cache_copy(PyObject *self, PyObject *unused)
+{
+ return Py_NewRef(self);
+}
+
+static PyObject *
+lru_cache_deepcopy(PyObject *self, PyObject *unused)
+{
+ return Py_NewRef(self);
+}
+
+static int
+lru_cache_tp_traverse(lru_cache_object *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ lru_list_elem *link = self->root.next;
+ while (link != &self->root) {
+ lru_list_elem *next = link->next;
+ Py_VISIT(link->key);
+ Py_VISIT(link->result);
+ Py_VISIT(Py_TYPE(link));
+ link = next;
+ }
+ Py_VISIT(self->cache);
+ Py_VISIT(self->func);
+ Py_VISIT(self->kwd_mark);
+ Py_VISIT(self->lru_list_elem_type);
+ Py_VISIT(self->cache_info_type);
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+
+PyDoc_STRVAR(lru_cache_doc,
+"Create a cached callable that wraps another function.\n\
+\n\
+user_function: the function being cached\n\
+\n\
+maxsize: 0 for no caching\n\
+ None for unlimited cache size\n\
+ n for a bounded cache\n\
+\n\
+typed: False cache f(3) and f(3.0) as identical calls\n\
+ True cache f(3) and f(3.0) as distinct calls\n\
+\n\
+cache_info_type: namedtuple class with the fields:\n\
+ hits misses currsize maxsize\n"
+);
+
+static PyMethodDef lru_cache_methods[] = {
+ _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_INFO_METHODDEF
+ _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_CLEAR_METHODDEF
+ {"__reduce__", (PyCFunction)lru_cache_reduce, METH_NOARGS},
+ {"__copy__", (PyCFunction)lru_cache_copy, METH_VARARGS},
+ {"__deepcopy__", (PyCFunction)lru_cache_deepcopy, METH_VARARGS},
+ {NULL}
+};
+
+static PyGetSetDef lru_cache_getsetlist[] = {
+ {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
+ {NULL}
+};
+
+static PyMemberDef lru_cache_memberlist[] = {
+ {"__dictoffset__", T_PYSSIZET,
+ offsetof(lru_cache_object, dict), READONLY},
+ {"__weaklistoffset__", T_PYSSIZET,
+ offsetof(lru_cache_object, weakreflist), READONLY},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot lru_cache_type_slots[] = {
+ {Py_tp_dealloc, lru_cache_dealloc},
+ {Py_tp_call, lru_cache_call},
+ {Py_tp_doc, (void *)lru_cache_doc},
+ {Py_tp_traverse, lru_cache_tp_traverse},
+ {Py_tp_clear, lru_cache_tp_clear},
+ {Py_tp_methods, lru_cache_methods},
+ {Py_tp_members, lru_cache_memberlist},
+ {Py_tp_getset, lru_cache_getsetlist},
+ {Py_tp_descr_get, lru_cache_descr_get},
+ {Py_tp_new, lru_cache_new},
+ {0, 0}
+};
+
+static PyType_Spec lru_cache_type_spec = {
+ .name = "functools._lru_cache_wrapper",
+ .basicsize = sizeof(lru_cache_object),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_METHOD_DESCRIPTOR | Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = lru_cache_type_slots
+};
+
+
+/* module level code ********************************************************/
+
+PyDoc_STRVAR(_functools_doc,
+"Tools that operate on functions.");
+
+static PyMethodDef _functools_methods[] = {
+ {"reduce", functools_reduce, METH_VARARGS, functools_reduce_doc},
+ _FUNCTOOLS_CMP_TO_KEY_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+_functools_exec(PyObject *module)
+{
+ _functools_state *state = get_functools_state(module);
+ state->kwd_mark = _PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);
+ if (state->kwd_mark == NULL) {
+ return -1;
+ }
+
+ state->partial_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
+ &partial_type_spec, NULL);
+ if (state->partial_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->partial_type) < 0) {
+ return -1;
+ }
+
+ PyObject *lru_cache_type = PyType_FromModuleAndSpec(module,
+ &lru_cache_type_spec, NULL);
+ if (lru_cache_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, (PyTypeObject *)lru_cache_type) < 0) {
+ Py_DECREF(lru_cache_type);
+ return -1;
+ }
+ Py_DECREF(lru_cache_type);
+
+ state->keyobject_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
+ &keyobject_type_spec, NULL);
+ if (state->keyobject_type == NULL) {
+ return -1;
+ }
+ // keyobject_type is used only internally.
+ // So we don't expose it in module namespace.
+
+ state->lru_list_elem_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &lru_list_elem_type_spec, NULL);
+ if (state->lru_list_elem_type == NULL) {
+ return -1;
+ }
+ // lru_list_elem is used only in _lru_cache_wrapper.
+ // So we don't expose it in module namespace.
+
+ return 0;
+}
+
+static int
+_functools_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _functools_state *state = get_functools_state(module);
+ Py_VISIT(state->kwd_mark);
+ Py_VISIT(state->partial_type);
+ Py_VISIT(state->keyobject_type);
+ Py_VISIT(state->lru_list_elem_type);
+ return 0;
+}
+
+static int
+_functools_clear(PyObject *module)
+{
+ _functools_state *state = get_functools_state(module);
+ Py_CLEAR(state->kwd_mark);
+ Py_CLEAR(state->partial_type);
+ Py_CLEAR(state->keyobject_type);
+ Py_CLEAR(state->lru_list_elem_type);
+ return 0;
+}
+
+static void
+_functools_free(void *module)
+{
+ _functools_clear((PyObject *)module);
+}
+
+static struct PyModuleDef_Slot _functools_slots[] = {
+ {Py_mod_exec, _functools_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _functools_module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_functools",
+ .m_doc = _functools_doc,
+ .m_size = sizeof(_functools_state),
+ .m_methods = _functools_methods,
+ .m_slots = _functools_slots,
+ .m_traverse = _functools_traverse,
+ .m_clear = _functools_clear,
+ .m_free = _functools_free,
+};
+
+PyMODINIT_FUNC
+PyInit__functools(void)
+{
+ return PyModuleDef_Init(&_functools_module);
+}
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c
new file mode 100644
index 00000000000..222ac824f01
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.c
@@ -0,0 +1,1472 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#include "internal/Hacl_Hash_MD5.h"
+
+static uint32_t
+_h0[4U] =
+ { (uint32_t)0x67452301U, (uint32_t)0xefcdab89U, (uint32_t)0x98badcfeU, (uint32_t)0x10325476U };
+
+static uint32_t
+_t[64U] =
+ {
+ (uint32_t)0xd76aa478U, (uint32_t)0xe8c7b756U, (uint32_t)0x242070dbU, (uint32_t)0xc1bdceeeU,
+ (uint32_t)0xf57c0fafU, (uint32_t)0x4787c62aU, (uint32_t)0xa8304613U, (uint32_t)0xfd469501U,
+ (uint32_t)0x698098d8U, (uint32_t)0x8b44f7afU, (uint32_t)0xffff5bb1U, (uint32_t)0x895cd7beU,
+ (uint32_t)0x6b901122U, (uint32_t)0xfd987193U, (uint32_t)0xa679438eU, (uint32_t)0x49b40821U,
+ (uint32_t)0xf61e2562U, (uint32_t)0xc040b340U, (uint32_t)0x265e5a51U, (uint32_t)0xe9b6c7aaU,
+ (uint32_t)0xd62f105dU, (uint32_t)0x02441453U, (uint32_t)0xd8a1e681U, (uint32_t)0xe7d3fbc8U,
+ (uint32_t)0x21e1cde6U, (uint32_t)0xc33707d6U, (uint32_t)0xf4d50d87U, (uint32_t)0x455a14edU,
+ (uint32_t)0xa9e3e905U, (uint32_t)0xfcefa3f8U, (uint32_t)0x676f02d9U, (uint32_t)0x8d2a4c8aU,
+ (uint32_t)0xfffa3942U, (uint32_t)0x8771f681U, (uint32_t)0x6d9d6122U, (uint32_t)0xfde5380cU,
+ (uint32_t)0xa4beea44U, (uint32_t)0x4bdecfa9U, (uint32_t)0xf6bb4b60U, (uint32_t)0xbebfbc70U,
+ (uint32_t)0x289b7ec6U, (uint32_t)0xeaa127faU, (uint32_t)0xd4ef3085U, (uint32_t)0x4881d05U,
+ (uint32_t)0xd9d4d039U, (uint32_t)0xe6db99e5U, (uint32_t)0x1fa27cf8U, (uint32_t)0xc4ac5665U,
+ (uint32_t)0xf4292244U, (uint32_t)0x432aff97U, (uint32_t)0xab9423a7U, (uint32_t)0xfc93a039U,
+ (uint32_t)0x655b59c3U, (uint32_t)0x8f0ccc92U, (uint32_t)0xffeff47dU, (uint32_t)0x85845dd1U,
+ (uint32_t)0x6fa87e4fU, (uint32_t)0xfe2ce6e0U, (uint32_t)0xa3014314U, (uint32_t)0x4e0811a1U,
+ (uint32_t)0xf7537e82U, (uint32_t)0xbd3af235U, (uint32_t)0x2ad7d2bbU, (uint32_t)0xeb86d391U
+ };
+
+void Hacl_Hash_Core_MD5_legacy_init(uint32_t *s)
+{
+ KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, (uint32_t)1U, s[i] = _h0[i];);
+}
+
+static void legacy_update(uint32_t *abcd, uint8_t *x)
+{
+ uint32_t aa = abcd[0U];
+ uint32_t bb = abcd[1U];
+ uint32_t cc = abcd[2U];
+ uint32_t dd = abcd[3U];
+ uint32_t va = abcd[0U];
+ uint32_t vb0 = abcd[1U];
+ uint32_t vc0 = abcd[2U];
+ uint32_t vd0 = abcd[3U];
+ uint8_t *b0 = x;
+ uint32_t u = load32_le(b0);
+ uint32_t xk = u;
+ uint32_t ti0 = _t[0U];
+ uint32_t
+ v =
+ vb0
+ +
+ ((va + ((vb0 & vc0) | (~vb0 & vd0)) + xk + ti0)
+ << (uint32_t)7U
+ | (va + ((vb0 & vc0) | (~vb0 & vd0)) + xk + ti0) >> (uint32_t)25U);
+ abcd[0U] = v;
+ uint32_t va0 = abcd[3U];
+ uint32_t vb1 = abcd[0U];
+ uint32_t vc1 = abcd[1U];
+ uint32_t vd1 = abcd[2U];
+ uint8_t *b1 = x + (uint32_t)4U;
+ uint32_t u0 = load32_le(b1);
+ uint32_t xk0 = u0;
+ uint32_t ti1 = _t[1U];
+ uint32_t
+ v0 =
+ vb1
+ +
+ ((va0 + ((vb1 & vc1) | (~vb1 & vd1)) + xk0 + ti1)
+ << (uint32_t)12U
+ | (va0 + ((vb1 & vc1) | (~vb1 & vd1)) + xk0 + ti1) >> (uint32_t)20U);
+ abcd[3U] = v0;
+ uint32_t va1 = abcd[2U];
+ uint32_t vb2 = abcd[3U];
+ uint32_t vc2 = abcd[0U];
+ uint32_t vd2 = abcd[1U];
+ uint8_t *b2 = x + (uint32_t)8U;
+ uint32_t u1 = load32_le(b2);
+ uint32_t xk1 = u1;
+ uint32_t ti2 = _t[2U];
+ uint32_t
+ v1 =
+ vb2
+ +
+ ((va1 + ((vb2 & vc2) | (~vb2 & vd2)) + xk1 + ti2)
+ << (uint32_t)17U
+ | (va1 + ((vb2 & vc2) | (~vb2 & vd2)) + xk1 + ti2) >> (uint32_t)15U);
+ abcd[2U] = v1;
+ uint32_t va2 = abcd[1U];
+ uint32_t vb3 = abcd[2U];
+ uint32_t vc3 = abcd[3U];
+ uint32_t vd3 = abcd[0U];
+ uint8_t *b3 = x + (uint32_t)12U;
+ uint32_t u2 = load32_le(b3);
+ uint32_t xk2 = u2;
+ uint32_t ti3 = _t[3U];
+ uint32_t
+ v2 =
+ vb3
+ +
+ ((va2 + ((vb3 & vc3) | (~vb3 & vd3)) + xk2 + ti3)
+ << (uint32_t)22U
+ | (va2 + ((vb3 & vc3) | (~vb3 & vd3)) + xk2 + ti3) >> (uint32_t)10U);
+ abcd[1U] = v2;
+ uint32_t va3 = abcd[0U];
+ uint32_t vb4 = abcd[1U];
+ uint32_t vc4 = abcd[2U];
+ uint32_t vd4 = abcd[3U];
+ uint8_t *b4 = x + (uint32_t)16U;
+ uint32_t u3 = load32_le(b4);
+ uint32_t xk3 = u3;
+ uint32_t ti4 = _t[4U];
+ uint32_t
+ v3 =
+ vb4
+ +
+ ((va3 + ((vb4 & vc4) | (~vb4 & vd4)) + xk3 + ti4)
+ << (uint32_t)7U
+ | (va3 + ((vb4 & vc4) | (~vb4 & vd4)) + xk3 + ti4) >> (uint32_t)25U);
+ abcd[0U] = v3;
+ uint32_t va4 = abcd[3U];
+ uint32_t vb5 = abcd[0U];
+ uint32_t vc5 = abcd[1U];
+ uint32_t vd5 = abcd[2U];
+ uint8_t *b5 = x + (uint32_t)20U;
+ uint32_t u4 = load32_le(b5);
+ uint32_t xk4 = u4;
+ uint32_t ti5 = _t[5U];
+ uint32_t
+ v4 =
+ vb5
+ +
+ ((va4 + ((vb5 & vc5) | (~vb5 & vd5)) + xk4 + ti5)
+ << (uint32_t)12U
+ | (va4 + ((vb5 & vc5) | (~vb5 & vd5)) + xk4 + ti5) >> (uint32_t)20U);
+ abcd[3U] = v4;
+ uint32_t va5 = abcd[2U];
+ uint32_t vb6 = abcd[3U];
+ uint32_t vc6 = abcd[0U];
+ uint32_t vd6 = abcd[1U];
+ uint8_t *b6 = x + (uint32_t)24U;
+ uint32_t u5 = load32_le(b6);
+ uint32_t xk5 = u5;
+ uint32_t ti6 = _t[6U];
+ uint32_t
+ v5 =
+ vb6
+ +
+ ((va5 + ((vb6 & vc6) | (~vb6 & vd6)) + xk5 + ti6)
+ << (uint32_t)17U
+ | (va5 + ((vb6 & vc6) | (~vb6 & vd6)) + xk5 + ti6) >> (uint32_t)15U);
+ abcd[2U] = v5;
+ uint32_t va6 = abcd[1U];
+ uint32_t vb7 = abcd[2U];
+ uint32_t vc7 = abcd[3U];
+ uint32_t vd7 = abcd[0U];
+ uint8_t *b7 = x + (uint32_t)28U;
+ uint32_t u6 = load32_le(b7);
+ uint32_t xk6 = u6;
+ uint32_t ti7 = _t[7U];
+ uint32_t
+ v6 =
+ vb7
+ +
+ ((va6 + ((vb7 & vc7) | (~vb7 & vd7)) + xk6 + ti7)
+ << (uint32_t)22U
+ | (va6 + ((vb7 & vc7) | (~vb7 & vd7)) + xk6 + ti7) >> (uint32_t)10U);
+ abcd[1U] = v6;
+ uint32_t va7 = abcd[0U];
+ uint32_t vb8 = abcd[1U];
+ uint32_t vc8 = abcd[2U];
+ uint32_t vd8 = abcd[3U];
+ uint8_t *b8 = x + (uint32_t)32U;
+ uint32_t u7 = load32_le(b8);
+ uint32_t xk7 = u7;
+ uint32_t ti8 = _t[8U];
+ uint32_t
+ v7 =
+ vb8
+ +
+ ((va7 + ((vb8 & vc8) | (~vb8 & vd8)) + xk7 + ti8)
+ << (uint32_t)7U
+ | (va7 + ((vb8 & vc8) | (~vb8 & vd8)) + xk7 + ti8) >> (uint32_t)25U);
+ abcd[0U] = v7;
+ uint32_t va8 = abcd[3U];
+ uint32_t vb9 = abcd[0U];
+ uint32_t vc9 = abcd[1U];
+ uint32_t vd9 = abcd[2U];
+ uint8_t *b9 = x + (uint32_t)36U;
+ uint32_t u8 = load32_le(b9);
+ uint32_t xk8 = u8;
+ uint32_t ti9 = _t[9U];
+ uint32_t
+ v8 =
+ vb9
+ +
+ ((va8 + ((vb9 & vc9) | (~vb9 & vd9)) + xk8 + ti9)
+ << (uint32_t)12U
+ | (va8 + ((vb9 & vc9) | (~vb9 & vd9)) + xk8 + ti9) >> (uint32_t)20U);
+ abcd[3U] = v8;
+ uint32_t va9 = abcd[2U];
+ uint32_t vb10 = abcd[3U];
+ uint32_t vc10 = abcd[0U];
+ uint32_t vd10 = abcd[1U];
+ uint8_t *b10 = x + (uint32_t)40U;
+ uint32_t u9 = load32_le(b10);
+ uint32_t xk9 = u9;
+ uint32_t ti10 = _t[10U];
+ uint32_t
+ v9 =
+ vb10
+ +
+ ((va9 + ((vb10 & vc10) | (~vb10 & vd10)) + xk9 + ti10)
+ << (uint32_t)17U
+ | (va9 + ((vb10 & vc10) | (~vb10 & vd10)) + xk9 + ti10) >> (uint32_t)15U);
+ abcd[2U] = v9;
+ uint32_t va10 = abcd[1U];
+ uint32_t vb11 = abcd[2U];
+ uint32_t vc11 = abcd[3U];
+ uint32_t vd11 = abcd[0U];
+ uint8_t *b11 = x + (uint32_t)44U;
+ uint32_t u10 = load32_le(b11);
+ uint32_t xk10 = u10;
+ uint32_t ti11 = _t[11U];
+ uint32_t
+ v10 =
+ vb11
+ +
+ ((va10 + ((vb11 & vc11) | (~vb11 & vd11)) + xk10 + ti11)
+ << (uint32_t)22U
+ | (va10 + ((vb11 & vc11) | (~vb11 & vd11)) + xk10 + ti11) >> (uint32_t)10U);
+ abcd[1U] = v10;
+ uint32_t va11 = abcd[0U];
+ uint32_t vb12 = abcd[1U];
+ uint32_t vc12 = abcd[2U];
+ uint32_t vd12 = abcd[3U];
+ uint8_t *b12 = x + (uint32_t)48U;
+ uint32_t u11 = load32_le(b12);
+ uint32_t xk11 = u11;
+ uint32_t ti12 = _t[12U];
+ uint32_t
+ v11 =
+ vb12
+ +
+ ((va11 + ((vb12 & vc12) | (~vb12 & vd12)) + xk11 + ti12)
+ << (uint32_t)7U
+ | (va11 + ((vb12 & vc12) | (~vb12 & vd12)) + xk11 + ti12) >> (uint32_t)25U);
+ abcd[0U] = v11;
+ uint32_t va12 = abcd[3U];
+ uint32_t vb13 = abcd[0U];
+ uint32_t vc13 = abcd[1U];
+ uint32_t vd13 = abcd[2U];
+ uint8_t *b13 = x + (uint32_t)52U;
+ uint32_t u12 = load32_le(b13);
+ uint32_t xk12 = u12;
+ uint32_t ti13 = _t[13U];
+ uint32_t
+ v12 =
+ vb13
+ +
+ ((va12 + ((vb13 & vc13) | (~vb13 & vd13)) + xk12 + ti13)
+ << (uint32_t)12U
+ | (va12 + ((vb13 & vc13) | (~vb13 & vd13)) + xk12 + ti13) >> (uint32_t)20U);
+ abcd[3U] = v12;
+ uint32_t va13 = abcd[2U];
+ uint32_t vb14 = abcd[3U];
+ uint32_t vc14 = abcd[0U];
+ uint32_t vd14 = abcd[1U];
+ uint8_t *b14 = x + (uint32_t)56U;
+ uint32_t u13 = load32_le(b14);
+ uint32_t xk13 = u13;
+ uint32_t ti14 = _t[14U];
+ uint32_t
+ v13 =
+ vb14
+ +
+ ((va13 + ((vb14 & vc14) | (~vb14 & vd14)) + xk13 + ti14)
+ << (uint32_t)17U
+ | (va13 + ((vb14 & vc14) | (~vb14 & vd14)) + xk13 + ti14) >> (uint32_t)15U);
+ abcd[2U] = v13;
+ uint32_t va14 = abcd[1U];
+ uint32_t vb15 = abcd[2U];
+ uint32_t vc15 = abcd[3U];
+ uint32_t vd15 = abcd[0U];
+ uint8_t *b15 = x + (uint32_t)60U;
+ uint32_t u14 = load32_le(b15);
+ uint32_t xk14 = u14;
+ uint32_t ti15 = _t[15U];
+ uint32_t
+ v14 =
+ vb15
+ +
+ ((va14 + ((vb15 & vc15) | (~vb15 & vd15)) + xk14 + ti15)
+ << (uint32_t)22U
+ | (va14 + ((vb15 & vc15) | (~vb15 & vd15)) + xk14 + ti15) >> (uint32_t)10U);
+ abcd[1U] = v14;
+ uint32_t va15 = abcd[0U];
+ uint32_t vb16 = abcd[1U];
+ uint32_t vc16 = abcd[2U];
+ uint32_t vd16 = abcd[3U];
+ uint8_t *b16 = x + (uint32_t)4U;
+ uint32_t u15 = load32_le(b16);
+ uint32_t xk15 = u15;
+ uint32_t ti16 = _t[16U];
+ uint32_t
+ v15 =
+ vb16
+ +
+ ((va15 + ((vb16 & vd16) | (vc16 & ~vd16)) + xk15 + ti16)
+ << (uint32_t)5U
+ | (va15 + ((vb16 & vd16) | (vc16 & ~vd16)) + xk15 + ti16) >> (uint32_t)27U);
+ abcd[0U] = v15;
+ uint32_t va16 = abcd[3U];
+ uint32_t vb17 = abcd[0U];
+ uint32_t vc17 = abcd[1U];
+ uint32_t vd17 = abcd[2U];
+ uint8_t *b17 = x + (uint32_t)24U;
+ uint32_t u16 = load32_le(b17);
+ uint32_t xk16 = u16;
+ uint32_t ti17 = _t[17U];
+ uint32_t
+ v16 =
+ vb17
+ +
+ ((va16 + ((vb17 & vd17) | (vc17 & ~vd17)) + xk16 + ti17)
+ << (uint32_t)9U
+ | (va16 + ((vb17 & vd17) | (vc17 & ~vd17)) + xk16 + ti17) >> (uint32_t)23U);
+ abcd[3U] = v16;
+ uint32_t va17 = abcd[2U];
+ uint32_t vb18 = abcd[3U];
+ uint32_t vc18 = abcd[0U];
+ uint32_t vd18 = abcd[1U];
+ uint8_t *b18 = x + (uint32_t)44U;
+ uint32_t u17 = load32_le(b18);
+ uint32_t xk17 = u17;
+ uint32_t ti18 = _t[18U];
+ uint32_t
+ v17 =
+ vb18
+ +
+ ((va17 + ((vb18 & vd18) | (vc18 & ~vd18)) + xk17 + ti18)
+ << (uint32_t)14U
+ | (va17 + ((vb18 & vd18) | (vc18 & ~vd18)) + xk17 + ti18) >> (uint32_t)18U);
+ abcd[2U] = v17;
+ uint32_t va18 = abcd[1U];
+ uint32_t vb19 = abcd[2U];
+ uint32_t vc19 = abcd[3U];
+ uint32_t vd19 = abcd[0U];
+ uint8_t *b19 = x;
+ uint32_t u18 = load32_le(b19);
+ uint32_t xk18 = u18;
+ uint32_t ti19 = _t[19U];
+ uint32_t
+ v18 =
+ vb19
+ +
+ ((va18 + ((vb19 & vd19) | (vc19 & ~vd19)) + xk18 + ti19)
+ << (uint32_t)20U
+ | (va18 + ((vb19 & vd19) | (vc19 & ~vd19)) + xk18 + ti19) >> (uint32_t)12U);
+ abcd[1U] = v18;
+ uint32_t va19 = abcd[0U];
+ uint32_t vb20 = abcd[1U];
+ uint32_t vc20 = abcd[2U];
+ uint32_t vd20 = abcd[3U];
+ uint8_t *b20 = x + (uint32_t)20U;
+ uint32_t u19 = load32_le(b20);
+ uint32_t xk19 = u19;
+ uint32_t ti20 = _t[20U];
+ uint32_t
+ v19 =
+ vb20
+ +
+ ((va19 + ((vb20 & vd20) | (vc20 & ~vd20)) + xk19 + ti20)
+ << (uint32_t)5U
+ | (va19 + ((vb20 & vd20) | (vc20 & ~vd20)) + xk19 + ti20) >> (uint32_t)27U);
+ abcd[0U] = v19;
+ uint32_t va20 = abcd[3U];
+ uint32_t vb21 = abcd[0U];
+ uint32_t vc21 = abcd[1U];
+ uint32_t vd21 = abcd[2U];
+ uint8_t *b21 = x + (uint32_t)40U;
+ uint32_t u20 = load32_le(b21);
+ uint32_t xk20 = u20;
+ uint32_t ti21 = _t[21U];
+ uint32_t
+ v20 =
+ vb21
+ +
+ ((va20 + ((vb21 & vd21) | (vc21 & ~vd21)) + xk20 + ti21)
+ << (uint32_t)9U
+ | (va20 + ((vb21 & vd21) | (vc21 & ~vd21)) + xk20 + ti21) >> (uint32_t)23U);
+ abcd[3U] = v20;
+ uint32_t va21 = abcd[2U];
+ uint32_t vb22 = abcd[3U];
+ uint32_t vc22 = abcd[0U];
+ uint32_t vd22 = abcd[1U];
+ uint8_t *b22 = x + (uint32_t)60U;
+ uint32_t u21 = load32_le(b22);
+ uint32_t xk21 = u21;
+ uint32_t ti22 = _t[22U];
+ uint32_t
+ v21 =
+ vb22
+ +
+ ((va21 + ((vb22 & vd22) | (vc22 & ~vd22)) + xk21 + ti22)
+ << (uint32_t)14U
+ | (va21 + ((vb22 & vd22) | (vc22 & ~vd22)) + xk21 + ti22) >> (uint32_t)18U);
+ abcd[2U] = v21;
+ uint32_t va22 = abcd[1U];
+ uint32_t vb23 = abcd[2U];
+ uint32_t vc23 = abcd[3U];
+ uint32_t vd23 = abcd[0U];
+ uint8_t *b23 = x + (uint32_t)16U;
+ uint32_t u22 = load32_le(b23);
+ uint32_t xk22 = u22;
+ uint32_t ti23 = _t[23U];
+ uint32_t
+ v22 =
+ vb23
+ +
+ ((va22 + ((vb23 & vd23) | (vc23 & ~vd23)) + xk22 + ti23)
+ << (uint32_t)20U
+ | (va22 + ((vb23 & vd23) | (vc23 & ~vd23)) + xk22 + ti23) >> (uint32_t)12U);
+ abcd[1U] = v22;
+ uint32_t va23 = abcd[0U];
+ uint32_t vb24 = abcd[1U];
+ uint32_t vc24 = abcd[2U];
+ uint32_t vd24 = abcd[3U];
+ uint8_t *b24 = x + (uint32_t)36U;
+ uint32_t u23 = load32_le(b24);
+ uint32_t xk23 = u23;
+ uint32_t ti24 = _t[24U];
+ uint32_t
+ v23 =
+ vb24
+ +
+ ((va23 + ((vb24 & vd24) | (vc24 & ~vd24)) + xk23 + ti24)
+ << (uint32_t)5U
+ | (va23 + ((vb24 & vd24) | (vc24 & ~vd24)) + xk23 + ti24) >> (uint32_t)27U);
+ abcd[0U] = v23;
+ uint32_t va24 = abcd[3U];
+ uint32_t vb25 = abcd[0U];
+ uint32_t vc25 = abcd[1U];
+ uint32_t vd25 = abcd[2U];
+ uint8_t *b25 = x + (uint32_t)56U;
+ uint32_t u24 = load32_le(b25);
+ uint32_t xk24 = u24;
+ uint32_t ti25 = _t[25U];
+ uint32_t
+ v24 =
+ vb25
+ +
+ ((va24 + ((vb25 & vd25) | (vc25 & ~vd25)) + xk24 + ti25)
+ << (uint32_t)9U
+ | (va24 + ((vb25 & vd25) | (vc25 & ~vd25)) + xk24 + ti25) >> (uint32_t)23U);
+ abcd[3U] = v24;
+ uint32_t va25 = abcd[2U];
+ uint32_t vb26 = abcd[3U];
+ uint32_t vc26 = abcd[0U];
+ uint32_t vd26 = abcd[1U];
+ uint8_t *b26 = x + (uint32_t)12U;
+ uint32_t u25 = load32_le(b26);
+ uint32_t xk25 = u25;
+ uint32_t ti26 = _t[26U];
+ uint32_t
+ v25 =
+ vb26
+ +
+ ((va25 + ((vb26 & vd26) | (vc26 & ~vd26)) + xk25 + ti26)
+ << (uint32_t)14U
+ | (va25 + ((vb26 & vd26) | (vc26 & ~vd26)) + xk25 + ti26) >> (uint32_t)18U);
+ abcd[2U] = v25;
+ uint32_t va26 = abcd[1U];
+ uint32_t vb27 = abcd[2U];
+ uint32_t vc27 = abcd[3U];
+ uint32_t vd27 = abcd[0U];
+ uint8_t *b27 = x + (uint32_t)32U;
+ uint32_t u26 = load32_le(b27);
+ uint32_t xk26 = u26;
+ uint32_t ti27 = _t[27U];
+ uint32_t
+ v26 =
+ vb27
+ +
+ ((va26 + ((vb27 & vd27) | (vc27 & ~vd27)) + xk26 + ti27)
+ << (uint32_t)20U
+ | (va26 + ((vb27 & vd27) | (vc27 & ~vd27)) + xk26 + ti27) >> (uint32_t)12U);
+ abcd[1U] = v26;
+ uint32_t va27 = abcd[0U];
+ uint32_t vb28 = abcd[1U];
+ uint32_t vc28 = abcd[2U];
+ uint32_t vd28 = abcd[3U];
+ uint8_t *b28 = x + (uint32_t)52U;
+ uint32_t u27 = load32_le(b28);
+ uint32_t xk27 = u27;
+ uint32_t ti28 = _t[28U];
+ uint32_t
+ v27 =
+ vb28
+ +
+ ((va27 + ((vb28 & vd28) | (vc28 & ~vd28)) + xk27 + ti28)
+ << (uint32_t)5U
+ | (va27 + ((vb28 & vd28) | (vc28 & ~vd28)) + xk27 + ti28) >> (uint32_t)27U);
+ abcd[0U] = v27;
+ uint32_t va28 = abcd[3U];
+ uint32_t vb29 = abcd[0U];
+ uint32_t vc29 = abcd[1U];
+ uint32_t vd29 = abcd[2U];
+ uint8_t *b29 = x + (uint32_t)8U;
+ uint32_t u28 = load32_le(b29);
+ uint32_t xk28 = u28;
+ uint32_t ti29 = _t[29U];
+ uint32_t
+ v28 =
+ vb29
+ +
+ ((va28 + ((vb29 & vd29) | (vc29 & ~vd29)) + xk28 + ti29)
+ << (uint32_t)9U
+ | (va28 + ((vb29 & vd29) | (vc29 & ~vd29)) + xk28 + ti29) >> (uint32_t)23U);
+ abcd[3U] = v28;
+ uint32_t va29 = abcd[2U];
+ uint32_t vb30 = abcd[3U];
+ uint32_t vc30 = abcd[0U];
+ uint32_t vd30 = abcd[1U];
+ uint8_t *b30 = x + (uint32_t)28U;
+ uint32_t u29 = load32_le(b30);
+ uint32_t xk29 = u29;
+ uint32_t ti30 = _t[30U];
+ uint32_t
+ v29 =
+ vb30
+ +
+ ((va29 + ((vb30 & vd30) | (vc30 & ~vd30)) + xk29 + ti30)
+ << (uint32_t)14U
+ | (va29 + ((vb30 & vd30) | (vc30 & ~vd30)) + xk29 + ti30) >> (uint32_t)18U);
+ abcd[2U] = v29;
+ uint32_t va30 = abcd[1U];
+ uint32_t vb31 = abcd[2U];
+ uint32_t vc31 = abcd[3U];
+ uint32_t vd31 = abcd[0U];
+ uint8_t *b31 = x + (uint32_t)48U;
+ uint32_t u30 = load32_le(b31);
+ uint32_t xk30 = u30;
+ uint32_t ti31 = _t[31U];
+ uint32_t
+ v30 =
+ vb31
+ +
+ ((va30 + ((vb31 & vd31) | (vc31 & ~vd31)) + xk30 + ti31)
+ << (uint32_t)20U
+ | (va30 + ((vb31 & vd31) | (vc31 & ~vd31)) + xk30 + ti31) >> (uint32_t)12U);
+ abcd[1U] = v30;
+ uint32_t va31 = abcd[0U];
+ uint32_t vb32 = abcd[1U];
+ uint32_t vc32 = abcd[2U];
+ uint32_t vd32 = abcd[3U];
+ uint8_t *b32 = x + (uint32_t)20U;
+ uint32_t u31 = load32_le(b32);
+ uint32_t xk31 = u31;
+ uint32_t ti32 = _t[32U];
+ uint32_t
+ v31 =
+ vb32
+ +
+ ((va31 + (vb32 ^ (vc32 ^ vd32)) + xk31 + ti32)
+ << (uint32_t)4U
+ | (va31 + (vb32 ^ (vc32 ^ vd32)) + xk31 + ti32) >> (uint32_t)28U);
+ abcd[0U] = v31;
+ uint32_t va32 = abcd[3U];
+ uint32_t vb33 = abcd[0U];
+ uint32_t vc33 = abcd[1U];
+ uint32_t vd33 = abcd[2U];
+ uint8_t *b33 = x + (uint32_t)32U;
+ uint32_t u32 = load32_le(b33);
+ uint32_t xk32 = u32;
+ uint32_t ti33 = _t[33U];
+ uint32_t
+ v32 =
+ vb33
+ +
+ ((va32 + (vb33 ^ (vc33 ^ vd33)) + xk32 + ti33)
+ << (uint32_t)11U
+ | (va32 + (vb33 ^ (vc33 ^ vd33)) + xk32 + ti33) >> (uint32_t)21U);
+ abcd[3U] = v32;
+ uint32_t va33 = abcd[2U];
+ uint32_t vb34 = abcd[3U];
+ uint32_t vc34 = abcd[0U];
+ uint32_t vd34 = abcd[1U];
+ uint8_t *b34 = x + (uint32_t)44U;
+ uint32_t u33 = load32_le(b34);
+ uint32_t xk33 = u33;
+ uint32_t ti34 = _t[34U];
+ uint32_t
+ v33 =
+ vb34
+ +
+ ((va33 + (vb34 ^ (vc34 ^ vd34)) + xk33 + ti34)
+ << (uint32_t)16U
+ | (va33 + (vb34 ^ (vc34 ^ vd34)) + xk33 + ti34) >> (uint32_t)16U);
+ abcd[2U] = v33;
+ uint32_t va34 = abcd[1U];
+ uint32_t vb35 = abcd[2U];
+ uint32_t vc35 = abcd[3U];
+ uint32_t vd35 = abcd[0U];
+ uint8_t *b35 = x + (uint32_t)56U;
+ uint32_t u34 = load32_le(b35);
+ uint32_t xk34 = u34;
+ uint32_t ti35 = _t[35U];
+ uint32_t
+ v34 =
+ vb35
+ +
+ ((va34 + (vb35 ^ (vc35 ^ vd35)) + xk34 + ti35)
+ << (uint32_t)23U
+ | (va34 + (vb35 ^ (vc35 ^ vd35)) + xk34 + ti35) >> (uint32_t)9U);
+ abcd[1U] = v34;
+ uint32_t va35 = abcd[0U];
+ uint32_t vb36 = abcd[1U];
+ uint32_t vc36 = abcd[2U];
+ uint32_t vd36 = abcd[3U];
+ uint8_t *b36 = x + (uint32_t)4U;
+ uint32_t u35 = load32_le(b36);
+ uint32_t xk35 = u35;
+ uint32_t ti36 = _t[36U];
+ uint32_t
+ v35 =
+ vb36
+ +
+ ((va35 + (vb36 ^ (vc36 ^ vd36)) + xk35 + ti36)
+ << (uint32_t)4U
+ | (va35 + (vb36 ^ (vc36 ^ vd36)) + xk35 + ti36) >> (uint32_t)28U);
+ abcd[0U] = v35;
+ uint32_t va36 = abcd[3U];
+ uint32_t vb37 = abcd[0U];
+ uint32_t vc37 = abcd[1U];
+ uint32_t vd37 = abcd[2U];
+ uint8_t *b37 = x + (uint32_t)16U;
+ uint32_t u36 = load32_le(b37);
+ uint32_t xk36 = u36;
+ uint32_t ti37 = _t[37U];
+ uint32_t
+ v36 =
+ vb37
+ +
+ ((va36 + (vb37 ^ (vc37 ^ vd37)) + xk36 + ti37)
+ << (uint32_t)11U
+ | (va36 + (vb37 ^ (vc37 ^ vd37)) + xk36 + ti37) >> (uint32_t)21U);
+ abcd[3U] = v36;
+ uint32_t va37 = abcd[2U];
+ uint32_t vb38 = abcd[3U];
+ uint32_t vc38 = abcd[0U];
+ uint32_t vd38 = abcd[1U];
+ uint8_t *b38 = x + (uint32_t)28U;
+ uint32_t u37 = load32_le(b38);
+ uint32_t xk37 = u37;
+ uint32_t ti38 = _t[38U];
+ uint32_t
+ v37 =
+ vb38
+ +
+ ((va37 + (vb38 ^ (vc38 ^ vd38)) + xk37 + ti38)
+ << (uint32_t)16U
+ | (va37 + (vb38 ^ (vc38 ^ vd38)) + xk37 + ti38) >> (uint32_t)16U);
+ abcd[2U] = v37;
+ uint32_t va38 = abcd[1U];
+ uint32_t vb39 = abcd[2U];
+ uint32_t vc39 = abcd[3U];
+ uint32_t vd39 = abcd[0U];
+ uint8_t *b39 = x + (uint32_t)40U;
+ uint32_t u38 = load32_le(b39);
+ uint32_t xk38 = u38;
+ uint32_t ti39 = _t[39U];
+ uint32_t
+ v38 =
+ vb39
+ +
+ ((va38 + (vb39 ^ (vc39 ^ vd39)) + xk38 + ti39)
+ << (uint32_t)23U
+ | (va38 + (vb39 ^ (vc39 ^ vd39)) + xk38 + ti39) >> (uint32_t)9U);
+ abcd[1U] = v38;
+ uint32_t va39 = abcd[0U];
+ uint32_t vb40 = abcd[1U];
+ uint32_t vc40 = abcd[2U];
+ uint32_t vd40 = abcd[3U];
+ uint8_t *b40 = x + (uint32_t)52U;
+ uint32_t u39 = load32_le(b40);
+ uint32_t xk39 = u39;
+ uint32_t ti40 = _t[40U];
+ uint32_t
+ v39 =
+ vb40
+ +
+ ((va39 + (vb40 ^ (vc40 ^ vd40)) + xk39 + ti40)
+ << (uint32_t)4U
+ | (va39 + (vb40 ^ (vc40 ^ vd40)) + xk39 + ti40) >> (uint32_t)28U);
+ abcd[0U] = v39;
+ uint32_t va40 = abcd[3U];
+ uint32_t vb41 = abcd[0U];
+ uint32_t vc41 = abcd[1U];
+ uint32_t vd41 = abcd[2U];
+ uint8_t *b41 = x;
+ uint32_t u40 = load32_le(b41);
+ uint32_t xk40 = u40;
+ uint32_t ti41 = _t[41U];
+ uint32_t
+ v40 =
+ vb41
+ +
+ ((va40 + (vb41 ^ (vc41 ^ vd41)) + xk40 + ti41)
+ << (uint32_t)11U
+ | (va40 + (vb41 ^ (vc41 ^ vd41)) + xk40 + ti41) >> (uint32_t)21U);
+ abcd[3U] = v40;
+ uint32_t va41 = abcd[2U];
+ uint32_t vb42 = abcd[3U];
+ uint32_t vc42 = abcd[0U];
+ uint32_t vd42 = abcd[1U];
+ uint8_t *b42 = x + (uint32_t)12U;
+ uint32_t u41 = load32_le(b42);
+ uint32_t xk41 = u41;
+ uint32_t ti42 = _t[42U];
+ uint32_t
+ v41 =
+ vb42
+ +
+ ((va41 + (vb42 ^ (vc42 ^ vd42)) + xk41 + ti42)
+ << (uint32_t)16U
+ | (va41 + (vb42 ^ (vc42 ^ vd42)) + xk41 + ti42) >> (uint32_t)16U);
+ abcd[2U] = v41;
+ uint32_t va42 = abcd[1U];
+ uint32_t vb43 = abcd[2U];
+ uint32_t vc43 = abcd[3U];
+ uint32_t vd43 = abcd[0U];
+ uint8_t *b43 = x + (uint32_t)24U;
+ uint32_t u42 = load32_le(b43);
+ uint32_t xk42 = u42;
+ uint32_t ti43 = _t[43U];
+ uint32_t
+ v42 =
+ vb43
+ +
+ ((va42 + (vb43 ^ (vc43 ^ vd43)) + xk42 + ti43)
+ << (uint32_t)23U
+ | (va42 + (vb43 ^ (vc43 ^ vd43)) + xk42 + ti43) >> (uint32_t)9U);
+ abcd[1U] = v42;
+ uint32_t va43 = abcd[0U];
+ uint32_t vb44 = abcd[1U];
+ uint32_t vc44 = abcd[2U];
+ uint32_t vd44 = abcd[3U];
+ uint8_t *b44 = x + (uint32_t)36U;
+ uint32_t u43 = load32_le(b44);
+ uint32_t xk43 = u43;
+ uint32_t ti44 = _t[44U];
+ uint32_t
+ v43 =
+ vb44
+ +
+ ((va43 + (vb44 ^ (vc44 ^ vd44)) + xk43 + ti44)
+ << (uint32_t)4U
+ | (va43 + (vb44 ^ (vc44 ^ vd44)) + xk43 + ti44) >> (uint32_t)28U);
+ abcd[0U] = v43;
+ uint32_t va44 = abcd[3U];
+ uint32_t vb45 = abcd[0U];
+ uint32_t vc45 = abcd[1U];
+ uint32_t vd45 = abcd[2U];
+ uint8_t *b45 = x + (uint32_t)48U;
+ uint32_t u44 = load32_le(b45);
+ uint32_t xk44 = u44;
+ uint32_t ti45 = _t[45U];
+ uint32_t
+ v44 =
+ vb45
+ +
+ ((va44 + (vb45 ^ (vc45 ^ vd45)) + xk44 + ti45)
+ << (uint32_t)11U
+ | (va44 + (vb45 ^ (vc45 ^ vd45)) + xk44 + ti45) >> (uint32_t)21U);
+ abcd[3U] = v44;
+ uint32_t va45 = abcd[2U];
+ uint32_t vb46 = abcd[3U];
+ uint32_t vc46 = abcd[0U];
+ uint32_t vd46 = abcd[1U];
+ uint8_t *b46 = x + (uint32_t)60U;
+ uint32_t u45 = load32_le(b46);
+ uint32_t xk45 = u45;
+ uint32_t ti46 = _t[46U];
+ uint32_t
+ v45 =
+ vb46
+ +
+ ((va45 + (vb46 ^ (vc46 ^ vd46)) + xk45 + ti46)
+ << (uint32_t)16U
+ | (va45 + (vb46 ^ (vc46 ^ vd46)) + xk45 + ti46) >> (uint32_t)16U);
+ abcd[2U] = v45;
+ uint32_t va46 = abcd[1U];
+ uint32_t vb47 = abcd[2U];
+ uint32_t vc47 = abcd[3U];
+ uint32_t vd47 = abcd[0U];
+ uint8_t *b47 = x + (uint32_t)8U;
+ uint32_t u46 = load32_le(b47);
+ uint32_t xk46 = u46;
+ uint32_t ti47 = _t[47U];
+ uint32_t
+ v46 =
+ vb47
+ +
+ ((va46 + (vb47 ^ (vc47 ^ vd47)) + xk46 + ti47)
+ << (uint32_t)23U
+ | (va46 + (vb47 ^ (vc47 ^ vd47)) + xk46 + ti47) >> (uint32_t)9U);
+ abcd[1U] = v46;
+ uint32_t va47 = abcd[0U];
+ uint32_t vb48 = abcd[1U];
+ uint32_t vc48 = abcd[2U];
+ uint32_t vd48 = abcd[3U];
+ uint8_t *b48 = x;
+ uint32_t u47 = load32_le(b48);
+ uint32_t xk47 = u47;
+ uint32_t ti48 = _t[48U];
+ uint32_t
+ v47 =
+ vb48
+ +
+ ((va47 + (vc48 ^ (vb48 | ~vd48)) + xk47 + ti48)
+ << (uint32_t)6U
+ | (va47 + (vc48 ^ (vb48 | ~vd48)) + xk47 + ti48) >> (uint32_t)26U);
+ abcd[0U] = v47;
+ uint32_t va48 = abcd[3U];
+ uint32_t vb49 = abcd[0U];
+ uint32_t vc49 = abcd[1U];
+ uint32_t vd49 = abcd[2U];
+ uint8_t *b49 = x + (uint32_t)28U;
+ uint32_t u48 = load32_le(b49);
+ uint32_t xk48 = u48;
+ uint32_t ti49 = _t[49U];
+ uint32_t
+ v48 =
+ vb49
+ +
+ ((va48 + (vc49 ^ (vb49 | ~vd49)) + xk48 + ti49)
+ << (uint32_t)10U
+ | (va48 + (vc49 ^ (vb49 | ~vd49)) + xk48 + ti49) >> (uint32_t)22U);
+ abcd[3U] = v48;
+ uint32_t va49 = abcd[2U];
+ uint32_t vb50 = abcd[3U];
+ uint32_t vc50 = abcd[0U];
+ uint32_t vd50 = abcd[1U];
+ uint8_t *b50 = x + (uint32_t)56U;
+ uint32_t u49 = load32_le(b50);
+ uint32_t xk49 = u49;
+ uint32_t ti50 = _t[50U];
+ uint32_t
+ v49 =
+ vb50
+ +
+ ((va49 + (vc50 ^ (vb50 | ~vd50)) + xk49 + ti50)
+ << (uint32_t)15U
+ | (va49 + (vc50 ^ (vb50 | ~vd50)) + xk49 + ti50) >> (uint32_t)17U);
+ abcd[2U] = v49;
+ uint32_t va50 = abcd[1U];
+ uint32_t vb51 = abcd[2U];
+ uint32_t vc51 = abcd[3U];
+ uint32_t vd51 = abcd[0U];
+ uint8_t *b51 = x + (uint32_t)20U;
+ uint32_t u50 = load32_le(b51);
+ uint32_t xk50 = u50;
+ uint32_t ti51 = _t[51U];
+ uint32_t
+ v50 =
+ vb51
+ +
+ ((va50 + (vc51 ^ (vb51 | ~vd51)) + xk50 + ti51)
+ << (uint32_t)21U
+ | (va50 + (vc51 ^ (vb51 | ~vd51)) + xk50 + ti51) >> (uint32_t)11U);
+ abcd[1U] = v50;
+ uint32_t va51 = abcd[0U];
+ uint32_t vb52 = abcd[1U];
+ uint32_t vc52 = abcd[2U];
+ uint32_t vd52 = abcd[3U];
+ uint8_t *b52 = x + (uint32_t)48U;
+ uint32_t u51 = load32_le(b52);
+ uint32_t xk51 = u51;
+ uint32_t ti52 = _t[52U];
+ uint32_t
+ v51 =
+ vb52
+ +
+ ((va51 + (vc52 ^ (vb52 | ~vd52)) + xk51 + ti52)
+ << (uint32_t)6U
+ | (va51 + (vc52 ^ (vb52 | ~vd52)) + xk51 + ti52) >> (uint32_t)26U);
+ abcd[0U] = v51;
+ uint32_t va52 = abcd[3U];
+ uint32_t vb53 = abcd[0U];
+ uint32_t vc53 = abcd[1U];
+ uint32_t vd53 = abcd[2U];
+ uint8_t *b53 = x + (uint32_t)12U;
+ uint32_t u52 = load32_le(b53);
+ uint32_t xk52 = u52;
+ uint32_t ti53 = _t[53U];
+ uint32_t
+ v52 =
+ vb53
+ +
+ ((va52 + (vc53 ^ (vb53 | ~vd53)) + xk52 + ti53)
+ << (uint32_t)10U
+ | (va52 + (vc53 ^ (vb53 | ~vd53)) + xk52 + ti53) >> (uint32_t)22U);
+ abcd[3U] = v52;
+ uint32_t va53 = abcd[2U];
+ uint32_t vb54 = abcd[3U];
+ uint32_t vc54 = abcd[0U];
+ uint32_t vd54 = abcd[1U];
+ uint8_t *b54 = x + (uint32_t)40U;
+ uint32_t u53 = load32_le(b54);
+ uint32_t xk53 = u53;
+ uint32_t ti54 = _t[54U];
+ uint32_t
+ v53 =
+ vb54
+ +
+ ((va53 + (vc54 ^ (vb54 | ~vd54)) + xk53 + ti54)
+ << (uint32_t)15U
+ | (va53 + (vc54 ^ (vb54 | ~vd54)) + xk53 + ti54) >> (uint32_t)17U);
+ abcd[2U] = v53;
+ uint32_t va54 = abcd[1U];
+ uint32_t vb55 = abcd[2U];
+ uint32_t vc55 = abcd[3U];
+ uint32_t vd55 = abcd[0U];
+ uint8_t *b55 = x + (uint32_t)4U;
+ uint32_t u54 = load32_le(b55);
+ uint32_t xk54 = u54;
+ uint32_t ti55 = _t[55U];
+ uint32_t
+ v54 =
+ vb55
+ +
+ ((va54 + (vc55 ^ (vb55 | ~vd55)) + xk54 + ti55)
+ << (uint32_t)21U
+ | (va54 + (vc55 ^ (vb55 | ~vd55)) + xk54 + ti55) >> (uint32_t)11U);
+ abcd[1U] = v54;
+ uint32_t va55 = abcd[0U];
+ uint32_t vb56 = abcd[1U];
+ uint32_t vc56 = abcd[2U];
+ uint32_t vd56 = abcd[3U];
+ uint8_t *b56 = x + (uint32_t)32U;
+ uint32_t u55 = load32_le(b56);
+ uint32_t xk55 = u55;
+ uint32_t ti56 = _t[56U];
+ uint32_t
+ v55 =
+ vb56
+ +
+ ((va55 + (vc56 ^ (vb56 | ~vd56)) + xk55 + ti56)
+ << (uint32_t)6U
+ | (va55 + (vc56 ^ (vb56 | ~vd56)) + xk55 + ti56) >> (uint32_t)26U);
+ abcd[0U] = v55;
+ uint32_t va56 = abcd[3U];
+ uint32_t vb57 = abcd[0U];
+ uint32_t vc57 = abcd[1U];
+ uint32_t vd57 = abcd[2U];
+ uint8_t *b57 = x + (uint32_t)60U;
+ uint32_t u56 = load32_le(b57);
+ uint32_t xk56 = u56;
+ uint32_t ti57 = _t[57U];
+ uint32_t
+ v56 =
+ vb57
+ +
+ ((va56 + (vc57 ^ (vb57 | ~vd57)) + xk56 + ti57)
+ << (uint32_t)10U
+ | (va56 + (vc57 ^ (vb57 | ~vd57)) + xk56 + ti57) >> (uint32_t)22U);
+ abcd[3U] = v56;
+ uint32_t va57 = abcd[2U];
+ uint32_t vb58 = abcd[3U];
+ uint32_t vc58 = abcd[0U];
+ uint32_t vd58 = abcd[1U];
+ uint8_t *b58 = x + (uint32_t)24U;
+ uint32_t u57 = load32_le(b58);
+ uint32_t xk57 = u57;
+ uint32_t ti58 = _t[58U];
+ uint32_t
+ v57 =
+ vb58
+ +
+ ((va57 + (vc58 ^ (vb58 | ~vd58)) + xk57 + ti58)
+ << (uint32_t)15U
+ | (va57 + (vc58 ^ (vb58 | ~vd58)) + xk57 + ti58) >> (uint32_t)17U);
+ abcd[2U] = v57;
+ uint32_t va58 = abcd[1U];
+ uint32_t vb59 = abcd[2U];
+ uint32_t vc59 = abcd[3U];
+ uint32_t vd59 = abcd[0U];
+ uint8_t *b59 = x + (uint32_t)52U;
+ uint32_t u58 = load32_le(b59);
+ uint32_t xk58 = u58;
+ uint32_t ti59 = _t[59U];
+ uint32_t
+ v58 =
+ vb59
+ +
+ ((va58 + (vc59 ^ (vb59 | ~vd59)) + xk58 + ti59)
+ << (uint32_t)21U
+ | (va58 + (vc59 ^ (vb59 | ~vd59)) + xk58 + ti59) >> (uint32_t)11U);
+ abcd[1U] = v58;
+ uint32_t va59 = abcd[0U];
+ uint32_t vb60 = abcd[1U];
+ uint32_t vc60 = abcd[2U];
+ uint32_t vd60 = abcd[3U];
+ uint8_t *b60 = x + (uint32_t)16U;
+ uint32_t u59 = load32_le(b60);
+ uint32_t xk59 = u59;
+ uint32_t ti60 = _t[60U];
+ uint32_t
+ v59 =
+ vb60
+ +
+ ((va59 + (vc60 ^ (vb60 | ~vd60)) + xk59 + ti60)
+ << (uint32_t)6U
+ | (va59 + (vc60 ^ (vb60 | ~vd60)) + xk59 + ti60) >> (uint32_t)26U);
+ abcd[0U] = v59;
+ uint32_t va60 = abcd[3U];
+ uint32_t vb61 = abcd[0U];
+ uint32_t vc61 = abcd[1U];
+ uint32_t vd61 = abcd[2U];
+ uint8_t *b61 = x + (uint32_t)44U;
+ uint32_t u60 = load32_le(b61);
+ uint32_t xk60 = u60;
+ uint32_t ti61 = _t[61U];
+ uint32_t
+ v60 =
+ vb61
+ +
+ ((va60 + (vc61 ^ (vb61 | ~vd61)) + xk60 + ti61)
+ << (uint32_t)10U
+ | (va60 + (vc61 ^ (vb61 | ~vd61)) + xk60 + ti61) >> (uint32_t)22U);
+ abcd[3U] = v60;
+ uint32_t va61 = abcd[2U];
+ uint32_t vb62 = abcd[3U];
+ uint32_t vc62 = abcd[0U];
+ uint32_t vd62 = abcd[1U];
+ uint8_t *b62 = x + (uint32_t)8U;
+ uint32_t u61 = load32_le(b62);
+ uint32_t xk61 = u61;
+ uint32_t ti62 = _t[62U];
+ uint32_t
+ v61 =
+ vb62
+ +
+ ((va61 + (vc62 ^ (vb62 | ~vd62)) + xk61 + ti62)
+ << (uint32_t)15U
+ | (va61 + (vc62 ^ (vb62 | ~vd62)) + xk61 + ti62) >> (uint32_t)17U);
+ abcd[2U] = v61;
+ uint32_t va62 = abcd[1U];
+ uint32_t vb = abcd[2U];
+ uint32_t vc = abcd[3U];
+ uint32_t vd = abcd[0U];
+ uint8_t *b63 = x + (uint32_t)36U;
+ uint32_t u62 = load32_le(b63);
+ uint32_t xk62 = u62;
+ uint32_t ti = _t[63U];
+ uint32_t
+ v62 =
+ vb
+ +
+ ((va62 + (vc ^ (vb | ~vd)) + xk62 + ti)
+ << (uint32_t)21U
+ | (va62 + (vc ^ (vb | ~vd)) + xk62 + ti) >> (uint32_t)11U);
+ abcd[1U] = v62;
+ uint32_t a = abcd[0U];
+ uint32_t b = abcd[1U];
+ uint32_t c = abcd[2U];
+ uint32_t d = abcd[3U];
+ abcd[0U] = a + aa;
+ abcd[1U] = b + bb;
+ abcd[2U] = c + cc;
+ abcd[3U] = d + dd;
+}
+
+static void legacy_pad(uint64_t len, uint8_t *dst)
+{
+ uint8_t *dst1 = dst;
+ dst1[0U] = (uint8_t)0x80U;
+ uint8_t *dst2 = dst + (uint32_t)1U;
+ for
+ (uint32_t
+ i = (uint32_t)0U;
+ i
+ < ((uint32_t)128U - ((uint32_t)9U + (uint32_t)(len % (uint64_t)(uint32_t)64U))) % (uint32_t)64U;
+ i++)
+ {
+ dst2[i] = (uint8_t)0U;
+ }
+ uint8_t
+ *dst3 =
+ dst
+ +
+ (uint32_t)1U
+ +
+ ((uint32_t)128U - ((uint32_t)9U + (uint32_t)(len % (uint64_t)(uint32_t)64U)))
+ % (uint32_t)64U;
+ store64_le(dst3, len << (uint32_t)3U);
+}
+
+void Hacl_Hash_Core_MD5_legacy_finish(uint32_t *s, uint8_t *dst)
+{
+ KRML_MAYBE_FOR4(i,
+ (uint32_t)0U,
+ (uint32_t)4U,
+ (uint32_t)1U,
+ store32_le(dst + i * (uint32_t)4U, s[i]););
+}
+
+void Hacl_Hash_MD5_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks)
+{
+ for (uint32_t i = (uint32_t)0U; i < n_blocks; i++)
+ {
+ uint32_t sz = (uint32_t)64U;
+ uint8_t *block = blocks + sz * i;
+ legacy_update(s, block);
+ }
+}
+
+void
+Hacl_Hash_MD5_legacy_update_last(
+ uint32_t *s,
+ uint64_t prev_len,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ uint32_t blocks_n = input_len / (uint32_t)64U;
+ uint32_t blocks_len = blocks_n * (uint32_t)64U;
+ uint8_t *blocks = input;
+ uint32_t rest_len = input_len - blocks_len;
+ uint8_t *rest = input + blocks_len;
+ Hacl_Hash_MD5_legacy_update_multi(s, blocks, blocks_n);
+ uint64_t total_input_len = prev_len + (uint64_t)input_len;
+ uint32_t
+ pad_len =
+ (uint32_t)1U
+ +
+ ((uint32_t)128U - ((uint32_t)9U + (uint32_t)(total_input_len % (uint64_t)(uint32_t)64U)))
+ % (uint32_t)64U
+ + (uint32_t)8U;
+ uint32_t tmp_len = rest_len + pad_len;
+ uint8_t tmp_twoblocks[128U] = { 0U };
+ uint8_t *tmp = tmp_twoblocks;
+ uint8_t *tmp_rest = tmp;
+ uint8_t *tmp_pad = tmp + rest_len;
+ memcpy(tmp_rest, rest, rest_len * sizeof (uint8_t));
+ legacy_pad(total_input_len, tmp_pad);
+ Hacl_Hash_MD5_legacy_update_multi(s, tmp, tmp_len / (uint32_t)64U);
+}
+
+void Hacl_Hash_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ uint32_t
+ s[4U] =
+ { (uint32_t)0x67452301U, (uint32_t)0xefcdab89U, (uint32_t)0x98badcfeU, (uint32_t)0x10325476U };
+ uint32_t blocks_n0 = input_len / (uint32_t)64U;
+ uint32_t blocks_n1;
+ if (input_len % (uint32_t)64U == (uint32_t)0U && blocks_n0 > (uint32_t)0U)
+ {
+ blocks_n1 = blocks_n0 - (uint32_t)1U;
+ }
+ else
+ {
+ blocks_n1 = blocks_n0;
+ }
+ uint32_t blocks_len0 = blocks_n1 * (uint32_t)64U;
+ uint8_t *blocks0 = input;
+ uint32_t rest_len0 = input_len - blocks_len0;
+ uint8_t *rest0 = input + blocks_len0;
+ uint32_t blocks_n = blocks_n1;
+ uint32_t blocks_len = blocks_len0;
+ uint8_t *blocks = blocks0;
+ uint32_t rest_len = rest_len0;
+ uint8_t *rest = rest0;
+ Hacl_Hash_MD5_legacy_update_multi(s, blocks, blocks_n);
+ Hacl_Hash_MD5_legacy_update_last(s, (uint64_t)blocks_len, rest, rest_len);
+ Hacl_Hash_Core_MD5_legacy_finish(s, dst);
+}
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_create_in(void)
+{
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)4U, sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ Hacl_Hash_Core_MD5_legacy_init(block_state);
+ return p;
+}
+
+void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ Hacl_Hash_Core_MD5_legacy_init(block_state);
+ Hacl_Streaming_MD_state_32
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+/**
+0 = success, 1 = max length exceeded
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_MD5_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len)
+{
+ Hacl_Streaming_MD_state_32 s = *p;
+ uint64_t total_len = s.total_len;
+ if ((uint64_t)len > (uint64_t)2305843009213693951U - total_len)
+ {
+ return Hacl_Streaming_Types_MaximumLengthExceeded;
+ }
+ uint32_t sz;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ sz = (uint32_t)64U;
+ }
+ else
+ {
+ sz = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ if (len <= (uint32_t)64U - sz)
+ {
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf2 = buf + sz1;
+ memcpy(buf2, data, len * sizeof (uint8_t));
+ uint64_t total_len2 = total_len1 + (uint64_t)len;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len2
+ }
+ );
+ }
+ else if (sz == (uint32_t)0U)
+ {
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_Hash_MD5_legacy_update_multi(block_state1, buf, (uint32_t)1U);
+ }
+ uint32_t ite;
+ if ((uint64_t)len % (uint64_t)(uint32_t)64U == (uint64_t)0U && (uint64_t)len > (uint64_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)len % (uint64_t)(uint32_t)64U);
+ }
+ uint32_t n_blocks = (len - ite) / (uint32_t)64U;
+ uint32_t data1_len = n_blocks * (uint32_t)64U;
+ uint32_t data2_len = len - data1_len;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + data1_len;
+ Hacl_Hash_MD5_legacy_update_multi(block_state1, data1, data1_len / (uint32_t)64U);
+ uint8_t *dst = buf;
+ memcpy(dst, data2, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)len
+ }
+ );
+ }
+ else
+ {
+ uint32_t diff = (uint32_t)64U - sz;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + diff;
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state10 = s1.block_state;
+ uint8_t *buf0 = s1.buf;
+ uint64_t total_len10 = s1.total_len;
+ uint32_t sz10;
+ if (total_len10 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len10 > (uint64_t)0U)
+ {
+ sz10 = (uint32_t)64U;
+ }
+ else
+ {
+ sz10 = (uint32_t)(total_len10 % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf2 = buf0 + sz10;
+ memcpy(buf2, data1, diff * sizeof (uint8_t));
+ uint64_t total_len2 = total_len10 + (uint64_t)diff;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state10,
+ .buf = buf0,
+ .total_len = total_len2
+ }
+ );
+ Hacl_Streaming_MD_state_32 s10 = *p;
+ uint32_t *block_state1 = s10.block_state;
+ uint8_t *buf = s10.buf;
+ uint64_t total_len1 = s10.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_Hash_MD5_legacy_update_multi(block_state1, buf, (uint32_t)1U);
+ }
+ uint32_t ite;
+ if
+ (
+ (uint64_t)(len - diff)
+ % (uint64_t)(uint32_t)64U
+ == (uint64_t)0U
+ && (uint64_t)(len - diff) > (uint64_t)0U
+ )
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)(len - diff) % (uint64_t)(uint32_t)64U);
+ }
+ uint32_t n_blocks = (len - diff - ite) / (uint32_t)64U;
+ uint32_t data1_len = n_blocks * (uint32_t)64U;
+ uint32_t data2_len = len - diff - data1_len;
+ uint8_t *data11 = data2;
+ uint8_t *data21 = data2 + data1_len;
+ Hacl_Hash_MD5_legacy_update_multi(block_state1, data11, data1_len / (uint32_t)64U);
+ uint8_t *dst = buf;
+ memcpy(dst, data21, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)(len - diff)
+ }
+ );
+ }
+ return Hacl_Streaming_Types_Success;
+}
+
+void Hacl_Streaming_MD5_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst)
+{
+ Hacl_Streaming_MD_state_32 scrut = *p;
+ uint32_t *block_state = scrut.block_state;
+ uint8_t *buf_ = scrut.buf;
+ uint64_t total_len = scrut.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = (uint32_t)64U;
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf_1 = buf_;
+ uint32_t tmp_block_state[4U] = { 0U };
+ memcpy(tmp_block_state, block_state, (uint32_t)4U * sizeof (uint32_t));
+ uint32_t ite;
+ if (r % (uint32_t)64U == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = r % (uint32_t)64U;
+ }
+ uint8_t *buf_last = buf_1 + r - ite;
+ uint8_t *buf_multi = buf_1;
+ Hacl_Hash_MD5_legacy_update_multi(tmp_block_state, buf_multi, (uint32_t)0U);
+ uint64_t prev_len_last = total_len - (uint64_t)r;
+ Hacl_Hash_MD5_legacy_update_last(tmp_block_state, prev_len_last, buf_last, r);
+ Hacl_Hash_Core_MD5_legacy_finish(tmp_block_state, dst);
+}
+
+void Hacl_Streaming_MD5_legacy_free(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ KRML_HOST_FREE(block_state);
+ KRML_HOST_FREE(buf);
+ KRML_HOST_FREE(s);
+}
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_copy(Hacl_Streaming_MD_state_32 *s0)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s0;
+ uint32_t *block_state0 = scrut.block_state;
+ uint8_t *buf0 = scrut.buf;
+ uint64_t total_len0 = scrut.total_len;
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ memcpy(buf, buf0, (uint32_t)64U * sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)4U, sizeof (uint32_t));
+ memcpy(block_state, block_state0, (uint32_t)4U * sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = total_len0 };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ return p;
+}
+
+void Hacl_Streaming_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ Hacl_Hash_MD5_legacy_hash(input, input_len, dst);
+}
+
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h
new file mode 100644
index 00000000000..13c19fd40f4
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_MD5.h
@@ -0,0 +1,65 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __Hacl_Hash_MD5_H
+#define __Hacl_Hash_MD5_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "Hacl_Streaming_Types.h"
+
+typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_MD5_state;
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_create_in(void);
+
+void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s);
+
+/**
+0 = success, 1 = max length exceeded
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_MD5_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len);
+
+void Hacl_Streaming_MD5_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst);
+
+void Hacl_Streaming_MD5_legacy_free(Hacl_Streaming_MD_state_32 *s);
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_copy(Hacl_Streaming_MD_state_32 *s0);
+
+void Hacl_Streaming_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __Hacl_Hash_MD5_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c
new file mode 100644
index 00000000000..5ecb3c0b3a5
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.c
@@ -0,0 +1,508 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#include "internal/Hacl_Hash_SHA1.h"
+
+static uint32_t
+_h0[5U] =
+ {
+ (uint32_t)0x67452301U, (uint32_t)0xefcdab89U, (uint32_t)0x98badcfeU, (uint32_t)0x10325476U,
+ (uint32_t)0xc3d2e1f0U
+ };
+
+void Hacl_Hash_Core_SHA1_legacy_init(uint32_t *s)
+{
+ KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, s[i] = _h0[i];);
+}
+
+static void legacy_update(uint32_t *h, uint8_t *l)
+{
+ uint32_t ha = h[0U];
+ uint32_t hb = h[1U];
+ uint32_t hc = h[2U];
+ uint32_t hd = h[3U];
+ uint32_t he = h[4U];
+ uint32_t _w[80U] = { 0U };
+ for (uint32_t i = (uint32_t)0U; i < (uint32_t)80U; i++)
+ {
+ uint32_t v;
+ if (i < (uint32_t)16U)
+ {
+ uint8_t *b = l + i * (uint32_t)4U;
+ uint32_t u = load32_be(b);
+ v = u;
+ }
+ else
+ {
+ uint32_t wmit3 = _w[i - (uint32_t)3U];
+ uint32_t wmit8 = _w[i - (uint32_t)8U];
+ uint32_t wmit14 = _w[i - (uint32_t)14U];
+ uint32_t wmit16 = _w[i - (uint32_t)16U];
+ v =
+ (wmit3 ^ (wmit8 ^ (wmit14 ^ wmit16)))
+ << (uint32_t)1U
+ | (wmit3 ^ (wmit8 ^ (wmit14 ^ wmit16))) >> (uint32_t)31U;
+ }
+ _w[i] = v;
+ }
+ for (uint32_t i = (uint32_t)0U; i < (uint32_t)80U; i++)
+ {
+ uint32_t _a = h[0U];
+ uint32_t _b = h[1U];
+ uint32_t _c = h[2U];
+ uint32_t _d = h[3U];
+ uint32_t _e = h[4U];
+ uint32_t wmit = _w[i];
+ uint32_t ite0;
+ if (i < (uint32_t)20U)
+ {
+ ite0 = (_b & _c) ^ (~_b & _d);
+ }
+ else if ((uint32_t)39U < i && i < (uint32_t)60U)
+ {
+ ite0 = (_b & _c) ^ ((_b & _d) ^ (_c & _d));
+ }
+ else
+ {
+ ite0 = _b ^ (_c ^ _d);
+ }
+ uint32_t ite;
+ if (i < (uint32_t)20U)
+ {
+ ite = (uint32_t)0x5a827999U;
+ }
+ else if (i < (uint32_t)40U)
+ {
+ ite = (uint32_t)0x6ed9eba1U;
+ }
+ else if (i < (uint32_t)60U)
+ {
+ ite = (uint32_t)0x8f1bbcdcU;
+ }
+ else
+ {
+ ite = (uint32_t)0xca62c1d6U;
+ }
+ uint32_t _T = (_a << (uint32_t)5U | _a >> (uint32_t)27U) + ite0 + _e + ite + wmit;
+ h[0U] = _T;
+ h[1U] = _a;
+ h[2U] = _b << (uint32_t)30U | _b >> (uint32_t)2U;
+ h[3U] = _c;
+ h[4U] = _d;
+ }
+ for (uint32_t i = (uint32_t)0U; i < (uint32_t)80U; i++)
+ {
+ _w[i] = (uint32_t)0U;
+ }
+ uint32_t sta = h[0U];
+ uint32_t stb = h[1U];
+ uint32_t stc = h[2U];
+ uint32_t std = h[3U];
+ uint32_t ste = h[4U];
+ h[0U] = sta + ha;
+ h[1U] = stb + hb;
+ h[2U] = stc + hc;
+ h[3U] = std + hd;
+ h[4U] = ste + he;
+}
+
+static void legacy_pad(uint64_t len, uint8_t *dst)
+{
+ uint8_t *dst1 = dst;
+ dst1[0U] = (uint8_t)0x80U;
+ uint8_t *dst2 = dst + (uint32_t)1U;
+ for
+ (uint32_t
+ i = (uint32_t)0U;
+ i
+ < ((uint32_t)128U - ((uint32_t)9U + (uint32_t)(len % (uint64_t)(uint32_t)64U))) % (uint32_t)64U;
+ i++)
+ {
+ dst2[i] = (uint8_t)0U;
+ }
+ uint8_t
+ *dst3 =
+ dst
+ +
+ (uint32_t)1U
+ +
+ ((uint32_t)128U - ((uint32_t)9U + (uint32_t)(len % (uint64_t)(uint32_t)64U)))
+ % (uint32_t)64U;
+ store64_be(dst3, len << (uint32_t)3U);
+}
+
+void Hacl_Hash_Core_SHA1_legacy_finish(uint32_t *s, uint8_t *dst)
+{
+ KRML_MAYBE_FOR5(i,
+ (uint32_t)0U,
+ (uint32_t)5U,
+ (uint32_t)1U,
+ store32_be(dst + i * (uint32_t)4U, s[i]););
+}
+
+void Hacl_Hash_SHA1_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks)
+{
+ for (uint32_t i = (uint32_t)0U; i < n_blocks; i++)
+ {
+ uint32_t sz = (uint32_t)64U;
+ uint8_t *block = blocks + sz * i;
+ legacy_update(s, block);
+ }
+}
+
+void
+Hacl_Hash_SHA1_legacy_update_last(
+ uint32_t *s,
+ uint64_t prev_len,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ uint32_t blocks_n = input_len / (uint32_t)64U;
+ uint32_t blocks_len = blocks_n * (uint32_t)64U;
+ uint8_t *blocks = input;
+ uint32_t rest_len = input_len - blocks_len;
+ uint8_t *rest = input + blocks_len;
+ Hacl_Hash_SHA1_legacy_update_multi(s, blocks, blocks_n);
+ uint64_t total_input_len = prev_len + (uint64_t)input_len;
+ uint32_t
+ pad_len =
+ (uint32_t)1U
+ +
+ ((uint32_t)128U - ((uint32_t)9U + (uint32_t)(total_input_len % (uint64_t)(uint32_t)64U)))
+ % (uint32_t)64U
+ + (uint32_t)8U;
+ uint32_t tmp_len = rest_len + pad_len;
+ uint8_t tmp_twoblocks[128U] = { 0U };
+ uint8_t *tmp = tmp_twoblocks;
+ uint8_t *tmp_rest = tmp;
+ uint8_t *tmp_pad = tmp + rest_len;
+ memcpy(tmp_rest, rest, rest_len * sizeof (uint8_t));
+ legacy_pad(total_input_len, tmp_pad);
+ Hacl_Hash_SHA1_legacy_update_multi(s, tmp, tmp_len / (uint32_t)64U);
+}
+
+void Hacl_Hash_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ uint32_t
+ s[5U] =
+ {
+ (uint32_t)0x67452301U, (uint32_t)0xefcdab89U, (uint32_t)0x98badcfeU, (uint32_t)0x10325476U,
+ (uint32_t)0xc3d2e1f0U
+ };
+ uint32_t blocks_n0 = input_len / (uint32_t)64U;
+ uint32_t blocks_n1;
+ if (input_len % (uint32_t)64U == (uint32_t)0U && blocks_n0 > (uint32_t)0U)
+ {
+ blocks_n1 = blocks_n0 - (uint32_t)1U;
+ }
+ else
+ {
+ blocks_n1 = blocks_n0;
+ }
+ uint32_t blocks_len0 = blocks_n1 * (uint32_t)64U;
+ uint8_t *blocks0 = input;
+ uint32_t rest_len0 = input_len - blocks_len0;
+ uint8_t *rest0 = input + blocks_len0;
+ uint32_t blocks_n = blocks_n1;
+ uint32_t blocks_len = blocks_len0;
+ uint8_t *blocks = blocks0;
+ uint32_t rest_len = rest_len0;
+ uint8_t *rest = rest0;
+ Hacl_Hash_SHA1_legacy_update_multi(s, blocks, blocks_n);
+ Hacl_Hash_SHA1_legacy_update_last(s, (uint64_t)blocks_len, rest, rest_len);
+ Hacl_Hash_Core_SHA1_legacy_finish(s, dst);
+}
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_create_in(void)
+{
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)5U, sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ Hacl_Hash_Core_SHA1_legacy_init(block_state);
+ return p;
+}
+
+void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ Hacl_Hash_Core_SHA1_legacy_init(block_state);
+ Hacl_Streaming_MD_state_32
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+/**
+0 = success, 1 = max length exceeded
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA1_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len)
+{
+ Hacl_Streaming_MD_state_32 s = *p;
+ uint64_t total_len = s.total_len;
+ if ((uint64_t)len > (uint64_t)2305843009213693951U - total_len)
+ {
+ return Hacl_Streaming_Types_MaximumLengthExceeded;
+ }
+ uint32_t sz;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ sz = (uint32_t)64U;
+ }
+ else
+ {
+ sz = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ if (len <= (uint32_t)64U - sz)
+ {
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf2 = buf + sz1;
+ memcpy(buf2, data, len * sizeof (uint8_t));
+ uint64_t total_len2 = total_len1 + (uint64_t)len;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len2
+ }
+ );
+ }
+ else if (sz == (uint32_t)0U)
+ {
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_Hash_SHA1_legacy_update_multi(block_state1, buf, (uint32_t)1U);
+ }
+ uint32_t ite;
+ if ((uint64_t)len % (uint64_t)(uint32_t)64U == (uint64_t)0U && (uint64_t)len > (uint64_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)len % (uint64_t)(uint32_t)64U);
+ }
+ uint32_t n_blocks = (len - ite) / (uint32_t)64U;
+ uint32_t data1_len = n_blocks * (uint32_t)64U;
+ uint32_t data2_len = len - data1_len;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + data1_len;
+ Hacl_Hash_SHA1_legacy_update_multi(block_state1, data1, data1_len / (uint32_t)64U);
+ uint8_t *dst = buf;
+ memcpy(dst, data2, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)len
+ }
+ );
+ }
+ else
+ {
+ uint32_t diff = (uint32_t)64U - sz;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + diff;
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state10 = s1.block_state;
+ uint8_t *buf0 = s1.buf;
+ uint64_t total_len10 = s1.total_len;
+ uint32_t sz10;
+ if (total_len10 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len10 > (uint64_t)0U)
+ {
+ sz10 = (uint32_t)64U;
+ }
+ else
+ {
+ sz10 = (uint32_t)(total_len10 % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf2 = buf0 + sz10;
+ memcpy(buf2, data1, diff * sizeof (uint8_t));
+ uint64_t total_len2 = total_len10 + (uint64_t)diff;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state10,
+ .buf = buf0,
+ .total_len = total_len2
+ }
+ );
+ Hacl_Streaming_MD_state_32 s10 = *p;
+ uint32_t *block_state1 = s10.block_state;
+ uint8_t *buf = s10.buf;
+ uint64_t total_len1 = s10.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_Hash_SHA1_legacy_update_multi(block_state1, buf, (uint32_t)1U);
+ }
+ uint32_t ite;
+ if
+ (
+ (uint64_t)(len - diff)
+ % (uint64_t)(uint32_t)64U
+ == (uint64_t)0U
+ && (uint64_t)(len - diff) > (uint64_t)0U
+ )
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)(len - diff) % (uint64_t)(uint32_t)64U);
+ }
+ uint32_t n_blocks = (len - diff - ite) / (uint32_t)64U;
+ uint32_t data1_len = n_blocks * (uint32_t)64U;
+ uint32_t data2_len = len - diff - data1_len;
+ uint8_t *data11 = data2;
+ uint8_t *data21 = data2 + data1_len;
+ Hacl_Hash_SHA1_legacy_update_multi(block_state1, data11, data1_len / (uint32_t)64U);
+ uint8_t *dst = buf;
+ memcpy(dst, data21, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)(len - diff)
+ }
+ );
+ }
+ return Hacl_Streaming_Types_Success;
+}
+
+void Hacl_Streaming_SHA1_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst)
+{
+ Hacl_Streaming_MD_state_32 scrut = *p;
+ uint32_t *block_state = scrut.block_state;
+ uint8_t *buf_ = scrut.buf;
+ uint64_t total_len = scrut.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = (uint32_t)64U;
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf_1 = buf_;
+ uint32_t tmp_block_state[5U] = { 0U };
+ memcpy(tmp_block_state, block_state, (uint32_t)5U * sizeof (uint32_t));
+ uint32_t ite;
+ if (r % (uint32_t)64U == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = r % (uint32_t)64U;
+ }
+ uint8_t *buf_last = buf_1 + r - ite;
+ uint8_t *buf_multi = buf_1;
+ Hacl_Hash_SHA1_legacy_update_multi(tmp_block_state, buf_multi, (uint32_t)0U);
+ uint64_t prev_len_last = total_len - (uint64_t)r;
+ Hacl_Hash_SHA1_legacy_update_last(tmp_block_state, prev_len_last, buf_last, r);
+ Hacl_Hash_Core_SHA1_legacy_finish(tmp_block_state, dst);
+}
+
+void Hacl_Streaming_SHA1_legacy_free(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ KRML_HOST_FREE(block_state);
+ KRML_HOST_FREE(buf);
+ KRML_HOST_FREE(s);
+}
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_copy(Hacl_Streaming_MD_state_32 *s0)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s0;
+ uint32_t *block_state0 = scrut.block_state;
+ uint8_t *buf0 = scrut.buf;
+ uint64_t total_len0 = scrut.total_len;
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ memcpy(buf, buf0, (uint32_t)64U * sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)5U, sizeof (uint32_t));
+ memcpy(block_state, block_state0, (uint32_t)5U * sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = total_len0 };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ return p;
+}
+
+void Hacl_Streaming_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ Hacl_Hash_SHA1_legacy_hash(input, input_len, dst);
+}
+
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h
new file mode 100644
index 00000000000..dc50aa6f6d3
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA1.h
@@ -0,0 +1,65 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __Hacl_Hash_SHA1_H
+#define __Hacl_Hash_SHA1_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "Hacl_Streaming_Types.h"
+
+typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA1_state;
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_create_in(void);
+
+void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s);
+
+/**
+0 = success, 1 = max length exceeded
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA1_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len);
+
+void Hacl_Streaming_SHA1_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst);
+
+void Hacl_Streaming_SHA1_legacy_free(Hacl_Streaming_MD_state_32 *s);
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_copy(Hacl_Streaming_MD_state_32 *s0);
+
+void Hacl_Streaming_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __Hacl_Hash_SHA1_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c
new file mode 100644
index 00000000000..08e3f7edbf4
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.c
@@ -0,0 +1,1345 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#include "internal/Hacl_Hash_SHA2.h"
+
+
+
+void Hacl_SHA2_Scalar32_sha256_init(uint32_t *hash)
+{
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ uint32_t *os = hash;
+ uint32_t x = Hacl_Impl_SHA2_Generic_h256[i];
+ os[i] = x;);
+}
+
+static inline void sha256_update(uint8_t *b, uint32_t *hash)
+{
+ uint32_t hash_old[8U] = { 0U };
+ uint32_t ws[16U] = { 0U };
+ memcpy(hash_old, hash, (uint32_t)8U * sizeof (uint32_t));
+ uint8_t *b10 = b;
+ uint32_t u = load32_be(b10);
+ ws[0U] = u;
+ uint32_t u0 = load32_be(b10 + (uint32_t)4U);
+ ws[1U] = u0;
+ uint32_t u1 = load32_be(b10 + (uint32_t)8U);
+ ws[2U] = u1;
+ uint32_t u2 = load32_be(b10 + (uint32_t)12U);
+ ws[3U] = u2;
+ uint32_t u3 = load32_be(b10 + (uint32_t)16U);
+ ws[4U] = u3;
+ uint32_t u4 = load32_be(b10 + (uint32_t)20U);
+ ws[5U] = u4;
+ uint32_t u5 = load32_be(b10 + (uint32_t)24U);
+ ws[6U] = u5;
+ uint32_t u6 = load32_be(b10 + (uint32_t)28U);
+ ws[7U] = u6;
+ uint32_t u7 = load32_be(b10 + (uint32_t)32U);
+ ws[8U] = u7;
+ uint32_t u8 = load32_be(b10 + (uint32_t)36U);
+ ws[9U] = u8;
+ uint32_t u9 = load32_be(b10 + (uint32_t)40U);
+ ws[10U] = u9;
+ uint32_t u10 = load32_be(b10 + (uint32_t)44U);
+ ws[11U] = u10;
+ uint32_t u11 = load32_be(b10 + (uint32_t)48U);
+ ws[12U] = u11;
+ uint32_t u12 = load32_be(b10 + (uint32_t)52U);
+ ws[13U] = u12;
+ uint32_t u13 = load32_be(b10 + (uint32_t)56U);
+ ws[14U] = u13;
+ uint32_t u14 = load32_be(b10 + (uint32_t)60U);
+ ws[15U] = u14;
+ KRML_MAYBE_FOR4(i0,
+ (uint32_t)0U,
+ (uint32_t)4U,
+ (uint32_t)1U,
+ KRML_MAYBE_FOR16(i,
+ (uint32_t)0U,
+ (uint32_t)16U,
+ (uint32_t)1U,
+ uint32_t k_t = Hacl_Impl_SHA2_Generic_k224_256[(uint32_t)16U * i0 + i];
+ uint32_t ws_t = ws[i];
+ uint32_t a0 = hash[0U];
+ uint32_t b0 = hash[1U];
+ uint32_t c0 = hash[2U];
+ uint32_t d0 = hash[3U];
+ uint32_t e0 = hash[4U];
+ uint32_t f0 = hash[5U];
+ uint32_t g0 = hash[6U];
+ uint32_t h02 = hash[7U];
+ uint32_t k_e_t = k_t;
+ uint32_t
+ t1 =
+ h02
+ +
+ ((e0 << (uint32_t)26U | e0 >> (uint32_t)6U)
+ ^
+ ((e0 << (uint32_t)21U | e0 >> (uint32_t)11U)
+ ^ (e0 << (uint32_t)7U | e0 >> (uint32_t)25U)))
+ + ((e0 & f0) ^ (~e0 & g0))
+ + k_e_t
+ + ws_t;
+ uint32_t
+ t2 =
+ ((a0 << (uint32_t)30U | a0 >> (uint32_t)2U)
+ ^
+ ((a0 << (uint32_t)19U | a0 >> (uint32_t)13U)
+ ^ (a0 << (uint32_t)10U | a0 >> (uint32_t)22U)))
+ + ((a0 & b0) ^ ((a0 & c0) ^ (b0 & c0)));
+ uint32_t a1 = t1 + t2;
+ uint32_t b1 = a0;
+ uint32_t c1 = b0;
+ uint32_t d1 = c0;
+ uint32_t e1 = d0 + t1;
+ uint32_t f1 = e0;
+ uint32_t g1 = f0;
+ uint32_t h12 = g0;
+ hash[0U] = a1;
+ hash[1U] = b1;
+ hash[2U] = c1;
+ hash[3U] = d1;
+ hash[4U] = e1;
+ hash[5U] = f1;
+ hash[6U] = g1;
+ hash[7U] = h12;);
+ if (i0 < (uint32_t)3U)
+ {
+ KRML_MAYBE_FOR16(i,
+ (uint32_t)0U,
+ (uint32_t)16U,
+ (uint32_t)1U,
+ uint32_t t16 = ws[i];
+ uint32_t t15 = ws[(i + (uint32_t)1U) % (uint32_t)16U];
+ uint32_t t7 = ws[(i + (uint32_t)9U) % (uint32_t)16U];
+ uint32_t t2 = ws[(i + (uint32_t)14U) % (uint32_t)16U];
+ uint32_t
+ s1 =
+ (t2 << (uint32_t)15U | t2 >> (uint32_t)17U)
+ ^ ((t2 << (uint32_t)13U | t2 >> (uint32_t)19U) ^ t2 >> (uint32_t)10U);
+ uint32_t
+ s0 =
+ (t15 << (uint32_t)25U | t15 >> (uint32_t)7U)
+ ^ ((t15 << (uint32_t)14U | t15 >> (uint32_t)18U) ^ t15 >> (uint32_t)3U);
+ ws[i] = s1 + t7 + s0 + t16;);
+ });
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ uint32_t *os = hash;
+ uint32_t x = hash[i] + hash_old[i];
+ os[i] = x;);
+}
+
+void Hacl_SHA2_Scalar32_sha256_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st)
+{
+ uint32_t blocks = len / (uint32_t)64U;
+ for (uint32_t i = (uint32_t)0U; i < blocks; i++)
+ {
+ uint8_t *b0 = b;
+ uint8_t *mb = b0 + i * (uint32_t)64U;
+ sha256_update(mb, st);
+ }
+}
+
+void
+Hacl_SHA2_Scalar32_sha256_update_last(
+ uint64_t totlen,
+ uint32_t len,
+ uint8_t *b,
+ uint32_t *hash
+)
+{
+ uint32_t blocks;
+ if (len + (uint32_t)8U + (uint32_t)1U <= (uint32_t)64U)
+ {
+ blocks = (uint32_t)1U;
+ }
+ else
+ {
+ blocks = (uint32_t)2U;
+ }
+ uint32_t fin = blocks * (uint32_t)64U;
+ uint8_t last[128U] = { 0U };
+ uint8_t totlen_buf[8U] = { 0U };
+ uint64_t total_len_bits = totlen << (uint32_t)3U;
+ store64_be(totlen_buf, total_len_bits);
+ uint8_t *b0 = b;
+ memcpy(last, b0, len * sizeof (uint8_t));
+ last[len] = (uint8_t)0x80U;
+ memcpy(last + fin - (uint32_t)8U, totlen_buf, (uint32_t)8U * sizeof (uint8_t));
+ uint8_t *last00 = last;
+ uint8_t *last10 = last + (uint32_t)64U;
+ uint8_t *l0 = last00;
+ uint8_t *l1 = last10;
+ uint8_t *lb0 = l0;
+ uint8_t *lb1 = l1;
+ uint8_t *last0 = lb0;
+ uint8_t *last1 = lb1;
+ sha256_update(last0, hash);
+ if (blocks > (uint32_t)1U)
+ {
+ sha256_update(last1, hash);
+ return;
+ }
+}
+
+void Hacl_SHA2_Scalar32_sha256_finish(uint32_t *st, uint8_t *h)
+{
+ uint8_t hbuf[32U] = { 0U };
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ store32_be(hbuf + i * (uint32_t)4U, st[i]););
+ memcpy(h, hbuf, (uint32_t)32U * sizeof (uint8_t));
+}
+
+void Hacl_SHA2_Scalar32_sha224_init(uint32_t *hash)
+{
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ uint32_t *os = hash;
+ uint32_t x = Hacl_Impl_SHA2_Generic_h224[i];
+ os[i] = x;);
+}
+
+static inline void sha224_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st)
+{
+ Hacl_SHA2_Scalar32_sha256_update_nblocks(len, b, st);
+}
+
+void
+Hacl_SHA2_Scalar32_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st)
+{
+ Hacl_SHA2_Scalar32_sha256_update_last(totlen, len, b, st);
+}
+
+void Hacl_SHA2_Scalar32_sha224_finish(uint32_t *st, uint8_t *h)
+{
+ uint8_t hbuf[32U] = { 0U };
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ store32_be(hbuf + i * (uint32_t)4U, st[i]););
+ memcpy(h, hbuf, (uint32_t)28U * sizeof (uint8_t));
+}
+
+void Hacl_SHA2_Scalar32_sha512_init(uint64_t *hash)
+{
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ uint64_t *os = hash;
+ uint64_t x = Hacl_Impl_SHA2_Generic_h512[i];
+ os[i] = x;);
+}
+
+static inline void sha512_update(uint8_t *b, uint64_t *hash)
+{
+ uint64_t hash_old[8U] = { 0U };
+ uint64_t ws[16U] = { 0U };
+ memcpy(hash_old, hash, (uint32_t)8U * sizeof (uint64_t));
+ uint8_t *b10 = b;
+ uint64_t u = load64_be(b10);
+ ws[0U] = u;
+ uint64_t u0 = load64_be(b10 + (uint32_t)8U);
+ ws[1U] = u0;
+ uint64_t u1 = load64_be(b10 + (uint32_t)16U);
+ ws[2U] = u1;
+ uint64_t u2 = load64_be(b10 + (uint32_t)24U);
+ ws[3U] = u2;
+ uint64_t u3 = load64_be(b10 + (uint32_t)32U);
+ ws[4U] = u3;
+ uint64_t u4 = load64_be(b10 + (uint32_t)40U);
+ ws[5U] = u4;
+ uint64_t u5 = load64_be(b10 + (uint32_t)48U);
+ ws[6U] = u5;
+ uint64_t u6 = load64_be(b10 + (uint32_t)56U);
+ ws[7U] = u6;
+ uint64_t u7 = load64_be(b10 + (uint32_t)64U);
+ ws[8U] = u7;
+ uint64_t u8 = load64_be(b10 + (uint32_t)72U);
+ ws[9U] = u8;
+ uint64_t u9 = load64_be(b10 + (uint32_t)80U);
+ ws[10U] = u9;
+ uint64_t u10 = load64_be(b10 + (uint32_t)88U);
+ ws[11U] = u10;
+ uint64_t u11 = load64_be(b10 + (uint32_t)96U);
+ ws[12U] = u11;
+ uint64_t u12 = load64_be(b10 + (uint32_t)104U);
+ ws[13U] = u12;
+ uint64_t u13 = load64_be(b10 + (uint32_t)112U);
+ ws[14U] = u13;
+ uint64_t u14 = load64_be(b10 + (uint32_t)120U);
+ ws[15U] = u14;
+ KRML_MAYBE_FOR5(i0,
+ (uint32_t)0U,
+ (uint32_t)5U,
+ (uint32_t)1U,
+ KRML_MAYBE_FOR16(i,
+ (uint32_t)0U,
+ (uint32_t)16U,
+ (uint32_t)1U,
+ uint64_t k_t = Hacl_Impl_SHA2_Generic_k384_512[(uint32_t)16U * i0 + i];
+ uint64_t ws_t = ws[i];
+ uint64_t a0 = hash[0U];
+ uint64_t b0 = hash[1U];
+ uint64_t c0 = hash[2U];
+ uint64_t d0 = hash[3U];
+ uint64_t e0 = hash[4U];
+ uint64_t f0 = hash[5U];
+ uint64_t g0 = hash[6U];
+ uint64_t h02 = hash[7U];
+ uint64_t k_e_t = k_t;
+ uint64_t
+ t1 =
+ h02
+ +
+ ((e0 << (uint32_t)50U | e0 >> (uint32_t)14U)
+ ^
+ ((e0 << (uint32_t)46U | e0 >> (uint32_t)18U)
+ ^ (e0 << (uint32_t)23U | e0 >> (uint32_t)41U)))
+ + ((e0 & f0) ^ (~e0 & g0))
+ + k_e_t
+ + ws_t;
+ uint64_t
+ t2 =
+ ((a0 << (uint32_t)36U | a0 >> (uint32_t)28U)
+ ^
+ ((a0 << (uint32_t)30U | a0 >> (uint32_t)34U)
+ ^ (a0 << (uint32_t)25U | a0 >> (uint32_t)39U)))
+ + ((a0 & b0) ^ ((a0 & c0) ^ (b0 & c0)));
+ uint64_t a1 = t1 + t2;
+ uint64_t b1 = a0;
+ uint64_t c1 = b0;
+ uint64_t d1 = c0;
+ uint64_t e1 = d0 + t1;
+ uint64_t f1 = e0;
+ uint64_t g1 = f0;
+ uint64_t h12 = g0;
+ hash[0U] = a1;
+ hash[1U] = b1;
+ hash[2U] = c1;
+ hash[3U] = d1;
+ hash[4U] = e1;
+ hash[5U] = f1;
+ hash[6U] = g1;
+ hash[7U] = h12;);
+ if (i0 < (uint32_t)4U)
+ {
+ KRML_MAYBE_FOR16(i,
+ (uint32_t)0U,
+ (uint32_t)16U,
+ (uint32_t)1U,
+ uint64_t t16 = ws[i];
+ uint64_t t15 = ws[(i + (uint32_t)1U) % (uint32_t)16U];
+ uint64_t t7 = ws[(i + (uint32_t)9U) % (uint32_t)16U];
+ uint64_t t2 = ws[(i + (uint32_t)14U) % (uint32_t)16U];
+ uint64_t
+ s1 =
+ (t2 << (uint32_t)45U | t2 >> (uint32_t)19U)
+ ^ ((t2 << (uint32_t)3U | t2 >> (uint32_t)61U) ^ t2 >> (uint32_t)6U);
+ uint64_t
+ s0 =
+ (t15 << (uint32_t)63U | t15 >> (uint32_t)1U)
+ ^ ((t15 << (uint32_t)56U | t15 >> (uint32_t)8U) ^ t15 >> (uint32_t)7U);
+ ws[i] = s1 + t7 + s0 + t16;);
+ });
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ uint64_t *os = hash;
+ uint64_t x = hash[i] + hash_old[i];
+ os[i] = x;);
+}
+
+void Hacl_SHA2_Scalar32_sha512_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st)
+{
+ uint32_t blocks = len / (uint32_t)128U;
+ for (uint32_t i = (uint32_t)0U; i < blocks; i++)
+ {
+ uint8_t *b0 = b;
+ uint8_t *mb = b0 + i * (uint32_t)128U;
+ sha512_update(mb, st);
+ }
+}
+
+void
+Hacl_SHA2_Scalar32_sha512_update_last(
+ FStar_UInt128_uint128 totlen,
+ uint32_t len,
+ uint8_t *b,
+ uint64_t *hash
+)
+{
+ uint32_t blocks;
+ if (len + (uint32_t)16U + (uint32_t)1U <= (uint32_t)128U)
+ {
+ blocks = (uint32_t)1U;
+ }
+ else
+ {
+ blocks = (uint32_t)2U;
+ }
+ uint32_t fin = blocks * (uint32_t)128U;
+ uint8_t last[256U] = { 0U };
+ uint8_t totlen_buf[16U] = { 0U };
+ FStar_UInt128_uint128 total_len_bits = FStar_UInt128_shift_left(totlen, (uint32_t)3U);
+ store128_be(totlen_buf, total_len_bits);
+ uint8_t *b0 = b;
+ memcpy(last, b0, len * sizeof (uint8_t));
+ last[len] = (uint8_t)0x80U;
+ memcpy(last + fin - (uint32_t)16U, totlen_buf, (uint32_t)16U * sizeof (uint8_t));
+ uint8_t *last00 = last;
+ uint8_t *last10 = last + (uint32_t)128U;
+ uint8_t *l0 = last00;
+ uint8_t *l1 = last10;
+ uint8_t *lb0 = l0;
+ uint8_t *lb1 = l1;
+ uint8_t *last0 = lb0;
+ uint8_t *last1 = lb1;
+ sha512_update(last0, hash);
+ if (blocks > (uint32_t)1U)
+ {
+ sha512_update(last1, hash);
+ return;
+ }
+}
+
+void Hacl_SHA2_Scalar32_sha512_finish(uint64_t *st, uint8_t *h)
+{
+ uint8_t hbuf[64U] = { 0U };
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ store64_be(hbuf + i * (uint32_t)8U, st[i]););
+ memcpy(h, hbuf, (uint32_t)64U * sizeof (uint8_t));
+}
+
+void Hacl_SHA2_Scalar32_sha384_init(uint64_t *hash)
+{
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ uint64_t *os = hash;
+ uint64_t x = Hacl_Impl_SHA2_Generic_h384[i];
+ os[i] = x;);
+}
+
+void Hacl_SHA2_Scalar32_sha384_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st)
+{
+ Hacl_SHA2_Scalar32_sha512_update_nblocks(len, b, st);
+}
+
+void
+Hacl_SHA2_Scalar32_sha384_update_last(
+ FStar_UInt128_uint128 totlen,
+ uint32_t len,
+ uint8_t *b,
+ uint64_t *st
+)
+{
+ Hacl_SHA2_Scalar32_sha512_update_last(totlen, len, b, st);
+}
+
+void Hacl_SHA2_Scalar32_sha384_finish(uint64_t *st, uint8_t *h)
+{
+ uint8_t hbuf[64U] = { 0U };
+ KRML_MAYBE_FOR8(i,
+ (uint32_t)0U,
+ (uint32_t)8U,
+ (uint32_t)1U,
+ store64_be(hbuf + i * (uint32_t)8U, st[i]););
+ memcpy(h, hbuf, (uint32_t)48U * sizeof (uint8_t));
+}
+
+/**
+Allocate initial state for the SHA2_256 hash. The state is to be freed by
+calling `free_256`.
+*/
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_256(void)
+{
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)8U, sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ Hacl_SHA2_Scalar32_sha256_init(block_state);
+ return p;
+}
+
+/**
+Copies the state passed as argument into a newly allocated state (deep copy).
+The state is to be freed by calling `free_256`. Cloning the state this way is
+useful, for instance, if your control-flow diverges and you need to feed
+more (different) data into the hash in each branch.
+*/
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_copy_256(Hacl_Streaming_MD_state_32 *s0)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s0;
+ uint32_t *block_state0 = scrut.block_state;
+ uint8_t *buf0 = scrut.buf;
+ uint64_t total_len0 = scrut.total_len;
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ memcpy(buf, buf0, (uint32_t)64U * sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)8U, sizeof (uint32_t));
+ memcpy(block_state, block_state0, (uint32_t)8U * sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = total_len0 };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ return p;
+}
+
+/**
+Reset an existing state to the initial hash state with empty data.
+*/
+void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ Hacl_SHA2_Scalar32_sha256_init(block_state);
+ Hacl_Streaming_MD_state_32
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+static inline Hacl_Streaming_Types_error_code
+update_224_256(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len)
+{
+ Hacl_Streaming_MD_state_32 s = *p;
+ uint64_t total_len = s.total_len;
+ if ((uint64_t)len > (uint64_t)2305843009213693951U - total_len)
+ {
+ return Hacl_Streaming_Types_MaximumLengthExceeded;
+ }
+ uint32_t sz;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ sz = (uint32_t)64U;
+ }
+ else
+ {
+ sz = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ if (len <= (uint32_t)64U - sz)
+ {
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf2 = buf + sz1;
+ memcpy(buf2, data, len * sizeof (uint8_t));
+ uint64_t total_len2 = total_len1 + (uint64_t)len;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len2
+ }
+ );
+ }
+ else if (sz == (uint32_t)0U)
+ {
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_SHA2_Scalar32_sha256_update_nblocks((uint32_t)64U, buf, block_state1);
+ }
+ uint32_t ite;
+ if ((uint64_t)len % (uint64_t)(uint32_t)64U == (uint64_t)0U && (uint64_t)len > (uint64_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)len % (uint64_t)(uint32_t)64U);
+ }
+ uint32_t n_blocks = (len - ite) / (uint32_t)64U;
+ uint32_t data1_len = n_blocks * (uint32_t)64U;
+ uint32_t data2_len = len - data1_len;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + data1_len;
+ Hacl_SHA2_Scalar32_sha256_update_nblocks(data1_len / (uint32_t)64U * (uint32_t)64U,
+ data1,
+ block_state1);
+ uint8_t *dst = buf;
+ memcpy(dst, data2, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)len
+ }
+ );
+ }
+ else
+ {
+ uint32_t diff = (uint32_t)64U - sz;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + diff;
+ Hacl_Streaming_MD_state_32 s1 = *p;
+ uint32_t *block_state10 = s1.block_state;
+ uint8_t *buf0 = s1.buf;
+ uint64_t total_len10 = s1.total_len;
+ uint32_t sz10;
+ if (total_len10 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len10 > (uint64_t)0U)
+ {
+ sz10 = (uint32_t)64U;
+ }
+ else
+ {
+ sz10 = (uint32_t)(total_len10 % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf2 = buf0 + sz10;
+ memcpy(buf2, data1, diff * sizeof (uint8_t));
+ uint64_t total_len2 = total_len10 + (uint64_t)diff;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state10,
+ .buf = buf0,
+ .total_len = total_len2
+ }
+ );
+ Hacl_Streaming_MD_state_32 s10 = *p;
+ uint32_t *block_state1 = s10.block_state;
+ uint8_t *buf = s10.buf;
+ uint64_t total_len1 = s10.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)64U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)64U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_SHA2_Scalar32_sha256_update_nblocks((uint32_t)64U, buf, block_state1);
+ }
+ uint32_t ite;
+ if
+ (
+ (uint64_t)(len - diff)
+ % (uint64_t)(uint32_t)64U
+ == (uint64_t)0U
+ && (uint64_t)(len - diff) > (uint64_t)0U
+ )
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)(len - diff) % (uint64_t)(uint32_t)64U);
+ }
+ uint32_t n_blocks = (len - diff - ite) / (uint32_t)64U;
+ uint32_t data1_len = n_blocks * (uint32_t)64U;
+ uint32_t data2_len = len - diff - data1_len;
+ uint8_t *data11 = data2;
+ uint8_t *data21 = data2 + data1_len;
+ Hacl_SHA2_Scalar32_sha256_update_nblocks(data1_len / (uint32_t)64U * (uint32_t)64U,
+ data11,
+ block_state1);
+ uint8_t *dst = buf;
+ memcpy(dst, data21, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_32){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)(len - diff)
+ }
+ );
+ }
+ return Hacl_Streaming_Types_Success;
+}
+
+/**
+Feed an arbitrary amount of data into the hash. This function returns 0 for
+success, or 1 if the combined length of all of the data passed to `update_256`
+(since the last call to `init_256`) exceeds 2^61-1 bytes.
+
+This function is identical to the update function for SHA2_224.
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_256(
+ Hacl_Streaming_MD_state_32 *p,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ return update_224_256(p, input, input_len);
+}
+
+/**
+Write the resulting hash into `dst`, an array of 32 bytes. The state remains
+valid after a call to `finish_256`, meaning the user may feed more data into
+the hash via `update_256`. (The finish_256 function operates on an internal copy of
+the state and therefore does not invalidate the client-held state `p`.)
+*/
+void Hacl_Streaming_SHA2_finish_256(Hacl_Streaming_MD_state_32 *p, uint8_t *dst)
+{
+ Hacl_Streaming_MD_state_32 scrut = *p;
+ uint32_t *block_state = scrut.block_state;
+ uint8_t *buf_ = scrut.buf;
+ uint64_t total_len = scrut.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = (uint32_t)64U;
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf_1 = buf_;
+ uint32_t tmp_block_state[8U] = { 0U };
+ memcpy(tmp_block_state, block_state, (uint32_t)8U * sizeof (uint32_t));
+ uint32_t ite;
+ if (r % (uint32_t)64U == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = r % (uint32_t)64U;
+ }
+ uint8_t *buf_last = buf_1 + r - ite;
+ uint8_t *buf_multi = buf_1;
+ Hacl_SHA2_Scalar32_sha256_update_nblocks((uint32_t)0U, buf_multi, tmp_block_state);
+ uint64_t prev_len_last = total_len - (uint64_t)r;
+ Hacl_SHA2_Scalar32_sha256_update_last(prev_len_last + (uint64_t)r,
+ r,
+ buf_last,
+ tmp_block_state);
+ Hacl_SHA2_Scalar32_sha256_finish(tmp_block_state, dst);
+}
+
+/**
+Free a state allocated with `create_in_256`.
+
+This function is identical to the free function for SHA2_224.
+*/
+void Hacl_Streaming_SHA2_free_256(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ KRML_HOST_FREE(block_state);
+ KRML_HOST_FREE(buf);
+ KRML_HOST_FREE(s);
+}
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 32 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_256(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ uint8_t *ib = input;
+ uint8_t *rb = dst;
+ uint32_t st[8U] = { 0U };
+ Hacl_SHA2_Scalar32_sha256_init(st);
+ uint32_t rem = input_len % (uint32_t)64U;
+ uint64_t len_ = (uint64_t)input_len;
+ Hacl_SHA2_Scalar32_sha256_update_nblocks(input_len, ib, st);
+ uint32_t rem1 = input_len % (uint32_t)64U;
+ uint8_t *b0 = ib;
+ uint8_t *lb = b0 + input_len - rem1;
+ Hacl_SHA2_Scalar32_sha256_update_last(len_, rem, lb, st);
+ Hacl_SHA2_Scalar32_sha256_finish(st, rb);
+}
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_224(void)
+{
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)64U, sizeof (uint8_t));
+ uint32_t *block_state = (uint32_t *)KRML_HOST_CALLOC((uint32_t)8U, sizeof (uint32_t));
+ Hacl_Streaming_MD_state_32
+ s = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_MD_state_32
+ *p = (Hacl_Streaming_MD_state_32 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_32));
+ p[0U] = s;
+ Hacl_SHA2_Scalar32_sha224_init(block_state);
+ return p;
+}
+
+void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s)
+{
+ Hacl_Streaming_MD_state_32 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint32_t *block_state = scrut.block_state;
+ Hacl_SHA2_Scalar32_sha224_init(block_state);
+ Hacl_Streaming_MD_state_32
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_224(
+ Hacl_Streaming_MD_state_32 *p,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ return update_224_256(p, input, input_len);
+}
+
+/**
+Write the resulting hash into `dst`, an array of 28 bytes. The state remains
+valid after a call to `finish_224`, meaning the user may feed more data into
+the hash via `update_224`.
+*/
+void Hacl_Streaming_SHA2_finish_224(Hacl_Streaming_MD_state_32 *p, uint8_t *dst)
+{
+ Hacl_Streaming_MD_state_32 scrut = *p;
+ uint32_t *block_state = scrut.block_state;
+ uint8_t *buf_ = scrut.buf;
+ uint64_t total_len = scrut.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)(uint32_t)64U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = (uint32_t)64U;
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)(uint32_t)64U);
+ }
+ uint8_t *buf_1 = buf_;
+ uint32_t tmp_block_state[8U] = { 0U };
+ memcpy(tmp_block_state, block_state, (uint32_t)8U * sizeof (uint32_t));
+ uint32_t ite;
+ if (r % (uint32_t)64U == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite = (uint32_t)64U;
+ }
+ else
+ {
+ ite = r % (uint32_t)64U;
+ }
+ uint8_t *buf_last = buf_1 + r - ite;
+ uint8_t *buf_multi = buf_1;
+ sha224_update_nblocks((uint32_t)0U, buf_multi, tmp_block_state);
+ uint64_t prev_len_last = total_len - (uint64_t)r;
+ Hacl_SHA2_Scalar32_sha224_update_last(prev_len_last + (uint64_t)r,
+ r,
+ buf_last,
+ tmp_block_state);
+ Hacl_SHA2_Scalar32_sha224_finish(tmp_block_state, dst);
+}
+
+void Hacl_Streaming_SHA2_free_224(Hacl_Streaming_MD_state_32 *p)
+{
+ Hacl_Streaming_SHA2_free_256(p);
+}
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 28 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_224(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ uint8_t *ib = input;
+ uint8_t *rb = dst;
+ uint32_t st[8U] = { 0U };
+ Hacl_SHA2_Scalar32_sha224_init(st);
+ uint32_t rem = input_len % (uint32_t)64U;
+ uint64_t len_ = (uint64_t)input_len;
+ sha224_update_nblocks(input_len, ib, st);
+ uint32_t rem1 = input_len % (uint32_t)64U;
+ uint8_t *b0 = ib;
+ uint8_t *lb = b0 + input_len - rem1;
+ Hacl_SHA2_Scalar32_sha224_update_last(len_, rem, lb, st);
+ Hacl_SHA2_Scalar32_sha224_finish(st, rb);
+}
+
+Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_512(void)
+{
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)128U, sizeof (uint8_t));
+ uint64_t *block_state = (uint64_t *)KRML_HOST_CALLOC((uint32_t)8U, sizeof (uint64_t));
+ Hacl_Streaming_MD_state_64
+ s = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_MD_state_64
+ *p = (Hacl_Streaming_MD_state_64 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_64));
+ p[0U] = s;
+ Hacl_SHA2_Scalar32_sha512_init(block_state);
+ return p;
+}
+
+/**
+Copies the state passed as argument into a newly allocated state (deep copy).
+The state is to be freed by calling `free_512`. Cloning the state this way is
+useful, for instance, if your control-flow diverges and you need to feed
+more (different) data into the hash in each branch.
+*/
+Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_copy_512(Hacl_Streaming_MD_state_64 *s0)
+{
+ Hacl_Streaming_MD_state_64 scrut = *s0;
+ uint64_t *block_state0 = scrut.block_state;
+ uint8_t *buf0 = scrut.buf;
+ uint64_t total_len0 = scrut.total_len;
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)128U, sizeof (uint8_t));
+ memcpy(buf, buf0, (uint32_t)128U * sizeof (uint8_t));
+ uint64_t *block_state = (uint64_t *)KRML_HOST_CALLOC((uint32_t)8U, sizeof (uint64_t));
+ memcpy(block_state, block_state0, (uint32_t)8U * sizeof (uint64_t));
+ Hacl_Streaming_MD_state_64
+ s = { .block_state = block_state, .buf = buf, .total_len = total_len0 };
+ Hacl_Streaming_MD_state_64
+ *p = (Hacl_Streaming_MD_state_64 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_64));
+ p[0U] = s;
+ return p;
+}
+
+void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s)
+{
+ Hacl_Streaming_MD_state_64 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint64_t *block_state = scrut.block_state;
+ Hacl_SHA2_Scalar32_sha512_init(block_state);
+ Hacl_Streaming_MD_state_64
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+static inline Hacl_Streaming_Types_error_code
+update_384_512(Hacl_Streaming_MD_state_64 *p, uint8_t *data, uint32_t len)
+{
+ Hacl_Streaming_MD_state_64 s = *p;
+ uint64_t total_len = s.total_len;
+ if ((uint64_t)len > (uint64_t)18446744073709551615U - total_len)
+ {
+ return Hacl_Streaming_Types_MaximumLengthExceeded;
+ }
+ uint32_t sz;
+ if (total_len % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ sz = (uint32_t)128U;
+ }
+ else
+ {
+ sz = (uint32_t)(total_len % (uint64_t)(uint32_t)128U);
+ }
+ if (len <= (uint32_t)128U - sz)
+ {
+ Hacl_Streaming_MD_state_64 s1 = *p;
+ uint64_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)128U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)128U);
+ }
+ uint8_t *buf2 = buf + sz1;
+ memcpy(buf2, data, len * sizeof (uint8_t));
+ uint64_t total_len2 = total_len1 + (uint64_t)len;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_64){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len2
+ }
+ );
+ }
+ else if (sz == (uint32_t)0U)
+ {
+ Hacl_Streaming_MD_state_64 s1 = *p;
+ uint64_t *block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)128U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)128U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_SHA2_Scalar32_sha512_update_nblocks((uint32_t)128U, buf, block_state1);
+ }
+ uint32_t ite;
+ if ((uint64_t)len % (uint64_t)(uint32_t)128U == (uint64_t)0U && (uint64_t)len > (uint64_t)0U)
+ {
+ ite = (uint32_t)128U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)len % (uint64_t)(uint32_t)128U);
+ }
+ uint32_t n_blocks = (len - ite) / (uint32_t)128U;
+ uint32_t data1_len = n_blocks * (uint32_t)128U;
+ uint32_t data2_len = len - data1_len;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + data1_len;
+ Hacl_SHA2_Scalar32_sha512_update_nblocks(data1_len / (uint32_t)128U * (uint32_t)128U,
+ data1,
+ block_state1);
+ uint8_t *dst = buf;
+ memcpy(dst, data2, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_64){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)len
+ }
+ );
+ }
+ else
+ {
+ uint32_t diff = (uint32_t)128U - sz;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + diff;
+ Hacl_Streaming_MD_state_64 s1 = *p;
+ uint64_t *block_state10 = s1.block_state;
+ uint8_t *buf0 = s1.buf;
+ uint64_t total_len10 = s1.total_len;
+ uint32_t sz10;
+ if (total_len10 % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len10 > (uint64_t)0U)
+ {
+ sz10 = (uint32_t)128U;
+ }
+ else
+ {
+ sz10 = (uint32_t)(total_len10 % (uint64_t)(uint32_t)128U);
+ }
+ uint8_t *buf2 = buf0 + sz10;
+ memcpy(buf2, data1, diff * sizeof (uint8_t));
+ uint64_t total_len2 = total_len10 + (uint64_t)diff;
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_64){
+ .block_state = block_state10,
+ .buf = buf0,
+ .total_len = total_len2
+ }
+ );
+ Hacl_Streaming_MD_state_64 s10 = *p;
+ uint64_t *block_state1 = s10.block_state;
+ uint8_t *buf = s10.buf;
+ uint64_t total_len1 = s10.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = (uint32_t)128U;
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)(uint32_t)128U);
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Hacl_SHA2_Scalar32_sha512_update_nblocks((uint32_t)128U, buf, block_state1);
+ }
+ uint32_t ite;
+ if
+ (
+ (uint64_t)(len - diff)
+ % (uint64_t)(uint32_t)128U
+ == (uint64_t)0U
+ && (uint64_t)(len - diff) > (uint64_t)0U
+ )
+ {
+ ite = (uint32_t)128U;
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)(len - diff) % (uint64_t)(uint32_t)128U);
+ }
+ uint32_t n_blocks = (len - diff - ite) / (uint32_t)128U;
+ uint32_t data1_len = n_blocks * (uint32_t)128U;
+ uint32_t data2_len = len - diff - data1_len;
+ uint8_t *data11 = data2;
+ uint8_t *data21 = data2 + data1_len;
+ Hacl_SHA2_Scalar32_sha512_update_nblocks(data1_len / (uint32_t)128U * (uint32_t)128U,
+ data11,
+ block_state1);
+ uint8_t *dst = buf;
+ memcpy(dst, data21, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_MD_state_64){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)(len - diff)
+ }
+ );
+ }
+ return Hacl_Streaming_Types_Success;
+}
+
+/**
+Feed an arbitrary amount of data into the hash. This function returns 0 for
+success, or 1 if the combined length of all of the data passed to `update_512`
+(since the last call to `init_512`) exceeds 2^125-1 bytes.
+
+This function is identical to the update function for SHA2_384.
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_512(
+ Hacl_Streaming_MD_state_64 *p,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ return update_384_512(p, input, input_len);
+}
+
+/**
+Write the resulting hash into `dst`, an array of 64 bytes. The state remains
+valid after a call to `finish_512`, meaning the user may feed more data into
+the hash via `update_512`. (The finish_512 function operates on an internal copy of
+the state and therefore does not invalidate the client-held state `p`.)
+*/
+void Hacl_Streaming_SHA2_finish_512(Hacl_Streaming_MD_state_64 *p, uint8_t *dst)
+{
+ Hacl_Streaming_MD_state_64 scrut = *p;
+ uint64_t *block_state = scrut.block_state;
+ uint8_t *buf_ = scrut.buf;
+ uint64_t total_len = scrut.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = (uint32_t)128U;
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)(uint32_t)128U);
+ }
+ uint8_t *buf_1 = buf_;
+ uint64_t tmp_block_state[8U] = { 0U };
+ memcpy(tmp_block_state, block_state, (uint32_t)8U * sizeof (uint64_t));
+ uint32_t ite;
+ if (r % (uint32_t)128U == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite = (uint32_t)128U;
+ }
+ else
+ {
+ ite = r % (uint32_t)128U;
+ }
+ uint8_t *buf_last = buf_1 + r - ite;
+ uint8_t *buf_multi = buf_1;
+ Hacl_SHA2_Scalar32_sha512_update_nblocks((uint32_t)0U, buf_multi, tmp_block_state);
+ uint64_t prev_len_last = total_len - (uint64_t)r;
+ Hacl_SHA2_Scalar32_sha512_update_last(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128(prev_len_last),
+ FStar_UInt128_uint64_to_uint128((uint64_t)r)),
+ r,
+ buf_last,
+ tmp_block_state);
+ Hacl_SHA2_Scalar32_sha512_finish(tmp_block_state, dst);
+}
+
+/**
+Free a state allocated with `create_in_512`.
+
+This function is identical to the free function for SHA2_384.
+*/
+void Hacl_Streaming_SHA2_free_512(Hacl_Streaming_MD_state_64 *s)
+{
+ Hacl_Streaming_MD_state_64 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint64_t *block_state = scrut.block_state;
+ KRML_HOST_FREE(block_state);
+ KRML_HOST_FREE(buf);
+ KRML_HOST_FREE(s);
+}
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 64 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_512(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ uint8_t *ib = input;
+ uint8_t *rb = dst;
+ uint64_t st[8U] = { 0U };
+ Hacl_SHA2_Scalar32_sha512_init(st);
+ uint32_t rem = input_len % (uint32_t)128U;
+ FStar_UInt128_uint128 len_ = FStar_UInt128_uint64_to_uint128((uint64_t)input_len);
+ Hacl_SHA2_Scalar32_sha512_update_nblocks(input_len, ib, st);
+ uint32_t rem1 = input_len % (uint32_t)128U;
+ uint8_t *b0 = ib;
+ uint8_t *lb = b0 + input_len - rem1;
+ Hacl_SHA2_Scalar32_sha512_update_last(len_, rem, lb, st);
+ Hacl_SHA2_Scalar32_sha512_finish(st, rb);
+}
+
+Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_384(void)
+{
+ uint8_t *buf = (uint8_t *)KRML_HOST_CALLOC((uint32_t)128U, sizeof (uint8_t));
+ uint64_t *block_state = (uint64_t *)KRML_HOST_CALLOC((uint32_t)8U, sizeof (uint64_t));
+ Hacl_Streaming_MD_state_64
+ s = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_MD_state_64
+ *p = (Hacl_Streaming_MD_state_64 *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_MD_state_64));
+ p[0U] = s;
+ Hacl_SHA2_Scalar32_sha384_init(block_state);
+ return p;
+}
+
+void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s)
+{
+ Hacl_Streaming_MD_state_64 scrut = *s;
+ uint8_t *buf = scrut.buf;
+ uint64_t *block_state = scrut.block_state;
+ Hacl_SHA2_Scalar32_sha384_init(block_state);
+ Hacl_Streaming_MD_state_64
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_384(
+ Hacl_Streaming_MD_state_64 *p,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ return update_384_512(p, input, input_len);
+}
+
+/**
+Write the resulting hash into `dst`, an array of 48 bytes. The state remains
+valid after a call to `finish_384`, meaning the user may feed more data into
+the hash via `update_384`.
+*/
+void Hacl_Streaming_SHA2_finish_384(Hacl_Streaming_MD_state_64 *p, uint8_t *dst)
+{
+ Hacl_Streaming_MD_state_64 scrut = *p;
+ uint64_t *block_state = scrut.block_state;
+ uint8_t *buf_ = scrut.buf;
+ uint64_t total_len = scrut.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)(uint32_t)128U == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = (uint32_t)128U;
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)(uint32_t)128U);
+ }
+ uint8_t *buf_1 = buf_;
+ uint64_t tmp_block_state[8U] = { 0U };
+ memcpy(tmp_block_state, block_state, (uint32_t)8U * sizeof (uint64_t));
+ uint32_t ite;
+ if (r % (uint32_t)128U == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite = (uint32_t)128U;
+ }
+ else
+ {
+ ite = r % (uint32_t)128U;
+ }
+ uint8_t *buf_last = buf_1 + r - ite;
+ uint8_t *buf_multi = buf_1;
+ Hacl_SHA2_Scalar32_sha384_update_nblocks((uint32_t)0U, buf_multi, tmp_block_state);
+ uint64_t prev_len_last = total_len - (uint64_t)r;
+ Hacl_SHA2_Scalar32_sha384_update_last(FStar_UInt128_add(FStar_UInt128_uint64_to_uint128(prev_len_last),
+ FStar_UInt128_uint64_to_uint128((uint64_t)r)),
+ r,
+ buf_last,
+ tmp_block_state);
+ Hacl_SHA2_Scalar32_sha384_finish(tmp_block_state, dst);
+}
+
+void Hacl_Streaming_SHA2_free_384(Hacl_Streaming_MD_state_64 *p)
+{
+ Hacl_Streaming_SHA2_free_512(p);
+}
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 48 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_384(uint8_t *input, uint32_t input_len, uint8_t *dst)
+{
+ uint8_t *ib = input;
+ uint8_t *rb = dst;
+ uint64_t st[8U] = { 0U };
+ Hacl_SHA2_Scalar32_sha384_init(st);
+ uint32_t rem = input_len % (uint32_t)128U;
+ FStar_UInt128_uint128 len_ = FStar_UInt128_uint64_to_uint128((uint64_t)input_len);
+ Hacl_SHA2_Scalar32_sha384_update_nblocks(input_len, ib, st);
+ uint32_t rem1 = input_len % (uint32_t)128U;
+ uint8_t *b0 = ib;
+ uint8_t *lb = b0 + input_len - rem1;
+ Hacl_SHA2_Scalar32_sha384_update_last(len_, rem, lb, st);
+ Hacl_SHA2_Scalar32_sha384_finish(st, rb);
+}
+
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h
new file mode 100644
index 00000000000..a0e731094df
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA2.h
@@ -0,0 +1,204 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __Hacl_Hash_SHA2_H
+#define __Hacl_Hash_SHA2_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "python_hacl_namespaces.h"
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "Hacl_Streaming_Types.h"
+
+
+typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA2_state_sha2_224;
+
+typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA2_state_sha2_256;
+
+typedef Hacl_Streaming_MD_state_64 Hacl_Streaming_SHA2_state_sha2_384;
+
+typedef Hacl_Streaming_MD_state_64 Hacl_Streaming_SHA2_state_sha2_512;
+
+/**
+Allocate initial state for the SHA2_256 hash. The state is to be freed by
+calling `free_256`.
+*/
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_256(void);
+
+/**
+Copies the state passed as argument into a newly allocated state (deep copy).
+The state is to be freed by calling `free_256`. Cloning the state this way is
+useful, for instance, if your control-flow diverges and you need to feed
+more (different) data into the hash in each branch.
+*/
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_copy_256(Hacl_Streaming_MD_state_32 *s0);
+
+/**
+Reset an existing state to the initial hash state with empty data.
+*/
+void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s);
+
+/**
+Feed an arbitrary amount of data into the hash. This function returns 0 for
+success, or 1 if the combined length of all of the data passed to `update_256`
+(since the last call to `init_256`) exceeds 2^61-1 bytes.
+
+This function is identical to the update function for SHA2_224.
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_256(
+ Hacl_Streaming_MD_state_32 *p,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+/**
+Write the resulting hash into `dst`, an array of 32 bytes. The state remains
+valid after a call to `finish_256`, meaning the user may feed more data into
+the hash via `update_256`. (The finish_256 function operates on an internal copy of
+the state and therefore does not invalidate the client-held state `p`.)
+*/
+void Hacl_Streaming_SHA2_finish_256(Hacl_Streaming_MD_state_32 *p, uint8_t *dst);
+
+/**
+Free a state allocated with `create_in_256`.
+
+This function is identical to the free function for SHA2_224.
+*/
+void Hacl_Streaming_SHA2_free_256(Hacl_Streaming_MD_state_32 *s);
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 32 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_256(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_224(void);
+
+void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s);
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_224(
+ Hacl_Streaming_MD_state_32 *p,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+/**
+Write the resulting hash into `dst`, an array of 28 bytes. The state remains
+valid after a call to `finish_224`, meaning the user may feed more data into
+the hash via `update_224`.
+*/
+void Hacl_Streaming_SHA2_finish_224(Hacl_Streaming_MD_state_32 *p, uint8_t *dst);
+
+void Hacl_Streaming_SHA2_free_224(Hacl_Streaming_MD_state_32 *p);
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 28 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_224(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_512(void);
+
+/**
+Copies the state passed as argument into a newly allocated state (deep copy).
+The state is to be freed by calling `free_512`. Cloning the state this way is
+useful, for instance, if your control-flow diverges and you need to feed
+more (different) data into the hash in each branch.
+*/
+Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_copy_512(Hacl_Streaming_MD_state_64 *s0);
+
+void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s);
+
+/**
+Feed an arbitrary amount of data into the hash. This function returns 0 for
+success, or 1 if the combined length of all of the data passed to `update_512`
+(since the last call to `init_512`) exceeds 2^125-1 bytes.
+
+This function is identical to the update function for SHA2_384.
+*/
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_512(
+ Hacl_Streaming_MD_state_64 *p,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+/**
+Write the resulting hash into `dst`, an array of 64 bytes. The state remains
+valid after a call to `finish_512`, meaning the user may feed more data into
+the hash via `update_512`. (The finish_512 function operates on an internal copy of
+the state and therefore does not invalidate the client-held state `p`.)
+*/
+void Hacl_Streaming_SHA2_finish_512(Hacl_Streaming_MD_state_64 *p, uint8_t *dst);
+
+/**
+Free a state allocated with `create_in_512`.
+
+This function is identical to the free function for SHA2_384.
+*/
+void Hacl_Streaming_SHA2_free_512(Hacl_Streaming_MD_state_64 *s);
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 64 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_512(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_384(void);
+
+void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s);
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_SHA2_update_384(
+ Hacl_Streaming_MD_state_64 *p,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+/**
+Write the resulting hash into `dst`, an array of 48 bytes. The state remains
+valid after a call to `finish_384`, meaning the user may feed more data into
+the hash via `update_384`.
+*/
+void Hacl_Streaming_SHA2_finish_384(Hacl_Streaming_MD_state_64 *p, uint8_t *dst);
+
+void Hacl_Streaming_SHA2_free_384(Hacl_Streaming_MD_state_64 *p);
+
+/**
+Hash `input`, of len `input_len`, into `dst`, an array of 48 bytes.
+*/
+void Hacl_Streaming_SHA2_hash_384(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __Hacl_Hash_SHA2_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c
new file mode 100644
index 00000000000..b3febdfeb2b
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.c
@@ -0,0 +1,824 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#include "internal/Hacl_Hash_SHA3.h"
+
+static uint32_t block_len(Spec_Hash_Definitions_hash_alg a)
+{
+ switch (a)
+ {
+ case Spec_Hash_Definitions_SHA3_224:
+ {
+ return (uint32_t)144U;
+ }
+ case Spec_Hash_Definitions_SHA3_256:
+ {
+ return (uint32_t)136U;
+ }
+ case Spec_Hash_Definitions_SHA3_384:
+ {
+ return (uint32_t)104U;
+ }
+ case Spec_Hash_Definitions_SHA3_512:
+ {
+ return (uint32_t)72U;
+ }
+ case Spec_Hash_Definitions_Shake128:
+ {
+ return (uint32_t)168U;
+ }
+ case Spec_Hash_Definitions_Shake256:
+ {
+ return (uint32_t)136U;
+ }
+ default:
+ {
+ KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__);
+ KRML_HOST_EXIT(253U);
+ }
+ }
+}
+
+static uint32_t hash_len(Spec_Hash_Definitions_hash_alg a)
+{
+ switch (a)
+ {
+ case Spec_Hash_Definitions_SHA3_224:
+ {
+ return (uint32_t)28U;
+ }
+ case Spec_Hash_Definitions_SHA3_256:
+ {
+ return (uint32_t)32U;
+ }
+ case Spec_Hash_Definitions_SHA3_384:
+ {
+ return (uint32_t)48U;
+ }
+ case Spec_Hash_Definitions_SHA3_512:
+ {
+ return (uint32_t)64U;
+ }
+ default:
+ {
+ KRML_HOST_EPRINTF("KaRaMeL incomplete match at %s:%d\n", __FILE__, __LINE__);
+ KRML_HOST_EXIT(253U);
+ }
+ }
+}
+
+void
+Hacl_Hash_SHA3_update_multi_sha3(
+ Spec_Hash_Definitions_hash_alg a,
+ uint64_t *s,
+ uint8_t *blocks,
+ uint32_t n_blocks
+)
+{
+ for (uint32_t i = (uint32_t)0U; i < n_blocks; i++)
+ {
+ uint8_t *block = blocks + i * block_len(a);
+ Hacl_Impl_SHA3_absorb_inner(block_len(a), block, s);
+ }
+}
+
+void
+Hacl_Hash_SHA3_update_last_sha3(
+ Spec_Hash_Definitions_hash_alg a,
+ uint64_t *s,
+ uint8_t *input,
+ uint32_t input_len
+)
+{
+ uint8_t suffix;
+ if (a == Spec_Hash_Definitions_Shake128 || a == Spec_Hash_Definitions_Shake256)
+ {
+ suffix = (uint8_t)0x1fU;
+ }
+ else
+ {
+ suffix = (uint8_t)0x06U;
+ }
+ uint32_t len = block_len(a);
+ if (input_len == len)
+ {
+ Hacl_Impl_SHA3_absorb_inner(len, input, s);
+ uint8_t *uu____0 = input + input_len;
+ uint8_t lastBlock_[200U] = { 0U };
+ uint8_t *lastBlock = lastBlock_;
+ memcpy(lastBlock, uu____0, (uint32_t)0U * sizeof (uint8_t));
+ lastBlock[0U] = suffix;
+ Hacl_Impl_SHA3_loadState(len, lastBlock, s);
+ if (!((suffix & (uint8_t)0x80U) == (uint8_t)0U) && (uint32_t)0U == len - (uint32_t)1U)
+ {
+ Hacl_Impl_SHA3_state_permute(s);
+ }
+ uint8_t nextBlock_[200U] = { 0U };
+ uint8_t *nextBlock = nextBlock_;
+ nextBlock[len - (uint32_t)1U] = (uint8_t)0x80U;
+ Hacl_Impl_SHA3_loadState(len, nextBlock, s);
+ Hacl_Impl_SHA3_state_permute(s);
+ return;
+ }
+ uint8_t lastBlock_[200U] = { 0U };
+ uint8_t *lastBlock = lastBlock_;
+ memcpy(lastBlock, input, input_len * sizeof (uint8_t));
+ lastBlock[input_len] = suffix;
+ Hacl_Impl_SHA3_loadState(len, lastBlock, s);
+ if (!((suffix & (uint8_t)0x80U) == (uint8_t)0U) && input_len == len - (uint32_t)1U)
+ {
+ Hacl_Impl_SHA3_state_permute(s);
+ }
+ uint8_t nextBlock_[200U] = { 0U };
+ uint8_t *nextBlock = nextBlock_;
+ nextBlock[len - (uint32_t)1U] = (uint8_t)0x80U;
+ Hacl_Impl_SHA3_loadState(len, nextBlock, s);
+ Hacl_Impl_SHA3_state_permute(s);
+}
+
+typedef struct hash_buf2_s
+{
+ Hacl_Streaming_Keccak_hash_buf fst;
+ Hacl_Streaming_Keccak_hash_buf snd;
+}
+hash_buf2;
+
+Spec_Hash_Definitions_hash_alg Hacl_Streaming_Keccak_get_alg(Hacl_Streaming_Keccak_state *s)
+{
+ Hacl_Streaming_Keccak_state scrut = *s;
+ Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state;
+ return block_state.fst;
+}
+
+Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_hash_alg a)
+{
+ KRML_CHECK_SIZE(sizeof (uint8_t), block_len(a));
+ uint8_t *buf0 = (uint8_t *)KRML_HOST_CALLOC(block_len(a), sizeof (uint8_t));
+ uint64_t *buf = (uint64_t *)KRML_HOST_CALLOC((uint32_t)25U, sizeof (uint64_t));
+ Hacl_Streaming_Keccak_hash_buf block_state = { .fst = a, .snd = buf };
+ Hacl_Streaming_Keccak_state
+ s = { .block_state = block_state, .buf = buf0, .total_len = (uint64_t)(uint32_t)0U };
+ Hacl_Streaming_Keccak_state
+ *p = (Hacl_Streaming_Keccak_state *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_Keccak_state));
+ p[0U] = s;
+ uint64_t *s1 = block_state.snd;
+ memset(s1, 0U, (uint32_t)25U * sizeof (uint64_t));
+ return p;
+}
+
+void Hacl_Streaming_Keccak_free(Hacl_Streaming_Keccak_state *s)
+{
+ Hacl_Streaming_Keccak_state scrut = *s;
+ uint8_t *buf = scrut.buf;
+ Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state;
+ uint64_t *s1 = block_state.snd;
+ KRML_HOST_FREE(s1);
+ KRML_HOST_FREE(buf);
+ KRML_HOST_FREE(s);
+}
+
+Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_copy(Hacl_Streaming_Keccak_state *s0)
+{
+ Hacl_Streaming_Keccak_state scrut0 = *s0;
+ Hacl_Streaming_Keccak_hash_buf block_state0 = scrut0.block_state;
+ uint8_t *buf0 = scrut0.buf;
+ uint64_t total_len0 = scrut0.total_len;
+ Spec_Hash_Definitions_hash_alg i = block_state0.fst;
+ KRML_CHECK_SIZE(sizeof (uint8_t), block_len(i));
+ uint8_t *buf1 = (uint8_t *)KRML_HOST_CALLOC(block_len(i), sizeof (uint8_t));
+ memcpy(buf1, buf0, block_len(i) * sizeof (uint8_t));
+ uint64_t *buf = (uint64_t *)KRML_HOST_CALLOC((uint32_t)25U, sizeof (uint64_t));
+ Hacl_Streaming_Keccak_hash_buf block_state = { .fst = i, .snd = buf };
+ hash_buf2 scrut = { .fst = block_state0, .snd = block_state };
+ uint64_t *s_dst = scrut.snd.snd;
+ uint64_t *s_src = scrut.fst.snd;
+ memcpy(s_dst, s_src, (uint32_t)25U * sizeof (uint64_t));
+ Hacl_Streaming_Keccak_state
+ s = { .block_state = block_state, .buf = buf1, .total_len = total_len0 };
+ Hacl_Streaming_Keccak_state
+ *p = (Hacl_Streaming_Keccak_state *)KRML_HOST_MALLOC(sizeof (Hacl_Streaming_Keccak_state));
+ p[0U] = s;
+ return p;
+}
+
+void Hacl_Streaming_Keccak_reset(Hacl_Streaming_Keccak_state *s)
+{
+ Hacl_Streaming_Keccak_state scrut = *s;
+ uint8_t *buf = scrut.buf;
+ Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state;
+ uint64_t *s1 = block_state.snd;
+ memset(s1, 0U, (uint32_t)25U * sizeof (uint64_t));
+ Hacl_Streaming_Keccak_state
+ tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U };
+ s[0U] = tmp;
+}
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_Keccak_update(Hacl_Streaming_Keccak_state *p, uint8_t *data, uint32_t len)
+{
+ Hacl_Streaming_Keccak_state s = *p;
+ Hacl_Streaming_Keccak_hash_buf block_state = s.block_state;
+ uint64_t total_len = s.total_len;
+ Spec_Hash_Definitions_hash_alg i = block_state.fst;
+ if ((uint64_t)len > (uint64_t)0xFFFFFFFFFFFFFFFFU - total_len)
+ {
+ return Hacl_Streaming_Types_MaximumLengthExceeded;
+ }
+ uint32_t sz;
+ if (total_len % (uint64_t)block_len(i) == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ sz = block_len(i);
+ }
+ else
+ {
+ sz = (uint32_t)(total_len % (uint64_t)block_len(i));
+ }
+ if (len <= block_len(i) - sz)
+ {
+ Hacl_Streaming_Keccak_state s1 = *p;
+ Hacl_Streaming_Keccak_hash_buf block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)block_len(i) == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = block_len(i);
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)block_len(i));
+ }
+ uint8_t *buf2 = buf + sz1;
+ memcpy(buf2, data, len * sizeof (uint8_t));
+ uint64_t total_len2 = total_len1 + (uint64_t)len;
+ *p
+ =
+ (
+ (Hacl_Streaming_Keccak_state){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len2
+ }
+ );
+ }
+ else if (sz == (uint32_t)0U)
+ {
+ Hacl_Streaming_Keccak_state s1 = *p;
+ Hacl_Streaming_Keccak_hash_buf block_state1 = s1.block_state;
+ uint8_t *buf = s1.buf;
+ uint64_t total_len1 = s1.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)block_len(i) == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = block_len(i);
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)block_len(i));
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Spec_Hash_Definitions_hash_alg a1 = block_state1.fst;
+ uint64_t *s2 = block_state1.snd;
+ Hacl_Hash_SHA3_update_multi_sha3(a1, s2, buf, block_len(i) / block_len(a1));
+ }
+ uint32_t ite;
+ if ((uint64_t)len % (uint64_t)block_len(i) == (uint64_t)0U && (uint64_t)len > (uint64_t)0U)
+ {
+ ite = block_len(i);
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)len % (uint64_t)block_len(i));
+ }
+ uint32_t n_blocks = (len - ite) / block_len(i);
+ uint32_t data1_len = n_blocks * block_len(i);
+ uint32_t data2_len = len - data1_len;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + data1_len;
+ Spec_Hash_Definitions_hash_alg a1 = block_state1.fst;
+ uint64_t *s2 = block_state1.snd;
+ Hacl_Hash_SHA3_update_multi_sha3(a1, s2, data1, data1_len / block_len(a1));
+ uint8_t *dst = buf;
+ memcpy(dst, data2, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_Keccak_state){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)len
+ }
+ );
+ }
+ else
+ {
+ uint32_t diff = block_len(i) - sz;
+ uint8_t *data1 = data;
+ uint8_t *data2 = data + diff;
+ Hacl_Streaming_Keccak_state s1 = *p;
+ Hacl_Streaming_Keccak_hash_buf block_state10 = s1.block_state;
+ uint8_t *buf0 = s1.buf;
+ uint64_t total_len10 = s1.total_len;
+ uint32_t sz10;
+ if (total_len10 % (uint64_t)block_len(i) == (uint64_t)0U && total_len10 > (uint64_t)0U)
+ {
+ sz10 = block_len(i);
+ }
+ else
+ {
+ sz10 = (uint32_t)(total_len10 % (uint64_t)block_len(i));
+ }
+ uint8_t *buf2 = buf0 + sz10;
+ memcpy(buf2, data1, diff * sizeof (uint8_t));
+ uint64_t total_len2 = total_len10 + (uint64_t)diff;
+ *p
+ =
+ (
+ (Hacl_Streaming_Keccak_state){
+ .block_state = block_state10,
+ .buf = buf0,
+ .total_len = total_len2
+ }
+ );
+ Hacl_Streaming_Keccak_state s10 = *p;
+ Hacl_Streaming_Keccak_hash_buf block_state1 = s10.block_state;
+ uint8_t *buf = s10.buf;
+ uint64_t total_len1 = s10.total_len;
+ uint32_t sz1;
+ if (total_len1 % (uint64_t)block_len(i) == (uint64_t)0U && total_len1 > (uint64_t)0U)
+ {
+ sz1 = block_len(i);
+ }
+ else
+ {
+ sz1 = (uint32_t)(total_len1 % (uint64_t)block_len(i));
+ }
+ if (!(sz1 == (uint32_t)0U))
+ {
+ Spec_Hash_Definitions_hash_alg a1 = block_state1.fst;
+ uint64_t *s2 = block_state1.snd;
+ Hacl_Hash_SHA3_update_multi_sha3(a1, s2, buf, block_len(i) / block_len(a1));
+ }
+ uint32_t ite;
+ if
+ (
+ (uint64_t)(len - diff)
+ % (uint64_t)block_len(i)
+ == (uint64_t)0U
+ && (uint64_t)(len - diff) > (uint64_t)0U
+ )
+ {
+ ite = block_len(i);
+ }
+ else
+ {
+ ite = (uint32_t)((uint64_t)(len - diff) % (uint64_t)block_len(i));
+ }
+ uint32_t n_blocks = (len - diff - ite) / block_len(i);
+ uint32_t data1_len = n_blocks * block_len(i);
+ uint32_t data2_len = len - diff - data1_len;
+ uint8_t *data11 = data2;
+ uint8_t *data21 = data2 + data1_len;
+ Spec_Hash_Definitions_hash_alg a1 = block_state1.fst;
+ uint64_t *s2 = block_state1.snd;
+ Hacl_Hash_SHA3_update_multi_sha3(a1, s2, data11, data1_len / block_len(a1));
+ uint8_t *dst = buf;
+ memcpy(dst, data21, data2_len * sizeof (uint8_t));
+ *p
+ =
+ (
+ (Hacl_Streaming_Keccak_state){
+ .block_state = block_state1,
+ .buf = buf,
+ .total_len = total_len1 + (uint64_t)(len - diff)
+ }
+ );
+ }
+ return Hacl_Streaming_Types_Success;
+}
+
+static void
+finish_(
+ Spec_Hash_Definitions_hash_alg a,
+ Hacl_Streaming_Keccak_state *p,
+ uint8_t *dst,
+ uint32_t l
+)
+{
+ Hacl_Streaming_Keccak_state scrut0 = *p;
+ Hacl_Streaming_Keccak_hash_buf block_state = scrut0.block_state;
+ uint8_t *buf_ = scrut0.buf;
+ uint64_t total_len = scrut0.total_len;
+ uint32_t r;
+ if (total_len % (uint64_t)block_len(a) == (uint64_t)0U && total_len > (uint64_t)0U)
+ {
+ r = block_len(a);
+ }
+ else
+ {
+ r = (uint32_t)(total_len % (uint64_t)block_len(a));
+ }
+ uint8_t *buf_1 = buf_;
+ uint64_t buf[25U] = { 0U };
+ Hacl_Streaming_Keccak_hash_buf tmp_block_state = { .fst = a, .snd = buf };
+ hash_buf2 scrut = { .fst = block_state, .snd = tmp_block_state };
+ uint64_t *s_dst = scrut.snd.snd;
+ uint64_t *s_src = scrut.fst.snd;
+ memcpy(s_dst, s_src, (uint32_t)25U * sizeof (uint64_t));
+ uint32_t ite0;
+ if (r % block_len(a) == (uint32_t)0U && r > (uint32_t)0U)
+ {
+ ite0 = block_len(a);
+ }
+ else
+ {
+ ite0 = r % block_len(a);
+ }
+ uint8_t *buf_last = buf_1 + r - ite0;
+ uint8_t *buf_multi = buf_1;
+ Spec_Hash_Definitions_hash_alg a1 = tmp_block_state.fst;
+ uint64_t *s0 = tmp_block_state.snd;
+ Hacl_Hash_SHA3_update_multi_sha3(a1, s0, buf_multi, (uint32_t)0U / block_len(a1));
+ Spec_Hash_Definitions_hash_alg a10 = tmp_block_state.fst;
+ uint64_t *s1 = tmp_block_state.snd;
+ Hacl_Hash_SHA3_update_last_sha3(a10, s1, buf_last, r);
+ Spec_Hash_Definitions_hash_alg a11 = tmp_block_state.fst;
+ uint64_t *s = tmp_block_state.snd;
+ if (a11 == Spec_Hash_Definitions_Shake128 || a11 == Spec_Hash_Definitions_Shake256)
+ {
+ uint32_t ite;
+ if (a11 == Spec_Hash_Definitions_Shake128 || a11 == Spec_Hash_Definitions_Shake256)
+ {
+ ite = l;
+ }
+ else
+ {
+ ite = hash_len(a11);
+ }
+ Hacl_Impl_SHA3_squeeze(s, block_len(a11), ite, dst);
+ return;
+ }
+ Hacl_Impl_SHA3_squeeze(s, block_len(a11), hash_len(a11), dst);
+}
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_Keccak_finish(Hacl_Streaming_Keccak_state *s, uint8_t *dst)
+{
+ Spec_Hash_Definitions_hash_alg a1 = Hacl_Streaming_Keccak_get_alg(s);
+ if (a1 == Spec_Hash_Definitions_Shake128 || a1 == Spec_Hash_Definitions_Shake256)
+ {
+ return Hacl_Streaming_Types_InvalidAlgorithm;
+ }
+ finish_(a1, s, dst, hash_len(a1));
+ return Hacl_Streaming_Types_Success;
+}
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_Keccak_squeeze(Hacl_Streaming_Keccak_state *s, uint8_t *dst, uint32_t l)
+{
+ Spec_Hash_Definitions_hash_alg a1 = Hacl_Streaming_Keccak_get_alg(s);
+ if (!(a1 == Spec_Hash_Definitions_Shake128 || a1 == Spec_Hash_Definitions_Shake256))
+ {
+ return Hacl_Streaming_Types_InvalidAlgorithm;
+ }
+ if (l == (uint32_t)0U)
+ {
+ return Hacl_Streaming_Types_InvalidLength;
+ }
+ finish_(a1, s, dst, l);
+ return Hacl_Streaming_Types_Success;
+}
+
+uint32_t Hacl_Streaming_Keccak_block_len(Hacl_Streaming_Keccak_state *s)
+{
+ Spec_Hash_Definitions_hash_alg a1 = Hacl_Streaming_Keccak_get_alg(s);
+ return block_len(a1);
+}
+
+uint32_t Hacl_Streaming_Keccak_hash_len(Hacl_Streaming_Keccak_state *s)
+{
+ Spec_Hash_Definitions_hash_alg a1 = Hacl_Streaming_Keccak_get_alg(s);
+ return hash_len(a1);
+}
+
+bool Hacl_Streaming_Keccak_is_shake(Hacl_Streaming_Keccak_state *s)
+{
+ Spec_Hash_Definitions_hash_alg uu____0 = Hacl_Streaming_Keccak_get_alg(s);
+ return uu____0 == Spec_Hash_Definitions_Shake128 || uu____0 == Spec_Hash_Definitions_Shake256;
+}
+
+void
+Hacl_SHA3_shake128_hacl(
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint32_t outputByteLen,
+ uint8_t *output
+)
+{
+ Hacl_Impl_SHA3_keccak((uint32_t)1344U,
+ (uint32_t)256U,
+ inputByteLen,
+ input,
+ (uint8_t)0x1FU,
+ outputByteLen,
+ output);
+}
+
+void
+Hacl_SHA3_shake256_hacl(
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint32_t outputByteLen,
+ uint8_t *output
+)
+{
+ Hacl_Impl_SHA3_keccak((uint32_t)1088U,
+ (uint32_t)512U,
+ inputByteLen,
+ input,
+ (uint8_t)0x1FU,
+ outputByteLen,
+ output);
+}
+
+void Hacl_SHA3_sha3_224(uint32_t inputByteLen, uint8_t *input, uint8_t *output)
+{
+ Hacl_Impl_SHA3_keccak((uint32_t)1152U,
+ (uint32_t)448U,
+ inputByteLen,
+ input,
+ (uint8_t)0x06U,
+ (uint32_t)28U,
+ output);
+}
+
+void Hacl_SHA3_sha3_256(uint32_t inputByteLen, uint8_t *input, uint8_t *output)
+{
+ Hacl_Impl_SHA3_keccak((uint32_t)1088U,
+ (uint32_t)512U,
+ inputByteLen,
+ input,
+ (uint8_t)0x06U,
+ (uint32_t)32U,
+ output);
+}
+
+void Hacl_SHA3_sha3_384(uint32_t inputByteLen, uint8_t *input, uint8_t *output)
+{
+ Hacl_Impl_SHA3_keccak((uint32_t)832U,
+ (uint32_t)768U,
+ inputByteLen,
+ input,
+ (uint8_t)0x06U,
+ (uint32_t)48U,
+ output);
+}
+
+void Hacl_SHA3_sha3_512(uint32_t inputByteLen, uint8_t *input, uint8_t *output)
+{
+ Hacl_Impl_SHA3_keccak((uint32_t)576U,
+ (uint32_t)1024U,
+ inputByteLen,
+ input,
+ (uint8_t)0x06U,
+ (uint32_t)64U,
+ output);
+}
+
+static const
+uint32_t
+keccak_rotc[24U] =
+ {
+ (uint32_t)1U, (uint32_t)3U, (uint32_t)6U, (uint32_t)10U, (uint32_t)15U, (uint32_t)21U,
+ (uint32_t)28U, (uint32_t)36U, (uint32_t)45U, (uint32_t)55U, (uint32_t)2U, (uint32_t)14U,
+ (uint32_t)27U, (uint32_t)41U, (uint32_t)56U, (uint32_t)8U, (uint32_t)25U, (uint32_t)43U,
+ (uint32_t)62U, (uint32_t)18U, (uint32_t)39U, (uint32_t)61U, (uint32_t)20U, (uint32_t)44U
+ };
+
+static const
+uint32_t
+keccak_piln[24U] =
+ {
+ (uint32_t)10U, (uint32_t)7U, (uint32_t)11U, (uint32_t)17U, (uint32_t)18U, (uint32_t)3U,
+ (uint32_t)5U, (uint32_t)16U, (uint32_t)8U, (uint32_t)21U, (uint32_t)24U, (uint32_t)4U,
+ (uint32_t)15U, (uint32_t)23U, (uint32_t)19U, (uint32_t)13U, (uint32_t)12U, (uint32_t)2U,
+ (uint32_t)20U, (uint32_t)14U, (uint32_t)22U, (uint32_t)9U, (uint32_t)6U, (uint32_t)1U
+ };
+
+static const
+uint64_t
+keccak_rndc[24U] =
+ {
+ (uint64_t)0x0000000000000001U, (uint64_t)0x0000000000008082U, (uint64_t)0x800000000000808aU,
+ (uint64_t)0x8000000080008000U, (uint64_t)0x000000000000808bU, (uint64_t)0x0000000080000001U,
+ (uint64_t)0x8000000080008081U, (uint64_t)0x8000000000008009U, (uint64_t)0x000000000000008aU,
+ (uint64_t)0x0000000000000088U, (uint64_t)0x0000000080008009U, (uint64_t)0x000000008000000aU,
+ (uint64_t)0x000000008000808bU, (uint64_t)0x800000000000008bU, (uint64_t)0x8000000000008089U,
+ (uint64_t)0x8000000000008003U, (uint64_t)0x8000000000008002U, (uint64_t)0x8000000000000080U,
+ (uint64_t)0x000000000000800aU, (uint64_t)0x800000008000000aU, (uint64_t)0x8000000080008081U,
+ (uint64_t)0x8000000000008080U, (uint64_t)0x0000000080000001U, (uint64_t)0x8000000080008008U
+ };
+
+void Hacl_Impl_SHA3_state_permute(uint64_t *s)
+{
+ for (uint32_t i0 = (uint32_t)0U; i0 < (uint32_t)24U; i0++)
+ {
+ uint64_t _C[5U] = { 0U };
+ KRML_MAYBE_FOR5(i,
+ (uint32_t)0U,
+ (uint32_t)5U,
+ (uint32_t)1U,
+ _C[i] =
+ s[i
+ + (uint32_t)0U]
+ ^
+ (s[i
+ + (uint32_t)5U]
+ ^ (s[i + (uint32_t)10U] ^ (s[i + (uint32_t)15U] ^ s[i + (uint32_t)20U]))););
+ KRML_MAYBE_FOR5(i1,
+ (uint32_t)0U,
+ (uint32_t)5U,
+ (uint32_t)1U,
+ uint64_t uu____0 = _C[(i1 + (uint32_t)1U) % (uint32_t)5U];
+ uint64_t
+ _D =
+ _C[(i1 + (uint32_t)4U)
+ % (uint32_t)5U]
+ ^ (uu____0 << (uint32_t)1U | uu____0 >> (uint32_t)63U);
+ KRML_MAYBE_FOR5(i,
+ (uint32_t)0U,
+ (uint32_t)5U,
+ (uint32_t)1U,
+ s[i1 + (uint32_t)5U * i] = s[i1 + (uint32_t)5U * i] ^ _D;););
+ uint64_t x = s[1U];
+ uint64_t current = x;
+ for (uint32_t i = (uint32_t)0U; i < (uint32_t)24U; i++)
+ {
+ uint32_t _Y = keccak_piln[i];
+ uint32_t r = keccak_rotc[i];
+ uint64_t temp = s[_Y];
+ uint64_t uu____1 = current;
+ s[_Y] = uu____1 << r | uu____1 >> ((uint32_t)64U - r);
+ current = temp;
+ }
+ KRML_MAYBE_FOR5(i,
+ (uint32_t)0U,
+ (uint32_t)5U,
+ (uint32_t)1U,
+ uint64_t
+ v0 =
+ s[(uint32_t)0U
+ + (uint32_t)5U * i]
+ ^ (~s[(uint32_t)1U + (uint32_t)5U * i] & s[(uint32_t)2U + (uint32_t)5U * i]);
+ uint64_t
+ v1 =
+ s[(uint32_t)1U
+ + (uint32_t)5U * i]
+ ^ (~s[(uint32_t)2U + (uint32_t)5U * i] & s[(uint32_t)3U + (uint32_t)5U * i]);
+ uint64_t
+ v2 =
+ s[(uint32_t)2U
+ + (uint32_t)5U * i]
+ ^ (~s[(uint32_t)3U + (uint32_t)5U * i] & s[(uint32_t)4U + (uint32_t)5U * i]);
+ uint64_t
+ v3 =
+ s[(uint32_t)3U
+ + (uint32_t)5U * i]
+ ^ (~s[(uint32_t)4U + (uint32_t)5U * i] & s[(uint32_t)0U + (uint32_t)5U * i]);
+ uint64_t
+ v4 =
+ s[(uint32_t)4U
+ + (uint32_t)5U * i]
+ ^ (~s[(uint32_t)0U + (uint32_t)5U * i] & s[(uint32_t)1U + (uint32_t)5U * i]);
+ s[(uint32_t)0U + (uint32_t)5U * i] = v0;
+ s[(uint32_t)1U + (uint32_t)5U * i] = v1;
+ s[(uint32_t)2U + (uint32_t)5U * i] = v2;
+ s[(uint32_t)3U + (uint32_t)5U * i] = v3;
+ s[(uint32_t)4U + (uint32_t)5U * i] = v4;);
+ uint64_t c = keccak_rndc[i0];
+ s[0U] = s[0U] ^ c;
+ }
+}
+
+void Hacl_Impl_SHA3_loadState(uint32_t rateInBytes, uint8_t *input, uint64_t *s)
+{
+ uint8_t block[200U] = { 0U };
+ memcpy(block, input, rateInBytes * sizeof (uint8_t));
+ for (uint32_t i = (uint32_t)0U; i < (uint32_t)25U; i++)
+ {
+ uint64_t u = load64_le(block + i * (uint32_t)8U);
+ uint64_t x = u;
+ s[i] = s[i] ^ x;
+ }
+}
+
+static void storeState(uint32_t rateInBytes, uint64_t *s, uint8_t *res)
+{
+ uint8_t block[200U] = { 0U };
+ for (uint32_t i = (uint32_t)0U; i < (uint32_t)25U; i++)
+ {
+ uint64_t sj = s[i];
+ store64_le(block + i * (uint32_t)8U, sj);
+ }
+ memcpy(res, block, rateInBytes * sizeof (uint8_t));
+}
+
+void Hacl_Impl_SHA3_absorb_inner(uint32_t rateInBytes, uint8_t *block, uint64_t *s)
+{
+ Hacl_Impl_SHA3_loadState(rateInBytes, block, s);
+ Hacl_Impl_SHA3_state_permute(s);
+}
+
+static void
+absorb(
+ uint64_t *s,
+ uint32_t rateInBytes,
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint8_t delimitedSuffix
+)
+{
+ uint32_t n_blocks = inputByteLen / rateInBytes;
+ uint32_t rem = inputByteLen % rateInBytes;
+ for (uint32_t i = (uint32_t)0U; i < n_blocks; i++)
+ {
+ uint8_t *block = input + i * rateInBytes;
+ Hacl_Impl_SHA3_absorb_inner(rateInBytes, block, s);
+ }
+ uint8_t *last = input + n_blocks * rateInBytes;
+ uint8_t lastBlock_[200U] = { 0U };
+ uint8_t *lastBlock = lastBlock_;
+ memcpy(lastBlock, last, rem * sizeof (uint8_t));
+ lastBlock[rem] = delimitedSuffix;
+ Hacl_Impl_SHA3_loadState(rateInBytes, lastBlock, s);
+ if (!((delimitedSuffix & (uint8_t)0x80U) == (uint8_t)0U) && rem == rateInBytes - (uint32_t)1U)
+ {
+ Hacl_Impl_SHA3_state_permute(s);
+ }
+ uint8_t nextBlock_[200U] = { 0U };
+ uint8_t *nextBlock = nextBlock_;
+ nextBlock[rateInBytes - (uint32_t)1U] = (uint8_t)0x80U;
+ Hacl_Impl_SHA3_loadState(rateInBytes, nextBlock, s);
+ Hacl_Impl_SHA3_state_permute(s);
+}
+
+void
+Hacl_Impl_SHA3_squeeze(
+ uint64_t *s,
+ uint32_t rateInBytes,
+ uint32_t outputByteLen,
+ uint8_t *output
+)
+{
+ uint32_t outBlocks = outputByteLen / rateInBytes;
+ uint32_t remOut = outputByteLen % rateInBytes;
+ uint8_t *last = output + outputByteLen - remOut;
+ uint8_t *blocks = output;
+ for (uint32_t i = (uint32_t)0U; i < outBlocks; i++)
+ {
+ storeState(rateInBytes, s, blocks + i * rateInBytes);
+ Hacl_Impl_SHA3_state_permute(s);
+ }
+ storeState(remOut, s, last);
+}
+
+void
+Hacl_Impl_SHA3_keccak(
+ uint32_t rate,
+ uint32_t capacity,
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint8_t delimitedSuffix,
+ uint32_t outputByteLen,
+ uint8_t *output
+)
+{
+ uint32_t rateInBytes = rate / (uint32_t)8U;
+ uint64_t s[25U] = { 0U };
+ absorb(s, rateInBytes, inputByteLen, input, delimitedSuffix);
+ Hacl_Impl_SHA3_squeeze(s, rateInBytes, outputByteLen, output);
+}
+
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h
new file mode 100644
index 00000000000..681b6af4a80
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Hash_SHA3.h
@@ -0,0 +1,130 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __Hacl_Hash_SHA3_H
+#define __Hacl_Hash_SHA3_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "Hacl_Streaming_Types.h"
+
+typedef struct Hacl_Streaming_Keccak_hash_buf_s
+{
+ Spec_Hash_Definitions_hash_alg fst;
+ uint64_t *snd;
+}
+Hacl_Streaming_Keccak_hash_buf;
+
+typedef struct Hacl_Streaming_Keccak_state_s
+{
+ Hacl_Streaming_Keccak_hash_buf block_state;
+ uint8_t *buf;
+ uint64_t total_len;
+}
+Hacl_Streaming_Keccak_state;
+
+Spec_Hash_Definitions_hash_alg Hacl_Streaming_Keccak_get_alg(Hacl_Streaming_Keccak_state *s);
+
+Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_hash_alg a);
+
+void Hacl_Streaming_Keccak_free(Hacl_Streaming_Keccak_state *s);
+
+Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_copy(Hacl_Streaming_Keccak_state *s0);
+
+void Hacl_Streaming_Keccak_reset(Hacl_Streaming_Keccak_state *s);
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_Keccak_update(Hacl_Streaming_Keccak_state *p, uint8_t *data, uint32_t len);
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_Keccak_finish(Hacl_Streaming_Keccak_state *s, uint8_t *dst);
+
+Hacl_Streaming_Types_error_code
+Hacl_Streaming_Keccak_squeeze(Hacl_Streaming_Keccak_state *s, uint8_t *dst, uint32_t l);
+
+uint32_t Hacl_Streaming_Keccak_block_len(Hacl_Streaming_Keccak_state *s);
+
+uint32_t Hacl_Streaming_Keccak_hash_len(Hacl_Streaming_Keccak_state *s);
+
+bool Hacl_Streaming_Keccak_is_shake(Hacl_Streaming_Keccak_state *s);
+
+void
+Hacl_SHA3_shake128_hacl(
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint32_t outputByteLen,
+ uint8_t *output
+);
+
+void
+Hacl_SHA3_shake256_hacl(
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint32_t outputByteLen,
+ uint8_t *output
+);
+
+void Hacl_SHA3_sha3_224(uint32_t inputByteLen, uint8_t *input, uint8_t *output);
+
+void Hacl_SHA3_sha3_256(uint32_t inputByteLen, uint8_t *input, uint8_t *output);
+
+void Hacl_SHA3_sha3_384(uint32_t inputByteLen, uint8_t *input, uint8_t *output);
+
+void Hacl_SHA3_sha3_512(uint32_t inputByteLen, uint8_t *input, uint8_t *output);
+
+void Hacl_Impl_SHA3_absorb_inner(uint32_t rateInBytes, uint8_t *block, uint64_t *s);
+
+void
+Hacl_Impl_SHA3_squeeze(
+ uint64_t *s,
+ uint32_t rateInBytes,
+ uint32_t outputByteLen,
+ uint8_t *output
+);
+
+void
+Hacl_Impl_SHA3_keccak(
+ uint32_t rate,
+ uint32_t capacity,
+ uint32_t inputByteLen,
+ uint8_t *input,
+ uint8_t delimitedSuffix,
+ uint32_t outputByteLen,
+ uint8_t *output
+);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __Hacl_Hash_SHA3_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h b/contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h
new file mode 100644
index 00000000000..15ef16ba607
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/Hacl_Streaming_Types.h
@@ -0,0 +1,83 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __Hacl_Streaming_Types_H
+#define __Hacl_Streaming_Types_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#define Spec_Hash_Definitions_SHA2_224 0
+#define Spec_Hash_Definitions_SHA2_256 1
+#define Spec_Hash_Definitions_SHA2_384 2
+#define Spec_Hash_Definitions_SHA2_512 3
+#define Spec_Hash_Definitions_SHA1 4
+#define Spec_Hash_Definitions_MD5 5
+#define Spec_Hash_Definitions_Blake2S 6
+#define Spec_Hash_Definitions_Blake2B 7
+#define Spec_Hash_Definitions_SHA3_256 8
+#define Spec_Hash_Definitions_SHA3_224 9
+#define Spec_Hash_Definitions_SHA3_384 10
+#define Spec_Hash_Definitions_SHA3_512 11
+#define Spec_Hash_Definitions_Shake128 12
+#define Spec_Hash_Definitions_Shake256 13
+
+typedef uint8_t Spec_Hash_Definitions_hash_alg;
+
+#define Hacl_Streaming_Types_Success 0
+#define Hacl_Streaming_Types_InvalidAlgorithm 1
+#define Hacl_Streaming_Types_InvalidLength 2
+#define Hacl_Streaming_Types_MaximumLengthExceeded 3
+
+typedef uint8_t Hacl_Streaming_Types_error_code;
+
+typedef struct Hacl_Streaming_MD_state_32_s
+{
+ uint32_t *block_state;
+ uint8_t *buf;
+ uint64_t total_len;
+}
+Hacl_Streaming_MD_state_32;
+
+typedef struct Hacl_Streaming_MD_state_64_s
+{
+ uint64_t *block_state;
+ uint8_t *buf;
+ uint64_t total_len;
+}
+Hacl_Streaming_MD_state_64;
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __Hacl_Streaming_Types_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h
new file mode 100644
index 00000000000..3d36d440735
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt128_Verified.h
@@ -0,0 +1,346 @@
+/*
+ Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
+ Licensed under the Apache 2.0 License.
+*/
+
+
+#ifndef __FStar_UInt128_Verified_H
+#define __FStar_UInt128_Verified_H
+
+#include "FStar_UInt_8_16_32_64.h"
+#include <inttypes.h>
+#include <stdbool.h>
+#include "krml/types.h"
+#include "krml/internal/target.h"
+
+static inline uint64_t FStar_UInt128_constant_time_carry(uint64_t a, uint64_t b)
+{
+ return (a ^ ((a ^ b) | ((a - b) ^ b))) >> (uint32_t)63U;
+}
+
+static inline uint64_t FStar_UInt128_carry(uint64_t a, uint64_t b)
+{
+ return FStar_UInt128_constant_time_carry(a, b);
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low + b.low;
+ lit.high = a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_add_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low + b.low;
+ lit.high = a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low + b.low;
+ lit.high = a.high + b.high + FStar_UInt128_carry(a.low + b.low, b.low);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_sub(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low - b.low;
+ lit.high = a.high - b.high - FStar_UInt128_carry(a.low, a.low - b.low);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_sub_underspec(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low - b.low;
+ lit.high = a.high - b.high - FStar_UInt128_carry(a.low, a.low - b.low);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_sub_mod_impl(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low - b.low;
+ lit.high = a.high - b.high - FStar_UInt128_carry(a.low, a.low - b.low);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_sub_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ return FStar_UInt128_sub_mod_impl(a, b);
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_logand(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low & b.low;
+ lit.high = a.high & b.high;
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_logxor(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low ^ b.low;
+ lit.high = a.high ^ b.high;
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_logor(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low | b.low;
+ lit.high = a.high | b.high;
+ return lit;
+}
+
+static inline FStar_UInt128_uint128 FStar_UInt128_lognot(FStar_UInt128_uint128 a)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = ~a.low;
+ lit.high = ~a.high;
+ return lit;
+}
+
+static uint32_t FStar_UInt128_u32_64 = (uint32_t)64U;
+
+static inline uint64_t FStar_UInt128_add_u64_shift_left(uint64_t hi, uint64_t lo, uint32_t s)
+{
+ return (hi << s) + (lo >> (FStar_UInt128_u32_64 - s));
+}
+
+static inline uint64_t
+FStar_UInt128_add_u64_shift_left_respec(uint64_t hi, uint64_t lo, uint32_t s)
+{
+ return FStar_UInt128_add_u64_shift_left(hi, lo, s);
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_shift_left_small(FStar_UInt128_uint128 a, uint32_t s)
+{
+ if (s == (uint32_t)0U)
+ {
+ return a;
+ }
+ else
+ {
+ FStar_UInt128_uint128 lit;
+ lit.low = a.low << s;
+ lit.high = FStar_UInt128_add_u64_shift_left_respec(a.high, a.low, s);
+ return lit;
+ }
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_shift_left_large(FStar_UInt128_uint128 a, uint32_t s)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = (uint64_t)0U;
+ lit.high = a.low << (s - FStar_UInt128_u32_64);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_shift_left(FStar_UInt128_uint128 a, uint32_t s)
+{
+ if (s < FStar_UInt128_u32_64)
+ {
+ return FStar_UInt128_shift_left_small(a, s);
+ }
+ else
+ {
+ return FStar_UInt128_shift_left_large(a, s);
+ }
+}
+
+static inline uint64_t FStar_UInt128_add_u64_shift_right(uint64_t hi, uint64_t lo, uint32_t s)
+{
+ return (lo >> s) + (hi << (FStar_UInt128_u32_64 - s));
+}
+
+static inline uint64_t
+FStar_UInt128_add_u64_shift_right_respec(uint64_t hi, uint64_t lo, uint32_t s)
+{
+ return FStar_UInt128_add_u64_shift_right(hi, lo, s);
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_shift_right_small(FStar_UInt128_uint128 a, uint32_t s)
+{
+ if (s == (uint32_t)0U)
+ {
+ return a;
+ }
+ else
+ {
+ FStar_UInt128_uint128 lit;
+ lit.low = FStar_UInt128_add_u64_shift_right_respec(a.high, a.low, s);
+ lit.high = a.high >> s;
+ return lit;
+ }
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_shift_right_large(FStar_UInt128_uint128 a, uint32_t s)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a.high >> (s - FStar_UInt128_u32_64);
+ lit.high = (uint64_t)0U;
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_shift_right(FStar_UInt128_uint128 a, uint32_t s)
+{
+ if (s < FStar_UInt128_u32_64)
+ {
+ return FStar_UInt128_shift_right_small(a, s);
+ }
+ else
+ {
+ return FStar_UInt128_shift_right_large(a, s);
+ }
+}
+
+static inline bool FStar_UInt128_eq(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ return a.low == b.low && a.high == b.high;
+}
+
+static inline bool FStar_UInt128_gt(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ return a.high > b.high || (a.high == b.high && a.low > b.low);
+}
+
+static inline bool FStar_UInt128_lt(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ return a.high < b.high || (a.high == b.high && a.low < b.low);
+}
+
+static inline bool FStar_UInt128_gte(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ return a.high > b.high || (a.high == b.high && a.low >= b.low);
+}
+
+static inline bool FStar_UInt128_lte(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ return a.high < b.high || (a.high == b.high && a.low <= b.low);
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_eq_mask(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = FStar_UInt64_eq_mask(a.low, b.low) & FStar_UInt64_eq_mask(a.high, b.high);
+ lit.high = FStar_UInt64_eq_mask(a.low, b.low) & FStar_UInt64_eq_mask(a.high, b.high);
+ return lit;
+}
+
+static inline FStar_UInt128_uint128
+FStar_UInt128_gte_mask(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low =
+ (FStar_UInt64_gte_mask(a.high, b.high) & ~FStar_UInt64_eq_mask(a.high, b.high))
+ | (FStar_UInt64_eq_mask(a.high, b.high) & FStar_UInt64_gte_mask(a.low, b.low));
+ lit.high =
+ (FStar_UInt64_gte_mask(a.high, b.high) & ~FStar_UInt64_eq_mask(a.high, b.high))
+ | (FStar_UInt64_eq_mask(a.high, b.high) & FStar_UInt64_gte_mask(a.low, b.low));
+ return lit;
+}
+
+static inline FStar_UInt128_uint128 FStar_UInt128_uint64_to_uint128(uint64_t a)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low = a;
+ lit.high = (uint64_t)0U;
+ return lit;
+}
+
+static inline uint64_t FStar_UInt128_uint128_to_uint64(FStar_UInt128_uint128 a)
+{
+ return a.low;
+}
+
+static inline uint64_t FStar_UInt128_u64_mod_32(uint64_t a)
+{
+ return a & (uint64_t)0xffffffffU;
+}
+
+static uint32_t FStar_UInt128_u32_32 = (uint32_t)32U;
+
+static inline uint64_t FStar_UInt128_u32_combine(uint64_t hi, uint64_t lo)
+{
+ return lo + (hi << FStar_UInt128_u32_32);
+}
+
+static inline FStar_UInt128_uint128 FStar_UInt128_mul32(uint64_t x, uint32_t y)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low =
+ FStar_UInt128_u32_combine((x >> FStar_UInt128_u32_32)
+ * (uint64_t)y
+ + (FStar_UInt128_u64_mod_32(x) * (uint64_t)y >> FStar_UInt128_u32_32),
+ FStar_UInt128_u64_mod_32(FStar_UInt128_u64_mod_32(x) * (uint64_t)y));
+ lit.high =
+ ((x >> FStar_UInt128_u32_32)
+ * (uint64_t)y
+ + (FStar_UInt128_u64_mod_32(x) * (uint64_t)y >> FStar_UInt128_u32_32))
+ >> FStar_UInt128_u32_32;
+ return lit;
+}
+
+static inline uint64_t FStar_UInt128_u32_combine_(uint64_t hi, uint64_t lo)
+{
+ return lo + (hi << FStar_UInt128_u32_32);
+}
+
+static inline FStar_UInt128_uint128 FStar_UInt128_mul_wide(uint64_t x, uint64_t y)
+{
+ FStar_UInt128_uint128 lit;
+ lit.low =
+ FStar_UInt128_u32_combine_(FStar_UInt128_u64_mod_32(x)
+ * (y >> FStar_UInt128_u32_32)
+ +
+ FStar_UInt128_u64_mod_32((x >> FStar_UInt128_u32_32)
+ * FStar_UInt128_u64_mod_32(y)
+ + (FStar_UInt128_u64_mod_32(x) * FStar_UInt128_u64_mod_32(y) >> FStar_UInt128_u32_32)),
+ FStar_UInt128_u64_mod_32(FStar_UInt128_u64_mod_32(x) * FStar_UInt128_u64_mod_32(y)));
+ lit.high =
+ (x >> FStar_UInt128_u32_32)
+ * (y >> FStar_UInt128_u32_32)
+ +
+ (((x >> FStar_UInt128_u32_32)
+ * FStar_UInt128_u64_mod_32(y)
+ + (FStar_UInt128_u64_mod_32(x) * FStar_UInt128_u64_mod_32(y) >> FStar_UInt128_u32_32))
+ >> FStar_UInt128_u32_32)
+ +
+ ((FStar_UInt128_u64_mod_32(x)
+ * (y >> FStar_UInt128_u32_32)
+ +
+ FStar_UInt128_u64_mod_32((x >> FStar_UInt128_u32_32)
+ * FStar_UInt128_u64_mod_32(y)
+ + (FStar_UInt128_u64_mod_32(x) * FStar_UInt128_u64_mod_32(y) >> FStar_UInt128_u32_32)))
+ >> FStar_UInt128_u32_32);
+ return lit;
+}
+
+
+#define __FStar_UInt128_Verified_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h
new file mode 100644
index 00000000000..a56c7d61349
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h
@@ -0,0 +1,107 @@
+/*
+ Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
+ Licensed under the Apache 2.0 License.
+*/
+
+
+#ifndef __FStar_UInt_8_16_32_64_H
+#define __FStar_UInt_8_16_32_64_H
+
+#include <inttypes.h>
+#include <stdbool.h>
+
+#include "krml/lowstar_endianness.h"
+#include "krml/types.h"
+#include "krml/internal/target.h"
+
+static inline uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b)
+{
+ uint64_t x = a ^ b;
+ uint64_t minus_x = ~x + (uint64_t)1U;
+ uint64_t x_or_minus_x = x | minus_x;
+ uint64_t xnx = x_or_minus_x >> (uint32_t)63U;
+ return xnx - (uint64_t)1U;
+}
+
+static inline uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b)
+{
+ uint64_t x = a;
+ uint64_t y = b;
+ uint64_t x_xor_y = x ^ y;
+ uint64_t x_sub_y = x - y;
+ uint64_t x_sub_y_xor_y = x_sub_y ^ y;
+ uint64_t q = x_xor_y | x_sub_y_xor_y;
+ uint64_t x_xor_q = x ^ q;
+ uint64_t x_xor_q_ = x_xor_q >> (uint32_t)63U;
+ return x_xor_q_ - (uint64_t)1U;
+}
+
+static inline uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b)
+{
+ uint32_t x = a ^ b;
+ uint32_t minus_x = ~x + (uint32_t)1U;
+ uint32_t x_or_minus_x = x | minus_x;
+ uint32_t xnx = x_or_minus_x >> (uint32_t)31U;
+ return xnx - (uint32_t)1U;
+}
+
+static inline uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b)
+{
+ uint32_t x = a;
+ uint32_t y = b;
+ uint32_t x_xor_y = x ^ y;
+ uint32_t x_sub_y = x - y;
+ uint32_t x_sub_y_xor_y = x_sub_y ^ y;
+ uint32_t q = x_xor_y | x_sub_y_xor_y;
+ uint32_t x_xor_q = x ^ q;
+ uint32_t x_xor_q_ = x_xor_q >> (uint32_t)31U;
+ return x_xor_q_ - (uint32_t)1U;
+}
+
+static inline uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b)
+{
+ uint16_t x = a ^ b;
+ uint16_t minus_x = ~x + (uint16_t)1U;
+ uint16_t x_or_minus_x = x | minus_x;
+ uint16_t xnx = x_or_minus_x >> (uint32_t)15U;
+ return xnx - (uint16_t)1U;
+}
+
+static inline uint16_t FStar_UInt16_gte_mask(uint16_t a, uint16_t b)
+{
+ uint16_t x = a;
+ uint16_t y = b;
+ uint16_t x_xor_y = x ^ y;
+ uint16_t x_sub_y = x - y;
+ uint16_t x_sub_y_xor_y = x_sub_y ^ y;
+ uint16_t q = x_xor_y | x_sub_y_xor_y;
+ uint16_t x_xor_q = x ^ q;
+ uint16_t x_xor_q_ = x_xor_q >> (uint32_t)15U;
+ return x_xor_q_ - (uint16_t)1U;
+}
+
+static inline uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b)
+{
+ uint8_t x = a ^ b;
+ uint8_t minus_x = ~x + (uint8_t)1U;
+ uint8_t x_or_minus_x = x | minus_x;
+ uint8_t xnx = x_or_minus_x >> (uint32_t)7U;
+ return xnx - (uint8_t)1U;
+}
+
+static inline uint8_t FStar_UInt8_gte_mask(uint8_t a, uint8_t b)
+{
+ uint8_t x = a;
+ uint8_t y = b;
+ uint8_t x_xor_y = x ^ y;
+ uint8_t x_sub_y = x - y;
+ uint8_t x_sub_y_xor_y = x_sub_y ^ y;
+ uint8_t q = x_xor_y | x_sub_y_xor_y;
+ uint8_t x_xor_q = x ^ q;
+ uint8_t x_xor_q_ = x_xor_q >> (uint32_t)7U;
+ return x_xor_q_ - (uint8_t)1U;
+}
+
+
+#define __FStar_UInt_8_16_32_64_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h b/contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h
new file mode 100644
index 00000000000..e2b6d62859a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h
@@ -0,0 +1,68 @@
+/* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
+ Licensed under the Apache 2.0 License. */
+
+#ifndef FSTAR_UINT128_STRUCT_ENDIANNESS_H
+#define FSTAR_UINT128_STRUCT_ENDIANNESS_H
+
+/* Hand-written implementation of endianness-related uint128 functions
+ * for the extracted uint128 implementation */
+
+/* Access 64-bit fields within the int128. */
+#define HIGH64_OF(x) ((x)->high)
+#define LOW64_OF(x) ((x)->low)
+
+/* A series of definitions written using pointers. */
+
+inline static void load128_le_(uint8_t *b, uint128_t *r) {
+ LOW64_OF(r) = load64_le(b);
+ HIGH64_OF(r) = load64_le(b + 8);
+}
+
+inline static void store128_le_(uint8_t *b, uint128_t *n) {
+ store64_le(b, LOW64_OF(n));
+ store64_le(b + 8, HIGH64_OF(n));
+}
+
+inline static void load128_be_(uint8_t *b, uint128_t *r) {
+ HIGH64_OF(r) = load64_be(b);
+ LOW64_OF(r) = load64_be(b + 8);
+}
+
+inline static void store128_be_(uint8_t *b, uint128_t *n) {
+ store64_be(b, HIGH64_OF(n));
+ store64_be(b + 8, LOW64_OF(n));
+}
+
+#ifndef KRML_NOSTRUCT_PASSING
+
+inline static uint128_t load128_le(uint8_t *b) {
+ uint128_t r;
+ load128_le_(b, &r);
+ return r;
+}
+
+inline static void store128_le(uint8_t *b, uint128_t n) {
+ store128_le_(b, &n);
+}
+
+inline static uint128_t load128_be(uint8_t *b) {
+ uint128_t r;
+ load128_be_(b, &r);
+ return r;
+}
+
+inline static void store128_be(uint8_t *b, uint128_t n) {
+ store128_be_(b, &n);
+}
+
+#else /* !defined(KRML_STRUCT_PASSING) */
+
+# define print128 print128_
+# define load128_le load128_le_
+# define store128_le store128_le_
+# define load128_be load128_be_
+# define store128_be store128_be_
+
+#endif /* KRML_STRUCT_PASSING */
+
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h b/contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h
new file mode 100644
index 00000000000..5a2f94eb2ec
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/internal/target.h
@@ -0,0 +1,266 @@
+/* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
+ Licensed under the Apache 2.0 License. */
+
+#ifndef __KRML_TARGET_H
+#define __KRML_TARGET_H
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <assert.h>
+
+/* Since KaRaMeL emits the inline keyword unconditionally, we follow the
+ * guidelines at https://gcc.gnu.org/onlinedocs/gcc/Inline.html and make this
+ * __inline__ to ensure the code compiles with -std=c90 and earlier. */
+#ifdef __GNUC__
+# define inline __inline__
+#endif
+
+/******************************************************************************/
+/* Macros that KaRaMeL will generate. */
+/******************************************************************************/
+
+/* For "bare" targets that do not have a C stdlib, the user might want to use
+ * [-add-early-include '"mydefinitions.h"'] and override these. */
+#ifndef KRML_HOST_PRINTF
+# define KRML_HOST_PRINTF printf
+#endif
+
+#if ( \
+ (defined __STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
+ (!(defined KRML_HOST_EPRINTF)))
+# define KRML_HOST_EPRINTF(...) fprintf(stderr, __VA_ARGS__)
+#elif !(defined KRML_HOST_EPRINTF) && defined(_MSC_VER)
+# define KRML_HOST_EPRINTF(...) fprintf(stderr, __VA_ARGS__)
+#endif
+
+#ifndef KRML_HOST_EXIT
+# define KRML_HOST_EXIT exit
+#endif
+
+#ifndef KRML_HOST_MALLOC
+# define KRML_HOST_MALLOC malloc
+#endif
+
+#ifndef KRML_HOST_CALLOC
+# define KRML_HOST_CALLOC calloc
+#endif
+
+#ifndef KRML_HOST_FREE
+# define KRML_HOST_FREE free
+#endif
+
+#ifndef KRML_HOST_IGNORE
+# define KRML_HOST_IGNORE(x) (void)(x)
+#endif
+
+/* In FStar.Buffer.fst, the size of arrays is uint32_t, but it's a number of
+ * *elements*. Do an ugly, run-time check (some of which KaRaMeL can eliminate).
+ */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))
+# define _KRML_CHECK_SIZE_PRAGMA \
+ _Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
+#else
+# define _KRML_CHECK_SIZE_PRAGMA
+#endif
+
+#define KRML_CHECK_SIZE(size_elt, sz) \
+ do { \
+ _KRML_CHECK_SIZE_PRAGMA \
+ if (((size_t)(sz)) > ((size_t)(SIZE_MAX / (size_elt)))) { \
+ KRML_HOST_PRINTF( \
+ "Maximum allocatable size exceeded, aborting before overflow at " \
+ "%s:%d\n", \
+ __FILE__, __LINE__); \
+ KRML_HOST_EXIT(253); \
+ } \
+ } while (0)
+
+/* Macros for prettier unrolling of loops */
+#define KRML_LOOP1(i, n, x) { \
+ x \
+ i += n; \
+}
+
+#define KRML_LOOP2(i, n, x) \
+ KRML_LOOP1(i, n, x) \
+ KRML_LOOP1(i, n, x)
+
+#define KRML_LOOP3(i, n, x) \
+ KRML_LOOP2(i, n, x) \
+ KRML_LOOP1(i, n, x)
+
+#define KRML_LOOP4(i, n, x) \
+ KRML_LOOP2(i, n, x) \
+ KRML_LOOP2(i, n, x)
+
+#define KRML_LOOP5(i, n, x) \
+ KRML_LOOP4(i, n, x) \
+ KRML_LOOP1(i, n, x)
+
+#define KRML_LOOP6(i, n, x) \
+ KRML_LOOP4(i, n, x) \
+ KRML_LOOP2(i, n, x)
+
+#define KRML_LOOP7(i, n, x) \
+ KRML_LOOP4(i, n, x) \
+ KRML_LOOP3(i, n, x)
+
+#define KRML_LOOP8(i, n, x) \
+ KRML_LOOP4(i, n, x) \
+ KRML_LOOP4(i, n, x)
+
+#define KRML_LOOP9(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP1(i, n, x)
+
+#define KRML_LOOP10(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP2(i, n, x)
+
+#define KRML_LOOP11(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP3(i, n, x)
+
+#define KRML_LOOP12(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP4(i, n, x)
+
+#define KRML_LOOP13(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP5(i, n, x)
+
+#define KRML_LOOP14(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP6(i, n, x)
+
+#define KRML_LOOP15(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP7(i, n, x)
+
+#define KRML_LOOP16(i, n, x) \
+ KRML_LOOP8(i, n, x) \
+ KRML_LOOP8(i, n, x)
+
+#define KRML_UNROLL_FOR(i, z, n, k, x) do { \
+ uint32_t i = z; \
+ KRML_LOOP##n(i, k, x) \
+} while (0)
+
+#define KRML_ACTUAL_FOR(i, z, n, k, x) \
+ do { \
+ for (uint32_t i = z; i < n; i += k) { \
+ x \
+ } \
+ } while (0)
+
+#ifndef KRML_UNROLL_MAX
+#define KRML_UNROLL_MAX 16
+#endif
+
+/* 1 is the number of loop iterations, i.e. (n - z)/k as evaluated by krml */
+#if 0 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR0(i, z, n, k, x)
+#else
+#define KRML_MAYBE_FOR0(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 1 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 1, k, x)
+#else
+#define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 2 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
+#else
+#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 3 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
+#else
+#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 4 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
+#else
+#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 5 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
+#else
+#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 6 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
+#else
+#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 7 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x)
+#else
+#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 8 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 8, k, x)
+#else
+#define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 9 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
+#else
+#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 10 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 10, k, x)
+#else
+#define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 11 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 11, k, x)
+#else
+#define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 12 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 12, k, x)
+#else
+#define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 13 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 13, k, x)
+#else
+#define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 14 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 14, k, x)
+#else
+#define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 15 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
+#else
+#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+
+#if 16 <= KRML_UNROLL_MAX
+#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
+#else
+#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
+#endif
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h b/contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h
new file mode 100644
index 00000000000..b6c648602b9
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/lowstar_endianness.h
@@ -0,0 +1,231 @@
+/* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
+ Licensed under the Apache 2.0 License. */
+
+#ifndef __LOWSTAR_ENDIANNESS_H
+#define __LOWSTAR_ENDIANNESS_H
+
+#include <string.h>
+#include <inttypes.h>
+
+/******************************************************************************/
+/* Implementing C.fst (part 2: endian-ness macros) */
+/******************************************************************************/
+
+/* ... for Linux */
+#if defined(__linux__) || defined(__CYGWIN__) || defined (__USE_SYSTEM_ENDIAN_H__) || defined(__GLIBC__)
+# include <endian.h>
+
+/* ... for OSX */
+#elif defined(__APPLE__)
+# include <libkern/OSByteOrder.h>
+# define htole64(x) OSSwapHostToLittleInt64(x)
+# define le64toh(x) OSSwapLittleToHostInt64(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define be64toh(x) OSSwapBigToHostInt64(x)
+
+# define htole16(x) OSSwapHostToLittleInt16(x)
+# define le16toh(x) OSSwapLittleToHostInt16(x)
+# define htobe16(x) OSSwapHostToBigInt16(x)
+# define be16toh(x) OSSwapBigToHostInt16(x)
+
+# define htole32(x) OSSwapHostToLittleInt32(x)
+# define le32toh(x) OSSwapLittleToHostInt32(x)
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define be32toh(x) OSSwapBigToHostInt32(x)
+
+/* ... for Solaris */
+#elif defined(__sun__)
+# error #include <sys/byteorder.h>
+# define htole64(x) LE_64(x)
+# define le64toh(x) LE_64(x)
+# define htobe64(x) BE_64(x)
+# define be64toh(x) BE_64(x)
+
+# define htole16(x) LE_16(x)
+# define le16toh(x) LE_16(x)
+# define htobe16(x) BE_16(x)
+# define be16toh(x) BE_16(x)
+
+# define htole32(x) LE_32(x)
+# define le32toh(x) LE_32(x)
+# define htobe32(x) BE_32(x)
+# define be32toh(x) BE_32(x)
+
+/* ... for the BSDs */
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+# include <sys/endian.h>
+#elif defined(__OpenBSD__)
+# include <endian.h>
+
+/* ... for Windows (MSVC)... not targeting XBOX 360! */
+#elif defined(_MSC_VER)
+
+# include <stdlib.h>
+# define htobe16(x) _byteswap_ushort(x)
+# define htole16(x) (x)
+# define be16toh(x) _byteswap_ushort(x)
+# define le16toh(x) (x)
+
+# define htobe32(x) _byteswap_ulong(x)
+# define htole32(x) (x)
+# define be32toh(x) _byteswap_ulong(x)
+# define le32toh(x) (x)
+
+# define htobe64(x) _byteswap_uint64(x)
+# define htole64(x) (x)
+# define be64toh(x) _byteswap_uint64(x)
+# define le64toh(x) (x)
+
+/* ... for Windows (GCC-like, e.g. mingw or clang) */
+#elif (defined(_WIN32) || defined(_WIN64) || defined(__EMSCRIPTEN__)) && \
+ (defined(__GNUC__) || defined(__clang__))
+
+# define htobe16(x) __builtin_bswap16(x)
+# define htole16(x) (x)
+# define be16toh(x) __builtin_bswap16(x)
+# define le16toh(x) (x)
+
+# define htobe32(x) __builtin_bswap32(x)
+# define htole32(x) (x)
+# define be32toh(x) __builtin_bswap32(x)
+# define le32toh(x) (x)
+
+# define htobe64(x) __builtin_bswap64(x)
+# define htole64(x) (x)
+# define be64toh(x) __builtin_bswap64(x)
+# define le64toh(x) (x)
+
+/* ... generic big-endian fallback code */
+/* ... AIX doesn't have __BYTE_ORDER__ (with XLC compiler) & is always big-endian */
+#elif (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || defined(_AIX)
+
+/* byte swapping code inspired by:
+ * https://github.com/rweather/arduinolibs/blob/master/libraries/Crypto/utility/EndianUtil.h
+ * */
+
+# define htobe32(x) (x)
+# define be32toh(x) (x)
+# define htole32(x) \
+ (__extension__({ \
+ uint32_t _temp = (x); \
+ ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
+ ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
+ }))
+# define le32toh(x) (htole32((x)))
+
+# define htobe64(x) (x)
+# define be64toh(x) (x)
+# define htole64(x) \
+ (__extension__({ \
+ uint64_t __temp = (x); \
+ uint32_t __low = htobe32((uint32_t)__temp); \
+ uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
+ (((uint64_t)__low) << 32) | __high; \
+ }))
+# define le64toh(x) (htole64((x)))
+
+/* ... generic little-endian fallback code */
+#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+
+# define htole32(x) (x)
+# define le32toh(x) (x)
+# define htobe32(x) \
+ (__extension__({ \
+ uint32_t _temp = (x); \
+ ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
+ ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
+ }))
+# define be32toh(x) (htobe32((x)))
+
+# define htole64(x) (x)
+# define le64toh(x) (x)
+# define htobe64(x) \
+ (__extension__({ \
+ uint64_t __temp = (x); \
+ uint32_t __low = htobe32((uint32_t)__temp); \
+ uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
+ (((uint64_t)__low) << 32) | __high; \
+ }))
+# define be64toh(x) (htobe64((x)))
+
+/* ... couldn't determine endian-ness of the target platform */
+#else
+# error "Please define __BYTE_ORDER__!"
+
+#endif /* defined(__linux__) || ... */
+
+/* Loads and stores. These avoid undefined behavior due to unaligned memory
+ * accesses, via memcpy. */
+
+inline static uint16_t load16(uint8_t *b) {
+ uint16_t x;
+ memcpy(&x, b, 2);
+ return x;
+}
+
+inline static uint32_t load32(uint8_t *b) {
+ uint32_t x;
+ memcpy(&x, b, 4);
+ return x;
+}
+
+inline static uint64_t load64(uint8_t *b) {
+ uint64_t x;
+ memcpy(&x, b, 8);
+ return x;
+}
+
+inline static void store16(uint8_t *b, uint16_t i) {
+ memcpy(b, &i, 2);
+}
+
+inline static void store32(uint8_t *b, uint32_t i) {
+ memcpy(b, &i, 4);
+}
+
+inline static void store64(uint8_t *b, uint64_t i) {
+ memcpy(b, &i, 8);
+}
+
+/* Legacy accessors so that this header can serve as an implementation of
+ * C.Endianness */
+#define load16_le(b) (le16toh(load16(b)))
+#define store16_le(b, i) (store16(b, htole16(i)))
+#define load16_be(b) (be16toh(load16(b)))
+#define store16_be(b, i) (store16(b, htobe16(i)))
+
+#define load32_le(b) (le32toh(load32(b)))
+#define store32_le(b, i) (store32(b, htole32(i)))
+#define load32_be(b) (be32toh(load32(b)))
+#define store32_be(b, i) (store32(b, htobe32(i)))
+
+#define load64_le(b) (le64toh(load64(b)))
+#define store64_le(b, i) (store64(b, htole64(i)))
+#define load64_be(b) (be64toh(load64(b)))
+#define store64_be(b, i) (store64(b, htobe64(i)))
+
+/* Co-existence of LowStar.Endianness and FStar.Endianness generates name
+ * conflicts, because of course both insist on having no prefixes. Until a
+ * prefix is added, or until we truly retire FStar.Endianness, solve this issue
+ * in an elegant way. */
+#define load16_le0 load16_le
+#define store16_le0 store16_le
+#define load16_be0 load16_be
+#define store16_be0 store16_be
+
+#define load32_le0 load32_le
+#define store32_le0 store32_le
+#define load32_be0 load32_be
+#define store32_be0 store32_be
+
+#define load64_le0 load64_le
+#define store64_le0 store64_le
+#define load64_be0 load64_be
+#define store64_be0 store64_be
+
+#define load128_le0 load128_le
+#define store128_le0 store128_le
+#define load128_be0 load128_be
+#define store128_be0 store128_be
+
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/include/krml/types.h b/contrib/tools/python3/Modules/_hacl/include/krml/types.h
new file mode 100644
index 00000000000..509f555536e
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/include/krml/types.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include <inttypes.h>
+
+typedef struct FStar_UInt128_uint128_s {
+ uint64_t low;
+ uint64_t high;
+} FStar_UInt128_uint128, uint128_t;
+
+#define KRML_VERIFIED_UINT128
+
+#include "krml/lowstar_endianness.h"
+#include "krml/fstar_uint128_struct_endianness.h"
+#include "krml/FStar_UInt128_Verified.h"
diff --git a/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h
new file mode 100644
index 00000000000..87ad4cf228d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_MD5.h
@@ -0,0 +1,61 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __internal_Hacl_Hash_MD5_H
+#define __internal_Hacl_Hash_MD5_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "../Hacl_Hash_MD5.h"
+
+void Hacl_Hash_Core_MD5_legacy_init(uint32_t *s);
+
+void Hacl_Hash_Core_MD5_legacy_finish(uint32_t *s, uint8_t *dst);
+
+void Hacl_Hash_MD5_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks);
+
+void
+Hacl_Hash_MD5_legacy_update_last(
+ uint32_t *s,
+ uint64_t prev_len,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+void Hacl_Hash_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __internal_Hacl_Hash_MD5_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h
new file mode 100644
index 00000000000..d2d9df44c6c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA1.h
@@ -0,0 +1,61 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __internal_Hacl_Hash_SHA1_H
+#define __internal_Hacl_Hash_SHA1_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "../Hacl_Hash_SHA1.h"
+
+void Hacl_Hash_Core_SHA1_legacy_init(uint32_t *s);
+
+void Hacl_Hash_Core_SHA1_legacy_finish(uint32_t *s, uint8_t *dst);
+
+void Hacl_Hash_SHA1_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks);
+
+void
+Hacl_Hash_SHA1_legacy_update_last(
+ uint32_t *s,
+ uint64_t prev_len,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+void Hacl_Hash_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __internal_Hacl_Hash_SHA1_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h
new file mode 100644
index 00000000000..851f7dc60c9
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA2.h
@@ -0,0 +1,184 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __internal_Hacl_Hash_SHA2_H
+#define __internal_Hacl_Hash_SHA2_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+
+#include "../Hacl_Hash_SHA2.h"
+
+static const
+uint32_t
+Hacl_Impl_SHA2_Generic_h224[8U] =
+ {
+ (uint32_t)0xc1059ed8U, (uint32_t)0x367cd507U, (uint32_t)0x3070dd17U, (uint32_t)0xf70e5939U,
+ (uint32_t)0xffc00b31U, (uint32_t)0x68581511U, (uint32_t)0x64f98fa7U, (uint32_t)0xbefa4fa4U
+ };
+
+static const
+uint32_t
+Hacl_Impl_SHA2_Generic_h256[8U] =
+ {
+ (uint32_t)0x6a09e667U, (uint32_t)0xbb67ae85U, (uint32_t)0x3c6ef372U, (uint32_t)0xa54ff53aU,
+ (uint32_t)0x510e527fU, (uint32_t)0x9b05688cU, (uint32_t)0x1f83d9abU, (uint32_t)0x5be0cd19U
+ };
+
+static const
+uint64_t
+Hacl_Impl_SHA2_Generic_h384[8U] =
+ {
+ (uint64_t)0xcbbb9d5dc1059ed8U, (uint64_t)0x629a292a367cd507U, (uint64_t)0x9159015a3070dd17U,
+ (uint64_t)0x152fecd8f70e5939U, (uint64_t)0x67332667ffc00b31U, (uint64_t)0x8eb44a8768581511U,
+ (uint64_t)0xdb0c2e0d64f98fa7U, (uint64_t)0x47b5481dbefa4fa4U
+ };
+
+static const
+uint64_t
+Hacl_Impl_SHA2_Generic_h512[8U] =
+ {
+ (uint64_t)0x6a09e667f3bcc908U, (uint64_t)0xbb67ae8584caa73bU, (uint64_t)0x3c6ef372fe94f82bU,
+ (uint64_t)0xa54ff53a5f1d36f1U, (uint64_t)0x510e527fade682d1U, (uint64_t)0x9b05688c2b3e6c1fU,
+ (uint64_t)0x1f83d9abfb41bd6bU, (uint64_t)0x5be0cd19137e2179U
+ };
+
+static const
+uint32_t
+Hacl_Impl_SHA2_Generic_k224_256[64U] =
+ {
+ (uint32_t)0x428a2f98U, (uint32_t)0x71374491U, (uint32_t)0xb5c0fbcfU, (uint32_t)0xe9b5dba5U,
+ (uint32_t)0x3956c25bU, (uint32_t)0x59f111f1U, (uint32_t)0x923f82a4U, (uint32_t)0xab1c5ed5U,
+ (uint32_t)0xd807aa98U, (uint32_t)0x12835b01U, (uint32_t)0x243185beU, (uint32_t)0x550c7dc3U,
+ (uint32_t)0x72be5d74U, (uint32_t)0x80deb1feU, (uint32_t)0x9bdc06a7U, (uint32_t)0xc19bf174U,
+ (uint32_t)0xe49b69c1U, (uint32_t)0xefbe4786U, (uint32_t)0x0fc19dc6U, (uint32_t)0x240ca1ccU,
+ (uint32_t)0x2de92c6fU, (uint32_t)0x4a7484aaU, (uint32_t)0x5cb0a9dcU, (uint32_t)0x76f988daU,
+ (uint32_t)0x983e5152U, (uint32_t)0xa831c66dU, (uint32_t)0xb00327c8U, (uint32_t)0xbf597fc7U,
+ (uint32_t)0xc6e00bf3U, (uint32_t)0xd5a79147U, (uint32_t)0x06ca6351U, (uint32_t)0x14292967U,
+ (uint32_t)0x27b70a85U, (uint32_t)0x2e1b2138U, (uint32_t)0x4d2c6dfcU, (uint32_t)0x53380d13U,
+ (uint32_t)0x650a7354U, (uint32_t)0x766a0abbU, (uint32_t)0x81c2c92eU, (uint32_t)0x92722c85U,
+ (uint32_t)0xa2bfe8a1U, (uint32_t)0xa81a664bU, (uint32_t)0xc24b8b70U, (uint32_t)0xc76c51a3U,
+ (uint32_t)0xd192e819U, (uint32_t)0xd6990624U, (uint32_t)0xf40e3585U, (uint32_t)0x106aa070U,
+ (uint32_t)0x19a4c116U, (uint32_t)0x1e376c08U, (uint32_t)0x2748774cU, (uint32_t)0x34b0bcb5U,
+ (uint32_t)0x391c0cb3U, (uint32_t)0x4ed8aa4aU, (uint32_t)0x5b9cca4fU, (uint32_t)0x682e6ff3U,
+ (uint32_t)0x748f82eeU, (uint32_t)0x78a5636fU, (uint32_t)0x84c87814U, (uint32_t)0x8cc70208U,
+ (uint32_t)0x90befffaU, (uint32_t)0xa4506cebU, (uint32_t)0xbef9a3f7U, (uint32_t)0xc67178f2U
+ };
+
+static const
+uint64_t
+Hacl_Impl_SHA2_Generic_k384_512[80U] =
+ {
+ (uint64_t)0x428a2f98d728ae22U, (uint64_t)0x7137449123ef65cdU, (uint64_t)0xb5c0fbcfec4d3b2fU,
+ (uint64_t)0xe9b5dba58189dbbcU, (uint64_t)0x3956c25bf348b538U, (uint64_t)0x59f111f1b605d019U,
+ (uint64_t)0x923f82a4af194f9bU, (uint64_t)0xab1c5ed5da6d8118U, (uint64_t)0xd807aa98a3030242U,
+ (uint64_t)0x12835b0145706fbeU, (uint64_t)0x243185be4ee4b28cU, (uint64_t)0x550c7dc3d5ffb4e2U,
+ (uint64_t)0x72be5d74f27b896fU, (uint64_t)0x80deb1fe3b1696b1U, (uint64_t)0x9bdc06a725c71235U,
+ (uint64_t)0xc19bf174cf692694U, (uint64_t)0xe49b69c19ef14ad2U, (uint64_t)0xefbe4786384f25e3U,
+ (uint64_t)0x0fc19dc68b8cd5b5U, (uint64_t)0x240ca1cc77ac9c65U, (uint64_t)0x2de92c6f592b0275U,
+ (uint64_t)0x4a7484aa6ea6e483U, (uint64_t)0x5cb0a9dcbd41fbd4U, (uint64_t)0x76f988da831153b5U,
+ (uint64_t)0x983e5152ee66dfabU, (uint64_t)0xa831c66d2db43210U, (uint64_t)0xb00327c898fb213fU,
+ (uint64_t)0xbf597fc7beef0ee4U, (uint64_t)0xc6e00bf33da88fc2U, (uint64_t)0xd5a79147930aa725U,
+ (uint64_t)0x06ca6351e003826fU, (uint64_t)0x142929670a0e6e70U, (uint64_t)0x27b70a8546d22ffcU,
+ (uint64_t)0x2e1b21385c26c926U, (uint64_t)0x4d2c6dfc5ac42aedU, (uint64_t)0x53380d139d95b3dfU,
+ (uint64_t)0x650a73548baf63deU, (uint64_t)0x766a0abb3c77b2a8U, (uint64_t)0x81c2c92e47edaee6U,
+ (uint64_t)0x92722c851482353bU, (uint64_t)0xa2bfe8a14cf10364U, (uint64_t)0xa81a664bbc423001U,
+ (uint64_t)0xc24b8b70d0f89791U, (uint64_t)0xc76c51a30654be30U, (uint64_t)0xd192e819d6ef5218U,
+ (uint64_t)0xd69906245565a910U, (uint64_t)0xf40e35855771202aU, (uint64_t)0x106aa07032bbd1b8U,
+ (uint64_t)0x19a4c116b8d2d0c8U, (uint64_t)0x1e376c085141ab53U, (uint64_t)0x2748774cdf8eeb99U,
+ (uint64_t)0x34b0bcb5e19b48a8U, (uint64_t)0x391c0cb3c5c95a63U, (uint64_t)0x4ed8aa4ae3418acbU,
+ (uint64_t)0x5b9cca4f7763e373U, (uint64_t)0x682e6ff3d6b2b8a3U, (uint64_t)0x748f82ee5defb2fcU,
+ (uint64_t)0x78a5636f43172f60U, (uint64_t)0x84c87814a1f0ab72U, (uint64_t)0x8cc702081a6439ecU,
+ (uint64_t)0x90befffa23631e28U, (uint64_t)0xa4506cebde82bde9U, (uint64_t)0xbef9a3f7b2c67915U,
+ (uint64_t)0xc67178f2e372532bU, (uint64_t)0xca273eceea26619cU, (uint64_t)0xd186b8c721c0c207U,
+ (uint64_t)0xeada7dd6cde0eb1eU, (uint64_t)0xf57d4f7fee6ed178U, (uint64_t)0x06f067aa72176fbaU,
+ (uint64_t)0x0a637dc5a2c898a6U, (uint64_t)0x113f9804bef90daeU, (uint64_t)0x1b710b35131c471bU,
+ (uint64_t)0x28db77f523047d84U, (uint64_t)0x32caab7b40c72493U, (uint64_t)0x3c9ebe0a15c9bebcU,
+ (uint64_t)0x431d67c49c100d4cU, (uint64_t)0x4cc5d4becb3e42b6U, (uint64_t)0x597f299cfc657e2aU,
+ (uint64_t)0x5fcb6fab3ad6faecU, (uint64_t)0x6c44198c4a475817U
+ };
+
+void Hacl_SHA2_Scalar32_sha256_init(uint32_t *hash);
+
+void Hacl_SHA2_Scalar32_sha256_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st);
+
+void
+Hacl_SHA2_Scalar32_sha256_update_last(
+ uint64_t totlen,
+ uint32_t len,
+ uint8_t *b,
+ uint32_t *hash
+);
+
+void Hacl_SHA2_Scalar32_sha256_finish(uint32_t *st, uint8_t *h);
+
+void Hacl_SHA2_Scalar32_sha224_init(uint32_t *hash);
+
+void
+Hacl_SHA2_Scalar32_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st);
+
+void Hacl_SHA2_Scalar32_sha224_finish(uint32_t *st, uint8_t *h);
+
+void Hacl_SHA2_Scalar32_sha512_init(uint64_t *hash);
+
+void Hacl_SHA2_Scalar32_sha512_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st);
+
+void
+Hacl_SHA2_Scalar32_sha512_update_last(
+ FStar_UInt128_uint128 totlen,
+ uint32_t len,
+ uint8_t *b,
+ uint64_t *hash
+);
+
+void Hacl_SHA2_Scalar32_sha512_finish(uint64_t *st, uint8_t *h);
+
+void Hacl_SHA2_Scalar32_sha384_init(uint64_t *hash);
+
+void Hacl_SHA2_Scalar32_sha384_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st);
+
+void
+Hacl_SHA2_Scalar32_sha384_update_last(
+ FStar_UInt128_uint128 totlen,
+ uint32_t len,
+ uint8_t *b,
+ uint64_t *st
+);
+
+void Hacl_SHA2_Scalar32_sha384_finish(uint64_t *st, uint8_t *h);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __internal_Hacl_Hash_SHA2_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h
new file mode 100644
index 00000000000..1c9808b8dd4
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/internal/Hacl_Hash_SHA3.h
@@ -0,0 +1,65 @@
+/* MIT License
+ *
+ * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation
+ * Copyright (c) 2022-2023 HACL* Contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+
+#ifndef __internal_Hacl_Hash_SHA3_H
+#define __internal_Hacl_Hash_SHA3_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <string.h>
+#include "krml/types.h"
+#include "krml/lowstar_endianness.h"
+#include "krml/internal/target.h"
+
+#include "../Hacl_Hash_SHA3.h"
+
+void
+Hacl_Hash_SHA3_update_multi_sha3(
+ Spec_Hash_Definitions_hash_alg a,
+ uint64_t *s,
+ uint8_t *blocks,
+ uint32_t n_blocks
+);
+
+void
+Hacl_Hash_SHA3_update_last_sha3(
+ Spec_Hash_Definitions_hash_alg a,
+ uint64_t *s,
+ uint8_t *input,
+ uint32_t input_len
+);
+
+void Hacl_Impl_SHA3_state_permute(uint64_t *s);
+
+void Hacl_Impl_SHA3_loadState(uint32_t rateInBytes, uint8_t *input, uint64_t *s);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define __internal_Hacl_Hash_SHA3_H_DEFINED
+#endif
diff --git a/contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h b/contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h
new file mode 100644
index 00000000000..0df236282ac
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hacl/python_hacl_namespaces.h
@@ -0,0 +1,86 @@
+#ifndef _PYTHON_HACL_NAMESPACES_H
+#define _PYTHON_HACL_NAMESPACES_H
+
+/*
+ * C's excuse for namespaces: Use globally unique names to avoid linkage
+ * conflicts with builds linking or dynamically loading other code potentially
+ * using HACL* libraries.
+ */
+
+#define Hacl_Streaming_SHA2_state_sha2_224_s python_hashlib_Hacl_Streaming_SHA2_state_sha2_224_s
+#define Hacl_Streaming_SHA2_state_sha2_224 python_hashlib_Hacl_Streaming_SHA2_state_sha2_224
+#define Hacl_Streaming_SHA2_state_sha2_256 python_hashlib_Hacl_Streaming_SHA2_state_sha2_256
+#define Hacl_Streaming_SHA2_state_sha2_384_s python_hashlib_Hacl_Streaming_SHA2_state_sha2_384_s
+#define Hacl_Streaming_SHA2_state_sha2_384 python_hashlib_Hacl_Streaming_SHA2_state_sha2_384
+#define Hacl_Streaming_SHA2_state_sha2_512 python_hashlib_Hacl_Streaming_SHA2_state_sha2_512
+#define Hacl_Streaming_SHA2_create_in_256 python_hashlib_Hacl_Streaming_SHA2_create_in_256
+#define Hacl_Streaming_SHA2_create_in_224 python_hashlib_Hacl_Streaming_SHA2_create_in_224
+#define Hacl_Streaming_SHA2_create_in_512 python_hashlib_Hacl_Streaming_SHA2_create_in_512
+#define Hacl_Streaming_SHA2_create_in_384 python_hashlib_Hacl_Streaming_SHA2_create_in_384
+#define Hacl_Streaming_SHA2_copy_256 python_hashlib_Hacl_Streaming_SHA2_copy_256
+#define Hacl_Streaming_SHA2_copy_224 python_hashlib_Hacl_Streaming_SHA2_copy_224
+#define Hacl_Streaming_SHA2_copy_512 python_hashlib_Hacl_Streaming_SHA2_copy_512
+#define Hacl_Streaming_SHA2_copy_384 python_hashlib_Hacl_Streaming_SHA2_copy_384
+#define Hacl_Streaming_SHA2_init_256 python_hashlib_Hacl_Streaming_SHA2_init_256
+#define Hacl_Streaming_SHA2_init_224 python_hashlib_Hacl_Streaming_SHA2_init_224
+#define Hacl_Streaming_SHA2_init_512 python_hashlib_Hacl_Streaming_SHA2_init_512
+#define Hacl_Streaming_SHA2_init_384 python_hashlib_Hacl_Streaming_SHA2_init_384
+#define Hacl_SHA2_Scalar32_sha512_init python_hashlib_Hacl_SHA2_Scalar32_sha512_init
+#define Hacl_Streaming_SHA2_update_256 python_hashlib_Hacl_Streaming_SHA2_update_256
+#define Hacl_Streaming_SHA2_update_224 python_hashlib_Hacl_Streaming_SHA2_update_224
+#define Hacl_Streaming_SHA2_update_512 python_hashlib_Hacl_Streaming_SHA2_update_512
+#define Hacl_Streaming_SHA2_update_384 python_hashlib_Hacl_Streaming_SHA2_update_384
+#define Hacl_Streaming_SHA2_finish_256 python_hashlib_Hacl_Streaming_SHA2_finish_256
+#define Hacl_Streaming_SHA2_finish_224 python_hashlib_Hacl_Streaming_SHA2_finish_224
+#define Hacl_Streaming_SHA2_finish_512 python_hashlib_Hacl_Streaming_SHA2_finish_512
+#define Hacl_Streaming_SHA2_finish_384 python_hashlib_Hacl_Streaming_SHA2_finish_384
+#define Hacl_Streaming_SHA2_free_256 python_hashlib_Hacl_Streaming_SHA2_free_256
+#define Hacl_Streaming_SHA2_free_224 python_hashlib_Hacl_Streaming_SHA2_free_224
+#define Hacl_Streaming_SHA2_free_512 python_hashlib_Hacl_Streaming_SHA2_free_512
+#define Hacl_Streaming_SHA2_free_384 python_hashlib_Hacl_Streaming_SHA2_free_384
+#define Hacl_Streaming_SHA2_sha256 python_hashlib_Hacl_Streaming_SHA2_sha256
+#define Hacl_Streaming_SHA2_sha224 python_hashlib_Hacl_Streaming_SHA2_sha224
+#define Hacl_Streaming_SHA2_sha512 python_hashlib_Hacl_Streaming_SHA2_sha512
+#define Hacl_Streaming_SHA2_sha384 python_hashlib_Hacl_Streaming_SHA2_sha384
+
+#define Hacl_Streaming_MD5_legacy_create_in python_hashlib_Hacl_Streaming_MD5_legacy_create_in
+#define Hacl_Streaming_MD5_legacy_init python_hashlib_Hacl_Streaming_MD5_legacy_init
+#define Hacl_Streaming_MD5_legacy_update python_hashlib_Hacl_Streaming_MD5_legacy_update
+#define Hacl_Streaming_MD5_legacy_finish python_hashlib_Hacl_Streaming_MD5_legacy_finish
+#define Hacl_Streaming_MD5_legacy_free python_hashlib_Hacl_Streaming_MD5_legacy_free
+#define Hacl_Streaming_MD5_legacy_copy python_hashlib_Hacl_Streaming_MD5_legacy_copy
+#define Hacl_Streaming_MD5_legacy_hash python_hashlib_Hacl_Streaming_MD5_legacy_hash
+
+#define Hacl_Streaming_SHA1_legacy_create_in python_hashlib_Hacl_Streaming_SHA1_legacy_create_in
+#define Hacl_Streaming_SHA1_legacy_init python_hashlib_Hacl_Streaming_SHA1_legacy_init
+#define Hacl_Streaming_SHA1_legacy_update python_hashlib_Hacl_Streaming_SHA1_legacy_update
+#define Hacl_Streaming_SHA1_legacy_finish python_hashlib_Hacl_Streaming_SHA1_legacy_finish
+#define Hacl_Streaming_SHA1_legacy_free python_hashlib_Hacl_Streaming_SHA1_legacy_free
+#define Hacl_Streaming_SHA1_legacy_copy python_hashlib_Hacl_Streaming_SHA1_legacy_copy
+#define Hacl_Streaming_SHA1_legacy_hash python_hashlib_Hacl_Streaming_SHA1_legacy_hash
+
+#define Hacl_Hash_SHA3_update_last_sha3 python_hashlib_Hacl_Hash_SHA3_update_last_sha3
+#define Hacl_Hash_SHA3_update_multi_sha3 python_hashlib_Hacl_Hash_SHA3_update_multi_sha3
+#define Hacl_Impl_SHA3_absorb_inner python_hashlib_Hacl_Impl_SHA3_absorb_inner
+#define Hacl_Impl_SHA3_keccak python_hashlib_Hacl_Impl_SHA3_keccak
+#define Hacl_Impl_SHA3_loadState python_hashlib_Hacl_Impl_SHA3_loadState
+#define Hacl_Impl_SHA3_squeeze python_hashlib_Hacl_Impl_SHA3_squeeze
+#define Hacl_Impl_SHA3_state_permute python_hashlib_Hacl_Impl_SHA3_state_permute
+#define Hacl_SHA3_sha3_224 python_hashlib_Hacl_SHA3_sha3_224
+#define Hacl_SHA3_sha3_256 python_hashlib_Hacl_SHA3_sha3_256
+#define Hacl_SHA3_sha3_384 python_hashlib_Hacl_SHA3_sha3_384
+#define Hacl_SHA3_sha3_512 python_hashlib_Hacl_SHA3_sha3_512
+#define Hacl_SHA3_shake128_hacl python_hashlib_Hacl_SHA3_shake128_hacl
+#define Hacl_SHA3_shake256_hacl python_hashlib_Hacl_SHA3_shake256_hacl
+#define Hacl_Streaming_Keccak_block_len python_hashlib_Hacl_Streaming_Keccak_block_len
+#define Hacl_Streaming_Keccak_copy python_hashlib_Hacl_Streaming_Keccak_copy
+#define Hacl_Streaming_Keccak_finish python_hashlib_Hacl_Streaming_Keccak_finish
+#define Hacl_Streaming_Keccak_free python_hashlib_Hacl_Streaming_Keccak_free
+#define Hacl_Streaming_Keccak_get_alg python_hashlib_Hacl_Streaming_Keccak_get_alg
+#define Hacl_Streaming_Keccak_hash_len python_hashlib_Hacl_Streaming_Keccak_hash_len
+#define Hacl_Streaming_Keccak_is_shake python_hashlib_Hacl_Streaming_Keccak_is_shake
+#define Hacl_Streaming_Keccak_malloc python_hashlib_Hacl_Streaming_Keccak_malloc
+#define Hacl_Streaming_Keccak_reset python_hashlib_Hacl_Streaming_Keccak_reset
+#define Hacl_Streaming_Keccak_update python_hashlib_Hacl_Streaming_Keccak_update
+
+#endif // _PYTHON_HACL_NAMESPACES_H
diff --git a/contrib/tools/python3/Modules/_hashopenssl.c b/contrib/tools/python3/Modules/_hashopenssl.c
new file mode 100644
index 00000000000..af6d1b23d3a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_hashopenssl.c
@@ -0,0 +1,2290 @@
+/* Module that wraps all OpenSSL hash algorithms */
+
+/*
+ * Copyright (C) 2005-2010 Gregory P. Smith ([email protected])
+ * Licensed to PSF under a Contributor Agreement.
+ *
+ * Derived from a skeleton of shamodule.c containing work performed by:
+ *
+ * Andrew Kuchling ([email protected])
+ * Greg Stein ([email protected])
+ *
+ */
+
+/* Don't warn about deprecated functions, */
+#ifndef OPENSSL_API_COMPAT
+ // 0x10101000L == 1.1.1, 30000 == 3.0.0
+ #define OPENSSL_API_COMPAT 0x10101000L
+#endif
+#define OPENSSL_NO_DEPRECATED 1
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "pycore_hashtable.h"
+#include "hashlib.h"
+#include "pycore_strhex.h" // _Py_strhex()
+
+/* EVP is the preferred interface to hashing in OpenSSL */
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
+#include <openssl/crypto.h> // FIPS_mode()
+/* We use the object interface to discover what hashes OpenSSL supports. */
+#include <openssl/objects.h>
+#include <openssl/err.h>
+
+
+#ifndef OPENSSL_THREADS
+# error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL"
+#endif
+
+#define MUNCH_SIZE INT_MAX
+
+#define PY_OPENSSL_HAS_SCRYPT 1
+#define PY_OPENSSL_HAS_SHA3 1
+#define PY_OPENSSL_HAS_SHAKE 1
+#define PY_OPENSSL_HAS_BLAKE2 1
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#define PY_EVP_MD EVP_MD
+#define PY_EVP_MD_fetch(algorithm, properties) EVP_MD_fetch(NULL, algorithm, properties)
+#define PY_EVP_MD_up_ref(md) EVP_MD_up_ref(md)
+#define PY_EVP_MD_free(md) EVP_MD_free(md)
+#else
+#define PY_EVP_MD const EVP_MD
+#define PY_EVP_MD_fetch(algorithm, properties) EVP_get_digestbyname(algorithm)
+#define PY_EVP_MD_up_ref(md) do {} while(0)
+#define PY_EVP_MD_free(md) do {} while(0)
+#endif
+
+/* hash alias map and fast lookup
+ *
+ * Map between Python's preferred names and OpenSSL internal names. Maintain
+ * cache of fetched EVP MD objects. The EVP_get_digestbyname() and
+ * EVP_MD_fetch() API calls have a performance impact.
+ *
+ * The py_hashentry_t items are stored in a _Py_hashtable_t with py_name and
+ * py_alias as keys.
+ */
+
+enum Py_hash_type {
+ Py_ht_evp, // usedforsecurity=True / default
+ Py_ht_evp_nosecurity, // usedforsecurity=False
+ Py_ht_mac, // HMAC
+ Py_ht_pbkdf2, // PKBDF2
+};
+
+typedef struct {
+ const char *py_name;
+ const char *py_alias;
+ const char *ossl_name;
+ int ossl_nid;
+ int refcnt;
+ PY_EVP_MD *evp;
+ PY_EVP_MD *evp_nosecurity;
+} py_hashentry_t;
+
+#define Py_hash_md5 "md5"
+#define Py_hash_sha1 "sha1"
+#define Py_hash_sha224 "sha224"
+#define Py_hash_sha256 "sha256"
+#define Py_hash_sha384 "sha384"
+#define Py_hash_sha512 "sha512"
+#define Py_hash_sha512_224 "sha512_224"
+#define Py_hash_sha512_256 "sha512_256"
+#define Py_hash_sha3_224 "sha3_224"
+#define Py_hash_sha3_256 "sha3_256"
+#define Py_hash_sha3_384 "sha3_384"
+#define Py_hash_sha3_512 "sha3_512"
+#define Py_hash_shake_128 "shake_128"
+#define Py_hash_shake_256 "shake_256"
+#define Py_hash_blake2s "blake2s"
+#define Py_hash_blake2b "blake2b"
+
+#define PY_HASH_ENTRY(py_name, py_alias, ossl_name, ossl_nid) \
+ {py_name, py_alias, ossl_name, ossl_nid, 0, NULL, NULL}
+
+static const py_hashentry_t py_hashes[] = {
+ /* md5 */
+ PY_HASH_ENTRY(Py_hash_md5, "MD5", SN_md5, NID_md5),
+ /* sha1 */
+ PY_HASH_ENTRY(Py_hash_sha1, "SHA1", SN_sha1, NID_sha1),
+ /* sha2 family */
+ PY_HASH_ENTRY(Py_hash_sha224, "SHA224", SN_sha224, NID_sha224),
+ PY_HASH_ENTRY(Py_hash_sha256, "SHA256", SN_sha256, NID_sha256),
+ PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384),
+ PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512),
+ /* truncated sha2 */
+ PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224, NID_sha512_224),
+ PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256, NID_sha512_256),
+ /* sha3 */
+ PY_HASH_ENTRY(Py_hash_sha3_224, NULL, SN_sha3_224, NID_sha3_224),
+ PY_HASH_ENTRY(Py_hash_sha3_256, NULL, SN_sha3_256, NID_sha3_256),
+ PY_HASH_ENTRY(Py_hash_sha3_384, NULL, SN_sha3_384, NID_sha3_384),
+ PY_HASH_ENTRY(Py_hash_sha3_512, NULL, SN_sha3_512, NID_sha3_512),
+ /* sha3 shake */
+ PY_HASH_ENTRY(Py_hash_shake_128, NULL, SN_shake128, NID_shake128),
+ PY_HASH_ENTRY(Py_hash_shake_256, NULL, SN_shake256, NID_shake256),
+ /* blake2 digest */
+ PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256, NID_blake2s256),
+ PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512, NID_blake2b512),
+ PY_HASH_ENTRY(NULL, NULL, NULL, 0),
+};
+
+static Py_uhash_t
+py_hashentry_t_hash_name(const void *key) {
+ return _Py_HashBytes(key, strlen((const char *)key));
+}
+
+static int
+py_hashentry_t_compare_name(const void *key1, const void *key2) {
+ return strcmp((const char *)key1, (const char *)key2) == 0;
+}
+
+static void
+py_hashentry_t_destroy_value(void *entry) {
+ py_hashentry_t *h = (py_hashentry_t *)entry;
+ if (--(h->refcnt) == 0) {
+ if (h->evp != NULL) {
+ PY_EVP_MD_free(h->evp);
+ h->evp = NULL;
+ }
+ if (h->evp_nosecurity != NULL) {
+ PY_EVP_MD_free(h->evp_nosecurity);
+ h->evp_nosecurity = NULL;
+ }
+ PyMem_Free(entry);
+ }
+}
+
+static _Py_hashtable_t *
+py_hashentry_table_new(void) {
+ _Py_hashtable_t *ht = _Py_hashtable_new_full(
+ py_hashentry_t_hash_name,
+ py_hashentry_t_compare_name,
+ NULL,
+ py_hashentry_t_destroy_value,
+ NULL
+ );
+ if (ht == NULL) {
+ return NULL;
+ }
+
+ for (const py_hashentry_t *h = py_hashes; h->py_name != NULL; h++) {
+ py_hashentry_t *entry = (py_hashentry_t *)PyMem_Malloc(sizeof(py_hashentry_t));
+ if (entry == NULL) {
+ goto error;
+ }
+ memcpy(entry, h, sizeof(py_hashentry_t));
+
+ if (_Py_hashtable_set(ht, (const void*)entry->py_name, (void*)entry) < 0) {
+ PyMem_Free(entry);
+ goto error;
+ }
+ entry->refcnt = 1;
+
+ if (h->py_alias != NULL) {
+ if (_Py_hashtable_set(ht, (const void*)entry->py_alias, (void*)entry) < 0) {
+ PyMem_Free(entry);
+ goto error;
+ }
+ entry->refcnt++;
+ }
+ }
+
+ return ht;
+ error:
+ _Py_hashtable_destroy(ht);
+ return NULL;
+}
+
+/* Module state */
+static PyModuleDef _hashlibmodule;
+
+typedef struct {
+ PyTypeObject *EVPtype;
+ PyTypeObject *HMACtype;
+#ifdef PY_OPENSSL_HAS_SHAKE
+ PyTypeObject *EVPXOFtype;
+#endif
+ PyObject *constructs;
+ PyObject *unsupported_digestmod_error;
+ _Py_hashtable_t *hashtable;
+} _hashlibstate;
+
+static inline _hashlibstate*
+get_hashlib_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_hashlibstate *)state;
+}
+
+typedef struct {
+ PyObject_HEAD
+ EVP_MD_CTX *ctx; /* OpenSSL message digest context */
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock; /* OpenSSL context lock */
+} EVPobject;
+
+typedef struct {
+ PyObject_HEAD
+ HMAC_CTX *ctx; /* OpenSSL hmac context */
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock; /* HMAC context lock */
+} HMACobject;
+
+#include "clinic/_hashopenssl.c.h"
+/*[clinic input]
+module _hashlib
+class _hashlib.HASH "EVPobject *" "((_hashlibstate *)PyModule_GetState(module))->EVPtype"
+class _hashlib.HASHXOF "EVPobject *" "((_hashlibstate *)PyModule_GetState(module))->EVPXOFtype"
+class _hashlib.HMAC "HMACobject *" "((_hashlibstate *)PyModule_GetState(module))->HMACtype"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7df1bcf6f75cb8ef]*/
+
+
+/* LCOV_EXCL_START */
+static PyObject *
+_setException(PyObject *exc, const char* altmsg, ...)
+{
+ unsigned long errcode = ERR_peek_last_error();
+ const char *lib, *func, *reason;
+ va_list vargs;
+
+ va_start(vargs, altmsg);
+ if (!errcode) {
+ if (altmsg == NULL) {
+ PyErr_SetString(exc, "no reason supplied");
+ } else {
+ PyErr_FormatV(exc, altmsg, vargs);
+ }
+ va_end(vargs);
+ return NULL;
+ }
+ va_end(vargs);
+ ERR_clear_error();
+
+ lib = ERR_lib_error_string(errcode);
+ func = ERR_func_error_string(errcode);
+ reason = ERR_reason_error_string(errcode);
+
+ if (lib && func) {
+ PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
+ }
+ else if (lib) {
+ PyErr_Format(exc, "[%s] %s", lib, reason);
+ }
+ else {
+ PyErr_SetString(exc, reason);
+ }
+ return NULL;
+}
+/* LCOV_EXCL_STOP */
+
+static PyObject*
+py_digest_name(const EVP_MD *md)
+{
+ int nid = EVP_MD_nid(md);
+ const char *name = NULL;
+ const py_hashentry_t *h;
+
+ for (h = py_hashes; h->py_name != NULL; h++) {
+ if (h->ossl_nid == nid) {
+ name = h->py_name;
+ break;
+ }
+ }
+ if (name == NULL) {
+ /* Ignore aliased names and only use long, lowercase name. The aliases
+ * pollute the list and OpenSSL appears to have its own definition of
+ * alias as the resulting list still contains duplicate and alternate
+ * names for several algorithms.
+ */
+ name = OBJ_nid2ln(nid);
+ if (name == NULL)
+ name = OBJ_nid2sn(nid);
+ }
+
+ return PyUnicode_FromString(name);
+}
+
+/* Get EVP_MD by HID and purpose */
+static PY_EVP_MD*
+py_digest_by_name(PyObject *module, const char *name, enum Py_hash_type py_ht)
+{
+ PY_EVP_MD *digest = NULL;
+ _hashlibstate *state = get_hashlib_state(module);
+ py_hashentry_t *entry = (py_hashentry_t *)_Py_hashtable_get(
+ state->hashtable, (const void*)name
+ );
+
+ if (entry != NULL) {
+ switch (py_ht) {
+ case Py_ht_evp:
+ case Py_ht_mac:
+ case Py_ht_pbkdf2:
+ if (entry->evp == NULL) {
+ entry->evp = PY_EVP_MD_fetch(entry->ossl_name, NULL);
+ }
+ digest = entry->evp;
+ break;
+ case Py_ht_evp_nosecurity:
+ if (entry->evp_nosecurity == NULL) {
+ entry->evp_nosecurity = PY_EVP_MD_fetch(entry->ossl_name, "-fips");
+ }
+ digest = entry->evp_nosecurity;
+ break;
+ }
+ if (digest != NULL) {
+ PY_EVP_MD_up_ref(digest);
+ }
+ } else {
+ // Fall back for looking up an unindexed OpenSSL specific name.
+ switch (py_ht) {
+ case Py_ht_evp:
+ case Py_ht_mac:
+ case Py_ht_pbkdf2:
+ digest = PY_EVP_MD_fetch(name, NULL);
+ break;
+ case Py_ht_evp_nosecurity:
+ digest = PY_EVP_MD_fetch(name, "-fips");
+ break;
+ }
+ }
+ if (digest == NULL) {
+ _setException(state->unsupported_digestmod_error, "unsupported hash type %s", name);
+ return NULL;
+ }
+ return digest;
+}
+
+/* Get digest EVP from object
+ *
+ * * string
+ * * _hashopenssl builtin function
+ *
+ * on error returns NULL with exception set.
+ */
+static PY_EVP_MD*
+py_digest_by_digestmod(PyObject *module, PyObject *digestmod, enum Py_hash_type py_ht) {
+ PY_EVP_MD* evp;
+ PyObject *name_obj = NULL;
+ const char *name;
+
+ if (PyUnicode_Check(digestmod)) {
+ name_obj = digestmod;
+ } else {
+ _hashlibstate *state = get_hashlib_state(module);
+ // borrowed ref
+ name_obj = PyDict_GetItemWithError(state->constructs, digestmod);
+ }
+ if (name_obj == NULL) {
+ if (!PyErr_Occurred()) {
+ _hashlibstate *state = get_hashlib_state(module);
+ PyErr_Format(
+ state->unsupported_digestmod_error,
+ "Unsupported digestmod %R", digestmod);
+ }
+ return NULL;
+ }
+
+ name = PyUnicode_AsUTF8(name_obj);
+ if (name == NULL) {
+ return NULL;
+ }
+
+ evp = py_digest_by_name(module, name, py_ht);
+ if (evp == NULL) {
+ return NULL;
+ }
+
+ return evp;
+}
+
+static EVPobject *
+newEVPobject(PyTypeObject *type)
+{
+ EVPobject *retval = (EVPobject *)PyObject_New(EVPobject, type);
+ if (retval == NULL) {
+ return NULL;
+ }
+
+ retval->lock = NULL;
+
+ retval->ctx = EVP_MD_CTX_new();
+ if (retval->ctx == NULL) {
+ Py_DECREF(retval);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ return retval;
+}
+
+static int
+EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len)
+{
+ unsigned int process;
+ const unsigned char *cp = (const unsigned char *)vp;
+ while (0 < len) {
+ if (len > (Py_ssize_t)MUNCH_SIZE)
+ process = MUNCH_SIZE;
+ else
+ process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int);
+ if (!EVP_DigestUpdate(self->ctx, (const void*)cp, process)) {
+ _setException(PyExc_ValueError, NULL);
+ return -1;
+ }
+ len -= process;
+ cp += process;
+ }
+ return 0;
+}
+
+/* Internal methods for a hash object */
+
+static void
+EVP_dealloc(EVPobject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ if (self->lock != NULL)
+ PyThread_free_lock(self->lock);
+ EVP_MD_CTX_free(self->ctx);
+ PyObject_Free(self);
+ Py_DECREF(tp);
+}
+
+static int
+locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self)
+{
+ int result;
+ ENTER_HASHLIB(self);
+ result = EVP_MD_CTX_copy(new_ctx_p, self->ctx);
+ LEAVE_HASHLIB(self);
+ return result;
+}
+
+/* External methods for a hash object */
+
+/*[clinic input]
+_hashlib.HASH.copy as EVP_copy
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+EVP_copy_impl(EVPobject *self)
+/*[clinic end generated code: output=b370c21cdb8ca0b4 input=31455b6a3e638069]*/
+{
+ EVPobject *newobj;
+
+ if ((newobj = newEVPobject(Py_TYPE(self))) == NULL)
+ return NULL;
+
+ if (!locked_EVP_MD_CTX_copy(newobj->ctx, self)) {
+ Py_DECREF(newobj);
+ return _setException(PyExc_ValueError, NULL);
+ }
+ return (PyObject *)newobj;
+}
+
+/*[clinic input]
+_hashlib.HASH.digest as EVP_digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+EVP_digest_impl(EVPobject *self)
+/*[clinic end generated code: output=0f6a3a0da46dc12d input=03561809a419bf00]*/
+{
+ unsigned char digest[EVP_MAX_MD_SIZE];
+ EVP_MD_CTX *temp_ctx;
+ PyObject *retval;
+ unsigned int digest_size;
+
+ temp_ctx = EVP_MD_CTX_new();
+ if (temp_ctx == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ digest_size = EVP_MD_CTX_size(temp_ctx);
+ if (!EVP_DigestFinal(temp_ctx, digest, NULL)) {
+ _setException(PyExc_ValueError, NULL);
+ return NULL;
+ }
+
+ retval = PyBytes_FromStringAndSize((const char *)digest, digest_size);
+ EVP_MD_CTX_free(temp_ctx);
+ return retval;
+}
+
+/*[clinic input]
+_hashlib.HASH.hexdigest as EVP_hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+EVP_hexdigest_impl(EVPobject *self)
+/*[clinic end generated code: output=18e6decbaf197296 input=aff9cf0e4c741a9a]*/
+{
+ unsigned char digest[EVP_MAX_MD_SIZE];
+ EVP_MD_CTX *temp_ctx;
+ unsigned int digest_size;
+
+ temp_ctx = EVP_MD_CTX_new();
+ if (temp_ctx == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ /* Get the raw (binary) digest value */
+ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ digest_size = EVP_MD_CTX_size(temp_ctx);
+ if (!EVP_DigestFinal(temp_ctx, digest, NULL)) {
+ _setException(PyExc_ValueError, NULL);
+ return NULL;
+ }
+
+ EVP_MD_CTX_free(temp_ctx);
+
+ return _Py_strhex((const char *)digest, (Py_ssize_t)digest_size);
+}
+
+/*[clinic input]
+_hashlib.HASH.update as EVP_update
+
+ obj: object
+ /
+
+Update this hash object's state with the provided string.
+[clinic start generated code]*/
+
+static PyObject *
+EVP_update(EVPobject *self, PyObject *obj)
+/*[clinic end generated code: output=ec1d55ed2432e966 input=9b30ec848f015501]*/
+{
+ int result;
+ Py_buffer view;
+
+ GET_BUFFER_VIEW_OR_ERROUT(obj, &view);
+
+ if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ /* fail? lock = NULL and we fail over to non-threaded code. */
+ }
+
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ result = EVP_hash(self, view.buf, view.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ result = EVP_hash(self, view.buf, view.len);
+ }
+
+ PyBuffer_Release(&view);
+
+ if (result == -1)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef EVP_methods[] = {
+ EVP_UPDATE_METHODDEF
+ EVP_DIGEST_METHODDEF
+ EVP_HEXDIGEST_METHODDEF
+ EVP_COPY_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+EVP_get_block_size(EVPobject *self, void *closure)
+{
+ long block_size;
+ block_size = EVP_MD_CTX_block_size(self->ctx);
+ return PyLong_FromLong(block_size);
+}
+
+static PyObject *
+EVP_get_digest_size(EVPobject *self, void *closure)
+{
+ long size;
+ size = EVP_MD_CTX_size(self->ctx);
+ return PyLong_FromLong(size);
+}
+
+static PyObject *
+EVP_get_name(EVPobject *self, void *closure)
+{
+ return py_digest_name(EVP_MD_CTX_md(self->ctx));
+}
+
+static PyGetSetDef EVP_getseters[] = {
+ {"digest_size",
+ (getter)EVP_get_digest_size, NULL,
+ NULL,
+ NULL},
+ {"block_size",
+ (getter)EVP_get_block_size, NULL,
+ NULL,
+ NULL},
+ {"name",
+ (getter)EVP_get_name, NULL,
+ NULL,
+ PyDoc_STR("algorithm name.")},
+ {NULL} /* Sentinel */
+};
+
+
+static PyObject *
+EVP_repr(EVPobject *self)
+{
+ PyObject *name_obj, *repr;
+ name_obj = py_digest_name(EVP_MD_CTX_md(self->ctx));
+ if (!name_obj) {
+ return NULL;
+ }
+ repr = PyUnicode_FromFormat("<%U %s object @ %p>",
+ name_obj, Py_TYPE(self)->tp_name, self);
+ Py_DECREF(name_obj);
+ return repr;
+}
+
+PyDoc_STRVAR(hashtype_doc,
+"HASH(name, string=b\'\')\n"
+"--\n"
+"\n"
+"A hash is an object used to calculate a checksum of a string of information.\n"
+"\n"
+"Methods:\n"
+"\n"
+"update() -- updates the current digest with an additional string\n"
+"digest() -- return the current digest value\n"
+"hexdigest() -- return the current digest as a string of hexadecimal digits\n"
+"copy() -- return a copy of the current hash object\n"
+"\n"
+"Attributes:\n"
+"\n"
+"name -- the hash algorithm being used by this object\n"
+"digest_size -- number of bytes in this hashes output");
+
+static PyType_Slot EVPtype_slots[] = {
+ {Py_tp_dealloc, EVP_dealloc},
+ {Py_tp_repr, EVP_repr},
+ {Py_tp_doc, (char *)hashtype_doc},
+ {Py_tp_methods, EVP_methods},
+ {Py_tp_getset, EVP_getseters},
+ {0, 0},
+};
+
+static PyType_Spec EVPtype_spec = {
+ "_hashlib.HASH", /*tp_name*/
+ sizeof(EVPobject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
+ EVPtype_slots
+};
+
+#ifdef PY_OPENSSL_HAS_SHAKE
+
+/*[clinic input]
+_hashlib.HASHXOF.digest as EVPXOF_digest
+
+ length: Py_ssize_t
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+EVPXOF_digest_impl(EVPobject *self, Py_ssize_t length)
+/*[clinic end generated code: output=ef9320c23280efad input=816a6537cea3d1db]*/
+{
+ EVP_MD_CTX *temp_ctx;
+ PyObject *retval = PyBytes_FromStringAndSize(NULL, length);
+
+ if (retval == NULL) {
+ return NULL;
+ }
+
+ temp_ctx = EVP_MD_CTX_new();
+ if (temp_ctx == NULL) {
+ Py_DECREF(retval);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
+ Py_DECREF(retval);
+ EVP_MD_CTX_free(temp_ctx);
+ return _setException(PyExc_ValueError, NULL);
+ }
+ if (!EVP_DigestFinalXOF(temp_ctx,
+ (unsigned char*)PyBytes_AS_STRING(retval),
+ length)) {
+ Py_DECREF(retval);
+ EVP_MD_CTX_free(temp_ctx);
+ _setException(PyExc_ValueError, NULL);
+ return NULL;
+ }
+
+ EVP_MD_CTX_free(temp_ctx);
+ return retval;
+}
+
+/*[clinic input]
+_hashlib.HASHXOF.hexdigest as EVPXOF_hexdigest
+
+ length: Py_ssize_t
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+EVPXOF_hexdigest_impl(EVPobject *self, Py_ssize_t length)
+/*[clinic end generated code: output=eb3e6ee7788bf5b2 input=5f9d6a8f269e34df]*/
+{
+ unsigned char *digest;
+ EVP_MD_CTX *temp_ctx;
+ PyObject *retval;
+
+ digest = (unsigned char*)PyMem_Malloc(length);
+ if (digest == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ temp_ctx = EVP_MD_CTX_new();
+ if (temp_ctx == NULL) {
+ PyMem_Free(digest);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ /* Get the raw (binary) digest value */
+ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
+ PyMem_Free(digest);
+ EVP_MD_CTX_free(temp_ctx);
+ return _setException(PyExc_ValueError, NULL);
+ }
+ if (!EVP_DigestFinalXOF(temp_ctx, digest, length)) {
+ PyMem_Free(digest);
+ EVP_MD_CTX_free(temp_ctx);
+ _setException(PyExc_ValueError, NULL);
+ return NULL;
+ }
+
+ EVP_MD_CTX_free(temp_ctx);
+
+ retval = _Py_strhex((const char *)digest, length);
+ PyMem_Free(digest);
+ return retval;
+}
+
+static PyMethodDef EVPXOF_methods[] = {
+ EVPXOF_DIGEST_METHODDEF
+ EVPXOF_HEXDIGEST_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+static PyObject *
+EVPXOF_get_digest_size(EVPobject *self, void *closure)
+{
+ return PyLong_FromLong(0);
+}
+
+static PyGetSetDef EVPXOF_getseters[] = {
+ {"digest_size",
+ (getter)EVPXOF_get_digest_size, NULL,
+ NULL,
+ NULL},
+ {NULL} /* Sentinel */
+};
+
+PyDoc_STRVAR(hashxoftype_doc,
+"HASHXOF(name, string=b\'\')\n"
+"--\n"
+"\n"
+"A hash is an object used to calculate a checksum of a string of information.\n"
+"\n"
+"Methods:\n"
+"\n"
+"update() -- updates the current digest with an additional string\n"
+"digest(length) -- return the current digest value\n"
+"hexdigest(length) -- return the current digest as a string of hexadecimal digits\n"
+"copy() -- return a copy of the current hash object\n"
+"\n"
+"Attributes:\n"
+"\n"
+"name -- the hash algorithm being used by this object\n"
+"digest_size -- number of bytes in this hashes output");
+
+static PyType_Slot EVPXOFtype_slots[] = {
+ {Py_tp_doc, (char *)hashxoftype_doc},
+ {Py_tp_methods, EVPXOF_methods},
+ {Py_tp_getset, EVPXOF_getseters},
+ {0, 0},
+};
+
+static PyType_Spec EVPXOFtype_spec = {
+ "_hashlib.HASHXOF", /*tp_name*/
+ sizeof(EVPobject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
+ EVPXOFtype_slots
+};
+
+
+#endif
+
+static PyObject*
+py_evp_fromname(PyObject *module, const char *digestname, PyObject *data_obj,
+ int usedforsecurity)
+{
+ Py_buffer view = { 0 };
+ PY_EVP_MD *digest = NULL;
+ PyTypeObject *type;
+ EVPobject *self = NULL;
+
+ if (data_obj != NULL) {
+ GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view);
+ }
+
+ digest = py_digest_by_name(
+ module, digestname, usedforsecurity ? Py_ht_evp : Py_ht_evp_nosecurity
+ );
+ if (digest == NULL) {
+ goto exit;
+ }
+
+ if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
+ type = get_hashlib_state(module)->EVPXOFtype;
+ } else {
+ type = get_hashlib_state(module)->EVPtype;
+ }
+
+ self = newEVPobject(type);
+ if (self == NULL) {
+ goto exit;
+ }
+
+#if defined(EVP_MD_CTX_FLAG_NON_FIPS_ALLOW) && OPENSSL_VERSION_NUMBER < 0x30000000L
+ // In OpenSSL 1.1.1 the non FIPS allowed flag is context specific while
+ // in 3.0.0 it is a different EVP_MD provider.
+ if (!usedforsecurity) {
+ EVP_MD_CTX_set_flags(self->ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
+ }
+#endif
+
+ int result = EVP_DigestInit_ex(self->ctx, digest, NULL);
+ if (!result) {
+ _setException(PyExc_ValueError, NULL);
+ Py_CLEAR(self);
+ goto exit;
+ }
+
+ if (view.buf && view.len) {
+ if (view.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ result = EVP_hash(self, view.buf, view.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ result = EVP_hash(self, view.buf, view.len);
+ }
+ if (result == -1) {
+ Py_CLEAR(self);
+ goto exit;
+ }
+ }
+
+ exit:
+ if (data_obj != NULL) {
+ PyBuffer_Release(&view);
+ }
+ if (digest != NULL) {
+ PY_EVP_MD_free(digest);
+ }
+
+ return (PyObject *)self;
+}
+
+
+/* The module-level function: new() */
+
+/*[clinic input]
+_hashlib.new as EVP_new
+
+ name as name_obj: object
+ string as data_obj: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new hash object using the named algorithm.
+
+An optional string argument may be provided and will be
+automatically hashed.
+
+The MD5 and SHA1 algorithms are always supported.
+[clinic start generated code]*/
+
+static PyObject *
+EVP_new_impl(PyObject *module, PyObject *name_obj, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=ddd5053f92dffe90 input=c24554d0337be1b0]*/
+{
+ char *name;
+ if (!PyArg_Parse(name_obj, "s", &name)) {
+ PyErr_SetString(PyExc_TypeError, "name must be a string");
+ return NULL;
+ }
+ return py_evp_fromname(module, name, data_obj, usedforsecurity);
+}
+
+
+/*[clinic input]
+_hashlib.openssl_md5
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a md5 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_md5_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=87b0186440a44f8c input=990e36d5e689b16e]*/
+{
+ return py_evp_fromname(module, Py_hash_md5, data_obj, usedforsecurity);
+}
+
+
+/*[clinic input]
+_hashlib.openssl_sha1
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha1 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha1_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=6813024cf690670d input=948f2f4b6deabc10]*/
+{
+ return py_evp_fromname(module, Py_hash_sha1, data_obj, usedforsecurity);
+}
+
+
+/*[clinic input]
+_hashlib.openssl_sha224
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha224 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha224_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=a2dfe7cc4eb14ebb input=f9272821fadca505]*/
+{
+ return py_evp_fromname(module, Py_hash_sha224, data_obj, usedforsecurity);
+}
+
+
+/*[clinic input]
+_hashlib.openssl_sha256
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha256 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha256_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=1f874a34870f0a68 input=549fad9d2930d4c5]*/
+{
+ return py_evp_fromname(module, Py_hash_sha256, data_obj, usedforsecurity);
+}
+
+
+/*[clinic input]
+_hashlib.openssl_sha384
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha384 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha384_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=58529eff9ca457b2 input=48601a6e3bf14ad7]*/
+{
+ return py_evp_fromname(module, Py_hash_sha384, data_obj, usedforsecurity);
+}
+
+
+/*[clinic input]
+_hashlib.openssl_sha512
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha512 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha512_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=2c744c9e4a40d5f6 input=c5c46a2a817aa98f]*/
+{
+ return py_evp_fromname(module, Py_hash_sha512, data_obj, usedforsecurity);
+}
+
+
+#ifdef PY_OPENSSL_HAS_SHA3
+
+/*[clinic input]
+_hashlib.openssl_sha3_224
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha3-224 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha3_224_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=144641c1d144b974 input=e3a01b2888916157]*/
+{
+ return py_evp_fromname(module, Py_hash_sha3_224, data_obj, usedforsecurity);
+}
+
+/*[clinic input]
+_hashlib.openssl_sha3_256
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha3-256 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha3_256_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=c61f1ab772d06668 input=e2908126c1b6deed]*/
+{
+ return py_evp_fromname(module, Py_hash_sha3_256, data_obj , usedforsecurity);
+}
+
+/*[clinic input]
+_hashlib.openssl_sha3_384
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha3-384 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha3_384_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=f68e4846858cf0ee input=ec0edf5c792f8252]*/
+{
+ return py_evp_fromname(module, Py_hash_sha3_384, data_obj , usedforsecurity);
+}
+
+/*[clinic input]
+_hashlib.openssl_sha3_512
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a sha3-512 hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_sha3_512_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=2eede478c159354a input=64e2cc0c094d56f4]*/
+{
+ return py_evp_fromname(module, Py_hash_sha3_512, data_obj , usedforsecurity);
+}
+#endif /* PY_OPENSSL_HAS_SHA3 */
+
+#ifdef PY_OPENSSL_HAS_SHAKE
+/*[clinic input]
+_hashlib.openssl_shake_128
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a shake-128 variable hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_shake_128_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=bc49cdd8ada1fa97 input=6c9d67440eb33ec8]*/
+{
+ return py_evp_fromname(module, Py_hash_shake_128, data_obj , usedforsecurity);
+}
+
+/*[clinic input]
+_hashlib.openssl_shake_256
+
+ string as data_obj: object(py_default="b''") = NULL
+ *
+ usedforsecurity: bool = True
+
+Returns a shake-256 variable hash object; optionally initialized with a string
+
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_openssl_shake_256_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity)
+/*[clinic end generated code: output=358d213be8852df7 input=479cbe9fefd4a9f8]*/
+{
+ return py_evp_fromname(module, Py_hash_shake_256, data_obj , usedforsecurity);
+}
+#endif /* PY_OPENSSL_HAS_SHAKE */
+
+/*[clinic input]
+_hashlib.pbkdf2_hmac as pbkdf2_hmac
+
+ hash_name: str
+ password: Py_buffer
+ salt: Py_buffer
+ iterations: long
+ dklen as dklen_obj: object = None
+
+Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as pseudorandom function.
+[clinic start generated code]*/
+
+static PyObject *
+pbkdf2_hmac_impl(PyObject *module, const char *hash_name,
+ Py_buffer *password, Py_buffer *salt, long iterations,
+ PyObject *dklen_obj)
+/*[clinic end generated code: output=144b76005416599b input=ed3ab0d2d28b5d5c]*/
+{
+ PyObject *key_obj = NULL;
+ char *key;
+ long dklen;
+ int retval;
+
+ PY_EVP_MD *digest = py_digest_by_name(module, hash_name, Py_ht_pbkdf2);
+ if (digest == NULL) {
+ goto end;
+ }
+
+ if (password->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "password is too long.");
+ goto end;
+ }
+
+ if (salt->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "salt is too long.");
+ goto end;
+ }
+
+ if (iterations < 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "iteration value must be greater than 0.");
+ goto end;
+ }
+ if (iterations > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "iteration value is too great.");
+ goto end;
+ }
+
+ if (dklen_obj == Py_None) {
+ dklen = EVP_MD_size(digest);
+ } else {
+ dklen = PyLong_AsLong(dklen_obj);
+ if ((dklen == -1) && PyErr_Occurred()) {
+ goto end;
+ }
+ }
+ if (dklen < 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "key length must be greater than 0.");
+ goto end;
+ }
+ if (dklen > INT_MAX) {
+ /* INT_MAX is always smaller than dkLen max (2^32 - 1) * hLen */
+ PyErr_SetString(PyExc_OverflowError,
+ "key length is too great.");
+ goto end;
+ }
+
+ key_obj = PyBytes_FromStringAndSize(NULL, dklen);
+ if (key_obj == NULL) {
+ goto end;
+ }
+ key = PyBytes_AS_STRING(key_obj);
+
+ Py_BEGIN_ALLOW_THREADS
+ retval = PKCS5_PBKDF2_HMAC((char*)password->buf, (int)password->len,
+ (unsigned char *)salt->buf, (int)salt->len,
+ iterations, digest, dklen,
+ (unsigned char *)key);
+ Py_END_ALLOW_THREADS
+
+ if (!retval) {
+ Py_CLEAR(key_obj);
+ _setException(PyExc_ValueError, NULL);
+ goto end;
+ }
+
+ end:
+ if (digest != NULL) {
+ PY_EVP_MD_free(digest);
+ }
+ return key_obj;
+}
+
+#ifdef PY_OPENSSL_HAS_SCRYPT
+
+/* XXX: Parameters salt, n, r and p should be required keyword-only parameters.
+ They are optional in the Argument Clinic declaration only due to a
+ limitation of PyArg_ParseTupleAndKeywords. */
+
+/*[clinic input]
+_hashlib.scrypt
+
+ password: Py_buffer
+ *
+ salt: Py_buffer = None
+ n as n_obj: object(subclass_of='&PyLong_Type') = None
+ r as r_obj: object(subclass_of='&PyLong_Type') = None
+ p as p_obj: object(subclass_of='&PyLong_Type') = None
+ maxmem: long = 0
+ dklen: long = 64
+
+
+scrypt password-based key derivation function.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_scrypt_impl(PyObject *module, Py_buffer *password, Py_buffer *salt,
+ PyObject *n_obj, PyObject *r_obj, PyObject *p_obj,
+ long maxmem, long dklen)
+/*[clinic end generated code: output=14849e2aa2b7b46c input=48a7d63bf3f75c42]*/
+{
+ PyObject *key_obj = NULL;
+ char *key;
+ int retval;
+ unsigned long n, r, p;
+
+ if (password->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "password is too long.");
+ return NULL;
+ }
+
+ if (salt->buf == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "salt is required");
+ return NULL;
+ }
+ if (salt->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "salt is too long.");
+ return NULL;
+ }
+
+ n = PyLong_AsUnsignedLong(n_obj);
+ if (n == (unsigned long) -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "n is required and must be an unsigned int");
+ return NULL;
+ }
+ if (n < 2 || n & (n - 1)) {
+ PyErr_SetString(PyExc_ValueError,
+ "n must be a power of 2.");
+ return NULL;
+ }
+
+ r = PyLong_AsUnsignedLong(r_obj);
+ if (r == (unsigned long) -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "r is required and must be an unsigned int");
+ return NULL;
+ }
+
+ p = PyLong_AsUnsignedLong(p_obj);
+ if (p == (unsigned long) -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "p is required and must be an unsigned int");
+ return NULL;
+ }
+
+ if (maxmem < 0 || maxmem > INT_MAX) {
+ /* OpenSSL 1.1.0 restricts maxmem to 32 MiB. It may change in the
+ future. The maxmem constant is private to OpenSSL. */
+ PyErr_Format(PyExc_ValueError,
+ "maxmem must be positive and smaller than %d",
+ INT_MAX);
+ return NULL;
+ }
+
+ if (dklen < 1 || dklen > INT_MAX) {
+ PyErr_Format(PyExc_ValueError,
+ "dklen must be greater than 0 and smaller than %d",
+ INT_MAX);
+ return NULL;
+ }
+
+ /* let OpenSSL validate the rest */
+ retval = EVP_PBE_scrypt(NULL, 0, NULL, 0, n, r, p, maxmem, NULL, 0);
+ if (!retval) {
+ _setException(PyExc_ValueError, "Invalid parameter combination for n, r, p, maxmem.");
+ return NULL;
+ }
+
+ key_obj = PyBytes_FromStringAndSize(NULL, dklen);
+ if (key_obj == NULL) {
+ return NULL;
+ }
+ key = PyBytes_AS_STRING(key_obj);
+
+ Py_BEGIN_ALLOW_THREADS
+ retval = EVP_PBE_scrypt(
+ (const char*)password->buf, (size_t)password->len,
+ (const unsigned char *)salt->buf, (size_t)salt->len,
+ n, r, p, maxmem,
+ (unsigned char *)key, (size_t)dklen
+ );
+ Py_END_ALLOW_THREADS
+
+ if (!retval) {
+ Py_CLEAR(key_obj);
+ _setException(PyExc_ValueError, NULL);
+ return NULL;
+ }
+ return key_obj;
+}
+#endif /* PY_OPENSSL_HAS_SCRYPT */
+
+/* Fast HMAC for hmac.digest()
+ */
+
+/*[clinic input]
+_hashlib.hmac_digest as _hashlib_hmac_singleshot
+
+ key: Py_buffer
+ msg: Py_buffer
+ digest: object
+
+Single-shot HMAC.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key,
+ Py_buffer *msg, PyObject *digest)
+/*[clinic end generated code: output=82f19965d12706ac input=0a0790cc3db45c2e]*/
+{
+ unsigned char md[EVP_MAX_MD_SIZE] = {0};
+ unsigned int md_len = 0;
+ unsigned char *result;
+ PY_EVP_MD *evp;
+
+ if (key->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "key is too long.");
+ return NULL;
+ }
+ if (msg->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "msg is too long.");
+ return NULL;
+ }
+
+ evp = py_digest_by_digestmod(module, digest, Py_ht_mac);
+ if (evp == NULL) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ result = HMAC(
+ evp,
+ (const void*)key->buf, (int)key->len,
+ (const unsigned char*)msg->buf, (int)msg->len,
+ md, &md_len
+ );
+ Py_END_ALLOW_THREADS
+ PY_EVP_MD_free(evp);
+
+ if (result == NULL) {
+ _setException(PyExc_ValueError, NULL);
+ return NULL;
+ }
+ return PyBytes_FromStringAndSize((const char*)md, md_len);
+}
+
+/* OpenSSL-based HMAC implementation
+ */
+
+static int _hmac_update(HMACobject*, PyObject*);
+
+/*[clinic input]
+_hashlib.hmac_new
+
+ key: Py_buffer
+ msg as msg_obj: object(c_default="NULL") = b''
+ digestmod: object(c_default="NULL") = None
+
+Return a new hmac object.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj,
+ PyObject *digestmod)
+/*[clinic end generated code: output=c20d9e4d9ed6d219 input=5f4071dcc7f34362]*/
+{
+ PyTypeObject *type = get_hashlib_state(module)->HMACtype;
+ PY_EVP_MD *digest;
+ HMAC_CTX *ctx = NULL;
+ HMACobject *self = NULL;
+ int r;
+
+ if (key->len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "key is too long.");
+ return NULL;
+ }
+
+ if (digestmod == NULL) {
+ PyErr_SetString(
+ PyExc_TypeError, "Missing required parameter 'digestmod'.");
+ return NULL;
+ }
+
+ digest = py_digest_by_digestmod(module, digestmod, Py_ht_mac);
+ if (digest == NULL) {
+ return NULL;
+ }
+
+ ctx = HMAC_CTX_new();
+ if (ctx == NULL) {
+ _setException(PyExc_ValueError, NULL);
+ goto error;
+ }
+
+ r = HMAC_Init_ex(
+ ctx,
+ (const char*)key->buf,
+ (int)key->len,
+ digest,
+ NULL /*impl*/);
+ PY_EVP_MD_free(digest);
+ if (r == 0) {
+ _setException(PyExc_ValueError, NULL);
+ goto error;
+ }
+
+ self = (HMACobject *)PyObject_New(HMACobject, type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ self->ctx = ctx;
+ self->lock = NULL;
+
+ if ((msg_obj != NULL) && (msg_obj != Py_None)) {
+ if (!_hmac_update(self, msg_obj))
+ goto error;
+ }
+
+ return (PyObject*)self;
+
+error:
+ if (ctx) HMAC_CTX_free(ctx);
+ if (self) PyObject_Free(self);
+ return NULL;
+}
+
+/* helper functions */
+static int
+locked_HMAC_CTX_copy(HMAC_CTX *new_ctx_p, HMACobject *self)
+{
+ int result;
+ ENTER_HASHLIB(self);
+ result = HMAC_CTX_copy(new_ctx_p, self->ctx);
+ LEAVE_HASHLIB(self);
+ return result;
+}
+
+static unsigned int
+_hmac_digest_size(HMACobject *self)
+{
+ unsigned int digest_size = EVP_MD_size(HMAC_CTX_get_md(self->ctx));
+ assert(digest_size <= EVP_MAX_MD_SIZE);
+ return digest_size;
+}
+
+static int
+_hmac_update(HMACobject *self, PyObject *obj)
+{
+ int r;
+ Py_buffer view = {0};
+
+ GET_BUFFER_VIEW_OR_ERROR(obj, &view, return 0);
+
+ if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ /* fail? lock = NULL and we fail over to non-threaded code. */
+ }
+
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ r = HMAC_Update(self->ctx, (const unsigned char*)view.buf, view.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ r = HMAC_Update(self->ctx, (const unsigned char*)view.buf, view.len);
+ }
+
+ PyBuffer_Release(&view);
+
+ if (r == 0) {
+ _setException(PyExc_ValueError, NULL);
+ return 0;
+ }
+ return 1;
+}
+
+/*[clinic input]
+_hashlib.HMAC.copy
+
+Return a copy ("clone") of the HMAC object.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_HMAC_copy_impl(HMACobject *self)
+/*[clinic end generated code: output=29aa28b452833127 input=e2fa6a05db61a4d6]*/
+{
+ HMACobject *retval;
+
+ HMAC_CTX *ctx = HMAC_CTX_new();
+ if (ctx == NULL) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ if (!locked_HMAC_CTX_copy(ctx, self)) {
+ HMAC_CTX_free(ctx);
+ return _setException(PyExc_ValueError, NULL);
+ }
+
+ retval = (HMACobject *)PyObject_New(HMACobject, Py_TYPE(self));
+ if (retval == NULL) {
+ HMAC_CTX_free(ctx);
+ return NULL;
+ }
+ retval->ctx = ctx;
+ retval->lock = NULL;
+
+ return (PyObject *)retval;
+}
+
+static void
+_hmac_dealloc(HMACobject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ if (self->lock != NULL) {
+ PyThread_free_lock(self->lock);
+ }
+ HMAC_CTX_free(self->ctx);
+ PyObject_Free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+_hmac_repr(HMACobject *self)
+{
+ PyObject *digest_name = py_digest_name(HMAC_CTX_get_md(self->ctx));
+ if (digest_name == NULL) {
+ return NULL;
+ }
+ PyObject *repr = PyUnicode_FromFormat(
+ "<%U HMAC object @ %p>", digest_name, self
+ );
+ Py_DECREF(digest_name);
+ return repr;
+}
+
+/*[clinic input]
+_hashlib.HMAC.update
+ msg: object
+
+Update the HMAC object with msg.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_HMAC_update_impl(HMACobject *self, PyObject *msg)
+/*[clinic end generated code: output=f31f0ace8c625b00 input=1829173bb3cfd4e6]*/
+{
+ if (!_hmac_update(self, msg)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static int
+_hmac_digest(HMACobject *self, unsigned char *buf, unsigned int len)
+{
+ HMAC_CTX *temp_ctx = HMAC_CTX_new();
+ if (temp_ctx == NULL) {
+ PyErr_NoMemory();
+ return 0;
+ }
+ if (!locked_HMAC_CTX_copy(temp_ctx, self)) {
+ _setException(PyExc_ValueError, NULL);
+ return 0;
+ }
+ int r = HMAC_Final(temp_ctx, buf, &len);
+ HMAC_CTX_free(temp_ctx);
+ if (r == 0) {
+ _setException(PyExc_ValueError, NULL);
+ return 0;
+ }
+ return 1;
+}
+
+/*[clinic input]
+_hashlib.HMAC.digest
+Return the digest of the bytes passed to the update() method so far.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_HMAC_digest_impl(HMACobject *self)
+/*[clinic end generated code: output=1b1424355af7a41e input=bff07f74da318fb4]*/
+{
+ unsigned char digest[EVP_MAX_MD_SIZE];
+ unsigned int digest_size = _hmac_digest_size(self);
+ if (digest_size == 0) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ int r = _hmac_digest(self, digest, digest_size);
+ if (r == 0) {
+ return NULL;
+ }
+ return PyBytes_FromStringAndSize((const char *)digest, digest_size);
+}
+
+/*[clinic input]
+_hashlib.HMAC.hexdigest
+
+Return hexadecimal digest of the bytes passed to the update() method so far.
+
+This may be used to exchange the value safely in email or other non-binary
+environments.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_HMAC_hexdigest_impl(HMACobject *self)
+/*[clinic end generated code: output=80d825be1eaae6a7 input=5abc42702874ddcf]*/
+{
+ unsigned char digest[EVP_MAX_MD_SIZE];
+ unsigned int digest_size = _hmac_digest_size(self);
+ if (digest_size == 0) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ int r = _hmac_digest(self, digest, digest_size);
+ if (r == 0) {
+ return NULL;
+ }
+ return _Py_strhex((const char *)digest, digest_size);
+}
+
+static PyObject *
+_hashlib_hmac_get_digest_size(HMACobject *self, void *closure)
+{
+ unsigned int digest_size = _hmac_digest_size(self);
+ if (digest_size == 0) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ return PyLong_FromLong(digest_size);
+}
+
+static PyObject *
+_hashlib_hmac_get_block_size(HMACobject *self, void *closure)
+{
+ const EVP_MD *md = HMAC_CTX_get_md(self->ctx);
+ if (md == NULL) {
+ return _setException(PyExc_ValueError, NULL);
+ }
+ return PyLong_FromLong(EVP_MD_block_size(md));
+}
+
+static PyObject *
+_hashlib_hmac_get_name(HMACobject *self, void *closure)
+{
+ PyObject *digest_name = py_digest_name(HMAC_CTX_get_md(self->ctx));
+ if (digest_name == NULL) {
+ return NULL;
+ }
+ PyObject *name = PyUnicode_FromFormat("hmac-%U", digest_name);
+ Py_DECREF(digest_name);
+ return name;
+}
+
+static PyMethodDef HMAC_methods[] = {
+ _HASHLIB_HMAC_UPDATE_METHODDEF
+ _HASHLIB_HMAC_DIGEST_METHODDEF
+ _HASHLIB_HMAC_HEXDIGEST_METHODDEF
+ _HASHLIB_HMAC_COPY_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyGetSetDef HMAC_getset[] = {
+ {"digest_size", (getter)_hashlib_hmac_get_digest_size, NULL, NULL, NULL},
+ {"block_size", (getter)_hashlib_hmac_get_block_size, NULL, NULL, NULL},
+ {"name", (getter)_hashlib_hmac_get_name, NULL, NULL, NULL},
+ {NULL} /* Sentinel */
+};
+
+
+PyDoc_STRVAR(hmactype_doc,
+"The object used to calculate HMAC of a message.\n\
+\n\
+Methods:\n\
+\n\
+update() -- updates the current digest with an additional string\n\
+digest() -- return the current digest value\n\
+hexdigest() -- return the current digest as a string of hexadecimal digits\n\
+copy() -- return a copy of the current hash object\n\
+\n\
+Attributes:\n\
+\n\
+name -- the name, including the hash algorithm used by this object\n\
+digest_size -- number of bytes in digest() output\n");
+
+static PyType_Slot HMACtype_slots[] = {
+ {Py_tp_doc, (char *)hmactype_doc},
+ {Py_tp_repr, (reprfunc)_hmac_repr},
+ {Py_tp_dealloc,(destructor)_hmac_dealloc},
+ {Py_tp_methods, HMAC_methods},
+ {Py_tp_getset, HMAC_getset},
+ {0, NULL}
+};
+
+PyType_Spec HMACtype_spec = {
+ "_hashlib.HMAC", /* name */
+ sizeof(HMACobject), /* basicsize */
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
+ .slots = HMACtype_slots,
+};
+
+
+/* State for our callback function so that it can accumulate a result. */
+typedef struct _internal_name_mapper_state {
+ PyObject *set;
+ int error;
+} _InternalNameMapperState;
+
+
+/* A callback function to pass to OpenSSL's OBJ_NAME_do_all(...) */
+static void
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+_openssl_hash_name_mapper(EVP_MD *md, void *arg)
+#else
+_openssl_hash_name_mapper(const EVP_MD *md, const char *from,
+ const char *to, void *arg)
+#endif
+{
+ _InternalNameMapperState *state = (_InternalNameMapperState *)arg;
+ PyObject *py_name;
+
+ assert(state != NULL);
+ // ignore all undefined providers
+ if ((md == NULL) || (EVP_MD_nid(md) == NID_undef)) {
+ return;
+ }
+
+ py_name = py_digest_name(md);
+ if (py_name == NULL) {
+ state->error = 1;
+ } else {
+ if (PySet_Add(state->set, py_name) != 0) {
+ state->error = 1;
+ }
+ Py_DECREF(py_name);
+ }
+}
+
+
+/* Ask OpenSSL for a list of supported ciphers, filling in a Python set. */
+static int
+hashlib_md_meth_names(PyObject *module)
+{
+ _InternalNameMapperState state = {
+ .set = PyFrozenSet_New(NULL),
+ .error = 0
+ };
+ if (state.set == NULL) {
+ return -1;
+ }
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ // get algorithms from all activated providers in default context
+ EVP_MD_do_all_provided(NULL, &_openssl_hash_name_mapper, &state);
+#else
+ EVP_MD_do_all(&_openssl_hash_name_mapper, &state);
+#endif
+
+ if (state.error) {
+ Py_DECREF(state.set);
+ return -1;
+ }
+
+ if (PyModule_AddObject(module, "openssl_md_meth_names", state.set) < 0) {
+ Py_DECREF(state.set);
+ return -1;
+ }
+
+ return 0;
+}
+
+/*[clinic input]
+_hashlib.get_fips_mode -> int
+
+Determine the OpenSSL FIPS mode of operation.
+
+For OpenSSL 3.0.0 and newer it returns the state of the default provider
+in the default OSSL context. It's not quite the same as FIPS_mode() but good
+enough for unittests.
+
+Effectively any non-zero return value indicates FIPS mode;
+values other than 1 may have additional significance.
+[clinic start generated code]*/
+
+static int
+_hashlib_get_fips_mode_impl(PyObject *module)
+/*[clinic end generated code: output=87eece1bab4d3fa9 input=2db61538c41c6fef]*/
+
+{
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ return EVP_default_properties_is_fips_enabled(NULL);
+#else
+ ERR_clear_error();
+ int result = FIPS_mode();
+ if (result == 0) {
+ // "If the library was built without support of the FIPS Object Module,
+ // then the function will return 0 with an error code of
+ // CRYPTO_R_FIPS_MODE_NOT_SUPPORTED (0x0f06d065)."
+ // But 0 is also a valid result value.
+ unsigned long errcode = ERR_peek_last_error();
+ if (errcode) {
+ _setException(PyExc_ValueError, NULL);
+ return -1;
+ }
+ }
+ return result;
+#endif
+}
+
+
+static int
+_tscmp(const unsigned char *a, const unsigned char *b,
+ Py_ssize_t len_a, Py_ssize_t len_b)
+{
+ /* loop count depends on length of b. Might leak very little timing
+ * information if sizes are different.
+ */
+ Py_ssize_t length = len_b;
+ const void *left = a;
+ const void *right = b;
+ int result = 0;
+
+ if (len_a != length) {
+ left = b;
+ result = 1;
+ }
+
+ result |= CRYPTO_memcmp(left, right, length);
+
+ return (result == 0);
+}
+
+/* NOTE: Keep in sync with _operator.c implementation. */
+
+/*[clinic input]
+_hashlib.compare_digest
+
+ a: object
+ b: object
+ /
+
+Return 'a == b'.
+
+This function uses an approach designed to prevent
+timing analysis, making it appropriate for cryptography.
+
+a and b must both be of the same type: either str (ASCII only),
+or any bytes-like object.
+
+Note: If a and b are of different lengths, or if an error occurs,
+a timing attack could theoretically reveal information about the
+types and lengths of a and b--but not their values.
+[clinic start generated code]*/
+
+static PyObject *
+_hashlib_compare_digest_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=6f1c13927480aed9 input=9c40c6e566ca12f5]*/
+{
+ int rc;
+
+ /* ASCII unicode string */
+ if(PyUnicode_Check(a) && PyUnicode_Check(b)) {
+ if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
+ return NULL;
+ }
+ if (!PyUnicode_IS_ASCII(a) || !PyUnicode_IS_ASCII(b)) {
+ PyErr_SetString(PyExc_TypeError,
+ "comparing strings with non-ASCII characters is "
+ "not supported");
+ return NULL;
+ }
+
+ rc = _tscmp(PyUnicode_DATA(a),
+ PyUnicode_DATA(b),
+ PyUnicode_GET_LENGTH(a),
+ PyUnicode_GET_LENGTH(b));
+ }
+ /* fallback to buffer interface for bytes, bytearray and other */
+ else {
+ Py_buffer view_a;
+ Py_buffer view_b;
+
+ if (PyObject_CheckBuffer(a) == 0 && PyObject_CheckBuffer(b) == 0) {
+ PyErr_Format(PyExc_TypeError,
+ "unsupported operand types(s) or combination of types: "
+ "'%.100s' and '%.100s'",
+ Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
+ return NULL;
+ }
+
+ if (PyObject_GetBuffer(a, &view_a, PyBUF_SIMPLE) == -1) {
+ return NULL;
+ }
+ if (view_a.ndim > 1) {
+ PyErr_SetString(PyExc_BufferError,
+ "Buffer must be single dimension");
+ PyBuffer_Release(&view_a);
+ return NULL;
+ }
+
+ if (PyObject_GetBuffer(b, &view_b, PyBUF_SIMPLE) == -1) {
+ PyBuffer_Release(&view_a);
+ return NULL;
+ }
+ if (view_b.ndim > 1) {
+ PyErr_SetString(PyExc_BufferError,
+ "Buffer must be single dimension");
+ PyBuffer_Release(&view_a);
+ PyBuffer_Release(&view_b);
+ return NULL;
+ }
+
+ rc = _tscmp((const unsigned char*)view_a.buf,
+ (const unsigned char*)view_b.buf,
+ view_a.len,
+ view_b.len);
+
+ PyBuffer_Release(&view_a);
+ PyBuffer_Release(&view_b);
+ }
+
+ return PyBool_FromLong(rc);
+}
+
+/* List of functions exported by this module */
+
+static struct PyMethodDef EVP_functions[] = {
+ EVP_NEW_METHODDEF
+ PBKDF2_HMAC_METHODDEF
+ _HASHLIB_SCRYPT_METHODDEF
+ _HASHLIB_GET_FIPS_MODE_METHODDEF
+ _HASHLIB_COMPARE_DIGEST_METHODDEF
+ _HASHLIB_HMAC_SINGLESHOT_METHODDEF
+ _HASHLIB_HMAC_NEW_METHODDEF
+ _HASHLIB_OPENSSL_MD5_METHODDEF
+ _HASHLIB_OPENSSL_SHA1_METHODDEF
+ _HASHLIB_OPENSSL_SHA224_METHODDEF
+ _HASHLIB_OPENSSL_SHA256_METHODDEF
+ _HASHLIB_OPENSSL_SHA384_METHODDEF
+ _HASHLIB_OPENSSL_SHA512_METHODDEF
+ _HASHLIB_OPENSSL_SHA3_224_METHODDEF
+ _HASHLIB_OPENSSL_SHA3_256_METHODDEF
+ _HASHLIB_OPENSSL_SHA3_384_METHODDEF
+ _HASHLIB_OPENSSL_SHA3_512_METHODDEF
+ _HASHLIB_OPENSSL_SHAKE_128_METHODDEF
+ _HASHLIB_OPENSSL_SHAKE_256_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+
+/* Initialize this module. */
+
+static int
+hashlib_traverse(PyObject *m, visitproc visit, void *arg)
+{
+ _hashlibstate *state = get_hashlib_state(m);
+ Py_VISIT(state->EVPtype);
+ Py_VISIT(state->HMACtype);
+#ifdef PY_OPENSSL_HAS_SHAKE
+ Py_VISIT(state->EVPXOFtype);
+#endif
+ Py_VISIT(state->constructs);
+ Py_VISIT(state->unsupported_digestmod_error);
+ return 0;
+}
+
+static int
+hashlib_clear(PyObject *m)
+{
+ _hashlibstate *state = get_hashlib_state(m);
+ Py_CLEAR(state->EVPtype);
+ Py_CLEAR(state->HMACtype);
+#ifdef PY_OPENSSL_HAS_SHAKE
+ Py_CLEAR(state->EVPXOFtype);
+#endif
+ Py_CLEAR(state->constructs);
+ Py_CLEAR(state->unsupported_digestmod_error);
+
+ if (state->hashtable != NULL) {
+ _Py_hashtable_destroy(state->hashtable);
+ state->hashtable = NULL;
+ }
+
+ return 0;
+}
+
+static void
+hashlib_free(void *m)
+{
+ hashlib_clear((PyObject *)m);
+}
+
+/* Py_mod_exec functions */
+static int
+hashlib_init_hashtable(PyObject *module)
+{
+ _hashlibstate *state = get_hashlib_state(module);
+
+ state->hashtable = py_hashentry_table_new();
+ if (state->hashtable == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ return 0;
+}
+
+static int
+hashlib_init_evptype(PyObject *module)
+{
+ _hashlibstate *state = get_hashlib_state(module);
+
+ state->EVPtype = (PyTypeObject *)PyType_FromSpec(&EVPtype_spec);
+ if (state->EVPtype == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->EVPtype) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+hashlib_init_evpxoftype(PyObject *module)
+{
+#ifdef PY_OPENSSL_HAS_SHAKE
+ _hashlibstate *state = get_hashlib_state(module);
+
+ if (state->EVPtype == NULL) {
+ return -1;
+ }
+
+ state->EVPXOFtype = (PyTypeObject *)PyType_FromSpecWithBases(
+ &EVPXOFtype_spec, (PyObject *)state->EVPtype
+ );
+ if (state->EVPXOFtype == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->EVPXOFtype) < 0) {
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+static int
+hashlib_init_hmactype(PyObject *module)
+{
+ _hashlibstate *state = get_hashlib_state(module);
+
+ state->HMACtype = (PyTypeObject *)PyType_FromSpec(&HMACtype_spec);
+ if (state->HMACtype == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->HMACtype) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+hashlib_init_constructors(PyObject *module)
+{
+ /* Create dict from builtin openssl_hash functions to name
+ * {_hashlib.openssl_sha256: "sha256", ...}
+ */
+ PyModuleDef *mdef;
+ PyMethodDef *fdef;
+ PyObject *proxy;
+ PyObject *func, *name_obj;
+ _hashlibstate *state = get_hashlib_state(module);
+
+ mdef = PyModule_GetDef(module);
+ if (mdef == NULL) {
+ return -1;
+ }
+
+ state->constructs = PyDict_New();
+ if (state->constructs == NULL) {
+ return -1;
+ }
+
+ for (fdef = mdef->m_methods; fdef->ml_name != NULL; fdef++) {
+ if (strncmp(fdef->ml_name, "openssl_", 8)) {
+ continue;
+ }
+ name_obj = PyUnicode_FromString(fdef->ml_name + 8);
+ if (name_obj == NULL) {
+ return -1;
+ }
+ func = PyObject_GetAttrString(module, fdef->ml_name);
+ if (func == NULL) {
+ Py_DECREF(name_obj);
+ return -1;
+ }
+ int rc = PyDict_SetItem(state->constructs, func, name_obj);
+ Py_DECREF(func);
+ Py_DECREF(name_obj);
+ if (rc < 0) {
+ return -1;
+ }
+ }
+
+ proxy = PyDictProxy_New(state->constructs);
+ if (proxy == NULL) {
+ return -1;
+ }
+
+ int rc = PyModule_AddObjectRef(module, "_constructors", proxy);
+ Py_DECREF(proxy);
+ if (rc < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+hashlib_exception(PyObject *module)
+{
+ _hashlibstate *state = get_hashlib_state(module);
+ state->unsupported_digestmod_error = PyErr_NewException(
+ "_hashlib.UnsupportedDigestmodError", PyExc_ValueError, NULL);
+ if (state->unsupported_digestmod_error == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(module, "UnsupportedDigestmodError",
+ state->unsupported_digestmod_error) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+
+static PyModuleDef_Slot hashlib_slots[] = {
+ {Py_mod_exec, hashlib_init_hashtable},
+ {Py_mod_exec, hashlib_init_evptype},
+ {Py_mod_exec, hashlib_init_evpxoftype},
+ {Py_mod_exec, hashlib_init_hmactype},
+ {Py_mod_exec, hashlib_md_meth_names},
+ {Py_mod_exec, hashlib_init_constructors},
+ {Py_mod_exec, hashlib_exception},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _hashlibmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_hashlib",
+ .m_doc = "OpenSSL interface for hashlib module",
+ .m_size = sizeof(_hashlibstate),
+ .m_methods = EVP_functions,
+ .m_slots = hashlib_slots,
+ .m_traverse = hashlib_traverse,
+ .m_clear = hashlib_clear,
+ .m_free = hashlib_free
+};
+
+PyMODINIT_FUNC
+PyInit__hashlib(void)
+{
+ return PyModuleDef_Init(&_hashlibmodule);
+}
diff --git a/contrib/tools/python3/Modules/_heapqmodule.c b/contrib/tools/python3/Modules/_heapqmodule.c
new file mode 100644
index 00000000000..00285ae01f8
--- /dev/null
+++ b/contrib/tools/python3/Modules/_heapqmodule.c
@@ -0,0 +1,705 @@
+/* Drop in replacement for heapq.py
+
+C implementation derived directly from heapq.py in Py2.3
+which was written by Kevin O'Connor, augmented by Tim Peters,
+annotated by François Pinard, and converted to C by Raymond Hettinger.
+
+*/
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_list.h" // _PyList_ITEMS()
+
+#include "clinic/_heapqmodule.c.h"
+
+
+/*[clinic input]
+module _heapq
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d7cca0a2e4c0ceb3]*/
+
+static int
+siftdown(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
+{
+ PyObject *newitem, *parent, **arr;
+ Py_ssize_t parentpos, size;
+ int cmp;
+
+ assert(PyList_Check(heap));
+ size = PyList_GET_SIZE(heap);
+ if (pos >= size) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return -1;
+ }
+
+ /* Follow the path to the root, moving parents down until finding
+ a place newitem fits. */
+ arr = _PyList_ITEMS(heap);
+ newitem = arr[pos];
+ while (pos > startpos) {
+ parentpos = (pos - 1) >> 1;
+ parent = arr[parentpos];
+ Py_INCREF(newitem);
+ Py_INCREF(parent);
+ cmp = PyObject_RichCompareBool(newitem, parent, Py_LT);
+ Py_DECREF(parent);
+ Py_DECREF(newitem);
+ if (cmp < 0)
+ return -1;
+ if (size != PyList_GET_SIZE(heap)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "list changed size during iteration");
+ return -1;
+ }
+ if (cmp == 0)
+ break;
+ arr = _PyList_ITEMS(heap);
+ parent = arr[parentpos];
+ newitem = arr[pos];
+ arr[parentpos] = newitem;
+ arr[pos] = parent;
+ pos = parentpos;
+ }
+ return 0;
+}
+
+static int
+siftup(PyListObject *heap, Py_ssize_t pos)
+{
+ Py_ssize_t startpos, endpos, childpos, limit;
+ PyObject *tmp1, *tmp2, **arr;
+ int cmp;
+
+ assert(PyList_Check(heap));
+ endpos = PyList_GET_SIZE(heap);
+ startpos = pos;
+ if (pos >= endpos) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return -1;
+ }
+
+ /* Bubble up the smaller child until hitting a leaf. */
+ arr = _PyList_ITEMS(heap);
+ limit = endpos >> 1; /* smallest pos that has no child */
+ while (pos < limit) {
+ /* Set childpos to index of smaller child. */
+ childpos = 2*pos + 1; /* leftmost child position */
+ if (childpos + 1 < endpos) {
+ PyObject* a = arr[childpos];
+ PyObject* b = arr[childpos + 1];
+ Py_INCREF(a);
+ Py_INCREF(b);
+ cmp = PyObject_RichCompareBool(a, b, Py_LT);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (cmp < 0)
+ return -1;
+ childpos += ((unsigned)cmp ^ 1); /* increment when cmp==0 */
+ arr = _PyList_ITEMS(heap); /* arr may have changed */
+ if (endpos != PyList_GET_SIZE(heap)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "list changed size during iteration");
+ return -1;
+ }
+ }
+ /* Move the smaller child up. */
+ tmp1 = arr[childpos];
+ tmp2 = arr[pos];
+ arr[childpos] = tmp2;
+ arr[pos] = tmp1;
+ pos = childpos;
+ }
+ /* Bubble it up to its final resting place (by sifting its parents down). */
+ return siftdown(heap, startpos, pos);
+}
+
+/*[clinic input]
+_heapq.heappush
+
+ heap: object(subclass_of='&PyList_Type')
+ item: object
+ /
+
+Push item onto heap, maintaining the heap invariant.
+[clinic start generated code]*/
+
+static PyObject *
+_heapq_heappush_impl(PyObject *module, PyObject *heap, PyObject *item)
+/*[clinic end generated code: output=912c094f47663935 input=7c69611f3698aceb]*/
+{
+ if (PyList_Append(heap, item))
+ return NULL;
+
+ if (siftdown((PyListObject *)heap, 0, PyList_GET_SIZE(heap)-1))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+heappop_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t))
+{
+ PyObject *lastelt, *returnitem;
+ Py_ssize_t n;
+
+ /* raises IndexError if the heap is empty */
+ n = PyList_GET_SIZE(heap);
+ if (n == 0) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return NULL;
+ }
+
+ lastelt = PyList_GET_ITEM(heap, n-1) ;
+ Py_INCREF(lastelt);
+ if (PyList_SetSlice(heap, n-1, n, NULL)) {
+ Py_DECREF(lastelt);
+ return NULL;
+ }
+ n--;
+
+ if (!n)
+ return lastelt;
+ returnitem = PyList_GET_ITEM(heap, 0);
+ PyList_SET_ITEM(heap, 0, lastelt);
+ if (siftup_func((PyListObject *)heap, 0)) {
+ Py_DECREF(returnitem);
+ return NULL;
+ }
+ return returnitem;
+}
+
+/*[clinic input]
+_heapq.heappop
+
+ heap: object(subclass_of='&PyList_Type')
+ /
+
+Pop the smallest item off the heap, maintaining the heap invariant.
+[clinic start generated code]*/
+
+static PyObject *
+_heapq_heappop_impl(PyObject *module, PyObject *heap)
+/*[clinic end generated code: output=96dfe82d37d9af76 input=91487987a583c856]*/
+{
+ return heappop_internal(heap, siftup);
+}
+
+static PyObject *
+heapreplace_internal(PyObject *heap, PyObject *item, int siftup_func(PyListObject *, Py_ssize_t))
+{
+ PyObject *returnitem;
+
+ if (PyList_GET_SIZE(heap) == 0) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return NULL;
+ }
+
+ returnitem = PyList_GET_ITEM(heap, 0);
+ PyList_SET_ITEM(heap, 0, Py_NewRef(item));
+ if (siftup_func((PyListObject *)heap, 0)) {
+ Py_DECREF(returnitem);
+ return NULL;
+ }
+ return returnitem;
+}
+
+
+/*[clinic input]
+_heapq.heapreplace
+
+ heap: object(subclass_of='&PyList_Type')
+ item: object
+ /
+
+Pop and return the current smallest value, and add the new item.
+
+This is more efficient than heappop() followed by heappush(), and can be
+more appropriate when using a fixed-size heap. Note that the value
+returned may be larger than item! That constrains reasonable uses of
+this routine unless written as part of a conditional replacement:
+
+ if item > heap[0]:
+ item = heapreplace(heap, item)
+[clinic start generated code]*/
+
+static PyObject *
+_heapq_heapreplace_impl(PyObject *module, PyObject *heap, PyObject *item)
+/*[clinic end generated code: output=82ea55be8fbe24b4 input=719202ac02ba10c8]*/
+{
+ return heapreplace_internal(heap, item, siftup);
+}
+
+/*[clinic input]
+_heapq.heappushpop
+
+ heap: object(subclass_of='&PyList_Type')
+ item: object
+ /
+
+Push item on the heap, then pop and return the smallest item from the heap.
+
+The combined action runs more efficiently than heappush() followed by
+a separate call to heappop().
+[clinic start generated code]*/
+
+static PyObject *
+_heapq_heappushpop_impl(PyObject *module, PyObject *heap, PyObject *item)
+/*[clinic end generated code: output=67231dc98ed5774f input=5dc701f1eb4a4aa7]*/
+{
+ PyObject *returnitem;
+ int cmp;
+
+ if (PyList_GET_SIZE(heap) == 0) {
+ return Py_NewRef(item);
+ }
+
+ PyObject* top = PyList_GET_ITEM(heap, 0);
+ Py_INCREF(top);
+ cmp = PyObject_RichCompareBool(top, item, Py_LT);
+ Py_DECREF(top);
+ if (cmp < 0)
+ return NULL;
+ if (cmp == 0) {
+ return Py_NewRef(item);
+ }
+
+ if (PyList_GET_SIZE(heap) == 0) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return NULL;
+ }
+
+ returnitem = PyList_GET_ITEM(heap, 0);
+ PyList_SET_ITEM(heap, 0, Py_NewRef(item));
+ if (siftup((PyListObject *)heap, 0)) {
+ Py_DECREF(returnitem);
+ return NULL;
+ }
+ return returnitem;
+}
+
+static Py_ssize_t
+keep_top_bit(Py_ssize_t n)
+{
+ int i = 0;
+
+ while (n > 1) {
+ n >>= 1;
+ i++;
+ }
+ return n << i;
+}
+
+/* Cache friendly version of heapify()
+ -----------------------------------
+
+ Build-up a heap in O(n) time by performing siftup() operations
+ on nodes whose children are already heaps.
+
+ The simplest way is to sift the nodes in reverse order from
+ n//2-1 to 0 inclusive. The downside is that children may be
+ out of cache by the time their parent is reached.
+
+ A better way is to not wait for the children to go out of cache.
+ Once a sibling pair of child nodes have been sifted, immediately
+ sift their parent node (while the children are still in cache).
+
+ Both ways build child heaps before their parents, so both ways
+ do the exact same number of comparisons and produce exactly
+ the same heap. The only difference is that the traversal
+ order is optimized for cache efficiency.
+*/
+
+static PyObject *
+cache_friendly_heapify(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t))
+{
+ Py_ssize_t i, j, m, mhalf, leftmost;
+
+ m = PyList_GET_SIZE(heap) >> 1; /* index of first childless node */
+ leftmost = keep_top_bit(m + 1) - 1; /* leftmost node in row of m */
+ mhalf = m >> 1; /* parent of first childless node */
+
+ for (i = leftmost - 1 ; i >= mhalf ; i--) {
+ j = i;
+ while (1) {
+ if (siftup_func((PyListObject *)heap, j))
+ return NULL;
+ if (!(j & 1))
+ break;
+ j >>= 1;
+ }
+ }
+
+ for (i = m - 1 ; i >= leftmost ; i--) {
+ j = i;
+ while (1) {
+ if (siftup_func((PyListObject *)heap, j))
+ return NULL;
+ if (!(j & 1))
+ break;
+ j >>= 1;
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+heapify_internal(PyObject *heap, int siftup_func(PyListObject *, Py_ssize_t))
+{
+ Py_ssize_t i, n;
+
+ /* For heaps likely to be bigger than L1 cache, we use the cache
+ friendly heapify function. For smaller heaps that fit entirely
+ in cache, we prefer the simpler algorithm with less branching.
+ */
+ n = PyList_GET_SIZE(heap);
+ if (n > 2500)
+ return cache_friendly_heapify(heap, siftup_func);
+
+ /* Transform bottom-up. The largest index there's any point to
+ looking at is the largest with a child index in-range, so must
+ have 2*i + 1 < n, or i < (n-1)/2. If n is even = 2*j, this is
+ (2*j-1)/2 = j-1/2 so j-1 is the largest, which is n//2 - 1. If
+ n is odd = 2*j+1, this is (2*j+1-1)/2 = j so j-1 is the largest,
+ and that's again n//2-1.
+ */
+ for (i = (n >> 1) - 1 ; i >= 0 ; i--)
+ if (siftup_func((PyListObject *)heap, i))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_heapq.heapify
+
+ heap: object(subclass_of='&PyList_Type')
+ /
+
+Transform list into a heap, in-place, in O(len(heap)) time.
+[clinic start generated code]*/
+
+static PyObject *
+_heapq_heapify_impl(PyObject *module, PyObject *heap)
+/*[clinic end generated code: output=e63a636fcf83d6d0 input=53bb7a2166febb73]*/
+{
+ return heapify_internal(heap, siftup);
+}
+
+static int
+siftdown_max(PyListObject *heap, Py_ssize_t startpos, Py_ssize_t pos)
+{
+ PyObject *newitem, *parent, **arr;
+ Py_ssize_t parentpos, size;
+ int cmp;
+
+ assert(PyList_Check(heap));
+ size = PyList_GET_SIZE(heap);
+ if (pos >= size) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return -1;
+ }
+
+ /* Follow the path to the root, moving parents down until finding
+ a place newitem fits. */
+ arr = _PyList_ITEMS(heap);
+ newitem = arr[pos];
+ while (pos > startpos) {
+ parentpos = (pos - 1) >> 1;
+ parent = Py_NewRef(arr[parentpos]);
+ Py_INCREF(newitem);
+ cmp = PyObject_RichCompareBool(parent, newitem, Py_LT);
+ Py_DECREF(parent);
+ Py_DECREF(newitem);
+ if (cmp < 0)
+ return -1;
+ if (size != PyList_GET_SIZE(heap)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "list changed size during iteration");
+ return -1;
+ }
+ if (cmp == 0)
+ break;
+ arr = _PyList_ITEMS(heap);
+ parent = arr[parentpos];
+ newitem = arr[pos];
+ arr[parentpos] = newitem;
+ arr[pos] = parent;
+ pos = parentpos;
+ }
+ return 0;
+}
+
+static int
+siftup_max(PyListObject *heap, Py_ssize_t pos)
+{
+ Py_ssize_t startpos, endpos, childpos, limit;
+ PyObject *tmp1, *tmp2, **arr;
+ int cmp;
+
+ assert(PyList_Check(heap));
+ endpos = PyList_GET_SIZE(heap);
+ startpos = pos;
+ if (pos >= endpos) {
+ PyErr_SetString(PyExc_IndexError, "index out of range");
+ return -1;
+ }
+
+ /* Bubble up the smaller child until hitting a leaf. */
+ arr = _PyList_ITEMS(heap);
+ limit = endpos >> 1; /* smallest pos that has no child */
+ while (pos < limit) {
+ /* Set childpos to index of smaller child. */
+ childpos = 2*pos + 1; /* leftmost child position */
+ if (childpos + 1 < endpos) {
+ PyObject* a = arr[childpos + 1];
+ PyObject* b = arr[childpos];
+ Py_INCREF(a);
+ Py_INCREF(b);
+ cmp = PyObject_RichCompareBool(a, b, Py_LT);
+ Py_DECREF(a);
+ Py_DECREF(b);
+ if (cmp < 0)
+ return -1;
+ childpos += ((unsigned)cmp ^ 1); /* increment when cmp==0 */
+ arr = _PyList_ITEMS(heap); /* arr may have changed */
+ if (endpos != PyList_GET_SIZE(heap)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "list changed size during iteration");
+ return -1;
+ }
+ }
+ /* Move the smaller child up. */
+ tmp1 = arr[childpos];
+ tmp2 = arr[pos];
+ arr[childpos] = tmp2;
+ arr[pos] = tmp1;
+ pos = childpos;
+ }
+ /* Bubble it up to its final resting place (by sifting its parents down). */
+ return siftdown_max(heap, startpos, pos);
+}
+
+
+/*[clinic input]
+_heapq._heappop_max
+
+ heap: object(subclass_of='&PyList_Type')
+ /
+
+Maxheap variant of heappop.
+[clinic start generated code]*/
+
+static PyObject *
+_heapq__heappop_max_impl(PyObject *module, PyObject *heap)
+/*[clinic end generated code: output=9e77aadd4e6a8760 input=362c06e1c7484793]*/
+{
+ return heappop_internal(heap, siftup_max);
+}
+
+/*[clinic input]
+_heapq._heapreplace_max
+
+ heap: object(subclass_of='&PyList_Type')
+ item: object
+ /
+
+Maxheap variant of heapreplace.
+[clinic start generated code]*/
+
+static PyObject *
+_heapq__heapreplace_max_impl(PyObject *module, PyObject *heap,
+ PyObject *item)
+/*[clinic end generated code: output=8ad7545e4a5e8adb input=f2dd27cbadb948d7]*/
+{
+ return heapreplace_internal(heap, item, siftup_max);
+}
+
+/*[clinic input]
+_heapq._heapify_max
+
+ heap: object(subclass_of='&PyList_Type')
+ /
+
+Maxheap variant of heapify.
+[clinic start generated code]*/
+
+static PyObject *
+_heapq__heapify_max_impl(PyObject *module, PyObject *heap)
+/*[clinic end generated code: output=2cb028beb4a8b65e input=c1f765ee69f124b8]*/
+{
+ return heapify_internal(heap, siftup_max);
+}
+
+static PyMethodDef heapq_methods[] = {
+ _HEAPQ_HEAPPUSH_METHODDEF
+ _HEAPQ_HEAPPUSHPOP_METHODDEF
+ _HEAPQ_HEAPPOP_METHODDEF
+ _HEAPQ_HEAPREPLACE_METHODDEF
+ _HEAPQ_HEAPIFY_METHODDEF
+ _HEAPQ__HEAPPOP_MAX_METHODDEF
+ _HEAPQ__HEAPIFY_MAX_METHODDEF
+ _HEAPQ__HEAPREPLACE_MAX_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(module_doc,
+"Heap queue algorithm (a.k.a. priority queue).\n\
+\n\
+Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for\n\
+all k, counting elements from 0. For the sake of comparison,\n\
+non-existing elements are considered to be infinite. The interesting\n\
+property of a heap is that a[0] is always its smallest element.\n\
+\n\
+Usage:\n\
+\n\
+heap = [] # creates an empty heap\n\
+heappush(heap, item) # pushes a new item on the heap\n\
+item = heappop(heap) # pops the smallest item from the heap\n\
+item = heap[0] # smallest item on the heap without popping it\n\
+heapify(x) # transforms list into a heap, in-place, in linear time\n\
+item = heapreplace(heap, item) # pops and returns smallest item, and adds\n\
+ # new item; the heap size is unchanged\n\
+\n\
+Our API differs from textbook heap algorithms as follows:\n\
+\n\
+- We use 0-based indexing. This makes the relationship between the\n\
+ index for a node and the indexes for its children slightly less\n\
+ obvious, but is more suitable since Python uses 0-based indexing.\n\
+\n\
+- Our heappop() method returns the smallest item, not the largest.\n\
+\n\
+These two make it possible to view the heap as a regular Python list\n\
+without surprises: heap[0] is the smallest item, and heap.sort()\n\
+maintains the heap invariant!\n");
+
+
+PyDoc_STRVAR(__about__,
+"Heap queues\n\
+\n\
+[explanation by Fran\xc3\xa7ois Pinard]\n\
+\n\
+Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for\n\
+all k, counting elements from 0. For the sake of comparison,\n\
+non-existing elements are considered to be infinite. The interesting\n\
+property of a heap is that a[0] is always its smallest element.\n"
+"\n\
+The strange invariant above is meant to be an efficient memory\n\
+representation for a tournament. The numbers below are `k', not a[k]:\n\
+\n\
+ 0\n\
+\n\
+ 1 2\n\
+\n\
+ 3 4 5 6\n\
+\n\
+ 7 8 9 10 11 12 13 14\n\
+\n\
+ 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30\n\
+\n\
+\n\
+In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'. In\n\
+a usual binary tournament we see in sports, each cell is the winner\n\
+over the two cells it tops, and we can trace the winner down the tree\n\
+to see all opponents s/he had. However, in many computer applications\n\
+of such tournaments, we do not need to trace the history of a winner.\n\
+To be more memory efficient, when a winner is promoted, we try to\n\
+replace it by something else at a lower level, and the rule becomes\n\
+that a cell and the two cells it tops contain three different items,\n\
+but the top cell \"wins\" over the two topped cells.\n"
+"\n\
+If this heap invariant is protected at all time, index 0 is clearly\n\
+the overall winner. The simplest algorithmic way to remove it and\n\
+find the \"next\" winner is to move some loser (let's say cell 30 in the\n\
+diagram above) into the 0 position, and then percolate this new 0 down\n\
+the tree, exchanging values, until the invariant is re-established.\n\
+This is clearly logarithmic on the total number of items in the tree.\n\
+By iterating over all items, you get an O(n ln n) sort.\n"
+"\n\
+A nice feature of this sort is that you can efficiently insert new\n\
+items while the sort is going on, provided that the inserted items are\n\
+not \"better\" than the last 0'th element you extracted. This is\n\
+especially useful in simulation contexts, where the tree holds all\n\
+incoming events, and the \"win\" condition means the smallest scheduled\n\
+time. When an event schedule other events for execution, they are\n\
+scheduled into the future, so they can easily go into the heap. So, a\n\
+heap is a good structure for implementing schedulers (this is what I\n\
+used for my MIDI sequencer :-).\n"
+"\n\
+Various structures for implementing schedulers have been extensively\n\
+studied, and heaps are good for this, as they are reasonably speedy,\n\
+the speed is almost constant, and the worst case is not much different\n\
+than the average case. However, there are other representations which\n\
+are more efficient overall, yet the worst cases might be terrible.\n"
+"\n\
+Heaps are also very useful in big disk sorts. You most probably all\n\
+know that a big sort implies producing \"runs\" (which are pre-sorted\n\
+sequences, which size is usually related to the amount of CPU memory),\n\
+followed by a merging passes for these runs, which merging is often\n\
+very cleverly organised[1]. It is very important that the initial\n\
+sort produces the longest runs possible. Tournaments are a good way\n\
+to that. If, using all the memory available to hold a tournament, you\n\
+replace and percolate items that happen to fit the current run, you'll\n\
+produce runs which are twice the size of the memory for random input,\n\
+and much better for input fuzzily ordered.\n"
+"\n\
+Moreover, if you output the 0'th item on disk and get an input which\n\
+may not fit in the current tournament (because the value \"wins\" over\n\
+the last output value), it cannot fit in the heap, so the size of the\n\
+heap decreases. The freed memory could be cleverly reused immediately\n\
+for progressively building a second heap, which grows at exactly the\n\
+same rate the first heap is melting. When the first heap completely\n\
+vanishes, you switch heaps and start a new run. Clever and quite\n\
+effective!\n\
+\n\
+In a word, heaps are useful memory structures to know. I use them in\n\
+a few applications, and I think it is good to keep a `heap' module\n\
+around. :-)\n"
+"\n\
+--------------------\n\
+[1] The disk balancing algorithms which are current, nowadays, are\n\
+more annoying than clever, and this is a consequence of the seeking\n\
+capabilities of the disks. On devices which cannot seek, like big\n\
+tape drives, the story was quite different, and one had to be very\n\
+clever to ensure (far in advance) that each tape movement will be the\n\
+most effective possible (that is, will best participate at\n\
+\"progressing\" the merge). Some tapes were even able to read\n\
+backwards, and this was also used to avoid the rewinding time.\n\
+Believe me, real good tape sorts were quite spectacular to watch!\n\
+From all times, sorting has always been a Great Art! :-)\n");
+
+
+static int
+heapq_exec(PyObject *m)
+{
+ PyObject *about = PyUnicode_FromString(__about__);
+ if (PyModule_AddObject(m, "__about__", about) < 0) {
+ Py_DECREF(about);
+ return -1;
+ }
+ return 0;
+}
+
+static struct PyModuleDef_Slot heapq_slots[] = {
+ {Py_mod_exec, heapq_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _heapqmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_heapq",
+ module_doc,
+ 0,
+ heapq_methods,
+ heapq_slots,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__heapq(void)
+{
+ return PyModuleDef_Init(&_heapqmodule);
+}
diff --git a/contrib/tools/python3/Modules/_io/_iomodule.c b/contrib/tools/python3/Modules/_io/_iomodule.c
new file mode 100644
index 00000000000..7b06c1bee5a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/_iomodule.c
@@ -0,0 +1,739 @@
+/*
+ An implementation of the new I/O lib as defined by PEP 3116 - "New I/O"
+
+ Classes defined here: UnsupportedOperation, BlockingIOError.
+ Functions defined here: open().
+
+ Mostly written by Amaury Forgeot d'Arc
+*/
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "_iomodule.h"
+#include "pycore_pystate.h" // _PyInterpreterState_GET()
+#include "pycore_initconfig.h" // _PyStatus_OK()
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef MS_WINDOWS
+#include <windows.h>
+#endif
+
+PyDoc_STRVAR(module_doc,
+"The io module provides the Python interfaces to stream handling. The\n"
+"builtin open function is defined in this module.\n"
+"\n"
+"At the top of the I/O hierarchy is the abstract base class IOBase. It\n"
+"defines the basic interface to a stream. Note, however, that there is no\n"
+"separation between reading and writing to streams; implementations are\n"
+"allowed to raise an OSError if they do not support a given operation.\n"
+"\n"
+"Extending IOBase is RawIOBase which deals simply with the reading and\n"
+"writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide\n"
+"an interface to OS files.\n"
+"\n"
+"BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its\n"
+"subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer\n"
+"streams that are readable, writable, and both respectively.\n"
+"BufferedRandom provides a buffered interface to random access\n"
+"streams. BytesIO is a simple stream of in-memory bytes.\n"
+"\n"
+"Another IOBase subclass, TextIOBase, deals with the encoding and decoding\n"
+"of streams into text. TextIOWrapper, which extends it, is a buffered text\n"
+"interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO\n"
+"is an in-memory stream for text.\n"
+"\n"
+"Argument names are not part of the specification, and only the arguments\n"
+"of open() are intended to be used as keyword arguments.\n"
+"\n"
+"data:\n"
+"\n"
+"DEFAULT_BUFFER_SIZE\n"
+"\n"
+" An int containing the default buffer size used by the module's buffered\n"
+" I/O classes. open() uses the file's blksize (as obtained by os.stat) if\n"
+" possible.\n"
+ );
+
+
+/*
+ * The main open() function
+ */
+/*[clinic input]
+module _io
+
+_io.open
+ file: object
+ mode: str = "r"
+ buffering: int = -1
+ encoding: str(accept={str, NoneType}) = None
+ errors: str(accept={str, NoneType}) = None
+ newline: str(accept={str, NoneType}) = None
+ closefd: bool = True
+ opener: object = None
+
+Open file and return a stream. Raise OSError upon failure.
+
+file is either a text or byte string giving the name (and the path
+if the file isn't in the current working directory) of the file to
+be opened or an integer file descriptor of the file to be
+wrapped. (If a file descriptor is given, it is closed when the
+returned I/O object is closed, unless closefd is set to False.)
+
+mode is an optional string that specifies the mode in which the file
+is opened. It defaults to 'r' which means open for reading in text
+mode. Other common values are 'w' for writing (truncating the file if
+it already exists), 'x' for creating and writing to a new file, and
+'a' for appending (which on some Unix systems, means that all writes
+append to the end of the file regardless of the current seek position).
+In text mode, if encoding is not specified the encoding used is platform
+dependent: locale.getencoding() is called to get the current locale encoding.
+(For reading and writing raw bytes use binary mode and leave encoding
+unspecified.) The available modes are:
+
+========= ===============================================================
+Character Meaning
+--------- ---------------------------------------------------------------
+'r' open for reading (default)
+'w' open for writing, truncating the file first
+'x' create a new file and open it for writing
+'a' open for writing, appending to the end of the file if it exists
+'b' binary mode
+'t' text mode (default)
+'+' open a disk file for updating (reading and writing)
+========= ===============================================================
+
+The default mode is 'rt' (open for reading text). For binary random
+access, the mode 'w+b' opens and truncates the file to 0 bytes, while
+'r+b' opens the file without truncation. The 'x' mode implies 'w' and
+raises an `FileExistsError` if the file already exists.
+
+Python distinguishes between files opened in binary and text modes,
+even when the underlying operating system doesn't. Files opened in
+binary mode (appending 'b' to the mode argument) return contents as
+bytes objects without any decoding. In text mode (the default, or when
+'t' is appended to the mode argument), the contents of the file are
+returned as strings, the bytes having been first decoded using a
+platform-dependent encoding or using the specified encoding if given.
+
+buffering is an optional integer used to set the buffering policy.
+Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
+line buffering (only usable in text mode), and an integer > 1 to indicate
+the size of a fixed-size chunk buffer. When no buffering argument is
+given, the default buffering policy works as follows:
+
+* Binary files are buffered in fixed-size chunks; the size of the buffer
+ is chosen using a heuristic trying to determine the underlying device's
+ "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
+ On many systems, the buffer will typically be 4096 or 8192 bytes long.
+
+* "Interactive" text files (files for which isatty() returns True)
+ use line buffering. Other text files use the policy described above
+ for binary files.
+
+encoding is the name of the encoding used to decode or encode the
+file. This should only be used in text mode. The default encoding is
+platform dependent, but any encoding supported by Python can be
+passed. See the codecs module for the list of supported encodings.
+
+errors is an optional string that specifies how encoding errors are to
+be handled---this argument should not be used in binary mode. Pass
+'strict' to raise a ValueError exception if there is an encoding error
+(the default of None has the same effect), or pass 'ignore' to ignore
+errors. (Note that ignoring encoding errors can lead to data loss.)
+See the documentation for codecs.register or run 'help(codecs.Codec)'
+for a list of the permitted encoding error strings.
+
+newline controls how universal newlines works (it only applies to text
+mode). It can be None, '', '\n', '\r', and '\r\n'. It works as
+follows:
+
+* On input, if newline is None, universal newlines mode is
+ enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
+ these are translated into '\n' before being returned to the
+ caller. If it is '', universal newline mode is enabled, but line
+ endings are returned to the caller untranslated. If it has any of
+ the other legal values, input lines are only terminated by the given
+ string, and the line ending is returned to the caller untranslated.
+
+* On output, if newline is None, any '\n' characters written are
+ translated to the system default line separator, os.linesep. If
+ newline is '' or '\n', no translation takes place. If newline is any
+ of the other legal values, any '\n' characters written are translated
+ to the given string.
+
+If closefd is False, the underlying file descriptor will be kept open
+when the file is closed. This does not work when a file name is given
+and must be True in that case.
+
+A custom opener can be used by passing a callable as *opener*. The
+underlying file descriptor for the file object is then obtained by
+calling *opener* with (*file*, *flags*). *opener* must return an open
+file descriptor (passing os.open as *opener* results in functionality
+similar to passing None).
+
+open() returns a file object whose type depends on the mode, and
+through which the standard file operations such as reading and writing
+are performed. When open() is used to open a file in a text mode ('w',
+'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
+a file in a binary mode, the returned class varies: in read binary
+mode, it returns a BufferedReader; in write binary and append binary
+modes, it returns a BufferedWriter, and in read/write mode, it returns
+a BufferedRandom.
+
+It is also possible to use a string or bytearray as a file for both
+reading and writing. For strings StringIO can be used like a file
+opened in a text mode, and for bytes a BytesIO can be used like a file
+opened in a binary mode.
+[clinic start generated code]*/
+
+static PyObject *
+_io_open_impl(PyObject *module, PyObject *file, const char *mode,
+ int buffering, const char *encoding, const char *errors,
+ const char *newline, int closefd, PyObject *opener)
+/*[clinic end generated code: output=aefafc4ce2b46dc0 input=cd034e7cdfbf4e78]*/
+{
+ unsigned i;
+
+ int creating = 0, reading = 0, writing = 0, appending = 0, updating = 0;
+ int text = 0, binary = 0;
+
+ char rawmode[6], *m;
+ int line_buffering, is_number, isatty = 0;
+
+ PyObject *raw, *modeobj = NULL, *buffer, *wrapper, *result = NULL, *path_or_fd = NULL;
+
+ is_number = PyNumber_Check(file);
+
+ if (is_number) {
+ path_or_fd = Py_NewRef(file);
+ } else {
+ path_or_fd = PyOS_FSPath(file);
+ if (path_or_fd == NULL) {
+ return NULL;
+ }
+ }
+
+ if (!is_number &&
+ !PyUnicode_Check(path_or_fd) &&
+ !PyBytes_Check(path_or_fd)) {
+ PyErr_Format(PyExc_TypeError, "invalid file: %R", file);
+ goto error;
+ }
+
+ /* Decode mode */
+ for (i = 0; i < strlen(mode); i++) {
+ char c = mode[i];
+
+ switch (c) {
+ case 'x':
+ creating = 1;
+ break;
+ case 'r':
+ reading = 1;
+ break;
+ case 'w':
+ writing = 1;
+ break;
+ case 'a':
+ appending = 1;
+ break;
+ case '+':
+ updating = 1;
+ break;
+ case 't':
+ text = 1;
+ break;
+ case 'b':
+ binary = 1;
+ break;
+ default:
+ goto invalid_mode;
+ }
+
+ /* c must not be duplicated */
+ if (strchr(mode+i+1, c)) {
+ invalid_mode:
+ PyErr_Format(PyExc_ValueError, "invalid mode: '%s'", mode);
+ goto error;
+ }
+
+ }
+
+ m = rawmode;
+ if (creating) *(m++) = 'x';
+ if (reading) *(m++) = 'r';
+ if (writing) *(m++) = 'w';
+ if (appending) *(m++) = 'a';
+ if (updating) *(m++) = '+';
+ *m = '\0';
+
+ /* Parameters validation */
+ if (text && binary) {
+ PyErr_SetString(PyExc_ValueError,
+ "can't have text and binary mode at once");
+ goto error;
+ }
+
+ if (creating + reading + writing + appending > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "must have exactly one of create/read/write/append mode");
+ goto error;
+ }
+
+ if (binary && encoding != NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "binary mode doesn't take an encoding argument");
+ goto error;
+ }
+
+ if (binary && errors != NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "binary mode doesn't take an errors argument");
+ goto error;
+ }
+
+ if (binary && newline != NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "binary mode doesn't take a newline argument");
+ goto error;
+ }
+
+ if (binary && buffering == 1) {
+ if (PyErr_WarnEx(PyExc_RuntimeWarning,
+ "line buffering (buffering=1) isn't supported in "
+ "binary mode, the default buffer size will be used",
+ 1) < 0) {
+ goto error;
+ }
+ }
+
+ /* Create the Raw file stream */
+ _PyIO_State *state = get_io_state(module);
+ {
+ PyObject *RawIO_class = (PyObject *)state->PyFileIO_Type;
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+ const PyConfig *config = _Py_GetConfig();
+ if (!config->legacy_windows_stdio && _PyIO_get_console_type(path_or_fd) != '\0') {
+ RawIO_class = (PyObject *)state->PyWindowsConsoleIO_Type;
+ encoding = "utf-8";
+ }
+#endif
+ raw = PyObject_CallFunction(RawIO_class, "OsOO",
+ path_or_fd, rawmode,
+ closefd ? Py_True : Py_False,
+ opener);
+ }
+
+ if (raw == NULL)
+ goto error;
+ result = raw;
+
+ Py_SETREF(path_or_fd, NULL);
+
+ modeobj = PyUnicode_FromString(mode);
+ if (modeobj == NULL)
+ goto error;
+
+ /* buffering */
+ if (buffering < 0) {
+ PyObject *res = PyObject_CallMethodNoArgs(raw, &_Py_ID(isatty));
+ if (res == NULL)
+ goto error;
+ isatty = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (isatty < 0)
+ goto error;
+ }
+
+ if (buffering == 1 || isatty) {
+ buffering = -1;
+ line_buffering = 1;
+ }
+ else
+ line_buffering = 0;
+
+ if (buffering < 0) {
+ PyObject *blksize_obj;
+ blksize_obj = PyObject_GetAttr(raw, &_Py_ID(_blksize));
+ if (blksize_obj == NULL)
+ goto error;
+ buffering = PyLong_AsLong(blksize_obj);
+ Py_DECREF(blksize_obj);
+ if (buffering == -1 && PyErr_Occurred())
+ goto error;
+ }
+ if (buffering < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid buffering size");
+ goto error;
+ }
+
+ /* if not buffering, returns the raw file object */
+ if (buffering == 0) {
+ if (!binary) {
+ PyErr_SetString(PyExc_ValueError,
+ "can't have unbuffered text I/O");
+ goto error;
+ }
+
+ Py_DECREF(modeobj);
+ return result;
+ }
+
+ /* wraps into a buffered file */
+ {
+ PyObject *Buffered_class;
+
+ if (updating) {
+ Buffered_class = (PyObject *)state->PyBufferedRandom_Type;
+ }
+ else if (creating || writing || appending) {
+ Buffered_class = (PyObject *)state->PyBufferedWriter_Type;
+ }
+ else if (reading) {
+ Buffered_class = (PyObject *)state->PyBufferedReader_Type;
+ }
+ else {
+ PyErr_Format(PyExc_ValueError,
+ "unknown mode: '%s'", mode);
+ goto error;
+ }
+
+ buffer = PyObject_CallFunction(Buffered_class, "Oi", raw, buffering);
+ }
+ if (buffer == NULL)
+ goto error;
+ result = buffer;
+ Py_DECREF(raw);
+
+
+ /* if binary, returns the buffered file */
+ if (binary) {
+ Py_DECREF(modeobj);
+ return result;
+ }
+
+ /* wraps into a TextIOWrapper */
+ wrapper = PyObject_CallFunction((PyObject *)state->PyTextIOWrapper_Type,
+ "OsssO",
+ buffer,
+ encoding, errors, newline,
+ line_buffering ? Py_True : Py_False);
+ if (wrapper == NULL)
+ goto error;
+ result = wrapper;
+ Py_DECREF(buffer);
+
+ if (PyObject_SetAttr(wrapper, &_Py_ID(mode), modeobj) < 0)
+ goto error;
+ Py_DECREF(modeobj);
+ return result;
+
+ error:
+ if (result != NULL) {
+ PyObject *exc = PyErr_GetRaisedException();
+ PyObject *close_result = PyObject_CallMethodNoArgs(result, &_Py_ID(close));
+ _PyErr_ChainExceptions1(exc);
+ Py_XDECREF(close_result);
+ Py_DECREF(result);
+ }
+ Py_XDECREF(path_or_fd);
+ Py_XDECREF(modeobj);
+ return NULL;
+}
+
+
+/*[clinic input]
+_io.text_encoding
+ encoding: object
+ stacklevel: int = 2
+ /
+
+A helper function to choose the text encoding.
+
+When encoding is not None, this function returns it.
+Otherwise, this function returns the default text encoding
+(i.e. "locale" or "utf-8" depends on UTF-8 mode).
+
+This function emits an EncodingWarning if encoding is None and
+sys.flags.warn_default_encoding is true.
+
+This can be used in APIs with an encoding=None parameter.
+However, please consider using encoding="utf-8" for new APIs.
+[clinic start generated code]*/
+
+static PyObject *
+_io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel)
+/*[clinic end generated code: output=91b2cfea6934cc0c input=4999aa8b3d90f3d4]*/
+{
+ if (encoding == NULL || encoding == Py_None) {
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (_PyInterpreterState_GetConfig(interp)->warn_default_encoding) {
+ if (PyErr_WarnEx(PyExc_EncodingWarning,
+ "'encoding' argument not specified", stacklevel)) {
+ return NULL;
+ }
+ }
+ const PyPreConfig *preconfig = &_PyRuntime.preconfig;
+ if (preconfig->utf8_mode) {
+ _Py_DECLARE_STR(utf_8, "utf-8");
+ encoding = &_Py_STR(utf_8);
+ }
+ else {
+ encoding = &_Py_ID(locale);
+ }
+ }
+ return Py_NewRef(encoding);
+}
+
+
+/*[clinic input]
+_io.open_code
+
+ path : unicode
+
+Opens the provided file with the intent to import the contents.
+
+This may perform extra validation beyond open(), but is otherwise interchangeable
+with calling open(path, 'rb').
+
+[clinic start generated code]*/
+
+static PyObject *
+_io_open_code_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=2fe4ecbd6f3d6844 input=f5c18e23f4b2ed9f]*/
+{
+ return PyFile_OpenCodeObject(path);
+}
+
+/*
+ * Private helpers for the io module.
+ */
+
+Py_off_t
+PyNumber_AsOff_t(PyObject *item, PyObject *err)
+{
+ Py_off_t result;
+ PyObject *runerr;
+ PyObject *value = _PyNumber_Index(item);
+ if (value == NULL)
+ return -1;
+
+ /* We're done if PyLong_AsSsize_t() returns without error. */
+ result = PyLong_AsOff_t(value);
+ if (result != -1 || !(runerr = PyErr_Occurred()))
+ goto finish;
+
+ /* Error handling code -- only manage OverflowError differently */
+ if (!PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError))
+ goto finish;
+
+ PyErr_Clear();
+ /* If no error-handling desired then the default clipping
+ is sufficient.
+ */
+ if (!err) {
+ assert(PyLong_Check(value));
+ /* Whether or not it is less than or equal to
+ zero is determined by the sign of ob_size
+ */
+ if (_PyLong_Sign(value) < 0)
+ result = PY_OFF_T_MIN;
+ else
+ result = PY_OFF_T_MAX;
+ }
+ else {
+ /* Otherwise replace the error with caller's error object. */
+ PyErr_Format(err,
+ "cannot fit '%.200s' into an offset-sized integer",
+ Py_TYPE(item)->tp_name);
+ }
+
+ finish:
+ Py_DECREF(value);
+ return result;
+}
+
+static int
+iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
+ _PyIO_State *state = get_io_state(mod);
+ Py_VISIT(state->unsupported_operation);
+
+ Py_VISIT(state->PyIOBase_Type);
+ Py_VISIT(state->PyIncrementalNewlineDecoder_Type);
+ Py_VISIT(state->PyRawIOBase_Type);
+ Py_VISIT(state->PyBufferedIOBase_Type);
+ Py_VISIT(state->PyBufferedRWPair_Type);
+ Py_VISIT(state->PyBufferedRandom_Type);
+ Py_VISIT(state->PyBufferedReader_Type);
+ Py_VISIT(state->PyBufferedWriter_Type);
+ Py_VISIT(state->PyBytesIOBuffer_Type);
+ Py_VISIT(state->PyBytesIO_Type);
+ Py_VISIT(state->PyFileIO_Type);
+ Py_VISIT(state->PyStringIO_Type);
+ Py_VISIT(state->PyTextIOBase_Type);
+ Py_VISIT(state->PyTextIOWrapper_Type);
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+ Py_VISIT(state->PyWindowsConsoleIO_Type);
+#endif
+ return 0;
+}
+
+
+static int
+iomodule_clear(PyObject *mod) {
+ _PyIO_State *state = get_io_state(mod);
+ Py_CLEAR(state->unsupported_operation);
+
+ Py_CLEAR(state->PyIOBase_Type);
+ Py_CLEAR(state->PyIncrementalNewlineDecoder_Type);
+ Py_CLEAR(state->PyRawIOBase_Type);
+ Py_CLEAR(state->PyBufferedIOBase_Type);
+ Py_CLEAR(state->PyBufferedRWPair_Type);
+ Py_CLEAR(state->PyBufferedRandom_Type);
+ Py_CLEAR(state->PyBufferedReader_Type);
+ Py_CLEAR(state->PyBufferedWriter_Type);
+ Py_CLEAR(state->PyBytesIOBuffer_Type);
+ Py_CLEAR(state->PyBytesIO_Type);
+ Py_CLEAR(state->PyFileIO_Type);
+ Py_CLEAR(state->PyStringIO_Type);
+ Py_CLEAR(state->PyTextIOBase_Type);
+ Py_CLEAR(state->PyTextIOWrapper_Type);
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+ Py_CLEAR(state->PyWindowsConsoleIO_Type);
+#endif
+ return 0;
+}
+
+static void
+iomodule_free(void *mod)
+{
+ (void)iomodule_clear((PyObject *)mod);
+}
+
+
+/*
+ * Module definition
+ */
+
+#define clinic_state() (get_io_state(module))
+#include "clinic/_iomodule.c.h"
+#undef clinic_state
+
+static PyMethodDef module_methods[] = {
+ _IO_OPEN_METHODDEF
+ _IO_TEXT_ENCODING_METHODDEF
+ _IO_OPEN_CODE_METHODDEF
+ {NULL, NULL}
+};
+
+#define ADD_TYPE(module, type, spec, base) \
+do { \
+ type = (PyTypeObject *)PyType_FromModuleAndSpec(module, spec, \
+ (PyObject *)base); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddType(module, type) < 0) { \
+ return -1; \
+ } \
+} while (0)
+
+static int
+iomodule_exec(PyObject *m)
+{
+ _PyIO_State *state = get_io_state(m);
+
+ /* DEFAULT_BUFFER_SIZE */
+ if (PyModule_AddIntMacro(m, DEFAULT_BUFFER_SIZE) < 0)
+ return -1;
+
+ /* UnsupportedOperation inherits from ValueError and OSError */
+ state->unsupported_operation = PyObject_CallFunction(
+ (PyObject *)&PyType_Type, "s(OO){}",
+ "UnsupportedOperation", PyExc_OSError, PyExc_ValueError);
+ if (state->unsupported_operation == NULL)
+ return -1;
+ if (PyModule_AddObjectRef(m, "UnsupportedOperation",
+ state->unsupported_operation) < 0)
+ {
+ return -1;
+ }
+
+ /* BlockingIOError, for compatibility */
+ if (PyModule_AddObjectRef(m, "BlockingIOError",
+ (PyObject *) PyExc_BlockingIOError) < 0) {
+ return -1;
+ }
+
+ // Base classes
+ ADD_TYPE(m, state->PyIncrementalNewlineDecoder_Type, &nldecoder_spec, NULL);
+ ADD_TYPE(m, state->PyBytesIOBuffer_Type, &bytesiobuf_spec, NULL);
+ ADD_TYPE(m, state->PyIOBase_Type, &iobase_spec, NULL);
+
+ // PyIOBase_Type subclasses
+ ADD_TYPE(m, state->PyTextIOBase_Type, &textiobase_spec,
+ state->PyIOBase_Type);
+ ADD_TYPE(m, state->PyBufferedIOBase_Type, &bufferediobase_spec,
+ state->PyIOBase_Type);
+ ADD_TYPE(m, state->PyRawIOBase_Type, &rawiobase_spec,
+ state->PyIOBase_Type);
+
+ // PyBufferedIOBase_Type(PyIOBase_Type) subclasses
+ ADD_TYPE(m, state->PyBytesIO_Type, &bytesio_spec, state->PyBufferedIOBase_Type);
+ ADD_TYPE(m, state->PyBufferedWriter_Type, &bufferedwriter_spec,
+ state->PyBufferedIOBase_Type);
+ ADD_TYPE(m, state->PyBufferedReader_Type, &bufferedreader_spec,
+ state->PyBufferedIOBase_Type);
+ ADD_TYPE(m, state->PyBufferedRWPair_Type, &bufferedrwpair_spec,
+ state->PyBufferedIOBase_Type);
+ ADD_TYPE(m, state->PyBufferedRandom_Type, &bufferedrandom_spec,
+ state->PyBufferedIOBase_Type);
+
+ // PyRawIOBase_Type(PyIOBase_Type) subclasses
+ ADD_TYPE(m, state->PyFileIO_Type, &fileio_spec, state->PyRawIOBase_Type);
+
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+ ADD_TYPE(m, state->PyWindowsConsoleIO_Type, &winconsoleio_spec,
+ state->PyRawIOBase_Type);
+#endif
+
+ // PyTextIOBase_Type(PyIOBase_Type) subclasses
+ ADD_TYPE(m, state->PyStringIO_Type, &stringio_spec, state->PyTextIOBase_Type);
+ ADD_TYPE(m, state->PyTextIOWrapper_Type, &textiowrapper_spec,
+ state->PyTextIOBase_Type);
+
+#undef ADD_TYPE
+ return 0;
+}
+
+static struct PyModuleDef_Slot iomodule_slots[] = {
+ {Py_mod_exec, iomodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+struct PyModuleDef _PyIO_Module = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "io",
+ .m_doc = module_doc,
+ .m_size = sizeof(_PyIO_State),
+ .m_methods = module_methods,
+ .m_traverse = iomodule_traverse,
+ .m_clear = iomodule_clear,
+ .m_free = iomodule_free,
+ .m_slots = iomodule_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__io(void)
+{
+ return PyModuleDef_Init(&_PyIO_Module);
+}
diff --git a/contrib/tools/python3/Modules/_io/_iomodule.h b/contrib/tools/python3/Modules/_io/_iomodule.h
new file mode 100644
index 00000000000..afd638a120b
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/_iomodule.h
@@ -0,0 +1,197 @@
+/*
+ * Declarations shared between the different parts of the io module
+ */
+
+#include "exports.h"
+
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+#include "structmember.h"
+
+/* Type specs */
+extern PyType_Spec bufferediobase_spec;
+extern PyType_Spec bufferedrandom_spec;
+extern PyType_Spec bufferedreader_spec;
+extern PyType_Spec bufferedrwpair_spec;
+extern PyType_Spec bufferedwriter_spec;
+extern PyType_Spec bytesio_spec;
+extern PyType_Spec bytesiobuf_spec;
+extern PyType_Spec fileio_spec;
+extern PyType_Spec iobase_spec;
+extern PyType_Spec nldecoder_spec;
+extern PyType_Spec rawiobase_spec;
+extern PyType_Spec stringio_spec;
+extern PyType_Spec textiobase_spec;
+extern PyType_Spec textiowrapper_spec;
+
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+extern PyType_Spec winconsoleio_spec;
+#endif
+
+/* These functions are used as METH_NOARGS methods, are normally called
+ * with args=NULL, and return a new reference.
+ * BUT when args=Py_True is passed, they return a borrowed reference.
+ */
+typedef struct _io_state _PyIO_State; // Forward decl.
+extern PyObject* _PyIOBase_check_readable(_PyIO_State *state,
+ PyObject *self, PyObject *args);
+extern PyObject* _PyIOBase_check_writable(_PyIO_State *state,
+ PyObject *self, PyObject *args);
+extern PyObject* _PyIOBase_check_seekable(_PyIO_State *state,
+ PyObject *self, PyObject *args);
+extern PyObject* _PyIOBase_check_closed(PyObject *self, PyObject *args);
+
+/* Helper for finalization.
+ This function will revive an object ready to be deallocated and try to
+ close() it. It returns 0 if the object can be destroyed, or -1 if it
+ is alive again. */
+extern int _PyIOBase_finalize(PyObject *self);
+
+/* Returns true if the given FileIO object is closed.
+ Doesn't check the argument type, so be careful! */
+extern int _PyFileIO_closed(PyObject *self);
+
+/* Shortcut to the core of the IncrementalNewlineDecoder.decode method */
+extern PyObject *_PyIncrementalNewlineDecoder_decode(
+ PyObject *self, PyObject *input, int final);
+
+/* Finds the first line ending between `start` and `end`.
+ If found, returns the index after the line ending and doesn't touch
+ `*consumed`.
+ If not found, returns -1 and sets `*consumed` to the number of characters
+ which can be safely put aside until another search.
+
+ NOTE: for performance reasons, `end` must point to a NUL character ('\0').
+ Otherwise, the function will scan further and return garbage.
+
+ There are three modes, in order of priority:
+ * translated: Only find \n (assume newlines already translated)
+ * universal: Use universal newlines algorithm
+ * Otherwise, the line ending is specified by readnl, a str object */
+extern Py_ssize_t _PyIO_find_line_ending(
+ int translated, int universal, PyObject *readnl,
+ int kind, const char *start, const char *end, Py_ssize_t *consumed);
+
+/* Return 1 if an OSError with errno == EINTR is set (and then
+ clears the error indicator), 0 otherwise.
+ Should only be called when PyErr_Occurred() is true.
+*/
+extern int _PyIO_trap_eintr(void);
+
+#define DEFAULT_BUFFER_SIZE (8 * 1024) /* bytes */
+
+/*
+ * Offset type for positioning.
+ */
+
+/* Printing a variable of type off_t (with e.g., PyUnicode_FromFormat)
+ correctly and without producing compiler warnings is surprisingly painful.
+ We identify an integer type whose size matches off_t and then: (1) cast the
+ off_t to that integer type and (2) use the appropriate conversion
+ specification. The cast is necessary: gcc complains about formatting a
+ long with "%lld" even when both long and long long have the same
+ precision. */
+
+#ifdef MS_WINDOWS
+
+/* Windows uses long long for offsets */
+typedef long long Py_off_t;
+# define PyLong_AsOff_t PyLong_AsLongLong
+# define PyLong_FromOff_t PyLong_FromLongLong
+# define PY_OFF_T_MAX LLONG_MAX
+# define PY_OFF_T_MIN LLONG_MIN
+# define PY_OFF_T_COMPAT long long /* type compatible with off_t */
+# define PY_PRIdOFF "lld" /* format to use for that type */
+
+#else
+
+/* Other platforms use off_t */
+typedef off_t Py_off_t;
+#if (SIZEOF_OFF_T == SIZEOF_SIZE_T)
+# define PyLong_AsOff_t PyLong_AsSsize_t
+# define PyLong_FromOff_t PyLong_FromSsize_t
+# define PY_OFF_T_MAX PY_SSIZE_T_MAX
+# define PY_OFF_T_MIN PY_SSIZE_T_MIN
+# define PY_OFF_T_COMPAT Py_ssize_t
+# define PY_PRIdOFF "zd"
+#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG)
+# define PyLong_AsOff_t PyLong_AsLongLong
+# define PyLong_FromOff_t PyLong_FromLongLong
+# define PY_OFF_T_MAX LLONG_MAX
+# define PY_OFF_T_MIN LLONG_MIN
+# define PY_OFF_T_COMPAT long long
+# define PY_PRIdOFF "lld"
+#elif (SIZEOF_OFF_T == SIZEOF_LONG)
+# define PyLong_AsOff_t PyLong_AsLong
+# define PyLong_FromOff_t PyLong_FromLong
+# define PY_OFF_T_MAX LONG_MAX
+# define PY_OFF_T_MIN LONG_MIN
+# define PY_OFF_T_COMPAT long
+# define PY_PRIdOFF "ld"
+#else
+# error off_t does not match either size_t, long, or long long!
+#endif
+
+#endif
+
+extern Py_off_t PyNumber_AsOff_t(PyObject *item, PyObject *err);
+
+/* Implementation details */
+
+/* IO module structure */
+
+extern PyModuleDef _PyIO_Module;
+
+struct _io_state {
+ int initialized;
+ PyObject *unsupported_operation;
+
+ /* Types */
+ PyTypeObject *PyIOBase_Type;
+ PyTypeObject *PyIncrementalNewlineDecoder_Type;
+ PyTypeObject *PyRawIOBase_Type;
+ PyTypeObject *PyBufferedIOBase_Type;
+ PyTypeObject *PyBufferedRWPair_Type;
+ PyTypeObject *PyBufferedRandom_Type;
+ PyTypeObject *PyBufferedReader_Type;
+ PyTypeObject *PyBufferedWriter_Type;
+ PyTypeObject *PyBytesIOBuffer_Type;
+ PyTypeObject *PyBytesIO_Type;
+ PyTypeObject *PyFileIO_Type;
+ PyTypeObject *PyStringIO_Type;
+ PyTypeObject *PyTextIOBase_Type;
+ PyTypeObject *PyTextIOWrapper_Type;
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+ PyTypeObject *PyWindowsConsoleIO_Type;
+#endif
+};
+
+static inline _PyIO_State *
+get_io_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_PyIO_State *)state;
+}
+
+static inline _PyIO_State *
+get_io_state_by_cls(PyTypeObject *cls)
+{
+ void *state = _PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return (_PyIO_State *)state;
+}
+
+static inline _PyIO_State *
+find_io_state_by_def(PyTypeObject *type)
+{
+ PyObject *mod = PyType_GetModuleByDef(type, &_PyIO_Module);
+ assert(mod != NULL);
+ return get_io_state(mod);
+}
+
+extern PyObject *_PyIOBase_cannot_pickle(PyObject *self, PyObject *args);
+
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+extern char _PyIO_get_console_type(PyObject *);
+#endif
diff --git a/contrib/tools/python3/Modules/_io/bufferedio.c b/contrib/tools/python3/Modules/_io/bufferedio.c
new file mode 100644
index 00000000000..f30d54a5e11
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/bufferedio.c
@@ -0,0 +1,2692 @@
+/*
+ An implementation of Buffered I/O as defined by PEP 3116 - "New I/O"
+
+ Classes defined here: BufferedIOBase, BufferedReader, BufferedWriter,
+ BufferedRandom.
+
+ Written by Amaury Forgeot d'Arc and Antoine Pitrou
+*/
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_object.h"
+#include "structmember.h" // PyMemberDef
+#include "_iomodule.h"
+
+/*[clinic input]
+module _io
+class _io._BufferedIOBase "PyObject *" "clinic_state()->PyBufferedIOBase_Type"
+class _io._Buffered "buffered *" "clinic_state()->PyBufferedIOBase_Type"
+class _io.BufferedReader "buffered *" "clinic_state()->PyBufferedReader_Type"
+class _io.BufferedWriter "buffered *" "clinic_state()->PyBufferedWriter_Type"
+class _io.BufferedRWPair "rwpair *" "clinic_state()->PyBufferedRWPair_Type"
+class _io.BufferedRandom "buffered *" "clinic_state()->PyBufferedRandom_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3b3ef9cbbbad4590]*/
+
+/*
+ * BufferedIOBase class, inherits from IOBase.
+ */
+PyDoc_STRVAR(bufferediobase_doc,
+ "Base class for buffered IO objects.\n"
+ "\n"
+ "The main difference with RawIOBase is that the read() method\n"
+ "supports omitting the size argument, and does not have a default\n"
+ "implementation that defers to readinto().\n"
+ "\n"
+ "In addition, read(), readinto() and write() may raise\n"
+ "BlockingIOError if the underlying raw stream is in non-blocking\n"
+ "mode and not ready; unlike their raw counterparts, they will never\n"
+ "return None.\n"
+ "\n"
+ "A typical implementation should not inherit from a RawIOBase\n"
+ "implementation, but wrap one.\n"
+ );
+
+static PyObject *
+_bufferediobase_readinto_generic(PyObject *self, Py_buffer *buffer, char readinto1)
+{
+ Py_ssize_t len;
+ PyObject *data;
+
+ PyObject *attr = readinto1
+ ? &_Py_ID(read1)
+ : &_Py_ID(read);
+ data = _PyObject_CallMethod(self, attr, "n", buffer->len);
+ if (data == NULL)
+ return NULL;
+
+ if (!PyBytes_Check(data)) {
+ Py_DECREF(data);
+ PyErr_SetString(PyExc_TypeError, "read() should return bytes");
+ return NULL;
+ }
+
+ len = PyBytes_GET_SIZE(data);
+ if (len > buffer->len) {
+ PyErr_Format(PyExc_ValueError,
+ "read() returned too much data: "
+ "%zd bytes requested, %zd returned",
+ buffer->len, len);
+ Py_DECREF(data);
+ return NULL;
+ }
+ memcpy(buffer->buf, PyBytes_AS_STRING(data), len);
+
+ Py_DECREF(data);
+
+ return PyLong_FromSsize_t(len);
+}
+
+/*[clinic input]
+_io._BufferedIOBase.readinto
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__BufferedIOBase_readinto_impl(PyObject *self, Py_buffer *buffer)
+/*[clinic end generated code: output=8c8cda6684af8038 input=00a6b9a38f29830a]*/
+{
+ return _bufferediobase_readinto_generic(self, buffer, 0);
+}
+
+/*[clinic input]
+_io._BufferedIOBase.readinto1
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__BufferedIOBase_readinto1_impl(PyObject *self, Py_buffer *buffer)
+/*[clinic end generated code: output=358623e4fd2b69d3 input=ebad75b4aadfb9be]*/
+{
+ return _bufferediobase_readinto_generic(self, buffer, 1);
+}
+
+static PyObject *
+bufferediobase_unsupported(_PyIO_State *state, const char *message)
+{
+ PyErr_SetString(state->unsupported_operation, message);
+ return NULL;
+}
+
+/*[clinic input]
+_io._BufferedIOBase.detach
+
+ cls: defining_class
+ /
+
+Disconnect this buffer from its underlying raw stream and return it.
+
+After the raw stream has been detached, the buffer is in an unusable
+state.
+[clinic start generated code]*/
+
+static PyObject *
+_io__BufferedIOBase_detach_impl(PyObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=b87b135d67cd4448 input=0b61a7b4357c1ea7]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return bufferediobase_unsupported(state, "detach");
+}
+
+/*[clinic input]
+_io._BufferedIOBase.read
+
+ cls: defining_class
+ size: int(unused=True) = -1
+ /
+
+Read and return up to n bytes.
+
+If the size argument is omitted, None, or negative, read and
+return all data until EOF.
+
+If the size argument is positive, and the underlying raw stream is
+not 'interactive', multiple raw reads may be issued to satisfy
+the byte count (unless EOF is reached first).
+However, for interactive raw streams (as well as sockets and pipes),
+at most one raw read will be issued, and a short result does not
+imply that EOF is imminent.
+
+Return an empty bytes object on EOF.
+
+Return None if the underlying raw stream was open in non-blocking
+mode and no data is available at the moment.
+[clinic start generated code]*/
+
+static PyObject *
+_io__BufferedIOBase_read_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size))
+/*[clinic end generated code: output=aceb2765587b0a29 input=824f6f910465e61a]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return bufferediobase_unsupported(state, "read");
+}
+
+/*[clinic input]
+_io._BufferedIOBase.read1
+
+ cls: defining_class
+ size: int(unused=True) = -1
+ /
+
+Read and return up to size bytes, with at most one read() call to the underlying raw stream.
+
+Return an empty bytes object on EOF.
+A short result does not imply that EOF is imminent.
+[clinic start generated code]*/
+
+static PyObject *
+_io__BufferedIOBase_read1_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size))
+/*[clinic end generated code: output=2e7fc62972487eaa input=af76380e020fd9e6]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return bufferediobase_unsupported(state, "read1");
+}
+
+/*[clinic input]
+_io._BufferedIOBase.write
+
+ cls: defining_class
+ b: object(unused=True)
+ /
+
+Write buffer b to the IO stream.
+
+Return the number of bytes written, which is always
+the length of b in bytes.
+
+Raise BlockingIOError if the buffer is full and the
+underlying raw stream cannot accept more data at the moment.
+[clinic start generated code]*/
+
+static PyObject *
+_io__BufferedIOBase_write_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *Py_UNUSED(b))
+/*[clinic end generated code: output=712c635246bf2306 input=9793f5c8f71029ad]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return bufferediobase_unsupported(state, "write");
+}
+
+
+typedef struct {
+ PyObject_HEAD
+
+ PyObject *raw;
+ int ok; /* Initialized? */
+ int detached;
+ int readable;
+ int writable;
+ char finalizing;
+
+ /* True if this is a vanilla Buffered object (rather than a user derived
+ class) *and* the raw stream is a vanilla FileIO object. */
+ int fast_closed_checks;
+
+ /* Absolute position inside the raw stream (-1 if unknown). */
+ Py_off_t abs_pos;
+
+ /* A static buffer of size `buffer_size` */
+ char *buffer;
+ /* Current logical position in the buffer. */
+ Py_off_t pos;
+ /* Position of the raw stream in the buffer. */
+ Py_off_t raw_pos;
+
+ /* Just after the last buffered byte in the buffer, or -1 if the buffer
+ isn't ready for reading. */
+ Py_off_t read_end;
+
+ /* Just after the last byte actually written */
+ Py_off_t write_pos;
+ /* Just after the last byte waiting to be written, or -1 if the buffer
+ isn't ready for writing. */
+ Py_off_t write_end;
+
+ PyThread_type_lock lock;
+ volatile unsigned long owner;
+
+ Py_ssize_t buffer_size;
+ Py_ssize_t buffer_mask;
+
+ PyObject *dict;
+ PyObject *weakreflist;
+} buffered;
+
+/*
+ Implementation notes:
+
+ * BufferedReader, BufferedWriter and BufferedRandom try to share most
+ methods (this is helped by the members `readable` and `writable`, which
+ are initialized in the respective constructors)
+ * They also share a single buffer for reading and writing. This enables
+ interleaved reads and writes without flushing. It also makes the logic
+ a bit trickier to get right.
+ * The absolute position of the raw stream is cached, if possible, in the
+ `abs_pos` member. It must be updated every time an operation is done
+ on the raw stream. If not sure, it can be reinitialized by calling
+ _buffered_raw_tell(), which queries the raw stream (_buffered_raw_seek()
+ also does it). To read it, use RAW_TELL().
+ * Three helpers, _bufferedreader_raw_read, _bufferedwriter_raw_write and
+ _bufferedwriter_flush_unlocked do a lot of useful housekeeping.
+
+ NOTE: we should try to maintain block alignment of reads and writes to the
+ raw stream (according to the buffer size), but for now it is only done
+ in read() and friends.
+
+*/
+
+/* These macros protect the buffered object against concurrent operations. */
+
+static int
+_enter_buffered_busy(buffered *self)
+{
+ int relax_locking;
+ PyLockStatus st;
+ if (self->owner == PyThread_get_thread_ident()) {
+ PyErr_Format(PyExc_RuntimeError,
+ "reentrant call inside %R", self);
+ return 0;
+ }
+ PyInterpreterState *interp = PyInterpreterState_Get();
+ relax_locking = _Py_IsInterpreterFinalizing(interp);
+ Py_BEGIN_ALLOW_THREADS
+ if (!relax_locking)
+ st = PyThread_acquire_lock(self->lock, 1);
+ else {
+ /* When finalizing, we don't want a deadlock to happen with daemon
+ * threads abruptly shut down while they owned the lock.
+ * Therefore, only wait for a grace period (1 s.).
+ * Note that non-daemon threads have already exited here, so this
+ * shouldn't affect carefully written threaded I/O code.
+ */
+ st = PyThread_acquire_lock_timed(self->lock, (PY_TIMEOUT_T)1e6, 0);
+ }
+ Py_END_ALLOW_THREADS
+ if (relax_locking && st != PY_LOCK_ACQUIRED) {
+ PyObject *ascii = PyObject_ASCII((PyObject*)self);
+ _Py_FatalErrorFormat(__func__,
+ "could not acquire lock for %s at interpreter "
+ "shutdown, possibly due to daemon threads",
+ ascii ? PyUnicode_AsUTF8(ascii) : "<ascii(self) failed>");
+ }
+ return 1;
+}
+
+#define ENTER_BUFFERED(self) \
+ ( (PyThread_acquire_lock(self->lock, 0) ? \
+ 1 : _enter_buffered_busy(self)) \
+ && (self->owner = PyThread_get_thread_ident(), 1) )
+
+#define LEAVE_BUFFERED(self) \
+ do { \
+ self->owner = 0; \
+ PyThread_release_lock(self->lock); \
+ } while(0);
+
+#define CHECK_INITIALIZED(self) \
+ if (self->ok <= 0) { \
+ if (self->detached) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "raw stream has been detached"); \
+ } else { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on uninitialized object"); \
+ } \
+ return NULL; \
+ }
+
+#define CHECK_INITIALIZED_INT(self) \
+ if (self->ok <= 0) { \
+ if (self->detached) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "raw stream has been detached"); \
+ } else { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on uninitialized object"); \
+ } \
+ return -1; \
+ }
+
+#define IS_CLOSED(self) \
+ (!self->buffer || \
+ (self->fast_closed_checks \
+ ? _PyFileIO_closed(self->raw) \
+ : buffered_closed(self)))
+
+#define CHECK_CLOSED(self, error_msg) \
+ if (IS_CLOSED(self) && (Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t) == 0)) { \
+ PyErr_SetString(PyExc_ValueError, error_msg); \
+ return NULL; \
+ } \
+
+#define VALID_READ_BUFFER(self) \
+ (self->readable && self->read_end != -1)
+
+#define VALID_WRITE_BUFFER(self) \
+ (self->writable && self->write_end != -1)
+
+#define ADJUST_POSITION(self, _new_pos) \
+ do { \
+ self->pos = _new_pos; \
+ if (VALID_READ_BUFFER(self) && self->read_end < self->pos) \
+ self->read_end = self->pos; \
+ } while(0)
+
+#define READAHEAD(self) \
+ ((self->readable && VALID_READ_BUFFER(self)) \
+ ? (self->read_end - self->pos) : 0)
+
+#define RAW_OFFSET(self) \
+ (((VALID_READ_BUFFER(self) || VALID_WRITE_BUFFER(self)) \
+ && self->raw_pos >= 0) ? self->raw_pos - self->pos : 0)
+
+#define RAW_TELL(self) \
+ (self->abs_pos != -1 ? self->abs_pos : _buffered_raw_tell(self))
+
+#define MINUS_LAST_BLOCK(self, size) \
+ (self->buffer_mask ? \
+ (size & ~self->buffer_mask) : \
+ (self->buffer_size * (size / self->buffer_size)))
+
+
+static int
+buffered_clear(buffered *self)
+{
+ self->ok = 0;
+ Py_CLEAR(self->raw);
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+buffered_dealloc(buffered *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ self->finalizing = 1;
+ if (_PyIOBase_finalize((PyObject *) self) < 0)
+ return;
+ _PyObject_GC_UNTRACK(self);
+ self->ok = 0;
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *)self);
+ if (self->buffer) {
+ PyMem_Free(self->buffer);
+ self->buffer = NULL;
+ }
+ if (self->lock) {
+ PyThread_free_lock(self->lock);
+ self->lock = NULL;
+ }
+ (void)buffered_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+_io._Buffered.__sizeof__
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered___sizeof___impl(buffered *self)
+/*[clinic end generated code: output=0231ef7f5053134e input=753c782d808d34df]*/
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->buffer) {
+ res += (size_t)self->buffer_size;
+ }
+ return PyLong_FromSize_t(res);
+}
+
+static int
+buffered_traverse(buffered *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->raw);
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+/* Because this can call arbitrary code, it shouldn't be called when
+ the refcount is 0 (that is, not directly from tp_dealloc unless
+ the refcount has been temporarily re-incremented). */
+/*[clinic input]
+_io._Buffered._dealloc_warn
+
+ source: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered__dealloc_warn(buffered *self, PyObject *source)
+/*[clinic end generated code: output=690dcc3df8967162 input=8f845f2a4786391c]*/
+{
+ if (self->ok && self->raw) {
+ PyObject *r;
+ r = PyObject_CallMethodOneArg(self->raw, &_Py_ID(_dealloc_warn), source);
+ if (r)
+ Py_DECREF(r);
+ else
+ PyErr_Clear();
+ }
+ Py_RETURN_NONE;
+}
+
+/*
+ * _BufferedIOMixin methods
+ * This is not a class, just a collection of methods that will be reused
+ * by BufferedReader and BufferedWriter
+ */
+
+/* Flush and close */
+/*[clinic input]
+_io._Buffered.flush as _io__Buffered_simple_flush
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_simple_flush_impl(buffered *self)
+/*[clinic end generated code: output=29ebb3820db1bdfd input=f33ef045e7250767]*/
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_CallMethodNoArgs(self->raw, &_Py_ID(flush));
+}
+
+static int
+buffered_closed(buffered *self)
+{
+ int closed;
+ PyObject *res;
+ CHECK_INITIALIZED_INT(self)
+ res = PyObject_GetAttr(self->raw, &_Py_ID(closed));
+ if (res == NULL)
+ return -1;
+ closed = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ return closed;
+}
+
+static PyObject *
+buffered_closed_get(buffered *self, void *context)
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_GetAttr(self->raw, &_Py_ID(closed));
+}
+
+/*[clinic input]
+_io._Buffered.close
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_close_impl(buffered *self)
+/*[clinic end generated code: output=7280b7b42033be0c input=d20b83d1ddd7d805]*/
+{
+ PyObject *res = NULL;
+ int r;
+
+ CHECK_INITIALIZED(self)
+ if (!ENTER_BUFFERED(self)) {
+ return NULL;
+ }
+
+ r = buffered_closed(self);
+ if (r < 0)
+ goto end;
+ if (r > 0) {
+ res = Py_NewRef(Py_None);
+ goto end;
+ }
+
+ if (self->finalizing) {
+ PyObject *r = _io__Buffered__dealloc_warn(self, (PyObject *) self);
+ if (r)
+ Py_DECREF(r);
+ else
+ PyErr_Clear();
+ }
+ /* flush() will most probably re-take the lock, so drop it first */
+ LEAVE_BUFFERED(self)
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (!ENTER_BUFFERED(self)) {
+ return NULL;
+ }
+ PyObject *exc = NULL;
+ if (res == NULL) {
+ exc = PyErr_GetRaisedException();
+ }
+ else {
+ Py_DECREF(res);
+ }
+
+ res = PyObject_CallMethodNoArgs(self->raw, &_Py_ID(close));
+
+ if (self->buffer) {
+ PyMem_Free(self->buffer);
+ self->buffer = NULL;
+ }
+
+ if (exc != NULL) {
+ _PyErr_ChainExceptions1(exc);
+ Py_CLEAR(res);
+ }
+
+ self->read_end = 0;
+ self->pos = 0;
+
+end:
+ LEAVE_BUFFERED(self)
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.detach
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_detach_impl(buffered *self)
+/*[clinic end generated code: output=dd0fc057b8b779f7 input=482762a345cc9f44]*/
+{
+ PyObject *raw, *res;
+ CHECK_INITIALIZED(self)
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL)
+ return NULL;
+ Py_DECREF(res);
+ raw = self->raw;
+ self->raw = NULL;
+ self->detached = 1;
+ self->ok = 0;
+ return raw;
+}
+
+/* Inquiries */
+
+/*[clinic input]
+_io._Buffered.seekable
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_seekable_impl(buffered *self)
+/*[clinic end generated code: output=90172abb5ceb6e8f input=7d35764f5fb5262b]*/
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_CallMethodNoArgs(self->raw, &_Py_ID(seekable));
+}
+
+/*[clinic input]
+_io._Buffered.readable
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_readable_impl(buffered *self)
+/*[clinic end generated code: output=92afa07661ecb698 input=640619addb513b8b]*/
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_CallMethodNoArgs(self->raw, &_Py_ID(readable));
+}
+
+/*[clinic input]
+_io._Buffered.writable
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_writable_impl(buffered *self)
+/*[clinic end generated code: output=4e3eee8d6f9d8552 input=b35ea396b2201554]*/
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_CallMethodNoArgs(self->raw, &_Py_ID(writable));
+}
+
+static PyObject *
+buffered_name_get(buffered *self, void *context)
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_GetAttr(self->raw, &_Py_ID(name));
+}
+
+static PyObject *
+buffered_mode_get(buffered *self, void *context)
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_GetAttr(self->raw, &_Py_ID(mode));
+}
+
+/* Lower-level APIs */
+
+/*[clinic input]
+_io._Buffered.fileno
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_fileno_impl(buffered *self)
+/*[clinic end generated code: output=b717648d58a95ee3 input=768ea30b3f6314a7]*/
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_CallMethodNoArgs(self->raw, &_Py_ID(fileno));
+}
+
+/*[clinic input]
+_io._Buffered.isatty
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_isatty_impl(buffered *self)
+/*[clinic end generated code: output=c20e55caae67baea input=9ea007b11559bee4]*/
+{
+ CHECK_INITIALIZED(self)
+ return PyObject_CallMethodNoArgs(self->raw, &_Py_ID(isatty));
+}
+
+/* Forward decls */
+static PyObject *
+_bufferedwriter_flush_unlocked(buffered *);
+static Py_ssize_t
+_bufferedreader_fill_buffer(buffered *self);
+static void
+_bufferedreader_reset_buf(buffered *self);
+static void
+_bufferedwriter_reset_buf(buffered *self);
+static PyObject *
+_bufferedreader_peek_unlocked(buffered *self);
+static PyObject *
+_bufferedreader_read_all(buffered *self);
+static PyObject *
+_bufferedreader_read_fast(buffered *self, Py_ssize_t);
+static PyObject *
+_bufferedreader_read_generic(buffered *self, Py_ssize_t);
+static Py_ssize_t
+_bufferedreader_raw_read(buffered *self, char *start, Py_ssize_t len);
+
+/*
+ * Helpers
+ */
+
+/* Sets the current error to BlockingIOError */
+static void
+_set_BlockingIOError(const char *msg, Py_ssize_t written)
+{
+ PyObject *err;
+ PyErr_Clear();
+ err = PyObject_CallFunction(PyExc_BlockingIOError, "isn",
+ errno, msg, written);
+ if (err)
+ PyErr_SetObject(PyExc_BlockingIOError, err);
+ Py_XDECREF(err);
+}
+
+/* Returns the address of the `written` member if a BlockingIOError was
+ raised, NULL otherwise. The error is always re-raised. */
+static Py_ssize_t *
+_buffered_check_blocking_error(void)
+{
+ PyObject *exc = PyErr_GetRaisedException();
+ if (exc == NULL || !PyErr_GivenExceptionMatches(exc, PyExc_BlockingIOError)) {
+ PyErr_SetRaisedException(exc);
+ return NULL;
+ }
+ PyOSErrorObject *err = (PyOSErrorObject *)exc;
+ /* TODO: sanity check (err->written >= 0) */
+ PyErr_SetRaisedException(exc);
+ return &err->written;
+}
+
+static Py_off_t
+_buffered_raw_tell(buffered *self)
+{
+ Py_off_t n;
+ PyObject *res;
+ res = PyObject_CallMethodNoArgs(self->raw, &_Py_ID(tell));
+ if (res == NULL)
+ return -1;
+ n = PyNumber_AsOff_t(res, PyExc_ValueError);
+ Py_DECREF(res);
+ if (n < 0) {
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_OSError,
+ "Raw stream returned invalid position %" PY_PRIdOFF,
+ (PY_OFF_T_COMPAT)n);
+ return -1;
+ }
+ self->abs_pos = n;
+ return n;
+}
+
+static Py_off_t
+_buffered_raw_seek(buffered *self, Py_off_t target, int whence)
+{
+ PyObject *res, *posobj, *whenceobj;
+ Py_off_t n;
+
+ posobj = PyLong_FromOff_t(target);
+ if (posobj == NULL)
+ return -1;
+ whenceobj = PyLong_FromLong(whence);
+ if (whenceobj == NULL) {
+ Py_DECREF(posobj);
+ return -1;
+ }
+ res = PyObject_CallMethodObjArgs(self->raw, &_Py_ID(seek),
+ posobj, whenceobj, NULL);
+ Py_DECREF(posobj);
+ Py_DECREF(whenceobj);
+ if (res == NULL)
+ return -1;
+ n = PyNumber_AsOff_t(res, PyExc_ValueError);
+ Py_DECREF(res);
+ if (n < 0) {
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_OSError,
+ "Raw stream returned invalid position %" PY_PRIdOFF,
+ (PY_OFF_T_COMPAT)n);
+ return -1;
+ }
+ self->abs_pos = n;
+ return n;
+}
+
+static int
+_buffered_init(buffered *self)
+{
+ Py_ssize_t n;
+ if (self->buffer_size <= 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "buffer size must be strictly positive");
+ return -1;
+ }
+ if (self->buffer)
+ PyMem_Free(self->buffer);
+ self->buffer = PyMem_Malloc(self->buffer_size);
+ if (self->buffer == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ if (self->lock)
+ PyThread_free_lock(self->lock);
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock");
+ return -1;
+ }
+ self->owner = 0;
+ /* Find out whether buffer_size is a power of 2 */
+ /* XXX is this optimization useful? */
+ for (n = self->buffer_size - 1; n & 1; n >>= 1)
+ ;
+ if (n == 0)
+ self->buffer_mask = self->buffer_size - 1;
+ else
+ self->buffer_mask = 0;
+ if (_buffered_raw_tell(self) == -1)
+ PyErr_Clear();
+ return 0;
+}
+
+/* Return 1 if an OSError with errno == EINTR is set (and then
+ clears the error indicator), 0 otherwise.
+ Should only be called when PyErr_Occurred() is true.
+*/
+int
+_PyIO_trap_eintr(void)
+{
+ if (!PyErr_ExceptionMatches(PyExc_OSError)) {
+ return 0;
+ }
+ PyObject *exc = PyErr_GetRaisedException();
+ PyOSErrorObject *env_err = (PyOSErrorObject *)exc;
+ assert(env_err != NULL);
+ if (env_err->myerrno != NULL) {
+ assert(EINTR > 0 && EINTR < INT_MAX);
+ assert(PyLong_CheckExact(env_err->myerrno));
+ int overflow;
+ int myerrno = PyLong_AsLongAndOverflow(env_err->myerrno, &overflow);
+ PyErr_Clear();
+ if (myerrno == EINTR) {
+ Py_DECREF(exc);
+ return 1;
+ }
+ }
+ /* This silences any error set by PyObject_RichCompareBool() */
+ PyErr_SetRaisedException(exc);
+ return 0;
+}
+
+/*
+ * Shared methods and wrappers
+ */
+
+static PyObject *
+buffered_flush_and_rewind_unlocked(buffered *self)
+{
+ PyObject *res;
+
+ res = _bufferedwriter_flush_unlocked(self);
+ if (res == NULL)
+ return NULL;
+ Py_DECREF(res);
+
+ if (self->readable) {
+ /* Rewind the raw stream so that its position corresponds to
+ the current logical position. */
+ Py_off_t n;
+ n = _buffered_raw_seek(self, -RAW_OFFSET(self), 1);
+ _bufferedreader_reset_buf(self);
+ if (n == -1)
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_io._Buffered.flush
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_flush_impl(buffered *self)
+/*[clinic end generated code: output=da2674ef1ce71f3a input=fda63444697c6bf4]*/
+{
+ PyObject *res;
+
+ CHECK_INITIALIZED(self)
+ CHECK_CLOSED(self, "flush of closed file")
+
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+ res = buffered_flush_and_rewind_unlocked(self);
+ LEAVE_BUFFERED(self)
+
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.peek
+ size: Py_ssize_t = 0
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_peek_impl(buffered *self, Py_ssize_t size)
+/*[clinic end generated code: output=ba7a097ca230102b input=37ffb97d06ff4adb]*/
+{
+ PyObject *res = NULL;
+
+ CHECK_INITIALIZED(self)
+ CHECK_CLOSED(self, "peek of closed file")
+
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+
+ if (self->writable) {
+ res = buffered_flush_and_rewind_unlocked(self);
+ if (res == NULL)
+ goto end;
+ Py_CLEAR(res);
+ }
+ res = _bufferedreader_peek_unlocked(self);
+
+end:
+ LEAVE_BUFFERED(self)
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.read
+ size as n: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_read_impl(buffered *self, Py_ssize_t n)
+/*[clinic end generated code: output=f41c78bb15b9bbe9 input=7df81e82e08a68a2]*/
+{
+ PyObject *res;
+
+ CHECK_INITIALIZED(self)
+ if (n < -1) {
+ PyErr_SetString(PyExc_ValueError,
+ "read length must be non-negative or -1");
+ return NULL;
+ }
+
+ CHECK_CLOSED(self, "read of closed file")
+
+ if (n == -1) {
+ /* The number of bytes is unspecified, read until the end of stream */
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+ res = _bufferedreader_read_all(self);
+ }
+ else {
+ res = _bufferedreader_read_fast(self, n);
+ if (res != Py_None)
+ return res;
+ Py_DECREF(res);
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+ res = _bufferedreader_read_generic(self, n);
+ }
+
+ LEAVE_BUFFERED(self)
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.read1
+ size as n: Py_ssize_t = -1
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_read1_impl(buffered *self, Py_ssize_t n)
+/*[clinic end generated code: output=bcc4fb4e54d103a3 input=7d22de9630b61774]*/
+{
+ Py_ssize_t have, r;
+ PyObject *res = NULL;
+
+ CHECK_INITIALIZED(self)
+ if (n < 0) {
+ n = self->buffer_size;
+ }
+
+ CHECK_CLOSED(self, "read of closed file")
+
+ if (n == 0)
+ return PyBytes_FromStringAndSize(NULL, 0);
+
+ /* Return up to n bytes. If at least one byte is buffered, we
+ only return buffered bytes. Otherwise, we do one raw read. */
+
+ have = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ if (have > 0) {
+ n = Py_MIN(have, n);
+ res = _bufferedreader_read_fast(self, n);
+ assert(res != Py_None);
+ return res;
+ }
+ res = PyBytes_FromStringAndSize(NULL, n);
+ if (res == NULL)
+ return NULL;
+ if (!ENTER_BUFFERED(self)) {
+ Py_DECREF(res);
+ return NULL;
+ }
+ _bufferedreader_reset_buf(self);
+ r = _bufferedreader_raw_read(self, PyBytes_AS_STRING(res), n);
+ LEAVE_BUFFERED(self)
+ if (r == -1) {
+ Py_DECREF(res);
+ return NULL;
+ }
+ if (r == -2)
+ r = 0;
+ if (n > r)
+ _PyBytes_Resize(&res, r);
+ return res;
+}
+
+static PyObject *
+_buffered_readinto_generic(buffered *self, Py_buffer *buffer, char readinto1)
+{
+ Py_ssize_t n, written = 0, remaining;
+ PyObject *res = NULL;
+
+ CHECK_INITIALIZED(self)
+ CHECK_CLOSED(self, "readinto of closed file")
+
+ n = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ if (n > 0) {
+ if (n >= buffer->len) {
+ memcpy(buffer->buf, self->buffer + self->pos, buffer->len);
+ self->pos += buffer->len;
+ return PyLong_FromSsize_t(buffer->len);
+ }
+ memcpy(buffer->buf, self->buffer + self->pos, n);
+ self->pos += n;
+ written = n;
+ }
+
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+
+ if (self->writable) {
+ res = buffered_flush_and_rewind_unlocked(self);
+ if (res == NULL)
+ goto end;
+ Py_CLEAR(res);
+ }
+
+ _bufferedreader_reset_buf(self);
+ self->pos = 0;
+
+ for (remaining = buffer->len - written;
+ remaining > 0;
+ written += n, remaining -= n) {
+ /* If remaining bytes is larger than internal buffer size, copy
+ * directly into caller's buffer. */
+ if (remaining > self->buffer_size) {
+ n = _bufferedreader_raw_read(self, (char *) buffer->buf + written,
+ remaining);
+ }
+
+ /* In readinto1 mode, we do not want to fill the internal
+ buffer if we already have some data to return */
+ else if (!(readinto1 && written)) {
+ n = _bufferedreader_fill_buffer(self);
+ if (n > 0) {
+ if (n > remaining)
+ n = remaining;
+ memcpy((char *) buffer->buf + written,
+ self->buffer + self->pos, n);
+ self->pos += n;
+ continue; /* short circuit */
+ }
+ }
+ else
+ n = 0;
+
+ if (n == 0 || (n == -2 && written > 0))
+ break;
+ if (n < 0) {
+ if (n == -2) {
+ res = Py_NewRef(Py_None);
+ }
+ goto end;
+ }
+
+ /* At most one read in readinto1 mode */
+ if (readinto1) {
+ written += n;
+ break;
+ }
+ }
+ res = PyLong_FromSsize_t(written);
+
+end:
+ LEAVE_BUFFERED(self);
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.readinto
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_readinto_impl(buffered *self, Py_buffer *buffer)
+/*[clinic end generated code: output=bcb376580b1d8170 input=ed6b98b7a20a3008]*/
+{
+ return _buffered_readinto_generic(self, buffer, 0);
+}
+
+/*[clinic input]
+_io._Buffered.readinto1
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_readinto1_impl(buffered *self, Py_buffer *buffer)
+/*[clinic end generated code: output=6e5c6ac5868205d6 input=4455c5d55fdf1687]*/
+{
+ return _buffered_readinto_generic(self, buffer, 1);
+}
+
+
+static PyObject *
+_buffered_readline(buffered *self, Py_ssize_t limit)
+{
+ PyObject *res = NULL;
+ PyObject *chunks = NULL;
+ Py_ssize_t n;
+ const char *start, *s, *end;
+
+ CHECK_CLOSED(self, "readline of closed file")
+
+ /* First, try to find a line in the buffer. This can run unlocked because
+ the calls to the C API are simple enough that they can't trigger
+ any thread switch. */
+ n = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ if (limit >= 0 && n > limit)
+ n = limit;
+ start = self->buffer + self->pos;
+ s = memchr(start, '\n', n);
+ if (s != NULL) {
+ res = PyBytes_FromStringAndSize(start, s - start + 1);
+ if (res != NULL)
+ self->pos += s - start + 1;
+ goto end_unlocked;
+ }
+ if (n == limit) {
+ res = PyBytes_FromStringAndSize(start, n);
+ if (res != NULL)
+ self->pos += n;
+ goto end_unlocked;
+ }
+
+ if (!ENTER_BUFFERED(self))
+ goto end_unlocked;
+
+ /* Now we try to get some more from the raw stream */
+ chunks = PyList_New(0);
+ if (chunks == NULL)
+ goto end;
+ if (n > 0) {
+ res = PyBytes_FromStringAndSize(start, n);
+ if (res == NULL)
+ goto end;
+ if (PyList_Append(chunks, res) < 0) {
+ Py_CLEAR(res);
+ goto end;
+ }
+ Py_CLEAR(res);
+ self->pos += n;
+ if (limit >= 0)
+ limit -= n;
+ }
+ if (self->writable) {
+ PyObject *r = buffered_flush_and_rewind_unlocked(self);
+ if (r == NULL)
+ goto end;
+ Py_DECREF(r);
+ }
+
+ for (;;) {
+ _bufferedreader_reset_buf(self);
+ n = _bufferedreader_fill_buffer(self);
+ if (n == -1)
+ goto end;
+ if (n <= 0)
+ break;
+ if (limit >= 0 && n > limit)
+ n = limit;
+ start = self->buffer;
+ end = start + n;
+ s = start;
+ while (s < end) {
+ if (*s++ == '\n') {
+ res = PyBytes_FromStringAndSize(start, s - start);
+ if (res == NULL)
+ goto end;
+ self->pos = s - start;
+ goto found;
+ }
+ }
+ res = PyBytes_FromStringAndSize(start, n);
+ if (res == NULL)
+ goto end;
+ if (n == limit) {
+ self->pos = n;
+ break;
+ }
+ if (PyList_Append(chunks, res) < 0) {
+ Py_CLEAR(res);
+ goto end;
+ }
+ Py_CLEAR(res);
+ if (limit >= 0)
+ limit -= n;
+ }
+found:
+ if (res != NULL && PyList_Append(chunks, res) < 0) {
+ Py_CLEAR(res);
+ goto end;
+ }
+ Py_XSETREF(res, _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks));
+
+end:
+ LEAVE_BUFFERED(self)
+end_unlocked:
+ Py_XDECREF(chunks);
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.readline
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_readline_impl(buffered *self, Py_ssize_t size)
+/*[clinic end generated code: output=24dd2aa6e33be83c input=673b6240e315ef8a]*/
+{
+ CHECK_INITIALIZED(self)
+ return _buffered_readline(self, size);
+}
+
+
+/*[clinic input]
+_io._Buffered.tell
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_tell_impl(buffered *self)
+/*[clinic end generated code: output=386972ae84716c1e input=ad61e04a6b349573]*/
+{
+ Py_off_t pos;
+
+ CHECK_INITIALIZED(self)
+ pos = _buffered_raw_tell(self);
+ if (pos == -1)
+ return NULL;
+ pos -= RAW_OFFSET(self);
+ /* TODO: sanity check (pos >= 0) */
+ return PyLong_FromOff_t(pos);
+}
+
+/*[clinic input]
+_io._Buffered.seek
+ target as targetobj: object
+ whence: int = 0
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence)
+/*[clinic end generated code: output=7ae0e8dc46efdefb input=a9c4920bfcba6163]*/
+{
+ Py_off_t target, n;
+ PyObject *res = NULL;
+
+ CHECK_INITIALIZED(self)
+
+ /* Do some error checking instead of trusting OS 'seek()'
+ ** error detection, just in case.
+ */
+ if ((whence < 0 || whence >2)
+#ifdef SEEK_HOLE
+ && (whence != SEEK_HOLE)
+#endif
+#ifdef SEEK_DATA
+ && (whence != SEEK_DATA)
+#endif
+ ) {
+ PyErr_Format(PyExc_ValueError,
+ "whence value %d unsupported", whence);
+ return NULL;
+ }
+
+ CHECK_CLOSED(self, "seek of closed file")
+
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ if (_PyIOBase_check_seekable(state, self->raw, Py_True) == NULL) {
+ return NULL;
+ }
+
+ target = PyNumber_AsOff_t(targetobj, PyExc_ValueError);
+ if (target == -1 && PyErr_Occurred())
+ return NULL;
+
+ /* SEEK_SET and SEEK_CUR are special because we could seek inside the
+ buffer. Other whence values must be managed without this optimization.
+ Some Operating Systems can provide additional values, like
+ SEEK_HOLE/SEEK_DATA. */
+ if (((whence == 0) || (whence == 1)) && self->readable) {
+ Py_off_t current, avail;
+ /* Check if seeking leaves us inside the current buffer,
+ so as to return quickly if possible. Also, we needn't take the
+ lock in this fast path.
+ Don't know how to do that when whence == 2, though. */
+ /* NOTE: RAW_TELL() can release the GIL but the object is in a stable
+ state at this point. */
+ current = RAW_TELL(self);
+ avail = READAHEAD(self);
+ if (avail > 0) {
+ Py_off_t offset;
+ if (whence == 0)
+ offset = target - (current - RAW_OFFSET(self));
+ else
+ offset = target;
+ if (offset >= -self->pos && offset <= avail) {
+ self->pos += offset;
+ return PyLong_FromOff_t(current - avail + offset);
+ }
+ }
+ }
+
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+
+ /* Fallback: invoke raw seek() method and clear buffer */
+ if (self->writable) {
+ res = _bufferedwriter_flush_unlocked(self);
+ if (res == NULL)
+ goto end;
+ Py_CLEAR(res);
+ }
+
+ /* TODO: align on block boundary and read buffer if needed? */
+ if (whence == 1)
+ target -= RAW_OFFSET(self);
+ n = _buffered_raw_seek(self, target, whence);
+ if (n == -1)
+ goto end;
+ self->raw_pos = -1;
+ res = PyLong_FromOff_t(n);
+ if (res != NULL && self->readable)
+ _bufferedreader_reset_buf(self);
+
+end:
+ LEAVE_BUFFERED(self)
+ return res;
+}
+
+/*[clinic input]
+_io._Buffered.truncate
+ cls: defining_class
+ pos: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__Buffered_truncate_impl(buffered *self, PyTypeObject *cls, PyObject *pos)
+/*[clinic end generated code: output=fe3882fbffe79f1a input=f5b737d97d76303f]*/
+{
+ PyObject *res = NULL;
+
+ CHECK_INITIALIZED(self)
+ CHECK_CLOSED(self, "truncate of closed file")
+ if (!self->writable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return bufferediobase_unsupported(state, "truncate");
+ }
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+
+ res = buffered_flush_and_rewind_unlocked(self);
+ if (res == NULL) {
+ goto end;
+ }
+ Py_CLEAR(res);
+
+ res = PyObject_CallMethodOneArg(self->raw, &_Py_ID(truncate), pos);
+ if (res == NULL)
+ goto end;
+ /* Reset cached position */
+ if (_buffered_raw_tell(self) == -1)
+ PyErr_Clear();
+
+end:
+ LEAVE_BUFFERED(self)
+ return res;
+}
+
+static PyObject *
+buffered_iternext(buffered *self)
+{
+ PyObject *line;
+ PyTypeObject *tp;
+
+ CHECK_INITIALIZED(self);
+
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ tp = Py_TYPE(self);
+ if (Py_IS_TYPE(tp, state->PyBufferedReader_Type) ||
+ Py_IS_TYPE(tp, state->PyBufferedRandom_Type))
+ {
+ /* Skip method call overhead for speed */
+ line = _buffered_readline(self, -1);
+ }
+ else {
+ line = PyObject_CallMethodNoArgs((PyObject *)self,
+ &_Py_ID(readline));
+ if (line && !PyBytes_Check(line)) {
+ PyErr_Format(PyExc_OSError,
+ "readline() should have returned a bytes object, "
+ "not '%.200s'", Py_TYPE(line)->tp_name);
+ Py_DECREF(line);
+ return NULL;
+ }
+ }
+
+ if (line == NULL)
+ return NULL;
+
+ if (PyBytes_GET_SIZE(line) == 0) {
+ /* Reached EOF or would have blocked */
+ Py_DECREF(line);
+ return NULL;
+ }
+
+ return line;
+}
+
+static PyObject *
+buffered_repr(buffered *self)
+{
+ PyObject *nameobj, *res;
+
+ if (_PyObject_LookupAttr((PyObject *) self, &_Py_ID(name), &nameobj) < 0) {
+ if (!PyErr_ExceptionMatches(PyExc_ValueError)) {
+ return NULL;
+ }
+ /* Ignore ValueError raised if the underlying stream was detached */
+ PyErr_Clear();
+ }
+ if (nameobj == NULL) {
+ res = PyUnicode_FromFormat("<%s>", Py_TYPE(self)->tp_name);
+ }
+ else {
+ int status = Py_ReprEnter((PyObject *)self);
+ res = NULL;
+ if (status == 0) {
+ res = PyUnicode_FromFormat("<%s name=%R>",
+ Py_TYPE(self)->tp_name, nameobj);
+ Py_ReprLeave((PyObject *)self);
+ }
+ else if (status > 0) {
+ PyErr_Format(PyExc_RuntimeError,
+ "reentrant call inside %s.__repr__",
+ Py_TYPE(self)->tp_name);
+ }
+ Py_DECREF(nameobj);
+ }
+ return res;
+}
+
+/*
+ * class BufferedReader
+ */
+
+static void _bufferedreader_reset_buf(buffered *self)
+{
+ self->read_end = -1;
+}
+
+/*[clinic input]
+_io.BufferedReader.__init__
+ raw: object
+ buffer_size: Py_ssize_t(c_default="DEFAULT_BUFFER_SIZE") = DEFAULT_BUFFER_SIZE
+
+Create a new buffered reader using the given readable raw IO object.
+[clinic start generated code]*/
+
+static int
+_io_BufferedReader___init___impl(buffered *self, PyObject *raw,
+ Py_ssize_t buffer_size)
+/*[clinic end generated code: output=cddcfefa0ed294c4 input=fb887e06f11b4e48]*/
+{
+ self->ok = 0;
+ self->detached = 0;
+
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ if (_PyIOBase_check_readable(state, raw, Py_True) == NULL) {
+ return -1;
+ }
+
+ Py_XSETREF(self->raw, Py_NewRef(raw));
+ self->buffer_size = buffer_size;
+ self->readable = 1;
+ self->writable = 0;
+
+ if (_buffered_init(self) < 0)
+ return -1;
+ _bufferedreader_reset_buf(self);
+
+ self->fast_closed_checks = (
+ Py_IS_TYPE(self, state->PyBufferedReader_Type) &&
+ Py_IS_TYPE(raw, state->PyFileIO_Type)
+ );
+
+ self->ok = 1;
+ return 0;
+}
+
+static Py_ssize_t
+_bufferedreader_raw_read(buffered *self, char *start, Py_ssize_t len)
+{
+ Py_buffer buf;
+ PyObject *memobj, *res;
+ Py_ssize_t n;
+ /* NOTE: the buffer needn't be released as its object is NULL. */
+ if (PyBuffer_FillInfo(&buf, NULL, start, len, 0, PyBUF_CONTIG) == -1)
+ return -1;
+ memobj = PyMemoryView_FromBuffer(&buf);
+ if (memobj == NULL)
+ return -1;
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals() when EINTR
+ occurs so we needn't do it ourselves.
+ We then retry reading, ignoring the signal if no handler has
+ raised (see issue #10956).
+ */
+ do {
+ res = PyObject_CallMethodOneArg(self->raw, &_Py_ID(readinto), memobj);
+ } while (res == NULL && _PyIO_trap_eintr());
+ Py_DECREF(memobj);
+ if (res == NULL)
+ return -1;
+ if (res == Py_None) {
+ /* Non-blocking stream would have blocked. Special return code! */
+ Py_DECREF(res);
+ return -2;
+ }
+ n = PyNumber_AsSsize_t(res, PyExc_ValueError);
+ Py_DECREF(res);
+
+ if (n == -1 && PyErr_Occurred()) {
+ _PyErr_FormatFromCause(
+ PyExc_OSError,
+ "raw readinto() failed"
+ );
+ return -1;
+ }
+
+ if (n < 0 || n > len) {
+ PyErr_Format(PyExc_OSError,
+ "raw readinto() returned invalid length %zd "
+ "(should have been between 0 and %zd)", n, len);
+ return -1;
+ }
+ if (n > 0 && self->abs_pos != -1)
+ self->abs_pos += n;
+ return n;
+}
+
+static Py_ssize_t
+_bufferedreader_fill_buffer(buffered *self)
+{
+ Py_ssize_t start, len, n;
+ if (VALID_READ_BUFFER(self))
+ start = Py_SAFE_DOWNCAST(self->read_end, Py_off_t, Py_ssize_t);
+ else
+ start = 0;
+ len = self->buffer_size - start;
+ n = _bufferedreader_raw_read(self, self->buffer + start, len);
+ if (n <= 0)
+ return n;
+ self->read_end = start + n;
+ self->raw_pos = start + n;
+ return n;
+}
+
+static PyObject *
+_bufferedreader_read_all(buffered *self)
+{
+ Py_ssize_t current_size;
+ PyObject *res = NULL, *data = NULL, *tmp = NULL, *chunks = NULL, *readall;
+
+ /* First copy what we have in the current buffer. */
+ current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ if (current_size) {
+ data = PyBytes_FromStringAndSize(
+ self->buffer + self->pos, current_size);
+ if (data == NULL)
+ return NULL;
+ self->pos += current_size;
+ }
+ /* We're going past the buffer's bounds, flush it */
+ if (self->writable) {
+ tmp = buffered_flush_and_rewind_unlocked(self);
+ if (tmp == NULL)
+ goto cleanup;
+ Py_CLEAR(tmp);
+ }
+ _bufferedreader_reset_buf(self);
+
+ if (_PyObject_LookupAttr(self->raw, &_Py_ID(readall), &readall) < 0) {
+ goto cleanup;
+ }
+ if (readall) {
+ tmp = _PyObject_CallNoArgs(readall);
+ Py_DECREF(readall);
+ if (tmp == NULL)
+ goto cleanup;
+ if (tmp != Py_None && !PyBytes_Check(tmp)) {
+ PyErr_SetString(PyExc_TypeError, "readall() should return bytes");
+ goto cleanup;
+ }
+ if (current_size == 0) {
+ res = tmp;
+ } else {
+ if (tmp != Py_None) {
+ PyBytes_Concat(&data, tmp);
+ }
+ res = data;
+ }
+ goto cleanup;
+ }
+
+ chunks = PyList_New(0);
+ if (chunks == NULL)
+ goto cleanup;
+
+ while (1) {
+ if (data) {
+ if (PyList_Append(chunks, data) < 0)
+ goto cleanup;
+ Py_CLEAR(data);
+ }
+
+ /* Read until EOF or until read() would block. */
+ data = PyObject_CallMethodNoArgs(self->raw, &_Py_ID(read));
+ if (data == NULL)
+ goto cleanup;
+ if (data != Py_None && !PyBytes_Check(data)) {
+ PyErr_SetString(PyExc_TypeError, "read() should return bytes");
+ goto cleanup;
+ }
+ if (data == Py_None || PyBytes_GET_SIZE(data) == 0) {
+ if (current_size == 0) {
+ res = data;
+ goto cleanup;
+ }
+ else {
+ tmp = _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks);
+ res = tmp;
+ goto cleanup;
+ }
+ }
+ current_size += PyBytes_GET_SIZE(data);
+ if (self->abs_pos != -1)
+ self->abs_pos += PyBytes_GET_SIZE(data);
+ }
+cleanup:
+ /* res is either NULL or a borrowed ref */
+ Py_XINCREF(res);
+ Py_XDECREF(data);
+ Py_XDECREF(tmp);
+ Py_XDECREF(chunks);
+ return res;
+}
+
+/* Read n bytes from the buffer if it can, otherwise return None.
+ This function is simple enough that it can run unlocked. */
+static PyObject *
+_bufferedreader_read_fast(buffered *self, Py_ssize_t n)
+{
+ Py_ssize_t current_size;
+
+ current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ if (n <= current_size) {
+ /* Fast path: the data to read is fully buffered. */
+ PyObject *res = PyBytes_FromStringAndSize(self->buffer + self->pos, n);
+ if (res != NULL)
+ self->pos += n;
+ return res;
+ }
+ Py_RETURN_NONE;
+}
+
+/* Generic read function: read from the stream until enough bytes are read,
+ * or until an EOF occurs or until read() would block.
+ */
+static PyObject *
+_bufferedreader_read_generic(buffered *self, Py_ssize_t n)
+{
+ PyObject *res = NULL;
+ Py_ssize_t current_size, remaining, written;
+ char *out;
+
+ current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ if (n <= current_size)
+ return _bufferedreader_read_fast(self, n);
+
+ res = PyBytes_FromStringAndSize(NULL, n);
+ if (res == NULL)
+ goto error;
+ out = PyBytes_AS_STRING(res);
+ remaining = n;
+ written = 0;
+ if (current_size > 0) {
+ memcpy(out, self->buffer + self->pos, current_size);
+ remaining -= current_size;
+ written += current_size;
+ self->pos += current_size;
+ }
+ /* Flush the write buffer if necessary */
+ if (self->writable) {
+ PyObject *r = buffered_flush_and_rewind_unlocked(self);
+ if (r == NULL)
+ goto error;
+ Py_DECREF(r);
+ }
+ _bufferedreader_reset_buf(self);
+ while (remaining > 0) {
+ /* We want to read a whole block at the end into buffer.
+ If we had readv() we could do this in one pass. */
+ Py_ssize_t r = MINUS_LAST_BLOCK(self, remaining);
+ if (r == 0)
+ break;
+ r = _bufferedreader_raw_read(self, out + written, r);
+ if (r == -1)
+ goto error;
+ if (r == 0 || r == -2) {
+ /* EOF occurred or read() would block. */
+ if (r == 0 || written > 0) {
+ if (_PyBytes_Resize(&res, written))
+ goto error;
+ return res;
+ }
+ Py_DECREF(res);
+ Py_RETURN_NONE;
+ }
+ remaining -= r;
+ written += r;
+ }
+ assert(remaining <= self->buffer_size);
+ self->pos = 0;
+ self->raw_pos = 0;
+ self->read_end = 0;
+ /* NOTE: when the read is satisfied, we avoid issuing any additional
+ reads, which could block indefinitely (e.g. on a socket).
+ See issue #9550. */
+ while (remaining > 0 && self->read_end < self->buffer_size) {
+ Py_ssize_t r = _bufferedreader_fill_buffer(self);
+ if (r == -1)
+ goto error;
+ if (r == 0 || r == -2) {
+ /* EOF occurred or read() would block. */
+ if (r == 0 || written > 0) {
+ if (_PyBytes_Resize(&res, written))
+ goto error;
+ return res;
+ }
+ Py_DECREF(res);
+ Py_RETURN_NONE;
+ }
+ if (remaining > r) {
+ memcpy(out + written, self->buffer + self->pos, r);
+ written += r;
+ self->pos += r;
+ remaining -= r;
+ }
+ else if (remaining > 0) {
+ memcpy(out + written, self->buffer + self->pos, remaining);
+ written += remaining;
+ self->pos += remaining;
+ remaining = 0;
+ }
+ if (remaining == 0)
+ break;
+ }
+
+ return res;
+
+error:
+ Py_XDECREF(res);
+ return NULL;
+}
+
+static PyObject *
+_bufferedreader_peek_unlocked(buffered *self)
+{
+ Py_ssize_t have, r;
+
+ have = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+ /* Constraints:
+ 1. we don't want to advance the file position.
+ 2. we don't want to lose block alignment, so we can't shift the buffer
+ to make some place.
+ Therefore, we either return `have` bytes (if > 0), or a full buffer.
+ */
+ if (have > 0) {
+ return PyBytes_FromStringAndSize(self->buffer + self->pos, have);
+ }
+
+ /* Fill the buffer from the raw stream, and copy it to the result. */
+ _bufferedreader_reset_buf(self);
+ r = _bufferedreader_fill_buffer(self);
+ if (r == -1)
+ return NULL;
+ if (r == -2)
+ r = 0;
+ self->pos = 0;
+ return PyBytes_FromStringAndSize(self->buffer, r);
+}
+
+
+/*
+ * class BufferedWriter
+ */
+static void
+_bufferedwriter_reset_buf(buffered *self)
+{
+ self->write_pos = 0;
+ self->write_end = -1;
+}
+
+/*[clinic input]
+_io.BufferedWriter.__init__
+ raw: object
+ buffer_size: Py_ssize_t(c_default="DEFAULT_BUFFER_SIZE") = DEFAULT_BUFFER_SIZE
+
+A buffer for a writeable sequential RawIO object.
+
+The constructor creates a BufferedWriter for the given writeable raw
+stream. If the buffer_size is not given, it defaults to
+DEFAULT_BUFFER_SIZE.
+[clinic start generated code]*/
+
+static int
+_io_BufferedWriter___init___impl(buffered *self, PyObject *raw,
+ Py_ssize_t buffer_size)
+/*[clinic end generated code: output=c8942a020c0dee64 input=914be9b95e16007b]*/
+{
+ self->ok = 0;
+ self->detached = 0;
+
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ if (_PyIOBase_check_writable(state, raw, Py_True) == NULL) {
+ return -1;
+ }
+
+ Py_INCREF(raw);
+ Py_XSETREF(self->raw, raw);
+ self->readable = 0;
+ self->writable = 1;
+
+ self->buffer_size = buffer_size;
+ if (_buffered_init(self) < 0)
+ return -1;
+ _bufferedwriter_reset_buf(self);
+ self->pos = 0;
+
+ self->fast_closed_checks = (
+ Py_IS_TYPE(self, state->PyBufferedWriter_Type) &&
+ Py_IS_TYPE(raw, state->PyFileIO_Type)
+ );
+
+ self->ok = 1;
+ return 0;
+}
+
+static Py_ssize_t
+_bufferedwriter_raw_write(buffered *self, char *start, Py_ssize_t len)
+{
+ Py_buffer buf;
+ PyObject *memobj, *res;
+ Py_ssize_t n;
+ int errnum;
+ /* NOTE: the buffer needn't be released as its object is NULL. */
+ if (PyBuffer_FillInfo(&buf, NULL, start, len, 1, PyBUF_CONTIG_RO) == -1)
+ return -1;
+ memobj = PyMemoryView_FromBuffer(&buf);
+ if (memobj == NULL)
+ return -1;
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals() when EINTR
+ occurs so we needn't do it ourselves.
+ We then retry writing, ignoring the signal if no handler has
+ raised (see issue #10956).
+ */
+ do {
+ errno = 0;
+ res = PyObject_CallMethodOneArg(self->raw, &_Py_ID(write), memobj);
+ errnum = errno;
+ } while (res == NULL && _PyIO_trap_eintr());
+ Py_DECREF(memobj);
+ if (res == NULL)
+ return -1;
+ if (res == Py_None) {
+ /* Non-blocking stream would have blocked. Special return code!
+ Being paranoid we reset errno in case it is changed by code
+ triggered by a decref. errno is used by _set_BlockingIOError(). */
+ Py_DECREF(res);
+ errno = errnum;
+ return -2;
+ }
+ n = PyNumber_AsSsize_t(res, PyExc_ValueError);
+ Py_DECREF(res);
+ if (n < 0 || n > len) {
+ PyErr_Format(PyExc_OSError,
+ "raw write() returned invalid length %zd "
+ "(should have been between 0 and %zd)", n, len);
+ return -1;
+ }
+ if (n > 0 && self->abs_pos != -1)
+ self->abs_pos += n;
+ return n;
+}
+
+static PyObject *
+_bufferedwriter_flush_unlocked(buffered *self)
+{
+ Py_off_t n, rewind;
+
+ if (!VALID_WRITE_BUFFER(self) || self->write_pos == self->write_end)
+ goto end;
+ /* First, rewind */
+ rewind = RAW_OFFSET(self) + (self->pos - self->write_pos);
+ if (rewind != 0) {
+ n = _buffered_raw_seek(self, -rewind, 1);
+ if (n < 0) {
+ goto error;
+ }
+ self->raw_pos -= rewind;
+ }
+ while (self->write_pos < self->write_end) {
+ n = _bufferedwriter_raw_write(self,
+ self->buffer + self->write_pos,
+ Py_SAFE_DOWNCAST(self->write_end - self->write_pos,
+ Py_off_t, Py_ssize_t));
+ if (n == -1) {
+ goto error;
+ }
+ else if (n == -2) {
+ _set_BlockingIOError("write could not complete without blocking",
+ 0);
+ goto error;
+ }
+ self->write_pos += n;
+ self->raw_pos = self->write_pos;
+ /* Partial writes can return successfully when interrupted by a
+ signal (see write(2)). We must run signal handlers before
+ blocking another time, possibly indefinitely. */
+ if (PyErr_CheckSignals() < 0)
+ goto error;
+ }
+
+
+end:
+ /* This ensures that after return from this function,
+ VALID_WRITE_BUFFER(self) returns false.
+
+ This is a required condition because when a tell() is called
+ after flushing and if VALID_READ_BUFFER(self) is false, we need
+ VALID_WRITE_BUFFER(self) to be false to have
+ RAW_OFFSET(self) == 0.
+
+ Issue: https://bugs.python.org/issue32228 */
+ _bufferedwriter_reset_buf(self);
+ Py_RETURN_NONE;
+
+error:
+ return NULL;
+}
+
+/*[clinic input]
+_io.BufferedWriter.write
+ buffer: Py_buffer
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io_BufferedWriter_write_impl(buffered *self, Py_buffer *buffer)
+/*[clinic end generated code: output=7f8d1365759bfc6b input=dd87dd85fc7f8850]*/
+{
+ PyObject *res = NULL;
+ Py_ssize_t written, avail, remaining;
+ Py_off_t offset;
+
+ CHECK_INITIALIZED(self)
+
+ if (!ENTER_BUFFERED(self))
+ return NULL;
+
+ /* Issue #31976: Check for closed file after acquiring the lock. Another
+ thread could be holding the lock while closing the file. */
+ if (IS_CLOSED(self)) {
+ PyErr_SetString(PyExc_ValueError, "write to closed file");
+ goto error;
+ }
+
+ /* Fast path: the data to write can be fully buffered. */
+ if (!VALID_READ_BUFFER(self) && !VALID_WRITE_BUFFER(self)) {
+ self->pos = 0;
+ self->raw_pos = 0;
+ }
+ avail = Py_SAFE_DOWNCAST(self->buffer_size - self->pos, Py_off_t, Py_ssize_t);
+ if (buffer->len <= avail) {
+ memcpy(self->buffer + self->pos, buffer->buf, buffer->len);
+ if (!VALID_WRITE_BUFFER(self) || self->write_pos > self->pos) {
+ self->write_pos = self->pos;
+ }
+ ADJUST_POSITION(self, self->pos + buffer->len);
+ if (self->pos > self->write_end)
+ self->write_end = self->pos;
+ written = buffer->len;
+ goto end;
+ }
+
+ /* First write the current buffer */
+ res = _bufferedwriter_flush_unlocked(self);
+ if (res == NULL) {
+ Py_ssize_t *w = _buffered_check_blocking_error();
+ if (w == NULL)
+ goto error;
+ if (self->readable)
+ _bufferedreader_reset_buf(self);
+ /* Make some place by shifting the buffer. */
+ assert(VALID_WRITE_BUFFER(self));
+ memmove(self->buffer, self->buffer + self->write_pos,
+ Py_SAFE_DOWNCAST(self->write_end - self->write_pos,
+ Py_off_t, Py_ssize_t));
+ self->write_end -= self->write_pos;
+ self->raw_pos -= self->write_pos;
+ self->pos -= self->write_pos;
+ self->write_pos = 0;
+ avail = Py_SAFE_DOWNCAST(self->buffer_size - self->write_end,
+ Py_off_t, Py_ssize_t);
+ if (buffer->len <= avail) {
+ /* Everything can be buffered */
+ PyErr_Clear();
+ memcpy(self->buffer + self->write_end, buffer->buf, buffer->len);
+ self->write_end += buffer->len;
+ self->pos += buffer->len;
+ written = buffer->len;
+ goto end;
+ }
+ /* Buffer as much as possible. */
+ memcpy(self->buffer + self->write_end, buffer->buf, avail);
+ self->write_end += avail;
+ self->pos += avail;
+ /* XXX Modifying the existing exception e using the pointer w
+ will change e.characters_written but not e.args[2].
+ Therefore we just replace with a new error. */
+ _set_BlockingIOError("write could not complete without blocking",
+ avail);
+ goto error;
+ }
+ Py_CLEAR(res);
+
+ /* Adjust the raw stream position if it is away from the logical stream
+ position. This happens if the read buffer has been filled but not
+ modified (and therefore _bufferedwriter_flush_unlocked() didn't rewind
+ the raw stream by itself).
+ Fixes issue #6629.
+ */
+ offset = RAW_OFFSET(self);
+ if (offset != 0) {
+ if (_buffered_raw_seek(self, -offset, 1) < 0)
+ goto error;
+ self->raw_pos -= offset;
+ }
+
+ /* Then write buf itself. At this point the buffer has been emptied. */
+ remaining = buffer->len;
+ written = 0;
+ while (remaining > self->buffer_size) {
+ Py_ssize_t n = _bufferedwriter_raw_write(
+ self, (char *) buffer->buf + written, buffer->len - written);
+ if (n == -1) {
+ goto error;
+ } else if (n == -2) {
+ /* Write failed because raw file is non-blocking */
+ if (remaining > self->buffer_size) {
+ /* Can't buffer everything, still buffer as much as possible */
+ memcpy(self->buffer,
+ (char *) buffer->buf + written, self->buffer_size);
+ self->raw_pos = 0;
+ ADJUST_POSITION(self, self->buffer_size);
+ self->write_end = self->buffer_size;
+ written += self->buffer_size;
+ _set_BlockingIOError("write could not complete without "
+ "blocking", written);
+ goto error;
+ }
+ PyErr_Clear();
+ break;
+ }
+ written += n;
+ remaining -= n;
+ /* Partial writes can return successfully when interrupted by a
+ signal (see write(2)). We must run signal handlers before
+ blocking another time, possibly indefinitely. */
+ if (PyErr_CheckSignals() < 0)
+ goto error;
+ }
+ if (self->readable)
+ _bufferedreader_reset_buf(self);
+ if (remaining > 0) {
+ memcpy(self->buffer, (char *) buffer->buf + written, remaining);
+ written += remaining;
+ }
+ self->write_pos = 0;
+ /* TODO: sanity check (remaining >= 0) */
+ self->write_end = remaining;
+ ADJUST_POSITION(self, remaining);
+ self->raw_pos = 0;
+
+end:
+ res = PyLong_FromSsize_t(written);
+
+error:
+ LEAVE_BUFFERED(self)
+ return res;
+}
+
+
+/*
+ * BufferedRWPair
+ */
+
+/* XXX The usefulness of this (compared to having two separate IO objects) is
+ * questionable.
+ */
+
+typedef struct {
+ PyObject_HEAD
+ buffered *reader;
+ buffered *writer;
+ PyObject *dict;
+ PyObject *weakreflist;
+} rwpair;
+
+/*[clinic input]
+_io.BufferedRWPair.__init__
+ reader: object
+ writer: object
+ buffer_size: Py_ssize_t(c_default="DEFAULT_BUFFER_SIZE") = DEFAULT_BUFFER_SIZE
+ /
+
+A buffered reader and writer object together.
+
+A buffered reader object and buffered writer object put together to
+form a sequential IO object that can read and write. This is typically
+used with a socket or two-way pipe.
+
+reader and writer are RawIOBase objects that are readable and
+writeable respectively. If the buffer_size is omitted it defaults to
+DEFAULT_BUFFER_SIZE.
+[clinic start generated code]*/
+
+static int
+_io_BufferedRWPair___init___impl(rwpair *self, PyObject *reader,
+ PyObject *writer, Py_ssize_t buffer_size)
+/*[clinic end generated code: output=327e73d1aee8f984 input=620d42d71f33a031]*/
+{
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ if (_PyIOBase_check_readable(state, reader, Py_True) == NULL) {
+ return -1;
+ }
+ if (_PyIOBase_check_writable(state, writer, Py_True) == NULL) {
+ return -1;
+ }
+
+ self->reader = (buffered *) PyObject_CallFunction(
+ (PyObject *)state->PyBufferedReader_Type,
+ "On", reader, buffer_size);
+ if (self->reader == NULL)
+ return -1;
+
+ self->writer = (buffered *) PyObject_CallFunction(
+ (PyObject *)state->PyBufferedWriter_Type,
+ "On", writer, buffer_size);
+ if (self->writer == NULL) {
+ Py_CLEAR(self->reader);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+bufferedrwpair_traverse(rwpair *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->dict);
+ Py_VISIT(self->reader);
+ Py_VISIT(self->writer);
+ return 0;
+}
+
+static int
+bufferedrwpair_clear(rwpair *self)
+{
+ Py_CLEAR(self->reader);
+ Py_CLEAR(self->writer);
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+bufferedrwpair_dealloc(rwpair *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ _PyObject_GC_UNTRACK(self);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *)self);
+ (void)bufferedrwpair_clear(self);
+ tp->tp_free((PyObject *) self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+_forward_call(buffered *self, PyObject *name, PyObject *args)
+{
+ PyObject *func, *ret;
+ if (self == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "I/O operation on uninitialized object");
+ return NULL;
+ }
+
+ func = PyObject_GetAttr((PyObject *)self, name);
+ if (func == NULL) {
+ PyErr_SetObject(PyExc_AttributeError, name);
+ return NULL;
+ }
+
+ ret = PyObject_CallObject(func, args);
+ Py_DECREF(func);
+ return ret;
+}
+
+static PyObject *
+bufferedrwpair_read(rwpair *self, PyObject *args)
+{
+ return _forward_call(self->reader, &_Py_ID(read), args);
+}
+
+static PyObject *
+bufferedrwpair_peek(rwpair *self, PyObject *args)
+{
+ return _forward_call(self->reader, &_Py_ID(peek), args);
+}
+
+static PyObject *
+bufferedrwpair_read1(rwpair *self, PyObject *args)
+{
+ return _forward_call(self->reader, &_Py_ID(read1), args);
+}
+
+static PyObject *
+bufferedrwpair_readinto(rwpair *self, PyObject *args)
+{
+ return _forward_call(self->reader, &_Py_ID(readinto), args);
+}
+
+static PyObject *
+bufferedrwpair_readinto1(rwpair *self, PyObject *args)
+{
+ return _forward_call(self->reader, &_Py_ID(readinto1), args);
+}
+
+static PyObject *
+bufferedrwpair_write(rwpair *self, PyObject *args)
+{
+ return _forward_call(self->writer, &_Py_ID(write), args);
+}
+
+static PyObject *
+bufferedrwpair_flush(rwpair *self, PyObject *Py_UNUSED(ignored))
+{
+ return _forward_call(self->writer, &_Py_ID(flush), NULL);
+}
+
+static PyObject *
+bufferedrwpair_readable(rwpair *self, PyObject *Py_UNUSED(ignored))
+{
+ return _forward_call(self->reader, &_Py_ID(readable), NULL);
+}
+
+static PyObject *
+bufferedrwpair_writable(rwpair *self, PyObject *Py_UNUSED(ignored))
+{
+ return _forward_call(self->writer, &_Py_ID(writable), NULL);
+}
+
+static PyObject *
+bufferedrwpair_close(rwpair *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *exc = NULL;
+ PyObject *ret = _forward_call(self->writer, &_Py_ID(close), NULL);
+ if (ret == NULL) {
+ exc = PyErr_GetRaisedException();
+ }
+ else {
+ Py_DECREF(ret);
+ }
+ ret = _forward_call(self->reader, &_Py_ID(close), NULL);
+ if (exc != NULL) {
+ _PyErr_ChainExceptions1(exc);
+ Py_CLEAR(ret);
+ }
+ return ret;
+}
+
+static PyObject *
+bufferedrwpair_isatty(rwpair *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *ret = _forward_call(self->writer, &_Py_ID(isatty), NULL);
+
+ if (ret != Py_False) {
+ /* either True or exception */
+ return ret;
+ }
+ Py_DECREF(ret);
+
+ return _forward_call(self->reader, &_Py_ID(isatty), NULL);
+}
+
+static PyObject *
+bufferedrwpair_closed_get(rwpair *self, void *context)
+{
+ if (self->writer == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "the BufferedRWPair object is being garbage-collected");
+ return NULL;
+ }
+ return PyObject_GetAttr((PyObject *) self->writer, &_Py_ID(closed));
+}
+
+
+/*
+ * BufferedRandom
+ */
+
+/*[clinic input]
+_io.BufferedRandom.__init__
+ raw: object
+ buffer_size: Py_ssize_t(c_default="DEFAULT_BUFFER_SIZE") = DEFAULT_BUFFER_SIZE
+
+A buffered interface to random access streams.
+
+The constructor creates a reader and writer for a seekable stream,
+raw, given in the first argument. If the buffer_size is omitted it
+defaults to DEFAULT_BUFFER_SIZE.
+[clinic start generated code]*/
+
+static int
+_io_BufferedRandom___init___impl(buffered *self, PyObject *raw,
+ Py_ssize_t buffer_size)
+/*[clinic end generated code: output=d3d64eb0f64e64a3 input=a4e818fb86d0e50c]*/
+{
+ self->ok = 0;
+ self->detached = 0;
+
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ if (_PyIOBase_check_seekable(state, raw, Py_True) == NULL) {
+ return -1;
+ }
+ if (_PyIOBase_check_readable(state, raw, Py_True) == NULL) {
+ return -1;
+ }
+ if (_PyIOBase_check_writable(state, raw, Py_True) == NULL) {
+ return -1;
+ }
+
+ Py_INCREF(raw);
+ Py_XSETREF(self->raw, raw);
+ self->buffer_size = buffer_size;
+ self->readable = 1;
+ self->writable = 1;
+
+ if (_buffered_init(self) < 0)
+ return -1;
+ _bufferedreader_reset_buf(self);
+ _bufferedwriter_reset_buf(self);
+ self->pos = 0;
+
+ self->fast_closed_checks = (Py_IS_TYPE(self, state->PyBufferedRandom_Type) &&
+ Py_IS_TYPE(raw, state->PyFileIO_Type));
+
+ self->ok = 1;
+ return 0;
+}
+
+#define clinic_state() (find_io_state_by_def(Py_TYPE(self)))
+#include "clinic/bufferedio.c.h"
+#undef clinic_state
+
+static PyMethodDef bufferediobase_methods[] = {
+ _IO__BUFFEREDIOBASE_DETACH_METHODDEF
+ _IO__BUFFEREDIOBASE_READ_METHODDEF
+ _IO__BUFFEREDIOBASE_READ1_METHODDEF
+ _IO__BUFFEREDIOBASE_READINTO_METHODDEF
+ _IO__BUFFEREDIOBASE_READINTO1_METHODDEF
+ _IO__BUFFEREDIOBASE_WRITE_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot bufferediobase_slots[] = {
+ {Py_tp_doc, (void *)bufferediobase_doc},
+ {Py_tp_methods, bufferediobase_methods},
+ {0, NULL},
+};
+
+/* Do not set Py_TPFLAGS_HAVE_GC so that tp_traverse and tp_clear are inherited */
+PyType_Spec bufferediobase_spec = {
+ .name = "_io._BufferedIOBase",
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bufferediobase_slots,
+};
+
+static PyMethodDef bufferedreader_methods[] = {
+ /* BufferedIOMixin methods */
+ _IO__BUFFERED_DETACH_METHODDEF
+ _IO__BUFFERED_SIMPLE_FLUSH_METHODDEF
+ _IO__BUFFERED_CLOSE_METHODDEF
+ _IO__BUFFERED_SEEKABLE_METHODDEF
+ _IO__BUFFERED_READABLE_METHODDEF
+ _IO__BUFFERED_FILENO_METHODDEF
+ _IO__BUFFERED_ISATTY_METHODDEF
+ _IO__BUFFERED__DEALLOC_WARN_METHODDEF
+
+ _IO__BUFFERED_READ_METHODDEF
+ _IO__BUFFERED_PEEK_METHODDEF
+ _IO__BUFFERED_READ1_METHODDEF
+ _IO__BUFFERED_READINTO_METHODDEF
+ _IO__BUFFERED_READINTO1_METHODDEF
+ _IO__BUFFERED_READLINE_METHODDEF
+ _IO__BUFFERED_SEEK_METHODDEF
+ _IO__BUFFERED_TELL_METHODDEF
+ _IO__BUFFERED_TRUNCATE_METHODDEF
+ _IO__BUFFERED___SIZEOF___METHODDEF
+
+ {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {NULL, NULL}
+};
+
+static PyMemberDef bufferedreader_members[] = {
+ {"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+ {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(buffered, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(buffered, dict), READONLY},
+ {NULL}
+};
+
+static PyGetSetDef bufferedreader_getset[] = {
+ {"closed", (getter)buffered_closed_get, NULL, NULL},
+ {"name", (getter)buffered_name_get, NULL, NULL},
+ {"mode", (getter)buffered_mode_get, NULL, NULL},
+ {NULL}
+};
+
+
+static PyType_Slot bufferedreader_slots[] = {
+ {Py_tp_dealloc, buffered_dealloc},
+ {Py_tp_repr, buffered_repr},
+ {Py_tp_doc, (void *)_io_BufferedReader___init____doc__},
+ {Py_tp_traverse, buffered_traverse},
+ {Py_tp_clear, buffered_clear},
+ {Py_tp_iternext, buffered_iternext},
+ {Py_tp_methods, bufferedreader_methods},
+ {Py_tp_members, bufferedreader_members},
+ {Py_tp_getset, bufferedreader_getset},
+ {Py_tp_init, _io_BufferedReader___init__},
+ {0, NULL},
+};
+
+PyType_Spec bufferedreader_spec = {
+ .name = "_io.BufferedReader",
+ .basicsize = sizeof(buffered),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bufferedreader_slots,
+};
+
+static PyMethodDef bufferedwriter_methods[] = {
+ /* BufferedIOMixin methods */
+ _IO__BUFFERED_CLOSE_METHODDEF
+ _IO__BUFFERED_DETACH_METHODDEF
+ _IO__BUFFERED_SEEKABLE_METHODDEF
+ _IO__BUFFERED_WRITABLE_METHODDEF
+ _IO__BUFFERED_FILENO_METHODDEF
+ _IO__BUFFERED_ISATTY_METHODDEF
+ _IO__BUFFERED__DEALLOC_WARN_METHODDEF
+
+ _IO_BUFFEREDWRITER_WRITE_METHODDEF
+ _IO__BUFFERED_TRUNCATE_METHODDEF
+ _IO__BUFFERED_FLUSH_METHODDEF
+ _IO__BUFFERED_SEEK_METHODDEF
+ _IO__BUFFERED_TELL_METHODDEF
+ _IO__BUFFERED___SIZEOF___METHODDEF
+
+ {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {NULL, NULL}
+};
+
+static PyMemberDef bufferedwriter_members[] = {
+ {"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+ {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(buffered, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(buffered, dict), READONLY},
+ {NULL}
+};
+
+static PyGetSetDef bufferedwriter_getset[] = {
+ {"closed", (getter)buffered_closed_get, NULL, NULL},
+ {"name", (getter)buffered_name_get, NULL, NULL},
+ {"mode", (getter)buffered_mode_get, NULL, NULL},
+ {NULL}
+};
+
+
+static PyType_Slot bufferedwriter_slots[] = {
+ {Py_tp_dealloc, buffered_dealloc},
+ {Py_tp_repr, buffered_repr},
+ {Py_tp_doc, (void *)_io_BufferedWriter___init____doc__},
+ {Py_tp_traverse, buffered_traverse},
+ {Py_tp_clear, buffered_clear},
+ {Py_tp_methods, bufferedwriter_methods},
+ {Py_tp_members, bufferedwriter_members},
+ {Py_tp_getset, bufferedwriter_getset},
+ {Py_tp_init, _io_BufferedWriter___init__},
+ {0, NULL},
+};
+
+PyType_Spec bufferedwriter_spec = {
+ .name = "_io.BufferedWriter",
+ .basicsize = sizeof(buffered),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bufferedwriter_slots,
+};
+
+static PyMethodDef bufferedrwpair_methods[] = {
+ {"read", (PyCFunction)bufferedrwpair_read, METH_VARARGS},
+ {"peek", (PyCFunction)bufferedrwpair_peek, METH_VARARGS},
+ {"read1", (PyCFunction)bufferedrwpair_read1, METH_VARARGS},
+ {"readinto", (PyCFunction)bufferedrwpair_readinto, METH_VARARGS},
+ {"readinto1", (PyCFunction)bufferedrwpair_readinto1, METH_VARARGS},
+
+ {"write", (PyCFunction)bufferedrwpair_write, METH_VARARGS},
+ {"flush", (PyCFunction)bufferedrwpair_flush, METH_NOARGS},
+
+ {"readable", (PyCFunction)bufferedrwpair_readable, METH_NOARGS},
+ {"writable", (PyCFunction)bufferedrwpair_writable, METH_NOARGS},
+
+ {"close", (PyCFunction)bufferedrwpair_close, METH_NOARGS},
+ {"isatty", (PyCFunction)bufferedrwpair_isatty, METH_NOARGS},
+
+ {NULL, NULL}
+};
+
+static PyMemberDef bufferedrwpair_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(rwpair, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(rwpair, dict), READONLY},
+ {NULL}
+};
+
+static PyGetSetDef bufferedrwpair_getset[] = {
+ {"closed", (getter)bufferedrwpair_closed_get, NULL, NULL},
+ {NULL}
+};
+
+static PyType_Slot bufferedrwpair_slots[] = {
+ {Py_tp_dealloc, bufferedrwpair_dealloc},
+ {Py_tp_doc, (void *)_io_BufferedRWPair___init____doc__},
+ {Py_tp_traverse, bufferedrwpair_traverse},
+ {Py_tp_clear, bufferedrwpair_clear},
+ {Py_tp_methods, bufferedrwpair_methods},
+ {Py_tp_members, bufferedrwpair_members},
+ {Py_tp_getset, bufferedrwpair_getset},
+ {Py_tp_init, _io_BufferedRWPair___init__},
+ {0, NULL},
+};
+
+PyType_Spec bufferedrwpair_spec = {
+ .name = "_io.BufferedRWPair",
+ .basicsize = sizeof(rwpair),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bufferedrwpair_slots,
+};
+
+
+static PyMethodDef bufferedrandom_methods[] = {
+ /* BufferedIOMixin methods */
+ _IO__BUFFERED_CLOSE_METHODDEF
+ _IO__BUFFERED_DETACH_METHODDEF
+ _IO__BUFFERED_SEEKABLE_METHODDEF
+ _IO__BUFFERED_READABLE_METHODDEF
+ _IO__BUFFERED_WRITABLE_METHODDEF
+ _IO__BUFFERED_FILENO_METHODDEF
+ _IO__BUFFERED_ISATTY_METHODDEF
+ _IO__BUFFERED__DEALLOC_WARN_METHODDEF
+
+ _IO__BUFFERED_FLUSH_METHODDEF
+
+ _IO__BUFFERED_SEEK_METHODDEF
+ _IO__BUFFERED_TELL_METHODDEF
+ _IO__BUFFERED_TRUNCATE_METHODDEF
+ _IO__BUFFERED_READ_METHODDEF
+ _IO__BUFFERED_READ1_METHODDEF
+ _IO__BUFFERED_READINTO_METHODDEF
+ _IO__BUFFERED_READINTO1_METHODDEF
+ _IO__BUFFERED_READLINE_METHODDEF
+ _IO__BUFFERED_PEEK_METHODDEF
+ _IO_BUFFEREDWRITER_WRITE_METHODDEF
+ _IO__BUFFERED___SIZEOF___METHODDEF
+
+ {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {NULL, NULL}
+};
+
+static PyMemberDef bufferedrandom_members[] = {
+ {"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+ {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(buffered, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(buffered, dict), READONLY},
+ {NULL}
+};
+
+static PyGetSetDef bufferedrandom_getset[] = {
+ {"closed", (getter)buffered_closed_get, NULL, NULL},
+ {"name", (getter)buffered_name_get, NULL, NULL},
+ {"mode", (getter)buffered_mode_get, NULL, NULL},
+ {NULL}
+};
+
+
+static PyType_Slot bufferedrandom_slots[] = {
+ {Py_tp_dealloc, buffered_dealloc},
+ {Py_tp_repr, buffered_repr},
+ {Py_tp_doc, (void *)_io_BufferedRandom___init____doc__},
+ {Py_tp_traverse, buffered_traverse},
+ {Py_tp_clear, buffered_clear},
+ {Py_tp_iternext, buffered_iternext},
+ {Py_tp_methods, bufferedrandom_methods},
+ {Py_tp_members, bufferedrandom_members},
+ {Py_tp_getset, bufferedrandom_getset},
+ {Py_tp_init, _io_BufferedRandom___init__},
+ {0, NULL},
+};
+
+PyType_Spec bufferedrandom_spec = {
+ .name = "_io.BufferedRandom",
+ .basicsize = sizeof(buffered),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bufferedrandom_slots,
+};
diff --git a/contrib/tools/python3/Modules/_io/bytesio.c b/contrib/tools/python3/Modules/_io/bytesio.c
new file mode 100644
index 00000000000..9459affa4a8
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/bytesio.c
@@ -0,0 +1,1133 @@
+#include "Python.h"
+#include "pycore_object.h"
+#include <stddef.h> // offsetof()
+#include "_iomodule.h"
+
+/*[clinic input]
+module _io
+class _io.BytesIO "bytesio *" "clinic_state()->PyBytesIO_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=48ede2f330f847c3]*/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *buf;
+ Py_ssize_t pos;
+ Py_ssize_t string_size;
+ PyObject *dict;
+ PyObject *weakreflist;
+ Py_ssize_t exports;
+} bytesio;
+
+typedef struct {
+ PyObject_HEAD
+ bytesio *source;
+} bytesiobuf;
+
+/* The bytesio object can be in three states:
+ * Py_REFCNT(buf) == 1, exports == 0.
+ * Py_REFCNT(buf) > 1. exports == 0,
+ first modification or export causes the internal buffer copying.
+ * exports > 0. Py_REFCNT(buf) == 1, any modifications are forbidden.
+*/
+
+static int
+check_closed(bytesio *self)
+{
+ if (self->buf == NULL) {
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed file.");
+ return 1;
+ }
+ return 0;
+}
+
+static int
+check_exports(bytesio *self)
+{
+ if (self->exports > 0) {
+ PyErr_SetString(PyExc_BufferError,
+ "Existing exports of data: object cannot be re-sized");
+ return 1;
+ }
+ return 0;
+}
+
+#define CHECK_CLOSED(self) \
+ if (check_closed(self)) { \
+ return NULL; \
+ }
+
+#define CHECK_EXPORTS(self) \
+ if (check_exports(self)) { \
+ return NULL; \
+ }
+
+#define SHARED_BUF(self) (Py_REFCNT((self)->buf) > 1)
+
+
+/* Internal routine to get a line from the buffer of a BytesIO
+ object. Returns the length between the current position to the
+ next newline character. */
+static Py_ssize_t
+scan_eol(bytesio *self, Py_ssize_t len)
+{
+ const char *start, *n;
+ Py_ssize_t maxlen;
+
+ assert(self->buf != NULL);
+ assert(self->pos >= 0);
+
+ if (self->pos >= self->string_size)
+ return 0;
+
+ /* Move to the end of the line, up to the end of the string, s. */
+ maxlen = self->string_size - self->pos;
+ if (len < 0 || len > maxlen)
+ len = maxlen;
+
+ if (len) {
+ start = PyBytes_AS_STRING(self->buf) + self->pos;
+ n = memchr(start, '\n', len);
+ if (n)
+ /* Get the length from the current position to the end of
+ the line. */
+ len = n - start + 1;
+ }
+ assert(len >= 0);
+ assert(self->pos < PY_SSIZE_T_MAX - len);
+
+ return len;
+}
+
+/* Internal routine for detaching the shared buffer of BytesIO objects.
+ The caller should ensure that the 'size' argument is non-negative and
+ not lesser than self->string_size. Returns 0 on success, -1 otherwise. */
+static int
+unshare_buffer(bytesio *self, size_t size)
+{
+ PyObject *new_buf;
+ assert(SHARED_BUF(self));
+ assert(self->exports == 0);
+ assert(size >= (size_t)self->string_size);
+ new_buf = PyBytes_FromStringAndSize(NULL, size);
+ if (new_buf == NULL)
+ return -1;
+ memcpy(PyBytes_AS_STRING(new_buf), PyBytes_AS_STRING(self->buf),
+ self->string_size);
+ Py_SETREF(self->buf, new_buf);
+ return 0;
+}
+
+/* Internal routine for changing the size of the buffer of BytesIO objects.
+ The caller should ensure that the 'size' argument is non-negative. Returns
+ 0 on success, -1 otherwise. */
+static int
+resize_buffer(bytesio *self, size_t size)
+{
+ assert(self->buf != NULL);
+ assert(self->exports == 0);
+
+ /* Here, unsigned types are used to avoid dealing with signed integer
+ overflow, which is undefined in C. */
+ size_t alloc = PyBytes_GET_SIZE(self->buf);
+
+ /* For simplicity, stay in the range of the signed type. Anyway, Python
+ doesn't allow strings to be longer than this. */
+ if (size > PY_SSIZE_T_MAX)
+ goto overflow;
+
+ if (size < alloc / 2) {
+ /* Major downsize; resize down to exact size. */
+ alloc = size + 1;
+ }
+ else if (size < alloc) {
+ /* Within allocated size; quick exit */
+ return 0;
+ }
+ else if (size <= alloc * 1.125) {
+ /* Moderate upsize; overallocate similar to list_resize() */
+ alloc = size + (size >> 3) + (size < 9 ? 3 : 6);
+ }
+ else {
+ /* Major upsize; resize up to exact size */
+ alloc = size + 1;
+ }
+
+ if (alloc > ((size_t)-1) / sizeof(char))
+ goto overflow;
+
+ if (SHARED_BUF(self)) {
+ if (unshare_buffer(self, alloc) < 0)
+ return -1;
+ }
+ else {
+ if (_PyBytes_Resize(&self->buf, alloc) < 0)
+ return -1;
+ }
+
+ return 0;
+
+ overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "new buffer size too large");
+ return -1;
+}
+
+/* Internal routine for writing a string of bytes to the buffer of a BytesIO
+ object. Returns the number of bytes written, or -1 on error.
+ Inlining is disabled because it's significantly decreases performance
+ of writelines() in PGO build. */
+Py_NO_INLINE static Py_ssize_t
+write_bytes(bytesio *self, PyObject *b)
+{
+ if (check_closed(self)) {
+ return -1;
+ }
+ if (check_exports(self)) {
+ return -1;
+ }
+
+ Py_buffer buf;
+ if (PyObject_GetBuffer(b, &buf, PyBUF_CONTIG_RO) < 0) {
+ return -1;
+ }
+ Py_ssize_t len = buf.len;
+ if (len == 0) {
+ goto done;
+ }
+
+ assert(self->pos >= 0);
+ size_t endpos = (size_t)self->pos + len;
+ if (endpos > (size_t)PyBytes_GET_SIZE(self->buf)) {
+ if (resize_buffer(self, endpos) < 0) {
+ len = -1;
+ goto done;
+ }
+ }
+ else if (SHARED_BUF(self)) {
+ if (unshare_buffer(self, Py_MAX(endpos, (size_t)self->string_size)) < 0) {
+ len = -1;
+ goto done;
+ }
+ }
+
+ if (self->pos > self->string_size) {
+ /* In case of overseek, pad with null bytes the buffer region between
+ the end of stream and the current position.
+
+ 0 lo string_size hi
+ | |<---used--->|<----------available----------->|
+ | | <--to pad-->|<---to write---> |
+ 0 buf position
+ */
+ memset(PyBytes_AS_STRING(self->buf) + self->string_size, '\0',
+ (self->pos - self->string_size) * sizeof(char));
+ }
+
+ /* Copy the data to the internal buffer, overwriting some of the existing
+ data if self->pos < self->string_size. */
+ memcpy(PyBytes_AS_STRING(self->buf) + self->pos, buf.buf, len);
+ self->pos = endpos;
+
+ /* Set the new length of the internal string if it has changed. */
+ if ((size_t)self->string_size < endpos) {
+ self->string_size = endpos;
+ }
+
+ done:
+ PyBuffer_Release(&buf);
+ return len;
+}
+
+static PyObject *
+bytesio_get_closed(bytesio *self, void *Py_UNUSED(ignored))
+{
+ if (self->buf == NULL) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+/*[clinic input]
+_io.BytesIO.readable
+
+Returns True if the IO object can be read.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_readable_impl(bytesio *self)
+/*[clinic end generated code: output=4e93822ad5b62263 input=96c5d0cccfb29f5c]*/
+{
+ CHECK_CLOSED(self);
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_io.BytesIO.writable
+
+Returns True if the IO object can be written.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_writable_impl(bytesio *self)
+/*[clinic end generated code: output=64ff6a254b1150b8 input=700eed808277560a]*/
+{
+ CHECK_CLOSED(self);
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_io.BytesIO.seekable
+
+Returns True if the IO object can be seeked.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_seekable_impl(bytesio *self)
+/*[clinic end generated code: output=6b417f46dcc09b56 input=9421f65627a344dd]*/
+{
+ CHECK_CLOSED(self);
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_io.BytesIO.flush
+
+Does nothing.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_flush_impl(bytesio *self)
+/*[clinic end generated code: output=187e3d781ca134a0 input=561ea490be4581a7]*/
+{
+ CHECK_CLOSED(self);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_io.BytesIO.getbuffer
+
+ cls: defining_class
+ /
+
+Get a read-write view over the contents of the BytesIO object.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_getbuffer_impl(bytesio *self, PyTypeObject *cls)
+/*[clinic end generated code: output=045091d7ce87fe4e input=0668fbb48f95dffa]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ PyTypeObject *type = state->PyBytesIOBuffer_Type;
+ bytesiobuf *buf;
+ PyObject *view;
+
+ CHECK_CLOSED(self);
+
+ buf = (bytesiobuf *) type->tp_alloc(type, 0);
+ if (buf == NULL)
+ return NULL;
+ buf->source = (bytesio*)Py_NewRef(self);
+ view = PyMemoryView_FromObject((PyObject *) buf);
+ Py_DECREF(buf);
+ return view;
+}
+
+/*[clinic input]
+_io.BytesIO.getvalue
+
+Retrieve the entire contents of the BytesIO object.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_getvalue_impl(bytesio *self)
+/*[clinic end generated code: output=b3f6a3233c8fd628 input=4b403ac0af3973ed]*/
+{
+ CHECK_CLOSED(self);
+ if (self->string_size <= 1 || self->exports > 0)
+ return PyBytes_FromStringAndSize(PyBytes_AS_STRING(self->buf),
+ self->string_size);
+
+ if (self->string_size != PyBytes_GET_SIZE(self->buf)) {
+ if (SHARED_BUF(self)) {
+ if (unshare_buffer(self, self->string_size) < 0)
+ return NULL;
+ }
+ else {
+ if (_PyBytes_Resize(&self->buf, self->string_size) < 0)
+ return NULL;
+ }
+ }
+ return Py_NewRef(self->buf);
+}
+
+/*[clinic input]
+_io.BytesIO.isatty
+
+Always returns False.
+
+BytesIO objects are not connected to a TTY-like device.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_isatty_impl(bytesio *self)
+/*[clinic end generated code: output=df67712e669f6c8f input=6f97f0985d13f827]*/
+{
+ CHECK_CLOSED(self);
+ Py_RETURN_FALSE;
+}
+
+/*[clinic input]
+_io.BytesIO.tell
+
+Current file position, an integer.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_tell_impl(bytesio *self)
+/*[clinic end generated code: output=b54b0f93cd0e5e1d input=b106adf099cb3657]*/
+{
+ CHECK_CLOSED(self);
+ return PyLong_FromSsize_t(self->pos);
+}
+
+static PyObject *
+read_bytes(bytesio *self, Py_ssize_t size)
+{
+ const char *output;
+
+ assert(self->buf != NULL);
+ assert(size <= self->string_size);
+ if (size > 1 &&
+ self->pos == 0 && size == PyBytes_GET_SIZE(self->buf) &&
+ self->exports == 0) {
+ self->pos += size;
+ return Py_NewRef(self->buf);
+ }
+
+ output = PyBytes_AS_STRING(self->buf) + self->pos;
+ self->pos += size;
+ return PyBytes_FromStringAndSize(output, size);
+}
+
+/*[clinic input]
+_io.BytesIO.read
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read at most size bytes, returned as a bytes object.
+
+If the size argument is negative, read until EOF is reached.
+Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_read_impl(bytesio *self, Py_ssize_t size)
+/*[clinic end generated code: output=9cc025f21c75bdd2 input=74344a39f431c3d7]*/
+{
+ Py_ssize_t n;
+
+ CHECK_CLOSED(self);
+
+ /* adjust invalid sizes */
+ n = self->string_size - self->pos;
+ if (size < 0 || size > n) {
+ size = n;
+ if (size < 0)
+ size = 0;
+ }
+
+ return read_bytes(self, size);
+}
+
+
+/*[clinic input]
+_io.BytesIO.read1
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read at most size bytes, returned as a bytes object.
+
+If the size argument is negative or omitted, read until EOF is reached.
+Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_read1_impl(bytesio *self, Py_ssize_t size)
+/*[clinic end generated code: output=d0f843285aa95f1c input=440a395bf9129ef5]*/
+{
+ return _io_BytesIO_read_impl(self, size);
+}
+
+/*[clinic input]
+_io.BytesIO.readline
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Next line from the file, as a bytes object.
+
+Retain newline. A non-negative size argument limits the maximum
+number of bytes to return (an incomplete line may be returned then).
+Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_readline_impl(bytesio *self, Py_ssize_t size)
+/*[clinic end generated code: output=4bff3c251df8ffcd input=e7c3fbd1744e2783]*/
+{
+ Py_ssize_t n;
+
+ CHECK_CLOSED(self);
+
+ n = scan_eol(self, size);
+
+ return read_bytes(self, n);
+}
+
+/*[clinic input]
+_io.BytesIO.readlines
+ size as arg: object = None
+ /
+
+List of bytes objects, each a line from the file.
+
+Call readline() repeatedly and return a list of the lines so read.
+The optional size argument, if given, is an approximate bound on the
+total number of bytes in the lines returned.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_readlines_impl(bytesio *self, PyObject *arg)
+/*[clinic end generated code: output=09b8e34c880808ff input=691aa1314f2c2a87]*/
+{
+ Py_ssize_t maxsize, size, n;
+ PyObject *result, *line;
+ const char *output;
+
+ CHECK_CLOSED(self);
+
+ if (PyLong_Check(arg)) {
+ maxsize = PyLong_AsSsize_t(arg);
+ if (maxsize == -1 && PyErr_Occurred())
+ return NULL;
+ }
+ else if (arg == Py_None) {
+ /* No size limit, by default. */
+ maxsize = -1;
+ }
+ else {
+ PyErr_Format(PyExc_TypeError, "integer argument expected, got '%s'",
+ Py_TYPE(arg)->tp_name);
+ return NULL;
+ }
+
+ size = 0;
+ result = PyList_New(0);
+ if (!result)
+ return NULL;
+
+ output = PyBytes_AS_STRING(self->buf) + self->pos;
+ while ((n = scan_eol(self, -1)) != 0) {
+ self->pos += n;
+ line = PyBytes_FromStringAndSize(output, n);
+ if (!line)
+ goto on_error;
+ if (PyList_Append(result, line) == -1) {
+ Py_DECREF(line);
+ goto on_error;
+ }
+ Py_DECREF(line);
+ size += n;
+ if (maxsize > 0 && size >= maxsize)
+ break;
+ output += n;
+ }
+ return result;
+
+ on_error:
+ Py_DECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+_io.BytesIO.readinto
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+
+Read bytes into buffer.
+
+Returns number of bytes read (0 for EOF), or None if the object
+is set not to block and has no data to read.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer)
+/*[clinic end generated code: output=a5d407217dcf0639 input=1424d0fdce857919]*/
+{
+ Py_ssize_t len, n;
+
+ CHECK_CLOSED(self);
+
+ /* adjust invalid sizes */
+ len = buffer->len;
+ n = self->string_size - self->pos;
+ if (len > n) {
+ len = n;
+ if (len < 0)
+ len = 0;
+ }
+
+ memcpy(buffer->buf, PyBytes_AS_STRING(self->buf) + self->pos, len);
+ assert(self->pos + len < PY_SSIZE_T_MAX);
+ assert(len >= 0);
+ self->pos += len;
+
+ return PyLong_FromSsize_t(len);
+}
+
+/*[clinic input]
+_io.BytesIO.truncate
+ size: Py_ssize_t(accept={int, NoneType}, c_default="self->pos") = None
+ /
+
+Truncate the file to at most size bytes.
+
+Size defaults to the current file position, as returned by tell().
+The current file position is unchanged. Returns the new size.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_truncate_impl(bytesio *self, Py_ssize_t size)
+/*[clinic end generated code: output=9ad17650c15fa09b input=423759dd42d2f7c1]*/
+{
+ CHECK_CLOSED(self);
+ CHECK_EXPORTS(self);
+
+ if (size < 0) {
+ PyErr_Format(PyExc_ValueError,
+ "negative size value %zd", size);
+ return NULL;
+ }
+
+ if (size < self->string_size) {
+ self->string_size = size;
+ if (resize_buffer(self, size) < 0)
+ return NULL;
+ }
+
+ return PyLong_FromSsize_t(size);
+}
+
+static PyObject *
+bytesio_iternext(bytesio *self)
+{
+ Py_ssize_t n;
+
+ CHECK_CLOSED(self);
+
+ n = scan_eol(self, -1);
+
+ if (n == 0)
+ return NULL;
+
+ return read_bytes(self, n);
+}
+
+/*[clinic input]
+_io.BytesIO.seek
+ pos: Py_ssize_t
+ whence: int = 0
+ /
+
+Change stream position.
+
+Seek to byte offset pos relative to position indicated by whence:
+ 0 Start of stream (the default). pos should be >= 0;
+ 1 Current position - pos may be negative;
+ 2 End of stream - pos usually negative.
+Returns the new absolute position.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence)
+/*[clinic end generated code: output=c26204a68e9190e4 input=1e875e6ebc652948]*/
+{
+ CHECK_CLOSED(self);
+
+ if (pos < 0 && whence == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "negative seek value %zd", pos);
+ return NULL;
+ }
+
+ /* whence = 0: offset relative to beginning of the string.
+ whence = 1: offset relative to current position.
+ whence = 2: offset relative the end of the string. */
+ if (whence == 1) {
+ if (pos > PY_SSIZE_T_MAX - self->pos) {
+ PyErr_SetString(PyExc_OverflowError,
+ "new position too large");
+ return NULL;
+ }
+ pos += self->pos;
+ }
+ else if (whence == 2) {
+ if (pos > PY_SSIZE_T_MAX - self->string_size) {
+ PyErr_SetString(PyExc_OverflowError,
+ "new position too large");
+ return NULL;
+ }
+ pos += self->string_size;
+ }
+ else if (whence != 0) {
+ PyErr_Format(PyExc_ValueError,
+ "invalid whence (%i, should be 0, 1 or 2)", whence);
+ return NULL;
+ }
+
+ if (pos < 0)
+ pos = 0;
+ self->pos = pos;
+
+ return PyLong_FromSsize_t(self->pos);
+}
+
+/*[clinic input]
+_io.BytesIO.write
+ b: object
+ /
+
+Write bytes to file.
+
+Return the number of bytes written.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_write(bytesio *self, PyObject *b)
+/*[clinic end generated code: output=53316d99800a0b95 input=f5ec7c8c64ed720a]*/
+{
+ Py_ssize_t n = write_bytes(self, b);
+ return n >= 0 ? PyLong_FromSsize_t(n) : NULL;
+}
+
+/*[clinic input]
+_io.BytesIO.writelines
+ lines: object
+ /
+
+Write lines to the file.
+
+Note that newlines are not added. lines can be any iterable object
+producing bytes-like objects. This is equivalent to calling write() for
+each element.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_writelines(bytesio *self, PyObject *lines)
+/*[clinic end generated code: output=7f33aa3271c91752 input=e972539176fc8fc1]*/
+{
+ PyObject *it, *item;
+
+ CHECK_CLOSED(self);
+
+ it = PyObject_GetIter(lines);
+ if (it == NULL)
+ return NULL;
+
+ while ((item = PyIter_Next(it)) != NULL) {
+ Py_ssize_t ret = write_bytes(self, item);
+ Py_DECREF(item);
+ if (ret < 0) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ }
+ Py_DECREF(it);
+
+ /* See if PyIter_Next failed */
+ if (PyErr_Occurred())
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_io.BytesIO.close
+
+Disable all I/O operations.
+[clinic start generated code]*/
+
+static PyObject *
+_io_BytesIO_close_impl(bytesio *self)
+/*[clinic end generated code: output=1471bb9411af84a0 input=37e1f55556e61f60]*/
+{
+ CHECK_EXPORTS(self);
+ Py_CLEAR(self->buf);
+ Py_RETURN_NONE;
+}
+
+/* Pickling support.
+
+ Note that only pickle protocol 2 and onward are supported since we use
+ extended __reduce__ API of PEP 307 to make BytesIO instances picklable.
+
+ Providing support for protocol < 2 would require the __reduce_ex__ method
+ which is notably long-winded when defined properly.
+
+ For BytesIO, the implementation would similar to one coded for
+ object.__reduce_ex__, but slightly less general. To be more specific, we
+ could call bytesio_getstate directly and avoid checking for the presence of
+ a fallback __reduce__ method. However, we would still need a __newobj__
+ function to use the efficient instance representation of PEP 307.
+ */
+
+static PyObject *
+bytesio_getstate(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *initvalue = _io_BytesIO_getvalue_impl(self);
+ PyObject *dict;
+ PyObject *state;
+
+ if (initvalue == NULL)
+ return NULL;
+ if (self->dict == NULL) {
+ dict = Py_NewRef(Py_None);
+ }
+ else {
+ dict = PyDict_Copy(self->dict);
+ if (dict == NULL) {
+ Py_DECREF(initvalue);
+ return NULL;
+ }
+ }
+
+ state = Py_BuildValue("(OnN)", initvalue, self->pos, dict);
+ Py_DECREF(initvalue);
+ return state;
+}
+
+static PyObject *
+bytesio_setstate(bytesio *self, PyObject *state)
+{
+ PyObject *result;
+ PyObject *position_obj;
+ PyObject *dict;
+ Py_ssize_t pos;
+
+ assert(state != NULL);
+
+ /* We allow the state tuple to be longer than 3, because we may need
+ someday to extend the object's state without breaking
+ backward-compatibility. */
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) < 3) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__setstate__ argument should be 3-tuple, got %.200s",
+ Py_TYPE(self)->tp_name, Py_TYPE(state)->tp_name);
+ return NULL;
+ }
+ CHECK_EXPORTS(self);
+ /* Reset the object to its default state. This is only needed to handle
+ the case of repeated calls to __setstate__. */
+ self->string_size = 0;
+ self->pos = 0;
+
+ /* Set the value of the internal buffer. If state[0] does not support the
+ buffer protocol, bytesio_write will raise the appropriate TypeError. */
+ result = _io_BytesIO_write(self, PyTuple_GET_ITEM(state, 0));
+ if (result == NULL)
+ return NULL;
+ Py_DECREF(result);
+
+ /* Set carefully the position value. Alternatively, we could use the seek
+ method instead of modifying self->pos directly to better protect the
+ object internal state against erroneous (or malicious) inputs. */
+ position_obj = PyTuple_GET_ITEM(state, 1);
+ if (!PyLong_Check(position_obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "second item of state must be an integer, not %.200s",
+ Py_TYPE(position_obj)->tp_name);
+ return NULL;
+ }
+ pos = PyLong_AsSsize_t(position_obj);
+ if (pos == -1 && PyErr_Occurred())
+ return NULL;
+ if (pos < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "position value cannot be negative");
+ return NULL;
+ }
+ self->pos = pos;
+
+ /* Set the dictionary of the instance variables. */
+ dict = PyTuple_GET_ITEM(state, 2);
+ if (dict != Py_None) {
+ if (!PyDict_Check(dict)) {
+ PyErr_Format(PyExc_TypeError,
+ "third item of state should be a dict, got a %.200s",
+ Py_TYPE(dict)->tp_name);
+ return NULL;
+ }
+ if (self->dict) {
+ /* Alternatively, we could replace the internal dictionary
+ completely. However, it seems more practical to just update it. */
+ if (PyDict_Update(self->dict, dict) < 0)
+ return NULL;
+ }
+ else {
+ self->dict = Py_NewRef(dict);
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+static void
+bytesio_dealloc(bytesio *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ _PyObject_GC_UNTRACK(self);
+ if (self->exports > 0) {
+ PyErr_SetString(PyExc_SystemError,
+ "deallocated BytesIO object has exported buffers");
+ PyErr_Print();
+ }
+ Py_CLEAR(self->buf);
+ Py_CLEAR(self->dict);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+bytesio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ bytesio *self;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (bytesio *)type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ /* tp_alloc initializes all the fields to zero. So we don't have to
+ initialize them here. */
+
+ self->buf = PyBytes_FromStringAndSize(NULL, 0);
+ if (self->buf == NULL) {
+ Py_DECREF(self);
+ return PyErr_NoMemory();
+ }
+
+ return (PyObject *)self;
+}
+
+/*[clinic input]
+_io.BytesIO.__init__
+ initial_bytes as initvalue: object(c_default="NULL") = b''
+
+Buffered I/O implementation using an in-memory bytes buffer.
+[clinic start generated code]*/
+
+static int
+_io_BytesIO___init___impl(bytesio *self, PyObject *initvalue)
+/*[clinic end generated code: output=65c0c51e24c5b621 input=aac7f31b67bf0fb6]*/
+{
+ /* In case, __init__ is called multiple times. */
+ self->string_size = 0;
+ self->pos = 0;
+
+ if (self->exports > 0) {
+ PyErr_SetString(PyExc_BufferError,
+ "Existing exports of data: object cannot be re-sized");
+ return -1;
+ }
+ if (initvalue && initvalue != Py_None) {
+ if (PyBytes_CheckExact(initvalue)) {
+ Py_XSETREF(self->buf, Py_NewRef(initvalue));
+ self->string_size = PyBytes_GET_SIZE(initvalue);
+ }
+ else {
+ PyObject *res;
+ res = _io_BytesIO_write(self, initvalue);
+ if (res == NULL)
+ return -1;
+ Py_DECREF(res);
+ self->pos = 0;
+ }
+ }
+
+ return 0;
+}
+
+static PyObject *
+bytesio_sizeof(bytesio *self, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->buf && !SHARED_BUF(self)) {
+ size_t s = _PySys_GetSizeOf(self->buf);
+ if (s == (size_t)-1) {
+ return NULL;
+ }
+ res += s;
+ }
+ return PyLong_FromSize_t(res);
+}
+
+static int
+bytesio_traverse(bytesio *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->dict);
+ Py_VISIT(self->buf);
+ return 0;
+}
+
+static int
+bytesio_clear(bytesio *self)
+{
+ Py_CLEAR(self->dict);
+ if (self->exports == 0) {
+ Py_CLEAR(self->buf);
+ }
+ return 0;
+}
+
+
+#define clinic_state() (find_io_state_by_def(Py_TYPE(self)))
+#include "clinic/bytesio.c.h"
+#undef clinic_state
+
+static PyGetSetDef bytesio_getsetlist[] = {
+ {"closed", (getter)bytesio_get_closed, NULL,
+ "True if the file is closed."},
+ {NULL}, /* sentinel */
+};
+
+static struct PyMethodDef bytesio_methods[] = {
+ _IO_BYTESIO_READABLE_METHODDEF
+ _IO_BYTESIO_SEEKABLE_METHODDEF
+ _IO_BYTESIO_WRITABLE_METHODDEF
+ _IO_BYTESIO_CLOSE_METHODDEF
+ _IO_BYTESIO_FLUSH_METHODDEF
+ _IO_BYTESIO_ISATTY_METHODDEF
+ _IO_BYTESIO_TELL_METHODDEF
+ _IO_BYTESIO_WRITE_METHODDEF
+ _IO_BYTESIO_WRITELINES_METHODDEF
+ _IO_BYTESIO_READ1_METHODDEF
+ _IO_BYTESIO_READINTO_METHODDEF
+ _IO_BYTESIO_READLINE_METHODDEF
+ _IO_BYTESIO_READLINES_METHODDEF
+ _IO_BYTESIO_READ_METHODDEF
+ _IO_BYTESIO_GETBUFFER_METHODDEF
+ _IO_BYTESIO_GETVALUE_METHODDEF
+ _IO_BYTESIO_SEEK_METHODDEF
+ _IO_BYTESIO_TRUNCATE_METHODDEF
+ {"__getstate__", (PyCFunction)bytesio_getstate, METH_NOARGS, NULL},
+ {"__setstate__", (PyCFunction)bytesio_setstate, METH_O, NULL},
+ {"__sizeof__", (PyCFunction)bytesio_sizeof, METH_NOARGS, NULL},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyMemberDef bytesio_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(bytesio, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(bytesio, dict), READONLY},
+ {NULL}
+};
+
+static PyType_Slot bytesio_slots[] = {
+ {Py_tp_dealloc, bytesio_dealloc},
+ {Py_tp_doc, (void *)_io_BytesIO___init____doc__},
+ {Py_tp_traverse, bytesio_traverse},
+ {Py_tp_clear, bytesio_clear},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, bytesio_iternext},
+ {Py_tp_methods, bytesio_methods},
+ {Py_tp_members, bytesio_members},
+ {Py_tp_getset, bytesio_getsetlist},
+ {Py_tp_init, _io_BytesIO___init__},
+ {Py_tp_new, bytesio_new},
+ {0, NULL},
+};
+
+PyType_Spec bytesio_spec = {
+ .name = "_io.BytesIO",
+ .basicsize = sizeof(bytesio),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = bytesio_slots,
+};
+
+/*
+ * Implementation of the small intermediate object used by getbuffer().
+ * getbuffer() returns a memoryview over this object, which should make it
+ * invisible from Python code.
+ */
+
+static int
+bytesiobuf_getbuffer(bytesiobuf *obj, Py_buffer *view, int flags)
+{
+ bytesio *b = (bytesio *) obj->source;
+
+ if (view == NULL) {
+ PyErr_SetString(PyExc_BufferError,
+ "bytesiobuf_getbuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ if (b->exports == 0 && SHARED_BUF(b)) {
+ if (unshare_buffer(b, b->string_size) < 0)
+ return -1;
+ }
+
+ /* cannot fail if view != NULL and readonly == 0 */
+ (void)PyBuffer_FillInfo(view, (PyObject*)obj,
+ PyBytes_AS_STRING(b->buf), b->string_size,
+ 0, flags);
+ b->exports++;
+ return 0;
+}
+
+static void
+bytesiobuf_releasebuffer(bytesiobuf *obj, Py_buffer *view)
+{
+ bytesio *b = (bytesio *) obj->source;
+ b->exports--;
+}
+
+static int
+bytesiobuf_traverse(bytesiobuf *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->source);
+ return 0;
+}
+
+static void
+bytesiobuf_dealloc(bytesiobuf *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(self);
+ Py_CLEAR(self->source);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot bytesiobuf_slots[] = {
+ {Py_tp_dealloc, bytesiobuf_dealloc},
+ {Py_tp_traverse, bytesiobuf_traverse},
+
+ // Buffer protocol
+ {Py_bf_getbuffer, bytesiobuf_getbuffer},
+ {Py_bf_releasebuffer, bytesiobuf_releasebuffer},
+ {0, NULL},
+};
+
+PyType_Spec bytesiobuf_spec = {
+ .name = "_io._BytesIOBuffer",
+ .basicsize = sizeof(bytesiobuf),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = bytesiobuf_slots,
+};
diff --git a/contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h b/contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h
new file mode 100644
index 00000000000..4d76e333b0f
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/_iomodule.c.h
@@ -0,0 +1,410 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io_open__doc__,
+"open($module, /, file, mode=\'r\', buffering=-1, encoding=None,\n"
+" errors=None, newline=None, closefd=True, opener=None)\n"
+"--\n"
+"\n"
+"Open file and return a stream. Raise OSError upon failure.\n"
+"\n"
+"file is either a text or byte string giving the name (and the path\n"
+"if the file isn\'t in the current working directory) of the file to\n"
+"be opened or an integer file descriptor of the file to be\n"
+"wrapped. (If a file descriptor is given, it is closed when the\n"
+"returned I/O object is closed, unless closefd is set to False.)\n"
+"\n"
+"mode is an optional string that specifies the mode in which the file\n"
+"is opened. It defaults to \'r\' which means open for reading in text\n"
+"mode. Other common values are \'w\' for writing (truncating the file if\n"
+"it already exists), \'x\' for creating and writing to a new file, and\n"
+"\'a\' for appending (which on some Unix systems, means that all writes\n"
+"append to the end of the file regardless of the current seek position).\n"
+"In text mode, if encoding is not specified the encoding used is platform\n"
+"dependent: locale.getencoding() is called to get the current locale encoding.\n"
+"(For reading and writing raw bytes use binary mode and leave encoding\n"
+"unspecified.) The available modes are:\n"
+"\n"
+"========= ===============================================================\n"
+"Character Meaning\n"
+"--------- ---------------------------------------------------------------\n"
+"\'r\' open for reading (default)\n"
+"\'w\' open for writing, truncating the file first\n"
+"\'x\' create a new file and open it for writing\n"
+"\'a\' open for writing, appending to the end of the file if it exists\n"
+"\'b\' binary mode\n"
+"\'t\' text mode (default)\n"
+"\'+\' open a disk file for updating (reading and writing)\n"
+"========= ===============================================================\n"
+"\n"
+"The default mode is \'rt\' (open for reading text). For binary random\n"
+"access, the mode \'w+b\' opens and truncates the file to 0 bytes, while\n"
+"\'r+b\' opens the file without truncation. The \'x\' mode implies \'w\' and\n"
+"raises an `FileExistsError` if the file already exists.\n"
+"\n"
+"Python distinguishes between files opened in binary and text modes,\n"
+"even when the underlying operating system doesn\'t. Files opened in\n"
+"binary mode (appending \'b\' to the mode argument) return contents as\n"
+"bytes objects without any decoding. In text mode (the default, or when\n"
+"\'t\' is appended to the mode argument), the contents of the file are\n"
+"returned as strings, the bytes having been first decoded using a\n"
+"platform-dependent encoding or using the specified encoding if given.\n"
+"\n"
+"buffering is an optional integer used to set the buffering policy.\n"
+"Pass 0 to switch buffering off (only allowed in binary mode), 1 to select\n"
+"line buffering (only usable in text mode), and an integer > 1 to indicate\n"
+"the size of a fixed-size chunk buffer. When no buffering argument is\n"
+"given, the default buffering policy works as follows:\n"
+"\n"
+"* Binary files are buffered in fixed-size chunks; the size of the buffer\n"
+" is chosen using a heuristic trying to determine the underlying device\'s\n"
+" \"block size\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\n"
+" On many systems, the buffer will typically be 4096 or 8192 bytes long.\n"
+"\n"
+"* \"Interactive\" text files (files for which isatty() returns True)\n"
+" use line buffering. Other text files use the policy described above\n"
+" for binary files.\n"
+"\n"
+"encoding is the name of the encoding used to decode or encode the\n"
+"file. This should only be used in text mode. The default encoding is\n"
+"platform dependent, but any encoding supported by Python can be\n"
+"passed. See the codecs module for the list of supported encodings.\n"
+"\n"
+"errors is an optional string that specifies how encoding errors are to\n"
+"be handled---this argument should not be used in binary mode. Pass\n"
+"\'strict\' to raise a ValueError exception if there is an encoding error\n"
+"(the default of None has the same effect), or pass \'ignore\' to ignore\n"
+"errors. (Note that ignoring encoding errors can lead to data loss.)\n"
+"See the documentation for codecs.register or run \'help(codecs.Codec)\'\n"
+"for a list of the permitted encoding error strings.\n"
+"\n"
+"newline controls how universal newlines works (it only applies to text\n"
+"mode). It can be None, \'\', \'\\n\', \'\\r\', and \'\\r\\n\'. It works as\n"
+"follows:\n"
+"\n"
+"* On input, if newline is None, universal newlines mode is\n"
+" enabled. Lines in the input can end in \'\\n\', \'\\r\', or \'\\r\\n\', and\n"
+" these are translated into \'\\n\' before being returned to the\n"
+" caller. If it is \'\', universal newline mode is enabled, but line\n"
+" endings are returned to the caller untranslated. If it has any of\n"
+" the other legal values, input lines are only terminated by the given\n"
+" string, and the line ending is returned to the caller untranslated.\n"
+"\n"
+"* On output, if newline is None, any \'\\n\' characters written are\n"
+" translated to the system default line separator, os.linesep. If\n"
+" newline is \'\' or \'\\n\', no translation takes place. If newline is any\n"
+" of the other legal values, any \'\\n\' characters written are translated\n"
+" to the given string.\n"
+"\n"
+"If closefd is False, the underlying file descriptor will be kept open\n"
+"when the file is closed. This does not work when a file name is given\n"
+"and must be True in that case.\n"
+"\n"
+"A custom opener can be used by passing a callable as *opener*. The\n"
+"underlying file descriptor for the file object is then obtained by\n"
+"calling *opener* with (*file*, *flags*). *opener* must return an open\n"
+"file descriptor (passing os.open as *opener* results in functionality\n"
+"similar to passing None).\n"
+"\n"
+"open() returns a file object whose type depends on the mode, and\n"
+"through which the standard file operations such as reading and writing\n"
+"are performed. When open() is used to open a file in a text mode (\'w\',\n"
+"\'r\', \'wt\', \'rt\', etc.), it returns a TextIOWrapper. When used to open\n"
+"a file in a binary mode, the returned class varies: in read binary\n"
+"mode, it returns a BufferedReader; in write binary and append binary\n"
+"modes, it returns a BufferedWriter, and in read/write mode, it returns\n"
+"a BufferedRandom.\n"
+"\n"
+"It is also possible to use a string or bytearray as a file for both\n"
+"reading and writing. For strings StringIO can be used like a file\n"
+"opened in a text mode, and for bytes a BytesIO can be used like a file\n"
+"opened in a binary mode.");
+
+#define _IO_OPEN_METHODDEF \
+ {"open", _PyCFunction_CAST(_io_open), METH_FASTCALL|METH_KEYWORDS, _io_open__doc__},
+
+static PyObject *
+_io_open_impl(PyObject *module, PyObject *file, const char *mode,
+ int buffering, const char *encoding, const char *errors,
+ const char *newline, int closefd, PyObject *opener);
+
+static PyObject *
+_io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 8
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file), &_Py_ID(mode), &_Py_ID(buffering), &_Py_ID(encoding), &_Py_ID(errors), &_Py_ID(newline), &_Py_ID(closefd), &_Py_ID(opener), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "open",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[8];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *file;
+ const char *mode = "r";
+ int buffering = -1;
+ const char *encoding = NULL;
+ const char *errors = NULL;
+ const char *newline = NULL;
+ int closefd = 1;
+ PyObject *opener = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 8, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ file = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("open", "argument 'mode'", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t mode_length;
+ mode = PyUnicode_AsUTF8AndSize(args[1], &mode_length);
+ if (mode == NULL) {
+ goto exit;
+ }
+ if (strlen(mode) != (size_t)mode_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[2]) {
+ buffering = _PyLong_AsInt(args[2]);
+ if (buffering == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ if (args[3] == Py_None) {
+ encoding = NULL;
+ }
+ else if (PyUnicode_Check(args[3])) {
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[3], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("open", "argument 'encoding'", "str or None", args[3]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[4]) {
+ if (args[4] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[4])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[4], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("open", "argument 'errors'", "str or None", args[4]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[5]) {
+ if (args[5] == Py_None) {
+ newline = NULL;
+ }
+ else if (PyUnicode_Check(args[5])) {
+ Py_ssize_t newline_length;
+ newline = PyUnicode_AsUTF8AndSize(args[5], &newline_length);
+ if (newline == NULL) {
+ goto exit;
+ }
+ if (strlen(newline) != (size_t)newline_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("open", "argument 'newline'", "str or None", args[5]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[6]) {
+ closefd = PyObject_IsTrue(args[6]);
+ if (closefd < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ opener = args[7];
+skip_optional_pos:
+ return_value = _io_open_impl(module, file, mode, buffering, encoding, errors, newline, closefd, opener);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_text_encoding__doc__,
+"text_encoding($module, encoding, stacklevel=2, /)\n"
+"--\n"
+"\n"
+"A helper function to choose the text encoding.\n"
+"\n"
+"When encoding is not None, this function returns it.\n"
+"Otherwise, this function returns the default text encoding\n"
+"(i.e. \"locale\" or \"utf-8\" depends on UTF-8 mode).\n"
+"\n"
+"This function emits an EncodingWarning if encoding is None and\n"
+"sys.flags.warn_default_encoding is true.\n"
+"\n"
+"This can be used in APIs with an encoding=None parameter.\n"
+"However, please consider using encoding=\"utf-8\" for new APIs.");
+
+#define _IO_TEXT_ENCODING_METHODDEF \
+ {"text_encoding", _PyCFunction_CAST(_io_text_encoding), METH_FASTCALL, _io_text_encoding__doc__},
+
+static PyObject *
+_io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel);
+
+static PyObject *
+_io_text_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *encoding;
+ int stacklevel = 2;
+
+ if (!_PyArg_CheckPositional("text_encoding", nargs, 1, 2)) {
+ goto exit;
+ }
+ encoding = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ stacklevel = _PyLong_AsInt(args[1]);
+ if (stacklevel == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_text_encoding_impl(module, encoding, stacklevel);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_open_code__doc__,
+"open_code($module, /, path)\n"
+"--\n"
+"\n"
+"Opens the provided file with the intent to import the contents.\n"
+"\n"
+"This may perform extra validation beyond open(), but is otherwise interchangeable\n"
+"with calling open(path, \'rb\').");
+
+#define _IO_OPEN_CODE_METHODDEF \
+ {"open_code", _PyCFunction_CAST(_io_open_code), METH_FASTCALL|METH_KEYWORDS, _io_open_code__doc__},
+
+static PyObject *
+_io_open_code_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+_io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "open_code",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("open_code", "argument 'path'", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = _io_open_code_impl(module, path);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=f387eba3f4c0254a input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h b/contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h
new file mode 100644
index 00000000000..3becf4a5e3b
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/bufferedio.c.h
@@ -0,0 +1,1101 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__,
+"readinto($self, buffer, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFEREDIOBASE_READINTO_METHODDEF \
+ {"readinto", (PyCFunction)_io__BufferedIOBase_readinto, METH_O, _io__BufferedIOBase_readinto__doc__},
+
+static PyObject *
+_io__BufferedIOBase_readinto_impl(PyObject *self, Py_buffer *buffer);
+
+static PyObject *
+_io__BufferedIOBase_readinto(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _io__BufferedIOBase_readinto_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__BufferedIOBase_readinto1__doc__,
+"readinto1($self, buffer, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFEREDIOBASE_READINTO1_METHODDEF \
+ {"readinto1", (PyCFunction)_io__BufferedIOBase_readinto1, METH_O, _io__BufferedIOBase_readinto1__doc__},
+
+static PyObject *
+_io__BufferedIOBase_readinto1_impl(PyObject *self, Py_buffer *buffer);
+
+static PyObject *
+_io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__BufferedIOBase_detach__doc__,
+"detach($self, /)\n"
+"--\n"
+"\n"
+"Disconnect this buffer from its underlying raw stream and return it.\n"
+"\n"
+"After the raw stream has been detached, the buffer is in an unusable\n"
+"state.");
+
+#define _IO__BUFFEREDIOBASE_DETACH_METHODDEF \
+ {"detach", _PyCFunction_CAST(_io__BufferedIOBase_detach), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__BufferedIOBase_detach__doc__},
+
+static PyObject *
+_io__BufferedIOBase_detach_impl(PyObject *self, PyTypeObject *cls);
+
+static PyObject *
+_io__BufferedIOBase_detach(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "detach() takes no arguments");
+ return NULL;
+ }
+ return _io__BufferedIOBase_detach_impl(self, cls);
+}
+
+PyDoc_STRVAR(_io__BufferedIOBase_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read and return up to n bytes.\n"
+"\n"
+"If the size argument is omitted, None, or negative, read and\n"
+"return all data until EOF.\n"
+"\n"
+"If the size argument is positive, and the underlying raw stream is\n"
+"not \'interactive\', multiple raw reads may be issued to satisfy\n"
+"the byte count (unless EOF is reached first).\n"
+"However, for interactive raw streams (as well as sockets and pipes),\n"
+"at most one raw read will be issued, and a short result does not\n"
+"imply that EOF is imminent.\n"
+"\n"
+"Return an empty bytes object on EOF.\n"
+"\n"
+"Return None if the underlying raw stream was open in non-blocking\n"
+"mode and no data is available at the moment.");
+
+#define _IO__BUFFEREDIOBASE_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io__BufferedIOBase_read), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__BufferedIOBase_read__doc__},
+
+static PyObject *
+_io__BufferedIOBase_read_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size));
+
+static PyObject *
+_io__BufferedIOBase_read(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "read",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int size = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ size = _PyLong_AsInt(args[0]);
+ if (size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io__BufferedIOBase_read_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__BufferedIOBase_read1__doc__,
+"read1($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read and return up to size bytes, with at most one read() call to the underlying raw stream.\n"
+"\n"
+"Return an empty bytes object on EOF.\n"
+"A short result does not imply that EOF is imminent.");
+
+#define _IO__BUFFEREDIOBASE_READ1_METHODDEF \
+ {"read1", _PyCFunction_CAST(_io__BufferedIOBase_read1), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__BufferedIOBase_read1__doc__},
+
+static PyObject *
+_io__BufferedIOBase_read1_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size));
+
+static PyObject *
+_io__BufferedIOBase_read1(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "read1",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int size = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ size = _PyLong_AsInt(args[0]);
+ if (size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io__BufferedIOBase_read1_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__BufferedIOBase_write__doc__,
+"write($self, b, /)\n"
+"--\n"
+"\n"
+"Write buffer b to the IO stream.\n"
+"\n"
+"Return the number of bytes written, which is always\n"
+"the length of b in bytes.\n"
+"\n"
+"Raise BlockingIOError if the buffer is full and the\n"
+"underlying raw stream cannot accept more data at the moment.");
+
+#define _IO__BUFFEREDIOBASE_WRITE_METHODDEF \
+ {"write", _PyCFunction_CAST(_io__BufferedIOBase_write), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__BufferedIOBase_write__doc__},
+
+static PyObject *
+_io__BufferedIOBase_write_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *Py_UNUSED(b));
+
+static PyObject *
+_io__BufferedIOBase_write(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "write",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *b;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ b = args[0];
+ return_value = _io__BufferedIOBase_write_impl(self, cls, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED___SIZEOF___METHODDEF \
+ {"__sizeof__", (PyCFunction)_io__Buffered___sizeof__, METH_NOARGS, _io__Buffered___sizeof____doc__},
+
+static PyObject *
+_io__Buffered___sizeof___impl(buffered *self);
+
+static PyObject *
+_io__Buffered___sizeof__(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered___sizeof___impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered__dealloc_warn__doc__,
+"_dealloc_warn($self, source, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED__DEALLOC_WARN_METHODDEF \
+ {"_dealloc_warn", (PyCFunction)_io__Buffered__dealloc_warn, METH_O, _io__Buffered__dealloc_warn__doc__},
+
+PyDoc_STRVAR(_io__Buffered_simple_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_SIMPLE_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_io__Buffered_simple_flush, METH_NOARGS, _io__Buffered_simple_flush__doc__},
+
+static PyObject *
+_io__Buffered_simple_flush_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_simple_flush(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_simple_flush_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_io__Buffered_close, METH_NOARGS, _io__Buffered_close__doc__},
+
+static PyObject *
+_io__Buffered_close_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_close(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_close_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_detach__doc__,
+"detach($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_DETACH_METHODDEF \
+ {"detach", (PyCFunction)_io__Buffered_detach, METH_NOARGS, _io__Buffered_detach__doc__},
+
+static PyObject *
+_io__Buffered_detach_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_detach(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_detach_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_seekable__doc__,
+"seekable($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_SEEKABLE_METHODDEF \
+ {"seekable", (PyCFunction)_io__Buffered_seekable, METH_NOARGS, _io__Buffered_seekable__doc__},
+
+static PyObject *
+_io__Buffered_seekable_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_seekable(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_seekable_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io__Buffered_readable, METH_NOARGS, _io__Buffered_readable__doc__},
+
+static PyObject *
+_io__Buffered_readable_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_readable(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_readable_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io__Buffered_writable, METH_NOARGS, _io__Buffered_writable__doc__},
+
+static PyObject *
+_io__Buffered_writable_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_writable(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_writable_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)_io__Buffered_fileno, METH_NOARGS, _io__Buffered_fileno__doc__},
+
+static PyObject *
+_io__Buffered_fileno_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_fileno(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_fileno_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_isatty__doc__,
+"isatty($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)_io__Buffered_isatty, METH_NOARGS, _io__Buffered_isatty__doc__},
+
+static PyObject *
+_io__Buffered_isatty_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_isatty(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_isatty_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_io__Buffered_flush, METH_NOARGS, _io__Buffered_flush__doc__},
+
+static PyObject *
+_io__Buffered_flush_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_flush(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_flush_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_peek__doc__,
+"peek($self, size=0, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_PEEK_METHODDEF \
+ {"peek", _PyCFunction_CAST(_io__Buffered_peek), METH_FASTCALL, _io__Buffered_peek__doc__},
+
+static PyObject *
+_io__Buffered_peek_impl(buffered *self, Py_ssize_t size);
+
+static PyObject *
+_io__Buffered_peek(buffered *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = 0;
+
+ if (!_PyArg_CheckPositional("peek", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ size = ival;
+ }
+skip_optional:
+ return_value = _io__Buffered_peek_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io__Buffered_read), METH_FASTCALL, _io__Buffered_read__doc__},
+
+static PyObject *
+_io__Buffered_read_impl(buffered *self, Py_ssize_t n);
+
+static PyObject *
+_io__Buffered_read(buffered *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t n = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &n)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io__Buffered_read_impl(self, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_read1__doc__,
+"read1($self, size=-1, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_READ1_METHODDEF \
+ {"read1", _PyCFunction_CAST(_io__Buffered_read1), METH_FASTCALL, _io__Buffered_read1__doc__},
+
+static PyObject *
+_io__Buffered_read1_impl(buffered *self, Py_ssize_t n);
+
+static PyObject *
+_io__Buffered_read1(buffered *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t n = -1;
+
+ if (!_PyArg_CheckPositional("read1", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ n = ival;
+ }
+skip_optional:
+ return_value = _io__Buffered_read1_impl(self, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_readinto__doc__,
+"readinto($self, buffer, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_READINTO_METHODDEF \
+ {"readinto", (PyCFunction)_io__Buffered_readinto, METH_O, _io__Buffered_readinto__doc__},
+
+static PyObject *
+_io__Buffered_readinto_impl(buffered *self, Py_buffer *buffer);
+
+static PyObject *
+_io__Buffered_readinto(buffered *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _io__Buffered_readinto_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_readinto1__doc__,
+"readinto1($self, buffer, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_READINTO1_METHODDEF \
+ {"readinto1", (PyCFunction)_io__Buffered_readinto1, METH_O, _io__Buffered_readinto1__doc__},
+
+static PyObject *
+_io__Buffered_readinto1_impl(buffered *self, Py_buffer *buffer);
+
+static PyObject *
+_io__Buffered_readinto1(buffered *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _io__Buffered_readinto1_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_readline__doc__,
+"readline($self, size=-1, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_io__Buffered_readline), METH_FASTCALL, _io__Buffered_readline__doc__},
+
+static PyObject *
+_io__Buffered_readline_impl(buffered *self, Py_ssize_t size);
+
+static PyObject *
+_io__Buffered_readline(buffered *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io__Buffered_readline_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_TELL_METHODDEF \
+ {"tell", (PyCFunction)_io__Buffered_tell, METH_NOARGS, _io__Buffered_tell__doc__},
+
+static PyObject *
+_io__Buffered_tell_impl(buffered *self);
+
+static PyObject *
+_io__Buffered_tell(buffered *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__Buffered_tell_impl(self);
+}
+
+PyDoc_STRVAR(_io__Buffered_seek__doc__,
+"seek($self, target, whence=0, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(_io__Buffered_seek), METH_FASTCALL, _io__Buffered_seek__doc__},
+
+static PyObject *
+_io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence);
+
+static PyObject *
+_io__Buffered_seek(buffered *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *targetobj;
+ int whence = 0;
+
+ if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
+ goto exit;
+ }
+ targetobj = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ whence = _PyLong_AsInt(args[1]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io__Buffered_seek_impl(self, targetobj, whence);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__Buffered_truncate__doc__,
+"truncate($self, pos=None, /)\n"
+"--\n"
+"\n");
+
+#define _IO__BUFFERED_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(_io__Buffered_truncate), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__Buffered_truncate__doc__},
+
+static PyObject *
+_io__Buffered_truncate_impl(buffered *self, PyTypeObject *cls, PyObject *pos);
+
+static PyObject *
+_io__Buffered_truncate(buffered *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "truncate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *pos = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ pos = args[0];
+skip_optional_posonly:
+ return_value = _io__Buffered_truncate_impl(self, cls, pos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BufferedReader___init____doc__,
+"BufferedReader(raw, buffer_size=DEFAULT_BUFFER_SIZE)\n"
+"--\n"
+"\n"
+"Create a new buffered reader using the given readable raw IO object.");
+
+static int
+_io_BufferedReader___init___impl(buffered *self, PyObject *raw,
+ Py_ssize_t buffer_size);
+
+static int
+_io_BufferedReader___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(raw), &_Py_ID(buffer_size), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"raw", "buffer_size", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "BufferedReader",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *raw;
+ Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ raw = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(fastargs[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffer_size = ival;
+ }
+skip_optional_pos:
+ return_value = _io_BufferedReader___init___impl((buffered *)self, raw, buffer_size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BufferedWriter___init____doc__,
+"BufferedWriter(raw, buffer_size=DEFAULT_BUFFER_SIZE)\n"
+"--\n"
+"\n"
+"A buffer for a writeable sequential RawIO object.\n"
+"\n"
+"The constructor creates a BufferedWriter for the given writeable raw\n"
+"stream. If the buffer_size is not given, it defaults to\n"
+"DEFAULT_BUFFER_SIZE.");
+
+static int
+_io_BufferedWriter___init___impl(buffered *self, PyObject *raw,
+ Py_ssize_t buffer_size);
+
+static int
+_io_BufferedWriter___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(raw), &_Py_ID(buffer_size), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"raw", "buffer_size", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "BufferedWriter",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *raw;
+ Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ raw = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(fastargs[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffer_size = ival;
+ }
+skip_optional_pos:
+ return_value = _io_BufferedWriter___init___impl((buffered *)self, raw, buffer_size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BufferedWriter_write__doc__,
+"write($self, buffer, /)\n"
+"--\n"
+"\n");
+
+#define _IO_BUFFEREDWRITER_WRITE_METHODDEF \
+ {"write", (PyCFunction)_io_BufferedWriter_write, METH_O, _io_BufferedWriter_write__doc__},
+
+static PyObject *
+_io_BufferedWriter_write_impl(buffered *self, Py_buffer *buffer);
+
+static PyObject *
+_io_BufferedWriter_write(buffered *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _io_BufferedWriter_write_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BufferedRWPair___init____doc__,
+"BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE, /)\n"
+"--\n"
+"\n"
+"A buffered reader and writer object together.\n"
+"\n"
+"A buffered reader object and buffered writer object put together to\n"
+"form a sequential IO object that can read and write. This is typically\n"
+"used with a socket or two-way pipe.\n"
+"\n"
+"reader and writer are RawIOBase objects that are readable and\n"
+"writeable respectively. If the buffer_size is omitted it defaults to\n"
+"DEFAULT_BUFFER_SIZE.");
+
+static int
+_io_BufferedRWPair___init___impl(rwpair *self, PyObject *reader,
+ PyObject *writer, Py_ssize_t buffer_size);
+
+static int
+_io_BufferedRWPair___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ PyTypeObject *base_tp = clinic_state()->PyBufferedRWPair_Type;
+ PyObject *reader;
+ PyObject *writer;
+ Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE;
+
+ if ((Py_IS_TYPE(self, base_tp) ||
+ Py_TYPE(self)->tp_new == base_tp->tp_new) &&
+ !_PyArg_NoKeywords("BufferedRWPair", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("BufferedRWPair", PyTuple_GET_SIZE(args), 2, 3)) {
+ goto exit;
+ }
+ reader = PyTuple_GET_ITEM(args, 0);
+ writer = PyTuple_GET_ITEM(args, 1);
+ if (PyTuple_GET_SIZE(args) < 3) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(PyTuple_GET_ITEM(args, 2));
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffer_size = ival;
+ }
+skip_optional:
+ return_value = _io_BufferedRWPair___init___impl((rwpair *)self, reader, writer, buffer_size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BufferedRandom___init____doc__,
+"BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE)\n"
+"--\n"
+"\n"
+"A buffered interface to random access streams.\n"
+"\n"
+"The constructor creates a reader and writer for a seekable stream,\n"
+"raw, given in the first argument. If the buffer_size is omitted it\n"
+"defaults to DEFAULT_BUFFER_SIZE.");
+
+static int
+_io_BufferedRandom___init___impl(buffered *self, PyObject *raw,
+ Py_ssize_t buffer_size);
+
+static int
+_io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(raw), &_Py_ID(buffer_size), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"raw", "buffer_size", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "BufferedRandom",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *raw;
+ Py_ssize_t buffer_size = DEFAULT_BUFFER_SIZE;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ raw = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(fastargs[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffer_size = ival;
+ }
+skip_optional_pos:
+ return_value = _io_BufferedRandom___init___impl((buffered *)self, raw, buffer_size);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=e51a6ca8bc8ed33d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/bytesio.c.h b/contrib/tools/python3/Modules/_io/clinic/bytesio.c.h
new file mode 100644
index 00000000000..c816ef5d6bb
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/bytesio.c.h
@@ -0,0 +1,541 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io_BytesIO_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n"
+"Returns True if the IO object can be read.");
+
+#define _IO_BYTESIO_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io_BytesIO_readable, METH_NOARGS, _io_BytesIO_readable__doc__},
+
+static PyObject *
+_io_BytesIO_readable_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_readable(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_readable_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n"
+"Returns True if the IO object can be written.");
+
+#define _IO_BYTESIO_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io_BytesIO_writable, METH_NOARGS, _io_BytesIO_writable__doc__},
+
+static PyObject *
+_io_BytesIO_writable_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_writable(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_writable_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_seekable__doc__,
+"seekable($self, /)\n"
+"--\n"
+"\n"
+"Returns True if the IO object can be seeked.");
+
+#define _IO_BYTESIO_SEEKABLE_METHODDEF \
+ {"seekable", (PyCFunction)_io_BytesIO_seekable, METH_NOARGS, _io_BytesIO_seekable__doc__},
+
+static PyObject *
+_io_BytesIO_seekable_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_seekable(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_seekable_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n"
+"Does nothing.");
+
+#define _IO_BYTESIO_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_io_BytesIO_flush, METH_NOARGS, _io_BytesIO_flush__doc__},
+
+static PyObject *
+_io_BytesIO_flush_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_flush(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_flush_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_getbuffer__doc__,
+"getbuffer($self, /)\n"
+"--\n"
+"\n"
+"Get a read-write view over the contents of the BytesIO object.");
+
+#define _IO_BYTESIO_GETBUFFER_METHODDEF \
+ {"getbuffer", _PyCFunction_CAST(_io_BytesIO_getbuffer), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io_BytesIO_getbuffer__doc__},
+
+static PyObject *
+_io_BytesIO_getbuffer_impl(bytesio *self, PyTypeObject *cls);
+
+static PyObject *
+_io_BytesIO_getbuffer(bytesio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "getbuffer() takes no arguments");
+ return NULL;
+ }
+ return _io_BytesIO_getbuffer_impl(self, cls);
+}
+
+PyDoc_STRVAR(_io_BytesIO_getvalue__doc__,
+"getvalue($self, /)\n"
+"--\n"
+"\n"
+"Retrieve the entire contents of the BytesIO object.");
+
+#define _IO_BYTESIO_GETVALUE_METHODDEF \
+ {"getvalue", (PyCFunction)_io_BytesIO_getvalue, METH_NOARGS, _io_BytesIO_getvalue__doc__},
+
+static PyObject *
+_io_BytesIO_getvalue_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_getvalue(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_getvalue_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_isatty__doc__,
+"isatty($self, /)\n"
+"--\n"
+"\n"
+"Always returns False.\n"
+"\n"
+"BytesIO objects are not connected to a TTY-like device.");
+
+#define _IO_BYTESIO_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)_io_BytesIO_isatty, METH_NOARGS, _io_BytesIO_isatty__doc__},
+
+static PyObject *
+_io_BytesIO_isatty_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_isatty(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_isatty_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n"
+"Current file position, an integer.");
+
+#define _IO_BYTESIO_TELL_METHODDEF \
+ {"tell", (PyCFunction)_io_BytesIO_tell, METH_NOARGS, _io_BytesIO_tell__doc__},
+
+static PyObject *
+_io_BytesIO_tell_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_tell(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_tell_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read at most size bytes, returned as a bytes object.\n"
+"\n"
+"If the size argument is negative, read until EOF is reached.\n"
+"Return an empty bytes object at EOF.");
+
+#define _IO_BYTESIO_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io_BytesIO_read), METH_FASTCALL, _io_BytesIO_read__doc__},
+
+static PyObject *
+_io_BytesIO_read_impl(bytesio *self, Py_ssize_t size);
+
+static PyObject *
+_io_BytesIO_read(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_BytesIO_read_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_read1__doc__,
+"read1($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read at most size bytes, returned as a bytes object.\n"
+"\n"
+"If the size argument is negative or omitted, read until EOF is reached.\n"
+"Return an empty bytes object at EOF.");
+
+#define _IO_BYTESIO_READ1_METHODDEF \
+ {"read1", _PyCFunction_CAST(_io_BytesIO_read1), METH_FASTCALL, _io_BytesIO_read1__doc__},
+
+static PyObject *
+_io_BytesIO_read1_impl(bytesio *self, Py_ssize_t size);
+
+static PyObject *
+_io_BytesIO_read1(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("read1", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_BytesIO_read1_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_readline__doc__,
+"readline($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Next line from the file, as a bytes object.\n"
+"\n"
+"Retain newline. A non-negative size argument limits the maximum\n"
+"number of bytes to return (an incomplete line may be returned then).\n"
+"Return an empty bytes object at EOF.");
+
+#define _IO_BYTESIO_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_io_BytesIO_readline), METH_FASTCALL, _io_BytesIO_readline__doc__},
+
+static PyObject *
+_io_BytesIO_readline_impl(bytesio *self, Py_ssize_t size);
+
+static PyObject *
+_io_BytesIO_readline(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_BytesIO_readline_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_readlines__doc__,
+"readlines($self, size=None, /)\n"
+"--\n"
+"\n"
+"List of bytes objects, each a line from the file.\n"
+"\n"
+"Call readline() repeatedly and return a list of the lines so read.\n"
+"The optional size argument, if given, is an approximate bound on the\n"
+"total number of bytes in the lines returned.");
+
+#define _IO_BYTESIO_READLINES_METHODDEF \
+ {"readlines", _PyCFunction_CAST(_io_BytesIO_readlines), METH_FASTCALL, _io_BytesIO_readlines__doc__},
+
+static PyObject *
+_io_BytesIO_readlines_impl(bytesio *self, PyObject *arg);
+
+static PyObject *
+_io_BytesIO_readlines(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *arg = Py_None;
+
+ if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ arg = args[0];
+skip_optional:
+ return_value = _io_BytesIO_readlines_impl(self, arg);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_readinto__doc__,
+"readinto($self, buffer, /)\n"
+"--\n"
+"\n"
+"Read bytes into buffer.\n"
+"\n"
+"Returns number of bytes read (0 for EOF), or None if the object\n"
+"is set not to block and has no data to read.");
+
+#define _IO_BYTESIO_READINTO_METHODDEF \
+ {"readinto", (PyCFunction)_io_BytesIO_readinto, METH_O, _io_BytesIO_readinto__doc__},
+
+static PyObject *
+_io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer);
+
+static PyObject *
+_io_BytesIO_readinto(bytesio *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _io_BytesIO_readinto_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_truncate__doc__,
+"truncate($self, size=None, /)\n"
+"--\n"
+"\n"
+"Truncate the file to at most size bytes.\n"
+"\n"
+"Size defaults to the current file position, as returned by tell().\n"
+"The current file position is unchanged. Returns the new size.");
+
+#define _IO_BYTESIO_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(_io_BytesIO_truncate), METH_FASTCALL, _io_BytesIO_truncate__doc__},
+
+static PyObject *
+_io_BytesIO_truncate_impl(bytesio *self, Py_ssize_t size);
+
+static PyObject *
+_io_BytesIO_truncate(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = self->pos;
+
+ if (!_PyArg_CheckPositional("truncate", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_BytesIO_truncate_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_seek__doc__,
+"seek($self, pos, whence=0, /)\n"
+"--\n"
+"\n"
+"Change stream position.\n"
+"\n"
+"Seek to byte offset pos relative to position indicated by whence:\n"
+" 0 Start of stream (the default). pos should be >= 0;\n"
+" 1 Current position - pos may be negative;\n"
+" 2 End of stream - pos usually negative.\n"
+"Returns the new absolute position.");
+
+#define _IO_BYTESIO_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(_io_BytesIO_seek), METH_FASTCALL, _io_BytesIO_seek__doc__},
+
+static PyObject *
+_io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence);
+
+static PyObject *
+_io_BytesIO_seek(bytesio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t pos;
+ int whence = 0;
+
+ if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ whence = _PyLong_AsInt(args[1]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_BytesIO_seek_impl(self, pos, whence);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_BytesIO_write__doc__,
+"write($self, b, /)\n"
+"--\n"
+"\n"
+"Write bytes to file.\n"
+"\n"
+"Return the number of bytes written.");
+
+#define _IO_BYTESIO_WRITE_METHODDEF \
+ {"write", (PyCFunction)_io_BytesIO_write, METH_O, _io_BytesIO_write__doc__},
+
+PyDoc_STRVAR(_io_BytesIO_writelines__doc__,
+"writelines($self, lines, /)\n"
+"--\n"
+"\n"
+"Write lines to the file.\n"
+"\n"
+"Note that newlines are not added. lines can be any iterable object\n"
+"producing bytes-like objects. This is equivalent to calling write() for\n"
+"each element.");
+
+#define _IO_BYTESIO_WRITELINES_METHODDEF \
+ {"writelines", (PyCFunction)_io_BytesIO_writelines, METH_O, _io_BytesIO_writelines__doc__},
+
+PyDoc_STRVAR(_io_BytesIO_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Disable all I/O operations.");
+
+#define _IO_BYTESIO_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_io_BytesIO_close, METH_NOARGS, _io_BytesIO_close__doc__},
+
+static PyObject *
+_io_BytesIO_close_impl(bytesio *self);
+
+static PyObject *
+_io_BytesIO_close(bytesio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_BytesIO_close_impl(self);
+}
+
+PyDoc_STRVAR(_io_BytesIO___init____doc__,
+"BytesIO(initial_bytes=b\'\')\n"
+"--\n"
+"\n"
+"Buffered I/O implementation using an in-memory bytes buffer.");
+
+static int
+_io_BytesIO___init___impl(bytesio *self, PyObject *initvalue);
+
+static int
+_io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(initial_bytes), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"initial_bytes", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "BytesIO",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *initvalue = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ initvalue = fastargs[0];
+skip_optional_pos:
+ return_value = _io_BytesIO___init___impl((bytesio *)self, initvalue);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=1c540b54a10919d7 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/fileio.c.h b/contrib/tools/python3/Modules/_io/clinic/fileio.c.h
new file mode 100644
index 00000000000..0d94e6cec69
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/fileio.c.h
@@ -0,0 +1,539 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io_FileIO_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the file.\n"
+"\n"
+"A closed file cannot be used for further I/O operations. close() may be\n"
+"called more than once without error.");
+
+#define _IO_FILEIO_CLOSE_METHODDEF \
+ {"close", _PyCFunction_CAST(_io_FileIO_close), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io_FileIO_close__doc__},
+
+static PyObject *
+_io_FileIO_close_impl(fileio *self, PyTypeObject *cls);
+
+static PyObject *
+_io_FileIO_close(fileio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "close() takes no arguments");
+ return NULL;
+ }
+ return _io_FileIO_close_impl(self, cls);
+}
+
+PyDoc_STRVAR(_io_FileIO___init____doc__,
+"FileIO(file, mode=\'r\', closefd=True, opener=None)\n"
+"--\n"
+"\n"
+"Open a file.\n"
+"\n"
+"The mode can be \'r\' (default), \'w\', \'x\' or \'a\' for reading,\n"
+"writing, exclusive creation or appending. The file will be created if it\n"
+"doesn\'t exist when opened for writing or appending; it will be truncated\n"
+"when opened for writing. A FileExistsError will be raised if it already\n"
+"exists when opened for creating. Opening a file for creating implies\n"
+"writing so this mode behaves in a similar way to \'w\'.Add a \'+\' to the mode\n"
+"to allow simultaneous reading and writing. A custom opener can be used by\n"
+"passing a callable as *opener*. The underlying file descriptor for the file\n"
+"object is then obtained by calling opener with (*name*, *flags*).\n"
+"*opener* must return an open file descriptor (passing os.open as *opener*\n"
+"results in functionality similar to passing None).");
+
+static int
+_io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
+ int closefd, PyObject *opener);
+
+static int
+_io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file), &_Py_ID(mode), &_Py_ID(closefd), &_Py_ID(opener), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"file", "mode", "closefd", "opener", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "FileIO",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *nameobj;
+ const char *mode = "r";
+ int closefd = 1;
+ PyObject *opener = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 4, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ nameobj = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[1]) {
+ if (!PyUnicode_Check(fastargs[1])) {
+ _PyArg_BadArgument("FileIO", "argument 'mode'", "str", fastargs[1]);
+ goto exit;
+ }
+ Py_ssize_t mode_length;
+ mode = PyUnicode_AsUTF8AndSize(fastargs[1], &mode_length);
+ if (mode == NULL) {
+ goto exit;
+ }
+ if (strlen(mode) != (size_t)mode_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[2]) {
+ closefd = PyObject_IsTrue(fastargs[2]);
+ if (closefd < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ opener = fastargs[3];
+skip_optional_pos:
+ return_value = _io_FileIO___init___impl((fileio *)self, nameobj, mode, closefd, opener);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_FileIO_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n"
+"Return the underlying file descriptor (an integer).");
+
+#define _IO_FILEIO_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)_io_FileIO_fileno, METH_NOARGS, _io_FileIO_fileno__doc__},
+
+static PyObject *
+_io_FileIO_fileno_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_fileno(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_fileno_impl(self);
+}
+
+PyDoc_STRVAR(_io_FileIO_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n"
+"True if file was opened in a read mode.");
+
+#define _IO_FILEIO_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io_FileIO_readable, METH_NOARGS, _io_FileIO_readable__doc__},
+
+static PyObject *
+_io_FileIO_readable_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_readable(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_readable_impl(self);
+}
+
+PyDoc_STRVAR(_io_FileIO_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n"
+"True if file was opened in a write mode.");
+
+#define _IO_FILEIO_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io_FileIO_writable, METH_NOARGS, _io_FileIO_writable__doc__},
+
+static PyObject *
+_io_FileIO_writable_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_writable(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_writable_impl(self);
+}
+
+PyDoc_STRVAR(_io_FileIO_seekable__doc__,
+"seekable($self, /)\n"
+"--\n"
+"\n"
+"True if file supports random-access.");
+
+#define _IO_FILEIO_SEEKABLE_METHODDEF \
+ {"seekable", (PyCFunction)_io_FileIO_seekable, METH_NOARGS, _io_FileIO_seekable__doc__},
+
+static PyObject *
+_io_FileIO_seekable_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_seekable(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_seekable_impl(self);
+}
+
+PyDoc_STRVAR(_io_FileIO_readinto__doc__,
+"readinto($self, buffer, /)\n"
+"--\n"
+"\n"
+"Same as RawIOBase.readinto().");
+
+#define _IO_FILEIO_READINTO_METHODDEF \
+ {"readinto", _PyCFunction_CAST(_io_FileIO_readinto), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io_FileIO_readinto__doc__},
+
+static PyObject *
+_io_FileIO_readinto_impl(fileio *self, PyTypeObject *cls, Py_buffer *buffer);
+
+static PyObject *
+_io_FileIO_readinto(fileio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "readinto",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_buffer buffer = {NULL, NULL};
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto", "argument 1", "read-write bytes-like object", args[0]);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ return_value = _io_FileIO_readinto_impl(self, cls, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_FileIO_readall__doc__,
+"readall($self, /)\n"
+"--\n"
+"\n"
+"Read all data from the file, returned as bytes.\n"
+"\n"
+"In non-blocking mode, returns as much as is immediately available,\n"
+"or None if no data is available. Return an empty bytes object at EOF.");
+
+#define _IO_FILEIO_READALL_METHODDEF \
+ {"readall", (PyCFunction)_io_FileIO_readall, METH_NOARGS, _io_FileIO_readall__doc__},
+
+static PyObject *
+_io_FileIO_readall_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_readall(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_readall_impl(self);
+}
+
+PyDoc_STRVAR(_io_FileIO_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read at most size bytes, returned as bytes.\n"
+"\n"
+"Only makes one system call, so less data may be returned than requested.\n"
+"In non-blocking mode, returns None if no data is available.\n"
+"Return an empty bytes object at EOF.");
+
+#define _IO_FILEIO_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io_FileIO_read), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io_FileIO_read__doc__},
+
+static PyObject *
+_io_FileIO_read_impl(fileio *self, PyTypeObject *cls, Py_ssize_t size);
+
+static PyObject *
+_io_FileIO_read(fileio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "read",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t size = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io_FileIO_read_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_FileIO_write__doc__,
+"write($self, b, /)\n"
+"--\n"
+"\n"
+"Write buffer b to file, return number of bytes written.\n"
+"\n"
+"Only makes one system call, so not all of the data may be written.\n"
+"The number of bytes actually written is returned. In non-blocking mode,\n"
+"returns None if the write would block.");
+
+#define _IO_FILEIO_WRITE_METHODDEF \
+ {"write", _PyCFunction_CAST(_io_FileIO_write), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io_FileIO_write__doc__},
+
+static PyObject *
+_io_FileIO_write_impl(fileio *self, PyTypeObject *cls, Py_buffer *b);
+
+static PyObject *
+_io_FileIO_write(fileio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "write",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_buffer b = {NULL, NULL};
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &b, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&b, 'C')) {
+ _PyArg_BadArgument("write", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ return_value = _io_FileIO_write_impl(self, cls, &b);
+
+exit:
+ /* Cleanup for b */
+ if (b.obj) {
+ PyBuffer_Release(&b);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_FileIO_seek__doc__,
+"seek($self, pos, whence=0, /)\n"
+"--\n"
+"\n"
+"Move to new file position and return the file position.\n"
+"\n"
+"Argument offset is a byte count. Optional argument whence defaults to\n"
+"SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values\n"
+"are SEEK_CUR or 1 (move relative to current position, positive or negative),\n"
+"and SEEK_END or 2 (move relative to end of file, usually negative, although\n"
+"many platforms allow seeking beyond the end of a file).\n"
+"\n"
+"Note that not all file objects are seekable.");
+
+#define _IO_FILEIO_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(_io_FileIO_seek), METH_FASTCALL, _io_FileIO_seek__doc__},
+
+static PyObject *
+_io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence);
+
+static PyObject *
+_io_FileIO_seek(fileio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *pos;
+ int whence = 0;
+
+ if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
+ goto exit;
+ }
+ pos = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ whence = _PyLong_AsInt(args[1]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_FileIO_seek_impl(self, pos, whence);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_FileIO_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n"
+"Current file position.\n"
+"\n"
+"Can raise OSError for non seekable files.");
+
+#define _IO_FILEIO_TELL_METHODDEF \
+ {"tell", (PyCFunction)_io_FileIO_tell, METH_NOARGS, _io_FileIO_tell__doc__},
+
+static PyObject *
+_io_FileIO_tell_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_tell(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_tell_impl(self);
+}
+
+#if defined(HAVE_FTRUNCATE)
+
+PyDoc_STRVAR(_io_FileIO_truncate__doc__,
+"truncate($self, size=None, /)\n"
+"--\n"
+"\n"
+"Truncate the file to at most size bytes and return the truncated size.\n"
+"\n"
+"Size defaults to the current file position, as returned by tell().\n"
+"The current file position is changed to the value of size.");
+
+#define _IO_FILEIO_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(_io_FileIO_truncate), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io_FileIO_truncate__doc__},
+
+static PyObject *
+_io_FileIO_truncate_impl(fileio *self, PyTypeObject *cls, PyObject *posobj);
+
+static PyObject *
+_io_FileIO_truncate(fileio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "truncate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *posobj = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ posobj = args[0];
+skip_optional_posonly:
+ return_value = _io_FileIO_truncate_impl(self, cls, posobj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FTRUNCATE) */
+
+PyDoc_STRVAR(_io_FileIO_isatty__doc__,
+"isatty($self, /)\n"
+"--\n"
+"\n"
+"True if the file is connected to a TTY device.");
+
+#define _IO_FILEIO_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)_io_FileIO_isatty, METH_NOARGS, _io_FileIO_isatty__doc__},
+
+static PyObject *
+_io_FileIO_isatty_impl(fileio *self);
+
+static PyObject *
+_io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_FileIO_isatty_impl(self);
+}
+
+#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
+ #define _IO_FILEIO_TRUNCATE_METHODDEF
+#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
+/*[clinic end generated code: output=17d5c63e9b37ccb1 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/iobase.c.h b/contrib/tools/python3/Modules/_io/clinic/iobase.c.h
new file mode 100644
index 00000000000..328ea95e3f8
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/iobase.c.h
@@ -0,0 +1,444 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io__IOBase_seek__doc__,
+"seek($self, offset, whence=os.SEEK_SET, /)\n"
+"--\n"
+"\n"
+"Change the stream position to the given byte offset.\n"
+"\n"
+" offset\n"
+" The stream position, relative to \'whence\'.\n"
+" whence\n"
+" The relative position to seek from.\n"
+"\n"
+"The offset is interpreted relative to the position indicated by whence.\n"
+"Values for whence are:\n"
+"\n"
+"* os.SEEK_SET or 0 -- start of stream (the default); offset should be zero or positive\n"
+"* os.SEEK_CUR or 1 -- current stream position; offset may be negative\n"
+"* os.SEEK_END or 2 -- end of stream; offset is usually negative\n"
+"\n"
+"Return the new absolute position.");
+
+#define _IO__IOBASE_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(_io__IOBase_seek), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__IOBase_seek__doc__},
+
+static PyObject *
+_io__IOBase_seek_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(offset), int Py_UNUSED(whence));
+
+static PyObject *
+_io__IOBase_seek(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "seek",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ int offset;
+ int whence = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ offset = _PyLong_AsInt(args[0]);
+ if (offset == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional_posonly;
+ }
+ whence = _PyLong_AsInt(args[1]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io__IOBase_seek_impl(self, cls, offset, whence);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__IOBase_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n"
+"Return current stream position.");
+
+#define _IO__IOBASE_TELL_METHODDEF \
+ {"tell", (PyCFunction)_io__IOBase_tell, METH_NOARGS, _io__IOBase_tell__doc__},
+
+static PyObject *
+_io__IOBase_tell_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_tell(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_tell_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_truncate__doc__,
+"truncate($self, size=None, /)\n"
+"--\n"
+"\n"
+"Truncate file to size bytes.\n"
+"\n"
+"File pointer is left unchanged. Size defaults to the current IO position\n"
+"as reported by tell(). Return the new size.");
+
+#define _IO__IOBASE_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(_io__IOBase_truncate), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__IOBase_truncate__doc__},
+
+static PyObject *
+_io__IOBase_truncate_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *Py_UNUSED(size));
+
+static PyObject *
+_io__IOBase_truncate(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "truncate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *size = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ size = args[0];
+skip_optional_posonly:
+ return_value = _io__IOBase_truncate_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__IOBase_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n"
+"Flush write buffers, if applicable.\n"
+"\n"
+"This is not implemented for read-only and non-blocking streams.");
+
+#define _IO__IOBASE_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_io__IOBase_flush, METH_NOARGS, _io__IOBase_flush__doc__},
+
+static PyObject *
+_io__IOBase_flush_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_flush(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_flush_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Flush and close the IO object.\n"
+"\n"
+"This method has no effect if the file is already closed.");
+
+#define _IO__IOBASE_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_io__IOBase_close, METH_NOARGS, _io__IOBase_close__doc__},
+
+static PyObject *
+_io__IOBase_close_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_close(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_close_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_seekable__doc__,
+"seekable($self, /)\n"
+"--\n"
+"\n"
+"Return whether object supports random access.\n"
+"\n"
+"If False, seek(), tell() and truncate() will raise OSError.\n"
+"This method may need to do a test seek().");
+
+#define _IO__IOBASE_SEEKABLE_METHODDEF \
+ {"seekable", (PyCFunction)_io__IOBase_seekable, METH_NOARGS, _io__IOBase_seekable__doc__},
+
+static PyObject *
+_io__IOBase_seekable_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_seekable(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_seekable_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n"
+"Return whether object was opened for reading.\n"
+"\n"
+"If False, read() will raise OSError.");
+
+#define _IO__IOBASE_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io__IOBase_readable, METH_NOARGS, _io__IOBase_readable__doc__},
+
+static PyObject *
+_io__IOBase_readable_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_readable(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_readable_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n"
+"Return whether object was opened for writing.\n"
+"\n"
+"If False, write() will raise OSError.");
+
+#define _IO__IOBASE_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io__IOBase_writable, METH_NOARGS, _io__IOBase_writable__doc__},
+
+static PyObject *
+_io__IOBase_writable_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_writable(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_writable_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n"
+"Return underlying file descriptor if one exists.\n"
+"\n"
+"Raise OSError if the IO object does not use a file descriptor.");
+
+#define _IO__IOBASE_FILENO_METHODDEF \
+ {"fileno", _PyCFunction_CAST(_io__IOBase_fileno), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__IOBase_fileno__doc__},
+
+static PyObject *
+_io__IOBase_fileno_impl(PyObject *self, PyTypeObject *cls);
+
+static PyObject *
+_io__IOBase_fileno(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "fileno() takes no arguments");
+ return NULL;
+ }
+ return _io__IOBase_fileno_impl(self, cls);
+}
+
+PyDoc_STRVAR(_io__IOBase_isatty__doc__,
+"isatty($self, /)\n"
+"--\n"
+"\n"
+"Return whether this is an \'interactive\' stream.\n"
+"\n"
+"Return False if it can\'t be determined.");
+
+#define _IO__IOBASE_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)_io__IOBase_isatty, METH_NOARGS, _io__IOBase_isatty__doc__},
+
+static PyObject *
+_io__IOBase_isatty_impl(PyObject *self);
+
+static PyObject *
+_io__IOBase_isatty(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__IOBase_isatty_impl(self);
+}
+
+PyDoc_STRVAR(_io__IOBase_readline__doc__,
+"readline($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read and return a line from the stream.\n"
+"\n"
+"If size is specified, at most size bytes will be read.\n"
+"\n"
+"The line terminator is always b\'\\n\' for binary files; for text\n"
+"files, the newlines argument to open can be used to select the line\n"
+"terminator(s) recognized.");
+
+#define _IO__IOBASE_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_io__IOBase_readline), METH_FASTCALL, _io__IOBase_readline__doc__},
+
+static PyObject *
+_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit);
+
+static PyObject *
+_io__IOBase_readline(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t limit = -1;
+
+ if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &limit)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io__IOBase_readline_impl(self, limit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__IOBase_readlines__doc__,
+"readlines($self, hint=-1, /)\n"
+"--\n"
+"\n"
+"Return a list of lines from the stream.\n"
+"\n"
+"hint can be specified to control the number of lines read: no more\n"
+"lines will be read if the total size (in bytes/characters) of all\n"
+"lines so far exceeds hint.");
+
+#define _IO__IOBASE_READLINES_METHODDEF \
+ {"readlines", _PyCFunction_CAST(_io__IOBase_readlines), METH_FASTCALL, _io__IOBase_readlines__doc__},
+
+static PyObject *
+_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint);
+
+static PyObject *
+_io__IOBase_readlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t hint = -1;
+
+ if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &hint)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io__IOBase_readlines_impl(self, hint);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__IOBase_writelines__doc__,
+"writelines($self, lines, /)\n"
+"--\n"
+"\n"
+"Write a list of lines to stream.\n"
+"\n"
+"Line separators are not added, so it is usual for each of the\n"
+"lines provided to have a line separator at the end.");
+
+#define _IO__IOBASE_WRITELINES_METHODDEF \
+ {"writelines", (PyCFunction)_io__IOBase_writelines, METH_O, _io__IOBase_writelines__doc__},
+
+PyDoc_STRVAR(_io__RawIOBase_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n");
+
+#define _IO__RAWIOBASE_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io__RawIOBase_read), METH_FASTCALL, _io__RawIOBase_read__doc__},
+
+static PyObject *
+_io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n);
+
+static PyObject *
+_io__RawIOBase_read(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t n = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ n = ival;
+ }
+skip_optional:
+ return_value = _io__RawIOBase_read_impl(self, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__RawIOBase_readall__doc__,
+"readall($self, /)\n"
+"--\n"
+"\n"
+"Read until EOF, using multiple read() call.");
+
+#define _IO__RAWIOBASE_READALL_METHODDEF \
+ {"readall", (PyCFunction)_io__RawIOBase_readall, METH_NOARGS, _io__RawIOBase_readall__doc__},
+
+static PyObject *
+_io__RawIOBase_readall_impl(PyObject *self);
+
+static PyObject *
+_io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__RawIOBase_readall_impl(self);
+}
+/*[clinic end generated code: output=60faa842b41185d2 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/stringio.c.h b/contrib/tools/python3/Modules/_io/clinic/stringio.c.h
new file mode 100644
index 00000000000..d495dd10c16
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/stringio.c.h
@@ -0,0 +1,370 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io_StringIO_getvalue__doc__,
+"getvalue($self, /)\n"
+"--\n"
+"\n"
+"Retrieve the entire contents of the object.");
+
+#define _IO_STRINGIO_GETVALUE_METHODDEF \
+ {"getvalue", (PyCFunction)_io_StringIO_getvalue, METH_NOARGS, _io_StringIO_getvalue__doc__},
+
+static PyObject *
+_io_StringIO_getvalue_impl(stringio *self);
+
+static PyObject *
+_io_StringIO_getvalue(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_StringIO_getvalue_impl(self);
+}
+
+PyDoc_STRVAR(_io_StringIO_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n"
+"Tell the current file position.");
+
+#define _IO_STRINGIO_TELL_METHODDEF \
+ {"tell", (PyCFunction)_io_StringIO_tell, METH_NOARGS, _io_StringIO_tell__doc__},
+
+static PyObject *
+_io_StringIO_tell_impl(stringio *self);
+
+static PyObject *
+_io_StringIO_tell(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_StringIO_tell_impl(self);
+}
+
+PyDoc_STRVAR(_io_StringIO_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read at most size characters, returned as a string.\n"
+"\n"
+"If the argument is negative or omitted, read until EOF\n"
+"is reached. Return an empty string at EOF.");
+
+#define _IO_STRINGIO_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io_StringIO_read), METH_FASTCALL, _io_StringIO_read__doc__},
+
+static PyObject *
+_io_StringIO_read_impl(stringio *self, Py_ssize_t size);
+
+static PyObject *
+_io_StringIO_read(stringio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_StringIO_read_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_StringIO_readline__doc__,
+"readline($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read until newline or EOF.\n"
+"\n"
+"Returns an empty string if EOF is hit immediately.");
+
+#define _IO_STRINGIO_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_io_StringIO_readline), METH_FASTCALL, _io_StringIO_readline__doc__},
+
+static PyObject *
+_io_StringIO_readline_impl(stringio *self, Py_ssize_t size);
+
+static PyObject *
+_io_StringIO_readline(stringio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_StringIO_readline_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_StringIO_truncate__doc__,
+"truncate($self, pos=None, /)\n"
+"--\n"
+"\n"
+"Truncate size to pos.\n"
+"\n"
+"The pos argument defaults to the current file position, as\n"
+"returned by tell(). The current file position is unchanged.\n"
+"Returns the new absolute position.");
+
+#define _IO_STRINGIO_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(_io_StringIO_truncate), METH_FASTCALL, _io_StringIO_truncate__doc__},
+
+static PyObject *
+_io_StringIO_truncate_impl(stringio *self, Py_ssize_t size);
+
+static PyObject *
+_io_StringIO_truncate(stringio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = self->pos;
+
+ if (!_PyArg_CheckPositional("truncate", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_StringIO_truncate_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_StringIO_seek__doc__,
+"seek($self, pos, whence=0, /)\n"
+"--\n"
+"\n"
+"Change stream position.\n"
+"\n"
+"Seek to character offset pos relative to position indicated by whence:\n"
+" 0 Start of stream (the default). pos should be >= 0;\n"
+" 1 Current position - pos must be 0;\n"
+" 2 End of stream - pos must be 0.\n"
+"Returns the new absolute position.");
+
+#define _IO_STRINGIO_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(_io_StringIO_seek), METH_FASTCALL, _io_StringIO_seek__doc__},
+
+static PyObject *
+_io_StringIO_seek_impl(stringio *self, Py_ssize_t pos, int whence);
+
+static PyObject *
+_io_StringIO_seek(stringio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t pos;
+ int whence = 0;
+
+ if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ whence = _PyLong_AsInt(args[1]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_StringIO_seek_impl(self, pos, whence);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_StringIO_write__doc__,
+"write($self, s, /)\n"
+"--\n"
+"\n"
+"Write string to file.\n"
+"\n"
+"Returns the number of characters written, which is always equal to\n"
+"the length of the string.");
+
+#define _IO_STRINGIO_WRITE_METHODDEF \
+ {"write", (PyCFunction)_io_StringIO_write, METH_O, _io_StringIO_write__doc__},
+
+PyDoc_STRVAR(_io_StringIO_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the IO object.\n"
+"\n"
+"Attempting any further operation after the object is closed\n"
+"will raise a ValueError.\n"
+"\n"
+"This method has no effect if the file is already closed.");
+
+#define _IO_STRINGIO_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_io_StringIO_close, METH_NOARGS, _io_StringIO_close__doc__},
+
+static PyObject *
+_io_StringIO_close_impl(stringio *self);
+
+static PyObject *
+_io_StringIO_close(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_StringIO_close_impl(self);
+}
+
+PyDoc_STRVAR(_io_StringIO___init____doc__,
+"StringIO(initial_value=\'\', newline=\'\\n\')\n"
+"--\n"
+"\n"
+"Text I/O implementation using an in-memory buffer.\n"
+"\n"
+"The initial_value argument sets the value of object. The newline\n"
+"argument is like the one of TextIOWrapper\'s constructor.");
+
+static int
+_io_StringIO___init___impl(stringio *self, PyObject *value,
+ PyObject *newline_obj);
+
+static int
+_io_StringIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(initial_value), &_Py_ID(newline), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"initial_value", "newline", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "StringIO",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *value = NULL;
+ PyObject *newline_obj = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[0]) {
+ value = fastargs[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ newline_obj = fastargs[1];
+skip_optional_pos:
+ return_value = _io_StringIO___init___impl((stringio *)self, value, newline_obj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_StringIO_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n"
+"Returns True if the IO object can be read.");
+
+#define _IO_STRINGIO_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io_StringIO_readable, METH_NOARGS, _io_StringIO_readable__doc__},
+
+static PyObject *
+_io_StringIO_readable_impl(stringio *self);
+
+static PyObject *
+_io_StringIO_readable(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_StringIO_readable_impl(self);
+}
+
+PyDoc_STRVAR(_io_StringIO_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n"
+"Returns True if the IO object can be written.");
+
+#define _IO_STRINGIO_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io_StringIO_writable, METH_NOARGS, _io_StringIO_writable__doc__},
+
+static PyObject *
+_io_StringIO_writable_impl(stringio *self);
+
+static PyObject *
+_io_StringIO_writable(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_StringIO_writable_impl(self);
+}
+
+PyDoc_STRVAR(_io_StringIO_seekable__doc__,
+"seekable($self, /)\n"
+"--\n"
+"\n"
+"Returns True if the IO object can be seeked.");
+
+#define _IO_STRINGIO_SEEKABLE_METHODDEF \
+ {"seekable", (PyCFunction)_io_StringIO_seekable, METH_NOARGS, _io_StringIO_seekable__doc__},
+
+static PyObject *
+_io_StringIO_seekable_impl(stringio *self);
+
+static PyObject *
+_io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_StringIO_seekable_impl(self);
+}
+/*[clinic end generated code: output=533f20ae9b773126 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/textio.c.h b/contrib/tools/python3/Modules/_io/clinic/textio.c.h
new file mode 100644
index 00000000000..1f67434f881
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/textio.c.h
@@ -0,0 +1,985 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_io__TextIOBase_detach__doc__,
+"detach($self, /)\n"
+"--\n"
+"\n"
+"Separate the underlying buffer from the TextIOBase and return it.\n"
+"\n"
+"After the underlying buffer has been detached, the TextIO is in an unusable state.");
+
+#define _IO__TEXTIOBASE_DETACH_METHODDEF \
+ {"detach", _PyCFunction_CAST(_io__TextIOBase_detach), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__TextIOBase_detach__doc__},
+
+static PyObject *
+_io__TextIOBase_detach_impl(PyObject *self, PyTypeObject *cls);
+
+static PyObject *
+_io__TextIOBase_detach(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "detach() takes no arguments");
+ return NULL;
+ }
+ return _io__TextIOBase_detach_impl(self, cls);
+}
+
+PyDoc_STRVAR(_io__TextIOBase_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read at most size characters from stream.\n"
+"\n"
+"Read from underlying buffer until we have size characters or we hit EOF.\n"
+"If size is negative or omitted, read until EOF.");
+
+#define _IO__TEXTIOBASE_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io__TextIOBase_read), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__TextIOBase_read__doc__},
+
+static PyObject *
+_io__TextIOBase_read_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size));
+
+static PyObject *
+_io__TextIOBase_read(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "read",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int size = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ size = _PyLong_AsInt(args[0]);
+ if (size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io__TextIOBase_read_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__TextIOBase_readline__doc__,
+"readline($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read until newline or EOF.\n"
+"\n"
+"Return an empty string if EOF is hit immediately.\n"
+"If size is specified, at most size characters will be read.");
+
+#define _IO__TEXTIOBASE_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_io__TextIOBase_readline), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__TextIOBase_readline__doc__},
+
+static PyObject *
+_io__TextIOBase_readline_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size));
+
+static PyObject *
+_io__TextIOBase_readline(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "readline",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int size = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ size = _PyLong_AsInt(args[0]);
+ if (size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io__TextIOBase_readline_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io__TextIOBase_write__doc__,
+"write($self, s, /)\n"
+"--\n"
+"\n"
+"Write string s to stream.\n"
+"\n"
+"Return the number of characters written\n"
+"(which is always equal to the length of the string).");
+
+#define _IO__TEXTIOBASE_WRITE_METHODDEF \
+ {"write", _PyCFunction_CAST(_io__TextIOBase_write), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__TextIOBase_write__doc__},
+
+static PyObject *
+_io__TextIOBase_write_impl(PyObject *self, PyTypeObject *cls,
+ const char *Py_UNUSED(s));
+
+static PyObject *
+_io__TextIOBase_write(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "write",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ const char *s;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("write", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t s_length;
+ s = PyUnicode_AsUTF8AndSize(args[0], &s_length);
+ if (s == NULL) {
+ goto exit;
+ }
+ if (strlen(s) != (size_t)s_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _io__TextIOBase_write_impl(self, cls, s);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_IncrementalNewlineDecoder___init____doc__,
+"IncrementalNewlineDecoder(decoder, translate, errors=\'strict\')\n"
+"--\n"
+"\n"
+"Codec used when reading a file in universal newlines mode.\n"
+"\n"
+"It wraps another incremental decoder, translating \\r\\n and \\r into \\n.\n"
+"It also records the types of newlines encountered. When used with\n"
+"translate=False, it ensures that the newline sequence is returned in\n"
+"one piece. When used with decoder=None, it expects unicode strings as\n"
+"decode input and translates newlines without first invoking an external\n"
+"decoder.");
+
+static int
+_io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self,
+ PyObject *decoder, int translate,
+ PyObject *errors);
+
+static int
+_io_IncrementalNewlineDecoder___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(decoder), &_Py_ID(translate), &_Py_ID(errors), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"decoder", "translate", "errors", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "IncrementalNewlineDecoder",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 2;
+ PyObject *decoder;
+ int translate;
+ PyObject *errors = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 2, 3, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ decoder = fastargs[0];
+ translate = PyObject_IsTrue(fastargs[1]);
+ if (translate < 0) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ errors = fastargs[2];
+skip_optional_pos:
+ return_value = _io_IncrementalNewlineDecoder___init___impl((nldecoder_object *)self, decoder, translate, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_IncrementalNewlineDecoder_decode__doc__,
+"decode($self, /, input, final=False)\n"
+"--\n"
+"\n");
+
+#define _IO_INCREMENTALNEWLINEDECODER_DECODE_METHODDEF \
+ {"decode", _PyCFunction_CAST(_io_IncrementalNewlineDecoder_decode), METH_FASTCALL|METH_KEYWORDS, _io_IncrementalNewlineDecoder_decode__doc__},
+
+static PyObject *
+_io_IncrementalNewlineDecoder_decode_impl(nldecoder_object *self,
+ PyObject *input, int final);
+
+static PyObject *
+_io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(input), &_Py_ID(final), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"input", "final", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *input;
+ int final = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ input = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ final = PyObject_IsTrue(args[1]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _io_IncrementalNewlineDecoder_decode_impl(self, input, final);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_IncrementalNewlineDecoder_getstate__doc__,
+"getstate($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_INCREMENTALNEWLINEDECODER_GETSTATE_METHODDEF \
+ {"getstate", (PyCFunction)_io_IncrementalNewlineDecoder_getstate, METH_NOARGS, _io_IncrementalNewlineDecoder_getstate__doc__},
+
+static PyObject *
+_io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self);
+
+static PyObject *
+_io_IncrementalNewlineDecoder_getstate(nldecoder_object *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_IncrementalNewlineDecoder_getstate_impl(self);
+}
+
+PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__,
+"setstate($self, state, /)\n"
+"--\n"
+"\n");
+
+#define _IO_INCREMENTALNEWLINEDECODER_SETSTATE_METHODDEF \
+ {"setstate", (PyCFunction)_io_IncrementalNewlineDecoder_setstate, METH_O, _io_IncrementalNewlineDecoder_setstate__doc__},
+
+PyDoc_STRVAR(_io_IncrementalNewlineDecoder_reset__doc__,
+"reset($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_INCREMENTALNEWLINEDECODER_RESET_METHODDEF \
+ {"reset", (PyCFunction)_io_IncrementalNewlineDecoder_reset, METH_NOARGS, _io_IncrementalNewlineDecoder_reset__doc__},
+
+static PyObject *
+_io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self);
+
+static PyObject *
+_io_IncrementalNewlineDecoder_reset(nldecoder_object *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_IncrementalNewlineDecoder_reset_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper___init____doc__,
+"TextIOWrapper(buffer, encoding=None, errors=None, newline=None,\n"
+" line_buffering=False, write_through=False)\n"
+"--\n"
+"\n"
+"Character and line based layer over a BufferedIOBase object, buffer.\n"
+"\n"
+"encoding gives the name of the encoding that the stream will be\n"
+"decoded or encoded with. It defaults to locale.getencoding().\n"
+"\n"
+"errors determines the strictness of encoding and decoding (see\n"
+"help(codecs.Codec) or the documentation for codecs.register) and\n"
+"defaults to \"strict\".\n"
+"\n"
+"newline controls how line endings are handled. It can be None, \'\',\n"
+"\'\\n\', \'\\r\', and \'\\r\\n\'. It works as follows:\n"
+"\n"
+"* On input, if newline is None, universal newlines mode is\n"
+" enabled. Lines in the input can end in \'\\n\', \'\\r\', or \'\\r\\n\', and\n"
+" these are translated into \'\\n\' before being returned to the\n"
+" caller. If it is \'\', universal newline mode is enabled, but line\n"
+" endings are returned to the caller untranslated. If it has any of\n"
+" the other legal values, input lines are only terminated by the given\n"
+" string, and the line ending is returned to the caller untranslated.\n"
+"\n"
+"* On output, if newline is None, any \'\\n\' characters written are\n"
+" translated to the system default line separator, os.linesep. If\n"
+" newline is \'\' or \'\\n\', no translation takes place. If newline is any\n"
+" of the other legal values, any \'\\n\' characters written are translated\n"
+" to the given string.\n"
+"\n"
+"If line_buffering is True, a call to flush is implied when a call to\n"
+"write contains a newline character.");
+
+static int
+_io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
+ const char *encoding, PyObject *errors,
+ const char *newline, int line_buffering,
+ int write_through);
+
+static int
+_io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 6
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(buffer), &_Py_ID(encoding), &_Py_ID(errors), &_Py_ID(newline), &_Py_ID(line_buffering), &_Py_ID(write_through), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"buffer", "encoding", "errors", "newline", "line_buffering", "write_through", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "TextIOWrapper",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[6];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *buffer;
+ const char *encoding = NULL;
+ PyObject *errors = Py_None;
+ const char *newline = NULL;
+ int line_buffering = 0;
+ int write_through = 0;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 6, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ buffer = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[1]) {
+ if (fastargs[1] == Py_None) {
+ encoding = NULL;
+ }
+ else if (PyUnicode_Check(fastargs[1])) {
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(fastargs[1], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("TextIOWrapper", "argument 'encoding'", "str or None", fastargs[1]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[2]) {
+ errors = fastargs[2];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[3]) {
+ if (fastargs[3] == Py_None) {
+ newline = NULL;
+ }
+ else if (PyUnicode_Check(fastargs[3])) {
+ Py_ssize_t newline_length;
+ newline = PyUnicode_AsUTF8AndSize(fastargs[3], &newline_length);
+ if (newline == NULL) {
+ goto exit;
+ }
+ if (strlen(newline) != (size_t)newline_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("TextIOWrapper", "argument 'newline'", "str or None", fastargs[3]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[4]) {
+ line_buffering = PyObject_IsTrue(fastargs[4]);
+ if (line_buffering < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ write_through = PyObject_IsTrue(fastargs[5]);
+ if (write_through < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _io_TextIOWrapper___init___impl((textio *)self, buffer, encoding, errors, newline, line_buffering, write_through);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_reconfigure__doc__,
+"reconfigure($self, /, *, encoding=None, errors=None, newline=None,\n"
+" line_buffering=None, write_through=None)\n"
+"--\n"
+"\n"
+"Reconfigure the text stream with new parameters.\n"
+"\n"
+"This also does an implicit stream flush.");
+
+#define _IO_TEXTIOWRAPPER_RECONFIGURE_METHODDEF \
+ {"reconfigure", _PyCFunction_CAST(_io_TextIOWrapper_reconfigure), METH_FASTCALL|METH_KEYWORDS, _io_TextIOWrapper_reconfigure__doc__},
+
+static PyObject *
+_io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding,
+ PyObject *errors, PyObject *newline_obj,
+ PyObject *line_buffering_obj,
+ PyObject *write_through_obj);
+
+static PyObject *
+_io_TextIOWrapper_reconfigure(textio *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(encoding), &_Py_ID(errors), &_Py_ID(newline), &_Py_ID(line_buffering), &_Py_ID(write_through), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"encoding", "errors", "newline", "line_buffering", "write_through", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "reconfigure",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *encoding = Py_None;
+ PyObject *errors = Py_None;
+ PyObject *newline_obj = NULL;
+ PyObject *line_buffering_obj = Py_None;
+ PyObject *write_through_obj = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[0]) {
+ encoding = args[0];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[1]) {
+ errors = args[1];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[2]) {
+ newline_obj = args[2];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ line_buffering_obj = args[3];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ write_through_obj = args[4];
+skip_optional_kwonly:
+ return_value = _io_TextIOWrapper_reconfigure_impl(self, encoding, errors, newline_obj, line_buffering_obj, write_through_obj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_detach__doc__,
+"detach($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_DETACH_METHODDEF \
+ {"detach", (PyCFunction)_io_TextIOWrapper_detach, METH_NOARGS, _io_TextIOWrapper_detach__doc__},
+
+static PyObject *
+_io_TextIOWrapper_detach_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_detach(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_detach_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_write__doc__,
+"write($self, text, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_WRITE_METHODDEF \
+ {"write", (PyCFunction)_io_TextIOWrapper_write, METH_O, _io_TextIOWrapper_write__doc__},
+
+static PyObject *
+_io_TextIOWrapper_write_impl(textio *self, PyObject *text);
+
+static PyObject *
+_io_TextIOWrapper_write(textio *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *text;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("write", "argument", "str", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ text = arg;
+ return_value = _io_TextIOWrapper_write_impl(self, text);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io_TextIOWrapper_read), METH_FASTCALL, _io_TextIOWrapper_read__doc__},
+
+static PyObject *
+_io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n);
+
+static PyObject *
+_io_TextIOWrapper_read(textio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t n = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &n)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_TextIOWrapper_read_impl(self, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_readline__doc__,
+"readline($self, size=-1, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_io_TextIOWrapper_readline), METH_FASTCALL, _io_TextIOWrapper_readline__doc__},
+
+static PyObject *
+_io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size);
+
+static PyObject *
+_io_TextIOWrapper_readline(textio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size = -1;
+
+ if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ size = ival;
+ }
+skip_optional:
+ return_value = _io_TextIOWrapper_readline_impl(self, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_seek__doc__,
+"seek($self, cookie, whence=os.SEEK_SET, /)\n"
+"--\n"
+"\n"
+"Set the stream position, and return the new stream position.\n"
+"\n"
+" cookie\n"
+" Zero or an opaque number returned by tell().\n"
+" whence\n"
+" The relative position to seek from.\n"
+"\n"
+"Four operations are supported, given by the following argument\n"
+"combinations:\n"
+"\n"
+"- seek(0, SEEK_SET): Rewind to the start of the stream.\n"
+"- seek(cookie, SEEK_SET): Restore a previous position;\n"
+" \'cookie\' must be a number returned by tell().\n"
+"- seek(0, SEEK_END): Fast-forward to the end of the stream.\n"
+"- seek(0, SEEK_CUR): Leave the current stream position unchanged.\n"
+"\n"
+"Any other argument combinations are invalid,\n"
+"and may raise exceptions.");
+
+#define _IO_TEXTIOWRAPPER_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(_io_TextIOWrapper_seek), METH_FASTCALL, _io_TextIOWrapper_seek__doc__},
+
+static PyObject *
+_io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence);
+
+static PyObject *
+_io_TextIOWrapper_seek(textio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *cookieObj;
+ int whence = 0;
+
+ if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
+ goto exit;
+ }
+ cookieObj = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ whence = _PyLong_AsInt(args[1]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _io_TextIOWrapper_seek_impl(self, cookieObj, whence);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n"
+"Return the stream position as an opaque number.\n"
+"\n"
+"The return value of tell() can be given as input to seek(), to restore a\n"
+"previous stream position.");
+
+#define _IO_TEXTIOWRAPPER_TELL_METHODDEF \
+ {"tell", (PyCFunction)_io_TextIOWrapper_tell, METH_NOARGS, _io_TextIOWrapper_tell__doc__},
+
+static PyObject *
+_io_TextIOWrapper_tell_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_tell(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_tell_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_truncate__doc__,
+"truncate($self, pos=None, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(_io_TextIOWrapper_truncate), METH_FASTCALL, _io_TextIOWrapper_truncate__doc__},
+
+static PyObject *
+_io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos);
+
+static PyObject *
+_io_TextIOWrapper_truncate(textio *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *pos = Py_None;
+
+ if (!_PyArg_CheckPositional("truncate", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ pos = args[0];
+skip_optional:
+ return_value = _io_TextIOWrapper_truncate_impl(self, pos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)_io_TextIOWrapper_fileno, METH_NOARGS, _io_TextIOWrapper_fileno__doc__},
+
+static PyObject *
+_io_TextIOWrapper_fileno_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_fileno(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_fileno_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_seekable__doc__,
+"seekable($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_SEEKABLE_METHODDEF \
+ {"seekable", (PyCFunction)_io_TextIOWrapper_seekable, METH_NOARGS, _io_TextIOWrapper_seekable__doc__},
+
+static PyObject *
+_io_TextIOWrapper_seekable_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_seekable(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_seekable_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io_TextIOWrapper_readable, METH_NOARGS, _io_TextIOWrapper_readable__doc__},
+
+static PyObject *
+_io_TextIOWrapper_readable_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_readable(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_readable_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io_TextIOWrapper_writable, METH_NOARGS, _io_TextIOWrapper_writable__doc__},
+
+static PyObject *
+_io_TextIOWrapper_writable_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_writable(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_writable_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_isatty__doc__,
+"isatty($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)_io_TextIOWrapper_isatty, METH_NOARGS, _io_TextIOWrapper_isatty__doc__},
+
+static PyObject *
+_io_TextIOWrapper_isatty_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_isatty(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_isatty_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_io_TextIOWrapper_flush, METH_NOARGS, _io_TextIOWrapper_flush__doc__},
+
+static PyObject *
+_io_TextIOWrapper_flush_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_flush(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_flush_impl(self);
+}
+
+PyDoc_STRVAR(_io_TextIOWrapper_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n");
+
+#define _IO_TEXTIOWRAPPER_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_io_TextIOWrapper_close, METH_NOARGS, _io_TextIOWrapper_close__doc__},
+
+static PyObject *
+_io_TextIOWrapper_close_impl(textio *self);
+
+static PyObject *
+_io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io_TextIOWrapper_close_impl(self);
+}
+/*[clinic end generated code: output=408adcf5b8c5d8a6 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h b/contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h
new file mode 100644
index 00000000000..064ed3814d9
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/clinic/winconsoleio.c.h
@@ -0,0 +1,468 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the console object.\n"
+"\n"
+"A closed console object cannot be used for further I/O operations.\n"
+"close() may be called more than once without error.");
+
+#define _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF \
+ {"close", _PyCFunction_CAST(_io__WindowsConsoleIO_close), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__WindowsConsoleIO_close__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_close_impl(winconsoleio *self, PyTypeObject *cls);
+
+static PyObject *
+_io__WindowsConsoleIO_close(winconsoleio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "close() takes no arguments");
+ return NULL;
+ }
+ return _io__WindowsConsoleIO_close_impl(self, cls);
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO___init____doc__,
+"_WindowsConsoleIO(file, mode=\'r\', closefd=True, opener=None)\n"
+"--\n"
+"\n"
+"Open a console buffer by file descriptor.\n"
+"\n"
+"The mode can be \'rb\' (default), or \'wb\' for reading or writing bytes. All\n"
+"other mode characters will be ignored. Mode \'b\' will be assumed if it is\n"
+"omitted. The *opener* parameter is always ignored.");
+
+static int
+_io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
+ const char *mode, int closefd,
+ PyObject *opener);
+
+static int
+_io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file), &_Py_ID(mode), &_Py_ID(closefd), &_Py_ID(opener), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"file", "mode", "closefd", "opener", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_WindowsConsoleIO",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *nameobj;
+ const char *mode = "r";
+ int closefd = 1;
+ PyObject *opener = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 4, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ nameobj = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[1]) {
+ if (!PyUnicode_Check(fastargs[1])) {
+ _PyArg_BadArgument("_WindowsConsoleIO", "argument 'mode'", "str", fastargs[1]);
+ goto exit;
+ }
+ Py_ssize_t mode_length;
+ mode = PyUnicode_AsUTF8AndSize(fastargs[1], &mode_length);
+ if (mode == NULL) {
+ goto exit;
+ }
+ if (strlen(mode) != (size_t)mode_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[2]) {
+ closefd = PyObject_IsTrue(fastargs[2]);
+ if (closefd < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ opener = fastargs[3];
+skip_optional_pos:
+ return_value = _io__WindowsConsoleIO___init___impl((winconsoleio *)self, nameobj, mode, closefd, opener);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n"
+"Return the underlying file descriptor (an integer).");
+
+#define _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)_io__WindowsConsoleIO_fileno, METH_NOARGS, _io__WindowsConsoleIO_fileno__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_fileno_impl(winconsoleio *self);
+
+static PyObject *
+_io__WindowsConsoleIO_fileno(winconsoleio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__WindowsConsoleIO_fileno_impl(self);
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_readable__doc__,
+"readable($self, /)\n"
+"--\n"
+"\n"
+"True if console is an input buffer.");
+
+#define _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF \
+ {"readable", (PyCFunction)_io__WindowsConsoleIO_readable, METH_NOARGS, _io__WindowsConsoleIO_readable__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_readable_impl(winconsoleio *self);
+
+static PyObject *
+_io__WindowsConsoleIO_readable(winconsoleio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__WindowsConsoleIO_readable_impl(self);
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_writable__doc__,
+"writable($self, /)\n"
+"--\n"
+"\n"
+"True if console is an output buffer.");
+
+#define _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF \
+ {"writable", (PyCFunction)_io__WindowsConsoleIO_writable, METH_NOARGS, _io__WindowsConsoleIO_writable__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_writable_impl(winconsoleio *self);
+
+static PyObject *
+_io__WindowsConsoleIO_writable(winconsoleio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__WindowsConsoleIO_writable_impl(self);
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_readinto__doc__,
+"readinto($self, buffer, /)\n"
+"--\n"
+"\n"
+"Same as RawIOBase.readinto().");
+
+#define _IO__WINDOWSCONSOLEIO_READINTO_METHODDEF \
+ {"readinto", _PyCFunction_CAST(_io__WindowsConsoleIO_readinto), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__WindowsConsoleIO_readinto__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_readinto_impl(winconsoleio *self, PyTypeObject *cls,
+ Py_buffer *buffer);
+
+static PyObject *
+_io__WindowsConsoleIO_readinto(winconsoleio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "readinto",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_buffer buffer = {NULL, NULL};
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &buffer, PyBUF_WRITABLE) < 0) {
+ PyErr_Clear();
+ _PyArg_BadArgument("readinto", "argument 1", "read-write bytes-like object", args[0]);
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("readinto", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ return_value = _io__WindowsConsoleIO_readinto_impl(self, cls, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_readall__doc__,
+"readall($self, /)\n"
+"--\n"
+"\n"
+"Read all data from the console, returned as bytes.\n"
+"\n"
+"Return an empty bytes object at EOF.");
+
+#define _IO__WINDOWSCONSOLEIO_READALL_METHODDEF \
+ {"readall", (PyCFunction)_io__WindowsConsoleIO_readall, METH_NOARGS, _io__WindowsConsoleIO_readall__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_readall_impl(winconsoleio *self);
+
+static PyObject *
+_io__WindowsConsoleIO_readall(winconsoleio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__WindowsConsoleIO_readall_impl(self);
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read at most size bytes, returned as bytes.\n"
+"\n"
+"Only makes one system call when size is a positive integer,\n"
+"so less data may be returned than requested.\n"
+"Return an empty bytes object at EOF.");
+
+#define _IO__WINDOWSCONSOLEIO_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_io__WindowsConsoleIO_read), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__WindowsConsoleIO_read__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_read_impl(winconsoleio *self, PyTypeObject *cls,
+ Py_ssize_t size);
+
+static PyObject *
+_io__WindowsConsoleIO_read(winconsoleio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "read",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t size = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &size)) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = _io__WindowsConsoleIO_read_impl(self, cls, size);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_write__doc__,
+"write($self, b, /)\n"
+"--\n"
+"\n"
+"Write buffer b to file, return number of bytes written.\n"
+"\n"
+"Only makes one system call, so not all of the data may be written.\n"
+"The number of bytes actually written is returned.");
+
+#define _IO__WINDOWSCONSOLEIO_WRITE_METHODDEF \
+ {"write", _PyCFunction_CAST(_io__WindowsConsoleIO_write), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _io__WindowsConsoleIO_write__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_write_impl(winconsoleio *self, PyTypeObject *cls,
+ Py_buffer *b);
+
+static PyObject *
+_io__WindowsConsoleIO_write(winconsoleio *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "write",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_buffer b = {NULL, NULL};
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &b, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&b, 'C')) {
+ _PyArg_BadArgument("write", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ return_value = _io__WindowsConsoleIO_write_impl(self, cls, &b);
+
+exit:
+ /* Cleanup for b */
+ if (b.obj) {
+ PyBuffer_Release(&b);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#if defined(HAVE_WINDOWS_CONSOLE_IO)
+
+PyDoc_STRVAR(_io__WindowsConsoleIO_isatty__doc__,
+"isatty($self, /)\n"
+"--\n"
+"\n"
+"Always True.");
+
+#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)_io__WindowsConsoleIO_isatty, METH_NOARGS, _io__WindowsConsoleIO_isatty__doc__},
+
+static PyObject *
+_io__WindowsConsoleIO_isatty_impl(winconsoleio *self);
+
+static PyObject *
+_io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored))
+{
+ return _io__WindowsConsoleIO_isatty_impl(self);
+}
+
+#endif /* defined(HAVE_WINDOWS_CONSOLE_IO) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_FILENO_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_READABLE_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_READINTO_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_READINTO_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_READINTO_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_READALL_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_READALL_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_READALL_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_READ_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_READ_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_READ_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_WRITE_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_WRITE_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_WRITE_METHODDEF) */
+
+#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
+ #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
+#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
+/*[clinic end generated code: output=9a9f95a1b52c95f9 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_io/fileio.c b/contrib/tools/python3/Modules/_io/fileio.c
new file mode 100644
index 00000000000..bab68077a21
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/fileio.c
@@ -0,0 +1,1230 @@
+/* Author: Daniel Stutzbach */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
+#include "pycore_object.h" // _PyObject_GC_UNTRACK()
+#include "structmember.h" // PyMemberDef
+#include <stdbool.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <stddef.h> /* For offsetof */
+#include "_iomodule.h"
+
+/*
+ * Known likely problems:
+ *
+ * - Files larger then 2**32-1
+ * - Files with unicode filenames
+ * - Passing numbers greater than 2**32-1 when an integer is expected
+ * - Making it work on Windows and other oddball platforms
+ *
+ * To Do:
+ *
+ * - autoconfify header file inclusion
+ */
+
+#ifdef MS_WINDOWS
+/* can simulate truncate with Win32 API functions; see file_truncate */
+#define HAVE_FTRUNCATE
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#endif
+
+#if BUFSIZ < (8*1024)
+#define SMALLCHUNK (8*1024)
+#elif (BUFSIZ >= (2 << 25))
+#error "unreasonable BUFSIZ > 64 MiB defined"
+#else
+#define SMALLCHUNK BUFSIZ
+#endif
+
+/*[clinic input]
+module _io
+class _io.FileIO "fileio *" "clinic_state()->PyFileIO_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ac25ec278f4d6703]*/
+
+typedef struct {
+ PyObject_HEAD
+ int fd;
+ unsigned int created : 1;
+ unsigned int readable : 1;
+ unsigned int writable : 1;
+ unsigned int appending : 1;
+ signed int seekable : 2; /* -1 means unknown */
+ unsigned int closefd : 1;
+ char finalizing;
+ unsigned int blksize;
+ PyObject *weakreflist;
+ PyObject *dict;
+} fileio;
+
+#define PyFileIO_Check(state, op) (PyObject_TypeCheck((op), state->PyFileIO_Type))
+
+/* Forward declarations */
+static PyObject* portable_lseek(fileio *self, PyObject *posobj, int whence, bool suppress_pipe_error);
+
+int
+_PyFileIO_closed(PyObject *self)
+{
+ return ((fileio *)self)->fd < 0;
+}
+
+/* Because this can call arbitrary code, it shouldn't be called when
+ the refcount is 0 (that is, not directly from tp_dealloc unless
+ the refcount has been temporarily re-incremented). */
+static PyObject *
+fileio_dealloc_warn(fileio *self, PyObject *source)
+{
+ if (self->fd >= 0 && self->closefd) {
+ PyObject *exc = PyErr_GetRaisedException();
+ if (PyErr_ResourceWarning(source, 1, "unclosed file %R", source)) {
+ /* Spurious errors can appear at shutdown */
+ if (PyErr_ExceptionMatches(PyExc_Warning))
+ PyErr_WriteUnraisable((PyObject *) self);
+ }
+ PyErr_SetRaisedException(exc);
+ }
+ Py_RETURN_NONE;
+}
+
+/* Returns 0 on success, -1 with exception set on failure. */
+static int
+internal_close(fileio *self)
+{
+ int err = 0;
+ int save_errno = 0;
+ if (self->fd >= 0) {
+ int fd = self->fd;
+ self->fd = -1;
+ /* fd is accessible and someone else may have closed it */
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ err = close(fd);
+ if (err < 0)
+ save_errno = errno;
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ }
+ if (err < 0) {
+ errno = save_errno;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+ return 0;
+}
+
+/*[clinic input]
+_io.FileIO.close
+
+ cls: defining_class
+ /
+
+Close the file.
+
+A closed file cannot be used for further I/O operations. close() may be
+called more than once without error.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_close_impl(fileio *self, PyTypeObject *cls)
+/*[clinic end generated code: output=c30cbe9d1f23ca58 input=70da49e63db7c64d]*/
+{
+ PyObject *res;
+ int rc;
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ res = PyObject_CallMethodOneArg((PyObject*)state->PyRawIOBase_Type,
+ &_Py_ID(close), (PyObject *)self);
+ if (!self->closefd) {
+ self->fd = -1;
+ return res;
+ }
+
+ PyObject *exc = NULL;
+ if (res == NULL) {
+ exc = PyErr_GetRaisedException();
+ }
+ if (self->finalizing) {
+ PyObject *r = fileio_dealloc_warn(self, (PyObject *) self);
+ if (r) {
+ Py_DECREF(r);
+ }
+ else {
+ PyErr_Clear();
+ }
+ }
+ rc = internal_close(self);
+ if (res == NULL) {
+ _PyErr_ChainExceptions1(exc);
+ }
+ if (rc < 0) {
+ Py_CLEAR(res);
+ }
+ return res;
+}
+
+static PyObject *
+fileio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ fileio *self;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+
+ self = (fileio *) type->tp_alloc(type, 0);
+ if (self != NULL) {
+ self->fd = -1;
+ self->created = 0;
+ self->readable = 0;
+ self->writable = 0;
+ self->appending = 0;
+ self->seekable = -1;
+ self->blksize = 0;
+ self->closefd = 1;
+ self->weakreflist = NULL;
+ }
+
+ return (PyObject *) self;
+}
+
+#ifdef O_CLOEXEC
+extern int _Py_open_cloexec_works;
+#endif
+
+/*[clinic input]
+_io.FileIO.__init__
+ file as nameobj: object
+ mode: str = "r"
+ closefd: bool = True
+ opener: object = None
+
+Open a file.
+
+The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
+writing, exclusive creation or appending. The file will be created if it
+doesn't exist when opened for writing or appending; it will be truncated
+when opened for writing. A FileExistsError will be raised if it already
+exists when opened for creating. Opening a file for creating implies
+writing so this mode behaves in a similar way to 'w'.Add a '+' to the mode
+to allow simultaneous reading and writing. A custom opener can be used by
+passing a callable as *opener*. The underlying file descriptor for the file
+object is then obtained by calling opener with (*name*, *flags*).
+*opener* must return an open file descriptor (passing os.open as *opener*
+results in functionality similar to passing None).
+[clinic start generated code]*/
+
+static int
+_io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
+ int closefd, PyObject *opener)
+/*[clinic end generated code: output=23413f68e6484bbd input=588aac967e0ba74b]*/
+{
+#ifdef MS_WINDOWS
+ Py_UNICODE *widename = NULL;
+#else
+ const char *name = NULL;
+#endif
+ PyObject *stringobj = NULL;
+ const char *s;
+ int ret = 0;
+ int rwa = 0, plus = 0;
+ int flags = 0;
+ int fd = -1;
+ int fd_is_own = 0;
+#ifdef O_CLOEXEC
+ int *atomic_flag_works = &_Py_open_cloexec_works;
+#elif !defined(MS_WINDOWS)
+ int *atomic_flag_works = NULL;
+#endif
+ struct _Py_stat_struct fdfstat;
+ int fstat_result;
+ int async_err = 0;
+
+#ifdef Py_DEBUG
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ assert(PyFileIO_Check(state, self));
+#endif
+ if (self->fd >= 0) {
+ if (self->closefd) {
+ /* Have to close the existing file first. */
+ if (internal_close(self) < 0)
+ return -1;
+ }
+ else
+ self->fd = -1;
+ }
+
+ fd = _PyLong_AsInt(nameobj);
+ if (fd < 0) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "negative file descriptor");
+ return -1;
+ }
+ PyErr_Clear();
+ }
+
+ if (fd < 0) {
+#ifdef MS_WINDOWS
+ if (!PyUnicode_FSDecoder(nameobj, &stringobj)) {
+ return -1;
+ }
+ widename = PyUnicode_AsWideCharString(stringobj, NULL);
+ if (widename == NULL)
+ return -1;
+#else
+ if (!PyUnicode_FSConverter(nameobj, &stringobj)) {
+ return -1;
+ }
+ name = PyBytes_AS_STRING(stringobj);
+#endif
+ }
+
+ s = mode;
+ while (*s) {
+ switch (*s++) {
+ case 'x':
+ if (rwa) {
+ bad_mode:
+ PyErr_SetString(PyExc_ValueError,
+ "Must have exactly one of create/read/write/append "
+ "mode and at most one plus");
+ goto error;
+ }
+ rwa = 1;
+ self->created = 1;
+ self->writable = 1;
+ flags |= O_EXCL | O_CREAT;
+ break;
+ case 'r':
+ if (rwa)
+ goto bad_mode;
+ rwa = 1;
+ self->readable = 1;
+ break;
+ case 'w':
+ if (rwa)
+ goto bad_mode;
+ rwa = 1;
+ self->writable = 1;
+ flags |= O_CREAT | O_TRUNC;
+ break;
+ case 'a':
+ if (rwa)
+ goto bad_mode;
+ rwa = 1;
+ self->writable = 1;
+ self->appending = 1;
+ flags |= O_APPEND | O_CREAT;
+ break;
+ case 'b':
+ break;
+ case '+':
+ if (plus)
+ goto bad_mode;
+ self->readable = self->writable = 1;
+ plus = 1;
+ break;
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "invalid mode: %.200s", mode);
+ goto error;
+ }
+ }
+
+ if (!rwa)
+ goto bad_mode;
+
+ if (self->readable && self->writable)
+ flags |= O_RDWR;
+ else if (self->readable)
+ flags |= O_RDONLY;
+ else
+ flags |= O_WRONLY;
+
+#ifdef O_BINARY
+ flags |= O_BINARY;
+#endif
+
+#ifdef MS_WINDOWS
+ flags |= O_NOINHERIT;
+#elif defined(O_CLOEXEC)
+ flags |= O_CLOEXEC;
+#endif
+
+ if (PySys_Audit("open", "Osi", nameobj, mode, flags) < 0) {
+ goto error;
+ }
+
+ if (fd >= 0) {
+ self->fd = fd;
+ self->closefd = closefd;
+ }
+ else {
+ self->closefd = 1;
+ if (!closefd) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot use closefd=False with file name");
+ goto error;
+ }
+
+ errno = 0;
+ if (opener == Py_None) {
+ do {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef MS_WINDOWS
+ self->fd = _wopen(widename, flags, 0666);
+#else
+ self->fd = open(name, flags, 0666);
+#endif
+ Py_END_ALLOW_THREADS
+ } while (self->fd < 0 && errno == EINTR &&
+ !(async_err = PyErr_CheckSignals()));
+
+ if (async_err)
+ goto error;
+
+ if (self->fd < 0) {
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, nameobj);
+ goto error;
+ }
+ }
+ else {
+ PyObject *fdobj;
+
+#ifndef MS_WINDOWS
+ /* the opener may clear the atomic flag */
+ atomic_flag_works = NULL;
+#endif
+
+ fdobj = PyObject_CallFunction(opener, "Oi", nameobj, flags);
+ if (fdobj == NULL)
+ goto error;
+ if (!PyLong_Check(fdobj)) {
+ Py_DECREF(fdobj);
+ PyErr_SetString(PyExc_TypeError,
+ "expected integer from opener");
+ goto error;
+ }
+
+ self->fd = _PyLong_AsInt(fdobj);
+ Py_DECREF(fdobj);
+ if (self->fd < 0) {
+ if (!PyErr_Occurred()) {
+ /* The opener returned a negative but didn't set an
+ exception. See issue #27066 */
+ PyErr_Format(PyExc_ValueError,
+ "opener returned %d", self->fd);
+ }
+ goto error;
+ }
+ }
+ fd_is_own = 1;
+
+#ifndef MS_WINDOWS
+ if (_Py_set_inheritable(self->fd, 0, atomic_flag_works) < 0)
+ goto error;
+#endif
+ }
+
+ self->blksize = DEFAULT_BUFFER_SIZE;
+ Py_BEGIN_ALLOW_THREADS
+ fstat_result = _Py_fstat_noraise(self->fd, &fdfstat);
+ Py_END_ALLOW_THREADS
+ if (fstat_result < 0) {
+ /* Tolerate fstat() errors other than EBADF. See Issue #25717, where
+ an anonymous file on a Virtual Box shared folder filesystem would
+ raise ENOENT. */
+#ifdef MS_WINDOWS
+ if (GetLastError() == ERROR_INVALID_HANDLE) {
+ PyErr_SetFromWindowsErr(0);
+#else
+ if (errno == EBADF) {
+ PyErr_SetFromErrno(PyExc_OSError);
+#endif
+ goto error;
+ }
+ }
+ else {
+#if defined(S_ISDIR) && defined(EISDIR)
+ /* On Unix, open will succeed for directories.
+ In Python, there should be no file objects referring to
+ directories, so we need a check. */
+ if (S_ISDIR(fdfstat.st_mode)) {
+ errno = EISDIR;
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, nameobj);
+ goto error;
+ }
+#endif /* defined(S_ISDIR) */
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ if (fdfstat.st_blksize > 1)
+ self->blksize = fdfstat.st_blksize;
+#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
+ }
+
+#if defined(MS_WINDOWS) || defined(__CYGWIN__)
+ /* don't translate newlines (\r\n <=> \n) */
+ _setmode(self->fd, O_BINARY);
+#endif
+
+ if (PyObject_SetAttr((PyObject *)self, &_Py_ID(name), nameobj) < 0)
+ goto error;
+
+ if (self->appending) {
+ /* For consistent behaviour, we explicitly seek to the
+ end of file (otherwise, it might be done only on the
+ first write()). */
+ PyObject *pos = portable_lseek(self, NULL, 2, true);
+ if (pos == NULL)
+ goto error;
+ Py_DECREF(pos);
+ }
+
+ goto done;
+
+ error:
+ ret = -1;
+ if (!fd_is_own)
+ self->fd = -1;
+ if (self->fd >= 0) {
+ PyObject *exc = PyErr_GetRaisedException();
+ internal_close(self);
+ _PyErr_ChainExceptions1(exc);
+ }
+
+ done:
+#ifdef MS_WINDOWS
+ PyMem_Free(widename);
+#endif
+ Py_CLEAR(stringobj);
+ return ret;
+}
+
+static int
+fileio_traverse(fileio *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static int
+fileio_clear(fileio *self)
+{
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+fileio_dealloc(fileio *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ self->finalizing = 1;
+ if (_PyIOBase_finalize((PyObject *) self) < 0)
+ return;
+ _PyObject_GC_UNTRACK(self);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ (void)fileio_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+err_closed(void)
+{
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed file");
+ return NULL;
+}
+
+static PyObject *
+err_mode(_PyIO_State *state, const char *action)
+{
+ return PyErr_Format(state->unsupported_operation,
+ "File not open for %s", action);
+}
+
+/*[clinic input]
+_io.FileIO.fileno
+
+Return the underlying file descriptor (an integer).
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_fileno_impl(fileio *self)
+/*[clinic end generated code: output=a9626ce5398ece90 input=0b9b2de67335ada3]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+ return PyLong_FromLong((long) self->fd);
+}
+
+/*[clinic input]
+_io.FileIO.readable
+
+True if file was opened in a read mode.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_readable_impl(fileio *self)
+/*[clinic end generated code: output=640744a6150fe9ba input=a3fdfed6eea721c5]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+ return PyBool_FromLong((long) self->readable);
+}
+
+/*[clinic input]
+_io.FileIO.writable
+
+True if file was opened in a write mode.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_writable_impl(fileio *self)
+/*[clinic end generated code: output=96cefc5446e89977 input=c204a808ca2e1748]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+ return PyBool_FromLong((long) self->writable);
+}
+
+/*[clinic input]
+_io.FileIO.seekable
+
+True if file supports random-access.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_seekable_impl(fileio *self)
+/*[clinic end generated code: output=47909ca0a42e9287 input=c8e5554d2fd63c7f]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+ if (self->seekable < 0) {
+ /* portable_lseek() sets the seekable attribute */
+ PyObject *pos = portable_lseek(self, NULL, SEEK_CUR, false);
+ assert(self->seekable >= 0);
+ if (pos == NULL) {
+ PyErr_Clear();
+ }
+ else {
+ Py_DECREF(pos);
+ }
+ }
+ return PyBool_FromLong((long) self->seekable);
+}
+
+/*[clinic input]
+_io.FileIO.readinto
+ cls: defining_class
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+
+Same as RawIOBase.readinto().
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_readinto_impl(fileio *self, PyTypeObject *cls, Py_buffer *buffer)
+/*[clinic end generated code: output=97f0f3d69534db34 input=fd20323e18ce1ec8]*/
+{
+ Py_ssize_t n;
+ int err;
+
+ if (self->fd < 0)
+ return err_closed();
+ if (!self->readable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return err_mode(state, "reading");
+ }
+
+ n = _Py_read(self->fd, buffer->buf, buffer->len);
+ /* copy errno because PyBuffer_Release() can indirectly modify it */
+ err = errno;
+
+ if (n == -1) {
+ if (err == EAGAIN) {
+ PyErr_Clear();
+ Py_RETURN_NONE;
+ }
+ return NULL;
+ }
+
+ return PyLong_FromSsize_t(n);
+}
+
+static size_t
+new_buffersize(fileio *self, size_t currentsize)
+{
+ size_t addend;
+
+ /* Expand the buffer by an amount proportional to the current size,
+ giving us amortized linear-time behavior. For bigger sizes, use a
+ less-than-double growth factor to avoid excessive allocation. */
+ assert(currentsize <= PY_SSIZE_T_MAX);
+ if (currentsize > 65536)
+ addend = currentsize >> 3;
+ else
+ addend = 256 + currentsize;
+ if (addend < SMALLCHUNK)
+ /* Avoid tiny read() calls. */
+ addend = SMALLCHUNK;
+ return addend + currentsize;
+}
+
+/*[clinic input]
+_io.FileIO.readall
+
+Read all data from the file, returned as bytes.
+
+In non-blocking mode, returns as much as is immediately available,
+or None if no data is available. Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_readall_impl(fileio *self)
+/*[clinic end generated code: output=faa0292b213b4022 input=dbdc137f55602834]*/
+{
+ struct _Py_stat_struct status;
+ Py_off_t pos, end;
+ PyObject *result;
+ Py_ssize_t bytes_read = 0;
+ Py_ssize_t n;
+ size_t bufsize;
+ int fstat_result;
+
+ if (self->fd < 0)
+ return err_closed();
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef MS_WINDOWS
+ pos = _lseeki64(self->fd, 0L, SEEK_CUR);
+#else
+ pos = lseek(self->fd, 0L, SEEK_CUR);
+#endif
+ _Py_END_SUPPRESS_IPH
+ fstat_result = _Py_fstat_noraise(self->fd, &status);
+ Py_END_ALLOW_THREADS
+
+ if (fstat_result == 0)
+ end = status.st_size;
+ else
+ end = (Py_off_t)-1;
+
+ if (end > 0 && end >= pos && pos >= 0 && end - pos < PY_SSIZE_T_MAX) {
+ /* This is probably a real file, so we try to allocate a
+ buffer one byte larger than the rest of the file. If the
+ calculation is right then we should get EOF without having
+ to enlarge the buffer. */
+ bufsize = (size_t)(end - pos + 1);
+ } else {
+ bufsize = SMALLCHUNK;
+ }
+
+ result = PyBytes_FromStringAndSize(NULL, bufsize);
+ if (result == NULL)
+ return NULL;
+
+ while (1) {
+ if (bytes_read >= (Py_ssize_t)bufsize) {
+ bufsize = new_buffersize(self, bytes_read);
+ if (bufsize > PY_SSIZE_T_MAX || bufsize <= 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "unbounded read returned more bytes "
+ "than a Python bytes object can hold");
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ if (PyBytes_GET_SIZE(result) < (Py_ssize_t)bufsize) {
+ if (_PyBytes_Resize(&result, bufsize) < 0)
+ return NULL;
+ }
+ }
+
+ n = _Py_read(self->fd,
+ PyBytes_AS_STRING(result) + bytes_read,
+ bufsize - bytes_read);
+
+ if (n == 0)
+ break;
+ if (n == -1) {
+ if (errno == EAGAIN) {
+ PyErr_Clear();
+ if (bytes_read > 0)
+ break;
+ Py_DECREF(result);
+ Py_RETURN_NONE;
+ }
+ Py_DECREF(result);
+ return NULL;
+ }
+ bytes_read += n;
+ pos += n;
+ }
+
+ if (PyBytes_GET_SIZE(result) > bytes_read) {
+ if (_PyBytes_Resize(&result, bytes_read) < 0)
+ return NULL;
+ }
+ return result;
+}
+
+/*[clinic input]
+_io.FileIO.read
+ cls: defining_class
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read at most size bytes, returned as bytes.
+
+Only makes one system call, so less data may be returned than requested.
+In non-blocking mode, returns None if no data is available.
+Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_read_impl(fileio *self, PyTypeObject *cls, Py_ssize_t size)
+/*[clinic end generated code: output=bbd749c7c224143e input=f613d2057e4a1918]*/
+{
+ char *ptr;
+ Py_ssize_t n;
+ PyObject *bytes;
+
+ if (self->fd < 0)
+ return err_closed();
+ if (!self->readable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return err_mode(state, "reading");
+ }
+
+ if (size < 0)
+ return _io_FileIO_readall_impl(self);
+
+ if (size > _PY_READ_MAX) {
+ size = _PY_READ_MAX;
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, size);
+ if (bytes == NULL)
+ return NULL;
+ ptr = PyBytes_AS_STRING(bytes);
+
+ n = _Py_read(self->fd, ptr, size);
+ if (n == -1) {
+ /* copy errno because Py_DECREF() can indirectly modify it */
+ int err = errno;
+ Py_DECREF(bytes);
+ if (err == EAGAIN) {
+ PyErr_Clear();
+ Py_RETURN_NONE;
+ }
+ return NULL;
+ }
+
+ if (n != size) {
+ if (_PyBytes_Resize(&bytes, n) < 0) {
+ Py_CLEAR(bytes);
+ return NULL;
+ }
+ }
+
+ return (PyObject *) bytes;
+}
+
+/*[clinic input]
+_io.FileIO.write
+ cls: defining_class
+ b: Py_buffer
+ /
+
+Write buffer b to file, return number of bytes written.
+
+Only makes one system call, so not all of the data may be written.
+The number of bytes actually written is returned. In non-blocking mode,
+returns None if the write would block.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_write_impl(fileio *self, PyTypeObject *cls, Py_buffer *b)
+/*[clinic end generated code: output=927e25be80f3b77b input=2776314f043088f5]*/
+{
+ Py_ssize_t n;
+ int err;
+
+ if (self->fd < 0)
+ return err_closed();
+ if (!self->writable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return err_mode(state, "writing");
+ }
+
+ n = _Py_write(self->fd, b->buf, b->len);
+ /* copy errno because PyBuffer_Release() can indirectly modify it */
+ err = errno;
+
+ if (n < 0) {
+ if (err == EAGAIN) {
+ PyErr_Clear();
+ Py_RETURN_NONE;
+ }
+ return NULL;
+ }
+
+ return PyLong_FromSsize_t(n);
+}
+
+/* XXX Windows support below is likely incomplete */
+
+/* Cribbed from posix_lseek() */
+static PyObject *
+portable_lseek(fileio *self, PyObject *posobj, int whence, bool suppress_pipe_error)
+{
+ Py_off_t pos, res;
+ int fd = self->fd;
+
+#ifdef SEEK_SET
+ /* Turn 0, 1, 2 into SEEK_{SET,CUR,END} */
+ switch (whence) {
+#if SEEK_SET != 0
+ case 0: whence = SEEK_SET; break;
+#endif
+#if SEEK_CUR != 1
+ case 1: whence = SEEK_CUR; break;
+#endif
+#if SEEK_END != 2
+ case 2: whence = SEEK_END; break;
+#endif
+ }
+#endif /* SEEK_SET */
+
+ if (posobj == NULL) {
+ pos = 0;
+ }
+ else {
+#if defined(HAVE_LARGEFILE_SUPPORT)
+ pos = PyLong_AsLongLong(posobj);
+#else
+ pos = PyLong_AsLong(posobj);
+#endif
+ if (PyErr_Occurred())
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef MS_WINDOWS
+ res = _lseeki64(fd, pos, whence);
+#else
+ res = lseek(fd, pos, whence);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ if (self->seekable < 0) {
+ self->seekable = (res >= 0);
+ }
+
+ if (res < 0) {
+ if (suppress_pipe_error && errno == ESPIPE) {
+ res = 0;
+ } else {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ }
+
+#if defined(HAVE_LARGEFILE_SUPPORT)
+ return PyLong_FromLongLong(res);
+#else
+ return PyLong_FromLong(res);
+#endif
+}
+
+/*[clinic input]
+_io.FileIO.seek
+ pos: object
+ whence: int = 0
+ /
+
+Move to new file position and return the file position.
+
+Argument offset is a byte count. Optional argument whence defaults to
+SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
+are SEEK_CUR or 1 (move relative to current position, positive or negative),
+and SEEK_END or 2 (move relative to end of file, usually negative, although
+many platforms allow seeking beyond the end of a file).
+
+Note that not all file objects are seekable.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence)
+/*[clinic end generated code: output=c976acdf054e6655 input=0439194b0774d454]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+
+ return portable_lseek(self, pos, whence, false);
+}
+
+/*[clinic input]
+_io.FileIO.tell
+
+Current file position.
+
+Can raise OSError for non seekable files.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_tell_impl(fileio *self)
+/*[clinic end generated code: output=ffe2147058809d0b input=807e24ead4cec2f9]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+
+ return portable_lseek(self, NULL, 1, false);
+}
+
+#ifdef HAVE_FTRUNCATE
+/*[clinic input]
+_io.FileIO.truncate
+ cls: defining_class
+ size as posobj: object = None
+ /
+
+Truncate the file to at most size bytes and return the truncated size.
+
+Size defaults to the current file position, as returned by tell().
+The current file position is changed to the value of size.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_truncate_impl(fileio *self, PyTypeObject *cls, PyObject *posobj)
+/*[clinic end generated code: output=d936732a49e8d5a2 input=c367fb45d6bb2c18]*/
+{
+ Py_off_t pos;
+ int ret;
+ int fd;
+
+ fd = self->fd;
+ if (fd < 0)
+ return err_closed();
+ if (!self->writable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return err_mode(state, "writing");
+ }
+
+ if (posobj == Py_None) {
+ /* Get the current position. */
+ posobj = portable_lseek(self, NULL, 1, false);
+ if (posobj == NULL)
+ return NULL;
+ }
+ else {
+ Py_INCREF(posobj);
+ }
+
+#if defined(HAVE_LARGEFILE_SUPPORT)
+ pos = PyLong_AsLongLong(posobj);
+#else
+ pos = PyLong_AsLong(posobj);
+#endif
+ if (PyErr_Occurred()){
+ Py_DECREF(posobj);
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ errno = 0;
+#ifdef MS_WINDOWS
+ ret = _chsize_s(fd, pos);
+#else
+ ret = ftruncate(fd, pos);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ if (ret != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ Py_DECREF(posobj);
+ return NULL;
+ }
+
+ return posobj;
+}
+#endif /* HAVE_FTRUNCATE */
+
+static const char *
+mode_string(fileio *self)
+{
+ if (self->created) {
+ if (self->readable)
+ return "xb+";
+ else
+ return "xb";
+ }
+ if (self->appending) {
+ if (self->readable)
+ return "ab+";
+ else
+ return "ab";
+ }
+ else if (self->readable) {
+ if (self->writable)
+ return "rb+";
+ else
+ return "rb";
+ }
+ else
+ return "wb";
+}
+
+static PyObject *
+fileio_repr(fileio *self)
+{
+ PyObject *nameobj, *res;
+
+ if (self->fd < 0)
+ return PyUnicode_FromFormat("<_io.FileIO [closed]>");
+
+ if (_PyObject_LookupAttr((PyObject *) self, &_Py_ID(name), &nameobj) < 0) {
+ return NULL;
+ }
+ if (nameobj == NULL) {
+ res = PyUnicode_FromFormat(
+ "<_io.FileIO fd=%d mode='%s' closefd=%s>",
+ self->fd, mode_string(self), self->closefd ? "True" : "False");
+ }
+ else {
+ int status = Py_ReprEnter((PyObject *)self);
+ res = NULL;
+ if (status == 0) {
+ res = PyUnicode_FromFormat(
+ "<_io.FileIO name=%R mode='%s' closefd=%s>",
+ nameobj, mode_string(self), self->closefd ? "True" : "False");
+ Py_ReprLeave((PyObject *)self);
+ }
+ else if (status > 0) {
+ PyErr_Format(PyExc_RuntimeError,
+ "reentrant call inside %s.__repr__",
+ Py_TYPE(self)->tp_name);
+ }
+ Py_DECREF(nameobj);
+ }
+ return res;
+}
+
+/*[clinic input]
+_io.FileIO.isatty
+
+True if the file is connected to a TTY device.
+[clinic start generated code]*/
+
+static PyObject *
+_io_FileIO_isatty_impl(fileio *self)
+/*[clinic end generated code: output=932c39924e9a8070 input=cd94ca1f5e95e843]*/
+{
+ long res;
+
+ if (self->fd < 0)
+ return err_closed();
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ res = isatty(self->fd);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ return PyBool_FromLong(res);
+}
+
+#include "clinic/fileio.c.h"
+
+static PyMethodDef fileio_methods[] = {
+ _IO_FILEIO_READ_METHODDEF
+ _IO_FILEIO_READALL_METHODDEF
+ _IO_FILEIO_READINTO_METHODDEF
+ _IO_FILEIO_WRITE_METHODDEF
+ _IO_FILEIO_SEEK_METHODDEF
+ _IO_FILEIO_TELL_METHODDEF
+ _IO_FILEIO_TRUNCATE_METHODDEF
+ _IO_FILEIO_CLOSE_METHODDEF
+ _IO_FILEIO_SEEKABLE_METHODDEF
+ _IO_FILEIO_READABLE_METHODDEF
+ _IO_FILEIO_WRITABLE_METHODDEF
+ _IO_FILEIO_FILENO_METHODDEF
+ _IO_FILEIO_ISATTY_METHODDEF
+ {"_dealloc_warn", (PyCFunction)fileio_dealloc_warn, METH_O, NULL},
+ {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {NULL, NULL} /* sentinel */
+};
+
+/* 'closed' and 'mode' are attributes for backwards compatibility reasons. */
+
+static PyObject *
+get_closed(fileio *self, void *closure)
+{
+ return PyBool_FromLong((long)(self->fd < 0));
+}
+
+static PyObject *
+get_closefd(fileio *self, void *closure)
+{
+ return PyBool_FromLong((long)(self->closefd));
+}
+
+static PyObject *
+get_mode(fileio *self, void *closure)
+{
+ return PyUnicode_FromString(mode_string(self));
+}
+
+static PyGetSetDef fileio_getsetlist[] = {
+ {"closed", (getter)get_closed, NULL, "True if the file is closed"},
+ {"closefd", (getter)get_closefd, NULL,
+ "True if the file descriptor will be closed by close()."},
+ {"mode", (getter)get_mode, NULL, "String giving the file mode"},
+ {NULL},
+};
+
+static PyMemberDef fileio_members[] = {
+ {"_blksize", T_UINT, offsetof(fileio, blksize), 0},
+ {"_finalizing", T_BOOL, offsetof(fileio, finalizing), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(fileio, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(fileio, dict), READONLY},
+ {NULL}
+};
+
+static PyType_Slot fileio_slots[] = {
+ {Py_tp_dealloc, fileio_dealloc},
+ {Py_tp_repr, fileio_repr},
+ {Py_tp_doc, (void *)_io_FileIO___init____doc__},
+ {Py_tp_traverse, fileio_traverse},
+ {Py_tp_clear, fileio_clear},
+ {Py_tp_methods, fileio_methods},
+ {Py_tp_members, fileio_members},
+ {Py_tp_getset, fileio_getsetlist},
+ {Py_tp_init, _io_FileIO___init__},
+ {Py_tp_new, fileio_new},
+ {0, NULL},
+};
+
+PyType_Spec fileio_spec = {
+ .name = "_io.FileIO",
+ .basicsize = sizeof(fileio),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = fileio_slots,
+};
diff --git a/contrib/tools/python3/Modules/_io/iobase.c b/contrib/tools/python3/Modules/_io/iobase.c
new file mode 100644
index 00000000000..bc2c9afa016
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/iobase.c
@@ -0,0 +1,1061 @@
+/*
+ An implementation of the I/O abstract base classes hierarchy
+ as defined by PEP 3116 - "New I/O"
+
+ Classes defined here: IOBase, RawIOBase.
+
+ Written by Amaury Forgeot d'Arc and Antoine Pitrou
+*/
+
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_long.h" // _PyLong_GetOne()
+#include "pycore_object.h"
+#include <stddef.h> // offsetof()
+#include "_iomodule.h"
+
+/*[clinic input]
+module _io
+class _io._IOBase "PyObject *" "clinic_state()->PyIOBase_Type"
+class _io._RawIOBase "PyObject *" "clinic_state()->PyRawIOBase_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=9006b7802ab8ea85]*/
+
+/*
+ * IOBase class, an abstract class
+ */
+
+typedef struct {
+ PyObject_HEAD
+
+ PyObject *dict;
+ PyObject *weakreflist;
+} iobase;
+
+PyDoc_STRVAR(iobase_doc,
+ "The abstract base class for all I/O classes.\n"
+ "\n"
+ "This class provides dummy implementations for many methods that\n"
+ "derived classes can override selectively; the default implementations\n"
+ "represent a file that cannot be read, written or seeked.\n"
+ "\n"
+ "Even though IOBase does not declare read, readinto, or write because\n"
+ "their signatures will vary, implementations and clients should\n"
+ "consider those methods part of the interface. Also, implementations\n"
+ "may raise UnsupportedOperation when operations they do not support are\n"
+ "called.\n"
+ "\n"
+ "The basic type used for binary data read from or written to a file is\n"
+ "bytes. Other bytes-like objects are accepted as method arguments too.\n"
+ "In some cases (such as readinto), a writable object is required. Text\n"
+ "I/O classes work with str data.\n"
+ "\n"
+ "Note that calling any method (except additional calls to close(),\n"
+ "which are ignored) on a closed stream should raise a ValueError.\n"
+ "\n"
+ "IOBase (and its subclasses) support the iterator protocol, meaning\n"
+ "that an IOBase object can be iterated over yielding the lines in a\n"
+ "stream.\n"
+ "\n"
+ "IOBase also supports the :keyword:`with` statement. In this example,\n"
+ "fp is closed after the suite of the with statement is complete:\n"
+ "\n"
+ "with open('spam.txt', 'r') as fp:\n"
+ " fp.write('Spam and eggs!')\n");
+
+/* Use this macro whenever you want to check the internal `closed` status
+ of the IOBase object rather than the virtual `closed` attribute as returned
+ by whatever subclass. */
+
+
+/* Internal methods */
+static PyObject *
+iobase_unsupported(_PyIO_State *state, const char *message)
+{
+ PyErr_SetString(state->unsupported_operation, message);
+ return NULL;
+}
+
+/* Positioning */
+
+/*[clinic input]
+_io._IOBase.seek
+ cls: defining_class
+ offset: int(unused=True)
+ The stream position, relative to 'whence'.
+ whence: int(unused=True, c_default='0') = os.SEEK_SET
+ The relative position to seek from.
+ /
+
+Change the stream position to the given byte offset.
+
+The offset is interpreted relative to the position indicated by whence.
+Values for whence are:
+
+* os.SEEK_SET or 0 -- start of stream (the default); offset should be zero or positive
+* os.SEEK_CUR or 1 -- current stream position; offset may be negative
+* os.SEEK_END or 2 -- end of stream; offset is usually negative
+
+Return the new absolute position.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_seek_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(offset), int Py_UNUSED(whence))
+/*[clinic end generated code: output=8bd74ea6538ded53 input=74211232b363363e]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return iobase_unsupported(state, "seek");
+}
+
+/*[clinic input]
+_io._IOBase.tell
+
+Return current stream position.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_tell_impl(PyObject *self)
+/*[clinic end generated code: output=89a1c0807935abe2 input=04e615fec128801f]*/
+{
+ return _PyObject_CallMethod(self, &_Py_ID(seek), "ii", 0, 1);
+}
+
+/*[clinic input]
+_io._IOBase.truncate
+ cls: defining_class
+ size: object(unused=True) = None
+ /
+
+Truncate file to size bytes.
+
+File pointer is left unchanged. Size defaults to the current IO position
+as reported by tell(). Return the new size.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_truncate_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *Py_UNUSED(size))
+/*[clinic end generated code: output=2013179bff1fe8ef input=660ac20936612c27]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return iobase_unsupported(state, "truncate");
+}
+
+static int
+iobase_is_closed(PyObject *self)
+{
+ PyObject *res;
+ int ret;
+ /* This gets the derived attribute, which is *not* __IOBase_closed
+ in most cases! */
+ ret = _PyObject_LookupAttr(self, &_Py_ID(__IOBase_closed), &res);
+ Py_XDECREF(res);
+ return ret;
+}
+
+/* Flush and close methods */
+
+/*[clinic input]
+_io._IOBase.flush
+
+Flush write buffers, if applicable.
+
+This is not implemented for read-only and non-blocking streams.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_flush_impl(PyObject *self)
+/*[clinic end generated code: output=7cef4b4d54656a3b input=773be121abe270aa]*/
+{
+ /* XXX Should this return the number of bytes written??? */
+ int closed = iobase_is_closed(self);
+
+ if (!closed) {
+ Py_RETURN_NONE;
+ }
+ if (closed > 0) {
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed file.");
+ }
+ return NULL;
+}
+
+static PyObject *
+iobase_closed_get(PyObject *self, void *context)
+{
+ int closed = iobase_is_closed(self);
+ if (closed < 0) {
+ return NULL;
+ }
+ return PyBool_FromLong(closed);
+}
+
+static int
+iobase_check_closed(PyObject *self)
+{
+ PyObject *res;
+ int closed;
+ /* This gets the derived attribute, which is *not* __IOBase_closed
+ in most cases! */
+ closed = _PyObject_LookupAttr(self, &_Py_ID(closed), &res);
+ if (closed > 0) {
+ closed = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (closed > 0) {
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed file.");
+ return -1;
+ }
+ }
+ return closed;
+}
+
+PyObject *
+_PyIOBase_check_closed(PyObject *self, PyObject *args)
+{
+ if (iobase_check_closed(self)) {
+ return NULL;
+ }
+ if (args == Py_True) {
+ return Py_None;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+iobase_check_seekable(PyObject *self, PyObject *args)
+{
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ return _PyIOBase_check_seekable(state, self, args);
+}
+
+static PyObject *
+iobase_check_readable(PyObject *self, PyObject *args)
+{
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ return _PyIOBase_check_readable(state, self, args);
+}
+
+static PyObject *
+iobase_check_writable(PyObject *self, PyObject *args)
+{
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ return _PyIOBase_check_writable(state, self, args);
+}
+
+PyObject *
+_PyIOBase_cannot_pickle(PyObject *self, PyObject *args)
+{
+ PyErr_Format(PyExc_TypeError,
+ "cannot pickle '%.100s' instances", _PyType_Name(Py_TYPE(self)));
+ return NULL;
+}
+
+/* XXX: IOBase thinks it has to maintain its own internal state in
+ `__IOBase_closed` and call flush() by itself, but it is redundant with
+ whatever behaviour a non-trivial derived class will implement. */
+
+/*[clinic input]
+_io._IOBase.close
+
+Flush and close the IO object.
+
+This method has no effect if the file is already closed.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_close_impl(PyObject *self)
+/*[clinic end generated code: output=63c6a6f57d783d6d input=f4494d5c31dbc6b7]*/
+{
+ int rc, closed = iobase_is_closed(self);
+
+ if (closed < 0) {
+ return NULL;
+ }
+ if (closed) {
+ Py_RETURN_NONE;
+ }
+
+ PyObject *res = PyObject_CallMethodNoArgs(self, &_Py_ID(flush));
+
+ PyObject *exc = PyErr_GetRaisedException();
+ rc = PyObject_SetAttr(self, &_Py_ID(__IOBase_closed), Py_True);
+ _PyErr_ChainExceptions1(exc);
+ if (rc < 0) {
+ Py_CLEAR(res);
+ }
+
+ if (res == NULL)
+ return NULL;
+
+ Py_DECREF(res);
+ Py_RETURN_NONE;
+}
+
+/* Finalization and garbage collection support */
+
+static void
+iobase_finalize(PyObject *self)
+{
+ PyObject *res;
+ int closed;
+
+ /* Save the current exception, if any. */
+ PyObject *exc = PyErr_GetRaisedException();
+
+ /* If `closed` doesn't exist or can't be evaluated as bool, then the
+ object is probably in an unusable state, so ignore. */
+ if (_PyObject_LookupAttr(self, &_Py_ID(closed), &res) <= 0) {
+ PyErr_Clear();
+ closed = -1;
+ }
+ else {
+ closed = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (closed == -1)
+ PyErr_Clear();
+ }
+ if (closed == 0) {
+ /* Signal close() that it was called as part of the object
+ finalization process. */
+ if (PyObject_SetAttr(self, &_Py_ID(_finalizing), Py_True))
+ PyErr_Clear();
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(close));
+ /* Silencing I/O errors is bad, but printing spurious tracebacks is
+ equally as bad, and potentially more frequent (because of
+ shutdown issues). */
+ if (res == NULL) {
+#ifndef Py_DEBUG
+ if (_Py_GetConfig()->dev_mode) {
+ PyErr_WriteUnraisable(self);
+ }
+ else {
+ PyErr_Clear();
+ }
+#else
+ PyErr_WriteUnraisable(self);
+#endif
+ }
+ else {
+ Py_DECREF(res);
+ }
+ }
+
+ /* Restore the saved exception. */
+ PyErr_SetRaisedException(exc);
+}
+
+int
+_PyIOBase_finalize(PyObject *self)
+{
+ int is_zombie;
+
+ /* If _PyIOBase_finalize() is called from a destructor, we need to
+ resurrect the object as calling close() can invoke arbitrary code. */
+ is_zombie = (Py_REFCNT(self) == 0);
+ if (is_zombie)
+ return PyObject_CallFinalizerFromDealloc(self);
+ else {
+ PyObject_CallFinalizer(self);
+ return 0;
+ }
+}
+
+static int
+iobase_traverse(iobase *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static int
+iobase_clear(iobase *self)
+{
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+/* Destructor */
+
+static void
+iobase_dealloc(iobase *self)
+{
+ /* NOTE: since IOBaseObject has its own dict, Python-defined attributes
+ are still available here for close() to use.
+ However, if the derived class declares a __slots__, those slots are
+ already gone.
+ */
+ if (_PyIOBase_finalize((PyObject *) self) < 0) {
+ /* When called from a heap type's dealloc, the type will be
+ decref'ed on return (see e.g. subtype_dealloc in typeobject.c). */
+ if (_PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE)) {
+ Py_INCREF(Py_TYPE(self));
+ }
+ return;
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ _PyObject_GC_UNTRACK(self);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ Py_CLEAR(self->dict);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+/* Inquiry methods */
+
+/*[clinic input]
+_io._IOBase.seekable
+
+Return whether object supports random access.
+
+If False, seek(), tell() and truncate() will raise OSError.
+This method may need to do a test seek().
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_seekable_impl(PyObject *self)
+/*[clinic end generated code: output=4c24c67f5f32a43d input=b976622f7fdf3063]*/
+{
+ Py_RETURN_FALSE;
+}
+
+PyObject *
+_PyIOBase_check_seekable(_PyIO_State *state, PyObject *self, PyObject *args)
+{
+ PyObject *res = PyObject_CallMethodNoArgs(self, &_Py_ID(seekable));
+ if (res == NULL)
+ return NULL;
+ if (res != Py_True) {
+ Py_CLEAR(res);
+ iobase_unsupported(state, "File or stream is not seekable.");
+ return NULL;
+ }
+ if (args == Py_True) {
+ Py_DECREF(res);
+ }
+ return res;
+}
+
+/*[clinic input]
+_io._IOBase.readable
+
+Return whether object was opened for reading.
+
+If False, read() will raise OSError.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_readable_impl(PyObject *self)
+/*[clinic end generated code: output=e48089250686388b input=285b3b866a0ec35f]*/
+{
+ Py_RETURN_FALSE;
+}
+
+/* May be called with any object */
+PyObject *
+_PyIOBase_check_readable(_PyIO_State *state, PyObject *self, PyObject *args)
+{
+ PyObject *res = PyObject_CallMethodNoArgs(self, &_Py_ID(readable));
+ if (res == NULL)
+ return NULL;
+ if (res != Py_True) {
+ Py_CLEAR(res);
+ iobase_unsupported(state, "File or stream is not readable.");
+ return NULL;
+ }
+ if (args == Py_True) {
+ Py_DECREF(res);
+ }
+ return res;
+}
+
+/*[clinic input]
+_io._IOBase.writable
+
+Return whether object was opened for writing.
+
+If False, write() will raise OSError.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_writable_impl(PyObject *self)
+/*[clinic end generated code: output=406001d0985be14f input=9dcac18a013a05b5]*/
+{
+ Py_RETURN_FALSE;
+}
+
+/* May be called with any object */
+PyObject *
+_PyIOBase_check_writable(_PyIO_State *state, PyObject *self, PyObject *args)
+{
+ PyObject *res = PyObject_CallMethodNoArgs(self, &_Py_ID(writable));
+ if (res == NULL)
+ return NULL;
+ if (res != Py_True) {
+ Py_CLEAR(res);
+ iobase_unsupported(state, "File or stream is not writable.");
+ return NULL;
+ }
+ if (args == Py_True) {
+ Py_DECREF(res);
+ }
+ return res;
+}
+
+/* Context manager */
+
+static PyObject *
+iobase_enter(PyObject *self, PyObject *args)
+{
+ if (iobase_check_closed(self))
+ return NULL;
+
+ return Py_NewRef(self);
+}
+
+static PyObject *
+iobase_exit(PyObject *self, PyObject *args)
+{
+ return PyObject_CallMethodNoArgs(self, &_Py_ID(close));
+}
+
+/* Lower-level APIs */
+
+/* XXX Should these be present even if unimplemented? */
+
+/*[clinic input]
+_io._IOBase.fileno
+ cls: defining_class
+ /
+
+Return underlying file descriptor if one exists.
+
+Raise OSError if the IO object does not use a file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_fileno_impl(PyObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=7caaa32a6f4ada3d input=1927c8bea5c85099]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return iobase_unsupported(state, "fileno");
+}
+
+/*[clinic input]
+_io._IOBase.isatty
+
+Return whether this is an 'interactive' stream.
+
+Return False if it can't be determined.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_isatty_impl(PyObject *self)
+/*[clinic end generated code: output=60cab77cede41cdd input=9ef76530d368458b]*/
+{
+ if (iobase_check_closed(self))
+ return NULL;
+ Py_RETURN_FALSE;
+}
+
+/* Readline(s) and writelines */
+
+/*[clinic input]
+_io._IOBase.readline
+ size as limit: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read and return a line from the stream.
+
+If size is specified, at most size bytes will be read.
+
+The line terminator is always b'\n' for binary files; for text
+files, the newlines argument to open can be used to select the line
+terminator(s) recognized.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit)
+/*[clinic end generated code: output=4479f79b58187840 input=d0c596794e877bff]*/
+{
+ /* For backwards compatibility, a (slowish) readline(). */
+
+ PyObject *peek, *buffer, *result;
+ Py_ssize_t old_size = -1;
+
+ if (_PyObject_LookupAttr(self, &_Py_ID(peek), &peek) < 0) {
+ return NULL;
+ }
+
+ buffer = PyByteArray_FromStringAndSize(NULL, 0);
+ if (buffer == NULL) {
+ Py_XDECREF(peek);
+ return NULL;
+ }
+
+ while (limit < 0 || PyByteArray_GET_SIZE(buffer) < limit) {
+ Py_ssize_t nreadahead = 1;
+ PyObject *b;
+
+ if (peek != NULL) {
+ PyObject *readahead = PyObject_CallOneArg(peek, _PyLong_GetOne());
+ if (readahead == NULL) {
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals()
+ when EINTR occurs so we needn't do it ourselves. */
+ if (_PyIO_trap_eintr()) {
+ continue;
+ }
+ goto fail;
+ }
+ if (!PyBytes_Check(readahead)) {
+ PyErr_Format(PyExc_OSError,
+ "peek() should have returned a bytes object, "
+ "not '%.200s'", Py_TYPE(readahead)->tp_name);
+ Py_DECREF(readahead);
+ goto fail;
+ }
+ if (PyBytes_GET_SIZE(readahead) > 0) {
+ Py_ssize_t n = 0;
+ const char *buf = PyBytes_AS_STRING(readahead);
+ if (limit >= 0) {
+ do {
+ if (n >= PyBytes_GET_SIZE(readahead) || n >= limit)
+ break;
+ if (buf[n++] == '\n')
+ break;
+ } while (1);
+ }
+ else {
+ do {
+ if (n >= PyBytes_GET_SIZE(readahead))
+ break;
+ if (buf[n++] == '\n')
+ break;
+ } while (1);
+ }
+ nreadahead = n;
+ }
+ Py_DECREF(readahead);
+ }
+
+ b = _PyObject_CallMethod(self, &_Py_ID(read), "n", nreadahead);
+ if (b == NULL) {
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals()
+ when EINTR occurs so we needn't do it ourselves. */
+ if (_PyIO_trap_eintr()) {
+ continue;
+ }
+ goto fail;
+ }
+ if (!PyBytes_Check(b)) {
+ PyErr_Format(PyExc_OSError,
+ "read() should have returned a bytes object, "
+ "not '%.200s'", Py_TYPE(b)->tp_name);
+ Py_DECREF(b);
+ goto fail;
+ }
+ if (PyBytes_GET_SIZE(b) == 0) {
+ Py_DECREF(b);
+ break;
+ }
+
+ old_size = PyByteArray_GET_SIZE(buffer);
+ if (PyByteArray_Resize(buffer, old_size + PyBytes_GET_SIZE(b)) < 0) {
+ Py_DECREF(b);
+ goto fail;
+ }
+ memcpy(PyByteArray_AS_STRING(buffer) + old_size,
+ PyBytes_AS_STRING(b), PyBytes_GET_SIZE(b));
+
+ Py_DECREF(b);
+
+ if (PyByteArray_AS_STRING(buffer)[PyByteArray_GET_SIZE(buffer) - 1] == '\n')
+ break;
+ }
+
+ result = PyBytes_FromStringAndSize(PyByteArray_AS_STRING(buffer),
+ PyByteArray_GET_SIZE(buffer));
+ Py_XDECREF(peek);
+ Py_DECREF(buffer);
+ return result;
+ fail:
+ Py_XDECREF(peek);
+ Py_DECREF(buffer);
+ return NULL;
+}
+
+static PyObject *
+iobase_iter(PyObject *self)
+{
+ if (iobase_check_closed(self))
+ return NULL;
+
+ return Py_NewRef(self);
+}
+
+static PyObject *
+iobase_iternext(PyObject *self)
+{
+ PyObject *line = PyObject_CallMethodNoArgs(self, &_Py_ID(readline));
+
+ if (line == NULL)
+ return NULL;
+
+ if (PyObject_Size(line) <= 0) {
+ /* Error or empty */
+ Py_DECREF(line);
+ return NULL;
+ }
+
+ return line;
+}
+
+/*[clinic input]
+_io._IOBase.readlines
+ hint: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Return a list of lines from the stream.
+
+hint can be specified to control the number of lines read: no more
+lines will be read if the total size (in bytes/characters) of all
+lines so far exceeds hint.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
+/*[clinic end generated code: output=2f50421677fa3dea input=9400c786ea9dc416]*/
+{
+ Py_ssize_t length = 0;
+ PyObject *result, *it = NULL;
+
+ result = PyList_New(0);
+ if (result == NULL)
+ return NULL;
+
+ if (hint <= 0) {
+ /* XXX special-casing this made sense in the Python version in order
+ to remove the bytecode interpretation overhead, but it could
+ probably be removed here. */
+ PyObject *ret = PyObject_CallMethodObjArgs(result, &_Py_ID(extend),
+ self, NULL);
+ if (ret == NULL) {
+ goto error;
+ }
+ Py_DECREF(ret);
+ return result;
+ }
+
+ it = PyObject_GetIter(self);
+ if (it == NULL) {
+ goto error;
+ }
+
+ while (1) {
+ Py_ssize_t line_length;
+ PyObject *line = PyIter_Next(it);
+ if (line == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ else
+ break; /* StopIteration raised */
+ }
+
+ if (PyList_Append(result, line) < 0) {
+ Py_DECREF(line);
+ goto error;
+ }
+ line_length = PyObject_Size(line);
+ Py_DECREF(line);
+ if (line_length < 0) {
+ goto error;
+ }
+ if (line_length > hint - length)
+ break;
+ length += line_length;
+ }
+
+ Py_DECREF(it);
+ return result;
+
+ error:
+ Py_XDECREF(it);
+ Py_DECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+_io._IOBase.writelines
+ lines: object
+ /
+
+Write a list of lines to stream.
+
+Line separators are not added, so it is usual for each of the
+lines provided to have a line separator at the end.
+[clinic start generated code]*/
+
+static PyObject *
+_io__IOBase_writelines(PyObject *self, PyObject *lines)
+/*[clinic end generated code: output=976eb0a9b60a6628 input=cac3fc8864183359]*/
+{
+ PyObject *iter, *res;
+
+ if (iobase_check_closed(self))
+ return NULL;
+
+ iter = PyObject_GetIter(lines);
+ if (iter == NULL)
+ return NULL;
+
+ while (1) {
+ PyObject *line = PyIter_Next(iter);
+ if (line == NULL) {
+ if (PyErr_Occurred()) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ else
+ break; /* Stop Iteration */
+ }
+
+ res = NULL;
+ do {
+ res = PyObject_CallMethodObjArgs(self, &_Py_ID(write), line, NULL);
+ } while (res == NULL && _PyIO_trap_eintr());
+ Py_DECREF(line);
+ if (res == NULL) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ Py_DECREF(res);
+ }
+ Py_DECREF(iter);
+ Py_RETURN_NONE;
+}
+
+#define clinic_state() (find_io_state_by_def(Py_TYPE(self)))
+#include "clinic/iobase.c.h"
+#undef clinic_state
+
+static PyMethodDef iobase_methods[] = {
+ _IO__IOBASE_SEEK_METHODDEF
+ _IO__IOBASE_TELL_METHODDEF
+ _IO__IOBASE_TRUNCATE_METHODDEF
+ _IO__IOBASE_FLUSH_METHODDEF
+ _IO__IOBASE_CLOSE_METHODDEF
+
+ _IO__IOBASE_SEEKABLE_METHODDEF
+ _IO__IOBASE_READABLE_METHODDEF
+ _IO__IOBASE_WRITABLE_METHODDEF
+
+ {"_checkClosed", _PyIOBase_check_closed, METH_NOARGS},
+ {"_checkSeekable", iobase_check_seekable, METH_NOARGS},
+ {"_checkReadable", iobase_check_readable, METH_NOARGS},
+ {"_checkWritable", iobase_check_writable, METH_NOARGS},
+
+ _IO__IOBASE_FILENO_METHODDEF
+ _IO__IOBASE_ISATTY_METHODDEF
+
+ {"__enter__", iobase_enter, METH_NOARGS},
+ {"__exit__", iobase_exit, METH_VARARGS},
+
+ _IO__IOBASE_READLINE_METHODDEF
+ _IO__IOBASE_READLINES_METHODDEF
+ _IO__IOBASE_WRITELINES_METHODDEF
+
+ {NULL, NULL}
+};
+
+static PyGetSetDef iobase_getset[] = {
+ {"__dict__", PyObject_GenericGetDict, NULL, NULL},
+ {"closed", (getter)iobase_closed_get, NULL, NULL},
+ {NULL}
+};
+
+static struct PyMemberDef iobase_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(iobase, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(iobase, dict), READONLY},
+ {NULL},
+};
+
+
+static PyType_Slot iobase_slots[] = {
+ {Py_tp_dealloc, iobase_dealloc},
+ {Py_tp_doc, (void *)iobase_doc},
+ {Py_tp_traverse, iobase_traverse},
+ {Py_tp_clear, iobase_clear},
+ {Py_tp_iter, iobase_iter},
+ {Py_tp_iternext, iobase_iternext},
+ {Py_tp_methods, iobase_methods},
+ {Py_tp_members, iobase_members},
+ {Py_tp_getset, iobase_getset},
+ {Py_tp_finalize, iobase_finalize},
+ {0, NULL},
+};
+
+PyType_Spec iobase_spec = {
+ .name = "_io._IOBase",
+ .basicsize = sizeof(iobase),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = iobase_slots,
+};
+
+/*
+ * RawIOBase class, Inherits from IOBase.
+ */
+PyDoc_STRVAR(rawiobase_doc,
+ "Base class for raw binary I/O.");
+
+/*
+ * The read() method is implemented by calling readinto(); derived classes
+ * that want to support read() only need to implement readinto() as a
+ * primitive operation. In general, readinto() can be more efficient than
+ * read().
+ *
+ * (It would be tempting to also provide an implementation of readinto() in
+ * terms of read(), in case the latter is a more suitable primitive operation,
+ * but that would lead to nasty recursion in case a subclass doesn't implement
+ * either.)
+*/
+
+/*[clinic input]
+_io._RawIOBase.read
+ size as n: Py_ssize_t = -1
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n)
+/*[clinic end generated code: output=6cdeb731e3c9f13c input=b6d0dcf6417d1374]*/
+{
+ PyObject *b, *res;
+
+ if (n < 0) {
+ return PyObject_CallMethodNoArgs(self, &_Py_ID(readall));
+ }
+
+ /* TODO: allocate a bytes object directly instead and manually construct
+ a writable memoryview pointing to it. */
+ b = PyByteArray_FromStringAndSize(NULL, n);
+ if (b == NULL)
+ return NULL;
+
+ res = PyObject_CallMethodObjArgs(self, &_Py_ID(readinto), b, NULL);
+ if (res == NULL || res == Py_None) {
+ Py_DECREF(b);
+ return res;
+ }
+
+ n = PyNumber_AsSsize_t(res, PyExc_ValueError);
+ Py_DECREF(res);
+ if (n == -1 && PyErr_Occurred()) {
+ Py_DECREF(b);
+ return NULL;
+ }
+
+ res = PyBytes_FromStringAndSize(PyByteArray_AsString(b), n);
+ Py_DECREF(b);
+ return res;
+}
+
+
+/*[clinic input]
+_io._RawIOBase.readall
+
+Read until EOF, using multiple read() call.
+[clinic start generated code]*/
+
+static PyObject *
+_io__RawIOBase_readall_impl(PyObject *self)
+/*[clinic end generated code: output=1987b9ce929425a0 input=688874141213622a]*/
+{
+ int r;
+ PyObject *chunks = PyList_New(0);
+ PyObject *result;
+
+ if (chunks == NULL)
+ return NULL;
+
+ while (1) {
+ PyObject *data = _PyObject_CallMethod(self, &_Py_ID(read),
+ "i", DEFAULT_BUFFER_SIZE);
+ if (!data) {
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals()
+ when EINTR occurs so we needn't do it ourselves. */
+ if (_PyIO_trap_eintr()) {
+ continue;
+ }
+ Py_DECREF(chunks);
+ return NULL;
+ }
+ if (data == Py_None) {
+ if (PyList_GET_SIZE(chunks) == 0) {
+ Py_DECREF(chunks);
+ return data;
+ }
+ Py_DECREF(data);
+ break;
+ }
+ if (!PyBytes_Check(data)) {
+ Py_DECREF(chunks);
+ Py_DECREF(data);
+ PyErr_SetString(PyExc_TypeError, "read() should return bytes");
+ return NULL;
+ }
+ if (PyBytes_GET_SIZE(data) == 0) {
+ /* EOF */
+ Py_DECREF(data);
+ break;
+ }
+ r = PyList_Append(chunks, data);
+ Py_DECREF(data);
+ if (r < 0) {
+ Py_DECREF(chunks);
+ return NULL;
+ }
+ }
+ result = _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), chunks);
+ Py_DECREF(chunks);
+ return result;
+}
+
+static PyObject *
+rawiobase_readinto(PyObject *self, PyObject *args)
+{
+ PyErr_SetNone(PyExc_NotImplementedError);
+ return NULL;
+}
+
+static PyObject *
+rawiobase_write(PyObject *self, PyObject *args)
+{
+ PyErr_SetNone(PyExc_NotImplementedError);
+ return NULL;
+}
+
+static PyMethodDef rawiobase_methods[] = {
+ _IO__RAWIOBASE_READ_METHODDEF
+ _IO__RAWIOBASE_READALL_METHODDEF
+ {"readinto", rawiobase_readinto, METH_VARARGS},
+ {"write", rawiobase_write, METH_VARARGS},
+ {NULL, NULL}
+};
+
+static PyType_Slot rawiobase_slots[] = {
+ {Py_tp_doc, (void *)rawiobase_doc},
+ {Py_tp_methods, rawiobase_methods},
+ {0, NULL},
+};
+
+/* Do not set Py_TPFLAGS_HAVE_GC so that tp_traverse and tp_clear are inherited */
+PyType_Spec rawiobase_spec = {
+ .name = "_io._RawIOBase",
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = rawiobase_slots,
+};
diff --git a/contrib/tools/python3/Modules/_io/stringio.c b/contrib/tools/python3/Modules/_io/stringio.c
new file mode 100644
index 00000000000..3eb25704b4a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/stringio.c
@@ -0,0 +1,1037 @@
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include <stddef.h> // offsetof()
+#include "pycore_object.h"
+#include "_iomodule.h"
+
+/* Implementation note: the buffer is always at least one character longer
+ than the enclosed string, for proper functioning of _PyIO_find_line_ending.
+*/
+
+#define STATE_REALIZED 1
+#define STATE_ACCUMULATING 2
+
+/*[clinic input]
+module _io
+class _io.StringIO "stringio *" "clinic_state()->PyStringIO_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2693eada0658d470]*/
+
+typedef struct {
+ PyObject_HEAD
+ Py_UCS4 *buf;
+ Py_ssize_t pos;
+ Py_ssize_t string_size;
+ size_t buf_size;
+
+ /* The stringio object can be in two states: accumulating or realized.
+ In accumulating state, the internal buffer contains nothing and
+ the contents are given by the embedded _PyUnicodeWriter structure.
+ In realized state, the internal buffer is meaningful and the
+ _PyUnicodeWriter is destroyed.
+ */
+ int state;
+ _PyUnicodeWriter writer;
+
+ char ok; /* initialized? */
+ char closed;
+ char readuniversal;
+ char readtranslate;
+ PyObject *decoder;
+ PyObject *readnl;
+ PyObject *writenl;
+
+ PyObject *dict;
+ PyObject *weakreflist;
+ _PyIO_State *module_state;
+} stringio;
+
+static int _io_StringIO___init__(PyObject *self, PyObject *args, PyObject *kwargs);
+
+#define CHECK_INITIALIZED(self) \
+ if (self->ok <= 0) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on uninitialized object"); \
+ return NULL; \
+ }
+
+#define CHECK_CLOSED(self) \
+ if (self->closed) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on closed file"); \
+ return NULL; \
+ }
+
+#define ENSURE_REALIZED(self) \
+ if (realize(self) < 0) { \
+ return NULL; \
+ }
+
+
+/* Internal routine for changing the size, in terms of characters, of the
+ buffer of StringIO objects. The caller should ensure that the 'size'
+ argument is non-negative. Returns 0 on success, -1 otherwise. */
+static int
+resize_buffer(stringio *self, size_t size)
+{
+ /* Here, unsigned types are used to avoid dealing with signed integer
+ overflow, which is undefined in C. */
+ size_t alloc = self->buf_size;
+ Py_UCS4 *new_buf = NULL;
+
+ assert(self->buf != NULL);
+
+ /* Reserve one more char for line ending detection. */
+ size = size + 1;
+ /* For simplicity, stay in the range of the signed type. Anyway, Python
+ doesn't allow strings to be longer than this. */
+ if (size > PY_SSIZE_T_MAX)
+ goto overflow;
+
+ if (size < alloc / 2) {
+ /* Major downsize; resize down to exact size. */
+ alloc = size + 1;
+ }
+ else if (size < alloc) {
+ /* Within allocated size; quick exit */
+ return 0;
+ }
+ else if (size <= alloc * 1.125) {
+ /* Moderate upsize; overallocate similar to list_resize() */
+ alloc = size + (size >> 3) + (size < 9 ? 3 : 6);
+ }
+ else {
+ /* Major upsize; resize up to exact size */
+ alloc = size + 1;
+ }
+
+ if (alloc > PY_SIZE_MAX / sizeof(Py_UCS4))
+ goto overflow;
+ new_buf = (Py_UCS4 *)PyMem_Realloc(self->buf, alloc * sizeof(Py_UCS4));
+ if (new_buf == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->buf_size = alloc;
+ self->buf = new_buf;
+
+ return 0;
+
+ overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "new buffer size too large");
+ return -1;
+}
+
+static PyObject *
+make_intermediate(stringio *self)
+{
+ PyObject *intermediate = _PyUnicodeWriter_Finish(&self->writer);
+ self->state = STATE_REALIZED;
+ if (intermediate == NULL)
+ return NULL;
+
+ _PyUnicodeWriter_Init(&self->writer);
+ self->writer.overallocate = 1;
+ if (_PyUnicodeWriter_WriteStr(&self->writer, intermediate)) {
+ Py_DECREF(intermediate);
+ return NULL;
+ }
+ self->state = STATE_ACCUMULATING;
+ return intermediate;
+}
+
+static int
+realize(stringio *self)
+{
+ Py_ssize_t len;
+ PyObject *intermediate;
+
+ if (self->state == STATE_REALIZED)
+ return 0;
+ assert(self->state == STATE_ACCUMULATING);
+ self->state = STATE_REALIZED;
+
+ intermediate = _PyUnicodeWriter_Finish(&self->writer);
+ if (intermediate == NULL)
+ return -1;
+
+ /* Append the intermediate string to the internal buffer.
+ The length should be equal to the current cursor position.
+ */
+ len = PyUnicode_GET_LENGTH(intermediate);
+ if (resize_buffer(self, len) < 0) {
+ Py_DECREF(intermediate);
+ return -1;
+ }
+ if (!PyUnicode_AsUCS4(intermediate, self->buf, len, 0)) {
+ Py_DECREF(intermediate);
+ return -1;
+ }
+
+ Py_DECREF(intermediate);
+ return 0;
+}
+
+/* Internal routine for writing a whole PyUnicode object to the buffer of a
+ StringIO object. Returns 0 on success, or -1 on error. */
+static Py_ssize_t
+write_str(stringio *self, PyObject *obj)
+{
+ Py_ssize_t len;
+ PyObject *decoded = NULL;
+
+ assert(self->buf != NULL);
+ assert(self->pos >= 0);
+
+ if (self->decoder != NULL) {
+ decoded = _PyIncrementalNewlineDecoder_decode(
+ self->decoder, obj, 1 /* always final */);
+ }
+ else {
+ decoded = Py_NewRef(obj);
+ }
+ if (self->writenl) {
+ PyObject *translated = PyUnicode_Replace(
+ decoded, &_Py_STR(newline), self->writenl, -1);
+ Py_SETREF(decoded, translated);
+ }
+ if (decoded == NULL)
+ return -1;
+
+ assert(PyUnicode_Check(decoded));
+ if (PyUnicode_READY(decoded)) {
+ Py_DECREF(decoded);
+ return -1;
+ }
+ len = PyUnicode_GET_LENGTH(decoded);
+ assert(len >= 0);
+
+ /* This overflow check is not strictly necessary. However, it avoids us to
+ deal with funky things like comparing an unsigned and a signed
+ integer. */
+ if (self->pos > PY_SSIZE_T_MAX - len) {
+ PyErr_SetString(PyExc_OverflowError,
+ "new position too large");
+ goto fail;
+ }
+
+ if (self->state == STATE_ACCUMULATING) {
+ if (self->string_size == self->pos) {
+ if (_PyUnicodeWriter_WriteStr(&self->writer, decoded))
+ goto fail;
+ goto success;
+ }
+ if (realize(self))
+ goto fail;
+ }
+
+ if (self->pos + len > self->string_size) {
+ if (resize_buffer(self, self->pos + len) < 0)
+ goto fail;
+ }
+
+ if (self->pos > self->string_size) {
+ /* In case of overseek, pad with null bytes the buffer region between
+ the end of stream and the current position.
+
+ 0 lo string_size hi
+ | |<---used--->|<----------available----------->|
+ | | <--to pad-->|<---to write---> |
+ 0 buf position
+
+ */
+ memset(self->buf + self->string_size, '\0',
+ (self->pos - self->string_size) * sizeof(Py_UCS4));
+ }
+
+ /* Copy the data to the internal buffer, overwriting some of the
+ existing data if self->pos < self->string_size. */
+ if (!PyUnicode_AsUCS4(decoded,
+ self->buf + self->pos,
+ self->buf_size - self->pos,
+ 0))
+ goto fail;
+
+success:
+ /* Set the new length of the internal string if it has changed. */
+ self->pos += len;
+ if (self->string_size < self->pos)
+ self->string_size = self->pos;
+
+ Py_DECREF(decoded);
+ return 0;
+
+fail:
+ Py_XDECREF(decoded);
+ return -1;
+}
+
+/*[clinic input]
+_io.StringIO.getvalue
+
+Retrieve the entire contents of the object.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_getvalue_impl(stringio *self)
+/*[clinic end generated code: output=27b6a7bfeaebce01 input=d23cb81d6791cf88]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ if (self->state == STATE_ACCUMULATING)
+ return make_intermediate(self);
+ return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, self->buf,
+ self->string_size);
+}
+
+/*[clinic input]
+_io.StringIO.tell
+
+Tell the current file position.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_tell_impl(stringio *self)
+/*[clinic end generated code: output=2e87ac67b116c77b input=ec866ebaff02f405]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ return PyLong_FromSsize_t(self->pos);
+}
+
+/*[clinic input]
+_io.StringIO.read
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read at most size characters, returned as a string.
+
+If the argument is negative or omitted, read until EOF
+is reached. Return an empty string at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_read_impl(stringio *self, Py_ssize_t size)
+/*[clinic end generated code: output=ae8cf6002f71626c input=0921093383dfb92d]*/
+{
+ Py_ssize_t n;
+ Py_UCS4 *output;
+
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+
+ /* adjust invalid sizes */
+ n = self->string_size - self->pos;
+ if (size < 0 || size > n) {
+ size = n;
+ if (size < 0)
+ size = 0;
+ }
+
+ /* Optimization for seek(0); read() */
+ if (self->state == STATE_ACCUMULATING && self->pos == 0 && size == n) {
+ PyObject *result = make_intermediate(self);
+ self->pos = self->string_size;
+ return result;
+ }
+
+ ENSURE_REALIZED(self);
+ output = self->buf + self->pos;
+ self->pos += size;
+ return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, output, size);
+}
+
+/* Internal helper, used by stringio_readline and stringio_iternext */
+static PyObject *
+_stringio_readline(stringio *self, Py_ssize_t limit)
+{
+ Py_UCS4 *start, *end, old_char;
+ Py_ssize_t len, consumed;
+
+ /* In case of overseek, return the empty string */
+ if (self->pos >= self->string_size)
+ return PyUnicode_New(0, 0);
+
+ start = self->buf + self->pos;
+ if (limit < 0 || limit > self->string_size - self->pos)
+ limit = self->string_size - self->pos;
+
+ end = start + limit;
+ old_char = *end;
+ *end = '\0';
+ len = _PyIO_find_line_ending(
+ self->readtranslate, self->readuniversal, self->readnl,
+ PyUnicode_4BYTE_KIND, (char*)start, (char*)end, &consumed);
+ *end = old_char;
+ /* If we haven't found any line ending, we just return everything
+ (`consumed` is ignored). */
+ if (len < 0)
+ len = limit;
+ self->pos += len;
+ return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, start, len);
+}
+
+/*[clinic input]
+_io.StringIO.readline
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read until newline or EOF.
+
+Returns an empty string if EOF is hit immediately.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_readline_impl(stringio *self, Py_ssize_t size)
+/*[clinic end generated code: output=cabd6452f1b7e85d input=a5bd70bf682aa276]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ ENSURE_REALIZED(self);
+
+ return _stringio_readline(self, size);
+}
+
+static PyObject *
+stringio_iternext(stringio *self)
+{
+ PyObject *line;
+
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ ENSURE_REALIZED(self);
+
+ if (Py_IS_TYPE(self, self->module_state->PyStringIO_Type)) {
+ /* Skip method call overhead for speed */
+ line = _stringio_readline(self, -1);
+ }
+ else {
+ /* XXX is subclassing StringIO really supported? */
+ line = PyObject_CallMethodNoArgs((PyObject *)self,
+ &_Py_ID(readline));
+ if (line && !PyUnicode_Check(line)) {
+ PyErr_Format(PyExc_OSError,
+ "readline() should have returned a str object, "
+ "not '%.200s'", Py_TYPE(line)->tp_name);
+ Py_DECREF(line);
+ return NULL;
+ }
+ }
+
+ if (line == NULL)
+ return NULL;
+
+ if (PyUnicode_GET_LENGTH(line) == 0) {
+ /* Reached EOF */
+ Py_DECREF(line);
+ return NULL;
+ }
+
+ return line;
+}
+
+/*[clinic input]
+_io.StringIO.truncate
+ pos as size: Py_ssize_t(accept={int, NoneType}, c_default="self->pos") = None
+ /
+
+Truncate size to pos.
+
+The pos argument defaults to the current file position, as
+returned by tell(). The current file position is unchanged.
+Returns the new absolute position.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_truncate_impl(stringio *self, Py_ssize_t size)
+/*[clinic end generated code: output=eb3aef8e06701365 input=5505cff90ca48b96]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+
+ if (size < 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Negative size value %zd", size);
+ return NULL;
+ }
+
+ if (size < self->string_size) {
+ ENSURE_REALIZED(self);
+ if (resize_buffer(self, size) < 0)
+ return NULL;
+ self->string_size = size;
+ }
+
+ return PyLong_FromSsize_t(size);
+}
+
+/*[clinic input]
+_io.StringIO.seek
+ pos: Py_ssize_t
+ whence: int = 0
+ /
+
+Change stream position.
+
+Seek to character offset pos relative to position indicated by whence:
+ 0 Start of stream (the default). pos should be >= 0;
+ 1 Current position - pos must be 0;
+ 2 End of stream - pos must be 0.
+Returns the new absolute position.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_seek_impl(stringio *self, Py_ssize_t pos, int whence)
+/*[clinic end generated code: output=e9e0ac9a8ae71c25 input=e3855b24e7cae06a]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+
+ if (whence != 0 && whence != 1 && whence != 2) {
+ PyErr_Format(PyExc_ValueError,
+ "Invalid whence (%i, should be 0, 1 or 2)", whence);
+ return NULL;
+ }
+ else if (pos < 0 && whence == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Negative seek position %zd", pos);
+ return NULL;
+ }
+ else if (whence != 0 && pos != 0) {
+ PyErr_SetString(PyExc_OSError,
+ "Can't do nonzero cur-relative seeks");
+ return NULL;
+ }
+
+ /* whence = 0: offset relative to beginning of the string.
+ whence = 1: no change to current position.
+ whence = 2: change position to end of file. */
+ if (whence == 1) {
+ pos = self->pos;
+ }
+ else if (whence == 2) {
+ pos = self->string_size;
+ }
+
+ self->pos = pos;
+
+ return PyLong_FromSsize_t(self->pos);
+}
+
+/*[clinic input]
+_io.StringIO.write
+ s as obj: object
+ /
+
+Write string to file.
+
+Returns the number of characters written, which is always equal to
+the length of the string.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_write(stringio *self, PyObject *obj)
+/*[clinic end generated code: output=0deaba91a15b94da input=cf96f3b16586e669]*/
+{
+ Py_ssize_t size;
+
+ CHECK_INITIALIZED(self);
+ if (!PyUnicode_Check(obj)) {
+ PyErr_Format(PyExc_TypeError, "string argument expected, got '%s'",
+ Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+ if (PyUnicode_READY(obj))
+ return NULL;
+ CHECK_CLOSED(self);
+ size = PyUnicode_GET_LENGTH(obj);
+
+ if (size > 0 && write_str(self, obj) < 0)
+ return NULL;
+
+ return PyLong_FromSsize_t(size);
+}
+
+/*[clinic input]
+_io.StringIO.close
+
+Close the IO object.
+
+Attempting any further operation after the object is closed
+will raise a ValueError.
+
+This method has no effect if the file is already closed.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_close_impl(stringio *self)
+/*[clinic end generated code: output=04399355cbe518f1 input=cbc10b45f35d6d46]*/
+{
+ self->closed = 1;
+ /* Free up some memory */
+ if (resize_buffer(self, 0) < 0)
+ return NULL;
+ _PyUnicodeWriter_Dealloc(&self->writer);
+ Py_CLEAR(self->readnl);
+ Py_CLEAR(self->writenl);
+ Py_CLEAR(self->decoder);
+ Py_RETURN_NONE;
+}
+
+static int
+stringio_traverse(stringio *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->readnl);
+ Py_VISIT(self->writenl);
+ Py_VISIT(self->decoder);
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static int
+stringio_clear(stringio *self)
+{
+ Py_CLEAR(self->readnl);
+ Py_CLEAR(self->writenl);
+ Py_CLEAR(self->decoder);
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+stringio_dealloc(stringio *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ _PyObject_GC_UNTRACK(self);
+ self->ok = 0;
+ if (self->buf) {
+ PyMem_Free(self->buf);
+ self->buf = NULL;
+ }
+ _PyUnicodeWriter_Dealloc(&self->writer);
+ (void)stringio_clear(self);
+ if (self->weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject *) self);
+ }
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+stringio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ stringio *self;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (stringio *)type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ /* tp_alloc initializes all the fields to zero. So we don't have to
+ initialize them here. */
+
+ self->buf = (Py_UCS4 *)PyMem_Malloc(0);
+ if (self->buf == NULL) {
+ Py_DECREF(self);
+ return PyErr_NoMemory();
+ }
+
+ return (PyObject *)self;
+}
+
+/*[clinic input]
+_io.StringIO.__init__
+ initial_value as value: object(c_default="NULL") = ''
+ newline as newline_obj: object(c_default="NULL") = '\n'
+
+Text I/O implementation using an in-memory buffer.
+
+The initial_value argument sets the value of object. The newline
+argument is like the one of TextIOWrapper's constructor.
+[clinic start generated code]*/
+
+static int
+_io_StringIO___init___impl(stringio *self, PyObject *value,
+ PyObject *newline_obj)
+/*[clinic end generated code: output=a421ea023b22ef4e input=cee2d9181b2577a3]*/
+{
+ const char *newline = "\n";
+ Py_ssize_t value_len;
+
+ /* Parse the newline argument. We only want to allow unicode objects or
+ None. */
+ if (newline_obj == Py_None) {
+ newline = NULL;
+ }
+ else if (newline_obj) {
+ if (!PyUnicode_Check(newline_obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "newline must be str or None, not %.200s",
+ Py_TYPE(newline_obj)->tp_name);
+ return -1;
+ }
+ newline = PyUnicode_AsUTF8(newline_obj);
+ if (newline == NULL)
+ return -1;
+ }
+
+ if (newline && newline[0] != '\0'
+ && !(newline[0] == '\n' && newline[1] == '\0')
+ && !(newline[0] == '\r' && newline[1] == '\0')
+ && !(newline[0] == '\r' && newline[1] == '\n' && newline[2] == '\0')) {
+ PyErr_Format(PyExc_ValueError,
+ "illegal newline value: %R", newline_obj);
+ return -1;
+ }
+ if (value && value != Py_None && !PyUnicode_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "initial_value must be str or None, not %.200s",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+
+ self->ok = 0;
+
+ _PyUnicodeWriter_Dealloc(&self->writer);
+ Py_CLEAR(self->readnl);
+ Py_CLEAR(self->writenl);
+ Py_CLEAR(self->decoder);
+
+ assert((newline != NULL && newline_obj != Py_None) ||
+ (newline == NULL && newline_obj == Py_None));
+
+ if (newline) {
+ self->readnl = PyUnicode_FromString(newline);
+ if (self->readnl == NULL)
+ return -1;
+ }
+ self->readuniversal = (newline == NULL || newline[0] == '\0');
+ self->readtranslate = (newline == NULL);
+ /* If newline == "", we don't translate anything.
+ If newline == "\n" or newline == None, we translate to "\n", which is
+ a no-op.
+ (for newline == None, TextIOWrapper translates to os.linesep, but it
+ is pointless for StringIO)
+ */
+ if (newline != NULL && newline[0] == '\r') {
+ self->writenl = Py_NewRef(self->readnl);
+ }
+
+ _PyIO_State *module_state = find_io_state_by_def(Py_TYPE(self));
+ if (self->readuniversal) {
+ self->decoder = PyObject_CallFunctionObjArgs(
+ (PyObject *)module_state->PyIncrementalNewlineDecoder_Type,
+ Py_None, self->readtranslate ? Py_True : Py_False, NULL);
+ if (self->decoder == NULL)
+ return -1;
+ }
+
+ /* Now everything is set up, resize buffer to size of initial value,
+ and copy it */
+ self->string_size = 0;
+ if (value && value != Py_None)
+ value_len = PyUnicode_GetLength(value);
+ else
+ value_len = 0;
+ if (value_len > 0) {
+ /* This is a heuristic, for newline translation might change
+ the string length. */
+ if (resize_buffer(self, 0) < 0)
+ return -1;
+ self->state = STATE_REALIZED;
+ self->pos = 0;
+ if (write_str(self, value) < 0)
+ return -1;
+ }
+ else {
+ /* Empty stringio object, we can start by accumulating */
+ if (resize_buffer(self, 0) < 0)
+ return -1;
+ _PyUnicodeWriter_Init(&self->writer);
+ self->writer.overallocate = 1;
+ self->state = STATE_ACCUMULATING;
+ }
+ self->pos = 0;
+ self->module_state = module_state;
+ self->closed = 0;
+ self->ok = 1;
+ return 0;
+}
+
+/* Properties and pseudo-properties */
+
+/*[clinic input]
+_io.StringIO.readable
+
+Returns True if the IO object can be read.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_readable_impl(stringio *self)
+/*[clinic end generated code: output=b19d44dd8b1ceb99 input=39ce068b224c21ad]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_io.StringIO.writable
+
+Returns True if the IO object can be written.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_writable_impl(stringio *self)
+/*[clinic end generated code: output=13e4dd77187074ca input=7a691353aac38835]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_io.StringIO.seekable
+
+Returns True if the IO object can be seeked.
+[clinic start generated code]*/
+
+static PyObject *
+_io_StringIO_seekable_impl(stringio *self)
+/*[clinic end generated code: output=4d20b4641c756879 input=4c606d05b32952e6]*/
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ Py_RETURN_TRUE;
+}
+
+/* Pickling support.
+
+ The implementation of __getstate__ is similar to the one for BytesIO,
+ except that we also save the newline parameter. For __setstate__ and unlike
+ BytesIO, we call __init__ to restore the object's state. Doing so allows us
+ to avoid decoding the complex newline state while keeping the object
+ representation compact.
+
+ See comment in bytesio.c regarding why only pickle protocols and onward are
+ supported.
+*/
+
+static PyObject *
+stringio_getstate(stringio *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *initvalue = _io_StringIO_getvalue_impl(self);
+ PyObject *dict;
+ PyObject *state;
+
+ if (initvalue == NULL)
+ return NULL;
+ if (self->dict == NULL) {
+ dict = Py_NewRef(Py_None);
+ }
+ else {
+ dict = PyDict_Copy(self->dict);
+ if (dict == NULL) {
+ Py_DECREF(initvalue);
+ return NULL;
+ }
+ }
+
+ state = Py_BuildValue("(OOnN)", initvalue,
+ self->readnl ? self->readnl : Py_None,
+ self->pos, dict);
+ Py_DECREF(initvalue);
+ return state;
+}
+
+static PyObject *
+stringio_setstate(stringio *self, PyObject *state)
+{
+ PyObject *initarg;
+ PyObject *position_obj;
+ PyObject *dict;
+ Py_ssize_t pos;
+
+ assert(state != NULL);
+ CHECK_CLOSED(self);
+
+ /* We allow the state tuple to be longer than 4, because we may need
+ someday to extend the object's state without breaking
+ backward-compatibility. */
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) < 4) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__setstate__ argument should be 4-tuple, got %.200s",
+ Py_TYPE(self)->tp_name, Py_TYPE(state)->tp_name);
+ return NULL;
+ }
+
+ /* Initialize the object's state. */
+ initarg = PyTuple_GetSlice(state, 0, 2);
+ if (initarg == NULL)
+ return NULL;
+ if (_io_StringIO___init__((PyObject *)self, initarg, NULL) < 0) {
+ Py_DECREF(initarg);
+ return NULL;
+ }
+ Py_DECREF(initarg);
+
+ /* Restore the buffer state. Even if __init__ did initialize the buffer,
+ we have to initialize it again since __init__ may translate the
+ newlines in the initial_value string. We clearly do not want that
+ because the string value in the state tuple has already been translated
+ once by __init__. So we do not take any chance and replace object's
+ buffer completely. */
+ {
+ PyObject *item;
+ Py_UCS4 *buf;
+ Py_ssize_t bufsize;
+
+ item = PyTuple_GET_ITEM(state, 0);
+ buf = PyUnicode_AsUCS4Copy(item);
+ if (buf == NULL)
+ return NULL;
+ bufsize = PyUnicode_GET_LENGTH(item);
+
+ if (resize_buffer(self, bufsize) < 0) {
+ PyMem_Free(buf);
+ return NULL;
+ }
+ memcpy(self->buf, buf, bufsize * sizeof(Py_UCS4));
+ PyMem_Free(buf);
+ self->string_size = bufsize;
+ }
+
+ /* Set carefully the position value. Alternatively, we could use the seek
+ method instead of modifying self->pos directly to better protect the
+ object internal state against erroneous (or malicious) inputs. */
+ position_obj = PyTuple_GET_ITEM(state, 2);
+ if (!PyLong_Check(position_obj)) {
+ PyErr_Format(PyExc_TypeError,
+ "third item of state must be an integer, got %.200s",
+ Py_TYPE(position_obj)->tp_name);
+ return NULL;
+ }
+ pos = PyLong_AsSsize_t(position_obj);
+ if (pos == -1 && PyErr_Occurred())
+ return NULL;
+ if (pos < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "position value cannot be negative");
+ return NULL;
+ }
+ self->pos = pos;
+
+ /* Set the dictionary of the instance variables. */
+ dict = PyTuple_GET_ITEM(state, 3);
+ if (dict != Py_None) {
+ if (!PyDict_Check(dict)) {
+ PyErr_Format(PyExc_TypeError,
+ "fourth item of state should be a dict, got a %.200s",
+ Py_TYPE(dict)->tp_name);
+ return NULL;
+ }
+ if (self->dict) {
+ /* Alternatively, we could replace the internal dictionary
+ completely. However, it seems more practical to just update it. */
+ if (PyDict_Update(self->dict, dict) < 0)
+ return NULL;
+ }
+ else {
+ self->dict = Py_NewRef(dict);
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+
+static PyObject *
+stringio_closed(stringio *self, void *context)
+{
+ CHECK_INITIALIZED(self);
+ return PyBool_FromLong(self->closed);
+}
+
+static PyObject *
+stringio_line_buffering(stringio *self, void *context)
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ Py_RETURN_FALSE;
+}
+
+static PyObject *
+stringio_newlines(stringio *self, void *context)
+{
+ CHECK_INITIALIZED(self);
+ CHECK_CLOSED(self);
+ if (self->decoder == NULL)
+ Py_RETURN_NONE;
+ return PyObject_GetAttr(self->decoder, &_Py_ID(newlines));
+}
+
+#define clinic_state() (find_io_state_by_def(Py_TYPE(self)))
+#include "clinic/stringio.c.h"
+#undef clinic_state
+
+static struct PyMethodDef stringio_methods[] = {
+ _IO_STRINGIO_CLOSE_METHODDEF
+ _IO_STRINGIO_GETVALUE_METHODDEF
+ _IO_STRINGIO_READ_METHODDEF
+ _IO_STRINGIO_READLINE_METHODDEF
+ _IO_STRINGIO_TELL_METHODDEF
+ _IO_STRINGIO_TRUNCATE_METHODDEF
+ _IO_STRINGIO_SEEK_METHODDEF
+ _IO_STRINGIO_WRITE_METHODDEF
+
+ _IO_STRINGIO_SEEKABLE_METHODDEF
+ _IO_STRINGIO_READABLE_METHODDEF
+ _IO_STRINGIO_WRITABLE_METHODDEF
+
+ {"__getstate__", (PyCFunction)stringio_getstate, METH_NOARGS},
+ {"__setstate__", (PyCFunction)stringio_setstate, METH_O},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyGetSetDef stringio_getset[] = {
+ {"closed", (getter)stringio_closed, NULL, NULL},
+ {"newlines", (getter)stringio_newlines, NULL, NULL},
+ /* (following comments straight off of the original Python wrapper:)
+ XXX Cruft to support the TextIOWrapper API. This would only
+ be meaningful if StringIO supported the buffer attribute.
+ Hopefully, a better solution, than adding these pseudo-attributes,
+ will be found.
+ */
+ {"line_buffering", (getter)stringio_line_buffering, NULL, NULL},
+ {NULL}
+};
+
+static struct PyMemberDef stringio_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(stringio, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(stringio, dict), READONLY},
+ {NULL},
+};
+
+static PyType_Slot stringio_slots[] = {
+ {Py_tp_dealloc, stringio_dealloc},
+ {Py_tp_doc, (void *)_io_StringIO___init____doc__},
+ {Py_tp_traverse, stringio_traverse},
+ {Py_tp_clear, stringio_clear},
+ {Py_tp_iternext, stringio_iternext},
+ {Py_tp_methods, stringio_methods},
+ {Py_tp_members, stringio_members},
+ {Py_tp_getset, stringio_getset},
+ {Py_tp_init, _io_StringIO___init__},
+ {Py_tp_new, stringio_new},
+ {0, NULL},
+};
+
+PyType_Spec stringio_spec = {
+ .name = "_io.StringIO",
+ .basicsize = sizeof(stringio),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = stringio_slots,
+};
diff --git a/contrib/tools/python3/Modules/_io/textio.c b/contrib/tools/python3/Modules/_io/textio.c
new file mode 100644
index 00000000000..14dd19d95c2
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/textio.c
@@ -0,0 +1,3352 @@
+/*
+ An implementation of Text I/O as defined by PEP 3116 - "New I/O"
+
+ Classes defined here: TextIOBase, IncrementalNewlineDecoder, TextIOWrapper.
+
+ Written by Amaury Forgeot d'Arc and Antoine Pitrou
+*/
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_interp.h" // PyInterpreterState.fs_codec
+#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_fileutils.h" // _Py_GetLocaleEncoding()
+#include "pycore_object.h"
+#include "pycore_pystate.h" // _PyInterpreterState_GET()
+#include "structmember.h" // PyMemberDef
+#include "_iomodule.h"
+
+/*[clinic input]
+module _io
+class _io.IncrementalNewlineDecoder "nldecoder_object *" "clinic_state()->PyIncrementalNewlineDecoder_Type"
+class _io.TextIOWrapper "textio *" "clinic_state()->TextIOWrapper_Type"
+class _io._TextIOBase "PyObject *" "&PyTextIOBase_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=8b7f24fa13bfdd7f]*/
+
+typedef struct nldecoder_object nldecoder_object;
+typedef struct textio textio;
+
+#define clinic_state() (find_io_state_by_def(Py_TYPE(self)))
+#include "clinic/textio.c.h"
+#undef clinic_state
+
+/* TextIOBase */
+
+PyDoc_STRVAR(textiobase_doc,
+ "Base class for text I/O.\n"
+ "\n"
+ "This class provides a character and line based interface to stream\n"
+ "I/O. There is no readinto method because Python's character strings\n"
+ "are immutable.\n"
+ );
+
+static PyObject *
+_unsupported(_PyIO_State *state, const char *message)
+{
+ PyErr_SetString(state->unsupported_operation, message);
+ return NULL;
+}
+
+/*[clinic input]
+_io._TextIOBase.detach
+ cls: defining_class
+ /
+
+Separate the underlying buffer from the TextIOBase and return it.
+
+After the underlying buffer has been detached, the TextIO is in an unusable state.
+[clinic start generated code]*/
+
+static PyObject *
+_io__TextIOBase_detach_impl(PyObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=50915f40c609eaa4 input=987ca3640d0a3776]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return _unsupported(state, "detach");
+}
+
+/*[clinic input]
+_io._TextIOBase.read
+ cls: defining_class
+ size: int(unused=True) = -1
+ /
+
+Read at most size characters from stream.
+
+Read from underlying buffer until we have size characters or we hit EOF.
+If size is negative or omitted, read until EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io__TextIOBase_read_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size))
+/*[clinic end generated code: output=51a5178a309ce647 input=f5e37720f9fc563f]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return _unsupported(state, "read");
+}
+
+/*[clinic input]
+_io._TextIOBase.readline
+ cls: defining_class
+ size: int(unused=True) = -1
+ /
+
+Read until newline or EOF.
+
+Return an empty string if EOF is hit immediately.
+If size is specified, at most size characters will be read.
+[clinic start generated code]*/
+
+static PyObject *
+_io__TextIOBase_readline_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size))
+/*[clinic end generated code: output=3f47d7966d6d074e input=42eafec94107fa27]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return _unsupported(state, "readline");
+}
+
+/*[clinic input]
+_io._TextIOBase.write
+ cls: defining_class
+ s: str(unused=True)
+ /
+
+Write string s to stream.
+
+Return the number of characters written
+(which is always equal to the length of the string).
+[clinic start generated code]*/
+
+static PyObject *
+_io__TextIOBase_write_impl(PyObject *self, PyTypeObject *cls,
+ const char *Py_UNUSED(s))
+/*[clinic end generated code: output=18b28231460275de input=e9cabaa5f6732b07]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return _unsupported(state, "write");
+}
+
+PyDoc_STRVAR(textiobase_encoding_doc,
+ "Encoding of the text stream.\n"
+ "\n"
+ "Subclasses should override.\n"
+ );
+
+static PyObject *
+textiobase_encoding_get(PyObject *self, void *context)
+{
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(textiobase_newlines_doc,
+ "Line endings translated so far.\n"
+ "\n"
+ "Only line endings translated during reading are considered.\n"
+ "\n"
+ "Subclasses should override.\n"
+ );
+
+static PyObject *
+textiobase_newlines_get(PyObject *self, void *context)
+{
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(textiobase_errors_doc,
+ "The error setting of the decoder or encoder.\n"
+ "\n"
+ "Subclasses should override.\n"
+ );
+
+static PyObject *
+textiobase_errors_get(PyObject *self, void *context)
+{
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef textiobase_methods[] = {
+ _IO__TEXTIOBASE_DETACH_METHODDEF
+ _IO__TEXTIOBASE_READ_METHODDEF
+ _IO__TEXTIOBASE_READLINE_METHODDEF
+ _IO__TEXTIOBASE_WRITE_METHODDEF
+ {NULL, NULL}
+};
+
+static PyGetSetDef textiobase_getset[] = {
+ {"encoding", (getter)textiobase_encoding_get, NULL, textiobase_encoding_doc},
+ {"newlines", (getter)textiobase_newlines_get, NULL, textiobase_newlines_doc},
+ {"errors", (getter)textiobase_errors_get, NULL, textiobase_errors_doc},
+ {NULL}
+};
+
+static PyType_Slot textiobase_slots[] = {
+ {Py_tp_doc, (void *)textiobase_doc},
+ {Py_tp_methods, textiobase_methods},
+ {Py_tp_getset, textiobase_getset},
+ {0, NULL},
+};
+
+/* Do not set Py_TPFLAGS_HAVE_GC so that tp_traverse and tp_clear are inherited */
+PyType_Spec textiobase_spec = {
+ .name = "_io._TextIOBase",
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = textiobase_slots,
+};
+
+/* IncrementalNewlineDecoder */
+
+struct nldecoder_object {
+ PyObject_HEAD
+ PyObject *decoder;
+ PyObject *errors;
+ unsigned int pendingcr: 1;
+ unsigned int translate: 1;
+ unsigned int seennl: 3;
+};
+
+/*[clinic input]
+_io.IncrementalNewlineDecoder.__init__
+ decoder: object
+ translate: bool
+ errors: object(c_default="NULL") = "strict"
+
+Codec used when reading a file in universal newlines mode.
+
+It wraps another incremental decoder, translating \r\n and \r into \n.
+It also records the types of newlines encountered. When used with
+translate=False, it ensures that the newline sequence is returned in
+one piece. When used with decoder=None, it expects unicode strings as
+decode input and translates newlines without first invoking an external
+decoder.
+[clinic start generated code]*/
+
+static int
+_io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self,
+ PyObject *decoder, int translate,
+ PyObject *errors)
+/*[clinic end generated code: output=fbd04d443e764ec2 input=ed547aa257616b0e]*/
+{
+
+ if (errors == NULL) {
+ errors = Py_NewRef(&_Py_ID(strict));
+ }
+ else {
+ errors = Py_NewRef(errors);
+ }
+
+ Py_XSETREF(self->errors, errors);
+ Py_XSETREF(self->decoder, Py_NewRef(decoder));
+ self->translate = translate ? 1 : 0;
+ self->seennl = 0;
+ self->pendingcr = 0;
+
+ return 0;
+}
+
+static int
+incrementalnewlinedecoder_traverse(nldecoder_object *self, visitproc visit,
+ void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->decoder);
+ Py_VISIT(self->errors);
+ return 0;
+}
+
+static int
+incrementalnewlinedecoder_clear(nldecoder_object *self)
+{
+ Py_CLEAR(self->decoder);
+ Py_CLEAR(self->errors);
+ return 0;
+}
+
+static void
+incrementalnewlinedecoder_dealloc(nldecoder_object *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ _PyObject_GC_UNTRACK(self);
+ (void)incrementalnewlinedecoder_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+check_decoded(PyObject *decoded)
+{
+ if (decoded == NULL)
+ return -1;
+ if (!PyUnicode_Check(decoded)) {
+ PyErr_Format(PyExc_TypeError,
+ "decoder should return a string result, not '%.200s'",
+ Py_TYPE(decoded)->tp_name);
+ Py_DECREF(decoded);
+ return -1;
+ }
+ if (PyUnicode_READY(decoded) < 0) {
+ Py_DECREF(decoded);
+ return -1;
+ }
+ return 0;
+}
+
+#define CHECK_INITIALIZED_DECODER(self) \
+ if (self->errors == NULL) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "IncrementalNewlineDecoder.__init__() not called"); \
+ return NULL; \
+ }
+
+#define SEEN_CR 1
+#define SEEN_LF 2
+#define SEEN_CRLF 4
+#define SEEN_ALL (SEEN_CR | SEEN_LF | SEEN_CRLF)
+
+PyObject *
+_PyIncrementalNewlineDecoder_decode(PyObject *myself,
+ PyObject *input, int final)
+{
+ PyObject *output;
+ Py_ssize_t output_len;
+ nldecoder_object *self = (nldecoder_object *) myself;
+
+ CHECK_INITIALIZED_DECODER(self);
+
+ /* decode input (with the eventual \r from a previous pass) */
+ if (self->decoder != Py_None) {
+ output = PyObject_CallMethodObjArgs(self->decoder,
+ &_Py_ID(decode), input, final ? Py_True : Py_False, NULL);
+ }
+ else {
+ output = Py_NewRef(input);
+ }
+
+ if (check_decoded(output) < 0)
+ return NULL;
+
+ output_len = PyUnicode_GET_LENGTH(output);
+ if (self->pendingcr && (final || output_len > 0)) {
+ /* Prefix output with CR */
+ int kind;
+ PyObject *modified;
+ char *out;
+
+ modified = PyUnicode_New(output_len + 1,
+ PyUnicode_MAX_CHAR_VALUE(output));
+ if (modified == NULL)
+ goto error;
+ kind = PyUnicode_KIND(modified);
+ out = PyUnicode_DATA(modified);
+ PyUnicode_WRITE(kind, out, 0, '\r');
+ memcpy(out + kind, PyUnicode_DATA(output), kind * output_len);
+ Py_SETREF(output, modified); /* output remains ready */
+ self->pendingcr = 0;
+ output_len++;
+ }
+
+ /* retain last \r even when not translating data:
+ * then readline() is sure to get \r\n in one pass
+ */
+ if (!final) {
+ if (output_len > 0
+ && PyUnicode_READ_CHAR(output, output_len - 1) == '\r')
+ {
+ PyObject *modified = PyUnicode_Substring(output, 0, output_len -1);
+ if (modified == NULL)
+ goto error;
+ Py_SETREF(output, modified);
+ self->pendingcr = 1;
+ }
+ }
+
+ /* Record which newlines are read and do newline translation if desired,
+ all in one pass. */
+ {
+ const void *in_str;
+ Py_ssize_t len;
+ int seennl = self->seennl;
+ int only_lf = 0;
+ int kind;
+
+ in_str = PyUnicode_DATA(output);
+ len = PyUnicode_GET_LENGTH(output);
+ kind = PyUnicode_KIND(output);
+
+ if (len == 0)
+ return output;
+
+ /* If, up to now, newlines are consistently \n, do a quick check
+ for the \r *byte* with the libc's optimized memchr.
+ */
+ if (seennl == SEEN_LF || seennl == 0) {
+ only_lf = (memchr(in_str, '\r', kind * len) == NULL);
+ }
+
+ if (only_lf) {
+ /* If not already seen, quick scan for a possible "\n" character.
+ (there's nothing else to be done, even when in translation mode)
+ */
+ if (seennl == 0 &&
+ memchr(in_str, '\n', kind * len) != NULL) {
+ if (kind == PyUnicode_1BYTE_KIND)
+ seennl |= SEEN_LF;
+ else {
+ Py_ssize_t i = 0;
+ for (;;) {
+ Py_UCS4 c;
+ /* Fast loop for non-control characters */
+ while (PyUnicode_READ(kind, in_str, i) > '\n')
+ i++;
+ c = PyUnicode_READ(kind, in_str, i++);
+ if (c == '\n') {
+ seennl |= SEEN_LF;
+ break;
+ }
+ if (i >= len)
+ break;
+ }
+ }
+ }
+ /* Finished: we have scanned for newlines, and none of them
+ need translating */
+ }
+ else if (!self->translate) {
+ Py_ssize_t i = 0;
+ /* We have already seen all newline types, no need to scan again */
+ if (seennl == SEEN_ALL)
+ goto endscan;
+ for (;;) {
+ Py_UCS4 c;
+ /* Fast loop for non-control characters */
+ while (PyUnicode_READ(kind, in_str, i) > '\r')
+ i++;
+ c = PyUnicode_READ(kind, in_str, i++);
+ if (c == '\n')
+ seennl |= SEEN_LF;
+ else if (c == '\r') {
+ if (PyUnicode_READ(kind, in_str, i) == '\n') {
+ seennl |= SEEN_CRLF;
+ i++;
+ }
+ else
+ seennl |= SEEN_CR;
+ }
+ if (i >= len)
+ break;
+ if (seennl == SEEN_ALL)
+ break;
+ }
+ endscan:
+ ;
+ }
+ else {
+ void *translated;
+ int kind = PyUnicode_KIND(output);
+ const void *in_str = PyUnicode_DATA(output);
+ Py_ssize_t in, out;
+ /* XXX: Previous in-place translation here is disabled as
+ resizing is not possible anymore */
+ /* We could try to optimize this so that we only do a copy
+ when there is something to translate. On the other hand,
+ we already know there is a \r byte, so chances are high
+ that something needs to be done. */
+ translated = PyMem_Malloc(kind * len);
+ if (translated == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ in = out = 0;
+ for (;;) {
+ Py_UCS4 c;
+ /* Fast loop for non-control characters */
+ while ((c = PyUnicode_READ(kind, in_str, in++)) > '\r')
+ PyUnicode_WRITE(kind, translated, out++, c);
+ if (c == '\n') {
+ PyUnicode_WRITE(kind, translated, out++, c);
+ seennl |= SEEN_LF;
+ continue;
+ }
+ if (c == '\r') {
+ if (PyUnicode_READ(kind, in_str, in) == '\n') {
+ in++;
+ seennl |= SEEN_CRLF;
+ }
+ else
+ seennl |= SEEN_CR;
+ PyUnicode_WRITE(kind, translated, out++, '\n');
+ continue;
+ }
+ if (in > len)
+ break;
+ PyUnicode_WRITE(kind, translated, out++, c);
+ }
+ Py_DECREF(output);
+ output = PyUnicode_FromKindAndData(kind, translated, out);
+ PyMem_Free(translated);
+ if (!output)
+ return NULL;
+ }
+ self->seennl |= seennl;
+ }
+
+ return output;
+
+ error:
+ Py_DECREF(output);
+ return NULL;
+}
+
+/*[clinic input]
+_io.IncrementalNewlineDecoder.decode
+ input: object
+ final: bool = False
+[clinic start generated code]*/
+
+static PyObject *
+_io_IncrementalNewlineDecoder_decode_impl(nldecoder_object *self,
+ PyObject *input, int final)
+/*[clinic end generated code: output=0d486755bb37a66e input=90e223c70322c5cd]*/
+{
+ return _PyIncrementalNewlineDecoder_decode((PyObject *) self, input, final);
+}
+
+/*[clinic input]
+_io.IncrementalNewlineDecoder.getstate
+[clinic start generated code]*/
+
+static PyObject *
+_io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self)
+/*[clinic end generated code: output=f0d2c9c136f4e0d0 input=f8ff101825e32e7f]*/
+{
+ PyObject *buffer;
+ unsigned long long flag;
+
+ CHECK_INITIALIZED_DECODER(self);
+
+ if (self->decoder != Py_None) {
+ PyObject *state = PyObject_CallMethodNoArgs(self->decoder,
+ &_Py_ID(getstate));
+ if (state == NULL)
+ return NULL;
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError,
+ "illegal decoder state");
+ Py_DECREF(state);
+ return NULL;
+ }
+ if (!PyArg_ParseTuple(state, "OK;illegal decoder state",
+ &buffer, &flag))
+ {
+ Py_DECREF(state);
+ return NULL;
+ }
+ Py_INCREF(buffer);
+ Py_DECREF(state);
+ }
+ else {
+ buffer = PyBytes_FromString("");
+ flag = 0;
+ }
+ flag <<= 1;
+ if (self->pendingcr)
+ flag |= 1;
+ return Py_BuildValue("NK", buffer, flag);
+}
+
+/*[clinic input]
+_io.IncrementalNewlineDecoder.setstate
+ state: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io_IncrementalNewlineDecoder_setstate(nldecoder_object *self,
+ PyObject *state)
+/*[clinic end generated code: output=c10c622508b576cb input=c53fb505a76dbbe2]*/
+{
+ PyObject *buffer;
+ unsigned long long flag;
+
+ CHECK_INITIALIZED_DECODER(self);
+
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state argument must be a tuple");
+ return NULL;
+ }
+ if (!PyArg_ParseTuple(state, "OK;setstate(): illegal state argument",
+ &buffer, &flag))
+ {
+ return NULL;
+ }
+
+ self->pendingcr = (int) (flag & 1);
+ flag >>= 1;
+
+ if (self->decoder != Py_None) {
+ return _PyObject_CallMethod(self->decoder, &_Py_ID(setstate),
+ "((OK))", buffer, flag);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+
+/*[clinic input]
+_io.IncrementalNewlineDecoder.reset
+[clinic start generated code]*/
+
+static PyObject *
+_io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self)
+/*[clinic end generated code: output=32fa40c7462aa8ff input=728678ddaea776df]*/
+{
+ CHECK_INITIALIZED_DECODER(self);
+
+ self->seennl = 0;
+ self->pendingcr = 0;
+ if (self->decoder != Py_None)
+ return PyObject_CallMethodNoArgs(self->decoder, &_Py_ID(reset));
+ else
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+incrementalnewlinedecoder_newlines_get(nldecoder_object *self, void *context)
+{
+ CHECK_INITIALIZED_DECODER(self);
+
+ switch (self->seennl) {
+ case SEEN_CR:
+ return PyUnicode_FromString("\r");
+ case SEEN_LF:
+ return PyUnicode_FromString("\n");
+ case SEEN_CRLF:
+ return PyUnicode_FromString("\r\n");
+ case SEEN_CR | SEEN_LF:
+ return Py_BuildValue("ss", "\r", "\n");
+ case SEEN_CR | SEEN_CRLF:
+ return Py_BuildValue("ss", "\r", "\r\n");
+ case SEEN_LF | SEEN_CRLF:
+ return Py_BuildValue("ss", "\n", "\r\n");
+ case SEEN_CR | SEEN_LF | SEEN_CRLF:
+ return Py_BuildValue("sss", "\r", "\n", "\r\n");
+ default:
+ Py_RETURN_NONE;
+ }
+
+}
+
+/* TextIOWrapper */
+
+typedef PyObject *
+ (*encodefunc_t)(PyObject *, PyObject *);
+
+struct textio
+{
+ PyObject_HEAD
+ int ok; /* initialized? */
+ int detached;
+ Py_ssize_t chunk_size;
+ PyObject *buffer;
+ PyObject *encoding;
+ PyObject *encoder;
+ PyObject *decoder;
+ PyObject *readnl;
+ PyObject *errors;
+ const char *writenl; /* ASCII-encoded; NULL stands for \n */
+ char line_buffering;
+ char write_through;
+ char readuniversal;
+ char readtranslate;
+ char writetranslate;
+ char seekable;
+ char has_read1;
+ char telling;
+ char finalizing;
+ /* Specialized encoding func (see below) */
+ encodefunc_t encodefunc;
+ /* Whether or not it's the start of the stream */
+ char encoding_start_of_stream;
+
+ /* Reads and writes are internally buffered in order to speed things up.
+ However, any read will first flush the write buffer if itsn't empty.
+
+ Please also note that text to be written is first encoded before being
+ buffered. This is necessary so that encoding errors are immediately
+ reported to the caller, but it unfortunately means that the
+ IncrementalEncoder (whose encode() method is always written in Python)
+ becomes a bottleneck for small writes.
+ */
+ PyObject *decoded_chars; /* buffer for text returned from decoder */
+ Py_ssize_t decoded_chars_used; /* offset into _decoded_chars for read() */
+ PyObject *pending_bytes; // data waiting to be written.
+ // ascii unicode, bytes, or list of them.
+ Py_ssize_t pending_bytes_count;
+
+ /* snapshot is either NULL, or a tuple (dec_flags, next_input) where
+ * dec_flags is the second (integer) item of the decoder state and
+ * next_input is the chunk of input bytes that comes next after the
+ * snapshot point. We use this to reconstruct decoder states in tell().
+ */
+ PyObject *snapshot;
+ /* Bytes-to-characters ratio for the current chunk. Serves as input for
+ the heuristic in tell(). */
+ double b2cratio;
+
+ /* Cache raw object if it's a FileIO object */
+ PyObject *raw;
+
+ PyObject *weakreflist;
+ PyObject *dict;
+
+ _PyIO_State *state;
+};
+
+static void
+textiowrapper_set_decoded_chars(textio *self, PyObject *chars);
+
+/* A couple of specialized cases in order to bypass the slow incremental
+ encoding methods for the most popular encodings. */
+
+static PyObject *
+ascii_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_AsASCIIString(text, PyUnicode_AsUTF8(self->errors));
+}
+
+static PyObject *
+utf16be_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_EncodeUTF16(text,
+ PyUnicode_AsUTF8(self->errors), 1);
+}
+
+static PyObject *
+utf16le_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_EncodeUTF16(text,
+ PyUnicode_AsUTF8(self->errors), -1);
+}
+
+static PyObject *
+utf16_encode(textio *self, PyObject *text)
+{
+ if (!self->encoding_start_of_stream) {
+ /* Skip the BOM and use native byte ordering */
+#if PY_BIG_ENDIAN
+ return utf16be_encode(self, text);
+#else
+ return utf16le_encode(self, text);
+#endif
+ }
+ return _PyUnicode_EncodeUTF16(text,
+ PyUnicode_AsUTF8(self->errors), 0);
+}
+
+static PyObject *
+utf32be_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_EncodeUTF32(text,
+ PyUnicode_AsUTF8(self->errors), 1);
+}
+
+static PyObject *
+utf32le_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_EncodeUTF32(text,
+ PyUnicode_AsUTF8(self->errors), -1);
+}
+
+static PyObject *
+utf32_encode(textio *self, PyObject *text)
+{
+ if (!self->encoding_start_of_stream) {
+ /* Skip the BOM and use native byte ordering */
+#if PY_BIG_ENDIAN
+ return utf32be_encode(self, text);
+#else
+ return utf32le_encode(self, text);
+#endif
+ }
+ return _PyUnicode_EncodeUTF32(text,
+ PyUnicode_AsUTF8(self->errors), 0);
+}
+
+static PyObject *
+utf8_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_AsUTF8String(text, PyUnicode_AsUTF8(self->errors));
+}
+
+static PyObject *
+latin1_encode(textio *self, PyObject *text)
+{
+ return _PyUnicode_AsLatin1String(text, PyUnicode_AsUTF8(self->errors));
+}
+
+// Return true when encoding can be skipped when text is ascii.
+static inline int
+is_asciicompat_encoding(encodefunc_t f)
+{
+ return f == (encodefunc_t) ascii_encode
+ || f == (encodefunc_t) latin1_encode
+ || f == (encodefunc_t) utf8_encode;
+}
+
+/* Map normalized encoding names onto the specialized encoding funcs */
+
+typedef struct {
+ const char *name;
+ encodefunc_t encodefunc;
+} encodefuncentry;
+
+static const encodefuncentry encodefuncs[] = {
+ {"ascii", (encodefunc_t) ascii_encode},
+ {"iso8859-1", (encodefunc_t) latin1_encode},
+ {"utf-8", (encodefunc_t) utf8_encode},
+ {"utf-16-be", (encodefunc_t) utf16be_encode},
+ {"utf-16-le", (encodefunc_t) utf16le_encode},
+ {"utf-16", (encodefunc_t) utf16_encode},
+ {"utf-32-be", (encodefunc_t) utf32be_encode},
+ {"utf-32-le", (encodefunc_t) utf32le_encode},
+ {"utf-32", (encodefunc_t) utf32_encode},
+ {NULL, NULL}
+};
+
+static int
+validate_newline(const char *newline)
+{
+ if (newline && newline[0] != '\0'
+ && !(newline[0] == '\n' && newline[1] == '\0')
+ && !(newline[0] == '\r' && newline[1] == '\0')
+ && !(newline[0] == '\r' && newline[1] == '\n' && newline[2] == '\0')) {
+ PyErr_Format(PyExc_ValueError,
+ "illegal newline value: %s", newline);
+ return -1;
+ }
+ return 0;
+}
+
+static int
+set_newline(textio *self, const char *newline)
+{
+ PyObject *old = self->readnl;
+ if (newline == NULL) {
+ self->readnl = NULL;
+ }
+ else {
+ self->readnl = PyUnicode_FromString(newline);
+ if (self->readnl == NULL) {
+ self->readnl = old;
+ return -1;
+ }
+ }
+ self->readuniversal = (newline == NULL || newline[0] == '\0');
+ self->readtranslate = (newline == NULL);
+ self->writetranslate = (newline == NULL || newline[0] != '\0');
+ if (!self->readuniversal && self->readnl != NULL) {
+ // validate_newline() accepts only ASCII newlines.
+ assert(PyUnicode_KIND(self->readnl) == PyUnicode_1BYTE_KIND);
+ self->writenl = (const char *)PyUnicode_1BYTE_DATA(self->readnl);
+ if (strcmp(self->writenl, "\n") == 0) {
+ self->writenl = NULL;
+ }
+ }
+ else {
+#ifdef MS_WINDOWS
+ self->writenl = "\r\n";
+#else
+ self->writenl = NULL;
+#endif
+ }
+ Py_XDECREF(old);
+ return 0;
+}
+
+static int
+_textiowrapper_set_decoder(textio *self, PyObject *codec_info,
+ const char *errors)
+{
+ PyObject *res;
+ int r;
+
+ res = PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(readable));
+ if (res == NULL)
+ return -1;
+
+ r = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (r == -1)
+ return -1;
+
+ if (r != 1)
+ return 0;
+
+ Py_CLEAR(self->decoder);
+ self->decoder = _PyCodecInfo_GetIncrementalDecoder(codec_info, errors);
+ if (self->decoder == NULL)
+ return -1;
+
+ if (self->readuniversal) {
+ _PyIO_State *state = self->state;
+ PyObject *incrementalDecoder = PyObject_CallFunctionObjArgs(
+ (PyObject *)state->PyIncrementalNewlineDecoder_Type,
+ self->decoder, self->readtranslate ? Py_True : Py_False, NULL);
+ if (incrementalDecoder == NULL)
+ return -1;
+ Py_XSETREF(self->decoder, incrementalDecoder);
+ }
+
+ return 0;
+}
+
+static PyObject*
+_textiowrapper_decode(_PyIO_State *state, PyObject *decoder, PyObject *bytes,
+ int eof)
+{
+ PyObject *chars;
+
+ if (Py_IS_TYPE(decoder, state->PyIncrementalNewlineDecoder_Type))
+ chars = _PyIncrementalNewlineDecoder_decode(decoder, bytes, eof);
+ else
+ chars = PyObject_CallMethodObjArgs(decoder, &_Py_ID(decode), bytes,
+ eof ? Py_True : Py_False, NULL);
+
+ if (check_decoded(chars) < 0)
+ // check_decoded already decreases refcount
+ return NULL;
+
+ return chars;
+}
+
+static int
+_textiowrapper_set_encoder(textio *self, PyObject *codec_info,
+ const char *errors)
+{
+ PyObject *res;
+ int r;
+
+ res = PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(writable));
+ if (res == NULL)
+ return -1;
+
+ r = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (r == -1)
+ return -1;
+
+ if (r != 1)
+ return 0;
+
+ Py_CLEAR(self->encoder);
+ self->encodefunc = NULL;
+ self->encoder = _PyCodecInfo_GetIncrementalEncoder(codec_info, errors);
+ if (self->encoder == NULL)
+ return -1;
+
+ /* Get the normalized named of the codec */
+ if (_PyObject_LookupAttr(codec_info, &_Py_ID(name), &res) < 0) {
+ return -1;
+ }
+ if (res != NULL && PyUnicode_Check(res)) {
+ const encodefuncentry *e = encodefuncs;
+ while (e->name != NULL) {
+ if (_PyUnicode_EqualToASCIIString(res, e->name)) {
+ self->encodefunc = e->encodefunc;
+ break;
+ }
+ e++;
+ }
+ }
+ Py_XDECREF(res);
+
+ return 0;
+}
+
+static int
+_textiowrapper_fix_encoder_state(textio *self)
+{
+ if (!self->seekable || !self->encoder) {
+ return 0;
+ }
+
+ self->encoding_start_of_stream = 1;
+
+ PyObject *cookieObj = PyObject_CallMethodNoArgs(
+ self->buffer, &_Py_ID(tell));
+ if (cookieObj == NULL) {
+ return -1;
+ }
+
+ int cmp = PyObject_RichCompareBool(cookieObj, _PyLong_GetZero(), Py_EQ);
+ Py_DECREF(cookieObj);
+ if (cmp < 0) {
+ return -1;
+ }
+
+ if (cmp == 0) {
+ self->encoding_start_of_stream = 0;
+ PyObject *res = PyObject_CallMethodOneArg(
+ self->encoder, &_Py_ID(setstate), _PyLong_GetZero());
+ if (res == NULL) {
+ return -1;
+ }
+ Py_DECREF(res);
+ }
+
+ return 0;
+}
+
+static int
+io_check_errors(PyObject *errors)
+{
+ assert(errors != NULL && errors != Py_None);
+
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+#ifndef Py_DEBUG
+ /* In release mode, only check in development mode (-X dev) */
+ if (!_PyInterpreterState_GetConfig(interp)->dev_mode) {
+ return 0;
+ }
+#else
+ /* Always check in debug mode */
+#endif
+
+ /* Avoid calling PyCodec_LookupError() before the codec registry is ready:
+ before_PyUnicode_InitEncodings() is called. */
+ if (!interp->unicode.fs_codec.encoding) {
+ return 0;
+ }
+
+ Py_ssize_t name_length;
+ const char *name = PyUnicode_AsUTF8AndSize(errors, &name_length);
+ if (name == NULL) {
+ return -1;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character in errors");
+ return -1;
+ }
+ PyObject *handler = PyCodec_LookupError(name);
+ if (handler != NULL) {
+ Py_DECREF(handler);
+ return 0;
+ }
+ return -1;
+}
+
+
+
+/*[clinic input]
+_io.TextIOWrapper.__init__
+ buffer: object
+ encoding: str(accept={str, NoneType}) = None
+ errors: object = None
+ newline: str(accept={str, NoneType}) = None
+ line_buffering: bool = False
+ write_through: bool = False
+
+Character and line based layer over a BufferedIOBase object, buffer.
+
+encoding gives the name of the encoding that the stream will be
+decoded or encoded with. It defaults to locale.getencoding().
+
+errors determines the strictness of encoding and decoding (see
+help(codecs.Codec) or the documentation for codecs.register) and
+defaults to "strict".
+
+newline controls how line endings are handled. It can be None, '',
+'\n', '\r', and '\r\n'. It works as follows:
+
+* On input, if newline is None, universal newlines mode is
+ enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
+ these are translated into '\n' before being returned to the
+ caller. If it is '', universal newline mode is enabled, but line
+ endings are returned to the caller untranslated. If it has any of
+ the other legal values, input lines are only terminated by the given
+ string, and the line ending is returned to the caller untranslated.
+
+* On output, if newline is None, any '\n' characters written are
+ translated to the system default line separator, os.linesep. If
+ newline is '' or '\n', no translation takes place. If newline is any
+ of the other legal values, any '\n' characters written are translated
+ to the given string.
+
+If line_buffering is True, a call to flush is implied when a call to
+write contains a newline character.
+[clinic start generated code]*/
+
+static int
+_io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
+ const char *encoding, PyObject *errors,
+ const char *newline, int line_buffering,
+ int write_through)
+/*[clinic end generated code: output=72267c0c01032ed2 input=e6cfaaaf6059d4f5]*/
+{
+ PyObject *raw, *codec_info = NULL;
+ PyObject *res;
+ int r;
+
+ self->ok = 0;
+ self->detached = 0;
+
+ if (encoding == NULL) {
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (_PyInterpreterState_GetConfig(interp)->warn_default_encoding) {
+ if (PyErr_WarnEx(PyExc_EncodingWarning,
+ "'encoding' argument not specified", 1)) {
+ return -1;
+ }
+ }
+ }
+
+ if (errors == Py_None) {
+ errors = &_Py_ID(strict);
+ }
+ else if (!PyUnicode_Check(errors)) {
+ // Check 'errors' argument here because Argument Clinic doesn't support
+ // 'str(accept={str, NoneType})' converter.
+ PyErr_Format(
+ PyExc_TypeError,
+ "TextIOWrapper() argument 'errors' must be str or None, not %.50s",
+ Py_TYPE(errors)->tp_name);
+ return -1;
+ }
+ else if (io_check_errors(errors)) {
+ return -1;
+ }
+ Py_ssize_t errors_len;
+ const char *errors_str = PyUnicode_AsUTF8AndSize(errors, &errors_len);
+ if (errors_str == NULL) {
+ return -1;
+ }
+ if (strlen(errors_str) != (size_t)errors_len) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ return -1;
+ }
+
+ if (validate_newline(newline) < 0) {
+ return -1;
+ }
+
+ Py_CLEAR(self->buffer);
+ Py_CLEAR(self->encoding);
+ Py_CLEAR(self->encoder);
+ Py_CLEAR(self->decoder);
+ Py_CLEAR(self->readnl);
+ Py_CLEAR(self->decoded_chars);
+ Py_CLEAR(self->pending_bytes);
+ Py_CLEAR(self->snapshot);
+ Py_CLEAR(self->errors);
+ Py_CLEAR(self->raw);
+ self->decoded_chars_used = 0;
+ self->pending_bytes_count = 0;
+ self->encodefunc = NULL;
+ self->b2cratio = 0.0;
+
+ if (encoding == NULL && _PyRuntime.preconfig.utf8_mode) {
+ _Py_DECLARE_STR(utf_8, "utf-8");
+ self->encoding = Py_NewRef(&_Py_STR(utf_8));
+ }
+ else if (encoding == NULL || (strcmp(encoding, "locale") == 0)) {
+ self->encoding = _Py_GetLocaleEncodingObject();
+ if (self->encoding == NULL) {
+ goto error;
+ }
+ assert(PyUnicode_Check(self->encoding));
+ }
+
+ if (self->encoding != NULL) {
+ encoding = PyUnicode_AsUTF8(self->encoding);
+ if (encoding == NULL)
+ goto error;
+ }
+ else if (encoding != NULL) {
+ self->encoding = PyUnicode_FromString(encoding);
+ if (self->encoding == NULL)
+ goto error;
+ }
+ else {
+ PyErr_SetString(PyExc_OSError,
+ "could not determine default encoding");
+ goto error;
+ }
+
+ /* Check we have been asked for a real text encoding */
+ codec_info = _PyCodec_LookupTextEncoding(encoding, "codecs.open()");
+ if (codec_info == NULL) {
+ Py_CLEAR(self->encoding);
+ goto error;
+ }
+
+ /* XXX: Failures beyond this point have the potential to leak elements
+ * of the partially constructed object (like self->encoding)
+ */
+
+ self->errors = Py_NewRef(errors);
+ self->chunk_size = 8192;
+ self->line_buffering = line_buffering;
+ self->write_through = write_through;
+ if (set_newline(self, newline) < 0) {
+ goto error;
+ }
+
+ self->buffer = Py_NewRef(buffer);
+
+ /* Build the decoder object */
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ self->state = state;
+ if (_textiowrapper_set_decoder(self, codec_info, errors_str) != 0)
+ goto error;
+
+ /* Build the encoder object */
+ if (_textiowrapper_set_encoder(self, codec_info, errors_str) != 0)
+ goto error;
+
+ /* Finished sorting out the codec details */
+ Py_CLEAR(codec_info);
+
+ if (Py_IS_TYPE(buffer, state->PyBufferedReader_Type) ||
+ Py_IS_TYPE(buffer, state->PyBufferedWriter_Type) ||
+ Py_IS_TYPE(buffer, state->PyBufferedRandom_Type))
+ {
+ if (_PyObject_LookupAttr(buffer, &_Py_ID(raw), &raw) < 0)
+ goto error;
+ /* Cache the raw FileIO object to speed up 'closed' checks */
+ if (raw != NULL) {
+ if (Py_IS_TYPE(raw, state->PyFileIO_Type))
+ self->raw = raw;
+ else
+ Py_DECREF(raw);
+ }
+ }
+
+ res = PyObject_CallMethodNoArgs(buffer, &_Py_ID(seekable));
+ if (res == NULL)
+ goto error;
+ r = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (r < 0)
+ goto error;
+ self->seekable = self->telling = r;
+
+ r = _PyObject_LookupAttr(buffer, &_Py_ID(read1), &res);
+ if (r < 0) {
+ goto error;
+ }
+ Py_XDECREF(res);
+ self->has_read1 = r;
+
+ self->encoding_start_of_stream = 0;
+ if (_textiowrapper_fix_encoder_state(self) < 0) {
+ goto error;
+ }
+
+ self->ok = 1;
+ return 0;
+
+ error:
+ Py_XDECREF(codec_info);
+ return -1;
+}
+
+/* Return *default_value* if ob is None, 0 if ob is false, 1 if ob is true,
+ * -1 on error.
+ */
+static int
+convert_optional_bool(PyObject *obj, int default_value)
+{
+ long v;
+ if (obj == Py_None) {
+ v = default_value;
+ }
+ else {
+ v = PyLong_AsLong(obj);
+ if (v == -1 && PyErr_Occurred())
+ return -1;
+ }
+ return v != 0;
+}
+
+static int
+textiowrapper_change_encoding(textio *self, PyObject *encoding,
+ PyObject *errors, int newline_changed)
+{
+ /* Use existing settings where new settings are not specified */
+ if (encoding == Py_None && errors == Py_None && !newline_changed) {
+ return 0; // no change
+ }
+
+ if (encoding == Py_None) {
+ encoding = self->encoding;
+ if (errors == Py_None) {
+ errors = self->errors;
+ }
+ Py_INCREF(encoding);
+ }
+ else {
+ if (_PyUnicode_EqualToASCIIString(encoding, "locale")) {
+ encoding = _Py_GetLocaleEncodingObject();
+ if (encoding == NULL) {
+ return -1;
+ }
+ } else {
+ Py_INCREF(encoding);
+ }
+ if (errors == Py_None) {
+ errors = &_Py_ID(strict);
+ }
+ }
+ Py_INCREF(errors);
+
+ const char *c_encoding = PyUnicode_AsUTF8(encoding);
+ if (c_encoding == NULL) {
+ Py_DECREF(encoding);
+ Py_DECREF(errors);
+ return -1;
+ }
+ const char *c_errors = PyUnicode_AsUTF8(errors);
+ if (c_errors == NULL) {
+ Py_DECREF(encoding);
+ Py_DECREF(errors);
+ return -1;
+ }
+
+ // Create new encoder & decoder
+ PyObject *codec_info = _PyCodec_LookupTextEncoding(
+ c_encoding, "codecs.open()");
+ if (codec_info == NULL) {
+ Py_DECREF(encoding);
+ Py_DECREF(errors);
+ return -1;
+ }
+ if (_textiowrapper_set_decoder(self, codec_info, c_errors) != 0 ||
+ _textiowrapper_set_encoder(self, codec_info, c_errors) != 0) {
+ Py_DECREF(codec_info);
+ Py_DECREF(encoding);
+ Py_DECREF(errors);
+ return -1;
+ }
+ Py_DECREF(codec_info);
+
+ Py_SETREF(self->encoding, encoding);
+ Py_SETREF(self->errors, errors);
+
+ return _textiowrapper_fix_encoder_state(self);
+}
+
+/*[clinic input]
+_io.TextIOWrapper.reconfigure
+ *
+ encoding: object = None
+ errors: object = None
+ newline as newline_obj: object(c_default="NULL") = None
+ line_buffering as line_buffering_obj: object = None
+ write_through as write_through_obj: object = None
+
+Reconfigure the text stream with new parameters.
+
+This also does an implicit stream flush.
+
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding,
+ PyObject *errors, PyObject *newline_obj,
+ PyObject *line_buffering_obj,
+ PyObject *write_through_obj)
+/*[clinic end generated code: output=52b812ff4b3d4b0f input=671e82136e0f5822]*/
+{
+ int line_buffering;
+ int write_through;
+ const char *newline = NULL;
+
+ if (encoding != Py_None && !PyUnicode_Check(encoding)) {
+ PyErr_Format(PyExc_TypeError,
+ "reconfigure() argument 'encoding' must be str or None, not %s",
+ Py_TYPE(encoding)->tp_name);
+ return NULL;
+ }
+ if (errors != Py_None && !PyUnicode_Check(errors)) {
+ PyErr_Format(PyExc_TypeError,
+ "reconfigure() argument 'errors' must be str or None, not %s",
+ Py_TYPE(errors)->tp_name);
+ return NULL;
+ }
+ if (newline_obj != NULL && newline_obj != Py_None &&
+ !PyUnicode_Check(newline_obj))
+ {
+ PyErr_Format(PyExc_TypeError,
+ "reconfigure() argument 'newline' must be str or None, not %s",
+ Py_TYPE(newline_obj)->tp_name);
+ return NULL;
+ }
+ /* Check if something is in the read buffer */
+ if (self->decoded_chars != NULL) {
+ if (encoding != Py_None || errors != Py_None || newline_obj != NULL) {
+ _unsupported(self->state,
+ "It is not possible to set the encoding or newline "
+ "of stream after the first read");
+ return NULL;
+ }
+ }
+
+ if (newline_obj != NULL && newline_obj != Py_None) {
+ newline = PyUnicode_AsUTF8(newline_obj);
+ if (newline == NULL || validate_newline(newline) < 0) {
+ return NULL;
+ }
+ }
+
+ line_buffering = convert_optional_bool(line_buffering_obj,
+ self->line_buffering);
+ if (line_buffering < 0) {
+ return NULL;
+ }
+ write_through = convert_optional_bool(write_through_obj,
+ self->write_through);
+ if (write_through < 0) {
+ return NULL;
+ }
+
+ PyObject *res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL) {
+ return NULL;
+ }
+ Py_DECREF(res);
+ self->b2cratio = 0;
+
+ if (newline_obj != NULL && set_newline(self, newline) < 0) {
+ return NULL;
+ }
+
+ if (textiowrapper_change_encoding(
+ self, encoding, errors, newline_obj != NULL) < 0) {
+ return NULL;
+ }
+
+ self->line_buffering = line_buffering;
+ self->write_through = write_through;
+ Py_RETURN_NONE;
+}
+
+static int
+textiowrapper_clear(textio *self)
+{
+ self->ok = 0;
+ Py_CLEAR(self->buffer);
+ Py_CLEAR(self->encoding);
+ Py_CLEAR(self->encoder);
+ Py_CLEAR(self->decoder);
+ Py_CLEAR(self->readnl);
+ Py_CLEAR(self->decoded_chars);
+ Py_CLEAR(self->pending_bytes);
+ Py_CLEAR(self->snapshot);
+ Py_CLEAR(self->errors);
+ Py_CLEAR(self->raw);
+
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+textiowrapper_dealloc(textio *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ self->finalizing = 1;
+ if (_PyIOBase_finalize((PyObject *) self) < 0)
+ return;
+ self->ok = 0;
+ _PyObject_GC_UNTRACK(self);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *)self);
+ (void)textiowrapper_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+textiowrapper_traverse(textio *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->buffer);
+ Py_VISIT(self->encoding);
+ Py_VISIT(self->encoder);
+ Py_VISIT(self->decoder);
+ Py_VISIT(self->readnl);
+ Py_VISIT(self->decoded_chars);
+ Py_VISIT(self->pending_bytes);
+ Py_VISIT(self->snapshot);
+ Py_VISIT(self->errors);
+ Py_VISIT(self->raw);
+
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static PyObject *
+textiowrapper_closed_get(textio *self, void *context);
+
+/* This macro takes some shortcuts to make the common case faster. */
+#define CHECK_CLOSED(self) \
+ do { \
+ int r; \
+ PyObject *_res; \
+ if (Py_IS_TYPE(self, self->state->PyTextIOWrapper_Type)) { \
+ if (self->raw != NULL) \
+ r = _PyFileIO_closed(self->raw); \
+ else { \
+ _res = textiowrapper_closed_get(self, NULL); \
+ if (_res == NULL) \
+ return NULL; \
+ r = PyObject_IsTrue(_res); \
+ Py_DECREF(_res); \
+ if (r < 0) \
+ return NULL; \
+ } \
+ if (r > 0) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on closed file."); \
+ return NULL; \
+ } \
+ } \
+ else if (_PyIOBase_check_closed((PyObject *)self, Py_True) == NULL) \
+ return NULL; \
+ } while (0)
+
+#define CHECK_INITIALIZED(self) \
+ if (self->ok <= 0) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on uninitialized object"); \
+ return NULL; \
+ }
+
+#define CHECK_ATTACHED(self) \
+ CHECK_INITIALIZED(self); \
+ if (self->detached) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "underlying buffer has been detached"); \
+ return NULL; \
+ }
+
+#define CHECK_ATTACHED_INT(self) \
+ if (self->ok <= 0) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "I/O operation on uninitialized object"); \
+ return -1; \
+ } else if (self->detached) { \
+ PyErr_SetString(PyExc_ValueError, \
+ "underlying buffer has been detached"); \
+ return -1; \
+ }
+
+
+/*[clinic input]
+_io.TextIOWrapper.detach
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_detach_impl(textio *self)
+/*[clinic end generated code: output=7ba3715cd032d5f2 input=e5a71fbda9e1d9f9]*/
+{
+ PyObject *buffer, *res;
+ CHECK_ATTACHED(self);
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL)
+ return NULL;
+ Py_DECREF(res);
+ buffer = self->buffer;
+ self->buffer = NULL;
+ self->detached = 1;
+ return buffer;
+}
+
+/* Flush the internal write buffer. This doesn't explicitly flush the
+ underlying buffered object, though. */
+static int
+_textiowrapper_writeflush(textio *self)
+{
+ if (self->pending_bytes == NULL)
+ return 0;
+
+ PyObject *pending = self->pending_bytes;
+ PyObject *b;
+
+ if (PyBytes_Check(pending)) {
+ b = Py_NewRef(pending);
+ }
+ else if (PyUnicode_Check(pending)) {
+ assert(PyUnicode_IS_ASCII(pending));
+ assert(PyUnicode_GET_LENGTH(pending) == self->pending_bytes_count);
+ b = PyBytes_FromStringAndSize(
+ PyUnicode_DATA(pending), PyUnicode_GET_LENGTH(pending));
+ if (b == NULL) {
+ return -1;
+ }
+ }
+ else {
+ assert(PyList_Check(pending));
+ b = PyBytes_FromStringAndSize(NULL, self->pending_bytes_count);
+ if (b == NULL) {
+ return -1;
+ }
+
+ char *buf = PyBytes_AsString(b);
+ Py_ssize_t pos = 0;
+
+ for (Py_ssize_t i = 0; i < PyList_GET_SIZE(pending); i++) {
+ PyObject *obj = PyList_GET_ITEM(pending, i);
+ char *src;
+ Py_ssize_t len;
+ if (PyUnicode_Check(obj)) {
+ assert(PyUnicode_IS_ASCII(obj));
+ src = PyUnicode_DATA(obj);
+ len = PyUnicode_GET_LENGTH(obj);
+ }
+ else {
+ assert(PyBytes_Check(obj));
+ if (PyBytes_AsStringAndSize(obj, &src, &len) < 0) {
+ Py_DECREF(b);
+ return -1;
+ }
+ }
+ memcpy(buf + pos, src, len);
+ pos += len;
+ }
+ assert(pos == self->pending_bytes_count);
+ }
+
+ self->pending_bytes_count = 0;
+ self->pending_bytes = NULL;
+ Py_DECREF(pending);
+
+ PyObject *ret;
+ do {
+ ret = PyObject_CallMethodOneArg(self->buffer, &_Py_ID(write), b);
+ } while (ret == NULL && _PyIO_trap_eintr());
+ Py_DECREF(b);
+ // NOTE: We cleared buffer but we don't know how many bytes are actually written
+ // when an error occurred.
+ if (ret == NULL)
+ return -1;
+ Py_DECREF(ret);
+ return 0;
+}
+
+/*[clinic input]
+_io.TextIOWrapper.write
+ text: unicode
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_write_impl(textio *self, PyObject *text)
+/*[clinic end generated code: output=d2deb0d50771fcec input=fdf19153584a0e44]*/
+{
+ PyObject *ret;
+ PyObject *b;
+ Py_ssize_t textlen;
+ int haslf = 0;
+ int needflush = 0, text_needflush = 0;
+
+ if (PyUnicode_READY(text) == -1)
+ return NULL;
+
+ CHECK_ATTACHED(self);
+ CHECK_CLOSED(self);
+
+ if (self->encoder == NULL) {
+ return _unsupported(self->state, "not writable");
+ }
+
+ Py_INCREF(text);
+
+ textlen = PyUnicode_GET_LENGTH(text);
+
+ if ((self->writetranslate && self->writenl != NULL) || self->line_buffering)
+ if (PyUnicode_FindChar(text, '\n', 0, PyUnicode_GET_LENGTH(text), 1) != -1)
+ haslf = 1;
+
+ if (haslf && self->writetranslate && self->writenl != NULL) {
+ PyObject *newtext = _PyObject_CallMethod(text, &_Py_ID(replace),
+ "ss", "\n", self->writenl);
+ Py_DECREF(text);
+ if (newtext == NULL)
+ return NULL;
+ text = newtext;
+ }
+
+ if (self->write_through)
+ text_needflush = 1;
+ if (self->line_buffering &&
+ (haslf ||
+ PyUnicode_FindChar(text, '\r', 0, PyUnicode_GET_LENGTH(text), 1) != -1))
+ needflush = 1;
+
+ /* XXX What if we were just reading? */
+ if (self->encodefunc != NULL) {
+ if (PyUnicode_IS_ASCII(text) &&
+ // See bpo-43260
+ PyUnicode_GET_LENGTH(text) <= self->chunk_size &&
+ is_asciicompat_encoding(self->encodefunc)) {
+ b = Py_NewRef(text);
+ }
+ else {
+ b = (*self->encodefunc)((PyObject *) self, text);
+ }
+ self->encoding_start_of_stream = 0;
+ }
+ else {
+ b = PyObject_CallMethodOneArg(self->encoder, &_Py_ID(encode), text);
+ }
+
+ Py_DECREF(text);
+ if (b == NULL)
+ return NULL;
+ if (b != text && !PyBytes_Check(b)) {
+ PyErr_Format(PyExc_TypeError,
+ "encoder should return a bytes object, not '%.200s'",
+ Py_TYPE(b)->tp_name);
+ Py_DECREF(b);
+ return NULL;
+ }
+
+ Py_ssize_t bytes_len;
+ if (b == text) {
+ bytes_len = PyUnicode_GET_LENGTH(b);
+ }
+ else {
+ bytes_len = PyBytes_GET_SIZE(b);
+ }
+
+ if (self->pending_bytes == NULL) {
+ self->pending_bytes_count = 0;
+ self->pending_bytes = b;
+ }
+ else if (self->pending_bytes_count + bytes_len > self->chunk_size) {
+ // Prevent to concatenate more than chunk_size data.
+ if (_textiowrapper_writeflush(self) < 0) {
+ Py_DECREF(b);
+ return NULL;
+ }
+ self->pending_bytes = b;
+ }
+ else if (!PyList_CheckExact(self->pending_bytes)) {
+ PyObject *list = PyList_New(2);
+ if (list == NULL) {
+ Py_DECREF(b);
+ return NULL;
+ }
+ PyList_SET_ITEM(list, 0, self->pending_bytes);
+ PyList_SET_ITEM(list, 1, b);
+ self->pending_bytes = list;
+ }
+ else {
+ if (PyList_Append(self->pending_bytes, b) < 0) {
+ Py_DECREF(b);
+ return NULL;
+ }
+ Py_DECREF(b);
+ }
+
+ self->pending_bytes_count += bytes_len;
+ if (self->pending_bytes_count >= self->chunk_size || needflush ||
+ text_needflush) {
+ if (_textiowrapper_writeflush(self) < 0)
+ return NULL;
+ }
+
+ if (needflush) {
+ ret = PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(flush));
+ if (ret == NULL)
+ return NULL;
+ Py_DECREF(ret);
+ }
+
+ if (self->snapshot != NULL) {
+ textiowrapper_set_decoded_chars(self, NULL);
+ Py_CLEAR(self->snapshot);
+ }
+
+ if (self->decoder) {
+ ret = PyObject_CallMethodNoArgs(self->decoder, &_Py_ID(reset));
+ if (ret == NULL)
+ return NULL;
+ Py_DECREF(ret);
+ }
+
+ return PyLong_FromSsize_t(textlen);
+}
+
+/* Steal a reference to chars and store it in the decoded_char buffer;
+ */
+static void
+textiowrapper_set_decoded_chars(textio *self, PyObject *chars)
+{
+ Py_XSETREF(self->decoded_chars, chars);
+ self->decoded_chars_used = 0;
+}
+
+static PyObject *
+textiowrapper_get_decoded_chars(textio *self, Py_ssize_t n)
+{
+ PyObject *chars;
+ Py_ssize_t avail;
+
+ if (self->decoded_chars == NULL)
+ return PyUnicode_FromStringAndSize(NULL, 0);
+
+ /* decoded_chars is guaranteed to be "ready". */
+ avail = (PyUnicode_GET_LENGTH(self->decoded_chars)
+ - self->decoded_chars_used);
+
+ assert(avail >= 0);
+
+ if (n < 0 || n > avail)
+ n = avail;
+
+ if (self->decoded_chars_used > 0 || n < avail) {
+ chars = PyUnicode_Substring(self->decoded_chars,
+ self->decoded_chars_used,
+ self->decoded_chars_used + n);
+ if (chars == NULL)
+ return NULL;
+ }
+ else {
+ chars = Py_NewRef(self->decoded_chars);
+ }
+
+ self->decoded_chars_used += n;
+ return chars;
+}
+
+/* Read and decode the next chunk of data from the BufferedReader.
+ */
+static int
+textiowrapper_read_chunk(textio *self, Py_ssize_t size_hint)
+{
+ PyObject *dec_buffer = NULL;
+ PyObject *dec_flags = NULL;
+ PyObject *input_chunk = NULL;
+ Py_buffer input_chunk_buf;
+ PyObject *decoded_chars, *chunk_size;
+ Py_ssize_t nbytes, nchars;
+ int eof;
+
+ /* The return value is True unless EOF was reached. The decoded string is
+ * placed in self._decoded_chars (replacing its previous value). The
+ * entire input chunk is sent to the decoder, though some of it may remain
+ * buffered in the decoder, yet to be converted.
+ */
+
+ if (self->decoder == NULL) {
+ _unsupported(self->state, "not readable");
+ return -1;
+ }
+
+ if (self->telling) {
+ /* To prepare for tell(), we need to snapshot a point in the file
+ * where the decoder's input buffer is empty.
+ */
+ PyObject *state = PyObject_CallMethodNoArgs(self->decoder,
+ &_Py_ID(getstate));
+ if (state == NULL)
+ return -1;
+ /* Given this, we know there was a valid snapshot point
+ * len(dec_buffer) bytes ago with decoder state (b'', dec_flags).
+ */
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError,
+ "illegal decoder state");
+ Py_DECREF(state);
+ return -1;
+ }
+ if (!PyArg_ParseTuple(state,
+ "OO;illegal decoder state", &dec_buffer, &dec_flags))
+ {
+ Py_DECREF(state);
+ return -1;
+ }
+
+ if (!PyBytes_Check(dec_buffer)) {
+ PyErr_Format(PyExc_TypeError,
+ "illegal decoder state: the first item should be a "
+ "bytes object, not '%.200s'",
+ Py_TYPE(dec_buffer)->tp_name);
+ Py_DECREF(state);
+ return -1;
+ }
+ Py_INCREF(dec_buffer);
+ Py_INCREF(dec_flags);
+ Py_DECREF(state);
+ }
+
+ /* Read a chunk, decode it, and put the result in self._decoded_chars. */
+ if (size_hint > 0) {
+ size_hint = (Py_ssize_t)(Py_MAX(self->b2cratio, 1.0) * size_hint);
+ }
+ chunk_size = PyLong_FromSsize_t(Py_MAX(self->chunk_size, size_hint));
+ if (chunk_size == NULL)
+ goto fail;
+
+ input_chunk = PyObject_CallMethodOneArg(self->buffer,
+ (self->has_read1 ? &_Py_ID(read1): &_Py_ID(read)),
+ chunk_size);
+ Py_DECREF(chunk_size);
+ if (input_chunk == NULL)
+ goto fail;
+
+ if (PyObject_GetBuffer(input_chunk, &input_chunk_buf, 0) != 0) {
+ PyErr_Format(PyExc_TypeError,
+ "underlying %s() should have returned a bytes-like object, "
+ "not '%.200s'", (self->has_read1 ? "read1": "read"),
+ Py_TYPE(input_chunk)->tp_name);
+ goto fail;
+ }
+
+ nbytes = input_chunk_buf.len;
+ eof = (nbytes == 0);
+
+ decoded_chars = _textiowrapper_decode(self->state, self->decoder,
+ input_chunk, eof);
+ PyBuffer_Release(&input_chunk_buf);
+ if (decoded_chars == NULL)
+ goto fail;
+
+ textiowrapper_set_decoded_chars(self, decoded_chars);
+ nchars = PyUnicode_GET_LENGTH(decoded_chars);
+ if (nchars > 0)
+ self->b2cratio = (double) nbytes / nchars;
+ else
+ self->b2cratio = 0.0;
+ if (nchars > 0)
+ eof = 0;
+
+ if (self->telling) {
+ /* At the snapshot point, len(dec_buffer) bytes before the read, the
+ * next input to be decoded is dec_buffer + input_chunk.
+ */
+ PyObject *next_input = dec_buffer;
+ PyBytes_Concat(&next_input, input_chunk);
+ dec_buffer = NULL; /* Reference lost to PyBytes_Concat */
+ if (next_input == NULL) {
+ goto fail;
+ }
+ PyObject *snapshot = Py_BuildValue("NN", dec_flags, next_input);
+ if (snapshot == NULL) {
+ dec_flags = NULL;
+ goto fail;
+ }
+ Py_XSETREF(self->snapshot, snapshot);
+ }
+ Py_DECREF(input_chunk);
+
+ return (eof == 0);
+
+ fail:
+ Py_XDECREF(dec_buffer);
+ Py_XDECREF(dec_flags);
+ Py_XDECREF(input_chunk);
+ return -1;
+}
+
+/*[clinic input]
+_io.TextIOWrapper.read
+ size as n: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n)
+/*[clinic end generated code: output=7e651ce6cc6a25a6 input=123eecbfe214aeb8]*/
+{
+ PyObject *result = NULL, *chunks = NULL;
+
+ CHECK_ATTACHED(self);
+ CHECK_CLOSED(self);
+
+ if (self->decoder == NULL) {
+ return _unsupported(self->state, "not readable");
+ }
+
+ if (_textiowrapper_writeflush(self) < 0)
+ return NULL;
+
+ if (n < 0) {
+ /* Read everything */
+ PyObject *bytes = PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(read));
+ PyObject *decoded;
+ if (bytes == NULL)
+ goto fail;
+
+ _PyIO_State *state = self->state;
+ if (Py_IS_TYPE(self->decoder, state->PyIncrementalNewlineDecoder_Type))
+ decoded = _PyIncrementalNewlineDecoder_decode(self->decoder,
+ bytes, 1);
+ else
+ decoded = PyObject_CallMethodObjArgs(
+ self->decoder, &_Py_ID(decode), bytes, Py_True, NULL);
+ Py_DECREF(bytes);
+ if (check_decoded(decoded) < 0)
+ goto fail;
+
+ result = textiowrapper_get_decoded_chars(self, -1);
+
+ if (result == NULL) {
+ Py_DECREF(decoded);
+ return NULL;
+ }
+
+ PyUnicode_AppendAndDel(&result, decoded);
+ if (result == NULL)
+ goto fail;
+
+ if (self->snapshot != NULL) {
+ textiowrapper_set_decoded_chars(self, NULL);
+ Py_CLEAR(self->snapshot);
+ }
+ return result;
+ }
+ else {
+ int res = 1;
+ Py_ssize_t remaining = n;
+
+ result = textiowrapper_get_decoded_chars(self, n);
+ if (result == NULL)
+ goto fail;
+ if (PyUnicode_READY(result) == -1)
+ goto fail;
+ remaining -= PyUnicode_GET_LENGTH(result);
+
+ /* Keep reading chunks until we have n characters to return */
+ while (remaining > 0) {
+ res = textiowrapper_read_chunk(self, remaining);
+ if (res < 0) {
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals()
+ when EINTR occurs so we needn't do it ourselves. */
+ if (_PyIO_trap_eintr()) {
+ continue;
+ }
+ goto fail;
+ }
+ if (res == 0) /* EOF */
+ break;
+ if (chunks == NULL) {
+ chunks = PyList_New(0);
+ if (chunks == NULL)
+ goto fail;
+ }
+ if (PyUnicode_GET_LENGTH(result) > 0 &&
+ PyList_Append(chunks, result) < 0)
+ goto fail;
+ Py_DECREF(result);
+ result = textiowrapper_get_decoded_chars(self, remaining);
+ if (result == NULL)
+ goto fail;
+ remaining -= PyUnicode_GET_LENGTH(result);
+ }
+ if (chunks != NULL) {
+ if (result != NULL && PyList_Append(chunks, result) < 0)
+ goto fail;
+ _Py_DECLARE_STR(empty, "");
+ Py_XSETREF(result, PyUnicode_Join(&_Py_STR(empty), chunks));
+ if (result == NULL)
+ goto fail;
+ Py_CLEAR(chunks);
+ }
+ return result;
+ }
+ fail:
+ Py_XDECREF(result);
+ Py_XDECREF(chunks);
+ return NULL;
+}
+
+
+/* NOTE: `end` must point to the real end of the Py_UCS4 storage,
+ that is to the NUL character. Otherwise the function will produce
+ incorrect results. */
+static const char *
+find_control_char(int kind, const char *s, const char *end, Py_UCS4 ch)
+{
+ if (kind == PyUnicode_1BYTE_KIND) {
+ assert(ch < 256);
+ return (char *) memchr((const void *) s, (char) ch, end - s);
+ }
+ for (;;) {
+ while (PyUnicode_READ(kind, s, 0) > ch)
+ s += kind;
+ if (PyUnicode_READ(kind, s, 0) == ch)
+ return s;
+ if (s == end)
+ return NULL;
+ s += kind;
+ }
+}
+
+Py_ssize_t
+_PyIO_find_line_ending(
+ int translated, int universal, PyObject *readnl,
+ int kind, const char *start, const char *end, Py_ssize_t *consumed)
+{
+ Py_ssize_t len = (end - start)/kind;
+
+ if (translated) {
+ /* Newlines are already translated, only search for \n */
+ const char *pos = find_control_char(kind, start, end, '\n');
+ if (pos != NULL)
+ return (pos - start)/kind + 1;
+ else {
+ *consumed = len;
+ return -1;
+ }
+ }
+ else if (universal) {
+ /* Universal newline search. Find any of \r, \r\n, \n
+ * The decoder ensures that \r\n are not split in two pieces
+ */
+ const char *s = start;
+ for (;;) {
+ Py_UCS4 ch;
+ /* Fast path for non-control chars. The loop always ends
+ since the Unicode string is NUL-terminated. */
+ while (PyUnicode_READ(kind, s, 0) > '\r')
+ s += kind;
+ if (s >= end) {
+ *consumed = len;
+ return -1;
+ }
+ ch = PyUnicode_READ(kind, s, 0);
+ s += kind;
+ if (ch == '\n')
+ return (s - start)/kind;
+ if (ch == '\r') {
+ if (PyUnicode_READ(kind, s, 0) == '\n')
+ return (s - start)/kind + 1;
+ else
+ return (s - start)/kind;
+ }
+ }
+ }
+ else {
+ /* Non-universal mode. */
+ Py_ssize_t readnl_len = PyUnicode_GET_LENGTH(readnl);
+ const Py_UCS1 *nl = PyUnicode_1BYTE_DATA(readnl);
+ /* Assume that readnl is an ASCII character. */
+ assert(PyUnicode_KIND(readnl) == PyUnicode_1BYTE_KIND);
+ if (readnl_len == 1) {
+ const char *pos = find_control_char(kind, start, end, nl[0]);
+ if (pos != NULL)
+ return (pos - start)/kind + 1;
+ *consumed = len;
+ return -1;
+ }
+ else {
+ const char *s = start;
+ const char *e = end - (readnl_len - 1)*kind;
+ const char *pos;
+ if (e < s)
+ e = s;
+ while (s < e) {
+ Py_ssize_t i;
+ const char *pos = find_control_char(kind, s, end, nl[0]);
+ if (pos == NULL || pos >= e)
+ break;
+ for (i = 1; i < readnl_len; i++) {
+ if (PyUnicode_READ(kind, pos, i) != nl[i])
+ break;
+ }
+ if (i == readnl_len)
+ return (pos - start)/kind + readnl_len;
+ s = pos + kind;
+ }
+ pos = find_control_char(kind, e, end, nl[0]);
+ if (pos == NULL)
+ *consumed = len;
+ else
+ *consumed = (pos - start)/kind;
+ return -1;
+ }
+ }
+}
+
+static PyObject *
+_textiowrapper_readline(textio *self, Py_ssize_t limit)
+{
+ PyObject *line = NULL, *chunks = NULL, *remaining = NULL;
+ Py_ssize_t start, endpos, chunked, offset_to_buffer;
+ int res;
+
+ CHECK_CLOSED(self);
+
+ if (_textiowrapper_writeflush(self) < 0)
+ return NULL;
+
+ chunked = 0;
+
+ while (1) {
+ const char *ptr;
+ Py_ssize_t line_len;
+ int kind;
+ Py_ssize_t consumed = 0;
+
+ /* First, get some data if necessary */
+ res = 1;
+ while (!self->decoded_chars ||
+ !PyUnicode_GET_LENGTH(self->decoded_chars)) {
+ res = textiowrapper_read_chunk(self, 0);
+ if (res < 0) {
+ /* NOTE: PyErr_SetFromErrno() calls PyErr_CheckSignals()
+ when EINTR occurs so we needn't do it ourselves. */
+ if (_PyIO_trap_eintr()) {
+ continue;
+ }
+ goto error;
+ }
+ if (res == 0)
+ break;
+ }
+ if (res == 0) {
+ /* end of file */
+ textiowrapper_set_decoded_chars(self, NULL);
+ Py_CLEAR(self->snapshot);
+ start = endpos = offset_to_buffer = 0;
+ break;
+ }
+
+ if (remaining == NULL) {
+ line = Py_NewRef(self->decoded_chars);
+ start = self->decoded_chars_used;
+ offset_to_buffer = 0;
+ }
+ else {
+ assert(self->decoded_chars_used == 0);
+ line = PyUnicode_Concat(remaining, self->decoded_chars);
+ start = 0;
+ offset_to_buffer = PyUnicode_GET_LENGTH(remaining);
+ Py_CLEAR(remaining);
+ if (line == NULL)
+ goto error;
+ if (PyUnicode_READY(line) == -1)
+ goto error;
+ }
+
+ ptr = PyUnicode_DATA(line);
+ line_len = PyUnicode_GET_LENGTH(line);
+ kind = PyUnicode_KIND(line);
+
+ endpos = _PyIO_find_line_ending(
+ self->readtranslate, self->readuniversal, self->readnl,
+ kind,
+ ptr + kind * start,
+ ptr + kind * line_len,
+ &consumed);
+ if (endpos >= 0) {
+ endpos += start;
+ if (limit >= 0 && (endpos - start) + chunked >= limit)
+ endpos = start + limit - chunked;
+ break;
+ }
+
+ /* We can put aside up to `endpos` */
+ endpos = consumed + start;
+ if (limit >= 0 && (endpos - start) + chunked >= limit) {
+ /* Didn't find line ending, but reached length limit */
+ endpos = start + limit - chunked;
+ break;
+ }
+
+ if (endpos > start) {
+ /* No line ending seen yet - put aside current data */
+ PyObject *s;
+ if (chunks == NULL) {
+ chunks = PyList_New(0);
+ if (chunks == NULL)
+ goto error;
+ }
+ s = PyUnicode_Substring(line, start, endpos);
+ if (s == NULL)
+ goto error;
+ if (PyList_Append(chunks, s) < 0) {
+ Py_DECREF(s);
+ goto error;
+ }
+ chunked += PyUnicode_GET_LENGTH(s);
+ Py_DECREF(s);
+ }
+ /* There may be some remaining bytes we'll have to prepend to the
+ next chunk of data */
+ if (endpos < line_len) {
+ remaining = PyUnicode_Substring(line, endpos, line_len);
+ if (remaining == NULL)
+ goto error;
+ }
+ Py_CLEAR(line);
+ /* We have consumed the buffer */
+ textiowrapper_set_decoded_chars(self, NULL);
+ }
+
+ if (line != NULL) {
+ /* Our line ends in the current buffer */
+ self->decoded_chars_used = endpos - offset_to_buffer;
+ if (start > 0 || endpos < PyUnicode_GET_LENGTH(line)) {
+ PyObject *s = PyUnicode_Substring(line, start, endpos);
+ Py_CLEAR(line);
+ if (s == NULL)
+ goto error;
+ line = s;
+ }
+ }
+ if (remaining != NULL) {
+ if (chunks == NULL) {
+ chunks = PyList_New(0);
+ if (chunks == NULL)
+ goto error;
+ }
+ if (PyList_Append(chunks, remaining) < 0)
+ goto error;
+ Py_CLEAR(remaining);
+ }
+ if (chunks != NULL) {
+ if (line != NULL) {
+ if (PyList_Append(chunks, line) < 0)
+ goto error;
+ Py_DECREF(line);
+ }
+ line = PyUnicode_Join(&_Py_STR(empty), chunks);
+ if (line == NULL)
+ goto error;
+ Py_CLEAR(chunks);
+ }
+ if (line == NULL) {
+ line = Py_NewRef(&_Py_STR(empty));
+ }
+
+ return line;
+
+ error:
+ Py_XDECREF(chunks);
+ Py_XDECREF(remaining);
+ Py_XDECREF(line);
+ return NULL;
+}
+
+/*[clinic input]
+_io.TextIOWrapper.readline
+ size: Py_ssize_t = -1
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size)
+/*[clinic end generated code: output=344afa98804e8b25 input=56c7172483b36db6]*/
+{
+ CHECK_ATTACHED(self);
+ return _textiowrapper_readline(self, size);
+}
+
+/* Seek and Tell */
+
+typedef struct {
+ Py_off_t start_pos;
+ int dec_flags;
+ int bytes_to_feed;
+ int chars_to_skip;
+ char need_eof;
+} cookie_type;
+
+/*
+ To speed up cookie packing/unpacking, we store the fields in a temporary
+ string and call _PyLong_FromByteArray() or _PyLong_AsByteArray (resp.).
+ The following macros define at which offsets in the intermediary byte
+ string the various CookieStruct fields will be stored.
+ */
+
+#define COOKIE_BUF_LEN (sizeof(Py_off_t) + 3 * sizeof(int) + sizeof(char))
+
+#if PY_BIG_ENDIAN
+/* We want the least significant byte of start_pos to also be the least
+ significant byte of the cookie, which means that in big-endian mode we
+ must copy the fields in reverse order. */
+
+# define OFF_START_POS (sizeof(char) + 3 * sizeof(int))
+# define OFF_DEC_FLAGS (sizeof(char) + 2 * sizeof(int))
+# define OFF_BYTES_TO_FEED (sizeof(char) + sizeof(int))
+# define OFF_CHARS_TO_SKIP (sizeof(char))
+# define OFF_NEED_EOF 0
+
+#else
+/* Little-endian mode: the least significant byte of start_pos will
+ naturally end up the least significant byte of the cookie. */
+
+# define OFF_START_POS 0
+# define OFF_DEC_FLAGS (sizeof(Py_off_t))
+# define OFF_BYTES_TO_FEED (sizeof(Py_off_t) + sizeof(int))
+# define OFF_CHARS_TO_SKIP (sizeof(Py_off_t) + 2 * sizeof(int))
+# define OFF_NEED_EOF (sizeof(Py_off_t) + 3 * sizeof(int))
+
+#endif
+
+static int
+textiowrapper_parse_cookie(cookie_type *cookie, PyObject *cookieObj)
+{
+ unsigned char buffer[COOKIE_BUF_LEN];
+ PyLongObject *cookieLong = (PyLongObject *)PyNumber_Long(cookieObj);
+ if (cookieLong == NULL)
+ return -1;
+
+ if (_PyLong_AsByteArray(cookieLong, buffer, sizeof(buffer),
+ PY_LITTLE_ENDIAN, 0) < 0) {
+ Py_DECREF(cookieLong);
+ return -1;
+ }
+ Py_DECREF(cookieLong);
+
+ memcpy(&cookie->start_pos, buffer + OFF_START_POS, sizeof(cookie->start_pos));
+ memcpy(&cookie->dec_flags, buffer + OFF_DEC_FLAGS, sizeof(cookie->dec_flags));
+ memcpy(&cookie->bytes_to_feed, buffer + OFF_BYTES_TO_FEED, sizeof(cookie->bytes_to_feed));
+ memcpy(&cookie->chars_to_skip, buffer + OFF_CHARS_TO_SKIP, sizeof(cookie->chars_to_skip));
+ memcpy(&cookie->need_eof, buffer + OFF_NEED_EOF, sizeof(cookie->need_eof));
+
+ return 0;
+}
+
+static PyObject *
+textiowrapper_build_cookie(cookie_type *cookie)
+{
+ unsigned char buffer[COOKIE_BUF_LEN];
+
+ memcpy(buffer + OFF_START_POS, &cookie->start_pos, sizeof(cookie->start_pos));
+ memcpy(buffer + OFF_DEC_FLAGS, &cookie->dec_flags, sizeof(cookie->dec_flags));
+ memcpy(buffer + OFF_BYTES_TO_FEED, &cookie->bytes_to_feed, sizeof(cookie->bytes_to_feed));
+ memcpy(buffer + OFF_CHARS_TO_SKIP, &cookie->chars_to_skip, sizeof(cookie->chars_to_skip));
+ memcpy(buffer + OFF_NEED_EOF, &cookie->need_eof, sizeof(cookie->need_eof));
+
+ return _PyLong_FromByteArray(buffer, sizeof(buffer),
+ PY_LITTLE_ENDIAN, 0);
+}
+
+static int
+_textiowrapper_decoder_setstate(textio *self, cookie_type *cookie)
+{
+ PyObject *res;
+ /* When seeking to the start of the stream, we call decoder.reset()
+ rather than decoder.getstate().
+ This is for a few decoders such as utf-16 for which the state value
+ at start is not (b"", 0) but e.g. (b"", 2) (meaning, in the case of
+ utf-16, that we are expecting a BOM).
+ */
+ if (cookie->start_pos == 0 && cookie->dec_flags == 0) {
+ res = PyObject_CallMethodNoArgs(self->decoder, &_Py_ID(reset));
+ }
+ else {
+ res = _PyObject_CallMethod(self->decoder, &_Py_ID(setstate),
+ "((yi))", "", cookie->dec_flags);
+ }
+ if (res == NULL) {
+ return -1;
+ }
+ Py_DECREF(res);
+ return 0;
+}
+
+static int
+_textiowrapper_encoder_reset(textio *self, int start_of_stream)
+{
+ PyObject *res;
+ if (start_of_stream) {
+ res = PyObject_CallMethodNoArgs(self->encoder, &_Py_ID(reset));
+ self->encoding_start_of_stream = 1;
+ }
+ else {
+ res = PyObject_CallMethodOneArg(self->encoder, &_Py_ID(setstate),
+ _PyLong_GetZero());
+ self->encoding_start_of_stream = 0;
+ }
+ if (res == NULL)
+ return -1;
+ Py_DECREF(res);
+ return 0;
+}
+
+static int
+_textiowrapper_encoder_setstate(textio *self, cookie_type *cookie)
+{
+ /* Same as _textiowrapper_decoder_setstate() above. */
+ return _textiowrapper_encoder_reset(
+ self, cookie->start_pos == 0 && cookie->dec_flags == 0);
+}
+
+/*[clinic input]
+_io.TextIOWrapper.seek
+ cookie as cookieObj: object
+ Zero or an opaque number returned by tell().
+ whence: int(c_default='0') = os.SEEK_SET
+ The relative position to seek from.
+ /
+
+Set the stream position, and return the new stream position.
+
+Four operations are supported, given by the following argument
+combinations:
+
+- seek(0, SEEK_SET): Rewind to the start of the stream.
+- seek(cookie, SEEK_SET): Restore a previous position;
+ 'cookie' must be a number returned by tell().
+- seek(0, SEEK_END): Fast-forward to the end of the stream.
+- seek(0, SEEK_CUR): Leave the current stream position unchanged.
+
+Any other argument combinations are invalid,
+and may raise exceptions.
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence)
+/*[clinic end generated code: output=0a15679764e2d04d input=0f68adcb02cf2823]*/
+{
+ PyObject *posobj;
+ cookie_type cookie;
+ PyObject *res;
+ int cmp;
+ PyObject *snapshot;
+
+ CHECK_ATTACHED(self);
+ CHECK_CLOSED(self);
+
+ Py_INCREF(cookieObj);
+
+ if (!self->seekable) {
+ _unsupported(self->state, "underlying stream is not seekable");
+ goto fail;
+ }
+
+ PyObject *zero = _PyLong_GetZero(); // borrowed reference
+
+ switch (whence) {
+ case SEEK_CUR:
+ /* seek relative to current position */
+ cmp = PyObject_RichCompareBool(cookieObj, zero, Py_EQ);
+ if (cmp < 0)
+ goto fail;
+
+ if (cmp == 0) {
+ _unsupported(self->state, "can't do nonzero cur-relative seeks");
+ goto fail;
+ }
+
+ /* Seeking to the current position should attempt to
+ * sync the underlying buffer with the current position.
+ */
+ Py_DECREF(cookieObj);
+ cookieObj = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(tell));
+ if (cookieObj == NULL)
+ goto fail;
+ break;
+
+ case SEEK_END:
+ /* seek relative to end of file */
+ cmp = PyObject_RichCompareBool(cookieObj, zero, Py_EQ);
+ if (cmp < 0)
+ goto fail;
+
+ if (cmp == 0) {
+ _unsupported(self->state, "can't do nonzero end-relative seeks");
+ goto fail;
+ }
+
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL)
+ goto fail;
+ Py_DECREF(res);
+
+ textiowrapper_set_decoded_chars(self, NULL);
+ Py_CLEAR(self->snapshot);
+ if (self->decoder) {
+ res = PyObject_CallMethodNoArgs(self->decoder, &_Py_ID(reset));
+ if (res == NULL)
+ goto fail;
+ Py_DECREF(res);
+ }
+
+ res = _PyObject_CallMethod(self->buffer, &_Py_ID(seek), "ii", 0, 2);
+ Py_CLEAR(cookieObj);
+ if (res == NULL)
+ goto fail;
+ if (self->encoder) {
+ /* If seek() == 0, we are at the start of stream, otherwise not */
+ cmp = PyObject_RichCompareBool(res, zero, Py_EQ);
+ if (cmp < 0 || _textiowrapper_encoder_reset(self, cmp)) {
+ Py_DECREF(res);
+ goto fail;
+ }
+ }
+ return res;
+
+ case SEEK_SET:
+ break;
+
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "invalid whence (%d, should be %d, %d or %d)", whence,
+ SEEK_SET, SEEK_CUR, SEEK_END);
+ goto fail;
+ }
+
+ cmp = PyObject_RichCompareBool(cookieObj, zero, Py_LT);
+ if (cmp < 0)
+ goto fail;
+
+ if (cmp == 1) {
+ PyErr_Format(PyExc_ValueError,
+ "negative seek position %R", cookieObj);
+ goto fail;
+ }
+
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL)
+ goto fail;
+ Py_DECREF(res);
+
+ /* The strategy of seek() is to go back to the safe start point
+ * and replay the effect of read(chars_to_skip) from there.
+ */
+ if (textiowrapper_parse_cookie(&cookie, cookieObj) < 0)
+ goto fail;
+
+ /* Seek back to the safe start point. */
+ posobj = PyLong_FromOff_t(cookie.start_pos);
+ if (posobj == NULL)
+ goto fail;
+ res = PyObject_CallMethodOneArg(self->buffer, &_Py_ID(seek), posobj);
+ Py_DECREF(posobj);
+ if (res == NULL)
+ goto fail;
+ Py_DECREF(res);
+
+ textiowrapper_set_decoded_chars(self, NULL);
+ Py_CLEAR(self->snapshot);
+
+ /* Restore the decoder to its state from the safe start point. */
+ if (self->decoder) {
+ if (_textiowrapper_decoder_setstate(self, &cookie) < 0)
+ goto fail;
+ }
+
+ if (cookie.chars_to_skip) {
+ /* Just like _read_chunk, feed the decoder and save a snapshot. */
+ PyObject *input_chunk = _PyObject_CallMethod(self->buffer, &_Py_ID(read),
+ "i", cookie.bytes_to_feed);
+ PyObject *decoded;
+
+ if (input_chunk == NULL)
+ goto fail;
+
+ if (!PyBytes_Check(input_chunk)) {
+ PyErr_Format(PyExc_TypeError,
+ "underlying read() should have returned a bytes "
+ "object, not '%.200s'",
+ Py_TYPE(input_chunk)->tp_name);
+ Py_DECREF(input_chunk);
+ goto fail;
+ }
+
+ snapshot = Py_BuildValue("iN", cookie.dec_flags, input_chunk);
+ if (snapshot == NULL) {
+ goto fail;
+ }
+ Py_XSETREF(self->snapshot, snapshot);
+
+ decoded = PyObject_CallMethodObjArgs(self->decoder, &_Py_ID(decode),
+ input_chunk, cookie.need_eof ? Py_True : Py_False, NULL);
+
+ if (check_decoded(decoded) < 0)
+ goto fail;
+
+ textiowrapper_set_decoded_chars(self, decoded);
+
+ /* Skip chars_to_skip of the decoded characters. */
+ if (PyUnicode_GetLength(self->decoded_chars) < cookie.chars_to_skip) {
+ PyErr_SetString(PyExc_OSError, "can't restore logical file position");
+ goto fail;
+ }
+ self->decoded_chars_used = cookie.chars_to_skip;
+ }
+ else {
+ snapshot = Py_BuildValue("iy", cookie.dec_flags, "");
+ if (snapshot == NULL)
+ goto fail;
+ Py_XSETREF(self->snapshot, snapshot);
+ }
+
+ /* Finally, reset the encoder (merely useful for proper BOM handling) */
+ if (self->encoder) {
+ if (_textiowrapper_encoder_setstate(self, &cookie) < 0)
+ goto fail;
+ }
+ return cookieObj;
+ fail:
+ Py_XDECREF(cookieObj);
+ return NULL;
+
+}
+
+/*[clinic input]
+_io.TextIOWrapper.tell
+
+Return the stream position as an opaque number.
+
+The return value of tell() can be given as input to seek(), to restore a
+previous stream position.
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_tell_impl(textio *self)
+/*[clinic end generated code: output=4f168c08bf34ad5f input=0852d627d76fb520]*/
+{
+ PyObject *res;
+ PyObject *posobj = NULL;
+ cookie_type cookie = {0,0,0,0,0};
+ PyObject *next_input;
+ Py_ssize_t chars_to_skip, chars_decoded;
+ Py_ssize_t skip_bytes, skip_back;
+ PyObject *saved_state = NULL;
+ const char *input, *input_end;
+ Py_ssize_t dec_buffer_len;
+ int dec_flags;
+
+ CHECK_ATTACHED(self);
+ CHECK_CLOSED(self);
+
+ if (!self->seekable) {
+ _unsupported(self->state, "underlying stream is not seekable");
+ goto fail;
+ }
+ if (!self->telling) {
+ PyErr_SetString(PyExc_OSError,
+ "telling position disabled by next() call");
+ goto fail;
+ }
+
+ if (_textiowrapper_writeflush(self) < 0)
+ return NULL;
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL)
+ goto fail;
+ Py_DECREF(res);
+
+ posobj = PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(tell));
+ if (posobj == NULL)
+ goto fail;
+
+ if (self->decoder == NULL || self->snapshot == NULL) {
+ assert (self->decoded_chars == NULL || PyUnicode_GetLength(self->decoded_chars) == 0);
+ return posobj;
+ }
+
+#if defined(HAVE_LARGEFILE_SUPPORT)
+ cookie.start_pos = PyLong_AsLongLong(posobj);
+#else
+ cookie.start_pos = PyLong_AsLong(posobj);
+#endif
+ Py_DECREF(posobj);
+ if (PyErr_Occurred())
+ goto fail;
+
+ /* Skip backward to the snapshot point (see _read_chunk). */
+ assert(PyTuple_Check(self->snapshot));
+ if (!PyArg_ParseTuple(self->snapshot, "iO", &cookie.dec_flags, &next_input))
+ goto fail;
+
+ assert (PyBytes_Check(next_input));
+
+ cookie.start_pos -= PyBytes_GET_SIZE(next_input);
+
+ /* How many decoded characters have been used up since the snapshot? */
+ if (self->decoded_chars_used == 0) {
+ /* We haven't moved from the snapshot point. */
+ return textiowrapper_build_cookie(&cookie);
+ }
+
+ chars_to_skip = self->decoded_chars_used;
+
+ /* Decoder state will be restored at the end */
+ saved_state = PyObject_CallMethodNoArgs(self->decoder,
+ &_Py_ID(getstate));
+ if (saved_state == NULL)
+ goto fail;
+
+#define DECODER_GETSTATE() do { \
+ PyObject *dec_buffer; \
+ PyObject *_state = PyObject_CallMethodNoArgs(self->decoder, \
+ &_Py_ID(getstate)); \
+ if (_state == NULL) \
+ goto fail; \
+ if (!PyTuple_Check(_state)) { \
+ PyErr_SetString(PyExc_TypeError, \
+ "illegal decoder state"); \
+ Py_DECREF(_state); \
+ goto fail; \
+ } \
+ if (!PyArg_ParseTuple(_state, "Oi;illegal decoder state", \
+ &dec_buffer, &dec_flags)) \
+ { \
+ Py_DECREF(_state); \
+ goto fail; \
+ } \
+ if (!PyBytes_Check(dec_buffer)) { \
+ PyErr_Format(PyExc_TypeError, \
+ "illegal decoder state: the first item should be a " \
+ "bytes object, not '%.200s'", \
+ Py_TYPE(dec_buffer)->tp_name); \
+ Py_DECREF(_state); \
+ goto fail; \
+ } \
+ dec_buffer_len = PyBytes_GET_SIZE(dec_buffer); \
+ Py_DECREF(_state); \
+ } while (0)
+
+#define DECODER_DECODE(start, len, res) do { \
+ PyObject *_decoded = _PyObject_CallMethod( \
+ self->decoder, &_Py_ID(decode), "y#", start, len); \
+ if (check_decoded(_decoded) < 0) \
+ goto fail; \
+ res = PyUnicode_GET_LENGTH(_decoded); \
+ Py_DECREF(_decoded); \
+ } while (0)
+
+ /* Fast search for an acceptable start point, close to our
+ current pos */
+ skip_bytes = (Py_ssize_t) (self->b2cratio * chars_to_skip);
+ skip_back = 1;
+ assert(skip_back <= PyBytes_GET_SIZE(next_input));
+ input = PyBytes_AS_STRING(next_input);
+ while (skip_bytes > 0) {
+ /* Decode up to temptative start point */
+ if (_textiowrapper_decoder_setstate(self, &cookie) < 0)
+ goto fail;
+ DECODER_DECODE(input, skip_bytes, chars_decoded);
+ if (chars_decoded <= chars_to_skip) {
+ DECODER_GETSTATE();
+ if (dec_buffer_len == 0) {
+ /* Before pos and no bytes buffered in decoder => OK */
+ cookie.dec_flags = dec_flags;
+ chars_to_skip -= chars_decoded;
+ break;
+ }
+ /* Skip back by buffered amount and reset heuristic */
+ skip_bytes -= dec_buffer_len;
+ skip_back = 1;
+ }
+ else {
+ /* We're too far ahead, skip back a bit */
+ skip_bytes -= skip_back;
+ skip_back *= 2;
+ }
+ }
+ if (skip_bytes <= 0) {
+ skip_bytes = 0;
+ if (_textiowrapper_decoder_setstate(self, &cookie) < 0)
+ goto fail;
+ }
+
+ /* Note our initial start point. */
+ cookie.start_pos += skip_bytes;
+ cookie.chars_to_skip = Py_SAFE_DOWNCAST(chars_to_skip, Py_ssize_t, int);
+ if (chars_to_skip == 0)
+ goto finally;
+
+ /* We should be close to the desired position. Now feed the decoder one
+ * byte at a time until we reach the `chars_to_skip` target.
+ * As we go, note the nearest "safe start point" before the current
+ * location (a point where the decoder has nothing buffered, so seek()
+ * can safely start from there and advance to this location).
+ */
+ chars_decoded = 0;
+ input = PyBytes_AS_STRING(next_input);
+ input_end = input + PyBytes_GET_SIZE(next_input);
+ input += skip_bytes;
+ while (input < input_end) {
+ Py_ssize_t n;
+
+ DECODER_DECODE(input, (Py_ssize_t)1, n);
+ /* We got n chars for 1 byte */
+ chars_decoded += n;
+ cookie.bytes_to_feed += 1;
+ DECODER_GETSTATE();
+
+ if (dec_buffer_len == 0 && chars_decoded <= chars_to_skip) {
+ /* Decoder buffer is empty, so this is a safe start point. */
+ cookie.start_pos += cookie.bytes_to_feed;
+ chars_to_skip -= chars_decoded;
+ cookie.dec_flags = dec_flags;
+ cookie.bytes_to_feed = 0;
+ chars_decoded = 0;
+ }
+ if (chars_decoded >= chars_to_skip)
+ break;
+ input++;
+ }
+ if (input == input_end) {
+ /* We didn't get enough decoded data; signal EOF to get more. */
+ PyObject *decoded = _PyObject_CallMethod(
+ self->decoder, &_Py_ID(decode), "yO", "", /* final = */ Py_True);
+ if (check_decoded(decoded) < 0)
+ goto fail;
+ chars_decoded += PyUnicode_GET_LENGTH(decoded);
+ Py_DECREF(decoded);
+ cookie.need_eof = 1;
+
+ if (chars_decoded < chars_to_skip) {
+ PyErr_SetString(PyExc_OSError,
+ "can't reconstruct logical file position");
+ goto fail;
+ }
+ }
+
+finally:
+ res = PyObject_CallMethodOneArg(
+ self->decoder, &_Py_ID(setstate), saved_state);
+ Py_DECREF(saved_state);
+ if (res == NULL)
+ return NULL;
+ Py_DECREF(res);
+
+ /* The returned cookie corresponds to the last safe start point. */
+ cookie.chars_to_skip = Py_SAFE_DOWNCAST(chars_to_skip, Py_ssize_t, int);
+ return textiowrapper_build_cookie(&cookie);
+
+fail:
+ if (saved_state) {
+ PyObject *exc = PyErr_GetRaisedException();
+ res = PyObject_CallMethodOneArg(
+ self->decoder, &_Py_ID(setstate), saved_state);
+ _PyErr_ChainExceptions1(exc);
+ Py_DECREF(saved_state);
+ Py_XDECREF(res);
+ }
+ return NULL;
+}
+
+/*[clinic input]
+_io.TextIOWrapper.truncate
+ pos: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos)
+/*[clinic end generated code: output=90ec2afb9bb7745f input=56ec8baa65aea377]*/
+{
+ PyObject *res;
+
+ CHECK_ATTACHED(self)
+
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL)
+ return NULL;
+ Py_DECREF(res);
+
+ return PyObject_CallMethodOneArg(self->buffer, &_Py_ID(truncate), pos);
+}
+
+static PyObject *
+textiowrapper_repr(textio *self)
+{
+ PyObject *nameobj, *modeobj, *res, *s;
+ int status;
+
+ CHECK_INITIALIZED(self);
+
+ res = PyUnicode_FromString("<_io.TextIOWrapper");
+ if (res == NULL)
+ return NULL;
+
+ status = Py_ReprEnter((PyObject *)self);
+ if (status != 0) {
+ if (status > 0) {
+ PyErr_Format(PyExc_RuntimeError,
+ "reentrant call inside %s.__repr__",
+ Py_TYPE(self)->tp_name);
+ }
+ goto error;
+ }
+ if (_PyObject_LookupAttr((PyObject *) self, &_Py_ID(name), &nameobj) < 0) {
+ if (!PyErr_ExceptionMatches(PyExc_ValueError)) {
+ goto error;
+ }
+ /* Ignore ValueError raised if the underlying stream was detached */
+ PyErr_Clear();
+ }
+ if (nameobj != NULL) {
+ s = PyUnicode_FromFormat(" name=%R", nameobj);
+ Py_DECREF(nameobj);
+ if (s == NULL)
+ goto error;
+ PyUnicode_AppendAndDel(&res, s);
+ if (res == NULL)
+ goto error;
+ }
+ if (_PyObject_LookupAttr((PyObject *) self, &_Py_ID(mode), &modeobj) < 0) {
+ goto error;
+ }
+ if (modeobj != NULL) {
+ s = PyUnicode_FromFormat(" mode=%R", modeobj);
+ Py_DECREF(modeobj);
+ if (s == NULL)
+ goto error;
+ PyUnicode_AppendAndDel(&res, s);
+ if (res == NULL)
+ goto error;
+ }
+ s = PyUnicode_FromFormat("%U encoding=%R>",
+ res, self->encoding);
+ Py_DECREF(res);
+ if (status == 0) {
+ Py_ReprLeave((PyObject *)self);
+ }
+ return s;
+
+ error:
+ Py_XDECREF(res);
+ if (status == 0) {
+ Py_ReprLeave((PyObject *)self);
+ }
+ return NULL;
+}
+
+
+/* Inquiries */
+
+/*[clinic input]
+_io.TextIOWrapper.fileno
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_fileno_impl(textio *self)
+/*[clinic end generated code: output=21490a4c3da13e6c input=c488ca83d0069f9b]*/
+{
+ CHECK_ATTACHED(self);
+ return PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(fileno));
+}
+
+/*[clinic input]
+_io.TextIOWrapper.seekable
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_seekable_impl(textio *self)
+/*[clinic end generated code: output=ab223dbbcffc0f00 input=8b005ca06e1fca13]*/
+{
+ CHECK_ATTACHED(self);
+ return PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(seekable));
+}
+
+/*[clinic input]
+_io.TextIOWrapper.readable
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_readable_impl(textio *self)
+/*[clinic end generated code: output=72ff7ba289a8a91b input=0704ea7e01b0d3eb]*/
+{
+ CHECK_ATTACHED(self);
+ return PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(readable));
+}
+
+/*[clinic input]
+_io.TextIOWrapper.writable
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_writable_impl(textio *self)
+/*[clinic end generated code: output=a728c71790d03200 input=c41740bc9d8636e8]*/
+{
+ CHECK_ATTACHED(self);
+ return PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(writable));
+}
+
+/*[clinic input]
+_io.TextIOWrapper.isatty
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_isatty_impl(textio *self)
+/*[clinic end generated code: output=12be1a35bace882e input=fb68d9f2c99bbfff]*/
+{
+ CHECK_ATTACHED(self);
+ return PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(isatty));
+}
+
+/*[clinic input]
+_io.TextIOWrapper.flush
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_flush_impl(textio *self)
+/*[clinic end generated code: output=59de9165f9c2e4d2 input=928c60590694ab85]*/
+{
+ CHECK_ATTACHED(self);
+ CHECK_CLOSED(self);
+ self->telling = self->seekable;
+ if (_textiowrapper_writeflush(self) < 0)
+ return NULL;
+ return PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(flush));
+}
+
+/*[clinic input]
+_io.TextIOWrapper.close
+[clinic start generated code]*/
+
+static PyObject *
+_io_TextIOWrapper_close_impl(textio *self)
+/*[clinic end generated code: output=056ccf8b4876e4f4 input=9c2114315eae1948]*/
+{
+ PyObject *res;
+ int r;
+ CHECK_ATTACHED(self);
+
+ res = textiowrapper_closed_get(self, NULL);
+ if (res == NULL)
+ return NULL;
+ r = PyObject_IsTrue(res);
+ Py_DECREF(res);
+ if (r < 0)
+ return NULL;
+
+ if (r > 0) {
+ Py_RETURN_NONE; /* stream already closed */
+ }
+ else {
+ PyObject *exc = NULL;
+ if (self->finalizing) {
+ res = PyObject_CallMethodOneArg(self->buffer, &_Py_ID(_dealloc_warn),
+ (PyObject *)self);
+ if (res) {
+ Py_DECREF(res);
+ }
+ else {
+ PyErr_Clear();
+ }
+ }
+ res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(flush));
+ if (res == NULL) {
+ exc = PyErr_GetRaisedException();
+ }
+ else {
+ Py_DECREF(res);
+ }
+
+ res = PyObject_CallMethodNoArgs(self->buffer, &_Py_ID(close));
+ if (exc != NULL) {
+ _PyErr_ChainExceptions1(exc);
+ Py_CLEAR(res);
+ }
+ return res;
+ }
+}
+
+static PyObject *
+textiowrapper_iternext(textio *self)
+{
+ PyObject *line;
+
+ CHECK_ATTACHED(self);
+
+ self->telling = 0;
+ if (Py_IS_TYPE(self, self->state->PyTextIOWrapper_Type)) {
+ /* Skip method call overhead for speed */
+ line = _textiowrapper_readline(self, -1);
+ }
+ else {
+ line = PyObject_CallMethodNoArgs((PyObject *)self,
+ &_Py_ID(readline));
+ if (line && !PyUnicode_Check(line)) {
+ PyErr_Format(PyExc_OSError,
+ "readline() should have returned a str object, "
+ "not '%.200s'", Py_TYPE(line)->tp_name);
+ Py_DECREF(line);
+ return NULL;
+ }
+ }
+
+ if (line == NULL || PyUnicode_READY(line) == -1)
+ return NULL;
+
+ if (PyUnicode_GET_LENGTH(line) == 0) {
+ /* Reached EOF or would have blocked */
+ Py_DECREF(line);
+ Py_CLEAR(self->snapshot);
+ self->telling = self->seekable;
+ return NULL;
+ }
+
+ return line;
+}
+
+static PyObject *
+textiowrapper_name_get(textio *self, void *context)
+{
+ CHECK_ATTACHED(self);
+ return PyObject_GetAttr(self->buffer, &_Py_ID(name));
+}
+
+static PyObject *
+textiowrapper_closed_get(textio *self, void *context)
+{
+ CHECK_ATTACHED(self);
+ return PyObject_GetAttr(self->buffer, &_Py_ID(closed));
+}
+
+static PyObject *
+textiowrapper_newlines_get(textio *self, void *context)
+{
+ PyObject *res;
+ CHECK_ATTACHED(self);
+ if (self->decoder == NULL ||
+ _PyObject_LookupAttr(self->decoder, &_Py_ID(newlines), &res) == 0)
+ {
+ Py_RETURN_NONE;
+ }
+ return res;
+}
+
+static PyObject *
+textiowrapper_errors_get(textio *self, void *context)
+{
+ CHECK_INITIALIZED(self);
+ return Py_NewRef(self->errors);
+}
+
+static PyObject *
+textiowrapper_chunk_size_get(textio *self, void *context)
+{
+ CHECK_ATTACHED(self);
+ return PyLong_FromSsize_t(self->chunk_size);
+}
+
+static int
+textiowrapper_chunk_size_set(textio *self, PyObject *arg, void *context)
+{
+ Py_ssize_t n;
+ CHECK_ATTACHED_INT(self);
+ if (arg == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ n = PyNumber_AsSsize_t(arg, PyExc_ValueError);
+ if (n == -1 && PyErr_Occurred())
+ return -1;
+ if (n <= 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "a strictly positive integer is required");
+ return -1;
+ }
+ self->chunk_size = n;
+ return 0;
+}
+
+static PyMethodDef incrementalnewlinedecoder_methods[] = {
+ _IO_INCREMENTALNEWLINEDECODER_DECODE_METHODDEF
+ _IO_INCREMENTALNEWLINEDECODER_GETSTATE_METHODDEF
+ _IO_INCREMENTALNEWLINEDECODER_SETSTATE_METHODDEF
+ _IO_INCREMENTALNEWLINEDECODER_RESET_METHODDEF
+ {NULL}
+};
+
+static PyGetSetDef incrementalnewlinedecoder_getset[] = {
+ {"newlines", (getter)incrementalnewlinedecoder_newlines_get, NULL, NULL},
+ {NULL}
+};
+
+static PyType_Slot nldecoder_slots[] = {
+ {Py_tp_dealloc, incrementalnewlinedecoder_dealloc},
+ {Py_tp_doc, (void *)_io_IncrementalNewlineDecoder___init____doc__},
+ {Py_tp_methods, incrementalnewlinedecoder_methods},
+ {Py_tp_getset, incrementalnewlinedecoder_getset},
+ {Py_tp_traverse, incrementalnewlinedecoder_traverse},
+ {Py_tp_clear, incrementalnewlinedecoder_clear},
+ {Py_tp_init, _io_IncrementalNewlineDecoder___init__},
+ {0, NULL},
+};
+
+PyType_Spec nldecoder_spec = {
+ .name = "_io.IncrementalNewlineDecoder",
+ .basicsize = sizeof(nldecoder_object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = nldecoder_slots,
+};
+
+
+static PyMethodDef textiowrapper_methods[] = {
+ _IO_TEXTIOWRAPPER_DETACH_METHODDEF
+ _IO_TEXTIOWRAPPER_RECONFIGURE_METHODDEF
+ _IO_TEXTIOWRAPPER_WRITE_METHODDEF
+ _IO_TEXTIOWRAPPER_READ_METHODDEF
+ _IO_TEXTIOWRAPPER_READLINE_METHODDEF
+ _IO_TEXTIOWRAPPER_FLUSH_METHODDEF
+ _IO_TEXTIOWRAPPER_CLOSE_METHODDEF
+
+ _IO_TEXTIOWRAPPER_FILENO_METHODDEF
+ _IO_TEXTIOWRAPPER_SEEKABLE_METHODDEF
+ _IO_TEXTIOWRAPPER_READABLE_METHODDEF
+ _IO_TEXTIOWRAPPER_WRITABLE_METHODDEF
+ _IO_TEXTIOWRAPPER_ISATTY_METHODDEF
+
+ _IO_TEXTIOWRAPPER_SEEK_METHODDEF
+ _IO_TEXTIOWRAPPER_TELL_METHODDEF
+ _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF
+
+ {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS},
+ {NULL, NULL}
+};
+
+static PyMemberDef textiowrapper_members[] = {
+ {"encoding", T_OBJECT, offsetof(textio, encoding), READONLY},
+ {"buffer", T_OBJECT, offsetof(textio, buffer), READONLY},
+ {"line_buffering", T_BOOL, offsetof(textio, line_buffering), READONLY},
+ {"write_through", T_BOOL, offsetof(textio, write_through), READONLY},
+ {"_finalizing", T_BOOL, offsetof(textio, finalizing), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(textio, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(textio, dict), READONLY},
+ {NULL}
+};
+
+static PyGetSetDef textiowrapper_getset[] = {
+ {"name", (getter)textiowrapper_name_get, NULL, NULL},
+ {"closed", (getter)textiowrapper_closed_get, NULL, NULL},
+/* {"mode", (getter)TextIOWrapper_mode_get, NULL, NULL},
+*/
+ {"newlines", (getter)textiowrapper_newlines_get, NULL, NULL},
+ {"errors", (getter)textiowrapper_errors_get, NULL, NULL},
+ {"_CHUNK_SIZE", (getter)textiowrapper_chunk_size_get,
+ (setter)textiowrapper_chunk_size_set, NULL},
+ {NULL}
+};
+
+PyType_Slot textiowrapper_slots[] = {
+ {Py_tp_dealloc, textiowrapper_dealloc},
+ {Py_tp_repr, textiowrapper_repr},
+ {Py_tp_doc, (void *)_io_TextIOWrapper___init____doc__},
+ {Py_tp_traverse, textiowrapper_traverse},
+ {Py_tp_clear, textiowrapper_clear},
+ {Py_tp_iternext, textiowrapper_iternext},
+ {Py_tp_methods, textiowrapper_methods},
+ {Py_tp_members, textiowrapper_members},
+ {Py_tp_getset, textiowrapper_getset},
+ {Py_tp_init, _io_TextIOWrapper___init__},
+ {0, NULL},
+};
+
+PyType_Spec textiowrapper_spec = {
+ .name = "_io.TextIOWrapper",
+ .basicsize = sizeof(textio),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = textiowrapper_slots,
+};
diff --git a/contrib/tools/python3/Modules/_io/winconsoleio.c b/contrib/tools/python3/Modules/_io/winconsoleio.c
new file mode 100644
index 00000000000..c2c365e0807
--- /dev/null
+++ b/contrib/tools/python3/Modules/_io/winconsoleio.c
@@ -0,0 +1,1179 @@
+/*
+ An implementation of Windows console I/O
+
+ Classes defined here: _WindowsConsoleIO
+
+ Written by Steve Dower
+*/
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
+#include "pycore_object.h" // _PyObject_GC_UNTRACK()
+
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+
+#include "structmember.h" // PyMemberDef
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#include <stddef.h> /* For offsetof */
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#include <fcntl.h>
+
+#include "_iomodule.h"
+
+/* BUFSIZ determines how many characters can be typed at the console
+ before it starts blocking. */
+#if BUFSIZ < (16*1024)
+#define SMALLCHUNK (2*1024)
+#elif (BUFSIZ >= (2 << 25))
+#error "unreasonable BUFSIZ > 64 MiB defined"
+#else
+#define SMALLCHUNK BUFSIZ
+#endif
+
+/* BUFMAX determines how many bytes can be read in one go. */
+#define BUFMAX (32*1024*1024)
+
+/* SMALLBUF determines how many utf-8 characters will be
+ buffered within the stream, in order to support reads
+ of less than one character */
+#define SMALLBUF 4
+
+char _get_console_type(HANDLE handle) {
+ DWORD mode, peek_count;
+
+ if (handle == INVALID_HANDLE_VALUE)
+ return '\0';
+
+ if (!GetConsoleMode(handle, &mode))
+ return '\0';
+
+ /* Peek at the handle to see whether it is an input or output handle */
+ if (GetNumberOfConsoleInputEvents(handle, &peek_count))
+ return 'r';
+ return 'w';
+}
+
+char _PyIO_get_console_type(PyObject *path_or_fd) {
+ int fd = PyLong_AsLong(path_or_fd);
+ PyErr_Clear();
+ if (fd >= 0) {
+ HANDLE handle = _Py_get_osfhandle_noraise(fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ return '\0';
+ return _get_console_type(handle);
+ }
+
+ PyObject *decoded;
+ wchar_t *decoded_wstr;
+
+ if (!PyUnicode_FSDecoder(path_or_fd, &decoded)) {
+ PyErr_Clear();
+ return '\0';
+ }
+ decoded_wstr = PyUnicode_AsWideCharString(decoded, NULL);
+ Py_CLEAR(decoded);
+ if (!decoded_wstr) {
+ PyErr_Clear();
+ return '\0';
+ }
+
+ char m = '\0';
+ if (!_wcsicmp(decoded_wstr, L"CONIN$")) {
+ m = 'r';
+ } else if (!_wcsicmp(decoded_wstr, L"CONOUT$")) {
+ m = 'w';
+ } else if (!_wcsicmp(decoded_wstr, L"CON")) {
+ m = 'x';
+ }
+ if (m) {
+ PyMem_Free(decoded_wstr);
+ return m;
+ }
+
+ DWORD length;
+ wchar_t name_buf[MAX_PATH], *pname_buf = name_buf;
+
+ length = GetFullPathNameW(decoded_wstr, MAX_PATH, pname_buf, NULL);
+ if (length > MAX_PATH) {
+ pname_buf = PyMem_New(wchar_t, length);
+ if (pname_buf)
+ length = GetFullPathNameW(decoded_wstr, length, pname_buf, NULL);
+ else
+ length = 0;
+ }
+ PyMem_Free(decoded_wstr);
+
+ if (length) {
+ wchar_t *name = pname_buf;
+ if (length >= 4 && name[3] == L'\\' &&
+ (name[2] == L'.' || name[2] == L'?') &&
+ name[1] == L'\\' && name[0] == L'\\') {
+ name += 4;
+ }
+ if (!_wcsicmp(name, L"CONIN$")) {
+ m = 'r';
+ } else if (!_wcsicmp(name, L"CONOUT$")) {
+ m = 'w';
+ } else if (!_wcsicmp(name, L"CON")) {
+ m = 'x';
+ }
+ }
+
+ if (pname_buf != name_buf)
+ PyMem_Free(pname_buf);
+ return m;
+}
+
+static DWORD
+_find_last_utf8_boundary(const char *buf, DWORD len)
+{
+ /* This function never returns 0, returns the original len instead */
+ DWORD count = 1;
+ if (len == 0 || (buf[len - 1] & 0x80) == 0) {
+ return len;
+ }
+ for (;; count++) {
+ if (count > 3 || count >= len) {
+ return len;
+ }
+ if ((buf[len - count] & 0xc0) != 0x80) {
+ return len - count;
+ }
+ }
+}
+
+/*[clinic input]
+module _io
+class _io._WindowsConsoleIO "winconsoleio *" "clinic_state()->PyWindowsConsoleIO_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=05526e723011ab36]*/
+
+typedef struct {
+ PyObject_HEAD
+ int fd;
+ unsigned int created : 1;
+ unsigned int readable : 1;
+ unsigned int writable : 1;
+ unsigned int closefd : 1;
+ char finalizing;
+ unsigned int blksize;
+ PyObject *weakreflist;
+ PyObject *dict;
+ char buf[SMALLBUF];
+ wchar_t wbuf;
+} winconsoleio;
+
+int
+_PyWindowsConsoleIO_closed(PyObject *self)
+{
+ return ((winconsoleio *)self)->fd == -1;
+}
+
+
+/* Returns 0 on success, -1 with exception set on failure. */
+static int
+internal_close(winconsoleio *self)
+{
+ if (self->fd != -1) {
+ if (self->closefd) {
+ _Py_BEGIN_SUPPRESS_IPH
+ close(self->fd);
+ _Py_END_SUPPRESS_IPH
+ }
+ self->fd = -1;
+ }
+ return 0;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.close
+ cls: defining_class
+ /
+
+Close the console object.
+
+A closed console object cannot be used for further I/O operations.
+close() may be called more than once without error.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_close_impl(winconsoleio *self, PyTypeObject *cls)
+/*[clinic end generated code: output=e50c1808c063e1e2 input=161001bd2a649a4b]*/
+{
+ PyObject *res;
+ PyObject *exc;
+ int rc;
+
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ res = PyObject_CallMethodOneArg((PyObject*)state->PyRawIOBase_Type,
+ &_Py_ID(close), (PyObject*)self);
+ if (!self->closefd) {
+ self->fd = -1;
+ return res;
+ }
+ if (res == NULL) {
+ exc = PyErr_GetRaisedException();
+ }
+ rc = internal_close(self);
+ if (res == NULL) {
+ _PyErr_ChainExceptions1(exc);
+ }
+ if (rc < 0) {
+ Py_CLEAR(res);
+ }
+ return res;
+}
+
+static PyObject *
+winconsoleio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ winconsoleio *self;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+
+ self = (winconsoleio *) type->tp_alloc(type, 0);
+ if (self != NULL) {
+ self->fd = -1;
+ self->created = 0;
+ self->readable = 0;
+ self->writable = 0;
+ self->closefd = 0;
+ self->blksize = 0;
+ self->weakreflist = NULL;
+ }
+
+ return (PyObject *) self;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.__init__
+ file as nameobj: object
+ mode: str = "r"
+ closefd: bool = True
+ opener: object = None
+
+Open a console buffer by file descriptor.
+
+The mode can be 'rb' (default), or 'wb' for reading or writing bytes. All
+other mode characters will be ignored. Mode 'b' will be assumed if it is
+omitted. The *opener* parameter is always ignored.
+[clinic start generated code]*/
+
+static int
+_io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
+ const char *mode, int closefd,
+ PyObject *opener)
+/*[clinic end generated code: output=3fd9cbcdd8d95429 input=7a3eed6bbe998fd9]*/
+{
+ const char *s;
+ wchar_t *name = NULL;
+ char console_type = '\0';
+ int ret = 0;
+ int rwa = 0;
+ int fd = -1;
+ int fd_is_own = 0;
+ HANDLE handle = NULL;
+
+#ifndef NDEBUG
+ _PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
+ assert(PyObject_TypeCheck(self, state->PyWindowsConsoleIO_Type));
+#endif
+ if (self->fd >= 0) {
+ if (self->closefd) {
+ /* Have to close the existing file first. */
+ if (internal_close(self) < 0)
+ return -1;
+ }
+ else
+ self->fd = -1;
+ }
+
+ fd = _PyLong_AsInt(nameobj);
+ if (fd < 0) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "negative file descriptor");
+ return -1;
+ }
+ PyErr_Clear();
+ }
+ self->fd = fd;
+
+ if (fd < 0) {
+ PyObject *decodedname;
+
+ int d = PyUnicode_FSDecoder(nameobj, (void*)&decodedname);
+ if (!d)
+ return -1;
+
+ name = PyUnicode_AsWideCharString(decodedname, NULL);
+ console_type = _PyIO_get_console_type(decodedname);
+ Py_CLEAR(decodedname);
+ if (name == NULL)
+ return -1;
+ }
+
+ s = mode;
+ while (*s) {
+ switch (*s++) {
+ case '+':
+ case 'a':
+ case 'b':
+ case 'x':
+ break;
+ case 'r':
+ if (rwa)
+ goto bad_mode;
+ rwa = 1;
+ self->readable = 1;
+ if (console_type == 'x')
+ console_type = 'r';
+ break;
+ case 'w':
+ if (rwa)
+ goto bad_mode;
+ rwa = 1;
+ self->writable = 1;
+ if (console_type == 'x')
+ console_type = 'w';
+ break;
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "invalid mode: %.200s", mode);
+ goto error;
+ }
+ }
+
+ if (!rwa)
+ goto bad_mode;
+
+ if (fd >= 0) {
+ handle = _Py_get_osfhandle_noraise(fd);
+ self->closefd = 0;
+ } else {
+ DWORD access = GENERIC_READ;
+
+ self->closefd = 1;
+ if (!closefd) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot use closefd=False with file name");
+ goto error;
+ }
+
+ if (self->writable)
+ access = GENERIC_WRITE;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* Attempt to open for read/write initially, then fall back
+ on the specific access. This is required for modern names
+ CONIN$ and CONOUT$, which allow reading/writing state as
+ well as reading/writing content. */
+ handle = CreateFileW(name, GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+ if (handle == INVALID_HANDLE_VALUE)
+ handle = CreateFileW(name, access,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (handle == INVALID_HANDLE_VALUE) {
+ PyErr_SetExcFromWindowsErrWithFilenameObject(PyExc_OSError, GetLastError(), nameobj);
+ goto error;
+ }
+
+ if (self->writable)
+ self->fd = _Py_open_osfhandle_noraise(handle, _O_WRONLY | _O_BINARY);
+ else
+ self->fd = _Py_open_osfhandle_noraise(handle, _O_RDONLY | _O_BINARY);
+ if (self->fd < 0) {
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, nameobj);
+ CloseHandle(handle);
+ goto error;
+ }
+ }
+
+ if (console_type == '\0')
+ console_type = _get_console_type(handle);
+
+ if (self->writable && console_type != 'w') {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot open console input buffer for writing");
+ goto error;
+ }
+ if (self->readable && console_type != 'r') {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot open console output buffer for reading");
+ goto error;
+ }
+
+ self->blksize = DEFAULT_BUFFER_SIZE;
+ memset(self->buf, 0, 4);
+
+ if (PyObject_SetAttr((PyObject *)self, &_Py_ID(name), nameobj) < 0)
+ goto error;
+
+ goto done;
+
+bad_mode:
+ PyErr_SetString(PyExc_ValueError,
+ "Must have exactly one of read or write mode");
+error:
+ ret = -1;
+ internal_close(self);
+
+done:
+ if (name)
+ PyMem_Free(name);
+ return ret;
+}
+
+static int
+winconsoleio_traverse(winconsoleio *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->dict);
+ return 0;
+}
+
+static int
+winconsoleio_clear(winconsoleio *self)
+{
+ Py_CLEAR(self->dict);
+ return 0;
+}
+
+static void
+winconsoleio_dealloc(winconsoleio *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ self->finalizing = 1;
+ if (_PyIOBase_finalize((PyObject *) self) < 0)
+ return;
+ _PyObject_GC_UNTRACK(self);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ Py_CLEAR(self->dict);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+err_closed(void)
+{
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed file");
+ return NULL;
+}
+
+static PyObject *
+err_mode(_PyIO_State *state, const char *action)
+{
+ return PyErr_Format(state->unsupported_operation,
+ "Console buffer does not support %s", action);
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.fileno
+
+Return the underlying file descriptor (an integer).
+
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_fileno_impl(winconsoleio *self)
+/*[clinic end generated code: output=006fa74ce3b5cfbf input=845c47ebbc3a2f67]*/
+{
+ if (self->fd < 0)
+ return err_closed();
+ return PyLong_FromLong(self->fd);
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.readable
+
+True if console is an input buffer.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_readable_impl(winconsoleio *self)
+/*[clinic end generated code: output=daf9cef2743becf0 input=6be9defb5302daae]*/
+{
+ if (self->fd == -1)
+ return err_closed();
+ return PyBool_FromLong((long) self->readable);
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.writable
+
+True if console is an output buffer.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_writable_impl(winconsoleio *self)
+/*[clinic end generated code: output=e0a2ad7eae5abf67 input=cefbd8abc24df6a0]*/
+{
+ if (self->fd == -1)
+ return err_closed();
+ return PyBool_FromLong((long) self->writable);
+}
+
+static DWORD
+_buflen(winconsoleio *self)
+{
+ for (DWORD i = 0; i < SMALLBUF; ++i) {
+ if (!self->buf[i])
+ return i;
+ }
+ return SMALLBUF;
+}
+
+static DWORD
+_copyfrombuf(winconsoleio *self, char *buf, DWORD len)
+{
+ DWORD n = 0;
+
+ while (self->buf[0] && len--) {
+ buf[n++] = self->buf[0];
+ for (int i = 1; i < SMALLBUF; ++i)
+ self->buf[i - 1] = self->buf[i];
+ self->buf[SMALLBUF - 1] = 0;
+ }
+
+ return n;
+}
+
+static wchar_t *
+read_console_w(HANDLE handle, DWORD maxlen, DWORD *readlen) {
+ int err = 0, sig = 0;
+
+ wchar_t *buf = (wchar_t*)PyMem_Malloc(maxlen * sizeof(wchar_t));
+ if (!buf)
+ goto error;
+
+ *readlen = 0;
+
+ //DebugBreak();
+ Py_BEGIN_ALLOW_THREADS
+ DWORD off = 0;
+ while (off < maxlen) {
+ DWORD n = (DWORD)-1;
+ DWORD len = min(maxlen - off, BUFSIZ);
+ SetLastError(0);
+ BOOL res = ReadConsoleW(handle, &buf[off], len, &n, NULL);
+
+ if (!res) {
+ err = GetLastError();
+ break;
+ }
+ if (n == (DWORD)-1 && (err = GetLastError()) == ERROR_OPERATION_ABORTED) {
+ break;
+ }
+ if (n == 0) {
+ err = GetLastError();
+ if (err != ERROR_OPERATION_ABORTED)
+ break;
+ err = 0;
+ HANDLE hInterruptEvent = _PyOS_SigintEvent();
+ if (WaitForSingleObjectEx(hInterruptEvent, 100, FALSE)
+ == WAIT_OBJECT_0) {
+ ResetEvent(hInterruptEvent);
+ Py_BLOCK_THREADS
+ sig = PyErr_CheckSignals();
+ Py_UNBLOCK_THREADS
+ if (sig < 0)
+ break;
+ }
+ }
+ *readlen += n;
+
+ /* If we didn't read a full buffer that time, don't try
+ again or we will block a second time. */
+ if (n < len)
+ break;
+ /* If the buffer ended with a newline, break out */
+ if (buf[*readlen - 1] == '\n')
+ break;
+ /* If the buffer ends with a high surrogate, expand the
+ buffer and read an extra character. */
+ WORD char_type;
+ if (off + BUFSIZ >= maxlen &&
+ GetStringTypeW(CT_CTYPE3, &buf[*readlen - 1], 1, &char_type) &&
+ char_type == C3_HIGHSURROGATE) {
+ wchar_t *newbuf;
+ maxlen += 1;
+ Py_BLOCK_THREADS
+ newbuf = (wchar_t*)PyMem_Realloc(buf, maxlen * sizeof(wchar_t));
+ Py_UNBLOCK_THREADS
+ if (!newbuf) {
+ sig = -1;
+ break;
+ }
+ buf = newbuf;
+ /* Only advance by n and not BUFSIZ in this case */
+ off += n;
+ continue;
+ }
+
+ off += BUFSIZ;
+ }
+
+ Py_END_ALLOW_THREADS
+
+ if (sig)
+ goto error;
+ if (err) {
+ PyErr_SetFromWindowsErr(err);
+ goto error;
+ }
+
+ if (*readlen > 0 && buf[0] == L'\x1a') {
+ PyMem_Free(buf);
+ buf = (wchar_t *)PyMem_Malloc(sizeof(wchar_t));
+ if (!buf)
+ goto error;
+ buf[0] = L'\0';
+ *readlen = 0;
+ }
+
+ return buf;
+
+error:
+ if (buf)
+ PyMem_Free(buf);
+ return NULL;
+}
+
+
+static Py_ssize_t
+readinto(_PyIO_State *state, winconsoleio *self, char *buf, Py_ssize_t len)
+{
+ if (self->fd == -1) {
+ err_closed();
+ return -1;
+ }
+ if (!self->readable) {
+ err_mode(state, "reading");
+ return -1;
+ }
+ if (len == 0)
+ return 0;
+ if (len > BUFMAX) {
+ PyErr_Format(PyExc_ValueError, "cannot read more than %d bytes", BUFMAX);
+ return -1;
+ }
+
+ HANDLE handle = _Py_get_osfhandle(self->fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ return -1;
+
+ /* Each character may take up to 4 bytes in the final buffer.
+ This is highly conservative, but necessary to avoid
+ failure for any given Unicode input (e.g. \U0010ffff).
+ If the caller requests fewer than 4 bytes, we buffer one
+ character.
+ */
+ DWORD wlen = (DWORD)(len / 4);
+ if (wlen == 0) {
+ wlen = 1;
+ }
+
+ DWORD read_len = _copyfrombuf(self, buf, (DWORD)len);
+ if (read_len) {
+ buf = &buf[read_len];
+ len -= read_len;
+ wlen -= 1;
+ }
+ if (len == read_len || wlen == 0)
+ return read_len;
+
+ DWORD n;
+ wchar_t *wbuf = read_console_w(handle, wlen, &n);
+ if (wbuf == NULL)
+ return -1;
+ if (n == 0) {
+ PyMem_Free(wbuf);
+ return read_len;
+ }
+
+ int err = 0;
+ DWORD u8n = 0;
+
+ Py_BEGIN_ALLOW_THREADS
+ if (len < 4) {
+ if (WideCharToMultiByte(CP_UTF8, 0, wbuf, n,
+ self->buf, sizeof(self->buf) / sizeof(self->buf[0]),
+ NULL, NULL))
+ u8n = _copyfrombuf(self, buf, (DWORD)len);
+ } else {
+ u8n = WideCharToMultiByte(CP_UTF8, 0, wbuf, n,
+ buf, (DWORD)len, NULL, NULL);
+ }
+
+ if (u8n) {
+ read_len += u8n;
+ u8n = 0;
+ } else {
+ err = GetLastError();
+ if (err == ERROR_INSUFFICIENT_BUFFER) {
+ /* Calculate the needed buffer for a more useful error, as this
+ means our "/ 4" logic above is insufficient for some input.
+ */
+ u8n = WideCharToMultiByte(CP_UTF8, 0, wbuf, n,
+ NULL, 0, NULL, NULL);
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ PyMem_Free(wbuf);
+
+ if (u8n) {
+ PyErr_Format(PyExc_SystemError,
+ "Buffer had room for %zd bytes but %u bytes required",
+ len, u8n);
+ return -1;
+ }
+ if (err) {
+ PyErr_SetFromWindowsErr(err);
+ return -1;
+ }
+
+ return read_len;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.readinto
+ cls: defining_class
+ buffer: Py_buffer(accept={rwbuffer})
+ /
+
+Same as RawIOBase.readinto().
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_readinto_impl(winconsoleio *self, PyTypeObject *cls,
+ Py_buffer *buffer)
+/*[clinic end generated code: output=96717c74f6204b79 input=4b0627c3b1645f78]*/
+{
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ Py_ssize_t len = readinto(state, self, buffer->buf, buffer->len);
+ if (len < 0)
+ return NULL;
+
+ return PyLong_FromSsize_t(len);
+}
+
+static DWORD
+new_buffersize(winconsoleio *self, DWORD currentsize)
+{
+ DWORD addend;
+
+ /* Expand the buffer by an amount proportional to the current size,
+ giving us amortized linear-time behavior. For bigger sizes, use a
+ less-than-double growth factor to avoid excessive allocation. */
+ if (currentsize > 65536)
+ addend = currentsize >> 3;
+ else
+ addend = 256 + currentsize;
+ if (addend < SMALLCHUNK)
+ /* Avoid tiny read() calls. */
+ addend = SMALLCHUNK;
+ return addend + currentsize;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.readall
+
+Read all data from the console, returned as bytes.
+
+Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_readall_impl(winconsoleio *self)
+/*[clinic end generated code: output=e6d312c684f6e23b input=4024d649a1006e69]*/
+{
+ wchar_t *buf;
+ DWORD bufsize, n, len = 0;
+ PyObject *bytes;
+ DWORD bytes_size, rn;
+ HANDLE handle;
+
+ if (self->fd == -1)
+ return err_closed();
+
+ handle = _Py_get_osfhandle(self->fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ bufsize = BUFSIZ;
+
+ buf = (wchar_t*)PyMem_Malloc((bufsize + 1) * sizeof(wchar_t));
+ if (buf == NULL)
+ return NULL;
+
+ while (1) {
+ wchar_t *subbuf;
+
+ if (len >= (Py_ssize_t)bufsize) {
+ DWORD newsize = new_buffersize(self, len);
+ if (newsize > BUFMAX)
+ break;
+ if (newsize < bufsize) {
+ PyErr_SetString(PyExc_OverflowError,
+ "unbounded read returned more bytes "
+ "than a Python bytes object can hold");
+ PyMem_Free(buf);
+ return NULL;
+ }
+ bufsize = newsize;
+
+ wchar_t *tmp = PyMem_Realloc(buf,
+ (bufsize + 1) * sizeof(wchar_t));
+ if (tmp == NULL) {
+ PyMem_Free(buf);
+ return NULL;
+ }
+ buf = tmp;
+ }
+
+ subbuf = read_console_w(handle, bufsize - len, &n);
+
+ if (subbuf == NULL) {
+ PyMem_Free(buf);
+ return NULL;
+ }
+
+ if (n > 0)
+ wcsncpy_s(&buf[len], bufsize - len + 1, subbuf, n);
+
+ PyMem_Free(subbuf);
+
+ /* when the read is empty we break */
+ if (n == 0)
+ break;
+
+ len += n;
+ }
+
+ if (len == 0 && _buflen(self) == 0) {
+ /* when the result starts with ^Z we return an empty buffer */
+ PyMem_Free(buf);
+ return PyBytes_FromStringAndSize(NULL, 0);
+ }
+
+ if (len) {
+ Py_BEGIN_ALLOW_THREADS
+ bytes_size = WideCharToMultiByte(CP_UTF8, 0, buf, len,
+ NULL, 0, NULL, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (!bytes_size) {
+ DWORD err = GetLastError();
+ PyMem_Free(buf);
+ return PyErr_SetFromWindowsErr(err);
+ }
+ } else {
+ bytes_size = 0;
+ }
+
+ bytes_size += _buflen(self);
+ bytes = PyBytes_FromStringAndSize(NULL, bytes_size);
+ rn = _copyfrombuf(self, PyBytes_AS_STRING(bytes), bytes_size);
+
+ if (len) {
+ Py_BEGIN_ALLOW_THREADS
+ bytes_size = WideCharToMultiByte(CP_UTF8, 0, buf, len,
+ &PyBytes_AS_STRING(bytes)[rn], bytes_size - rn, NULL, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (!bytes_size) {
+ DWORD err = GetLastError();
+ PyMem_Free(buf);
+ Py_CLEAR(bytes);
+ return PyErr_SetFromWindowsErr(err);
+ }
+
+ /* add back the number of preserved bytes */
+ bytes_size += rn;
+ }
+
+ PyMem_Free(buf);
+ if (bytes_size < (size_t)PyBytes_GET_SIZE(bytes)) {
+ if (_PyBytes_Resize(&bytes, n * sizeof(wchar_t)) < 0) {
+ Py_CLEAR(bytes);
+ return NULL;
+ }
+ }
+ return bytes;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.read
+ cls: defining_class
+ size: Py_ssize_t(accept={int, NoneType}) = -1
+ /
+
+Read at most size bytes, returned as bytes.
+
+Only makes one system call when size is a positive integer,
+so less data may be returned than requested.
+Return an empty bytes object at EOF.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_read_impl(winconsoleio *self, PyTypeObject *cls,
+ Py_ssize_t size)
+/*[clinic end generated code: output=7e569a586537c0ae input=a14570a5da273365]*/
+{
+ PyObject *bytes;
+ Py_ssize_t bytes_size;
+
+ if (self->fd == -1)
+ return err_closed();
+ if (!self->readable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return err_mode(state, "reading");
+ }
+
+ if (size < 0)
+ return _io__WindowsConsoleIO_readall_impl(self);
+ if (size > BUFMAX) {
+ PyErr_Format(PyExc_ValueError, "cannot read more than %d bytes", BUFMAX);
+ return NULL;
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, size);
+ if (bytes == NULL)
+ return NULL;
+
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ bytes_size = readinto(state, self, PyBytes_AS_STRING(bytes),
+ PyBytes_GET_SIZE(bytes));
+ if (bytes_size < 0) {
+ Py_CLEAR(bytes);
+ return NULL;
+ }
+
+ if (bytes_size < PyBytes_GET_SIZE(bytes)) {
+ if (_PyBytes_Resize(&bytes, bytes_size) < 0) {
+ Py_CLEAR(bytes);
+ return NULL;
+ }
+ }
+
+ return bytes;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.write
+ cls: defining_class
+ b: Py_buffer
+ /
+
+Write buffer b to file, return number of bytes written.
+
+Only makes one system call, so not all of the data may be written.
+The number of bytes actually written is returned.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_write_impl(winconsoleio *self, PyTypeObject *cls,
+ Py_buffer *b)
+/*[clinic end generated code: output=e8019f480243cb29 input=10ac37c19339dfbe]*/
+{
+ BOOL res = TRUE;
+ wchar_t *wbuf;
+ DWORD len, wlen, n = 0;
+ HANDLE handle;
+
+ if (self->fd == -1)
+ return err_closed();
+ if (!self->writable) {
+ _PyIO_State *state = get_io_state_by_cls(cls);
+ return err_mode(state, "writing");
+ }
+
+ handle = _Py_get_osfhandle(self->fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ if (!b->len) {
+ return PyLong_FromLong(0);
+ }
+ if (b->len > BUFMAX)
+ len = BUFMAX;
+ else
+ len = (DWORD)b->len;
+
+ Py_BEGIN_ALLOW_THREADS
+ wlen = MultiByteToWideChar(CP_UTF8, 0, b->buf, len, NULL, 0);
+
+ /* issue11395 there is an unspecified upper bound on how many bytes
+ can be written at once. We cap at 32k - the caller will have to
+ handle partial writes.
+ Since we don't know how many input bytes are being ignored, we
+ have to reduce and recalculate. */
+ while (wlen > 32766 / sizeof(wchar_t)) {
+ len /= 2;
+ /* Fix for github issues gh-110913 and gh-82052. */
+ len = _find_last_utf8_boundary(b->buf, len);
+ wlen = MultiByteToWideChar(CP_UTF8, 0, b->buf, len, NULL, 0);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (!wlen)
+ return PyErr_SetFromWindowsErr(0);
+
+ wbuf = (wchar_t*)PyMem_Malloc(wlen * sizeof(wchar_t));
+
+ Py_BEGIN_ALLOW_THREADS
+ wlen = MultiByteToWideChar(CP_UTF8, 0, b->buf, len, wbuf, wlen);
+ if (wlen) {
+ res = WriteConsoleW(handle, wbuf, wlen, &n, NULL);
+ if (res && n < wlen) {
+ /* Wrote fewer characters than expected, which means our
+ * len value may be wrong. So recalculate it from the
+ * characters that were written. As this could potentially
+ * result in a different value, we also validate that value.
+ */
+ len = WideCharToMultiByte(CP_UTF8, 0, wbuf, n,
+ NULL, 0, NULL, NULL);
+ if (len) {
+ wlen = MultiByteToWideChar(CP_UTF8, 0, b->buf, len,
+ NULL, 0);
+ assert(wlen == len);
+ }
+ }
+ } else
+ res = 0;
+ Py_END_ALLOW_THREADS
+
+ if (!res) {
+ DWORD err = GetLastError();
+ PyMem_Free(wbuf);
+ return PyErr_SetFromWindowsErr(err);
+ }
+
+ PyMem_Free(wbuf);
+ return PyLong_FromSsize_t(len);
+}
+
+static PyObject *
+winconsoleio_repr(winconsoleio *self)
+{
+ if (self->fd == -1)
+ return PyUnicode_FromFormat("<_io._WindowsConsoleIO [closed]>");
+
+ if (self->readable)
+ return PyUnicode_FromFormat("<_io._WindowsConsoleIO mode='rb' closefd=%s>",
+ self->closefd ? "True" : "False");
+ if (self->writable)
+ return PyUnicode_FromFormat("<_io._WindowsConsoleIO mode='wb' closefd=%s>",
+ self->closefd ? "True" : "False");
+
+ PyErr_SetString(PyExc_SystemError, "_WindowsConsoleIO has invalid mode");
+ return NULL;
+}
+
+/*[clinic input]
+_io._WindowsConsoleIO.isatty
+
+Always True.
+[clinic start generated code]*/
+
+static PyObject *
+_io__WindowsConsoleIO_isatty_impl(winconsoleio *self)
+/*[clinic end generated code: output=9eac09d287c11bd7 input=9b91591dbe356f86]*/
+{
+ if (self->fd == -1)
+ return err_closed();
+
+ Py_RETURN_TRUE;
+}
+
+#define clinic_state() (find_io_state_by_def(Py_TYPE(self)))
+#include "clinic/winconsoleio.c.h"
+#undef clinic_state
+
+static PyMethodDef winconsoleio_methods[] = {
+ _IO__WINDOWSCONSOLEIO_READ_METHODDEF
+ _IO__WINDOWSCONSOLEIO_READALL_METHODDEF
+ _IO__WINDOWSCONSOLEIO_READINTO_METHODDEF
+ _IO__WINDOWSCONSOLEIO_WRITE_METHODDEF
+ _IO__WINDOWSCONSOLEIO_CLOSE_METHODDEF
+ _IO__WINDOWSCONSOLEIO_READABLE_METHODDEF
+ _IO__WINDOWSCONSOLEIO_WRITABLE_METHODDEF
+ _IO__WINDOWSCONSOLEIO_FILENO_METHODDEF
+ _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+/* 'closed' and 'mode' are attributes for compatibility with FileIO. */
+
+static PyObject *
+get_closed(winconsoleio *self, void *closure)
+{
+ return PyBool_FromLong((long)(self->fd == -1));
+}
+
+static PyObject *
+get_closefd(winconsoleio *self, void *closure)
+{
+ return PyBool_FromLong((long)(self->closefd));
+}
+
+static PyObject *
+get_mode(winconsoleio *self, void *closure)
+{
+ return PyUnicode_FromString(self->readable ? "rb" : "wb");
+}
+
+static PyGetSetDef winconsoleio_getsetlist[] = {
+ {"closed", (getter)get_closed, NULL, "True if the file is closed"},
+ {"closefd", (getter)get_closefd, NULL,
+ "True if the file descriptor will be closed by close()."},
+ {"mode", (getter)get_mode, NULL, "String giving the file mode"},
+ {NULL},
+};
+
+static PyMemberDef winconsoleio_members[] = {
+ {"_blksize", T_UINT, offsetof(winconsoleio, blksize), 0},
+ {"_finalizing", T_BOOL, offsetof(winconsoleio, finalizing), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(winconsoleio, weakreflist), READONLY},
+ {"__dictoffset__", T_PYSSIZET, offsetof(winconsoleio, dict), READONLY},
+ {NULL}
+};
+
+static PyType_Slot winconsoleio_slots[] = {
+ {Py_tp_dealloc, winconsoleio_dealloc},
+ {Py_tp_repr, winconsoleio_repr},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)_io__WindowsConsoleIO___init____doc__},
+ {Py_tp_traverse, winconsoleio_traverse},
+ {Py_tp_clear, winconsoleio_clear},
+ {Py_tp_methods, winconsoleio_methods},
+ {Py_tp_members, winconsoleio_members},
+ {Py_tp_getset, winconsoleio_getsetlist},
+ {Py_tp_init, _io__WindowsConsoleIO___init__},
+ {Py_tp_new, winconsoleio_new},
+ {0, NULL},
+};
+
+PyType_Spec winconsoleio_spec = {
+ .name = "_io._WindowsConsoleIO",
+ .basicsize = sizeof(winconsoleio),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = winconsoleio_slots,
+};
+
+#endif /* HAVE_WINDOWS_CONSOLE_IO */
diff --git a/contrib/tools/python3/Modules/_json.c b/contrib/tools/python3/Modules/_json.c
new file mode 100644
index 00000000000..c90de05b046
--- /dev/null
+++ b/contrib/tools/python3/Modules/_json.c
@@ -0,0 +1,1820 @@
+/* JSON accelerator C extensor: _json module.
+ *
+ * It is built as a built-in module (Py_BUILD_CORE_BUILTIN define) on Windows
+ * and as an extension module (Py_BUILD_CORE_MODULE define) on other
+ * platforms. */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#include "pycore_runtime.h" // _PyRuntime
+#include "structmember.h" // PyMemberDef
+#include "pycore_global_objects.h" // _Py_ID()
+#include <stdbool.h> // bool
+
+
+typedef struct _PyScannerObject {
+ PyObject_HEAD
+ signed char strict;
+ PyObject *object_hook;
+ PyObject *object_pairs_hook;
+ PyObject *parse_float;
+ PyObject *parse_int;
+ PyObject *parse_constant;
+ PyObject *memo;
+} PyScannerObject;
+
+static PyMemberDef scanner_members[] = {
+ {"strict", T_BOOL, offsetof(PyScannerObject, strict), READONLY, "strict"},
+ {"object_hook", T_OBJECT, offsetof(PyScannerObject, object_hook), READONLY, "object_hook"},
+ {"object_pairs_hook", T_OBJECT, offsetof(PyScannerObject, object_pairs_hook), READONLY},
+ {"parse_float", T_OBJECT, offsetof(PyScannerObject, parse_float), READONLY, "parse_float"},
+ {"parse_int", T_OBJECT, offsetof(PyScannerObject, parse_int), READONLY, "parse_int"},
+ {"parse_constant", T_OBJECT, offsetof(PyScannerObject, parse_constant), READONLY, "parse_constant"},
+ {NULL}
+};
+
+typedef struct _PyEncoderObject {
+ PyObject_HEAD
+ PyObject *markers;
+ PyObject *defaultfn;
+ PyObject *encoder;
+ PyObject *indent;
+ PyObject *key_separator;
+ PyObject *item_separator;
+ char sort_keys;
+ char skipkeys;
+ int allow_nan;
+ PyCFunction fast_encode;
+} PyEncoderObject;
+
+static PyMemberDef encoder_members[] = {
+ {"markers", T_OBJECT, offsetof(PyEncoderObject, markers), READONLY, "markers"},
+ {"default", T_OBJECT, offsetof(PyEncoderObject, defaultfn), READONLY, "default"},
+ {"encoder", T_OBJECT, offsetof(PyEncoderObject, encoder), READONLY, "encoder"},
+ {"indent", T_OBJECT, offsetof(PyEncoderObject, indent), READONLY, "indent"},
+ {"key_separator", T_OBJECT, offsetof(PyEncoderObject, key_separator), READONLY, "key_separator"},
+ {"item_separator", T_OBJECT, offsetof(PyEncoderObject, item_separator), READONLY, "item_separator"},
+ {"sort_keys", T_BOOL, offsetof(PyEncoderObject, sort_keys), READONLY, "sort_keys"},
+ {"skipkeys", T_BOOL, offsetof(PyEncoderObject, skipkeys), READONLY, "skipkeys"},
+ {NULL}
+};
+
+/* Forward decls */
+
+static PyObject *
+ascii_escape_unicode(PyObject *pystr);
+static PyObject *
+py_encode_basestring_ascii(PyObject* Py_UNUSED(self), PyObject *pystr);
+static PyObject *
+scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr);
+static PyObject *
+_build_rval_index_tuple(PyObject *rval, Py_ssize_t idx);
+static PyObject *
+scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
+static void
+scanner_dealloc(PyObject *self);
+static int
+scanner_clear(PyScannerObject *self);
+static PyObject *
+encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
+static void
+encoder_dealloc(PyObject *self);
+static int
+encoder_clear(PyEncoderObject *self);
+static int
+encoder_listencode_list(PyEncoderObject *s, _PyUnicodeWriter *writer, PyObject *seq, Py_ssize_t indent_level);
+static int
+encoder_listencode_obj(PyEncoderObject *s, _PyUnicodeWriter *writer, PyObject *obj, Py_ssize_t indent_level);
+static int
+encoder_listencode_dict(PyEncoderObject *s, _PyUnicodeWriter *writer, PyObject *dct, Py_ssize_t indent_level);
+static PyObject *
+_encoded_const(PyObject *obj);
+static void
+raise_errmsg(const char *msg, PyObject *s, Py_ssize_t end);
+static PyObject *
+encoder_encode_string(PyEncoderObject *s, PyObject *obj);
+static PyObject *
+encoder_encode_float(PyEncoderObject *s, PyObject *obj);
+
+#define S_CHAR(c) (c >= ' ' && c <= '~' && c != '\\' && c != '"')
+#define IS_WHITESPACE(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
+
+static Py_ssize_t
+ascii_escape_unichar(Py_UCS4 c, unsigned char *output, Py_ssize_t chars)
+{
+ /* Escape unicode code point c to ASCII escape sequences
+ in char *output. output must have at least 12 bytes unused to
+ accommodate an escaped surrogate pair "\uXXXX\uXXXX" */
+ output[chars++] = '\\';
+ switch (c) {
+ case '\\': output[chars++] = c; break;
+ case '"': output[chars++] = c; break;
+ case '\b': output[chars++] = 'b'; break;
+ case '\f': output[chars++] = 'f'; break;
+ case '\n': output[chars++] = 'n'; break;
+ case '\r': output[chars++] = 'r'; break;
+ case '\t': output[chars++] = 't'; break;
+ default:
+ if (c >= 0x10000) {
+ /* UTF-16 surrogate pair */
+ Py_UCS4 v = Py_UNICODE_HIGH_SURROGATE(c);
+ output[chars++] = 'u';
+ output[chars++] = Py_hexdigits[(v >> 12) & 0xf];
+ output[chars++] = Py_hexdigits[(v >> 8) & 0xf];
+ output[chars++] = Py_hexdigits[(v >> 4) & 0xf];
+ output[chars++] = Py_hexdigits[(v ) & 0xf];
+ c = Py_UNICODE_LOW_SURROGATE(c);
+ output[chars++] = '\\';
+ }
+ output[chars++] = 'u';
+ output[chars++] = Py_hexdigits[(c >> 12) & 0xf];
+ output[chars++] = Py_hexdigits[(c >> 8) & 0xf];
+ output[chars++] = Py_hexdigits[(c >> 4) & 0xf];
+ output[chars++] = Py_hexdigits[(c ) & 0xf];
+ }
+ return chars;
+}
+
+static PyObject *
+ascii_escape_unicode(PyObject *pystr)
+{
+ /* Take a PyUnicode pystr and return a new ASCII-only escaped PyUnicode */
+ Py_ssize_t i;
+ Py_ssize_t input_chars;
+ Py_ssize_t output_size;
+ Py_ssize_t chars;
+ PyObject *rval;
+ const void *input;
+ Py_UCS1 *output;
+ int kind;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return NULL;
+
+ input_chars = PyUnicode_GET_LENGTH(pystr);
+ input = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+
+ /* Compute the output size */
+ for (i = 0, output_size = 2; i < input_chars; i++) {
+ Py_UCS4 c = PyUnicode_READ(kind, input, i);
+ Py_ssize_t d;
+ if (S_CHAR(c)) {
+ d = 1;
+ }
+ else {
+ switch(c) {
+ case '\\': case '"': case '\b': case '\f':
+ case '\n': case '\r': case '\t':
+ d = 2; break;
+ default:
+ d = c >= 0x10000 ? 12 : 6;
+ }
+ }
+ if (output_size > PY_SSIZE_T_MAX - d) {
+ PyErr_SetString(PyExc_OverflowError, "string is too long to escape");
+ return NULL;
+ }
+ output_size += d;
+ }
+
+ rval = PyUnicode_New(output_size, 127);
+ if (rval == NULL) {
+ return NULL;
+ }
+ output = PyUnicode_1BYTE_DATA(rval);
+ chars = 0;
+ output[chars++] = '"';
+ for (i = 0; i < input_chars; i++) {
+ Py_UCS4 c = PyUnicode_READ(kind, input, i);
+ if (S_CHAR(c)) {
+ output[chars++] = c;
+ }
+ else {
+ chars = ascii_escape_unichar(c, output, chars);
+ }
+ }
+ output[chars++] = '"';
+#ifdef Py_DEBUG
+ assert(_PyUnicode_CheckConsistency(rval, 1));
+#endif
+ return rval;
+}
+
+static PyObject *
+escape_unicode(PyObject *pystr)
+{
+ /* Take a PyUnicode pystr and return a new escaped PyUnicode */
+ Py_ssize_t i;
+ Py_ssize_t input_chars;
+ Py_ssize_t output_size;
+ Py_ssize_t chars;
+ PyObject *rval;
+ const void *input;
+ int kind;
+ Py_UCS4 maxchar;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return NULL;
+
+ maxchar = PyUnicode_MAX_CHAR_VALUE(pystr);
+ input_chars = PyUnicode_GET_LENGTH(pystr);
+ input = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+
+ /* Compute the output size */
+ for (i = 0, output_size = 2; i < input_chars; i++) {
+ Py_UCS4 c = PyUnicode_READ(kind, input, i);
+ Py_ssize_t d;
+ switch (c) {
+ case '\\': case '"': case '\b': case '\f':
+ case '\n': case '\r': case '\t':
+ d = 2;
+ break;
+ default:
+ if (c <= 0x1f)
+ d = 6;
+ else
+ d = 1;
+ }
+ if (output_size > PY_SSIZE_T_MAX - d) {
+ PyErr_SetString(PyExc_OverflowError, "string is too long to escape");
+ return NULL;
+ }
+ output_size += d;
+ }
+
+ rval = PyUnicode_New(output_size, maxchar);
+ if (rval == NULL)
+ return NULL;
+
+ kind = PyUnicode_KIND(rval);
+
+#define ENCODE_OUTPUT do { \
+ chars = 0; \
+ output[chars++] = '"'; \
+ for (i = 0; i < input_chars; i++) { \
+ Py_UCS4 c = PyUnicode_READ(kind, input, i); \
+ switch (c) { \
+ case '\\': output[chars++] = '\\'; output[chars++] = c; break; \
+ case '"': output[chars++] = '\\'; output[chars++] = c; break; \
+ case '\b': output[chars++] = '\\'; output[chars++] = 'b'; break; \
+ case '\f': output[chars++] = '\\'; output[chars++] = 'f'; break; \
+ case '\n': output[chars++] = '\\'; output[chars++] = 'n'; break; \
+ case '\r': output[chars++] = '\\'; output[chars++] = 'r'; break; \
+ case '\t': output[chars++] = '\\'; output[chars++] = 't'; break; \
+ default: \
+ if (c <= 0x1f) { \
+ output[chars++] = '\\'; \
+ output[chars++] = 'u'; \
+ output[chars++] = '0'; \
+ output[chars++] = '0'; \
+ output[chars++] = Py_hexdigits[(c >> 4) & 0xf]; \
+ output[chars++] = Py_hexdigits[(c ) & 0xf]; \
+ } else { \
+ output[chars++] = c; \
+ } \
+ } \
+ } \
+ output[chars++] = '"'; \
+ } while (0)
+
+ if (kind == PyUnicode_1BYTE_KIND) {
+ Py_UCS1 *output = PyUnicode_1BYTE_DATA(rval);
+ ENCODE_OUTPUT;
+ } else if (kind == PyUnicode_2BYTE_KIND) {
+ Py_UCS2 *output = PyUnicode_2BYTE_DATA(rval);
+ ENCODE_OUTPUT;
+ } else {
+ Py_UCS4 *output = PyUnicode_4BYTE_DATA(rval);
+ assert(kind == PyUnicode_4BYTE_KIND);
+ ENCODE_OUTPUT;
+ }
+#undef ENCODE_OUTPUT
+
+#ifdef Py_DEBUG
+ assert(_PyUnicode_CheckConsistency(rval, 1));
+#endif
+ return rval;
+}
+
+static void
+raise_errmsg(const char *msg, PyObject *s, Py_ssize_t end)
+{
+ /* Use JSONDecodeError exception to raise a nice looking ValueError subclass */
+ _Py_DECLARE_STR(json_decoder, "json.decoder");
+ PyObject *JSONDecodeError =
+ _PyImport_GetModuleAttr(&_Py_STR(json_decoder), &_Py_ID(JSONDecodeError));
+ if (JSONDecodeError == NULL) {
+ return;
+ }
+
+ PyObject *exc;
+ exc = PyObject_CallFunction(JSONDecodeError, "zOn", msg, s, end);
+ Py_DECREF(JSONDecodeError);
+ if (exc) {
+ PyErr_SetObject(JSONDecodeError, exc);
+ Py_DECREF(exc);
+ }
+}
+
+static void
+raise_stop_iteration(Py_ssize_t idx)
+{
+ PyObject *value = PyLong_FromSsize_t(idx);
+ if (value != NULL) {
+ PyErr_SetObject(PyExc_StopIteration, value);
+ Py_DECREF(value);
+ }
+}
+
+static PyObject *
+_build_rval_index_tuple(PyObject *rval, Py_ssize_t idx) {
+ /* return (rval, idx) tuple, stealing reference to rval */
+ PyObject *tpl;
+ PyObject *pyidx;
+ /*
+ steal a reference to rval, returns (rval, idx)
+ */
+ if (rval == NULL) {
+ return NULL;
+ }
+ pyidx = PyLong_FromSsize_t(idx);
+ if (pyidx == NULL) {
+ Py_DECREF(rval);
+ return NULL;
+ }
+ tpl = PyTuple_New(2);
+ if (tpl == NULL) {
+ Py_DECREF(pyidx);
+ Py_DECREF(rval);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(tpl, 0, rval);
+ PyTuple_SET_ITEM(tpl, 1, pyidx);
+ return tpl;
+}
+
+static PyObject *
+scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next_end_ptr)
+{
+ /* Read the JSON string from PyUnicode pystr.
+ end is the index of the first character after the quote.
+ if strict is zero then literal control characters are allowed
+ *next_end_ptr is a return-by-reference index of the character
+ after the end quote
+
+ Return value is a new PyUnicode
+ */
+ PyObject *rval = NULL;
+ Py_ssize_t len;
+ Py_ssize_t begin = end - 1;
+ Py_ssize_t next /* = begin */;
+ const void *buf;
+ int kind;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return 0;
+
+ _PyUnicodeWriter writer;
+ _PyUnicodeWriter_Init(&writer);
+ writer.overallocate = 1;
+
+ len = PyUnicode_GET_LENGTH(pystr);
+ buf = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+
+ if (end < 0 || len < end) {
+ PyErr_SetString(PyExc_ValueError, "end is out of bounds");
+ goto bail;
+ }
+ while (1) {
+ /* Find the end of the string or the next escape */
+ Py_UCS4 c;
+ {
+ // Use tight scope variable to help register allocation.
+ Py_UCS4 d = 0;
+ for (next = end; next < len; next++) {
+ d = PyUnicode_READ(kind, buf, next);
+ if (d == '"' || d == '\\') {
+ break;
+ }
+ if (d <= 0x1f && strict) {
+ raise_errmsg("Invalid control character at", pystr, next);
+ goto bail;
+ }
+ }
+ c = d;
+ }
+
+ if (c == '"') {
+ // Fast path for simple case.
+ if (writer.buffer == NULL) {
+ PyObject *ret = PyUnicode_Substring(pystr, end, next);
+ if (ret == NULL) {
+ goto bail;
+ }
+ *next_end_ptr = next + 1;;
+ return ret;
+ }
+ }
+ else if (c != '\\') {
+ raise_errmsg("Unterminated string starting at", pystr, begin);
+ goto bail;
+ }
+
+ /* Pick up this chunk if it's not zero length */
+ if (next != end) {
+ if (_PyUnicodeWriter_WriteSubstring(&writer, pystr, end, next) < 0) {
+ goto bail;
+ }
+ }
+ next++;
+ if (c == '"') {
+ end = next;
+ break;
+ }
+ if (next == len) {
+ raise_errmsg("Unterminated string starting at", pystr, begin);
+ goto bail;
+ }
+ c = PyUnicode_READ(kind, buf, next);
+ if (c != 'u') {
+ /* Non-unicode backslash escapes */
+ end = next + 1;
+ switch (c) {
+ case '"': break;
+ case '\\': break;
+ case '/': break;
+ case 'b': c = '\b'; break;
+ case 'f': c = '\f'; break;
+ case 'n': c = '\n'; break;
+ case 'r': c = '\r'; break;
+ case 't': c = '\t'; break;
+ default: c = 0;
+ }
+ if (c == 0) {
+ raise_errmsg("Invalid \\escape", pystr, end - 2);
+ goto bail;
+ }
+ }
+ else {
+ c = 0;
+ next++;
+ end = next + 4;
+ if (end >= len) {
+ raise_errmsg("Invalid \\uXXXX escape", pystr, next - 1);
+ goto bail;
+ }
+ /* Decode 4 hex digits */
+ for (; next < end; next++) {
+ Py_UCS4 digit = PyUnicode_READ(kind, buf, next);
+ c <<= 4;
+ switch (digit) {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ c |= (digit - '0'); break;
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f':
+ c |= (digit - 'a' + 10); break;
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F':
+ c |= (digit - 'A' + 10); break;
+ default:
+ raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5);
+ goto bail;
+ }
+ }
+ /* Surrogate pair */
+ if (Py_UNICODE_IS_HIGH_SURROGATE(c) && end + 6 < len &&
+ PyUnicode_READ(kind, buf, next++) == '\\' &&
+ PyUnicode_READ(kind, buf, next++) == 'u') {
+ Py_UCS4 c2 = 0;
+ end += 6;
+ /* Decode 4 hex digits */
+ for (; next < end; next++) {
+ Py_UCS4 digit = PyUnicode_READ(kind, buf, next);
+ c2 <<= 4;
+ switch (digit) {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ c2 |= (digit - '0'); break;
+ case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f':
+ c2 |= (digit - 'a' + 10); break;
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F':
+ c2 |= (digit - 'A' + 10); break;
+ default:
+ raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5);
+ goto bail;
+ }
+ }
+ if (Py_UNICODE_IS_LOW_SURROGATE(c2))
+ c = Py_UNICODE_JOIN_SURROGATES(c, c2);
+ else
+ end -= 6;
+ }
+ }
+ if (_PyUnicodeWriter_WriteChar(&writer, c) < 0) {
+ goto bail;
+ }
+ }
+
+ rval = _PyUnicodeWriter_Finish(&writer);
+ *next_end_ptr = end;
+ return rval;
+
+bail:
+ *next_end_ptr = -1;
+ _PyUnicodeWriter_Dealloc(&writer);
+ return NULL;
+}
+
+PyDoc_STRVAR(pydoc_scanstring,
+ "scanstring(string, end, strict=True) -> (string, end)\n"
+ "\n"
+ "Scan the string s for a JSON string. End is the index of the\n"
+ "character in s after the quote that started the JSON string.\n"
+ "Unescapes all valid JSON string escape sequences and raises ValueError\n"
+ "on attempt to decode an invalid string. If strict is False then literal\n"
+ "control characters are allowed in the string.\n"
+ "\n"
+ "Returns a tuple of the decoded string and the index of the character in s\n"
+ "after the end quote."
+);
+
+static PyObject *
+py_scanstring(PyObject* Py_UNUSED(self), PyObject *args)
+{
+ PyObject *pystr;
+ PyObject *rval;
+ Py_ssize_t end;
+ Py_ssize_t next_end = -1;
+ int strict = 1;
+ if (!PyArg_ParseTuple(args, "On|p:scanstring", &pystr, &end, &strict)) {
+ return NULL;
+ }
+ if (PyUnicode_Check(pystr)) {
+ rval = scanstring_unicode(pystr, end, strict, &next_end);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "first argument must be a string, not %.80s",
+ Py_TYPE(pystr)->tp_name);
+ return NULL;
+ }
+ return _build_rval_index_tuple(rval, next_end);
+}
+
+PyDoc_STRVAR(pydoc_encode_basestring_ascii,
+ "encode_basestring_ascii(string) -> string\n"
+ "\n"
+ "Return an ASCII-only JSON representation of a Python string"
+);
+
+static PyObject *
+py_encode_basestring_ascii(PyObject* Py_UNUSED(self), PyObject *pystr)
+{
+ PyObject *rval;
+ /* Return an ASCII-only JSON representation of a Python string */
+ /* METH_O */
+ if (PyUnicode_Check(pystr)) {
+ rval = ascii_escape_unicode(pystr);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "first argument must be a string, not %.80s",
+ Py_TYPE(pystr)->tp_name);
+ return NULL;
+ }
+ return rval;
+}
+
+
+PyDoc_STRVAR(pydoc_encode_basestring,
+ "encode_basestring(string) -> string\n"
+ "\n"
+ "Return a JSON representation of a Python string"
+);
+
+static PyObject *
+py_encode_basestring(PyObject* Py_UNUSED(self), PyObject *pystr)
+{
+ PyObject *rval;
+ /* Return a JSON representation of a Python string */
+ /* METH_O */
+ if (PyUnicode_Check(pystr)) {
+ rval = escape_unicode(pystr);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "first argument must be a string, not %.80s",
+ Py_TYPE(pystr)->tp_name);
+ return NULL;
+ }
+ return rval;
+}
+
+static void
+scanner_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(self);
+ scanner_clear((PyScannerObject *)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static int
+scanner_traverse(PyScannerObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->object_hook);
+ Py_VISIT(self->object_pairs_hook);
+ Py_VISIT(self->parse_float);
+ Py_VISIT(self->parse_int);
+ Py_VISIT(self->parse_constant);
+ Py_VISIT(self->memo);
+ return 0;
+}
+
+static int
+scanner_clear(PyScannerObject *self)
+{
+ Py_CLEAR(self->object_hook);
+ Py_CLEAR(self->object_pairs_hook);
+ Py_CLEAR(self->parse_float);
+ Py_CLEAR(self->parse_int);
+ Py_CLEAR(self->parse_constant);
+ Py_CLEAR(self->memo);
+ return 0;
+}
+
+static PyObject *
+_parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
+{
+ /* Read a JSON object from PyUnicode pystr.
+ idx is the index of the first character after the opening curly brace.
+ *next_idx_ptr is a return-by-reference index to the first character after
+ the closing curly brace.
+
+ Returns a new PyObject (usually a dict, but object_hook can change that)
+ */
+ const void *str;
+ int kind;
+ Py_ssize_t end_idx;
+ PyObject *val = NULL;
+ PyObject *rval = NULL;
+ PyObject *key = NULL;
+ int has_pairs_hook = (s->object_pairs_hook != Py_None);
+ Py_ssize_t next_idx;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return NULL;
+
+ str = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+ end_idx = PyUnicode_GET_LENGTH(pystr) - 1;
+
+ if (has_pairs_hook)
+ rval = PyList_New(0);
+ else
+ rval = PyDict_New();
+ if (rval == NULL)
+ return NULL;
+
+ /* skip whitespace after { */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind,str, idx))) idx++;
+
+ /* only loop if the object is non-empty */
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != '}') {
+ while (1) {
+ PyObject *memokey;
+
+ /* read key */
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != '"') {
+ raise_errmsg("Expecting property name enclosed in double quotes", pystr, idx);
+ goto bail;
+ }
+ key = scanstring_unicode(pystr, idx + 1, s->strict, &next_idx);
+ if (key == NULL)
+ goto bail;
+ memokey = PyDict_SetDefault(s->memo, key, key);
+ if (memokey == NULL) {
+ goto bail;
+ }
+ Py_SETREF(key, Py_NewRef(memokey));
+ idx = next_idx;
+
+ /* skip whitespace between key and : delimiter, read :, skip whitespace */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ':') {
+ raise_errmsg("Expecting ':' delimiter", pystr, idx);
+ goto bail;
+ }
+ idx++;
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+
+ /* read any JSON term */
+ val = scan_once_unicode(s, pystr, idx, &next_idx);
+ if (val == NULL)
+ goto bail;
+
+ if (has_pairs_hook) {
+ PyObject *item = PyTuple_Pack(2, key, val);
+ if (item == NULL)
+ goto bail;
+ Py_CLEAR(key);
+ Py_CLEAR(val);
+ if (PyList_Append(rval, item) == -1) {
+ Py_DECREF(item);
+ goto bail;
+ }
+ Py_DECREF(item);
+ }
+ else {
+ if (PyDict_SetItem(rval, key, val) < 0)
+ goto bail;
+ Py_CLEAR(key);
+ Py_CLEAR(val);
+ }
+ idx = next_idx;
+
+ /* skip whitespace before } or , */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+
+ /* bail if the object is closed or we didn't get the , delimiter */
+ if (idx <= end_idx && PyUnicode_READ(kind, str, idx) == '}')
+ break;
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ',') {
+ raise_errmsg("Expecting ',' delimiter", pystr, idx);
+ goto bail;
+ }
+ idx++;
+
+ /* skip whitespace after , delimiter */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+ }
+ }
+
+ *next_idx_ptr = idx + 1;
+
+ if (has_pairs_hook) {
+ val = PyObject_CallOneArg(s->object_pairs_hook, rval);
+ Py_DECREF(rval);
+ return val;
+ }
+
+ /* if object_hook is not None: rval = object_hook(rval) */
+ if (s->object_hook != Py_None) {
+ val = PyObject_CallOneArg(s->object_hook, rval);
+ Py_DECREF(rval);
+ return val;
+ }
+ return rval;
+bail:
+ Py_XDECREF(key);
+ Py_XDECREF(val);
+ Py_XDECREF(rval);
+ return NULL;
+}
+
+static PyObject *
+_parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) {
+ /* Read a JSON array from PyUnicode pystr.
+ idx is the index of the first character after the opening brace.
+ *next_idx_ptr is a return-by-reference index to the first character after
+ the closing brace.
+
+ Returns a new PyList
+ */
+ const void *str;
+ int kind;
+ Py_ssize_t end_idx;
+ PyObject *val = NULL;
+ PyObject *rval;
+ Py_ssize_t next_idx;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return NULL;
+
+ rval = PyList_New(0);
+ if (rval == NULL)
+ return NULL;
+
+ str = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+ end_idx = PyUnicode_GET_LENGTH(pystr) - 1;
+
+ /* skip whitespace after [ */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+
+ /* only loop if the array is non-empty */
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ']') {
+ while (1) {
+
+ /* read any JSON term */
+ val = scan_once_unicode(s, pystr, idx, &next_idx);
+ if (val == NULL)
+ goto bail;
+
+ if (PyList_Append(rval, val) == -1)
+ goto bail;
+
+ Py_CLEAR(val);
+ idx = next_idx;
+
+ /* skip whitespace between term and , */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+
+ /* bail if the array is closed or we didn't get the , delimiter */
+ if (idx <= end_idx && PyUnicode_READ(kind, str, idx) == ']')
+ break;
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ',') {
+ raise_errmsg("Expecting ',' delimiter", pystr, idx);
+ goto bail;
+ }
+ idx++;
+
+ /* skip whitespace after , */
+ while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
+ }
+ }
+
+ /* verify that idx < end_idx, PyUnicode_READ(kind, str, idx) should be ']' */
+ if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ']') {
+ raise_errmsg("Expecting value", pystr, end_idx);
+ goto bail;
+ }
+ *next_idx_ptr = idx + 1;
+ return rval;
+bail:
+ Py_XDECREF(val);
+ Py_DECREF(rval);
+ return NULL;
+}
+
+static PyObject *
+_parse_constant(PyScannerObject *s, const char *constant, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) {
+ /* Read a JSON constant.
+ constant is the constant string that was found
+ ("NaN", "Infinity", "-Infinity").
+ idx is the index of the first character of the constant
+ *next_idx_ptr is a return-by-reference index to the first character after
+ the constant.
+
+ Returns the result of parse_constant
+ */
+ PyObject *cstr;
+ PyObject *rval;
+ /* constant is "NaN", "Infinity", or "-Infinity" */
+ cstr = PyUnicode_InternFromString(constant);
+ if (cstr == NULL)
+ return NULL;
+
+ /* rval = parse_constant(constant) */
+ rval = PyObject_CallOneArg(s->parse_constant, cstr);
+ idx += PyUnicode_GET_LENGTH(cstr);
+ Py_DECREF(cstr);
+ *next_idx_ptr = idx;
+ return rval;
+}
+
+static PyObject *
+_match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_ptr) {
+ /* Read a JSON number from PyUnicode pystr.
+ idx is the index of the first character of the number
+ *next_idx_ptr is a return-by-reference index to the first character after
+ the number.
+
+ Returns a new PyObject representation of that number:
+ PyLong, or PyFloat.
+ May return other types if parse_int or parse_float are set
+ */
+ const void *str;
+ int kind;
+ Py_ssize_t end_idx;
+ Py_ssize_t idx = start;
+ int is_float = 0;
+ PyObject *rval;
+ PyObject *numstr = NULL;
+ PyObject *custom_func;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return NULL;
+
+ str = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+ end_idx = PyUnicode_GET_LENGTH(pystr) - 1;
+
+ /* read a sign if it's there, make sure it's not the end of the string */
+ if (PyUnicode_READ(kind, str, idx) == '-') {
+ idx++;
+ if (idx > end_idx) {
+ raise_stop_iteration(start);
+ return NULL;
+ }
+ }
+
+ /* read as many integer digits as we find as long as it doesn't start with 0 */
+ if (PyUnicode_READ(kind, str, idx) >= '1' && PyUnicode_READ(kind, str, idx) <= '9') {
+ idx++;
+ while (idx <= end_idx && PyUnicode_READ(kind, str, idx) >= '0' && PyUnicode_READ(kind, str, idx) <= '9') idx++;
+ }
+ /* if it starts with 0 we only expect one integer digit */
+ else if (PyUnicode_READ(kind, str, idx) == '0') {
+ idx++;
+ }
+ /* no integer digits, error */
+ else {
+ raise_stop_iteration(start);
+ return NULL;
+ }
+
+ /* if the next char is '.' followed by a digit then read all float digits */
+ if (idx < end_idx && PyUnicode_READ(kind, str, idx) == '.' && PyUnicode_READ(kind, str, idx + 1) >= '0' && PyUnicode_READ(kind, str, idx + 1) <= '9') {
+ is_float = 1;
+ idx += 2;
+ while (idx <= end_idx && PyUnicode_READ(kind, str, idx) >= '0' && PyUnicode_READ(kind, str, idx) <= '9') idx++;
+ }
+
+ /* if the next char is 'e' or 'E' then maybe read the exponent (or backtrack) */
+ if (idx < end_idx && (PyUnicode_READ(kind, str, idx) == 'e' || PyUnicode_READ(kind, str, idx) == 'E')) {
+ Py_ssize_t e_start = idx;
+ idx++;
+
+ /* read an exponent sign if present */
+ if (idx < end_idx && (PyUnicode_READ(kind, str, idx) == '-' || PyUnicode_READ(kind, str, idx) == '+')) idx++;
+
+ /* read all digits */
+ while (idx <= end_idx && PyUnicode_READ(kind, str, idx) >= '0' && PyUnicode_READ(kind, str, idx) <= '9') idx++;
+
+ /* if we got a digit, then parse as float. if not, backtrack */
+ if (PyUnicode_READ(kind, str, idx - 1) >= '0' && PyUnicode_READ(kind, str, idx - 1) <= '9') {
+ is_float = 1;
+ }
+ else {
+ idx = e_start;
+ }
+ }
+
+ if (is_float && s->parse_float != (PyObject *)&PyFloat_Type)
+ custom_func = s->parse_float;
+ else if (!is_float && s->parse_int != (PyObject *) &PyLong_Type)
+ custom_func = s->parse_int;
+ else
+ custom_func = NULL;
+
+ if (custom_func) {
+ /* copy the section we determined to be a number */
+ numstr = PyUnicode_FromKindAndData(kind,
+ (char*)str + kind * start,
+ idx - start);
+ if (numstr == NULL)
+ return NULL;
+ rval = PyObject_CallOneArg(custom_func, numstr);
+ }
+ else {
+ Py_ssize_t i, n;
+ char *buf;
+ /* Straight conversion to ASCII, to avoid costly conversion of
+ decimal unicode digits (which cannot appear here) */
+ n = idx - start;
+ numstr = PyBytes_FromStringAndSize(NULL, n);
+ if (numstr == NULL)
+ return NULL;
+ buf = PyBytes_AS_STRING(numstr);
+ for (i = 0; i < n; i++) {
+ buf[i] = (char) PyUnicode_READ(kind, str, i + start);
+ }
+ if (is_float)
+ rval = PyFloat_FromString(numstr);
+ else
+ rval = PyLong_FromString(buf, NULL, 10);
+ }
+ Py_DECREF(numstr);
+ *next_idx_ptr = idx;
+ return rval;
+}
+
+static PyObject *
+scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
+{
+ /* Read one JSON term (of any kind) from PyUnicode pystr.
+ idx is the index of the first character of the term
+ *next_idx_ptr is a return-by-reference index to the first character after
+ the number.
+
+ Returns a new PyObject representation of the term.
+ */
+ PyObject *res;
+ const void *str;
+ int kind;
+ Py_ssize_t length;
+
+ if (PyUnicode_READY(pystr) == -1)
+ return NULL;
+
+ str = PyUnicode_DATA(pystr);
+ kind = PyUnicode_KIND(pystr);
+ length = PyUnicode_GET_LENGTH(pystr);
+
+ if (idx < 0) {
+ PyErr_SetString(PyExc_ValueError, "idx cannot be negative");
+ return NULL;
+ }
+ if (idx >= length) {
+ raise_stop_iteration(idx);
+ return NULL;
+ }
+
+ switch (PyUnicode_READ(kind, str, idx)) {
+ case '"':
+ /* string */
+ return scanstring_unicode(pystr, idx + 1, s->strict, next_idx_ptr);
+ case '{':
+ /* object */
+ if (_Py_EnterRecursiveCall(" while decoding a JSON object "
+ "from a unicode string"))
+ return NULL;
+ res = _parse_object_unicode(s, pystr, idx + 1, next_idx_ptr);
+ _Py_LeaveRecursiveCall();
+ return res;
+ case '[':
+ /* array */
+ if (_Py_EnterRecursiveCall(" while decoding a JSON array "
+ "from a unicode string"))
+ return NULL;
+ res = _parse_array_unicode(s, pystr, idx + 1, next_idx_ptr);
+ _Py_LeaveRecursiveCall();
+ return res;
+ case 'n':
+ /* null */
+ if ((idx + 3 < length) && PyUnicode_READ(kind, str, idx + 1) == 'u' && PyUnicode_READ(kind, str, idx + 2) == 'l' && PyUnicode_READ(kind, str, idx + 3) == 'l') {
+ *next_idx_ptr = idx + 4;
+ Py_RETURN_NONE;
+ }
+ break;
+ case 't':
+ /* true */
+ if ((idx + 3 < length) && PyUnicode_READ(kind, str, idx + 1) == 'r' && PyUnicode_READ(kind, str, idx + 2) == 'u' && PyUnicode_READ(kind, str, idx + 3) == 'e') {
+ *next_idx_ptr = idx + 4;
+ Py_RETURN_TRUE;
+ }
+ break;
+ case 'f':
+ /* false */
+ if ((idx + 4 < length) && PyUnicode_READ(kind, str, idx + 1) == 'a' &&
+ PyUnicode_READ(kind, str, idx + 2) == 'l' &&
+ PyUnicode_READ(kind, str, idx + 3) == 's' &&
+ PyUnicode_READ(kind, str, idx + 4) == 'e') {
+ *next_idx_ptr = idx + 5;
+ Py_RETURN_FALSE;
+ }
+ break;
+ case 'N':
+ /* NaN */
+ if ((idx + 2 < length) && PyUnicode_READ(kind, str, idx + 1) == 'a' &&
+ PyUnicode_READ(kind, str, idx + 2) == 'N') {
+ return _parse_constant(s, "NaN", idx, next_idx_ptr);
+ }
+ break;
+ case 'I':
+ /* Infinity */
+ if ((idx + 7 < length) && PyUnicode_READ(kind, str, idx + 1) == 'n' &&
+ PyUnicode_READ(kind, str, idx + 2) == 'f' &&
+ PyUnicode_READ(kind, str, idx + 3) == 'i' &&
+ PyUnicode_READ(kind, str, idx + 4) == 'n' &&
+ PyUnicode_READ(kind, str, idx + 5) == 'i' &&
+ PyUnicode_READ(kind, str, idx + 6) == 't' &&
+ PyUnicode_READ(kind, str, idx + 7) == 'y') {
+ return _parse_constant(s, "Infinity", idx, next_idx_ptr);
+ }
+ break;
+ case '-':
+ /* -Infinity */
+ if ((idx + 8 < length) && PyUnicode_READ(kind, str, idx + 1) == 'I' &&
+ PyUnicode_READ(kind, str, idx + 2) == 'n' &&
+ PyUnicode_READ(kind, str, idx + 3) == 'f' &&
+ PyUnicode_READ(kind, str, idx + 4) == 'i' &&
+ PyUnicode_READ(kind, str, idx + 5) == 'n' &&
+ PyUnicode_READ(kind, str, idx + 6) == 'i' &&
+ PyUnicode_READ(kind, str, idx + 7) == 't' &&
+ PyUnicode_READ(kind, str, idx + 8) == 'y') {
+ return _parse_constant(s, "-Infinity", idx, next_idx_ptr);
+ }
+ break;
+ }
+ /* Didn't find a string, object, array, or named constant. Look for a number. */
+ return _match_number_unicode(s, pystr, idx, next_idx_ptr);
+}
+
+static PyObject *
+scanner_call(PyScannerObject *self, PyObject *args, PyObject *kwds)
+{
+ /* Python callable interface to scan_once_{str,unicode} */
+ PyObject *pystr;
+ PyObject *rval;
+ Py_ssize_t idx;
+ Py_ssize_t next_idx = -1;
+ static char *kwlist[] = {"string", "idx", NULL};
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:scan_once", kwlist, &pystr, &idx))
+ return NULL;
+
+ if (PyUnicode_Check(pystr)) {
+ rval = scan_once_unicode(self, pystr, idx, &next_idx);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "first argument must be a string, not %.80s",
+ Py_TYPE(pystr)->tp_name);
+ return NULL;
+ }
+ PyDict_Clear(self->memo);
+ if (rval == NULL)
+ return NULL;
+ return _build_rval_index_tuple(rval, next_idx);
+}
+
+static PyObject *
+scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyScannerObject *s;
+ PyObject *ctx;
+ PyObject *strict;
+ static char *kwlist[] = {"context", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx))
+ return NULL;
+
+ s = (PyScannerObject *)type->tp_alloc(type, 0);
+ if (s == NULL) {
+ return NULL;
+ }
+
+ s->memo = PyDict_New();
+ if (s->memo == NULL)
+ goto bail;
+
+ /* All of these will fail "gracefully" so we don't need to verify them */
+ strict = PyObject_GetAttrString(ctx, "strict");
+ if (strict == NULL)
+ goto bail;
+ s->strict = PyObject_IsTrue(strict);
+ Py_DECREF(strict);
+ if (s->strict < 0)
+ goto bail;
+ s->object_hook = PyObject_GetAttrString(ctx, "object_hook");
+ if (s->object_hook == NULL)
+ goto bail;
+ s->object_pairs_hook = PyObject_GetAttrString(ctx, "object_pairs_hook");
+ if (s->object_pairs_hook == NULL)
+ goto bail;
+ s->parse_float = PyObject_GetAttrString(ctx, "parse_float");
+ if (s->parse_float == NULL)
+ goto bail;
+ s->parse_int = PyObject_GetAttrString(ctx, "parse_int");
+ if (s->parse_int == NULL)
+ goto bail;
+ s->parse_constant = PyObject_GetAttrString(ctx, "parse_constant");
+ if (s->parse_constant == NULL)
+ goto bail;
+
+ return (PyObject *)s;
+
+bail:
+ Py_DECREF(s);
+ return NULL;
+}
+
+PyDoc_STRVAR(scanner_doc, "JSON scanner object");
+
+static PyType_Slot PyScannerType_slots[] = {
+ {Py_tp_doc, (void *)scanner_doc},
+ {Py_tp_dealloc, scanner_dealloc},
+ {Py_tp_call, scanner_call},
+ {Py_tp_traverse, scanner_traverse},
+ {Py_tp_clear, scanner_clear},
+ {Py_tp_members, scanner_members},
+ {Py_tp_new, scanner_new},
+ {0, 0}
+};
+
+static PyType_Spec PyScannerType_spec = {
+ .name = "_json.Scanner",
+ .basicsize = sizeof(PyScannerObject),
+ .itemsize = 0,
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
+ .slots = PyScannerType_slots,
+};
+
+static PyObject *
+encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"markers", "default", "encoder", "indent", "key_separator", "item_separator", "sort_keys", "skipkeys", "allow_nan", NULL};
+
+ PyEncoderObject *s;
+ PyObject *markers, *defaultfn, *encoder, *indent, *key_separator;
+ PyObject *item_separator;
+ int sort_keys, skipkeys, allow_nan;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOOUUppp:make_encoder", kwlist,
+ &markers, &defaultfn, &encoder, &indent,
+ &key_separator, &item_separator,
+ &sort_keys, &skipkeys, &allow_nan))
+ return NULL;
+
+ if (markers != Py_None && !PyDict_Check(markers)) {
+ PyErr_Format(PyExc_TypeError,
+ "make_encoder() argument 1 must be dict or None, "
+ "not %.200s", Py_TYPE(markers)->tp_name);
+ return NULL;
+ }
+
+ s = (PyEncoderObject *)type->tp_alloc(type, 0);
+ if (s == NULL)
+ return NULL;
+
+ s->markers = Py_NewRef(markers);
+ s->defaultfn = Py_NewRef(defaultfn);
+ s->encoder = Py_NewRef(encoder);
+ s->indent = Py_NewRef(indent);
+ s->key_separator = Py_NewRef(key_separator);
+ s->item_separator = Py_NewRef(item_separator);
+ s->sort_keys = sort_keys;
+ s->skipkeys = skipkeys;
+ s->allow_nan = allow_nan;
+ s->fast_encode = NULL;
+
+ if (PyCFunction_Check(s->encoder)) {
+ PyCFunction f = PyCFunction_GetFunction(s->encoder);
+ if (f == (PyCFunction)py_encode_basestring_ascii ||
+ f == (PyCFunction)py_encode_basestring) {
+ s->fast_encode = f;
+ }
+ }
+
+ return (PyObject *)s;
+}
+
+static PyObject *
+encoder_call(PyEncoderObject *self, PyObject *args, PyObject *kwds)
+{
+ /* Python callable interface to encode_listencode_obj */
+ static char *kwlist[] = {"obj", "_current_indent_level", NULL};
+ PyObject *obj, *result;
+ Py_ssize_t indent_level;
+ _PyUnicodeWriter writer;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "On:_iterencode", kwlist,
+ &obj, &indent_level))
+ return NULL;
+
+ _PyUnicodeWriter_Init(&writer);
+ writer.overallocate = 1;
+
+ if (encoder_listencode_obj(self, &writer, obj, indent_level)) {
+ _PyUnicodeWriter_Dealloc(&writer);
+ return NULL;
+ }
+
+ result = PyTuple_New(1);
+ if (result == NULL ||
+ PyTuple_SetItem(result, 0, _PyUnicodeWriter_Finish(&writer)) < 0) {
+ Py_XDECREF(result);
+ return NULL;
+ }
+ return result;
+}
+
+static PyObject *
+_encoded_const(PyObject *obj)
+{
+ /* Return the JSON string representation of None, True, False */
+ if (obj == Py_None) {
+ return Py_NewRef(&_Py_ID(null));
+ }
+ else if (obj == Py_True) {
+ return Py_NewRef(&_Py_ID(true));
+ }
+ else if (obj == Py_False) {
+ return Py_NewRef(&_Py_ID(false));
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError, "not a const");
+ return NULL;
+ }
+}
+
+static PyObject *
+encoder_encode_float(PyEncoderObject *s, PyObject *obj)
+{
+ /* Return the JSON representation of a PyFloat. */
+ double i = PyFloat_AS_DOUBLE(obj);
+ if (!Py_IS_FINITE(i)) {
+ if (!s->allow_nan) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "Out of range float values are not JSON compliant: %R",
+ obj
+ );
+ return NULL;
+ }
+ if (i > 0) {
+ return PyUnicode_FromString("Infinity");
+ }
+ else if (i < 0) {
+ return PyUnicode_FromString("-Infinity");
+ }
+ else {
+ return PyUnicode_FromString("NaN");
+ }
+ }
+ return PyFloat_Type.tp_repr(obj);
+}
+
+static PyObject *
+encoder_encode_string(PyEncoderObject *s, PyObject *obj)
+{
+ /* Return the JSON representation of a string */
+ PyObject *encoded;
+
+ if (s->fast_encode) {
+ return s->fast_encode(NULL, obj);
+ }
+ encoded = PyObject_CallOneArg(s->encoder, obj);
+ if (encoded != NULL && !PyUnicode_Check(encoded)) {
+ PyErr_Format(PyExc_TypeError,
+ "encoder() must return a string, not %.80s",
+ Py_TYPE(encoded)->tp_name);
+ Py_DECREF(encoded);
+ return NULL;
+ }
+ return encoded;
+}
+
+static int
+_steal_accumulate(_PyUnicodeWriter *writer, PyObject *stolen)
+{
+ /* Append stolen and then decrement its reference count */
+ int rval = _PyUnicodeWriter_WriteStr(writer, stolen);
+ Py_DECREF(stolen);
+ return rval;
+}
+
+static int
+encoder_listencode_obj(PyEncoderObject *s, _PyUnicodeWriter *writer,
+ PyObject *obj, Py_ssize_t indent_level)
+{
+ /* Encode Python object obj to a JSON term */
+ PyObject *newobj;
+ int rv;
+
+ if (obj == Py_None) {
+ return _PyUnicodeWriter_WriteASCIIString(writer, "null", 4);
+ }
+ else if (obj == Py_True) {
+ return _PyUnicodeWriter_WriteASCIIString(writer, "true", 4);
+ }
+ else if (obj == Py_False) {
+ return _PyUnicodeWriter_WriteASCIIString(writer, "false", 5);
+ }
+ else if (PyUnicode_Check(obj)) {
+ PyObject *encoded = encoder_encode_string(s, obj);
+ if (encoded == NULL)
+ return -1;
+ return _steal_accumulate(writer, encoded);
+ }
+ else if (PyLong_Check(obj)) {
+ PyObject *encoded = PyLong_Type.tp_repr(obj);
+ if (encoded == NULL)
+ return -1;
+ return _steal_accumulate(writer, encoded);
+ }
+ else if (PyFloat_Check(obj)) {
+ PyObject *encoded = encoder_encode_float(s, obj);
+ if (encoded == NULL)
+ return -1;
+ return _steal_accumulate(writer, encoded);
+ }
+ else if (PyList_Check(obj) || PyTuple_Check(obj)) {
+ if (_Py_EnterRecursiveCall(" while encoding a JSON object"))
+ return -1;
+ rv = encoder_listencode_list(s, writer, obj, indent_level);
+ _Py_LeaveRecursiveCall();
+ return rv;
+ }
+ else if (PyDict_Check(obj)) {
+ if (_Py_EnterRecursiveCall(" while encoding a JSON object"))
+ return -1;
+ rv = encoder_listencode_dict(s, writer, obj, indent_level);
+ _Py_LeaveRecursiveCall();
+ return rv;
+ }
+ else {
+ PyObject *ident = NULL;
+ if (s->markers != Py_None) {
+ int has_key;
+ ident = PyLong_FromVoidPtr(obj);
+ if (ident == NULL)
+ return -1;
+ has_key = PyDict_Contains(s->markers, ident);
+ if (has_key) {
+ if (has_key != -1)
+ PyErr_SetString(PyExc_ValueError, "Circular reference detected");
+ Py_DECREF(ident);
+ return -1;
+ }
+ if (PyDict_SetItem(s->markers, ident, obj)) {
+ Py_DECREF(ident);
+ return -1;
+ }
+ }
+ newobj = PyObject_CallOneArg(s->defaultfn, obj);
+ if (newobj == NULL) {
+ Py_XDECREF(ident);
+ return -1;
+ }
+
+ if (_Py_EnterRecursiveCall(" while encoding a JSON object")) {
+ Py_DECREF(newobj);
+ Py_XDECREF(ident);
+ return -1;
+ }
+ rv = encoder_listencode_obj(s, writer, newobj, indent_level);
+ _Py_LeaveRecursiveCall();
+
+ Py_DECREF(newobj);
+ if (rv) {
+ Py_XDECREF(ident);
+ return -1;
+ }
+ if (ident != NULL) {
+ if (PyDict_DelItem(s->markers, ident)) {
+ Py_XDECREF(ident);
+ return -1;
+ }
+ Py_XDECREF(ident);
+ }
+ return rv;
+ }
+}
+
+static int
+encoder_encode_key_value(PyEncoderObject *s, _PyUnicodeWriter *writer, bool *first,
+ PyObject *key, PyObject *value, Py_ssize_t indent_level)
+{
+ PyObject *keystr = NULL;
+ PyObject *encoded;
+
+ if (PyUnicode_Check(key)) {
+ keystr = Py_NewRef(key);
+ }
+ else if (PyFloat_Check(key)) {
+ keystr = encoder_encode_float(s, key);
+ }
+ else if (key == Py_True || key == Py_False || key == Py_None) {
+ /* This must come before the PyLong_Check because
+ True and False are also 1 and 0.*/
+ keystr = _encoded_const(key);
+ }
+ else if (PyLong_Check(key)) {
+ keystr = PyLong_Type.tp_repr(key);
+ }
+ else if (s->skipkeys) {
+ return 0;
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "keys must be str, int, float, bool or None, "
+ "not %.100s", Py_TYPE(key)->tp_name);
+ return -1;
+ }
+
+ if (keystr == NULL) {
+ return -1;
+ }
+
+ if (*first) {
+ *first = false;
+ }
+ else {
+ if (_PyUnicodeWriter_WriteStr(writer, s->item_separator) < 0) {
+ Py_DECREF(keystr);
+ return -1;
+ }
+ }
+
+ encoded = encoder_encode_string(s, keystr);
+ Py_DECREF(keystr);
+ if (encoded == NULL) {
+ return -1;
+ }
+
+ if (_steal_accumulate(writer, encoded) < 0) {
+ return -1;
+ }
+ if (_PyUnicodeWriter_WriteStr(writer, s->key_separator) < 0) {
+ return -1;
+ }
+ if (encoder_listencode_obj(s, writer, value, indent_level) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+encoder_listencode_dict(PyEncoderObject *s, _PyUnicodeWriter *writer,
+ PyObject *dct, Py_ssize_t indent_level)
+{
+ /* Encode Python dict dct a JSON term */
+ PyObject *ident = NULL;
+ PyObject *items = NULL;
+ PyObject *key, *value;
+ bool first = true;
+
+ if (PyDict_GET_SIZE(dct) == 0) /* Fast path */
+ return _PyUnicodeWriter_WriteASCIIString(writer, "{}", 2);
+
+ if (s->markers != Py_None) {
+ int has_key;
+ ident = PyLong_FromVoidPtr(dct);
+ if (ident == NULL)
+ goto bail;
+ has_key = PyDict_Contains(s->markers, ident);
+ if (has_key) {
+ if (has_key != -1)
+ PyErr_SetString(PyExc_ValueError, "Circular reference detected");
+ goto bail;
+ }
+ if (PyDict_SetItem(s->markers, ident, dct)) {
+ goto bail;
+ }
+ }
+
+ if (_PyUnicodeWriter_WriteChar(writer, '{'))
+ goto bail;
+
+ if (s->indent != Py_None) {
+ /* TODO: DOES NOT RUN */
+ indent_level += 1;
+ /*
+ newline_indent = '\n' + (' ' * (_indent * _current_indent_level))
+ separator = _item_separator + newline_indent
+ buf += newline_indent
+ */
+ }
+
+ if (s->sort_keys || !PyDict_CheckExact(dct)) {
+ items = PyMapping_Items(dct);
+ if (items == NULL || (s->sort_keys && PyList_Sort(items) < 0))
+ goto bail;
+
+ for (Py_ssize_t i = 0; i < PyList_GET_SIZE(items); i++) {
+ PyObject *item = PyList_GET_ITEM(items, i);
+
+ if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
+ PyErr_SetString(PyExc_ValueError, "items must return 2-tuples");
+ goto bail;
+ }
+
+ key = PyTuple_GET_ITEM(item, 0);
+ value = PyTuple_GET_ITEM(item, 1);
+ if (encoder_encode_key_value(s, writer, &first, key, value, indent_level) < 0)
+ goto bail;
+ }
+ Py_CLEAR(items);
+
+ } else {
+ Py_ssize_t pos = 0;
+ while (PyDict_Next(dct, &pos, &key, &value)) {
+ if (encoder_encode_key_value(s, writer, &first, key, value, indent_level) < 0)
+ goto bail;
+ }
+ }
+
+ if (ident != NULL) {
+ if (PyDict_DelItem(s->markers, ident))
+ goto bail;
+ Py_CLEAR(ident);
+ }
+ /* TODO DOES NOT RUN; dead code
+ if (s->indent != Py_None) {
+ indent_level -= 1;
+
+ yield '\n' + (' ' * (_indent * _current_indent_level))
+ }*/
+ if (_PyUnicodeWriter_WriteChar(writer, '}'))
+ goto bail;
+ return 0;
+
+bail:
+ Py_XDECREF(items);
+ Py_XDECREF(ident);
+ return -1;
+}
+
+static int
+encoder_listencode_list(PyEncoderObject *s, _PyUnicodeWriter *writer,
+ PyObject *seq, Py_ssize_t indent_level)
+{
+ PyObject *ident = NULL;
+ PyObject *s_fast = NULL;
+ Py_ssize_t i;
+
+ ident = NULL;
+ s_fast = PySequence_Fast(seq, "_iterencode_list needs a sequence");
+ if (s_fast == NULL)
+ return -1;
+ if (PySequence_Fast_GET_SIZE(s_fast) == 0) {
+ Py_DECREF(s_fast);
+ return _PyUnicodeWriter_WriteASCIIString(writer, "[]", 2);
+ }
+
+ if (s->markers != Py_None) {
+ int has_key;
+ ident = PyLong_FromVoidPtr(seq);
+ if (ident == NULL)
+ goto bail;
+ has_key = PyDict_Contains(s->markers, ident);
+ if (has_key) {
+ if (has_key != -1)
+ PyErr_SetString(PyExc_ValueError, "Circular reference detected");
+ goto bail;
+ }
+ if (PyDict_SetItem(s->markers, ident, seq)) {
+ goto bail;
+ }
+ }
+
+ if (_PyUnicodeWriter_WriteChar(writer, '['))
+ goto bail;
+ if (s->indent != Py_None) {
+ /* TODO: DOES NOT RUN */
+ indent_level += 1;
+ /*
+ newline_indent = '\n' + (' ' * (_indent * _current_indent_level))
+ separator = _item_separator + newline_indent
+ buf += newline_indent
+ */
+ }
+ for (i = 0; i < PySequence_Fast_GET_SIZE(s_fast); i++) {
+ PyObject *obj = PySequence_Fast_GET_ITEM(s_fast, i);
+ if (i) {
+ if (_PyUnicodeWriter_WriteStr(writer, s->item_separator))
+ goto bail;
+ }
+ if (encoder_listencode_obj(s, writer, obj, indent_level))
+ goto bail;
+ }
+ if (ident != NULL) {
+ if (PyDict_DelItem(s->markers, ident))
+ goto bail;
+ Py_CLEAR(ident);
+ }
+
+ /* TODO: DOES NOT RUN
+ if (s->indent != Py_None) {
+ indent_level -= 1;
+
+ yield '\n' + (' ' * (_indent * _current_indent_level))
+ }*/
+ if (_PyUnicodeWriter_WriteChar(writer, ']'))
+ goto bail;
+ Py_DECREF(s_fast);
+ return 0;
+
+bail:
+ Py_XDECREF(ident);
+ Py_DECREF(s_fast);
+ return -1;
+}
+
+static void
+encoder_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(self);
+ encoder_clear((PyEncoderObject *)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static int
+encoder_traverse(PyEncoderObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->markers);
+ Py_VISIT(self->defaultfn);
+ Py_VISIT(self->encoder);
+ Py_VISIT(self->indent);
+ Py_VISIT(self->key_separator);
+ Py_VISIT(self->item_separator);
+ return 0;
+}
+
+static int
+encoder_clear(PyEncoderObject *self)
+{
+ /* Deallocate Encoder */
+ Py_CLEAR(self->markers);
+ Py_CLEAR(self->defaultfn);
+ Py_CLEAR(self->encoder);
+ Py_CLEAR(self->indent);
+ Py_CLEAR(self->key_separator);
+ Py_CLEAR(self->item_separator);
+ return 0;
+}
+
+PyDoc_STRVAR(encoder_doc, "_iterencode(obj, _current_indent_level) -> iterable");
+
+static PyType_Slot PyEncoderType_slots[] = {
+ {Py_tp_doc, (void *)encoder_doc},
+ {Py_tp_dealloc, encoder_dealloc},
+ {Py_tp_call, encoder_call},
+ {Py_tp_traverse, encoder_traverse},
+ {Py_tp_clear, encoder_clear},
+ {Py_tp_members, encoder_members},
+ {Py_tp_new, encoder_new},
+ {0, 0}
+};
+
+static PyType_Spec PyEncoderType_spec = {
+ .name = "_json.Encoder",
+ .basicsize = sizeof(PyEncoderObject),
+ .itemsize = 0,
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
+ .slots = PyEncoderType_slots
+};
+
+static PyMethodDef speedups_methods[] = {
+ {"encode_basestring_ascii",
+ (PyCFunction)py_encode_basestring_ascii,
+ METH_O,
+ pydoc_encode_basestring_ascii},
+ {"encode_basestring",
+ (PyCFunction)py_encode_basestring,
+ METH_O,
+ pydoc_encode_basestring},
+ {"scanstring",
+ (PyCFunction)py_scanstring,
+ METH_VARARGS,
+ pydoc_scanstring},
+ {NULL, NULL, 0, NULL}
+};
+
+PyDoc_STRVAR(module_doc,
+"json speedups\n");
+
+static int
+_json_exec(PyObject *module)
+{
+ PyObject *PyScannerType = PyType_FromSpec(&PyScannerType_spec);
+ if (PyScannerType == NULL) {
+ return -1;
+ }
+ int rc = PyModule_AddObjectRef(module, "make_scanner", PyScannerType);
+ Py_DECREF(PyScannerType);
+ if (rc < 0) {
+ return -1;
+ }
+
+ PyObject *PyEncoderType = PyType_FromSpec(&PyEncoderType_spec);
+ if (PyEncoderType == NULL) {
+ return -1;
+ }
+ rc = PyModule_AddObjectRef(module, "make_encoder", PyEncoderType);
+ Py_DECREF(PyEncoderType);
+ if (rc < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot _json_slots[] = {
+ {Py_mod_exec, _json_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef jsonmodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_json",
+ .m_doc = module_doc,
+ .m_methods = speedups_methods,
+ .m_slots = _json_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__json(void)
+{
+ return PyModuleDef_Init(&jsonmodule);
+}
diff --git a/contrib/tools/python3/Modules/_localemodule.c b/contrib/tools/python3/Modules/_localemodule.c
new file mode 100644
index 00000000000..cbd036fdf2a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_localemodule.c
@@ -0,0 +1,926 @@
+/***********************************************************
+Copyright (C) 1997, 2002, 2003, 2007, 2008 Martin von Loewis
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies.
+
+This software comes with no warranty. Use at your own risk.
+
+******************************************************************/
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_fileutils.h"
+
+#include <stdio.h>
+#include <locale.h>
+#include <string.h>
+#include <ctype.h>
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#ifdef HAVE_LANGINFO_H
+#include <langinfo.h>
+#endif
+
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#endif
+
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+
+#if defined(MS_WINDOWS)
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#endif
+
+PyDoc_STRVAR(locale__doc__, "Support for POSIX locales.");
+
+typedef struct _locale_state {
+ PyObject *Error;
+} _locale_state;
+
+static inline _locale_state*
+get_locale_state(PyObject *m)
+{
+ void *state = PyModule_GetState(m);
+ assert(state != NULL);
+ return (_locale_state *)state;
+}
+
+#include "clinic/_localemodule.c.h"
+
+/*[clinic input]
+module _locale
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ed98569b726feada]*/
+
+/* support functions for formatting floating point numbers */
+
+/* the grouping is terminated by either 0 or CHAR_MAX */
+static PyObject*
+copy_grouping(const char* s)
+{
+ int i;
+ PyObject *result, *val = NULL;
+
+ if (s[0] == '\0') {
+ /* empty string: no grouping at all */
+ return PyList_New(0);
+ }
+
+ for (i = 0; s[i] != '\0' && s[i] != CHAR_MAX; i++)
+ ; /* nothing */
+
+ result = PyList_New(i+1);
+ if (!result)
+ return NULL;
+
+ i = -1;
+ do {
+ i++;
+ val = PyLong_FromLong(s[i]);
+ if (val == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyList_SET_ITEM(result, i, val);
+ } while (s[i] != '\0' && s[i] != CHAR_MAX);
+
+ return result;
+}
+
+/*[clinic input]
+_locale.setlocale
+
+ category: int
+ locale: str(accept={str, NoneType}) = NULL
+ /
+
+Activates/queries locale processing.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_setlocale_impl(PyObject *module, int category, const char *locale)
+/*[clinic end generated code: output=a0e777ae5d2ff117 input=dbe18f1d66c57a6a]*/
+{
+ char *result;
+ PyObject *result_object;
+
+#if defined(MS_WINDOWS)
+ if (category < LC_MIN || category > LC_MAX)
+ {
+ PyErr_SetString(get_locale_state(module)->Error,
+ "invalid locale category");
+ return NULL;
+ }
+#endif
+
+ if (locale) {
+ /* set locale */
+ result = setlocale(category, locale);
+ if (!result) {
+ /* operation failed, no setting was changed */
+ PyErr_SetString(get_locale_state(module)->Error,
+ "unsupported locale setting");
+ return NULL;
+ }
+ result_object = PyUnicode_DecodeLocale(result, NULL);
+ if (!result_object)
+ return NULL;
+ } else {
+ /* get locale */
+ result = setlocale(category, NULL);
+ if (!result) {
+ PyErr_SetString(get_locale_state(module)->Error,
+ "locale query failed");
+ return NULL;
+ }
+ result_object = PyUnicode_DecodeLocale(result, NULL);
+ }
+ return result_object;
+}
+
+static int
+locale_is_ascii(const char *str)
+{
+ return (strlen(str) == 1 && ((unsigned char)str[0]) <= 127);
+}
+
+static int
+locale_decode_monetary(PyObject *dict, struct lconv *lc)
+{
+#ifndef MS_WINDOWS
+ int change_locale;
+ change_locale = (!locale_is_ascii(lc->int_curr_symbol)
+ || !locale_is_ascii(lc->currency_symbol)
+ || !locale_is_ascii(lc->mon_decimal_point)
+ || !locale_is_ascii(lc->mon_thousands_sep));
+
+ /* Keep a copy of the LC_CTYPE locale */
+ char *oldloc = NULL, *loc = NULL;
+ if (change_locale) {
+ oldloc = setlocale(LC_CTYPE, NULL);
+ if (!oldloc) {
+ PyErr_SetString(PyExc_RuntimeWarning,
+ "failed to get LC_CTYPE locale");
+ return -1;
+ }
+
+ oldloc = _PyMem_Strdup(oldloc);
+ if (!oldloc) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ loc = setlocale(LC_MONETARY, NULL);
+ if (loc != NULL && strcmp(loc, oldloc) == 0) {
+ loc = NULL;
+ }
+
+ if (loc != NULL) {
+ /* Only set the locale temporarily the LC_CTYPE locale
+ to the LC_MONETARY locale if the two locales are different and
+ at least one string is non-ASCII. */
+ setlocale(LC_CTYPE, loc);
+ }
+ }
+
+#define GET_LOCALE_STRING(ATTR) PyUnicode_DecodeLocale(lc->ATTR, NULL)
+#else /* MS_WINDOWS */
+/* Use _W_* fields of Windows struct lconv */
+#define GET_LOCALE_STRING(ATTR) PyUnicode_FromWideChar(lc->_W_ ## ATTR, -1)
+#endif /* MS_WINDOWS */
+
+ int res = -1;
+
+#define RESULT_STRING(ATTR) \
+ do { \
+ PyObject *obj; \
+ obj = GET_LOCALE_STRING(ATTR); \
+ if (obj == NULL) { \
+ goto done; \
+ } \
+ if (PyDict_SetItemString(dict, Py_STRINGIFY(ATTR), obj) < 0) { \
+ Py_DECREF(obj); \
+ goto done; \
+ } \
+ Py_DECREF(obj); \
+ } while (0)
+
+ RESULT_STRING(int_curr_symbol);
+ RESULT_STRING(currency_symbol);
+ RESULT_STRING(mon_decimal_point);
+ RESULT_STRING(mon_thousands_sep);
+#undef RESULT_STRING
+#undef GET_LOCALE_STRING
+
+ res = 0;
+
+done:
+#ifndef MS_WINDOWS
+ if (loc != NULL) {
+ setlocale(LC_CTYPE, oldloc);
+ }
+ PyMem_Free(oldloc);
+#endif
+ return res;
+}
+
+/*[clinic input]
+_locale.localeconv
+
+Returns numeric and monetary locale-specific parameters.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_localeconv_impl(PyObject *module)
+/*[clinic end generated code: output=43a54515e0a2aef5 input=f1132d15accf4444]*/
+{
+ PyObject* result;
+ struct lconv *lc;
+ PyObject *x;
+
+ result = PyDict_New();
+ if (!result) {
+ return NULL;
+ }
+
+ /* if LC_NUMERIC is different in the C library, use saved value */
+ lc = localeconv();
+
+ /* hopefully, the localeconv result survives the C library calls
+ involved herein */
+
+#define RESULT(key, obj)\
+ do { \
+ if (obj == NULL) \
+ goto failed; \
+ if (PyDict_SetItemString(result, key, obj) < 0) { \
+ Py_DECREF(obj); \
+ goto failed; \
+ } \
+ Py_DECREF(obj); \
+ } while (0)
+
+#ifdef MS_WINDOWS
+/* Use _W_* fields of Windows struct lconv */
+#define GET_LOCALE_STRING(ATTR) PyUnicode_FromWideChar(lc->_W_ ## ATTR, -1)
+#else
+#define GET_LOCALE_STRING(ATTR) PyUnicode_DecodeLocale(lc->ATTR, NULL)
+#endif
+#define RESULT_STRING(s)\
+ do { \
+ x = GET_LOCALE_STRING(s); \
+ RESULT(#s, x); \
+ } while (0)
+
+#define RESULT_INT(i)\
+ do { \
+ x = PyLong_FromLong(lc->i); \
+ RESULT(#i, x); \
+ } while (0)
+
+ /* Monetary information: LC_MONETARY encoding */
+ if (locale_decode_monetary(result, lc) < 0) {
+ goto failed;
+ }
+ x = copy_grouping(lc->mon_grouping);
+ RESULT("mon_grouping", x);
+
+ RESULT_STRING(positive_sign);
+ RESULT_STRING(negative_sign);
+ RESULT_INT(int_frac_digits);
+ RESULT_INT(frac_digits);
+ RESULT_INT(p_cs_precedes);
+ RESULT_INT(p_sep_by_space);
+ RESULT_INT(n_cs_precedes);
+ RESULT_INT(n_sep_by_space);
+ RESULT_INT(p_sign_posn);
+ RESULT_INT(n_sign_posn);
+
+ /* Numeric information: LC_NUMERIC encoding */
+ PyObject *decimal_point = NULL, *thousands_sep = NULL;
+ if (_Py_GetLocaleconvNumeric(lc, &decimal_point, &thousands_sep) < 0) {
+ Py_XDECREF(decimal_point);
+ Py_XDECREF(thousands_sep);
+ goto failed;
+ }
+
+ if (PyDict_SetItemString(result, "decimal_point", decimal_point) < 0) {
+ Py_DECREF(decimal_point);
+ Py_DECREF(thousands_sep);
+ goto failed;
+ }
+ Py_DECREF(decimal_point);
+
+ if (PyDict_SetItemString(result, "thousands_sep", thousands_sep) < 0) {
+ Py_DECREF(thousands_sep);
+ goto failed;
+ }
+ Py_DECREF(thousands_sep);
+
+ x = copy_grouping(lc->grouping);
+ RESULT("grouping", x);
+
+ return result;
+
+ failed:
+ Py_DECREF(result);
+ return NULL;
+
+#undef RESULT
+#undef RESULT_STRING
+#undef RESULT_INT
+#undef GET_LOCALE_STRING
+}
+
+#if defined(HAVE_WCSCOLL)
+
+/*[clinic input]
+_locale.strcoll
+
+ os1: unicode
+ os2: unicode
+ /
+
+Compares two strings according to the locale.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_strcoll_impl(PyObject *module, PyObject *os1, PyObject *os2)
+/*[clinic end generated code: output=82ddc6d62c76d618 input=693cd02bcbf38dd8]*/
+{
+ PyObject *result = NULL;
+ wchar_t *ws1 = NULL, *ws2 = NULL;
+
+ /* Convert the unicode strings to wchar[]. */
+ ws1 = PyUnicode_AsWideCharString(os1, NULL);
+ if (ws1 == NULL)
+ goto done;
+ ws2 = PyUnicode_AsWideCharString(os2, NULL);
+ if (ws2 == NULL)
+ goto done;
+ /* Collate the strings. */
+ result = PyLong_FromLong(wcscoll(ws1, ws2));
+ done:
+ /* Deallocate everything. */
+ if (ws1) PyMem_Free(ws1);
+ if (ws2) PyMem_Free(ws2);
+ return result;
+}
+#endif
+
+#ifdef HAVE_WCSXFRM
+
+/*[clinic input]
+_locale.strxfrm
+
+ string as str: unicode
+ /
+
+Return a string that can be used as a key for locale-aware comparisons.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_strxfrm_impl(PyObject *module, PyObject *str)
+/*[clinic end generated code: output=3081866ebffc01af input=1378bbe6a88b4780]*/
+{
+ Py_ssize_t n1;
+ wchar_t *s = NULL, *buf = NULL;
+ size_t n2;
+ PyObject *result = NULL;
+
+ s = PyUnicode_AsWideCharString(str, &n1);
+ if (s == NULL)
+ goto exit;
+ if (wcslen(s) != (size_t)n1) {
+ PyErr_SetString(PyExc_ValueError,
+ "embedded null character");
+ goto exit;
+ }
+
+ /* assume no change in size, first */
+ n1 = n1 + 1;
+ buf = PyMem_New(wchar_t, n1);
+ if (!buf) {
+ PyErr_NoMemory();
+ goto exit;
+ }
+ errno = 0;
+ n2 = wcsxfrm(buf, s, n1);
+ if (errno && errno != ERANGE) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto exit;
+ }
+ if (n2 >= (size_t)n1) {
+ /* more space needed */
+ wchar_t * new_buf = PyMem_Realloc(buf, (n2+1)*sizeof(wchar_t));
+ if (!new_buf) {
+ PyErr_NoMemory();
+ goto exit;
+ }
+ buf = new_buf;
+ errno = 0;
+ n2 = wcsxfrm(buf, s, n2+1);
+ if (errno) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto exit;
+ }
+ }
+ result = PyUnicode_FromWideChar(buf, n2);
+exit:
+ PyMem_Free(buf);
+ PyMem_Free(s);
+ return result;
+}
+#endif
+
+#if defined(MS_WINDOWS)
+
+/*[clinic input]
+_locale._getdefaultlocale
+
+[clinic start generated code]*/
+
+static PyObject *
+_locale__getdefaultlocale_impl(PyObject *module)
+/*[clinic end generated code: output=e6254088579534c2 input=003ea41acd17f7c7]*/
+{
+ char encoding[20];
+ char locale[100];
+
+ PyOS_snprintf(encoding, sizeof(encoding), "cp%u", GetACP());
+
+ if (GetLocaleInfoA(LOCALE_USER_DEFAULT,
+ LOCALE_SISO639LANGNAME,
+ locale, sizeof(locale))) {
+ Py_ssize_t i = strlen(locale);
+ locale[i++] = '_';
+ if (GetLocaleInfoA(LOCALE_USER_DEFAULT,
+ LOCALE_SISO3166CTRYNAME,
+ locale+i, (int)(sizeof(locale)-i)))
+ return Py_BuildValue("ss", locale, encoding);
+ }
+
+ /* If we end up here, this windows version didn't know about
+ ISO639/ISO3166 names (it's probably Windows 95). Return the
+ Windows language identifier instead (a hexadecimal number) */
+
+ locale[0] = '0';
+ locale[1] = 'x';
+ if (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTLANGUAGE,
+ locale+2, sizeof(locale)-2)) {
+ return Py_BuildValue("ss", locale, encoding);
+ }
+
+ /* cannot determine the language code (very unlikely) */
+ Py_INCREF(Py_None);
+ return Py_BuildValue("Os", Py_None, encoding);
+}
+#endif
+
+#ifdef HAVE_LANGINFO_H
+#define LANGINFO(X) {#X, X}
+static struct langinfo_constant{
+ char* name;
+ int value;
+} langinfo_constants[] =
+{
+ /* These constants should exist on any langinfo implementation */
+ LANGINFO(DAY_1),
+ LANGINFO(DAY_2),
+ LANGINFO(DAY_3),
+ LANGINFO(DAY_4),
+ LANGINFO(DAY_5),
+ LANGINFO(DAY_6),
+ LANGINFO(DAY_7),
+
+ LANGINFO(ABDAY_1),
+ LANGINFO(ABDAY_2),
+ LANGINFO(ABDAY_3),
+ LANGINFO(ABDAY_4),
+ LANGINFO(ABDAY_5),
+ LANGINFO(ABDAY_6),
+ LANGINFO(ABDAY_7),
+
+ LANGINFO(MON_1),
+ LANGINFO(MON_2),
+ LANGINFO(MON_3),
+ LANGINFO(MON_4),
+ LANGINFO(MON_5),
+ LANGINFO(MON_6),
+ LANGINFO(MON_7),
+ LANGINFO(MON_8),
+ LANGINFO(MON_9),
+ LANGINFO(MON_10),
+ LANGINFO(MON_11),
+ LANGINFO(MON_12),
+
+ LANGINFO(ABMON_1),
+ LANGINFO(ABMON_2),
+ LANGINFO(ABMON_3),
+ LANGINFO(ABMON_4),
+ LANGINFO(ABMON_5),
+ LANGINFO(ABMON_6),
+ LANGINFO(ABMON_7),
+ LANGINFO(ABMON_8),
+ LANGINFO(ABMON_9),
+ LANGINFO(ABMON_10),
+ LANGINFO(ABMON_11),
+ LANGINFO(ABMON_12),
+
+#ifdef RADIXCHAR
+ /* The following are not available with glibc 2.0 */
+ LANGINFO(RADIXCHAR),
+ LANGINFO(THOUSEP),
+ /* YESSTR and NOSTR are deprecated in glibc, since they are
+ a special case of message translation, which should be rather
+ done using gettext. So we don't expose it to Python in the
+ first place.
+ LANGINFO(YESSTR),
+ LANGINFO(NOSTR),
+ */
+ LANGINFO(CRNCYSTR),
+#endif
+
+ LANGINFO(D_T_FMT),
+ LANGINFO(D_FMT),
+ LANGINFO(T_FMT),
+ LANGINFO(AM_STR),
+ LANGINFO(PM_STR),
+
+ /* The following constants are available only with XPG4, but...
+ OpenBSD doesn't have CODESET but has T_FMT_AMPM, and doesn't have
+ a few of the others.
+ Solution: ifdef-test them all. */
+#ifdef CODESET
+ LANGINFO(CODESET),
+#endif
+#ifdef T_FMT_AMPM
+ LANGINFO(T_FMT_AMPM),
+#endif
+#ifdef ERA
+ LANGINFO(ERA),
+#endif
+#ifdef ERA_D_FMT
+ LANGINFO(ERA_D_FMT),
+#endif
+#ifdef ERA_D_T_FMT
+ LANGINFO(ERA_D_T_FMT),
+#endif
+#ifdef ERA_T_FMT
+ LANGINFO(ERA_T_FMT),
+#endif
+#ifdef ALT_DIGITS
+ LANGINFO(ALT_DIGITS),
+#endif
+#ifdef YESEXPR
+ LANGINFO(YESEXPR),
+#endif
+#ifdef NOEXPR
+ LANGINFO(NOEXPR),
+#endif
+#ifdef _DATE_FMT
+ /* This is not available in all glibc versions that have CODESET. */
+ LANGINFO(_DATE_FMT),
+#endif
+ {0, 0}
+};
+
+/*[clinic input]
+_locale.nl_langinfo
+
+ key as item: int
+ /
+
+Return the value for the locale information associated with key.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_nl_langinfo_impl(PyObject *module, int item)
+/*[clinic end generated code: output=6aea457b47e077a3 input=00798143eecfeddc]*/
+{
+ int i;
+ /* Check whether this is a supported constant. GNU libc sometimes
+ returns numeric values in the char* return value, which would
+ crash PyUnicode_FromString. */
+ for (i = 0; langinfo_constants[i].name; i++)
+ if (langinfo_constants[i].value == item) {
+ /* Check NULL as a workaround for GNU libc's returning NULL
+ instead of an empty string for nl_langinfo(ERA). */
+ const char *result = nl_langinfo(item);
+ result = result != NULL ? result : "";
+ return PyUnicode_DecodeLocale(result, NULL);
+ }
+ PyErr_SetString(PyExc_ValueError, "unsupported langinfo constant");
+ return NULL;
+}
+#endif /* HAVE_LANGINFO_H */
+
+#ifdef HAVE_LIBINTL_H
+
+/*[clinic input]
+_locale.gettext
+
+ msg as in: str
+ /
+
+gettext(msg) -> string
+
+Return translation of msg.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_gettext_impl(PyObject *module, const char *in)
+/*[clinic end generated code: output=493bb4b38a4704fe input=949fc8efc2bb3bc3]*/
+{
+ return PyUnicode_DecodeLocale(gettext(in), NULL);
+}
+
+/*[clinic input]
+_locale.dgettext
+
+ domain: str(accept={str, NoneType})
+ msg as in: str
+ /
+
+dgettext(domain, msg) -> string
+
+Return translation of msg in domain.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_dgettext_impl(PyObject *module, const char *domain, const char *in)
+/*[clinic end generated code: output=3c0cd5287b972c8f input=a277388a635109d8]*/
+{
+ return PyUnicode_DecodeLocale(dgettext(domain, in), NULL);
+}
+
+/*[clinic input]
+_locale.dcgettext
+
+ domain: str(accept={str, NoneType})
+ msg as msgid: str
+ category: int
+ /
+
+Return translation of msg in domain and category.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_dcgettext_impl(PyObject *module, const char *domain,
+ const char *msgid, int category)
+/*[clinic end generated code: output=0f4cc4fce0aa283f input=ec5f8fed4336de67]*/
+{
+ return PyUnicode_DecodeLocale(dcgettext(domain,msgid,category), NULL);
+}
+
+/*[clinic input]
+_locale.textdomain
+
+ domain: str(accept={str, NoneType})
+ /
+
+Set the C library's textdmain to domain, returning the new domain.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_textdomain_impl(PyObject *module, const char *domain)
+/*[clinic end generated code: output=7992df06aadec313 input=66359716f5eb1d38]*/
+{
+ domain = textdomain(domain);
+ if (!domain) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyUnicode_DecodeLocale(domain, NULL);
+}
+
+/*[clinic input]
+_locale.bindtextdomain
+
+ domain: str
+ dir as dirname_obj: object
+ /
+
+Bind the C library's domain to dir.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_bindtextdomain_impl(PyObject *module, const char *domain,
+ PyObject *dirname_obj)
+/*[clinic end generated code: output=6d6f3c7b345d785c input=c0dff085acfe272b]*/
+{
+ const char *dirname, *current_dirname;
+ PyObject *dirname_bytes = NULL, *result;
+
+ if (!strlen(domain)) {
+ PyErr_SetString(get_locale_state(module)->Error,
+ "domain must be a non-empty string");
+ return 0;
+ }
+ if (dirname_obj != Py_None) {
+ if (!PyUnicode_FSConverter(dirname_obj, &dirname_bytes))
+ return NULL;
+ dirname = PyBytes_AsString(dirname_bytes);
+ } else {
+ dirname_bytes = NULL;
+ dirname = NULL;
+ }
+ current_dirname = bindtextdomain(domain, dirname);
+ if (current_dirname == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ Py_XDECREF(dirname_bytes);
+ return NULL;
+ }
+ result = PyUnicode_DecodeLocale(current_dirname, NULL);
+ Py_XDECREF(dirname_bytes);
+ return result;
+}
+
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+
+/*[clinic input]
+_locale.bind_textdomain_codeset
+
+ domain: str
+ codeset: str(accept={str, NoneType})
+ /
+
+Bind the C library's domain to codeset.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_bind_textdomain_codeset_impl(PyObject *module, const char *domain,
+ const char *codeset)
+/*[clinic end generated code: output=fa452f9c8b1b9e89 input=23fbe3540400f259]*/
+{
+ codeset = bind_textdomain_codeset(domain, codeset);
+ if (codeset) {
+ return PyUnicode_DecodeLocale(codeset, NULL);
+ }
+ Py_RETURN_NONE;
+}
+#endif // HAVE_BIND_TEXTDOMAIN_CODESET
+
+#endif // HAVE_LIBINTL_H
+
+
+/*[clinic input]
+_locale.getencoding
+
+Get the current locale encoding.
+[clinic start generated code]*/
+
+static PyObject *
+_locale_getencoding_impl(PyObject *module)
+/*[clinic end generated code: output=86b326b971872e46 input=6503d11e5958b360]*/
+{
+ return _Py_GetLocaleEncodingObject();
+}
+
+
+static struct PyMethodDef PyLocale_Methods[] = {
+ _LOCALE_SETLOCALE_METHODDEF
+ _LOCALE_LOCALECONV_METHODDEF
+#ifdef HAVE_WCSCOLL
+ _LOCALE_STRCOLL_METHODDEF
+#endif
+#ifdef HAVE_WCSXFRM
+ _LOCALE_STRXFRM_METHODDEF
+#endif
+#if defined(MS_WINDOWS)
+ _LOCALE__GETDEFAULTLOCALE_METHODDEF
+#endif
+#ifdef HAVE_LANGINFO_H
+ _LOCALE_NL_LANGINFO_METHODDEF
+#endif
+#ifdef HAVE_LIBINTL_H
+ _LOCALE_GETTEXT_METHODDEF
+ _LOCALE_DGETTEXT_METHODDEF
+ _LOCALE_DCGETTEXT_METHODDEF
+ _LOCALE_TEXTDOMAIN_METHODDEF
+ _LOCALE_BINDTEXTDOMAIN_METHODDEF
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+ _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
+#endif
+#endif
+ _LOCALE_GETENCODING_METHODDEF
+ {NULL, NULL}
+};
+
+static int
+_locale_exec(PyObject *module)
+{
+#ifdef HAVE_LANGINFO_H
+ int i;
+#endif
+#define ADD_INT(module, value) \
+ do { \
+ if (PyModule_AddIntConstant(module, #value, value) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+ ADD_INT(module, LC_CTYPE);
+ ADD_INT(module, LC_TIME);
+ ADD_INT(module, LC_COLLATE);
+ ADD_INT(module, LC_MONETARY);
+
+#ifdef LC_MESSAGES
+ ADD_INT(module, LC_MESSAGES);
+#endif /* LC_MESSAGES */
+
+ ADD_INT(module, LC_NUMERIC);
+ ADD_INT(module, LC_ALL);
+ ADD_INT(module, CHAR_MAX);
+
+ _locale_state *state = get_locale_state(module);
+ state->Error = PyErr_NewException("locale.Error", NULL, NULL);
+ if (state->Error == NULL) {
+ return -1;
+ }
+ Py_INCREF(get_locale_state(module)->Error);
+ if (PyModule_AddObject(module, "Error", get_locale_state(module)->Error) < 0) {
+ Py_DECREF(get_locale_state(module)->Error);
+ return -1;
+ }
+
+#ifdef HAVE_LANGINFO_H
+ for (i = 0; langinfo_constants[i].name; i++) {
+ if (PyModule_AddIntConstant(module,
+ langinfo_constants[i].name,
+ langinfo_constants[i].value) < 0) {
+ return -1;
+ }
+ }
+#endif
+
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return 0;
+
+#undef ADD_INT
+}
+
+static struct PyModuleDef_Slot _locale_slots[] = {
+ {Py_mod_exec, _locale_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+locale_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _locale_state *state = get_locale_state(module);
+ Py_VISIT(state->Error);
+ return 0;
+}
+
+static int
+locale_clear(PyObject *module)
+{
+ _locale_state *state = get_locale_state(module);
+ Py_CLEAR(state->Error);
+ return 0;
+}
+
+static void
+locale_free(PyObject *module)
+{
+ locale_clear(module);
+}
+
+static struct PyModuleDef _localemodule = {
+ PyModuleDef_HEAD_INIT,
+ "_locale",
+ locale__doc__,
+ sizeof(_locale_state),
+ PyLocale_Methods,
+ _locale_slots,
+ locale_traverse,
+ locale_clear,
+ (freefunc)locale_free,
+};
+
+PyMODINIT_FUNC
+PyInit__locale(void)
+{
+ return PyModuleDef_Init(&_localemodule);
+}
+
+/*
+Local variables:
+c-basic-offset: 4
+indent-tabs-mode: nil
+End:
+*/
diff --git a/contrib/tools/python3/Modules/_lsprof.c b/contrib/tools/python3/Modules/_lsprof.c
new file mode 100644
index 00000000000..257de4387c0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_lsprof.c
@@ -0,0 +1,1027 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "rotatingtree.h"
+
+/************************************************************/
+/* Written by Brett Rosen and Ted Czotter */
+
+struct _ProfilerEntry;
+
+/* represents a function called from another function */
+typedef struct _ProfilerSubEntry {
+ rotating_node_t header;
+ _PyTime_t tt;
+ _PyTime_t it;
+ long callcount;
+ long recursivecallcount;
+ long recursionLevel;
+} ProfilerSubEntry;
+
+/* represents a function or user defined block */
+typedef struct _ProfilerEntry {
+ rotating_node_t header;
+ PyObject *userObj; /* PyCodeObject, or a descriptive str for builtins */
+ _PyTime_t tt; /* total time in this entry */
+ _PyTime_t it; /* inline time in this entry (not in subcalls) */
+ long callcount; /* how many times this was called */
+ long recursivecallcount; /* how many times called recursively */
+ long recursionLevel;
+ rotating_node_t *calls;
+} ProfilerEntry;
+
+typedef struct _ProfilerContext {
+ _PyTime_t t0;
+ _PyTime_t subt;
+ struct _ProfilerContext *previous;
+ ProfilerEntry *ctxEntry;
+} ProfilerContext;
+
+typedef struct {
+ PyObject_HEAD
+ rotating_node_t *profilerEntries;
+ ProfilerContext *currentProfilerContext;
+ ProfilerContext *freelistProfilerContext;
+ int flags;
+ PyObject *externalTimer;
+ double externalTimerUnit;
+ int tool_id;
+ PyObject* missing;
+} ProfilerObject;
+
+#define POF_ENABLED 0x001
+#define POF_SUBCALLS 0x002
+#define POF_BUILTINS 0x004
+#define POF_NOMEMORY 0x100
+
+/*[clinic input]
+module _lsprof
+class _lsprof.Profiler "ProfilerObject *" "&ProfilerType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e349ac952152f336]*/
+
+#include "clinic/_lsprof.c.h"
+
+typedef struct {
+ PyTypeObject *profiler_type;
+ PyTypeObject *stats_entry_type;
+ PyTypeObject *stats_subentry_type;
+} _lsprof_state;
+
+static inline _lsprof_state*
+_lsprof_get_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_lsprof_state *)state;
+}
+
+/*** External Timers ***/
+
+static _PyTime_t CallExternalTimer(ProfilerObject *pObj)
+{
+ PyObject *o = _PyObject_CallNoArgs(pObj->externalTimer);
+ if (o == NULL) {
+ PyErr_WriteUnraisable(pObj->externalTimer);
+ return 0;
+ }
+
+ _PyTime_t result;
+ int err;
+ if (pObj->externalTimerUnit > 0.0) {
+ /* interpret the result as an integer that will be scaled
+ in profiler_getstats() */
+ err = _PyTime_FromNanosecondsObject(&result, o);
+ }
+ else {
+ /* interpret the result as a double measured in seconds.
+ As the profiler works with _PyTime_t internally
+ we convert it to a large integer */
+ err = _PyTime_FromSecondsObject(&result, o, _PyTime_ROUND_FLOOR);
+ }
+ Py_DECREF(o);
+ if (err < 0) {
+ PyErr_WriteUnraisable(pObj->externalTimer);
+ return 0;
+ }
+ return result;
+}
+
+static inline _PyTime_t
+call_timer(ProfilerObject *pObj)
+{
+ if (pObj->externalTimer != NULL) {
+ return CallExternalTimer(pObj);
+ }
+ else {
+ return _PyTime_GetPerfCounter();
+ }
+}
+
+
+/*** ProfilerObject ***/
+
+static PyObject *
+normalizeUserObj(PyObject *obj)
+{
+ PyCFunctionObject *fn;
+ if (!PyCFunction_Check(obj)) {
+ return Py_NewRef(obj);
+ }
+ /* Replace built-in function objects with a descriptive string
+ because of built-in methods -- keeping a reference to
+ __self__ is probably not a good idea. */
+ fn = (PyCFunctionObject *)obj;
+
+ if (fn->m_self == NULL) {
+ /* built-in function: look up the module name */
+ PyObject *mod = fn->m_module;
+ PyObject *modname = NULL;
+ if (mod != NULL) {
+ if (PyUnicode_Check(mod)) {
+ modname = Py_NewRef(mod);
+ }
+ else if (PyModule_Check(mod)) {
+ modname = PyModule_GetNameObject(mod);
+ if (modname == NULL)
+ PyErr_Clear();
+ }
+ }
+ if (modname != NULL) {
+ if (!_PyUnicode_EqualToASCIIString(modname, "builtins")) {
+ PyObject *result;
+ result = PyUnicode_FromFormat("<%U.%s>", modname,
+ fn->m_ml->ml_name);
+ Py_DECREF(modname);
+ return result;
+ }
+ Py_DECREF(modname);
+ }
+ return PyUnicode_FromFormat("<%s>", fn->m_ml->ml_name);
+ }
+ else {
+ /* built-in method: try to return
+ repr(getattr(type(__self__), __name__))
+ */
+ PyObject *self = fn->m_self;
+ PyObject *name = PyUnicode_FromString(fn->m_ml->ml_name);
+ PyObject *modname = fn->m_module;
+
+ if (name != NULL) {
+ PyObject *mo = _PyType_Lookup(Py_TYPE(self), name);
+ Py_XINCREF(mo);
+ Py_DECREF(name);
+ if (mo != NULL) {
+ PyObject *res = PyObject_Repr(mo);
+ Py_DECREF(mo);
+ if (res != NULL)
+ return res;
+ }
+ }
+ /* Otherwise, use __module__ */
+ PyErr_Clear();
+ if (modname != NULL && PyUnicode_Check(modname))
+ return PyUnicode_FromFormat("<built-in method %S.%s>",
+ modname, fn->m_ml->ml_name);
+ else
+ return PyUnicode_FromFormat("<built-in method %s>",
+ fn->m_ml->ml_name);
+ }
+}
+
+static ProfilerEntry*
+newProfilerEntry(ProfilerObject *pObj, void *key, PyObject *userObj)
+{
+ ProfilerEntry *self;
+ self = (ProfilerEntry*) PyMem_Malloc(sizeof(ProfilerEntry));
+ if (self == NULL) {
+ pObj->flags |= POF_NOMEMORY;
+ return NULL;
+ }
+ userObj = normalizeUserObj(userObj);
+ if (userObj == NULL) {
+ PyErr_Clear();
+ PyMem_Free(self);
+ pObj->flags |= POF_NOMEMORY;
+ return NULL;
+ }
+ self->header.key = key;
+ self->userObj = userObj;
+ self->tt = 0;
+ self->it = 0;
+ self->callcount = 0;
+ self->recursivecallcount = 0;
+ self->recursionLevel = 0;
+ self->calls = EMPTY_ROTATING_TREE;
+ RotatingTree_Add(&pObj->profilerEntries, &self->header);
+ return self;
+}
+
+static ProfilerEntry*
+getEntry(ProfilerObject *pObj, void *key)
+{
+ return (ProfilerEntry*) RotatingTree_Get(&pObj->profilerEntries, key);
+}
+
+static ProfilerSubEntry *
+getSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry)
+{
+ return (ProfilerSubEntry*) RotatingTree_Get(&caller->calls,
+ (void *)entry);
+}
+
+static ProfilerSubEntry *
+newSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry)
+{
+ ProfilerSubEntry *self;
+ self = (ProfilerSubEntry*) PyMem_Malloc(sizeof(ProfilerSubEntry));
+ if (self == NULL) {
+ pObj->flags |= POF_NOMEMORY;
+ return NULL;
+ }
+ self->header.key = (void *)entry;
+ self->tt = 0;
+ self->it = 0;
+ self->callcount = 0;
+ self->recursivecallcount = 0;
+ self->recursionLevel = 0;
+ RotatingTree_Add(&caller->calls, &self->header);
+ return self;
+}
+
+static int freeSubEntry(rotating_node_t *header, void *arg)
+{
+ ProfilerSubEntry *subentry = (ProfilerSubEntry*) header;
+ PyMem_Free(subentry);
+ return 0;
+}
+
+static int freeEntry(rotating_node_t *header, void *arg)
+{
+ ProfilerEntry *entry = (ProfilerEntry*) header;
+ RotatingTree_Enum(entry->calls, freeSubEntry, NULL);
+ Py_DECREF(entry->userObj);
+ PyMem_Free(entry);
+ return 0;
+}
+
+static void clearEntries(ProfilerObject *pObj)
+{
+ RotatingTree_Enum(pObj->profilerEntries, freeEntry, NULL);
+ pObj->profilerEntries = EMPTY_ROTATING_TREE;
+ /* release the memory hold by the ProfilerContexts */
+ if (pObj->currentProfilerContext) {
+ PyMem_Free(pObj->currentProfilerContext);
+ pObj->currentProfilerContext = NULL;
+ }
+ while (pObj->freelistProfilerContext) {
+ ProfilerContext *c = pObj->freelistProfilerContext;
+ pObj->freelistProfilerContext = c->previous;
+ PyMem_Free(c);
+ }
+ pObj->freelistProfilerContext = NULL;
+}
+
+static void
+initContext(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry)
+{
+ self->ctxEntry = entry;
+ self->subt = 0;
+ self->previous = pObj->currentProfilerContext;
+ pObj->currentProfilerContext = self;
+ ++entry->recursionLevel;
+ if ((pObj->flags & POF_SUBCALLS) && self->previous) {
+ /* find or create an entry for me in my caller's entry */
+ ProfilerEntry *caller = self->previous->ctxEntry;
+ ProfilerSubEntry *subentry = getSubEntry(pObj, caller, entry);
+ if (subentry == NULL)
+ subentry = newSubEntry(pObj, caller, entry);
+ if (subentry)
+ ++subentry->recursionLevel;
+ }
+ self->t0 = call_timer(pObj);
+}
+
+static void
+Stop(ProfilerObject *pObj, ProfilerContext *self, ProfilerEntry *entry)
+{
+ _PyTime_t tt = call_timer(pObj) - self->t0;
+ _PyTime_t it = tt - self->subt;
+ if (self->previous)
+ self->previous->subt += tt;
+ pObj->currentProfilerContext = self->previous;
+ if (--entry->recursionLevel == 0)
+ entry->tt += tt;
+ else
+ ++entry->recursivecallcount;
+ entry->it += it;
+ entry->callcount++;
+ if ((pObj->flags & POF_SUBCALLS) && self->previous) {
+ /* find or create an entry for me in my caller's entry */
+ ProfilerEntry *caller = self->previous->ctxEntry;
+ ProfilerSubEntry *subentry = getSubEntry(pObj, caller, entry);
+ if (subentry) {
+ if (--subentry->recursionLevel == 0)
+ subentry->tt += tt;
+ else
+ ++subentry->recursivecallcount;
+ subentry->it += it;
+ ++subentry->callcount;
+ }
+ }
+}
+
+static void
+ptrace_enter_call(PyObject *self, void *key, PyObject *userObj)
+{
+ /* entering a call to the function identified by 'key'
+ (which can be a PyCodeObject or a PyMethodDef pointer) */
+ ProfilerObject *pObj = (ProfilerObject*)self;
+ ProfilerEntry *profEntry;
+ ProfilerContext *pContext;
+
+ /* In the case of entering a generator expression frame via a
+ * throw (gen_send_ex(.., 1)), we may already have an
+ * Exception set here. We must not mess around with this
+ * exception, and some of the code under here assumes that
+ * PyErr_* is its own to mess around with, so we have to
+ * save and restore any current exception. */
+ PyObject *exc = PyErr_GetRaisedException();
+
+ profEntry = getEntry(pObj, key);
+ if (profEntry == NULL) {
+ profEntry = newProfilerEntry(pObj, key, userObj);
+ if (profEntry == NULL)
+ goto restorePyerr;
+ }
+ /* grab a ProfilerContext out of the free list */
+ pContext = pObj->freelistProfilerContext;
+ if (pContext) {
+ pObj->freelistProfilerContext = pContext->previous;
+ }
+ else {
+ /* free list exhausted, allocate a new one */
+ pContext = (ProfilerContext*)
+ PyMem_Malloc(sizeof(ProfilerContext));
+ if (pContext == NULL) {
+ pObj->flags |= POF_NOMEMORY;
+ goto restorePyerr;
+ }
+ }
+ initContext(pObj, pContext, profEntry);
+
+restorePyerr:
+ PyErr_SetRaisedException(exc);
+}
+
+static void
+ptrace_leave_call(PyObject *self, void *key)
+{
+ /* leaving a call to the function identified by 'key' */
+ ProfilerObject *pObj = (ProfilerObject*)self;
+ ProfilerEntry *profEntry;
+ ProfilerContext *pContext;
+
+ pContext = pObj->currentProfilerContext;
+ if (pContext == NULL)
+ return;
+ profEntry = getEntry(pObj, key);
+ if (profEntry) {
+ Stop(pObj, pContext, profEntry);
+ }
+ else {
+ pObj->currentProfilerContext = pContext->previous;
+ }
+ /* put pContext into the free list */
+ pContext->previous = pObj->freelistProfilerContext;
+ pObj->freelistProfilerContext = pContext;
+}
+
+static int
+pending_exception(ProfilerObject *pObj)
+{
+ if (pObj->flags & POF_NOMEMORY) {
+ pObj->flags -= POF_NOMEMORY;
+ PyErr_SetString(PyExc_MemoryError,
+ "memory was exhausted while profiling");
+ return -1;
+ }
+ return 0;
+}
+
+/************************************************************/
+
+static PyStructSequence_Field profiler_entry_fields[] = {
+ {"code", "code object or built-in function name"},
+ {"callcount", "how many times this was called"},
+ {"reccallcount", "how many times called recursively"},
+ {"totaltime", "total time in this entry"},
+ {"inlinetime", "inline time in this entry (not in subcalls)"},
+ {"calls", "details of the calls"},
+ {0}
+};
+
+static PyStructSequence_Field profiler_subentry_fields[] = {
+ {"code", "called code object or built-in function name"},
+ {"callcount", "how many times this is called"},
+ {"reccallcount", "how many times this is called recursively"},
+ {"totaltime", "total time spent in this call"},
+ {"inlinetime", "inline time (not in further subcalls)"},
+ {0}
+};
+
+static PyStructSequence_Desc profiler_entry_desc = {
+ .name = "_lsprof.profiler_entry",
+ .fields = profiler_entry_fields,
+ .doc = NULL,
+ .n_in_sequence = 6
+};
+
+static PyStructSequence_Desc profiler_subentry_desc = {
+ .name = "_lsprof.profiler_subentry",
+ .fields = profiler_subentry_fields,
+ .doc = NULL,
+ .n_in_sequence = 5
+};
+
+typedef struct {
+ PyObject *list;
+ PyObject *sublist;
+ double factor;
+ _lsprof_state *state;
+} statscollector_t;
+
+static int statsForSubEntry(rotating_node_t *node, void *arg)
+{
+ ProfilerSubEntry *sentry = (ProfilerSubEntry*) node;
+ statscollector_t *collect = (statscollector_t*) arg;
+ ProfilerEntry *entry = (ProfilerEntry*) sentry->header.key;
+ int err;
+ PyObject *sinfo;
+ sinfo = PyObject_CallFunction((PyObject*) collect->state->stats_subentry_type,
+ "((Olldd))",
+ entry->userObj,
+ sentry->callcount,
+ sentry->recursivecallcount,
+ collect->factor * sentry->tt,
+ collect->factor * sentry->it);
+ if (sinfo == NULL)
+ return -1;
+ err = PyList_Append(collect->sublist, sinfo);
+ Py_DECREF(sinfo);
+ return err;
+}
+
+static int statsForEntry(rotating_node_t *node, void *arg)
+{
+ ProfilerEntry *entry = (ProfilerEntry*) node;
+ statscollector_t *collect = (statscollector_t*) arg;
+ PyObject *info;
+ int err;
+ if (entry->callcount == 0)
+ return 0; /* skip */
+
+ if (entry->calls != EMPTY_ROTATING_TREE) {
+ collect->sublist = PyList_New(0);
+ if (collect->sublist == NULL)
+ return -1;
+ if (RotatingTree_Enum(entry->calls,
+ statsForSubEntry, collect) != 0) {
+ Py_DECREF(collect->sublist);
+ return -1;
+ }
+ }
+ else {
+ collect->sublist = Py_NewRef(Py_None);
+ }
+
+ info = PyObject_CallFunction((PyObject*) collect->state->stats_entry_type,
+ "((OllddO))",
+ entry->userObj,
+ entry->callcount,
+ entry->recursivecallcount,
+ collect->factor * entry->tt,
+ collect->factor * entry->it,
+ collect->sublist);
+ Py_DECREF(collect->sublist);
+ if (info == NULL)
+ return -1;
+ err = PyList_Append(collect->list, info);
+ Py_DECREF(info);
+ return err;
+}
+
+/*[clinic input]
+_lsprof.Profiler.getstats
+
+ cls: defining_class
+
+list of profiler_entry objects.
+
+getstats() -> list of profiler_entry objects
+
+Return all information collected by the profiler.
+Each profiler_entry is a tuple-like object with the
+following attributes:
+
+ code code object
+ callcount how many times this was called
+ reccallcount how many times called recursively
+ totaltime total time in this entry
+ inlinetime inline time in this entry (not in subcalls)
+ calls details of the calls
+
+The calls attribute is either None or a list of
+profiler_subentry objects:
+
+ code called code object
+ callcount how many times this is called
+ reccallcount how many times this is called recursively
+ totaltime total time spent in this call
+ inlinetime inline time (not in further subcalls)
+[clinic start generated code]*/
+
+static PyObject *
+_lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=1806ef720019ee03 input=445e193ef4522902]*/
+{
+ statscollector_t collect;
+ collect.state = _PyType_GetModuleState(cls);
+ if (pending_exception(self)) {
+ return NULL;
+ }
+ if (!self->externalTimer || self->externalTimerUnit == 0.0) {
+ _PyTime_t onesec = _PyTime_FromSeconds(1);
+ collect.factor = (double)1 / onesec;
+ }
+ else {
+ collect.factor = self->externalTimerUnit;
+ }
+
+ collect.list = PyList_New(0);
+ if (collect.list == NULL)
+ return NULL;
+ if (RotatingTree_Enum(self->profilerEntries, statsForEntry, &collect)
+ != 0) {
+ Py_DECREF(collect.list);
+ return NULL;
+ }
+ return collect.list;
+}
+
+static int
+setSubcalls(ProfilerObject *pObj, int nvalue)
+{
+ if (nvalue == 0)
+ pObj->flags &= ~POF_SUBCALLS;
+ else if (nvalue > 0)
+ pObj->flags |= POF_SUBCALLS;
+ return 0;
+}
+
+static int
+setBuiltins(ProfilerObject *pObj, int nvalue)
+{
+ if (nvalue == 0)
+ pObj->flags &= ~POF_BUILTINS;
+ else if (nvalue > 0) {
+ pObj->flags |= POF_BUILTINS;
+ }
+ return 0;
+}
+
+PyObject* pystart_callback(ProfilerObject* self, PyObject *const *args, Py_ssize_t size)
+{
+ PyObject* code = args[0];
+ ptrace_enter_call((PyObject*)self, (void *)code, (PyObject *)code);
+
+ Py_RETURN_NONE;
+}
+
+PyObject* pyreturn_callback(ProfilerObject* self, PyObject *const *args, Py_ssize_t size)
+{
+ PyObject* code = args[0];
+ ptrace_leave_call((PyObject*)self, (void *)code);
+
+ Py_RETURN_NONE;
+}
+
+PyObject* get_cfunc_from_callable(PyObject* callable, PyObject* self_arg, PyObject* missing)
+{
+ // return a new reference
+ if (PyCFunction_Check(callable)) {
+ Py_INCREF(callable);
+ return (PyObject*)((PyCFunctionObject *)callable);
+ }
+ if (Py_TYPE(callable) == &PyMethodDescr_Type) {
+ /* For backwards compatibility need to
+ * convert to builtin method */
+
+ /* If no arg, skip */
+ if (self_arg == missing) {
+ return NULL;
+ }
+ PyObject *meth = Py_TYPE(callable)->tp_descr_get(
+ callable, self_arg, (PyObject*)Py_TYPE(self_arg));
+ if (meth == NULL) {
+ return NULL;
+ }
+ if (PyCFunction_Check(meth)) {
+ return (PyObject*)((PyCFunctionObject *)meth);
+ }
+ }
+ return NULL;
+}
+
+PyObject* ccall_callback(ProfilerObject* self, PyObject *const *args, Py_ssize_t size)
+{
+ if (self->flags & POF_BUILTINS) {
+ PyObject* callable = args[2];
+ PyObject* self_arg = args[3];
+
+ PyObject* cfunc = get_cfunc_from_callable(callable, self_arg, self->missing);
+
+ if (cfunc) {
+ ptrace_enter_call((PyObject*)self,
+ ((PyCFunctionObject *)cfunc)->m_ml,
+ cfunc);
+ Py_DECREF(cfunc);
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+PyObject* creturn_callback(ProfilerObject* self, PyObject *const *args, Py_ssize_t size)
+{
+ if (self->flags & POF_BUILTINS) {
+ PyObject* callable = args[2];
+ PyObject* self_arg = args[3];
+
+ PyObject* cfunc = get_cfunc_from_callable(callable, self_arg, self->missing);
+
+ if (cfunc) {
+ ptrace_leave_call((PyObject*)self,
+ ((PyCFunctionObject *)cfunc)->m_ml);
+ Py_DECREF(cfunc);
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+static const struct {
+ int event;
+ const char* callback_method;
+} callback_table[] = {
+ {PY_MONITORING_EVENT_PY_START, "_pystart_callback"},
+ {PY_MONITORING_EVENT_PY_RESUME, "_pystart_callback"},
+ {PY_MONITORING_EVENT_PY_THROW, "_pystart_callback"},
+ {PY_MONITORING_EVENT_PY_RETURN, "_pyreturn_callback"},
+ {PY_MONITORING_EVENT_PY_YIELD, "_pyreturn_callback"},
+ {PY_MONITORING_EVENT_PY_UNWIND, "_pyreturn_callback"},
+ {PY_MONITORING_EVENT_CALL, "_ccall_callback"},
+ {PY_MONITORING_EVENT_C_RETURN, "_creturn_callback"},
+ {PY_MONITORING_EVENT_C_RAISE, "_creturn_callback"},
+ {0, NULL}
+};
+
+PyDoc_STRVAR(enable_doc, "\
+enable(subcalls=True, builtins=True)\n\
+\n\
+Start collecting profiling information.\n\
+If 'subcalls' is True, also records for each function\n\
+statistics separated according to its current caller.\n\
+If 'builtins' is True, records the time spent in\n\
+built-in functions separately from their caller.\n\
+");
+
+static PyObject*
+profiler_enable(ProfilerObject *self, PyObject *args, PyObject *kwds)
+{
+ int subcalls = -1;
+ int builtins = -1;
+ static char *kwlist[] = {"subcalls", "builtins", 0};
+ int all_events = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|pp:enable",
+ kwlist, &subcalls, &builtins))
+ return NULL;
+ if (setSubcalls(self, subcalls) < 0 || setBuiltins(self, builtins) < 0) {
+ return NULL;
+ }
+
+ PyObject* monitoring = _PyImport_GetModuleAttrString("sys", "monitoring");
+ if (!monitoring) {
+ return NULL;
+ }
+
+ if (PyObject_CallMethod(monitoring, "use_tool_id", "is", self->tool_id, "cProfile") == NULL) {
+ PyErr_Format(PyExc_ValueError, "Another profiling tool is already active");
+ Py_DECREF(monitoring);
+ return NULL;
+ }
+
+ for (int i = 0; callback_table[i].callback_method; i++) {
+ PyObject* callback = PyObject_GetAttrString((PyObject*)self, callback_table[i].callback_method);
+ if (!callback) {
+ Py_DECREF(monitoring);
+ return NULL;
+ }
+ Py_XDECREF(PyObject_CallMethod(monitoring, "register_callback", "iiO", self->tool_id,
+ (1 << callback_table[i].event),
+ callback));
+ Py_DECREF(callback);
+ all_events |= (1 << callback_table[i].event);
+ }
+
+ if (!PyObject_CallMethod(monitoring, "set_events", "ii", self->tool_id, all_events)) {
+ Py_DECREF(monitoring);
+ return NULL;
+ }
+
+ Py_DECREF(monitoring);
+
+ self->flags |= POF_ENABLED;
+ Py_RETURN_NONE;
+}
+
+static void
+flush_unmatched(ProfilerObject *pObj)
+{
+ while (pObj->currentProfilerContext) {
+ ProfilerContext *pContext = pObj->currentProfilerContext;
+ ProfilerEntry *profEntry= pContext->ctxEntry;
+ if (profEntry)
+ Stop(pObj, pContext, profEntry);
+ else
+ pObj->currentProfilerContext = pContext->previous;
+ if (pContext)
+ PyMem_Free(pContext);
+ }
+
+}
+
+PyDoc_STRVAR(disable_doc, "\
+disable()\n\
+\n\
+Stop collecting profiling information.\n\
+");
+
+static PyObject*
+profiler_disable(ProfilerObject *self, PyObject* noarg)
+{
+ if (self->flags & POF_ENABLED) {
+ PyObject* result = NULL;
+ PyObject* monitoring = _PyImport_GetModuleAttrString("sys", "monitoring");
+
+ if (!monitoring) {
+ return NULL;
+ }
+
+ for (int i = 0; callback_table[i].callback_method; i++) {
+ result = PyObject_CallMethod(monitoring, "register_callback", "iiO", self->tool_id,
+ (1 << callback_table[i].event), Py_None);
+ if (!result) {
+ Py_DECREF(monitoring);
+ return NULL;
+ }
+ Py_DECREF(result);
+ }
+
+ result = PyObject_CallMethod(monitoring, "set_events", "ii", self->tool_id, 0);
+ if (!result) {
+ Py_DECREF(monitoring);
+ return NULL;
+ }
+ Py_DECREF(result);
+
+ result = PyObject_CallMethod(monitoring, "free_tool_id", "i", self->tool_id);
+ if (!result) {
+ Py_DECREF(monitoring);
+ return NULL;
+ }
+ Py_DECREF(result);
+
+ Py_DECREF(monitoring);
+
+ self->flags &= ~POF_ENABLED;
+ flush_unmatched(self);
+ }
+
+ if (pending_exception(self)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(clear_doc, "\
+clear()\n\
+\n\
+Clear all profiling information collected so far.\n\
+");
+
+static PyObject*
+profiler_clear(ProfilerObject *pObj, PyObject* noarg)
+{
+ clearEntries(pObj);
+ Py_RETURN_NONE;
+}
+
+static int
+profiler_traverse(ProfilerObject *op, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(op));
+ return 0;
+}
+
+static void
+profiler_dealloc(ProfilerObject *op)
+{
+ PyObject_GC_UnTrack(op);
+ if (op->flags & POF_ENABLED) {
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (_PyEval_SetProfile(tstate, NULL, NULL) < 0) {
+ _PyErr_WriteUnraisableMsg("When destroying _lsprof profiler", NULL);
+ }
+ }
+
+ flush_unmatched(op);
+ clearEntries(op);
+ Py_XDECREF(op->externalTimer);
+ PyTypeObject *tp = Py_TYPE(op);
+ tp->tp_free(op);
+ Py_DECREF(tp);
+}
+
+static int
+profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
+{
+ PyObject *timer = NULL;
+ double timeunit = 0.0;
+ int subcalls = 1;
+ int builtins = 1;
+ static char *kwlist[] = {"timer", "timeunit",
+ "subcalls", "builtins", 0};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "|Odpp:Profiler", kwlist,
+ &timer, &timeunit,
+ &subcalls, &builtins))
+ return -1;
+
+ if (setSubcalls(pObj, subcalls) < 0 || setBuiltins(pObj, builtins) < 0)
+ return -1;
+ pObj->externalTimerUnit = timeunit;
+ Py_XSETREF(pObj->externalTimer, Py_XNewRef(timer));
+ pObj->tool_id = PY_MONITORING_PROFILER_ID;
+
+ PyObject* monitoring = _PyImport_GetModuleAttrString("sys", "monitoring");
+ if (!monitoring) {
+ return -1;
+ }
+ pObj->missing = PyObject_GetAttrString(monitoring, "MISSING");
+ if (!pObj->missing) {
+ Py_DECREF(monitoring);
+ return -1;
+ }
+ Py_DECREF(monitoring);
+ return 0;
+}
+
+static PyMethodDef profiler_methods[] = {
+ _LSPROF_PROFILER_GETSTATS_METHODDEF
+ {"enable", _PyCFunction_CAST(profiler_enable),
+ METH_VARARGS | METH_KEYWORDS, enable_doc},
+ {"disable", (PyCFunction)profiler_disable,
+ METH_NOARGS, disable_doc},
+ {"clear", (PyCFunction)profiler_clear,
+ METH_NOARGS, clear_doc},
+ {"_pystart_callback", _PyCFunction_CAST(pystart_callback),
+ METH_FASTCALL, NULL},
+ {"_pyreturn_callback", _PyCFunction_CAST(pyreturn_callback),
+ METH_FASTCALL, NULL},
+ {"_ccall_callback", _PyCFunction_CAST(ccall_callback),
+ METH_FASTCALL, NULL},
+ {"_creturn_callback", _PyCFunction_CAST(creturn_callback),
+ METH_FASTCALL, NULL},
+ {NULL, NULL}
+};
+
+PyDoc_STRVAR(profiler_doc, "\
+Profiler(timer=None, timeunit=None, subcalls=True, builtins=True)\n\
+\n\
+ Builds a profiler object using the specified timer function.\n\
+ The default timer is a fast built-in one based on real time.\n\
+ For custom timer functions returning integers, timeunit can\n\
+ be a float specifying a scale (i.e. how long each integer unit\n\
+ is, in seconds).\n\
+");
+
+static PyType_Slot _lsprof_profiler_type_spec_slots[] = {
+ {Py_tp_doc, (void *)profiler_doc},
+ {Py_tp_methods, profiler_methods},
+ {Py_tp_dealloc, profiler_dealloc},
+ {Py_tp_init, profiler_init},
+ {Py_tp_traverse, profiler_traverse},
+ {0, 0}
+};
+
+static PyType_Spec _lsprof_profiler_type_spec = {
+ .name = "_lsprof.Profiler",
+ .basicsize = sizeof(ProfilerObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = _lsprof_profiler_type_spec_slots,
+};
+
+static PyMethodDef moduleMethods[] = {
+ {NULL, NULL}
+};
+
+static int
+_lsprof_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _lsprof_state *state = _lsprof_get_state(module);
+ Py_VISIT(state->profiler_type);
+ Py_VISIT(state->stats_entry_type);
+ Py_VISIT(state->stats_subentry_type);
+ return 0;
+}
+
+static int
+_lsprof_clear(PyObject *module)
+{
+ _lsprof_state *state = _lsprof_get_state(module);
+ Py_CLEAR(state->profiler_type);
+ Py_CLEAR(state->stats_entry_type);
+ Py_CLEAR(state->stats_subentry_type);
+ return 0;
+}
+
+static void
+_lsprof_free(void *module)
+{
+ _lsprof_clear((PyObject *)module);
+}
+
+static int
+_lsprof_exec(PyObject *module)
+{
+ _lsprof_state *state = PyModule_GetState(module);
+
+ state->profiler_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &_lsprof_profiler_type_spec, NULL);
+ if (state->profiler_type == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(module, state->profiler_type) < 0) {
+ return -1;
+ }
+
+ state->stats_entry_type = PyStructSequence_NewType(&profiler_entry_desc);
+ if (state->stats_entry_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->stats_entry_type) < 0) {
+ return -1;
+ }
+
+ state->stats_subentry_type = PyStructSequence_NewType(&profiler_subentry_desc);
+ if (state->stats_subentry_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->stats_subentry_type) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot _lsprofslots[] = {
+ {Py_mod_exec, _lsprof_exec},
+ // XXX gh-103092: fix isolation.
+ {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
+ //{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _lsprofmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_lsprof",
+ .m_doc = "Fast profiler",
+ .m_size = sizeof(_lsprof_state),
+ .m_methods = moduleMethods,
+ .m_slots = _lsprofslots,
+ .m_traverse = _lsprof_traverse,
+ .m_clear = _lsprof_clear,
+ .m_free = _lsprof_free
+};
+
+PyMODINIT_FUNC
+PyInit__lsprof(void)
+{
+ return PyModuleDef_Init(&_lsprofmodule);
+}
diff --git a/contrib/tools/python3/Modules/_lzmamodule.c b/contrib/tools/python3/Modules/_lzmamodule.c
new file mode 100644
index 00000000000..7bbd6569aa2
--- /dev/null
+++ b/contrib/tools/python3/Modules/_lzmamodule.c
@@ -0,0 +1,1663 @@
+/* _lzma - Low-level Python interface to liblzma.
+
+ Initial implementation by Per Øyvind Karlsen.
+ Rewritten by Nadeem Vawda.
+
+*/
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+
+#include <stdlib.h> // free()
+#include <string.h>
+
+#include <lzma.h>
+
+// Blocks output buffer wrappers
+#include "pycore_blocks_output_buffer.h"
+
+#if OUTPUT_BUFFER_MAX_BLOCK_SIZE > SIZE_MAX
+ #error "The maximum block size accepted by liblzma is SIZE_MAX."
+#endif
+
+/* On success, return value >= 0
+ On failure, return -1 */
+static inline Py_ssize_t
+OutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, Py_ssize_t max_length,
+ uint8_t **next_out, size_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ allocated = _BlocksOutputBuffer_InitAndGrow(
+ buffer, max_length, (void**) next_out);
+ *avail_out = (size_t) allocated;
+ return allocated;
+}
+
+/* On success, return value >= 0
+ On failure, return -1 */
+static inline Py_ssize_t
+OutputBuffer_Grow(_BlocksOutputBuffer *buffer,
+ uint8_t **next_out, size_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ allocated = _BlocksOutputBuffer_Grow(
+ buffer, (void**) next_out, (Py_ssize_t) *avail_out);
+ *avail_out = (size_t) allocated;
+ return allocated;
+}
+
+static inline Py_ssize_t
+OutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, size_t avail_out)
+{
+ return _BlocksOutputBuffer_GetDataSize(buffer, (Py_ssize_t) avail_out);
+}
+
+static inline PyObject *
+OutputBuffer_Finish(_BlocksOutputBuffer *buffer, size_t avail_out)
+{
+ return _BlocksOutputBuffer_Finish(buffer, (Py_ssize_t) avail_out);
+}
+
+static inline void
+OutputBuffer_OnError(_BlocksOutputBuffer *buffer)
+{
+ _BlocksOutputBuffer_OnError(buffer);
+}
+
+
+#define ACQUIRE_LOCK(obj) do { \
+ if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+ Py_BEGIN_ALLOW_THREADS \
+ PyThread_acquire_lock((obj)->lock, 1); \
+ Py_END_ALLOW_THREADS \
+ } } while (0)
+#define RELEASE_LOCK(obj) PyThread_release_lock((obj)->lock)
+
+typedef struct {
+ PyTypeObject *lzma_compressor_type;
+ PyTypeObject *lzma_decompressor_type;
+ PyObject *error;
+ PyObject *empty_tuple;
+} _lzma_state;
+
+static inline _lzma_state*
+get_lzma_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_lzma_state *)state;
+}
+
+/* Container formats: */
+enum {
+ FORMAT_AUTO,
+ FORMAT_XZ,
+ FORMAT_ALONE,
+ FORMAT_RAW,
+};
+
+#define LZMA_CHECK_UNKNOWN (LZMA_CHECK_ID_MAX + 1)
+
+
+typedef struct {
+ PyObject_HEAD
+ lzma_allocator alloc;
+ lzma_stream lzs;
+ int flushed;
+ PyThread_type_lock lock;
+} Compressor;
+
+typedef struct {
+ PyObject_HEAD
+ lzma_allocator alloc;
+ lzma_stream lzs;
+ int check;
+ char eof;
+ PyObject *unused_data;
+ char needs_input;
+ uint8_t *input_buffer;
+ size_t input_buffer_size;
+ PyThread_type_lock lock;
+} Decompressor;
+
+/* Helper functions. */
+
+static int
+catch_lzma_error(_lzma_state *state, lzma_ret lzret)
+{
+ switch (lzret) {
+ case LZMA_OK:
+ case LZMA_GET_CHECK:
+ case LZMA_NO_CHECK:
+ case LZMA_STREAM_END:
+ return 0;
+ case LZMA_UNSUPPORTED_CHECK:
+ PyErr_SetString(state->error, "Unsupported integrity check");
+ return 1;
+ case LZMA_MEM_ERROR:
+ PyErr_NoMemory();
+ return 1;
+ case LZMA_MEMLIMIT_ERROR:
+ PyErr_SetString(state->error, "Memory usage limit exceeded");
+ return 1;
+ case LZMA_FORMAT_ERROR:
+ PyErr_SetString(state->error, "Input format not supported by decoder");
+ return 1;
+ case LZMA_OPTIONS_ERROR:
+ PyErr_SetString(state->error, "Invalid or unsupported options");
+ return 1;
+ case LZMA_DATA_ERROR:
+ PyErr_SetString(state->error, "Corrupt input data");
+ return 1;
+ case LZMA_BUF_ERROR:
+ PyErr_SetString(state->error, "Insufficient buffer space");
+ return 1;
+ case LZMA_PROG_ERROR:
+ PyErr_SetString(state->error, "Internal error");
+ return 1;
+ default:
+ PyErr_Format(state->error, "Unrecognized error from liblzma: %d", lzret);
+ return 1;
+ }
+}
+
+static void*
+PyLzma_Malloc(void *opaque, size_t items, size_t size)
+{
+ if (size != 0 && items > (size_t)PY_SSIZE_T_MAX / size) {
+ return NULL;
+ }
+ /* PyMem_Malloc() cannot be used:
+ the GIL is not held when lzma_code() is called */
+ return PyMem_RawMalloc(items * size);
+}
+
+static void
+PyLzma_Free(void *opaque, void *ptr)
+{
+ PyMem_RawFree(ptr);
+}
+
+
+/* Some custom type conversions for PyArg_ParseTupleAndKeywords(),
+ since the predefined conversion specifiers do not suit our needs:
+
+ uint32_t - the "I" (unsigned int) specifier is the right size, but
+ silently ignores overflows on conversion.
+
+ lzma_vli - the "K" (unsigned long long) specifier is the right
+ size, but like "I" it silently ignores overflows on conversion.
+
+ lzma_mode and lzma_match_finder - these are enumeration types, and
+ so the size of each is implementation-defined. Worse, different
+ enum types can be of different sizes within the same program, so
+ to be strictly correct, we need to define two separate converters.
+ */
+
+#define INT_TYPE_CONVERTER_FUNC(TYPE, FUNCNAME) \
+ static int \
+ FUNCNAME(PyObject *obj, void *ptr) \
+ { \
+ unsigned long long val; \
+ \
+ val = PyLong_AsUnsignedLongLong(obj); \
+ if (PyErr_Occurred()) \
+ return 0; \
+ if ((unsigned long long)(TYPE)val != val) { \
+ PyErr_SetString(PyExc_OverflowError, \
+ "Value too large for " #TYPE " type"); \
+ return 0; \
+ } \
+ *(TYPE *)ptr = (TYPE)val; \
+ return 1; \
+ }
+
+INT_TYPE_CONVERTER_FUNC(uint32_t, uint32_converter)
+INT_TYPE_CONVERTER_FUNC(lzma_vli, lzma_vli_converter)
+INT_TYPE_CONVERTER_FUNC(lzma_mode, lzma_mode_converter)
+INT_TYPE_CONVERTER_FUNC(lzma_match_finder, lzma_mf_converter)
+
+#undef INT_TYPE_CONVERTER_FUNC
+
+
+/* Filter specifier parsing.
+
+ This code handles converting filter specifiers (Python dicts) into
+ the C lzma_filter structs expected by liblzma. */
+
+static void *
+parse_filter_spec_lzma(_lzma_state *state, PyObject *spec)
+{
+ static char *optnames[] = {"id", "preset", "dict_size", "lc", "lp",
+ "pb", "mode", "nice_len", "mf", "depth", NULL};
+ PyObject *id;
+ PyObject *preset_obj;
+ uint32_t preset = LZMA_PRESET_DEFAULT;
+ lzma_options_lzma *options;
+
+ /* First, fill in default values for all the options using a preset.
+ Then, override the defaults with any values given by the caller. */
+
+ preset_obj = PyMapping_GetItemString(spec, "preset");
+ if (preset_obj == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError)) {
+ PyErr_Clear();
+ }
+ else {
+ return NULL;
+ }
+ } else {
+ int ok = uint32_converter(preset_obj, &preset);
+ Py_DECREF(preset_obj);
+ if (!ok) {
+ return NULL;
+ }
+ }
+
+ options = (lzma_options_lzma *)PyMem_Calloc(1, sizeof *options);
+ if (options == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ if (lzma_lzma_preset(options, preset)) {
+ PyMem_Free(options);
+ PyErr_Format(state->error, "Invalid compression preset: %u", preset);
+ return NULL;
+ }
+
+ if (!PyArg_ParseTupleAndKeywords(state->empty_tuple, spec,
+ "|OOO&O&O&O&O&O&O&O&", optnames,
+ &id, &preset_obj,
+ uint32_converter, &options->dict_size,
+ uint32_converter, &options->lc,
+ uint32_converter, &options->lp,
+ uint32_converter, &options->pb,
+ lzma_mode_converter, &options->mode,
+ uint32_converter, &options->nice_len,
+ lzma_mf_converter, &options->mf,
+ uint32_converter, &options->depth)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid filter specifier for LZMA filter");
+ PyMem_Free(options);
+ return NULL;
+ }
+
+ return options;
+}
+
+static void *
+parse_filter_spec_delta(_lzma_state *state, PyObject *spec)
+{
+ static char *optnames[] = {"id", "dist", NULL};
+ PyObject *id;
+ uint32_t dist = 1;
+ lzma_options_delta *options;
+
+ if (!PyArg_ParseTupleAndKeywords(state->empty_tuple, spec, "|OO&", optnames,
+ &id, uint32_converter, &dist)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid filter specifier for delta filter");
+ return NULL;
+ }
+
+ options = (lzma_options_delta *)PyMem_Calloc(1, sizeof *options);
+ if (options == NULL) {
+ return PyErr_NoMemory();
+ }
+ options->type = LZMA_DELTA_TYPE_BYTE;
+ options->dist = dist;
+ return options;
+}
+
+static void *
+parse_filter_spec_bcj(_lzma_state *state, PyObject *spec)
+{
+ static char *optnames[] = {"id", "start_offset", NULL};
+ PyObject *id;
+ uint32_t start_offset = 0;
+ lzma_options_bcj *options;
+
+ if (!PyArg_ParseTupleAndKeywords(state->empty_tuple, spec, "|OO&", optnames,
+ &id, uint32_converter, &start_offset)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid filter specifier for BCJ filter");
+ return NULL;
+ }
+
+ options = (lzma_options_bcj *)PyMem_Calloc(1, sizeof *options);
+ if (options == NULL) {
+ return PyErr_NoMemory();
+ }
+ options->start_offset = start_offset;
+ return options;
+}
+
+static int
+lzma_filter_converter(_lzma_state *state, PyObject *spec, void *ptr)
+{
+ lzma_filter *f = (lzma_filter *)ptr;
+ PyObject *id_obj;
+
+ if (!PyMapping_Check(spec)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Filter specifier must be a dict or dict-like object");
+ return 0;
+ }
+ id_obj = PyMapping_GetItemString(spec, "id");
+ if (id_obj == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError))
+ PyErr_SetString(PyExc_ValueError,
+ "Filter specifier must have an \"id\" entry");
+ return 0;
+ }
+ f->id = PyLong_AsUnsignedLongLong(id_obj);
+ Py_DECREF(id_obj);
+ if (PyErr_Occurred()) {
+ return 0;
+ }
+
+ switch (f->id) {
+ case LZMA_FILTER_LZMA1:
+ case LZMA_FILTER_LZMA2:
+ f->options = parse_filter_spec_lzma(state, spec);
+ return f->options != NULL;
+ case LZMA_FILTER_DELTA:
+ f->options = parse_filter_spec_delta(state, spec);
+ return f->options != NULL;
+ case LZMA_FILTER_X86:
+ case LZMA_FILTER_POWERPC:
+ case LZMA_FILTER_IA64:
+ case LZMA_FILTER_ARM:
+ case LZMA_FILTER_ARMTHUMB:
+ case LZMA_FILTER_SPARC:
+ f->options = parse_filter_spec_bcj(state, spec);
+ return f->options != NULL;
+ default:
+ PyErr_Format(PyExc_ValueError, "Invalid filter ID: %llu", f->id);
+ return 0;
+ }
+}
+
+static void
+free_filter_chain(lzma_filter filters[])
+{
+ for (int i = 0; filters[i].id != LZMA_VLI_UNKNOWN; i++) {
+ PyMem_Free(filters[i].options);
+ }
+}
+
+static int
+parse_filter_chain_spec(_lzma_state *state, lzma_filter filters[], PyObject *filterspecs)
+{
+ Py_ssize_t i, num_filters;
+
+ num_filters = PySequence_Length(filterspecs);
+ if (num_filters == -1) {
+ return -1;
+ }
+ if (num_filters > LZMA_FILTERS_MAX) {
+ PyErr_Format(PyExc_ValueError,
+ "Too many filters - liblzma supports a maximum of %d",
+ LZMA_FILTERS_MAX);
+ return -1;
+ }
+
+ for (i = 0; i < num_filters; i++) {
+ int ok = 1;
+ PyObject *spec = PySequence_GetItem(filterspecs, i);
+ if (spec == NULL || !lzma_filter_converter(state, spec, &filters[i])) {
+ ok = 0;
+ }
+ Py_XDECREF(spec);
+ if (!ok) {
+ filters[i].id = LZMA_VLI_UNKNOWN;
+ free_filter_chain(filters);
+ return -1;
+ }
+ }
+ filters[num_filters].id = LZMA_VLI_UNKNOWN;
+ return 0;
+}
+
+
+/* Filter specifier construction.
+
+ This code handles converting C lzma_filter structs into
+ Python-level filter specifiers (represented as dicts). */
+
+static int
+spec_add_field(PyObject *spec, const char *key, unsigned long long value)
+{
+ PyObject *value_object = PyLong_FromUnsignedLongLong(value);
+ if (value_object == NULL) {
+ return -1;
+ }
+ PyObject *key_object = PyUnicode_InternFromString(key);
+ if (key_object == NULL) {
+ Py_DECREF(value_object);
+ return -1;
+ }
+ int status = PyDict_SetItem(spec, key_object, value_object);
+ Py_DECREF(key_object);
+ Py_DECREF(value_object);
+ return status;
+}
+
+static PyObject *
+build_filter_spec(const lzma_filter *f)
+{
+ PyObject *spec;
+
+ spec = PyDict_New();
+ if (spec == NULL) {
+ return NULL;
+ }
+
+#define ADD_FIELD(SOURCE, FIELD) \
+ do { \
+ if (spec_add_field(spec, #FIELD, SOURCE->FIELD) == -1) \
+ goto error;\
+ } while (0)
+
+ ADD_FIELD(f, id);
+
+ switch (f->id) {
+ /* For LZMA1 filters, lzma_properties_{encode,decode}() only look at the
+ lc, lp, pb, and dict_size fields. For LZMA2 filters, only the
+ dict_size field is used. */
+ case LZMA_FILTER_LZMA1: {
+ lzma_options_lzma *options = f->options;
+ ADD_FIELD(options, lc);
+ ADD_FIELD(options, lp);
+ ADD_FIELD(options, pb);
+ ADD_FIELD(options, dict_size);
+ break;
+ }
+ case LZMA_FILTER_LZMA2: {
+ lzma_options_lzma *options = f->options;
+ ADD_FIELD(options, dict_size);
+ break;
+ }
+ case LZMA_FILTER_DELTA: {
+ lzma_options_delta *options = f->options;
+ ADD_FIELD(options, dist);
+ break;
+ }
+ case LZMA_FILTER_X86:
+ case LZMA_FILTER_POWERPC:
+ case LZMA_FILTER_IA64:
+ case LZMA_FILTER_ARM:
+ case LZMA_FILTER_ARMTHUMB:
+ case LZMA_FILTER_SPARC: {
+ lzma_options_bcj *options = f->options;
+ if (options) {
+ ADD_FIELD(options, start_offset);
+ }
+ break;
+ }
+ default:
+ PyErr_Format(PyExc_ValueError, "Invalid filter ID: %llu", f->id);
+ goto error;
+ }
+
+#undef ADD_FIELD
+
+ return spec;
+
+error:
+ Py_DECREF(spec);
+ return NULL;
+}
+
+
+/*[clinic input]
+module _lzma
+class _lzma.LZMACompressor "Compressor *" "&Compressor_type"
+class _lzma.LZMADecompressor "Decompressor *" "&Decompressor_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2c14bbe05ff0c147]*/
+
+#include "clinic/_lzmamodule.c.h"
+
+/*[python input]
+
+class lzma_vli_converter(CConverter):
+ type = 'lzma_vli'
+ converter = 'lzma_vli_converter'
+
+class lzma_filter_converter(CConverter):
+ type = 'lzma_filter'
+ converter = 'lzma_filter_converter'
+ c_default = c_ignored_default = "{LZMA_VLI_UNKNOWN, NULL}"
+
+ def cleanup(self):
+ name = ensure_legal_c_identifier(self.name)
+ return ('if (%(name)s.id != LZMA_VLI_UNKNOWN)\n'
+ ' PyMem_Free(%(name)s.options);\n') % {'name': name}
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=74fe7631ce377a94]*/
+
+
+/* LZMACompressor class. */
+
+static PyObject *
+compress(Compressor *c, uint8_t *data, size_t len, lzma_action action)
+{
+ PyObject *result;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+ _lzma_state *state = PyType_GetModuleState(Py_TYPE(c));
+ assert(state != NULL);
+
+ if (OutputBuffer_InitAndGrow(&buffer, -1, &c->lzs.next_out, &c->lzs.avail_out) < 0) {
+ goto error;
+ }
+ c->lzs.next_in = data;
+ c->lzs.avail_in = len;
+
+ for (;;) {
+ lzma_ret lzret;
+
+ Py_BEGIN_ALLOW_THREADS
+ lzret = lzma_code(&c->lzs, action);
+ Py_END_ALLOW_THREADS
+
+ if (lzret == LZMA_BUF_ERROR && len == 0 && c->lzs.avail_out > 0) {
+ lzret = LZMA_OK; /* That wasn't a real error */
+ }
+ if (catch_lzma_error(state, lzret)) {
+ goto error;
+ }
+ if ((action == LZMA_RUN && c->lzs.avail_in == 0) ||
+ (action == LZMA_FINISH && lzret == LZMA_STREAM_END)) {
+ break;
+ } else if (c->lzs.avail_out == 0) {
+ if (OutputBuffer_Grow(&buffer, &c->lzs.next_out, &c->lzs.avail_out) < 0) {
+ goto error;
+ }
+ }
+ }
+
+ result = OutputBuffer_Finish(&buffer, c->lzs.avail_out);
+ if (result != NULL) {
+ return result;
+ }
+
+error:
+ OutputBuffer_OnError(&buffer);
+ return NULL;
+}
+
+/*[clinic input]
+_lzma.LZMACompressor.compress
+
+ data: Py_buffer
+ /
+
+Provide data to the compressor object.
+
+Returns a chunk of compressed data if possible, or b'' otherwise.
+
+When you have finished providing data to the compressor, call the
+flush() method to finish the compression process.
+[clinic start generated code]*/
+
+static PyObject *
+_lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data)
+/*[clinic end generated code: output=31f615136963e00f input=64019eac7f2cc8d0]*/
+{
+ PyObject *result = NULL;
+
+ ACQUIRE_LOCK(self);
+ if (self->flushed) {
+ PyErr_SetString(PyExc_ValueError, "Compressor has been flushed");
+ }
+ else {
+ result = compress(self, data->buf, data->len, LZMA_RUN);
+ }
+ RELEASE_LOCK(self);
+ return result;
+}
+
+/*[clinic input]
+_lzma.LZMACompressor.flush
+
+Finish the compression process.
+
+Returns the compressed data left in internal buffers.
+
+The compressor object may not be used after this method is called.
+[clinic start generated code]*/
+
+static PyObject *
+_lzma_LZMACompressor_flush_impl(Compressor *self)
+/*[clinic end generated code: output=fec21f3e22504f50 input=6b369303f67ad0a8]*/
+{
+ PyObject *result = NULL;
+
+ ACQUIRE_LOCK(self);
+ if (self->flushed) {
+ PyErr_SetString(PyExc_ValueError, "Repeated call to flush()");
+ } else {
+ self->flushed = 1;
+ result = compress(self, NULL, 0, LZMA_FINISH);
+ }
+ RELEASE_LOCK(self);
+ return result;
+}
+
+static int
+Compressor_init_xz(_lzma_state *state, lzma_stream *lzs,
+ int check, uint32_t preset, PyObject *filterspecs)
+{
+ lzma_ret lzret;
+
+ if (filterspecs == Py_None) {
+ lzret = lzma_easy_encoder(lzs, preset, check);
+ } else {
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+
+ if (parse_filter_chain_spec(state, filters, filterspecs) == -1)
+ return -1;
+ lzret = lzma_stream_encoder(lzs, filters, check);
+ free_filter_chain(filters);
+ }
+ if (catch_lzma_error(state, lzret)) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+static int
+Compressor_init_alone(_lzma_state *state, lzma_stream *lzs, uint32_t preset, PyObject *filterspecs)
+{
+ lzma_ret lzret;
+
+ if (filterspecs == Py_None) {
+ lzma_options_lzma options;
+
+ if (lzma_lzma_preset(&options, preset)) {
+ PyErr_Format(state->error, "Invalid compression preset: %u", preset);
+ return -1;
+ }
+ lzret = lzma_alone_encoder(lzs, &options);
+ } else {
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+
+ if (parse_filter_chain_spec(state, filters, filterspecs) == -1)
+ return -1;
+ if (filters[0].id == LZMA_FILTER_LZMA1 &&
+ filters[1].id == LZMA_VLI_UNKNOWN) {
+ lzret = lzma_alone_encoder(lzs, filters[0].options);
+ } else {
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid filter chain for FORMAT_ALONE - "
+ "must be a single LZMA1 filter");
+ lzret = LZMA_PROG_ERROR;
+ }
+ free_filter_chain(filters);
+ }
+ if (PyErr_Occurred() || catch_lzma_error(state, lzret)) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+static int
+Compressor_init_raw(_lzma_state *state, lzma_stream *lzs, PyObject *filterspecs)
+{
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+ lzma_ret lzret;
+
+ if (filterspecs == Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "Must specify filters for FORMAT_RAW");
+ return -1;
+ }
+ if (parse_filter_chain_spec(state, filters, filterspecs) == -1) {
+ return -1;
+ }
+ lzret = lzma_raw_encoder(lzs, filters);
+ free_filter_chain(filters);
+ if (catch_lzma_error(state, lzret)) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+/*[-clinic input]
+@classmethod
+_lzma.LZMACompressor.__new__
+
+ format: int(c_default="FORMAT_XZ") = FORMAT_XZ
+ The container format to use for the output. This can
+ be FORMAT_XZ (default), FORMAT_ALONE, or FORMAT_RAW.
+
+ check: int(c_default="-1") = unspecified
+ The integrity check to use. For FORMAT_XZ, the default
+ is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not support integrity
+ checks; for these formats, check must be omitted, or be CHECK_NONE.
+
+ preset: object = None
+ If provided should be an integer in the range 0-9, optionally
+ OR-ed with the constant PRESET_EXTREME.
+
+ filters: object = None
+ If provided should be a sequence of dicts. Each dict should
+ have an entry for "id" indicating the ID of the filter, plus
+ additional entries for options to the filter.
+
+Create a compressor object for compressing data incrementally.
+
+The settings used by the compressor can be specified either as a
+preset compression level (with the 'preset' argument), or in detail
+as a custom filter chain (with the 'filters' argument). For FORMAT_XZ
+and FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
+level. For FORMAT_RAW, the caller must always specify a filter chain;
+the raw compressor does not support preset compression levels.
+
+For one-shot compression, use the compress() function instead.
+[-clinic start generated code]*/
+static PyObject *
+Compressor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ static char *arg_names[] = {"format", "check", "preset", "filters", NULL};
+ int format = FORMAT_XZ;
+ int check = -1;
+ uint32_t preset = LZMA_PRESET_DEFAULT;
+ PyObject *preset_obj = Py_None;
+ PyObject *filterspecs = Py_None;
+ Compressor *self;
+
+ _lzma_state *state = PyType_GetModuleState(type);
+ assert(state != NULL);
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "|iiOO:LZMACompressor", arg_names,
+ &format, &check, &preset_obj,
+ &filterspecs)) {
+ return NULL;
+ }
+
+ if (format != FORMAT_XZ && check != -1 && check != LZMA_CHECK_NONE) {
+ PyErr_SetString(PyExc_ValueError,
+ "Integrity checks are only supported by FORMAT_XZ");
+ return NULL;
+ }
+
+ if (preset_obj != Py_None && filterspecs != Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot specify both preset and filter chain");
+ return NULL;
+ }
+
+ if (preset_obj != Py_None && !uint32_converter(preset_obj, &preset)) {
+ return NULL;
+ }
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (Compressor *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->alloc.opaque = NULL;
+ self->alloc.alloc = PyLzma_Malloc;
+ self->alloc.free = PyLzma_Free;
+ self->lzs.allocator = &self->alloc;
+
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
+
+ self->flushed = 0;
+ switch (format) {
+ case FORMAT_XZ:
+ if (check == -1) {
+ check = LZMA_CHECK_CRC64;
+ }
+ if (Compressor_init_xz(state, &self->lzs, check, preset, filterspecs) != 0) {
+ goto error;
+ }
+ break;
+
+ case FORMAT_ALONE:
+ if (Compressor_init_alone(state, &self->lzs, preset, filterspecs) != 0) {
+ goto error;
+ }
+ break;
+
+ case FORMAT_RAW:
+ if (Compressor_init_raw(state, &self->lzs, filterspecs) != 0) {
+ goto error;
+ }
+ break;
+
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "Invalid container format: %d", format);
+ goto error;
+ }
+
+ return (PyObject *)self;
+
+error:
+ Py_DECREF(self);
+ return NULL;
+}
+
+static void
+Compressor_dealloc(Compressor *self)
+{
+ lzma_end(&self->lzs);
+ if (self->lock != NULL) {
+ PyThread_free_lock(self->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyMethodDef Compressor_methods[] = {
+ _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF
+ _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF
+ {NULL}
+};
+
+static int
+Compressor_traverse(Compressor *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+PyDoc_STRVAR(Compressor_doc,
+"LZMACompressor(format=FORMAT_XZ, check=-1, preset=None, filters=None)\n"
+"\n"
+"Create a compressor object for compressing data incrementally.\n"
+"\n"
+"format specifies the container format to use for the output. This can\n"
+"be FORMAT_XZ (default), FORMAT_ALONE, or FORMAT_RAW.\n"
+"\n"
+"check specifies the integrity check to use. For FORMAT_XZ, the default\n"
+"is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not support integrity\n"
+"checks; for these formats, check must be omitted, or be CHECK_NONE.\n"
+"\n"
+"The settings used by the compressor can be specified either as a\n"
+"preset compression level (with the 'preset' argument), or in detail\n"
+"as a custom filter chain (with the 'filters' argument). For FORMAT_XZ\n"
+"and FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset\n"
+"level. For FORMAT_RAW, the caller must always specify a filter chain;\n"
+"the raw compressor does not support preset compression levels.\n"
+"\n"
+"preset (if provided) should be an integer in the range 0-9, optionally\n"
+"OR-ed with the constant PRESET_EXTREME.\n"
+"\n"
+"filters (if provided) should be a sequence of dicts. Each dict should\n"
+"have an entry for \"id\" indicating the ID of the filter, plus\n"
+"additional entries for options to the filter.\n"
+"\n"
+"For one-shot compression, use the compress() function instead.\n");
+
+static PyType_Slot lzma_compressor_type_slots[] = {
+ {Py_tp_dealloc, Compressor_dealloc},
+ {Py_tp_methods, Compressor_methods},
+ {Py_tp_new, Compressor_new},
+ {Py_tp_doc, (char *)Compressor_doc},
+ {Py_tp_traverse, Compressor_traverse},
+ {0, 0}
+};
+
+static PyType_Spec lzma_compressor_type_spec = {
+ .name = "_lzma.LZMACompressor",
+ .basicsize = sizeof(Compressor),
+ // Calling PyType_GetModuleState() on a subclass is not safe.
+ // lzma_compressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
+ // which prevents to create a subclass.
+ // So calling PyType_GetModuleState() in this file is always safe.
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = lzma_compressor_type_slots,
+};
+
+/* LZMADecompressor class. */
+
+/* Decompress data of length d->lzs.avail_in in d->lzs.next_in. The output
+ buffer is allocated dynamically and returned. At most max_length bytes are
+ returned, so some of the input may not be consumed. d->lzs.next_in and
+ d->lzs.avail_in are updated to reflect the consumed input. */
+static PyObject*
+decompress_buf(Decompressor *d, Py_ssize_t max_length)
+{
+ PyObject *result;
+ lzma_stream *lzs = &d->lzs;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+ _lzma_state *state = PyType_GetModuleState(Py_TYPE(d));
+ assert(state != NULL);
+
+ if (OutputBuffer_InitAndGrow(&buffer, max_length, &lzs->next_out, &lzs->avail_out) < 0) {
+ goto error;
+ }
+
+ for (;;) {
+ lzma_ret lzret;
+
+ Py_BEGIN_ALLOW_THREADS
+ lzret = lzma_code(lzs, LZMA_RUN);
+ Py_END_ALLOW_THREADS
+
+ if (lzret == LZMA_BUF_ERROR && lzs->avail_in == 0 && lzs->avail_out > 0) {
+ lzret = LZMA_OK; /* That wasn't a real error */
+ }
+ if (catch_lzma_error(state, lzret)) {
+ goto error;
+ }
+ if (lzret == LZMA_GET_CHECK || lzret == LZMA_NO_CHECK) {
+ d->check = lzma_get_check(&d->lzs);
+ }
+ if (lzret == LZMA_STREAM_END) {
+ d->eof = 1;
+ break;
+ } else if (lzs->avail_out == 0) {
+ /* Need to check lzs->avail_out before lzs->avail_in.
+ Maybe lzs's internal state still have a few bytes
+ can be output, grow the output buffer and continue
+ if max_lengh < 0. */
+ if (OutputBuffer_GetDataSize(&buffer, lzs->avail_out) == max_length) {
+ break;
+ }
+ if (OutputBuffer_Grow(&buffer, &lzs->next_out, &lzs->avail_out) < 0) {
+ goto error;
+ }
+ } else if (lzs->avail_in == 0) {
+ break;
+ }
+ }
+
+ result = OutputBuffer_Finish(&buffer, lzs->avail_out);
+ if (result != NULL) {
+ return result;
+ }
+
+error:
+ OutputBuffer_OnError(&buffer);
+ return NULL;
+}
+
+static PyObject *
+decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
+{
+ char input_buffer_in_use;
+ PyObject *result;
+ lzma_stream *lzs = &d->lzs;
+
+ /* Prepend unconsumed input if necessary */
+ if (lzs->next_in != NULL) {
+ size_t avail_now, avail_total;
+
+ /* Number of bytes we can append to input buffer */
+ avail_now = (d->input_buffer + d->input_buffer_size)
+ - (lzs->next_in + lzs->avail_in);
+
+ /* Number of bytes we can append if we move existing
+ contents to beginning of buffer (overwriting
+ consumed input) */
+ avail_total = d->input_buffer_size - lzs->avail_in;
+
+ if (avail_total < len) {
+ size_t offset = lzs->next_in - d->input_buffer;
+ uint8_t *tmp;
+ size_t new_size = d->input_buffer_size + len - avail_now;
+
+ /* Assign to temporary variable first, so we don't
+ lose address of allocated buffer if realloc fails */
+ tmp = PyMem_Realloc(d->input_buffer, new_size);
+ if (tmp == NULL) {
+ PyErr_SetNone(PyExc_MemoryError);
+ return NULL;
+ }
+ d->input_buffer = tmp;
+ d->input_buffer_size = new_size;
+
+ lzs->next_in = d->input_buffer + offset;
+ }
+ else if (avail_now < len) {
+ memmove(d->input_buffer, lzs->next_in,
+ lzs->avail_in);
+ lzs->next_in = d->input_buffer;
+ }
+ memcpy((void*)(lzs->next_in + lzs->avail_in), data, len);
+ lzs->avail_in += len;
+ input_buffer_in_use = 1;
+ }
+ else {
+ lzs->next_in = data;
+ lzs->avail_in = len;
+ input_buffer_in_use = 0;
+ }
+
+ result = decompress_buf(d, max_length);
+ if (result == NULL) {
+ lzs->next_in = NULL;
+ return NULL;
+ }
+
+ if (d->eof) {
+ d->needs_input = 0;
+ if (lzs->avail_in > 0) {
+ Py_XSETREF(d->unused_data,
+ PyBytes_FromStringAndSize((char *)lzs->next_in, lzs->avail_in));
+ if (d->unused_data == NULL) {
+ goto error;
+ }
+ }
+ }
+ else if (lzs->avail_in == 0) {
+ lzs->next_in = NULL;
+
+ if (lzs->avail_out == 0) {
+ /* (avail_in==0 && avail_out==0)
+ Maybe lzs's internal state still have a few bytes can
+ be output, try to output them next time. */
+ d->needs_input = 0;
+
+ /* If max_length < 0, lzs->avail_out always > 0 */
+ assert(max_length >= 0);
+ } else {
+ /* Input buffer exhausted, output buffer has space. */
+ d->needs_input = 1;
+ }
+ }
+ else {
+ d->needs_input = 0;
+
+ /* If we did not use the input buffer, we now have
+ to copy the tail from the caller's buffer into the
+ input buffer */
+ if (!input_buffer_in_use) {
+
+ /* Discard buffer if it's too small
+ (resizing it may needlessly copy the current contents) */
+ if (d->input_buffer != NULL &&
+ d->input_buffer_size < lzs->avail_in) {
+ PyMem_Free(d->input_buffer);
+ d->input_buffer = NULL;
+ }
+
+ /* Allocate if necessary */
+ if (d->input_buffer == NULL) {
+ d->input_buffer = PyMem_Malloc(lzs->avail_in);
+ if (d->input_buffer == NULL) {
+ PyErr_SetNone(PyExc_MemoryError);
+ goto error;
+ }
+ d->input_buffer_size = lzs->avail_in;
+ }
+
+ /* Copy tail */
+ memcpy(d->input_buffer, lzs->next_in, lzs->avail_in);
+ lzs->next_in = d->input_buffer;
+ }
+ }
+
+ return result;
+
+error:
+ Py_XDECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+_lzma.LZMADecompressor.decompress
+
+ data: Py_buffer
+ max_length: Py_ssize_t=-1
+
+Decompress *data*, returning uncompressed data as bytes.
+
+If *max_length* is nonnegative, returns at most *max_length* bytes of
+decompressed data. If this limit is reached and further output can be
+produced, *self.needs_input* will be set to ``False``. In this case, the next
+call to *decompress()* may provide *data* as b'' to obtain more of the output.
+
+If all of the input data was decompressed and returned (either because this
+was less than *max_length* bytes, or because *max_length* was negative),
+*self.needs_input* will be set to True.
+
+Attempting to decompress data after the end of stream is reached raises an
+EOFError. Any data found after the end of the stream is ignored and saved in
+the unused_data attribute.
+[clinic start generated code]*/
+
+static PyObject *
+_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data,
+ Py_ssize_t max_length)
+/*[clinic end generated code: output=ef4e20ec7122241d input=60c1f135820e309d]*/
+{
+ PyObject *result = NULL;
+
+ ACQUIRE_LOCK(self);
+ if (self->eof)
+ PyErr_SetString(PyExc_EOFError, "Already at end of stream");
+ else
+ result = decompress(self, data->buf, data->len, max_length);
+ RELEASE_LOCK(self);
+ return result;
+}
+
+static int
+Decompressor_init_raw(_lzma_state *state, lzma_stream *lzs, PyObject *filterspecs)
+{
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+ lzma_ret lzret;
+
+ if (parse_filter_chain_spec(state, filters, filterspecs) == -1) {
+ return -1;
+ }
+ lzret = lzma_raw_decoder(lzs, filters);
+ free_filter_chain(filters);
+ if (catch_lzma_error(state, lzret)) {
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+/*[clinic input]
+@classmethod
+_lzma.LZMADecompressor.__new__
+
+ format: int(c_default="FORMAT_AUTO") = FORMAT_AUTO
+ Specifies the container format of the input stream. If this is
+ FORMAT_AUTO (the default), the decompressor will automatically detect
+ whether the input is FORMAT_XZ or FORMAT_ALONE. Streams created with
+ FORMAT_RAW cannot be autodetected.
+
+ memlimit: object = None
+ Limit the amount of memory used by the decompressor. This will cause
+ decompression to fail if the input cannot be decompressed within the
+ given limit.
+
+ filters: object = None
+ A custom filter chain. This argument is required for FORMAT_RAW, and
+ not accepted with any other format. When provided, this should be a
+ sequence of dicts, each indicating the ID and options for a single
+ filter.
+
+Create a decompressor object for decompressing data incrementally.
+
+For one-shot decompression, use the decompress() function instead.
+[clinic start generated code]*/
+
+static PyObject *
+_lzma_LZMADecompressor_impl(PyTypeObject *type, int format,
+ PyObject *memlimit, PyObject *filters)
+/*[clinic end generated code: output=2d46d5e70f10bc7f input=ca40cd1cb1202b0d]*/
+{
+ Decompressor *self;
+ const uint32_t decoder_flags = LZMA_TELL_ANY_CHECK | LZMA_TELL_NO_CHECK;
+ uint64_t memlimit_ = UINT64_MAX;
+ lzma_ret lzret;
+ _lzma_state *state = PyType_GetModuleState(type);
+ assert(state != NULL);
+
+ if (memlimit != Py_None) {
+ if (format == FORMAT_RAW) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot specify memory limit with FORMAT_RAW");
+ return NULL;
+ }
+ memlimit_ = PyLong_AsUnsignedLongLong(memlimit);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+
+ if (format == FORMAT_RAW && filters == Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "Must specify filters for FORMAT_RAW");
+ return NULL;
+ } else if (format != FORMAT_RAW && filters != Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot specify filters except with FORMAT_RAW");
+ return NULL;
+ }
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (Decompressor *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+ self->alloc.opaque = NULL;
+ self->alloc.alloc = PyLzma_Malloc;
+ self->alloc.free = PyLzma_Free;
+ self->lzs.allocator = &self->alloc;
+ self->lzs.next_in = NULL;
+
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
+
+ self->check = LZMA_CHECK_UNKNOWN;
+ self->needs_input = 1;
+ self->input_buffer = NULL;
+ self->input_buffer_size = 0;
+ Py_XSETREF(self->unused_data, PyBytes_FromStringAndSize(NULL, 0));
+ if (self->unused_data == NULL) {
+ goto error;
+ }
+
+ switch (format) {
+ case FORMAT_AUTO:
+ lzret = lzma_auto_decoder(&self->lzs, memlimit_, decoder_flags);
+ if (catch_lzma_error(state, lzret)) {
+ goto error;
+ }
+ break;
+
+ case FORMAT_XZ:
+ lzret = lzma_stream_decoder(&self->lzs, memlimit_, decoder_flags);
+ if (catch_lzma_error(state, lzret)) {
+ goto error;
+ }
+ break;
+
+ case FORMAT_ALONE:
+ self->check = LZMA_CHECK_NONE;
+ lzret = lzma_alone_decoder(&self->lzs, memlimit_);
+ if (catch_lzma_error(state, lzret)) {
+ goto error;
+ }
+ break;
+
+ case FORMAT_RAW:
+ self->check = LZMA_CHECK_NONE;
+ if (Decompressor_init_raw(state, &self->lzs, filters) == -1) {
+ goto error;
+ }
+ break;
+
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "Invalid container format: %d", format);
+ goto error;
+ }
+
+ return (PyObject *)self;
+
+error:
+ Py_DECREF(self);
+ return NULL;
+}
+
+static void
+Decompressor_dealloc(Decompressor *self)
+{
+ if(self->input_buffer != NULL)
+ PyMem_Free(self->input_buffer);
+
+ lzma_end(&self->lzs);
+ Py_CLEAR(self->unused_data);
+ if (self->lock != NULL) {
+ PyThread_free_lock(self->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+Decompressor_traverse(Decompressor *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static PyMethodDef Decompressor_methods[] = {
+ _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF
+ {NULL}
+};
+
+PyDoc_STRVAR(Decompressor_check_doc,
+"ID of the integrity check used by the input stream.");
+
+PyDoc_STRVAR(Decompressor_eof_doc,
+"True if the end-of-stream marker has been reached.");
+
+PyDoc_STRVAR(Decompressor_needs_input_doc,
+"True if more input is needed before more decompressed data can be produced.");
+
+PyDoc_STRVAR(Decompressor_unused_data_doc,
+"Data found after the end of the compressed stream.");
+
+static PyMemberDef Decompressor_members[] = {
+ {"check", T_INT, offsetof(Decompressor, check), READONLY,
+ Decompressor_check_doc},
+ {"eof", T_BOOL, offsetof(Decompressor, eof), READONLY,
+ Decompressor_eof_doc},
+ {"needs_input", T_BOOL, offsetof(Decompressor, needs_input), READONLY,
+ Decompressor_needs_input_doc},
+ {"unused_data", T_OBJECT_EX, offsetof(Decompressor, unused_data), READONLY,
+ Decompressor_unused_data_doc},
+ {NULL}
+};
+
+static PyType_Slot lzma_decompressor_type_slots[] = {
+ {Py_tp_dealloc, Decompressor_dealloc},
+ {Py_tp_methods, Decompressor_methods},
+ {Py_tp_new, _lzma_LZMADecompressor},
+ {Py_tp_doc, (char *)_lzma_LZMADecompressor__doc__},
+ {Py_tp_traverse, Decompressor_traverse},
+ {Py_tp_members, Decompressor_members},
+ {0, 0}
+};
+
+static PyType_Spec lzma_decompressor_type_spec = {
+ .name = "_lzma.LZMADecompressor",
+ .basicsize = sizeof(Decompressor),
+ // Calling PyType_GetModuleState() on a subclass is not safe.
+ // lzma_decompressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
+ // which prevents to create a subclass.
+ // So calling PyType_GetModuleState() in this file is always safe.
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = lzma_decompressor_type_slots,
+};
+
+
+/* Module-level functions. */
+
+/*[clinic input]
+_lzma.is_check_supported
+ check_id: int
+ /
+
+Test whether the given integrity check is supported.
+
+Always returns True for CHECK_NONE and CHECK_CRC32.
+[clinic start generated code]*/
+
+static PyObject *
+_lzma_is_check_supported_impl(PyObject *module, int check_id)
+/*[clinic end generated code: output=e4f14ba3ce2ad0a5 input=5518297b97b2318f]*/
+{
+ return PyBool_FromLong(lzma_check_is_supported(check_id));
+}
+
+PyDoc_STRVAR(_lzma__encode_filter_properties__doc__,
+"_encode_filter_properties($module, filter, /)\n"
+"--\n"
+"\n"
+"Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n"
+"\n"
+"The result does not include the filter ID itself, only the options.");
+
+#define _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF \
+ {"_encode_filter_properties", (PyCFunction)_lzma__encode_filter_properties, METH_O, _lzma__encode_filter_properties__doc__},
+
+static PyObject *
+_lzma__encode_filter_properties_impl(PyObject *module, lzma_filter filter);
+
+static PyObject *
+_lzma__encode_filter_properties(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ lzma_filter filter = {LZMA_VLI_UNKNOWN, NULL};
+ _lzma_state *state = get_lzma_state(module);
+ assert(state != NULL);
+ if (!lzma_filter_converter(state, arg, &filter)) {
+ goto exit;
+ }
+ return_value = _lzma__encode_filter_properties_impl(module, filter);
+
+exit:
+ /* Cleanup for filter */
+ if (filter.id != LZMA_VLI_UNKNOWN) {
+ PyMem_Free(filter.options);
+ }
+
+ return return_value;
+}
+
+static PyObject *
+_lzma__encode_filter_properties_impl(PyObject *module, lzma_filter filter)
+{
+ lzma_ret lzret;
+ uint32_t encoded_size;
+ PyObject *result = NULL;
+ _lzma_state *state = get_lzma_state(module);
+ assert(state != NULL);
+
+ lzret = lzma_properties_size(&encoded_size, &filter);
+ if (catch_lzma_error(state, lzret))
+ goto error;
+
+ result = PyBytes_FromStringAndSize(NULL, encoded_size);
+ if (result == NULL)
+ goto error;
+
+ lzret = lzma_properties_encode(
+ &filter, (uint8_t *)PyBytes_AS_STRING(result));
+ if (catch_lzma_error(state, lzret)) {
+ goto error;
+ }
+
+ return result;
+
+error:
+ Py_XDECREF(result);
+ return NULL;
+}
+
+
+/*[clinic input]
+_lzma._decode_filter_properties
+ filter_id: lzma_vli
+ encoded_props: Py_buffer
+ /
+
+Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).
+
+The result does not include the filter ID itself, only the options.
+[clinic start generated code]*/
+
+static PyObject *
+_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
+ Py_buffer *encoded_props)
+/*[clinic end generated code: output=714fd2ef565d5c60 input=246410800782160c]*/
+{
+ lzma_filter filter;
+ lzma_ret lzret;
+ PyObject *result = NULL;
+ filter.id = filter_id;
+ _lzma_state *state = get_lzma_state(module);
+ assert(state != NULL);
+
+ lzret = lzma_properties_decode(
+ &filter, NULL, encoded_props->buf, encoded_props->len);
+ if (catch_lzma_error(state, lzret)) {
+ return NULL;
+ }
+
+ result = build_filter_spec(&filter);
+
+ /* We use vanilla free() here instead of PyMem_Free() - filter.options was
+ allocated by lzma_properties_decode() using the default allocator. */
+ free(filter.options);
+ return result;
+}
+
+/* Some of our constants are more than 32 bits wide, so PyModule_AddIntConstant
+ would not work correctly on platforms with 32-bit longs. */
+static int
+module_add_int_constant(PyObject *m, const char *name, long long value)
+{
+ PyObject *o = PyLong_FromLongLong(value);
+ if (o == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObject(m, name, o) == 0) {
+ return 0;
+ }
+ Py_DECREF(o);
+ return -1;
+}
+
+static int
+lzma_exec(PyObject *module)
+{
+#define ADD_INT_PREFIX_MACRO(module, macro) \
+ do { \
+ if (module_add_int_constant(module, #macro, LZMA_ ## macro) < 0) { \
+ return -1; \
+ } \
+ } while(0)
+
+#define ADD_INT_MACRO(module, macro) \
+ do { \
+ if (PyModule_AddIntMacro(module, macro) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+
+ _lzma_state *state = get_lzma_state(module);
+
+ state->empty_tuple = PyTuple_New(0);
+ if (state->empty_tuple == NULL) {
+ return -1;
+ }
+
+ ADD_INT_MACRO(module, FORMAT_AUTO);
+ ADD_INT_MACRO(module, FORMAT_XZ);
+ ADD_INT_MACRO(module, FORMAT_ALONE);
+ ADD_INT_MACRO(module, FORMAT_RAW);
+ ADD_INT_PREFIX_MACRO(module, CHECK_NONE);
+ ADD_INT_PREFIX_MACRO(module, CHECK_CRC32);
+ ADD_INT_PREFIX_MACRO(module, CHECK_CRC64);
+ ADD_INT_PREFIX_MACRO(module, CHECK_SHA256);
+ ADD_INT_PREFIX_MACRO(module, CHECK_ID_MAX);
+ ADD_INT_PREFIX_MACRO(module, CHECK_UNKNOWN);
+ ADD_INT_PREFIX_MACRO(module, FILTER_LZMA1);
+ ADD_INT_PREFIX_MACRO(module, FILTER_LZMA2);
+ ADD_INT_PREFIX_MACRO(module, FILTER_DELTA);
+ ADD_INT_PREFIX_MACRO(module, FILTER_X86);
+ ADD_INT_PREFIX_MACRO(module, FILTER_IA64);
+ ADD_INT_PREFIX_MACRO(module, FILTER_ARM);
+ ADD_INT_PREFIX_MACRO(module, FILTER_ARMTHUMB);
+ ADD_INT_PREFIX_MACRO(module, FILTER_SPARC);
+ ADD_INT_PREFIX_MACRO(module, FILTER_POWERPC);
+ ADD_INT_PREFIX_MACRO(module, MF_HC3);
+ ADD_INT_PREFIX_MACRO(module, MF_HC4);
+ ADD_INT_PREFIX_MACRO(module, MF_BT2);
+ ADD_INT_PREFIX_MACRO(module, MF_BT3);
+ ADD_INT_PREFIX_MACRO(module, MF_BT4);
+ ADD_INT_PREFIX_MACRO(module, MODE_FAST);
+ ADD_INT_PREFIX_MACRO(module, MODE_NORMAL);
+ ADD_INT_PREFIX_MACRO(module, PRESET_DEFAULT);
+ ADD_INT_PREFIX_MACRO(module, PRESET_EXTREME);
+
+ state->error = PyErr_NewExceptionWithDoc("_lzma.LZMAError", "Call to liblzma failed.", NULL, NULL);
+ if (state->error == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(module, (PyTypeObject *)state->error) < 0) {
+ return -1;
+ }
+
+
+ state->lzma_compressor_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
+ &lzma_compressor_type_spec, NULL);
+ if (state->lzma_compressor_type == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(module, state->lzma_compressor_type) < 0) {
+ return -1;
+ }
+
+ state->lzma_decompressor_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
+ &lzma_decompressor_type_spec, NULL);
+ if (state->lzma_decompressor_type == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(module, state->lzma_decompressor_type) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyMethodDef lzma_methods[] = {
+ _LZMA_IS_CHECK_SUPPORTED_METHODDEF
+ _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF
+ _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF
+ {NULL}
+};
+
+static PyModuleDef_Slot lzma_slots[] = {
+ {Py_mod_exec, lzma_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+lzma_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _lzma_state *state = get_lzma_state(module);
+ Py_VISIT(state->lzma_compressor_type);
+ Py_VISIT(state->lzma_decompressor_type);
+ Py_VISIT(state->error);
+ Py_VISIT(state->empty_tuple);
+ return 0;
+}
+
+static int
+lzma_clear(PyObject *module)
+{
+ _lzma_state *state = get_lzma_state(module);
+ Py_CLEAR(state->lzma_compressor_type);
+ Py_CLEAR(state->lzma_decompressor_type);
+ Py_CLEAR(state->error);
+ Py_CLEAR(state->empty_tuple);
+ return 0;
+}
+
+static void
+lzma_free(void *module)
+{
+ lzma_clear((PyObject *)module);
+}
+
+static PyModuleDef _lzmamodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_lzma",
+ .m_size = sizeof(_lzma_state),
+ .m_methods = lzma_methods,
+ .m_slots = lzma_slots,
+ .m_traverse = lzma_traverse,
+ .m_clear = lzma_clear,
+ .m_free = lzma_free,
+};
+
+PyMODINIT_FUNC
+PyInit__lzma(void)
+{
+ return PyModuleDef_Init(&_lzmamodule);
+}
diff --git a/contrib/tools/python3/Modules/_math.h b/contrib/tools/python3/Modules/_math.h
new file mode 100644
index 00000000000..2285b64747c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_math.h
@@ -0,0 +1,25 @@
+/* log1p(x) = log(1+x). The log1p function is designed to avoid the
+ significant loss of precision that arises from direct evaluation when x is
+ small. Use the substitute from _math.h on all platforms: it includes
+ workarounds for buggy handling of zeros.
+ */
+
+static double
+_Py_log1p(double x)
+{
+ /* Some platforms (e.g. MacOS X 10.8, see gh-59682) supply a log1p function
+ but don't respect the sign of zero: log1p(-0.0) gives 0.0 instead of
+ the correct result of -0.0.
+
+ To save fiddling with configure tests and platform checks, we handle the
+ special case of zero input directly on all platforms.
+ */
+ if (x == 0.0) {
+ return x;
+ }
+ else {
+ return log1p(x);
+ }
+}
+
+#define m_log1p _Py_log1p
diff --git a/contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h b/contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h
new file mode 100644
index 00000000000..885cd5c2fff
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/clinic/multiprocessing.c.h
@@ -0,0 +1,175 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_closesocket__doc__,
+"closesocket($module, handle, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIPROCESSING_CLOSESOCKET_METHODDEF \
+ {"closesocket", (PyCFunction)_multiprocessing_closesocket, METH_O, _multiprocessing_closesocket__doc__},
+
+static PyObject *
+_multiprocessing_closesocket_impl(PyObject *module, HANDLE handle);
+
+static PyObject *
+_multiprocessing_closesocket(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+
+ handle = PyLong_AsVoidPtr(arg);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _multiprocessing_closesocket_impl(module, handle);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_recv__doc__,
+"recv($module, handle, size, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIPROCESSING_RECV_METHODDEF \
+ {"recv", _PyCFunction_CAST(_multiprocessing_recv), METH_FASTCALL, _multiprocessing_recv__doc__},
+
+static PyObject *
+_multiprocessing_recv_impl(PyObject *module, HANDLE handle, int size);
+
+static PyObject *
+_multiprocessing_recv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ int size;
+
+ if (!_PyArg_CheckPositional("recv", nargs, 2, 2)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ size = _PyLong_AsInt(args[1]);
+ if (size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _multiprocessing_recv_impl(module, handle, size);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_send__doc__,
+"send($module, handle, buf, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIPROCESSING_SEND_METHODDEF \
+ {"send", _PyCFunction_CAST(_multiprocessing_send), METH_FASTCALL, _multiprocessing_send__doc__},
+
+static PyObject *
+_multiprocessing_send_impl(PyObject *module, HANDLE handle, Py_buffer *buf);
+
+static PyObject *
+_multiprocessing_send(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer buf = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("send", nargs, 2, 2)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &buf, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buf, 'C')) {
+ _PyArg_BadArgument("send", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = _multiprocessing_send_impl(module, handle, &buf);
+
+exit:
+ /* Cleanup for buf */
+ if (buf.obj) {
+ PyBuffer_Release(&buf);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+PyDoc_STRVAR(_multiprocessing_sem_unlink__doc__,
+"sem_unlink($module, name, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIPROCESSING_SEM_UNLINK_METHODDEF \
+ {"sem_unlink", (PyCFunction)_multiprocessing_sem_unlink, METH_O, _multiprocessing_sem_unlink__doc__},
+
+static PyObject *
+_multiprocessing_sem_unlink_impl(PyObject *module, const char *name);
+
+static PyObject *
+_multiprocessing_sem_unlink(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *name;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("sem_unlink", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(arg, &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _multiprocessing_sem_unlink_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+#ifndef _MULTIPROCESSING_CLOSESOCKET_METHODDEF
+ #define _MULTIPROCESSING_CLOSESOCKET_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_CLOSESOCKET_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_RECV_METHODDEF
+ #define _MULTIPROCESSING_RECV_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_RECV_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEND_METHODDEF
+ #define _MULTIPROCESSING_SEND_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */
+/*[clinic end generated code: output=4a6afc67c1f5ec85 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h b/contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h
new file mode 100644
index 00000000000..df2aa29cfe6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/clinic/posixshmem.c.h
@@ -0,0 +1,175 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+#if defined(HAVE_SHM_OPEN)
+
+PyDoc_STRVAR(_posixshmem_shm_open__doc__,
+"shm_open($module, /, path, flags, mode=511)\n"
+"--\n"
+"\n"
+"Open a shared memory object. Returns a file descriptor (integer).");
+
+#define _POSIXSHMEM_SHM_OPEN_METHODDEF \
+ {"shm_open", _PyCFunction_CAST(_posixshmem_shm_open), METH_FASTCALL|METH_KEYWORDS, _posixshmem_shm_open__doc__},
+
+static int
+_posixshmem_shm_open_impl(PyObject *module, PyObject *path, int flags,
+ int mode);
+
+static PyObject *
+_posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(flags), &_Py_ID(mode), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "flags", "mode", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "shm_open",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *path;
+ int flags;
+ int mode = 511;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("shm_open", "argument 'path'", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ path = args[0];
+ flags = _PyLong_AsInt(args[1]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ mode = _PyLong_AsInt(args[2]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ _return_value = _posixshmem_shm_open_impl(module, path, flags, mode);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SHM_OPEN) */
+
+#if defined(HAVE_SHM_UNLINK)
+
+PyDoc_STRVAR(_posixshmem_shm_unlink__doc__,
+"shm_unlink($module, /, path)\n"
+"--\n"
+"\n"
+"Remove a shared memory object (similar to unlink()).\n"
+"\n"
+"Remove a shared memory object name, and, once all processes have unmapped\n"
+"the object, de-allocates and destroys the contents of the associated memory\n"
+"region.");
+
+#define _POSIXSHMEM_SHM_UNLINK_METHODDEF \
+ {"shm_unlink", _PyCFunction_CAST(_posixshmem_shm_unlink), METH_FASTCALL|METH_KEYWORDS, _posixshmem_shm_unlink__doc__},
+
+static PyObject *
+_posixshmem_shm_unlink_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+_posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "shm_unlink",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("shm_unlink", "argument 'path'", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = _posixshmem_shm_unlink_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SHM_UNLINK) */
+
+#ifndef _POSIXSHMEM_SHM_OPEN_METHODDEF
+ #define _POSIXSHMEM_SHM_OPEN_METHODDEF
+#endif /* !defined(_POSIXSHMEM_SHM_OPEN_METHODDEF) */
+
+#ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF
+ #define _POSIXSHMEM_SHM_UNLINK_METHODDEF
+#endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */
+/*[clinic end generated code: output=3f6fee283d5fd0e9 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h b/contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h
new file mode 100644
index 00000000000..35347169bc1
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/clinic/semaphore.c.h
@@ -0,0 +1,545 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+#if defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_SemLock_acquire__doc__,
+"acquire($self, /, block=True, timeout=None)\n"
+"--\n"
+"\n"
+"Acquire the semaphore/lock.");
+
+#define _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF \
+ {"acquire", _PyCFunction_CAST(_multiprocessing_SemLock_acquire), METH_FASTCALL|METH_KEYWORDS, _multiprocessing_SemLock_acquire__doc__},
+
+static PyObject *
+_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking,
+ PyObject *timeout_obj);
+
+static PyObject *
+_multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(block), &_Py_ID(timeout), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"block", "timeout", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "acquire",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int blocking = 1;
+ PyObject *timeout_obj = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ blocking = PyObject_IsTrue(args[0]);
+ if (blocking < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ timeout_obj = args[1];
+skip_optional_pos:
+ return_value = _multiprocessing_SemLock_acquire_impl(self, blocking, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS) */
+
+#if defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__,
+"release($self, /)\n"
+"--\n"
+"\n"
+"Release the semaphore/lock.");
+
+#define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \
+ {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__},
+
+static PyObject *
+_multiprocessing_SemLock_release_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock_release(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock_release_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS) */
+
+#if defined(HAVE_MP_SEMAPHORE) && !defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_SemLock_acquire__doc__,
+"acquire($self, /, block=True, timeout=None)\n"
+"--\n"
+"\n"
+"Acquire the semaphore/lock.");
+
+#define _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF \
+ {"acquire", _PyCFunction_CAST(_multiprocessing_SemLock_acquire), METH_FASTCALL|METH_KEYWORDS, _multiprocessing_SemLock_acquire__doc__},
+
+static PyObject *
+_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking,
+ PyObject *timeout_obj);
+
+static PyObject *
+_multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(block), &_Py_ID(timeout), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"block", "timeout", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "acquire",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int blocking = 1;
+ PyObject *timeout_obj = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ blocking = PyObject_IsTrue(args[0]);
+ if (blocking < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ timeout_obj = args[1];
+skip_optional_pos:
+ return_value = _multiprocessing_SemLock_acquire_impl(self, blocking, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) && !defined(MS_WINDOWS) */
+
+#if defined(HAVE_MP_SEMAPHORE) && !defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__,
+"release($self, /)\n"
+"--\n"
+"\n"
+"Release the semaphore/lock.");
+
+#define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \
+ {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__},
+
+static PyObject *
+_multiprocessing_SemLock_release_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock_release(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock_release_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) && !defined(MS_WINDOWS) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+static PyObject *
+_multiprocessing_SemLock_impl(PyTypeObject *type, int kind, int value,
+ int maxvalue, const char *name, int unlink);
+
+static PyObject *
+_multiprocessing_SemLock(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(kind), &_Py_ID(value), &_Py_ID(maxvalue), &_Py_ID(name), &_Py_ID(unlink), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"kind", "value", "maxvalue", "name", "unlink", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "SemLock",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ int kind;
+ int value;
+ int maxvalue;
+ const char *name;
+ int unlink;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 5, 5, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ kind = _PyLong_AsInt(fastargs[0]);
+ if (kind == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ value = _PyLong_AsInt(fastargs[1]);
+ if (value == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ maxvalue = _PyLong_AsInt(fastargs[2]);
+ if (maxvalue == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(fastargs[3])) {
+ _PyArg_BadArgument("SemLock", "argument 'name'", "str", fastargs[3]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(fastargs[3], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ unlink = PyObject_IsTrue(fastargs[4]);
+ if (unlink < 0) {
+ goto exit;
+ }
+ return_value = _multiprocessing_SemLock_impl(type, kind, value, maxvalue, name, unlink);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock__rebuild__doc__,
+"_rebuild($type, handle, kind, maxvalue, name, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF \
+ {"_rebuild", _PyCFunction_CAST(_multiprocessing_SemLock__rebuild), METH_FASTCALL|METH_CLASS, _multiprocessing_SemLock__rebuild__doc__},
+
+static PyObject *
+_multiprocessing_SemLock__rebuild_impl(PyTypeObject *type, SEM_HANDLE handle,
+ int kind, int maxvalue,
+ const char *name);
+
+static PyObject *
+_multiprocessing_SemLock__rebuild(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ SEM_HANDLE handle;
+ int kind;
+ int maxvalue;
+ const char *name;
+
+ if (!_PyArg_ParseStack(args, nargs, ""F_SEM_HANDLE"iiz:_rebuild",
+ &handle, &kind, &maxvalue, &name)) {
+ goto exit;
+ }
+ return_value = _multiprocessing_SemLock__rebuild_impl(type, handle, kind, maxvalue, name);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock__count__doc__,
+"_count($self, /)\n"
+"--\n"
+"\n"
+"Num of `acquire()`s minus num of `release()`s for this process.");
+
+#define _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF \
+ {"_count", (PyCFunction)_multiprocessing_SemLock__count, METH_NOARGS, _multiprocessing_SemLock__count__doc__},
+
+static PyObject *
+_multiprocessing_SemLock__count_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock__count(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock__count_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock__is_mine__doc__,
+"_is_mine($self, /)\n"
+"--\n"
+"\n"
+"Whether the lock is owned by this thread.");
+
+#define _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF \
+ {"_is_mine", (PyCFunction)_multiprocessing_SemLock__is_mine, METH_NOARGS, _multiprocessing_SemLock__is_mine__doc__},
+
+static PyObject *
+_multiprocessing_SemLock__is_mine_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock__is_mine(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock__is_mine_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock__get_value__doc__,
+"_get_value($self, /)\n"
+"--\n"
+"\n"
+"Get the value of the semaphore.");
+
+#define _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF \
+ {"_get_value", (PyCFunction)_multiprocessing_SemLock__get_value, METH_NOARGS, _multiprocessing_SemLock__get_value__doc__},
+
+static PyObject *
+_multiprocessing_SemLock__get_value_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock__get_value(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock__get_value_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock__is_zero__doc__,
+"_is_zero($self, /)\n"
+"--\n"
+"\n"
+"Return whether semaphore has value zero.");
+
+#define _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF \
+ {"_is_zero", (PyCFunction)_multiprocessing_SemLock__is_zero, METH_NOARGS, _multiprocessing_SemLock__is_zero__doc__},
+
+static PyObject *
+_multiprocessing_SemLock__is_zero_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock__is_zero(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock__is_zero_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock__after_fork__doc__,
+"_after_fork($self, /)\n"
+"--\n"
+"\n"
+"Rezero the net acquisition count after fork().");
+
+#define _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF \
+ {"_after_fork", (PyCFunction)_multiprocessing_SemLock__after_fork, METH_NOARGS, _multiprocessing_SemLock__after_fork__doc__},
+
+static PyObject *
+_multiprocessing_SemLock__after_fork_impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock__after_fork(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock__after_fork_impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock___enter____doc__,
+"__enter__($self, /)\n"
+"--\n"
+"\n"
+"Enter the semaphore/lock.");
+
+#define _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF \
+ {"__enter__", (PyCFunction)_multiprocessing_SemLock___enter__, METH_NOARGS, _multiprocessing_SemLock___enter____doc__},
+
+static PyObject *
+_multiprocessing_SemLock___enter___impl(SemLockObject *self);
+
+static PyObject *
+_multiprocessing_SemLock___enter__(SemLockObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multiprocessing_SemLock___enter___impl(self);
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#if defined(HAVE_MP_SEMAPHORE)
+
+PyDoc_STRVAR(_multiprocessing_SemLock___exit____doc__,
+"__exit__($self, exc_type=None, exc_value=None, exc_tb=None, /)\n"
+"--\n"
+"\n"
+"Exit the semaphore/lock.");
+
+#define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF \
+ {"__exit__", _PyCFunction_CAST(_multiprocessing_SemLock___exit__), METH_FASTCALL, _multiprocessing_SemLock___exit____doc__},
+
+static PyObject *
+_multiprocessing_SemLock___exit___impl(SemLockObject *self,
+ PyObject *exc_type,
+ PyObject *exc_value, PyObject *exc_tb);
+
+static PyObject *
+_multiprocessing_SemLock___exit__(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *exc_type = Py_None;
+ PyObject *exc_value = Py_None;
+ PyObject *exc_tb = Py_None;
+
+ if (!_PyArg_CheckPositional("__exit__", nargs, 0, 3)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ exc_type = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ exc_value = args[1];
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ exc_tb = args[2];
+skip_optional:
+ return_value = _multiprocessing_SemLock___exit___impl(self, exc_type, exc_value, exc_tb);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_MP_SEMAPHORE) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF) */
+
+#ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
+ #define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
+#endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */
+/*[clinic end generated code: output=dae57a702cc01512 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c
new file mode 100644
index 00000000000..8f9daa5c3de
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.c
@@ -0,0 +1,295 @@
+/*
+ * Extension module used by multiprocessing package
+ *
+ * multiprocessing.c
+ *
+ * Copyright (c) 2006-2008, R Oudkerk
+ * Licensed to PSF under a Contributor Agreement.
+ */
+
+#include "multiprocessing.h"
+
+/*[python input]
+class HANDLE_converter(CConverter):
+ type = "HANDLE"
+ format_unit = '"F_HANDLE"'
+
+ def parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyLong_AsVoidPtr({argname});
+ if (!{paramname} && PyErr_Occurred()) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.parser_name)
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=3e537d244034affb]*/
+
+/*[clinic input]
+module _multiprocessing
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=01e0745f380ac6e3]*/
+
+#include "clinic/multiprocessing.c.h"
+
+/*
+ * Function which raises exceptions based on error codes
+ */
+
+PyObject *
+_PyMp_SetError(PyObject *Type, int num)
+{
+ switch (num) {
+#ifdef MS_WINDOWS
+ case MP_STANDARD_ERROR:
+ if (Type == NULL)
+ Type = PyExc_OSError;
+ PyErr_SetExcFromWindowsErr(Type, 0);
+ break;
+ case MP_SOCKET_ERROR:
+ if (Type == NULL)
+ Type = PyExc_OSError;
+ PyErr_SetExcFromWindowsErr(Type, WSAGetLastError());
+ break;
+#else /* !MS_WINDOWS */
+ case MP_STANDARD_ERROR:
+ case MP_SOCKET_ERROR:
+ if (Type == NULL)
+ Type = PyExc_OSError;
+ PyErr_SetFromErrno(Type);
+ break;
+#endif /* !MS_WINDOWS */
+ case MP_MEMORY_ERROR:
+ PyErr_NoMemory();
+ break;
+ case MP_EXCEPTION_HAS_BEEN_SET:
+ break;
+ default:
+ PyErr_Format(PyExc_RuntimeError,
+ "unknown error number %d", num);
+ }
+ return NULL;
+}
+
+#ifdef MS_WINDOWS
+/*[clinic input]
+_multiprocessing.closesocket
+
+ handle: HANDLE
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_closesocket_impl(PyObject *module, HANDLE handle)
+/*[clinic end generated code: output=214f359f900966f4 input=8a20706dd386c6cc]*/
+{
+ int ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = closesocket((SOCKET) handle);
+ Py_END_ALLOW_THREADS
+
+ if (ret)
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_multiprocessing.recv
+
+ handle: HANDLE
+ size: int
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_recv_impl(PyObject *module, HANDLE handle, int size)
+/*[clinic end generated code: output=92322781ba9ff598 input=6a5b0834372cee5b]*/
+{
+ int nread;
+ PyObject *buf;
+
+ buf = PyBytes_FromStringAndSize(NULL, size);
+ if (!buf)
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ nread = recv((SOCKET) handle, PyBytes_AS_STRING(buf), size, 0);
+ Py_END_ALLOW_THREADS
+
+ if (nread < 0) {
+ Py_DECREF(buf);
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+ }
+ _PyBytes_Resize(&buf, nread);
+ return buf;
+}
+
+/*[clinic input]
+_multiprocessing.send
+
+ handle: HANDLE
+ buf: Py_buffer
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_send_impl(PyObject *module, HANDLE handle, Py_buffer *buf)
+/*[clinic end generated code: output=52d7df0519c596cb input=41dce742f98d2210]*/
+{
+ int ret, length;
+
+ length = (int)Py_MIN(buf->len, INT_MAX);
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = send((SOCKET) handle, buf->buf, length, 0);
+ Py_END_ALLOW_THREADS
+
+ if (ret < 0)
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+ return PyLong_FromLong(ret);
+}
+
+#endif
+
+/*[clinic input]
+_multiprocessing.sem_unlink
+
+ name: str
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_sem_unlink_impl(PyObject *module, const char *name)
+/*[clinic end generated code: output=fcbfeb1ed255e647 input=bf939aff9564f1d5]*/
+{
+ return _PyMp_sem_unlink(name);
+}
+
+/*
+ * Function table
+ */
+
+static PyMethodDef module_methods[] = {
+#ifdef MS_WINDOWS
+ _MULTIPROCESSING_CLOSESOCKET_METHODDEF
+ _MULTIPROCESSING_RECV_METHODDEF
+ _MULTIPROCESSING_SEND_METHODDEF
+#endif
+#if !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__)
+ _MULTIPROCESSING_SEM_UNLINK_METHODDEF
+#endif
+ {NULL}
+};
+
+
+/*
+ * Initialize
+ */
+
+static int
+multiprocessing_exec(PyObject *module)
+{
+#ifdef HAVE_MP_SEMAPHORE
+
+ PyTypeObject *semlock_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &_PyMp_SemLockType_spec, NULL);
+
+ if (semlock_type == NULL) {
+ return -1;
+ }
+ int rc = PyModule_AddType(module, semlock_type);
+ Py_DECREF(semlock_type);
+ if (rc < 0) {
+ return -1;
+ }
+
+ PyObject *py_sem_value_max;
+ /* Some systems define SEM_VALUE_MAX as an unsigned value that
+ * causes it to be negative when used as an int (NetBSD).
+ *
+ * Issue #28152: Use (0) instead of 0 to fix a warning on dead code
+ * when using clang -Wunreachable-code. */
+ if ((int)(SEM_VALUE_MAX) < (0)) {
+ py_sem_value_max = PyLong_FromLong(INT_MAX);
+ }
+ else {
+ py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX);
+ }
+ if (py_sem_value_max == NULL) {
+ return -1;
+ }
+ if (PyDict_SetItemString(semlock_type->tp_dict, "SEM_VALUE_MAX",
+ py_sem_value_max) < 0) {
+ Py_DECREF(py_sem_value_max);
+ return -1;
+ }
+ Py_DECREF(py_sem_value_max);
+
+#endif
+
+ /* Add configuration macros */
+ PyObject *flags = PyDict_New();
+ if (!flags) {
+ return -1;
+ }
+
+#define ADD_FLAG(name) \
+ do { \
+ PyObject *value = PyLong_FromLong(name); \
+ if (value == NULL) { \
+ Py_DECREF(flags); \
+ return -1; \
+ } \
+ if (PyDict_SetItemString(flags, #name, value) < 0) { \
+ Py_DECREF(flags); \
+ Py_DECREF(value); \
+ return -1; \
+ } \
+ Py_DECREF(value); \
+ } while (0)
+
+#if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
+ ADD_FLAG(HAVE_SEM_OPEN);
+#endif
+#ifdef HAVE_SEM_TIMEDWAIT
+ ADD_FLAG(HAVE_SEM_TIMEDWAIT);
+#endif
+#ifdef HAVE_BROKEN_SEM_GETVALUE
+ ADD_FLAG(HAVE_BROKEN_SEM_GETVALUE);
+#endif
+#ifdef HAVE_BROKEN_SEM_UNLINK
+ ADD_FLAG(HAVE_BROKEN_SEM_UNLINK);
+#endif
+
+ if (PyModule_AddObject(module, "flags", flags) < 0) {
+ Py_DECREF(flags);
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot multiprocessing_slots[] = {
+ {Py_mod_exec, multiprocessing_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef multiprocessing_module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_multiprocessing",
+ .m_size = 0,
+ .m_methods = module_methods,
+ .m_slots = multiprocessing_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__multiprocessing(void)
+{
+ return PyModuleDef_Init(&multiprocessing_module);
+}
diff --git a/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h
new file mode 100644
index 00000000000..dfc2a8e0799
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/multiprocessing.h
@@ -0,0 +1,97 @@
+#ifndef MULTIPROCESSING_H
+#define MULTIPROCESSING_H
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "structmember.h"
+#include "pythread.h"
+
+/*
+ * Platform includes and definitions
+ */
+
+#ifdef MS_WINDOWS
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <winsock2.h>
+# include <process.h> /* getpid() */
+# ifdef Py_DEBUG
+# include <crtdbg.h>
+# endif
+# define SEM_HANDLE HANDLE
+# define SEM_VALUE_MAX LONG_MAX
+# define HAVE_MP_SEMAPHORE
+#else
+# include <fcntl.h> /* O_CREAT and O_EXCL */
+# if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
+# define HAVE_MP_SEMAPHORE
+# include <semaphore.h>
+ typedef sem_t *SEM_HANDLE;
+# endif
+#endif
+
+/*
+ * Issue 3110 - Solaris does not define SEM_VALUE_MAX
+ */
+#ifndef SEM_VALUE_MAX
+ #if defined(HAVE_SYSCONF) && defined(_SC_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX sysconf(_SC_SEM_VALUE_MAX)
+ #elif defined(_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX _SEM_VALUE_MAX
+ #elif defined(_POSIX_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX
+ #else
+ # define SEM_VALUE_MAX INT_MAX
+ #endif
+#endif
+
+
+/*
+ * Format codes
+ */
+
+#if SIZEOF_VOID_P == SIZEOF_LONG
+# define F_POINTER "k"
+# define T_POINTER T_ULONG
+#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
+# define F_POINTER "K"
+# define T_POINTER T_ULONGLONG
+#else
+# error "can't find format code for unsigned integer of same size as void*"
+#endif
+
+#ifdef MS_WINDOWS
+# define F_HANDLE F_POINTER
+# define T_HANDLE T_POINTER
+# define F_SEM_HANDLE F_HANDLE
+# define T_SEM_HANDLE T_HANDLE
+#else
+# define F_HANDLE "i"
+# define T_HANDLE T_INT
+# define F_SEM_HANDLE F_POINTER
+# define T_SEM_HANDLE T_POINTER
+#endif
+
+/*
+ * Error codes which can be returned by functions called without GIL
+ */
+
+#define MP_SUCCESS (0)
+#define MP_STANDARD_ERROR (-1)
+#define MP_MEMORY_ERROR (-1001)
+#define MP_SOCKET_ERROR (-1002)
+#define MP_EXCEPTION_HAS_BEEN_SET (-1003)
+
+PyObject *_PyMp_SetError(PyObject *Type, int num);
+
+/*
+ * Externs - not all will really exist on all platforms
+ */
+
+extern PyType_Spec _PyMp_SemLockType_spec;
+extern PyObject *_PyMp_sem_unlink(const char *name);
+
+#endif /* MULTIPROCESSING_H */
diff --git a/contrib/tools/python3/Modules/_multiprocessing/posixshmem.c b/contrib/tools/python3/Modules/_multiprocessing/posixshmem.c
new file mode 100644
index 00000000000..88c93fe3137
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/posixshmem.c
@@ -0,0 +1,133 @@
+/*
+posixshmem - A Python extension that provides shm_open() and shm_unlink()
+*/
+
+#define PY_SSIZE_T_CLEAN
+
+#include <Python.h>
+
+// for shm_open() and shm_unlink()
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+/*[clinic input]
+module _posixshmem
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=a416734e49164bf8]*/
+
+/*
+ *
+ * Module-level functions & meta stuff
+ *
+ */
+
+#ifdef HAVE_SHM_OPEN
+/*[clinic input]
+_posixshmem.shm_open -> int
+ path: unicode
+ flags: int
+ mode: int = 0o777
+
+# "shm_open(path, flags, mode=0o777)\n\n\
+
+Open a shared memory object. Returns a file descriptor (integer).
+
+[clinic start generated code]*/
+
+static int
+_posixshmem_shm_open_impl(PyObject *module, PyObject *path, int flags,
+ int mode)
+/*[clinic end generated code: output=8d110171a4fa20df input=e83b58fa802fac25]*/
+{
+ int fd;
+ int async_err = 0;
+ const char *name = PyUnicode_AsUTF8(path);
+ if (name == NULL) {
+ return -1;
+ }
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ fd = shm_open(name, flags, mode);
+ Py_END_ALLOW_THREADS
+ } while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (fd < 0) {
+ if (!async_err)
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path);
+ return -1;
+ }
+
+ return fd;
+}
+#endif /* HAVE_SHM_OPEN */
+
+#ifdef HAVE_SHM_UNLINK
+/*[clinic input]
+_posixshmem.shm_unlink
+ path: unicode
+
+Remove a shared memory object (similar to unlink()).
+
+Remove a shared memory object name, and, once all processes have unmapped
+the object, de-allocates and destroys the contents of the associated memory
+region.
+
+[clinic start generated code]*/
+
+static PyObject *
+_posixshmem_shm_unlink_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=42f8b23d134b9ff5 input=8dc0f87143e3b300]*/
+{
+ int rv;
+ int async_err = 0;
+ const char *name = PyUnicode_AsUTF8(path);
+ if (name == NULL) {
+ return NULL;
+ }
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ rv = shm_unlink(name);
+ Py_END_ALLOW_THREADS
+ } while (rv < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (rv < 0) {
+ if (!async_err)
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SHM_UNLINK */
+
+#include "clinic/posixshmem.c.h"
+
+static PyMethodDef module_methods[ ] = {
+ _POSIXSHMEM_SHM_OPEN_METHODDEF
+ _POSIXSHMEM_SHM_UNLINK_METHODDEF
+ {NULL} /* Sentinel */
+};
+
+
+static PyModuleDef_Slot module_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+
+static struct PyModuleDef _posixshmemmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_posixshmem",
+ .m_doc = "POSIX shared memory module",
+ .m_size = 0,
+ .m_methods = module_methods,
+ .m_slots = module_slots,
+};
+
+/* Module init function */
+PyMODINIT_FUNC
+PyInit__posixshmem(void)
+{
+ return PyModuleDef_Init(&_posixshmemmodule);
+}
diff --git a/contrib/tools/python3/Modules/_multiprocessing/semaphore.c b/contrib/tools/python3/Modules/_multiprocessing/semaphore.c
new file mode 100644
index 00000000000..c7df82dfe2d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_multiprocessing/semaphore.c
@@ -0,0 +1,790 @@
+/*
+ * A type which wraps a semaphore
+ *
+ * semaphore.c
+ *
+ * Copyright (c) 2006-2008, R Oudkerk
+ * Licensed to PSF under a Contributor Agreement.
+ */
+
+#include "multiprocessing.h"
+
+#ifdef HAVE_MP_SEMAPHORE
+
+enum { RECURSIVE_MUTEX, SEMAPHORE };
+
+typedef struct {
+ PyObject_HEAD
+ SEM_HANDLE handle;
+ unsigned long last_tid;
+ int count;
+ int maxvalue;
+ int kind;
+ char *name;
+} SemLockObject;
+
+/*[python input]
+class SEM_HANDLE_converter(CConverter):
+ type = "SEM_HANDLE"
+ format_unit = '"F_SEM_HANDLE"'
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=3e0ad43e482d8716]*/
+
+/*[clinic input]
+module _multiprocessing
+class _multiprocessing.SemLock "SemLockObject *" "&_PyMp_SemLockType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=935fb41b7d032599]*/
+
+#include "clinic/semaphore.c.h"
+
+#define ISMINE(o) (o->count > 0 && PyThread_get_thread_ident() == o->last_tid)
+
+
+#ifdef MS_WINDOWS
+
+/*
+ * Windows definitions
+ */
+
+#define SEM_FAILED NULL
+
+#define SEM_CLEAR_ERROR() SetLastError(0)
+#define SEM_GET_LAST_ERROR() GetLastError()
+#define SEM_CREATE(name, val, max) CreateSemaphore(NULL, val, max, NULL)
+#define SEM_CLOSE(sem) (CloseHandle(sem) ? 0 : -1)
+#define SEM_GETVALUE(sem, pval) _GetSemaphoreValue(sem, pval)
+#define SEM_UNLINK(name) 0
+
+static int
+_GetSemaphoreValue(HANDLE handle, long *value)
+{
+ long previous;
+
+ switch (WaitForSingleObjectEx(handle, 0, FALSE)) {
+ case WAIT_OBJECT_0:
+ if (!ReleaseSemaphore(handle, 1, &previous))
+ return MP_STANDARD_ERROR;
+ *value = previous + 1;
+ return 0;
+ case WAIT_TIMEOUT:
+ *value = 0;
+ return 0;
+ default:
+ return MP_STANDARD_ERROR;
+ }
+}
+
+/*[clinic input]
+_multiprocessing.SemLock.acquire
+
+ block as blocking: bool = True
+ timeout as timeout_obj: object = None
+
+Acquire the semaphore/lock.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking,
+ PyObject *timeout_obj)
+/*[clinic end generated code: output=f9998f0b6b0b0872 input=e5b45f5cbb775166]*/
+{
+ double timeout;
+ DWORD res, full_msecs, nhandles;
+ HANDLE handles[2], sigint_event;
+
+ /* calculate timeout */
+ if (!blocking) {
+ full_msecs = 0;
+ } else if (timeout_obj == Py_None) {
+ full_msecs = INFINITE;
+ } else {
+ timeout = PyFloat_AsDouble(timeout_obj);
+ if (PyErr_Occurred())
+ return NULL;
+ timeout *= 1000.0; /* convert to millisecs */
+ if (timeout < 0.0) {
+ timeout = 0.0;
+ } else if (timeout >= 0.5 * INFINITE) { /* 25 days */
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout is too large");
+ return NULL;
+ }
+ full_msecs = (DWORD)(timeout + 0.5);
+ }
+
+ /* check whether we already own the lock */
+ if (self->kind == RECURSIVE_MUTEX && ISMINE(self)) {
+ ++self->count;
+ Py_RETURN_TRUE;
+ }
+
+ /* check whether we can acquire without releasing the GIL and blocking */
+ if (WaitForSingleObjectEx(self->handle, 0, FALSE) == WAIT_OBJECT_0) {
+ self->last_tid = GetCurrentThreadId();
+ ++self->count;
+ Py_RETURN_TRUE;
+ }
+
+ /* prepare list of handles */
+ nhandles = 0;
+ handles[nhandles++] = self->handle;
+ if (_PyOS_IsMainThread()) {
+ sigint_event = _PyOS_SigintEvent();
+ assert(sigint_event != NULL);
+ handles[nhandles++] = sigint_event;
+ }
+ else {
+ sigint_event = NULL;
+ }
+
+ /* do the wait */
+ Py_BEGIN_ALLOW_THREADS
+ if (sigint_event != NULL)
+ ResetEvent(sigint_event);
+ res = WaitForMultipleObjectsEx(nhandles, handles, FALSE, full_msecs, FALSE);
+ Py_END_ALLOW_THREADS
+
+ /* handle result */
+ switch (res) {
+ case WAIT_TIMEOUT:
+ Py_RETURN_FALSE;
+ case WAIT_OBJECT_0 + 0:
+ self->last_tid = GetCurrentThreadId();
+ ++self->count;
+ Py_RETURN_TRUE;
+ case WAIT_OBJECT_0 + 1:
+ errno = EINTR;
+ return PyErr_SetFromErrno(PyExc_OSError);
+ case WAIT_FAILED:
+ return PyErr_SetFromWindowsErr(0);
+ default:
+ PyErr_Format(PyExc_RuntimeError, "WaitForSingleObject() or "
+ "WaitForMultipleObjects() gave unrecognized "
+ "value %u", res);
+ return NULL;
+ }
+}
+
+/*[clinic input]
+_multiprocessing.SemLock.release
+
+Release the semaphore/lock.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock_release_impl(SemLockObject *self)
+/*[clinic end generated code: output=b22f53ba96b0d1db input=ba7e63a961885d3d]*/
+{
+ if (self->kind == RECURSIVE_MUTEX) {
+ if (!ISMINE(self)) {
+ PyErr_SetString(PyExc_AssertionError, "attempt to "
+ "release recursive lock not owned "
+ "by thread");
+ return NULL;
+ }
+ if (self->count > 1) {
+ --self->count;
+ Py_RETURN_NONE;
+ }
+ assert(self->count == 1);
+ }
+
+ if (!ReleaseSemaphore(self->handle, 1, NULL)) {
+ if (GetLastError() == ERROR_TOO_MANY_POSTS) {
+ PyErr_SetString(PyExc_ValueError, "semaphore or lock "
+ "released too many times");
+ return NULL;
+ } else {
+ return PyErr_SetFromWindowsErr(0);
+ }
+ }
+
+ --self->count;
+ Py_RETURN_NONE;
+}
+
+#else /* !MS_WINDOWS */
+
+/*
+ * Unix definitions
+ */
+
+#define SEM_CLEAR_ERROR()
+#define SEM_GET_LAST_ERROR() 0
+#define SEM_CREATE(name, val, max) sem_open(name, O_CREAT | O_EXCL, 0600, val)
+#define SEM_CLOSE(sem) sem_close(sem)
+#define SEM_GETVALUE(sem, pval) sem_getvalue(sem, pval)
+#define SEM_UNLINK(name) sem_unlink(name)
+
+/* OS X 10.4 defines SEM_FAILED as -1 instead of (sem_t *)-1; this gives
+ compiler warnings, and (potentially) undefined behaviour. */
+#ifdef __APPLE__
+# undef SEM_FAILED
+# define SEM_FAILED ((sem_t *)-1)
+#endif
+
+#ifndef HAVE_SEM_UNLINK
+# define sem_unlink(name) 0
+#endif
+
+#ifndef HAVE_SEM_TIMEDWAIT
+# define sem_timedwait(sem,deadline) sem_timedwait_save(sem,deadline,_save)
+
+static int
+sem_timedwait_save(sem_t *sem, struct timespec *deadline, PyThreadState *_save)
+{
+ int res;
+ unsigned long delay, difference;
+ struct timeval now, tvdeadline, tvdelay;
+
+ errno = 0;
+ tvdeadline.tv_sec = deadline->tv_sec;
+ tvdeadline.tv_usec = deadline->tv_nsec / 1000;
+
+ for (delay = 0 ; ; delay += 1000) {
+ /* poll */
+ if (sem_trywait(sem) == 0)
+ return 0;
+ else if (errno != EAGAIN)
+ return MP_STANDARD_ERROR;
+
+ /* get current time */
+ if (gettimeofday(&now, NULL) < 0)
+ return MP_STANDARD_ERROR;
+
+ /* check for timeout */
+ if (tvdeadline.tv_sec < now.tv_sec ||
+ (tvdeadline.tv_sec == now.tv_sec &&
+ tvdeadline.tv_usec <= now.tv_usec)) {
+ errno = ETIMEDOUT;
+ return MP_STANDARD_ERROR;
+ }
+
+ /* calculate how much time is left */
+ difference = (tvdeadline.tv_sec - now.tv_sec) * 1000000 +
+ (tvdeadline.tv_usec - now.tv_usec);
+
+ /* check delay not too long -- maximum is 20 msecs */
+ if (delay > 20000)
+ delay = 20000;
+ if (delay > difference)
+ delay = difference;
+
+ /* sleep */
+ tvdelay.tv_sec = delay / 1000000;
+ tvdelay.tv_usec = delay % 1000000;
+ if (select(0, NULL, NULL, NULL, &tvdelay) < 0)
+ return MP_STANDARD_ERROR;
+
+ /* check for signals */
+ Py_BLOCK_THREADS
+ res = PyErr_CheckSignals();
+ Py_UNBLOCK_THREADS
+
+ if (res) {
+ errno = EINTR;
+ return MP_EXCEPTION_HAS_BEEN_SET;
+ }
+ }
+}
+
+#endif /* !HAVE_SEM_TIMEDWAIT */
+
+/*[clinic input]
+_multiprocessing.SemLock.acquire
+
+ block as blocking: bool = True
+ timeout as timeout_obj: object = None
+
+Acquire the semaphore/lock.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking,
+ PyObject *timeout_obj)
+/*[clinic end generated code: output=f9998f0b6b0b0872 input=e5b45f5cbb775166]*/
+{
+ int res, err = 0;
+ struct timespec deadline = {0};
+
+ if (self->kind == RECURSIVE_MUTEX && ISMINE(self)) {
+ ++self->count;
+ Py_RETURN_TRUE;
+ }
+
+ int use_deadline = (timeout_obj != Py_None);
+ if (use_deadline) {
+ double timeout = PyFloat_AsDouble(timeout_obj);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ if (timeout < 0.0) {
+ timeout = 0.0;
+ }
+
+ struct timeval now;
+ if (gettimeofday(&now, NULL) < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ long sec = (long) timeout;
+ long nsec = (long) (1e9 * (timeout - sec) + 0.5);
+ deadline.tv_sec = now.tv_sec + sec;
+ deadline.tv_nsec = now.tv_usec * 1000 + nsec;
+ deadline.tv_sec += (deadline.tv_nsec / 1000000000);
+ deadline.tv_nsec %= 1000000000;
+ }
+
+ /* Check whether we can acquire without releasing the GIL and blocking */
+ do {
+ res = sem_trywait(self->handle);
+ err = errno;
+ } while (res < 0 && errno == EINTR && !PyErr_CheckSignals());
+ errno = err;
+
+ if (res < 0 && errno == EAGAIN && blocking) {
+ /* Couldn't acquire immediately, need to block */
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ if (!use_deadline) {
+ res = sem_wait(self->handle);
+ }
+ else {
+ res = sem_timedwait(self->handle, &deadline);
+ }
+ Py_END_ALLOW_THREADS
+ err = errno;
+ if (res == MP_EXCEPTION_HAS_BEEN_SET)
+ break;
+ } while (res < 0 && errno == EINTR && !PyErr_CheckSignals());
+ }
+
+ if (res < 0) {
+ errno = err;
+ if (errno == EAGAIN || errno == ETIMEDOUT)
+ Py_RETURN_FALSE;
+ else if (errno == EINTR)
+ return NULL;
+ else
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+
+ ++self->count;
+ self->last_tid = PyThread_get_thread_ident();
+
+ Py_RETURN_TRUE;
+}
+
+/*[clinic input]
+_multiprocessing.SemLock.release
+
+Release the semaphore/lock.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock_release_impl(SemLockObject *self)
+/*[clinic end generated code: output=b22f53ba96b0d1db input=ba7e63a961885d3d]*/
+{
+ if (self->kind == RECURSIVE_MUTEX) {
+ if (!ISMINE(self)) {
+ PyErr_SetString(PyExc_AssertionError, "attempt to "
+ "release recursive lock not owned "
+ "by thread");
+ return NULL;
+ }
+ if (self->count > 1) {
+ --self->count;
+ Py_RETURN_NONE;
+ }
+ assert(self->count == 1);
+ } else {
+#ifdef HAVE_BROKEN_SEM_GETVALUE
+ /* We will only check properly the maxvalue == 1 case */
+ if (self->maxvalue == 1) {
+ /* make sure that already locked */
+ if (sem_trywait(self->handle) < 0) {
+ if (errno != EAGAIN) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ /* it is already locked as expected */
+ } else {
+ /* it was not locked so undo wait and raise */
+ if (sem_post(self->handle) < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ PyErr_SetString(PyExc_ValueError, "semaphore "
+ "or lock released too many "
+ "times");
+ return NULL;
+ }
+ }
+#else
+ int sval;
+
+ /* This check is not an absolute guarantee that the semaphore
+ does not rise above maxvalue. */
+ if (sem_getvalue(self->handle, &sval) < 0) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ } else if (sval >= self->maxvalue) {
+ PyErr_SetString(PyExc_ValueError, "semaphore or lock "
+ "released too many times");
+ return NULL;
+ }
+#endif
+ }
+
+ if (sem_post(self->handle) < 0)
+ return PyErr_SetFromErrno(PyExc_OSError);
+
+ --self->count;
+ Py_RETURN_NONE;
+}
+
+#endif /* !MS_WINDOWS */
+
+/*
+ * All platforms
+ */
+
+static PyObject *
+newsemlockobject(PyTypeObject *type, SEM_HANDLE handle, int kind, int maxvalue,
+ char *name)
+{
+ SemLockObject *self = (SemLockObject *)type->tp_alloc(type, 0);
+ if (!self)
+ return NULL;
+ self->handle = handle;
+ self->kind = kind;
+ self->count = 0;
+ self->last_tid = 0;
+ self->maxvalue = maxvalue;
+ self->name = name;
+ return (PyObject*)self;
+}
+
+/*[clinic input]
+@classmethod
+_multiprocessing.SemLock.__new__
+
+ kind: int
+ value: int
+ maxvalue: int
+ name: str
+ unlink: bool
+
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock_impl(PyTypeObject *type, int kind, int value,
+ int maxvalue, const char *name, int unlink)
+/*[clinic end generated code: output=30727e38f5f7577a input=fdaeb69814471c5b]*/
+{
+ SEM_HANDLE handle = SEM_FAILED;
+ PyObject *result;
+ char *name_copy = NULL;
+
+ if (kind != RECURSIVE_MUTEX && kind != SEMAPHORE) {
+ PyErr_SetString(PyExc_ValueError, "unrecognized kind");
+ return NULL;
+ }
+
+ if (!unlink) {
+ name_copy = PyMem_Malloc(strlen(name) + 1);
+ if (name_copy == NULL) {
+ return PyErr_NoMemory();
+ }
+ strcpy(name_copy, name);
+ }
+
+ SEM_CLEAR_ERROR();
+ handle = SEM_CREATE(name, value, maxvalue);
+ /* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */
+ if (handle == SEM_FAILED || SEM_GET_LAST_ERROR() != 0)
+ goto failure;
+
+ if (unlink && SEM_UNLINK(name) < 0)
+ goto failure;
+
+ result = newsemlockobject(type, handle, kind, maxvalue, name_copy);
+ if (!result)
+ goto failure;
+
+ return result;
+
+ failure:
+ if (!PyErr_Occurred()) {
+ _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+ }
+ if (handle != SEM_FAILED)
+ SEM_CLOSE(handle);
+ PyMem_Free(name_copy);
+ return NULL;
+}
+
+/*[clinic input]
+@classmethod
+_multiprocessing.SemLock._rebuild
+
+ handle: SEM_HANDLE
+ kind: int
+ maxvalue: int
+ name: str(accept={str, NoneType})
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock__rebuild_impl(PyTypeObject *type, SEM_HANDLE handle,
+ int kind, int maxvalue,
+ const char *name)
+/*[clinic end generated code: output=2aaee14f063f3bd9 input=f7040492ac6d9962]*/
+{
+ char *name_copy = NULL;
+
+ if (name != NULL) {
+ name_copy = PyMem_Malloc(strlen(name) + 1);
+ if (name_copy == NULL)
+ return PyErr_NoMemory();
+ strcpy(name_copy, name);
+ }
+
+#ifndef MS_WINDOWS
+ if (name != NULL) {
+ handle = sem_open(name, 0);
+ if (handle == SEM_FAILED) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ PyMem_Free(name_copy);
+ return NULL;
+ }
+ }
+#endif
+
+ return newsemlockobject(type, handle, kind, maxvalue, name_copy);
+}
+
+static void
+semlock_dealloc(SemLockObject* self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ if (self->handle != SEM_FAILED)
+ SEM_CLOSE(self->handle);
+ PyMem_Free(self->name);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+_multiprocessing.SemLock._count
+
+Num of `acquire()`s minus num of `release()`s for this process.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock__count_impl(SemLockObject *self)
+/*[clinic end generated code: output=5ba8213900e517bb input=36fc59b1cd1025ab]*/
+{
+ return PyLong_FromLong((long)self->count);
+}
+
+/*[clinic input]
+_multiprocessing.SemLock._is_mine
+
+Whether the lock is owned by this thread.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock__is_mine_impl(SemLockObject *self)
+/*[clinic end generated code: output=92dc98863f4303be input=a96664cb2f0093ba]*/
+{
+ /* only makes sense for a lock */
+ return PyBool_FromLong(ISMINE(self));
+}
+
+/*[clinic input]
+_multiprocessing.SemLock._get_value
+
+Get the value of the semaphore.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock__get_value_impl(SemLockObject *self)
+/*[clinic end generated code: output=64bc1b89bda05e36 input=cb10f9a769836203]*/
+{
+#ifdef HAVE_BROKEN_SEM_GETVALUE
+ PyErr_SetNone(PyExc_NotImplementedError);
+ return NULL;
+#else
+ int sval;
+ if (SEM_GETVALUE(self->handle, &sval) < 0)
+ return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+ /* some posix implementations use negative numbers to indicate
+ the number of waiting threads */
+ if (sval < 0)
+ sval = 0;
+ return PyLong_FromLong((long)sval);
+#endif
+}
+
+/*[clinic input]
+_multiprocessing.SemLock._is_zero
+
+Return whether semaphore has value zero.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock__is_zero_impl(SemLockObject *self)
+/*[clinic end generated code: output=815d4c878c806ed7 input=294a446418d31347]*/
+{
+#ifdef HAVE_BROKEN_SEM_GETVALUE
+ if (sem_trywait(self->handle) < 0) {
+ if (errno == EAGAIN)
+ Py_RETURN_TRUE;
+ return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+ } else {
+ if (sem_post(self->handle) < 0)
+ return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+ Py_RETURN_FALSE;
+ }
+#else
+ int sval;
+ if (SEM_GETVALUE(self->handle, &sval) < 0)
+ return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+ return PyBool_FromLong((long)sval == 0);
+#endif
+}
+
+/*[clinic input]
+_multiprocessing.SemLock._after_fork
+
+Rezero the net acquisition count after fork().
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock__after_fork_impl(SemLockObject *self)
+/*[clinic end generated code: output=718bb27914c6a6c1 input=190991008a76621e]*/
+{
+ self->count = 0;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_multiprocessing.SemLock.__enter__
+
+Enter the semaphore/lock.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock___enter___impl(SemLockObject *self)
+/*[clinic end generated code: output=beeb2f07c858511f input=c5e27d594284690b]*/
+{
+ return _multiprocessing_SemLock_acquire_impl(self, 1, Py_None);
+}
+
+/*[clinic input]
+_multiprocessing.SemLock.__exit__
+
+ exc_type: object = None
+ exc_value: object = None
+ exc_tb: object = None
+ /
+
+Exit the semaphore/lock.
+[clinic start generated code]*/
+
+static PyObject *
+_multiprocessing_SemLock___exit___impl(SemLockObject *self,
+ PyObject *exc_type,
+ PyObject *exc_value, PyObject *exc_tb)
+/*[clinic end generated code: output=3b37c1a9f8b91a03 input=7d644b64a89903f8]*/
+{
+ return _multiprocessing_SemLock_release_impl(self);
+}
+
+static int
+semlock_traverse(SemLockObject *s, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(s));
+ return 0;
+}
+
+/*
+ * Semaphore methods
+ */
+
+static PyMethodDef semlock_methods[] = {
+ _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF
+ _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF
+ _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF
+ _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
+ _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF
+ _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF
+ _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF
+ _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF
+ _MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF
+ _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF
+ {NULL}
+};
+
+/*
+ * Member table
+ */
+
+static PyMemberDef semlock_members[] = {
+ {"handle", T_SEM_HANDLE, offsetof(SemLockObject, handle), READONLY,
+ ""},
+ {"kind", T_INT, offsetof(SemLockObject, kind), READONLY,
+ ""},
+ {"maxvalue", T_INT, offsetof(SemLockObject, maxvalue), READONLY,
+ ""},
+ {"name", T_STRING, offsetof(SemLockObject, name), READONLY,
+ ""},
+ {NULL}
+};
+
+/*
+ * Semaphore type
+ */
+
+static PyType_Slot _PyMp_SemLockType_slots[] = {
+ {Py_tp_dealloc, semlock_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_setattro, PyObject_GenericSetAttr},
+ {Py_tp_methods, semlock_methods},
+ {Py_tp_members, semlock_members},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, _multiprocessing_SemLock},
+ {Py_tp_traverse, semlock_traverse},
+ {Py_tp_free, PyObject_GC_Del},
+ {Py_tp_doc, (void *)PyDoc_STR("Semaphore/Mutex type")},
+ {0, 0},
+};
+
+PyType_Spec _PyMp_SemLockType_spec = {
+ .name = "_multiprocessing.SemLock",
+ .basicsize = sizeof(SemLockObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = _PyMp_SemLockType_slots,
+};
+
+/*
+ * Function to unlink semaphore names
+ */
+
+PyObject *
+_PyMp_sem_unlink(const char *name)
+{
+ if (SEM_UNLINK(name) < 0) {
+ _PyMp_SetError(NULL, MP_STANDARD_ERROR);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+#endif // HAVE_MP_SEMAPHORE
diff --git a/contrib/tools/python3/Modules/_opcode.c b/contrib/tools/python3/Modules/_opcode.c
new file mode 100644
index 00000000000..b70d426fa29
--- /dev/null
+++ b/contrib/tools/python3/Modules/_opcode.c
@@ -0,0 +1,115 @@
+#include "Python.h"
+#include "opcode.h"
+#include "internal/pycore_code.h"
+
+/*[clinic input]
+module _opcode
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=117442e66eb376e6]*/
+
+#include "clinic/_opcode.c.h"
+
+/*[clinic input]
+
+_opcode.stack_effect -> int
+
+ opcode: int
+ oparg: object = None
+ /
+ *
+ jump: object = None
+
+Compute the stack effect of the opcode.
+[clinic start generated code]*/
+
+static int
+_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg,
+ PyObject *jump)
+/*[clinic end generated code: output=64a18f2ead954dbb input=461c9d4a44851898]*/
+{
+ int effect;
+ int oparg_int = 0;
+ int jump_int;
+ if (HAS_ARG(opcode)) {
+ if (oparg == Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "stack_effect: opcode requires oparg but oparg was not specified");
+ return -1;
+ }
+ oparg_int = (int)PyLong_AsLong(oparg);
+ if ((oparg_int == -1) && PyErr_Occurred()) {
+ return -1;
+ }
+ }
+ else if (oparg != Py_None) {
+ PyErr_SetString(PyExc_ValueError,
+ "stack_effect: opcode does not permit oparg but oparg was specified");
+ return -1;
+ }
+ if (jump == Py_None) {
+ jump_int = -1;
+ }
+ else if (jump == Py_True) {
+ jump_int = 1;
+ }
+ else if (jump == Py_False) {
+ jump_int = 0;
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "stack_effect: jump must be False, True or None");
+ return -1;
+ }
+ effect = PyCompile_OpcodeStackEffectWithJump(opcode, oparg_int, jump_int);
+ if (effect == PY_INVALID_STACK_EFFECT) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid opcode or oparg");
+ return -1;
+ }
+ return effect;
+}
+
+/*[clinic input]
+
+_opcode.get_specialization_stats
+
+Return the specialization stats
+[clinic start generated code]*/
+
+static PyObject *
+_opcode_get_specialization_stats_impl(PyObject *module)
+/*[clinic end generated code: output=fcbc32fdfbec5c17 input=e1f60db68d8ce5f6]*/
+{
+#ifdef Py_STATS
+ return _Py_GetSpecializationStats();
+#else
+ Py_RETURN_NONE;
+#endif
+}
+
+static PyMethodDef
+opcode_functions[] = {
+ _OPCODE_STACK_EFFECT_METHODDEF
+ _OPCODE_GET_SPECIALIZATION_STATS_METHODDEF
+ {NULL, NULL, 0, NULL}
+};
+
+static PyModuleDef_Slot module_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef opcodemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_opcode",
+ .m_doc = "Opcode support module.",
+ .m_size = 0,
+ .m_methods = opcode_functions,
+ .m_slots = module_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__opcode(void)
+{
+ return PyModuleDef_Init(&opcodemodule);
+}
diff --git a/contrib/tools/python3/Modules/_operator.c b/contrib/tools/python3/Modules/_operator.c
new file mode 100644
index 00000000000..68ccc90562d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_operator.c
@@ -0,0 +1,1877 @@
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "structmember.h" // PyMemberDef
+#include "pycore_runtime.h" // _Py_ID()
+#include "clinic/_operator.c.h"
+
+typedef struct {
+ PyObject *itemgetter_type;
+ PyObject *attrgetter_type;
+ PyObject *methodcaller_type;
+} _operator_state;
+
+static inline _operator_state*
+get_operator_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_operator_state *)state;
+}
+
+/*[clinic input]
+module _operator
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=672ecf48487521e7]*/
+
+PyDoc_STRVAR(operator_doc,
+"Operator interface.\n\
+\n\
+This module exports a set of functions implemented in C corresponding\n\
+to the intrinsic operators of Python. For example, operator.add(x, y)\n\
+is equivalent to the expression x+y. The function names are those\n\
+used for special methods; variants without leading and trailing\n\
+'__' are also provided for convenience.");
+
+
+/*[clinic input]
+_operator.truth -> bool
+
+ a: object
+ /
+
+Return True if a is true, False otherwise.
+[clinic start generated code]*/
+
+static int
+_operator_truth_impl(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=eaf87767234fa5d7 input=bc74a4cd90235875]*/
+{
+ return PyObject_IsTrue(a);
+}
+
+/*[clinic input]
+_operator.add
+
+ a: object
+ b: object
+ /
+
+Same as a + b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_add_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=8292984204f45164 input=5efe3bff856ac215]*/
+{
+ return PyNumber_Add(a, b);
+}
+
+/*[clinic input]
+_operator.sub = _operator.add
+
+Same as a - b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_sub_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4adfc3b888c1ee2e input=6494c6b100b8e795]*/
+{
+ return PyNumber_Subtract(a, b);
+}
+
+/*[clinic input]
+_operator.mul = _operator.add
+
+Same as a * b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_mul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=d24d66f55a01944c input=2368615b4358b70d]*/
+{
+ return PyNumber_Multiply(a, b);
+}
+
+/*[clinic input]
+_operator.matmul = _operator.add
+
+Same as a @ b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_matmul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=a20d917eb35d0101 input=9ab304e37fb42dd4]*/
+{
+ return PyNumber_MatrixMultiply(a, b);
+}
+
+/*[clinic input]
+_operator.floordiv = _operator.add
+
+Same as a // b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_floordiv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=df26b71a60589f99 input=bb2e88ba446c612c]*/
+{
+ return PyNumber_FloorDivide(a, b);
+}
+
+/*[clinic input]
+_operator.truediv = _operator.add
+
+Same as a / b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_truediv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=0e6a959944d77719 input=ecbb947673f4eb1f]*/
+{
+ return PyNumber_TrueDivide(a, b);
+}
+
+/*[clinic input]
+_operator.mod = _operator.add
+
+Same as a % b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_mod_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=9519822f0bbec166 input=102e19b422342ac1]*/
+{
+ return PyNumber_Remainder(a, b);
+}
+
+/*[clinic input]
+_operator.neg
+
+ a: object
+ /
+
+Same as -a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_neg(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=36e08ecfc6a1c08c input=84f09bdcf27c96ec]*/
+{
+ return PyNumber_Negative(a);
+}
+
+/*[clinic input]
+_operator.pos = _operator.neg
+
+Same as +a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_pos(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=dad7a126221dd091 input=b6445b63fddb8772]*/
+{
+ return PyNumber_Positive(a);
+}
+
+/*[clinic input]
+_operator.abs = _operator.neg
+
+Same as abs(a).
+[clinic start generated code]*/
+
+static PyObject *
+_operator_abs(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=1389a93ba053ea3e input=341d07ba86f58039]*/
+{
+ return PyNumber_Absolute(a);
+}
+
+/*[clinic input]
+_operator.inv = _operator.neg
+
+Same as ~a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_inv(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=a56875ba075ee06d input=b01a4677739f6eb2]*/
+{
+ return PyNumber_Invert(a);
+}
+
+/*[clinic input]
+_operator.invert = _operator.neg
+
+Same as ~a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_invert(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=406b5aa030545fcc input=7f2d607176672e55]*/
+{
+ return PyNumber_Invert(a);
+}
+
+/*[clinic input]
+_operator.lshift = _operator.add
+
+Same as a << b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_lshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=37f7e52c41435bd8 input=746e8a160cbbc9eb]*/
+{
+ return PyNumber_Lshift(a, b);
+}
+
+/*[clinic input]
+_operator.rshift = _operator.add
+
+Same as a >> b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_rshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4593c7ef30ec2ee3 input=d2c85bb5a64504c2]*/
+{
+ return PyNumber_Rshift(a, b);
+}
+
+/*[clinic input]
+_operator.not_ = _operator.truth
+
+Same as not a.
+[clinic start generated code]*/
+
+static int
+_operator_not__impl(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=743f9c24a09759ef input=854156d50804d9b8]*/
+{
+ return PyObject_Not(a);
+}
+
+/*[clinic input]
+_operator.and_ = _operator.add
+
+Same as a & b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_and__impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=93c4fe88f7b76d9e input=4f3057c90ec4c99f]*/
+{
+ return PyNumber_And(a, b);
+}
+
+/*[clinic input]
+_operator.xor = _operator.add
+
+Same as a ^ b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_xor_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=b24cd8b79fde0004 input=3c5cfa7253d808dd]*/
+{
+ return PyNumber_Xor(a, b);
+}
+
+/*[clinic input]
+_operator.or_ = _operator.add
+
+Same as a | b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_or__impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=58024867b8d90461 input=b40c6c44f7c79c09]*/
+{
+ return PyNumber_Or(a, b);
+}
+
+/*[clinic input]
+_operator.iadd = _operator.add
+
+Same as a += b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_iadd_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=07dc627832526eb5 input=d22a91c07ac69227]*/
+{
+ return PyNumber_InPlaceAdd(a, b);
+}
+
+/*[clinic input]
+_operator.isub = _operator.add
+
+Same as a -= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_isub_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4513467d23b5e0b1 input=4591b00d0a0ccafd]*/
+{
+ return PyNumber_InPlaceSubtract(a, b);
+}
+
+/*[clinic input]
+_operator.imul = _operator.add
+
+Same as a *= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_imul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=5e87dacd19a71eab input=0e01fb8631e1b76f]*/
+{
+ return PyNumber_InPlaceMultiply(a, b);
+}
+
+/*[clinic input]
+_operator.imatmul = _operator.add
+
+Same as a @= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_imatmul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=d603cbdf716ce519 input=bb614026372cd542]*/
+{
+ return PyNumber_InPlaceMatrixMultiply(a, b);
+}
+
+/*[clinic input]
+_operator.ifloordiv = _operator.add
+
+Same as a //= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ifloordiv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=535336048c681794 input=9df3b5021cff4ca1]*/
+{
+ return PyNumber_InPlaceFloorDivide(a, b);
+}
+
+/*[clinic input]
+_operator.itruediv = _operator.add
+
+Same as a /= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_itruediv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=28017fbd3563952f input=9a1ee01608f5f590]*/
+{
+ return PyNumber_InPlaceTrueDivide(a, b);
+}
+
+/*[clinic input]
+_operator.imod = _operator.add
+
+Same as a %= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_imod_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=f7c540ae0fc70904 input=d0c384a3ce38e1dd]*/
+{
+ return PyNumber_InPlaceRemainder(a, b);
+}
+
+/*[clinic input]
+_operator.ilshift = _operator.add
+
+Same as a <<= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ilshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=e73a8fee1ac18749 input=e21b6b310f54572e]*/
+{
+ return PyNumber_InPlaceLshift(a, b);
+}
+
+/*[clinic input]
+_operator.irshift = _operator.add
+
+Same as a >>= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_irshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=97f2af6b5ff2ed81 input=6778dbd0f6e1ec16]*/
+{
+ return PyNumber_InPlaceRshift(a, b);
+}
+
+/*[clinic input]
+_operator.iand = _operator.add
+
+Same as a &= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_iand_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4599e9d40cbf7d00 input=71dfd8e70c156a7b]*/
+{
+ return PyNumber_InPlaceAnd(a, b);
+}
+
+/*[clinic input]
+_operator.ixor = _operator.add
+
+Same as a ^= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ixor_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=5ff881766872be03 input=695c32bec0604d86]*/
+{
+ return PyNumber_InPlaceXor(a, b);
+}
+
+/*[clinic input]
+_operator.ior = _operator.add
+
+Same as a |= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ior_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=48aac319445bf759 input=8f01d03eda9920cf]*/
+{
+ return PyNumber_InPlaceOr(a, b);
+}
+
+/*[clinic input]
+_operator.concat = _operator.add
+
+Same as a + b, for a and b sequences.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_concat_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=80028390942c5f11 input=8544ccd5341a3658]*/
+{
+ return PySequence_Concat(a, b);
+}
+
+/*[clinic input]
+_operator.iconcat = _operator.add
+
+Same as a += b, for a and b sequences.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_iconcat_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=3ea0a162ebb2e26d input=8f5fe5722fcd837e]*/
+{
+ return PySequence_InPlaceConcat(a, b);
+}
+
+/*[clinic input]
+_operator.contains -> bool
+
+ a: object
+ b: object
+ /
+
+Same as b in a (note reversed operands).
+[clinic start generated code]*/
+
+static int
+_operator_contains_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=413b4dbe82b6ffc1 input=9122a69b505fde13]*/
+{
+ return PySequence_Contains(a, b);
+}
+
+/*[clinic input]
+_operator.indexOf -> Py_ssize_t
+
+ a: object
+ b: object
+ /
+
+Return the first index of b in a.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_operator_indexOf_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=c6226d8e0fb60fa6 input=8be2e43b6a6fffe3]*/
+{
+ return PySequence_Index(a, b);
+}
+
+/*[clinic input]
+_operator.countOf = _operator.indexOf
+
+Return the number of items in a which are, or which equal, b.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_operator_countOf_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=9e1623197daf3382 input=93ea57f170f3f0bb]*/
+{
+ return PySequence_Count(a, b);
+}
+
+/*[clinic input]
+_operator.getitem
+
+ a: object
+ b: object
+ /
+
+Same as a[b].
+[clinic start generated code]*/
+
+static PyObject *
+_operator_getitem_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=6c8d8101a676e594 input=6682797320e48845]*/
+{
+ return PyObject_GetItem(a, b);
+}
+
+/*[clinic input]
+_operator.setitem
+
+ a: object
+ b: object
+ c: object
+ /
+
+Same as a[b] = c.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_setitem_impl(PyObject *module, PyObject *a, PyObject *b,
+ PyObject *c)
+/*[clinic end generated code: output=1324f9061ae99e25 input=ceaf453c4d3a58df]*/
+{
+ if (-1 == PyObject_SetItem(a, b, c))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_operator.delitem = _operator.getitem
+
+Same as del a[b].
+[clinic start generated code]*/
+
+static PyObject *
+_operator_delitem_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=db18f61506295799 input=991bec56a0d3ec7f]*/
+{
+ if (-1 == PyObject_DelItem(a, b))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_operator.eq
+
+ a: object
+ b: object
+ /
+
+Same as a == b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_eq_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=8d7d46ed4135677c input=586fca687a95a83f]*/
+{
+ return PyObject_RichCompare(a, b, Py_EQ);
+}
+
+/*[clinic input]
+_operator.ne = _operator.eq
+
+Same as a != b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ne_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=c99bd0c3a4c01297 input=5d88f23d35e9abac]*/
+{
+ return PyObject_RichCompare(a, b, Py_NE);
+}
+
+/*[clinic input]
+_operator.lt = _operator.eq
+
+Same as a < b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_lt_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=082d7c45c440e535 input=34a59ad6d39d3a2b]*/
+{
+ return PyObject_RichCompare(a, b, Py_LT);
+}
+
+/*[clinic input]
+_operator.le = _operator.eq
+
+Same as a <= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_le_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=00970a2923d0ae17 input=b812a7860a0bef44]*/
+{
+ return PyObject_RichCompare(a, b, Py_LE);
+}
+
+/*[clinic input]
+_operator.gt = _operator.eq
+
+Same as a > b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_gt_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=8d373349ecf25641 input=9bdb45b995ada35b]*/
+{
+ return PyObject_RichCompare(a, b, Py_GT);
+}
+
+/*[clinic input]
+_operator.ge = _operator.eq
+
+Same as a >= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ge_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=7ce3882256d4b137 input=cf1dc4a5ca9c35f5]*/
+{
+ return PyObject_RichCompare(a, b, Py_GE);
+}
+
+/*[clinic input]
+_operator.pow = _operator.add
+
+Same as a ** b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_pow_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=09e668ad50036120 input=690b40f097ab1637]*/
+{
+ return PyNumber_Power(a, b, Py_None);
+}
+
+/*[clinic input]
+_operator.ipow = _operator.add
+
+Same as a **= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ipow_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=7189ff4d4367c808 input=f00623899d07499a]*/
+{
+ return PyNumber_InPlacePower(a, b, Py_None);
+}
+
+/*[clinic input]
+_operator.index
+
+ a: object
+ /
+
+Same as a.__index__()
+[clinic start generated code]*/
+
+static PyObject *
+_operator_index(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=d972b0764ac305fc input=6f54d50ea64a579c]*/
+{
+ return PyNumber_Index(a);
+}
+
+/*[clinic input]
+_operator.is_ = _operator.add
+
+Same as a is b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_is__impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=bcd47a402e482e1d input=5fa9b97df03c427f]*/
+{
+ PyObject *result = Py_Is(a, b) ? Py_True : Py_False;
+ return Py_NewRef(result);
+}
+
+/*[clinic input]
+_operator.is_not = _operator.add
+
+Same as a is not b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_is_not_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=491a1f2f81f6c7f9 input=5a93f7e1a93535f1]*/
+{
+ PyObject *result;
+ result = (a != b) ? Py_True : Py_False;
+ return Py_NewRef(result);
+}
+
+/* compare_digest **********************************************************/
+
+/*
+ * timing safe compare
+ *
+ * Returns 1 if the strings are equal.
+ * In case of len(a) != len(b) the function tries to keep the timing
+ * dependent on the length of b. CPU cache locality may still alter timing
+ * a bit.
+ */
+static int
+_tscmp(const unsigned char *a, const unsigned char *b,
+ Py_ssize_t len_a, Py_ssize_t len_b)
+{
+ /* The volatile type declarations make sure that the compiler has no
+ * chance to optimize and fold the code in any way that may change
+ * the timing.
+ */
+ volatile Py_ssize_t length;
+ volatile const unsigned char *left;
+ volatile const unsigned char *right;
+ Py_ssize_t i;
+ volatile unsigned char result;
+
+ /* loop count depends on length of b */
+ length = len_b;
+ left = NULL;
+ right = b;
+
+ /* don't use else here to keep the amount of CPU instructions constant,
+ * volatile forces re-evaluation
+ * */
+ if (len_a == length) {
+ left = *((volatile const unsigned char**)&a);
+ result = 0;
+ }
+ if (len_a != length) {
+ left = b;
+ result = 1;
+ }
+
+ for (i=0; i < length; i++) {
+ result |= *left++ ^ *right++;
+ }
+
+ return (result == 0);
+}
+
+/*[clinic input]
+_operator.length_hint -> Py_ssize_t
+
+ obj: object
+ default: Py_ssize_t = 0
+ /
+
+Return an estimate of the number of items in obj.
+
+This is useful for presizing containers when building from an iterable.
+
+If the object supports len(), the result will be exact.
+Otherwise, it may over- or under-estimate by an arbitrary amount.
+The result will be an integer >= 0.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_operator_length_hint_impl(PyObject *module, PyObject *obj,
+ Py_ssize_t default_value)
+/*[clinic end generated code: output=01d469edc1d612ad input=65ed29f04401e96a]*/
+{
+ return PyObject_LengthHint(obj, default_value);
+}
+
+/* NOTE: Keep in sync with _hashopenssl.c implementation. */
+
+/*[clinic input]
+_operator._compare_digest = _operator.eq
+
+Return 'a == b'.
+
+This function uses an approach designed to prevent
+timing analysis, making it appropriate for cryptography.
+
+a and b must both be of the same type: either str (ASCII only),
+or any bytes-like object.
+
+Note: If a and b are of different lengths, or if an error occurs,
+a timing attack could theoretically reveal information about the
+types and lengths of a and b--but not their values.
+[clinic start generated code]*/
+
+static PyObject *
+_operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=11d452bdd3a23cbc input=9ac7e2c4e30bc356]*/
+{
+ int rc;
+
+ /* ASCII unicode string */
+ if(PyUnicode_Check(a) && PyUnicode_Check(b)) {
+ if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
+ return NULL;
+ }
+ if (!PyUnicode_IS_ASCII(a) || !PyUnicode_IS_ASCII(b)) {
+ PyErr_SetString(PyExc_TypeError,
+ "comparing strings with non-ASCII characters is "
+ "not supported");
+ return NULL;
+ }
+
+ rc = _tscmp(PyUnicode_DATA(a),
+ PyUnicode_DATA(b),
+ PyUnicode_GET_LENGTH(a),
+ PyUnicode_GET_LENGTH(b));
+ }
+ /* fallback to buffer interface for bytes, bytearray and other */
+ else {
+ Py_buffer view_a;
+ Py_buffer view_b;
+
+ if (PyObject_CheckBuffer(a) == 0 && PyObject_CheckBuffer(b) == 0) {
+ PyErr_Format(PyExc_TypeError,
+ "unsupported operand types(s) or combination of types: "
+ "'%.100s' and '%.100s'",
+ Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
+ return NULL;
+ }
+
+ if (PyObject_GetBuffer(a, &view_a, PyBUF_SIMPLE) == -1) {
+ return NULL;
+ }
+ if (view_a.ndim > 1) {
+ PyErr_SetString(PyExc_BufferError,
+ "Buffer must be single dimension");
+ PyBuffer_Release(&view_a);
+ return NULL;
+ }
+
+ if (PyObject_GetBuffer(b, &view_b, PyBUF_SIMPLE) == -1) {
+ PyBuffer_Release(&view_a);
+ return NULL;
+ }
+ if (view_b.ndim > 1) {
+ PyErr_SetString(PyExc_BufferError,
+ "Buffer must be single dimension");
+ PyBuffer_Release(&view_a);
+ PyBuffer_Release(&view_b);
+ return NULL;
+ }
+
+ rc = _tscmp((const unsigned char*)view_a.buf,
+ (const unsigned char*)view_b.buf,
+ view_a.len,
+ view_b.len);
+
+ PyBuffer_Release(&view_a);
+ PyBuffer_Release(&view_b);
+ }
+
+ return PyBool_FromLong(rc);
+}
+
+PyDoc_STRVAR(_operator_call__doc__,
+"call($module, obj, /, *args, **kwargs)\n"
+"--\n"
+"\n"
+"Same as obj(*args, **kwargs).");
+
+#define _OPERATOR_CALL_METHODDEF \
+ {"call", _PyCFunction_CAST(_operator_call), METH_FASTCALL | METH_KEYWORDS, _operator_call__doc__},
+
+static PyObject *
+_operator_call(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (!_PyArg_CheckPositional("call", nargs, 1, PY_SSIZE_T_MAX)) {
+ return NULL;
+ }
+ return PyObject_Vectorcall(
+ args[0],
+ &args[1], (PyVectorcall_NARGS(nargs) - 1) | PY_VECTORCALL_ARGUMENTS_OFFSET,
+ kwnames);
+}
+
+/* operator methods **********************************************************/
+
+static struct PyMethodDef operator_methods[] = {
+
+ _OPERATOR_TRUTH_METHODDEF
+ _OPERATOR_CONTAINS_METHODDEF
+ _OPERATOR_INDEXOF_METHODDEF
+ _OPERATOR_COUNTOF_METHODDEF
+ _OPERATOR_IS__METHODDEF
+ _OPERATOR_IS_NOT_METHODDEF
+ _OPERATOR_INDEX_METHODDEF
+ _OPERATOR_ADD_METHODDEF
+ _OPERATOR_SUB_METHODDEF
+ _OPERATOR_MUL_METHODDEF
+ _OPERATOR_MATMUL_METHODDEF
+ _OPERATOR_FLOORDIV_METHODDEF
+ _OPERATOR_TRUEDIV_METHODDEF
+ _OPERATOR_MOD_METHODDEF
+ _OPERATOR_NEG_METHODDEF
+ _OPERATOR_POS_METHODDEF
+ _OPERATOR_ABS_METHODDEF
+ _OPERATOR_INV_METHODDEF
+ _OPERATOR_INVERT_METHODDEF
+ _OPERATOR_LSHIFT_METHODDEF
+ _OPERATOR_RSHIFT_METHODDEF
+ _OPERATOR_NOT__METHODDEF
+ _OPERATOR_AND__METHODDEF
+ _OPERATOR_XOR_METHODDEF
+ _OPERATOR_OR__METHODDEF
+ _OPERATOR_IADD_METHODDEF
+ _OPERATOR_ISUB_METHODDEF
+ _OPERATOR_IMUL_METHODDEF
+ _OPERATOR_IMATMUL_METHODDEF
+ _OPERATOR_IFLOORDIV_METHODDEF
+ _OPERATOR_ITRUEDIV_METHODDEF
+ _OPERATOR_IMOD_METHODDEF
+ _OPERATOR_ILSHIFT_METHODDEF
+ _OPERATOR_IRSHIFT_METHODDEF
+ _OPERATOR_IAND_METHODDEF
+ _OPERATOR_IXOR_METHODDEF
+ _OPERATOR_IOR_METHODDEF
+ _OPERATOR_CONCAT_METHODDEF
+ _OPERATOR_ICONCAT_METHODDEF
+ _OPERATOR_GETITEM_METHODDEF
+ _OPERATOR_SETITEM_METHODDEF
+ _OPERATOR_DELITEM_METHODDEF
+ _OPERATOR_POW_METHODDEF
+ _OPERATOR_IPOW_METHODDEF
+ _OPERATOR_EQ_METHODDEF
+ _OPERATOR_NE_METHODDEF
+ _OPERATOR_LT_METHODDEF
+ _OPERATOR_LE_METHODDEF
+ _OPERATOR_GT_METHODDEF
+ _OPERATOR_GE_METHODDEF
+ _OPERATOR__COMPARE_DIGEST_METHODDEF
+ _OPERATOR_LENGTH_HINT_METHODDEF
+ _OPERATOR_CALL_METHODDEF
+ {NULL, NULL} /* sentinel */
+
+};
+
+/* itemgetter object **********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t nitems;
+ PyObject *item;
+ Py_ssize_t index; // -1 unless *item* is a single non-negative integer index
+ vectorcallfunc vectorcall;
+} itemgetterobject;
+
+// Forward declarations
+static PyObject *
+itemgetter_vectorcall(PyObject *, PyObject *const *, size_t, PyObject *);
+static PyObject *
+itemgetter_call_impl(itemgetterobject *, PyObject *);
+
+/* AC 3.5: treats first argument as an iterable, otherwise uses *args */
+static PyObject *
+itemgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ itemgetterobject *ig;
+ PyObject *item;
+ Py_ssize_t nitems;
+ Py_ssize_t index;
+
+ if (!_PyArg_NoKeywords("itemgetter", kwds))
+ return NULL;
+
+ nitems = PyTuple_GET_SIZE(args);
+ if (nitems <= 1) {
+ if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &item))
+ return NULL;
+ } else {
+ item = args;
+ }
+ _operator_state *state = _PyType_GetModuleState(type);
+ /* create itemgetterobject structure */
+ ig = PyObject_GC_New(itemgetterobject, (PyTypeObject *) state->itemgetter_type);
+ if (ig == NULL) {
+ return NULL;
+ }
+
+ ig->item = Py_NewRef(item);
+ ig->nitems = nitems;
+ ig->index = -1;
+ if (PyLong_CheckExact(item)) {
+ index = PyLong_AsSsize_t(item);
+ if (index < 0) {
+ /* If we get here, then either the index conversion failed
+ * due to being out of range, or the index was a negative
+ * integer. Either way, we clear any possible exception
+ * and fall back to the slow path, where ig->index is -1.
+ */
+ PyErr_Clear();
+ }
+ else {
+ ig->index = index;
+ }
+ }
+
+ ig->vectorcall = (vectorcallfunc)itemgetter_vectorcall;
+ PyObject_GC_Track(ig);
+ return (PyObject *)ig;
+}
+
+static int
+itemgetter_clear(itemgetterobject *ig)
+{
+ Py_CLEAR(ig->item);
+ return 0;
+}
+
+static void
+itemgetter_dealloc(itemgetterobject *ig)
+{
+ PyTypeObject *tp = Py_TYPE(ig);
+ PyObject_GC_UnTrack(ig);
+ (void)itemgetter_clear(ig);
+ tp->tp_free(ig);
+ Py_DECREF(tp);
+}
+
+static int
+itemgetter_traverse(itemgetterobject *ig, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(ig));
+ Py_VISIT(ig->item);
+ return 0;
+}
+
+static PyObject *
+itemgetter_call(itemgetterobject *ig, PyObject *args, PyObject *kw)
+{
+ assert(PyTuple_CheckExact(args));
+ if (!_PyArg_NoKeywords("itemgetter", kw))
+ return NULL;
+ if (!_PyArg_CheckPositional("itemgetter", PyTuple_GET_SIZE(args), 1, 1))
+ return NULL;
+ return itemgetter_call_impl(ig, PyTuple_GET_ITEM(args, 0));
+}
+
+static PyObject *
+itemgetter_vectorcall(PyObject *ig, PyObject *const *args,
+ size_t nargsf, PyObject *kwnames)
+{
+ if (!_PyArg_NoKwnames("itemgetter", kwnames)) {
+ return NULL;
+ }
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ if (!_PyArg_CheckPositional("itemgetter", nargs, 1, 1)) {
+ return NULL;
+ }
+ return itemgetter_call_impl((itemgetterobject *)ig, args[0]);
+}
+
+static PyObject *
+itemgetter_call_impl(itemgetterobject *ig, PyObject *obj)
+{
+ PyObject *result;
+ Py_ssize_t i, nitems=ig->nitems;
+ if (nitems == 1) {
+ if (ig->index >= 0
+ && PyTuple_CheckExact(obj)
+ && ig->index < PyTuple_GET_SIZE(obj))
+ {
+ result = PyTuple_GET_ITEM(obj, ig->index);
+ return Py_NewRef(result);
+ }
+ return PyObject_GetItem(obj, ig->item);
+ }
+
+ assert(PyTuple_Check(ig->item));
+ assert(PyTuple_GET_SIZE(ig->item) == nitems);
+
+ result = PyTuple_New(nitems);
+ if (result == NULL)
+ return NULL;
+
+ for (i=0 ; i < nitems ; i++) {
+ PyObject *item, *val;
+ item = PyTuple_GET_ITEM(ig->item, i);
+ val = PyObject_GetItem(obj, item);
+ if (val == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(result, i, val);
+ }
+ return result;
+}
+
+static PyObject *
+itemgetter_repr(itemgetterobject *ig)
+{
+ PyObject *repr;
+ const char *reprfmt;
+
+ int status = Py_ReprEnter((PyObject *)ig);
+ if (status != 0) {
+ if (status < 0)
+ return NULL;
+ return PyUnicode_FromFormat("%s(...)", Py_TYPE(ig)->tp_name);
+ }
+
+ reprfmt = ig->nitems == 1 ? "%s(%R)" : "%s%R";
+ repr = PyUnicode_FromFormat(reprfmt, Py_TYPE(ig)->tp_name, ig->item);
+ Py_ReprLeave((PyObject *)ig);
+ return repr;
+}
+
+static PyObject *
+itemgetter_reduce(itemgetterobject *ig, PyObject *Py_UNUSED(ignored))
+{
+ if (ig->nitems == 1)
+ return Py_BuildValue("O(O)", Py_TYPE(ig), ig->item);
+ return PyTuple_Pack(2, Py_TYPE(ig), ig->item);
+}
+
+PyDoc_STRVAR(reduce_doc, "Return state information for pickling");
+
+static PyMethodDef itemgetter_methods[] = {
+ {"__reduce__", (PyCFunction)itemgetter_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL}
+};
+
+static PyMemberDef itemgetter_members[] = {
+ {"__vectorcalloffset__", T_PYSSIZET, offsetof(itemgetterobject, vectorcall), READONLY},
+ {NULL} /* Sentinel */
+};
+
+PyDoc_STRVAR(itemgetter_doc,
+"itemgetter(item, /, *items)\n--\n\n\
+Return a callable object that fetches the given item(s) from its operand.\n\
+After f = itemgetter(2), the call f(r) returns r[2].\n\
+After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])");
+
+static PyType_Slot itemgetter_type_slots[] = {
+ {Py_tp_doc, (void *)itemgetter_doc},
+ {Py_tp_dealloc, itemgetter_dealloc},
+ {Py_tp_call, itemgetter_call},
+ {Py_tp_traverse, itemgetter_traverse},
+ {Py_tp_clear, itemgetter_clear},
+ {Py_tp_methods, itemgetter_methods},
+ {Py_tp_members, itemgetter_members},
+ {Py_tp_new, itemgetter_new},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_repr, itemgetter_repr},
+ {0, 0}
+};
+
+static PyType_Spec itemgetter_type_spec = {
+ .name = "operator.itemgetter",
+ .basicsize = sizeof(itemgetterobject),
+ .itemsize = 0,
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_VECTORCALL),
+ .slots = itemgetter_type_slots,
+};
+
+/* attrgetter object **********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t nattrs;
+ PyObject *attr;
+ vectorcallfunc vectorcall;
+} attrgetterobject;
+
+// Forward declarations
+static PyObject *
+attrgetter_vectorcall(PyObject *, PyObject *const *, size_t, PyObject *);
+static PyObject *
+attrgetter_call_impl(attrgetterobject *, PyObject *);
+
+/* AC 3.5: treats first argument as an iterable, otherwise uses *args */
+static PyObject *
+attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ attrgetterobject *ag;
+ PyObject *attr;
+ Py_ssize_t nattrs, idx, char_idx;
+
+ if (!_PyArg_NoKeywords("attrgetter", kwds))
+ return NULL;
+
+ nattrs = PyTuple_GET_SIZE(args);
+ if (nattrs <= 1) {
+ if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &attr))
+ return NULL;
+ }
+
+ attr = PyTuple_New(nattrs);
+ if (attr == NULL)
+ return NULL;
+
+ /* prepare attr while checking args */
+ for (idx = 0; idx < nattrs; ++idx) {
+ PyObject *item = PyTuple_GET_ITEM(args, idx);
+ int dot_count;
+
+ if (!PyUnicode_Check(item)) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute name must be a string");
+ Py_DECREF(attr);
+ return NULL;
+ }
+ if (PyUnicode_READY(item)) {
+ Py_DECREF(attr);
+ return NULL;
+ }
+ Py_ssize_t item_len = PyUnicode_GET_LENGTH(item);
+ int kind = PyUnicode_KIND(item);
+ const void *data = PyUnicode_DATA(item);
+
+ /* check whether the string is dotted */
+ dot_count = 0;
+ for (char_idx = 0; char_idx < item_len; ++char_idx) {
+ if (PyUnicode_READ(kind, data, char_idx) == '.')
+ ++dot_count;
+ }
+
+ if (dot_count == 0) {
+ Py_INCREF(item);
+ PyUnicode_InternInPlace(&item);
+ PyTuple_SET_ITEM(attr, idx, item);
+ } else { /* make it a tuple of non-dotted attrnames */
+ PyObject *attr_chain = PyTuple_New(dot_count + 1);
+ PyObject *attr_chain_item;
+ Py_ssize_t unibuff_from = 0;
+ Py_ssize_t unibuff_till = 0;
+ Py_ssize_t attr_chain_idx = 0;
+
+ if (attr_chain == NULL) {
+ Py_DECREF(attr);
+ return NULL;
+ }
+
+ for (; dot_count > 0; --dot_count) {
+ while (PyUnicode_READ(kind, data, unibuff_till) != '.') {
+ ++unibuff_till;
+ }
+ attr_chain_item = PyUnicode_Substring(item,
+ unibuff_from,
+ unibuff_till);
+ if (attr_chain_item == NULL) {
+ Py_DECREF(attr_chain);
+ Py_DECREF(attr);
+ return NULL;
+ }
+ PyUnicode_InternInPlace(&attr_chain_item);
+ PyTuple_SET_ITEM(attr_chain, attr_chain_idx, attr_chain_item);
+ ++attr_chain_idx;
+ unibuff_till = unibuff_from = unibuff_till + 1;
+ }
+
+ /* now add the last dotless name */
+ attr_chain_item = PyUnicode_Substring(item,
+ unibuff_from, item_len);
+ if (attr_chain_item == NULL) {
+ Py_DECREF(attr_chain);
+ Py_DECREF(attr);
+ return NULL;
+ }
+ PyUnicode_InternInPlace(&attr_chain_item);
+ PyTuple_SET_ITEM(attr_chain, attr_chain_idx, attr_chain_item);
+
+ PyTuple_SET_ITEM(attr, idx, attr_chain);
+ }
+ }
+
+ _operator_state *state = _PyType_GetModuleState(type);
+ /* create attrgetterobject structure */
+ ag = PyObject_GC_New(attrgetterobject, (PyTypeObject *)state->attrgetter_type);
+ if (ag == NULL) {
+ Py_DECREF(attr);
+ return NULL;
+ }
+
+ ag->attr = attr;
+ ag->nattrs = nattrs;
+ ag->vectorcall = (vectorcallfunc)attrgetter_vectorcall;
+
+ PyObject_GC_Track(ag);
+ return (PyObject *)ag;
+}
+
+static int
+attrgetter_clear(attrgetterobject *ag)
+{
+ Py_CLEAR(ag->attr);
+ return 0;
+}
+
+static void
+attrgetter_dealloc(attrgetterobject *ag)
+{
+ PyTypeObject *tp = Py_TYPE(ag);
+ PyObject_GC_UnTrack(ag);
+ (void)attrgetter_clear(ag);
+ tp->tp_free(ag);
+ Py_DECREF(tp);
+}
+
+static int
+attrgetter_traverse(attrgetterobject *ag, visitproc visit, void *arg)
+{
+ Py_VISIT(ag->attr);
+ Py_VISIT(Py_TYPE(ag));
+ return 0;
+}
+
+static PyObject *
+dotted_getattr(PyObject *obj, PyObject *attr)
+{
+ PyObject *newobj;
+
+ /* attr is either a tuple or instance of str.
+ Ensured by the setup code of attrgetter_new */
+ if (PyTuple_CheckExact(attr)) { /* chained getattr */
+ Py_ssize_t name_idx = 0, name_count;
+ PyObject *attr_name;
+
+ name_count = PyTuple_GET_SIZE(attr);
+ Py_INCREF(obj);
+ for (name_idx = 0; name_idx < name_count; ++name_idx) {
+ attr_name = PyTuple_GET_ITEM(attr, name_idx);
+ newobj = PyObject_GetAttr(obj, attr_name);
+ Py_DECREF(obj);
+ if (newobj == NULL) {
+ return NULL;
+ }
+ /* here */
+ obj = newobj;
+ }
+ } else { /* single getattr */
+ newobj = PyObject_GetAttr(obj, attr);
+ if (newobj == NULL)
+ return NULL;
+ obj = newobj;
+ }
+
+ return obj;
+}
+
+static PyObject *
+attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw)
+{
+ if (!_PyArg_NoKeywords("attrgetter", kw))
+ return NULL;
+ if (!_PyArg_CheckPositional("attrgetter", PyTuple_GET_SIZE(args), 1, 1))
+ return NULL;
+ return attrgetter_call_impl(ag, PyTuple_GET_ITEM(args, 0));
+}
+
+static PyObject *
+attrgetter_vectorcall(PyObject *ag, PyObject *const *args, size_t nargsf, PyObject *kwnames)
+{
+ if (!_PyArg_NoKwnames("attrgetter", kwnames)) {
+ return NULL;
+ }
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ if (!_PyArg_CheckPositional("attrgetter", nargs, 1, 1)) {
+ return NULL;
+ }
+ return attrgetter_call_impl((attrgetterobject *)ag, args[0]);
+}
+
+static PyObject *
+attrgetter_call_impl(attrgetterobject *ag, PyObject *obj)
+{
+ PyObject *result;
+ Py_ssize_t i, nattrs=ag->nattrs;
+
+ if (ag->nattrs == 1) {
+ /* ag->attr is always a tuple */
+ return dotted_getattr(obj, PyTuple_GET_ITEM(ag->attr, 0));
+ }
+
+ assert(PyTuple_Check(ag->attr));
+ assert(PyTuple_GET_SIZE(ag->attr) == nattrs);
+
+ result = PyTuple_New(nattrs);
+ if (result == NULL)
+ return NULL;
+
+ for (i=0 ; i < nattrs ; i++) {
+ PyObject *attr, *val;
+ attr = PyTuple_GET_ITEM(ag->attr, i);
+ val = dotted_getattr(obj, attr);
+ if (val == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(result, i, val);
+ }
+ return result;
+}
+
+static PyObject *
+dotjoinattr(PyObject *attr, PyObject **attrsep)
+{
+ if (PyTuple_CheckExact(attr)) {
+ if (*attrsep == NULL) {
+ *attrsep = PyUnicode_FromString(".");
+ if (*attrsep == NULL)
+ return NULL;
+ }
+ return PyUnicode_Join(*attrsep, attr);
+ } else {
+ return Py_NewRef(attr);
+ }
+}
+
+static PyObject *
+attrgetter_args(attrgetterobject *ag)
+{
+ Py_ssize_t i;
+ PyObject *attrsep = NULL;
+ PyObject *attrstrings = PyTuple_New(ag->nattrs);
+ if (attrstrings == NULL)
+ return NULL;
+
+ for (i = 0; i < ag->nattrs; ++i) {
+ PyObject *attr = PyTuple_GET_ITEM(ag->attr, i);
+ PyObject *attrstr = dotjoinattr(attr, &attrsep);
+ if (attrstr == NULL) {
+ Py_XDECREF(attrsep);
+ Py_DECREF(attrstrings);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(attrstrings, i, attrstr);
+ }
+ Py_XDECREF(attrsep);
+ return attrstrings;
+}
+
+static PyObject *
+attrgetter_repr(attrgetterobject *ag)
+{
+ PyObject *repr = NULL;
+ int status = Py_ReprEnter((PyObject *)ag);
+ if (status != 0) {
+ if (status < 0)
+ return NULL;
+ return PyUnicode_FromFormat("%s(...)", Py_TYPE(ag)->tp_name);
+ }
+
+ if (ag->nattrs == 1) {
+ PyObject *attrsep = NULL;
+ PyObject *attr = dotjoinattr(PyTuple_GET_ITEM(ag->attr, 0), &attrsep);
+ if (attr != NULL) {
+ repr = PyUnicode_FromFormat("%s(%R)", Py_TYPE(ag)->tp_name, attr);
+ Py_DECREF(attr);
+ }
+ Py_XDECREF(attrsep);
+ }
+ else {
+ PyObject *attrstrings = attrgetter_args(ag);
+ if (attrstrings != NULL) {
+ repr = PyUnicode_FromFormat("%s%R",
+ Py_TYPE(ag)->tp_name, attrstrings);
+ Py_DECREF(attrstrings);
+ }
+ }
+ Py_ReprLeave((PyObject *)ag);
+ return repr;
+}
+
+static PyObject *
+attrgetter_reduce(attrgetterobject *ag, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *attrstrings = attrgetter_args(ag);
+ if (attrstrings == NULL)
+ return NULL;
+
+ return Py_BuildValue("ON", Py_TYPE(ag), attrstrings);
+}
+
+static PyMethodDef attrgetter_methods[] = {
+ {"__reduce__", (PyCFunction)attrgetter_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL}
+};
+
+static PyMemberDef attrgetter_members[] = {
+ {"__vectorcalloffset__", T_PYSSIZET, offsetof(attrgetterobject, vectorcall), READONLY},
+ {NULL} /* Sentinel*/
+};
+
+PyDoc_STRVAR(attrgetter_doc,
+"attrgetter(attr, /, *attrs)\n--\n\n\
+Return a callable object that fetches the given attribute(s) from its operand.\n\
+After f = attrgetter('name'), the call f(r) returns r.name.\n\
+After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).\n\
+After h = attrgetter('name.first', 'name.last'), the call h(r) returns\n\
+(r.name.first, r.name.last).");
+
+static PyType_Slot attrgetter_type_slots[] = {
+ {Py_tp_doc, (void *)attrgetter_doc},
+ {Py_tp_dealloc, attrgetter_dealloc},
+ {Py_tp_call, attrgetter_call},
+ {Py_tp_traverse, attrgetter_traverse},
+ {Py_tp_clear, attrgetter_clear},
+ {Py_tp_methods, attrgetter_methods},
+ {Py_tp_members, attrgetter_members},
+ {Py_tp_new, attrgetter_new},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_repr, attrgetter_repr},
+ {0, 0}
+};
+
+static PyType_Spec attrgetter_type_spec = {
+ .name = "operator.attrgetter",
+ .basicsize = sizeof(attrgetterobject),
+ .itemsize = 0,
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_VECTORCALL),
+ .slots = attrgetter_type_slots,
+};
+
+
+/* methodcaller object **********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *name;
+ PyObject *args;
+ PyObject *kwds;
+} methodcallerobject;
+
+/* AC 3.5: variable number of arguments, not currently support by AC */
+static PyObject *
+methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ methodcallerobject *mc;
+ PyObject *name;
+
+ if (PyTuple_GET_SIZE(args) < 1) {
+ PyErr_SetString(PyExc_TypeError, "methodcaller needs at least "
+ "one argument, the method name");
+ return NULL;
+ }
+
+ name = PyTuple_GET_ITEM(args, 0);
+ if (!PyUnicode_Check(name)) {
+ PyErr_SetString(PyExc_TypeError,
+ "method name must be a string");
+ return NULL;
+ }
+
+ _operator_state *state = _PyType_GetModuleState(type);
+ /* create methodcallerobject structure */
+ mc = PyObject_GC_New(methodcallerobject, (PyTypeObject *)state->methodcaller_type);
+ if (mc == NULL) {
+ return NULL;
+ }
+
+ name = PyTuple_GET_ITEM(args, 0);
+ Py_INCREF(name);
+ PyUnicode_InternInPlace(&name);
+ mc->name = name;
+
+ mc->kwds = Py_XNewRef(kwds);
+
+ mc->args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+ if (mc->args == NULL) {
+ Py_DECREF(mc);
+ return NULL;
+ }
+
+ PyObject_GC_Track(mc);
+ return (PyObject *)mc;
+}
+
+static int
+methodcaller_clear(methodcallerobject *mc)
+{
+ Py_CLEAR(mc->name);
+ Py_CLEAR(mc->args);
+ Py_CLEAR(mc->kwds);
+ return 0;
+}
+
+static void
+methodcaller_dealloc(methodcallerobject *mc)
+{
+ PyTypeObject *tp = Py_TYPE(mc);
+ PyObject_GC_UnTrack(mc);
+ (void)methodcaller_clear(mc);
+ tp->tp_free(mc);
+ Py_DECREF(tp);
+}
+
+static int
+methodcaller_traverse(methodcallerobject *mc, visitproc visit, void *arg)
+{
+ Py_VISIT(mc->name);
+ Py_VISIT(mc->args);
+ Py_VISIT(mc->kwds);
+ Py_VISIT(Py_TYPE(mc));
+ return 0;
+}
+
+static PyObject *
+methodcaller_call(methodcallerobject *mc, PyObject *args, PyObject *kw)
+{
+ PyObject *method, *obj, *result;
+
+ if (!_PyArg_NoKeywords("methodcaller", kw))
+ return NULL;
+ if (!_PyArg_CheckPositional("methodcaller", PyTuple_GET_SIZE(args), 1, 1))
+ return NULL;
+ obj = PyTuple_GET_ITEM(args, 0);
+ method = PyObject_GetAttr(obj, mc->name);
+ if (method == NULL)
+ return NULL;
+ result = PyObject_Call(method, mc->args, mc->kwds);
+ Py_DECREF(method);
+ return result;
+}
+
+static PyObject *
+methodcaller_repr(methodcallerobject *mc)
+{
+ PyObject *argreprs, *repr = NULL, *sep, *joinedargreprs;
+ Py_ssize_t numtotalargs, numposargs, numkwdargs, i;
+ int status = Py_ReprEnter((PyObject *)mc);
+ if (status != 0) {
+ if (status < 0)
+ return NULL;
+ return PyUnicode_FromFormat("%s(...)", Py_TYPE(mc)->tp_name);
+ }
+
+ numkwdargs = mc->kwds != NULL ? PyDict_GET_SIZE(mc->kwds) : 0;
+ numposargs = PyTuple_GET_SIZE(mc->args);
+ numtotalargs = numposargs + numkwdargs;
+
+ if (numtotalargs == 0) {
+ repr = PyUnicode_FromFormat("%s(%R)", Py_TYPE(mc)->tp_name, mc->name);
+ Py_ReprLeave((PyObject *)mc);
+ return repr;
+ }
+
+ argreprs = PyTuple_New(numtotalargs);
+ if (argreprs == NULL) {
+ Py_ReprLeave((PyObject *)mc);
+ return NULL;
+ }
+
+ for (i = 0; i < numposargs; ++i) {
+ PyObject *onerepr = PyObject_Repr(PyTuple_GET_ITEM(mc->args, i));
+ if (onerepr == NULL)
+ goto done;
+ PyTuple_SET_ITEM(argreprs, i, onerepr);
+ }
+
+ if (numkwdargs != 0) {
+ PyObject *key, *value;
+ Py_ssize_t pos = 0;
+ while (PyDict_Next(mc->kwds, &pos, &key, &value)) {
+ PyObject *onerepr = PyUnicode_FromFormat("%U=%R", key, value);
+ if (onerepr == NULL)
+ goto done;
+ if (i >= numtotalargs) {
+ i = -1;
+ Py_DECREF(onerepr);
+ break;
+ }
+ PyTuple_SET_ITEM(argreprs, i, onerepr);
+ ++i;
+ }
+ if (i != numtotalargs) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "keywords dict changed size during iteration");
+ goto done;
+ }
+ }
+
+ sep = PyUnicode_FromString(", ");
+ if (sep == NULL)
+ goto done;
+
+ joinedargreprs = PyUnicode_Join(sep, argreprs);
+ Py_DECREF(sep);
+ if (joinedargreprs == NULL)
+ goto done;
+
+ repr = PyUnicode_FromFormat("%s(%R, %U)", Py_TYPE(mc)->tp_name,
+ mc->name, joinedargreprs);
+ Py_DECREF(joinedargreprs);
+
+done:
+ Py_DECREF(argreprs);
+ Py_ReprLeave((PyObject *)mc);
+ return repr;
+}
+
+static PyObject *
+methodcaller_reduce(methodcallerobject *mc, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *newargs;
+ if (!mc->kwds || PyDict_GET_SIZE(mc->kwds) == 0) {
+ Py_ssize_t i;
+ Py_ssize_t callargcount = PyTuple_GET_SIZE(mc->args);
+ newargs = PyTuple_New(1 + callargcount);
+ if (newargs == NULL)
+ return NULL;
+ PyTuple_SET_ITEM(newargs, 0, Py_NewRef(mc->name));
+ for (i = 0; i < callargcount; ++i) {
+ PyObject *arg = PyTuple_GET_ITEM(mc->args, i);
+ PyTuple_SET_ITEM(newargs, i + 1, Py_NewRef(arg));
+ }
+ return Py_BuildValue("ON", Py_TYPE(mc), newargs);
+ }
+ else {
+ PyObject *partial;
+ PyObject *constructor;
+ PyObject *newargs[2];
+
+ partial = _PyImport_GetModuleAttrString("functools", "partial");
+ if (!partial)
+ return NULL;
+
+ newargs[0] = (PyObject *)Py_TYPE(mc);
+ newargs[1] = mc->name;
+ constructor = PyObject_VectorcallDict(partial, newargs, 2, mc->kwds);
+
+ Py_DECREF(partial);
+ return Py_BuildValue("NO", constructor, mc->args);
+ }
+}
+
+static PyMethodDef methodcaller_methods[] = {
+ {"__reduce__", (PyCFunction)methodcaller_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL}
+};
+PyDoc_STRVAR(methodcaller_doc,
+"methodcaller(name, /, *args, **kwargs)\n--\n\n\
+Return a callable object that calls the given method on its operand.\n\
+After f = methodcaller('name'), the call f(r) returns r.name().\n\
+After g = methodcaller('name', 'date', foo=1), the call g(r) returns\n\
+r.name('date', foo=1).");
+
+static PyType_Slot methodcaller_type_slots[] = {
+ {Py_tp_doc, (void *)methodcaller_doc},
+ {Py_tp_dealloc, methodcaller_dealloc},
+ {Py_tp_call, methodcaller_call},
+ {Py_tp_traverse, methodcaller_traverse},
+ {Py_tp_clear, methodcaller_clear},
+ {Py_tp_methods, methodcaller_methods},
+ {Py_tp_new, methodcaller_new},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_repr, methodcaller_repr},
+ {0, 0}
+};
+
+static PyType_Spec methodcaller_type_spec = {
+ .name = "operator.methodcaller",
+ .basicsize = sizeof(methodcallerobject),
+ .itemsize = 0,
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = methodcaller_type_slots,
+};
+
+static int
+operator_exec(PyObject *module)
+{
+ _operator_state *state = get_operator_state(module);
+ state->attrgetter_type = PyType_FromModuleAndSpec(module, &attrgetter_type_spec, NULL);
+ if (state->attrgetter_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, (PyTypeObject *)state->attrgetter_type) < 0) {
+ return -1;
+ }
+
+ state->itemgetter_type = PyType_FromModuleAndSpec(module, &itemgetter_type_spec, NULL);
+ if (state->itemgetter_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, (PyTypeObject *)state->itemgetter_type) < 0) {
+ return -1;
+ }
+
+ state->methodcaller_type = PyType_FromModuleAndSpec(module, &methodcaller_type_spec, NULL);
+ if (state->methodcaller_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, (PyTypeObject *)state->methodcaller_type) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static struct PyModuleDef_Slot operator_slots[] = {
+ {Py_mod_exec, operator_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+operator_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _operator_state *state = get_operator_state(module);
+ Py_VISIT(state->attrgetter_type);
+ Py_VISIT(state->itemgetter_type);
+ Py_VISIT(state->methodcaller_type);
+ return 0;
+}
+
+static int
+operator_clear(PyObject *module)
+{
+ _operator_state *state = get_operator_state(module);
+ Py_CLEAR(state->attrgetter_type);
+ Py_CLEAR(state->itemgetter_type);
+ Py_CLEAR(state->methodcaller_type);
+ return 0;
+}
+
+static void
+operator_free(void *module)
+{
+ operator_clear((PyObject *)module);
+}
+
+static struct PyModuleDef operatormodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_operator",
+ .m_doc = operator_doc,
+ .m_size = sizeof(_operator_state),
+ .m_methods = operator_methods,
+ .m_slots = operator_slots,
+ .m_traverse = operator_traverse,
+ .m_clear = operator_clear,
+ .m_free = operator_free,
+};
+
+PyMODINIT_FUNC
+PyInit__operator(void)
+{
+ return PyModuleDef_Init(&operatormodule);
+}
diff --git a/contrib/tools/python3/Modules/_pickle.c b/contrib/tools/python3/Modules/_pickle.c
new file mode 100644
index 00000000000..2bf9977f0b7
--- /dev/null
+++ b/contrib/tools/python3/Modules/_pickle.c
@@ -0,0 +1,7986 @@
+/* pickle accelerator C extensor: _pickle module.
+ *
+ * It is built as a built-in module (Py_BUILD_CORE_BUILTIN define) on Windows
+ * and as an extension module (Py_BUILD_CORE_MODULE define) on other
+ * platforms. */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_runtime.h" // _Py_ID()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "structmember.h" // PyMemberDef
+
+#include <stdlib.h> // strtol()
+
+PyDoc_STRVAR(pickle_module_doc,
+"Optimized C implementation for the Python pickle module.");
+
+/*[clinic input]
+module _pickle
+class _pickle.Pickler "PicklerObject *" ""
+class _pickle.PicklerMemoProxy "PicklerMemoProxyObject *" ""
+class _pickle.Unpickler "UnpicklerObject *" ""
+class _pickle.UnpicklerMemoProxy "UnpicklerMemoProxyObject *" ""
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b6d7191ab6466cda]*/
+
+/* Bump HIGHEST_PROTOCOL when new opcodes are added to the pickle protocol.
+ Bump DEFAULT_PROTOCOL only when the oldest still supported version of Python
+ already includes it. */
+enum {
+ HIGHEST_PROTOCOL = 5,
+ DEFAULT_PROTOCOL = 4
+};
+
+#ifdef MS_WINDOWS
+// These are already typedefs from windows.h, pulled in via pycore_runtime.h.
+#define FLOAT FLOAT_
+#define INT INT_
+#define LONG LONG_
+
+/* This can already be defined on Windows to set the character set
+ the Windows header files treat as default */
+#ifdef UNICODE
+#undef UNICODE
+#endif
+#endif
+
+/* Pickle opcodes. These must be kept updated with pickle.py.
+ Extensive docs are in pickletools.py. */
+enum opcode {
+ MARK = '(',
+ STOP = '.',
+ POP = '0',
+ POP_MARK = '1',
+ DUP = '2',
+ FLOAT = 'F',
+ INT = 'I',
+ BININT = 'J',
+ BININT1 = 'K',
+ LONG = 'L',
+ BININT2 = 'M',
+ NONE = 'N',
+ PERSID = 'P',
+ BINPERSID = 'Q',
+ REDUCE = 'R',
+ STRING = 'S',
+ BINSTRING = 'T',
+ SHORT_BINSTRING = 'U',
+ UNICODE = 'V',
+ BINUNICODE = 'X',
+ APPEND = 'a',
+ BUILD = 'b',
+ GLOBAL = 'c',
+ DICT = 'd',
+ EMPTY_DICT = '}',
+ APPENDS = 'e',
+ GET = 'g',
+ BINGET = 'h',
+ INST = 'i',
+ LONG_BINGET = 'j',
+ LIST = 'l',
+ EMPTY_LIST = ']',
+ OBJ = 'o',
+ PUT = 'p',
+ BINPUT = 'q',
+ LONG_BINPUT = 'r',
+ SETITEM = 's',
+ TUPLE = 't',
+ EMPTY_TUPLE = ')',
+ SETITEMS = 'u',
+ BINFLOAT = 'G',
+
+ /* Protocol 2. */
+ PROTO = '\x80',
+ NEWOBJ = '\x81',
+ EXT1 = '\x82',
+ EXT2 = '\x83',
+ EXT4 = '\x84',
+ TUPLE1 = '\x85',
+ TUPLE2 = '\x86',
+ TUPLE3 = '\x87',
+ NEWTRUE = '\x88',
+ NEWFALSE = '\x89',
+ LONG1 = '\x8a',
+ LONG4 = '\x8b',
+
+ /* Protocol 3 (Python 3.x) */
+ BINBYTES = 'B',
+ SHORT_BINBYTES = 'C',
+
+ /* Protocol 4 */
+ SHORT_BINUNICODE = '\x8c',
+ BINUNICODE8 = '\x8d',
+ BINBYTES8 = '\x8e',
+ EMPTY_SET = '\x8f',
+ ADDITEMS = '\x90',
+ FROZENSET = '\x91',
+ NEWOBJ_EX = '\x92',
+ STACK_GLOBAL = '\x93',
+ MEMOIZE = '\x94',
+ FRAME = '\x95',
+
+ /* Protocol 5 */
+ BYTEARRAY8 = '\x96',
+ NEXT_BUFFER = '\x97',
+ READONLY_BUFFER = '\x98'
+};
+
+enum {
+ /* Keep in synch with pickle.Pickler._BATCHSIZE. This is how many elements
+ batch_list/dict() pumps out before doing APPENDS/SETITEMS. Nothing will
+ break if this gets out of synch with pickle.py, but it's unclear that would
+ help anything either. */
+ BATCHSIZE = 1000,
+
+ /* Nesting limit until Pickler, when running in "fast mode", starts
+ checking for self-referential data-structures. */
+ FAST_NESTING_LIMIT = 50,
+
+ /* Initial size of the write buffer of Pickler. */
+ WRITE_BUF_SIZE = 4096,
+
+ /* Prefetch size when unpickling (disabled on unpeekable streams) */
+ PREFETCH = 8192 * 16,
+
+ FRAME_SIZE_MIN = 4,
+ FRAME_SIZE_TARGET = 64 * 1024,
+ FRAME_HEADER_SIZE = 9
+};
+
+/*************************************************************************/
+
+/* State of the pickle module, per PEP 3121. */
+typedef struct {
+ /* Exception classes for pickle. */
+ PyObject *PickleError;
+ PyObject *PicklingError;
+ PyObject *UnpicklingError;
+
+ /* copyreg.dispatch_table, {type_object: pickling_function} */
+ PyObject *dispatch_table;
+
+ /* For the extension opcodes EXT1, EXT2 and EXT4. */
+
+ /* copyreg._extension_registry, {(module_name, function_name): code} */
+ PyObject *extension_registry;
+ /* copyreg._extension_cache, {code: object} */
+ PyObject *extension_cache;
+ /* copyreg._inverted_registry, {code: (module_name, function_name)} */
+ PyObject *inverted_registry;
+
+ /* Import mappings for compatibility with Python 2.x */
+
+ /* _compat_pickle.NAME_MAPPING,
+ {(oldmodule, oldname): (newmodule, newname)} */
+ PyObject *name_mapping_2to3;
+ /* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */
+ PyObject *import_mapping_2to3;
+ /* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */
+ PyObject *name_mapping_3to2;
+ PyObject *import_mapping_3to2;
+
+ /* codecs.encode, used for saving bytes in older protocols */
+ PyObject *codecs_encode;
+ /* builtins.getattr, used for saving nested names with protocol < 4 */
+ PyObject *getattr;
+ /* functools.partial, used for implementing __newobj_ex__ with protocols
+ 2 and 3 */
+ PyObject *partial;
+
+ /* Types */
+ PyTypeObject *Pickler_Type;
+ PyTypeObject *Unpickler_Type;
+ PyTypeObject *Pdata_Type;
+ PyTypeObject *PicklerMemoProxyType;
+ PyTypeObject *UnpicklerMemoProxyType;
+} PickleState;
+
+/* Forward declaration of the _pickle module definition. */
+static struct PyModuleDef _picklemodule;
+
+/* Given a module object, get its per-module state. */
+static inline PickleState *
+_Pickle_GetState(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (PickleState *)state;
+}
+
+static inline PickleState *
+_Pickle_GetStateByClass(PyTypeObject *cls)
+{
+ void *state = _PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return (PickleState *)state;
+}
+
+static inline PickleState *
+_Pickle_FindStateByType(PyTypeObject *tp)
+{
+ PyObject *module = PyType_GetModuleByDef(tp, &_picklemodule);
+ assert(module != NULL);
+ return _Pickle_GetState(module);
+}
+
+/* Clear the given pickle module state. */
+static void
+_Pickle_ClearState(PickleState *st)
+{
+ Py_CLEAR(st->PickleError);
+ Py_CLEAR(st->PicklingError);
+ Py_CLEAR(st->UnpicklingError);
+ Py_CLEAR(st->dispatch_table);
+ Py_CLEAR(st->extension_registry);
+ Py_CLEAR(st->extension_cache);
+ Py_CLEAR(st->inverted_registry);
+ Py_CLEAR(st->name_mapping_2to3);
+ Py_CLEAR(st->import_mapping_2to3);
+ Py_CLEAR(st->name_mapping_3to2);
+ Py_CLEAR(st->import_mapping_3to2);
+ Py_CLEAR(st->codecs_encode);
+ Py_CLEAR(st->getattr);
+ Py_CLEAR(st->partial);
+ Py_CLEAR(st->Pickler_Type);
+ Py_CLEAR(st->Unpickler_Type);
+ Py_CLEAR(st->Pdata_Type);
+ Py_CLEAR(st->PicklerMemoProxyType);
+ Py_CLEAR(st->UnpicklerMemoProxyType);
+}
+
+/* Initialize the given pickle module state. */
+static int
+_Pickle_InitState(PickleState *st)
+{
+ PyObject *copyreg = NULL;
+ PyObject *compat_pickle = NULL;
+
+ st->getattr = _PyEval_GetBuiltin(&_Py_ID(getattr));
+ if (st->getattr == NULL)
+ goto error;
+
+ copyreg = PyImport_ImportModule("copyreg");
+ if (!copyreg)
+ goto error;
+ st->dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table");
+ if (!st->dispatch_table)
+ goto error;
+ if (!PyDict_CheckExact(st->dispatch_table)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg.dispatch_table should be a dict, not %.200s",
+ Py_TYPE(st->dispatch_table)->tp_name);
+ goto error;
+ }
+ st->extension_registry = \
+ PyObject_GetAttrString(copyreg, "_extension_registry");
+ if (!st->extension_registry)
+ goto error;
+ if (!PyDict_CheckExact(st->extension_registry)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg._extension_registry should be a dict, "
+ "not %.200s", Py_TYPE(st->extension_registry)->tp_name);
+ goto error;
+ }
+ st->inverted_registry = \
+ PyObject_GetAttrString(copyreg, "_inverted_registry");
+ if (!st->inverted_registry)
+ goto error;
+ if (!PyDict_CheckExact(st->inverted_registry)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg._inverted_registry should be a dict, "
+ "not %.200s", Py_TYPE(st->inverted_registry)->tp_name);
+ goto error;
+ }
+ st->extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache");
+ if (!st->extension_cache)
+ goto error;
+ if (!PyDict_CheckExact(st->extension_cache)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "copyreg._extension_cache should be a dict, "
+ "not %.200s", Py_TYPE(st->extension_cache)->tp_name);
+ goto error;
+ }
+ Py_CLEAR(copyreg);
+
+ /* Load the 2.x -> 3.x stdlib module mapping tables */
+ compat_pickle = PyImport_ImportModule("_compat_pickle");
+ if (!compat_pickle)
+ goto error;
+ st->name_mapping_2to3 = \
+ PyObject_GetAttrString(compat_pickle, "NAME_MAPPING");
+ if (!st->name_mapping_2to3)
+ goto error;
+ if (!PyDict_CheckExact(st->name_mapping_2to3)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.NAME_MAPPING should be a dict, not %.200s",
+ Py_TYPE(st->name_mapping_2to3)->tp_name);
+ goto error;
+ }
+ st->import_mapping_2to3 = \
+ PyObject_GetAttrString(compat_pickle, "IMPORT_MAPPING");
+ if (!st->import_mapping_2to3)
+ goto error;
+ if (!PyDict_CheckExact(st->import_mapping_2to3)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.IMPORT_MAPPING should be a dict, "
+ "not %.200s", Py_TYPE(st->import_mapping_2to3)->tp_name);
+ goto error;
+ }
+ /* ... and the 3.x -> 2.x mapping tables */
+ st->name_mapping_3to2 = \
+ PyObject_GetAttrString(compat_pickle, "REVERSE_NAME_MAPPING");
+ if (!st->name_mapping_3to2)
+ goto error;
+ if (!PyDict_CheckExact(st->name_mapping_3to2)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, "
+ "not %.200s", Py_TYPE(st->name_mapping_3to2)->tp_name);
+ goto error;
+ }
+ st->import_mapping_3to2 = \
+ PyObject_GetAttrString(compat_pickle, "REVERSE_IMPORT_MAPPING");
+ if (!st->import_mapping_3to2)
+ goto error;
+ if (!PyDict_CheckExact(st->import_mapping_3to2)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, "
+ "not %.200s", Py_TYPE(st->import_mapping_3to2)->tp_name);
+ goto error;
+ }
+ Py_CLEAR(compat_pickle);
+
+ st->codecs_encode = _PyImport_GetModuleAttrString("codecs", "encode");
+ if (st->codecs_encode == NULL) {
+ goto error;
+ }
+ if (!PyCallable_Check(st->codecs_encode)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "codecs.encode should be a callable, not %.200s",
+ Py_TYPE(st->codecs_encode)->tp_name);
+ goto error;
+ }
+
+ st->partial = _PyImport_GetModuleAttrString("functools", "partial");
+ if (!st->partial)
+ goto error;
+
+ return 0;
+
+ error:
+ Py_CLEAR(copyreg);
+ Py_CLEAR(compat_pickle);
+ _Pickle_ClearState(st);
+ return -1;
+}
+
+/* Helper for calling a function with a single argument quickly.
+
+ This function steals the reference of the given argument. */
+static PyObject *
+_Pickle_FastCall(PyObject *func, PyObject *obj)
+{
+ PyObject *result;
+
+ result = PyObject_CallOneArg(func, obj);
+ Py_DECREF(obj);
+ return result;
+}
+
+/*************************************************************************/
+
+/* Retrieve and deconstruct a method for avoiding a reference cycle
+ (pickler -> bound method of pickler -> pickler) */
+static int
+init_method_ref(PyObject *self, PyObject *name,
+ PyObject **method_func, PyObject **method_self)
+{
+ PyObject *func, *func2;
+ int ret;
+
+ /* *method_func and *method_self should be consistent. All refcount decrements
+ should be occurred after setting *method_self and *method_func. */
+ ret = _PyObject_LookupAttr(self, name, &func);
+ if (func == NULL) {
+ *method_self = NULL;
+ Py_CLEAR(*method_func);
+ return ret;
+ }
+
+ if (PyMethod_Check(func) && PyMethod_GET_SELF(func) == self) {
+ /* Deconstruct a bound Python method */
+ *method_self = self; /* borrowed */
+ func2 = PyMethod_GET_FUNCTION(func);
+ Py_XSETREF(*method_func, Py_NewRef(func2));
+ Py_DECREF(func);
+ return 0;
+ }
+ else {
+ *method_self = NULL;
+ Py_XSETREF(*method_func, func);
+ return 0;
+ }
+}
+
+/* Bind a method if it was deconstructed */
+static PyObject *
+reconstruct_method(PyObject *func, PyObject *self)
+{
+ if (self) {
+ return PyMethod_New(func, self);
+ }
+ else {
+ return Py_NewRef(func);
+ }
+}
+
+static PyObject *
+call_method(PyObject *func, PyObject *self, PyObject *obj)
+{
+ if (self) {
+ return PyObject_CallFunctionObjArgs(func, self, obj, NULL);
+ }
+ else {
+ return PyObject_CallOneArg(func, obj);
+ }
+}
+
+/*************************************************************************/
+
+/* Internal data type used as the unpickling stack. */
+typedef struct {
+ PyObject_VAR_HEAD
+ PyObject **data;
+ int mark_set; /* is MARK set? */
+ Py_ssize_t fence; /* position of top MARK or 0 */
+ Py_ssize_t allocated; /* number of slots in data allocated */
+} Pdata;
+
+static int
+Pdata_traverse(Pdata *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+Pdata_dealloc(Pdata *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_ssize_t i = Py_SIZE(self);
+ while (--i >= 0) {
+ Py_DECREF(self->data[i]);
+ }
+ PyMem_Free(self->data);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot pdata_slots[] = {
+ {Py_tp_dealloc, Pdata_dealloc},
+ {Py_tp_traverse, Pdata_traverse},
+ {0, NULL},
+};
+
+static PyType_Spec pdata_spec = {
+ .name = "_pickle.Pdata",
+ .basicsize = sizeof(Pdata),
+ .itemsize = sizeof(PyObject *),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = pdata_slots,
+};
+
+static PyObject *
+Pdata_New(PickleState *state)
+{
+ Pdata *self;
+
+ if (!(self = PyObject_GC_New(Pdata, state->Pdata_Type)))
+ return NULL;
+ Py_SET_SIZE(self, 0);
+ self->mark_set = 0;
+ self->fence = 0;
+ self->allocated = 8;
+ self->data = PyMem_Malloc(self->allocated * sizeof(PyObject *));
+ if (self->data) {
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+ }
+ Py_DECREF(self);
+ return PyErr_NoMemory();
+}
+
+
+/* Retain only the initial clearto items. If clearto >= the current
+ * number of items, this is a (non-erroneous) NOP.
+ */
+static int
+Pdata_clear(Pdata *self, Py_ssize_t clearto)
+{
+ Py_ssize_t i = Py_SIZE(self);
+
+ assert(clearto >= self->fence);
+ if (clearto >= i)
+ return 0;
+
+ while (--i >= clearto) {
+ Py_CLEAR(self->data[i]);
+ }
+ Py_SET_SIZE(self, clearto);
+ return 0;
+}
+
+static int
+Pdata_grow(Pdata *self)
+{
+ PyObject **data = self->data;
+ size_t allocated = (size_t)self->allocated;
+ size_t new_allocated;
+
+ new_allocated = (allocated >> 3) + 6;
+ /* check for integer overflow */
+ if (new_allocated > (size_t)PY_SSIZE_T_MAX - allocated)
+ goto nomemory;
+ new_allocated += allocated;
+ PyMem_RESIZE(data, PyObject *, new_allocated);
+ if (data == NULL)
+ goto nomemory;
+
+ self->data = data;
+ self->allocated = (Py_ssize_t)new_allocated;
+ return 0;
+
+ nomemory:
+ PyErr_NoMemory();
+ return -1;
+}
+
+static int
+Pdata_stack_underflow(PickleState *st, Pdata *self)
+{
+ PyErr_SetString(st->UnpicklingError,
+ self->mark_set ?
+ "unexpected MARK found" :
+ "unpickling stack underflow");
+ return -1;
+}
+
+/* D is a Pdata*. Pop the topmost element and store it into V, which
+ * must be an lvalue holding PyObject*. On stack underflow, UnpicklingError
+ * is raised and V is set to NULL.
+ */
+static PyObject *
+Pdata_pop(PickleState *state, Pdata *self)
+{
+ if (Py_SIZE(self) <= self->fence) {
+ Pdata_stack_underflow(state, self);
+ return NULL;
+ }
+ Py_SET_SIZE(self, Py_SIZE(self) - 1);
+ return self->data[Py_SIZE(self)];
+}
+#define PDATA_POP(S, D, V) do { (V) = Pdata_pop(S, (D)); } while (0)
+
+static int
+Pdata_push(Pdata *self, PyObject *obj)
+{
+ if (Py_SIZE(self) == self->allocated && Pdata_grow(self) < 0) {
+ return -1;
+ }
+ self->data[Py_SIZE(self)] = obj;
+ Py_SET_SIZE(self, Py_SIZE(self) + 1);
+ return 0;
+}
+
+/* Push an object on stack, transferring its ownership to the stack. */
+#define PDATA_PUSH(D, O, ER) do { \
+ if (Pdata_push((D), (O)) < 0) return (ER); } while(0)
+
+/* Push an object on stack, adding a new reference to the object. */
+#define PDATA_APPEND(D, O, ER) do { \
+ Py_INCREF((O)); \
+ if (Pdata_push((D), (O)) < 0) return (ER); } while(0)
+
+static PyObject *
+Pdata_poptuple(PickleState *state, Pdata *self, Py_ssize_t start)
+{
+ PyObject *tuple;
+ Py_ssize_t len, i, j;
+
+ if (start < self->fence) {
+ Pdata_stack_underflow(state, self);
+ return NULL;
+ }
+ len = Py_SIZE(self) - start;
+ tuple = PyTuple_New(len);
+ if (tuple == NULL)
+ return NULL;
+ for (i = start, j = 0; j < len; i++, j++)
+ PyTuple_SET_ITEM(tuple, j, self->data[i]);
+
+ Py_SET_SIZE(self, start);
+ return tuple;
+}
+
+static PyObject *
+Pdata_poplist(Pdata *self, Py_ssize_t start)
+{
+ PyObject *list;
+ Py_ssize_t len, i, j;
+
+ len = Py_SIZE(self) - start;
+ list = PyList_New(len);
+ if (list == NULL)
+ return NULL;
+ for (i = start, j = 0; j < len; i++, j++)
+ PyList_SET_ITEM(list, j, self->data[i]);
+
+ Py_SET_SIZE(self, start);
+ return list;
+}
+
+typedef struct {
+ PyObject *me_key;
+ Py_ssize_t me_value;
+} PyMemoEntry;
+
+typedef struct {
+ size_t mt_mask;
+ size_t mt_used;
+ size_t mt_allocated;
+ PyMemoEntry *mt_table;
+} PyMemoTable;
+
+typedef struct PicklerObject {
+ PyObject_HEAD
+ PyMemoTable *memo; /* Memo table, keep track of the seen
+ objects to support self-referential objects
+ pickling. */
+ PyObject *pers_func; /* persistent_id() method, can be NULL */
+ PyObject *pers_func_self; /* borrowed reference to self if pers_func
+ is an unbound method, NULL otherwise */
+ PyObject *dispatch_table; /* private dispatch_table, can be NULL */
+ PyObject *reducer_override; /* hook for invoking user-defined callbacks
+ instead of save_global when pickling
+ functions and classes*/
+
+ PyObject *write; /* write() method of the output stream. */
+ PyObject *output_buffer; /* Write into a local bytearray buffer before
+ flushing to the stream. */
+ Py_ssize_t output_len; /* Length of output_buffer. */
+ Py_ssize_t max_output_len; /* Allocation size of output_buffer. */
+ int proto; /* Pickle protocol number, >= 0 */
+ int bin; /* Boolean, true if proto > 0 */
+ int framing; /* True when framing is enabled, proto >= 4 */
+ Py_ssize_t frame_start; /* Position in output_buffer where the
+ current frame begins. -1 if there
+ is no frame currently open. */
+
+ Py_ssize_t buf_size; /* Size of the current buffered pickle data */
+ int fast; /* Enable fast mode if set to a true value.
+ The fast mode disable the usage of memo,
+ therefore speeding the pickling process by
+ not generating superfluous PUT opcodes. It
+ should not be used if with self-referential
+ objects. */
+ int fast_nesting;
+ int fix_imports; /* Indicate whether Pickler should fix
+ the name of globals for Python 2.x. */
+ PyObject *fast_memo;
+ PyObject *buffer_callback; /* Callback for out-of-band buffers, or NULL */
+} PicklerObject;
+
+typedef struct UnpicklerObject {
+ PyObject_HEAD
+ Pdata *stack; /* Pickle data stack, store unpickled objects. */
+
+ /* The unpickler memo is just an array of PyObject *s. Using a dict
+ is unnecessary, since the keys are contiguous ints. */
+ PyObject **memo;
+ size_t memo_size; /* Capacity of the memo array */
+ size_t memo_len; /* Number of objects in the memo */
+
+ PyObject *pers_func; /* persistent_load() method, can be NULL. */
+ PyObject *pers_func_self; /* borrowed reference to self if pers_func
+ is an unbound method, NULL otherwise */
+
+ Py_buffer buffer;
+ char *input_buffer;
+ char *input_line;
+ Py_ssize_t input_len;
+ Py_ssize_t next_read_idx;
+ Py_ssize_t prefetched_idx; /* index of first prefetched byte */
+
+ PyObject *read; /* read() method of the input stream. */
+ PyObject *readinto; /* readinto() method of the input stream. */
+ PyObject *readline; /* readline() method of the input stream. */
+ PyObject *peek; /* peek() method of the input stream, or NULL */
+ PyObject *buffers; /* iterable of out-of-band buffers, or NULL */
+
+ char *encoding; /* Name of the encoding to be used for
+ decoding strings pickled using Python
+ 2.x. The default value is "ASCII" */
+ char *errors; /* Name of errors handling scheme to used when
+ decoding strings. The default value is
+ "strict". */
+ Py_ssize_t *marks; /* Mark stack, used for unpickling container
+ objects. */
+ Py_ssize_t num_marks; /* Number of marks in the mark stack. */
+ Py_ssize_t marks_size; /* Current allocated size of the mark stack. */
+ int proto; /* Protocol of the pickle loaded. */
+ int fix_imports; /* Indicate whether Unpickler should fix
+ the name of globals pickled by Python 2.x. */
+} UnpicklerObject;
+
+typedef struct {
+ PyObject_HEAD
+ PicklerObject *pickler; /* Pickler whose memo table we're proxying. */
+} PicklerMemoProxyObject;
+
+typedef struct {
+ PyObject_HEAD
+ UnpicklerObject *unpickler;
+} UnpicklerMemoProxyObject;
+
+/* Forward declarations */
+static int save(PickleState *state, PicklerObject *, PyObject *, int);
+static int save_reduce(PickleState *, PicklerObject *, PyObject *, PyObject *);
+
+#include "clinic/_pickle.c.h"
+
+/*************************************************************************
+ A custom hashtable mapping void* to Python ints. This is used by the pickler
+ for memoization. Using a custom hashtable rather than PyDict allows us to skip
+ a bunch of unnecessary object creation. This makes a huge performance
+ difference. */
+
+#define MT_MINSIZE 8
+#define PERTURB_SHIFT 5
+
+
+static PyMemoTable *
+PyMemoTable_New(void)
+{
+ PyMemoTable *memo = PyMem_Malloc(sizeof(PyMemoTable));
+ if (memo == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ memo->mt_used = 0;
+ memo->mt_allocated = MT_MINSIZE;
+ memo->mt_mask = MT_MINSIZE - 1;
+ memo->mt_table = PyMem_Malloc(MT_MINSIZE * sizeof(PyMemoEntry));
+ if (memo->mt_table == NULL) {
+ PyMem_Free(memo);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ memset(memo->mt_table, 0, MT_MINSIZE * sizeof(PyMemoEntry));
+
+ return memo;
+}
+
+static PyMemoTable *
+PyMemoTable_Copy(PyMemoTable *self)
+{
+ PyMemoTable *new = PyMemoTable_New();
+ if (new == NULL)
+ return NULL;
+
+ new->mt_used = self->mt_used;
+ new->mt_allocated = self->mt_allocated;
+ new->mt_mask = self->mt_mask;
+ /* The table we get from _New() is probably smaller than we wanted.
+ Free it and allocate one that's the right size. */
+ PyMem_Free(new->mt_table);
+ new->mt_table = PyMem_NEW(PyMemoEntry, self->mt_allocated);
+ if (new->mt_table == NULL) {
+ PyMem_Free(new);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ for (size_t i = 0; i < self->mt_allocated; i++) {
+ Py_XINCREF(self->mt_table[i].me_key);
+ }
+ memcpy(new->mt_table, self->mt_table,
+ sizeof(PyMemoEntry) * self->mt_allocated);
+
+ return new;
+}
+
+static Py_ssize_t
+PyMemoTable_Size(PyMemoTable *self)
+{
+ return self->mt_used;
+}
+
+static int
+PyMemoTable_Clear(PyMemoTable *self)
+{
+ Py_ssize_t i = self->mt_allocated;
+
+ while (--i >= 0) {
+ Py_XDECREF(self->mt_table[i].me_key);
+ }
+ self->mt_used = 0;
+ memset(self->mt_table, 0, self->mt_allocated * sizeof(PyMemoEntry));
+ return 0;
+}
+
+static void
+PyMemoTable_Del(PyMemoTable *self)
+{
+ if (self == NULL)
+ return;
+ PyMemoTable_Clear(self);
+
+ PyMem_Free(self->mt_table);
+ PyMem_Free(self);
+}
+
+/* Since entries cannot be deleted from this hashtable, _PyMemoTable_Lookup()
+ can be considerably simpler than dictobject.c's lookdict(). */
+static PyMemoEntry *
+_PyMemoTable_Lookup(PyMemoTable *self, PyObject *key)
+{
+ size_t i;
+ size_t perturb;
+ size_t mask = self->mt_mask;
+ PyMemoEntry *table = self->mt_table;
+ PyMemoEntry *entry;
+ Py_hash_t hash = (Py_hash_t)key >> 3;
+
+ i = hash & mask;
+ entry = &table[i];
+ if (entry->me_key == NULL || entry->me_key == key)
+ return entry;
+
+ for (perturb = hash; ; perturb >>= PERTURB_SHIFT) {
+ i = (i << 2) + i + perturb + 1;
+ entry = &table[i & mask];
+ if (entry->me_key == NULL || entry->me_key == key)
+ return entry;
+ }
+ Py_UNREACHABLE();
+}
+
+/* Returns -1 on failure, 0 on success. */
+static int
+_PyMemoTable_ResizeTable(PyMemoTable *self, size_t min_size)
+{
+ PyMemoEntry *oldtable = NULL;
+ PyMemoEntry *oldentry, *newentry;
+ size_t new_size = MT_MINSIZE;
+ size_t to_process;
+
+ assert(min_size > 0);
+
+ if (min_size > PY_SSIZE_T_MAX) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ /* Find the smallest valid table size >= min_size. */
+ while (new_size < min_size) {
+ new_size <<= 1;
+ }
+ /* new_size needs to be a power of two. */
+ assert((new_size & (new_size - 1)) == 0);
+
+ /* Allocate new table. */
+ oldtable = self->mt_table;
+ self->mt_table = PyMem_NEW(PyMemoEntry, new_size);
+ if (self->mt_table == NULL) {
+ self->mt_table = oldtable;
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->mt_allocated = new_size;
+ self->mt_mask = new_size - 1;
+ memset(self->mt_table, 0, sizeof(PyMemoEntry) * new_size);
+
+ /* Copy entries from the old table. */
+ to_process = self->mt_used;
+ for (oldentry = oldtable; to_process > 0; oldentry++) {
+ if (oldentry->me_key != NULL) {
+ to_process--;
+ /* newentry is a pointer to a chunk of the new
+ mt_table, so we're setting the key:value pair
+ in-place. */
+ newentry = _PyMemoTable_Lookup(self, oldentry->me_key);
+ newentry->me_key = oldentry->me_key;
+ newentry->me_value = oldentry->me_value;
+ }
+ }
+
+ /* Deallocate the old table. */
+ PyMem_Free(oldtable);
+ return 0;
+}
+
+/* Returns NULL on failure, a pointer to the value otherwise. */
+static Py_ssize_t *
+PyMemoTable_Get(PyMemoTable *self, PyObject *key)
+{
+ PyMemoEntry *entry = _PyMemoTable_Lookup(self, key);
+ if (entry->me_key == NULL)
+ return NULL;
+ return &entry->me_value;
+}
+
+/* Returns -1 on failure, 0 on success. */
+static int
+PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
+{
+ PyMemoEntry *entry;
+
+ assert(key != NULL);
+
+ entry = _PyMemoTable_Lookup(self, key);
+ if (entry->me_key != NULL) {
+ entry->me_value = value;
+ return 0;
+ }
+ entry->me_key = Py_NewRef(key);
+ entry->me_value = value;
+ self->mt_used++;
+
+ /* If we added a key, we can safely resize. Otherwise just return!
+ * If used >= 2/3 size, adjust size. Normally, this quaduples the size.
+ *
+ * Quadrupling the size improves average table sparseness
+ * (reducing collisions) at the cost of some memory. It also halves
+ * the number of expensive resize operations in a growing memo table.
+ *
+ * Very large memo tables (over 50K items) use doubling instead.
+ * This may help applications with severe memory constraints.
+ */
+ if (SIZE_MAX / 3 >= self->mt_used && self->mt_used * 3 < self->mt_allocated * 2) {
+ return 0;
+ }
+ // self->mt_used is always < PY_SSIZE_T_MAX, so this can't overflow.
+ size_t desired_size = (self->mt_used > 50000 ? 2 : 4) * self->mt_used;
+ return _PyMemoTable_ResizeTable(self, desired_size);
+}
+
+#undef MT_MINSIZE
+#undef PERTURB_SHIFT
+
+/*************************************************************************/
+
+
+static int
+_Pickler_ClearBuffer(PicklerObject *self)
+{
+ Py_XSETREF(self->output_buffer,
+ PyBytes_FromStringAndSize(NULL, self->max_output_len));
+ if (self->output_buffer == NULL)
+ return -1;
+ self->output_len = 0;
+ self->frame_start = -1;
+ return 0;
+}
+
+static void
+_write_size64(char *out, size_t value)
+{
+ size_t i;
+
+ static_assert(sizeof(size_t) <= 8, "size_t is larger than 64-bit");
+
+ for (i = 0; i < sizeof(size_t); i++) {
+ out[i] = (unsigned char)((value >> (8 * i)) & 0xff);
+ }
+ for (i = sizeof(size_t); i < 8; i++) {
+ out[i] = 0;
+ }
+}
+
+static int
+_Pickler_CommitFrame(PicklerObject *self)
+{
+ size_t frame_len;
+ char *qdata;
+
+ if (!self->framing || self->frame_start == -1)
+ return 0;
+ frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
+ qdata = PyBytes_AS_STRING(self->output_buffer) + self->frame_start;
+ if (frame_len >= FRAME_SIZE_MIN) {
+ qdata[0] = FRAME;
+ _write_size64(qdata + 1, frame_len);
+ }
+ else {
+ memmove(qdata, qdata + FRAME_HEADER_SIZE, frame_len);
+ self->output_len -= FRAME_HEADER_SIZE;
+ }
+ self->frame_start = -1;
+ return 0;
+}
+
+static PyObject *
+_Pickler_GetString(PicklerObject *self)
+{
+ PyObject *output_buffer = self->output_buffer;
+
+ assert(self->output_buffer != NULL);
+
+ if (_Pickler_CommitFrame(self))
+ return NULL;
+
+ self->output_buffer = NULL;
+ /* Resize down to exact size */
+ if (_PyBytes_Resize(&output_buffer, self->output_len) < 0)
+ return NULL;
+ return output_buffer;
+}
+
+static int
+_Pickler_FlushToFile(PicklerObject *self)
+{
+ PyObject *output, *result;
+
+ assert(self->write != NULL);
+
+ /* This will commit the frame first */
+ output = _Pickler_GetString(self);
+ if (output == NULL)
+ return -1;
+
+ result = _Pickle_FastCall(self->write, output);
+ Py_XDECREF(result);
+ return (result == NULL) ? -1 : 0;
+}
+
+static int
+_Pickler_OpcodeBoundary(PicklerObject *self)
+{
+ Py_ssize_t frame_len;
+
+ if (!self->framing || self->frame_start == -1) {
+ return 0;
+ }
+ frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
+ if (frame_len >= FRAME_SIZE_TARGET) {
+ if(_Pickler_CommitFrame(self)) {
+ return -1;
+ }
+ /* Flush the content of the committed frame to the underlying
+ * file and reuse the pickler buffer for the next frame so as
+ * to limit memory usage when dumping large complex objects to
+ * a file.
+ *
+ * self->write is NULL when called via dumps.
+ */
+ if (self->write != NULL) {
+ if (_Pickler_FlushToFile(self) < 0) {
+ return -1;
+ }
+ if (_Pickler_ClearBuffer(self) < 0) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+static Py_ssize_t
+_Pickler_Write(PicklerObject *self, const char *s, Py_ssize_t data_len)
+{
+ Py_ssize_t i, n, required;
+ char *buffer;
+ int need_new_frame;
+
+ assert(s != NULL);
+ need_new_frame = (self->framing && self->frame_start == -1);
+
+ if (need_new_frame)
+ n = data_len + FRAME_HEADER_SIZE;
+ else
+ n = data_len;
+
+ required = self->output_len + n;
+ if (required > self->max_output_len) {
+ /* Make place in buffer for the pickle chunk */
+ if (self->output_len >= PY_SSIZE_T_MAX / 2 - n) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->max_output_len = (self->output_len + n) / 2 * 3;
+ if (_PyBytes_Resize(&self->output_buffer, self->max_output_len) < 0)
+ return -1;
+ }
+ buffer = PyBytes_AS_STRING(self->output_buffer);
+ if (need_new_frame) {
+ /* Setup new frame */
+ Py_ssize_t frame_start = self->output_len;
+ self->frame_start = frame_start;
+ for (i = 0; i < FRAME_HEADER_SIZE; i++) {
+ /* Write an invalid value, for debugging */
+ buffer[frame_start + i] = 0xFE;
+ }
+ self->output_len += FRAME_HEADER_SIZE;
+ }
+ if (data_len < 8) {
+ /* This is faster than memcpy when the string is short. */
+ for (i = 0; i < data_len; i++) {
+ buffer[self->output_len + i] = s[i];
+ }
+ }
+ else {
+ memcpy(buffer + self->output_len, s, data_len);
+ }
+ self->output_len += data_len;
+ return data_len;
+}
+
+static PicklerObject *
+_Pickler_New(PickleState *st)
+{
+ PyMemoTable *memo = PyMemoTable_New();
+ if (memo == NULL) {
+ return NULL;
+ }
+
+ const Py_ssize_t max_output_len = WRITE_BUF_SIZE;
+ PyObject *output_buffer = PyBytes_FromStringAndSize(NULL, max_output_len);
+ if (output_buffer == NULL) {
+ goto error;
+ }
+
+ PicklerObject *self = PyObject_GC_New(PicklerObject, st->Pickler_Type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ self->memo = memo;
+ self->pers_func = NULL;
+ self->pers_func_self = NULL;
+ self->dispatch_table = NULL;
+ self->reducer_override = NULL;
+ self->write = NULL;
+ self->output_buffer = output_buffer;
+ self->output_len = 0;
+ self->max_output_len = max_output_len;
+ self->proto = 0;
+ self->bin = 0;
+ self->framing = 0;
+ self->frame_start = -1;
+ self->buf_size = 0;
+ self->fast = 0;
+ self->fast_nesting = 0;
+ self->fix_imports = 0;
+ self->fast_memo = NULL;
+ self->buffer_callback = NULL;
+
+ PyObject_GC_Track(self);
+ return self;
+
+error:
+ PyMem_Free(memo);
+ Py_XDECREF(output_buffer);
+ return NULL;
+}
+
+static int
+_Pickler_SetProtocol(PicklerObject *self, PyObject *protocol, int fix_imports)
+{
+ long proto;
+
+ if (protocol == Py_None) {
+ proto = DEFAULT_PROTOCOL;
+ }
+ else {
+ proto = PyLong_AsLong(protocol);
+ if (proto < 0) {
+ if (proto == -1 && PyErr_Occurred())
+ return -1;
+ proto = HIGHEST_PROTOCOL;
+ }
+ else if (proto > HIGHEST_PROTOCOL) {
+ PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d",
+ HIGHEST_PROTOCOL);
+ return -1;
+ }
+ }
+ self->proto = (int)proto;
+ self->bin = proto > 0;
+ self->fix_imports = fix_imports && proto < 3;
+ return 0;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Pickler. */
+static int
+_Pickler_SetOutputStream(PicklerObject *self, PyObject *file)
+{
+ assert(file != NULL);
+ if (_PyObject_LookupAttr(file, &_Py_ID(write), &self->write) < 0) {
+ return -1;
+ }
+ if (self->write == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "file must have a 'write' attribute");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+_Pickler_SetBufferCallback(PicklerObject *self, PyObject *buffer_callback)
+{
+ if (buffer_callback == Py_None) {
+ buffer_callback = NULL;
+ }
+ if (buffer_callback != NULL && self->proto < 5) {
+ PyErr_SetString(PyExc_ValueError,
+ "buffer_callback needs protocol >= 5");
+ return -1;
+ }
+
+ self->buffer_callback = Py_XNewRef(buffer_callback);
+ return 0;
+}
+
+/* Returns the size of the input on success, -1 on failure. This takes its
+ own reference to `input`. */
+static Py_ssize_t
+_Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
+{
+ if (self->buffer.buf != NULL)
+ PyBuffer_Release(&self->buffer);
+ if (PyObject_GetBuffer(input, &self->buffer, PyBUF_CONTIG_RO) < 0)
+ return -1;
+ self->input_buffer = self->buffer.buf;
+ self->input_len = self->buffer.len;
+ self->next_read_idx = 0;
+ self->prefetched_idx = self->input_len;
+ return self->input_len;
+}
+
+static int
+bad_readline(PickleState *st)
+{
+ PyErr_SetString(st->UnpicklingError, "pickle data was truncated");
+ return -1;
+}
+
+/* Skip any consumed data that was only prefetched using peek() */
+static int
+_Unpickler_SkipConsumed(UnpicklerObject *self)
+{
+ Py_ssize_t consumed;
+ PyObject *r;
+
+ consumed = self->next_read_idx - self->prefetched_idx;
+ if (consumed <= 0)
+ return 0;
+
+ assert(self->peek); /* otherwise we did something wrong */
+ /* This makes a useless copy... */
+ r = PyObject_CallFunction(self->read, "n", consumed);
+ if (r == NULL)
+ return -1;
+ Py_DECREF(r);
+
+ self->prefetched_idx = self->next_read_idx;
+ return 0;
+}
+
+static const Py_ssize_t READ_WHOLE_LINE = -1;
+
+/* If reading from a file, we need to only pull the bytes we need, since there
+ may be multiple pickle objects arranged contiguously in the same input
+ buffer.
+
+ If `n` is READ_WHOLE_LINE, read a whole line. Otherwise, read up to `n`
+ bytes from the input stream/buffer.
+
+ Update the unpickler's input buffer with the newly-read data. Returns -1 on
+ failure; on success, returns the number of bytes read from the file.
+
+ On success, self->input_len will be 0; this is intentional so that when
+ unpickling from a file, the "we've run out of data" code paths will trigger,
+ causing the Unpickler to go back to the file for more data. Use the returned
+ size to tell you how much data you can process. */
+static Py_ssize_t
+_Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n)
+{
+ PyObject *data;
+ Py_ssize_t read_size;
+
+ assert(self->read != NULL);
+
+ if (_Unpickler_SkipConsumed(self) < 0)
+ return -1;
+
+ if (n == READ_WHOLE_LINE) {
+ data = PyObject_CallNoArgs(self->readline);
+ }
+ else {
+ PyObject *len;
+ /* Prefetch some data without advancing the file pointer, if possible */
+ if (self->peek && n < PREFETCH) {
+ len = PyLong_FromSsize_t(PREFETCH);
+ if (len == NULL)
+ return -1;
+ data = _Pickle_FastCall(self->peek, len);
+ if (data == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_NotImplementedError))
+ return -1;
+ /* peek() is probably not supported by the given file object */
+ PyErr_Clear();
+ Py_CLEAR(self->peek);
+ }
+ else {
+ read_size = _Unpickler_SetStringInput(self, data);
+ Py_DECREF(data);
+ self->prefetched_idx = 0;
+ if (n <= read_size)
+ return n;
+ }
+ }
+ len = PyLong_FromSsize_t(n);
+ if (len == NULL)
+ return -1;
+ data = _Pickle_FastCall(self->read, len);
+ }
+ if (data == NULL)
+ return -1;
+
+ read_size = _Unpickler_SetStringInput(self, data);
+ Py_DECREF(data);
+ return read_size;
+}
+
+/* Don't call it directly: use _Unpickler_Read() */
+static Py_ssize_t
+_Unpickler_ReadImpl(UnpicklerObject *self, PickleState *st, char **s, Py_ssize_t n)
+{
+ Py_ssize_t num_read;
+
+ *s = NULL;
+ if (self->next_read_idx > PY_SSIZE_T_MAX - n) {
+ PyErr_SetString(st->UnpicklingError,
+ "read would overflow (invalid bytecode)");
+ return -1;
+ }
+
+ /* This case is handled by the _Unpickler_Read() macro for efficiency */
+ assert(self->next_read_idx + n > self->input_len);
+
+ if (!self->read)
+ return bad_readline(st);
+
+ /* Extend the buffer to satisfy desired size */
+ num_read = _Unpickler_ReadFromFile(self, n);
+ if (num_read < 0)
+ return -1;
+ if (num_read < n)
+ return bad_readline(st);
+ *s = self->input_buffer;
+ self->next_read_idx = n;
+ return n;
+}
+
+/* Read `n` bytes from the unpickler's data source, storing the result in `buf`.
+ *
+ * This should only be used for non-small data reads where potentially
+ * avoiding a copy is beneficial. This method does not try to prefetch
+ * more data into the input buffer.
+ *
+ * _Unpickler_Read() is recommended in most cases.
+ */
+static Py_ssize_t
+_Unpickler_ReadInto(PickleState *state, UnpicklerObject *self, char *buf,
+ Py_ssize_t n)
+{
+ assert(n != READ_WHOLE_LINE);
+
+ /* Read from available buffer data, if any */
+ Py_ssize_t in_buffer = self->input_len - self->next_read_idx;
+ if (in_buffer > 0) {
+ Py_ssize_t to_read = Py_MIN(in_buffer, n);
+ memcpy(buf, self->input_buffer + self->next_read_idx, to_read);
+ self->next_read_idx += to_read;
+ buf += to_read;
+ n -= to_read;
+ if (n == 0) {
+ /* Entire read was satisfied from buffer */
+ return n;
+ }
+ }
+
+ /* Read from file */
+ if (!self->read) {
+ /* We're unpickling memory, this means the input is truncated */
+ return bad_readline(state);
+ }
+ if (_Unpickler_SkipConsumed(self) < 0) {
+ return -1;
+ }
+
+ if (!self->readinto) {
+ /* readinto() not supported on file-like object, fall back to read()
+ * and copy into destination buffer (bpo-39681) */
+ PyObject* len = PyLong_FromSsize_t(n);
+ if (len == NULL) {
+ return -1;
+ }
+ PyObject* data = _Pickle_FastCall(self->read, len);
+ if (data == NULL) {
+ return -1;
+ }
+ if (!PyBytes_Check(data)) {
+ PyErr_Format(PyExc_ValueError,
+ "read() returned non-bytes object (%R)",
+ Py_TYPE(data));
+ Py_DECREF(data);
+ return -1;
+ }
+ Py_ssize_t read_size = PyBytes_GET_SIZE(data);
+ if (read_size < n) {
+ Py_DECREF(data);
+ return bad_readline(state);
+ }
+ memcpy(buf, PyBytes_AS_STRING(data), n);
+ Py_DECREF(data);
+ return n;
+ }
+
+ /* Call readinto() into user buffer */
+ PyObject *buf_obj = PyMemoryView_FromMemory(buf, n, PyBUF_WRITE);
+ if (buf_obj == NULL) {
+ return -1;
+ }
+ PyObject *read_size_obj = _Pickle_FastCall(self->readinto, buf_obj);
+ if (read_size_obj == NULL) {
+ return -1;
+ }
+ Py_ssize_t read_size = PyLong_AsSsize_t(read_size_obj);
+ Py_DECREF(read_size_obj);
+
+ if (read_size < 0) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "readinto() returned negative size");
+ }
+ return -1;
+ }
+ if (read_size < n) {
+ return bad_readline(state);
+ }
+ return n;
+}
+
+/* Read `n` bytes from the unpickler's data source, storing the result in `*s`.
+
+ This should be used for all data reads, rather than accessing the unpickler's
+ input buffer directly. This method deals correctly with reading from input
+ streams, which the input buffer doesn't deal with.
+
+ Note that when reading from a file-like object, self->next_read_idx won't
+ be updated (it should remain at 0 for the entire unpickling process). You
+ should use this function's return value to know how many bytes you can
+ consume.
+
+ Returns -1 (with an exception set) on failure. On success, return the
+ number of chars read. */
+#define _Unpickler_Read(self, state, s, n) \
+ (((n) <= (self)->input_len - (self)->next_read_idx) \
+ ? (*(s) = (self)->input_buffer + (self)->next_read_idx, \
+ (self)->next_read_idx += (n), \
+ (n)) \
+ : _Unpickler_ReadImpl(self, state, (s), (n)))
+
+static Py_ssize_t
+_Unpickler_CopyLine(UnpicklerObject *self, char *line, Py_ssize_t len,
+ char **result)
+{
+ char *input_line = PyMem_Realloc(self->input_line, len + 1);
+ if (input_line == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ memcpy(input_line, line, len);
+ input_line[len] = '\0';
+ self->input_line = input_line;
+ *result = self->input_line;
+ return len;
+}
+
+/* Read a line from the input stream/buffer. If we run off the end of the input
+ before hitting \n, raise an error.
+
+ Returns the number of chars read, or -1 on failure. */
+static Py_ssize_t
+_Unpickler_Readline(PickleState *state, UnpicklerObject *self, char **result)
+{
+ Py_ssize_t i, num_read;
+
+ for (i = self->next_read_idx; i < self->input_len; i++) {
+ if (self->input_buffer[i] == '\n') {
+ char *line_start = self->input_buffer + self->next_read_idx;
+ num_read = i - self->next_read_idx + 1;
+ self->next_read_idx = i + 1;
+ return _Unpickler_CopyLine(self, line_start, num_read, result);
+ }
+ }
+ if (!self->read)
+ return bad_readline(state);
+
+ num_read = _Unpickler_ReadFromFile(self, READ_WHOLE_LINE);
+ if (num_read < 0)
+ return -1;
+ if (num_read == 0 || self->input_buffer[num_read - 1] != '\n')
+ return bad_readline(state);
+ self->next_read_idx = num_read;
+ return _Unpickler_CopyLine(self, self->input_buffer, num_read, result);
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. The memo array
+ will be modified in place. */
+static int
+_Unpickler_ResizeMemoList(UnpicklerObject *self, size_t new_size)
+{
+ size_t i;
+
+ assert(new_size > self->memo_size);
+
+ PyObject **memo_new = self->memo;
+ PyMem_RESIZE(memo_new, PyObject *, new_size);
+ if (memo_new == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->memo = memo_new;
+ for (i = self->memo_size; i < new_size; i++)
+ self->memo[i] = NULL;
+ self->memo_size = new_size;
+ return 0;
+}
+
+/* Returns NULL if idx is out of bounds. */
+static PyObject *
+_Unpickler_MemoGet(UnpicklerObject *self, size_t idx)
+{
+ if (idx >= self->memo_size)
+ return NULL;
+
+ return self->memo[idx];
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success.
+ This takes its own reference to `value`. */
+static int
+_Unpickler_MemoPut(UnpicklerObject *self, size_t idx, PyObject *value)
+{
+ PyObject *old_item;
+
+ if (idx >= self->memo_size) {
+ if (_Unpickler_ResizeMemoList(self, idx * 2) < 0)
+ return -1;
+ assert(idx < self->memo_size);
+ }
+ old_item = self->memo[idx];
+ self->memo[idx] = Py_NewRef(value);
+ if (old_item != NULL) {
+ Py_DECREF(old_item);
+ }
+ else {
+ self->memo_len++;
+ }
+ return 0;
+}
+
+static PyObject **
+_Unpickler_NewMemo(Py_ssize_t new_size)
+{
+ PyObject **memo = PyMem_NEW(PyObject *, new_size);
+ if (memo == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ memset(memo, 0, new_size * sizeof(PyObject *));
+ return memo;
+}
+
+/* Free the unpickler's memo, taking care to decref any items left in it. */
+static void
+_Unpickler_MemoCleanup(UnpicklerObject *self)
+{
+ Py_ssize_t i;
+ PyObject **memo = self->memo;
+
+ if (self->memo == NULL)
+ return;
+ self->memo = NULL;
+ i = self->memo_size;
+ while (--i >= 0) {
+ Py_XDECREF(memo[i]);
+ }
+ PyMem_Free(memo);
+}
+
+static UnpicklerObject *
+_Unpickler_New(PyObject *module)
+{
+ const int MEMO_SIZE = 32;
+ PyObject **memo = _Unpickler_NewMemo(MEMO_SIZE);
+ if (memo == NULL) {
+ return NULL;
+ }
+
+ PickleState *st = _Pickle_GetState(module);
+ PyObject *stack = Pdata_New(st);
+ if (stack == NULL) {
+ goto error;
+ }
+
+ UnpicklerObject *self = PyObject_GC_New(UnpicklerObject,
+ st->Unpickler_Type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ self->stack = (Pdata *)stack;
+ self->memo = memo;
+ self->memo_size = MEMO_SIZE;
+ self->memo_len = 0;
+ self->pers_func = NULL;
+ self->pers_func_self = NULL;
+ memset(&self->buffer, 0, sizeof(Py_buffer));
+ self->input_buffer = NULL;
+ self->input_line = NULL;
+ self->input_len = 0;
+ self->next_read_idx = 0;
+ self->prefetched_idx = 0;
+ self->read = NULL;
+ self->readinto = NULL;
+ self->readline = NULL;
+ self->peek = NULL;
+ self->buffers = NULL;
+ self->encoding = NULL;
+ self->errors = NULL;
+ self->marks = NULL;
+ self->num_marks = 0;
+ self->marks_size = 0;
+ self->proto = 0;
+ self->fix_imports = 0;
+
+ PyObject_GC_Track(self);
+ return self;
+
+error:
+ PyMem_Free(memo);
+ Py_XDECREF(stack);
+ return NULL;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Unpickler. */
+static int
+_Unpickler_SetInputStream(UnpicklerObject *self, PyObject *file)
+{
+ /* Optional file methods */
+ if (_PyObject_LookupAttr(file, &_Py_ID(peek), &self->peek) < 0) {
+ goto error;
+ }
+ if (_PyObject_LookupAttr(file, &_Py_ID(readinto), &self->readinto) < 0) {
+ goto error;
+ }
+ if (_PyObject_LookupAttr(file, &_Py_ID(read), &self->read) < 0) {
+ goto error;
+ }
+ if (_PyObject_LookupAttr(file, &_Py_ID(readline), &self->readline) < 0) {
+ goto error;
+ }
+ if (!self->readline || !self->read) {
+ PyErr_SetString(PyExc_TypeError,
+ "file must have 'read' and 'readline' attributes");
+ goto error;
+ }
+ return 0;
+
+error:
+ Py_CLEAR(self->read);
+ Py_CLEAR(self->readinto);
+ Py_CLEAR(self->readline);
+ Py_CLEAR(self->peek);
+ return -1;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Unpickler. */
+static int
+_Unpickler_SetInputEncoding(UnpicklerObject *self,
+ const char *encoding,
+ const char *errors)
+{
+ if (encoding == NULL)
+ encoding = "ASCII";
+ if (errors == NULL)
+ errors = "strict";
+
+ self->encoding = _PyMem_Strdup(encoding);
+ self->errors = _PyMem_Strdup(errors);
+ if (self->encoding == NULL || self->errors == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ return 0;
+}
+
+/* Returns -1 (with an exception set) on failure, 0 on success. This may
+ be called once on a freshly created Unpickler. */
+static int
+_Unpickler_SetBuffers(UnpicklerObject *self, PyObject *buffers)
+{
+ if (buffers == NULL || buffers == Py_None) {
+ self->buffers = NULL;
+ }
+ else {
+ self->buffers = PyObject_GetIter(buffers);
+ if (self->buffers == NULL) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+/* Generate a GET opcode for an object stored in the memo. */
+static int
+memo_get(PickleState *st, PicklerObject *self, PyObject *key)
+{
+ Py_ssize_t *value;
+ char pdata[30];
+ Py_ssize_t len;
+
+ value = PyMemoTable_Get(self->memo, key);
+ if (value == NULL) {
+ PyErr_SetObject(PyExc_KeyError, key);
+ return -1;
+ }
+
+ if (!self->bin) {
+ pdata[0] = GET;
+ PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
+ "%zd\n", *value);
+ len = strlen(pdata);
+ }
+ else {
+ if (*value < 256) {
+ pdata[0] = BINGET;
+ pdata[1] = (unsigned char)(*value & 0xff);
+ len = 2;
+ }
+ else if ((size_t)*value <= 0xffffffffUL) {
+ pdata[0] = LONG_BINGET;
+ pdata[1] = (unsigned char)(*value & 0xff);
+ pdata[2] = (unsigned char)((*value >> 8) & 0xff);
+ pdata[3] = (unsigned char)((*value >> 16) & 0xff);
+ pdata[4] = (unsigned char)((*value >> 24) & 0xff);
+ len = 5;
+ }
+ else { /* unlikely */
+ PyErr_SetString(st->PicklingError,
+ "memo id too large for LONG_BINGET");
+ return -1;
+ }
+ }
+
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* Store an object in the memo, assign it a new unique ID based on the number
+ of objects currently stored in the memo and generate a PUT opcode. */
+static int
+memo_put(PickleState *st, PicklerObject *self, PyObject *obj)
+{
+ char pdata[30];
+ Py_ssize_t len;
+ Py_ssize_t idx;
+
+ const char memoize_op = MEMOIZE;
+
+ if (self->fast)
+ return 0;
+
+ idx = PyMemoTable_Size(self->memo);
+ if (PyMemoTable_Set(self->memo, obj, idx) < 0)
+ return -1;
+
+ if (self->proto >= 4) {
+ if (_Pickler_Write(self, &memoize_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+ else if (!self->bin) {
+ pdata[0] = PUT;
+ PyOS_snprintf(pdata + 1, sizeof(pdata) - 1,
+ "%zd\n", idx);
+ len = strlen(pdata);
+ }
+ else {
+ if (idx < 256) {
+ pdata[0] = BINPUT;
+ pdata[1] = (unsigned char)idx;
+ len = 2;
+ }
+ else if ((size_t)idx <= 0xffffffffUL) {
+ pdata[0] = LONG_BINPUT;
+ pdata[1] = (unsigned char)(idx & 0xff);
+ pdata[2] = (unsigned char)((idx >> 8) & 0xff);
+ pdata[3] = (unsigned char)((idx >> 16) & 0xff);
+ pdata[4] = (unsigned char)((idx >> 24) & 0xff);
+ len = 5;
+ }
+ else { /* unlikely */
+ PyErr_SetString(st->PicklingError,
+ "memo id too large for LONG_BINPUT");
+ return -1;
+ }
+ }
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+
+ return 0;
+}
+
+static PyObject *
+get_dotted_path(PyObject *obj, PyObject *name)
+{
+ PyObject *dotted_path;
+ Py_ssize_t i, n;
+ _Py_DECLARE_STR(dot, ".");
+ dotted_path = PyUnicode_Split(name, &_Py_STR(dot), -1);
+ if (dotted_path == NULL)
+ return NULL;
+ n = PyList_GET_SIZE(dotted_path);
+ assert(n >= 1);
+ for (i = 0; i < n; i++) {
+ PyObject *subpath = PyList_GET_ITEM(dotted_path, i);
+ if (_PyUnicode_EqualToASCIIString(subpath, "<locals>")) {
+ if (obj == NULL)
+ PyErr_Format(PyExc_AttributeError,
+ "Can't pickle local object %R", name);
+ else
+ PyErr_Format(PyExc_AttributeError,
+ "Can't pickle local attribute %R on %R", name, obj);
+ Py_DECREF(dotted_path);
+ return NULL;
+ }
+ }
+ return dotted_path;
+}
+
+static PyObject *
+get_deep_attribute(PyObject *obj, PyObject *names, PyObject **pparent)
+{
+ Py_ssize_t i, n;
+ PyObject *parent = NULL;
+
+ assert(PyList_CheckExact(names));
+ Py_INCREF(obj);
+ n = PyList_GET_SIZE(names);
+ for (i = 0; i < n; i++) {
+ PyObject *name = PyList_GET_ITEM(names, i);
+ Py_XSETREF(parent, obj);
+ (void)_PyObject_LookupAttr(parent, name, &obj);
+ if (obj == NULL) {
+ Py_DECREF(parent);
+ return NULL;
+ }
+ }
+ if (pparent != NULL)
+ *pparent = parent;
+ else
+ Py_XDECREF(parent);
+ return obj;
+}
+
+
+static PyObject *
+getattribute(PyObject *obj, PyObject *name, int allow_qualname)
+{
+ PyObject *dotted_path, *attr;
+
+ if (allow_qualname) {
+ dotted_path = get_dotted_path(obj, name);
+ if (dotted_path == NULL)
+ return NULL;
+ attr = get_deep_attribute(obj, dotted_path, NULL);
+ Py_DECREF(dotted_path);
+ }
+ else {
+ (void)_PyObject_LookupAttr(obj, name, &attr);
+ }
+ if (attr == NULL && !PyErr_Occurred()) {
+ PyErr_Format(PyExc_AttributeError,
+ "Can't get attribute %R on %R", name, obj);
+ }
+ return attr;
+}
+
+static int
+_checkmodule(PyObject *module_name, PyObject *module,
+ PyObject *global, PyObject *dotted_path)
+{
+ if (module == Py_None) {
+ return -1;
+ }
+ if (PyUnicode_Check(module_name) &&
+ _PyUnicode_EqualToASCIIString(module_name, "__main__")) {
+ return -1;
+ }
+
+ PyObject *candidate = get_deep_attribute(module, dotted_path, NULL);
+ if (candidate == NULL) {
+ return -1;
+ }
+ if (candidate != global) {
+ Py_DECREF(candidate);
+ return -1;
+ }
+ Py_DECREF(candidate);
+ return 0;
+}
+
+static PyObject *
+whichmodule(PyObject *global, PyObject *dotted_path)
+{
+ PyObject *module_name;
+ PyObject *module = NULL;
+ Py_ssize_t i;
+ PyObject *modules;
+
+ if (_PyObject_LookupAttr(global, &_Py_ID(__module__), &module_name) < 0) {
+ return NULL;
+ }
+ if (module_name) {
+ /* In some rare cases (e.g., bound methods of extension types),
+ __module__ can be None. If it is so, then search sys.modules for
+ the module of global. */
+ if (module_name != Py_None)
+ return module_name;
+ Py_CLEAR(module_name);
+ }
+ assert(module_name == NULL);
+
+ /* Fallback on walking sys.modules */
+ PyThreadState *tstate = _PyThreadState_GET();
+ modules = _PySys_GetAttr(tstate, &_Py_ID(modules));
+ if (modules == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "unable to get sys.modules");
+ return NULL;
+ }
+ if (PyDict_CheckExact(modules)) {
+ i = 0;
+ while (PyDict_Next(modules, &i, &module_name, &module)) {
+ if (_checkmodule(module_name, module, global, dotted_path) == 0) {
+ return Py_NewRef(module_name);
+ }
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ }
+ else {
+ PyObject *iterator = PyObject_GetIter(modules);
+ if (iterator == NULL) {
+ return NULL;
+ }
+ while ((module_name = PyIter_Next(iterator))) {
+ module = PyObject_GetItem(modules, module_name);
+ if (module == NULL) {
+ Py_DECREF(module_name);
+ Py_DECREF(iterator);
+ return NULL;
+ }
+ if (_checkmodule(module_name, module, global, dotted_path) == 0) {
+ Py_DECREF(module);
+ Py_DECREF(iterator);
+ return module_name;
+ }
+ Py_DECREF(module);
+ Py_DECREF(module_name);
+ if (PyErr_Occurred()) {
+ Py_DECREF(iterator);
+ return NULL;
+ }
+ }
+ Py_DECREF(iterator);
+ }
+
+ /* If no module is found, use __main__. */
+ module_name = &_Py_ID(__main__);
+ return Py_NewRef(module_name);
+}
+
+/* fast_save_enter() and fast_save_leave() are guards against recursive
+ objects when Pickler is used with the "fast mode" (i.e., with object
+ memoization disabled). If the nesting of a list or dict object exceed
+ FAST_NESTING_LIMIT, these guards will start keeping an internal
+ reference to the seen list or dict objects and check whether these objects
+ are recursive. These are not strictly necessary, since save() has a
+ hard-coded recursion limit, but they give a nicer error message than the
+ typical RuntimeError. */
+static int
+fast_save_enter(PicklerObject *self, PyObject *obj)
+{
+ /* if fast_nesting < 0, we're doing an error exit. */
+ if (++self->fast_nesting >= FAST_NESTING_LIMIT) {
+ PyObject *key = NULL;
+ if (self->fast_memo == NULL) {
+ self->fast_memo = PyDict_New();
+ if (self->fast_memo == NULL) {
+ self->fast_nesting = -1;
+ return 0;
+ }
+ }
+ key = PyLong_FromVoidPtr(obj);
+ if (key == NULL) {
+ self->fast_nesting = -1;
+ return 0;
+ }
+ int r = PyDict_Contains(self->fast_memo, key);
+ if (r > 0) {
+ PyErr_Format(PyExc_ValueError,
+ "fast mode: can't pickle cyclic objects "
+ "including object type %.200s at %p",
+ Py_TYPE(obj)->tp_name, obj);
+ }
+ else if (r == 0) {
+ r = PyDict_SetItem(self->fast_memo, key, Py_None);
+ }
+ Py_DECREF(key);
+ if (r != 0) {
+ self->fast_nesting = -1;
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+fast_save_leave(PicklerObject *self, PyObject *obj)
+{
+ if (self->fast_nesting-- >= FAST_NESTING_LIMIT) {
+ PyObject *key = PyLong_FromVoidPtr(obj);
+ if (key == NULL)
+ return 0;
+ if (PyDict_DelItem(self->fast_memo, key) < 0) {
+ Py_DECREF(key);
+ return 0;
+ }
+ Py_DECREF(key);
+ }
+ return 1;
+}
+
+static int
+save_none(PicklerObject *self, PyObject *obj)
+{
+ const char none_op = NONE;
+ if (_Pickler_Write(self, &none_op, 1) < 0)
+ return -1;
+
+ return 0;
+}
+
+static int
+save_bool(PicklerObject *self, PyObject *obj)
+{
+ if (self->proto >= 2) {
+ const char bool_op = (obj == Py_True) ? NEWTRUE : NEWFALSE;
+ if (_Pickler_Write(self, &bool_op, 1) < 0)
+ return -1;
+ }
+ else {
+ /* These aren't opcodes -- they're ways to pickle bools before protocol 2
+ * so that unpicklers written before bools were introduced unpickle them
+ * as ints, but unpicklers after can recognize that bools were intended.
+ * Note that protocol 2 added direct ways to pickle bools.
+ */
+ const char *bool_str = (obj == Py_True) ? "I01\n" : "I00\n";
+ if (_Pickler_Write(self, bool_str, strlen(bool_str)) < 0)
+ return -1;
+ }
+ return 0;
+}
+
+static int
+save_long(PicklerObject *self, PyObject *obj)
+{
+ PyObject *repr = NULL;
+ Py_ssize_t size;
+ long val;
+ int overflow;
+ int status = 0;
+
+ val= PyLong_AsLongAndOverflow(obj, &overflow);
+ if (!overflow && (sizeof(long) <= 4 ||
+ (val <= 0x7fffffffL && val >= (-0x7fffffffL - 1))))
+ {
+ /* result fits in a signed 4-byte integer.
+
+ Note: we can't use -0x80000000L in the above condition because some
+ compilers (e.g., MSVC) will promote 0x80000000L to an unsigned type
+ before applying the unary minus when sizeof(long) <= 4. The
+ resulting value stays unsigned which is commonly not what we want,
+ so MSVC happily warns us about it. However, that result would have
+ been fine because we guard for sizeof(long) <= 4 which turns the
+ condition true in that particular case. */
+ char pdata[32];
+ Py_ssize_t len = 0;
+
+ if (self->bin) {
+ pdata[1] = (unsigned char)(val & 0xff);
+ pdata[2] = (unsigned char)((val >> 8) & 0xff);
+ pdata[3] = (unsigned char)((val >> 16) & 0xff);
+ pdata[4] = (unsigned char)((val >> 24) & 0xff);
+
+ if ((pdata[4] != 0) || (pdata[3] != 0)) {
+ pdata[0] = BININT;
+ len = 5;
+ }
+ else if (pdata[2] != 0) {
+ pdata[0] = BININT2;
+ len = 3;
+ }
+ else {
+ pdata[0] = BININT1;
+ len = 2;
+ }
+ }
+ else {
+ sprintf(pdata, "%c%ld\n", INT, val);
+ len = strlen(pdata);
+ }
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+
+ return 0;
+ }
+ assert(!PyErr_Occurred());
+
+ if (self->proto >= 2) {
+ /* Linear-time pickling. */
+ size_t nbits;
+ size_t nbytes;
+ unsigned char *pdata;
+ char header[5];
+ int i;
+ int sign = _PyLong_Sign(obj);
+
+ if (sign == 0) {
+ header[0] = LONG1;
+ header[1] = 0; /* It's 0 -- an empty bytestring. */
+ if (_Pickler_Write(self, header, 2) < 0)
+ goto error;
+ return 0;
+ }
+ nbits = _PyLong_NumBits(obj);
+ if (nbits == (size_t)-1 && PyErr_Occurred())
+ goto error;
+ /* How many bytes do we need? There are nbits >> 3 full
+ * bytes of data, and nbits & 7 leftover bits. If there
+ * are any leftover bits, then we clearly need another
+ * byte. What's not so obvious is that we *probably*
+ * need another byte even if there aren't any leftovers:
+ * the most-significant bit of the most-significant byte
+ * acts like a sign bit, and it's usually got a sense
+ * opposite of the one we need. The exception is ints
+ * of the form -(2**(8*j-1)) for j > 0. Such an int is
+ * its own 256's-complement, so has the right sign bit
+ * even without the extra byte. That's a pain to check
+ * for in advance, though, so we always grab an extra
+ * byte at the start, and cut it back later if possible.
+ */
+ nbytes = (nbits >> 3) + 1;
+ if (nbytes > 0x7fffffffL) {
+ PyErr_SetString(PyExc_OverflowError,
+ "int too large to pickle");
+ goto error;
+ }
+ repr = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)nbytes);
+ if (repr == NULL)
+ goto error;
+ pdata = (unsigned char *)PyBytes_AS_STRING(repr);
+ i = _PyLong_AsByteArray((PyLongObject *)obj,
+ pdata, nbytes,
+ 1 /* little endian */ , 1 /* signed */ );
+ if (i < 0)
+ goto error;
+ /* If the int is negative, this may be a byte more than
+ * needed. This is so iff the MSB is all redundant sign
+ * bits.
+ */
+ if (sign < 0 &&
+ nbytes > 1 &&
+ pdata[nbytes - 1] == 0xff &&
+ (pdata[nbytes - 2] & 0x80) != 0) {
+ nbytes--;
+ }
+
+ if (nbytes < 256) {
+ header[0] = LONG1;
+ header[1] = (unsigned char)nbytes;
+ size = 2;
+ }
+ else {
+ header[0] = LONG4;
+ size = (Py_ssize_t) nbytes;
+ for (i = 1; i < 5; i++) {
+ header[i] = (unsigned char)(size & 0xff);
+ size >>= 8;
+ }
+ size = 5;
+ }
+ if (_Pickler_Write(self, header, size) < 0 ||
+ _Pickler_Write(self, (char *)pdata, (int)nbytes) < 0)
+ goto error;
+ }
+ else {
+ const char long_op = LONG;
+ const char *string;
+
+ /* proto < 2: write the repr and newline. This is quadratic-time (in
+ the number of digits), in both directions. We add a trailing 'L'
+ to the repr, for compatibility with Python 2.x. */
+
+ repr = PyObject_Repr(obj);
+ if (repr == NULL)
+ goto error;
+
+ string = PyUnicode_AsUTF8AndSize(repr, &size);
+ if (string == NULL)
+ goto error;
+
+ if (_Pickler_Write(self, &long_op, 1) < 0 ||
+ _Pickler_Write(self, string, size) < 0 ||
+ _Pickler_Write(self, "L\n", 2) < 0)
+ goto error;
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ Py_XDECREF(repr);
+
+ return status;
+}
+
+static int
+save_float(PicklerObject *self, PyObject *obj)
+{
+ double x = PyFloat_AS_DOUBLE((PyFloatObject *)obj);
+
+ if (self->bin) {
+ char pdata[9];
+ pdata[0] = BINFLOAT;
+ if (PyFloat_Pack8(x, &pdata[1], 0) < 0)
+ return -1;
+ if (_Pickler_Write(self, pdata, 9) < 0)
+ return -1;
+ }
+ else {
+ int result = -1;
+ char *buf = NULL;
+ char op = FLOAT;
+
+ if (_Pickler_Write(self, &op, 1) < 0)
+ goto done;
+
+ buf = PyOS_double_to_string(x, 'r', 0, Py_DTSF_ADD_DOT_0, NULL);
+ if (!buf) {
+ PyErr_NoMemory();
+ goto done;
+ }
+
+ if (_Pickler_Write(self, buf, strlen(buf)) < 0)
+ goto done;
+
+ if (_Pickler_Write(self, "\n", 1) < 0)
+ goto done;
+
+ result = 0;
+done:
+ PyMem_Free(buf);
+ return result;
+ }
+
+ return 0;
+}
+
+/* Perform direct write of the header and payload of the binary object.
+
+ The large contiguous data is written directly into the underlying file
+ object, bypassing the output_buffer of the Pickler. We intentionally
+ do not insert a protocol 4 frame opcode to make it possible to optimize
+ file.read calls in the loader.
+ */
+static int
+_Pickler_write_bytes(PicklerObject *self,
+ const char *header, Py_ssize_t header_size,
+ const char *data, Py_ssize_t data_size,
+ PyObject *payload)
+{
+ int bypass_buffer = (data_size >= FRAME_SIZE_TARGET);
+ int framing = self->framing;
+
+ if (bypass_buffer) {
+ assert(self->output_buffer != NULL);
+ /* Commit the previous frame. */
+ if (_Pickler_CommitFrame(self)) {
+ return -1;
+ }
+ /* Disable framing temporarily */
+ self->framing = 0;
+ }
+
+ if (_Pickler_Write(self, header, header_size) < 0) {
+ return -1;
+ }
+
+ if (bypass_buffer && self->write != NULL) {
+ /* Bypass the in-memory buffer to directly stream large data
+ into the underlying file object. */
+ PyObject *result, *mem = NULL;
+ /* Dump the output buffer to the file. */
+ if (_Pickler_FlushToFile(self) < 0) {
+ return -1;
+ }
+
+ /* Stream write the payload into the file without going through the
+ output buffer. */
+ if (payload == NULL) {
+ /* TODO: It would be better to use a memoryview with a linked
+ original string if this is possible. */
+ payload = mem = PyBytes_FromStringAndSize(data, data_size);
+ if (payload == NULL) {
+ return -1;
+ }
+ }
+ result = PyObject_CallOneArg(self->write, payload);
+ Py_XDECREF(mem);
+ if (result == NULL) {
+ return -1;
+ }
+ Py_DECREF(result);
+
+ /* Reinitialize the buffer for subsequent calls to _Pickler_Write. */
+ if (_Pickler_ClearBuffer(self) < 0) {
+ return -1;
+ }
+ }
+ else {
+ if (_Pickler_Write(self, data, data_size) < 0) {
+ return -1;
+ }
+ }
+
+ /* Re-enable framing for subsequent calls to _Pickler_Write. */
+ self->framing = framing;
+
+ return 0;
+}
+
+static int
+_save_bytes_data(PickleState *st, PicklerObject *self, PyObject *obj,
+ const char *data, Py_ssize_t size)
+{
+ assert(self->proto >= 3);
+
+ char header[9];
+ Py_ssize_t len;
+
+ if (size < 0)
+ return -1;
+
+ if (size <= 0xff) {
+ header[0] = SHORT_BINBYTES;
+ header[1] = (unsigned char)size;
+ len = 2;
+ }
+ else if ((size_t)size <= 0xffffffffUL) {
+ header[0] = BINBYTES;
+ header[1] = (unsigned char)(size & 0xff);
+ header[2] = (unsigned char)((size >> 8) & 0xff);
+ header[3] = (unsigned char)((size >> 16) & 0xff);
+ header[4] = (unsigned char)((size >> 24) & 0xff);
+ len = 5;
+ }
+ else if (self->proto >= 4) {
+ header[0] = BINBYTES8;
+ _write_size64(header + 1, size);
+ len = 9;
+ }
+ else {
+ PyErr_SetString(PyExc_OverflowError,
+ "serializing a bytes object larger than 4 GiB "
+ "requires pickle protocol 4 or higher");
+ return -1;
+ }
+
+ if (_Pickler_write_bytes(self, header, len, data, size, obj) < 0) {
+ return -1;
+ }
+
+ if (memo_put(st, self, obj) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+save_bytes(PickleState *st, PicklerObject *self, PyObject *obj)
+{
+ if (self->proto < 3) {
+ /* Older pickle protocols do not have an opcode for pickling bytes
+ objects. Therefore, we need to fake the copy protocol (i.e.,
+ the __reduce__ method) to permit bytes object unpickling.
+
+ Here we use a hack to be compatible with Python 2. Since in Python
+ 2 'bytes' is just an alias for 'str' (which has different
+ parameters than the actual bytes object), we use codecs.encode
+ to create the appropriate 'str' object when unpickled using
+ Python 2 *and* the appropriate 'bytes' object when unpickled
+ using Python 3. Again this is a hack and we don't need to do this
+ with newer protocols. */
+ PyObject *reduce_value;
+ int status;
+
+ if (PyBytes_GET_SIZE(obj) == 0) {
+ reduce_value = Py_BuildValue("(O())", (PyObject*)&PyBytes_Type);
+ }
+ else {
+ PyObject *unicode_str =
+ PyUnicode_DecodeLatin1(PyBytes_AS_STRING(obj),
+ PyBytes_GET_SIZE(obj),
+ "strict");
+
+ if (unicode_str == NULL)
+ return -1;
+ reduce_value = Py_BuildValue("(O(OO))",
+ st->codecs_encode, unicode_str,
+ &_Py_ID(latin1));
+ Py_DECREF(unicode_str);
+ }
+
+ if (reduce_value == NULL)
+ return -1;
+
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(st, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+ else {
+ return _save_bytes_data(st, self, obj, PyBytes_AS_STRING(obj),
+ PyBytes_GET_SIZE(obj));
+ }
+}
+
+static int
+_save_bytearray_data(PickleState *state, PicklerObject *self, PyObject *obj,
+ const char *data, Py_ssize_t size)
+{
+ assert(self->proto >= 5);
+
+ char header[9];
+ Py_ssize_t len;
+
+ if (size < 0)
+ return -1;
+
+ header[0] = BYTEARRAY8;
+ _write_size64(header + 1, size);
+ len = 9;
+
+ if (_Pickler_write_bytes(self, header, len, data, size, obj) < 0) {
+ return -1;
+ }
+
+ if (memo_put(state, self, obj) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+save_bytearray(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ if (self->proto < 5) {
+ /* Older pickle protocols do not have an opcode for pickling
+ * bytearrays. */
+ PyObject *reduce_value = NULL;
+ int status;
+
+ if (PyByteArray_GET_SIZE(obj) == 0) {
+ reduce_value = Py_BuildValue("(O())",
+ (PyObject *) &PyByteArray_Type);
+ }
+ else {
+ PyObject *bytes_obj = PyBytes_FromObject(obj);
+ if (bytes_obj != NULL) {
+ reduce_value = Py_BuildValue("(O(O))",
+ (PyObject *) &PyByteArray_Type,
+ bytes_obj);
+ Py_DECREF(bytes_obj);
+ }
+ }
+ if (reduce_value == NULL)
+ return -1;
+
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+ else {
+ return _save_bytearray_data(state, self, obj,
+ PyByteArray_AS_STRING(obj),
+ PyByteArray_GET_SIZE(obj));
+ }
+}
+
+static int
+save_picklebuffer(PickleState *st, PicklerObject *self, PyObject *obj)
+{
+ if (self->proto < 5) {
+ PyErr_SetString(st->PicklingError,
+ "PickleBuffer can only pickled with protocol >= 5");
+ return -1;
+ }
+ const Py_buffer* view = PyPickleBuffer_GetBuffer(obj);
+ if (view == NULL) {
+ return -1;
+ }
+ if (view->suboffsets != NULL || !PyBuffer_IsContiguous(view, 'A')) {
+ PyErr_SetString(st->PicklingError,
+ "PickleBuffer can not be pickled when "
+ "pointing to a non-contiguous buffer");
+ return -1;
+ }
+ int in_band = 1;
+ if (self->buffer_callback != NULL) {
+ PyObject *ret = PyObject_CallOneArg(self->buffer_callback, obj);
+ if (ret == NULL) {
+ return -1;
+ }
+ in_band = PyObject_IsTrue(ret);
+ Py_DECREF(ret);
+ if (in_band == -1) {
+ return -1;
+ }
+ }
+ if (in_band) {
+ /* Write data in-band */
+ if (view->readonly) {
+ return _save_bytes_data(st, self, obj, (const char *)view->buf,
+ view->len);
+ }
+ else {
+ return _save_bytearray_data(st, self, obj, (const char *)view->buf,
+ view->len);
+ }
+ }
+ else {
+ /* Write data out-of-band */
+ const char next_buffer_op = NEXT_BUFFER;
+ if (_Pickler_Write(self, &next_buffer_op, 1) < 0) {
+ return -1;
+ }
+ if (view->readonly) {
+ const char readonly_buffer_op = READONLY_BUFFER;
+ if (_Pickler_Write(self, &readonly_buffer_op, 1) < 0) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+/* A copy of PyUnicode_AsRawUnicodeEscapeString() that also translates
+ backslash and newline characters to \uXXXX escapes. */
+static PyObject *
+raw_unicode_escape(PyObject *obj)
+{
+ char *p;
+ Py_ssize_t i, size;
+ const void *data;
+ int kind;
+ _PyBytesWriter writer;
+
+ if (PyUnicode_READY(obj))
+ return NULL;
+
+ _PyBytesWriter_Init(&writer);
+
+ size = PyUnicode_GET_LENGTH(obj);
+ data = PyUnicode_DATA(obj);
+ kind = PyUnicode_KIND(obj);
+
+ p = _PyBytesWriter_Alloc(&writer, size);
+ if (p == NULL)
+ goto error;
+ writer.overallocate = 1;
+
+ for (i=0; i < size; i++) {
+ Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+ /* Map 32-bit characters to '\Uxxxxxxxx' */
+ if (ch >= 0x10000) {
+ /* -1: subtract 1 preallocated byte */
+ p = _PyBytesWriter_Prepare(&writer, p, 10-1);
+ if (p == NULL)
+ goto error;
+
+ *p++ = '\\';
+ *p++ = 'U';
+ *p++ = Py_hexdigits[(ch >> 28) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 24) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 20) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 16) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 12) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 8) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 4) & 0xf];
+ *p++ = Py_hexdigits[ch & 15];
+ }
+ /* Map 16-bit characters, '\\' and '\n' to '\uxxxx' */
+ else if (ch >= 256 ||
+ ch == '\\' || ch == 0 || ch == '\n' || ch == '\r' ||
+ ch == 0x1a)
+ {
+ /* -1: subtract 1 preallocated byte */
+ p = _PyBytesWriter_Prepare(&writer, p, 6-1);
+ if (p == NULL)
+ goto error;
+
+ *p++ = '\\';
+ *p++ = 'u';
+ *p++ = Py_hexdigits[(ch >> 12) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 8) & 0xf];
+ *p++ = Py_hexdigits[(ch >> 4) & 0xf];
+ *p++ = Py_hexdigits[ch & 15];
+ }
+ /* Copy everything else as-is */
+ else
+ *p++ = (char) ch;
+ }
+
+ return _PyBytesWriter_Finish(&writer, p);
+
+error:
+ _PyBytesWriter_Dealloc(&writer);
+ return NULL;
+}
+
+static int
+write_unicode_binary(PicklerObject *self, PyObject *obj)
+{
+ char header[9];
+ Py_ssize_t len;
+ PyObject *encoded = NULL;
+ Py_ssize_t size;
+ const char *data;
+
+ if (PyUnicode_READY(obj))
+ return -1;
+
+ data = PyUnicode_AsUTF8AndSize(obj, &size);
+ if (data == NULL) {
+ /* Issue #8383: for strings with lone surrogates, fallback on the
+ "surrogatepass" error handler. */
+ PyErr_Clear();
+ encoded = PyUnicode_AsEncodedString(obj, "utf-8", "surrogatepass");
+ if (encoded == NULL)
+ return -1;
+
+ data = PyBytes_AS_STRING(encoded);
+ size = PyBytes_GET_SIZE(encoded);
+ }
+
+ assert(size >= 0);
+ if (size <= 0xff && self->proto >= 4) {
+ header[0] = SHORT_BINUNICODE;
+ header[1] = (unsigned char)(size & 0xff);
+ len = 2;
+ }
+ else if ((size_t)size <= 0xffffffffUL) {
+ header[0] = BINUNICODE;
+ header[1] = (unsigned char)(size & 0xff);
+ header[2] = (unsigned char)((size >> 8) & 0xff);
+ header[3] = (unsigned char)((size >> 16) & 0xff);
+ header[4] = (unsigned char)((size >> 24) & 0xff);
+ len = 5;
+ }
+ else if (self->proto >= 4) {
+ header[0] = BINUNICODE8;
+ _write_size64(header + 1, size);
+ len = 9;
+ }
+ else {
+ PyErr_SetString(PyExc_OverflowError,
+ "serializing a string larger than 4 GiB "
+ "requires pickle protocol 4 or higher");
+ Py_XDECREF(encoded);
+ return -1;
+ }
+
+ if (_Pickler_write_bytes(self, header, len, data, size, encoded) < 0) {
+ Py_XDECREF(encoded);
+ return -1;
+ }
+ Py_XDECREF(encoded);
+ return 0;
+}
+
+static int
+save_unicode(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ if (self->bin) {
+ if (write_unicode_binary(self, obj) < 0)
+ return -1;
+ }
+ else {
+ PyObject *encoded;
+ Py_ssize_t size;
+ const char unicode_op = UNICODE;
+
+ encoded = raw_unicode_escape(obj);
+ if (encoded == NULL)
+ return -1;
+
+ if (_Pickler_Write(self, &unicode_op, 1) < 0) {
+ Py_DECREF(encoded);
+ return -1;
+ }
+
+ size = PyBytes_GET_SIZE(encoded);
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0) {
+ Py_DECREF(encoded);
+ return -1;
+ }
+ Py_DECREF(encoded);
+
+ if (_Pickler_Write(self, "\n", 1) < 0)
+ return -1;
+ }
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* A helper for save_tuple. Push the len elements in tuple t on the stack. */
+static int
+store_tuple_elements(PickleState *state, PicklerObject *self, PyObject *t,
+ Py_ssize_t len)
+{
+ Py_ssize_t i;
+
+ assert(PyTuple_Size(t) == len);
+
+ for (i = 0; i < len; i++) {
+ PyObject *element = PyTuple_GET_ITEM(t, i);
+
+ if (element == NULL)
+ return -1;
+ if (save(state, self, element, 0) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Tuples are ubiquitous in the pickle protocols, so many techniques are
+ * used across protocols to minimize the space needed to pickle them.
+ * Tuples are also the only builtin immutable type that can be recursive
+ * (a tuple can be reached from itself), and that requires some subtle
+ * magic so that it works in all cases. IOW, this is a long routine.
+ */
+static int
+save_tuple(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ Py_ssize_t len, i;
+
+ const char mark_op = MARK;
+ const char tuple_op = TUPLE;
+ const char pop_op = POP;
+ const char pop_mark_op = POP_MARK;
+ const char len2opcode[] = {EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3};
+
+ if ((len = PyTuple_Size(obj)) < 0)
+ return -1;
+
+ if (len == 0) {
+ char pdata[2];
+
+ if (self->proto) {
+ pdata[0] = EMPTY_TUPLE;
+ len = 1;
+ }
+ else {
+ pdata[0] = MARK;
+ pdata[1] = TUPLE;
+ len = 2;
+ }
+ if (_Pickler_Write(self, pdata, len) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* The tuple isn't in the memo now. If it shows up there after
+ * saving the tuple elements, the tuple must be recursive, in
+ * which case we'll pop everything we put on the stack, and fetch
+ * its value from the memo.
+ */
+ if (len <= 3 && self->proto >= 2) {
+ /* Use TUPLE{1,2,3} opcodes. */
+ if (store_tuple_elements(state, self, obj, len) < 0)
+ return -1;
+
+ if (PyMemoTable_Get(self->memo, obj)) {
+ /* pop the len elements */
+ for (i = 0; i < len; i++)
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ /* fetch from memo */
+ if (memo_get(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+ }
+ else { /* Not recursive. */
+ if (_Pickler_Write(self, len2opcode + len, 1) < 0)
+ return -1;
+ }
+ goto memoize;
+ }
+
+ /* proto < 2 and len > 0, or proto >= 2 and len > 3.
+ * Generate MARK e1 e2 ... TUPLE
+ */
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+
+ if (store_tuple_elements(state, self, obj, len) < 0)
+ return -1;
+
+ if (PyMemoTable_Get(self->memo, obj)) {
+ /* pop the stack stuff we pushed */
+ if (self->bin) {
+ if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
+ return -1;
+ }
+ else {
+ /* Note that we pop one more than len, to remove
+ * the MARK too.
+ */
+ for (i = 0; i <= len; i++)
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ }
+ /* fetch from memo */
+ if (memo_get(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+ }
+ else { /* Not recursive. */
+ if (_Pickler_Write(self, &tuple_op, 1) < 0)
+ return -1;
+ }
+
+ memoize:
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* iter is an iterator giving items, and we batch up chunks of
+ * MARK item item ... item APPENDS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty list, or list-like object, for the APPENDS to operate on.
+ * Returns 0 on success, <0 on error.
+ */
+static int
+batch_list(PickleState *state, PicklerObject *self, PyObject *iter)
+{
+ PyObject *obj = NULL;
+ PyObject *firstitem = NULL;
+ int i, n;
+
+ const char mark_op = MARK;
+ const char append_op = APPEND;
+ const char appends_op = APPENDS;
+
+ assert(iter != NULL);
+
+ /* XXX: I think this function could be made faster by avoiding the
+ iterator interface and fetching objects directly from list using
+ PyList_GET_ITEM.
+ */
+
+ if (self->proto == 0) {
+ /* APPENDS isn't available; do one at a time. */
+ for (;;) {
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ return -1;
+ break;
+ }
+ i = save(state, self, obj, 0);
+ Py_DECREF(obj);
+ if (i < 0)
+ return -1;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ return -1;
+ }
+ return 0;
+ }
+
+ /* proto > 0: write in batches of BATCHSIZE. */
+ do {
+ /* Get first item */
+ firstitem = PyIter_Next(iter);
+ if (firstitem == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* nothing more to add */
+ break;
+ }
+
+ /* Try to get a second item */
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* Only one item to write */
+ if (save(state, self, firstitem, 0) < 0)
+ goto error;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ break;
+ }
+
+ /* More than one item to write */
+
+ /* Pump out MARK, items, APPENDS. */
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ goto error;
+
+ if (save(state, self, firstitem, 0) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ n = 1;
+
+ /* Fetch and save up to BATCHSIZE items */
+ while (obj) {
+ if (save(state, self, obj, 0) < 0)
+ goto error;
+ Py_CLEAR(obj);
+ n += 1;
+
+ if (n == BATCHSIZE)
+ break;
+
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+ break;
+ }
+ }
+
+ if (_Pickler_Write(self, &appends_op, 1) < 0)
+ goto error;
+
+ } while (n == BATCHSIZE);
+ return 0;
+
+ error:
+ Py_XDECREF(firstitem);
+ Py_XDECREF(obj);
+ return -1;
+}
+
+/* This is a variant of batch_list() above, specialized for lists (with no
+ * support for list subclasses). Like batch_list(), we batch up chunks of
+ * MARK item item ... item APPENDS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty list, or list-like object, for the APPENDS to operate on.
+ * Returns 0 on success, -1 on error.
+ *
+ * This version is considerably faster than batch_list(), if less general.
+ *
+ * Note that this only works for protocols > 0.
+ */
+static int
+batch_list_exact(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *item = NULL;
+ Py_ssize_t this_batch, total;
+
+ const char append_op = APPEND;
+ const char appends_op = APPENDS;
+ const char mark_op = MARK;
+
+ assert(obj != NULL);
+ assert(self->proto > 0);
+ assert(PyList_CheckExact(obj));
+
+ if (PyList_GET_SIZE(obj) == 1) {
+ item = PyList_GET_ITEM(obj, 0);
+ Py_INCREF(item);
+ int err = save(state, self, item, 0);
+ Py_DECREF(item);
+ if (err < 0)
+ return -1;
+ if (_Pickler_Write(self, &append_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* Write in batches of BATCHSIZE. */
+ total = 0;
+ do {
+ this_batch = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (total < PyList_GET_SIZE(obj)) {
+ item = PyList_GET_ITEM(obj, total);
+ Py_INCREF(item);
+ int err = save(state, self, item, 0);
+ Py_DECREF(item);
+ if (err < 0)
+ return -1;
+ total++;
+ if (++this_batch == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &appends_op, 1) < 0)
+ return -1;
+
+ } while (total < PyList_GET_SIZE(obj));
+
+ return 0;
+}
+
+static int
+save_list(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ char header[3];
+ Py_ssize_t len;
+ int status = 0;
+
+ if (self->fast && !fast_save_enter(self, obj))
+ goto error;
+
+ /* Create an empty list. */
+ if (self->bin) {
+ header[0] = EMPTY_LIST;
+ len = 1;
+ }
+ else {
+ header[0] = MARK;
+ header[1] = LIST;
+ len = 2;
+ }
+
+ if (_Pickler_Write(self, header, len) < 0)
+ goto error;
+
+ /* Get list length, and bow out early if empty. */
+ if ((len = PyList_Size(obj)) < 0)
+ goto error;
+
+ if (memo_put(state, self, obj) < 0)
+ goto error;
+
+ if (len != 0) {
+ /* Materialize the list elements. */
+ if (PyList_CheckExact(obj) && self->proto > 0) {
+ if (_Py_EnterRecursiveCall(" while pickling an object"))
+ goto error;
+ status = batch_list_exact(state, self, obj);
+ _Py_LeaveRecursiveCall();
+ } else {
+ PyObject *iter = PyObject_GetIter(obj);
+ if (iter == NULL)
+ goto error;
+
+ if (_Py_EnterRecursiveCall(" while pickling an object")) {
+ Py_DECREF(iter);
+ goto error;
+ }
+ status = batch_list(state, self, iter);
+ _Py_LeaveRecursiveCall();
+ Py_DECREF(iter);
+ }
+ }
+ if (0) {
+ error:
+ status = -1;
+ }
+
+ if (self->fast && !fast_save_leave(self, obj))
+ status = -1;
+
+ return status;
+}
+
+/* iter is an iterator giving (key, value) pairs, and we batch up chunks of
+ * MARK key value ... key value SETITEMS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty dict, or dict-like object, for the SETITEMS to operate on.
+ * Returns 0 on success, <0 on error.
+ *
+ * This is very much like batch_list(). The difference between saving
+ * elements directly, and picking apart two-tuples, is so long-winded at
+ * the C level, though, that attempts to combine these routines were too
+ * ugly to bear.
+ */
+static int
+batch_dict(PickleState *state, PicklerObject *self, PyObject *iter)
+{
+ PyObject *obj = NULL;
+ PyObject *firstitem = NULL;
+ int i, n;
+
+ const char mark_op = MARK;
+ const char setitem_op = SETITEM;
+ const char setitems_op = SETITEMS;
+
+ assert(iter != NULL);
+
+ if (self->proto == 0) {
+ /* SETITEMS isn't available; do one at a time. */
+ for (;;) {
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ return -1;
+ break;
+ }
+ if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
+ PyErr_SetString(PyExc_TypeError, "dict items "
+ "iterator must return 2-tuples");
+ return -1;
+ }
+ i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);
+ if (i >= 0)
+ i = save(state, self, PyTuple_GET_ITEM(obj, 1), 0);
+ Py_DECREF(obj);
+ if (i < 0)
+ return -1;
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
+ return -1;
+ }
+ return 0;
+ }
+
+ /* proto > 0: write in batches of BATCHSIZE. */
+ do {
+ /* Get first item */
+ firstitem = PyIter_Next(iter);
+ if (firstitem == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* nothing more to add */
+ break;
+ }
+ if (!PyTuple_Check(firstitem) || PyTuple_Size(firstitem) != 2) {
+ PyErr_SetString(PyExc_TypeError, "dict items "
+ "iterator must return 2-tuples");
+ goto error;
+ }
+
+ /* Try to get a second item */
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+
+ /* Only one item to write */
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
+ goto error;
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
+ goto error;
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ break;
+ }
+
+ /* More than one item to write */
+
+ /* Pump out MARK, items, SETITEMS. */
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ goto error;
+
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 0), 0) < 0)
+ goto error;
+ if (save(state, self, PyTuple_GET_ITEM(firstitem, 1), 0) < 0)
+ goto error;
+ Py_CLEAR(firstitem);
+ n = 1;
+
+ /* Fetch and save up to BATCHSIZE items */
+ while (obj) {
+ if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
+ PyErr_SetString(PyExc_TypeError, "dict items "
+ "iterator must return 2-tuples");
+ goto error;
+ }
+ if (save(state, self, PyTuple_GET_ITEM(obj, 0), 0) < 0 ||
+ save(state, self, PyTuple_GET_ITEM(obj, 1), 0) < 0)
+ goto error;
+ Py_CLEAR(obj);
+ n += 1;
+
+ if (n == BATCHSIZE)
+ break;
+
+ obj = PyIter_Next(iter);
+ if (obj == NULL) {
+ if (PyErr_Occurred())
+ goto error;
+ break;
+ }
+ }
+
+ if (_Pickler_Write(self, &setitems_op, 1) < 0)
+ goto error;
+
+ } while (n == BATCHSIZE);
+ return 0;
+
+ error:
+ Py_XDECREF(firstitem);
+ Py_XDECREF(obj);
+ return -1;
+}
+
+/* This is a variant of batch_dict() above that specializes for dicts, with no
+ * support for dict subclasses. Like batch_dict(), we batch up chunks of
+ * MARK key value ... key value SETITEMS
+ * opcode sequences. Calling code should have arranged to first create an
+ * empty dict, or dict-like object, for the SETITEMS to operate on.
+ * Returns 0 on success, -1 on error.
+ *
+ * Note that this currently doesn't work for protocol 0.
+ */
+static int
+batch_dict_exact(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *key = NULL, *value = NULL;
+ int i;
+ Py_ssize_t dict_size, ppos = 0;
+
+ const char mark_op = MARK;
+ const char setitem_op = SETITEM;
+ const char setitems_op = SETITEMS;
+
+ assert(obj != NULL && PyDict_CheckExact(obj));
+ assert(self->proto > 0);
+
+ dict_size = PyDict_GET_SIZE(obj);
+
+ /* Special-case len(d) == 1 to save space. */
+ if (dict_size == 1) {
+ PyDict_Next(obj, &ppos, &key, &value);
+ Py_INCREF(key);
+ Py_INCREF(value);
+ if (save(state, self, key, 0) < 0) {
+ goto error;
+ }
+ if (save(state, self, value, 0) < 0) {
+ goto error;
+ }
+ Py_CLEAR(key);
+ Py_CLEAR(value);
+ if (_Pickler_Write(self, &setitem_op, 1) < 0)
+ return -1;
+ return 0;
+ }
+
+ /* Write in batches of BATCHSIZE. */
+ do {
+ i = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (PyDict_Next(obj, &ppos, &key, &value)) {
+ Py_INCREF(key);
+ Py_INCREF(value);
+ if (save(state, self, key, 0) < 0) {
+ goto error;
+ }
+ if (save(state, self, value, 0) < 0) {
+ goto error;
+ }
+ Py_CLEAR(key);
+ Py_CLEAR(value);
+ if (++i == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &setitems_op, 1) < 0)
+ return -1;
+ if (PyDict_GET_SIZE(obj) != dict_size) {
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "dictionary changed size during iteration");
+ return -1;
+ }
+
+ } while (i == BATCHSIZE);
+ return 0;
+error:
+ Py_XDECREF(key);
+ Py_XDECREF(value);
+ return -1;
+}
+
+static int
+save_dict(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *items, *iter;
+ char header[3];
+ Py_ssize_t len;
+ int status = 0;
+ assert(PyDict_Check(obj));
+
+ if (self->fast && !fast_save_enter(self, obj))
+ goto error;
+
+ /* Create an empty dict. */
+ if (self->bin) {
+ header[0] = EMPTY_DICT;
+ len = 1;
+ }
+ else {
+ header[0] = MARK;
+ header[1] = DICT;
+ len = 2;
+ }
+
+ if (_Pickler_Write(self, header, len) < 0)
+ goto error;
+
+ if (memo_put(state, self, obj) < 0)
+ goto error;
+
+ if (PyDict_GET_SIZE(obj)) {
+ /* Save the dict items. */
+ if (PyDict_CheckExact(obj) && self->proto > 0) {
+ /* We can take certain shortcuts if we know this is a dict and
+ not a dict subclass. */
+ if (_Py_EnterRecursiveCall(" while pickling an object"))
+ goto error;
+ status = batch_dict_exact(state, self, obj);
+ _Py_LeaveRecursiveCall();
+ } else {
+ items = PyObject_CallMethodNoArgs(obj, &_Py_ID(items));
+ if (items == NULL)
+ goto error;
+ iter = PyObject_GetIter(items);
+ Py_DECREF(items);
+ if (iter == NULL)
+ goto error;
+ if (_Py_EnterRecursiveCall(" while pickling an object")) {
+ Py_DECREF(iter);
+ goto error;
+ }
+ status = batch_dict(state, self, iter);
+ _Py_LeaveRecursiveCall();
+ Py_DECREF(iter);
+ }
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+
+ if (self->fast && !fast_save_leave(self, obj))
+ status = -1;
+
+ return status;
+}
+
+static int
+save_set(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *item;
+ int i;
+ Py_ssize_t set_size, ppos = 0;
+ Py_hash_t hash;
+
+ const char empty_set_op = EMPTY_SET;
+ const char mark_op = MARK;
+ const char additems_op = ADDITEMS;
+
+ if (self->proto < 4) {
+ PyObject *items;
+ PyObject *reduce_value;
+ int status;
+
+ items = PySequence_List(obj);
+ if (items == NULL) {
+ return -1;
+ }
+ reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PySet_Type, items);
+ Py_DECREF(items);
+ if (reduce_value == NULL) {
+ return -1;
+ }
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+
+ if (_Pickler_Write(self, &empty_set_op, 1) < 0)
+ return -1;
+
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ set_size = PySet_GET_SIZE(obj);
+ if (set_size == 0)
+ return 0; /* nothing to do */
+
+ /* Write in batches of BATCHSIZE. */
+ do {
+ i = 0;
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+ while (_PySet_NextEntry(obj, &ppos, &item, &hash)) {
+ Py_INCREF(item);
+ int err = save(state, self, item, 0);
+ Py_CLEAR(item);
+ if (err < 0)
+ return -1;
+ if (++i == BATCHSIZE)
+ break;
+ }
+ if (_Pickler_Write(self, &additems_op, 1) < 0)
+ return -1;
+ if (PySet_GET_SIZE(obj) != set_size) {
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "set changed size during iteration");
+ return -1;
+ }
+ } while (i == BATCHSIZE);
+
+ return 0;
+}
+
+static int
+save_frozenset(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *iter;
+
+ const char mark_op = MARK;
+ const char frozenset_op = FROZENSET;
+
+ if (self->fast && !fast_save_enter(self, obj))
+ return -1;
+
+ if (self->proto < 4) {
+ PyObject *items;
+ PyObject *reduce_value;
+ int status;
+
+ items = PySequence_List(obj);
+ if (items == NULL) {
+ return -1;
+ }
+ reduce_value = Py_BuildValue("(O(O))", (PyObject*)&PyFrozenSet_Type,
+ items);
+ Py_DECREF(items);
+ if (reduce_value == NULL) {
+ return -1;
+ }
+ /* save_reduce() will memoize the object automatically. */
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+ }
+
+ if (_Pickler_Write(self, &mark_op, 1) < 0)
+ return -1;
+
+ iter = PyObject_GetIter(obj);
+ if (iter == NULL) {
+ return -1;
+ }
+ for (;;) {
+ PyObject *item;
+
+ item = PyIter_Next(iter);
+ if (item == NULL) {
+ if (PyErr_Occurred()) {
+ Py_DECREF(iter);
+ return -1;
+ }
+ break;
+ }
+ if (save(state, self, item, 0) < 0) {
+ Py_DECREF(item);
+ Py_DECREF(iter);
+ return -1;
+ }
+ Py_DECREF(item);
+ }
+ Py_DECREF(iter);
+
+ /* If the object is already in the memo, this means it is
+ recursive. In this case, throw away everything we put on the
+ stack, and fetch the object back from the memo. */
+ if (PyMemoTable_Get(self->memo, obj)) {
+ const char pop_mark_op = POP_MARK;
+
+ if (_Pickler_Write(self, &pop_mark_op, 1) < 0)
+ return -1;
+ if (memo_get(state, self, obj) < 0)
+ return -1;
+ return 0;
+ }
+
+ if (_Pickler_Write(self, &frozenset_op, 1) < 0)
+ return -1;
+ if (memo_put(state, self, obj) < 0)
+ return -1;
+
+ return 0;
+}
+
+static int
+fix_imports(PickleState *st, PyObject **module_name, PyObject **global_name)
+{
+ PyObject *key;
+ PyObject *item;
+
+ key = PyTuple_Pack(2, *module_name, *global_name);
+ if (key == NULL)
+ return -1;
+ item = PyDict_GetItemWithError(st->name_mapping_3to2, key);
+ Py_DECREF(key);
+ if (item) {
+ PyObject *fixed_module_name;
+ PyObject *fixed_global_name;
+
+ if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_NAME_MAPPING values "
+ "should be 2-tuples, not %.200s",
+ Py_TYPE(item)->tp_name);
+ return -1;
+ }
+ fixed_module_name = PyTuple_GET_ITEM(item, 0);
+ fixed_global_name = PyTuple_GET_ITEM(item, 1);
+ if (!PyUnicode_Check(fixed_module_name) ||
+ !PyUnicode_Check(fixed_global_name)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_NAME_MAPPING values "
+ "should be pairs of str, not (%.200s, %.200s)",
+ Py_TYPE(fixed_module_name)->tp_name,
+ Py_TYPE(fixed_global_name)->tp_name);
+ return -1;
+ }
+
+ Py_CLEAR(*module_name);
+ Py_CLEAR(*global_name);
+ *module_name = Py_NewRef(fixed_module_name);
+ *global_name = Py_NewRef(fixed_global_name);
+ return 0;
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+
+ item = PyDict_GetItemWithError(st->import_mapping_3to2, *module_name);
+ if (item) {
+ if (!PyUnicode_Check(item)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.REVERSE_IMPORT_MAPPING values "
+ "should be strings, not %.200s",
+ Py_TYPE(item)->tp_name);
+ return -1;
+ }
+ Py_XSETREF(*module_name, Py_NewRef(item));
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+save_global(PickleState *st, PicklerObject *self, PyObject *obj,
+ PyObject *name)
+{
+ PyObject *global_name = NULL;
+ PyObject *module_name = NULL;
+ PyObject *module = NULL;
+ PyObject *parent = NULL;
+ PyObject *dotted_path = NULL;
+ PyObject *lastname = NULL;
+ PyObject *cls;
+ int status = 0;
+
+ const char global_op = GLOBAL;
+
+ if (name) {
+ global_name = Py_NewRef(name);
+ }
+ else {
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__qualname__), &global_name) < 0)
+ goto error;
+ if (global_name == NULL) {
+ global_name = PyObject_GetAttr(obj, &_Py_ID(__name__));
+ if (global_name == NULL)
+ goto error;
+ }
+ }
+
+ dotted_path = get_dotted_path(module, global_name);
+ if (dotted_path == NULL)
+ goto error;
+ module_name = whichmodule(obj, dotted_path);
+ if (module_name == NULL)
+ goto error;
+
+ /* XXX: Change to use the import C API directly with level=0 to disallow
+ relative imports.
+
+ XXX: PyImport_ImportModuleLevel could be used. However, this bypasses
+ builtins.__import__. Therefore, _pickle, unlike pickle.py, will ignore
+ custom import functions (IMHO, this would be a nice security
+ feature). The import C API would need to be extended to support the
+ extra parameters of __import__ to fix that. */
+ module = PyImport_Import(module_name);
+ if (module == NULL) {
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: import of module %R failed",
+ obj, module_name);
+ goto error;
+ }
+ lastname = Py_NewRef(PyList_GET_ITEM(dotted_path,
+ PyList_GET_SIZE(dotted_path) - 1));
+ cls = get_deep_attribute(module, dotted_path, &parent);
+ Py_CLEAR(dotted_path);
+ if (cls == NULL) {
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: attribute lookup %S on %S failed",
+ obj, global_name, module_name);
+ goto error;
+ }
+ if (cls != obj) {
+ Py_DECREF(cls);
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: it's not the same object as %S.%S",
+ obj, module_name, global_name);
+ goto error;
+ }
+ Py_DECREF(cls);
+
+ if (self->proto >= 2) {
+ /* See whether this is in the extension registry, and if
+ * so generate an EXT opcode.
+ */
+ PyObject *extension_key;
+ PyObject *code_obj; /* extension code as Python object */
+ long code; /* extension code as C value */
+ char pdata[5];
+ Py_ssize_t n;
+
+ extension_key = PyTuple_Pack(2, module_name, global_name);
+ if (extension_key == NULL) {
+ goto error;
+ }
+ code_obj = PyDict_GetItemWithError(st->extension_registry,
+ extension_key);
+ Py_DECREF(extension_key);
+ /* The object is not registered in the extension registry.
+ This is the most likely code path. */
+ if (code_obj == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ goto gen_global;
+ }
+
+ /* XXX: pickle.py doesn't check neither the type, nor the range
+ of the value returned by the extension_registry. It should for
+ consistency. */
+
+ /* Verify code_obj has the right type and value. */
+ if (!PyLong_Check(code_obj)) {
+ PyErr_Format(st->PicklingError,
+ "Can't pickle %R: extension code %R isn't an integer",
+ obj, code_obj);
+ goto error;
+ }
+ code = PyLong_AS_LONG(code_obj);
+ if (code <= 0 || code > 0x7fffffffL) {
+ if (!PyErr_Occurred())
+ PyErr_Format(st->PicklingError, "Can't pickle %R: extension "
+ "code %ld is out of range", obj, code);
+ goto error;
+ }
+
+ /* Generate an EXT opcode. */
+ if (code <= 0xff) {
+ pdata[0] = EXT1;
+ pdata[1] = (unsigned char)code;
+ n = 2;
+ }
+ else if (code <= 0xffff) {
+ pdata[0] = EXT2;
+ pdata[1] = (unsigned char)(code & 0xff);
+ pdata[2] = (unsigned char)((code >> 8) & 0xff);
+ n = 3;
+ }
+ else {
+ pdata[0] = EXT4;
+ pdata[1] = (unsigned char)(code & 0xff);
+ pdata[2] = (unsigned char)((code >> 8) & 0xff);
+ pdata[3] = (unsigned char)((code >> 16) & 0xff);
+ pdata[4] = (unsigned char)((code >> 24) & 0xff);
+ n = 5;
+ }
+
+ if (_Pickler_Write(self, pdata, n) < 0)
+ goto error;
+ }
+ else {
+ gen_global:
+ if (parent == module) {
+ Py_SETREF(global_name, Py_NewRef(lastname));
+ }
+ if (self->proto >= 4) {
+ const char stack_global_op = STACK_GLOBAL;
+
+ if (save(st, self, module_name, 0) < 0)
+ goto error;
+ if (save(st, self, global_name, 0) < 0)
+ goto error;
+
+ if (_Pickler_Write(self, &stack_global_op, 1) < 0)
+ goto error;
+ }
+ else if (parent != module) {
+ PyObject *reduce_value = Py_BuildValue("(O(OO))",
+ st->getattr, parent, lastname);
+ if (reduce_value == NULL)
+ goto error;
+ status = save_reduce(st, self, reduce_value, NULL);
+ Py_DECREF(reduce_value);
+ if (status < 0)
+ goto error;
+ }
+ else {
+ /* Generate a normal global opcode if we are using a pickle
+ protocol < 4, or if the object is not registered in the
+ extension registry. */
+ PyObject *encoded;
+ PyObject *(*unicode_encoder)(PyObject *);
+
+ if (_Pickler_Write(self, &global_op, 1) < 0)
+ goto error;
+
+ /* For protocol < 3 and if the user didn't request against doing
+ so, we convert module names to the old 2.x module names. */
+ if (self->proto < 3 && self->fix_imports) {
+ if (fix_imports(st, &module_name, &global_name) < 0) {
+ goto error;
+ }
+ }
+
+ /* Since Python 3.0 now supports non-ASCII identifiers, we encode
+ both the module name and the global name using UTF-8. We do so
+ only when we are using the pickle protocol newer than version
+ 3. This is to ensure compatibility with older Unpickler running
+ on Python 2.x. */
+ if (self->proto == 3) {
+ unicode_encoder = PyUnicode_AsUTF8String;
+ }
+ else {
+ unicode_encoder = PyUnicode_AsASCIIString;
+ }
+ encoded = unicode_encoder(module_name);
+ if (encoded == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
+ PyErr_Format(st->PicklingError,
+ "can't pickle module identifier '%S' using "
+ "pickle protocol %i",
+ module_name, self->proto);
+ goto error;
+ }
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+ PyBytes_GET_SIZE(encoded)) < 0) {
+ Py_DECREF(encoded);
+ goto error;
+ }
+ Py_DECREF(encoded);
+ if(_Pickler_Write(self, "\n", 1) < 0)
+ goto error;
+
+ /* Save the name of the module. */
+ encoded = unicode_encoder(global_name);
+ if (encoded == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
+ PyErr_Format(st->PicklingError,
+ "can't pickle global identifier '%S' using "
+ "pickle protocol %i",
+ global_name, self->proto);
+ goto error;
+ }
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+ PyBytes_GET_SIZE(encoded)) < 0) {
+ Py_DECREF(encoded);
+ goto error;
+ }
+ Py_DECREF(encoded);
+ if (_Pickler_Write(self, "\n", 1) < 0)
+ goto error;
+ }
+ /* Memoize the object. */
+ if (memo_put(st, self, obj) < 0)
+ goto error;
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ Py_XDECREF(module_name);
+ Py_XDECREF(global_name);
+ Py_XDECREF(module);
+ Py_XDECREF(parent);
+ Py_XDECREF(dotted_path);
+ Py_XDECREF(lastname);
+
+ return status;
+}
+
+static int
+save_singleton_type(PickleState *state, PicklerObject *self, PyObject *obj,
+ PyObject *singleton)
+{
+ PyObject *reduce_value;
+ int status;
+
+ reduce_value = Py_BuildValue("O(O)", &PyType_Type, singleton);
+ if (reduce_value == NULL) {
+ return -1;
+ }
+ status = save_reduce(state, self, reduce_value, obj);
+ Py_DECREF(reduce_value);
+ return status;
+}
+
+static int
+save_type(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ if (obj == (PyObject *)&_PyNone_Type) {
+ return save_singleton_type(state, self, obj, Py_None);
+ }
+ else if (obj == (PyObject *)&PyEllipsis_Type) {
+ return save_singleton_type(state, self, obj, Py_Ellipsis);
+ }
+ else if (obj == (PyObject *)&_PyNotImplemented_Type) {
+ return save_singleton_type(state, self, obj, Py_NotImplemented);
+ }
+ return save_global(state, self, obj, NULL);
+}
+
+static int
+save_pers(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ PyObject *pid = NULL;
+ int status = 0;
+
+ const char persid_op = PERSID;
+ const char binpersid_op = BINPERSID;
+
+ pid = call_method(self->pers_func, self->pers_func_self, obj);
+ if (pid == NULL)
+ return -1;
+
+ if (pid != Py_None) {
+ if (self->bin) {
+ if (save(state, self, pid, 1) < 0 ||
+ _Pickler_Write(self, &binpersid_op, 1) < 0)
+ goto error;
+ }
+ else {
+ PyObject *pid_str;
+
+ pid_str = PyObject_Str(pid);
+ if (pid_str == NULL)
+ goto error;
+
+ /* XXX: Should it check whether the pid contains embedded
+ newlines? */
+ if (!PyUnicode_IS_ASCII(pid_str)) {
+ PyErr_SetString(state->PicklingError,
+ "persistent IDs in protocol 0 must be "
+ "ASCII strings");
+ Py_DECREF(pid_str);
+ goto error;
+ }
+
+ if (_Pickler_Write(self, &persid_op, 1) < 0 ||
+ _Pickler_Write(self, PyUnicode_DATA(pid_str),
+ PyUnicode_GET_LENGTH(pid_str)) < 0 ||
+ _Pickler_Write(self, "\n", 1) < 0) {
+ Py_DECREF(pid_str);
+ goto error;
+ }
+ Py_DECREF(pid_str);
+ }
+ status = 1;
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ Py_XDECREF(pid);
+
+ return status;
+}
+
+static PyObject *
+get_class(PyObject *obj)
+{
+ PyObject *cls;
+
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__class__), &cls) == 0) {
+ cls = Py_NewRef(Py_TYPE(obj));
+ }
+ return cls;
+}
+
+/* We're saving obj, and args is the 2-thru-5 tuple returned by the
+ * appropriate __reduce__ method for obj.
+ */
+static int
+save_reduce(PickleState *st, PicklerObject *self, PyObject *args,
+ PyObject *obj)
+{
+ PyObject *callable;
+ PyObject *argtup;
+ PyObject *state = NULL;
+ PyObject *listitems = Py_None;
+ PyObject *dictitems = Py_None;
+ PyObject *state_setter = Py_None;
+ Py_ssize_t size;
+ int use_newobj = 0, use_newobj_ex = 0;
+
+ const char reduce_op = REDUCE;
+ const char build_op = BUILD;
+ const char newobj_op = NEWOBJ;
+ const char newobj_ex_op = NEWOBJ_EX;
+
+ size = PyTuple_Size(args);
+ if (size < 2 || size > 6) {
+ PyErr_SetString(st->PicklingError, "tuple returned by "
+ "__reduce__ must contain 2 through 6 elements");
+ return -1;
+ }
+
+ if (!PyArg_UnpackTuple(args, "save_reduce", 2, 6,
+ &callable, &argtup, &state, &listitems, &dictitems,
+ &state_setter))
+ return -1;
+
+ if (!PyCallable_Check(callable)) {
+ PyErr_SetString(st->PicklingError, "first item of the tuple "
+ "returned by __reduce__ must be callable");
+ return -1;
+ }
+ if (!PyTuple_Check(argtup)) {
+ PyErr_SetString(st->PicklingError, "second item of the tuple "
+ "returned by __reduce__ must be a tuple");
+ return -1;
+ }
+
+ if (state == Py_None)
+ state = NULL;
+
+ if (listitems == Py_None)
+ listitems = NULL;
+ else if (!PyIter_Check(listitems)) {
+ PyErr_Format(st->PicklingError, "fourth element of the tuple "
+ "returned by __reduce__ must be an iterator, not %s",
+ Py_TYPE(listitems)->tp_name);
+ return -1;
+ }
+
+ if (dictitems == Py_None)
+ dictitems = NULL;
+ else if (!PyIter_Check(dictitems)) {
+ PyErr_Format(st->PicklingError, "fifth element of the tuple "
+ "returned by __reduce__ must be an iterator, not %s",
+ Py_TYPE(dictitems)->tp_name);
+ return -1;
+ }
+
+ if (state_setter == Py_None)
+ state_setter = NULL;
+ else if (!PyCallable_Check(state_setter)) {
+ PyErr_Format(st->PicklingError, "sixth element of the tuple "
+ "returned by __reduce__ must be a function, not %s",
+ Py_TYPE(state_setter)->tp_name);
+ return -1;
+ }
+
+ if (self->proto >= 2) {
+ PyObject *name;
+
+ if (_PyObject_LookupAttr(callable, &_Py_ID(__name__), &name) < 0) {
+ return -1;
+ }
+ if (name != NULL && PyUnicode_Check(name)) {
+ use_newobj_ex = _PyUnicode_Equal(name, &_Py_ID(__newobj_ex__));
+ if (!use_newobj_ex) {
+ use_newobj = _PyUnicode_Equal(name, &_Py_ID(__newobj__));
+ }
+ }
+ Py_XDECREF(name);
+ }
+
+ if (use_newobj_ex) {
+ PyObject *cls;
+ PyObject *args;
+ PyObject *kwargs;
+
+ if (PyTuple_GET_SIZE(argtup) != 3) {
+ PyErr_Format(st->PicklingError,
+ "length of the NEWOBJ_EX argument tuple must be "
+ "exactly 3, not %zd", PyTuple_GET_SIZE(argtup));
+ return -1;
+ }
+
+ cls = PyTuple_GET_ITEM(argtup, 0);
+ if (!PyType_Check(cls)) {
+ PyErr_Format(st->PicklingError,
+ "first item from NEWOBJ_EX argument tuple must "
+ "be a class, not %.200s", Py_TYPE(cls)->tp_name);
+ return -1;
+ }
+ args = PyTuple_GET_ITEM(argtup, 1);
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(st->PicklingError,
+ "second item from NEWOBJ_EX argument tuple must "
+ "be a tuple, not %.200s", Py_TYPE(args)->tp_name);
+ return -1;
+ }
+ kwargs = PyTuple_GET_ITEM(argtup, 2);
+ if (!PyDict_Check(kwargs)) {
+ PyErr_Format(st->PicklingError,
+ "third item from NEWOBJ_EX argument tuple must "
+ "be a dict, not %.200s", Py_TYPE(kwargs)->tp_name);
+ return -1;
+ }
+
+ if (self->proto >= 4) {
+ if (save(st, self, cls, 0) < 0 ||
+ save(st, self, args, 0) < 0 ||
+ save(st, self, kwargs, 0) < 0 ||
+ _Pickler_Write(self, &newobj_ex_op, 1) < 0) {
+ return -1;
+ }
+ }
+ else {
+ PyObject *newargs;
+ PyObject *cls_new;
+ Py_ssize_t i;
+
+ newargs = PyTuple_New(PyTuple_GET_SIZE(args) + 2);
+ if (newargs == NULL)
+ return -1;
+
+ cls_new = PyObject_GetAttr(cls, &_Py_ID(__new__));
+ if (cls_new == NULL) {
+ Py_DECREF(newargs);
+ return -1;
+ }
+ PyTuple_SET_ITEM(newargs, 0, cls_new);
+ PyTuple_SET_ITEM(newargs, 1, Py_NewRef(cls));
+ for (i = 0; i < PyTuple_GET_SIZE(args); i++) {
+ PyObject *item = PyTuple_GET_ITEM(args, i);
+ PyTuple_SET_ITEM(newargs, i + 2, Py_NewRef(item));
+ }
+
+ callable = PyObject_Call(st->partial, newargs, kwargs);
+ Py_DECREF(newargs);
+ if (callable == NULL)
+ return -1;
+
+ newargs = PyTuple_New(0);
+ if (newargs == NULL) {
+ Py_DECREF(callable);
+ return -1;
+ }
+
+ if (save(st, self, callable, 0) < 0 ||
+ save(st, self, newargs, 0) < 0 ||
+ _Pickler_Write(self, &reduce_op, 1) < 0) {
+ Py_DECREF(newargs);
+ Py_DECREF(callable);
+ return -1;
+ }
+ Py_DECREF(newargs);
+ Py_DECREF(callable);
+ }
+ }
+ else if (use_newobj) {
+ PyObject *cls;
+ PyObject *newargtup;
+ PyObject *obj_class;
+ int p;
+
+ /* Sanity checks. */
+ if (PyTuple_GET_SIZE(argtup) < 1) {
+ PyErr_SetString(st->PicklingError, "__newobj__ arglist is empty");
+ return -1;
+ }
+
+ cls = PyTuple_GET_ITEM(argtup, 0);
+ if (!PyType_Check(cls)) {
+ PyErr_SetString(st->PicklingError, "args[0] from "
+ "__newobj__ args is not a type");
+ return -1;
+ }
+
+ if (obj != NULL) {
+ obj_class = get_class(obj);
+ if (obj_class == NULL) {
+ return -1;
+ }
+ p = obj_class != cls;
+ Py_DECREF(obj_class);
+ if (p) {
+ PyErr_SetString(st->PicklingError, "args[0] from "
+ "__newobj__ args has the wrong class");
+ return -1;
+ }
+ }
+ /* XXX: These calls save() are prone to infinite recursion. Imagine
+ what happen if the value returned by the __reduce__() method of
+ some extension type contains another object of the same type. Ouch!
+
+ Here is a quick example, that I ran into, to illustrate what I
+ mean:
+
+ >>> import pickle, copyreg
+ >>> copyreg.dispatch_table.pop(complex)
+ >>> pickle.dumps(1+2j)
+ Traceback (most recent call last):
+ ...
+ RecursionError: maximum recursion depth exceeded
+
+ Removing the complex class from copyreg.dispatch_table made the
+ __reduce_ex__() method emit another complex object:
+
+ >>> (1+1j).__reduce_ex__(2)
+ (<function __newobj__ at 0xb7b71c3c>,
+ (<class 'complex'>, (1+1j)), None, None, None)
+
+ Thus when save() was called on newargstup (the 2nd item) recursion
+ ensued. Of course, the bug was in the complex class which had a
+ broken __getnewargs__() that emitted another complex object. But,
+ the point, here, is it is quite easy to end up with a broken reduce
+ function. */
+
+ /* Save the class and its __new__ arguments. */
+ if (save(st, self, cls, 0) < 0) {
+ return -1;
+ }
+
+ newargtup = PyTuple_GetSlice(argtup, 1, PyTuple_GET_SIZE(argtup));
+ if (newargtup == NULL)
+ return -1;
+
+ p = save(st, self, newargtup, 0);
+ Py_DECREF(newargtup);
+ if (p < 0)
+ return -1;
+
+ /* Add NEWOBJ opcode. */
+ if (_Pickler_Write(self, &newobj_op, 1) < 0)
+ return -1;
+ }
+ else { /* Not using NEWOBJ. */
+ if (save(st, self, callable, 0) < 0 ||
+ save(st, self, argtup, 0) < 0 ||
+ _Pickler_Write(self, &reduce_op, 1) < 0)
+ return -1;
+ }
+
+ /* obj can be NULL when save_reduce() is used directly. A NULL obj means
+ the caller do not want to memoize the object. Not particularly useful,
+ but that is to mimic the behavior save_reduce() in pickle.py when
+ obj is None. */
+ if (obj != NULL) {
+ /* If the object is already in the memo, this means it is
+ recursive. In this case, throw away everything we put on the
+ stack, and fetch the object back from the memo. */
+ if (PyMemoTable_Get(self->memo, obj)) {
+ const char pop_op = POP;
+
+ if (_Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ if (memo_get(st, self, obj) < 0)
+ return -1;
+
+ return 0;
+ }
+ else if (memo_put(st, self, obj) < 0)
+ return -1;
+ }
+
+ if (listitems && batch_list(st, self, listitems) < 0)
+ return -1;
+
+ if (dictitems && batch_dict(st, self, dictitems) < 0)
+ return -1;
+
+ if (state) {
+ if (state_setter == NULL) {
+ if (save(st, self, state, 0) < 0 ||
+ _Pickler_Write(self, &build_op, 1) < 0)
+ return -1;
+ }
+ else {
+
+ /* If a state_setter is specified, call it instead of load_build to
+ * update obj's with its previous state.
+ * The first 4 save/write instructions push state_setter and its
+ * tuple of expected arguments (obj, state) onto the stack. The
+ * REDUCE opcode triggers the state_setter(obj, state) function
+ * call. Finally, because state-updating routines only do in-place
+ * modification, the whole operation has to be stack-transparent.
+ * Thus, we finally pop the call's output from the stack.*/
+
+ const char tupletwo_op = TUPLE2;
+ const char pop_op = POP;
+ if (save(st, self, state_setter, 0) < 0 ||
+ save(st, self, obj, 0) < 0 || save(st, self, state, 0) < 0 ||
+ _Pickler_Write(self, &tupletwo_op, 1) < 0 ||
+ _Pickler_Write(self, &reduce_op, 1) < 0 ||
+ _Pickler_Write(self, &pop_op, 1) < 0)
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static int
+save(PickleState *st, PicklerObject *self, PyObject *obj, int pers_save)
+{
+ PyTypeObject *type;
+ PyObject *reduce_func = NULL;
+ PyObject *reduce_value = NULL;
+ int status = 0;
+
+ if (_Pickler_OpcodeBoundary(self) < 0)
+ return -1;
+
+ /* The extra pers_save argument is necessary to avoid calling save_pers()
+ on its returned object. */
+ if (!pers_save && self->pers_func) {
+ /* save_pers() returns:
+ -1 to signal an error;
+ 0 if it did nothing successfully;
+ 1 if a persistent id was saved.
+ */
+ if ((status = save_pers(st, self, obj)) != 0)
+ return status;
+ }
+
+ type = Py_TYPE(obj);
+
+ /* The old cPickle had an optimization that used switch-case statement
+ dispatching on the first letter of the type name. This has was removed
+ since benchmarks shown that this optimization was actually slowing
+ things down. */
+
+ /* Atom types; these aren't memoized, so don't check the memo. */
+
+ if (obj == Py_None) {
+ return save_none(self, obj);
+ }
+ else if (obj == Py_False || obj == Py_True) {
+ return save_bool(self, obj);
+ }
+ else if (type == &PyLong_Type) {
+ return save_long(self, obj);
+ }
+ else if (type == &PyFloat_Type) {
+ return save_float(self, obj);
+ }
+
+ /* Check the memo to see if it has the object. If so, generate
+ a GET (or BINGET) opcode, instead of pickling the object
+ once again. */
+ if (PyMemoTable_Get(self->memo, obj)) {
+ return memo_get(st, self, obj);
+ }
+
+ if (type == &PyBytes_Type) {
+ return save_bytes(st, self, obj);
+ }
+ else if (type == &PyUnicode_Type) {
+ return save_unicode(st, self, obj);
+ }
+
+ /* We're only calling _Py_EnterRecursiveCall here so that atomic
+ types above are pickled faster. */
+ if (_Py_EnterRecursiveCall(" while pickling an object")) {
+ return -1;
+ }
+
+ if (type == &PyDict_Type) {
+ status = save_dict(st, self, obj);
+ goto done;
+ }
+ else if (type == &PySet_Type) {
+ status = save_set(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyFrozenSet_Type) {
+ status = save_frozenset(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyList_Type) {
+ status = save_list(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyTuple_Type) {
+ status = save_tuple(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyByteArray_Type) {
+ status = save_bytearray(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyPickleBuffer_Type) {
+ status = save_picklebuffer(st, self, obj);
+ goto done;
+ }
+
+ /* Now, check reducer_override. If it returns NotImplemented,
+ * fallback to save_type or save_global, and then perhaps to the
+ * regular reduction mechanism.
+ */
+ if (self->reducer_override != NULL) {
+ reduce_value = PyObject_CallOneArg(self->reducer_override, obj);
+ if (reduce_value == NULL) {
+ goto error;
+ }
+ if (reduce_value != Py_NotImplemented) {
+ goto reduce;
+ }
+ Py_SETREF(reduce_value, NULL);
+ }
+
+ if (type == &PyType_Type) {
+ status = save_type(st, self, obj);
+ goto done;
+ }
+ else if (type == &PyFunction_Type) {
+ status = save_global(st, self, obj, NULL);
+ goto done;
+ }
+
+ /* XXX: This part needs some unit tests. */
+
+ /* Get a reduction callable, and call it. This may come from
+ * self.dispatch_table, copyreg.dispatch_table, the object's
+ * __reduce_ex__ method, or the object's __reduce__ method.
+ */
+ if (self->dispatch_table == NULL) {
+ reduce_func = PyDict_GetItemWithError(st->dispatch_table,
+ (PyObject *)type);
+ if (reduce_func == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ } else {
+ /* PyDict_GetItemWithError() returns a borrowed reference.
+ Increase the reference count to be consistent with
+ PyObject_GetItem and _PyObject_GetAttrId used below. */
+ Py_INCREF(reduce_func);
+ }
+ } else {
+ reduce_func = PyObject_GetItem(self->dispatch_table,
+ (PyObject *)type);
+ if (reduce_func == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError))
+ PyErr_Clear();
+ else
+ goto error;
+ }
+ }
+ if (reduce_func != NULL) {
+ reduce_value = _Pickle_FastCall(reduce_func, Py_NewRef(obj));
+ }
+ else if (PyType_IsSubtype(type, &PyType_Type)) {
+ status = save_global(st, self, obj, NULL);
+ goto done;
+ }
+ else {
+ /* XXX: If the __reduce__ method is defined, __reduce_ex__ is
+ automatically defined as __reduce__. While this is convenient, this
+ make it impossible to know which method was actually called. Of
+ course, this is not a big deal. But still, it would be nice to let
+ the user know which method was called when something go
+ wrong. Incidentally, this means if __reduce_ex__ is not defined, we
+ don't actually have to check for a __reduce__ method. */
+
+ /* Check for a __reduce_ex__ method. */
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__reduce_ex__), &reduce_func) < 0) {
+ goto error;
+ }
+ if (reduce_func != NULL) {
+ PyObject *proto;
+ proto = PyLong_FromLong(self->proto);
+ if (proto != NULL) {
+ reduce_value = _Pickle_FastCall(reduce_func, proto);
+ }
+ }
+ else {
+ /* Check for a __reduce__ method. */
+ if (_PyObject_LookupAttr(obj, &_Py_ID(__reduce__), &reduce_func) < 0) {
+ goto error;
+ }
+ if (reduce_func != NULL) {
+ reduce_value = PyObject_CallNoArgs(reduce_func);
+ }
+ else {
+ PyErr_Format(st->PicklingError,
+ "can't pickle '%.200s' object: %R",
+ type->tp_name, obj);
+ goto error;
+ }
+ }
+ }
+
+ if (reduce_value == NULL)
+ goto error;
+
+ reduce:
+ if (PyUnicode_Check(reduce_value)) {
+ status = save_global(st, self, obj, reduce_value);
+ goto done;
+ }
+
+ if (!PyTuple_Check(reduce_value)) {
+ PyErr_SetString(st->PicklingError,
+ "__reduce__ must return a string or tuple");
+ goto error;
+ }
+
+ status = save_reduce(st, self, reduce_value, obj);
+
+ if (0) {
+ error:
+ status = -1;
+ }
+ done:
+
+ _Py_LeaveRecursiveCall();
+ Py_XDECREF(reduce_func);
+ Py_XDECREF(reduce_value);
+
+ return status;
+}
+
+static int
+dump(PickleState *state, PicklerObject *self, PyObject *obj)
+{
+ const char stop_op = STOP;
+ int status = -1;
+ PyObject *tmp;
+
+ if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(reducer_override),
+ &tmp) < 0) {
+ goto error;
+ }
+ /* Cache the reducer_override method, if it exists. */
+ if (tmp != NULL) {
+ Py_XSETREF(self->reducer_override, tmp);
+ }
+ else {
+ Py_CLEAR(self->reducer_override);
+ }
+
+ if (self->proto >= 2) {
+ char header[2];
+
+ header[0] = PROTO;
+ assert(self->proto >= 0 && self->proto < 256);
+ header[1] = (unsigned char)self->proto;
+ if (_Pickler_Write(self, header, 2) < 0)
+ goto error;
+ if (self->proto >= 4)
+ self->framing = 1;
+ }
+
+ if (save(state, self, obj, 0) < 0 ||
+ _Pickler_Write(self, &stop_op, 1) < 0 ||
+ _Pickler_CommitFrame(self) < 0)
+ goto error;
+
+ // Success
+ status = 0;
+
+ error:
+ self->framing = 0;
+
+ /* Break the reference cycle we generated at the beginning this function
+ * call when setting the reducer_override attribute of the Pickler instance
+ * to a bound method of the same instance. This is important as the Pickler
+ * instance holds a reference to each object it has pickled (through its
+ * memo): thus, these objects won't be garbage-collected as long as the
+ * Pickler itself is not collected. */
+ Py_CLEAR(self->reducer_override);
+ return status;
+}
+
+/*[clinic input]
+
+_pickle.Pickler.clear_memo
+
+Clears the pickler's "memo".
+
+The memo is the data structure that remembers which objects the
+pickler has already seen, so that shared or recursive objects are
+pickled by reference and not by value. This method is useful when
+re-using picklers.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Pickler_clear_memo_impl(PicklerObject *self)
+/*[clinic end generated code: output=8665c8658aaa094b input=01bdad52f3d93e56]*/
+{
+ if (self->memo)
+ PyMemoTable_Clear(self->memo);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+
+_pickle.Pickler.dump
+
+ cls: defining_class
+ obj: object
+ /
+
+Write a pickled representation of the given object to the open file.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Pickler_dump_impl(PicklerObject *self, PyTypeObject *cls,
+ PyObject *obj)
+/*[clinic end generated code: output=952cf7f68b1445bb input=f949d84151983594]*/
+{
+ PickleState *st = _Pickle_GetStateByClass(cls);
+ /* Check whether the Pickler was initialized correctly (issue3664).
+ Developers often forget to call __init__() in their subclasses, which
+ would trigger a segfault without this check. */
+ if (self->write == NULL) {
+ PyErr_Format(st->PicklingError,
+ "Pickler.__init__() was not called by %s.__init__()",
+ Py_TYPE(self)->tp_name);
+ return NULL;
+ }
+
+ if (_Pickler_ClearBuffer(self) < 0)
+ return NULL;
+
+ if (dump(st, self, obj) < 0)
+ return NULL;
+
+ if (_Pickler_FlushToFile(self) < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+
+_pickle.Pickler.__sizeof__ -> size_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static size_t
+_pickle_Pickler___sizeof___impl(PicklerObject *self)
+/*[clinic end generated code: output=23ad75658d3b59ff input=d8127c8e7012ebd7]*/
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->memo != NULL) {
+ res += sizeof(PyMemoTable);
+ res += self->memo->mt_allocated * sizeof(PyMemoEntry);
+ }
+ if (self->output_buffer != NULL) {
+ size_t s = _PySys_GetSizeOf(self->output_buffer);
+ if (s == (size_t)-1) {
+ return -1;
+ }
+ res += s;
+ }
+ return res;
+}
+
+static struct PyMethodDef Pickler_methods[] = {
+ _PICKLE_PICKLER_DUMP_METHODDEF
+ _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF
+ _PICKLE_PICKLER___SIZEOF___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+Pickler_clear(PicklerObject *self)
+{
+ Py_CLEAR(self->output_buffer);
+ Py_CLEAR(self->write);
+ Py_CLEAR(self->pers_func);
+ Py_CLEAR(self->dispatch_table);
+ Py_CLEAR(self->fast_memo);
+ Py_CLEAR(self->reducer_override);
+ Py_CLEAR(self->buffer_callback);
+
+ if (self->memo != NULL) {
+ PyMemoTable *memo = self->memo;
+ self->memo = NULL;
+ PyMemoTable_Del(memo);
+ }
+ return 0;
+}
+
+static void
+Pickler_dealloc(PicklerObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ (void)Pickler_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->write);
+ Py_VISIT(self->pers_func);
+ Py_VISIT(self->dispatch_table);
+ Py_VISIT(self->fast_memo);
+ Py_VISIT(self->reducer_override);
+ Py_VISIT(self->buffer_callback);
+ PyMemoTable *memo = self->memo;
+ if (memo && memo->mt_table) {
+ Py_ssize_t i = memo->mt_allocated;
+ while (--i >= 0) {
+ Py_VISIT(memo->mt_table[i].me_key);
+ }
+ }
+
+ return 0;
+}
+
+
+/*[clinic input]
+
+_pickle.Pickler.__init__
+
+ file: object
+ protocol: object = None
+ fix_imports: bool = True
+ buffer_callback: object = None
+
+This takes a binary file for writing a pickle data stream.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
+protocol is 4. It was introduced in Python 3.4, and is incompatible
+with previous versions.
+
+Specifying a negative protocol version selects the highest protocol
+version supported. The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+The *file* argument must have a write() method that accepts a single
+bytes argument. It can thus be a file object opened for binary
+writing, an io.BytesIO instance, or any other custom object that meets
+this interface.
+
+If *fix_imports* is True and protocol is less than 3, pickle will try
+to map the new Python 3 names to the old module names used in Python
+2, so that the pickle data stream is readable with Python 2.
+
+If *buffer_callback* is None (the default), buffer views are
+serialized into *file* as part of the pickle stream.
+
+If *buffer_callback* is not None, then it can be called any number
+of times with a buffer view. If the callback returns a false value
+(such as None), the given buffer is out-of-band; otherwise the
+buffer is serialized in-band, i.e. inside the pickle stream.
+
+It is an error if *buffer_callback* is not None and *protocol*
+is None or smaller than 5.
+
+[clinic start generated code]*/
+
+static int
+_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
+ PyObject *protocol, int fix_imports,
+ PyObject *buffer_callback)
+/*[clinic end generated code: output=0abedc50590d259b input=a7c969699bf5dad3]*/
+{
+ /* In case of multiple __init__() calls, clear previous content. */
+ if (self->write != NULL)
+ (void)Pickler_clear(self);
+
+ if (_Pickler_SetProtocol(self, protocol, fix_imports) < 0)
+ return -1;
+
+ if (_Pickler_SetOutputStream(self, file) < 0)
+ return -1;
+
+ if (_Pickler_SetBufferCallback(self, buffer_callback) < 0)
+ return -1;
+
+ /* memo and output_buffer may have already been created in _Pickler_New */
+ if (self->memo == NULL) {
+ self->memo = PyMemoTable_New();
+ if (self->memo == NULL)
+ return -1;
+ }
+ self->output_len = 0;
+ if (self->output_buffer == NULL) {
+ self->max_output_len = WRITE_BUF_SIZE;
+ self->output_buffer = PyBytes_FromStringAndSize(NULL,
+ self->max_output_len);
+ if (self->output_buffer == NULL)
+ return -1;
+ }
+
+ self->fast = 0;
+ self->fast_nesting = 0;
+ self->fast_memo = NULL;
+
+ if (init_method_ref((PyObject *)self, &_Py_ID(persistent_id),
+ &self->pers_func, &self->pers_func_self) < 0)
+ {
+ return -1;
+ }
+ if (self->dispatch_table != NULL) {
+ return 0;
+ }
+ if (_PyObject_LookupAttr((PyObject *)self, &_Py_ID(dispatch_table),
+ &self->dispatch_table) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/* Define a proxy object for the Pickler's internal memo object. This is to
+ * avoid breaking code like:
+ * pickler.memo.clear()
+ * and
+ * pickler.memo = saved_memo
+ * Is this a good idea? Not really, but we don't want to break code that uses
+ * it. Note that we don't implement the entire mapping API here. This is
+ * intentional, as these should be treated as black-box implementation details.
+ */
+
+/*[clinic input]
+_pickle.PicklerMemoProxy.clear
+
+Remove all items from memo.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=5fb9370d48ae8b05 input=ccc186dacd0f1405]*/
+{
+ if (self->pickler->memo)
+ PyMemoTable_Clear(self->pickler->memo);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_pickle.PicklerMemoProxy.copy
+
+Copy the memo to a new object.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
+{
+ PyMemoTable *memo;
+ PyObject *new_memo = PyDict_New();
+ if (new_memo == NULL)
+ return NULL;
+
+ memo = self->pickler->memo;
+ for (size_t i = 0; i < memo->mt_allocated; ++i) {
+ PyMemoEntry entry = memo->mt_table[i];
+ if (entry.me_key != NULL) {
+ int status;
+ PyObject *key, *value;
+
+ key = PyLong_FromVoidPtr(entry.me_key);
+ if (key == NULL) {
+ goto error;
+ }
+ value = Py_BuildValue("nO", entry.me_value, entry.me_key);
+ if (value == NULL) {
+ Py_DECREF(key);
+ goto error;
+ }
+ status = PyDict_SetItem(new_memo, key, value);
+ Py_DECREF(key);
+ Py_DECREF(value);
+ if (status < 0)
+ goto error;
+ }
+ }
+ return new_memo;
+
+ error:
+ Py_XDECREF(new_memo);
+ return NULL;
+}
+
+/*[clinic input]
+_pickle.PicklerMemoProxy.__reduce__
+
+Implement pickle support.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self)
+/*[clinic end generated code: output=bebba1168863ab1d input=2f7c540e24b7aae4]*/
+{
+ PyObject *reduce_value, *dict_args;
+ PyObject *contents = _pickle_PicklerMemoProxy_copy_impl(self);
+ if (contents == NULL)
+ return NULL;
+
+ reduce_value = PyTuple_New(2);
+ if (reduce_value == NULL) {
+ Py_DECREF(contents);
+ return NULL;
+ }
+ dict_args = PyTuple_New(1);
+ if (dict_args == NULL) {
+ Py_DECREF(contents);
+ Py_DECREF(reduce_value);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(dict_args, 0, contents);
+ PyTuple_SET_ITEM(reduce_value, 0, Py_NewRef(&PyDict_Type));
+ PyTuple_SET_ITEM(reduce_value, 1, dict_args);
+ return reduce_value;
+}
+
+static PyMethodDef picklerproxy_methods[] = {
+ _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF
+ _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF
+ _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static void
+PicklerMemoProxy_dealloc(PicklerMemoProxyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_CLEAR(self->pickler);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+PicklerMemoProxy_traverse(PicklerMemoProxyObject *self,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->pickler);
+ return 0;
+}
+
+static int
+PicklerMemoProxy_clear(PicklerMemoProxyObject *self)
+{
+ Py_CLEAR(self->pickler);
+ return 0;
+}
+
+static PyType_Slot memoproxy_slots[] = {
+ {Py_tp_dealloc, PicklerMemoProxy_dealloc},
+ {Py_tp_traverse, PicklerMemoProxy_traverse},
+ {Py_tp_clear, PicklerMemoProxy_clear},
+ {Py_tp_methods, picklerproxy_methods},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL},
+};
+
+static PyType_Spec memoproxy_spec = {
+ .name = "_pickle.PicklerMemoProxy",
+ .basicsize = sizeof(PicklerMemoProxyObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = memoproxy_slots,
+};
+
+static PyObject *
+PicklerMemoProxy_New(PicklerObject *pickler)
+{
+ PicklerMemoProxyObject *self;
+ PickleState *st = _Pickle_FindStateByType(Py_TYPE(pickler));
+ self = PyObject_GC_New(PicklerMemoProxyObject, st->PicklerMemoProxyType);
+ if (self == NULL)
+ return NULL;
+ self->pickler = (PicklerObject*)Py_NewRef(pickler);
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*****************************************************************************/
+
+static PyObject *
+Pickler_get_memo(PicklerObject *self, void *Py_UNUSED(ignored))
+{
+ return PicklerMemoProxy_New(self);
+}
+
+static int
+Pickler_set_memo(PicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
+{
+ PyMemoTable *new_memo = NULL;
+
+ if (obj == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+
+ PickleState *st = _Pickle_FindStateByType(Py_TYPE(self));
+ if (Py_IS_TYPE(obj, st->PicklerMemoProxyType)) {
+ PicklerObject *pickler =
+ ((PicklerMemoProxyObject *)obj)->pickler;
+
+ new_memo = PyMemoTable_Copy(pickler->memo);
+ if (new_memo == NULL)
+ return -1;
+ }
+ else if (PyDict_Check(obj)) {
+ Py_ssize_t i = 0;
+ PyObject *key, *value;
+
+ new_memo = PyMemoTable_New();
+ if (new_memo == NULL)
+ return -1;
+
+ while (PyDict_Next(obj, &i, &key, &value)) {
+ Py_ssize_t memo_id;
+ PyObject *memo_obj;
+
+ if (!PyTuple_Check(value) || PyTuple_GET_SIZE(value) != 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "'memo' values must be 2-item tuples");
+ goto error;
+ }
+ memo_id = PyLong_AsSsize_t(PyTuple_GET_ITEM(value, 0));
+ if (memo_id == -1 && PyErr_Occurred())
+ goto error;
+ memo_obj = PyTuple_GET_ITEM(value, 1);
+ if (PyMemoTable_Set(new_memo, memo_obj, memo_id) < 0)
+ goto error;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "'memo' attribute must be a PicklerMemoProxy object "
+ "or dict, not %.200s", Py_TYPE(obj)->tp_name);
+ return -1;
+ }
+
+ PyMemoTable_Del(self->memo);
+ self->memo = new_memo;
+
+ return 0;
+
+ error:
+ if (new_memo)
+ PyMemoTable_Del(new_memo);
+ return -1;
+}
+
+static PyObject *
+Pickler_get_persid(PicklerObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->pers_func == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "persistent_id");
+ return NULL;
+ }
+ return reconstruct_method(self->pers_func, self->pers_func_self);
+}
+
+static int
+Pickler_set_persid(PicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+ if (!PyCallable_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "persistent_id must be a callable taking one argument");
+ return -1;
+ }
+
+ self->pers_func_self = NULL;
+ Py_XSETREF(self->pers_func, Py_NewRef(value));
+
+ return 0;
+}
+
+static PyMemberDef Pickler_members[] = {
+ {"bin", T_INT, offsetof(PicklerObject, bin)},
+ {"fast", T_INT, offsetof(PicklerObject, fast)},
+ {"dispatch_table", T_OBJECT_EX, offsetof(PicklerObject, dispatch_table)},
+ {NULL}
+};
+
+static PyGetSetDef Pickler_getsets[] = {
+ {"memo", (getter)Pickler_get_memo,
+ (setter)Pickler_set_memo},
+ {"persistent_id", (getter)Pickler_get_persid,
+ (setter)Pickler_set_persid},
+ {NULL}
+};
+
+static PyType_Slot pickler_type_slots[] = {
+ {Py_tp_dealloc, Pickler_dealloc},
+ {Py_tp_methods, Pickler_methods},
+ {Py_tp_members, Pickler_members},
+ {Py_tp_getset, Pickler_getsets},
+ {Py_tp_clear, Pickler_clear},
+ {Py_tp_doc, (char*)_pickle_Pickler___init____doc__},
+ {Py_tp_traverse, Pickler_traverse},
+ {Py_tp_init, _pickle_Pickler___init__},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec pickler_type_spec = {
+ .name = "_pickle.Pickler",
+ .basicsize = sizeof(PicklerObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = pickler_type_slots,
+};
+
+/* Temporary helper for calling self.find_class().
+
+ XXX: It would be nice to able to avoid Python function call overhead, by
+ using directly the C version of find_class(), when find_class() is not
+ overridden by a subclass. Although, this could become rather hackish. A
+ simpler optimization would be to call the C function when self is not a
+ subclass instance. */
+static PyObject *
+find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
+{
+ return PyObject_CallMethodObjArgs((PyObject *)self, &_Py_ID(find_class),
+ module_name, global_name, NULL);
+}
+
+static Py_ssize_t
+marker(PickleState *st, UnpicklerObject *self)
+{
+ if (self->num_marks < 1) {
+ PyErr_SetString(st->UnpicklingError, "could not find MARK");
+ return -1;
+ }
+
+ Py_ssize_t mark = self->marks[--self->num_marks];
+ self->stack->mark_set = self->num_marks != 0;
+ self->stack->fence = self->num_marks ?
+ self->marks[self->num_marks - 1] : 0;
+ return mark;
+}
+
+static int
+load_none(PickleState *state, UnpicklerObject *self)
+{
+ PDATA_APPEND(self->stack, Py_None, -1);
+ return 0;
+}
+
+static int
+load_int(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ char *endptr, *s;
+ Py_ssize_t len;
+ long x;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ errno = 0;
+ /* XXX: Should the base argument of strtol() be explicitly set to 10?
+ XXX(avassalotti): Should this uses PyOS_strtol()? */
+ x = strtol(s, &endptr, 0);
+
+ if (errno || (*endptr != '\n' && *endptr != '\0')) {
+ /* Hm, maybe we've got something long. Let's try reading
+ * it as a Python int object. */
+ errno = 0;
+ /* XXX: Same thing about the base here. */
+ value = PyLong_FromString(s, NULL, 0);
+ if (value == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert string to int");
+ return -1;
+ }
+ }
+ else {
+ if (len == 3 && (x == 0 || x == 1)) {
+ if ((value = PyBool_FromLong(x)) == NULL)
+ return -1;
+ }
+ else {
+ if ((value = PyLong_FromLong(x)) == NULL)
+ return -1;
+ }
+ }
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_bool(PickleState *state, UnpicklerObject *self, PyObject *boolean)
+{
+ assert(boolean == Py_True || boolean == Py_False);
+ PDATA_APPEND(self->stack, boolean, -1);
+ return 0;
+}
+
+/* s contains x bytes of an unsigned little-endian integer. Return its value
+ * as a C Py_ssize_t, or -1 if it's higher than PY_SSIZE_T_MAX.
+ */
+static Py_ssize_t
+calc_binsize(char *bytes, int nbytes)
+{
+ unsigned char *s = (unsigned char *)bytes;
+ int i;
+ size_t x = 0;
+
+ if (nbytes > (int)sizeof(size_t)) {
+ /* Check for integer overflow. BINBYTES8 and BINUNICODE8 opcodes
+ * have 64-bit size that can't be represented on 32-bit platform.
+ */
+ for (i = (int)sizeof(size_t); i < nbytes; i++) {
+ if (s[i])
+ return -1;
+ }
+ nbytes = (int)sizeof(size_t);
+ }
+ for (i = 0; i < nbytes; i++) {
+ x |= (size_t) s[i] << (8 * i);
+ }
+
+ if (x > PY_SSIZE_T_MAX)
+ return -1;
+ else
+ return (Py_ssize_t) x;
+}
+
+/* s contains x bytes of a little-endian integer. Return its value as a
+ * C int. Obscure: when x is 1 or 2, this is an unsigned little-endian
+ * int, but when x is 4 it's a signed one. This is a historical source
+ * of x-platform bugs.
+ */
+static long
+calc_binint(char *bytes, int nbytes)
+{
+ unsigned char *s = (unsigned char *)bytes;
+ Py_ssize_t i;
+ long x = 0;
+
+ for (i = 0; i < nbytes; i++) {
+ x |= (long)s[i] << (8 * i);
+ }
+
+ /* Unlike BININT1 and BININT2, BININT (more accurately BININT4)
+ * is signed, so on a box with longs bigger than 4 bytes we need
+ * to extend a BININT's sign bit to the full width.
+ */
+ if (SIZEOF_LONG > 4 && nbytes == 4) {
+ x |= -(x & (1L << 31));
+ }
+
+ return x;
+}
+
+static int
+load_binintx(UnpicklerObject *self, char *s, int size)
+{
+ PyObject *value;
+ long x;
+
+ x = calc_binint(s, size);
+
+ if ((value = PyLong_FromLong(x)) == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_binint(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ if (_Unpickler_Read(self, state, &s, 4) < 0)
+ return -1;
+
+ return load_binintx(self, s, 4);
+}
+
+static int
+load_binint1(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ if (_Unpickler_Read(self, state, &s, 1) < 0)
+ return -1;
+
+ return load_binintx(self, s, 1);
+}
+
+static int
+load_binint2(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ if (_Unpickler_Read(self, state, &s, 2) < 0)
+ return -1;
+
+ return load_binintx(self, s, 2);
+}
+
+static int
+load_long(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ char *s = NULL;
+ Py_ssize_t len;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ /* s[len-2] will usually be 'L' (and s[len-1] is '\n'); we need to remove
+ the 'L' before calling PyLong_FromString. In order to maintain
+ compatibility with Python 3.0.0, we don't actually *require*
+ the 'L' to be present. */
+ if (s[len-2] == 'L')
+ s[len-2] = '\0';
+ /* XXX: Should the base argument explicitly set to 10? */
+ value = PyLong_FromString(s, NULL, 0);
+ if (value == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+/* 'size' bytes contain the # of bytes of little-endian 256's-complement
+ * data following.
+ */
+static int
+load_counted_long(PickleState *st, UnpicklerObject *self, int size)
+{
+ PyObject *value;
+ char *nbytes;
+ char *pdata;
+
+ assert(size == 1 || size == 4);
+ if (_Unpickler_Read(self, st, &nbytes, size) < 0)
+ return -1;
+
+ size = calc_binint(nbytes, size);
+ if (size < 0) {
+ /* Corrupt or hostile pickle -- we never write one like this */
+ PyErr_SetString(st->UnpicklingError,
+ "LONG pickle has negative byte count");
+ return -1;
+ }
+
+ if (size == 0)
+ value = PyLong_FromLong(0L);
+ else {
+ /* Read the raw little-endian bytes and convert. */
+ if (_Unpickler_Read(self, st, &pdata, size) < 0)
+ return -1;
+ value = _PyLong_FromByteArray((unsigned char *)pdata, (size_t)size,
+ 1 /* little endian */ , 1 /* signed */ );
+ }
+ if (value == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_float(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ char *endptr, *s;
+ Py_ssize_t len;
+ double d;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ errno = 0;
+ d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError);
+ if (d == -1.0 && PyErr_Occurred())
+ return -1;
+ if ((endptr[0] != '\n') && (endptr[0] != '\0')) {
+ PyErr_SetString(PyExc_ValueError, "could not convert string to float");
+ return -1;
+ }
+ value = PyFloat_FromDouble(d);
+ if (value == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_binfloat(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ double x;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 8) < 0)
+ return -1;
+
+ x = PyFloat_Unpack8(s, 0);
+ if (x == -1.0 && PyErr_Occurred())
+ return -1;
+
+ if ((value = PyFloat_FromDouble(x)) == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_string(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *bytes;
+ PyObject *obj;
+ Py_ssize_t len;
+ char *s, *p;
+
+ if ((len = _Unpickler_Readline(st, self, &s)) < 0)
+ return -1;
+ /* Strip the newline */
+ len--;
+ /* Strip outermost quotes */
+ if (len >= 2 && s[0] == s[len - 1] && (s[0] == '\'' || s[0] == '"')) {
+ p = s + 1;
+ len -= 2;
+ }
+ else {
+ PyErr_SetString(st->UnpicklingError,
+ "the STRING opcode argument must be quoted");
+ return -1;
+ }
+ assert(len >= 0);
+
+ /* Use the PyBytes API to decode the string, since that is what is used
+ to encode, and then coerce the result to Unicode. */
+ bytes = PyBytes_DecodeEscape(p, len, NULL, 0, NULL);
+ if (bytes == NULL)
+ return -1;
+
+ /* Leave the Python 2.x strings as bytes if the *encoding* given to the
+ Unpickler was 'bytes'. Otherwise, convert them to unicode. */
+ if (strcmp(self->encoding, "bytes") == 0) {
+ obj = bytes;
+ }
+ else {
+ obj = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors);
+ Py_DECREF(bytes);
+ if (obj == NULL) {
+ return -1;
+ }
+ }
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static int
+load_counted_binstring(PickleState *st, UnpicklerObject *self, int nbytes)
+{
+ PyObject *obj;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, st, &s, nbytes) < 0)
+ return -1;
+
+ size = calc_binsize(s, nbytes);
+ if (size < 0) {
+ PyErr_Format(st->UnpicklingError,
+ "BINSTRING exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ if (_Unpickler_Read(self, st, &s, size) < 0)
+ return -1;
+
+ /* Convert Python 2.x strings to bytes if the *encoding* given to the
+ Unpickler was 'bytes'. Otherwise, convert them to unicode. */
+ if (strcmp(self->encoding, "bytes") == 0) {
+ obj = PyBytes_FromStringAndSize(s, size);
+ }
+ else {
+ obj = PyUnicode_Decode(s, size, self->encoding, self->errors);
+ }
+ if (obj == NULL) {
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static int
+load_counted_binbytes(PickleState *state, UnpicklerObject *self, int nbytes)
+{
+ PyObject *bytes;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, nbytes) < 0)
+ return -1;
+
+ size = calc_binsize(s, nbytes);
+ if (size < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "BINBYTES exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, size);
+ if (bytes == NULL)
+ return -1;
+ if (_Unpickler_ReadInto(state, self, PyBytes_AS_STRING(bytes), size) < 0) {
+ Py_DECREF(bytes);
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, bytes, -1);
+ return 0;
+}
+
+static int
+load_counted_bytearray(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *bytearray;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 8) < 0) {
+ return -1;
+ }
+
+ size = calc_binsize(s, 8);
+ if (size < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "BYTEARRAY8 exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ bytearray = PyByteArray_FromStringAndSize(NULL, size);
+ if (bytearray == NULL) {
+ return -1;
+ }
+ char *str = PyByteArray_AS_STRING(bytearray);
+ if (_Unpickler_ReadInto(state, self, str, size) < 0) {
+ Py_DECREF(bytearray);
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, bytearray, -1);
+ return 0;
+}
+
+static int
+load_next_buffer(PickleState *st, UnpicklerObject *self)
+{
+ if (self->buffers == NULL) {
+ PyErr_SetString(st->UnpicklingError,
+ "pickle stream refers to out-of-band data "
+ "but no *buffers* argument was given");
+ return -1;
+ }
+ PyObject *buf = PyIter_Next(self->buffers);
+ if (buf == NULL) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(st->UnpicklingError,
+ "not enough out-of-band buffers");
+ }
+ return -1;
+ }
+
+ PDATA_PUSH(self->stack, buf, -1);
+ return 0;
+}
+
+static int
+load_readonly_buffer(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t len = Py_SIZE(self->stack);
+ if (len <= self->stack->fence) {
+ return Pdata_stack_underflow(state, self->stack);
+ }
+
+ PyObject *obj = self->stack->data[len - 1];
+ PyObject *view = PyMemoryView_FromObject(obj);
+ if (view == NULL) {
+ return -1;
+ }
+ if (!PyMemoryView_GET_BUFFER(view)->readonly) {
+ /* Original object is writable */
+ PyMemoryView_GET_BUFFER(view)->readonly = 1;
+ self->stack->data[len - 1] = view;
+ Py_DECREF(obj);
+ }
+ else {
+ /* Original object is read-only, no need to replace it */
+ Py_DECREF(view);
+ }
+ return 0;
+}
+
+static int
+load_unicode(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *str;
+ Py_ssize_t len;
+ char *s = NULL;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 1)
+ return bad_readline(state);
+
+ str = PyUnicode_DecodeRawUnicodeEscape(s, len - 1, NULL);
+ if (str == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, str, -1);
+ return 0;
+}
+
+static int
+load_counted_binunicode(PickleState *state, UnpicklerObject *self, int nbytes)
+{
+ PyObject *str;
+ Py_ssize_t size;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, nbytes) < 0)
+ return -1;
+
+ size = calc_binsize(s, nbytes);
+ if (size < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "BINUNICODE exceeds system's maximum size of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ if (_Unpickler_Read(self, state, &s, size) < 0)
+ return -1;
+
+ str = PyUnicode_DecodeUTF8(s, size, "surrogatepass");
+ if (str == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, str, -1);
+ return 0;
+}
+
+static int
+load_counted_tuple(PickleState *state, UnpicklerObject *self, Py_ssize_t len)
+{
+ PyObject *tuple;
+
+ if (Py_SIZE(self->stack) < len)
+ return Pdata_stack_underflow(state, self->stack);
+
+ tuple = Pdata_poptuple(state, self->stack, Py_SIZE(self->stack) - len);
+ if (tuple == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, tuple, -1);
+ return 0;
+}
+
+static int
+load_tuple(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ return load_counted_tuple(state, self, Py_SIZE(self->stack) - i);
+}
+
+static int
+load_empty_list(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *list;
+
+ if ((list = PyList_New(0)) == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, list, -1);
+ return 0;
+}
+
+static int
+load_empty_dict(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *dict;
+
+ if ((dict = PyDict_New()) == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, dict, -1);
+ return 0;
+}
+
+static int
+load_empty_set(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *set;
+
+ if ((set = PySet_New(NULL)) == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, set, -1);
+ return 0;
+}
+
+static int
+load_list(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *list;
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ list = Pdata_poplist(self->stack, i);
+ if (list == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, list, -1);
+ return 0;
+}
+
+static int
+load_dict(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *dict, *key, *value;
+ Py_ssize_t i, j, k;
+
+ if ((i = marker(st, self)) < 0)
+ return -1;
+ j = Py_SIZE(self->stack);
+
+ if ((dict = PyDict_New()) == NULL)
+ return -1;
+
+ if ((j - i) % 2 != 0) {
+ PyErr_SetString(st->UnpicklingError, "odd number of items for DICT");
+ Py_DECREF(dict);
+ return -1;
+ }
+
+ for (k = i + 1; k < j; k += 2) {
+ key = self->stack->data[k - 1];
+ value = self->stack->data[k];
+ if (PyDict_SetItem(dict, key, value) < 0) {
+ Py_DECREF(dict);
+ return -1;
+ }
+ }
+ Pdata_clear(self->stack, i);
+ PDATA_PUSH(self->stack, dict, -1);
+ return 0;
+}
+
+static int
+load_frozenset(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *items;
+ PyObject *frozenset;
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ items = Pdata_poptuple(state, self->stack, i);
+ if (items == NULL)
+ return -1;
+
+ frozenset = PyFrozenSet_New(items);
+ Py_DECREF(items);
+ if (frozenset == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, frozenset, -1);
+ return 0;
+}
+
+static PyObject *
+instantiate(PyObject *cls, PyObject *args)
+{
+ /* Caller must assure args are a tuple. Normally, args come from
+ Pdata_poptuple which packs objects from the top of the stack
+ into a newly created tuple. */
+ assert(PyTuple_Check(args));
+ if (!PyTuple_GET_SIZE(args) && PyType_Check(cls)) {
+ PyObject *func;
+ if (_PyObject_LookupAttr(cls, &_Py_ID(__getinitargs__), &func) < 0) {
+ return NULL;
+ }
+ if (func == NULL) {
+ return PyObject_CallMethodOneArg(cls, &_Py_ID(__new__), cls);
+ }
+ Py_DECREF(func);
+ }
+ return PyObject_CallObject(cls, args);
+}
+
+static int
+load_obj(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *cls, *args, *obj = NULL;
+ Py_ssize_t i;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ if (Py_SIZE(self->stack) - i < 1)
+ return Pdata_stack_underflow(state, self->stack);
+
+ args = Pdata_poptuple(state, self->stack, i + 1);
+ if (args == NULL)
+ return -1;
+
+ PDATA_POP(state, self->stack, cls);
+ if (cls) {
+ obj = instantiate(cls, args);
+ Py_DECREF(cls);
+ }
+ Py_DECREF(args);
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static int
+load_inst(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *cls = NULL;
+ PyObject *args = NULL;
+ PyObject *obj = NULL;
+ PyObject *module_name;
+ PyObject *class_name;
+ Py_ssize_t len;
+ Py_ssize_t i;
+ char *s;
+
+ if ((i = marker(state, self)) < 0)
+ return -1;
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+
+ /* Here it is safe to use PyUnicode_DecodeASCII(), even though non-ASCII
+ identifiers are permitted in Python 3.0, since the INST opcode is only
+ supported by older protocols on Python 2.x. */
+ module_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
+ if (module_name == NULL)
+ return -1;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) >= 0) {
+ if (len < 2) {
+ Py_DECREF(module_name);
+ return bad_readline(state);
+ }
+ class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
+ if (class_name != NULL) {
+ cls = find_class(self, module_name, class_name);
+ Py_DECREF(class_name);
+ }
+ }
+ Py_DECREF(module_name);
+
+ if (cls == NULL)
+ return -1;
+
+ if ((args = Pdata_poptuple(state, self->stack, i)) != NULL) {
+ obj = instantiate(cls, args);
+ Py_DECREF(args);
+ }
+ Py_DECREF(cls);
+
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+static void
+newobj_unpickling_error(PickleState *st, const char *msg, int use_kwargs,
+ PyObject *arg)
+{
+ PyErr_Format(st->UnpicklingError, msg,
+ use_kwargs ? "NEWOBJ_EX" : "NEWOBJ",
+ Py_TYPE(arg)->tp_name);
+}
+
+static int
+load_newobj(PickleState *state, UnpicklerObject *self, int use_kwargs)
+{
+ PyObject *cls, *args, *kwargs = NULL;
+ PyObject *obj;
+
+ /* Stack is ... cls args [kwargs], and we want to call
+ * cls.__new__(cls, *args, **kwargs).
+ */
+ if (use_kwargs) {
+ PDATA_POP(state, self->stack, kwargs);
+ if (kwargs == NULL) {
+ return -1;
+ }
+ }
+ PDATA_POP(state, self->stack, args);
+ if (args == NULL) {
+ Py_XDECREF(kwargs);
+ return -1;
+ }
+ PDATA_POP(state, self->stack, cls);
+ if (cls == NULL) {
+ Py_XDECREF(kwargs);
+ Py_DECREF(args);
+ return -1;
+ }
+
+ if (!PyType_Check(cls)) {
+ newobj_unpickling_error(state,
+ "%s class argument must be a type, not %.200s",
+ use_kwargs, cls);
+ goto error;
+ }
+ if (((PyTypeObject *)cls)->tp_new == NULL) {
+ newobj_unpickling_error(state,
+ "%s class argument '%.200s' doesn't have __new__",
+ use_kwargs, cls);
+ goto error;
+ }
+ if (!PyTuple_Check(args)) {
+ newobj_unpickling_error(state,
+ "%s args argument must be a tuple, not %.200s",
+ use_kwargs, args);
+ goto error;
+ }
+ if (use_kwargs && !PyDict_Check(kwargs)) {
+ newobj_unpickling_error(state,
+ "%s kwargs argument must be a dict, not %.200s",
+ use_kwargs, kwargs);
+ goto error;
+ }
+
+ obj = ((PyTypeObject *)cls)->tp_new((PyTypeObject *)cls, args, kwargs);
+ if (obj == NULL) {
+ goto error;
+ }
+ Py_XDECREF(kwargs);
+ Py_DECREF(args);
+ Py_DECREF(cls);
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+
+error:
+ Py_XDECREF(kwargs);
+ Py_DECREF(args);
+ Py_DECREF(cls);
+ return -1;
+}
+
+static int
+load_global(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *global = NULL;
+ PyObject *module_name;
+ PyObject *global_name;
+ Py_ssize_t len;
+ char *s;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+ module_name = PyUnicode_DecodeUTF8(s, len - 1, "strict");
+ if (!module_name)
+ return -1;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) >= 0) {
+ if (len < 2) {
+ Py_DECREF(module_name);
+ return bad_readline(state);
+ }
+ global_name = PyUnicode_DecodeUTF8(s, len - 1, "strict");
+ if (global_name) {
+ global = find_class(self, module_name, global_name);
+ Py_DECREF(global_name);
+ }
+ }
+ Py_DECREF(module_name);
+
+ if (global == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, global, -1);
+ return 0;
+}
+
+static int
+load_stack_global(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *global;
+ PyObject *module_name;
+ PyObject *global_name;
+
+ PDATA_POP(st, self->stack, global_name);
+ if (global_name == NULL) {
+ return -1;
+ }
+ PDATA_POP(st, self->stack, module_name);
+ if (module_name == NULL) {
+ Py_DECREF(global_name);
+ return -1;
+ }
+ if (!PyUnicode_CheckExact(module_name) ||
+ !PyUnicode_CheckExact(global_name))
+ {
+ PyErr_SetString(st->UnpicklingError, "STACK_GLOBAL requires str");
+ Py_DECREF(global_name);
+ Py_DECREF(module_name);
+ return -1;
+ }
+ global = find_class(self, module_name, global_name);
+ Py_DECREF(global_name);
+ Py_DECREF(module_name);
+ if (global == NULL)
+ return -1;
+ PDATA_PUSH(self->stack, global, -1);
+ return 0;
+}
+
+static int
+load_persid(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *pid, *obj;
+ Py_ssize_t len;
+ char *s;
+
+ if (self->pers_func) {
+ if ((len = _Unpickler_Readline(st, self, &s)) < 0)
+ return -1;
+ if (len < 1)
+ return bad_readline(st);
+
+ pid = PyUnicode_DecodeASCII(s, len - 1, "strict");
+ if (pid == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
+ PyErr_SetString(st->UnpicklingError,
+ "persistent IDs in protocol 0 must be "
+ "ASCII strings");
+ }
+ return -1;
+ }
+
+ obj = call_method(self->pers_func, self->pers_func_self, pid);
+ Py_DECREF(pid);
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+ }
+ else {
+ PyErr_SetString(st->UnpicklingError,
+ "A load persistent id instruction was encountered, "
+ "but no persistent_load function was specified.");
+ return -1;
+ }
+}
+
+static int
+load_binpersid(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *pid, *obj;
+
+ if (self->pers_func) {
+ PDATA_POP(st, self->stack, pid);
+ if (pid == NULL)
+ return -1;
+
+ obj = call_method(self->pers_func, self->pers_func_self, pid);
+ Py_DECREF(pid);
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+ }
+ else {
+ PyErr_SetString(st->UnpicklingError,
+ "A load persistent id instruction was encountered, "
+ "but no persistent_load function was specified.");
+ return -1;
+ }
+}
+
+static int
+load_pop(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t len = Py_SIZE(self->stack);
+
+ /* Note that we split the (pickle.py) stack into two stacks,
+ * an object stack and a mark stack. We have to be clever and
+ * pop the right one. We do this by looking at the top of the
+ * mark stack first, and only signalling a stack underflow if
+ * the object stack is empty and the mark stack doesn't match
+ * our expectations.
+ */
+ if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) {
+ self->num_marks--;
+ self->stack->mark_set = self->num_marks != 0;
+ self->stack->fence = self->num_marks ?
+ self->marks[self->num_marks - 1] : 0;
+ } else if (len <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ else {
+ len--;
+ Py_DECREF(self->stack->data[len]);
+ Py_SET_SIZE(self->stack, len);
+ }
+ return 0;
+}
+
+static int
+load_pop_mark(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i;
+ if ((i = marker(state, self)) < 0)
+ return -1;
+
+ Pdata_clear(self->stack, i);
+
+ return 0;
+}
+
+static int
+load_dup(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *last;
+ Py_ssize_t len = Py_SIZE(self->stack);
+
+ if (len <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ last = self->stack->data[len - 1];
+ PDATA_APPEND(self->stack, last, -1);
+ return 0;
+}
+
+static int
+load_get(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *key, *value;
+ Py_ssize_t idx;
+ Py_ssize_t len;
+ char *s;
+
+ if ((len = _Unpickler_Readline(st, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(st);
+
+ key = PyLong_FromString(s, NULL, 10);
+ if (key == NULL)
+ return -1;
+ idx = PyLong_AsSsize_t(key);
+ if (idx == -1 && PyErr_Occurred()) {
+ Py_DECREF(key);
+ return -1;
+ }
+
+ value = _Unpickler_MemoGet(self, idx);
+ if (value == NULL) {
+ if (!PyErr_Occurred()) {
+ PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
+ }
+ Py_DECREF(key);
+ return -1;
+ }
+ Py_DECREF(key);
+
+ PDATA_APPEND(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_binget(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, st, &s, 1) < 0)
+ return -1;
+
+ idx = Py_CHARMASK(s[0]);
+
+ value = _Unpickler_MemoGet(self, idx);
+ if (value == NULL) {
+ PyObject *key = PyLong_FromSsize_t(idx);
+ if (key != NULL) {
+ PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
+ Py_DECREF(key);
+ }
+ return -1;
+ }
+
+ PDATA_APPEND(self->stack, value, -1);
+ return 0;
+}
+
+static int
+load_long_binget(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, st, &s, 4) < 0)
+ return -1;
+
+ idx = calc_binsize(s, 4);
+
+ value = _Unpickler_MemoGet(self, idx);
+ if (value == NULL) {
+ PyObject *key = PyLong_FromSsize_t(idx);
+ if (key != NULL) {
+ PyErr_Format(st->UnpicklingError, "Memo value not found at index %ld", idx);
+ Py_DECREF(key);
+ }
+ return -1;
+ }
+
+ PDATA_APPEND(self->stack, value, -1);
+ return 0;
+}
+
+/* Push an object from the extension registry (EXT[124]). nbytes is
+ * the number of bytes following the opcode, holding the index (code) value.
+ */
+static int
+load_extension(PickleState *st, UnpicklerObject *self, int nbytes)
+{
+ char *codebytes; /* the nbytes bytes after the opcode */
+ long code; /* calc_binint returns long */
+ PyObject *py_code; /* code as a Python int */
+ PyObject *obj; /* the object to push */
+ PyObject *pair; /* (module_name, class_name) */
+ PyObject *module_name, *class_name;
+
+ assert(nbytes == 1 || nbytes == 2 || nbytes == 4);
+ if (_Unpickler_Read(self, st, &codebytes, nbytes) < 0)
+ return -1;
+ code = calc_binint(codebytes, nbytes);
+ if (code <= 0) { /* note that 0 is forbidden */
+ /* Corrupt or hostile pickle. */
+ PyErr_SetString(st->UnpicklingError, "EXT specifies code <= 0");
+ return -1;
+ }
+
+ /* Look for the code in the cache. */
+ py_code = PyLong_FromLong(code);
+ if (py_code == NULL)
+ return -1;
+ obj = PyDict_GetItemWithError(st->extension_cache, py_code);
+ if (obj != NULL) {
+ /* Bingo. */
+ Py_DECREF(py_code);
+ PDATA_APPEND(self->stack, obj, -1);
+ return 0;
+ }
+ if (PyErr_Occurred()) {
+ Py_DECREF(py_code);
+ return -1;
+ }
+
+ /* Look up the (module_name, class_name) pair. */
+ pair = PyDict_GetItemWithError(st->inverted_registry, py_code);
+ if (pair == NULL) {
+ Py_DECREF(py_code);
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError, "unregistered extension "
+ "code %ld", code);
+ }
+ return -1;
+ }
+ /* Since the extension registry is manipulable via Python code,
+ * confirm that pair is really a 2-tuple of strings.
+ */
+ if (!PyTuple_Check(pair) || PyTuple_Size(pair) != 2) {
+ goto error;
+ }
+
+ module_name = PyTuple_GET_ITEM(pair, 0);
+ if (!PyUnicode_Check(module_name)) {
+ goto error;
+ }
+
+ class_name = PyTuple_GET_ITEM(pair, 1);
+ if (!PyUnicode_Check(class_name)) {
+ goto error;
+ }
+
+ /* Load the object. */
+ obj = find_class(self, module_name, class_name);
+ if (obj == NULL) {
+ Py_DECREF(py_code);
+ return -1;
+ }
+ /* Cache code -> obj. */
+ code = PyDict_SetItem(st->extension_cache, py_code, obj);
+ Py_DECREF(py_code);
+ if (code < 0) {
+ Py_DECREF(obj);
+ return -1;
+ }
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+
+error:
+ Py_DECREF(py_code);
+ PyErr_Format(PyExc_ValueError, "_inverted_registry[%ld] "
+ "isn't a 2-tuple of strings", code);
+ return -1;
+}
+
+static int
+load_put(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *key, *value;
+ Py_ssize_t idx;
+ Py_ssize_t len;
+ char *s = NULL;
+
+ if ((len = _Unpickler_Readline(state, self, &s)) < 0)
+ return -1;
+ if (len < 2)
+ return bad_readline(state);
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ key = PyLong_FromString(s, NULL, 10);
+ if (key == NULL)
+ return -1;
+ idx = PyLong_AsSsize_t(key);
+ Py_DECREF(key);
+ if (idx < 0) {
+ if (!PyErr_Occurred())
+ PyErr_SetString(PyExc_ValueError,
+ "negative PUT argument");
+ return -1;
+ }
+
+ return _Unpickler_MemoPut(self, idx, value);
+}
+
+static int
+load_binput(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 1) < 0)
+ return -1;
+
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ idx = Py_CHARMASK(s[0]);
+
+ return _Unpickler_MemoPut(self, idx, value);
+}
+
+static int
+load_long_binput(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+ Py_ssize_t idx;
+ char *s;
+
+ if (_Unpickler_Read(self, state, &s, 4) < 0)
+ return -1;
+
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ idx = calc_binsize(s, 4);
+ if (idx < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "negative LONG_BINPUT argument");
+ return -1;
+ }
+
+ return _Unpickler_MemoPut(self, idx, value);
+}
+
+static int
+load_memoize(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *value;
+
+ if (Py_SIZE(self->stack) <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ value = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ return _Unpickler_MemoPut(self, self->memo_len, value);
+}
+
+static int
+do_append(PickleState *state, UnpicklerObject *self, Py_ssize_t x)
+{
+ PyObject *value;
+ PyObject *slice;
+ PyObject *list;
+ PyObject *result;
+ Py_ssize_t len, i;
+
+ len = Py_SIZE(self->stack);
+ if (x > len || x <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ if (len == x) /* nothing to do */
+ return 0;
+
+ list = self->stack->data[x - 1];
+
+ if (PyList_CheckExact(list)) {
+ Py_ssize_t list_len;
+ int ret;
+
+ slice = Pdata_poplist(self->stack, x);
+ if (!slice)
+ return -1;
+ list_len = PyList_GET_SIZE(list);
+ ret = PyList_SetSlice(list, list_len, list_len, slice);
+ Py_DECREF(slice);
+ return ret;
+ }
+ else {
+ PyObject *extend_func;
+
+ if (_PyObject_LookupAttr(list, &_Py_ID(extend), &extend_func) < 0) {
+ return -1;
+ }
+ if (extend_func != NULL) {
+ slice = Pdata_poplist(self->stack, x);
+ if (!slice) {
+ Py_DECREF(extend_func);
+ return -1;
+ }
+ result = _Pickle_FastCall(extend_func, slice);
+ Py_DECREF(extend_func);
+ if (result == NULL)
+ return -1;
+ Py_DECREF(result);
+ }
+ else {
+ PyObject *append_func;
+
+ /* Even if the PEP 307 requires extend() and append() methods,
+ fall back on append() if the object has no extend() method
+ for backward compatibility. */
+ append_func = PyObject_GetAttr(list, &_Py_ID(append));
+ if (append_func == NULL)
+ return -1;
+ for (i = x; i < len; i++) {
+ value = self->stack->data[i];
+ result = _Pickle_FastCall(append_func, value);
+ if (result == NULL) {
+ Pdata_clear(self->stack, i + 1);
+ Py_SET_SIZE(self->stack, x);
+ Py_DECREF(append_func);
+ return -1;
+ }
+ Py_DECREF(result);
+ }
+ Py_SET_SIZE(self->stack, x);
+ Py_DECREF(append_func);
+ }
+ }
+
+ return 0;
+}
+
+static int
+load_append(PickleState *state, UnpicklerObject *self)
+{
+ if (Py_SIZE(self->stack) - 1 <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ return do_append(state, self, Py_SIZE(self->stack) - 1);
+}
+
+static int
+load_appends(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i = marker(state, self);
+ if (i < 0)
+ return -1;
+ return do_append(state, self, i);
+}
+
+static int
+do_setitems(PickleState *st, UnpicklerObject *self, Py_ssize_t x)
+{
+ PyObject *value, *key;
+ PyObject *dict;
+ Py_ssize_t len, i;
+ int status = 0;
+
+ len = Py_SIZE(self->stack);
+ if (x > len || x <= self->stack->fence)
+ return Pdata_stack_underflow(st, self->stack);
+ if (len == x) /* nothing to do */
+ return 0;
+ if ((len - x) % 2 != 0) {
+ /* Corrupt or hostile pickle -- we never write one like this. */
+ PyErr_SetString(st->UnpicklingError,
+ "odd number of items for SETITEMS");
+ return -1;
+ }
+
+ /* Here, dict does not actually need to be a PyDict; it could be anything
+ that supports the __setitem__ attribute. */
+ dict = self->stack->data[x - 1];
+
+ for (i = x + 1; i < len; i += 2) {
+ key = self->stack->data[i - 1];
+ value = self->stack->data[i];
+ if (PyObject_SetItem(dict, key, value) < 0) {
+ status = -1;
+ break;
+ }
+ }
+
+ Pdata_clear(self->stack, x);
+ return status;
+}
+
+static int
+load_setitem(PickleState *state, UnpicklerObject *self)
+{
+ return do_setitems(state, self, Py_SIZE(self->stack) - 2);
+}
+
+static int
+load_setitems(PickleState *state, UnpicklerObject *self)
+{
+ Py_ssize_t i = marker(state, self);
+ if (i < 0)
+ return -1;
+ return do_setitems(state, self, i);
+}
+
+static int
+load_additems(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *set;
+ Py_ssize_t mark, len, i;
+
+ mark = marker(state, self);
+ if (mark < 0)
+ return -1;
+ len = Py_SIZE(self->stack);
+ if (mark > len || mark <= self->stack->fence)
+ return Pdata_stack_underflow(state, self->stack);
+ if (len == mark) /* nothing to do */
+ return 0;
+
+ set = self->stack->data[mark - 1];
+
+ if (PySet_Check(set)) {
+ PyObject *items;
+ int status;
+
+ items = Pdata_poptuple(state, self->stack, mark);
+ if (items == NULL)
+ return -1;
+
+ status = _PySet_Update(set, items);
+ Py_DECREF(items);
+ return status;
+ }
+ else {
+ PyObject *add_func;
+
+ add_func = PyObject_GetAttr(set, &_Py_ID(add));
+ if (add_func == NULL)
+ return -1;
+ for (i = mark; i < len; i++) {
+ PyObject *result;
+ PyObject *item;
+
+ item = self->stack->data[i];
+ result = _Pickle_FastCall(add_func, item);
+ if (result == NULL) {
+ Pdata_clear(self->stack, i + 1);
+ Py_SET_SIZE(self->stack, mark);
+ return -1;
+ }
+ Py_DECREF(result);
+ }
+ Py_SET_SIZE(self->stack, mark);
+ }
+
+ return 0;
+}
+
+static int
+load_build(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *inst, *slotstate;
+ PyObject *setstate;
+ int status = 0;
+
+ /* Stack is ... instance, state. We want to leave instance at
+ * the stack top, possibly mutated via instance.__setstate__(state).
+ */
+ if (Py_SIZE(self->stack) - 2 < self->stack->fence)
+ return Pdata_stack_underflow(st, self->stack);
+
+ PyObject *state;
+ PDATA_POP(st, self->stack, state);
+ if (state == NULL)
+ return -1;
+
+ inst = self->stack->data[Py_SIZE(self->stack) - 1];
+
+ if (_PyObject_LookupAttr(inst, &_Py_ID(__setstate__), &setstate) < 0) {
+ Py_DECREF(state);
+ return -1;
+ }
+ if (setstate != NULL) {
+ PyObject *result;
+
+ /* The explicit __setstate__ is responsible for everything. */
+ result = _Pickle_FastCall(setstate, state);
+ Py_DECREF(setstate);
+ if (result == NULL)
+ return -1;
+ Py_DECREF(result);
+ return 0;
+ }
+
+ /* A default __setstate__. First see whether state embeds a
+ * slot state dict too (a proto 2 addition).
+ */
+ if (PyTuple_Check(state) && PyTuple_GET_SIZE(state) == 2) {
+ PyObject *tmp = state;
+
+ state = PyTuple_GET_ITEM(tmp, 0);
+ slotstate = PyTuple_GET_ITEM(tmp, 1);
+ Py_INCREF(state);
+ Py_INCREF(slotstate);
+ Py_DECREF(tmp);
+ }
+ else
+ slotstate = NULL;
+
+ /* Set inst.__dict__ from the state dict (if any). */
+ if (state != Py_None) {
+ PyObject *dict;
+ PyObject *d_key, *d_value;
+ Py_ssize_t i;
+
+ if (!PyDict_Check(state)) {
+ PyErr_SetString(st->UnpicklingError, "state is not a dictionary");
+ goto error;
+ }
+ dict = PyObject_GetAttr(inst, &_Py_ID(__dict__));
+ if (dict == NULL)
+ goto error;
+
+ i = 0;
+ while (PyDict_Next(state, &i, &d_key, &d_value)) {
+ /* normally the keys for instance attributes are
+ interned. we should try to do that here. */
+ Py_INCREF(d_key);
+ if (PyUnicode_CheckExact(d_key))
+ PyUnicode_InternInPlace(&d_key);
+ if (PyObject_SetItem(dict, d_key, d_value) < 0) {
+ Py_DECREF(d_key);
+ goto error;
+ }
+ Py_DECREF(d_key);
+ }
+ Py_DECREF(dict);
+ }
+
+ /* Also set instance attributes from the slotstate dict (if any). */
+ if (slotstate != NULL) {
+ PyObject *d_key, *d_value;
+ Py_ssize_t i;
+
+ if (!PyDict_Check(slotstate)) {
+ PyErr_SetString(st->UnpicklingError,
+ "slot state is not a dictionary");
+ goto error;
+ }
+ i = 0;
+ while (PyDict_Next(slotstate, &i, &d_key, &d_value)) {
+ if (PyObject_SetAttr(inst, d_key, d_value) < 0)
+ goto error;
+ }
+ }
+
+ if (0) {
+ error:
+ status = -1;
+ }
+
+ Py_DECREF(state);
+ Py_XDECREF(slotstate);
+ return status;
+}
+
+static int
+load_mark(PickleState *state, UnpicklerObject *self)
+{
+
+ /* Note that we split the (pickle.py) stack into two stacks, an
+ * object stack and a mark stack. Here we push a mark onto the
+ * mark stack.
+ */
+
+ if (self->num_marks >= self->marks_size) {
+ size_t alloc = ((size_t)self->num_marks << 1) + 20;
+ Py_ssize_t *marks_new = self->marks;
+ PyMem_RESIZE(marks_new, Py_ssize_t, alloc);
+ if (marks_new == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->marks = marks_new;
+ self->marks_size = (Py_ssize_t)alloc;
+ }
+
+ self->stack->mark_set = 1;
+ self->marks[self->num_marks++] = self->stack->fence = Py_SIZE(self->stack);
+
+ return 0;
+}
+
+static int
+load_reduce(PickleState *state, UnpicklerObject *self)
+{
+ PyObject *callable = NULL;
+ PyObject *argtup = NULL;
+ PyObject *obj = NULL;
+
+ PDATA_POP(state, self->stack, argtup);
+ if (argtup == NULL)
+ return -1;
+ PDATA_POP(state, self->stack, callable);
+ if (callable) {
+ obj = PyObject_CallObject(callable, argtup);
+ Py_DECREF(callable);
+ }
+ Py_DECREF(argtup);
+
+ if (obj == NULL)
+ return -1;
+
+ PDATA_PUSH(self->stack, obj, -1);
+ return 0;
+}
+
+/* Just raises an error if we don't know the protocol specified. PROTO
+ * is the first opcode for protocols >= 2.
+ */
+static int
+load_proto(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ int i;
+
+ if (_Unpickler_Read(self, state, &s, 1) < 0)
+ return -1;
+
+ i = (unsigned char)s[0];
+ if (i <= HIGHEST_PROTOCOL) {
+ self->proto = i;
+ return 0;
+ }
+
+ PyErr_Format(PyExc_ValueError, "unsupported pickle protocol: %d", i);
+ return -1;
+}
+
+static int
+load_frame(PickleState *state, UnpicklerObject *self)
+{
+ char *s;
+ Py_ssize_t frame_len;
+
+ if (_Unpickler_Read(self, state, &s, 8) < 0)
+ return -1;
+
+ frame_len = calc_binsize(s, 8);
+ if (frame_len < 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "FRAME length exceeds system's maximum of %zd bytes",
+ PY_SSIZE_T_MAX);
+ return -1;
+ }
+
+ if (_Unpickler_Read(self, state, &s, frame_len) < 0)
+ return -1;
+
+ /* Rewind to start of frame */
+ self->next_read_idx -= frame_len;
+ return 0;
+}
+
+static PyObject *
+load(PickleState *st, UnpicklerObject *self)
+{
+ PyObject *value = NULL;
+ char *s = NULL;
+
+ self->num_marks = 0;
+ self->stack->mark_set = 0;
+ self->stack->fence = 0;
+ self->proto = 0;
+ if (Py_SIZE(self->stack))
+ Pdata_clear(self->stack, 0);
+
+ /* Convenient macros for the dispatch while-switch loop just below. */
+#define OP(opcode, load_func) \
+ case opcode: if (load_func(st, self) < 0) break; continue;
+
+#define OP_ARG(opcode, load_func, arg) \
+ case opcode: if (load_func(st, self, (arg)) < 0) break; continue;
+
+ while (1) {
+ if (_Unpickler_Read(self, st, &s, 1) < 0) {
+ if (PyErr_ExceptionMatches(st->UnpicklingError)) {
+ PyErr_Format(PyExc_EOFError, "Ran out of input");
+ }
+ return NULL;
+ }
+
+ switch ((enum opcode)s[0]) {
+ OP(NONE, load_none)
+ OP(BININT, load_binint)
+ OP(BININT1, load_binint1)
+ OP(BININT2, load_binint2)
+ OP(INT, load_int)
+ OP(LONG, load_long)
+ OP_ARG(LONG1, load_counted_long, 1)
+ OP_ARG(LONG4, load_counted_long, 4)
+ OP(FLOAT, load_float)
+ OP(BINFLOAT, load_binfloat)
+ OP_ARG(SHORT_BINBYTES, load_counted_binbytes, 1)
+ OP_ARG(BINBYTES, load_counted_binbytes, 4)
+ OP_ARG(BINBYTES8, load_counted_binbytes, 8)
+ OP(BYTEARRAY8, load_counted_bytearray)
+ OP(NEXT_BUFFER, load_next_buffer)
+ OP(READONLY_BUFFER, load_readonly_buffer)
+ OP_ARG(SHORT_BINSTRING, load_counted_binstring, 1)
+ OP_ARG(BINSTRING, load_counted_binstring, 4)
+ OP(STRING, load_string)
+ OP(UNICODE, load_unicode)
+ OP_ARG(SHORT_BINUNICODE, load_counted_binunicode, 1)
+ OP_ARG(BINUNICODE, load_counted_binunicode, 4)
+ OP_ARG(BINUNICODE8, load_counted_binunicode, 8)
+ OP_ARG(EMPTY_TUPLE, load_counted_tuple, 0)
+ OP_ARG(TUPLE1, load_counted_tuple, 1)
+ OP_ARG(TUPLE2, load_counted_tuple, 2)
+ OP_ARG(TUPLE3, load_counted_tuple, 3)
+ OP(TUPLE, load_tuple)
+ OP(EMPTY_LIST, load_empty_list)
+ OP(LIST, load_list)
+ OP(EMPTY_DICT, load_empty_dict)
+ OP(DICT, load_dict)
+ OP(EMPTY_SET, load_empty_set)
+ OP(ADDITEMS, load_additems)
+ OP(FROZENSET, load_frozenset)
+ OP(OBJ, load_obj)
+ OP(INST, load_inst)
+ OP_ARG(NEWOBJ, load_newobj, 0)
+ OP_ARG(NEWOBJ_EX, load_newobj, 1)
+ OP(GLOBAL, load_global)
+ OP(STACK_GLOBAL, load_stack_global)
+ OP(APPEND, load_append)
+ OP(APPENDS, load_appends)
+ OP(BUILD, load_build)
+ OP(DUP, load_dup)
+ OP(BINGET, load_binget)
+ OP(LONG_BINGET, load_long_binget)
+ OP(GET, load_get)
+ OP(MARK, load_mark)
+ OP(BINPUT, load_binput)
+ OP(LONG_BINPUT, load_long_binput)
+ OP(PUT, load_put)
+ OP(MEMOIZE, load_memoize)
+ OP(POP, load_pop)
+ OP(POP_MARK, load_pop_mark)
+ OP(SETITEM, load_setitem)
+ OP(SETITEMS, load_setitems)
+ OP(PERSID, load_persid)
+ OP(BINPERSID, load_binpersid)
+ OP(REDUCE, load_reduce)
+ OP(PROTO, load_proto)
+ OP(FRAME, load_frame)
+ OP_ARG(EXT1, load_extension, 1)
+ OP_ARG(EXT2, load_extension, 2)
+ OP_ARG(EXT4, load_extension, 4)
+ OP_ARG(NEWTRUE, load_bool, Py_True)
+ OP_ARG(NEWFALSE, load_bool, Py_False)
+
+ case STOP:
+ break;
+
+ default:
+ {
+ unsigned char c = (unsigned char) *s;
+ if (0x20 <= c && c <= 0x7e && c != '\'' && c != '\\') {
+ PyErr_Format(st->UnpicklingError,
+ "invalid load key, '%c'.", c);
+ }
+ else {
+ PyErr_Format(st->UnpicklingError,
+ "invalid load key, '\\x%02x'.", c);
+ }
+ return NULL;
+ }
+ }
+
+ break; /* and we are done! */
+ }
+
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
+ if (_Unpickler_SkipConsumed(self) < 0)
+ return NULL;
+
+ PDATA_POP(st, self->stack, value);
+ return value;
+}
+
+/*[clinic input]
+
+_pickle.Unpickler.load
+
+ cls: defining_class
+
+Load a pickle.
+
+Read a pickled object representation from the open file object given
+in the constructor, and return the reconstituted object hierarchy
+specified therein.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Unpickler_load_impl(UnpicklerObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=cc88168f608e3007 input=f5d2f87e61d5f07f]*/
+{
+ UnpicklerObject *unpickler = (UnpicklerObject*)self;
+
+ PickleState *st = _Pickle_GetStateByClass(cls);
+
+ /* Check whether the Unpickler was initialized correctly. This prevents
+ segfaulting if a subclass overridden __init__ with a function that does
+ not call Unpickler.__init__(). Here, we simply ensure that self->read
+ is not NULL. */
+ if (unpickler->read == NULL) {
+ PyErr_Format(st->UnpicklingError,
+ "Unpickler.__init__() was not called by %s.__init__()",
+ Py_TYPE(unpickler)->tp_name);
+ return NULL;
+ }
+
+ return load(st, unpickler);
+}
+
+/* The name of find_class() is misleading. In newer pickle protocols, this
+ function is used for loading any global (i.e., functions), not just
+ classes. The name is kept only for backward compatibility. */
+
+/*[clinic input]
+
+_pickle.Unpickler.find_class
+
+ cls: defining_class
+ module_name: object
+ global_name: object
+ /
+
+Return an object from a specified module.
+
+If necessary, the module will be imported. Subclasses may override
+this method (e.g. to restrict unpickling of arbitrary classes and
+functions).
+
+This method is called whenever a class or a function object is
+needed. Both arguments passed are str objects.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyTypeObject *cls,
+ PyObject *module_name,
+ PyObject *global_name)
+/*[clinic end generated code: output=99577948abb0be81 input=9577745719219fc7]*/
+{
+ PyObject *global;
+ PyObject *module;
+
+ if (PySys_Audit("pickle.find_class", "OO",
+ module_name, global_name) < 0) {
+ return NULL;
+ }
+
+ /* Try to map the old names used in Python 2.x to the new ones used in
+ Python 3.x. We do this only with old pickle protocols and when the
+ user has not disabled the feature. */
+ if (self->proto < 3 && self->fix_imports) {
+ PyObject *key;
+ PyObject *item;
+ PickleState *st = _Pickle_GetStateByClass(cls);
+
+ /* Check if the global (i.e., a function or a class) was renamed
+ or moved to another module. */
+ key = PyTuple_Pack(2, module_name, global_name);
+ if (key == NULL)
+ return NULL;
+ item = PyDict_GetItemWithError(st->name_mapping_2to3, key);
+ Py_DECREF(key);
+ if (item) {
+ if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.NAME_MAPPING values should be "
+ "2-tuples, not %.200s", Py_TYPE(item)->tp_name);
+ return NULL;
+ }
+ module_name = PyTuple_GET_ITEM(item, 0);
+ global_name = PyTuple_GET_ITEM(item, 1);
+ if (!PyUnicode_Check(module_name) ||
+ !PyUnicode_Check(global_name)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.NAME_MAPPING values should be "
+ "pairs of str, not (%.200s, %.200s)",
+ Py_TYPE(module_name)->tp_name,
+ Py_TYPE(global_name)->tp_name);
+ return NULL;
+ }
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ else {
+ /* Check if the module was renamed. */
+ item = PyDict_GetItemWithError(st->import_mapping_2to3, module_name);
+ if (item) {
+ if (!PyUnicode_Check(item)) {
+ PyErr_Format(PyExc_RuntimeError,
+ "_compat_pickle.IMPORT_MAPPING values should be "
+ "strings, not %.200s", Py_TYPE(item)->tp_name);
+ return NULL;
+ }
+ module_name = item;
+ }
+ else if (PyErr_Occurred()) {
+ return NULL;
+ }
+ }
+ }
+
+ /*
+ * we don't use PyImport_GetModule here, because it can return partially-
+ * initialised modules, which then cause the getattribute to fail.
+ */
+ module = PyImport_Import(module_name);
+ if (module == NULL) {
+ return NULL;
+ }
+ global = getattribute(module, global_name, self->proto >= 4);
+ Py_DECREF(module);
+ return global;
+}
+
+/*[clinic input]
+
+_pickle.Unpickler.__sizeof__ -> size_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static size_t
+_pickle_Unpickler___sizeof___impl(UnpicklerObject *self)
+/*[clinic end generated code: output=4648d84c228196df input=27180b2b6b524012]*/
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->memo != NULL)
+ res += self->memo_size * sizeof(PyObject *);
+ if (self->marks != NULL)
+ res += (size_t)self->marks_size * sizeof(Py_ssize_t);
+ if (self->input_line != NULL)
+ res += strlen(self->input_line) + 1;
+ if (self->encoding != NULL)
+ res += strlen(self->encoding) + 1;
+ if (self->errors != NULL)
+ res += strlen(self->errors) + 1;
+ return res;
+}
+
+static struct PyMethodDef Unpickler_methods[] = {
+ _PICKLE_UNPICKLER_LOAD_METHODDEF
+ _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF
+ _PICKLE_UNPICKLER___SIZEOF___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+Unpickler_clear(UnpicklerObject *self)
+{
+ Py_CLEAR(self->readline);
+ Py_CLEAR(self->readinto);
+ Py_CLEAR(self->read);
+ Py_CLEAR(self->peek);
+ Py_CLEAR(self->stack);
+ Py_CLEAR(self->pers_func);
+ Py_CLEAR(self->buffers);
+ if (self->buffer.buf != NULL) {
+ PyBuffer_Release(&self->buffer);
+ self->buffer.buf = NULL;
+ }
+
+ _Unpickler_MemoCleanup(self);
+ PyMem_Free(self->marks);
+ self->marks = NULL;
+ PyMem_Free(self->input_line);
+ self->input_line = NULL;
+ PyMem_Free(self->encoding);
+ self->encoding = NULL;
+ PyMem_Free(self->errors);
+ self->errors = NULL;
+
+ return 0;
+}
+
+static void
+Unpickler_dealloc(UnpicklerObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack((PyObject *)self);
+ (void)Unpickler_clear(self);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+Unpickler_traverse(UnpicklerObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->readline);
+ Py_VISIT(self->readinto);
+ Py_VISIT(self->read);
+ Py_VISIT(self->peek);
+ Py_VISIT(self->stack);
+ Py_VISIT(self->pers_func);
+ Py_VISIT(self->buffers);
+ PyObject **memo = self->memo;
+ if (memo) {
+ Py_ssize_t i = self->memo_size;
+ while (--i >= 0) {
+ Py_VISIT(memo[i]);
+ }
+ }
+ return 0;
+}
+
+/*[clinic input]
+
+_pickle.Unpickler.__init__
+
+ file: object
+ *
+ fix_imports: bool = True
+ encoding: str = 'ASCII'
+ errors: str = 'strict'
+ buffers: object(c_default="NULL") = ()
+
+This takes a binary file for reading a pickle data stream.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed. Bytes past the pickled object's
+representation are ignored.
+
+The argument *file* must have two methods, a read() method that takes
+an integer argument, and a readline() method that requires no
+arguments. Both methods should return bytes. Thus *file* can be a
+binary file object opened for reading, an io.BytesIO object, or any
+other custom object that meets this interface.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatibility support for pickle stream
+generated by Python 2. If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3. The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively. The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
+
+static int
+_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
+ int fix_imports, const char *encoding,
+ const char *errors, PyObject *buffers)
+/*[clinic end generated code: output=09f0192649ea3f85 input=ca4c1faea9553121]*/
+{
+ /* In case of multiple __init__() calls, clear previous content. */
+ if (self->read != NULL)
+ (void)Unpickler_clear(self);
+
+ if (_Unpickler_SetInputStream(self, file) < 0)
+ return -1;
+
+ if (_Unpickler_SetInputEncoding(self, encoding, errors) < 0)
+ return -1;
+
+ if (_Unpickler_SetBuffers(self, buffers) < 0)
+ return -1;
+
+ self->fix_imports = fix_imports;
+
+ if (init_method_ref((PyObject *)self, &_Py_ID(persistent_load),
+ &self->pers_func, &self->pers_func_self) < 0)
+ {
+ return -1;
+ }
+
+ PyTypeObject *tp = Py_TYPE(self);
+ PickleState *state = _Pickle_FindStateByType(tp);
+ self->stack = (Pdata *)Pdata_New(state);
+ if (self->stack == NULL)
+ return -1;
+
+ self->memo_size = 32;
+ self->memo = _Unpickler_NewMemo(self->memo_size);
+ if (self->memo == NULL)
+ return -1;
+
+ self->proto = 0;
+
+ return 0;
+}
+
+
+/* Define a proxy object for the Unpickler's internal memo object. This is to
+ * avoid breaking code like:
+ * unpickler.memo.clear()
+ * and
+ * unpickler.memo = saved_memo
+ * Is this a good idea? Not really, but we don't want to break code that uses
+ * it. Note that we don't implement the entire mapping API here. This is
+ * intentional, as these should be treated as black-box implementation details.
+ *
+ * We do, however, have to implement pickling/unpickling support because of
+ * real-world code like cvs2svn.
+ */
+
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.clear
+
+Remove all items from memo.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=d20cd43f4ba1fb1f input=b1df7c52e7afd9bd]*/
+{
+ _Unpickler_MemoCleanup(self->unpickler);
+ self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size);
+ if (self->unpickler->memo == NULL)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.copy
+
+Copy the memo to a new object.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=e12af7e9bc1e4c77 input=97769247ce032c1d]*/
+{
+ size_t i;
+ PyObject *new_memo = PyDict_New();
+ if (new_memo == NULL)
+ return NULL;
+
+ for (i = 0; i < self->unpickler->memo_size; i++) {
+ int status;
+ PyObject *key, *value;
+
+ value = self->unpickler->memo[i];
+ if (value == NULL)
+ continue;
+
+ key = PyLong_FromSsize_t(i);
+ if (key == NULL)
+ goto error;
+ status = PyDict_SetItem(new_memo, key, value);
+ Py_DECREF(key);
+ if (status < 0)
+ goto error;
+ }
+ return new_memo;
+
+error:
+ Py_DECREF(new_memo);
+ return NULL;
+}
+
+/*[clinic input]
+_pickle.UnpicklerMemoProxy.__reduce__
+
+Implement pickling support.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self)
+/*[clinic end generated code: output=6da34ac048d94cca input=6920862413407199]*/
+{
+ PyObject *reduce_value;
+ PyObject *constructor_args;
+ PyObject *contents = _pickle_UnpicklerMemoProxy_copy_impl(self);
+ if (contents == NULL)
+ return NULL;
+
+ reduce_value = PyTuple_New(2);
+ if (reduce_value == NULL) {
+ Py_DECREF(contents);
+ return NULL;
+ }
+ constructor_args = PyTuple_New(1);
+ if (constructor_args == NULL) {
+ Py_DECREF(contents);
+ Py_DECREF(reduce_value);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(constructor_args, 0, contents);
+ PyTuple_SET_ITEM(reduce_value, 0, Py_NewRef(&PyDict_Type));
+ PyTuple_SET_ITEM(reduce_value, 1, constructor_args);
+ return reduce_value;
+}
+
+static PyMethodDef unpicklerproxy_methods[] = {
+ _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF
+ _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF
+ _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static void
+UnpicklerMemoProxy_dealloc(UnpicklerMemoProxyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_CLEAR(self->unpickler);
+ tp->tp_free((PyObject *)self);
+ Py_DECREF(tp);
+}
+
+static int
+UnpicklerMemoProxy_traverse(UnpicklerMemoProxyObject *self,
+ visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->unpickler);
+ return 0;
+}
+
+static int
+UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self)
+{
+ Py_CLEAR(self->unpickler);
+ return 0;
+}
+
+static PyType_Slot unpickler_memoproxy_slots[] = {
+ {Py_tp_dealloc, UnpicklerMemoProxy_dealloc},
+ {Py_tp_traverse, UnpicklerMemoProxy_traverse},
+ {Py_tp_clear, UnpicklerMemoProxy_clear},
+ {Py_tp_methods, unpicklerproxy_methods},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL},
+};
+
+static PyType_Spec unpickler_memoproxy_spec = {
+ .name = "_pickle.UnpicklerMemoProxy",
+ .basicsize = sizeof(UnpicklerMemoProxyObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = unpickler_memoproxy_slots,
+};
+
+static PyObject *
+UnpicklerMemoProxy_New(UnpicklerObject *unpickler)
+{
+ PickleState *state = _Pickle_FindStateByType(Py_TYPE(unpickler));
+ UnpicklerMemoProxyObject *self;
+ self = PyObject_GC_New(UnpicklerMemoProxyObject,
+ state->UnpicklerMemoProxyType);
+ if (self == NULL)
+ return NULL;
+ self->unpickler = (UnpicklerObject*)Py_NewRef(unpickler);
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+/*****************************************************************************/
+
+
+static PyObject *
+Unpickler_get_memo(UnpicklerObject *self, void *Py_UNUSED(ignored))
+{
+ return UnpicklerMemoProxy_New(self);
+}
+
+static int
+Unpickler_set_memo(UnpicklerObject *self, PyObject *obj, void *Py_UNUSED(ignored))
+{
+ PyObject **new_memo;
+ size_t new_memo_size = 0;
+
+ if (obj == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+
+ PickleState *state = _Pickle_FindStateByType(Py_TYPE(self));
+ if (Py_IS_TYPE(obj, state->UnpicklerMemoProxyType)) {
+ UnpicklerObject *unpickler =
+ ((UnpicklerMemoProxyObject *)obj)->unpickler;
+
+ new_memo_size = unpickler->memo_size;
+ new_memo = _Unpickler_NewMemo(new_memo_size);
+ if (new_memo == NULL)
+ return -1;
+
+ for (size_t i = 0; i < new_memo_size; i++) {
+ new_memo[i] = Py_XNewRef(unpickler->memo[i]);
+ }
+ }
+ else if (PyDict_Check(obj)) {
+ Py_ssize_t i = 0;
+ PyObject *key, *value;
+
+ new_memo_size = PyDict_GET_SIZE(obj);
+ new_memo = _Unpickler_NewMemo(new_memo_size);
+ if (new_memo == NULL)
+ return -1;
+
+ while (PyDict_Next(obj, &i, &key, &value)) {
+ Py_ssize_t idx;
+ if (!PyLong_Check(key)) {
+ PyErr_SetString(PyExc_TypeError,
+ "memo key must be integers");
+ goto error;
+ }
+ idx = PyLong_AsSsize_t(key);
+ if (idx == -1 && PyErr_Occurred())
+ goto error;
+ if (idx < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "memo key must be positive integers.");
+ goto error;
+ }
+ if (_Unpickler_MemoPut(self, idx, value) < 0)
+ goto error;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "'memo' attribute must be an UnpicklerMemoProxy object "
+ "or dict, not %.200s", Py_TYPE(obj)->tp_name);
+ return -1;
+ }
+
+ _Unpickler_MemoCleanup(self);
+ self->memo_size = new_memo_size;
+ self->memo = new_memo;
+
+ return 0;
+
+ error:
+ if (new_memo_size) {
+ for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
+ Py_XDECREF(new_memo[i]);
+ }
+ PyMem_Free(new_memo);
+ }
+ return -1;
+}
+
+static PyObject *
+Unpickler_get_persload(UnpicklerObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->pers_func == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "persistent_load");
+ return NULL;
+ }
+ return reconstruct_method(self->pers_func, self->pers_func_self);
+}
+
+static int
+Unpickler_set_persload(UnpicklerObject *self, PyObject *value, void *Py_UNUSED(ignored))
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "attribute deletion is not supported");
+ return -1;
+ }
+ if (!PyCallable_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "persistent_load must be a callable taking "
+ "one argument");
+ return -1;
+ }
+
+ self->pers_func_self = NULL;
+ Py_XSETREF(self->pers_func, Py_NewRef(value));
+
+ return 0;
+}
+
+static PyGetSetDef Unpickler_getsets[] = {
+ {"memo", (getter)Unpickler_get_memo, (setter)Unpickler_set_memo},
+ {"persistent_load", (getter)Unpickler_get_persload,
+ (setter)Unpickler_set_persload},
+ {NULL}
+};
+
+static PyType_Slot unpickler_type_slots[] = {
+ {Py_tp_dealloc, Unpickler_dealloc},
+ {Py_tp_doc, (char *)_pickle_Unpickler___init____doc__},
+ {Py_tp_traverse, Unpickler_traverse},
+ {Py_tp_clear, Unpickler_clear},
+ {Py_tp_methods, Unpickler_methods},
+ {Py_tp_getset, Unpickler_getsets},
+ {Py_tp_init, _pickle_Unpickler___init__},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec unpickler_type_spec = {
+ .name = "_pickle.Unpickler",
+ .basicsize = sizeof(UnpicklerObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = unpickler_type_slots,
+};
+
+/*[clinic input]
+
+_pickle.dump
+
+ obj: object
+ file: object
+ protocol: object = None
+ *
+ fix_imports: bool = True
+ buffer_callback: object = None
+
+Write a pickled representation of obj to the open file object file.
+
+This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may
+be more efficient.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
+protocol is 4. It was introduced in Python 3.4, and is incompatible
+with previous versions.
+
+Specifying a negative protocol version selects the highest protocol
+version supported. The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+The *file* argument must have a write() method that accepts a single
+bytes argument. It can thus be a file object opened for binary
+writing, an io.BytesIO instance, or any other custom object that meets
+this interface.
+
+If *fix_imports* is True and protocol is less than 3, pickle will try
+to map the new Python 3 names to the old module names used in Python
+2, so that the pickle data stream is readable with Python 2.
+
+If *buffer_callback* is None (the default), buffer views are serialized
+into *file* as part of the pickle stream. It is an error if
+*buffer_callback* is not None and *protocol* is None or smaller than 5.
+
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
+ PyObject *protocol, int fix_imports,
+ PyObject *buffer_callback)
+/*[clinic end generated code: output=706186dba996490c input=5ed6653da99cd97c]*/
+{
+ PickleState *state = _Pickle_GetState(module);
+ PicklerObject *pickler = _Pickler_New(state);
+
+ if (pickler == NULL)
+ return NULL;
+
+ if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
+ goto error;
+
+ if (_Pickler_SetOutputStream(pickler, file) < 0)
+ goto error;
+
+ if (_Pickler_SetBufferCallback(pickler, buffer_callback) < 0)
+ goto error;
+
+ if (dump(state, pickler, obj) < 0)
+ goto error;
+
+ if (_Pickler_FlushToFile(pickler) < 0)
+ goto error;
+
+ Py_DECREF(pickler);
+ Py_RETURN_NONE;
+
+ error:
+ Py_XDECREF(pickler);
+ return NULL;
+}
+
+/*[clinic input]
+
+_pickle.dumps
+
+ obj: object
+ protocol: object = None
+ *
+ fix_imports: bool = True
+ buffer_callback: object = None
+
+Return the pickled representation of the object as a bytes object.
+
+The optional *protocol* argument tells the pickler to use the given
+protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default
+protocol is 4. It was introduced in Python 3.4, and is incompatible
+with previous versions.
+
+Specifying a negative protocol version selects the highest protocol
+version supported. The higher the protocol used, the more recent the
+version of Python needed to read the pickle produced.
+
+If *fix_imports* is True and *protocol* is less than 3, pickle will
+try to map the new Python 3 names to the old module names used in
+Python 2, so that the pickle data stream is readable with Python 2.
+
+If *buffer_callback* is None (the default), buffer views are serialized
+into *file* as part of the pickle stream. It is an error if
+*buffer_callback* is not None and *protocol* is None or smaller than 5.
+
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
+ int fix_imports, PyObject *buffer_callback)
+/*[clinic end generated code: output=fbab0093a5580fdf input=e543272436c6f987]*/
+{
+ PyObject *result;
+ PickleState *state = _Pickle_GetState(module);
+ PicklerObject *pickler = _Pickler_New(state);
+
+ if (pickler == NULL)
+ return NULL;
+
+ if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0)
+ goto error;
+
+ if (_Pickler_SetBufferCallback(pickler, buffer_callback) < 0)
+ goto error;
+
+ if (dump(state, pickler, obj) < 0)
+ goto error;
+
+ result = _Pickler_GetString(pickler);
+ Py_DECREF(pickler);
+ return result;
+
+ error:
+ Py_XDECREF(pickler);
+ return NULL;
+}
+
+/*[clinic input]
+
+_pickle.load
+
+ file: object
+ *
+ fix_imports: bool = True
+ encoding: str = 'ASCII'
+ errors: str = 'strict'
+ buffers: object(c_default="NULL") = ()
+
+Read and return an object from the pickle data stored in a file.
+
+This is equivalent to ``Unpickler(file).load()``, but may be more
+efficient.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed. Bytes past the pickled object's
+representation are ignored.
+
+The argument *file* must have two methods, a read() method that takes
+an integer argument, and a readline() method that requires no
+arguments. Both methods should return bytes. Thus *file* can be a
+binary file object opened for reading, an io.BytesIO object, or any
+other custom object that meets this interface.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatibility support for pickle stream
+generated by Python 2. If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3. The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively. The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
+ const char *encoding, const char *errors,
+ PyObject *buffers)
+/*[clinic end generated code: output=250452d141c23e76 input=46c7c31c92f4f371]*/
+{
+ PyObject *result;
+ UnpicklerObject *unpickler = _Unpickler_New(module);
+
+ if (unpickler == NULL)
+ return NULL;
+
+ if (_Unpickler_SetInputStream(unpickler, file) < 0)
+ goto error;
+
+ if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
+ goto error;
+
+ if (_Unpickler_SetBuffers(unpickler, buffers) < 0)
+ goto error;
+
+ unpickler->fix_imports = fix_imports;
+
+ PickleState *state = _Pickle_GetState(module);
+ result = load(state, unpickler);
+ Py_DECREF(unpickler);
+ return result;
+
+ error:
+ Py_XDECREF(unpickler);
+ return NULL;
+}
+
+/*[clinic input]
+
+_pickle.loads
+
+ data: object
+ /
+ *
+ fix_imports: bool = True
+ encoding: str = 'ASCII'
+ errors: str = 'strict'
+ buffers: object(c_default="NULL") = ()
+
+Read and return an object from the given pickle data.
+
+The protocol version of the pickle is detected automatically, so no
+protocol argument is needed. Bytes past the pickled object's
+representation are ignored.
+
+Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
+which are used to control compatibility support for pickle stream
+generated by Python 2. If *fix_imports* is True, pickle will try to
+map the old Python 2 names to the new names used in Python 3. The
+*encoding* and *errors* tell pickle how to decode 8-bit string
+instances pickled by Python 2; these default to 'ASCII' and 'strict',
+respectively. The *encoding* can be 'bytes' to read these 8-bit
+string instances as bytes objects.
+[clinic start generated code]*/
+
+static PyObject *
+_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
+ const char *encoding, const char *errors,
+ PyObject *buffers)
+/*[clinic end generated code: output=82ac1e6b588e6d02 input=b3615540d0535087]*/
+{
+ PyObject *result;
+ UnpicklerObject *unpickler = _Unpickler_New(module);
+
+ if (unpickler == NULL)
+ return NULL;
+
+ if (_Unpickler_SetStringInput(unpickler, data) < 0)
+ goto error;
+
+ if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0)
+ goto error;
+
+ if (_Unpickler_SetBuffers(unpickler, buffers) < 0)
+ goto error;
+
+ unpickler->fix_imports = fix_imports;
+
+ PickleState *state = _Pickle_GetState(module);
+ result = load(state, unpickler);
+ Py_DECREF(unpickler);
+ return result;
+
+ error:
+ Py_XDECREF(unpickler);
+ return NULL;
+}
+
+static struct PyMethodDef pickle_methods[] = {
+ _PICKLE_DUMP_METHODDEF
+ _PICKLE_DUMPS_METHODDEF
+ _PICKLE_LOAD_METHODDEF
+ _PICKLE_LOADS_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+pickle_clear(PyObject *m)
+{
+ _Pickle_ClearState(_Pickle_GetState(m));
+ return 0;
+}
+
+static void
+pickle_free(PyObject *m)
+{
+ _Pickle_ClearState(_Pickle_GetState(m));
+}
+
+static int
+pickle_traverse(PyObject *m, visitproc visit, void *arg)
+{
+ PickleState *st = _Pickle_GetState(m);
+ Py_VISIT(st->PickleError);
+ Py_VISIT(st->PicklingError);
+ Py_VISIT(st->UnpicklingError);
+ Py_VISIT(st->dispatch_table);
+ Py_VISIT(st->extension_registry);
+ Py_VISIT(st->extension_cache);
+ Py_VISIT(st->inverted_registry);
+ Py_VISIT(st->name_mapping_2to3);
+ Py_VISIT(st->import_mapping_2to3);
+ Py_VISIT(st->name_mapping_3to2);
+ Py_VISIT(st->import_mapping_3to2);
+ Py_VISIT(st->codecs_encode);
+ Py_VISIT(st->getattr);
+ Py_VISIT(st->partial);
+ Py_VISIT(st->Pickler_Type);
+ Py_VISIT(st->Unpickler_Type);
+ Py_VISIT(st->Pdata_Type);
+ Py_VISIT(st->PicklerMemoProxyType);
+ Py_VISIT(st->UnpicklerMemoProxyType);
+ return 0;
+}
+
+static int
+_pickle_exec(PyObject *m)
+{
+ PickleState *st = _Pickle_GetState(m);
+
+#define CREATE_TYPE(mod, type, spec) \
+ do { \
+ type = (PyTypeObject *)PyType_FromMetaclass(NULL, mod, spec, NULL); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+ } while (0)
+
+ CREATE_TYPE(m, st->Pdata_Type, &pdata_spec);
+ CREATE_TYPE(m, st->PicklerMemoProxyType, &memoproxy_spec);
+ CREATE_TYPE(m, st->UnpicklerMemoProxyType, &unpickler_memoproxy_spec);
+ CREATE_TYPE(m, st->Pickler_Type, &pickler_type_spec);
+ CREATE_TYPE(m, st->Unpickler_Type, &unpickler_type_spec);
+
+#undef CREATE_TYPE
+
+ /* Add types */
+ if (PyModule_AddType(m, &PyPickleBuffer_Type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(m, st->Pickler_Type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(m, st->Unpickler_Type) < 0) {
+ return -1;
+ }
+
+ /* Initialize the exceptions. */
+ st->PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL);
+ if (st->PickleError == NULL)
+ return -1;
+ st->PicklingError = \
+ PyErr_NewException("_pickle.PicklingError", st->PickleError, NULL);
+ if (st->PicklingError == NULL)
+ return -1;
+ st->UnpicklingError = \
+ PyErr_NewException("_pickle.UnpicklingError", st->PickleError, NULL);
+ if (st->UnpicklingError == NULL)
+ return -1;
+
+ if (PyModule_AddObjectRef(m, "PickleError", st->PickleError) < 0) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(m, "PicklingError", st->PicklingError) < 0) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(m, "UnpicklingError", st->UnpicklingError) < 0) {
+ return -1;
+ }
+
+ if (_Pickle_InitState(st) < 0)
+ return -1;
+
+ return 0;
+}
+
+static PyModuleDef_Slot pickle_slots[] = {
+ {Py_mod_exec, _pickle_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static struct PyModuleDef _picklemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_pickle",
+ .m_doc = pickle_module_doc,
+ .m_size = sizeof(PickleState),
+ .m_methods = pickle_methods,
+ .m_slots = pickle_slots,
+ .m_traverse = pickle_traverse,
+ .m_clear = pickle_clear,
+ .m_free = (freefunc)pickle_free,
+};
+
+PyMODINIT_FUNC
+PyInit__pickle(void)
+{
+ return PyModuleDef_Init(&_picklemodule);
+}
diff --git a/contrib/tools/python3/Modules/_posixsubprocess.c b/contrib/tools/python3/Modules/_posixsubprocess.c
new file mode 100644
index 00000000000..d75bb92757c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_posixsubprocess.c
@@ -0,0 +1,1249 @@
+/* Authors: Gregory P. Smith & Jeffrey Yasskin */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_fileutils.h"
+#include "pycore_pystate.h"
+#if defined(HAVE_PIPE2) && !defined(_GNU_SOURCE)
+# define _GNU_SOURCE
+#endif
+#include <unistd.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if defined(HAVE_SYS_STAT_H)
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
+#if defined(HAVE_SYS_RESOURCE_H)
+#include <sys/resource.h>
+#endif
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif /* HAVE_GRP_H */
+
+#include "posixmodule.h"
+
+#ifdef _Py_MEMORY_SANITIZER
+# include <sanitizer/msan_interface.h>
+#endif
+
+#if defined(__ANDROID__) && __ANDROID_API__ < 21 && !defined(SYS_getdents64)
+# include <sys/linux-syscalls.h>
+# define SYS_getdents64 __NR_getdents64
+#endif
+
+#if defined(__linux__) && defined(HAVE_VFORK) && defined(HAVE_SIGNAL_H) && \
+ defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
+/* If this is ever expanded to non-Linux platforms, verify what calls are
+ * allowed after vfork(). Ex: setsid() may be disallowed on macOS? */
+# include <signal.h>
+# define VFORK_USABLE 1
+#endif
+
+#if defined(__sun) && defined(__SVR4)
+/* readdir64 is used to work around Solaris 9 bug 6395699. */
+# define readdir readdir64
+# define dirent dirent64
+# if !defined(HAVE_DIRFD)
+/* Some versions of Solaris lack dirfd(). */
+# define dirfd(dirp) ((dirp)->dd_fd)
+# define HAVE_DIRFD
+# endif
+#endif
+
+#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__DragonFly__)
+# define FD_DIR "/dev/fd"
+#else
+# define FD_DIR "/proc/self/fd"
+#endif
+
+#ifdef NGROUPS_MAX
+#define MAX_GROUPS NGROUPS_MAX
+#else
+#define MAX_GROUPS 64
+#endif
+
+#define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0)
+
+static struct PyModuleDef _posixsubprocessmodule;
+
+/*[clinic input]
+module _posixsubprocess
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c62211df27cf7334]*/
+
+/*[python input]
+class pid_t_converter(CConverter):
+ type = 'pid_t'
+ format_unit = '" _Py_PARSE_PID "'
+
+ def parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyLong_AsPid({argname});
+ if ({paramname} == -1 && PyErr_Occurred()) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.parser_name)
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=5af1c116d56cbb5a]*/
+
+#include "clinic/_posixsubprocess.c.h"
+
+/* Convert ASCII to a positive int, no libc call. no overflow. -1 on error. */
+static int
+_pos_int_from_ascii(const char *name)
+{
+ int num = 0;
+ while (*name >= '0' && *name <= '9') {
+ num = num * 10 + (*name - '0');
+ ++name;
+ }
+ if (*name)
+ return -1; /* Non digit found, not a number. */
+ return num;
+}
+
+
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+/* When /dev/fd isn't mounted it is often a static directory populated
+ * with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD, OpenBSD and DragonFlyBSD.
+ * NetBSD and OpenBSD have a /proc fs available (though not necessarily
+ * mounted) and do not have fdescfs for /dev/fd. MacOS X has a devfs
+ * that properly supports /dev/fd.
+ */
+static int
+_is_fdescfs_mounted_on_dev_fd(void)
+{
+ struct stat dev_stat;
+ struct stat dev_fd_stat;
+ if (stat("/dev", &dev_stat) != 0)
+ return 0;
+ if (stat(FD_DIR, &dev_fd_stat) != 0)
+ return 0;
+ if (dev_stat.st_dev == dev_fd_stat.st_dev)
+ return 0; /* / == /dev == /dev/fd means it is static. #fail */
+ return 1;
+}
+#endif
+
+
+/* Returns 1 if there is a problem with fd_sequence, 0 otherwise. */
+static int
+_sanity_check_python_fd_sequence(PyObject *fd_sequence)
+{
+ Py_ssize_t seq_idx;
+ long prev_fd = -1;
+ for (seq_idx = 0; seq_idx < PyTuple_GET_SIZE(fd_sequence); ++seq_idx) {
+ PyObject* py_fd = PyTuple_GET_ITEM(fd_sequence, seq_idx);
+ long iter_fd;
+ if (!PyLong_Check(py_fd)) {
+ return 1;
+ }
+ iter_fd = PyLong_AsLong(py_fd);
+ if (iter_fd < 0 || iter_fd <= prev_fd || iter_fd > INT_MAX) {
+ /* Negative, overflow, unsorted, too big for a fd. */
+ return 1;
+ }
+ prev_fd = iter_fd;
+ }
+ return 0;
+}
+
+
+/* Is fd found in the sorted Python Sequence? */
+static int
+_is_fd_in_sorted_fd_sequence(int fd, int *fd_sequence,
+ Py_ssize_t fd_sequence_len)
+{
+ /* Binary search. */
+ Py_ssize_t search_min = 0;
+ Py_ssize_t search_max = fd_sequence_len - 1;
+ if (search_max < 0)
+ return 0;
+ do {
+ long middle = (search_min + search_max) / 2;
+ long middle_fd = fd_sequence[middle];
+ if (fd == middle_fd)
+ return 1;
+ if (fd > middle_fd)
+ search_min = middle + 1;
+ else
+ search_max = middle - 1;
+ } while (search_min <= search_max);
+ return 0;
+}
+
+/*
+ * Do all the Python C API calls in the parent process to turn the pass_fds
+ * "py_fds_to_keep" tuple into a C array. The caller owns allocation and
+ * freeing of the array.
+ *
+ * On error an unknown number of array elements may have been filled in.
+ * A Python exception has been set when an error is returned.
+ *
+ * Returns: -1 on error, 0 on success.
+ */
+static int
+convert_fds_to_keep_to_c(PyObject *py_fds_to_keep, int *c_fds_to_keep)
+{
+ Py_ssize_t i, len;
+
+ len = PyTuple_GET_SIZE(py_fds_to_keep);
+ for (i = 0; i < len; ++i) {
+ PyObject* fdobj = PyTuple_GET_ITEM(py_fds_to_keep, i);
+ long fd = PyLong_AsLong(fdobj);
+ if (fd == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ if (fd < 0 || fd > INT_MAX) {
+ PyErr_SetString(PyExc_ValueError,
+ "fd out of range in fds_to_keep.");
+ return -1;
+ }
+ c_fds_to_keep[i] = (int)fd;
+ }
+ return 0;
+}
+
+
+/* This function must be async-signal-safe as it is called from child_exec()
+ * after fork() or vfork().
+ */
+static int
+make_inheritable(int *c_fds_to_keep, Py_ssize_t len, int errpipe_write)
+{
+ Py_ssize_t i;
+
+ for (i = 0; i < len; ++i) {
+ int fd = c_fds_to_keep[i];
+ if (fd == errpipe_write) {
+ /* errpipe_write is part of fds_to_keep. It must be closed at
+ exec(), but kept open in the child process until exec() is
+ called. */
+ continue;
+ }
+ if (_Py_set_inheritable_async_safe(fd, 1, NULL) < 0)
+ return -1;
+ }
+ return 0;
+}
+
+
+/* Get the maximum file descriptor that could be opened by this process.
+ * This function is async signal safe for use between fork() and exec().
+ */
+static long
+safe_get_max_fd(void)
+{
+ long local_max_fd;
+#if defined(__NetBSD__)
+ local_max_fd = fcntl(0, F_MAXFD);
+ if (local_max_fd >= 0)
+ return local_max_fd;
+#endif
+#if defined(HAVE_SYS_RESOURCE_H) && defined(__OpenBSD__)
+ struct rlimit rl;
+ /* Not on the POSIX async signal safe functions list but likely
+ * safe. TODO - Someone should audit OpenBSD to make sure. */
+ if (getrlimit(RLIMIT_NOFILE, &rl) >= 0)
+ return (long) rl.rlim_max;
+#endif
+#ifdef _SC_OPEN_MAX
+ local_max_fd = sysconf(_SC_OPEN_MAX);
+ if (local_max_fd == -1)
+#endif
+ local_max_fd = 256; /* Matches legacy Lib/subprocess.py behavior. */
+ return local_max_fd;
+}
+
+
+/* Close all file descriptors in the given range except for those in
+ * fds_to_keep by invoking closer on each subrange.
+ *
+ * If end_fd == -1, it's guessed via safe_get_max_fd(), but it isn't
+ * possible to know for sure what the max fd to go up to is for
+ * processes with the capability of raising their maximum, or in case
+ * a process opened a high fd and then lowered its maximum.
+ */
+static int
+_close_range_except(int start_fd,
+ int end_fd,
+ int *fds_to_keep,
+ Py_ssize_t fds_to_keep_len,
+ int (*closer)(int, int))
+{
+ if (end_fd == -1) {
+ end_fd = Py_MIN(safe_get_max_fd(), INT_MAX);
+ }
+ Py_ssize_t keep_seq_idx;
+ /* As fds_to_keep is sorted we can loop through the list closing
+ * fds in between any in the keep list falling within our range. */
+ for (keep_seq_idx = 0; keep_seq_idx < fds_to_keep_len; ++keep_seq_idx) {
+ int keep_fd = fds_to_keep[keep_seq_idx];
+ if (keep_fd < start_fd)
+ continue;
+ if (closer(start_fd, keep_fd - 1) != 0)
+ return -1;
+ start_fd = keep_fd + 1;
+ }
+ if (start_fd <= end_fd) {
+ if (closer(start_fd, end_fd) != 0)
+ return -1;
+ }
+ return 0;
+}
+
+#if defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)
+/* It doesn't matter if d_name has room for NAME_MAX chars; we're using this
+ * only to read a directory of short file descriptor number names. The kernel
+ * will return an error if we didn't give it enough space. Highly Unlikely.
+ * This structure is very old and stable: It will not change unless the kernel
+ * chooses to break compatibility with all existing binaries. Highly Unlikely.
+ */
+struct linux_dirent64 {
+ unsigned long long d_ino;
+ long long d_off;
+ unsigned short d_reclen; /* Length of this linux_dirent */
+ unsigned char d_type;
+ char d_name[256]; /* Filename (null-terminated) */
+};
+
+static int
+_brute_force_closer(int first, int last)
+{
+ for (int i = first; i <= last; i++) {
+ /* Ignore errors */
+ (void)close(i);
+ }
+ return 0;
+}
+
+/* Close all open file descriptors in the range from start_fd and higher
+ * Do not close any in the sorted fds_to_keep list.
+ *
+ * This version is async signal safe as it does not make any unsafe C library
+ * calls, malloc calls or handle any locks. It is _unfortunate_ to be forced
+ * to resort to making a kernel system call directly but this is the ONLY api
+ * available that does no harm. opendir/readdir/closedir perform memory
+ * allocation and locking so while they usually work they are not guaranteed
+ * to (especially if you have replaced your malloc implementation). A version
+ * of this function that uses those can be found in the _maybe_unsafe variant.
+ *
+ * This is Linux specific because that is all I am ready to test it on. It
+ * should be easy to add OS specific dirent or dirent64 structures and modify
+ * it with some cpp #define magic to work on other OSes as well if you want.
+ */
+static void
+_close_open_fds_safe(int start_fd, int *fds_to_keep, Py_ssize_t fds_to_keep_len)
+{
+ int fd_dir_fd;
+
+ fd_dir_fd = _Py_open_noraise(FD_DIR, O_RDONLY);
+ if (fd_dir_fd == -1) {
+ /* No way to get a list of open fds. */
+ _close_range_except(start_fd, -1,
+ fds_to_keep, fds_to_keep_len,
+ _brute_force_closer);
+ return;
+ } else {
+ char buffer[sizeof(struct linux_dirent64)];
+ int bytes;
+ while ((bytes = syscall(SYS_getdents64, fd_dir_fd,
+ (struct linux_dirent64 *)buffer,
+ sizeof(buffer))) > 0) {
+ struct linux_dirent64 *entry;
+ int offset;
+#ifdef _Py_MEMORY_SANITIZER
+ __msan_unpoison(buffer, bytes);
+#endif
+ for (offset = 0; offset < bytes; offset += entry->d_reclen) {
+ int fd;
+ entry = (struct linux_dirent64 *)(buffer + offset);
+ if ((fd = _pos_int_from_ascii(entry->d_name)) < 0)
+ continue; /* Not a number. */
+ if (fd != fd_dir_fd && fd >= start_fd &&
+ !_is_fd_in_sorted_fd_sequence(fd, fds_to_keep,
+ fds_to_keep_len)) {
+ close(fd);
+ }
+ }
+ }
+ close(fd_dir_fd);
+ }
+}
+
+#define _close_open_fds_fallback _close_open_fds_safe
+
+#else /* NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */
+
+static int
+_unsafe_closer(int first, int last)
+{
+ _Py_closerange(first, last);
+ return 0;
+}
+
+/* Close all open file descriptors from start_fd and higher.
+ * Do not close any in the sorted fds_to_keep tuple.
+ *
+ * This function violates the strict use of async signal safe functions. :(
+ * It calls opendir(), readdir() and closedir(). Of these, the one most
+ * likely to ever cause a problem is opendir() as it performs an internal
+ * malloc(). Practically this should not be a problem. The Java VM makes the
+ * same calls between fork and exec in its own UNIXProcess_md.c implementation.
+ *
+ * readdir_r() is not used because it provides no benefit. It is typically
+ * implemented as readdir() followed by memcpy(). See also:
+ * http://womble.decadent.org.uk/readdir_r-advisory.html
+ */
+static void
+_close_open_fds_maybe_unsafe(int start_fd, int *fds_to_keep,
+ Py_ssize_t fds_to_keep_len)
+{
+ DIR *proc_fd_dir;
+#ifndef HAVE_DIRFD
+ while (_is_fd_in_sorted_fd_sequence(start_fd, fds_to_keep,
+ fds_to_keep_len)) {
+ ++start_fd;
+ }
+ /* Close our lowest fd before we call opendir so that it is likely to
+ * reuse that fd otherwise we might close opendir's file descriptor in
+ * our loop. This trick assumes that fd's are allocated on a lowest
+ * available basis. */
+ close(start_fd);
+ ++start_fd;
+#endif
+
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+ if (!_is_fdescfs_mounted_on_dev_fd())
+ proc_fd_dir = NULL;
+ else
+#endif
+ proc_fd_dir = opendir(FD_DIR);
+ if (!proc_fd_dir) {
+ /* No way to get a list of open fds. */
+ _close_range_except(start_fd, -1, fds_to_keep, fds_to_keep_len,
+ _unsafe_closer);
+ } else {
+ struct dirent *dir_entry;
+#ifdef HAVE_DIRFD
+ int fd_used_by_opendir = dirfd(proc_fd_dir);
+#else
+ int fd_used_by_opendir = start_fd - 1;
+#endif
+ errno = 0;
+ while ((dir_entry = readdir(proc_fd_dir))) {
+ int fd;
+ if ((fd = _pos_int_from_ascii(dir_entry->d_name)) < 0)
+ continue; /* Not a number. */
+ if (fd != fd_used_by_opendir && fd >= start_fd &&
+ !_is_fd_in_sorted_fd_sequence(fd, fds_to_keep,
+ fds_to_keep_len)) {
+ close(fd);
+ }
+ errno = 0;
+ }
+ if (errno) {
+ /* readdir error, revert behavior. Highly Unlikely. */
+ _close_range_except(start_fd, -1, fds_to_keep, fds_to_keep_len,
+ _unsafe_closer);
+ }
+ closedir(proc_fd_dir);
+ }
+}
+
+#define _close_open_fds_fallback _close_open_fds_maybe_unsafe
+
+#endif /* else NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */
+
+/* We can use close_range() library function only if it's known to be
+ * async-signal-safe.
+ *
+ * On Linux, glibc explicitly documents it to be a thin wrapper over
+ * the system call, and other C libraries are likely to follow glibc.
+ */
+#if defined(HAVE_CLOSE_RANGE) && \
+ (defined(__linux__) || defined(__FreeBSD__))
+#define HAVE_ASYNC_SAFE_CLOSE_RANGE
+
+static int
+_close_range_closer(int first, int last)
+{
+ return close_range(first, last, 0);
+}
+#endif
+
+static void
+_close_open_fds(int start_fd, int *fds_to_keep, Py_ssize_t fds_to_keep_len)
+{
+#ifdef HAVE_ASYNC_SAFE_CLOSE_RANGE
+ if (_close_range_except(
+ start_fd, INT_MAX, fds_to_keep, fds_to_keep_len,
+ _close_range_closer) == 0) {
+ return;
+ }
+#endif
+ _close_open_fds_fallback(start_fd, fds_to_keep, fds_to_keep_len);
+}
+
+#ifdef VFORK_USABLE
+/* Reset dispositions for all signals to SIG_DFL except for ignored
+ * signals. This way we ensure that no signal handlers can run
+ * after we unblock signals in a child created by vfork().
+ */
+static void
+reset_signal_handlers(const sigset_t *child_sigmask)
+{
+ struct sigaction sa_dfl = {.sa_handler = SIG_DFL};
+ for (int sig = 1; sig < _NSIG; sig++) {
+ /* Dispositions for SIGKILL and SIGSTOP can't be changed. */
+ if (sig == SIGKILL || sig == SIGSTOP) {
+ continue;
+ }
+
+ /* There is no need to reset the disposition of signals that will
+ * remain blocked across execve() since the kernel will do it. */
+ if (sigismember(child_sigmask, sig) == 1) {
+ continue;
+ }
+
+ struct sigaction sa;
+ /* C libraries usually return EINVAL for signals used
+ * internally (e.g. for thread cancellation), so simply
+ * skip errors here. */
+ if (sigaction(sig, NULL, &sa) == -1) {
+ continue;
+ }
+
+ /* void *h works as these fields are both pointer types already. */
+ void *h = (sa.sa_flags & SA_SIGINFO ? (void *)sa.sa_sigaction :
+ (void *)sa.sa_handler);
+ if (h == SIG_IGN || h == SIG_DFL) {
+ continue;
+ }
+
+ /* This call can't reasonably fail, but if it does, terminating
+ * the child seems to be too harsh, so ignore errors. */
+ (void) sigaction(sig, &sa_dfl, NULL);
+ }
+}
+#endif /* VFORK_USABLE */
+
+
+/*
+ * This function is code executed in the child process immediately after
+ * (v)fork to set things up and call exec().
+ *
+ * All of the code in this function must only use async-signal-safe functions,
+ * listed at `man 7 signal` or
+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
+ *
+ * This restriction is documented at
+ * http://www.opengroup.org/onlinepubs/009695399/functions/fork.html.
+ *
+ * If this function is called after vfork(), even more care must be taken.
+ * The lack of preparations that C libraries normally take on fork(),
+ * as well as sharing the address space with the parent, might make even
+ * async-signal-safe functions vfork-unsafe. In particular, on Linux,
+ * set*id() and setgroups() library functions must not be called, since
+ * they have to interact with the library-level thread list and send
+ * library-internal signals to implement per-process credentials semantics
+ * required by POSIX but not supported natively on Linux. Another reason to
+ * avoid this family of functions is that sharing an address space between
+ * processes running with different privileges is inherently insecure.
+ * See https://bugs.python.org/issue35823 for discussion and references.
+ *
+ * In some C libraries, setrlimit() has the same thread list/signalling
+ * behavior since resource limits were per-thread attributes before
+ * Linux 2.6.10. Musl, as of 1.2.1, is known to have this issue
+ * (https://www.openwall.com/lists/musl/2020/10/15/6).
+ *
+ * If vfork-unsafe functionality is desired after vfork(), consider using
+ * syscall() to obtain it.
+ */
+Py_NO_INLINE static void
+child_exec(char *const exec_array[],
+ char *const argv[],
+ char *const envp[],
+ const char *cwd,
+ int p2cread, int p2cwrite,
+ int c2pread, int c2pwrite,
+ int errread, int errwrite,
+ int errpipe_read, int errpipe_write,
+ int close_fds, int restore_signals,
+ int call_setsid, pid_t pgid_to_set,
+ gid_t gid,
+ Py_ssize_t extra_group_size, const gid_t *extra_groups,
+ uid_t uid, int child_umask,
+ const void *child_sigmask,
+ int *fds_to_keep, Py_ssize_t fds_to_keep_len,
+ PyObject *preexec_fn,
+ PyObject *preexec_fn_args_tuple)
+{
+ int i, saved_errno;
+ PyObject *result;
+ /* Indicate to the parent that the error happened before exec(). */
+ const char *err_msg = "noexec";
+ /* Buffer large enough to hold a hex integer. We can't malloc. */
+ char hex_errno[sizeof(saved_errno)*2+1];
+
+ if (make_inheritable(fds_to_keep, fds_to_keep_len, errpipe_write) < 0)
+ goto error;
+
+ /* Close parent's pipe ends. */
+ if (p2cwrite != -1)
+ POSIX_CALL(close(p2cwrite));
+ if (c2pread != -1)
+ POSIX_CALL(close(c2pread));
+ if (errread != -1)
+ POSIX_CALL(close(errread));
+ POSIX_CALL(close(errpipe_read));
+
+ /* When duping fds, if there arises a situation where one of the fds is
+ either 0, 1 or 2, it is possible that it is overwritten (#12607). */
+ if (c2pwrite == 0) {
+ POSIX_CALL(c2pwrite = dup(c2pwrite));
+ /* issue32270 */
+ if (_Py_set_inheritable_async_safe(c2pwrite, 0, NULL) < 0) {
+ goto error;
+ }
+ }
+ while (errwrite == 0 || errwrite == 1) {
+ POSIX_CALL(errwrite = dup(errwrite));
+ /* issue32270 */
+ if (_Py_set_inheritable_async_safe(errwrite, 0, NULL) < 0) {
+ goto error;
+ }
+ }
+
+ /* Dup fds for child.
+ dup2() removes the CLOEXEC flag but we must do it ourselves if dup2()
+ would be a no-op (issue #10806). */
+ if (p2cread == 0) {
+ if (_Py_set_inheritable_async_safe(p2cread, 1, NULL) < 0)
+ goto error;
+ }
+ else if (p2cread != -1)
+ POSIX_CALL(dup2(p2cread, 0)); /* stdin */
+
+ if (c2pwrite == 1) {
+ if (_Py_set_inheritable_async_safe(c2pwrite, 1, NULL) < 0)
+ goto error;
+ }
+ else if (c2pwrite != -1)
+ POSIX_CALL(dup2(c2pwrite, 1)); /* stdout */
+
+ if (errwrite == 2) {
+ if (_Py_set_inheritable_async_safe(errwrite, 1, NULL) < 0)
+ goto error;
+ }
+ else if (errwrite != -1)
+ POSIX_CALL(dup2(errwrite, 2)); /* stderr */
+
+ /* We no longer manually close p2cread, c2pwrite, and errwrite here as
+ * _close_open_fds takes care when it is not already non-inheritable. */
+
+ if (cwd) {
+ if (chdir(cwd) == -1) {
+ err_msg = "noexec:chdir";
+ goto error;
+ }
+ }
+
+ if (child_umask >= 0)
+ umask(child_umask); /* umask() always succeeds. */
+
+ if (restore_signals)
+ _Py_RestoreSignals();
+
+#ifdef VFORK_USABLE
+ if (child_sigmask) {
+ reset_signal_handlers(child_sigmask);
+ if ((errno = pthread_sigmask(SIG_SETMASK, child_sigmask, NULL))) {
+ goto error;
+ }
+ }
+#endif
+
+#ifdef HAVE_SETSID
+ if (call_setsid)
+ POSIX_CALL(setsid());
+#endif
+
+#ifdef HAVE_SETPGID
+ static_assert(_Py_IS_TYPE_SIGNED(pid_t), "pid_t is unsigned");
+ if (pgid_to_set >= 0) {
+ POSIX_CALL(setpgid(0, pgid_to_set));
+ }
+#endif
+
+#ifdef HAVE_SETGROUPS
+ if (extra_group_size >= 0) {
+ assert((extra_group_size == 0) == (extra_groups == NULL));
+ POSIX_CALL(setgroups(extra_group_size, extra_groups));
+ }
+#endif /* HAVE_SETGROUPS */
+
+#ifdef HAVE_SETREGID
+ if (gid != (gid_t)-1)
+ POSIX_CALL(setregid(gid, gid));
+#endif /* HAVE_SETREGID */
+
+#ifdef HAVE_SETREUID
+ if (uid != (uid_t)-1)
+ POSIX_CALL(setreuid(uid, uid));
+#endif /* HAVE_SETREUID */
+
+
+ err_msg = "";
+ if (preexec_fn != Py_None && preexec_fn_args_tuple) {
+ /* This is where the user has asked us to deadlock their program. */
+ result = PyObject_Call(preexec_fn, preexec_fn_args_tuple, NULL);
+ if (result == NULL) {
+ /* Stringifying the exception or traceback would involve
+ * memory allocation and thus potential for deadlock.
+ * We've already faced potential deadlock by calling back
+ * into Python in the first place, so it probably doesn't
+ * matter but we avoid it to minimize the possibility. */
+ err_msg = "Exception occurred in preexec_fn.";
+ errno = 0; /* We don't want to report an OSError. */
+ goto error;
+ }
+ /* Py_DECREF(result); - We're about to exec so why bother? */
+ }
+
+ /* close FDs after executing preexec_fn, which might open FDs */
+ if (close_fds) {
+ /* TODO HP-UX could use pstat_getproc() if anyone cares about it. */
+ _close_open_fds(3, fds_to_keep, fds_to_keep_len);
+ }
+
+ /* This loop matches the Lib/os.py _execvpe()'s PATH search when */
+ /* given the executable_list generated by Lib/subprocess.py. */
+ saved_errno = 0;
+ for (i = 0; exec_array[i] != NULL; ++i) {
+ const char *executable = exec_array[i];
+ if (envp) {
+ execve(executable, argv, envp);
+ } else {
+ execv(executable, argv);
+ }
+ if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
+ saved_errno = errno;
+ }
+ }
+ /* Report the first exec error, not the last. */
+ if (saved_errno)
+ errno = saved_errno;
+
+error:
+ saved_errno = errno;
+ /* Report the posix error to our parent process. */
+ /* We ignore all write() return values as the total size of our writes is
+ less than PIPEBUF and we cannot do anything about an error anyways.
+ Use _Py_write_noraise() to retry write() if it is interrupted by a
+ signal (fails with EINTR). */
+ if (saved_errno) {
+ char *cur;
+ _Py_write_noraise(errpipe_write, "OSError:", 8);
+ cur = hex_errno + sizeof(hex_errno);
+ while (saved_errno != 0 && cur != hex_errno) {
+ *--cur = Py_hexdigits[saved_errno % 16];
+ saved_errno /= 16;
+ }
+ _Py_write_noraise(errpipe_write, cur, hex_errno + sizeof(hex_errno) - cur);
+ _Py_write_noraise(errpipe_write, ":", 1);
+ /* We can't call strerror(saved_errno). It is not async signal safe.
+ * The parent process will look the error message up. */
+ } else {
+ _Py_write_noraise(errpipe_write, "SubprocessError:0:", 18);
+ }
+ _Py_write_noraise(errpipe_write, err_msg, strlen(err_msg));
+}
+
+
+/* The main purpose of this wrapper function is to isolate vfork() from both
+ * subprocess_fork_exec() and child_exec(). A child process created via
+ * vfork() executes on the same stack as the parent process while the latter is
+ * suspended, so this function should not be inlined to avoid compiler bugs
+ * that might clobber data needed by the parent later. Additionally,
+ * child_exec() should not be inlined to avoid spurious -Wclobber warnings from
+ * GCC (see bpo-35823).
+ */
+Py_NO_INLINE static pid_t
+do_fork_exec(char *const exec_array[],
+ char *const argv[],
+ char *const envp[],
+ const char *cwd,
+ int p2cread, int p2cwrite,
+ int c2pread, int c2pwrite,
+ int errread, int errwrite,
+ int errpipe_read, int errpipe_write,
+ int close_fds, int restore_signals,
+ int call_setsid, pid_t pgid_to_set,
+ gid_t gid,
+ Py_ssize_t extra_group_size, const gid_t *extra_groups,
+ uid_t uid, int child_umask,
+ const void *child_sigmask,
+ int *fds_to_keep, Py_ssize_t fds_to_keep_len,
+ PyObject *preexec_fn,
+ PyObject *preexec_fn_args_tuple)
+{
+
+ pid_t pid;
+
+#ifdef VFORK_USABLE
+ PyThreadState *vfork_tstate_save;
+ if (child_sigmask) {
+ /* These are checked by our caller; verify them in debug builds. */
+ assert(uid == (uid_t)-1);
+ assert(gid == (gid_t)-1);
+ assert(extra_group_size < 0);
+ assert(preexec_fn == Py_None);
+
+ /* Drop the GIL so that other threads can continue execution while this
+ * thread in the parent remains blocked per vfork-semantics on the
+ * child's exec syscall outcome. Exec does filesystem access which
+ * can take an arbitrarily long time. This addresses GH-104372.
+ *
+ * The vfork'ed child still runs in our address space. Per POSIX it
+ * must be limited to nothing but exec, but the Linux implementation
+ * is a little more usable. See the child_exec() comment - The child
+ * MUST NOT re-acquire the GIL.
+ */
+ vfork_tstate_save = PyEval_SaveThread();
+ pid = vfork();
+ if (pid != 0) {
+ // Not in the child process, reacquire the GIL.
+ PyEval_RestoreThread(vfork_tstate_save);
+ }
+ if (pid == (pid_t)-1) {
+ /* If vfork() fails, fall back to using fork(). When it isn't
+ * allowed in a process by the kernel, vfork can return -1
+ * with errno EINVAL. https://bugs.python.org/issue47151. */
+ pid = fork();
+ }
+ } else
+#endif
+ {
+ pid = fork();
+ }
+
+ if (pid != 0) {
+ // Parent process.
+ return pid;
+ }
+
+ /* Child process.
+ * See the comment above child_exec() for restrictions imposed on
+ * the code below.
+ */
+
+ if (preexec_fn != Py_None) {
+ /* We'll be calling back into Python later so we need to do this.
+ * This call may not be async-signal-safe but neither is calling
+ * back into Python. The user asked us to use hope as a strategy
+ * to avoid deadlock... */
+ PyOS_AfterFork_Child();
+ }
+
+ child_exec(exec_array, argv, envp, cwd,
+ p2cread, p2cwrite, c2pread, c2pwrite,
+ errread, errwrite, errpipe_read, errpipe_write,
+ close_fds, restore_signals, call_setsid, pgid_to_set,
+ gid, extra_group_size, extra_groups,
+ uid, child_umask, child_sigmask,
+ fds_to_keep, fds_to_keep_len,
+ preexec_fn, preexec_fn_args_tuple);
+ _exit(255);
+ return 0; /* Dead code to avoid a potential compiler warning. */
+}
+
+/*[clinic input]
+_posixsubprocess.fork_exec as subprocess_fork_exec
+ args as process_args: object
+ executable_list: object
+ close_fds: bool
+ pass_fds as py_fds_to_keep: object(subclass_of='&PyTuple_Type')
+ cwd as cwd_obj: object
+ env as env_list: object
+ p2cread: int
+ p2cwrite: int
+ c2pread: int
+ c2pwrite: int
+ errread: int
+ errwrite: int
+ errpipe_read: int
+ errpipe_write: int
+ restore_signals: bool
+ call_setsid: bool
+ pgid_to_set: pid_t
+ gid as gid_object: object
+ extra_groups as extra_groups_packed: object
+ uid as uid_object: object
+ child_umask: int
+ preexec_fn: object
+ allow_vfork: bool
+ /
+
+Spawn a fresh new child process.
+
+Fork a child process, close parent file descriptors as appropriate in the
+child and duplicate the few that are needed before calling exec() in the
+child process.
+
+If close_fds is True, close file descriptors 3 and higher, except those listed
+in the sorted tuple pass_fds.
+
+The preexec_fn, if supplied, will be called immediately before closing file
+descriptors and exec.
+
+WARNING: preexec_fn is NOT SAFE if your application uses threads.
+ It may trigger infrequent, difficult to debug deadlocks.
+
+If an error occurs in the child process before the exec, it is
+serialized and written to the errpipe_write fd per subprocess.py.
+
+Returns: the child process's PID.
+
+Raises: Only on an error in the parent process.
+[clinic start generated code]*/
+
+static PyObject *
+subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
+ PyObject *executable_list, int close_fds,
+ PyObject *py_fds_to_keep, PyObject *cwd_obj,
+ PyObject *env_list, int p2cread, int p2cwrite,
+ int c2pread, int c2pwrite, int errread,
+ int errwrite, int errpipe_read, int errpipe_write,
+ int restore_signals, int call_setsid,
+ pid_t pgid_to_set, PyObject *gid_object,
+ PyObject *extra_groups_packed,
+ PyObject *uid_object, int child_umask,
+ PyObject *preexec_fn, int allow_vfork)
+/*[clinic end generated code: output=7ee4f6ee5cf22b5b input=51757287ef266ffa]*/
+{
+ PyObject *converted_args = NULL, *fast_args = NULL;
+ PyObject *preexec_fn_args_tuple = NULL;
+ gid_t *extra_groups = NULL;
+ PyObject *cwd_obj2 = NULL;
+ const char *cwd = NULL;
+ pid_t pid = -1;
+ int need_to_reenable_gc = 0;
+ char *const *argv = NULL, *const *envp = NULL;
+ int need_after_fork = 0;
+ int saved_errno = 0;
+ int *c_fds_to_keep = NULL;
+ Py_ssize_t fds_to_keep_len = PyTuple_GET_SIZE(py_fds_to_keep);
+
+ PyInterpreterState *interp = PyInterpreterState_Get();
+ if ((preexec_fn != Py_None) && interp->finalizing) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "preexec_fn not supported at interpreter shutdown");
+ return NULL;
+ }
+ if ((preexec_fn != Py_None) && (interp != PyInterpreterState_Main())) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "preexec_fn not supported within subinterpreters");
+ return NULL;
+ }
+
+ if (close_fds && errpipe_write < 3) { /* precondition */
+ PyErr_SetString(PyExc_ValueError, "errpipe_write must be >= 3");
+ return NULL;
+ }
+ if (_sanity_check_python_fd_sequence(py_fds_to_keep)) {
+ PyErr_SetString(PyExc_ValueError, "bad value(s) in fds_to_keep");
+ return NULL;
+ }
+
+ /* We need to call gc.disable() when we'll be calling preexec_fn */
+ if (preexec_fn != Py_None) {
+ need_to_reenable_gc = PyGC_Disable();
+ }
+
+ char *const *exec_array = _PySequence_BytesToCharpArray(executable_list);
+ if (!exec_array)
+ goto cleanup;
+
+ /* Convert args and env into appropriate arguments for exec() */
+ /* These conversions are done in the parent process to avoid allocating
+ or freeing memory in the child process. */
+ if (process_args != Py_None) {
+ Py_ssize_t num_args;
+ /* Equivalent to: */
+ /* tuple(PyUnicode_FSConverter(arg) for arg in process_args) */
+ fast_args = PySequence_Fast(process_args, "argv must be a tuple");
+ if (fast_args == NULL)
+ goto cleanup;
+ num_args = PySequence_Fast_GET_SIZE(fast_args);
+ converted_args = PyTuple_New(num_args);
+ if (converted_args == NULL)
+ goto cleanup;
+ for (Py_ssize_t arg_num = 0; arg_num < num_args; ++arg_num) {
+ PyObject *borrowed_arg, *converted_arg;
+ if (PySequence_Fast_GET_SIZE(fast_args) != num_args) {
+ PyErr_SetString(PyExc_RuntimeError, "args changed during iteration");
+ goto cleanup;
+ }
+ borrowed_arg = PySequence_Fast_GET_ITEM(fast_args, arg_num);
+ if (PyUnicode_FSConverter(borrowed_arg, &converted_arg) == 0)
+ goto cleanup;
+ PyTuple_SET_ITEM(converted_args, arg_num, converted_arg);
+ }
+
+ argv = _PySequence_BytesToCharpArray(converted_args);
+ Py_CLEAR(converted_args);
+ Py_CLEAR(fast_args);
+ if (!argv)
+ goto cleanup;
+ }
+
+ if (env_list != Py_None) {
+ envp = _PySequence_BytesToCharpArray(env_list);
+ if (!envp)
+ goto cleanup;
+ }
+
+ if (cwd_obj != Py_None) {
+ if (PyUnicode_FSConverter(cwd_obj, &cwd_obj2) == 0)
+ goto cleanup;
+ cwd = PyBytes_AsString(cwd_obj2);
+ }
+
+ // Special initial value meaning that subprocess API was called with
+ // extra_groups=None leading to _posixsubprocess.fork_exec(gids=None).
+ // We use this to differentiate between code desiring a setgroups(0, NULL)
+ // call vs no call at all. The fast vfork() code path could be used when
+ // there is no setgroups call.
+ Py_ssize_t extra_group_size = -2;
+
+ if (extra_groups_packed != Py_None) {
+#ifdef HAVE_SETGROUPS
+ if (!PyList_Check(extra_groups_packed)) {
+ PyErr_SetString(PyExc_TypeError,
+ "setgroups argument must be a list");
+ goto cleanup;
+ }
+ extra_group_size = PySequence_Size(extra_groups_packed);
+
+ if (extra_group_size < 0)
+ goto cleanup;
+
+ if (extra_group_size > MAX_GROUPS) {
+ PyErr_SetString(PyExc_ValueError, "too many extra_groups");
+ goto cleanup;
+ }
+
+ /* Deliberately keep extra_groups == NULL for extra_group_size == 0 */
+ if (extra_group_size > 0) {
+ extra_groups = PyMem_RawMalloc(extra_group_size * sizeof(gid_t));
+ if (extra_groups == NULL) {
+ PyErr_SetString(PyExc_MemoryError,
+ "failed to allocate memory for group list");
+ goto cleanup;
+ }
+ }
+
+ for (Py_ssize_t i = 0; i < extra_group_size; i++) {
+ PyObject *elem;
+ elem = PySequence_GetItem(extra_groups_packed, i);
+ if (!elem)
+ goto cleanup;
+ if (!PyLong_Check(elem)) {
+ PyErr_SetString(PyExc_TypeError,
+ "extra_groups must be integers");
+ Py_DECREF(elem);
+ goto cleanup;
+ } else {
+ gid_t gid;
+ if (!_Py_Gid_Converter(elem, &gid)) {
+ Py_DECREF(elem);
+ PyErr_SetString(PyExc_ValueError, "invalid group id");
+ goto cleanup;
+ }
+ extra_groups[i] = gid;
+ }
+ Py_DECREF(elem);
+ }
+
+#else /* HAVE_SETGROUPS */
+ PyErr_BadInternalCall();
+ goto cleanup;
+#endif /* HAVE_SETGROUPS */
+ }
+
+ gid_t gid = (gid_t)-1;
+ if (gid_object != Py_None) {
+#ifdef HAVE_SETREGID
+ if (!_Py_Gid_Converter(gid_object, &gid))
+ goto cleanup;
+
+#else /* HAVE_SETREGID */
+ PyErr_BadInternalCall();
+ goto cleanup;
+#endif /* HAVE_SETREUID */
+ }
+
+ uid_t uid = (uid_t)-1;
+ if (uid_object != Py_None) {
+#ifdef HAVE_SETREUID
+ if (!_Py_Uid_Converter(uid_object, &uid))
+ goto cleanup;
+
+#else /* HAVE_SETREUID */
+ PyErr_BadInternalCall();
+ goto cleanup;
+#endif /* HAVE_SETREUID */
+ }
+
+ c_fds_to_keep = PyMem_Malloc(fds_to_keep_len * sizeof(int));
+ if (c_fds_to_keep == NULL) {
+ PyErr_SetString(PyExc_MemoryError, "failed to malloc c_fds_to_keep");
+ goto cleanup;
+ }
+ if (convert_fds_to_keep_to_c(py_fds_to_keep, c_fds_to_keep) < 0) {
+ goto cleanup;
+ }
+
+ /* This must be the last thing done before fork() because we do not
+ * want to call PyOS_BeforeFork() if there is any chance of another
+ * error leading to the cleanup: code without calling fork(). */
+ if (preexec_fn != Py_None) {
+ preexec_fn_args_tuple = PyTuple_New(0);
+ if (!preexec_fn_args_tuple)
+ goto cleanup;
+ PyOS_BeforeFork();
+ need_after_fork = 1;
+ }
+
+ /* NOTE: When old_sigmask is non-NULL, do_fork_exec() may use vfork(). */
+ const void *old_sigmask = NULL;
+#ifdef VFORK_USABLE
+ /* Use vfork() only if it's safe. See the comment above child_exec(). */
+ sigset_t old_sigs;
+ if (preexec_fn == Py_None && allow_vfork &&
+ uid == (uid_t)-1 && gid == (gid_t)-1 && extra_group_size < 0) {
+ /* Block all signals to ensure that no signal handlers are run in the
+ * child process while it shares memory with us. Note that signals
+ * used internally by C libraries won't be blocked by
+ * pthread_sigmask(), but signal handlers installed by C libraries
+ * normally service only signals originating from *within the process*,
+ * so it should be sufficient to consider any library function that
+ * might send such a signal to be vfork-unsafe and do not call it in
+ * the child.
+ */
+ sigset_t all_sigs;
+ sigfillset(&all_sigs);
+ if ((saved_errno = pthread_sigmask(SIG_BLOCK, &all_sigs, &old_sigs))) {
+ goto cleanup;
+ }
+ old_sigmask = &old_sigs;
+ }
+#endif
+
+ pid = do_fork_exec(exec_array, argv, envp, cwd,
+ p2cread, p2cwrite, c2pread, c2pwrite,
+ errread, errwrite, errpipe_read, errpipe_write,
+ close_fds, restore_signals, call_setsid, pgid_to_set,
+ gid, extra_group_size, extra_groups,
+ uid, child_umask, old_sigmask,
+ c_fds_to_keep, fds_to_keep_len,
+ preexec_fn, preexec_fn_args_tuple);
+
+ /* Parent (original) process */
+ if (pid == (pid_t)-1) {
+ /* Capture errno for the exception. */
+ saved_errno = errno;
+ }
+
+#ifdef VFORK_USABLE
+ if (old_sigmask) {
+ /* vfork() semantics guarantees that the parent is blocked
+ * until the child performs _exit() or execve(), so it is safe
+ * to unblock signals once we're here.
+ * Note that in environments where vfork() is implemented as fork(),
+ * such as QEMU user-mode emulation, the parent won't be blocked,
+ * but it won't share the address space with the child,
+ * so it's still safe to unblock the signals.
+ *
+ * We don't handle errors here because this call can't fail
+ * if valid arguments are given, and because there is no good
+ * way for the caller to deal with a failure to restore
+ * the thread signal mask. */
+ (void) pthread_sigmask(SIG_SETMASK, old_sigmask, NULL);
+ }
+#endif
+
+ if (need_after_fork)
+ PyOS_AfterFork_Parent();
+
+cleanup:
+ if (c_fds_to_keep != NULL) {
+ PyMem_Free(c_fds_to_keep);
+ }
+
+ if (saved_errno != 0) {
+ errno = saved_errno;
+ /* We can't call this above as PyOS_AfterFork_Parent() calls back
+ * into Python code which would see the unreturned error. */
+ PyErr_SetFromErrno(PyExc_OSError);
+ }
+
+ Py_XDECREF(preexec_fn_args_tuple);
+ PyMem_RawFree(extra_groups);
+ Py_XDECREF(cwd_obj2);
+ if (envp)
+ _Py_FreeCharPArray(envp);
+ Py_XDECREF(converted_args);
+ Py_XDECREF(fast_args);
+ if (argv)
+ _Py_FreeCharPArray(argv);
+ if (exec_array)
+ _Py_FreeCharPArray(exec_array);
+
+ if (need_to_reenable_gc) {
+ PyGC_Enable();
+ }
+
+ return pid == -1 ? NULL : PyLong_FromPid(pid);
+}
+
+/* module level code ********************************************************/
+
+PyDoc_STRVAR(module_doc,
+"A POSIX helper for the subprocess module.");
+
+static PyMethodDef module_methods[] = {
+ SUBPROCESS_FORK_EXEC_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyModuleDef_Slot _posixsubprocess_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _posixsubprocessmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_posixsubprocess",
+ .m_doc = module_doc,
+ .m_size = 0,
+ .m_methods = module_methods,
+ .m_slots = _posixsubprocess_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__posixsubprocess(void)
+{
+ return PyModuleDef_Init(&_posixsubprocessmodule);
+}
diff --git a/contrib/tools/python3/Modules/_queuemodule.c b/contrib/tools/python3/Modules/_queuemodule.c
new file mode 100644
index 00000000000..db5be842b8a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_queuemodule.c
@@ -0,0 +1,456 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "structmember.h" // PyMemberDef
+#include <stddef.h> // offsetof()
+
+typedef struct {
+ PyTypeObject *SimpleQueueType;
+ PyObject *EmptyError;
+} simplequeue_state;
+
+static simplequeue_state *
+simplequeue_get_state(PyObject *module)
+{
+ simplequeue_state *state = _PyModule_GetState(module);
+ assert(state);
+ return state;
+}
+static struct PyModuleDef queuemodule;
+#define simplequeue_get_state_by_type(type) \
+ (simplequeue_get_state(PyType_GetModuleByDef(type, &queuemodule)))
+
+typedef struct {
+ PyObject_HEAD
+ PyThread_type_lock lock;
+ int locked;
+ PyObject *lst;
+ Py_ssize_t lst_pos;
+ PyObject *weakreflist;
+} simplequeueobject;
+
+/*[clinic input]
+module _queue
+class _queue.SimpleQueue "simplequeueobject *" "simplequeue_get_state_by_type(type)->SimpleQueueType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=0a4023fe4d198c8d]*/
+
+static int
+simplequeue_clear(simplequeueobject *self)
+{
+ Py_CLEAR(self->lst);
+ return 0;
+}
+
+static void
+simplequeue_dealloc(simplequeueobject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+
+ PyObject_GC_UnTrack(self);
+ if (self->lock != NULL) {
+ /* Unlock the lock so it's safe to free it */
+ if (self->locked > 0)
+ PyThread_release_lock(self->lock);
+ PyThread_free_lock(self->lock);
+ }
+ (void)simplequeue_clear(self);
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ Py_TYPE(self)->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static int
+simplequeue_traverse(simplequeueobject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->lst);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+/*[clinic input]
+@classmethod
+_queue.SimpleQueue.__new__ as simplequeue_new
+
+Simple, unbounded, reentrant FIFO queue.
+[clinic start generated code]*/
+
+static PyObject *
+simplequeue_new_impl(PyTypeObject *type)
+/*[clinic end generated code: output=ba97740608ba31cd input=a0674a1643e3e2fb]*/
+{
+ simplequeueobject *self;
+
+ self = (simplequeueobject *) type->tp_alloc(type, 0);
+ if (self != NULL) {
+ self->weakreflist = NULL;
+ self->lst = PyList_New(0);
+ self->lock = PyThread_allocate_lock();
+ self->lst_pos = 0;
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "can't allocate lock");
+ return NULL;
+ }
+ if (self->lst == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+
+ return (PyObject *) self;
+}
+
+/*[clinic input]
+_queue.SimpleQueue.put
+ item: object
+ block: bool = True
+ timeout: object = None
+
+Put the item on the queue.
+
+The optional 'block' and 'timeout' arguments are ignored, as this method
+never blocks. They are provided for compatibility with the Queue class.
+
+[clinic start generated code]*/
+
+static PyObject *
+_queue_SimpleQueue_put_impl(simplequeueobject *self, PyObject *item,
+ int block, PyObject *timeout)
+/*[clinic end generated code: output=4333136e88f90d8b input=6e601fa707a782d5]*/
+{
+ /* BEGIN GIL-protected critical section */
+ if (PyList_Append(self->lst, item) < 0)
+ return NULL;
+ if (self->locked) {
+ /* A get() may be waiting, wake it up */
+ self->locked = 0;
+ PyThread_release_lock(self->lock);
+ }
+ /* END GIL-protected critical section */
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_queue.SimpleQueue.put_nowait
+ item: object
+
+Put an item into the queue without blocking.
+
+This is exactly equivalent to `put(item)` and is only provided
+for compatibility with the Queue class.
+
+[clinic start generated code]*/
+
+static PyObject *
+_queue_SimpleQueue_put_nowait_impl(simplequeueobject *self, PyObject *item)
+/*[clinic end generated code: output=0990536715efb1f1 input=36b1ea96756b2ece]*/
+{
+ return _queue_SimpleQueue_put_impl(self, item, 0, Py_None);
+}
+
+static PyObject *
+simplequeue_pop_item(simplequeueobject *self)
+{
+ Py_ssize_t count, n;
+ PyObject *item;
+
+ n = PyList_GET_SIZE(self->lst);
+ assert(self->lst_pos < n);
+
+ item = PyList_GET_ITEM(self->lst, self->lst_pos);
+ Py_INCREF(Py_None);
+ PyList_SET_ITEM(self->lst, self->lst_pos, Py_None);
+ self->lst_pos += 1;
+ count = n - self->lst_pos;
+ if (self->lst_pos > count) {
+ /* The list is more than 50% empty, reclaim space at the beginning */
+ if (PyList_SetSlice(self->lst, 0, self->lst_pos, NULL)) {
+ /* Undo pop */
+ self->lst_pos -= 1;
+ PyList_SET_ITEM(self->lst, self->lst_pos, item);
+ return NULL;
+ }
+ self->lst_pos = 0;
+ }
+ return item;
+}
+
+/*[clinic input]
+_queue.SimpleQueue.get
+
+ cls: defining_class
+ /
+ block: bool = True
+ timeout as timeout_obj: object = None
+
+Remove and return an item from the queue.
+
+If optional args 'block' is true and 'timeout' is None (the default),
+block if necessary until an item is available. If 'timeout' is
+a non-negative number, it blocks at most 'timeout' seconds and raises
+the Empty exception if no item was available within that time.
+Otherwise ('block' is false), return an item if one is immediately
+available, else raise the Empty exception ('timeout' is ignored
+in that case).
+
+[clinic start generated code]*/
+
+static PyObject *
+_queue_SimpleQueue_get_impl(simplequeueobject *self, PyTypeObject *cls,
+ int block, PyObject *timeout_obj)
+/*[clinic end generated code: output=5c2cca914cd1e55b input=5b4047bfbc645ec1]*/
+{
+ _PyTime_t endtime = 0;
+ _PyTime_t timeout;
+ PyObject *item;
+ PyLockStatus r;
+ PY_TIMEOUT_T microseconds;
+ PyThreadState *tstate = PyThreadState_Get();
+
+ if (block == 0) {
+ /* Non-blocking */
+ microseconds = 0;
+ }
+ else if (timeout_obj != Py_None) {
+ /* With timeout */
+ if (_PyTime_FromSecondsObject(&timeout,
+ timeout_obj, _PyTime_ROUND_CEILING) < 0) {
+ return NULL;
+ }
+ if (timeout < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "'timeout' must be a non-negative number");
+ return NULL;
+ }
+ microseconds = _PyTime_AsMicroseconds(timeout,
+ _PyTime_ROUND_CEILING);
+ if (microseconds > PY_TIMEOUT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout value is too large");
+ return NULL;
+ }
+ endtime = _PyDeadline_Init(timeout);
+ }
+ else {
+ /* Infinitely blocking */
+ microseconds = -1;
+ }
+
+ /* put() signals the queue to be non-empty by releasing the lock.
+ * So we simply try to acquire the lock in a loop, until the condition
+ * (queue non-empty) becomes true.
+ */
+ while (self->lst_pos == PyList_GET_SIZE(self->lst)) {
+ /* First a simple non-blocking try without releasing the GIL */
+ r = PyThread_acquire_lock_timed(self->lock, 0, 0);
+ if (r == PY_LOCK_FAILURE && microseconds != 0) {
+ Py_BEGIN_ALLOW_THREADS
+ r = PyThread_acquire_lock_timed(self->lock, microseconds, 1);
+ Py_END_ALLOW_THREADS
+ }
+
+ if (r == PY_LOCK_INTR && _PyEval_MakePendingCalls(tstate) < 0) {
+ return NULL;
+ }
+ if (r == PY_LOCK_FAILURE) {
+ PyObject *module = PyType_GetModule(cls);
+ simplequeue_state *state = simplequeue_get_state(module);
+ /* Timed out */
+ PyErr_SetNone(state->EmptyError);
+ return NULL;
+ }
+ self->locked = 1;
+
+ /* Adjust timeout for next iteration (if any) */
+ if (microseconds > 0) {
+ timeout = _PyDeadline_Get(endtime);
+ microseconds = _PyTime_AsMicroseconds(timeout,
+ _PyTime_ROUND_CEILING);
+ }
+ }
+
+ /* BEGIN GIL-protected critical section */
+ assert(self->lst_pos < PyList_GET_SIZE(self->lst));
+ item = simplequeue_pop_item(self);
+ if (self->locked) {
+ PyThread_release_lock(self->lock);
+ self->locked = 0;
+ }
+ /* END GIL-protected critical section */
+
+ return item;
+}
+
+/*[clinic input]
+_queue.SimpleQueue.get_nowait
+
+ cls: defining_class
+ /
+
+Remove and return an item from the queue without blocking.
+
+Only get an item if one is immediately available. Otherwise
+raise the Empty exception.
+[clinic start generated code]*/
+
+static PyObject *
+_queue_SimpleQueue_get_nowait_impl(simplequeueobject *self,
+ PyTypeObject *cls)
+/*[clinic end generated code: output=620c58e2750f8b8a input=842f732bf04216d3]*/
+{
+ return _queue_SimpleQueue_get_impl(self, cls, 0, Py_None);
+}
+
+/*[clinic input]
+_queue.SimpleQueue.empty -> bool
+
+Return True if the queue is empty, False otherwise (not reliable!).
+[clinic start generated code]*/
+
+static int
+_queue_SimpleQueue_empty_impl(simplequeueobject *self)
+/*[clinic end generated code: output=1a02a1b87c0ef838 input=1a98431c45fd66f9]*/
+{
+ return self->lst_pos == PyList_GET_SIZE(self->lst);
+}
+
+/*[clinic input]
+_queue.SimpleQueue.qsize -> Py_ssize_t
+
+Return the approximate size of the queue (not reliable!).
+[clinic start generated code]*/
+
+static Py_ssize_t
+_queue_SimpleQueue_qsize_impl(simplequeueobject *self)
+/*[clinic end generated code: output=f9dcd9d0a90e121e input=7a74852b407868a1]*/
+{
+ return PyList_GET_SIZE(self->lst) - self->lst_pos;
+}
+
+static int
+queue_traverse(PyObject *m, visitproc visit, void *arg)
+{
+ simplequeue_state *state = simplequeue_get_state(m);
+ Py_VISIT(state->SimpleQueueType);
+ Py_VISIT(state->EmptyError);
+ return 0;
+}
+
+static int
+queue_clear(PyObject *m)
+{
+ simplequeue_state *state = simplequeue_get_state(m);
+ Py_CLEAR(state->SimpleQueueType);
+ Py_CLEAR(state->EmptyError);
+ return 0;
+}
+
+static void
+queue_free(void *m)
+{
+ queue_clear((PyObject *)m);
+}
+
+#include "clinic/_queuemodule.c.h"
+
+
+static PyMethodDef simplequeue_methods[] = {
+ _QUEUE_SIMPLEQUEUE_EMPTY_METHODDEF
+ _QUEUE_SIMPLEQUEUE_GET_METHODDEF
+ _QUEUE_SIMPLEQUEUE_GET_NOWAIT_METHODDEF
+ _QUEUE_SIMPLEQUEUE_PUT_METHODDEF
+ _QUEUE_SIMPLEQUEUE_PUT_NOWAIT_METHODDEF
+ _QUEUE_SIMPLEQUEUE_QSIZE_METHODDEF
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* sentinel */
+};
+
+static struct PyMemberDef simplequeue_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(simplequeueobject, weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot simplequeue_slots[] = {
+ {Py_tp_dealloc, simplequeue_dealloc},
+ {Py_tp_doc, (void *)simplequeue_new__doc__},
+ {Py_tp_traverse, simplequeue_traverse},
+ {Py_tp_clear, simplequeue_clear},
+ {Py_tp_members, simplequeue_members},
+ {Py_tp_methods, simplequeue_methods},
+ {Py_tp_new, simplequeue_new},
+ {0, NULL},
+};
+
+static PyType_Spec simplequeue_spec = {
+ .name = "_queue.SimpleQueue",
+ .basicsize = sizeof(simplequeueobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = simplequeue_slots,
+};
+
+
+/* Initialization function */
+
+PyDoc_STRVAR(queue_module_doc,
+"C implementation of the Python queue module.\n\
+This module is an implementation detail, please do not use it directly.");
+
+static int
+queuemodule_exec(PyObject *module)
+{
+ simplequeue_state *state = simplequeue_get_state(module);
+
+ state->EmptyError = PyErr_NewExceptionWithDoc(
+ "_queue.Empty",
+ "Exception raised by Queue.get(block=0)/get_nowait().",
+ NULL, NULL);
+ if (state->EmptyError == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(module, "Empty", state->EmptyError) < 0) {
+ return -1;
+ }
+
+ state->SimpleQueueType = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &simplequeue_spec, NULL);
+ if (state->SimpleQueueType == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->SimpleQueueType) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot queuemodule_slots[] = {
+ {Py_mod_exec, queuemodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+
+static struct PyModuleDef queuemodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_queue",
+ .m_doc = queue_module_doc,
+ .m_size = sizeof(simplequeue_state),
+ .m_slots = queuemodule_slots,
+ .m_traverse = queue_traverse,
+ .m_clear = queue_clear,
+ .m_free = queue_free,
+};
+
+
+PyMODINIT_FUNC
+PyInit__queue(void)
+{
+ return PyModuleDef_Init(&queuemodule);
+}
diff --git a/contrib/tools/python3/Modules/_randommodule.c b/contrib/tools/python3/Modules/_randommodule.c
new file mode 100644
index 00000000000..fda5ef267fb
--- /dev/null
+++ b/contrib/tools/python3/Modules/_randommodule.c
@@ -0,0 +1,668 @@
+/* Random objects */
+
+/* ------------------------------------------------------------------
+ The code in this module was based on a download from:
+ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
+
+ It was modified in 2002 by Raymond Hettinger as follows:
+
+ * the principal computational lines untouched.
+
+ * renamed genrand_res53() to random_random() and wrapped
+ in python calling/return code.
+
+ * genrand_uint32() and the helper functions, init_genrand()
+ and init_by_array(), were declared static, wrapped in
+ Python calling/return code. also, their global data
+ references were replaced with structure references.
+
+ * unused functions from the original were deleted.
+ new, original C python code was added to implement the
+ Random() interface.
+
+ The following are the verbatim comments from the original code:
+
+ A C-program for MT19937, with initialization improved 2002/1/26.
+ Coded by Takuji Nishimura and Makoto Matsumoto.
+
+ Before using, initialize the state by using init_genrand(seed)
+ or init_by_array(init_key, key_length).
+
+ Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. The names of its contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ Any feedback is very welcome.
+ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
+*/
+
+/* ---------------------------------------------------------------*/
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_runtime.h"
+#ifdef HAVE_PROCESS_H
+# include <process.h> // getpid()
+#endif
+
+#ifdef MS_WINDOWS
+# include <windows.h>
+#endif
+
+/* Period parameters -- These are all magic. Don't change. */
+#define N 624
+#define M 397
+#define MATRIX_A 0x9908b0dfU /* constant vector a */
+#define UPPER_MASK 0x80000000U /* most significant w-r bits */
+#define LOWER_MASK 0x7fffffffU /* least significant r bits */
+
+typedef struct {
+ PyObject *Random_Type;
+ PyObject *Long___abs__;
+} _randomstate;
+
+static inline _randomstate*
+get_random_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_randomstate *)state;
+}
+
+static struct PyModuleDef _randommodule;
+
+#define _randomstate_type(type) \
+ (get_random_state(PyType_GetModuleByDef(type, &_randommodule)))
+
+typedef struct {
+ PyObject_HEAD
+ int index;
+ uint32_t state[N];
+} RandomObject;
+
+
+#include "clinic/_randommodule.c.h"
+
+/*[clinic input]
+module _random
+class _random.Random "RandomObject *" "_randomstate_type(type)->Random_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=70a2c99619474983]*/
+
+/* Random methods */
+
+
+/* generates a random number on [0,0xffffffff]-interval */
+static uint32_t
+genrand_uint32(RandomObject *self)
+{
+ uint32_t y;
+ static const uint32_t mag01[2] = {0x0U, MATRIX_A};
+ /* mag01[x] = x * MATRIX_A for x=0,1 */
+ uint32_t *mt;
+
+ mt = self->state;
+ if (self->index >= N) { /* generate N words at one time */
+ int kk;
+
+ for (kk=0;kk<N-M;kk++) {
+ y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
+ mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1U];
+ }
+ for (;kk<N-1;kk++) {
+ y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
+ mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1U];
+ }
+ y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
+ mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1U];
+
+ self->index = 0;
+ }
+
+ y = mt[self->index++];
+ y ^= (y >> 11);
+ y ^= (y << 7) & 0x9d2c5680U;
+ y ^= (y << 15) & 0xefc60000U;
+ y ^= (y >> 18);
+ return y;
+}
+
+/* random_random is the function named genrand_res53 in the original code;
+ * generates a random number on [0,1) with 53-bit resolution; note that
+ * 9007199254740992 == 2**53; I assume they're spelling "/2**53" as
+ * multiply-by-reciprocal in the (likely vain) hope that the compiler will
+ * optimize the division away at compile-time. 67108864 is 2**26. In
+ * effect, a contains 27 random bits shifted left 26, and b fills in the
+ * lower 26 bits of the 53-bit numerator.
+ * The original code credited Isaku Wada for this algorithm, 2002/01/09.
+ */
+
+/*[clinic input]
+_random.Random.random
+
+ self: self(type="RandomObject *")
+
+random() -> x in the interval [0, 1).
+[clinic start generated code]*/
+
+static PyObject *
+_random_Random_random_impl(RandomObject *self)
+/*[clinic end generated code: output=117ff99ee53d755c input=afb2a59cbbb00349]*/
+{
+ uint32_t a=genrand_uint32(self)>>5, b=genrand_uint32(self)>>6;
+ return PyFloat_FromDouble((a*67108864.0+b)*(1.0/9007199254740992.0));
+}
+
+/* initializes mt[N] with a seed */
+static void
+init_genrand(RandomObject *self, uint32_t s)
+{
+ int mti;
+ uint32_t *mt;
+
+ mt = self->state;
+ mt[0]= s;
+ for (mti=1; mti<N; mti++) {
+ mt[mti] =
+ (1812433253U * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
+ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
+ /* In the previous versions, MSBs of the seed affect */
+ /* only MSBs of the array mt[]. */
+ /* 2002/01/09 modified by Makoto Matsumoto */
+ }
+ self->index = mti;
+ return;
+}
+
+/* initialize by an array with array-length */
+/* init_key is the array for initializing keys */
+/* key_length is its length */
+static void
+init_by_array(RandomObject *self, uint32_t init_key[], size_t key_length)
+{
+ size_t i, j, k; /* was signed in the original code. RDH 12/16/2002 */
+ uint32_t *mt;
+
+ mt = self->state;
+ init_genrand(self, 19650218U);
+ i=1; j=0;
+ k = (N>key_length ? N : key_length);
+ for (; k; k--) {
+ mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525U))
+ + init_key[j] + (uint32_t)j; /* non linear */
+ i++; j++;
+ if (i>=N) { mt[0] = mt[N-1]; i=1; }
+ if (j>=key_length) j=0;
+ }
+ for (k=N-1; k; k--) {
+ mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941U))
+ - (uint32_t)i; /* non linear */
+ i++;
+ if (i>=N) { mt[0] = mt[N-1]; i=1; }
+ }
+
+ mt[0] = 0x80000000U; /* MSB is 1; assuring non-zero initial array */
+}
+
+/*
+ * The rest is Python-specific code, neither part of, nor derived from, the
+ * Twister download.
+ */
+
+static int
+random_seed_urandom(RandomObject *self)
+{
+ uint32_t key[N];
+
+ if (_PyOS_URandomNonblock(key, sizeof(key)) < 0) {
+ return -1;
+ }
+ init_by_array(self, key, Py_ARRAY_LENGTH(key));
+ return 0;
+}
+
+static void
+random_seed_time_pid(RandomObject *self)
+{
+ _PyTime_t now;
+ uint32_t key[5];
+
+ now = _PyTime_GetSystemClock();
+ key[0] = (uint32_t)(now & 0xffffffffU);
+ key[1] = (uint32_t)(now >> 32);
+
+#if defined(MS_WINDOWS) && !defined(MS_WINDOWS_DESKTOP) && !defined(MS_WINDOWS_SYSTEM)
+ key[2] = (uint32_t)GetCurrentProcessId();
+#elif defined(HAVE_GETPID)
+ key[2] = (uint32_t)getpid();
+#else
+ key[2] = 0;
+#endif
+
+ now = _PyTime_GetMonotonicClock();
+ key[3] = (uint32_t)(now & 0xffffffffU);
+ key[4] = (uint32_t)(now >> 32);
+
+ init_by_array(self, key, Py_ARRAY_LENGTH(key));
+}
+
+static int
+random_seed(RandomObject *self, PyObject *arg)
+{
+ int result = -1; /* guilty until proved innocent */
+ PyObject *n = NULL;
+ uint32_t *key = NULL;
+ size_t bits, keyused;
+ int res;
+
+ if (arg == NULL || arg == Py_None) {
+ if (random_seed_urandom(self) < 0) {
+ PyErr_Clear();
+
+ /* Reading system entropy failed, fall back on the worst entropy:
+ use the current time and process identifier. */
+ random_seed_time_pid(self);
+ }
+ return 0;
+ }
+
+ /* This algorithm relies on the number being unsigned.
+ * So: if the arg is a PyLong, use its absolute value.
+ * Otherwise use its hash value, cast to unsigned.
+ */
+ if (PyLong_CheckExact(arg)) {
+ n = PyNumber_Absolute(arg);
+ } else if (PyLong_Check(arg)) {
+ /* Calling int.__abs__() prevents calling arg.__abs__(), which might
+ return an invalid value. See issue #31478. */
+ _randomstate *state = _randomstate_type(Py_TYPE(self));
+ n = PyObject_CallOneArg(state->Long___abs__, arg);
+ }
+ else {
+ Py_hash_t hash = PyObject_Hash(arg);
+ if (hash == -1)
+ goto Done;
+ n = PyLong_FromSize_t((size_t)hash);
+ }
+ if (n == NULL)
+ goto Done;
+
+ /* Now split n into 32-bit chunks, from the right. */
+ bits = _PyLong_NumBits(n);
+ if (bits == (size_t)-1 && PyErr_Occurred())
+ goto Done;
+
+ /* Figure out how many 32-bit chunks this gives us. */
+ keyused = bits == 0 ? 1 : (bits - 1) / 32 + 1;
+
+ /* Convert seed to byte sequence. */
+ key = (uint32_t *)PyMem_Malloc((size_t)4 * keyused);
+ if (key == NULL) {
+ PyErr_NoMemory();
+ goto Done;
+ }
+ res = _PyLong_AsByteArray((PyLongObject *)n,
+ (unsigned char *)key, keyused * 4,
+ PY_LITTLE_ENDIAN,
+ 0); /* unsigned */
+ if (res == -1) {
+ goto Done;
+ }
+
+#if PY_BIG_ENDIAN
+ {
+ size_t i, j;
+ /* Reverse an array. */
+ for (i = 0, j = keyused - 1; i < j; i++, j--) {
+ uint32_t tmp = key[i];
+ key[i] = key[j];
+ key[j] = tmp;
+ }
+ }
+#endif
+ init_by_array(self, key, keyused);
+
+ result = 0;
+
+Done:
+ Py_XDECREF(n);
+ PyMem_Free(key);
+ return result;
+}
+
+/*[clinic input]
+_random.Random.seed
+
+ self: self(type="RandomObject *")
+ n: object = None
+ /
+
+seed([n]) -> None.
+
+Defaults to use urandom and falls back to a combination
+of the current time and the process identifier.
+[clinic start generated code]*/
+
+static PyObject *
+_random_Random_seed_impl(RandomObject *self, PyObject *n)
+/*[clinic end generated code: output=0fad1e16ba883681 input=78d6ef0d52532a54]*/
+{
+ if (random_seed(self, n) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_random.Random.getstate
+
+ self: self(type="RandomObject *")
+
+getstate() -> tuple containing the current state.
+[clinic start generated code]*/
+
+static PyObject *
+_random_Random_getstate_impl(RandomObject *self)
+/*[clinic end generated code: output=bf6cef0c092c7180 input=b937a487928c0e89]*/
+{
+ PyObject *state;
+ PyObject *element;
+ int i;
+
+ state = PyTuple_New(N+1);
+ if (state == NULL)
+ return NULL;
+ for (i=0; i<N ; i++) {
+ element = PyLong_FromUnsignedLong(self->state[i]);
+ if (element == NULL)
+ goto Fail;
+ PyTuple_SET_ITEM(state, i, element);
+ }
+ element = PyLong_FromLong((long)(self->index));
+ if (element == NULL)
+ goto Fail;
+ PyTuple_SET_ITEM(state, i, element);
+ return state;
+
+Fail:
+ Py_DECREF(state);
+ return NULL;
+}
+
+
+/*[clinic input]
+_random.Random.setstate
+
+ self: self(type="RandomObject *")
+ state: object
+ /
+
+setstate(state) -> None. Restores generator state.
+[clinic start generated code]*/
+
+static PyObject *
+_random_Random_setstate(RandomObject *self, PyObject *state)
+/*[clinic end generated code: output=fd1c3cd0037b6681 input=b3b4efbb1bc66af8]*/
+{
+ int i;
+ unsigned long element;
+ long index;
+ uint32_t new_state[N];
+
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError,
+ "state vector must be a tuple");
+ return NULL;
+ }
+ if (PyTuple_Size(state) != N+1) {
+ PyErr_SetString(PyExc_ValueError,
+ "state vector is the wrong size");
+ return NULL;
+ }
+
+ for (i=0; i<N ; i++) {
+ element = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(state, i));
+ if (element == (unsigned long)-1 && PyErr_Occurred())
+ return NULL;
+ new_state[i] = (uint32_t)element;
+ }
+
+ index = PyLong_AsLong(PyTuple_GET_ITEM(state, i));
+ if (index == -1 && PyErr_Occurred())
+ return NULL;
+ if (index < 0 || index > N) {
+ PyErr_SetString(PyExc_ValueError, "invalid state");
+ return NULL;
+ }
+ self->index = (int)index;
+ for (i = 0; i < N; i++)
+ self->state[i] = new_state[i];
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+
+_random.Random.getrandbits
+
+ self: self(type="RandomObject *")
+ k: int
+ /
+
+getrandbits(k) -> x. Generates an int with k random bits.
+[clinic start generated code]*/
+
+static PyObject *
+_random_Random_getrandbits_impl(RandomObject *self, int k)
+/*[clinic end generated code: output=b402f82a2158887f input=8c0e6396dd176fc0]*/
+{
+ int i, words;
+ uint32_t r;
+ uint32_t *wordarray;
+ PyObject *result;
+
+ if (k < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "number of bits must be non-negative");
+ return NULL;
+ }
+
+ if (k == 0)
+ return PyLong_FromLong(0);
+
+ if (k <= 32) /* Fast path */
+ return PyLong_FromUnsignedLong(genrand_uint32(self) >> (32 - k));
+
+ words = (k - 1) / 32 + 1;
+ wordarray = (uint32_t *)PyMem_Malloc(words * 4);
+ if (wordarray == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ /* Fill-out bits of long integer, by 32-bit words, from least significant
+ to most significant. */
+#if PY_LITTLE_ENDIAN
+ for (i = 0; i < words; i++, k -= 32)
+#else
+ for (i = words - 1; i >= 0; i--, k -= 32)
+#endif
+ {
+ r = genrand_uint32(self);
+ if (k < 32)
+ r >>= (32 - k); /* Drop least significant bits */
+ wordarray[i] = r;
+ }
+
+ result = _PyLong_FromByteArray((unsigned char *)wordarray, words * 4,
+ PY_LITTLE_ENDIAN, 0 /* unsigned */);
+ PyMem_Free(wordarray);
+ return result;
+}
+
+static int
+random_init(RandomObject *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *arg = NULL;
+ _randomstate *state = _randomstate_type(Py_TYPE(self));
+
+ if ((Py_IS_TYPE(self, (PyTypeObject *)state->Random_Type) ||
+ Py_TYPE(self)->tp_init == ((PyTypeObject*)state->Random_Type)->tp_init) &&
+ !_PyArg_NoKeywords("Random", kwds)) {
+ return -1;
+ }
+
+ if (PyTuple_GET_SIZE(args) > 1) {
+ PyErr_SetString(PyExc_TypeError, "Random() requires 0 or 1 argument");
+ return -1;
+ }
+
+ if (PyTuple_GET_SIZE(args) == 1)
+ arg = PyTuple_GET_ITEM(args, 0);
+
+ return random_seed(self, arg);
+}
+
+
+static PyMethodDef random_methods[] = {
+ _RANDOM_RANDOM_RANDOM_METHODDEF
+ _RANDOM_RANDOM_SEED_METHODDEF
+ _RANDOM_RANDOM_GETSTATE_METHODDEF
+ _RANDOM_RANDOM_SETSTATE_METHODDEF
+ _RANDOM_RANDOM_GETRANDBITS_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(random_doc,
+"Random() -> create a random number generator with its own internal state.");
+
+static PyType_Slot Random_Type_slots[] = {
+ {Py_tp_doc, (void *)random_doc},
+ {Py_tp_methods, random_methods},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_init, random_init},
+ {Py_tp_free, PyObject_Free},
+ {0, 0},
+};
+
+static PyType_Spec Random_Type_spec = {
+ "_random.Random",
+ sizeof(RandomObject),
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ Random_Type_slots
+};
+
+PyDoc_STRVAR(module_doc,
+"Module implements the Mersenne Twister random number generator.");
+
+static int
+_random_exec(PyObject *module)
+{
+ _randomstate *state = get_random_state(module);
+
+ state->Random_Type = PyType_FromModuleAndSpec(
+ module, &Random_Type_spec, NULL);
+ if (state->Random_Type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, (PyTypeObject *)state->Random_Type) < 0) {
+ return -1;
+ }
+
+ /* Look up and save int.__abs__, which is needed in random_seed(). */
+ PyObject *longval = PyLong_FromLong(0);
+ if (longval == NULL) {
+ return -1;
+ }
+
+ PyObject *longtype = PyObject_Type(longval);
+ Py_DECREF(longval);
+ if (longtype == NULL) {
+ return -1;
+ }
+
+ state->Long___abs__ = PyObject_GetAttrString(longtype, "__abs__");
+ Py_DECREF(longtype);
+ if (state->Long___abs__ == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot _random_slots[] = {
+ {Py_mod_exec, _random_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+_random_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ Py_VISIT(get_random_state(module)->Random_Type);
+ return 0;
+}
+
+static int
+_random_clear(PyObject *module)
+{
+ Py_CLEAR(get_random_state(module)->Random_Type);
+ Py_CLEAR(get_random_state(module)->Long___abs__);
+ return 0;
+}
+
+static void
+_random_free(void *module)
+{
+ _random_clear((PyObject *)module);
+}
+
+static struct PyModuleDef _randommodule = {
+ PyModuleDef_HEAD_INIT,
+ "_random",
+ module_doc,
+ sizeof(_randomstate),
+ NULL,
+ _random_slots,
+ _random_traverse,
+ _random_clear,
+ _random_free,
+};
+
+PyMODINIT_FUNC
+PyInit__random(void)
+{
+ return PyModuleDef_Init(&_randommodule);
+}
diff --git a/contrib/tools/python3/Modules/_scproxy.c b/contrib/tools/python3/Modules/_scproxy.c
new file mode 100644
index 00000000000..0df0324df55
--- /dev/null
+++ b/contrib/tools/python3/Modules/_scproxy.c
@@ -0,0 +1,264 @@
+/*
+ * Helper method for urllib to fetch the proxy configuration settings
+ * using the SystemConfiguration framework.
+ */
+#include <Python.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+
+static int32_t
+cfnum_to_int32(CFNumberRef num)
+{
+ int32_t result;
+
+ CFNumberGetValue(num, kCFNumberSInt32Type, &result);
+ return result;
+}
+
+static PyObject*
+cfstring_to_pystring(CFStringRef ref)
+{
+ const char* s;
+
+ s = CFStringGetCStringPtr(ref, kCFStringEncodingUTF8);
+ if (s) {
+ return PyUnicode_DecodeUTF8(
+ s, strlen(s), NULL);
+
+ } else {
+ CFIndex len = CFStringGetLength(ref);
+ Boolean ok;
+ PyObject* result;
+ char* buf;
+
+ buf = PyMem_Malloc(len*4);
+ if (buf == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ ok = CFStringGetCString(ref,
+ buf, len * 4,
+ kCFStringEncodingUTF8);
+ if (!ok) {
+ PyMem_Free(buf);
+ return NULL;
+ } else {
+ result = PyUnicode_DecodeUTF8(
+ buf, strlen(buf), NULL);
+ PyMem_Free(buf);
+ }
+ return result;
+ }
+}
+
+
+static PyObject*
+get_proxy_settings(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
+{
+ CFDictionaryRef proxyDict = NULL;
+ CFNumberRef aNum = NULL;
+ CFArrayRef anArray = NULL;
+ PyObject* result = NULL;
+ PyObject* v;
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ proxyDict = SCDynamicStoreCopyProxies(NULL);
+ Py_END_ALLOW_THREADS
+
+ if (!proxyDict) {
+ Py_RETURN_NONE;
+ }
+
+ result = PyDict_New();
+ if (result == NULL) goto error;
+
+ aNum = CFDictionaryGetValue(proxyDict,
+ kSCPropNetProxiesExcludeSimpleHostnames);
+ if (aNum == NULL) {
+ v = PyBool_FromLong(0);
+ } else {
+ v = PyBool_FromLong(cfnum_to_int32(aNum));
+ }
+
+ if (v == NULL) goto error;
+
+ r = PyDict_SetItemString(result, "exclude_simple", v);
+ Py_SETREF(v, NULL);
+ if (r == -1) goto error;
+
+ anArray = CFDictionaryGetValue(proxyDict,
+ kSCPropNetProxiesExceptionsList);
+ if (anArray != NULL) {
+ CFIndex len = CFArrayGetCount(anArray);
+ CFIndex i;
+ v = PyTuple_New(len);
+ if (v == NULL) goto error;
+
+ r = PyDict_SetItemString(result, "exceptions", v);
+ Py_DECREF(v);
+ if (r == -1) goto error;
+
+ for (i = 0; i < len; i++) {
+ CFStringRef aString = NULL;
+
+ aString = CFArrayGetValueAtIndex(anArray, i);
+ if (aString == NULL) {
+ PyTuple_SetItem(v, i, Py_None);
+ Py_INCREF(Py_None);
+ } else {
+ PyObject* t = cfstring_to_pystring(aString);
+ if (!t) {
+ PyTuple_SetItem(v, i, Py_None);
+ Py_INCREF(Py_None);
+ } else {
+ PyTuple_SetItem(v, i, t);
+ }
+ }
+ }
+ }
+
+ CFRelease(proxyDict);
+ return result;
+
+error:
+ if (proxyDict) CFRelease(proxyDict);
+ Py_XDECREF(result);
+ return NULL;
+}
+
+static int
+set_proxy(PyObject* proxies, const char* proto, CFDictionaryRef proxyDict,
+ CFStringRef enabledKey,
+ CFStringRef hostKey, CFStringRef portKey)
+{
+ CFNumberRef aNum;
+
+ aNum = CFDictionaryGetValue(proxyDict, enabledKey);
+ if (aNum && cfnum_to_int32(aNum)) {
+ CFStringRef hostString;
+
+ hostString = CFDictionaryGetValue(proxyDict, hostKey);
+ aNum = CFDictionaryGetValue(proxyDict, portKey);
+
+ if (hostString) {
+ int r;
+ PyObject* h = cfstring_to_pystring(hostString);
+ PyObject* v;
+ if (h) {
+ if (aNum) {
+ int32_t port = cfnum_to_int32(aNum);
+ v = PyUnicode_FromFormat("http://%U:%ld",
+ h, (long)port);
+ } else {
+ v = PyUnicode_FromFormat("http://%U", h);
+ }
+ Py_DECREF(h);
+ if (!v) return -1;
+ r = PyDict_SetItemString(proxies, proto,
+ v);
+ Py_DECREF(v);
+ return r;
+ }
+ }
+
+ }
+ return 0;
+}
+
+
+
+static PyObject*
+get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
+{
+ PyObject* result = NULL;
+ int r;
+ CFDictionaryRef proxyDict = NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ proxyDict = SCDynamicStoreCopyProxies(NULL);
+ Py_END_ALLOW_THREADS
+
+ if (proxyDict == NULL) {
+ return PyDict_New();
+ }
+
+ result = PyDict_New();
+ if (result == NULL) goto error;
+
+ r = set_proxy(result, "http", proxyDict,
+ kSCPropNetProxiesHTTPEnable,
+ kSCPropNetProxiesHTTPProxy,
+ kSCPropNetProxiesHTTPPort);
+ if (r == -1) goto error;
+ r = set_proxy(result, "https", proxyDict,
+ kSCPropNetProxiesHTTPSEnable,
+ kSCPropNetProxiesHTTPSProxy,
+ kSCPropNetProxiesHTTPSPort);
+ if (r == -1) goto error;
+ r = set_proxy(result, "ftp", proxyDict,
+ kSCPropNetProxiesFTPEnable,
+ kSCPropNetProxiesFTPProxy,
+ kSCPropNetProxiesFTPPort);
+ if (r == -1) goto error;
+ r = set_proxy(result, "gopher", proxyDict,
+ kSCPropNetProxiesGopherEnable,
+ kSCPropNetProxiesGopherProxy,
+ kSCPropNetProxiesGopherPort);
+ if (r == -1) goto error;
+ r = set_proxy(result, "socks", proxyDict,
+ kSCPropNetProxiesSOCKSEnable,
+ kSCPropNetProxiesSOCKSProxy,
+ kSCPropNetProxiesSOCKSPort);
+ if (r == -1) goto error;
+
+ CFRelease(proxyDict);
+ return result;
+error:
+ if (proxyDict) CFRelease(proxyDict);
+ Py_XDECREF(result);
+ return NULL;
+}
+
+static PyMethodDef mod_methods[] = {
+ {
+ "_get_proxy_settings",
+ get_proxy_settings,
+ METH_NOARGS,
+ NULL,
+ },
+ {
+ "_get_proxies",
+ get_proxies,
+ METH_NOARGS,
+ NULL,
+ },
+ { 0, 0, 0, 0 }
+};
+
+static PyModuleDef_Slot _scproxy_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _scproxy_module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_scproxy",
+ .m_size = 0,
+ .m_methods = mod_methods,
+ .m_slots = _scproxy_slots,
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PyMODINIT_FUNC
+PyInit__scproxy(void)
+{
+ return PyModuleDef_Init(&_scproxy_module);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/blob.c b/contrib/tools/python3/Modules/_sqlite/blob.c
new file mode 100644
index 00000000000..76d261baf00
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/blob.c
@@ -0,0 +1,617 @@
+#include "blob.h"
+#include "util.h"
+
+#define clinic_state() (pysqlite_get_state_by_type(Py_TYPE(self)))
+#include "clinic/blob.c.h"
+#undef clinic_state
+
+/*[clinic input]
+module _sqlite3
+class _sqlite3.Blob "pysqlite_Blob *" "clinic_state()->BlobType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=908d3e16a45f8da7]*/
+
+static void
+close_blob(pysqlite_Blob *self)
+{
+ if (self->blob) {
+ sqlite3_blob *blob = self->blob;
+ self->blob = NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ sqlite3_blob_close(blob);
+ Py_END_ALLOW_THREADS
+ }
+}
+
+static int
+blob_traverse(pysqlite_Blob *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->connection);
+ return 0;
+}
+
+static int
+blob_clear(pysqlite_Blob *self)
+{
+ Py_CLEAR(self->connection);
+ return 0;
+}
+
+static void
+blob_dealloc(pysqlite_Blob *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+
+ close_blob(self);
+
+ if (self->in_weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject*)self);
+ }
+ tp->tp_clear((PyObject *)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+// Return 1 if the blob object is usable, 0 if not.
+static int
+check_blob(pysqlite_Blob *self)
+{
+ if (!pysqlite_check_connection(self->connection) ||
+ !pysqlite_check_thread(self->connection)) {
+ return 0;
+ }
+ if (self->blob == NULL) {
+ pysqlite_state *state = self->connection->state;
+ PyErr_SetString(state->ProgrammingError,
+ "Cannot operate on a closed blob.");
+ return 0;
+ }
+ return 1;
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.close as blob_close
+
+Close the blob.
+[clinic start generated code]*/
+
+static PyObject *
+blob_close_impl(pysqlite_Blob *self)
+/*[clinic end generated code: output=848accc20a138d1b input=7bc178a402a40bd8]*/
+{
+ if (!pysqlite_check_connection(self->connection) ||
+ !pysqlite_check_thread(self->connection))
+ {
+ return NULL;
+ }
+ close_blob(self);
+ Py_RETURN_NONE;
+};
+
+void
+pysqlite_close_all_blobs(pysqlite_Connection *self)
+{
+ for (int i = 0; i < PyList_GET_SIZE(self->blobs); i++) {
+ PyObject *weakref = PyList_GET_ITEM(self->blobs, i);
+ PyObject *blob = PyWeakref_GetObject(weakref);
+ if (!Py_IsNone(blob)) {
+ close_blob((pysqlite_Blob *)blob);
+ }
+ }
+}
+
+static void
+blob_seterror(pysqlite_Blob *self, int rc)
+{
+ assert(self->connection != NULL);
+#if SQLITE_VERSION_NUMBER < 3008008
+ // SQLite pre 3.8.8 does not set this blob error on the connection
+ if (rc == SQLITE_ABORT) {
+ PyErr_SetString(self->connection->OperationalError,
+ "Cannot operate on an expired blob handle");
+ return;
+ }
+#endif
+ _pysqlite_seterror(self->connection->state, self->connection->db);
+}
+
+static PyObject *
+read_single(pysqlite_Blob *self, Py_ssize_t offset)
+{
+ unsigned char buf = 0;
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_blob_read(self->blob, (void *)&buf, 1, (int)offset);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ blob_seterror(self, rc);
+ return NULL;
+ }
+ return PyLong_FromUnsignedLong((unsigned long)buf);
+}
+
+static PyObject *
+read_multiple(pysqlite_Blob *self, Py_ssize_t length, Py_ssize_t offset)
+{
+ assert(length <= sqlite3_blob_bytes(self->blob));
+ assert(offset < sqlite3_blob_bytes(self->blob));
+
+ PyObject *buffer = PyBytes_FromStringAndSize(NULL, length);
+ if (buffer == NULL) {
+ return NULL;
+ }
+
+ char *raw_buffer = PyBytes_AS_STRING(buffer);
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_blob_read(self->blob, raw_buffer, (int)length, (int)offset);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ Py_DECREF(buffer);
+ blob_seterror(self, rc);
+ return NULL;
+ }
+ return buffer;
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.read as blob_read
+
+ length: int = -1
+ Read length in bytes.
+ /
+
+Read data at the current offset position.
+
+If the end of the blob is reached, the data up to end of file will be returned.
+When length is not specified, or is negative, Blob.read() will read until the
+end of the blob.
+[clinic start generated code]*/
+
+static PyObject *
+blob_read_impl(pysqlite_Blob *self, int length)
+/*[clinic end generated code: output=1fc99b2541360dde input=f2e4aa4378837250]*/
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+
+ /* Make sure we never read past "EOB". Also read the rest of the blob if a
+ * negative length is specified. */
+ int blob_len = sqlite3_blob_bytes(self->blob);
+ int max_read_len = blob_len - self->offset;
+ if (length < 0 || length > max_read_len) {
+ length = max_read_len;
+ }
+
+ assert(length >= 0);
+ if (length == 0) {
+ return PyBytes_FromStringAndSize(NULL, 0);
+ }
+
+ PyObject *buffer = read_multiple(self, length, self->offset);
+ if (buffer == NULL) {
+ return NULL;
+ }
+ self->offset += length;
+ return buffer;
+};
+
+static int
+inner_write(pysqlite_Blob *self, const void *buf, Py_ssize_t len,
+ Py_ssize_t offset)
+{
+ Py_ssize_t blob_len = sqlite3_blob_bytes(self->blob);
+ Py_ssize_t remaining_len = blob_len - offset;
+ if (len > remaining_len) {
+ PyErr_SetString(PyExc_ValueError, "data longer than blob length");
+ return -1;
+ }
+
+ assert(offset <= blob_len);
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_blob_write(self->blob, buf, (int)len, (int)offset);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ blob_seterror(self, rc);
+ return -1;
+ }
+ return 0;
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.write as blob_write
+
+ data: Py_buffer
+ /
+
+Write data at the current offset.
+
+This function cannot change the blob length. Writing beyond the end of the
+blob will result in an exception being raised.
+[clinic start generated code]*/
+
+static PyObject *
+blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
+/*[clinic end generated code: output=b34cf22601b570b2 input=a84712f24a028e6d]*/
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+
+ int rc = inner_write(self, data->buf, data->len, self->offset);
+ if (rc < 0) {
+ return NULL;
+ }
+ self->offset += (int)data->len;
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.seek as blob_seek
+
+ offset: int
+ origin: int = 0
+ /
+
+Set the current access position to offset.
+
+The origin argument defaults to os.SEEK_SET (absolute blob positioning).
+Other values for origin are os.SEEK_CUR (seek relative to the current position)
+and os.SEEK_END (seek relative to the blob's end).
+[clinic start generated code]*/
+
+static PyObject *
+blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
+/*[clinic end generated code: output=854c5a0e208547a5 input=5da9a07e55fe6bb6]*/
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+
+ int blob_len = sqlite3_blob_bytes(self->blob);
+ switch (origin) {
+ case SEEK_SET:
+ break;
+ case SEEK_CUR:
+ if (offset > INT_MAX - self->offset) {
+ goto overflow;
+ }
+ offset += self->offset;
+ break;
+ case SEEK_END:
+ if (offset > INT_MAX - blob_len) {
+ goto overflow;
+ }
+ offset += blob_len;
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError,
+ "'origin' should be os.SEEK_SET, os.SEEK_CUR, or "
+ "os.SEEK_END");
+ return NULL;
+ }
+
+ if (offset < 0 || offset > blob_len) {
+ PyErr_SetString(PyExc_ValueError, "offset out of blob range");
+ return NULL;
+ }
+
+ self->offset = offset;
+ Py_RETURN_NONE;
+
+overflow:
+ PyErr_SetString(PyExc_OverflowError, "seek offset results in overflow");
+ return NULL;
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.tell as blob_tell
+
+Return the current access position for the blob.
+[clinic start generated code]*/
+
+static PyObject *
+blob_tell_impl(pysqlite_Blob *self)
+/*[clinic end generated code: output=3d3ba484a90b3a99 input=7e34057aa303612c]*/
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+ return PyLong_FromLong(self->offset);
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.__enter__ as blob_enter
+
+Blob context manager enter.
+[clinic start generated code]*/
+
+static PyObject *
+blob_enter_impl(pysqlite_Blob *self)
+/*[clinic end generated code: output=4fd32484b071a6cd input=fe4842c3c582d5a7]*/
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+ return Py_NewRef(self);
+}
+
+
+/*[clinic input]
+_sqlite3.Blob.__exit__ as blob_exit
+
+ type: object
+ val: object
+ tb: object
+ /
+
+Blob context manager exit.
+[clinic start generated code]*/
+
+static PyObject *
+blob_exit_impl(pysqlite_Blob *self, PyObject *type, PyObject *val,
+ PyObject *tb)
+/*[clinic end generated code: output=fc86ceeb2b68c7b2 input=575d9ecea205f35f]*/
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+ close_blob(self);
+ Py_RETURN_FALSE;
+}
+
+static Py_ssize_t
+blob_length(pysqlite_Blob *self)
+{
+ if (!check_blob(self)) {
+ return -1;
+ }
+ return sqlite3_blob_bytes(self->blob);
+};
+
+static Py_ssize_t
+get_subscript_index(pysqlite_Blob *self, PyObject *item)
+{
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ int blob_len = sqlite3_blob_bytes(self->blob);
+ if (i < 0) {
+ i += blob_len;
+ }
+ if (i < 0 || i >= blob_len) {
+ PyErr_SetString(PyExc_IndexError, "Blob index out of range");
+ return -1;
+ }
+ return i;
+}
+
+static PyObject *
+subscript_index(pysqlite_Blob *self, PyObject *item)
+{
+ Py_ssize_t i = get_subscript_index(self, item);
+ if (i < 0) {
+ return NULL;
+ }
+ return read_single(self, i);
+}
+
+static int
+get_slice_info(pysqlite_Blob *self, PyObject *item, Py_ssize_t *start,
+ Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelen)
+{
+ if (PySlice_Unpack(item, start, stop, step) < 0) {
+ return -1;
+ }
+ int len = sqlite3_blob_bytes(self->blob);
+ *slicelen = PySlice_AdjustIndices(len, start, stop, *step);
+ return 0;
+}
+
+static PyObject *
+subscript_slice(pysqlite_Blob *self, PyObject *item)
+{
+ Py_ssize_t start, stop, step, len;
+ if (get_slice_info(self, item, &start, &stop, &step, &len) < 0) {
+ return NULL;
+ }
+
+ if (step == 1) {
+ return read_multiple(self, len, start);
+ }
+ PyObject *blob = read_multiple(self, stop - start, start);
+ if (blob == NULL) {
+ return NULL;
+ }
+ PyObject *result = PyBytes_FromStringAndSize(NULL, len);
+ if (result != NULL) {
+ char *blob_buf = PyBytes_AS_STRING(blob);
+ char *res_buf = PyBytes_AS_STRING(result);
+ for (Py_ssize_t i = 0, j = 0; i < len; i++, j += step) {
+ res_buf[i] = blob_buf[j];
+ }
+ Py_DECREF(blob);
+ }
+ return result;
+}
+
+static PyObject *
+blob_subscript(pysqlite_Blob *self, PyObject *item)
+{
+ if (!check_blob(self)) {
+ return NULL;
+ }
+
+ if (PyIndex_Check(item)) {
+ return subscript_index(self, item);
+ }
+ if (PySlice_Check(item)) {
+ return subscript_slice(self, item);
+ }
+
+ PyErr_SetString(PyExc_TypeError, "Blob indices must be integers");
+ return NULL;
+}
+
+static int
+ass_subscript_index(pysqlite_Blob *self, PyObject *item, PyObject *value)
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Blob doesn't support item deletion");
+ return -1;
+ }
+ if (!PyLong_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "'%s' object cannot be interpreted as an integer",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ Py_ssize_t i = get_subscript_index(self, item);
+ if (i < 0) {
+ return -1;
+ }
+
+ long val = PyLong_AsLong(value);
+ if (val == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ val = -1;
+ }
+ if (val < 0 || val > 255) {
+ PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)");
+ return -1;
+ }
+ // Downcast to avoid endianness problems.
+ unsigned char byte = (unsigned char)val;
+ return inner_write(self, (const void *)&byte, 1, i);
+}
+
+static int
+ass_subscript_slice(pysqlite_Blob *self, PyObject *item, PyObject *value)
+{
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "Blob doesn't support slice deletion");
+ return -1;
+ }
+
+ Py_ssize_t start, stop, step, len;
+ if (get_slice_info(self, item, &start, &stop, &step, &len) < 0) {
+ return -1;
+ }
+
+ if (len == 0) {
+ return 0;
+ }
+
+ Py_buffer vbuf;
+ if (PyObject_GetBuffer(value, &vbuf, PyBUF_SIMPLE) < 0) {
+ return -1;
+ }
+
+ int rc = -1;
+ if (vbuf.len != len) {
+ PyErr_SetString(PyExc_IndexError,
+ "Blob slice assignment is wrong size");
+ }
+ else if (step == 1) {
+ rc = inner_write(self, vbuf.buf, len, start);
+ }
+ else {
+ PyObject *blob_bytes = read_multiple(self, stop - start, start);
+ if (blob_bytes != NULL) {
+ char *blob_buf = PyBytes_AS_STRING(blob_bytes);
+ for (Py_ssize_t i = 0, j = 0; i < len; i++, j += step) {
+ blob_buf[j] = ((char *)vbuf.buf)[i];
+ }
+ rc = inner_write(self, blob_buf, stop - start, start);
+ Py_DECREF(blob_bytes);
+ }
+ }
+ PyBuffer_Release(&vbuf);
+ return rc;
+}
+
+static int
+blob_ass_subscript(pysqlite_Blob *self, PyObject *item, PyObject *value)
+{
+ if (!check_blob(self)) {
+ return -1;
+ }
+
+ if (PyIndex_Check(item)) {
+ return ass_subscript_index(self, item, value);
+ }
+ if (PySlice_Check(item)) {
+ return ass_subscript_slice(self, item, value);
+ }
+
+ PyErr_SetString(PyExc_TypeError, "Blob indices must be integers");
+ return -1;
+}
+
+
+static PyMethodDef blob_methods[] = {
+ BLOB_CLOSE_METHODDEF
+ BLOB_ENTER_METHODDEF
+ BLOB_EXIT_METHODDEF
+ BLOB_READ_METHODDEF
+ BLOB_SEEK_METHODDEF
+ BLOB_TELL_METHODDEF
+ BLOB_WRITE_METHODDEF
+ {NULL, NULL}
+};
+
+static struct PyMemberDef blob_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(pysqlite_Blob, in_weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot blob_slots[] = {
+ {Py_tp_dealloc, blob_dealloc},
+ {Py_tp_traverse, blob_traverse},
+ {Py_tp_clear, blob_clear},
+ {Py_tp_methods, blob_methods},
+ {Py_tp_members, blob_members},
+
+ // Mapping protocol
+ {Py_mp_length, blob_length},
+ {Py_mp_subscript, blob_subscript},
+ {Py_mp_ass_subscript, blob_ass_subscript},
+ {0, NULL},
+};
+
+static PyType_Spec blob_spec = {
+ .name = MODULE_NAME ".Blob",
+ .basicsize = sizeof(pysqlite_Blob),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = blob_slots,
+};
+
+int
+pysqlite_blob_setup_types(PyObject *mod)
+{
+ PyObject *type = PyType_FromModuleAndSpec(mod, &blob_spec, NULL);
+ if (type == NULL) {
+ return -1;
+ }
+ pysqlite_state *state = pysqlite_get_state(mod);
+ state->BlobType = (PyTypeObject *)type;
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/blob.h b/contrib/tools/python3/Modules/_sqlite/blob.h
new file mode 100644
index 00000000000..418ca03bdb5
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/blob.h
@@ -0,0 +1,24 @@
+#ifndef PYSQLITE_BLOB_H
+#define PYSQLITE_BLOB_H
+
+#include "Python.h"
+#include "sqlite3.h"
+#include "connection.h"
+
+#define BLOB_SEEK_START 0
+#define BLOB_SEEK_CUR 1
+#define BLOB_SEEK_END 2
+
+typedef struct {
+ PyObject_HEAD
+ pysqlite_Connection *connection;
+ sqlite3_blob *blob;
+ int offset;
+
+ PyObject *in_weakreflist;
+} pysqlite_Blob;
+
+int pysqlite_blob_setup_types(PyObject *mod);
+void pysqlite_close_all_blobs(pysqlite_Connection *self);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h
new file mode 100644
index 00000000000..f3d8a35be46
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/blob.c.h
@@ -0,0 +1,222 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(blob_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the blob.");
+
+#define BLOB_CLOSE_METHODDEF \
+ {"close", (PyCFunction)blob_close, METH_NOARGS, blob_close__doc__},
+
+static PyObject *
+blob_close_impl(pysqlite_Blob *self);
+
+static PyObject *
+blob_close(pysqlite_Blob *self, PyObject *Py_UNUSED(ignored))
+{
+ return blob_close_impl(self);
+}
+
+PyDoc_STRVAR(blob_read__doc__,
+"read($self, length=-1, /)\n"
+"--\n"
+"\n"
+"Read data at the current offset position.\n"
+"\n"
+" length\n"
+" Read length in bytes.\n"
+"\n"
+"If the end of the blob is reached, the data up to end of file will be returned.\n"
+"When length is not specified, or is negative, Blob.read() will read until the\n"
+"end of the blob.");
+
+#define BLOB_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(blob_read), METH_FASTCALL, blob_read__doc__},
+
+static PyObject *
+blob_read_impl(pysqlite_Blob *self, int length);
+
+static PyObject *
+blob_read(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int length = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ length = _PyLong_AsInt(args[0]);
+ if (length == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = blob_read_impl(self, length);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(blob_write__doc__,
+"write($self, data, /)\n"
+"--\n"
+"\n"
+"Write data at the current offset.\n"
+"\n"
+"This function cannot change the blob length. Writing beyond the end of the\n"
+"blob will result in an exception being raised.");
+
+#define BLOB_WRITE_METHODDEF \
+ {"write", (PyCFunction)blob_write, METH_O, blob_write__doc__},
+
+static PyObject *
+blob_write_impl(pysqlite_Blob *self, Py_buffer *data);
+
+static PyObject *
+blob_write(pysqlite_Blob *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = blob_write_impl(self, &data);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(blob_seek__doc__,
+"seek($self, offset, origin=0, /)\n"
+"--\n"
+"\n"
+"Set the current access position to offset.\n"
+"\n"
+"The origin argument defaults to os.SEEK_SET (absolute blob positioning).\n"
+"Other values for origin are os.SEEK_CUR (seek relative to the current position)\n"
+"and os.SEEK_END (seek relative to the blob\'s end).");
+
+#define BLOB_SEEK_METHODDEF \
+ {"seek", _PyCFunction_CAST(blob_seek), METH_FASTCALL, blob_seek__doc__},
+
+static PyObject *
+blob_seek_impl(pysqlite_Blob *self, int offset, int origin);
+
+static PyObject *
+blob_seek(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int offset;
+ int origin = 0;
+
+ if (!_PyArg_CheckPositional("seek", nargs, 1, 2)) {
+ goto exit;
+ }
+ offset = _PyLong_AsInt(args[0]);
+ if (offset == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ origin = _PyLong_AsInt(args[1]);
+ if (origin == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = blob_seek_impl(self, offset, origin);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(blob_tell__doc__,
+"tell($self, /)\n"
+"--\n"
+"\n"
+"Return the current access position for the blob.");
+
+#define BLOB_TELL_METHODDEF \
+ {"tell", (PyCFunction)blob_tell, METH_NOARGS, blob_tell__doc__},
+
+static PyObject *
+blob_tell_impl(pysqlite_Blob *self);
+
+static PyObject *
+blob_tell(pysqlite_Blob *self, PyObject *Py_UNUSED(ignored))
+{
+ return blob_tell_impl(self);
+}
+
+PyDoc_STRVAR(blob_enter__doc__,
+"__enter__($self, /)\n"
+"--\n"
+"\n"
+"Blob context manager enter.");
+
+#define BLOB_ENTER_METHODDEF \
+ {"__enter__", (PyCFunction)blob_enter, METH_NOARGS, blob_enter__doc__},
+
+static PyObject *
+blob_enter_impl(pysqlite_Blob *self);
+
+static PyObject *
+blob_enter(pysqlite_Blob *self, PyObject *Py_UNUSED(ignored))
+{
+ return blob_enter_impl(self);
+}
+
+PyDoc_STRVAR(blob_exit__doc__,
+"__exit__($self, type, val, tb, /)\n"
+"--\n"
+"\n"
+"Blob context manager exit.");
+
+#define BLOB_EXIT_METHODDEF \
+ {"__exit__", _PyCFunction_CAST(blob_exit), METH_FASTCALL, blob_exit__doc__},
+
+static PyObject *
+blob_exit_impl(pysqlite_Blob *self, PyObject *type, PyObject *val,
+ PyObject *tb);
+
+static PyObject *
+blob_exit(pysqlite_Blob *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *type;
+ PyObject *val;
+ PyObject *tb;
+
+ if (!_PyArg_CheckPositional("__exit__", nargs, 3, 3)) {
+ goto exit;
+ }
+ type = args[0];
+ val = args[1];
+ tb = args[2];
+ return_value = blob_exit_impl(self, type, val, tb);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=ad6a402f70e85977 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h
new file mode 100644
index 00000000000..417abcc4626
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/connection.c.h
@@ -0,0 +1,1668 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+static int
+pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database,
+ double timeout, int detect_types,
+ const char *isolation_level,
+ int check_same_thread, PyObject *factory,
+ int cache_size, int uri,
+ enum autocommit_mode autocommit);
+
+static int
+pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 9
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(database), &_Py_ID(timeout), &_Py_ID(detect_types), &_Py_ID(isolation_level), &_Py_ID(check_same_thread), &_Py_ID(factory), &_Py_ID(cached_statements), &_Py_ID(uri), &_Py_ID(autocommit), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"database", "timeout", "detect_types", "isolation_level", "check_same_thread", "factory", "cached_statements", "uri", "autocommit", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Connection",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[9];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *database;
+ double timeout = 5.0;
+ int detect_types = 0;
+ const char *isolation_level = "";
+ int check_same_thread = 1;
+ PyObject *factory = (PyObject*)clinic_state()->ConnectionType;
+ int cache_size = 128;
+ int uri = 0;
+ enum autocommit_mode autocommit = LEGACY_TRANSACTION_CONTROL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 8, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ database = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[1]) {
+ if (PyFloat_CheckExact(fastargs[1])) {
+ timeout = PyFloat_AS_DOUBLE(fastargs[1]);
+ }
+ else
+ {
+ timeout = PyFloat_AsDouble(fastargs[1]);
+ if (timeout == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[2]) {
+ detect_types = _PyLong_AsInt(fastargs[2]);
+ if (detect_types == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[3]) {
+ if (!isolation_level_converter(fastargs[3], &isolation_level)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[4]) {
+ check_same_thread = PyObject_IsTrue(fastargs[4]);
+ if (check_same_thread < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[5]) {
+ factory = fastargs[5];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[6]) {
+ cache_size = _PyLong_AsInt(fastargs[6]);
+ if (cache_size == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[7]) {
+ uri = PyObject_IsTrue(fastargs[7]);
+ if (uri < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!autocommit_converter(fastargs[8], &autocommit)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = pysqlite_connection_init_impl((pysqlite_Connection *)self, database, timeout, detect_types, isolation_level, check_same_thread, factory, cache_size, uri, autocommit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_cursor__doc__,
+"cursor($self, /, factory=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Return a cursor for the connection.");
+
+#define PYSQLITE_CONNECTION_CURSOR_METHODDEF \
+ {"cursor", _PyCFunction_CAST(pysqlite_connection_cursor), METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_cursor__doc__},
+
+static PyObject *
+pysqlite_connection_cursor_impl(pysqlite_Connection *self, PyObject *factory);
+
+static PyObject *
+pysqlite_connection_cursor(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(factory), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"factory", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "cursor",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *factory = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ factory = args[0];
+skip_optional_pos:
+ return_value = pysqlite_connection_cursor_impl(self, factory);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(blobopen__doc__,
+"blobopen($self, table, column, row, /, *, readonly=False, name=\'main\')\n"
+"--\n"
+"\n"
+"Open and return a BLOB object.\n"
+"\n"
+" table\n"
+" Table name.\n"
+" column\n"
+" Column name.\n"
+" row\n"
+" Row index.\n"
+" readonly\n"
+" Open the BLOB without write permissions.\n"
+" name\n"
+" Database name.");
+
+#define BLOBOPEN_METHODDEF \
+ {"blobopen", _PyCFunction_CAST(blobopen), METH_FASTCALL|METH_KEYWORDS, blobopen__doc__},
+
+static PyObject *
+blobopen_impl(pysqlite_Connection *self, const char *table, const char *col,
+ sqlite3_int64 row, int readonly, const char *name);
+
+static PyObject *
+blobopen(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(readonly), &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "", "", "readonly", "name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "blobopen",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ const char *table;
+ const char *col;
+ sqlite3_int64 row;
+ int readonly = 0;
+ const char *name = "main";
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("blobopen", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t table_length;
+ table = PyUnicode_AsUTF8AndSize(args[0], &table_length);
+ if (table == NULL) {
+ goto exit;
+ }
+ if (strlen(table) != (size_t)table_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("blobopen", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t col_length;
+ col = PyUnicode_AsUTF8AndSize(args[1], &col_length);
+ if (col == NULL) {
+ goto exit;
+ }
+ if (strlen(col) != (size_t)col_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!sqlite3_int64_converter(args[2], &row)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[3]) {
+ readonly = PyObject_IsTrue(args[3]);
+ if (readonly < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (!PyUnicode_Check(args[4])) {
+ _PyArg_BadArgument("blobopen", "argument 'name'", "str", args[4]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[4], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = blobopen_impl(self, table, col, row, readonly, name);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the database connection.\n"
+"\n"
+"Any pending transaction is not committed implicitly.");
+
+#define PYSQLITE_CONNECTION_CLOSE_METHODDEF \
+ {"close", (PyCFunction)pysqlite_connection_close, METH_NOARGS, pysqlite_connection_close__doc__},
+
+static PyObject *
+pysqlite_connection_close_impl(pysqlite_Connection *self);
+
+static PyObject *
+pysqlite_connection_close(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_connection_close_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_connection_commit__doc__,
+"commit($self, /)\n"
+"--\n"
+"\n"
+"Commit any pending transaction to the database.\n"
+"\n"
+"If there is no open transaction, this method is a no-op.");
+
+#define PYSQLITE_CONNECTION_COMMIT_METHODDEF \
+ {"commit", (PyCFunction)pysqlite_connection_commit, METH_NOARGS, pysqlite_connection_commit__doc__},
+
+static PyObject *
+pysqlite_connection_commit_impl(pysqlite_Connection *self);
+
+static PyObject *
+pysqlite_connection_commit(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_connection_commit_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_connection_rollback__doc__,
+"rollback($self, /)\n"
+"--\n"
+"\n"
+"Roll back to the start of any pending transaction.\n"
+"\n"
+"If there is no open transaction, this method is a no-op.");
+
+#define PYSQLITE_CONNECTION_ROLLBACK_METHODDEF \
+ {"rollback", (PyCFunction)pysqlite_connection_rollback, METH_NOARGS, pysqlite_connection_rollback__doc__},
+
+static PyObject *
+pysqlite_connection_rollback_impl(pysqlite_Connection *self);
+
+static PyObject *
+pysqlite_connection_rollback(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_connection_rollback_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_connection_create_function__doc__,
+"create_function($self, /, name, narg, func, *, deterministic=False)\n"
+"--\n"
+"\n"
+"Creates a new function.");
+
+#define PYSQLITE_CONNECTION_CREATE_FUNCTION_METHODDEF \
+ {"create_function", _PyCFunction_CAST(pysqlite_connection_create_function), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_create_function__doc__},
+
+static PyObject *
+pysqlite_connection_create_function_impl(pysqlite_Connection *self,
+ PyTypeObject *cls, const char *name,
+ int narg, PyObject *func,
+ int deterministic);
+
+static PyObject *
+pysqlite_connection_create_function(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), &_Py_ID(narg), &_Py_ID(func), &_Py_ID(deterministic), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", "narg", "func", "deterministic", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "create_function",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ const char *name;
+ int narg;
+ PyObject *func;
+ int deterministic = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("create_function", "argument 'name'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ narg = _PyLong_AsInt(args[1]);
+ if (narg == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ func = args[2];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ deterministic = PyObject_IsTrue(args[3]);
+ if (deterministic < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = pysqlite_connection_create_function_impl(self, cls, name, narg, func, deterministic);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_WINDOW_FUNCTIONS)
+
+PyDoc_STRVAR(create_window_function__doc__,
+"create_window_function($self, name, num_params, aggregate_class, /)\n"
+"--\n"
+"\n"
+"Creates or redefines an aggregate window function. Non-standard.\n"
+"\n"
+" name\n"
+" The name of the SQL aggregate window function to be created or\n"
+" redefined.\n"
+" num_params\n"
+" The number of arguments the step and inverse methods takes.\n"
+" aggregate_class\n"
+" A class with step(), finalize(), value(), and inverse() methods.\n"
+" Set to None to clear the window function.");
+
+#define CREATE_WINDOW_FUNCTION_METHODDEF \
+ {"create_window_function", _PyCFunction_CAST(create_window_function), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, create_window_function__doc__},
+
+static PyObject *
+create_window_function_impl(pysqlite_Connection *self, PyTypeObject *cls,
+ const char *name, int num_params,
+ PyObject *aggregate_class);
+
+static PyObject *
+create_window_function(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "create_window_function",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ const char *name;
+ int num_params;
+ PyObject *aggregate_class;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("create_window_function", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ num_params = _PyLong_AsInt(args[1]);
+ if (num_params == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ aggregate_class = args[2];
+ return_value = create_window_function_impl(self, cls, name, num_params, aggregate_class);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WINDOW_FUNCTIONS) */
+
+PyDoc_STRVAR(pysqlite_connection_create_aggregate__doc__,
+"create_aggregate($self, /, name, n_arg, aggregate_class)\n"
+"--\n"
+"\n"
+"Creates a new aggregate.");
+
+#define PYSQLITE_CONNECTION_CREATE_AGGREGATE_METHODDEF \
+ {"create_aggregate", _PyCFunction_CAST(pysqlite_connection_create_aggregate), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_create_aggregate__doc__},
+
+static PyObject *
+pysqlite_connection_create_aggregate_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ const char *name, int n_arg,
+ PyObject *aggregate_class);
+
+static PyObject *
+pysqlite_connection_create_aggregate(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), &_Py_ID(n_arg), &_Py_ID(aggregate_class), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", "n_arg", "aggregate_class", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "create_aggregate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ const char *name;
+ int n_arg;
+ PyObject *aggregate_class;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("create_aggregate", "argument 'name'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ n_arg = _PyLong_AsInt(args[1]);
+ if (n_arg == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ aggregate_class = args[2];
+ return_value = pysqlite_connection_create_aggregate_impl(self, cls, name, n_arg, aggregate_class);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_set_authorizer__doc__,
+"set_authorizer($self, /, authorizer_callback)\n"
+"--\n"
+"\n"
+"Sets authorizer callback.");
+
+#define PYSQLITE_CONNECTION_SET_AUTHORIZER_METHODDEF \
+ {"set_authorizer", _PyCFunction_CAST(pysqlite_connection_set_authorizer), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_set_authorizer__doc__},
+
+static PyObject *
+pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ PyObject *callable);
+
+static PyObject *
+pysqlite_connection_set_authorizer(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(authorizer_callback), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"authorizer_callback", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "set_authorizer",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *callable;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ callable = args[0];
+ return_value = pysqlite_connection_set_authorizer_impl(self, cls, callable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_set_progress_handler__doc__,
+"set_progress_handler($self, /, progress_handler, n)\n"
+"--\n"
+"\n"
+"Sets progress handler callback.");
+
+#define PYSQLITE_CONNECTION_SET_PROGRESS_HANDLER_METHODDEF \
+ {"set_progress_handler", _PyCFunction_CAST(pysqlite_connection_set_progress_handler), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_set_progress_handler__doc__},
+
+static PyObject *
+pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ PyObject *callable, int n);
+
+static PyObject *
+pysqlite_connection_set_progress_handler(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(progress_handler), &_Py_ID(n), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"progress_handler", "n", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "set_progress_handler",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *callable;
+ int n;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ callable = args[0];
+ n = _PyLong_AsInt(args[1]);
+ if (n == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = pysqlite_connection_set_progress_handler_impl(self, cls, callable, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_set_trace_callback__doc__,
+"set_trace_callback($self, /, trace_callback)\n"
+"--\n"
+"\n"
+"Sets a trace callback called for each SQL statement (passed as unicode).");
+
+#define PYSQLITE_CONNECTION_SET_TRACE_CALLBACK_METHODDEF \
+ {"set_trace_callback", _PyCFunction_CAST(pysqlite_connection_set_trace_callback), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_set_trace_callback__doc__},
+
+static PyObject *
+pysqlite_connection_set_trace_callback_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ PyObject *callable);
+
+static PyObject *
+pysqlite_connection_set_trace_callback(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(trace_callback), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"trace_callback", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "set_trace_callback",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *callable;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ callable = args[0];
+ return_value = pysqlite_connection_set_trace_callback_impl(self, cls, callable);
+
+exit:
+ return return_value;
+}
+
+#if defined(PY_SQLITE_ENABLE_LOAD_EXTENSION)
+
+PyDoc_STRVAR(pysqlite_connection_enable_load_extension__doc__,
+"enable_load_extension($self, enable, /)\n"
+"--\n"
+"\n"
+"Enable dynamic loading of SQLite extension modules.");
+
+#define PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF \
+ {"enable_load_extension", (PyCFunction)pysqlite_connection_enable_load_extension, METH_O, pysqlite_connection_enable_load_extension__doc__},
+
+static PyObject *
+pysqlite_connection_enable_load_extension_impl(pysqlite_Connection *self,
+ int onoff);
+
+static PyObject *
+pysqlite_connection_enable_load_extension(pysqlite_Connection *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int onoff;
+
+ onoff = PyObject_IsTrue(arg);
+ if (onoff < 0) {
+ goto exit;
+ }
+ return_value = pysqlite_connection_enable_load_extension_impl(self, onoff);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_SQLITE_ENABLE_LOAD_EXTENSION) */
+
+#if defined(PY_SQLITE_ENABLE_LOAD_EXTENSION)
+
+PyDoc_STRVAR(pysqlite_connection_load_extension__doc__,
+"load_extension($self, name, /, *, entrypoint=None)\n"
+"--\n"
+"\n"
+"Load SQLite extension module.");
+
+#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF \
+ {"load_extension", _PyCFunction_CAST(pysqlite_connection_load_extension), METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_load_extension__doc__},
+
+static PyObject *
+pysqlite_connection_load_extension_impl(pysqlite_Connection *self,
+ const char *extension_name,
+ const char *entrypoint);
+
+static PyObject *
+pysqlite_connection_load_extension(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(entrypoint), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "entrypoint", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "load_extension",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ const char *extension_name;
+ const char *entrypoint = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("load_extension", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t extension_name_length;
+ extension_name = PyUnicode_AsUTF8AndSize(args[0], &extension_name_length);
+ if (extension_name == NULL) {
+ goto exit;
+ }
+ if (strlen(extension_name) != (size_t)extension_name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[1] == Py_None) {
+ entrypoint = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t entrypoint_length;
+ entrypoint = PyUnicode_AsUTF8AndSize(args[1], &entrypoint_length);
+ if (entrypoint == NULL) {
+ goto exit;
+ }
+ if (strlen(entrypoint) != (size_t)entrypoint_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("load_extension", "argument 'entrypoint'", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = pysqlite_connection_load_extension_impl(self, extension_name, entrypoint);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_SQLITE_ENABLE_LOAD_EXTENSION) */
+
+PyDoc_STRVAR(pysqlite_connection_execute__doc__,
+"execute($self, sql, parameters=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Executes an SQL statement.");
+
+#define PYSQLITE_CONNECTION_EXECUTE_METHODDEF \
+ {"execute", _PyCFunction_CAST(pysqlite_connection_execute), METH_FASTCALL, pysqlite_connection_execute__doc__},
+
+static PyObject *
+pysqlite_connection_execute_impl(pysqlite_Connection *self, PyObject *sql,
+ PyObject *parameters);
+
+static PyObject *
+pysqlite_connection_execute(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sql;
+ PyObject *parameters = NULL;
+
+ if (!_PyArg_CheckPositional("execute", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("execute", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ sql = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ parameters = args[1];
+skip_optional:
+ return_value = pysqlite_connection_execute_impl(self, sql, parameters);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_executemany__doc__,
+"executemany($self, sql, parameters, /)\n"
+"--\n"
+"\n"
+"Repeatedly executes an SQL statement.");
+
+#define PYSQLITE_CONNECTION_EXECUTEMANY_METHODDEF \
+ {"executemany", _PyCFunction_CAST(pysqlite_connection_executemany), METH_FASTCALL, pysqlite_connection_executemany__doc__},
+
+static PyObject *
+pysqlite_connection_executemany_impl(pysqlite_Connection *self,
+ PyObject *sql, PyObject *parameters);
+
+static PyObject *
+pysqlite_connection_executemany(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sql;
+ PyObject *parameters;
+
+ if (!_PyArg_CheckPositional("executemany", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("executemany", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ sql = args[0];
+ parameters = args[1];
+ return_value = pysqlite_connection_executemany_impl(self, sql, parameters);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_executescript__doc__,
+"executescript($self, sql_script, /)\n"
+"--\n"
+"\n"
+"Executes multiple SQL statements at once.");
+
+#define PYSQLITE_CONNECTION_EXECUTESCRIPT_METHODDEF \
+ {"executescript", (PyCFunction)pysqlite_connection_executescript, METH_O, pysqlite_connection_executescript__doc__},
+
+PyDoc_STRVAR(pysqlite_connection_interrupt__doc__,
+"interrupt($self, /)\n"
+"--\n"
+"\n"
+"Abort any pending database operation.");
+
+#define PYSQLITE_CONNECTION_INTERRUPT_METHODDEF \
+ {"interrupt", (PyCFunction)pysqlite_connection_interrupt, METH_NOARGS, pysqlite_connection_interrupt__doc__},
+
+static PyObject *
+pysqlite_connection_interrupt_impl(pysqlite_Connection *self);
+
+static PyObject *
+pysqlite_connection_interrupt(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_connection_interrupt_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_connection_iterdump__doc__,
+"iterdump($self, /)\n"
+"--\n"
+"\n"
+"Returns iterator to the dump of the database in an SQL text format.");
+
+#define PYSQLITE_CONNECTION_ITERDUMP_METHODDEF \
+ {"iterdump", (PyCFunction)pysqlite_connection_iterdump, METH_NOARGS, pysqlite_connection_iterdump__doc__},
+
+static PyObject *
+pysqlite_connection_iterdump_impl(pysqlite_Connection *self);
+
+static PyObject *
+pysqlite_connection_iterdump(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_connection_iterdump_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_connection_backup__doc__,
+"backup($self, /, target, *, pages=-1, progress=None, name=\'main\',\n"
+" sleep=0.25)\n"
+"--\n"
+"\n"
+"Makes a backup of the database.");
+
+#define PYSQLITE_CONNECTION_BACKUP_METHODDEF \
+ {"backup", _PyCFunction_CAST(pysqlite_connection_backup), METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_backup__doc__},
+
+static PyObject *
+pysqlite_connection_backup_impl(pysqlite_Connection *self,
+ pysqlite_Connection *target, int pages,
+ PyObject *progress, const char *name,
+ double sleep);
+
+static PyObject *
+pysqlite_connection_backup(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(target), &_Py_ID(pages), &_Py_ID(progress), &_Py_ID(name), &_Py_ID(sleep), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"target", "pages", "progress", "name", "sleep", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "backup",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ pysqlite_Connection *target;
+ int pages = -1;
+ PyObject *progress = Py_None;
+ const char *name = "main";
+ double sleep = 0.25;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(args[0], clinic_state()->ConnectionType)) {
+ _PyArg_BadArgument("backup", "argument 'target'", (clinic_state()->ConnectionType)->tp_name, args[0]);
+ goto exit;
+ }
+ target = (pysqlite_Connection *)args[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[1]) {
+ pages = _PyLong_AsInt(args[1]);
+ if (pages == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[2]) {
+ progress = args[2];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ if (!PyUnicode_Check(args[3])) {
+ _PyArg_BadArgument("backup", "argument 'name'", "str", args[3]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[3], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (PyFloat_CheckExact(args[4])) {
+ sleep = PyFloat_AS_DOUBLE(args[4]);
+ }
+ else
+ {
+ sleep = PyFloat_AsDouble(args[4]);
+ if (sleep == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+skip_optional_kwonly:
+ return_value = pysqlite_connection_backup_impl(self, target, pages, progress, name, sleep);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_connection_create_collation__doc__,
+"create_collation($self, name, callback, /)\n"
+"--\n"
+"\n"
+"Creates a collation function.");
+
+#define PYSQLITE_CONNECTION_CREATE_COLLATION_METHODDEF \
+ {"create_collation", _PyCFunction_CAST(pysqlite_connection_create_collation), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pysqlite_connection_create_collation__doc__},
+
+static PyObject *
+pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ const char *name,
+ PyObject *callable);
+
+static PyObject *
+pysqlite_connection_create_collation(pysqlite_Connection *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "create_collation",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ const char *name;
+ PyObject *callable;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("create_collation", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ callable = args[1];
+ return_value = pysqlite_connection_create_collation_impl(self, cls, name, callable);
+
+exit:
+ return return_value;
+}
+
+#if defined(PY_SQLITE_HAVE_SERIALIZE)
+
+PyDoc_STRVAR(serialize__doc__,
+"serialize($self, /, *, name=\'main\')\n"
+"--\n"
+"\n"
+"Serialize a database into a byte string.\n"
+"\n"
+" name\n"
+" Which database to serialize.\n"
+"\n"
+"For an ordinary on-disk database file, the serialization is just a copy of the\n"
+"disk file. For an in-memory database or a \"temp\" database, the serialization is\n"
+"the same sequence of bytes which would be written to disk if that database\n"
+"were backed up to disk.");
+
+#define SERIALIZE_METHODDEF \
+ {"serialize", _PyCFunction_CAST(serialize), METH_FASTCALL|METH_KEYWORDS, serialize__doc__},
+
+static PyObject *
+serialize_impl(pysqlite_Connection *self, const char *name);
+
+static PyObject *
+serialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "serialize",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ const char *name = "main";
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("serialize", "argument 'name'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[0], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = serialize_impl(self, name);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_SQLITE_HAVE_SERIALIZE) */
+
+#if defined(PY_SQLITE_HAVE_SERIALIZE)
+
+PyDoc_STRVAR(deserialize__doc__,
+"deserialize($self, data, /, *, name=\'main\')\n"
+"--\n"
+"\n"
+"Load a serialized database.\n"
+"\n"
+" data\n"
+" The serialized database content.\n"
+" name\n"
+" Which database to reopen with the deserialization.\n"
+"\n"
+"The deserialize interface causes the database connection to disconnect from the\n"
+"target database, and then reopen it as an in-memory database based on the given\n"
+"serialized data.\n"
+"\n"
+"The deserialize interface will fail with SQLITE_BUSY if the database is\n"
+"currently in a read transaction or is involved in a backup operation.");
+
+#define DESERIALIZE_METHODDEF \
+ {"deserialize", _PyCFunction_CAST(deserialize), METH_FASTCALL|METH_KEYWORDS, deserialize__doc__},
+
+static PyObject *
+deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
+ const char *name);
+
+static PyObject *
+deserialize(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "deserialize",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ const char *name = "main";
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyUnicode_Check(args[0])) {
+ Py_ssize_t len;
+ const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len);
+ if (ptr == NULL) {
+ goto exit;
+ }
+ PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, 0);
+ }
+ else { /* any bytes-like object */
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("deserialize", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("deserialize", "argument 'name'", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(args[1], &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = deserialize_impl(self, &data, name);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(PY_SQLITE_HAVE_SERIALIZE) */
+
+PyDoc_STRVAR(pysqlite_connection_enter__doc__,
+"__enter__($self, /)\n"
+"--\n"
+"\n"
+"Called when the connection is used as a context manager.\n"
+"\n"
+"Returns itself as a convenience to the caller.");
+
+#define PYSQLITE_CONNECTION_ENTER_METHODDEF \
+ {"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS, pysqlite_connection_enter__doc__},
+
+static PyObject *
+pysqlite_connection_enter_impl(pysqlite_Connection *self);
+
+static PyObject *
+pysqlite_connection_enter(pysqlite_Connection *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_connection_enter_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_connection_exit__doc__,
+"__exit__($self, type, value, traceback, /)\n"
+"--\n"
+"\n"
+"Called when the connection is used as a context manager.\n"
+"\n"
+"If there was any exception, a rollback takes place; otherwise we commit.");
+
+#define PYSQLITE_CONNECTION_EXIT_METHODDEF \
+ {"__exit__", _PyCFunction_CAST(pysqlite_connection_exit), METH_FASTCALL, pysqlite_connection_exit__doc__},
+
+static PyObject *
+pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
+ PyObject *exc_value, PyObject *exc_tb);
+
+static PyObject *
+pysqlite_connection_exit(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *exc_type;
+ PyObject *exc_value;
+ PyObject *exc_tb;
+
+ if (!_PyArg_CheckPositional("__exit__", nargs, 3, 3)) {
+ goto exit;
+ }
+ exc_type = args[0];
+ exc_value = args[1];
+ exc_tb = args[2];
+ return_value = pysqlite_connection_exit_impl(self, exc_type, exc_value, exc_tb);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(setlimit__doc__,
+"setlimit($self, category, limit, /)\n"
+"--\n"
+"\n"
+"Set connection run-time limits.\n"
+"\n"
+" category\n"
+" The limit category to be set.\n"
+" limit\n"
+" The new limit. If the new limit is a negative number, the limit is\n"
+" unchanged.\n"
+"\n"
+"Attempts to increase a limit above its hard upper bound are silently truncated\n"
+"to the hard upper bound. Regardless of whether or not the limit was changed,\n"
+"the prior value of the limit is returned.");
+
+#define SETLIMIT_METHODDEF \
+ {"setlimit", _PyCFunction_CAST(setlimit), METH_FASTCALL, setlimit__doc__},
+
+static PyObject *
+setlimit_impl(pysqlite_Connection *self, int category, int limit);
+
+static PyObject *
+setlimit(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int category;
+ int limit;
+
+ if (!_PyArg_CheckPositional("setlimit", nargs, 2, 2)) {
+ goto exit;
+ }
+ category = _PyLong_AsInt(args[0]);
+ if (category == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ limit = _PyLong_AsInt(args[1]);
+ if (limit == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = setlimit_impl(self, category, limit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(getlimit__doc__,
+"getlimit($self, category, /)\n"
+"--\n"
+"\n"
+"Get connection run-time limits.\n"
+"\n"
+" category\n"
+" The limit category to be queried.");
+
+#define GETLIMIT_METHODDEF \
+ {"getlimit", (PyCFunction)getlimit, METH_O, getlimit__doc__},
+
+static PyObject *
+getlimit_impl(pysqlite_Connection *self, int category);
+
+static PyObject *
+getlimit(pysqlite_Connection *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int category;
+
+ category = _PyLong_AsInt(arg);
+ if (category == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = getlimit_impl(self, category);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(setconfig__doc__,
+"setconfig($self, op, enable=True, /)\n"
+"--\n"
+"\n"
+"Set a boolean connection configuration option.\n"
+"\n"
+" op\n"
+" The configuration verb; one of the sqlite3.SQLITE_DBCONFIG codes.");
+
+#define SETCONFIG_METHODDEF \
+ {"setconfig", _PyCFunction_CAST(setconfig), METH_FASTCALL, setconfig__doc__},
+
+static PyObject *
+setconfig_impl(pysqlite_Connection *self, int op, int enable);
+
+static PyObject *
+setconfig(pysqlite_Connection *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int op;
+ int enable = 1;
+
+ if (!_PyArg_CheckPositional("setconfig", nargs, 1, 2)) {
+ goto exit;
+ }
+ op = _PyLong_AsInt(args[0]);
+ if (op == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ enable = PyObject_IsTrue(args[1]);
+ if (enable < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = setconfig_impl(self, op, enable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(getconfig__doc__,
+"getconfig($self, op, /)\n"
+"--\n"
+"\n"
+"Query a boolean connection configuration option.\n"
+"\n"
+" op\n"
+" The configuration verb; one of the sqlite3.SQLITE_DBCONFIG codes.");
+
+#define GETCONFIG_METHODDEF \
+ {"getconfig", (PyCFunction)getconfig, METH_O, getconfig__doc__},
+
+static int
+getconfig_impl(pysqlite_Connection *self, int op);
+
+static PyObject *
+getconfig(pysqlite_Connection *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int op;
+ int _return_value;
+
+ op = _PyLong_AsInt(arg);
+ if (op == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = getconfig_impl(self, op);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#ifndef CREATE_WINDOW_FUNCTION_METHODDEF
+ #define CREATE_WINDOW_FUNCTION_METHODDEF
+#endif /* !defined(CREATE_WINDOW_FUNCTION_METHODDEF) */
+
+#ifndef PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF
+ #define PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF
+#endif /* !defined(PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF) */
+
+#ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
+ #define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
+#endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */
+
+#ifndef SERIALIZE_METHODDEF
+ #define SERIALIZE_METHODDEF
+#endif /* !defined(SERIALIZE_METHODDEF) */
+
+#ifndef DESERIALIZE_METHODDEF
+ #define DESERIALIZE_METHODDEF
+#endif /* !defined(DESERIALIZE_METHODDEF) */
+/*[clinic end generated code: output=834a99827555bf1a input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h
new file mode 100644
index 00000000000..43e912d1347
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/cursor.c.h
@@ -0,0 +1,322 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+static int
+pysqlite_cursor_init_impl(pysqlite_Cursor *self,
+ pysqlite_Connection *connection);
+
+static int
+pysqlite_cursor_init(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ PyTypeObject *base_tp = clinic_state()->CursorType;
+ pysqlite_Connection *connection;
+
+ if ((Py_IS_TYPE(self, base_tp) ||
+ Py_TYPE(self)->tp_new == base_tp->tp_new) &&
+ !_PyArg_NoKeywords("Cursor", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("Cursor", PyTuple_GET_SIZE(args), 1, 1)) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->ConnectionType)) {
+ _PyArg_BadArgument("Cursor", "argument 1", (clinic_state()->ConnectionType)->tp_name, PyTuple_GET_ITEM(args, 0));
+ goto exit;
+ }
+ connection = (pysqlite_Connection *)PyTuple_GET_ITEM(args, 0);
+ return_value = pysqlite_cursor_init_impl((pysqlite_Cursor *)self, connection);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_cursor_execute__doc__,
+"execute($self, sql, parameters=(), /)\n"
+"--\n"
+"\n"
+"Executes an SQL statement.");
+
+#define PYSQLITE_CURSOR_EXECUTE_METHODDEF \
+ {"execute", _PyCFunction_CAST(pysqlite_cursor_execute), METH_FASTCALL, pysqlite_cursor_execute__doc__},
+
+static PyObject *
+pysqlite_cursor_execute_impl(pysqlite_Cursor *self, PyObject *sql,
+ PyObject *parameters);
+
+static PyObject *
+pysqlite_cursor_execute(pysqlite_Cursor *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sql;
+ PyObject *parameters = NULL;
+
+ if (!_PyArg_CheckPositional("execute", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("execute", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ sql = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ parameters = args[1];
+skip_optional:
+ return_value = pysqlite_cursor_execute_impl(self, sql, parameters);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_cursor_executemany__doc__,
+"executemany($self, sql, seq_of_parameters, /)\n"
+"--\n"
+"\n"
+"Repeatedly executes an SQL statement.");
+
+#define PYSQLITE_CURSOR_EXECUTEMANY_METHODDEF \
+ {"executemany", _PyCFunction_CAST(pysqlite_cursor_executemany), METH_FASTCALL, pysqlite_cursor_executemany__doc__},
+
+static PyObject *
+pysqlite_cursor_executemany_impl(pysqlite_Cursor *self, PyObject *sql,
+ PyObject *seq_of_parameters);
+
+static PyObject *
+pysqlite_cursor_executemany(pysqlite_Cursor *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sql;
+ PyObject *seq_of_parameters;
+
+ if (!_PyArg_CheckPositional("executemany", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("executemany", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ sql = args[0];
+ seq_of_parameters = args[1];
+ return_value = pysqlite_cursor_executemany_impl(self, sql, seq_of_parameters);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_cursor_executescript__doc__,
+"executescript($self, sql_script, /)\n"
+"--\n"
+"\n"
+"Executes multiple SQL statements at once.");
+
+#define PYSQLITE_CURSOR_EXECUTESCRIPT_METHODDEF \
+ {"executescript", (PyCFunction)pysqlite_cursor_executescript, METH_O, pysqlite_cursor_executescript__doc__},
+
+static PyObject *
+pysqlite_cursor_executescript_impl(pysqlite_Cursor *self,
+ const char *sql_script);
+
+static PyObject *
+pysqlite_cursor_executescript(pysqlite_Cursor *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *sql_script;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("executescript", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t sql_script_length;
+ sql_script = PyUnicode_AsUTF8AndSize(arg, &sql_script_length);
+ if (sql_script == NULL) {
+ goto exit;
+ }
+ if (strlen(sql_script) != (size_t)sql_script_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = pysqlite_cursor_executescript_impl(self, sql_script);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_cursor_fetchone__doc__,
+"fetchone($self, /)\n"
+"--\n"
+"\n"
+"Fetches one row from the resultset.");
+
+#define PYSQLITE_CURSOR_FETCHONE_METHODDEF \
+ {"fetchone", (PyCFunction)pysqlite_cursor_fetchone, METH_NOARGS, pysqlite_cursor_fetchone__doc__},
+
+static PyObject *
+pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self);
+
+static PyObject *
+pysqlite_cursor_fetchone(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_cursor_fetchone_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_cursor_fetchmany__doc__,
+"fetchmany($self, /, size=1)\n"
+"--\n"
+"\n"
+"Fetches several rows from the resultset.\n"
+"\n"
+" size\n"
+" The default value is set by the Cursor.arraysize attribute.");
+
+#define PYSQLITE_CURSOR_FETCHMANY_METHODDEF \
+ {"fetchmany", _PyCFunction_CAST(pysqlite_cursor_fetchmany), METH_FASTCALL|METH_KEYWORDS, pysqlite_cursor_fetchmany__doc__},
+
+static PyObject *
+pysqlite_cursor_fetchmany_impl(pysqlite_Cursor *self, int maxrows);
+
+static PyObject *
+pysqlite_cursor_fetchmany(pysqlite_Cursor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(size), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"size", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fetchmany",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int maxrows = self->arraysize;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ maxrows = _PyLong_AsInt(args[0]);
+ if (maxrows == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = pysqlite_cursor_fetchmany_impl(self, maxrows);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_cursor_fetchall__doc__,
+"fetchall($self, /)\n"
+"--\n"
+"\n"
+"Fetches all rows from the resultset.");
+
+#define PYSQLITE_CURSOR_FETCHALL_METHODDEF \
+ {"fetchall", (PyCFunction)pysqlite_cursor_fetchall, METH_NOARGS, pysqlite_cursor_fetchall__doc__},
+
+static PyObject *
+pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self);
+
+static PyObject *
+pysqlite_cursor_fetchall(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_cursor_fetchall_impl(self);
+}
+
+PyDoc_STRVAR(pysqlite_cursor_setinputsizes__doc__,
+"setinputsizes($self, sizes, /)\n"
+"--\n"
+"\n"
+"Required by DB-API. Does nothing in sqlite3.");
+
+#define PYSQLITE_CURSOR_SETINPUTSIZES_METHODDEF \
+ {"setinputsizes", (PyCFunction)pysqlite_cursor_setinputsizes, METH_O, pysqlite_cursor_setinputsizes__doc__},
+
+PyDoc_STRVAR(pysqlite_cursor_setoutputsize__doc__,
+"setoutputsize($self, size, column=None, /)\n"
+"--\n"
+"\n"
+"Required by DB-API. Does nothing in sqlite3.");
+
+#define PYSQLITE_CURSOR_SETOUTPUTSIZE_METHODDEF \
+ {"setoutputsize", _PyCFunction_CAST(pysqlite_cursor_setoutputsize), METH_FASTCALL, pysqlite_cursor_setoutputsize__doc__},
+
+static PyObject *
+pysqlite_cursor_setoutputsize_impl(pysqlite_Cursor *self, PyObject *size,
+ PyObject *column);
+
+static PyObject *
+pysqlite_cursor_setoutputsize(pysqlite_Cursor *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *size;
+ PyObject *column = Py_None;
+
+ if (!_PyArg_CheckPositional("setoutputsize", nargs, 1, 2)) {
+ goto exit;
+ }
+ size = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ column = args[1];
+skip_optional:
+ return_value = pysqlite_cursor_setoutputsize_impl(self, size, column);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_cursor_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Closes the cursor.");
+
+#define PYSQLITE_CURSOR_CLOSE_METHODDEF \
+ {"close", (PyCFunction)pysqlite_cursor_close, METH_NOARGS, pysqlite_cursor_close__doc__},
+
+static PyObject *
+pysqlite_cursor_close_impl(pysqlite_Cursor *self);
+
+static PyObject *
+pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_cursor_close_impl(self);
+}
+/*[clinic end generated code: output=1f82e3c9791bb9a5 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_sqlite/clinic/module.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/module.c.h
new file mode 100644
index 00000000000..12f60835880
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/module.c.h
@@ -0,0 +1,214 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(pysqlite_complete_statement__doc__,
+"complete_statement($module, /, statement)\n"
+"--\n"
+"\n"
+"Checks if a string contains a complete SQL statement.");
+
+#define PYSQLITE_COMPLETE_STATEMENT_METHODDEF \
+ {"complete_statement", _PyCFunction_CAST(pysqlite_complete_statement), METH_FASTCALL|METH_KEYWORDS, pysqlite_complete_statement__doc__},
+
+static PyObject *
+pysqlite_complete_statement_impl(PyObject *module, const char *statement);
+
+static PyObject *
+pysqlite_complete_statement(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(statement), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"statement", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "complete_statement",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ const char *statement;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("complete_statement", "argument 'statement'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t statement_length;
+ statement = PyUnicode_AsUTF8AndSize(args[0], &statement_length);
+ if (statement == NULL) {
+ goto exit;
+ }
+ if (strlen(statement) != (size_t)statement_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = pysqlite_complete_statement_impl(module, statement);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_register_adapter__doc__,
+"register_adapter($module, type, adapter, /)\n"
+"--\n"
+"\n"
+"Register a function to adapt Python objects to SQLite values.");
+
+#define PYSQLITE_REGISTER_ADAPTER_METHODDEF \
+ {"register_adapter", _PyCFunction_CAST(pysqlite_register_adapter), METH_FASTCALL, pysqlite_register_adapter__doc__},
+
+static PyObject *
+pysqlite_register_adapter_impl(PyObject *module, PyTypeObject *type,
+ PyObject *caster);
+
+static PyObject *
+pysqlite_register_adapter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *type;
+ PyObject *caster;
+
+ if (!_PyArg_CheckPositional("register_adapter", nargs, 2, 2)) {
+ goto exit;
+ }
+ type = (PyTypeObject *)args[0];
+ caster = args[1];
+ return_value = pysqlite_register_adapter_impl(module, type, caster);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_register_converter__doc__,
+"register_converter($module, typename, converter, /)\n"
+"--\n"
+"\n"
+"Register a function to convert SQLite values to Python objects.");
+
+#define PYSQLITE_REGISTER_CONVERTER_METHODDEF \
+ {"register_converter", _PyCFunction_CAST(pysqlite_register_converter), METH_FASTCALL, pysqlite_register_converter__doc__},
+
+static PyObject *
+pysqlite_register_converter_impl(PyObject *module, PyObject *orig_name,
+ PyObject *callable);
+
+static PyObject *
+pysqlite_register_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *orig_name;
+ PyObject *callable;
+
+ if (!_PyArg_CheckPositional("register_converter", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("register_converter", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ orig_name = args[0];
+ callable = args[1];
+ return_value = pysqlite_register_converter_impl(module, orig_name, callable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_enable_callback_trace__doc__,
+"enable_callback_tracebacks($module, enable, /)\n"
+"--\n"
+"\n"
+"Enable or disable callback functions throwing errors to stderr.");
+
+#define PYSQLITE_ENABLE_CALLBACK_TRACE_METHODDEF \
+ {"enable_callback_tracebacks", (PyCFunction)pysqlite_enable_callback_trace, METH_O, pysqlite_enable_callback_trace__doc__},
+
+static PyObject *
+pysqlite_enable_callback_trace_impl(PyObject *module, int enable);
+
+static PyObject *
+pysqlite_enable_callback_trace(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int enable;
+
+ enable = _PyLong_AsInt(arg);
+ if (enable == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = pysqlite_enable_callback_trace_impl(module, enable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_adapt__doc__,
+"adapt($module, obj, proto=PrepareProtocolType, alt=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Adapt given object to given protocol.");
+
+#define PYSQLITE_ADAPT_METHODDEF \
+ {"adapt", _PyCFunction_CAST(pysqlite_adapt), METH_FASTCALL, pysqlite_adapt__doc__},
+
+static PyObject *
+pysqlite_adapt_impl(PyObject *module, PyObject *obj, PyObject *proto,
+ PyObject *alt);
+
+static PyObject *
+pysqlite_adapt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *obj;
+ PyObject *proto = (PyObject *)clinic_state()->PrepareProtocolType;
+ PyObject *alt = NULL;
+
+ if (!_PyArg_CheckPositional("adapt", nargs, 1, 3)) {
+ goto exit;
+ }
+ obj = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ proto = args[1];
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ alt = args[2];
+skip_optional:
+ return_value = pysqlite_adapt_impl(module, obj, proto, alt);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=39d38c6cfc455042 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_sqlite/clinic/row.c.h b/contrib/tools/python3/Modules/_sqlite/clinic/row.c.h
new file mode 100644
index 00000000000..89a48fd52da
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/clinic/row.c.h
@@ -0,0 +1,63 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+static PyObject *
+pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor,
+ PyObject *data);
+
+static PyObject *
+pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->RowType;
+ pysqlite_Cursor *cursor;
+ PyObject *data;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("Row", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("Row", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state()->CursorType)) {
+ _PyArg_BadArgument("Row", "argument 1", (clinic_state()->CursorType)->tp_name, PyTuple_GET_ITEM(args, 0));
+ goto exit;
+ }
+ cursor = (pysqlite_Cursor *)PyTuple_GET_ITEM(args, 0);
+ if (!PyTuple_Check(PyTuple_GET_ITEM(args, 1))) {
+ _PyArg_BadArgument("Row", "argument 2", "tuple", PyTuple_GET_ITEM(args, 1));
+ goto exit;
+ }
+ data = PyTuple_GET_ITEM(args, 1);
+ return_value = pysqlite_row_new_impl(type, cursor, data);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pysqlite_row_keys__doc__,
+"keys($self, /)\n"
+"--\n"
+"\n"
+"Returns the keys of the row.");
+
+#define PYSQLITE_ROW_KEYS_METHODDEF \
+ {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, pysqlite_row_keys__doc__},
+
+static PyObject *
+pysqlite_row_keys_impl(pysqlite_Row *self);
+
+static PyObject *
+pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored))
+{
+ return pysqlite_row_keys_impl(self);
+}
+/*[clinic end generated code: output=157b31ac3f6af1ba input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_sqlite/connection.c b/contrib/tools/python3/Modules/_sqlite/connection.c
new file mode 100644
index 00000000000..12e5c135aaf
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/connection.c
@@ -0,0 +1,2659 @@
+/* connection.c - the connection type
+ *
+ * Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "module.h"
+#include "structmember.h" // PyMemberDef
+#include "connection.h"
+#include "statement.h"
+#include "cursor.h"
+#include "blob.h"
+#include "prepare_protocol.h"
+#include "util.h"
+
+#include <stdbool.h>
+
+#if SQLITE_VERSION_NUMBER >= 3014000
+#define HAVE_TRACE_V2
+#endif
+
+#if SQLITE_VERSION_NUMBER >= 3025000
+#define HAVE_WINDOW_FUNCTIONS
+#endif
+
+static const char *
+get_isolation_level(const char *level)
+{
+ assert(level != NULL);
+ static const char *const allowed_levels[] = {
+ "",
+ "DEFERRED",
+ "IMMEDIATE",
+ "EXCLUSIVE",
+ NULL
+ };
+ for (int i = 0; allowed_levels[i] != NULL; i++) {
+ const char *candidate = allowed_levels[i];
+ if (sqlite3_stricmp(level, candidate) == 0) {
+ return candidate;
+ }
+ }
+ PyErr_SetString(PyExc_ValueError,
+ "isolation_level string must be '', 'DEFERRED', "
+ "'IMMEDIATE', or 'EXCLUSIVE'");
+ return NULL;
+}
+
+static int
+isolation_level_converter(PyObject *str_or_none, const char **result)
+{
+ if (Py_IsNone(str_or_none)) {
+ *result = NULL;
+ }
+ else if (PyUnicode_Check(str_or_none)) {
+ Py_ssize_t sz;
+ const char *str = PyUnicode_AsUTF8AndSize(str_or_none, &sz);
+ if (str == NULL) {
+ return 0;
+ }
+ if (strlen(str) != (size_t)sz) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ return 0;
+ }
+
+ const char *level = get_isolation_level(str);
+ if (level == NULL) {
+ return 0;
+ }
+ *result = level;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "isolation_level must be str or None");
+ return 0;
+ }
+ return 1;
+}
+
+static int
+autocommit_converter(PyObject *val, enum autocommit_mode *result)
+{
+ if (Py_IsTrue(val)) {
+ *result = AUTOCOMMIT_ENABLED;
+ return 1;
+ }
+ if (Py_IsFalse(val)) {
+ *result = AUTOCOMMIT_DISABLED;
+ return 1;
+ }
+ if (PyLong_Check(val) &&
+ PyLong_AsLong(val) == LEGACY_TRANSACTION_CONTROL)
+ {
+ *result = AUTOCOMMIT_LEGACY;
+ return 1;
+ }
+
+ PyErr_SetString(PyExc_ValueError,
+ "autocommit must be True, False, or "
+ "sqlite3.LEGACY_TRANSACTION_CONTROL");
+ return 0;
+}
+
+static int
+sqlite3_int64_converter(PyObject *obj, sqlite3_int64 *result)
+{
+ if (!PyLong_Check(obj)) {
+ PyErr_SetString(PyExc_TypeError, "expected 'int'");
+ return 0;
+ }
+ *result = _pysqlite_long_as_int64(obj);
+ if (PyErr_Occurred()) {
+ return 0;
+ }
+ return 1;
+}
+
+#define clinic_state() (pysqlite_get_state_by_type(Py_TYPE(self)))
+#include "clinic/connection.c.h"
+#undef clinic_state
+
+/*[clinic input]
+module _sqlite3
+class _sqlite3.Connection "pysqlite_Connection *" "clinic_state()->ConnectionType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=67369db2faf80891]*/
+
+static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self);
+static void free_callback_context(callback_context *ctx);
+static void set_callback_context(callback_context **ctx_pp,
+ callback_context *ctx);
+static int connection_close(pysqlite_Connection *self);
+PyObject *_pysqlite_query_execute(pysqlite_Cursor *, int, PyObject *, PyObject *);
+
+static PyObject *
+new_statement_cache(pysqlite_Connection *self, pysqlite_state *state,
+ int maxsize)
+{
+ PyObject *args[] = { NULL, PyLong_FromLong(maxsize), };
+ if (args[1] == NULL) {
+ return NULL;
+ }
+ PyObject *lru_cache = state->lru_cache;
+ size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ PyObject *inner = PyObject_Vectorcall(lru_cache, args + 1, nargsf, NULL);
+ Py_DECREF(args[1]);
+ if (inner == NULL) {
+ return NULL;
+ }
+
+ args[1] = (PyObject *)self; // Borrowed ref.
+ nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ PyObject *res = PyObject_Vectorcall(inner, args + 1, nargsf, NULL);
+ Py_DECREF(inner);
+ return res;
+}
+
+static inline int
+connection_exec_stmt(pysqlite_Connection *self, const char *sql)
+{
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ int len = (int)strlen(sql) + 1;
+ sqlite3_stmt *stmt;
+ rc = sqlite3_prepare_v2(self->db, sql, len, &stmt, NULL);
+ if (rc == SQLITE_OK) {
+ (void)sqlite3_step(stmt);
+ rc = sqlite3_finalize(stmt);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ (void)_pysqlite_seterror(self->state, self->db);
+ return -1;
+ }
+ return 0;
+}
+
+/*[python input]
+class IsolationLevel_converter(CConverter):
+ type = "const char *"
+ converter = "isolation_level_converter"
+
+class Autocommit_converter(CConverter):
+ type = "enum autocommit_mode"
+ converter = "autocommit_converter"
+
+class sqlite3_int64_converter(CConverter):
+ type = "sqlite3_int64"
+ converter = "sqlite3_int64_converter"
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=dff8760fb1eba6a1]*/
+
+// NB: This needs to be in sync with the sqlite3.connect docstring
+/*[clinic input]
+_sqlite3.Connection.__init__ as pysqlite_connection_init
+
+ database: object
+ timeout: double = 5.0
+ detect_types: int = 0
+ isolation_level: IsolationLevel = ""
+ check_same_thread: bool = True
+ factory: object(c_default='(PyObject*)clinic_state()->ConnectionType') = ConnectionType
+ cached_statements as cache_size: int = 128
+ uri: bool = False
+ *
+ autocommit: Autocommit(c_default='LEGACY_TRANSACTION_CONTROL') = sqlite3.LEGACY_TRANSACTION_CONTROL
+[clinic start generated code]*/
+
+static int
+pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database,
+ double timeout, int detect_types,
+ const char *isolation_level,
+ int check_same_thread, PyObject *factory,
+ int cache_size, int uri,
+ enum autocommit_mode autocommit)
+/*[clinic end generated code: output=cba057313ea7712f input=9b0ab6c12f674fa3]*/
+{
+ if (PySys_Audit("sqlite3.connect", "O", database) < 0) {
+ return -1;
+ }
+
+ PyObject *bytes;
+ if (!PyUnicode_FSConverter(database, &bytes)) {
+ return -1;
+ }
+
+ if (self->initialized) {
+ self->initialized = 0;
+
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_clear((PyObject *)self);
+ if (connection_close(self) < 0) {
+ return -1;
+ }
+ }
+
+ // Create and configure SQLite database object.
+ sqlite3 *db;
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_open_v2(PyBytes_AS_STRING(bytes), &db,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE |
+ (uri ? SQLITE_OPEN_URI : 0), NULL);
+ if (rc == SQLITE_OK) {
+ (void)sqlite3_busy_timeout(db, (int)(timeout*1000));
+ }
+ Py_END_ALLOW_THREADS
+
+ Py_DECREF(bytes);
+ if (db == NULL && rc == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ pysqlite_state *state = pysqlite_get_state_by_type(Py_TYPE(self));
+ if (rc != SQLITE_OK) {
+ _pysqlite_seterror(state, db);
+ goto error;
+ }
+
+ // Create LRU statement cache; returns a new reference.
+ PyObject *statement_cache = new_statement_cache(self, state, cache_size);
+ if (statement_cache == NULL) {
+ goto error;
+ }
+
+ /* Create lists of weak references to cursors and blobs */
+ PyObject *cursors = PyList_New(0);
+ if (cursors == NULL) {
+ Py_DECREF(statement_cache);
+ goto error;
+ }
+
+ PyObject *blobs = PyList_New(0);
+ if (blobs == NULL) {
+ Py_DECREF(statement_cache);
+ Py_DECREF(cursors);
+ goto error;
+ }
+
+ // Init connection state members.
+ self->db = db;
+ self->state = state;
+ self->detect_types = detect_types;
+ self->isolation_level = isolation_level;
+ self->autocommit = autocommit;
+ self->check_same_thread = check_same_thread;
+ self->thread_ident = PyThread_get_thread_ident();
+ self->statement_cache = statement_cache;
+ self->cursors = cursors;
+ self->blobs = blobs;
+ self->created_cursors = 0;
+ self->row_factory = Py_NewRef(Py_None);
+ self->text_factory = Py_NewRef(&PyUnicode_Type);
+ self->trace_ctx = NULL;
+ self->progress_ctx = NULL;
+ self->authorizer_ctx = NULL;
+
+ // Borrowed refs
+ self->Warning = state->Warning;
+ self->Error = state->Error;
+ self->InterfaceError = state->InterfaceError;
+ self->DatabaseError = state->DatabaseError;
+ self->DataError = state->DataError;
+ self->OperationalError = state->OperationalError;
+ self->IntegrityError = state->IntegrityError;
+ self->InternalError = state->InternalError;
+ self->ProgrammingError = state->ProgrammingError;
+ self->NotSupportedError = state->NotSupportedError;
+
+ if (PySys_Audit("sqlite3.connect/handle", "O", self) < 0) {
+ return -1; // Don't goto error; at this point, dealloc will clean up.
+ }
+
+ self->initialized = 1;
+
+ if (autocommit == AUTOCOMMIT_DISABLED) {
+ if (connection_exec_stmt(self, "BEGIN") < 0) {
+ return -1;
+ }
+ }
+ return 0;
+
+error:
+ // There are no statements or other SQLite objects attached to the
+ // database, so sqlite3_close() should always return SQLITE_OK.
+ rc = sqlite3_close(db);
+ assert(rc == SQLITE_OK);
+ return -1;
+}
+
+#define VISIT_CALLBACK_CONTEXT(ctx) \
+do { \
+ if (ctx) { \
+ Py_VISIT(ctx->callable); \
+ Py_VISIT(ctx->module); \
+ } \
+} while (0)
+
+static int
+connection_traverse(pysqlite_Connection *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->statement_cache);
+ Py_VISIT(self->cursors);
+ Py_VISIT(self->blobs);
+ Py_VISIT(self->row_factory);
+ Py_VISIT(self->text_factory);
+ VISIT_CALLBACK_CONTEXT(self->trace_ctx);
+ VISIT_CALLBACK_CONTEXT(self->progress_ctx);
+ VISIT_CALLBACK_CONTEXT(self->authorizer_ctx);
+#undef VISIT_CALLBACK_CONTEXT
+ return 0;
+}
+
+static inline void
+clear_callback_context(callback_context *ctx)
+{
+ if (ctx != NULL) {
+ Py_CLEAR(ctx->callable);
+ Py_CLEAR(ctx->module);
+ }
+}
+
+static int
+connection_clear(pysqlite_Connection *self)
+{
+ Py_CLEAR(self->statement_cache);
+ Py_CLEAR(self->cursors);
+ Py_CLEAR(self->blobs);
+ Py_CLEAR(self->row_factory);
+ Py_CLEAR(self->text_factory);
+ clear_callback_context(self->trace_ctx);
+ clear_callback_context(self->progress_ctx);
+ clear_callback_context(self->authorizer_ctx);
+ return 0;
+}
+
+static void
+free_callback_contexts(pysqlite_Connection *self)
+{
+ set_callback_context(&self->trace_ctx, NULL);
+ set_callback_context(&self->progress_ctx, NULL);
+ set_callback_context(&self->authorizer_ctx, NULL);
+}
+
+static void
+remove_callbacks(sqlite3 *db)
+{
+ assert(db != NULL);
+ /* None of these APIs can fail, as long as they are given a valid
+ * database pointer. */
+ int rc;
+#ifdef HAVE_TRACE_V2
+ rc = sqlite3_trace_v2(db, SQLITE_TRACE_STMT, 0, 0);
+ assert(rc == SQLITE_OK), (void)rc;
+#else
+ sqlite3_trace(db, 0, (void*)0);
+#endif
+
+ sqlite3_progress_handler(db, 0, 0, (void *)0);
+
+ rc = sqlite3_set_authorizer(db, NULL, NULL);
+ assert(rc == SQLITE_OK), (void)rc;
+}
+
+static int
+connection_close(pysqlite_Connection *self)
+{
+ if (self->db == NULL) {
+ return 0;
+ }
+
+ int rc = 0;
+ if (self->autocommit == AUTOCOMMIT_DISABLED &&
+ !sqlite3_get_autocommit(self->db))
+ {
+ if (connection_exec_stmt(self, "ROLLBACK") < 0) {
+ rc = -1;
+ }
+ }
+
+ sqlite3 *db = self->db;
+ self->db = NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* The v2 close call always returns SQLITE_OK if given a valid database
+ * pointer (which we do), so we can safely ignore the return value */
+ (void)sqlite3_close_v2(db);
+ Py_END_ALLOW_THREADS
+
+ free_callback_contexts(self);
+ return rc;
+}
+
+static void
+connection_finalize(PyObject *self)
+{
+ pysqlite_Connection *con = (pysqlite_Connection *)self;
+ PyObject *exc = PyErr_GetRaisedException();
+
+ /* If close is implicitly called as a result of interpreter
+ * tear-down, we must not call back into Python. */
+ PyInterpreterState *interp = PyInterpreterState_Get();
+ int teardown = _Py_IsInterpreterFinalizing(interp);
+ if (teardown && con->db) {
+ remove_callbacks(con->db);
+ }
+
+ /* Clean up if user has not called .close() explicitly. */
+ if (connection_close(con) < 0) {
+ if (teardown) {
+ PyErr_Clear();
+ }
+ else {
+ PyErr_WriteUnraisable((PyObject *)self);
+ }
+ }
+
+ PyErr_SetRaisedException(exc);
+}
+
+static void
+connection_dealloc(PyObject *self)
+{
+ if (PyObject_CallFinalizerFromDealloc(self) < 0) {
+ return;
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tp->tp_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+_sqlite3.Connection.cursor as pysqlite_connection_cursor
+
+ factory: object = NULL
+
+Return a cursor for the connection.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_cursor_impl(pysqlite_Connection *self, PyObject *factory)
+/*[clinic end generated code: output=562432a9e6af2aa1 input=4127345aa091b650]*/
+{
+ PyObject* cursor;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (factory == NULL) {
+ factory = (PyObject *)self->state->CursorType;
+ }
+
+ cursor = PyObject_CallOneArg(factory, (PyObject *)self);
+ if (cursor == NULL)
+ return NULL;
+ if (!PyObject_TypeCheck(cursor, self->state->CursorType)) {
+ PyErr_Format(PyExc_TypeError,
+ "factory must return a cursor, not %.100s",
+ Py_TYPE(cursor)->tp_name);
+ Py_DECREF(cursor);
+ return NULL;
+ }
+
+ _pysqlite_drop_unused_cursor_references(self);
+
+ if (cursor && self->row_factory != Py_None) {
+ Py_INCREF(self->row_factory);
+ Py_XSETREF(((pysqlite_Cursor *)cursor)->row_factory, self->row_factory);
+ }
+
+ return cursor;
+}
+
+/*[clinic input]
+_sqlite3.Connection.blobopen as blobopen
+
+ table: str
+ Table name.
+ column as col: str
+ Column name.
+ row: sqlite3_int64
+ Row index.
+ /
+ *
+ readonly: bool = False
+ Open the BLOB without write permissions.
+ name: str = "main"
+ Database name.
+
+Open and return a BLOB object.
+[clinic start generated code]*/
+
+static PyObject *
+blobopen_impl(pysqlite_Connection *self, const char *table, const char *col,
+ sqlite3_int64 row, int readonly, const char *name)
+/*[clinic end generated code: output=6a02d43efb885d1c input=23576bd1108d8774]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ int rc;
+ sqlite3_blob *blob;
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_blob_open(self->db, name, table, col, row, !readonly, &blob);
+ Py_END_ALLOW_THREADS
+
+ if (rc == SQLITE_MISUSE) {
+ PyErr_Format(self->state->InterfaceError, sqlite3_errstr(rc));
+ return NULL;
+ }
+ else if (rc != SQLITE_OK) {
+ _pysqlite_seterror(self->state, self->db);
+ return NULL;
+ }
+
+ pysqlite_Blob *obj = PyObject_GC_New(pysqlite_Blob, self->state->BlobType);
+ if (obj == NULL) {
+ goto error;
+ }
+
+ obj->connection = (pysqlite_Connection *)Py_NewRef(self);
+ obj->blob = blob;
+ obj->offset = 0;
+ obj->in_weakreflist = NULL;
+
+ PyObject_GC_Track(obj);
+
+ // Add our blob to connection blobs list
+ PyObject *weakref = PyWeakref_NewRef((PyObject *)obj, NULL);
+ if (weakref == NULL) {
+ goto error;
+ }
+ rc = PyList_Append(self->blobs, weakref);
+ Py_DECREF(weakref);
+ if (rc < 0) {
+ goto error;
+ }
+
+ return (PyObject *)obj;
+
+error:
+ Py_XDECREF(obj);
+ return NULL;
+}
+
+/*[clinic input]
+_sqlite3.Connection.close as pysqlite_connection_close
+
+Close the database connection.
+
+Any pending transaction is not committed implicitly.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_close_impl(pysqlite_Connection *self)
+/*[clinic end generated code: output=a546a0da212c9b97 input=b3ed5b74f6fefc06]*/
+{
+ if (!pysqlite_check_thread(self)) {
+ return NULL;
+ }
+
+ if (!self->initialized) {
+ PyTypeObject *tp = Py_TYPE(self);
+ pysqlite_state *state = pysqlite_get_state_by_type(tp);
+ PyErr_SetString(state->ProgrammingError,
+ "Base Connection.__init__ not called.");
+ return NULL;
+ }
+
+ pysqlite_close_all_blobs(self);
+ Py_CLEAR(self->statement_cache);
+ if (connection_close(self) < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*
+ * Checks if a connection object is usable (i. e. not closed).
+ *
+ * 0 => error; 1 => ok
+ */
+int pysqlite_check_connection(pysqlite_Connection* con)
+{
+ if (!con->initialized) {
+ pysqlite_state *state = pysqlite_get_state_by_type(Py_TYPE(con));
+ PyErr_SetString(state->ProgrammingError,
+ "Base Connection.__init__ not called.");
+ return 0;
+ }
+
+ if (!con->db) {
+ PyErr_SetString(con->state->ProgrammingError,
+ "Cannot operate on a closed database.");
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+/*[clinic input]
+_sqlite3.Connection.commit as pysqlite_connection_commit
+
+Commit any pending transaction to the database.
+
+If there is no open transaction, this method is a no-op.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_commit_impl(pysqlite_Connection *self)
+/*[clinic end generated code: output=3da45579e89407f2 input=c8793c97c3446065]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (self->autocommit == AUTOCOMMIT_LEGACY) {
+ if (!sqlite3_get_autocommit(self->db)) {
+ if (connection_exec_stmt(self, "COMMIT") < 0) {
+ return NULL;
+ }
+ }
+ }
+ else if (self->autocommit == AUTOCOMMIT_DISABLED) {
+ if (connection_exec_stmt(self, "COMMIT") < 0) {
+ return NULL;
+ }
+ if (connection_exec_stmt(self, "BEGIN") < 0) {
+ return NULL;
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Connection.rollback as pysqlite_connection_rollback
+
+Roll back to the start of any pending transaction.
+
+If there is no open transaction, this method is a no-op.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_rollback_impl(pysqlite_Connection *self)
+/*[clinic end generated code: output=b66fa0d43e7ef305 input=7f60a2f1076f16b3]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (self->autocommit == AUTOCOMMIT_LEGACY) {
+ if (!sqlite3_get_autocommit(self->db)) {
+ if (connection_exec_stmt(self, "ROLLBACK") < 0) {
+ return NULL;
+ }
+ }
+ }
+ else if (self->autocommit == AUTOCOMMIT_DISABLED) {
+ if (connection_exec_stmt(self, "ROLLBACK") < 0) {
+ return NULL;
+ }
+ if (connection_exec_stmt(self, "BEGIN") < 0) {
+ return NULL;
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+static int
+_pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
+{
+ if (py_val == Py_None) {
+ sqlite3_result_null(context);
+ } else if (PyLong_Check(py_val)) {
+ sqlite_int64 value = _pysqlite_long_as_int64(py_val);
+ if (value == -1 && PyErr_Occurred())
+ return -1;
+ sqlite3_result_int64(context, value);
+ } else if (PyFloat_Check(py_val)) {
+ double value = PyFloat_AsDouble(py_val);
+ if (value == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+ sqlite3_result_double(context, value);
+ } else if (PyUnicode_Check(py_val)) {
+ Py_ssize_t sz;
+ const char *str = PyUnicode_AsUTF8AndSize(py_val, &sz);
+ if (str == NULL) {
+ return -1;
+ }
+ if (sz > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "string is longer than INT_MAX bytes");
+ return -1;
+ }
+ sqlite3_result_text(context, str, (int)sz, SQLITE_TRANSIENT);
+ } else if (PyObject_CheckBuffer(py_val)) {
+ Py_buffer view;
+ if (PyObject_GetBuffer(py_val, &view, PyBUF_SIMPLE) != 0) {
+ return -1;
+ }
+ if (view.len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "BLOB longer than INT_MAX bytes");
+ PyBuffer_Release(&view);
+ return -1;
+ }
+ sqlite3_result_blob(context, view.buf, (int)view.len, SQLITE_TRANSIENT);
+ PyBuffer_Release(&view);
+ } else {
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ PyErr_Format(ctx->state->ProgrammingError,
+ "User-defined functions cannot return '%s' values to "
+ "SQLite",
+ Py_TYPE(py_val)->tp_name);
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+_pysqlite_build_py_params(sqlite3_context *context, int argc,
+ sqlite3_value **argv)
+{
+ PyObject* args;
+ int i;
+ sqlite3_value* cur_value;
+ PyObject* cur_py_value;
+
+ args = PyTuple_New(argc);
+ if (!args) {
+ return NULL;
+ }
+
+ for (i = 0; i < argc; i++) {
+ cur_value = argv[i];
+ switch (sqlite3_value_type(argv[i])) {
+ case SQLITE_INTEGER:
+ cur_py_value = PyLong_FromLongLong(sqlite3_value_int64(cur_value));
+ break;
+ case SQLITE_FLOAT:
+ cur_py_value = PyFloat_FromDouble(sqlite3_value_double(cur_value));
+ break;
+ case SQLITE_TEXT: {
+ sqlite3 *db = sqlite3_context_db_handle(context);
+ const char *text = (const char *)sqlite3_value_text(cur_value);
+
+ if (text == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ Py_ssize_t size = sqlite3_value_bytes(cur_value);
+ cur_py_value = PyUnicode_FromStringAndSize(text, size);
+ break;
+ }
+ case SQLITE_BLOB: {
+ sqlite3 *db = sqlite3_context_db_handle(context);
+ const void *blob = sqlite3_value_blob(cur_value);
+
+ if (blob == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ Py_ssize_t size = sqlite3_value_bytes(cur_value);
+ cur_py_value = PyBytes_FromStringAndSize(blob, size);
+ break;
+ }
+ case SQLITE_NULL:
+ default:
+ cur_py_value = Py_NewRef(Py_None);
+ }
+
+ if (!cur_py_value) {
+ goto error;
+ }
+
+ PyTuple_SET_ITEM(args, i, cur_py_value);
+ }
+
+ return args;
+
+error:
+ Py_DECREF(args);
+ return NULL;
+}
+
+static void
+print_or_clear_traceback(callback_context *ctx)
+{
+ assert(ctx != NULL);
+ assert(ctx->state != NULL);
+ if (ctx->state->enable_callback_tracebacks) {
+ PyErr_WriteUnraisable(ctx->callable);
+ }
+ else {
+ PyErr_Clear();
+ }
+}
+
+// Checks the Python exception and sets the appropriate SQLite error code.
+static void
+set_sqlite_error(sqlite3_context *context, const char *msg)
+{
+ assert(PyErr_Occurred());
+ if (PyErr_ExceptionMatches(PyExc_MemoryError)) {
+ sqlite3_result_error_nomem(context);
+ }
+ else if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ sqlite3_result_error_toobig(context);
+ }
+ else {
+ sqlite3_result_error(context, msg, -1);
+ }
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ print_or_clear_traceback(ctx);
+}
+
+static void
+func_callback(sqlite3_context *context, int argc, sqlite3_value **argv)
+{
+ PyGILState_STATE threadstate = PyGILState_Ensure();
+
+ PyObject* args;
+ PyObject* py_retval = NULL;
+ int ok;
+
+ args = _pysqlite_build_py_params(context, argc, argv);
+ if (args) {
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ assert(ctx != NULL);
+ py_retval = PyObject_CallObject(ctx->callable, args);
+ Py_DECREF(args);
+ }
+
+ ok = 0;
+ if (py_retval) {
+ ok = _pysqlite_set_result(context, py_retval) == 0;
+ Py_DECREF(py_retval);
+ }
+ if (!ok) {
+ set_sqlite_error(context, "user-defined function raised exception");
+ }
+
+ PyGILState_Release(threadstate);
+}
+
+static void
+step_callback(sqlite3_context *context, int argc, sqlite3_value **params)
+{
+ PyGILState_STATE threadstate = PyGILState_Ensure();
+
+ PyObject* args;
+ PyObject* function_result = NULL;
+ PyObject** aggregate_instance;
+ PyObject* stepmethod = NULL;
+
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ assert(ctx != NULL);
+
+ aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
+ if (*aggregate_instance == NULL) {
+ *aggregate_instance = PyObject_CallNoArgs(ctx->callable);
+ if (!*aggregate_instance) {
+ set_sqlite_error(context,
+ "user-defined aggregate's '__init__' method raised error");
+ goto error;
+ }
+ }
+
+ stepmethod = PyObject_GetAttr(*aggregate_instance, ctx->state->str_step);
+ if (!stepmethod) {
+ set_sqlite_error(context,
+ "user-defined aggregate's 'step' method not defined");
+ goto error;
+ }
+
+ args = _pysqlite_build_py_params(context, argc, params);
+ if (!args) {
+ goto error;
+ }
+
+ function_result = PyObject_CallObject(stepmethod, args);
+ Py_DECREF(args);
+
+ if (!function_result) {
+ set_sqlite_error(context,
+ "user-defined aggregate's 'step' method raised error");
+ }
+
+error:
+ Py_XDECREF(stepmethod);
+ Py_XDECREF(function_result);
+
+ PyGILState_Release(threadstate);
+}
+
+static void
+final_callback(sqlite3_context *context)
+{
+ PyGILState_STATE threadstate = PyGILState_Ensure();
+
+ PyObject* function_result;
+ PyObject** aggregate_instance;
+ int ok;
+
+ aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, 0);
+ if (aggregate_instance == NULL) {
+ /* No rows matched the query; the step handler was never called. */
+ goto error;
+ }
+ else if (!*aggregate_instance) {
+ /* this branch is executed if there was an exception in the aggregate's
+ * __init__ */
+
+ goto error;
+ }
+
+ // Keep the exception (if any) of the last call to step, value, or inverse
+ PyObject *exc = PyErr_GetRaisedException();
+
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ assert(ctx != NULL);
+ function_result = PyObject_CallMethodNoArgs(*aggregate_instance,
+ ctx->state->str_finalize);
+ Py_DECREF(*aggregate_instance);
+
+ ok = 0;
+ if (function_result) {
+ ok = _pysqlite_set_result(context, function_result) == 0;
+ Py_DECREF(function_result);
+ }
+ if (!ok) {
+ int attr_err = PyErr_ExceptionMatches(PyExc_AttributeError);
+ _PyErr_ChainExceptions1(exc);
+
+ /* Note: contrary to the step, value, and inverse callbacks, SQLite
+ * does _not_, as of SQLite 3.38.0, propagate errors to sqlite3_step()
+ * from the finalize callback. This implies that execute*() will not
+ * raise OperationalError, as it normally would. */
+ set_sqlite_error(context, attr_err
+ ? "user-defined aggregate's 'finalize' method not defined"
+ : "user-defined aggregate's 'finalize' method raised error");
+ }
+ else {
+ PyErr_SetRaisedException(exc);
+ }
+
+error:
+ PyGILState_Release(threadstate);
+}
+
+static void _pysqlite_drop_unused_cursor_references(pysqlite_Connection* self)
+{
+ PyObject* new_list;
+ PyObject* weakref;
+ int i;
+
+ /* we only need to do this once in a while */
+ if (self->created_cursors++ < 200) {
+ return;
+ }
+
+ self->created_cursors = 0;
+
+ new_list = PyList_New(0);
+ if (!new_list) {
+ return;
+ }
+
+ for (i = 0; i < PyList_Size(self->cursors); i++) {
+ weakref = PyList_GetItem(self->cursors, i);
+ if (PyWeakref_GetObject(weakref) != Py_None) {
+ if (PyList_Append(new_list, weakref) != 0) {
+ Py_DECREF(new_list);
+ return;
+ }
+ }
+ }
+
+ Py_SETREF(self->cursors, new_list);
+}
+
+/* Allocate a UDF/callback context structure. In order to ensure that the state
+ * pointer always outlives the callback context, we make sure it owns a
+ * reference to the module itself. create_callback_context() is always called
+ * from connection methods, so we use the defining class to fetch the module
+ * pointer.
+ */
+static callback_context *
+create_callback_context(PyTypeObject *cls, PyObject *callable)
+{
+ callback_context *ctx = PyMem_Malloc(sizeof(callback_context));
+ if (ctx != NULL) {
+ PyObject *module = PyType_GetModule(cls);
+ ctx->callable = Py_NewRef(callable);
+ ctx->module = Py_NewRef(module);
+ ctx->state = pysqlite_get_state(module);
+ }
+ return ctx;
+}
+
+static void
+free_callback_context(callback_context *ctx)
+{
+ assert(ctx != NULL);
+ Py_XDECREF(ctx->callable);
+ Py_XDECREF(ctx->module);
+ PyMem_Free(ctx);
+}
+
+static void
+set_callback_context(callback_context **ctx_pp, callback_context *ctx)
+{
+ assert(ctx_pp != NULL);
+ callback_context *tmp = *ctx_pp;
+ *ctx_pp = ctx;
+ if (tmp != NULL) {
+ free_callback_context(tmp);
+ }
+}
+
+static void
+destructor_callback(void *ctx)
+{
+ if (ctx != NULL) {
+ // This function may be called without the GIL held, so we need to
+ // ensure that we destroy 'ctx' with the GIL held.
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ free_callback_context((callback_context *)ctx);
+ PyGILState_Release(gstate);
+ }
+}
+
+/*[clinic input]
+_sqlite3.Connection.create_function as pysqlite_connection_create_function
+
+ cls: defining_class
+ /
+ name: str
+ narg: int
+ func: object
+ *
+ deterministic: bool = False
+
+Creates a new function.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_create_function_impl(pysqlite_Connection *self,
+ PyTypeObject *cls, const char *name,
+ int narg, PyObject *func,
+ int deterministic)
+/*[clinic end generated code: output=8a811529287ad240 input=b3e8e1d8ddaffbef]*/
+{
+ int rc;
+ int flags = SQLITE_UTF8;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (deterministic) {
+#if SQLITE_VERSION_NUMBER < 3008003
+ PyErr_SetString(self->NotSupportedError,
+ "deterministic=True requires SQLite 3.8.3 or higher");
+ return NULL;
+#else
+ if (sqlite3_libversion_number() < 3008003) {
+ PyErr_SetString(self->NotSupportedError,
+ "deterministic=True requires SQLite 3.8.3 or higher");
+ return NULL;
+ }
+ flags |= SQLITE_DETERMINISTIC;
+#endif
+ }
+ callback_context *ctx = create_callback_context(cls, func);
+ if (ctx == NULL) {
+ return NULL;
+ }
+ rc = sqlite3_create_function_v2(self->db, name, narg, flags, ctx,
+ func_callback,
+ NULL,
+ NULL,
+ &destructor_callback); // will decref func
+
+ if (rc != SQLITE_OK) {
+ /* Workaround for SQLite bug: no error code or string is available here */
+ PyErr_SetString(self->OperationalError, "Error creating function");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+#ifdef HAVE_WINDOW_FUNCTIONS
+/*
+ * Regarding the 'inverse' aggregate callback:
+ * This method is only required by window aggregate functions, not
+ * ordinary aggregate function implementations. It is invoked to remove
+ * a row from the current window. The function arguments, if any,
+ * correspond to the row being removed.
+ */
+static void
+inverse_callback(sqlite3_context *context, int argc, sqlite3_value **params)
+{
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ assert(ctx != NULL);
+
+ int size = sizeof(PyObject *);
+ PyObject **cls = (PyObject **)sqlite3_aggregate_context(context, size);
+ assert(cls != NULL);
+ assert(*cls != NULL);
+
+ PyObject *method = PyObject_GetAttr(*cls, ctx->state->str_inverse);
+ if (method == NULL) {
+ set_sqlite_error(context,
+ "user-defined aggregate's 'inverse' method not defined");
+ goto exit;
+ }
+
+ PyObject *args = _pysqlite_build_py_params(context, argc, params);
+ if (args == NULL) {
+ set_sqlite_error(context,
+ "unable to build arguments for user-defined aggregate's "
+ "'inverse' method");
+ goto exit;
+ }
+
+ PyObject *res = PyObject_CallObject(method, args);
+ Py_DECREF(args);
+ if (res == NULL) {
+ set_sqlite_error(context,
+ "user-defined aggregate's 'inverse' method raised error");
+ goto exit;
+ }
+ Py_DECREF(res);
+
+exit:
+ Py_XDECREF(method);
+ PyGILState_Release(gilstate);
+}
+
+/*
+ * Regarding the 'value' aggregate callback:
+ * This method is only required by window aggregate functions, not
+ * ordinary aggregate function implementations. It is invoked to return
+ * the current value of the aggregate.
+ */
+static void
+value_callback(sqlite3_context *context)
+{
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
+ callback_context *ctx = (callback_context *)sqlite3_user_data(context);
+ assert(ctx != NULL);
+
+ int size = sizeof(PyObject *);
+ PyObject **cls = (PyObject **)sqlite3_aggregate_context(context, size);
+ assert(cls != NULL);
+ assert(*cls != NULL);
+
+ PyObject *res = PyObject_CallMethodNoArgs(*cls, ctx->state->str_value);
+ if (res == NULL) {
+ int attr_err = PyErr_ExceptionMatches(PyExc_AttributeError);
+ set_sqlite_error(context, attr_err
+ ? "user-defined aggregate's 'value' method not defined"
+ : "user-defined aggregate's 'value' method raised error");
+ }
+ else {
+ int rc = _pysqlite_set_result(context, res);
+ Py_DECREF(res);
+ if (rc < 0) {
+ set_sqlite_error(context,
+ "unable to set result from user-defined aggregate's "
+ "'value' method");
+ }
+ }
+
+ PyGILState_Release(gilstate);
+}
+
+/*[clinic input]
+_sqlite3.Connection.create_window_function as create_window_function
+
+ cls: defining_class
+ name: str
+ The name of the SQL aggregate window function to be created or
+ redefined.
+ num_params: int
+ The number of arguments the step and inverse methods takes.
+ aggregate_class: object
+ A class with step(), finalize(), value(), and inverse() methods.
+ Set to None to clear the window function.
+ /
+
+Creates or redefines an aggregate window function. Non-standard.
+[clinic start generated code]*/
+
+static PyObject *
+create_window_function_impl(pysqlite_Connection *self, PyTypeObject *cls,
+ const char *name, int num_params,
+ PyObject *aggregate_class)
+/*[clinic end generated code: output=5332cd9464522235 input=46d57a54225b5228]*/
+{
+ if (sqlite3_libversion_number() < 3025000) {
+ PyErr_SetString(self->NotSupportedError,
+ "create_window_function() requires "
+ "SQLite 3.25.0 or higher");
+ return NULL;
+ }
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ int flags = SQLITE_UTF8;
+ int rc;
+ if (Py_IsNone(aggregate_class)) {
+ rc = sqlite3_create_window_function(self->db, name, num_params, flags,
+ 0, 0, 0, 0, 0, 0);
+ }
+ else {
+ callback_context *ctx = create_callback_context(cls, aggregate_class);
+ if (ctx == NULL) {
+ return NULL;
+ }
+ rc = sqlite3_create_window_function(self->db, name, num_params, flags,
+ ctx,
+ &step_callback,
+ &final_callback,
+ &value_callback,
+ &inverse_callback,
+ &destructor_callback);
+ }
+
+ if (rc != SQLITE_OK) {
+ // Errors are not set on the database connection, so we cannot
+ // use _pysqlite_seterror().
+ PyErr_SetString(self->ProgrammingError, sqlite3_errstr(rc));
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif
+
+/*[clinic input]
+_sqlite3.Connection.create_aggregate as pysqlite_connection_create_aggregate
+
+ cls: defining_class
+ /
+ name: str
+ n_arg: int
+ aggregate_class: object
+
+Creates a new aggregate.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_create_aggregate_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ const char *name, int n_arg,
+ PyObject *aggregate_class)
+/*[clinic end generated code: output=1b02d0f0aec7ff96 input=68a2a26366d4c686]*/
+{
+ int rc;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ callback_context *ctx = create_callback_context(cls, aggregate_class);
+ if (ctx == NULL) {
+ return NULL;
+ }
+ rc = sqlite3_create_function_v2(self->db, name, n_arg, SQLITE_UTF8, ctx,
+ 0,
+ &step_callback,
+ &final_callback,
+ &destructor_callback); // will decref func
+ if (rc != SQLITE_OK) {
+ /* Workaround for SQLite bug: no error code or string is available here */
+ PyErr_SetString(self->OperationalError, "Error creating aggregate");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static int
+authorizer_callback(void *ctx, int action, const char *arg1,
+ const char *arg2 , const char *dbname,
+ const char *access_attempt_source)
+{
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
+ PyObject *ret;
+ int rc = SQLITE_DENY;
+
+ assert(ctx != NULL);
+ PyObject *callable = ((callback_context *)ctx)->callable;
+ ret = PyObject_CallFunction(callable, "issss", action, arg1, arg2, dbname,
+ access_attempt_source);
+
+ if (ret == NULL) {
+ print_or_clear_traceback(ctx);
+ rc = SQLITE_DENY;
+ }
+ else {
+ if (PyLong_Check(ret)) {
+ rc = _PyLong_AsInt(ret);
+ if (rc == -1 && PyErr_Occurred()) {
+ print_or_clear_traceback(ctx);
+ rc = SQLITE_DENY;
+ }
+ }
+ else {
+ rc = SQLITE_DENY;
+ }
+ Py_DECREF(ret);
+ }
+
+ PyGILState_Release(gilstate);
+ return rc;
+}
+
+static int
+progress_callback(void *ctx)
+{
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
+ int rc;
+ PyObject *ret;
+
+ assert(ctx != NULL);
+ PyObject *callable = ((callback_context *)ctx)->callable;
+ ret = PyObject_CallNoArgs(callable);
+ if (!ret) {
+ /* abort query if error occurred */
+ rc = -1;
+ }
+ else {
+ rc = PyObject_IsTrue(ret);
+ Py_DECREF(ret);
+ }
+ if (rc < 0) {
+ print_or_clear_traceback(ctx);
+ }
+
+ PyGILState_Release(gilstate);
+ return rc;
+}
+
+#ifdef HAVE_TRACE_V2
+/*
+ * From https://sqlite.org/c3ref/trace_v2.html:
+ * The integer return value from the callback is currently ignored, though this
+ * may change in future releases. Callback implementations should return zero
+ * to ensure future compatibility.
+ */
+static int
+trace_callback(unsigned int type, void *ctx, void *stmt, void *sql)
+#else
+static void
+trace_callback(void *ctx, const char *sql)
+#endif
+{
+#ifdef HAVE_TRACE_V2
+ if (type != SQLITE_TRACE_STMT) {
+ return 0;
+ }
+#endif
+
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
+ assert(ctx != NULL);
+ pysqlite_state *state = ((callback_context *)ctx)->state;
+ assert(state != NULL);
+
+ PyObject *py_statement = NULL;
+#ifdef HAVE_TRACE_V2
+ const char *expanded_sql = sqlite3_expanded_sql((sqlite3_stmt *)stmt);
+ if (expanded_sql == NULL) {
+ sqlite3 *db = sqlite3_db_handle((sqlite3_stmt *)stmt);
+ if (sqlite3_errcode(db) == SQLITE_NOMEM) {
+ (void)PyErr_NoMemory();
+ goto exit;
+ }
+
+ PyErr_SetString(state->DataError,
+ "Expanded SQL string exceeds the maximum string length");
+ print_or_clear_traceback((callback_context *)ctx);
+
+ // Fall back to unexpanded sql
+ py_statement = PyUnicode_FromString((const char *)sql);
+ }
+ else {
+ py_statement = PyUnicode_FromString(expanded_sql);
+ sqlite3_free((void *)expanded_sql);
+ }
+#else
+ if (sql == NULL) {
+ PyErr_SetString(state->DataError,
+ "Expanded SQL string exceeds the maximum string length");
+ print_or_clear_traceback((callback_context *)ctx);
+ goto exit;
+ }
+ py_statement = PyUnicode_FromString(sql);
+#endif
+ if (py_statement) {
+ PyObject *callable = ((callback_context *)ctx)->callable;
+ PyObject *ret = PyObject_CallOneArg(callable, py_statement);
+ Py_DECREF(py_statement);
+ Py_XDECREF(ret);
+ }
+ if (PyErr_Occurred()) {
+ print_or_clear_traceback((callback_context *)ctx);
+ }
+
+exit:
+ PyGILState_Release(gilstate);
+#ifdef HAVE_TRACE_V2
+ return 0;
+#endif
+}
+
+/*[clinic input]
+_sqlite3.Connection.set_authorizer as pysqlite_connection_set_authorizer
+
+ cls: defining_class
+ /
+ authorizer_callback as callable: object
+
+Sets authorizer callback.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ PyObject *callable)
+/*[clinic end generated code: output=75fa60114fc971c3 input=605d32ba92dd3eca]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ int rc;
+ if (callable == Py_None) {
+ rc = sqlite3_set_authorizer(self->db, NULL, NULL);
+ set_callback_context(&self->authorizer_ctx, NULL);
+ }
+ else {
+ callback_context *ctx = create_callback_context(cls, callable);
+ if (ctx == NULL) {
+ return NULL;
+ }
+ rc = sqlite3_set_authorizer(self->db, authorizer_callback, ctx);
+ set_callback_context(&self->authorizer_ctx, ctx);
+ }
+ if (rc != SQLITE_OK) {
+ PyErr_SetString(self->OperationalError,
+ "Error setting authorizer callback");
+ set_callback_context(&self->authorizer_ctx, NULL);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Connection.set_progress_handler as pysqlite_connection_set_progress_handler
+
+ cls: defining_class
+ /
+ progress_handler as callable: object
+ n: int
+
+Sets progress handler callback.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ PyObject *callable, int n)
+/*[clinic end generated code: output=0739957fd8034a50 input=f7c1837984bd86db]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (callable == Py_None) {
+ /* None clears the progress handler previously set */
+ sqlite3_progress_handler(self->db, 0, 0, (void*)0);
+ set_callback_context(&self->progress_ctx, NULL);
+ }
+ else {
+ callback_context *ctx = create_callback_context(cls, callable);
+ if (ctx == NULL) {
+ return NULL;
+ }
+ sqlite3_progress_handler(self->db, n, progress_callback, ctx);
+ set_callback_context(&self->progress_ctx, ctx);
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Connection.set_trace_callback as pysqlite_connection_set_trace_callback
+
+ cls: defining_class
+ /
+ trace_callback as callable: object
+
+Sets a trace callback called for each SQL statement (passed as unicode).
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_set_trace_callback_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ PyObject *callable)
+/*[clinic end generated code: output=d91048c03bfcee05 input=351a94210c5f81bb]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (callable == Py_None) {
+ /*
+ * None clears the trace callback previously set
+ *
+ * Ref.
+ * - https://sqlite.org/c3ref/c_trace.html
+ * - https://sqlite.org/c3ref/trace_v2.html
+ */
+#ifdef HAVE_TRACE_V2
+ sqlite3_trace_v2(self->db, SQLITE_TRACE_STMT, 0, 0);
+#else
+ sqlite3_trace(self->db, 0, (void*)0);
+#endif
+ set_callback_context(&self->trace_ctx, NULL);
+ }
+ else {
+ callback_context *ctx = create_callback_context(cls, callable);
+ if (ctx == NULL) {
+ return NULL;
+ }
+#ifdef HAVE_TRACE_V2
+ sqlite3_trace_v2(self->db, SQLITE_TRACE_STMT, trace_callback, ctx);
+#else
+ sqlite3_trace(self->db, trace_callback, ctx);
+#endif
+ set_callback_context(&self->trace_ctx, ctx);
+ }
+
+ Py_RETURN_NONE;
+}
+
+#ifdef PY_SQLITE_ENABLE_LOAD_EXTENSION
+/*[clinic input]
+_sqlite3.Connection.enable_load_extension as pysqlite_connection_enable_load_extension
+
+ enable as onoff: bool
+ /
+
+Enable dynamic loading of SQLite extension modules.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_enable_load_extension_impl(pysqlite_Connection *self,
+ int onoff)
+/*[clinic end generated code: output=9cac37190d388baf input=2a1e87931486380f]*/
+{
+ int rc;
+
+ if (PySys_Audit("sqlite3.enable_load_extension",
+ "OO", self, onoff ? Py_True : Py_False) < 0) {
+ return NULL;
+ }
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ rc = sqlite3_enable_load_extension(self->db, onoff);
+
+ if (rc != SQLITE_OK) {
+ PyErr_SetString(self->OperationalError,
+ "Error enabling load extension");
+ return NULL;
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+/*[clinic input]
+_sqlite3.Connection.load_extension as pysqlite_connection_load_extension
+
+ name as extension_name: str
+ /
+ *
+ entrypoint: str(accept={str, NoneType}) = None
+
+Load SQLite extension module.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_load_extension_impl(pysqlite_Connection *self,
+ const char *extension_name,
+ const char *entrypoint)
+/*[clinic end generated code: output=7e61a7add9de0286 input=c36b14ea702e04f5]*/
+{
+ int rc;
+ char* errmsg;
+
+ if (PySys_Audit("sqlite3.load_extension", "Os", self, extension_name) < 0) {
+ return NULL;
+ }
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ rc = sqlite3_load_extension(self->db, extension_name, entrypoint, &errmsg);
+ if (rc != 0) {
+ PyErr_SetString(self->OperationalError, errmsg);
+ return NULL;
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+#endif
+
+int pysqlite_check_thread(pysqlite_Connection* self)
+{
+ if (self->check_same_thread) {
+ if (PyThread_get_thread_ident() != self->thread_ident) {
+ PyErr_Format(self->ProgrammingError,
+ "SQLite objects created in a thread can only be used in that same thread. "
+ "The object was created in thread id %lu and this is thread id %lu.",
+ self->thread_ident, PyThread_get_thread_ident());
+ return 0;
+ }
+
+ }
+ return 1;
+}
+
+static PyObject* pysqlite_connection_get_isolation_level(pysqlite_Connection* self, void* unused)
+{
+ if (!pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ if (self->isolation_level != NULL) {
+ return PyUnicode_FromString(self->isolation_level);
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject* pysqlite_connection_get_total_changes(pysqlite_Connection* self, void* unused)
+{
+ if (!pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ return PyLong_FromLong(sqlite3_total_changes(self->db));
+}
+
+static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* self, void* unused)
+{
+ if (!pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ if (!sqlite3_get_autocommit(self->db)) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+static int
+pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored))
+{
+ if (isolation_level == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ if (Py_IsNone(isolation_level)) {
+ self->isolation_level = NULL;
+
+ // Execute a COMMIT to re-enable autocommit mode
+ PyObject *res = pysqlite_connection_commit_impl(self);
+ if (res == NULL) {
+ return -1;
+ }
+ Py_DECREF(res);
+ return 0;
+ }
+ if (!isolation_level_converter(isolation_level, &self->isolation_level)) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+pysqlite_connection_call(pysqlite_Connection *self, PyObject *args,
+ PyObject *kwargs)
+{
+ PyObject* sql;
+ pysqlite_Statement* statement;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (!_PyArg_NoKeywords(MODULE_NAME ".Connection", kwargs))
+ return NULL;
+
+ if (!PyArg_ParseTuple(args, "U", &sql))
+ return NULL;
+
+ statement = pysqlite_statement_create(self, sql);
+ if (statement == NULL) {
+ return NULL;
+ }
+
+ return (PyObject*)statement;
+}
+
+/*[clinic input]
+_sqlite3.Connection.execute as pysqlite_connection_execute
+
+ sql: unicode
+ parameters: object = NULL
+ /
+
+Executes an SQL statement.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_execute_impl(pysqlite_Connection *self, PyObject *sql,
+ PyObject *parameters)
+/*[clinic end generated code: output=5be05ae01ee17ee4 input=27aa7792681ddba2]*/
+{
+ PyObject* result = 0;
+
+ PyObject *cursor = pysqlite_connection_cursor_impl(self, NULL);
+ if (!cursor) {
+ goto error;
+ }
+
+ result = _pysqlite_query_execute((pysqlite_Cursor *)cursor, 0, sql, parameters);
+ if (!result) {
+ Py_CLEAR(cursor);
+ }
+
+error:
+ Py_XDECREF(result);
+
+ return cursor;
+}
+
+/*[clinic input]
+_sqlite3.Connection.executemany as pysqlite_connection_executemany
+
+ sql: unicode
+ parameters: object
+ /
+
+Repeatedly executes an SQL statement.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_executemany_impl(pysqlite_Connection *self,
+ PyObject *sql, PyObject *parameters)
+/*[clinic end generated code: output=776cd2fd20bfe71f input=495be76551d525db]*/
+{
+ PyObject* result = 0;
+
+ PyObject *cursor = pysqlite_connection_cursor_impl(self, NULL);
+ if (!cursor) {
+ goto error;
+ }
+
+ result = _pysqlite_query_execute((pysqlite_Cursor *)cursor, 1, sql, parameters);
+ if (!result) {
+ Py_CLEAR(cursor);
+ }
+
+error:
+ Py_XDECREF(result);
+
+ return cursor;
+}
+
+/*[clinic input]
+_sqlite3.Connection.executescript as pysqlite_connection_executescript
+
+ sql_script as script_obj: object
+ /
+
+Executes multiple SQL statements at once.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_executescript(pysqlite_Connection *self,
+ PyObject *script_obj)
+/*[clinic end generated code: output=4c4f9d77aa0ae37d input=f6e5f1ccfa313db4]*/
+{
+ PyObject* result = 0;
+
+ PyObject *cursor = pysqlite_connection_cursor_impl(self, NULL);
+ if (!cursor) {
+ goto error;
+ }
+
+ PyObject *meth = self->state->str_executescript; // borrowed ref.
+ result = PyObject_CallMethodObjArgs(cursor, meth, script_obj, NULL);
+ if (!result) {
+ Py_CLEAR(cursor);
+ }
+
+error:
+ Py_XDECREF(result);
+
+ return cursor;
+}
+
+/* ------------------------- COLLATION CODE ------------------------ */
+
+static int
+collation_callback(void *context, int text1_length, const void *text1_data,
+ int text2_length, const void *text2_data)
+{
+ PyGILState_STATE gilstate = PyGILState_Ensure();
+
+ PyObject* string1 = 0;
+ PyObject* string2 = 0;
+ PyObject* retval = NULL;
+ long longval;
+ int result = 0;
+
+ /* This callback may be executed multiple times per sqlite3_step(). Bail if
+ * the previous call failed */
+ if (PyErr_Occurred()) {
+ goto finally;
+ }
+
+ string1 = PyUnicode_FromStringAndSize((const char*)text1_data, text1_length);
+ if (string1 == NULL) {
+ goto finally;
+ }
+ string2 = PyUnicode_FromStringAndSize((const char*)text2_data, text2_length);
+ if (string2 == NULL) {
+ goto finally;
+ }
+
+ callback_context *ctx = (callback_context *)context;
+ assert(ctx != NULL);
+ PyObject *args[] = { NULL, string1, string2 }; // Borrowed refs.
+ size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ retval = PyObject_Vectorcall(ctx->callable, args + 1, nargsf, NULL);
+ if (retval == NULL) {
+ /* execution failed */
+ goto finally;
+ }
+
+ longval = PyLong_AsLongAndOverflow(retval, &result);
+ if (longval == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ result = 0;
+ }
+ else if (!result) {
+ if (longval > 0)
+ result = 1;
+ else if (longval < 0)
+ result = -1;
+ }
+
+finally:
+ Py_XDECREF(string1);
+ Py_XDECREF(string2);
+ Py_XDECREF(retval);
+ PyGILState_Release(gilstate);
+ return result;
+}
+
+/*[clinic input]
+_sqlite3.Connection.interrupt as pysqlite_connection_interrupt
+
+Abort any pending database operation.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_interrupt_impl(pysqlite_Connection *self)
+/*[clinic end generated code: output=f193204bc9e70b47 input=75ad03ade7012859]*/
+{
+ PyObject* retval = NULL;
+
+ if (!pysqlite_check_connection(self)) {
+ goto finally;
+ }
+
+ sqlite3_interrupt(self->db);
+
+ retval = Py_NewRef(Py_None);
+
+finally:
+ return retval;
+}
+
+/* Function author: Paul Kippes <[email protected]>
+ * Class method of Connection to call the Python function _iterdump
+ * of the sqlite3 module.
+ */
+/*[clinic input]
+_sqlite3.Connection.iterdump as pysqlite_connection_iterdump
+
+Returns iterator to the dump of the database in an SQL text format.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_iterdump_impl(pysqlite_Connection *self)
+/*[clinic end generated code: output=586997aaf9808768 input=1911ca756066da89]*/
+{
+ if (!pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ PyObject *iterdump = _PyImport_GetModuleAttrString(MODULE_NAME ".dump", "_iterdump");
+ if (!iterdump) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(self->OperationalError,
+ "Failed to obtain _iterdump() reference");
+ }
+ return NULL;
+ }
+
+ PyObject *retval = PyObject_CallOneArg(iterdump, (PyObject *)self);
+ Py_DECREF(iterdump);
+ return retval;
+}
+
+/*[clinic input]
+_sqlite3.Connection.backup as pysqlite_connection_backup
+
+ target: object(type='pysqlite_Connection *', subclass_of='clinic_state()->ConnectionType')
+ *
+ pages: int = -1
+ progress: object = None
+ name: str = "main"
+ sleep: double = 0.250
+
+Makes a backup of the database.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_backup_impl(pysqlite_Connection *self,
+ pysqlite_Connection *target, int pages,
+ PyObject *progress, const char *name,
+ double sleep)
+/*[clinic end generated code: output=306a3e6a38c36334 input=c6519d0f59d0fd7f]*/
+{
+ int rc;
+ int sleep_ms = (int)(sleep * 1000.0);
+ sqlite3 *bck_conn;
+ sqlite3_backup *bck_handle;
+
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ if (!pysqlite_check_connection(target)) {
+ return NULL;
+ }
+
+ if (target == self) {
+ PyErr_SetString(PyExc_ValueError, "target cannot be the same connection instance");
+ return NULL;
+ }
+
+#if SQLITE_VERSION_NUMBER < 3008008
+ /* Since 3.8.8 this is already done, per commit
+ https://www.sqlite.org/src/info/169b5505498c0a7e */
+ if (!sqlite3_get_autocommit(target->db)) {
+ PyErr_SetString(self->OperationalError, "target is in transaction");
+ return NULL;
+ }
+#endif
+
+ if (progress != Py_None && !PyCallable_Check(progress)) {
+ PyErr_SetString(PyExc_TypeError, "progress argument must be a callable");
+ return NULL;
+ }
+
+ if (pages == 0) {
+ pages = -1;
+ }
+
+ bck_conn = target->db;
+
+ Py_BEGIN_ALLOW_THREADS
+ bck_handle = sqlite3_backup_init(bck_conn, "main", self->db, name);
+ Py_END_ALLOW_THREADS
+
+ if (bck_handle == NULL) {
+ _pysqlite_seterror(self->state, bck_conn);
+ return NULL;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_backup_step(bck_handle, pages);
+ Py_END_ALLOW_THREADS
+
+ if (progress != Py_None) {
+ int remaining = sqlite3_backup_remaining(bck_handle);
+ int pagecount = sqlite3_backup_pagecount(bck_handle);
+ PyObject *res = PyObject_CallFunction(progress, "iii", rc,
+ remaining, pagecount);
+ if (res == NULL) {
+ /* Callback failed: abort backup and bail. */
+ Py_BEGIN_ALLOW_THREADS
+ sqlite3_backup_finish(bck_handle);
+ Py_END_ALLOW_THREADS
+ return NULL;
+ }
+ Py_DECREF(res);
+ }
+
+ /* Sleep for a while if there are still further pages to copy and
+ the engine could not make any progress */
+ if (rc == SQLITE_BUSY || rc == SQLITE_LOCKED) {
+ Py_BEGIN_ALLOW_THREADS
+ sqlite3_sleep(sleep_ms);
+ Py_END_ALLOW_THREADS
+ }
+ } while (rc == SQLITE_OK || rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_backup_finish(bck_handle);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ _pysqlite_seterror(self->state, bck_conn);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Connection.create_collation as pysqlite_connection_create_collation
+
+ cls: defining_class
+ name: str
+ callback as callable: object
+ /
+
+Creates a collation function.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
+ PyTypeObject *cls,
+ const char *name,
+ PyObject *callable)
+/*[clinic end generated code: output=32d339e97869c378 input=f67ecd2e31e61ad3]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ callback_context *ctx = NULL;
+ int rc;
+ int flags = SQLITE_UTF8;
+ if (callable == Py_None) {
+ rc = sqlite3_create_collation_v2(self->db, name, flags,
+ NULL, NULL, NULL);
+ }
+ else {
+ if (!PyCallable_Check(callable)) {
+ PyErr_SetString(PyExc_TypeError, "parameter must be callable");
+ return NULL;
+ }
+ ctx = create_callback_context(cls, callable);
+ if (ctx == NULL) {
+ return NULL;
+ }
+ rc = sqlite3_create_collation_v2(self->db, name, flags, ctx,
+ &collation_callback,
+ &destructor_callback);
+ }
+
+ if (rc != SQLITE_OK) {
+ /* Unlike other sqlite3_* functions, the destructor callback is _not_
+ * called if sqlite3_create_collation_v2() fails, so we have to free
+ * the context before returning.
+ */
+ if (callable != Py_None) {
+ free_callback_context(ctx);
+ }
+ _pysqlite_seterror(self->state, self->db);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+#ifdef PY_SQLITE_HAVE_SERIALIZE
+/*[clinic input]
+_sqlite3.Connection.serialize as serialize
+
+ *
+ name: str = "main"
+ Which database to serialize.
+
+Serialize a database into a byte string.
+
+For an ordinary on-disk database file, the serialization is just a copy of the
+disk file. For an in-memory database or a "temp" database, the serialization is
+the same sequence of bytes which would be written to disk if that database
+were backed up to disk.
+[clinic start generated code]*/
+
+static PyObject *
+serialize_impl(pysqlite_Connection *self, const char *name)
+/*[clinic end generated code: output=97342b0e55239dd3 input=d2eb5194a65abe2b]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ /* If SQLite has a contiguous memory representation of the database, we can
+ * avoid memory allocations, so we try with the no-copy flag first.
+ */
+ sqlite3_int64 size;
+ unsigned int flags = SQLITE_SERIALIZE_NOCOPY;
+ const char *data;
+
+ Py_BEGIN_ALLOW_THREADS
+ data = (const char *)sqlite3_serialize(self->db, name, &size, flags);
+ if (data == NULL) {
+ flags &= ~SQLITE_SERIALIZE_NOCOPY;
+ data = (const char *)sqlite3_serialize(self->db, name, &size, flags);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (data == NULL) {
+ PyErr_Format(self->OperationalError, "unable to serialize '%s'",
+ name);
+ return NULL;
+ }
+ PyObject *res = PyBytes_FromStringAndSize(data, (Py_ssize_t)size);
+ if (!(flags & SQLITE_SERIALIZE_NOCOPY)) {
+ sqlite3_free((void *)data);
+ }
+ return res;
+}
+
+/*[clinic input]
+_sqlite3.Connection.deserialize as deserialize
+
+ data: Py_buffer(accept={buffer, str})
+ The serialized database content.
+ /
+ *
+ name: str = "main"
+ Which database to reopen with the deserialization.
+
+Load a serialized database.
+
+The deserialize interface causes the database connection to disconnect from the
+target database, and then reopen it as an in-memory database based on the given
+serialized data.
+
+The deserialize interface will fail with SQLITE_BUSY if the database is
+currently in a read transaction or is involved in a backup operation.
+[clinic start generated code]*/
+
+static PyObject *
+deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
+ const char *name)
+/*[clinic end generated code: output=e394c798b98bad89 input=1be4ca1faacf28f2]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ /* Transfer ownership of the buffer to SQLite:
+ * - Move buffer from Py to SQLite
+ * - Tell SQLite to free buffer memory
+ * - Tell SQLite that it is permitted to grow the resulting database
+ *
+ * Make sure we don't overflow sqlite3_deserialize(); it accepts a signed
+ * 64-bit int as its data size argument.
+ *
+ * We can safely use sqlite3_malloc64 here, since it was introduced before
+ * the serialize APIs.
+ */
+ if (data->len > 9223372036854775807) { // (1 << 63) - 1
+ PyErr_SetString(PyExc_OverflowError, "'data' is too large");
+ return NULL;
+ }
+
+ sqlite3_int64 size = (sqlite3_int64)data->len;
+ unsigned char *buf = sqlite3_malloc64(size);
+ if (buf == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ const unsigned int flags = SQLITE_DESERIALIZE_FREEONCLOSE |
+ SQLITE_DESERIALIZE_RESIZEABLE;
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ (void)memcpy(buf, data->buf, data->len);
+ rc = sqlite3_deserialize(self->db, name, buf, size, size, flags);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ (void)_pysqlite_seterror(self->state, self->db);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif // PY_SQLITE_HAVE_SERIALIZE
+
+
+/*[clinic input]
+_sqlite3.Connection.__enter__ as pysqlite_connection_enter
+
+Called when the connection is used as a context manager.
+
+Returns itself as a convenience to the caller.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_enter_impl(pysqlite_Connection *self)
+/*[clinic end generated code: output=457b09726d3e9dcd input=127d7a4f17e86d8f]*/
+{
+ if (!pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ return Py_NewRef((PyObject *)self);
+}
+
+/*[clinic input]
+_sqlite3.Connection.__exit__ as pysqlite_connection_exit
+
+ type as exc_type: object
+ value as exc_value: object
+ traceback as exc_tb: object
+ /
+
+Called when the connection is used as a context manager.
+
+If there was any exception, a rollback takes place; otherwise we commit.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
+ PyObject *exc_value, PyObject *exc_tb)
+/*[clinic end generated code: output=0705200e9321202a input=bd66f1532c9c54a7]*/
+{
+ int commit = 0;
+ PyObject* result;
+
+ if (exc_type == Py_None && exc_value == Py_None && exc_tb == Py_None) {
+ commit = 1;
+ result = pysqlite_connection_commit_impl(self);
+ }
+ else {
+ result = pysqlite_connection_rollback_impl(self);
+ }
+
+ if (result == NULL) {
+ if (commit) {
+ /* Commit failed; try to rollback in order to unlock the database.
+ * If rollback also fails, chain the exceptions. */
+ PyObject *exc = PyErr_GetRaisedException();
+ result = pysqlite_connection_rollback_impl(self);
+ if (result == NULL) {
+ _PyErr_ChainExceptions1(exc);
+ }
+ else {
+ Py_DECREF(result);
+ PyErr_SetRaisedException(exc);
+ }
+ }
+ return NULL;
+ }
+ Py_DECREF(result);
+
+ Py_RETURN_FALSE;
+}
+
+/*[clinic input]
+_sqlite3.Connection.setlimit as setlimit
+
+ category: int
+ The limit category to be set.
+ limit: int
+ The new limit. If the new limit is a negative number, the limit is
+ unchanged.
+ /
+
+Set connection run-time limits.
+
+Attempts to increase a limit above its hard upper bound are silently truncated
+to the hard upper bound. Regardless of whether or not the limit was changed,
+the prior value of the limit is returned.
+[clinic start generated code]*/
+
+static PyObject *
+setlimit_impl(pysqlite_Connection *self, int category, int limit)
+/*[clinic end generated code: output=0d208213f8d68ccd input=9bd469537e195635]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+
+ int old_limit = sqlite3_limit(self->db, category, limit);
+ if (old_limit < 0) {
+ PyErr_SetString(self->ProgrammingError, "'category' is out of bounds");
+ return NULL;
+ }
+ return PyLong_FromLong(old_limit);
+}
+
+/*[clinic input]
+_sqlite3.Connection.getlimit as getlimit
+
+ category: int
+ The limit category to be queried.
+ /
+
+Get connection run-time limits.
+[clinic start generated code]*/
+
+static PyObject *
+getlimit_impl(pysqlite_Connection *self, int category)
+/*[clinic end generated code: output=7c3f5d11f24cecb1 input=61e0849fb4fb058f]*/
+{
+ return setlimit_impl(self, category, -1);
+}
+
+static inline bool
+is_int_config(const int op)
+{
+ switch (op) {
+ case SQLITE_DBCONFIG_ENABLE_FKEY:
+ case SQLITE_DBCONFIG_ENABLE_TRIGGER:
+#if SQLITE_VERSION_NUMBER >= 3012002
+ case SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3013000
+ case SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3016000
+ case SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3020000
+ case SQLITE_DBCONFIG_ENABLE_QPSG:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3022000
+ case SQLITE_DBCONFIG_TRIGGER_EQP:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3024000
+ case SQLITE_DBCONFIG_RESET_DATABASE:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3026000
+ case SQLITE_DBCONFIG_DEFENSIVE:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3028000
+ case SQLITE_DBCONFIG_WRITABLE_SCHEMA:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3029000
+ case SQLITE_DBCONFIG_DQS_DDL:
+ case SQLITE_DBCONFIG_DQS_DML:
+ case SQLITE_DBCONFIG_LEGACY_ALTER_TABLE:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3030000
+ case SQLITE_DBCONFIG_ENABLE_VIEW:
+#endif
+#if SQLITE_VERSION_NUMBER >= 3031000
+ case SQLITE_DBCONFIG_LEGACY_FILE_FORMAT:
+ case SQLITE_DBCONFIG_TRUSTED_SCHEMA:
+#endif
+ return true;
+ default:
+ return false;
+ }
+}
+
+/*[clinic input]
+_sqlite3.Connection.setconfig as setconfig
+
+ op: int
+ The configuration verb; one of the sqlite3.SQLITE_DBCONFIG codes.
+ enable: bool = True
+ /
+
+Set a boolean connection configuration option.
+[clinic start generated code]*/
+
+static PyObject *
+setconfig_impl(pysqlite_Connection *self, int op, int enable)
+/*[clinic end generated code: output=c60b13e618aff873 input=a10f1539c2d7da6b]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ if (!is_int_config(op)) {
+ return PyErr_Format(PyExc_ValueError, "unknown config 'op': %d", op);
+ }
+
+ int actual;
+ int rc = sqlite3_db_config(self->db, op, enable, &actual);
+ if (rc != SQLITE_OK) {
+ (void)_pysqlite_seterror(self->state, self->db);
+ return NULL;
+ }
+ if (enable != actual) {
+ PyErr_SetString(self->state->OperationalError, "Unable to set config");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Connection.getconfig as getconfig -> bool
+
+ op: int
+ The configuration verb; one of the sqlite3.SQLITE_DBCONFIG codes.
+ /
+
+Query a boolean connection configuration option.
+[clinic start generated code]*/
+
+static int
+getconfig_impl(pysqlite_Connection *self, int op)
+/*[clinic end generated code: output=25ac05044c7b78a3 input=b0526d7e432e3f2f]*/
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return -1;
+ }
+ if (!is_int_config(op)) {
+ PyErr_Format(PyExc_ValueError, "unknown config 'op': %d", op);
+ return -1;
+ }
+
+ int current;
+ int rc = sqlite3_db_config(self->db, op, -1, &current);
+ if (rc != SQLITE_OK) {
+ (void)_pysqlite_seterror(self->state, self->db);
+ return -1;
+ }
+ return current;
+}
+
+static PyObject *
+get_autocommit(pysqlite_Connection *self, void *Py_UNUSED(ctx))
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return NULL;
+ }
+ if (self->autocommit == AUTOCOMMIT_ENABLED) {
+ Py_RETURN_TRUE;
+ }
+ if (self->autocommit == AUTOCOMMIT_DISABLED) {
+ Py_RETURN_FALSE;
+ }
+ return PyLong_FromLong(LEGACY_TRANSACTION_CONTROL);
+}
+
+static int
+set_autocommit(pysqlite_Connection *self, PyObject *val, void *Py_UNUSED(ctx))
+{
+ if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
+ return -1;
+ }
+ if (!autocommit_converter(val, &self->autocommit)) {
+ return -1;
+ }
+ if (self->autocommit == AUTOCOMMIT_ENABLED) {
+ if (!sqlite3_get_autocommit(self->db)) {
+ if (connection_exec_stmt(self, "COMMIT") < 0) {
+ return -1;
+ }
+ }
+ }
+ else if (self->autocommit == AUTOCOMMIT_DISABLED) {
+ if (sqlite3_get_autocommit(self->db)) {
+ if (connection_exec_stmt(self, "BEGIN") < 0) {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
+
+
+static const char connection_doc[] =
+PyDoc_STR("SQLite database connection object.");
+
+static PyGetSetDef connection_getset[] = {
+ {"isolation_level", (getter)pysqlite_connection_get_isolation_level, (setter)pysqlite_connection_set_isolation_level},
+ {"total_changes", (getter)pysqlite_connection_get_total_changes, (setter)0},
+ {"in_transaction", (getter)pysqlite_connection_get_in_transaction, (setter)0},
+ {"autocommit", (getter)get_autocommit, (setter)set_autocommit},
+ {NULL}
+};
+
+static PyMethodDef connection_methods[] = {
+ PYSQLITE_CONNECTION_BACKUP_METHODDEF
+ PYSQLITE_CONNECTION_CLOSE_METHODDEF
+ PYSQLITE_CONNECTION_COMMIT_METHODDEF
+ PYSQLITE_CONNECTION_CREATE_AGGREGATE_METHODDEF
+ PYSQLITE_CONNECTION_CREATE_COLLATION_METHODDEF
+ PYSQLITE_CONNECTION_CREATE_FUNCTION_METHODDEF
+ PYSQLITE_CONNECTION_CURSOR_METHODDEF
+ PYSQLITE_CONNECTION_ENABLE_LOAD_EXTENSION_METHODDEF
+ PYSQLITE_CONNECTION_ENTER_METHODDEF
+ PYSQLITE_CONNECTION_EXECUTEMANY_METHODDEF
+ PYSQLITE_CONNECTION_EXECUTESCRIPT_METHODDEF
+ PYSQLITE_CONNECTION_EXECUTE_METHODDEF
+ PYSQLITE_CONNECTION_EXIT_METHODDEF
+ PYSQLITE_CONNECTION_INTERRUPT_METHODDEF
+ PYSQLITE_CONNECTION_ITERDUMP_METHODDEF
+ PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
+ PYSQLITE_CONNECTION_ROLLBACK_METHODDEF
+ PYSQLITE_CONNECTION_SET_AUTHORIZER_METHODDEF
+ PYSQLITE_CONNECTION_SET_PROGRESS_HANDLER_METHODDEF
+ PYSQLITE_CONNECTION_SET_TRACE_CALLBACK_METHODDEF
+ SETLIMIT_METHODDEF
+ GETLIMIT_METHODDEF
+ SERIALIZE_METHODDEF
+ DESERIALIZE_METHODDEF
+ CREATE_WINDOW_FUNCTION_METHODDEF
+ BLOBOPEN_METHODDEF
+ SETCONFIG_METHODDEF
+ GETCONFIG_METHODDEF
+ {NULL, NULL}
+};
+
+static struct PyMemberDef connection_members[] =
+{
+ {"Warning", T_OBJECT, offsetof(pysqlite_Connection, Warning), READONLY},
+ {"Error", T_OBJECT, offsetof(pysqlite_Connection, Error), READONLY},
+ {"InterfaceError", T_OBJECT, offsetof(pysqlite_Connection, InterfaceError), READONLY},
+ {"DatabaseError", T_OBJECT, offsetof(pysqlite_Connection, DatabaseError), READONLY},
+ {"DataError", T_OBJECT, offsetof(pysqlite_Connection, DataError), READONLY},
+ {"OperationalError", T_OBJECT, offsetof(pysqlite_Connection, OperationalError), READONLY},
+ {"IntegrityError", T_OBJECT, offsetof(pysqlite_Connection, IntegrityError), READONLY},
+ {"InternalError", T_OBJECT, offsetof(pysqlite_Connection, InternalError), READONLY},
+ {"ProgrammingError", T_OBJECT, offsetof(pysqlite_Connection, ProgrammingError), READONLY},
+ {"NotSupportedError", T_OBJECT, offsetof(pysqlite_Connection, NotSupportedError), READONLY},
+ {"row_factory", T_OBJECT, offsetof(pysqlite_Connection, row_factory)},
+ {"text_factory", T_OBJECT, offsetof(pysqlite_Connection, text_factory)},
+ {NULL}
+};
+
+static PyType_Slot connection_slots[] = {
+ {Py_tp_finalize, connection_finalize},
+ {Py_tp_dealloc, connection_dealloc},
+ {Py_tp_doc, (void *)connection_doc},
+ {Py_tp_methods, connection_methods},
+ {Py_tp_members, connection_members},
+ {Py_tp_getset, connection_getset},
+ {Py_tp_init, pysqlite_connection_init},
+ {Py_tp_call, pysqlite_connection_call},
+ {Py_tp_traverse, connection_traverse},
+ {Py_tp_clear, connection_clear},
+ {0, NULL},
+};
+
+static PyType_Spec connection_spec = {
+ .name = MODULE_NAME ".Connection",
+ .basicsize = sizeof(pysqlite_Connection),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = connection_slots,
+};
+
+int
+pysqlite_connection_setup_types(PyObject *module)
+{
+ PyObject *type = PyType_FromModuleAndSpec(module, &connection_spec, NULL);
+ if (type == NULL) {
+ return -1;
+ }
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->ConnectionType = (PyTypeObject *)type;
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/connection.h b/contrib/tools/python3/Modules/_sqlite/connection.h
new file mode 100644
index 00000000000..1df92065a58
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/connection.h
@@ -0,0 +1,114 @@
+/* connection.h - definitions for the connection type
+ *
+ * Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_CONNECTION_H
+#define PYSQLITE_CONNECTION_H
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pythread.h"
+#include "structmember.h"
+
+#include "module.h"
+
+#include "sqlite3.h"
+
+typedef struct _callback_context
+{
+ PyObject *callable;
+ PyObject *module;
+ pysqlite_state *state;
+} callback_context;
+
+enum autocommit_mode {
+ AUTOCOMMIT_LEGACY = LEGACY_TRANSACTION_CONTROL,
+ AUTOCOMMIT_ENABLED = 1,
+ AUTOCOMMIT_DISABLED = 0,
+};
+
+typedef struct
+{
+ PyObject_HEAD
+ sqlite3 *db;
+ pysqlite_state *state;
+
+ /* the type detection mode. Only 0, PARSE_DECLTYPES, PARSE_COLNAMES or a
+ * bitwise combination thereof makes sense */
+ int detect_types;
+
+ /* NULL for autocommit, otherwise a string with the isolation level */
+ const char *isolation_level;
+ enum autocommit_mode autocommit;
+
+ /* 1 if a check should be performed for each API call if the connection is
+ * used from the same thread it was created in */
+ int check_same_thread;
+
+ int initialized;
+
+ /* thread identification of the thread the connection was created in */
+ unsigned long thread_ident;
+
+ PyObject *statement_cache;
+
+ /* Lists of weak references to cursors and blobs used within this connection */
+ PyObject *cursors;
+ PyObject *blobs;
+
+ /* Counters for how many cursors were created in the connection. May be
+ * reset to 0 at certain intervals */
+ int created_cursors;
+
+ PyObject* row_factory;
+
+ /* Determines how bytestrings from SQLite are converted to Python objects:
+ * - PyUnicode_Type: Python Unicode objects are constructed from UTF-8 bytestrings
+ * - PyBytes_Type: The bytestrings are returned as-is.
+ * - Any custom callable: Any object returned from the callable called with the bytestring
+ * as single parameter.
+ */
+ PyObject* text_factory;
+
+ // Remember contexts used by the trace, progress, and authoriser callbacks
+ callback_context *trace_ctx;
+ callback_context *progress_ctx;
+ callback_context *authorizer_ctx;
+
+ /* Exception objects: borrowed refs. */
+ PyObject* Warning;
+ PyObject* Error;
+ PyObject* InterfaceError;
+ PyObject* DatabaseError;
+ PyObject* DataError;
+ PyObject* OperationalError;
+ PyObject* IntegrityError;
+ PyObject* InternalError;
+ PyObject* ProgrammingError;
+ PyObject* NotSupportedError;
+} pysqlite_Connection;
+
+int pysqlite_check_thread(pysqlite_Connection* self);
+int pysqlite_check_connection(pysqlite_Connection* con);
+
+int pysqlite_connection_setup_types(PyObject *module);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/cursor.c b/contrib/tools/python3/Modules/_sqlite/cursor.c
new file mode 100644
index 00000000000..caeedbddb8d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/cursor.c
@@ -0,0 +1,1366 @@
+/* cursor.c - the cursor type
+ *
+ * Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "cursor.h"
+#include "microprotocols.h"
+#include "module.h"
+#include "util.h"
+
+typedef enum {
+ TYPE_LONG,
+ TYPE_FLOAT,
+ TYPE_UNICODE,
+ TYPE_BUFFER,
+ TYPE_UNKNOWN
+} parameter_type;
+
+#define clinic_state() (pysqlite_get_state_by_type(Py_TYPE(self)))
+#include "clinic/cursor.c.h"
+#undef clinic_state
+
+static inline int
+check_cursor_locked(pysqlite_Cursor *cur)
+{
+ if (cur->locked) {
+ PyErr_SetString(cur->connection->ProgrammingError,
+ "Recursive use of cursors not allowed.");
+ return 0;
+ }
+ return 1;
+}
+
+/*[clinic input]
+module _sqlite3
+class _sqlite3.Cursor "pysqlite_Cursor *" "clinic_state()->CursorType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3c5b8115c5cf30f1]*/
+
+/*
+ * Registers a cursor with the connection.
+ *
+ * 0 => error; 1 => ok
+ */
+static int
+register_cursor(pysqlite_Connection *connection, PyObject *cursor)
+{
+ PyObject *weakref = PyWeakref_NewRef((PyObject *)cursor, NULL);
+ if (weakref == NULL) {
+ return 0;
+ }
+
+ if (PyList_Append(connection->cursors, weakref) < 0) {
+ Py_CLEAR(weakref);
+ return 0;
+ }
+
+ Py_DECREF(weakref);
+ return 1;
+}
+
+/*[clinic input]
+_sqlite3.Cursor.__init__ as pysqlite_cursor_init
+
+ connection: object(type='pysqlite_Connection *', subclass_of='clinic_state()->ConnectionType')
+ /
+
+[clinic start generated code]*/
+
+static int
+pysqlite_cursor_init_impl(pysqlite_Cursor *self,
+ pysqlite_Connection *connection)
+/*[clinic end generated code: output=ac59dce49a809ca8 input=23d4265b534989fb]*/
+{
+ if (!check_cursor_locked(self)) {
+ return -1;
+ }
+
+ Py_INCREF(connection);
+ Py_XSETREF(self->connection, connection);
+ Py_CLEAR(self->statement);
+ Py_CLEAR(self->row_cast_map);
+
+ Py_INCREF(Py_None);
+ Py_XSETREF(self->description, Py_None);
+
+ Py_INCREF(Py_None);
+ Py_XSETREF(self->lastrowid, Py_None);
+
+ self->arraysize = 1;
+ self->closed = 0;
+ self->rowcount = -1L;
+
+ Py_INCREF(Py_None);
+ Py_XSETREF(self->row_factory, Py_None);
+
+ if (!pysqlite_check_thread(self->connection)) {
+ return -1;
+ }
+
+ if (!register_cursor(connection, (PyObject *)self)) {
+ return -1;
+ }
+
+ self->initialized = 1;
+
+ return 0;
+}
+
+static inline int
+stmt_reset(pysqlite_Statement *self)
+{
+ int rc = SQLITE_OK;
+
+ if (self->st != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_reset(self->st);
+ Py_END_ALLOW_THREADS
+ }
+
+ return rc;
+}
+
+static int
+cursor_traverse(pysqlite_Cursor *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->connection);
+ Py_VISIT(self->description);
+ Py_VISIT(self->row_cast_map);
+ Py_VISIT(self->lastrowid);
+ Py_VISIT(self->row_factory);
+ Py_VISIT(self->statement);
+ return 0;
+}
+
+static int
+cursor_clear(pysqlite_Cursor *self)
+{
+ Py_CLEAR(self->connection);
+ Py_CLEAR(self->description);
+ Py_CLEAR(self->row_cast_map);
+ Py_CLEAR(self->lastrowid);
+ Py_CLEAR(self->row_factory);
+ if (self->statement) {
+ /* Reset the statement if the user has not closed the cursor */
+ stmt_reset(self->statement);
+ Py_CLEAR(self->statement);
+ }
+
+ return 0;
+}
+
+static void
+cursor_dealloc(pysqlite_Cursor *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ if (self->in_weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject*)self);
+ }
+ tp->tp_clear((PyObject *)self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+_pysqlite_get_converter(pysqlite_state *state, const char *keystr,
+ Py_ssize_t keylen)
+{
+ PyObject *key;
+ PyObject *upcase_key;
+ PyObject *retval;
+
+ key = PyUnicode_FromStringAndSize(keystr, keylen);
+ if (!key) {
+ return NULL;
+ }
+ upcase_key = PyObject_CallMethodNoArgs(key, state->str_upper);
+ Py_DECREF(key);
+ if (!upcase_key) {
+ return NULL;
+ }
+
+ retval = PyDict_GetItemWithError(state->converters, upcase_key);
+ Py_DECREF(upcase_key);
+
+ return retval;
+}
+
+static int
+pysqlite_build_row_cast_map(pysqlite_Cursor* self)
+{
+ int i;
+ const char* pos;
+ const char* decltype;
+ PyObject* converter;
+
+ if (!self->connection->detect_types) {
+ return 0;
+ }
+
+ Py_XSETREF(self->row_cast_map, PyList_New(0));
+ if (!self->row_cast_map) {
+ return -1;
+ }
+
+ for (i = 0; i < sqlite3_column_count(self->statement->st); i++) {
+ converter = NULL;
+
+ if (self->connection->detect_types & PARSE_COLNAMES) {
+ const char *colname = sqlite3_column_name(self->statement->st, i);
+ if (colname == NULL) {
+ PyErr_NoMemory();
+ Py_CLEAR(self->row_cast_map);
+ return -1;
+ }
+ const char *type_start = NULL;
+ for (pos = colname; *pos != 0; pos++) {
+ if (*pos == '[') {
+ type_start = pos + 1;
+ }
+ else if (*pos == ']' && type_start != NULL) {
+ pysqlite_state *state = self->connection->state;
+ converter = _pysqlite_get_converter(state, type_start,
+ pos - type_start);
+ if (!converter && PyErr_Occurred()) {
+ Py_CLEAR(self->row_cast_map);
+ return -1;
+ }
+ break;
+ }
+ }
+ }
+
+ if (!converter && self->connection->detect_types & PARSE_DECLTYPES) {
+ decltype = sqlite3_column_decltype(self->statement->st, i);
+ if (decltype) {
+ for (pos = decltype;;pos++) {
+ /* Converter names are split at '(' and blanks.
+ * This allows 'INTEGER NOT NULL' to be treated as 'INTEGER' and
+ * 'NUMBER(10)' to be treated as 'NUMBER', for example.
+ * In other words, it will work as people expect it to work.*/
+ if (*pos == ' ' || *pos == '(' || *pos == 0) {
+ pysqlite_state *state = self->connection->state;
+ converter = _pysqlite_get_converter(state, decltype,
+ pos - decltype);
+ if (!converter && PyErr_Occurred()) {
+ Py_CLEAR(self->row_cast_map);
+ return -1;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ if (!converter) {
+ converter = Py_None;
+ }
+
+ if (PyList_Append(self->row_cast_map, converter) != 0) {
+ Py_CLEAR(self->row_cast_map);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static PyObject *
+_pysqlite_build_column_name(pysqlite_Cursor *self, const char *colname)
+{
+ const char* pos;
+ Py_ssize_t len;
+
+ if (self->connection->detect_types & PARSE_COLNAMES) {
+ for (pos = colname; *pos; pos++) {
+ if (*pos == '[') {
+ if ((pos != colname) && (*(pos-1) == ' ')) {
+ pos--;
+ }
+ break;
+ }
+ }
+ len = pos - colname;
+ }
+ else {
+ len = strlen(colname);
+ }
+ return PyUnicode_FromStringAndSize(colname, len);
+}
+
+/*
+ * Returns a row from the currently active SQLite statement
+ *
+ * Precondidition:
+ * - sqlite3_step() has been called before and it returned SQLITE_ROW.
+ */
+static PyObject *
+_pysqlite_fetch_one_row(pysqlite_Cursor* self)
+{
+ int i, numcols;
+ PyObject* row;
+ int coltype;
+ PyObject* converter;
+ PyObject* converted;
+ Py_ssize_t nbytes;
+ char buf[200];
+ const char* colname;
+ PyObject* error_msg;
+
+ Py_BEGIN_ALLOW_THREADS
+ numcols = sqlite3_data_count(self->statement->st);
+ Py_END_ALLOW_THREADS
+
+ row = PyTuple_New(numcols);
+ if (!row)
+ return NULL;
+
+ sqlite3 *db = self->connection->db;
+ for (i = 0; i < numcols; i++) {
+ if (self->connection->detect_types
+ && self->row_cast_map != NULL
+ && i < PyList_GET_SIZE(self->row_cast_map))
+ {
+ converter = PyList_GET_ITEM(self->row_cast_map, i);
+ }
+ else {
+ converter = Py_None;
+ }
+
+ /*
+ * Note, sqlite3_column_bytes() must come after sqlite3_column_blob()
+ * or sqlite3_column_text().
+ *
+ * See https://sqlite.org/c3ref/column_blob.html for details.
+ */
+ if (converter != Py_None) {
+ const void *blob = sqlite3_column_blob(self->statement->st, i);
+ if (blob == NULL) {
+ if (sqlite3_errcode(db) == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ converted = Py_NewRef(Py_None);
+ }
+ else {
+ nbytes = sqlite3_column_bytes(self->statement->st, i);
+ PyObject *item = PyBytes_FromStringAndSize(blob, nbytes);
+ if (item == NULL) {
+ goto error;
+ }
+ converted = PyObject_CallOneArg(converter, item);
+ Py_DECREF(item);
+ }
+ } else {
+ Py_BEGIN_ALLOW_THREADS
+ coltype = sqlite3_column_type(self->statement->st, i);
+ Py_END_ALLOW_THREADS
+ if (coltype == SQLITE_NULL) {
+ converted = Py_NewRef(Py_None);
+ } else if (coltype == SQLITE_INTEGER) {
+ converted = PyLong_FromLongLong(sqlite3_column_int64(self->statement->st, i));
+ } else if (coltype == SQLITE_FLOAT) {
+ converted = PyFloat_FromDouble(sqlite3_column_double(self->statement->st, i));
+ } else if (coltype == SQLITE_TEXT) {
+ const char *text = (const char*)sqlite3_column_text(self->statement->st, i);
+ if (text == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ nbytes = sqlite3_column_bytes(self->statement->st, i);
+ if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) {
+ converted = PyUnicode_FromStringAndSize(text, nbytes);
+ if (!converted && PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
+ PyErr_Clear();
+ colname = sqlite3_column_name(self->statement->st, i);
+ if (colname == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ PyOS_snprintf(buf, sizeof(buf) - 1, "Could not decode to UTF-8 column '%s' with text '%s'",
+ colname , text);
+ error_msg = PyUnicode_Decode(buf, strlen(buf), "ascii", "replace");
+
+ PyObject *exc = self->connection->OperationalError;
+ if (!error_msg) {
+ PyErr_SetString(exc, "Could not decode to UTF-8");
+ } else {
+ PyErr_SetObject(exc, error_msg);
+ Py_DECREF(error_msg);
+ }
+ }
+ } else if (self->connection->text_factory == (PyObject*)&PyBytes_Type) {
+ converted = PyBytes_FromStringAndSize(text, nbytes);
+ } else if (self->connection->text_factory == (PyObject*)&PyByteArray_Type) {
+ converted = PyByteArray_FromStringAndSize(text, nbytes);
+ } else {
+ converted = PyObject_CallFunction(self->connection->text_factory, "y#", text, nbytes);
+ }
+ } else {
+ /* coltype == SQLITE_BLOB */
+ const void *blob = sqlite3_column_blob(self->statement->st, i);
+ if (blob == NULL && sqlite3_errcode(db) == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ nbytes = sqlite3_column_bytes(self->statement->st, i);
+ converted = PyBytes_FromStringAndSize(blob, nbytes);
+ }
+ }
+
+ if (!converted) {
+ goto error;
+ }
+ PyTuple_SET_ITEM(row, i, converted);
+ }
+
+ if (PyErr_Occurred())
+ goto error;
+
+ return row;
+
+error:
+ Py_DECREF(row);
+ return NULL;
+}
+
+/*
+ * Checks if a cursor object is usable.
+ *
+ * 0 => error; 1 => ok
+ */
+static int check_cursor(pysqlite_Cursor* cur)
+{
+ if (!cur->initialized) {
+ pysqlite_state *state = pysqlite_get_state_by_type(Py_TYPE(cur));
+ PyErr_SetString(state->ProgrammingError,
+ "Base Cursor.__init__ not called.");
+ return 0;
+ }
+
+ if (cur->closed) {
+ PyErr_SetString(cur->connection->state->ProgrammingError,
+ "Cannot operate on a closed cursor.");
+ return 0;
+ }
+
+ return (pysqlite_check_thread(cur->connection)
+ && pysqlite_check_connection(cur->connection)
+ && check_cursor_locked(cur));
+}
+
+static int
+begin_transaction(pysqlite_Connection *self)
+{
+ assert(self->isolation_level != NULL);
+ int rc;
+
+ Py_BEGIN_ALLOW_THREADS
+ sqlite3_stmt *statement;
+ char begin_stmt[16] = "BEGIN ";
+#ifdef Py_DEBUG
+ size_t len = strlen(self->isolation_level);
+ assert(len <= 9);
+#endif
+ (void)strcat(begin_stmt, self->isolation_level);
+ rc = sqlite3_prepare_v2(self->db, begin_stmt, -1, &statement, NULL);
+ if (rc == SQLITE_OK) {
+ (void)sqlite3_step(statement);
+ rc = sqlite3_finalize(statement);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ (void)_pysqlite_seterror(self->state, self->db);
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyObject *
+get_statement_from_cache(pysqlite_Cursor *self, PyObject *operation)
+{
+ PyObject *args[] = { NULL, operation, }; // Borrowed ref.
+ PyObject *cache = self->connection->statement_cache;
+ size_t nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET;
+ return PyObject_Vectorcall(cache, args + 1, nargsf, NULL);
+}
+
+static inline int
+stmt_step(sqlite3_stmt *statement)
+{
+ int rc;
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_step(statement);
+ Py_END_ALLOW_THREADS
+
+ return rc;
+}
+
+static int
+bind_param(pysqlite_state *state, pysqlite_Statement *self, int pos,
+ PyObject *parameter)
+{
+ int rc = SQLITE_OK;
+ const char *string;
+ Py_ssize_t buflen;
+ parameter_type paramtype;
+
+ if (parameter == Py_None) {
+ rc = sqlite3_bind_null(self->st, pos);
+ goto final;
+ }
+
+ if (PyLong_CheckExact(parameter)) {
+ paramtype = TYPE_LONG;
+ } else if (PyFloat_CheckExact(parameter)) {
+ paramtype = TYPE_FLOAT;
+ } else if (PyUnicode_CheckExact(parameter)) {
+ paramtype = TYPE_UNICODE;
+ } else if (PyLong_Check(parameter)) {
+ paramtype = TYPE_LONG;
+ } else if (PyFloat_Check(parameter)) {
+ paramtype = TYPE_FLOAT;
+ } else if (PyUnicode_Check(parameter)) {
+ paramtype = TYPE_UNICODE;
+ } else if (PyObject_CheckBuffer(parameter)) {
+ paramtype = TYPE_BUFFER;
+ } else {
+ paramtype = TYPE_UNKNOWN;
+ }
+
+ switch (paramtype) {
+ case TYPE_LONG: {
+ sqlite_int64 value = _pysqlite_long_as_int64(parameter);
+ if (value == -1 && PyErr_Occurred())
+ rc = -1;
+ else
+ rc = sqlite3_bind_int64(self->st, pos, value);
+ break;
+ }
+ case TYPE_FLOAT: {
+ double value = PyFloat_AsDouble(parameter);
+ if (value == -1 && PyErr_Occurred()) {
+ rc = -1;
+ }
+ else {
+ rc = sqlite3_bind_double(self->st, pos, value);
+ }
+ break;
+ }
+ case TYPE_UNICODE:
+ string = PyUnicode_AsUTF8AndSize(parameter, &buflen);
+ if (string == NULL)
+ return -1;
+ if (buflen > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "string longer than INT_MAX bytes");
+ return -1;
+ }
+ rc = sqlite3_bind_text(self->st, pos, string, (int)buflen, SQLITE_TRANSIENT);
+ break;
+ case TYPE_BUFFER: {
+ Py_buffer view;
+ if (PyObject_GetBuffer(parameter, &view, PyBUF_SIMPLE) != 0) {
+ return -1;
+ }
+ if (view.len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "BLOB longer than INT_MAX bytes");
+ PyBuffer_Release(&view);
+ return -1;
+ }
+ rc = sqlite3_bind_blob(self->st, pos, view.buf, (int)view.len, SQLITE_TRANSIENT);
+ PyBuffer_Release(&view);
+ break;
+ }
+ case TYPE_UNKNOWN:
+ PyErr_Format(state->ProgrammingError,
+ "Error binding parameter %d: type '%s' is not supported",
+ pos, Py_TYPE(parameter)->tp_name);
+ rc = -1;
+ }
+
+final:
+ return rc;
+}
+
+/* returns 0 if the object is one of Python's internal ones that don't need to be adapted */
+static inline int
+need_adapt(pysqlite_state *state, PyObject *obj)
+{
+ if (state->BaseTypeAdapted) {
+ return 1;
+ }
+
+ if (PyLong_CheckExact(obj) || PyFloat_CheckExact(obj)
+ || PyUnicode_CheckExact(obj) || PyByteArray_CheckExact(obj)) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+static void
+bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
+ PyObject *parameters)
+{
+ PyObject* current_param;
+ PyObject* adapted;
+ const char* binding_name;
+ int i;
+ int rc;
+ int num_params_needed;
+ Py_ssize_t num_params;
+
+ Py_BEGIN_ALLOW_THREADS
+ num_params_needed = sqlite3_bind_parameter_count(self->st);
+ Py_END_ALLOW_THREADS
+
+ if (PyTuple_CheckExact(parameters) || PyList_CheckExact(parameters) || (!PyDict_Check(parameters) && PySequence_Check(parameters))) {
+ /* parameters passed as sequence */
+ if (PyTuple_CheckExact(parameters)) {
+ num_params = PyTuple_GET_SIZE(parameters);
+ } else if (PyList_CheckExact(parameters)) {
+ num_params = PyList_GET_SIZE(parameters);
+ } else {
+ num_params = PySequence_Size(parameters);
+ if (num_params == -1) {
+ return;
+ }
+ }
+ if (num_params != num_params_needed) {
+ PyErr_Format(state->ProgrammingError,
+ "Incorrect number of bindings supplied. The current "
+ "statement uses %d, and there are %zd supplied.",
+ num_params_needed, num_params);
+ return;
+ }
+ for (i = 0; i < num_params; i++) {
+ const char *name = sqlite3_bind_parameter_name(self->st, i+1);
+ if (name != NULL) {
+ int ret = PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "Binding %d ('%s') is a named parameter, but you "
+ "supplied a sequence which requires nameless (qmark) "
+ "placeholders. Starting with Python 3.14 an "
+ "sqlite3.ProgrammingError will be raised.",
+ i+1, name);
+ if (ret < 0) {
+ return;
+ }
+ }
+
+ if (PyTuple_CheckExact(parameters)) {
+ PyObject *item = PyTuple_GET_ITEM(parameters, i);
+ current_param = Py_NewRef(item);
+ } else if (PyList_CheckExact(parameters)) {
+ PyObject *item = PyList_GetItem(parameters, i);
+ current_param = Py_XNewRef(item);
+ } else {
+ current_param = PySequence_GetItem(parameters, i);
+ }
+ if (!current_param) {
+ return;
+ }
+
+ if (!need_adapt(state, current_param)) {
+ adapted = current_param;
+ } else {
+ PyObject *protocol = (PyObject *)state->PrepareProtocolType;
+ adapted = pysqlite_microprotocols_adapt(state, current_param,
+ protocol,
+ current_param);
+ Py_DECREF(current_param);
+ if (!adapted) {
+ return;
+ }
+ }
+
+ rc = bind_param(state, self, i + 1, adapted);
+ Py_DECREF(adapted);
+
+ if (rc != SQLITE_OK) {
+ PyObject *exc = PyErr_GetRaisedException();
+ sqlite3 *db = sqlite3_db_handle(self->st);
+ _pysqlite_seterror(state, db);
+ _PyErr_ChainExceptions1(exc);
+ return;
+ }
+ }
+ } else if (PyDict_Check(parameters)) {
+ /* parameters passed as dictionary */
+ for (i = 1; i <= num_params_needed; i++) {
+ PyObject *binding_name_obj;
+ Py_BEGIN_ALLOW_THREADS
+ binding_name = sqlite3_bind_parameter_name(self->st, i);
+ Py_END_ALLOW_THREADS
+ if (!binding_name) {
+ PyErr_Format(state->ProgrammingError,
+ "Binding %d has no name, but you supplied a "
+ "dictionary (which has only names).", i);
+ return;
+ }
+
+ binding_name++; /* skip first char (the colon) */
+ binding_name_obj = PyUnicode_FromString(binding_name);
+ if (!binding_name_obj) {
+ return;
+ }
+ if (PyDict_CheckExact(parameters)) {
+ PyObject *item = PyDict_GetItemWithError(parameters, binding_name_obj);
+ current_param = Py_XNewRef(item);
+ } else {
+ current_param = PyObject_GetItem(parameters, binding_name_obj);
+ }
+ Py_DECREF(binding_name_obj);
+ if (!current_param) {
+ if (!PyErr_Occurred() || PyErr_ExceptionMatches(PyExc_LookupError)) {
+ PyErr_Format(state->ProgrammingError,
+ "You did not supply a value for binding "
+ "parameter :%s.", binding_name);
+ }
+ return;
+ }
+
+ if (!need_adapt(state, current_param)) {
+ adapted = current_param;
+ } else {
+ PyObject *protocol = (PyObject *)state->PrepareProtocolType;
+ adapted = pysqlite_microprotocols_adapt(state, current_param,
+ protocol,
+ current_param);
+ Py_DECREF(current_param);
+ if (!adapted) {
+ return;
+ }
+ }
+
+ rc = bind_param(state, self, i, adapted);
+ Py_DECREF(adapted);
+
+ if (rc != SQLITE_OK) {
+ PyObject *exc = PyErr_GetRaisedException();
+ sqlite3 *db = sqlite3_db_handle(self->st);
+ _pysqlite_seterror(state, db);
+ _PyErr_ChainExceptions1(exc);
+ return;
+ }
+ }
+ } else {
+ PyErr_SetString(state->ProgrammingError,
+ "parameters are of unsupported type");
+ }
+}
+
+PyObject *
+_pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation, PyObject* second_argument)
+{
+ PyObject* parameters_list = NULL;
+ PyObject* parameters_iter = NULL;
+ PyObject* parameters = NULL;
+ int i;
+ int rc;
+ int numcols;
+ PyObject* column_name;
+
+ if (!check_cursor(self)) {
+ goto error;
+ }
+
+ self->locked = 1;
+
+ if (multiple) {
+ if (PyIter_Check(second_argument)) {
+ /* iterator */
+ parameters_iter = Py_NewRef(second_argument);
+ } else {
+ /* sequence */
+ parameters_iter = PyObject_GetIter(second_argument);
+ if (!parameters_iter) {
+ goto error;
+ }
+ }
+ } else {
+ parameters_list = PyList_New(0);
+ if (!parameters_list) {
+ goto error;
+ }
+
+ if (second_argument == NULL) {
+ second_argument = PyTuple_New(0);
+ if (!second_argument) {
+ goto error;
+ }
+ } else {
+ Py_INCREF(second_argument);
+ }
+ if (PyList_Append(parameters_list, second_argument) != 0) {
+ Py_DECREF(second_argument);
+ goto error;
+ }
+ Py_DECREF(second_argument);
+
+ parameters_iter = PyObject_GetIter(parameters_list);
+ if (!parameters_iter) {
+ goto error;
+ }
+ }
+
+ /* reset description */
+ Py_INCREF(Py_None);
+ Py_SETREF(self->description, Py_None);
+
+ if (self->statement) {
+ // Reset pending statements on this cursor.
+ (void)stmt_reset(self->statement);
+ }
+
+ PyObject *stmt = get_statement_from_cache(self, operation);
+ Py_XSETREF(self->statement, (pysqlite_Statement *)stmt);
+ if (!self->statement) {
+ goto error;
+ }
+
+ pysqlite_state *state = self->connection->state;
+ if (multiple && sqlite3_stmt_readonly(self->statement->st)) {
+ PyErr_SetString(state->ProgrammingError,
+ "executemany() can only execute DML statements.");
+ goto error;
+ }
+
+ if (sqlite3_stmt_busy(self->statement->st)) {
+ Py_SETREF(self->statement,
+ pysqlite_statement_create(self->connection, operation));
+ if (self->statement == NULL) {
+ goto error;
+ }
+ }
+
+ (void)stmt_reset(self->statement);
+ self->rowcount = self->statement->is_dml ? 0L : -1L;
+
+ /* We start a transaction implicitly before a DML statement.
+ SELECT is the only exception. See #9924. */
+ if (self->connection->autocommit == AUTOCOMMIT_LEGACY
+ && self->connection->isolation_level
+ && self->statement->is_dml
+ && sqlite3_get_autocommit(self->connection->db))
+ {
+ if (begin_transaction(self->connection) < 0) {
+ goto error;
+ }
+ }
+
+ assert(!sqlite3_stmt_busy(self->statement->st));
+ while (1) {
+ parameters = PyIter_Next(parameters_iter);
+ if (!parameters) {
+ break;
+ }
+
+ bind_parameters(state, self->statement, parameters);
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+
+ rc = stmt_step(self->statement->st);
+ if (rc != SQLITE_DONE && rc != SQLITE_ROW) {
+ if (PyErr_Occurred()) {
+ /* there was an error that occurred in a user-defined callback */
+ if (state->enable_callback_tracebacks) {
+ PyErr_Print();
+ } else {
+ PyErr_Clear();
+ }
+ }
+ _pysqlite_seterror(state, self->connection->db);
+ goto error;
+ }
+
+ if (pysqlite_build_row_cast_map(self) != 0) {
+ _PyErr_FormatFromCause(state->OperationalError,
+ "Error while building row_cast_map");
+ goto error;
+ }
+
+ assert(rc == SQLITE_ROW || rc == SQLITE_DONE);
+ Py_BEGIN_ALLOW_THREADS
+ numcols = sqlite3_column_count(self->statement->st);
+ Py_END_ALLOW_THREADS
+ if (self->description == Py_None && numcols > 0) {
+ Py_SETREF(self->description, PyTuple_New(numcols));
+ if (!self->description) {
+ goto error;
+ }
+ for (i = 0; i < numcols; i++) {
+ const char *colname;
+ colname = sqlite3_column_name(self->statement->st, i);
+ if (colname == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ column_name = _pysqlite_build_column_name(self, colname);
+ if (column_name == NULL) {
+ goto error;
+ }
+ PyObject *descriptor = PyTuple_Pack(7, column_name,
+ Py_None, Py_None, Py_None,
+ Py_None, Py_None, Py_None);
+ Py_DECREF(column_name);
+ if (descriptor == NULL) {
+ goto error;
+ }
+ PyTuple_SET_ITEM(self->description, i, descriptor);
+ }
+ }
+
+ if (rc == SQLITE_DONE) {
+ if (self->statement->is_dml) {
+ self->rowcount += (long)sqlite3_changes(self->connection->db);
+ }
+ stmt_reset(self->statement);
+ }
+ Py_XDECREF(parameters);
+ }
+
+ if (!multiple) {
+ sqlite_int64 lastrowid;
+
+ Py_BEGIN_ALLOW_THREADS
+ lastrowid = sqlite3_last_insert_rowid(self->connection->db);
+ Py_END_ALLOW_THREADS
+
+ Py_SETREF(self->lastrowid, PyLong_FromLongLong(lastrowid));
+ // Fall through on error.
+ }
+
+error:
+ Py_XDECREF(parameters);
+ Py_XDECREF(parameters_iter);
+ Py_XDECREF(parameters_list);
+
+ self->locked = 0;
+
+ if (PyErr_Occurred()) {
+ if (self->statement) {
+ (void)stmt_reset(self->statement);
+ Py_CLEAR(self->statement);
+ }
+ self->rowcount = -1L;
+ return NULL;
+ }
+ if (self->statement && !sqlite3_stmt_busy(self->statement->st)) {
+ Py_CLEAR(self->statement);
+ }
+ return Py_NewRef((PyObject *)self);
+}
+
+/*[clinic input]
+_sqlite3.Cursor.execute as pysqlite_cursor_execute
+
+ sql: unicode
+ parameters: object(c_default = 'NULL') = ()
+ /
+
+Executes an SQL statement.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_execute_impl(pysqlite_Cursor *self, PyObject *sql,
+ PyObject *parameters)
+/*[clinic end generated code: output=d81b4655c7c0bbad input=a8e0200a11627f94]*/
+{
+ return _pysqlite_query_execute(self, 0, sql, parameters);
+}
+
+/*[clinic input]
+_sqlite3.Cursor.executemany as pysqlite_cursor_executemany
+
+ sql: unicode
+ seq_of_parameters: object
+ /
+
+Repeatedly executes an SQL statement.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_executemany_impl(pysqlite_Cursor *self, PyObject *sql,
+ PyObject *seq_of_parameters)
+/*[clinic end generated code: output=2c65a3c4733fb5d8 input=0d0a52e5eb7ccd35]*/
+{
+ return _pysqlite_query_execute(self, 1, sql, seq_of_parameters);
+}
+
+/*[clinic input]
+_sqlite3.Cursor.executescript as pysqlite_cursor_executescript
+
+ sql_script: str
+ /
+
+Executes multiple SQL statements at once.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_executescript_impl(pysqlite_Cursor *self,
+ const char *sql_script)
+/*[clinic end generated code: output=8fd726dde1c65164 input=78f093be415a8a2c]*/
+{
+ if (!check_cursor(self)) {
+ return NULL;
+ }
+
+ size_t sql_len = strlen(sql_script);
+ int max_length = sqlite3_limit(self->connection->db,
+ SQLITE_LIMIT_SQL_LENGTH, -1);
+ if (sql_len > (unsigned)max_length) {
+ PyErr_SetString(self->connection->DataError,
+ "query string is too large");
+ return NULL;
+ }
+
+ // Commit if needed
+ sqlite3 *db = self->connection->db;
+ if (self->connection->autocommit == AUTOCOMMIT_LEGACY
+ && !sqlite3_get_autocommit(db))
+ {
+ int rc = SQLITE_OK;
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_exec(db, "COMMIT", NULL, NULL, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ goto error;
+ }
+ }
+
+ while (1) {
+ int rc;
+ const char *tail;
+
+ Py_BEGIN_ALLOW_THREADS
+ sqlite3_stmt *stmt;
+ rc = sqlite3_prepare_v2(db, sql_script, (int)sql_len + 1, &stmt,
+ &tail);
+ if (rc == SQLITE_OK) {
+ do {
+ rc = sqlite3_step(stmt);
+ } while (rc == SQLITE_ROW);
+ rc = sqlite3_finalize(stmt);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ goto error;
+ }
+
+ if (*tail == (char)0) {
+ break;
+ }
+ sql_len -= (tail - sql_script);
+ sql_script = tail;
+ }
+
+ return Py_NewRef((PyObject *)self);
+
+error:
+ _pysqlite_seterror(self->connection->state, db);
+ return NULL;
+}
+
+static PyObject *
+pysqlite_cursor_iternext(pysqlite_Cursor *self)
+{
+ if (!check_cursor(self)) {
+ return NULL;
+ }
+
+ if (self->statement == NULL) {
+ return NULL;
+ }
+
+ sqlite3_stmt *stmt = self->statement->st;
+ assert(stmt != NULL);
+ assert(sqlite3_data_count(stmt) != 0);
+
+ self->locked = 1; // GH-80254: Prevent recursive use of cursors.
+ PyObject *row = _pysqlite_fetch_one_row(self);
+ self->locked = 0;
+ if (row == NULL) {
+ return NULL;
+ }
+ int rc = stmt_step(stmt);
+ if (rc == SQLITE_DONE) {
+ if (self->statement->is_dml) {
+ self->rowcount = (long)sqlite3_changes(self->connection->db);
+ }
+ (void)stmt_reset(self->statement);
+ Py_CLEAR(self->statement);
+ }
+ else if (rc != SQLITE_ROW) {
+ (void)_pysqlite_seterror(self->connection->state,
+ self->connection->db);
+ (void)stmt_reset(self->statement);
+ Py_CLEAR(self->statement);
+ Py_DECREF(row);
+ return NULL;
+ }
+ if (!Py_IsNone(self->row_factory)) {
+ PyObject *factory = self->row_factory;
+ PyObject *args[] = { (PyObject *)self, row, };
+ PyObject *new_row = PyObject_Vectorcall(factory, args, 2, NULL);
+ Py_SETREF(row, new_row);
+ }
+ return row;
+}
+
+/*[clinic input]
+_sqlite3.Cursor.fetchone as pysqlite_cursor_fetchone
+
+Fetches one row from the resultset.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_fetchone_impl(pysqlite_Cursor *self)
+/*[clinic end generated code: output=4bd2eabf5baaddb0 input=e78294ec5980fdba]*/
+{
+ PyObject* row;
+
+ row = pysqlite_cursor_iternext(self);
+ if (!row && !PyErr_Occurred()) {
+ Py_RETURN_NONE;
+ }
+
+ return row;
+}
+
+/*[clinic input]
+_sqlite3.Cursor.fetchmany as pysqlite_cursor_fetchmany
+
+ size as maxrows: int(c_default='self->arraysize') = 1
+ The default value is set by the Cursor.arraysize attribute.
+
+Fetches several rows from the resultset.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_fetchmany_impl(pysqlite_Cursor *self, int maxrows)
+/*[clinic end generated code: output=a8ef31fea64d0906 input=c26e6ca3f34debd0]*/
+{
+ PyObject* row;
+ PyObject* list;
+ int counter = 0;
+
+ list = PyList_New(0);
+ if (!list) {
+ return NULL;
+ }
+
+ while ((row = pysqlite_cursor_iternext(self))) {
+ if (PyList_Append(list, row) < 0) {
+ Py_DECREF(row);
+ break;
+ }
+ Py_DECREF(row);
+
+ if (++counter == maxrows) {
+ break;
+ }
+ }
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(list);
+ return NULL;
+ } else {
+ return list;
+ }
+}
+
+/*[clinic input]
+_sqlite3.Cursor.fetchall as pysqlite_cursor_fetchall
+
+Fetches all rows from the resultset.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_fetchall_impl(pysqlite_Cursor *self)
+/*[clinic end generated code: output=d5da12aca2da4b27 input=f5d401086a8df25a]*/
+{
+ PyObject* row;
+ PyObject* list;
+
+ list = PyList_New(0);
+ if (!list) {
+ return NULL;
+ }
+
+ while ((row = pysqlite_cursor_iternext(self))) {
+ if (PyList_Append(list, row) < 0) {
+ Py_DECREF(row);
+ break;
+ }
+ Py_DECREF(row);
+ }
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(list);
+ return NULL;
+ } else {
+ return list;
+ }
+}
+
+/*[clinic input]
+_sqlite3.Cursor.setinputsizes as pysqlite_cursor_setinputsizes
+
+ sizes: object
+ /
+
+Required by DB-API. Does nothing in sqlite3.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_setinputsizes(pysqlite_Cursor *self, PyObject *sizes)
+/*[clinic end generated code: output=893c817afe9d08ad input=de7950a3aec79bdf]*/
+{
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Cursor.setoutputsize as pysqlite_cursor_setoutputsize
+
+ size: object
+ column: object = None
+ /
+
+Required by DB-API. Does nothing in sqlite3.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_setoutputsize_impl(pysqlite_Cursor *self, PyObject *size,
+ PyObject *column)
+/*[clinic end generated code: output=018d7e9129d45efe input=607a6bece8bbb273]*/
+{
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.Cursor.close as pysqlite_cursor_close
+
+Closes the cursor.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_cursor_close_impl(pysqlite_Cursor *self)
+/*[clinic end generated code: output=b6055e4ec6fe63b6 input=08b36552dbb9a986]*/
+{
+ if (!check_cursor_locked(self)) {
+ return NULL;
+ }
+
+ if (!self->connection) {
+ PyTypeObject *tp = Py_TYPE(self);
+ pysqlite_state *state = pysqlite_get_state_by_type(tp);
+ PyErr_SetString(state->ProgrammingError,
+ "Base Cursor.__init__ not called.");
+ return NULL;
+ }
+ if (!pysqlite_check_thread(self->connection) || !pysqlite_check_connection(self->connection)) {
+ return NULL;
+ }
+
+ if (self->statement) {
+ (void)stmt_reset(self->statement);
+ Py_CLEAR(self->statement);
+ }
+
+ self->closed = 1;
+
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef cursor_methods[] = {
+ PYSQLITE_CURSOR_CLOSE_METHODDEF
+ PYSQLITE_CURSOR_EXECUTEMANY_METHODDEF
+ PYSQLITE_CURSOR_EXECUTESCRIPT_METHODDEF
+ PYSQLITE_CURSOR_EXECUTE_METHODDEF
+ PYSQLITE_CURSOR_FETCHALL_METHODDEF
+ PYSQLITE_CURSOR_FETCHMANY_METHODDEF
+ PYSQLITE_CURSOR_FETCHONE_METHODDEF
+ PYSQLITE_CURSOR_SETINPUTSIZES_METHODDEF
+ PYSQLITE_CURSOR_SETOUTPUTSIZE_METHODDEF
+ {NULL, NULL}
+};
+
+static struct PyMemberDef cursor_members[] =
+{
+ {"connection", T_OBJECT, offsetof(pysqlite_Cursor, connection), READONLY},
+ {"description", T_OBJECT, offsetof(pysqlite_Cursor, description), READONLY},
+ {"arraysize", T_INT, offsetof(pysqlite_Cursor, arraysize), 0},
+ {"lastrowid", T_OBJECT, offsetof(pysqlite_Cursor, lastrowid), READONLY},
+ {"rowcount", T_LONG, offsetof(pysqlite_Cursor, rowcount), READONLY},
+ {"row_factory", T_OBJECT, offsetof(pysqlite_Cursor, row_factory), 0},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(pysqlite_Cursor, in_weakreflist), READONLY},
+ {NULL}
+};
+
+static const char cursor_doc[] =
+PyDoc_STR("SQLite database cursor class.");
+
+static PyType_Slot cursor_slots[] = {
+ {Py_tp_dealloc, cursor_dealloc},
+ {Py_tp_doc, (void *)cursor_doc},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, pysqlite_cursor_iternext},
+ {Py_tp_methods, cursor_methods},
+ {Py_tp_members, cursor_members},
+ {Py_tp_init, pysqlite_cursor_init},
+ {Py_tp_traverse, cursor_traverse},
+ {Py_tp_clear, cursor_clear},
+ {0, NULL},
+};
+
+static PyType_Spec cursor_spec = {
+ .name = MODULE_NAME ".Cursor",
+ .basicsize = sizeof(pysqlite_Cursor),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = cursor_slots,
+};
+
+int
+pysqlite_cursor_setup_types(PyObject *module)
+{
+ PyObject *type = PyType_FromModuleAndSpec(module, &cursor_spec, NULL);
+ if (type == NULL) {
+ return -1;
+ }
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->CursorType = (PyTypeObject *)type;
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/cursor.h b/contrib/tools/python3/Modules/_sqlite/cursor.h
new file mode 100644
index 00000000000..0bcdddc3e29
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/cursor.h
@@ -0,0 +1,53 @@
+/* cursor.h - definitions for the cursor type
+ *
+ * Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_CURSOR_H
+#define PYSQLITE_CURSOR_H
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+#include "statement.h"
+#include "connection.h"
+#include "module.h"
+
+typedef struct
+{
+ PyObject_HEAD
+ pysqlite_Connection* connection;
+ PyObject* description;
+ PyObject* row_cast_map;
+ int arraysize;
+ PyObject* lastrowid;
+ long rowcount;
+ PyObject* row_factory;
+ pysqlite_Statement* statement;
+ int closed;
+ int locked;
+ int initialized;
+
+ PyObject* in_weakreflist; /* List of weak references */
+} pysqlite_Cursor;
+
+int pysqlite_cursor_setup_types(PyObject *module);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/microprotocols.c b/contrib/tools/python3/Modules/_sqlite/microprotocols.c
new file mode 100644
index 00000000000..148220d0f91
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/microprotocols.c
@@ -0,0 +1,144 @@
+/* microprotocols.c - minimalist and non-validating protocols implementation
+ *
+ * Copyright (C) 2003-2004 Federico Di Gregorio <[email protected]>
+ *
+ * This file is part of psycopg and was adapted for pysqlite. Federico Di
+ * Gregorio gave the permission to use it within pysqlite under the following
+ * license:
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include <Python.h>
+
+#include "cursor.h"
+#include "microprotocols.h"
+#include "prepare_protocol.h"
+
+
+/* pysqlite_microprotocols_init - initialize the adapters dictionary */
+
+int
+pysqlite_microprotocols_init(PyObject *module)
+{
+ /* create adapters dictionary and put it in module namespace */
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->psyco_adapters = PyDict_New();
+ if (state->psyco_adapters == NULL) {
+ return -1;
+ }
+
+ return PyModule_AddObjectRef(module, "adapters", state->psyco_adapters);
+}
+
+
+/* pysqlite_microprotocols_add - add a reverse type-caster to the dictionary */
+
+int
+pysqlite_microprotocols_add(pysqlite_state *state, PyTypeObject *type,
+ PyObject *proto, PyObject *cast)
+{
+ PyObject* key;
+ int rc;
+
+ assert(type != NULL);
+ assert(proto != NULL);
+ key = PyTuple_Pack(2, (PyObject *)type, proto);
+ if (!key) {
+ return -1;
+ }
+
+ rc = PyDict_SetItem(state->psyco_adapters, key, cast);
+ Py_DECREF(key);
+
+ return rc;
+}
+
+/* pysqlite_microprotocols_adapt - adapt an object to the built-in protocol */
+
+PyObject *
+pysqlite_microprotocols_adapt(pysqlite_state *state, PyObject *obj,
+ PyObject *proto, PyObject *alt)
+{
+ PyObject *adapter, *key, *adapted;
+
+ /* we don't check for exact type conformance as specified in PEP 246
+ because the PrepareProtocolType type is abstract and there is no
+ way to get a quotable object to be its instance */
+
+ /* look for an adapter in the registry */
+ key = PyTuple_Pack(2, (PyObject *)Py_TYPE(obj), proto);
+ if (!key) {
+ return NULL;
+ }
+ adapter = PyDict_GetItemWithError(state->psyco_adapters, key);
+ Py_DECREF(key);
+ if (adapter) {
+ Py_INCREF(adapter);
+ adapted = PyObject_CallOneArg(adapter, obj);
+ Py_DECREF(adapter);
+ return adapted;
+ }
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
+ /* try to have the protocol adapt this object */
+ if (_PyObject_LookupAttr(proto, state->str___adapt__, &adapter) < 0) {
+ return NULL;
+ }
+ if (adapter) {
+ adapted = PyObject_CallOneArg(adapter, obj);
+ Py_DECREF(adapter);
+
+ if (adapted == Py_None) {
+ Py_DECREF(adapted);
+ }
+ else if (adapted || !PyErr_ExceptionMatches(PyExc_TypeError)) {
+ return adapted;
+ }
+ else {
+ PyErr_Clear();
+ }
+ }
+
+ /* and finally try to have the object adapt itself */
+ if (_PyObject_LookupAttr(obj, state->str___conform__, &adapter) < 0) {
+ return NULL;
+ }
+ if (adapter) {
+ adapted = PyObject_CallOneArg(adapter, proto);
+ Py_DECREF(adapter);
+
+ if (adapted == Py_None) {
+ Py_DECREF(adapted);
+ }
+ else if (adapted || !PyErr_ExceptionMatches(PyExc_TypeError)) {
+ return adapted;
+ }
+ else {
+ PyErr_Clear();
+ }
+ }
+
+ if (alt) {
+ return Py_NewRef(alt);
+ }
+ /* else set the right exception and return NULL */
+ PyErr_SetString(state->ProgrammingError, "can't adapt");
+ return NULL;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/microprotocols.h b/contrib/tools/python3/Modules/_sqlite/microprotocols.h
new file mode 100644
index 00000000000..6bde9d01f45
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/microprotocols.h
@@ -0,0 +1,43 @@
+/* microprotocols.c - definitions for minimalist and non-validating protocols
+ *
+ * Copyright (C) 2003-2004 Federico Di Gregorio <[email protected]>
+ *
+ * This file is part of psycopg and was adapted for pysqlite. Federico Di
+ * Gregorio gave the permission to use it within pysqlite under the following
+ * license:
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PSYCOPG_MICROPROTOCOLS_H
+#define PSYCOPG_MICROPROTOCOLS_H 1
+
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
+/** exported functions **/
+
+/* used by module.c to init the microprotocols system */
+extern int pysqlite_microprotocols_init(PyObject *module);
+extern int pysqlite_microprotocols_add(pysqlite_state *state,
+ PyTypeObject *type, PyObject *proto,
+ PyObject *cast);
+extern PyObject *pysqlite_microprotocols_adapt(pysqlite_state *state,
+ PyObject *obj, PyObject *proto,
+ PyObject *alt);
+
+#endif /* !defined(PSYCOPG_MICROPROTOCOLS_H) */
diff --git a/contrib/tools/python3/Modules/_sqlite/module.c b/contrib/tools/python3/Modules/_sqlite/module.c
new file mode 100644
index 00000000000..27bd42f4595
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/module.c
@@ -0,0 +1,807 @@
+/* module.c - the module itself
+ *
+ * Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "connection.h"
+#include "statement.h"
+#include "cursor.h"
+#include "prepare_protocol.h"
+#include "microprotocols.h"
+#include "row.h"
+#include "blob.h"
+
+#if SQLITE_VERSION_NUMBER < 3007015
+#error "SQLite 3.7.15 or higher required"
+#endif
+
+#define clinic_state() (pysqlite_get_state(module))
+#include "clinic/module.c.h"
+#undef clinic_state
+
+/*[clinic input]
+module _sqlite3
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=81e330492d57488e]*/
+
+// NB: This needs to be in sync with the Connection.__init__ docstring.
+PyDoc_STRVAR(module_connect_doc,
+"connect($module, /, database, timeout=5.0, detect_types=0,\n"
+" isolation_level='', check_same_thread=True,\n"
+" factory=ConnectionType, cached_statements=128, uri=False, *,\n"
+" autocommit=sqlite3.LEGACY_TRANSACTION_CONTROL)\n"
+"--\n"
+"\n"
+"Opens a connection to the SQLite database file database.\n"
+"\n"
+"You can use \":memory:\" to open a database connection to a database that resides\n"
+"in RAM instead of on disk.");
+
+#define PYSQLITE_CONNECT_METHODDEF \
+ {"connect", _PyCFunction_CAST(module_connect), METH_FASTCALL|METH_KEYWORDS, module_connect_doc},
+
+static PyObject *
+module_connect(PyObject *module, PyObject *const *args, Py_ssize_t nargsf,
+ PyObject *kwnames)
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+ PyObject *factory = (PyObject *)state->ConnectionType;
+
+ static const int FACTORY_POS = 5;
+ Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
+ if (nargs > FACTORY_POS) {
+ factory = args[FACTORY_POS];
+ }
+ else if (kwnames != NULL) {
+ for (Py_ssize_t i = 0; i < PyTuple_GET_SIZE(kwnames); i++) {
+ PyObject *item = PyTuple_GET_ITEM(kwnames, i); // borrowed ref.
+ if (PyUnicode_CompareWithASCIIString(item, "factory") == 0) {
+ factory = args[nargs + i];
+ break;
+ }
+ }
+ }
+
+ return PyObject_Vectorcall(factory, args, nargsf, kwnames);
+}
+
+/*[clinic input]
+_sqlite3.complete_statement as pysqlite_complete_statement
+
+ statement: str
+
+Checks if a string contains a complete SQL statement.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_complete_statement_impl(PyObject *module, const char *statement)
+/*[clinic end generated code: output=e55f1ff1952df558 input=ac45d257375bb828]*/
+{
+ if (sqlite3_complete(statement)) {
+ return Py_NewRef(Py_True);
+ } else {
+ return Py_NewRef(Py_False);
+ }
+}
+
+/*[clinic input]
+_sqlite3.register_adapter as pysqlite_register_adapter
+
+ type: object(type='PyTypeObject *')
+ adapter as caster: object
+ /
+
+Register a function to adapt Python objects to SQLite values.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_register_adapter_impl(PyObject *module, PyTypeObject *type,
+ PyObject *caster)
+/*[clinic end generated code: output=a287e8db18e8af23 input=29a5e0f213030242]*/
+{
+ int rc;
+
+ /* a basic type is adapted; there's a performance optimization if that's not the case
+ * (99 % of all usages) */
+ if (type == &PyLong_Type || type == &PyFloat_Type
+ || type == &PyUnicode_Type || type == &PyByteArray_Type) {
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->BaseTypeAdapted = 1;
+ }
+
+ pysqlite_state *state = pysqlite_get_state(module);
+ PyObject *protocol = (PyObject *)state->PrepareProtocolType;
+ rc = pysqlite_microprotocols_add(state, type, protocol, caster);
+ if (rc == -1) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.register_converter as pysqlite_register_converter
+
+ typename as orig_name: unicode
+ converter as callable: object
+ /
+
+Register a function to convert SQLite values to Python objects.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_register_converter_impl(PyObject *module, PyObject *orig_name,
+ PyObject *callable)
+/*[clinic end generated code: output=a2f2bfeed7230062 input=159a444971b40378]*/
+{
+ PyObject* name = NULL;
+ PyObject* retval = NULL;
+
+ /* convert the name to upper case */
+ pysqlite_state *state = pysqlite_get_state(module);
+ name = PyObject_CallMethodNoArgs(orig_name, state->str_upper);
+ if (!name) {
+ goto error;
+ }
+
+ if (PyDict_SetItem(state->converters, name, callable) != 0) {
+ goto error;
+ }
+
+ retval = Py_NewRef(Py_None);
+error:
+ Py_XDECREF(name);
+ return retval;
+}
+
+/*[clinic input]
+_sqlite3.enable_callback_tracebacks as pysqlite_enable_callback_trace
+
+ enable: int
+ /
+
+Enable or disable callback functions throwing errors to stderr.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_enable_callback_trace_impl(PyObject *module, int enable)
+/*[clinic end generated code: output=4ff1d051c698f194 input=cb79d3581eb77c40]*/
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->enable_callback_tracebacks = enable;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_sqlite3.adapt as pysqlite_adapt
+
+ obj: object
+ proto: object(c_default='(PyObject *)clinic_state()->PrepareProtocolType') = PrepareProtocolType
+ alt: object = NULL
+ /
+
+Adapt given object to given protocol.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_adapt_impl(PyObject *module, PyObject *obj, PyObject *proto,
+ PyObject *alt)
+/*[clinic end generated code: output=0c3927c5fcd23dd9 input=a53dc9993e81e15f]*/
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+ return pysqlite_microprotocols_adapt(state, obj, proto, alt);
+}
+
+static int converters_init(PyObject* module)
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->converters = PyDict_New();
+ if (state->converters == NULL) {
+ return -1;
+ }
+
+ return PyModule_AddObjectRef(module, "converters", state->converters);
+}
+
+static int
+load_functools_lru_cache(PyObject *module)
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->lru_cache = _PyImport_GetModuleAttrString("functools", "lru_cache");
+ if (state->lru_cache == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyMethodDef module_methods[] = {
+ PYSQLITE_ADAPT_METHODDEF
+ PYSQLITE_COMPLETE_STATEMENT_METHODDEF
+ PYSQLITE_CONNECT_METHODDEF
+ PYSQLITE_ENABLE_CALLBACK_TRACE_METHODDEF
+ PYSQLITE_REGISTER_ADAPTER_METHODDEF
+ PYSQLITE_REGISTER_CONVERTER_METHODDEF
+ {NULL, NULL}
+};
+
+/* SQLite C API result codes. See also:
+ * - https://www.sqlite.org/c3ref/c_abort_rollback.html
+ * - https://sqlite.org/changes.html#version_3_3_8
+ * - https://sqlite.org/changes.html#version_3_7_16
+ * - https://sqlite.org/changes.html#version_3_7_17
+ * - https://sqlite.org/changes.html#version_3_8_0
+ * - https://sqlite.org/changes.html#version_3_8_3
+ * - https://sqlite.org/changes.html#version_3_14
+ *
+ * Note: the SQLite changelogs rarely mention new result codes, so in order to
+ * keep the 'error_codes' table in sync with SQLite, we must manually inspect
+ * sqlite3.h for every release.
+ *
+ * We keep the SQLITE_VERSION_NUMBER checks in order to easily declutter the
+ * code when we adjust the SQLite version requirement.
+ */
+static const struct {
+ const char *name;
+ long value;
+} error_codes[] = {
+#define DECLARE_ERROR_CODE(code) {#code, code}
+ // Primary result code list
+ DECLARE_ERROR_CODE(SQLITE_ABORT),
+ DECLARE_ERROR_CODE(SQLITE_AUTH),
+ DECLARE_ERROR_CODE(SQLITE_BUSY),
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT),
+ DECLARE_ERROR_CODE(SQLITE_CORRUPT),
+ DECLARE_ERROR_CODE(SQLITE_DONE),
+ DECLARE_ERROR_CODE(SQLITE_EMPTY),
+ DECLARE_ERROR_CODE(SQLITE_ERROR),
+ DECLARE_ERROR_CODE(SQLITE_FORMAT),
+ DECLARE_ERROR_CODE(SQLITE_FULL),
+ DECLARE_ERROR_CODE(SQLITE_INTERNAL),
+ DECLARE_ERROR_CODE(SQLITE_INTERRUPT),
+ DECLARE_ERROR_CODE(SQLITE_IOERR),
+ DECLARE_ERROR_CODE(SQLITE_LOCKED),
+ DECLARE_ERROR_CODE(SQLITE_MISMATCH),
+ DECLARE_ERROR_CODE(SQLITE_MISUSE),
+ DECLARE_ERROR_CODE(SQLITE_NOLFS),
+ DECLARE_ERROR_CODE(SQLITE_NOMEM),
+ DECLARE_ERROR_CODE(SQLITE_NOTADB),
+ DECLARE_ERROR_CODE(SQLITE_NOTFOUND),
+ DECLARE_ERROR_CODE(SQLITE_OK),
+ DECLARE_ERROR_CODE(SQLITE_PERM),
+ DECLARE_ERROR_CODE(SQLITE_PROTOCOL),
+ DECLARE_ERROR_CODE(SQLITE_RANGE),
+ DECLARE_ERROR_CODE(SQLITE_READONLY),
+ DECLARE_ERROR_CODE(SQLITE_ROW),
+ DECLARE_ERROR_CODE(SQLITE_SCHEMA),
+ DECLARE_ERROR_CODE(SQLITE_TOOBIG),
+#if SQLITE_VERSION_NUMBER >= 3007017
+ DECLARE_ERROR_CODE(SQLITE_NOTICE),
+ DECLARE_ERROR_CODE(SQLITE_WARNING),
+#endif
+ // Extended result code list
+ DECLARE_ERROR_CODE(SQLITE_ABORT_ROLLBACK),
+ DECLARE_ERROR_CODE(SQLITE_BUSY_RECOVERY),
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN_FULLPATH),
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN_ISDIR),
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN_NOTEMPDIR),
+ DECLARE_ERROR_CODE(SQLITE_CORRUPT_VTAB),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_ACCESS),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_BLOCKED),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_CHECKRESERVEDLOCK),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_CLOSE),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_DELETE),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_DELETE_NOENT),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_DIR_CLOSE),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_DIR_FSYNC),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_FSTAT),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_FSYNC),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_LOCK),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_NOMEM),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_RDLOCK),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_READ),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_SEEK),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_SHMLOCK),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_SHMMAP),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_SHMOPEN),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_SHMSIZE),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_SHORT_READ),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_TRUNCATE),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_UNLOCK),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_WRITE),
+ DECLARE_ERROR_CODE(SQLITE_LOCKED_SHAREDCACHE),
+ DECLARE_ERROR_CODE(SQLITE_READONLY_CANTLOCK),
+ DECLARE_ERROR_CODE(SQLITE_READONLY_RECOVERY),
+#if SQLITE_VERSION_NUMBER >= 3007016
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_CHECK),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_COMMITHOOK),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_FOREIGNKEY),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_FUNCTION),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_NOTNULL),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_PRIMARYKEY),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_TRIGGER),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_UNIQUE),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_VTAB),
+ DECLARE_ERROR_CODE(SQLITE_READONLY_ROLLBACK),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3007017
+ DECLARE_ERROR_CODE(SQLITE_IOERR_MMAP),
+ DECLARE_ERROR_CODE(SQLITE_NOTICE_RECOVER_ROLLBACK),
+ DECLARE_ERROR_CODE(SQLITE_NOTICE_RECOVER_WAL),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3008000
+ DECLARE_ERROR_CODE(SQLITE_BUSY_SNAPSHOT),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_GETTEMPPATH),
+ DECLARE_ERROR_CODE(SQLITE_WARNING_AUTOINDEX),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3008001
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN_CONVPATH),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_CONVPATH),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3008002
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_ROWID),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3008003
+ DECLARE_ERROR_CODE(SQLITE_READONLY_DBMOVED),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3008007
+ DECLARE_ERROR_CODE(SQLITE_AUTH_USER),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3009000
+ DECLARE_ERROR_CODE(SQLITE_IOERR_VNODE),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3010000
+ DECLARE_ERROR_CODE(SQLITE_IOERR_AUTH),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3014001
+ DECLARE_ERROR_CODE(SQLITE_OK_LOAD_PERMANENTLY),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3021000
+ DECLARE_ERROR_CODE(SQLITE_IOERR_BEGIN_ATOMIC),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_COMMIT_ATOMIC),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_ROLLBACK_ATOMIC),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3022000
+ DECLARE_ERROR_CODE(SQLITE_ERROR_MISSING_COLLSEQ),
+ DECLARE_ERROR_CODE(SQLITE_ERROR_RETRY),
+ DECLARE_ERROR_CODE(SQLITE_READONLY_CANTINIT),
+ DECLARE_ERROR_CODE(SQLITE_READONLY_DIRECTORY),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3024000
+ DECLARE_ERROR_CODE(SQLITE_CORRUPT_SEQUENCE),
+ DECLARE_ERROR_CODE(SQLITE_LOCKED_VTAB),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3025000
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN_DIRTYWAL),
+ DECLARE_ERROR_CODE(SQLITE_ERROR_SNAPSHOT),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3031000
+ DECLARE_ERROR_CODE(SQLITE_CANTOPEN_SYMLINK),
+ DECLARE_ERROR_CODE(SQLITE_CONSTRAINT_PINNED),
+ DECLARE_ERROR_CODE(SQLITE_OK_SYMLINK),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3032000
+ DECLARE_ERROR_CODE(SQLITE_BUSY_TIMEOUT),
+ DECLARE_ERROR_CODE(SQLITE_CORRUPT_INDEX),
+ DECLARE_ERROR_CODE(SQLITE_IOERR_DATA),
+#endif
+#if SQLITE_VERSION_NUMBER >= 3034000
+ DECLARE_ERROR_CODE(SQLITE_IOERR_CORRUPTFS),
+#endif
+#undef DECLARE_ERROR_CODE
+ {NULL, 0},
+};
+
+static int
+add_error_constants(PyObject *module)
+{
+ for (int i = 0; error_codes[i].name != NULL; i++) {
+ const char *name = error_codes[i].name;
+ const long value = error_codes[i].value;
+ if (PyModule_AddIntConstant(module, name, value) < 0) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+const char *
+pysqlite_error_name(int rc)
+{
+ for (int i = 0; error_codes[i].name != NULL; i++) {
+ if (error_codes[i].value == rc) {
+ return error_codes[i].name;
+ }
+ }
+ // No error code matched.
+ return NULL;
+}
+
+static int
+add_integer_constants(PyObject *module) {
+#define ADD_INT(ival) \
+ do { \
+ if (PyModule_AddIntConstant(module, #ival, ival) < 0) { \
+ return -1; \
+ } \
+ } while (0); \
+
+ ADD_INT(PARSE_DECLTYPES);
+ ADD_INT(PARSE_COLNAMES);
+ ADD_INT(SQLITE_DENY);
+ ADD_INT(SQLITE_IGNORE);
+ ADD_INT(SQLITE_CREATE_INDEX);
+ ADD_INT(SQLITE_CREATE_TABLE);
+ ADD_INT(SQLITE_CREATE_TEMP_INDEX);
+ ADD_INT(SQLITE_CREATE_TEMP_TABLE);
+ ADD_INT(SQLITE_CREATE_TEMP_TRIGGER);
+ ADD_INT(SQLITE_CREATE_TEMP_VIEW);
+ ADD_INT(SQLITE_CREATE_TRIGGER);
+ ADD_INT(SQLITE_CREATE_VIEW);
+ ADD_INT(SQLITE_DELETE);
+ ADD_INT(SQLITE_DROP_INDEX);
+ ADD_INT(SQLITE_DROP_TABLE);
+ ADD_INT(SQLITE_DROP_TEMP_INDEX);
+ ADD_INT(SQLITE_DROP_TEMP_TABLE);
+ ADD_INT(SQLITE_DROP_TEMP_TRIGGER);
+ ADD_INT(SQLITE_DROP_TEMP_VIEW);
+ ADD_INT(SQLITE_DROP_TRIGGER);
+ ADD_INT(SQLITE_DROP_VIEW);
+ ADD_INT(SQLITE_INSERT);
+ ADD_INT(SQLITE_PRAGMA);
+ ADD_INT(SQLITE_READ);
+ ADD_INT(SQLITE_SELECT);
+ ADD_INT(SQLITE_TRANSACTION);
+ ADD_INT(SQLITE_UPDATE);
+ ADD_INT(SQLITE_ATTACH);
+ ADD_INT(SQLITE_DETACH);
+ ADD_INT(SQLITE_ALTER_TABLE);
+ ADD_INT(SQLITE_REINDEX);
+ ADD_INT(SQLITE_ANALYZE);
+ ADD_INT(SQLITE_CREATE_VTABLE);
+ ADD_INT(SQLITE_DROP_VTABLE);
+ ADD_INT(SQLITE_FUNCTION);
+ ADD_INT(SQLITE_SAVEPOINT);
+#if SQLITE_VERSION_NUMBER >= 3008003
+ ADD_INT(SQLITE_RECURSIVE);
+#endif
+ // Run-time limit categories
+ ADD_INT(SQLITE_LIMIT_LENGTH);
+ ADD_INT(SQLITE_LIMIT_SQL_LENGTH);
+ ADD_INT(SQLITE_LIMIT_COLUMN);
+ ADD_INT(SQLITE_LIMIT_EXPR_DEPTH);
+ ADD_INT(SQLITE_LIMIT_COMPOUND_SELECT);
+ ADD_INT(SQLITE_LIMIT_VDBE_OP);
+ ADD_INT(SQLITE_LIMIT_FUNCTION_ARG);
+ ADD_INT(SQLITE_LIMIT_ATTACHED);
+ ADD_INT(SQLITE_LIMIT_LIKE_PATTERN_LENGTH);
+ ADD_INT(SQLITE_LIMIT_VARIABLE_NUMBER);
+ ADD_INT(SQLITE_LIMIT_TRIGGER_DEPTH);
+#if SQLITE_VERSION_NUMBER >= 3008007
+ ADD_INT(SQLITE_LIMIT_WORKER_THREADS);
+#endif
+
+ /*
+ * Database connection configuration options.
+ * See https://www.sqlite.org/c3ref/c_dbconfig_defensive.html
+ */
+ ADD_INT(SQLITE_DBCONFIG_ENABLE_FKEY);
+ ADD_INT(SQLITE_DBCONFIG_ENABLE_TRIGGER);
+#if SQLITE_VERSION_NUMBER >= 3012002
+ ADD_INT(SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3013000
+ ADD_INT(SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3016000
+ ADD_INT(SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3020000
+ ADD_INT(SQLITE_DBCONFIG_ENABLE_QPSG);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3022000
+ ADD_INT(SQLITE_DBCONFIG_TRIGGER_EQP);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3024000
+ ADD_INT(SQLITE_DBCONFIG_RESET_DATABASE);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3026000
+ ADD_INT(SQLITE_DBCONFIG_DEFENSIVE);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3028000
+ ADD_INT(SQLITE_DBCONFIG_WRITABLE_SCHEMA);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3029000
+ ADD_INT(SQLITE_DBCONFIG_DQS_DDL);
+ ADD_INT(SQLITE_DBCONFIG_DQS_DML);
+ ADD_INT(SQLITE_DBCONFIG_LEGACY_ALTER_TABLE);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3030000
+ ADD_INT(SQLITE_DBCONFIG_ENABLE_VIEW);
+#endif
+#if SQLITE_VERSION_NUMBER >= 3031000
+ ADD_INT(SQLITE_DBCONFIG_LEGACY_FILE_FORMAT);
+ ADD_INT(SQLITE_DBCONFIG_TRUSTED_SCHEMA);
+#endif
+#undef ADD_INT
+ return 0;
+}
+
+/* Convert SQLite default threading mode (as set by the compile-time constant
+ * SQLITE_THREADSAFE) to the corresponding DB-API 2.0 (PEP 249) threadsafety
+ * level. */
+static int
+get_threadsafety(pysqlite_state *state)
+{
+ int mode = sqlite3_threadsafe();
+ switch (mode) {
+ case 0: // Single-thread mode; threads may not share the module.
+ return 0;
+ case 1: // Serialized mode; threads may share the module,
+ return 3; // connections, and cursors.
+ case 2: // Multi-thread mode; threads may share the module, but not
+ return 1; // connections.
+ default:
+ PyErr_Format(state->InterfaceError,
+ "Unable to interpret SQLite threadsafety mode. Got %d, "
+ "expected 0, 1, or 2", mode);
+ return -1;
+ }
+}
+
+static int
+module_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+
+ // Exceptions
+ Py_VISIT(state->DataError);
+ Py_VISIT(state->DatabaseError);
+ Py_VISIT(state->Error);
+ Py_VISIT(state->IntegrityError);
+ Py_VISIT(state->InterfaceError);
+ Py_VISIT(state->InternalError);
+ Py_VISIT(state->NotSupportedError);
+ Py_VISIT(state->OperationalError);
+ Py_VISIT(state->ProgrammingError);
+ Py_VISIT(state->Warning);
+
+ // Types
+ Py_VISIT(state->BlobType);
+ Py_VISIT(state->ConnectionType);
+ Py_VISIT(state->CursorType);
+ Py_VISIT(state->PrepareProtocolType);
+ Py_VISIT(state->RowType);
+ Py_VISIT(state->StatementType);
+
+ // Misc
+ Py_VISIT(state->converters);
+ Py_VISIT(state->lru_cache);
+ Py_VISIT(state->psyco_adapters);
+
+ return 0;
+}
+
+static int
+module_clear(PyObject *module)
+{
+ pysqlite_state *state = pysqlite_get_state(module);
+
+ // Exceptions
+ Py_CLEAR(state->DataError);
+ Py_CLEAR(state->DatabaseError);
+ Py_CLEAR(state->Error);
+ Py_CLEAR(state->IntegrityError);
+ Py_CLEAR(state->InterfaceError);
+ Py_CLEAR(state->InternalError);
+ Py_CLEAR(state->NotSupportedError);
+ Py_CLEAR(state->OperationalError);
+ Py_CLEAR(state->ProgrammingError);
+ Py_CLEAR(state->Warning);
+
+ // Types
+ Py_CLEAR(state->BlobType);
+ Py_CLEAR(state->ConnectionType);
+ Py_CLEAR(state->CursorType);
+ Py_CLEAR(state->PrepareProtocolType);
+ Py_CLEAR(state->RowType);
+ Py_CLEAR(state->StatementType);
+
+ // Misc
+ Py_CLEAR(state->converters);
+ Py_CLEAR(state->lru_cache);
+ Py_CLEAR(state->psyco_adapters);
+
+ // Interned strings
+ Py_CLEAR(state->str___adapt__);
+ Py_CLEAR(state->str___conform__);
+ Py_CLEAR(state->str_executescript);
+ Py_CLEAR(state->str_finalize);
+ Py_CLEAR(state->str_inverse);
+ Py_CLEAR(state->str_step);
+ Py_CLEAR(state->str_upper);
+ Py_CLEAR(state->str_value);
+
+ return 0;
+}
+
+static void
+module_free(void *module)
+{
+ module_clear((PyObject *)module);
+}
+
+#define ADD_TYPE(module, type) \
+do { \
+ if (PyModule_AddType(module, type) < 0) { \
+ goto error; \
+ } \
+} while (0)
+
+#define ADD_EXCEPTION(module, state, exc, base) \
+do { \
+ state->exc = PyErr_NewException(MODULE_NAME "." #exc, base, NULL); \
+ if (state->exc == NULL) { \
+ goto error; \
+ } \
+ ADD_TYPE(module, (PyTypeObject *)state->exc); \
+} while (0)
+
+#define ADD_INTERNED(state, string) \
+do { \
+ PyObject *tmp = PyUnicode_InternFromString(#string); \
+ if (tmp == NULL) { \
+ goto error; \
+ } \
+ state->str_ ## string = tmp; \
+} while (0)
+
+static int
+module_exec(PyObject *module)
+{
+ if (sqlite3_libversion_number() < 3007015) {
+ PyErr_SetString(PyExc_ImportError, MODULE_NAME ": SQLite 3.7.15 or higher required");
+ return -1;
+ }
+
+ int rc = sqlite3_initialize();
+ if (rc != SQLITE_OK) {
+ PyErr_SetString(PyExc_ImportError, sqlite3_errstr(rc));
+ return -1;
+ }
+
+ if ((pysqlite_row_setup_types(module) < 0) ||
+ (pysqlite_cursor_setup_types(module) < 0) ||
+ (pysqlite_connection_setup_types(module) < 0) ||
+ (pysqlite_statement_setup_types(module) < 0) ||
+ (pysqlite_prepare_protocol_setup_types(module) < 0) ||
+ (pysqlite_blob_setup_types(module) < 0)
+ ) {
+ goto error;
+ }
+
+ pysqlite_state *state = pysqlite_get_state(module);
+ ADD_TYPE(module, state->BlobType);
+ ADD_TYPE(module, state->ConnectionType);
+ ADD_TYPE(module, state->CursorType);
+ ADD_TYPE(module, state->PrepareProtocolType);
+ ADD_TYPE(module, state->RowType);
+
+ /*** Create DB-API Exception hierarchy */
+ ADD_EXCEPTION(module, state, Error, PyExc_Exception);
+ ADD_EXCEPTION(module, state, Warning, PyExc_Exception);
+
+ /* Error subclasses */
+ ADD_EXCEPTION(module, state, InterfaceError, state->Error);
+ ADD_EXCEPTION(module, state, DatabaseError, state->Error);
+
+ /* DatabaseError subclasses */
+ ADD_EXCEPTION(module, state, InternalError, state->DatabaseError);
+ ADD_EXCEPTION(module, state, OperationalError, state->DatabaseError);
+ ADD_EXCEPTION(module, state, ProgrammingError, state->DatabaseError);
+ ADD_EXCEPTION(module, state, IntegrityError, state->DatabaseError);
+ ADD_EXCEPTION(module, state, DataError, state->DatabaseError);
+ ADD_EXCEPTION(module, state, NotSupportedError, state->DatabaseError);
+
+ /* Add interned strings */
+ ADD_INTERNED(state, __adapt__);
+ ADD_INTERNED(state, __conform__);
+ ADD_INTERNED(state, executescript);
+ ADD_INTERNED(state, finalize);
+ ADD_INTERNED(state, inverse);
+ ADD_INTERNED(state, step);
+ ADD_INTERNED(state, upper);
+ ADD_INTERNED(state, value);
+
+ /* Set error constants */
+ if (add_error_constants(module) < 0) {
+ goto error;
+ }
+
+ /* Set integer constants */
+ if (add_integer_constants(module) < 0) {
+ goto error;
+ }
+
+ if (PyModule_AddStringConstant(module, "_deprecated_version", PYSQLITE_VERSION) < 0) {
+ goto error;
+ }
+
+ if (PyModule_AddStringConstant(module, "sqlite_version", sqlite3_libversion())) {
+ goto error;
+ }
+
+ if (PyModule_AddIntMacro(module, LEGACY_TRANSACTION_CONTROL) < 0) {
+ goto error;
+ }
+
+ int threadsafety = get_threadsafety(state);
+ if (threadsafety < 0) {
+ goto error;
+ }
+ if (PyModule_AddIntConstant(module, "threadsafety", threadsafety) < 0) {
+ goto error;
+ }
+
+ /* initialize microprotocols layer */
+ if (pysqlite_microprotocols_init(module) < 0) {
+ goto error;
+ }
+
+ /* initialize the default converters */
+ if (converters_init(module) < 0) {
+ goto error;
+ }
+
+ if (load_functools_lru_cache(module) < 0) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ sqlite3_shutdown();
+ return -1;
+}
+
+static struct PyModuleDef_Slot module_slots[] = {
+ {Py_mod_exec, module_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+struct PyModuleDef _sqlite3module = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_sqlite3",
+ .m_size = sizeof(pysqlite_state),
+ .m_methods = module_methods,
+ .m_slots = module_slots,
+ .m_traverse = module_traverse,
+ .m_clear = module_clear,
+ .m_free = module_free,
+};
+
+PyMODINIT_FUNC
+PyInit__sqlite3(void)
+{
+ return PyModuleDef_Init(&_sqlite3module);
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/module.h b/contrib/tools/python3/Modules/_sqlite/module.h
new file mode 100644
index 00000000000..daa22091d38
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/module.h
@@ -0,0 +1,99 @@
+/* module.h - definitions for the module
+ *
+ * Copyright (C) 2004-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_MODULE_H
+#define PYSQLITE_MODULE_H
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+#define LEGACY_TRANSACTION_CONTROL -1
+
+#define PYSQLITE_VERSION "2.6.0"
+#define MODULE_NAME "sqlite3"
+
+typedef struct {
+ PyObject *DataError;
+ PyObject *DatabaseError;
+ PyObject *Error;
+ PyObject *IntegrityError;
+ PyObject *InterfaceError;
+ PyObject *InternalError;
+ PyObject *NotSupportedError;
+ PyObject *OperationalError;
+ PyObject *ProgrammingError;
+ PyObject *Warning;
+
+
+ /* A dictionary, mapping column types (INTEGER, VARCHAR, etc.) to converter
+ * functions, that convert the SQL value to the appropriate Python value.
+ * The key is uppercase.
+ */
+ PyObject *converters;
+
+ PyObject *lru_cache;
+ PyObject *psyco_adapters; // The adapters registry
+ int BaseTypeAdapted;
+ int enable_callback_tracebacks;
+
+ PyTypeObject *BlobType;
+ PyTypeObject *ConnectionType;
+ PyTypeObject *CursorType;
+ PyTypeObject *PrepareProtocolType;
+ PyTypeObject *RowType;
+ PyTypeObject *StatementType;
+
+ /* Pointers to interned strings */
+ PyObject *str___adapt__;
+ PyObject *str___conform__;
+ PyObject *str_executescript;
+ PyObject *str_finalize;
+ PyObject *str_inverse;
+ PyObject *str_step;
+ PyObject *str_upper;
+ PyObject *str_value;
+} pysqlite_state;
+
+extern pysqlite_state pysqlite_global_state;
+
+static inline pysqlite_state *
+pysqlite_get_state(PyObject *module)
+{
+ pysqlite_state *state = (pysqlite_state *)PyModule_GetState(module);
+ assert(state != NULL);
+ return state;
+}
+
+extern struct PyModuleDef _sqlite3module;
+static inline pysqlite_state *
+pysqlite_get_state_by_type(PyTypeObject *tp)
+{
+ PyObject *module = PyType_GetModuleByDef(tp, &_sqlite3module);
+ assert(module != NULL);
+ return pysqlite_get_state(module);
+}
+
+extern const char *pysqlite_error_name(int rc);
+
+#define PARSE_DECLTYPES 1
+#define PARSE_COLNAMES 2
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/prepare_protocol.c b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.c
new file mode 100644
index 00000000000..44533225665
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.c
@@ -0,0 +1,77 @@
+/* prepare_protocol.c - the protocol for preparing values for SQLite
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "prepare_protocol.h"
+
+static int
+pysqlite_prepare_protocol_init(pysqlite_PrepareProtocol *self, PyObject *args,
+ PyObject *kwargs)
+{
+ return 0;
+}
+
+static int
+pysqlite_prepare_protocol_traverse(PyObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+pysqlite_prepare_protocol_dealloc(pysqlite_PrepareProtocol *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+PyDoc_STRVAR(doc, "PEP 246 style object adaption protocol type.");
+
+static PyType_Slot type_slots[] = {
+ {Py_tp_dealloc, pysqlite_prepare_protocol_dealloc},
+ {Py_tp_init, pysqlite_prepare_protocol_init},
+ {Py_tp_traverse, pysqlite_prepare_protocol_traverse},
+ {Py_tp_doc, (void *)doc},
+ {0, NULL},
+};
+
+static PyType_Spec type_spec = {
+ .name = MODULE_NAME ".PrepareProtocol",
+ .basicsize = sizeof(pysqlite_PrepareProtocol),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = type_slots,
+};
+
+int
+pysqlite_prepare_protocol_setup_types(PyObject *module)
+{
+ PyObject *type = PyType_FromModuleAndSpec(module, &type_spec, NULL);
+ if (type == NULL) {
+ return -1;
+ }
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->PrepareProtocolType = (PyTypeObject *)type;
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/prepare_protocol.h b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.h
new file mode 100644
index 00000000000..afc55a8c1c4
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/prepare_protocol.h
@@ -0,0 +1,35 @@
+/* prepare_protocol.h - the protocol for preparing values for SQLite
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_PREPARE_PROTOCOL_H
+#define PYSQLITE_PREPARE_PROTOCOL_H
+#include "module.h"
+
+typedef struct
+{
+ PyObject_HEAD
+} pysqlite_PrepareProtocol;
+
+int pysqlite_prepare_protocol_setup_types(PyObject *module);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/row.c b/contrib/tools/python3/Modules/_sqlite/row.c
new file mode 100644
index 00000000000..1a1943285ce
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/row.c
@@ -0,0 +1,276 @@
+/* row.c - an enhanced tuple for database rows
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "row.h"
+#include "cursor.h"
+
+#define clinic_state() (pysqlite_get_state_by_type(type))
+#include "clinic/row.c.h"
+#undef clinic_state
+
+/*[clinic input]
+module _sqlite3
+class _sqlite3.Row "pysqlite_Row *" "clinic_state()->RowType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=966c53403d7f3a40]*/
+
+static int
+row_clear(pysqlite_Row *self)
+{
+ Py_CLEAR(self->data);
+ Py_CLEAR(self->description);
+ return 0;
+}
+
+static int
+row_traverse(pysqlite_Row *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->data);
+ Py_VISIT(self->description);
+ return 0;
+}
+
+static void
+pysqlite_row_dealloc(PyObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ tp->tp_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+@classmethod
+_sqlite3.Row.__new__ as pysqlite_row_new
+
+ cursor: object(type='pysqlite_Cursor *', subclass_of='clinic_state()->CursorType')
+ data: object(subclass_of='&PyTuple_Type')
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor,
+ PyObject *data)
+/*[clinic end generated code: output=10d58b09a819a4c1 input=b9e954ca31345dbf]*/
+{
+ pysqlite_Row *self;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+
+ self = (pysqlite_Row *) type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ self->data = Py_NewRef(data);
+ self->description = Py_NewRef(cursor->description);
+
+ return (PyObject *) self;
+}
+
+PyObject* pysqlite_row_item(pysqlite_Row* self, Py_ssize_t idx)
+{
+ PyObject *item = PyTuple_GetItem(self->data, idx);
+ return Py_XNewRef(item);
+}
+
+static int
+equal_ignore_case(PyObject *left, PyObject *right)
+{
+ int eq = PyObject_RichCompareBool(left, right, Py_EQ);
+ if (eq) { /* equal or error */
+ return eq;
+ }
+ if (!PyUnicode_Check(left) || !PyUnicode_Check(right)) {
+ return 0;
+ }
+ if (!PyUnicode_IS_ASCII(left) || !PyUnicode_IS_ASCII(right)) {
+ return 0;
+ }
+
+ Py_ssize_t len = PyUnicode_GET_LENGTH(left);
+ if (PyUnicode_GET_LENGTH(right) != len) {
+ return 0;
+ }
+ const Py_UCS1 *p1 = PyUnicode_1BYTE_DATA(left);
+ const Py_UCS1 *p2 = PyUnicode_1BYTE_DATA(right);
+ for (; len; len--, p1++, p2++) {
+ if (Py_TOLOWER(*p1) != Py_TOLOWER(*p2)) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static PyObject *
+pysqlite_row_subscript(pysqlite_Row *self, PyObject *idx)
+{
+ Py_ssize_t _idx;
+ Py_ssize_t nitems, i;
+
+ if (PyLong_Check(idx)) {
+ _idx = PyNumber_AsSsize_t(idx, PyExc_IndexError);
+ if (_idx == -1 && PyErr_Occurred())
+ return NULL;
+ if (_idx < 0)
+ _idx += PyTuple_GET_SIZE(self->data);
+
+ PyObject *item = PyTuple_GetItem(self->data, _idx);
+ return Py_XNewRef(item);
+ } else if (PyUnicode_Check(idx)) {
+ nitems = PyTuple_Size(self->description);
+
+ for (i = 0; i < nitems; i++) {
+ PyObject *obj;
+ obj = PyTuple_GET_ITEM(self->description, i);
+ obj = PyTuple_GET_ITEM(obj, 0);
+ int eq = equal_ignore_case(idx, obj);
+ if (eq < 0) {
+ return NULL;
+ }
+ if (eq) {
+ /* found item */
+ PyObject *item = PyTuple_GetItem(self->data, i);
+ return Py_XNewRef(item);
+ }
+ }
+
+ PyErr_SetString(PyExc_IndexError, "No item with that key");
+ return NULL;
+ }
+ else if (PySlice_Check(idx)) {
+ return PyObject_GetItem(self->data, idx);
+ }
+ else {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or string");
+ return NULL;
+ }
+}
+
+static Py_ssize_t
+pysqlite_row_length(pysqlite_Row* self)
+{
+ return PyTuple_GET_SIZE(self->data);
+}
+
+/*[clinic input]
+_sqlite3.Row.keys as pysqlite_row_keys
+
+Returns the keys of the row.
+[clinic start generated code]*/
+
+static PyObject *
+pysqlite_row_keys_impl(pysqlite_Row *self)
+/*[clinic end generated code: output=efe3dfb3af6edc07 input=7549a122827c5563]*/
+{
+ PyObject* list;
+ Py_ssize_t nitems, i;
+
+ list = PyList_New(0);
+ if (!list) {
+ return NULL;
+ }
+ nitems = PyTuple_Size(self->description);
+
+ for (i = 0; i < nitems; i++) {
+ if (PyList_Append(list, PyTuple_GET_ITEM(PyTuple_GET_ITEM(self->description, i), 0)) != 0) {
+ Py_DECREF(list);
+ return NULL;
+ }
+ }
+
+ return list;
+}
+
+static PyObject* pysqlite_iter(pysqlite_Row* self)
+{
+ return PyObject_GetIter(self->data);
+}
+
+static Py_hash_t pysqlite_row_hash(pysqlite_Row *self)
+{
+ return PyObject_Hash(self->description) ^ PyObject_Hash(self->data);
+}
+
+static PyObject* pysqlite_row_richcompare(pysqlite_Row *self, PyObject *_other, int opid)
+{
+ if (opid != Py_EQ && opid != Py_NE)
+ Py_RETURN_NOTIMPLEMENTED;
+
+ pysqlite_state *state = pysqlite_get_state_by_type(Py_TYPE(self));
+ if (PyObject_TypeCheck(_other, state->RowType)) {
+ pysqlite_Row *other = (pysqlite_Row *)_other;
+ int eq = PyObject_RichCompareBool(self->description, other->description, Py_EQ);
+ if (eq < 0) {
+ return NULL;
+ }
+ if (eq) {
+ return PyObject_RichCompare(self->data, other->data, opid);
+ }
+ return PyBool_FromLong(opid != Py_EQ);
+ }
+ Py_RETURN_NOTIMPLEMENTED;
+}
+
+static PyMethodDef row_methods[] = {
+ PYSQLITE_ROW_KEYS_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot row_slots[] = {
+ {Py_tp_dealloc, pysqlite_row_dealloc},
+ {Py_tp_hash, pysqlite_row_hash},
+ {Py_tp_methods, row_methods},
+ {Py_tp_richcompare, pysqlite_row_richcompare},
+ {Py_tp_iter, pysqlite_iter},
+ {Py_mp_length, pysqlite_row_length},
+ {Py_mp_subscript, pysqlite_row_subscript},
+ {Py_sq_length, pysqlite_row_length},
+ {Py_sq_item, pysqlite_row_item},
+ {Py_tp_new, pysqlite_row_new},
+ {Py_tp_traverse, row_traverse},
+ {Py_tp_clear, row_clear},
+ {0, NULL},
+};
+
+static PyType_Spec row_spec = {
+ .name = MODULE_NAME ".Row",
+ .basicsize = sizeof(pysqlite_Row),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = row_slots,
+};
+
+int
+pysqlite_row_setup_types(PyObject *module)
+{
+ PyObject *type = PyType_FromModuleAndSpec(module, &row_spec, NULL);
+ if (type == NULL) {
+ return -1;
+ }
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->RowType = (PyTypeObject *)type;
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/row.h b/contrib/tools/python3/Modules/_sqlite/row.h
new file mode 100644
index 00000000000..b5190981758
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/row.h
@@ -0,0 +1,38 @@
+/* row.h - an enhanced tuple for database rows
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_ROW_H
+#define PYSQLITE_ROW_H
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+typedef struct _Row
+{
+ PyObject_HEAD
+ PyObject* data;
+ PyObject* description;
+} pysqlite_Row;
+
+int pysqlite_row_setup_types(PyObject *module);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/statement.c b/contrib/tools/python3/Modules/_sqlite/statement.c
new file mode 100644
index 00000000000..229bfc3b504
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/statement.c
@@ -0,0 +1,205 @@
+/* statement.c - the statement type
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "connection.h"
+#include "statement.h"
+#include "util.h"
+
+/* prototypes */
+static const char *lstrip_sql(const char *sql);
+
+pysqlite_Statement *
+pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
+{
+ pysqlite_state *state = connection->state;
+ assert(PyUnicode_Check(sql));
+ Py_ssize_t size;
+ const char *sql_cstr = PyUnicode_AsUTF8AndSize(sql, &size);
+ if (sql_cstr == NULL) {
+ return NULL;
+ }
+
+ sqlite3 *db = connection->db;
+ int max_length = sqlite3_limit(db, SQLITE_LIMIT_SQL_LENGTH, -1);
+ if (size > max_length) {
+ PyErr_SetString(connection->DataError,
+ "query string is too large");
+ return NULL;
+ }
+ if (strlen(sql_cstr) != (size_t)size) {
+ PyErr_SetString(connection->ProgrammingError,
+ "the query contains a null character");
+ return NULL;
+ }
+
+ sqlite3_stmt *stmt;
+ const char *tail;
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ rc = sqlite3_prepare_v2(db, sql_cstr, (int)size + 1, &stmt, &tail);
+ Py_END_ALLOW_THREADS
+
+ if (rc != SQLITE_OK) {
+ _pysqlite_seterror(state, db);
+ return NULL;
+ }
+
+ if (lstrip_sql(tail) != NULL) {
+ PyErr_SetString(connection->ProgrammingError,
+ "You can only execute one statement at a time.");
+ goto error;
+ }
+
+ /* Determine if the statement is a DML statement.
+ SELECT is the only exception. See #9924. */
+ int is_dml = 0;
+ const char *p = lstrip_sql(sql_cstr);
+ if (p != NULL) {
+ is_dml = (PyOS_strnicmp(p, "insert", 6) == 0)
+ || (PyOS_strnicmp(p, "update", 6) == 0)
+ || (PyOS_strnicmp(p, "delete", 6) == 0)
+ || (PyOS_strnicmp(p, "replace", 7) == 0);
+ }
+
+ pysqlite_Statement *self = PyObject_GC_New(pysqlite_Statement,
+ state->StatementType);
+ if (self == NULL) {
+ goto error;
+ }
+
+ self->st = stmt;
+ self->is_dml = is_dml;
+
+ PyObject_GC_Track(self);
+ return self;
+
+error:
+ (void)sqlite3_finalize(stmt);
+ return NULL;
+}
+
+static void
+stmt_dealloc(pysqlite_Statement *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ if (self->st) {
+ Py_BEGIN_ALLOW_THREADS
+ sqlite3_finalize(self->st);
+ Py_END_ALLOW_THREADS
+ self->st = 0;
+ }
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static int
+stmt_traverse(pysqlite_Statement *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+/*
+ * Strip leading whitespace and comments from incoming SQL (null terminated C
+ * string) and return a pointer to the first non-whitespace, non-comment
+ * character.
+ *
+ * This is used to check if somebody tries to execute more than one SQL query
+ * with one execute()/executemany() command, which the DB-API don't allow.
+ *
+ * It is also used to harden DML query detection.
+ */
+static inline const char *
+lstrip_sql(const char *sql)
+{
+ // This loop is borrowed from the SQLite source code.
+ for (const char *pos = sql; *pos; pos++) {
+ switch (*pos) {
+ case ' ':
+ case '\t':
+ case '\f':
+ case '\n':
+ case '\r':
+ // Skip whitespace.
+ break;
+ case '-':
+ // Skip line comments.
+ if (pos[1] == '-') {
+ pos += 2;
+ while (pos[0] && pos[0] != '\n') {
+ pos++;
+ }
+ if (pos[0] == '\0') {
+ return NULL;
+ }
+ continue;
+ }
+ return pos;
+ case '/':
+ // Skip C style comments.
+ if (pos[1] == '*') {
+ pos += 2;
+ while (pos[0] && (pos[0] != '*' || pos[1] != '/')) {
+ pos++;
+ }
+ if (pos[0] == '\0') {
+ return NULL;
+ }
+ pos++;
+ continue;
+ }
+ return pos;
+ default:
+ return pos;
+ }
+ }
+
+ return NULL;
+}
+
+static PyType_Slot stmt_slots[] = {
+ {Py_tp_dealloc, stmt_dealloc},
+ {Py_tp_traverse, stmt_traverse},
+ {0, NULL},
+};
+
+static PyType_Spec stmt_spec = {
+ .name = MODULE_NAME ".Statement",
+ .basicsize = sizeof(pysqlite_Statement),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = stmt_slots,
+};
+
+int
+pysqlite_statement_setup_types(PyObject *module)
+{
+ PyObject *type = PyType_FromModuleAndSpec(module, &stmt_spec, NULL);
+ if (type == NULL) {
+ return -1;
+ }
+ pysqlite_state *state = pysqlite_get_state(module);
+ state->StatementType = (PyTypeObject *)type;
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/statement.h b/contrib/tools/python3/Modules/_sqlite/statement.h
new file mode 100644
index 00000000000..11a6464b1a1
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/statement.h
@@ -0,0 +1,43 @@
+/* statement.h - definitions for the statement type
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_STATEMENT_H
+#define PYSQLITE_STATEMENT_H
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+#include "connection.h"
+#include "sqlite3.h"
+
+typedef struct
+{
+ PyObject_HEAD
+ sqlite3_stmt* st;
+ int is_dml;
+} pysqlite_Statement;
+
+pysqlite_Statement *pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql);
+
+int pysqlite_statement_setup_types(PyObject *module);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/util.c b/contrib/tools/python3/Modules/_sqlite/util.c
new file mode 100644
index 00000000000..2b3bbfefa3c
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/util.c
@@ -0,0 +1,167 @@
+/* util.c - various utility functions
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#include "module.h"
+#include "connection.h"
+
+// Returns non-NULL if a new exception should be raised
+static PyObject *
+get_exception_class(pysqlite_state *state, int errorcode)
+{
+ switch (errorcode) {
+ case SQLITE_OK:
+ PyErr_Clear();
+ return NULL;
+ case SQLITE_INTERNAL:
+ case SQLITE_NOTFOUND:
+ return state->InternalError;
+ case SQLITE_NOMEM:
+ return PyErr_NoMemory();
+ case SQLITE_ERROR:
+ case SQLITE_PERM:
+ case SQLITE_ABORT:
+ case SQLITE_BUSY:
+ case SQLITE_LOCKED:
+ case SQLITE_READONLY:
+ case SQLITE_INTERRUPT:
+ case SQLITE_IOERR:
+ case SQLITE_FULL:
+ case SQLITE_CANTOPEN:
+ case SQLITE_PROTOCOL:
+ case SQLITE_EMPTY:
+ case SQLITE_SCHEMA:
+ return state->OperationalError;
+ case SQLITE_CORRUPT:
+ return state->DatabaseError;
+ case SQLITE_TOOBIG:
+ return state->DataError;
+ case SQLITE_CONSTRAINT:
+ case SQLITE_MISMATCH:
+ return state->IntegrityError;
+ case SQLITE_MISUSE:
+ case SQLITE_RANGE:
+ return state->InterfaceError;
+ default:
+ return state->DatabaseError;
+ }
+}
+
+static void
+raise_exception(PyObject *type, int errcode, const char *errmsg)
+{
+ PyObject *exc = NULL;
+ PyObject *args[] = { PyUnicode_FromString(errmsg), };
+ if (args[0] == NULL) {
+ goto exit;
+ }
+ exc = PyObject_Vectorcall(type, args, 1, NULL);
+ Py_DECREF(args[0]);
+ if (exc == NULL) {
+ goto exit;
+ }
+
+ PyObject *code = PyLong_FromLong(errcode);
+ if (code == NULL) {
+ goto exit;
+ }
+ int rc = PyObject_SetAttrString(exc, "sqlite_errorcode", code);
+ Py_DECREF(code);
+ if (rc < 0) {
+ goto exit;
+ }
+
+ const char *error_name = pysqlite_error_name(errcode);
+ PyObject *name;
+ if (error_name) {
+ name = PyUnicode_FromString(error_name);
+ }
+ else {
+ name = PyUnicode_InternFromString("unknown");
+ }
+ if (name == NULL) {
+ goto exit;
+ }
+ rc = PyObject_SetAttrString(exc, "sqlite_errorname", name);
+ Py_DECREF(name);
+ if (rc < 0) {
+ goto exit;
+ }
+
+ PyErr_SetObject(type, exc);
+
+exit:
+ Py_XDECREF(exc);
+}
+
+/**
+ * Checks the SQLite error code and sets the appropriate DB-API exception.
+ * Returns the error code (0 means no error occurred).
+ */
+int
+_pysqlite_seterror(pysqlite_state *state, sqlite3 *db)
+{
+ int errorcode = sqlite3_errcode(db);
+ PyObject *exc_class = get_exception_class(state, errorcode);
+ if (exc_class == NULL) {
+ // No new exception need be raised; just pass the error code
+ return errorcode;
+ }
+
+ /* Create and set the exception. */
+ int extended_errcode = sqlite3_extended_errcode(db);
+ const char *errmsg = sqlite3_errmsg(db);
+ raise_exception(exc_class, extended_errcode, errmsg);
+ return extended_errcode;
+}
+
+#ifdef WORDS_BIGENDIAN
+# define IS_LITTLE_ENDIAN 0
+#else
+# define IS_LITTLE_ENDIAN 1
+#endif
+
+sqlite_int64
+_pysqlite_long_as_int64(PyObject * py_val)
+{
+ int overflow;
+ long long value = PyLong_AsLongLongAndOverflow(py_val, &overflow);
+ if (value == -1 && PyErr_Occurred())
+ return -1;
+ if (!overflow) {
+# if SIZEOF_LONG_LONG > 8
+ if (-0x8000000000000000LL <= value && value <= 0x7FFFFFFFFFFFFFFFLL)
+# endif
+ return value;
+ }
+ else if (sizeof(value) < sizeof(sqlite_int64)) {
+ sqlite_int64 int64val;
+ if (_PyLong_AsByteArray((PyLongObject *)py_val,
+ (unsigned char *)&int64val, sizeof(int64val),
+ IS_LITTLE_ENDIAN, 1 /* signed */) >= 0) {
+ return int64val;
+ }
+ }
+ PyErr_SetString(PyExc_OverflowError,
+ "Python int too large to convert to SQLite INTEGER");
+ return -1;
+}
diff --git a/contrib/tools/python3/Modules/_sqlite/util.h b/contrib/tools/python3/Modules/_sqlite/util.h
new file mode 100644
index 00000000000..a22bcd82d2a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/util.h
@@ -0,0 +1,40 @@
+/* util.h - various utility functions
+ *
+ * Copyright (C) 2005-2010 Gerhard Häring <[email protected]>
+ *
+ * This file is part of pysqlite.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ */
+
+#ifndef PYSQLITE_UTIL_H
+#define PYSQLITE_UTIL_H
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pythread.h"
+#include "sqlite3.h"
+#include "connection.h"
+
+/**
+ * Checks the SQLite error code and sets the appropriate DB-API exception.
+ * Returns the error code (0 means no error occurred).
+ */
+int _pysqlite_seterror(pysqlite_state *state, sqlite3 *db);
+
+sqlite_int64 _pysqlite_long_as_int64(PyObject * value);
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sqlite/ya.make b/contrib/tools/python3/Modules/_sqlite/ya.make
new file mode 100644
index 00000000000..c8e770686f0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sqlite/ya.make
@@ -0,0 +1,47 @@
+# Generated by devtools/yamaker.
+
+LIBRARY()
+
+VERSION(3.12.2)
+
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
+
+LICENSE(Python-2.0)
+
+PEERDIR(
+ contrib/libs/sqlite3
+)
+
+ADDINCL(
+ contrib/libs/sqlite3
+ contrib/tools/python3/Include
+ contrib/tools/python3/Include/internal
+)
+
+PYTHON3_ADDINCL()
+
+NO_COMPILER_WARNINGS()
+
+NO_RUNTIME()
+
+CFLAGS(
+ -DMODULE_NAME=sqlite3
+)
+
+SRCS(
+ blob.c
+ connection.c
+ cursor.c
+ microprotocols.c
+ module.c
+ prepare_protocol.c
+ row.c
+ statement.c
+ util.c
+)
+
+PY_REGISTER(
+ _sqlite3
+)
+
+END()
diff --git a/contrib/tools/python3/Modules/_sre/clinic/sre.c.h b/contrib/tools/python3/Modules/_sre/clinic/sre.c.h
new file mode 100644
index 00000000000..529c634e76d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sre/clinic/sre.c.h
@@ -0,0 +1,1463 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_sre_getcodesize__doc__,
+"getcodesize($module, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_GETCODESIZE_METHODDEF \
+ {"getcodesize", (PyCFunction)_sre_getcodesize, METH_NOARGS, _sre_getcodesize__doc__},
+
+static int
+_sre_getcodesize_impl(PyObject *module);
+
+static PyObject *
+_sre_getcodesize(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _sre_getcodesize_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_ascii_iscased__doc__,
+"ascii_iscased($module, character, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_ASCII_ISCASED_METHODDEF \
+ {"ascii_iscased", (PyCFunction)_sre_ascii_iscased, METH_O, _sre_ascii_iscased__doc__},
+
+static int
+_sre_ascii_iscased_impl(PyObject *module, int character);
+
+static PyObject *
+_sre_ascii_iscased(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int character;
+ int _return_value;
+
+ character = _PyLong_AsInt(arg);
+ if (character == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = _sre_ascii_iscased_impl(module, character);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_unicode_iscased__doc__,
+"unicode_iscased($module, character, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_UNICODE_ISCASED_METHODDEF \
+ {"unicode_iscased", (PyCFunction)_sre_unicode_iscased, METH_O, _sre_unicode_iscased__doc__},
+
+static int
+_sre_unicode_iscased_impl(PyObject *module, int character);
+
+static PyObject *
+_sre_unicode_iscased(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int character;
+ int _return_value;
+
+ character = _PyLong_AsInt(arg);
+ if (character == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = _sre_unicode_iscased_impl(module, character);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_ascii_tolower__doc__,
+"ascii_tolower($module, character, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_ASCII_TOLOWER_METHODDEF \
+ {"ascii_tolower", (PyCFunction)_sre_ascii_tolower, METH_O, _sre_ascii_tolower__doc__},
+
+static int
+_sre_ascii_tolower_impl(PyObject *module, int character);
+
+static PyObject *
+_sre_ascii_tolower(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int character;
+ int _return_value;
+
+ character = _PyLong_AsInt(arg);
+ if (character == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = _sre_ascii_tolower_impl(module, character);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_unicode_tolower__doc__,
+"unicode_tolower($module, character, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_UNICODE_TOLOWER_METHODDEF \
+ {"unicode_tolower", (PyCFunction)_sre_unicode_tolower, METH_O, _sre_unicode_tolower__doc__},
+
+static int
+_sre_unicode_tolower_impl(PyObject *module, int character);
+
+static PyObject *
+_sre_unicode_tolower(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int character;
+ int _return_value;
+
+ character = _PyLong_AsInt(arg);
+ if (character == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = _sre_unicode_tolower_impl(module, character);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_match__doc__,
+"match($self, /, string, pos=0, endpos=sys.maxsize)\n"
+"--\n"
+"\n"
+"Matches zero or more characters at the beginning of the string.");
+
+#define _SRE_SRE_PATTERN_MATCH_METHODDEF \
+ {"match", _PyCFunction_CAST(_sre_SRE_Pattern_match), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_match__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_match_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos);
+
+static PyObject *
+_sre_SRE_Pattern_match(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "match",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t pos = 0;
+ Py_ssize_t endpos = PY_SSIZE_T_MAX;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ endpos = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_match_impl(self, cls, string, pos, endpos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_fullmatch__doc__,
+"fullmatch($self, /, string, pos=0, endpos=sys.maxsize)\n"
+"--\n"
+"\n"
+"Matches against all of the string.");
+
+#define _SRE_SRE_PATTERN_FULLMATCH_METHODDEF \
+ {"fullmatch", _PyCFunction_CAST(_sre_SRE_Pattern_fullmatch), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_fullmatch__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos);
+
+static PyObject *
+_sre_SRE_Pattern_fullmatch(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fullmatch",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t pos = 0;
+ Py_ssize_t endpos = PY_SSIZE_T_MAX;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ endpos = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_fullmatch_impl(self, cls, string, pos, endpos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_search__doc__,
+"search($self, /, string, pos=0, endpos=sys.maxsize)\n"
+"--\n"
+"\n"
+"Scan through string looking for a match, and return a corresponding match object instance.\n"
+"\n"
+"Return None if no position in the string matches.");
+
+#define _SRE_SRE_PATTERN_SEARCH_METHODDEF \
+ {"search", _PyCFunction_CAST(_sre_SRE_Pattern_search), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_search__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_search_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos);
+
+static PyObject *
+_sre_SRE_Pattern_search(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "search",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t pos = 0;
+ Py_ssize_t endpos = PY_SSIZE_T_MAX;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ endpos = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_search_impl(self, cls, string, pos, endpos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_findall__doc__,
+"findall($self, /, string, pos=0, endpos=sys.maxsize)\n"
+"--\n"
+"\n"
+"Return a list of all non-overlapping matches of pattern in string.");
+
+#define _SRE_SRE_PATTERN_FINDALL_METHODDEF \
+ {"findall", _PyCFunction_CAST(_sre_SRE_Pattern_findall), METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_findall__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string,
+ Py_ssize_t pos, Py_ssize_t endpos);
+
+static PyObject *
+_sre_SRE_Pattern_findall(PatternObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "findall",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t pos = 0;
+ Py_ssize_t endpos = PY_SSIZE_T_MAX;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ endpos = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_findall_impl(self, string, pos, endpos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_finditer__doc__,
+"finditer($self, /, string, pos=0, endpos=sys.maxsize)\n"
+"--\n"
+"\n"
+"Return an iterator over all non-overlapping matches for the RE pattern in string.\n"
+"\n"
+"For each match, the iterator returns a match object.");
+
+#define _SRE_SRE_PATTERN_FINDITER_METHODDEF \
+ {"finditer", _PyCFunction_CAST(_sre_SRE_Pattern_finditer), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_finditer__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_finditer_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos);
+
+static PyObject *
+_sre_SRE_Pattern_finditer(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "finditer",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t pos = 0;
+ Py_ssize_t endpos = PY_SSIZE_T_MAX;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ endpos = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_finditer_impl(self, cls, string, pos, endpos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_scanner__doc__,
+"scanner($self, /, string, pos=0, endpos=sys.maxsize)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_PATTERN_SCANNER_METHODDEF \
+ {"scanner", _PyCFunction_CAST(_sre_SRE_Pattern_scanner), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_scanner__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_scanner_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos);
+
+static PyObject *
+_sre_SRE_Pattern_scanner(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(pos), &_Py_ID(endpos), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "scanner",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t pos = 0;
+ Py_ssize_t endpos = PY_SSIZE_T_MAX;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ pos = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ endpos = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_scanner_impl(self, cls, string, pos, endpos);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_split__doc__,
+"split($self, /, string, maxsplit=0)\n"
+"--\n"
+"\n"
+"Split string by the occurrences of pattern.");
+
+#define _SRE_SRE_PATTERN_SPLIT_METHODDEF \
+ {"split", _PyCFunction_CAST(_sre_SRE_Pattern_split), METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_split__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string,
+ Py_ssize_t maxsplit);
+
+static PyObject *
+_sre_SRE_Pattern_split(PatternObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(maxsplit), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "maxsplit", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "split",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *string;
+ Py_ssize_t maxsplit = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ string = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ maxsplit = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_split_impl(self, string, maxsplit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_sub__doc__,
+"sub($self, /, repl, string, count=0)\n"
+"--\n"
+"\n"
+"Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.");
+
+#define _SRE_SRE_PATTERN_SUB_METHODDEF \
+ {"sub", _PyCFunction_CAST(_sre_SRE_Pattern_sub), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_sub__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_sub_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *repl, PyObject *string, Py_ssize_t count);
+
+static PyObject *
+_sre_SRE_Pattern_sub(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(repl), &_Py_ID(string), &_Py_ID(count), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"repl", "string", "count", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sub",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *repl;
+ PyObject *string;
+ Py_ssize_t count = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ repl = args[0];
+ string = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ count = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_sub_impl(self, cls, repl, string, count);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern_subn__doc__,
+"subn($self, /, repl, string, count=0)\n"
+"--\n"
+"\n"
+"Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.");
+
+#define _SRE_SRE_PATTERN_SUBN_METHODDEF \
+ {"subn", _PyCFunction_CAST(_sre_SRE_Pattern_subn), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Pattern_subn__doc__},
+
+static PyObject *
+_sre_SRE_Pattern_subn_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *repl, PyObject *string,
+ Py_ssize_t count);
+
+static PyObject *
+_sre_SRE_Pattern_subn(PatternObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(repl), &_Py_ID(string), &_Py_ID(count), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"repl", "string", "count", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "subn",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *repl;
+ PyObject *string;
+ Py_ssize_t count = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ repl = args[0];
+ string = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ count = ival;
+ }
+skip_optional_pos:
+ return_value = _sre_SRE_Pattern_subn_impl(self, cls, repl, string, count);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern___copy____doc__,
+"__copy__($self, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_PATTERN___COPY___METHODDEF \
+ {"__copy__", (PyCFunction)_sre_SRE_Pattern___copy__, METH_NOARGS, _sre_SRE_Pattern___copy____doc__},
+
+static PyObject *
+_sre_SRE_Pattern___copy___impl(PatternObject *self);
+
+static PyObject *
+_sre_SRE_Pattern___copy__(PatternObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _sre_SRE_Pattern___copy___impl(self);
+}
+
+PyDoc_STRVAR(_sre_SRE_Pattern___deepcopy____doc__,
+"__deepcopy__($self, memo, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF \
+ {"__deepcopy__", (PyCFunction)_sre_SRE_Pattern___deepcopy__, METH_O, _sre_SRE_Pattern___deepcopy____doc__},
+
+PyDoc_STRVAR(_sre_compile__doc__,
+"compile($module, /, pattern, flags, code, groups, groupindex,\n"
+" indexgroup)\n"
+"--\n"
+"\n");
+
+#define _SRE_COMPILE_METHODDEF \
+ {"compile", _PyCFunction_CAST(_sre_compile), METH_FASTCALL|METH_KEYWORDS, _sre_compile__doc__},
+
+static PyObject *
+_sre_compile_impl(PyObject *module, PyObject *pattern, int flags,
+ PyObject *code, Py_ssize_t groups, PyObject *groupindex,
+ PyObject *indexgroup);
+
+static PyObject *
+_sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 6
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(pattern), &_Py_ID(flags), &_Py_ID(code), &_Py_ID(groups), &_Py_ID(groupindex), &_Py_ID(indexgroup), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "compile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[6];
+ PyObject *pattern;
+ int flags;
+ PyObject *code;
+ Py_ssize_t groups;
+ PyObject *groupindex;
+ PyObject *indexgroup;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 6, 6, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ pattern = args[0];
+ flags = _PyLong_AsInt(args[1]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!PyList_Check(args[2])) {
+ _PyArg_BadArgument("compile", "argument 'code'", "list", args[2]);
+ goto exit;
+ }
+ code = args[2];
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[3]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ groups = ival;
+ }
+ if (!PyDict_Check(args[4])) {
+ _PyArg_BadArgument("compile", "argument 'groupindex'", "dict", args[4]);
+ goto exit;
+ }
+ groupindex = args[4];
+ if (!PyTuple_Check(args[5])) {
+ _PyArg_BadArgument("compile", "argument 'indexgroup'", "tuple", args[5]);
+ goto exit;
+ }
+ indexgroup = args[5];
+ return_value = _sre_compile_impl(module, pattern, flags, code, groups, groupindex, indexgroup);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_template__doc__,
+"template($module, pattern, template, /)\n"
+"--\n"
+"\n"
+"\n"
+"\n"
+" template\n"
+" A list containing interleaved literal strings (str or bytes) and group\n"
+" indices (int), as returned by re._parser.parse_template():\n"
+" [literal1, group1, ..., literalN, groupN]");
+
+#define _SRE_TEMPLATE_METHODDEF \
+ {"template", _PyCFunction_CAST(_sre_template), METH_FASTCALL, _sre_template__doc__},
+
+static PyObject *
+_sre_template_impl(PyObject *module, PyObject *pattern, PyObject *template);
+
+static PyObject *
+_sre_template(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *pattern;
+ PyObject *template;
+
+ if (!_PyArg_CheckPositional("template", nargs, 2, 2)) {
+ goto exit;
+ }
+ pattern = args[0];
+ if (!PyList_Check(args[1])) {
+ _PyArg_BadArgument("template", "argument 2", "list", args[1]);
+ goto exit;
+ }
+ template = args[1];
+ return_value = _sre_template_impl(module, pattern, template);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match_expand__doc__,
+"expand($self, /, template)\n"
+"--\n"
+"\n"
+"Return the string obtained by doing backslash substitution on the string template, as done by the sub() method.");
+
+#define _SRE_SRE_MATCH_EXPAND_METHODDEF \
+ {"expand", _PyCFunction_CAST(_sre_SRE_Match_expand), METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_expand__doc__},
+
+static PyObject *
+_sre_SRE_Match_expand_impl(MatchObject *self, PyObject *template);
+
+static PyObject *
+_sre_SRE_Match_expand(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(template), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"template", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "expand",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *template;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ template = args[0];
+ return_value = _sre_SRE_Match_expand_impl(self, template);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match_groups__doc__,
+"groups($self, /, default=None)\n"
+"--\n"
+"\n"
+"Return a tuple containing all the subgroups of the match, from 1.\n"
+"\n"
+" default\n"
+" Is used for groups that did not participate in the match.");
+
+#define _SRE_SRE_MATCH_GROUPS_METHODDEF \
+ {"groups", _PyCFunction_CAST(_sre_SRE_Match_groups), METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_groups__doc__},
+
+static PyObject *
+_sre_SRE_Match_groups_impl(MatchObject *self, PyObject *default_value);
+
+static PyObject *
+_sre_SRE_Match_groups(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(default), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"default", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "groups",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *default_value = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ default_value = args[0];
+skip_optional_pos:
+ return_value = _sre_SRE_Match_groups_impl(self, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match_groupdict__doc__,
+"groupdict($self, /, default=None)\n"
+"--\n"
+"\n"
+"Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.\n"
+"\n"
+" default\n"
+" Is used for groups that did not participate in the match.");
+
+#define _SRE_SRE_MATCH_GROUPDICT_METHODDEF \
+ {"groupdict", _PyCFunction_CAST(_sre_SRE_Match_groupdict), METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Match_groupdict__doc__},
+
+static PyObject *
+_sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value);
+
+static PyObject *
+_sre_SRE_Match_groupdict(MatchObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(default), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"default", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "groupdict",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *default_value = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ default_value = args[0];
+skip_optional_pos:
+ return_value = _sre_SRE_Match_groupdict_impl(self, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match_start__doc__,
+"start($self, group=0, /)\n"
+"--\n"
+"\n"
+"Return index of the start of the substring matched by group.");
+
+#define _SRE_SRE_MATCH_START_METHODDEF \
+ {"start", _PyCFunction_CAST(_sre_SRE_Match_start), METH_FASTCALL, _sre_SRE_Match_start__doc__},
+
+static Py_ssize_t
+_sre_SRE_Match_start_impl(MatchObject *self, PyObject *group);
+
+static PyObject *
+_sre_SRE_Match_start(MatchObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *group = NULL;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("start", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ group = args[0];
+skip_optional:
+ _return_value = _sre_SRE_Match_start_impl(self, group);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match_end__doc__,
+"end($self, group=0, /)\n"
+"--\n"
+"\n"
+"Return index of the end of the substring matched by group.");
+
+#define _SRE_SRE_MATCH_END_METHODDEF \
+ {"end", _PyCFunction_CAST(_sre_SRE_Match_end), METH_FASTCALL, _sre_SRE_Match_end__doc__},
+
+static Py_ssize_t
+_sre_SRE_Match_end_impl(MatchObject *self, PyObject *group);
+
+static PyObject *
+_sre_SRE_Match_end(MatchObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *group = NULL;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("end", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ group = args[0];
+skip_optional:
+ _return_value = _sre_SRE_Match_end_impl(self, group);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match_span__doc__,
+"span($self, group=0, /)\n"
+"--\n"
+"\n"
+"For match object m, return the 2-tuple (m.start(group), m.end(group)).");
+
+#define _SRE_SRE_MATCH_SPAN_METHODDEF \
+ {"span", _PyCFunction_CAST(_sre_SRE_Match_span), METH_FASTCALL, _sre_SRE_Match_span__doc__},
+
+static PyObject *
+_sre_SRE_Match_span_impl(MatchObject *self, PyObject *group);
+
+static PyObject *
+_sre_SRE_Match_span(MatchObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *group = NULL;
+
+ if (!_PyArg_CheckPositional("span", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ group = args[0];
+skip_optional:
+ return_value = _sre_SRE_Match_span_impl(self, group);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sre_SRE_Match___copy____doc__,
+"__copy__($self, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_MATCH___COPY___METHODDEF \
+ {"__copy__", (PyCFunction)_sre_SRE_Match___copy__, METH_NOARGS, _sre_SRE_Match___copy____doc__},
+
+static PyObject *
+_sre_SRE_Match___copy___impl(MatchObject *self);
+
+static PyObject *
+_sre_SRE_Match___copy__(MatchObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _sre_SRE_Match___copy___impl(self);
+}
+
+PyDoc_STRVAR(_sre_SRE_Match___deepcopy____doc__,
+"__deepcopy__($self, memo, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_MATCH___DEEPCOPY___METHODDEF \
+ {"__deepcopy__", (PyCFunction)_sre_SRE_Match___deepcopy__, METH_O, _sre_SRE_Match___deepcopy____doc__},
+
+PyDoc_STRVAR(_sre_SRE_Scanner_match__doc__,
+"match($self, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_SCANNER_MATCH_METHODDEF \
+ {"match", _PyCFunction_CAST(_sre_SRE_Scanner_match), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Scanner_match__doc__},
+
+static PyObject *
+_sre_SRE_Scanner_match_impl(ScannerObject *self, PyTypeObject *cls);
+
+static PyObject *
+_sre_SRE_Scanner_match(ScannerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "match() takes no arguments");
+ return NULL;
+ }
+ return _sre_SRE_Scanner_match_impl(self, cls);
+}
+
+PyDoc_STRVAR(_sre_SRE_Scanner_search__doc__,
+"search($self, /)\n"
+"--\n"
+"\n");
+
+#define _SRE_SRE_SCANNER_SEARCH_METHODDEF \
+ {"search", _PyCFunction_CAST(_sre_SRE_Scanner_search), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _sre_SRE_Scanner_search__doc__},
+
+static PyObject *
+_sre_SRE_Scanner_search_impl(ScannerObject *self, PyTypeObject *cls);
+
+static PyObject *
+_sre_SRE_Scanner_search(ScannerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "search() takes no arguments");
+ return NULL;
+ }
+ return _sre_SRE_Scanner_search_impl(self, cls);
+}
+/*[clinic end generated code: output=045de53cfe02dee0 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_sre/sre.c b/contrib/tools/python3/Modules/_sre/sre.c
new file mode 100644
index 00000000000..0547390454a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sre/sre.c
@@ -0,0 +1,3249 @@
+/*
+ * Secret Labs' Regular Expression Engine
+ *
+ * regular expression matching engine
+ *
+ * partial history:
+ * 1999-10-24 fl created (based on existing template matcher code)
+ * 2000-03-06 fl first alpha, sort of
+ * 2000-08-01 fl fixes for 1.6b1
+ * 2000-08-07 fl use PyOS_CheckStack() if available
+ * 2000-09-20 fl added expand method
+ * 2001-03-20 fl lots of fixes for 2.1b2
+ * 2001-04-15 fl export copyright as Python attribute, not global
+ * 2001-04-28 fl added __copy__ methods (work in progress)
+ * 2001-05-14 fl fixes for 1.5.2 compatibility
+ * 2001-07-01 fl added BIGCHARSET support (from Martin von Loewis)
+ * 2001-10-18 fl fixed group reset issue (from Matthew Mueller)
+ * 2001-10-20 fl added split primitive; re-enable unicode for 1.6/2.0/2.1
+ * 2001-10-21 fl added sub/subn primitive
+ * 2001-10-24 fl added finditer primitive (for 2.2 only)
+ * 2001-12-07 fl fixed memory leak in sub/subn (Guido van Rossum)
+ * 2002-11-09 fl fixed empty sub/subn return type
+ * 2003-04-18 mvl fully support 4-byte codes
+ * 2003-10-17 gn implemented non recursive scheme
+ * 2013-02-04 mrab added fullmatch primitive
+ *
+ * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
+ *
+ * This version of the SRE library can be redistributed under CNRI's
+ * Python 1.6 license. For any other use, please contact Secret Labs
+ *
+ * Portions of this engine have been developed in cooperation with
+ * CNRI. Hewlett-Packard provided funding for 1.6 integration and
+ * other compatibility work.
+ */
+
+static const char copyright[] =
+ " SRE 2.2.2 Copyright (c) 1997-2002 by Secret Labs AB ";
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "structmember.h" // PyMemberDef
+
+#include "sre.h"
+
+#define SRE_CODE_BITS (8 * sizeof(SRE_CODE))
+
+#include <ctype.h>
+
+/* defining this one enables tracing */
+#undef VERBOSE
+
+/* -------------------------------------------------------------------- */
+
+#if defined(_MSC_VER)
+#pragma optimize("agtw", on) /* doesn't seem to make much difference... */
+#pragma warning(disable: 4710) /* who cares if functions are not inlined ;-) */
+/* fastest possible local call under MSVC */
+#define LOCAL(type) static __inline type __fastcall
+#else
+#define LOCAL(type) static inline type
+#endif
+
+/* error codes */
+#define SRE_ERROR_ILLEGAL -1 /* illegal opcode */
+#define SRE_ERROR_STATE -2 /* illegal state */
+#define SRE_ERROR_RECURSION_LIMIT -3 /* runaway recursion */
+#define SRE_ERROR_MEMORY -9 /* out of memory */
+#define SRE_ERROR_INTERRUPTED -10 /* signal handler raised exception */
+
+#if defined(VERBOSE)
+#define TRACE(v) printf v
+#else
+#define TRACE(v)
+#endif
+
+/* -------------------------------------------------------------------- */
+/* search engine state */
+
+#define SRE_IS_DIGIT(ch)\
+ ((ch) <= '9' && Py_ISDIGIT(ch))
+#define SRE_IS_SPACE(ch)\
+ ((ch) <= ' ' && Py_ISSPACE(ch))
+#define SRE_IS_LINEBREAK(ch)\
+ ((ch) == '\n')
+#define SRE_IS_WORD(ch)\
+ ((ch) <= 'z' && (Py_ISALNUM(ch) || (ch) == '_'))
+
+static unsigned int sre_lower_ascii(unsigned int ch)
+{
+ return ((ch) < 128 ? Py_TOLOWER(ch) : ch);
+}
+
+/* locale-specific character predicates */
+/* !(c & ~N) == (c < N+1) for any unsigned c, this avoids
+ * warnings when c's type supports only numbers < N+1 */
+#define SRE_LOC_IS_ALNUM(ch) (!((ch) & ~255) ? isalnum((ch)) : 0)
+#define SRE_LOC_IS_WORD(ch) (SRE_LOC_IS_ALNUM((ch)) || (ch) == '_')
+
+static unsigned int sre_lower_locale(unsigned int ch)
+{
+ return ((ch) < 256 ? (unsigned int)tolower((ch)) : ch);
+}
+
+static unsigned int sre_upper_locale(unsigned int ch)
+{
+ return ((ch) < 256 ? (unsigned int)toupper((ch)) : ch);
+}
+
+/* unicode-specific character predicates */
+
+#define SRE_UNI_IS_DIGIT(ch) Py_UNICODE_ISDECIMAL(ch)
+#define SRE_UNI_IS_SPACE(ch) Py_UNICODE_ISSPACE(ch)
+#define SRE_UNI_IS_LINEBREAK(ch) Py_UNICODE_ISLINEBREAK(ch)
+#define SRE_UNI_IS_ALNUM(ch) Py_UNICODE_ISALNUM(ch)
+#define SRE_UNI_IS_WORD(ch) (SRE_UNI_IS_ALNUM(ch) || (ch) == '_')
+
+static unsigned int sre_lower_unicode(unsigned int ch)
+{
+ return (unsigned int) Py_UNICODE_TOLOWER(ch);
+}
+
+static unsigned int sre_upper_unicode(unsigned int ch)
+{
+ return (unsigned int) Py_UNICODE_TOUPPER(ch);
+}
+
+LOCAL(int)
+sre_category(SRE_CODE category, unsigned int ch)
+{
+ switch (category) {
+
+ case SRE_CATEGORY_DIGIT:
+ return SRE_IS_DIGIT(ch);
+ case SRE_CATEGORY_NOT_DIGIT:
+ return !SRE_IS_DIGIT(ch);
+ case SRE_CATEGORY_SPACE:
+ return SRE_IS_SPACE(ch);
+ case SRE_CATEGORY_NOT_SPACE:
+ return !SRE_IS_SPACE(ch);
+ case SRE_CATEGORY_WORD:
+ return SRE_IS_WORD(ch);
+ case SRE_CATEGORY_NOT_WORD:
+ return !SRE_IS_WORD(ch);
+ case SRE_CATEGORY_LINEBREAK:
+ return SRE_IS_LINEBREAK(ch);
+ case SRE_CATEGORY_NOT_LINEBREAK:
+ return !SRE_IS_LINEBREAK(ch);
+
+ case SRE_CATEGORY_LOC_WORD:
+ return SRE_LOC_IS_WORD(ch);
+ case SRE_CATEGORY_LOC_NOT_WORD:
+ return !SRE_LOC_IS_WORD(ch);
+
+ case SRE_CATEGORY_UNI_DIGIT:
+ return SRE_UNI_IS_DIGIT(ch);
+ case SRE_CATEGORY_UNI_NOT_DIGIT:
+ return !SRE_UNI_IS_DIGIT(ch);
+ case SRE_CATEGORY_UNI_SPACE:
+ return SRE_UNI_IS_SPACE(ch);
+ case SRE_CATEGORY_UNI_NOT_SPACE:
+ return !SRE_UNI_IS_SPACE(ch);
+ case SRE_CATEGORY_UNI_WORD:
+ return SRE_UNI_IS_WORD(ch);
+ case SRE_CATEGORY_UNI_NOT_WORD:
+ return !SRE_UNI_IS_WORD(ch);
+ case SRE_CATEGORY_UNI_LINEBREAK:
+ return SRE_UNI_IS_LINEBREAK(ch);
+ case SRE_CATEGORY_UNI_NOT_LINEBREAK:
+ return !SRE_UNI_IS_LINEBREAK(ch);
+ }
+ return 0;
+}
+
+LOCAL(int)
+char_loc_ignore(SRE_CODE pattern, SRE_CODE ch)
+{
+ return ch == pattern
+ || (SRE_CODE) sre_lower_locale(ch) == pattern
+ || (SRE_CODE) sre_upper_locale(ch) == pattern;
+}
+
+
+/* helpers */
+
+static void
+data_stack_dealloc(SRE_STATE* state)
+{
+ if (state->data_stack) {
+ PyMem_Free(state->data_stack);
+ state->data_stack = NULL;
+ }
+ state->data_stack_size = state->data_stack_base = 0;
+}
+
+static int
+data_stack_grow(SRE_STATE* state, Py_ssize_t size)
+{
+ Py_ssize_t minsize, cursize;
+ minsize = state->data_stack_base+size;
+ cursize = state->data_stack_size;
+ if (cursize < minsize) {
+ void* stack;
+ cursize = minsize+minsize/4+1024;
+ TRACE(("allocate/grow stack %zd\n", cursize));
+ stack = PyMem_Realloc(state->data_stack, cursize);
+ if (!stack) {
+ data_stack_dealloc(state);
+ return SRE_ERROR_MEMORY;
+ }
+ state->data_stack = (char *)stack;
+ state->data_stack_size = cursize;
+ }
+ return 0;
+}
+
+/* generate 8-bit version */
+
+#define SRE_CHAR Py_UCS1
+#define SIZEOF_SRE_CHAR 1
+#define SRE(F) sre_ucs1_##F
+#include "sre_lib.h"
+
+/* generate 16-bit unicode version */
+
+#define SRE_CHAR Py_UCS2
+#define SIZEOF_SRE_CHAR 2
+#define SRE(F) sre_ucs2_##F
+#include "sre_lib.h"
+
+/* generate 32-bit unicode version */
+
+#define SRE_CHAR Py_UCS4
+#define SIZEOF_SRE_CHAR 4
+#define SRE(F) sre_ucs4_##F
+#include "sre_lib.h"
+
+/* -------------------------------------------------------------------- */
+/* factories and destructors */
+
+/* module state */
+typedef struct {
+ PyTypeObject *Pattern_Type;
+ PyTypeObject *Match_Type;
+ PyTypeObject *Scanner_Type;
+ PyTypeObject *Template_Type;
+ PyObject *compile_template; // reference to re._compile_template
+} _sremodulestate;
+
+static _sremodulestate *
+get_sre_module_state(PyObject *m)
+{
+ _sremodulestate *state = (_sremodulestate *)_PyModule_GetState(m);
+ assert(state);
+ return state;
+}
+
+static struct PyModuleDef sremodule;
+#define get_sre_module_state_by_class(cls) \
+ (get_sre_module_state(PyType_GetModule(cls)))
+
+/* see sre.h for object declarations */
+static PyObject*pattern_new_match(_sremodulestate *, PatternObject*, SRE_STATE*, Py_ssize_t);
+static PyObject *pattern_scanner(_sremodulestate *, PatternObject *, PyObject *, Py_ssize_t, Py_ssize_t);
+
+/*[clinic input]
+module _sre
+class _sre.SRE_Pattern "PatternObject *" "get_sre_module_state_by_class(tp)->Pattern_Type"
+class _sre.SRE_Match "MatchObject *" "get_sre_module_state_by_class(tp)->Match_Type"
+class _sre.SRE_Scanner "ScannerObject *" "get_sre_module_state_by_class(tp)->Scanner_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=fe2966e32b66a231]*/
+
+/*[clinic input]
+_sre.getcodesize -> int
+[clinic start generated code]*/
+
+static int
+_sre_getcodesize_impl(PyObject *module)
+/*[clinic end generated code: output=e0db7ce34a6dd7b1 input=bd6f6ecf4916bb2b]*/
+{
+ return sizeof(SRE_CODE);
+}
+
+/*[clinic input]
+_sre.ascii_iscased -> bool
+
+ character: int
+ /
+
+[clinic start generated code]*/
+
+static int
+_sre_ascii_iscased_impl(PyObject *module, int character)
+/*[clinic end generated code: output=4f454b630fbd19a2 input=9f0bd952812c7ed3]*/
+{
+ unsigned int ch = (unsigned int)character;
+ return ch < 128 && Py_ISALPHA(ch);
+}
+
+/*[clinic input]
+_sre.unicode_iscased -> bool
+
+ character: int
+ /
+
+[clinic start generated code]*/
+
+static int
+_sre_unicode_iscased_impl(PyObject *module, int character)
+/*[clinic end generated code: output=9c5ddee0dc2bc258 input=51e42c3b8dddb78e]*/
+{
+ unsigned int ch = (unsigned int)character;
+ return ch != sre_lower_unicode(ch) || ch != sre_upper_unicode(ch);
+}
+
+/*[clinic input]
+_sre.ascii_tolower -> int
+
+ character: int
+ /
+
+[clinic start generated code]*/
+
+static int
+_sre_ascii_tolower_impl(PyObject *module, int character)
+/*[clinic end generated code: output=228294ed6ff2a612 input=272c609b5b61f136]*/
+{
+ return sre_lower_ascii(character);
+}
+
+/*[clinic input]
+_sre.unicode_tolower -> int
+
+ character: int
+ /
+
+[clinic start generated code]*/
+
+static int
+_sre_unicode_tolower_impl(PyObject *module, int character)
+/*[clinic end generated code: output=6422272d7d7fee65 input=91d708c5f3c2045a]*/
+{
+ return sre_lower_unicode(character);
+}
+
+LOCAL(void)
+state_reset(SRE_STATE* state)
+{
+ /* state->mark will be set to 0 in SRE_OP_MARK dynamically. */
+ /*memset(state->mark, 0, sizeof(*state->mark) * SRE_MARK_SIZE);*/
+
+ state->lastmark = -1;
+ state->lastindex = -1;
+
+ state->repeat = NULL;
+
+ data_stack_dealloc(state);
+}
+
+static const void*
+getstring(PyObject* string, Py_ssize_t* p_length,
+ int* p_isbytes, int* p_charsize,
+ Py_buffer *view)
+{
+ /* given a python object, return a data pointer, a length (in
+ characters), and a character size. return NULL if the object
+ is not a string (or not compatible) */
+
+ /* Unicode objects do not support the buffer API. So, get the data
+ directly instead. */
+ if (PyUnicode_Check(string)) {
+ if (PyUnicode_READY(string) == -1)
+ return NULL;
+ *p_length = PyUnicode_GET_LENGTH(string);
+ *p_charsize = PyUnicode_KIND(string);
+ *p_isbytes = 0;
+ return PyUnicode_DATA(string);
+ }
+
+ /* get pointer to byte string buffer */
+ if (PyObject_GetBuffer(string, view, PyBUF_SIMPLE) != 0) {
+ PyErr_Format(PyExc_TypeError, "expected string or bytes-like "
+ "object, got '%.200s'", Py_TYPE(string)->tp_name);
+ return NULL;
+ }
+
+ *p_length = view->len;
+ *p_charsize = 1;
+ *p_isbytes = 1;
+
+ if (view->buf == NULL) {
+ PyErr_SetString(PyExc_ValueError, "Buffer is NULL");
+ PyBuffer_Release(view);
+ view->buf = NULL;
+ return NULL;
+ }
+ return view->buf;
+}
+
+LOCAL(PyObject*)
+state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string,
+ Py_ssize_t start, Py_ssize_t end)
+{
+ /* prepare state object */
+
+ Py_ssize_t length;
+ int isbytes, charsize;
+ const void* ptr;
+
+ memset(state, 0, sizeof(SRE_STATE));
+
+ state->mark = PyMem_New(const void *, pattern->groups * 2);
+ if (!state->mark) {
+ PyErr_NoMemory();
+ goto err;
+ }
+ state->lastmark = -1;
+ state->lastindex = -1;
+
+ state->buffer.buf = NULL;
+ ptr = getstring(string, &length, &isbytes, &charsize, &state->buffer);
+ if (!ptr)
+ goto err;
+
+ if (isbytes && pattern->isbytes == 0) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot use a string pattern on a bytes-like object");
+ goto err;
+ }
+ if (!isbytes && pattern->isbytes > 0) {
+ PyErr_SetString(PyExc_TypeError,
+ "cannot use a bytes pattern on a string-like object");
+ goto err;
+ }
+
+ /* adjust boundaries */
+ if (start < 0)
+ start = 0;
+ else if (start > length)
+ start = length;
+
+ if (end < 0)
+ end = 0;
+ else if (end > length)
+ end = length;
+
+ state->isbytes = isbytes;
+ state->charsize = charsize;
+ state->match_all = 0;
+ state->must_advance = 0;
+
+ state->beginning = ptr;
+
+ state->start = (void*) ((char*) ptr + start * state->charsize);
+ state->end = (void*) ((char*) ptr + end * state->charsize);
+
+ state->string = Py_NewRef(string);
+ state->pos = start;
+ state->endpos = end;
+
+ return string;
+ err:
+ /* We add an explicit cast here because MSVC has a bug when
+ compiling C code where it believes that `const void**` cannot be
+ safely casted to `void*`, see bpo-39943 for details. */
+ PyMem_Free((void*) state->mark);
+ state->mark = NULL;
+ if (state->buffer.buf)
+ PyBuffer_Release(&state->buffer);
+ return NULL;
+}
+
+LOCAL(void)
+state_fini(SRE_STATE* state)
+{
+ if (state->buffer.buf)
+ PyBuffer_Release(&state->buffer);
+ Py_XDECREF(state->string);
+ data_stack_dealloc(state);
+ /* See above PyMem_Del for why we explicitly cast here. */
+ PyMem_Free((void*) state->mark);
+ state->mark = NULL;
+}
+
+/* calculate offset from start of string */
+#define STATE_OFFSET(state, member)\
+ (((char*)(member) - (char*)(state)->beginning) / (state)->charsize)
+
+LOCAL(PyObject*)
+getslice(int isbytes, const void *ptr,
+ PyObject* string, Py_ssize_t start, Py_ssize_t end)
+{
+ if (isbytes) {
+ if (PyBytes_CheckExact(string) &&
+ start == 0 && end == PyBytes_GET_SIZE(string)) {
+ return Py_NewRef(string);
+ }
+ return PyBytes_FromStringAndSize(
+ (const char *)ptr + start, end - start);
+ }
+ else {
+ return PyUnicode_Substring(string, start, end);
+ }
+}
+
+LOCAL(PyObject*)
+state_getslice(SRE_STATE* state, Py_ssize_t index, PyObject* string, int empty)
+{
+ Py_ssize_t i, j;
+
+ index = (index - 1) * 2;
+
+ if (string == Py_None || index >= state->lastmark || !state->mark[index] || !state->mark[index+1]) {
+ if (empty)
+ /* want empty string */
+ i = j = 0;
+ else {
+ Py_RETURN_NONE;
+ }
+ } else {
+ i = STATE_OFFSET(state, state->mark[index]);
+ j = STATE_OFFSET(state, state->mark[index+1]);
+
+ /* check wrong span */
+ if (i > j) {
+ PyErr_SetString(PyExc_SystemError,
+ "The span of capturing group is wrong,"
+ " please report a bug for the re module.");
+ return NULL;
+ }
+ }
+
+ return getslice(state->isbytes, state->beginning, string, i, j);
+}
+
+static void
+pattern_error(Py_ssize_t status)
+{
+ switch (status) {
+ case SRE_ERROR_RECURSION_LIMIT:
+ /* This error code seems to be unused. */
+ PyErr_SetString(
+ PyExc_RecursionError,
+ "maximum recursion limit exceeded"
+ );
+ break;
+ case SRE_ERROR_MEMORY:
+ PyErr_NoMemory();
+ break;
+ case SRE_ERROR_INTERRUPTED:
+ /* An exception has already been raised, so let it fly */
+ break;
+ default:
+ /* other error codes indicate compiler/engine bugs */
+ PyErr_SetString(
+ PyExc_RuntimeError,
+ "internal error in regular expression engine"
+ );
+ }
+}
+
+static int
+pattern_traverse(PatternObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->groupindex);
+ Py_VISIT(self->indexgroup);
+ Py_VISIT(self->pattern);
+ return 0;
+}
+
+static int
+pattern_clear(PatternObject *self)
+{
+ Py_CLEAR(self->groupindex);
+ Py_CLEAR(self->indexgroup);
+ Py_CLEAR(self->pattern);
+ return 0;
+}
+
+static void
+pattern_dealloc(PatternObject* self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+
+ PyObject_GC_UnTrack(self);
+ if (self->weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject *) self);
+ }
+ (void)pattern_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+LOCAL(Py_ssize_t)
+sre_match(SRE_STATE* state, SRE_CODE* pattern)
+{
+ if (state->charsize == 1)
+ return sre_ucs1_match(state, pattern, 1);
+ if (state->charsize == 2)
+ return sre_ucs2_match(state, pattern, 1);
+ assert(state->charsize == 4);
+ return sre_ucs4_match(state, pattern, 1);
+}
+
+LOCAL(Py_ssize_t)
+sre_search(SRE_STATE* state, SRE_CODE* pattern)
+{
+ if (state->charsize == 1)
+ return sre_ucs1_search(state, pattern);
+ if (state->charsize == 2)
+ return sre_ucs2_search(state, pattern);
+ assert(state->charsize == 4);
+ return sre_ucs4_search(state, pattern);
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.match
+
+ cls: defining_class
+ /
+ string: object
+ pos: Py_ssize_t = 0
+ endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
+
+Matches zero or more characters at the beginning of the string.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_match_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos)
+/*[clinic end generated code: output=ec6208ea58a0cca0 input=4bdb9c3e564d13ac]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+ SRE_STATE state;
+ Py_ssize_t status;
+ PyObject *match;
+
+ if (!state_init(&state, (PatternObject *)self, string, pos, endpos))
+ return NULL;
+
+ state.ptr = state.start;
+
+ TRACE(("|%p|%p|MATCH\n", PatternObject_GetCode(self), state.ptr));
+
+ status = sre_match(&state, PatternObject_GetCode(self));
+
+ TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
+ if (PyErr_Occurred()) {
+ state_fini(&state);
+ return NULL;
+ }
+
+ match = pattern_new_match(module_state, self, &state, status);
+ state_fini(&state);
+ return match;
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.fullmatch
+
+ cls: defining_class
+ /
+ string: object
+ pos: Py_ssize_t = 0
+ endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
+
+Matches against all of the string.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos)
+/*[clinic end generated code: output=625b75b027ef94da input=50981172ab0fcfdd]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+ SRE_STATE state;
+ Py_ssize_t status;
+ PyObject *match;
+
+ if (!state_init(&state, self, string, pos, endpos))
+ return NULL;
+
+ state.ptr = state.start;
+
+ TRACE(("|%p|%p|FULLMATCH\n", PatternObject_GetCode(self), state.ptr));
+
+ state.match_all = 1;
+ status = sre_match(&state, PatternObject_GetCode(self));
+
+ TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
+ if (PyErr_Occurred()) {
+ state_fini(&state);
+ return NULL;
+ }
+
+ match = pattern_new_match(module_state, self, &state, status);
+ state_fini(&state);
+ return match;
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.search
+
+ cls: defining_class
+ /
+ string: object
+ pos: Py_ssize_t = 0
+ endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
+
+Scan through string looking for a match, and return a corresponding match object instance.
+
+Return None if no position in the string matches.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_search_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos)
+/*[clinic end generated code: output=bd7f2d9d583e1463 input=afa9afb66a74a4b3]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+ SRE_STATE state;
+ Py_ssize_t status;
+ PyObject *match;
+
+ if (!state_init(&state, self, string, pos, endpos))
+ return NULL;
+
+ TRACE(("|%p|%p|SEARCH\n", PatternObject_GetCode(self), state.ptr));
+
+ status = sre_search(&state, PatternObject_GetCode(self));
+
+ TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
+
+ if (PyErr_Occurred()) {
+ state_fini(&state);
+ return NULL;
+ }
+
+ match = pattern_new_match(module_state, self, &state, status);
+ state_fini(&state);
+ return match;
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.findall
+
+ string: object
+ pos: Py_ssize_t = 0
+ endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
+
+Return a list of all non-overlapping matches of pattern in string.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string,
+ Py_ssize_t pos, Py_ssize_t endpos)
+/*[clinic end generated code: output=f4966baceea60aca input=5b6a4ee799741563]*/
+{
+ SRE_STATE state;
+ PyObject* list;
+ Py_ssize_t status;
+ Py_ssize_t i, b, e;
+
+ if (!state_init(&state, self, string, pos, endpos))
+ return NULL;
+
+ list = PyList_New(0);
+ if (!list) {
+ state_fini(&state);
+ return NULL;
+ }
+
+ while (state.start <= state.end) {
+
+ PyObject* item;
+
+ state_reset(&state);
+
+ state.ptr = state.start;
+
+ status = sre_search(&state, PatternObject_GetCode(self));
+ if (PyErr_Occurred())
+ goto error;
+
+ if (status <= 0) {
+ if (status == 0)
+ break;
+ pattern_error(status);
+ goto error;
+ }
+
+ /* don't bother to build a match object */
+ switch (self->groups) {
+ case 0:
+ b = STATE_OFFSET(&state, state.start);
+ e = STATE_OFFSET(&state, state.ptr);
+ item = getslice(state.isbytes, state.beginning,
+ string, b, e);
+ if (!item)
+ goto error;
+ break;
+ case 1:
+ item = state_getslice(&state, 1, string, 1);
+ if (!item)
+ goto error;
+ break;
+ default:
+ item = PyTuple_New(self->groups);
+ if (!item)
+ goto error;
+ for (i = 0; i < self->groups; i++) {
+ PyObject* o = state_getslice(&state, i+1, string, 1);
+ if (!o) {
+ Py_DECREF(item);
+ goto error;
+ }
+ PyTuple_SET_ITEM(item, i, o);
+ }
+ break;
+ }
+
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+
+ state.must_advance = (state.ptr == state.start);
+ state.start = state.ptr;
+ }
+
+ state_fini(&state);
+ return list;
+
+error:
+ Py_DECREF(list);
+ state_fini(&state);
+ return NULL;
+
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.finditer
+
+ cls: defining_class
+ /
+ string: object
+ pos: Py_ssize_t = 0
+ endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
+
+Return an iterator over all non-overlapping matches for the RE pattern in string.
+
+For each match, the iterator returns a match object.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_finditer_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos)
+/*[clinic end generated code: output=1791dbf3618ade56 input=812e332a4848cbaf]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+ PyObject* scanner;
+ PyObject* search;
+ PyObject* iterator;
+
+ scanner = pattern_scanner(module_state, self, string, pos, endpos);
+ if (!scanner)
+ return NULL;
+
+ search = PyObject_GetAttrString(scanner, "search");
+ Py_DECREF(scanner);
+ if (!search)
+ return NULL;
+
+ iterator = PyCallIter_New(search, Py_None);
+ Py_DECREF(search);
+
+ return iterator;
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.scanner
+
+ cls: defining_class
+ /
+ string: object
+ pos: Py_ssize_t = 0
+ endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_scanner_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *string, Py_ssize_t pos,
+ Py_ssize_t endpos)
+/*[clinic end generated code: output=f70cd506112f1bd9 input=2e487e5151bcee4c]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+
+ return pattern_scanner(module_state, self, string, pos, endpos);
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.split
+
+ string: object
+ maxsplit: Py_ssize_t = 0
+
+Split string by the occurrences of pattern.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string,
+ Py_ssize_t maxsplit)
+/*[clinic end generated code: output=7ac66f381c45e0be input=1eeeb10dafc9947a]*/
+{
+ SRE_STATE state;
+ PyObject* list;
+ PyObject* item;
+ Py_ssize_t status;
+ Py_ssize_t n;
+ Py_ssize_t i;
+ const void* last;
+
+ assert(self->codesize != 0);
+
+ if (!state_init(&state, self, string, 0, PY_SSIZE_T_MAX))
+ return NULL;
+
+ list = PyList_New(0);
+ if (!list) {
+ state_fini(&state);
+ return NULL;
+ }
+
+ n = 0;
+ last = state.start;
+
+ while (!maxsplit || n < maxsplit) {
+
+ state_reset(&state);
+
+ state.ptr = state.start;
+
+ status = sre_search(&state, PatternObject_GetCode(self));
+ if (PyErr_Occurred())
+ goto error;
+
+ if (status <= 0) {
+ if (status == 0)
+ break;
+ pattern_error(status);
+ goto error;
+ }
+
+ /* get segment before this match */
+ item = getslice(state.isbytes, state.beginning,
+ string, STATE_OFFSET(&state, last),
+ STATE_OFFSET(&state, state.start)
+ );
+ if (!item)
+ goto error;
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+
+ /* add groups (if any) */
+ for (i = 0; i < self->groups; i++) {
+ item = state_getslice(&state, i+1, string, 0);
+ if (!item)
+ goto error;
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+ }
+
+ n = n + 1;
+ state.must_advance = (state.ptr == state.start);
+ last = state.start = state.ptr;
+
+ }
+
+ /* get segment following last match (even if empty) */
+ item = getslice(state.isbytes, state.beginning,
+ string, STATE_OFFSET(&state, last), state.endpos
+ );
+ if (!item)
+ goto error;
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+
+ state_fini(&state);
+ return list;
+
+error:
+ Py_DECREF(list);
+ state_fini(&state);
+ return NULL;
+
+}
+
+static PyObject *
+compile_template(_sremodulestate *module_state,
+ PatternObject *pattern, PyObject *template)
+{
+ /* delegate to Python code */
+ PyObject *func = module_state->compile_template;
+ if (func == NULL) {
+ func = _PyImport_GetModuleAttrString("re", "_compile_template");
+ if (func == NULL) {
+ return NULL;
+ }
+ Py_XSETREF(module_state->compile_template, func);
+ }
+
+ PyObject *args[] = {(PyObject *)pattern, template};
+ PyObject *result = PyObject_Vectorcall(func, args, 2, NULL);
+
+ if (result == NULL && PyErr_ExceptionMatches(PyExc_TypeError)) {
+ /* If the replacement string is unhashable (e.g. bytearray),
+ * convert it to the basic type (str or bytes) and repeat. */
+ if (PyUnicode_Check(template) && !PyUnicode_CheckExact(template)) {
+ PyErr_Clear();
+ template = _PyUnicode_Copy(template);
+ }
+ else if (PyObject_CheckBuffer(template) && !PyBytes_CheckExact(template)) {
+ PyErr_Clear();
+ template = PyBytes_FromObject(template);
+ }
+ else {
+ return NULL;
+ }
+ if (template == NULL) {
+ return NULL;
+ }
+ args[1] = template;
+ result = PyObject_Vectorcall(func, args, 2, NULL);
+ Py_DECREF(template);
+ }
+
+ if (result != NULL && Py_TYPE(result) != module_state->Template_Type) {
+ PyErr_Format(PyExc_RuntimeError,
+ "the result of compiling a replacement string is %.200s",
+ Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+}
+
+static PyObject *expand_template(TemplateObject *, MatchObject *); /* Forward */
+
+static PyObject*
+pattern_subx(_sremodulestate* module_state,
+ PatternObject* self,
+ PyObject* ptemplate,
+ PyObject* string,
+ Py_ssize_t count,
+ Py_ssize_t subn)
+{
+ SRE_STATE state;
+ PyObject* list;
+ PyObject* joiner;
+ PyObject* item;
+ PyObject* filter;
+ PyObject* match;
+ const void* ptr;
+ Py_ssize_t status;
+ Py_ssize_t n;
+ Py_ssize_t i, b, e;
+ int isbytes, charsize;
+ enum {LITERAL, TEMPLATE, CALLABLE} filter_type;
+ Py_buffer view;
+
+ if (PyCallable_Check(ptemplate)) {
+ /* sub/subn takes either a function or a template */
+ filter = Py_NewRef(ptemplate);
+ filter_type = CALLABLE;
+ } else {
+ /* if not callable, check if it's a literal string */
+ int literal;
+ view.buf = NULL;
+ ptr = getstring(ptemplate, &n, &isbytes, &charsize, &view);
+ if (ptr) {
+ if (charsize == 1)
+ literal = memchr(ptr, '\\', n) == NULL;
+ else
+ literal = PyUnicode_FindChar(ptemplate, '\\', 0, n, 1) == -1;
+ } else {
+ PyErr_Clear();
+ literal = 0;
+ }
+ if (view.buf)
+ PyBuffer_Release(&view);
+ if (literal) {
+ filter = Py_NewRef(ptemplate);
+ filter_type = LITERAL;
+ } else {
+ /* not a literal; hand it over to the template compiler */
+ filter = compile_template(module_state, self, ptemplate);
+ if (!filter)
+ return NULL;
+
+ assert(Py_TYPE(filter) == module_state->Template_Type);
+ if (Py_SIZE(filter) == 0) {
+ Py_SETREF(filter,
+ Py_NewRef(((TemplateObject *)filter)->literal));
+ filter_type = LITERAL;
+ }
+ else {
+ filter_type = TEMPLATE;
+ }
+ }
+ }
+
+ if (!state_init(&state, self, string, 0, PY_SSIZE_T_MAX)) {
+ Py_DECREF(filter);
+ return NULL;
+ }
+
+ list = PyList_New(0);
+ if (!list) {
+ Py_DECREF(filter);
+ state_fini(&state);
+ return NULL;
+ }
+
+ n = i = 0;
+
+ while (!count || n < count) {
+
+ state_reset(&state);
+
+ state.ptr = state.start;
+
+ status = sre_search(&state, PatternObject_GetCode(self));
+ if (PyErr_Occurred())
+ goto error;
+
+ if (status <= 0) {
+ if (status == 0)
+ break;
+ pattern_error(status);
+ goto error;
+ }
+
+ b = STATE_OFFSET(&state, state.start);
+ e = STATE_OFFSET(&state, state.ptr);
+
+ if (i < b) {
+ /* get segment before this match */
+ item = getslice(state.isbytes, state.beginning,
+ string, i, b);
+ if (!item)
+ goto error;
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+
+ }
+
+ if (filter_type != LITERAL) {
+ /* pass match object through filter */
+ match = pattern_new_match(module_state, self, &state, 1);
+ if (!match)
+ goto error;
+ if (filter_type == TEMPLATE) {
+ item = expand_template((TemplateObject *)filter,
+ (MatchObject *)match);
+ }
+ else {
+ assert(filter_type == CALLABLE);
+ item = PyObject_CallOneArg(filter, match);
+ }
+ Py_DECREF(match);
+ if (!item)
+ goto error;
+ } else {
+ /* filter is literal string */
+ item = Py_NewRef(filter);
+ }
+
+ /* add to list */
+ if (item != Py_None) {
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+ }
+
+ i = e;
+ n = n + 1;
+ state.must_advance = (state.ptr == state.start);
+ state.start = state.ptr;
+ }
+
+ /* get segment following last match */
+ if (i < state.endpos) {
+ item = getslice(state.isbytes, state.beginning,
+ string, i, state.endpos);
+ if (!item)
+ goto error;
+ status = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (status < 0)
+ goto error;
+ }
+
+ state_fini(&state);
+
+ Py_DECREF(filter);
+
+ /* convert list to single string (also removes list) */
+ joiner = getslice(state.isbytes, state.beginning, string, 0, 0);
+ if (!joiner) {
+ Py_DECREF(list);
+ return NULL;
+ }
+ if (PyList_GET_SIZE(list) == 0) {
+ Py_DECREF(list);
+ item = joiner;
+ }
+ else {
+ if (state.isbytes)
+ item = _PyBytes_Join(joiner, list);
+ else
+ item = PyUnicode_Join(joiner, list);
+ Py_DECREF(joiner);
+ Py_DECREF(list);
+ if (!item)
+ return NULL;
+ }
+
+ if (subn)
+ return Py_BuildValue("Nn", item, n);
+
+ return item;
+
+error:
+ Py_DECREF(list);
+ state_fini(&state);
+ Py_DECREF(filter);
+ return NULL;
+
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.sub
+
+ cls: defining_class
+ /
+ repl: object
+ string: object
+ count: Py_ssize_t = 0
+
+Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_sub_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *repl, PyObject *string, Py_ssize_t count)
+/*[clinic end generated code: output=4be141ab04bca60d input=d8d1d4ac2311a07c]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+
+ return pattern_subx(module_state, self, repl, string, count, 0);
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.subn
+
+ cls: defining_class
+ /
+ repl: object
+ string: object
+ count: Py_ssize_t = 0
+
+Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern_subn_impl(PatternObject *self, PyTypeObject *cls,
+ PyObject *repl, PyObject *string,
+ Py_ssize_t count)
+/*[clinic end generated code: output=da02fd85258b1e1f input=8b78a65b8302e58d]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+
+ return pattern_subx(module_state, self, repl, string, count, 1);
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.__copy__
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern___copy___impl(PatternObject *self)
+/*[clinic end generated code: output=85dedc2db1bd8694 input=a730a59d863bc9f5]*/
+{
+ return Py_NewRef(self);
+}
+
+/*[clinic input]
+_sre.SRE_Pattern.__deepcopy__
+
+ memo: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject *memo)
+/*[clinic end generated code: output=2ad25679c1f1204a input=a465b1602f997bed]*/
+{
+ return Py_NewRef(self);
+}
+
+static PyObject *
+pattern_repr(PatternObject *obj)
+{
+ static const struct {
+ const char *name;
+ int value;
+ } flag_names[] = {
+ {"re.TEMPLATE", SRE_FLAG_TEMPLATE},
+ {"re.IGNORECASE", SRE_FLAG_IGNORECASE},
+ {"re.LOCALE", SRE_FLAG_LOCALE},
+ {"re.MULTILINE", SRE_FLAG_MULTILINE},
+ {"re.DOTALL", SRE_FLAG_DOTALL},
+ {"re.UNICODE", SRE_FLAG_UNICODE},
+ {"re.VERBOSE", SRE_FLAG_VERBOSE},
+ {"re.DEBUG", SRE_FLAG_DEBUG},
+ {"re.ASCII", SRE_FLAG_ASCII},
+ };
+ PyObject *result = NULL;
+ PyObject *flag_items;
+ size_t i;
+ int flags = obj->flags;
+
+ /* Omit re.UNICODE for valid string patterns. */
+ if (obj->isbytes == 0 &&
+ (flags & (SRE_FLAG_LOCALE|SRE_FLAG_UNICODE|SRE_FLAG_ASCII)) ==
+ SRE_FLAG_UNICODE)
+ flags &= ~SRE_FLAG_UNICODE;
+
+ flag_items = PyList_New(0);
+ if (!flag_items)
+ return NULL;
+
+ for (i = 0; i < Py_ARRAY_LENGTH(flag_names); i++) {
+ if (flags & flag_names[i].value) {
+ PyObject *item = PyUnicode_FromString(flag_names[i].name);
+ if (!item)
+ goto done;
+
+ if (PyList_Append(flag_items, item) < 0) {
+ Py_DECREF(item);
+ goto done;
+ }
+ Py_DECREF(item);
+ flags &= ~flag_names[i].value;
+ }
+ }
+ if (flags) {
+ PyObject *item = PyUnicode_FromFormat("0x%x", flags);
+ if (!item)
+ goto done;
+
+ if (PyList_Append(flag_items, item) < 0) {
+ Py_DECREF(item);
+ goto done;
+ }
+ Py_DECREF(item);
+ }
+
+ if (PyList_Size(flag_items) > 0) {
+ PyObject *flags_result;
+ PyObject *sep = PyUnicode_FromString("|");
+ if (!sep)
+ goto done;
+ flags_result = PyUnicode_Join(sep, flag_items);
+ Py_DECREF(sep);
+ if (!flags_result)
+ goto done;
+ result = PyUnicode_FromFormat("re.compile(%.200R, %S)",
+ obj->pattern, flags_result);
+ Py_DECREF(flags_result);
+ }
+ else {
+ result = PyUnicode_FromFormat("re.compile(%.200R)", obj->pattern);
+ }
+
+done:
+ Py_DECREF(flag_items);
+ return result;
+}
+
+PyDoc_STRVAR(pattern_doc, "Compiled regular expression object.");
+
+/* PatternObject's 'groupindex' method. */
+static PyObject *
+pattern_groupindex(PatternObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->groupindex == NULL)
+ return PyDict_New();
+ return PyDictProxy_New(self->groupindex);
+}
+
+static int _validate(PatternObject *self); /* Forward */
+
+/*[clinic input]
+_sre.compile
+
+ pattern: object
+ flags: int
+ code: object(subclass_of='&PyList_Type')
+ groups: Py_ssize_t
+ groupindex: object(subclass_of='&PyDict_Type')
+ indexgroup: object(subclass_of='&PyTuple_Type')
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_compile_impl(PyObject *module, PyObject *pattern, int flags,
+ PyObject *code, Py_ssize_t groups, PyObject *groupindex,
+ PyObject *indexgroup)
+/*[clinic end generated code: output=ef9c2b3693776404 input=0a68476dbbe5db30]*/
+{
+ /* "compile" pattern descriptor to pattern object */
+
+ _sremodulestate *module_state = get_sre_module_state(module);
+ PatternObject* self;
+ Py_ssize_t i, n;
+
+ n = PyList_GET_SIZE(code);
+ /* coverity[ampersand_in_size] */
+ self = PyObject_GC_NewVar(PatternObject, module_state->Pattern_Type, n);
+ if (!self)
+ return NULL;
+ self->weakreflist = NULL;
+ self->pattern = NULL;
+ self->groupindex = NULL;
+ self->indexgroup = NULL;
+
+ self->codesize = n;
+
+ for (i = 0; i < n; i++) {
+ PyObject *o = PyList_GET_ITEM(code, i);
+ unsigned long value = PyLong_AsUnsignedLong(o);
+ if (value == (unsigned long)-1 && PyErr_Occurred()) {
+ break;
+ }
+ self->code[i] = (SRE_CODE) value;
+ if ((unsigned long) self->code[i] != value) {
+ PyErr_SetString(PyExc_OverflowError,
+ "regular expression code size limit exceeded");
+ break;
+ }
+ }
+ PyObject_GC_Track(self);
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ if (pattern == Py_None) {
+ self->isbytes = -1;
+ }
+ else {
+ Py_ssize_t p_length;
+ int charsize;
+ Py_buffer view;
+ view.buf = NULL;
+ if (!getstring(pattern, &p_length, &self->isbytes,
+ &charsize, &view)) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (view.buf)
+ PyBuffer_Release(&view);
+ }
+
+ self->pattern = Py_NewRef(pattern);
+
+ self->flags = flags;
+
+ self->groups = groups;
+
+ if (PyDict_GET_SIZE(groupindex) > 0) {
+ self->groupindex = Py_NewRef(groupindex);
+ if (PyTuple_GET_SIZE(indexgroup) > 0) {
+ self->indexgroup = Py_NewRef(indexgroup);
+ }
+ }
+
+ if (!_validate(self)) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ return (PyObject*) self;
+}
+
+/*[clinic input]
+_sre.template
+
+ pattern: object
+ template: object(subclass_of="&PyList_Type")
+ A list containing interleaved literal strings (str or bytes) and group
+ indices (int), as returned by re._parser.parse_template():
+ [literal1, group1, ..., literalN, groupN]
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_template_impl(PyObject *module, PyObject *pattern, PyObject *template)
+/*[clinic end generated code: output=d51290e596ebca86 input=af55380b27f02942]*/
+{
+ /* template is a list containing interleaved literal strings (str or bytes)
+ * and group indices (int), as returned by _parser.parse_template:
+ * [literal1, group1, literal2, ..., literalN].
+ */
+ _sremodulestate *module_state = get_sre_module_state(module);
+ TemplateObject *self = NULL;
+ Py_ssize_t n = PyList_GET_SIZE(template);
+ if ((n & 1) == 0 || n < 1) {
+ goto bad_template;
+ }
+ n /= 2;
+ self = PyObject_GC_NewVar(TemplateObject, module_state->Template_Type, n);
+ if (!self)
+ return NULL;
+ self->chunks = 1 + 2*n;
+ self->literal = Py_NewRef(PyList_GET_ITEM(template, 0));
+ for (Py_ssize_t i = 0; i < n; i++) {
+ Py_ssize_t index = PyLong_AsSsize_t(PyList_GET_ITEM(template, 2*i+1));
+ if (index == -1 && PyErr_Occurred()) {
+ Py_SET_SIZE(self, i);
+ Py_DECREF(self);
+ return NULL;
+ }
+ if (index < 0) {
+ Py_SET_SIZE(self, i);
+ goto bad_template;
+ }
+ self->items[i].index = index;
+
+ PyObject *literal = PyList_GET_ITEM(template, 2*i+2);
+ // Skip empty literals.
+ if ((PyUnicode_Check(literal) && !PyUnicode_GET_LENGTH(literal)) ||
+ (PyBytes_Check(literal) && !PyBytes_GET_SIZE(literal)))
+ {
+ literal = NULL;
+ self->chunks--;
+ }
+ self->items[i].literal = Py_XNewRef(literal);
+ }
+ return (PyObject*) self;
+
+bad_template:
+ PyErr_SetString(PyExc_TypeError, "invalid template");
+ Py_XDECREF(self);
+ return NULL;
+}
+
+/* -------------------------------------------------------------------- */
+/* Code validation */
+
+/* To learn more about this code, have a look at the _compile() function in
+ Lib/sre_compile.py. The validation functions below checks the code array
+ for conformance with the code patterns generated there.
+
+ The nice thing about the generated code is that it is position-independent:
+ all jumps are relative jumps forward. Also, jumps don't cross each other:
+ the target of a later jump is always earlier than the target of an earlier
+ jump. IOW, this is okay:
+
+ J---------J-------T--------T
+ \ \_____/ /
+ \______________________/
+
+ but this is not:
+
+ J---------J-------T--------T
+ \_________\_____/ /
+ \____________/
+
+ It also helps that SRE_CODE is always an unsigned type.
+*/
+
+/* Defining this one enables tracing of the validator */
+#undef VVERBOSE
+
+/* Trace macro for the validator */
+#if defined(VVERBOSE)
+#define VTRACE(v) printf v
+#else
+#define VTRACE(v) do {} while(0) /* do nothing */
+#endif
+
+/* Report failure */
+#define FAIL do { VTRACE(("FAIL: %d\n", __LINE__)); return -1; } while (0)
+
+/* Extract opcode, argument, or skip count from code array */
+#define GET_OP \
+ do { \
+ VTRACE(("%p: ", code)); \
+ if (code >= end) FAIL; \
+ op = *code++; \
+ VTRACE(("%lu (op)\n", (unsigned long)op)); \
+ } while (0)
+#define GET_ARG \
+ do { \
+ VTRACE(("%p= ", code)); \
+ if (code >= end) FAIL; \
+ arg = *code++; \
+ VTRACE(("%lu (arg)\n", (unsigned long)arg)); \
+ } while (0)
+#define GET_SKIP_ADJ(adj) \
+ do { \
+ VTRACE(("%p= ", code)); \
+ if (code >= end) FAIL; \
+ skip = *code; \
+ VTRACE(("%lu (skip to %p)\n", \
+ (unsigned long)skip, code+skip)); \
+ if (skip-adj > (uintptr_t)(end - code)) \
+ FAIL; \
+ code++; \
+ } while (0)
+#define GET_SKIP GET_SKIP_ADJ(0)
+
+static int
+_validate_charset(SRE_CODE *code, SRE_CODE *end)
+{
+ /* Some variables are manipulated by the macros above */
+ SRE_CODE op;
+ SRE_CODE arg;
+ SRE_CODE offset;
+ int i;
+
+ while (code < end) {
+ GET_OP;
+ switch (op) {
+
+ case SRE_OP_NEGATE:
+ break;
+
+ case SRE_OP_LITERAL:
+ GET_ARG;
+ break;
+
+ case SRE_OP_RANGE:
+ case SRE_OP_RANGE_UNI_IGNORE:
+ GET_ARG;
+ GET_ARG;
+ break;
+
+ case SRE_OP_CHARSET:
+ offset = 256/SRE_CODE_BITS; /* 256-bit bitmap */
+ if (offset > (uintptr_t)(end - code))
+ FAIL;
+ code += offset;
+ break;
+
+ case SRE_OP_BIGCHARSET:
+ GET_ARG; /* Number of blocks */
+ offset = 256/sizeof(SRE_CODE); /* 256-byte table */
+ if (offset > (uintptr_t)(end - code))
+ FAIL;
+ /* Make sure that each byte points to a valid block */
+ for (i = 0; i < 256; i++) {
+ if (((unsigned char *)code)[i] >= arg)
+ FAIL;
+ }
+ code += offset;
+ offset = arg * (256/SRE_CODE_BITS); /* 256-bit bitmap times arg */
+ if (offset > (uintptr_t)(end - code))
+ FAIL;
+ code += offset;
+ break;
+
+ case SRE_OP_CATEGORY:
+ GET_ARG;
+ switch (arg) {
+ case SRE_CATEGORY_DIGIT:
+ case SRE_CATEGORY_NOT_DIGIT:
+ case SRE_CATEGORY_SPACE:
+ case SRE_CATEGORY_NOT_SPACE:
+ case SRE_CATEGORY_WORD:
+ case SRE_CATEGORY_NOT_WORD:
+ case SRE_CATEGORY_LINEBREAK:
+ case SRE_CATEGORY_NOT_LINEBREAK:
+ case SRE_CATEGORY_LOC_WORD:
+ case SRE_CATEGORY_LOC_NOT_WORD:
+ case SRE_CATEGORY_UNI_DIGIT:
+ case SRE_CATEGORY_UNI_NOT_DIGIT:
+ case SRE_CATEGORY_UNI_SPACE:
+ case SRE_CATEGORY_UNI_NOT_SPACE:
+ case SRE_CATEGORY_UNI_WORD:
+ case SRE_CATEGORY_UNI_NOT_WORD:
+ case SRE_CATEGORY_UNI_LINEBREAK:
+ case SRE_CATEGORY_UNI_NOT_LINEBREAK:
+ break;
+ default:
+ FAIL;
+ }
+ break;
+
+ default:
+ FAIL;
+
+ }
+ }
+
+ return 0;
+}
+
+/* Returns 0 on success, -1 on failure, and 1 if the last op is JUMP. */
+static int
+_validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
+{
+ /* Some variables are manipulated by the macros above */
+ SRE_CODE op;
+ SRE_CODE arg;
+ SRE_CODE skip;
+
+ VTRACE(("code=%p, end=%p\n", code, end));
+
+ if (code > end)
+ FAIL;
+
+ while (code < end) {
+ GET_OP;
+ switch (op) {
+
+ case SRE_OP_MARK:
+ /* We don't check whether marks are properly nested; the
+ sre_match() code is robust even if they don't, and the worst
+ you can get is nonsensical match results. */
+ GET_ARG;
+ if (arg > 2 * (size_t)groups + 1) {
+ VTRACE(("arg=%d, groups=%d\n", (int)arg, (int)groups));
+ FAIL;
+ }
+ break;
+
+ case SRE_OP_LITERAL:
+ case SRE_OP_NOT_LITERAL:
+ case SRE_OP_LITERAL_IGNORE:
+ case SRE_OP_NOT_LITERAL_IGNORE:
+ case SRE_OP_LITERAL_UNI_IGNORE:
+ case SRE_OP_NOT_LITERAL_UNI_IGNORE:
+ case SRE_OP_LITERAL_LOC_IGNORE:
+ case SRE_OP_NOT_LITERAL_LOC_IGNORE:
+ GET_ARG;
+ /* The arg is just a character, nothing to check */
+ break;
+
+ case SRE_OP_SUCCESS:
+ case SRE_OP_FAILURE:
+ /* Nothing to check; these normally end the matching process */
+ break;
+
+ case SRE_OP_AT:
+ GET_ARG;
+ switch (arg) {
+ case SRE_AT_BEGINNING:
+ case SRE_AT_BEGINNING_STRING:
+ case SRE_AT_BEGINNING_LINE:
+ case SRE_AT_END:
+ case SRE_AT_END_LINE:
+ case SRE_AT_END_STRING:
+ case SRE_AT_BOUNDARY:
+ case SRE_AT_NON_BOUNDARY:
+ case SRE_AT_LOC_BOUNDARY:
+ case SRE_AT_LOC_NON_BOUNDARY:
+ case SRE_AT_UNI_BOUNDARY:
+ case SRE_AT_UNI_NON_BOUNDARY:
+ break;
+ default:
+ FAIL;
+ }
+ break;
+
+ case SRE_OP_ANY:
+ case SRE_OP_ANY_ALL:
+ /* These have no operands */
+ break;
+
+ case SRE_OP_IN:
+ case SRE_OP_IN_IGNORE:
+ case SRE_OP_IN_UNI_IGNORE:
+ case SRE_OP_IN_LOC_IGNORE:
+ GET_SKIP;
+ /* Stop 1 before the end; we check the FAILURE below */
+ if (_validate_charset(code, code+skip-2))
+ FAIL;
+ if (code[skip-2] != SRE_OP_FAILURE)
+ FAIL;
+ code += skip-1;
+ break;
+
+ case SRE_OP_INFO:
+ {
+ /* A minimal info field is
+ <INFO> <1=skip> <2=flags> <3=min> <4=max>;
+ If SRE_INFO_PREFIX or SRE_INFO_CHARSET is in the flags,
+ more follows. */
+ SRE_CODE flags, i;
+ SRE_CODE *newcode;
+ GET_SKIP;
+ newcode = code+skip-1;
+ GET_ARG; flags = arg;
+ GET_ARG;
+ GET_ARG;
+ /* Check that only valid flags are present */
+ if ((flags & ~(SRE_INFO_PREFIX |
+ SRE_INFO_LITERAL |
+ SRE_INFO_CHARSET)) != 0)
+ FAIL;
+ /* PREFIX and CHARSET are mutually exclusive */
+ if ((flags & SRE_INFO_PREFIX) &&
+ (flags & SRE_INFO_CHARSET))
+ FAIL;
+ /* LITERAL implies PREFIX */
+ if ((flags & SRE_INFO_LITERAL) &&
+ !(flags & SRE_INFO_PREFIX))
+ FAIL;
+ /* Validate the prefix */
+ if (flags & SRE_INFO_PREFIX) {
+ SRE_CODE prefix_len;
+ GET_ARG; prefix_len = arg;
+ GET_ARG;
+ /* Here comes the prefix string */
+ if (prefix_len > (uintptr_t)(newcode - code))
+ FAIL;
+ code += prefix_len;
+ /* And here comes the overlap table */
+ if (prefix_len > (uintptr_t)(newcode - code))
+ FAIL;
+ /* Each overlap value should be < prefix_len */
+ for (i = 0; i < prefix_len; i++) {
+ if (code[i] >= prefix_len)
+ FAIL;
+ }
+ code += prefix_len;
+ }
+ /* Validate the charset */
+ if (flags & SRE_INFO_CHARSET) {
+ if (_validate_charset(code, newcode-1))
+ FAIL;
+ if (newcode[-1] != SRE_OP_FAILURE)
+ FAIL;
+ code = newcode;
+ }
+ else if (code != newcode) {
+ VTRACE(("code=%p, newcode=%p\n", code, newcode));
+ FAIL;
+ }
+ }
+ break;
+
+ case SRE_OP_BRANCH:
+ {
+ SRE_CODE *target = NULL;
+ for (;;) {
+ GET_SKIP;
+ if (skip == 0)
+ break;
+ /* Stop 2 before the end; we check the JUMP below */
+ if (_validate_inner(code, code+skip-3, groups))
+ FAIL;
+ code += skip-3;
+ /* Check that it ends with a JUMP, and that each JUMP
+ has the same target */
+ GET_OP;
+ if (op != SRE_OP_JUMP)
+ FAIL;
+ GET_SKIP;
+ if (target == NULL)
+ target = code+skip-1;
+ else if (code+skip-1 != target)
+ FAIL;
+ }
+ if (code != target)
+ FAIL;
+ }
+ break;
+
+ case SRE_OP_REPEAT_ONE:
+ case SRE_OP_MIN_REPEAT_ONE:
+ case SRE_OP_POSSESSIVE_REPEAT_ONE:
+ {
+ SRE_CODE min, max;
+ GET_SKIP;
+ GET_ARG; min = arg;
+ GET_ARG; max = arg;
+ if (min > max)
+ FAIL;
+ if (max > SRE_MAXREPEAT)
+ FAIL;
+ if (_validate_inner(code, code+skip-4, groups))
+ FAIL;
+ code += skip-4;
+ GET_OP;
+ if (op != SRE_OP_SUCCESS)
+ FAIL;
+ }
+ break;
+
+ case SRE_OP_REPEAT:
+ case SRE_OP_POSSESSIVE_REPEAT:
+ {
+ SRE_CODE op1 = op, min, max;
+ GET_SKIP;
+ GET_ARG; min = arg;
+ GET_ARG; max = arg;
+ if (min > max)
+ FAIL;
+ if (max > SRE_MAXREPEAT)
+ FAIL;
+ if (_validate_inner(code, code+skip-3, groups))
+ FAIL;
+ code += skip-3;
+ GET_OP;
+ if (op1 == SRE_OP_POSSESSIVE_REPEAT) {
+ if (op != SRE_OP_SUCCESS)
+ FAIL;
+ }
+ else {
+ if (op != SRE_OP_MAX_UNTIL && op != SRE_OP_MIN_UNTIL)
+ FAIL;
+ }
+ }
+ break;
+
+ case SRE_OP_ATOMIC_GROUP:
+ {
+ GET_SKIP;
+ if (_validate_inner(code, code+skip-2, groups))
+ FAIL;
+ code += skip-2;
+ GET_OP;
+ if (op != SRE_OP_SUCCESS)
+ FAIL;
+ }
+ break;
+
+ case SRE_OP_GROUPREF:
+ case SRE_OP_GROUPREF_IGNORE:
+ case SRE_OP_GROUPREF_UNI_IGNORE:
+ case SRE_OP_GROUPREF_LOC_IGNORE:
+ GET_ARG;
+ if (arg >= (size_t)groups)
+ FAIL;
+ break;
+
+ case SRE_OP_GROUPREF_EXISTS:
+ /* The regex syntax for this is: '(?(group)then|else)', where
+ 'group' is either an integer group number or a group name,
+ 'then' and 'else' are sub-regexes, and 'else' is optional. */
+ GET_ARG;
+ if (arg >= (size_t)groups)
+ FAIL;
+ GET_SKIP_ADJ(1);
+ code--; /* The skip is relative to the first arg! */
+ /* There are two possibilities here: if there is both a 'then'
+ part and an 'else' part, the generated code looks like:
+
+ GROUPREF_EXISTS
+ <group>
+ <skipyes>
+ ...then part...
+ JUMP
+ <skipno>
+ (<skipyes> jumps here)
+ ...else part...
+ (<skipno> jumps here)
+
+ If there is only a 'then' part, it looks like:
+
+ GROUPREF_EXISTS
+ <group>
+ <skip>
+ ...then part...
+ (<skip> jumps here)
+
+ There is no direct way to decide which it is, and we don't want
+ to allow arbitrary jumps anywhere in the code; so we just look
+ for a JUMP opcode preceding our skip target.
+ */
+ VTRACE(("then part:\n"));
+ int rc = _validate_inner(code+1, code+skip-1, groups);
+ if (rc == 1) {
+ VTRACE(("else part:\n"));
+ code += skip-2; /* Position after JUMP, at <skipno> */
+ GET_SKIP;
+ rc = _validate_inner(code, code+skip-1, groups);
+ }
+ if (rc)
+ FAIL;
+ code += skip-1;
+ break;
+
+ case SRE_OP_ASSERT:
+ case SRE_OP_ASSERT_NOT:
+ GET_SKIP;
+ GET_ARG; /* 0 for lookahead, width for lookbehind */
+ code--; /* Back up over arg to simplify math below */
+ /* Stop 1 before the end; we check the SUCCESS below */
+ if (_validate_inner(code+1, code+skip-2, groups))
+ FAIL;
+ code += skip-2;
+ GET_OP;
+ if (op != SRE_OP_SUCCESS)
+ FAIL;
+ break;
+
+ case SRE_OP_JUMP:
+ if (code + 1 != end)
+ FAIL;
+ VTRACE(("JUMP: %d\n", __LINE__));
+ return 1;
+
+ default:
+ FAIL;
+
+ }
+ }
+
+ VTRACE(("okay\n"));
+ return 0;
+}
+
+static int
+_validate_outer(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
+{
+ if (groups < 0 || (size_t)groups > SRE_MAXGROUPS ||
+ code >= end || end[-1] != SRE_OP_SUCCESS)
+ FAIL;
+ return _validate_inner(code, end-1, groups);
+}
+
+static int
+_validate(PatternObject *self)
+{
+ if (_validate_outer(self->code, self->code+self->codesize, self->groups))
+ {
+ PyErr_SetString(PyExc_RuntimeError, "invalid SRE code");
+ return 0;
+ }
+ else
+ VTRACE(("Success!\n"));
+ return 1;
+}
+
+/* -------------------------------------------------------------------- */
+/* match methods */
+
+static int
+match_traverse(MatchObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->string);
+ Py_VISIT(self->regs);
+ Py_VISIT(self->pattern);
+ return 0;
+}
+
+static int
+match_clear(MatchObject *self)
+{
+ Py_CLEAR(self->string);
+ Py_CLEAR(self->regs);
+ Py_CLEAR(self->pattern);
+ return 0;
+}
+
+static void
+match_dealloc(MatchObject* self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+
+ PyObject_GC_UnTrack(self);
+ (void)match_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject*
+match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
+{
+ Py_ssize_t length;
+ int isbytes, charsize;
+ Py_buffer view;
+ PyObject *result;
+ const void* ptr;
+ Py_ssize_t i, j;
+
+ assert(0 <= index && index < self->groups);
+ index *= 2;
+
+ if (self->string == Py_None || self->mark[index] < 0) {
+ /* return default value if the string or group is undefined */
+ return Py_NewRef(def);
+ }
+
+ ptr = getstring(self->string, &length, &isbytes, &charsize, &view);
+ if (ptr == NULL)
+ return NULL;
+
+ i = self->mark[index];
+ j = self->mark[index+1];
+ i = Py_MIN(i, length);
+ j = Py_MIN(j, length);
+ result = getslice(isbytes, ptr, self->string, i, j);
+ if (isbytes && view.buf != NULL)
+ PyBuffer_Release(&view);
+ return result;
+}
+
+static Py_ssize_t
+match_getindex(MatchObject* self, PyObject* index)
+{
+ Py_ssize_t i;
+
+ if (index == NULL)
+ /* Default value */
+ return 0;
+
+ if (PyIndex_Check(index)) {
+ i = PyNumber_AsSsize_t(index, NULL);
+ }
+ else {
+ i = -1;
+
+ if (self->pattern->groupindex) {
+ index = PyDict_GetItemWithError(self->pattern->groupindex, index);
+ if (index && PyLong_Check(index)) {
+ i = PyLong_AsSsize_t(index);
+ }
+ }
+ }
+ if (i < 0 || i >= self->groups) {
+ /* raise IndexError if we were given a bad group number */
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_IndexError, "no such group");
+ }
+ return -1;
+ }
+
+ return i;
+}
+
+static PyObject*
+match_getslice(MatchObject* self, PyObject* index, PyObject* def)
+{
+ Py_ssize_t i = match_getindex(self, index);
+
+ if (i < 0) {
+ return NULL;
+ }
+
+ return match_getslice_by_index(self, i, def);
+}
+
+/*[clinic input]
+_sre.SRE_Match.expand
+
+ template: object
+
+Return the string obtained by doing backslash substitution on the string template, as done by the sub() method.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Match_expand_impl(MatchObject *self, PyObject *template)
+/*[clinic end generated code: output=931b58ccc323c3a1 input=4bfdb22c2f8b146a]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(Py_TYPE(self));
+ PyObject *filter = compile_template(module_state, self->pattern, template);
+ if (filter == NULL) {
+ return NULL;
+ }
+ PyObject *result = expand_template((TemplateObject *)filter, self);
+ Py_DECREF(filter);
+ return result;
+}
+
+static PyObject*
+match_group(MatchObject* self, PyObject* args)
+{
+ PyObject* result;
+ Py_ssize_t i, size;
+
+ size = PyTuple_GET_SIZE(args);
+
+ switch (size) {
+ case 0:
+ result = match_getslice(self, _PyLong_GetZero(), Py_None);
+ break;
+ case 1:
+ result = match_getslice(self, PyTuple_GET_ITEM(args, 0), Py_None);
+ break;
+ default:
+ /* fetch multiple items */
+ result = PyTuple_New(size);
+ if (!result)
+ return NULL;
+ for (i = 0; i < size; i++) {
+ PyObject* item = match_getslice(
+ self, PyTuple_GET_ITEM(args, i), Py_None
+ );
+ if (!item) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(result, i, item);
+ }
+ break;
+ }
+ return result;
+}
+
+static PyObject*
+match_getitem(MatchObject* self, PyObject* name)
+{
+ return match_getslice(self, name, Py_None);
+}
+
+/*[clinic input]
+_sre.SRE_Match.groups
+
+ default: object = None
+ Is used for groups that did not participate in the match.
+
+Return a tuple containing all the subgroups of the match, from 1.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Match_groups_impl(MatchObject *self, PyObject *default_value)
+/*[clinic end generated code: output=daf8e2641537238a input=bb069ef55dabca91]*/
+{
+ PyObject* result;
+ Py_ssize_t index;
+
+ result = PyTuple_New(self->groups-1);
+ if (!result)
+ return NULL;
+
+ for (index = 1; index < self->groups; index++) {
+ PyObject* item;
+ item = match_getslice_by_index(self, index, default_value);
+ if (!item) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(result, index-1, item);
+ }
+
+ return result;
+}
+
+/*[clinic input]
+_sre.SRE_Match.groupdict
+
+ default: object = None
+ Is used for groups that did not participate in the match.
+
+Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Match_groupdict_impl(MatchObject *self, PyObject *default_value)
+/*[clinic end generated code: output=29917c9073e41757 input=0ded7960b23780aa]*/
+{
+ PyObject *result;
+ PyObject *key;
+ PyObject *value;
+ Py_ssize_t pos = 0;
+ Py_hash_t hash;
+
+ result = PyDict_New();
+ if (!result || !self->pattern->groupindex)
+ return result;
+
+ while (_PyDict_Next(self->pattern->groupindex, &pos, &key, &value, &hash)) {
+ int status;
+ Py_INCREF(key);
+ value = match_getslice(self, key, default_value);
+ if (!value) {
+ Py_DECREF(key);
+ goto failed;
+ }
+ status = _PyDict_SetItem_KnownHash(result, key, value, hash);
+ Py_DECREF(value);
+ Py_DECREF(key);
+ if (status < 0)
+ goto failed;
+ }
+
+ return result;
+
+failed:
+ Py_DECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+_sre.SRE_Match.start -> Py_ssize_t
+
+ group: object(c_default="NULL") = 0
+ /
+
+Return index of the start of the substring matched by group.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_sre_SRE_Match_start_impl(MatchObject *self, PyObject *group)
+/*[clinic end generated code: output=3f6e7f9df2fb5201 input=ced8e4ed4b33ee6c]*/
+{
+ Py_ssize_t index = match_getindex(self, group);
+
+ if (index < 0) {
+ return -1;
+ }
+
+ /* mark is -1 if group is undefined */
+ return self->mark[index*2];
+}
+
+/*[clinic input]
+_sre.SRE_Match.end -> Py_ssize_t
+
+ group: object(c_default="NULL") = 0
+ /
+
+Return index of the end of the substring matched by group.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_sre_SRE_Match_end_impl(MatchObject *self, PyObject *group)
+/*[clinic end generated code: output=f4240b09911f7692 input=1b799560c7f3d7e6]*/
+{
+ Py_ssize_t index = match_getindex(self, group);
+
+ if (index < 0) {
+ return -1;
+ }
+
+ /* mark is -1 if group is undefined */
+ return self->mark[index*2+1];
+}
+
+LOCAL(PyObject*)
+_pair(Py_ssize_t i1, Py_ssize_t i2)
+{
+ PyObject* pair;
+ PyObject* item;
+
+ pair = PyTuple_New(2);
+ if (!pair)
+ return NULL;
+
+ item = PyLong_FromSsize_t(i1);
+ if (!item)
+ goto error;
+ PyTuple_SET_ITEM(pair, 0, item);
+
+ item = PyLong_FromSsize_t(i2);
+ if (!item)
+ goto error;
+ PyTuple_SET_ITEM(pair, 1, item);
+
+ return pair;
+
+ error:
+ Py_DECREF(pair);
+ return NULL;
+}
+
+/*[clinic input]
+_sre.SRE_Match.span
+
+ group: object(c_default="NULL") = 0
+ /
+
+For match object m, return the 2-tuple (m.start(group), m.end(group)).
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Match_span_impl(MatchObject *self, PyObject *group)
+/*[clinic end generated code: output=f02ae40594d14fe6 input=8fa6014e982d71d4]*/
+{
+ Py_ssize_t index = match_getindex(self, group);
+
+ if (index < 0) {
+ return NULL;
+ }
+
+ /* marks are -1 if group is undefined */
+ return _pair(self->mark[index*2], self->mark[index*2+1]);
+}
+
+static PyObject*
+match_regs(MatchObject* self)
+{
+ PyObject* regs;
+ PyObject* item;
+ Py_ssize_t index;
+
+ regs = PyTuple_New(self->groups);
+ if (!regs)
+ return NULL;
+
+ for (index = 0; index < self->groups; index++) {
+ item = _pair(self->mark[index*2], self->mark[index*2+1]);
+ if (!item) {
+ Py_DECREF(regs);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(regs, index, item);
+ }
+
+ self->regs = Py_NewRef(regs);
+
+ return regs;
+}
+
+/*[clinic input]
+_sre.SRE_Match.__copy__
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Match___copy___impl(MatchObject *self)
+/*[clinic end generated code: output=a779c5fc8b5b4eb4 input=3bb4d30b6baddb5b]*/
+{
+ return Py_NewRef(self);
+}
+
+/*[clinic input]
+_sre.SRE_Match.__deepcopy__
+
+ memo: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Match___deepcopy__(MatchObject *self, PyObject *memo)
+/*[clinic end generated code: output=ba7cb46d655e4ee2 input=779d12a31c2c325e]*/
+{
+ return Py_NewRef(self);
+}
+
+PyDoc_STRVAR(match_doc,
+"The result of re.match() and re.search().\n\
+Match objects always have a boolean value of True.");
+
+PyDoc_STRVAR(match_group_doc,
+"group([group1, ...]) -> str or tuple.\n\
+ Return subgroup(s) of the match by indices or names.\n\
+ For 0 returns the entire match.");
+
+static PyObject *
+match_lastindex_get(MatchObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->lastindex >= 0)
+ return PyLong_FromSsize_t(self->lastindex);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+match_lastgroup_get(MatchObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->pattern->indexgroup &&
+ self->lastindex >= 0 &&
+ self->lastindex < PyTuple_GET_SIZE(self->pattern->indexgroup))
+ {
+ PyObject *result = PyTuple_GET_ITEM(self->pattern->indexgroup,
+ self->lastindex);
+ return Py_NewRef(result);
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+match_regs_get(MatchObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->regs) {
+ return Py_NewRef(self->regs);
+ } else
+ return match_regs(self);
+}
+
+static PyObject *
+match_repr(MatchObject *self)
+{
+ PyObject *result;
+ PyObject *group0 = match_getslice_by_index(self, 0, Py_None);
+ if (group0 == NULL)
+ return NULL;
+ result = PyUnicode_FromFormat(
+ "<%s object; span=(%zd, %zd), match=%.50R>",
+ Py_TYPE(self)->tp_name,
+ self->mark[0], self->mark[1], group0);
+ Py_DECREF(group0);
+ return result;
+}
+
+
+static PyObject*
+pattern_new_match(_sremodulestate* module_state,
+ PatternObject* pattern,
+ SRE_STATE* state,
+ Py_ssize_t status)
+{
+ /* create match object (from state object) */
+
+ MatchObject* match;
+ Py_ssize_t i, j;
+ char* base;
+ int n;
+
+ if (status > 0) {
+
+ /* create match object (with room for extra group marks) */
+ /* coverity[ampersand_in_size] */
+ match = PyObject_GC_NewVar(MatchObject,
+ module_state->Match_Type,
+ 2*(pattern->groups+1));
+ if (!match)
+ return NULL;
+
+ match->pattern = (PatternObject*)Py_NewRef(pattern);
+
+ match->string = Py_NewRef(state->string);
+
+ match->regs = NULL;
+ match->groups = pattern->groups+1;
+
+ /* fill in group slices */
+
+ base = (char*) state->beginning;
+ n = state->charsize;
+
+ match->mark[0] = ((char*) state->start - base) / n;
+ match->mark[1] = ((char*) state->ptr - base) / n;
+
+ for (i = j = 0; i < pattern->groups; i++, j+=2)
+ if (j+1 <= state->lastmark && state->mark[j] && state->mark[j+1]) {
+ match->mark[j+2] = ((char*) state->mark[j] - base) / n;
+ match->mark[j+3] = ((char*) state->mark[j+1] - base) / n;
+
+ /* check wrong span */
+ if (match->mark[j+2] > match->mark[j+3]) {
+ PyErr_SetString(PyExc_SystemError,
+ "The span of capturing group is wrong,"
+ " please report a bug for the re module.");
+ Py_DECREF(match);
+ return NULL;
+ }
+ } else
+ match->mark[j+2] = match->mark[j+3] = -1; /* undefined */
+
+ match->pos = state->pos;
+ match->endpos = state->endpos;
+
+ match->lastindex = state->lastindex;
+
+ PyObject_GC_Track(match);
+ return (PyObject*) match;
+
+ } else if (status == 0) {
+
+ /* no match */
+ Py_RETURN_NONE;
+
+ }
+
+ /* internal error */
+ pattern_error(status);
+ return NULL;
+}
+
+
+/* -------------------------------------------------------------------- */
+/* scanner methods (experimental) */
+
+static int
+scanner_traverse(ScannerObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->pattern);
+ return 0;
+}
+
+static int
+scanner_clear(ScannerObject *self)
+{
+ Py_CLEAR(self->pattern);
+ return 0;
+}
+
+static void
+scanner_dealloc(ScannerObject* self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+
+ PyObject_GC_UnTrack(self);
+ state_fini(&self->state);
+ (void)scanner_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static int
+scanner_begin(ScannerObject* self)
+{
+ if (self->executing) {
+ PyErr_SetString(PyExc_ValueError,
+ "regular expression scanner already executing");
+ return 0;
+ }
+ self->executing = 1;
+ return 1;
+}
+
+static void
+scanner_end(ScannerObject* self)
+{
+ assert(self->executing);
+ self->executing = 0;
+}
+
+/*[clinic input]
+_sre.SRE_Scanner.match
+
+ cls: defining_class
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Scanner_match_impl(ScannerObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=6e22c149dc0f0325 input=b5146e1f30278cb7]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+ SRE_STATE* state = &self->state;
+ PyObject* match;
+ Py_ssize_t status;
+
+ if (!scanner_begin(self)) {
+ return NULL;
+ }
+ if (state->start == NULL) {
+ scanner_end(self);
+ Py_RETURN_NONE;
+ }
+
+ state_reset(state);
+
+ state->ptr = state->start;
+
+ status = sre_match(state, PatternObject_GetCode(self->pattern));
+ if (PyErr_Occurred()) {
+ scanner_end(self);
+ return NULL;
+ }
+
+ match = pattern_new_match(module_state, (PatternObject*) self->pattern,
+ state, status);
+
+ if (status == 0)
+ state->start = NULL;
+ else {
+ state->must_advance = (state->ptr == state->start);
+ state->start = state->ptr;
+ }
+
+ scanner_end(self);
+ return match;
+}
+
+
+/*[clinic input]
+_sre.SRE_Scanner.search
+
+ cls: defining_class
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_sre_SRE_Scanner_search_impl(ScannerObject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=23e8fc78013f9161 input=056c2d37171d0bf2]*/
+{
+ _sremodulestate *module_state = get_sre_module_state_by_class(cls);
+ SRE_STATE* state = &self->state;
+ PyObject* match;
+ Py_ssize_t status;
+
+ if (!scanner_begin(self)) {
+ return NULL;
+ }
+ if (state->start == NULL) {
+ scanner_end(self);
+ Py_RETURN_NONE;
+ }
+
+ state_reset(state);
+
+ state->ptr = state->start;
+
+ status = sre_search(state, PatternObject_GetCode(self->pattern));
+ if (PyErr_Occurred()) {
+ scanner_end(self);
+ return NULL;
+ }
+
+ match = pattern_new_match(module_state, (PatternObject*) self->pattern,
+ state, status);
+
+ if (status == 0)
+ state->start = NULL;
+ else {
+ state->must_advance = (state->ptr == state->start);
+ state->start = state->ptr;
+ }
+
+ scanner_end(self);
+ return match;
+}
+
+static PyObject *
+pattern_scanner(_sremodulestate *module_state,
+ PatternObject *self,
+ PyObject *string,
+ Py_ssize_t pos,
+ Py_ssize_t endpos)
+{
+ ScannerObject* scanner;
+
+ /* create scanner object */
+ scanner = PyObject_GC_New(ScannerObject, module_state->Scanner_Type);
+ if (!scanner)
+ return NULL;
+ scanner->pattern = NULL;
+ scanner->executing = 0;
+
+ /* create search state object */
+ if (!state_init(&scanner->state, self, string, pos, endpos)) {
+ Py_DECREF(scanner);
+ return NULL;
+ }
+
+ scanner->pattern = Py_NewRef(self);
+
+ PyObject_GC_Track(scanner);
+ return (PyObject*) scanner;
+}
+
+/* -------------------------------------------------------------------- */
+/* template methods */
+
+static int
+template_traverse(TemplateObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->literal);
+ for (Py_ssize_t i = 0, n = Py_SIZE(self); i < n; i++) {
+ Py_VISIT(self->items[i].literal);
+ }
+ return 0;
+}
+
+static int
+template_clear(TemplateObject *self)
+{
+ Py_CLEAR(self->literal);
+ for (Py_ssize_t i = 0, n = Py_SIZE(self); i < n; i++) {
+ Py_CLEAR(self->items[i].literal);
+ }
+ return 0;
+}
+
+static void
+template_dealloc(TemplateObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+
+ PyObject_GC_UnTrack(self);
+ (void)template_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+expand_template(TemplateObject *self, MatchObject *match)
+{
+ if (Py_SIZE(self) == 0) {
+ return Py_NewRef(self->literal);
+ }
+
+ PyObject *result = NULL;
+ Py_ssize_t count = 0; // the number of non-empty chunks
+ /* For small number of strings use a buffer allocated on the stack,
+ * otherwise use a list object. */
+ PyObject *buffer[10];
+ PyObject **out = buffer;
+ PyObject *list = NULL;
+ if (self->chunks > (int)Py_ARRAY_LENGTH(buffer) ||
+ !PyUnicode_Check(self->literal))
+ {
+ list = PyList_New(self->chunks);
+ if (!list) {
+ return NULL;
+ }
+ out = &PyList_GET_ITEM(list, 0);
+ }
+
+ out[count++] = Py_NewRef(self->literal);
+ for (Py_ssize_t i = 0; i < Py_SIZE(self); i++) {
+ Py_ssize_t index = self->items[i].index;
+ if (index >= match->groups) {
+ PyErr_SetString(PyExc_IndexError, "no such group");
+ goto cleanup;
+ }
+ PyObject *item = match_getslice_by_index(match, index, Py_None);
+ if (item == NULL) {
+ goto cleanup;
+ }
+ if (item != Py_None) {
+ out[count++] = Py_NewRef(item);
+ }
+ Py_DECREF(item);
+
+ PyObject *literal = self->items[i].literal;
+ if (literal != NULL) {
+ out[count++] = Py_NewRef(literal);
+ }
+ }
+
+ if (PyUnicode_Check(self->literal)) {
+ result = _PyUnicode_JoinArray(&_Py_STR(empty), out, count);
+ }
+ else {
+ Py_SET_SIZE(list, count);
+ result = _PyBytes_Join((PyObject *)&_Py_SINGLETON(bytes_empty), list);
+ }
+
+cleanup:
+ if (list) {
+ Py_DECREF(list);
+ }
+ else {
+ for (Py_ssize_t i = 0; i < count; i++) {
+ Py_DECREF(out[i]);
+ }
+ }
+ return result;
+}
+
+
+static Py_hash_t
+pattern_hash(PatternObject *self)
+{
+ Py_hash_t hash, hash2;
+
+ hash = PyObject_Hash(self->pattern);
+ if (hash == -1) {
+ return -1;
+ }
+
+ hash2 = _Py_HashBytes(self->code, sizeof(self->code[0]) * self->codesize);
+ hash ^= hash2;
+
+ hash ^= self->flags;
+ hash ^= self->isbytes;
+ hash ^= self->codesize;
+
+ if (hash == -1) {
+ hash = -2;
+ }
+ return hash;
+}
+
+static PyObject*
+pattern_richcompare(PyObject *lefto, PyObject *righto, int op)
+{
+ PyTypeObject *tp = Py_TYPE(lefto);
+ _sremodulestate *module_state = get_sre_module_state_by_class(tp);
+ PatternObject *left, *right;
+ int cmp;
+
+ if (op != Py_EQ && op != Py_NE) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+ if (!Py_IS_TYPE(righto, module_state->Pattern_Type))
+ {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+ if (lefto == righto) {
+ /* a pattern is equal to itself */
+ return PyBool_FromLong(op == Py_EQ);
+ }
+
+ left = (PatternObject *)lefto;
+ right = (PatternObject *)righto;
+
+ cmp = (left->flags == right->flags
+ && left->isbytes == right->isbytes
+ && left->codesize == right->codesize);
+ if (cmp) {
+ /* Compare the code and the pattern because the same pattern can
+ produce different codes depending on the locale used to compile the
+ pattern when the re.LOCALE flag is used. Don't compare groups,
+ indexgroup nor groupindex: they are derivated from the pattern. */
+ cmp = (memcmp(left->code, right->code,
+ sizeof(left->code[0]) * left->codesize) == 0);
+ }
+ if (cmp) {
+ cmp = PyObject_RichCompareBool(left->pattern, right->pattern,
+ Py_EQ);
+ if (cmp < 0) {
+ return NULL;
+ }
+ }
+ if (op == Py_NE) {
+ cmp = !cmp;
+ }
+ return PyBool_FromLong(cmp);
+}
+
+#include "clinic/sre.c.h"
+
+static PyMethodDef pattern_methods[] = {
+ _SRE_SRE_PATTERN_MATCH_METHODDEF
+ _SRE_SRE_PATTERN_FULLMATCH_METHODDEF
+ _SRE_SRE_PATTERN_SEARCH_METHODDEF
+ _SRE_SRE_PATTERN_SUB_METHODDEF
+ _SRE_SRE_PATTERN_SUBN_METHODDEF
+ _SRE_SRE_PATTERN_FINDALL_METHODDEF
+ _SRE_SRE_PATTERN_SPLIT_METHODDEF
+ _SRE_SRE_PATTERN_FINDITER_METHODDEF
+ _SRE_SRE_PATTERN_SCANNER_METHODDEF
+ _SRE_SRE_PATTERN___COPY___METHODDEF
+ _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS,
+ PyDoc_STR("See PEP 585")},
+ {NULL, NULL}
+};
+
+static PyGetSetDef pattern_getset[] = {
+ {"groupindex", (getter)pattern_groupindex, (setter)NULL,
+ "A dictionary mapping group names to group numbers."},
+ {NULL} /* Sentinel */
+};
+
+#define PAT_OFF(x) offsetof(PatternObject, x)
+static PyMemberDef pattern_members[] = {
+ {"pattern", T_OBJECT, PAT_OFF(pattern), READONLY,
+ "The pattern string from which the RE object was compiled."},
+ {"flags", T_INT, PAT_OFF(flags), READONLY,
+ "The regex matching flags."},
+ {"groups", T_PYSSIZET, PAT_OFF(groups), READONLY,
+ "The number of capturing groups in the pattern."},
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(PatternObject, weakreflist), READONLY},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot pattern_slots[] = {
+ {Py_tp_dealloc, (destructor)pattern_dealloc},
+ {Py_tp_repr, (reprfunc)pattern_repr},
+ {Py_tp_hash, (hashfunc)pattern_hash},
+ {Py_tp_doc, (void *)pattern_doc},
+ {Py_tp_richcompare, pattern_richcompare},
+ {Py_tp_methods, pattern_methods},
+ {Py_tp_members, pattern_members},
+ {Py_tp_getset, pattern_getset},
+ {Py_tp_traverse, pattern_traverse},
+ {Py_tp_clear, pattern_clear},
+ {0, NULL},
+};
+
+static PyType_Spec pattern_spec = {
+ .name = "re.Pattern",
+ .basicsize = sizeof(PatternObject),
+ .itemsize = sizeof(SRE_CODE),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_HAVE_GC),
+ .slots = pattern_slots,
+};
+
+static PyMethodDef match_methods[] = {
+ {"group", (PyCFunction) match_group, METH_VARARGS, match_group_doc},
+ _SRE_SRE_MATCH_START_METHODDEF
+ _SRE_SRE_MATCH_END_METHODDEF
+ _SRE_SRE_MATCH_SPAN_METHODDEF
+ _SRE_SRE_MATCH_GROUPS_METHODDEF
+ _SRE_SRE_MATCH_GROUPDICT_METHODDEF
+ _SRE_SRE_MATCH_EXPAND_METHODDEF
+ _SRE_SRE_MATCH___COPY___METHODDEF
+ _SRE_SRE_MATCH___DEEPCOPY___METHODDEF
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS,
+ PyDoc_STR("See PEP 585")},
+ {NULL, NULL}
+};
+
+static PyGetSetDef match_getset[] = {
+ {"lastindex", (getter)match_lastindex_get, (setter)NULL,
+ "The integer index of the last matched capturing group."},
+ {"lastgroup", (getter)match_lastgroup_get, (setter)NULL,
+ "The name of the last matched capturing group."},
+ {"regs", (getter)match_regs_get, (setter)NULL},
+ {NULL}
+};
+
+#define MATCH_OFF(x) offsetof(MatchObject, x)
+static PyMemberDef match_members[] = {
+ {"string", T_OBJECT, MATCH_OFF(string), READONLY,
+ "The string passed to match() or search()."},
+ {"re", T_OBJECT, MATCH_OFF(pattern), READONLY,
+ "The regular expression object."},
+ {"pos", T_PYSSIZET, MATCH_OFF(pos), READONLY,
+ "The index into the string at which the RE engine started looking for a match."},
+ {"endpos", T_PYSSIZET, MATCH_OFF(endpos), READONLY,
+ "The index into the string beyond which the RE engine will not go."},
+ {NULL}
+};
+
+/* FIXME: implement setattr("string", None) as a special case (to
+ detach the associated string, if any */
+static PyType_Slot match_slots[] = {
+ {Py_tp_dealloc, match_dealloc},
+ {Py_tp_repr, match_repr},
+ {Py_tp_doc, (void *)match_doc},
+ {Py_tp_methods, match_methods},
+ {Py_tp_members, match_members},
+ {Py_tp_getset, match_getset},
+ {Py_tp_traverse, match_traverse},
+ {Py_tp_clear, match_clear},
+
+ /* As mapping.
+ *
+ * Match objects do not support length or assignment, but do support
+ * __getitem__.
+ */
+ {Py_mp_subscript, match_getitem},
+
+ {0, NULL},
+};
+
+static PyType_Spec match_spec = {
+ .name = "re.Match",
+ .basicsize = sizeof(MatchObject),
+ .itemsize = sizeof(Py_ssize_t),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_HAVE_GC),
+ .slots = match_slots,
+};
+
+static PyMethodDef scanner_methods[] = {
+ _SRE_SRE_SCANNER_MATCH_METHODDEF
+ _SRE_SRE_SCANNER_SEARCH_METHODDEF
+ {NULL, NULL}
+};
+
+#define SCAN_OFF(x) offsetof(ScannerObject, x)
+static PyMemberDef scanner_members[] = {
+ {"pattern", T_OBJECT, SCAN_OFF(pattern), READONLY},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot scanner_slots[] = {
+ {Py_tp_dealloc, scanner_dealloc},
+ {Py_tp_methods, scanner_methods},
+ {Py_tp_members, scanner_members},
+ {Py_tp_traverse, scanner_traverse},
+ {Py_tp_clear, scanner_clear},
+ {0, NULL},
+};
+
+static PyType_Spec scanner_spec = {
+ .name = "_sre.SRE_Scanner",
+ .basicsize = sizeof(ScannerObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_HAVE_GC),
+ .slots = scanner_slots,
+};
+
+static PyType_Slot template_slots[] = {
+ {Py_tp_dealloc, template_dealloc},
+ {Py_tp_traverse, template_traverse},
+ {Py_tp_clear, template_clear},
+ {0, NULL},
+};
+
+static PyType_Spec template_spec = {
+ .name = "_sre.SRE_Template",
+ .basicsize = sizeof(TemplateObject),
+ .itemsize = sizeof(((TemplateObject *)0)->items[0]),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_HAVE_GC),
+ .slots = template_slots,
+};
+
+static PyMethodDef _functions[] = {
+ _SRE_COMPILE_METHODDEF
+ _SRE_TEMPLATE_METHODDEF
+ _SRE_GETCODESIZE_METHODDEF
+ _SRE_ASCII_ISCASED_METHODDEF
+ _SRE_UNICODE_ISCASED_METHODDEF
+ _SRE_ASCII_TOLOWER_METHODDEF
+ _SRE_UNICODE_TOLOWER_METHODDEF
+ {NULL, NULL}
+};
+
+static int
+sre_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _sremodulestate *state = get_sre_module_state(module);
+
+ Py_VISIT(state->Pattern_Type);
+ Py_VISIT(state->Match_Type);
+ Py_VISIT(state->Scanner_Type);
+ Py_VISIT(state->Template_Type);
+ Py_VISIT(state->compile_template);
+
+ return 0;
+}
+
+static int
+sre_clear(PyObject *module)
+{
+ _sremodulestate *state = get_sre_module_state(module);
+
+ Py_CLEAR(state->Pattern_Type);
+ Py_CLEAR(state->Match_Type);
+ Py_CLEAR(state->Scanner_Type);
+ Py_CLEAR(state->Template_Type);
+ Py_CLEAR(state->compile_template);
+
+ return 0;
+}
+
+static void
+sre_free(void *module)
+{
+ sre_clear((PyObject *)module);
+}
+
+#define CREATE_TYPE(m, type, spec) \
+do { \
+ type = (PyTypeObject *)PyType_FromModuleAndSpec(m, spec, NULL); \
+ if (type == NULL) { \
+ goto error; \
+ } \
+} while (0)
+
+#define ADD_ULONG_CONSTANT(module, name, value) \
+ do { \
+ PyObject *o = PyLong_FromUnsignedLong(value); \
+ if (!o) \
+ goto error; \
+ int res = PyModule_AddObjectRef(module, name, o); \
+ Py_DECREF(o); \
+ if (res < 0) { \
+ goto error; \
+ } \
+} while (0)
+
+static int
+sre_exec(PyObject *m)
+{
+ _sremodulestate *state;
+
+ /* Create heap types */
+ state = get_sre_module_state(m);
+ CREATE_TYPE(m, state->Pattern_Type, &pattern_spec);
+ CREATE_TYPE(m, state->Match_Type, &match_spec);
+ CREATE_TYPE(m, state->Scanner_Type, &scanner_spec);
+ CREATE_TYPE(m, state->Template_Type, &template_spec);
+
+ if (PyModule_AddIntConstant(m, "MAGIC", SRE_MAGIC) < 0) {
+ goto error;
+ }
+
+ if (PyModule_AddIntConstant(m, "CODESIZE", sizeof(SRE_CODE)) < 0) {
+ goto error;
+ }
+
+ ADD_ULONG_CONSTANT(m, "MAXREPEAT", SRE_MAXREPEAT);
+ ADD_ULONG_CONSTANT(m, "MAXGROUPS", SRE_MAXGROUPS);
+
+ if (PyModule_AddStringConstant(m, "copyright", copyright) < 0) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ return -1;
+}
+
+static PyModuleDef_Slot sre_slots[] = {
+ {Py_mod_exec, sre_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static struct PyModuleDef sremodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_sre",
+ .m_size = sizeof(_sremodulestate),
+ .m_methods = _functions,
+ .m_slots = sre_slots,
+ .m_traverse = sre_traverse,
+ .m_free = sre_free,
+ .m_clear = sre_clear,
+};
+
+PyMODINIT_FUNC
+PyInit__sre(void)
+{
+ return PyModuleDef_Init(&sremodule);
+}
+
+/* vim:ts=4:sw=4:et
+*/
diff --git a/contrib/tools/python3/Modules/_sre/sre.h b/contrib/tools/python3/Modules/_sre/sre.h
new file mode 100644
index 00000000000..a0f235606e2
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sre/sre.h
@@ -0,0 +1,107 @@
+/*
+ * Secret Labs' Regular Expression Engine
+ *
+ * regular expression matching engine
+ *
+ * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
+ *
+ * See the sre.c file for information on usage and redistribution.
+ */
+
+#ifndef SRE_INCLUDED
+#define SRE_INCLUDED
+
+#include "sre_constants.h"
+
+/* size of a code word (must be unsigned short or larger, and
+ large enough to hold a UCS4 character) */
+#define SRE_CODE Py_UCS4
+#if SIZEOF_SIZE_T > 4
+# define SRE_MAXREPEAT (~(SRE_CODE)0)
+# define SRE_MAXGROUPS ((SRE_CODE)INT32_MAX / 2)
+#else
+# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX)
+# define SRE_MAXGROUPS ((SRE_CODE)PY_SSIZE_T_MAX / SIZEOF_VOID_P / 2)
+#endif
+
+typedef struct {
+ PyObject_VAR_HEAD
+ Py_ssize_t groups; /* must be first! */
+ PyObject* groupindex; /* dict */
+ PyObject* indexgroup; /* tuple */
+ /* compatibility */
+ PyObject* pattern; /* pattern source (or None) */
+ int flags; /* flags used when compiling pattern source */
+ PyObject *weakreflist; /* List of weak references */
+ int isbytes; /* pattern type (1 - bytes, 0 - string, -1 - None) */
+ /* pattern code */
+ Py_ssize_t codesize;
+ SRE_CODE code[1];
+} PatternObject;
+
+#define PatternObject_GetCode(o) (((PatternObject*)(o))->code)
+
+typedef struct {
+ PyObject_VAR_HEAD
+ PyObject* string; /* link to the target string (must be first) */
+ PyObject* regs; /* cached list of matching spans */
+ PatternObject* pattern; /* link to the regex (pattern) object */
+ Py_ssize_t pos, endpos; /* current target slice */
+ Py_ssize_t lastindex; /* last index marker seen by the engine (-1 if none) */
+ Py_ssize_t groups; /* number of groups (start/end marks) */
+ Py_ssize_t mark[1];
+} MatchObject;
+
+typedef struct {
+ PyObject_VAR_HEAD
+ Py_ssize_t chunks; /* the number of group references and non-NULL literals
+ * self->chunks <= 2*Py_SIZE(self) + 1 */
+ PyObject *literal;
+ struct {
+ Py_ssize_t index;
+ PyObject *literal; /* NULL if empty */
+ } items[0];
+} TemplateObject;
+
+typedef struct SRE_REPEAT_T {
+ Py_ssize_t count;
+ const SRE_CODE* pattern; /* points to REPEAT operator arguments */
+ const void* last_ptr; /* helper to check for infinite loops */
+ struct SRE_REPEAT_T *prev; /* points to previous repeat context */
+} SRE_REPEAT;
+
+typedef struct {
+ /* string pointers */
+ const void* ptr; /* current position (also end of current slice) */
+ const void* beginning; /* start of original string */
+ const void* start; /* start of current slice */
+ const void* end; /* end of original string */
+ /* attributes for the match object */
+ PyObject* string;
+ Py_buffer buffer;
+ Py_ssize_t pos, endpos;
+ int isbytes;
+ int charsize; /* character size */
+ int match_all;
+ int must_advance;
+ /* marks */
+ int lastmark;
+ int lastindex;
+ const void** mark;
+ /* dynamically allocated stuff */
+ char* data_stack;
+ size_t data_stack_size;
+ size_t data_stack_base;
+ /* current repeat context */
+ SRE_REPEAT *repeat;
+ unsigned int sigcount;
+} SRE_STATE;
+
+typedef struct {
+ PyObject_HEAD
+ PyObject* pattern;
+ SRE_STATE state;
+ int executing;
+} ScannerObject;
+
+#endif
diff --git a/contrib/tools/python3/Modules/_sre/sre_constants.h b/contrib/tools/python3/Modules/_sre/sre_constants.h
new file mode 100644
index 00000000000..b5692292f65
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sre/sre_constants.h
@@ -0,0 +1,99 @@
+/*
+ * Secret Labs' Regular Expression Engine
+ *
+ * regular expression matching engine
+ *
+ * Auto-generated by Tools/build/generate_sre_constants.py from
+ * Lib/re/_constants.py.
+ *
+ * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
+ *
+ * See the sre.c file for information on usage and redistribution.
+ */
+
+#define SRE_MAGIC 20221023
+#define SRE_OP_FAILURE 0
+#define SRE_OP_SUCCESS 1
+#define SRE_OP_ANY 2
+#define SRE_OP_ANY_ALL 3
+#define SRE_OP_ASSERT 4
+#define SRE_OP_ASSERT_NOT 5
+#define SRE_OP_AT 6
+#define SRE_OP_BRANCH 7
+#define SRE_OP_CATEGORY 8
+#define SRE_OP_CHARSET 9
+#define SRE_OP_BIGCHARSET 10
+#define SRE_OP_GROUPREF 11
+#define SRE_OP_GROUPREF_EXISTS 12
+#define SRE_OP_IN 13
+#define SRE_OP_INFO 14
+#define SRE_OP_JUMP 15
+#define SRE_OP_LITERAL 16
+#define SRE_OP_MARK 17
+#define SRE_OP_MAX_UNTIL 18
+#define SRE_OP_MIN_UNTIL 19
+#define SRE_OP_NOT_LITERAL 20
+#define SRE_OP_NEGATE 21
+#define SRE_OP_RANGE 22
+#define SRE_OP_REPEAT 23
+#define SRE_OP_REPEAT_ONE 24
+#define SRE_OP_SUBPATTERN 25
+#define SRE_OP_MIN_REPEAT_ONE 26
+#define SRE_OP_ATOMIC_GROUP 27
+#define SRE_OP_POSSESSIVE_REPEAT 28
+#define SRE_OP_POSSESSIVE_REPEAT_ONE 29
+#define SRE_OP_GROUPREF_IGNORE 30
+#define SRE_OP_IN_IGNORE 31
+#define SRE_OP_LITERAL_IGNORE 32
+#define SRE_OP_NOT_LITERAL_IGNORE 33
+#define SRE_OP_GROUPREF_LOC_IGNORE 34
+#define SRE_OP_IN_LOC_IGNORE 35
+#define SRE_OP_LITERAL_LOC_IGNORE 36
+#define SRE_OP_NOT_LITERAL_LOC_IGNORE 37
+#define SRE_OP_GROUPREF_UNI_IGNORE 38
+#define SRE_OP_IN_UNI_IGNORE 39
+#define SRE_OP_LITERAL_UNI_IGNORE 40
+#define SRE_OP_NOT_LITERAL_UNI_IGNORE 41
+#define SRE_OP_RANGE_UNI_IGNORE 42
+#define SRE_AT_BEGINNING 0
+#define SRE_AT_BEGINNING_LINE 1
+#define SRE_AT_BEGINNING_STRING 2
+#define SRE_AT_BOUNDARY 3
+#define SRE_AT_NON_BOUNDARY 4
+#define SRE_AT_END 5
+#define SRE_AT_END_LINE 6
+#define SRE_AT_END_STRING 7
+#define SRE_AT_LOC_BOUNDARY 8
+#define SRE_AT_LOC_NON_BOUNDARY 9
+#define SRE_AT_UNI_BOUNDARY 10
+#define SRE_AT_UNI_NON_BOUNDARY 11
+#define SRE_CATEGORY_DIGIT 0
+#define SRE_CATEGORY_NOT_DIGIT 1
+#define SRE_CATEGORY_SPACE 2
+#define SRE_CATEGORY_NOT_SPACE 3
+#define SRE_CATEGORY_WORD 4
+#define SRE_CATEGORY_NOT_WORD 5
+#define SRE_CATEGORY_LINEBREAK 6
+#define SRE_CATEGORY_NOT_LINEBREAK 7
+#define SRE_CATEGORY_LOC_WORD 8
+#define SRE_CATEGORY_LOC_NOT_WORD 9
+#define SRE_CATEGORY_UNI_DIGIT 10
+#define SRE_CATEGORY_UNI_NOT_DIGIT 11
+#define SRE_CATEGORY_UNI_SPACE 12
+#define SRE_CATEGORY_UNI_NOT_SPACE 13
+#define SRE_CATEGORY_UNI_WORD 14
+#define SRE_CATEGORY_UNI_NOT_WORD 15
+#define SRE_CATEGORY_UNI_LINEBREAK 16
+#define SRE_CATEGORY_UNI_NOT_LINEBREAK 17
+#define SRE_FLAG_TEMPLATE 1
+#define SRE_FLAG_IGNORECASE 2
+#define SRE_FLAG_LOCALE 4
+#define SRE_FLAG_MULTILINE 8
+#define SRE_FLAG_DOTALL 16
+#define SRE_FLAG_UNICODE 32
+#define SRE_FLAG_VERBOSE 64
+#define SRE_FLAG_DEBUG 128
+#define SRE_FLAG_ASCII 256
+#define SRE_INFO_PREFIX 1
+#define SRE_INFO_LITERAL 2
+#define SRE_INFO_CHARSET 4
diff --git a/contrib/tools/python3/Modules/_sre/sre_lib.h b/contrib/tools/python3/Modules/_sre/sre_lib.h
new file mode 100644
index 00000000000..95c1ada908d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sre/sre_lib.h
@@ -0,0 +1,1818 @@
+/*
+ * Secret Labs' Regular Expression Engine
+ *
+ * regular expression matching engine
+ *
+ * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
+ *
+ * See the sre.c file for information on usage and redistribution.
+ */
+
+/* String matching engine */
+
+/* This file is included three times, with different character settings */
+
+LOCAL(int)
+SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at)
+{
+ /* check if pointer is at given position */
+
+ Py_ssize_t thisp, thatp;
+
+ switch (at) {
+
+ case SRE_AT_BEGINNING:
+ case SRE_AT_BEGINNING_STRING:
+ return ((void*) ptr == state->beginning);
+
+ case SRE_AT_BEGINNING_LINE:
+ return ((void*) ptr == state->beginning ||
+ SRE_IS_LINEBREAK((int) ptr[-1]));
+
+ case SRE_AT_END:
+ return (((SRE_CHAR *)state->end - ptr == 1 &&
+ SRE_IS_LINEBREAK((int) ptr[0])) ||
+ ((void*) ptr == state->end));
+
+ case SRE_AT_END_LINE:
+ return ((void*) ptr == state->end ||
+ SRE_IS_LINEBREAK((int) ptr[0]));
+
+ case SRE_AT_END_STRING:
+ return ((void*) ptr == state->end);
+
+ case SRE_AT_BOUNDARY:
+ if (state->beginning == state->end)
+ return 0;
+ thatp = ((void*) ptr > state->beginning) ?
+ SRE_IS_WORD((int) ptr[-1]) : 0;
+ thisp = ((void*) ptr < state->end) ?
+ SRE_IS_WORD((int) ptr[0]) : 0;
+ return thisp != thatp;
+
+ case SRE_AT_NON_BOUNDARY:
+ if (state->beginning == state->end)
+ return 0;
+ thatp = ((void*) ptr > state->beginning) ?
+ SRE_IS_WORD((int) ptr[-1]) : 0;
+ thisp = ((void*) ptr < state->end) ?
+ SRE_IS_WORD((int) ptr[0]) : 0;
+ return thisp == thatp;
+
+ case SRE_AT_LOC_BOUNDARY:
+ if (state->beginning == state->end)
+ return 0;
+ thatp = ((void*) ptr > state->beginning) ?
+ SRE_LOC_IS_WORD((int) ptr[-1]) : 0;
+ thisp = ((void*) ptr < state->end) ?
+ SRE_LOC_IS_WORD((int) ptr[0]) : 0;
+ return thisp != thatp;
+
+ case SRE_AT_LOC_NON_BOUNDARY:
+ if (state->beginning == state->end)
+ return 0;
+ thatp = ((void*) ptr > state->beginning) ?
+ SRE_LOC_IS_WORD((int) ptr[-1]) : 0;
+ thisp = ((void*) ptr < state->end) ?
+ SRE_LOC_IS_WORD((int) ptr[0]) : 0;
+ return thisp == thatp;
+
+ case SRE_AT_UNI_BOUNDARY:
+ if (state->beginning == state->end)
+ return 0;
+ thatp = ((void*) ptr > state->beginning) ?
+ SRE_UNI_IS_WORD((int) ptr[-1]) : 0;
+ thisp = ((void*) ptr < state->end) ?
+ SRE_UNI_IS_WORD((int) ptr[0]) : 0;
+ return thisp != thatp;
+
+ case SRE_AT_UNI_NON_BOUNDARY:
+ if (state->beginning == state->end)
+ return 0;
+ thatp = ((void*) ptr > state->beginning) ?
+ SRE_UNI_IS_WORD((int) ptr[-1]) : 0;
+ thisp = ((void*) ptr < state->end) ?
+ SRE_UNI_IS_WORD((int) ptr[0]) : 0;
+ return thisp == thatp;
+
+ }
+
+ return 0;
+}
+
+LOCAL(int)
+SRE(charset)(SRE_STATE* state, const SRE_CODE* set, SRE_CODE ch)
+{
+ /* check if character is a member of the given set */
+
+ int ok = 1;
+
+ for (;;) {
+ switch (*set++) {
+
+ case SRE_OP_FAILURE:
+ return !ok;
+
+ case SRE_OP_LITERAL:
+ /* <LITERAL> <code> */
+ if (ch == set[0])
+ return ok;
+ set++;
+ break;
+
+ case SRE_OP_CATEGORY:
+ /* <CATEGORY> <code> */
+ if (sre_category(set[0], (int) ch))
+ return ok;
+ set++;
+ break;
+
+ case SRE_OP_CHARSET:
+ /* <CHARSET> <bitmap> */
+ if (ch < 256 &&
+ (set[ch/SRE_CODE_BITS] & (1u << (ch & (SRE_CODE_BITS-1)))))
+ return ok;
+ set += 256/SRE_CODE_BITS;
+ break;
+
+ case SRE_OP_RANGE:
+ /* <RANGE> <lower> <upper> */
+ if (set[0] <= ch && ch <= set[1])
+ return ok;
+ set += 2;
+ break;
+
+ case SRE_OP_RANGE_UNI_IGNORE:
+ /* <RANGE_UNI_IGNORE> <lower> <upper> */
+ {
+ SRE_CODE uch;
+ /* ch is already lower cased */
+ if (set[0] <= ch && ch <= set[1])
+ return ok;
+ uch = sre_upper_unicode(ch);
+ if (set[0] <= uch && uch <= set[1])
+ return ok;
+ set += 2;
+ break;
+ }
+
+ case SRE_OP_NEGATE:
+ ok = !ok;
+ break;
+
+ case SRE_OP_BIGCHARSET:
+ /* <BIGCHARSET> <blockcount> <256 blockindices> <blocks> */
+ {
+ Py_ssize_t count, block;
+ count = *(set++);
+
+ if (ch < 0x10000u)
+ block = ((unsigned char*)set)[ch >> 8];
+ else
+ block = -1;
+ set += 256/sizeof(SRE_CODE);
+ if (block >=0 &&
+ (set[(block * 256 + (ch & 255))/SRE_CODE_BITS] &
+ (1u << (ch & (SRE_CODE_BITS-1)))))
+ return ok;
+ set += count * (256/SRE_CODE_BITS);
+ break;
+ }
+
+ default:
+ /* internal error -- there's not much we can do about it
+ here, so let's just pretend it didn't match... */
+ return 0;
+ }
+ }
+}
+
+LOCAL(int)
+SRE(charset_loc_ignore)(SRE_STATE* state, const SRE_CODE* set, SRE_CODE ch)
+{
+ SRE_CODE lo, up;
+ lo = sre_lower_locale(ch);
+ if (SRE(charset)(state, set, lo))
+ return 1;
+
+ up = sre_upper_locale(ch);
+ return up != lo && SRE(charset)(state, set, up);
+}
+
+LOCAL(Py_ssize_t) SRE(match)(SRE_STATE* state, const SRE_CODE* pattern, int toplevel);
+
+LOCAL(Py_ssize_t)
+SRE(count)(SRE_STATE* state, const SRE_CODE* pattern, Py_ssize_t maxcount)
+{
+ SRE_CODE chr;
+ SRE_CHAR c;
+ const SRE_CHAR* ptr = (const SRE_CHAR *)state->ptr;
+ const SRE_CHAR* end = (const SRE_CHAR *)state->end;
+ Py_ssize_t i;
+
+ /* adjust end */
+ if (maxcount < end - ptr && maxcount != SRE_MAXREPEAT)
+ end = ptr + maxcount;
+
+ switch (pattern[0]) {
+
+ case SRE_OP_IN:
+ /* repeated set */
+ TRACE(("|%p|%p|COUNT IN\n", pattern, ptr));
+ while (ptr < end && SRE(charset)(state, pattern + 2, *ptr))
+ ptr++;
+ break;
+
+ case SRE_OP_ANY:
+ /* repeated dot wildcard. */
+ TRACE(("|%p|%p|COUNT ANY\n", pattern, ptr));
+ while (ptr < end && !SRE_IS_LINEBREAK(*ptr))
+ ptr++;
+ break;
+
+ case SRE_OP_ANY_ALL:
+ /* repeated dot wildcard. skip to the end of the target
+ string, and backtrack from there */
+ TRACE(("|%p|%p|COUNT ANY_ALL\n", pattern, ptr));
+ ptr = end;
+ break;
+
+ case SRE_OP_LITERAL:
+ /* repeated literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT LITERAL %d\n", pattern, ptr, chr));
+ c = (SRE_CHAR) chr;
+#if SIZEOF_SRE_CHAR < 4
+ if ((SRE_CODE) c != chr)
+ ; /* literal can't match: doesn't fit in char width */
+ else
+#endif
+ while (ptr < end && *ptr == c)
+ ptr++;
+ break;
+
+ case SRE_OP_LITERAL_IGNORE:
+ /* repeated literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT LITERAL_IGNORE %d\n", pattern, ptr, chr));
+ while (ptr < end && (SRE_CODE) sre_lower_ascii(*ptr) == chr)
+ ptr++;
+ break;
+
+ case SRE_OP_LITERAL_UNI_IGNORE:
+ /* repeated literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT LITERAL_UNI_IGNORE %d\n", pattern, ptr, chr));
+ while (ptr < end && (SRE_CODE) sre_lower_unicode(*ptr) == chr)
+ ptr++;
+ break;
+
+ case SRE_OP_LITERAL_LOC_IGNORE:
+ /* repeated literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT LITERAL_LOC_IGNORE %d\n", pattern, ptr, chr));
+ while (ptr < end && char_loc_ignore(chr, *ptr))
+ ptr++;
+ break;
+
+ case SRE_OP_NOT_LITERAL:
+ /* repeated non-literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT NOT_LITERAL %d\n", pattern, ptr, chr));
+ c = (SRE_CHAR) chr;
+#if SIZEOF_SRE_CHAR < 4
+ if ((SRE_CODE) c != chr)
+ ptr = end; /* literal can't match: doesn't fit in char width */
+ else
+#endif
+ while (ptr < end && *ptr != c)
+ ptr++;
+ break;
+
+ case SRE_OP_NOT_LITERAL_IGNORE:
+ /* repeated non-literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT NOT_LITERAL_IGNORE %d\n", pattern, ptr, chr));
+ while (ptr < end && (SRE_CODE) sre_lower_ascii(*ptr) != chr)
+ ptr++;
+ break;
+
+ case SRE_OP_NOT_LITERAL_UNI_IGNORE:
+ /* repeated non-literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT NOT_LITERAL_UNI_IGNORE %d\n", pattern, ptr, chr));
+ while (ptr < end && (SRE_CODE) sre_lower_unicode(*ptr) != chr)
+ ptr++;
+ break;
+
+ case SRE_OP_NOT_LITERAL_LOC_IGNORE:
+ /* repeated non-literal */
+ chr = pattern[1];
+ TRACE(("|%p|%p|COUNT NOT_LITERAL_LOC_IGNORE %d\n", pattern, ptr, chr));
+ while (ptr < end && !char_loc_ignore(chr, *ptr))
+ ptr++;
+ break;
+
+ default:
+ /* repeated single character pattern */
+ TRACE(("|%p|%p|COUNT SUBPATTERN\n", pattern, ptr));
+ while ((SRE_CHAR*) state->ptr < end) {
+ i = SRE(match)(state, pattern, 0);
+ if (i < 0)
+ return i;
+ if (!i)
+ break;
+ }
+ TRACE(("|%p|%p|COUNT %zd\n", pattern, ptr,
+ (SRE_CHAR*) state->ptr - ptr));
+ return (SRE_CHAR*) state->ptr - ptr;
+ }
+
+ TRACE(("|%p|%p|COUNT %zd\n", pattern, ptr,
+ ptr - (SRE_CHAR*) state->ptr));
+ return ptr - (SRE_CHAR*) state->ptr;
+}
+
+/* The macros below should be used to protect recursive SRE(match)()
+ * calls that *failed* and do *not* return immediately (IOW, those
+ * that will backtrack). Explaining:
+ *
+ * - Recursive SRE(match)() returned true: that's usually a success
+ * (besides atypical cases like ASSERT_NOT), therefore there's no
+ * reason to restore lastmark;
+ *
+ * - Recursive SRE(match)() returned false but the current SRE(match)()
+ * is returning to the caller: If the current SRE(match)() is the
+ * top function of the recursion, returning false will be a matching
+ * failure, and it doesn't matter where lastmark is pointing to.
+ * If it's *not* the top function, it will be a recursive SRE(match)()
+ * failure by itself, and the calling SRE(match)() will have to deal
+ * with the failure by the same rules explained here (it will restore
+ * lastmark by itself if necessary);
+ *
+ * - Recursive SRE(match)() returned false, and will continue the
+ * outside 'for' loop: must be protected when breaking, since the next
+ * OP could potentially depend on lastmark;
+ *
+ * - Recursive SRE(match)() returned false, and will be called again
+ * inside a local for/while loop: must be protected between each
+ * loop iteration, since the recursive SRE(match)() could do anything,
+ * and could potentially depend on lastmark.
+ *
+ * For more information, check the discussion at SF patch #712900.
+ */
+#define LASTMARK_SAVE() \
+ do { \
+ ctx->lastmark = state->lastmark; \
+ ctx->lastindex = state->lastindex; \
+ } while (0)
+#define LASTMARK_RESTORE() \
+ do { \
+ state->lastmark = ctx->lastmark; \
+ state->lastindex = ctx->lastindex; \
+ } while (0)
+
+#define RETURN_ERROR(i) do { return i; } while(0)
+#define RETURN_FAILURE do { ret = 0; goto exit; } while(0)
+#define RETURN_SUCCESS do { ret = 1; goto exit; } while(0)
+
+#define RETURN_ON_ERROR(i) \
+ do { if (i < 0) RETURN_ERROR(i); } while (0)
+#define RETURN_ON_SUCCESS(i) \
+ do { RETURN_ON_ERROR(i); if (i > 0) RETURN_SUCCESS; } while (0)
+#define RETURN_ON_FAILURE(i) \
+ do { RETURN_ON_ERROR(i); if (i == 0) RETURN_FAILURE; } while (0)
+
+#define DATA_STACK_ALLOC(state, type, ptr) \
+do { \
+ alloc_pos = state->data_stack_base; \
+ TRACE(("allocating %s in %zd (%zd)\n", \
+ Py_STRINGIFY(type), alloc_pos, sizeof(type))); \
+ if (sizeof(type) > state->data_stack_size - alloc_pos) { \
+ int j = data_stack_grow(state, sizeof(type)); \
+ if (j < 0) return j; \
+ if (ctx_pos != -1) \
+ DATA_STACK_LOOKUP_AT(state, SRE(match_context), ctx, ctx_pos); \
+ } \
+ ptr = (type*)(state->data_stack+alloc_pos); \
+ state->data_stack_base += sizeof(type); \
+} while (0)
+
+#define DATA_STACK_LOOKUP_AT(state, type, ptr, pos) \
+do { \
+ TRACE(("looking up %s at %zd\n", Py_STRINGIFY(type), pos)); \
+ ptr = (type*)(state->data_stack+pos); \
+} while (0)
+
+#define DATA_STACK_PUSH(state, data, size) \
+do { \
+ TRACE(("copy data in %p to %zd (%zd)\n", \
+ data, state->data_stack_base, size)); \
+ if (size > state->data_stack_size - state->data_stack_base) { \
+ int j = data_stack_grow(state, size); \
+ if (j < 0) return j; \
+ if (ctx_pos != -1) \
+ DATA_STACK_LOOKUP_AT(state, SRE(match_context), ctx, ctx_pos); \
+ } \
+ memcpy(state->data_stack+state->data_stack_base, data, size); \
+ state->data_stack_base += size; \
+} while (0)
+
+/* We add an explicit cast to memcpy here because MSVC has a bug when
+ compiling C code where it believes that `const void**` cannot be
+ safely casted to `void*`, see bpo-39943 for details. */
+#define DATA_STACK_POP(state, data, size, discard) \
+do { \
+ TRACE(("copy data to %p from %zd (%zd)\n", \
+ data, state->data_stack_base-size, size)); \
+ memcpy((void*) data, state->data_stack+state->data_stack_base-size, size); \
+ if (discard) \
+ state->data_stack_base -= size; \
+} while (0)
+
+#define DATA_STACK_POP_DISCARD(state, size) \
+do { \
+ TRACE(("discard data from %zd (%zd)\n", \
+ state->data_stack_base-size, size)); \
+ state->data_stack_base -= size; \
+} while(0)
+
+#define DATA_PUSH(x) \
+ DATA_STACK_PUSH(state, (x), sizeof(*(x)))
+#define DATA_POP(x) \
+ DATA_STACK_POP(state, (x), sizeof(*(x)), 1)
+#define DATA_POP_DISCARD(x) \
+ DATA_STACK_POP_DISCARD(state, sizeof(*(x)))
+#define DATA_ALLOC(t,p) \
+ DATA_STACK_ALLOC(state, t, p)
+#define DATA_LOOKUP_AT(t,p,pos) \
+ DATA_STACK_LOOKUP_AT(state,t,p,pos)
+
+#define MARK_PUSH(lastmark) \
+ do if (lastmark >= 0) { \
+ size_t _marks_size = (lastmark+1) * sizeof(void*); \
+ DATA_STACK_PUSH(state, state->mark, _marks_size); \
+ } while (0)
+#define MARK_POP(lastmark) \
+ do if (lastmark >= 0) { \
+ size_t _marks_size = (lastmark+1) * sizeof(void*); \
+ DATA_STACK_POP(state, state->mark, _marks_size, 1); \
+ } while (0)
+#define MARK_POP_KEEP(lastmark) \
+ do if (lastmark >= 0) { \
+ size_t _marks_size = (lastmark+1) * sizeof(void*); \
+ DATA_STACK_POP(state, state->mark, _marks_size, 0); \
+ } while (0)
+#define MARK_POP_DISCARD(lastmark) \
+ do if (lastmark >= 0) { \
+ size_t _marks_size = (lastmark+1) * sizeof(void*); \
+ DATA_STACK_POP_DISCARD(state, _marks_size); \
+ } while (0)
+
+#define JUMP_NONE 0
+#define JUMP_MAX_UNTIL_1 1
+#define JUMP_MAX_UNTIL_2 2
+#define JUMP_MAX_UNTIL_3 3
+#define JUMP_MIN_UNTIL_1 4
+#define JUMP_MIN_UNTIL_2 5
+#define JUMP_MIN_UNTIL_3 6
+#define JUMP_REPEAT 7
+#define JUMP_REPEAT_ONE_1 8
+#define JUMP_REPEAT_ONE_2 9
+#define JUMP_MIN_REPEAT_ONE 10
+#define JUMP_BRANCH 11
+#define JUMP_ASSERT 12
+#define JUMP_ASSERT_NOT 13
+#define JUMP_POSS_REPEAT_1 14
+#define JUMP_POSS_REPEAT_2 15
+#define JUMP_ATOMIC_GROUP 16
+
+#define DO_JUMPX(jumpvalue, jumplabel, nextpattern, toplevel_) \
+ ctx->pattern = pattern; \
+ ctx->ptr = ptr; \
+ DATA_ALLOC(SRE(match_context), nextctx); \
+ nextctx->pattern = nextpattern; \
+ nextctx->toplevel = toplevel_; \
+ nextctx->jump = jumpvalue; \
+ nextctx->last_ctx_pos = ctx_pos; \
+ pattern = nextpattern; \
+ ctx_pos = alloc_pos; \
+ ctx = nextctx; \
+ goto entrance; \
+ jumplabel: \
+ pattern = ctx->pattern; \
+ ptr = ctx->ptr;
+
+#define DO_JUMP(jumpvalue, jumplabel, nextpattern) \
+ DO_JUMPX(jumpvalue, jumplabel, nextpattern, ctx->toplevel)
+
+#define DO_JUMP0(jumpvalue, jumplabel, nextpattern) \
+ DO_JUMPX(jumpvalue, jumplabel, nextpattern, 0)
+
+typedef struct {
+ Py_ssize_t count;
+ union {
+ SRE_CODE chr;
+ SRE_REPEAT* rep;
+ } u;
+ int lastmark;
+ int lastindex;
+ const SRE_CODE* pattern;
+ const SRE_CHAR* ptr;
+ int toplevel;
+ int jump;
+ Py_ssize_t last_ctx_pos;
+} SRE(match_context);
+
+#define MAYBE_CHECK_SIGNALS \
+ do { \
+ if ((0 == (++sigcount & 0xfff)) && PyErr_CheckSignals()) { \
+ RETURN_ERROR(SRE_ERROR_INTERRUPTED); \
+ } \
+ } while (0)
+
+#ifdef HAVE_COMPUTED_GOTOS
+ #ifndef USE_COMPUTED_GOTOS
+ #define USE_COMPUTED_GOTOS 1
+ #endif
+#elif defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS
+ #error "Computed gotos are not supported on this compiler."
+#else
+ #undef USE_COMPUTED_GOTOS
+ #define USE_COMPUTED_GOTOS 0
+#endif
+
+#if USE_COMPUTED_GOTOS
+ #define TARGET(OP) TARGET_ ## OP
+ #define DISPATCH \
+ do { \
+ MAYBE_CHECK_SIGNALS; \
+ goto *sre_targets[*pattern++]; \
+ } while (0)
+#else
+ #define TARGET(OP) case OP
+ #define DISPATCH goto dispatch
+#endif
+
+/* check if string matches the given pattern. returns <0 for
+ error, 0 for failure, and 1 for success */
+LOCAL(Py_ssize_t)
+SRE(match)(SRE_STATE* state, const SRE_CODE* pattern, int toplevel)
+{
+ const SRE_CHAR* end = (const SRE_CHAR *)state->end;
+ Py_ssize_t alloc_pos, ctx_pos = -1;
+ Py_ssize_t ret = 0;
+ int jump;
+ unsigned int sigcount = state->sigcount;
+
+ SRE(match_context)* ctx;
+ SRE(match_context)* nextctx;
+
+ TRACE(("|%p|%p|ENTER\n", pattern, state->ptr));
+
+ DATA_ALLOC(SRE(match_context), ctx);
+ ctx->last_ctx_pos = -1;
+ ctx->jump = JUMP_NONE;
+ ctx->toplevel = toplevel;
+ ctx_pos = alloc_pos;
+
+#if USE_COMPUTED_GOTOS
+#include "sre_targets.h"
+#endif
+
+entrance:
+
+ ; // Fashion statement.
+ const SRE_CHAR *ptr = (SRE_CHAR *)state->ptr;
+
+ if (pattern[0] == SRE_OP_INFO) {
+ /* optimization info block */
+ /* <INFO> <1=skip> <2=flags> <3=min> ... */
+ if (pattern[3] && (uintptr_t)(end - ptr) < pattern[3]) {
+ TRACE(("reject (got %tu chars, need %zu)\n",
+ end - ptr, (size_t) pattern[3]));
+ RETURN_FAILURE;
+ }
+ pattern += pattern[1] + 1;
+ }
+
+#if USE_COMPUTED_GOTOS
+ DISPATCH;
+#else
+dispatch:
+ MAYBE_CHECK_SIGNALS;
+ switch (*pattern++)
+#endif
+ {
+
+ TARGET(SRE_OP_MARK):
+ /* set mark */
+ /* <MARK> <gid> */
+ TRACE(("|%p|%p|MARK %d\n", pattern,
+ ptr, pattern[0]));
+ {
+ int i = pattern[0];
+ if (i & 1)
+ state->lastindex = i/2 + 1;
+ if (i > state->lastmark) {
+ /* state->lastmark is the highest valid index in the
+ state->mark array. If it is increased by more than 1,
+ the intervening marks must be set to NULL to signal
+ that these marks have not been encountered. */
+ int j = state->lastmark + 1;
+ while (j < i)
+ state->mark[j++] = NULL;
+ state->lastmark = i;
+ }
+ state->mark[i] = ptr;
+ }
+ pattern++;
+ DISPATCH;
+
+ TARGET(SRE_OP_LITERAL):
+ /* match literal string */
+ /* <LITERAL> <code> */
+ TRACE(("|%p|%p|LITERAL %d\n", pattern,
+ ptr, *pattern));
+ if (ptr >= end || (SRE_CODE) ptr[0] != pattern[0])
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_NOT_LITERAL):
+ /* match anything that is not literal character */
+ /* <NOT_LITERAL> <code> */
+ TRACE(("|%p|%p|NOT_LITERAL %d\n", pattern,
+ ptr, *pattern));
+ if (ptr >= end || (SRE_CODE) ptr[0] == pattern[0])
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_SUCCESS):
+ /* end of pattern */
+ TRACE(("|%p|%p|SUCCESS\n", pattern, ptr));
+ if (ctx->toplevel &&
+ ((state->match_all && ptr != state->end) ||
+ (state->must_advance && ptr == state->start)))
+ {
+ RETURN_FAILURE;
+ }
+ state->ptr = ptr;
+ RETURN_SUCCESS;
+
+ TARGET(SRE_OP_AT):
+ /* match at given position */
+ /* <AT> <code> */
+ TRACE(("|%p|%p|AT %d\n", pattern, ptr, *pattern));
+ if (!SRE(at)(state, ptr, *pattern))
+ RETURN_FAILURE;
+ pattern++;
+ DISPATCH;
+
+ TARGET(SRE_OP_CATEGORY):
+ /* match at given category */
+ /* <CATEGORY> <code> */
+ TRACE(("|%p|%p|CATEGORY %d\n", pattern,
+ ptr, *pattern));
+ if (ptr >= end || !sre_category(pattern[0], ptr[0]))
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_ANY):
+ /* match anything (except a newline) */
+ /* <ANY> */
+ TRACE(("|%p|%p|ANY\n", pattern, ptr));
+ if (ptr >= end || SRE_IS_LINEBREAK(ptr[0]))
+ RETURN_FAILURE;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_ANY_ALL):
+ /* match anything */
+ /* <ANY_ALL> */
+ TRACE(("|%p|%p|ANY_ALL\n", pattern, ptr));
+ if (ptr >= end)
+ RETURN_FAILURE;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_IN):
+ /* match set member (or non_member) */
+ /* <IN> <skip> <set> */
+ TRACE(("|%p|%p|IN\n", pattern, ptr));
+ if (ptr >= end ||
+ !SRE(charset)(state, pattern + 1, *ptr))
+ RETURN_FAILURE;
+ pattern += pattern[0];
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_LITERAL_IGNORE):
+ TRACE(("|%p|%p|LITERAL_IGNORE %d\n",
+ pattern, ptr, pattern[0]));
+ if (ptr >= end ||
+ sre_lower_ascii(*ptr) != *pattern)
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_LITERAL_UNI_IGNORE):
+ TRACE(("|%p|%p|LITERAL_UNI_IGNORE %d\n",
+ pattern, ptr, pattern[0]));
+ if (ptr >= end ||
+ sre_lower_unicode(*ptr) != *pattern)
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_LITERAL_LOC_IGNORE):
+ TRACE(("|%p|%p|LITERAL_LOC_IGNORE %d\n",
+ pattern, ptr, pattern[0]));
+ if (ptr >= end
+ || !char_loc_ignore(*pattern, *ptr))
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_NOT_LITERAL_IGNORE):
+ TRACE(("|%p|%p|NOT_LITERAL_IGNORE %d\n",
+ pattern, ptr, *pattern));
+ if (ptr >= end ||
+ sre_lower_ascii(*ptr) == *pattern)
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_NOT_LITERAL_UNI_IGNORE):
+ TRACE(("|%p|%p|NOT_LITERAL_UNI_IGNORE %d\n",
+ pattern, ptr, *pattern));
+ if (ptr >= end ||
+ sre_lower_unicode(*ptr) == *pattern)
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_NOT_LITERAL_LOC_IGNORE):
+ TRACE(("|%p|%p|NOT_LITERAL_LOC_IGNORE %d\n",
+ pattern, ptr, *pattern));
+ if (ptr >= end
+ || char_loc_ignore(*pattern, *ptr))
+ RETURN_FAILURE;
+ pattern++;
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_IN_IGNORE):
+ TRACE(("|%p|%p|IN_IGNORE\n", pattern, ptr));
+ if (ptr >= end
+ || !SRE(charset)(state, pattern+1,
+ (SRE_CODE)sre_lower_ascii(*ptr)))
+ RETURN_FAILURE;
+ pattern += pattern[0];
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_IN_UNI_IGNORE):
+ TRACE(("|%p|%p|IN_UNI_IGNORE\n", pattern, ptr));
+ if (ptr >= end
+ || !SRE(charset)(state, pattern+1,
+ (SRE_CODE)sre_lower_unicode(*ptr)))
+ RETURN_FAILURE;
+ pattern += pattern[0];
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_IN_LOC_IGNORE):
+ TRACE(("|%p|%p|IN_LOC_IGNORE\n", pattern, ptr));
+ if (ptr >= end
+ || !SRE(charset_loc_ignore)(state, pattern+1, *ptr))
+ RETURN_FAILURE;
+ pattern += pattern[0];
+ ptr++;
+ DISPATCH;
+
+ TARGET(SRE_OP_JUMP):
+ TARGET(SRE_OP_INFO):
+ /* jump forward */
+ /* <JUMP> <offset> */
+ TRACE(("|%p|%p|JUMP %d\n", pattern,
+ ptr, pattern[0]));
+ pattern += pattern[0];
+ DISPATCH;
+
+ TARGET(SRE_OP_BRANCH):
+ /* alternation */
+ /* <BRANCH> <0=skip> code <JUMP> ... <NULL> */
+ TRACE(("|%p|%p|BRANCH\n", pattern, ptr));
+ LASTMARK_SAVE();
+ if (state->repeat)
+ MARK_PUSH(ctx->lastmark);
+ for (; pattern[0]; pattern += pattern[0]) {
+ if (pattern[1] == SRE_OP_LITERAL &&
+ (ptr >= end ||
+ (SRE_CODE) *ptr != pattern[2]))
+ continue;
+ if (pattern[1] == SRE_OP_IN &&
+ (ptr >= end ||
+ !SRE(charset)(state, pattern + 3,
+ (SRE_CODE) *ptr)))
+ continue;
+ state->ptr = ptr;
+ DO_JUMP(JUMP_BRANCH, jump_branch, pattern+1);
+ if (ret) {
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ if (state->repeat)
+ MARK_POP_KEEP(ctx->lastmark);
+ LASTMARK_RESTORE();
+ }
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_FAILURE;
+
+ TARGET(SRE_OP_REPEAT_ONE):
+ /* match repeated sequence (maximizing regexp) */
+
+ /* this operator only works if the repeated item is
+ exactly one character wide, and we're not already
+ collecting backtracking points. for other cases,
+ use the MAX_REPEAT operator */
+
+ /* <REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS> tail */
+
+ TRACE(("|%p|%p|REPEAT_ONE %d %d\n", pattern, ptr,
+ pattern[1], pattern[2]));
+
+ if ((Py_ssize_t) pattern[1] > end - ptr)
+ RETURN_FAILURE; /* cannot match */
+
+ state->ptr = ptr;
+
+ ret = SRE(count)(state, pattern+3, pattern[2]);
+ RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+ ctx->count = ret;
+ ptr += ctx->count;
+
+ /* when we arrive here, count contains the number of
+ matches, and ptr points to the tail of the target
+ string. check if the rest of the pattern matches,
+ and backtrack if not. */
+
+ if (ctx->count < (Py_ssize_t) pattern[1])
+ RETURN_FAILURE;
+
+ if (pattern[pattern[0]] == SRE_OP_SUCCESS &&
+ ptr == state->end &&
+ !(ctx->toplevel && state->must_advance && ptr == state->start))
+ {
+ /* tail is empty. we're finished */
+ state->ptr = ptr;
+ RETURN_SUCCESS;
+ }
+
+ LASTMARK_SAVE();
+ if (state->repeat)
+ MARK_PUSH(ctx->lastmark);
+
+ if (pattern[pattern[0]] == SRE_OP_LITERAL) {
+ /* tail starts with a literal. skip positions where
+ the rest of the pattern cannot possibly match */
+ ctx->u.chr = pattern[pattern[0]+1];
+ for (;;) {
+ while (ctx->count >= (Py_ssize_t) pattern[1] &&
+ (ptr >= end || *ptr != ctx->u.chr)) {
+ ptr--;
+ ctx->count--;
+ }
+ if (ctx->count < (Py_ssize_t) pattern[1])
+ break;
+ state->ptr = ptr;
+ DO_JUMP(JUMP_REPEAT_ONE_1, jump_repeat_one_1,
+ pattern+pattern[0]);
+ if (ret) {
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ if (state->repeat)
+ MARK_POP_KEEP(ctx->lastmark);
+ LASTMARK_RESTORE();
+
+ ptr--;
+ ctx->count--;
+ }
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ } else {
+ /* general case */
+ while (ctx->count >= (Py_ssize_t) pattern[1]) {
+ state->ptr = ptr;
+ DO_JUMP(JUMP_REPEAT_ONE_2, jump_repeat_one_2,
+ pattern+pattern[0]);
+ if (ret) {
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ if (state->repeat)
+ MARK_POP_KEEP(ctx->lastmark);
+ LASTMARK_RESTORE();
+
+ ptr--;
+ ctx->count--;
+ }
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ }
+ RETURN_FAILURE;
+
+ TARGET(SRE_OP_MIN_REPEAT_ONE):
+ /* match repeated sequence (minimizing regexp) */
+
+ /* this operator only works if the repeated item is
+ exactly one character wide, and we're not already
+ collecting backtracking points. for other cases,
+ use the MIN_REPEAT operator */
+
+ /* <MIN_REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS> tail */
+
+ TRACE(("|%p|%p|MIN_REPEAT_ONE %d %d\n", pattern, ptr,
+ pattern[1], pattern[2]));
+
+ if ((Py_ssize_t) pattern[1] > end - ptr)
+ RETURN_FAILURE; /* cannot match */
+
+ state->ptr = ptr;
+
+ if (pattern[1] == 0)
+ ctx->count = 0;
+ else {
+ /* count using pattern min as the maximum */
+ ret = SRE(count)(state, pattern+3, pattern[1]);
+ RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+ if (ret < (Py_ssize_t) pattern[1])
+ /* didn't match minimum number of times */
+ RETURN_FAILURE;
+ /* advance past minimum matches of repeat */
+ ctx->count = ret;
+ ptr += ctx->count;
+ }
+
+ if (pattern[pattern[0]] == SRE_OP_SUCCESS &&
+ !(ctx->toplevel &&
+ ((state->match_all && ptr != state->end) ||
+ (state->must_advance && ptr == state->start))))
+ {
+ /* tail is empty. we're finished */
+ state->ptr = ptr;
+ RETURN_SUCCESS;
+
+ } else {
+ /* general case */
+ LASTMARK_SAVE();
+ if (state->repeat)
+ MARK_PUSH(ctx->lastmark);
+
+ while ((Py_ssize_t)pattern[2] == SRE_MAXREPEAT
+ || ctx->count <= (Py_ssize_t)pattern[2]) {
+ state->ptr = ptr;
+ DO_JUMP(JUMP_MIN_REPEAT_ONE,jump_min_repeat_one,
+ pattern+pattern[0]);
+ if (ret) {
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ if (state->repeat)
+ MARK_POP_KEEP(ctx->lastmark);
+ LASTMARK_RESTORE();
+
+ state->ptr = ptr;
+ ret = SRE(count)(state, pattern+3, 1);
+ RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+ if (ret == 0)
+ break;
+ assert(ret == 1);
+ ptr++;
+ ctx->count++;
+ }
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ }
+ RETURN_FAILURE;
+
+ TARGET(SRE_OP_POSSESSIVE_REPEAT_ONE):
+ /* match repeated sequence (maximizing regexp) without
+ backtracking */
+
+ /* this operator only works if the repeated item is
+ exactly one character wide, and we're not already
+ collecting backtracking points. for other cases,
+ use the MAX_REPEAT operator */
+
+ /* <POSSESSIVE_REPEAT_ONE> <skip> <1=min> <2=max> item <SUCCESS>
+ tail */
+
+ TRACE(("|%p|%p|POSSESSIVE_REPEAT_ONE %d %d\n", pattern,
+ ptr, pattern[1], pattern[2]));
+
+ if (ptr + pattern[1] > end) {
+ RETURN_FAILURE; /* cannot match */
+ }
+
+ state->ptr = ptr;
+
+ ret = SRE(count)(state, pattern + 3, pattern[2]);
+ RETURN_ON_ERROR(ret);
+ DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+ ctx->count = ret;
+ ptr += ctx->count;
+
+ /* when we arrive here, count contains the number of
+ matches, and ptr points to the tail of the target
+ string. check if the rest of the pattern matches,
+ and fail if not. */
+
+ /* Test for not enough repetitions in match */
+ if (ctx->count < (Py_ssize_t) pattern[1]) {
+ RETURN_FAILURE;
+ }
+
+ /* Update the pattern to point to the next op code */
+ pattern += pattern[0];
+
+ /* Let the tail be evaluated separately and consider this
+ match successful. */
+ if (*pattern == SRE_OP_SUCCESS &&
+ ptr == state->end &&
+ !(ctx->toplevel && state->must_advance && ptr == state->start))
+ {
+ /* tail is empty. we're finished */
+ state->ptr = ptr;
+ RETURN_SUCCESS;
+ }
+
+ /* Attempt to match the rest of the string */
+ DISPATCH;
+
+ TARGET(SRE_OP_REPEAT):
+ /* create repeat context. all the hard work is done
+ by the UNTIL operator (MAX_UNTIL, MIN_UNTIL) */
+ /* <REPEAT> <skip> <1=min> <2=max>
+ <3=repeat_index> item <UNTIL> tail */
+ TRACE(("|%p|%p|REPEAT %d %d\n", pattern, ptr,
+ pattern[1], pattern[2]));
+
+ /* install new repeat context */
+ /* TODO(https://github.com/python/cpython/issues/67877): Fix this
+ * potential memory leak. */
+ ctx->u.rep = (SRE_REPEAT*) PyObject_Malloc(sizeof(*ctx->u.rep));
+ if (!ctx->u.rep) {
+ PyErr_NoMemory();
+ RETURN_FAILURE;
+ }
+ ctx->u.rep->count = -1;
+ ctx->u.rep->pattern = pattern;
+ ctx->u.rep->prev = state->repeat;
+ ctx->u.rep->last_ptr = NULL;
+ state->repeat = ctx->u.rep;
+
+ state->ptr = ptr;
+ DO_JUMP(JUMP_REPEAT, jump_repeat, pattern+pattern[0]);
+ state->repeat = ctx->u.rep->prev;
+ PyObject_Free(ctx->u.rep);
+
+ if (ret) {
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ RETURN_FAILURE;
+
+ TARGET(SRE_OP_MAX_UNTIL):
+ /* maximizing repeat */
+ /* <REPEAT> <skip> <1=min> <2=max> item <MAX_UNTIL> tail */
+
+ /* FIXME: we probably need to deal with zero-width
+ matches in here... */
+
+ ctx->u.rep = state->repeat;
+ if (!ctx->u.rep)
+ RETURN_ERROR(SRE_ERROR_STATE);
+
+ state->ptr = ptr;
+
+ ctx->count = ctx->u.rep->count+1;
+
+ TRACE(("|%p|%p|MAX_UNTIL %zd\n", pattern,
+ ptr, ctx->count));
+
+ if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) {
+ /* not enough matches */
+ ctx->u.rep->count = ctx->count;
+ DO_JUMP(JUMP_MAX_UNTIL_1, jump_max_until_1,
+ ctx->u.rep->pattern+3);
+ if (ret) {
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ ctx->u.rep->count = ctx->count-1;
+ state->ptr = ptr;
+ RETURN_FAILURE;
+ }
+
+ if ((ctx->count < (Py_ssize_t) ctx->u.rep->pattern[2] ||
+ ctx->u.rep->pattern[2] == SRE_MAXREPEAT) &&
+ state->ptr != ctx->u.rep->last_ptr) {
+ /* we may have enough matches, but if we can
+ match another item, do so */
+ ctx->u.rep->count = ctx->count;
+ LASTMARK_SAVE();
+ MARK_PUSH(ctx->lastmark);
+ /* zero-width match protection */
+ DATA_PUSH(&ctx->u.rep->last_ptr);
+ ctx->u.rep->last_ptr = state->ptr;
+ DO_JUMP(JUMP_MAX_UNTIL_2, jump_max_until_2,
+ ctx->u.rep->pattern+3);
+ DATA_POP(&ctx->u.rep->last_ptr);
+ if (ret) {
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ MARK_POP(ctx->lastmark);
+ LASTMARK_RESTORE();
+ ctx->u.rep->count = ctx->count-1;
+ state->ptr = ptr;
+ }
+
+ /* cannot match more repeated items here. make sure the
+ tail matches */
+ state->repeat = ctx->u.rep->prev;
+ DO_JUMP(JUMP_MAX_UNTIL_3, jump_max_until_3, pattern);
+ state->repeat = ctx->u.rep; // restore repeat before return
+
+ RETURN_ON_SUCCESS(ret);
+ state->ptr = ptr;
+ RETURN_FAILURE;
+
+ TARGET(SRE_OP_MIN_UNTIL):
+ /* minimizing repeat */
+ /* <REPEAT> <skip> <1=min> <2=max> item <MIN_UNTIL> tail */
+
+ ctx->u.rep = state->repeat;
+ if (!ctx->u.rep)
+ RETURN_ERROR(SRE_ERROR_STATE);
+
+ state->ptr = ptr;
+
+ ctx->count = ctx->u.rep->count+1;
+
+ TRACE(("|%p|%p|MIN_UNTIL %zd %p\n", pattern,
+ ptr, ctx->count, ctx->u.rep->pattern));
+
+ if (ctx->count < (Py_ssize_t) ctx->u.rep->pattern[1]) {
+ /* not enough matches */
+ ctx->u.rep->count = ctx->count;
+ DO_JUMP(JUMP_MIN_UNTIL_1, jump_min_until_1,
+ ctx->u.rep->pattern+3);
+ if (ret) {
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ ctx->u.rep->count = ctx->count-1;
+ state->ptr = ptr;
+ RETURN_FAILURE;
+ }
+
+ /* see if the tail matches */
+ state->repeat = ctx->u.rep->prev;
+
+ LASTMARK_SAVE();
+ if (state->repeat)
+ MARK_PUSH(ctx->lastmark);
+
+ DO_JUMP(JUMP_MIN_UNTIL_2, jump_min_until_2, pattern);
+ SRE_REPEAT *repeat_of_tail = state->repeat;
+ state->repeat = ctx->u.rep; // restore repeat before return
+
+ if (ret) {
+ if (repeat_of_tail)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ if (repeat_of_tail)
+ MARK_POP(ctx->lastmark);
+ LASTMARK_RESTORE();
+
+ state->ptr = ptr;
+
+ if ((ctx->count >= (Py_ssize_t) ctx->u.rep->pattern[2]
+ && ctx->u.rep->pattern[2] != SRE_MAXREPEAT) ||
+ state->ptr == ctx->u.rep->last_ptr)
+ RETURN_FAILURE;
+
+ ctx->u.rep->count = ctx->count;
+ /* zero-width match protection */
+ DATA_PUSH(&ctx->u.rep->last_ptr);
+ ctx->u.rep->last_ptr = state->ptr;
+ DO_JUMP(JUMP_MIN_UNTIL_3,jump_min_until_3,
+ ctx->u.rep->pattern+3);
+ DATA_POP(&ctx->u.rep->last_ptr);
+ if (ret) {
+ RETURN_ON_ERROR(ret);
+ RETURN_SUCCESS;
+ }
+ ctx->u.rep->count = ctx->count-1;
+ state->ptr = ptr;
+ RETURN_FAILURE;
+
+ TARGET(SRE_OP_POSSESSIVE_REPEAT):
+ /* create possessive repeat contexts. */
+ /* <POSSESSIVE_REPEAT> <skip> <1=min> <2=max> pattern
+ <SUCCESS> tail */
+ TRACE(("|%p|%p|POSSESSIVE_REPEAT %d %d\n", pattern,
+ ptr, pattern[1], pattern[2]));
+
+ /* Set the global Input pointer to this context's Input
+ pointer */
+ state->ptr = ptr;
+
+ /* Initialize Count to 0 */
+ ctx->count = 0;
+
+ /* Check for minimum required matches. */
+ while (ctx->count < (Py_ssize_t)pattern[1]) {
+ /* not enough matches */
+ DO_JUMP0(JUMP_POSS_REPEAT_1, jump_poss_repeat_1,
+ &pattern[3]);
+ if (ret) {
+ RETURN_ON_ERROR(ret);
+ ctx->count++;
+ }
+ else {
+ state->ptr = ptr;
+ RETURN_FAILURE;
+ }
+ }
+
+ /* Clear the context's Input stream pointer so that it
+ doesn't match the global state so that the while loop can
+ be entered. */
+ ptr = NULL;
+
+ /* Keep trying to parse the <pattern> sub-pattern until the
+ end is reached, creating a new context each time. */
+ while ((ctx->count < (Py_ssize_t)pattern[2] ||
+ (Py_ssize_t)pattern[2] == SRE_MAXREPEAT) &&
+ state->ptr != ptr) {
+ /* Save the Capture Group Marker state into the current
+ Context and back up the current highest number
+ Capture Group marker. */
+ LASTMARK_SAVE();
+ MARK_PUSH(ctx->lastmark);
+
+ /* zero-width match protection */
+ /* Set the context's Input Stream pointer to be the
+ current Input Stream pointer from the global
+ state. When the loop reaches the next iteration,
+ the context will then store the last known good
+ position with the global state holding the Input
+ Input Stream position that has been updated with
+ the most recent match. Thus, if state's Input
+ stream remains the same as the one stored in the
+ current Context, we know we have successfully
+ matched an empty string and that all subsequent
+ matches will also be the empty string until the
+ maximum number of matches are counted, and because
+ of this, we could immediately stop at that point and
+ consider this match successful. */
+ ptr = state->ptr;
+
+ /* We have not reached the maximin matches, so try to
+ match once more. */
+ DO_JUMP0(JUMP_POSS_REPEAT_2, jump_poss_repeat_2,
+ &pattern[3]);
+
+ /* Check to see if the last attempted match
+ succeeded. */
+ if (ret) {
+ /* Drop the saved highest number Capture Group
+ marker saved above and use the newly updated
+ value. */
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+
+ /* Success, increment the count. */
+ ctx->count++;
+ }
+ /* Last attempted match failed. */
+ else {
+ /* Restore the previously saved highest number
+ Capture Group marker since the last iteration
+ did not match, then restore that to the global
+ state. */
+ MARK_POP(ctx->lastmark);
+ LASTMARK_RESTORE();
+
+ /* Restore the global Input Stream pointer
+ since it can change after jumps. */
+ state->ptr = ptr;
+
+ /* We have sufficient matches, so exit loop. */
+ break;
+ }
+ }
+
+ /* Evaluate Tail */
+ /* Jump to end of pattern indicated by skip, and then skip
+ the SUCCESS op code that follows it. */
+ pattern += pattern[0] + 1;
+ ptr = state->ptr;
+ DISPATCH;
+
+ TARGET(SRE_OP_ATOMIC_GROUP):
+ /* Atomic Group Sub Pattern */
+ /* <ATOMIC_GROUP> <skip> pattern <SUCCESS> tail */
+ TRACE(("|%p|%p|ATOMIC_GROUP\n", pattern, ptr));
+
+ /* Set the global Input pointer to this context's Input
+ pointer */
+ state->ptr = ptr;
+
+ /* Evaluate the Atomic Group in a new context, terminating
+ when the end of the group, represented by a SUCCESS op
+ code, is reached. */
+ /* Group Pattern begins at an offset of 1 code. */
+ DO_JUMP0(JUMP_ATOMIC_GROUP, jump_atomic_group,
+ &pattern[1]);
+
+ /* Test Exit Condition */
+ RETURN_ON_ERROR(ret);
+
+ if (ret == 0) {
+ /* Atomic Group failed to Match. */
+ state->ptr = ptr;
+ RETURN_FAILURE;
+ }
+
+ /* Evaluate Tail */
+ /* Jump to end of pattern indicated by skip, and then skip
+ the SUCCESS op code that follows it. */
+ pattern += pattern[0];
+ ptr = state->ptr;
+ DISPATCH;
+
+ TARGET(SRE_OP_GROUPREF):
+ /* match backreference */
+ TRACE(("|%p|%p|GROUPREF %d\n", pattern,
+ ptr, pattern[0]));
+ {
+ int groupref = pattern[0] * 2;
+ if (groupref >= state->lastmark) {
+ RETURN_FAILURE;
+ } else {
+ SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+ SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+ if (!p || !e || e < p)
+ RETURN_FAILURE;
+ while (p < e) {
+ if (ptr >= end || *ptr != *p)
+ RETURN_FAILURE;
+ p++;
+ ptr++;
+ }
+ }
+ }
+ pattern++;
+ DISPATCH;
+
+ TARGET(SRE_OP_GROUPREF_IGNORE):
+ /* match backreference */
+ TRACE(("|%p|%p|GROUPREF_IGNORE %d\n", pattern,
+ ptr, pattern[0]));
+ {
+ int groupref = pattern[0] * 2;
+ if (groupref >= state->lastmark) {
+ RETURN_FAILURE;
+ } else {
+ SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+ SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+ if (!p || !e || e < p)
+ RETURN_FAILURE;
+ while (p < e) {
+ if (ptr >= end ||
+ sre_lower_ascii(*ptr) != sre_lower_ascii(*p))
+ RETURN_FAILURE;
+ p++;
+ ptr++;
+ }
+ }
+ }
+ pattern++;
+ DISPATCH;
+
+ TARGET(SRE_OP_GROUPREF_UNI_IGNORE):
+ /* match backreference */
+ TRACE(("|%p|%p|GROUPREF_UNI_IGNORE %d\n", pattern,
+ ptr, pattern[0]));
+ {
+ int groupref = pattern[0] * 2;
+ if (groupref >= state->lastmark) {
+ RETURN_FAILURE;
+ } else {
+ SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+ SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+ if (!p || !e || e < p)
+ RETURN_FAILURE;
+ while (p < e) {
+ if (ptr >= end ||
+ sre_lower_unicode(*ptr) != sre_lower_unicode(*p))
+ RETURN_FAILURE;
+ p++;
+ ptr++;
+ }
+ }
+ }
+ pattern++;
+ DISPATCH;
+
+ TARGET(SRE_OP_GROUPREF_LOC_IGNORE):
+ /* match backreference */
+ TRACE(("|%p|%p|GROUPREF_LOC_IGNORE %d\n", pattern,
+ ptr, pattern[0]));
+ {
+ int groupref = pattern[0] * 2;
+ if (groupref >= state->lastmark) {
+ RETURN_FAILURE;
+ } else {
+ SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+ SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+ if (!p || !e || e < p)
+ RETURN_FAILURE;
+ while (p < e) {
+ if (ptr >= end ||
+ sre_lower_locale(*ptr) != sre_lower_locale(*p))
+ RETURN_FAILURE;
+ p++;
+ ptr++;
+ }
+ }
+ }
+ pattern++;
+ DISPATCH;
+
+ TARGET(SRE_OP_GROUPREF_EXISTS):
+ TRACE(("|%p|%p|GROUPREF_EXISTS %d\n", pattern,
+ ptr, pattern[0]));
+ /* <GROUPREF_EXISTS> <group> <skip> codeyes <JUMP> codeno ... */
+ {
+ int groupref = pattern[0] * 2;
+ if (groupref >= state->lastmark) {
+ pattern += pattern[1];
+ DISPATCH;
+ } else {
+ SRE_CHAR* p = (SRE_CHAR*) state->mark[groupref];
+ SRE_CHAR* e = (SRE_CHAR*) state->mark[groupref+1];
+ if (!p || !e || e < p) {
+ pattern += pattern[1];
+ DISPATCH;
+ }
+ }
+ }
+ pattern += 2;
+ DISPATCH;
+
+ TARGET(SRE_OP_ASSERT):
+ /* assert subpattern */
+ /* <ASSERT> <skip> <back> <pattern> */
+ TRACE(("|%p|%p|ASSERT %d\n", pattern,
+ ptr, pattern[1]));
+ if ((uintptr_t)(ptr - (SRE_CHAR *)state->beginning) < pattern[1])
+ RETURN_FAILURE;
+ state->ptr = ptr - pattern[1];
+ DO_JUMP0(JUMP_ASSERT, jump_assert, pattern+2);
+ RETURN_ON_FAILURE(ret);
+ pattern += pattern[0];
+ DISPATCH;
+
+ TARGET(SRE_OP_ASSERT_NOT):
+ /* assert not subpattern */
+ /* <ASSERT_NOT> <skip> <back> <pattern> */
+ TRACE(("|%p|%p|ASSERT_NOT %d\n", pattern,
+ ptr, pattern[1]));
+ if ((uintptr_t)(ptr - (SRE_CHAR *)state->beginning) >= pattern[1]) {
+ state->ptr = ptr - pattern[1];
+ LASTMARK_SAVE();
+ if (state->repeat)
+ MARK_PUSH(ctx->lastmark);
+
+ DO_JUMP0(JUMP_ASSERT_NOT, jump_assert_not, pattern+2);
+ if (ret) {
+ if (state->repeat)
+ MARK_POP_DISCARD(ctx->lastmark);
+ RETURN_ON_ERROR(ret);
+ RETURN_FAILURE;
+ }
+ if (state->repeat)
+ MARK_POP(ctx->lastmark);
+ LASTMARK_RESTORE();
+ }
+ pattern += pattern[0];
+ DISPATCH;
+
+ TARGET(SRE_OP_FAILURE):
+ /* immediate failure */
+ TRACE(("|%p|%p|FAILURE\n", pattern, ptr));
+ RETURN_FAILURE;
+
+#if !USE_COMPUTED_GOTOS
+ default:
+#endif
+ // Also any unused opcodes:
+ TARGET(SRE_OP_RANGE_UNI_IGNORE):
+ TARGET(SRE_OP_SUBPATTERN):
+ TARGET(SRE_OP_RANGE):
+ TARGET(SRE_OP_NEGATE):
+ TARGET(SRE_OP_BIGCHARSET):
+ TARGET(SRE_OP_CHARSET):
+ TRACE(("|%p|%p|UNKNOWN %d\n", pattern, ptr,
+ pattern[-1]));
+ RETURN_ERROR(SRE_ERROR_ILLEGAL);
+
+ }
+
+exit:
+ ctx_pos = ctx->last_ctx_pos;
+ jump = ctx->jump;
+ DATA_POP_DISCARD(ctx);
+ if (ctx_pos == -1) {
+ state->sigcount = sigcount;
+ return ret;
+ }
+ DATA_LOOKUP_AT(SRE(match_context), ctx, ctx_pos);
+
+ switch (jump) {
+ case JUMP_MAX_UNTIL_2:
+ TRACE(("|%p|%p|JUMP_MAX_UNTIL_2\n", pattern, ptr));
+ goto jump_max_until_2;
+ case JUMP_MAX_UNTIL_3:
+ TRACE(("|%p|%p|JUMP_MAX_UNTIL_3\n", pattern, ptr));
+ goto jump_max_until_3;
+ case JUMP_MIN_UNTIL_2:
+ TRACE(("|%p|%p|JUMP_MIN_UNTIL_2\n", pattern, ptr));
+ goto jump_min_until_2;
+ case JUMP_MIN_UNTIL_3:
+ TRACE(("|%p|%p|JUMP_MIN_UNTIL_3\n", pattern, ptr));
+ goto jump_min_until_3;
+ case JUMP_BRANCH:
+ TRACE(("|%p|%p|JUMP_BRANCH\n", pattern, ptr));
+ goto jump_branch;
+ case JUMP_MAX_UNTIL_1:
+ TRACE(("|%p|%p|JUMP_MAX_UNTIL_1\n", pattern, ptr));
+ goto jump_max_until_1;
+ case JUMP_MIN_UNTIL_1:
+ TRACE(("|%p|%p|JUMP_MIN_UNTIL_1\n", pattern, ptr));
+ goto jump_min_until_1;
+ case JUMP_POSS_REPEAT_1:
+ TRACE(("|%p|%p|JUMP_POSS_REPEAT_1\n", pattern, ptr));
+ goto jump_poss_repeat_1;
+ case JUMP_POSS_REPEAT_2:
+ TRACE(("|%p|%p|JUMP_POSS_REPEAT_2\n", pattern, ptr));
+ goto jump_poss_repeat_2;
+ case JUMP_REPEAT:
+ TRACE(("|%p|%p|JUMP_REPEAT\n", pattern, ptr));
+ goto jump_repeat;
+ case JUMP_REPEAT_ONE_1:
+ TRACE(("|%p|%p|JUMP_REPEAT_ONE_1\n", pattern, ptr));
+ goto jump_repeat_one_1;
+ case JUMP_REPEAT_ONE_2:
+ TRACE(("|%p|%p|JUMP_REPEAT_ONE_2\n", pattern, ptr));
+ goto jump_repeat_one_2;
+ case JUMP_MIN_REPEAT_ONE:
+ TRACE(("|%p|%p|JUMP_MIN_REPEAT_ONE\n", pattern, ptr));
+ goto jump_min_repeat_one;
+ case JUMP_ATOMIC_GROUP:
+ TRACE(("|%p|%p|JUMP_ATOMIC_GROUP\n", pattern, ptr));
+ goto jump_atomic_group;
+ case JUMP_ASSERT:
+ TRACE(("|%p|%p|JUMP_ASSERT\n", pattern, ptr));
+ goto jump_assert;
+ case JUMP_ASSERT_NOT:
+ TRACE(("|%p|%p|JUMP_ASSERT_NOT\n", pattern, ptr));
+ goto jump_assert_not;
+ case JUMP_NONE:
+ TRACE(("|%p|%p|RETURN %zd\n", pattern,
+ ptr, ret));
+ break;
+ }
+
+ return ret; /* should never get here */
+}
+
+/* need to reset capturing groups between two SRE(match) callings in loops */
+#define RESET_CAPTURE_GROUP() \
+ do { state->lastmark = state->lastindex = -1; } while (0)
+
+LOCAL(Py_ssize_t)
+SRE(search)(SRE_STATE* state, SRE_CODE* pattern)
+{
+ SRE_CHAR* ptr = (SRE_CHAR *)state->start;
+ SRE_CHAR* end = (SRE_CHAR *)state->end;
+ Py_ssize_t status = 0;
+ Py_ssize_t prefix_len = 0;
+ Py_ssize_t prefix_skip = 0;
+ SRE_CODE* prefix = NULL;
+ SRE_CODE* charset = NULL;
+ SRE_CODE* overlap = NULL;
+ int flags = 0;
+
+ if (ptr > end)
+ return 0;
+
+ if (pattern[0] == SRE_OP_INFO) {
+ /* optimization info block */
+ /* <INFO> <1=skip> <2=flags> <3=min> <4=max> <5=prefix info> */
+
+ flags = pattern[2];
+
+ if (pattern[3] && (uintptr_t)(end - ptr) < pattern[3]) {
+ TRACE(("reject (got %tu chars, need %zu)\n",
+ end - ptr, (size_t) pattern[3]));
+ return 0;
+ }
+ if (pattern[3] > 1) {
+ /* adjust end point (but make sure we leave at least one
+ character in there, so literal search will work) */
+ end -= pattern[3] - 1;
+ if (end <= ptr)
+ end = ptr;
+ }
+
+ if (flags & SRE_INFO_PREFIX) {
+ /* pattern starts with a known prefix */
+ /* <length> <skip> <prefix data> <overlap data> */
+ prefix_len = pattern[5];
+ prefix_skip = pattern[6];
+ prefix = pattern + 7;
+ overlap = prefix + prefix_len - 1;
+ } else if (flags & SRE_INFO_CHARSET)
+ /* pattern starts with a character from a known set */
+ /* <charset> */
+ charset = pattern + 5;
+
+ pattern += 1 + pattern[1];
+ }
+
+ TRACE(("prefix = %p %zd %zd\n",
+ prefix, prefix_len, prefix_skip));
+ TRACE(("charset = %p\n", charset));
+
+ if (prefix_len == 1) {
+ /* pattern starts with a literal character */
+ SRE_CHAR c = (SRE_CHAR) prefix[0];
+#if SIZEOF_SRE_CHAR < 4
+ if ((SRE_CODE) c != prefix[0])
+ return 0; /* literal can't match: doesn't fit in char width */
+#endif
+ end = (SRE_CHAR *)state->end;
+ state->must_advance = 0;
+ while (ptr < end) {
+ while (*ptr != c) {
+ if (++ptr >= end)
+ return 0;
+ }
+ TRACE(("|%p|%p|SEARCH LITERAL\n", pattern, ptr));
+ state->start = ptr;
+ state->ptr = ptr + prefix_skip;
+ if (flags & SRE_INFO_LITERAL)
+ return 1; /* we got all of it */
+ status = SRE(match)(state, pattern + 2*prefix_skip, 0);
+ if (status != 0)
+ return status;
+ ++ptr;
+ RESET_CAPTURE_GROUP();
+ }
+ return 0;
+ }
+
+ if (prefix_len > 1) {
+ /* pattern starts with a known prefix. use the overlap
+ table to skip forward as fast as we possibly can */
+ Py_ssize_t i = 0;
+
+ end = (SRE_CHAR *)state->end;
+ if (prefix_len > end - ptr)
+ return 0;
+#if SIZEOF_SRE_CHAR < 4
+ for (i = 0; i < prefix_len; i++)
+ if ((SRE_CODE)(SRE_CHAR) prefix[i] != prefix[i])
+ return 0; /* literal can't match: doesn't fit in char width */
+#endif
+ while (ptr < end) {
+ SRE_CHAR c = (SRE_CHAR) prefix[0];
+ while (*ptr++ != c) {
+ if (ptr >= end)
+ return 0;
+ }
+ if (ptr >= end)
+ return 0;
+
+ i = 1;
+ state->must_advance = 0;
+ do {
+ if (*ptr == (SRE_CHAR) prefix[i]) {
+ if (++i != prefix_len) {
+ if (++ptr >= end)
+ return 0;
+ continue;
+ }
+ /* found a potential match */
+ TRACE(("|%p|%p|SEARCH SCAN\n", pattern, ptr));
+ state->start = ptr - (prefix_len - 1);
+ state->ptr = ptr - (prefix_len - prefix_skip - 1);
+ if (flags & SRE_INFO_LITERAL)
+ return 1; /* we got all of it */
+ status = SRE(match)(state, pattern + 2*prefix_skip, 0);
+ if (status != 0)
+ return status;
+ /* close but no cigar -- try again */
+ if (++ptr >= end)
+ return 0;
+ RESET_CAPTURE_GROUP();
+ }
+ i = overlap[i];
+ } while (i != 0);
+ }
+ return 0;
+ }
+
+ if (charset) {
+ /* pattern starts with a character from a known set */
+ end = (SRE_CHAR *)state->end;
+ state->must_advance = 0;
+ for (;;) {
+ while (ptr < end && !SRE(charset)(state, charset, *ptr))
+ ptr++;
+ if (ptr >= end)
+ return 0;
+ TRACE(("|%p|%p|SEARCH CHARSET\n", pattern, ptr));
+ state->start = ptr;
+ state->ptr = ptr;
+ status = SRE(match)(state, pattern, 0);
+ if (status != 0)
+ break;
+ ptr++;
+ RESET_CAPTURE_GROUP();
+ }
+ } else {
+ /* general case */
+ assert(ptr <= end);
+ TRACE(("|%p|%p|SEARCH\n", pattern, ptr));
+ state->start = state->ptr = ptr;
+ status = SRE(match)(state, pattern, 1);
+ state->must_advance = 0;
+ if (status == 0 && pattern[0] == SRE_OP_AT &&
+ (pattern[1] == SRE_AT_BEGINNING ||
+ pattern[1] == SRE_AT_BEGINNING_STRING))
+ {
+ state->start = state->ptr = ptr = end;
+ return 0;
+ }
+ while (status == 0 && ptr < end) {
+ ptr++;
+ RESET_CAPTURE_GROUP();
+ TRACE(("|%p|%p|SEARCH\n", pattern, ptr));
+ state->start = state->ptr = ptr;
+ status = SRE(match)(state, pattern, 0);
+ }
+ }
+
+ return status;
+}
+
+#undef SRE_CHAR
+#undef SIZEOF_SRE_CHAR
+#undef SRE
+
+/* vim:ts=4:sw=4:et
+*/
diff --git a/contrib/tools/python3/Modules/_sre/sre_targets.h b/contrib/tools/python3/Modules/_sre/sre_targets.h
new file mode 100644
index 00000000000..62761a0000d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_sre/sre_targets.h
@@ -0,0 +1,58 @@
+/*
+ * Secret Labs' Regular Expression Engine
+ *
+ * regular expression matching engine
+ *
+ * Auto-generated by Tools/build/generate_sre_constants.py from
+ * Lib/re/_constants.py.
+ *
+ * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
+ *
+ * See the sre.c file for information on usage and redistribution.
+ */
+
+static void *sre_targets[43] = {
+ &&TARGET_SRE_OP_FAILURE,
+ &&TARGET_SRE_OP_SUCCESS,
+ &&TARGET_SRE_OP_ANY,
+ &&TARGET_SRE_OP_ANY_ALL,
+ &&TARGET_SRE_OP_ASSERT,
+ &&TARGET_SRE_OP_ASSERT_NOT,
+ &&TARGET_SRE_OP_AT,
+ &&TARGET_SRE_OP_BRANCH,
+ &&TARGET_SRE_OP_CATEGORY,
+ &&TARGET_SRE_OP_CHARSET,
+ &&TARGET_SRE_OP_BIGCHARSET,
+ &&TARGET_SRE_OP_GROUPREF,
+ &&TARGET_SRE_OP_GROUPREF_EXISTS,
+ &&TARGET_SRE_OP_IN,
+ &&TARGET_SRE_OP_INFO,
+ &&TARGET_SRE_OP_JUMP,
+ &&TARGET_SRE_OP_LITERAL,
+ &&TARGET_SRE_OP_MARK,
+ &&TARGET_SRE_OP_MAX_UNTIL,
+ &&TARGET_SRE_OP_MIN_UNTIL,
+ &&TARGET_SRE_OP_NOT_LITERAL,
+ &&TARGET_SRE_OP_NEGATE,
+ &&TARGET_SRE_OP_RANGE,
+ &&TARGET_SRE_OP_REPEAT,
+ &&TARGET_SRE_OP_REPEAT_ONE,
+ &&TARGET_SRE_OP_SUBPATTERN,
+ &&TARGET_SRE_OP_MIN_REPEAT_ONE,
+ &&TARGET_SRE_OP_ATOMIC_GROUP,
+ &&TARGET_SRE_OP_POSSESSIVE_REPEAT,
+ &&TARGET_SRE_OP_POSSESSIVE_REPEAT_ONE,
+ &&TARGET_SRE_OP_GROUPREF_IGNORE,
+ &&TARGET_SRE_OP_IN_IGNORE,
+ &&TARGET_SRE_OP_LITERAL_IGNORE,
+ &&TARGET_SRE_OP_NOT_LITERAL_IGNORE,
+ &&TARGET_SRE_OP_GROUPREF_LOC_IGNORE,
+ &&TARGET_SRE_OP_IN_LOC_IGNORE,
+ &&TARGET_SRE_OP_LITERAL_LOC_IGNORE,
+ &&TARGET_SRE_OP_NOT_LITERAL_LOC_IGNORE,
+ &&TARGET_SRE_OP_GROUPREF_UNI_IGNORE,
+ &&TARGET_SRE_OP_IN_UNI_IGNORE,
+ &&TARGET_SRE_OP_LITERAL_UNI_IGNORE,
+ &&TARGET_SRE_OP_NOT_LITERAL_UNI_IGNORE,
+ &&TARGET_SRE_OP_RANGE_UNI_IGNORE,
+};
diff --git a/contrib/tools/python3/Modules/_ssl.c b/contrib/tools/python3/Modules/_ssl.c
new file mode 100644
index 00000000000..7b4e9b5d696
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl.c
@@ -0,0 +1,6294 @@
+/* SSL socket module
+
+ SSL support based on patches by Brian E Gallew and Laszlo Kovacs.
+ Re-worked a bit by Bill Janssen to add server-side support and
+ certificate decoding. Chris Stawarz contributed some non-blocking
+ patches.
+
+ This module is imported by ssl.py. It should *not* be used
+ directly.
+
+ XXX should partial writes be enabled, SSL_MODE_ENABLE_PARTIAL_WRITE?
+
+ XXX integrate several "shutdown modes" as suggested in
+ http://bugs.python.org/issue8108#msg102867 ?
+*/
+
+/* Don't warn about deprecated functions, */
+#ifndef OPENSSL_API_COMPAT
+ // 0x10101000L == 1.1.1, 30000 == 3.0.0
+ #define OPENSSL_API_COMPAT 0x10101000L
+#endif
+#define OPENSSL_NO_DEPRECATED 1
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+
+/* Include symbols from _socket module */
+#include "socketmodule.h"
+
+#ifdef MS_WINDOWS
+# include <wincrypt.h>
+#endif
+
+#include "_ssl.h"
+
+/* Redefined below for Windows debug builds after important #includes */
+#define _PySSL_FIX_ERRNO
+
+#define PySSL_BEGIN_ALLOW_THREADS_S(save) \
+ do { (save) = PyEval_SaveThread(); } while(0)
+#define PySSL_END_ALLOW_THREADS_S(save) \
+ do { PyEval_RestoreThread(save); _PySSL_FIX_ERRNO; } while(0)
+#define PySSL_BEGIN_ALLOW_THREADS { \
+ PyThreadState *_save = NULL; \
+ PySSL_BEGIN_ALLOW_THREADS_S(_save);
+#define PySSL_END_ALLOW_THREADS PySSL_END_ALLOW_THREADS_S(_save); }
+
+
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+
+/* Include OpenSSL header files */
+#include "openssl/rsa.h"
+#include "openssl/crypto.h"
+#include "openssl/x509.h"
+#include "openssl/x509v3.h"
+#include "openssl/pem.h"
+#include "openssl/ssl.h"
+#include "openssl/err.h"
+#include "openssl/rand.h"
+#include "openssl/bio.h"
+#include "openssl/dh.h"
+
+#ifndef OPENSSL_THREADS
+# error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL"
+#endif
+
+
+
+struct py_ssl_error_code {
+ const char *mnemonic;
+ int library, reason;
+};
+
+struct py_ssl_library_code {
+ const char *library;
+ int code;
+};
+
+#if defined(MS_WINDOWS) && defined(Py_DEBUG)
+/* Debug builds on Windows rely on getting errno directly from OpenSSL.
+ * However, because it uses a different CRT, we need to transfer the
+ * value of errno from OpenSSL into our debug CRT.
+ *
+ * Don't be fooled - this is horribly ugly code. The only reasonable
+ * alternative is to do both debug and release builds of OpenSSL, which
+ * requires much uglier code to transform their automatically generated
+ * makefile. This is the lesser of all the evils.
+ */
+
+static void _PySSLFixErrno(void) {
+ HMODULE ucrtbase = GetModuleHandleW(L"ucrtbase.dll");
+ if (!ucrtbase) {
+ /* If ucrtbase.dll is not loaded but the SSL DLLs are, we likely
+ * have a catastrophic failure, but this function is not the
+ * place to raise it. */
+ return;
+ }
+
+ typedef int *(__stdcall *errno_func)(void);
+ errno_func ssl_errno = (errno_func)GetProcAddress(ucrtbase, "_errno");
+ if (ssl_errno) {
+ errno = *ssl_errno();
+ *ssl_errno() = 0;
+ } else {
+ errno = ENOTRECOVERABLE;
+ }
+}
+
+#undef _PySSL_FIX_ERRNO
+#define _PySSL_FIX_ERRNO _PySSLFixErrno()
+#endif
+
+/* Include generated data (error codes) */
+#if (OPENSSL_VERSION_NUMBER >= 0x30100000L)
+#include "_ssl_data_31.h"
+#elif (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+#include "_ssl_data_300.h"
+#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#include "_ssl_data_111.h"
+#else
+#include "_ssl_data.h"
+#endif
+
+/* OpenSSL API 1.1.0+ does not include version methods */
+#ifndef OPENSSL_NO_SSL3_METHOD
+extern const SSL_METHOD *SSLv3_method(void);
+#endif
+#ifndef OPENSSL_NO_TLS1_METHOD
+extern const SSL_METHOD *TLSv1_method(void);
+#endif
+#ifndef OPENSSL_NO_TLS1_1_METHOD
+extern const SSL_METHOD *TLSv1_1_method(void);
+#endif
+#ifndef OPENSSL_NO_TLS1_2_METHOD
+extern const SSL_METHOD *TLSv1_2_method(void);
+#endif
+
+#ifndef INVALID_SOCKET /* MS defines this */
+#define INVALID_SOCKET (-1)
+#endif
+
+/* Default cipher suites */
+#ifndef PY_SSL_DEFAULT_CIPHERS
+#define PY_SSL_DEFAULT_CIPHERS 1
+#endif
+
+#if PY_SSL_DEFAULT_CIPHERS == 0
+ #ifndef PY_SSL_DEFAULT_CIPHER_STRING
+ #error "Py_SSL_DEFAULT_CIPHERS 0 needs Py_SSL_DEFAULT_CIPHER_STRING"
+ #endif
+ #ifndef PY_SSL_MIN_PROTOCOL
+ #define PY_SSL_MIN_PROTOCOL TLS1_2_VERSION
+ #endif
+#elif PY_SSL_DEFAULT_CIPHERS == 1
+/* Python custom selection of sensible cipher suites
+ * @SECLEVEL=2: security level 2 with 112 bits minimum security (e.g. 2048 bits RSA key)
+ * ECDH+*: enable ephemeral elliptic curve Diffie-Hellman
+ * DHE+*: fallback to ephemeral finite field Diffie-Hellman
+ * encryption order: AES AEAD (GCM), ChaCha AEAD, AES CBC
+ * !aNULL:!eNULL: really no NULL ciphers
+ * !aDSS: no authentication with discrete logarithm DSA algorithm
+ * !SHA1: no weak SHA1 MAC
+ * !AESCCM: no CCM mode, it's uncommon and slow
+ *
+ * Based on Hynek's excellent blog post (update 2021-02-11)
+ * https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
+ */
+ #define PY_SSL_DEFAULT_CIPHER_STRING "DEFAULT:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
+ #ifndef PY_SSL_MIN_PROTOCOL
+ #define PY_SSL_MIN_PROTOCOL TLS1_2_VERSION
+ #endif
+#elif PY_SSL_DEFAULT_CIPHERS == 2
+/* Ignored in SSLContext constructor, only used to as _ssl.DEFAULT_CIPHER_STRING */
+ #define PY_SSL_DEFAULT_CIPHER_STRING SSL_DEFAULT_CIPHER_LIST
+#else
+ #error "Unsupported PY_SSL_DEFAULT_CIPHERS"
+#endif
+
+
+enum py_ssl_error {
+ /* these mirror ssl.h */
+ PY_SSL_ERROR_NONE,
+ PY_SSL_ERROR_SSL,
+ PY_SSL_ERROR_WANT_READ,
+ PY_SSL_ERROR_WANT_WRITE,
+ PY_SSL_ERROR_WANT_X509_LOOKUP,
+ PY_SSL_ERROR_SYSCALL, /* look at error stack/return value/errno */
+ PY_SSL_ERROR_ZERO_RETURN,
+ PY_SSL_ERROR_WANT_CONNECT,
+ /* start of non ssl.h errorcodes */
+ PY_SSL_ERROR_EOF, /* special case of SSL_ERROR_SYSCALL */
+ PY_SSL_ERROR_NO_SOCKET, /* socket has been GC'd */
+ PY_SSL_ERROR_INVALID_ERROR_CODE
+};
+
+enum py_ssl_server_or_client {
+ PY_SSL_CLIENT,
+ PY_SSL_SERVER
+};
+
+enum py_ssl_cert_requirements {
+ PY_SSL_CERT_NONE,
+ PY_SSL_CERT_OPTIONAL,
+ PY_SSL_CERT_REQUIRED
+};
+
+enum py_ssl_version {
+ PY_SSL_VERSION_SSL2,
+ PY_SSL_VERSION_SSL3=1,
+ PY_SSL_VERSION_TLS, /* SSLv23 */
+ PY_SSL_VERSION_TLS1,
+ PY_SSL_VERSION_TLS1_1,
+ PY_SSL_VERSION_TLS1_2,
+ PY_SSL_VERSION_TLS_CLIENT=0x10,
+ PY_SSL_VERSION_TLS_SERVER,
+};
+
+enum py_proto_version {
+ PY_PROTO_MINIMUM_SUPPORTED = -2,
+ PY_PROTO_SSLv3 = SSL3_VERSION,
+ PY_PROTO_TLSv1 = TLS1_VERSION,
+ PY_PROTO_TLSv1_1 = TLS1_1_VERSION,
+ PY_PROTO_TLSv1_2 = TLS1_2_VERSION,
+#ifdef TLS1_3_VERSION
+ PY_PROTO_TLSv1_3 = TLS1_3_VERSION,
+#else
+ PY_PROTO_TLSv1_3 = 0x304,
+#endif
+ PY_PROTO_MAXIMUM_SUPPORTED = -1,
+
+/* OpenSSL has no dedicated API to set the minimum version to the maximum
+ * available version, and the other way around. We have to figure out the
+ * minimum and maximum available version on our own and hope for the best.
+ */
+#if defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
+ PY_PROTO_MINIMUM_AVAILABLE = PY_PROTO_SSLv3,
+#elif defined(TLS1_VERSION) && !defined(OPENSSL_NO_TLS1)
+ PY_PROTO_MINIMUM_AVAILABLE = PY_PROTO_TLSv1,
+#elif defined(TLS1_1_VERSION) && !defined(OPENSSL_NO_TLS1_1)
+ PY_PROTO_MINIMUM_AVAILABLE = PY_PROTO_TLSv1_1,
+#elif defined(TLS1_2_VERSION) && !defined(OPENSSL_NO_TLS1_2)
+ PY_PROTO_MINIMUM_AVAILABLE = PY_PROTO_TLSv1_2,
+#elif defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
+ PY_PROTO_MINIMUM_AVAILABLE = PY_PROTO_TLSv1_3,
+#else
+ #error "PY_PROTO_MINIMUM_AVAILABLE not found"
+#endif
+
+#if defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
+ PY_PROTO_MAXIMUM_AVAILABLE = PY_PROTO_TLSv1_3,
+#elif defined(TLS1_2_VERSION) && !defined(OPENSSL_NO_TLS1_2)
+ PY_PROTO_MAXIMUM_AVAILABLE = PY_PROTO_TLSv1_2,
+#elif defined(TLS1_1_VERSION) && !defined(OPENSSL_NO_TLS1_1)
+ PY_PROTO_MAXIMUM_AVAILABLE = PY_PROTO_TLSv1_1,
+#elif defined(TLS1_VERSION) && !defined(OPENSSL_NO_TLS1)
+ PY_PROTO_MAXIMUM_AVAILABLE = PY_PROTO_TLSv1,
+#elif defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
+ PY_PROTO_MAXIMUM_AVAILABLE = PY_PROTO_SSLv3,
+#else
+ #error "PY_PROTO_MAXIMUM_AVAILABLE not found"
+#endif
+};
+
+/* SSL socket object */
+
+#define X509_NAME_MAXLEN 256
+
+
+/* In case of 'tls-unique' it will be 12 bytes for TLS, 36 bytes for
+ * older SSL, but let's be safe */
+#define PySSL_CB_MAXLEN 128
+
+
+typedef struct {
+ PyObject_HEAD
+ SSL_CTX *ctx;
+ unsigned char *alpn_protocols;
+ unsigned int alpn_protocols_len;
+ PyObject *set_sni_cb;
+ int check_hostname;
+ /* OpenSSL has no API to get hostflags from X509_VERIFY_PARAM* struct.
+ * We have to maintain our own copy. OpenSSL's hostflags default to 0.
+ */
+ unsigned int hostflags;
+ int protocol;
+#ifdef TLS1_3_VERSION
+ int post_handshake_auth;
+#endif
+ PyObject *msg_cb;
+ PyObject *keylog_filename;
+ BIO *keylog_bio;
+ /* Cached module state, also used in SSLSocket and SSLSession code. */
+ _sslmodulestate *state;
+} PySSLContext;
+
+typedef struct {
+ int ssl; /* last seen error from SSL */
+ int c; /* last seen error from libc */
+#ifdef MS_WINDOWS
+ int ws; /* last seen error from winsock */
+#endif
+} _PySSLError;
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *Socket; /* weakref to socket on which we're layered */
+ SSL *ssl;
+ PySSLContext *ctx; /* weakref to SSL context */
+ char shutdown_seen_zero;
+ enum py_ssl_server_or_client socket_type;
+ PyObject *owner; /* Python level "owner" passed to servername callback */
+ PyObject *server_hostname;
+ _PySSLError err; /* last seen error from various sources */
+ /* Some SSL callbacks don't have error reporting. Callback wrappers
+ * store exception information on the socket. The handshake, read, write,
+ * and shutdown methods check for chained exceptions.
+ */
+ PyObject *exc;
+} PySSLSocket;
+
+typedef struct {
+ PyObject_HEAD
+ BIO *bio;
+ int eof_written;
+} PySSLMemoryBIO;
+
+typedef struct {
+ PyObject_HEAD
+ SSL_SESSION *session;
+ PySSLContext *ctx;
+} PySSLSession;
+
+static inline _PySSLError _PySSL_errno(int failed, const SSL *ssl, int retcode)
+{
+ _PySSLError err = { 0 };
+ if (failed) {
+#ifdef MS_WINDOWS
+ err.ws = WSAGetLastError();
+ _PySSL_FIX_ERRNO;
+#endif
+ err.c = errno;
+ err.ssl = SSL_get_error(ssl, retcode);
+ }
+ return err;
+}
+
+/*[clinic input]
+module _ssl
+class _ssl._SSLContext "PySSLContext *" "get_state_type(type)->PySSLContext_Type"
+class _ssl._SSLSocket "PySSLSocket *" "get_state_type(type)->PySSLSocket_Type"
+class _ssl.MemoryBIO "PySSLMemoryBIO *" "get_state_type(type)->PySSLMemoryBIO_Type"
+class _ssl.SSLSession "PySSLSession *" "get_state_type(type)->PySSLSession_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d293bed8bae240fd]*/
+
+#include "clinic/_ssl.c.h"
+
+static int PySSL_select(PySocketSockObject *s, int writing, _PyTime_t timeout);
+
+static int PySSL_set_owner(PySSLSocket *, PyObject *, void *);
+static int PySSL_set_session(PySSLSocket *, PyObject *, void *);
+
+typedef enum {
+ SOCKET_IS_NONBLOCKING,
+ SOCKET_IS_BLOCKING,
+ SOCKET_HAS_TIMED_OUT,
+ SOCKET_HAS_BEEN_CLOSED,
+ SOCKET_TOO_LARGE_FOR_SELECT,
+ SOCKET_OPERATION_OK
+} timeout_state;
+
+/* Wrap error strings with filename and line # */
+#define ERRSTR1(x,y,z) (x ":" y ": " z)
+#define ERRSTR(x) ERRSTR1("_ssl.c", Py_STRINGIFY(__LINE__), x)
+
+/* Get the socket from a PySSLSocket, if it has one */
+#define GET_SOCKET(obj) ((obj)->Socket ? \
+ (PySocketSockObject *) PyWeakref_GetObject((obj)->Socket) : NULL)
+
+/* If sock is NULL, use a timeout of 0 second */
+#define GET_SOCKET_TIMEOUT(sock) \
+ ((sock != NULL) ? (sock)->sock_timeout : 0)
+
+#include "_ssl/debughelpers.c"
+
+/*
+ * SSL errors.
+ */
+
+PyDoc_STRVAR(SSLError_doc,
+"An error occurred in the SSL implementation.");
+
+PyDoc_STRVAR(SSLCertVerificationError_doc,
+"A certificate could not be verified.");
+
+PyDoc_STRVAR(SSLZeroReturnError_doc,
+"SSL/TLS session closed cleanly.");
+
+PyDoc_STRVAR(SSLWantReadError_doc,
+"Non-blocking SSL socket needs to read more data\n"
+"before the requested operation can be completed.");
+
+PyDoc_STRVAR(SSLWantWriteError_doc,
+"Non-blocking SSL socket needs to write more data\n"
+"before the requested operation can be completed.");
+
+PyDoc_STRVAR(SSLSyscallError_doc,
+"System error when attempting SSL operation.");
+
+PyDoc_STRVAR(SSLEOFError_doc,
+"SSL/TLS connection terminated abruptly.");
+
+static PyObject *
+SSLError_str(PyOSErrorObject *self)
+{
+ if (self->strerror != NULL && PyUnicode_Check(self->strerror)) {
+ return Py_NewRef(self->strerror);
+ }
+ else
+ return PyObject_Str(self->args);
+}
+
+static PyType_Slot sslerror_type_slots[] = {
+ {Py_tp_doc, (void*)SSLError_doc},
+ {Py_tp_str, SSLError_str},
+ {0, 0},
+};
+
+static PyType_Spec sslerror_type_spec = {
+ .name = "ssl.SSLError",
+ .basicsize = sizeof(PyOSErrorObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = sslerror_type_slots
+};
+
+static void
+fill_and_set_sslerror(_sslmodulestate *state,
+ PySSLSocket *sslsock, PyObject *type, int ssl_errno,
+ const char *errstr, int lineno, unsigned long errcode)
+{
+ PyObject *err_value = NULL, *reason_obj = NULL, *lib_obj = NULL;
+ PyObject *verify_obj = NULL, *verify_code_obj = NULL;
+ PyObject *init_value, *msg, *key;
+
+ if (errcode != 0) {
+ int lib, reason;
+
+ lib = ERR_GET_LIB(errcode);
+ reason = ERR_GET_REASON(errcode);
+ key = Py_BuildValue("ii", lib, reason);
+ if (key == NULL)
+ goto fail;
+ reason_obj = PyDict_GetItemWithError(state->err_codes_to_names, key);
+ Py_DECREF(key);
+ if (reason_obj == NULL && PyErr_Occurred()) {
+ goto fail;
+ }
+ key = PyLong_FromLong(lib);
+ if (key == NULL)
+ goto fail;
+ lib_obj = PyDict_GetItemWithError(state->lib_codes_to_names, key);
+ Py_DECREF(key);
+ if (lib_obj == NULL && PyErr_Occurred()) {
+ goto fail;
+ }
+ if (errstr == NULL)
+ errstr = ERR_reason_error_string(errcode);
+ }
+ if (errstr == NULL)
+ errstr = "unknown error";
+
+ /* verify code for cert validation error */
+ if ((sslsock != NULL) && (type == state->PySSLCertVerificationErrorObject)) {
+ const char *verify_str = NULL;
+ long verify_code;
+
+ verify_code = SSL_get_verify_result(sslsock->ssl);
+ verify_code_obj = PyLong_FromLong(verify_code);
+ if (verify_code_obj == NULL) {
+ goto fail;
+ }
+
+ switch (verify_code) {
+ case X509_V_ERR_HOSTNAME_MISMATCH:
+ verify_obj = PyUnicode_FromFormat(
+ "Hostname mismatch, certificate is not valid for '%S'.",
+ sslsock->server_hostname
+ );
+ break;
+ case X509_V_ERR_IP_ADDRESS_MISMATCH:
+ verify_obj = PyUnicode_FromFormat(
+ "IP address mismatch, certificate is not valid for '%S'.",
+ sslsock->server_hostname
+ );
+ break;
+ default:
+ verify_str = X509_verify_cert_error_string(verify_code);
+ if (verify_str != NULL) {
+ verify_obj = PyUnicode_FromString(verify_str);
+ } else {
+ verify_obj = Py_NewRef(Py_None);
+ }
+ break;
+ }
+ if (verify_obj == NULL) {
+ goto fail;
+ }
+ }
+
+ if (verify_obj && reason_obj && lib_obj)
+ msg = PyUnicode_FromFormat("[%S: %S] %s: %S (_ssl.c:%d)",
+ lib_obj, reason_obj, errstr, verify_obj,
+ lineno);
+ else if (reason_obj && lib_obj)
+ msg = PyUnicode_FromFormat("[%S: %S] %s (_ssl.c:%d)",
+ lib_obj, reason_obj, errstr, lineno);
+ else if (lib_obj)
+ msg = PyUnicode_FromFormat("[%S] %s (_ssl.c:%d)",
+ lib_obj, errstr, lineno);
+ else
+ msg = PyUnicode_FromFormat("%s (_ssl.c:%d)", errstr, lineno);
+ if (msg == NULL)
+ goto fail;
+
+ init_value = Py_BuildValue("iN", ERR_GET_REASON(ssl_errno), msg);
+ if (init_value == NULL)
+ goto fail;
+
+ err_value = PyObject_CallObject(type, init_value);
+ Py_DECREF(init_value);
+ if (err_value == NULL)
+ goto fail;
+
+ if (reason_obj == NULL)
+ reason_obj = Py_None;
+ if (PyObject_SetAttr(err_value, state->str_reason, reason_obj))
+ goto fail;
+
+ if (lib_obj == NULL)
+ lib_obj = Py_None;
+ if (PyObject_SetAttr(err_value, state->str_library, lib_obj))
+ goto fail;
+
+ if ((sslsock != NULL) && (type == state->PySSLCertVerificationErrorObject)) {
+ /* Only set verify code / message for SSLCertVerificationError */
+ if (PyObject_SetAttr(err_value, state->str_verify_code,
+ verify_code_obj))
+ goto fail;
+ if (PyObject_SetAttr(err_value, state->str_verify_message, verify_obj))
+ goto fail;
+ }
+
+ PyErr_SetObject(type, err_value);
+fail:
+ Py_XDECREF(err_value);
+ Py_XDECREF(verify_code_obj);
+ Py_XDECREF(verify_obj);
+}
+
+static int
+PySSL_ChainExceptions(PySSLSocket *sslsock) {
+ if (sslsock->exc == NULL)
+ return 0;
+
+ _PyErr_ChainExceptions1(sslsock->exc);
+ sslsock->exc = NULL;
+ return -1;
+}
+
+static PyObject *
+PySSL_SetError(PySSLSocket *sslsock, int ret, const char *filename, int lineno)
+{
+ PyObject *type;
+ char *errstr = NULL;
+ _PySSLError err;
+ enum py_ssl_error p = PY_SSL_ERROR_NONE;
+ unsigned long e = 0;
+
+ assert(sslsock != NULL);
+
+ _sslmodulestate *state = get_state_sock(sslsock);
+ type = state->PySSLErrorObject;
+
+ assert(ret <= 0);
+ e = ERR_peek_last_error();
+
+ if (sslsock->ssl != NULL) {
+ err = sslsock->err;
+
+ switch (err.ssl) {
+ case SSL_ERROR_ZERO_RETURN:
+ errstr = "TLS/SSL connection has been closed (EOF)";
+ type = state->PySSLZeroReturnErrorObject;
+ p = PY_SSL_ERROR_ZERO_RETURN;
+ break;
+ case SSL_ERROR_WANT_READ:
+ errstr = "The operation did not complete (read)";
+ type = state->PySSLWantReadErrorObject;
+ p = PY_SSL_ERROR_WANT_READ;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ p = PY_SSL_ERROR_WANT_WRITE;
+ type = state->PySSLWantWriteErrorObject;
+ errstr = "The operation did not complete (write)";
+ break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ p = PY_SSL_ERROR_WANT_X509_LOOKUP;
+ errstr = "The operation did not complete (X509 lookup)";
+ break;
+ case SSL_ERROR_WANT_CONNECT:
+ p = PY_SSL_ERROR_WANT_CONNECT;
+ errstr = "The operation did not complete (connect)";
+ break;
+ case SSL_ERROR_SYSCALL:
+ {
+ if (e == 0) {
+ PySocketSockObject *s = GET_SOCKET(sslsock);
+ if (ret == 0 || (((PyObject *)s) == Py_None)) {
+ p = PY_SSL_ERROR_EOF;
+ type = state->PySSLEOFErrorObject;
+ errstr = "EOF occurred in violation of protocol";
+ } else if (s && ret == -1) {
+ /* underlying BIO reported an I/O error */
+ ERR_clear_error();
+#ifdef MS_WINDOWS
+ if (err.ws) {
+ return PyErr_SetFromWindowsErr(err.ws);
+ }
+#endif
+ if (err.c) {
+ errno = err.c;
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ else {
+ p = PY_SSL_ERROR_EOF;
+ type = state->PySSLEOFErrorObject;
+ errstr = "EOF occurred in violation of protocol";
+ }
+ } else { /* possible? */
+ p = PY_SSL_ERROR_SYSCALL;
+ type = state->PySSLSyscallErrorObject;
+ errstr = "Some I/O error occurred";
+ }
+ } else {
+ if (ERR_GET_LIB(e) == ERR_LIB_SSL &&
+ ERR_GET_REASON(e) == SSL_R_CERTIFICATE_VERIFY_FAILED) {
+ type = state->PySSLCertVerificationErrorObject;
+ }
+ p = PY_SSL_ERROR_SYSCALL;
+ }
+ break;
+ }
+ case SSL_ERROR_SSL:
+ {
+ p = PY_SSL_ERROR_SSL;
+ if (e == 0) {
+ /* possible? */
+ errstr = "A failure in the SSL library occurred";
+ }
+ if (ERR_GET_LIB(e) == ERR_LIB_SSL &&
+ ERR_GET_REASON(e) == SSL_R_CERTIFICATE_VERIFY_FAILED) {
+ type = state->PySSLCertVerificationErrorObject;
+ }
+#if defined(SSL_R_UNEXPECTED_EOF_WHILE_READING)
+ /* OpenSSL 3.0 changed transport EOF from SSL_ERROR_SYSCALL with
+ * zero return value to SSL_ERROR_SSL with a special error code. */
+ if (ERR_GET_LIB(e) == ERR_LIB_SSL &&
+ ERR_GET_REASON(e) == SSL_R_UNEXPECTED_EOF_WHILE_READING) {
+ p = PY_SSL_ERROR_EOF;
+ type = state->PySSLEOFErrorObject;
+ errstr = "EOF occurred in violation of protocol";
+ }
+#endif
+ break;
+ }
+ default:
+ p = PY_SSL_ERROR_INVALID_ERROR_CODE;
+ errstr = "Invalid error code";
+ }
+ }
+ fill_and_set_sslerror(state, sslsock, type, p, errstr, lineno, e);
+ ERR_clear_error();
+ PySSL_ChainExceptions(sslsock);
+ return NULL;
+}
+
+static PyObject *
+_setSSLError (_sslmodulestate *state, const char *errstr, int errcode, const char *filename, int lineno)
+{
+ if (errstr == NULL)
+ errcode = ERR_peek_last_error();
+ else
+ errcode = 0;
+ fill_and_set_sslerror(state, NULL, state->PySSLErrorObject, errcode, errstr, lineno, errcode);
+ ERR_clear_error();
+ return NULL;
+}
+
+static int
+_ssl_deprecated(const char* msg, int stacklevel) {
+ return PyErr_WarnEx(
+ PyExc_DeprecationWarning, msg, stacklevel
+ );
+}
+
+#define PY_SSL_DEPRECATED(name, stacklevel, ret) \
+ if (_ssl_deprecated((name), (stacklevel)) == -1) return (ret)
+
+/*
+ * SSL objects
+ */
+
+static int
+_ssl_configure_hostname(PySSLSocket *self, const char* server_hostname)
+{
+ int retval = -1;
+ ASN1_OCTET_STRING *ip;
+ PyObject *hostname;
+ size_t len;
+
+ assert(server_hostname);
+
+ /* Disable OpenSSL's special mode with leading dot in hostname:
+ * When name starts with a dot (e.g ".example.com"), it will be
+ * matched by a certificate valid for any sub-domain of name.
+ */
+ len = strlen(server_hostname);
+ if (len == 0 || *server_hostname == '.') {
+ PyErr_SetString(
+ PyExc_ValueError,
+ "server_hostname cannot be an empty string or start with a "
+ "leading dot.");
+ return retval;
+ }
+
+ /* inet_pton is not available on all platforms. */
+ ip = a2i_IPADDRESS(server_hostname);
+ if (ip == NULL) {
+ ERR_clear_error();
+ }
+
+ hostname = PyUnicode_Decode(server_hostname, len, "ascii", "strict");
+ if (hostname == NULL) {
+ goto error;
+ }
+ self->server_hostname = hostname;
+
+ /* Only send SNI extension for non-IP hostnames */
+ if (ip == NULL) {
+ if (!SSL_set_tlsext_host_name(self->ssl, server_hostname)) {
+ _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__);
+ goto error;
+ }
+ }
+ if (self->ctx->check_hostname) {
+ X509_VERIFY_PARAM *param = SSL_get0_param(self->ssl);
+ if (ip == NULL) {
+ if (!X509_VERIFY_PARAM_set1_host(param, server_hostname,
+ strlen(server_hostname))) {
+ _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__);
+ goto error;
+ }
+ } else {
+ if (!X509_VERIFY_PARAM_set1_ip(param, ASN1_STRING_get0_data(ip),
+ ASN1_STRING_length(ip))) {
+ _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__);
+ goto error;
+ }
+ }
+ }
+ retval = 0;
+ error:
+ if (ip != NULL) {
+ ASN1_OCTET_STRING_free(ip);
+ }
+ return retval;
+}
+
+static PySSLSocket *
+newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
+ enum py_ssl_server_or_client socket_type,
+ char *server_hostname,
+ PyObject *owner, PyObject *session,
+ PySSLMemoryBIO *inbio, PySSLMemoryBIO *outbio)
+{
+ PySSLSocket *self;
+ SSL_CTX *ctx = sslctx->ctx;
+ _PySSLError err = { 0 };
+
+ if ((socket_type == PY_SSL_SERVER) &&
+ (sslctx->protocol == PY_SSL_VERSION_TLS_CLIENT)) {
+ _setSSLError(get_state_ctx(sslctx),
+ "Cannot create a server socket with a "
+ "PROTOCOL_TLS_CLIENT context", 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ if ((socket_type == PY_SSL_CLIENT) &&
+ (sslctx->protocol == PY_SSL_VERSION_TLS_SERVER)) {
+ _setSSLError(get_state_ctx(sslctx),
+ "Cannot create a client socket with a "
+ "PROTOCOL_TLS_SERVER context", 0, __FILE__, __LINE__);
+ return NULL;
+ }
+
+ self = PyObject_GC_New(PySSLSocket,
+ get_state_ctx(sslctx)->PySSLSocket_Type);
+ if (self == NULL)
+ return NULL;
+
+ self->ssl = NULL;
+ self->Socket = NULL;
+ self->ctx = (PySSLContext*)Py_NewRef(sslctx);
+ self->shutdown_seen_zero = 0;
+ self->owner = NULL;
+ self->server_hostname = NULL;
+ self->err = err;
+ self->exc = NULL;
+
+ /* Make sure the SSL error state is initialized */
+ ERR_clear_error();
+
+ PySSL_BEGIN_ALLOW_THREADS
+ self->ssl = SSL_new(ctx);
+ PySSL_END_ALLOW_THREADS
+ if (self->ssl == NULL) {
+ Py_DECREF(self);
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ /* bpo43522 and OpenSSL < 1.1.1l: copy hostflags manually */
+#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION < 0x101010cf
+ X509_VERIFY_PARAM *ssl_params = SSL_get0_param(self->ssl);
+ X509_VERIFY_PARAM_set_hostflags(ssl_params, sslctx->hostflags);
+#endif
+ SSL_set_app_data(self->ssl, self);
+ if (sock) {
+ SSL_set_fd(self->ssl, Py_SAFE_DOWNCAST(sock->sock_fd, SOCKET_T, int));
+ } else {
+ /* BIOs are reference counted and SSL_set_bio borrows our reference.
+ * To prevent a double free in memory_bio_dealloc() we need to take an
+ * extra reference here. */
+ BIO_up_ref(inbio->bio);
+ BIO_up_ref(outbio->bio);
+ SSL_set_bio(self->ssl, inbio->bio, outbio->bio);
+ }
+ SSL_set_mode(self->ssl,
+ SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | SSL_MODE_AUTO_RETRY);
+
+#ifdef TLS1_3_VERSION
+ if (sslctx->post_handshake_auth == 1) {
+ if (socket_type == PY_SSL_SERVER) {
+ /* bpo-37428: OpenSSL does not ignore SSL_VERIFY_POST_HANDSHAKE.
+ * Set SSL_VERIFY_POST_HANDSHAKE flag only for server sockets and
+ * only in combination with SSL_VERIFY_PEER flag. */
+ int mode = SSL_get_verify_mode(self->ssl);
+ if (mode & SSL_VERIFY_PEER) {
+ int (*verify_cb)(int, X509_STORE_CTX *) = NULL;
+ verify_cb = SSL_get_verify_callback(self->ssl);
+ mode |= SSL_VERIFY_POST_HANDSHAKE;
+ SSL_set_verify(self->ssl, mode, verify_cb);
+ }
+ } else {
+ /* client socket */
+ SSL_set_post_handshake_auth(self->ssl, 1);
+ }
+ }
+#endif
+
+ if (server_hostname != NULL) {
+ if (_ssl_configure_hostname(self, server_hostname) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+ /* If the socket is in non-blocking mode or timeout mode, set the BIO
+ * to non-blocking mode (blocking is the default)
+ */
+ if (sock && sock->sock_timeout >= 0) {
+ BIO_set_nbio(SSL_get_rbio(self->ssl), 1);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), 1);
+ }
+
+ PySSL_BEGIN_ALLOW_THREADS
+ if (socket_type == PY_SSL_CLIENT)
+ SSL_set_connect_state(self->ssl);
+ else
+ SSL_set_accept_state(self->ssl);
+ PySSL_END_ALLOW_THREADS
+
+ self->socket_type = socket_type;
+ if (sock != NULL) {
+ self->Socket = PyWeakref_NewRef((PyObject *) sock, NULL);
+ if (self->Socket == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+ if (owner && owner != Py_None) {
+ if (PySSL_set_owner(self, owner, NULL) == -1) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+ if (session && session != Py_None) {
+ if (PySSL_set_session(self, session, NULL) == -1) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+
+ PyObject_GC_Track(self);
+ return self;
+}
+
+/* SSL object methods */
+
+/*[clinic input]
+_ssl._SSLSocket.do_handshake
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_do_handshake_impl(PySSLSocket *self)
+/*[clinic end generated code: output=6c0898a8936548f6 input=d2d737de3df018c8]*/
+{
+ int ret;
+ _PySSLError err;
+ int sockstate, nonblocking;
+ PySocketSockObject *sock = GET_SOCKET(self);
+ _PyTime_t timeout, deadline = 0;
+ int has_timeout;
+
+ if (sock) {
+ if (((PyObject*)sock) == Py_None) {
+ _setSSLError(get_state_sock(self),
+ "Underlying socket connection gone",
+ PY_SSL_ERROR_NO_SOCKET, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_INCREF(sock);
+
+ /* just in case the blocking state of the socket has been changed */
+ nonblocking = (sock->sock_timeout >= 0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+ }
+
+ timeout = GET_SOCKET_TIMEOUT(sock);
+ has_timeout = (timeout > 0);
+ if (has_timeout) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ /* Actually negotiate SSL connection */
+ /* XXX If SSL_do_handshake() returns 0, it's also a failure. */
+ do {
+ PySSL_BEGIN_ALLOW_THREADS
+ ret = SSL_do_handshake(self->ssl);
+ err = _PySSL_errno(ret < 1, self->ssl, ret);
+ PySSL_END_ALLOW_THREADS
+ self->err = err;
+
+ if (PyErr_CheckSignals())
+ goto error;
+
+ if (has_timeout)
+ timeout = _PyDeadline_Get(deadline);
+
+ if (err.ssl == SSL_ERROR_WANT_READ) {
+ sockstate = PySSL_select(sock, 0, timeout);
+ } else if (err.ssl == SSL_ERROR_WANT_WRITE) {
+ sockstate = PySSL_select(sock, 1, timeout);
+ } else {
+ sockstate = SOCKET_OPERATION_OK;
+ }
+
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PyExc_TimeoutError,
+ ERRSTR("The handshake operation timed out"));
+ goto error;
+ } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
+ PyErr_SetString(get_state_sock(self)->PySSLErrorObject,
+ ERRSTR("Underlying socket has been closed."));
+ goto error;
+ } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
+ PyErr_SetString(get_state_sock(self)->PySSLErrorObject,
+ ERRSTR("Underlying socket too large for select()."));
+ goto error;
+ } else if (sockstate == SOCKET_IS_NONBLOCKING) {
+ break;
+ }
+ } while (err.ssl == SSL_ERROR_WANT_READ ||
+ err.ssl == SSL_ERROR_WANT_WRITE);
+ Py_XDECREF(sock);
+ if (ret < 1)
+ return PySSL_SetError(self, ret, __FILE__, __LINE__);
+ if (PySSL_ChainExceptions(self) < 0)
+ return NULL;
+ Py_RETURN_NONE;
+error:
+ Py_XDECREF(sock);
+ PySSL_ChainExceptions(self);
+ return NULL;
+}
+
+static PyObject *
+_asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name)
+{
+ char buf[X509_NAME_MAXLEN];
+ char *namebuf = buf;
+ int buflen;
+ PyObject *name_obj = NULL;
+
+ buflen = OBJ_obj2txt(namebuf, X509_NAME_MAXLEN, name, no_name);
+ if (buflen < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ /* initial buffer is too small for oid + terminating null byte */
+ if (buflen > X509_NAME_MAXLEN - 1) {
+ /* make OBJ_obj2txt() calculate the required buflen */
+ buflen = OBJ_obj2txt(NULL, 0, name, no_name);
+ /* allocate len + 1 for terminating NULL byte */
+ namebuf = PyMem_Malloc(buflen + 1);
+ if (namebuf == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ buflen = OBJ_obj2txt(namebuf, buflen + 1, name, no_name);
+ if (buflen < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ goto done;
+ }
+ }
+ if (!buflen && no_name) {
+ name_obj = Py_NewRef(Py_None);
+ }
+ else {
+ name_obj = PyUnicode_FromStringAndSize(namebuf, buflen);
+ }
+
+ done:
+ if (buf != namebuf) {
+ PyMem_Free(namebuf);
+ }
+ return name_obj;
+}
+
+static PyObject *
+_create_tuple_for_attribute(_sslmodulestate *state,
+ ASN1_OBJECT *name, ASN1_STRING *value)
+{
+ Py_ssize_t buflen;
+ PyObject *pyattr;
+ PyObject *pyname = _asn1obj2py(state, name, 0);
+
+ if (pyname == NULL) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+
+ if (ASN1_STRING_type(value) == V_ASN1_BIT_STRING) {
+ buflen = ASN1_STRING_length(value);
+ pyattr = Py_BuildValue("Ny#", pyname, ASN1_STRING_get0_data(value), buflen);
+ } else {
+ unsigned char *valuebuf = NULL;
+ buflen = ASN1_STRING_to_UTF8(&valuebuf, value);
+ if (buflen < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ Py_DECREF(pyname);
+ return NULL;
+ }
+ pyattr = Py_BuildValue("Ns#", pyname, valuebuf, buflen);
+ OPENSSL_free(valuebuf);
+ }
+ return pyattr;
+}
+
+static PyObject *
+_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname)
+{
+ PyObject *dn = NULL; /* tuple which represents the "distinguished name" */
+ PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */
+ PyObject *rdnt;
+ PyObject *attr = NULL; /* tuple to hold an attribute */
+ int entry_count = X509_NAME_entry_count(xname);
+ X509_NAME_ENTRY *entry;
+ ASN1_OBJECT *name;
+ ASN1_STRING *value;
+ int index_counter;
+ int rdn_level = -1;
+ int retcode;
+
+ dn = PyList_New(0);
+ if (dn == NULL)
+ return NULL;
+ /* now create another tuple to hold the top-level RDN */
+ rdn = PyList_New(0);
+ if (rdn == NULL)
+ goto fail0;
+
+ for (index_counter = 0;
+ index_counter < entry_count;
+ index_counter++)
+ {
+ entry = X509_NAME_get_entry(xname, index_counter);
+
+ /* check to see if we've gotten to a new RDN */
+ if (rdn_level >= 0) {
+ if (rdn_level != X509_NAME_ENTRY_set(entry)) {
+ /* yes, new RDN */
+ /* add old RDN to DN */
+ rdnt = PyList_AsTuple(rdn);
+ Py_DECREF(rdn);
+ if (rdnt == NULL)
+ goto fail0;
+ retcode = PyList_Append(dn, rdnt);
+ Py_DECREF(rdnt);
+ if (retcode < 0)
+ goto fail0;
+ /* create new RDN */
+ rdn = PyList_New(0);
+ if (rdn == NULL)
+ goto fail0;
+ }
+ }
+ rdn_level = X509_NAME_ENTRY_set(entry);
+
+ /* now add this attribute to the current RDN */
+ name = X509_NAME_ENTRY_get_object(entry);
+ value = X509_NAME_ENTRY_get_data(entry);
+ attr = _create_tuple_for_attribute(state, name, value);
+ /*
+ fprintf(stderr, "RDN level %d, attribute %s: %s\n",
+ entry->set,
+ PyBytes_AS_STRING(PyTuple_GET_ITEM(attr, 0)),
+ PyBytes_AS_STRING(PyTuple_GET_ITEM(attr, 1)));
+ */
+ if (attr == NULL)
+ goto fail1;
+ retcode = PyList_Append(rdn, attr);
+ Py_DECREF(attr);
+ if (retcode < 0)
+ goto fail1;
+ }
+ /* now, there's typically a dangling RDN */
+ if (rdn != NULL) {
+ if (PyList_GET_SIZE(rdn) > 0) {
+ rdnt = PyList_AsTuple(rdn);
+ Py_DECREF(rdn);
+ if (rdnt == NULL)
+ goto fail0;
+ retcode = PyList_Append(dn, rdnt);
+ Py_DECREF(rdnt);
+ if (retcode < 0)
+ goto fail0;
+ }
+ else {
+ Py_DECREF(rdn);
+ }
+ }
+
+ /* convert list to tuple */
+ rdnt = PyList_AsTuple(dn);
+ Py_DECREF(dn);
+ if (rdnt == NULL)
+ return NULL;
+ return rdnt;
+
+ fail1:
+ Py_XDECREF(rdn);
+
+ fail0:
+ Py_XDECREF(dn);
+ return NULL;
+}
+
+static PyObject *
+_get_peer_alt_names (_sslmodulestate *state, X509 *certificate) {
+
+ /* this code follows the procedure outlined in
+ OpenSSL's crypto/x509v3/v3_prn.c:X509v3_EXT_print()
+ function to extract the STACK_OF(GENERAL_NAME),
+ then iterates through the stack to add the
+ names. */
+
+ int j;
+ PyObject *peer_alt_names = Py_None;
+ PyObject *v = NULL, *t;
+ GENERAL_NAMES *names = NULL;
+ GENERAL_NAME *name;
+ BIO *biobuf = NULL;
+ char buf[2048];
+ char *vptr;
+ int len;
+
+ if (certificate == NULL)
+ return peer_alt_names;
+
+ /* get a memory buffer */
+ biobuf = BIO_new(BIO_s_mem());
+ if (biobuf == NULL) {
+ PyErr_SetString(state->PySSLErrorObject, "failed to allocate BIO");
+ return NULL;
+ }
+
+ names = (GENERAL_NAMES *)X509_get_ext_d2i(
+ certificate, NID_subject_alt_name, NULL, NULL);
+ if (names != NULL) {
+ if (peer_alt_names == Py_None) {
+ peer_alt_names = PyList_New(0);
+ if (peer_alt_names == NULL)
+ goto fail;
+ }
+
+ for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
+ /* get a rendering of each name in the set of names */
+ int gntype;
+ ASN1_STRING *as = NULL;
+
+ name = sk_GENERAL_NAME_value(names, j);
+ gntype = name->type;
+ switch (gntype) {
+ case GEN_DIRNAME:
+ /* we special-case DirName as a tuple of
+ tuples of attributes */
+
+ t = PyTuple_New(2);
+ if (t == NULL) {
+ goto fail;
+ }
+
+ v = PyUnicode_FromString("DirName");
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+
+ v = _create_tuple_for_X509_NAME(state, name->d.dirn);
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
+ break;
+
+ case GEN_EMAIL:
+ case GEN_DNS:
+ case GEN_URI:
+ /* GENERAL_NAME_print() doesn't handle NULL bytes in ASN1_string
+ correctly, CVE-2013-4238 */
+ t = PyTuple_New(2);
+ if (t == NULL)
+ goto fail;
+ switch (gntype) {
+ case GEN_EMAIL:
+ v = PyUnicode_FromString("email");
+ as = name->d.rfc822Name;
+ break;
+ case GEN_DNS:
+ v = PyUnicode_FromString("DNS");
+ as = name->d.dNSName;
+ break;
+ case GEN_URI:
+ v = PyUnicode_FromString("URI");
+ as = name->d.uniformResourceIdentifier;
+ break;
+ }
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+ v = PyUnicode_FromStringAndSize((char *)ASN1_STRING_get0_data(as),
+ ASN1_STRING_length(as));
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
+ break;
+
+ case GEN_RID:
+ t = PyTuple_New(2);
+ if (t == NULL)
+ goto fail;
+
+ v = PyUnicode_FromString("Registered ID");
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+
+ len = i2t_ASN1_OBJECT(buf, sizeof(buf)-1, name->d.rid);
+ if (len < 0) {
+ Py_DECREF(t);
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ goto fail;
+ } else if (len >= (int)sizeof(buf)) {
+ v = PyUnicode_FromString("<INVALID>");
+ } else {
+ v = PyUnicode_FromStringAndSize(buf, len);
+ }
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
+ break;
+
+ case GEN_IPADD:
+ /* OpenSSL < 3.0.0 adds a trailing \n to IPv6. 3.0.0 removed
+ * the trailing newline. Remove it in all versions
+ */
+ t = PyTuple_New(2);
+ if (t == NULL)
+ goto fail;
+
+ v = PyUnicode_FromString("IP Address");
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+
+ if (name->d.ip->length == 4) {
+ unsigned char *p = name->d.ip->data;
+ v = PyUnicode_FromFormat(
+ "%d.%d.%d.%d",
+ p[0], p[1], p[2], p[3]
+ );
+ } else if (name->d.ip->length == 16) {
+ unsigned char *p = name->d.ip->data;
+ v = PyUnicode_FromFormat(
+ "%X:%X:%X:%X:%X:%X:%X:%X",
+ p[0] << 8 | p[1],
+ p[2] << 8 | p[3],
+ p[4] << 8 | p[5],
+ p[6] << 8 | p[7],
+ p[8] << 8 | p[9],
+ p[10] << 8 | p[11],
+ p[12] << 8 | p[13],
+ p[14] << 8 | p[15]
+ );
+ } else {
+ v = PyUnicode_FromString("<invalid>");
+ }
+
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
+ break;
+
+ default:
+ /* for everything else, we use the OpenSSL print form */
+ switch (gntype) {
+ /* check for new general name type */
+ case GEN_OTHERNAME:
+ case GEN_X400:
+ case GEN_EDIPARTY:
+ case GEN_RID:
+ break;
+ default:
+ if (PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
+ "Unknown general name type %d",
+ gntype) == -1) {
+ goto fail;
+ }
+ break;
+ }
+ (void) BIO_reset(biobuf);
+ GENERAL_NAME_print(biobuf, name);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ goto fail;
+ }
+ vptr = strchr(buf, ':');
+ if (vptr == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "Invalid value %.200s",
+ buf);
+ goto fail;
+ }
+ t = PyTuple_New(2);
+ if (t == NULL)
+ goto fail;
+ v = PyUnicode_FromStringAndSize(buf, (vptr - buf));
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 0, v);
+ v = PyUnicode_FromStringAndSize((vptr + 1),
+ (len - (vptr - buf + 1)));
+ if (v == NULL) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
+ break;
+ }
+
+ /* and add that rendering to the list */
+
+ if (PyList_Append(peer_alt_names, t) < 0) {
+ Py_DECREF(t);
+ goto fail;
+ }
+ Py_DECREF(t);
+ }
+ sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
+ }
+ BIO_free(biobuf);
+ if (peer_alt_names != Py_None) {
+ v = PyList_AsTuple(peer_alt_names);
+ Py_DECREF(peer_alt_names);
+ return v;
+ } else {
+ return peer_alt_names;
+ }
+
+
+ fail:
+ if (biobuf != NULL)
+ BIO_free(biobuf);
+
+ if (peer_alt_names != Py_None) {
+ Py_XDECREF(peer_alt_names);
+ }
+
+ return NULL;
+}
+
+static PyObject *
+_get_aia_uri(X509 *certificate, int nid) {
+ PyObject *lst = NULL, *ostr = NULL;
+ int i, result;
+ AUTHORITY_INFO_ACCESS *info;
+
+ info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL);
+ if (info == NULL)
+ return Py_None;
+ if (sk_ACCESS_DESCRIPTION_num(info) == 0) {
+ AUTHORITY_INFO_ACCESS_free(info);
+ return Py_None;
+ }
+
+ if ((lst = PyList_New(0)) == NULL) {
+ goto fail;
+ }
+
+ for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
+ ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i);
+ ASN1_IA5STRING *uri;
+
+ if ((OBJ_obj2nid(ad->method) != nid) ||
+ (ad->location->type != GEN_URI)) {
+ continue;
+ }
+ uri = ad->location->d.uniformResourceIdentifier;
+ ostr = PyUnicode_FromStringAndSize((char *)uri->data,
+ uri->length);
+ if (ostr == NULL) {
+ goto fail;
+ }
+ result = PyList_Append(lst, ostr);
+ Py_DECREF(ostr);
+ if (result < 0) {
+ goto fail;
+ }
+ }
+ AUTHORITY_INFO_ACCESS_free(info);
+
+ /* convert to tuple or None */
+ if (PyList_Size(lst) == 0) {
+ Py_DECREF(lst);
+ return Py_None;
+ } else {
+ PyObject *tup;
+ tup = PyList_AsTuple(lst);
+ Py_DECREF(lst);
+ return tup;
+ }
+
+ fail:
+ AUTHORITY_INFO_ACCESS_free(info);
+ Py_XDECREF(lst);
+ return NULL;
+}
+
+static PyObject *
+_get_crl_dp(X509 *certificate) {
+ STACK_OF(DIST_POINT) *dps;
+ int i, j;
+ PyObject *lst, *res = NULL;
+
+ dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points, NULL, NULL);
+
+ if (dps == NULL)
+ return Py_None;
+
+ lst = PyList_New(0);
+ if (lst == NULL)
+ goto done;
+
+ for (i=0; i < sk_DIST_POINT_num(dps); i++) {
+ DIST_POINT *dp;
+ STACK_OF(GENERAL_NAME) *gns;
+
+ dp = sk_DIST_POINT_value(dps, i);
+ if (dp->distpoint == NULL) {
+ /* Ignore empty DP value, CVE-2019-5010 */
+ continue;
+ }
+ gns = dp->distpoint->name.fullname;
+
+ for (j=0; j < sk_GENERAL_NAME_num(gns); j++) {
+ GENERAL_NAME *gn;
+ ASN1_IA5STRING *uri;
+ PyObject *ouri;
+ int err;
+
+ gn = sk_GENERAL_NAME_value(gns, j);
+ if (gn->type != GEN_URI) {
+ continue;
+ }
+ uri = gn->d.uniformResourceIdentifier;
+ ouri = PyUnicode_FromStringAndSize((char *)uri->data,
+ uri->length);
+ if (ouri == NULL)
+ goto done;
+
+ err = PyList_Append(lst, ouri);
+ Py_DECREF(ouri);
+ if (err < 0)
+ goto done;
+ }
+ }
+
+ /* Convert to tuple. */
+ res = (PyList_GET_SIZE(lst) > 0) ? PyList_AsTuple(lst) : Py_None;
+
+ done:
+ Py_XDECREF(lst);
+ CRL_DIST_POINTS_free(dps);
+ return res;
+}
+
+static PyObject *
+_decode_certificate(_sslmodulestate *state, X509 *certificate) {
+
+ PyObject *retval = NULL;
+ BIO *biobuf = NULL;
+ PyObject *peer;
+ PyObject *peer_alt_names = NULL;
+ PyObject *issuer;
+ PyObject *version;
+ PyObject *sn_obj;
+ PyObject *obj;
+ ASN1_INTEGER *serialNumber;
+ char buf[2048];
+ int len, result;
+ const ASN1_TIME *notBefore, *notAfter;
+ PyObject *pnotBefore, *pnotAfter;
+
+ retval = PyDict_New();
+ if (retval == NULL)
+ return NULL;
+
+ peer = _create_tuple_for_X509_NAME(
+ state,
+ X509_get_subject_name(certificate));
+ if (peer == NULL)
+ goto fail0;
+ if (PyDict_SetItemString(retval, (const char *) "subject", peer) < 0) {
+ Py_DECREF(peer);
+ goto fail0;
+ }
+ Py_DECREF(peer);
+
+ issuer = _create_tuple_for_X509_NAME(
+ state,
+ X509_get_issuer_name(certificate));
+ if (issuer == NULL)
+ goto fail0;
+ if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) < 0) {
+ Py_DECREF(issuer);
+ goto fail0;
+ }
+ Py_DECREF(issuer);
+
+ version = PyLong_FromLong(X509_get_version(certificate) + 1);
+ if (version == NULL)
+ goto fail0;
+ if (PyDict_SetItemString(retval, "version", version) < 0) {
+ Py_DECREF(version);
+ goto fail0;
+ }
+ Py_DECREF(version);
+
+ /* get a memory buffer */
+ biobuf = BIO_new(BIO_s_mem());
+ if (biobuf == NULL) {
+ PyErr_SetString(state->PySSLErrorObject, "failed to allocate BIO");
+ goto fail0;
+ }
+
+ (void) BIO_reset(biobuf);
+ serialNumber = X509_get_serialNumber(certificate);
+ /* should not exceed 20 octets, 160 bits, so buf is big enough */
+ i2a_ASN1_INTEGER(biobuf, serialNumber);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ goto fail1;
+ }
+ sn_obj = PyUnicode_FromStringAndSize(buf, len);
+ if (sn_obj == NULL)
+ goto fail1;
+ if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
+ Py_DECREF(sn_obj);
+ goto fail1;
+ }
+ Py_DECREF(sn_obj);
+
+ (void) BIO_reset(biobuf);
+ notBefore = X509_get0_notBefore(certificate);
+ ASN1_TIME_print(biobuf, notBefore);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ goto fail1;
+ }
+ pnotBefore = PyUnicode_FromStringAndSize(buf, len);
+ if (pnotBefore == NULL)
+ goto fail1;
+ if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
+ Py_DECREF(pnotBefore);
+ goto fail1;
+ }
+ Py_DECREF(pnotBefore);
+
+ (void) BIO_reset(biobuf);
+ notAfter = X509_get0_notAfter(certificate);
+ ASN1_TIME_print(biobuf, notAfter);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+ if (len < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ goto fail1;
+ }
+ pnotAfter = PyUnicode_FromStringAndSize(buf, len);
+ if (pnotAfter == NULL)
+ goto fail1;
+ if (PyDict_SetItemString(retval, "notAfter", pnotAfter) < 0) {
+ Py_DECREF(pnotAfter);
+ goto fail1;
+ }
+ Py_DECREF(pnotAfter);
+
+ /* Now look for subjectAltName */
+
+ peer_alt_names = _get_peer_alt_names(state, certificate);
+ if (peer_alt_names == NULL)
+ goto fail1;
+ else if (peer_alt_names != Py_None) {
+ if (PyDict_SetItemString(retval, "subjectAltName",
+ peer_alt_names) < 0) {
+ Py_DECREF(peer_alt_names);
+ goto fail1;
+ }
+ Py_DECREF(peer_alt_names);
+ }
+
+ /* Authority Information Access: OCSP URIs */
+ obj = _get_aia_uri(certificate, NID_ad_OCSP);
+ if (obj == NULL) {
+ goto fail1;
+ } else if (obj != Py_None) {
+ result = PyDict_SetItemString(retval, "OCSP", obj);
+ Py_DECREF(obj);
+ if (result < 0) {
+ goto fail1;
+ }
+ }
+
+ obj = _get_aia_uri(certificate, NID_ad_ca_issuers);
+ if (obj == NULL) {
+ goto fail1;
+ } else if (obj != Py_None) {
+ result = PyDict_SetItemString(retval, "caIssuers", obj);
+ Py_DECREF(obj);
+ if (result < 0) {
+ goto fail1;
+ }
+ }
+
+ /* CDP (CRL distribution points) */
+ obj = _get_crl_dp(certificate);
+ if (obj == NULL) {
+ goto fail1;
+ } else if (obj != Py_None) {
+ result = PyDict_SetItemString(retval, "crlDistributionPoints", obj);
+ Py_DECREF(obj);
+ if (result < 0) {
+ goto fail1;
+ }
+ }
+
+ BIO_free(biobuf);
+ return retval;
+
+ fail1:
+ if (biobuf != NULL)
+ BIO_free(biobuf);
+ fail0:
+ Py_XDECREF(retval);
+ return NULL;
+}
+
+static PyObject *
+_certificate_to_der(_sslmodulestate *state, X509 *certificate)
+{
+ unsigned char *bytes_buf = NULL;
+ int len;
+ PyObject *retval;
+
+ bytes_buf = NULL;
+ len = i2d_X509(certificate, &bytes_buf);
+ if (len < 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ /* this is actually an immutable bytes sequence */
+ retval = PyBytes_FromStringAndSize((const char *) bytes_buf, len);
+ OPENSSL_free(bytes_buf);
+ return retval;
+}
+
+#include "_ssl/misc.c"
+#include "_ssl/cert.c"
+
+/*[clinic input]
+_ssl._test_decode_cert
+ path: object(converter="PyUnicode_FSConverter")
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__test_decode_cert_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=96becb9abb23c091 input=cdeaaf02d4346628]*/
+{
+ PyObject *retval = NULL;
+ X509 *x=NULL;
+ BIO *cert;
+ _sslmodulestate *state = get_ssl_state(module);
+
+ if ((cert=BIO_new(BIO_s_file())) == NULL) {
+ PyErr_SetString(state->PySSLErrorObject,
+ "Can't malloc memory to read file");
+ goto fail0;
+ }
+
+ if (BIO_read_filename(cert, PyBytes_AsString(path)) <= 0) {
+ PyErr_SetString(state->PySSLErrorObject,
+ "Can't open file");
+ goto fail0;
+ }
+
+ x = PEM_read_bio_X509(cert, NULL, NULL, NULL);
+ if (x == NULL) {
+ PyErr_SetString(state->PySSLErrorObject,
+ "Error decoding PEM-encoded file");
+ goto fail0;
+ }
+
+ retval = _decode_certificate(state, x);
+ X509_free(x);
+
+ fail0:
+ Py_DECREF(path);
+ if (cert != NULL) BIO_free(cert);
+ return retval;
+}
+
+
+/*[clinic input]
+_ssl._SSLSocket.getpeercert
+ der as binary_mode: bool = False
+ /
+
+Returns the certificate for the peer.
+
+If no certificate was provided, returns None. If a certificate was
+provided, but not validated, returns an empty dictionary. Otherwise
+returns a dict containing information about the peer certificate.
+
+If the optional argument is True, returns a DER-encoded copy of the
+peer certificate, or None if no certificate was provided. This will
+return the certificate even if it wasn't validated.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_getpeercert_impl(PySSLSocket *self, int binary_mode)
+/*[clinic end generated code: output=1f0ab66dfb693c88 input=c0fbe802e57629b7]*/
+{
+ int verification;
+ X509 *peer_cert;
+ PyObject *result;
+
+ if (!SSL_is_init_finished(self->ssl)) {
+ PyErr_SetString(PyExc_ValueError,
+ "handshake not done yet");
+ return NULL;
+ }
+ peer_cert = SSL_get_peer_certificate(self->ssl);
+ if (peer_cert == NULL)
+ Py_RETURN_NONE;
+
+ if (binary_mode) {
+ /* return cert in DER-encoded format */
+ result = _certificate_to_der(get_state_sock(self), peer_cert);
+ } else {
+ verification = SSL_CTX_get_verify_mode(SSL_get_SSL_CTX(self->ssl));
+ if ((verification & SSL_VERIFY_PEER) == 0)
+ result = PyDict_New();
+ else
+ result = _decode_certificate(get_state_sock(self), peer_cert);
+ }
+ X509_free(peer_cert);
+ return result;
+}
+
+/*[clinic input]
+_ssl._SSLSocket.get_verified_chain
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_get_verified_chain_impl(PySSLSocket *self)
+/*[clinic end generated code: output=802421163cdc3110 input=5fb0714f77e2bd51]*/
+{
+ /* borrowed reference */
+ STACK_OF(X509) *chain = SSL_get0_verified_chain(self->ssl);
+ if (chain == NULL) {
+ Py_RETURN_NONE;
+ }
+ return _PySSL_CertificateFromX509Stack(self->ctx->state, chain, 1);
+}
+
+/*[clinic input]
+_ssl._SSLSocket.get_unverified_chain
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_get_unverified_chain_impl(PySSLSocket *self)
+/*[clinic end generated code: output=5acdae414e13f913 input=78c33c360c635cb5]*/
+{
+ PyObject *retval;
+ /* borrowed reference */
+ /* TODO: include SSL_get_peer_certificate() for server-side sockets */
+ STACK_OF(X509) *chain = SSL_get_peer_cert_chain(self->ssl);
+ if (chain == NULL) {
+ Py_RETURN_NONE;
+ }
+ retval = _PySSL_CertificateFromX509Stack(self->ctx->state, chain, 1);
+ if (retval == NULL) {
+ return NULL;
+ }
+ /* OpenSSL does not include peer cert for server side connections */
+ if (self->socket_type == PY_SSL_SERVER) {
+ PyObject *peerobj = NULL;
+ X509 *peer = SSL_get_peer_certificate(self->ssl);
+
+ if (peer == NULL) {
+ peerobj = Py_NewRef(Py_None);
+ } else {
+ /* consume X509 reference on success */
+ peerobj = _PySSL_CertificateFromX509(self->ctx->state, peer, 0);
+ if (peerobj == NULL) {
+ X509_free(peer);
+ Py_DECREF(retval);
+ return NULL;
+ }
+ }
+ int res = PyList_Insert(retval, 0, peerobj);
+ Py_DECREF(peerobj);
+ if (res < 0) {
+ Py_DECREF(retval);
+ return NULL;
+ }
+ }
+ return retval;
+}
+
+static PyObject *
+cipher_to_tuple(const SSL_CIPHER *cipher)
+{
+ const char *cipher_name, *cipher_protocol;
+ PyObject *v, *retval = PyTuple_New(3);
+ if (retval == NULL)
+ return NULL;
+
+ cipher_name = SSL_CIPHER_get_name(cipher);
+ if (cipher_name == NULL) {
+ PyTuple_SET_ITEM(retval, 0, Py_NewRef(Py_None));
+ } else {
+ v = PyUnicode_FromString(cipher_name);
+ if (v == NULL)
+ goto fail;
+ PyTuple_SET_ITEM(retval, 0, v);
+ }
+
+ cipher_protocol = SSL_CIPHER_get_version(cipher);
+ if (cipher_protocol == NULL) {
+ PyTuple_SET_ITEM(retval, 1, Py_NewRef(Py_None));
+ } else {
+ v = PyUnicode_FromString(cipher_protocol);
+ if (v == NULL)
+ goto fail;
+ PyTuple_SET_ITEM(retval, 1, v);
+ }
+
+ v = PyLong_FromLong(SSL_CIPHER_get_bits(cipher, NULL));
+ if (v == NULL)
+ goto fail;
+ PyTuple_SET_ITEM(retval, 2, v);
+
+ return retval;
+
+ fail:
+ Py_DECREF(retval);
+ return NULL;
+}
+
+static PyObject *
+cipher_to_dict(const SSL_CIPHER *cipher)
+{
+ const char *cipher_name, *cipher_protocol;
+
+ unsigned long cipher_id;
+ int alg_bits, strength_bits, len;
+ char buf[512] = {0};
+ int aead, nid;
+ const char *skcipher = NULL, *digest = NULL, *kx = NULL, *auth = NULL;
+
+ /* can be NULL */
+ cipher_name = SSL_CIPHER_get_name(cipher);
+ cipher_protocol = SSL_CIPHER_get_version(cipher);
+ cipher_id = SSL_CIPHER_get_id(cipher);
+ SSL_CIPHER_description(cipher, buf, sizeof(buf) - 1);
+ /* Downcast to avoid a warning. Safe since buf is always 512 bytes */
+ len = (int)strlen(buf);
+ if (len > 1 && buf[len-1] == '\n')
+ buf[len-1] = '\0';
+ strength_bits = SSL_CIPHER_get_bits(cipher, &alg_bits);
+
+ aead = SSL_CIPHER_is_aead(cipher);
+ nid = SSL_CIPHER_get_cipher_nid(cipher);
+ skcipher = nid != NID_undef ? OBJ_nid2ln(nid) : NULL;
+ nid = SSL_CIPHER_get_digest_nid(cipher);
+ digest = nid != NID_undef ? OBJ_nid2ln(nid) : NULL;
+ nid = SSL_CIPHER_get_kx_nid(cipher);
+ kx = nid != NID_undef ? OBJ_nid2ln(nid) : NULL;
+ nid = SSL_CIPHER_get_auth_nid(cipher);
+ auth = nid != NID_undef ? OBJ_nid2ln(nid) : NULL;
+
+ return Py_BuildValue(
+ "{sksssssssisi"
+ "sOssssssss"
+ "}",
+ "id", cipher_id,
+ "name", cipher_name,
+ "protocol", cipher_protocol,
+ "description", buf,
+ "strength_bits", strength_bits,
+ "alg_bits", alg_bits
+ ,"aead", aead ? Py_True : Py_False,
+ "symmetric", skcipher,
+ "digest", digest,
+ "kea", kx,
+ "auth", auth
+ );
+}
+
+/*[clinic input]
+_ssl._SSLSocket.shared_ciphers
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self)
+/*[clinic end generated code: output=3d174ead2e42c4fd input=0bfe149da8fe6306]*/
+{
+ STACK_OF(SSL_CIPHER) *server_ciphers;
+ STACK_OF(SSL_CIPHER) *client_ciphers;
+ int i, len;
+ PyObject *res;
+ const SSL_CIPHER* cipher;
+
+ /* Rather than use SSL_get_shared_ciphers, we use an equivalent algorithm because:
+
+ 1) It returns a colon separated list of strings, in an undefined
+ order, that we would have to post process back into tuples.
+ 2) It will return a truncated string with no indication that it has
+ done so, if the buffer is too small.
+ */
+
+ server_ciphers = SSL_get_ciphers(self->ssl);
+ if (!server_ciphers)
+ Py_RETURN_NONE;
+ client_ciphers = SSL_get_client_ciphers(self->ssl);
+ if (!client_ciphers)
+ Py_RETURN_NONE;
+
+ res = PyList_New(sk_SSL_CIPHER_num(server_ciphers));
+ if (!res)
+ return NULL;
+ len = 0;
+ for (i = 0; i < sk_SSL_CIPHER_num(server_ciphers); i++) {
+ cipher = sk_SSL_CIPHER_value(server_ciphers, i);
+ if (sk_SSL_CIPHER_find(client_ciphers, cipher) < 0)
+ continue;
+
+ PyObject *tup = cipher_to_tuple(cipher);
+ if (!tup) {
+ Py_DECREF(res);
+ return NULL;
+ }
+ PyList_SET_ITEM(res, len++, tup);
+ }
+ Py_SET_SIZE(res, len);
+ return res;
+}
+
+/*[clinic input]
+_ssl._SSLSocket.cipher
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_cipher_impl(PySSLSocket *self)
+/*[clinic end generated code: output=376417c16d0e5815 input=548fb0e27243796d]*/
+{
+ const SSL_CIPHER *current;
+
+ if (self->ssl == NULL)
+ Py_RETURN_NONE;
+ current = SSL_get_current_cipher(self->ssl);
+ if (current == NULL)
+ Py_RETURN_NONE;
+ return cipher_to_tuple(current);
+}
+
+/*[clinic input]
+_ssl._SSLSocket.version
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_version_impl(PySSLSocket *self)
+/*[clinic end generated code: output=178aed33193b2cdb input=900186a503436fd6]*/
+{
+ const char *version;
+
+ if (self->ssl == NULL)
+ Py_RETURN_NONE;
+ if (!SSL_is_init_finished(self->ssl)) {
+ /* handshake not finished */
+ Py_RETURN_NONE;
+ }
+ version = SSL_get_version(self->ssl);
+ if (!strcmp(version, "unknown"))
+ Py_RETURN_NONE;
+ return PyUnicode_FromString(version);
+}
+
+/*[clinic input]
+_ssl._SSLSocket.selected_alpn_protocol
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_selected_alpn_protocol_impl(PySSLSocket *self)
+/*[clinic end generated code: output=ec33688b303d250f input=442de30e35bc2913]*/
+{
+ const unsigned char *out;
+ unsigned int outlen;
+
+ SSL_get0_alpn_selected(self->ssl, &out, &outlen);
+
+ if (out == NULL)
+ Py_RETURN_NONE;
+ return PyUnicode_FromStringAndSize((char *)out, outlen);
+}
+
+/*[clinic input]
+_ssl._SSLSocket.compression
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_compression_impl(PySSLSocket *self)
+/*[clinic end generated code: output=bd16cb1bb4646ae7 input=5d059d0a2bbc32c8]*/
+{
+#ifdef OPENSSL_NO_COMP
+ Py_RETURN_NONE;
+#else
+ const COMP_METHOD *comp_method;
+ const char *short_name;
+
+ if (self->ssl == NULL)
+ Py_RETURN_NONE;
+ comp_method = SSL_get_current_compression(self->ssl);
+ if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
+ Py_RETURN_NONE;
+ short_name = OBJ_nid2sn(COMP_get_type(comp_method));
+ if (short_name == NULL)
+ Py_RETURN_NONE;
+ return PyUnicode_DecodeFSDefault(short_name);
+#endif
+}
+
+static PySSLContext *PySSL_get_context(PySSLSocket *self, void *closure) {
+ return (PySSLContext*)Py_NewRef(self->ctx);
+}
+
+static int PySSL_set_context(PySSLSocket *self, PyObject *value,
+ void *closure) {
+
+ if (PyObject_TypeCheck(value, self->ctx->state->PySSLContext_Type)) {
+ Py_SETREF(self->ctx, (PySSLContext *)Py_NewRef(value));
+ SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
+ /* Set SSL* internal msg_callback to state of new context's state */
+ SSL_set_msg_callback(
+ self->ssl,
+ self->ctx->msg_cb ? _PySSL_msg_callback : NULL
+ );
+ } else {
+ PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext");
+ return -1;
+ }
+
+ return 0;
+}
+
+PyDoc_STRVAR(PySSL_set_context_doc,
+"_setter_context(ctx)\n\
+\
+This changes the context associated with the SSLSocket. This is typically\n\
+used from within a callback function set by the sni_callback\n\
+on the SSLContext to change the certificate information associated with the\n\
+SSLSocket before the cryptographic exchange handshake messages\n");
+
+
+static PyObject *
+PySSL_get_server_side(PySSLSocket *self, void *c)
+{
+ return PyBool_FromLong(self->socket_type == PY_SSL_SERVER);
+}
+
+PyDoc_STRVAR(PySSL_get_server_side_doc,
+"Whether this is a server-side socket.");
+
+static PyObject *
+PySSL_get_server_hostname(PySSLSocket *self, void *c)
+{
+ if (self->server_hostname == NULL)
+ Py_RETURN_NONE;
+ return Py_NewRef(self->server_hostname);
+}
+
+PyDoc_STRVAR(PySSL_get_server_hostname_doc,
+"The currently set server hostname (for SNI).");
+
+static PyObject *
+PySSL_get_owner(PySSLSocket *self, void *c)
+{
+ PyObject *owner;
+
+ if (self->owner == NULL)
+ Py_RETURN_NONE;
+
+ owner = PyWeakref_GetObject(self->owner);
+ return Py_NewRef(owner);
+}
+
+static int
+PySSL_set_owner(PySSLSocket *self, PyObject *value, void *c)
+{
+ Py_XSETREF(self->owner, PyWeakref_NewRef(value, NULL));
+ if (self->owner == NULL)
+ return -1;
+ return 0;
+}
+
+PyDoc_STRVAR(PySSL_get_owner_doc,
+"The Python-level owner of this object.\
+Passed as \"self\" in servername callback.");
+
+static int
+PySSL_traverse(PySSLSocket *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->exc);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+PySSL_clear(PySSLSocket *self)
+{
+ Py_CLEAR(self->exc);
+ return 0;
+}
+
+static void
+PySSL_dealloc(PySSLSocket *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ if (self->ssl) {
+ SSL_free(self->ssl);
+ }
+ Py_XDECREF(self->Socket);
+ Py_XDECREF(self->ctx);
+ Py_XDECREF(self->server_hostname);
+ Py_XDECREF(self->owner);
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+/* If the socket has a timeout, do a select()/poll() on the socket.
+ The argument writing indicates the direction.
+ Returns one of the possibilities in the timeout_state enum (above).
+ */
+
+static int
+PySSL_select(PySocketSockObject *s, int writing, _PyTime_t timeout)
+{
+ int rc;
+#ifdef HAVE_POLL
+ struct pollfd pollfd;
+ _PyTime_t ms;
+#else
+ int nfds;
+ fd_set fds;
+ struct timeval tv;
+#endif
+
+ /* Nothing to do unless we're in timeout mode (not non-blocking) */
+ if ((s == NULL) || (timeout == 0))
+ return SOCKET_IS_NONBLOCKING;
+ else if (timeout < 0) {
+ if (s->sock_timeout > 0)
+ return SOCKET_HAS_TIMED_OUT;
+ else
+ return SOCKET_IS_BLOCKING;
+ }
+
+ /* Guard against closed socket */
+ if (s->sock_fd == INVALID_SOCKET)
+ return SOCKET_HAS_BEEN_CLOSED;
+
+ /* Prefer poll, if available, since you can poll() any fd
+ * which can't be done with select(). */
+#ifdef HAVE_POLL
+ pollfd.fd = s->sock_fd;
+ pollfd.events = writing ? POLLOUT : POLLIN;
+
+ /* timeout is in seconds, poll() uses milliseconds */
+ ms = (int)_PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
+ assert(ms <= INT_MAX);
+
+ PySSL_BEGIN_ALLOW_THREADS
+ rc = poll(&pollfd, 1, (int)ms);
+ PySSL_END_ALLOW_THREADS
+#else
+ /* Guard against socket too large for select*/
+ if (!_PyIsSelectable_fd(s->sock_fd))
+ return SOCKET_TOO_LARGE_FOR_SELECT;
+
+ _PyTime_AsTimeval_clamp(timeout, &tv, _PyTime_ROUND_CEILING);
+
+ FD_ZERO(&fds);
+ FD_SET(s->sock_fd, &fds);
+
+ /* Wait until the socket becomes ready */
+ PySSL_BEGIN_ALLOW_THREADS
+ nfds = Py_SAFE_DOWNCAST(s->sock_fd+1, SOCKET_T, int);
+ if (writing)
+ rc = select(nfds, NULL, &fds, NULL, &tv);
+ else
+ rc = select(nfds, &fds, NULL, NULL, &tv);
+ PySSL_END_ALLOW_THREADS
+#endif
+
+ /* Return SOCKET_TIMED_OUT on timeout, SOCKET_OPERATION_OK otherwise
+ (when we are able to write or when there's something to read) */
+ return rc == 0 ? SOCKET_HAS_TIMED_OUT : SOCKET_OPERATION_OK;
+}
+
+/*[clinic input]
+_ssl._SSLSocket.write
+ b: Py_buffer
+ /
+
+Writes the bytes-like object b into the SSL object.
+
+Returns the number of bytes written.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)
+/*[clinic end generated code: output=aa7a6be5527358d8 input=77262d994fe5100a]*/
+{
+ size_t count = 0;
+ int retval;
+ int sockstate;
+ _PySSLError err;
+ int nonblocking;
+ PySocketSockObject *sock = GET_SOCKET(self);
+ _PyTime_t timeout, deadline = 0;
+ int has_timeout;
+
+ if (sock != NULL) {
+ if (((PyObject*)sock) == Py_None) {
+ _setSSLError(get_state_sock(self),
+ "Underlying socket connection gone",
+ PY_SSL_ERROR_NO_SOCKET, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_INCREF(sock);
+ }
+
+ if (sock != NULL) {
+ /* just in case the blocking state of the socket has been changed */
+ nonblocking = (sock->sock_timeout >= 0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+ }
+
+ timeout = GET_SOCKET_TIMEOUT(sock);
+ has_timeout = (timeout > 0);
+ if (has_timeout) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ sockstate = PySSL_select(sock, 1, timeout);
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PyExc_TimeoutError,
+ "The write operation timed out");
+ goto error;
+ } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
+ PyErr_SetString(get_state_sock(self)->PySSLErrorObject,
+ "Underlying socket has been closed.");
+ goto error;
+ } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
+ PyErr_SetString(get_state_sock(self)->PySSLErrorObject,
+ "Underlying socket too large for select().");
+ goto error;
+ }
+
+ do {
+ PySSL_BEGIN_ALLOW_THREADS
+ retval = SSL_write_ex(self->ssl, b->buf, (size_t)b->len, &count);
+ err = _PySSL_errno(retval == 0, self->ssl, retval);
+ PySSL_END_ALLOW_THREADS
+ self->err = err;
+
+ if (PyErr_CheckSignals())
+ goto error;
+
+ if (has_timeout) {
+ timeout = _PyDeadline_Get(deadline);
+ }
+
+ if (err.ssl == SSL_ERROR_WANT_READ) {
+ sockstate = PySSL_select(sock, 0, timeout);
+ } else if (err.ssl == SSL_ERROR_WANT_WRITE) {
+ sockstate = PySSL_select(sock, 1, timeout);
+ } else {
+ sockstate = SOCKET_OPERATION_OK;
+ }
+
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PyExc_TimeoutError,
+ "The write operation timed out");
+ goto error;
+ } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
+ PyErr_SetString(get_state_sock(self)->PySSLErrorObject,
+ "Underlying socket has been closed.");
+ goto error;
+ } else if (sockstate == SOCKET_IS_NONBLOCKING) {
+ break;
+ }
+ } while (err.ssl == SSL_ERROR_WANT_READ ||
+ err.ssl == SSL_ERROR_WANT_WRITE);
+
+ Py_XDECREF(sock);
+ if (retval == 0)
+ return PySSL_SetError(self, retval, __FILE__, __LINE__);
+ if (PySSL_ChainExceptions(self) < 0)
+ return NULL;
+ return PyLong_FromSize_t(count);
+error:
+ Py_XDECREF(sock);
+ PySSL_ChainExceptions(self);
+ return NULL;
+}
+
+/*[clinic input]
+_ssl._SSLSocket.pending
+
+Returns the number of already decrypted bytes available for read, pending on the connection.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_pending_impl(PySSLSocket *self)
+/*[clinic end generated code: output=983d9fecdc308a83 input=2b77487d6dfd597f]*/
+{
+ int count = 0;
+ _PySSLError err;
+
+ PySSL_BEGIN_ALLOW_THREADS
+ count = SSL_pending(self->ssl);
+ err = _PySSL_errno(count < 0, self->ssl, count);
+ PySSL_END_ALLOW_THREADS
+ self->err = err;
+
+ if (count < 0)
+ return PySSL_SetError(self, count, __FILE__, __LINE__);
+ else
+ return PyLong_FromLong(count);
+}
+
+/*[clinic input]
+_ssl._SSLSocket.read
+ size as len: Py_ssize_t
+ [
+ buffer: Py_buffer(accept={rwbuffer})
+ ]
+ /
+
+Read up to size bytes from the SSL socket.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
+ int group_right_1, Py_buffer *buffer)
+/*[clinic end generated code: output=49b16e6406023734 input=ec48bf622be1c4a1]*/
+{
+ PyObject *dest = NULL;
+ char *mem;
+ size_t count = 0;
+ int retval;
+ int sockstate;
+ _PySSLError err;
+ int nonblocking;
+ PySocketSockObject *sock = GET_SOCKET(self);
+ _PyTime_t timeout, deadline = 0;
+ int has_timeout;
+
+ if (!group_right_1 && len < 0) {
+ PyErr_SetString(PyExc_ValueError, "size should not be negative");
+ return NULL;
+ }
+
+ if (sock != NULL) {
+ if (((PyObject*)sock) == Py_None) {
+ _setSSLError(get_state_sock(self),
+ "Underlying socket connection gone",
+ PY_SSL_ERROR_NO_SOCKET, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_INCREF(sock);
+ }
+
+ if (!group_right_1) {
+ dest = PyBytes_FromStringAndSize(NULL, len);
+ if (dest == NULL)
+ goto error;
+ if (len == 0) {
+ Py_XDECREF(sock);
+ return dest;
+ }
+ mem = PyBytes_AS_STRING(dest);
+ }
+ else {
+ mem = buffer->buf;
+ if (len <= 0 || len > buffer->len) {
+ len = (int) buffer->len;
+ if (buffer->len != len) {
+ PyErr_SetString(PyExc_OverflowError,
+ "maximum length can't fit in a C 'int'");
+ goto error;
+ }
+ if (len == 0) {
+ count = 0;
+ goto done;
+ }
+ }
+ }
+
+ if (sock != NULL) {
+ /* just in case the blocking state of the socket has been changed */
+ nonblocking = (sock->sock_timeout >= 0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+ }
+
+ timeout = GET_SOCKET_TIMEOUT(sock);
+ has_timeout = (timeout > 0);
+ if (has_timeout)
+ deadline = _PyDeadline_Init(timeout);
+
+ do {
+ PySSL_BEGIN_ALLOW_THREADS
+ retval = SSL_read_ex(self->ssl, mem, (size_t)len, &count);
+ err = _PySSL_errno(retval == 0, self->ssl, retval);
+ PySSL_END_ALLOW_THREADS
+ self->err = err;
+
+ if (PyErr_CheckSignals())
+ goto error;
+
+ if (has_timeout) {
+ timeout = _PyDeadline_Get(deadline);
+ }
+
+ if (err.ssl == SSL_ERROR_WANT_READ) {
+ sockstate = PySSL_select(sock, 0, timeout);
+ } else if (err.ssl == SSL_ERROR_WANT_WRITE) {
+ sockstate = PySSL_select(sock, 1, timeout);
+ } else if (err.ssl == SSL_ERROR_ZERO_RETURN &&
+ SSL_get_shutdown(self->ssl) == SSL_RECEIVED_SHUTDOWN)
+ {
+ count = 0;
+ goto done;
+ }
+ else
+ sockstate = SOCKET_OPERATION_OK;
+
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PyExc_TimeoutError,
+ "The read operation timed out");
+ goto error;
+ } else if (sockstate == SOCKET_IS_NONBLOCKING) {
+ break;
+ }
+ } while (err.ssl == SSL_ERROR_WANT_READ ||
+ err.ssl == SSL_ERROR_WANT_WRITE);
+
+ if (retval == 0) {
+ PySSL_SetError(self, retval, __FILE__, __LINE__);
+ goto error;
+ }
+ if (self->exc != NULL)
+ goto error;
+
+done:
+ Py_XDECREF(sock);
+ if (!group_right_1) {
+ _PyBytes_Resize(&dest, count);
+ return dest;
+ }
+ else {
+ return PyLong_FromSize_t(count);
+ }
+
+error:
+ PySSL_ChainExceptions(self);
+ Py_XDECREF(sock);
+ if (!group_right_1)
+ Py_XDECREF(dest);
+ return NULL;
+}
+
+/*[clinic input]
+_ssl._SSLSocket.shutdown
+
+Does the SSL shutdown handshake with the remote end.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_shutdown_impl(PySSLSocket *self)
+/*[clinic end generated code: output=ca1aa7ed9d25ca42 input=11d39e69b0a2bf4a]*/
+{
+ _PySSLError err;
+ int sockstate, nonblocking, ret;
+ int zeros = 0;
+ PySocketSockObject *sock = GET_SOCKET(self);
+ _PyTime_t timeout, deadline = 0;
+ int has_timeout;
+
+ if (sock != NULL) {
+ /* Guard against closed socket */
+ if ((((PyObject*)sock) == Py_None) || (sock->sock_fd == INVALID_SOCKET)) {
+ _setSSLError(get_state_sock(self),
+ "Underlying socket connection gone",
+ PY_SSL_ERROR_NO_SOCKET, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_INCREF(sock);
+
+ /* Just in case the blocking state of the socket has been changed */
+ nonblocking = (sock->sock_timeout >= 0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+ }
+
+ timeout = GET_SOCKET_TIMEOUT(sock);
+ has_timeout = (timeout > 0);
+ if (has_timeout) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ while (1) {
+ PySSL_BEGIN_ALLOW_THREADS
+ /* Disable read-ahead so that unwrap can work correctly.
+ * Otherwise OpenSSL might read in too much data,
+ * eating clear text data that happens to be
+ * transmitted after the SSL shutdown.
+ * Should be safe to call repeatedly every time this
+ * function is used and the shutdown_seen_zero != 0
+ * condition is met.
+ */
+ if (self->shutdown_seen_zero)
+ SSL_set_read_ahead(self->ssl, 0);
+ ret = SSL_shutdown(self->ssl);
+ err = _PySSL_errno(ret < 0, self->ssl, ret);
+ PySSL_END_ALLOW_THREADS
+ self->err = err;
+
+ /* If err == 1, a secure shutdown with SSL_shutdown() is complete */
+ if (ret > 0)
+ break;
+ if (ret == 0) {
+ /* Don't loop endlessly; instead preserve legacy
+ behaviour of trying SSL_shutdown() only twice.
+ This looks necessary for OpenSSL < 0.9.8m */
+ if (++zeros > 1)
+ break;
+ /* Shutdown was sent, now try receiving */
+ self->shutdown_seen_zero = 1;
+ continue;
+ }
+
+ if (has_timeout) {
+ timeout = _PyDeadline_Get(deadline);
+ }
+
+ /* Possibly retry shutdown until timeout or failure */
+ if (err.ssl == SSL_ERROR_WANT_READ)
+ sockstate = PySSL_select(sock, 0, timeout);
+ else if (err.ssl == SSL_ERROR_WANT_WRITE)
+ sockstate = PySSL_select(sock, 1, timeout);
+ else
+ break;
+
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ if (err.ssl == SSL_ERROR_WANT_READ)
+ PyErr_SetString(PyExc_TimeoutError,
+ "The read operation timed out");
+ else
+ PyErr_SetString(PyExc_TimeoutError,
+ "The write operation timed out");
+ goto error;
+ }
+ else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
+ PyErr_SetString(get_state_sock(self)->PySSLErrorObject,
+ "Underlying socket too large for select().");
+ goto error;
+ }
+ else if (sockstate != SOCKET_OPERATION_OK)
+ /* Retain the SSL error code */
+ break;
+ }
+ if (ret < 0) {
+ Py_XDECREF(sock);
+ PySSL_SetError(self, ret, __FILE__, __LINE__);
+ return NULL;
+ }
+ if (self->exc != NULL)
+ goto error;
+ if (sock)
+ /* It's already INCREF'ed */
+ return (PyObject *) sock;
+ else
+ Py_RETURN_NONE;
+
+error:
+ Py_XDECREF(sock);
+ PySSL_ChainExceptions(self);
+ return NULL;
+}
+
+/*[clinic input]
+_ssl._SSLSocket.get_channel_binding
+ cb_type: str = "tls-unique"
+
+Get channel binding data for current connection.
+
+Raise ValueError if the requested `cb_type` is not supported. Return bytes
+of the data or None if the data is not available (e.g. before the handshake).
+Only 'tls-unique' channel binding data from RFC 5929 is supported.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_get_channel_binding_impl(PySSLSocket *self,
+ const char *cb_type)
+/*[clinic end generated code: output=34bac9acb6a61d31 input=08b7e43b99c17d41]*/
+{
+ char buf[PySSL_CB_MAXLEN];
+ size_t len;
+
+ if (strcmp(cb_type, "tls-unique") == 0) {
+ if (SSL_session_reused(self->ssl) ^ !self->socket_type) {
+ /* if session is resumed XOR we are the client */
+ len = SSL_get_finished(self->ssl, buf, PySSL_CB_MAXLEN);
+ }
+ else {
+ /* if a new session XOR we are the server */
+ len = SSL_get_peer_finished(self->ssl, buf, PySSL_CB_MAXLEN);
+ }
+ }
+ else {
+ PyErr_Format(
+ PyExc_ValueError,
+ "'%s' channel binding type not implemented",
+ cb_type
+ );
+ return NULL;
+ }
+
+ /* It cannot be negative in current OpenSSL version as of July 2011 */
+ if (len == 0)
+ Py_RETURN_NONE;
+
+ return PyBytes_FromStringAndSize(buf, len);
+}
+
+/*[clinic input]
+_ssl._SSLSocket.verify_client_post_handshake
+
+Initiate TLS 1.3 post-handshake authentication
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self)
+/*[clinic end generated code: output=532147f3b1341425 input=6bfa874810a3d889]*/
+{
+#ifdef TLS1_3_VERSION
+ int err = SSL_verify_client_post_handshake(self->ssl);
+ if (err == 0)
+ return _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__);
+ else
+ Py_RETURN_NONE;
+#else
+ PyErr_SetString(PyExc_NotImplementedError,
+ "Post-handshake auth is not supported by your "
+ "OpenSSL version.");
+ return NULL;
+#endif
+}
+
+static SSL_SESSION*
+_ssl_session_dup(SSL_SESSION *session) {
+ SSL_SESSION *newsession = NULL;
+ int slen;
+ unsigned char *senc = NULL, *p;
+ const unsigned char *const_p;
+
+ if (session == NULL) {
+ PyErr_SetString(PyExc_ValueError, "Invalid session");
+ goto error;
+ }
+
+ /* get length */
+ slen = i2d_SSL_SESSION(session, NULL);
+ if (slen == 0 || slen > 0xFF00) {
+ PyErr_SetString(PyExc_ValueError, "i2d() failed");
+ goto error;
+ }
+ if ((senc = PyMem_Malloc(slen)) == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ p = senc;
+ if (!i2d_SSL_SESSION(session, &p)) {
+ PyErr_SetString(PyExc_ValueError, "i2d() failed");
+ goto error;
+ }
+ const_p = senc;
+ newsession = d2i_SSL_SESSION(NULL, &const_p, slen);
+ if (newsession == NULL) {
+ PyErr_SetString(PyExc_ValueError, "d2i() failed");
+ goto error;
+ }
+ PyMem_Free(senc);
+ return newsession;
+ error:
+ if (senc != NULL) {
+ PyMem_Free(senc);
+ }
+ return NULL;
+}
+
+static PyObject *
+PySSL_get_session(PySSLSocket *self, void *closure) {
+ /* get_session can return sessions from a server-side connection,
+ * it does not check for handshake done or client socket. */
+ PySSLSession *pysess;
+ SSL_SESSION *session;
+
+ /* duplicate session as workaround for session bug in OpenSSL 1.1.0,
+ * https://github.com/openssl/openssl/issues/1550 */
+ session = SSL_get0_session(self->ssl); /* borrowed reference */
+ if (session == NULL) {
+ Py_RETURN_NONE;
+ }
+ if ((session = _ssl_session_dup(session)) == NULL) {
+ return NULL;
+ }
+ session = SSL_get1_session(self->ssl);
+ if (session == NULL) {
+ Py_RETURN_NONE;
+ }
+ pysess = PyObject_GC_New(PySSLSession, self->ctx->state->PySSLSession_Type);
+ if (pysess == NULL) {
+ SSL_SESSION_free(session);
+ return NULL;
+ }
+
+ assert(self->ctx);
+ pysess->ctx = (PySSLContext*)Py_NewRef(self->ctx);
+ pysess->session = session;
+ PyObject_GC_Track(pysess);
+ return (PyObject *)pysess;
+}
+
+static int PySSL_set_session(PySSLSocket *self, PyObject *value,
+ void *closure)
+ {
+ PySSLSession *pysess;
+ SSL_SESSION *session;
+ int result;
+
+ if (!Py_IS_TYPE(value, get_state_sock(self)->PySSLSession_Type)) {
+ PyErr_SetString(PyExc_TypeError, "Value is not a SSLSession.");
+ return -1;
+ }
+ pysess = (PySSLSession *)value;
+
+ if (self->ctx->ctx != pysess->ctx->ctx) {
+ PyErr_SetString(PyExc_ValueError,
+ "Session refers to a different SSLContext.");
+ return -1;
+ }
+ if (self->socket_type != PY_SSL_CLIENT) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot set session for server-side SSLSocket.");
+ return -1;
+ }
+ if (SSL_is_init_finished(self->ssl)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot set session after handshake.");
+ return -1;
+ }
+ /* duplicate session */
+ if ((session = _ssl_session_dup(pysess->session)) == NULL) {
+ return -1;
+ }
+ result = SSL_set_session(self->ssl, session);
+ /* free duplicate, SSL_set_session() bumps ref count */
+ SSL_SESSION_free(session);
+ if (result == 0) {
+ _setSSLError(get_state_sock(self), NULL, 0, __FILE__, __LINE__);
+ return -1;
+ }
+ return 0;
+}
+
+PyDoc_STRVAR(PySSL_set_session_doc,
+"_setter_session(session)\n\
+\
+Get / set SSLSession.");
+
+static PyObject *
+PySSL_get_session_reused(PySSLSocket *self, void *closure) {
+ if (SSL_session_reused(self->ssl)) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
+PyDoc_STRVAR(PySSL_get_session_reused_doc,
+"Was the client session reused during handshake?");
+
+static PyGetSetDef ssl_getsetlist[] = {
+ {"context", (getter) PySSL_get_context,
+ (setter) PySSL_set_context, PySSL_set_context_doc},
+ {"server_side", (getter) PySSL_get_server_side, NULL,
+ PySSL_get_server_side_doc},
+ {"server_hostname", (getter) PySSL_get_server_hostname, NULL,
+ PySSL_get_server_hostname_doc},
+ {"owner", (getter) PySSL_get_owner, (setter) PySSL_set_owner,
+ PySSL_get_owner_doc},
+ {"session", (getter) PySSL_get_session,
+ (setter) PySSL_set_session, PySSL_set_session_doc},
+ {"session_reused", (getter) PySSL_get_session_reused, NULL,
+ PySSL_get_session_reused_doc},
+ {NULL}, /* sentinel */
+};
+
+static PyMethodDef PySSLMethods[] = {
+ _SSL__SSLSOCKET_DO_HANDSHAKE_METHODDEF
+ _SSL__SSLSOCKET_WRITE_METHODDEF
+ _SSL__SSLSOCKET_READ_METHODDEF
+ _SSL__SSLSOCKET_PENDING_METHODDEF
+ _SSL__SSLSOCKET_GETPEERCERT_METHODDEF
+ _SSL__SSLSOCKET_GET_CHANNEL_BINDING_METHODDEF
+ _SSL__SSLSOCKET_CIPHER_METHODDEF
+ _SSL__SSLSOCKET_SHARED_CIPHERS_METHODDEF
+ _SSL__SSLSOCKET_VERSION_METHODDEF
+ _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF
+ _SSL__SSLSOCKET_COMPRESSION_METHODDEF
+ _SSL__SSLSOCKET_SHUTDOWN_METHODDEF
+ _SSL__SSLSOCKET_VERIFY_CLIENT_POST_HANDSHAKE_METHODDEF
+ _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF
+ _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot PySSLSocket_slots[] = {
+ {Py_tp_methods, PySSLMethods},
+ {Py_tp_getset, ssl_getsetlist},
+ {Py_tp_dealloc, PySSL_dealloc},
+ {Py_tp_traverse, PySSL_traverse},
+ {Py_tp_clear, PySSL_clear},
+ {0, 0},
+};
+
+static PyType_Spec PySSLSocket_spec = {
+ .name = "_ssl._SSLSocket",
+ .basicsize = sizeof(PySSLSocket),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_HAVE_GC),
+ .slots = PySSLSocket_slots,
+};
+
+/*
+ * _SSLContext objects
+ */
+
+static int
+_set_verify_mode(PySSLContext *self, enum py_ssl_cert_requirements n)
+{
+ int mode;
+ int (*verify_cb)(int, X509_STORE_CTX *) = NULL;
+
+ switch(n) {
+ case PY_SSL_CERT_NONE:
+ mode = SSL_VERIFY_NONE;
+ break;
+ case PY_SSL_CERT_OPTIONAL:
+ mode = SSL_VERIFY_PEER;
+ break;
+ case PY_SSL_CERT_REQUIRED:
+ mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError,
+ "invalid value for verify_mode");
+ return -1;
+ }
+
+ /* bpo-37428: newPySSLSocket() sets SSL_VERIFY_POST_HANDSHAKE flag for
+ * server sockets and SSL_set_post_handshake_auth() for client. */
+
+ /* keep current verify cb */
+ verify_cb = SSL_CTX_get_verify_callback(self->ctx);
+ SSL_CTX_set_verify(self->ctx, mode, verify_cb);
+ return 0;
+}
+
+/*[clinic input]
+@classmethod
+_ssl._SSLContext.__new__
+ protocol as proto_version: int
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
+/*[clinic end generated code: output=2cf0d7a0741b6bd1 input=8d58a805b95fc534]*/
+{
+ PySSLContext *self;
+ uint64_t options;
+ const SSL_METHOD *method = NULL;
+ SSL_CTX *ctx = NULL;
+ X509_VERIFY_PARAM *params;
+ int result;
+
+ /* slower approach, walk MRO and get borrowed reference to module.
+ * PyType_GetModuleByDef is required for SSLContext subclasses */
+ PyObject *module = PyType_GetModuleByDef(type, &_sslmodule_def);
+ if (module == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Cannot find internal module state");
+ return NULL;
+ }
+
+ switch(proto_version) {
+#if defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
+ case PY_SSL_VERSION_SSL3:
+ PY_SSL_DEPRECATED("ssl.PROTOCOL_SSLv3 is deprecated", 2, NULL);
+ method = SSLv3_method();
+ break;
+#endif
+#if (defined(TLS1_VERSION) && \
+ !defined(OPENSSL_NO_TLS1) && \
+ !defined(OPENSSL_NO_TLS1_METHOD))
+ case PY_SSL_VERSION_TLS1:
+ PY_SSL_DEPRECATED("ssl.PROTOCOL_TLSv1 is deprecated", 2, NULL);
+ method = TLSv1_method();
+ break;
+#endif
+#if (defined(TLS1_1_VERSION) && \
+ !defined(OPENSSL_NO_TLS1_1) && \
+ !defined(OPENSSL_NO_TLS1_1_METHOD))
+ case PY_SSL_VERSION_TLS1_1:
+ PY_SSL_DEPRECATED("ssl.PROTOCOL_TLSv1_1 is deprecated", 2, NULL);
+ method = TLSv1_1_method();
+ break;
+#endif
+#if (defined(TLS1_2_VERSION) && \
+ !defined(OPENSSL_NO_TLS1_2) && \
+ !defined(OPENSSL_NO_TLS1_2_METHOD))
+ case PY_SSL_VERSION_TLS1_2:
+ PY_SSL_DEPRECATED("ssl.PROTOCOL_TLSv1_2 is deprecated", 2, NULL);
+ method = TLSv1_2_method();
+ break;
+#endif
+ case PY_SSL_VERSION_TLS:
+ PY_SSL_DEPRECATED("ssl.PROTOCOL_TLS is deprecated", 2, NULL);
+ method = TLS_method();
+ break;
+ case PY_SSL_VERSION_TLS_CLIENT:
+ method = TLS_client_method();
+ break;
+ case PY_SSL_VERSION_TLS_SERVER:
+ method = TLS_server_method();
+ break;
+ default:
+ method = NULL;
+ }
+
+ if (method == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "invalid or unsupported protocol version %i",
+ proto_version);
+ return NULL;
+ }
+
+ PySSL_BEGIN_ALLOW_THREADS
+ ctx = SSL_CTX_new(method);
+ PySSL_END_ALLOW_THREADS
+
+ if (ctx == NULL) {
+ _setSSLError(get_ssl_state(module), NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (PySSLContext *) type->tp_alloc(type, 0);
+ if (self == NULL) {
+ SSL_CTX_free(ctx);
+ return NULL;
+ }
+ self->ctx = ctx;
+ self->hostflags = X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;
+ self->protocol = proto_version;
+ self->msg_cb = NULL;
+ self->keylog_filename = NULL;
+ self->keylog_bio = NULL;
+ self->alpn_protocols = NULL;
+ self->set_sni_cb = NULL;
+ self->state = get_ssl_state(module);
+
+ /* Don't check host name by default */
+ if (proto_version == PY_SSL_VERSION_TLS_CLIENT) {
+ self->check_hostname = 1;
+ if (_set_verify_mode(self, PY_SSL_CERT_REQUIRED) == -1) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ } else {
+ self->check_hostname = 0;
+ if (_set_verify_mode(self, PY_SSL_CERT_NONE) == -1) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+ /* Defaults */
+ options = SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+ if (proto_version != PY_SSL_VERSION_SSL2)
+ options |= SSL_OP_NO_SSLv2;
+ if (proto_version != PY_SSL_VERSION_SSL3)
+ options |= SSL_OP_NO_SSLv3;
+ /* Minimal security flags for server and client side context.
+ * Client sockets ignore server-side parameters. */
+#ifdef SSL_OP_NO_COMPRESSION
+ options |= SSL_OP_NO_COMPRESSION;
+#endif
+#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
+ options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
+#endif
+#ifdef SSL_OP_SINGLE_DH_USE
+ options |= SSL_OP_SINGLE_DH_USE;
+#endif
+#ifdef SSL_OP_SINGLE_ECDH_USE
+ options |= SSL_OP_SINGLE_ECDH_USE;
+#endif
+ SSL_CTX_set_options(self->ctx, options);
+
+ /* A bare minimum cipher list without completely broken cipher suites.
+ * It's far from perfect but gives users a better head start. */
+ if (proto_version != PY_SSL_VERSION_SSL2) {
+#if PY_SSL_DEFAULT_CIPHERS == 2
+ /* stick to OpenSSL's default settings */
+ result = 1;
+#else
+ result = SSL_CTX_set_cipher_list(ctx, PY_SSL_DEFAULT_CIPHER_STRING);
+#endif
+ } else {
+ /* SSLv2 needs MD5 */
+ result = SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!eNULL");
+ }
+ if (result == 0) {
+ Py_DECREF(self);
+ ERR_clear_error();
+ PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
+ "No cipher can be selected.");
+ goto error;
+ }
+#ifdef PY_SSL_MIN_PROTOCOL
+ switch(proto_version) {
+ case PY_SSL_VERSION_TLS:
+ case PY_SSL_VERSION_TLS_CLIENT:
+ case PY_SSL_VERSION_TLS_SERVER:
+ result = SSL_CTX_set_min_proto_version(ctx, PY_SSL_MIN_PROTOCOL);
+ if (result == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Failed to set minimum protocol 0x%x",
+ PY_SSL_MIN_PROTOCOL);
+ goto error;
+ }
+ break;
+ default:
+ break;
+ }
+#endif
+
+ /* Set SSL_MODE_RELEASE_BUFFERS. This potentially greatly reduces memory
+ usage for no cost at all. */
+ SSL_CTX_set_mode(self->ctx, SSL_MODE_RELEASE_BUFFERS);
+
+#define SID_CTX "Python"
+ SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
+ sizeof(SID_CTX));
+#undef SID_CTX
+
+ params = SSL_CTX_get0_param(self->ctx);
+ /* Improve trust chain building when cross-signed intermediate
+ certificates are present. See https://bugs.python.org/issue23476. */
+ X509_VERIFY_PARAM_set_flags(params, X509_V_FLAG_TRUSTED_FIRST);
+ X509_VERIFY_PARAM_set_hostflags(params, self->hostflags);
+
+#ifdef TLS1_3_VERSION
+ self->post_handshake_auth = 0;
+ SSL_CTX_set_post_handshake_auth(self->ctx, self->post_handshake_auth);
+#endif
+
+ return (PyObject *)self;
+ error:
+ Py_XDECREF(self);
+ ERR_clear_error();
+ return NULL;
+}
+
+static int
+context_traverse(PySSLContext *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->set_sni_cb);
+ Py_VISIT(self->msg_cb);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+context_clear(PySSLContext *self)
+{
+ Py_CLEAR(self->set_sni_cb);
+ Py_CLEAR(self->msg_cb);
+ Py_CLEAR(self->keylog_filename);
+ if (self->keylog_bio != NULL) {
+ PySSL_BEGIN_ALLOW_THREADS
+ BIO_free_all(self->keylog_bio);
+ PySSL_END_ALLOW_THREADS
+ self->keylog_bio = NULL;
+ }
+ return 0;
+}
+
+static void
+context_dealloc(PySSLContext *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(self);
+ context_clear(self);
+ SSL_CTX_free(self->ctx);
+ PyMem_FREE(self->alpn_protocols);
+ Py_TYPE(self)->tp_free(self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+_ssl._SSLContext.set_ciphers
+ cipherlist: str
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist)
+/*[clinic end generated code: output=3a3162f3557c0f3f input=a7ac931b9f3ca7fc]*/
+{
+ int ret = SSL_CTX_set_cipher_list(self->ctx, cipherlist);
+ if (ret == 0) {
+ /* Clearing the error queue is necessary on some OpenSSL versions,
+ otherwise the error will be reported again when another SSL call
+ is done. */
+ ERR_clear_error();
+ PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
+ "No cipher can be selected.");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_ssl._SSLContext.get_ciphers
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_get_ciphers_impl(PySSLContext *self)
+/*[clinic end generated code: output=a56e4d68a406dfc4 input=a2aadc9af89b79c5]*/
+{
+ SSL *ssl = NULL;
+ STACK_OF(SSL_CIPHER) *sk = NULL;
+ const SSL_CIPHER *cipher;
+ int i=0;
+ PyObject *result = NULL, *dct;
+
+ ssl = SSL_new(self->ctx);
+ if (ssl == NULL) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ goto exit;
+ }
+ sk = SSL_get_ciphers(ssl);
+
+ result = PyList_New(sk_SSL_CIPHER_num(sk));
+ if (result == NULL) {
+ goto exit;
+ }
+
+ for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
+ cipher = sk_SSL_CIPHER_value(sk, i);
+ dct = cipher_to_dict(cipher);
+ if (dct == NULL) {
+ Py_CLEAR(result);
+ goto exit;
+ }
+ PyList_SET_ITEM(result, i, dct);
+ }
+
+ exit:
+ if (ssl != NULL)
+ SSL_free(ssl);
+ return result;
+
+}
+
+
+static int
+do_protocol_selection(int alpn, unsigned char **out, unsigned char *outlen,
+ const unsigned char *server_protocols, unsigned int server_protocols_len,
+ const unsigned char *client_protocols, unsigned int client_protocols_len)
+{
+ int ret;
+ if (client_protocols == NULL) {
+ client_protocols = (unsigned char *)"";
+ client_protocols_len = 0;
+ }
+ if (server_protocols == NULL) {
+ server_protocols = (unsigned char *)"";
+ server_protocols_len = 0;
+ }
+
+ ret = SSL_select_next_proto(out, outlen,
+ server_protocols, server_protocols_len,
+ client_protocols, client_protocols_len);
+ if (alpn && ret != OPENSSL_NPN_NEGOTIATED)
+ return SSL_TLSEXT_ERR_NOACK;
+
+ return SSL_TLSEXT_ERR_OK;
+}
+
+static int
+_selectALPN_cb(SSL *s,
+ const unsigned char **out, unsigned char *outlen,
+ const unsigned char *client_protocols, unsigned int client_protocols_len,
+ void *args)
+{
+ PySSLContext *ctx = (PySSLContext *)args;
+ return do_protocol_selection(1, (unsigned char **)out, outlen,
+ ctx->alpn_protocols, ctx->alpn_protocols_len,
+ client_protocols, client_protocols_len);
+}
+
+/*[clinic input]
+_ssl._SSLContext._set_alpn_protocols
+ protos: Py_buffer
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self,
+ Py_buffer *protos)
+/*[clinic end generated code: output=87599a7f76651a9b input=9bba964595d519be]*/
+{
+ if ((size_t)protos->len > UINT_MAX) {
+ PyErr_Format(PyExc_OverflowError,
+ "protocols longer than %u bytes", UINT_MAX);
+ return NULL;
+ }
+
+ PyMem_Free(self->alpn_protocols);
+ self->alpn_protocols = PyMem_Malloc(protos->len);
+ if (!self->alpn_protocols)
+ return PyErr_NoMemory();
+ memcpy(self->alpn_protocols, protos->buf, protos->len);
+ self->alpn_protocols_len = (unsigned int)protos->len;
+
+ if (SSL_CTX_set_alpn_protos(self->ctx, self->alpn_protocols, self->alpn_protocols_len))
+ return PyErr_NoMemory();
+ SSL_CTX_set_alpn_select_cb(self->ctx, _selectALPN_cb, self);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+get_verify_mode(PySSLContext *self, void *c)
+{
+ /* ignore SSL_VERIFY_CLIENT_ONCE and SSL_VERIFY_POST_HANDSHAKE */
+ int mask = (SSL_VERIFY_NONE | SSL_VERIFY_PEER |
+ SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
+ switch (SSL_CTX_get_verify_mode(self->ctx) & mask) {
+ case SSL_VERIFY_NONE:
+ return PyLong_FromLong(PY_SSL_CERT_NONE);
+ case SSL_VERIFY_PEER:
+ return PyLong_FromLong(PY_SSL_CERT_OPTIONAL);
+ case SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT:
+ return PyLong_FromLong(PY_SSL_CERT_REQUIRED);
+ }
+ PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
+ "invalid return value from SSL_CTX_get_verify_mode");
+ return NULL;
+}
+
+static int
+set_verify_mode(PySSLContext *self, PyObject *arg, void *c)
+{
+ int n;
+ if (!PyArg_Parse(arg, "i", &n))
+ return -1;
+ if (n == PY_SSL_CERT_NONE && self->check_hostname) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot set verify_mode to CERT_NONE when "
+ "check_hostname is enabled.");
+ return -1;
+ }
+ return _set_verify_mode(self, n);
+}
+
+static PyObject *
+get_verify_flags(PySSLContext *self, void *c)
+{
+ X509_VERIFY_PARAM *param;
+ unsigned long flags;
+
+ param = SSL_CTX_get0_param(self->ctx);
+ flags = X509_VERIFY_PARAM_get_flags(param);
+ return PyLong_FromUnsignedLong(flags);
+}
+
+static int
+set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
+{
+ X509_VERIFY_PARAM *param;
+ unsigned long new_flags, flags, set, clear;
+
+ if (!PyArg_Parse(arg, "k", &new_flags))
+ return -1;
+ param = SSL_CTX_get0_param(self->ctx);
+ flags = X509_VERIFY_PARAM_get_flags(param);
+ clear = flags & ~new_flags;
+ set = ~flags & new_flags;
+ if (clear) {
+ if (!X509_VERIFY_PARAM_clear_flags(param, clear)) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ return -1;
+ }
+ }
+ if (set) {
+ if (!X509_VERIFY_PARAM_set_flags(param, set)) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+/* Getter and setter for protocol version */
+static int
+set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what)
+{
+ long v;
+ int result;
+
+ if (!PyArg_Parse(arg, "l", &v))
+ return -1;
+ if (v > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "Option is too long");
+ return -1;
+ }
+
+ switch(self->protocol) {
+ case PY_SSL_VERSION_TLS_CLIENT: /* fall through */
+ case PY_SSL_VERSION_TLS_SERVER: /* fall through */
+ case PY_SSL_VERSION_TLS:
+ break;
+ default:
+ PyErr_SetString(
+ PyExc_ValueError,
+ "The context's protocol doesn't support modification of "
+ "highest and lowest version."
+ );
+ return -1;
+ }
+
+ /* check for deprecations and supported values */
+ switch(v) {
+ case PY_PROTO_SSLv3:
+ PY_SSL_DEPRECATED("ssl.TLSVersion.SSLv3 is deprecated", 2, -1);
+ break;
+ case PY_PROTO_TLSv1:
+ PY_SSL_DEPRECATED("ssl.TLSVersion.TLSv1 is deprecated", 2, -1);
+ break;
+ case PY_PROTO_TLSv1_1:
+ PY_SSL_DEPRECATED("ssl.TLSVersion.TLSv1_1 is deprecated", 2, -1);
+ break;
+ case PY_PROTO_MINIMUM_SUPPORTED:
+ case PY_PROTO_MAXIMUM_SUPPORTED:
+ case PY_PROTO_TLSv1_2:
+ case PY_PROTO_TLSv1_3:
+ /* ok */
+ break;
+ default:
+ PyErr_Format(PyExc_ValueError,
+ "Unsupported TLS/SSL version 0x%x", v);
+ return -1;
+ }
+
+ if (what == 0) {
+ switch(v) {
+ case PY_PROTO_MINIMUM_SUPPORTED:
+ v = 0;
+ break;
+ case PY_PROTO_MAXIMUM_SUPPORTED:
+ /* Emulate max for set_min_proto_version */
+ v = PY_PROTO_MAXIMUM_AVAILABLE;
+ break;
+ default:
+ break;
+ }
+ result = SSL_CTX_set_min_proto_version(self->ctx, v);
+ }
+ else {
+ switch(v) {
+ case PY_PROTO_MAXIMUM_SUPPORTED:
+ v = 0;
+ break;
+ case PY_PROTO_MINIMUM_SUPPORTED:
+ /* Emulate max for set_min_proto_version */
+ v = PY_PROTO_MINIMUM_AVAILABLE;
+ break;
+ default:
+ break;
+ }
+ result = SSL_CTX_set_max_proto_version(self->ctx, v);
+ }
+ if (result == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Unsupported protocol version 0x%x", v);
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+get_minimum_version(PySSLContext *self, void *c)
+{
+ int v = SSL_CTX_get_min_proto_version(self->ctx);
+ if (v == 0) {
+ v = PY_PROTO_MINIMUM_SUPPORTED;
+ }
+ return PyLong_FromLong(v);
+}
+
+static int
+set_minimum_version(PySSLContext *self, PyObject *arg, void *c)
+{
+ return set_min_max_proto_version(self, arg, 0);
+}
+
+static PyObject *
+get_maximum_version(PySSLContext *self, void *c)
+{
+ int v = SSL_CTX_get_max_proto_version(self->ctx);
+ if (v == 0) {
+ v = PY_PROTO_MAXIMUM_SUPPORTED;
+ }
+ return PyLong_FromLong(v);
+}
+
+static int
+set_maximum_version(PySSLContext *self, PyObject *arg, void *c)
+{
+ return set_min_max_proto_version(self, arg, 1);
+}
+
+#ifdef TLS1_3_VERSION
+static PyObject *
+get_num_tickets(PySSLContext *self, void *c)
+{
+ return PyLong_FromSize_t(SSL_CTX_get_num_tickets(self->ctx));
+}
+
+static int
+set_num_tickets(PySSLContext *self, PyObject *arg, void *c)
+{
+ long num;
+ if (!PyArg_Parse(arg, "l", &num))
+ return -1;
+ if (num < 0) {
+ PyErr_SetString(PyExc_ValueError, "value must be non-negative");
+ return -1;
+ }
+ if (self->protocol != PY_SSL_VERSION_TLS_SERVER) {
+ PyErr_SetString(PyExc_ValueError,
+ "SSLContext is not a server context.");
+ return -1;
+ }
+ if (SSL_CTX_set_num_tickets(self->ctx, num) != 1) {
+ PyErr_SetString(PyExc_ValueError, "failed to set num tickets.");
+ return -1;
+ }
+ return 0;
+}
+
+PyDoc_STRVAR(PySSLContext_num_tickets_doc,
+"Control the number of TLSv1.3 session tickets");
+#endif /* TLS1_3_VERSION */
+
+static PyObject *
+get_security_level(PySSLContext *self, void *c)
+{
+ return PyLong_FromLong(SSL_CTX_get_security_level(self->ctx));
+}
+PyDoc_STRVAR(PySSLContext_security_level_doc, "The current security level");
+
+static PyObject *
+get_options(PySSLContext *self, void *c)
+{
+ uint64_t options = SSL_CTX_get_options(self->ctx);
+ Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(options));
+ return PyLong_FromUnsignedLongLong(options);
+}
+
+static int
+set_options(PySSLContext *self, PyObject *arg, void *c)
+{
+ PyObject *new_opts_obj;
+ unsigned long long new_opts_arg;
+ uint64_t new_opts, opts, clear, set;
+ uint64_t opt_no = (
+ SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 |
+ SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3
+ );
+
+ if (!PyArg_Parse(arg, "O!", &PyLong_Type, &new_opts_obj)) {
+ return -1;
+ }
+ new_opts_arg = PyLong_AsUnsignedLongLong(new_opts_obj);
+ if (new_opts_arg == (unsigned long long)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ Py_BUILD_ASSERT(sizeof(new_opts) >= sizeof(new_opts_arg));
+ new_opts = (uint64_t)new_opts_arg;
+
+ opts = SSL_CTX_get_options(self->ctx);
+ clear = opts & ~new_opts;
+ set = ~opts & new_opts;
+
+ if ((set & opt_no) != 0) {
+ if (_ssl_deprecated("ssl.OP_NO_SSL*/ssl.OP_NO_TLS* options are "
+ "deprecated", 2) < 0) {
+ return -1;
+ }
+ }
+ if (clear) {
+ SSL_CTX_clear_options(self->ctx, clear);
+ }
+ if (set) {
+ SSL_CTX_set_options(self->ctx, set);
+ }
+ return 0;
+}
+
+static PyObject *
+get_host_flags(PySSLContext *self, void *c)
+{
+ return PyLong_FromUnsignedLong(self->hostflags);
+}
+
+static int
+set_host_flags(PySSLContext *self, PyObject *arg, void *c)
+{
+ X509_VERIFY_PARAM *param;
+ unsigned int new_flags = 0;
+
+ if (!PyArg_Parse(arg, "I", &new_flags))
+ return -1;
+
+ param = SSL_CTX_get0_param(self->ctx);
+ self->hostflags = new_flags;
+ X509_VERIFY_PARAM_set_hostflags(param, new_flags);
+ return 0;
+}
+
+static PyObject *
+get_check_hostname(PySSLContext *self, void *c)
+{
+ return PyBool_FromLong(self->check_hostname);
+}
+
+static int
+set_check_hostname(PySSLContext *self, PyObject *arg, void *c)
+{
+ int check_hostname;
+ if (!PyArg_Parse(arg, "p", &check_hostname))
+ return -1;
+ if (check_hostname &&
+ SSL_CTX_get_verify_mode(self->ctx) == SSL_VERIFY_NONE) {
+ /* check_hostname = True sets verify_mode = CERT_REQUIRED */
+ if (_set_verify_mode(self, PY_SSL_CERT_REQUIRED) == -1) {
+ return -1;
+ }
+ }
+ self->check_hostname = check_hostname;
+ return 0;
+}
+
+static PyObject *
+get_post_handshake_auth(PySSLContext *self, void *c) {
+#if TLS1_3_VERSION
+ return PyBool_FromLong(self->post_handshake_auth);
+#else
+ Py_RETURN_NONE;
+#endif
+}
+
+#if TLS1_3_VERSION
+static int
+set_post_handshake_auth(PySSLContext *self, PyObject *arg, void *c) {
+ if (arg == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ int pha = PyObject_IsTrue(arg);
+
+ if (pha == -1) {
+ return -1;
+ }
+ self->post_handshake_auth = pha;
+
+ /* bpo-37428: newPySSLSocket() sets SSL_VERIFY_POST_HANDSHAKE flag for
+ * server sockets and SSL_set_post_handshake_auth() for client. */
+
+ return 0;
+}
+#endif
+
+static PyObject *
+get_protocol(PySSLContext *self, void *c) {
+ return PyLong_FromLong(self->protocol);
+}
+
+typedef struct {
+ PyThreadState *thread_state;
+ PyObject *callable;
+ char *password;
+ int size;
+ int error;
+} _PySSLPasswordInfo;
+
+static int
+_pwinfo_set(_PySSLPasswordInfo *pw_info, PyObject* password,
+ const char *bad_type_error)
+{
+ /* Set the password and size fields of a _PySSLPasswordInfo struct
+ from a unicode, bytes, or byte array object.
+ The password field will be dynamically allocated and must be freed
+ by the caller */
+ PyObject *password_bytes = NULL;
+ const char *data = NULL;
+ Py_ssize_t size;
+
+ if (PyUnicode_Check(password)) {
+ password_bytes = PyUnicode_AsUTF8String(password);
+ if (!password_bytes) {
+ goto error;
+ }
+ data = PyBytes_AS_STRING(password_bytes);
+ size = PyBytes_GET_SIZE(password_bytes);
+ } else if (PyBytes_Check(password)) {
+ data = PyBytes_AS_STRING(password);
+ size = PyBytes_GET_SIZE(password);
+ } else if (PyByteArray_Check(password)) {
+ data = PyByteArray_AS_STRING(password);
+ size = PyByteArray_GET_SIZE(password);
+ } else {
+ PyErr_SetString(PyExc_TypeError, bad_type_error);
+ goto error;
+ }
+
+ if (size > (Py_ssize_t)INT_MAX) {
+ PyErr_Format(PyExc_ValueError,
+ "password cannot be longer than %d bytes", INT_MAX);
+ goto error;
+ }
+
+ PyMem_Free(pw_info->password);
+ pw_info->password = PyMem_Malloc(size);
+ if (!pw_info->password) {
+ PyErr_SetString(PyExc_MemoryError,
+ "unable to allocate password buffer");
+ goto error;
+ }
+ memcpy(pw_info->password, data, size);
+ pw_info->size = (int)size;
+
+ Py_XDECREF(password_bytes);
+ return 1;
+
+error:
+ Py_XDECREF(password_bytes);
+ return 0;
+}
+
+static int
+_password_callback(char *buf, int size, int rwflag, void *userdata)
+{
+ _PySSLPasswordInfo *pw_info = (_PySSLPasswordInfo*) userdata;
+ PyObject *fn_ret = NULL;
+
+ PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
+
+ if (pw_info->error) {
+ /* already failed previously. OpenSSL 3.0.0-alpha14 invokes the
+ * callback multiple times which can lead to fatal Python error in
+ * exception check. */
+ goto error;
+ }
+
+ if (pw_info->callable) {
+ fn_ret = PyObject_CallNoArgs(pw_info->callable);
+ if (!fn_ret) {
+ /* TODO: It would be nice to move _ctypes_add_traceback() into the
+ core python API, so we could use it to add a frame here */
+ goto error;
+ }
+
+ if (!_pwinfo_set(pw_info, fn_ret,
+ "password callback must return a string")) {
+ goto error;
+ }
+ Py_CLEAR(fn_ret);
+ }
+
+ if (pw_info->size > size) {
+ PyErr_Format(PyExc_ValueError,
+ "password cannot be longer than %d bytes", size);
+ goto error;
+ }
+
+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info->thread_state);
+ memcpy(buf, pw_info->password, pw_info->size);
+ return pw_info->size;
+
+error:
+ Py_XDECREF(fn_ret);
+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info->thread_state);
+ pw_info->error = 1;
+ return -1;
+}
+
+/*[clinic input]
+_ssl._SSLContext.load_cert_chain
+ certfile: object
+ keyfile: object = None
+ password: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile,
+ PyObject *keyfile, PyObject *password)
+/*[clinic end generated code: output=9480bc1c380e2095 input=30bc7e967ea01a58]*/
+{
+ PyObject *certfile_bytes = NULL, *keyfile_bytes = NULL;
+ pem_password_cb *orig_passwd_cb = SSL_CTX_get_default_passwd_cb(self->ctx);
+ void *orig_passwd_userdata = SSL_CTX_get_default_passwd_cb_userdata(self->ctx);
+ _PySSLPasswordInfo pw_info = { NULL, NULL, NULL, 0, 0 };
+ int r;
+
+ errno = 0;
+ ERR_clear_error();
+ if (keyfile == Py_None)
+ keyfile = NULL;
+ if (!PyUnicode_FSConverter(certfile, &certfile_bytes)) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "certfile should be a valid filesystem path");
+ }
+ return NULL;
+ }
+ if (keyfile && !PyUnicode_FSConverter(keyfile, &keyfile_bytes)) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "keyfile should be a valid filesystem path");
+ }
+ goto error;
+ }
+ if (password != Py_None) {
+ if (PyCallable_Check(password)) {
+ pw_info.callable = password;
+ } else if (!_pwinfo_set(&pw_info, password,
+ "password should be a string or callable")) {
+ goto error;
+ }
+ SSL_CTX_set_default_passwd_cb(self->ctx, _password_callback);
+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, &pw_info);
+ }
+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
+ r = SSL_CTX_use_certificate_chain_file(self->ctx,
+ PyBytes_AS_STRING(certfile_bytes));
+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
+ if (r != 1) {
+ if (pw_info.error) {
+ ERR_clear_error();
+ /* the password callback has already set the error information */
+ }
+ else if (errno != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ ERR_clear_error();
+ }
+ else {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ }
+ goto error;
+ }
+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
+ r = SSL_CTX_use_PrivateKey_file(self->ctx,
+ PyBytes_AS_STRING(keyfile ? keyfile_bytes : certfile_bytes),
+ SSL_FILETYPE_PEM);
+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
+ Py_CLEAR(keyfile_bytes);
+ Py_CLEAR(certfile_bytes);
+ if (r != 1) {
+ if (pw_info.error) {
+ ERR_clear_error();
+ /* the password callback has already set the error information */
+ }
+ else if (errno != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ ERR_clear_error();
+ }
+ else {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ }
+ goto error;
+ }
+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
+ r = SSL_CTX_check_private_key(self->ctx);
+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
+ if (r != 1) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ goto error;
+ }
+ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
+ PyMem_Free(pw_info.password);
+ Py_RETURN_NONE;
+
+error:
+ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
+ PyMem_Free(pw_info.password);
+ Py_XDECREF(keyfile_bytes);
+ Py_XDECREF(certfile_bytes);
+ return NULL;
+}
+
+/* internal helper function, returns -1 on error
+ */
+static int
+_add_ca_certs(PySSLContext *self, const void *data, Py_ssize_t len,
+ int filetype)
+{
+ BIO *biobuf = NULL;
+ X509_STORE *store;
+ int retval = -1, err, loaded = 0, was_bio_eof = 0;
+
+ assert(filetype == SSL_FILETYPE_ASN1 || filetype == SSL_FILETYPE_PEM);
+
+ if (len <= 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "Empty certificate data");
+ return -1;
+ } else if (len > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "Certificate data is too long.");
+ return -1;
+ }
+
+ biobuf = BIO_new_mem_buf(data, (int)len);
+ if (biobuf == NULL) {
+ _setSSLError(get_state_ctx(self), "Can't allocate buffer", 0, __FILE__, __LINE__);
+ return -1;
+ }
+
+ store = SSL_CTX_get_cert_store(self->ctx);
+ assert(store != NULL);
+
+ while (1) {
+ X509 *cert = NULL;
+ int r;
+
+ if (filetype == SSL_FILETYPE_ASN1) {
+ if (BIO_eof(biobuf)) {
+ was_bio_eof = 1;
+ break;
+ }
+ cert = d2i_X509_bio(biobuf, NULL);
+ } else {
+ cert = PEM_read_bio_X509(biobuf, NULL,
+ SSL_CTX_get_default_passwd_cb(self->ctx),
+ SSL_CTX_get_default_passwd_cb_userdata(self->ctx)
+ );
+ }
+ if (cert == NULL) {
+ break;
+ }
+ r = X509_STORE_add_cert(store, cert);
+ X509_free(cert);
+ if (!r) {
+ err = ERR_peek_last_error();
+ if ((ERR_GET_LIB(err) == ERR_LIB_X509) &&
+ (ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE)) {
+ /* cert already in hash table, not an error */
+ ERR_clear_error();
+ } else {
+ break;
+ }
+ }
+ loaded++;
+ }
+
+ err = ERR_peek_last_error();
+ if (loaded == 0) {
+ const char *msg = NULL;
+ if (filetype == SSL_FILETYPE_PEM) {
+ msg = "no start line: cadata does not contain a certificate";
+ } else {
+ msg = "not enough data: cadata does not contain a certificate";
+ }
+ _setSSLError(get_state_ctx(self), msg, 0, __FILE__, __LINE__);
+ retval = -1;
+ } else if ((filetype == SSL_FILETYPE_ASN1) && was_bio_eof) {
+ /* EOF ASN1 file, not an error */
+ ERR_clear_error();
+ retval = 0;
+ } else if ((filetype == SSL_FILETYPE_PEM) &&
+ (ERR_GET_LIB(err) == ERR_LIB_PEM) &&
+ (ERR_GET_REASON(err) == PEM_R_NO_START_LINE)) {
+ /* EOF PEM file, not an error */
+ ERR_clear_error();
+ retval = 0;
+ } else if (err != 0) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ retval = -1;
+ } else {
+ retval = 0;
+ }
+
+ BIO_free(biobuf);
+ return retval;
+}
+
+
+/*[clinic input]
+_ssl._SSLContext.load_verify_locations
+ cafile: object = None
+ capath: object = None
+ cadata: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_load_verify_locations_impl(PySSLContext *self,
+ PyObject *cafile,
+ PyObject *capath,
+ PyObject *cadata)
+/*[clinic end generated code: output=454c7e41230ca551 input=42ecfe258233e194]*/
+{
+ PyObject *cafile_bytes = NULL, *capath_bytes = NULL;
+ const char *cafile_buf = NULL, *capath_buf = NULL;
+ int r = 0, ok = 1;
+
+ errno = 0;
+ if (cafile == Py_None)
+ cafile = NULL;
+ if (capath == Py_None)
+ capath = NULL;
+ if (cadata == Py_None)
+ cadata = NULL;
+
+ if (cafile == NULL && capath == NULL && cadata == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "cafile, capath and cadata cannot be all omitted");
+ goto error;
+ }
+ if (cafile && !PyUnicode_FSConverter(cafile, &cafile_bytes)) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "cafile should be a valid filesystem path");
+ }
+ goto error;
+ }
+ if (capath && !PyUnicode_FSConverter(capath, &capath_bytes)) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "capath should be a valid filesystem path");
+ }
+ goto error;
+ }
+
+ /* validate cadata type and load cadata */
+ if (cadata) {
+ if (PyUnicode_Check(cadata)) {
+ PyObject *cadata_ascii = PyUnicode_AsASCIIString(cadata);
+ if (cadata_ascii == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ goto invalid_cadata;
+ }
+ goto error;
+ }
+ r = _add_ca_certs(self,
+ PyBytes_AS_STRING(cadata_ascii),
+ PyBytes_GET_SIZE(cadata_ascii),
+ SSL_FILETYPE_PEM);
+ Py_DECREF(cadata_ascii);
+ if (r == -1) {
+ goto error;
+ }
+ }
+ else if (PyObject_CheckBuffer(cadata)) {
+ Py_buffer buf;
+ if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE)) {
+ goto error;
+ }
+ if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
+ PyBuffer_Release(&buf);
+ PyErr_SetString(PyExc_TypeError,
+ "cadata should be a contiguous buffer with "
+ "a single dimension");
+ goto error;
+ }
+ r = _add_ca_certs(self, buf.buf, buf.len, SSL_FILETYPE_ASN1);
+ PyBuffer_Release(&buf);
+ if (r == -1) {
+ goto error;
+ }
+ }
+ else {
+ invalid_cadata:
+ PyErr_SetString(PyExc_TypeError,
+ "cadata should be an ASCII string or a "
+ "bytes-like object");
+ goto error;
+ }
+ }
+
+ /* load cafile or capath */
+ if (cafile || capath) {
+ if (cafile)
+ cafile_buf = PyBytes_AS_STRING(cafile_bytes);
+ if (capath)
+ capath_buf = PyBytes_AS_STRING(capath_bytes);
+ PySSL_BEGIN_ALLOW_THREADS
+ r = SSL_CTX_load_verify_locations(self->ctx, cafile_buf, capath_buf);
+ PySSL_END_ALLOW_THREADS
+ if (r != 1) {
+ if (errno != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ ERR_clear_error();
+ }
+ else {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ }
+ goto error;
+ }
+ }
+ goto end;
+
+ error:
+ ok = 0;
+ end:
+ Py_XDECREF(cafile_bytes);
+ Py_XDECREF(capath_bytes);
+ if (ok) {
+ Py_RETURN_NONE;
+ } else {
+ return NULL;
+ }
+}
+
+/*[clinic input]
+_ssl._SSLContext.load_dh_params
+ path as filepath: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_load_dh_params(PySSLContext *self, PyObject *filepath)
+/*[clinic end generated code: output=1c8e57a38e055af0 input=c8871f3c796ae1d6]*/
+{
+ FILE *f;
+ DH *dh;
+
+ f = _Py_fopen_obj(filepath, "rb");
+ if (f == NULL)
+ return NULL;
+
+ errno = 0;
+ PySSL_BEGIN_ALLOW_THREADS
+ dh = PEM_read_DHparams(f, NULL, NULL, NULL);
+ fclose(f);
+ PySSL_END_ALLOW_THREADS
+ if (dh == NULL) {
+ if (errno != 0) {
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, filepath);
+ ERR_clear_error();
+ }
+ else {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ }
+ return NULL;
+ }
+ if (!SSL_CTX_set_tmp_dh(self->ctx, dh)) {
+ DH_free(dh);
+ return _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ }
+ DH_free(dh);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_ssl._SSLContext._wrap_socket
+ sock: object(subclass_of="get_state_ctx(self)->Sock_Type")
+ server_side: bool
+ server_hostname as hostname_obj: object = None
+ *
+ owner: object = None
+ session: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext__wrap_socket_impl(PySSLContext *self, PyObject *sock,
+ int server_side, PyObject *hostname_obj,
+ PyObject *owner, PyObject *session)
+/*[clinic end generated code: output=f103f238633940b4 input=700ca8fedff53994]*/
+{
+ char *hostname = NULL;
+ PyObject *res;
+
+ /* server_hostname is either None (or absent), or to be encoded
+ as IDN A-label (ASCII str) without NULL bytes. */
+ if (hostname_obj != Py_None) {
+ if (!PyArg_Parse(hostname_obj, "es", "ascii", &hostname))
+ return NULL;
+ }
+
+ res = (PyObject *) newPySSLSocket(self, (PySocketSockObject *)sock,
+ server_side, hostname,
+ owner, session,
+ NULL, NULL);
+ if (hostname != NULL)
+ PyMem_Free(hostname);
+ return res;
+}
+
+/*[clinic input]
+_ssl._SSLContext._wrap_bio
+ incoming: object(subclass_of="get_state_ctx(self)->PySSLMemoryBIO_Type", type="PySSLMemoryBIO *")
+ outgoing: object(subclass_of="get_state_ctx(self)->PySSLMemoryBIO_Type", type="PySSLMemoryBIO *")
+ server_side: bool
+ server_hostname as hostname_obj: object = None
+ *
+ owner: object = None
+ session: object = None
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext__wrap_bio_impl(PySSLContext *self, PySSLMemoryBIO *incoming,
+ PySSLMemoryBIO *outgoing, int server_side,
+ PyObject *hostname_obj, PyObject *owner,
+ PyObject *session)
+/*[clinic end generated code: output=5c5d6d9b41f99332 input=a9205d097fd45a82]*/
+{
+ char *hostname = NULL;
+ PyObject *res;
+
+ /* server_hostname is either None (or absent), or to be encoded
+ as IDN A-label (ASCII str) without NULL bytes. */
+ if (hostname_obj != Py_None) {
+ if (!PyArg_Parse(hostname_obj, "es", "ascii", &hostname))
+ return NULL;
+ }
+
+ res = (PyObject *) newPySSLSocket(self, NULL, server_side, hostname,
+ owner, session,
+ incoming, outgoing);
+
+ PyMem_Free(hostname);
+ return res;
+}
+
+/*[clinic input]
+_ssl._SSLContext.session_stats
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_session_stats_impl(PySSLContext *self)
+/*[clinic end generated code: output=0d96411c42893bfb input=7e0a81fb11102c8b]*/
+{
+ int r;
+ PyObject *value, *stats = PyDict_New();
+ if (!stats)
+ return NULL;
+
+#define ADD_STATS(SSL_NAME, KEY_NAME) \
+ value = PyLong_FromLong(SSL_CTX_sess_ ## SSL_NAME (self->ctx)); \
+ if (value == NULL) \
+ goto error; \
+ r = PyDict_SetItemString(stats, KEY_NAME, value); \
+ Py_DECREF(value); \
+ if (r < 0) \
+ goto error;
+
+ ADD_STATS(number, "number");
+ ADD_STATS(connect, "connect");
+ ADD_STATS(connect_good, "connect_good");
+ ADD_STATS(connect_renegotiate, "connect_renegotiate");
+ ADD_STATS(accept, "accept");
+ ADD_STATS(accept_good, "accept_good");
+ ADD_STATS(accept_renegotiate, "accept_renegotiate");
+ ADD_STATS(accept, "accept");
+ ADD_STATS(hits, "hits");
+ ADD_STATS(misses, "misses");
+ ADD_STATS(timeouts, "timeouts");
+ ADD_STATS(cache_full, "cache_full");
+
+#undef ADD_STATS
+
+ return stats;
+
+error:
+ Py_DECREF(stats);
+ return NULL;
+}
+
+/*[clinic input]
+_ssl._SSLContext.set_default_verify_paths
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self)
+/*[clinic end generated code: output=0bee74e6e09deaaa input=35f3408021463d74]*/
+{
+ int rc;
+ Py_BEGIN_ALLOW_THREADS
+ rc = SSL_CTX_set_default_verify_paths(self->ctx);
+ Py_END_ALLOW_THREADS
+ if (!rc) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_ssl._SSLContext.set_ecdh_curve
+ name: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_set_ecdh_curve(PySSLContext *self, PyObject *name)
+/*[clinic end generated code: output=23022c196e40d7d2 input=c2bafb6f6e34726b]*/
+{
+ PyObject *name_bytes;
+ int nid;
+ if (!PyUnicode_FSConverter(name, &name_bytes))
+ return NULL;
+ assert(PyBytes_Check(name_bytes));
+ nid = OBJ_sn2nid(PyBytes_AS_STRING(name_bytes));
+ Py_DECREF(name_bytes);
+ if (nid == 0) {
+ PyErr_Format(PyExc_ValueError,
+ "unknown elliptic curve name %R", name);
+ return NULL;
+ }
+#if OPENSSL_VERSION_MAJOR < 3
+ EC_KEY *key = EC_KEY_new_by_curve_name(nid);
+ if (key == NULL) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ SSL_CTX_set_tmp_ecdh(self->ctx, key);
+ EC_KEY_free(key);
+#else
+ if (!SSL_CTX_set1_groups(self->ctx, &nid, 1)) {
+ _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+#endif
+ Py_RETURN_NONE;
+}
+
+static int
+_servername_callback(SSL *s, int *al, void *args)
+{
+ int ret;
+ PySSLContext *sslctx = (PySSLContext *) args;
+ PySSLSocket *ssl;
+ PyObject *result;
+ /* The high-level ssl.SSLSocket object */
+ PyObject *ssl_socket;
+ const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
+ PyGILState_STATE gstate = PyGILState_Ensure();
+
+ if (sslctx->set_sni_cb == NULL) {
+ /* remove race condition in this the call back while if removing the
+ * callback is in progress */
+ PyGILState_Release(gstate);
+ return SSL_TLSEXT_ERR_OK;
+ }
+
+ ssl = SSL_get_app_data(s);
+ assert(Py_IS_TYPE(ssl, get_state_ctx(sslctx)->PySSLSocket_Type));
+
+ /* The servername callback expects an argument that represents the current
+ * SSL connection and that has a .context attribute that can be changed to
+ * identify the requested hostname. Since the official API is the Python
+ * level API we want to pass the callback a Python level object rather than
+ * a _ssl.SSLSocket instance. If there's an "owner" (typically an
+ * SSLObject) that will be passed. Otherwise if there's a socket then that
+ * will be passed. If both do not exist only then the C-level object is
+ * passed. */
+ if (ssl->owner)
+ ssl_socket = PyWeakref_GetObject(ssl->owner);
+ else if (ssl->Socket)
+ ssl_socket = PyWeakref_GetObject(ssl->Socket);
+ else
+ ssl_socket = (PyObject *) ssl;
+
+ Py_INCREF(ssl_socket);
+ if (ssl_socket == Py_None)
+ goto error;
+
+ if (servername == NULL) {
+ result = PyObject_CallFunctionObjArgs(sslctx->set_sni_cb, ssl_socket,
+ Py_None, sslctx, NULL);
+ }
+ else {
+ PyObject *servername_bytes;
+ PyObject *servername_str;
+
+ servername_bytes = PyBytes_FromString(servername);
+ if (servername_bytes == NULL) {
+ PyErr_WriteUnraisable((PyObject *) sslctx);
+ goto error;
+ }
+ /* server_hostname was encoded to an A-label by our caller; put it
+ * back into a str object, but still as an A-label (bpo-28414)
+ */
+ servername_str = PyUnicode_FromEncodedObject(servername_bytes, "ascii", NULL);
+ if (servername_str == NULL) {
+ PyErr_WriteUnraisable(servername_bytes);
+ Py_DECREF(servername_bytes);
+ goto error;
+ }
+ Py_DECREF(servername_bytes);
+ result = PyObject_CallFunctionObjArgs(
+ sslctx->set_sni_cb, ssl_socket, servername_str,
+ sslctx, NULL);
+ Py_DECREF(servername_str);
+ }
+ Py_DECREF(ssl_socket);
+
+ if (result == NULL) {
+ PyErr_WriteUnraisable(sslctx->set_sni_cb);
+ *al = SSL_AD_HANDSHAKE_FAILURE;
+ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+ else {
+ /* Result may be None, a SSLContext or an integer
+ * None and SSLContext are OK, integer or other values are an error.
+ */
+ if (result == Py_None) {
+ ret = SSL_TLSEXT_ERR_OK;
+ } else {
+ *al = (int) PyLong_AsLong(result);
+ if (PyErr_Occurred()) {
+ PyErr_WriteUnraisable(result);
+ *al = SSL_AD_INTERNAL_ERROR;
+ }
+ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+ Py_DECREF(result);
+ }
+
+ PyGILState_Release(gstate);
+ return ret;
+
+error:
+ Py_DECREF(ssl_socket);
+ *al = SSL_AD_INTERNAL_ERROR;
+ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
+ PyGILState_Release(gstate);
+ return ret;
+}
+
+static PyObject *
+get_sni_callback(PySSLContext *self, void *c)
+{
+ PyObject *cb = self->set_sni_cb;
+ if (cb == NULL) {
+ Py_RETURN_NONE;
+ }
+ return Py_NewRef(cb);
+}
+
+static int
+set_sni_callback(PySSLContext *self, PyObject *arg, void *c)
+{
+ if (self->protocol == PY_SSL_VERSION_TLS_CLIENT) {
+ PyErr_SetString(PyExc_ValueError,
+ "sni_callback cannot be set on TLS_CLIENT context");
+ return -1;
+ }
+ Py_CLEAR(self->set_sni_cb);
+ if (arg == Py_None) {
+ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
+ }
+ else {
+ if (!PyCallable_Check(arg)) {
+ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
+ PyErr_SetString(PyExc_TypeError,
+ "not a callable object");
+ return -1;
+ }
+ self->set_sni_cb = Py_NewRef(arg);
+ SSL_CTX_set_tlsext_servername_callback(self->ctx, _servername_callback);
+ SSL_CTX_set_tlsext_servername_arg(self->ctx, self);
+ }
+ return 0;
+}
+
+PyDoc_STRVAR(PySSLContext_sni_callback_doc,
+"Set a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.\n\
+\n\
+If the argument is None then the callback is disabled. The method is called\n\
+with the SSLSocket, the server name as a string, and the SSLContext object.\n\
+See RFC 6066 for details of the SNI extension.");
+
+/*[clinic input]
+_ssl._SSLContext.cert_store_stats
+
+Returns quantities of loaded X.509 certificates.
+
+X.509 certificates with a CA extension and certificate revocation lists
+inside the context's cert store.
+
+NOTE: Certificates in a capath directory aren't loaded unless they have
+been used at least once.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_cert_store_stats_impl(PySSLContext *self)
+/*[clinic end generated code: output=5f356f4d9cca874d input=eb40dd0f6d0e40cf]*/
+{
+ X509_STORE *store;
+ STACK_OF(X509_OBJECT) *objs;
+ X509_OBJECT *obj;
+ int x509 = 0, crl = 0, ca = 0, i;
+
+ store = SSL_CTX_get_cert_store(self->ctx);
+ objs = X509_STORE_get0_objects(store);
+ for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
+ obj = sk_X509_OBJECT_value(objs, i);
+ switch (X509_OBJECT_get_type(obj)) {
+ case X509_LU_X509:
+ x509++;
+ if (X509_check_ca(X509_OBJECT_get0_X509(obj))) {
+ ca++;
+ }
+ break;
+ case X509_LU_CRL:
+ crl++;
+ break;
+ default:
+ /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY.
+ * As far as I can tell they are internal states and never
+ * stored in a cert store */
+ break;
+ }
+ }
+ return Py_BuildValue("{sisisi}", "x509", x509, "crl", crl,
+ "x509_ca", ca);
+}
+
+/*[clinic input]
+_ssl._SSLContext.get_ca_certs
+ binary_form: bool = False
+
+Returns a list of dicts with information of loaded CA certs.
+
+If the optional argument is True, returns a DER-encoded copy of the CA
+certificate.
+
+NOTE: Certificates in a capath directory aren't loaded unless they have
+been used at least once.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl__SSLContext_get_ca_certs_impl(PySSLContext *self, int binary_form)
+/*[clinic end generated code: output=0d58f148f37e2938 input=6887b5a09b7f9076]*/
+{
+ X509_STORE *store;
+ STACK_OF(X509_OBJECT) *objs;
+ PyObject *ci = NULL, *rlist = NULL;
+ int i;
+
+ if ((rlist = PyList_New(0)) == NULL) {
+ return NULL;
+ }
+
+ store = SSL_CTX_get_cert_store(self->ctx);
+ objs = X509_STORE_get0_objects(store);
+ for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
+ X509_OBJECT *obj;
+ X509 *cert;
+
+ obj = sk_X509_OBJECT_value(objs, i);
+ if (X509_OBJECT_get_type(obj) != X509_LU_X509) {
+ /* not a x509 cert */
+ continue;
+ }
+ /* CA for any purpose */
+ cert = X509_OBJECT_get0_X509(obj);
+ if (!X509_check_ca(cert)) {
+ continue;
+ }
+ if (binary_form) {
+ ci = _certificate_to_der(get_state_ctx(self), cert);
+ } else {
+ ci = _decode_certificate(get_state_ctx(self), cert);
+ }
+ if (ci == NULL) {
+ goto error;
+ }
+ if (PyList_Append(rlist, ci) == -1) {
+ goto error;
+ }
+ Py_CLEAR(ci);
+ }
+ return rlist;
+
+ error:
+ Py_XDECREF(ci);
+ Py_XDECREF(rlist);
+ return NULL;
+}
+
+
+static PyGetSetDef context_getsetlist[] = {
+ {"check_hostname", (getter) get_check_hostname,
+ (setter) set_check_hostname, NULL},
+ {"_host_flags", (getter) get_host_flags,
+ (setter) set_host_flags, NULL},
+ {"minimum_version", (getter) get_minimum_version,
+ (setter) set_minimum_version, NULL},
+ {"maximum_version", (getter) get_maximum_version,
+ (setter) set_maximum_version, NULL},
+ {"keylog_filename", (getter) _PySSLContext_get_keylog_filename,
+ (setter) _PySSLContext_set_keylog_filename, NULL},
+ {"_msg_callback", (getter) _PySSLContext_get_msg_callback,
+ (setter) _PySSLContext_set_msg_callback, NULL},
+ {"sni_callback", (getter) get_sni_callback,
+ (setter) set_sni_callback, PySSLContext_sni_callback_doc},
+#ifdef TLS1_3_VERSION
+ {"num_tickets", (getter) get_num_tickets,
+ (setter) set_num_tickets, PySSLContext_num_tickets_doc},
+#endif
+ {"options", (getter) get_options,
+ (setter) set_options, NULL},
+ {"post_handshake_auth", (getter) get_post_handshake_auth,
+#ifdef TLS1_3_VERSION
+ (setter) set_post_handshake_auth,
+#else
+ NULL,
+#endif
+ NULL},
+ {"protocol", (getter) get_protocol,
+ NULL, NULL},
+ {"verify_flags", (getter) get_verify_flags,
+ (setter) set_verify_flags, NULL},
+ {"verify_mode", (getter) get_verify_mode,
+ (setter) set_verify_mode, NULL},
+ {"security_level", (getter) get_security_level,
+ NULL, PySSLContext_security_level_doc},
+ {NULL}, /* sentinel */
+};
+
+static struct PyMethodDef context_methods[] = {
+ _SSL__SSLCONTEXT__WRAP_SOCKET_METHODDEF
+ _SSL__SSLCONTEXT__WRAP_BIO_METHODDEF
+ _SSL__SSLCONTEXT_SET_CIPHERS_METHODDEF
+ _SSL__SSLCONTEXT__SET_ALPN_PROTOCOLS_METHODDEF
+ _SSL__SSLCONTEXT_LOAD_CERT_CHAIN_METHODDEF
+ _SSL__SSLCONTEXT_LOAD_DH_PARAMS_METHODDEF
+ _SSL__SSLCONTEXT_LOAD_VERIFY_LOCATIONS_METHODDEF
+ _SSL__SSLCONTEXT_SESSION_STATS_METHODDEF
+ _SSL__SSLCONTEXT_SET_DEFAULT_VERIFY_PATHS_METHODDEF
+ _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF
+ _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF
+ _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF
+ _SSL__SSLCONTEXT_GET_CIPHERS_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot PySSLContext_slots[] = {
+ {Py_tp_methods, context_methods},
+ {Py_tp_getset, context_getsetlist},
+ {Py_tp_new, _ssl__SSLContext},
+ {Py_tp_dealloc, context_dealloc},
+ {Py_tp_traverse, context_traverse},
+ {Py_tp_clear, context_clear},
+ {0, 0},
+};
+
+static PyType_Spec PySSLContext_spec = {
+ .name = "_ssl._SSLContext",
+ .basicsize = sizeof(PySSLContext),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = PySSLContext_slots,
+};
+
+
+/*
+ * MemoryBIO objects
+ */
+
+/*[clinic input]
+@classmethod
+_ssl.MemoryBIO.__new__
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_MemoryBIO_impl(PyTypeObject *type)
+/*[clinic end generated code: output=8820a58db78330ac input=26d22e4909ecb1b5]*/
+{
+ BIO *bio;
+ PySSLMemoryBIO *self;
+
+ bio = BIO_new(BIO_s_mem());
+ if (bio == NULL) {
+ PyErr_SetString(PyExc_MemoryError, "failed to allocate BIO");
+ return NULL;
+ }
+ /* Since our BIO is non-blocking an empty read() does not indicate EOF,
+ * just that no data is currently available. The SSL routines should retry
+ * the read, which we can achieve by calling BIO_set_retry_read(). */
+ BIO_set_retry_read(bio);
+ BIO_set_mem_eof_return(bio, -1);
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ self = (PySSLMemoryBIO *) type->tp_alloc(type, 0);
+ if (self == NULL) {
+ BIO_free(bio);
+ return NULL;
+ }
+ self->bio = bio;
+ self->eof_written = 0;
+
+ return (PyObject *) self;
+}
+
+static int
+memory_bio_traverse(PySSLMemoryBIO *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+memory_bio_dealloc(PySSLMemoryBIO *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ BIO_free(self->bio);
+ Py_TYPE(self)->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+memory_bio_get_pending(PySSLMemoryBIO *self, void *c)
+{
+ return PyLong_FromSize_t(BIO_ctrl_pending(self->bio));
+}
+
+PyDoc_STRVAR(PySSL_memory_bio_pending_doc,
+"The number of bytes pending in the memory BIO.");
+
+static PyObject *
+memory_bio_get_eof(PySSLMemoryBIO *self, void *c)
+{
+ return PyBool_FromLong((BIO_ctrl_pending(self->bio) == 0)
+ && self->eof_written);
+}
+
+PyDoc_STRVAR(PySSL_memory_bio_eof_doc,
+"Whether the memory BIO is at EOF.");
+
+/*[clinic input]
+_ssl.MemoryBIO.read
+ size as len: int = -1
+ /
+
+Read up to size bytes from the memory BIO.
+
+If size is not specified, read the entire buffer.
+If the return value is an empty bytes instance, this means either
+EOF or that no data is available. Use the "eof" property to
+distinguish between the two.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len)
+/*[clinic end generated code: output=a657aa1e79cd01b3 input=574d7be06a902366]*/
+{
+ int avail, nbytes;
+ PyObject *result;
+
+ avail = (int)Py_MIN(BIO_ctrl_pending(self->bio), INT_MAX);
+ if ((len < 0) || (len > avail))
+ len = avail;
+
+ result = PyBytes_FromStringAndSize(NULL, len);
+ if ((result == NULL) || (len == 0))
+ return result;
+
+ nbytes = BIO_read(self->bio, PyBytes_AS_STRING(result), len);
+ if (nbytes < 0) {
+ _sslmodulestate *state = get_state_mbio(self);
+ Py_DECREF(result);
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+
+ /* There should never be any short reads but check anyway. */
+ if (nbytes < len) {
+ _PyBytes_Resize(&result, nbytes);
+ }
+
+ return result;
+}
+
+/*[clinic input]
+_ssl.MemoryBIO.write
+ b: Py_buffer
+ /
+
+Writes the bytes b into the memory BIO.
+
+Returns the number of bytes written.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_MemoryBIO_write_impl(PySSLMemoryBIO *self, Py_buffer *b)
+/*[clinic end generated code: output=156ec59110d75935 input=e45757b3e17c4808]*/
+{
+ int nbytes;
+
+ if (b->len > INT_MAX) {
+ PyErr_Format(PyExc_OverflowError,
+ "string longer than %d bytes", INT_MAX);
+ return NULL;
+ }
+
+ if (self->eof_written) {
+ PyObject *module = PyType_GetModule(Py_TYPE(self));
+ if (module == NULL)
+ return NULL;
+ PyErr_SetString(get_ssl_state(module)->PySSLErrorObject,
+ "cannot write() after write_eof()");
+ return NULL;
+ }
+
+ nbytes = BIO_write(self->bio, b->buf, (int)b->len);
+ if (nbytes < 0) {
+ _sslmodulestate *state = get_state_mbio(self);
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+
+ return PyLong_FromLong(nbytes);
+}
+
+/*[clinic input]
+_ssl.MemoryBIO.write_eof
+
+Write an EOF marker to the memory BIO.
+
+When all data has been read, the "eof" property will be True.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_MemoryBIO_write_eof_impl(PySSLMemoryBIO *self)
+/*[clinic end generated code: output=d4106276ccd1ed34 input=56a945f1d29e8bd6]*/
+{
+ self->eof_written = 1;
+ /* After an EOF is written, a zero return from read() should be a real EOF
+ * i.e. it should not be retried. Clear the SHOULD_RETRY flag. */
+ BIO_clear_retry_flags(self->bio);
+ BIO_set_mem_eof_return(self->bio, 0);
+
+ Py_RETURN_NONE;
+}
+
+static PyGetSetDef memory_bio_getsetlist[] = {
+ {"pending", (getter) memory_bio_get_pending, NULL,
+ PySSL_memory_bio_pending_doc},
+ {"eof", (getter) memory_bio_get_eof, NULL,
+ PySSL_memory_bio_eof_doc},
+ {NULL}, /* sentinel */
+};
+
+static struct PyMethodDef memory_bio_methods[] = {
+ _SSL_MEMORYBIO_READ_METHODDEF
+ _SSL_MEMORYBIO_WRITE_METHODDEF
+ _SSL_MEMORYBIO_WRITE_EOF_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot PySSLMemoryBIO_slots[] = {
+ {Py_tp_methods, memory_bio_methods},
+ {Py_tp_getset, memory_bio_getsetlist},
+ {Py_tp_new, _ssl_MemoryBIO},
+ {Py_tp_dealloc, memory_bio_dealloc},
+ {Py_tp_traverse, memory_bio_traverse},
+ {0, 0},
+};
+
+static PyType_Spec PySSLMemoryBIO_spec = {
+ .name = "_ssl.MemoryBIO",
+ .basicsize = sizeof(PySSLMemoryBIO),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_HAVE_GC),
+ .slots = PySSLMemoryBIO_slots,
+};
+
+/*
+ * SSL Session object
+ */
+
+static void
+PySSLSession_dealloc(PySSLSession *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyObject_GC_UnTrack(self);
+ Py_XDECREF(self->ctx);
+ if (self->session != NULL) {
+ SSL_SESSION_free(self->session);
+ }
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+PySSLSession_richcompare(PyObject *left, PyObject *right, int op)
+{
+ int result;
+ PyTypeObject *sesstype = ((PySSLSession*)left)->ctx->state->PySSLSession_Type;
+
+ if (left == NULL || right == NULL) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
+ if (!Py_IS_TYPE(left, sesstype) || !Py_IS_TYPE(right, sesstype)) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+ if (left == right) {
+ result = 0;
+ } else {
+ const unsigned char *left_id, *right_id;
+ unsigned int left_len, right_len;
+ left_id = SSL_SESSION_get_id(((PySSLSession *)left)->session,
+ &left_len);
+ right_id = SSL_SESSION_get_id(((PySSLSession *)right)->session,
+ &right_len);
+ if (left_len == right_len) {
+ result = memcmp(left_id, right_id, left_len);
+ } else {
+ result = 1;
+ }
+ }
+
+ switch (op) {
+ case Py_EQ:
+ if (result == 0) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ break;
+ case Py_NE:
+ if (result != 0) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ break;
+ case Py_LT:
+ case Py_LE:
+ case Py_GT:
+ case Py_GE:
+ Py_RETURN_NOTIMPLEMENTED;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+}
+
+static int
+PySSLSession_traverse(PySSLSession *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->ctx);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static int
+PySSLSession_clear(PySSLSession *self)
+{
+ Py_CLEAR(self->ctx);
+ return 0;
+}
+
+
+static PyObject *
+PySSLSession_get_time(PySSLSession *self, void *closure) {
+ return PyLong_FromLong(SSL_SESSION_get_time(self->session));
+}
+
+PyDoc_STRVAR(PySSLSession_get_time_doc,
+"Session creation time (seconds since epoch).");
+
+
+static PyObject *
+PySSLSession_get_timeout(PySSLSession *self, void *closure) {
+ return PyLong_FromLong(SSL_SESSION_get_timeout(self->session));
+}
+
+PyDoc_STRVAR(PySSLSession_get_timeout_doc,
+"Session timeout (delta in seconds).");
+
+
+static PyObject *
+PySSLSession_get_ticket_lifetime_hint(PySSLSession *self, void *closure) {
+ unsigned long hint = SSL_SESSION_get_ticket_lifetime_hint(self->session);
+ return PyLong_FromUnsignedLong(hint);
+}
+
+PyDoc_STRVAR(PySSLSession_get_ticket_lifetime_hint_doc,
+"Ticket life time hint.");
+
+
+static PyObject *
+PySSLSession_get_session_id(PySSLSession *self, void *closure) {
+ const unsigned char *id;
+ unsigned int len;
+ id = SSL_SESSION_get_id(self->session, &len);
+ return PyBytes_FromStringAndSize((const char *)id, len);
+}
+
+PyDoc_STRVAR(PySSLSession_get_session_id_doc,
+"Session id");
+
+
+static PyObject *
+PySSLSession_get_has_ticket(PySSLSession *self, void *closure) {
+ if (SSL_SESSION_has_ticket(self->session)) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
+PyDoc_STRVAR(PySSLSession_get_has_ticket_doc,
+"Does the session contain a ticket?");
+
+
+static PyGetSetDef PySSLSession_getsetlist[] = {
+ {"has_ticket", (getter) PySSLSession_get_has_ticket, NULL,
+ PySSLSession_get_has_ticket_doc},
+ {"id", (getter) PySSLSession_get_session_id, NULL,
+ PySSLSession_get_session_id_doc},
+ {"ticket_lifetime_hint", (getter) PySSLSession_get_ticket_lifetime_hint,
+ NULL, PySSLSession_get_ticket_lifetime_hint_doc},
+ {"time", (getter) PySSLSession_get_time, NULL,
+ PySSLSession_get_time_doc},
+ {"timeout", (getter) PySSLSession_get_timeout, NULL,
+ PySSLSession_get_timeout_doc},
+ {NULL}, /* sentinel */
+};
+
+static PyType_Slot PySSLSession_slots[] = {
+ {Py_tp_getset,PySSLSession_getsetlist},
+ {Py_tp_richcompare, PySSLSession_richcompare},
+ {Py_tp_dealloc, PySSLSession_dealloc},
+ {Py_tp_traverse, PySSLSession_traverse},
+ {Py_tp_clear, PySSLSession_clear},
+ {0, 0},
+};
+
+static PyType_Spec PySSLSession_spec = {
+ .name = "_ssl.SSLSession",
+ .basicsize = sizeof(PySSLSession),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ .slots = PySSLSession_slots,
+};
+
+
+/* helper routines for seeding the SSL PRNG */
+/*[clinic input]
+_ssl.RAND_add
+ string as view: Py_buffer(accept={str, buffer})
+ entropy: double
+ /
+
+Mix string into the OpenSSL PRNG state.
+
+entropy (a float) is a lower bound on the entropy contained in
+string. See RFC 4086.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_RAND_add_impl(PyObject *module, Py_buffer *view, double entropy)
+/*[clinic end generated code: output=e6dd48df9c9024e9 input=5c33017422828f5c]*/
+{
+ const char *buf;
+ Py_ssize_t len, written;
+
+ buf = (const char *)view->buf;
+ len = view->len;
+ do {
+ written = Py_MIN(len, INT_MAX);
+ RAND_add(buf, (int)written, entropy);
+ buf += written;
+ len -= written;
+ } while (len);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+PySSL_RAND(PyObject *module, int len, int pseudo)
+{
+ int ok;
+ PyObject *bytes;
+ unsigned long err;
+ const char *errstr;
+ PyObject *v;
+
+ if (len < 0) {
+ PyErr_SetString(PyExc_ValueError, "num must be positive");
+ return NULL;
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, len);
+ if (bytes == NULL)
+ return NULL;
+ if (pseudo) {
+ ok = RAND_bytes((unsigned char*)PyBytes_AS_STRING(bytes), len);
+ if (ok == 0 || ok == 1)
+ return Py_BuildValue("NO", bytes, ok == 1 ? Py_True : Py_False);
+ }
+ else {
+ ok = RAND_bytes((unsigned char*)PyBytes_AS_STRING(bytes), len);
+ if (ok == 1)
+ return bytes;
+ }
+ Py_DECREF(bytes);
+
+ err = ERR_get_error();
+ errstr = ERR_reason_error_string(err);
+ v = Py_BuildValue("(ks)", err, errstr);
+ if (v != NULL) {
+ PyErr_SetObject(get_ssl_state(module)->PySSLErrorObject, v);
+ Py_DECREF(v);
+ }
+ return NULL;
+}
+
+/*[clinic input]
+_ssl.RAND_bytes
+ n: int
+ /
+
+Generate n cryptographically strong pseudo-random bytes.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_RAND_bytes_impl(PyObject *module, int n)
+/*[clinic end generated code: output=977da635e4838bc7 input=678ddf2872dfebfc]*/
+{
+ return PySSL_RAND(module, n, 0);
+}
+
+
+/*[clinic input]
+_ssl.RAND_status
+
+Returns True if the OpenSSL PRNG has been seeded with enough data and False if not.
+
+It is necessary to seed the PRNG with RAND_add() on some platforms before
+using the ssl() function.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_RAND_status_impl(PyObject *module)
+/*[clinic end generated code: output=7e0aaa2d39fdc1ad input=d5ae5aea52f36e01]*/
+{
+ return PyBool_FromLong(RAND_status());
+}
+
+/*[clinic input]
+_ssl.get_default_verify_paths
+
+Return search paths and environment vars that are used by SSLContext's set_default_verify_paths() to load default CAs.
+
+The values are 'cert_file_env', 'cert_file', 'cert_dir_env', 'cert_dir'.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_get_default_verify_paths_impl(PyObject *module)
+/*[clinic end generated code: output=e5b62a466271928b input=5210c953d98c3eb5]*/
+{
+ PyObject *ofile_env = NULL;
+ PyObject *ofile = NULL;
+ PyObject *odir_env = NULL;
+ PyObject *odir = NULL;
+
+#define CONVERT(info, target) { \
+ const char *tmp = (info); \
+ target = NULL; \
+ if (!tmp) { target = Py_NewRef(Py_None); } \
+ else if ((target = PyUnicode_DecodeFSDefault(tmp)) == NULL) { \
+ target = PyBytes_FromString(tmp); } \
+ if (!target) goto error; \
+ }
+
+ CONVERT(X509_get_default_cert_file_env(), ofile_env);
+ CONVERT(X509_get_default_cert_file(), ofile);
+ CONVERT(X509_get_default_cert_dir_env(), odir_env);
+ CONVERT(X509_get_default_cert_dir(), odir);
+#undef CONVERT
+
+ return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);
+
+ error:
+ Py_XDECREF(ofile_env);
+ Py_XDECREF(ofile);
+ Py_XDECREF(odir_env);
+ Py_XDECREF(odir);
+ return NULL;
+}
+
+static PyObject*
+asn1obj2py(_sslmodulestate *state, ASN1_OBJECT *obj)
+{
+ int nid;
+ const char *ln, *sn;
+
+ nid = OBJ_obj2nid(obj);
+ if (nid == NID_undef) {
+ PyErr_Format(PyExc_ValueError, "Unknown object");
+ return NULL;
+ }
+ sn = OBJ_nid2sn(nid);
+ ln = OBJ_nid2ln(nid);
+ return Py_BuildValue("issN", nid, sn, ln, _asn1obj2py(state, obj, 1));
+}
+
+/*[clinic input]
+_ssl.txt2obj
+ txt: str
+ name: bool = False
+
+Lookup NID, short name, long name and OID of an ASN1_OBJECT.
+
+By default objects are looked up by OID. With name=True short and
+long name are also matched.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_txt2obj_impl(PyObject *module, const char *txt, int name)
+/*[clinic end generated code: output=c38e3991347079c1 input=1c1e7d0aa7c48602]*/
+{
+ PyObject *result = NULL;
+ ASN1_OBJECT *obj;
+
+ obj = OBJ_txt2obj(txt, name ? 0 : 1);
+ if (obj == NULL) {
+ PyErr_Format(PyExc_ValueError, "unknown object '%.100s'", txt);
+ return NULL;
+ }
+ result = asn1obj2py(get_ssl_state(module), obj);
+ ASN1_OBJECT_free(obj);
+ return result;
+}
+
+/*[clinic input]
+_ssl.nid2obj
+ nid: int
+ /
+
+Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_nid2obj_impl(PyObject *module, int nid)
+/*[clinic end generated code: output=4a98ab691cd4f84a input=51787a3bee7d8f98]*/
+{
+ PyObject *result = NULL;
+ ASN1_OBJECT *obj;
+
+ if (nid < NID_undef) {
+ PyErr_SetString(PyExc_ValueError, "NID must be positive.");
+ return NULL;
+ }
+ obj = OBJ_nid2obj(nid);
+ if (obj == NULL) {
+ PyErr_Format(PyExc_ValueError, "unknown NID %i", nid);
+ return NULL;
+ }
+ result = asn1obj2py(get_ssl_state(module), obj);
+ ASN1_OBJECT_free(obj);
+ return result;
+}
+
+#ifdef _MSC_VER
+
+static PyObject*
+certEncodingType(DWORD encodingType)
+{
+ static PyObject *x509_asn = NULL;
+ static PyObject *pkcs_7_asn = NULL;
+
+ if (x509_asn == NULL) {
+ x509_asn = PyUnicode_InternFromString("x509_asn");
+ if (x509_asn == NULL)
+ return NULL;
+ }
+ if (pkcs_7_asn == NULL) {
+ pkcs_7_asn = PyUnicode_InternFromString("pkcs_7_asn");
+ if (pkcs_7_asn == NULL)
+ return NULL;
+ }
+ switch(encodingType) {
+ case X509_ASN_ENCODING:
+ return Py_NewRef(x509_asn);
+ case PKCS_7_ASN_ENCODING:
+ return Py_NewRef(pkcs_7_asn);
+ default:
+ return PyLong_FromLong(encodingType);
+ }
+}
+
+static PyObject*
+parseKeyUsage(PCCERT_CONTEXT pCertCtx, DWORD flags)
+{
+ CERT_ENHKEY_USAGE *usage;
+ DWORD size, error, i;
+ PyObject *retval;
+
+ if (!CertGetEnhancedKeyUsage(pCertCtx, flags, NULL, &size)) {
+ error = GetLastError();
+ if (error == CRYPT_E_NOT_FOUND) {
+ Py_RETURN_TRUE;
+ }
+ return PyErr_SetFromWindowsErr(error);
+ }
+
+ usage = (CERT_ENHKEY_USAGE*)PyMem_Malloc(size);
+ if (usage == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ /* Now get the actual enhanced usage property */
+ if (!CertGetEnhancedKeyUsage(pCertCtx, flags, usage, &size)) {
+ PyMem_Free(usage);
+ error = GetLastError();
+ if (error == CRYPT_E_NOT_FOUND) {
+ Py_RETURN_TRUE;
+ }
+ return PyErr_SetFromWindowsErr(error);
+ }
+ retval = PyFrozenSet_New(NULL);
+ if (retval == NULL) {
+ goto error;
+ }
+ for (i = 0; i < usage->cUsageIdentifier; ++i) {
+ if (usage->rgpszUsageIdentifier[i]) {
+ PyObject *oid;
+ int err;
+ oid = PyUnicode_FromString(usage->rgpszUsageIdentifier[i]);
+ if (oid == NULL) {
+ Py_CLEAR(retval);
+ goto error;
+ }
+ err = PySet_Add(retval, oid);
+ Py_DECREF(oid);
+ if (err == -1) {
+ Py_CLEAR(retval);
+ goto error;
+ }
+ }
+ }
+ error:
+ PyMem_Free(usage);
+ return retval;
+}
+
+static HCERTSTORE
+ssl_collect_certificates(const char *store_name)
+{
+/* this function collects the system certificate stores listed in
+ * system_stores into a collection certificate store for being
+ * enumerated. The store must be readable to be added to the
+ * store collection.
+ */
+
+ HCERTSTORE hCollectionStore = NULL, hSystemStore = NULL;
+ static DWORD system_stores[] = {
+ CERT_SYSTEM_STORE_LOCAL_MACHINE,
+ CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE,
+ CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY,
+ CERT_SYSTEM_STORE_CURRENT_USER,
+ CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY,
+ CERT_SYSTEM_STORE_SERVICES,
+ CERT_SYSTEM_STORE_USERS};
+ size_t i, storesAdded;
+ BOOL result;
+
+ hCollectionStore = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0,
+ (HCRYPTPROV)NULL, 0, NULL);
+ if (!hCollectionStore) {
+ return NULL;
+ }
+ storesAdded = 0;
+ for (i = 0; i < sizeof(system_stores) / sizeof(DWORD); i++) {
+ hSystemStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0,
+ (HCRYPTPROV)NULL,
+ CERT_STORE_READONLY_FLAG |
+ system_stores[i], store_name);
+ if (hSystemStore) {
+ result = CertAddStoreToCollection(hCollectionStore, hSystemStore,
+ CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 0);
+ if (result) {
+ ++storesAdded;
+ }
+ CertCloseStore(hSystemStore, 0); /* flag must be 0 */
+ }
+ }
+ if (storesAdded == 0) {
+ CertCloseStore(hCollectionStore, CERT_CLOSE_STORE_FORCE_FLAG);
+ return NULL;
+ }
+
+ return hCollectionStore;
+}
+
+/*[clinic input]
+_ssl.enum_certificates
+ store_name: str
+
+Retrieve certificates from Windows' cert store.
+
+store_name may be one of 'CA', 'ROOT' or 'MY'. The system may provide
+more cert storages, too. The function returns a list of (bytes,
+encoding_type, trust) tuples. The encoding_type flag can be interpreted
+with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The trust setting is either
+a set of OIDs or the boolean True.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_enum_certificates_impl(PyObject *module, const char *store_name)
+/*[clinic end generated code: output=5134dc8bb3a3c893 input=915f60d70461ea4e]*/
+{
+ HCERTSTORE hCollectionStore = NULL;
+ PCCERT_CONTEXT pCertCtx = NULL;
+ PyObject *keyusage = NULL, *cert = NULL, *enc = NULL, *tup = NULL;
+ PyObject *result = NULL;
+
+ result = PySet_New(NULL);
+ if (result == NULL) {
+ return NULL;
+ }
+ hCollectionStore = ssl_collect_certificates(store_name);
+ if (hCollectionStore == NULL) {
+ Py_DECREF(result);
+ return PyErr_SetFromWindowsErr(GetLastError());
+ }
+
+ while (pCertCtx = CertEnumCertificatesInStore(hCollectionStore, pCertCtx)) {
+ cert = PyBytes_FromStringAndSize((const char*)pCertCtx->pbCertEncoded,
+ pCertCtx->cbCertEncoded);
+ if (!cert) {
+ Py_CLEAR(result);
+ break;
+ }
+ if ((enc = certEncodingType(pCertCtx->dwCertEncodingType)) == NULL) {
+ Py_CLEAR(result);
+ break;
+ }
+ keyusage = parseKeyUsage(pCertCtx, CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG);
+ if (keyusage == Py_True) {
+ Py_DECREF(keyusage);
+ keyusage = parseKeyUsage(pCertCtx, CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG);
+ }
+ if (keyusage == NULL) {
+ Py_CLEAR(result);
+ break;
+ }
+ if ((tup = PyTuple_New(3)) == NULL) {
+ Py_CLEAR(result);
+ break;
+ }
+ PyTuple_SET_ITEM(tup, 0, cert);
+ cert = NULL;
+ PyTuple_SET_ITEM(tup, 1, enc);
+ enc = NULL;
+ PyTuple_SET_ITEM(tup, 2, keyusage);
+ keyusage = NULL;
+ if (PySet_Add(result, tup) == -1) {
+ Py_CLEAR(result);
+ Py_CLEAR(tup);
+ break;
+ }
+ Py_CLEAR(tup);
+ }
+ if (pCertCtx) {
+ /* loop ended with an error, need to clean up context manually */
+ CertFreeCertificateContext(pCertCtx);
+ }
+
+ /* In error cases cert, enc and tup may not be NULL */
+ Py_XDECREF(cert);
+ Py_XDECREF(enc);
+ Py_XDECREF(keyusage);
+ Py_XDECREF(tup);
+
+ /* CERT_CLOSE_STORE_FORCE_FLAG forces freeing of memory for all contexts
+ associated with the store, in this case our collection store and the
+ associated system stores. */
+ if (!CertCloseStore(hCollectionStore, CERT_CLOSE_STORE_FORCE_FLAG)) {
+ /* This error case might shadow another exception.*/
+ Py_XDECREF(result);
+ return PyErr_SetFromWindowsErr(GetLastError());
+ }
+
+ /* convert set to list */
+ if (result == NULL) {
+ return NULL;
+ } else {
+ PyObject *lst = PySequence_List(result);
+ Py_DECREF(result);
+ return lst;
+ }
+}
+
+/*[clinic input]
+_ssl.enum_crls
+ store_name: str
+
+Retrieve CRLs from Windows' cert store.
+
+store_name may be one of 'CA', 'ROOT' or 'MY'. The system may provide
+more cert storages, too. The function returns a list of (bytes,
+encoding_type) tuples. The encoding_type flag can be interpreted with
+X509_ASN_ENCODING or PKCS_7_ASN_ENCODING.
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_enum_crls_impl(PyObject *module, const char *store_name)
+/*[clinic end generated code: output=bce467f60ccd03b6 input=a1f1d7629f1c5d3d]*/
+{
+ HCERTSTORE hCollectionStore = NULL;
+ PCCRL_CONTEXT pCrlCtx = NULL;
+ PyObject *crl = NULL, *enc = NULL, *tup = NULL;
+ PyObject *result = NULL;
+
+ result = PySet_New(NULL);
+ if (result == NULL) {
+ return NULL;
+ }
+ hCollectionStore = ssl_collect_certificates(store_name);
+ if (hCollectionStore == NULL) {
+ Py_DECREF(result);
+ return PyErr_SetFromWindowsErr(GetLastError());
+ }
+
+ while (pCrlCtx = CertEnumCRLsInStore(hCollectionStore, pCrlCtx)) {
+ crl = PyBytes_FromStringAndSize((const char*)pCrlCtx->pbCrlEncoded,
+ pCrlCtx->cbCrlEncoded);
+ if (!crl) {
+ Py_CLEAR(result);
+ break;
+ }
+ if ((enc = certEncodingType(pCrlCtx->dwCertEncodingType)) == NULL) {
+ Py_CLEAR(result);
+ break;
+ }
+ if ((tup = PyTuple_New(2)) == NULL) {
+ Py_CLEAR(result);
+ break;
+ }
+ PyTuple_SET_ITEM(tup, 0, crl);
+ crl = NULL;
+ PyTuple_SET_ITEM(tup, 1, enc);
+ enc = NULL;
+
+ if (PySet_Add(result, tup) == -1) {
+ Py_CLEAR(result);
+ Py_CLEAR(tup);
+ break;
+ }
+ Py_CLEAR(tup);
+ }
+ if (pCrlCtx) {
+ /* loop ended with an error, need to clean up context manually */
+ CertFreeCRLContext(pCrlCtx);
+ }
+
+ /* In error cases cert, enc and tup may not be NULL */
+ Py_XDECREF(crl);
+ Py_XDECREF(enc);
+ Py_XDECREF(tup);
+
+ /* CERT_CLOSE_STORE_FORCE_FLAG forces freeing of memory for all contexts
+ associated with the store, in this case our collection store and the
+ associated system stores. */
+ if (!CertCloseStore(hCollectionStore, CERT_CLOSE_STORE_FORCE_FLAG)) {
+ /* This error case might shadow another exception.*/
+ Py_XDECREF(result);
+ return PyErr_SetFromWindowsErr(GetLastError());
+ }
+ /* convert set to list */
+ if (result == NULL) {
+ return NULL;
+ } else {
+ PyObject *lst = PySequence_List(result);
+ Py_DECREF(result);
+ return lst;
+ }
+}
+
+#endif /* _MSC_VER */
+
+/* List of functions exported by this module. */
+static PyMethodDef PySSL_methods[] = {
+ _SSL__TEST_DECODE_CERT_METHODDEF
+ _SSL_RAND_ADD_METHODDEF
+ _SSL_RAND_BYTES_METHODDEF
+ _SSL_RAND_STATUS_METHODDEF
+ _SSL_GET_DEFAULT_VERIFY_PATHS_METHODDEF
+ _SSL_ENUM_CERTIFICATES_METHODDEF
+ _SSL_ENUM_CRLS_METHODDEF
+ _SSL_TXT2OBJ_METHODDEF
+ _SSL_NID2OBJ_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+
+PyDoc_STRVAR(module_doc,
+"Implementation module for SSL socket operations. See the socket module\n\
+for documentation.");
+
+static int
+sslmodule_init_exceptions(PyObject *module)
+{
+ _sslmodulestate *state = get_ssl_state(module);
+ PyObject *bases = NULL;
+
+#define add_exception(exc, name, doc, base) \
+do { \
+ (exc) = PyErr_NewExceptionWithDoc("ssl." name, (doc), (base), NULL); \
+ if ((state) == NULL) goto error; \
+ if (PyModule_AddObjectRef(module, name, exc) < 0) goto error; \
+} while(0)
+
+ state->PySSLErrorObject = PyType_FromSpecWithBases(
+ &sslerror_type_spec, PyExc_OSError);
+ if (state->PySSLErrorObject == NULL) {
+ goto error;
+ }
+ if (PyModule_AddObjectRef(module, "SSLError", state->PySSLErrorObject) < 0) {
+ goto error;
+ }
+
+ /* ssl.CertificateError used to be a subclass of ValueError */
+ bases = PyTuple_Pack(2, state->PySSLErrorObject, PyExc_ValueError);
+ if (bases == NULL) {
+ goto error;
+ }
+ add_exception(
+ state->PySSLCertVerificationErrorObject,
+ "SSLCertVerificationError",
+ SSLCertVerificationError_doc,
+ bases
+ );
+ Py_CLEAR(bases);
+
+ add_exception(
+ state->PySSLZeroReturnErrorObject,
+ "SSLZeroReturnError",
+ SSLZeroReturnError_doc,
+ state->PySSLErrorObject
+ );
+
+ add_exception(
+ state->PySSLWantWriteErrorObject,
+ "SSLWantWriteError",
+ SSLWantWriteError_doc,
+ state->PySSLErrorObject
+ );
+
+ add_exception(
+ state->PySSLWantReadErrorObject,
+ "SSLWantReadError",
+ SSLWantReadError_doc,
+ state->PySSLErrorObject
+ );
+
+ add_exception(
+ state->PySSLSyscallErrorObject,
+ "SSLSyscallError",
+ SSLSyscallError_doc,
+ state->PySSLErrorObject
+ );
+
+ add_exception(
+ state->PySSLEOFErrorObject,
+ "SSLEOFError",
+ SSLEOFError_doc,
+ state->PySSLErrorObject
+ );
+#undef add_exception
+
+ return 0;
+ error:
+ Py_XDECREF(bases);
+ return -1;
+}
+
+static int
+sslmodule_init_socketapi(PyObject *module)
+{
+ _sslmodulestate *state = get_ssl_state(module);
+ PySocketModule_APIObject *sockmod = PySocketModule_ImportModuleAndAPI();
+
+ if ((sockmod == NULL) || (sockmod->Sock_Type == NULL)) {
+ return -1;
+ }
+ state->Sock_Type = (PyTypeObject*)Py_NewRef(sockmod->Sock_Type);
+ return 0;
+}
+
+
+static int
+sslmodule_add_option(PyObject *m, const char *name, uint64_t value)
+{
+ Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(value));
+ PyObject *obj = PyLong_FromUnsignedLongLong(value);
+ if (obj == NULL) {
+ return -1;
+ }
+ int res = PyModule_AddObjectRef(m, name, obj);
+ Py_DECREF(obj);
+ return res;
+}
+
+
+static int
+sslmodule_init_constants(PyObject *m)
+{
+ PyModule_AddStringConstant(m, "_DEFAULT_CIPHERS",
+ PY_SSL_DEFAULT_CIPHER_STRING);
+
+ PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN",
+ PY_SSL_ERROR_ZERO_RETURN);
+ PyModule_AddIntConstant(m, "SSL_ERROR_WANT_READ",
+ PY_SSL_ERROR_WANT_READ);
+ PyModule_AddIntConstant(m, "SSL_ERROR_WANT_WRITE",
+ PY_SSL_ERROR_WANT_WRITE);
+ PyModule_AddIntConstant(m, "SSL_ERROR_WANT_X509_LOOKUP",
+ PY_SSL_ERROR_WANT_X509_LOOKUP);
+ PyModule_AddIntConstant(m, "SSL_ERROR_SYSCALL",
+ PY_SSL_ERROR_SYSCALL);
+ PyModule_AddIntConstant(m, "SSL_ERROR_SSL",
+ PY_SSL_ERROR_SSL);
+ PyModule_AddIntConstant(m, "SSL_ERROR_WANT_CONNECT",
+ PY_SSL_ERROR_WANT_CONNECT);
+ /* non ssl.h errorcodes */
+ PyModule_AddIntConstant(m, "SSL_ERROR_EOF",
+ PY_SSL_ERROR_EOF);
+ PyModule_AddIntConstant(m, "SSL_ERROR_INVALID_ERROR_CODE",
+ PY_SSL_ERROR_INVALID_ERROR_CODE);
+ /* cert requirements */
+ PyModule_AddIntConstant(m, "CERT_NONE",
+ PY_SSL_CERT_NONE);
+ PyModule_AddIntConstant(m, "CERT_OPTIONAL",
+ PY_SSL_CERT_OPTIONAL);
+ PyModule_AddIntConstant(m, "CERT_REQUIRED",
+ PY_SSL_CERT_REQUIRED);
+ /* CRL verification for verification_flags */
+ PyModule_AddIntConstant(m, "VERIFY_DEFAULT",
+ 0);
+ PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_LEAF",
+ X509_V_FLAG_CRL_CHECK);
+ PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_CHAIN",
+ X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
+ PyModule_AddIntConstant(m, "VERIFY_X509_STRICT",
+ X509_V_FLAG_X509_STRICT);
+ PyModule_AddIntConstant(m, "VERIFY_ALLOW_PROXY_CERTS",
+ X509_V_FLAG_ALLOW_PROXY_CERTS);
+ PyModule_AddIntConstant(m, "VERIFY_X509_TRUSTED_FIRST",
+ X509_V_FLAG_TRUSTED_FIRST);
+
+#ifdef X509_V_FLAG_PARTIAL_CHAIN
+ PyModule_AddIntConstant(m, "VERIFY_X509_PARTIAL_CHAIN",
+ X509_V_FLAG_PARTIAL_CHAIN);
+#endif
+
+ /* Alert Descriptions from ssl.h */
+ /* note RESERVED constants no longer intended for use have been removed */
+ /* http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6 */
+
+#define ADD_AD_CONSTANT(s) \
+ PyModule_AddIntConstant(m, "ALERT_DESCRIPTION_"#s, \
+ SSL_AD_##s)
+
+ ADD_AD_CONSTANT(CLOSE_NOTIFY);
+ ADD_AD_CONSTANT(UNEXPECTED_MESSAGE);
+ ADD_AD_CONSTANT(BAD_RECORD_MAC);
+ ADD_AD_CONSTANT(RECORD_OVERFLOW);
+ ADD_AD_CONSTANT(DECOMPRESSION_FAILURE);
+ ADD_AD_CONSTANT(HANDSHAKE_FAILURE);
+ ADD_AD_CONSTANT(BAD_CERTIFICATE);
+ ADD_AD_CONSTANT(UNSUPPORTED_CERTIFICATE);
+ ADD_AD_CONSTANT(CERTIFICATE_REVOKED);
+ ADD_AD_CONSTANT(CERTIFICATE_EXPIRED);
+ ADD_AD_CONSTANT(CERTIFICATE_UNKNOWN);
+ ADD_AD_CONSTANT(ILLEGAL_PARAMETER);
+ ADD_AD_CONSTANT(UNKNOWN_CA);
+ ADD_AD_CONSTANT(ACCESS_DENIED);
+ ADD_AD_CONSTANT(DECODE_ERROR);
+ ADD_AD_CONSTANT(DECRYPT_ERROR);
+ ADD_AD_CONSTANT(PROTOCOL_VERSION);
+ ADD_AD_CONSTANT(INSUFFICIENT_SECURITY);
+ ADD_AD_CONSTANT(INTERNAL_ERROR);
+ ADD_AD_CONSTANT(USER_CANCELLED);
+ ADD_AD_CONSTANT(NO_RENEGOTIATION);
+ /* Not all constants are in old OpenSSL versions */
+#ifdef SSL_AD_UNSUPPORTED_EXTENSION
+ ADD_AD_CONSTANT(UNSUPPORTED_EXTENSION);
+#endif
+#ifdef SSL_AD_CERTIFICATE_UNOBTAINABLE
+ ADD_AD_CONSTANT(CERTIFICATE_UNOBTAINABLE);
+#endif
+#ifdef SSL_AD_UNRECOGNIZED_NAME
+ ADD_AD_CONSTANT(UNRECOGNIZED_NAME);
+#endif
+#ifdef SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE
+ ADD_AD_CONSTANT(BAD_CERTIFICATE_STATUS_RESPONSE);
+#endif
+#ifdef SSL_AD_BAD_CERTIFICATE_HASH_VALUE
+ ADD_AD_CONSTANT(BAD_CERTIFICATE_HASH_VALUE);
+#endif
+#ifdef SSL_AD_UNKNOWN_PSK_IDENTITY
+ ADD_AD_CONSTANT(UNKNOWN_PSK_IDENTITY);
+#endif
+
+#undef ADD_AD_CONSTANT
+
+ /* protocol versions */
+#ifndef OPENSSL_NO_SSL3
+ PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
+ PY_SSL_VERSION_SSL3);
+#endif
+ PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
+ PY_SSL_VERSION_TLS);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLS",
+ PY_SSL_VERSION_TLS);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLS_CLIENT",
+ PY_SSL_VERSION_TLS_CLIENT);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLS_SERVER",
+ PY_SSL_VERSION_TLS_SERVER);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
+ PY_SSL_VERSION_TLS1);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_1",
+ PY_SSL_VERSION_TLS1_1);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_2",
+ PY_SSL_VERSION_TLS1_2);
+
+#define ADD_OPTION(NAME, VALUE) if (sslmodule_add_option(m, NAME, (VALUE)) < 0) return -1
+
+ /* protocol options */
+ ADD_OPTION("OP_ALL", SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
+ ADD_OPTION("OP_NO_SSLv2", SSL_OP_NO_SSLv2);
+ ADD_OPTION("OP_NO_SSLv3", SSL_OP_NO_SSLv3);
+ ADD_OPTION("OP_NO_TLSv1", SSL_OP_NO_TLSv1);
+ ADD_OPTION("OP_NO_TLSv1_1", SSL_OP_NO_TLSv1_1);
+ ADD_OPTION("OP_NO_TLSv1_2", SSL_OP_NO_TLSv1_2);
+#ifdef SSL_OP_NO_TLSv1_3
+ ADD_OPTION("OP_NO_TLSv1_3", SSL_OP_NO_TLSv1_3);
+#else
+ ADD_OPTION("OP_NO_TLSv1_3", 0);
+#endif
+ ADD_OPTION("OP_CIPHER_SERVER_PREFERENCE",
+ SSL_OP_CIPHER_SERVER_PREFERENCE);
+ ADD_OPTION("OP_SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE);
+ ADD_OPTION("OP_NO_TICKET", SSL_OP_NO_TICKET);
+ ADD_OPTION("OP_LEGACY_SERVER_CONNECT",
+ SSL_OP_LEGACY_SERVER_CONNECT);
+#ifdef SSL_OP_SINGLE_ECDH_USE
+ ADD_OPTION("OP_SINGLE_ECDH_USE", SSL_OP_SINGLE_ECDH_USE);
+#endif
+#ifdef SSL_OP_NO_COMPRESSION
+ ADD_OPTION("OP_NO_COMPRESSION",
+ SSL_OP_NO_COMPRESSION);
+#endif
+#ifdef SSL_OP_ENABLE_MIDDLEBOX_COMPAT
+ ADD_OPTION("OP_ENABLE_MIDDLEBOX_COMPAT",
+ SSL_OP_ENABLE_MIDDLEBOX_COMPAT);
+#endif
+#ifdef SSL_OP_NO_RENEGOTIATION
+ ADD_OPTION("OP_NO_RENEGOTIATION",
+ SSL_OP_NO_RENEGOTIATION);
+#endif
+#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
+ ADD_OPTION("OP_IGNORE_UNEXPECTED_EOF",
+ SSL_OP_IGNORE_UNEXPECTED_EOF);
+#endif
+#ifdef SSL_OP_ENABLE_KTLS
+ ADD_OPTION("OP_ENABLE_KTLS", SSL_OP_ENABLE_KTLS);
+#endif
+
+#ifdef X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT
+ PyModule_AddIntConstant(m, "HOSTFLAG_ALWAYS_CHECK_SUBJECT",
+ X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT);
+#endif
+#ifdef X509_CHECK_FLAG_NEVER_CHECK_SUBJECT
+ PyModule_AddIntConstant(m, "HOSTFLAG_NEVER_CHECK_SUBJECT",
+ X509_CHECK_FLAG_NEVER_CHECK_SUBJECT);
+#endif
+#ifdef X509_CHECK_FLAG_NO_WILDCARDS
+ PyModule_AddIntConstant(m, "HOSTFLAG_NO_WILDCARDS",
+ X509_CHECK_FLAG_NO_WILDCARDS);
+#endif
+#ifdef X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS
+ PyModule_AddIntConstant(m, "HOSTFLAG_NO_PARTIAL_WILDCARDS",
+ X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
+#endif
+#ifdef X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS
+ PyModule_AddIntConstant(m, "HOSTFLAG_MULTI_LABEL_WILDCARDS",
+ X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS);
+#endif
+#ifdef X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS
+ PyModule_AddIntConstant(m, "HOSTFLAG_SINGLE_LABEL_SUBDOMAINS",
+ X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS);
+#endif
+
+ /* file types */
+ PyModule_AddIntConstant(m, "ENCODING_PEM", PY_SSL_ENCODING_PEM);
+ PyModule_AddIntConstant(m, "ENCODING_DER", PY_SSL_ENCODING_DER);
+
+ /* protocol versions */
+ PyModule_AddIntConstant(m, "PROTO_MINIMUM_SUPPORTED",
+ PY_PROTO_MINIMUM_SUPPORTED);
+ PyModule_AddIntConstant(m, "PROTO_MAXIMUM_SUPPORTED",
+ PY_PROTO_MAXIMUM_SUPPORTED);
+ PyModule_AddIntConstant(m, "PROTO_SSLv3", PY_PROTO_SSLv3);
+ PyModule_AddIntConstant(m, "PROTO_TLSv1", PY_PROTO_TLSv1);
+ PyModule_AddIntConstant(m, "PROTO_TLSv1_1", PY_PROTO_TLSv1_1);
+ PyModule_AddIntConstant(m, "PROTO_TLSv1_2", PY_PROTO_TLSv1_2);
+ PyModule_AddIntConstant(m, "PROTO_TLSv1_3", PY_PROTO_TLSv1_3);
+
+#define addbool(m, key, value) \
+ do { \
+ PyObject *bool_obj = (value) ? Py_True : Py_False; \
+ PyModule_AddObject((m), (key), Py_NewRef(bool_obj)); \
+ } while (0)
+
+ addbool(m, "HAS_SNI", 1);
+ addbool(m, "HAS_TLS_UNIQUE", 1);
+ addbool(m, "HAS_ECDH", 1);
+ addbool(m, "HAS_NPN", 0);
+ addbool(m, "HAS_ALPN", 1);
+
+ addbool(m, "HAS_SSLv2", 0);
+
+#if defined(SSL3_VERSION) && !defined(OPENSSL_NO_SSL3)
+ addbool(m, "HAS_SSLv3", 1);
+#else
+ addbool(m, "HAS_SSLv3", 0);
+#endif
+
+#if defined(TLS1_VERSION) && !defined(OPENSSL_NO_TLS1)
+ addbool(m, "HAS_TLSv1", 1);
+#else
+ addbool(m, "HAS_TLSv1", 0);
+#endif
+
+#if defined(TLS1_1_VERSION) && !defined(OPENSSL_NO_TLS1_1)
+ addbool(m, "HAS_TLSv1_1", 1);
+#else
+ addbool(m, "HAS_TLSv1_1", 0);
+#endif
+
+#if defined(TLS1_2_VERSION) && !defined(OPENSSL_NO_TLS1_2)
+ addbool(m, "HAS_TLSv1_2", 1);
+#else
+ addbool(m, "HAS_TLSv1_2", 0);
+#endif
+
+#if defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
+ addbool(m, "HAS_TLSv1_3", 1);
+#else
+ addbool(m, "HAS_TLSv1_3", 0);
+#endif
+
+ return 0;
+}
+
+static int
+sslmodule_init_errorcodes(PyObject *module)
+{
+ _sslmodulestate *state = get_ssl_state(module);
+
+ struct py_ssl_error_code *errcode;
+ struct py_ssl_library_code *libcode;
+
+ /* Mappings for error codes */
+ state->err_codes_to_names = PyDict_New();
+ if (state->err_codes_to_names == NULL)
+ return -1;
+ state->lib_codes_to_names = PyDict_New();
+ if (state->lib_codes_to_names == NULL)
+ return -1;
+
+ errcode = error_codes;
+ while (errcode->mnemonic != NULL) {
+ PyObject *mnemo = PyUnicode_FromString(errcode->mnemonic);
+ if (mnemo == NULL) {
+ return -1;
+ }
+ PyObject *key = Py_BuildValue("ii", errcode->library, errcode->reason);
+ if (key == NULL) {
+ Py_DECREF(mnemo);
+ return -1;
+ }
+ int rc = PyDict_SetItem(state->err_codes_to_names, key, mnemo);
+ Py_DECREF(key);
+ Py_DECREF(mnemo);
+ if (rc < 0) {
+ return -1;
+ }
+ errcode++;
+ }
+
+ libcode = library_codes;
+ while (libcode->library != NULL) {
+ PyObject *mnemo, *key;
+ key = PyLong_FromLong(libcode->code);
+ mnemo = PyUnicode_FromString(libcode->library);
+ if (key == NULL || mnemo == NULL)
+ return -1;
+ if (PyDict_SetItem(state->lib_codes_to_names, key, mnemo))
+ return -1;
+ Py_DECREF(key);
+ Py_DECREF(mnemo);
+ libcode++;
+ }
+
+ return 0;
+}
+
+static void
+parse_openssl_version(unsigned long libver,
+ unsigned int *major, unsigned int *minor,
+ unsigned int *fix, unsigned int *patch,
+ unsigned int *status)
+{
+ *status = libver & 0xF;
+ libver >>= 4;
+ *patch = libver & 0xFF;
+ libver >>= 8;
+ *fix = libver & 0xFF;
+ libver >>= 8;
+ *minor = libver & 0xFF;
+ libver >>= 8;
+ *major = libver & 0xFF;
+}
+
+static int
+sslmodule_init_versioninfo(PyObject *m)
+{
+ PyObject *r;
+ unsigned long libver;
+ unsigned int major, minor, fix, patch, status;
+
+ /* OpenSSL version */
+ /* SSLeay() gives us the version of the library linked against,
+ which could be different from the headers version.
+ */
+ libver = OpenSSL_version_num();
+ r = PyLong_FromUnsignedLong(libver);
+ if (_PyModule_Add(m, "OPENSSL_VERSION_NUMBER", r) < 0)
+ return -1;
+
+ parse_openssl_version(libver, &major, &minor, &fix, &patch, &status);
+ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
+ if (_PyModule_Add(m, "OPENSSL_VERSION_INFO", r) < 0)
+ return -1;
+
+ r = PyUnicode_FromString(OpenSSL_version(OPENSSL_VERSION));
+ if (_PyModule_Add(m, "OPENSSL_VERSION", r) < 0)
+ return -1;
+
+ libver = OPENSSL_VERSION_NUMBER;
+ parse_openssl_version(libver, &major, &minor, &fix, &patch, &status);
+ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
+ if (_PyModule_Add(m, "_OPENSSL_API_VERSION", r) < 0)
+ return -1;
+
+ return 0;
+}
+
+static int
+sslmodule_init_types(PyObject *module)
+{
+ _sslmodulestate *state = get_ssl_state(module);
+
+ state->PySSLContext_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &PySSLContext_spec, NULL
+ );
+ if (state->PySSLContext_Type == NULL)
+ return -1;
+
+ state->PySSLSocket_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &PySSLSocket_spec, NULL
+ );
+ if (state->PySSLSocket_Type == NULL)
+ return -1;
+
+ state->PySSLMemoryBIO_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &PySSLMemoryBIO_spec, NULL
+ );
+ if (state->PySSLMemoryBIO_Type == NULL)
+ return -1;
+
+ state->PySSLSession_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &PySSLSession_spec, NULL
+ );
+ if (state->PySSLSession_Type == NULL)
+ return -1;
+
+ state->PySSLCertificate_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &PySSLCertificate_spec, NULL
+ );
+ if (state->PySSLCertificate_Type == NULL)
+ return -1;
+
+ if (PyModule_AddType(module, state->PySSLContext_Type))
+ return -1;
+ if (PyModule_AddType(module, state->PySSLSocket_Type))
+ return -1;
+ if (PyModule_AddType(module, state->PySSLMemoryBIO_Type))
+ return -1;
+ if (PyModule_AddType(module, state->PySSLSession_Type))
+ return -1;
+ if (PyModule_AddType(module, state->PySSLCertificate_Type))
+ return -1;
+ return 0;
+}
+
+static int
+sslmodule_init_strings(PyObject *module)
+{
+ _sslmodulestate *state = get_ssl_state(module);
+ state->str_library = PyUnicode_InternFromString("library");
+ if (state->str_library == NULL) {
+ return -1;
+ }
+ state->str_reason = PyUnicode_InternFromString("reason");
+ if (state->str_reason == NULL) {
+ return -1;
+ }
+ state->str_verify_message = PyUnicode_InternFromString("verify_message");
+ if (state->str_verify_message == NULL) {
+ return -1;
+ }
+ state->str_verify_code = PyUnicode_InternFromString("verify_code");
+ if (state->str_verify_code == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+sslmodule_init_lock(PyObject *module)
+{
+ _sslmodulestate *state = get_ssl_state(module);
+ state->keylog_lock = PyThread_allocate_lock();
+ if (state->keylog_lock == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot sslmodule_slots[] = {
+ {Py_mod_exec, sslmodule_init_types},
+ {Py_mod_exec, sslmodule_init_exceptions},
+ {Py_mod_exec, sslmodule_init_socketapi},
+ {Py_mod_exec, sslmodule_init_errorcodes},
+ {Py_mod_exec, sslmodule_init_constants},
+ {Py_mod_exec, sslmodule_init_versioninfo},
+ {Py_mod_exec, sslmodule_init_strings},
+ {Py_mod_exec, sslmodule_init_lock},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+sslmodule_traverse(PyObject *m, visitproc visit, void *arg)
+{
+ _sslmodulestate *state = get_ssl_state(m);
+
+ Py_VISIT(state->PySSLContext_Type);
+ Py_VISIT(state->PySSLSocket_Type);
+ Py_VISIT(state->PySSLMemoryBIO_Type);
+ Py_VISIT(state->PySSLSession_Type);
+ Py_VISIT(state->PySSLCertificate_Type);
+ Py_VISIT(state->PySSLErrorObject);
+ Py_VISIT(state->PySSLCertVerificationErrorObject);
+ Py_VISIT(state->PySSLZeroReturnErrorObject);
+ Py_VISIT(state->PySSLWantReadErrorObject);
+ Py_VISIT(state->PySSLWantWriteErrorObject);
+ Py_VISIT(state->PySSLSyscallErrorObject);
+ Py_VISIT(state->PySSLEOFErrorObject);
+ Py_VISIT(state->err_codes_to_names);
+ Py_VISIT(state->lib_codes_to_names);
+ Py_VISIT(state->Sock_Type);
+
+ return 0;
+}
+
+static int
+sslmodule_clear(PyObject *m)
+{
+ _sslmodulestate *state = get_ssl_state(m);
+
+ Py_CLEAR(state->PySSLContext_Type);
+ Py_CLEAR(state->PySSLSocket_Type);
+ Py_CLEAR(state->PySSLMemoryBIO_Type);
+ Py_CLEAR(state->PySSLSession_Type);
+ Py_CLEAR(state->PySSLCertificate_Type);
+ Py_CLEAR(state->PySSLErrorObject);
+ Py_CLEAR(state->PySSLCertVerificationErrorObject);
+ Py_CLEAR(state->PySSLZeroReturnErrorObject);
+ Py_CLEAR(state->PySSLWantReadErrorObject);
+ Py_CLEAR(state->PySSLWantWriteErrorObject);
+ Py_CLEAR(state->PySSLSyscallErrorObject);
+ Py_CLEAR(state->PySSLEOFErrorObject);
+ Py_CLEAR(state->err_codes_to_names);
+ Py_CLEAR(state->lib_codes_to_names);
+ Py_CLEAR(state->Sock_Type);
+ Py_CLEAR(state->str_library);
+ Py_CLEAR(state->str_reason);
+ Py_CLEAR(state->str_verify_code);
+ Py_CLEAR(state->str_verify_message);
+ return 0;
+}
+
+static void
+sslmodule_free(void *m)
+{
+ sslmodule_clear((PyObject *)m);
+ _sslmodulestate *state = get_ssl_state(m);
+ PyThread_free_lock(state->keylog_lock);
+}
+
+static struct PyModuleDef _sslmodule_def = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_ssl",
+ .m_doc = module_doc,
+ .m_size = sizeof(_sslmodulestate),
+ .m_methods = PySSL_methods,
+ .m_slots = sslmodule_slots,
+ .m_traverse = sslmodule_traverse,
+ .m_clear = sslmodule_clear,
+ .m_free = sslmodule_free
+};
+
+PyMODINIT_FUNC
+PyInit__ssl(void)
+{
+ return PyModuleDef_Init(&_sslmodule_def);
+}
diff --git a/contrib/tools/python3/Modules/_ssl.h b/contrib/tools/python3/Modules/_ssl.h
new file mode 100644
index 00000000000..22d93ddcc6d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl.h
@@ -0,0 +1,80 @@
+#ifndef Py_SSL_H
+#define Py_SSL_H
+
+/* OpenSSL header files */
+#include "openssl/evp.h"
+#include "openssl/x509.h"
+
+/*
+ * ssl module state
+ */
+typedef struct {
+ /* Types */
+ PyTypeObject *PySSLContext_Type;
+ PyTypeObject *PySSLSocket_Type;
+ PyTypeObject *PySSLMemoryBIO_Type;
+ PyTypeObject *PySSLSession_Type;
+ PyTypeObject *PySSLCertificate_Type;
+ /* SSL error object */
+ PyObject *PySSLErrorObject;
+ PyObject *PySSLCertVerificationErrorObject;
+ PyObject *PySSLZeroReturnErrorObject;
+ PyObject *PySSLWantReadErrorObject;
+ PyObject *PySSLWantWriteErrorObject;
+ PyObject *PySSLSyscallErrorObject;
+ PyObject *PySSLEOFErrorObject;
+ /* Error mappings */
+ PyObject *err_codes_to_names;
+ PyObject *lib_codes_to_names;
+ /* socket type from module CAPI */
+ PyTypeObject *Sock_Type;
+ /* Interned strings */
+ PyObject *str_library;
+ PyObject *str_reason;
+ PyObject *str_verify_code;
+ PyObject *str_verify_message;
+ /* keylog lock */
+ PyThread_type_lock keylog_lock;
+} _sslmodulestate;
+
+static struct PyModuleDef _sslmodule_def;
+
+Py_LOCAL_INLINE(_sslmodulestate*)
+get_ssl_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_sslmodulestate *)state;
+}
+
+#define get_state_type(type) \
+ (get_ssl_state(PyType_GetModuleByDef(type, &_sslmodule_def)))
+#define get_state_ctx(c) (((PySSLContext *)(c))->state)
+#define get_state_sock(s) (((PySSLSocket *)(s))->ctx->state)
+#define get_state_obj(o) ((_sslmodulestate *)PyType_GetModuleState(Py_TYPE(o)))
+#define get_state_mbio(b) get_state_obj(b)
+#define get_state_cert(c) get_state_obj(c)
+
+/* ************************************************************************
+ * certificate
+ */
+
+enum py_ssl_encoding {
+ PY_SSL_ENCODING_PEM=X509_FILETYPE_PEM,
+ PY_SSL_ENCODING_DER=X509_FILETYPE_ASN1,
+ PY_SSL_ENCODING_PEM_AUX=X509_FILETYPE_PEM + 0x100,
+};
+
+typedef struct {
+ PyObject_HEAD
+ X509 *cert;
+ Py_hash_t hash;
+} PySSLCertificate;
+
+/* ************************************************************************
+ * helpers and utils
+ */
+static PyObject *_PySSL_BytesFromBIO(_sslmodulestate *state, BIO *bio);
+static PyObject *_PySSL_UnicodeFromBIO(_sslmodulestate *state, BIO *bio, const char *error);
+
+#endif /* Py_SSL_H */
diff --git a/contrib/tools/python3/Modules/_ssl/cert.c b/contrib/tools/python3/Modules/_ssl/cert.c
new file mode 100644
index 00000000000..bda66dc4d94
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl/cert.c
@@ -0,0 +1,245 @@
+#include "Python.h"
+#include "../_ssl.h"
+
+#include "openssl/err.h"
+#include "openssl/bio.h"
+#include "openssl/pem.h"
+#include "openssl/x509.h"
+
+/*[clinic input]
+module _ssl
+class _ssl.Certificate "PySSLCertificate *" "PySSLCertificate_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=780fc647948cfffc]*/
+
+#include "clinic/cert.c.h"
+
+static PyObject *
+newCertificate(PyTypeObject *type, X509 *cert, int upref)
+{
+ PySSLCertificate *self;
+
+ assert(type != NULL && type->tp_alloc != NULL);
+ assert(cert != NULL);
+
+ self = (PySSLCertificate *) type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+ if (upref == 1) {
+ X509_up_ref(cert);
+ }
+ self->cert = cert;
+ self->hash = -1;
+
+ return (PyObject *) self;
+}
+
+static PyObject *
+_PySSL_CertificateFromX509(_sslmodulestate *state, X509 *cert, int upref)
+{
+ return newCertificate(state->PySSLCertificate_Type, cert, upref);
+}
+
+static PyObject*
+_PySSL_CertificateFromX509Stack(_sslmodulestate *state, STACK_OF(X509) *stack, int upref)
+{
+ int len, i;
+ PyObject *result = NULL;
+
+ len = sk_X509_num(stack);
+ result = PyList_New(len);
+ if (result == NULL) {
+ return NULL;
+ }
+ for (i = 0; i < len; i++) {
+ X509 *cert = sk_X509_value(stack, i);
+ PyObject *ocert = _PySSL_CertificateFromX509(state, cert, upref);
+ if (ocert == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyList_SetItem(result, i, ocert);
+ }
+ return result;
+}
+
+/*[clinic input]
+_ssl.Certificate.public_bytes
+ format: int(c_default="PY_SSL_ENCODING_PEM") = Encoding.PEM
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_Certificate_public_bytes_impl(PySSLCertificate *self, int format)
+/*[clinic end generated code: output=c01ddbb697429e12 input=4d38c45e874b0e64]*/
+{
+ BIO *bio;
+ int retcode;
+ PyObject *result;
+ _sslmodulestate *state = get_state_cert(self);
+
+ bio = BIO_new(BIO_s_mem());
+ if (bio == NULL) {
+ PyErr_SetString(state->PySSLErrorObject,
+ "failed to allocate BIO");
+ return NULL;
+ }
+ switch(format) {
+ case PY_SSL_ENCODING_PEM:
+ retcode = PEM_write_bio_X509(bio, self->cert);
+ break;
+ case PY_SSL_ENCODING_PEM_AUX:
+ retcode = PEM_write_bio_X509_AUX(bio, self->cert);
+ break;
+ case PY_SSL_ENCODING_DER:
+ retcode = i2d_X509_bio(bio, self->cert);
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError, "Unsupported format");
+ BIO_free(bio);
+ return NULL;
+ }
+ if (retcode != 1) {
+ BIO_free(bio);
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ return NULL;
+ }
+ if (format == PY_SSL_ENCODING_DER) {
+ result = _PySSL_BytesFromBIO(state, bio);
+ } else {
+ result = _PySSL_UnicodeFromBIO(state, bio, "error");
+ }
+ BIO_free(bio);
+ return result;
+}
+
+
+/*[clinic input]
+_ssl.Certificate.get_info
+
+[clinic start generated code]*/
+
+static PyObject *
+_ssl_Certificate_get_info_impl(PySSLCertificate *self)
+/*[clinic end generated code: output=0f0deaac54f4408b input=ba2c1694b39d0778]*/
+{
+ return _decode_certificate(get_state_cert(self), self->cert);
+}
+
+static PyObject*
+_x509name_print(_sslmodulestate *state, X509_NAME *name, int indent, unsigned long flags)
+{
+ PyObject *res;
+ BIO *biobuf;
+
+ biobuf = BIO_new(BIO_s_mem());
+ if (biobuf == NULL) {
+ PyErr_SetString(PyExc_MemoryError, "failed to allocate BIO");
+ return NULL;
+ }
+
+ if (X509_NAME_print_ex(biobuf, name, indent, flags) <= 0) {
+ _setSSLError(state, NULL, 0, __FILE__, __LINE__);
+ BIO_free(biobuf);
+ return NULL;
+ }
+ res = _PySSL_UnicodeFromBIO(state, biobuf, "strict");
+ BIO_free(biobuf);
+ return res;
+}
+
+/* ************************************************************************
+ * PySSLCertificate_Type
+ */
+
+static PyObject *
+certificate_repr(PySSLCertificate *self)
+{
+ PyObject *osubject, *result;
+
+ /* subject string is ASCII encoded, UTF-8 chars are quoted */
+ osubject = _x509name_print(
+ get_state_cert(self),
+ X509_get_subject_name(self->cert),
+ 0,
+ XN_FLAG_RFC2253
+ );
+ if (osubject == NULL)
+ return NULL;
+ result = PyUnicode_FromFormat(
+ "<%s '%U'>",
+ Py_TYPE(self)->tp_name, osubject
+ );
+ Py_DECREF(osubject);
+ return result;
+}
+
+static Py_hash_t
+certificate_hash(PySSLCertificate *self)
+{
+ if (self->hash == (Py_hash_t)-1) {
+ unsigned long hash;
+ hash = X509_subject_name_hash(self->cert);
+ if ((Py_hash_t)hash == (Py_hash_t)-1) {
+ self->hash = -2;
+ } else {
+ self->hash = (Py_hash_t)hash;
+ }
+ }
+ return self->hash;
+}
+
+static PyObject *
+certificate_richcompare(PySSLCertificate *self, PyObject *other, int op)
+{
+ int cmp;
+ _sslmodulestate *state = get_state_cert(self);
+
+ if (Py_TYPE(other) != state->PySSLCertificate_Type) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ /* only support == and != */
+ if ((op != Py_EQ) && (op != Py_NE)) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ cmp = X509_cmp(self->cert, ((PySSLCertificate*)other)->cert);
+ if (((op == Py_EQ) && (cmp == 0)) || ((op == Py_NE) && (cmp != 0))) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static void
+certificate_dealloc(PySSLCertificate *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ X509_free(self->cert);
+ Py_TYPE(self)->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyMethodDef certificate_methods[] = {
+ /* methods */
+ _SSL_CERTIFICATE_PUBLIC_BYTES_METHODDEF
+ _SSL_CERTIFICATE_GET_INFO_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot PySSLCertificate_slots[] = {
+ {Py_tp_dealloc, certificate_dealloc},
+ {Py_tp_repr, certificate_repr},
+ {Py_tp_hash, certificate_hash},
+ {Py_tp_richcompare, certificate_richcompare},
+ {Py_tp_methods, certificate_methods},
+ {0, 0},
+};
+
+static PyType_Spec PySSLCertificate_spec = {
+ "_ssl.Certificate",
+ sizeof(PySSLCertificate),
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE,
+ PySSLCertificate_slots,
+};
diff --git a/contrib/tools/python3/Modules/_ssl/clinic/cert.c.h b/contrib/tools/python3/Modules/_ssl/clinic/cert.c.h
new file mode 100644
index 00000000000..a052ab2086f
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl/clinic/cert.c.h
@@ -0,0 +1,89 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_ssl_Certificate_public_bytes__doc__,
+"public_bytes($self, /, format=Encoding.PEM)\n"
+"--\n"
+"\n");
+
+#define _SSL_CERTIFICATE_PUBLIC_BYTES_METHODDEF \
+ {"public_bytes", _PyCFunction_CAST(_ssl_Certificate_public_bytes), METH_FASTCALL|METH_KEYWORDS, _ssl_Certificate_public_bytes__doc__},
+
+static PyObject *
+_ssl_Certificate_public_bytes_impl(PySSLCertificate *self, int format);
+
+static PyObject *
+_ssl_Certificate_public_bytes(PySSLCertificate *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(format), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"format", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "public_bytes",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int format = PY_SSL_ENCODING_PEM;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ format = _PyLong_AsInt(args[0]);
+ if (format == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _ssl_Certificate_public_bytes_impl(self, format);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_Certificate_get_info__doc__,
+"get_info($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL_CERTIFICATE_GET_INFO_METHODDEF \
+ {"get_info", (PyCFunction)_ssl_Certificate_get_info, METH_NOARGS, _ssl_Certificate_get_info__doc__},
+
+static PyObject *
+_ssl_Certificate_get_info_impl(PySSLCertificate *self);
+
+static PyObject *
+_ssl_Certificate_get_info(PySSLCertificate *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl_Certificate_get_info_impl(self);
+}
+/*[clinic end generated code: output=82efada014f9b7fe input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/_ssl/debughelpers.c b/contrib/tools/python3/Modules/_ssl/debughelpers.c
new file mode 100644
index 00000000000..a81f0aad05a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl/debughelpers.c
@@ -0,0 +1,206 @@
+/* Debug helpers */
+
+#ifndef SSL3_MT_CHANGE_CIPHER_SPEC
+/* Dummy message type for handling CCS like a normal handshake message
+ * not defined in OpenSSL 1.0.2
+ */
+#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
+#endif
+
+static void
+_PySSL_msg_callback(int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg)
+{
+ const char *cbuf = (const char *)buf;
+ PyGILState_STATE threadstate;
+ PyObject *res = NULL;
+ PySSLSocket *ssl_obj = NULL; /* ssl._SSLSocket, borrowed ref */
+ PyObject *ssl_socket = NULL; /* ssl.SSLSocket or ssl.SSLObject */
+ int msg_type;
+
+ threadstate = PyGILState_Ensure();
+
+ ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl);
+ assert(Py_IS_TYPE(ssl_obj, get_state_sock(ssl_obj)->PySSLSocket_Type));
+ if (ssl_obj->ctx->msg_cb == NULL) {
+ PyGILState_Release(threadstate);
+ return;
+ }
+
+ if (ssl_obj->owner)
+ ssl_socket = PyWeakref_GetObject(ssl_obj->owner);
+ else if (ssl_obj->Socket)
+ ssl_socket = PyWeakref_GetObject(ssl_obj->Socket);
+ else
+ ssl_socket = (PyObject *)ssl_obj;
+ Py_INCREF(ssl_socket);
+
+ /* assume that OpenSSL verifies all payload and buf len is of sufficient
+ length */
+ switch(content_type) {
+ case SSL3_RT_CHANGE_CIPHER_SPEC:
+ msg_type = SSL3_MT_CHANGE_CIPHER_SPEC;
+ break;
+ case SSL3_RT_ALERT:
+ /* byte 0: level */
+ /* byte 1: alert type */
+ msg_type = (int)cbuf[1];
+ break;
+ case SSL3_RT_HANDSHAKE:
+ msg_type = (int)cbuf[0];
+ break;
+#ifdef SSL3_RT_HEADER
+ case SSL3_RT_HEADER:
+ /* frame header encodes version in bytes 1..2 */
+ version = cbuf[1] << 8 | cbuf[2];
+ msg_type = (int)cbuf[0];
+ break;
+#endif
+#ifdef SSL3_RT_INNER_CONTENT_TYPE
+ case SSL3_RT_INNER_CONTENT_TYPE:
+ msg_type = (int)cbuf[0];
+ break;
+#endif
+ default:
+ /* never SSL3_RT_APPLICATION_DATA */
+ msg_type = -1;
+ break;
+ }
+
+ res = PyObject_CallFunction(
+ ssl_obj->ctx->msg_cb, "Osiiiy#",
+ ssl_socket, write_p ? "write" : "read",
+ version, content_type, msg_type,
+ buf, len
+ );
+ if (res == NULL) {
+ ssl_obj->exc = PyErr_GetRaisedException();
+ } else {
+ Py_DECREF(res);
+ }
+ Py_XDECREF(ssl_socket);
+
+ PyGILState_Release(threadstate);
+}
+
+
+static PyObject *
+_PySSLContext_get_msg_callback(PySSLContext *self, void *c) {
+ if (self->msg_cb != NULL) {
+ return Py_NewRef(self->msg_cb);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static int
+_PySSLContext_set_msg_callback(PySSLContext *self, PyObject *arg, void *c) {
+ Py_CLEAR(self->msg_cb);
+ if (arg == Py_None) {
+ SSL_CTX_set_msg_callback(self->ctx, NULL);
+ }
+ else {
+ if (!PyCallable_Check(arg)) {
+ SSL_CTX_set_msg_callback(self->ctx, NULL);
+ PyErr_SetString(PyExc_TypeError,
+ "not a callable object");
+ return -1;
+ }
+ self->msg_cb = Py_NewRef(arg);
+ SSL_CTX_set_msg_callback(self->ctx, _PySSL_msg_callback);
+ }
+ return 0;
+}
+
+static void
+_PySSL_keylog_callback(const SSL *ssl, const char *line)
+{
+ PyGILState_STATE threadstate;
+ PySSLSocket *ssl_obj = NULL; /* ssl._SSLSocket, borrowed ref */
+ int res, e;
+
+ threadstate = PyGILState_Ensure();
+
+ ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl);
+ assert(Py_IS_TYPE(ssl_obj, get_state_sock(ssl_obj)->PySSLSocket_Type));
+ PyThread_type_lock lock = get_state_sock(ssl_obj)->keylog_lock;
+ assert(lock != NULL);
+ if (ssl_obj->ctx->keylog_bio == NULL) {
+ return;
+ }
+ /*
+ * The lock is neither released on exit nor on fork(). The lock is
+ * also shared between all SSLContexts although contexts may write to
+ * their own files. IMHO that's good enough for a non-performance
+ * critical debug helper.
+ */
+
+ PySSL_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(lock, 1);
+ res = BIO_printf(ssl_obj->ctx->keylog_bio, "%s\n", line);
+ e = errno;
+ (void)BIO_flush(ssl_obj->ctx->keylog_bio);
+ PyThread_release_lock(lock);
+ PySSL_END_ALLOW_THREADS
+
+ if (res == -1) {
+ errno = e;
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
+ ssl_obj->ctx->keylog_filename);
+ ssl_obj->exc = PyErr_GetRaisedException();
+ }
+ PyGILState_Release(threadstate);
+}
+
+static PyObject *
+_PySSLContext_get_keylog_filename(PySSLContext *self, void *c) {
+ if (self->keylog_filename != NULL) {
+ return Py_NewRef(self->keylog_filename);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static int
+_PySSLContext_set_keylog_filename(PySSLContext *self, PyObject *arg, void *c) {
+ FILE *fp;
+ /* Reset variables and callback first */
+ SSL_CTX_set_keylog_callback(self->ctx, NULL);
+ Py_CLEAR(self->keylog_filename);
+ if (self->keylog_bio != NULL) {
+ BIO *bio = self->keylog_bio;
+ self->keylog_bio = NULL;
+ PySSL_BEGIN_ALLOW_THREADS
+ BIO_free_all(bio);
+ PySSL_END_ALLOW_THREADS
+ }
+
+ if (arg == Py_None) {
+ /* None disables the callback */
+ return 0;
+ }
+
+ /* _Py_fopen_obj() also checks that arg is of proper type. */
+ fp = _Py_fopen_obj(arg, "a" PY_STDIOTEXTMODE);
+ if (fp == NULL)
+ return -1;
+
+ self->keylog_bio = BIO_new_fp(fp, BIO_CLOSE | BIO_FP_TEXT);
+ if (self->keylog_bio == NULL) {
+ PyErr_SetString(get_state_ctx(self)->PySSLErrorObject,
+ "Can't malloc memory for keylog file");
+ return -1;
+ }
+ self->keylog_filename = Py_NewRef(arg);
+
+ /* Write a header for seekable, empty files (this excludes pipes). */
+ PySSL_BEGIN_ALLOW_THREADS
+ if (BIO_tell(self->keylog_bio) == 0) {
+ BIO_puts(self->keylog_bio,
+ "# TLS secrets log file, generated by OpenSSL / Python\n");
+ (void)BIO_flush(self->keylog_bio);
+ }
+ PySSL_END_ALLOW_THREADS
+ SSL_CTX_set_keylog_callback(self->ctx, _PySSL_keylog_callback);
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/_ssl/misc.c b/contrib/tools/python3/Modules/_ssl/misc.c
new file mode 100644
index 00000000000..4de091d57ef
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl/misc.c
@@ -0,0 +1,34 @@
+#include "Python.h"
+#include "../_ssl.h"
+
+#include "openssl/bio.h"
+
+/* BIO_s_mem() to PyBytes
+ */
+static PyObject *
+_PySSL_BytesFromBIO(_sslmodulestate *state, BIO *bio)
+{
+ long size;
+ char *data = NULL;
+ size = BIO_get_mem_data(bio, &data);
+ if (data == NULL || size < 0) {
+ PyErr_SetString(PyExc_ValueError, "Not a memory BIO");
+ return NULL;
+ }
+ return PyBytes_FromStringAndSize(data, size);
+}
+
+/* BIO_s_mem() to PyUnicode
+ */
+static PyObject *
+_PySSL_UnicodeFromBIO(_sslmodulestate *state, BIO *bio, const char *error)
+{
+ long size;
+ char *data = NULL;
+ size = BIO_get_mem_data(bio, &data);
+ if (data == NULL || size < 0) {
+ PyErr_SetString(PyExc_ValueError, "Not a memory BIO");
+ return NULL;
+ }
+ return PyUnicode_DecodeUTF8(data, size, error);
+}
diff --git a/contrib/tools/python3/Modules/_ssl_data.h b/contrib/tools/python3/Modules/_ssl_data.h
new file mode 100644
index 00000000000..8f2994f52df
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl_data.h
@@ -0,0 +1,6323 @@
+/* File generated by Tools/ssl/make_ssl_data.py */
+/* Generated on 2020-04-13T21:45:54.559159 */
+
+static struct py_ssl_library_code library_codes[] = {
+#ifdef ERR_LIB_ASN1
+ {"ASN1", ERR_LIB_ASN1},
+#endif
+#ifdef ERR_LIB_ASYNC
+ {"ASYNC", ERR_LIB_ASYNC},
+#endif
+#ifdef ERR_LIB_BIO
+ {"BIO", ERR_LIB_BIO},
+#endif
+#ifdef ERR_LIB_BN
+ {"BN", ERR_LIB_BN},
+#endif
+#ifdef ERR_LIB_CMS
+ {"CMS", ERR_LIB_CMS},
+#endif
+#ifdef ERR_LIB_COMP
+ {"COMP", ERR_LIB_COMP},
+#endif
+#ifdef ERR_LIB_CONF
+ {"CONF", ERR_LIB_CONF},
+#endif
+#ifdef ERR_LIB_CRYPTO
+ {"CRYPTO", ERR_LIB_CRYPTO},
+#endif
+#ifdef ERR_LIB_CT
+ {"CT", ERR_LIB_CT},
+#endif
+#ifdef ERR_LIB_DH
+ {"DH", ERR_LIB_DH},
+#endif
+#ifdef ERR_LIB_DSA
+ {"DSA", ERR_LIB_DSA},
+#endif
+#ifdef ERR_LIB_EC
+ {"EC", ERR_LIB_EC},
+#endif
+#ifdef ERR_LIB_ENGINE
+ {"ENGINE", ERR_LIB_ENGINE},
+#endif
+#ifdef ERR_LIB_EVP
+ {"EVP", ERR_LIB_EVP},
+#endif
+#ifdef ERR_LIB_KDF
+ {"KDF", ERR_LIB_KDF},
+#endif
+#ifdef ERR_LIB_OCSP
+ {"OCSP", ERR_LIB_OCSP},
+#endif
+#ifdef ERR_LIB_PEM
+ {"PEM", ERR_LIB_PEM},
+#endif
+#ifdef ERR_LIB_PKCS12
+ {"PKCS12", ERR_LIB_PKCS12},
+#endif
+#ifdef ERR_LIB_PKCS7
+ {"PKCS7", ERR_LIB_PKCS7},
+#endif
+#ifdef ERR_LIB_RAND
+ {"RAND", ERR_LIB_RAND},
+#endif
+#ifdef ERR_LIB_RSA
+ {"RSA", ERR_LIB_RSA},
+#endif
+#ifdef ERR_LIB_SSL
+ {"SSL", ERR_LIB_SSL},
+#endif
+#ifdef ERR_LIB_TS
+ {"TS", ERR_LIB_TS},
+#endif
+#ifdef ERR_LIB_UI
+ {"UI", ERR_LIB_UI},
+#endif
+#ifdef ERR_LIB_X509
+ {"X509", ERR_LIB_X509},
+#endif
+#ifdef ERR_LIB_X509V3
+ {"X509V3", ERR_LIB_X509V3},
+#endif
+ { NULL }
+};
+
+static struct py_ssl_error_code error_codes[] = {
+ #ifdef ASN1_R_ADDING_OBJECT
+ {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
+ #else
+ {"ADDING_OBJECT", 13, 171},
+ #endif
+ #ifdef ASN1_R_ASN1_PARSE_ERROR
+ {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR},
+ #else
+ {"ASN1_PARSE_ERROR", 13, 203},
+ #endif
+ #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR
+ {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR},
+ #else
+ {"ASN1_SIG_PARSE_ERROR", 13, 204},
+ #endif
+ #ifdef ASN1_R_AUX_ERROR
+ {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR},
+ #else
+ {"AUX_ERROR", 13, 100},
+ #endif
+ #ifdef ASN1_R_BAD_OBJECT_HEADER
+ {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER},
+ #else
+ {"BAD_OBJECT_HEADER", 13, 102},
+ #endif
+ #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH
+ {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH},
+ #else
+ {"BMPSTRING_IS_WRONG_LENGTH", 13, 214},
+ #endif
+ #ifdef ASN1_R_BN_LIB
+ {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB},
+ #else
+ {"BN_LIB", 13, 105},
+ #endif
+ #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH
+ {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH},
+ #else
+ {"BOOLEAN_IS_WRONG_LENGTH", 13, 106},
+ #endif
+ #ifdef ASN1_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 13, 107},
+ #endif
+ #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108},
+ #endif
+ #ifdef ASN1_R_CONTEXT_NOT_INITIALISED
+ {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED},
+ #else
+ {"CONTEXT_NOT_INITIALISED", 13, 217},
+ #endif
+ #ifdef ASN1_R_DATA_IS_WRONG
+ {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG},
+ #else
+ {"DATA_IS_WRONG", 13, 109},
+ #endif
+ #ifdef ASN1_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 13, 110},
+ #endif
+ #ifdef ASN1_R_DEPTH_EXCEEDED
+ {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED},
+ #else
+ {"DEPTH_EXCEEDED", 13, 174},
+ #endif
+ #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED},
+ #else
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198},
+ #endif
+ #ifdef ASN1_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 13, 112},
+ #endif
+ #ifdef ASN1_R_ERROR_GETTING_TIME
+ {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME},
+ #else
+ {"ERROR_GETTING_TIME", 13, 173},
+ #endif
+ #ifdef ASN1_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 13, 172},
+ #endif
+ #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS
+ {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS},
+ #else
+ {"ERROR_SETTING_CIPHER_PARAMS", 13, 114},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_INTEGER
+ {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER},
+ #else
+ {"EXPECTING_AN_INTEGER", 13, 115},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_OBJECT
+ {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT},
+ #else
+ {"EXPECTING_AN_OBJECT", 13, 116},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH
+ {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH},
+ #else
+ {"EXPLICIT_LENGTH_MISMATCH", 13, 119},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED},
+ #else
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120},
+ #endif
+ #ifdef ASN1_R_FIELD_MISSING
+ {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING},
+ #else
+ {"FIELD_MISSING", 13, 121},
+ #endif
+ #ifdef ASN1_R_FIRST_NUM_TOO_LARGE
+ {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE},
+ #else
+ {"FIRST_NUM_TOO_LARGE", 13, 122},
+ #endif
+ #ifdef ASN1_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 13, 123},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT
+ {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT},
+ #else
+ {"ILLEGAL_BITSTRING_FORMAT", 13, 175},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BOOLEAN
+ {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN},
+ #else
+ {"ILLEGAL_BOOLEAN", 13, 176},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_CHARACTERS
+ {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS},
+ #else
+ {"ILLEGAL_CHARACTERS", 13, 124},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_FORMAT
+ {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT},
+ #else
+ {"ILLEGAL_FORMAT", 13, 177},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_HEX
+ {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX},
+ #else
+ {"ILLEGAL_HEX", 13, 178},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG
+ {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG},
+ #else
+ {"ILLEGAL_IMPLICIT_TAG", 13, 179},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_INTEGER
+ {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER},
+ #else
+ {"ILLEGAL_INTEGER", 13, 180},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE
+ {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE},
+ #else
+ {"ILLEGAL_NEGATIVE_VALUE", 13, 226},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING
+ {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING},
+ #else
+ {"ILLEGAL_NESTED_TAGGING", 13, 181},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL
+ {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL},
+ #else
+ {"ILLEGAL_NULL", 13, 125},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL_VALUE
+ {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE},
+ #else
+ {"ILLEGAL_NULL_VALUE", 13, 182},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OBJECT
+ {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT},
+ #else
+ {"ILLEGAL_OBJECT", 13, 183},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY
+ {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY},
+ #else
+ {"ILLEGAL_OPTIONAL_ANY", 13, 126},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE},
+ #else
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_PADDING
+ {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING},
+ #else
+ {"ILLEGAL_PADDING", 13, 221},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TAGGED_ANY
+ {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY},
+ #else
+ {"ILLEGAL_TAGGED_ANY", 13, 127},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TIME_VALUE
+ {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE},
+ #else
+ {"ILLEGAL_TIME_VALUE", 13, 184},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT
+ {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT},
+ #else
+ {"ILLEGAL_ZERO_CONTENT", 13, 222},
+ #endif
+ #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT
+ {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT},
+ #else
+ {"INTEGER_NOT_ASCII_FORMAT", 13, 185},
+ #endif
+ #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG
+ {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG},
+ #else
+ {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128},
+ #endif
+ #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT
+ {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT},
+ #else
+ {"INVALID_BIT_STRING_BITS_LEFT", 13, 220},
+ #endif
+ #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH
+ {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH},
+ #else
+ {"INVALID_BMPSTRING_LENGTH", 13, 129},
+ #endif
+ #ifdef ASN1_R_INVALID_DIGIT
+ {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT},
+ #else
+ {"INVALID_DIGIT", 13, 130},
+ #endif
+ #ifdef ASN1_R_INVALID_MIME_TYPE
+ {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE},
+ #else
+ {"INVALID_MIME_TYPE", 13, 205},
+ #endif
+ #ifdef ASN1_R_INVALID_MODIFIER
+ {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER},
+ #else
+ {"INVALID_MODIFIER", 13, 186},
+ #endif
+ #ifdef ASN1_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 13, 187},
+ #endif
+ #ifdef ASN1_R_INVALID_OBJECT_ENCODING
+ {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING},
+ #else
+ {"INVALID_OBJECT_ENCODING", 13, 216},
+ #endif
+ #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS
+ {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS},
+ #else
+ {"INVALID_SCRYPT_PARAMETERS", 13, 227},
+ #endif
+ #ifdef ASN1_R_INVALID_SEPARATOR
+ {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR},
+ #else
+ {"INVALID_SEPARATOR", 13, 131},
+ #endif
+ #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE
+ {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE},
+ #else
+ {"INVALID_STRING_TABLE_VALUE", 13, 218},
+ #endif
+ #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH
+ {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH},
+ #else
+ {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133},
+ #endif
+ #ifdef ASN1_R_INVALID_UTF8STRING
+ {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING},
+ #else
+ {"INVALID_UTF8STRING", 13, 134},
+ #endif
+ #ifdef ASN1_R_INVALID_VALUE
+ {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE},
+ #else
+ {"INVALID_VALUE", 13, 219},
+ #endif
+ #ifdef ASN1_R_LIST_ERROR
+ {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR},
+ #else
+ {"LIST_ERROR", 13, 188},
+ #endif
+ #ifdef ASN1_R_MIME_NO_CONTENT_TYPE
+ {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE},
+ #else
+ {"MIME_NO_CONTENT_TYPE", 13, 206},
+ #endif
+ #ifdef ASN1_R_MIME_PARSE_ERROR
+ {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR},
+ #else
+ {"MIME_PARSE_ERROR", 13, 207},
+ #endif
+ #ifdef ASN1_R_MIME_SIG_PARSE_ERROR
+ {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR},
+ #else
+ {"MIME_SIG_PARSE_ERROR", 13, 208},
+ #endif
+ #ifdef ASN1_R_MISSING_EOC
+ {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC},
+ #else
+ {"MISSING_EOC", 13, 137},
+ #endif
+ #ifdef ASN1_R_MISSING_SECOND_NUMBER
+ {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER},
+ #else
+ {"MISSING_SECOND_NUMBER", 13, 138},
+ #endif
+ #ifdef ASN1_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 13, 189},
+ #endif
+ #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL
+ {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL},
+ #else
+ {"MSTRING_NOT_UNIVERSAL", 13, 139},
+ #endif
+ #ifdef ASN1_R_MSTRING_WRONG_TAG
+ {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG},
+ #else
+ {"MSTRING_WRONG_TAG", 13, 140},
+ #endif
+ #ifdef ASN1_R_NESTED_ASN1_STRING
+ {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING},
+ #else
+ {"NESTED_ASN1_STRING", 13, 197},
+ #endif
+ #ifdef ASN1_R_NESTED_TOO_DEEP
+ {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP},
+ #else
+ {"NESTED_TOO_DEEP", 13, 201},
+ #endif
+ #ifdef ASN1_R_NON_HEX_CHARACTERS
+ {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS},
+ #else
+ {"NON_HEX_CHARACTERS", 13, 141},
+ #endif
+ #ifdef ASN1_R_NOT_ASCII_FORMAT
+ {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT},
+ #else
+ {"NOT_ASCII_FORMAT", 13, 190},
+ #endif
+ #ifdef ASN1_R_NOT_ENOUGH_DATA
+ {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA},
+ #else
+ {"NOT_ENOUGH_DATA", 13, 142},
+ #endif
+ #ifdef ASN1_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 13, 209},
+ #endif
+ #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE
+ {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE},
+ #else
+ {"NO_MATCHING_CHOICE_TYPE", 13, 143},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE
+ {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE},
+ #else
+ {"NO_MULTIPART_BODY_FAILURE", 13, 210},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BOUNDARY
+ {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY},
+ #else
+ {"NO_MULTIPART_BOUNDARY", 13, 211},
+ #endif
+ #ifdef ASN1_R_NO_SIG_CONTENT_TYPE
+ {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE},
+ #else
+ {"NO_SIG_CONTENT_TYPE", 13, 212},
+ #endif
+ #ifdef ASN1_R_NULL_IS_WRONG_LENGTH
+ {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH},
+ #else
+ {"NULL_IS_WRONG_LENGTH", 13, 144},
+ #endif
+ #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT
+ {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT},
+ #else
+ {"OBJECT_NOT_ASCII_FORMAT", 13, 191},
+ #endif
+ #ifdef ASN1_R_ODD_NUMBER_OF_CHARS
+ {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS},
+ #else
+ {"ODD_NUMBER_OF_CHARS", 13, 145},
+ #endif
+ #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE
+ {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE},
+ #else
+ {"SECOND_NUMBER_TOO_LARGE", 13, 147},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH
+ {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH},
+ #else
+ {"SEQUENCE_LENGTH_MISMATCH", 13, 148},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED
+ {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED},
+ #else
+ {"SEQUENCE_NOT_CONSTRUCTED", 13, 149},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG},
+ #else
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192},
+ #endif
+ #ifdef ASN1_R_SHORT_LINE
+ {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE},
+ #else
+ {"SHORT_LINE", 13, 150},
+ #endif
+ #ifdef ASN1_R_SIG_INVALID_MIME_TYPE
+ {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE},
+ #else
+ {"SIG_INVALID_MIME_TYPE", 13, 213},
+ #endif
+ #ifdef ASN1_R_STREAMING_NOT_SUPPORTED
+ {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED},
+ #else
+ {"STREAMING_NOT_SUPPORTED", 13, 202},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 13, 151},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_SHORT
+ {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT},
+ #else
+ {"STRING_TOO_SHORT", 13, 152},
+ #endif
+ #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154},
+ #endif
+ #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT
+ {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT},
+ #else
+ {"TIME_NOT_ASCII_FORMAT", 13, 193},
+ #endif
+ #ifdef ASN1_R_TOO_LARGE
+ {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE},
+ #else
+ {"TOO_LARGE", 13, 223},
+ #endif
+ #ifdef ASN1_R_TOO_LONG
+ {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG},
+ #else
+ {"TOO_LONG", 13, 155},
+ #endif
+ #ifdef ASN1_R_TOO_SMALL
+ {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL},
+ #else
+ {"TOO_SMALL", 13, 224},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED
+ {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED},
+ #else
+ {"TYPE_NOT_CONSTRUCTED", 13, 156},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_PRIMITIVE
+ {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE},
+ #else
+ {"TYPE_NOT_PRIMITIVE", 13, 195},
+ #endif
+ #ifdef ASN1_R_UNEXPECTED_EOC
+ {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC},
+ #else
+ {"UNEXPECTED_EOC", 13, 159},
+ #endif
+ #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH},
+ #else
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_FORMAT
+ {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT},
+ #else
+ {"UNKNOWN_FORMAT", 13, 160},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE
+ {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE},
+ #else
+ {"UNKNOWN_OBJECT_TYPE", 13, 162},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE
+ {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE},
+ #else
+ {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM
+ {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM},
+ #else
+ {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_TAG
+ {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG},
+ #else
+ {"UNKNOWN_TAG", 13, 194},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE},
+ #else
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 13, 228},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 13, 196},
+ #endif
+ #ifdef ASN1_R_WRONG_INTEGER_TYPE
+ {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE},
+ #else
+ {"WRONG_INTEGER_TYPE", 13, 225},
+ #endif
+ #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE
+ {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE},
+ #else
+ {"WRONG_PUBLIC_KEY_TYPE", 13, 200},
+ #endif
+ #ifdef ASN1_R_WRONG_TAG
+ {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG},
+ #else
+ {"WRONG_TAG", 13, 168},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SET_POOL
+ {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL},
+ #else
+ {"FAILED_TO_SET_POOL", 51, 101},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT
+ {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT},
+ #else
+ {"FAILED_TO_SWAP_CONTEXT", 51, 102},
+ #endif
+ #ifdef ASYNC_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 51, 105},
+ #endif
+ #ifdef ASYNC_R_INVALID_POOL_SIZE
+ {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE},
+ #else
+ {"INVALID_POOL_SIZE", 51, 103},
+ #endif
+ #ifdef BIO_R_ACCEPT_ERROR
+ {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR},
+ #else
+ {"ACCEPT_ERROR", 32, 100},
+ #endif
+ #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET},
+ #else
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141},
+ #endif
+ #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE
+ {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE},
+ #else
+ {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129},
+ #endif
+ #ifdef BIO_R_BAD_FOPEN_MODE
+ {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE},
+ #else
+ {"BAD_FOPEN_MODE", 32, 101},
+ #endif
+ #ifdef BIO_R_BROKEN_PIPE
+ {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE},
+ #else
+ {"BROKEN_PIPE", 32, 124},
+ #endif
+ #ifdef BIO_R_CONNECT_ERROR
+ {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR},
+ #else
+ {"CONNECT_ERROR", 32, 103},
+ #endif
+ #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET},
+ #else
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_ERROR
+ {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR},
+ #else
+ {"GETSOCKNAME_ERROR", 32, 132},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS},
+ #else
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133},
+ #endif
+ #ifdef BIO_R_GETTING_SOCKTYPE
+ {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE},
+ #else
+ {"GETTING_SOCKTYPE", 32, 134},
+ #endif
+ #ifdef BIO_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 32, 125},
+ #endif
+ #ifdef BIO_R_INVALID_SOCKET
+ {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET},
+ #else
+ {"INVALID_SOCKET", 32, 135},
+ #endif
+ #ifdef BIO_R_IN_USE
+ {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE},
+ #else
+ {"IN_USE", 32, 123},
+ #endif
+ #ifdef BIO_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 32, 102},
+ #endif
+ #ifdef BIO_R_LISTEN_V6_ONLY
+ {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY},
+ #else
+ {"LISTEN_V6_ONLY", 32, 136},
+ #endif
+ #ifdef BIO_R_LOOKUP_RETURNED_NOTHING
+ {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING},
+ #else
+ {"LOOKUP_RETURNED_NOTHING", 32, 142},
+ #endif
+ #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE
+ {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE},
+ #else
+ {"MALFORMED_HOST_OR_SERVICE", 32, 130},
+ #endif
+ #ifdef BIO_R_NBIO_CONNECT_ERROR
+ {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR},
+ #else
+ {"NBIO_CONNECT_ERROR", 32, 110},
+ #endif
+ #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143},
+ #endif
+ #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144},
+ #endif
+ #ifdef BIO_R_NO_PORT_DEFINED
+ {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED},
+ #else
+ {"NO_PORT_DEFINED", 32, 113},
+ #endif
+ #ifdef BIO_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 32, 128},
+ #endif
+ #ifdef BIO_R_NULL_PARAMETER
+ {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER},
+ #else
+ {"NULL_PARAMETER", 32, 115},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_BIND_SOCKET
+ {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET},
+ #else
+ {"UNABLE_TO_BIND_SOCKET", 32, 117},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET
+ {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET},
+ #else
+ {"UNABLE_TO_CREATE_SOCKET", 32, 118},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_KEEPALIVE
+ {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE},
+ #else
+ {"UNABLE_TO_KEEPALIVE", 32, 137},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET
+ {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET},
+ #else
+ {"UNABLE_TO_LISTEN_SOCKET", 32, 119},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_NODELAY
+ {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY},
+ #else
+ {"UNABLE_TO_NODELAY", 32, 138},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_REUSEADDR
+ {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR},
+ #else
+ {"UNABLE_TO_REUSEADDR", 32, 139},
+ #endif
+ #ifdef BIO_R_UNAVAILABLE_IP_FAMILY
+ {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY},
+ #else
+ {"UNAVAILABLE_IP_FAMILY", 32, 145},
+ #endif
+ #ifdef BIO_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 32, 120},
+ #endif
+ #ifdef BIO_R_UNKNOWN_INFO_TYPE
+ {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE},
+ #else
+ {"UNKNOWN_INFO_TYPE", 32, 140},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_IP_FAMILY
+ {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY},
+ #else
+ {"UNSUPPORTED_IP_FAMILY", 32, 146},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_METHOD
+ {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD},
+ #else
+ {"UNSUPPORTED_METHOD", 32, 121},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY
+ {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY},
+ #else
+ {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131},
+ #endif
+ #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO
+ {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO},
+ #else
+ {"WRITE_TO_READ_ONLY_BIO", 32, 126},
+ #endif
+ #ifdef BIO_R_WSASTARTUP
+ {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP},
+ #else
+ {"WSASTARTUP", 32, 122},
+ #endif
+ #ifdef BN_R_ARG2_LT_ARG3
+ {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3},
+ #else
+ {"ARG2_LT_ARG3", 3, 100},
+ #endif
+ #ifdef BN_R_BAD_RECIPROCAL
+ {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL},
+ #else
+ {"BAD_RECIPROCAL", 3, 101},
+ #endif
+ #ifdef BN_R_BIGNUM_TOO_LONG
+ {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG},
+ #else
+ {"BIGNUM_TOO_LONG", 3, 114},
+ #endif
+ #ifdef BN_R_BITS_TOO_SMALL
+ {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL},
+ #else
+ {"BITS_TOO_SMALL", 3, 118},
+ #endif
+ #ifdef BN_R_CALLED_WITH_EVEN_MODULUS
+ {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS},
+ #else
+ {"CALLED_WITH_EVEN_MODULUS", 3, 102},
+ #endif
+ #ifdef BN_R_DIV_BY_ZERO
+ {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO},
+ #else
+ {"DIV_BY_ZERO", 3, 103},
+ #endif
+ #ifdef BN_R_ENCODING_ERROR
+ {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR},
+ #else
+ {"ENCODING_ERROR", 3, 104},
+ #endif
+ #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA},
+ #else
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105},
+ #endif
+ #ifdef BN_R_INPUT_NOT_REDUCED
+ {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED},
+ #else
+ {"INPUT_NOT_REDUCED", 3, 110},
+ #endif
+ #ifdef BN_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 3, 106},
+ #endif
+ #ifdef BN_R_INVALID_RANGE
+ {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE},
+ #else
+ {"INVALID_RANGE", 3, 115},
+ #endif
+ #ifdef BN_R_INVALID_SHIFT
+ {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT},
+ #else
+ {"INVALID_SHIFT", 3, 119},
+ #endif
+ #ifdef BN_R_NOT_A_SQUARE
+ {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE},
+ #else
+ {"NOT_A_SQUARE", 3, 111},
+ #endif
+ #ifdef BN_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 3, 107},
+ #endif
+ #ifdef BN_R_NO_INVERSE
+ {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE},
+ #else
+ {"NO_INVERSE", 3, 108},
+ #endif
+ #ifdef BN_R_NO_SOLUTION
+ {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION},
+ #else
+ {"NO_SOLUTION", 3, 116},
+ #endif
+ #ifdef BN_R_PRIVATE_KEY_TOO_LARGE
+ {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE},
+ #else
+ {"PRIVATE_KEY_TOO_LARGE", 3, 117},
+ #endif
+ #ifdef BN_R_P_IS_NOT_PRIME
+ {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME},
+ #else
+ {"P_IS_NOT_PRIME", 3, 112},
+ #endif
+ #ifdef BN_R_TOO_MANY_ITERATIONS
+ {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS},
+ #else
+ {"TOO_MANY_ITERATIONS", 3, 113},
+ #endif
+ #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES
+ {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES},
+ #else
+ {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109},
+ #endif
+ #ifdef CMS_R_ADD_SIGNER_ERROR
+ {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR},
+ #else
+ {"ADD_SIGNER_ERROR", 46, 99},
+ #endif
+ #ifdef CMS_R_ATTRIBUTE_ERROR
+ {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR},
+ #else
+ {"ATTRIBUTE_ERROR", 46, 161},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT
+ {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT},
+ #else
+ {"CERTIFICATE_ALREADY_PRESENT", 46, 175},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID
+ {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID},
+ #else
+ {"CERTIFICATE_HAS_NO_KEYID", 46, 160},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 46, 100},
+ #endif
+ #ifdef CMS_R_CIPHER_INITIALISATION_ERROR
+ {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_INITIALISATION_ERROR", 46, 101},
+ #endif
+ #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102},
+ #endif
+ #ifdef CMS_R_CMS_DATAFINAL_ERROR
+ {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR},
+ #else
+ {"CMS_DATAFINAL_ERROR", 46, 103},
+ #endif
+ #ifdef CMS_R_CMS_LIB
+ {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB},
+ #else
+ {"CMS_LIB", 46, 104},
+ #endif
+ #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH
+ {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH},
+ #else
+ {"CONTENTIDENTIFIER_MISMATCH", 46, 170},
+ #endif
+ #ifdef CMS_R_CONTENT_NOT_FOUND
+ {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND},
+ #else
+ {"CONTENT_NOT_FOUND", 46, 105},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_MISMATCH
+ {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH},
+ #else
+ {"CONTENT_TYPE_MISMATCH", 46, 171},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108},
+ #endif
+ #ifdef CMS_R_CONTENT_VERIFY_ERROR
+ {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR},
+ #else
+ {"CONTENT_VERIFY_ERROR", 46, 109},
+ #endif
+ #ifdef CMS_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 46, 110},
+ #endif
+ #ifdef CMS_R_CTRL_FAILURE
+ {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE},
+ #else
+ {"CTRL_FAILURE", 46, 111},
+ #endif
+ #ifdef CMS_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 46, 112},
+ #endif
+ #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY
+ {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY},
+ #else
+ {"ERROR_GETTING_PUBLIC_KEY", 46, 113},
+ #endif
+ #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE},
+ #else
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_KEY
+ {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY},
+ #else
+ {"ERROR_SETTING_KEY", 46, 115},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO
+ {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO},
+ #else
+ {"ERROR_SETTING_RECIPIENTINFO", 46, 116},
+ #endif
+ #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH
+ {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH},
+ #else
+ {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER},
+ #else
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 46, 118},
+ #endif
+ #ifdef CMS_R_MD_BIO_INIT_ERROR
+ {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR},
+ #else
+ {"MD_BIO_INIT_ERROR", 46, 119},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH
+ {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_ERROR
+ {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR},
+ #else
+ {"MSGSIGDIGEST_ERROR", 46, 172},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE},
+ #else
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH
+ {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH},
+ #else
+ {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163},
+ #endif
+ #ifdef CMS_R_NEED_ONE_SIGNER
+ {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER},
+ #else
+ {"NEED_ONE_SIGNER", 46, 164},
+ #endif
+ #ifdef CMS_R_NOT_A_SIGNED_RECEIPT
+ {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT},
+ #else
+ {"NOT_A_SIGNED_RECEIPT", 46, 165},
+ #endif
+ #ifdef CMS_R_NOT_ENCRYPTED_DATA
+ {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA},
+ #else
+ {"NOT_ENCRYPTED_DATA", 46, 122},
+ #endif
+ #ifdef CMS_R_NOT_KEK
+ {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK},
+ #else
+ {"NOT_KEK", 46, 123},
+ #endif
+ #ifdef CMS_R_NOT_KEY_AGREEMENT
+ {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT},
+ #else
+ {"NOT_KEY_AGREEMENT", 46, 181},
+ #endif
+ #ifdef CMS_R_NOT_KEY_TRANSPORT
+ {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT},
+ #else
+ {"NOT_KEY_TRANSPORT", 46, 124},
+ #endif
+ #ifdef CMS_R_NOT_PWRI
+ {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI},
+ #else
+ {"NOT_PWRI", 46, 177},
+ #endif
+ #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125},
+ #endif
+ #ifdef CMS_R_NO_CIPHER
+ {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER},
+ #else
+ {"NO_CIPHER", 46, 126},
+ #endif
+ #ifdef CMS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 46, 127},
+ #endif
+ #ifdef CMS_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 46, 173},
+ #endif
+ #ifdef CMS_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 46, 128},
+ #endif
+ #ifdef CMS_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 46, 129},
+ #endif
+ #ifdef CMS_R_NO_KEY
+ {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY},
+ #else
+ {"NO_KEY", 46, 130},
+ #endif
+ #ifdef CMS_R_NO_KEY_OR_CERT
+ {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT},
+ #else
+ {"NO_KEY_OR_CERT", 46, 174},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_DIGEST
+ {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST},
+ #else
+ {"NO_MATCHING_DIGEST", 46, 131},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_RECIPIENT
+ {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT},
+ #else
+ {"NO_MATCHING_RECIPIENT", 46, 132},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_SIGNATURE
+ {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE},
+ #else
+ {"NO_MATCHING_SIGNATURE", 46, 166},
+ #endif
+ #ifdef CMS_R_NO_MSGSIGDIGEST
+ {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST},
+ #else
+ {"NO_MSGSIGDIGEST", 46, 167},
+ #endif
+ #ifdef CMS_R_NO_PASSWORD
+ {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD},
+ #else
+ {"NO_PASSWORD", 46, 178},
+ #endif
+ #ifdef CMS_R_NO_PRIVATE_KEY
+ {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY},
+ #else
+ {"NO_PRIVATE_KEY", 46, 133},
+ #endif
+ #ifdef CMS_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 46, 134},
+ #endif
+ #ifdef CMS_R_NO_RECEIPT_REQUEST
+ {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST},
+ #else
+ {"NO_RECEIPT_REQUEST", 46, 168},
+ #endif
+ #ifdef CMS_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 46, 135},
+ #endif
+ #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136},
+ #endif
+ #ifdef CMS_R_RECEIPT_DECODE_ERROR
+ {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR},
+ #else
+ {"RECEIPT_DECODE_ERROR", 46, 169},
+ #endif
+ #ifdef CMS_R_RECIPIENT_ERROR
+ {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR},
+ #else
+ {"RECIPIENT_ERROR", 46, 137},
+ #endif
+ #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138},
+ #endif
+ #ifdef CMS_R_SIGNFINAL_ERROR
+ {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR},
+ #else
+ {"SIGNFINAL_ERROR", 46, 139},
+ #endif
+ #ifdef CMS_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 46, 140},
+ #endif
+ #ifdef CMS_R_STORE_INIT_ERROR
+ {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR},
+ #else
+ {"STORE_INIT_ERROR", 46, 141},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA
+ {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"TYPE_NOT_COMPRESSED_DATA", 46, 142},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DATA
+ {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA},
+ #else
+ {"TYPE_NOT_DATA", 46, 143},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA
+ {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA},
+ #else
+ {"TYPE_NOT_DIGESTED_DATA", 46, 144},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA
+ {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA},
+ #else
+ {"TYPE_NOT_ENCRYPTED_DATA", 46, 145},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA
+ {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"TYPE_NOT_ENVELOPED_DATA", 46, 146},
+ #endif
+ #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT
+ {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT},
+ #else
+ {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147},
+ #endif
+ #ifdef CMS_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 46, 148},
+ #endif
+ #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 46, 149},
+ #endif
+ #ifdef CMS_R_UNKNOWN_ID
+ {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID},
+ #else
+ {"UNKNOWN_ID", 46, 150},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 46, 152},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM
+ {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEK_ALGORITHM", 46, 153},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE
+ {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 46, 156},
+ #endif
+ #ifdef CMS_R_UNWRAP_ERROR
+ {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR},
+ #else
+ {"UNWRAP_ERROR", 46, 157},
+ #endif
+ #ifdef CMS_R_UNWRAP_FAILURE
+ {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE},
+ #else
+ {"UNWRAP_FAILURE", 46, 180},
+ #endif
+ #ifdef CMS_R_VERIFICATION_FAILURE
+ {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE},
+ #else
+ {"VERIFICATION_FAILURE", 46, 158},
+ #endif
+ #ifdef CMS_R_WRAP_ERROR
+ {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR},
+ #else
+ {"WRAP_ERROR", 46, 159},
+ #endif
+ #ifdef COMP_R_ZLIB_DEFLATE_ERROR
+ {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR},
+ #else
+ {"ZLIB_DEFLATE_ERROR", 41, 99},
+ #endif
+ #ifdef COMP_R_ZLIB_INFLATE_ERROR
+ {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR},
+ #else
+ {"ZLIB_INFLATE_ERROR", 41, 100},
+ #endif
+ #ifdef COMP_R_ZLIB_NOT_SUPPORTED
+ {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED},
+ #else
+ {"ZLIB_NOT_SUPPORTED", 41, 101},
+ #endif
+ #ifdef CONF_R_ERROR_LOADING_DSO
+ {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO},
+ #else
+ {"ERROR_LOADING_DSO", 14, 110},
+ #endif
+ #ifdef CONF_R_LIST_CANNOT_BE_NULL
+ {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL},
+ #else
+ {"LIST_CANNOT_BE_NULL", 14, 115},
+ #endif
+ #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET
+ {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET},
+ #else
+ {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100},
+ #endif
+ #ifdef CONF_R_MISSING_EQUAL_SIGN
+ {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN},
+ #else
+ {"MISSING_EQUAL_SIGN", 14, 101},
+ #endif
+ #ifdef CONF_R_MISSING_INIT_FUNCTION
+ {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION},
+ #else
+ {"MISSING_INIT_FUNCTION", 14, 112},
+ #endif
+ #ifdef CONF_R_MODULE_INITIALIZATION_ERROR
+ {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR},
+ #else
+ {"MODULE_INITIALIZATION_ERROR", 14, 109},
+ #endif
+ #ifdef CONF_R_NO_CLOSE_BRACE
+ {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE},
+ #else
+ {"NO_CLOSE_BRACE", 14, 102},
+ #endif
+ #ifdef CONF_R_NO_CONF
+ {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF},
+ #else
+ {"NO_CONF", 14, 105},
+ #endif
+ #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE},
+ #else
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106},
+ #endif
+ #ifdef CONF_R_NO_SECTION
+ {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION},
+ #else
+ {"NO_SECTION", 14, 107},
+ #endif
+ #ifdef CONF_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 14, 114},
+ #endif
+ #ifdef CONF_R_NO_VALUE
+ {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE},
+ #else
+ {"NO_VALUE", 14, 108},
+ #endif
+ #ifdef CONF_R_NUMBER_TOO_LARGE
+ {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE},
+ #else
+ {"NUMBER_TOO_LARGE", 14, 121},
+ #endif
+ #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE
+ {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE},
+ #else
+ {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 14, 117},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 14, 119},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 14, 120},
+ #endif
+ #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION
+ {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION},
+ #else
+ {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103},
+ #endif
+ #ifdef CONF_R_UNKNOWN_MODULE_NAME
+ {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME},
+ #else
+ {"UNKNOWN_MODULE_NAME", 14, 113},
+ #endif
+ #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG
+ {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG},
+ #else
+ {"VARIABLE_EXPANSION_TOO_LONG", 14, 116},
+ #endif
+ #ifdef CONF_R_VARIABLE_HAS_NO_VALUE
+ {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE},
+ #else
+ {"VARIABLE_HAS_NO_VALUE", 14, 104},
+ #endif
+ #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED
+ {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED},
+ #else
+ {"FIPS_MODE_NOT_SUPPORTED", 15, 101},
+ #endif
+ #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT
+ {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT},
+ #else
+ {"ILLEGAL_HEX_DIGIT", 15, 102},
+ #endif
+ #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS
+ {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS},
+ #else
+ {"ODD_NUMBER_OF_DIGITS", 15, 103},
+ #endif
+ #ifdef CT_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 50, 108},
+ #endif
+ #ifdef CT_R_INVALID_LOG_ID_LENGTH
+ {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH},
+ #else
+ {"INVALID_LOG_ID_LENGTH", 50, 100},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID
+ {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID},
+ #else
+ {"LOG_CONF_INVALID", 50, 109},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID_KEY
+ {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY},
+ #else
+ {"LOG_CONF_INVALID_KEY", 50, 110},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION
+ {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION},
+ #else
+ {"LOG_CONF_MISSING_DESCRIPTION", 50, 111},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_KEY
+ {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY},
+ #else
+ {"LOG_CONF_MISSING_KEY", 50, 112},
+ #endif
+ #ifdef CT_R_LOG_KEY_INVALID
+ {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID},
+ #else
+ {"LOG_KEY_INVALID", 50, 113},
+ #endif
+ #ifdef CT_R_SCT_FUTURE_TIMESTAMP
+ {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP},
+ #else
+ {"SCT_FUTURE_TIMESTAMP", 50, 116},
+ #endif
+ #ifdef CT_R_SCT_INVALID
+ {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID},
+ #else
+ {"SCT_INVALID", 50, 104},
+ #endif
+ #ifdef CT_R_SCT_INVALID_SIGNATURE
+ {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE},
+ #else
+ {"SCT_INVALID_SIGNATURE", 50, 107},
+ #endif
+ #ifdef CT_R_SCT_LIST_INVALID
+ {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID},
+ #else
+ {"SCT_LIST_INVALID", 50, 105},
+ #endif
+ #ifdef CT_R_SCT_LOG_ID_MISMATCH
+ {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH},
+ #else
+ {"SCT_LOG_ID_MISMATCH", 50, 114},
+ #endif
+ #ifdef CT_R_SCT_NOT_SET
+ {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET},
+ #else
+ {"SCT_NOT_SET", 50, 106},
+ #endif
+ #ifdef CT_R_SCT_UNSUPPORTED_VERSION
+ {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION},
+ #else
+ {"SCT_UNSUPPORTED_VERSION", 50, 115},
+ #endif
+ #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID
+ {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID},
+ #else
+ {"UNRECOGNIZED_SIGNATURE_NID", 50, 101},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE
+ {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE},
+ #else
+ {"UNSUPPORTED_ENTRY_TYPE", 50, 102},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 50, 103},
+ #endif
+ #ifdef DH_R_BAD_GENERATOR
+ {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR},
+ #else
+ {"BAD_GENERATOR", 5, 101},
+ #endif
+ #ifdef DH_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 5, 109},
+ #endif
+ #ifdef DH_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 5, 106},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_J_VALUE
+ {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE},
+ #else
+ {"CHECK_INVALID_J_VALUE", 5, 115},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_Q_VALUE
+ {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE},
+ #else
+ {"CHECK_INVALID_Q_VALUE", 5, 116},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_INVALID
+ {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID},
+ #else
+ {"CHECK_PUBKEY_INVALID", 5, 122},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE
+ {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE},
+ #else
+ {"CHECK_PUBKEY_TOO_LARGE", 5, 123},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL
+ {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL},
+ #else
+ {"CHECK_PUBKEY_TOO_SMALL", 5, 124},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_PRIME
+ {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME},
+ #else
+ {"CHECK_P_NOT_PRIME", 5, 117},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME
+ {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME},
+ #else
+ {"CHECK_P_NOT_SAFE_PRIME", 5, 118},
+ #endif
+ #ifdef DH_R_CHECK_Q_NOT_PRIME
+ {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME},
+ #else
+ {"CHECK_Q_NOT_PRIME", 5, 119},
+ #endif
+ #ifdef DH_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 5, 104},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NAME
+ {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME},
+ #else
+ {"INVALID_PARAMETER_NAME", 5, 110},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NID
+ {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID},
+ #else
+ {"INVALID_PARAMETER_NID", 5, 114},
+ #endif
+ #ifdef DH_R_INVALID_PUBKEY
+ {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY},
+ #else
+ {"INVALID_PUBKEY", 5, 102},
+ #endif
+ #ifdef DH_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 5, 112},
+ #endif
+ #ifdef DH_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 5, 108},
+ #endif
+ #ifdef DH_R_MISSING_PUBKEY
+ {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY},
+ #else
+ {"MISSING_PUBKEY", 5, 125},
+ #endif
+ #ifdef DH_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 5, 103},
+ #endif
+ #ifdef DH_R_NOT_SUITABLE_GENERATOR
+ {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR},
+ #else
+ {"NOT_SUITABLE_GENERATOR", 5, 120},
+ #endif
+ #ifdef DH_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 5, 107},
+ #endif
+ #ifdef DH_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 5, 100},
+ #endif
+ #ifdef DH_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 5, 105},
+ #endif
+ #ifdef DH_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 5, 111},
+ #endif
+ #ifdef DH_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 5, 113},
+ #endif
+ #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR
+ {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR},
+ #else
+ {"UNABLE_TO_CHECK_GENERATOR", 5, 121},
+ #endif
+ #ifdef DSA_R_BAD_Q_VALUE
+ {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE},
+ #else
+ {"BAD_Q_VALUE", 10, 102},
+ #endif
+ #ifdef DSA_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 10, 108},
+ #endif
+ #ifdef DSA_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 10, 109},
+ #endif
+ #ifdef DSA_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 10, 104},
+ #endif
+ #ifdef DSA_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 10, 106},
+ #endif
+ #ifdef DSA_R_INVALID_PARAMETERS
+ {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS},
+ #else
+ {"INVALID_PARAMETERS", 10, 112},
+ #endif
+ #ifdef DSA_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 10, 101},
+ #endif
+ #ifdef DSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 10, 111},
+ #endif
+ #ifdef DSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 10, 103},
+ #endif
+ #ifdef DSA_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 10, 107},
+ #endif
+ #ifdef DSA_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 10, 105},
+ #endif
+ #ifdef DSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 10, 113},
+ #endif
+ #ifdef DSA_R_SEED_LEN_SMALL
+ {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL},
+ #else
+ {"SEED_LEN_SMALL", 10, 110},
+ #endif
+ #ifdef EC_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 16, 115},
+ #endif
+ #ifdef EC_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 16, 156},
+ #endif
+ #ifdef EC_R_BIGNUM_OUT_OF_RANGE
+ {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE},
+ #else
+ {"BIGNUM_OUT_OF_RANGE", 16, 144},
+ #endif
+ #ifdef EC_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 16, 100},
+ #endif
+ #ifdef EC_R_CANNOT_INVERT
+ {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT},
+ #else
+ {"CANNOT_INVERT", 16, 165},
+ #endif
+ #ifdef EC_R_COORDINATES_OUT_OF_RANGE
+ {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE},
+ #else
+ {"COORDINATES_OUT_OF_RANGE", 16, 146},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159},
+ #endif
+ #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE
+ {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE},
+ #else
+ {"D2I_ECPKPARAMETERS_FAILURE", 16, 117},
+ #endif
+ #ifdef EC_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 16, 142},
+ #endif
+ #ifdef EC_R_DISCRIMINANT_IS_ZERO
+ {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO},
+ #else
+ {"DISCRIMINANT_IS_ZERO", 16, 118},
+ #endif
+ #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE},
+ #else
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119},
+ #endif
+ #ifdef EC_R_FIELD_TOO_LARGE
+ {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE},
+ #else
+ {"FIELD_TOO_LARGE", 16, 143},
+ #endif
+ #ifdef EC_R_GF2M_NOT_SUPPORTED
+ {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED},
+ #else
+ {"GF2M_NOT_SUPPORTED", 16, 147},
+ #endif
+ #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE
+ {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE},
+ #else
+ {"GROUP2PKPARAMETERS_FAILURE", 16, 120},
+ #endif
+ #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE
+ {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE},
+ #else
+ {"I2D_ECPKPARAMETERS_FAILURE", 16, 121},
+ #endif
+ #ifdef EC_R_INCOMPATIBLE_OBJECTS
+ {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS},
+ #else
+ {"INCOMPATIBLE_OBJECTS", 16, 101},
+ #endif
+ #ifdef EC_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 16, 112},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSED_POINT
+ {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT},
+ #else
+ {"INVALID_COMPRESSED_POINT", 16, 110},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSION_BIT
+ {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT},
+ #else
+ {"INVALID_COMPRESSION_BIT", 16, 109},
+ #endif
+ #ifdef EC_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 16, 141},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 16, 151},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 16, 138},
+ #endif
+ #ifdef EC_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 16, 102},
+ #endif
+ #ifdef EC_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 16, 103},
+ #endif
+ #ifdef EC_R_INVALID_FORM
+ {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM},
+ #else
+ {"INVALID_FORM", 16, 104},
+ #endif
+ #ifdef EC_R_INVALID_GROUP_ORDER
+ {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER},
+ #else
+ {"INVALID_GROUP_ORDER", 16, 122},
+ #endif
+ #ifdef EC_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 16, 116},
+ #endif
+ #ifdef EC_R_INVALID_OUTPUT_LENGTH
+ {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH},
+ #else
+ {"INVALID_OUTPUT_LENGTH", 16, 161},
+ #endif
+ #ifdef EC_R_INVALID_PEER_KEY
+ {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY},
+ #else
+ {"INVALID_PEER_KEY", 16, 133},
+ #endif
+ #ifdef EC_R_INVALID_PENTANOMIAL_BASIS
+ {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS},
+ #else
+ {"INVALID_PENTANOMIAL_BASIS", 16, 132},
+ #endif
+ #ifdef EC_R_INVALID_PRIVATE_KEY
+ {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY},
+ #else
+ {"INVALID_PRIVATE_KEY", 16, 123},
+ #endif
+ #ifdef EC_R_INVALID_TRINOMIAL_BASIS
+ {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS},
+ #else
+ {"INVALID_TRINOMIAL_BASIS", 16, 137},
+ #endif
+ #ifdef EC_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 16, 148},
+ #endif
+ #ifdef EC_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 16, 140},
+ #endif
+ #ifdef EC_R_LADDER_POST_FAILURE
+ {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE},
+ #else
+ {"LADDER_POST_FAILURE", 16, 136},
+ #endif
+ #ifdef EC_R_LADDER_PRE_FAILURE
+ {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE},
+ #else
+ {"LADDER_PRE_FAILURE", 16, 153},
+ #endif
+ #ifdef EC_R_LADDER_STEP_FAILURE
+ {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE},
+ #else
+ {"LADDER_STEP_FAILURE", 16, 162},
+ #endif
+ #ifdef EC_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 16, 124},
+ #endif
+ #ifdef EC_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 16, 125},
+ #endif
+ #ifdef EC_R_NEED_NEW_SETUP_VALUES
+ {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES},
+ #else
+ {"NEED_NEW_SETUP_VALUES", 16, 157},
+ #endif
+ #ifdef EC_R_NOT_A_NIST_PRIME
+ {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME},
+ #else
+ {"NOT_A_NIST_PRIME", 16, 135},
+ #endif
+ #ifdef EC_R_NOT_IMPLEMENTED
+ {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED},
+ #else
+ {"NOT_IMPLEMENTED", 16, 126},
+ #endif
+ #ifdef EC_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 16, 111},
+ #endif
+ #ifdef EC_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 16, 139},
+ #endif
+ #ifdef EC_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 16, 154},
+ #endif
+ #ifdef EC_R_OPERATION_NOT_SUPPORTED
+ {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED},
+ #else
+ {"OPERATION_NOT_SUPPORTED", 16, 152},
+ #endif
+ #ifdef EC_R_PASSED_NULL_PARAMETER
+ {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER},
+ #else
+ {"PASSED_NULL_PARAMETER", 16, 134},
+ #endif
+ #ifdef EC_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 16, 149},
+ #endif
+ #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE
+ {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE},
+ #else
+ {"PKPARAMETERS2GROUP_FAILURE", 16, 127},
+ #endif
+ #ifdef EC_R_POINT_ARITHMETIC_FAILURE
+ {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE},
+ #else
+ {"POINT_ARITHMETIC_FAILURE", 16, 155},
+ #endif
+ #ifdef EC_R_POINT_AT_INFINITY
+ {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY},
+ #else
+ {"POINT_AT_INFINITY", 16, 106},
+ #endif
+ #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE
+ {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE},
+ #else
+ {"POINT_COORDINATES_BLIND_FAILURE", 16, 163},
+ #endif
+ #ifdef EC_R_POINT_IS_NOT_ON_CURVE
+ {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE},
+ #else
+ {"POINT_IS_NOT_ON_CURVE", 16, 107},
+ #endif
+ #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED
+ {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED},
+ #else
+ {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158},
+ #endif
+ #ifdef EC_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 16, 150},
+ #endif
+ #ifdef EC_R_SLOT_FULL
+ {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL},
+ #else
+ {"SLOT_FULL", 16, 108},
+ #endif
+ #ifdef EC_R_UNDEFINED_GENERATOR
+ {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR},
+ #else
+ {"UNDEFINED_GENERATOR", 16, 113},
+ #endif
+ #ifdef EC_R_UNDEFINED_ORDER
+ {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER},
+ #else
+ {"UNDEFINED_ORDER", 16, 128},
+ #endif
+ #ifdef EC_R_UNKNOWN_COFACTOR
+ {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR},
+ #else
+ {"UNKNOWN_COFACTOR", 16, 164},
+ #endif
+ #ifdef EC_R_UNKNOWN_GROUP
+ {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP},
+ #else
+ {"UNKNOWN_GROUP", 16, 129},
+ #endif
+ #ifdef EC_R_UNKNOWN_ORDER
+ {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER},
+ #else
+ {"UNKNOWN_ORDER", 16, 114},
+ #endif
+ #ifdef EC_R_UNSUPPORTED_FIELD
+ {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD},
+ #else
+ {"UNSUPPORTED_FIELD", 16, 131},
+ #endif
+ #ifdef EC_R_WRONG_CURVE_PARAMETERS
+ {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS},
+ #else
+ {"WRONG_CURVE_PARAMETERS", 16, 145},
+ #endif
+ #ifdef EC_R_WRONG_ORDER
+ {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER},
+ #else
+ {"WRONG_ORDER", 16, 130},
+ #endif
+ #ifdef ENGINE_R_ALREADY_LOADED
+ {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED},
+ #else
+ {"ALREADY_LOADED", 38, 100},
+ #endif
+ #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER
+ {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER},
+ #else
+ {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133},
+ #endif
+ #ifdef ENGINE_R_CMD_NOT_EXECUTABLE
+ {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE},
+ #else
+ {"CMD_NOT_EXECUTABLE", 38, 134},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_INPUT
+ {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT},
+ #else
+ {"COMMAND_TAKES_INPUT", 38, 135},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT
+ {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT},
+ #else
+ {"COMMAND_TAKES_NO_INPUT", 38, 136},
+ #endif
+ #ifdef ENGINE_R_CONFLICTING_ENGINE_ID
+ {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID},
+ #else
+ {"CONFLICTING_ENGINE_ID", 38, 103},
+ #endif
+ #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119},
+ #endif
+ #ifdef ENGINE_R_DSO_FAILURE
+ {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE},
+ #else
+ {"DSO_FAILURE", 38, 104},
+ #endif
+ #ifdef ENGINE_R_DSO_NOT_FOUND
+ {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND},
+ #else
+ {"DSO_NOT_FOUND", 38, 132},
+ #endif
+ #ifdef ENGINE_R_ENGINES_SECTION_ERROR
+ {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR},
+ #else
+ {"ENGINES_SECTION_ERROR", 38, 148},
+ #endif
+ #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR
+ {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR},
+ #else
+ {"ENGINE_CONFIGURATION_ERROR", 38, 102},
+ #endif
+ #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST
+ {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST},
+ #else
+ {"ENGINE_IS_NOT_IN_LIST", 38, 105},
+ #endif
+ #ifdef ENGINE_R_ENGINE_SECTION_ERROR
+ {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR},
+ #else
+ {"ENGINE_SECTION_ERROR", 38, 149},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY
+ {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY},
+ #else
+ {"FAILED_LOADING_PRIVATE_KEY", 38, 128},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY
+ {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY},
+ #else
+ {"FAILED_LOADING_PUBLIC_KEY", 38, 129},
+ #endif
+ #ifdef ENGINE_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 38, 106},
+ #endif
+ #ifdef ENGINE_R_ID_OR_NAME_MISSING
+ {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING},
+ #else
+ {"ID_OR_NAME_MISSING", 38, 108},
+ #endif
+ #ifdef ENGINE_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 38, 109},
+ #endif
+ #ifdef ENGINE_R_INTERNAL_LIST_ERROR
+ {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR},
+ #else
+ {"INTERNAL_LIST_ERROR", 38, 110},
+ #endif
+ #ifdef ENGINE_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 38, 143},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NAME
+ {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME},
+ #else
+ {"INVALID_CMD_NAME", 38, 137},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NUMBER
+ {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER},
+ #else
+ {"INVALID_CMD_NUMBER", 38, 138},
+ #endif
+ #ifdef ENGINE_R_INVALID_INIT_VALUE
+ {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE},
+ #else
+ {"INVALID_INIT_VALUE", 38, 151},
+ #endif
+ #ifdef ENGINE_R_INVALID_STRING
+ {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING},
+ #else
+ {"INVALID_STRING", 38, 150},
+ #endif
+ #ifdef ENGINE_R_NOT_INITIALISED
+ {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED},
+ #else
+ {"NOT_INITIALISED", 38, 117},
+ #endif
+ #ifdef ENGINE_R_NOT_LOADED
+ {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED},
+ #else
+ {"NOT_LOADED", 38, 112},
+ #endif
+ #ifdef ENGINE_R_NO_CONTROL_FUNCTION
+ {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION},
+ #else
+ {"NO_CONTROL_FUNCTION", 38, 120},
+ #endif
+ #ifdef ENGINE_R_NO_INDEX
+ {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX},
+ #else
+ {"NO_INDEX", 38, 144},
+ #endif
+ #ifdef ENGINE_R_NO_LOAD_FUNCTION
+ {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION},
+ #else
+ {"NO_LOAD_FUNCTION", 38, 125},
+ #endif
+ #ifdef ENGINE_R_NO_REFERENCE
+ {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE},
+ #else
+ {"NO_REFERENCE", 38, 130},
+ #endif
+ #ifdef ENGINE_R_NO_SUCH_ENGINE
+ {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE},
+ #else
+ {"NO_SUCH_ENGINE", 38, 116},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER
+ {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER},
+ #else
+ {"UNIMPLEMENTED_CIPHER", 38, 146},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST
+ {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST},
+ #else
+ {"UNIMPLEMENTED_DIGEST", 38, 147},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD},
+ #else
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101},
+ #endif
+ #ifdef ENGINE_R_VERSION_INCOMPATIBILITY
+ {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY},
+ #else
+ {"VERSION_INCOMPATIBILITY", 38, 145},
+ #endif
+ #ifdef EVP_R_AES_KEY_SETUP_FAILED
+ {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED},
+ #else
+ {"AES_KEY_SETUP_FAILED", 6, 143},
+ #endif
+ #ifdef EVP_R_ARIA_KEY_SETUP_FAILED
+ {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED},
+ #else
+ {"ARIA_KEY_SETUP_FAILED", 6, 176},
+ #endif
+ #ifdef EVP_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 6, 100},
+ #endif
+ #ifdef EVP_R_BAD_KEY_LENGTH
+ {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH},
+ #else
+ {"BAD_KEY_LENGTH", 6, 195},
+ #endif
+ #ifdef EVP_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 6, 155},
+ #endif
+ #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED
+ {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED},
+ #else
+ {"CAMELLIA_KEY_SETUP_FAILED", 6, 157},
+ #endif
+ #ifdef EVP_R_CIPHER_PARAMETER_ERROR
+ {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR},
+ #else
+ {"CIPHER_PARAMETER_ERROR", 6, 122},
+ #endif
+ #ifdef EVP_R_COMMAND_NOT_SUPPORTED
+ {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED},
+ #else
+ {"COMMAND_NOT_SUPPORTED", 6, 147},
+ #endif
+ #ifdef EVP_R_COPY_ERROR
+ {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR},
+ #else
+ {"COPY_ERROR", 6, 173},
+ #endif
+ #ifdef EVP_R_CTRL_NOT_IMPLEMENTED
+ {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_NOT_IMPLEMENTED", 6, 132},
+ #endif
+ #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133},
+ #endif
+ #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH},
+ #else
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138},
+ #endif
+ #ifdef EVP_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 6, 114},
+ #endif
+ #ifdef EVP_R_DIFFERENT_KEY_TYPES
+ {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES},
+ #else
+ {"DIFFERENT_KEY_TYPES", 6, 101},
+ #endif
+ #ifdef EVP_R_DIFFERENT_PARAMETERS
+ {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS},
+ #else
+ {"DIFFERENT_PARAMETERS", 6, 153},
+ #endif
+ #ifdef EVP_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 6, 165},
+ #endif
+ #ifdef EVP_R_ERROR_SETTING_FIPS_MODE
+ {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE},
+ #else
+ {"ERROR_SETTING_FIPS_MODE", 6, 166},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_HMAC_KEY
+ {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY},
+ #else
+ {"EXPECTING_AN_HMAC_KEY", 6, 174},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_RSA_KEY
+ {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY},
+ #else
+ {"EXPECTING_AN_RSA_KEY", 6, 127},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DH_KEY
+ {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY},
+ #else
+ {"EXPECTING_A_DH_KEY", 6, 128},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DSA_KEY
+ {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY},
+ #else
+ {"EXPECTING_A_DSA_KEY", 6, 129},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_EC_KEY
+ {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY},
+ #else
+ {"EXPECTING_A_EC_KEY", 6, 142},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_POLY1305_KEY
+ {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY},
+ #else
+ {"EXPECTING_A_POLY1305_KEY", 6, 164},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY
+ {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY},
+ #else
+ {"EXPECTING_A_SIPHASH_KEY", 6, 175},
+ #endif
+ #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED
+ {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED},
+ #else
+ {"FIPS_MODE_NOT_SUPPORTED", 6, 167},
+ #endif
+ #ifdef EVP_R_GET_RAW_KEY_FAILED
+ {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED},
+ #else
+ {"GET_RAW_KEY_FAILED", 6, 182},
+ #endif
+ #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS
+ {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS},
+ #else
+ {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171},
+ #endif
+ #ifdef EVP_R_INITIALIZATION_ERROR
+ {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR},
+ #else
+ {"INITIALIZATION_ERROR", 6, 134},
+ #endif
+ #ifdef EVP_R_INPUT_NOT_INITIALIZED
+ {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED},
+ #else
+ {"INPUT_NOT_INITIALIZED", 6, 111},
+ #endif
+ #ifdef EVP_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 6, 152},
+ #endif
+ #ifdef EVP_R_INVALID_FIPS_MODE
+ {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE},
+ #else
+ {"INVALID_FIPS_MODE", 6, 168},
+ #endif
+ #ifdef EVP_R_INVALID_IV_LENGTH
+ {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH},
+ #else
+ {"INVALID_IV_LENGTH", 6, 194},
+ #endif
+ #ifdef EVP_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 6, 163},
+ #endif
+ #ifdef EVP_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 6, 130},
+ #endif
+ #ifdef EVP_R_INVALID_OPERATION
+ {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION},
+ #else
+ {"INVALID_OPERATION", 6, 148},
+ #endif
+ #ifdef EVP_R_KEYGEN_FAILURE
+ {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE},
+ #else
+ {"KEYGEN_FAILURE", 6, 120},
+ #endif
+ #ifdef EVP_R_KEY_SETUP_FAILED
+ {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED},
+ #else
+ {"KEY_SETUP_FAILED", 6, 180},
+ #endif
+ #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED
+ {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED},
+ #else
+ {"MEMORY_LIMIT_EXCEEDED", 6, 172},
+ #endif
+ #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL
+ {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL},
+ #else
+ {"MESSAGE_DIGEST_IS_NULL", 6, 159},
+ #endif
+ #ifdef EVP_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 6, 144},
+ #endif
+ #ifdef EVP_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 6, 103},
+ #endif
+ #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH
+ {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH},
+ #else
+ {"NOT_XOF_OR_INVALID_LENGTH", 6, 178},
+ #endif
+ #ifdef EVP_R_NO_CIPHER_SET
+ {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET},
+ #else
+ {"NO_CIPHER_SET", 6, 131},
+ #endif
+ #ifdef EVP_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 6, 158},
+ #endif
+ #ifdef EVP_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 6, 139},
+ #endif
+ #ifdef EVP_R_NO_KEY_SET
+ {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET},
+ #else
+ {"NO_KEY_SET", 6, 154},
+ #endif
+ #ifdef EVP_R_NO_OPERATION_SET
+ {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET},
+ #else
+ {"NO_OPERATION_SET", 6, 149},
+ #endif
+ #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED
+ {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED},
+ #else
+ {"ONLY_ONESHOT_SUPPORTED", 6, 177},
+ #endif
+ #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150},
+ #endif
+ #ifdef EVP_R_OPERATON_NOT_INITIALIZED
+ {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED},
+ #else
+ {"OPERATON_NOT_INITIALIZED", 6, 151},
+ #endif
+ #ifdef EVP_R_PARTIALLY_OVERLAPPING
+ {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING},
+ #else
+ {"PARTIALLY_OVERLAPPING", 6, 162},
+ #endif
+ #ifdef EVP_R_PBKDF2_ERROR
+ {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR},
+ #else
+ {"PBKDF2_ERROR", 6, 181},
+ #endif
+ #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED},
+ #else
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR
+ {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR},
+ #else
+ {"PRIVATE_KEY_DECODE_ERROR", 6, 145},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR
+ {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR},
+ #else
+ {"PRIVATE_KEY_ENCODE_ERROR", 6, 146},
+ #endif
+ #ifdef EVP_R_PUBLIC_KEY_NOT_RSA
+ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA},
+ #else
+ {"PUBLIC_KEY_NOT_RSA", 6, 106},
+ #endif
+ #ifdef EVP_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 6, 160},
+ #endif
+ #ifdef EVP_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 6, 161},
+ #endif
+ #ifdef EVP_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 6, 169},
+ #endif
+ #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM
+ {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM},
+ #else
+ {"UNKNOWN_PBE_ALGORITHM", 6, 121},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 6, 156},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 6, 107},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEYLENGTH
+ {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH},
+ #else
+ {"UNSUPPORTED_KEYLENGTH", 6, 123},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION},
+ #else
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_SIZE
+ {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE},
+ #else
+ {"UNSUPPORTED_KEY_SIZE", 6, 108},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+ #else
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRF
+ {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF},
+ #else
+ {"UNSUPPORTED_PRF", 6, 125},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM},
+ #else
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_SALT_TYPE
+ {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE},
+ #else
+ {"UNSUPPORTED_SALT_TYPE", 6, 126},
+ #endif
+ #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED
+ {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED},
+ #else
+ {"WRAP_MODE_NOT_ALLOWED", 6, 170},
+ #endif
+ #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH
+ {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH},
+ #else
+ {"WRONG_FINAL_BLOCK_LENGTH", 6, 109},
+ #endif
+ #ifdef EVP_R_XTS_DUPLICATED_KEYS
+ {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS},
+ #else
+ {"XTS_DUPLICATED_KEYS", 6, 183},
+ #endif
+ #ifdef KDF_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 52, 100},
+ #endif
+ #ifdef KDF_R_MISSING_ITERATION_COUNT
+ {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT},
+ #else
+ {"MISSING_ITERATION_COUNT", 52, 109},
+ #endif
+ #ifdef KDF_R_MISSING_KEY
+ {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY},
+ #else
+ {"MISSING_KEY", 52, 104},
+ #endif
+ #ifdef KDF_R_MISSING_MESSAGE_DIGEST
+ {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST},
+ #else
+ {"MISSING_MESSAGE_DIGEST", 52, 105},
+ #endif
+ #ifdef KDF_R_MISSING_PARAMETER
+ {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER},
+ #else
+ {"MISSING_PARAMETER", 52, 101},
+ #endif
+ #ifdef KDF_R_MISSING_PASS
+ {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS},
+ #else
+ {"MISSING_PASS", 52, 110},
+ #endif
+ #ifdef KDF_R_MISSING_SALT
+ {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT},
+ #else
+ {"MISSING_SALT", 52, 111},
+ #endif
+ #ifdef KDF_R_MISSING_SECRET
+ {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET},
+ #else
+ {"MISSING_SECRET", 52, 107},
+ #endif
+ #ifdef KDF_R_MISSING_SEED
+ {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED},
+ #else
+ {"MISSING_SEED", 52, 106},
+ #endif
+ #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE
+ {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE},
+ #else
+ {"UNKNOWN_PARAMETER_TYPE", 52, 103},
+ #endif
+ #ifdef KDF_R_VALUE_ERROR
+ {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR},
+ #else
+ {"VALUE_ERROR", 52, 108},
+ #endif
+ #ifdef KDF_R_VALUE_MISSING
+ {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING},
+ #else
+ {"VALUE_MISSING", 52, 102},
+ #endif
+ #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 39, 101},
+ #endif
+ #ifdef OCSP_R_DIGEST_ERR
+ {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR},
+ #else
+ {"DIGEST_ERR", 39, 102},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD
+ {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD},
+ #else
+ {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD
+ {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD},
+ #else
+ {"ERROR_IN_THISUPDATE_FIELD", 39, 123},
+ #endif
+ #ifdef OCSP_R_ERROR_PARSING_URL
+ {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL},
+ #else
+ {"ERROR_PARSING_URL", 39, 121},
+ #endif
+ #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE
+ {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE},
+ #else
+ {"MISSING_OCSPSIGNING_USAGE", 39, 103},
+ #endif
+ #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE
+ {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE},
+ #else
+ {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124},
+ #endif
+ #ifdef OCSP_R_NOT_BASIC_RESPONSE
+ {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE},
+ #else
+ {"NOT_BASIC_RESPONSE", 39, 104},
+ #endif
+ #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN
+ {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN},
+ #else
+ {"NO_CERTIFICATES_IN_CHAIN", 39, 105},
+ #endif
+ #ifdef OCSP_R_NO_RESPONSE_DATA
+ {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA},
+ #else
+ {"NO_RESPONSE_DATA", 39, 108},
+ #endif
+ #ifdef OCSP_R_NO_REVOKED_TIME
+ {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME},
+ #else
+ {"NO_REVOKED_TIME", 39, 109},
+ #endif
+ #ifdef OCSP_R_NO_SIGNER_KEY
+ {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY},
+ #else
+ {"NO_SIGNER_KEY", 39, 130},
+ #endif
+ #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110},
+ #endif
+ #ifdef OCSP_R_REQUEST_NOT_SIGNED
+ {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED},
+ #else
+ {"REQUEST_NOT_SIGNED", 39, 128},
+ #endif
+ #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA},
+ #else
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111},
+ #endif
+ #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED
+ {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED},
+ #else
+ {"ROOT_CA_NOT_TRUSTED", 39, 112},
+ #endif
+ #ifdef OCSP_R_SERVER_RESPONSE_ERROR
+ {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR},
+ #else
+ {"SERVER_RESPONSE_ERROR", 39, 114},
+ #endif
+ #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR
+ {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR},
+ #else
+ {"SERVER_RESPONSE_PARSE_ERROR", 39, 115},
+ #endif
+ #ifdef OCSP_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 39, 117},
+ #endif
+ #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118},
+ #endif
+ #ifdef OCSP_R_STATUS_EXPIRED
+ {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED},
+ #else
+ {"STATUS_EXPIRED", 39, 125},
+ #endif
+ #ifdef OCSP_R_STATUS_NOT_YET_VALID
+ {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID},
+ #else
+ {"STATUS_NOT_YET_VALID", 39, 126},
+ #endif
+ #ifdef OCSP_R_STATUS_TOO_OLD
+ {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD},
+ #else
+ {"STATUS_TOO_OLD", 39, 127},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST
+ {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST", 39, 119},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 39, 120},
+ #endif
+ #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE},
+ #else
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129},
+ #endif
+ #ifdef PEM_R_BAD_BASE64_DECODE
+ {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
+ #else
+ {"BAD_BASE64_DECODE", 9, 100},
+ #endif
+ #ifdef PEM_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 9, 101},
+ #endif
+ #ifdef PEM_R_BAD_END_LINE
+ {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
+ #else
+ {"BAD_END_LINE", 9, 102},
+ #endif
+ #ifdef PEM_R_BAD_IV_CHARS
+ {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
+ #else
+ {"BAD_IV_CHARS", 9, 103},
+ #endif
+ #ifdef PEM_R_BAD_MAGIC_NUMBER
+ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
+ #else
+ {"BAD_MAGIC_NUMBER", 9, 116},
+ #endif
+ #ifdef PEM_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 9, 104},
+ #endif
+ #ifdef PEM_R_BAD_VERSION_NUMBER
+ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
+ #else
+ {"BAD_VERSION_NUMBER", 9, 117},
+ #endif
+ #ifdef PEM_R_BIO_WRITE_FAILURE
+ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
+ #else
+ {"BIO_WRITE_FAILURE", 9, 118},
+ #endif
+ #ifdef PEM_R_CIPHER_IS_NULL
+ {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
+ #else
+ {"CIPHER_IS_NULL", 9, 127},
+ #endif
+ #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
+ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
+ #else
+ {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115},
+ #endif
+ #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
+ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
+ #else
+ {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119},
+ #endif
+ #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
+ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
+ #else
+ {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120},
+ #endif
+ #ifdef PEM_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 9, 128},
+ #endif
+ #ifdef PEM_R_INCONSISTENT_HEADER
+ {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
+ #else
+ {"INCONSISTENT_HEADER", 9, 121},
+ #endif
+ #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
+ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
+ #else
+ {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122},
+ #endif
+ #ifdef PEM_R_KEYBLOB_TOO_SHORT
+ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
+ #else
+ {"KEYBLOB_TOO_SHORT", 9, 123},
+ #endif
+ #ifdef PEM_R_MISSING_DEK_IV
+ {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV},
+ #else
+ {"MISSING_DEK_IV", 9, 129},
+ #endif
+ #ifdef PEM_R_NOT_DEK_INFO
+ {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
+ #else
+ {"NOT_DEK_INFO", 9, 105},
+ #endif
+ #ifdef PEM_R_NOT_ENCRYPTED
+ {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
+ #else
+ {"NOT_ENCRYPTED", 9, 106},
+ #endif
+ #ifdef PEM_R_NOT_PROC_TYPE
+ {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
+ #else
+ {"NOT_PROC_TYPE", 9, 107},
+ #endif
+ #ifdef PEM_R_NO_START_LINE
+ {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
+ #else
+ {"NO_START_LINE", 9, 108},
+ #endif
+ #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
+ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD},
+ #else
+ {"PROBLEMS_GETTING_PASSWORD", 9, 109},
+ #endif
+ #ifdef PEM_R_PUBLIC_KEY_NO_RSA
+ {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA},
+ #else
+ {"PUBLIC_KEY_NO_RSA", 9, 110},
+ #endif
+ #ifdef PEM_R_PVK_DATA_TOO_SHORT
+ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
+ #else
+ {"PVK_DATA_TOO_SHORT", 9, 124},
+ #endif
+ #ifdef PEM_R_PVK_TOO_SHORT
+ {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
+ #else
+ {"PVK_TOO_SHORT", 9, 125},
+ #endif
+ #ifdef PEM_R_READ_KEY
+ {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
+ #else
+ {"READ_KEY", 9, 111},
+ #endif
+ #ifdef PEM_R_SHORT_HEADER
+ {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
+ #else
+ {"SHORT_HEADER", 9, 112},
+ #endif
+ #ifdef PEM_R_UNEXPECTED_DEK_IV
+ {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV},
+ #else
+ {"UNEXPECTED_DEK_IV", 9, 130},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 9, 113},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
+ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
+ #else
+ {"UNSUPPORTED_ENCRYPTION", 9, 114},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
+ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS},
+ #else
+ {"UNSUPPORTED_KEY_COMPONENTS", 9, 126},
+ #endif
+ #ifdef PKCS12_R_CANT_PACK_STRUCTURE
+ {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE},
+ #else
+ {"CANT_PACK_STRUCTURE", 35, 100},
+ #endif
+ #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA
+ {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_DATA", 35, 121},
+ #endif
+ #ifdef PKCS12_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 35, 101},
+ #endif
+ #ifdef PKCS12_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 35, 102},
+ #endif
+ #ifdef PKCS12_R_ENCRYPT_ERROR
+ {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR},
+ #else
+ {"ENCRYPT_ERROR", 35, 103},
+ #endif
+ #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE},
+ #else
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 35, 104},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER
+ {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER},
+ #else
+ {"INVALID_NULL_PKCS12_POINTER", 35, 105},
+ #endif
+ #ifdef PKCS12_R_IV_GEN_ERROR
+ {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR},
+ #else
+ {"IV_GEN_ERROR", 35, 106},
+ #endif
+ #ifdef PKCS12_R_KEY_GEN_ERROR
+ {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR},
+ #else
+ {"KEY_GEN_ERROR", 35, 107},
+ #endif
+ #ifdef PKCS12_R_MAC_ABSENT
+ {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT},
+ #else
+ {"MAC_ABSENT", 35, 108},
+ #endif
+ #ifdef PKCS12_R_MAC_GENERATION_ERROR
+ {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR},
+ #else
+ {"MAC_GENERATION_ERROR", 35, 109},
+ #endif
+ #ifdef PKCS12_R_MAC_SETUP_ERROR
+ {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR},
+ #else
+ {"MAC_SETUP_ERROR", 35, 110},
+ #endif
+ #ifdef PKCS12_R_MAC_STRING_SET_ERROR
+ {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR},
+ #else
+ {"MAC_STRING_SET_ERROR", 35, 111},
+ #endif
+ #ifdef PKCS12_R_MAC_VERIFY_FAILURE
+ {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE},
+ #else
+ {"MAC_VERIFY_FAILURE", 35, 113},
+ #endif
+ #ifdef PKCS12_R_PARSE_ERROR
+ {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR},
+ #else
+ {"PARSE_ERROR", 35, 114},
+ #endif
+ #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR
+ {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR},
+ #else
+ {"PKCS12_ALGOR_CIPHERINIT_ERROR", 35, 115},
+ #endif
+ #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR
+ {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR},
+ #else
+ {"PKCS12_CIPHERFINAL_ERROR", 35, 116},
+ #endif
+ #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR
+ {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR},
+ #else
+ {"PKCS12_PBE_CRYPT_ERROR", 35, 117},
+ #endif
+ #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 35, 118},
+ #endif
+ #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE
+ {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE},
+ #else
+ {"UNSUPPORTED_PKCS12_MODE", 35, 119},
+ #endif
+ #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 33, 117},
+ #endif
+ #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144},
+ #endif
+ #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED
+ {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED},
+ #else
+ {"CIPHER_NOT_INITIALIZED", 33, 116},
+ #endif
+ #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT
+ {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT},
+ #else
+ {"CONTENT_AND_DATA_PRESENT", 33, 118},
+ #endif
+ #ifdef PKCS7_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 33, 152},
+ #endif
+ #ifdef PKCS7_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 33, 119},
+ #endif
+ #ifdef PKCS7_R_DIGEST_FAILURE
+ {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE},
+ #else
+ {"DIGEST_FAILURE", 33, 101},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE
+ {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE},
+ #else
+ {"ENCRYPTION_CTRL_FAILURE", 33, 149},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150},
+ #endif
+ #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT
+ {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT},
+ #else
+ {"ERROR_ADDING_RECIPIENT", 33, 120},
+ #endif
+ #ifdef PKCS7_R_ERROR_SETTING_CIPHER
+ {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER},
+ #else
+ {"ERROR_SETTING_CIPHER", 33, 121},
+ #endif
+ #ifdef PKCS7_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 33, 143},
+ #endif
+ #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE
+ {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE},
+ #else
+ {"INVALID_SIGNED_DATA_TYPE", 33, 155},
+ #endif
+ #ifdef PKCS7_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 33, 122},
+ #endif
+ #ifdef PKCS7_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 33, 151},
+ #endif
+ #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND},
+ #else
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154},
+ #endif
+ #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE},
+ #else
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA
+ {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA},
+ #else
+ {"NO_SIGNATURES_ON_DATA", 33, 123},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 33, 142},
+ #endif
+ #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR
+ {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNER_ERROR", 33, 153},
+ #endif
+ #ifdef PKCS7_R_PKCS7_DATASIGN
+ {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN},
+ #else
+ {"PKCS7_DATASIGN", 33, 145},
+ #endif
+ #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127},
+ #endif
+ #ifdef PKCS7_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 33, 105},
+ #endif
+ #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128},
+ #endif
+ #ifdef PKCS7_R_SIGNING_CTRL_FAILURE
+ {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE},
+ #else
+ {"SIGNING_CTRL_FAILURE", 33, 147},
+ #endif
+ #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148},
+ #endif
+ #ifdef PKCS7_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 33, 129},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE
+ {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE},
+ #else
+ {"UNABLE_TO_FIND_CERTIFICATE", 33, 106},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO
+ {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO},
+ #else
+ {"UNABLE_TO_FIND_MEM_BIO", 33, 107},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST},
+ #else
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE
+ {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE},
+ #else
+ {"UNKNOWN_DIGEST_TYPE", 33, 109},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_OPERATION
+ {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION},
+ #else
+ {"UNKNOWN_OPERATION", 33, 110},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE
+ {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE},
+ #else
+ {"UNSUPPORTED_CIPHER_TYPE", 33, 111},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 33, 112},
+ #endif
+ #ifdef PKCS7_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 33, 113},
+ #endif
+ #ifdef PKCS7_R_WRONG_PKCS7_TYPE
+ {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE},
+ #else
+ {"WRONG_PKCS7_TYPE", 33, 114},
+ #endif
+ #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG
+ {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG},
+ #else
+ {"ADDITIONAL_INPUT_TOO_LONG", 36, 102},
+ #endif
+ #ifdef RAND_R_ALREADY_INSTANTIATED
+ {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED},
+ #else
+ {"ALREADY_INSTANTIATED", 36, 103},
+ #endif
+ #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE
+ {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE},
+ #else
+ {"ARGUMENT_OUT_OF_RANGE", 36, 105},
+ #endif
+ #ifdef RAND_R_CANNOT_OPEN_FILE
+ {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE},
+ #else
+ {"CANNOT_OPEN_FILE", 36, 121},
+ #endif
+ #ifdef RAND_R_DRBG_ALREADY_INITIALIZED
+ {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED},
+ #else
+ {"DRBG_ALREADY_INITIALIZED", 36, 129},
+ #endif
+ #ifdef RAND_R_DRBG_NOT_INITIALISED
+ {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED},
+ #else
+ {"DRBG_NOT_INITIALISED", 36, 104},
+ #endif
+ #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG
+ {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG},
+ #else
+ {"ENTROPY_INPUT_TOO_LONG", 36, 106},
+ #endif
+ #ifdef RAND_R_ENTROPY_OUT_OF_RANGE
+ {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE},
+ #else
+ {"ENTROPY_OUT_OF_RANGE", 36, 124},
+ #endif
+ #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED},
+ #else
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127},
+ #endif
+ #ifdef RAND_R_ERROR_INITIALISING_DRBG
+ {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG},
+ #else
+ {"ERROR_INITIALISING_DRBG", 36, 107},
+ #endif
+ #ifdef RAND_R_ERROR_INSTANTIATING_DRBG
+ {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG},
+ #else
+ {"ERROR_INSTANTIATING_DRBG", 36, 108},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT},
+ #else
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY
+ {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY},
+ #else
+ {"ERROR_RETRIEVING_ENTROPY", 36, 110},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_NONCE
+ {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE},
+ #else
+ {"ERROR_RETRIEVING_NONCE", 36, 111},
+ #endif
+ #ifdef RAND_R_FAILED_TO_CREATE_LOCK
+ {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK},
+ #else
+ {"FAILED_TO_CREATE_LOCK", 36, 126},
+ #endif
+ #ifdef RAND_R_FUNC_NOT_IMPLEMENTED
+ {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED},
+ #else
+ {"FUNC_NOT_IMPLEMENTED", 36, 101},
+ #endif
+ #ifdef RAND_R_FWRITE_ERROR
+ {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR},
+ #else
+ {"FWRITE_ERROR", 36, 123},
+ #endif
+ #ifdef RAND_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 36, 112},
+ #endif
+ #ifdef RAND_R_INTERNAL_ERROR
+ {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR},
+ #else
+ {"INTERNAL_ERROR", 36, 113},
+ #endif
+ #ifdef RAND_R_IN_ERROR_STATE
+ {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE},
+ #else
+ {"IN_ERROR_STATE", 36, 114},
+ #endif
+ #ifdef RAND_R_NOT_A_REGULAR_FILE
+ {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE},
+ #else
+ {"NOT_A_REGULAR_FILE", 36, 122},
+ #endif
+ #ifdef RAND_R_NOT_INSTANTIATED
+ {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED},
+ #else
+ {"NOT_INSTANTIATED", 36, 115},
+ #endif
+ #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED},
+ #else
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128},
+ #endif
+ #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED
+ {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED},
+ #else
+ {"PARENT_LOCKING_NOT_ENABLED", 36, 130},
+ #endif
+ #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK
+ {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK},
+ #else
+ {"PARENT_STRENGTH_TOO_WEAK", 36, 131},
+ #endif
+ #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG
+ {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG},
+ #else
+ {"PERSONALISATION_STRING_TOO_LONG", 36, 116},
+ #endif
+ #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED},
+ #else
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133},
+ #endif
+ #ifdef RAND_R_PRNG_NOT_SEEDED
+ {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED},
+ #else
+ {"PRNG_NOT_SEEDED", 36, 100},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_OVERFLOW
+ {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW},
+ #else
+ {"RANDOM_POOL_OVERFLOW", 36, 125},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_UNDERFLOW
+ {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW},
+ #else
+ {"RANDOM_POOL_UNDERFLOW", 36, 134},
+ #endif
+ #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG
+ {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG},
+ #else
+ {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117},
+ #endif
+ #ifdef RAND_R_RESEED_ERROR
+ {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR},
+ #else
+ {"RESEED_ERROR", 36, 118},
+ #endif
+ #ifdef RAND_R_SELFTEST_FAILURE
+ {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE},
+ #else
+ {"SELFTEST_FAILURE", 36, 119},
+ #endif
+ #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED
+ {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED},
+ #else
+ {"TOO_LITTLE_NONCE_REQUESTED", 36, 135},
+ #endif
+ #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED
+ {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED},
+ #else
+ {"TOO_MUCH_NONCE_REQUESTED", 36, 136},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS
+ {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS},
+ #else
+ {"UNSUPPORTED_DRBG_FLAGS", 36, 132},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE
+ {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE},
+ #else
+ {"UNSUPPORTED_DRBG_TYPE", 36, 120},
+ #endif
+ #ifdef RSA_R_ALGORITHM_MISMATCH
+ {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH},
+ #else
+ {"ALGORITHM_MISMATCH", 4, 100},
+ #endif
+ #ifdef RSA_R_BAD_E_VALUE
+ {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE},
+ #else
+ {"BAD_E_VALUE", 4, 101},
+ #endif
+ #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT
+ {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT},
+ #else
+ {"BAD_FIXED_HEADER_DECRYPT", 4, 102},
+ #endif
+ #ifdef RSA_R_BAD_PAD_BYTE_COUNT
+ {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT},
+ #else
+ {"BAD_PAD_BYTE_COUNT", 4, 103},
+ #endif
+ #ifdef RSA_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 4, 104},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01
+ {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01},
+ #else
+ {"BLOCK_TYPE_IS_NOT_01", 4, 106},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02
+ {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02},
+ #else
+ {"BLOCK_TYPE_IS_NOT_02", 4, 107},
+ #endif
+ #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN
+ {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN},
+ #else
+ {"DATA_GREATER_THAN_MOD_LEN", 4, 108},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE
+ {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE},
+ #else
+ {"DATA_TOO_LARGE", 4, 109},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS
+ {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS},
+ #else
+ {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL
+ {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL},
+ #else
+ {"DATA_TOO_SMALL", 4, 111},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122},
+ #endif
+ #ifdef RSA_R_DIGEST_DOES_NOT_MATCH
+ {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH},
+ #else
+ {"DIGEST_DOES_NOT_MATCH", 4, 158},
+ #endif
+ #ifdef RSA_R_DIGEST_NOT_ALLOWED
+ {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED},
+ #else
+ {"DIGEST_NOT_ALLOWED", 4, 145},
+ #endif
+ #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY},
+ #else
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112},
+ #endif
+ #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D
+ {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMP1_NOT_CONGRUENT_TO_D", 4, 124},
+ #endif
+ #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D
+ {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125},
+ #endif
+ #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1
+ {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1},
+ #else
+ {"D_E_NOT_CONGRUENT_TO_1", 4, 123},
+ #endif
+ #ifdef RSA_R_FIRST_OCTET_INVALID
+ {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID},
+ #else
+ {"FIRST_OCTET_INVALID", 4, 133},
+ #endif
+ #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+ #else
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 4, 157},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST_LENGTH
+ {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH},
+ #else
+ {"INVALID_DIGEST_LENGTH", 4, 143},
+ #endif
+ #ifdef RSA_R_INVALID_HEADER
+ {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER},
+ #else
+ {"INVALID_HEADER", 4, 137},
+ #endif
+ #ifdef RSA_R_INVALID_LABEL
+ {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL},
+ #else
+ {"INVALID_LABEL", 4, 160},
+ #endif
+ #ifdef RSA_R_INVALID_MESSAGE_LENGTH
+ {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH},
+ #else
+ {"INVALID_MESSAGE_LENGTH", 4, 131},
+ #endif
+ #ifdef RSA_R_INVALID_MGF1_MD
+ {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD},
+ #else
+ {"INVALID_MGF1_MD", 4, 156},
+ #endif
+ #ifdef RSA_R_INVALID_MULTI_PRIME_KEY
+ {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY},
+ #else
+ {"INVALID_MULTI_PRIME_KEY", 4, 167},
+ #endif
+ #ifdef RSA_R_INVALID_OAEP_PARAMETERS
+ {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS},
+ #else
+ {"INVALID_OAEP_PARAMETERS", 4, 161},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING
+ {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING},
+ #else
+ {"INVALID_PADDING", 4, 138},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING_MODE
+ {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE},
+ #else
+ {"INVALID_PADDING_MODE", 4, 141},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_PARAMETERS
+ {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS},
+ #else
+ {"INVALID_PSS_PARAMETERS", 4, 149},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_SALTLEN
+ {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN},
+ #else
+ {"INVALID_PSS_SALTLEN", 4, 146},
+ #endif
+ #ifdef RSA_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 4, 150},
+ #endif
+ #ifdef RSA_R_INVALID_TRAILER
+ {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER},
+ #else
+ {"INVALID_TRAILER", 4, 139},
+ #endif
+ #ifdef RSA_R_INVALID_X931_DIGEST
+ {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST},
+ #else
+ {"INVALID_X931_DIGEST", 4, 142},
+ #endif
+ #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q
+ {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q},
+ #else
+ {"IQMP_NOT_INVERSE_OF_Q", 4, 126},
+ #endif
+ #ifdef RSA_R_KEY_PRIME_NUM_INVALID
+ {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID},
+ #else
+ {"KEY_PRIME_NUM_INVALID", 4, 165},
+ #endif
+ #ifdef RSA_R_KEY_SIZE_TOO_SMALL
+ {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL},
+ #else
+ {"KEY_SIZE_TOO_SMALL", 4, 120},
+ #endif
+ #ifdef RSA_R_LAST_OCTET_INVALID
+ {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID},
+ #else
+ {"LAST_OCTET_INVALID", 4, 134},
+ #endif
+ #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED
+ {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED},
+ #else
+ {"MGF1_DIGEST_NOT_ALLOWED", 4, 152},
+ #endif
+ #ifdef RSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 4, 179},
+ #endif
+ #ifdef RSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 4, 105},
+ #endif
+ #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R},
+ #else
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168},
+ #endif
+ #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D},
+ #else
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169},
+ #endif
+ #ifdef RSA_R_MP_R_NOT_PRIME
+ {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME},
+ #else
+ {"MP_R_NOT_PRIME", 4, 170},
+ #endif
+ #ifdef RSA_R_NO_PUBLIC_EXPONENT
+ {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT},
+ #else
+ {"NO_PUBLIC_EXPONENT", 4, 140},
+ #endif
+ #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING
+ {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING},
+ #else
+ {"NULL_BEFORE_BLOCK_MISSING", 4, 113},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES},
+ #else
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q
+ {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q},
+ #else
+ {"N_DOES_NOT_EQUAL_P_Q", 4, 127},
+ #endif
+ #ifdef RSA_R_OAEP_DECODING_ERROR
+ {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR},
+ #else
+ {"OAEP_DECODING_ERROR", 4, 121},
+ #endif
+ #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148},
+ #endif
+ #ifdef RSA_R_PADDING_CHECK_FAILED
+ {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED},
+ #else
+ {"PADDING_CHECK_FAILED", 4, 114},
+ #endif
+ #ifdef RSA_R_PKCS_DECODING_ERROR
+ {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR},
+ #else
+ {"PKCS_DECODING_ERROR", 4, 159},
+ #endif
+ #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL
+ {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL},
+ #else
+ {"PSS_SALTLEN_TOO_SMALL", 4, 164},
+ #endif
+ #ifdef RSA_R_P_NOT_PRIME
+ {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME},
+ #else
+ {"P_NOT_PRIME", 4, 128},
+ #endif
+ #ifdef RSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 4, 129},
+ #endif
+ #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
+ {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED},
+ #else
+ {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130},
+ #endif
+ #ifdef RSA_R_SLEN_CHECK_FAILED
+ {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED},
+ #else
+ {"SLEN_CHECK_FAILED", 4, 136},
+ #endif
+ #ifdef RSA_R_SLEN_RECOVERY_FAILED
+ {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED},
+ #else
+ {"SLEN_RECOVERY_FAILED", 4, 135},
+ #endif
+ #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK
+ {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK},
+ #else
+ {"SSLV3_ROLLBACK_ATTACK", 4, 115},
+ #endif
+ #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116},
+ #endif
+ #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE
+ {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE},
+ #else
+ {"UNKNOWN_ALGORITHM_TYPE", 4, 117},
+ #endif
+ #ifdef RSA_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 4, 166},
+ #endif
+ #ifdef RSA_R_UNKNOWN_MASK_DIGEST
+ {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST},
+ #else
+ {"UNKNOWN_MASK_DIGEST", 4, 151},
+ #endif
+ #ifdef RSA_R_UNKNOWN_PADDING_TYPE
+ {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE},
+ #else
+ {"UNKNOWN_PADDING_TYPE", 4, 118},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE
+ {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE},
+ #else
+ {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE
+ {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE},
+ #else
+ {"UNSUPPORTED_LABEL_SOURCE", 4, 163},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM
+ {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MASK_ALGORITHM", 4, 153},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER
+ {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER},
+ #else
+ {"UNSUPPORTED_MASK_PARAMETER", 4, 154},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE
+ {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE},
+ #else
+ {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155},
+ #endif
+ #ifdef RSA_R_VALUE_MISSING
+ {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING},
+ #else
+ {"VALUE_MISSING", 4, 147},
+ #endif
+ #ifdef RSA_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 4, 119},
+ #endif
+ #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY},
+ #else
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291},
+ #endif
+ #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
+ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
+ #else
+ {"APP_DATA_IN_HANDSHAKE", 20, 100},
+ #endif
+ #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
+ #else
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE
+ {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE},
+ #else
+ {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE},
+ #else
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158},
+ #endif
+ #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
+ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
+ #else
+ {"BAD_CHANGE_CIPHER_SPEC", 20, 103},
+ #endif
+ #ifdef SSL_R_BAD_CIPHER
+ {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER},
+ #else
+ {"BAD_CIPHER", 20, 186},
+ #endif
+ #ifdef SSL_R_BAD_DATA
+ {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA},
+ #else
+ {"BAD_DATA", 20, 390},
+ #endif
+ #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
+ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
+ #else
+ {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106},
+ #endif
+ #ifdef SSL_R_BAD_DECOMPRESSION
+ {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
+ #else
+ {"BAD_DECOMPRESSION", 20, 107},
+ #endif
+ #ifdef SSL_R_BAD_DH_VALUE
+ {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE},
+ #else
+ {"BAD_DH_VALUE", 20, 102},
+ #endif
+ #ifdef SSL_R_BAD_DIGEST_LENGTH
+ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
+ #else
+ {"BAD_DIGEST_LENGTH", 20, 111},
+ #endif
+ #ifdef SSL_R_BAD_EARLY_DATA
+ {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA},
+ #else
+ {"BAD_EARLY_DATA", 20, 233},
+ #endif
+ #ifdef SSL_R_BAD_ECC_CERT
+ {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
+ #else
+ {"BAD_ECC_CERT", 20, 304},
+ #endif
+ #ifdef SSL_R_BAD_ECDSA_SIGNATURE
+ {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE},
+ #else
+ {"BAD_ECDSA_SIGNATURE", 20, 305},
+ #endif
+ #ifdef SSL_R_BAD_ECPOINT
+ {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
+ #else
+ {"BAD_ECPOINT", 20, 306},
+ #endif
+ #ifdef SSL_R_BAD_EXTENSION
+ {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION},
+ #else
+ {"BAD_EXTENSION", 20, 110},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
+ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
+ #else
+ {"BAD_HANDSHAKE_LENGTH", 20, 332},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_STATE
+ {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE},
+ #else
+ {"BAD_HANDSHAKE_STATE", 20, 236},
+ #endif
+ #ifdef SSL_R_BAD_HELLO_REQUEST
+ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
+ #else
+ {"BAD_HELLO_REQUEST", 20, 105},
+ #endif
+ #ifdef SSL_R_BAD_HRR_VERSION
+ {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION},
+ #else
+ {"BAD_HRR_VERSION", 20, 263},
+ #endif
+ #ifdef SSL_R_BAD_KEY_SHARE
+ {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE},
+ #else
+ {"BAD_KEY_SHARE", 20, 108},
+ #endif
+ #ifdef SSL_R_BAD_KEY_UPDATE
+ {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE},
+ #else
+ {"BAD_KEY_UPDATE", 20, 122},
+ #endif
+ #ifdef SSL_R_BAD_LEGACY_VERSION
+ {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION},
+ #else
+ {"BAD_LEGACY_VERSION", 20, 292},
+ #endif
+ #ifdef SSL_R_BAD_LENGTH
+ {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
+ #else
+ {"BAD_LENGTH", 20, 271},
+ #endif
+ #ifdef SSL_R_BAD_MAC_LENGTH
+ {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH},
+ #else
+ {"BAD_MAC_LENGTH", 20, 333},
+ #endif
+ #ifdef SSL_R_BAD_PACKET
+ {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET},
+ #else
+ {"BAD_PACKET", 20, 240},
+ #endif
+ #ifdef SSL_R_BAD_PACKET_LENGTH
+ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
+ #else
+ {"BAD_PACKET_LENGTH", 20, 115},
+ #endif
+ #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
+ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
+ #else
+ {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116},
+ #endif
+ #ifdef SSL_R_BAD_PSK
+ {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK},
+ #else
+ {"BAD_PSK", 20, 219},
+ #endif
+ #ifdef SSL_R_BAD_PSK_IDENTITY
+ {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY},
+ #else
+ {"BAD_PSK_IDENTITY", 20, 114},
+ #endif
+ #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH
+ {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH},
+ #else
+ {"BAD_PSK_IDENTITY_HINT_LENGTH", 20, 316},
+ #endif
+ #ifdef SSL_R_BAD_RECORD_TYPE
+ {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE},
+ #else
+ {"BAD_RECORD_TYPE", 20, 443},
+ #endif
+ #ifdef SSL_R_BAD_RSA_ENCRYPT
+ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
+ #else
+ {"BAD_RSA_ENCRYPT", 20, 119},
+ #endif
+ #ifdef SSL_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 20, 123},
+ #endif
+ #ifdef SSL_R_BAD_SRP_A_LENGTH
+ {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH},
+ #else
+ {"BAD_SRP_A_LENGTH", 20, 347},
+ #endif
+ #ifdef SSL_R_BAD_SRP_B_LENGTH
+ {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH},
+ #else
+ {"BAD_SRP_B_LENGTH", 20, 348},
+ #endif
+ #ifdef SSL_R_BAD_SRP_G_LENGTH
+ {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH},
+ #else
+ {"BAD_SRP_G_LENGTH", 20, 349},
+ #endif
+ #ifdef SSL_R_BAD_SRP_N_LENGTH
+ {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH},
+ #else
+ {"BAD_SRP_N_LENGTH", 20, 350},
+ #endif
+ #ifdef SSL_R_BAD_SRP_PARAMETERS
+ {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS},
+ #else
+ {"BAD_SRP_PARAMETERS", 20, 371},
+ #endif
+ #ifdef SSL_R_BAD_SRP_S_LENGTH
+ {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH},
+ #else
+ {"BAD_SRP_S_LENGTH", 20, 351},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_MKI_VALUE
+ {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE},
+ #else
+ {"BAD_SRTP_MKI_VALUE", 20, 352},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353},
+ #endif
+ #ifdef SSL_R_BAD_SSL_FILETYPE
+ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
+ #else
+ {"BAD_SSL_FILETYPE", 20, 124},
+ #endif
+ #ifdef SSL_R_BAD_VALUE
+ {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE},
+ #else
+ {"BAD_VALUE", 20, 384},
+ #endif
+ #ifdef SSL_R_BAD_WRITE_RETRY
+ {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
+ #else
+ {"BAD_WRITE_RETRY", 20, 127},
+ #endif
+ #ifdef SSL_R_BINDER_DOES_NOT_VERIFY
+ {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY},
+ #else
+ {"BINDER_DOES_NOT_VERIFY", 20, 253},
+ #endif
+ #ifdef SSL_R_BIO_NOT_SET
+ {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
+ #else
+ {"BIO_NOT_SET", 20, 128},
+ #endif
+ #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
+ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
+ #else
+ {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129},
+ #endif
+ #ifdef SSL_R_BN_LIB
+ {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
+ #else
+ {"BN_LIB", 20, 130},
+ #endif
+ #ifdef SSL_R_CALLBACK_FAILED
+ {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED},
+ #else
+ {"CALLBACK_FAILED", 20, 234},
+ #endif
+ #ifdef SSL_R_CANNOT_CHANGE_CIPHER
+ {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER},
+ #else
+ {"CANNOT_CHANGE_CIPHER", 20, 109},
+ #endif
+ #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
+ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
+ #else
+ {"CA_DN_LENGTH_MISMATCH", 20, 131},
+ #endif
+ #ifdef SSL_R_CA_KEY_TOO_SMALL
+ {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL},
+ #else
+ {"CA_KEY_TOO_SMALL", 20, 397},
+ #endif
+ #ifdef SSL_R_CA_MD_TOO_WEAK
+ {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK},
+ #else
+ {"CA_MD_TOO_WEAK", 20, 398},
+ #endif
+ #ifdef SSL_R_CCS_RECEIVED_EARLY
+ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
+ #else
+ {"CCS_RECEIVED_EARLY", 20, 133},
+ #endif
+ #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
+ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED},
+ #else
+ {"CERTIFICATE_VERIFY_FAILED", 20, 134},
+ #endif
+ #ifdef SSL_R_CERT_CB_ERROR
+ {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR},
+ #else
+ {"CERT_CB_ERROR", 20, 377},
+ #endif
+ #ifdef SSL_R_CERT_LENGTH_MISMATCH
+ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
+ #else
+ {"CERT_LENGTH_MISMATCH", 20, 135},
+ #endif
+ #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED},
+ #else
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218},
+ #endif
+ #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
+ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH},
+ #else
+ {"CIPHER_CODE_WRONG_LENGTH", 20, 137},
+ #endif
+ #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE
+ {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE},
+ #else
+ {"CIPHER_OR_HASH_UNAVAILABLE", 20, 138},
+ #endif
+ #ifdef SSL_R_CLIENTHELLO_TLSEXT
+ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
+ #else
+ {"CLIENTHELLO_TLSEXT", 20, 226},
+ #endif
+ #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
+ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG},
+ #else
+ {"COMPRESSED_LENGTH_TOO_LONG", 20, 140},
+ #endif
+ #ifdef SSL_R_COMPRESSION_DISABLED
+ {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
+ #else
+ {"COMPRESSION_DISABLED", 20, 343},
+ #endif
+ #ifdef SSL_R_COMPRESSION_FAILURE
+ {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
+ #else
+ {"COMPRESSION_FAILURE", 20, 141},
+ #endif
+ #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
+ #else
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307},
+ #endif
+ #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
+ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR},
+ #else
+ {"COMPRESSION_LIBRARY_ERROR", 20, 142},
+ #endif
+ #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
+ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
+ #else
+ {"CONNECTION_TYPE_NOT_SET", 20, 144},
+ #endif
+ #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED
+ {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED},
+ #else
+ {"CONTEXT_NOT_DANE_ENABLED", 20, 167},
+ #endif
+ #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE
+ {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE},
+ #else
+ {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400},
+ #endif
+ #ifdef SSL_R_COOKIE_MISMATCH
+ {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
+ #else
+ {"COOKIE_MISMATCH", 20, 308},
+ #endif
+ #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED},
+ #else
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206},
+ #endif
+ #ifdef SSL_R_DANE_ALREADY_ENABLED
+ {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED},
+ #else
+ {"DANE_ALREADY_ENABLED", 20, 172},
+ #endif
+ #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL},
+ #else
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173},
+ #endif
+ #ifdef SSL_R_DANE_NOT_ENABLED
+ {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED},
+ #else
+ {"DANE_NOT_ENABLED", 20, 175},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE
+ {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE", 20, 180},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH
+ {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE
+ {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE},
+ #else
+ {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY
+ {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY},
+ #else
+ {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR
+ {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR},
+ #else
+ {"DANE_TLSA_BAD_SELECTOR", 20, 202},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_NULL_DATA
+ {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA},
+ #else
+ {"DANE_TLSA_NULL_DATA", 20, 203},
+ #endif
+ #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
+ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
+ #else
+ {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145},
+ #endif
+ #ifdef SSL_R_DATA_LENGTH_TOO_LONG
+ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
+ #else
+ {"DATA_LENGTH_TOO_LONG", 20, 146},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED
+ {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
+ #else
+ {"DECRYPTION_FAILED", 20, 147},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
+ #else
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281},
+ #endif
+ #ifdef SSL_R_DH_KEY_TOO_SMALL
+ {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL},
+ #else
+ {"DH_KEY_TOO_SMALL", 20, 394},
+ #endif
+ #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
+ #else
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148},
+ #endif
+ #ifdef SSL_R_DIGEST_CHECK_FAILED
+ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
+ #else
+ {"DIGEST_CHECK_FAILED", 20, 149},
+ #endif
+ #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
+ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
+ #else
+ {"DTLS_MESSAGE_TOO_BIG", 20, 334},
+ #endif
+ #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
+ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID},
+ #else
+ {"DUPLICATE_COMPRESSION_ID", 20, 309},
+ #endif
+ #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT
+ {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT},
+ #else
+ {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", 20, 317},
+ #endif
+ #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
+ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING},
+ #else
+ {"ECC_CERT_NOT_FOR_SIGNING", 20, 318},
+ #endif
+ #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE
+ {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE},
+ #else
+ {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", 20, 322},
+ #endif
+ #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE
+ {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE},
+ #else
+ {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", 20, 323},
+ #endif
+ #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE},
+ #else
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374},
+ #endif
+ #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER
+ {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER},
+ #else
+ {"ECGROUP_TOO_LARGE_FOR_CIPHER", 20, 310},
+ #endif
+ #ifdef SSL_R_EE_KEY_TOO_SMALL
+ {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL},
+ #else
+ {"EE_KEY_TOO_SMALL", 20, 399},
+ #endif
+ #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354},
+ #endif
+ #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
+ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
+ #else
+ {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150},
+ #endif
+ #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
+ #else
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151},
+ #endif
+ #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN},
+ #else
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204},
+ #endif
+ #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE},
+ #else
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194},
+ #endif
+ #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
+ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
+ #else
+ {"EXCESSIVE_MESSAGE_SIZE", 20, 152},
+ #endif
+ #ifdef SSL_R_EXTENSION_NOT_RECEIVED
+ {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED},
+ #else
+ {"EXTENSION_NOT_RECEIVED", 20, 279},
+ #endif
+ #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
+ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
+ #else
+ {"EXTRA_DATA_IN_MESSAGE", 20, 153},
+ #endif
+ #ifdef SSL_R_EXT_LENGTH_MISMATCH
+ {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH},
+ #else
+ {"EXT_LENGTH_MISMATCH", 20, 163},
+ #endif
+ #ifdef SSL_R_FAILED_TO_INIT_ASYNC
+ {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC},
+ #else
+ {"FAILED_TO_INIT_ASYNC", 20, 405},
+ #endif
+ #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO
+ {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO},
+ #else
+ {"FRAGMENTED_CLIENT_HELLO", 20, 401},
+ #endif
+ #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
+ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
+ #else
+ {"GOT_A_FIN_BEFORE_A_CCS", 20, 154},
+ #endif
+ #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS
+ {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS},
+ #else
+ {"GOT_NEXT_PROTO_BEFORE_A_CCS", 20, 355},
+ #endif
+ #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION
+ {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION},
+ #else
+ {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", 20, 356},
+ #endif
+ #ifdef SSL_R_HTTPS_PROXY_REQUEST
+ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
+ #else
+ {"HTTPS_PROXY_REQUEST", 20, 155},
+ #endif
+ #ifdef SSL_R_HTTP_REQUEST
+ {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
+ #else
+ {"HTTP_REQUEST", 20, 156},
+ #endif
+ #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION
+ {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION},
+ #else
+ {"ILLEGAL_POINT_COMPRESSION", 20, 162},
+ #endif
+ #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST
+ {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST},
+ #else
+ {"ILLEGAL_SUITEB_DIGEST", 20, 380},
+ #endif
+ #ifdef SSL_R_INAPPROPRIATE_FALLBACK
+ {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK},
+ #else
+ {"INAPPROPRIATE_FALLBACK", 20, 373},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_COMPRESSION
+ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION},
+ #else
+ {"INCONSISTENT_COMPRESSION", 20, 340},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN
+ {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN},
+ #else
+ {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI
+ {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI},
+ #else
+ {"INCONSISTENT_EARLY_DATA_SNI", 20, 231},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EXTMS
+ {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS},
+ #else
+ {"INCONSISTENT_EXTMS", 20, 104},
+ #endif
+ #ifdef SSL_R_INSUFFICIENT_SECURITY
+ {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY},
+ #else
+ {"INSUFFICIENT_SECURITY", 20, 241},
+ #endif
+ #ifdef SSL_R_INVALID_ALERT
+ {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT},
+ #else
+ {"INVALID_ALERT", 20, 205},
+ #endif
+ #ifdef SSL_R_INVALID_CCS_MESSAGE
+ {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE},
+ #else
+ {"INVALID_CCS_MESSAGE", 20, 260},
+ #endif
+ #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG
+ {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG},
+ #else
+ {"INVALID_CERTIFICATE_OR_ALG", 20, 238},
+ #endif
+ #ifdef SSL_R_INVALID_COMMAND
+ {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
+ #else
+ {"INVALID_COMMAND", 20, 280},
+ #endif
+ #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
+ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM},
+ #else
+ {"INVALID_COMPRESSION_ALGORITHM", 20, 341},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIG
+ {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG},
+ #else
+ {"INVALID_CONFIG", 20, 283},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIGURATION_NAME
+ {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME},
+ #else
+ {"INVALID_CONFIGURATION_NAME", 20, 113},
+ #endif
+ #ifdef SSL_R_INVALID_CONTEXT
+ {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT},
+ #else
+ {"INVALID_CONTEXT", 20, 282},
+ #endif
+ #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE
+ {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE},
+ #else
+ {"INVALID_CT_VALIDATION_TYPE", 20, 212},
+ #endif
+ #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE
+ {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE},
+ #else
+ {"INVALID_KEY_UPDATE_TYPE", 20, 120},
+ #endif
+ #ifdef SSL_R_INVALID_MAX_EARLY_DATA
+ {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA},
+ #else
+ {"INVALID_MAX_EARLY_DATA", 20, 174},
+ #endif
+ #ifdef SSL_R_INVALID_NULL_CMD_NAME
+ {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME},
+ #else
+ {"INVALID_NULL_CMD_NAME", 20, 385},
+ #endif
+ #ifdef SSL_R_INVALID_SEQUENCE_NUMBER
+ {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER},
+ #else
+ {"INVALID_SEQUENCE_NUMBER", 20, 402},
+ #endif
+ #ifdef SSL_R_INVALID_SERVERINFO_DATA
+ {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA},
+ #else
+ {"INVALID_SERVERINFO_DATA", 20, 388},
+ #endif
+ #ifdef SSL_R_INVALID_SESSION_ID
+ {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID},
+ #else
+ {"INVALID_SESSION_ID", 20, 999},
+ #endif
+ #ifdef SSL_R_INVALID_SRP_USERNAME
+ {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME},
+ #else
+ {"INVALID_SRP_USERNAME", 20, 357},
+ #endif
+ #ifdef SSL_R_INVALID_STATUS_RESPONSE
+ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
+ #else
+ {"INVALID_STATUS_RESPONSE", 20, 328},
+ #endif
+ #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
+ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH},
+ #else
+ {"INVALID_TICKET_KEYS_LENGTH", 20, 325},
+ #endif
+ #ifdef SSL_R_KRB5_S_TKT_NYV
+ {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV},
+ #else
+ {"KRB5_S_TKT_NYV", 20, 294},
+ #endif
+ #ifdef SSL_R_KRB5_S_TKT_SKEW
+ {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW},
+ #else
+ {"KRB5_S_TKT_SKEW", 20, 295},
+ #endif
+ #ifdef SSL_R_LENGTH_MISMATCH
+ {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
+ #else
+ {"LENGTH_MISMATCH", 20, 159},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 20, 404},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_SHORT
+ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
+ #else
+ {"LENGTH_TOO_SHORT", 20, 160},
+ #endif
+ #ifdef SSL_R_LIBRARY_BUG
+ {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
+ #else
+ {"LIBRARY_BUG", 20, 274},
+ #endif
+ #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
+ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"LIBRARY_HAS_NO_CIPHERS", 20, 161},
+ #endif
+ #ifdef SSL_R_MESSAGE_TOO_LONG
+ {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG},
+ #else
+ {"MESSAGE_TOO_LONG", 20, 296},
+ #endif
+ #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
+ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT},
+ #else
+ {"MISSING_DSA_SIGNING_CERT", 20, 165},
+ #endif
+ #ifdef SSL_R_MISSING_ECDH_CERT
+ {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT},
+ #else
+ {"MISSING_ECDH_CERT", 20, 382},
+ #endif
+ #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT
+ {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT},
+ #else
+ {"MISSING_ECDSA_SIGNING_CERT", 20, 381},
+ #endif
+ #ifdef SSL_R_MISSING_FATAL
+ {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL},
+ #else
+ {"MISSING_FATAL", 20, 256},
+ #endif
+ #ifdef SSL_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 20, 290},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_CERTIFICATE
+ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
+ #else
+ {"MISSING_RSA_CERTIFICATE", 20, 168},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
+ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT},
+ #else
+ {"MISSING_RSA_ENCRYPTING_CERT", 20, 169},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
+ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT},
+ #else
+ {"MISSING_RSA_SIGNING_CERT", 20, 170},
+ #endif
+ #ifdef SSL_R_MISSING_SIGALGS_EXTENSION
+ {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION},
+ #else
+ {"MISSING_SIGALGS_EXTENSION", 20, 112},
+ #endif
+ #ifdef SSL_R_MISSING_SIGNING_CERT
+ {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT},
+ #else
+ {"MISSING_SIGNING_CERT", 20, 221},
+ #endif
+ #ifdef SSL_R_MISSING_SRP_PARAM
+ {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM},
+ #else
+ {"MISSING_SRP_PARAM", 20, 358},
+ #endif
+ #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION},
+ #else
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_DH_KEY
+ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
+ #else
+ {"MISSING_TMP_DH_KEY", 20, 171},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_ECDH_KEY
+ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
+ #else
+ {"MISSING_TMP_ECDH_KEY", 20, 311},
+ #endif
+ #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA},
+ #else
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293},
+ #endif
+ #ifdef SSL_R_MULTIPLE_SGC_RESTARTS
+ {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS},
+ #else
+ {"MULTIPLE_SGC_RESTARTS", 20, 346},
+ #endif
+ #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY
+ {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY},
+ #else
+ {"NOT_ON_RECORD_BOUNDARY", 20, 182},
+ #endif
+ #ifdef SSL_R_NOT_REPLACING_CERTIFICATE
+ {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE},
+ #else
+ {"NOT_REPLACING_CERTIFICATE", 20, 289},
+ #endif
+ #ifdef SSL_R_NOT_SERVER
+ {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER},
+ #else
+ {"NOT_SERVER", 20, 284},
+ #endif
+ #ifdef SSL_R_NO_APPLICATION_PROTOCOL
+ {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL},
+ #else
+ {"NO_APPLICATION_PROTOCOL", 20, 235},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATES_RETURNED
+ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED},
+ #else
+ {"NO_CERTIFICATES_RETURNED", 20, 176},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
+ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
+ #else
+ {"NO_CERTIFICATE_ASSIGNED", 20, 177},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_SET
+ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
+ #else
+ {"NO_CERTIFICATE_SET", 20, 179},
+ #endif
+ #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR
+ {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR},
+ #else
+ {"NO_CHANGE_FOLLOWING_HRR", 20, 214},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_AVAILABLE
+ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
+ #else
+ {"NO_CIPHERS_AVAILABLE", 20, 181},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_SPECIFIED
+ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
+ #else
+ {"NO_CIPHERS_SPECIFIED", 20, 183},
+ #endif
+ #ifdef SSL_R_NO_CIPHER_MATCH
+ {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
+ #else
+ {"NO_CIPHER_MATCH", 20, 185},
+ #endif
+ #ifdef SSL_R_NO_CLIENT_CERT_METHOD
+ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
+ #else
+ {"NO_CLIENT_CERT_METHOD", 20, 331},
+ #endif
+ #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
+ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED},
+ #else
+ {"NO_COMPRESSION_SPECIFIED", 20, 187},
+ #endif
+ #ifdef SSL_R_NO_COOKIE_CALLBACK_SET
+ {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET},
+ #else
+ {"NO_COOKIE_CALLBACK_SET", 20, 287},
+ #endif
+ #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
+ #else
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330},
+ #endif
+ #ifdef SSL_R_NO_METHOD_SPECIFIED
+ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
+ #else
+ {"NO_METHOD_SPECIFIED", 20, 188},
+ #endif
+ #ifdef SSL_R_NO_PEM_EXTENSIONS
+ {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS},
+ #else
+ {"NO_PEM_EXTENSIONS", 20, 389},
+ #endif
+ #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
+ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
+ #else
+ {"NO_PRIVATE_KEY_ASSIGNED", 20, 190},
+ #endif
+ #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
+ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
+ #else
+ {"NO_PROTOCOLS_AVAILABLE", 20, 191},
+ #endif
+ #ifdef SSL_R_NO_RENEGOTIATION
+ {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
+ #else
+ {"NO_RENEGOTIATION", 20, 339},
+ #endif
+ #ifdef SSL_R_NO_REQUIRED_DIGEST
+ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
+ #else
+ {"NO_REQUIRED_DIGEST", 20, 324},
+ #endif
+ #ifdef SSL_R_NO_SHARED_CIPHER
+ {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
+ #else
+ {"NO_SHARED_CIPHER", 20, 193},
+ #endif
+ #ifdef SSL_R_NO_SHARED_GROUPS
+ {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS},
+ #else
+ {"NO_SHARED_GROUPS", 20, 410},
+ #endif
+ #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS},
+ #else
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376},
+ #endif
+ #ifdef SSL_R_NO_SRTP_PROFILES
+ {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES},
+ #else
+ {"NO_SRTP_PROFILES", 20, 359},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_KEY_SHARE
+ {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE},
+ #else
+ {"NO_SUITABLE_KEY_SHARE", 20, 101},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM},
+ #else
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118},
+ #endif
+ #ifdef SSL_R_NO_VALID_SCTS
+ {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS},
+ #else
+ {"NO_VALID_SCTS", 20, 216},
+ #endif
+ #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK
+ {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK},
+ #else
+ {"NO_VERIFY_COOKIE_CALLBACK", 20, 403},
+ #endif
+ #ifdef SSL_R_NULL_SSL_CTX
+ {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
+ #else
+ {"NULL_SSL_CTX", 20, 195},
+ #endif
+ #ifdef SSL_R_NULL_SSL_METHOD_PASSED
+ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
+ #else
+ {"NULL_SSL_METHOD_PASSED", 20, 196},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344},
+ #endif
+ #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE
+ {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE},
+ #else
+ {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 387},
+ #endif
+ #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE
+ {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE},
+ #else
+ {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 379},
+ #endif
+ #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE
+ {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE},
+ #else
+ {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", 20, 297},
+ #endif
+ #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG
+ {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG},
+ #else
+ {"OPAQUE_PRF_INPUT_TOO_LONG", 20, 327},
+ #endif
+ #ifdef SSL_R_OVERFLOW_ERROR
+ {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR},
+ #else
+ {"OVERFLOW_ERROR", 20, 237},
+ #endif
+ #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
+ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
+ #else
+ {"PACKET_LENGTH_TOO_LONG", 20, 198},
+ #endif
+ #ifdef SSL_R_PARSE_TLSEXT
+ {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
+ #else
+ {"PARSE_TLSEXT", 20, 227},
+ #endif
+ #ifdef SSL_R_PATH_TOO_LONG
+ {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
+ #else
+ {"PATH_TOO_LONG", 20, 270},
+ #endif
+ #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
+ #else
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199},
+ #endif
+ #ifdef SSL_R_PEM_NAME_BAD_PREFIX
+ {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX},
+ #else
+ {"PEM_NAME_BAD_PREFIX", 20, 391},
+ #endif
+ #ifdef SSL_R_PEM_NAME_TOO_SHORT
+ {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT},
+ #else
+ {"PEM_NAME_TOO_SHORT", 20, 392},
+ #endif
+ #ifdef SSL_R_PIPELINE_FAILURE
+ {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE},
+ #else
+ {"PIPELINE_FAILURE", 20, 406},
+ #endif
+ #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR},
+ #else
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278},
+ #endif
+ #ifdef SSL_R_PRIVATE_KEY_MISMATCH
+ {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH},
+ #else
+ {"PRIVATE_KEY_MISMATCH", 20, 288},
+ #endif
+ #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
+ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
+ #else
+ {"PROTOCOL_IS_SHUTDOWN", 20, 207},
+ #endif
+ #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
+ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
+ #else
+ {"PSK_IDENTITY_NOT_FOUND", 20, 223},
+ #endif
+ #ifdef SSL_R_PSK_NO_CLIENT_CB
+ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
+ #else
+ {"PSK_NO_CLIENT_CB", 20, 224},
+ #endif
+ #ifdef SSL_R_PSK_NO_SERVER_CB
+ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
+ #else
+ {"PSK_NO_SERVER_CB", 20, 225},
+ #endif
+ #ifdef SSL_R_READ_BIO_NOT_SET
+ {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
+ #else
+ {"READ_BIO_NOT_SET", 20, 211},
+ #endif
+ #ifdef SSL_R_READ_TIMEOUT_EXPIRED
+ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
+ #else
+ {"READ_TIMEOUT_EXPIRED", 20, 312},
+ #endif
+ #ifdef SSL_R_RECORD_LENGTH_MISMATCH
+ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
+ #else
+ {"RECORD_LENGTH_MISMATCH", 20, 213},
+ #endif
+ #ifdef SSL_R_RECORD_TOO_SMALL
+ {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
+ #else
+ {"RECORD_TOO_SMALL", 20, 298},
+ #endif
+ #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
+ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG},
+ #else
+ {"RENEGOTIATE_EXT_TOO_LONG", 20, 335},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
+ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR},
+ #else
+ {"RENEGOTIATION_ENCODING_ERR", 20, 336},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_MISMATCH
+ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
+ #else
+ {"RENEGOTIATION_MISMATCH", 20, 337},
+ #endif
+ #ifdef SSL_R_REQUEST_PENDING
+ {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING},
+ #else
+ {"REQUEST_PENDING", 20, 285},
+ #endif
+ #ifdef SSL_R_REQUEST_SENT
+ {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT},
+ #else
+ {"REQUEST_SENT", 20, 286},
+ #endif
+ #ifdef SSL_R_REQUIRED_CIPHER_MISSING
+ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
+ #else
+ {"REQUIRED_CIPHER_MISSING", 20, 215},
+ #endif
+ #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING},
+ #else
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342},
+ #endif
+ #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
+ #else
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345},
+ #endif
+ #ifdef SSL_R_SCT_VERIFICATION_FAILED
+ {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED},
+ #else
+ {"SCT_VERIFICATION_FAILED", 20, 208},
+ #endif
+ #ifdef SSL_R_SERVERHELLO_TLSEXT
+ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
+ #else
+ {"SERVERHELLO_TLSEXT", 20, 275},
+ #endif
+ #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
+ #else
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277},
+ #endif
+ #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT
+ {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT},
+ #else
+ {"SHUTDOWN_WHILE_IN_INIT", 20, 407},
+ #endif
+ #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR
+ {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR},
+ #else
+ {"SIGNATURE_ALGORITHMS_ERROR", 20, 360},
+ #endif
+ #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
+ #else
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220},
+ #endif
+ #ifdef SSL_R_SRP_A_CALC
+ {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC},
+ #else
+ {"SRP_A_CALC", 20, 361},
+ #endif
+ #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES},
+ #else
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362},
+ #endif
+ #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG},
+ #else
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363},
+ #endif
+ #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE},
+ #else
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364},
+ #endif
+ #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG
+ {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG},
+ #else
+ {"SSL2_CONNECTION_ID_TOO_LONG", 20, 299},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT
+ {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT},
+ #else
+ {"SSL3_EXT_INVALID_ECPOINTFORMAT", 20, 321},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH},
+ #else
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
+ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME", 20, 319},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320},
+ #endif
+ #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
+ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL3_SESSION_ID_TOO_LONG", 20, 300},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
+ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
+ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
+ #else
+ {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
+ #else
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
+ #else
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
+ #else
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
+ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
+ #else
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 20, 117},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125},
+ #endif
+ #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
+ #else
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228},
+ #endif
+ #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
+ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
+ #else
+ {"SSL_HANDSHAKE_FAILURE", 20, 229},
+ #endif
+ #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230},
+ #endif
+ #ifdef SSL_R_SSL_NEGATIVE_LENGTH
+ {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH},
+ #else
+ {"SSL_NEGATIVE_LENGTH", 20, 372},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 20, 126},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 20, 136},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
+ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
+ #else
+ {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
+ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
+ #else
+ {"SSL_SESSION_ID_CONFLICT", 20, 302},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
+ #else
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG
+ {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_TOO_LONG", 20, 408},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH
+ {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH},
+ #else
+ {"SSL_SESSION_VERSION_MISMATCH", 20, 210},
+ #endif
+ #ifdef SSL_R_STILL_IN_INIT
+ {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT},
+ #else
+ {"STILL_IN_INIT", 20, 121},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED},
+ #else
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION
+ {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION},
+ #else
+ {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
+ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED},
+ #else
+ {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
+ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR},
+ #else
+ {"TLSV1_ALERT_DECODE_ERROR", 20, 1050},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
+ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
+ #else
+ {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
+ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
+ #else
+ {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
+ #else
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK},
+ #else
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
+ #else
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
+ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
+ #else
+ {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
+ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
+ #else
+ {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
+ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
+ #else
+ {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
+ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
+ #else
+ {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
+ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
+ #else
+ {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
+ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED},
+ #else
+ {"TLSV1_ALERT_USER_CANCELLED", 20, 1090},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113},
+ #endif
+ #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
+ #else
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111},
+ #endif
+ #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
+ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
+ #else
+ {"TLSV1_UNRECOGNIZED_NAME", 20, 1112},
+ #endif
+ #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
+ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
+ #else
+ {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110},
+ #endif
+ #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT
+ {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT},
+ #else
+ {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", 20, 365},
+ #endif
+ #ifdef SSL_R_TLS_HEARTBEAT_PENDING
+ {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING},
+ #else
+ {"TLS_HEARTBEAT_PENDING", 20, 366},
+ #endif
+ #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL
+ {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL},
+ #else
+ {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367},
+ #endif
+ #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
+ #else
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157},
+ #endif
+ #ifdef SSL_R_TOO_MANY_KEY_UPDATES
+ {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES},
+ #else
+ {"TOO_MANY_KEY_UPDATES", 20, 132},
+ #endif
+ #ifdef SSL_R_TOO_MANY_WARN_ALERTS
+ {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS},
+ #else
+ {"TOO_MANY_WARN_ALERTS", 20, 409},
+ #endif
+ #ifdef SSL_R_TOO_MUCH_EARLY_DATA
+ {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA},
+ #else
+ {"TOO_MUCH_EARLY_DATA", 20, 164},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS
+ {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS},
+ #else
+ {"UNABLE_TO_DECODE_ECDH_CERTS", 20, 313},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE
+ {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE},
+ #else
+ {"UNEXPECTED_CCS_MESSAGE", 20, 262},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA
+ {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA},
+ #else
+ {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_MESSAGE
+ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
+ #else
+ {"UNEXPECTED_MESSAGE", 20, 244},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_RECORD
+ {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
+ #else
+ {"UNEXPECTED_RECORD", 20, 245},
+ #endif
+ #ifdef SSL_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 20, 276},
+ #endif
+ #ifdef SSL_R_UNKNOWN_ALERT_TYPE
+ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
+ #else
+ {"UNKNOWN_ALERT_TYPE", 20, 246},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
+ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE},
+ #else
+ {"UNKNOWN_CERTIFICATE_TYPE", 20, 247},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
+ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
+ #else
+ {"UNKNOWN_CIPHER_RETURNED", 20, 248},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
+ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
+ #else
+ {"UNKNOWN_CIPHER_TYPE", 20, 249},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CMD_NAME
+ {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME},
+ #else
+ {"UNKNOWN_CMD_NAME", 20, 386},
+ #endif
+ #ifdef SSL_R_UNKNOWN_COMMAND
+ {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND},
+ #else
+ {"UNKNOWN_COMMAND", 20, 139},
+ #endif
+ #ifdef SSL_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 20, 368},
+ #endif
+ #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
+ #else
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PKEY_TYPE
+ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
+ #else
+ {"UNKNOWN_PKEY_TYPE", 20, 251},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PROTOCOL
+ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
+ #else
+ {"UNKNOWN_PROTOCOL", 20, 252},
+ #endif
+ #ifdef SSL_R_UNKNOWN_SSL_VERSION
+ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
+ #else
+ {"UNKNOWN_SSL_VERSION", 20, 254},
+ #endif
+ #ifdef SSL_R_UNKNOWN_STATE
+ {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
+ #else
+ {"UNKNOWN_STATE", 20, 255},
+ #endif
+ #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
+ #else
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338},
+ #endif
+ #ifdef SSL_R_UNSOLICITED_EXTENSION
+ {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION},
+ #else
+ {"UNSOLICITED_EXTENSION", 20, 217},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE
+ {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE},
+ #else
+ {"UNSUPPORTED_DIGEST_TYPE", 20, 326},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
+ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
+ #else
+ {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_PROTOCOL
+ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
+ #else
+ {"UNSUPPORTED_PROTOCOL", 20, 258},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
+ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
+ #else
+ {"UNSUPPORTED_SSL_VERSION", 20, 259},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
+ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
+ #else
+ {"UNSUPPORTED_STATUS_TYPE", 20, 329},
+ #endif
+ #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED
+ {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED},
+ #else
+ {"USE_SRTP_NOT_NEGOTIATED", 20, 369},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_HIGH
+ {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH},
+ #else
+ {"VERSION_TOO_HIGH", 20, 166},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_LOW
+ {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW},
+ #else
+ {"VERSION_TOO_LOW", 20, 396},
+ #endif
+ #ifdef SSL_R_WRONG_CERTIFICATE_TYPE
+ {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE},
+ #else
+ {"WRONG_CERTIFICATE_TYPE", 20, 383},
+ #endif
+ #ifdef SSL_R_WRONG_CIPHER_RETURNED
+ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
+ #else
+ {"WRONG_CIPHER_RETURNED", 20, 261},
+ #endif
+ #ifdef SSL_R_WRONG_CURVE
+ {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE},
+ #else
+ {"WRONG_CURVE", 20, 378},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 20, 264},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_SIZE
+ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
+ #else
+ {"WRONG_SIGNATURE_SIZE", 20, 265},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_TYPE
+ {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE},
+ #else
+ {"WRONG_SIGNATURE_TYPE", 20, 370},
+ #endif
+ #ifdef SSL_R_WRONG_SSL_VERSION
+ {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
+ #else
+ {"WRONG_SSL_VERSION", 20, 266},
+ #endif
+ #ifdef SSL_R_WRONG_VERSION_NUMBER
+ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
+ #else
+ {"WRONG_VERSION_NUMBER", 20, 267},
+ #endif
+ #ifdef SSL_R_X509_LIB
+ {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
+ #else
+ {"X509_LIB", 20, 268},
+ #endif
+ #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
+ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
+ #else
+ {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269},
+ #endif
+ #ifdef TS_R_BAD_PKCS7_TYPE
+ {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE},
+ #else
+ {"BAD_PKCS7_TYPE", 47, 132},
+ #endif
+ #ifdef TS_R_BAD_TYPE
+ {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE},
+ #else
+ {"BAD_TYPE", 47, 133},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_CERT
+ {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT},
+ #else
+ {"CANNOT_LOAD_CERT", 47, 137},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_KEY
+ {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY},
+ #else
+ {"CANNOT_LOAD_KEY", 47, 138},
+ #endif
+ #ifdef TS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 47, 100},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_ENGINE
+ {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE},
+ #else
+ {"COULD_NOT_SET_ENGINE", 47, 127},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_TIME
+ {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME},
+ #else
+ {"COULD_NOT_SET_TIME", 47, 115},
+ #endif
+ #ifdef TS_R_DETACHED_CONTENT
+ {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT},
+ #else
+ {"DETACHED_CONTENT", 47, 134},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR
+ {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139},
+ #endif
+ #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR
+ {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+ #else
+ {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101},
+ #endif
+ #ifdef TS_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 47, 102},
+ #endif
+ #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE},
+ #else
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117},
+ #endif
+ #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH
+ {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH},
+ #else
+ {"MESSAGE_IMPRINT_MISMATCH", 47, 103},
+ #endif
+ #ifdef TS_R_NONCE_MISMATCH
+ {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH},
+ #else
+ {"NONCE_MISMATCH", 47, 104},
+ #endif
+ #ifdef TS_R_NONCE_NOT_RETURNED
+ {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED},
+ #else
+ {"NONCE_NOT_RETURNED", 47, 105},
+ #endif
+ #ifdef TS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 47, 106},
+ #endif
+ #ifdef TS_R_NO_TIME_STAMP_TOKEN
+ {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN},
+ #else
+ {"NO_TIME_STAMP_TOKEN", 47, 107},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119},
+ #endif
+ #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED
+ {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED},
+ #else
+ {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129},
+ #endif
+ #ifdef TS_R_POLICY_MISMATCH
+ {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH},
+ #else
+ {"POLICY_MISMATCH", 47, 108},
+ #endif
+ #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120},
+ #endif
+ #ifdef TS_R_RESPONSE_SETUP_ERROR
+ {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR},
+ #else
+ {"RESPONSE_SETUP_ERROR", 47, 121},
+ #endif
+ #ifdef TS_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 47, 109},
+ #endif
+ #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER
+ {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER},
+ #else
+ {"THERE_MUST_BE_ONE_SIGNER", 47, 110},
+ #endif
+ #ifdef TS_R_TIME_SYSCALL_ERROR
+ {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR},
+ #else
+ {"TIME_SYSCALL_ERROR", 47, 122},
+ #endif
+ #ifdef TS_R_TOKEN_NOT_PRESENT
+ {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT},
+ #else
+ {"TOKEN_NOT_PRESENT", 47, 130},
+ #endif
+ #ifdef TS_R_TOKEN_PRESENT
+ {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT},
+ #else
+ {"TOKEN_PRESENT", 47, 131},
+ #endif
+ #ifdef TS_R_TSA_NAME_MISMATCH
+ {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH},
+ #else
+ {"TSA_NAME_MISMATCH", 47, 111},
+ #endif
+ #ifdef TS_R_TSA_UNTRUSTED
+ {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED},
+ #else
+ {"TSA_UNTRUSTED", 47, 112},
+ #endif
+ #ifdef TS_R_TST_INFO_SETUP_ERROR
+ {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR},
+ #else
+ {"TST_INFO_SETUP_ERROR", 47, 123},
+ #endif
+ #ifdef TS_R_TS_DATASIGN
+ {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN},
+ #else
+ {"TS_DATASIGN", 47, 124},
+ #endif
+ #ifdef TS_R_UNACCEPTABLE_POLICY
+ {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY},
+ #else
+ {"UNACCEPTABLE_POLICY", 47, 125},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM
+ {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MD_ALGORITHM", 47, 126},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 47, 113},
+ #endif
+ #ifdef TS_R_VAR_BAD_VALUE
+ {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE},
+ #else
+ {"VAR_BAD_VALUE", 47, 135},
+ #endif
+ #ifdef TS_R_VAR_LOOKUP_FAILURE
+ {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE},
+ #else
+ {"VAR_LOOKUP_FAILURE", 47, 136},
+ #endif
+ #ifdef TS_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 47, 114},
+ #endif
+ #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS},
+ #else
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104},
+ #endif
+ #ifdef UI_R_INDEX_TOO_LARGE
+ {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE},
+ #else
+ {"INDEX_TOO_LARGE", 40, 102},
+ #endif
+ #ifdef UI_R_INDEX_TOO_SMALL
+ {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL},
+ #else
+ {"INDEX_TOO_SMALL", 40, 103},
+ #endif
+ #ifdef UI_R_NO_RESULT_BUFFER
+ {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER},
+ #else
+ {"NO_RESULT_BUFFER", 40, 105},
+ #endif
+ #ifdef UI_R_PROCESSING_ERROR
+ {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR},
+ #else
+ {"PROCESSING_ERROR", 40, 107},
+ #endif
+ #ifdef UI_R_RESULT_TOO_LARGE
+ {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE},
+ #else
+ {"RESULT_TOO_LARGE", 40, 100},
+ #endif
+ #ifdef UI_R_RESULT_TOO_SMALL
+ {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL},
+ #else
+ {"RESULT_TOO_SMALL", 40, 101},
+ #endif
+ #ifdef UI_R_SYSASSIGN_ERROR
+ {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR},
+ #else
+ {"SYSASSIGN_ERROR", 40, 109},
+ #endif
+ #ifdef UI_R_SYSDASSGN_ERROR
+ {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR},
+ #else
+ {"SYSDASSGN_ERROR", 40, 110},
+ #endif
+ #ifdef UI_R_SYSQIOW_ERROR
+ {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR},
+ #else
+ {"SYSQIOW_ERROR", 40, 111},
+ #endif
+ #ifdef UI_R_UNKNOWN_CONTROL_COMMAND
+ {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND},
+ #else
+ {"UNKNOWN_CONTROL_COMMAND", 40, 106},
+ #endif
+ #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE},
+ #else
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108},
+ #endif
+ #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED},
+ #else
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112},
+ #endif
+ #ifdef X509V3_R_BAD_IP_ADDRESS
+ {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS},
+ #else
+ {"BAD_IP_ADDRESS", 34, 118},
+ #endif
+ #ifdef X509V3_R_BAD_OBJECT
+ {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT},
+ #else
+ {"BAD_OBJECT", 34, 119},
+ #endif
+ #ifdef X509V3_R_BN_DEC2BN_ERROR
+ {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR},
+ #else
+ {"BN_DEC2BN_ERROR", 34, 100},
+ #endif
+ #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR
+ {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR},
+ #else
+ {"BN_TO_ASN1_INTEGER_ERROR", 34, 101},
+ #endif
+ #ifdef X509V3_R_DIRNAME_ERROR
+ {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR},
+ #else
+ {"DIRNAME_ERROR", 34, 149},
+ #endif
+ #ifdef X509V3_R_DISTPOINT_ALREADY_SET
+ {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET},
+ #else
+ {"DISTPOINT_ALREADY_SET", 34, 160},
+ #endif
+ #ifdef X509V3_R_DUPLICATE_ZONE_ID
+ {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID},
+ #else
+ {"DUPLICATE_ZONE_ID", 34, 133},
+ #endif
+ #ifdef X509V3_R_ERROR_CONVERTING_ZONE
+ {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE},
+ #else
+ {"ERROR_CONVERTING_ZONE", 34, 131},
+ #endif
+ #ifdef X509V3_R_ERROR_CREATING_EXTENSION
+ {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION},
+ #else
+ {"ERROR_CREATING_EXTENSION", 34, 144},
+ #endif
+ #ifdef X509V3_R_ERROR_IN_EXTENSION
+ {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION},
+ #else
+ {"ERROR_IN_EXTENSION", 34, 128},
+ #endif
+ #ifdef X509V3_R_EXPECTED_A_SECTION_NAME
+ {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME},
+ #else
+ {"EXPECTED_A_SECTION_NAME", 34, 137},
+ #endif
+ #ifdef X509V3_R_EXTENSION_EXISTS
+ {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS},
+ #else
+ {"EXTENSION_EXISTS", 34, 145},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NAME_ERROR
+ {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR},
+ #else
+ {"EXTENSION_NAME_ERROR", 34, 115},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NOT_FOUND
+ {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND},
+ #else
+ {"EXTENSION_NOT_FOUND", 34, 102},
+ #endif
+ #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
+ {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED},
+ #else
+ {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103},
+ #endif
+ #ifdef X509V3_R_EXTENSION_VALUE_ERROR
+ {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR},
+ #else
+ {"EXTENSION_VALUE_ERROR", 34, 116},
+ #endif
+ #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION
+ {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION},
+ #else
+ {"ILLEGAL_EMPTY_EXTENSION", 34, 151},
+ #endif
+ #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG
+ {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG},
+ #else
+ {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152},
+ #endif
+ #ifdef X509V3_R_INVALID_ASNUMBER
+ {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER},
+ #else
+ {"INVALID_ASNUMBER", 34, 162},
+ #endif
+ #ifdef X509V3_R_INVALID_ASRANGE
+ {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE},
+ #else
+ {"INVALID_ASRANGE", 34, 163},
+ #endif
+ #ifdef X509V3_R_INVALID_BOOLEAN_STRING
+ {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING},
+ #else
+ {"INVALID_BOOLEAN_STRING", 34, 104},
+ #endif
+ #ifdef X509V3_R_INVALID_EXTENSION_STRING
+ {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING},
+ #else
+ {"INVALID_EXTENSION_STRING", 34, 105},
+ #endif
+ #ifdef X509V3_R_INVALID_INHERITANCE
+ {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE},
+ #else
+ {"INVALID_INHERITANCE", 34, 165},
+ #endif
+ #ifdef X509V3_R_INVALID_IPADDRESS
+ {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS},
+ #else
+ {"INVALID_IPADDRESS", 34, 166},
+ #endif
+ #ifdef X509V3_R_INVALID_MULTIPLE_RDNS
+ {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS},
+ #else
+ {"INVALID_MULTIPLE_RDNS", 34, 161},
+ #endif
+ #ifdef X509V3_R_INVALID_NAME
+ {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME},
+ #else
+ {"INVALID_NAME", 34, 106},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 34, 107},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_NAME
+ {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME},
+ #else
+ {"INVALID_NULL_NAME", 34, 108},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_VALUE
+ {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE},
+ #else
+ {"INVALID_NULL_VALUE", 34, 109},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 34, 140},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBERS
+ {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS},
+ #else
+ {"INVALID_NUMBERS", 34, 141},
+ #endif
+ #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER
+ {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER},
+ #else
+ {"INVALID_OBJECT_IDENTIFIER", 34, 110},
+ #endif
+ #ifdef X509V3_R_INVALID_OPTION
+ {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION},
+ #else
+ {"INVALID_OPTION", 34, 138},
+ #endif
+ #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER
+ {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER},
+ #else
+ {"INVALID_POLICY_IDENTIFIER", 34, 134},
+ #endif
+ #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING
+ {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING},
+ #else
+ {"INVALID_PROXY_POLICY_SETTING", 34, 153},
+ #endif
+ #ifdef X509V3_R_INVALID_PURPOSE
+ {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE},
+ #else
+ {"INVALID_PURPOSE", 34, 146},
+ #endif
+ #ifdef X509V3_R_INVALID_SAFI
+ {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI},
+ #else
+ {"INVALID_SAFI", 34, 164},
+ #endif
+ #ifdef X509V3_R_INVALID_SECTION
+ {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION},
+ #else
+ {"INVALID_SECTION", 34, 135},
+ #endif
+ #ifdef X509V3_R_INVALID_SYNTAX
+ {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX},
+ #else
+ {"INVALID_SYNTAX", 34, 143},
+ #endif
+ #ifdef X509V3_R_ISSUER_DECODE_ERROR
+ {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR},
+ #else
+ {"ISSUER_DECODE_ERROR", 34, 126},
+ #endif
+ #ifdef X509V3_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 34, 124},
+ #endif
+ #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS
+ {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS},
+ #else
+ {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142},
+ #endif
+ #ifdef X509V3_R_NO_CONFIG_DATABASE
+ {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE},
+ #else
+ {"NO_CONFIG_DATABASE", 34, 136},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_CERTIFICATE
+ {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE},
+ #else
+ {"NO_ISSUER_CERTIFICATE", 34, 121},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_DETAILS
+ {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS},
+ #else
+ {"NO_ISSUER_DETAILS", 34, 127},
+ #endif
+ #ifdef X509V3_R_NO_POLICY_IDENTIFIER
+ {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER},
+ #else
+ {"NO_POLICY_IDENTIFIER", 34, 139},
+ #endif
+ #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED},
+ #else
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154},
+ #endif
+ #ifdef X509V3_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 34, 114},
+ #endif
+ #ifdef X509V3_R_NO_SUBJECT_DETAILS
+ {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS},
+ #else
+ {"NO_SUBJECT_DETAILS", 34, 125},
+ #endif
+ #ifdef X509V3_R_OPERATION_NOT_DEFINED
+ {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED},
+ #else
+ {"OPERATION_NOT_DEFINED", 34, 148},
+ #endif
+ #ifdef X509V3_R_OTHERNAME_ERROR
+ {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR},
+ #else
+ {"OTHERNAME_ERROR", 34, 147},
+ #endif
+ #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED},
+ #else
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH
+ {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH},
+ #else
+ {"POLICY_PATH_LENGTH", 34, 156},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED},
+ #else
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157},
+ #endif
+ #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY},
+ #else
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159},
+ #endif
+ #ifdef X509V3_R_SECTION_NOT_FOUND
+ {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND},
+ #else
+ {"SECTION_NOT_FOUND", 34, 150},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS
+ {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS},
+ #else
+ {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID
+ {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID},
+ #else
+ {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT
+ {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT},
+ #else
+ {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION
+ {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION},
+ #else
+ {"UNKNOWN_EXTENSION", 34, 129},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME
+ {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME},
+ #else
+ {"UNKNOWN_EXTENSION_NAME", 34, 130},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 34, 120},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_OPTION
+ {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION},
+ #else
+ {"UNSUPPORTED_OPTION", 34, 117},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 34, 167},
+ #endif
+ #ifdef X509V3_R_USER_TOO_LONG
+ {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG},
+ #else
+ {"USER_TOO_LONG", 34, 132},
+ #endif
+ #ifdef X509_R_AKID_MISMATCH
+ {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH},
+ #else
+ {"AKID_MISMATCH", 11, 110},
+ #endif
+ #ifdef X509_R_BAD_SELECTOR
+ {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR},
+ #else
+ {"BAD_SELECTOR", 11, 133},
+ #endif
+ #ifdef X509_R_BAD_X509_FILETYPE
+ {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
+ #else
+ {"BAD_X509_FILETYPE", 11, 100},
+ #endif
+ #ifdef X509_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 11, 118},
+ #endif
+ #ifdef X509_R_CANT_CHECK_DH_KEY
+ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
+ #else
+ {"CANT_CHECK_DH_KEY", 11, 114},
+ #endif
+ #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
+ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE},
+ #else
+ {"CERT_ALREADY_IN_HASH_TABLE", 11, 101},
+ #endif
+ #ifdef X509_R_CRL_ALREADY_DELTA
+ {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA},
+ #else
+ {"CRL_ALREADY_DELTA", 11, 127},
+ #endif
+ #ifdef X509_R_CRL_VERIFY_FAILURE
+ {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE},
+ #else
+ {"CRL_VERIFY_FAILURE", 11, 131},
+ #endif
+ #ifdef X509_R_ERR_ASN1_LIB
+ {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB},
+ #else
+ {"ERR_ASN1_LIB", 11, 102},
+ #endif
+ #ifdef X509_R_IDP_MISMATCH
+ {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH},
+ #else
+ {"IDP_MISMATCH", 11, 128},
+ #endif
+ #ifdef X509_R_INVALID_ATTRIBUTES
+ {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES},
+ #else
+ {"INVALID_ATTRIBUTES", 11, 138},
+ #endif
+ #ifdef X509_R_INVALID_DIRECTORY
+ {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
+ #else
+ {"INVALID_DIRECTORY", 11, 113},
+ #endif
+ #ifdef X509_R_INVALID_FIELD_NAME
+ {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
+ #else
+ {"INVALID_FIELD_NAME", 11, 119},
+ #endif
+ #ifdef X509_R_INVALID_TRUST
+ {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
+ #else
+ {"INVALID_TRUST", 11, 123},
+ #endif
+ #ifdef X509_R_ISSUER_MISMATCH
+ {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH},
+ #else
+ {"ISSUER_MISMATCH", 11, 129},
+ #endif
+ #ifdef X509_R_KEY_TYPE_MISMATCH
+ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
+ #else
+ {"KEY_TYPE_MISMATCH", 11, 115},
+ #endif
+ #ifdef X509_R_KEY_VALUES_MISMATCH
+ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
+ #else
+ {"KEY_VALUES_MISMATCH", 11, 116},
+ #endif
+ #ifdef X509_R_LOADING_CERT_DIR
+ {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
+ #else
+ {"LOADING_CERT_DIR", 11, 103},
+ #endif
+ #ifdef X509_R_LOADING_DEFAULTS
+ {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
+ #else
+ {"LOADING_DEFAULTS", 11, 104},
+ #endif
+ #ifdef X509_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 11, 124},
+ #endif
+ #ifdef X509_R_NAME_TOO_LONG
+ {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG},
+ #else
+ {"NAME_TOO_LONG", 11, 134},
+ #endif
+ #ifdef X509_R_NEWER_CRL_NOT_NEWER
+ {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER},
+ #else
+ {"NEWER_CRL_NOT_NEWER", 11, 132},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_FOUND
+ {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND},
+ #else
+ {"NO_CERTIFICATE_FOUND", 11, 135},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND
+ {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND},
+ #else
+ {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136},
+ #endif
+ #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
+ #else
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105},
+ #endif
+ #ifdef X509_R_NO_CRL_FOUND
+ {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND},
+ #else
+ {"NO_CRL_FOUND", 11, 137},
+ #endif
+ #ifdef X509_R_NO_CRL_NUMBER
+ {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER},
+ #else
+ {"NO_CRL_NUMBER", 11, 130},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
+ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR},
+ #else
+ {"PUBLIC_KEY_DECODE_ERROR", 11, 125},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
+ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR},
+ #else
+ {"PUBLIC_KEY_ENCODE_ERROR", 11, 126},
+ #endif
+ #ifdef X509_R_SHOULD_RETRY
+ {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
+ #else
+ {"SHOULD_RETRY", 11, 106},
+ #endif
+ #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
+ #else
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107},
+ #endif
+ #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
+ #else
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108},
+ #endif
+ #ifdef X509_R_UNKNOWN_KEY_TYPE
+ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
+ #else
+ {"UNKNOWN_KEY_TYPE", 11, 117},
+ #endif
+ #ifdef X509_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 11, 109},
+ #endif
+ #ifdef X509_R_UNKNOWN_PURPOSE_ID
+ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
+ #else
+ {"UNKNOWN_PURPOSE_ID", 11, 121},
+ #endif
+ #ifdef X509_R_UNKNOWN_TRUST_ID
+ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
+ #else
+ {"UNKNOWN_TRUST_ID", 11, 120},
+ #endif
+ #ifdef X509_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 11, 111},
+ #endif
+ #ifdef X509_R_WRONG_LOOKUP_TYPE
+ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
+ #else
+ {"WRONG_LOOKUP_TYPE", 11, 112},
+ #endif
+ #ifdef X509_R_WRONG_TYPE
+ {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
+ #else
+ {"WRONG_TYPE", 11, 122},
+ #endif
+ { NULL }
+};
diff --git a/contrib/tools/python3/Modules/_ssl_data_111.h b/contrib/tools/python3/Modules/_ssl_data_111.h
new file mode 100644
index 00000000000..093c786e6a2
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl_data_111.h
@@ -0,0 +1,6540 @@
+/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2023-06-01T02:58:04.081473 */
+static struct py_ssl_library_code library_codes[] = {
+#ifdef ERR_LIB_ASN1
+ {"ASN1", ERR_LIB_ASN1},
+#endif
+#ifdef ERR_LIB_ASYNC
+ {"ASYNC", ERR_LIB_ASYNC},
+#endif
+#ifdef ERR_LIB_BIO
+ {"BIO", ERR_LIB_BIO},
+#endif
+#ifdef ERR_LIB_BN
+ {"BN", ERR_LIB_BN},
+#endif
+#ifdef ERR_LIB_BUF
+ {"BUF", ERR_LIB_BUF},
+#endif
+#ifdef ERR_LIB_CMS
+ {"CMS", ERR_LIB_CMS},
+#endif
+#ifdef ERR_LIB_COMP
+ {"COMP", ERR_LIB_COMP},
+#endif
+#ifdef ERR_LIB_CONF
+ {"CONF", ERR_LIB_CONF},
+#endif
+#ifdef ERR_LIB_CRYPTO
+ {"CRYPTO", ERR_LIB_CRYPTO},
+#endif
+#ifdef ERR_LIB_CT
+ {"CT", ERR_LIB_CT},
+#endif
+#ifdef ERR_LIB_DH
+ {"DH", ERR_LIB_DH},
+#endif
+#ifdef ERR_LIB_DSA
+ {"DSA", ERR_LIB_DSA},
+#endif
+#ifdef ERR_LIB_DSO
+ {"DSO", ERR_LIB_DSO},
+#endif
+#ifdef ERR_LIB_EC
+ {"EC", ERR_LIB_EC},
+#endif
+#ifdef ERR_LIB_ECDH
+ {"ECDH", ERR_LIB_ECDH},
+#endif
+#ifdef ERR_LIB_ECDSA
+ {"ECDSA", ERR_LIB_ECDSA},
+#endif
+#ifdef ERR_LIB_ENGINE
+ {"ENGINE", ERR_LIB_ENGINE},
+#endif
+#ifdef ERR_LIB_EVP
+ {"EVP", ERR_LIB_EVP},
+#endif
+#ifdef ERR_LIB_FIPS
+ {"FIPS", ERR_LIB_FIPS},
+#endif
+#ifdef ERR_LIB_HMAC
+ {"HMAC", ERR_LIB_HMAC},
+#endif
+#ifdef ERR_LIB_JPAKE
+ {"JPAKE", ERR_LIB_JPAKE},
+#endif
+#ifdef ERR_LIB_KDF
+ {"KDF", ERR_LIB_KDF},
+#endif
+#ifdef ERR_LIB_METH
+ {"METH", ERR_LIB_METH},
+#endif
+#ifdef ERR_LIB_NONE
+ {"NONE", ERR_LIB_NONE},
+#endif
+#ifdef ERR_LIB_OBJ
+ {"OBJ", ERR_LIB_OBJ},
+#endif
+#ifdef ERR_LIB_OCSP
+ {"OCSP", ERR_LIB_OCSP},
+#endif
+#ifdef ERR_LIB_OSSL_STORE
+ {"OSSL_STORE", ERR_LIB_OSSL_STORE},
+#endif
+#ifdef ERR_LIB_PEM
+ {"PEM", ERR_LIB_PEM},
+#endif
+#ifdef ERR_LIB_PKCS12
+ {"PKCS12", ERR_LIB_PKCS12},
+#endif
+#ifdef ERR_LIB_PKCS7
+ {"PKCS7", ERR_LIB_PKCS7},
+#endif
+#ifdef ERR_LIB_PROXY
+ {"PROXY", ERR_LIB_PROXY},
+#endif
+#ifdef ERR_LIB_RAND
+ {"RAND", ERR_LIB_RAND},
+#endif
+#ifdef ERR_LIB_RSA
+ {"RSA", ERR_LIB_RSA},
+#endif
+#ifdef ERR_LIB_RSAREF
+ {"RSAREF", ERR_LIB_RSAREF},
+#endif
+#ifdef ERR_LIB_SM2
+ {"SM2", ERR_LIB_SM2},
+#endif
+#ifdef ERR_LIB_SSL
+ {"SSL", ERR_LIB_SSL},
+#endif
+#ifdef ERR_LIB_SSL2
+ {"SSL2", ERR_LIB_SSL2},
+#endif
+#ifdef ERR_LIB_SSL23
+ {"SSL23", ERR_LIB_SSL23},
+#endif
+#ifdef ERR_LIB_SSL3
+ {"SSL3", ERR_LIB_SSL3},
+#endif
+#ifdef ERR_LIB_SYS
+ {"SYS", ERR_LIB_SYS},
+#endif
+#ifdef ERR_LIB_TS
+ {"TS", ERR_LIB_TS},
+#endif
+#ifdef ERR_LIB_UI
+ {"UI", ERR_LIB_UI},
+#endif
+#ifdef ERR_LIB_USER
+ {"USER", ERR_LIB_USER},
+#endif
+#ifdef ERR_LIB_X509
+ {"X509", ERR_LIB_X509},
+#endif
+#ifdef ERR_LIB_X509V3
+ {"X509V3", ERR_LIB_X509V3},
+#endif
+ { NULL }
+};
+
+
+static struct py_ssl_error_code error_codes[] = {
+ #ifdef ASN1_R_ADDING_OBJECT
+ {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
+ #else
+ {"ADDING_OBJECT", 13, 171},
+ #endif
+ #ifdef ASN1_R_ASN1_PARSE_ERROR
+ {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR},
+ #else
+ {"ASN1_PARSE_ERROR", 13, 203},
+ #endif
+ #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR
+ {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR},
+ #else
+ {"ASN1_SIG_PARSE_ERROR", 13, 204},
+ #endif
+ #ifdef ASN1_R_AUX_ERROR
+ {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR},
+ #else
+ {"AUX_ERROR", 13, 100},
+ #endif
+ #ifdef ASN1_R_BAD_OBJECT_HEADER
+ {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER},
+ #else
+ {"BAD_OBJECT_HEADER", 13, 102},
+ #endif
+ #ifdef ASN1_R_BAD_TEMPLATE
+ {"BAD_TEMPLATE", ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE},
+ #else
+ {"BAD_TEMPLATE", 13, 230},
+ #endif
+ #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH
+ {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH},
+ #else
+ {"BMPSTRING_IS_WRONG_LENGTH", 13, 214},
+ #endif
+ #ifdef ASN1_R_BN_LIB
+ {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB},
+ #else
+ {"BN_LIB", 13, 105},
+ #endif
+ #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH
+ {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH},
+ #else
+ {"BOOLEAN_IS_WRONG_LENGTH", 13, 106},
+ #endif
+ #ifdef ASN1_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 13, 107},
+ #endif
+ #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108},
+ #endif
+ #ifdef ASN1_R_CONTEXT_NOT_INITIALISED
+ {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED},
+ #else
+ {"CONTEXT_NOT_INITIALISED", 13, 217},
+ #endif
+ #ifdef ASN1_R_DATA_IS_WRONG
+ {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG},
+ #else
+ {"DATA_IS_WRONG", 13, 109},
+ #endif
+ #ifdef ASN1_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 13, 110},
+ #endif
+ #ifdef ASN1_R_DEPTH_EXCEEDED
+ {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED},
+ #else
+ {"DEPTH_EXCEEDED", 13, 174},
+ #endif
+ #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED},
+ #else
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198},
+ #endif
+ #ifdef ASN1_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 13, 112},
+ #endif
+ #ifdef ASN1_R_ERROR_GETTING_TIME
+ {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME},
+ #else
+ {"ERROR_GETTING_TIME", 13, 173},
+ #endif
+ #ifdef ASN1_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 13, 172},
+ #endif
+ #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS
+ {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS},
+ #else
+ {"ERROR_SETTING_CIPHER_PARAMS", 13, 114},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_INTEGER
+ {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER},
+ #else
+ {"EXPECTING_AN_INTEGER", 13, 115},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_OBJECT
+ {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT},
+ #else
+ {"EXPECTING_AN_OBJECT", 13, 116},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH
+ {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH},
+ #else
+ {"EXPLICIT_LENGTH_MISMATCH", 13, 119},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED},
+ #else
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120},
+ #endif
+ #ifdef ASN1_R_FIELD_MISSING
+ {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING},
+ #else
+ {"FIELD_MISSING", 13, 121},
+ #endif
+ #ifdef ASN1_R_FIRST_NUM_TOO_LARGE
+ {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE},
+ #else
+ {"FIRST_NUM_TOO_LARGE", 13, 122},
+ #endif
+ #ifdef ASN1_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 13, 123},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT
+ {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT},
+ #else
+ {"ILLEGAL_BITSTRING_FORMAT", 13, 175},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BOOLEAN
+ {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN},
+ #else
+ {"ILLEGAL_BOOLEAN", 13, 176},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_CHARACTERS
+ {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS},
+ #else
+ {"ILLEGAL_CHARACTERS", 13, 124},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_FORMAT
+ {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT},
+ #else
+ {"ILLEGAL_FORMAT", 13, 177},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_HEX
+ {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX},
+ #else
+ {"ILLEGAL_HEX", 13, 178},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG
+ {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG},
+ #else
+ {"ILLEGAL_IMPLICIT_TAG", 13, 179},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_INTEGER
+ {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER},
+ #else
+ {"ILLEGAL_INTEGER", 13, 180},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE
+ {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE},
+ #else
+ {"ILLEGAL_NEGATIVE_VALUE", 13, 226},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING
+ {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING},
+ #else
+ {"ILLEGAL_NESTED_TAGGING", 13, 181},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL
+ {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL},
+ #else
+ {"ILLEGAL_NULL", 13, 125},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL_VALUE
+ {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE},
+ #else
+ {"ILLEGAL_NULL_VALUE", 13, 182},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OBJECT
+ {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT},
+ #else
+ {"ILLEGAL_OBJECT", 13, 183},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY
+ {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY},
+ #else
+ {"ILLEGAL_OPTIONAL_ANY", 13, 126},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE},
+ #else
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_PADDING
+ {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING},
+ #else
+ {"ILLEGAL_PADDING", 13, 221},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TAGGED_ANY
+ {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY},
+ #else
+ {"ILLEGAL_TAGGED_ANY", 13, 127},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TIME_VALUE
+ {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE},
+ #else
+ {"ILLEGAL_TIME_VALUE", 13, 184},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT
+ {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT},
+ #else
+ {"ILLEGAL_ZERO_CONTENT", 13, 222},
+ #endif
+ #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT
+ {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT},
+ #else
+ {"INTEGER_NOT_ASCII_FORMAT", 13, 185},
+ #endif
+ #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG
+ {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG},
+ #else
+ {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128},
+ #endif
+ #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT
+ {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT},
+ #else
+ {"INVALID_BIT_STRING_BITS_LEFT", 13, 220},
+ #endif
+ #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH
+ {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH},
+ #else
+ {"INVALID_BMPSTRING_LENGTH", 13, 129},
+ #endif
+ #ifdef ASN1_R_INVALID_DIGIT
+ {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT},
+ #else
+ {"INVALID_DIGIT", 13, 130},
+ #endif
+ #ifdef ASN1_R_INVALID_MIME_TYPE
+ {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE},
+ #else
+ {"INVALID_MIME_TYPE", 13, 205},
+ #endif
+ #ifdef ASN1_R_INVALID_MODIFIER
+ {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER},
+ #else
+ {"INVALID_MODIFIER", 13, 186},
+ #endif
+ #ifdef ASN1_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 13, 187},
+ #endif
+ #ifdef ASN1_R_INVALID_OBJECT_ENCODING
+ {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING},
+ #else
+ {"INVALID_OBJECT_ENCODING", 13, 216},
+ #endif
+ #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS
+ {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS},
+ #else
+ {"INVALID_SCRYPT_PARAMETERS", 13, 227},
+ #endif
+ #ifdef ASN1_R_INVALID_SEPARATOR
+ {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR},
+ #else
+ {"INVALID_SEPARATOR", 13, 131},
+ #endif
+ #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE
+ {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE},
+ #else
+ {"INVALID_STRING_TABLE_VALUE", 13, 218},
+ #endif
+ #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH
+ {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH},
+ #else
+ {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133},
+ #endif
+ #ifdef ASN1_R_INVALID_UTF8STRING
+ {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING},
+ #else
+ {"INVALID_UTF8STRING", 13, 134},
+ #endif
+ #ifdef ASN1_R_INVALID_VALUE
+ {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE},
+ #else
+ {"INVALID_VALUE", 13, 219},
+ #endif
+ #ifdef ASN1_R_LIST_ERROR
+ {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR},
+ #else
+ {"LIST_ERROR", 13, 188},
+ #endif
+ #ifdef ASN1_R_MIME_NO_CONTENT_TYPE
+ {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE},
+ #else
+ {"MIME_NO_CONTENT_TYPE", 13, 206},
+ #endif
+ #ifdef ASN1_R_MIME_PARSE_ERROR
+ {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR},
+ #else
+ {"MIME_PARSE_ERROR", 13, 207},
+ #endif
+ #ifdef ASN1_R_MIME_SIG_PARSE_ERROR
+ {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR},
+ #else
+ {"MIME_SIG_PARSE_ERROR", 13, 208},
+ #endif
+ #ifdef ASN1_R_MISSING_EOC
+ {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC},
+ #else
+ {"MISSING_EOC", 13, 137},
+ #endif
+ #ifdef ASN1_R_MISSING_SECOND_NUMBER
+ {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER},
+ #else
+ {"MISSING_SECOND_NUMBER", 13, 138},
+ #endif
+ #ifdef ASN1_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 13, 189},
+ #endif
+ #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL
+ {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL},
+ #else
+ {"MSTRING_NOT_UNIVERSAL", 13, 139},
+ #endif
+ #ifdef ASN1_R_MSTRING_WRONG_TAG
+ {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG},
+ #else
+ {"MSTRING_WRONG_TAG", 13, 140},
+ #endif
+ #ifdef ASN1_R_NESTED_ASN1_STRING
+ {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING},
+ #else
+ {"NESTED_ASN1_STRING", 13, 197},
+ #endif
+ #ifdef ASN1_R_NESTED_TOO_DEEP
+ {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP},
+ #else
+ {"NESTED_TOO_DEEP", 13, 201},
+ #endif
+ #ifdef ASN1_R_NON_HEX_CHARACTERS
+ {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS},
+ #else
+ {"NON_HEX_CHARACTERS", 13, 141},
+ #endif
+ #ifdef ASN1_R_NOT_ASCII_FORMAT
+ {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT},
+ #else
+ {"NOT_ASCII_FORMAT", 13, 190},
+ #endif
+ #ifdef ASN1_R_NOT_ENOUGH_DATA
+ {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA},
+ #else
+ {"NOT_ENOUGH_DATA", 13, 142},
+ #endif
+ #ifdef ASN1_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 13, 209},
+ #endif
+ #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE
+ {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE},
+ #else
+ {"NO_MATCHING_CHOICE_TYPE", 13, 143},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE
+ {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE},
+ #else
+ {"NO_MULTIPART_BODY_FAILURE", 13, 210},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BOUNDARY
+ {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY},
+ #else
+ {"NO_MULTIPART_BOUNDARY", 13, 211},
+ #endif
+ #ifdef ASN1_R_NO_SIG_CONTENT_TYPE
+ {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE},
+ #else
+ {"NO_SIG_CONTENT_TYPE", 13, 212},
+ #endif
+ #ifdef ASN1_R_NULL_IS_WRONG_LENGTH
+ {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH},
+ #else
+ {"NULL_IS_WRONG_LENGTH", 13, 144},
+ #endif
+ #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT
+ {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT},
+ #else
+ {"OBJECT_NOT_ASCII_FORMAT", 13, 191},
+ #endif
+ #ifdef ASN1_R_ODD_NUMBER_OF_CHARS
+ {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS},
+ #else
+ {"ODD_NUMBER_OF_CHARS", 13, 145},
+ #endif
+ #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE
+ {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE},
+ #else
+ {"SECOND_NUMBER_TOO_LARGE", 13, 147},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH
+ {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH},
+ #else
+ {"SEQUENCE_LENGTH_MISMATCH", 13, 148},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED
+ {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED},
+ #else
+ {"SEQUENCE_NOT_CONSTRUCTED", 13, 149},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG},
+ #else
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192},
+ #endif
+ #ifdef ASN1_R_SHORT_LINE
+ {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE},
+ #else
+ {"SHORT_LINE", 13, 150},
+ #endif
+ #ifdef ASN1_R_SIG_INVALID_MIME_TYPE
+ {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE},
+ #else
+ {"SIG_INVALID_MIME_TYPE", 13, 213},
+ #endif
+ #ifdef ASN1_R_STREAMING_NOT_SUPPORTED
+ {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED},
+ #else
+ {"STREAMING_NOT_SUPPORTED", 13, 202},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 13, 151},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_SHORT
+ {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT},
+ #else
+ {"STRING_TOO_SHORT", 13, 152},
+ #endif
+ #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154},
+ #endif
+ #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT
+ {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT},
+ #else
+ {"TIME_NOT_ASCII_FORMAT", 13, 193},
+ #endif
+ #ifdef ASN1_R_TOO_LARGE
+ {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE},
+ #else
+ {"TOO_LARGE", 13, 223},
+ #endif
+ #ifdef ASN1_R_TOO_LONG
+ {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG},
+ #else
+ {"TOO_LONG", 13, 155},
+ #endif
+ #ifdef ASN1_R_TOO_SMALL
+ {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL},
+ #else
+ {"TOO_SMALL", 13, 224},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED
+ {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED},
+ #else
+ {"TYPE_NOT_CONSTRUCTED", 13, 156},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_PRIMITIVE
+ {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE},
+ #else
+ {"TYPE_NOT_PRIMITIVE", 13, 195},
+ #endif
+ #ifdef ASN1_R_UNEXPECTED_EOC
+ {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC},
+ #else
+ {"UNEXPECTED_EOC", 13, 159},
+ #endif
+ #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH},
+ #else
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_FORMAT
+ {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT},
+ #else
+ {"UNKNOWN_FORMAT", 13, 160},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE
+ {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE},
+ #else
+ {"UNKNOWN_OBJECT_TYPE", 13, 162},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE
+ {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE},
+ #else
+ {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM
+ {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM},
+ #else
+ {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_TAG
+ {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG},
+ #else
+ {"UNKNOWN_TAG", 13, 194},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE},
+ #else
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 13, 228},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 13, 196},
+ #endif
+ #ifdef ASN1_R_WRONG_INTEGER_TYPE
+ {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE},
+ #else
+ {"WRONG_INTEGER_TYPE", 13, 225},
+ #endif
+ #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE
+ {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE},
+ #else
+ {"WRONG_PUBLIC_KEY_TYPE", 13, 200},
+ #endif
+ #ifdef ASN1_R_WRONG_TAG
+ {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG},
+ #else
+ {"WRONG_TAG", 13, 168},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SET_POOL
+ {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL},
+ #else
+ {"FAILED_TO_SET_POOL", 51, 101},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT
+ {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT},
+ #else
+ {"FAILED_TO_SWAP_CONTEXT", 51, 102},
+ #endif
+ #ifdef ASYNC_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 51, 105},
+ #endif
+ #ifdef ASYNC_R_INVALID_POOL_SIZE
+ {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE},
+ #else
+ {"INVALID_POOL_SIZE", 51, 103},
+ #endif
+ #ifdef BIO_R_ACCEPT_ERROR
+ {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR},
+ #else
+ {"ACCEPT_ERROR", 32, 100},
+ #endif
+ #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET},
+ #else
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141},
+ #endif
+ #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE
+ {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE},
+ #else
+ {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129},
+ #endif
+ #ifdef BIO_R_BAD_FOPEN_MODE
+ {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE},
+ #else
+ {"BAD_FOPEN_MODE", 32, 101},
+ #endif
+ #ifdef BIO_R_BROKEN_PIPE
+ {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE},
+ #else
+ {"BROKEN_PIPE", 32, 124},
+ #endif
+ #ifdef BIO_R_CONNECT_ERROR
+ {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR},
+ #else
+ {"CONNECT_ERROR", 32, 103},
+ #endif
+ #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET},
+ #else
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_ERROR
+ {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR},
+ #else
+ {"GETSOCKNAME_ERROR", 32, 132},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS},
+ #else
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133},
+ #endif
+ #ifdef BIO_R_GETTING_SOCKTYPE
+ {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE},
+ #else
+ {"GETTING_SOCKTYPE", 32, 134},
+ #endif
+ #ifdef BIO_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 32, 125},
+ #endif
+ #ifdef BIO_R_INVALID_SOCKET
+ {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET},
+ #else
+ {"INVALID_SOCKET", 32, 135},
+ #endif
+ #ifdef BIO_R_IN_USE
+ {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE},
+ #else
+ {"IN_USE", 32, 123},
+ #endif
+ #ifdef BIO_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 32, 102},
+ #endif
+ #ifdef BIO_R_LISTEN_V6_ONLY
+ {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY},
+ #else
+ {"LISTEN_V6_ONLY", 32, 136},
+ #endif
+ #ifdef BIO_R_LOOKUP_RETURNED_NOTHING
+ {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING},
+ #else
+ {"LOOKUP_RETURNED_NOTHING", 32, 142},
+ #endif
+ #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE
+ {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE},
+ #else
+ {"MALFORMED_HOST_OR_SERVICE", 32, 130},
+ #endif
+ #ifdef BIO_R_NBIO_CONNECT_ERROR
+ {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR},
+ #else
+ {"NBIO_CONNECT_ERROR", 32, 110},
+ #endif
+ #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143},
+ #endif
+ #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144},
+ #endif
+ #ifdef BIO_R_NO_PORT_DEFINED
+ {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED},
+ #else
+ {"NO_PORT_DEFINED", 32, 113},
+ #endif
+ #ifdef BIO_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 32, 128},
+ #endif
+ #ifdef BIO_R_NULL_PARAMETER
+ {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER},
+ #else
+ {"NULL_PARAMETER", 32, 115},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_BIND_SOCKET
+ {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET},
+ #else
+ {"UNABLE_TO_BIND_SOCKET", 32, 117},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET
+ {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET},
+ #else
+ {"UNABLE_TO_CREATE_SOCKET", 32, 118},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_KEEPALIVE
+ {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE},
+ #else
+ {"UNABLE_TO_KEEPALIVE", 32, 137},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET
+ {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET},
+ #else
+ {"UNABLE_TO_LISTEN_SOCKET", 32, 119},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_NODELAY
+ {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY},
+ #else
+ {"UNABLE_TO_NODELAY", 32, 138},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_REUSEADDR
+ {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR},
+ #else
+ {"UNABLE_TO_REUSEADDR", 32, 139},
+ #endif
+ #ifdef BIO_R_UNAVAILABLE_IP_FAMILY
+ {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY},
+ #else
+ {"UNAVAILABLE_IP_FAMILY", 32, 145},
+ #endif
+ #ifdef BIO_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 32, 120},
+ #endif
+ #ifdef BIO_R_UNKNOWN_INFO_TYPE
+ {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE},
+ #else
+ {"UNKNOWN_INFO_TYPE", 32, 140},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_IP_FAMILY
+ {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY},
+ #else
+ {"UNSUPPORTED_IP_FAMILY", 32, 146},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_METHOD
+ {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD},
+ #else
+ {"UNSUPPORTED_METHOD", 32, 121},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY
+ {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY},
+ #else
+ {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131},
+ #endif
+ #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO
+ {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO},
+ #else
+ {"WRITE_TO_READ_ONLY_BIO", 32, 126},
+ #endif
+ #ifdef BIO_R_WSASTARTUP
+ {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP},
+ #else
+ {"WSASTARTUP", 32, 122},
+ #endif
+ #ifdef BN_R_ARG2_LT_ARG3
+ {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3},
+ #else
+ {"ARG2_LT_ARG3", 3, 100},
+ #endif
+ #ifdef BN_R_BAD_RECIPROCAL
+ {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL},
+ #else
+ {"BAD_RECIPROCAL", 3, 101},
+ #endif
+ #ifdef BN_R_BIGNUM_TOO_LONG
+ {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG},
+ #else
+ {"BIGNUM_TOO_LONG", 3, 114},
+ #endif
+ #ifdef BN_R_BITS_TOO_SMALL
+ {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL},
+ #else
+ {"BITS_TOO_SMALL", 3, 118},
+ #endif
+ #ifdef BN_R_CALLED_WITH_EVEN_MODULUS
+ {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS},
+ #else
+ {"CALLED_WITH_EVEN_MODULUS", 3, 102},
+ #endif
+ #ifdef BN_R_DIV_BY_ZERO
+ {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO},
+ #else
+ {"DIV_BY_ZERO", 3, 103},
+ #endif
+ #ifdef BN_R_ENCODING_ERROR
+ {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR},
+ #else
+ {"ENCODING_ERROR", 3, 104},
+ #endif
+ #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA},
+ #else
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105},
+ #endif
+ #ifdef BN_R_INPUT_NOT_REDUCED
+ {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED},
+ #else
+ {"INPUT_NOT_REDUCED", 3, 110},
+ #endif
+ #ifdef BN_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 3, 106},
+ #endif
+ #ifdef BN_R_INVALID_RANGE
+ {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE},
+ #else
+ {"INVALID_RANGE", 3, 115},
+ #endif
+ #ifdef BN_R_INVALID_SHIFT
+ {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT},
+ #else
+ {"INVALID_SHIFT", 3, 119},
+ #endif
+ #ifdef BN_R_NOT_A_SQUARE
+ {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE},
+ #else
+ {"NOT_A_SQUARE", 3, 111},
+ #endif
+ #ifdef BN_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 3, 107},
+ #endif
+ #ifdef BN_R_NO_INVERSE
+ {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE},
+ #else
+ {"NO_INVERSE", 3, 108},
+ #endif
+ #ifdef BN_R_NO_SOLUTION
+ {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION},
+ #else
+ {"NO_SOLUTION", 3, 116},
+ #endif
+ #ifdef BN_R_PRIVATE_KEY_TOO_LARGE
+ {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE},
+ #else
+ {"PRIVATE_KEY_TOO_LARGE", 3, 117},
+ #endif
+ #ifdef BN_R_P_IS_NOT_PRIME
+ {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME},
+ #else
+ {"P_IS_NOT_PRIME", 3, 112},
+ #endif
+ #ifdef BN_R_TOO_MANY_ITERATIONS
+ {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS},
+ #else
+ {"TOO_MANY_ITERATIONS", 3, 113},
+ #endif
+ #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES
+ {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES},
+ #else
+ {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109},
+ #endif
+ #ifdef CMS_R_ADD_SIGNER_ERROR
+ {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR},
+ #else
+ {"ADD_SIGNER_ERROR", 46, 99},
+ #endif
+ #ifdef CMS_R_ATTRIBUTE_ERROR
+ {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR},
+ #else
+ {"ATTRIBUTE_ERROR", 46, 161},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT
+ {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT},
+ #else
+ {"CERTIFICATE_ALREADY_PRESENT", 46, 175},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID
+ {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID},
+ #else
+ {"CERTIFICATE_HAS_NO_KEYID", 46, 160},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 46, 100},
+ #endif
+ #ifdef CMS_R_CIPHER_INITIALISATION_ERROR
+ {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_INITIALISATION_ERROR", 46, 101},
+ #endif
+ #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102},
+ #endif
+ #ifdef CMS_R_CMS_DATAFINAL_ERROR
+ {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR},
+ #else
+ {"CMS_DATAFINAL_ERROR", 46, 103},
+ #endif
+ #ifdef CMS_R_CMS_LIB
+ {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB},
+ #else
+ {"CMS_LIB", 46, 104},
+ #endif
+ #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH
+ {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH},
+ #else
+ {"CONTENTIDENTIFIER_MISMATCH", 46, 170},
+ #endif
+ #ifdef CMS_R_CONTENT_NOT_FOUND
+ {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND},
+ #else
+ {"CONTENT_NOT_FOUND", 46, 105},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_MISMATCH
+ {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH},
+ #else
+ {"CONTENT_TYPE_MISMATCH", 46, 171},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108},
+ #endif
+ #ifdef CMS_R_CONTENT_VERIFY_ERROR
+ {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR},
+ #else
+ {"CONTENT_VERIFY_ERROR", 46, 109},
+ #endif
+ #ifdef CMS_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 46, 110},
+ #endif
+ #ifdef CMS_R_CTRL_FAILURE
+ {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE},
+ #else
+ {"CTRL_FAILURE", 46, 111},
+ #endif
+ #ifdef CMS_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 46, 112},
+ #endif
+ #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY
+ {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY},
+ #else
+ {"ERROR_GETTING_PUBLIC_KEY", 46, 113},
+ #endif
+ #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE},
+ #else
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_KEY
+ {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY},
+ #else
+ {"ERROR_SETTING_KEY", 46, 115},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO
+ {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO},
+ #else
+ {"ERROR_SETTING_RECIPIENTINFO", 46, 116},
+ #endif
+ #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH
+ {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH},
+ #else
+ {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER},
+ #else
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 46, 118},
+ #endif
+ #ifdef CMS_R_MD_BIO_INIT_ERROR
+ {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR},
+ #else
+ {"MD_BIO_INIT_ERROR", 46, 119},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH
+ {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_ERROR
+ {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR},
+ #else
+ {"MSGSIGDIGEST_ERROR", 46, 172},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE},
+ #else
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH
+ {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH},
+ #else
+ {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163},
+ #endif
+ #ifdef CMS_R_NEED_ONE_SIGNER
+ {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER},
+ #else
+ {"NEED_ONE_SIGNER", 46, 164},
+ #endif
+ #ifdef CMS_R_NOT_A_SIGNED_RECEIPT
+ {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT},
+ #else
+ {"NOT_A_SIGNED_RECEIPT", 46, 165},
+ #endif
+ #ifdef CMS_R_NOT_ENCRYPTED_DATA
+ {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA},
+ #else
+ {"NOT_ENCRYPTED_DATA", 46, 122},
+ #endif
+ #ifdef CMS_R_NOT_KEK
+ {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK},
+ #else
+ {"NOT_KEK", 46, 123},
+ #endif
+ #ifdef CMS_R_NOT_KEY_AGREEMENT
+ {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT},
+ #else
+ {"NOT_KEY_AGREEMENT", 46, 181},
+ #endif
+ #ifdef CMS_R_NOT_KEY_TRANSPORT
+ {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT},
+ #else
+ {"NOT_KEY_TRANSPORT", 46, 124},
+ #endif
+ #ifdef CMS_R_NOT_PWRI
+ {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI},
+ #else
+ {"NOT_PWRI", 46, 177},
+ #endif
+ #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125},
+ #endif
+ #ifdef CMS_R_NO_CIPHER
+ {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER},
+ #else
+ {"NO_CIPHER", 46, 126},
+ #endif
+ #ifdef CMS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 46, 127},
+ #endif
+ #ifdef CMS_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 46, 173},
+ #endif
+ #ifdef CMS_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 46, 128},
+ #endif
+ #ifdef CMS_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 46, 129},
+ #endif
+ #ifdef CMS_R_NO_KEY
+ {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY},
+ #else
+ {"NO_KEY", 46, 130},
+ #endif
+ #ifdef CMS_R_NO_KEY_OR_CERT
+ {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT},
+ #else
+ {"NO_KEY_OR_CERT", 46, 174},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_DIGEST
+ {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST},
+ #else
+ {"NO_MATCHING_DIGEST", 46, 131},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_RECIPIENT
+ {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT},
+ #else
+ {"NO_MATCHING_RECIPIENT", 46, 132},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_SIGNATURE
+ {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE},
+ #else
+ {"NO_MATCHING_SIGNATURE", 46, 166},
+ #endif
+ #ifdef CMS_R_NO_MSGSIGDIGEST
+ {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST},
+ #else
+ {"NO_MSGSIGDIGEST", 46, 167},
+ #endif
+ #ifdef CMS_R_NO_PASSWORD
+ {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD},
+ #else
+ {"NO_PASSWORD", 46, 178},
+ #endif
+ #ifdef CMS_R_NO_PRIVATE_KEY
+ {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY},
+ #else
+ {"NO_PRIVATE_KEY", 46, 133},
+ #endif
+ #ifdef CMS_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 46, 134},
+ #endif
+ #ifdef CMS_R_NO_RECEIPT_REQUEST
+ {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST},
+ #else
+ {"NO_RECEIPT_REQUEST", 46, 168},
+ #endif
+ #ifdef CMS_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 46, 135},
+ #endif
+ #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136},
+ #endif
+ #ifdef CMS_R_RECEIPT_DECODE_ERROR
+ {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR},
+ #else
+ {"RECEIPT_DECODE_ERROR", 46, 169},
+ #endif
+ #ifdef CMS_R_RECIPIENT_ERROR
+ {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR},
+ #else
+ {"RECIPIENT_ERROR", 46, 137},
+ #endif
+ #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138},
+ #endif
+ #ifdef CMS_R_SIGNFINAL_ERROR
+ {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR},
+ #else
+ {"SIGNFINAL_ERROR", 46, 139},
+ #endif
+ #ifdef CMS_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 46, 140},
+ #endif
+ #ifdef CMS_R_STORE_INIT_ERROR
+ {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR},
+ #else
+ {"STORE_INIT_ERROR", 46, 141},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA
+ {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"TYPE_NOT_COMPRESSED_DATA", 46, 142},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DATA
+ {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA},
+ #else
+ {"TYPE_NOT_DATA", 46, 143},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA
+ {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA},
+ #else
+ {"TYPE_NOT_DIGESTED_DATA", 46, 144},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA
+ {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA},
+ #else
+ {"TYPE_NOT_ENCRYPTED_DATA", 46, 145},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA
+ {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"TYPE_NOT_ENVELOPED_DATA", 46, 146},
+ #endif
+ #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT
+ {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT},
+ #else
+ {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147},
+ #endif
+ #ifdef CMS_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 46, 148},
+ #endif
+ #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 46, 149},
+ #endif
+ #ifdef CMS_R_UNKNOWN_ID
+ {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID},
+ #else
+ {"UNKNOWN_ID", 46, 150},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM", 46, 194},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 46, 152},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM
+ {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEK_ALGORITHM", 46, 153},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE
+ {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 46, 156},
+ #endif
+ #ifdef CMS_R_UNWRAP_ERROR
+ {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR},
+ #else
+ {"UNWRAP_ERROR", 46, 157},
+ #endif
+ #ifdef CMS_R_UNWRAP_FAILURE
+ {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE},
+ #else
+ {"UNWRAP_FAILURE", 46, 180},
+ #endif
+ #ifdef CMS_R_VERIFICATION_FAILURE
+ {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE},
+ #else
+ {"VERIFICATION_FAILURE", 46, 158},
+ #endif
+ #ifdef CMS_R_WRAP_ERROR
+ {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR},
+ #else
+ {"WRAP_ERROR", 46, 159},
+ #endif
+ #ifdef COMP_R_ZLIB_DEFLATE_ERROR
+ {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR},
+ #else
+ {"ZLIB_DEFLATE_ERROR", 41, 99},
+ #endif
+ #ifdef COMP_R_ZLIB_INFLATE_ERROR
+ {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR},
+ #else
+ {"ZLIB_INFLATE_ERROR", 41, 100},
+ #endif
+ #ifdef COMP_R_ZLIB_NOT_SUPPORTED
+ {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED},
+ #else
+ {"ZLIB_NOT_SUPPORTED", 41, 101},
+ #endif
+ #ifdef CONF_R_ERROR_LOADING_DSO
+ {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO},
+ #else
+ {"ERROR_LOADING_DSO", 14, 110},
+ #endif
+ #ifdef CONF_R_LIST_CANNOT_BE_NULL
+ {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL},
+ #else
+ {"LIST_CANNOT_BE_NULL", 14, 115},
+ #endif
+ #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET
+ {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET},
+ #else
+ {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100},
+ #endif
+ #ifdef CONF_R_MISSING_EQUAL_SIGN
+ {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN},
+ #else
+ {"MISSING_EQUAL_SIGN", 14, 101},
+ #endif
+ #ifdef CONF_R_MISSING_INIT_FUNCTION
+ {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION},
+ #else
+ {"MISSING_INIT_FUNCTION", 14, 112},
+ #endif
+ #ifdef CONF_R_MODULE_INITIALIZATION_ERROR
+ {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR},
+ #else
+ {"MODULE_INITIALIZATION_ERROR", 14, 109},
+ #endif
+ #ifdef CONF_R_NO_CLOSE_BRACE
+ {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE},
+ #else
+ {"NO_CLOSE_BRACE", 14, 102},
+ #endif
+ #ifdef CONF_R_NO_CONF
+ {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF},
+ #else
+ {"NO_CONF", 14, 105},
+ #endif
+ #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE},
+ #else
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106},
+ #endif
+ #ifdef CONF_R_NO_SECTION
+ {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION},
+ #else
+ {"NO_SECTION", 14, 107},
+ #endif
+ #ifdef CONF_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 14, 114},
+ #endif
+ #ifdef CONF_R_NO_VALUE
+ {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE},
+ #else
+ {"NO_VALUE", 14, 108},
+ #endif
+ #ifdef CONF_R_NUMBER_TOO_LARGE
+ {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE},
+ #else
+ {"NUMBER_TOO_LARGE", 14, 121},
+ #endif
+ #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE
+ {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE},
+ #else
+ {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 14, 117},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 14, 119},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 14, 120},
+ #endif
+ #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION
+ {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION},
+ #else
+ {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103},
+ #endif
+ #ifdef CONF_R_UNKNOWN_MODULE_NAME
+ {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME},
+ #else
+ {"UNKNOWN_MODULE_NAME", 14, 113},
+ #endif
+ #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG
+ {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG},
+ #else
+ {"VARIABLE_EXPANSION_TOO_LONG", 14, 116},
+ #endif
+ #ifdef CONF_R_VARIABLE_HAS_NO_VALUE
+ {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE},
+ #else
+ {"VARIABLE_HAS_NO_VALUE", 14, 104},
+ #endif
+ #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED
+ {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED},
+ #else
+ {"FIPS_MODE_NOT_SUPPORTED", 15, 101},
+ #endif
+ #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT
+ {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT},
+ #else
+ {"ILLEGAL_HEX_DIGIT", 15, 102},
+ #endif
+ #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS
+ {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS},
+ #else
+ {"ODD_NUMBER_OF_DIGITS", 15, 103},
+ #endif
+ #ifdef CT_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 50, 108},
+ #endif
+ #ifdef CT_R_INVALID_LOG_ID_LENGTH
+ {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH},
+ #else
+ {"INVALID_LOG_ID_LENGTH", 50, 100},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID
+ {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID},
+ #else
+ {"LOG_CONF_INVALID", 50, 109},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID_KEY
+ {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY},
+ #else
+ {"LOG_CONF_INVALID_KEY", 50, 110},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION
+ {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION},
+ #else
+ {"LOG_CONF_MISSING_DESCRIPTION", 50, 111},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_KEY
+ {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY},
+ #else
+ {"LOG_CONF_MISSING_KEY", 50, 112},
+ #endif
+ #ifdef CT_R_LOG_KEY_INVALID
+ {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID},
+ #else
+ {"LOG_KEY_INVALID", 50, 113},
+ #endif
+ #ifdef CT_R_SCT_FUTURE_TIMESTAMP
+ {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP},
+ #else
+ {"SCT_FUTURE_TIMESTAMP", 50, 116},
+ #endif
+ #ifdef CT_R_SCT_INVALID
+ {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID},
+ #else
+ {"SCT_INVALID", 50, 104},
+ #endif
+ #ifdef CT_R_SCT_INVALID_SIGNATURE
+ {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE},
+ #else
+ {"SCT_INVALID_SIGNATURE", 50, 107},
+ #endif
+ #ifdef CT_R_SCT_LIST_INVALID
+ {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID},
+ #else
+ {"SCT_LIST_INVALID", 50, 105},
+ #endif
+ #ifdef CT_R_SCT_LOG_ID_MISMATCH
+ {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH},
+ #else
+ {"SCT_LOG_ID_MISMATCH", 50, 114},
+ #endif
+ #ifdef CT_R_SCT_NOT_SET
+ {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET},
+ #else
+ {"SCT_NOT_SET", 50, 106},
+ #endif
+ #ifdef CT_R_SCT_UNSUPPORTED_VERSION
+ {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION},
+ #else
+ {"SCT_UNSUPPORTED_VERSION", 50, 115},
+ #endif
+ #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID
+ {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID},
+ #else
+ {"UNRECOGNIZED_SIGNATURE_NID", 50, 101},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE
+ {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE},
+ #else
+ {"UNSUPPORTED_ENTRY_TYPE", 50, 102},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 50, 103},
+ #endif
+ #ifdef DH_R_BAD_GENERATOR
+ {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR},
+ #else
+ {"BAD_GENERATOR", 5, 101},
+ #endif
+ #ifdef DH_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 5, 109},
+ #endif
+ #ifdef DH_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 5, 106},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_J_VALUE
+ {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE},
+ #else
+ {"CHECK_INVALID_J_VALUE", 5, 115},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_Q_VALUE
+ {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE},
+ #else
+ {"CHECK_INVALID_Q_VALUE", 5, 116},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_INVALID
+ {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID},
+ #else
+ {"CHECK_PUBKEY_INVALID", 5, 122},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE
+ {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE},
+ #else
+ {"CHECK_PUBKEY_TOO_LARGE", 5, 123},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL
+ {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL},
+ #else
+ {"CHECK_PUBKEY_TOO_SMALL", 5, 124},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_PRIME
+ {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME},
+ #else
+ {"CHECK_P_NOT_PRIME", 5, 117},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME
+ {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME},
+ #else
+ {"CHECK_P_NOT_SAFE_PRIME", 5, 118},
+ #endif
+ #ifdef DH_R_CHECK_Q_NOT_PRIME
+ {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME},
+ #else
+ {"CHECK_Q_NOT_PRIME", 5, 119},
+ #endif
+ #ifdef DH_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 5, 104},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NAME
+ {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME},
+ #else
+ {"INVALID_PARAMETER_NAME", 5, 110},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NID
+ {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID},
+ #else
+ {"INVALID_PARAMETER_NID", 5, 114},
+ #endif
+ #ifdef DH_R_INVALID_PUBKEY
+ {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY},
+ #else
+ {"INVALID_PUBKEY", 5, 102},
+ #endif
+ #ifdef DH_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 5, 112},
+ #endif
+ #ifdef DH_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 5, 108},
+ #endif
+ #ifdef DH_R_MISSING_PUBKEY
+ {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY},
+ #else
+ {"MISSING_PUBKEY", 5, 125},
+ #endif
+ #ifdef DH_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 5, 103},
+ #endif
+ #ifdef DH_R_NOT_SUITABLE_GENERATOR
+ {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR},
+ #else
+ {"NOT_SUITABLE_GENERATOR", 5, 120},
+ #endif
+ #ifdef DH_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 5, 107},
+ #endif
+ #ifdef DH_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 5, 100},
+ #endif
+ #ifdef DH_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 5, 105},
+ #endif
+ #ifdef DH_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 5, 111},
+ #endif
+ #ifdef DH_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 5, 113},
+ #endif
+ #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR
+ {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR},
+ #else
+ {"UNABLE_TO_CHECK_GENERATOR", 5, 121},
+ #endif
+ #ifdef DSA_R_BAD_Q_VALUE
+ {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE},
+ #else
+ {"BAD_Q_VALUE", 10, 102},
+ #endif
+ #ifdef DSA_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 10, 108},
+ #endif
+ #ifdef DSA_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 10, 109},
+ #endif
+ #ifdef DSA_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 10, 104},
+ #endif
+ #ifdef DSA_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 10, 106},
+ #endif
+ #ifdef DSA_R_INVALID_PARAMETERS
+ {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS},
+ #else
+ {"INVALID_PARAMETERS", 10, 112},
+ #endif
+ #ifdef DSA_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 10, 101},
+ #endif
+ #ifdef DSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 10, 111},
+ #endif
+ #ifdef DSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 10, 103},
+ #endif
+ #ifdef DSA_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 10, 107},
+ #endif
+ #ifdef DSA_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 10, 105},
+ #endif
+ #ifdef DSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 10, 113},
+ #endif
+ #ifdef DSA_R_SEED_LEN_SMALL
+ {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL},
+ #else
+ {"SEED_LEN_SMALL", 10, 110},
+ #endif
+ #ifdef DSO_R_CTRL_FAILED
+ {"CTRL_FAILED", ERR_LIB_DSO, DSO_R_CTRL_FAILED},
+ #else
+ {"CTRL_FAILED", 37, 100},
+ #endif
+ #ifdef DSO_R_DSO_ALREADY_LOADED
+ {"DSO_ALREADY_LOADED", ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED},
+ #else
+ {"DSO_ALREADY_LOADED", 37, 110},
+ #endif
+ #ifdef DSO_R_EMPTY_FILE_STRUCTURE
+ {"EMPTY_FILE_STRUCTURE", ERR_LIB_DSO, DSO_R_EMPTY_FILE_STRUCTURE},
+ #else
+ {"EMPTY_FILE_STRUCTURE", 37, 113},
+ #endif
+ #ifdef DSO_R_FAILURE
+ {"FAILURE", ERR_LIB_DSO, DSO_R_FAILURE},
+ #else
+ {"FAILURE", 37, 114},
+ #endif
+ #ifdef DSO_R_FILENAME_TOO_BIG
+ {"FILENAME_TOO_BIG", ERR_LIB_DSO, DSO_R_FILENAME_TOO_BIG},
+ #else
+ {"FILENAME_TOO_BIG", 37, 101},
+ #endif
+ #ifdef DSO_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_DSO, DSO_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 37, 102},
+ #endif
+ #ifdef DSO_R_INCORRECT_FILE_SYNTAX
+ {"INCORRECT_FILE_SYNTAX", ERR_LIB_DSO, DSO_R_INCORRECT_FILE_SYNTAX},
+ #else
+ {"INCORRECT_FILE_SYNTAX", 37, 115},
+ #endif
+ #ifdef DSO_R_LOAD_FAILED
+ {"LOAD_FAILED", ERR_LIB_DSO, DSO_R_LOAD_FAILED},
+ #else
+ {"LOAD_FAILED", 37, 103},
+ #endif
+ #ifdef DSO_R_NAME_TRANSLATION_FAILED
+ {"NAME_TRANSLATION_FAILED", ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED},
+ #else
+ {"NAME_TRANSLATION_FAILED", 37, 109},
+ #endif
+ #ifdef DSO_R_NO_FILENAME
+ {"NO_FILENAME", ERR_LIB_DSO, DSO_R_NO_FILENAME},
+ #else
+ {"NO_FILENAME", 37, 111},
+ #endif
+ #ifdef DSO_R_NULL_HANDLE
+ {"NULL_HANDLE", ERR_LIB_DSO, DSO_R_NULL_HANDLE},
+ #else
+ {"NULL_HANDLE", 37, 104},
+ #endif
+ #ifdef DSO_R_SET_FILENAME_FAILED
+ {"SET_FILENAME_FAILED", ERR_LIB_DSO, DSO_R_SET_FILENAME_FAILED},
+ #else
+ {"SET_FILENAME_FAILED", 37, 112},
+ #endif
+ #ifdef DSO_R_STACK_ERROR
+ {"STACK_ERROR", ERR_LIB_DSO, DSO_R_STACK_ERROR},
+ #else
+ {"STACK_ERROR", 37, 105},
+ #endif
+ #ifdef DSO_R_SYM_FAILURE
+ {"SYM_FAILURE", ERR_LIB_DSO, DSO_R_SYM_FAILURE},
+ #else
+ {"SYM_FAILURE", 37, 106},
+ #endif
+ #ifdef DSO_R_UNLOAD_FAILED
+ {"UNLOAD_FAILED", ERR_LIB_DSO, DSO_R_UNLOAD_FAILED},
+ #else
+ {"UNLOAD_FAILED", 37, 107},
+ #endif
+ #ifdef DSO_R_UNSUPPORTED
+ {"UNSUPPORTED", ERR_LIB_DSO, DSO_R_UNSUPPORTED},
+ #else
+ {"UNSUPPORTED", 37, 108},
+ #endif
+ #ifdef EC_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 16, 115},
+ #endif
+ #ifdef EC_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 16, 156},
+ #endif
+ #ifdef EC_R_BIGNUM_OUT_OF_RANGE
+ {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE},
+ #else
+ {"BIGNUM_OUT_OF_RANGE", 16, 144},
+ #endif
+ #ifdef EC_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 16, 100},
+ #endif
+ #ifdef EC_R_CANNOT_INVERT
+ {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT},
+ #else
+ {"CANNOT_INVERT", 16, 165},
+ #endif
+ #ifdef EC_R_COORDINATES_OUT_OF_RANGE
+ {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE},
+ #else
+ {"COORDINATES_OUT_OF_RANGE", 16, 146},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159},
+ #endif
+ #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE
+ {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE},
+ #else
+ {"D2I_ECPKPARAMETERS_FAILURE", 16, 117},
+ #endif
+ #ifdef EC_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 16, 142},
+ #endif
+ #ifdef EC_R_DISCRIMINANT_IS_ZERO
+ {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO},
+ #else
+ {"DISCRIMINANT_IS_ZERO", 16, 118},
+ #endif
+ #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE},
+ #else
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119},
+ #endif
+ #ifdef EC_R_FIELD_TOO_LARGE
+ {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE},
+ #else
+ {"FIELD_TOO_LARGE", 16, 143},
+ #endif
+ #ifdef EC_R_GF2M_NOT_SUPPORTED
+ {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED},
+ #else
+ {"GF2M_NOT_SUPPORTED", 16, 147},
+ #endif
+ #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE
+ {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE},
+ #else
+ {"GROUP2PKPARAMETERS_FAILURE", 16, 120},
+ #endif
+ #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE
+ {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE},
+ #else
+ {"I2D_ECPKPARAMETERS_FAILURE", 16, 121},
+ #endif
+ #ifdef EC_R_INCOMPATIBLE_OBJECTS
+ {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS},
+ #else
+ {"INCOMPATIBLE_OBJECTS", 16, 101},
+ #endif
+ #ifdef EC_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 16, 112},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSED_POINT
+ {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT},
+ #else
+ {"INVALID_COMPRESSED_POINT", 16, 110},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSION_BIT
+ {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT},
+ #else
+ {"INVALID_COMPRESSION_BIT", 16, 109},
+ #endif
+ #ifdef EC_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 16, 141},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 16, 151},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 16, 138},
+ #endif
+ #ifdef EC_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 16, 102},
+ #endif
+ #ifdef EC_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 16, 103},
+ #endif
+ #ifdef EC_R_INVALID_FORM
+ {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM},
+ #else
+ {"INVALID_FORM", 16, 104},
+ #endif
+ #ifdef EC_R_INVALID_GROUP_ORDER
+ {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER},
+ #else
+ {"INVALID_GROUP_ORDER", 16, 122},
+ #endif
+ #ifdef EC_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 16, 116},
+ #endif
+ #ifdef EC_R_INVALID_OUTPUT_LENGTH
+ {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH},
+ #else
+ {"INVALID_OUTPUT_LENGTH", 16, 161},
+ #endif
+ #ifdef EC_R_INVALID_PEER_KEY
+ {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY},
+ #else
+ {"INVALID_PEER_KEY", 16, 133},
+ #endif
+ #ifdef EC_R_INVALID_PENTANOMIAL_BASIS
+ {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS},
+ #else
+ {"INVALID_PENTANOMIAL_BASIS", 16, 132},
+ #endif
+ #ifdef EC_R_INVALID_PRIVATE_KEY
+ {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY},
+ #else
+ {"INVALID_PRIVATE_KEY", 16, 123},
+ #endif
+ #ifdef EC_R_INVALID_TRINOMIAL_BASIS
+ {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS},
+ #else
+ {"INVALID_TRINOMIAL_BASIS", 16, 137},
+ #endif
+ #ifdef EC_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 16, 148},
+ #endif
+ #ifdef EC_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 16, 140},
+ #endif
+ #ifdef EC_R_LADDER_POST_FAILURE
+ {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE},
+ #else
+ {"LADDER_POST_FAILURE", 16, 136},
+ #endif
+ #ifdef EC_R_LADDER_PRE_FAILURE
+ {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE},
+ #else
+ {"LADDER_PRE_FAILURE", 16, 153},
+ #endif
+ #ifdef EC_R_LADDER_STEP_FAILURE
+ {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE},
+ #else
+ {"LADDER_STEP_FAILURE", 16, 162},
+ #endif
+ #ifdef EC_R_MISSING_OID
+ {"MISSING_OID", ERR_LIB_EC, EC_R_MISSING_OID},
+ #else
+ {"MISSING_OID", 16, 167},
+ #endif
+ #ifdef EC_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 16, 124},
+ #endif
+ #ifdef EC_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 16, 125},
+ #endif
+ #ifdef EC_R_NEED_NEW_SETUP_VALUES
+ {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES},
+ #else
+ {"NEED_NEW_SETUP_VALUES", 16, 157},
+ #endif
+ #ifdef EC_R_NOT_A_NIST_PRIME
+ {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME},
+ #else
+ {"NOT_A_NIST_PRIME", 16, 135},
+ #endif
+ #ifdef EC_R_NOT_IMPLEMENTED
+ {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED},
+ #else
+ {"NOT_IMPLEMENTED", 16, 126},
+ #endif
+ #ifdef EC_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 16, 111},
+ #endif
+ #ifdef EC_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 16, 139},
+ #endif
+ #ifdef EC_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 16, 154},
+ #endif
+ #ifdef EC_R_OPERATION_NOT_SUPPORTED
+ {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED},
+ #else
+ {"OPERATION_NOT_SUPPORTED", 16, 152},
+ #endif
+ #ifdef EC_R_PASSED_NULL_PARAMETER
+ {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER},
+ #else
+ {"PASSED_NULL_PARAMETER", 16, 134},
+ #endif
+ #ifdef EC_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 16, 149},
+ #endif
+ #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE
+ {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE},
+ #else
+ {"PKPARAMETERS2GROUP_FAILURE", 16, 127},
+ #endif
+ #ifdef EC_R_POINT_ARITHMETIC_FAILURE
+ {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE},
+ #else
+ {"POINT_ARITHMETIC_FAILURE", 16, 155},
+ #endif
+ #ifdef EC_R_POINT_AT_INFINITY
+ {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY},
+ #else
+ {"POINT_AT_INFINITY", 16, 106},
+ #endif
+ #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE
+ {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE},
+ #else
+ {"POINT_COORDINATES_BLIND_FAILURE", 16, 163},
+ #endif
+ #ifdef EC_R_POINT_IS_NOT_ON_CURVE
+ {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE},
+ #else
+ {"POINT_IS_NOT_ON_CURVE", 16, 107},
+ #endif
+ #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED
+ {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED},
+ #else
+ {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158},
+ #endif
+ #ifdef EC_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 16, 150},
+ #endif
+ #ifdef EC_R_SLOT_FULL
+ {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL},
+ #else
+ {"SLOT_FULL", 16, 108},
+ #endif
+ #ifdef EC_R_UNDEFINED_GENERATOR
+ {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR},
+ #else
+ {"UNDEFINED_GENERATOR", 16, 113},
+ #endif
+ #ifdef EC_R_UNDEFINED_ORDER
+ {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER},
+ #else
+ {"UNDEFINED_ORDER", 16, 128},
+ #endif
+ #ifdef EC_R_UNKNOWN_COFACTOR
+ {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR},
+ #else
+ {"UNKNOWN_COFACTOR", 16, 164},
+ #endif
+ #ifdef EC_R_UNKNOWN_GROUP
+ {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP},
+ #else
+ {"UNKNOWN_GROUP", 16, 129},
+ #endif
+ #ifdef EC_R_UNKNOWN_ORDER
+ {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER},
+ #else
+ {"UNKNOWN_ORDER", 16, 114},
+ #endif
+ #ifdef EC_R_UNSUPPORTED_FIELD
+ {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD},
+ #else
+ {"UNSUPPORTED_FIELD", 16, 131},
+ #endif
+ #ifdef EC_R_WRONG_CURVE_PARAMETERS
+ {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS},
+ #else
+ {"WRONG_CURVE_PARAMETERS", 16, 145},
+ #endif
+ #ifdef EC_R_WRONG_ORDER
+ {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER},
+ #else
+ {"WRONG_ORDER", 16, 130},
+ #endif
+ #ifdef ENGINE_R_ALREADY_LOADED
+ {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED},
+ #else
+ {"ALREADY_LOADED", 38, 100},
+ #endif
+ #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER
+ {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER},
+ #else
+ {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133},
+ #endif
+ #ifdef ENGINE_R_CMD_NOT_EXECUTABLE
+ {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE},
+ #else
+ {"CMD_NOT_EXECUTABLE", 38, 134},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_INPUT
+ {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT},
+ #else
+ {"COMMAND_TAKES_INPUT", 38, 135},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT
+ {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT},
+ #else
+ {"COMMAND_TAKES_NO_INPUT", 38, 136},
+ #endif
+ #ifdef ENGINE_R_CONFLICTING_ENGINE_ID
+ {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID},
+ #else
+ {"CONFLICTING_ENGINE_ID", 38, 103},
+ #endif
+ #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119},
+ #endif
+ #ifdef ENGINE_R_DSO_FAILURE
+ {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE},
+ #else
+ {"DSO_FAILURE", 38, 104},
+ #endif
+ #ifdef ENGINE_R_DSO_NOT_FOUND
+ {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND},
+ #else
+ {"DSO_NOT_FOUND", 38, 132},
+ #endif
+ #ifdef ENGINE_R_ENGINES_SECTION_ERROR
+ {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR},
+ #else
+ {"ENGINES_SECTION_ERROR", 38, 148},
+ #endif
+ #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR
+ {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR},
+ #else
+ {"ENGINE_CONFIGURATION_ERROR", 38, 102},
+ #endif
+ #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST
+ {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST},
+ #else
+ {"ENGINE_IS_NOT_IN_LIST", 38, 105},
+ #endif
+ #ifdef ENGINE_R_ENGINE_SECTION_ERROR
+ {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR},
+ #else
+ {"ENGINE_SECTION_ERROR", 38, 149},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY
+ {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY},
+ #else
+ {"FAILED_LOADING_PRIVATE_KEY", 38, 128},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY
+ {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY},
+ #else
+ {"FAILED_LOADING_PUBLIC_KEY", 38, 129},
+ #endif
+ #ifdef ENGINE_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 38, 106},
+ #endif
+ #ifdef ENGINE_R_ID_OR_NAME_MISSING
+ {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING},
+ #else
+ {"ID_OR_NAME_MISSING", 38, 108},
+ #endif
+ #ifdef ENGINE_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 38, 109},
+ #endif
+ #ifdef ENGINE_R_INTERNAL_LIST_ERROR
+ {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR},
+ #else
+ {"INTERNAL_LIST_ERROR", 38, 110},
+ #endif
+ #ifdef ENGINE_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 38, 143},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NAME
+ {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME},
+ #else
+ {"INVALID_CMD_NAME", 38, 137},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NUMBER
+ {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER},
+ #else
+ {"INVALID_CMD_NUMBER", 38, 138},
+ #endif
+ #ifdef ENGINE_R_INVALID_INIT_VALUE
+ {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE},
+ #else
+ {"INVALID_INIT_VALUE", 38, 151},
+ #endif
+ #ifdef ENGINE_R_INVALID_STRING
+ {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING},
+ #else
+ {"INVALID_STRING", 38, 150},
+ #endif
+ #ifdef ENGINE_R_NOT_INITIALISED
+ {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED},
+ #else
+ {"NOT_INITIALISED", 38, 117},
+ #endif
+ #ifdef ENGINE_R_NOT_LOADED
+ {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED},
+ #else
+ {"NOT_LOADED", 38, 112},
+ #endif
+ #ifdef ENGINE_R_NO_CONTROL_FUNCTION
+ {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION},
+ #else
+ {"NO_CONTROL_FUNCTION", 38, 120},
+ #endif
+ #ifdef ENGINE_R_NO_INDEX
+ {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX},
+ #else
+ {"NO_INDEX", 38, 144},
+ #endif
+ #ifdef ENGINE_R_NO_LOAD_FUNCTION
+ {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION},
+ #else
+ {"NO_LOAD_FUNCTION", 38, 125},
+ #endif
+ #ifdef ENGINE_R_NO_REFERENCE
+ {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE},
+ #else
+ {"NO_REFERENCE", 38, 130},
+ #endif
+ #ifdef ENGINE_R_NO_SUCH_ENGINE
+ {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE},
+ #else
+ {"NO_SUCH_ENGINE", 38, 116},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER
+ {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER},
+ #else
+ {"UNIMPLEMENTED_CIPHER", 38, 146},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST
+ {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST},
+ #else
+ {"UNIMPLEMENTED_DIGEST", 38, 147},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD},
+ #else
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101},
+ #endif
+ #ifdef ENGINE_R_VERSION_INCOMPATIBILITY
+ {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY},
+ #else
+ {"VERSION_INCOMPATIBILITY", 38, 145},
+ #endif
+ #ifdef EVP_R_AES_KEY_SETUP_FAILED
+ {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED},
+ #else
+ {"AES_KEY_SETUP_FAILED", 6, 143},
+ #endif
+ #ifdef EVP_R_ARIA_KEY_SETUP_FAILED
+ {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED},
+ #else
+ {"ARIA_KEY_SETUP_FAILED", 6, 176},
+ #endif
+ #ifdef EVP_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 6, 100},
+ #endif
+ #ifdef EVP_R_BAD_KEY_LENGTH
+ {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH},
+ #else
+ {"BAD_KEY_LENGTH", 6, 195},
+ #endif
+ #ifdef EVP_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 6, 155},
+ #endif
+ #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED
+ {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED},
+ #else
+ {"CAMELLIA_KEY_SETUP_FAILED", 6, 157},
+ #endif
+ #ifdef EVP_R_CIPHER_PARAMETER_ERROR
+ {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR},
+ #else
+ {"CIPHER_PARAMETER_ERROR", 6, 122},
+ #endif
+ #ifdef EVP_R_COMMAND_NOT_SUPPORTED
+ {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED},
+ #else
+ {"COMMAND_NOT_SUPPORTED", 6, 147},
+ #endif
+ #ifdef EVP_R_COPY_ERROR
+ {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR},
+ #else
+ {"COPY_ERROR", 6, 173},
+ #endif
+ #ifdef EVP_R_CTRL_NOT_IMPLEMENTED
+ {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_NOT_IMPLEMENTED", 6, 132},
+ #endif
+ #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133},
+ #endif
+ #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH},
+ #else
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138},
+ #endif
+ #ifdef EVP_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 6, 114},
+ #endif
+ #ifdef EVP_R_DIFFERENT_KEY_TYPES
+ {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES},
+ #else
+ {"DIFFERENT_KEY_TYPES", 6, 101},
+ #endif
+ #ifdef EVP_R_DIFFERENT_PARAMETERS
+ {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS},
+ #else
+ {"DIFFERENT_PARAMETERS", 6, 153},
+ #endif
+ #ifdef EVP_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 6, 165},
+ #endif
+ #ifdef EVP_R_ERROR_SETTING_FIPS_MODE
+ {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE},
+ #else
+ {"ERROR_SETTING_FIPS_MODE", 6, 166},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_HMAC_KEY
+ {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY},
+ #else
+ {"EXPECTING_AN_HMAC_KEY", 6, 174},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_RSA_KEY
+ {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY},
+ #else
+ {"EXPECTING_AN_RSA_KEY", 6, 127},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DH_KEY
+ {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY},
+ #else
+ {"EXPECTING_A_DH_KEY", 6, 128},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DSA_KEY
+ {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY},
+ #else
+ {"EXPECTING_A_DSA_KEY", 6, 129},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_EC_KEY
+ {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY},
+ #else
+ {"EXPECTING_A_EC_KEY", 6, 142},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_POLY1305_KEY
+ {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY},
+ #else
+ {"EXPECTING_A_POLY1305_KEY", 6, 164},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY
+ {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY},
+ #else
+ {"EXPECTING_A_SIPHASH_KEY", 6, 175},
+ #endif
+ #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED
+ {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED},
+ #else
+ {"FIPS_MODE_NOT_SUPPORTED", 6, 167},
+ #endif
+ #ifdef EVP_R_GET_RAW_KEY_FAILED
+ {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED},
+ #else
+ {"GET_RAW_KEY_FAILED", 6, 182},
+ #endif
+ #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS
+ {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS},
+ #else
+ {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171},
+ #endif
+ #ifdef EVP_R_INITIALIZATION_ERROR
+ {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR},
+ #else
+ {"INITIALIZATION_ERROR", 6, 134},
+ #endif
+ #ifdef EVP_R_INPUT_NOT_INITIALIZED
+ {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED},
+ #else
+ {"INPUT_NOT_INITIALIZED", 6, 111},
+ #endif
+ #ifdef EVP_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 6, 152},
+ #endif
+ #ifdef EVP_R_INVALID_FIPS_MODE
+ {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE},
+ #else
+ {"INVALID_FIPS_MODE", 6, 168},
+ #endif
+ #ifdef EVP_R_INVALID_IV_LENGTH
+ {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH},
+ #else
+ {"INVALID_IV_LENGTH", 6, 194},
+ #endif
+ #ifdef EVP_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 6, 163},
+ #endif
+ #ifdef EVP_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 6, 130},
+ #endif
+ #ifdef EVP_R_INVALID_OPERATION
+ {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION},
+ #else
+ {"INVALID_OPERATION", 6, 148},
+ #endif
+ #ifdef EVP_R_KEYGEN_FAILURE
+ {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE},
+ #else
+ {"KEYGEN_FAILURE", 6, 120},
+ #endif
+ #ifdef EVP_R_KEY_SETUP_FAILED
+ {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED},
+ #else
+ {"KEY_SETUP_FAILED", 6, 180},
+ #endif
+ #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED
+ {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED},
+ #else
+ {"MEMORY_LIMIT_EXCEEDED", 6, 172},
+ #endif
+ #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL
+ {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL},
+ #else
+ {"MESSAGE_DIGEST_IS_NULL", 6, 159},
+ #endif
+ #ifdef EVP_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 6, 144},
+ #endif
+ #ifdef EVP_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 6, 103},
+ #endif
+ #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH
+ {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH},
+ #else
+ {"NOT_XOF_OR_INVALID_LENGTH", 6, 178},
+ #endif
+ #ifdef EVP_R_NO_CIPHER_SET
+ {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET},
+ #else
+ {"NO_CIPHER_SET", 6, 131},
+ #endif
+ #ifdef EVP_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 6, 158},
+ #endif
+ #ifdef EVP_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 6, 139},
+ #endif
+ #ifdef EVP_R_NO_KEY_SET
+ {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET},
+ #else
+ {"NO_KEY_SET", 6, 154},
+ #endif
+ #ifdef EVP_R_NO_OPERATION_SET
+ {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET},
+ #else
+ {"NO_OPERATION_SET", 6, 149},
+ #endif
+ #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED
+ {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED},
+ #else
+ {"ONLY_ONESHOT_SUPPORTED", 6, 177},
+ #endif
+ #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150},
+ #endif
+ #ifdef EVP_R_OPERATON_NOT_INITIALIZED
+ {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED},
+ #else
+ {"OPERATON_NOT_INITIALIZED", 6, 151},
+ #endif
+ #ifdef EVP_R_OUTPUT_WOULD_OVERFLOW
+ {"OUTPUT_WOULD_OVERFLOW", ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW},
+ #else
+ {"OUTPUT_WOULD_OVERFLOW", 6, 184},
+ #endif
+ #ifdef EVP_R_PARTIALLY_OVERLAPPING
+ {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING},
+ #else
+ {"PARTIALLY_OVERLAPPING", 6, 162},
+ #endif
+ #ifdef EVP_R_PBKDF2_ERROR
+ {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR},
+ #else
+ {"PBKDF2_ERROR", 6, 181},
+ #endif
+ #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED},
+ #else
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR
+ {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR},
+ #else
+ {"PRIVATE_KEY_DECODE_ERROR", 6, 145},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR
+ {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR},
+ #else
+ {"PRIVATE_KEY_ENCODE_ERROR", 6, 146},
+ #endif
+ #ifdef EVP_R_PUBLIC_KEY_NOT_RSA
+ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA},
+ #else
+ {"PUBLIC_KEY_NOT_RSA", 6, 106},
+ #endif
+ #ifdef EVP_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 6, 160},
+ #endif
+ #ifdef EVP_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 6, 161},
+ #endif
+ #ifdef EVP_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 6, 169},
+ #endif
+ #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM
+ {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM},
+ #else
+ {"UNKNOWN_PBE_ALGORITHM", 6, 121},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 6, 156},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 6, 107},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEYLENGTH
+ {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH},
+ #else
+ {"UNSUPPORTED_KEYLENGTH", 6, 123},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION},
+ #else
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_SIZE
+ {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE},
+ #else
+ {"UNSUPPORTED_KEY_SIZE", 6, 108},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+ #else
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRF
+ {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF},
+ #else
+ {"UNSUPPORTED_PRF", 6, 125},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM},
+ #else
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_SALT_TYPE
+ {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE},
+ #else
+ {"UNSUPPORTED_SALT_TYPE", 6, 126},
+ #endif
+ #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED
+ {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED},
+ #else
+ {"WRAP_MODE_NOT_ALLOWED", 6, 170},
+ #endif
+ #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH
+ {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH},
+ #else
+ {"WRONG_FINAL_BLOCK_LENGTH", 6, 109},
+ #endif
+ #ifdef EVP_R_XTS_DUPLICATED_KEYS
+ {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS},
+ #else
+ {"XTS_DUPLICATED_KEYS", 6, 183},
+ #endif
+ #ifdef KDF_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 52, 100},
+ #endif
+ #ifdef KDF_R_MISSING_ITERATION_COUNT
+ {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT},
+ #else
+ {"MISSING_ITERATION_COUNT", 52, 109},
+ #endif
+ #ifdef KDF_R_MISSING_KEY
+ {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY},
+ #else
+ {"MISSING_KEY", 52, 104},
+ #endif
+ #ifdef KDF_R_MISSING_MESSAGE_DIGEST
+ {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST},
+ #else
+ {"MISSING_MESSAGE_DIGEST", 52, 105},
+ #endif
+ #ifdef KDF_R_MISSING_PARAMETER
+ {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER},
+ #else
+ {"MISSING_PARAMETER", 52, 101},
+ #endif
+ #ifdef KDF_R_MISSING_PASS
+ {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS},
+ #else
+ {"MISSING_PASS", 52, 110},
+ #endif
+ #ifdef KDF_R_MISSING_SALT
+ {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT},
+ #else
+ {"MISSING_SALT", 52, 111},
+ #endif
+ #ifdef KDF_R_MISSING_SECRET
+ {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET},
+ #else
+ {"MISSING_SECRET", 52, 107},
+ #endif
+ #ifdef KDF_R_MISSING_SEED
+ {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED},
+ #else
+ {"MISSING_SEED", 52, 106},
+ #endif
+ #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE
+ {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE},
+ #else
+ {"UNKNOWN_PARAMETER_TYPE", 52, 103},
+ #endif
+ #ifdef KDF_R_VALUE_ERROR
+ {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR},
+ #else
+ {"VALUE_ERROR", 52, 108},
+ #endif
+ #ifdef KDF_R_VALUE_MISSING
+ {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING},
+ #else
+ {"VALUE_MISSING", 52, 102},
+ #endif
+ #ifdef OBJ_R_OID_EXISTS
+ {"OID_EXISTS", ERR_LIB_OBJ, OBJ_R_OID_EXISTS},
+ #else
+ {"OID_EXISTS", 8, 102},
+ #endif
+ #ifdef OBJ_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 8, 101},
+ #endif
+ #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 39, 101},
+ #endif
+ #ifdef OCSP_R_DIGEST_ERR
+ {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR},
+ #else
+ {"DIGEST_ERR", 39, 102},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD
+ {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD},
+ #else
+ {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD
+ {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD},
+ #else
+ {"ERROR_IN_THISUPDATE_FIELD", 39, 123},
+ #endif
+ #ifdef OCSP_R_ERROR_PARSING_URL
+ {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL},
+ #else
+ {"ERROR_PARSING_URL", 39, 121},
+ #endif
+ #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE
+ {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE},
+ #else
+ {"MISSING_OCSPSIGNING_USAGE", 39, 103},
+ #endif
+ #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE
+ {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE},
+ #else
+ {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124},
+ #endif
+ #ifdef OCSP_R_NOT_BASIC_RESPONSE
+ {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE},
+ #else
+ {"NOT_BASIC_RESPONSE", 39, 104},
+ #endif
+ #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN
+ {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN},
+ #else
+ {"NO_CERTIFICATES_IN_CHAIN", 39, 105},
+ #endif
+ #ifdef OCSP_R_NO_RESPONSE_DATA
+ {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA},
+ #else
+ {"NO_RESPONSE_DATA", 39, 108},
+ #endif
+ #ifdef OCSP_R_NO_REVOKED_TIME
+ {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME},
+ #else
+ {"NO_REVOKED_TIME", 39, 109},
+ #endif
+ #ifdef OCSP_R_NO_SIGNER_KEY
+ {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY},
+ #else
+ {"NO_SIGNER_KEY", 39, 130},
+ #endif
+ #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110},
+ #endif
+ #ifdef OCSP_R_REQUEST_NOT_SIGNED
+ {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED},
+ #else
+ {"REQUEST_NOT_SIGNED", 39, 128},
+ #endif
+ #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA},
+ #else
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111},
+ #endif
+ #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED
+ {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED},
+ #else
+ {"ROOT_CA_NOT_TRUSTED", 39, 112},
+ #endif
+ #ifdef OCSP_R_SERVER_RESPONSE_ERROR
+ {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR},
+ #else
+ {"SERVER_RESPONSE_ERROR", 39, 114},
+ #endif
+ #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR
+ {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR},
+ #else
+ {"SERVER_RESPONSE_PARSE_ERROR", 39, 115},
+ #endif
+ #ifdef OCSP_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 39, 117},
+ #endif
+ #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118},
+ #endif
+ #ifdef OCSP_R_STATUS_EXPIRED
+ {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED},
+ #else
+ {"STATUS_EXPIRED", 39, 125},
+ #endif
+ #ifdef OCSP_R_STATUS_NOT_YET_VALID
+ {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID},
+ #else
+ {"STATUS_NOT_YET_VALID", 39, 126},
+ #endif
+ #ifdef OCSP_R_STATUS_TOO_OLD
+ {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD},
+ #else
+ {"STATUS_TOO_OLD", 39, 127},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST
+ {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST", 39, 119},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 39, 120},
+ #endif
+ #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE},
+ #else
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129},
+ #endif
+ #ifdef OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE
+ {"AMBIGUOUS_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE},
+ #else
+ {"AMBIGUOUS_CONTENT_TYPE", 44, 107},
+ #endif
+ #ifdef OSSL_STORE_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_OSSL_STORE, OSSL_STORE_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 44, 115},
+ #endif
+ #ifdef OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC
+ {"ERROR_VERIFYING_PKCS12_MAC", ERR_LIB_OSSL_STORE, OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC},
+ #else
+ {"ERROR_VERIFYING_PKCS12_MAC", 44, 113},
+ #endif
+ #ifdef OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST
+ {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", ERR_LIB_OSSL_STORE, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST},
+ #else
+ {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", 44, 121},
+ #endif
+ #ifdef OSSL_STORE_R_INVALID_SCHEME
+ {"INVALID_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_INVALID_SCHEME},
+ #else
+ {"INVALID_SCHEME", 44, 106},
+ #endif
+ #ifdef OSSL_STORE_R_IS_NOT_A
+ {"IS_NOT_A", ERR_LIB_OSSL_STORE, OSSL_STORE_R_IS_NOT_A},
+ #else
+ {"IS_NOT_A", 44, 112},
+ #endif
+ #ifdef OSSL_STORE_R_LOADER_INCOMPLETE
+ {"LOADER_INCOMPLETE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADER_INCOMPLETE},
+ #else
+ {"LOADER_INCOMPLETE", 44, 116},
+ #endif
+ #ifdef OSSL_STORE_R_LOADING_STARTED
+ {"LOADING_STARTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADING_STARTED},
+ #else
+ {"LOADING_STARTED", 44, 117},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_CERTIFICATE
+ {"NOT_A_CERTIFICATE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CERTIFICATE},
+ #else
+ {"NOT_A_CERTIFICATE", 44, 100},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_CRL
+ {"NOT_A_CRL", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CRL},
+ #else
+ {"NOT_A_CRL", 44, 101},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_KEY
+ {"NOT_A_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_KEY},
+ #else
+ {"NOT_A_KEY", 44, 102},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_NAME
+ {"NOT_A_NAME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_NAME},
+ #else
+ {"NOT_A_NAME", 44, 103},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_PARAMETERS
+ {"NOT_PARAMETERS", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_PARAMETERS},
+ #else
+ {"NOT_PARAMETERS", 44, 104},
+ #endif
+ #ifdef OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR
+ {"PASSPHRASE_CALLBACK_ERROR", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR},
+ #else
+ {"PASSPHRASE_CALLBACK_ERROR", 44, 114},
+ #endif
+ #ifdef OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE
+ {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE},
+ #else
+ {"PATH_MUST_BE_ABSOLUTE", 44, 108},
+ #endif
+ #ifdef OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_OSSL_STORE, OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES},
+ #else
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 44, 119},
+ #endif
+ #ifdef OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED
+ {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED},
+ #else
+ {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", 44, 109},
+ #endif
+ #ifdef OSSL_STORE_R_UNREGISTERED_SCHEME
+ {"UNREGISTERED_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNREGISTERED_SCHEME},
+ #else
+ {"UNREGISTERED_SCHEME", 44, 105},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 44, 110},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_OPERATION
+ {"UNSUPPORTED_OPERATION", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_OPERATION},
+ #else
+ {"UNSUPPORTED_OPERATION", 44, 118},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE
+ {"UNSUPPORTED_SEARCH_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE},
+ #else
+ {"UNSUPPORTED_SEARCH_TYPE", 44, 120},
+ #endif
+ #ifdef OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED
+ {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED},
+ #else
+ {"URI_AUTHORITY_UNSUPPORTED", 44, 111},
+ #endif
+ #ifdef PEM_R_BAD_BASE64_DECODE
+ {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
+ #else
+ {"BAD_BASE64_DECODE", 9, 100},
+ #endif
+ #ifdef PEM_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 9, 101},
+ #endif
+ #ifdef PEM_R_BAD_END_LINE
+ {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
+ #else
+ {"BAD_END_LINE", 9, 102},
+ #endif
+ #ifdef PEM_R_BAD_IV_CHARS
+ {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
+ #else
+ {"BAD_IV_CHARS", 9, 103},
+ #endif
+ #ifdef PEM_R_BAD_MAGIC_NUMBER
+ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
+ #else
+ {"BAD_MAGIC_NUMBER", 9, 116},
+ #endif
+ #ifdef PEM_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 9, 104},
+ #endif
+ #ifdef PEM_R_BAD_VERSION_NUMBER
+ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
+ #else
+ {"BAD_VERSION_NUMBER", 9, 117},
+ #endif
+ #ifdef PEM_R_BIO_WRITE_FAILURE
+ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
+ #else
+ {"BIO_WRITE_FAILURE", 9, 118},
+ #endif
+ #ifdef PEM_R_CIPHER_IS_NULL
+ {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
+ #else
+ {"CIPHER_IS_NULL", 9, 127},
+ #endif
+ #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
+ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
+ #else
+ {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115},
+ #endif
+ #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
+ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
+ #else
+ {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119},
+ #endif
+ #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
+ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
+ #else
+ {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120},
+ #endif
+ #ifdef PEM_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 9, 128},
+ #endif
+ #ifdef PEM_R_INCONSISTENT_HEADER
+ {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
+ #else
+ {"INCONSISTENT_HEADER", 9, 121},
+ #endif
+ #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
+ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
+ #else
+ {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122},
+ #endif
+ #ifdef PEM_R_KEYBLOB_TOO_SHORT
+ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
+ #else
+ {"KEYBLOB_TOO_SHORT", 9, 123},
+ #endif
+ #ifdef PEM_R_MISSING_DEK_IV
+ {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV},
+ #else
+ {"MISSING_DEK_IV", 9, 129},
+ #endif
+ #ifdef PEM_R_NOT_DEK_INFO
+ {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
+ #else
+ {"NOT_DEK_INFO", 9, 105},
+ #endif
+ #ifdef PEM_R_NOT_ENCRYPTED
+ {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
+ #else
+ {"NOT_ENCRYPTED", 9, 106},
+ #endif
+ #ifdef PEM_R_NOT_PROC_TYPE
+ {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
+ #else
+ {"NOT_PROC_TYPE", 9, 107},
+ #endif
+ #ifdef PEM_R_NO_START_LINE
+ {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
+ #else
+ {"NO_START_LINE", 9, 108},
+ #endif
+ #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
+ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD},
+ #else
+ {"PROBLEMS_GETTING_PASSWORD", 9, 109},
+ #endif
+ #ifdef PEM_R_PVK_DATA_TOO_SHORT
+ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
+ #else
+ {"PVK_DATA_TOO_SHORT", 9, 124},
+ #endif
+ #ifdef PEM_R_PVK_TOO_SHORT
+ {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
+ #else
+ {"PVK_TOO_SHORT", 9, 125},
+ #endif
+ #ifdef PEM_R_READ_KEY
+ {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
+ #else
+ {"READ_KEY", 9, 111},
+ #endif
+ #ifdef PEM_R_SHORT_HEADER
+ {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
+ #else
+ {"SHORT_HEADER", 9, 112},
+ #endif
+ #ifdef PEM_R_UNEXPECTED_DEK_IV
+ {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV},
+ #else
+ {"UNEXPECTED_DEK_IV", 9, 130},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 9, 113},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
+ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
+ #else
+ {"UNSUPPORTED_ENCRYPTION", 9, 114},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
+ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS},
+ #else
+ {"UNSUPPORTED_KEY_COMPONENTS", 9, 126},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_PEM, PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 9, 110},
+ #endif
+ #ifdef PKCS12_R_CANT_PACK_STRUCTURE
+ {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE},
+ #else
+ {"CANT_PACK_STRUCTURE", 35, 100},
+ #endif
+ #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA
+ {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_DATA", 35, 121},
+ #endif
+ #ifdef PKCS12_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 35, 101},
+ #endif
+ #ifdef PKCS12_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 35, 102},
+ #endif
+ #ifdef PKCS12_R_ENCRYPT_ERROR
+ {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR},
+ #else
+ {"ENCRYPT_ERROR", 35, 103},
+ #endif
+ #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE},
+ #else
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 35, 104},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER
+ {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER},
+ #else
+ {"INVALID_NULL_PKCS12_POINTER", 35, 105},
+ #endif
+ #ifdef PKCS12_R_IV_GEN_ERROR
+ {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR},
+ #else
+ {"IV_GEN_ERROR", 35, 106},
+ #endif
+ #ifdef PKCS12_R_KEY_GEN_ERROR
+ {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR},
+ #else
+ {"KEY_GEN_ERROR", 35, 107},
+ #endif
+ #ifdef PKCS12_R_MAC_ABSENT
+ {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT},
+ #else
+ {"MAC_ABSENT", 35, 108},
+ #endif
+ #ifdef PKCS12_R_MAC_GENERATION_ERROR
+ {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR},
+ #else
+ {"MAC_GENERATION_ERROR", 35, 109},
+ #endif
+ #ifdef PKCS12_R_MAC_SETUP_ERROR
+ {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR},
+ #else
+ {"MAC_SETUP_ERROR", 35, 110},
+ #endif
+ #ifdef PKCS12_R_MAC_STRING_SET_ERROR
+ {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR},
+ #else
+ {"MAC_STRING_SET_ERROR", 35, 111},
+ #endif
+ #ifdef PKCS12_R_MAC_VERIFY_FAILURE
+ {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE},
+ #else
+ {"MAC_VERIFY_FAILURE", 35, 113},
+ #endif
+ #ifdef PKCS12_R_PARSE_ERROR
+ {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR},
+ #else
+ {"PARSE_ERROR", 35, 114},
+ #endif
+ #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR
+ {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR},
+ #else
+ {"PKCS12_ALGOR_CIPHERINIT_ERROR", 35, 115},
+ #endif
+ #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR
+ {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR},
+ #else
+ {"PKCS12_CIPHERFINAL_ERROR", 35, 116},
+ #endif
+ #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR
+ {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR},
+ #else
+ {"PKCS12_PBE_CRYPT_ERROR", 35, 117},
+ #endif
+ #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 35, 118},
+ #endif
+ #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE
+ {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE},
+ #else
+ {"UNSUPPORTED_PKCS12_MODE", 35, 119},
+ #endif
+ #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 33, 117},
+ #endif
+ #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144},
+ #endif
+ #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED
+ {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED},
+ #else
+ {"CIPHER_NOT_INITIALIZED", 33, 116},
+ #endif
+ #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT
+ {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT},
+ #else
+ {"CONTENT_AND_DATA_PRESENT", 33, 118},
+ #endif
+ #ifdef PKCS7_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 33, 152},
+ #endif
+ #ifdef PKCS7_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 33, 119},
+ #endif
+ #ifdef PKCS7_R_DIGEST_FAILURE
+ {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE},
+ #else
+ {"DIGEST_FAILURE", 33, 101},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE
+ {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE},
+ #else
+ {"ENCRYPTION_CTRL_FAILURE", 33, 149},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150},
+ #endif
+ #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT
+ {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT},
+ #else
+ {"ERROR_ADDING_RECIPIENT", 33, 120},
+ #endif
+ #ifdef PKCS7_R_ERROR_SETTING_CIPHER
+ {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER},
+ #else
+ {"ERROR_SETTING_CIPHER", 33, 121},
+ #endif
+ #ifdef PKCS7_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 33, 143},
+ #endif
+ #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE
+ {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE},
+ #else
+ {"INVALID_SIGNED_DATA_TYPE", 33, 155},
+ #endif
+ #ifdef PKCS7_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 33, 122},
+ #endif
+ #ifdef PKCS7_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 33, 151},
+ #endif
+ #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND},
+ #else
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154},
+ #endif
+ #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE},
+ #else
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA
+ {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA},
+ #else
+ {"NO_SIGNATURES_ON_DATA", 33, 123},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 33, 142},
+ #endif
+ #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR
+ {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNER_ERROR", 33, 153},
+ #endif
+ #ifdef PKCS7_R_PKCS7_DATASIGN
+ {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN},
+ #else
+ {"PKCS7_DATASIGN", 33, 145},
+ #endif
+ #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127},
+ #endif
+ #ifdef PKCS7_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 33, 105},
+ #endif
+ #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128},
+ #endif
+ #ifdef PKCS7_R_SIGNING_CTRL_FAILURE
+ {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE},
+ #else
+ {"SIGNING_CTRL_FAILURE", 33, 147},
+ #endif
+ #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148},
+ #endif
+ #ifdef PKCS7_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 33, 129},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE
+ {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE},
+ #else
+ {"UNABLE_TO_FIND_CERTIFICATE", 33, 106},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO
+ {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO},
+ #else
+ {"UNABLE_TO_FIND_MEM_BIO", 33, 107},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST},
+ #else
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE
+ {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE},
+ #else
+ {"UNKNOWN_DIGEST_TYPE", 33, 109},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_OPERATION
+ {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION},
+ #else
+ {"UNKNOWN_OPERATION", 33, 110},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE
+ {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE},
+ #else
+ {"UNSUPPORTED_CIPHER_TYPE", 33, 111},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 33, 112},
+ #endif
+ #ifdef PKCS7_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 33, 113},
+ #endif
+ #ifdef PKCS7_R_WRONG_PKCS7_TYPE
+ {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE},
+ #else
+ {"WRONG_PKCS7_TYPE", 33, 114},
+ #endif
+ #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG
+ {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG},
+ #else
+ {"ADDITIONAL_INPUT_TOO_LONG", 36, 102},
+ #endif
+ #ifdef RAND_R_ALREADY_INSTANTIATED
+ {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED},
+ #else
+ {"ALREADY_INSTANTIATED", 36, 103},
+ #endif
+ #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE
+ {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE},
+ #else
+ {"ARGUMENT_OUT_OF_RANGE", 36, 105},
+ #endif
+ #ifdef RAND_R_CANNOT_OPEN_FILE
+ {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE},
+ #else
+ {"CANNOT_OPEN_FILE", 36, 121},
+ #endif
+ #ifdef RAND_R_DRBG_ALREADY_INITIALIZED
+ {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED},
+ #else
+ {"DRBG_ALREADY_INITIALIZED", 36, 129},
+ #endif
+ #ifdef RAND_R_DRBG_NOT_INITIALISED
+ {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED},
+ #else
+ {"DRBG_NOT_INITIALISED", 36, 104},
+ #endif
+ #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG
+ {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG},
+ #else
+ {"ENTROPY_INPUT_TOO_LONG", 36, 106},
+ #endif
+ #ifdef RAND_R_ENTROPY_OUT_OF_RANGE
+ {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE},
+ #else
+ {"ENTROPY_OUT_OF_RANGE", 36, 124},
+ #endif
+ #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED},
+ #else
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127},
+ #endif
+ #ifdef RAND_R_ERROR_INITIALISING_DRBG
+ {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG},
+ #else
+ {"ERROR_INITIALISING_DRBG", 36, 107},
+ #endif
+ #ifdef RAND_R_ERROR_INSTANTIATING_DRBG
+ {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG},
+ #else
+ {"ERROR_INSTANTIATING_DRBG", 36, 108},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT},
+ #else
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY
+ {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY},
+ #else
+ {"ERROR_RETRIEVING_ENTROPY", 36, 110},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_NONCE
+ {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE},
+ #else
+ {"ERROR_RETRIEVING_NONCE", 36, 111},
+ #endif
+ #ifdef RAND_R_FAILED_TO_CREATE_LOCK
+ {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK},
+ #else
+ {"FAILED_TO_CREATE_LOCK", 36, 126},
+ #endif
+ #ifdef RAND_R_FUNC_NOT_IMPLEMENTED
+ {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED},
+ #else
+ {"FUNC_NOT_IMPLEMENTED", 36, 101},
+ #endif
+ #ifdef RAND_R_FWRITE_ERROR
+ {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR},
+ #else
+ {"FWRITE_ERROR", 36, 123},
+ #endif
+ #ifdef RAND_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 36, 112},
+ #endif
+ #ifdef RAND_R_INTERNAL_ERROR
+ {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR},
+ #else
+ {"INTERNAL_ERROR", 36, 113},
+ #endif
+ #ifdef RAND_R_IN_ERROR_STATE
+ {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE},
+ #else
+ {"IN_ERROR_STATE", 36, 114},
+ #endif
+ #ifdef RAND_R_NOT_A_REGULAR_FILE
+ {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE},
+ #else
+ {"NOT_A_REGULAR_FILE", 36, 122},
+ #endif
+ #ifdef RAND_R_NOT_INSTANTIATED
+ {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED},
+ #else
+ {"NOT_INSTANTIATED", 36, 115},
+ #endif
+ #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED},
+ #else
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128},
+ #endif
+ #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED
+ {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED},
+ #else
+ {"PARENT_LOCKING_NOT_ENABLED", 36, 130},
+ #endif
+ #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK
+ {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK},
+ #else
+ {"PARENT_STRENGTH_TOO_WEAK", 36, 131},
+ #endif
+ #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG
+ {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG},
+ #else
+ {"PERSONALISATION_STRING_TOO_LONG", 36, 116},
+ #endif
+ #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED},
+ #else
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133},
+ #endif
+ #ifdef RAND_R_PRNG_NOT_SEEDED
+ {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED},
+ #else
+ {"PRNG_NOT_SEEDED", 36, 100},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_OVERFLOW
+ {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW},
+ #else
+ {"RANDOM_POOL_OVERFLOW", 36, 125},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_UNDERFLOW
+ {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW},
+ #else
+ {"RANDOM_POOL_UNDERFLOW", 36, 134},
+ #endif
+ #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG
+ {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG},
+ #else
+ {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117},
+ #endif
+ #ifdef RAND_R_RESEED_ERROR
+ {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR},
+ #else
+ {"RESEED_ERROR", 36, 118},
+ #endif
+ #ifdef RAND_R_SELFTEST_FAILURE
+ {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE},
+ #else
+ {"SELFTEST_FAILURE", 36, 119},
+ #endif
+ #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED
+ {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED},
+ #else
+ {"TOO_LITTLE_NONCE_REQUESTED", 36, 135},
+ #endif
+ #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED
+ {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED},
+ #else
+ {"TOO_MUCH_NONCE_REQUESTED", 36, 136},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS
+ {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS},
+ #else
+ {"UNSUPPORTED_DRBG_FLAGS", 36, 132},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE
+ {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE},
+ #else
+ {"UNSUPPORTED_DRBG_TYPE", 36, 120},
+ #endif
+ #ifdef RSA_R_ALGORITHM_MISMATCH
+ {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH},
+ #else
+ {"ALGORITHM_MISMATCH", 4, 100},
+ #endif
+ #ifdef RSA_R_BAD_E_VALUE
+ {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE},
+ #else
+ {"BAD_E_VALUE", 4, 101},
+ #endif
+ #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT
+ {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT},
+ #else
+ {"BAD_FIXED_HEADER_DECRYPT", 4, 102},
+ #endif
+ #ifdef RSA_R_BAD_PAD_BYTE_COUNT
+ {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT},
+ #else
+ {"BAD_PAD_BYTE_COUNT", 4, 103},
+ #endif
+ #ifdef RSA_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 4, 104},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01
+ {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01},
+ #else
+ {"BLOCK_TYPE_IS_NOT_01", 4, 106},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02
+ {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02},
+ #else
+ {"BLOCK_TYPE_IS_NOT_02", 4, 107},
+ #endif
+ #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN
+ {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN},
+ #else
+ {"DATA_GREATER_THAN_MOD_LEN", 4, 108},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE
+ {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE},
+ #else
+ {"DATA_TOO_LARGE", 4, 109},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS
+ {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS},
+ #else
+ {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL
+ {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL},
+ #else
+ {"DATA_TOO_SMALL", 4, 111},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122},
+ #endif
+ #ifdef RSA_R_DIGEST_DOES_NOT_MATCH
+ {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH},
+ #else
+ {"DIGEST_DOES_NOT_MATCH", 4, 158},
+ #endif
+ #ifdef RSA_R_DIGEST_NOT_ALLOWED
+ {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED},
+ #else
+ {"DIGEST_NOT_ALLOWED", 4, 145},
+ #endif
+ #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY},
+ #else
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112},
+ #endif
+ #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D
+ {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMP1_NOT_CONGRUENT_TO_D", 4, 124},
+ #endif
+ #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D
+ {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125},
+ #endif
+ #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1
+ {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1},
+ #else
+ {"D_E_NOT_CONGRUENT_TO_1", 4, 123},
+ #endif
+ #ifdef RSA_R_FIRST_OCTET_INVALID
+ {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID},
+ #else
+ {"FIRST_OCTET_INVALID", 4, 133},
+ #endif
+ #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+ #else
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 4, 157},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST_LENGTH
+ {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH},
+ #else
+ {"INVALID_DIGEST_LENGTH", 4, 143},
+ #endif
+ #ifdef RSA_R_INVALID_HEADER
+ {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER},
+ #else
+ {"INVALID_HEADER", 4, 137},
+ #endif
+ #ifdef RSA_R_INVALID_LABEL
+ {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL},
+ #else
+ {"INVALID_LABEL", 4, 160},
+ #endif
+ #ifdef RSA_R_INVALID_MESSAGE_LENGTH
+ {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH},
+ #else
+ {"INVALID_MESSAGE_LENGTH", 4, 131},
+ #endif
+ #ifdef RSA_R_INVALID_MGF1_MD
+ {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD},
+ #else
+ {"INVALID_MGF1_MD", 4, 156},
+ #endif
+ #ifdef RSA_R_INVALID_MULTI_PRIME_KEY
+ {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY},
+ #else
+ {"INVALID_MULTI_PRIME_KEY", 4, 167},
+ #endif
+ #ifdef RSA_R_INVALID_OAEP_PARAMETERS
+ {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS},
+ #else
+ {"INVALID_OAEP_PARAMETERS", 4, 161},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING
+ {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING},
+ #else
+ {"INVALID_PADDING", 4, 138},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING_MODE
+ {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE},
+ #else
+ {"INVALID_PADDING_MODE", 4, 141},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_PARAMETERS
+ {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS},
+ #else
+ {"INVALID_PSS_PARAMETERS", 4, 149},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_SALTLEN
+ {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN},
+ #else
+ {"INVALID_PSS_SALTLEN", 4, 146},
+ #endif
+ #ifdef RSA_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 4, 150},
+ #endif
+ #ifdef RSA_R_INVALID_TRAILER
+ {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER},
+ #else
+ {"INVALID_TRAILER", 4, 139},
+ #endif
+ #ifdef RSA_R_INVALID_X931_DIGEST
+ {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST},
+ #else
+ {"INVALID_X931_DIGEST", 4, 142},
+ #endif
+ #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q
+ {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q},
+ #else
+ {"IQMP_NOT_INVERSE_OF_Q", 4, 126},
+ #endif
+ #ifdef RSA_R_KEY_PRIME_NUM_INVALID
+ {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID},
+ #else
+ {"KEY_PRIME_NUM_INVALID", 4, 165},
+ #endif
+ #ifdef RSA_R_KEY_SIZE_TOO_SMALL
+ {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL},
+ #else
+ {"KEY_SIZE_TOO_SMALL", 4, 120},
+ #endif
+ #ifdef RSA_R_LAST_OCTET_INVALID
+ {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID},
+ #else
+ {"LAST_OCTET_INVALID", 4, 134},
+ #endif
+ #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED
+ {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED},
+ #else
+ {"MGF1_DIGEST_NOT_ALLOWED", 4, 152},
+ #endif
+ #ifdef RSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 4, 179},
+ #endif
+ #ifdef RSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 4, 105},
+ #endif
+ #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R},
+ #else
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168},
+ #endif
+ #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D},
+ #else
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169},
+ #endif
+ #ifdef RSA_R_MP_R_NOT_PRIME
+ {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME},
+ #else
+ {"MP_R_NOT_PRIME", 4, 170},
+ #endif
+ #ifdef RSA_R_NO_PUBLIC_EXPONENT
+ {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT},
+ #else
+ {"NO_PUBLIC_EXPONENT", 4, 140},
+ #endif
+ #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING
+ {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING},
+ #else
+ {"NULL_BEFORE_BLOCK_MISSING", 4, 113},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES},
+ #else
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q
+ {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q},
+ #else
+ {"N_DOES_NOT_EQUAL_P_Q", 4, 127},
+ #endif
+ #ifdef RSA_R_OAEP_DECODING_ERROR
+ {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR},
+ #else
+ {"OAEP_DECODING_ERROR", 4, 121},
+ #endif
+ #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148},
+ #endif
+ #ifdef RSA_R_PADDING_CHECK_FAILED
+ {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED},
+ #else
+ {"PADDING_CHECK_FAILED", 4, 114},
+ #endif
+ #ifdef RSA_R_PKCS_DECODING_ERROR
+ {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR},
+ #else
+ {"PKCS_DECODING_ERROR", 4, 159},
+ #endif
+ #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL
+ {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL},
+ #else
+ {"PSS_SALTLEN_TOO_SMALL", 4, 164},
+ #endif
+ #ifdef RSA_R_P_NOT_PRIME
+ {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME},
+ #else
+ {"P_NOT_PRIME", 4, 128},
+ #endif
+ #ifdef RSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 4, 129},
+ #endif
+ #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
+ {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED},
+ #else
+ {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130},
+ #endif
+ #ifdef RSA_R_SLEN_CHECK_FAILED
+ {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED},
+ #else
+ {"SLEN_CHECK_FAILED", 4, 136},
+ #endif
+ #ifdef RSA_R_SLEN_RECOVERY_FAILED
+ {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED},
+ #else
+ {"SLEN_RECOVERY_FAILED", 4, 135},
+ #endif
+ #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK
+ {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK},
+ #else
+ {"SSLV3_ROLLBACK_ATTACK", 4, 115},
+ #endif
+ #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116},
+ #endif
+ #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE
+ {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE},
+ #else
+ {"UNKNOWN_ALGORITHM_TYPE", 4, 117},
+ #endif
+ #ifdef RSA_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 4, 166},
+ #endif
+ #ifdef RSA_R_UNKNOWN_MASK_DIGEST
+ {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST},
+ #else
+ {"UNKNOWN_MASK_DIGEST", 4, 151},
+ #endif
+ #ifdef RSA_R_UNKNOWN_PADDING_TYPE
+ {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE},
+ #else
+ {"UNKNOWN_PADDING_TYPE", 4, 118},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE
+ {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE},
+ #else
+ {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE
+ {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE},
+ #else
+ {"UNSUPPORTED_LABEL_SOURCE", 4, 163},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM
+ {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MASK_ALGORITHM", 4, 153},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER
+ {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER},
+ #else
+ {"UNSUPPORTED_MASK_PARAMETER", 4, 154},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE
+ {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE},
+ #else
+ {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155},
+ #endif
+ #ifdef RSA_R_VALUE_MISSING
+ {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING},
+ #else
+ {"VALUE_MISSING", 4, 147},
+ #endif
+ #ifdef RSA_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 4, 119},
+ #endif
+ #ifdef SM2_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_SM2, SM2_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 53, 100},
+ #endif
+ #ifdef SM2_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SM2, SM2_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 53, 101},
+ #endif
+ #ifdef SM2_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_SM2, SM2_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 53, 107},
+ #endif
+ #ifdef SM2_R_DIST_ID_TOO_LARGE
+ {"DIST_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_DIST_ID_TOO_LARGE},
+ #else
+ {"DIST_ID_TOO_LARGE", 53, 110},
+ #endif
+ #ifdef SM2_R_ID_NOT_SET
+ {"ID_NOT_SET", ERR_LIB_SM2, SM2_R_ID_NOT_SET},
+ #else
+ {"ID_NOT_SET", 53, 112},
+ #endif
+ #ifdef SM2_R_ID_TOO_LARGE
+ {"ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_ID_TOO_LARGE},
+ #else
+ {"ID_TOO_LARGE", 53, 111},
+ #endif
+ #ifdef SM2_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_SM2, SM2_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 53, 108},
+ #endif
+ #ifdef SM2_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_SM2, SM2_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 53, 102},
+ #endif
+ #ifdef SM2_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_SM2, SM2_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 53, 103},
+ #endif
+ #ifdef SM2_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_SM2, SM2_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 53, 104},
+ #endif
+ #ifdef SM2_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_SM2, SM2_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 53, 105},
+ #endif
+ #ifdef SM2_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_SM2, SM2_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 53, 109},
+ #endif
+ #ifdef SM2_R_USER_ID_TOO_LARGE
+ {"USER_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_USER_ID_TOO_LARGE},
+ #else
+ {"USER_ID_TOO_LARGE", 53, 106},
+ #endif
+ #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY},
+ #else
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291},
+ #endif
+ #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
+ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
+ #else
+ {"APP_DATA_IN_HANDSHAKE", 20, 100},
+ #endif
+ #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
+ #else
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE
+ {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE},
+ #else
+ {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE},
+ #else
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158},
+ #endif
+ #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
+ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
+ #else
+ {"BAD_CHANGE_CIPHER_SPEC", 20, 103},
+ #endif
+ #ifdef SSL_R_BAD_CIPHER
+ {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER},
+ #else
+ {"BAD_CIPHER", 20, 186},
+ #endif
+ #ifdef SSL_R_BAD_DATA
+ {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA},
+ #else
+ {"BAD_DATA", 20, 390},
+ #endif
+ #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
+ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
+ #else
+ {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106},
+ #endif
+ #ifdef SSL_R_BAD_DECOMPRESSION
+ {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
+ #else
+ {"BAD_DECOMPRESSION", 20, 107},
+ #endif
+ #ifdef SSL_R_BAD_DH_VALUE
+ {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE},
+ #else
+ {"BAD_DH_VALUE", 20, 102},
+ #endif
+ #ifdef SSL_R_BAD_DIGEST_LENGTH
+ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
+ #else
+ {"BAD_DIGEST_LENGTH", 20, 111},
+ #endif
+ #ifdef SSL_R_BAD_EARLY_DATA
+ {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA},
+ #else
+ {"BAD_EARLY_DATA", 20, 233},
+ #endif
+ #ifdef SSL_R_BAD_ECC_CERT
+ {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
+ #else
+ {"BAD_ECC_CERT", 20, 304},
+ #endif
+ #ifdef SSL_R_BAD_ECPOINT
+ {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
+ #else
+ {"BAD_ECPOINT", 20, 306},
+ #endif
+ #ifdef SSL_R_BAD_EXTENSION
+ {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION},
+ #else
+ {"BAD_EXTENSION", 20, 110},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
+ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
+ #else
+ {"BAD_HANDSHAKE_LENGTH", 20, 332},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_STATE
+ {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE},
+ #else
+ {"BAD_HANDSHAKE_STATE", 20, 236},
+ #endif
+ #ifdef SSL_R_BAD_HELLO_REQUEST
+ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
+ #else
+ {"BAD_HELLO_REQUEST", 20, 105},
+ #endif
+ #ifdef SSL_R_BAD_HRR_VERSION
+ {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION},
+ #else
+ {"BAD_HRR_VERSION", 20, 263},
+ #endif
+ #ifdef SSL_R_BAD_KEY_SHARE
+ {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE},
+ #else
+ {"BAD_KEY_SHARE", 20, 108},
+ #endif
+ #ifdef SSL_R_BAD_KEY_UPDATE
+ {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE},
+ #else
+ {"BAD_KEY_UPDATE", 20, 122},
+ #endif
+ #ifdef SSL_R_BAD_LEGACY_VERSION
+ {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION},
+ #else
+ {"BAD_LEGACY_VERSION", 20, 292},
+ #endif
+ #ifdef SSL_R_BAD_LENGTH
+ {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
+ #else
+ {"BAD_LENGTH", 20, 271},
+ #endif
+ #ifdef SSL_R_BAD_PACKET
+ {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET},
+ #else
+ {"BAD_PACKET", 20, 240},
+ #endif
+ #ifdef SSL_R_BAD_PACKET_LENGTH
+ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
+ #else
+ {"BAD_PACKET_LENGTH", 20, 115},
+ #endif
+ #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
+ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
+ #else
+ {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116},
+ #endif
+ #ifdef SSL_R_BAD_PSK
+ {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK},
+ #else
+ {"BAD_PSK", 20, 219},
+ #endif
+ #ifdef SSL_R_BAD_PSK_IDENTITY
+ {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY},
+ #else
+ {"BAD_PSK_IDENTITY", 20, 114},
+ #endif
+ #ifdef SSL_R_BAD_RECORD_TYPE
+ {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE},
+ #else
+ {"BAD_RECORD_TYPE", 20, 443},
+ #endif
+ #ifdef SSL_R_BAD_RSA_ENCRYPT
+ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
+ #else
+ {"BAD_RSA_ENCRYPT", 20, 119},
+ #endif
+ #ifdef SSL_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 20, 123},
+ #endif
+ #ifdef SSL_R_BAD_SRP_A_LENGTH
+ {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH},
+ #else
+ {"BAD_SRP_A_LENGTH", 20, 347},
+ #endif
+ #ifdef SSL_R_BAD_SRP_PARAMETERS
+ {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS},
+ #else
+ {"BAD_SRP_PARAMETERS", 20, 371},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_MKI_VALUE
+ {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE},
+ #else
+ {"BAD_SRTP_MKI_VALUE", 20, 352},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353},
+ #endif
+ #ifdef SSL_R_BAD_SSL_FILETYPE
+ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
+ #else
+ {"BAD_SSL_FILETYPE", 20, 124},
+ #endif
+ #ifdef SSL_R_BAD_VALUE
+ {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE},
+ #else
+ {"BAD_VALUE", 20, 384},
+ #endif
+ #ifdef SSL_R_BAD_WRITE_RETRY
+ {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
+ #else
+ {"BAD_WRITE_RETRY", 20, 127},
+ #endif
+ #ifdef SSL_R_BINDER_DOES_NOT_VERIFY
+ {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY},
+ #else
+ {"BINDER_DOES_NOT_VERIFY", 20, 253},
+ #endif
+ #ifdef SSL_R_BIO_NOT_SET
+ {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
+ #else
+ {"BIO_NOT_SET", 20, 128},
+ #endif
+ #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
+ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
+ #else
+ {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129},
+ #endif
+ #ifdef SSL_R_BN_LIB
+ {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
+ #else
+ {"BN_LIB", 20, 130},
+ #endif
+ #ifdef SSL_R_CALLBACK_FAILED
+ {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED},
+ #else
+ {"CALLBACK_FAILED", 20, 234},
+ #endif
+ #ifdef SSL_R_CANNOT_CHANGE_CIPHER
+ {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER},
+ #else
+ {"CANNOT_CHANGE_CIPHER", 20, 109},
+ #endif
+ #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
+ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
+ #else
+ {"CA_DN_LENGTH_MISMATCH", 20, 131},
+ #endif
+ #ifdef SSL_R_CA_KEY_TOO_SMALL
+ {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL},
+ #else
+ {"CA_KEY_TOO_SMALL", 20, 397},
+ #endif
+ #ifdef SSL_R_CA_MD_TOO_WEAK
+ {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK},
+ #else
+ {"CA_MD_TOO_WEAK", 20, 398},
+ #endif
+ #ifdef SSL_R_CCS_RECEIVED_EARLY
+ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
+ #else
+ {"CCS_RECEIVED_EARLY", 20, 133},
+ #endif
+ #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
+ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED},
+ #else
+ {"CERTIFICATE_VERIFY_FAILED", 20, 134},
+ #endif
+ #ifdef SSL_R_CERT_CB_ERROR
+ {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR},
+ #else
+ {"CERT_CB_ERROR", 20, 377},
+ #endif
+ #ifdef SSL_R_CERT_LENGTH_MISMATCH
+ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
+ #else
+ {"CERT_LENGTH_MISMATCH", 20, 135},
+ #endif
+ #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED},
+ #else
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218},
+ #endif
+ #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
+ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH},
+ #else
+ {"CIPHER_CODE_WRONG_LENGTH", 20, 137},
+ #endif
+ #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE
+ {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE},
+ #else
+ {"CIPHER_OR_HASH_UNAVAILABLE", 20, 138},
+ #endif
+ #ifdef SSL_R_CLIENTHELLO_TLSEXT
+ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
+ #else
+ {"CLIENTHELLO_TLSEXT", 20, 226},
+ #endif
+ #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
+ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG},
+ #else
+ {"COMPRESSED_LENGTH_TOO_LONG", 20, 140},
+ #endif
+ #ifdef SSL_R_COMPRESSION_DISABLED
+ {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
+ #else
+ {"COMPRESSION_DISABLED", 20, 343},
+ #endif
+ #ifdef SSL_R_COMPRESSION_FAILURE
+ {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
+ #else
+ {"COMPRESSION_FAILURE", 20, 141},
+ #endif
+ #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
+ #else
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307},
+ #endif
+ #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
+ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR},
+ #else
+ {"COMPRESSION_LIBRARY_ERROR", 20, 142},
+ #endif
+ #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
+ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
+ #else
+ {"CONNECTION_TYPE_NOT_SET", 20, 144},
+ #endif
+ #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED
+ {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED},
+ #else
+ {"CONTEXT_NOT_DANE_ENABLED", 20, 167},
+ #endif
+ #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE
+ {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE},
+ #else
+ {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400},
+ #endif
+ #ifdef SSL_R_COOKIE_MISMATCH
+ {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
+ #else
+ {"COOKIE_MISMATCH", 20, 308},
+ #endif
+ #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED},
+ #else
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206},
+ #endif
+ #ifdef SSL_R_DANE_ALREADY_ENABLED
+ {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED},
+ #else
+ {"DANE_ALREADY_ENABLED", 20, 172},
+ #endif
+ #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL},
+ #else
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173},
+ #endif
+ #ifdef SSL_R_DANE_NOT_ENABLED
+ {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED},
+ #else
+ {"DANE_NOT_ENABLED", 20, 175},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE
+ {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE", 20, 180},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH
+ {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE
+ {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE},
+ #else
+ {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY
+ {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY},
+ #else
+ {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR
+ {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR},
+ #else
+ {"DANE_TLSA_BAD_SELECTOR", 20, 202},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_NULL_DATA
+ {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA},
+ #else
+ {"DANE_TLSA_NULL_DATA", 20, 203},
+ #endif
+ #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
+ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
+ #else
+ {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145},
+ #endif
+ #ifdef SSL_R_DATA_LENGTH_TOO_LONG
+ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
+ #else
+ {"DATA_LENGTH_TOO_LONG", 20, 146},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED
+ {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
+ #else
+ {"DECRYPTION_FAILED", 20, 147},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
+ #else
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281},
+ #endif
+ #ifdef SSL_R_DH_KEY_TOO_SMALL
+ {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL},
+ #else
+ {"DH_KEY_TOO_SMALL", 20, 394},
+ #endif
+ #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
+ #else
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148},
+ #endif
+ #ifdef SSL_R_DIGEST_CHECK_FAILED
+ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
+ #else
+ {"DIGEST_CHECK_FAILED", 20, 149},
+ #endif
+ #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
+ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
+ #else
+ {"DTLS_MESSAGE_TOO_BIG", 20, 334},
+ #endif
+ #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
+ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID},
+ #else
+ {"DUPLICATE_COMPRESSION_ID", 20, 309},
+ #endif
+ #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
+ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING},
+ #else
+ {"ECC_CERT_NOT_FOR_SIGNING", 20, 318},
+ #endif
+ #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE},
+ #else
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374},
+ #endif
+ #ifdef SSL_R_EE_KEY_TOO_SMALL
+ {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL},
+ #else
+ {"EE_KEY_TOO_SMALL", 20, 399},
+ #endif
+ #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354},
+ #endif
+ #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
+ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
+ #else
+ {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150},
+ #endif
+ #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
+ #else
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151},
+ #endif
+ #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN},
+ #else
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204},
+ #endif
+ #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE},
+ #else
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194},
+ #endif
+ #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
+ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
+ #else
+ {"EXCESSIVE_MESSAGE_SIZE", 20, 152},
+ #endif
+ #ifdef SSL_R_EXTENSION_NOT_RECEIVED
+ {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED},
+ #else
+ {"EXTENSION_NOT_RECEIVED", 20, 279},
+ #endif
+ #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
+ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
+ #else
+ {"EXTRA_DATA_IN_MESSAGE", 20, 153},
+ #endif
+ #ifdef SSL_R_EXT_LENGTH_MISMATCH
+ {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH},
+ #else
+ {"EXT_LENGTH_MISMATCH", 20, 163},
+ #endif
+ #ifdef SSL_R_FAILED_TO_INIT_ASYNC
+ {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC},
+ #else
+ {"FAILED_TO_INIT_ASYNC", 20, 405},
+ #endif
+ #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO
+ {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO},
+ #else
+ {"FRAGMENTED_CLIENT_HELLO", 20, 401},
+ #endif
+ #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
+ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
+ #else
+ {"GOT_A_FIN_BEFORE_A_CCS", 20, 154},
+ #endif
+ #ifdef SSL_R_HTTPS_PROXY_REQUEST
+ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
+ #else
+ {"HTTPS_PROXY_REQUEST", 20, 155},
+ #endif
+ #ifdef SSL_R_HTTP_REQUEST
+ {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
+ #else
+ {"HTTP_REQUEST", 20, 156},
+ #endif
+ #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION
+ {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION},
+ #else
+ {"ILLEGAL_POINT_COMPRESSION", 20, 162},
+ #endif
+ #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST
+ {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST},
+ #else
+ {"ILLEGAL_SUITEB_DIGEST", 20, 380},
+ #endif
+ #ifdef SSL_R_INAPPROPRIATE_FALLBACK
+ {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK},
+ #else
+ {"INAPPROPRIATE_FALLBACK", 20, 373},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_COMPRESSION
+ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION},
+ #else
+ {"INCONSISTENT_COMPRESSION", 20, 340},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN
+ {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN},
+ #else
+ {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI
+ {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI},
+ #else
+ {"INCONSISTENT_EARLY_DATA_SNI", 20, 231},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EXTMS
+ {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS},
+ #else
+ {"INCONSISTENT_EXTMS", 20, 104},
+ #endif
+ #ifdef SSL_R_INSUFFICIENT_SECURITY
+ {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY},
+ #else
+ {"INSUFFICIENT_SECURITY", 20, 241},
+ #endif
+ #ifdef SSL_R_INVALID_ALERT
+ {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT},
+ #else
+ {"INVALID_ALERT", 20, 205},
+ #endif
+ #ifdef SSL_R_INVALID_CCS_MESSAGE
+ {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE},
+ #else
+ {"INVALID_CCS_MESSAGE", 20, 260},
+ #endif
+ #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG
+ {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG},
+ #else
+ {"INVALID_CERTIFICATE_OR_ALG", 20, 238},
+ #endif
+ #ifdef SSL_R_INVALID_COMMAND
+ {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
+ #else
+ {"INVALID_COMMAND", 20, 280},
+ #endif
+ #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
+ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM},
+ #else
+ {"INVALID_COMPRESSION_ALGORITHM", 20, 341},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIG
+ {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG},
+ #else
+ {"INVALID_CONFIG", 20, 283},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIGURATION_NAME
+ {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME},
+ #else
+ {"INVALID_CONFIGURATION_NAME", 20, 113},
+ #endif
+ #ifdef SSL_R_INVALID_CONTEXT
+ {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT},
+ #else
+ {"INVALID_CONTEXT", 20, 282},
+ #endif
+ #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE
+ {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE},
+ #else
+ {"INVALID_CT_VALIDATION_TYPE", 20, 212},
+ #endif
+ #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE
+ {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE},
+ #else
+ {"INVALID_KEY_UPDATE_TYPE", 20, 120},
+ #endif
+ #ifdef SSL_R_INVALID_MAX_EARLY_DATA
+ {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA},
+ #else
+ {"INVALID_MAX_EARLY_DATA", 20, 174},
+ #endif
+ #ifdef SSL_R_INVALID_NULL_CMD_NAME
+ {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME},
+ #else
+ {"INVALID_NULL_CMD_NAME", 20, 385},
+ #endif
+ #ifdef SSL_R_INVALID_SEQUENCE_NUMBER
+ {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER},
+ #else
+ {"INVALID_SEQUENCE_NUMBER", 20, 402},
+ #endif
+ #ifdef SSL_R_INVALID_SERVERINFO_DATA
+ {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA},
+ #else
+ {"INVALID_SERVERINFO_DATA", 20, 388},
+ #endif
+ #ifdef SSL_R_INVALID_SESSION_ID
+ {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID},
+ #else
+ {"INVALID_SESSION_ID", 20, 999},
+ #endif
+ #ifdef SSL_R_INVALID_SRP_USERNAME
+ {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME},
+ #else
+ {"INVALID_SRP_USERNAME", 20, 357},
+ #endif
+ #ifdef SSL_R_INVALID_STATUS_RESPONSE
+ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
+ #else
+ {"INVALID_STATUS_RESPONSE", 20, 328},
+ #endif
+ #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
+ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH},
+ #else
+ {"INVALID_TICKET_KEYS_LENGTH", 20, 325},
+ #endif
+ #ifdef SSL_R_LENGTH_MISMATCH
+ {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
+ #else
+ {"LENGTH_MISMATCH", 20, 159},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 20, 404},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_SHORT
+ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
+ #else
+ {"LENGTH_TOO_SHORT", 20, 160},
+ #endif
+ #ifdef SSL_R_LIBRARY_BUG
+ {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
+ #else
+ {"LIBRARY_BUG", 20, 274},
+ #endif
+ #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
+ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"LIBRARY_HAS_NO_CIPHERS", 20, 161},
+ #endif
+ #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
+ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT},
+ #else
+ {"MISSING_DSA_SIGNING_CERT", 20, 165},
+ #endif
+ #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT
+ {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT},
+ #else
+ {"MISSING_ECDSA_SIGNING_CERT", 20, 381},
+ #endif
+ #ifdef SSL_R_MISSING_FATAL
+ {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL},
+ #else
+ {"MISSING_FATAL", 20, 256},
+ #endif
+ #ifdef SSL_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 20, 290},
+ #endif
+ #ifdef SSL_R_MISSING_PSK_KEX_MODES_EXTENSION
+ {"MISSING_PSK_KEX_MODES_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_PSK_KEX_MODES_EXTENSION},
+ #else
+ {"MISSING_PSK_KEX_MODES_EXTENSION", 20, 310},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_CERTIFICATE
+ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
+ #else
+ {"MISSING_RSA_CERTIFICATE", 20, 168},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
+ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT},
+ #else
+ {"MISSING_RSA_ENCRYPTING_CERT", 20, 169},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
+ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT},
+ #else
+ {"MISSING_RSA_SIGNING_CERT", 20, 170},
+ #endif
+ #ifdef SSL_R_MISSING_SIGALGS_EXTENSION
+ {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION},
+ #else
+ {"MISSING_SIGALGS_EXTENSION", 20, 112},
+ #endif
+ #ifdef SSL_R_MISSING_SIGNING_CERT
+ {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT},
+ #else
+ {"MISSING_SIGNING_CERT", 20, 221},
+ #endif
+ #ifdef SSL_R_MISSING_SRP_PARAM
+ {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM},
+ #else
+ {"MISSING_SRP_PARAM", 20, 358},
+ #endif
+ #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION},
+ #else
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_DH_KEY
+ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
+ #else
+ {"MISSING_TMP_DH_KEY", 20, 171},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_ECDH_KEY
+ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
+ #else
+ {"MISSING_TMP_ECDH_KEY", 20, 311},
+ #endif
+ #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA},
+ #else
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293},
+ #endif
+ #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY
+ {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY},
+ #else
+ {"NOT_ON_RECORD_BOUNDARY", 20, 182},
+ #endif
+ #ifdef SSL_R_NOT_REPLACING_CERTIFICATE
+ {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE},
+ #else
+ {"NOT_REPLACING_CERTIFICATE", 20, 289},
+ #endif
+ #ifdef SSL_R_NOT_SERVER
+ {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER},
+ #else
+ {"NOT_SERVER", 20, 284},
+ #endif
+ #ifdef SSL_R_NO_APPLICATION_PROTOCOL
+ {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL},
+ #else
+ {"NO_APPLICATION_PROTOCOL", 20, 235},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATES_RETURNED
+ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED},
+ #else
+ {"NO_CERTIFICATES_RETURNED", 20, 176},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
+ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
+ #else
+ {"NO_CERTIFICATE_ASSIGNED", 20, 177},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_SET
+ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
+ #else
+ {"NO_CERTIFICATE_SET", 20, 179},
+ #endif
+ #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR
+ {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR},
+ #else
+ {"NO_CHANGE_FOLLOWING_HRR", 20, 214},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_AVAILABLE
+ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
+ #else
+ {"NO_CIPHERS_AVAILABLE", 20, 181},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_SPECIFIED
+ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
+ #else
+ {"NO_CIPHERS_SPECIFIED", 20, 183},
+ #endif
+ #ifdef SSL_R_NO_CIPHER_MATCH
+ {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
+ #else
+ {"NO_CIPHER_MATCH", 20, 185},
+ #endif
+ #ifdef SSL_R_NO_CLIENT_CERT_METHOD
+ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
+ #else
+ {"NO_CLIENT_CERT_METHOD", 20, 331},
+ #endif
+ #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
+ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED},
+ #else
+ {"NO_COMPRESSION_SPECIFIED", 20, 187},
+ #endif
+ #ifdef SSL_R_NO_COOKIE_CALLBACK_SET
+ {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET},
+ #else
+ {"NO_COOKIE_CALLBACK_SET", 20, 287},
+ #endif
+ #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
+ #else
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330},
+ #endif
+ #ifdef SSL_R_NO_METHOD_SPECIFIED
+ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
+ #else
+ {"NO_METHOD_SPECIFIED", 20, 188},
+ #endif
+ #ifdef SSL_R_NO_PEM_EXTENSIONS
+ {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS},
+ #else
+ {"NO_PEM_EXTENSIONS", 20, 389},
+ #endif
+ #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
+ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
+ #else
+ {"NO_PRIVATE_KEY_ASSIGNED", 20, 190},
+ #endif
+ #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
+ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
+ #else
+ {"NO_PROTOCOLS_AVAILABLE", 20, 191},
+ #endif
+ #ifdef SSL_R_NO_RENEGOTIATION
+ {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
+ #else
+ {"NO_RENEGOTIATION", 20, 339},
+ #endif
+ #ifdef SSL_R_NO_REQUIRED_DIGEST
+ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
+ #else
+ {"NO_REQUIRED_DIGEST", 20, 324},
+ #endif
+ #ifdef SSL_R_NO_SHARED_CIPHER
+ {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
+ #else
+ {"NO_SHARED_CIPHER", 20, 193},
+ #endif
+ #ifdef SSL_R_NO_SHARED_GROUPS
+ {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS},
+ #else
+ {"NO_SHARED_GROUPS", 20, 410},
+ #endif
+ #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS},
+ #else
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376},
+ #endif
+ #ifdef SSL_R_NO_SRTP_PROFILES
+ {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES},
+ #else
+ {"NO_SRTP_PROFILES", 20, 359},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_KEY_SHARE
+ {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE},
+ #else
+ {"NO_SUITABLE_KEY_SHARE", 20, 101},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM},
+ #else
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118},
+ #endif
+ #ifdef SSL_R_NO_VALID_SCTS
+ {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS},
+ #else
+ {"NO_VALID_SCTS", 20, 216},
+ #endif
+ #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK
+ {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK},
+ #else
+ {"NO_VERIFY_COOKIE_CALLBACK", 20, 403},
+ #endif
+ #ifdef SSL_R_NULL_SSL_CTX
+ {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
+ #else
+ {"NULL_SSL_CTX", 20, 195},
+ #endif
+ #ifdef SSL_R_NULL_SSL_METHOD_PASSED
+ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
+ #else
+ {"NULL_SSL_METHOD_PASSED", 20, 196},
+ #endif
+ #ifdef SSL_R_OCSP_CALLBACK_FAILURE
+ {"OCSP_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_OCSP_CALLBACK_FAILURE},
+ #else
+ {"OCSP_CALLBACK_FAILURE", 20, 294},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344},
+ #endif
+ #ifdef SSL_R_OVERFLOW_ERROR
+ {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR},
+ #else
+ {"OVERFLOW_ERROR", 20, 237},
+ #endif
+ #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
+ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
+ #else
+ {"PACKET_LENGTH_TOO_LONG", 20, 198},
+ #endif
+ #ifdef SSL_R_PARSE_TLSEXT
+ {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
+ #else
+ {"PARSE_TLSEXT", 20, 227},
+ #endif
+ #ifdef SSL_R_PATH_TOO_LONG
+ {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
+ #else
+ {"PATH_TOO_LONG", 20, 270},
+ #endif
+ #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
+ #else
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199},
+ #endif
+ #ifdef SSL_R_PEM_NAME_BAD_PREFIX
+ {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX},
+ #else
+ {"PEM_NAME_BAD_PREFIX", 20, 391},
+ #endif
+ #ifdef SSL_R_PEM_NAME_TOO_SHORT
+ {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT},
+ #else
+ {"PEM_NAME_TOO_SHORT", 20, 392},
+ #endif
+ #ifdef SSL_R_PIPELINE_FAILURE
+ {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE},
+ #else
+ {"PIPELINE_FAILURE", 20, 406},
+ #endif
+ #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR},
+ #else
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278},
+ #endif
+ #ifdef SSL_R_PRIVATE_KEY_MISMATCH
+ {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH},
+ #else
+ {"PRIVATE_KEY_MISMATCH", 20, 288},
+ #endif
+ #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
+ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
+ #else
+ {"PROTOCOL_IS_SHUTDOWN", 20, 207},
+ #endif
+ #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
+ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
+ #else
+ {"PSK_IDENTITY_NOT_FOUND", 20, 223},
+ #endif
+ #ifdef SSL_R_PSK_NO_CLIENT_CB
+ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
+ #else
+ {"PSK_NO_CLIENT_CB", 20, 224},
+ #endif
+ #ifdef SSL_R_PSK_NO_SERVER_CB
+ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
+ #else
+ {"PSK_NO_SERVER_CB", 20, 225},
+ #endif
+ #ifdef SSL_R_READ_BIO_NOT_SET
+ {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
+ #else
+ {"READ_BIO_NOT_SET", 20, 211},
+ #endif
+ #ifdef SSL_R_READ_TIMEOUT_EXPIRED
+ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
+ #else
+ {"READ_TIMEOUT_EXPIRED", 20, 312},
+ #endif
+ #ifdef SSL_R_RECORD_LENGTH_MISMATCH
+ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
+ #else
+ {"RECORD_LENGTH_MISMATCH", 20, 213},
+ #endif
+ #ifdef SSL_R_RECORD_TOO_SMALL
+ {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
+ #else
+ {"RECORD_TOO_SMALL", 20, 298},
+ #endif
+ #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
+ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG},
+ #else
+ {"RENEGOTIATE_EXT_TOO_LONG", 20, 335},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
+ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR},
+ #else
+ {"RENEGOTIATION_ENCODING_ERR", 20, 336},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_MISMATCH
+ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
+ #else
+ {"RENEGOTIATION_MISMATCH", 20, 337},
+ #endif
+ #ifdef SSL_R_REQUEST_PENDING
+ {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING},
+ #else
+ {"REQUEST_PENDING", 20, 285},
+ #endif
+ #ifdef SSL_R_REQUEST_SENT
+ {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT},
+ #else
+ {"REQUEST_SENT", 20, 286},
+ #endif
+ #ifdef SSL_R_REQUIRED_CIPHER_MISSING
+ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
+ #else
+ {"REQUIRED_CIPHER_MISSING", 20, 215},
+ #endif
+ #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING},
+ #else
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342},
+ #endif
+ #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
+ #else
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345},
+ #endif
+ #ifdef SSL_R_SCT_VERIFICATION_FAILED
+ {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED},
+ #else
+ {"SCT_VERIFICATION_FAILED", 20, 208},
+ #endif
+ #ifdef SSL_R_SERVERHELLO_TLSEXT
+ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
+ #else
+ {"SERVERHELLO_TLSEXT", 20, 275},
+ #endif
+ #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
+ #else
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277},
+ #endif
+ #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT
+ {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT},
+ #else
+ {"SHUTDOWN_WHILE_IN_INIT", 20, 407},
+ #endif
+ #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR
+ {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR},
+ #else
+ {"SIGNATURE_ALGORITHMS_ERROR", 20, 360},
+ #endif
+ #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
+ #else
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220},
+ #endif
+ #ifdef SSL_R_SRP_A_CALC
+ {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC},
+ #else
+ {"SRP_A_CALC", 20, 361},
+ #endif
+ #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES},
+ #else
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362},
+ #endif
+ #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG},
+ #else
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363},
+ #endif
+ #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE},
+ #else
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH},
+ #else
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
+ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME", 20, 319},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320},
+ #endif
+ #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
+ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL3_SESSION_ID_TOO_LONG", 20, 300},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
+ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
+ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
+ #else
+ {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
+ #else
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
+ #else
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
+ #else
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
+ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
+ #else
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 20, 117},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125},
+ #endif
+ #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
+ #else
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228},
+ #endif
+ #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
+ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
+ #else
+ {"SSL_HANDSHAKE_FAILURE", 20, 229},
+ #endif
+ #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230},
+ #endif
+ #ifdef SSL_R_SSL_NEGATIVE_LENGTH
+ {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH},
+ #else
+ {"SSL_NEGATIVE_LENGTH", 20, 372},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 20, 126},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 20, 136},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
+ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
+ #else
+ {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
+ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
+ #else
+ {"SSL_SESSION_ID_CONFLICT", 20, 302},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
+ #else
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG
+ {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_TOO_LONG", 20, 408},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH
+ {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH},
+ #else
+ {"SSL_SESSION_VERSION_MISMATCH", 20, 210},
+ #endif
+ #ifdef SSL_R_STILL_IN_INIT
+ {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT},
+ #else
+ {"STILL_IN_INIT", 20, 121},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED},
+ #else
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION
+ {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION},
+ #else
+ {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
+ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED},
+ #else
+ {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
+ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR},
+ #else
+ {"TLSV1_ALERT_DECODE_ERROR", 20, 1050},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
+ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
+ #else
+ {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
+ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
+ #else
+ {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
+ #else
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK},
+ #else
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
+ #else
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
+ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
+ #else
+ {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
+ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
+ #else
+ {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
+ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
+ #else
+ {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
+ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
+ #else
+ {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
+ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
+ #else
+ {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
+ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED},
+ #else
+ {"TLSV1_ALERT_USER_CANCELLED", 20, 1090},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113},
+ #endif
+ #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
+ #else
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111},
+ #endif
+ #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
+ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
+ #else
+ {"TLSV1_UNRECOGNIZED_NAME", 20, 1112},
+ #endif
+ #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
+ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
+ #else
+ {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110},
+ #endif
+ #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT
+ {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT},
+ #else
+ {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", 20, 365},
+ #endif
+ #ifdef SSL_R_TLS_HEARTBEAT_PENDING
+ {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING},
+ #else
+ {"TLS_HEARTBEAT_PENDING", 20, 366},
+ #endif
+ #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL
+ {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL},
+ #else
+ {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367},
+ #endif
+ #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
+ #else
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157},
+ #endif
+ #ifdef SSL_R_TOO_MANY_KEY_UPDATES
+ {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES},
+ #else
+ {"TOO_MANY_KEY_UPDATES", 20, 132},
+ #endif
+ #ifdef SSL_R_TOO_MANY_WARN_ALERTS
+ {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS},
+ #else
+ {"TOO_MANY_WARN_ALERTS", 20, 409},
+ #endif
+ #ifdef SSL_R_TOO_MUCH_EARLY_DATA
+ {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA},
+ #else
+ {"TOO_MUCH_EARLY_DATA", 20, 164},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE
+ {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE},
+ #else
+ {"UNEXPECTED_CCS_MESSAGE", 20, 262},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA
+ {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA},
+ #else
+ {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_MESSAGE
+ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
+ #else
+ {"UNEXPECTED_MESSAGE", 20, 244},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_RECORD
+ {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
+ #else
+ {"UNEXPECTED_RECORD", 20, 245},
+ #endif
+ #ifdef SSL_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 20, 276},
+ #endif
+ #ifdef SSL_R_UNKNOWN_ALERT_TYPE
+ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
+ #else
+ {"UNKNOWN_ALERT_TYPE", 20, 246},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
+ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE},
+ #else
+ {"UNKNOWN_CERTIFICATE_TYPE", 20, 247},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
+ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
+ #else
+ {"UNKNOWN_CIPHER_RETURNED", 20, 248},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
+ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
+ #else
+ {"UNKNOWN_CIPHER_TYPE", 20, 249},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CMD_NAME
+ {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME},
+ #else
+ {"UNKNOWN_CMD_NAME", 20, 386},
+ #endif
+ #ifdef SSL_R_UNKNOWN_COMMAND
+ {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND},
+ #else
+ {"UNKNOWN_COMMAND", 20, 139},
+ #endif
+ #ifdef SSL_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 20, 368},
+ #endif
+ #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
+ #else
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PKEY_TYPE
+ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
+ #else
+ {"UNKNOWN_PKEY_TYPE", 20, 251},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PROTOCOL
+ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
+ #else
+ {"UNKNOWN_PROTOCOL", 20, 252},
+ #endif
+ #ifdef SSL_R_UNKNOWN_SSL_VERSION
+ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
+ #else
+ {"UNKNOWN_SSL_VERSION", 20, 254},
+ #endif
+ #ifdef SSL_R_UNKNOWN_STATE
+ {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
+ #else
+ {"UNKNOWN_STATE", 20, 255},
+ #endif
+ #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
+ #else
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338},
+ #endif
+ #ifdef SSL_R_UNSOLICITED_EXTENSION
+ {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION},
+ #else
+ {"UNSOLICITED_EXTENSION", 20, 217},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
+ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
+ #else
+ {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_PROTOCOL
+ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
+ #else
+ {"UNSUPPORTED_PROTOCOL", 20, 258},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
+ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
+ #else
+ {"UNSUPPORTED_SSL_VERSION", 20, 259},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
+ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
+ #else
+ {"UNSUPPORTED_STATUS_TYPE", 20, 329},
+ #endif
+ #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED
+ {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED},
+ #else
+ {"USE_SRTP_NOT_NEGOTIATED", 20, 369},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_HIGH
+ {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH},
+ #else
+ {"VERSION_TOO_HIGH", 20, 166},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_LOW
+ {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW},
+ #else
+ {"VERSION_TOO_LOW", 20, 396},
+ #endif
+ #ifdef SSL_R_WRONG_CERTIFICATE_TYPE
+ {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE},
+ #else
+ {"WRONG_CERTIFICATE_TYPE", 20, 383},
+ #endif
+ #ifdef SSL_R_WRONG_CIPHER_RETURNED
+ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
+ #else
+ {"WRONG_CIPHER_RETURNED", 20, 261},
+ #endif
+ #ifdef SSL_R_WRONG_CURVE
+ {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE},
+ #else
+ {"WRONG_CURVE", 20, 378},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 20, 264},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_SIZE
+ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
+ #else
+ {"WRONG_SIGNATURE_SIZE", 20, 265},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_TYPE
+ {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE},
+ #else
+ {"WRONG_SIGNATURE_TYPE", 20, 370},
+ #endif
+ #ifdef SSL_R_WRONG_SSL_VERSION
+ {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
+ #else
+ {"WRONG_SSL_VERSION", 20, 266},
+ #endif
+ #ifdef SSL_R_WRONG_VERSION_NUMBER
+ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
+ #else
+ {"WRONG_VERSION_NUMBER", 20, 267},
+ #endif
+ #ifdef SSL_R_X509_LIB
+ {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
+ #else
+ {"X509_LIB", 20, 268},
+ #endif
+ #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
+ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
+ #else
+ {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269},
+ #endif
+ #ifdef TS_R_BAD_PKCS7_TYPE
+ {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE},
+ #else
+ {"BAD_PKCS7_TYPE", 47, 132},
+ #endif
+ #ifdef TS_R_BAD_TYPE
+ {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE},
+ #else
+ {"BAD_TYPE", 47, 133},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_CERT
+ {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT},
+ #else
+ {"CANNOT_LOAD_CERT", 47, 137},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_KEY
+ {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY},
+ #else
+ {"CANNOT_LOAD_KEY", 47, 138},
+ #endif
+ #ifdef TS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 47, 100},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_ENGINE
+ {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE},
+ #else
+ {"COULD_NOT_SET_ENGINE", 47, 127},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_TIME
+ {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME},
+ #else
+ {"COULD_NOT_SET_TIME", 47, 115},
+ #endif
+ #ifdef TS_R_DETACHED_CONTENT
+ {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT},
+ #else
+ {"DETACHED_CONTENT", 47, 134},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR
+ {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139},
+ #endif
+ #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR
+ {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+ #else
+ {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101},
+ #endif
+ #ifdef TS_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 47, 102},
+ #endif
+ #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE},
+ #else
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117},
+ #endif
+ #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH
+ {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH},
+ #else
+ {"MESSAGE_IMPRINT_MISMATCH", 47, 103},
+ #endif
+ #ifdef TS_R_NONCE_MISMATCH
+ {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH},
+ #else
+ {"NONCE_MISMATCH", 47, 104},
+ #endif
+ #ifdef TS_R_NONCE_NOT_RETURNED
+ {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED},
+ #else
+ {"NONCE_NOT_RETURNED", 47, 105},
+ #endif
+ #ifdef TS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 47, 106},
+ #endif
+ #ifdef TS_R_NO_TIME_STAMP_TOKEN
+ {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN},
+ #else
+ {"NO_TIME_STAMP_TOKEN", 47, 107},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119},
+ #endif
+ #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED
+ {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED},
+ #else
+ {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129},
+ #endif
+ #ifdef TS_R_POLICY_MISMATCH
+ {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH},
+ #else
+ {"POLICY_MISMATCH", 47, 108},
+ #endif
+ #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120},
+ #endif
+ #ifdef TS_R_RESPONSE_SETUP_ERROR
+ {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR},
+ #else
+ {"RESPONSE_SETUP_ERROR", 47, 121},
+ #endif
+ #ifdef TS_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 47, 109},
+ #endif
+ #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER
+ {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER},
+ #else
+ {"THERE_MUST_BE_ONE_SIGNER", 47, 110},
+ #endif
+ #ifdef TS_R_TIME_SYSCALL_ERROR
+ {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR},
+ #else
+ {"TIME_SYSCALL_ERROR", 47, 122},
+ #endif
+ #ifdef TS_R_TOKEN_NOT_PRESENT
+ {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT},
+ #else
+ {"TOKEN_NOT_PRESENT", 47, 130},
+ #endif
+ #ifdef TS_R_TOKEN_PRESENT
+ {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT},
+ #else
+ {"TOKEN_PRESENT", 47, 131},
+ #endif
+ #ifdef TS_R_TSA_NAME_MISMATCH
+ {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH},
+ #else
+ {"TSA_NAME_MISMATCH", 47, 111},
+ #endif
+ #ifdef TS_R_TSA_UNTRUSTED
+ {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED},
+ #else
+ {"TSA_UNTRUSTED", 47, 112},
+ #endif
+ #ifdef TS_R_TST_INFO_SETUP_ERROR
+ {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR},
+ #else
+ {"TST_INFO_SETUP_ERROR", 47, 123},
+ #endif
+ #ifdef TS_R_TS_DATASIGN
+ {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN},
+ #else
+ {"TS_DATASIGN", 47, 124},
+ #endif
+ #ifdef TS_R_UNACCEPTABLE_POLICY
+ {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY},
+ #else
+ {"UNACCEPTABLE_POLICY", 47, 125},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM
+ {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MD_ALGORITHM", 47, 126},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 47, 113},
+ #endif
+ #ifdef TS_R_VAR_BAD_VALUE
+ {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE},
+ #else
+ {"VAR_BAD_VALUE", 47, 135},
+ #endif
+ #ifdef TS_R_VAR_LOOKUP_FAILURE
+ {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE},
+ #else
+ {"VAR_LOOKUP_FAILURE", 47, 136},
+ #endif
+ #ifdef TS_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 47, 114},
+ #endif
+ #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS},
+ #else
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104},
+ #endif
+ #ifdef UI_R_INDEX_TOO_LARGE
+ {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE},
+ #else
+ {"INDEX_TOO_LARGE", 40, 102},
+ #endif
+ #ifdef UI_R_INDEX_TOO_SMALL
+ {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL},
+ #else
+ {"INDEX_TOO_SMALL", 40, 103},
+ #endif
+ #ifdef UI_R_NO_RESULT_BUFFER
+ {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER},
+ #else
+ {"NO_RESULT_BUFFER", 40, 105},
+ #endif
+ #ifdef UI_R_PROCESSING_ERROR
+ {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR},
+ #else
+ {"PROCESSING_ERROR", 40, 107},
+ #endif
+ #ifdef UI_R_RESULT_TOO_LARGE
+ {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE},
+ #else
+ {"RESULT_TOO_LARGE", 40, 100},
+ #endif
+ #ifdef UI_R_RESULT_TOO_SMALL
+ {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL},
+ #else
+ {"RESULT_TOO_SMALL", 40, 101},
+ #endif
+ #ifdef UI_R_SYSASSIGN_ERROR
+ {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR},
+ #else
+ {"SYSASSIGN_ERROR", 40, 109},
+ #endif
+ #ifdef UI_R_SYSDASSGN_ERROR
+ {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR},
+ #else
+ {"SYSDASSGN_ERROR", 40, 110},
+ #endif
+ #ifdef UI_R_SYSQIOW_ERROR
+ {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR},
+ #else
+ {"SYSQIOW_ERROR", 40, 111},
+ #endif
+ #ifdef UI_R_UNKNOWN_CONTROL_COMMAND
+ {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND},
+ #else
+ {"UNKNOWN_CONTROL_COMMAND", 40, 106},
+ #endif
+ #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE},
+ #else
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108},
+ #endif
+ #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED},
+ #else
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112},
+ #endif
+ #ifdef X509V3_R_BAD_IP_ADDRESS
+ {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS},
+ #else
+ {"BAD_IP_ADDRESS", 34, 118},
+ #endif
+ #ifdef X509V3_R_BAD_OBJECT
+ {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT},
+ #else
+ {"BAD_OBJECT", 34, 119},
+ #endif
+ #ifdef X509V3_R_BN_DEC2BN_ERROR
+ {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR},
+ #else
+ {"BN_DEC2BN_ERROR", 34, 100},
+ #endif
+ #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR
+ {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR},
+ #else
+ {"BN_TO_ASN1_INTEGER_ERROR", 34, 101},
+ #endif
+ #ifdef X509V3_R_DIRNAME_ERROR
+ {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR},
+ #else
+ {"DIRNAME_ERROR", 34, 149},
+ #endif
+ #ifdef X509V3_R_DISTPOINT_ALREADY_SET
+ {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET},
+ #else
+ {"DISTPOINT_ALREADY_SET", 34, 160},
+ #endif
+ #ifdef X509V3_R_DUPLICATE_ZONE_ID
+ {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID},
+ #else
+ {"DUPLICATE_ZONE_ID", 34, 133},
+ #endif
+ #ifdef X509V3_R_ERROR_CONVERTING_ZONE
+ {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE},
+ #else
+ {"ERROR_CONVERTING_ZONE", 34, 131},
+ #endif
+ #ifdef X509V3_R_ERROR_CREATING_EXTENSION
+ {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION},
+ #else
+ {"ERROR_CREATING_EXTENSION", 34, 144},
+ #endif
+ #ifdef X509V3_R_ERROR_IN_EXTENSION
+ {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION},
+ #else
+ {"ERROR_IN_EXTENSION", 34, 128},
+ #endif
+ #ifdef X509V3_R_EXPECTED_A_SECTION_NAME
+ {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME},
+ #else
+ {"EXPECTED_A_SECTION_NAME", 34, 137},
+ #endif
+ #ifdef X509V3_R_EXTENSION_EXISTS
+ {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS},
+ #else
+ {"EXTENSION_EXISTS", 34, 145},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NAME_ERROR
+ {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR},
+ #else
+ {"EXTENSION_NAME_ERROR", 34, 115},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NOT_FOUND
+ {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND},
+ #else
+ {"EXTENSION_NOT_FOUND", 34, 102},
+ #endif
+ #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
+ {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED},
+ #else
+ {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103},
+ #endif
+ #ifdef X509V3_R_EXTENSION_VALUE_ERROR
+ {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR},
+ #else
+ {"EXTENSION_VALUE_ERROR", 34, 116},
+ #endif
+ #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION
+ {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION},
+ #else
+ {"ILLEGAL_EMPTY_EXTENSION", 34, 151},
+ #endif
+ #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG
+ {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG},
+ #else
+ {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152},
+ #endif
+ #ifdef X509V3_R_INVALID_ASNUMBER
+ {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER},
+ #else
+ {"INVALID_ASNUMBER", 34, 162},
+ #endif
+ #ifdef X509V3_R_INVALID_ASRANGE
+ {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE},
+ #else
+ {"INVALID_ASRANGE", 34, 163},
+ #endif
+ #ifdef X509V3_R_INVALID_BOOLEAN_STRING
+ {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING},
+ #else
+ {"INVALID_BOOLEAN_STRING", 34, 104},
+ #endif
+ #ifdef X509V3_R_INVALID_EXTENSION_STRING
+ {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING},
+ #else
+ {"INVALID_EXTENSION_STRING", 34, 105},
+ #endif
+ #ifdef X509V3_R_INVALID_INHERITANCE
+ {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE},
+ #else
+ {"INVALID_INHERITANCE", 34, 165},
+ #endif
+ #ifdef X509V3_R_INVALID_IPADDRESS
+ {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS},
+ #else
+ {"INVALID_IPADDRESS", 34, 166},
+ #endif
+ #ifdef X509V3_R_INVALID_MULTIPLE_RDNS
+ {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS},
+ #else
+ {"INVALID_MULTIPLE_RDNS", 34, 161},
+ #endif
+ #ifdef X509V3_R_INVALID_NAME
+ {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME},
+ #else
+ {"INVALID_NAME", 34, 106},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 34, 107},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_NAME
+ {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME},
+ #else
+ {"INVALID_NULL_NAME", 34, 108},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_VALUE
+ {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE},
+ #else
+ {"INVALID_NULL_VALUE", 34, 109},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 34, 140},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBERS
+ {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS},
+ #else
+ {"INVALID_NUMBERS", 34, 141},
+ #endif
+ #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER
+ {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER},
+ #else
+ {"INVALID_OBJECT_IDENTIFIER", 34, 110},
+ #endif
+ #ifdef X509V3_R_INVALID_OPTION
+ {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION},
+ #else
+ {"INVALID_OPTION", 34, 138},
+ #endif
+ #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER
+ {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER},
+ #else
+ {"INVALID_POLICY_IDENTIFIER", 34, 134},
+ #endif
+ #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING
+ {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING},
+ #else
+ {"INVALID_PROXY_POLICY_SETTING", 34, 153},
+ #endif
+ #ifdef X509V3_R_INVALID_PURPOSE
+ {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE},
+ #else
+ {"INVALID_PURPOSE", 34, 146},
+ #endif
+ #ifdef X509V3_R_INVALID_SAFI
+ {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI},
+ #else
+ {"INVALID_SAFI", 34, 164},
+ #endif
+ #ifdef X509V3_R_INVALID_SECTION
+ {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION},
+ #else
+ {"INVALID_SECTION", 34, 135},
+ #endif
+ #ifdef X509V3_R_INVALID_SYNTAX
+ {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX},
+ #else
+ {"INVALID_SYNTAX", 34, 143},
+ #endif
+ #ifdef X509V3_R_ISSUER_DECODE_ERROR
+ {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR},
+ #else
+ {"ISSUER_DECODE_ERROR", 34, 126},
+ #endif
+ #ifdef X509V3_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 34, 124},
+ #endif
+ #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS
+ {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS},
+ #else
+ {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142},
+ #endif
+ #ifdef X509V3_R_NO_CONFIG_DATABASE
+ {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE},
+ #else
+ {"NO_CONFIG_DATABASE", 34, 136},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_CERTIFICATE
+ {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE},
+ #else
+ {"NO_ISSUER_CERTIFICATE", 34, 121},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_DETAILS
+ {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS},
+ #else
+ {"NO_ISSUER_DETAILS", 34, 127},
+ #endif
+ #ifdef X509V3_R_NO_POLICY_IDENTIFIER
+ {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER},
+ #else
+ {"NO_POLICY_IDENTIFIER", 34, 139},
+ #endif
+ #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED},
+ #else
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154},
+ #endif
+ #ifdef X509V3_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 34, 114},
+ #endif
+ #ifdef X509V3_R_NO_SUBJECT_DETAILS
+ {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS},
+ #else
+ {"NO_SUBJECT_DETAILS", 34, 125},
+ #endif
+ #ifdef X509V3_R_OPERATION_NOT_DEFINED
+ {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED},
+ #else
+ {"OPERATION_NOT_DEFINED", 34, 148},
+ #endif
+ #ifdef X509V3_R_OTHERNAME_ERROR
+ {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR},
+ #else
+ {"OTHERNAME_ERROR", 34, 147},
+ #endif
+ #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED},
+ #else
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH
+ {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH},
+ #else
+ {"POLICY_PATH_LENGTH", 34, 156},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED},
+ #else
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157},
+ #endif
+ #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY},
+ #else
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159},
+ #endif
+ #ifdef X509V3_R_SECTION_NOT_FOUND
+ {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND},
+ #else
+ {"SECTION_NOT_FOUND", 34, 150},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS
+ {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS},
+ #else
+ {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID
+ {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID},
+ #else
+ {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT
+ {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT},
+ #else
+ {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION
+ {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION},
+ #else
+ {"UNKNOWN_EXTENSION", 34, 129},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME
+ {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME},
+ #else
+ {"UNKNOWN_EXTENSION_NAME", 34, 130},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 34, 120},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_OPTION
+ {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION},
+ #else
+ {"UNSUPPORTED_OPTION", 34, 117},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 34, 167},
+ #endif
+ #ifdef X509V3_R_USER_TOO_LONG
+ {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG},
+ #else
+ {"USER_TOO_LONG", 34, 132},
+ #endif
+ #ifdef X509_R_AKID_MISMATCH
+ {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH},
+ #else
+ {"AKID_MISMATCH", 11, 110},
+ #endif
+ #ifdef X509_R_BAD_SELECTOR
+ {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR},
+ #else
+ {"BAD_SELECTOR", 11, 133},
+ #endif
+ #ifdef X509_R_BAD_X509_FILETYPE
+ {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
+ #else
+ {"BAD_X509_FILETYPE", 11, 100},
+ #endif
+ #ifdef X509_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 11, 118},
+ #endif
+ #ifdef X509_R_CANT_CHECK_DH_KEY
+ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
+ #else
+ {"CANT_CHECK_DH_KEY", 11, 114},
+ #endif
+ #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
+ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE},
+ #else
+ {"CERT_ALREADY_IN_HASH_TABLE", 11, 101},
+ #endif
+ #ifdef X509_R_CRL_ALREADY_DELTA
+ {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA},
+ #else
+ {"CRL_ALREADY_DELTA", 11, 127},
+ #endif
+ #ifdef X509_R_CRL_VERIFY_FAILURE
+ {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE},
+ #else
+ {"CRL_VERIFY_FAILURE", 11, 131},
+ #endif
+ #ifdef X509_R_IDP_MISMATCH
+ {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH},
+ #else
+ {"IDP_MISMATCH", 11, 128},
+ #endif
+ #ifdef X509_R_INVALID_ATTRIBUTES
+ {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES},
+ #else
+ {"INVALID_ATTRIBUTES", 11, 138},
+ #endif
+ #ifdef X509_R_INVALID_DIRECTORY
+ {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
+ #else
+ {"INVALID_DIRECTORY", 11, 113},
+ #endif
+ #ifdef X509_R_INVALID_FIELD_NAME
+ {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
+ #else
+ {"INVALID_FIELD_NAME", 11, 119},
+ #endif
+ #ifdef X509_R_INVALID_TRUST
+ {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
+ #else
+ {"INVALID_TRUST", 11, 123},
+ #endif
+ #ifdef X509_R_ISSUER_MISMATCH
+ {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH},
+ #else
+ {"ISSUER_MISMATCH", 11, 129},
+ #endif
+ #ifdef X509_R_KEY_TYPE_MISMATCH
+ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
+ #else
+ {"KEY_TYPE_MISMATCH", 11, 115},
+ #endif
+ #ifdef X509_R_KEY_VALUES_MISMATCH
+ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
+ #else
+ {"KEY_VALUES_MISMATCH", 11, 116},
+ #endif
+ #ifdef X509_R_LOADING_CERT_DIR
+ {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
+ #else
+ {"LOADING_CERT_DIR", 11, 103},
+ #endif
+ #ifdef X509_R_LOADING_DEFAULTS
+ {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
+ #else
+ {"LOADING_DEFAULTS", 11, 104},
+ #endif
+ #ifdef X509_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 11, 124},
+ #endif
+ #ifdef X509_R_NAME_TOO_LONG
+ {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG},
+ #else
+ {"NAME_TOO_LONG", 11, 134},
+ #endif
+ #ifdef X509_R_NEWER_CRL_NOT_NEWER
+ {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER},
+ #else
+ {"NEWER_CRL_NOT_NEWER", 11, 132},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_FOUND
+ {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND},
+ #else
+ {"NO_CERTIFICATE_FOUND", 11, 135},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND
+ {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND},
+ #else
+ {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136},
+ #endif
+ #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
+ #else
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105},
+ #endif
+ #ifdef X509_R_NO_CRL_FOUND
+ {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND},
+ #else
+ {"NO_CRL_FOUND", 11, 137},
+ #endif
+ #ifdef X509_R_NO_CRL_NUMBER
+ {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER},
+ #else
+ {"NO_CRL_NUMBER", 11, 130},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
+ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR},
+ #else
+ {"PUBLIC_KEY_DECODE_ERROR", 11, 125},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
+ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR},
+ #else
+ {"PUBLIC_KEY_ENCODE_ERROR", 11, 126},
+ #endif
+ #ifdef X509_R_SHOULD_RETRY
+ {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
+ #else
+ {"SHOULD_RETRY", 11, 106},
+ #endif
+ #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
+ #else
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107},
+ #endif
+ #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
+ #else
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108},
+ #endif
+ #ifdef X509_R_UNKNOWN_KEY_TYPE
+ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
+ #else
+ {"UNKNOWN_KEY_TYPE", 11, 117},
+ #endif
+ #ifdef X509_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 11, 109},
+ #endif
+ #ifdef X509_R_UNKNOWN_PURPOSE_ID
+ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
+ #else
+ {"UNKNOWN_PURPOSE_ID", 11, 121},
+ #endif
+ #ifdef X509_R_UNKNOWN_TRUST_ID
+ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
+ #else
+ {"UNKNOWN_TRUST_ID", 11, 120},
+ #endif
+ #ifdef X509_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 11, 111},
+ #endif
+ #ifdef X509_R_WRONG_LOOKUP_TYPE
+ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
+ #else
+ {"WRONG_LOOKUP_TYPE", 11, 112},
+ #endif
+ #ifdef X509_R_WRONG_TYPE
+ {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
+ #else
+ {"WRONG_TYPE", 11, 122},
+ #endif
+ { NULL }
+};
+
diff --git a/contrib/tools/python3/Modules/_ssl_data_300.h b/contrib/tools/python3/Modules/_ssl_data_300.h
new file mode 100644
index 00000000000..dc66731f6b6
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl_data_300.h
@@ -0,0 +1,8585 @@
+/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2023-06-01T03:03:52.163218 */
+static struct py_ssl_library_code library_codes[] = {
+#ifdef ERR_LIB_ASN1
+ {"ASN1", ERR_LIB_ASN1},
+#endif
+#ifdef ERR_LIB_ASYNC
+ {"ASYNC", ERR_LIB_ASYNC},
+#endif
+#ifdef ERR_LIB_BIO
+ {"BIO", ERR_LIB_BIO},
+#endif
+#ifdef ERR_LIB_BN
+ {"BN", ERR_LIB_BN},
+#endif
+#ifdef ERR_LIB_BUF
+ {"BUF", ERR_LIB_BUF},
+#endif
+#ifdef ERR_LIB_CMP
+ {"CMP", ERR_LIB_CMP},
+#endif
+#ifdef ERR_LIB_CMS
+ {"CMS", ERR_LIB_CMS},
+#endif
+#ifdef ERR_LIB_COMP
+ {"COMP", ERR_LIB_COMP},
+#endif
+#ifdef ERR_LIB_CONF
+ {"CONF", ERR_LIB_CONF},
+#endif
+#ifdef ERR_LIB_CRMF
+ {"CRMF", ERR_LIB_CRMF},
+#endif
+#ifdef ERR_LIB_CRYPTO
+ {"CRYPTO", ERR_LIB_CRYPTO},
+#endif
+#ifdef ERR_LIB_CT
+ {"CT", ERR_LIB_CT},
+#endif
+#ifdef ERR_LIB_DH
+ {"DH", ERR_LIB_DH},
+#endif
+#ifdef ERR_LIB_DSA
+ {"DSA", ERR_LIB_DSA},
+#endif
+#ifdef ERR_LIB_DSO
+ {"DSO", ERR_LIB_DSO},
+#endif
+#ifdef ERR_LIB_EC
+ {"EC", ERR_LIB_EC},
+#endif
+#ifdef ERR_LIB_ECDH
+ {"ECDH", ERR_LIB_ECDH},
+#endif
+#ifdef ERR_LIB_ECDSA
+ {"ECDSA", ERR_LIB_ECDSA},
+#endif
+#ifdef ERR_LIB_ENGINE
+ {"ENGINE", ERR_LIB_ENGINE},
+#endif
+#ifdef ERR_LIB_ESS
+ {"ESS", ERR_LIB_ESS},
+#endif
+#ifdef ERR_LIB_EVP
+ {"EVP", ERR_LIB_EVP},
+#endif
+#ifdef ERR_LIB_FIPS
+ {"FIPS", ERR_LIB_FIPS},
+#endif
+#ifdef ERR_LIB_HMAC
+ {"HMAC", ERR_LIB_HMAC},
+#endif
+#ifdef ERR_LIB_HTTP
+ {"HTTP", ERR_LIB_HTTP},
+#endif
+#ifdef ERR_LIB_JPAKE
+ {"JPAKE", ERR_LIB_JPAKE},
+#endif
+#ifdef ERR_LIB_KDF
+ {"KDF", ERR_LIB_KDF},
+#endif
+#ifdef ERR_LIB_MASK
+ {"MASK", ERR_LIB_MASK},
+#endif
+#ifdef ERR_LIB_METH
+ {"METH", ERR_LIB_METH},
+#endif
+#ifdef ERR_LIB_NONE
+ {"NONE", ERR_LIB_NONE},
+#endif
+#ifdef ERR_LIB_OBJ
+ {"OBJ", ERR_LIB_OBJ},
+#endif
+#ifdef ERR_LIB_OCSP
+ {"OCSP", ERR_LIB_OCSP},
+#endif
+#ifdef ERR_LIB_OFFSET
+ {"OFFSET", ERR_LIB_OFFSET},
+#endif
+#ifdef ERR_LIB_OSSL_DECODER
+ {"OSSL_DECODER", ERR_LIB_OSSL_DECODER},
+#endif
+#ifdef ERR_LIB_OSSL_ENCODER
+ {"OSSL_ENCODER", ERR_LIB_OSSL_ENCODER},
+#endif
+#ifdef ERR_LIB_OSSL_STORE
+ {"OSSL_STORE", ERR_LIB_OSSL_STORE},
+#endif
+#ifdef ERR_LIB_PEM
+ {"PEM", ERR_LIB_PEM},
+#endif
+#ifdef ERR_LIB_PKCS12
+ {"PKCS12", ERR_LIB_PKCS12},
+#endif
+#ifdef ERR_LIB_PKCS7
+ {"PKCS7", ERR_LIB_PKCS7},
+#endif
+#ifdef ERR_LIB_PROP
+ {"PROP", ERR_LIB_PROP},
+#endif
+#ifdef ERR_LIB_PROV
+ {"PROV", ERR_LIB_PROV},
+#endif
+#ifdef ERR_LIB_PROXY
+ {"PROXY", ERR_LIB_PROXY},
+#endif
+#ifdef ERR_LIB_RAND
+ {"RAND", ERR_LIB_RAND},
+#endif
+#ifdef ERR_LIB_RSA
+ {"RSA", ERR_LIB_RSA},
+#endif
+#ifdef ERR_LIB_RSAREF
+ {"RSAREF", ERR_LIB_RSAREF},
+#endif
+#ifdef ERR_LIB_SM2
+ {"SM2", ERR_LIB_SM2},
+#endif
+#ifdef ERR_LIB_SSL
+ {"SSL", ERR_LIB_SSL},
+#endif
+#ifdef ERR_LIB_SSL2
+ {"SSL2", ERR_LIB_SSL2},
+#endif
+#ifdef ERR_LIB_SSL23
+ {"SSL23", ERR_LIB_SSL23},
+#endif
+#ifdef ERR_LIB_SSL3
+ {"SSL3", ERR_LIB_SSL3},
+#endif
+#ifdef ERR_LIB_SYS
+ {"SYS", ERR_LIB_SYS},
+#endif
+#ifdef ERR_LIB_TS
+ {"TS", ERR_LIB_TS},
+#endif
+#ifdef ERR_LIB_UI
+ {"UI", ERR_LIB_UI},
+#endif
+#ifdef ERR_LIB_USER
+ {"USER", ERR_LIB_USER},
+#endif
+#ifdef ERR_LIB_X509
+ {"X509", ERR_LIB_X509},
+#endif
+#ifdef ERR_LIB_X509V3
+ {"X509V3", ERR_LIB_X509V3},
+#endif
+ { NULL }
+};
+
+
+static struct py_ssl_error_code error_codes[] = {
+ #ifdef ASN1_R_ADDING_OBJECT
+ {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
+ #else
+ {"ADDING_OBJECT", 13, 171},
+ #endif
+ #ifdef ASN1_R_ASN1_PARSE_ERROR
+ {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR},
+ #else
+ {"ASN1_PARSE_ERROR", 13, 203},
+ #endif
+ #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR
+ {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR},
+ #else
+ {"ASN1_SIG_PARSE_ERROR", 13, 204},
+ #endif
+ #ifdef ASN1_R_AUX_ERROR
+ {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR},
+ #else
+ {"AUX_ERROR", 13, 100},
+ #endif
+ #ifdef ASN1_R_BAD_OBJECT_HEADER
+ {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER},
+ #else
+ {"BAD_OBJECT_HEADER", 13, 102},
+ #endif
+ #ifdef ASN1_R_BAD_TEMPLATE
+ {"BAD_TEMPLATE", ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE},
+ #else
+ {"BAD_TEMPLATE", 13, 230},
+ #endif
+ #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH
+ {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH},
+ #else
+ {"BMPSTRING_IS_WRONG_LENGTH", 13, 214},
+ #endif
+ #ifdef ASN1_R_BN_LIB
+ {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB},
+ #else
+ {"BN_LIB", 13, 105},
+ #endif
+ #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH
+ {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH},
+ #else
+ {"BOOLEAN_IS_WRONG_LENGTH", 13, 106},
+ #endif
+ #ifdef ASN1_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 13, 107},
+ #endif
+ #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108},
+ #endif
+ #ifdef ASN1_R_CONTEXT_NOT_INITIALISED
+ {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED},
+ #else
+ {"CONTEXT_NOT_INITIALISED", 13, 217},
+ #endif
+ #ifdef ASN1_R_DATA_IS_WRONG
+ {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG},
+ #else
+ {"DATA_IS_WRONG", 13, 109},
+ #endif
+ #ifdef ASN1_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 13, 110},
+ #endif
+ #ifdef ASN1_R_DEPTH_EXCEEDED
+ {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED},
+ #else
+ {"DEPTH_EXCEEDED", 13, 174},
+ #endif
+ #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED},
+ #else
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198},
+ #endif
+ #ifdef ASN1_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 13, 112},
+ #endif
+ #ifdef ASN1_R_ERROR_GETTING_TIME
+ {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME},
+ #else
+ {"ERROR_GETTING_TIME", 13, 173},
+ #endif
+ #ifdef ASN1_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 13, 172},
+ #endif
+ #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS
+ {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS},
+ #else
+ {"ERROR_SETTING_CIPHER_PARAMS", 13, 114},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_INTEGER
+ {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER},
+ #else
+ {"EXPECTING_AN_INTEGER", 13, 115},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_OBJECT
+ {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT},
+ #else
+ {"EXPECTING_AN_OBJECT", 13, 116},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH
+ {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH},
+ #else
+ {"EXPLICIT_LENGTH_MISMATCH", 13, 119},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED},
+ #else
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120},
+ #endif
+ #ifdef ASN1_R_FIELD_MISSING
+ {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING},
+ #else
+ {"FIELD_MISSING", 13, 121},
+ #endif
+ #ifdef ASN1_R_FIRST_NUM_TOO_LARGE
+ {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE},
+ #else
+ {"FIRST_NUM_TOO_LARGE", 13, 122},
+ #endif
+ #ifdef ASN1_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 13, 123},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT
+ {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT},
+ #else
+ {"ILLEGAL_BITSTRING_FORMAT", 13, 175},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BOOLEAN
+ {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN},
+ #else
+ {"ILLEGAL_BOOLEAN", 13, 176},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_CHARACTERS
+ {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS},
+ #else
+ {"ILLEGAL_CHARACTERS", 13, 124},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_FORMAT
+ {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT},
+ #else
+ {"ILLEGAL_FORMAT", 13, 177},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_HEX
+ {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX},
+ #else
+ {"ILLEGAL_HEX", 13, 178},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG
+ {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG},
+ #else
+ {"ILLEGAL_IMPLICIT_TAG", 13, 179},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_INTEGER
+ {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER},
+ #else
+ {"ILLEGAL_INTEGER", 13, 180},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE
+ {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE},
+ #else
+ {"ILLEGAL_NEGATIVE_VALUE", 13, 226},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING
+ {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING},
+ #else
+ {"ILLEGAL_NESTED_TAGGING", 13, 181},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL
+ {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL},
+ #else
+ {"ILLEGAL_NULL", 13, 125},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL_VALUE
+ {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE},
+ #else
+ {"ILLEGAL_NULL_VALUE", 13, 182},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OBJECT
+ {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT},
+ #else
+ {"ILLEGAL_OBJECT", 13, 183},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY
+ {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY},
+ #else
+ {"ILLEGAL_OPTIONAL_ANY", 13, 126},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE},
+ #else
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_PADDING
+ {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING},
+ #else
+ {"ILLEGAL_PADDING", 13, 221},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TAGGED_ANY
+ {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY},
+ #else
+ {"ILLEGAL_TAGGED_ANY", 13, 127},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TIME_VALUE
+ {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE},
+ #else
+ {"ILLEGAL_TIME_VALUE", 13, 184},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT
+ {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT},
+ #else
+ {"ILLEGAL_ZERO_CONTENT", 13, 222},
+ #endif
+ #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT
+ {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT},
+ #else
+ {"INTEGER_NOT_ASCII_FORMAT", 13, 185},
+ #endif
+ #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG
+ {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG},
+ #else
+ {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128},
+ #endif
+ #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT
+ {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT},
+ #else
+ {"INVALID_BIT_STRING_BITS_LEFT", 13, 220},
+ #endif
+ #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH
+ {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH},
+ #else
+ {"INVALID_BMPSTRING_LENGTH", 13, 129},
+ #endif
+ #ifdef ASN1_R_INVALID_DIGIT
+ {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT},
+ #else
+ {"INVALID_DIGIT", 13, 130},
+ #endif
+ #ifdef ASN1_R_INVALID_MIME_TYPE
+ {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE},
+ #else
+ {"INVALID_MIME_TYPE", 13, 205},
+ #endif
+ #ifdef ASN1_R_INVALID_MODIFIER
+ {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER},
+ #else
+ {"INVALID_MODIFIER", 13, 186},
+ #endif
+ #ifdef ASN1_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 13, 187},
+ #endif
+ #ifdef ASN1_R_INVALID_OBJECT_ENCODING
+ {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING},
+ #else
+ {"INVALID_OBJECT_ENCODING", 13, 216},
+ #endif
+ #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS
+ {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS},
+ #else
+ {"INVALID_SCRYPT_PARAMETERS", 13, 227},
+ #endif
+ #ifdef ASN1_R_INVALID_SEPARATOR
+ {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR},
+ #else
+ {"INVALID_SEPARATOR", 13, 131},
+ #endif
+ #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE
+ {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE},
+ #else
+ {"INVALID_STRING_TABLE_VALUE", 13, 218},
+ #endif
+ #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH
+ {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH},
+ #else
+ {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133},
+ #endif
+ #ifdef ASN1_R_INVALID_UTF8STRING
+ {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING},
+ #else
+ {"INVALID_UTF8STRING", 13, 134},
+ #endif
+ #ifdef ASN1_R_INVALID_VALUE
+ {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE},
+ #else
+ {"INVALID_VALUE", 13, 219},
+ #endif
+ #ifdef ASN1_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 13, 231},
+ #endif
+ #ifdef ASN1_R_LIST_ERROR
+ {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR},
+ #else
+ {"LIST_ERROR", 13, 188},
+ #endif
+ #ifdef ASN1_R_MIME_NO_CONTENT_TYPE
+ {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE},
+ #else
+ {"MIME_NO_CONTENT_TYPE", 13, 206},
+ #endif
+ #ifdef ASN1_R_MIME_PARSE_ERROR
+ {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR},
+ #else
+ {"MIME_PARSE_ERROR", 13, 207},
+ #endif
+ #ifdef ASN1_R_MIME_SIG_PARSE_ERROR
+ {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR},
+ #else
+ {"MIME_SIG_PARSE_ERROR", 13, 208},
+ #endif
+ #ifdef ASN1_R_MISSING_EOC
+ {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC},
+ #else
+ {"MISSING_EOC", 13, 137},
+ #endif
+ #ifdef ASN1_R_MISSING_SECOND_NUMBER
+ {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER},
+ #else
+ {"MISSING_SECOND_NUMBER", 13, 138},
+ #endif
+ #ifdef ASN1_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 13, 189},
+ #endif
+ #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL
+ {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL},
+ #else
+ {"MSTRING_NOT_UNIVERSAL", 13, 139},
+ #endif
+ #ifdef ASN1_R_MSTRING_WRONG_TAG
+ {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG},
+ #else
+ {"MSTRING_WRONG_TAG", 13, 140},
+ #endif
+ #ifdef ASN1_R_NESTED_ASN1_STRING
+ {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING},
+ #else
+ {"NESTED_ASN1_STRING", 13, 197},
+ #endif
+ #ifdef ASN1_R_NESTED_TOO_DEEP
+ {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP},
+ #else
+ {"NESTED_TOO_DEEP", 13, 201},
+ #endif
+ #ifdef ASN1_R_NON_HEX_CHARACTERS
+ {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS},
+ #else
+ {"NON_HEX_CHARACTERS", 13, 141},
+ #endif
+ #ifdef ASN1_R_NOT_ASCII_FORMAT
+ {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT},
+ #else
+ {"NOT_ASCII_FORMAT", 13, 190},
+ #endif
+ #ifdef ASN1_R_NOT_ENOUGH_DATA
+ {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA},
+ #else
+ {"NOT_ENOUGH_DATA", 13, 142},
+ #endif
+ #ifdef ASN1_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 13, 209},
+ #endif
+ #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE
+ {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE},
+ #else
+ {"NO_MATCHING_CHOICE_TYPE", 13, 143},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE
+ {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE},
+ #else
+ {"NO_MULTIPART_BODY_FAILURE", 13, 210},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BOUNDARY
+ {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY},
+ #else
+ {"NO_MULTIPART_BOUNDARY", 13, 211},
+ #endif
+ #ifdef ASN1_R_NO_SIG_CONTENT_TYPE
+ {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE},
+ #else
+ {"NO_SIG_CONTENT_TYPE", 13, 212},
+ #endif
+ #ifdef ASN1_R_NULL_IS_WRONG_LENGTH
+ {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH},
+ #else
+ {"NULL_IS_WRONG_LENGTH", 13, 144},
+ #endif
+ #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT
+ {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT},
+ #else
+ {"OBJECT_NOT_ASCII_FORMAT", 13, 191},
+ #endif
+ #ifdef ASN1_R_ODD_NUMBER_OF_CHARS
+ {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS},
+ #else
+ {"ODD_NUMBER_OF_CHARS", 13, 145},
+ #endif
+ #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE
+ {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE},
+ #else
+ {"SECOND_NUMBER_TOO_LARGE", 13, 147},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH
+ {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH},
+ #else
+ {"SEQUENCE_LENGTH_MISMATCH", 13, 148},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED
+ {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED},
+ #else
+ {"SEQUENCE_NOT_CONSTRUCTED", 13, 149},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG},
+ #else
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192},
+ #endif
+ #ifdef ASN1_R_SHORT_LINE
+ {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE},
+ #else
+ {"SHORT_LINE", 13, 150},
+ #endif
+ #ifdef ASN1_R_SIG_INVALID_MIME_TYPE
+ {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE},
+ #else
+ {"SIG_INVALID_MIME_TYPE", 13, 213},
+ #endif
+ #ifdef ASN1_R_STREAMING_NOT_SUPPORTED
+ {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED},
+ #else
+ {"STREAMING_NOT_SUPPORTED", 13, 202},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 13, 151},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_SHORT
+ {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT},
+ #else
+ {"STRING_TOO_SHORT", 13, 152},
+ #endif
+ #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154},
+ #endif
+ #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT
+ {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT},
+ #else
+ {"TIME_NOT_ASCII_FORMAT", 13, 193},
+ #endif
+ #ifdef ASN1_R_TOO_LARGE
+ {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE},
+ #else
+ {"TOO_LARGE", 13, 223},
+ #endif
+ #ifdef ASN1_R_TOO_LONG
+ {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG},
+ #else
+ {"TOO_LONG", 13, 155},
+ #endif
+ #ifdef ASN1_R_TOO_SMALL
+ {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL},
+ #else
+ {"TOO_SMALL", 13, 224},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED
+ {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED},
+ #else
+ {"TYPE_NOT_CONSTRUCTED", 13, 156},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_PRIMITIVE
+ {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE},
+ #else
+ {"TYPE_NOT_PRIMITIVE", 13, 195},
+ #endif
+ #ifdef ASN1_R_UNEXPECTED_EOC
+ {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC},
+ #else
+ {"UNEXPECTED_EOC", 13, 159},
+ #endif
+ #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH},
+ #else
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_ASN1, ASN1_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 13, 229},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_FORMAT
+ {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT},
+ #else
+ {"UNKNOWN_FORMAT", 13, 160},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE
+ {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE},
+ #else
+ {"UNKNOWN_OBJECT_TYPE", 13, 162},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE
+ {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE},
+ #else
+ {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM
+ {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM},
+ #else
+ {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_TAG
+ {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG},
+ #else
+ {"UNKNOWN_TAG", 13, 194},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE},
+ #else
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 13, 228},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 13, 196},
+ #endif
+ #ifdef ASN1_R_WRONG_INTEGER_TYPE
+ {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE},
+ #else
+ {"WRONG_INTEGER_TYPE", 13, 225},
+ #endif
+ #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE
+ {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE},
+ #else
+ {"WRONG_PUBLIC_KEY_TYPE", 13, 200},
+ #endif
+ #ifdef ASN1_R_WRONG_TAG
+ {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG},
+ #else
+ {"WRONG_TAG", 13, 168},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SET_POOL
+ {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL},
+ #else
+ {"FAILED_TO_SET_POOL", 51, 101},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT
+ {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT},
+ #else
+ {"FAILED_TO_SWAP_CONTEXT", 51, 102},
+ #endif
+ #ifdef ASYNC_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 51, 105},
+ #endif
+ #ifdef ASYNC_R_INVALID_POOL_SIZE
+ {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE},
+ #else
+ {"INVALID_POOL_SIZE", 51, 103},
+ #endif
+ #ifdef BIO_R_ACCEPT_ERROR
+ {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR},
+ #else
+ {"ACCEPT_ERROR", 32, 100},
+ #endif
+ #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET},
+ #else
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141},
+ #endif
+ #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE
+ {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE},
+ #else
+ {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129},
+ #endif
+ #ifdef BIO_R_BAD_FOPEN_MODE
+ {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE},
+ #else
+ {"BAD_FOPEN_MODE", 32, 101},
+ #endif
+ #ifdef BIO_R_BROKEN_PIPE
+ {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE},
+ #else
+ {"BROKEN_PIPE", 32, 124},
+ #endif
+ #ifdef BIO_R_CONNECT_ERROR
+ {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR},
+ #else
+ {"CONNECT_ERROR", 32, 103},
+ #endif
+ #ifdef BIO_R_CONNECT_TIMEOUT
+ {"CONNECT_TIMEOUT", ERR_LIB_BIO, BIO_R_CONNECT_TIMEOUT},
+ #else
+ {"CONNECT_TIMEOUT", 32, 147},
+ #endif
+ #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET},
+ #else
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_ERROR
+ {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR},
+ #else
+ {"GETSOCKNAME_ERROR", 32, 132},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS},
+ #else
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133},
+ #endif
+ #ifdef BIO_R_GETTING_SOCKTYPE
+ {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE},
+ #else
+ {"GETTING_SOCKTYPE", 32, 134},
+ #endif
+ #ifdef BIO_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 32, 125},
+ #endif
+ #ifdef BIO_R_INVALID_SOCKET
+ {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET},
+ #else
+ {"INVALID_SOCKET", 32, 135},
+ #endif
+ #ifdef BIO_R_IN_USE
+ {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE},
+ #else
+ {"IN_USE", 32, 123},
+ #endif
+ #ifdef BIO_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 32, 102},
+ #endif
+ #ifdef BIO_R_LISTEN_V6_ONLY
+ {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY},
+ #else
+ {"LISTEN_V6_ONLY", 32, 136},
+ #endif
+ #ifdef BIO_R_LOOKUP_RETURNED_NOTHING
+ {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING},
+ #else
+ {"LOOKUP_RETURNED_NOTHING", 32, 142},
+ #endif
+ #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE
+ {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE},
+ #else
+ {"MALFORMED_HOST_OR_SERVICE", 32, 130},
+ #endif
+ #ifdef BIO_R_NBIO_CONNECT_ERROR
+ {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR},
+ #else
+ {"NBIO_CONNECT_ERROR", 32, 110},
+ #endif
+ #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143},
+ #endif
+ #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144},
+ #endif
+ #ifdef BIO_R_NO_PORT_DEFINED
+ {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED},
+ #else
+ {"NO_PORT_DEFINED", 32, 113},
+ #endif
+ #ifdef BIO_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 32, 128},
+ #endif
+ #ifdef BIO_R_TRANSFER_ERROR
+ {"TRANSFER_ERROR", ERR_LIB_BIO, BIO_R_TRANSFER_ERROR},
+ #else
+ {"TRANSFER_ERROR", 32, 104},
+ #endif
+ #ifdef BIO_R_TRANSFER_TIMEOUT
+ {"TRANSFER_TIMEOUT", ERR_LIB_BIO, BIO_R_TRANSFER_TIMEOUT},
+ #else
+ {"TRANSFER_TIMEOUT", 32, 105},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_BIND_SOCKET
+ {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET},
+ #else
+ {"UNABLE_TO_BIND_SOCKET", 32, 117},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET
+ {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET},
+ #else
+ {"UNABLE_TO_CREATE_SOCKET", 32, 118},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_KEEPALIVE
+ {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE},
+ #else
+ {"UNABLE_TO_KEEPALIVE", 32, 137},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET
+ {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET},
+ #else
+ {"UNABLE_TO_LISTEN_SOCKET", 32, 119},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_NODELAY
+ {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY},
+ #else
+ {"UNABLE_TO_NODELAY", 32, 138},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_REUSEADDR
+ {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR},
+ #else
+ {"UNABLE_TO_REUSEADDR", 32, 139},
+ #endif
+ #ifdef BIO_R_UNAVAILABLE_IP_FAMILY
+ {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY},
+ #else
+ {"UNAVAILABLE_IP_FAMILY", 32, 145},
+ #endif
+ #ifdef BIO_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 32, 120},
+ #endif
+ #ifdef BIO_R_UNKNOWN_INFO_TYPE
+ {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE},
+ #else
+ {"UNKNOWN_INFO_TYPE", 32, 140},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_IP_FAMILY
+ {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY},
+ #else
+ {"UNSUPPORTED_IP_FAMILY", 32, 146},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_METHOD
+ {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD},
+ #else
+ {"UNSUPPORTED_METHOD", 32, 121},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY
+ {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY},
+ #else
+ {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131},
+ #endif
+ #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO
+ {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO},
+ #else
+ {"WRITE_TO_READ_ONLY_BIO", 32, 126},
+ #endif
+ #ifdef BIO_R_WSASTARTUP
+ {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP},
+ #else
+ {"WSASTARTUP", 32, 122},
+ #endif
+ #ifdef BN_R_ARG2_LT_ARG3
+ {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3},
+ #else
+ {"ARG2_LT_ARG3", 3, 100},
+ #endif
+ #ifdef BN_R_BAD_RECIPROCAL
+ {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL},
+ #else
+ {"BAD_RECIPROCAL", 3, 101},
+ #endif
+ #ifdef BN_R_BIGNUM_TOO_LONG
+ {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG},
+ #else
+ {"BIGNUM_TOO_LONG", 3, 114},
+ #endif
+ #ifdef BN_R_BITS_TOO_SMALL
+ {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL},
+ #else
+ {"BITS_TOO_SMALL", 3, 118},
+ #endif
+ #ifdef BN_R_CALLED_WITH_EVEN_MODULUS
+ {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS},
+ #else
+ {"CALLED_WITH_EVEN_MODULUS", 3, 102},
+ #endif
+ #ifdef BN_R_DIV_BY_ZERO
+ {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO},
+ #else
+ {"DIV_BY_ZERO", 3, 103},
+ #endif
+ #ifdef BN_R_ENCODING_ERROR
+ {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR},
+ #else
+ {"ENCODING_ERROR", 3, 104},
+ #endif
+ #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA},
+ #else
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105},
+ #endif
+ #ifdef BN_R_INPUT_NOT_REDUCED
+ {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED},
+ #else
+ {"INPUT_NOT_REDUCED", 3, 110},
+ #endif
+ #ifdef BN_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 3, 106},
+ #endif
+ #ifdef BN_R_INVALID_RANGE
+ {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE},
+ #else
+ {"INVALID_RANGE", 3, 115},
+ #endif
+ #ifdef BN_R_INVALID_SHIFT
+ {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT},
+ #else
+ {"INVALID_SHIFT", 3, 119},
+ #endif
+ #ifdef BN_R_NOT_A_SQUARE
+ {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE},
+ #else
+ {"NOT_A_SQUARE", 3, 111},
+ #endif
+ #ifdef BN_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 3, 107},
+ #endif
+ #ifdef BN_R_NO_INVERSE
+ {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE},
+ #else
+ {"NO_INVERSE", 3, 108},
+ #endif
+ #ifdef BN_R_NO_PRIME_CANDIDATE
+ {"NO_PRIME_CANDIDATE", ERR_LIB_BN, BN_R_NO_PRIME_CANDIDATE},
+ #else
+ {"NO_PRIME_CANDIDATE", 3, 121},
+ #endif
+ #ifdef BN_R_NO_SOLUTION
+ {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION},
+ #else
+ {"NO_SOLUTION", 3, 116},
+ #endif
+ #ifdef BN_R_NO_SUITABLE_DIGEST
+ {"NO_SUITABLE_DIGEST", ERR_LIB_BN, BN_R_NO_SUITABLE_DIGEST},
+ #else
+ {"NO_SUITABLE_DIGEST", 3, 120},
+ #endif
+ #ifdef BN_R_PRIVATE_KEY_TOO_LARGE
+ {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE},
+ #else
+ {"PRIVATE_KEY_TOO_LARGE", 3, 117},
+ #endif
+ #ifdef BN_R_P_IS_NOT_PRIME
+ {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME},
+ #else
+ {"P_IS_NOT_PRIME", 3, 112},
+ #endif
+ #ifdef BN_R_TOO_MANY_ITERATIONS
+ {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS},
+ #else
+ {"TOO_MANY_ITERATIONS", 3, 113},
+ #endif
+ #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES
+ {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES},
+ #else
+ {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109},
+ #endif
+ #ifdef CMP_R_ALGORITHM_NOT_SUPPORTED
+ {"ALGORITHM_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_ALGORITHM_NOT_SUPPORTED},
+ #else
+ {"ALGORITHM_NOT_SUPPORTED", 58, 139},
+ #endif
+ #ifdef CMP_R_BAD_CHECKAFTER_IN_POLLREP
+ {"BAD_CHECKAFTER_IN_POLLREP", ERR_LIB_CMP, CMP_R_BAD_CHECKAFTER_IN_POLLREP},
+ #else
+ {"BAD_CHECKAFTER_IN_POLLREP", 58, 167},
+ #endif
+ #ifdef CMP_R_BAD_REQUEST_ID
+ {"BAD_REQUEST_ID", ERR_LIB_CMP, CMP_R_BAD_REQUEST_ID},
+ #else
+ {"BAD_REQUEST_ID", 58, 108},
+ #endif
+ #ifdef CMP_R_CERTHASH_UNMATCHED
+ {"CERTHASH_UNMATCHED", ERR_LIB_CMP, CMP_R_CERTHASH_UNMATCHED},
+ #else
+ {"CERTHASH_UNMATCHED", 58, 156},
+ #endif
+ #ifdef CMP_R_CERTID_NOT_FOUND
+ {"CERTID_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTID_NOT_FOUND},
+ #else
+ {"CERTID_NOT_FOUND", 58, 109},
+ #endif
+ #ifdef CMP_R_CERTIFICATE_NOT_ACCEPTED
+ {"CERTIFICATE_NOT_ACCEPTED", ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_ACCEPTED},
+ #else
+ {"CERTIFICATE_NOT_ACCEPTED", 58, 169},
+ #endif
+ #ifdef CMP_R_CERTIFICATE_NOT_FOUND
+ {"CERTIFICATE_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_FOUND},
+ #else
+ {"CERTIFICATE_NOT_FOUND", 58, 112},
+ #endif
+ #ifdef CMP_R_CERTREQMSG_NOT_FOUND
+ {"CERTREQMSG_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTREQMSG_NOT_FOUND},
+ #else
+ {"CERTREQMSG_NOT_FOUND", 58, 157},
+ #endif
+ #ifdef CMP_R_CERTRESPONSE_NOT_FOUND
+ {"CERTRESPONSE_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTRESPONSE_NOT_FOUND},
+ #else
+ {"CERTRESPONSE_NOT_FOUND", 58, 113},
+ #endif
+ #ifdef CMP_R_CERT_AND_KEY_DO_NOT_MATCH
+ {"CERT_AND_KEY_DO_NOT_MATCH", ERR_LIB_CMP, CMP_R_CERT_AND_KEY_DO_NOT_MATCH},
+ #else
+ {"CERT_AND_KEY_DO_NOT_MATCH", 58, 114},
+ #endif
+ #ifdef CMP_R_CHECKAFTER_OUT_OF_RANGE
+ {"CHECKAFTER_OUT_OF_RANGE", ERR_LIB_CMP, CMP_R_CHECKAFTER_OUT_OF_RANGE},
+ #else
+ {"CHECKAFTER_OUT_OF_RANGE", 58, 181},
+ #endif
+ #ifdef CMP_R_ENCOUNTERED_KEYUPDATEWARNING
+ {"ENCOUNTERED_KEYUPDATEWARNING", ERR_LIB_CMP, CMP_R_ENCOUNTERED_KEYUPDATEWARNING},
+ #else
+ {"ENCOUNTERED_KEYUPDATEWARNING", 58, 176},
+ #endif
+ #ifdef CMP_R_ENCOUNTERED_WAITING
+ {"ENCOUNTERED_WAITING", ERR_LIB_CMP, CMP_R_ENCOUNTERED_WAITING},
+ #else
+ {"ENCOUNTERED_WAITING", 58, 162},
+ #endif
+ #ifdef CMP_R_ERROR_CALCULATING_PROTECTION
+ {"ERROR_CALCULATING_PROTECTION", ERR_LIB_CMP, CMP_R_ERROR_CALCULATING_PROTECTION},
+ #else
+ {"ERROR_CALCULATING_PROTECTION", 58, 115},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_CERTCONF
+ {"ERROR_CREATING_CERTCONF", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTCONF},
+ #else
+ {"ERROR_CREATING_CERTCONF", 58, 116},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_CERTREP
+ {"ERROR_CREATING_CERTREP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREP},
+ #else
+ {"ERROR_CREATING_CERTREP", 58, 117},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_CERTREQ
+ {"ERROR_CREATING_CERTREQ", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREQ},
+ #else
+ {"ERROR_CREATING_CERTREQ", 58, 163},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_ERROR
+ {"ERROR_CREATING_ERROR", ERR_LIB_CMP, CMP_R_ERROR_CREATING_ERROR},
+ #else
+ {"ERROR_CREATING_ERROR", 58, 118},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_GENM
+ {"ERROR_CREATING_GENM", ERR_LIB_CMP, CMP_R_ERROR_CREATING_GENM},
+ #else
+ {"ERROR_CREATING_GENM", 58, 119},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_GENP
+ {"ERROR_CREATING_GENP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_GENP},
+ #else
+ {"ERROR_CREATING_GENP", 58, 120},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_PKICONF
+ {"ERROR_CREATING_PKICONF", ERR_LIB_CMP, CMP_R_ERROR_CREATING_PKICONF},
+ #else
+ {"ERROR_CREATING_PKICONF", 58, 122},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_POLLREP
+ {"ERROR_CREATING_POLLREP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREP},
+ #else
+ {"ERROR_CREATING_POLLREP", 58, 123},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_POLLREQ
+ {"ERROR_CREATING_POLLREQ", ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREQ},
+ #else
+ {"ERROR_CREATING_POLLREQ", 58, 124},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_RP
+ {"ERROR_CREATING_RP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_RP},
+ #else
+ {"ERROR_CREATING_RP", 58, 125},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_RR
+ {"ERROR_CREATING_RR", ERR_LIB_CMP, CMP_R_ERROR_CREATING_RR},
+ #else
+ {"ERROR_CREATING_RR", 58, 126},
+ #endif
+ #ifdef CMP_R_ERROR_PARSING_PKISTATUS
+ {"ERROR_PARSING_PKISTATUS", ERR_LIB_CMP, CMP_R_ERROR_PARSING_PKISTATUS},
+ #else
+ {"ERROR_PARSING_PKISTATUS", 58, 107},
+ #endif
+ #ifdef CMP_R_ERROR_PROCESSING_MESSAGE
+ {"ERROR_PROCESSING_MESSAGE", ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE},
+ #else
+ {"ERROR_PROCESSING_MESSAGE", 58, 158},
+ #endif
+ #ifdef CMP_R_ERROR_PROTECTING_MESSAGE
+ {"ERROR_PROTECTING_MESSAGE", ERR_LIB_CMP, CMP_R_ERROR_PROTECTING_MESSAGE},
+ #else
+ {"ERROR_PROTECTING_MESSAGE", 58, 127},
+ #endif
+ #ifdef CMP_R_ERROR_SETTING_CERTHASH
+ {"ERROR_SETTING_CERTHASH", ERR_LIB_CMP, CMP_R_ERROR_SETTING_CERTHASH},
+ #else
+ {"ERROR_SETTING_CERTHASH", 58, 128},
+ #endif
+ #ifdef CMP_R_ERROR_UNEXPECTED_CERTCONF
+ {"ERROR_UNEXPECTED_CERTCONF", ERR_LIB_CMP, CMP_R_ERROR_UNEXPECTED_CERTCONF},
+ #else
+ {"ERROR_UNEXPECTED_CERTCONF", 58, 160},
+ #endif
+ #ifdef CMP_R_ERROR_VALIDATING_PROTECTION
+ {"ERROR_VALIDATING_PROTECTION", ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_PROTECTION},
+ #else
+ {"ERROR_VALIDATING_PROTECTION", 58, 140},
+ #endif
+ #ifdef CMP_R_ERROR_VALIDATING_SIGNATURE
+ {"ERROR_VALIDATING_SIGNATURE", ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_SIGNATURE},
+ #else
+ {"ERROR_VALIDATING_SIGNATURE", 58, 171},
+ #endif
+ #ifdef CMP_R_FAILED_BUILDING_OWN_CHAIN
+ {"FAILED_BUILDING_OWN_CHAIN", ERR_LIB_CMP, CMP_R_FAILED_BUILDING_OWN_CHAIN},
+ #else
+ {"FAILED_BUILDING_OWN_CHAIN", 58, 164},
+ #endif
+ #ifdef CMP_R_FAILED_EXTRACTING_PUBKEY
+ {"FAILED_EXTRACTING_PUBKEY", ERR_LIB_CMP, CMP_R_FAILED_EXTRACTING_PUBKEY},
+ #else
+ {"FAILED_EXTRACTING_PUBKEY", 58, 141},
+ #endif
+ #ifdef CMP_R_FAILURE_OBTAINING_RANDOM
+ {"FAILURE_OBTAINING_RANDOM", ERR_LIB_CMP, CMP_R_FAILURE_OBTAINING_RANDOM},
+ #else
+ {"FAILURE_OBTAINING_RANDOM", 58, 110},
+ #endif
+ #ifdef CMP_R_FAIL_INFO_OUT_OF_RANGE
+ {"FAIL_INFO_OUT_OF_RANGE", ERR_LIB_CMP, CMP_R_FAIL_INFO_OUT_OF_RANGE},
+ #else
+ {"FAIL_INFO_OUT_OF_RANGE", 58, 129},
+ #endif
+ #ifdef CMP_R_INVALID_ARGS
+ {"INVALID_ARGS", ERR_LIB_CMP, CMP_R_INVALID_ARGS},
+ #else
+ {"INVALID_ARGS", 58, 100},
+ #endif
+ #ifdef CMP_R_INVALID_OPTION
+ {"INVALID_OPTION", ERR_LIB_CMP, CMP_R_INVALID_OPTION},
+ #else
+ {"INVALID_OPTION", 58, 174},
+ #endif
+ #ifdef CMP_R_MISSING_CERTID
+ {"MISSING_CERTID", ERR_LIB_CMP, CMP_R_MISSING_CERTID},
+ #else
+ {"MISSING_CERTID", 58, 165},
+ #endif
+ #ifdef CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION
+ {"MISSING_KEY_INPUT_FOR_CREATING_PROTECTION", ERR_LIB_CMP, CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION},
+ #else
+ {"MISSING_KEY_INPUT_FOR_CREATING_PROTECTION", 58, 130},
+ #endif
+ #ifdef CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE
+ {"MISSING_KEY_USAGE_DIGITALSIGNATURE", ERR_LIB_CMP, CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE},
+ #else
+ {"MISSING_KEY_USAGE_DIGITALSIGNATURE", 58, 142},
+ #endif
+ #ifdef CMP_R_MISSING_P10CSR
+ {"MISSING_P10CSR", ERR_LIB_CMP, CMP_R_MISSING_P10CSR},
+ #else
+ {"MISSING_P10CSR", 58, 121},
+ #endif
+ #ifdef CMP_R_MISSING_PBM_SECRET
+ {"MISSING_PBM_SECRET", ERR_LIB_CMP, CMP_R_MISSING_PBM_SECRET},
+ #else
+ {"MISSING_PBM_SECRET", 58, 166},
+ #endif
+ #ifdef CMP_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_CMP, CMP_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 58, 131},
+ #endif
+ #ifdef CMP_R_MISSING_PRIVATE_KEY_FOR_POPO
+ {"MISSING_PRIVATE_KEY_FOR_POPO", ERR_LIB_CMP, CMP_R_MISSING_PRIVATE_KEY_FOR_POPO},
+ #else
+ {"MISSING_PRIVATE_KEY_FOR_POPO", 58, 190},
+ #endif
+ #ifdef CMP_R_MISSING_PROTECTION
+ {"MISSING_PROTECTION", ERR_LIB_CMP, CMP_R_MISSING_PROTECTION},
+ #else
+ {"MISSING_PROTECTION", 58, 143},
+ #endif
+ #ifdef CMP_R_MISSING_PUBLIC_KEY
+ {"MISSING_PUBLIC_KEY", ERR_LIB_CMP, CMP_R_MISSING_PUBLIC_KEY},
+ #else
+ {"MISSING_PUBLIC_KEY", 58, 183},
+ #endif
+ #ifdef CMP_R_MISSING_REFERENCE_CERT
+ {"MISSING_REFERENCE_CERT", ERR_LIB_CMP, CMP_R_MISSING_REFERENCE_CERT},
+ #else
+ {"MISSING_REFERENCE_CERT", 58, 168},
+ #endif
+ #ifdef CMP_R_MISSING_SECRET
+ {"MISSING_SECRET", ERR_LIB_CMP, CMP_R_MISSING_SECRET},
+ #else
+ {"MISSING_SECRET", 58, 178},
+ #endif
+ #ifdef CMP_R_MISSING_SENDER_IDENTIFICATION
+ {"MISSING_SENDER_IDENTIFICATION", ERR_LIB_CMP, CMP_R_MISSING_SENDER_IDENTIFICATION},
+ #else
+ {"MISSING_SENDER_IDENTIFICATION", 58, 111},
+ #endif
+ #ifdef CMP_R_MISSING_TRUST_ANCHOR
+ {"MISSING_TRUST_ANCHOR", ERR_LIB_CMP, CMP_R_MISSING_TRUST_ANCHOR},
+ #else
+ {"MISSING_TRUST_ANCHOR", 58, 179},
+ #endif
+ #ifdef CMP_R_MISSING_TRUST_STORE
+ {"MISSING_TRUST_STORE", ERR_LIB_CMP, CMP_R_MISSING_TRUST_STORE},
+ #else
+ {"MISSING_TRUST_STORE", 58, 144},
+ #endif
+ #ifdef CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED
+ {"MULTIPLE_REQUESTS_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED},
+ #else
+ {"MULTIPLE_REQUESTS_NOT_SUPPORTED", 58, 161},
+ #endif
+ #ifdef CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED
+ {"MULTIPLE_RESPONSES_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED},
+ #else
+ {"MULTIPLE_RESPONSES_NOT_SUPPORTED", 58, 170},
+ #endif
+ #ifdef CMP_R_MULTIPLE_SAN_SOURCES
+ {"MULTIPLE_SAN_SOURCES", ERR_LIB_CMP, CMP_R_MULTIPLE_SAN_SOURCES},
+ #else
+ {"MULTIPLE_SAN_SOURCES", 58, 102},
+ #endif
+ #ifdef CMP_R_NO_STDIO
+ {"NO_STDIO", ERR_LIB_CMP, CMP_R_NO_STDIO},
+ #else
+ {"NO_STDIO", 58, 194},
+ #endif
+ #ifdef CMP_R_NO_SUITABLE_SENDER_CERT
+ {"NO_SUITABLE_SENDER_CERT", ERR_LIB_CMP, CMP_R_NO_SUITABLE_SENDER_CERT},
+ #else
+ {"NO_SUITABLE_SENDER_CERT", 58, 145},
+ #endif
+ #ifdef CMP_R_NULL_ARGUMENT
+ {"NULL_ARGUMENT", ERR_LIB_CMP, CMP_R_NULL_ARGUMENT},
+ #else
+ {"NULL_ARGUMENT", 58, 103},
+ #endif
+ #ifdef CMP_R_PKIBODY_ERROR
+ {"PKIBODY_ERROR", ERR_LIB_CMP, CMP_R_PKIBODY_ERROR},
+ #else
+ {"PKIBODY_ERROR", 58, 146},
+ #endif
+ #ifdef CMP_R_PKISTATUSINFO_NOT_FOUND
+ {"PKISTATUSINFO_NOT_FOUND", ERR_LIB_CMP, CMP_R_PKISTATUSINFO_NOT_FOUND},
+ #else
+ {"PKISTATUSINFO_NOT_FOUND", 58, 132},
+ #endif
+ #ifdef CMP_R_POLLING_FAILED
+ {"POLLING_FAILED", ERR_LIB_CMP, CMP_R_POLLING_FAILED},
+ #else
+ {"POLLING_FAILED", 58, 172},
+ #endif
+ #ifdef CMP_R_POTENTIALLY_INVALID_CERTIFICATE
+ {"POTENTIALLY_INVALID_CERTIFICATE", ERR_LIB_CMP, CMP_R_POTENTIALLY_INVALID_CERTIFICATE},
+ #else
+ {"POTENTIALLY_INVALID_CERTIFICATE", 58, 147},
+ #endif
+ #ifdef CMP_R_RECEIVED_ERROR
+ {"RECEIVED_ERROR", ERR_LIB_CMP, CMP_R_RECEIVED_ERROR},
+ #else
+ {"RECEIVED_ERROR", 58, 180},
+ #endif
+ #ifdef CMP_R_RECIPNONCE_UNMATCHED
+ {"RECIPNONCE_UNMATCHED", ERR_LIB_CMP, CMP_R_RECIPNONCE_UNMATCHED},
+ #else
+ {"RECIPNONCE_UNMATCHED", 58, 148},
+ #endif
+ #ifdef CMP_R_REQUEST_NOT_ACCEPTED
+ {"REQUEST_NOT_ACCEPTED", ERR_LIB_CMP, CMP_R_REQUEST_NOT_ACCEPTED},
+ #else
+ {"REQUEST_NOT_ACCEPTED", 58, 149},
+ #endif
+ #ifdef CMP_R_REQUEST_REJECTED_BY_SERVER
+ {"REQUEST_REJECTED_BY_SERVER", ERR_LIB_CMP, CMP_R_REQUEST_REJECTED_BY_SERVER},
+ #else
+ {"REQUEST_REJECTED_BY_SERVER", 58, 182},
+ #endif
+ #ifdef CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED
+ {"SENDER_GENERALNAME_TYPE_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED},
+ #else
+ {"SENDER_GENERALNAME_TYPE_NOT_SUPPORTED", 58, 150},
+ #endif
+ #ifdef CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG
+ {"SRVCERT_DOES_NOT_VALIDATE_MSG", ERR_LIB_CMP, CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG},
+ #else
+ {"SRVCERT_DOES_NOT_VALIDATE_MSG", 58, 151},
+ #endif
+ #ifdef CMP_R_TOTAL_TIMEOUT
+ {"TOTAL_TIMEOUT", ERR_LIB_CMP, CMP_R_TOTAL_TIMEOUT},
+ #else
+ {"TOTAL_TIMEOUT", 58, 184},
+ #endif
+ #ifdef CMP_R_TRANSACTIONID_UNMATCHED
+ {"TRANSACTIONID_UNMATCHED", ERR_LIB_CMP, CMP_R_TRANSACTIONID_UNMATCHED},
+ #else
+ {"TRANSACTIONID_UNMATCHED", 58, 152},
+ #endif
+ #ifdef CMP_R_TRANSFER_ERROR
+ {"TRANSFER_ERROR", ERR_LIB_CMP, CMP_R_TRANSFER_ERROR},
+ #else
+ {"TRANSFER_ERROR", 58, 159},
+ #endif
+ #ifdef CMP_R_UNEXPECTED_PKIBODY
+ {"UNEXPECTED_PKIBODY", ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY},
+ #else
+ {"UNEXPECTED_PKIBODY", 58, 133},
+ #endif
+ #ifdef CMP_R_UNEXPECTED_PKISTATUS
+ {"UNEXPECTED_PKISTATUS", ERR_LIB_CMP, CMP_R_UNEXPECTED_PKISTATUS},
+ #else
+ {"UNEXPECTED_PKISTATUS", 58, 185},
+ #endif
+ #ifdef CMP_R_UNEXPECTED_PVNO
+ {"UNEXPECTED_PVNO", ERR_LIB_CMP, CMP_R_UNEXPECTED_PVNO},
+ #else
+ {"UNEXPECTED_PVNO", 58, 153},
+ #endif
+ #ifdef CMP_R_UNKNOWN_ALGORITHM_ID
+ {"UNKNOWN_ALGORITHM_ID", ERR_LIB_CMP, CMP_R_UNKNOWN_ALGORITHM_ID},
+ #else
+ {"UNKNOWN_ALGORITHM_ID", 58, 134},
+ #endif
+ #ifdef CMP_R_UNKNOWN_CERT_TYPE
+ {"UNKNOWN_CERT_TYPE", ERR_LIB_CMP, CMP_R_UNKNOWN_CERT_TYPE},
+ #else
+ {"UNKNOWN_CERT_TYPE", 58, 135},
+ #endif
+ #ifdef CMP_R_UNKNOWN_PKISTATUS
+ {"UNKNOWN_PKISTATUS", ERR_LIB_CMP, CMP_R_UNKNOWN_PKISTATUS},
+ #else
+ {"UNKNOWN_PKISTATUS", 58, 186},
+ #endif
+ #ifdef CMP_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_CMP, CMP_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 58, 136},
+ #endif
+ #ifdef CMP_R_UNSUPPORTED_KEY_TYPE
+ {"UNSUPPORTED_KEY_TYPE", ERR_LIB_CMP, CMP_R_UNSUPPORTED_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_KEY_TYPE", 58, 137},
+ #endif
+ #ifdef CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC
+ {"UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC", ERR_LIB_CMP, CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC},
+ #else
+ {"UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC", 58, 154},
+ #endif
+ #ifdef CMP_R_VALUE_TOO_LARGE
+ {"VALUE_TOO_LARGE", ERR_LIB_CMP, CMP_R_VALUE_TOO_LARGE},
+ #else
+ {"VALUE_TOO_LARGE", 58, 175},
+ #endif
+ #ifdef CMP_R_VALUE_TOO_SMALL
+ {"VALUE_TOO_SMALL", ERR_LIB_CMP, CMP_R_VALUE_TOO_SMALL},
+ #else
+ {"VALUE_TOO_SMALL", 58, 177},
+ #endif
+ #ifdef CMP_R_WRONG_ALGORITHM_OID
+ {"WRONG_ALGORITHM_OID", ERR_LIB_CMP, CMP_R_WRONG_ALGORITHM_OID},
+ #else
+ {"WRONG_ALGORITHM_OID", 58, 138},
+ #endif
+ #ifdef CMP_R_WRONG_CERTID
+ {"WRONG_CERTID", ERR_LIB_CMP, CMP_R_WRONG_CERTID},
+ #else
+ {"WRONG_CERTID", 58, 189},
+ #endif
+ #ifdef CMP_R_WRONG_CERTID_IN_RP
+ {"WRONG_CERTID_IN_RP", ERR_LIB_CMP, CMP_R_WRONG_CERTID_IN_RP},
+ #else
+ {"WRONG_CERTID_IN_RP", 58, 187},
+ #endif
+ #ifdef CMP_R_WRONG_PBM_VALUE
+ {"WRONG_PBM_VALUE", ERR_LIB_CMP, CMP_R_WRONG_PBM_VALUE},
+ #else
+ {"WRONG_PBM_VALUE", 58, 155},
+ #endif
+ #ifdef CMP_R_WRONG_RP_COMPONENT_COUNT
+ {"WRONG_RP_COMPONENT_COUNT", ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT},
+ #else
+ {"WRONG_RP_COMPONENT_COUNT", 58, 188},
+ #endif
+ #ifdef CMP_R_WRONG_SERIAL_IN_RP
+ {"WRONG_SERIAL_IN_RP", ERR_LIB_CMP, CMP_R_WRONG_SERIAL_IN_RP},
+ #else
+ {"WRONG_SERIAL_IN_RP", 58, 173},
+ #endif
+ #ifdef CMS_R_ADD_SIGNER_ERROR
+ {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR},
+ #else
+ {"ADD_SIGNER_ERROR", 46, 99},
+ #endif
+ #ifdef CMS_R_ATTRIBUTE_ERROR
+ {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR},
+ #else
+ {"ATTRIBUTE_ERROR", 46, 161},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT
+ {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT},
+ #else
+ {"CERTIFICATE_ALREADY_PRESENT", 46, 175},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID
+ {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID},
+ #else
+ {"CERTIFICATE_HAS_NO_KEYID", 46, 160},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 46, 100},
+ #endif
+ #ifdef CMS_R_CIPHER_AEAD_SET_TAG_ERROR
+ {"CIPHER_AEAD_SET_TAG_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_AEAD_SET_TAG_ERROR},
+ #else
+ {"CIPHER_AEAD_SET_TAG_ERROR", 46, 184},
+ #endif
+ #ifdef CMS_R_CIPHER_GET_TAG
+ {"CIPHER_GET_TAG", ERR_LIB_CMS, CMS_R_CIPHER_GET_TAG},
+ #else
+ {"CIPHER_GET_TAG", 46, 185},
+ #endif
+ #ifdef CMS_R_CIPHER_INITIALISATION_ERROR
+ {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_INITIALISATION_ERROR", 46, 101},
+ #endif
+ #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102},
+ #endif
+ #ifdef CMS_R_CMS_DATAFINAL_ERROR
+ {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR},
+ #else
+ {"CMS_DATAFINAL_ERROR", 46, 103},
+ #endif
+ #ifdef CMS_R_CMS_LIB
+ {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB},
+ #else
+ {"CMS_LIB", 46, 104},
+ #endif
+ #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH
+ {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH},
+ #else
+ {"CONTENTIDENTIFIER_MISMATCH", 46, 170},
+ #endif
+ #ifdef CMS_R_CONTENT_NOT_FOUND
+ {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND},
+ #else
+ {"CONTENT_NOT_FOUND", 46, 105},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_MISMATCH
+ {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH},
+ #else
+ {"CONTENT_TYPE_MISMATCH", 46, 171},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108},
+ #endif
+ #ifdef CMS_R_CONTENT_VERIFY_ERROR
+ {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR},
+ #else
+ {"CONTENT_VERIFY_ERROR", 46, 109},
+ #endif
+ #ifdef CMS_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 46, 110},
+ #endif
+ #ifdef CMS_R_CTRL_FAILURE
+ {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE},
+ #else
+ {"CTRL_FAILURE", 46, 111},
+ #endif
+ #ifdef CMS_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_CMS, CMS_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 46, 187},
+ #endif
+ #ifdef CMS_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 46, 112},
+ #endif
+ #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY
+ {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY},
+ #else
+ {"ERROR_GETTING_PUBLIC_KEY", 46, 113},
+ #endif
+ #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE},
+ #else
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_KEY
+ {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY},
+ #else
+ {"ERROR_SETTING_KEY", 46, 115},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO
+ {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO},
+ #else
+ {"ERROR_SETTING_RECIPIENTINFO", 46, 116},
+ #endif
+ #ifdef CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR
+ {"ESS_SIGNING_CERTID_MISMATCH_ERROR", ERR_LIB_CMS, CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR},
+ #else
+ {"ESS_SIGNING_CERTID_MISMATCH_ERROR", 46, 183},
+ #endif
+ #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH
+ {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH},
+ #else
+ {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER},
+ #else
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 46, 118},
+ #endif
+ #ifdef CMS_R_INVALID_LABEL
+ {"INVALID_LABEL", ERR_LIB_CMS, CMS_R_INVALID_LABEL},
+ #else
+ {"INVALID_LABEL", 46, 190},
+ #endif
+ #ifdef CMS_R_INVALID_OAEP_PARAMETERS
+ {"INVALID_OAEP_PARAMETERS", ERR_LIB_CMS, CMS_R_INVALID_OAEP_PARAMETERS},
+ #else
+ {"INVALID_OAEP_PARAMETERS", 46, 191},
+ #endif
+ #ifdef CMS_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 46, 186},
+ #endif
+ #ifdef CMS_R_MD_BIO_INIT_ERROR
+ {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR},
+ #else
+ {"MD_BIO_INIT_ERROR", 46, 119},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH
+ {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_ERROR
+ {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR},
+ #else
+ {"MSGSIGDIGEST_ERROR", 46, 172},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE},
+ #else
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH
+ {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH},
+ #else
+ {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163},
+ #endif
+ #ifdef CMS_R_NEED_ONE_SIGNER
+ {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER},
+ #else
+ {"NEED_ONE_SIGNER", 46, 164},
+ #endif
+ #ifdef CMS_R_NOT_A_SIGNED_RECEIPT
+ {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT},
+ #else
+ {"NOT_A_SIGNED_RECEIPT", 46, 165},
+ #endif
+ #ifdef CMS_R_NOT_ENCRYPTED_DATA
+ {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA},
+ #else
+ {"NOT_ENCRYPTED_DATA", 46, 122},
+ #endif
+ #ifdef CMS_R_NOT_KEK
+ {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK},
+ #else
+ {"NOT_KEK", 46, 123},
+ #endif
+ #ifdef CMS_R_NOT_KEY_AGREEMENT
+ {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT},
+ #else
+ {"NOT_KEY_AGREEMENT", 46, 181},
+ #endif
+ #ifdef CMS_R_NOT_KEY_TRANSPORT
+ {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT},
+ #else
+ {"NOT_KEY_TRANSPORT", 46, 124},
+ #endif
+ #ifdef CMS_R_NOT_PWRI
+ {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI},
+ #else
+ {"NOT_PWRI", 46, 177},
+ #endif
+ #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125},
+ #endif
+ #ifdef CMS_R_NO_CIPHER
+ {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER},
+ #else
+ {"NO_CIPHER", 46, 126},
+ #endif
+ #ifdef CMS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 46, 127},
+ #endif
+ #ifdef CMS_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 46, 173},
+ #endif
+ #ifdef CMS_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 46, 128},
+ #endif
+ #ifdef CMS_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 46, 129},
+ #endif
+ #ifdef CMS_R_NO_KEY
+ {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY},
+ #else
+ {"NO_KEY", 46, 130},
+ #endif
+ #ifdef CMS_R_NO_KEY_OR_CERT
+ {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT},
+ #else
+ {"NO_KEY_OR_CERT", 46, 174},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_DIGEST
+ {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST},
+ #else
+ {"NO_MATCHING_DIGEST", 46, 131},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_RECIPIENT
+ {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT},
+ #else
+ {"NO_MATCHING_RECIPIENT", 46, 132},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_SIGNATURE
+ {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE},
+ #else
+ {"NO_MATCHING_SIGNATURE", 46, 166},
+ #endif
+ #ifdef CMS_R_NO_MSGSIGDIGEST
+ {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST},
+ #else
+ {"NO_MSGSIGDIGEST", 46, 167},
+ #endif
+ #ifdef CMS_R_NO_PASSWORD
+ {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD},
+ #else
+ {"NO_PASSWORD", 46, 178},
+ #endif
+ #ifdef CMS_R_NO_PRIVATE_KEY
+ {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY},
+ #else
+ {"NO_PRIVATE_KEY", 46, 133},
+ #endif
+ #ifdef CMS_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 46, 134},
+ #endif
+ #ifdef CMS_R_NO_RECEIPT_REQUEST
+ {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST},
+ #else
+ {"NO_RECEIPT_REQUEST", 46, 168},
+ #endif
+ #ifdef CMS_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 46, 135},
+ #endif
+ #ifdef CMS_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_CMS, CMS_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 46, 188},
+ #endif
+ #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136},
+ #endif
+ #ifdef CMS_R_RECEIPT_DECODE_ERROR
+ {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR},
+ #else
+ {"RECEIPT_DECODE_ERROR", 46, 169},
+ #endif
+ #ifdef CMS_R_RECIPIENT_ERROR
+ {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR},
+ #else
+ {"RECIPIENT_ERROR", 46, 137},
+ #endif
+ #ifdef CMS_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_CMS, CMS_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 46, 189},
+ #endif
+ #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138},
+ #endif
+ #ifdef CMS_R_SIGNFINAL_ERROR
+ {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR},
+ #else
+ {"SIGNFINAL_ERROR", 46, 139},
+ #endif
+ #ifdef CMS_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 46, 140},
+ #endif
+ #ifdef CMS_R_STORE_INIT_ERROR
+ {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR},
+ #else
+ {"STORE_INIT_ERROR", 46, 141},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA
+ {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"TYPE_NOT_COMPRESSED_DATA", 46, 142},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DATA
+ {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA},
+ #else
+ {"TYPE_NOT_DATA", 46, 143},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA
+ {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA},
+ #else
+ {"TYPE_NOT_DIGESTED_DATA", 46, 144},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA
+ {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA},
+ #else
+ {"TYPE_NOT_ENCRYPTED_DATA", 46, 145},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA
+ {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"TYPE_NOT_ENVELOPED_DATA", 46, 146},
+ #endif
+ #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT
+ {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT},
+ #else
+ {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147},
+ #endif
+ #ifdef CMS_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 46, 148},
+ #endif
+ #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 46, 149},
+ #endif
+ #ifdef CMS_R_UNKNOWN_ID
+ {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID},
+ #else
+ {"UNKNOWN_ID", 46, 150},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM", 46, 194},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 46, 152},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_ENCRYPTION_TYPE
+ {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_ENCRYPTION_TYPE},
+ #else
+ {"UNSUPPORTED_ENCRYPTION_TYPE", 46, 192},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM
+ {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEK_ALGORITHM", 46, 153},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_LABEL_SOURCE
+ {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_LABEL_SOURCE},
+ #else
+ {"UNSUPPORTED_LABEL_SOURCE", 46, 193},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE
+ {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 46, 156},
+ #endif
+ #ifdef CMS_R_UNWRAP_ERROR
+ {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR},
+ #else
+ {"UNWRAP_ERROR", 46, 157},
+ #endif
+ #ifdef CMS_R_UNWRAP_FAILURE
+ {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE},
+ #else
+ {"UNWRAP_FAILURE", 46, 180},
+ #endif
+ #ifdef CMS_R_VERIFICATION_FAILURE
+ {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE},
+ #else
+ {"VERIFICATION_FAILURE", 46, 158},
+ #endif
+ #ifdef CMS_R_WRAP_ERROR
+ {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR},
+ #else
+ {"WRAP_ERROR", 46, 159},
+ #endif
+ #ifdef COMP_R_ZLIB_DEFLATE_ERROR
+ {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR},
+ #else
+ {"ZLIB_DEFLATE_ERROR", 41, 99},
+ #endif
+ #ifdef COMP_R_ZLIB_INFLATE_ERROR
+ {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR},
+ #else
+ {"ZLIB_INFLATE_ERROR", 41, 100},
+ #endif
+ #ifdef COMP_R_ZLIB_NOT_SUPPORTED
+ {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED},
+ #else
+ {"ZLIB_NOT_SUPPORTED", 41, 101},
+ #endif
+ #ifdef CONF_R_ERROR_LOADING_DSO
+ {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO},
+ #else
+ {"ERROR_LOADING_DSO", 14, 110},
+ #endif
+ #ifdef CONF_R_INVALID_PRAGMA
+ {"INVALID_PRAGMA", ERR_LIB_CONF, CONF_R_INVALID_PRAGMA},
+ #else
+ {"INVALID_PRAGMA", 14, 122},
+ #endif
+ #ifdef CONF_R_LIST_CANNOT_BE_NULL
+ {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL},
+ #else
+ {"LIST_CANNOT_BE_NULL", 14, 115},
+ #endif
+ #ifdef CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION
+ {"MANDATORY_BRACES_IN_VARIABLE_EXPANSION", ERR_LIB_CONF, CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION},
+ #else
+ {"MANDATORY_BRACES_IN_VARIABLE_EXPANSION", 14, 123},
+ #endif
+ #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET
+ {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET},
+ #else
+ {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100},
+ #endif
+ #ifdef CONF_R_MISSING_EQUAL_SIGN
+ {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN},
+ #else
+ {"MISSING_EQUAL_SIGN", 14, 101},
+ #endif
+ #ifdef CONF_R_MISSING_INIT_FUNCTION
+ {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION},
+ #else
+ {"MISSING_INIT_FUNCTION", 14, 112},
+ #endif
+ #ifdef CONF_R_MODULE_INITIALIZATION_ERROR
+ {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR},
+ #else
+ {"MODULE_INITIALIZATION_ERROR", 14, 109},
+ #endif
+ #ifdef CONF_R_NO_CLOSE_BRACE
+ {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE},
+ #else
+ {"NO_CLOSE_BRACE", 14, 102},
+ #endif
+ #ifdef CONF_R_NO_CONF
+ {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF},
+ #else
+ {"NO_CONF", 14, 105},
+ #endif
+ #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE},
+ #else
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106},
+ #endif
+ #ifdef CONF_R_NO_SECTION
+ {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION},
+ #else
+ {"NO_SECTION", 14, 107},
+ #endif
+ #ifdef CONF_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 14, 114},
+ #endif
+ #ifdef CONF_R_NO_VALUE
+ {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE},
+ #else
+ {"NO_VALUE", 14, 108},
+ #endif
+ #ifdef CONF_R_NUMBER_TOO_LARGE
+ {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE},
+ #else
+ {"NUMBER_TOO_LARGE", 14, 121},
+ #endif
+ #ifdef CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION
+ {"OPENSSL_CONF_REFERENCES_MISSING_SECTION", ERR_LIB_CONF, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION},
+ #else
+ {"OPENSSL_CONF_REFERENCES_MISSING_SECTION", 14, 124},
+ #endif
+ #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE
+ {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE},
+ #else
+ {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111},
+ #endif
+ #ifdef CONF_R_RELATIVE_PATH
+ {"RELATIVE_PATH", ERR_LIB_CONF, CONF_R_RELATIVE_PATH},
+ #else
+ {"RELATIVE_PATH", 14, 125},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 14, 117},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 14, 119},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 14, 120},
+ #endif
+ #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION
+ {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION},
+ #else
+ {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103},
+ #endif
+ #ifdef CONF_R_UNKNOWN_MODULE_NAME
+ {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME},
+ #else
+ {"UNKNOWN_MODULE_NAME", 14, 113},
+ #endif
+ #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG
+ {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG},
+ #else
+ {"VARIABLE_EXPANSION_TOO_LONG", 14, 116},
+ #endif
+ #ifdef CONF_R_VARIABLE_HAS_NO_VALUE
+ {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE},
+ #else
+ {"VARIABLE_HAS_NO_VALUE", 14, 104},
+ #endif
+ #ifdef CRMF_R_BAD_PBM_ITERATIONCOUNT
+ {"BAD_PBM_ITERATIONCOUNT", ERR_LIB_CRMF, CRMF_R_BAD_PBM_ITERATIONCOUNT},
+ #else
+ {"BAD_PBM_ITERATIONCOUNT", 56, 100},
+ #endif
+ #ifdef CRMF_R_CRMFERROR
+ {"CRMFERROR", ERR_LIB_CRMF, CRMF_R_CRMFERROR},
+ #else
+ {"CRMFERROR", 56, 102},
+ #endif
+ #ifdef CRMF_R_ERROR
+ {"ERROR", ERR_LIB_CRMF, CRMF_R_ERROR},
+ #else
+ {"ERROR", 56, 103},
+ #endif
+ #ifdef CRMF_R_ERROR_DECODING_CERTIFICATE
+ {"ERROR_DECODING_CERTIFICATE", ERR_LIB_CRMF, CRMF_R_ERROR_DECODING_CERTIFICATE},
+ #else
+ {"ERROR_DECODING_CERTIFICATE", 56, 104},
+ #endif
+ #ifdef CRMF_R_ERROR_DECRYPTING_CERTIFICATE
+ {"ERROR_DECRYPTING_CERTIFICATE", ERR_LIB_CRMF, CRMF_R_ERROR_DECRYPTING_CERTIFICATE},
+ #else
+ {"ERROR_DECRYPTING_CERTIFICATE", 56, 105},
+ #endif
+ #ifdef CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY
+ {"ERROR_DECRYPTING_SYMMETRIC_KEY", ERR_LIB_CRMF, CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY},
+ #else
+ {"ERROR_DECRYPTING_SYMMETRIC_KEY", 56, 106},
+ #endif
+ #ifdef CRMF_R_FAILURE_OBTAINING_RANDOM
+ {"FAILURE_OBTAINING_RANDOM", ERR_LIB_CRMF, CRMF_R_FAILURE_OBTAINING_RANDOM},
+ #else
+ {"FAILURE_OBTAINING_RANDOM", 56, 107},
+ #endif
+ #ifdef CRMF_R_ITERATIONCOUNT_BELOW_100
+ {"ITERATIONCOUNT_BELOW_100", ERR_LIB_CRMF, CRMF_R_ITERATIONCOUNT_BELOW_100},
+ #else
+ {"ITERATIONCOUNT_BELOW_100", 56, 108},
+ #endif
+ #ifdef CRMF_R_MALFORMED_IV
+ {"MALFORMED_IV", ERR_LIB_CRMF, CRMF_R_MALFORMED_IV},
+ #else
+ {"MALFORMED_IV", 56, 101},
+ #endif
+ #ifdef CRMF_R_NULL_ARGUMENT
+ {"NULL_ARGUMENT", ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT},
+ #else
+ {"NULL_ARGUMENT", 56, 109},
+ #endif
+ #ifdef CRMF_R_POPOSKINPUT_NOT_SUPPORTED
+ {"POPOSKINPUT_NOT_SUPPORTED", ERR_LIB_CRMF, CRMF_R_POPOSKINPUT_NOT_SUPPORTED},
+ #else
+ {"POPOSKINPUT_NOT_SUPPORTED", 56, 113},
+ #endif
+ #ifdef CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY
+ {"POPO_INCONSISTENT_PUBLIC_KEY", ERR_LIB_CRMF, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY},
+ #else
+ {"POPO_INCONSISTENT_PUBLIC_KEY", 56, 117},
+ #endif
+ #ifdef CRMF_R_POPO_MISSING
+ {"POPO_MISSING", ERR_LIB_CRMF, CRMF_R_POPO_MISSING},
+ #else
+ {"POPO_MISSING", 56, 121},
+ #endif
+ #ifdef CRMF_R_POPO_MISSING_PUBLIC_KEY
+ {"POPO_MISSING_PUBLIC_KEY", ERR_LIB_CRMF, CRMF_R_POPO_MISSING_PUBLIC_KEY},
+ #else
+ {"POPO_MISSING_PUBLIC_KEY", 56, 118},
+ #endif
+ #ifdef CRMF_R_POPO_MISSING_SUBJECT
+ {"POPO_MISSING_SUBJECT", ERR_LIB_CRMF, CRMF_R_POPO_MISSING_SUBJECT},
+ #else
+ {"POPO_MISSING_SUBJECT", 56, 119},
+ #endif
+ #ifdef CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED
+ {"POPO_RAVERIFIED_NOT_ACCEPTED", ERR_LIB_CRMF, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED},
+ #else
+ {"POPO_RAVERIFIED_NOT_ACCEPTED", 56, 120},
+ #endif
+ #ifdef CRMF_R_SETTING_MAC_ALGOR_FAILURE
+ {"SETTING_MAC_ALGOR_FAILURE", ERR_LIB_CRMF, CRMF_R_SETTING_MAC_ALGOR_FAILURE},
+ #else
+ {"SETTING_MAC_ALGOR_FAILURE", 56, 110},
+ #endif
+ #ifdef CRMF_R_SETTING_OWF_ALGOR_FAILURE
+ {"SETTING_OWF_ALGOR_FAILURE", ERR_LIB_CRMF, CRMF_R_SETTING_OWF_ALGOR_FAILURE},
+ #else
+ {"SETTING_OWF_ALGOR_FAILURE", 56, 111},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 56, 112},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 56, 114},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO
+ {"UNSUPPORTED_METHOD_FOR_CREATING_POPO", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO},
+ #else
+ {"UNSUPPORTED_METHOD_FOR_CREATING_POPO", 56, 115},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_POPO_METHOD
+ {"UNSUPPORTED_POPO_METHOD", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_POPO_METHOD},
+ #else
+ {"UNSUPPORTED_POPO_METHOD", 56, 116},
+ #endif
+ #ifdef CRYPTO_R_BAD_ALGORITHM_NAME
+ {"BAD_ALGORITHM_NAME", ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME},
+ #else
+ {"BAD_ALGORITHM_NAME", 15, 117},
+ #endif
+ #ifdef CRYPTO_R_CONFLICTING_NAMES
+ {"CONFLICTING_NAMES", ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES},
+ #else
+ {"CONFLICTING_NAMES", 15, 118},
+ #endif
+ #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED
+ {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED},
+ #else
+ {"FIPS_MODE_NOT_SUPPORTED", 15, 101},
+ #endif
+ #ifdef CRYPTO_R_HEX_STRING_TOO_SHORT
+ {"HEX_STRING_TOO_SHORT", ERR_LIB_CRYPTO, CRYPTO_R_HEX_STRING_TOO_SHORT},
+ #else
+ {"HEX_STRING_TOO_SHORT", 15, 121},
+ #endif
+ #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT
+ {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT},
+ #else
+ {"ILLEGAL_HEX_DIGIT", 15, 102},
+ #endif
+ #ifdef CRYPTO_R_INSUFFICIENT_DATA_SPACE
+ {"INSUFFICIENT_DATA_SPACE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_DATA_SPACE},
+ #else
+ {"INSUFFICIENT_DATA_SPACE", 15, 106},
+ #endif
+ #ifdef CRYPTO_R_INSUFFICIENT_PARAM_SIZE
+ {"INSUFFICIENT_PARAM_SIZE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_PARAM_SIZE},
+ #else
+ {"INSUFFICIENT_PARAM_SIZE", 15, 107},
+ #endif
+ #ifdef CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE
+ {"INSUFFICIENT_SECURE_DATA_SPACE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE},
+ #else
+ {"INSUFFICIENT_SECURE_DATA_SPACE", 15, 108},
+ #endif
+ #ifdef CRYPTO_R_INVALID_NEGATIVE_VALUE
+ {"INVALID_NEGATIVE_VALUE", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_NEGATIVE_VALUE},
+ #else
+ {"INVALID_NEGATIVE_VALUE", 15, 122},
+ #endif
+ #ifdef CRYPTO_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 15, 109},
+ #endif
+ #ifdef CRYPTO_R_INVALID_OSSL_PARAM_TYPE
+ {"INVALID_OSSL_PARAM_TYPE", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_OSSL_PARAM_TYPE},
+ #else
+ {"INVALID_OSSL_PARAM_TYPE", 15, 110},
+ #endif
+ #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS
+ {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS},
+ #else
+ {"ODD_NUMBER_OF_DIGITS", 15, 103},
+ #endif
+ #ifdef CRYPTO_R_PROVIDER_ALREADY_EXISTS
+ {"PROVIDER_ALREADY_EXISTS", ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_ALREADY_EXISTS},
+ #else
+ {"PROVIDER_ALREADY_EXISTS", 15, 104},
+ #endif
+ #ifdef CRYPTO_R_PROVIDER_SECTION_ERROR
+ {"PROVIDER_SECTION_ERROR", ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_SECTION_ERROR},
+ #else
+ {"PROVIDER_SECTION_ERROR", 15, 105},
+ #endif
+ #ifdef CRYPTO_R_RANDOM_SECTION_ERROR
+ {"RANDOM_SECTION_ERROR", ERR_LIB_CRYPTO, CRYPTO_R_RANDOM_SECTION_ERROR},
+ #else
+ {"RANDOM_SECTION_ERROR", 15, 119},
+ #endif
+ #ifdef CRYPTO_R_SECURE_MALLOC_FAILURE
+ {"SECURE_MALLOC_FAILURE", ERR_LIB_CRYPTO, CRYPTO_R_SECURE_MALLOC_FAILURE},
+ #else
+ {"SECURE_MALLOC_FAILURE", 15, 111},
+ #endif
+ #ifdef CRYPTO_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_CRYPTO, CRYPTO_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 15, 112},
+ #endif
+ #ifdef CRYPTO_R_TOO_MANY_BYTES
+ {"TOO_MANY_BYTES", ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES},
+ #else
+ {"TOO_MANY_BYTES", 15, 113},
+ #endif
+ #ifdef CRYPTO_R_TOO_MANY_RECORDS
+ {"TOO_MANY_RECORDS", ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS},
+ #else
+ {"TOO_MANY_RECORDS", 15, 114},
+ #endif
+ #ifdef CRYPTO_R_TOO_SMALL_BUFFER
+ {"TOO_SMALL_BUFFER", ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER},
+ #else
+ {"TOO_SMALL_BUFFER", 15, 116},
+ #endif
+ #ifdef CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION
+ {"UNKNOWN_NAME_IN_RANDOM_SECTION", ERR_LIB_CRYPTO, CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION},
+ #else
+ {"UNKNOWN_NAME_IN_RANDOM_SECTION", 15, 120},
+ #endif
+ #ifdef CRYPTO_R_ZERO_LENGTH_NUMBER
+ {"ZERO_LENGTH_NUMBER", ERR_LIB_CRYPTO, CRYPTO_R_ZERO_LENGTH_NUMBER},
+ #else
+ {"ZERO_LENGTH_NUMBER", 15, 115},
+ #endif
+ #ifdef CT_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 50, 108},
+ #endif
+ #ifdef CT_R_INVALID_LOG_ID_LENGTH
+ {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH},
+ #else
+ {"INVALID_LOG_ID_LENGTH", 50, 100},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID
+ {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID},
+ #else
+ {"LOG_CONF_INVALID", 50, 109},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID_KEY
+ {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY},
+ #else
+ {"LOG_CONF_INVALID_KEY", 50, 110},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION
+ {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION},
+ #else
+ {"LOG_CONF_MISSING_DESCRIPTION", 50, 111},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_KEY
+ {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY},
+ #else
+ {"LOG_CONF_MISSING_KEY", 50, 112},
+ #endif
+ #ifdef CT_R_LOG_KEY_INVALID
+ {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID},
+ #else
+ {"LOG_KEY_INVALID", 50, 113},
+ #endif
+ #ifdef CT_R_SCT_FUTURE_TIMESTAMP
+ {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP},
+ #else
+ {"SCT_FUTURE_TIMESTAMP", 50, 116},
+ #endif
+ #ifdef CT_R_SCT_INVALID
+ {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID},
+ #else
+ {"SCT_INVALID", 50, 104},
+ #endif
+ #ifdef CT_R_SCT_INVALID_SIGNATURE
+ {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE},
+ #else
+ {"SCT_INVALID_SIGNATURE", 50, 107},
+ #endif
+ #ifdef CT_R_SCT_LIST_INVALID
+ {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID},
+ #else
+ {"SCT_LIST_INVALID", 50, 105},
+ #endif
+ #ifdef CT_R_SCT_LOG_ID_MISMATCH
+ {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH},
+ #else
+ {"SCT_LOG_ID_MISMATCH", 50, 114},
+ #endif
+ #ifdef CT_R_SCT_NOT_SET
+ {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET},
+ #else
+ {"SCT_NOT_SET", 50, 106},
+ #endif
+ #ifdef CT_R_SCT_UNSUPPORTED_VERSION
+ {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION},
+ #else
+ {"SCT_UNSUPPORTED_VERSION", 50, 115},
+ #endif
+ #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID
+ {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID},
+ #else
+ {"UNRECOGNIZED_SIGNATURE_NID", 50, 101},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE
+ {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE},
+ #else
+ {"UNSUPPORTED_ENTRY_TYPE", 50, 102},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 50, 103},
+ #endif
+ #ifdef DH_R_BAD_FFC_PARAMETERS
+ {"BAD_FFC_PARAMETERS", ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS},
+ #else
+ {"BAD_FFC_PARAMETERS", 5, 127},
+ #endif
+ #ifdef DH_R_BAD_GENERATOR
+ {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR},
+ #else
+ {"BAD_GENERATOR", 5, 101},
+ #endif
+ #ifdef DH_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 5, 109},
+ #endif
+ #ifdef DH_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 5, 106},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_J_VALUE
+ {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE},
+ #else
+ {"CHECK_INVALID_J_VALUE", 5, 115},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_Q_VALUE
+ {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE},
+ #else
+ {"CHECK_INVALID_Q_VALUE", 5, 116},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_INVALID
+ {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID},
+ #else
+ {"CHECK_PUBKEY_INVALID", 5, 122},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE
+ {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE},
+ #else
+ {"CHECK_PUBKEY_TOO_LARGE", 5, 123},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL
+ {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL},
+ #else
+ {"CHECK_PUBKEY_TOO_SMALL", 5, 124},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_PRIME
+ {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME},
+ #else
+ {"CHECK_P_NOT_PRIME", 5, 117},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME
+ {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME},
+ #else
+ {"CHECK_P_NOT_SAFE_PRIME", 5, 118},
+ #endif
+ #ifdef DH_R_CHECK_Q_NOT_PRIME
+ {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME},
+ #else
+ {"CHECK_Q_NOT_PRIME", 5, 119},
+ #endif
+ #ifdef DH_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 5, 104},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NAME
+ {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME},
+ #else
+ {"INVALID_PARAMETER_NAME", 5, 110},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NID
+ {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID},
+ #else
+ {"INVALID_PARAMETER_NID", 5, 114},
+ #endif
+ #ifdef DH_R_INVALID_PUBKEY
+ {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY},
+ #else
+ {"INVALID_PUBKEY", 5, 102},
+ #endif
+ #ifdef DH_R_INVALID_SECRET
+ {"INVALID_SECRET", ERR_LIB_DH, DH_R_INVALID_SECRET},
+ #else
+ {"INVALID_SECRET", 5, 128},
+ #endif
+ #ifdef DH_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 5, 112},
+ #endif
+ #ifdef DH_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 5, 108},
+ #endif
+ #ifdef DH_R_MISSING_PUBKEY
+ {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY},
+ #else
+ {"MISSING_PUBKEY", 5, 125},
+ #endif
+ #ifdef DH_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 5, 103},
+ #endif
+ #ifdef DH_R_MODULUS_TOO_SMALL
+ {"MODULUS_TOO_SMALL", ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL},
+ #else
+ {"MODULUS_TOO_SMALL", 5, 126},
+ #endif
+ #ifdef DH_R_NOT_SUITABLE_GENERATOR
+ {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR},
+ #else
+ {"NOT_SUITABLE_GENERATOR", 5, 120},
+ #endif
+ #ifdef DH_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 5, 107},
+ #endif
+ #ifdef DH_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 5, 100},
+ #endif
+ #ifdef DH_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 5, 105},
+ #endif
+ #ifdef DH_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 5, 111},
+ #endif
+ #ifdef DH_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 5, 113},
+ #endif
+ #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR
+ {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR},
+ #else
+ {"UNABLE_TO_CHECK_GENERATOR", 5, 121},
+ #endif
+ #ifdef DSA_R_BAD_FFC_PARAMETERS
+ {"BAD_FFC_PARAMETERS", ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS},
+ #else
+ {"BAD_FFC_PARAMETERS", 10, 114},
+ #endif
+ #ifdef DSA_R_BAD_Q_VALUE
+ {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE},
+ #else
+ {"BAD_Q_VALUE", 10, 102},
+ #endif
+ #ifdef DSA_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 10, 108},
+ #endif
+ #ifdef DSA_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 10, 109},
+ #endif
+ #ifdef DSA_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 10, 104},
+ #endif
+ #ifdef DSA_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 10, 106},
+ #endif
+ #ifdef DSA_R_INVALID_PARAMETERS
+ {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS},
+ #else
+ {"INVALID_PARAMETERS", 10, 112},
+ #endif
+ #ifdef DSA_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 10, 101},
+ #endif
+ #ifdef DSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 10, 111},
+ #endif
+ #ifdef DSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 10, 103},
+ #endif
+ #ifdef DSA_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 10, 107},
+ #endif
+ #ifdef DSA_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 10, 105},
+ #endif
+ #ifdef DSA_R_P_NOT_PRIME
+ {"P_NOT_PRIME", ERR_LIB_DSA, DSA_R_P_NOT_PRIME},
+ #else
+ {"P_NOT_PRIME", 10, 115},
+ #endif
+ #ifdef DSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 10, 113},
+ #endif
+ #ifdef DSA_R_SEED_LEN_SMALL
+ {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL},
+ #else
+ {"SEED_LEN_SMALL", 10, 110},
+ #endif
+ #ifdef DSA_R_TOO_MANY_RETRIES
+ {"TOO_MANY_RETRIES", ERR_LIB_DSA, DSA_R_TOO_MANY_RETRIES},
+ #else
+ {"TOO_MANY_RETRIES", 10, 116},
+ #endif
+ #ifdef DSO_R_CTRL_FAILED
+ {"CTRL_FAILED", ERR_LIB_DSO, DSO_R_CTRL_FAILED},
+ #else
+ {"CTRL_FAILED", 37, 100},
+ #endif
+ #ifdef DSO_R_DSO_ALREADY_LOADED
+ {"DSO_ALREADY_LOADED", ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED},
+ #else
+ {"DSO_ALREADY_LOADED", 37, 110},
+ #endif
+ #ifdef DSO_R_EMPTY_FILE_STRUCTURE
+ {"EMPTY_FILE_STRUCTURE", ERR_LIB_DSO, DSO_R_EMPTY_FILE_STRUCTURE},
+ #else
+ {"EMPTY_FILE_STRUCTURE", 37, 113},
+ #endif
+ #ifdef DSO_R_FAILURE
+ {"FAILURE", ERR_LIB_DSO, DSO_R_FAILURE},
+ #else
+ {"FAILURE", 37, 114},
+ #endif
+ #ifdef DSO_R_FILENAME_TOO_BIG
+ {"FILENAME_TOO_BIG", ERR_LIB_DSO, DSO_R_FILENAME_TOO_BIG},
+ #else
+ {"FILENAME_TOO_BIG", 37, 101},
+ #endif
+ #ifdef DSO_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_DSO, DSO_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 37, 102},
+ #endif
+ #ifdef DSO_R_INCORRECT_FILE_SYNTAX
+ {"INCORRECT_FILE_SYNTAX", ERR_LIB_DSO, DSO_R_INCORRECT_FILE_SYNTAX},
+ #else
+ {"INCORRECT_FILE_SYNTAX", 37, 115},
+ #endif
+ #ifdef DSO_R_LOAD_FAILED
+ {"LOAD_FAILED", ERR_LIB_DSO, DSO_R_LOAD_FAILED},
+ #else
+ {"LOAD_FAILED", 37, 103},
+ #endif
+ #ifdef DSO_R_NAME_TRANSLATION_FAILED
+ {"NAME_TRANSLATION_FAILED", ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED},
+ #else
+ {"NAME_TRANSLATION_FAILED", 37, 109},
+ #endif
+ #ifdef DSO_R_NO_FILENAME
+ {"NO_FILENAME", ERR_LIB_DSO, DSO_R_NO_FILENAME},
+ #else
+ {"NO_FILENAME", 37, 111},
+ #endif
+ #ifdef DSO_R_NULL_HANDLE
+ {"NULL_HANDLE", ERR_LIB_DSO, DSO_R_NULL_HANDLE},
+ #else
+ {"NULL_HANDLE", 37, 104},
+ #endif
+ #ifdef DSO_R_SET_FILENAME_FAILED
+ {"SET_FILENAME_FAILED", ERR_LIB_DSO, DSO_R_SET_FILENAME_FAILED},
+ #else
+ {"SET_FILENAME_FAILED", 37, 112},
+ #endif
+ #ifdef DSO_R_STACK_ERROR
+ {"STACK_ERROR", ERR_LIB_DSO, DSO_R_STACK_ERROR},
+ #else
+ {"STACK_ERROR", 37, 105},
+ #endif
+ #ifdef DSO_R_SYM_FAILURE
+ {"SYM_FAILURE", ERR_LIB_DSO, DSO_R_SYM_FAILURE},
+ #else
+ {"SYM_FAILURE", 37, 106},
+ #endif
+ #ifdef DSO_R_UNLOAD_FAILED
+ {"UNLOAD_FAILED", ERR_LIB_DSO, DSO_R_UNLOAD_FAILED},
+ #else
+ {"UNLOAD_FAILED", 37, 107},
+ #endif
+ #ifdef DSO_R_UNSUPPORTED
+ {"UNSUPPORTED", ERR_LIB_DSO, DSO_R_UNSUPPORTED},
+ #else
+ {"UNSUPPORTED", 37, 108},
+ #endif
+ #ifdef EC_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 16, 115},
+ #endif
+ #ifdef EC_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 16, 156},
+ #endif
+ #ifdef EC_R_BIGNUM_OUT_OF_RANGE
+ {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE},
+ #else
+ {"BIGNUM_OUT_OF_RANGE", 16, 144},
+ #endif
+ #ifdef EC_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 16, 100},
+ #endif
+ #ifdef EC_R_CANNOT_INVERT
+ {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT},
+ #else
+ {"CANNOT_INVERT", 16, 165},
+ #endif
+ #ifdef EC_R_COORDINATES_OUT_OF_RANGE
+ {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE},
+ #else
+ {"COORDINATES_OUT_OF_RANGE", 16, 146},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA
+ {"CURVE_DOES_NOT_SUPPORT_ECDSA", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_ECDSA", 16, 170},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159},
+ #endif
+ #ifdef EC_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 16, 142},
+ #endif
+ #ifdef EC_R_DISCRIMINANT_IS_ZERO
+ {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO},
+ #else
+ {"DISCRIMINANT_IS_ZERO", 16, 118},
+ #endif
+ #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE},
+ #else
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119},
+ #endif
+ #ifdef EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED
+ {"EXPLICIT_PARAMS_NOT_SUPPORTED", ERR_LIB_EC, EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED},
+ #else
+ {"EXPLICIT_PARAMS_NOT_SUPPORTED", 16, 127},
+ #endif
+ #ifdef EC_R_FAILED_MAKING_PUBLIC_KEY
+ {"FAILED_MAKING_PUBLIC_KEY", ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY},
+ #else
+ {"FAILED_MAKING_PUBLIC_KEY", 16, 166},
+ #endif
+ #ifdef EC_R_FIELD_TOO_LARGE
+ {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE},
+ #else
+ {"FIELD_TOO_LARGE", 16, 143},
+ #endif
+ #ifdef EC_R_GF2M_NOT_SUPPORTED
+ {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED},
+ #else
+ {"GF2M_NOT_SUPPORTED", 16, 147},
+ #endif
+ #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE
+ {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE},
+ #else
+ {"GROUP2PKPARAMETERS_FAILURE", 16, 120},
+ #endif
+ #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE
+ {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE},
+ #else
+ {"I2D_ECPKPARAMETERS_FAILURE", 16, 121},
+ #endif
+ #ifdef EC_R_INCOMPATIBLE_OBJECTS
+ {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS},
+ #else
+ {"INCOMPATIBLE_OBJECTS", 16, 101},
+ #endif
+ #ifdef EC_R_INVALID_A
+ {"INVALID_A", ERR_LIB_EC, EC_R_INVALID_A},
+ #else
+ {"INVALID_A", 16, 168},
+ #endif
+ #ifdef EC_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 16, 112},
+ #endif
+ #ifdef EC_R_INVALID_B
+ {"INVALID_B", ERR_LIB_EC, EC_R_INVALID_B},
+ #else
+ {"INVALID_B", 16, 169},
+ #endif
+ #ifdef EC_R_INVALID_COFACTOR
+ {"INVALID_COFACTOR", ERR_LIB_EC, EC_R_INVALID_COFACTOR},
+ #else
+ {"INVALID_COFACTOR", 16, 171},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSED_POINT
+ {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT},
+ #else
+ {"INVALID_COMPRESSED_POINT", 16, 110},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSION_BIT
+ {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT},
+ #else
+ {"INVALID_COMPRESSION_BIT", 16, 109},
+ #endif
+ #ifdef EC_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 16, 141},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 16, 151},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 16, 138},
+ #endif
+ #ifdef EC_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 16, 102},
+ #endif
+ #ifdef EC_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 16, 103},
+ #endif
+ #ifdef EC_R_INVALID_FORM
+ {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM},
+ #else
+ {"INVALID_FORM", 16, 104},
+ #endif
+ #ifdef EC_R_INVALID_GENERATOR
+ {"INVALID_GENERATOR", ERR_LIB_EC, EC_R_INVALID_GENERATOR},
+ #else
+ {"INVALID_GENERATOR", 16, 173},
+ #endif
+ #ifdef EC_R_INVALID_GROUP_ORDER
+ {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER},
+ #else
+ {"INVALID_GROUP_ORDER", 16, 122},
+ #endif
+ #ifdef EC_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 16, 116},
+ #endif
+ #ifdef EC_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_EC, EC_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 16, 117},
+ #endif
+ #ifdef EC_R_INVALID_NAMED_GROUP_CONVERSION
+ {"INVALID_NAMED_GROUP_CONVERSION", ERR_LIB_EC, EC_R_INVALID_NAMED_GROUP_CONVERSION},
+ #else
+ {"INVALID_NAMED_GROUP_CONVERSION", 16, 174},
+ #endif
+ #ifdef EC_R_INVALID_OUTPUT_LENGTH
+ {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH},
+ #else
+ {"INVALID_OUTPUT_LENGTH", 16, 161},
+ #endif
+ #ifdef EC_R_INVALID_P
+ {"INVALID_P", ERR_LIB_EC, EC_R_INVALID_P},
+ #else
+ {"INVALID_P", 16, 172},
+ #endif
+ #ifdef EC_R_INVALID_PEER_KEY
+ {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY},
+ #else
+ {"INVALID_PEER_KEY", 16, 133},
+ #endif
+ #ifdef EC_R_INVALID_PENTANOMIAL_BASIS
+ {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS},
+ #else
+ {"INVALID_PENTANOMIAL_BASIS", 16, 132},
+ #endif
+ #ifdef EC_R_INVALID_PRIVATE_KEY
+ {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY},
+ #else
+ {"INVALID_PRIVATE_KEY", 16, 123},
+ #endif
+ #ifdef EC_R_INVALID_SEED
+ {"INVALID_SEED", ERR_LIB_EC, EC_R_INVALID_SEED},
+ #else
+ {"INVALID_SEED", 16, 175},
+ #endif
+ #ifdef EC_R_INVALID_TRINOMIAL_BASIS
+ {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS},
+ #else
+ {"INVALID_TRINOMIAL_BASIS", 16, 137},
+ #endif
+ #ifdef EC_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 16, 148},
+ #endif
+ #ifdef EC_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 16, 140},
+ #endif
+ #ifdef EC_R_LADDER_POST_FAILURE
+ {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE},
+ #else
+ {"LADDER_POST_FAILURE", 16, 136},
+ #endif
+ #ifdef EC_R_LADDER_PRE_FAILURE
+ {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE},
+ #else
+ {"LADDER_PRE_FAILURE", 16, 153},
+ #endif
+ #ifdef EC_R_LADDER_STEP_FAILURE
+ {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE},
+ #else
+ {"LADDER_STEP_FAILURE", 16, 162},
+ #endif
+ #ifdef EC_R_MISSING_OID
+ {"MISSING_OID", ERR_LIB_EC, EC_R_MISSING_OID},
+ #else
+ {"MISSING_OID", 16, 167},
+ #endif
+ #ifdef EC_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 16, 124},
+ #endif
+ #ifdef EC_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 16, 125},
+ #endif
+ #ifdef EC_R_NEED_NEW_SETUP_VALUES
+ {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES},
+ #else
+ {"NEED_NEW_SETUP_VALUES", 16, 157},
+ #endif
+ #ifdef EC_R_NOT_A_NIST_PRIME
+ {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME},
+ #else
+ {"NOT_A_NIST_PRIME", 16, 135},
+ #endif
+ #ifdef EC_R_NOT_IMPLEMENTED
+ {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED},
+ #else
+ {"NOT_IMPLEMENTED", 16, 126},
+ #endif
+ #ifdef EC_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 16, 111},
+ #endif
+ #ifdef EC_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 16, 139},
+ #endif
+ #ifdef EC_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 16, 154},
+ #endif
+ #ifdef EC_R_OPERATION_NOT_SUPPORTED
+ {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED},
+ #else
+ {"OPERATION_NOT_SUPPORTED", 16, 152},
+ #endif
+ #ifdef EC_R_PASSED_NULL_PARAMETER
+ {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER},
+ #else
+ {"PASSED_NULL_PARAMETER", 16, 134},
+ #endif
+ #ifdef EC_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 16, 149},
+ #endif
+ #ifdef EC_R_POINT_ARITHMETIC_FAILURE
+ {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE},
+ #else
+ {"POINT_ARITHMETIC_FAILURE", 16, 155},
+ #endif
+ #ifdef EC_R_POINT_AT_INFINITY
+ {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY},
+ #else
+ {"POINT_AT_INFINITY", 16, 106},
+ #endif
+ #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE
+ {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE},
+ #else
+ {"POINT_COORDINATES_BLIND_FAILURE", 16, 163},
+ #endif
+ #ifdef EC_R_POINT_IS_NOT_ON_CURVE
+ {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE},
+ #else
+ {"POINT_IS_NOT_ON_CURVE", 16, 107},
+ #endif
+ #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED
+ {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED},
+ #else
+ {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158},
+ #endif
+ #ifdef EC_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 16, 150},
+ #endif
+ #ifdef EC_R_SLOT_FULL
+ {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL},
+ #else
+ {"SLOT_FULL", 16, 108},
+ #endif
+ #ifdef EC_R_TOO_MANY_RETRIES
+ {"TOO_MANY_RETRIES", ERR_LIB_EC, EC_R_TOO_MANY_RETRIES},
+ #else
+ {"TOO_MANY_RETRIES", 16, 176},
+ #endif
+ #ifdef EC_R_UNDEFINED_GENERATOR
+ {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR},
+ #else
+ {"UNDEFINED_GENERATOR", 16, 113},
+ #endif
+ #ifdef EC_R_UNDEFINED_ORDER
+ {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER},
+ #else
+ {"UNDEFINED_ORDER", 16, 128},
+ #endif
+ #ifdef EC_R_UNKNOWN_COFACTOR
+ {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR},
+ #else
+ {"UNKNOWN_COFACTOR", 16, 164},
+ #endif
+ #ifdef EC_R_UNKNOWN_GROUP
+ {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP},
+ #else
+ {"UNKNOWN_GROUP", 16, 129},
+ #endif
+ #ifdef EC_R_UNKNOWN_ORDER
+ {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER},
+ #else
+ {"UNKNOWN_ORDER", 16, 114},
+ #endif
+ #ifdef EC_R_UNSUPPORTED_FIELD
+ {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD},
+ #else
+ {"UNSUPPORTED_FIELD", 16, 131},
+ #endif
+ #ifdef EC_R_WRONG_CURVE_PARAMETERS
+ {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS},
+ #else
+ {"WRONG_CURVE_PARAMETERS", 16, 145},
+ #endif
+ #ifdef EC_R_WRONG_ORDER
+ {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER},
+ #else
+ {"WRONG_ORDER", 16, 130},
+ #endif
+ #ifdef ENGINE_R_ALREADY_LOADED
+ {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED},
+ #else
+ {"ALREADY_LOADED", 38, 100},
+ #endif
+ #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER
+ {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER},
+ #else
+ {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133},
+ #endif
+ #ifdef ENGINE_R_CMD_NOT_EXECUTABLE
+ {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE},
+ #else
+ {"CMD_NOT_EXECUTABLE", 38, 134},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_INPUT
+ {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT},
+ #else
+ {"COMMAND_TAKES_INPUT", 38, 135},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT
+ {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT},
+ #else
+ {"COMMAND_TAKES_NO_INPUT", 38, 136},
+ #endif
+ #ifdef ENGINE_R_CONFLICTING_ENGINE_ID
+ {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID},
+ #else
+ {"CONFLICTING_ENGINE_ID", 38, 103},
+ #endif
+ #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119},
+ #endif
+ #ifdef ENGINE_R_DSO_FAILURE
+ {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE},
+ #else
+ {"DSO_FAILURE", 38, 104},
+ #endif
+ #ifdef ENGINE_R_DSO_NOT_FOUND
+ {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND},
+ #else
+ {"DSO_NOT_FOUND", 38, 132},
+ #endif
+ #ifdef ENGINE_R_ENGINES_SECTION_ERROR
+ {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR},
+ #else
+ {"ENGINES_SECTION_ERROR", 38, 148},
+ #endif
+ #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR
+ {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR},
+ #else
+ {"ENGINE_CONFIGURATION_ERROR", 38, 102},
+ #endif
+ #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST
+ {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST},
+ #else
+ {"ENGINE_IS_NOT_IN_LIST", 38, 105},
+ #endif
+ #ifdef ENGINE_R_ENGINE_SECTION_ERROR
+ {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR},
+ #else
+ {"ENGINE_SECTION_ERROR", 38, 149},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY
+ {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY},
+ #else
+ {"FAILED_LOADING_PRIVATE_KEY", 38, 128},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY
+ {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY},
+ #else
+ {"FAILED_LOADING_PUBLIC_KEY", 38, 129},
+ #endif
+ #ifdef ENGINE_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 38, 106},
+ #endif
+ #ifdef ENGINE_R_ID_OR_NAME_MISSING
+ {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING},
+ #else
+ {"ID_OR_NAME_MISSING", 38, 108},
+ #endif
+ #ifdef ENGINE_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 38, 109},
+ #endif
+ #ifdef ENGINE_R_INTERNAL_LIST_ERROR
+ {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR},
+ #else
+ {"INTERNAL_LIST_ERROR", 38, 110},
+ #endif
+ #ifdef ENGINE_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 38, 143},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NAME
+ {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME},
+ #else
+ {"INVALID_CMD_NAME", 38, 137},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NUMBER
+ {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER},
+ #else
+ {"INVALID_CMD_NUMBER", 38, 138},
+ #endif
+ #ifdef ENGINE_R_INVALID_INIT_VALUE
+ {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE},
+ #else
+ {"INVALID_INIT_VALUE", 38, 151},
+ #endif
+ #ifdef ENGINE_R_INVALID_STRING
+ {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING},
+ #else
+ {"INVALID_STRING", 38, 150},
+ #endif
+ #ifdef ENGINE_R_NOT_INITIALISED
+ {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED},
+ #else
+ {"NOT_INITIALISED", 38, 117},
+ #endif
+ #ifdef ENGINE_R_NOT_LOADED
+ {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED},
+ #else
+ {"NOT_LOADED", 38, 112},
+ #endif
+ #ifdef ENGINE_R_NO_CONTROL_FUNCTION
+ {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION},
+ #else
+ {"NO_CONTROL_FUNCTION", 38, 120},
+ #endif
+ #ifdef ENGINE_R_NO_INDEX
+ {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX},
+ #else
+ {"NO_INDEX", 38, 144},
+ #endif
+ #ifdef ENGINE_R_NO_LOAD_FUNCTION
+ {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION},
+ #else
+ {"NO_LOAD_FUNCTION", 38, 125},
+ #endif
+ #ifdef ENGINE_R_NO_REFERENCE
+ {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE},
+ #else
+ {"NO_REFERENCE", 38, 130},
+ #endif
+ #ifdef ENGINE_R_NO_SUCH_ENGINE
+ {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE},
+ #else
+ {"NO_SUCH_ENGINE", 38, 116},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER
+ {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER},
+ #else
+ {"UNIMPLEMENTED_CIPHER", 38, 146},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST
+ {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST},
+ #else
+ {"UNIMPLEMENTED_DIGEST", 38, 147},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD},
+ #else
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101},
+ #endif
+ #ifdef ENGINE_R_VERSION_INCOMPATIBILITY
+ {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY},
+ #else
+ {"VERSION_INCOMPATIBILITY", 38, 145},
+ #endif
+ #ifdef ESS_R_EMPTY_ESS_CERT_ID_LIST
+ {"EMPTY_ESS_CERT_ID_LIST", ERR_LIB_ESS, ESS_R_EMPTY_ESS_CERT_ID_LIST},
+ #else
+ {"EMPTY_ESS_CERT_ID_LIST", 54, 107},
+ #endif
+ #ifdef ESS_R_ESS_CERT_DIGEST_ERROR
+ {"ESS_CERT_DIGEST_ERROR", ERR_LIB_ESS, ESS_R_ESS_CERT_DIGEST_ERROR},
+ #else
+ {"ESS_CERT_DIGEST_ERROR", 54, 103},
+ #endif
+ #ifdef ESS_R_ESS_CERT_ID_NOT_FOUND
+ {"ESS_CERT_ID_NOT_FOUND", ERR_LIB_ESS, ESS_R_ESS_CERT_ID_NOT_FOUND},
+ #else
+ {"ESS_CERT_ID_NOT_FOUND", 54, 104},
+ #endif
+ #ifdef ESS_R_ESS_CERT_ID_WRONG_ORDER
+ {"ESS_CERT_ID_WRONG_ORDER", ERR_LIB_ESS, ESS_R_ESS_CERT_ID_WRONG_ORDER},
+ #else
+ {"ESS_CERT_ID_WRONG_ORDER", 54, 105},
+ #endif
+ #ifdef ESS_R_ESS_DIGEST_ALG_UNKNOWN
+ {"ESS_DIGEST_ALG_UNKNOWN", ERR_LIB_ESS, ESS_R_ESS_DIGEST_ALG_UNKNOWN},
+ #else
+ {"ESS_DIGEST_ALG_UNKNOWN", 54, 106},
+ #endif
+ #ifdef ESS_R_ESS_SIGNING_CERTIFICATE_ERROR
+ {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+ #else
+ {"ESS_SIGNING_CERTIFICATE_ERROR", 54, 102},
+ #endif
+ #ifdef ESS_R_ESS_SIGNING_CERT_ADD_ERROR
+ {"ESS_SIGNING_CERT_ADD_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERT_ADD_ERROR},
+ #else
+ {"ESS_SIGNING_CERT_ADD_ERROR", 54, 100},
+ #endif
+ #ifdef ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR
+ {"ESS_SIGNING_CERT_V2_ADD_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR},
+ #else
+ {"ESS_SIGNING_CERT_V2_ADD_ERROR", 54, 101},
+ #endif
+ #ifdef ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE
+ {"MISSING_SIGNING_CERTIFICATE_ATTRIBUTE", ERR_LIB_ESS, ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE},
+ #else
+ {"MISSING_SIGNING_CERTIFICATE_ATTRIBUTE", 54, 108},
+ #endif
+ #ifdef EVP_R_AES_KEY_SETUP_FAILED
+ {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED},
+ #else
+ {"AES_KEY_SETUP_FAILED", 6, 143},
+ #endif
+ #ifdef EVP_R_ARIA_KEY_SETUP_FAILED
+ {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED},
+ #else
+ {"ARIA_KEY_SETUP_FAILED", 6, 176},
+ #endif
+ #ifdef EVP_R_BAD_ALGORITHM_NAME
+ {"BAD_ALGORITHM_NAME", ERR_LIB_EVP, EVP_R_BAD_ALGORITHM_NAME},
+ #else
+ {"BAD_ALGORITHM_NAME", 6, 200},
+ #endif
+ #ifdef EVP_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 6, 100},
+ #endif
+ #ifdef EVP_R_BAD_KEY_LENGTH
+ {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH},
+ #else
+ {"BAD_KEY_LENGTH", 6, 195},
+ #endif
+ #ifdef EVP_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 6, 155},
+ #endif
+ #ifdef EVP_R_CACHE_CONSTANTS_FAILED
+ {"CACHE_CONSTANTS_FAILED", ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED},
+ #else
+ {"CACHE_CONSTANTS_FAILED", 6, 225},
+ #endif
+ #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED
+ {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED},
+ #else
+ {"CAMELLIA_KEY_SETUP_FAILED", 6, 157},
+ #endif
+ #ifdef EVP_R_CANNOT_GET_PARAMETERS
+ {"CANNOT_GET_PARAMETERS", ERR_LIB_EVP, EVP_R_CANNOT_GET_PARAMETERS},
+ #else
+ {"CANNOT_GET_PARAMETERS", 6, 197},
+ #endif
+ #ifdef EVP_R_CANNOT_SET_PARAMETERS
+ {"CANNOT_SET_PARAMETERS", ERR_LIB_EVP, EVP_R_CANNOT_SET_PARAMETERS},
+ #else
+ {"CANNOT_SET_PARAMETERS", 6, 198},
+ #endif
+ #ifdef EVP_R_CIPHER_NOT_GCM_MODE
+ {"CIPHER_NOT_GCM_MODE", ERR_LIB_EVP, EVP_R_CIPHER_NOT_GCM_MODE},
+ #else
+ {"CIPHER_NOT_GCM_MODE", 6, 184},
+ #endif
+ #ifdef EVP_R_CIPHER_PARAMETER_ERROR
+ {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR},
+ #else
+ {"CIPHER_PARAMETER_ERROR", 6, 122},
+ #endif
+ #ifdef EVP_R_COMMAND_NOT_SUPPORTED
+ {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED},
+ #else
+ {"COMMAND_NOT_SUPPORTED", 6, 147},
+ #endif
+ #ifdef EVP_R_CONFLICTING_ALGORITHM_NAME
+ {"CONFLICTING_ALGORITHM_NAME", ERR_LIB_EVP, EVP_R_CONFLICTING_ALGORITHM_NAME},
+ #else
+ {"CONFLICTING_ALGORITHM_NAME", 6, 201},
+ #endif
+ #ifdef EVP_R_COPY_ERROR
+ {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR},
+ #else
+ {"COPY_ERROR", 6, 173},
+ #endif
+ #ifdef EVP_R_CTRL_NOT_IMPLEMENTED
+ {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_NOT_IMPLEMENTED", 6, 132},
+ #endif
+ #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133},
+ #endif
+ #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH},
+ #else
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138},
+ #endif
+ #ifdef EVP_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 6, 114},
+ #endif
+ #ifdef EVP_R_DEFAULT_QUERY_PARSE_ERROR
+ {"DEFAULT_QUERY_PARSE_ERROR", ERR_LIB_EVP, EVP_R_DEFAULT_QUERY_PARSE_ERROR},
+ #else
+ {"DEFAULT_QUERY_PARSE_ERROR", 6, 210},
+ #endif
+ #ifdef EVP_R_DIFFERENT_KEY_TYPES
+ {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES},
+ #else
+ {"DIFFERENT_KEY_TYPES", 6, 101},
+ #endif
+ #ifdef EVP_R_DIFFERENT_PARAMETERS
+ {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS},
+ #else
+ {"DIFFERENT_PARAMETERS", 6, 153},
+ #endif
+ #ifdef EVP_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 6, 165},
+ #endif
+ #ifdef EVP_R_ERROR_SETTING_FIPS_MODE
+ {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE},
+ #else
+ {"ERROR_SETTING_FIPS_MODE", 6, 166},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_HMAC_KEY
+ {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY},
+ #else
+ {"EXPECTING_AN_HMAC_KEY", 6, 174},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_RSA_KEY
+ {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY},
+ #else
+ {"EXPECTING_AN_RSA_KEY", 6, 127},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DH_KEY
+ {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY},
+ #else
+ {"EXPECTING_A_DH_KEY", 6, 128},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DSA_KEY
+ {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY},
+ #else
+ {"EXPECTING_A_DSA_KEY", 6, 129},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_ECX_KEY
+ {"EXPECTING_A_ECX_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_ECX_KEY},
+ #else
+ {"EXPECTING_A_ECX_KEY", 6, 219},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_EC_KEY
+ {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY},
+ #else
+ {"EXPECTING_A_EC_KEY", 6, 142},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_POLY1305_KEY
+ {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY},
+ #else
+ {"EXPECTING_A_POLY1305_KEY", 6, 164},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY
+ {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY},
+ #else
+ {"EXPECTING_A_SIPHASH_KEY", 6, 175},
+ #endif
+ #ifdef EVP_R_FINAL_ERROR
+ {"FINAL_ERROR", ERR_LIB_EVP, EVP_R_FINAL_ERROR},
+ #else
+ {"FINAL_ERROR", 6, 188},
+ #endif
+ #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED
+ {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED},
+ #else
+ {"FIPS_MODE_NOT_SUPPORTED", 6, 167},
+ #endif
+ #ifdef EVP_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_EVP, EVP_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 6, 214},
+ #endif
+ #ifdef EVP_R_GET_RAW_KEY_FAILED
+ {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED},
+ #else
+ {"GET_RAW_KEY_FAILED", 6, 182},
+ #endif
+ #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS
+ {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS},
+ #else
+ {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171},
+ #endif
+ #ifdef EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS
+ {"INACCESSIBLE_DOMAIN_PARAMETERS", ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS},
+ #else
+ {"INACCESSIBLE_DOMAIN_PARAMETERS", 6, 204},
+ #endif
+ #ifdef EVP_R_INACCESSIBLE_KEY
+ {"INACCESSIBLE_KEY", ERR_LIB_EVP, EVP_R_INACCESSIBLE_KEY},
+ #else
+ {"INACCESSIBLE_KEY", 6, 203},
+ #endif
+ #ifdef EVP_R_INITIALIZATION_ERROR
+ {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR},
+ #else
+ {"INITIALIZATION_ERROR", 6, 134},
+ #endif
+ #ifdef EVP_R_INPUT_NOT_INITIALIZED
+ {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED},
+ #else
+ {"INPUT_NOT_INITIALIZED", 6, 111},
+ #endif
+ #ifdef EVP_R_INVALID_CUSTOM_LENGTH
+ {"INVALID_CUSTOM_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_CUSTOM_LENGTH},
+ #else
+ {"INVALID_CUSTOM_LENGTH", 6, 185},
+ #endif
+ #ifdef EVP_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 6, 152},
+ #endif
+ #ifdef EVP_R_INVALID_FIPS_MODE
+ {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE},
+ #else
+ {"INVALID_FIPS_MODE", 6, 168},
+ #endif
+ #ifdef EVP_R_INVALID_IV_LENGTH
+ {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH},
+ #else
+ {"INVALID_IV_LENGTH", 6, 194},
+ #endif
+ #ifdef EVP_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 6, 163},
+ #endif
+ #ifdef EVP_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 6, 130},
+ #endif
+ #ifdef EVP_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 6, 221},
+ #endif
+ #ifdef EVP_R_INVALID_NULL_ALGORITHM
+ {"INVALID_NULL_ALGORITHM", ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM},
+ #else
+ {"INVALID_NULL_ALGORITHM", 6, 218},
+ #endif
+ #ifdef EVP_R_INVALID_OPERATION
+ {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION},
+ #else
+ {"INVALID_OPERATION", 6, 148},
+ #endif
+ #ifdef EVP_R_INVALID_PROVIDER_FUNCTIONS
+ {"INVALID_PROVIDER_FUNCTIONS", ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS},
+ #else
+ {"INVALID_PROVIDER_FUNCTIONS", 6, 193},
+ #endif
+ #ifdef EVP_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 6, 186},
+ #endif
+ #ifdef EVP_R_INVALID_SECRET_LENGTH
+ {"INVALID_SECRET_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SECRET_LENGTH},
+ #else
+ {"INVALID_SECRET_LENGTH", 6, 223},
+ #endif
+ #ifdef EVP_R_INVALID_SEED_LENGTH
+ {"INVALID_SEED_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SEED_LENGTH},
+ #else
+ {"INVALID_SEED_LENGTH", 6, 220},
+ #endif
+ #ifdef EVP_R_INVALID_VALUE
+ {"INVALID_VALUE", ERR_LIB_EVP, EVP_R_INVALID_VALUE},
+ #else
+ {"INVALID_VALUE", 6, 222},
+ #endif
+ #ifdef EVP_R_KEYMGMT_EXPORT_FAILURE
+ {"KEYMGMT_EXPORT_FAILURE", ERR_LIB_EVP, EVP_R_KEYMGMT_EXPORT_FAILURE},
+ #else
+ {"KEYMGMT_EXPORT_FAILURE", 6, 205},
+ #endif
+ #ifdef EVP_R_KEY_SETUP_FAILED
+ {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED},
+ #else
+ {"KEY_SETUP_FAILED", 6, 180},
+ #endif
+ #ifdef EVP_R_LOCKING_NOT_SUPPORTED
+ {"LOCKING_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED},
+ #else
+ {"LOCKING_NOT_SUPPORTED", 6, 213},
+ #endif
+ #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED
+ {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED},
+ #else
+ {"MEMORY_LIMIT_EXCEEDED", 6, 172},
+ #endif
+ #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL
+ {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL},
+ #else
+ {"MESSAGE_DIGEST_IS_NULL", 6, 159},
+ #endif
+ #ifdef EVP_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 6, 144},
+ #endif
+ #ifdef EVP_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 6, 103},
+ #endif
+ #ifdef EVP_R_NOT_ABLE_TO_COPY_CTX
+ {"NOT_ABLE_TO_COPY_CTX", ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX},
+ #else
+ {"NOT_ABLE_TO_COPY_CTX", 6, 190},
+ #endif
+ #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH
+ {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH},
+ #else
+ {"NOT_XOF_OR_INVALID_LENGTH", 6, 178},
+ #endif
+ #ifdef EVP_R_NO_CIPHER_SET
+ {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET},
+ #else
+ {"NO_CIPHER_SET", 6, 131},
+ #endif
+ #ifdef EVP_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 6, 158},
+ #endif
+ #ifdef EVP_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 6, 139},
+ #endif
+ #ifdef EVP_R_NO_IMPORT_FUNCTION
+ {"NO_IMPORT_FUNCTION", ERR_LIB_EVP, EVP_R_NO_IMPORT_FUNCTION},
+ #else
+ {"NO_IMPORT_FUNCTION", 6, 206},
+ #endif
+ #ifdef EVP_R_NO_KEYMGMT_AVAILABLE
+ {"NO_KEYMGMT_AVAILABLE", ERR_LIB_EVP, EVP_R_NO_KEYMGMT_AVAILABLE},
+ #else
+ {"NO_KEYMGMT_AVAILABLE", 6, 199},
+ #endif
+ #ifdef EVP_R_NO_KEYMGMT_PRESENT
+ {"NO_KEYMGMT_PRESENT", ERR_LIB_EVP, EVP_R_NO_KEYMGMT_PRESENT},
+ #else
+ {"NO_KEYMGMT_PRESENT", 6, 196},
+ #endif
+ #ifdef EVP_R_NO_KEY_SET
+ {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET},
+ #else
+ {"NO_KEY_SET", 6, 154},
+ #endif
+ #ifdef EVP_R_NO_OPERATION_SET
+ {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET},
+ #else
+ {"NO_OPERATION_SET", 6, 149},
+ #endif
+ #ifdef EVP_R_NULL_MAC_PKEY_CTX
+ {"NULL_MAC_PKEY_CTX", ERR_LIB_EVP, EVP_R_NULL_MAC_PKEY_CTX},
+ #else
+ {"NULL_MAC_PKEY_CTX", 6, 208},
+ #endif
+ #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED
+ {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED},
+ #else
+ {"ONLY_ONESHOT_SUPPORTED", 6, 177},
+ #endif
+ #ifdef EVP_R_OPERATION_NOT_INITIALIZED
+ {"OPERATION_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED},
+ #else
+ {"OPERATION_NOT_INITIALIZED", 6, 151},
+ #endif
+ #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150},
+ #endif
+ #ifdef EVP_R_OUTPUT_WOULD_OVERFLOW
+ {"OUTPUT_WOULD_OVERFLOW", ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW},
+ #else
+ {"OUTPUT_WOULD_OVERFLOW", 6, 202},
+ #endif
+ #ifdef EVP_R_PARAMETER_TOO_LARGE
+ {"PARAMETER_TOO_LARGE", ERR_LIB_EVP, EVP_R_PARAMETER_TOO_LARGE},
+ #else
+ {"PARAMETER_TOO_LARGE", 6, 187},
+ #endif
+ #ifdef EVP_R_PARTIALLY_OVERLAPPING
+ {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING},
+ #else
+ {"PARTIALLY_OVERLAPPING", 6, 162},
+ #endif
+ #ifdef EVP_R_PBKDF2_ERROR
+ {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR},
+ #else
+ {"PBKDF2_ERROR", 6, 181},
+ #endif
+ #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED},
+ #else
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR
+ {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR},
+ #else
+ {"PRIVATE_KEY_DECODE_ERROR", 6, 145},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR
+ {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR},
+ #else
+ {"PRIVATE_KEY_ENCODE_ERROR", 6, 146},
+ #endif
+ #ifdef EVP_R_PUBLIC_KEY_NOT_RSA
+ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA},
+ #else
+ {"PUBLIC_KEY_NOT_RSA", 6, 106},
+ #endif
+ #ifdef EVP_R_SETTING_XOF_FAILED
+ {"SETTING_XOF_FAILED", ERR_LIB_EVP, EVP_R_SETTING_XOF_FAILED},
+ #else
+ {"SETTING_XOF_FAILED", 6, 227},
+ #endif
+ #ifdef EVP_R_SET_DEFAULT_PROPERTY_FAILURE
+ {"SET_DEFAULT_PROPERTY_FAILURE", ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE},
+ #else
+ {"SET_DEFAULT_PROPERTY_FAILURE", 6, 209},
+ #endif
+ #ifdef EVP_R_TOO_MANY_RECORDS
+ {"TOO_MANY_RECORDS", ERR_LIB_EVP, EVP_R_TOO_MANY_RECORDS},
+ #else
+ {"TOO_MANY_RECORDS", 6, 183},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_ENABLE_LOCKING
+ {"UNABLE_TO_ENABLE_LOCKING", ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING},
+ #else
+ {"UNABLE_TO_ENABLE_LOCKING", 6, 212},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE
+ {"UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE", ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE},
+ #else
+ {"UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE", 6, 215},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH
+ {"UNABLE_TO_GET_RANDOM_STRENGTH", ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH},
+ #else
+ {"UNABLE_TO_GET_RANDOM_STRENGTH", 6, 216},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_LOCK_CONTEXT
+ {"UNABLE_TO_LOCK_CONTEXT", ERR_LIB_EVP, EVP_R_UNABLE_TO_LOCK_CONTEXT},
+ #else
+ {"UNABLE_TO_LOCK_CONTEXT", 6, 211},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_SET_CALLBACKS
+ {"UNABLE_TO_SET_CALLBACKS", ERR_LIB_EVP, EVP_R_UNABLE_TO_SET_CALLBACKS},
+ #else
+ {"UNABLE_TO_SET_CALLBACKS", 6, 217},
+ #endif
+ #ifdef EVP_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 6, 160},
+ #endif
+ #ifdef EVP_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 6, 161},
+ #endif
+ #ifdef EVP_R_UNKNOWN_KEY_TYPE
+ {"UNKNOWN_KEY_TYPE", ERR_LIB_EVP, EVP_R_UNKNOWN_KEY_TYPE},
+ #else
+ {"UNKNOWN_KEY_TYPE", 6, 207},
+ #endif
+ #ifdef EVP_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 6, 169},
+ #endif
+ #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM
+ {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM},
+ #else
+ {"UNKNOWN_PBE_ALGORITHM", 6, 121},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 6, 156},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 6, 107},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEYLENGTH
+ {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH},
+ #else
+ {"UNSUPPORTED_KEYLENGTH", 6, 123},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION},
+ #else
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_SIZE
+ {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE},
+ #else
+ {"UNSUPPORTED_KEY_SIZE", 6, 108},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_TYPE
+ {"UNSUPPORTED_KEY_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_KEY_TYPE", 6, 224},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+ #else
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRF
+ {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF},
+ #else
+ {"UNSUPPORTED_PRF", 6, 125},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM},
+ #else
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_SALT_TYPE
+ {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE},
+ #else
+ {"UNSUPPORTED_SALT_TYPE", 6, 126},
+ #endif
+ #ifdef EVP_R_UPDATE_ERROR
+ {"UPDATE_ERROR", ERR_LIB_EVP, EVP_R_UPDATE_ERROR},
+ #else
+ {"UPDATE_ERROR", 6, 189},
+ #endif
+ #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED
+ {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED},
+ #else
+ {"WRAP_MODE_NOT_ALLOWED", 6, 170},
+ #endif
+ #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH
+ {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH},
+ #else
+ {"WRONG_FINAL_BLOCK_LENGTH", 6, 109},
+ #endif
+ #ifdef EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", ERR_LIB_EVP, EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE},
+ #else
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", 6, 191},
+ #endif
+ #ifdef EVP_R_XTS_DUPLICATED_KEYS
+ {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS},
+ #else
+ {"XTS_DUPLICATED_KEYS", 6, 192},
+ #endif
+ #ifdef HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN
+ {"ASN1_LEN_EXCEEDS_MAX_RESP_LEN", ERR_LIB_HTTP, HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN},
+ #else
+ {"ASN1_LEN_EXCEEDS_MAX_RESP_LEN", 61, 108},
+ #endif
+ #ifdef HTTP_R_CONNECT_FAILURE
+ {"CONNECT_FAILURE", ERR_LIB_HTTP, HTTP_R_CONNECT_FAILURE},
+ #else
+ {"CONNECT_FAILURE", 61, 100},
+ #endif
+ #ifdef HTTP_R_ERROR_PARSING_ASN1_LENGTH
+ {"ERROR_PARSING_ASN1_LENGTH", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_ASN1_LENGTH},
+ #else
+ {"ERROR_PARSING_ASN1_LENGTH", 61, 109},
+ #endif
+ #ifdef HTTP_R_ERROR_PARSING_CONTENT_LENGTH
+ {"ERROR_PARSING_CONTENT_LENGTH", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_CONTENT_LENGTH},
+ #else
+ {"ERROR_PARSING_CONTENT_LENGTH", 61, 119},
+ #endif
+ #ifdef HTTP_R_ERROR_PARSING_URL
+ {"ERROR_PARSING_URL", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_URL},
+ #else
+ {"ERROR_PARSING_URL", 61, 101},
+ #endif
+ #ifdef HTTP_R_ERROR_RECEIVING
+ {"ERROR_RECEIVING", ERR_LIB_HTTP, HTTP_R_ERROR_RECEIVING},
+ #else
+ {"ERROR_RECEIVING", 61, 103},
+ #endif
+ #ifdef HTTP_R_ERROR_SENDING
+ {"ERROR_SENDING", ERR_LIB_HTTP, HTTP_R_ERROR_SENDING},
+ #else
+ {"ERROR_SENDING", 61, 102},
+ #endif
+ #ifdef HTTP_R_FAILED_READING_DATA
+ {"FAILED_READING_DATA", ERR_LIB_HTTP, HTTP_R_FAILED_READING_DATA},
+ #else
+ {"FAILED_READING_DATA", 61, 128},
+ #endif
+ #ifdef HTTP_R_HEADER_PARSE_ERROR
+ {"HEADER_PARSE_ERROR", ERR_LIB_HTTP, HTTP_R_HEADER_PARSE_ERROR},
+ #else
+ {"HEADER_PARSE_ERROR", 61, 126},
+ #endif
+ #ifdef HTTP_R_INCONSISTENT_CONTENT_LENGTH
+ {"INCONSISTENT_CONTENT_LENGTH", ERR_LIB_HTTP, HTTP_R_INCONSISTENT_CONTENT_LENGTH},
+ #else
+ {"INCONSISTENT_CONTENT_LENGTH", 61, 120},
+ #endif
+ #ifdef HTTP_R_INVALID_PORT_NUMBER
+ {"INVALID_PORT_NUMBER", ERR_LIB_HTTP, HTTP_R_INVALID_PORT_NUMBER},
+ #else
+ {"INVALID_PORT_NUMBER", 61, 123},
+ #endif
+ #ifdef HTTP_R_INVALID_URL_PATH
+ {"INVALID_URL_PATH", ERR_LIB_HTTP, HTTP_R_INVALID_URL_PATH},
+ #else
+ {"INVALID_URL_PATH", 61, 125},
+ #endif
+ #ifdef HTTP_R_INVALID_URL_SCHEME
+ {"INVALID_URL_SCHEME", ERR_LIB_HTTP, HTTP_R_INVALID_URL_SCHEME},
+ #else
+ {"INVALID_URL_SCHEME", 61, 124},
+ #endif
+ #ifdef HTTP_R_MAX_RESP_LEN_EXCEEDED
+ {"MAX_RESP_LEN_EXCEEDED", ERR_LIB_HTTP, HTTP_R_MAX_RESP_LEN_EXCEEDED},
+ #else
+ {"MAX_RESP_LEN_EXCEEDED", 61, 117},
+ #endif
+ #ifdef HTTP_R_MISSING_ASN1_ENCODING
+ {"MISSING_ASN1_ENCODING", ERR_LIB_HTTP, HTTP_R_MISSING_ASN1_ENCODING},
+ #else
+ {"MISSING_ASN1_ENCODING", 61, 110},
+ #endif
+ #ifdef HTTP_R_MISSING_CONTENT_TYPE
+ {"MISSING_CONTENT_TYPE", ERR_LIB_HTTP, HTTP_R_MISSING_CONTENT_TYPE},
+ #else
+ {"MISSING_CONTENT_TYPE", 61, 121},
+ #endif
+ #ifdef HTTP_R_MISSING_REDIRECT_LOCATION
+ {"MISSING_REDIRECT_LOCATION", ERR_LIB_HTTP, HTTP_R_MISSING_REDIRECT_LOCATION},
+ #else
+ {"MISSING_REDIRECT_LOCATION", 61, 111},
+ #endif
+ #ifdef HTTP_R_RECEIVED_ERROR
+ {"RECEIVED_ERROR", ERR_LIB_HTTP, HTTP_R_RECEIVED_ERROR},
+ #else
+ {"RECEIVED_ERROR", 61, 105},
+ #endif
+ #ifdef HTTP_R_RECEIVED_WRONG_HTTP_VERSION
+ {"RECEIVED_WRONG_HTTP_VERSION", ERR_LIB_HTTP, HTTP_R_RECEIVED_WRONG_HTTP_VERSION},
+ #else
+ {"RECEIVED_WRONG_HTTP_VERSION", 61, 106},
+ #endif
+ #ifdef HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP
+ {"REDIRECTION_FROM_HTTPS_TO_HTTP", ERR_LIB_HTTP, HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP},
+ #else
+ {"REDIRECTION_FROM_HTTPS_TO_HTTP", 61, 112},
+ #endif
+ #ifdef HTTP_R_REDIRECTION_NOT_ENABLED
+ {"REDIRECTION_NOT_ENABLED", ERR_LIB_HTTP, HTTP_R_REDIRECTION_NOT_ENABLED},
+ #else
+ {"REDIRECTION_NOT_ENABLED", 61, 116},
+ #endif
+ #ifdef HTTP_R_RESPONSE_LINE_TOO_LONG
+ {"RESPONSE_LINE_TOO_LONG", ERR_LIB_HTTP, HTTP_R_RESPONSE_LINE_TOO_LONG},
+ #else
+ {"RESPONSE_LINE_TOO_LONG", 61, 113},
+ #endif
+ #ifdef HTTP_R_RESPONSE_PARSE_ERROR
+ {"RESPONSE_PARSE_ERROR", ERR_LIB_HTTP, HTTP_R_RESPONSE_PARSE_ERROR},
+ #else
+ {"RESPONSE_PARSE_ERROR", 61, 104},
+ #endif
+ #ifdef HTTP_R_RETRY_TIMEOUT
+ {"RETRY_TIMEOUT", ERR_LIB_HTTP, HTTP_R_RETRY_TIMEOUT},
+ #else
+ {"RETRY_TIMEOUT", 61, 129},
+ #endif
+ #ifdef HTTP_R_SERVER_CANCELED_CONNECTION
+ {"SERVER_CANCELED_CONNECTION", ERR_LIB_HTTP, HTTP_R_SERVER_CANCELED_CONNECTION},
+ #else
+ {"SERVER_CANCELED_CONNECTION", 61, 127},
+ #endif
+ #ifdef HTTP_R_SOCK_NOT_SUPPORTED
+ {"SOCK_NOT_SUPPORTED", ERR_LIB_HTTP, HTTP_R_SOCK_NOT_SUPPORTED},
+ #else
+ {"SOCK_NOT_SUPPORTED", 61, 122},
+ #endif
+ #ifdef HTTP_R_STATUS_CODE_UNSUPPORTED
+ {"STATUS_CODE_UNSUPPORTED", ERR_LIB_HTTP, HTTP_R_STATUS_CODE_UNSUPPORTED},
+ #else
+ {"STATUS_CODE_UNSUPPORTED", 61, 114},
+ #endif
+ #ifdef HTTP_R_TLS_NOT_ENABLED
+ {"TLS_NOT_ENABLED", ERR_LIB_HTTP, HTTP_R_TLS_NOT_ENABLED},
+ #else
+ {"TLS_NOT_ENABLED", 61, 107},
+ #endif
+ #ifdef HTTP_R_TOO_MANY_REDIRECTIONS
+ {"TOO_MANY_REDIRECTIONS", ERR_LIB_HTTP, HTTP_R_TOO_MANY_REDIRECTIONS},
+ #else
+ {"TOO_MANY_REDIRECTIONS", 61, 115},
+ #endif
+ #ifdef HTTP_R_UNEXPECTED_CONTENT_TYPE
+ {"UNEXPECTED_CONTENT_TYPE", ERR_LIB_HTTP, HTTP_R_UNEXPECTED_CONTENT_TYPE},
+ #else
+ {"UNEXPECTED_CONTENT_TYPE", 61, 118},
+ #endif
+ #ifdef OBJ_R_OID_EXISTS
+ {"OID_EXISTS", ERR_LIB_OBJ, OBJ_R_OID_EXISTS},
+ #else
+ {"OID_EXISTS", 8, 102},
+ #endif
+ #ifdef OBJ_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 8, 101},
+ #endif
+ #ifdef OBJ_R_UNKNOWN_OBJECT_NAME
+ {"UNKNOWN_OBJECT_NAME", ERR_LIB_OBJ, OBJ_R_UNKNOWN_OBJECT_NAME},
+ #else
+ {"UNKNOWN_OBJECT_NAME", 8, 103},
+ #endif
+ #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 39, 101},
+ #endif
+ #ifdef OCSP_R_DIGEST_ERR
+ {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR},
+ #else
+ {"DIGEST_ERR", 39, 102},
+ #endif
+ #ifdef OCSP_R_DIGEST_NAME_ERR
+ {"DIGEST_NAME_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_NAME_ERR},
+ #else
+ {"DIGEST_NAME_ERR", 39, 106},
+ #endif
+ #ifdef OCSP_R_DIGEST_SIZE_ERR
+ {"DIGEST_SIZE_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_SIZE_ERR},
+ #else
+ {"DIGEST_SIZE_ERR", 39, 107},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD
+ {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD},
+ #else
+ {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD
+ {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD},
+ #else
+ {"ERROR_IN_THISUPDATE_FIELD", 39, 123},
+ #endif
+ #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE
+ {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE},
+ #else
+ {"MISSING_OCSPSIGNING_USAGE", 39, 103},
+ #endif
+ #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE
+ {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE},
+ #else
+ {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124},
+ #endif
+ #ifdef OCSP_R_NOT_BASIC_RESPONSE
+ {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE},
+ #else
+ {"NOT_BASIC_RESPONSE", 39, 104},
+ #endif
+ #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN
+ {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN},
+ #else
+ {"NO_CERTIFICATES_IN_CHAIN", 39, 105},
+ #endif
+ #ifdef OCSP_R_NO_RESPONSE_DATA
+ {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA},
+ #else
+ {"NO_RESPONSE_DATA", 39, 108},
+ #endif
+ #ifdef OCSP_R_NO_REVOKED_TIME
+ {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME},
+ #else
+ {"NO_REVOKED_TIME", 39, 109},
+ #endif
+ #ifdef OCSP_R_NO_SIGNER_KEY
+ {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY},
+ #else
+ {"NO_SIGNER_KEY", 39, 130},
+ #endif
+ #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110},
+ #endif
+ #ifdef OCSP_R_REQUEST_NOT_SIGNED
+ {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED},
+ #else
+ {"REQUEST_NOT_SIGNED", 39, 128},
+ #endif
+ #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA},
+ #else
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111},
+ #endif
+ #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED
+ {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED},
+ #else
+ {"ROOT_CA_NOT_TRUSTED", 39, 112},
+ #endif
+ #ifdef OCSP_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 39, 117},
+ #endif
+ #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118},
+ #endif
+ #ifdef OCSP_R_STATUS_EXPIRED
+ {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED},
+ #else
+ {"STATUS_EXPIRED", 39, 125},
+ #endif
+ #ifdef OCSP_R_STATUS_NOT_YET_VALID
+ {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID},
+ #else
+ {"STATUS_NOT_YET_VALID", 39, 126},
+ #endif
+ #ifdef OCSP_R_STATUS_TOO_OLD
+ {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD},
+ #else
+ {"STATUS_TOO_OLD", 39, 127},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST
+ {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST", 39, 119},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 39, 120},
+ #endif
+ #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE},
+ #else
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129},
+ #endif
+ #ifdef OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT
+ {"COULD_NOT_DECODE_OBJECT", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT},
+ #else
+ {"COULD_NOT_DECODE_OBJECT", 60, 101},
+ #endif
+ #ifdef OSSL_DECODER_R_DECODER_NOT_FOUND
+ {"DECODER_NOT_FOUND", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND},
+ #else
+ {"DECODER_NOT_FOUND", 60, 102},
+ #endif
+ #ifdef OSSL_DECODER_R_MISSING_GET_PARAMS
+ {"MISSING_GET_PARAMS", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_MISSING_GET_PARAMS},
+ #else
+ {"MISSING_GET_PARAMS", 60, 100},
+ #endif
+ #ifdef OSSL_ENCODER_R_ENCODER_NOT_FOUND
+ {"ENCODER_NOT_FOUND", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND},
+ #else
+ {"ENCODER_NOT_FOUND", 59, 101},
+ #endif
+ #ifdef OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY
+ {"INCORRECT_PROPERTY_QUERY", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY},
+ #else
+ {"INCORRECT_PROPERTY_QUERY", 59, 100},
+ #endif
+ #ifdef OSSL_ENCODER_R_MISSING_GET_PARAMS
+ {"MISSING_GET_PARAMS", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_MISSING_GET_PARAMS},
+ #else
+ {"MISSING_GET_PARAMS", 59, 102},
+ #endif
+ #ifdef OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE
+ {"AMBIGUOUS_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE},
+ #else
+ {"AMBIGUOUS_CONTENT_TYPE", 44, 107},
+ #endif
+ #ifdef OSSL_STORE_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_OSSL_STORE, OSSL_STORE_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 44, 115},
+ #endif
+ #ifdef OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC
+ {"ERROR_VERIFYING_PKCS12_MAC", ERR_LIB_OSSL_STORE, OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC},
+ #else
+ {"ERROR_VERIFYING_PKCS12_MAC", 44, 113},
+ #endif
+ #ifdef OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST
+ {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", ERR_LIB_OSSL_STORE, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST},
+ #else
+ {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", 44, 121},
+ #endif
+ #ifdef OSSL_STORE_R_INVALID_SCHEME
+ {"INVALID_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_INVALID_SCHEME},
+ #else
+ {"INVALID_SCHEME", 44, 106},
+ #endif
+ #ifdef OSSL_STORE_R_IS_NOT_A
+ {"IS_NOT_A", ERR_LIB_OSSL_STORE, OSSL_STORE_R_IS_NOT_A},
+ #else
+ {"IS_NOT_A", 44, 112},
+ #endif
+ #ifdef OSSL_STORE_R_LOADER_INCOMPLETE
+ {"LOADER_INCOMPLETE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADER_INCOMPLETE},
+ #else
+ {"LOADER_INCOMPLETE", 44, 116},
+ #endif
+ #ifdef OSSL_STORE_R_LOADING_STARTED
+ {"LOADING_STARTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADING_STARTED},
+ #else
+ {"LOADING_STARTED", 44, 117},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_CERTIFICATE
+ {"NOT_A_CERTIFICATE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CERTIFICATE},
+ #else
+ {"NOT_A_CERTIFICATE", 44, 100},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_CRL
+ {"NOT_A_CRL", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CRL},
+ #else
+ {"NOT_A_CRL", 44, 101},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_NAME
+ {"NOT_A_NAME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_NAME},
+ #else
+ {"NOT_A_NAME", 44, 103},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_PRIVATE_KEY
+ {"NOT_A_PRIVATE_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_PRIVATE_KEY},
+ #else
+ {"NOT_A_PRIVATE_KEY", 44, 102},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_PUBLIC_KEY
+ {"NOT_A_PUBLIC_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_PUBLIC_KEY},
+ #else
+ {"NOT_A_PUBLIC_KEY", 44, 122},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_PARAMETERS
+ {"NOT_PARAMETERS", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_PARAMETERS},
+ #else
+ {"NOT_PARAMETERS", 44, 104},
+ #endif
+ #ifdef OSSL_STORE_R_NO_LOADERS_FOUND
+ {"NO_LOADERS_FOUND", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NO_LOADERS_FOUND},
+ #else
+ {"NO_LOADERS_FOUND", 44, 123},
+ #endif
+ #ifdef OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR
+ {"PASSPHRASE_CALLBACK_ERROR", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR},
+ #else
+ {"PASSPHRASE_CALLBACK_ERROR", 44, 114},
+ #endif
+ #ifdef OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE
+ {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE},
+ #else
+ {"PATH_MUST_BE_ABSOLUTE", 44, 108},
+ #endif
+ #ifdef OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_OSSL_STORE, OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES},
+ #else
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 44, 119},
+ #endif
+ #ifdef OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED
+ {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED},
+ #else
+ {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", 44, 109},
+ #endif
+ #ifdef OSSL_STORE_R_UNREGISTERED_SCHEME
+ {"UNREGISTERED_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNREGISTERED_SCHEME},
+ #else
+ {"UNREGISTERED_SCHEME", 44, 105},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 44, 110},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_OPERATION
+ {"UNSUPPORTED_OPERATION", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_OPERATION},
+ #else
+ {"UNSUPPORTED_OPERATION", 44, 118},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE
+ {"UNSUPPORTED_SEARCH_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE},
+ #else
+ {"UNSUPPORTED_SEARCH_TYPE", 44, 120},
+ #endif
+ #ifdef OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED
+ {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED},
+ #else
+ {"URI_AUTHORITY_UNSUPPORTED", 44, 111},
+ #endif
+ #ifdef PEM_R_BAD_BASE64_DECODE
+ {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
+ #else
+ {"BAD_BASE64_DECODE", 9, 100},
+ #endif
+ #ifdef PEM_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 9, 101},
+ #endif
+ #ifdef PEM_R_BAD_END_LINE
+ {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
+ #else
+ {"BAD_END_LINE", 9, 102},
+ #endif
+ #ifdef PEM_R_BAD_IV_CHARS
+ {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
+ #else
+ {"BAD_IV_CHARS", 9, 103},
+ #endif
+ #ifdef PEM_R_BAD_MAGIC_NUMBER
+ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
+ #else
+ {"BAD_MAGIC_NUMBER", 9, 116},
+ #endif
+ #ifdef PEM_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 9, 104},
+ #endif
+ #ifdef PEM_R_BAD_VERSION_NUMBER
+ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
+ #else
+ {"BAD_VERSION_NUMBER", 9, 117},
+ #endif
+ #ifdef PEM_R_BIO_WRITE_FAILURE
+ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
+ #else
+ {"BIO_WRITE_FAILURE", 9, 118},
+ #endif
+ #ifdef PEM_R_CIPHER_IS_NULL
+ {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
+ #else
+ {"CIPHER_IS_NULL", 9, 127},
+ #endif
+ #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
+ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
+ #else
+ {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115},
+ #endif
+ #ifdef PEM_R_EXPECTING_DSS_KEY_BLOB
+ {"EXPECTING_DSS_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_DSS_KEY_BLOB},
+ #else
+ {"EXPECTING_DSS_KEY_BLOB", 9, 131},
+ #endif
+ #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
+ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
+ #else
+ {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119},
+ #endif
+ #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
+ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
+ #else
+ {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120},
+ #endif
+ #ifdef PEM_R_EXPECTING_RSA_KEY_BLOB
+ {"EXPECTING_RSA_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_RSA_KEY_BLOB},
+ #else
+ {"EXPECTING_RSA_KEY_BLOB", 9, 132},
+ #endif
+ #ifdef PEM_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 9, 128},
+ #endif
+ #ifdef PEM_R_INCONSISTENT_HEADER
+ {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
+ #else
+ {"INCONSISTENT_HEADER", 9, 121},
+ #endif
+ #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
+ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
+ #else
+ {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122},
+ #endif
+ #ifdef PEM_R_KEYBLOB_TOO_SHORT
+ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
+ #else
+ {"KEYBLOB_TOO_SHORT", 9, 123},
+ #endif
+ #ifdef PEM_R_MISSING_DEK_IV
+ {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV},
+ #else
+ {"MISSING_DEK_IV", 9, 129},
+ #endif
+ #ifdef PEM_R_NOT_DEK_INFO
+ {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
+ #else
+ {"NOT_DEK_INFO", 9, 105},
+ #endif
+ #ifdef PEM_R_NOT_ENCRYPTED
+ {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
+ #else
+ {"NOT_ENCRYPTED", 9, 106},
+ #endif
+ #ifdef PEM_R_NOT_PROC_TYPE
+ {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
+ #else
+ {"NOT_PROC_TYPE", 9, 107},
+ #endif
+ #ifdef PEM_R_NO_START_LINE
+ {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
+ #else
+ {"NO_START_LINE", 9, 108},
+ #endif
+ #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
+ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD},
+ #else
+ {"PROBLEMS_GETTING_PASSWORD", 9, 109},
+ #endif
+ #ifdef PEM_R_PVK_DATA_TOO_SHORT
+ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
+ #else
+ {"PVK_DATA_TOO_SHORT", 9, 124},
+ #endif
+ #ifdef PEM_R_PVK_TOO_SHORT
+ {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
+ #else
+ {"PVK_TOO_SHORT", 9, 125},
+ #endif
+ #ifdef PEM_R_READ_KEY
+ {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
+ #else
+ {"READ_KEY", 9, 111},
+ #endif
+ #ifdef PEM_R_SHORT_HEADER
+ {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
+ #else
+ {"SHORT_HEADER", 9, 112},
+ #endif
+ #ifdef PEM_R_UNEXPECTED_DEK_IV
+ {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV},
+ #else
+ {"UNEXPECTED_DEK_IV", 9, 130},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 9, 113},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
+ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
+ #else
+ {"UNSUPPORTED_ENCRYPTION", 9, 114},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
+ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS},
+ #else
+ {"UNSUPPORTED_KEY_COMPONENTS", 9, 126},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_PEM, PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 9, 110},
+ #endif
+ #ifdef PKCS12_R_CANT_PACK_STRUCTURE
+ {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE},
+ #else
+ {"CANT_PACK_STRUCTURE", 35, 100},
+ #endif
+ #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA
+ {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_DATA", 35, 121},
+ #endif
+ #ifdef PKCS12_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 35, 101},
+ #endif
+ #ifdef PKCS12_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 35, 102},
+ #endif
+ #ifdef PKCS12_R_ENCRYPT_ERROR
+ {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR},
+ #else
+ {"ENCRYPT_ERROR", 35, 103},
+ #endif
+ #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE},
+ #else
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 35, 104},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER
+ {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER},
+ #else
+ {"INVALID_NULL_PKCS12_POINTER", 35, 105},
+ #endif
+ #ifdef PKCS12_R_INVALID_TYPE
+ {"INVALID_TYPE", ERR_LIB_PKCS12, PKCS12_R_INVALID_TYPE},
+ #else
+ {"INVALID_TYPE", 35, 112},
+ #endif
+ #ifdef PKCS12_R_IV_GEN_ERROR
+ {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR},
+ #else
+ {"IV_GEN_ERROR", 35, 106},
+ #endif
+ #ifdef PKCS12_R_KEY_GEN_ERROR
+ {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR},
+ #else
+ {"KEY_GEN_ERROR", 35, 107},
+ #endif
+ #ifdef PKCS12_R_MAC_ABSENT
+ {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT},
+ #else
+ {"MAC_ABSENT", 35, 108},
+ #endif
+ #ifdef PKCS12_R_MAC_GENERATION_ERROR
+ {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR},
+ #else
+ {"MAC_GENERATION_ERROR", 35, 109},
+ #endif
+ #ifdef PKCS12_R_MAC_SETUP_ERROR
+ {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR},
+ #else
+ {"MAC_SETUP_ERROR", 35, 110},
+ #endif
+ #ifdef PKCS12_R_MAC_STRING_SET_ERROR
+ {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR},
+ #else
+ {"MAC_STRING_SET_ERROR", 35, 111},
+ #endif
+ #ifdef PKCS12_R_MAC_VERIFY_FAILURE
+ {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE},
+ #else
+ {"MAC_VERIFY_FAILURE", 35, 113},
+ #endif
+ #ifdef PKCS12_R_PARSE_ERROR
+ {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR},
+ #else
+ {"PARSE_ERROR", 35, 114},
+ #endif
+ #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR
+ {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR},
+ #else
+ {"PKCS12_CIPHERFINAL_ERROR", 35, 116},
+ #endif
+ #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 35, 118},
+ #endif
+ #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE
+ {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE},
+ #else
+ {"UNSUPPORTED_PKCS12_MODE", 35, 119},
+ #endif
+ #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 33, 117},
+ #endif
+ #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144},
+ #endif
+ #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED
+ {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED},
+ #else
+ {"CIPHER_NOT_INITIALIZED", 33, 116},
+ #endif
+ #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT
+ {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT},
+ #else
+ {"CONTENT_AND_DATA_PRESENT", 33, 118},
+ #endif
+ #ifdef PKCS7_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 33, 152},
+ #endif
+ #ifdef PKCS7_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 33, 119},
+ #endif
+ #ifdef PKCS7_R_DIGEST_FAILURE
+ {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE},
+ #else
+ {"DIGEST_FAILURE", 33, 101},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE
+ {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE},
+ #else
+ {"ENCRYPTION_CTRL_FAILURE", 33, 149},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150},
+ #endif
+ #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT
+ {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT},
+ #else
+ {"ERROR_ADDING_RECIPIENT", 33, 120},
+ #endif
+ #ifdef PKCS7_R_ERROR_SETTING_CIPHER
+ {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER},
+ #else
+ {"ERROR_SETTING_CIPHER", 33, 121},
+ #endif
+ #ifdef PKCS7_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 33, 143},
+ #endif
+ #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE
+ {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE},
+ #else
+ {"INVALID_SIGNED_DATA_TYPE", 33, 155},
+ #endif
+ #ifdef PKCS7_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 33, 122},
+ #endif
+ #ifdef PKCS7_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 33, 151},
+ #endif
+ #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND},
+ #else
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154},
+ #endif
+ #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE},
+ #else
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA
+ {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA},
+ #else
+ {"NO_SIGNATURES_ON_DATA", 33, 123},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 33, 142},
+ #endif
+ #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR
+ {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNER_ERROR", 33, 153},
+ #endif
+ #ifdef PKCS7_R_PKCS7_DATASIGN
+ {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN},
+ #else
+ {"PKCS7_DATASIGN", 33, 145},
+ #endif
+ #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127},
+ #endif
+ #ifdef PKCS7_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 33, 105},
+ #endif
+ #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128},
+ #endif
+ #ifdef PKCS7_R_SIGNING_CTRL_FAILURE
+ {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE},
+ #else
+ {"SIGNING_CTRL_FAILURE", 33, 147},
+ #endif
+ #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148},
+ #endif
+ #ifdef PKCS7_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 33, 129},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE
+ {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE},
+ #else
+ {"UNABLE_TO_FIND_CERTIFICATE", 33, 106},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO
+ {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO},
+ #else
+ {"UNABLE_TO_FIND_MEM_BIO", 33, 107},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST},
+ #else
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE
+ {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE},
+ #else
+ {"UNKNOWN_DIGEST_TYPE", 33, 109},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_OPERATION
+ {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION},
+ #else
+ {"UNKNOWN_OPERATION", 33, 110},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE
+ {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE},
+ #else
+ {"UNSUPPORTED_CIPHER_TYPE", 33, 111},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 33, 112},
+ #endif
+ #ifdef PKCS7_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 33, 113},
+ #endif
+ #ifdef PKCS7_R_WRONG_PKCS7_TYPE
+ {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE},
+ #else
+ {"WRONG_PKCS7_TYPE", 33, 114},
+ #endif
+ #ifdef PROP_R_NAME_TOO_LONG
+ {"NAME_TOO_LONG", ERR_LIB_PROP, PROP_R_NAME_TOO_LONG},
+ #else
+ {"NAME_TOO_LONG", 55, 100},
+ #endif
+ #ifdef PROP_R_NOT_AN_ASCII_CHARACTER
+ {"NOT_AN_ASCII_CHARACTER", ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER},
+ #else
+ {"NOT_AN_ASCII_CHARACTER", 55, 101},
+ #endif
+ #ifdef PROP_R_NOT_AN_HEXADECIMAL_DIGIT
+ {"NOT_AN_HEXADECIMAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT},
+ #else
+ {"NOT_AN_HEXADECIMAL_DIGIT", 55, 102},
+ #endif
+ #ifdef PROP_R_NOT_AN_IDENTIFIER
+ {"NOT_AN_IDENTIFIER", ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER},
+ #else
+ {"NOT_AN_IDENTIFIER", 55, 103},
+ #endif
+ #ifdef PROP_R_NOT_AN_OCTAL_DIGIT
+ {"NOT_AN_OCTAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT},
+ #else
+ {"NOT_AN_OCTAL_DIGIT", 55, 104},
+ #endif
+ #ifdef PROP_R_NOT_A_DECIMAL_DIGIT
+ {"NOT_A_DECIMAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT},
+ #else
+ {"NOT_A_DECIMAL_DIGIT", 55, 105},
+ #endif
+ #ifdef PROP_R_NO_MATCHING_STRING_DELIMITER
+ {"NO_MATCHING_STRING_DELIMITER", ERR_LIB_PROP, PROP_R_NO_MATCHING_STRING_DELIMITER},
+ #else
+ {"NO_MATCHING_STRING_DELIMITER", 55, 106},
+ #endif
+ #ifdef PROP_R_NO_VALUE
+ {"NO_VALUE", ERR_LIB_PROP, PROP_R_NO_VALUE},
+ #else
+ {"NO_VALUE", 55, 107},
+ #endif
+ #ifdef PROP_R_PARSE_FAILED
+ {"PARSE_FAILED", ERR_LIB_PROP, PROP_R_PARSE_FAILED},
+ #else
+ {"PARSE_FAILED", 55, 108},
+ #endif
+ #ifdef PROP_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_PROP, PROP_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 55, 109},
+ #endif
+ #ifdef PROP_R_TRAILING_CHARACTERS
+ {"TRAILING_CHARACTERS", ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS},
+ #else
+ {"TRAILING_CHARACTERS", 55, 110},
+ #endif
+ #ifdef PROV_R_ADDITIONAL_INPUT_TOO_LONG
+ {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG},
+ #else
+ {"ADDITIONAL_INPUT_TOO_LONG", 57, 184},
+ #endif
+ #ifdef PROV_R_ALGORITHM_MISMATCH
+ {"ALGORITHM_MISMATCH", ERR_LIB_PROV, PROV_R_ALGORITHM_MISMATCH},
+ #else
+ {"ALGORITHM_MISMATCH", 57, 173},
+ #endif
+ #ifdef PROV_R_ALREADY_INSTANTIATED
+ {"ALREADY_INSTANTIATED", ERR_LIB_PROV, PROV_R_ALREADY_INSTANTIATED},
+ #else
+ {"ALREADY_INSTANTIATED", 57, 185},
+ #endif
+ #ifdef PROV_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_PROV, PROV_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 57, 100},
+ #endif
+ #ifdef PROV_R_BAD_ENCODING
+ {"BAD_ENCODING", ERR_LIB_PROV, PROV_R_BAD_ENCODING},
+ #else
+ {"BAD_ENCODING", 57, 141},
+ #endif
+ #ifdef PROV_R_BAD_LENGTH
+ {"BAD_LENGTH", ERR_LIB_PROV, PROV_R_BAD_LENGTH},
+ #else
+ {"BAD_LENGTH", 57, 142},
+ #endif
+ #ifdef PROV_R_BAD_TLS_CLIENT_VERSION
+ {"BAD_TLS_CLIENT_VERSION", ERR_LIB_PROV, PROV_R_BAD_TLS_CLIENT_VERSION},
+ #else
+ {"BAD_TLS_CLIENT_VERSION", 57, 161},
+ #endif
+ #ifdef PROV_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_PROV, PROV_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 57, 160},
+ #endif
+ #ifdef PROV_R_CIPHER_OPERATION_FAILED
+ {"CIPHER_OPERATION_FAILED", ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED},
+ #else
+ {"CIPHER_OPERATION_FAILED", 57, 102},
+ #endif
+ #ifdef PROV_R_DERIVATION_FUNCTION_INIT_FAILED
+ {"DERIVATION_FUNCTION_INIT_FAILED", ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED},
+ #else
+ {"DERIVATION_FUNCTION_INIT_FAILED", 57, 205},
+ #endif
+ #ifdef PROV_R_DIGEST_NOT_ALLOWED
+ {"DIGEST_NOT_ALLOWED", ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED},
+ #else
+ {"DIGEST_NOT_ALLOWED", 57, 174},
+ #endif
+ #ifdef PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK
+ {"ENTROPY_SOURCE_STRENGTH_TOO_WEAK", ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK},
+ #else
+ {"ENTROPY_SOURCE_STRENGTH_TOO_WEAK", 57, 186},
+ #endif
+ #ifdef PROV_R_ERROR_INSTANTIATING_DRBG
+ {"ERROR_INSTANTIATING_DRBG", ERR_LIB_PROV, PROV_R_ERROR_INSTANTIATING_DRBG},
+ #else
+ {"ERROR_INSTANTIATING_DRBG", 57, 188},
+ #endif
+ #ifdef PROV_R_ERROR_RETRIEVING_ENTROPY
+ {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY},
+ #else
+ {"ERROR_RETRIEVING_ENTROPY", 57, 189},
+ #endif
+ #ifdef PROV_R_ERROR_RETRIEVING_NONCE
+ {"ERROR_RETRIEVING_NONCE", ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE},
+ #else
+ {"ERROR_RETRIEVING_NONCE", 57, 190},
+ #endif
+ #ifdef PROV_R_FAILED_DURING_DERIVATION
+ {"FAILED_DURING_DERIVATION", ERR_LIB_PROV, PROV_R_FAILED_DURING_DERIVATION},
+ #else
+ {"FAILED_DURING_DERIVATION", 57, 164},
+ #endif
+ #ifdef PROV_R_FAILED_TO_CREATE_LOCK
+ {"FAILED_TO_CREATE_LOCK", ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_LOCK},
+ #else
+ {"FAILED_TO_CREATE_LOCK", 57, 180},
+ #endif
+ #ifdef PROV_R_FAILED_TO_DECRYPT
+ {"FAILED_TO_DECRYPT", ERR_LIB_PROV, PROV_R_FAILED_TO_DECRYPT},
+ #else
+ {"FAILED_TO_DECRYPT", 57, 162},
+ #endif
+ #ifdef PROV_R_FAILED_TO_GENERATE_KEY
+ {"FAILED_TO_GENERATE_KEY", ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_KEY},
+ #else
+ {"FAILED_TO_GENERATE_KEY", 57, 121},
+ #endif
+ #ifdef PROV_R_FAILED_TO_GET_PARAMETER
+ {"FAILED_TO_GET_PARAMETER", ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER},
+ #else
+ {"FAILED_TO_GET_PARAMETER", 57, 103},
+ #endif
+ #ifdef PROV_R_FAILED_TO_SET_PARAMETER
+ {"FAILED_TO_SET_PARAMETER", ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER},
+ #else
+ {"FAILED_TO_SET_PARAMETER", 57, 104},
+ #endif
+ #ifdef PROV_R_FAILED_TO_SIGN
+ {"FAILED_TO_SIGN", ERR_LIB_PROV, PROV_R_FAILED_TO_SIGN},
+ #else
+ {"FAILED_TO_SIGN", 57, 175},
+ #endif
+ #ifdef PROV_R_FIPS_MODULE_CONDITIONAL_ERROR
+ {"FIPS_MODULE_CONDITIONAL_ERROR", ERR_LIB_PROV, PROV_R_FIPS_MODULE_CONDITIONAL_ERROR},
+ #else
+ {"FIPS_MODULE_CONDITIONAL_ERROR", 57, 227},
+ #endif
+ #ifdef PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE
+ {"FIPS_MODULE_ENTERING_ERROR_STATE", ERR_LIB_PROV, PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE},
+ #else
+ {"FIPS_MODULE_ENTERING_ERROR_STATE", 57, 224},
+ #endif
+ #ifdef PROV_R_FIPS_MODULE_IN_ERROR_STATE
+ {"FIPS_MODULE_IN_ERROR_STATE", ERR_LIB_PROV, PROV_R_FIPS_MODULE_IN_ERROR_STATE},
+ #else
+ {"FIPS_MODULE_IN_ERROR_STATE", 57, 225},
+ #endif
+ #ifdef PROV_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_PROV, PROV_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 57, 191},
+ #endif
+ #ifdef PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_PROV, PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+ #else
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 57, 165},
+ #endif
+ #ifdef PROV_R_INDICATOR_INTEGRITY_FAILURE
+ {"INDICATOR_INTEGRITY_FAILURE", ERR_LIB_PROV, PROV_R_INDICATOR_INTEGRITY_FAILURE},
+ #else
+ {"INDICATOR_INTEGRITY_FAILURE", 57, 210},
+ #endif
+ #ifdef PROV_R_INSUFFICIENT_DRBG_STRENGTH
+ {"INSUFFICIENT_DRBG_STRENGTH", ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH},
+ #else
+ {"INSUFFICIENT_DRBG_STRENGTH", 57, 181},
+ #endif
+ #ifdef PROV_R_INVALID_AAD
+ {"INVALID_AAD", ERR_LIB_PROV, PROV_R_INVALID_AAD},
+ #else
+ {"INVALID_AAD", 57, 108},
+ #endif
+ #ifdef PROV_R_INVALID_CONFIG_DATA
+ {"INVALID_CONFIG_DATA", ERR_LIB_PROV, PROV_R_INVALID_CONFIG_DATA},
+ #else
+ {"INVALID_CONFIG_DATA", 57, 211},
+ #endif
+ #ifdef PROV_R_INVALID_CONSTANT_LENGTH
+ {"INVALID_CONSTANT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_CONSTANT_LENGTH},
+ #else
+ {"INVALID_CONSTANT_LENGTH", 57, 157},
+ #endif
+ #ifdef PROV_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_PROV, PROV_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 57, 176},
+ #endif
+ #ifdef PROV_R_INVALID_CUSTOM_LENGTH
+ {"INVALID_CUSTOM_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_CUSTOM_LENGTH},
+ #else
+ {"INVALID_CUSTOM_LENGTH", 57, 111},
+ #endif
+ #ifdef PROV_R_INVALID_DATA
+ {"INVALID_DATA", ERR_LIB_PROV, PROV_R_INVALID_DATA},
+ #else
+ {"INVALID_DATA", 57, 115},
+ #endif
+ #ifdef PROV_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_PROV, PROV_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 57, 122},
+ #endif
+ #ifdef PROV_R_INVALID_DIGEST_LENGTH
+ {"INVALID_DIGEST_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH},
+ #else
+ {"INVALID_DIGEST_LENGTH", 57, 166},
+ #endif
+ #ifdef PROV_R_INVALID_DIGEST_SIZE
+ {"INVALID_DIGEST_SIZE", ERR_LIB_PROV, PROV_R_INVALID_DIGEST_SIZE},
+ #else
+ {"INVALID_DIGEST_SIZE", 57, 218},
+ #endif
+ #ifdef PROV_R_INVALID_INPUT_LENGTH
+ {"INVALID_INPUT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH},
+ #else
+ {"INVALID_INPUT_LENGTH", 57, 230},
+ #endif
+ #ifdef PROV_R_INVALID_ITERATION_COUNT
+ {"INVALID_ITERATION_COUNT", ERR_LIB_PROV, PROV_R_INVALID_ITERATION_COUNT},
+ #else
+ {"INVALID_ITERATION_COUNT", 57, 123},
+ #endif
+ #ifdef PROV_R_INVALID_IV_LENGTH
+ {"INVALID_IV_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH},
+ #else
+ {"INVALID_IV_LENGTH", 57, 109},
+ #endif
+ #ifdef PROV_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_PROV, PROV_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 57, 158},
+ #endif
+ #ifdef PROV_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 57, 105},
+ #endif
+ #ifdef PROV_R_INVALID_MAC
+ {"INVALID_MAC", ERR_LIB_PROV, PROV_R_INVALID_MAC},
+ #else
+ {"INVALID_MAC", 57, 151},
+ #endif
+ #ifdef PROV_R_INVALID_MGF1_MD
+ {"INVALID_MGF1_MD", ERR_LIB_PROV, PROV_R_INVALID_MGF1_MD},
+ #else
+ {"INVALID_MGF1_MD", 57, 167},
+ #endif
+ #ifdef PROV_R_INVALID_MODE
+ {"INVALID_MODE", ERR_LIB_PROV, PROV_R_INVALID_MODE},
+ #else
+ {"INVALID_MODE", 57, 125},
+ #endif
+ #ifdef PROV_R_INVALID_OUTPUT_LENGTH
+ {"INVALID_OUTPUT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_OUTPUT_LENGTH},
+ #else
+ {"INVALID_OUTPUT_LENGTH", 57, 217},
+ #endif
+ #ifdef PROV_R_INVALID_PADDING_MODE
+ {"INVALID_PADDING_MODE", ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE},
+ #else
+ {"INVALID_PADDING_MODE", 57, 168},
+ #endif
+ #ifdef PROV_R_INVALID_PUBINFO
+ {"INVALID_PUBINFO", ERR_LIB_PROV, PROV_R_INVALID_PUBINFO},
+ #else
+ {"INVALID_PUBINFO", 57, 198},
+ #endif
+ #ifdef PROV_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 57, 112},
+ #endif
+ #ifdef PROV_R_INVALID_SEED_LENGTH
+ {"INVALID_SEED_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_SEED_LENGTH},
+ #else
+ {"INVALID_SEED_LENGTH", 57, 154},
+ #endif
+ #ifdef PROV_R_INVALID_SIGNATURE_SIZE
+ {"INVALID_SIGNATURE_SIZE", ERR_LIB_PROV, PROV_R_INVALID_SIGNATURE_SIZE},
+ #else
+ {"INVALID_SIGNATURE_SIZE", 57, 179},
+ #endif
+ #ifdef PROV_R_INVALID_STATE
+ {"INVALID_STATE", ERR_LIB_PROV, PROV_R_INVALID_STATE},
+ #else
+ {"INVALID_STATE", 57, 212},
+ #endif
+ #ifdef PROV_R_INVALID_TAG
+ {"INVALID_TAG", ERR_LIB_PROV, PROV_R_INVALID_TAG},
+ #else
+ {"INVALID_TAG", 57, 110},
+ #endif
+ #ifdef PROV_R_INVALID_TAG_LENGTH
+ {"INVALID_TAG_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH},
+ #else
+ {"INVALID_TAG_LENGTH", 57, 118},
+ #endif
+ #ifdef PROV_R_INVALID_UKM_LENGTH
+ {"INVALID_UKM_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_UKM_LENGTH},
+ #else
+ {"INVALID_UKM_LENGTH", 57, 200},
+ #endif
+ #ifdef PROV_R_INVALID_X931_DIGEST
+ {"INVALID_X931_DIGEST", ERR_LIB_PROV, PROV_R_INVALID_X931_DIGEST},
+ #else
+ {"INVALID_X931_DIGEST", 57, 170},
+ #endif
+ #ifdef PROV_R_IN_ERROR_STATE
+ {"IN_ERROR_STATE", ERR_LIB_PROV, PROV_R_IN_ERROR_STATE},
+ #else
+ {"IN_ERROR_STATE", 57, 192},
+ #endif
+ #ifdef PROV_R_KEY_SETUP_FAILED
+ {"KEY_SETUP_FAILED", ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED},
+ #else
+ {"KEY_SETUP_FAILED", 57, 101},
+ #endif
+ #ifdef PROV_R_KEY_SIZE_TOO_SMALL
+ {"KEY_SIZE_TOO_SMALL", ERR_LIB_PROV, PROV_R_KEY_SIZE_TOO_SMALL},
+ #else
+ {"KEY_SIZE_TOO_SMALL", 57, 171},
+ #endif
+ #ifdef PROV_R_LENGTH_TOO_LARGE
+ {"LENGTH_TOO_LARGE", ERR_LIB_PROV, PROV_R_LENGTH_TOO_LARGE},
+ #else
+ {"LENGTH_TOO_LARGE", 57, 202},
+ #endif
+ #ifdef PROV_R_MISMATCHING_DOMAIN_PARAMETERS
+ {"MISMATCHING_DOMAIN_PARAMETERS", ERR_LIB_PROV, PROV_R_MISMATCHING_DOMAIN_PARAMETERS},
+ #else
+ {"MISMATCHING_DOMAIN_PARAMETERS", 57, 203},
+ #endif
+ #ifdef PROV_R_MISSING_CEK_ALG
+ {"MISSING_CEK_ALG", ERR_LIB_PROV, PROV_R_MISSING_CEK_ALG},
+ #else
+ {"MISSING_CEK_ALG", 57, 144},
+ #endif
+ #ifdef PROV_R_MISSING_CIPHER
+ {"MISSING_CIPHER", ERR_LIB_PROV, PROV_R_MISSING_CIPHER},
+ #else
+ {"MISSING_CIPHER", 57, 155},
+ #endif
+ #ifdef PROV_R_MISSING_CONFIG_DATA
+ {"MISSING_CONFIG_DATA", ERR_LIB_PROV, PROV_R_MISSING_CONFIG_DATA},
+ #else
+ {"MISSING_CONFIG_DATA", 57, 213},
+ #endif
+ #ifdef PROV_R_MISSING_CONSTANT
+ {"MISSING_CONSTANT", ERR_LIB_PROV, PROV_R_MISSING_CONSTANT},
+ #else
+ {"MISSING_CONSTANT", 57, 156},
+ #endif
+ #ifdef PROV_R_MISSING_KEY
+ {"MISSING_KEY", ERR_LIB_PROV, PROV_R_MISSING_KEY},
+ #else
+ {"MISSING_KEY", 57, 128},
+ #endif
+ #ifdef PROV_R_MISSING_MAC
+ {"MISSING_MAC", ERR_LIB_PROV, PROV_R_MISSING_MAC},
+ #else
+ {"MISSING_MAC", 57, 150},
+ #endif
+ #ifdef PROV_R_MISSING_MESSAGE_DIGEST
+ {"MISSING_MESSAGE_DIGEST", ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST},
+ #else
+ {"MISSING_MESSAGE_DIGEST", 57, 129},
+ #endif
+ #ifdef PROV_R_MISSING_OID
+ {"MISSING_OID", ERR_LIB_PROV, PROV_R_MISSING_OID},
+ #else
+ {"MISSING_OID", 57, 209},
+ #endif
+ #ifdef PROV_R_MISSING_PASS
+ {"MISSING_PASS", ERR_LIB_PROV, PROV_R_MISSING_PASS},
+ #else
+ {"MISSING_PASS", 57, 130},
+ #endif
+ #ifdef PROV_R_MISSING_SALT
+ {"MISSING_SALT", ERR_LIB_PROV, PROV_R_MISSING_SALT},
+ #else
+ {"MISSING_SALT", 57, 131},
+ #endif
+ #ifdef PROV_R_MISSING_SECRET
+ {"MISSING_SECRET", ERR_LIB_PROV, PROV_R_MISSING_SECRET},
+ #else
+ {"MISSING_SECRET", 57, 132},
+ #endif
+ #ifdef PROV_R_MISSING_SEED
+ {"MISSING_SEED", ERR_LIB_PROV, PROV_R_MISSING_SEED},
+ #else
+ {"MISSING_SEED", 57, 140},
+ #endif
+ #ifdef PROV_R_MISSING_SESSION_ID
+ {"MISSING_SESSION_ID", ERR_LIB_PROV, PROV_R_MISSING_SESSION_ID},
+ #else
+ {"MISSING_SESSION_ID", 57, 133},
+ #endif
+ #ifdef PROV_R_MISSING_TYPE
+ {"MISSING_TYPE", ERR_LIB_PROV, PROV_R_MISSING_TYPE},
+ #else
+ {"MISSING_TYPE", 57, 134},
+ #endif
+ #ifdef PROV_R_MISSING_XCGHASH
+ {"MISSING_XCGHASH", ERR_LIB_PROV, PROV_R_MISSING_XCGHASH},
+ #else
+ {"MISSING_XCGHASH", 57, 135},
+ #endif
+ #ifdef PROV_R_MODULE_INTEGRITY_FAILURE
+ {"MODULE_INTEGRITY_FAILURE", ERR_LIB_PROV, PROV_R_MODULE_INTEGRITY_FAILURE},
+ #else
+ {"MODULE_INTEGRITY_FAILURE", 57, 214},
+ #endif
+ #ifdef PROV_R_NOT_A_PRIVATE_KEY
+ {"NOT_A_PRIVATE_KEY", ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY},
+ #else
+ {"NOT_A_PRIVATE_KEY", 57, 221},
+ #endif
+ #ifdef PROV_R_NOT_A_PUBLIC_KEY
+ {"NOT_A_PUBLIC_KEY", ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY},
+ #else
+ {"NOT_A_PUBLIC_KEY", 57, 220},
+ #endif
+ #ifdef PROV_R_NOT_INSTANTIATED
+ {"NOT_INSTANTIATED", ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED},
+ #else
+ {"NOT_INSTANTIATED", 57, 193},
+ #endif
+ #ifdef PROV_R_NOT_PARAMETERS
+ {"NOT_PARAMETERS", ERR_LIB_PROV, PROV_R_NOT_PARAMETERS},
+ #else
+ {"NOT_PARAMETERS", 57, 226},
+ #endif
+ #ifdef PROV_R_NOT_SUPPORTED
+ {"NOT_SUPPORTED", ERR_LIB_PROV, PROV_R_NOT_SUPPORTED},
+ #else
+ {"NOT_SUPPORTED", 57, 136},
+ #endif
+ #ifdef PROV_R_NOT_XOF_OR_INVALID_LENGTH
+ {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_PROV, PROV_R_NOT_XOF_OR_INVALID_LENGTH},
+ #else
+ {"NOT_XOF_OR_INVALID_LENGTH", 57, 113},
+ #endif
+ #ifdef PROV_R_NO_KEY_SET
+ {"NO_KEY_SET", ERR_LIB_PROV, PROV_R_NO_KEY_SET},
+ #else
+ {"NO_KEY_SET", 57, 114},
+ #endif
+ #ifdef PROV_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 57, 177},
+ #endif
+ #ifdef PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_PROV, PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 57, 178},
+ #endif
+ #ifdef PROV_R_OUTPUT_BUFFER_TOO_SMALL
+ {"OUTPUT_BUFFER_TOO_SMALL", ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL},
+ #else
+ {"OUTPUT_BUFFER_TOO_SMALL", 57, 106},
+ #endif
+ #ifdef PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS
+ {"PARENT_CANNOT_GENERATE_RANDOM_NUMBERS", ERR_LIB_PROV, PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS},
+ #else
+ {"PARENT_CANNOT_GENERATE_RANDOM_NUMBERS", 57, 228},
+ #endif
+ #ifdef PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED
+ {"PARENT_CANNOT_SUPPLY_ENTROPY_SEED", ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED},
+ #else
+ {"PARENT_CANNOT_SUPPLY_ENTROPY_SEED", 57, 187},
+ #endif
+ #ifdef PROV_R_PARENT_LOCKING_NOT_ENABLED
+ {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED},
+ #else
+ {"PARENT_LOCKING_NOT_ENABLED", 57, 182},
+ #endif
+ #ifdef PROV_R_PARENT_STRENGTH_TOO_WEAK
+ {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK},
+ #else
+ {"PARENT_STRENGTH_TOO_WEAK", 57, 194},
+ #endif
+ #ifdef PROV_R_PATH_MUST_BE_ABSOLUTE
+ {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_PROV, PROV_R_PATH_MUST_BE_ABSOLUTE},
+ #else
+ {"PATH_MUST_BE_ABSOLUTE", 57, 219},
+ #endif
+ #ifdef PROV_R_PERSONALISATION_STRING_TOO_LONG
+ {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_TOO_LONG},
+ #else
+ {"PERSONALISATION_STRING_TOO_LONG", 57, 195},
+ #endif
+ #ifdef PROV_R_PSS_SALTLEN_TOO_SMALL
+ {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_PROV, PROV_R_PSS_SALTLEN_TOO_SMALL},
+ #else
+ {"PSS_SALTLEN_TOO_SMALL", 57, 172},
+ #endif
+ #ifdef PROV_R_REQUEST_TOO_LARGE_FOR_DRBG
+ {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_DRBG},
+ #else
+ {"REQUEST_TOO_LARGE_FOR_DRBG", 57, 196},
+ #endif
+ #ifdef PROV_R_REQUIRE_CTR_MODE_CIPHER
+ {"REQUIRE_CTR_MODE_CIPHER", ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER},
+ #else
+ {"REQUIRE_CTR_MODE_CIPHER", 57, 206},
+ #endif
+ #ifdef PROV_R_RESEED_ERROR
+ {"RESEED_ERROR", ERR_LIB_PROV, PROV_R_RESEED_ERROR},
+ #else
+ {"RESEED_ERROR", 57, 197},
+ #endif
+ #ifdef PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_PROV, PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES},
+ #else
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 57, 222},
+ #endif
+ #ifdef PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT
+ {"SEED_SOURCES_MUST_NOT_HAVE_A_PARENT", ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT},
+ #else
+ {"SEED_SOURCES_MUST_NOT_HAVE_A_PARENT", 57, 229},
+ #endif
+ #ifdef PROV_R_SELF_TEST_KAT_FAILURE
+ {"SELF_TEST_KAT_FAILURE", ERR_LIB_PROV, PROV_R_SELF_TEST_KAT_FAILURE},
+ #else
+ {"SELF_TEST_KAT_FAILURE", 57, 215},
+ #endif
+ #ifdef PROV_R_SELF_TEST_POST_FAILURE
+ {"SELF_TEST_POST_FAILURE", ERR_LIB_PROV, PROV_R_SELF_TEST_POST_FAILURE},
+ #else
+ {"SELF_TEST_POST_FAILURE", 57, 216},
+ #endif
+ #ifdef PROV_R_TAG_NOT_NEEDED
+ {"TAG_NOT_NEEDED", ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED},
+ #else
+ {"TAG_NOT_NEEDED", 57, 120},
+ #endif
+ #ifdef PROV_R_TAG_NOT_SET
+ {"TAG_NOT_SET", ERR_LIB_PROV, PROV_R_TAG_NOT_SET},
+ #else
+ {"TAG_NOT_SET", 57, 119},
+ #endif
+ #ifdef PROV_R_TOO_MANY_RECORDS
+ {"TOO_MANY_RECORDS", ERR_LIB_PROV, PROV_R_TOO_MANY_RECORDS},
+ #else
+ {"TOO_MANY_RECORDS", 57, 126},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_FIND_CIPHERS
+ {"UNABLE_TO_FIND_CIPHERS", ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS},
+ #else
+ {"UNABLE_TO_FIND_CIPHERS", 57, 207},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_GET_PARENT_STRENGTH
+ {"UNABLE_TO_GET_PARENT_STRENGTH", ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH},
+ #else
+ {"UNABLE_TO_GET_PARENT_STRENGTH", 57, 199},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_GET_PASSPHRASE
+ {"UNABLE_TO_GET_PASSPHRASE", ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PASSPHRASE},
+ #else
+ {"UNABLE_TO_GET_PASSPHRASE", 57, 159},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_INITIALISE_CIPHERS
+ {"UNABLE_TO_INITIALISE_CIPHERS", ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS},
+ #else
+ {"UNABLE_TO_INITIALISE_CIPHERS", 57, 208},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_LOAD_SHA256
+ {"UNABLE_TO_LOAD_SHA256", ERR_LIB_PROV, PROV_R_UNABLE_TO_LOAD_SHA256},
+ #else
+ {"UNABLE_TO_LOAD_SHA256", 57, 147},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_LOCK_PARENT
+ {"UNABLE_TO_LOCK_PARENT", ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT},
+ #else
+ {"UNABLE_TO_LOCK_PARENT", 57, 201},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_RESEED
+ {"UNABLE_TO_RESEED", ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED},
+ #else
+ {"UNABLE_TO_RESEED", 57, 204},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_CEK_ALG
+ {"UNSUPPORTED_CEK_ALG", ERR_LIB_PROV, PROV_R_UNSUPPORTED_CEK_ALG},
+ #else
+ {"UNSUPPORTED_CEK_ALG", 57, 145},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_KEY_SIZE
+ {"UNSUPPORTED_KEY_SIZE", ERR_LIB_PROV, PROV_R_UNSUPPORTED_KEY_SIZE},
+ #else
+ {"UNSUPPORTED_KEY_SIZE", 57, 153},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_MAC_TYPE
+ {"UNSUPPORTED_MAC_TYPE", ERR_LIB_PROV, PROV_R_UNSUPPORTED_MAC_TYPE},
+ #else
+ {"UNSUPPORTED_MAC_TYPE", 57, 137},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_PROV, PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+ #else
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", 57, 152},
+ #endif
+ #ifdef PROV_R_URI_AUTHORITY_UNSUPPORTED
+ {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_PROV, PROV_R_URI_AUTHORITY_UNSUPPORTED},
+ #else
+ {"URI_AUTHORITY_UNSUPPORTED", 57, 223},
+ #endif
+ #ifdef PROV_R_VALUE_ERROR
+ {"VALUE_ERROR", ERR_LIB_PROV, PROV_R_VALUE_ERROR},
+ #else
+ {"VALUE_ERROR", 57, 138},
+ #endif
+ #ifdef PROV_R_WRONG_FINAL_BLOCK_LENGTH
+ {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_PROV, PROV_R_WRONG_FINAL_BLOCK_LENGTH},
+ #else
+ {"WRONG_FINAL_BLOCK_LENGTH", 57, 107},
+ #endif
+ #ifdef PROV_R_WRONG_OUTPUT_BUFFER_SIZE
+ {"WRONG_OUTPUT_BUFFER_SIZE", ERR_LIB_PROV, PROV_R_WRONG_OUTPUT_BUFFER_SIZE},
+ #else
+ {"WRONG_OUTPUT_BUFFER_SIZE", 57, 139},
+ #endif
+ #ifdef PROV_R_XOF_DIGESTS_NOT_ALLOWED
+ {"XOF_DIGESTS_NOT_ALLOWED", ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED},
+ #else
+ {"XOF_DIGESTS_NOT_ALLOWED", 57, 183},
+ #endif
+ #ifdef PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", ERR_LIB_PROV, PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE},
+ #else
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", 57, 148},
+ #endif
+ #ifdef PROV_R_XTS_DUPLICATED_KEYS
+ {"XTS_DUPLICATED_KEYS", ERR_LIB_PROV, PROV_R_XTS_DUPLICATED_KEYS},
+ #else
+ {"XTS_DUPLICATED_KEYS", 57, 149},
+ #endif
+ #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG
+ {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG},
+ #else
+ {"ADDITIONAL_INPUT_TOO_LONG", 36, 102},
+ #endif
+ #ifdef RAND_R_ALREADY_INSTANTIATED
+ {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED},
+ #else
+ {"ALREADY_INSTANTIATED", 36, 103},
+ #endif
+ #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE
+ {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE},
+ #else
+ {"ARGUMENT_OUT_OF_RANGE", 36, 105},
+ #endif
+ #ifdef RAND_R_CANNOT_OPEN_FILE
+ {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE},
+ #else
+ {"CANNOT_OPEN_FILE", 36, 121},
+ #endif
+ #ifdef RAND_R_DERIVATION_FUNCTION_MANDATORY_FOR_FIPS
+ {"DERIVATION_FUNCTION_MANDATORY_FOR_FIPS", ERR_LIB_RAND, RAND_R_DERIVATION_FUNCTION_MANDATORY_FOR_FIPS},
+ #else
+ {"DERIVATION_FUNCTION_MANDATORY_FOR_FIPS", 36, 137},
+ #endif
+ #ifdef RAND_R_DRBG_ALREADY_INITIALIZED
+ {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED},
+ #else
+ {"DRBG_ALREADY_INITIALIZED", 36, 129},
+ #endif
+ #ifdef RAND_R_DRBG_NOT_INITIALISED
+ {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED},
+ #else
+ {"DRBG_NOT_INITIALISED", 36, 104},
+ #endif
+ #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG
+ {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG},
+ #else
+ {"ENTROPY_INPUT_TOO_LONG", 36, 106},
+ #endif
+ #ifdef RAND_R_ENTROPY_OUT_OF_RANGE
+ {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE},
+ #else
+ {"ENTROPY_OUT_OF_RANGE", 36, 124},
+ #endif
+ #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED},
+ #else
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127},
+ #endif
+ #ifdef RAND_R_ERROR_INITIALISING_DRBG
+ {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG},
+ #else
+ {"ERROR_INITIALISING_DRBG", 36, 107},
+ #endif
+ #ifdef RAND_R_ERROR_INSTANTIATING_DRBG
+ {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG},
+ #else
+ {"ERROR_INSTANTIATING_DRBG", 36, 108},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT},
+ #else
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY
+ {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY},
+ #else
+ {"ERROR_RETRIEVING_ENTROPY", 36, 110},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_NONCE
+ {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE},
+ #else
+ {"ERROR_RETRIEVING_NONCE", 36, 111},
+ #endif
+ #ifdef RAND_R_FAILED_TO_CREATE_LOCK
+ {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK},
+ #else
+ {"FAILED_TO_CREATE_LOCK", 36, 126},
+ #endif
+ #ifdef RAND_R_FUNC_NOT_IMPLEMENTED
+ {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED},
+ #else
+ {"FUNC_NOT_IMPLEMENTED", 36, 101},
+ #endif
+ #ifdef RAND_R_FWRITE_ERROR
+ {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR},
+ #else
+ {"FWRITE_ERROR", 36, 123},
+ #endif
+ #ifdef RAND_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 36, 112},
+ #endif
+ #ifdef RAND_R_INSUFFICIENT_DRBG_STRENGTH
+ {"INSUFFICIENT_DRBG_STRENGTH", ERR_LIB_RAND, RAND_R_INSUFFICIENT_DRBG_STRENGTH},
+ #else
+ {"INSUFFICIENT_DRBG_STRENGTH", 36, 139},
+ #endif
+ #ifdef RAND_R_INTERNAL_ERROR
+ {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR},
+ #else
+ {"INTERNAL_ERROR", 36, 113},
+ #endif
+ #ifdef RAND_R_IN_ERROR_STATE
+ {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE},
+ #else
+ {"IN_ERROR_STATE", 36, 114},
+ #endif
+ #ifdef RAND_R_NOT_A_REGULAR_FILE
+ {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE},
+ #else
+ {"NOT_A_REGULAR_FILE", 36, 122},
+ #endif
+ #ifdef RAND_R_NOT_INSTANTIATED
+ {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED},
+ #else
+ {"NOT_INSTANTIATED", 36, 115},
+ #endif
+ #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED},
+ #else
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128},
+ #endif
+ #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED
+ {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED},
+ #else
+ {"PARENT_LOCKING_NOT_ENABLED", 36, 130},
+ #endif
+ #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK
+ {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK},
+ #else
+ {"PARENT_STRENGTH_TOO_WEAK", 36, 131},
+ #endif
+ #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG
+ {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG},
+ #else
+ {"PERSONALISATION_STRING_TOO_LONG", 36, 116},
+ #endif
+ #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED},
+ #else
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133},
+ #endif
+ #ifdef RAND_R_PRNG_NOT_SEEDED
+ {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED},
+ #else
+ {"PRNG_NOT_SEEDED", 36, 100},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_OVERFLOW
+ {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW},
+ #else
+ {"RANDOM_POOL_OVERFLOW", 36, 125},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_UNDERFLOW
+ {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW},
+ #else
+ {"RANDOM_POOL_UNDERFLOW", 36, 134},
+ #endif
+ #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG
+ {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG},
+ #else
+ {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117},
+ #endif
+ #ifdef RAND_R_RESEED_ERROR
+ {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR},
+ #else
+ {"RESEED_ERROR", 36, 118},
+ #endif
+ #ifdef RAND_R_SELFTEST_FAILURE
+ {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE},
+ #else
+ {"SELFTEST_FAILURE", 36, 119},
+ #endif
+ #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED
+ {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED},
+ #else
+ {"TOO_LITTLE_NONCE_REQUESTED", 36, 135},
+ #endif
+ #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED
+ {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED},
+ #else
+ {"TOO_MUCH_NONCE_REQUESTED", 36, 136},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_CREATE_DRBG
+ {"UNABLE_TO_CREATE_DRBG", ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG},
+ #else
+ {"UNABLE_TO_CREATE_DRBG", 36, 143},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_FETCH_DRBG
+ {"UNABLE_TO_FETCH_DRBG", ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG},
+ #else
+ {"UNABLE_TO_FETCH_DRBG", 36, 144},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER
+ {"UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER", ERR_LIB_RAND, RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER},
+ #else
+ {"UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER", 36, 141},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_GET_PARENT_STRENGTH
+ {"UNABLE_TO_GET_PARENT_STRENGTH", ERR_LIB_RAND, RAND_R_UNABLE_TO_GET_PARENT_STRENGTH},
+ #else
+ {"UNABLE_TO_GET_PARENT_STRENGTH", 36, 138},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_LOCK_PARENT
+ {"UNABLE_TO_LOCK_PARENT", ERR_LIB_RAND, RAND_R_UNABLE_TO_LOCK_PARENT},
+ #else
+ {"UNABLE_TO_LOCK_PARENT", 36, 140},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS
+ {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS},
+ #else
+ {"UNSUPPORTED_DRBG_FLAGS", 36, 132},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE
+ {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE},
+ #else
+ {"UNSUPPORTED_DRBG_TYPE", 36, 120},
+ #endif
+ #ifdef RSA_R_ALGORITHM_MISMATCH
+ {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH},
+ #else
+ {"ALGORITHM_MISMATCH", 4, 100},
+ #endif
+ #ifdef RSA_R_BAD_E_VALUE
+ {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE},
+ #else
+ {"BAD_E_VALUE", 4, 101},
+ #endif
+ #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT
+ {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT},
+ #else
+ {"BAD_FIXED_HEADER_DECRYPT", 4, 102},
+ #endif
+ #ifdef RSA_R_BAD_PAD_BYTE_COUNT
+ {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT},
+ #else
+ {"BAD_PAD_BYTE_COUNT", 4, 103},
+ #endif
+ #ifdef RSA_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 4, 104},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01
+ {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01},
+ #else
+ {"BLOCK_TYPE_IS_NOT_01", 4, 106},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02
+ {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02},
+ #else
+ {"BLOCK_TYPE_IS_NOT_02", 4, 107},
+ #endif
+ #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN
+ {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN},
+ #else
+ {"DATA_GREATER_THAN_MOD_LEN", 4, 108},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE
+ {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE},
+ #else
+ {"DATA_TOO_LARGE", 4, 109},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS
+ {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS},
+ #else
+ {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL
+ {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL},
+ #else
+ {"DATA_TOO_SMALL", 4, 111},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122},
+ #endif
+ #ifdef RSA_R_DIGEST_DOES_NOT_MATCH
+ {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH},
+ #else
+ {"DIGEST_DOES_NOT_MATCH", 4, 158},
+ #endif
+ #ifdef RSA_R_DIGEST_NOT_ALLOWED
+ {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED},
+ #else
+ {"DIGEST_NOT_ALLOWED", 4, 145},
+ #endif
+ #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY},
+ #else
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112},
+ #endif
+ #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D
+ {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMP1_NOT_CONGRUENT_TO_D", 4, 124},
+ #endif
+ #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D
+ {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125},
+ #endif
+ #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1
+ {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1},
+ #else
+ {"D_E_NOT_CONGRUENT_TO_1", 4, 123},
+ #endif
+ #ifdef RSA_R_FIRST_OCTET_INVALID
+ {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID},
+ #else
+ {"FIRST_OCTET_INVALID", 4, 133},
+ #endif
+ #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+ #else
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 4, 157},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST_LENGTH
+ {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH},
+ #else
+ {"INVALID_DIGEST_LENGTH", 4, 143},
+ #endif
+ #ifdef RSA_R_INVALID_HEADER
+ {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER},
+ #else
+ {"INVALID_HEADER", 4, 137},
+ #endif
+ #ifdef RSA_R_INVALID_KEYPAIR
+ {"INVALID_KEYPAIR", ERR_LIB_RSA, RSA_R_INVALID_KEYPAIR},
+ #else
+ {"INVALID_KEYPAIR", 4, 171},
+ #endif
+ #ifdef RSA_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 4, 173},
+ #endif
+ #ifdef RSA_R_INVALID_LABEL
+ {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL},
+ #else
+ {"INVALID_LABEL", 4, 160},
+ #endif
+ #ifdef RSA_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 4, 181},
+ #endif
+ #ifdef RSA_R_INVALID_MESSAGE_LENGTH
+ {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH},
+ #else
+ {"INVALID_MESSAGE_LENGTH", 4, 131},
+ #endif
+ #ifdef RSA_R_INVALID_MGF1_MD
+ {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD},
+ #else
+ {"INVALID_MGF1_MD", 4, 156},
+ #endif
+ #ifdef RSA_R_INVALID_MODULUS
+ {"INVALID_MODULUS", ERR_LIB_RSA, RSA_R_INVALID_MODULUS},
+ #else
+ {"INVALID_MODULUS", 4, 174},
+ #endif
+ #ifdef RSA_R_INVALID_MULTI_PRIME_KEY
+ {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY},
+ #else
+ {"INVALID_MULTI_PRIME_KEY", 4, 167},
+ #endif
+ #ifdef RSA_R_INVALID_OAEP_PARAMETERS
+ {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS},
+ #else
+ {"INVALID_OAEP_PARAMETERS", 4, 161},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING
+ {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING},
+ #else
+ {"INVALID_PADDING", 4, 138},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING_MODE
+ {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE},
+ #else
+ {"INVALID_PADDING_MODE", 4, 141},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_PARAMETERS
+ {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS},
+ #else
+ {"INVALID_PSS_PARAMETERS", 4, 149},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_SALTLEN
+ {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN},
+ #else
+ {"INVALID_PSS_SALTLEN", 4, 146},
+ #endif
+ #ifdef RSA_R_INVALID_REQUEST
+ {"INVALID_REQUEST", ERR_LIB_RSA, RSA_R_INVALID_REQUEST},
+ #else
+ {"INVALID_REQUEST", 4, 175},
+ #endif
+ #ifdef RSA_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 4, 150},
+ #endif
+ #ifdef RSA_R_INVALID_STRENGTH
+ {"INVALID_STRENGTH", ERR_LIB_RSA, RSA_R_INVALID_STRENGTH},
+ #else
+ {"INVALID_STRENGTH", 4, 176},
+ #endif
+ #ifdef RSA_R_INVALID_TRAILER
+ {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER},
+ #else
+ {"INVALID_TRAILER", 4, 139},
+ #endif
+ #ifdef RSA_R_INVALID_X931_DIGEST
+ {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST},
+ #else
+ {"INVALID_X931_DIGEST", 4, 142},
+ #endif
+ #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q
+ {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q},
+ #else
+ {"IQMP_NOT_INVERSE_OF_Q", 4, 126},
+ #endif
+ #ifdef RSA_R_KEY_PRIME_NUM_INVALID
+ {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID},
+ #else
+ {"KEY_PRIME_NUM_INVALID", 4, 165},
+ #endif
+ #ifdef RSA_R_KEY_SIZE_TOO_SMALL
+ {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL},
+ #else
+ {"KEY_SIZE_TOO_SMALL", 4, 120},
+ #endif
+ #ifdef RSA_R_LAST_OCTET_INVALID
+ {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID},
+ #else
+ {"LAST_OCTET_INVALID", 4, 134},
+ #endif
+ #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED
+ {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED},
+ #else
+ {"MGF1_DIGEST_NOT_ALLOWED", 4, 152},
+ #endif
+ #ifdef RSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 4, 179},
+ #endif
+ #ifdef RSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 4, 105},
+ #endif
+ #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R},
+ #else
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168},
+ #endif
+ #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D},
+ #else
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169},
+ #endif
+ #ifdef RSA_R_MP_R_NOT_PRIME
+ {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME},
+ #else
+ {"MP_R_NOT_PRIME", 4, 170},
+ #endif
+ #ifdef RSA_R_NO_PUBLIC_EXPONENT
+ {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT},
+ #else
+ {"NO_PUBLIC_EXPONENT", 4, 140},
+ #endif
+ #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING
+ {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING},
+ #else
+ {"NULL_BEFORE_BLOCK_MISSING", 4, 113},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES},
+ #else
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q
+ {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q},
+ #else
+ {"N_DOES_NOT_EQUAL_P_Q", 4, 127},
+ #endif
+ #ifdef RSA_R_OAEP_DECODING_ERROR
+ {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR},
+ #else
+ {"OAEP_DECODING_ERROR", 4, 121},
+ #endif
+ #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148},
+ #endif
+ #ifdef RSA_R_PADDING_CHECK_FAILED
+ {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED},
+ #else
+ {"PADDING_CHECK_FAILED", 4, 114},
+ #endif
+ #ifdef RSA_R_PAIRWISE_TEST_FAILURE
+ {"PAIRWISE_TEST_FAILURE", ERR_LIB_RSA, RSA_R_PAIRWISE_TEST_FAILURE},
+ #else
+ {"PAIRWISE_TEST_FAILURE", 4, 177},
+ #endif
+ #ifdef RSA_R_PKCS_DECODING_ERROR
+ {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR},
+ #else
+ {"PKCS_DECODING_ERROR", 4, 159},
+ #endif
+ #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL
+ {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL},
+ #else
+ {"PSS_SALTLEN_TOO_SMALL", 4, 164},
+ #endif
+ #ifdef RSA_R_PUB_EXPONENT_OUT_OF_RANGE
+ {"PUB_EXPONENT_OUT_OF_RANGE", ERR_LIB_RSA, RSA_R_PUB_EXPONENT_OUT_OF_RANGE},
+ #else
+ {"PUB_EXPONENT_OUT_OF_RANGE", 4, 178},
+ #endif
+ #ifdef RSA_R_P_NOT_PRIME
+ {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME},
+ #else
+ {"P_NOT_PRIME", 4, 128},
+ #endif
+ #ifdef RSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 4, 129},
+ #endif
+ #ifdef RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT
+ {"RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT", ERR_LIB_RSA, RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT},
+ #else
+ {"RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT", 4, 180},
+ #endif
+ #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
+ {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED},
+ #else
+ {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130},
+ #endif
+ #ifdef RSA_R_SLEN_CHECK_FAILED
+ {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED},
+ #else
+ {"SLEN_CHECK_FAILED", 4, 136},
+ #endif
+ #ifdef RSA_R_SLEN_RECOVERY_FAILED
+ {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED},
+ #else
+ {"SLEN_RECOVERY_FAILED", 4, 135},
+ #endif
+ #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK
+ {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK},
+ #else
+ {"SSLV3_ROLLBACK_ATTACK", 4, 115},
+ #endif
+ #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116},
+ #endif
+ #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE
+ {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE},
+ #else
+ {"UNKNOWN_ALGORITHM_TYPE", 4, 117},
+ #endif
+ #ifdef RSA_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 4, 166},
+ #endif
+ #ifdef RSA_R_UNKNOWN_MASK_DIGEST
+ {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST},
+ #else
+ {"UNKNOWN_MASK_DIGEST", 4, 151},
+ #endif
+ #ifdef RSA_R_UNKNOWN_PADDING_TYPE
+ {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE},
+ #else
+ {"UNKNOWN_PADDING_TYPE", 4, 118},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE
+ {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE},
+ #else
+ {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE
+ {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE},
+ #else
+ {"UNSUPPORTED_LABEL_SOURCE", 4, 163},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM
+ {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MASK_ALGORITHM", 4, 153},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER
+ {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER},
+ #else
+ {"UNSUPPORTED_MASK_PARAMETER", 4, 154},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE
+ {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE},
+ #else
+ {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155},
+ #endif
+ #ifdef RSA_R_VALUE_MISSING
+ {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING},
+ #else
+ {"VALUE_MISSING", 4, 147},
+ #endif
+ #ifdef RSA_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 4, 119},
+ #endif
+ #ifdef SM2_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_SM2, SM2_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 53, 100},
+ #endif
+ #ifdef SM2_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SM2, SM2_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 53, 101},
+ #endif
+ #ifdef SM2_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_SM2, SM2_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 53, 107},
+ #endif
+ #ifdef SM2_R_DIST_ID_TOO_LARGE
+ {"DIST_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_DIST_ID_TOO_LARGE},
+ #else
+ {"DIST_ID_TOO_LARGE", 53, 110},
+ #endif
+ #ifdef SM2_R_ID_NOT_SET
+ {"ID_NOT_SET", ERR_LIB_SM2, SM2_R_ID_NOT_SET},
+ #else
+ {"ID_NOT_SET", 53, 112},
+ #endif
+ #ifdef SM2_R_ID_TOO_LARGE
+ {"ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_ID_TOO_LARGE},
+ #else
+ {"ID_TOO_LARGE", 53, 111},
+ #endif
+ #ifdef SM2_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_SM2, SM2_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 53, 108},
+ #endif
+ #ifdef SM2_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_SM2, SM2_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 53, 102},
+ #endif
+ #ifdef SM2_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_SM2, SM2_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 53, 103},
+ #endif
+ #ifdef SM2_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_SM2, SM2_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 53, 104},
+ #endif
+ #ifdef SM2_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_SM2, SM2_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 53, 105},
+ #endif
+ #ifdef SM2_R_INVALID_PRIVATE_KEY
+ {"INVALID_PRIVATE_KEY", ERR_LIB_SM2, SM2_R_INVALID_PRIVATE_KEY},
+ #else
+ {"INVALID_PRIVATE_KEY", 53, 113},
+ #endif
+ #ifdef SM2_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_SM2, SM2_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 53, 109},
+ #endif
+ #ifdef SM2_R_USER_ID_TOO_LARGE
+ {"USER_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_USER_ID_TOO_LARGE},
+ #else
+ {"USER_ID_TOO_LARGE", 53, 106},
+ #endif
+ #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY},
+ #else
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291},
+ #endif
+ #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
+ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
+ #else
+ {"APP_DATA_IN_HANDSHAKE", 20, 100},
+ #endif
+ #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
+ #else
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE
+ {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE},
+ #else
+ {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE},
+ #else
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158},
+ #endif
+ #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
+ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
+ #else
+ {"BAD_CHANGE_CIPHER_SPEC", 20, 103},
+ #endif
+ #ifdef SSL_R_BAD_CIPHER
+ {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER},
+ #else
+ {"BAD_CIPHER", 20, 186},
+ #endif
+ #ifdef SSL_R_BAD_DATA
+ {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA},
+ #else
+ {"BAD_DATA", 20, 390},
+ #endif
+ #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
+ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
+ #else
+ {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106},
+ #endif
+ #ifdef SSL_R_BAD_DECOMPRESSION
+ {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
+ #else
+ {"BAD_DECOMPRESSION", 20, 107},
+ #endif
+ #ifdef SSL_R_BAD_DH_VALUE
+ {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE},
+ #else
+ {"BAD_DH_VALUE", 20, 102},
+ #endif
+ #ifdef SSL_R_BAD_DIGEST_LENGTH
+ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
+ #else
+ {"BAD_DIGEST_LENGTH", 20, 111},
+ #endif
+ #ifdef SSL_R_BAD_EARLY_DATA
+ {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA},
+ #else
+ {"BAD_EARLY_DATA", 20, 233},
+ #endif
+ #ifdef SSL_R_BAD_ECC_CERT
+ {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
+ #else
+ {"BAD_ECC_CERT", 20, 304},
+ #endif
+ #ifdef SSL_R_BAD_ECPOINT
+ {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
+ #else
+ {"BAD_ECPOINT", 20, 306},
+ #endif
+ #ifdef SSL_R_BAD_EXTENSION
+ {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION},
+ #else
+ {"BAD_EXTENSION", 20, 110},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
+ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
+ #else
+ {"BAD_HANDSHAKE_LENGTH", 20, 332},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_STATE
+ {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE},
+ #else
+ {"BAD_HANDSHAKE_STATE", 20, 236},
+ #endif
+ #ifdef SSL_R_BAD_HELLO_REQUEST
+ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
+ #else
+ {"BAD_HELLO_REQUEST", 20, 105},
+ #endif
+ #ifdef SSL_R_BAD_HRR_VERSION
+ {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION},
+ #else
+ {"BAD_HRR_VERSION", 20, 263},
+ #endif
+ #ifdef SSL_R_BAD_KEY_SHARE
+ {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE},
+ #else
+ {"BAD_KEY_SHARE", 20, 108},
+ #endif
+ #ifdef SSL_R_BAD_KEY_UPDATE
+ {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE},
+ #else
+ {"BAD_KEY_UPDATE", 20, 122},
+ #endif
+ #ifdef SSL_R_BAD_LEGACY_VERSION
+ {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION},
+ #else
+ {"BAD_LEGACY_VERSION", 20, 292},
+ #endif
+ #ifdef SSL_R_BAD_LENGTH
+ {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
+ #else
+ {"BAD_LENGTH", 20, 271},
+ #endif
+ #ifdef SSL_R_BAD_PACKET
+ {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET},
+ #else
+ {"BAD_PACKET", 20, 240},
+ #endif
+ #ifdef SSL_R_BAD_PACKET_LENGTH
+ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
+ #else
+ {"BAD_PACKET_LENGTH", 20, 115},
+ #endif
+ #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
+ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
+ #else
+ {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116},
+ #endif
+ #ifdef SSL_R_BAD_PSK
+ {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK},
+ #else
+ {"BAD_PSK", 20, 219},
+ #endif
+ #ifdef SSL_R_BAD_PSK_IDENTITY
+ {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY},
+ #else
+ {"BAD_PSK_IDENTITY", 20, 114},
+ #endif
+ #ifdef SSL_R_BAD_RECORD_TYPE
+ {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE},
+ #else
+ {"BAD_RECORD_TYPE", 20, 443},
+ #endif
+ #ifdef SSL_R_BAD_RSA_ENCRYPT
+ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
+ #else
+ {"BAD_RSA_ENCRYPT", 20, 119},
+ #endif
+ #ifdef SSL_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 20, 123},
+ #endif
+ #ifdef SSL_R_BAD_SRP_A_LENGTH
+ {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH},
+ #else
+ {"BAD_SRP_A_LENGTH", 20, 347},
+ #endif
+ #ifdef SSL_R_BAD_SRP_PARAMETERS
+ {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS},
+ #else
+ {"BAD_SRP_PARAMETERS", 20, 371},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_MKI_VALUE
+ {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE},
+ #else
+ {"BAD_SRTP_MKI_VALUE", 20, 352},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353},
+ #endif
+ #ifdef SSL_R_BAD_SSL_FILETYPE
+ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
+ #else
+ {"BAD_SSL_FILETYPE", 20, 124},
+ #endif
+ #ifdef SSL_R_BAD_VALUE
+ {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE},
+ #else
+ {"BAD_VALUE", 20, 384},
+ #endif
+ #ifdef SSL_R_BAD_WRITE_RETRY
+ {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
+ #else
+ {"BAD_WRITE_RETRY", 20, 127},
+ #endif
+ #ifdef SSL_R_BINDER_DOES_NOT_VERIFY
+ {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY},
+ #else
+ {"BINDER_DOES_NOT_VERIFY", 20, 253},
+ #endif
+ #ifdef SSL_R_BIO_NOT_SET
+ {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
+ #else
+ {"BIO_NOT_SET", 20, 128},
+ #endif
+ #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
+ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
+ #else
+ {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129},
+ #endif
+ #ifdef SSL_R_BN_LIB
+ {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
+ #else
+ {"BN_LIB", 20, 130},
+ #endif
+ #ifdef SSL_R_CALLBACK_FAILED
+ {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED},
+ #else
+ {"CALLBACK_FAILED", 20, 234},
+ #endif
+ #ifdef SSL_R_CANNOT_CHANGE_CIPHER
+ {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER},
+ #else
+ {"CANNOT_CHANGE_CIPHER", 20, 109},
+ #endif
+ #ifdef SSL_R_CANNOT_GET_GROUP_NAME
+ {"CANNOT_GET_GROUP_NAME", ERR_LIB_SSL, SSL_R_CANNOT_GET_GROUP_NAME},
+ #else
+ {"CANNOT_GET_GROUP_NAME", 20, 299},
+ #endif
+ #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
+ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
+ #else
+ {"CA_DN_LENGTH_MISMATCH", 20, 131},
+ #endif
+ #ifdef SSL_R_CA_KEY_TOO_SMALL
+ {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL},
+ #else
+ {"CA_KEY_TOO_SMALL", 20, 397},
+ #endif
+ #ifdef SSL_R_CA_MD_TOO_WEAK
+ {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK},
+ #else
+ {"CA_MD_TOO_WEAK", 20, 398},
+ #endif
+ #ifdef SSL_R_CCS_RECEIVED_EARLY
+ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
+ #else
+ {"CCS_RECEIVED_EARLY", 20, 133},
+ #endif
+ #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
+ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED},
+ #else
+ {"CERTIFICATE_VERIFY_FAILED", 20, 134},
+ #endif
+ #ifdef SSL_R_CERT_CB_ERROR
+ {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR},
+ #else
+ {"CERT_CB_ERROR", 20, 377},
+ #endif
+ #ifdef SSL_R_CERT_LENGTH_MISMATCH
+ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
+ #else
+ {"CERT_LENGTH_MISMATCH", 20, 135},
+ #endif
+ #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED},
+ #else
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218},
+ #endif
+ #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
+ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH},
+ #else
+ {"CIPHER_CODE_WRONG_LENGTH", 20, 137},
+ #endif
+ #ifdef SSL_R_CLIENTHELLO_TLSEXT
+ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
+ #else
+ {"CLIENTHELLO_TLSEXT", 20, 226},
+ #endif
+ #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
+ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG},
+ #else
+ {"COMPRESSED_LENGTH_TOO_LONG", 20, 140},
+ #endif
+ #ifdef SSL_R_COMPRESSION_DISABLED
+ {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
+ #else
+ {"COMPRESSION_DISABLED", 20, 343},
+ #endif
+ #ifdef SSL_R_COMPRESSION_FAILURE
+ {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
+ #else
+ {"COMPRESSION_FAILURE", 20, 141},
+ #endif
+ #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
+ #else
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307},
+ #endif
+ #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
+ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR},
+ #else
+ {"COMPRESSION_LIBRARY_ERROR", 20, 142},
+ #endif
+ #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
+ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
+ #else
+ {"CONNECTION_TYPE_NOT_SET", 20, 144},
+ #endif
+ #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED
+ {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED},
+ #else
+ {"CONTEXT_NOT_DANE_ENABLED", 20, 167},
+ #endif
+ #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE
+ {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE},
+ #else
+ {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400},
+ #endif
+ #ifdef SSL_R_COOKIE_MISMATCH
+ {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
+ #else
+ {"COOKIE_MISMATCH", 20, 308},
+ #endif
+ #ifdef SSL_R_COPY_PARAMETERS_FAILED
+ {"COPY_PARAMETERS_FAILED", ERR_LIB_SSL, SSL_R_COPY_PARAMETERS_FAILED},
+ #else
+ {"COPY_PARAMETERS_FAILED", 20, 296},
+ #endif
+ #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED},
+ #else
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206},
+ #endif
+ #ifdef SSL_R_DANE_ALREADY_ENABLED
+ {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED},
+ #else
+ {"DANE_ALREADY_ENABLED", 20, 172},
+ #endif
+ #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL},
+ #else
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173},
+ #endif
+ #ifdef SSL_R_DANE_NOT_ENABLED
+ {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED},
+ #else
+ {"DANE_NOT_ENABLED", 20, 175},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE
+ {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE", 20, 180},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH
+ {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE
+ {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE},
+ #else
+ {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY
+ {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY},
+ #else
+ {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR
+ {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR},
+ #else
+ {"DANE_TLSA_BAD_SELECTOR", 20, 202},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_NULL_DATA
+ {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA},
+ #else
+ {"DANE_TLSA_NULL_DATA", 20, 203},
+ #endif
+ #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
+ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
+ #else
+ {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145},
+ #endif
+ #ifdef SSL_R_DATA_LENGTH_TOO_LONG
+ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
+ #else
+ {"DATA_LENGTH_TOO_LONG", 20, 146},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED
+ {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
+ #else
+ {"DECRYPTION_FAILED", 20, 147},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
+ #else
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281},
+ #endif
+ #ifdef SSL_R_DH_KEY_TOO_SMALL
+ {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL},
+ #else
+ {"DH_KEY_TOO_SMALL", 20, 394},
+ #endif
+ #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
+ #else
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148},
+ #endif
+ #ifdef SSL_R_DIGEST_CHECK_FAILED
+ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
+ #else
+ {"DIGEST_CHECK_FAILED", 20, 149},
+ #endif
+ #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
+ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
+ #else
+ {"DTLS_MESSAGE_TOO_BIG", 20, 334},
+ #endif
+ #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
+ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID},
+ #else
+ {"DUPLICATE_COMPRESSION_ID", 20, 309},
+ #endif
+ #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
+ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING},
+ #else
+ {"ECC_CERT_NOT_FOR_SIGNING", 20, 318},
+ #endif
+ #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE},
+ #else
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374},
+ #endif
+ #ifdef SSL_R_EE_KEY_TOO_SMALL
+ {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL},
+ #else
+ {"EE_KEY_TOO_SMALL", 20, 399},
+ #endif
+ #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354},
+ #endif
+ #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
+ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
+ #else
+ {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150},
+ #endif
+ #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
+ #else
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151},
+ #endif
+ #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN},
+ #else
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204},
+ #endif
+ #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE},
+ #else
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194},
+ #endif
+ #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
+ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
+ #else
+ {"EXCESSIVE_MESSAGE_SIZE", 20, 152},
+ #endif
+ #ifdef SSL_R_EXTENSION_NOT_RECEIVED
+ {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED},
+ #else
+ {"EXTENSION_NOT_RECEIVED", 20, 279},
+ #endif
+ #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
+ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
+ #else
+ {"EXTRA_DATA_IN_MESSAGE", 20, 153},
+ #endif
+ #ifdef SSL_R_EXT_LENGTH_MISMATCH
+ {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH},
+ #else
+ {"EXT_LENGTH_MISMATCH", 20, 163},
+ #endif
+ #ifdef SSL_R_FAILED_TO_INIT_ASYNC
+ {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC},
+ #else
+ {"FAILED_TO_INIT_ASYNC", 20, 405},
+ #endif
+ #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO
+ {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO},
+ #else
+ {"FRAGMENTED_CLIENT_HELLO", 20, 401},
+ #endif
+ #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
+ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
+ #else
+ {"GOT_A_FIN_BEFORE_A_CCS", 20, 154},
+ #endif
+ #ifdef SSL_R_HTTPS_PROXY_REQUEST
+ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
+ #else
+ {"HTTPS_PROXY_REQUEST", 20, 155},
+ #endif
+ #ifdef SSL_R_HTTP_REQUEST
+ {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
+ #else
+ {"HTTP_REQUEST", 20, 156},
+ #endif
+ #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION
+ {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION},
+ #else
+ {"ILLEGAL_POINT_COMPRESSION", 20, 162},
+ #endif
+ #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST
+ {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST},
+ #else
+ {"ILLEGAL_SUITEB_DIGEST", 20, 380},
+ #endif
+ #ifdef SSL_R_INAPPROPRIATE_FALLBACK
+ {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK},
+ #else
+ {"INAPPROPRIATE_FALLBACK", 20, 373},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_COMPRESSION
+ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION},
+ #else
+ {"INCONSISTENT_COMPRESSION", 20, 340},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN
+ {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN},
+ #else
+ {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI
+ {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI},
+ #else
+ {"INCONSISTENT_EARLY_DATA_SNI", 20, 231},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EXTMS
+ {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS},
+ #else
+ {"INCONSISTENT_EXTMS", 20, 104},
+ #endif
+ #ifdef SSL_R_INSUFFICIENT_SECURITY
+ {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY},
+ #else
+ {"INSUFFICIENT_SECURITY", 20, 241},
+ #endif
+ #ifdef SSL_R_INVALID_ALERT
+ {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT},
+ #else
+ {"INVALID_ALERT", 20, 205},
+ #endif
+ #ifdef SSL_R_INVALID_CCS_MESSAGE
+ {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE},
+ #else
+ {"INVALID_CCS_MESSAGE", 20, 260},
+ #endif
+ #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG
+ {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG},
+ #else
+ {"INVALID_CERTIFICATE_OR_ALG", 20, 238},
+ #endif
+ #ifdef SSL_R_INVALID_COMMAND
+ {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
+ #else
+ {"INVALID_COMMAND", 20, 280},
+ #endif
+ #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
+ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM},
+ #else
+ {"INVALID_COMPRESSION_ALGORITHM", 20, 341},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIG
+ {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG},
+ #else
+ {"INVALID_CONFIG", 20, 283},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIGURATION_NAME
+ {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME},
+ #else
+ {"INVALID_CONFIGURATION_NAME", 20, 113},
+ #endif
+ #ifdef SSL_R_INVALID_CONTEXT
+ {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT},
+ #else
+ {"INVALID_CONTEXT", 20, 282},
+ #endif
+ #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE
+ {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE},
+ #else
+ {"INVALID_CT_VALIDATION_TYPE", 20, 212},
+ #endif
+ #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE
+ {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE},
+ #else
+ {"INVALID_KEY_UPDATE_TYPE", 20, 120},
+ #endif
+ #ifdef SSL_R_INVALID_MAX_EARLY_DATA
+ {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA},
+ #else
+ {"INVALID_MAX_EARLY_DATA", 20, 174},
+ #endif
+ #ifdef SSL_R_INVALID_NULL_CMD_NAME
+ {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME},
+ #else
+ {"INVALID_NULL_CMD_NAME", 20, 385},
+ #endif
+ #ifdef SSL_R_INVALID_SEQUENCE_NUMBER
+ {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER},
+ #else
+ {"INVALID_SEQUENCE_NUMBER", 20, 402},
+ #endif
+ #ifdef SSL_R_INVALID_SERVERINFO_DATA
+ {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA},
+ #else
+ {"INVALID_SERVERINFO_DATA", 20, 388},
+ #endif
+ #ifdef SSL_R_INVALID_SESSION_ID
+ {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID},
+ #else
+ {"INVALID_SESSION_ID", 20, 999},
+ #endif
+ #ifdef SSL_R_INVALID_SRP_USERNAME
+ {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME},
+ #else
+ {"INVALID_SRP_USERNAME", 20, 357},
+ #endif
+ #ifdef SSL_R_INVALID_STATUS_RESPONSE
+ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
+ #else
+ {"INVALID_STATUS_RESPONSE", 20, 328},
+ #endif
+ #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
+ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH},
+ #else
+ {"INVALID_TICKET_KEYS_LENGTH", 20, 325},
+ #endif
+ #ifdef SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED
+ {"LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED", ERR_LIB_SSL, SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED},
+ #else
+ {"LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED", 20, 333},
+ #endif
+ #ifdef SSL_R_LENGTH_MISMATCH
+ {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
+ #else
+ {"LENGTH_MISMATCH", 20, 159},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 20, 404},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_SHORT
+ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
+ #else
+ {"LENGTH_TOO_SHORT", 20, 160},
+ #endif
+ #ifdef SSL_R_LIBRARY_BUG
+ {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
+ #else
+ {"LIBRARY_BUG", 20, 274},
+ #endif
+ #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
+ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"LIBRARY_HAS_NO_CIPHERS", 20, 161},
+ #endif
+ #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
+ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT},
+ #else
+ {"MISSING_DSA_SIGNING_CERT", 20, 165},
+ #endif
+ #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT
+ {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT},
+ #else
+ {"MISSING_ECDSA_SIGNING_CERT", 20, 381},
+ #endif
+ #ifdef SSL_R_MISSING_FATAL
+ {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL},
+ #else
+ {"MISSING_FATAL", 20, 256},
+ #endif
+ #ifdef SSL_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 20, 290},
+ #endif
+ #ifdef SSL_R_MISSING_PSK_KEX_MODES_EXTENSION
+ {"MISSING_PSK_KEX_MODES_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_PSK_KEX_MODES_EXTENSION},
+ #else
+ {"MISSING_PSK_KEX_MODES_EXTENSION", 20, 310},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_CERTIFICATE
+ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
+ #else
+ {"MISSING_RSA_CERTIFICATE", 20, 168},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
+ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT},
+ #else
+ {"MISSING_RSA_ENCRYPTING_CERT", 20, 169},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
+ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT},
+ #else
+ {"MISSING_RSA_SIGNING_CERT", 20, 170},
+ #endif
+ #ifdef SSL_R_MISSING_SIGALGS_EXTENSION
+ {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION},
+ #else
+ {"MISSING_SIGALGS_EXTENSION", 20, 112},
+ #endif
+ #ifdef SSL_R_MISSING_SIGNING_CERT
+ {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT},
+ #else
+ {"MISSING_SIGNING_CERT", 20, 221},
+ #endif
+ #ifdef SSL_R_MISSING_SRP_PARAM
+ {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM},
+ #else
+ {"MISSING_SRP_PARAM", 20, 358},
+ #endif
+ #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION},
+ #else
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_DH_KEY
+ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
+ #else
+ {"MISSING_TMP_DH_KEY", 20, 171},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_ECDH_KEY
+ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
+ #else
+ {"MISSING_TMP_ECDH_KEY", 20, 311},
+ #endif
+ #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA},
+ #else
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293},
+ #endif
+ #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY
+ {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY},
+ #else
+ {"NOT_ON_RECORD_BOUNDARY", 20, 182},
+ #endif
+ #ifdef SSL_R_NOT_REPLACING_CERTIFICATE
+ {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE},
+ #else
+ {"NOT_REPLACING_CERTIFICATE", 20, 289},
+ #endif
+ #ifdef SSL_R_NOT_SERVER
+ {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER},
+ #else
+ {"NOT_SERVER", 20, 284},
+ #endif
+ #ifdef SSL_R_NO_APPLICATION_PROTOCOL
+ {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL},
+ #else
+ {"NO_APPLICATION_PROTOCOL", 20, 235},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATES_RETURNED
+ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED},
+ #else
+ {"NO_CERTIFICATES_RETURNED", 20, 176},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
+ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
+ #else
+ {"NO_CERTIFICATE_ASSIGNED", 20, 177},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_SET
+ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
+ #else
+ {"NO_CERTIFICATE_SET", 20, 179},
+ #endif
+ #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR
+ {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR},
+ #else
+ {"NO_CHANGE_FOLLOWING_HRR", 20, 214},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_AVAILABLE
+ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
+ #else
+ {"NO_CIPHERS_AVAILABLE", 20, 181},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_SPECIFIED
+ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
+ #else
+ {"NO_CIPHERS_SPECIFIED", 20, 183},
+ #endif
+ #ifdef SSL_R_NO_CIPHER_MATCH
+ {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
+ #else
+ {"NO_CIPHER_MATCH", 20, 185},
+ #endif
+ #ifdef SSL_R_NO_CLIENT_CERT_METHOD
+ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
+ #else
+ {"NO_CLIENT_CERT_METHOD", 20, 331},
+ #endif
+ #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
+ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED},
+ #else
+ {"NO_COMPRESSION_SPECIFIED", 20, 187},
+ #endif
+ #ifdef SSL_R_NO_COOKIE_CALLBACK_SET
+ {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET},
+ #else
+ {"NO_COOKIE_CALLBACK_SET", 20, 287},
+ #endif
+ #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
+ #else
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330},
+ #endif
+ #ifdef SSL_R_NO_METHOD_SPECIFIED
+ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
+ #else
+ {"NO_METHOD_SPECIFIED", 20, 188},
+ #endif
+ #ifdef SSL_R_NO_PEM_EXTENSIONS
+ {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS},
+ #else
+ {"NO_PEM_EXTENSIONS", 20, 389},
+ #endif
+ #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
+ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
+ #else
+ {"NO_PRIVATE_KEY_ASSIGNED", 20, 190},
+ #endif
+ #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
+ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
+ #else
+ {"NO_PROTOCOLS_AVAILABLE", 20, 191},
+ #endif
+ #ifdef SSL_R_NO_RENEGOTIATION
+ {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
+ #else
+ {"NO_RENEGOTIATION", 20, 339},
+ #endif
+ #ifdef SSL_R_NO_REQUIRED_DIGEST
+ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
+ #else
+ {"NO_REQUIRED_DIGEST", 20, 324},
+ #endif
+ #ifdef SSL_R_NO_SHARED_CIPHER
+ {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
+ #else
+ {"NO_SHARED_CIPHER", 20, 193},
+ #endif
+ #ifdef SSL_R_NO_SHARED_GROUPS
+ {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS},
+ #else
+ {"NO_SHARED_GROUPS", 20, 410},
+ #endif
+ #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS},
+ #else
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376},
+ #endif
+ #ifdef SSL_R_NO_SRTP_PROFILES
+ {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES},
+ #else
+ {"NO_SRTP_PROFILES", 20, 359},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_DIGEST_ALGORITHM
+ {"NO_SUITABLE_DIGEST_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_DIGEST_ALGORITHM},
+ #else
+ {"NO_SUITABLE_DIGEST_ALGORITHM", 20, 297},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_GROUPS
+ {"NO_SUITABLE_GROUPS", ERR_LIB_SSL, SSL_R_NO_SUITABLE_GROUPS},
+ #else
+ {"NO_SUITABLE_GROUPS", 20, 295},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_KEY_SHARE
+ {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE},
+ #else
+ {"NO_SUITABLE_KEY_SHARE", 20, 101},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM},
+ #else
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118},
+ #endif
+ #ifdef SSL_R_NO_VALID_SCTS
+ {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS},
+ #else
+ {"NO_VALID_SCTS", 20, 216},
+ #endif
+ #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK
+ {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK},
+ #else
+ {"NO_VERIFY_COOKIE_CALLBACK", 20, 403},
+ #endif
+ #ifdef SSL_R_NULL_SSL_CTX
+ {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
+ #else
+ {"NULL_SSL_CTX", 20, 195},
+ #endif
+ #ifdef SSL_R_NULL_SSL_METHOD_PASSED
+ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
+ #else
+ {"NULL_SSL_METHOD_PASSED", 20, 196},
+ #endif
+ #ifdef SSL_R_OCSP_CALLBACK_FAILURE
+ {"OCSP_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_OCSP_CALLBACK_FAILURE},
+ #else
+ {"OCSP_CALLBACK_FAILURE", 20, 305},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344},
+ #endif
+ #ifdef SSL_R_OVERFLOW_ERROR
+ {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR},
+ #else
+ {"OVERFLOW_ERROR", 20, 237},
+ #endif
+ #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
+ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
+ #else
+ {"PACKET_LENGTH_TOO_LONG", 20, 198},
+ #endif
+ #ifdef SSL_R_PARSE_TLSEXT
+ {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
+ #else
+ {"PARSE_TLSEXT", 20, 227},
+ #endif
+ #ifdef SSL_R_PATH_TOO_LONG
+ {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
+ #else
+ {"PATH_TOO_LONG", 20, 270},
+ #endif
+ #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
+ #else
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199},
+ #endif
+ #ifdef SSL_R_PEM_NAME_BAD_PREFIX
+ {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX},
+ #else
+ {"PEM_NAME_BAD_PREFIX", 20, 391},
+ #endif
+ #ifdef SSL_R_PEM_NAME_TOO_SHORT
+ {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT},
+ #else
+ {"PEM_NAME_TOO_SHORT", 20, 392},
+ #endif
+ #ifdef SSL_R_PIPELINE_FAILURE
+ {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE},
+ #else
+ {"PIPELINE_FAILURE", 20, 406},
+ #endif
+ #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR},
+ #else
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278},
+ #endif
+ #ifdef SSL_R_PRIVATE_KEY_MISMATCH
+ {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH},
+ #else
+ {"PRIVATE_KEY_MISMATCH", 20, 288},
+ #endif
+ #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
+ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
+ #else
+ {"PROTOCOL_IS_SHUTDOWN", 20, 207},
+ #endif
+ #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
+ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
+ #else
+ {"PSK_IDENTITY_NOT_FOUND", 20, 223},
+ #endif
+ #ifdef SSL_R_PSK_NO_CLIENT_CB
+ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
+ #else
+ {"PSK_NO_CLIENT_CB", 20, 224},
+ #endif
+ #ifdef SSL_R_PSK_NO_SERVER_CB
+ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
+ #else
+ {"PSK_NO_SERVER_CB", 20, 225},
+ #endif
+ #ifdef SSL_R_READ_BIO_NOT_SET
+ {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
+ #else
+ {"READ_BIO_NOT_SET", 20, 211},
+ #endif
+ #ifdef SSL_R_READ_TIMEOUT_EXPIRED
+ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
+ #else
+ {"READ_TIMEOUT_EXPIRED", 20, 312},
+ #endif
+ #ifdef SSL_R_RECORD_LENGTH_MISMATCH
+ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
+ #else
+ {"RECORD_LENGTH_MISMATCH", 20, 213},
+ #endif
+ #ifdef SSL_R_RECORD_TOO_SMALL
+ {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
+ #else
+ {"RECORD_TOO_SMALL", 20, 298},
+ #endif
+ #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
+ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG},
+ #else
+ {"RENEGOTIATE_EXT_TOO_LONG", 20, 335},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
+ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR},
+ #else
+ {"RENEGOTIATION_ENCODING_ERR", 20, 336},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_MISMATCH
+ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
+ #else
+ {"RENEGOTIATION_MISMATCH", 20, 337},
+ #endif
+ #ifdef SSL_R_REQUEST_PENDING
+ {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING},
+ #else
+ {"REQUEST_PENDING", 20, 285},
+ #endif
+ #ifdef SSL_R_REQUEST_SENT
+ {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT},
+ #else
+ {"REQUEST_SENT", 20, 286},
+ #endif
+ #ifdef SSL_R_REQUIRED_CIPHER_MISSING
+ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
+ #else
+ {"REQUIRED_CIPHER_MISSING", 20, 215},
+ #endif
+ #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING},
+ #else
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342},
+ #endif
+ #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
+ #else
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345},
+ #endif
+ #ifdef SSL_R_SCT_VERIFICATION_FAILED
+ {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED},
+ #else
+ {"SCT_VERIFICATION_FAILED", 20, 208},
+ #endif
+ #ifdef SSL_R_SERVERHELLO_TLSEXT
+ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
+ #else
+ {"SERVERHELLO_TLSEXT", 20, 275},
+ #endif
+ #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
+ #else
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277},
+ #endif
+ #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT
+ {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT},
+ #else
+ {"SHUTDOWN_WHILE_IN_INIT", 20, 407},
+ #endif
+ #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR
+ {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR},
+ #else
+ {"SIGNATURE_ALGORITHMS_ERROR", 20, 360},
+ #endif
+ #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
+ #else
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220},
+ #endif
+ #ifdef SSL_R_SRP_A_CALC
+ {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC},
+ #else
+ {"SRP_A_CALC", 20, 361},
+ #endif
+ #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES},
+ #else
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362},
+ #endif
+ #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG},
+ #else
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363},
+ #endif
+ #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE},
+ #else
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH},
+ #else
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
+ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME", 20, 319},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320},
+ #endif
+ #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
+ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL3_SESSION_ID_TOO_LONG", 20, 300},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
+ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
+ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
+ #else
+ {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
+ #else
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
+ #else
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
+ #else
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
+ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
+ #else
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 20, 117},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125},
+ #endif
+ #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
+ #else
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228},
+ #endif
+ #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
+ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
+ #else
+ {"SSL_HANDSHAKE_FAILURE", 20, 229},
+ #endif
+ #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230},
+ #endif
+ #ifdef SSL_R_SSL_NEGATIVE_LENGTH
+ {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH},
+ #else
+ {"SSL_NEGATIVE_LENGTH", 20, 372},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 20, 126},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 20, 136},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
+ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
+ #else
+ {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
+ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
+ #else
+ {"SSL_SESSION_ID_CONFLICT", 20, 302},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
+ #else
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG
+ {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_TOO_LONG", 20, 408},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH
+ {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH},
+ #else
+ {"SSL_SESSION_VERSION_MISMATCH", 20, 210},
+ #endif
+ #ifdef SSL_R_STILL_IN_INIT
+ {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT},
+ #else
+ {"STILL_IN_INIT", 20, 121},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED},
+ #else
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION
+ {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION},
+ #else
+ {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
+ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED},
+ #else
+ {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
+ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR},
+ #else
+ {"TLSV1_ALERT_DECODE_ERROR", 20, 1050},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
+ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
+ #else
+ {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
+ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
+ #else
+ {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
+ #else
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK},
+ #else
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
+ #else
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
+ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
+ #else
+ {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
+ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
+ #else
+ {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
+ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
+ #else
+ {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
+ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
+ #else
+ {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
+ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
+ #else
+ {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
+ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED},
+ #else
+ {"TLSV1_ALERT_USER_CANCELLED", 20, 1090},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113},
+ #endif
+ #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
+ #else
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111},
+ #endif
+ #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
+ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
+ #else
+ {"TLSV1_UNRECOGNIZED_NAME", 20, 1112},
+ #endif
+ #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
+ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
+ #else
+ {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110},
+ #endif
+ #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL
+ {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL},
+ #else
+ {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367},
+ #endif
+ #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
+ #else
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157},
+ #endif
+ #ifdef SSL_R_TOO_MANY_KEY_UPDATES
+ {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES},
+ #else
+ {"TOO_MANY_KEY_UPDATES", 20, 132},
+ #endif
+ #ifdef SSL_R_TOO_MANY_WARN_ALERTS
+ {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS},
+ #else
+ {"TOO_MANY_WARN_ALERTS", 20, 409},
+ #endif
+ #ifdef SSL_R_TOO_MUCH_EARLY_DATA
+ {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA},
+ #else
+ {"TOO_MUCH_EARLY_DATA", 20, 164},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE
+ {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE},
+ #else
+ {"UNEXPECTED_CCS_MESSAGE", 20, 262},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA
+ {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA},
+ #else
+ {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_EOF_WHILE_READING
+ {"UNEXPECTED_EOF_WHILE_READING", ERR_LIB_SSL, SSL_R_UNEXPECTED_EOF_WHILE_READING},
+ #else
+ {"UNEXPECTED_EOF_WHILE_READING", 20, 294},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_MESSAGE
+ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
+ #else
+ {"UNEXPECTED_MESSAGE", 20, 244},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_RECORD
+ {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
+ #else
+ {"UNEXPECTED_RECORD", 20, 245},
+ #endif
+ #ifdef SSL_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 20, 276},
+ #endif
+ #ifdef SSL_R_UNKNOWN_ALERT_TYPE
+ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
+ #else
+ {"UNKNOWN_ALERT_TYPE", 20, 246},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
+ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE},
+ #else
+ {"UNKNOWN_CERTIFICATE_TYPE", 20, 247},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
+ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
+ #else
+ {"UNKNOWN_CIPHER_RETURNED", 20, 248},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
+ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
+ #else
+ {"UNKNOWN_CIPHER_TYPE", 20, 249},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CMD_NAME
+ {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME},
+ #else
+ {"UNKNOWN_CMD_NAME", 20, 386},
+ #endif
+ #ifdef SSL_R_UNKNOWN_COMMAND
+ {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND},
+ #else
+ {"UNKNOWN_COMMAND", 20, 139},
+ #endif
+ #ifdef SSL_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 20, 368},
+ #endif
+ #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
+ #else
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PKEY_TYPE
+ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
+ #else
+ {"UNKNOWN_PKEY_TYPE", 20, 251},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PROTOCOL
+ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
+ #else
+ {"UNKNOWN_PROTOCOL", 20, 252},
+ #endif
+ #ifdef SSL_R_UNKNOWN_SSL_VERSION
+ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
+ #else
+ {"UNKNOWN_SSL_VERSION", 20, 254},
+ #endif
+ #ifdef SSL_R_UNKNOWN_STATE
+ {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
+ #else
+ {"UNKNOWN_STATE", 20, 255},
+ #endif
+ #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
+ #else
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338},
+ #endif
+ #ifdef SSL_R_UNSOLICITED_EXTENSION
+ {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION},
+ #else
+ {"UNSOLICITED_EXTENSION", 20, 217},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
+ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
+ #else
+ {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_PROTOCOL
+ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
+ #else
+ {"UNSUPPORTED_PROTOCOL", 20, 258},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
+ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
+ #else
+ {"UNSUPPORTED_SSL_VERSION", 20, 259},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
+ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
+ #else
+ {"UNSUPPORTED_STATUS_TYPE", 20, 329},
+ #endif
+ #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED
+ {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED},
+ #else
+ {"USE_SRTP_NOT_NEGOTIATED", 20, 369},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_HIGH
+ {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH},
+ #else
+ {"VERSION_TOO_HIGH", 20, 166},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_LOW
+ {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW},
+ #else
+ {"VERSION_TOO_LOW", 20, 396},
+ #endif
+ #ifdef SSL_R_WRONG_CERTIFICATE_TYPE
+ {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE},
+ #else
+ {"WRONG_CERTIFICATE_TYPE", 20, 383},
+ #endif
+ #ifdef SSL_R_WRONG_CIPHER_RETURNED
+ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
+ #else
+ {"WRONG_CIPHER_RETURNED", 20, 261},
+ #endif
+ #ifdef SSL_R_WRONG_CURVE
+ {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE},
+ #else
+ {"WRONG_CURVE", 20, 378},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 20, 264},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_SIZE
+ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
+ #else
+ {"WRONG_SIGNATURE_SIZE", 20, 265},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_TYPE
+ {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE},
+ #else
+ {"WRONG_SIGNATURE_TYPE", 20, 370},
+ #endif
+ #ifdef SSL_R_WRONG_SSL_VERSION
+ {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
+ #else
+ {"WRONG_SSL_VERSION", 20, 266},
+ #endif
+ #ifdef SSL_R_WRONG_VERSION_NUMBER
+ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
+ #else
+ {"WRONG_VERSION_NUMBER", 20, 267},
+ #endif
+ #ifdef SSL_R_X509_LIB
+ {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
+ #else
+ {"X509_LIB", 20, 268},
+ #endif
+ #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
+ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
+ #else
+ {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269},
+ #endif
+ #ifdef TS_R_BAD_PKCS7_TYPE
+ {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE},
+ #else
+ {"BAD_PKCS7_TYPE", 47, 132},
+ #endif
+ #ifdef TS_R_BAD_TYPE
+ {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE},
+ #else
+ {"BAD_TYPE", 47, 133},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_CERT
+ {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT},
+ #else
+ {"CANNOT_LOAD_CERT", 47, 137},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_KEY
+ {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY},
+ #else
+ {"CANNOT_LOAD_KEY", 47, 138},
+ #endif
+ #ifdef TS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 47, 100},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_ENGINE
+ {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE},
+ #else
+ {"COULD_NOT_SET_ENGINE", 47, 127},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_TIME
+ {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME},
+ #else
+ {"COULD_NOT_SET_TIME", 47, 115},
+ #endif
+ #ifdef TS_R_DETACHED_CONTENT
+ {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT},
+ #else
+ {"DETACHED_CONTENT", 47, 134},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR
+ {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139},
+ #endif
+ #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR
+ {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+ #else
+ {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101},
+ #endif
+ #ifdef TS_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 47, 102},
+ #endif
+ #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE},
+ #else
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117},
+ #endif
+ #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH
+ {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH},
+ #else
+ {"MESSAGE_IMPRINT_MISMATCH", 47, 103},
+ #endif
+ #ifdef TS_R_NONCE_MISMATCH
+ {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH},
+ #else
+ {"NONCE_MISMATCH", 47, 104},
+ #endif
+ #ifdef TS_R_NONCE_NOT_RETURNED
+ {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED},
+ #else
+ {"NONCE_NOT_RETURNED", 47, 105},
+ #endif
+ #ifdef TS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 47, 106},
+ #endif
+ #ifdef TS_R_NO_TIME_STAMP_TOKEN
+ {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN},
+ #else
+ {"NO_TIME_STAMP_TOKEN", 47, 107},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119},
+ #endif
+ #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED
+ {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED},
+ #else
+ {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129},
+ #endif
+ #ifdef TS_R_POLICY_MISMATCH
+ {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH},
+ #else
+ {"POLICY_MISMATCH", 47, 108},
+ #endif
+ #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120},
+ #endif
+ #ifdef TS_R_RESPONSE_SETUP_ERROR
+ {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR},
+ #else
+ {"RESPONSE_SETUP_ERROR", 47, 121},
+ #endif
+ #ifdef TS_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 47, 109},
+ #endif
+ #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER
+ {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER},
+ #else
+ {"THERE_MUST_BE_ONE_SIGNER", 47, 110},
+ #endif
+ #ifdef TS_R_TIME_SYSCALL_ERROR
+ {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR},
+ #else
+ {"TIME_SYSCALL_ERROR", 47, 122},
+ #endif
+ #ifdef TS_R_TOKEN_NOT_PRESENT
+ {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT},
+ #else
+ {"TOKEN_NOT_PRESENT", 47, 130},
+ #endif
+ #ifdef TS_R_TOKEN_PRESENT
+ {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT},
+ #else
+ {"TOKEN_PRESENT", 47, 131},
+ #endif
+ #ifdef TS_R_TSA_NAME_MISMATCH
+ {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH},
+ #else
+ {"TSA_NAME_MISMATCH", 47, 111},
+ #endif
+ #ifdef TS_R_TSA_UNTRUSTED
+ {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED},
+ #else
+ {"TSA_UNTRUSTED", 47, 112},
+ #endif
+ #ifdef TS_R_TST_INFO_SETUP_ERROR
+ {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR},
+ #else
+ {"TST_INFO_SETUP_ERROR", 47, 123},
+ #endif
+ #ifdef TS_R_TS_DATASIGN
+ {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN},
+ #else
+ {"TS_DATASIGN", 47, 124},
+ #endif
+ #ifdef TS_R_UNACCEPTABLE_POLICY
+ {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY},
+ #else
+ {"UNACCEPTABLE_POLICY", 47, 125},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM
+ {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MD_ALGORITHM", 47, 126},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 47, 113},
+ #endif
+ #ifdef TS_R_VAR_BAD_VALUE
+ {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE},
+ #else
+ {"VAR_BAD_VALUE", 47, 135},
+ #endif
+ #ifdef TS_R_VAR_LOOKUP_FAILURE
+ {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE},
+ #else
+ {"VAR_LOOKUP_FAILURE", 47, 136},
+ #endif
+ #ifdef TS_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 47, 114},
+ #endif
+ #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS},
+ #else
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104},
+ #endif
+ #ifdef UI_R_INDEX_TOO_LARGE
+ {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE},
+ #else
+ {"INDEX_TOO_LARGE", 40, 102},
+ #endif
+ #ifdef UI_R_INDEX_TOO_SMALL
+ {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL},
+ #else
+ {"INDEX_TOO_SMALL", 40, 103},
+ #endif
+ #ifdef UI_R_NO_RESULT_BUFFER
+ {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER},
+ #else
+ {"NO_RESULT_BUFFER", 40, 105},
+ #endif
+ #ifdef UI_R_PROCESSING_ERROR
+ {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR},
+ #else
+ {"PROCESSING_ERROR", 40, 107},
+ #endif
+ #ifdef UI_R_RESULT_TOO_LARGE
+ {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE},
+ #else
+ {"RESULT_TOO_LARGE", 40, 100},
+ #endif
+ #ifdef UI_R_RESULT_TOO_SMALL
+ {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL},
+ #else
+ {"RESULT_TOO_SMALL", 40, 101},
+ #endif
+ #ifdef UI_R_SYSASSIGN_ERROR
+ {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR},
+ #else
+ {"SYSASSIGN_ERROR", 40, 109},
+ #endif
+ #ifdef UI_R_SYSDASSGN_ERROR
+ {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR},
+ #else
+ {"SYSDASSGN_ERROR", 40, 110},
+ #endif
+ #ifdef UI_R_SYSQIOW_ERROR
+ {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR},
+ #else
+ {"SYSQIOW_ERROR", 40, 111},
+ #endif
+ #ifdef UI_R_UNKNOWN_CONTROL_COMMAND
+ {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND},
+ #else
+ {"UNKNOWN_CONTROL_COMMAND", 40, 106},
+ #endif
+ #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE},
+ #else
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108},
+ #endif
+ #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED},
+ #else
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112},
+ #endif
+ #ifdef X509V3_R_BAD_IP_ADDRESS
+ {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS},
+ #else
+ {"BAD_IP_ADDRESS", 34, 118},
+ #endif
+ #ifdef X509V3_R_BAD_OBJECT
+ {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT},
+ #else
+ {"BAD_OBJECT", 34, 119},
+ #endif
+ #ifdef X509V3_R_BN_DEC2BN_ERROR
+ {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR},
+ #else
+ {"BN_DEC2BN_ERROR", 34, 100},
+ #endif
+ #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR
+ {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR},
+ #else
+ {"BN_TO_ASN1_INTEGER_ERROR", 34, 101},
+ #endif
+ #ifdef X509V3_R_DIRNAME_ERROR
+ {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR},
+ #else
+ {"DIRNAME_ERROR", 34, 149},
+ #endif
+ #ifdef X509V3_R_DISTPOINT_ALREADY_SET
+ {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET},
+ #else
+ {"DISTPOINT_ALREADY_SET", 34, 160},
+ #endif
+ #ifdef X509V3_R_DUPLICATE_ZONE_ID
+ {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID},
+ #else
+ {"DUPLICATE_ZONE_ID", 34, 133},
+ #endif
+ #ifdef X509V3_R_EMPTY_KEY_USAGE
+ {"EMPTY_KEY_USAGE", ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE},
+ #else
+ {"EMPTY_KEY_USAGE", 34, 169},
+ #endif
+ #ifdef X509V3_R_ERROR_CONVERTING_ZONE
+ {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE},
+ #else
+ {"ERROR_CONVERTING_ZONE", 34, 131},
+ #endif
+ #ifdef X509V3_R_ERROR_CREATING_EXTENSION
+ {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION},
+ #else
+ {"ERROR_CREATING_EXTENSION", 34, 144},
+ #endif
+ #ifdef X509V3_R_ERROR_IN_EXTENSION
+ {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION},
+ #else
+ {"ERROR_IN_EXTENSION", 34, 128},
+ #endif
+ #ifdef X509V3_R_EXPECTED_A_SECTION_NAME
+ {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME},
+ #else
+ {"EXPECTED_A_SECTION_NAME", 34, 137},
+ #endif
+ #ifdef X509V3_R_EXTENSION_EXISTS
+ {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS},
+ #else
+ {"EXTENSION_EXISTS", 34, 145},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NAME_ERROR
+ {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR},
+ #else
+ {"EXTENSION_NAME_ERROR", 34, 115},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NOT_FOUND
+ {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND},
+ #else
+ {"EXTENSION_NOT_FOUND", 34, 102},
+ #endif
+ #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
+ {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED},
+ #else
+ {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103},
+ #endif
+ #ifdef X509V3_R_EXTENSION_VALUE_ERROR
+ {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR},
+ #else
+ {"EXTENSION_VALUE_ERROR", 34, 116},
+ #endif
+ #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION
+ {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION},
+ #else
+ {"ILLEGAL_EMPTY_EXTENSION", 34, 151},
+ #endif
+ #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG
+ {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG},
+ #else
+ {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152},
+ #endif
+ #ifdef X509V3_R_INVALID_ASNUMBER
+ {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER},
+ #else
+ {"INVALID_ASNUMBER", 34, 162},
+ #endif
+ #ifdef X509V3_R_INVALID_ASRANGE
+ {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE},
+ #else
+ {"INVALID_ASRANGE", 34, 163},
+ #endif
+ #ifdef X509V3_R_INVALID_BOOLEAN_STRING
+ {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING},
+ #else
+ {"INVALID_BOOLEAN_STRING", 34, 104},
+ #endif
+ #ifdef X509V3_R_INVALID_CERTIFICATE
+ {"INVALID_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE},
+ #else
+ {"INVALID_CERTIFICATE", 34, 158},
+ #endif
+ #ifdef X509V3_R_INVALID_EMPTY_NAME
+ {"INVALID_EMPTY_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_EMPTY_NAME},
+ #else
+ {"INVALID_EMPTY_NAME", 34, 108},
+ #endif
+ #ifdef X509V3_R_INVALID_EXTENSION_STRING
+ {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING},
+ #else
+ {"INVALID_EXTENSION_STRING", 34, 105},
+ #endif
+ #ifdef X509V3_R_INVALID_INHERITANCE
+ {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE},
+ #else
+ {"INVALID_INHERITANCE", 34, 165},
+ #endif
+ #ifdef X509V3_R_INVALID_IPADDRESS
+ {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS},
+ #else
+ {"INVALID_IPADDRESS", 34, 166},
+ #endif
+ #ifdef X509V3_R_INVALID_MULTIPLE_RDNS
+ {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS},
+ #else
+ {"INVALID_MULTIPLE_RDNS", 34, 161},
+ #endif
+ #ifdef X509V3_R_INVALID_NAME
+ {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME},
+ #else
+ {"INVALID_NAME", 34, 106},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 34, 107},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_VALUE
+ {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE},
+ #else
+ {"INVALID_NULL_VALUE", 34, 109},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 34, 140},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBERS
+ {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS},
+ #else
+ {"INVALID_NUMBERS", 34, 141},
+ #endif
+ #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER
+ {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER},
+ #else
+ {"INVALID_OBJECT_IDENTIFIER", 34, 110},
+ #endif
+ #ifdef X509V3_R_INVALID_OPTION
+ {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION},
+ #else
+ {"INVALID_OPTION", 34, 138},
+ #endif
+ #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER
+ {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER},
+ #else
+ {"INVALID_POLICY_IDENTIFIER", 34, 134},
+ #endif
+ #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING
+ {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING},
+ #else
+ {"INVALID_PROXY_POLICY_SETTING", 34, 153},
+ #endif
+ #ifdef X509V3_R_INVALID_PURPOSE
+ {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE},
+ #else
+ {"INVALID_PURPOSE", 34, 146},
+ #endif
+ #ifdef X509V3_R_INVALID_SAFI
+ {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI},
+ #else
+ {"INVALID_SAFI", 34, 164},
+ #endif
+ #ifdef X509V3_R_INVALID_SECTION
+ {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION},
+ #else
+ {"INVALID_SECTION", 34, 135},
+ #endif
+ #ifdef X509V3_R_INVALID_SYNTAX
+ {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX},
+ #else
+ {"INVALID_SYNTAX", 34, 143},
+ #endif
+ #ifdef X509V3_R_ISSUER_DECODE_ERROR
+ {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR},
+ #else
+ {"ISSUER_DECODE_ERROR", 34, 126},
+ #endif
+ #ifdef X509V3_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 34, 124},
+ #endif
+ #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS
+ {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS},
+ #else
+ {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142},
+ #endif
+ #ifdef X509V3_R_NEGATIVE_PATHLEN
+ {"NEGATIVE_PATHLEN", ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN},
+ #else
+ {"NEGATIVE_PATHLEN", 34, 168},
+ #endif
+ #ifdef X509V3_R_NO_CONFIG_DATABASE
+ {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE},
+ #else
+ {"NO_CONFIG_DATABASE", 34, 136},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_CERTIFICATE
+ {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE},
+ #else
+ {"NO_ISSUER_CERTIFICATE", 34, 121},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_DETAILS
+ {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS},
+ #else
+ {"NO_ISSUER_DETAILS", 34, 127},
+ #endif
+ #ifdef X509V3_R_NO_POLICY_IDENTIFIER
+ {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER},
+ #else
+ {"NO_POLICY_IDENTIFIER", 34, 139},
+ #endif
+ #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED},
+ #else
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154},
+ #endif
+ #ifdef X509V3_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 34, 114},
+ #endif
+ #ifdef X509V3_R_NO_SUBJECT_DETAILS
+ {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS},
+ #else
+ {"NO_SUBJECT_DETAILS", 34, 125},
+ #endif
+ #ifdef X509V3_R_OPERATION_NOT_DEFINED
+ {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED},
+ #else
+ {"OPERATION_NOT_DEFINED", 34, 148},
+ #endif
+ #ifdef X509V3_R_OTHERNAME_ERROR
+ {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR},
+ #else
+ {"OTHERNAME_ERROR", 34, 147},
+ #endif
+ #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED},
+ #else
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH
+ {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH},
+ #else
+ {"POLICY_PATH_LENGTH", 34, 156},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED},
+ #else
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157},
+ #endif
+ #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY},
+ #else
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159},
+ #endif
+ #ifdef X509V3_R_SECTION_NOT_FOUND
+ {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND},
+ #else
+ {"SECTION_NOT_FOUND", 34, 150},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS
+ {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS},
+ #else
+ {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID
+ {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID},
+ #else
+ {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT
+ {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT},
+ #else
+ {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION
+ {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION},
+ #else
+ {"UNKNOWN_EXTENSION", 34, 129},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME
+ {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME},
+ #else
+ {"UNKNOWN_EXTENSION_NAME", 34, 130},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 34, 120},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_OPTION
+ {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION},
+ #else
+ {"UNSUPPORTED_OPTION", 34, 117},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 34, 167},
+ #endif
+ #ifdef X509V3_R_USER_TOO_LONG
+ {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG},
+ #else
+ {"USER_TOO_LONG", 34, 132},
+ #endif
+ #ifdef X509_R_AKID_MISMATCH
+ {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH},
+ #else
+ {"AKID_MISMATCH", 11, 110},
+ #endif
+ #ifdef X509_R_BAD_SELECTOR
+ {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR},
+ #else
+ {"BAD_SELECTOR", 11, 133},
+ #endif
+ #ifdef X509_R_BAD_X509_FILETYPE
+ {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
+ #else
+ {"BAD_X509_FILETYPE", 11, 100},
+ #endif
+ #ifdef X509_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 11, 118},
+ #endif
+ #ifdef X509_R_CANT_CHECK_DH_KEY
+ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
+ #else
+ {"CANT_CHECK_DH_KEY", 11, 114},
+ #endif
+ #ifdef X509_R_CERTIFICATE_VERIFICATION_FAILED
+ {"CERTIFICATE_VERIFICATION_FAILED", ERR_LIB_X509, X509_R_CERTIFICATE_VERIFICATION_FAILED},
+ #else
+ {"CERTIFICATE_VERIFICATION_FAILED", 11, 139},
+ #endif
+ #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
+ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE},
+ #else
+ {"CERT_ALREADY_IN_HASH_TABLE", 11, 101},
+ #endif
+ #ifdef X509_R_CRL_ALREADY_DELTA
+ {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA},
+ #else
+ {"CRL_ALREADY_DELTA", 11, 127},
+ #endif
+ #ifdef X509_R_CRL_VERIFY_FAILURE
+ {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE},
+ #else
+ {"CRL_VERIFY_FAILURE", 11, 131},
+ #endif
+ #ifdef X509_R_ERROR_GETTING_MD_BY_NID
+ {"ERROR_GETTING_MD_BY_NID", ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID},
+ #else
+ {"ERROR_GETTING_MD_BY_NID", 11, 141},
+ #endif
+ #ifdef X509_R_ERROR_USING_SIGINF_SET
+ {"ERROR_USING_SIGINF_SET", ERR_LIB_X509, X509_R_ERROR_USING_SIGINF_SET},
+ #else
+ {"ERROR_USING_SIGINF_SET", 11, 142},
+ #endif
+ #ifdef X509_R_IDP_MISMATCH
+ {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH},
+ #else
+ {"IDP_MISMATCH", 11, 128},
+ #endif
+ #ifdef X509_R_INVALID_ATTRIBUTES
+ {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES},
+ #else
+ {"INVALID_ATTRIBUTES", 11, 138},
+ #endif
+ #ifdef X509_R_INVALID_DIRECTORY
+ {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
+ #else
+ {"INVALID_DIRECTORY", 11, 113},
+ #endif
+ #ifdef X509_R_INVALID_DISTPOINT
+ {"INVALID_DISTPOINT", ERR_LIB_X509, X509_R_INVALID_DISTPOINT},
+ #else
+ {"INVALID_DISTPOINT", 11, 143},
+ #endif
+ #ifdef X509_R_INVALID_FIELD_NAME
+ {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
+ #else
+ {"INVALID_FIELD_NAME", 11, 119},
+ #endif
+ #ifdef X509_R_INVALID_TRUST
+ {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
+ #else
+ {"INVALID_TRUST", 11, 123},
+ #endif
+ #ifdef X509_R_ISSUER_MISMATCH
+ {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH},
+ #else
+ {"ISSUER_MISMATCH", 11, 129},
+ #endif
+ #ifdef X509_R_KEY_TYPE_MISMATCH
+ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
+ #else
+ {"KEY_TYPE_MISMATCH", 11, 115},
+ #endif
+ #ifdef X509_R_KEY_VALUES_MISMATCH
+ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
+ #else
+ {"KEY_VALUES_MISMATCH", 11, 116},
+ #endif
+ #ifdef X509_R_LOADING_CERT_DIR
+ {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
+ #else
+ {"LOADING_CERT_DIR", 11, 103},
+ #endif
+ #ifdef X509_R_LOADING_DEFAULTS
+ {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
+ #else
+ {"LOADING_DEFAULTS", 11, 104},
+ #endif
+ #ifdef X509_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 11, 124},
+ #endif
+ #ifdef X509_R_NAME_TOO_LONG
+ {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG},
+ #else
+ {"NAME_TOO_LONG", 11, 134},
+ #endif
+ #ifdef X509_R_NEWER_CRL_NOT_NEWER
+ {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER},
+ #else
+ {"NEWER_CRL_NOT_NEWER", 11, 132},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_FOUND
+ {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND},
+ #else
+ {"NO_CERTIFICATE_FOUND", 11, 135},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND
+ {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND},
+ #else
+ {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136},
+ #endif
+ #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
+ #else
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105},
+ #endif
+ #ifdef X509_R_NO_CRL_FOUND
+ {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND},
+ #else
+ {"NO_CRL_FOUND", 11, 137},
+ #endif
+ #ifdef X509_R_NO_CRL_NUMBER
+ {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER},
+ #else
+ {"NO_CRL_NUMBER", 11, 130},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
+ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR},
+ #else
+ {"PUBLIC_KEY_DECODE_ERROR", 11, 125},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
+ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR},
+ #else
+ {"PUBLIC_KEY_ENCODE_ERROR", 11, 126},
+ #endif
+ #ifdef X509_R_SHOULD_RETRY
+ {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
+ #else
+ {"SHOULD_RETRY", 11, 106},
+ #endif
+ #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
+ #else
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107},
+ #endif
+ #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
+ #else
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108},
+ #endif
+ #ifdef X509_R_UNKNOWN_KEY_TYPE
+ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
+ #else
+ {"UNKNOWN_KEY_TYPE", 11, 117},
+ #endif
+ #ifdef X509_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 11, 109},
+ #endif
+ #ifdef X509_R_UNKNOWN_PURPOSE_ID
+ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
+ #else
+ {"UNKNOWN_PURPOSE_ID", 11, 121},
+ #endif
+ #ifdef X509_R_UNKNOWN_SIGID_ALGS
+ {"UNKNOWN_SIGID_ALGS", ERR_LIB_X509, X509_R_UNKNOWN_SIGID_ALGS},
+ #else
+ {"UNKNOWN_SIGID_ALGS", 11, 144},
+ #endif
+ #ifdef X509_R_UNKNOWN_TRUST_ID
+ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
+ #else
+ {"UNKNOWN_TRUST_ID", 11, 120},
+ #endif
+ #ifdef X509_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 11, 111},
+ #endif
+ #ifdef X509_R_WRONG_LOOKUP_TYPE
+ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
+ #else
+ {"WRONG_LOOKUP_TYPE", 11, 112},
+ #endif
+ #ifdef X509_R_WRONG_TYPE
+ {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
+ #else
+ {"WRONG_TYPE", 11, 122},
+ #endif
+ { NULL }
+};
+
diff --git a/contrib/tools/python3/Modules/_ssl_data_31.h b/contrib/tools/python3/Modules/_ssl_data_31.h
new file mode 100644
index 00000000000..c589c501f4e
--- /dev/null
+++ b/contrib/tools/python3/Modules/_ssl_data_31.h
@@ -0,0 +1,8605 @@
+/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2023-06-01T03:04:00.275280 */
+static struct py_ssl_library_code library_codes[] = {
+#ifdef ERR_LIB_ASN1
+ {"ASN1", ERR_LIB_ASN1},
+#endif
+#ifdef ERR_LIB_ASYNC
+ {"ASYNC", ERR_LIB_ASYNC},
+#endif
+#ifdef ERR_LIB_BIO
+ {"BIO", ERR_LIB_BIO},
+#endif
+#ifdef ERR_LIB_BN
+ {"BN", ERR_LIB_BN},
+#endif
+#ifdef ERR_LIB_BUF
+ {"BUF", ERR_LIB_BUF},
+#endif
+#ifdef ERR_LIB_CMP
+ {"CMP", ERR_LIB_CMP},
+#endif
+#ifdef ERR_LIB_CMS
+ {"CMS", ERR_LIB_CMS},
+#endif
+#ifdef ERR_LIB_COMP
+ {"COMP", ERR_LIB_COMP},
+#endif
+#ifdef ERR_LIB_CONF
+ {"CONF", ERR_LIB_CONF},
+#endif
+#ifdef ERR_LIB_CRMF
+ {"CRMF", ERR_LIB_CRMF},
+#endif
+#ifdef ERR_LIB_CRYPTO
+ {"CRYPTO", ERR_LIB_CRYPTO},
+#endif
+#ifdef ERR_LIB_CT
+ {"CT", ERR_LIB_CT},
+#endif
+#ifdef ERR_LIB_DH
+ {"DH", ERR_LIB_DH},
+#endif
+#ifdef ERR_LIB_DSA
+ {"DSA", ERR_LIB_DSA},
+#endif
+#ifdef ERR_LIB_DSO
+ {"DSO", ERR_LIB_DSO},
+#endif
+#ifdef ERR_LIB_EC
+ {"EC", ERR_LIB_EC},
+#endif
+#ifdef ERR_LIB_ECDH
+ {"ECDH", ERR_LIB_ECDH},
+#endif
+#ifdef ERR_LIB_ECDSA
+ {"ECDSA", ERR_LIB_ECDSA},
+#endif
+#ifdef ERR_LIB_ENGINE
+ {"ENGINE", ERR_LIB_ENGINE},
+#endif
+#ifdef ERR_LIB_ESS
+ {"ESS", ERR_LIB_ESS},
+#endif
+#ifdef ERR_LIB_EVP
+ {"EVP", ERR_LIB_EVP},
+#endif
+#ifdef ERR_LIB_FIPS
+ {"FIPS", ERR_LIB_FIPS},
+#endif
+#ifdef ERR_LIB_HMAC
+ {"HMAC", ERR_LIB_HMAC},
+#endif
+#ifdef ERR_LIB_HTTP
+ {"HTTP", ERR_LIB_HTTP},
+#endif
+#ifdef ERR_LIB_JPAKE
+ {"JPAKE", ERR_LIB_JPAKE},
+#endif
+#ifdef ERR_LIB_KDF
+ {"KDF", ERR_LIB_KDF},
+#endif
+#ifdef ERR_LIB_MASK
+ {"MASK", ERR_LIB_MASK},
+#endif
+#ifdef ERR_LIB_METH
+ {"METH", ERR_LIB_METH},
+#endif
+#ifdef ERR_LIB_NONE
+ {"NONE", ERR_LIB_NONE},
+#endif
+#ifdef ERR_LIB_OBJ
+ {"OBJ", ERR_LIB_OBJ},
+#endif
+#ifdef ERR_LIB_OCSP
+ {"OCSP", ERR_LIB_OCSP},
+#endif
+#ifdef ERR_LIB_OFFSET
+ {"OFFSET", ERR_LIB_OFFSET},
+#endif
+#ifdef ERR_LIB_OSSL_DECODER
+ {"OSSL_DECODER", ERR_LIB_OSSL_DECODER},
+#endif
+#ifdef ERR_LIB_OSSL_ENCODER
+ {"OSSL_ENCODER", ERR_LIB_OSSL_ENCODER},
+#endif
+#ifdef ERR_LIB_OSSL_STORE
+ {"OSSL_STORE", ERR_LIB_OSSL_STORE},
+#endif
+#ifdef ERR_LIB_PEM
+ {"PEM", ERR_LIB_PEM},
+#endif
+#ifdef ERR_LIB_PKCS12
+ {"PKCS12", ERR_LIB_PKCS12},
+#endif
+#ifdef ERR_LIB_PKCS7
+ {"PKCS7", ERR_LIB_PKCS7},
+#endif
+#ifdef ERR_LIB_PROP
+ {"PROP", ERR_LIB_PROP},
+#endif
+#ifdef ERR_LIB_PROV
+ {"PROV", ERR_LIB_PROV},
+#endif
+#ifdef ERR_LIB_PROXY
+ {"PROXY", ERR_LIB_PROXY},
+#endif
+#ifdef ERR_LIB_RAND
+ {"RAND", ERR_LIB_RAND},
+#endif
+#ifdef ERR_LIB_RSA
+ {"RSA", ERR_LIB_RSA},
+#endif
+#ifdef ERR_LIB_RSAREF
+ {"RSAREF", ERR_LIB_RSAREF},
+#endif
+#ifdef ERR_LIB_SM2
+ {"SM2", ERR_LIB_SM2},
+#endif
+#ifdef ERR_LIB_SSL
+ {"SSL", ERR_LIB_SSL},
+#endif
+#ifdef ERR_LIB_SSL2
+ {"SSL2", ERR_LIB_SSL2},
+#endif
+#ifdef ERR_LIB_SSL23
+ {"SSL23", ERR_LIB_SSL23},
+#endif
+#ifdef ERR_LIB_SSL3
+ {"SSL3", ERR_LIB_SSL3},
+#endif
+#ifdef ERR_LIB_SYS
+ {"SYS", ERR_LIB_SYS},
+#endif
+#ifdef ERR_LIB_TS
+ {"TS", ERR_LIB_TS},
+#endif
+#ifdef ERR_LIB_UI
+ {"UI", ERR_LIB_UI},
+#endif
+#ifdef ERR_LIB_USER
+ {"USER", ERR_LIB_USER},
+#endif
+#ifdef ERR_LIB_X509
+ {"X509", ERR_LIB_X509},
+#endif
+#ifdef ERR_LIB_X509V3
+ {"X509V3", ERR_LIB_X509V3},
+#endif
+ { NULL }
+};
+
+
+static struct py_ssl_error_code error_codes[] = {
+ #ifdef ASN1_R_ADDING_OBJECT
+ {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
+ #else
+ {"ADDING_OBJECT", 13, 171},
+ #endif
+ #ifdef ASN1_R_ASN1_PARSE_ERROR
+ {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR},
+ #else
+ {"ASN1_PARSE_ERROR", 13, 203},
+ #endif
+ #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR
+ {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR},
+ #else
+ {"ASN1_SIG_PARSE_ERROR", 13, 204},
+ #endif
+ #ifdef ASN1_R_AUX_ERROR
+ {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR},
+ #else
+ {"AUX_ERROR", 13, 100},
+ #endif
+ #ifdef ASN1_R_BAD_OBJECT_HEADER
+ {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER},
+ #else
+ {"BAD_OBJECT_HEADER", 13, 102},
+ #endif
+ #ifdef ASN1_R_BAD_TEMPLATE
+ {"BAD_TEMPLATE", ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE},
+ #else
+ {"BAD_TEMPLATE", 13, 230},
+ #endif
+ #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH
+ {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH},
+ #else
+ {"BMPSTRING_IS_WRONG_LENGTH", 13, 214},
+ #endif
+ #ifdef ASN1_R_BN_LIB
+ {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB},
+ #else
+ {"BN_LIB", 13, 105},
+ #endif
+ #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH
+ {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH},
+ #else
+ {"BOOLEAN_IS_WRONG_LENGTH", 13, 106},
+ #endif
+ #ifdef ASN1_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 13, 107},
+ #endif
+ #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108},
+ #endif
+ #ifdef ASN1_R_CONTEXT_NOT_INITIALISED
+ {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED},
+ #else
+ {"CONTEXT_NOT_INITIALISED", 13, 217},
+ #endif
+ #ifdef ASN1_R_DATA_IS_WRONG
+ {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG},
+ #else
+ {"DATA_IS_WRONG", 13, 109},
+ #endif
+ #ifdef ASN1_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 13, 110},
+ #endif
+ #ifdef ASN1_R_DEPTH_EXCEEDED
+ {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED},
+ #else
+ {"DEPTH_EXCEEDED", 13, 174},
+ #endif
+ #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED},
+ #else
+ {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198},
+ #endif
+ #ifdef ASN1_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 13, 112},
+ #endif
+ #ifdef ASN1_R_ERROR_GETTING_TIME
+ {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME},
+ #else
+ {"ERROR_GETTING_TIME", 13, 173},
+ #endif
+ #ifdef ASN1_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 13, 172},
+ #endif
+ #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS
+ {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS},
+ #else
+ {"ERROR_SETTING_CIPHER_PARAMS", 13, 114},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_INTEGER
+ {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER},
+ #else
+ {"EXPECTING_AN_INTEGER", 13, 115},
+ #endif
+ #ifdef ASN1_R_EXPECTING_AN_OBJECT
+ {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT},
+ #else
+ {"EXPECTING_AN_OBJECT", 13, 116},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH
+ {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH},
+ #else
+ {"EXPLICIT_LENGTH_MISMATCH", 13, 119},
+ #endif
+ #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED},
+ #else
+ {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120},
+ #endif
+ #ifdef ASN1_R_FIELD_MISSING
+ {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING},
+ #else
+ {"FIELD_MISSING", 13, 121},
+ #endif
+ #ifdef ASN1_R_FIRST_NUM_TOO_LARGE
+ {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE},
+ #else
+ {"FIRST_NUM_TOO_LARGE", 13, 122},
+ #endif
+ #ifdef ASN1_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 13, 123},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT
+ {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT},
+ #else
+ {"ILLEGAL_BITSTRING_FORMAT", 13, 175},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_BOOLEAN
+ {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN},
+ #else
+ {"ILLEGAL_BOOLEAN", 13, 176},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_CHARACTERS
+ {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS},
+ #else
+ {"ILLEGAL_CHARACTERS", 13, 124},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_FORMAT
+ {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT},
+ #else
+ {"ILLEGAL_FORMAT", 13, 177},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_HEX
+ {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX},
+ #else
+ {"ILLEGAL_HEX", 13, 178},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG
+ {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG},
+ #else
+ {"ILLEGAL_IMPLICIT_TAG", 13, 179},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_INTEGER
+ {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER},
+ #else
+ {"ILLEGAL_INTEGER", 13, 180},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE
+ {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE},
+ #else
+ {"ILLEGAL_NEGATIVE_VALUE", 13, 226},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING
+ {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING},
+ #else
+ {"ILLEGAL_NESTED_TAGGING", 13, 181},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL
+ {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL},
+ #else
+ {"ILLEGAL_NULL", 13, 125},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_NULL_VALUE
+ {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE},
+ #else
+ {"ILLEGAL_NULL_VALUE", 13, 182},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OBJECT
+ {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT},
+ #else
+ {"ILLEGAL_OBJECT", 13, 183},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY
+ {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY},
+ #else
+ {"ILLEGAL_OPTIONAL_ANY", 13, 126},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE},
+ #else
+ {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_PADDING
+ {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING},
+ #else
+ {"ILLEGAL_PADDING", 13, 221},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TAGGED_ANY
+ {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY},
+ #else
+ {"ILLEGAL_TAGGED_ANY", 13, 127},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_TIME_VALUE
+ {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE},
+ #else
+ {"ILLEGAL_TIME_VALUE", 13, 184},
+ #endif
+ #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT
+ {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT},
+ #else
+ {"ILLEGAL_ZERO_CONTENT", 13, 222},
+ #endif
+ #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT
+ {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT},
+ #else
+ {"INTEGER_NOT_ASCII_FORMAT", 13, 185},
+ #endif
+ #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG
+ {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG},
+ #else
+ {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128},
+ #endif
+ #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT
+ {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT},
+ #else
+ {"INVALID_BIT_STRING_BITS_LEFT", 13, 220},
+ #endif
+ #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH
+ {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH},
+ #else
+ {"INVALID_BMPSTRING_LENGTH", 13, 129},
+ #endif
+ #ifdef ASN1_R_INVALID_DIGIT
+ {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT},
+ #else
+ {"INVALID_DIGIT", 13, 130},
+ #endif
+ #ifdef ASN1_R_INVALID_MIME_TYPE
+ {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE},
+ #else
+ {"INVALID_MIME_TYPE", 13, 205},
+ #endif
+ #ifdef ASN1_R_INVALID_MODIFIER
+ {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER},
+ #else
+ {"INVALID_MODIFIER", 13, 186},
+ #endif
+ #ifdef ASN1_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 13, 187},
+ #endif
+ #ifdef ASN1_R_INVALID_OBJECT_ENCODING
+ {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING},
+ #else
+ {"INVALID_OBJECT_ENCODING", 13, 216},
+ #endif
+ #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS
+ {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS},
+ #else
+ {"INVALID_SCRYPT_PARAMETERS", 13, 227},
+ #endif
+ #ifdef ASN1_R_INVALID_SEPARATOR
+ {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR},
+ #else
+ {"INVALID_SEPARATOR", 13, 131},
+ #endif
+ #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE
+ {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE},
+ #else
+ {"INVALID_STRING_TABLE_VALUE", 13, 218},
+ #endif
+ #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH
+ {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH},
+ #else
+ {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133},
+ #endif
+ #ifdef ASN1_R_INVALID_UTF8STRING
+ {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING},
+ #else
+ {"INVALID_UTF8STRING", 13, 134},
+ #endif
+ #ifdef ASN1_R_INVALID_VALUE
+ {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE},
+ #else
+ {"INVALID_VALUE", 13, 219},
+ #endif
+ #ifdef ASN1_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 13, 231},
+ #endif
+ #ifdef ASN1_R_LIST_ERROR
+ {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR},
+ #else
+ {"LIST_ERROR", 13, 188},
+ #endif
+ #ifdef ASN1_R_MIME_NO_CONTENT_TYPE
+ {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE},
+ #else
+ {"MIME_NO_CONTENT_TYPE", 13, 206},
+ #endif
+ #ifdef ASN1_R_MIME_PARSE_ERROR
+ {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR},
+ #else
+ {"MIME_PARSE_ERROR", 13, 207},
+ #endif
+ #ifdef ASN1_R_MIME_SIG_PARSE_ERROR
+ {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR},
+ #else
+ {"MIME_SIG_PARSE_ERROR", 13, 208},
+ #endif
+ #ifdef ASN1_R_MISSING_EOC
+ {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC},
+ #else
+ {"MISSING_EOC", 13, 137},
+ #endif
+ #ifdef ASN1_R_MISSING_SECOND_NUMBER
+ {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER},
+ #else
+ {"MISSING_SECOND_NUMBER", 13, 138},
+ #endif
+ #ifdef ASN1_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 13, 189},
+ #endif
+ #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL
+ {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL},
+ #else
+ {"MSTRING_NOT_UNIVERSAL", 13, 139},
+ #endif
+ #ifdef ASN1_R_MSTRING_WRONG_TAG
+ {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG},
+ #else
+ {"MSTRING_WRONG_TAG", 13, 140},
+ #endif
+ #ifdef ASN1_R_NESTED_ASN1_STRING
+ {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING},
+ #else
+ {"NESTED_ASN1_STRING", 13, 197},
+ #endif
+ #ifdef ASN1_R_NESTED_TOO_DEEP
+ {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP},
+ #else
+ {"NESTED_TOO_DEEP", 13, 201},
+ #endif
+ #ifdef ASN1_R_NON_HEX_CHARACTERS
+ {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS},
+ #else
+ {"NON_HEX_CHARACTERS", 13, 141},
+ #endif
+ #ifdef ASN1_R_NOT_ASCII_FORMAT
+ {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT},
+ #else
+ {"NOT_ASCII_FORMAT", 13, 190},
+ #endif
+ #ifdef ASN1_R_NOT_ENOUGH_DATA
+ {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA},
+ #else
+ {"NOT_ENOUGH_DATA", 13, 142},
+ #endif
+ #ifdef ASN1_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 13, 209},
+ #endif
+ #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE
+ {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE},
+ #else
+ {"NO_MATCHING_CHOICE_TYPE", 13, 143},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE
+ {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE},
+ #else
+ {"NO_MULTIPART_BODY_FAILURE", 13, 210},
+ #endif
+ #ifdef ASN1_R_NO_MULTIPART_BOUNDARY
+ {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY},
+ #else
+ {"NO_MULTIPART_BOUNDARY", 13, 211},
+ #endif
+ #ifdef ASN1_R_NO_SIG_CONTENT_TYPE
+ {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE},
+ #else
+ {"NO_SIG_CONTENT_TYPE", 13, 212},
+ #endif
+ #ifdef ASN1_R_NULL_IS_WRONG_LENGTH
+ {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH},
+ #else
+ {"NULL_IS_WRONG_LENGTH", 13, 144},
+ #endif
+ #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT
+ {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT},
+ #else
+ {"OBJECT_NOT_ASCII_FORMAT", 13, 191},
+ #endif
+ #ifdef ASN1_R_ODD_NUMBER_OF_CHARS
+ {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS},
+ #else
+ {"ODD_NUMBER_OF_CHARS", 13, 145},
+ #endif
+ #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE
+ {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE},
+ #else
+ {"SECOND_NUMBER_TOO_LARGE", 13, 147},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH
+ {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH},
+ #else
+ {"SEQUENCE_LENGTH_MISMATCH", 13, 148},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED
+ {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED},
+ #else
+ {"SEQUENCE_NOT_CONSTRUCTED", 13, 149},
+ #endif
+ #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG},
+ #else
+ {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192},
+ #endif
+ #ifdef ASN1_R_SHORT_LINE
+ {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE},
+ #else
+ {"SHORT_LINE", 13, 150},
+ #endif
+ #ifdef ASN1_R_SIG_INVALID_MIME_TYPE
+ {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE},
+ #else
+ {"SIG_INVALID_MIME_TYPE", 13, 213},
+ #endif
+ #ifdef ASN1_R_STREAMING_NOT_SUPPORTED
+ {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED},
+ #else
+ {"STREAMING_NOT_SUPPORTED", 13, 202},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 13, 151},
+ #endif
+ #ifdef ASN1_R_STRING_TOO_SHORT
+ {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT},
+ #else
+ {"STRING_TOO_SHORT", 13, 152},
+ #endif
+ #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154},
+ #endif
+ #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT
+ {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT},
+ #else
+ {"TIME_NOT_ASCII_FORMAT", 13, 193},
+ #endif
+ #ifdef ASN1_R_TOO_LARGE
+ {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE},
+ #else
+ {"TOO_LARGE", 13, 223},
+ #endif
+ #ifdef ASN1_R_TOO_LONG
+ {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG},
+ #else
+ {"TOO_LONG", 13, 155},
+ #endif
+ #ifdef ASN1_R_TOO_SMALL
+ {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL},
+ #else
+ {"TOO_SMALL", 13, 224},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED
+ {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED},
+ #else
+ {"TYPE_NOT_CONSTRUCTED", 13, 156},
+ #endif
+ #ifdef ASN1_R_TYPE_NOT_PRIMITIVE
+ {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE},
+ #else
+ {"TYPE_NOT_PRIMITIVE", 13, 195},
+ #endif
+ #ifdef ASN1_R_UNEXPECTED_EOC
+ {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC},
+ #else
+ {"UNEXPECTED_EOC", 13, 159},
+ #endif
+ #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH},
+ #else
+ {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_ASN1, ASN1_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 13, 229},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_FORMAT
+ {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT},
+ #else
+ {"UNKNOWN_FORMAT", 13, 160},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE
+ {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE},
+ #else
+ {"UNKNOWN_OBJECT_TYPE", 13, 162},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE
+ {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE},
+ #else
+ {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM
+ {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM},
+ #else
+ {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199},
+ #endif
+ #ifdef ASN1_R_UNKNOWN_TAG
+ {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG},
+ #else
+ {"UNKNOWN_TAG", 13, 194},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE},
+ #else
+ {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 13, 228},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167},
+ #endif
+ #ifdef ASN1_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 13, 196},
+ #endif
+ #ifdef ASN1_R_WRONG_INTEGER_TYPE
+ {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE},
+ #else
+ {"WRONG_INTEGER_TYPE", 13, 225},
+ #endif
+ #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE
+ {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE},
+ #else
+ {"WRONG_PUBLIC_KEY_TYPE", 13, 200},
+ #endif
+ #ifdef ASN1_R_WRONG_TAG
+ {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG},
+ #else
+ {"WRONG_TAG", 13, 168},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SET_POOL
+ {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL},
+ #else
+ {"FAILED_TO_SET_POOL", 51, 101},
+ #endif
+ #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT
+ {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT},
+ #else
+ {"FAILED_TO_SWAP_CONTEXT", 51, 102},
+ #endif
+ #ifdef ASYNC_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 51, 105},
+ #endif
+ #ifdef ASYNC_R_INVALID_POOL_SIZE
+ {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE},
+ #else
+ {"INVALID_POOL_SIZE", 51, 103},
+ #endif
+ #ifdef BIO_R_ACCEPT_ERROR
+ {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR},
+ #else
+ {"ACCEPT_ERROR", 32, 100},
+ #endif
+ #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET},
+ #else
+ {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141},
+ #endif
+ #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE
+ {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE},
+ #else
+ {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129},
+ #endif
+ #ifdef BIO_R_BAD_FOPEN_MODE
+ {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE},
+ #else
+ {"BAD_FOPEN_MODE", 32, 101},
+ #endif
+ #ifdef BIO_R_BROKEN_PIPE
+ {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE},
+ #else
+ {"BROKEN_PIPE", 32, 124},
+ #endif
+ #ifdef BIO_R_CONNECT_ERROR
+ {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR},
+ #else
+ {"CONNECT_ERROR", 32, 103},
+ #endif
+ #ifdef BIO_R_CONNECT_TIMEOUT
+ {"CONNECT_TIMEOUT", ERR_LIB_BIO, BIO_R_CONNECT_TIMEOUT},
+ #else
+ {"CONNECT_TIMEOUT", 32, 147},
+ #endif
+ #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET},
+ #else
+ {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_ERROR
+ {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR},
+ #else
+ {"GETSOCKNAME_ERROR", 32, 132},
+ #endif
+ #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS},
+ #else
+ {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133},
+ #endif
+ #ifdef BIO_R_GETTING_SOCKTYPE
+ {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE},
+ #else
+ {"GETTING_SOCKTYPE", 32, 134},
+ #endif
+ #ifdef BIO_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 32, 125},
+ #endif
+ #ifdef BIO_R_INVALID_SOCKET
+ {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET},
+ #else
+ {"INVALID_SOCKET", 32, 135},
+ #endif
+ #ifdef BIO_R_IN_USE
+ {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE},
+ #else
+ {"IN_USE", 32, 123},
+ #endif
+ #ifdef BIO_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 32, 102},
+ #endif
+ #ifdef BIO_R_LISTEN_V6_ONLY
+ {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY},
+ #else
+ {"LISTEN_V6_ONLY", 32, 136},
+ #endif
+ #ifdef BIO_R_LOOKUP_RETURNED_NOTHING
+ {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING},
+ #else
+ {"LOOKUP_RETURNED_NOTHING", 32, 142},
+ #endif
+ #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE
+ {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE},
+ #else
+ {"MALFORMED_HOST_OR_SERVICE", 32, 130},
+ #endif
+ #ifdef BIO_R_NBIO_CONNECT_ERROR
+ {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR},
+ #else
+ {"NBIO_CONNECT_ERROR", 32, 110},
+ #endif
+ #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143},
+ #endif
+ #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED},
+ #else
+ {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144},
+ #endif
+ #ifdef BIO_R_NO_PORT_DEFINED
+ {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED},
+ #else
+ {"NO_PORT_DEFINED", 32, 113},
+ #endif
+ #ifdef BIO_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 32, 128},
+ #endif
+ #ifdef BIO_R_TRANSFER_ERROR
+ {"TRANSFER_ERROR", ERR_LIB_BIO, BIO_R_TRANSFER_ERROR},
+ #else
+ {"TRANSFER_ERROR", 32, 104},
+ #endif
+ #ifdef BIO_R_TRANSFER_TIMEOUT
+ {"TRANSFER_TIMEOUT", ERR_LIB_BIO, BIO_R_TRANSFER_TIMEOUT},
+ #else
+ {"TRANSFER_TIMEOUT", 32, 105},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_BIND_SOCKET
+ {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET},
+ #else
+ {"UNABLE_TO_BIND_SOCKET", 32, 117},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET
+ {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET},
+ #else
+ {"UNABLE_TO_CREATE_SOCKET", 32, 118},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_KEEPALIVE
+ {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE},
+ #else
+ {"UNABLE_TO_KEEPALIVE", 32, 137},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET
+ {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET},
+ #else
+ {"UNABLE_TO_LISTEN_SOCKET", 32, 119},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_NODELAY
+ {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY},
+ #else
+ {"UNABLE_TO_NODELAY", 32, 138},
+ #endif
+ #ifdef BIO_R_UNABLE_TO_REUSEADDR
+ {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR},
+ #else
+ {"UNABLE_TO_REUSEADDR", 32, 139},
+ #endif
+ #ifdef BIO_R_UNAVAILABLE_IP_FAMILY
+ {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY},
+ #else
+ {"UNAVAILABLE_IP_FAMILY", 32, 145},
+ #endif
+ #ifdef BIO_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 32, 120},
+ #endif
+ #ifdef BIO_R_UNKNOWN_INFO_TYPE
+ {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE},
+ #else
+ {"UNKNOWN_INFO_TYPE", 32, 140},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_IP_FAMILY
+ {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY},
+ #else
+ {"UNSUPPORTED_IP_FAMILY", 32, 146},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_METHOD
+ {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD},
+ #else
+ {"UNSUPPORTED_METHOD", 32, 121},
+ #endif
+ #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY
+ {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY},
+ #else
+ {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131},
+ #endif
+ #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO
+ {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO},
+ #else
+ {"WRITE_TO_READ_ONLY_BIO", 32, 126},
+ #endif
+ #ifdef BIO_R_WSASTARTUP
+ {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP},
+ #else
+ {"WSASTARTUP", 32, 122},
+ #endif
+ #ifdef BN_R_ARG2_LT_ARG3
+ {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3},
+ #else
+ {"ARG2_LT_ARG3", 3, 100},
+ #endif
+ #ifdef BN_R_BAD_RECIPROCAL
+ {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL},
+ #else
+ {"BAD_RECIPROCAL", 3, 101},
+ #endif
+ #ifdef BN_R_BIGNUM_TOO_LONG
+ {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG},
+ #else
+ {"BIGNUM_TOO_LONG", 3, 114},
+ #endif
+ #ifdef BN_R_BITS_TOO_SMALL
+ {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL},
+ #else
+ {"BITS_TOO_SMALL", 3, 118},
+ #endif
+ #ifdef BN_R_CALLED_WITH_EVEN_MODULUS
+ {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS},
+ #else
+ {"CALLED_WITH_EVEN_MODULUS", 3, 102},
+ #endif
+ #ifdef BN_R_DIV_BY_ZERO
+ {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO},
+ #else
+ {"DIV_BY_ZERO", 3, 103},
+ #endif
+ #ifdef BN_R_ENCODING_ERROR
+ {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR},
+ #else
+ {"ENCODING_ERROR", 3, 104},
+ #endif
+ #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA},
+ #else
+ {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105},
+ #endif
+ #ifdef BN_R_INPUT_NOT_REDUCED
+ {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED},
+ #else
+ {"INPUT_NOT_REDUCED", 3, 110},
+ #endif
+ #ifdef BN_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 3, 106},
+ #endif
+ #ifdef BN_R_INVALID_RANGE
+ {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE},
+ #else
+ {"INVALID_RANGE", 3, 115},
+ #endif
+ #ifdef BN_R_INVALID_SHIFT
+ {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT},
+ #else
+ {"INVALID_SHIFT", 3, 119},
+ #endif
+ #ifdef BN_R_NOT_A_SQUARE
+ {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE},
+ #else
+ {"NOT_A_SQUARE", 3, 111},
+ #endif
+ #ifdef BN_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 3, 107},
+ #endif
+ #ifdef BN_R_NO_INVERSE
+ {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE},
+ #else
+ {"NO_INVERSE", 3, 108},
+ #endif
+ #ifdef BN_R_NO_PRIME_CANDIDATE
+ {"NO_PRIME_CANDIDATE", ERR_LIB_BN, BN_R_NO_PRIME_CANDIDATE},
+ #else
+ {"NO_PRIME_CANDIDATE", 3, 121},
+ #endif
+ #ifdef BN_R_NO_SOLUTION
+ {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION},
+ #else
+ {"NO_SOLUTION", 3, 116},
+ #endif
+ #ifdef BN_R_NO_SUITABLE_DIGEST
+ {"NO_SUITABLE_DIGEST", ERR_LIB_BN, BN_R_NO_SUITABLE_DIGEST},
+ #else
+ {"NO_SUITABLE_DIGEST", 3, 120},
+ #endif
+ #ifdef BN_R_PRIVATE_KEY_TOO_LARGE
+ {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE},
+ #else
+ {"PRIVATE_KEY_TOO_LARGE", 3, 117},
+ #endif
+ #ifdef BN_R_P_IS_NOT_PRIME
+ {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME},
+ #else
+ {"P_IS_NOT_PRIME", 3, 112},
+ #endif
+ #ifdef BN_R_TOO_MANY_ITERATIONS
+ {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS},
+ #else
+ {"TOO_MANY_ITERATIONS", 3, 113},
+ #endif
+ #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES
+ {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES},
+ #else
+ {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109},
+ #endif
+ #ifdef CMP_R_ALGORITHM_NOT_SUPPORTED
+ {"ALGORITHM_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_ALGORITHM_NOT_SUPPORTED},
+ #else
+ {"ALGORITHM_NOT_SUPPORTED", 58, 139},
+ #endif
+ #ifdef CMP_R_BAD_CHECKAFTER_IN_POLLREP
+ {"BAD_CHECKAFTER_IN_POLLREP", ERR_LIB_CMP, CMP_R_BAD_CHECKAFTER_IN_POLLREP},
+ #else
+ {"BAD_CHECKAFTER_IN_POLLREP", 58, 167},
+ #endif
+ #ifdef CMP_R_BAD_REQUEST_ID
+ {"BAD_REQUEST_ID", ERR_LIB_CMP, CMP_R_BAD_REQUEST_ID},
+ #else
+ {"BAD_REQUEST_ID", 58, 108},
+ #endif
+ #ifdef CMP_R_CERTHASH_UNMATCHED
+ {"CERTHASH_UNMATCHED", ERR_LIB_CMP, CMP_R_CERTHASH_UNMATCHED},
+ #else
+ {"CERTHASH_UNMATCHED", 58, 156},
+ #endif
+ #ifdef CMP_R_CERTID_NOT_FOUND
+ {"CERTID_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTID_NOT_FOUND},
+ #else
+ {"CERTID_NOT_FOUND", 58, 109},
+ #endif
+ #ifdef CMP_R_CERTIFICATE_NOT_ACCEPTED
+ {"CERTIFICATE_NOT_ACCEPTED", ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_ACCEPTED},
+ #else
+ {"CERTIFICATE_NOT_ACCEPTED", 58, 169},
+ #endif
+ #ifdef CMP_R_CERTIFICATE_NOT_FOUND
+ {"CERTIFICATE_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_FOUND},
+ #else
+ {"CERTIFICATE_NOT_FOUND", 58, 112},
+ #endif
+ #ifdef CMP_R_CERTREQMSG_NOT_FOUND
+ {"CERTREQMSG_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTREQMSG_NOT_FOUND},
+ #else
+ {"CERTREQMSG_NOT_FOUND", 58, 157},
+ #endif
+ #ifdef CMP_R_CERTRESPONSE_NOT_FOUND
+ {"CERTRESPONSE_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTRESPONSE_NOT_FOUND},
+ #else
+ {"CERTRESPONSE_NOT_FOUND", 58, 113},
+ #endif
+ #ifdef CMP_R_CERT_AND_KEY_DO_NOT_MATCH
+ {"CERT_AND_KEY_DO_NOT_MATCH", ERR_LIB_CMP, CMP_R_CERT_AND_KEY_DO_NOT_MATCH},
+ #else
+ {"CERT_AND_KEY_DO_NOT_MATCH", 58, 114},
+ #endif
+ #ifdef CMP_R_CHECKAFTER_OUT_OF_RANGE
+ {"CHECKAFTER_OUT_OF_RANGE", ERR_LIB_CMP, CMP_R_CHECKAFTER_OUT_OF_RANGE},
+ #else
+ {"CHECKAFTER_OUT_OF_RANGE", 58, 181},
+ #endif
+ #ifdef CMP_R_ENCOUNTERED_KEYUPDATEWARNING
+ {"ENCOUNTERED_KEYUPDATEWARNING", ERR_LIB_CMP, CMP_R_ENCOUNTERED_KEYUPDATEWARNING},
+ #else
+ {"ENCOUNTERED_KEYUPDATEWARNING", 58, 176},
+ #endif
+ #ifdef CMP_R_ENCOUNTERED_WAITING
+ {"ENCOUNTERED_WAITING", ERR_LIB_CMP, CMP_R_ENCOUNTERED_WAITING},
+ #else
+ {"ENCOUNTERED_WAITING", 58, 162},
+ #endif
+ #ifdef CMP_R_ERROR_CALCULATING_PROTECTION
+ {"ERROR_CALCULATING_PROTECTION", ERR_LIB_CMP, CMP_R_ERROR_CALCULATING_PROTECTION},
+ #else
+ {"ERROR_CALCULATING_PROTECTION", 58, 115},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_CERTCONF
+ {"ERROR_CREATING_CERTCONF", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTCONF},
+ #else
+ {"ERROR_CREATING_CERTCONF", 58, 116},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_CERTREP
+ {"ERROR_CREATING_CERTREP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREP},
+ #else
+ {"ERROR_CREATING_CERTREP", 58, 117},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_CERTREQ
+ {"ERROR_CREATING_CERTREQ", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREQ},
+ #else
+ {"ERROR_CREATING_CERTREQ", 58, 163},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_ERROR
+ {"ERROR_CREATING_ERROR", ERR_LIB_CMP, CMP_R_ERROR_CREATING_ERROR},
+ #else
+ {"ERROR_CREATING_ERROR", 58, 118},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_GENM
+ {"ERROR_CREATING_GENM", ERR_LIB_CMP, CMP_R_ERROR_CREATING_GENM},
+ #else
+ {"ERROR_CREATING_GENM", 58, 119},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_GENP
+ {"ERROR_CREATING_GENP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_GENP},
+ #else
+ {"ERROR_CREATING_GENP", 58, 120},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_PKICONF
+ {"ERROR_CREATING_PKICONF", ERR_LIB_CMP, CMP_R_ERROR_CREATING_PKICONF},
+ #else
+ {"ERROR_CREATING_PKICONF", 58, 122},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_POLLREP
+ {"ERROR_CREATING_POLLREP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREP},
+ #else
+ {"ERROR_CREATING_POLLREP", 58, 123},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_POLLREQ
+ {"ERROR_CREATING_POLLREQ", ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREQ},
+ #else
+ {"ERROR_CREATING_POLLREQ", 58, 124},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_RP
+ {"ERROR_CREATING_RP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_RP},
+ #else
+ {"ERROR_CREATING_RP", 58, 125},
+ #endif
+ #ifdef CMP_R_ERROR_CREATING_RR
+ {"ERROR_CREATING_RR", ERR_LIB_CMP, CMP_R_ERROR_CREATING_RR},
+ #else
+ {"ERROR_CREATING_RR", 58, 126},
+ #endif
+ #ifdef CMP_R_ERROR_PARSING_PKISTATUS
+ {"ERROR_PARSING_PKISTATUS", ERR_LIB_CMP, CMP_R_ERROR_PARSING_PKISTATUS},
+ #else
+ {"ERROR_PARSING_PKISTATUS", 58, 107},
+ #endif
+ #ifdef CMP_R_ERROR_PROCESSING_MESSAGE
+ {"ERROR_PROCESSING_MESSAGE", ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE},
+ #else
+ {"ERROR_PROCESSING_MESSAGE", 58, 158},
+ #endif
+ #ifdef CMP_R_ERROR_PROTECTING_MESSAGE
+ {"ERROR_PROTECTING_MESSAGE", ERR_LIB_CMP, CMP_R_ERROR_PROTECTING_MESSAGE},
+ #else
+ {"ERROR_PROTECTING_MESSAGE", 58, 127},
+ #endif
+ #ifdef CMP_R_ERROR_SETTING_CERTHASH
+ {"ERROR_SETTING_CERTHASH", ERR_LIB_CMP, CMP_R_ERROR_SETTING_CERTHASH},
+ #else
+ {"ERROR_SETTING_CERTHASH", 58, 128},
+ #endif
+ #ifdef CMP_R_ERROR_UNEXPECTED_CERTCONF
+ {"ERROR_UNEXPECTED_CERTCONF", ERR_LIB_CMP, CMP_R_ERROR_UNEXPECTED_CERTCONF},
+ #else
+ {"ERROR_UNEXPECTED_CERTCONF", 58, 160},
+ #endif
+ #ifdef CMP_R_ERROR_VALIDATING_PROTECTION
+ {"ERROR_VALIDATING_PROTECTION", ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_PROTECTION},
+ #else
+ {"ERROR_VALIDATING_PROTECTION", 58, 140},
+ #endif
+ #ifdef CMP_R_ERROR_VALIDATING_SIGNATURE
+ {"ERROR_VALIDATING_SIGNATURE", ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_SIGNATURE},
+ #else
+ {"ERROR_VALIDATING_SIGNATURE", 58, 171},
+ #endif
+ #ifdef CMP_R_FAILED_BUILDING_OWN_CHAIN
+ {"FAILED_BUILDING_OWN_CHAIN", ERR_LIB_CMP, CMP_R_FAILED_BUILDING_OWN_CHAIN},
+ #else
+ {"FAILED_BUILDING_OWN_CHAIN", 58, 164},
+ #endif
+ #ifdef CMP_R_FAILED_EXTRACTING_PUBKEY
+ {"FAILED_EXTRACTING_PUBKEY", ERR_LIB_CMP, CMP_R_FAILED_EXTRACTING_PUBKEY},
+ #else
+ {"FAILED_EXTRACTING_PUBKEY", 58, 141},
+ #endif
+ #ifdef CMP_R_FAILURE_OBTAINING_RANDOM
+ {"FAILURE_OBTAINING_RANDOM", ERR_LIB_CMP, CMP_R_FAILURE_OBTAINING_RANDOM},
+ #else
+ {"FAILURE_OBTAINING_RANDOM", 58, 110},
+ #endif
+ #ifdef CMP_R_FAIL_INFO_OUT_OF_RANGE
+ {"FAIL_INFO_OUT_OF_RANGE", ERR_LIB_CMP, CMP_R_FAIL_INFO_OUT_OF_RANGE},
+ #else
+ {"FAIL_INFO_OUT_OF_RANGE", 58, 129},
+ #endif
+ #ifdef CMP_R_INVALID_ARGS
+ {"INVALID_ARGS", ERR_LIB_CMP, CMP_R_INVALID_ARGS},
+ #else
+ {"INVALID_ARGS", 58, 100},
+ #endif
+ #ifdef CMP_R_INVALID_OPTION
+ {"INVALID_OPTION", ERR_LIB_CMP, CMP_R_INVALID_OPTION},
+ #else
+ {"INVALID_OPTION", 58, 174},
+ #endif
+ #ifdef CMP_R_MISSING_CERTID
+ {"MISSING_CERTID", ERR_LIB_CMP, CMP_R_MISSING_CERTID},
+ #else
+ {"MISSING_CERTID", 58, 165},
+ #endif
+ #ifdef CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION
+ {"MISSING_KEY_INPUT_FOR_CREATING_PROTECTION", ERR_LIB_CMP, CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION},
+ #else
+ {"MISSING_KEY_INPUT_FOR_CREATING_PROTECTION", 58, 130},
+ #endif
+ #ifdef CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE
+ {"MISSING_KEY_USAGE_DIGITALSIGNATURE", ERR_LIB_CMP, CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE},
+ #else
+ {"MISSING_KEY_USAGE_DIGITALSIGNATURE", 58, 142},
+ #endif
+ #ifdef CMP_R_MISSING_P10CSR
+ {"MISSING_P10CSR", ERR_LIB_CMP, CMP_R_MISSING_P10CSR},
+ #else
+ {"MISSING_P10CSR", 58, 121},
+ #endif
+ #ifdef CMP_R_MISSING_PBM_SECRET
+ {"MISSING_PBM_SECRET", ERR_LIB_CMP, CMP_R_MISSING_PBM_SECRET},
+ #else
+ {"MISSING_PBM_SECRET", 58, 166},
+ #endif
+ #ifdef CMP_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_CMP, CMP_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 58, 131},
+ #endif
+ #ifdef CMP_R_MISSING_PRIVATE_KEY_FOR_POPO
+ {"MISSING_PRIVATE_KEY_FOR_POPO", ERR_LIB_CMP, CMP_R_MISSING_PRIVATE_KEY_FOR_POPO},
+ #else
+ {"MISSING_PRIVATE_KEY_FOR_POPO", 58, 190},
+ #endif
+ #ifdef CMP_R_MISSING_PROTECTION
+ {"MISSING_PROTECTION", ERR_LIB_CMP, CMP_R_MISSING_PROTECTION},
+ #else
+ {"MISSING_PROTECTION", 58, 143},
+ #endif
+ #ifdef CMP_R_MISSING_PUBLIC_KEY
+ {"MISSING_PUBLIC_KEY", ERR_LIB_CMP, CMP_R_MISSING_PUBLIC_KEY},
+ #else
+ {"MISSING_PUBLIC_KEY", 58, 183},
+ #endif
+ #ifdef CMP_R_MISSING_REFERENCE_CERT
+ {"MISSING_REFERENCE_CERT", ERR_LIB_CMP, CMP_R_MISSING_REFERENCE_CERT},
+ #else
+ {"MISSING_REFERENCE_CERT", 58, 168},
+ #endif
+ #ifdef CMP_R_MISSING_SECRET
+ {"MISSING_SECRET", ERR_LIB_CMP, CMP_R_MISSING_SECRET},
+ #else
+ {"MISSING_SECRET", 58, 178},
+ #endif
+ #ifdef CMP_R_MISSING_SENDER_IDENTIFICATION
+ {"MISSING_SENDER_IDENTIFICATION", ERR_LIB_CMP, CMP_R_MISSING_SENDER_IDENTIFICATION},
+ #else
+ {"MISSING_SENDER_IDENTIFICATION", 58, 111},
+ #endif
+ #ifdef CMP_R_MISSING_TRUST_ANCHOR
+ {"MISSING_TRUST_ANCHOR", ERR_LIB_CMP, CMP_R_MISSING_TRUST_ANCHOR},
+ #else
+ {"MISSING_TRUST_ANCHOR", 58, 179},
+ #endif
+ #ifdef CMP_R_MISSING_TRUST_STORE
+ {"MISSING_TRUST_STORE", ERR_LIB_CMP, CMP_R_MISSING_TRUST_STORE},
+ #else
+ {"MISSING_TRUST_STORE", 58, 144},
+ #endif
+ #ifdef CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED
+ {"MULTIPLE_REQUESTS_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED},
+ #else
+ {"MULTIPLE_REQUESTS_NOT_SUPPORTED", 58, 161},
+ #endif
+ #ifdef CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED
+ {"MULTIPLE_RESPONSES_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED},
+ #else
+ {"MULTIPLE_RESPONSES_NOT_SUPPORTED", 58, 170},
+ #endif
+ #ifdef CMP_R_MULTIPLE_SAN_SOURCES
+ {"MULTIPLE_SAN_SOURCES", ERR_LIB_CMP, CMP_R_MULTIPLE_SAN_SOURCES},
+ #else
+ {"MULTIPLE_SAN_SOURCES", 58, 102},
+ #endif
+ #ifdef CMP_R_NO_STDIO
+ {"NO_STDIO", ERR_LIB_CMP, CMP_R_NO_STDIO},
+ #else
+ {"NO_STDIO", 58, 194},
+ #endif
+ #ifdef CMP_R_NO_SUITABLE_SENDER_CERT
+ {"NO_SUITABLE_SENDER_CERT", ERR_LIB_CMP, CMP_R_NO_SUITABLE_SENDER_CERT},
+ #else
+ {"NO_SUITABLE_SENDER_CERT", 58, 145},
+ #endif
+ #ifdef CMP_R_NULL_ARGUMENT
+ {"NULL_ARGUMENT", ERR_LIB_CMP, CMP_R_NULL_ARGUMENT},
+ #else
+ {"NULL_ARGUMENT", 58, 103},
+ #endif
+ #ifdef CMP_R_PKIBODY_ERROR
+ {"PKIBODY_ERROR", ERR_LIB_CMP, CMP_R_PKIBODY_ERROR},
+ #else
+ {"PKIBODY_ERROR", 58, 146},
+ #endif
+ #ifdef CMP_R_PKISTATUSINFO_NOT_FOUND
+ {"PKISTATUSINFO_NOT_FOUND", ERR_LIB_CMP, CMP_R_PKISTATUSINFO_NOT_FOUND},
+ #else
+ {"PKISTATUSINFO_NOT_FOUND", 58, 132},
+ #endif
+ #ifdef CMP_R_POLLING_FAILED
+ {"POLLING_FAILED", ERR_LIB_CMP, CMP_R_POLLING_FAILED},
+ #else
+ {"POLLING_FAILED", 58, 172},
+ #endif
+ #ifdef CMP_R_POTENTIALLY_INVALID_CERTIFICATE
+ {"POTENTIALLY_INVALID_CERTIFICATE", ERR_LIB_CMP, CMP_R_POTENTIALLY_INVALID_CERTIFICATE},
+ #else
+ {"POTENTIALLY_INVALID_CERTIFICATE", 58, 147},
+ #endif
+ #ifdef CMP_R_RECEIVED_ERROR
+ {"RECEIVED_ERROR", ERR_LIB_CMP, CMP_R_RECEIVED_ERROR},
+ #else
+ {"RECEIVED_ERROR", 58, 180},
+ #endif
+ #ifdef CMP_R_RECIPNONCE_UNMATCHED
+ {"RECIPNONCE_UNMATCHED", ERR_LIB_CMP, CMP_R_RECIPNONCE_UNMATCHED},
+ #else
+ {"RECIPNONCE_UNMATCHED", 58, 148},
+ #endif
+ #ifdef CMP_R_REQUEST_NOT_ACCEPTED
+ {"REQUEST_NOT_ACCEPTED", ERR_LIB_CMP, CMP_R_REQUEST_NOT_ACCEPTED},
+ #else
+ {"REQUEST_NOT_ACCEPTED", 58, 149},
+ #endif
+ #ifdef CMP_R_REQUEST_REJECTED_BY_SERVER
+ {"REQUEST_REJECTED_BY_SERVER", ERR_LIB_CMP, CMP_R_REQUEST_REJECTED_BY_SERVER},
+ #else
+ {"REQUEST_REJECTED_BY_SERVER", 58, 182},
+ #endif
+ #ifdef CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED
+ {"SENDER_GENERALNAME_TYPE_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED},
+ #else
+ {"SENDER_GENERALNAME_TYPE_NOT_SUPPORTED", 58, 150},
+ #endif
+ #ifdef CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG
+ {"SRVCERT_DOES_NOT_VALIDATE_MSG", ERR_LIB_CMP, CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG},
+ #else
+ {"SRVCERT_DOES_NOT_VALIDATE_MSG", 58, 151},
+ #endif
+ #ifdef CMP_R_TOTAL_TIMEOUT
+ {"TOTAL_TIMEOUT", ERR_LIB_CMP, CMP_R_TOTAL_TIMEOUT},
+ #else
+ {"TOTAL_TIMEOUT", 58, 184},
+ #endif
+ #ifdef CMP_R_TRANSACTIONID_UNMATCHED
+ {"TRANSACTIONID_UNMATCHED", ERR_LIB_CMP, CMP_R_TRANSACTIONID_UNMATCHED},
+ #else
+ {"TRANSACTIONID_UNMATCHED", 58, 152},
+ #endif
+ #ifdef CMP_R_TRANSFER_ERROR
+ {"TRANSFER_ERROR", ERR_LIB_CMP, CMP_R_TRANSFER_ERROR},
+ #else
+ {"TRANSFER_ERROR", 58, 159},
+ #endif
+ #ifdef CMP_R_UNEXPECTED_PKIBODY
+ {"UNEXPECTED_PKIBODY", ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY},
+ #else
+ {"UNEXPECTED_PKIBODY", 58, 133},
+ #endif
+ #ifdef CMP_R_UNEXPECTED_PKISTATUS
+ {"UNEXPECTED_PKISTATUS", ERR_LIB_CMP, CMP_R_UNEXPECTED_PKISTATUS},
+ #else
+ {"UNEXPECTED_PKISTATUS", 58, 185},
+ #endif
+ #ifdef CMP_R_UNEXPECTED_PVNO
+ {"UNEXPECTED_PVNO", ERR_LIB_CMP, CMP_R_UNEXPECTED_PVNO},
+ #else
+ {"UNEXPECTED_PVNO", 58, 153},
+ #endif
+ #ifdef CMP_R_UNKNOWN_ALGORITHM_ID
+ {"UNKNOWN_ALGORITHM_ID", ERR_LIB_CMP, CMP_R_UNKNOWN_ALGORITHM_ID},
+ #else
+ {"UNKNOWN_ALGORITHM_ID", 58, 134},
+ #endif
+ #ifdef CMP_R_UNKNOWN_CERT_TYPE
+ {"UNKNOWN_CERT_TYPE", ERR_LIB_CMP, CMP_R_UNKNOWN_CERT_TYPE},
+ #else
+ {"UNKNOWN_CERT_TYPE", 58, 135},
+ #endif
+ #ifdef CMP_R_UNKNOWN_PKISTATUS
+ {"UNKNOWN_PKISTATUS", ERR_LIB_CMP, CMP_R_UNKNOWN_PKISTATUS},
+ #else
+ {"UNKNOWN_PKISTATUS", 58, 186},
+ #endif
+ #ifdef CMP_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_CMP, CMP_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 58, 136},
+ #endif
+ #ifdef CMP_R_UNSUPPORTED_KEY_TYPE
+ {"UNSUPPORTED_KEY_TYPE", ERR_LIB_CMP, CMP_R_UNSUPPORTED_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_KEY_TYPE", 58, 137},
+ #endif
+ #ifdef CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC
+ {"UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC", ERR_LIB_CMP, CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC},
+ #else
+ {"UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC", 58, 154},
+ #endif
+ #ifdef CMP_R_VALUE_TOO_LARGE
+ {"VALUE_TOO_LARGE", ERR_LIB_CMP, CMP_R_VALUE_TOO_LARGE},
+ #else
+ {"VALUE_TOO_LARGE", 58, 175},
+ #endif
+ #ifdef CMP_R_VALUE_TOO_SMALL
+ {"VALUE_TOO_SMALL", ERR_LIB_CMP, CMP_R_VALUE_TOO_SMALL},
+ #else
+ {"VALUE_TOO_SMALL", 58, 177},
+ #endif
+ #ifdef CMP_R_WRONG_ALGORITHM_OID
+ {"WRONG_ALGORITHM_OID", ERR_LIB_CMP, CMP_R_WRONG_ALGORITHM_OID},
+ #else
+ {"WRONG_ALGORITHM_OID", 58, 138},
+ #endif
+ #ifdef CMP_R_WRONG_CERTID
+ {"WRONG_CERTID", ERR_LIB_CMP, CMP_R_WRONG_CERTID},
+ #else
+ {"WRONG_CERTID", 58, 189},
+ #endif
+ #ifdef CMP_R_WRONG_CERTID_IN_RP
+ {"WRONG_CERTID_IN_RP", ERR_LIB_CMP, CMP_R_WRONG_CERTID_IN_RP},
+ #else
+ {"WRONG_CERTID_IN_RP", 58, 187},
+ #endif
+ #ifdef CMP_R_WRONG_PBM_VALUE
+ {"WRONG_PBM_VALUE", ERR_LIB_CMP, CMP_R_WRONG_PBM_VALUE},
+ #else
+ {"WRONG_PBM_VALUE", 58, 155},
+ #endif
+ #ifdef CMP_R_WRONG_RP_COMPONENT_COUNT
+ {"WRONG_RP_COMPONENT_COUNT", ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT},
+ #else
+ {"WRONG_RP_COMPONENT_COUNT", 58, 188},
+ #endif
+ #ifdef CMP_R_WRONG_SERIAL_IN_RP
+ {"WRONG_SERIAL_IN_RP", ERR_LIB_CMP, CMP_R_WRONG_SERIAL_IN_RP},
+ #else
+ {"WRONG_SERIAL_IN_RP", 58, 173},
+ #endif
+ #ifdef CMS_R_ADD_SIGNER_ERROR
+ {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR},
+ #else
+ {"ADD_SIGNER_ERROR", 46, 99},
+ #endif
+ #ifdef CMS_R_ATTRIBUTE_ERROR
+ {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR},
+ #else
+ {"ATTRIBUTE_ERROR", 46, 161},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT
+ {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT},
+ #else
+ {"CERTIFICATE_ALREADY_PRESENT", 46, 175},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID
+ {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID},
+ #else
+ {"CERTIFICATE_HAS_NO_KEYID", 46, 160},
+ #endif
+ #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 46, 100},
+ #endif
+ #ifdef CMS_R_CIPHER_AEAD_SET_TAG_ERROR
+ {"CIPHER_AEAD_SET_TAG_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_AEAD_SET_TAG_ERROR},
+ #else
+ {"CIPHER_AEAD_SET_TAG_ERROR", 46, 184},
+ #endif
+ #ifdef CMS_R_CIPHER_GET_TAG
+ {"CIPHER_GET_TAG", ERR_LIB_CMS, CMS_R_CIPHER_GET_TAG},
+ #else
+ {"CIPHER_GET_TAG", 46, 185},
+ #endif
+ #ifdef CMS_R_CIPHER_INITIALISATION_ERROR
+ {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_INITIALISATION_ERROR", 46, 101},
+ #endif
+ #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR},
+ #else
+ {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102},
+ #endif
+ #ifdef CMS_R_CMS_DATAFINAL_ERROR
+ {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR},
+ #else
+ {"CMS_DATAFINAL_ERROR", 46, 103},
+ #endif
+ #ifdef CMS_R_CMS_LIB
+ {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB},
+ #else
+ {"CMS_LIB", 46, 104},
+ #endif
+ #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH
+ {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH},
+ #else
+ {"CONTENTIDENTIFIER_MISMATCH", 46, 170},
+ #endif
+ #ifdef CMS_R_CONTENT_NOT_FOUND
+ {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND},
+ #else
+ {"CONTENT_NOT_FOUND", 46, 105},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_MISMATCH
+ {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH},
+ #else
+ {"CONTENT_TYPE_MISMATCH", 46, 171},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107},
+ #endif
+ #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108},
+ #endif
+ #ifdef CMS_R_CONTENT_VERIFY_ERROR
+ {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR},
+ #else
+ {"CONTENT_VERIFY_ERROR", 46, 109},
+ #endif
+ #ifdef CMS_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 46, 110},
+ #endif
+ #ifdef CMS_R_CTRL_FAILURE
+ {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE},
+ #else
+ {"CTRL_FAILURE", 46, 111},
+ #endif
+ #ifdef CMS_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_CMS, CMS_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 46, 187},
+ #endif
+ #ifdef CMS_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 46, 112},
+ #endif
+ #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY
+ {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY},
+ #else
+ {"ERROR_GETTING_PUBLIC_KEY", 46, 113},
+ #endif
+ #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE},
+ #else
+ {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_KEY
+ {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY},
+ #else
+ {"ERROR_SETTING_KEY", 46, 115},
+ #endif
+ #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO
+ {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO},
+ #else
+ {"ERROR_SETTING_RECIPIENTINFO", 46, 116},
+ #endif
+ #ifdef CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR
+ {"ESS_SIGNING_CERTID_MISMATCH_ERROR", ERR_LIB_CMS, CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR},
+ #else
+ {"ESS_SIGNING_CERTID_MISMATCH_ERROR", 46, 183},
+ #endif
+ #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH
+ {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH},
+ #else
+ {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER},
+ #else
+ {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176},
+ #endif
+ #ifdef CMS_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 46, 118},
+ #endif
+ #ifdef CMS_R_INVALID_LABEL
+ {"INVALID_LABEL", ERR_LIB_CMS, CMS_R_INVALID_LABEL},
+ #else
+ {"INVALID_LABEL", 46, 190},
+ #endif
+ #ifdef CMS_R_INVALID_OAEP_PARAMETERS
+ {"INVALID_OAEP_PARAMETERS", ERR_LIB_CMS, CMS_R_INVALID_OAEP_PARAMETERS},
+ #else
+ {"INVALID_OAEP_PARAMETERS", 46, 191},
+ #endif
+ #ifdef CMS_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 46, 186},
+ #endif
+ #ifdef CMS_R_MD_BIO_INIT_ERROR
+ {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR},
+ #else
+ {"MD_BIO_INIT_ERROR", 46, 119},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120},
+ #endif
+ #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH
+ {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH},
+ #else
+ {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_ERROR
+ {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR},
+ #else
+ {"MSGSIGDIGEST_ERROR", 46, 172},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE},
+ #else
+ {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162},
+ #endif
+ #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH
+ {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH},
+ #else
+ {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163},
+ #endif
+ #ifdef CMS_R_NEED_ONE_SIGNER
+ {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER},
+ #else
+ {"NEED_ONE_SIGNER", 46, 164},
+ #endif
+ #ifdef CMS_R_NOT_A_SIGNED_RECEIPT
+ {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT},
+ #else
+ {"NOT_A_SIGNED_RECEIPT", 46, 165},
+ #endif
+ #ifdef CMS_R_NOT_ENCRYPTED_DATA
+ {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA},
+ #else
+ {"NOT_ENCRYPTED_DATA", 46, 122},
+ #endif
+ #ifdef CMS_R_NOT_KEK
+ {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK},
+ #else
+ {"NOT_KEK", 46, 123},
+ #endif
+ #ifdef CMS_R_NOT_KEY_AGREEMENT
+ {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT},
+ #else
+ {"NOT_KEY_AGREEMENT", 46, 181},
+ #endif
+ #ifdef CMS_R_NOT_KEY_TRANSPORT
+ {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT},
+ #else
+ {"NOT_KEY_TRANSPORT", 46, 124},
+ #endif
+ #ifdef CMS_R_NOT_PWRI
+ {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI},
+ #else
+ {"NOT_PWRI", 46, 177},
+ #endif
+ #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125},
+ #endif
+ #ifdef CMS_R_NO_CIPHER
+ {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER},
+ #else
+ {"NO_CIPHER", 46, 126},
+ #endif
+ #ifdef CMS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 46, 127},
+ #endif
+ #ifdef CMS_R_NO_CONTENT_TYPE
+ {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE},
+ #else
+ {"NO_CONTENT_TYPE", 46, 173},
+ #endif
+ #ifdef CMS_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 46, 128},
+ #endif
+ #ifdef CMS_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 46, 129},
+ #endif
+ #ifdef CMS_R_NO_KEY
+ {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY},
+ #else
+ {"NO_KEY", 46, 130},
+ #endif
+ #ifdef CMS_R_NO_KEY_OR_CERT
+ {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT},
+ #else
+ {"NO_KEY_OR_CERT", 46, 174},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_DIGEST
+ {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST},
+ #else
+ {"NO_MATCHING_DIGEST", 46, 131},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_RECIPIENT
+ {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT},
+ #else
+ {"NO_MATCHING_RECIPIENT", 46, 132},
+ #endif
+ #ifdef CMS_R_NO_MATCHING_SIGNATURE
+ {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE},
+ #else
+ {"NO_MATCHING_SIGNATURE", 46, 166},
+ #endif
+ #ifdef CMS_R_NO_MSGSIGDIGEST
+ {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST},
+ #else
+ {"NO_MSGSIGDIGEST", 46, 167},
+ #endif
+ #ifdef CMS_R_NO_PASSWORD
+ {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD},
+ #else
+ {"NO_PASSWORD", 46, 178},
+ #endif
+ #ifdef CMS_R_NO_PRIVATE_KEY
+ {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY},
+ #else
+ {"NO_PRIVATE_KEY", 46, 133},
+ #endif
+ #ifdef CMS_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 46, 134},
+ #endif
+ #ifdef CMS_R_NO_RECEIPT_REQUEST
+ {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST},
+ #else
+ {"NO_RECEIPT_REQUEST", 46, 168},
+ #endif
+ #ifdef CMS_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 46, 135},
+ #endif
+ #ifdef CMS_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_CMS, CMS_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 46, 188},
+ #endif
+ #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136},
+ #endif
+ #ifdef CMS_R_RECEIPT_DECODE_ERROR
+ {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR},
+ #else
+ {"RECEIPT_DECODE_ERROR", 46, 169},
+ #endif
+ #ifdef CMS_R_RECIPIENT_ERROR
+ {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR},
+ #else
+ {"RECIPIENT_ERROR", 46, 137},
+ #endif
+ #ifdef CMS_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_CMS, CMS_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 46, 189},
+ #endif
+ #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138},
+ #endif
+ #ifdef CMS_R_SIGNFINAL_ERROR
+ {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR},
+ #else
+ {"SIGNFINAL_ERROR", 46, 139},
+ #endif
+ #ifdef CMS_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 46, 140},
+ #endif
+ #ifdef CMS_R_STORE_INIT_ERROR
+ {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR},
+ #else
+ {"STORE_INIT_ERROR", 46, 141},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA
+ {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA},
+ #else
+ {"TYPE_NOT_COMPRESSED_DATA", 46, 142},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DATA
+ {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA},
+ #else
+ {"TYPE_NOT_DATA", 46, 143},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA
+ {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA},
+ #else
+ {"TYPE_NOT_DIGESTED_DATA", 46, 144},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA
+ {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA},
+ #else
+ {"TYPE_NOT_ENCRYPTED_DATA", 46, 145},
+ #endif
+ #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA
+ {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA},
+ #else
+ {"TYPE_NOT_ENVELOPED_DATA", 46, 146},
+ #endif
+ #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT
+ {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT},
+ #else
+ {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147},
+ #endif
+ #ifdef CMS_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 46, 148},
+ #endif
+ #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 46, 149},
+ #endif
+ #ifdef CMS_R_UNKNOWN_ID
+ {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID},
+ #else
+ {"UNKNOWN_ID", 46, 150},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM", 46, 194},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 46, 152},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_ENCRYPTION_TYPE
+ {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_ENCRYPTION_TYPE},
+ #else
+ {"UNSUPPORTED_ENCRYPTION_TYPE", 46, 192},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM
+ {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEK_ALGORITHM", 46, 153},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_LABEL_SOURCE
+ {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_LABEL_SOURCE},
+ #else
+ {"UNSUPPORTED_LABEL_SOURCE", 46, 193},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE
+ {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE},
+ #else
+ {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154},
+ #endif
+ #ifdef CMS_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 46, 156},
+ #endif
+ #ifdef CMS_R_UNWRAP_ERROR
+ {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR},
+ #else
+ {"UNWRAP_ERROR", 46, 157},
+ #endif
+ #ifdef CMS_R_UNWRAP_FAILURE
+ {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE},
+ #else
+ {"UNWRAP_FAILURE", 46, 180},
+ #endif
+ #ifdef CMS_R_VERIFICATION_FAILURE
+ {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE},
+ #else
+ {"VERIFICATION_FAILURE", 46, 158},
+ #endif
+ #ifdef CMS_R_WRAP_ERROR
+ {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR},
+ #else
+ {"WRAP_ERROR", 46, 159},
+ #endif
+ #ifdef COMP_R_ZLIB_DEFLATE_ERROR
+ {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR},
+ #else
+ {"ZLIB_DEFLATE_ERROR", 41, 99},
+ #endif
+ #ifdef COMP_R_ZLIB_INFLATE_ERROR
+ {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR},
+ #else
+ {"ZLIB_INFLATE_ERROR", 41, 100},
+ #endif
+ #ifdef COMP_R_ZLIB_NOT_SUPPORTED
+ {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED},
+ #else
+ {"ZLIB_NOT_SUPPORTED", 41, 101},
+ #endif
+ #ifdef CONF_R_ERROR_LOADING_DSO
+ {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO},
+ #else
+ {"ERROR_LOADING_DSO", 14, 110},
+ #endif
+ #ifdef CONF_R_INVALID_PRAGMA
+ {"INVALID_PRAGMA", ERR_LIB_CONF, CONF_R_INVALID_PRAGMA},
+ #else
+ {"INVALID_PRAGMA", 14, 122},
+ #endif
+ #ifdef CONF_R_LIST_CANNOT_BE_NULL
+ {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL},
+ #else
+ {"LIST_CANNOT_BE_NULL", 14, 115},
+ #endif
+ #ifdef CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION
+ {"MANDATORY_BRACES_IN_VARIABLE_EXPANSION", ERR_LIB_CONF, CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION},
+ #else
+ {"MANDATORY_BRACES_IN_VARIABLE_EXPANSION", 14, 123},
+ #endif
+ #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET
+ {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET},
+ #else
+ {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100},
+ #endif
+ #ifdef CONF_R_MISSING_EQUAL_SIGN
+ {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN},
+ #else
+ {"MISSING_EQUAL_SIGN", 14, 101},
+ #endif
+ #ifdef CONF_R_MISSING_INIT_FUNCTION
+ {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION},
+ #else
+ {"MISSING_INIT_FUNCTION", 14, 112},
+ #endif
+ #ifdef CONF_R_MODULE_INITIALIZATION_ERROR
+ {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR},
+ #else
+ {"MODULE_INITIALIZATION_ERROR", 14, 109},
+ #endif
+ #ifdef CONF_R_NO_CLOSE_BRACE
+ {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE},
+ #else
+ {"NO_CLOSE_BRACE", 14, 102},
+ #endif
+ #ifdef CONF_R_NO_CONF
+ {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF},
+ #else
+ {"NO_CONF", 14, 105},
+ #endif
+ #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE},
+ #else
+ {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106},
+ #endif
+ #ifdef CONF_R_NO_SECTION
+ {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION},
+ #else
+ {"NO_SECTION", 14, 107},
+ #endif
+ #ifdef CONF_R_NO_SUCH_FILE
+ {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE},
+ #else
+ {"NO_SUCH_FILE", 14, 114},
+ #endif
+ #ifdef CONF_R_NO_VALUE
+ {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE},
+ #else
+ {"NO_VALUE", 14, 108},
+ #endif
+ #ifdef CONF_R_NUMBER_TOO_LARGE
+ {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE},
+ #else
+ {"NUMBER_TOO_LARGE", 14, 121},
+ #endif
+ #ifdef CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION
+ {"OPENSSL_CONF_REFERENCES_MISSING_SECTION", ERR_LIB_CONF, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION},
+ #else
+ {"OPENSSL_CONF_REFERENCES_MISSING_SECTION", 14, 124},
+ #endif
+ #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE
+ {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE},
+ #else
+ {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111},
+ #endif
+ #ifdef CONF_R_RELATIVE_PATH
+ {"RELATIVE_PATH", ERR_LIB_CONF, CONF_R_RELATIVE_PATH},
+ #else
+ {"RELATIVE_PATH", 14, 125},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 14, 117},
+ #endif
+ #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 14, 119},
+ #endif
+ #ifdef CONF_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 14, 120},
+ #endif
+ #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION
+ {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION},
+ #else
+ {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103},
+ #endif
+ #ifdef CONF_R_UNKNOWN_MODULE_NAME
+ {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME},
+ #else
+ {"UNKNOWN_MODULE_NAME", 14, 113},
+ #endif
+ #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG
+ {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG},
+ #else
+ {"VARIABLE_EXPANSION_TOO_LONG", 14, 116},
+ #endif
+ #ifdef CONF_R_VARIABLE_HAS_NO_VALUE
+ {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE},
+ #else
+ {"VARIABLE_HAS_NO_VALUE", 14, 104},
+ #endif
+ #ifdef CRMF_R_BAD_PBM_ITERATIONCOUNT
+ {"BAD_PBM_ITERATIONCOUNT", ERR_LIB_CRMF, CRMF_R_BAD_PBM_ITERATIONCOUNT},
+ #else
+ {"BAD_PBM_ITERATIONCOUNT", 56, 100},
+ #endif
+ #ifdef CRMF_R_CRMFERROR
+ {"CRMFERROR", ERR_LIB_CRMF, CRMF_R_CRMFERROR},
+ #else
+ {"CRMFERROR", 56, 102},
+ #endif
+ #ifdef CRMF_R_ERROR
+ {"ERROR", ERR_LIB_CRMF, CRMF_R_ERROR},
+ #else
+ {"ERROR", 56, 103},
+ #endif
+ #ifdef CRMF_R_ERROR_DECODING_CERTIFICATE
+ {"ERROR_DECODING_CERTIFICATE", ERR_LIB_CRMF, CRMF_R_ERROR_DECODING_CERTIFICATE},
+ #else
+ {"ERROR_DECODING_CERTIFICATE", 56, 104},
+ #endif
+ #ifdef CRMF_R_ERROR_DECRYPTING_CERTIFICATE
+ {"ERROR_DECRYPTING_CERTIFICATE", ERR_LIB_CRMF, CRMF_R_ERROR_DECRYPTING_CERTIFICATE},
+ #else
+ {"ERROR_DECRYPTING_CERTIFICATE", 56, 105},
+ #endif
+ #ifdef CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY
+ {"ERROR_DECRYPTING_SYMMETRIC_KEY", ERR_LIB_CRMF, CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY},
+ #else
+ {"ERROR_DECRYPTING_SYMMETRIC_KEY", 56, 106},
+ #endif
+ #ifdef CRMF_R_FAILURE_OBTAINING_RANDOM
+ {"FAILURE_OBTAINING_RANDOM", ERR_LIB_CRMF, CRMF_R_FAILURE_OBTAINING_RANDOM},
+ #else
+ {"FAILURE_OBTAINING_RANDOM", 56, 107},
+ #endif
+ #ifdef CRMF_R_ITERATIONCOUNT_BELOW_100
+ {"ITERATIONCOUNT_BELOW_100", ERR_LIB_CRMF, CRMF_R_ITERATIONCOUNT_BELOW_100},
+ #else
+ {"ITERATIONCOUNT_BELOW_100", 56, 108},
+ #endif
+ #ifdef CRMF_R_MALFORMED_IV
+ {"MALFORMED_IV", ERR_LIB_CRMF, CRMF_R_MALFORMED_IV},
+ #else
+ {"MALFORMED_IV", 56, 101},
+ #endif
+ #ifdef CRMF_R_NULL_ARGUMENT
+ {"NULL_ARGUMENT", ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT},
+ #else
+ {"NULL_ARGUMENT", 56, 109},
+ #endif
+ #ifdef CRMF_R_POPOSKINPUT_NOT_SUPPORTED
+ {"POPOSKINPUT_NOT_SUPPORTED", ERR_LIB_CRMF, CRMF_R_POPOSKINPUT_NOT_SUPPORTED},
+ #else
+ {"POPOSKINPUT_NOT_SUPPORTED", 56, 113},
+ #endif
+ #ifdef CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY
+ {"POPO_INCONSISTENT_PUBLIC_KEY", ERR_LIB_CRMF, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY},
+ #else
+ {"POPO_INCONSISTENT_PUBLIC_KEY", 56, 117},
+ #endif
+ #ifdef CRMF_R_POPO_MISSING
+ {"POPO_MISSING", ERR_LIB_CRMF, CRMF_R_POPO_MISSING},
+ #else
+ {"POPO_MISSING", 56, 121},
+ #endif
+ #ifdef CRMF_R_POPO_MISSING_PUBLIC_KEY
+ {"POPO_MISSING_PUBLIC_KEY", ERR_LIB_CRMF, CRMF_R_POPO_MISSING_PUBLIC_KEY},
+ #else
+ {"POPO_MISSING_PUBLIC_KEY", 56, 118},
+ #endif
+ #ifdef CRMF_R_POPO_MISSING_SUBJECT
+ {"POPO_MISSING_SUBJECT", ERR_LIB_CRMF, CRMF_R_POPO_MISSING_SUBJECT},
+ #else
+ {"POPO_MISSING_SUBJECT", 56, 119},
+ #endif
+ #ifdef CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED
+ {"POPO_RAVERIFIED_NOT_ACCEPTED", ERR_LIB_CRMF, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED},
+ #else
+ {"POPO_RAVERIFIED_NOT_ACCEPTED", 56, 120},
+ #endif
+ #ifdef CRMF_R_SETTING_MAC_ALGOR_FAILURE
+ {"SETTING_MAC_ALGOR_FAILURE", ERR_LIB_CRMF, CRMF_R_SETTING_MAC_ALGOR_FAILURE},
+ #else
+ {"SETTING_MAC_ALGOR_FAILURE", 56, 110},
+ #endif
+ #ifdef CRMF_R_SETTING_OWF_ALGOR_FAILURE
+ {"SETTING_OWF_ALGOR_FAILURE", ERR_LIB_CRMF, CRMF_R_SETTING_OWF_ALGOR_FAILURE},
+ #else
+ {"SETTING_OWF_ALGOR_FAILURE", 56, 111},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 56, 112},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 56, 114},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO
+ {"UNSUPPORTED_METHOD_FOR_CREATING_POPO", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO},
+ #else
+ {"UNSUPPORTED_METHOD_FOR_CREATING_POPO", 56, 115},
+ #endif
+ #ifdef CRMF_R_UNSUPPORTED_POPO_METHOD
+ {"UNSUPPORTED_POPO_METHOD", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_POPO_METHOD},
+ #else
+ {"UNSUPPORTED_POPO_METHOD", 56, 116},
+ #endif
+ #ifdef CRYPTO_R_BAD_ALGORITHM_NAME
+ {"BAD_ALGORITHM_NAME", ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME},
+ #else
+ {"BAD_ALGORITHM_NAME", 15, 117},
+ #endif
+ #ifdef CRYPTO_R_CONFLICTING_NAMES
+ {"CONFLICTING_NAMES", ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES},
+ #else
+ {"CONFLICTING_NAMES", 15, 118},
+ #endif
+ #ifdef CRYPTO_R_HEX_STRING_TOO_SHORT
+ {"HEX_STRING_TOO_SHORT", ERR_LIB_CRYPTO, CRYPTO_R_HEX_STRING_TOO_SHORT},
+ #else
+ {"HEX_STRING_TOO_SHORT", 15, 121},
+ #endif
+ #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT
+ {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT},
+ #else
+ {"ILLEGAL_HEX_DIGIT", 15, 102},
+ #endif
+ #ifdef CRYPTO_R_INSUFFICIENT_DATA_SPACE
+ {"INSUFFICIENT_DATA_SPACE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_DATA_SPACE},
+ #else
+ {"INSUFFICIENT_DATA_SPACE", 15, 106},
+ #endif
+ #ifdef CRYPTO_R_INSUFFICIENT_PARAM_SIZE
+ {"INSUFFICIENT_PARAM_SIZE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_PARAM_SIZE},
+ #else
+ {"INSUFFICIENT_PARAM_SIZE", 15, 107},
+ #endif
+ #ifdef CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE
+ {"INSUFFICIENT_SECURE_DATA_SPACE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE},
+ #else
+ {"INSUFFICIENT_SECURE_DATA_SPACE", 15, 108},
+ #endif
+ #ifdef CRYPTO_R_INTEGER_OVERFLOW
+ {"INTEGER_OVERFLOW", ERR_LIB_CRYPTO, CRYPTO_R_INTEGER_OVERFLOW},
+ #else
+ {"INTEGER_OVERFLOW", 15, 127},
+ #endif
+ #ifdef CRYPTO_R_INVALID_NEGATIVE_VALUE
+ {"INVALID_NEGATIVE_VALUE", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_NEGATIVE_VALUE},
+ #else
+ {"INVALID_NEGATIVE_VALUE", 15, 122},
+ #endif
+ #ifdef CRYPTO_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 15, 109},
+ #endif
+ #ifdef CRYPTO_R_INVALID_OSSL_PARAM_TYPE
+ {"INVALID_OSSL_PARAM_TYPE", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_OSSL_PARAM_TYPE},
+ #else
+ {"INVALID_OSSL_PARAM_TYPE", 15, 110},
+ #endif
+ #ifdef CRYPTO_R_NO_PARAMS_TO_MERGE
+ {"NO_PARAMS_TO_MERGE", ERR_LIB_CRYPTO, CRYPTO_R_NO_PARAMS_TO_MERGE},
+ #else
+ {"NO_PARAMS_TO_MERGE", 15, 131},
+ #endif
+ #ifdef CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL
+ {"NO_SPACE_FOR_TERMINATING_NULL", ERR_LIB_CRYPTO, CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL},
+ #else
+ {"NO_SPACE_FOR_TERMINATING_NULL", 15, 128},
+ #endif
+ #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS
+ {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS},
+ #else
+ {"ODD_NUMBER_OF_DIGITS", 15, 103},
+ #endif
+ #ifdef CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY
+ {"PARAM_CANNOT_BE_REPRESENTED_EXACTLY", ERR_LIB_CRYPTO, CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY},
+ #else
+ {"PARAM_CANNOT_BE_REPRESENTED_EXACTLY", 15, 123},
+ #endif
+ #ifdef CRYPTO_R_PARAM_NOT_INTEGER_TYPE
+ {"PARAM_NOT_INTEGER_TYPE", ERR_LIB_CRYPTO, CRYPTO_R_PARAM_NOT_INTEGER_TYPE},
+ #else
+ {"PARAM_NOT_INTEGER_TYPE", 15, 124},
+ #endif
+ #ifdef CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE
+ {"PARAM_OF_INCOMPATIBLE_TYPE", ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE},
+ #else
+ {"PARAM_OF_INCOMPATIBLE_TYPE", 15, 129},
+ #endif
+ #ifdef CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED
+ {"PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED},
+ #else
+ {"PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED", 15, 125},
+ #endif
+ #ifdef CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT
+ {"PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT", ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT},
+ #else
+ {"PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT", 15, 130},
+ #endif
+ #ifdef CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION
+ {"PARAM_VALUE_TOO_LARGE_FOR_DESTINATION", ERR_LIB_CRYPTO, CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION},
+ #else
+ {"PARAM_VALUE_TOO_LARGE_FOR_DESTINATION", 15, 126},
+ #endif
+ #ifdef CRYPTO_R_PROVIDER_ALREADY_EXISTS
+ {"PROVIDER_ALREADY_EXISTS", ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_ALREADY_EXISTS},
+ #else
+ {"PROVIDER_ALREADY_EXISTS", 15, 104},
+ #endif
+ #ifdef CRYPTO_R_PROVIDER_SECTION_ERROR
+ {"PROVIDER_SECTION_ERROR", ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_SECTION_ERROR},
+ #else
+ {"PROVIDER_SECTION_ERROR", 15, 105},
+ #endif
+ #ifdef CRYPTO_R_RANDOM_SECTION_ERROR
+ {"RANDOM_SECTION_ERROR", ERR_LIB_CRYPTO, CRYPTO_R_RANDOM_SECTION_ERROR},
+ #else
+ {"RANDOM_SECTION_ERROR", 15, 119},
+ #endif
+ #ifdef CRYPTO_R_SECURE_MALLOC_FAILURE
+ {"SECURE_MALLOC_FAILURE", ERR_LIB_CRYPTO, CRYPTO_R_SECURE_MALLOC_FAILURE},
+ #else
+ {"SECURE_MALLOC_FAILURE", 15, 111},
+ #endif
+ #ifdef CRYPTO_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_CRYPTO, CRYPTO_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 15, 112},
+ #endif
+ #ifdef CRYPTO_R_TOO_MANY_BYTES
+ {"TOO_MANY_BYTES", ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES},
+ #else
+ {"TOO_MANY_BYTES", 15, 113},
+ #endif
+ #ifdef CRYPTO_R_TOO_MANY_RECORDS
+ {"TOO_MANY_RECORDS", ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS},
+ #else
+ {"TOO_MANY_RECORDS", 15, 114},
+ #endif
+ #ifdef CRYPTO_R_TOO_SMALL_BUFFER
+ {"TOO_SMALL_BUFFER", ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER},
+ #else
+ {"TOO_SMALL_BUFFER", 15, 116},
+ #endif
+ #ifdef CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION
+ {"UNKNOWN_NAME_IN_RANDOM_SECTION", ERR_LIB_CRYPTO, CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION},
+ #else
+ {"UNKNOWN_NAME_IN_RANDOM_SECTION", 15, 120},
+ #endif
+ #ifdef CRYPTO_R_ZERO_LENGTH_NUMBER
+ {"ZERO_LENGTH_NUMBER", ERR_LIB_CRYPTO, CRYPTO_R_ZERO_LENGTH_NUMBER},
+ #else
+ {"ZERO_LENGTH_NUMBER", 15, 115},
+ #endif
+ #ifdef CT_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 50, 108},
+ #endif
+ #ifdef CT_R_INVALID_LOG_ID_LENGTH
+ {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH},
+ #else
+ {"INVALID_LOG_ID_LENGTH", 50, 100},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID
+ {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID},
+ #else
+ {"LOG_CONF_INVALID", 50, 109},
+ #endif
+ #ifdef CT_R_LOG_CONF_INVALID_KEY
+ {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY},
+ #else
+ {"LOG_CONF_INVALID_KEY", 50, 110},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION
+ {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION},
+ #else
+ {"LOG_CONF_MISSING_DESCRIPTION", 50, 111},
+ #endif
+ #ifdef CT_R_LOG_CONF_MISSING_KEY
+ {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY},
+ #else
+ {"LOG_CONF_MISSING_KEY", 50, 112},
+ #endif
+ #ifdef CT_R_LOG_KEY_INVALID
+ {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID},
+ #else
+ {"LOG_KEY_INVALID", 50, 113},
+ #endif
+ #ifdef CT_R_SCT_FUTURE_TIMESTAMP
+ {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP},
+ #else
+ {"SCT_FUTURE_TIMESTAMP", 50, 116},
+ #endif
+ #ifdef CT_R_SCT_INVALID
+ {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID},
+ #else
+ {"SCT_INVALID", 50, 104},
+ #endif
+ #ifdef CT_R_SCT_INVALID_SIGNATURE
+ {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE},
+ #else
+ {"SCT_INVALID_SIGNATURE", 50, 107},
+ #endif
+ #ifdef CT_R_SCT_LIST_INVALID
+ {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID},
+ #else
+ {"SCT_LIST_INVALID", 50, 105},
+ #endif
+ #ifdef CT_R_SCT_LOG_ID_MISMATCH
+ {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH},
+ #else
+ {"SCT_LOG_ID_MISMATCH", 50, 114},
+ #endif
+ #ifdef CT_R_SCT_NOT_SET
+ {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET},
+ #else
+ {"SCT_NOT_SET", 50, 106},
+ #endif
+ #ifdef CT_R_SCT_UNSUPPORTED_VERSION
+ {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION},
+ #else
+ {"SCT_UNSUPPORTED_VERSION", 50, 115},
+ #endif
+ #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID
+ {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID},
+ #else
+ {"UNRECOGNIZED_SIGNATURE_NID", 50, 101},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE
+ {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE},
+ #else
+ {"UNSUPPORTED_ENTRY_TYPE", 50, 102},
+ #endif
+ #ifdef CT_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 50, 103},
+ #endif
+ #ifdef DH_R_BAD_FFC_PARAMETERS
+ {"BAD_FFC_PARAMETERS", ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS},
+ #else
+ {"BAD_FFC_PARAMETERS", 5, 127},
+ #endif
+ #ifdef DH_R_BAD_GENERATOR
+ {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR},
+ #else
+ {"BAD_GENERATOR", 5, 101},
+ #endif
+ #ifdef DH_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 5, 109},
+ #endif
+ #ifdef DH_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 5, 106},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_J_VALUE
+ {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE},
+ #else
+ {"CHECK_INVALID_J_VALUE", 5, 115},
+ #endif
+ #ifdef DH_R_CHECK_INVALID_Q_VALUE
+ {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE},
+ #else
+ {"CHECK_INVALID_Q_VALUE", 5, 116},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_INVALID
+ {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID},
+ #else
+ {"CHECK_PUBKEY_INVALID", 5, 122},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE
+ {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE},
+ #else
+ {"CHECK_PUBKEY_TOO_LARGE", 5, 123},
+ #endif
+ #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL
+ {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL},
+ #else
+ {"CHECK_PUBKEY_TOO_SMALL", 5, 124},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_PRIME
+ {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME},
+ #else
+ {"CHECK_P_NOT_PRIME", 5, 117},
+ #endif
+ #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME
+ {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME},
+ #else
+ {"CHECK_P_NOT_SAFE_PRIME", 5, 118},
+ #endif
+ #ifdef DH_R_CHECK_Q_NOT_PRIME
+ {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME},
+ #else
+ {"CHECK_Q_NOT_PRIME", 5, 119},
+ #endif
+ #ifdef DH_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 5, 104},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NAME
+ {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME},
+ #else
+ {"INVALID_PARAMETER_NAME", 5, 110},
+ #endif
+ #ifdef DH_R_INVALID_PARAMETER_NID
+ {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID},
+ #else
+ {"INVALID_PARAMETER_NID", 5, 114},
+ #endif
+ #ifdef DH_R_INVALID_PUBKEY
+ {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY},
+ #else
+ {"INVALID_PUBKEY", 5, 102},
+ #endif
+ #ifdef DH_R_INVALID_SECRET
+ {"INVALID_SECRET", ERR_LIB_DH, DH_R_INVALID_SECRET},
+ #else
+ {"INVALID_SECRET", 5, 128},
+ #endif
+ #ifdef DH_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 5, 112},
+ #endif
+ #ifdef DH_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 5, 108},
+ #endif
+ #ifdef DH_R_MISSING_PUBKEY
+ {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY},
+ #else
+ {"MISSING_PUBKEY", 5, 125},
+ #endif
+ #ifdef DH_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 5, 103},
+ #endif
+ #ifdef DH_R_MODULUS_TOO_SMALL
+ {"MODULUS_TOO_SMALL", ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL},
+ #else
+ {"MODULUS_TOO_SMALL", 5, 126},
+ #endif
+ #ifdef DH_R_NOT_SUITABLE_GENERATOR
+ {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR},
+ #else
+ {"NOT_SUITABLE_GENERATOR", 5, 120},
+ #endif
+ #ifdef DH_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 5, 107},
+ #endif
+ #ifdef DH_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 5, 100},
+ #endif
+ #ifdef DH_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 5, 105},
+ #endif
+ #ifdef DH_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 5, 111},
+ #endif
+ #ifdef DH_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 5, 113},
+ #endif
+ #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR
+ {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR},
+ #else
+ {"UNABLE_TO_CHECK_GENERATOR", 5, 121},
+ #endif
+ #ifdef DSA_R_BAD_FFC_PARAMETERS
+ {"BAD_FFC_PARAMETERS", ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS},
+ #else
+ {"BAD_FFC_PARAMETERS", 10, 114},
+ #endif
+ #ifdef DSA_R_BAD_Q_VALUE
+ {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE},
+ #else
+ {"BAD_Q_VALUE", 10, 102},
+ #endif
+ #ifdef DSA_R_BN_DECODE_ERROR
+ {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR},
+ #else
+ {"BN_DECODE_ERROR", 10, 108},
+ #endif
+ #ifdef DSA_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 10, 109},
+ #endif
+ #ifdef DSA_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 10, 104},
+ #endif
+ #ifdef DSA_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 10, 106},
+ #endif
+ #ifdef DSA_R_INVALID_PARAMETERS
+ {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS},
+ #else
+ {"INVALID_PARAMETERS", 10, 112},
+ #endif
+ #ifdef DSA_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 10, 101},
+ #endif
+ #ifdef DSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 10, 111},
+ #endif
+ #ifdef DSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 10, 103},
+ #endif
+ #ifdef DSA_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 10, 107},
+ #endif
+ #ifdef DSA_R_PARAMETER_ENCODING_ERROR
+ {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR},
+ #else
+ {"PARAMETER_ENCODING_ERROR", 10, 105},
+ #endif
+ #ifdef DSA_R_P_NOT_PRIME
+ {"P_NOT_PRIME", ERR_LIB_DSA, DSA_R_P_NOT_PRIME},
+ #else
+ {"P_NOT_PRIME", 10, 115},
+ #endif
+ #ifdef DSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 10, 113},
+ #endif
+ #ifdef DSA_R_SEED_LEN_SMALL
+ {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL},
+ #else
+ {"SEED_LEN_SMALL", 10, 110},
+ #endif
+ #ifdef DSA_R_TOO_MANY_RETRIES
+ {"TOO_MANY_RETRIES", ERR_LIB_DSA, DSA_R_TOO_MANY_RETRIES},
+ #else
+ {"TOO_MANY_RETRIES", 10, 116},
+ #endif
+ #ifdef DSO_R_CTRL_FAILED
+ {"CTRL_FAILED", ERR_LIB_DSO, DSO_R_CTRL_FAILED},
+ #else
+ {"CTRL_FAILED", 37, 100},
+ #endif
+ #ifdef DSO_R_DSO_ALREADY_LOADED
+ {"DSO_ALREADY_LOADED", ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED},
+ #else
+ {"DSO_ALREADY_LOADED", 37, 110},
+ #endif
+ #ifdef DSO_R_EMPTY_FILE_STRUCTURE
+ {"EMPTY_FILE_STRUCTURE", ERR_LIB_DSO, DSO_R_EMPTY_FILE_STRUCTURE},
+ #else
+ {"EMPTY_FILE_STRUCTURE", 37, 113},
+ #endif
+ #ifdef DSO_R_FAILURE
+ {"FAILURE", ERR_LIB_DSO, DSO_R_FAILURE},
+ #else
+ {"FAILURE", 37, 114},
+ #endif
+ #ifdef DSO_R_FILENAME_TOO_BIG
+ {"FILENAME_TOO_BIG", ERR_LIB_DSO, DSO_R_FILENAME_TOO_BIG},
+ #else
+ {"FILENAME_TOO_BIG", 37, 101},
+ #endif
+ #ifdef DSO_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_DSO, DSO_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 37, 102},
+ #endif
+ #ifdef DSO_R_INCORRECT_FILE_SYNTAX
+ {"INCORRECT_FILE_SYNTAX", ERR_LIB_DSO, DSO_R_INCORRECT_FILE_SYNTAX},
+ #else
+ {"INCORRECT_FILE_SYNTAX", 37, 115},
+ #endif
+ #ifdef DSO_R_LOAD_FAILED
+ {"LOAD_FAILED", ERR_LIB_DSO, DSO_R_LOAD_FAILED},
+ #else
+ {"LOAD_FAILED", 37, 103},
+ #endif
+ #ifdef DSO_R_NAME_TRANSLATION_FAILED
+ {"NAME_TRANSLATION_FAILED", ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED},
+ #else
+ {"NAME_TRANSLATION_FAILED", 37, 109},
+ #endif
+ #ifdef DSO_R_NO_FILENAME
+ {"NO_FILENAME", ERR_LIB_DSO, DSO_R_NO_FILENAME},
+ #else
+ {"NO_FILENAME", 37, 111},
+ #endif
+ #ifdef DSO_R_NULL_HANDLE
+ {"NULL_HANDLE", ERR_LIB_DSO, DSO_R_NULL_HANDLE},
+ #else
+ {"NULL_HANDLE", 37, 104},
+ #endif
+ #ifdef DSO_R_SET_FILENAME_FAILED
+ {"SET_FILENAME_FAILED", ERR_LIB_DSO, DSO_R_SET_FILENAME_FAILED},
+ #else
+ {"SET_FILENAME_FAILED", 37, 112},
+ #endif
+ #ifdef DSO_R_STACK_ERROR
+ {"STACK_ERROR", ERR_LIB_DSO, DSO_R_STACK_ERROR},
+ #else
+ {"STACK_ERROR", 37, 105},
+ #endif
+ #ifdef DSO_R_SYM_FAILURE
+ {"SYM_FAILURE", ERR_LIB_DSO, DSO_R_SYM_FAILURE},
+ #else
+ {"SYM_FAILURE", 37, 106},
+ #endif
+ #ifdef DSO_R_UNLOAD_FAILED
+ {"UNLOAD_FAILED", ERR_LIB_DSO, DSO_R_UNLOAD_FAILED},
+ #else
+ {"UNLOAD_FAILED", 37, 107},
+ #endif
+ #ifdef DSO_R_UNSUPPORTED
+ {"UNSUPPORTED", ERR_LIB_DSO, DSO_R_UNSUPPORTED},
+ #else
+ {"UNSUPPORTED", 37, 108},
+ #endif
+ #ifdef EC_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 16, 115},
+ #endif
+ #ifdef EC_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 16, 156},
+ #endif
+ #ifdef EC_R_BIGNUM_OUT_OF_RANGE
+ {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE},
+ #else
+ {"BIGNUM_OUT_OF_RANGE", 16, 144},
+ #endif
+ #ifdef EC_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 16, 100},
+ #endif
+ #ifdef EC_R_CANNOT_INVERT
+ {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT},
+ #else
+ {"CANNOT_INVERT", 16, 165},
+ #endif
+ #ifdef EC_R_COORDINATES_OUT_OF_RANGE
+ {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE},
+ #else
+ {"COORDINATES_OUT_OF_RANGE", 16, 146},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA
+ {"CURVE_DOES_NOT_SUPPORT_ECDSA", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_ECDSA", 16, 170},
+ #endif
+ #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING},
+ #else
+ {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159},
+ #endif
+ #ifdef EC_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 16, 142},
+ #endif
+ #ifdef EC_R_DISCRIMINANT_IS_ZERO
+ {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO},
+ #else
+ {"DISCRIMINANT_IS_ZERO", 16, 118},
+ #endif
+ #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE},
+ #else
+ {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119},
+ #endif
+ #ifdef EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED
+ {"EXPLICIT_PARAMS_NOT_SUPPORTED", ERR_LIB_EC, EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED},
+ #else
+ {"EXPLICIT_PARAMS_NOT_SUPPORTED", 16, 127},
+ #endif
+ #ifdef EC_R_FAILED_MAKING_PUBLIC_KEY
+ {"FAILED_MAKING_PUBLIC_KEY", ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY},
+ #else
+ {"FAILED_MAKING_PUBLIC_KEY", 16, 166},
+ #endif
+ #ifdef EC_R_FIELD_TOO_LARGE
+ {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE},
+ #else
+ {"FIELD_TOO_LARGE", 16, 143},
+ #endif
+ #ifdef EC_R_GF2M_NOT_SUPPORTED
+ {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED},
+ #else
+ {"GF2M_NOT_SUPPORTED", 16, 147},
+ #endif
+ #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE
+ {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE},
+ #else
+ {"GROUP2PKPARAMETERS_FAILURE", 16, 120},
+ #endif
+ #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE
+ {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE},
+ #else
+ {"I2D_ECPKPARAMETERS_FAILURE", 16, 121},
+ #endif
+ #ifdef EC_R_INCOMPATIBLE_OBJECTS
+ {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS},
+ #else
+ {"INCOMPATIBLE_OBJECTS", 16, 101},
+ #endif
+ #ifdef EC_R_INVALID_A
+ {"INVALID_A", ERR_LIB_EC, EC_R_INVALID_A},
+ #else
+ {"INVALID_A", 16, 168},
+ #endif
+ #ifdef EC_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 16, 112},
+ #endif
+ #ifdef EC_R_INVALID_B
+ {"INVALID_B", ERR_LIB_EC, EC_R_INVALID_B},
+ #else
+ {"INVALID_B", 16, 169},
+ #endif
+ #ifdef EC_R_INVALID_COFACTOR
+ {"INVALID_COFACTOR", ERR_LIB_EC, EC_R_INVALID_COFACTOR},
+ #else
+ {"INVALID_COFACTOR", 16, 171},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSED_POINT
+ {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT},
+ #else
+ {"INVALID_COMPRESSED_POINT", 16, 110},
+ #endif
+ #ifdef EC_R_INVALID_COMPRESSION_BIT
+ {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT},
+ #else
+ {"INVALID_COMPRESSION_BIT", 16, 109},
+ #endif
+ #ifdef EC_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 16, 141},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 16, 151},
+ #endif
+ #ifdef EC_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 16, 138},
+ #endif
+ #ifdef EC_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 16, 102},
+ #endif
+ #ifdef EC_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 16, 103},
+ #endif
+ #ifdef EC_R_INVALID_FORM
+ {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM},
+ #else
+ {"INVALID_FORM", 16, 104},
+ #endif
+ #ifdef EC_R_INVALID_GENERATOR
+ {"INVALID_GENERATOR", ERR_LIB_EC, EC_R_INVALID_GENERATOR},
+ #else
+ {"INVALID_GENERATOR", 16, 173},
+ #endif
+ #ifdef EC_R_INVALID_GROUP_ORDER
+ {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER},
+ #else
+ {"INVALID_GROUP_ORDER", 16, 122},
+ #endif
+ #ifdef EC_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 16, 116},
+ #endif
+ #ifdef EC_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_EC, EC_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 16, 117},
+ #endif
+ #ifdef EC_R_INVALID_NAMED_GROUP_CONVERSION
+ {"INVALID_NAMED_GROUP_CONVERSION", ERR_LIB_EC, EC_R_INVALID_NAMED_GROUP_CONVERSION},
+ #else
+ {"INVALID_NAMED_GROUP_CONVERSION", 16, 174},
+ #endif
+ #ifdef EC_R_INVALID_OUTPUT_LENGTH
+ {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH},
+ #else
+ {"INVALID_OUTPUT_LENGTH", 16, 161},
+ #endif
+ #ifdef EC_R_INVALID_P
+ {"INVALID_P", ERR_LIB_EC, EC_R_INVALID_P},
+ #else
+ {"INVALID_P", 16, 172},
+ #endif
+ #ifdef EC_R_INVALID_PEER_KEY
+ {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY},
+ #else
+ {"INVALID_PEER_KEY", 16, 133},
+ #endif
+ #ifdef EC_R_INVALID_PENTANOMIAL_BASIS
+ {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS},
+ #else
+ {"INVALID_PENTANOMIAL_BASIS", 16, 132},
+ #endif
+ #ifdef EC_R_INVALID_PRIVATE_KEY
+ {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY},
+ #else
+ {"INVALID_PRIVATE_KEY", 16, 123},
+ #endif
+ #ifdef EC_R_INVALID_SEED
+ {"INVALID_SEED", ERR_LIB_EC, EC_R_INVALID_SEED},
+ #else
+ {"INVALID_SEED", 16, 175},
+ #endif
+ #ifdef EC_R_INVALID_TRINOMIAL_BASIS
+ {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS},
+ #else
+ {"INVALID_TRINOMIAL_BASIS", 16, 137},
+ #endif
+ #ifdef EC_R_KDF_PARAMETER_ERROR
+ {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR},
+ #else
+ {"KDF_PARAMETER_ERROR", 16, 148},
+ #endif
+ #ifdef EC_R_KEYS_NOT_SET
+ {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET},
+ #else
+ {"KEYS_NOT_SET", 16, 140},
+ #endif
+ #ifdef EC_R_LADDER_POST_FAILURE
+ {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE},
+ #else
+ {"LADDER_POST_FAILURE", 16, 136},
+ #endif
+ #ifdef EC_R_LADDER_PRE_FAILURE
+ {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE},
+ #else
+ {"LADDER_PRE_FAILURE", 16, 153},
+ #endif
+ #ifdef EC_R_LADDER_STEP_FAILURE
+ {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE},
+ #else
+ {"LADDER_STEP_FAILURE", 16, 162},
+ #endif
+ #ifdef EC_R_MISSING_OID
+ {"MISSING_OID", ERR_LIB_EC, EC_R_MISSING_OID},
+ #else
+ {"MISSING_OID", 16, 167},
+ #endif
+ #ifdef EC_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 16, 124},
+ #endif
+ #ifdef EC_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 16, 125},
+ #endif
+ #ifdef EC_R_NEED_NEW_SETUP_VALUES
+ {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES},
+ #else
+ {"NEED_NEW_SETUP_VALUES", 16, 157},
+ #endif
+ #ifdef EC_R_NOT_A_NIST_PRIME
+ {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME},
+ #else
+ {"NOT_A_NIST_PRIME", 16, 135},
+ #endif
+ #ifdef EC_R_NOT_IMPLEMENTED
+ {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED},
+ #else
+ {"NOT_IMPLEMENTED", 16, 126},
+ #endif
+ #ifdef EC_R_NOT_INITIALIZED
+ {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED},
+ #else
+ {"NOT_INITIALIZED", 16, 111},
+ #endif
+ #ifdef EC_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 16, 139},
+ #endif
+ #ifdef EC_R_NO_PRIVATE_VALUE
+ {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE},
+ #else
+ {"NO_PRIVATE_VALUE", 16, 154},
+ #endif
+ #ifdef EC_R_OPERATION_NOT_SUPPORTED
+ {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED},
+ #else
+ {"OPERATION_NOT_SUPPORTED", 16, 152},
+ #endif
+ #ifdef EC_R_PASSED_NULL_PARAMETER
+ {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER},
+ #else
+ {"PASSED_NULL_PARAMETER", 16, 134},
+ #endif
+ #ifdef EC_R_PEER_KEY_ERROR
+ {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR},
+ #else
+ {"PEER_KEY_ERROR", 16, 149},
+ #endif
+ #ifdef EC_R_POINT_ARITHMETIC_FAILURE
+ {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE},
+ #else
+ {"POINT_ARITHMETIC_FAILURE", 16, 155},
+ #endif
+ #ifdef EC_R_POINT_AT_INFINITY
+ {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY},
+ #else
+ {"POINT_AT_INFINITY", 16, 106},
+ #endif
+ #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE
+ {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE},
+ #else
+ {"POINT_COORDINATES_BLIND_FAILURE", 16, 163},
+ #endif
+ #ifdef EC_R_POINT_IS_NOT_ON_CURVE
+ {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE},
+ #else
+ {"POINT_IS_NOT_ON_CURVE", 16, 107},
+ #endif
+ #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED
+ {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED},
+ #else
+ {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158},
+ #endif
+ #ifdef EC_R_SHARED_INFO_ERROR
+ {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR},
+ #else
+ {"SHARED_INFO_ERROR", 16, 150},
+ #endif
+ #ifdef EC_R_SLOT_FULL
+ {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL},
+ #else
+ {"SLOT_FULL", 16, 108},
+ #endif
+ #ifdef EC_R_TOO_MANY_RETRIES
+ {"TOO_MANY_RETRIES", ERR_LIB_EC, EC_R_TOO_MANY_RETRIES},
+ #else
+ {"TOO_MANY_RETRIES", 16, 176},
+ #endif
+ #ifdef EC_R_UNDEFINED_GENERATOR
+ {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR},
+ #else
+ {"UNDEFINED_GENERATOR", 16, 113},
+ #endif
+ #ifdef EC_R_UNDEFINED_ORDER
+ {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER},
+ #else
+ {"UNDEFINED_ORDER", 16, 128},
+ #endif
+ #ifdef EC_R_UNKNOWN_COFACTOR
+ {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR},
+ #else
+ {"UNKNOWN_COFACTOR", 16, 164},
+ #endif
+ #ifdef EC_R_UNKNOWN_GROUP
+ {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP},
+ #else
+ {"UNKNOWN_GROUP", 16, 129},
+ #endif
+ #ifdef EC_R_UNKNOWN_ORDER
+ {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER},
+ #else
+ {"UNKNOWN_ORDER", 16, 114},
+ #endif
+ #ifdef EC_R_UNSUPPORTED_FIELD
+ {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD},
+ #else
+ {"UNSUPPORTED_FIELD", 16, 131},
+ #endif
+ #ifdef EC_R_WRONG_CURVE_PARAMETERS
+ {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS},
+ #else
+ {"WRONG_CURVE_PARAMETERS", 16, 145},
+ #endif
+ #ifdef EC_R_WRONG_ORDER
+ {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER},
+ #else
+ {"WRONG_ORDER", 16, 130},
+ #endif
+ #ifdef ENGINE_R_ALREADY_LOADED
+ {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED},
+ #else
+ {"ALREADY_LOADED", 38, 100},
+ #endif
+ #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER
+ {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER},
+ #else
+ {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133},
+ #endif
+ #ifdef ENGINE_R_CMD_NOT_EXECUTABLE
+ {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE},
+ #else
+ {"CMD_NOT_EXECUTABLE", 38, 134},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_INPUT
+ {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT},
+ #else
+ {"COMMAND_TAKES_INPUT", 38, 135},
+ #endif
+ #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT
+ {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT},
+ #else
+ {"COMMAND_TAKES_NO_INPUT", 38, 136},
+ #endif
+ #ifdef ENGINE_R_CONFLICTING_ENGINE_ID
+ {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID},
+ #else
+ {"CONFLICTING_ENGINE_ID", 38, 103},
+ #endif
+ #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119},
+ #endif
+ #ifdef ENGINE_R_DSO_FAILURE
+ {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE},
+ #else
+ {"DSO_FAILURE", 38, 104},
+ #endif
+ #ifdef ENGINE_R_DSO_NOT_FOUND
+ {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND},
+ #else
+ {"DSO_NOT_FOUND", 38, 132},
+ #endif
+ #ifdef ENGINE_R_ENGINES_SECTION_ERROR
+ {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR},
+ #else
+ {"ENGINES_SECTION_ERROR", 38, 148},
+ #endif
+ #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR
+ {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR},
+ #else
+ {"ENGINE_CONFIGURATION_ERROR", 38, 102},
+ #endif
+ #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST
+ {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST},
+ #else
+ {"ENGINE_IS_NOT_IN_LIST", 38, 105},
+ #endif
+ #ifdef ENGINE_R_ENGINE_SECTION_ERROR
+ {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR},
+ #else
+ {"ENGINE_SECTION_ERROR", 38, 149},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY
+ {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY},
+ #else
+ {"FAILED_LOADING_PRIVATE_KEY", 38, 128},
+ #endif
+ #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY
+ {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY},
+ #else
+ {"FAILED_LOADING_PUBLIC_KEY", 38, 129},
+ #endif
+ #ifdef ENGINE_R_FINISH_FAILED
+ {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED},
+ #else
+ {"FINISH_FAILED", 38, 106},
+ #endif
+ #ifdef ENGINE_R_ID_OR_NAME_MISSING
+ {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING},
+ #else
+ {"ID_OR_NAME_MISSING", 38, 108},
+ #endif
+ #ifdef ENGINE_R_INIT_FAILED
+ {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED},
+ #else
+ {"INIT_FAILED", 38, 109},
+ #endif
+ #ifdef ENGINE_R_INTERNAL_LIST_ERROR
+ {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR},
+ #else
+ {"INTERNAL_LIST_ERROR", 38, 110},
+ #endif
+ #ifdef ENGINE_R_INVALID_ARGUMENT
+ {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT},
+ #else
+ {"INVALID_ARGUMENT", 38, 143},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NAME
+ {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME},
+ #else
+ {"INVALID_CMD_NAME", 38, 137},
+ #endif
+ #ifdef ENGINE_R_INVALID_CMD_NUMBER
+ {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER},
+ #else
+ {"INVALID_CMD_NUMBER", 38, 138},
+ #endif
+ #ifdef ENGINE_R_INVALID_INIT_VALUE
+ {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE},
+ #else
+ {"INVALID_INIT_VALUE", 38, 151},
+ #endif
+ #ifdef ENGINE_R_INVALID_STRING
+ {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING},
+ #else
+ {"INVALID_STRING", 38, 150},
+ #endif
+ #ifdef ENGINE_R_NOT_INITIALISED
+ {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED},
+ #else
+ {"NOT_INITIALISED", 38, 117},
+ #endif
+ #ifdef ENGINE_R_NOT_LOADED
+ {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED},
+ #else
+ {"NOT_LOADED", 38, 112},
+ #endif
+ #ifdef ENGINE_R_NO_CONTROL_FUNCTION
+ {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION},
+ #else
+ {"NO_CONTROL_FUNCTION", 38, 120},
+ #endif
+ #ifdef ENGINE_R_NO_INDEX
+ {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX},
+ #else
+ {"NO_INDEX", 38, 144},
+ #endif
+ #ifdef ENGINE_R_NO_LOAD_FUNCTION
+ {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION},
+ #else
+ {"NO_LOAD_FUNCTION", 38, 125},
+ #endif
+ #ifdef ENGINE_R_NO_REFERENCE
+ {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE},
+ #else
+ {"NO_REFERENCE", 38, 130},
+ #endif
+ #ifdef ENGINE_R_NO_SUCH_ENGINE
+ {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE},
+ #else
+ {"NO_SUCH_ENGINE", 38, 116},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER
+ {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER},
+ #else
+ {"UNIMPLEMENTED_CIPHER", 38, 146},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST
+ {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST},
+ #else
+ {"UNIMPLEMENTED_DIGEST", 38, 147},
+ #endif
+ #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD},
+ #else
+ {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101},
+ #endif
+ #ifdef ENGINE_R_VERSION_INCOMPATIBILITY
+ {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY},
+ #else
+ {"VERSION_INCOMPATIBILITY", 38, 145},
+ #endif
+ #ifdef ESS_R_EMPTY_ESS_CERT_ID_LIST
+ {"EMPTY_ESS_CERT_ID_LIST", ERR_LIB_ESS, ESS_R_EMPTY_ESS_CERT_ID_LIST},
+ #else
+ {"EMPTY_ESS_CERT_ID_LIST", 54, 107},
+ #endif
+ #ifdef ESS_R_ESS_CERT_DIGEST_ERROR
+ {"ESS_CERT_DIGEST_ERROR", ERR_LIB_ESS, ESS_R_ESS_CERT_DIGEST_ERROR},
+ #else
+ {"ESS_CERT_DIGEST_ERROR", 54, 103},
+ #endif
+ #ifdef ESS_R_ESS_CERT_ID_NOT_FOUND
+ {"ESS_CERT_ID_NOT_FOUND", ERR_LIB_ESS, ESS_R_ESS_CERT_ID_NOT_FOUND},
+ #else
+ {"ESS_CERT_ID_NOT_FOUND", 54, 104},
+ #endif
+ #ifdef ESS_R_ESS_CERT_ID_WRONG_ORDER
+ {"ESS_CERT_ID_WRONG_ORDER", ERR_LIB_ESS, ESS_R_ESS_CERT_ID_WRONG_ORDER},
+ #else
+ {"ESS_CERT_ID_WRONG_ORDER", 54, 105},
+ #endif
+ #ifdef ESS_R_ESS_DIGEST_ALG_UNKNOWN
+ {"ESS_DIGEST_ALG_UNKNOWN", ERR_LIB_ESS, ESS_R_ESS_DIGEST_ALG_UNKNOWN},
+ #else
+ {"ESS_DIGEST_ALG_UNKNOWN", 54, 106},
+ #endif
+ #ifdef ESS_R_ESS_SIGNING_CERTIFICATE_ERROR
+ {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+ #else
+ {"ESS_SIGNING_CERTIFICATE_ERROR", 54, 102},
+ #endif
+ #ifdef ESS_R_ESS_SIGNING_CERT_ADD_ERROR
+ {"ESS_SIGNING_CERT_ADD_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERT_ADD_ERROR},
+ #else
+ {"ESS_SIGNING_CERT_ADD_ERROR", 54, 100},
+ #endif
+ #ifdef ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR
+ {"ESS_SIGNING_CERT_V2_ADD_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR},
+ #else
+ {"ESS_SIGNING_CERT_V2_ADD_ERROR", 54, 101},
+ #endif
+ #ifdef ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE
+ {"MISSING_SIGNING_CERTIFICATE_ATTRIBUTE", ERR_LIB_ESS, ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE},
+ #else
+ {"MISSING_SIGNING_CERTIFICATE_ATTRIBUTE", 54, 108},
+ #endif
+ #ifdef EVP_R_AES_KEY_SETUP_FAILED
+ {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED},
+ #else
+ {"AES_KEY_SETUP_FAILED", 6, 143},
+ #endif
+ #ifdef EVP_R_ARIA_KEY_SETUP_FAILED
+ {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED},
+ #else
+ {"ARIA_KEY_SETUP_FAILED", 6, 176},
+ #endif
+ #ifdef EVP_R_BAD_ALGORITHM_NAME
+ {"BAD_ALGORITHM_NAME", ERR_LIB_EVP, EVP_R_BAD_ALGORITHM_NAME},
+ #else
+ {"BAD_ALGORITHM_NAME", 6, 200},
+ #endif
+ #ifdef EVP_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 6, 100},
+ #endif
+ #ifdef EVP_R_BAD_KEY_LENGTH
+ {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH},
+ #else
+ {"BAD_KEY_LENGTH", 6, 195},
+ #endif
+ #ifdef EVP_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 6, 155},
+ #endif
+ #ifdef EVP_R_CACHE_CONSTANTS_FAILED
+ {"CACHE_CONSTANTS_FAILED", ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED},
+ #else
+ {"CACHE_CONSTANTS_FAILED", 6, 225},
+ #endif
+ #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED
+ {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED},
+ #else
+ {"CAMELLIA_KEY_SETUP_FAILED", 6, 157},
+ #endif
+ #ifdef EVP_R_CANNOT_GET_PARAMETERS
+ {"CANNOT_GET_PARAMETERS", ERR_LIB_EVP, EVP_R_CANNOT_GET_PARAMETERS},
+ #else
+ {"CANNOT_GET_PARAMETERS", 6, 197},
+ #endif
+ #ifdef EVP_R_CANNOT_SET_PARAMETERS
+ {"CANNOT_SET_PARAMETERS", ERR_LIB_EVP, EVP_R_CANNOT_SET_PARAMETERS},
+ #else
+ {"CANNOT_SET_PARAMETERS", 6, 198},
+ #endif
+ #ifdef EVP_R_CIPHER_NOT_GCM_MODE
+ {"CIPHER_NOT_GCM_MODE", ERR_LIB_EVP, EVP_R_CIPHER_NOT_GCM_MODE},
+ #else
+ {"CIPHER_NOT_GCM_MODE", 6, 184},
+ #endif
+ #ifdef EVP_R_CIPHER_PARAMETER_ERROR
+ {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR},
+ #else
+ {"CIPHER_PARAMETER_ERROR", 6, 122},
+ #endif
+ #ifdef EVP_R_COMMAND_NOT_SUPPORTED
+ {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED},
+ #else
+ {"COMMAND_NOT_SUPPORTED", 6, 147},
+ #endif
+ #ifdef EVP_R_CONFLICTING_ALGORITHM_NAME
+ {"CONFLICTING_ALGORITHM_NAME", ERR_LIB_EVP, EVP_R_CONFLICTING_ALGORITHM_NAME},
+ #else
+ {"CONFLICTING_ALGORITHM_NAME", 6, 201},
+ #endif
+ #ifdef EVP_R_COPY_ERROR
+ {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR},
+ #else
+ {"COPY_ERROR", 6, 173},
+ #endif
+ #ifdef EVP_R_CTRL_NOT_IMPLEMENTED
+ {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_NOT_IMPLEMENTED", 6, 132},
+ #endif
+ #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED},
+ #else
+ {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133},
+ #endif
+ #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH},
+ #else
+ {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138},
+ #endif
+ #ifdef EVP_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 6, 114},
+ #endif
+ #ifdef EVP_R_DEFAULT_QUERY_PARSE_ERROR
+ {"DEFAULT_QUERY_PARSE_ERROR", ERR_LIB_EVP, EVP_R_DEFAULT_QUERY_PARSE_ERROR},
+ #else
+ {"DEFAULT_QUERY_PARSE_ERROR", 6, 210},
+ #endif
+ #ifdef EVP_R_DIFFERENT_KEY_TYPES
+ {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES},
+ #else
+ {"DIFFERENT_KEY_TYPES", 6, 101},
+ #endif
+ #ifdef EVP_R_DIFFERENT_PARAMETERS
+ {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS},
+ #else
+ {"DIFFERENT_PARAMETERS", 6, 153},
+ #endif
+ #ifdef EVP_R_ERROR_LOADING_SECTION
+ {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION},
+ #else
+ {"ERROR_LOADING_SECTION", 6, 165},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_HMAC_KEY
+ {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY},
+ #else
+ {"EXPECTING_AN_HMAC_KEY", 6, 174},
+ #endif
+ #ifdef EVP_R_EXPECTING_AN_RSA_KEY
+ {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY},
+ #else
+ {"EXPECTING_AN_RSA_KEY", 6, 127},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DH_KEY
+ {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY},
+ #else
+ {"EXPECTING_A_DH_KEY", 6, 128},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_DSA_KEY
+ {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY},
+ #else
+ {"EXPECTING_A_DSA_KEY", 6, 129},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_ECX_KEY
+ {"EXPECTING_A_ECX_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_ECX_KEY},
+ #else
+ {"EXPECTING_A_ECX_KEY", 6, 219},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_EC_KEY
+ {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY},
+ #else
+ {"EXPECTING_A_EC_KEY", 6, 142},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_POLY1305_KEY
+ {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY},
+ #else
+ {"EXPECTING_A_POLY1305_KEY", 6, 164},
+ #endif
+ #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY
+ {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY},
+ #else
+ {"EXPECTING_A_SIPHASH_KEY", 6, 175},
+ #endif
+ #ifdef EVP_R_FINAL_ERROR
+ {"FINAL_ERROR", ERR_LIB_EVP, EVP_R_FINAL_ERROR},
+ #else
+ {"FINAL_ERROR", 6, 188},
+ #endif
+ #ifdef EVP_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_EVP, EVP_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 6, 214},
+ #endif
+ #ifdef EVP_R_GET_RAW_KEY_FAILED
+ {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED},
+ #else
+ {"GET_RAW_KEY_FAILED", 6, 182},
+ #endif
+ #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS
+ {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS},
+ #else
+ {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171},
+ #endif
+ #ifdef EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS
+ {"INACCESSIBLE_DOMAIN_PARAMETERS", ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS},
+ #else
+ {"INACCESSIBLE_DOMAIN_PARAMETERS", 6, 204},
+ #endif
+ #ifdef EVP_R_INACCESSIBLE_KEY
+ {"INACCESSIBLE_KEY", ERR_LIB_EVP, EVP_R_INACCESSIBLE_KEY},
+ #else
+ {"INACCESSIBLE_KEY", 6, 203},
+ #endif
+ #ifdef EVP_R_INITIALIZATION_ERROR
+ {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR},
+ #else
+ {"INITIALIZATION_ERROR", 6, 134},
+ #endif
+ #ifdef EVP_R_INPUT_NOT_INITIALIZED
+ {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED},
+ #else
+ {"INPUT_NOT_INITIALIZED", 6, 111},
+ #endif
+ #ifdef EVP_R_INVALID_CUSTOM_LENGTH
+ {"INVALID_CUSTOM_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_CUSTOM_LENGTH},
+ #else
+ {"INVALID_CUSTOM_LENGTH", 6, 185},
+ #endif
+ #ifdef EVP_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 6, 152},
+ #endif
+ #ifdef EVP_R_INVALID_IV_LENGTH
+ {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH},
+ #else
+ {"INVALID_IV_LENGTH", 6, 194},
+ #endif
+ #ifdef EVP_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 6, 163},
+ #endif
+ #ifdef EVP_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 6, 130},
+ #endif
+ #ifdef EVP_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 6, 221},
+ #endif
+ #ifdef EVP_R_INVALID_NULL_ALGORITHM
+ {"INVALID_NULL_ALGORITHM", ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM},
+ #else
+ {"INVALID_NULL_ALGORITHM", 6, 218},
+ #endif
+ #ifdef EVP_R_INVALID_OPERATION
+ {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION},
+ #else
+ {"INVALID_OPERATION", 6, 148},
+ #endif
+ #ifdef EVP_R_INVALID_PROVIDER_FUNCTIONS
+ {"INVALID_PROVIDER_FUNCTIONS", ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS},
+ #else
+ {"INVALID_PROVIDER_FUNCTIONS", 6, 193},
+ #endif
+ #ifdef EVP_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 6, 186},
+ #endif
+ #ifdef EVP_R_INVALID_SECRET_LENGTH
+ {"INVALID_SECRET_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SECRET_LENGTH},
+ #else
+ {"INVALID_SECRET_LENGTH", 6, 223},
+ #endif
+ #ifdef EVP_R_INVALID_SEED_LENGTH
+ {"INVALID_SEED_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SEED_LENGTH},
+ #else
+ {"INVALID_SEED_LENGTH", 6, 220},
+ #endif
+ #ifdef EVP_R_INVALID_VALUE
+ {"INVALID_VALUE", ERR_LIB_EVP, EVP_R_INVALID_VALUE},
+ #else
+ {"INVALID_VALUE", 6, 222},
+ #endif
+ #ifdef EVP_R_KEYMGMT_EXPORT_FAILURE
+ {"KEYMGMT_EXPORT_FAILURE", ERR_LIB_EVP, EVP_R_KEYMGMT_EXPORT_FAILURE},
+ #else
+ {"KEYMGMT_EXPORT_FAILURE", 6, 205},
+ #endif
+ #ifdef EVP_R_KEY_SETUP_FAILED
+ {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED},
+ #else
+ {"KEY_SETUP_FAILED", 6, 180},
+ #endif
+ #ifdef EVP_R_LOCKING_NOT_SUPPORTED
+ {"LOCKING_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED},
+ #else
+ {"LOCKING_NOT_SUPPORTED", 6, 213},
+ #endif
+ #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED
+ {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED},
+ #else
+ {"MEMORY_LIMIT_EXCEEDED", 6, 172},
+ #endif
+ #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL
+ {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL},
+ #else
+ {"MESSAGE_DIGEST_IS_NULL", 6, 159},
+ #endif
+ #ifdef EVP_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 6, 144},
+ #endif
+ #ifdef EVP_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 6, 103},
+ #endif
+ #ifdef EVP_R_NOT_ABLE_TO_COPY_CTX
+ {"NOT_ABLE_TO_COPY_CTX", ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX},
+ #else
+ {"NOT_ABLE_TO_COPY_CTX", 6, 190},
+ #endif
+ #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH
+ {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH},
+ #else
+ {"NOT_XOF_OR_INVALID_LENGTH", 6, 178},
+ #endif
+ #ifdef EVP_R_NO_CIPHER_SET
+ {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET},
+ #else
+ {"NO_CIPHER_SET", 6, 131},
+ #endif
+ #ifdef EVP_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 6, 158},
+ #endif
+ #ifdef EVP_R_NO_DIGEST_SET
+ {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET},
+ #else
+ {"NO_DIGEST_SET", 6, 139},
+ #endif
+ #ifdef EVP_R_NO_IMPORT_FUNCTION
+ {"NO_IMPORT_FUNCTION", ERR_LIB_EVP, EVP_R_NO_IMPORT_FUNCTION},
+ #else
+ {"NO_IMPORT_FUNCTION", 6, 206},
+ #endif
+ #ifdef EVP_R_NO_KEYMGMT_AVAILABLE
+ {"NO_KEYMGMT_AVAILABLE", ERR_LIB_EVP, EVP_R_NO_KEYMGMT_AVAILABLE},
+ #else
+ {"NO_KEYMGMT_AVAILABLE", 6, 199},
+ #endif
+ #ifdef EVP_R_NO_KEYMGMT_PRESENT
+ {"NO_KEYMGMT_PRESENT", ERR_LIB_EVP, EVP_R_NO_KEYMGMT_PRESENT},
+ #else
+ {"NO_KEYMGMT_PRESENT", 6, 196},
+ #endif
+ #ifdef EVP_R_NO_KEY_SET
+ {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET},
+ #else
+ {"NO_KEY_SET", 6, 154},
+ #endif
+ #ifdef EVP_R_NO_OPERATION_SET
+ {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET},
+ #else
+ {"NO_OPERATION_SET", 6, 149},
+ #endif
+ #ifdef EVP_R_NULL_MAC_PKEY_CTX
+ {"NULL_MAC_PKEY_CTX", ERR_LIB_EVP, EVP_R_NULL_MAC_PKEY_CTX},
+ #else
+ {"NULL_MAC_PKEY_CTX", 6, 208},
+ #endif
+ #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED
+ {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED},
+ #else
+ {"ONLY_ONESHOT_SUPPORTED", 6, 177},
+ #endif
+ #ifdef EVP_R_OPERATION_NOT_INITIALIZED
+ {"OPERATION_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED},
+ #else
+ {"OPERATION_NOT_INITIALIZED", 6, 151},
+ #endif
+ #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150},
+ #endif
+ #ifdef EVP_R_OUTPUT_WOULD_OVERFLOW
+ {"OUTPUT_WOULD_OVERFLOW", ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW},
+ #else
+ {"OUTPUT_WOULD_OVERFLOW", 6, 202},
+ #endif
+ #ifdef EVP_R_PARAMETER_TOO_LARGE
+ {"PARAMETER_TOO_LARGE", ERR_LIB_EVP, EVP_R_PARAMETER_TOO_LARGE},
+ #else
+ {"PARAMETER_TOO_LARGE", 6, 187},
+ #endif
+ #ifdef EVP_R_PARTIALLY_OVERLAPPING
+ {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING},
+ #else
+ {"PARTIALLY_OVERLAPPING", 6, 162},
+ #endif
+ #ifdef EVP_R_PBKDF2_ERROR
+ {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR},
+ #else
+ {"PBKDF2_ERROR", 6, 181},
+ #endif
+ #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED},
+ #else
+ {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR
+ {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR},
+ #else
+ {"PRIVATE_KEY_DECODE_ERROR", 6, 145},
+ #endif
+ #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR
+ {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR},
+ #else
+ {"PRIVATE_KEY_ENCODE_ERROR", 6, 146},
+ #endif
+ #ifdef EVP_R_PUBLIC_KEY_NOT_RSA
+ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA},
+ #else
+ {"PUBLIC_KEY_NOT_RSA", 6, 106},
+ #endif
+ #ifdef EVP_R_SETTING_XOF_FAILED
+ {"SETTING_XOF_FAILED", ERR_LIB_EVP, EVP_R_SETTING_XOF_FAILED},
+ #else
+ {"SETTING_XOF_FAILED", 6, 227},
+ #endif
+ #ifdef EVP_R_SET_DEFAULT_PROPERTY_FAILURE
+ {"SET_DEFAULT_PROPERTY_FAILURE", ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE},
+ #else
+ {"SET_DEFAULT_PROPERTY_FAILURE", 6, 209},
+ #endif
+ #ifdef EVP_R_TOO_MANY_RECORDS
+ {"TOO_MANY_RECORDS", ERR_LIB_EVP, EVP_R_TOO_MANY_RECORDS},
+ #else
+ {"TOO_MANY_RECORDS", 6, 183},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_ENABLE_LOCKING
+ {"UNABLE_TO_ENABLE_LOCKING", ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING},
+ #else
+ {"UNABLE_TO_ENABLE_LOCKING", 6, 212},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE
+ {"UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE", ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE},
+ #else
+ {"UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE", 6, 215},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH
+ {"UNABLE_TO_GET_RANDOM_STRENGTH", ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH},
+ #else
+ {"UNABLE_TO_GET_RANDOM_STRENGTH", 6, 216},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_LOCK_CONTEXT
+ {"UNABLE_TO_LOCK_CONTEXT", ERR_LIB_EVP, EVP_R_UNABLE_TO_LOCK_CONTEXT},
+ #else
+ {"UNABLE_TO_LOCK_CONTEXT", 6, 211},
+ #endif
+ #ifdef EVP_R_UNABLE_TO_SET_CALLBACKS
+ {"UNABLE_TO_SET_CALLBACKS", ERR_LIB_EVP, EVP_R_UNABLE_TO_SET_CALLBACKS},
+ #else
+ {"UNABLE_TO_SET_CALLBACKS", 6, 217},
+ #endif
+ #ifdef EVP_R_UNKNOWN_CIPHER
+ {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER},
+ #else
+ {"UNKNOWN_CIPHER", 6, 160},
+ #endif
+ #ifdef EVP_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 6, 161},
+ #endif
+ #ifdef EVP_R_UNKNOWN_KEY_TYPE
+ {"UNKNOWN_KEY_TYPE", ERR_LIB_EVP, EVP_R_UNKNOWN_KEY_TYPE},
+ #else
+ {"UNKNOWN_KEY_TYPE", 6, 207},
+ #endif
+ #ifdef EVP_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 6, 169},
+ #endif
+ #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM
+ {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM},
+ #else
+ {"UNKNOWN_PBE_ALGORITHM", 6, 121},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 6, 156},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 6, 107},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEYLENGTH
+ {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH},
+ #else
+ {"UNSUPPORTED_KEYLENGTH", 6, 123},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION},
+ #else
+ {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_SIZE
+ {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE},
+ #else
+ {"UNSUPPORTED_KEY_SIZE", 6, 108},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_KEY_TYPE
+ {"UNSUPPORTED_KEY_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_KEY_TYPE", 6, 224},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+ #else
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRF
+ {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF},
+ #else
+ {"UNSUPPORTED_PRF", 6, 125},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM},
+ #else
+ {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118},
+ #endif
+ #ifdef EVP_R_UNSUPPORTED_SALT_TYPE
+ {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE},
+ #else
+ {"UNSUPPORTED_SALT_TYPE", 6, 126},
+ #endif
+ #ifdef EVP_R_UPDATE_ERROR
+ {"UPDATE_ERROR", ERR_LIB_EVP, EVP_R_UPDATE_ERROR},
+ #else
+ {"UPDATE_ERROR", 6, 189},
+ #endif
+ #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED
+ {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED},
+ #else
+ {"WRAP_MODE_NOT_ALLOWED", 6, 170},
+ #endif
+ #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH
+ {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH},
+ #else
+ {"WRONG_FINAL_BLOCK_LENGTH", 6, 109},
+ #endif
+ #ifdef EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", ERR_LIB_EVP, EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE},
+ #else
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", 6, 191},
+ #endif
+ #ifdef EVP_R_XTS_DUPLICATED_KEYS
+ {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS},
+ #else
+ {"XTS_DUPLICATED_KEYS", 6, 192},
+ #endif
+ #ifdef HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN
+ {"ASN1_LEN_EXCEEDS_MAX_RESP_LEN", ERR_LIB_HTTP, HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN},
+ #else
+ {"ASN1_LEN_EXCEEDS_MAX_RESP_LEN", 61, 108},
+ #endif
+ #ifdef HTTP_R_CONNECT_FAILURE
+ {"CONNECT_FAILURE", ERR_LIB_HTTP, HTTP_R_CONNECT_FAILURE},
+ #else
+ {"CONNECT_FAILURE", 61, 100},
+ #endif
+ #ifdef HTTP_R_ERROR_PARSING_ASN1_LENGTH
+ {"ERROR_PARSING_ASN1_LENGTH", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_ASN1_LENGTH},
+ #else
+ {"ERROR_PARSING_ASN1_LENGTH", 61, 109},
+ #endif
+ #ifdef HTTP_R_ERROR_PARSING_CONTENT_LENGTH
+ {"ERROR_PARSING_CONTENT_LENGTH", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_CONTENT_LENGTH},
+ #else
+ {"ERROR_PARSING_CONTENT_LENGTH", 61, 119},
+ #endif
+ #ifdef HTTP_R_ERROR_PARSING_URL
+ {"ERROR_PARSING_URL", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_URL},
+ #else
+ {"ERROR_PARSING_URL", 61, 101},
+ #endif
+ #ifdef HTTP_R_ERROR_RECEIVING
+ {"ERROR_RECEIVING", ERR_LIB_HTTP, HTTP_R_ERROR_RECEIVING},
+ #else
+ {"ERROR_RECEIVING", 61, 103},
+ #endif
+ #ifdef HTTP_R_ERROR_SENDING
+ {"ERROR_SENDING", ERR_LIB_HTTP, HTTP_R_ERROR_SENDING},
+ #else
+ {"ERROR_SENDING", 61, 102},
+ #endif
+ #ifdef HTTP_R_FAILED_READING_DATA
+ {"FAILED_READING_DATA", ERR_LIB_HTTP, HTTP_R_FAILED_READING_DATA},
+ #else
+ {"FAILED_READING_DATA", 61, 128},
+ #endif
+ #ifdef HTTP_R_HEADER_PARSE_ERROR
+ {"HEADER_PARSE_ERROR", ERR_LIB_HTTP, HTTP_R_HEADER_PARSE_ERROR},
+ #else
+ {"HEADER_PARSE_ERROR", 61, 126},
+ #endif
+ #ifdef HTTP_R_INCONSISTENT_CONTENT_LENGTH
+ {"INCONSISTENT_CONTENT_LENGTH", ERR_LIB_HTTP, HTTP_R_INCONSISTENT_CONTENT_LENGTH},
+ #else
+ {"INCONSISTENT_CONTENT_LENGTH", 61, 120},
+ #endif
+ #ifdef HTTP_R_INVALID_PORT_NUMBER
+ {"INVALID_PORT_NUMBER", ERR_LIB_HTTP, HTTP_R_INVALID_PORT_NUMBER},
+ #else
+ {"INVALID_PORT_NUMBER", 61, 123},
+ #endif
+ #ifdef HTTP_R_INVALID_URL_PATH
+ {"INVALID_URL_PATH", ERR_LIB_HTTP, HTTP_R_INVALID_URL_PATH},
+ #else
+ {"INVALID_URL_PATH", 61, 125},
+ #endif
+ #ifdef HTTP_R_INVALID_URL_SCHEME
+ {"INVALID_URL_SCHEME", ERR_LIB_HTTP, HTTP_R_INVALID_URL_SCHEME},
+ #else
+ {"INVALID_URL_SCHEME", 61, 124},
+ #endif
+ #ifdef HTTP_R_MAX_RESP_LEN_EXCEEDED
+ {"MAX_RESP_LEN_EXCEEDED", ERR_LIB_HTTP, HTTP_R_MAX_RESP_LEN_EXCEEDED},
+ #else
+ {"MAX_RESP_LEN_EXCEEDED", 61, 117},
+ #endif
+ #ifdef HTTP_R_MISSING_ASN1_ENCODING
+ {"MISSING_ASN1_ENCODING", ERR_LIB_HTTP, HTTP_R_MISSING_ASN1_ENCODING},
+ #else
+ {"MISSING_ASN1_ENCODING", 61, 110},
+ #endif
+ #ifdef HTTP_R_MISSING_CONTENT_TYPE
+ {"MISSING_CONTENT_TYPE", ERR_LIB_HTTP, HTTP_R_MISSING_CONTENT_TYPE},
+ #else
+ {"MISSING_CONTENT_TYPE", 61, 121},
+ #endif
+ #ifdef HTTP_R_MISSING_REDIRECT_LOCATION
+ {"MISSING_REDIRECT_LOCATION", ERR_LIB_HTTP, HTTP_R_MISSING_REDIRECT_LOCATION},
+ #else
+ {"MISSING_REDIRECT_LOCATION", 61, 111},
+ #endif
+ #ifdef HTTP_R_RECEIVED_ERROR
+ {"RECEIVED_ERROR", ERR_LIB_HTTP, HTTP_R_RECEIVED_ERROR},
+ #else
+ {"RECEIVED_ERROR", 61, 105},
+ #endif
+ #ifdef HTTP_R_RECEIVED_WRONG_HTTP_VERSION
+ {"RECEIVED_WRONG_HTTP_VERSION", ERR_LIB_HTTP, HTTP_R_RECEIVED_WRONG_HTTP_VERSION},
+ #else
+ {"RECEIVED_WRONG_HTTP_VERSION", 61, 106},
+ #endif
+ #ifdef HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP
+ {"REDIRECTION_FROM_HTTPS_TO_HTTP", ERR_LIB_HTTP, HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP},
+ #else
+ {"REDIRECTION_FROM_HTTPS_TO_HTTP", 61, 112},
+ #endif
+ #ifdef HTTP_R_REDIRECTION_NOT_ENABLED
+ {"REDIRECTION_NOT_ENABLED", ERR_LIB_HTTP, HTTP_R_REDIRECTION_NOT_ENABLED},
+ #else
+ {"REDIRECTION_NOT_ENABLED", 61, 116},
+ #endif
+ #ifdef HTTP_R_RESPONSE_LINE_TOO_LONG
+ {"RESPONSE_LINE_TOO_LONG", ERR_LIB_HTTP, HTTP_R_RESPONSE_LINE_TOO_LONG},
+ #else
+ {"RESPONSE_LINE_TOO_LONG", 61, 113},
+ #endif
+ #ifdef HTTP_R_RESPONSE_PARSE_ERROR
+ {"RESPONSE_PARSE_ERROR", ERR_LIB_HTTP, HTTP_R_RESPONSE_PARSE_ERROR},
+ #else
+ {"RESPONSE_PARSE_ERROR", 61, 104},
+ #endif
+ #ifdef HTTP_R_RETRY_TIMEOUT
+ {"RETRY_TIMEOUT", ERR_LIB_HTTP, HTTP_R_RETRY_TIMEOUT},
+ #else
+ {"RETRY_TIMEOUT", 61, 129},
+ #endif
+ #ifdef HTTP_R_SERVER_CANCELED_CONNECTION
+ {"SERVER_CANCELED_CONNECTION", ERR_LIB_HTTP, HTTP_R_SERVER_CANCELED_CONNECTION},
+ #else
+ {"SERVER_CANCELED_CONNECTION", 61, 127},
+ #endif
+ #ifdef HTTP_R_SOCK_NOT_SUPPORTED
+ {"SOCK_NOT_SUPPORTED", ERR_LIB_HTTP, HTTP_R_SOCK_NOT_SUPPORTED},
+ #else
+ {"SOCK_NOT_SUPPORTED", 61, 122},
+ #endif
+ #ifdef HTTP_R_STATUS_CODE_UNSUPPORTED
+ {"STATUS_CODE_UNSUPPORTED", ERR_LIB_HTTP, HTTP_R_STATUS_CODE_UNSUPPORTED},
+ #else
+ {"STATUS_CODE_UNSUPPORTED", 61, 114},
+ #endif
+ #ifdef HTTP_R_TLS_NOT_ENABLED
+ {"TLS_NOT_ENABLED", ERR_LIB_HTTP, HTTP_R_TLS_NOT_ENABLED},
+ #else
+ {"TLS_NOT_ENABLED", 61, 107},
+ #endif
+ #ifdef HTTP_R_TOO_MANY_REDIRECTIONS
+ {"TOO_MANY_REDIRECTIONS", ERR_LIB_HTTP, HTTP_R_TOO_MANY_REDIRECTIONS},
+ #else
+ {"TOO_MANY_REDIRECTIONS", 61, 115},
+ #endif
+ #ifdef HTTP_R_UNEXPECTED_CONTENT_TYPE
+ {"UNEXPECTED_CONTENT_TYPE", ERR_LIB_HTTP, HTTP_R_UNEXPECTED_CONTENT_TYPE},
+ #else
+ {"UNEXPECTED_CONTENT_TYPE", 61, 118},
+ #endif
+ #ifdef OBJ_R_OID_EXISTS
+ {"OID_EXISTS", ERR_LIB_OBJ, OBJ_R_OID_EXISTS},
+ #else
+ {"OID_EXISTS", 8, 102},
+ #endif
+ #ifdef OBJ_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 8, 101},
+ #endif
+ #ifdef OBJ_R_UNKNOWN_OBJECT_NAME
+ {"UNKNOWN_OBJECT_NAME", ERR_LIB_OBJ, OBJ_R_UNKNOWN_OBJECT_NAME},
+ #else
+ {"UNKNOWN_OBJECT_NAME", 8, 103},
+ #endif
+ #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 39, 101},
+ #endif
+ #ifdef OCSP_R_DIGEST_ERR
+ {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR},
+ #else
+ {"DIGEST_ERR", 39, 102},
+ #endif
+ #ifdef OCSP_R_DIGEST_NAME_ERR
+ {"DIGEST_NAME_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_NAME_ERR},
+ #else
+ {"DIGEST_NAME_ERR", 39, 106},
+ #endif
+ #ifdef OCSP_R_DIGEST_SIZE_ERR
+ {"DIGEST_SIZE_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_SIZE_ERR},
+ #else
+ {"DIGEST_SIZE_ERR", 39, 107},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD
+ {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD},
+ #else
+ {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122},
+ #endif
+ #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD
+ {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD},
+ #else
+ {"ERROR_IN_THISUPDATE_FIELD", 39, 123},
+ #endif
+ #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE
+ {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE},
+ #else
+ {"MISSING_OCSPSIGNING_USAGE", 39, 103},
+ #endif
+ #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE
+ {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE},
+ #else
+ {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124},
+ #endif
+ #ifdef OCSP_R_NOT_BASIC_RESPONSE
+ {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE},
+ #else
+ {"NOT_BASIC_RESPONSE", 39, 104},
+ #endif
+ #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN
+ {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN},
+ #else
+ {"NO_CERTIFICATES_IN_CHAIN", 39, 105},
+ #endif
+ #ifdef OCSP_R_NO_RESPONSE_DATA
+ {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA},
+ #else
+ {"NO_RESPONSE_DATA", 39, 108},
+ #endif
+ #ifdef OCSP_R_NO_REVOKED_TIME
+ {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME},
+ #else
+ {"NO_REVOKED_TIME", 39, 109},
+ #endif
+ #ifdef OCSP_R_NO_SIGNER_KEY
+ {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY},
+ #else
+ {"NO_SIGNER_KEY", 39, 130},
+ #endif
+ #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110},
+ #endif
+ #ifdef OCSP_R_REQUEST_NOT_SIGNED
+ {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED},
+ #else
+ {"REQUEST_NOT_SIGNED", 39, 128},
+ #endif
+ #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA},
+ #else
+ {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111},
+ #endif
+ #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED
+ {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED},
+ #else
+ {"ROOT_CA_NOT_TRUSTED", 39, 112},
+ #endif
+ #ifdef OCSP_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 39, 117},
+ #endif
+ #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118},
+ #endif
+ #ifdef OCSP_R_STATUS_EXPIRED
+ {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED},
+ #else
+ {"STATUS_EXPIRED", 39, 125},
+ #endif
+ #ifdef OCSP_R_STATUS_NOT_YET_VALID
+ {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID},
+ #else
+ {"STATUS_NOT_YET_VALID", 39, 126},
+ #endif
+ #ifdef OCSP_R_STATUS_TOO_OLD
+ {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD},
+ #else
+ {"STATUS_TOO_OLD", 39, 127},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST
+ {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST},
+ #else
+ {"UNKNOWN_MESSAGE_DIGEST", 39, 119},
+ #endif
+ #ifdef OCSP_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 39, 120},
+ #endif
+ #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE},
+ #else
+ {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129},
+ #endif
+ #ifdef OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT
+ {"COULD_NOT_DECODE_OBJECT", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_COULD_NOT_DECODE_OBJECT},
+ #else
+ {"COULD_NOT_DECODE_OBJECT", 60, 101},
+ #endif
+ #ifdef OSSL_DECODER_R_DECODER_NOT_FOUND
+ {"DECODER_NOT_FOUND", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND},
+ #else
+ {"DECODER_NOT_FOUND", 60, 102},
+ #endif
+ #ifdef OSSL_DECODER_R_MISSING_GET_PARAMS
+ {"MISSING_GET_PARAMS", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_MISSING_GET_PARAMS},
+ #else
+ {"MISSING_GET_PARAMS", 60, 100},
+ #endif
+ #ifdef OSSL_ENCODER_R_ENCODER_NOT_FOUND
+ {"ENCODER_NOT_FOUND", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND},
+ #else
+ {"ENCODER_NOT_FOUND", 59, 101},
+ #endif
+ #ifdef OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY
+ {"INCORRECT_PROPERTY_QUERY", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY},
+ #else
+ {"INCORRECT_PROPERTY_QUERY", 59, 100},
+ #endif
+ #ifdef OSSL_ENCODER_R_MISSING_GET_PARAMS
+ {"MISSING_GET_PARAMS", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_MISSING_GET_PARAMS},
+ #else
+ {"MISSING_GET_PARAMS", 59, 102},
+ #endif
+ #ifdef OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE
+ {"AMBIGUOUS_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE},
+ #else
+ {"AMBIGUOUS_CONTENT_TYPE", 44, 107},
+ #endif
+ #ifdef OSSL_STORE_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_OSSL_STORE, OSSL_STORE_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 44, 115},
+ #endif
+ #ifdef OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC
+ {"ERROR_VERIFYING_PKCS12_MAC", ERR_LIB_OSSL_STORE, OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC},
+ #else
+ {"ERROR_VERIFYING_PKCS12_MAC", 44, 113},
+ #endif
+ #ifdef OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST
+ {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", ERR_LIB_OSSL_STORE, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST},
+ #else
+ {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", 44, 121},
+ #endif
+ #ifdef OSSL_STORE_R_INVALID_SCHEME
+ {"INVALID_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_INVALID_SCHEME},
+ #else
+ {"INVALID_SCHEME", 44, 106},
+ #endif
+ #ifdef OSSL_STORE_R_IS_NOT_A
+ {"IS_NOT_A", ERR_LIB_OSSL_STORE, OSSL_STORE_R_IS_NOT_A},
+ #else
+ {"IS_NOT_A", 44, 112},
+ #endif
+ #ifdef OSSL_STORE_R_LOADER_INCOMPLETE
+ {"LOADER_INCOMPLETE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADER_INCOMPLETE},
+ #else
+ {"LOADER_INCOMPLETE", 44, 116},
+ #endif
+ #ifdef OSSL_STORE_R_LOADING_STARTED
+ {"LOADING_STARTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADING_STARTED},
+ #else
+ {"LOADING_STARTED", 44, 117},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_CERTIFICATE
+ {"NOT_A_CERTIFICATE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CERTIFICATE},
+ #else
+ {"NOT_A_CERTIFICATE", 44, 100},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_CRL
+ {"NOT_A_CRL", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CRL},
+ #else
+ {"NOT_A_CRL", 44, 101},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_NAME
+ {"NOT_A_NAME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_NAME},
+ #else
+ {"NOT_A_NAME", 44, 103},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_PRIVATE_KEY
+ {"NOT_A_PRIVATE_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_PRIVATE_KEY},
+ #else
+ {"NOT_A_PRIVATE_KEY", 44, 102},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_A_PUBLIC_KEY
+ {"NOT_A_PUBLIC_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_PUBLIC_KEY},
+ #else
+ {"NOT_A_PUBLIC_KEY", 44, 122},
+ #endif
+ #ifdef OSSL_STORE_R_NOT_PARAMETERS
+ {"NOT_PARAMETERS", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_PARAMETERS},
+ #else
+ {"NOT_PARAMETERS", 44, 104},
+ #endif
+ #ifdef OSSL_STORE_R_NO_LOADERS_FOUND
+ {"NO_LOADERS_FOUND", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NO_LOADERS_FOUND},
+ #else
+ {"NO_LOADERS_FOUND", 44, 123},
+ #endif
+ #ifdef OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR
+ {"PASSPHRASE_CALLBACK_ERROR", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR},
+ #else
+ {"PASSPHRASE_CALLBACK_ERROR", 44, 114},
+ #endif
+ #ifdef OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE
+ {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE},
+ #else
+ {"PATH_MUST_BE_ABSOLUTE", 44, 108},
+ #endif
+ #ifdef OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_OSSL_STORE, OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES},
+ #else
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 44, 119},
+ #endif
+ #ifdef OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED
+ {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED},
+ #else
+ {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", 44, 109},
+ #endif
+ #ifdef OSSL_STORE_R_UNREGISTERED_SCHEME
+ {"UNREGISTERED_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNREGISTERED_SCHEME},
+ #else
+ {"UNREGISTERED_SCHEME", 44, 105},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 44, 110},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_OPERATION
+ {"UNSUPPORTED_OPERATION", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_OPERATION},
+ #else
+ {"UNSUPPORTED_OPERATION", 44, 118},
+ #endif
+ #ifdef OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE
+ {"UNSUPPORTED_SEARCH_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE},
+ #else
+ {"UNSUPPORTED_SEARCH_TYPE", 44, 120},
+ #endif
+ #ifdef OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED
+ {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED},
+ #else
+ {"URI_AUTHORITY_UNSUPPORTED", 44, 111},
+ #endif
+ #ifdef PEM_R_BAD_BASE64_DECODE
+ {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
+ #else
+ {"BAD_BASE64_DECODE", 9, 100},
+ #endif
+ #ifdef PEM_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 9, 101},
+ #endif
+ #ifdef PEM_R_BAD_END_LINE
+ {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
+ #else
+ {"BAD_END_LINE", 9, 102},
+ #endif
+ #ifdef PEM_R_BAD_IV_CHARS
+ {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
+ #else
+ {"BAD_IV_CHARS", 9, 103},
+ #endif
+ #ifdef PEM_R_BAD_MAGIC_NUMBER
+ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
+ #else
+ {"BAD_MAGIC_NUMBER", 9, 116},
+ #endif
+ #ifdef PEM_R_BAD_PASSWORD_READ
+ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
+ #else
+ {"BAD_PASSWORD_READ", 9, 104},
+ #endif
+ #ifdef PEM_R_BAD_VERSION_NUMBER
+ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
+ #else
+ {"BAD_VERSION_NUMBER", 9, 117},
+ #endif
+ #ifdef PEM_R_BIO_WRITE_FAILURE
+ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
+ #else
+ {"BIO_WRITE_FAILURE", 9, 118},
+ #endif
+ #ifdef PEM_R_CIPHER_IS_NULL
+ {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
+ #else
+ {"CIPHER_IS_NULL", 9, 127},
+ #endif
+ #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
+ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
+ #else
+ {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115},
+ #endif
+ #ifdef PEM_R_EXPECTING_DSS_KEY_BLOB
+ {"EXPECTING_DSS_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_DSS_KEY_BLOB},
+ #else
+ {"EXPECTING_DSS_KEY_BLOB", 9, 131},
+ #endif
+ #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
+ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
+ #else
+ {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119},
+ #endif
+ #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
+ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
+ #else
+ {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120},
+ #endif
+ #ifdef PEM_R_EXPECTING_RSA_KEY_BLOB
+ {"EXPECTING_RSA_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_RSA_KEY_BLOB},
+ #else
+ {"EXPECTING_RSA_KEY_BLOB", 9, 132},
+ #endif
+ #ifdef PEM_R_HEADER_TOO_LONG
+ {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG},
+ #else
+ {"HEADER_TOO_LONG", 9, 128},
+ #endif
+ #ifdef PEM_R_INCONSISTENT_HEADER
+ {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
+ #else
+ {"INCONSISTENT_HEADER", 9, 121},
+ #endif
+ #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
+ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
+ #else
+ {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122},
+ #endif
+ #ifdef PEM_R_KEYBLOB_TOO_SHORT
+ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
+ #else
+ {"KEYBLOB_TOO_SHORT", 9, 123},
+ #endif
+ #ifdef PEM_R_MISSING_DEK_IV
+ {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV},
+ #else
+ {"MISSING_DEK_IV", 9, 129},
+ #endif
+ #ifdef PEM_R_NOT_DEK_INFO
+ {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
+ #else
+ {"NOT_DEK_INFO", 9, 105},
+ #endif
+ #ifdef PEM_R_NOT_ENCRYPTED
+ {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
+ #else
+ {"NOT_ENCRYPTED", 9, 106},
+ #endif
+ #ifdef PEM_R_NOT_PROC_TYPE
+ {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
+ #else
+ {"NOT_PROC_TYPE", 9, 107},
+ #endif
+ #ifdef PEM_R_NO_START_LINE
+ {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
+ #else
+ {"NO_START_LINE", 9, 108},
+ #endif
+ #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
+ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD},
+ #else
+ {"PROBLEMS_GETTING_PASSWORD", 9, 109},
+ #endif
+ #ifdef PEM_R_PVK_DATA_TOO_SHORT
+ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
+ #else
+ {"PVK_DATA_TOO_SHORT", 9, 124},
+ #endif
+ #ifdef PEM_R_PVK_TOO_SHORT
+ {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
+ #else
+ {"PVK_TOO_SHORT", 9, 125},
+ #endif
+ #ifdef PEM_R_READ_KEY
+ {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
+ #else
+ {"READ_KEY", 9, 111},
+ #endif
+ #ifdef PEM_R_SHORT_HEADER
+ {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
+ #else
+ {"SHORT_HEADER", 9, 112},
+ #endif
+ #ifdef PEM_R_UNEXPECTED_DEK_IV
+ {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV},
+ #else
+ {"UNEXPECTED_DEK_IV", 9, 130},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_CIPHER
+ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
+ #else
+ {"UNSUPPORTED_CIPHER", 9, 113},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
+ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
+ #else
+ {"UNSUPPORTED_ENCRYPTION", 9, 114},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
+ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS},
+ #else
+ {"UNSUPPORTED_KEY_COMPONENTS", 9, 126},
+ #endif
+ #ifdef PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_PEM, PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE},
+ #else
+ {"UNSUPPORTED_PUBLIC_KEY_TYPE", 9, 110},
+ #endif
+ #ifdef PKCS12_R_CANT_PACK_STRUCTURE
+ {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE},
+ #else
+ {"CANT_PACK_STRUCTURE", 35, 100},
+ #endif
+ #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA
+ {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA},
+ #else
+ {"CONTENT_TYPE_NOT_DATA", 35, 121},
+ #endif
+ #ifdef PKCS12_R_DECODE_ERROR
+ {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR},
+ #else
+ {"DECODE_ERROR", 35, 101},
+ #endif
+ #ifdef PKCS12_R_ENCODE_ERROR
+ {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR},
+ #else
+ {"ENCODE_ERROR", 35, 102},
+ #endif
+ #ifdef PKCS12_R_ENCRYPT_ERROR
+ {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR},
+ #else
+ {"ENCRYPT_ERROR", 35, 103},
+ #endif
+ #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE},
+ #else
+ {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 35, 104},
+ #endif
+ #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER
+ {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER},
+ #else
+ {"INVALID_NULL_PKCS12_POINTER", 35, 105},
+ #endif
+ #ifdef PKCS12_R_INVALID_TYPE
+ {"INVALID_TYPE", ERR_LIB_PKCS12, PKCS12_R_INVALID_TYPE},
+ #else
+ {"INVALID_TYPE", 35, 112},
+ #endif
+ #ifdef PKCS12_R_IV_GEN_ERROR
+ {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR},
+ #else
+ {"IV_GEN_ERROR", 35, 106},
+ #endif
+ #ifdef PKCS12_R_KEY_GEN_ERROR
+ {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR},
+ #else
+ {"KEY_GEN_ERROR", 35, 107},
+ #endif
+ #ifdef PKCS12_R_MAC_ABSENT
+ {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT},
+ #else
+ {"MAC_ABSENT", 35, 108},
+ #endif
+ #ifdef PKCS12_R_MAC_GENERATION_ERROR
+ {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR},
+ #else
+ {"MAC_GENERATION_ERROR", 35, 109},
+ #endif
+ #ifdef PKCS12_R_MAC_SETUP_ERROR
+ {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR},
+ #else
+ {"MAC_SETUP_ERROR", 35, 110},
+ #endif
+ #ifdef PKCS12_R_MAC_STRING_SET_ERROR
+ {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR},
+ #else
+ {"MAC_STRING_SET_ERROR", 35, 111},
+ #endif
+ #ifdef PKCS12_R_MAC_VERIFY_FAILURE
+ {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE},
+ #else
+ {"MAC_VERIFY_FAILURE", 35, 113},
+ #endif
+ #ifdef PKCS12_R_PARSE_ERROR
+ {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR},
+ #else
+ {"PARSE_ERROR", 35, 114},
+ #endif
+ #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR
+ {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR},
+ #else
+ {"PKCS12_CIPHERFINAL_ERROR", 35, 116},
+ #endif
+ #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM
+ {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM},
+ #else
+ {"UNKNOWN_DIGEST_ALGORITHM", 35, 118},
+ #endif
+ #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE
+ {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE},
+ #else
+ {"UNSUPPORTED_PKCS12_MODE", 35, 119},
+ #endif
+ #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 33, 117},
+ #endif
+ #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER},
+ #else
+ {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144},
+ #endif
+ #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED
+ {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED},
+ #else
+ {"CIPHER_NOT_INITIALIZED", 33, 116},
+ #endif
+ #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT
+ {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT},
+ #else
+ {"CONTENT_AND_DATA_PRESENT", 33, 118},
+ #endif
+ #ifdef PKCS7_R_CTRL_ERROR
+ {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR},
+ #else
+ {"CTRL_ERROR", 33, 152},
+ #endif
+ #ifdef PKCS7_R_DECRYPT_ERROR
+ {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR},
+ #else
+ {"DECRYPT_ERROR", 33, 119},
+ #endif
+ #ifdef PKCS7_R_DIGEST_FAILURE
+ {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE},
+ #else
+ {"DIGEST_FAILURE", 33, 101},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE
+ {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE},
+ #else
+ {"ENCRYPTION_CTRL_FAILURE", 33, 149},
+ #endif
+ #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150},
+ #endif
+ #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT
+ {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT},
+ #else
+ {"ERROR_ADDING_RECIPIENT", 33, 120},
+ #endif
+ #ifdef PKCS7_R_ERROR_SETTING_CIPHER
+ {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER},
+ #else
+ {"ERROR_SETTING_CIPHER", 33, 121},
+ #endif
+ #ifdef PKCS7_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 33, 143},
+ #endif
+ #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE
+ {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE},
+ #else
+ {"INVALID_SIGNED_DATA_TYPE", 33, 155},
+ #endif
+ #ifdef PKCS7_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 33, 122},
+ #endif
+ #ifdef PKCS7_R_NO_DEFAULT_DIGEST
+ {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST},
+ #else
+ {"NO_DEFAULT_DIGEST", 33, 151},
+ #endif
+ #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND},
+ #else
+ {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154},
+ #endif
+ #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE},
+ #else
+ {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA
+ {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA},
+ #else
+ {"NO_SIGNATURES_ON_DATA", 33, 123},
+ #endif
+ #ifdef PKCS7_R_NO_SIGNERS
+ {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS},
+ #else
+ {"NO_SIGNERS", 33, 142},
+ #endif
+ #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124},
+ #endif
+ #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR
+ {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNER_ERROR", 33, 153},
+ #endif
+ #ifdef PKCS7_R_PKCS7_DATASIGN
+ {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN},
+ #else
+ {"PKCS7_DATASIGN", 33, 145},
+ #endif
+ #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127},
+ #endif
+ #ifdef PKCS7_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 33, 105},
+ #endif
+ #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND
+ {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND},
+ #else
+ {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128},
+ #endif
+ #ifdef PKCS7_R_SIGNING_CTRL_FAILURE
+ {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE},
+ #else
+ {"SIGNING_CTRL_FAILURE", 33, 147},
+ #endif
+ #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE},
+ #else
+ {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148},
+ #endif
+ #ifdef PKCS7_R_SMIME_TEXT_ERROR
+ {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR},
+ #else
+ {"SMIME_TEXT_ERROR", 33, 129},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE
+ {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE},
+ #else
+ {"UNABLE_TO_FIND_CERTIFICATE", 33, 106},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO
+ {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO},
+ #else
+ {"UNABLE_TO_FIND_MEM_BIO", 33, 107},
+ #endif
+ #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST},
+ #else
+ {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE
+ {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE},
+ #else
+ {"UNKNOWN_DIGEST_TYPE", 33, 109},
+ #endif
+ #ifdef PKCS7_R_UNKNOWN_OPERATION
+ {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION},
+ #else
+ {"UNKNOWN_OPERATION", 33, 110},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE
+ {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE},
+ #else
+ {"UNSUPPORTED_CIPHER_TYPE", 33, 111},
+ #endif
+ #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE
+ {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE},
+ #else
+ {"UNSUPPORTED_CONTENT_TYPE", 33, 112},
+ #endif
+ #ifdef PKCS7_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 33, 113},
+ #endif
+ #ifdef PKCS7_R_WRONG_PKCS7_TYPE
+ {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE},
+ #else
+ {"WRONG_PKCS7_TYPE", 33, 114},
+ #endif
+ #ifdef PROP_R_NAME_TOO_LONG
+ {"NAME_TOO_LONG", ERR_LIB_PROP, PROP_R_NAME_TOO_LONG},
+ #else
+ {"NAME_TOO_LONG", 55, 100},
+ #endif
+ #ifdef PROP_R_NOT_AN_ASCII_CHARACTER
+ {"NOT_AN_ASCII_CHARACTER", ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER},
+ #else
+ {"NOT_AN_ASCII_CHARACTER", 55, 101},
+ #endif
+ #ifdef PROP_R_NOT_AN_HEXADECIMAL_DIGIT
+ {"NOT_AN_HEXADECIMAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT},
+ #else
+ {"NOT_AN_HEXADECIMAL_DIGIT", 55, 102},
+ #endif
+ #ifdef PROP_R_NOT_AN_IDENTIFIER
+ {"NOT_AN_IDENTIFIER", ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER},
+ #else
+ {"NOT_AN_IDENTIFIER", 55, 103},
+ #endif
+ #ifdef PROP_R_NOT_AN_OCTAL_DIGIT
+ {"NOT_AN_OCTAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT},
+ #else
+ {"NOT_AN_OCTAL_DIGIT", 55, 104},
+ #endif
+ #ifdef PROP_R_NOT_A_DECIMAL_DIGIT
+ {"NOT_A_DECIMAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT},
+ #else
+ {"NOT_A_DECIMAL_DIGIT", 55, 105},
+ #endif
+ #ifdef PROP_R_NO_MATCHING_STRING_DELIMITER
+ {"NO_MATCHING_STRING_DELIMITER", ERR_LIB_PROP, PROP_R_NO_MATCHING_STRING_DELIMITER},
+ #else
+ {"NO_MATCHING_STRING_DELIMITER", 55, 106},
+ #endif
+ #ifdef PROP_R_NO_VALUE
+ {"NO_VALUE", ERR_LIB_PROP, PROP_R_NO_VALUE},
+ #else
+ {"NO_VALUE", 55, 107},
+ #endif
+ #ifdef PROP_R_PARSE_FAILED
+ {"PARSE_FAILED", ERR_LIB_PROP, PROP_R_PARSE_FAILED},
+ #else
+ {"PARSE_FAILED", 55, 108},
+ #endif
+ #ifdef PROP_R_STRING_TOO_LONG
+ {"STRING_TOO_LONG", ERR_LIB_PROP, PROP_R_STRING_TOO_LONG},
+ #else
+ {"STRING_TOO_LONG", 55, 109},
+ #endif
+ #ifdef PROP_R_TRAILING_CHARACTERS
+ {"TRAILING_CHARACTERS", ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS},
+ #else
+ {"TRAILING_CHARACTERS", 55, 110},
+ #endif
+ #ifdef PROV_R_ADDITIONAL_INPUT_TOO_LONG
+ {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG},
+ #else
+ {"ADDITIONAL_INPUT_TOO_LONG", 57, 184},
+ #endif
+ #ifdef PROV_R_ALGORITHM_MISMATCH
+ {"ALGORITHM_MISMATCH", ERR_LIB_PROV, PROV_R_ALGORITHM_MISMATCH},
+ #else
+ {"ALGORITHM_MISMATCH", 57, 173},
+ #endif
+ #ifdef PROV_R_ALREADY_INSTANTIATED
+ {"ALREADY_INSTANTIATED", ERR_LIB_PROV, PROV_R_ALREADY_INSTANTIATED},
+ #else
+ {"ALREADY_INSTANTIATED", 57, 185},
+ #endif
+ #ifdef PROV_R_BAD_DECRYPT
+ {"BAD_DECRYPT", ERR_LIB_PROV, PROV_R_BAD_DECRYPT},
+ #else
+ {"BAD_DECRYPT", 57, 100},
+ #endif
+ #ifdef PROV_R_BAD_ENCODING
+ {"BAD_ENCODING", ERR_LIB_PROV, PROV_R_BAD_ENCODING},
+ #else
+ {"BAD_ENCODING", 57, 141},
+ #endif
+ #ifdef PROV_R_BAD_LENGTH
+ {"BAD_LENGTH", ERR_LIB_PROV, PROV_R_BAD_LENGTH},
+ #else
+ {"BAD_LENGTH", 57, 142},
+ #endif
+ #ifdef PROV_R_BAD_TLS_CLIENT_VERSION
+ {"BAD_TLS_CLIENT_VERSION", ERR_LIB_PROV, PROV_R_BAD_TLS_CLIENT_VERSION},
+ #else
+ {"BAD_TLS_CLIENT_VERSION", 57, 161},
+ #endif
+ #ifdef PROV_R_BN_ERROR
+ {"BN_ERROR", ERR_LIB_PROV, PROV_R_BN_ERROR},
+ #else
+ {"BN_ERROR", 57, 160},
+ #endif
+ #ifdef PROV_R_CIPHER_OPERATION_FAILED
+ {"CIPHER_OPERATION_FAILED", ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED},
+ #else
+ {"CIPHER_OPERATION_FAILED", 57, 102},
+ #endif
+ #ifdef PROV_R_DERIVATION_FUNCTION_INIT_FAILED
+ {"DERIVATION_FUNCTION_INIT_FAILED", ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED},
+ #else
+ {"DERIVATION_FUNCTION_INIT_FAILED", 57, 205},
+ #endif
+ #ifdef PROV_R_DIGEST_NOT_ALLOWED
+ {"DIGEST_NOT_ALLOWED", ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED},
+ #else
+ {"DIGEST_NOT_ALLOWED", 57, 174},
+ #endif
+ #ifdef PROV_R_EMS_NOT_ENABLED
+ {"EMS_NOT_ENABLED", ERR_LIB_PROV, PROV_R_EMS_NOT_ENABLED},
+ #else
+ {"EMS_NOT_ENABLED", 57, 233},
+ #endif
+ #ifdef PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK
+ {"ENTROPY_SOURCE_STRENGTH_TOO_WEAK", ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK},
+ #else
+ {"ENTROPY_SOURCE_STRENGTH_TOO_WEAK", 57, 186},
+ #endif
+ #ifdef PROV_R_ERROR_INSTANTIATING_DRBG
+ {"ERROR_INSTANTIATING_DRBG", ERR_LIB_PROV, PROV_R_ERROR_INSTANTIATING_DRBG},
+ #else
+ {"ERROR_INSTANTIATING_DRBG", 57, 188},
+ #endif
+ #ifdef PROV_R_ERROR_RETRIEVING_ENTROPY
+ {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY},
+ #else
+ {"ERROR_RETRIEVING_ENTROPY", 57, 189},
+ #endif
+ #ifdef PROV_R_ERROR_RETRIEVING_NONCE
+ {"ERROR_RETRIEVING_NONCE", ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE},
+ #else
+ {"ERROR_RETRIEVING_NONCE", 57, 190},
+ #endif
+ #ifdef PROV_R_FAILED_DURING_DERIVATION
+ {"FAILED_DURING_DERIVATION", ERR_LIB_PROV, PROV_R_FAILED_DURING_DERIVATION},
+ #else
+ {"FAILED_DURING_DERIVATION", 57, 164},
+ #endif
+ #ifdef PROV_R_FAILED_TO_CREATE_LOCK
+ {"FAILED_TO_CREATE_LOCK", ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_LOCK},
+ #else
+ {"FAILED_TO_CREATE_LOCK", 57, 180},
+ #endif
+ #ifdef PROV_R_FAILED_TO_DECRYPT
+ {"FAILED_TO_DECRYPT", ERR_LIB_PROV, PROV_R_FAILED_TO_DECRYPT},
+ #else
+ {"FAILED_TO_DECRYPT", 57, 162},
+ #endif
+ #ifdef PROV_R_FAILED_TO_GENERATE_KEY
+ {"FAILED_TO_GENERATE_KEY", ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_KEY},
+ #else
+ {"FAILED_TO_GENERATE_KEY", 57, 121},
+ #endif
+ #ifdef PROV_R_FAILED_TO_GET_PARAMETER
+ {"FAILED_TO_GET_PARAMETER", ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER},
+ #else
+ {"FAILED_TO_GET_PARAMETER", 57, 103},
+ #endif
+ #ifdef PROV_R_FAILED_TO_SET_PARAMETER
+ {"FAILED_TO_SET_PARAMETER", ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER},
+ #else
+ {"FAILED_TO_SET_PARAMETER", 57, 104},
+ #endif
+ #ifdef PROV_R_FAILED_TO_SIGN
+ {"FAILED_TO_SIGN", ERR_LIB_PROV, PROV_R_FAILED_TO_SIGN},
+ #else
+ {"FAILED_TO_SIGN", 57, 175},
+ #endif
+ #ifdef PROV_R_FIPS_MODULE_CONDITIONAL_ERROR
+ {"FIPS_MODULE_CONDITIONAL_ERROR", ERR_LIB_PROV, PROV_R_FIPS_MODULE_CONDITIONAL_ERROR},
+ #else
+ {"FIPS_MODULE_CONDITIONAL_ERROR", 57, 227},
+ #endif
+ #ifdef PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE
+ {"FIPS_MODULE_ENTERING_ERROR_STATE", ERR_LIB_PROV, PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE},
+ #else
+ {"FIPS_MODULE_ENTERING_ERROR_STATE", 57, 224},
+ #endif
+ #ifdef PROV_R_FIPS_MODULE_IN_ERROR_STATE
+ {"FIPS_MODULE_IN_ERROR_STATE", ERR_LIB_PROV, PROV_R_FIPS_MODULE_IN_ERROR_STATE},
+ #else
+ {"FIPS_MODULE_IN_ERROR_STATE", 57, 225},
+ #endif
+ #ifdef PROV_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_PROV, PROV_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 57, 191},
+ #endif
+ #ifdef PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_PROV, PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+ #else
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 57, 165},
+ #endif
+ #ifdef PROV_R_INDICATOR_INTEGRITY_FAILURE
+ {"INDICATOR_INTEGRITY_FAILURE", ERR_LIB_PROV, PROV_R_INDICATOR_INTEGRITY_FAILURE},
+ #else
+ {"INDICATOR_INTEGRITY_FAILURE", 57, 210},
+ #endif
+ #ifdef PROV_R_INSUFFICIENT_DRBG_STRENGTH
+ {"INSUFFICIENT_DRBG_STRENGTH", ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH},
+ #else
+ {"INSUFFICIENT_DRBG_STRENGTH", 57, 181},
+ #endif
+ #ifdef PROV_R_INVALID_AAD
+ {"INVALID_AAD", ERR_LIB_PROV, PROV_R_INVALID_AAD},
+ #else
+ {"INVALID_AAD", 57, 108},
+ #endif
+ #ifdef PROV_R_INVALID_CONFIG_DATA
+ {"INVALID_CONFIG_DATA", ERR_LIB_PROV, PROV_R_INVALID_CONFIG_DATA},
+ #else
+ {"INVALID_CONFIG_DATA", 57, 211},
+ #endif
+ #ifdef PROV_R_INVALID_CONSTANT_LENGTH
+ {"INVALID_CONSTANT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_CONSTANT_LENGTH},
+ #else
+ {"INVALID_CONSTANT_LENGTH", 57, 157},
+ #endif
+ #ifdef PROV_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_PROV, PROV_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 57, 176},
+ #endif
+ #ifdef PROV_R_INVALID_CUSTOM_LENGTH
+ {"INVALID_CUSTOM_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_CUSTOM_LENGTH},
+ #else
+ {"INVALID_CUSTOM_LENGTH", 57, 111},
+ #endif
+ #ifdef PROV_R_INVALID_DATA
+ {"INVALID_DATA", ERR_LIB_PROV, PROV_R_INVALID_DATA},
+ #else
+ {"INVALID_DATA", 57, 115},
+ #endif
+ #ifdef PROV_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_PROV, PROV_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 57, 122},
+ #endif
+ #ifdef PROV_R_INVALID_DIGEST_LENGTH
+ {"INVALID_DIGEST_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH},
+ #else
+ {"INVALID_DIGEST_LENGTH", 57, 166},
+ #endif
+ #ifdef PROV_R_INVALID_DIGEST_SIZE
+ {"INVALID_DIGEST_SIZE", ERR_LIB_PROV, PROV_R_INVALID_DIGEST_SIZE},
+ #else
+ {"INVALID_DIGEST_SIZE", 57, 218},
+ #endif
+ #ifdef PROV_R_INVALID_INPUT_LENGTH
+ {"INVALID_INPUT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_INPUT_LENGTH},
+ #else
+ {"INVALID_INPUT_LENGTH", 57, 230},
+ #endif
+ #ifdef PROV_R_INVALID_ITERATION_COUNT
+ {"INVALID_ITERATION_COUNT", ERR_LIB_PROV, PROV_R_INVALID_ITERATION_COUNT},
+ #else
+ {"INVALID_ITERATION_COUNT", 57, 123},
+ #endif
+ #ifdef PROV_R_INVALID_IV_LENGTH
+ {"INVALID_IV_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH},
+ #else
+ {"INVALID_IV_LENGTH", 57, 109},
+ #endif
+ #ifdef PROV_R_INVALID_KEY
+ {"INVALID_KEY", ERR_LIB_PROV, PROV_R_INVALID_KEY},
+ #else
+ {"INVALID_KEY", 57, 158},
+ #endif
+ #ifdef PROV_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 57, 105},
+ #endif
+ #ifdef PROV_R_INVALID_MAC
+ {"INVALID_MAC", ERR_LIB_PROV, PROV_R_INVALID_MAC},
+ #else
+ {"INVALID_MAC", 57, 151},
+ #endif
+ #ifdef PROV_R_INVALID_MGF1_MD
+ {"INVALID_MGF1_MD", ERR_LIB_PROV, PROV_R_INVALID_MGF1_MD},
+ #else
+ {"INVALID_MGF1_MD", 57, 167},
+ #endif
+ #ifdef PROV_R_INVALID_MODE
+ {"INVALID_MODE", ERR_LIB_PROV, PROV_R_INVALID_MODE},
+ #else
+ {"INVALID_MODE", 57, 125},
+ #endif
+ #ifdef PROV_R_INVALID_OUTPUT_LENGTH
+ {"INVALID_OUTPUT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_OUTPUT_LENGTH},
+ #else
+ {"INVALID_OUTPUT_LENGTH", 57, 217},
+ #endif
+ #ifdef PROV_R_INVALID_PADDING_MODE
+ {"INVALID_PADDING_MODE", ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE},
+ #else
+ {"INVALID_PADDING_MODE", 57, 168},
+ #endif
+ #ifdef PROV_R_INVALID_PUBINFO
+ {"INVALID_PUBINFO", ERR_LIB_PROV, PROV_R_INVALID_PUBINFO},
+ #else
+ {"INVALID_PUBINFO", 57, 198},
+ #endif
+ #ifdef PROV_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 57, 112},
+ #endif
+ #ifdef PROV_R_INVALID_SEED_LENGTH
+ {"INVALID_SEED_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_SEED_LENGTH},
+ #else
+ {"INVALID_SEED_LENGTH", 57, 154},
+ #endif
+ #ifdef PROV_R_INVALID_SIGNATURE_SIZE
+ {"INVALID_SIGNATURE_SIZE", ERR_LIB_PROV, PROV_R_INVALID_SIGNATURE_SIZE},
+ #else
+ {"INVALID_SIGNATURE_SIZE", 57, 179},
+ #endif
+ #ifdef PROV_R_INVALID_STATE
+ {"INVALID_STATE", ERR_LIB_PROV, PROV_R_INVALID_STATE},
+ #else
+ {"INVALID_STATE", 57, 212},
+ #endif
+ #ifdef PROV_R_INVALID_TAG
+ {"INVALID_TAG", ERR_LIB_PROV, PROV_R_INVALID_TAG},
+ #else
+ {"INVALID_TAG", 57, 110},
+ #endif
+ #ifdef PROV_R_INVALID_TAG_LENGTH
+ {"INVALID_TAG_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH},
+ #else
+ {"INVALID_TAG_LENGTH", 57, 118},
+ #endif
+ #ifdef PROV_R_INVALID_UKM_LENGTH
+ {"INVALID_UKM_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_UKM_LENGTH},
+ #else
+ {"INVALID_UKM_LENGTH", 57, 200},
+ #endif
+ #ifdef PROV_R_INVALID_X931_DIGEST
+ {"INVALID_X931_DIGEST", ERR_LIB_PROV, PROV_R_INVALID_X931_DIGEST},
+ #else
+ {"INVALID_X931_DIGEST", 57, 170},
+ #endif
+ #ifdef PROV_R_IN_ERROR_STATE
+ {"IN_ERROR_STATE", ERR_LIB_PROV, PROV_R_IN_ERROR_STATE},
+ #else
+ {"IN_ERROR_STATE", 57, 192},
+ #endif
+ #ifdef PROV_R_KEY_SETUP_FAILED
+ {"KEY_SETUP_FAILED", ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED},
+ #else
+ {"KEY_SETUP_FAILED", 57, 101},
+ #endif
+ #ifdef PROV_R_KEY_SIZE_TOO_SMALL
+ {"KEY_SIZE_TOO_SMALL", ERR_LIB_PROV, PROV_R_KEY_SIZE_TOO_SMALL},
+ #else
+ {"KEY_SIZE_TOO_SMALL", 57, 171},
+ #endif
+ #ifdef PROV_R_LENGTH_TOO_LARGE
+ {"LENGTH_TOO_LARGE", ERR_LIB_PROV, PROV_R_LENGTH_TOO_LARGE},
+ #else
+ {"LENGTH_TOO_LARGE", 57, 202},
+ #endif
+ #ifdef PROV_R_MISMATCHING_DOMAIN_PARAMETERS
+ {"MISMATCHING_DOMAIN_PARAMETERS", ERR_LIB_PROV, PROV_R_MISMATCHING_DOMAIN_PARAMETERS},
+ #else
+ {"MISMATCHING_DOMAIN_PARAMETERS", 57, 203},
+ #endif
+ #ifdef PROV_R_MISSING_CEK_ALG
+ {"MISSING_CEK_ALG", ERR_LIB_PROV, PROV_R_MISSING_CEK_ALG},
+ #else
+ {"MISSING_CEK_ALG", 57, 144},
+ #endif
+ #ifdef PROV_R_MISSING_CIPHER
+ {"MISSING_CIPHER", ERR_LIB_PROV, PROV_R_MISSING_CIPHER},
+ #else
+ {"MISSING_CIPHER", 57, 155},
+ #endif
+ #ifdef PROV_R_MISSING_CONFIG_DATA
+ {"MISSING_CONFIG_DATA", ERR_LIB_PROV, PROV_R_MISSING_CONFIG_DATA},
+ #else
+ {"MISSING_CONFIG_DATA", 57, 213},
+ #endif
+ #ifdef PROV_R_MISSING_CONSTANT
+ {"MISSING_CONSTANT", ERR_LIB_PROV, PROV_R_MISSING_CONSTANT},
+ #else
+ {"MISSING_CONSTANT", 57, 156},
+ #endif
+ #ifdef PROV_R_MISSING_KEY
+ {"MISSING_KEY", ERR_LIB_PROV, PROV_R_MISSING_KEY},
+ #else
+ {"MISSING_KEY", 57, 128},
+ #endif
+ #ifdef PROV_R_MISSING_MAC
+ {"MISSING_MAC", ERR_LIB_PROV, PROV_R_MISSING_MAC},
+ #else
+ {"MISSING_MAC", 57, 150},
+ #endif
+ #ifdef PROV_R_MISSING_MESSAGE_DIGEST
+ {"MISSING_MESSAGE_DIGEST", ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST},
+ #else
+ {"MISSING_MESSAGE_DIGEST", 57, 129},
+ #endif
+ #ifdef PROV_R_MISSING_OID
+ {"MISSING_OID", ERR_LIB_PROV, PROV_R_MISSING_OID},
+ #else
+ {"MISSING_OID", 57, 209},
+ #endif
+ #ifdef PROV_R_MISSING_PASS
+ {"MISSING_PASS", ERR_LIB_PROV, PROV_R_MISSING_PASS},
+ #else
+ {"MISSING_PASS", 57, 130},
+ #endif
+ #ifdef PROV_R_MISSING_SALT
+ {"MISSING_SALT", ERR_LIB_PROV, PROV_R_MISSING_SALT},
+ #else
+ {"MISSING_SALT", 57, 131},
+ #endif
+ #ifdef PROV_R_MISSING_SECRET
+ {"MISSING_SECRET", ERR_LIB_PROV, PROV_R_MISSING_SECRET},
+ #else
+ {"MISSING_SECRET", 57, 132},
+ #endif
+ #ifdef PROV_R_MISSING_SEED
+ {"MISSING_SEED", ERR_LIB_PROV, PROV_R_MISSING_SEED},
+ #else
+ {"MISSING_SEED", 57, 140},
+ #endif
+ #ifdef PROV_R_MISSING_SESSION_ID
+ {"MISSING_SESSION_ID", ERR_LIB_PROV, PROV_R_MISSING_SESSION_ID},
+ #else
+ {"MISSING_SESSION_ID", 57, 133},
+ #endif
+ #ifdef PROV_R_MISSING_TYPE
+ {"MISSING_TYPE", ERR_LIB_PROV, PROV_R_MISSING_TYPE},
+ #else
+ {"MISSING_TYPE", 57, 134},
+ #endif
+ #ifdef PROV_R_MISSING_XCGHASH
+ {"MISSING_XCGHASH", ERR_LIB_PROV, PROV_R_MISSING_XCGHASH},
+ #else
+ {"MISSING_XCGHASH", 57, 135},
+ #endif
+ #ifdef PROV_R_MODULE_INTEGRITY_FAILURE
+ {"MODULE_INTEGRITY_FAILURE", ERR_LIB_PROV, PROV_R_MODULE_INTEGRITY_FAILURE},
+ #else
+ {"MODULE_INTEGRITY_FAILURE", 57, 214},
+ #endif
+ #ifdef PROV_R_NOT_A_PRIVATE_KEY
+ {"NOT_A_PRIVATE_KEY", ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY},
+ #else
+ {"NOT_A_PRIVATE_KEY", 57, 221},
+ #endif
+ #ifdef PROV_R_NOT_A_PUBLIC_KEY
+ {"NOT_A_PUBLIC_KEY", ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY},
+ #else
+ {"NOT_A_PUBLIC_KEY", 57, 220},
+ #endif
+ #ifdef PROV_R_NOT_INSTANTIATED
+ {"NOT_INSTANTIATED", ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED},
+ #else
+ {"NOT_INSTANTIATED", 57, 193},
+ #endif
+ #ifdef PROV_R_NOT_PARAMETERS
+ {"NOT_PARAMETERS", ERR_LIB_PROV, PROV_R_NOT_PARAMETERS},
+ #else
+ {"NOT_PARAMETERS", 57, 226},
+ #endif
+ #ifdef PROV_R_NOT_SUPPORTED
+ {"NOT_SUPPORTED", ERR_LIB_PROV, PROV_R_NOT_SUPPORTED},
+ #else
+ {"NOT_SUPPORTED", 57, 136},
+ #endif
+ #ifdef PROV_R_NOT_XOF_OR_INVALID_LENGTH
+ {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_PROV, PROV_R_NOT_XOF_OR_INVALID_LENGTH},
+ #else
+ {"NOT_XOF_OR_INVALID_LENGTH", 57, 113},
+ #endif
+ #ifdef PROV_R_NO_KEY_SET
+ {"NO_KEY_SET", ERR_LIB_PROV, PROV_R_NO_KEY_SET},
+ #else
+ {"NO_KEY_SET", 57, 114},
+ #endif
+ #ifdef PROV_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 57, 177},
+ #endif
+ #ifdef PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_PROV, PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 57, 178},
+ #endif
+ #ifdef PROV_R_OUTPUT_BUFFER_TOO_SMALL
+ {"OUTPUT_BUFFER_TOO_SMALL", ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL},
+ #else
+ {"OUTPUT_BUFFER_TOO_SMALL", 57, 106},
+ #endif
+ #ifdef PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS
+ {"PARENT_CANNOT_GENERATE_RANDOM_NUMBERS", ERR_LIB_PROV, PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS},
+ #else
+ {"PARENT_CANNOT_GENERATE_RANDOM_NUMBERS", 57, 228},
+ #endif
+ #ifdef PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED
+ {"PARENT_CANNOT_SUPPLY_ENTROPY_SEED", ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED},
+ #else
+ {"PARENT_CANNOT_SUPPLY_ENTROPY_SEED", 57, 187},
+ #endif
+ #ifdef PROV_R_PARENT_LOCKING_NOT_ENABLED
+ {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED},
+ #else
+ {"PARENT_LOCKING_NOT_ENABLED", 57, 182},
+ #endif
+ #ifdef PROV_R_PARENT_STRENGTH_TOO_WEAK
+ {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK},
+ #else
+ {"PARENT_STRENGTH_TOO_WEAK", 57, 194},
+ #endif
+ #ifdef PROV_R_PATH_MUST_BE_ABSOLUTE
+ {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_PROV, PROV_R_PATH_MUST_BE_ABSOLUTE},
+ #else
+ {"PATH_MUST_BE_ABSOLUTE", 57, 219},
+ #endif
+ #ifdef PROV_R_PERSONALISATION_STRING_TOO_LONG
+ {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_TOO_LONG},
+ #else
+ {"PERSONALISATION_STRING_TOO_LONG", 57, 195},
+ #endif
+ #ifdef PROV_R_PSS_SALTLEN_TOO_SMALL
+ {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_PROV, PROV_R_PSS_SALTLEN_TOO_SMALL},
+ #else
+ {"PSS_SALTLEN_TOO_SMALL", 57, 172},
+ #endif
+ #ifdef PROV_R_REQUEST_TOO_LARGE_FOR_DRBG
+ {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_DRBG},
+ #else
+ {"REQUEST_TOO_LARGE_FOR_DRBG", 57, 196},
+ #endif
+ #ifdef PROV_R_REQUIRE_CTR_MODE_CIPHER
+ {"REQUIRE_CTR_MODE_CIPHER", ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER},
+ #else
+ {"REQUIRE_CTR_MODE_CIPHER", 57, 206},
+ #endif
+ #ifdef PROV_R_RESEED_ERROR
+ {"RESEED_ERROR", ERR_LIB_PROV, PROV_R_RESEED_ERROR},
+ #else
+ {"RESEED_ERROR", 57, 197},
+ #endif
+ #ifdef PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_PROV, PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES},
+ #else
+ {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 57, 222},
+ #endif
+ #ifdef PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT
+ {"SEED_SOURCES_MUST_NOT_HAVE_A_PARENT", ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT},
+ #else
+ {"SEED_SOURCES_MUST_NOT_HAVE_A_PARENT", 57, 229},
+ #endif
+ #ifdef PROV_R_SELF_TEST_KAT_FAILURE
+ {"SELF_TEST_KAT_FAILURE", ERR_LIB_PROV, PROV_R_SELF_TEST_KAT_FAILURE},
+ #else
+ {"SELF_TEST_KAT_FAILURE", 57, 215},
+ #endif
+ #ifdef PROV_R_SELF_TEST_POST_FAILURE
+ {"SELF_TEST_POST_FAILURE", ERR_LIB_PROV, PROV_R_SELF_TEST_POST_FAILURE},
+ #else
+ {"SELF_TEST_POST_FAILURE", 57, 216},
+ #endif
+ #ifdef PROV_R_TAG_NOT_NEEDED
+ {"TAG_NOT_NEEDED", ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED},
+ #else
+ {"TAG_NOT_NEEDED", 57, 120},
+ #endif
+ #ifdef PROV_R_TAG_NOT_SET
+ {"TAG_NOT_SET", ERR_LIB_PROV, PROV_R_TAG_NOT_SET},
+ #else
+ {"TAG_NOT_SET", 57, 119},
+ #endif
+ #ifdef PROV_R_TOO_MANY_RECORDS
+ {"TOO_MANY_RECORDS", ERR_LIB_PROV, PROV_R_TOO_MANY_RECORDS},
+ #else
+ {"TOO_MANY_RECORDS", 57, 126},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_FIND_CIPHERS
+ {"UNABLE_TO_FIND_CIPHERS", ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS},
+ #else
+ {"UNABLE_TO_FIND_CIPHERS", 57, 207},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_GET_PARENT_STRENGTH
+ {"UNABLE_TO_GET_PARENT_STRENGTH", ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH},
+ #else
+ {"UNABLE_TO_GET_PARENT_STRENGTH", 57, 199},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_GET_PASSPHRASE
+ {"UNABLE_TO_GET_PASSPHRASE", ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PASSPHRASE},
+ #else
+ {"UNABLE_TO_GET_PASSPHRASE", 57, 159},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_INITIALISE_CIPHERS
+ {"UNABLE_TO_INITIALISE_CIPHERS", ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS},
+ #else
+ {"UNABLE_TO_INITIALISE_CIPHERS", 57, 208},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_LOAD_SHA256
+ {"UNABLE_TO_LOAD_SHA256", ERR_LIB_PROV, PROV_R_UNABLE_TO_LOAD_SHA256},
+ #else
+ {"UNABLE_TO_LOAD_SHA256", 57, 147},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_LOCK_PARENT
+ {"UNABLE_TO_LOCK_PARENT", ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT},
+ #else
+ {"UNABLE_TO_LOCK_PARENT", 57, 201},
+ #endif
+ #ifdef PROV_R_UNABLE_TO_RESEED
+ {"UNABLE_TO_RESEED", ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED},
+ #else
+ {"UNABLE_TO_RESEED", 57, 204},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_CEK_ALG
+ {"UNSUPPORTED_CEK_ALG", ERR_LIB_PROV, PROV_R_UNSUPPORTED_CEK_ALG},
+ #else
+ {"UNSUPPORTED_CEK_ALG", 57, 145},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_KEY_SIZE
+ {"UNSUPPORTED_KEY_SIZE", ERR_LIB_PROV, PROV_R_UNSUPPORTED_KEY_SIZE},
+ #else
+ {"UNSUPPORTED_KEY_SIZE", 57, 153},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_MAC_TYPE
+ {"UNSUPPORTED_MAC_TYPE", ERR_LIB_PROV, PROV_R_UNSUPPORTED_MAC_TYPE},
+ #else
+ {"UNSUPPORTED_MAC_TYPE", 57, 137},
+ #endif
+ #ifdef PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_PROV, PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS},
+ #else
+ {"UNSUPPORTED_NUMBER_OF_ROUNDS", 57, 152},
+ #endif
+ #ifdef PROV_R_URI_AUTHORITY_UNSUPPORTED
+ {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_PROV, PROV_R_URI_AUTHORITY_UNSUPPORTED},
+ #else
+ {"URI_AUTHORITY_UNSUPPORTED", 57, 223},
+ #endif
+ #ifdef PROV_R_VALUE_ERROR
+ {"VALUE_ERROR", ERR_LIB_PROV, PROV_R_VALUE_ERROR},
+ #else
+ {"VALUE_ERROR", 57, 138},
+ #endif
+ #ifdef PROV_R_WRONG_FINAL_BLOCK_LENGTH
+ {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_PROV, PROV_R_WRONG_FINAL_BLOCK_LENGTH},
+ #else
+ {"WRONG_FINAL_BLOCK_LENGTH", 57, 107},
+ #endif
+ #ifdef PROV_R_WRONG_OUTPUT_BUFFER_SIZE
+ {"WRONG_OUTPUT_BUFFER_SIZE", ERR_LIB_PROV, PROV_R_WRONG_OUTPUT_BUFFER_SIZE},
+ #else
+ {"WRONG_OUTPUT_BUFFER_SIZE", 57, 139},
+ #endif
+ #ifdef PROV_R_XOF_DIGESTS_NOT_ALLOWED
+ {"XOF_DIGESTS_NOT_ALLOWED", ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED},
+ #else
+ {"XOF_DIGESTS_NOT_ALLOWED", 57, 183},
+ #endif
+ #ifdef PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", ERR_LIB_PROV, PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE},
+ #else
+ {"XTS_DATA_UNIT_IS_TOO_LARGE", 57, 148},
+ #endif
+ #ifdef PROV_R_XTS_DUPLICATED_KEYS
+ {"XTS_DUPLICATED_KEYS", ERR_LIB_PROV, PROV_R_XTS_DUPLICATED_KEYS},
+ #else
+ {"XTS_DUPLICATED_KEYS", 57, 149},
+ #endif
+ #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG
+ {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG},
+ #else
+ {"ADDITIONAL_INPUT_TOO_LONG", 36, 102},
+ #endif
+ #ifdef RAND_R_ALREADY_INSTANTIATED
+ {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED},
+ #else
+ {"ALREADY_INSTANTIATED", 36, 103},
+ #endif
+ #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE
+ {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE},
+ #else
+ {"ARGUMENT_OUT_OF_RANGE", 36, 105},
+ #endif
+ #ifdef RAND_R_CANNOT_OPEN_FILE
+ {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE},
+ #else
+ {"CANNOT_OPEN_FILE", 36, 121},
+ #endif
+ #ifdef RAND_R_DRBG_ALREADY_INITIALIZED
+ {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED},
+ #else
+ {"DRBG_ALREADY_INITIALIZED", 36, 129},
+ #endif
+ #ifdef RAND_R_DRBG_NOT_INITIALISED
+ {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED},
+ #else
+ {"DRBG_NOT_INITIALISED", 36, 104},
+ #endif
+ #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG
+ {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG},
+ #else
+ {"ENTROPY_INPUT_TOO_LONG", 36, 106},
+ #endif
+ #ifdef RAND_R_ENTROPY_OUT_OF_RANGE
+ {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE},
+ #else
+ {"ENTROPY_OUT_OF_RANGE", 36, 124},
+ #endif
+ #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED},
+ #else
+ {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127},
+ #endif
+ #ifdef RAND_R_ERROR_INITIALISING_DRBG
+ {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG},
+ #else
+ {"ERROR_INITIALISING_DRBG", 36, 107},
+ #endif
+ #ifdef RAND_R_ERROR_INSTANTIATING_DRBG
+ {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG},
+ #else
+ {"ERROR_INSTANTIATING_DRBG", 36, 108},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT},
+ #else
+ {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY
+ {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY},
+ #else
+ {"ERROR_RETRIEVING_ENTROPY", 36, 110},
+ #endif
+ #ifdef RAND_R_ERROR_RETRIEVING_NONCE
+ {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE},
+ #else
+ {"ERROR_RETRIEVING_NONCE", 36, 111},
+ #endif
+ #ifdef RAND_R_FAILED_TO_CREATE_LOCK
+ {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK},
+ #else
+ {"FAILED_TO_CREATE_LOCK", 36, 126},
+ #endif
+ #ifdef RAND_R_FUNC_NOT_IMPLEMENTED
+ {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED},
+ #else
+ {"FUNC_NOT_IMPLEMENTED", 36, 101},
+ #endif
+ #ifdef RAND_R_FWRITE_ERROR
+ {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR},
+ #else
+ {"FWRITE_ERROR", 36, 123},
+ #endif
+ #ifdef RAND_R_GENERATE_ERROR
+ {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR},
+ #else
+ {"GENERATE_ERROR", 36, 112},
+ #endif
+ #ifdef RAND_R_INSUFFICIENT_DRBG_STRENGTH
+ {"INSUFFICIENT_DRBG_STRENGTH", ERR_LIB_RAND, RAND_R_INSUFFICIENT_DRBG_STRENGTH},
+ #else
+ {"INSUFFICIENT_DRBG_STRENGTH", 36, 139},
+ #endif
+ #ifdef RAND_R_INTERNAL_ERROR
+ {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR},
+ #else
+ {"INTERNAL_ERROR", 36, 113},
+ #endif
+ #ifdef RAND_R_IN_ERROR_STATE
+ {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE},
+ #else
+ {"IN_ERROR_STATE", 36, 114},
+ #endif
+ #ifdef RAND_R_NOT_A_REGULAR_FILE
+ {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE},
+ #else
+ {"NOT_A_REGULAR_FILE", 36, 122},
+ #endif
+ #ifdef RAND_R_NOT_INSTANTIATED
+ {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED},
+ #else
+ {"NOT_INSTANTIATED", 36, 115},
+ #endif
+ #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED},
+ #else
+ {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128},
+ #endif
+ #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED
+ {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED},
+ #else
+ {"PARENT_LOCKING_NOT_ENABLED", 36, 130},
+ #endif
+ #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK
+ {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK},
+ #else
+ {"PARENT_STRENGTH_TOO_WEAK", 36, 131},
+ #endif
+ #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG
+ {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG},
+ #else
+ {"PERSONALISATION_STRING_TOO_LONG", 36, 116},
+ #endif
+ #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED},
+ #else
+ {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133},
+ #endif
+ #ifdef RAND_R_PRNG_NOT_SEEDED
+ {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED},
+ #else
+ {"PRNG_NOT_SEEDED", 36, 100},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_OVERFLOW
+ {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW},
+ #else
+ {"RANDOM_POOL_OVERFLOW", 36, 125},
+ #endif
+ #ifdef RAND_R_RANDOM_POOL_UNDERFLOW
+ {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW},
+ #else
+ {"RANDOM_POOL_UNDERFLOW", 36, 134},
+ #endif
+ #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG
+ {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG},
+ #else
+ {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117},
+ #endif
+ #ifdef RAND_R_RESEED_ERROR
+ {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR},
+ #else
+ {"RESEED_ERROR", 36, 118},
+ #endif
+ #ifdef RAND_R_SELFTEST_FAILURE
+ {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE},
+ #else
+ {"SELFTEST_FAILURE", 36, 119},
+ #endif
+ #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED
+ {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED},
+ #else
+ {"TOO_LITTLE_NONCE_REQUESTED", 36, 135},
+ #endif
+ #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED
+ {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED},
+ #else
+ {"TOO_MUCH_NONCE_REQUESTED", 36, 136},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_CREATE_DRBG
+ {"UNABLE_TO_CREATE_DRBG", ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG},
+ #else
+ {"UNABLE_TO_CREATE_DRBG", 36, 143},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_FETCH_DRBG
+ {"UNABLE_TO_FETCH_DRBG", ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG},
+ #else
+ {"UNABLE_TO_FETCH_DRBG", 36, 144},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER
+ {"UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER", ERR_LIB_RAND, RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER},
+ #else
+ {"UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER", 36, 141},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_GET_PARENT_STRENGTH
+ {"UNABLE_TO_GET_PARENT_STRENGTH", ERR_LIB_RAND, RAND_R_UNABLE_TO_GET_PARENT_STRENGTH},
+ #else
+ {"UNABLE_TO_GET_PARENT_STRENGTH", 36, 138},
+ #endif
+ #ifdef RAND_R_UNABLE_TO_LOCK_PARENT
+ {"UNABLE_TO_LOCK_PARENT", ERR_LIB_RAND, RAND_R_UNABLE_TO_LOCK_PARENT},
+ #else
+ {"UNABLE_TO_LOCK_PARENT", 36, 140},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS
+ {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS},
+ #else
+ {"UNSUPPORTED_DRBG_FLAGS", 36, 132},
+ #endif
+ #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE
+ {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE},
+ #else
+ {"UNSUPPORTED_DRBG_TYPE", 36, 120},
+ #endif
+ #ifdef RSA_R_ALGORITHM_MISMATCH
+ {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH},
+ #else
+ {"ALGORITHM_MISMATCH", 4, 100},
+ #endif
+ #ifdef RSA_R_BAD_E_VALUE
+ {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE},
+ #else
+ {"BAD_E_VALUE", 4, 101},
+ #endif
+ #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT
+ {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT},
+ #else
+ {"BAD_FIXED_HEADER_DECRYPT", 4, 102},
+ #endif
+ #ifdef RSA_R_BAD_PAD_BYTE_COUNT
+ {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT},
+ #else
+ {"BAD_PAD_BYTE_COUNT", 4, 103},
+ #endif
+ #ifdef RSA_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 4, 104},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01
+ {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01},
+ #else
+ {"BLOCK_TYPE_IS_NOT_01", 4, 106},
+ #endif
+ #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02
+ {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02},
+ #else
+ {"BLOCK_TYPE_IS_NOT_02", 4, 107},
+ #endif
+ #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN
+ {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN},
+ #else
+ {"DATA_GREATER_THAN_MOD_LEN", 4, 108},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE
+ {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE},
+ #else
+ {"DATA_TOO_LARGE", 4, 109},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110},
+ #endif
+ #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS
+ {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS},
+ #else
+ {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL
+ {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL},
+ #else
+ {"DATA_TOO_SMALL", 4, 111},
+ #endif
+ #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE},
+ #else
+ {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122},
+ #endif
+ #ifdef RSA_R_DIGEST_DOES_NOT_MATCH
+ {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH},
+ #else
+ {"DIGEST_DOES_NOT_MATCH", 4, 158},
+ #endif
+ #ifdef RSA_R_DIGEST_NOT_ALLOWED
+ {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED},
+ #else
+ {"DIGEST_NOT_ALLOWED", 4, 145},
+ #endif
+ #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY},
+ #else
+ {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112},
+ #endif
+ #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D
+ {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMP1_NOT_CONGRUENT_TO_D", 4, 124},
+ #endif
+ #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D
+ {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D},
+ #else
+ {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125},
+ #endif
+ #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1
+ {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1},
+ #else
+ {"D_E_NOT_CONGRUENT_TO_1", 4, 123},
+ #endif
+ #ifdef RSA_R_FIRST_OCTET_INVALID
+ {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID},
+ #else
+ {"FIRST_OCTET_INVALID", 4, 133},
+ #endif
+ #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE},
+ #else
+ {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 4, 157},
+ #endif
+ #ifdef RSA_R_INVALID_DIGEST_LENGTH
+ {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH},
+ #else
+ {"INVALID_DIGEST_LENGTH", 4, 143},
+ #endif
+ #ifdef RSA_R_INVALID_HEADER
+ {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER},
+ #else
+ {"INVALID_HEADER", 4, 137},
+ #endif
+ #ifdef RSA_R_INVALID_KEYPAIR
+ {"INVALID_KEYPAIR", ERR_LIB_RSA, RSA_R_INVALID_KEYPAIR},
+ #else
+ {"INVALID_KEYPAIR", 4, 171},
+ #endif
+ #ifdef RSA_R_INVALID_KEY_LENGTH
+ {"INVALID_KEY_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_KEY_LENGTH},
+ #else
+ {"INVALID_KEY_LENGTH", 4, 173},
+ #endif
+ #ifdef RSA_R_INVALID_LABEL
+ {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL},
+ #else
+ {"INVALID_LABEL", 4, 160},
+ #endif
+ #ifdef RSA_R_INVALID_LENGTH
+ {"INVALID_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_LENGTH},
+ #else
+ {"INVALID_LENGTH", 4, 181},
+ #endif
+ #ifdef RSA_R_INVALID_MESSAGE_LENGTH
+ {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH},
+ #else
+ {"INVALID_MESSAGE_LENGTH", 4, 131},
+ #endif
+ #ifdef RSA_R_INVALID_MGF1_MD
+ {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD},
+ #else
+ {"INVALID_MGF1_MD", 4, 156},
+ #endif
+ #ifdef RSA_R_INVALID_MODULUS
+ {"INVALID_MODULUS", ERR_LIB_RSA, RSA_R_INVALID_MODULUS},
+ #else
+ {"INVALID_MODULUS", 4, 174},
+ #endif
+ #ifdef RSA_R_INVALID_MULTI_PRIME_KEY
+ {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY},
+ #else
+ {"INVALID_MULTI_PRIME_KEY", 4, 167},
+ #endif
+ #ifdef RSA_R_INVALID_OAEP_PARAMETERS
+ {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS},
+ #else
+ {"INVALID_OAEP_PARAMETERS", 4, 161},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING
+ {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING},
+ #else
+ {"INVALID_PADDING", 4, 138},
+ #endif
+ #ifdef RSA_R_INVALID_PADDING_MODE
+ {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE},
+ #else
+ {"INVALID_PADDING_MODE", 4, 141},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_PARAMETERS
+ {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS},
+ #else
+ {"INVALID_PSS_PARAMETERS", 4, 149},
+ #endif
+ #ifdef RSA_R_INVALID_PSS_SALTLEN
+ {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN},
+ #else
+ {"INVALID_PSS_SALTLEN", 4, 146},
+ #endif
+ #ifdef RSA_R_INVALID_REQUEST
+ {"INVALID_REQUEST", ERR_LIB_RSA, RSA_R_INVALID_REQUEST},
+ #else
+ {"INVALID_REQUEST", 4, 175},
+ #endif
+ #ifdef RSA_R_INVALID_SALT_LENGTH
+ {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH},
+ #else
+ {"INVALID_SALT_LENGTH", 4, 150},
+ #endif
+ #ifdef RSA_R_INVALID_STRENGTH
+ {"INVALID_STRENGTH", ERR_LIB_RSA, RSA_R_INVALID_STRENGTH},
+ #else
+ {"INVALID_STRENGTH", 4, 176},
+ #endif
+ #ifdef RSA_R_INVALID_TRAILER
+ {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER},
+ #else
+ {"INVALID_TRAILER", 4, 139},
+ #endif
+ #ifdef RSA_R_INVALID_X931_DIGEST
+ {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST},
+ #else
+ {"INVALID_X931_DIGEST", 4, 142},
+ #endif
+ #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q
+ {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q},
+ #else
+ {"IQMP_NOT_INVERSE_OF_Q", 4, 126},
+ #endif
+ #ifdef RSA_R_KEY_PRIME_NUM_INVALID
+ {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID},
+ #else
+ {"KEY_PRIME_NUM_INVALID", 4, 165},
+ #endif
+ #ifdef RSA_R_KEY_SIZE_TOO_SMALL
+ {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL},
+ #else
+ {"KEY_SIZE_TOO_SMALL", 4, 120},
+ #endif
+ #ifdef RSA_R_LAST_OCTET_INVALID
+ {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID},
+ #else
+ {"LAST_OCTET_INVALID", 4, 134},
+ #endif
+ #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED
+ {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED},
+ #else
+ {"MGF1_DIGEST_NOT_ALLOWED", 4, 152},
+ #endif
+ #ifdef RSA_R_MISSING_PRIVATE_KEY
+ {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY},
+ #else
+ {"MISSING_PRIVATE_KEY", 4, 179},
+ #endif
+ #ifdef RSA_R_MODULUS_TOO_LARGE
+ {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE},
+ #else
+ {"MODULUS_TOO_LARGE", 4, 105},
+ #endif
+ #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R},
+ #else
+ {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168},
+ #endif
+ #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D},
+ #else
+ {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169},
+ #endif
+ #ifdef RSA_R_MP_R_NOT_PRIME
+ {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME},
+ #else
+ {"MP_R_NOT_PRIME", 4, 170},
+ #endif
+ #ifdef RSA_R_NO_PUBLIC_EXPONENT
+ {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT},
+ #else
+ {"NO_PUBLIC_EXPONENT", 4, 140},
+ #endif
+ #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING
+ {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING},
+ #else
+ {"NULL_BEFORE_BLOCK_MISSING", 4, 113},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES},
+ #else
+ {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172},
+ #endif
+ #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q
+ {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q},
+ #else
+ {"N_DOES_NOT_EQUAL_P_Q", 4, 127},
+ #endif
+ #ifdef RSA_R_OAEP_DECODING_ERROR
+ {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR},
+ #else
+ {"OAEP_DECODING_ERROR", 4, 121},
+ #endif
+ #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE},
+ #else
+ {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148},
+ #endif
+ #ifdef RSA_R_PADDING_CHECK_FAILED
+ {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED},
+ #else
+ {"PADDING_CHECK_FAILED", 4, 114},
+ #endif
+ #ifdef RSA_R_PAIRWISE_TEST_FAILURE
+ {"PAIRWISE_TEST_FAILURE", ERR_LIB_RSA, RSA_R_PAIRWISE_TEST_FAILURE},
+ #else
+ {"PAIRWISE_TEST_FAILURE", 4, 177},
+ #endif
+ #ifdef RSA_R_PKCS_DECODING_ERROR
+ {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR},
+ #else
+ {"PKCS_DECODING_ERROR", 4, 159},
+ #endif
+ #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL
+ {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL},
+ #else
+ {"PSS_SALTLEN_TOO_SMALL", 4, 164},
+ #endif
+ #ifdef RSA_R_PUB_EXPONENT_OUT_OF_RANGE
+ {"PUB_EXPONENT_OUT_OF_RANGE", ERR_LIB_RSA, RSA_R_PUB_EXPONENT_OUT_OF_RANGE},
+ #else
+ {"PUB_EXPONENT_OUT_OF_RANGE", 4, 178},
+ #endif
+ #ifdef RSA_R_P_NOT_PRIME
+ {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME},
+ #else
+ {"P_NOT_PRIME", 4, 128},
+ #endif
+ #ifdef RSA_R_Q_NOT_PRIME
+ {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME},
+ #else
+ {"Q_NOT_PRIME", 4, 129},
+ #endif
+ #ifdef RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT
+ {"RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT", ERR_LIB_RSA, RSA_R_RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT},
+ #else
+ {"RANDOMNESS_SOURCE_STRENGTH_INSUFFICIENT", 4, 180},
+ #endif
+ #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
+ {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED},
+ #else
+ {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130},
+ #endif
+ #ifdef RSA_R_SLEN_CHECK_FAILED
+ {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED},
+ #else
+ {"SLEN_CHECK_FAILED", 4, 136},
+ #endif
+ #ifdef RSA_R_SLEN_RECOVERY_FAILED
+ {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED},
+ #else
+ {"SLEN_RECOVERY_FAILED", 4, 135},
+ #endif
+ #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK
+ {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK},
+ #else
+ {"SSLV3_ROLLBACK_ATTACK", 4, 115},
+ #endif
+ #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD},
+ #else
+ {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116},
+ #endif
+ #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE
+ {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE},
+ #else
+ {"UNKNOWN_ALGORITHM_TYPE", 4, 117},
+ #endif
+ #ifdef RSA_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 4, 166},
+ #endif
+ #ifdef RSA_R_UNKNOWN_MASK_DIGEST
+ {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST},
+ #else
+ {"UNKNOWN_MASK_DIGEST", 4, 151},
+ #endif
+ #ifdef RSA_R_UNKNOWN_PADDING_TYPE
+ {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE},
+ #else
+ {"UNKNOWN_PADDING_TYPE", 4, 118},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE
+ {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE},
+ #else
+ {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE
+ {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE},
+ #else
+ {"UNSUPPORTED_LABEL_SOURCE", 4, 163},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM
+ {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MASK_ALGORITHM", 4, 153},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER
+ {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER},
+ #else
+ {"UNSUPPORTED_MASK_PARAMETER", 4, 154},
+ #endif
+ #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE
+ {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE},
+ #else
+ {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155},
+ #endif
+ #ifdef RSA_R_VALUE_MISSING
+ {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING},
+ #else
+ {"VALUE_MISSING", 4, 147},
+ #endif
+ #ifdef RSA_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 4, 119},
+ #endif
+ #ifdef SM2_R_ASN1_ERROR
+ {"ASN1_ERROR", ERR_LIB_SM2, SM2_R_ASN1_ERROR},
+ #else
+ {"ASN1_ERROR", 53, 100},
+ #endif
+ #ifdef SM2_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SM2, SM2_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 53, 101},
+ #endif
+ #ifdef SM2_R_BUFFER_TOO_SMALL
+ {"BUFFER_TOO_SMALL", ERR_LIB_SM2, SM2_R_BUFFER_TOO_SMALL},
+ #else
+ {"BUFFER_TOO_SMALL", 53, 107},
+ #endif
+ #ifdef SM2_R_DIST_ID_TOO_LARGE
+ {"DIST_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_DIST_ID_TOO_LARGE},
+ #else
+ {"DIST_ID_TOO_LARGE", 53, 110},
+ #endif
+ #ifdef SM2_R_ID_NOT_SET
+ {"ID_NOT_SET", ERR_LIB_SM2, SM2_R_ID_NOT_SET},
+ #else
+ {"ID_NOT_SET", 53, 112},
+ #endif
+ #ifdef SM2_R_ID_TOO_LARGE
+ {"ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_ID_TOO_LARGE},
+ #else
+ {"ID_TOO_LARGE", 53, 111},
+ #endif
+ #ifdef SM2_R_INVALID_CURVE
+ {"INVALID_CURVE", ERR_LIB_SM2, SM2_R_INVALID_CURVE},
+ #else
+ {"INVALID_CURVE", 53, 108},
+ #endif
+ #ifdef SM2_R_INVALID_DIGEST
+ {"INVALID_DIGEST", ERR_LIB_SM2, SM2_R_INVALID_DIGEST},
+ #else
+ {"INVALID_DIGEST", 53, 102},
+ #endif
+ #ifdef SM2_R_INVALID_DIGEST_TYPE
+ {"INVALID_DIGEST_TYPE", ERR_LIB_SM2, SM2_R_INVALID_DIGEST_TYPE},
+ #else
+ {"INVALID_DIGEST_TYPE", 53, 103},
+ #endif
+ #ifdef SM2_R_INVALID_ENCODING
+ {"INVALID_ENCODING", ERR_LIB_SM2, SM2_R_INVALID_ENCODING},
+ #else
+ {"INVALID_ENCODING", 53, 104},
+ #endif
+ #ifdef SM2_R_INVALID_FIELD
+ {"INVALID_FIELD", ERR_LIB_SM2, SM2_R_INVALID_FIELD},
+ #else
+ {"INVALID_FIELD", 53, 105},
+ #endif
+ #ifdef SM2_R_INVALID_PRIVATE_KEY
+ {"INVALID_PRIVATE_KEY", ERR_LIB_SM2, SM2_R_INVALID_PRIVATE_KEY},
+ #else
+ {"INVALID_PRIVATE_KEY", 53, 113},
+ #endif
+ #ifdef SM2_R_NO_PARAMETERS_SET
+ {"NO_PARAMETERS_SET", ERR_LIB_SM2, SM2_R_NO_PARAMETERS_SET},
+ #else
+ {"NO_PARAMETERS_SET", 53, 109},
+ #endif
+ #ifdef SM2_R_USER_ID_TOO_LARGE
+ {"USER_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_USER_ID_TOO_LARGE},
+ #else
+ {"USER_ID_TOO_LARGE", 53, 106},
+ #endif
+ #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY},
+ #else
+ {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291},
+ #endif
+ #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
+ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
+ #else
+ {"APP_DATA_IN_HANDSHAKE", 20, 100},
+ #endif
+ #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
+ #else
+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272},
+ #endif
+ #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE},
+ #else
+ {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158},
+ #endif
+ #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
+ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
+ #else
+ {"BAD_CHANGE_CIPHER_SPEC", 20, 103},
+ #endif
+ #ifdef SSL_R_BAD_CIPHER
+ {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER},
+ #else
+ {"BAD_CIPHER", 20, 186},
+ #endif
+ #ifdef SSL_R_BAD_DATA
+ {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA},
+ #else
+ {"BAD_DATA", 20, 390},
+ #endif
+ #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
+ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
+ #else
+ {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106},
+ #endif
+ #ifdef SSL_R_BAD_DECOMPRESSION
+ {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
+ #else
+ {"BAD_DECOMPRESSION", 20, 107},
+ #endif
+ #ifdef SSL_R_BAD_DH_VALUE
+ {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE},
+ #else
+ {"BAD_DH_VALUE", 20, 102},
+ #endif
+ #ifdef SSL_R_BAD_DIGEST_LENGTH
+ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
+ #else
+ {"BAD_DIGEST_LENGTH", 20, 111},
+ #endif
+ #ifdef SSL_R_BAD_EARLY_DATA
+ {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA},
+ #else
+ {"BAD_EARLY_DATA", 20, 233},
+ #endif
+ #ifdef SSL_R_BAD_ECC_CERT
+ {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
+ #else
+ {"BAD_ECC_CERT", 20, 304},
+ #endif
+ #ifdef SSL_R_BAD_ECPOINT
+ {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
+ #else
+ {"BAD_ECPOINT", 20, 306},
+ #endif
+ #ifdef SSL_R_BAD_EXTENSION
+ {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION},
+ #else
+ {"BAD_EXTENSION", 20, 110},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
+ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
+ #else
+ {"BAD_HANDSHAKE_LENGTH", 20, 332},
+ #endif
+ #ifdef SSL_R_BAD_HANDSHAKE_STATE
+ {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE},
+ #else
+ {"BAD_HANDSHAKE_STATE", 20, 236},
+ #endif
+ #ifdef SSL_R_BAD_HELLO_REQUEST
+ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
+ #else
+ {"BAD_HELLO_REQUEST", 20, 105},
+ #endif
+ #ifdef SSL_R_BAD_HRR_VERSION
+ {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION},
+ #else
+ {"BAD_HRR_VERSION", 20, 263},
+ #endif
+ #ifdef SSL_R_BAD_KEY_SHARE
+ {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE},
+ #else
+ {"BAD_KEY_SHARE", 20, 108},
+ #endif
+ #ifdef SSL_R_BAD_KEY_UPDATE
+ {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE},
+ #else
+ {"BAD_KEY_UPDATE", 20, 122},
+ #endif
+ #ifdef SSL_R_BAD_LEGACY_VERSION
+ {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION},
+ #else
+ {"BAD_LEGACY_VERSION", 20, 292},
+ #endif
+ #ifdef SSL_R_BAD_LENGTH
+ {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
+ #else
+ {"BAD_LENGTH", 20, 271},
+ #endif
+ #ifdef SSL_R_BAD_PACKET
+ {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET},
+ #else
+ {"BAD_PACKET", 20, 240},
+ #endif
+ #ifdef SSL_R_BAD_PACKET_LENGTH
+ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
+ #else
+ {"BAD_PACKET_LENGTH", 20, 115},
+ #endif
+ #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
+ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
+ #else
+ {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116},
+ #endif
+ #ifdef SSL_R_BAD_PSK
+ {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK},
+ #else
+ {"BAD_PSK", 20, 219},
+ #endif
+ #ifdef SSL_R_BAD_PSK_IDENTITY
+ {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY},
+ #else
+ {"BAD_PSK_IDENTITY", 20, 114},
+ #endif
+ #ifdef SSL_R_BAD_RECORD_TYPE
+ {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE},
+ #else
+ {"BAD_RECORD_TYPE", 20, 443},
+ #endif
+ #ifdef SSL_R_BAD_RSA_ENCRYPT
+ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
+ #else
+ {"BAD_RSA_ENCRYPT", 20, 119},
+ #endif
+ #ifdef SSL_R_BAD_SIGNATURE
+ {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
+ #else
+ {"BAD_SIGNATURE", 20, 123},
+ #endif
+ #ifdef SSL_R_BAD_SRP_A_LENGTH
+ {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH},
+ #else
+ {"BAD_SRP_A_LENGTH", 20, 347},
+ #endif
+ #ifdef SSL_R_BAD_SRP_PARAMETERS
+ {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS},
+ #else
+ {"BAD_SRP_PARAMETERS", 20, 371},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_MKI_VALUE
+ {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE},
+ #else
+ {"BAD_SRTP_MKI_VALUE", 20, 352},
+ #endif
+ #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353},
+ #endif
+ #ifdef SSL_R_BAD_SSL_FILETYPE
+ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
+ #else
+ {"BAD_SSL_FILETYPE", 20, 124},
+ #endif
+ #ifdef SSL_R_BAD_VALUE
+ {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE},
+ #else
+ {"BAD_VALUE", 20, 384},
+ #endif
+ #ifdef SSL_R_BAD_WRITE_RETRY
+ {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
+ #else
+ {"BAD_WRITE_RETRY", 20, 127},
+ #endif
+ #ifdef SSL_R_BINDER_DOES_NOT_VERIFY
+ {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY},
+ #else
+ {"BINDER_DOES_NOT_VERIFY", 20, 253},
+ #endif
+ #ifdef SSL_R_BIO_NOT_SET
+ {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
+ #else
+ {"BIO_NOT_SET", 20, 128},
+ #endif
+ #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
+ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
+ #else
+ {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129},
+ #endif
+ #ifdef SSL_R_BN_LIB
+ {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
+ #else
+ {"BN_LIB", 20, 130},
+ #endif
+ #ifdef SSL_R_CALLBACK_FAILED
+ {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED},
+ #else
+ {"CALLBACK_FAILED", 20, 234},
+ #endif
+ #ifdef SSL_R_CANNOT_CHANGE_CIPHER
+ {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER},
+ #else
+ {"CANNOT_CHANGE_CIPHER", 20, 109},
+ #endif
+ #ifdef SSL_R_CANNOT_GET_GROUP_NAME
+ {"CANNOT_GET_GROUP_NAME", ERR_LIB_SSL, SSL_R_CANNOT_GET_GROUP_NAME},
+ #else
+ {"CANNOT_GET_GROUP_NAME", 20, 299},
+ #endif
+ #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
+ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
+ #else
+ {"CA_DN_LENGTH_MISMATCH", 20, 131},
+ #endif
+ #ifdef SSL_R_CA_KEY_TOO_SMALL
+ {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL},
+ #else
+ {"CA_KEY_TOO_SMALL", 20, 397},
+ #endif
+ #ifdef SSL_R_CA_MD_TOO_WEAK
+ {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK},
+ #else
+ {"CA_MD_TOO_WEAK", 20, 398},
+ #endif
+ #ifdef SSL_R_CCS_RECEIVED_EARLY
+ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
+ #else
+ {"CCS_RECEIVED_EARLY", 20, 133},
+ #endif
+ #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
+ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED},
+ #else
+ {"CERTIFICATE_VERIFY_FAILED", 20, 134},
+ #endif
+ #ifdef SSL_R_CERT_CB_ERROR
+ {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR},
+ #else
+ {"CERT_CB_ERROR", 20, 377},
+ #endif
+ #ifdef SSL_R_CERT_LENGTH_MISMATCH
+ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
+ #else
+ {"CERT_LENGTH_MISMATCH", 20, 135},
+ #endif
+ #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED},
+ #else
+ {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218},
+ #endif
+ #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
+ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH},
+ #else
+ {"CIPHER_CODE_WRONG_LENGTH", 20, 137},
+ #endif
+ #ifdef SSL_R_CLIENTHELLO_TLSEXT
+ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
+ #else
+ {"CLIENTHELLO_TLSEXT", 20, 226},
+ #endif
+ #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
+ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG},
+ #else
+ {"COMPRESSED_LENGTH_TOO_LONG", 20, 140},
+ #endif
+ #ifdef SSL_R_COMPRESSION_DISABLED
+ {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
+ #else
+ {"COMPRESSION_DISABLED", 20, 343},
+ #endif
+ #ifdef SSL_R_COMPRESSION_FAILURE
+ {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
+ #else
+ {"COMPRESSION_FAILURE", 20, 141},
+ #endif
+ #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
+ #else
+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307},
+ #endif
+ #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
+ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR},
+ #else
+ {"COMPRESSION_LIBRARY_ERROR", 20, 142},
+ #endif
+ #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
+ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
+ #else
+ {"CONNECTION_TYPE_NOT_SET", 20, 144},
+ #endif
+ #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED
+ {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED},
+ #else
+ {"CONTEXT_NOT_DANE_ENABLED", 20, 167},
+ #endif
+ #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE
+ {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE},
+ #else
+ {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400},
+ #endif
+ #ifdef SSL_R_COOKIE_MISMATCH
+ {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
+ #else
+ {"COOKIE_MISMATCH", 20, 308},
+ #endif
+ #ifdef SSL_R_COPY_PARAMETERS_FAILED
+ {"COPY_PARAMETERS_FAILED", ERR_LIB_SSL, SSL_R_COPY_PARAMETERS_FAILED},
+ #else
+ {"COPY_PARAMETERS_FAILED", 20, 296},
+ #endif
+ #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED},
+ #else
+ {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206},
+ #endif
+ #ifdef SSL_R_DANE_ALREADY_ENABLED
+ {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED},
+ #else
+ {"DANE_ALREADY_ENABLED", 20, 172},
+ #endif
+ #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL},
+ #else
+ {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173},
+ #endif
+ #ifdef SSL_R_DANE_NOT_ENABLED
+ {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED},
+ #else
+ {"DANE_NOT_ENABLED", 20, 175},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE
+ {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE", 20, 180},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE},
+ #else
+ {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH
+ {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH},
+ #else
+ {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE
+ {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE},
+ #else
+ {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY
+ {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY},
+ #else
+ {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR
+ {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR},
+ #else
+ {"DANE_TLSA_BAD_SELECTOR", 20, 202},
+ #endif
+ #ifdef SSL_R_DANE_TLSA_NULL_DATA
+ {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA},
+ #else
+ {"DANE_TLSA_NULL_DATA", 20, 203},
+ #endif
+ #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
+ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
+ #else
+ {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145},
+ #endif
+ #ifdef SSL_R_DATA_LENGTH_TOO_LONG
+ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
+ #else
+ {"DATA_LENGTH_TOO_LONG", 20, 146},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED
+ {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
+ #else
+ {"DECRYPTION_FAILED", 20, 147},
+ #endif
+ #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
+ #else
+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281},
+ #endif
+ #ifdef SSL_R_DH_KEY_TOO_SMALL
+ {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL},
+ #else
+ {"DH_KEY_TOO_SMALL", 20, 394},
+ #endif
+ #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
+ #else
+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148},
+ #endif
+ #ifdef SSL_R_DIGEST_CHECK_FAILED
+ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
+ #else
+ {"DIGEST_CHECK_FAILED", 20, 149},
+ #endif
+ #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
+ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
+ #else
+ {"DTLS_MESSAGE_TOO_BIG", 20, 334},
+ #endif
+ #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
+ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID},
+ #else
+ {"DUPLICATE_COMPRESSION_ID", 20, 309},
+ #endif
+ #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
+ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING},
+ #else
+ {"ECC_CERT_NOT_FOR_SIGNING", 20, 318},
+ #endif
+ #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE},
+ #else
+ {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374},
+ #endif
+ #ifdef SSL_R_EE_KEY_TOO_SMALL
+ {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL},
+ #else
+ {"EE_KEY_TOO_SMALL", 20, 399},
+ #endif
+ #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST},
+ #else
+ {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354},
+ #endif
+ #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
+ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
+ #else
+ {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150},
+ #endif
+ #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
+ #else
+ {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151},
+ #endif
+ #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN},
+ #else
+ {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204},
+ #endif
+ #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE},
+ #else
+ {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194},
+ #endif
+ #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
+ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
+ #else
+ {"EXCESSIVE_MESSAGE_SIZE", 20, 152},
+ #endif
+ #ifdef SSL_R_EXTENSION_NOT_RECEIVED
+ {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED},
+ #else
+ {"EXTENSION_NOT_RECEIVED", 20, 279},
+ #endif
+ #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
+ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
+ #else
+ {"EXTRA_DATA_IN_MESSAGE", 20, 153},
+ #endif
+ #ifdef SSL_R_EXT_LENGTH_MISMATCH
+ {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH},
+ #else
+ {"EXT_LENGTH_MISMATCH", 20, 163},
+ #endif
+ #ifdef SSL_R_FAILED_TO_INIT_ASYNC
+ {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC},
+ #else
+ {"FAILED_TO_INIT_ASYNC", 20, 405},
+ #endif
+ #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO
+ {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO},
+ #else
+ {"FRAGMENTED_CLIENT_HELLO", 20, 401},
+ #endif
+ #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
+ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
+ #else
+ {"GOT_A_FIN_BEFORE_A_CCS", 20, 154},
+ #endif
+ #ifdef SSL_R_HTTPS_PROXY_REQUEST
+ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
+ #else
+ {"HTTPS_PROXY_REQUEST", 20, 155},
+ #endif
+ #ifdef SSL_R_HTTP_REQUEST
+ {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
+ #else
+ {"HTTP_REQUEST", 20, 156},
+ #endif
+ #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION
+ {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION},
+ #else
+ {"ILLEGAL_POINT_COMPRESSION", 20, 162},
+ #endif
+ #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST
+ {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST},
+ #else
+ {"ILLEGAL_SUITEB_DIGEST", 20, 380},
+ #endif
+ #ifdef SSL_R_INAPPROPRIATE_FALLBACK
+ {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK},
+ #else
+ {"INAPPROPRIATE_FALLBACK", 20, 373},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_COMPRESSION
+ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION},
+ #else
+ {"INCONSISTENT_COMPRESSION", 20, 340},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN
+ {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN},
+ #else
+ {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI
+ {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI},
+ #else
+ {"INCONSISTENT_EARLY_DATA_SNI", 20, 231},
+ #endif
+ #ifdef SSL_R_INCONSISTENT_EXTMS
+ {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS},
+ #else
+ {"INCONSISTENT_EXTMS", 20, 104},
+ #endif
+ #ifdef SSL_R_INSUFFICIENT_SECURITY
+ {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY},
+ #else
+ {"INSUFFICIENT_SECURITY", 20, 241},
+ #endif
+ #ifdef SSL_R_INVALID_ALERT
+ {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT},
+ #else
+ {"INVALID_ALERT", 20, 205},
+ #endif
+ #ifdef SSL_R_INVALID_CCS_MESSAGE
+ {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE},
+ #else
+ {"INVALID_CCS_MESSAGE", 20, 260},
+ #endif
+ #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG
+ {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG},
+ #else
+ {"INVALID_CERTIFICATE_OR_ALG", 20, 238},
+ #endif
+ #ifdef SSL_R_INVALID_COMMAND
+ {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
+ #else
+ {"INVALID_COMMAND", 20, 280},
+ #endif
+ #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
+ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM},
+ #else
+ {"INVALID_COMPRESSION_ALGORITHM", 20, 341},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIG
+ {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG},
+ #else
+ {"INVALID_CONFIG", 20, 283},
+ #endif
+ #ifdef SSL_R_INVALID_CONFIGURATION_NAME
+ {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME},
+ #else
+ {"INVALID_CONFIGURATION_NAME", 20, 113},
+ #endif
+ #ifdef SSL_R_INVALID_CONTEXT
+ {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT},
+ #else
+ {"INVALID_CONTEXT", 20, 282},
+ #endif
+ #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE
+ {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE},
+ #else
+ {"INVALID_CT_VALIDATION_TYPE", 20, 212},
+ #endif
+ #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE
+ {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE},
+ #else
+ {"INVALID_KEY_UPDATE_TYPE", 20, 120},
+ #endif
+ #ifdef SSL_R_INVALID_MAX_EARLY_DATA
+ {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA},
+ #else
+ {"INVALID_MAX_EARLY_DATA", 20, 174},
+ #endif
+ #ifdef SSL_R_INVALID_NULL_CMD_NAME
+ {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME},
+ #else
+ {"INVALID_NULL_CMD_NAME", 20, 385},
+ #endif
+ #ifdef SSL_R_INVALID_SEQUENCE_NUMBER
+ {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER},
+ #else
+ {"INVALID_SEQUENCE_NUMBER", 20, 402},
+ #endif
+ #ifdef SSL_R_INVALID_SERVERINFO_DATA
+ {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA},
+ #else
+ {"INVALID_SERVERINFO_DATA", 20, 388},
+ #endif
+ #ifdef SSL_R_INVALID_SESSION_ID
+ {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID},
+ #else
+ {"INVALID_SESSION_ID", 20, 999},
+ #endif
+ #ifdef SSL_R_INVALID_SRP_USERNAME
+ {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME},
+ #else
+ {"INVALID_SRP_USERNAME", 20, 357},
+ #endif
+ #ifdef SSL_R_INVALID_STATUS_RESPONSE
+ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
+ #else
+ {"INVALID_STATUS_RESPONSE", 20, 328},
+ #endif
+ #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
+ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH},
+ #else
+ {"INVALID_TICKET_KEYS_LENGTH", 20, 325},
+ #endif
+ #ifdef SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED
+ {"LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED", ERR_LIB_SSL, SSL_R_LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED},
+ #else
+ {"LEGACY_SIGALG_DISALLOWED_OR_UNSUPPORTED", 20, 333},
+ #endif
+ #ifdef SSL_R_LENGTH_MISMATCH
+ {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
+ #else
+ {"LENGTH_MISMATCH", 20, 159},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_LONG
+ {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG},
+ #else
+ {"LENGTH_TOO_LONG", 20, 404},
+ #endif
+ #ifdef SSL_R_LENGTH_TOO_SHORT
+ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
+ #else
+ {"LENGTH_TOO_SHORT", 20, 160},
+ #endif
+ #ifdef SSL_R_LIBRARY_BUG
+ {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
+ #else
+ {"LIBRARY_BUG", 20, 274},
+ #endif
+ #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
+ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"LIBRARY_HAS_NO_CIPHERS", 20, 161},
+ #endif
+ #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
+ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT},
+ #else
+ {"MISSING_DSA_SIGNING_CERT", 20, 165},
+ #endif
+ #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT
+ {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT},
+ #else
+ {"MISSING_ECDSA_SIGNING_CERT", 20, 381},
+ #endif
+ #ifdef SSL_R_MISSING_FATAL
+ {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL},
+ #else
+ {"MISSING_FATAL", 20, 256},
+ #endif
+ #ifdef SSL_R_MISSING_PARAMETERS
+ {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS},
+ #else
+ {"MISSING_PARAMETERS", 20, 290},
+ #endif
+ #ifdef SSL_R_MISSING_PSK_KEX_MODES_EXTENSION
+ {"MISSING_PSK_KEX_MODES_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_PSK_KEX_MODES_EXTENSION},
+ #else
+ {"MISSING_PSK_KEX_MODES_EXTENSION", 20, 310},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_CERTIFICATE
+ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
+ #else
+ {"MISSING_RSA_CERTIFICATE", 20, 168},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
+ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT},
+ #else
+ {"MISSING_RSA_ENCRYPTING_CERT", 20, 169},
+ #endif
+ #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
+ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT},
+ #else
+ {"MISSING_RSA_SIGNING_CERT", 20, 170},
+ #endif
+ #ifdef SSL_R_MISSING_SIGALGS_EXTENSION
+ {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION},
+ #else
+ {"MISSING_SIGALGS_EXTENSION", 20, 112},
+ #endif
+ #ifdef SSL_R_MISSING_SIGNING_CERT
+ {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT},
+ #else
+ {"MISSING_SIGNING_CERT", 20, 221},
+ #endif
+ #ifdef SSL_R_MISSING_SRP_PARAM
+ {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM},
+ #else
+ {"MISSING_SRP_PARAM", 20, 358},
+ #endif
+ #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION},
+ #else
+ {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_DH_KEY
+ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
+ #else
+ {"MISSING_TMP_DH_KEY", 20, 171},
+ #endif
+ #ifdef SSL_R_MISSING_TMP_ECDH_KEY
+ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
+ #else
+ {"MISSING_TMP_ECDH_KEY", 20, 311},
+ #endif
+ #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA},
+ #else
+ {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293},
+ #endif
+ #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY
+ {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY},
+ #else
+ {"NOT_ON_RECORD_BOUNDARY", 20, 182},
+ #endif
+ #ifdef SSL_R_NOT_REPLACING_CERTIFICATE
+ {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE},
+ #else
+ {"NOT_REPLACING_CERTIFICATE", 20, 289},
+ #endif
+ #ifdef SSL_R_NOT_SERVER
+ {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER},
+ #else
+ {"NOT_SERVER", 20, 284},
+ #endif
+ #ifdef SSL_R_NO_APPLICATION_PROTOCOL
+ {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL},
+ #else
+ {"NO_APPLICATION_PROTOCOL", 20, 235},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATES_RETURNED
+ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED},
+ #else
+ {"NO_CERTIFICATES_RETURNED", 20, 176},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
+ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
+ #else
+ {"NO_CERTIFICATE_ASSIGNED", 20, 177},
+ #endif
+ #ifdef SSL_R_NO_CERTIFICATE_SET
+ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
+ #else
+ {"NO_CERTIFICATE_SET", 20, 179},
+ #endif
+ #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR
+ {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR},
+ #else
+ {"NO_CHANGE_FOLLOWING_HRR", 20, 214},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_AVAILABLE
+ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
+ #else
+ {"NO_CIPHERS_AVAILABLE", 20, 181},
+ #endif
+ #ifdef SSL_R_NO_CIPHERS_SPECIFIED
+ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
+ #else
+ {"NO_CIPHERS_SPECIFIED", 20, 183},
+ #endif
+ #ifdef SSL_R_NO_CIPHER_MATCH
+ {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
+ #else
+ {"NO_CIPHER_MATCH", 20, 185},
+ #endif
+ #ifdef SSL_R_NO_CLIENT_CERT_METHOD
+ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
+ #else
+ {"NO_CLIENT_CERT_METHOD", 20, 331},
+ #endif
+ #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
+ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED},
+ #else
+ {"NO_COMPRESSION_SPECIFIED", 20, 187},
+ #endif
+ #ifdef SSL_R_NO_COOKIE_CALLBACK_SET
+ {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET},
+ #else
+ {"NO_COOKIE_CALLBACK_SET", 20, 287},
+ #endif
+ #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
+ #else
+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330},
+ #endif
+ #ifdef SSL_R_NO_METHOD_SPECIFIED
+ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
+ #else
+ {"NO_METHOD_SPECIFIED", 20, 188},
+ #endif
+ #ifdef SSL_R_NO_PEM_EXTENSIONS
+ {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS},
+ #else
+ {"NO_PEM_EXTENSIONS", 20, 389},
+ #endif
+ #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
+ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
+ #else
+ {"NO_PRIVATE_KEY_ASSIGNED", 20, 190},
+ #endif
+ #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
+ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
+ #else
+ {"NO_PROTOCOLS_AVAILABLE", 20, 191},
+ #endif
+ #ifdef SSL_R_NO_RENEGOTIATION
+ {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
+ #else
+ {"NO_RENEGOTIATION", 20, 339},
+ #endif
+ #ifdef SSL_R_NO_REQUIRED_DIGEST
+ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
+ #else
+ {"NO_REQUIRED_DIGEST", 20, 324},
+ #endif
+ #ifdef SSL_R_NO_SHARED_CIPHER
+ {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
+ #else
+ {"NO_SHARED_CIPHER", 20, 193},
+ #endif
+ #ifdef SSL_R_NO_SHARED_GROUPS
+ {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS},
+ #else
+ {"NO_SHARED_GROUPS", 20, 410},
+ #endif
+ #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS},
+ #else
+ {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376},
+ #endif
+ #ifdef SSL_R_NO_SRTP_PROFILES
+ {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES},
+ #else
+ {"NO_SRTP_PROFILES", 20, 359},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_DIGEST_ALGORITHM
+ {"NO_SUITABLE_DIGEST_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_DIGEST_ALGORITHM},
+ #else
+ {"NO_SUITABLE_DIGEST_ALGORITHM", 20, 297},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_GROUPS
+ {"NO_SUITABLE_GROUPS", ERR_LIB_SSL, SSL_R_NO_SUITABLE_GROUPS},
+ #else
+ {"NO_SUITABLE_GROUPS", 20, 295},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_KEY_SHARE
+ {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE},
+ #else
+ {"NO_SUITABLE_KEY_SHARE", 20, 101},
+ #endif
+ #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM},
+ #else
+ {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118},
+ #endif
+ #ifdef SSL_R_NO_VALID_SCTS
+ {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS},
+ #else
+ {"NO_VALID_SCTS", 20, 216},
+ #endif
+ #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK
+ {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK},
+ #else
+ {"NO_VERIFY_COOKIE_CALLBACK", 20, 403},
+ #endif
+ #ifdef SSL_R_NULL_SSL_CTX
+ {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
+ #else
+ {"NULL_SSL_CTX", 20, 195},
+ #endif
+ #ifdef SSL_R_NULL_SSL_METHOD_PASSED
+ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
+ #else
+ {"NULL_SSL_METHOD_PASSED", 20, 196},
+ #endif
+ #ifdef SSL_R_OCSP_CALLBACK_FAILURE
+ {"OCSP_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_OCSP_CALLBACK_FAILURE},
+ #else
+ {"OCSP_CALLBACK_FAILURE", 20, 305},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197},
+ #endif
+ #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
+ #else
+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344},
+ #endif
+ #ifdef SSL_R_OVERFLOW_ERROR
+ {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR},
+ #else
+ {"OVERFLOW_ERROR", 20, 237},
+ #endif
+ #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
+ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
+ #else
+ {"PACKET_LENGTH_TOO_LONG", 20, 198},
+ #endif
+ #ifdef SSL_R_PARSE_TLSEXT
+ {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
+ #else
+ {"PARSE_TLSEXT", 20, 227},
+ #endif
+ #ifdef SSL_R_PATH_TOO_LONG
+ {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
+ #else
+ {"PATH_TOO_LONG", 20, 270},
+ #endif
+ #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
+ #else
+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199},
+ #endif
+ #ifdef SSL_R_PEM_NAME_BAD_PREFIX
+ {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX},
+ #else
+ {"PEM_NAME_BAD_PREFIX", 20, 391},
+ #endif
+ #ifdef SSL_R_PEM_NAME_TOO_SHORT
+ {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT},
+ #else
+ {"PEM_NAME_TOO_SHORT", 20, 392},
+ #endif
+ #ifdef SSL_R_PIPELINE_FAILURE
+ {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE},
+ #else
+ {"PIPELINE_FAILURE", 20, 406},
+ #endif
+ #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR},
+ #else
+ {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278},
+ #endif
+ #ifdef SSL_R_PRIVATE_KEY_MISMATCH
+ {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH},
+ #else
+ {"PRIVATE_KEY_MISMATCH", 20, 288},
+ #endif
+ #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
+ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
+ #else
+ {"PROTOCOL_IS_SHUTDOWN", 20, 207},
+ #endif
+ #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
+ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
+ #else
+ {"PSK_IDENTITY_NOT_FOUND", 20, 223},
+ #endif
+ #ifdef SSL_R_PSK_NO_CLIENT_CB
+ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
+ #else
+ {"PSK_NO_CLIENT_CB", 20, 224},
+ #endif
+ #ifdef SSL_R_PSK_NO_SERVER_CB
+ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
+ #else
+ {"PSK_NO_SERVER_CB", 20, 225},
+ #endif
+ #ifdef SSL_R_READ_BIO_NOT_SET
+ {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
+ #else
+ {"READ_BIO_NOT_SET", 20, 211},
+ #endif
+ #ifdef SSL_R_READ_TIMEOUT_EXPIRED
+ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
+ #else
+ {"READ_TIMEOUT_EXPIRED", 20, 312},
+ #endif
+ #ifdef SSL_R_RECORD_LENGTH_MISMATCH
+ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
+ #else
+ {"RECORD_LENGTH_MISMATCH", 20, 213},
+ #endif
+ #ifdef SSL_R_RECORD_TOO_SMALL
+ {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
+ #else
+ {"RECORD_TOO_SMALL", 20, 298},
+ #endif
+ #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
+ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG},
+ #else
+ {"RENEGOTIATE_EXT_TOO_LONG", 20, 335},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
+ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR},
+ #else
+ {"RENEGOTIATION_ENCODING_ERR", 20, 336},
+ #endif
+ #ifdef SSL_R_RENEGOTIATION_MISMATCH
+ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
+ #else
+ {"RENEGOTIATION_MISMATCH", 20, 337},
+ #endif
+ #ifdef SSL_R_REQUEST_PENDING
+ {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING},
+ #else
+ {"REQUEST_PENDING", 20, 285},
+ #endif
+ #ifdef SSL_R_REQUEST_SENT
+ {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT},
+ #else
+ {"REQUEST_SENT", 20, 286},
+ #endif
+ #ifdef SSL_R_REQUIRED_CIPHER_MISSING
+ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
+ #else
+ {"REQUIRED_CIPHER_MISSING", 20, 215},
+ #endif
+ #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING},
+ #else
+ {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342},
+ #endif
+ #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
+ #else
+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345},
+ #endif
+ #ifdef SSL_R_SCT_VERIFICATION_FAILED
+ {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED},
+ #else
+ {"SCT_VERIFICATION_FAILED", 20, 208},
+ #endif
+ #ifdef SSL_R_SERVERHELLO_TLSEXT
+ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
+ #else
+ {"SERVERHELLO_TLSEXT", 20, 275},
+ #endif
+ #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
+ #else
+ {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277},
+ #endif
+ #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT
+ {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT},
+ #else
+ {"SHUTDOWN_WHILE_IN_INIT", 20, 407},
+ #endif
+ #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR
+ {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR},
+ #else
+ {"SIGNATURE_ALGORITHMS_ERROR", 20, 360},
+ #endif
+ #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
+ #else
+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220},
+ #endif
+ #ifdef SSL_R_SRP_A_CALC
+ {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC},
+ #else
+ {"SRP_A_CALC", 20, 361},
+ #endif
+ #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES},
+ #else
+ {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362},
+ #endif
+ #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG},
+ #else
+ {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363},
+ #endif
+ #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE},
+ #else
+ {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH},
+ #else
+ {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
+ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME", 20, 319},
+ #endif
+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
+ #else
+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320},
+ #endif
+ #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
+ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL3_SESSION_ID_TOO_LONG", 20, 300},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
+ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
+ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
+ #else
+ {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
+ #else
+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
+ #else
+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
+ #else
+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
+ #else
+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
+ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
+ #else
+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010},
+ #endif
+ #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
+ #else
+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY
+ {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY},
+ #else
+ {"SSL_COMMAND_SECTION_EMPTY", 20, 117},
+ #endif
+ #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND
+ {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND},
+ #else
+ {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125},
+ #endif
+ #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
+ #else
+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228},
+ #endif
+ #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
+ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
+ #else
+ {"SSL_HANDSHAKE_FAILURE", 20, 229},
+ #endif
+ #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
+ #else
+ {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230},
+ #endif
+ #ifdef SSL_R_SSL_NEGATIVE_LENGTH
+ {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH},
+ #else
+ {"SSL_NEGATIVE_LENGTH", 20, 372},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_EMPTY
+ {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY},
+ #else
+ {"SSL_SECTION_EMPTY", 20, 126},
+ #endif
+ #ifdef SSL_R_SSL_SECTION_NOT_FOUND
+ {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND},
+ #else
+ {"SSL_SECTION_NOT_FOUND", 20, 136},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
+ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
+ #else
+ {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
+ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
+ #else
+ {"SSL_SESSION_ID_CONFLICT", 20, 302},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
+ #else
+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG
+ {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG},
+ #else
+ {"SSL_SESSION_ID_TOO_LONG", 20, 408},
+ #endif
+ #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH
+ {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH},
+ #else
+ {"SSL_SESSION_VERSION_MISMATCH", 20, 210},
+ #endif
+ #ifdef SSL_R_STILL_IN_INIT
+ {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT},
+ #else
+ {"STILL_IN_INIT", 20, 121},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED},
+ #else
+ {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116},
+ #endif
+ #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION
+ {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION},
+ #else
+ {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
+ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED},
+ #else
+ {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
+ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR},
+ #else
+ {"TLSV1_ALERT_DECODE_ERROR", 20, 1050},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
+ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
+ #else
+ {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
+ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
+ #else
+ {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
+ #else
+ {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK},
+ #else
+ {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
+ #else
+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
+ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
+ #else
+ {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
+ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
+ #else
+ {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
+ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
+ #else
+ {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
+ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
+ #else
+ {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
+ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
+ #else
+ {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048},
+ #endif
+ #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
+ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED},
+ #else
+ {"TLSV1_ALERT_USER_CANCELLED", 20, 1090},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114},
+ #endif
+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
+ #else
+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113},
+ #endif
+ #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
+ #else
+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111},
+ #endif
+ #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
+ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
+ #else
+ {"TLSV1_UNRECOGNIZED_NAME", 20, 1112},
+ #endif
+ #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
+ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
+ #else
+ {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110},
+ #endif
+ #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL
+ {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL},
+ #else
+ {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367},
+ #endif
+ #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
+ #else
+ {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157},
+ #endif
+ #ifdef SSL_R_TOO_MANY_KEY_UPDATES
+ {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES},
+ #else
+ {"TOO_MANY_KEY_UPDATES", 20, 132},
+ #endif
+ #ifdef SSL_R_TOO_MANY_WARN_ALERTS
+ {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS},
+ #else
+ {"TOO_MANY_WARN_ALERTS", 20, 409},
+ #endif
+ #ifdef SSL_R_TOO_MUCH_EARLY_DATA
+ {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA},
+ #else
+ {"TOO_MUCH_EARLY_DATA", 20, 164},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
+ #else
+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242},
+ #endif
+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
+ #else
+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE
+ {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE},
+ #else
+ {"UNEXPECTED_CCS_MESSAGE", 20, 262},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA
+ {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA},
+ #else
+ {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_EOF_WHILE_READING
+ {"UNEXPECTED_EOF_WHILE_READING", ERR_LIB_SSL, SSL_R_UNEXPECTED_EOF_WHILE_READING},
+ #else
+ {"UNEXPECTED_EOF_WHILE_READING", 20, 294},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_MESSAGE
+ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
+ #else
+ {"UNEXPECTED_MESSAGE", 20, 244},
+ #endif
+ #ifdef SSL_R_UNEXPECTED_RECORD
+ {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
+ #else
+ {"UNEXPECTED_RECORD", 20, 245},
+ #endif
+ #ifdef SSL_R_UNINITIALIZED
+ {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
+ #else
+ {"UNINITIALIZED", 20, 276},
+ #endif
+ #ifdef SSL_R_UNKNOWN_ALERT_TYPE
+ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
+ #else
+ {"UNKNOWN_ALERT_TYPE", 20, 246},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
+ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE},
+ #else
+ {"UNKNOWN_CERTIFICATE_TYPE", 20, 247},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
+ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
+ #else
+ {"UNKNOWN_CIPHER_RETURNED", 20, 248},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
+ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
+ #else
+ {"UNKNOWN_CIPHER_TYPE", 20, 249},
+ #endif
+ #ifdef SSL_R_UNKNOWN_CMD_NAME
+ {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME},
+ #else
+ {"UNKNOWN_CMD_NAME", 20, 386},
+ #endif
+ #ifdef SSL_R_UNKNOWN_COMMAND
+ {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND},
+ #else
+ {"UNKNOWN_COMMAND", 20, 139},
+ #endif
+ #ifdef SSL_R_UNKNOWN_DIGEST
+ {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST},
+ #else
+ {"UNKNOWN_DIGEST", 20, 368},
+ #endif
+ #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
+ #else
+ {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PKEY_TYPE
+ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
+ #else
+ {"UNKNOWN_PKEY_TYPE", 20, 251},
+ #endif
+ #ifdef SSL_R_UNKNOWN_PROTOCOL
+ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
+ #else
+ {"UNKNOWN_PROTOCOL", 20, 252},
+ #endif
+ #ifdef SSL_R_UNKNOWN_SSL_VERSION
+ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
+ #else
+ {"UNKNOWN_SSL_VERSION", 20, 254},
+ #endif
+ #ifdef SSL_R_UNKNOWN_STATE
+ {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
+ #else
+ {"UNKNOWN_STATE", 20, 255},
+ #endif
+ #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
+ #else
+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338},
+ #endif
+ #ifdef SSL_R_UNSOLICITED_EXTENSION
+ {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION},
+ #else
+ {"UNSOLICITED_EXTENSION", 20, 217},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
+ #else
+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
+ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
+ #else
+ {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_PROTOCOL
+ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
+ #else
+ {"UNSUPPORTED_PROTOCOL", 20, 258},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
+ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
+ #else
+ {"UNSUPPORTED_SSL_VERSION", 20, 259},
+ #endif
+ #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
+ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
+ #else
+ {"UNSUPPORTED_STATUS_TYPE", 20, 329},
+ #endif
+ #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED
+ {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED},
+ #else
+ {"USE_SRTP_NOT_NEGOTIATED", 20, 369},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_HIGH
+ {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH},
+ #else
+ {"VERSION_TOO_HIGH", 20, 166},
+ #endif
+ #ifdef SSL_R_VERSION_TOO_LOW
+ {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW},
+ #else
+ {"VERSION_TOO_LOW", 20, 396},
+ #endif
+ #ifdef SSL_R_WRONG_CERTIFICATE_TYPE
+ {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE},
+ #else
+ {"WRONG_CERTIFICATE_TYPE", 20, 383},
+ #endif
+ #ifdef SSL_R_WRONG_CIPHER_RETURNED
+ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
+ #else
+ {"WRONG_CIPHER_RETURNED", 20, 261},
+ #endif
+ #ifdef SSL_R_WRONG_CURVE
+ {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE},
+ #else
+ {"WRONG_CURVE", 20, 378},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
+ #else
+ {"WRONG_SIGNATURE_LENGTH", 20, 264},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_SIZE
+ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
+ #else
+ {"WRONG_SIGNATURE_SIZE", 20, 265},
+ #endif
+ #ifdef SSL_R_WRONG_SIGNATURE_TYPE
+ {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE},
+ #else
+ {"WRONG_SIGNATURE_TYPE", 20, 370},
+ #endif
+ #ifdef SSL_R_WRONG_SSL_VERSION
+ {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
+ #else
+ {"WRONG_SSL_VERSION", 20, 266},
+ #endif
+ #ifdef SSL_R_WRONG_VERSION_NUMBER
+ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
+ #else
+ {"WRONG_VERSION_NUMBER", 20, 267},
+ #endif
+ #ifdef SSL_R_X509_LIB
+ {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
+ #else
+ {"X509_LIB", 20, 268},
+ #endif
+ #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
+ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
+ #else
+ {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269},
+ #endif
+ #ifdef TS_R_BAD_PKCS7_TYPE
+ {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE},
+ #else
+ {"BAD_PKCS7_TYPE", 47, 132},
+ #endif
+ #ifdef TS_R_BAD_TYPE
+ {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE},
+ #else
+ {"BAD_TYPE", 47, 133},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_CERT
+ {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT},
+ #else
+ {"CANNOT_LOAD_CERT", 47, 137},
+ #endif
+ #ifdef TS_R_CANNOT_LOAD_KEY
+ {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY},
+ #else
+ {"CANNOT_LOAD_KEY", 47, 138},
+ #endif
+ #ifdef TS_R_CERTIFICATE_VERIFY_ERROR
+ {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR},
+ #else
+ {"CERTIFICATE_VERIFY_ERROR", 47, 100},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_ENGINE
+ {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE},
+ #else
+ {"COULD_NOT_SET_ENGINE", 47, 127},
+ #endif
+ #ifdef TS_R_COULD_NOT_SET_TIME
+ {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME},
+ #else
+ {"COULD_NOT_SET_TIME", 47, 115},
+ #endif
+ #ifdef TS_R_DETACHED_CONTENT
+ {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT},
+ #else
+ {"DETACHED_CONTENT", 47, 134},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR
+ {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116},
+ #endif
+ #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR},
+ #else
+ {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139},
+ #endif
+ #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR
+ {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR},
+ #else
+ {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101},
+ #endif
+ #ifdef TS_R_INVALID_NULL_POINTER
+ {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER},
+ #else
+ {"INVALID_NULL_POINTER", 47, 102},
+ #endif
+ #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE},
+ #else
+ {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117},
+ #endif
+ #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH
+ {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH},
+ #else
+ {"MESSAGE_IMPRINT_MISMATCH", 47, 103},
+ #endif
+ #ifdef TS_R_NONCE_MISMATCH
+ {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH},
+ #else
+ {"NONCE_MISMATCH", 47, 104},
+ #endif
+ #ifdef TS_R_NONCE_NOT_RETURNED
+ {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED},
+ #else
+ {"NONCE_NOT_RETURNED", 47, 105},
+ #endif
+ #ifdef TS_R_NO_CONTENT
+ {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT},
+ #else
+ {"NO_CONTENT", 47, 106},
+ #endif
+ #ifdef TS_R_NO_TIME_STAMP_TOKEN
+ {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN},
+ #else
+ {"NO_TIME_STAMP_TOKEN", 47, 107},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR
+ {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118},
+ #endif
+ #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR},
+ #else
+ {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119},
+ #endif
+ #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED
+ {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED},
+ #else
+ {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129},
+ #endif
+ #ifdef TS_R_POLICY_MISMATCH
+ {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH},
+ #else
+ {"POLICY_MISMATCH", 47, 108},
+ #endif
+ #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE},
+ #else
+ {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120},
+ #endif
+ #ifdef TS_R_RESPONSE_SETUP_ERROR
+ {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR},
+ #else
+ {"RESPONSE_SETUP_ERROR", 47, 121},
+ #endif
+ #ifdef TS_R_SIGNATURE_FAILURE
+ {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE},
+ #else
+ {"SIGNATURE_FAILURE", 47, 109},
+ #endif
+ #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER
+ {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER},
+ #else
+ {"THERE_MUST_BE_ONE_SIGNER", 47, 110},
+ #endif
+ #ifdef TS_R_TIME_SYSCALL_ERROR
+ {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR},
+ #else
+ {"TIME_SYSCALL_ERROR", 47, 122},
+ #endif
+ #ifdef TS_R_TOKEN_NOT_PRESENT
+ {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT},
+ #else
+ {"TOKEN_NOT_PRESENT", 47, 130},
+ #endif
+ #ifdef TS_R_TOKEN_PRESENT
+ {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT},
+ #else
+ {"TOKEN_PRESENT", 47, 131},
+ #endif
+ #ifdef TS_R_TSA_NAME_MISMATCH
+ {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH},
+ #else
+ {"TSA_NAME_MISMATCH", 47, 111},
+ #endif
+ #ifdef TS_R_TSA_UNTRUSTED
+ {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED},
+ #else
+ {"TSA_UNTRUSTED", 47, 112},
+ #endif
+ #ifdef TS_R_TST_INFO_SETUP_ERROR
+ {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR},
+ #else
+ {"TST_INFO_SETUP_ERROR", 47, 123},
+ #endif
+ #ifdef TS_R_TS_DATASIGN
+ {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN},
+ #else
+ {"TS_DATASIGN", 47, 124},
+ #endif
+ #ifdef TS_R_UNACCEPTABLE_POLICY
+ {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY},
+ #else
+ {"UNACCEPTABLE_POLICY", 47, 125},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM
+ {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM},
+ #else
+ {"UNSUPPORTED_MD_ALGORITHM", 47, 126},
+ #endif
+ #ifdef TS_R_UNSUPPORTED_VERSION
+ {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION},
+ #else
+ {"UNSUPPORTED_VERSION", 47, 113},
+ #endif
+ #ifdef TS_R_VAR_BAD_VALUE
+ {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE},
+ #else
+ {"VAR_BAD_VALUE", 47, 135},
+ #endif
+ #ifdef TS_R_VAR_LOOKUP_FAILURE
+ {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE},
+ #else
+ {"VAR_LOOKUP_FAILURE", 47, 136},
+ #endif
+ #ifdef TS_R_WRONG_CONTENT_TYPE
+ {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE},
+ #else
+ {"WRONG_CONTENT_TYPE", 47, 114},
+ #endif
+ #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS},
+ #else
+ {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104},
+ #endif
+ #ifdef UI_R_INDEX_TOO_LARGE
+ {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE},
+ #else
+ {"INDEX_TOO_LARGE", 40, 102},
+ #endif
+ #ifdef UI_R_INDEX_TOO_SMALL
+ {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL},
+ #else
+ {"INDEX_TOO_SMALL", 40, 103},
+ #endif
+ #ifdef UI_R_NO_RESULT_BUFFER
+ {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER},
+ #else
+ {"NO_RESULT_BUFFER", 40, 105},
+ #endif
+ #ifdef UI_R_PROCESSING_ERROR
+ {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR},
+ #else
+ {"PROCESSING_ERROR", 40, 107},
+ #endif
+ #ifdef UI_R_RESULT_TOO_LARGE
+ {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE},
+ #else
+ {"RESULT_TOO_LARGE", 40, 100},
+ #endif
+ #ifdef UI_R_RESULT_TOO_SMALL
+ {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL},
+ #else
+ {"RESULT_TOO_SMALL", 40, 101},
+ #endif
+ #ifdef UI_R_SYSASSIGN_ERROR
+ {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR},
+ #else
+ {"SYSASSIGN_ERROR", 40, 109},
+ #endif
+ #ifdef UI_R_SYSDASSGN_ERROR
+ {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR},
+ #else
+ {"SYSDASSGN_ERROR", 40, 110},
+ #endif
+ #ifdef UI_R_SYSQIOW_ERROR
+ {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR},
+ #else
+ {"SYSQIOW_ERROR", 40, 111},
+ #endif
+ #ifdef UI_R_UNKNOWN_CONTROL_COMMAND
+ {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND},
+ #else
+ {"UNKNOWN_CONTROL_COMMAND", 40, 106},
+ #endif
+ #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE},
+ #else
+ {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108},
+ #endif
+ #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED},
+ #else
+ {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112},
+ #endif
+ #ifdef X509V3_R_BAD_IP_ADDRESS
+ {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS},
+ #else
+ {"BAD_IP_ADDRESS", 34, 118},
+ #endif
+ #ifdef X509V3_R_BAD_OBJECT
+ {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT},
+ #else
+ {"BAD_OBJECT", 34, 119},
+ #endif
+ #ifdef X509V3_R_BN_DEC2BN_ERROR
+ {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR},
+ #else
+ {"BN_DEC2BN_ERROR", 34, 100},
+ #endif
+ #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR
+ {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR},
+ #else
+ {"BN_TO_ASN1_INTEGER_ERROR", 34, 101},
+ #endif
+ #ifdef X509V3_R_DIRNAME_ERROR
+ {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR},
+ #else
+ {"DIRNAME_ERROR", 34, 149},
+ #endif
+ #ifdef X509V3_R_DISTPOINT_ALREADY_SET
+ {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET},
+ #else
+ {"DISTPOINT_ALREADY_SET", 34, 160},
+ #endif
+ #ifdef X509V3_R_DUPLICATE_ZONE_ID
+ {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID},
+ #else
+ {"DUPLICATE_ZONE_ID", 34, 133},
+ #endif
+ #ifdef X509V3_R_EMPTY_KEY_USAGE
+ {"EMPTY_KEY_USAGE", ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE},
+ #else
+ {"EMPTY_KEY_USAGE", 34, 169},
+ #endif
+ #ifdef X509V3_R_ERROR_CONVERTING_ZONE
+ {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE},
+ #else
+ {"ERROR_CONVERTING_ZONE", 34, 131},
+ #endif
+ #ifdef X509V3_R_ERROR_CREATING_EXTENSION
+ {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION},
+ #else
+ {"ERROR_CREATING_EXTENSION", 34, 144},
+ #endif
+ #ifdef X509V3_R_ERROR_IN_EXTENSION
+ {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION},
+ #else
+ {"ERROR_IN_EXTENSION", 34, 128},
+ #endif
+ #ifdef X509V3_R_EXPECTED_A_SECTION_NAME
+ {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME},
+ #else
+ {"EXPECTED_A_SECTION_NAME", 34, 137},
+ #endif
+ #ifdef X509V3_R_EXTENSION_EXISTS
+ {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS},
+ #else
+ {"EXTENSION_EXISTS", 34, 145},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NAME_ERROR
+ {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR},
+ #else
+ {"EXTENSION_NAME_ERROR", 34, 115},
+ #endif
+ #ifdef X509V3_R_EXTENSION_NOT_FOUND
+ {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND},
+ #else
+ {"EXTENSION_NOT_FOUND", 34, 102},
+ #endif
+ #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED
+ {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED},
+ #else
+ {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103},
+ #endif
+ #ifdef X509V3_R_EXTENSION_VALUE_ERROR
+ {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR},
+ #else
+ {"EXTENSION_VALUE_ERROR", 34, 116},
+ #endif
+ #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION
+ {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION},
+ #else
+ {"ILLEGAL_EMPTY_EXTENSION", 34, 151},
+ #endif
+ #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG
+ {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG},
+ #else
+ {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152},
+ #endif
+ #ifdef X509V3_R_INVALID_ASNUMBER
+ {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER},
+ #else
+ {"INVALID_ASNUMBER", 34, 162},
+ #endif
+ #ifdef X509V3_R_INVALID_ASRANGE
+ {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE},
+ #else
+ {"INVALID_ASRANGE", 34, 163},
+ #endif
+ #ifdef X509V3_R_INVALID_BOOLEAN_STRING
+ {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING},
+ #else
+ {"INVALID_BOOLEAN_STRING", 34, 104},
+ #endif
+ #ifdef X509V3_R_INVALID_CERTIFICATE
+ {"INVALID_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE},
+ #else
+ {"INVALID_CERTIFICATE", 34, 158},
+ #endif
+ #ifdef X509V3_R_INVALID_EMPTY_NAME
+ {"INVALID_EMPTY_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_EMPTY_NAME},
+ #else
+ {"INVALID_EMPTY_NAME", 34, 108},
+ #endif
+ #ifdef X509V3_R_INVALID_EXTENSION_STRING
+ {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING},
+ #else
+ {"INVALID_EXTENSION_STRING", 34, 105},
+ #endif
+ #ifdef X509V3_R_INVALID_INHERITANCE
+ {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE},
+ #else
+ {"INVALID_INHERITANCE", 34, 165},
+ #endif
+ #ifdef X509V3_R_INVALID_IPADDRESS
+ {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS},
+ #else
+ {"INVALID_IPADDRESS", 34, 166},
+ #endif
+ #ifdef X509V3_R_INVALID_MULTIPLE_RDNS
+ {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS},
+ #else
+ {"INVALID_MULTIPLE_RDNS", 34, 161},
+ #endif
+ #ifdef X509V3_R_INVALID_NAME
+ {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME},
+ #else
+ {"INVALID_NAME", 34, 106},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_ARGUMENT
+ {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT},
+ #else
+ {"INVALID_NULL_ARGUMENT", 34, 107},
+ #endif
+ #ifdef X509V3_R_INVALID_NULL_VALUE
+ {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE},
+ #else
+ {"INVALID_NULL_VALUE", 34, 109},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBER
+ {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER},
+ #else
+ {"INVALID_NUMBER", 34, 140},
+ #endif
+ #ifdef X509V3_R_INVALID_NUMBERS
+ {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS},
+ #else
+ {"INVALID_NUMBERS", 34, 141},
+ #endif
+ #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER
+ {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER},
+ #else
+ {"INVALID_OBJECT_IDENTIFIER", 34, 110},
+ #endif
+ #ifdef X509V3_R_INVALID_OPTION
+ {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION},
+ #else
+ {"INVALID_OPTION", 34, 138},
+ #endif
+ #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER
+ {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER},
+ #else
+ {"INVALID_POLICY_IDENTIFIER", 34, 134},
+ #endif
+ #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING
+ {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING},
+ #else
+ {"INVALID_PROXY_POLICY_SETTING", 34, 153},
+ #endif
+ #ifdef X509V3_R_INVALID_PURPOSE
+ {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE},
+ #else
+ {"INVALID_PURPOSE", 34, 146},
+ #endif
+ #ifdef X509V3_R_INVALID_SAFI
+ {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI},
+ #else
+ {"INVALID_SAFI", 34, 164},
+ #endif
+ #ifdef X509V3_R_INVALID_SECTION
+ {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION},
+ #else
+ {"INVALID_SECTION", 34, 135},
+ #endif
+ #ifdef X509V3_R_INVALID_SYNTAX
+ {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX},
+ #else
+ {"INVALID_SYNTAX", 34, 143},
+ #endif
+ #ifdef X509V3_R_ISSUER_DECODE_ERROR
+ {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR},
+ #else
+ {"ISSUER_DECODE_ERROR", 34, 126},
+ #endif
+ #ifdef X509V3_R_MISSING_VALUE
+ {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE},
+ #else
+ {"MISSING_VALUE", 34, 124},
+ #endif
+ #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS
+ {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS},
+ #else
+ {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142},
+ #endif
+ #ifdef X509V3_R_NEGATIVE_PATHLEN
+ {"NEGATIVE_PATHLEN", ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN},
+ #else
+ {"NEGATIVE_PATHLEN", 34, 168},
+ #endif
+ #ifdef X509V3_R_NO_CONFIG_DATABASE
+ {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE},
+ #else
+ {"NO_CONFIG_DATABASE", 34, 136},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_CERTIFICATE
+ {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE},
+ #else
+ {"NO_ISSUER_CERTIFICATE", 34, 121},
+ #endif
+ #ifdef X509V3_R_NO_ISSUER_DETAILS
+ {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS},
+ #else
+ {"NO_ISSUER_DETAILS", 34, 127},
+ #endif
+ #ifdef X509V3_R_NO_POLICY_IDENTIFIER
+ {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER},
+ #else
+ {"NO_POLICY_IDENTIFIER", 34, 139},
+ #endif
+ #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED},
+ #else
+ {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154},
+ #endif
+ #ifdef X509V3_R_NO_PUBLIC_KEY
+ {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY},
+ #else
+ {"NO_PUBLIC_KEY", 34, 114},
+ #endif
+ #ifdef X509V3_R_NO_SUBJECT_DETAILS
+ {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS},
+ #else
+ {"NO_SUBJECT_DETAILS", 34, 125},
+ #endif
+ #ifdef X509V3_R_OPERATION_NOT_DEFINED
+ {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED},
+ #else
+ {"OPERATION_NOT_DEFINED", 34, 148},
+ #endif
+ #ifdef X509V3_R_OTHERNAME_ERROR
+ {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR},
+ #else
+ {"OTHERNAME_ERROR", 34, 147},
+ #endif
+ #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED},
+ #else
+ {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH
+ {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH},
+ #else
+ {"POLICY_PATH_LENGTH", 34, 156},
+ #endif
+ #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED},
+ #else
+ {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157},
+ #endif
+ #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY},
+ #else
+ {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159},
+ #endif
+ #ifdef X509V3_R_SECTION_NOT_FOUND
+ {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND},
+ #else
+ {"SECTION_NOT_FOUND", 34, 150},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS
+ {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS},
+ #else
+ {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122},
+ #endif
+ #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID
+ {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID},
+ #else
+ {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT
+ {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT},
+ #else
+ {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION
+ {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION},
+ #else
+ {"UNKNOWN_EXTENSION", 34, 129},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME
+ {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME},
+ #else
+ {"UNKNOWN_EXTENSION_NAME", 34, 130},
+ #endif
+ #ifdef X509V3_R_UNKNOWN_OPTION
+ {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION},
+ #else
+ {"UNKNOWN_OPTION", 34, 120},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_OPTION
+ {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION},
+ #else
+ {"UNSUPPORTED_OPTION", 34, 117},
+ #endif
+ #ifdef X509V3_R_UNSUPPORTED_TYPE
+ {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE},
+ #else
+ {"UNSUPPORTED_TYPE", 34, 167},
+ #endif
+ #ifdef X509V3_R_USER_TOO_LONG
+ {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG},
+ #else
+ {"USER_TOO_LONG", 34, 132},
+ #endif
+ #ifdef X509_R_AKID_MISMATCH
+ {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH},
+ #else
+ {"AKID_MISMATCH", 11, 110},
+ #endif
+ #ifdef X509_R_BAD_SELECTOR
+ {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR},
+ #else
+ {"BAD_SELECTOR", 11, 133},
+ #endif
+ #ifdef X509_R_BAD_X509_FILETYPE
+ {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
+ #else
+ {"BAD_X509_FILETYPE", 11, 100},
+ #endif
+ #ifdef X509_R_BASE64_DECODE_ERROR
+ {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
+ #else
+ {"BASE64_DECODE_ERROR", 11, 118},
+ #endif
+ #ifdef X509_R_CANT_CHECK_DH_KEY
+ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
+ #else
+ {"CANT_CHECK_DH_KEY", 11, 114},
+ #endif
+ #ifdef X509_R_CERTIFICATE_VERIFICATION_FAILED
+ {"CERTIFICATE_VERIFICATION_FAILED", ERR_LIB_X509, X509_R_CERTIFICATE_VERIFICATION_FAILED},
+ #else
+ {"CERTIFICATE_VERIFICATION_FAILED", 11, 139},
+ #endif
+ #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
+ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE},
+ #else
+ {"CERT_ALREADY_IN_HASH_TABLE", 11, 101},
+ #endif
+ #ifdef X509_R_CRL_ALREADY_DELTA
+ {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA},
+ #else
+ {"CRL_ALREADY_DELTA", 11, 127},
+ #endif
+ #ifdef X509_R_CRL_VERIFY_FAILURE
+ {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE},
+ #else
+ {"CRL_VERIFY_FAILURE", 11, 131},
+ #endif
+ #ifdef X509_R_ERROR_GETTING_MD_BY_NID
+ {"ERROR_GETTING_MD_BY_NID", ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID},
+ #else
+ {"ERROR_GETTING_MD_BY_NID", 11, 141},
+ #endif
+ #ifdef X509_R_ERROR_USING_SIGINF_SET
+ {"ERROR_USING_SIGINF_SET", ERR_LIB_X509, X509_R_ERROR_USING_SIGINF_SET},
+ #else
+ {"ERROR_USING_SIGINF_SET", 11, 142},
+ #endif
+ #ifdef X509_R_IDP_MISMATCH
+ {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH},
+ #else
+ {"IDP_MISMATCH", 11, 128},
+ #endif
+ #ifdef X509_R_INVALID_ATTRIBUTES
+ {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES},
+ #else
+ {"INVALID_ATTRIBUTES", 11, 138},
+ #endif
+ #ifdef X509_R_INVALID_DIRECTORY
+ {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
+ #else
+ {"INVALID_DIRECTORY", 11, 113},
+ #endif
+ #ifdef X509_R_INVALID_DISTPOINT
+ {"INVALID_DISTPOINT", ERR_LIB_X509, X509_R_INVALID_DISTPOINT},
+ #else
+ {"INVALID_DISTPOINT", 11, 143},
+ #endif
+ #ifdef X509_R_INVALID_FIELD_NAME
+ {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
+ #else
+ {"INVALID_FIELD_NAME", 11, 119},
+ #endif
+ #ifdef X509_R_INVALID_TRUST
+ {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
+ #else
+ {"INVALID_TRUST", 11, 123},
+ #endif
+ #ifdef X509_R_ISSUER_MISMATCH
+ {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH},
+ #else
+ {"ISSUER_MISMATCH", 11, 129},
+ #endif
+ #ifdef X509_R_KEY_TYPE_MISMATCH
+ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
+ #else
+ {"KEY_TYPE_MISMATCH", 11, 115},
+ #endif
+ #ifdef X509_R_KEY_VALUES_MISMATCH
+ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
+ #else
+ {"KEY_VALUES_MISMATCH", 11, 116},
+ #endif
+ #ifdef X509_R_LOADING_CERT_DIR
+ {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
+ #else
+ {"LOADING_CERT_DIR", 11, 103},
+ #endif
+ #ifdef X509_R_LOADING_DEFAULTS
+ {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
+ #else
+ {"LOADING_DEFAULTS", 11, 104},
+ #endif
+ #ifdef X509_R_METHOD_NOT_SUPPORTED
+ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
+ #else
+ {"METHOD_NOT_SUPPORTED", 11, 124},
+ #endif
+ #ifdef X509_R_NAME_TOO_LONG
+ {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG},
+ #else
+ {"NAME_TOO_LONG", 11, 134},
+ #endif
+ #ifdef X509_R_NEWER_CRL_NOT_NEWER
+ {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER},
+ #else
+ {"NEWER_CRL_NOT_NEWER", 11, 132},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_FOUND
+ {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND},
+ #else
+ {"NO_CERTIFICATE_FOUND", 11, 135},
+ #endif
+ #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND
+ {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND},
+ #else
+ {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136},
+ #endif
+ #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
+ #else
+ {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105},
+ #endif
+ #ifdef X509_R_NO_CRL_FOUND
+ {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND},
+ #else
+ {"NO_CRL_FOUND", 11, 137},
+ #endif
+ #ifdef X509_R_NO_CRL_NUMBER
+ {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER},
+ #else
+ {"NO_CRL_NUMBER", 11, 130},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
+ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR},
+ #else
+ {"PUBLIC_KEY_DECODE_ERROR", 11, 125},
+ #endif
+ #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
+ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR},
+ #else
+ {"PUBLIC_KEY_ENCODE_ERROR", 11, 126},
+ #endif
+ #ifdef X509_R_SHOULD_RETRY
+ {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
+ #else
+ {"SHOULD_RETRY", 11, 106},
+ #endif
+ #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
+ #else
+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107},
+ #endif
+ #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
+ #else
+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108},
+ #endif
+ #ifdef X509_R_UNKNOWN_KEY_TYPE
+ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
+ #else
+ {"UNKNOWN_KEY_TYPE", 11, 117},
+ #endif
+ #ifdef X509_R_UNKNOWN_NID
+ {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
+ #else
+ {"UNKNOWN_NID", 11, 109},
+ #endif
+ #ifdef X509_R_UNKNOWN_PURPOSE_ID
+ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
+ #else
+ {"UNKNOWN_PURPOSE_ID", 11, 121},
+ #endif
+ #ifdef X509_R_UNKNOWN_SIGID_ALGS
+ {"UNKNOWN_SIGID_ALGS", ERR_LIB_X509, X509_R_UNKNOWN_SIGID_ALGS},
+ #else
+ {"UNKNOWN_SIGID_ALGS", 11, 144},
+ #endif
+ #ifdef X509_R_UNKNOWN_TRUST_ID
+ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
+ #else
+ {"UNKNOWN_TRUST_ID", 11, 120},
+ #endif
+ #ifdef X509_R_UNSUPPORTED_ALGORITHM
+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
+ #else
+ {"UNSUPPORTED_ALGORITHM", 11, 111},
+ #endif
+ #ifdef X509_R_WRONG_LOOKUP_TYPE
+ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
+ #else
+ {"WRONG_LOOKUP_TYPE", 11, 112},
+ #endif
+ #ifdef X509_R_WRONG_TYPE
+ {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
+ #else
+ {"WRONG_TYPE", 11, 122},
+ #endif
+ { NULL }
+};
+
diff --git a/contrib/tools/python3/Modules/_stat.c b/contrib/tools/python3/Modules/_stat.c
new file mode 100644
index 00000000000..4ec2bd25183
--- /dev/null
+++ b/contrib/tools/python3/Modules/_stat.c
@@ -0,0 +1,638 @@
+/* stat.h interface
+ *
+ * The module defines all S_IF*, S_I*, UF_*, SF_* and ST_* constants to
+ * sensible default values as well as defines S_IS*() macros in order to keep
+ * backward compatibility with the old stat.py module.
+ *
+ * New constants and macros such as S_IFDOOR / S_ISDOOR() are always defined
+ * as int 0.
+ *
+ * NOTE: POSIX only defines the values of the S_I* permission bits.
+ *
+ */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef MS_WINDOWS
+#include <windows.h>
+typedef unsigned short mode_t;
+
+/* FILE_ATTRIBUTE_INTEGRITY_STREAM and FILE_ATTRIBUTE_NO_SCRUB_DATA
+ are not present in VC2010, so define them manually */
+#ifndef FILE_ATTRIBUTE_INTEGRITY_STREAM
+# define FILE_ATTRIBUTE_INTEGRITY_STREAM 0x8000
+#endif
+
+#ifndef FILE_ATTRIBUTE_NO_SCRUB_DATA
+# define FILE_ATTRIBUTE_NO_SCRUB_DATA 0x20000
+#endif
+
+#ifndef IO_REPARSE_TAG_APPEXECLINK
+# define IO_REPARSE_TAG_APPEXECLINK 0x8000001BL
+#endif
+
+#endif /* MS_WINDOWS */
+
+/* From Python's stat.py */
+#ifndef S_IMODE
+# define S_IMODE 07777
+#endif
+
+/* S_IFXXX constants (file types)
+ *
+ * Only the names are defined by POSIX but not their value. All common file
+ * types seems to have the same numeric value on all platforms, though.
+ *
+ * pyport.h guarantees S_IFMT, S_IFDIR, S_IFCHR, S_IFREG and S_IFLNK
+ */
+
+#ifndef S_IFBLK
+# define S_IFBLK 0060000
+#endif
+
+#ifndef S_IFIFO
+# define S_IFIFO 0010000
+#endif
+
+#ifndef S_IFSOCK
+# define S_IFSOCK 0140000
+#endif
+
+#ifndef S_IFDOOR
+# define S_IFDOOR 0
+#endif
+
+#ifndef S_IFPORT
+# define S_IFPORT 0
+#endif
+
+#ifndef S_IFWHT
+# define S_IFWHT 0
+#endif
+
+
+/* S_ISXXX()
+ * pyport.h defines S_ISDIR(), S_ISREG() and S_ISCHR()
+ */
+
+#ifndef S_ISBLK
+# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
+#endif
+
+#ifndef S_ISFIFO
+# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
+#endif
+
+#ifndef S_ISLNK
+# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+#endif
+
+#ifndef S_ISSOCK
+# define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+#endif
+
+#ifndef S_ISDOOR
+# define S_ISDOOR(mode) 0
+#endif
+
+#ifndef S_ISPORT
+# define S_ISPORT(mode) 0
+#endif
+
+#ifndef S_ISWHT
+# define S_ISWHT(mode) 0
+#endif
+
+
+/* S_I* file permission
+ *
+ * The permission bit value are defined by POSIX standards.
+ */
+#ifndef S_ISUID
+# define S_ISUID 04000
+#endif
+
+#ifndef S_ISGID
+# define S_ISGID 02000
+#endif
+
+/* what is S_ENFMT? */
+#ifndef S_ENFMT
+# define S_ENFMT S_ISGID
+#endif
+
+#ifndef S_ISVTX
+# define S_ISVTX 01000
+#endif
+
+#ifndef S_IREAD
+# define S_IREAD 00400
+#endif
+
+#ifndef S_IWRITE
+# define S_IWRITE 00200
+#endif
+
+#ifndef S_IEXEC
+# define S_IEXEC 00100
+#endif
+
+#ifndef S_IRWXU
+# define S_IRWXU 00700
+#endif
+
+#ifndef S_IRUSR
+# define S_IRUSR 00400
+#endif
+
+#ifndef S_IWUSR
+# define S_IWUSR 00200
+#endif
+
+#ifndef S_IXUSR
+# define S_IXUSR 00100
+#endif
+
+#ifndef S_IRWXG
+# define S_IRWXG 00070
+#endif
+
+#ifndef S_IRGRP
+# define S_IRGRP 00040
+#endif
+
+#ifndef S_IWGRP
+# define S_IWGRP 00020
+#endif
+
+#ifndef S_IXGRP
+# define S_IXGRP 00010
+#endif
+
+#ifndef S_IRWXO
+# define S_IRWXO 00007
+#endif
+
+#ifndef S_IROTH
+# define S_IROTH 00004
+#endif
+
+#ifndef S_IWOTH
+# define S_IWOTH 00002
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 00001
+#endif
+
+
+/* Names for file flags */
+#ifndef UF_NODUMP
+# define UF_NODUMP 0x00000001
+#endif
+
+#ifndef UF_IMMUTABLE
+# define UF_IMMUTABLE 0x00000002
+#endif
+
+#ifndef UF_APPEND
+# define UF_APPEND 0x00000004
+#endif
+
+#ifndef UF_OPAQUE
+# define UF_OPAQUE 0x00000008
+#endif
+
+#ifndef UF_NOUNLINK
+# define UF_NOUNLINK 0x00000010
+#endif
+
+#ifndef UF_COMPRESSED
+# define UF_COMPRESSED 0x00000020
+#endif
+
+#ifndef UF_HIDDEN
+# define UF_HIDDEN 0x00008000
+#endif
+
+#ifndef SF_ARCHIVED
+# define SF_ARCHIVED 0x00010000
+#endif
+
+#ifndef SF_IMMUTABLE
+# define SF_IMMUTABLE 0x00020000
+#endif
+
+#ifndef SF_APPEND
+# define SF_APPEND 0x00040000
+#endif
+
+#ifndef SF_NOUNLINK
+# define SF_NOUNLINK 0x00100000
+#endif
+
+#ifndef SF_SNAPSHOT
+# define SF_SNAPSHOT 0x00200000
+#endif
+
+static mode_t
+_PyLong_AsMode_t(PyObject *op)
+{
+ unsigned long value;
+ mode_t mode;
+
+ value = PyLong_AsUnsignedLong(op);
+ if ((value == (unsigned long)-1) && PyErr_Occurred())
+ return (mode_t)-1;
+
+ mode = (mode_t)value;
+ if ((unsigned long)mode != value) {
+ PyErr_SetString(PyExc_OverflowError, "mode out of range");
+ return (mode_t)-1;
+ }
+ return mode;
+}
+
+
+#define stat_S_ISFUNC(isfunc, doc) \
+ static PyObject * \
+ stat_ ##isfunc (PyObject *self, PyObject *omode) \
+ { \
+ mode_t mode = _PyLong_AsMode_t(omode); \
+ if ((mode == (mode_t)-1) && PyErr_Occurred()) \
+ return NULL; \
+ return PyBool_FromLong(isfunc(mode)); \
+ } \
+ PyDoc_STRVAR(stat_ ## isfunc ## _doc, doc)
+
+stat_S_ISFUNC(S_ISDIR,
+ "S_ISDIR(mode) -> bool\n\n"
+ "Return True if mode is from a directory.");
+
+stat_S_ISFUNC(S_ISCHR,
+ "S_ISCHR(mode) -> bool\n\n"
+ "Return True if mode is from a character special device file.");
+
+stat_S_ISFUNC(S_ISBLK,
+ "S_ISBLK(mode) -> bool\n\n"
+ "Return True if mode is from a block special device file.");
+
+stat_S_ISFUNC(S_ISREG,
+ "S_ISREG(mode) -> bool\n\n"
+ "Return True if mode is from a regular file.");
+
+stat_S_ISFUNC(S_ISFIFO,
+ "S_ISFIFO(mode) -> bool\n\n"
+ "Return True if mode is from a FIFO (named pipe).");
+
+stat_S_ISFUNC(S_ISLNK,
+ "S_ISLNK(mode) -> bool\n\n"
+ "Return True if mode is from a symbolic link.");
+
+stat_S_ISFUNC(S_ISSOCK,
+ "S_ISSOCK(mode) -> bool\n\n"
+ "Return True if mode is from a socket.");
+
+stat_S_ISFUNC(S_ISDOOR,
+ "S_ISDOOR(mode) -> bool\n\n"
+ "Return True if mode is from a door.");
+
+stat_S_ISFUNC(S_ISPORT,
+ "S_ISPORT(mode) -> bool\n\n"
+ "Return True if mode is from an event port.");
+
+stat_S_ISFUNC(S_ISWHT,
+ "S_ISWHT(mode) -> bool\n\n"
+ "Return True if mode is from a whiteout.");
+
+
+PyDoc_STRVAR(stat_S_IMODE_doc,
+"Return the portion of the file's mode that can be set by os.chmod().");
+
+static PyObject *
+stat_S_IMODE(PyObject *self, PyObject *omode)
+{
+ mode_t mode = _PyLong_AsMode_t(omode);
+ if ((mode == (mode_t)-1) && PyErr_Occurred())
+ return NULL;
+ return PyLong_FromUnsignedLong(mode & S_IMODE);
+}
+
+
+PyDoc_STRVAR(stat_S_IFMT_doc,
+"Return the portion of the file's mode that describes the file type.");
+
+static PyObject *
+stat_S_IFMT(PyObject *self, PyObject *omode)
+{
+ mode_t mode = _PyLong_AsMode_t(omode);
+ if ((mode == (mode_t)-1) && PyErr_Occurred())
+ return NULL;
+ return PyLong_FromUnsignedLong(mode & S_IFMT);
+}
+
+/* file type chars according to
+ http://en.wikibooks.org/wiki/C_Programming/POSIX_Reference/sys/stat.h */
+
+static char
+filetype(mode_t mode)
+{
+ /* common cases first */
+ if (S_ISREG(mode)) return '-';
+ if (S_ISDIR(mode)) return 'd';
+ if (S_ISLNK(mode)) return 'l';
+ /* special files */
+ if (S_ISBLK(mode)) return 'b';
+ if (S_ISCHR(mode)) return 'c';
+ if (S_ISFIFO(mode)) return 'p';
+ if (S_ISSOCK(mode)) return 's';
+ /* non-standard types */
+ if (S_ISDOOR(mode)) return 'D';
+ if (S_ISPORT(mode)) return 'P';
+ if (S_ISWHT(mode)) return 'w';
+ /* unknown */
+ return '?';
+}
+
+static void
+fileperm(mode_t mode, char *buf)
+{
+ buf[0] = mode & S_IRUSR ? 'r' : '-';
+ buf[1] = mode & S_IWUSR ? 'w' : '-';
+ if (mode & S_ISUID) {
+ buf[2] = mode & S_IXUSR ? 's' : 'S';
+ } else {
+ buf[2] = mode & S_IXUSR ? 'x' : '-';
+ }
+ buf[3] = mode & S_IRGRP ? 'r' : '-';
+ buf[4] = mode & S_IWGRP ? 'w' : '-';
+ if (mode & S_ISGID) {
+ buf[5] = mode & S_IXGRP ? 's' : 'S';
+ } else {
+ buf[5] = mode & S_IXGRP ? 'x' : '-';
+ }
+ buf[6] = mode & S_IROTH ? 'r' : '-';
+ buf[7] = mode & S_IWOTH ? 'w' : '-';
+ if (mode & S_ISVTX) {
+ buf[8] = mode & S_IXOTH ? 't' : 'T';
+ } else {
+ buf[8] = mode & S_IXOTH ? 'x' : '-';
+ }
+}
+
+PyDoc_STRVAR(stat_filemode_doc,
+"Convert a file's mode to a string of the form '-rwxrwxrwx'");
+
+static PyObject *
+stat_filemode(PyObject *self, PyObject *omode)
+{
+ char buf[10];
+ mode_t mode;
+
+ mode = _PyLong_AsMode_t(omode);
+ if ((mode == (mode_t)-1) && PyErr_Occurred())
+ return NULL;
+
+ buf[0] = filetype(mode);
+ fileperm(mode, &buf[1]);
+ return PyUnicode_FromStringAndSize(buf, 10);
+}
+
+
+static PyMethodDef stat_methods[] = {
+ {"S_ISDIR", stat_S_ISDIR, METH_O, stat_S_ISDIR_doc},
+ {"S_ISCHR", stat_S_ISCHR, METH_O, stat_S_ISCHR_doc},
+ {"S_ISBLK", stat_S_ISBLK, METH_O, stat_S_ISBLK_doc},
+ {"S_ISREG", stat_S_ISREG, METH_O, stat_S_ISREG_doc},
+ {"S_ISFIFO", stat_S_ISFIFO, METH_O, stat_S_ISFIFO_doc},
+ {"S_ISLNK", stat_S_ISLNK, METH_O, stat_S_ISLNK_doc},
+ {"S_ISSOCK", stat_S_ISSOCK, METH_O, stat_S_ISSOCK_doc},
+ {"S_ISDOOR", stat_S_ISDOOR, METH_O, stat_S_ISDOOR_doc},
+ {"S_ISPORT", stat_S_ISPORT, METH_O, stat_S_ISPORT_doc},
+ {"S_ISWHT", stat_S_ISWHT, METH_O, stat_S_ISWHT_doc},
+ {"S_IMODE", stat_S_IMODE, METH_O, stat_S_IMODE_doc},
+ {"S_IFMT", stat_S_IFMT, METH_O, stat_S_IFMT_doc},
+ {"filemode", stat_filemode, METH_O, stat_filemode_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+
+PyDoc_STRVAR(module_doc,
+"S_IFMT_: file type bits\n\
+S_IFDIR: directory\n\
+S_IFCHR: character device\n\
+S_IFBLK: block device\n\
+S_IFREG: regular file\n\
+S_IFIFO: fifo (named pipe)\n\
+S_IFLNK: symbolic link\n\
+S_IFSOCK: socket file\n\
+S_IFDOOR: door\n\
+S_IFPORT: event port\n\
+S_IFWHT: whiteout\n\
+\n"
+
+"S_ISUID: set UID bit\n\
+S_ISGID: set GID bit\n\
+S_ENFMT: file locking enforcement\n\
+S_ISVTX: sticky bit\n\
+S_IREAD: Unix V7 synonym for S_IRUSR\n\
+S_IWRITE: Unix V7 synonym for S_IWUSR\n\
+S_IEXEC: Unix V7 synonym for S_IXUSR\n\
+S_IRWXU: mask for owner permissions\n\
+S_IRUSR: read by owner\n\
+S_IWUSR: write by owner\n\
+S_IXUSR: execute by owner\n\
+S_IRWXG: mask for group permissions\n\
+S_IRGRP: read by group\n\
+S_IWGRP: write by group\n\
+S_IXGRP: execute by group\n\
+S_IRWXO: mask for others (not in group) permissions\n\
+S_IROTH: read by others\n\
+S_IWOTH: write by others\n\
+S_IXOTH: execute by others\n\
+\n"
+
+"UF_NODUMP: do not dump file\n\
+UF_IMMUTABLE: file may not be changed\n\
+UF_APPEND: file may only be appended to\n\
+UF_OPAQUE: directory is opaque when viewed through a union stack\n\
+UF_NOUNLINK: file may not be renamed or deleted\n\
+UF_COMPRESSED: OS X: file is hfs-compressed\n\
+UF_HIDDEN: OS X: file should not be displayed\n\
+SF_ARCHIVED: file may be archived\n\
+SF_IMMUTABLE: file may not be changed\n\
+SF_APPEND: file may only be appended to\n\
+SF_NOUNLINK: file may not be renamed or deleted\n\
+SF_SNAPSHOT: file is a snapshot file\n\
+\n"
+
+"ST_MODE\n\
+ST_INO\n\
+ST_DEV\n\
+ST_NLINK\n\
+ST_UID\n\
+ST_GID\n\
+ST_SIZE\n\
+ST_ATIME\n\
+ST_MTIME\n\
+ST_CTIME\n\
+\n"
+
+"FILE_ATTRIBUTE_*: Windows file attribute constants\n\
+ (only present on Windows)\n\
+");
+
+
+static int
+stat_exec(PyObject *module)
+{
+#define ADD_INT_MACRO(module, macro) \
+ do { \
+ if (PyModule_AddIntConstant(module, #macro, macro) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+ ADD_INT_MACRO(module, S_IFDIR);
+ ADD_INT_MACRO(module, S_IFCHR);
+ ADD_INT_MACRO(module, S_IFBLK);
+ ADD_INT_MACRO(module, S_IFREG);
+ ADD_INT_MACRO(module, S_IFIFO);
+ ADD_INT_MACRO(module, S_IFLNK);
+ ADD_INT_MACRO(module, S_IFSOCK);
+ ADD_INT_MACRO(module, S_IFDOOR);
+ ADD_INT_MACRO(module, S_IFPORT);
+ ADD_INT_MACRO(module, S_IFWHT);
+
+ ADD_INT_MACRO(module, S_ISUID);
+ ADD_INT_MACRO(module, S_ISGID);
+ ADD_INT_MACRO(module, S_ISVTX);
+ ADD_INT_MACRO(module, S_ENFMT);
+
+ ADD_INT_MACRO(module, S_IREAD);
+ ADD_INT_MACRO(module, S_IWRITE);
+ ADD_INT_MACRO(module, S_IEXEC);
+
+ ADD_INT_MACRO(module, S_IRWXU);
+ ADD_INT_MACRO(module, S_IRUSR);
+ ADD_INT_MACRO(module, S_IWUSR);
+ ADD_INT_MACRO(module, S_IXUSR);
+
+ ADD_INT_MACRO(module, S_IRWXG);
+ ADD_INT_MACRO(module, S_IRGRP);
+ ADD_INT_MACRO(module, S_IWGRP);
+ ADD_INT_MACRO(module, S_IXGRP);
+
+ ADD_INT_MACRO(module, S_IRWXO);
+ ADD_INT_MACRO(module, S_IROTH);
+ ADD_INT_MACRO(module, S_IWOTH);
+ ADD_INT_MACRO(module, S_IXOTH);
+
+ ADD_INT_MACRO(module, UF_NODUMP);
+ ADD_INT_MACRO(module, UF_IMMUTABLE);
+ ADD_INT_MACRO(module, UF_APPEND);
+ ADD_INT_MACRO(module, UF_OPAQUE);
+ ADD_INT_MACRO(module, UF_NOUNLINK);
+ ADD_INT_MACRO(module, UF_COMPRESSED);
+ ADD_INT_MACRO(module, UF_HIDDEN);
+ ADD_INT_MACRO(module, SF_ARCHIVED);
+ ADD_INT_MACRO(module, SF_IMMUTABLE);
+ ADD_INT_MACRO(module, SF_APPEND);
+ ADD_INT_MACRO(module, SF_NOUNLINK);
+ ADD_INT_MACRO(module, SF_SNAPSHOT);
+
+ const char* st_constants[] = {
+ "ST_MODE",
+ "ST_INO",
+ "ST_DEV",
+ "ST_NLINK",
+ "ST_UID",
+ "ST_GID",
+ "ST_SIZE",
+ "ST_ATIME",
+ "ST_MTIME",
+ "ST_CTIME"
+ };
+
+ for (int i = 0; i < (int)Py_ARRAY_LENGTH(st_constants); i++) {
+ if (PyModule_AddIntConstant(module, st_constants[i], i) < 0) {
+ return -1;
+ }
+ }
+
+#ifdef MS_WINDOWS
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_ARCHIVE);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_COMPRESSED);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_DEVICE);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_DIRECTORY);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_ENCRYPTED);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_HIDDEN);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_INTEGRITY_STREAM);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_NORMAL);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_NO_SCRUB_DATA);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_OFFLINE);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_READONLY);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_REPARSE_POINT);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_SPARSE_FILE);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_SYSTEM);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_TEMPORARY);
+ ADD_INT_MACRO(module, FILE_ATTRIBUTE_VIRTUAL);
+
+ if (_PyModule_Add(module, "IO_REPARSE_TAG_SYMLINK",
+ PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(module, "IO_REPARSE_TAG_MOUNT_POINT",
+ PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(module, "IO_REPARSE_TAG_APPEXECLINK",
+ PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK)) < 0) {
+ return -1;
+ }
+#endif
+
+ return 0;
+}
+
+
+static PyModuleDef_Slot stat_slots[] = {
+ {Py_mod_exec, stat_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+
+static struct PyModuleDef statmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_stat",
+ .m_doc = module_doc,
+ .m_size = 0,
+ .m_methods = stat_methods,
+ .m_slots = stat_slots,
+};
+
+
+PyMODINIT_FUNC
+PyInit__stat(void)
+{
+ return PyModuleDef_Init(&statmodule);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/tools/python3/Modules/_statisticsmodule.c b/contrib/tools/python3/Modules/_statisticsmodule.c
new file mode 100644
index 00000000000..1d5465fbe6d
--- /dev/null
+++ b/contrib/tools/python3/Modules/_statisticsmodule.c
@@ -0,0 +1,152 @@
+/* statistics accelerator C extension: _statistics module. */
+
+#include "Python.h"
+#include "clinic/_statisticsmodule.c.h"
+
+/*[clinic input]
+module _statistics
+
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=864a6f59b76123b2]*/
+
+/*
+ * There is no closed-form solution to the inverse CDF for the normal
+ * distribution, so we use a rational approximation instead:
+ * Wichura, M.J. (1988). "Algorithm AS241: The Percentage Points of the
+ * Normal Distribution". Applied Statistics. Blackwell Publishing. 37
+ * (3): 477–484. doi:10.2307/2347330. JSTOR 2347330.
+ */
+
+/*[clinic input]
+_statistics._normal_dist_inv_cdf -> double
+ p: double
+ mu: double
+ sigma: double
+ /
+[clinic start generated code]*/
+
+static double
+_statistics__normal_dist_inv_cdf_impl(PyObject *module, double p, double mu,
+ double sigma)
+/*[clinic end generated code: output=02fd19ddaab36602 input=24715a74be15296a]*/
+{
+ double q, num, den, r, x;
+ if (p <= 0.0 || p >= 1.0) {
+ goto error;
+ }
+
+ q = p - 0.5;
+ if(fabs(q) <= 0.425) {
+ r = 0.180625 - q * q;
+ // Hash sum-55.8831928806149014439
+ num = (((((((2.5090809287301226727e+3 * r +
+ 3.3430575583588128105e+4) * r +
+ 6.7265770927008700853e+4) * r +
+ 4.5921953931549871457e+4) * r +
+ 1.3731693765509461125e+4) * r +
+ 1.9715909503065514427e+3) * r +
+ 1.3314166789178437745e+2) * r +
+ 3.3871328727963666080e+0) * q;
+ den = (((((((5.2264952788528545610e+3 * r +
+ 2.8729085735721942674e+4) * r +
+ 3.9307895800092710610e+4) * r +
+ 2.1213794301586595867e+4) * r +
+ 5.3941960214247511077e+3) * r +
+ 6.8718700749205790830e+2) * r +
+ 4.2313330701600911252e+1) * r +
+ 1.0);
+ if (den == 0.0) {
+ goto error;
+ }
+ x = num / den;
+ return mu + (x * sigma);
+ }
+ r = (q <= 0.0) ? p : (1.0 - p);
+ if (r <= 0.0 || r >= 1.0) {
+ goto error;
+ }
+ r = sqrt(-log(r));
+ if (r <= 5.0) {
+ r = r - 1.6;
+ // Hash sum-49.33206503301610289036
+ num = (((((((7.74545014278341407640e-4 * r +
+ 2.27238449892691845833e-2) * r +
+ 2.41780725177450611770e-1) * r +
+ 1.27045825245236838258e+0) * r +
+ 3.64784832476320460504e+0) * r +
+ 5.76949722146069140550e+0) * r +
+ 4.63033784615654529590e+0) * r +
+ 1.42343711074968357734e+0);
+ den = (((((((1.05075007164441684324e-9 * r +
+ 5.47593808499534494600e-4) * r +
+ 1.51986665636164571966e-2) * r +
+ 1.48103976427480074590e-1) * r +
+ 6.89767334985100004550e-1) * r +
+ 1.67638483018380384940e+0) * r +
+ 2.05319162663775882187e+0) * r +
+ 1.0);
+ } else {
+ r -= 5.0;
+ // Hash sum-47.52583317549289671629
+ num = (((((((2.01033439929228813265e-7 * r +
+ 2.71155556874348757815e-5) * r +
+ 1.24266094738807843860e-3) * r +
+ 2.65321895265761230930e-2) * r +
+ 2.96560571828504891230e-1) * r +
+ 1.78482653991729133580e+0) * r +
+ 5.46378491116411436990e+0) * r +
+ 6.65790464350110377720e+0);
+ den = (((((((2.04426310338993978564e-15 * r +
+ 1.42151175831644588870e-7) * r +
+ 1.84631831751005468180e-5) * r +
+ 7.86869131145613259100e-4) * r +
+ 1.48753612908506148525e-2) * r +
+ 1.36929880922735805310e-1) * r +
+ 5.99832206555887937690e-1) * r +
+ 1.0);
+ }
+ if (den == 0.0) {
+ goto error;
+ }
+ x = num / den;
+ if (q < 0.0) {
+ x = -x;
+ }
+ return mu + (x * sigma);
+
+ error:
+ PyErr_SetString(PyExc_ValueError, "inv_cdf undefined for these parameters");
+ return -1.0;
+}
+
+
+static PyMethodDef statistics_methods[] = {
+ _STATISTICS__NORMAL_DIST_INV_CDF_METHODDEF
+ {NULL, NULL, 0, NULL}
+};
+
+PyDoc_STRVAR(statistics_doc,
+"Accelerators for the statistics module.\n");
+
+static struct PyModuleDef_Slot _statisticsmodule_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef statisticsmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_statistics",
+ statistics_doc,
+ 0,
+ statistics_methods,
+ _statisticsmodule_slots,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__statistics(void)
+{
+ return PyModuleDef_Init(&statisticsmodule);
+}
diff --git a/contrib/tools/python3/Modules/_struct.c b/contrib/tools/python3/Modules/_struct.c
new file mode 100644
index 00000000000..55efc0c6cfe
--- /dev/null
+++ b/contrib/tools/python3/Modules/_struct.c
@@ -0,0 +1,2596 @@
+/* struct module -- pack values into and (out of) bytes objects */
+
+/* New version supporting byte order, alignment and size options,
+ character strings, and unsigned numbers */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "structmember.h" // PyMemberDef
+#include <ctype.h>
+
+/*[clinic input]
+class Struct "PyStructObject *" "&PyStructType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=9b032058a83ed7c3]*/
+
+typedef struct {
+ PyObject *cache;
+ PyObject *PyStructType;
+ PyObject *unpackiter_type;
+ PyObject *StructError;
+} _structmodulestate;
+
+static inline _structmodulestate*
+get_struct_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_structmodulestate *)state;
+}
+
+static struct PyModuleDef _structmodule;
+
+#define get_struct_state_structinst(self) \
+ (get_struct_state(PyType_GetModuleByDef(Py_TYPE(self), &_structmodule)))
+#define get_struct_state_iterinst(self) \
+ (get_struct_state(PyType_GetModule(Py_TYPE(self))))
+
+/* The translation function for each format character is table driven */
+typedef struct _formatdef {
+ char format;
+ Py_ssize_t size;
+ Py_ssize_t alignment;
+ PyObject* (*unpack)(_structmodulestate *, const char *,
+ const struct _formatdef *);
+ int (*pack)(_structmodulestate *, char *, PyObject *,
+ const struct _formatdef *);
+} formatdef;
+
+typedef struct _formatcode {
+ const struct _formatdef *fmtdef;
+ Py_ssize_t offset;
+ Py_ssize_t size;
+ Py_ssize_t repeat;
+} formatcode;
+
+/* Struct object interface */
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t s_size;
+ Py_ssize_t s_len;
+ formatcode *s_codes;
+ PyObject *s_format;
+ PyObject *weakreflist; /* List of weak references */
+} PyStructObject;
+
+#define PyStruct_Check(op, state) PyObject_TypeCheck(op, (PyTypeObject *)(state)->PyStructType)
+
+/* Define various structs to figure out the alignments of types */
+
+
+typedef struct { char c; short x; } st_short;
+typedef struct { char c; int x; } st_int;
+typedef struct { char c; long x; } st_long;
+typedef struct { char c; float x; } st_float;
+typedef struct { char c; double x; } st_double;
+typedef struct { char c; void *x; } st_void_p;
+typedef struct { char c; size_t x; } st_size_t;
+typedef struct { char c; _Bool x; } st_bool;
+
+#define SHORT_ALIGN (sizeof(st_short) - sizeof(short))
+#define INT_ALIGN (sizeof(st_int) - sizeof(int))
+#define LONG_ALIGN (sizeof(st_long) - sizeof(long))
+#define FLOAT_ALIGN (sizeof(st_float) - sizeof(float))
+#define DOUBLE_ALIGN (sizeof(st_double) - sizeof(double))
+#define VOID_P_ALIGN (sizeof(st_void_p) - sizeof(void *))
+#define SIZE_T_ALIGN (sizeof(st_size_t) - sizeof(size_t))
+#define BOOL_ALIGN (sizeof(st_bool) - sizeof(_Bool))
+
+/* We can't support q and Q in native mode unless the compiler does;
+ in std mode, they're 8 bytes on all platforms. */
+typedef struct { char c; long long x; } s_long_long;
+#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(long long))
+
+#ifdef __powerc
+#pragma options align=reset
+#endif
+
+/*[python input]
+class cache_struct_converter(CConverter):
+ type = 'PyStructObject *'
+ converter = 'cache_struct_converter'
+ c_default = "NULL"
+
+ def parse_arg(self, argname, displayname):
+ return """
+ if (!{converter}(module, {argname}, &{paramname})) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.name,
+ converter=self.converter)
+
+ def cleanup(self):
+ return "Py_XDECREF(%s);\n" % self.name
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=d6746621c2fb1a7d]*/
+
+static int cache_struct_converter(PyObject *, PyObject *, PyStructObject **);
+
+#include "clinic/_struct.c.h"
+
+/* Helper for integer format codes: converts an arbitrary Python object to a
+ PyLongObject if possible, otherwise fails. Caller should decref. */
+
+static PyObject *
+get_pylong(_structmodulestate *state, PyObject *v)
+{
+ assert(v != NULL);
+ if (!PyLong_Check(v)) {
+ /* Not an integer; try to use __index__ to convert. */
+ if (PyIndex_Check(v)) {
+ v = _PyNumber_Index(v);
+ if (v == NULL)
+ return NULL;
+ }
+ else {
+ PyErr_SetString(state->StructError,
+ "required argument is not an integer");
+ return NULL;
+ }
+ }
+ else
+ Py_INCREF(v);
+
+ assert(PyLong_Check(v));
+ return v;
+}
+
+/* Helper routine to get a C long and raise the appropriate error if it isn't
+ one */
+
+static int
+get_long(_structmodulestate *state, PyObject *v, long *p)
+{
+ long x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsLong(v);
+ Py_DECREF(v);
+ if (x == (long)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *p = x;
+ return 0;
+}
+
+
+/* Same, but handling unsigned long */
+
+static int
+get_ulong(_structmodulestate *state, PyObject *v, unsigned long *p)
+{
+ unsigned long x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsUnsignedLong(v);
+ Py_DECREF(v);
+ if (x == (unsigned long)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling native long long. */
+
+static int
+get_longlong(_structmodulestate *state, PyObject *v, long long *p)
+{
+ long long x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsLongLong(v);
+ Py_DECREF(v);
+ if (x == (long long)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling native unsigned long long. */
+
+static int
+get_ulonglong(_structmodulestate *state, PyObject *v, unsigned long long *p)
+{
+ unsigned long long x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsUnsignedLongLong(v);
+ Py_DECREF(v);
+ if (x == (unsigned long long)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling Py_ssize_t */
+
+static int
+get_ssize_t(_structmodulestate *state, PyObject *v, Py_ssize_t *p)
+{
+ Py_ssize_t x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsSsize_t(v);
+ Py_DECREF(v);
+ if (x == (Py_ssize_t)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *p = x;
+ return 0;
+}
+
+/* Same, but handling size_t */
+
+static int
+get_size_t(_structmodulestate *state, PyObject *v, size_t *p)
+{
+ size_t x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsSize_t(v);
+ Py_DECREF(v);
+ if (x == (size_t)-1 && PyErr_Occurred()) {
+ return -1;
+ }
+ *p = x;
+ return 0;
+}
+
+
+#define RANGE_ERROR(state, f, flag) return _range_error(state, f, flag)
+
+
+/* Floating point helpers */
+
+static PyObject *
+unpack_halffloat(const char *p, /* start of 2-byte string */
+ int le) /* true for little-endian, false for big-endian */
+{
+ double x = PyFloat_Unpack2(p, le);
+ if (x == -1.0 && PyErr_Occurred()) {
+ return NULL;
+ }
+ return PyFloat_FromDouble(x);
+}
+
+static int
+pack_halffloat(_structmodulestate *state,
+ char *p, /* start of 2-byte string */
+ PyObject *v, /* value to pack */
+ int le) /* true for little-endian, false for big-endian */
+{
+ double x = PyFloat_AsDouble(v);
+ if (x == -1.0 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ return PyFloat_Pack2(x, p, le);
+}
+
+static PyObject *
+unpack_float(const char *p, /* start of 4-byte string */
+ int le) /* true for little-endian, false for big-endian */
+{
+ double x;
+
+ x = PyFloat_Unpack4(p, le);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ return PyFloat_FromDouble(x);
+}
+
+static PyObject *
+unpack_double(const char *p, /* start of 8-byte string */
+ int le) /* true for little-endian, false for big-endian */
+{
+ double x;
+
+ x = PyFloat_Unpack8(p, le);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ return PyFloat_FromDouble(x);
+}
+
+/* Helper to format the range error exceptions */
+static int
+_range_error(_structmodulestate *state, const formatdef *f, int is_unsigned)
+{
+ /* ulargest is the largest unsigned value with f->size bytes.
+ * Note that the simpler:
+ * ((size_t)1 << (f->size * 8)) - 1
+ * doesn't work when f->size == sizeof(size_t) because C doesn't
+ * define what happens when a left shift count is >= the number of
+ * bits in the integer being shifted; e.g., on some boxes it doesn't
+ * shift at all when they're equal.
+ */
+ const size_t ulargest = (size_t)-1 >> ((SIZEOF_SIZE_T - f->size)*8);
+ assert(f->size >= 1 && f->size <= SIZEOF_SIZE_T);
+ if (is_unsigned)
+ PyErr_Format(state->StructError,
+ "'%c' format requires 0 <= number <= %zu",
+ f->format,
+ ulargest);
+ else {
+ const Py_ssize_t largest = (Py_ssize_t)(ulargest >> 1);
+ PyErr_Format(state->StructError,
+ "'%c' format requires %zd <= number <= %zd",
+ f->format,
+ ~ largest,
+ largest);
+ }
+
+ return -1;
+}
+
+
+
+/* A large number of small routines follow, with names of the form
+
+ [bln][up]_TYPE
+
+ [bln] distinguishes among big-endian, little-endian and native.
+ [pu] distinguishes between pack (to struct) and unpack (from struct).
+ TYPE is one of char, byte, ubyte, etc.
+*/
+
+/* Native mode routines. ****************************************************/
+/* NOTE:
+ In all n[up]_<type> routines handling types larger than 1 byte, there is
+ *no* guarantee that the p pointer is properly aligned for each type,
+ therefore memcpy is called. An intermediate variable is used to
+ compensate for big-endian architectures.
+ Normally both the intermediate variable and the memcpy call will be
+ skipped by C optimisation in little-endian architectures (gcc >= 2.91
+ does this). */
+
+static PyObject *
+nu_char(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return PyBytes_FromStringAndSize(p, 1);
+}
+
+static PyObject *
+nu_byte(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return PyLong_FromLong((long) *(signed char *)p);
+}
+
+static PyObject *
+nu_ubyte(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return PyLong_FromLong((long) *(unsigned char *)p);
+}
+
+static PyObject *
+nu_short(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ short x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromLong((long)x);
+}
+
+static PyObject *
+nu_ushort(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned short x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromLong((long)x);
+}
+
+static PyObject *
+nu_int(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ int x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromLong((long)x);
+}
+
+static PyObject *
+nu_uint(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned int x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromUnsignedLong((unsigned long)x);
+}
+
+static PyObject *
+nu_long(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ long x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromLong(x);
+}
+
+static PyObject *
+nu_ulong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromUnsignedLong(x);
+}
+
+static PyObject *
+nu_ssize_t(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ Py_ssize_t x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromSsize_t(x);
+}
+
+static PyObject *
+nu_size_t(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ size_t x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromSize_t(x);
+}
+
+static PyObject *
+nu_longlong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ long long x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromLongLong(x);
+}
+
+static PyObject *
+nu_ulonglong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long long x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromUnsignedLongLong(x);
+}
+
+static PyObject *
+nu_bool(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ _Bool x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyBool_FromLong(x != 0);
+}
+
+
+static PyObject *
+nu_halffloat(_structmodulestate *state, const char *p, const formatdef *f)
+{
+#if PY_LITTLE_ENDIAN
+ return unpack_halffloat(p, 1);
+#else
+ return unpack_halffloat(p, 0);
+#endif
+}
+
+static PyObject *
+nu_float(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ float x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyFloat_FromDouble((double)x);
+}
+
+static PyObject *
+nu_double(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ double x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyFloat_FromDouble(x);
+}
+
+static PyObject *
+nu_void_p(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ void *x;
+ memcpy((char *)&x, p, sizeof x);
+ return PyLong_FromVoidPtr(x);
+}
+
+static int
+np_byte(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+ if (x < -128 || x > 127) {
+ RANGE_ERROR(state, f, 0);
+ }
+ *p = (char)x;
+ return 0;
+}
+
+static int
+np_ubyte(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ if (x < 0 || x > 255) {
+ RANGE_ERROR(state, f, 1);
+ }
+ *(unsigned char *)p = (unsigned char)x;
+ return 0;
+}
+
+static int
+np_char(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ if (!PyBytes_Check(v) || PyBytes_Size(v) != 1) {
+ PyErr_SetString(state->StructError,
+ "char format requires a bytes object of length 1");
+ return -1;
+ }
+ *p = *PyBytes_AS_STRING(v);
+ return 0;
+}
+
+static int
+np_short(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ short y;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+ if (x < SHRT_MIN || x > SHRT_MAX) {
+ RANGE_ERROR(state, f, 0);
+ }
+ y = (short)x;
+ memcpy(p, (char *)&y, sizeof y);
+ return 0;
+}
+
+static int
+np_ushort(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ unsigned short y;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ if (x < 0 || x > USHRT_MAX) {
+ RANGE_ERROR(state, f, 1);
+ }
+ y = (unsigned short)x;
+ memcpy(p, (char *)&y, sizeof y);
+ return 0;
+}
+
+static int
+np_int(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ int y;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+#if (SIZEOF_LONG > SIZEOF_INT)
+ if ((x < ((long)INT_MIN)) || (x > ((long)INT_MAX)))
+ RANGE_ERROR(state, f, 0);
+#endif
+ y = (int)x;
+ memcpy(p, (char *)&y, sizeof y);
+ return 0;
+}
+
+static int
+np_uint(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ unsigned long x;
+ unsigned int y;
+ if (get_ulong(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ y = (unsigned int)x;
+#if (SIZEOF_LONG > SIZEOF_INT)
+ if (x > ((unsigned long)UINT_MAX))
+ RANGE_ERROR(state, f, 1);
+#endif
+ memcpy(p, (char *)&y, sizeof y);
+ return 0;
+}
+
+static int
+np_long(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_ulong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ unsigned long x;
+ if (get_ulong(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_ssize_t(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ Py_ssize_t x;
+ if (get_ssize_t(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_size_t(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ size_t x;
+ if (get_size_t(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long long x;
+ if (get_longlong(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Format(state->StructError,
+ "'%c' format requires %lld <= number <= %lld",
+ f->format,
+ LLONG_MIN,
+ LLONG_MAX);
+ }
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ unsigned long long x;
+ if (get_ulonglong(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Format(state->StructError,
+ "'%c' format requires 0 <= number <= %llu",
+ f->format,
+ ULLONG_MAX);
+ }
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+
+static int
+np_bool(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ int y;
+ _Bool x;
+ y = PyObject_IsTrue(v);
+ if (y < 0)
+ return -1;
+ x = y;
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_halffloat(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+#if PY_LITTLE_ENDIAN
+ return pack_halffloat(state, p, v, 1);
+#else
+ return pack_halffloat(state, p, v, 0);
+#endif
+}
+
+static int
+np_float(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ float x = (float)PyFloat_AsDouble(v);
+ if (x == -1 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static int
+np_double(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ double x = PyFloat_AsDouble(v);
+ if (x == -1 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ memcpy(p, (char *)&x, sizeof(double));
+ return 0;
+}
+
+static int
+np_void_p(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ void *x;
+
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ assert(PyLong_Check(v));
+ x = PyLong_AsVoidPtr(v);
+ Py_DECREF(v);
+ if (x == NULL && PyErr_Occurred())
+ return -1;
+ memcpy(p, (char *)&x, sizeof x);
+ return 0;
+}
+
+static const formatdef native_table[] = {
+ {'x', sizeof(char), 0, NULL},
+ {'b', sizeof(char), 0, nu_byte, np_byte},
+ {'B', sizeof(char), 0, nu_ubyte, np_ubyte},
+ {'c', sizeof(char), 0, nu_char, np_char},
+ {'s', sizeof(char), 0, NULL},
+ {'p', sizeof(char), 0, NULL},
+ {'h', sizeof(short), SHORT_ALIGN, nu_short, np_short},
+ {'H', sizeof(short), SHORT_ALIGN, nu_ushort, np_ushort},
+ {'i', sizeof(int), INT_ALIGN, nu_int, np_int},
+ {'I', sizeof(int), INT_ALIGN, nu_uint, np_uint},
+ {'l', sizeof(long), LONG_ALIGN, nu_long, np_long},
+ {'L', sizeof(long), LONG_ALIGN, nu_ulong, np_ulong},
+ {'n', sizeof(size_t), SIZE_T_ALIGN, nu_ssize_t, np_ssize_t},
+ {'N', sizeof(size_t), SIZE_T_ALIGN, nu_size_t, np_size_t},
+ {'q', sizeof(long long), LONG_LONG_ALIGN, nu_longlong, np_longlong},
+ {'Q', sizeof(long long), LONG_LONG_ALIGN, nu_ulonglong,np_ulonglong},
+ {'?', sizeof(_Bool), BOOL_ALIGN, nu_bool, np_bool},
+ {'e', sizeof(short), SHORT_ALIGN, nu_halffloat, np_halffloat},
+ {'f', sizeof(float), FLOAT_ALIGN, nu_float, np_float},
+ {'d', sizeof(double), DOUBLE_ALIGN, nu_double, np_double},
+ {'P', sizeof(void *), VOID_P_ALIGN, nu_void_p, np_void_p},
+ {0}
+};
+
+/* Big-endian routines. *****************************************************/
+
+static PyObject *
+bu_short(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x = 0;
+
+ /* This function is only ever used in the case f->size == 2. */
+ assert(f->size == 2);
+ Py_ssize_t i = 2;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | *bytes++;
+ } while (--i > 0);
+ /* Extend sign, avoiding implementation-defined or undefined behaviour. */
+ x = (x ^ 0x8000U) - 0x8000U;
+ return PyLong_FromLong(x & 0x8000U ? -1 - (long)(~x) : (long)x);
+}
+
+static PyObject *
+bu_int(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x = 0;
+
+ /* This function is only ever used in the case f->size == 4. */
+ assert(f->size == 4);
+ Py_ssize_t i = 4;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | *bytes++;
+ } while (--i > 0);
+ /* Extend sign, avoiding implementation-defined or undefined behaviour. */
+ x = (x ^ 0x80000000U) - 0x80000000U;
+ return PyLong_FromLong(x & 0x80000000U ? -1 - (long)(~x) : (long)x);
+}
+
+static PyObject *
+bu_uint(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x = 0;
+ Py_ssize_t i = f->size;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | *bytes++;
+ } while (--i > 0);
+ return PyLong_FromUnsignedLong(x);
+}
+
+static PyObject *
+bu_longlong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long long x = 0;
+
+ /* This function is only ever used in the case f->size == 8. */
+ assert(f->size == 8);
+ Py_ssize_t i = 8;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | *bytes++;
+ } while (--i > 0);
+ /* Extend sign, avoiding implementation-defined or undefined behaviour. */
+ x = (x ^ 0x8000000000000000U) - 0x8000000000000000U;
+ return PyLong_FromLongLong(
+ x & 0x8000000000000000U ? -1 - (long long)(~x) : (long long)x);
+}
+
+static PyObject *
+bu_ulonglong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long long x = 0;
+ Py_ssize_t i = f->size;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | *bytes++;
+ } while (--i > 0);
+ return PyLong_FromUnsignedLongLong(x);
+}
+
+static PyObject *
+bu_halffloat(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return unpack_halffloat(p, 0);
+}
+
+static PyObject *
+bu_float(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return unpack_float(p, 0);
+}
+
+static PyObject *
+bu_double(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return unpack_double(p, 0);
+}
+
+static PyObject *
+bu_bool(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return PyBool_FromLong(*p != 0);
+}
+
+static int
+bp_int(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ Py_ssize_t i;
+ unsigned char *q = (unsigned char *)p;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+ i = f->size;
+ if (i != SIZEOF_LONG) {
+ if ((i == 2) && (x < -32768 || x > 32767))
+ RANGE_ERROR(state, f, 0);
+#if (SIZEOF_LONG != 4)
+ else if ((i == 4) && (x < -2147483648L || x > 2147483647L))
+ RANGE_ERROR(state, f, 0);
+#endif
+ }
+ do {
+ q[--i] = (unsigned char)(x & 0xffL);
+ x >>= 8;
+ } while (i > 0);
+ return 0;
+}
+
+static int
+bp_uint(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ unsigned long x;
+ Py_ssize_t i;
+ unsigned char *q = (unsigned char *)p;
+ if (get_ulong(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ i = f->size;
+ if (i != SIZEOF_LONG) {
+ unsigned long maxint = 1;
+ maxint <<= (unsigned long)(i * 8);
+ if (x >= maxint)
+ RANGE_ERROR(state, f, 1);
+ }
+ do {
+ q[--i] = (unsigned char)(x & 0xffUL);
+ x >>= 8;
+ } while (i > 0);
+ return 0;
+}
+
+static int
+bp_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ int res;
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ res = _PyLong_AsByteArray((PyLongObject *)v,
+ (unsigned char *)p,
+ 8,
+ 0, /* little_endian */
+ 1 /* signed */);
+ Py_DECREF(v);
+ if (res == -1 && PyErr_Occurred()) {
+ PyErr_Format(state->StructError,
+ "'%c' format requires %lld <= number <= %lld",
+ f->format,
+ LLONG_MIN,
+ LLONG_MAX);
+ return -1;
+ }
+ return res;
+}
+
+static int
+bp_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ int res;
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ res = _PyLong_AsByteArray((PyLongObject *)v,
+ (unsigned char *)p,
+ 8,
+ 0, /* little_endian */
+ 0 /* signed */);
+ Py_DECREF(v);
+ if (res == -1 && PyErr_Occurred()) {
+ PyErr_Format(state->StructError,
+ "'%c' format requires 0 <= number <= %llu",
+ f->format,
+ ULLONG_MAX);
+ return -1;
+ }
+ return res;
+}
+
+static int
+bp_halffloat(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ return pack_halffloat(state, p, v, 0);
+}
+
+static int
+bp_float(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ double x = PyFloat_AsDouble(v);
+ if (x == -1 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ return PyFloat_Pack4(x, p, 0);
+}
+
+static int
+bp_double(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ double x = PyFloat_AsDouble(v);
+ if (x == -1 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ return PyFloat_Pack8(x, p, 0);
+}
+
+static int
+bp_bool(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ int y;
+ y = PyObject_IsTrue(v);
+ if (y < 0)
+ return -1;
+ *p = (char)y;
+ return 0;
+}
+
+static formatdef bigendian_table[] = {
+ {'x', 1, 0, NULL},
+ {'b', 1, 0, nu_byte, np_byte},
+ {'B', 1, 0, nu_ubyte, np_ubyte},
+ {'c', 1, 0, nu_char, np_char},
+ {'s', 1, 0, NULL},
+ {'p', 1, 0, NULL},
+ {'h', 2, 0, bu_short, bp_int},
+ {'H', 2, 0, bu_uint, bp_uint},
+ {'i', 4, 0, bu_int, bp_int},
+ {'I', 4, 0, bu_uint, bp_uint},
+ {'l', 4, 0, bu_int, bp_int},
+ {'L', 4, 0, bu_uint, bp_uint},
+ {'q', 8, 0, bu_longlong, bp_longlong},
+ {'Q', 8, 0, bu_ulonglong, bp_ulonglong},
+ {'?', 1, 0, bu_bool, bp_bool},
+ {'e', 2, 0, bu_halffloat, bp_halffloat},
+ {'f', 4, 0, bu_float, bp_float},
+ {'d', 8, 0, bu_double, bp_double},
+ {0}
+};
+
+/* Little-endian routines. *****************************************************/
+
+static PyObject *
+lu_short(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x = 0;
+
+ /* This function is only ever used in the case f->size == 2. */
+ assert(f->size == 2);
+ Py_ssize_t i = 2;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | bytes[--i];
+ } while (i > 0);
+ /* Extend sign, avoiding implementation-defined or undefined behaviour. */
+ x = (x ^ 0x8000U) - 0x8000U;
+ return PyLong_FromLong(x & 0x8000U ? -1 - (long)(~x) : (long)x);
+}
+
+static PyObject *
+lu_int(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x = 0;
+
+ /* This function is only ever used in the case f->size == 4. */
+ assert(f->size == 4);
+ Py_ssize_t i = 4;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | bytes[--i];
+ } while (i > 0);
+ /* Extend sign, avoiding implementation-defined or undefined behaviour. */
+ x = (x ^ 0x80000000U) - 0x80000000U;
+ return PyLong_FromLong(x & 0x80000000U ? -1 - (long)(~x) : (long)x);
+}
+
+static PyObject *
+lu_uint(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long x = 0;
+ Py_ssize_t i = f->size;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | bytes[--i];
+ } while (i > 0);
+ return PyLong_FromUnsignedLong(x);
+}
+
+static PyObject *
+lu_longlong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long long x = 0;
+
+ /* This function is only ever used in the case f->size == 8. */
+ assert(f->size == 8);
+ Py_ssize_t i = 8;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | bytes[--i];
+ } while (i > 0);
+ /* Extend sign, avoiding implementation-defined or undefined behaviour. */
+ x = (x ^ 0x8000000000000000U) - 0x8000000000000000U;
+ return PyLong_FromLongLong(
+ x & 0x8000000000000000U ? -1 - (long long)(~x) : (long long)x);
+}
+
+static PyObject *
+lu_ulonglong(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ unsigned long long x = 0;
+ Py_ssize_t i = f->size;
+ const unsigned char *bytes = (const unsigned char *)p;
+ do {
+ x = (x<<8) | bytes[--i];
+ } while (i > 0);
+ return PyLong_FromUnsignedLongLong(x);
+}
+
+static PyObject *
+lu_halffloat(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return unpack_halffloat(p, 1);
+}
+
+static PyObject *
+lu_float(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return unpack_float(p, 1);
+}
+
+static PyObject *
+lu_double(_structmodulestate *state, const char *p, const formatdef *f)
+{
+ return unpack_double(p, 1);
+}
+
+static int
+lp_int(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ long x;
+ Py_ssize_t i;
+ unsigned char *q = (unsigned char *)p;
+ if (get_long(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 0);
+ }
+ return -1;
+ }
+ i = f->size;
+ if (i != SIZEOF_LONG) {
+ if ((i == 2) && (x < -32768 || x > 32767))
+ RANGE_ERROR(state, f, 0);
+#if (SIZEOF_LONG != 4)
+ else if ((i == 4) && (x < -2147483648L || x > 2147483647L))
+ RANGE_ERROR(state, f, 0);
+#endif
+ }
+ do {
+ *q++ = (unsigned char)(x & 0xffL);
+ x >>= 8;
+ } while (--i > 0);
+ return 0;
+}
+
+static int
+lp_uint(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ unsigned long x;
+ Py_ssize_t i;
+ unsigned char *q = (unsigned char *)p;
+ if (get_ulong(state, v, &x) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ RANGE_ERROR(state, f, 1);
+ }
+ return -1;
+ }
+ i = f->size;
+ if (i != SIZEOF_LONG) {
+ unsigned long maxint = 1;
+ maxint <<= (unsigned long)(i * 8);
+ if (x >= maxint)
+ RANGE_ERROR(state, f, 1);
+ }
+ do {
+ *q++ = (unsigned char)(x & 0xffUL);
+ x >>= 8;
+ } while (--i > 0);
+ return 0;
+}
+
+static int
+lp_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ int res;
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ res = _PyLong_AsByteArray((PyLongObject*)v,
+ (unsigned char *)p,
+ 8,
+ 1, /* little_endian */
+ 1 /* signed */);
+ Py_DECREF(v);
+ if (res == -1 && PyErr_Occurred()) {
+ PyErr_Format(state->StructError,
+ "'%c' format requires %lld <= number <= %lld",
+ f->format,
+ LLONG_MIN,
+ LLONG_MAX);
+ return -1;
+ }
+ return res;
+}
+
+static int
+lp_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ int res;
+ v = get_pylong(state, v);
+ if (v == NULL)
+ return -1;
+ res = _PyLong_AsByteArray((PyLongObject*)v,
+ (unsigned char *)p,
+ 8,
+ 1, /* little_endian */
+ 0 /* signed */);
+ Py_DECREF(v);
+ if (res == -1 && PyErr_Occurred()) {
+ PyErr_Format(state->StructError,
+ "'%c' format requires 0 <= number <= %llu",
+ f->format,
+ ULLONG_MAX);
+ return -1;
+ }
+ return res;
+}
+
+static int
+lp_halffloat(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ return pack_halffloat(state, p, v, 1);
+}
+
+static int
+lp_float(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ double x = PyFloat_AsDouble(v);
+ if (x == -1 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ return PyFloat_Pack4(x, p, 1);
+}
+
+static int
+lp_double(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
+{
+ double x = PyFloat_AsDouble(v);
+ if (x == -1 && PyErr_Occurred()) {
+ PyErr_SetString(state->StructError,
+ "required argument is not a float");
+ return -1;
+ }
+ return PyFloat_Pack8(x, p, 1);
+}
+
+static formatdef lilendian_table[] = {
+ {'x', 1, 0, NULL},
+ {'b', 1, 0, nu_byte, np_byte},
+ {'B', 1, 0, nu_ubyte, np_ubyte},
+ {'c', 1, 0, nu_char, np_char},
+ {'s', 1, 0, NULL},
+ {'p', 1, 0, NULL},
+ {'h', 2, 0, lu_short, lp_int},
+ {'H', 2, 0, lu_uint, lp_uint},
+ {'i', 4, 0, lu_int, lp_int},
+ {'I', 4, 0, lu_uint, lp_uint},
+ {'l', 4, 0, lu_int, lp_int},
+ {'L', 4, 0, lu_uint, lp_uint},
+ {'q', 8, 0, lu_longlong, lp_longlong},
+ {'Q', 8, 0, lu_ulonglong, lp_ulonglong},
+ {'?', 1, 0, bu_bool, bp_bool}, /* Std rep not endian dep,
+ but potentially different from native rep -- reuse bx_bool funcs. */
+ {'e', 2, 0, lu_halffloat, lp_halffloat},
+ {'f', 4, 0, lu_float, lp_float},
+ {'d', 8, 0, lu_double, lp_double},
+ {0}
+};
+
+
+static const formatdef *
+whichtable(const char **pfmt)
+{
+ const char *fmt = (*pfmt)++; /* May be backed out of later */
+ switch (*fmt) {
+ case '<':
+ return lilendian_table;
+ case '>':
+ case '!': /* Network byte order is big-endian */
+ return bigendian_table;
+ case '=': { /* Host byte order -- different from native in alignment! */
+#if PY_LITTLE_ENDIAN
+ return lilendian_table;
+#else
+ return bigendian_table;
+#endif
+ }
+ default:
+ --*pfmt; /* Back out of pointer increment */
+ /* Fall through */
+ case '@':
+ return native_table;
+ }
+}
+
+
+/* Get the table entry for a format code */
+
+static const formatdef *
+getentry(_structmodulestate *state, int c, const formatdef *f)
+{
+ for (; f->format != '\0'; f++) {
+ if (f->format == c) {
+ return f;
+ }
+ }
+ PyErr_SetString(state->StructError, "bad char in struct format");
+ return NULL;
+}
+
+
+/* Align a size according to a format code. Return -1 on overflow. */
+
+static Py_ssize_t
+align(Py_ssize_t size, char c, const formatdef *e)
+{
+ Py_ssize_t extra;
+
+ if (e->format == c) {
+ if (e->alignment && size > 0) {
+ extra = (e->alignment - 1) - (size - 1) % (e->alignment);
+ if (extra > PY_SSIZE_T_MAX - size)
+ return -1;
+ size += extra;
+ }
+ }
+ return size;
+}
+
+/*
+ * Struct object implementation.
+ */
+
+/* calculate the size of a format string */
+
+static int
+prepare_s(PyStructObject *self)
+{
+ const formatdef *f;
+ const formatdef *e;
+ formatcode *codes;
+
+ const char *s;
+ const char *fmt;
+ char c;
+ Py_ssize_t size, len, num, itemsize;
+ size_t ncodes;
+
+ _structmodulestate *state = get_struct_state_structinst(self);
+
+ fmt = PyBytes_AS_STRING(self->s_format);
+ if (strlen(fmt) != (size_t)PyBytes_GET_SIZE(self->s_format)) {
+ PyErr_SetString(state->StructError,
+ "embedded null character");
+ return -1;
+ }
+
+ f = whichtable(&fmt);
+
+ s = fmt;
+ size = 0;
+ len = 0;
+ ncodes = 0;
+ while ((c = *s++) != '\0') {
+ if (Py_ISSPACE(c))
+ continue;
+ if ('0' <= c && c <= '9') {
+ num = c - '0';
+ while ('0' <= (c = *s++) && c <= '9') {
+ /* overflow-safe version of
+ if (num*10 + (c - '0') > PY_SSIZE_T_MAX) { ... } */
+ if (num >= PY_SSIZE_T_MAX / 10 && (
+ num > PY_SSIZE_T_MAX / 10 ||
+ (c - '0') > PY_SSIZE_T_MAX % 10))
+ goto overflow;
+ num = num*10 + (c - '0');
+ }
+ if (c == '\0') {
+ PyErr_SetString(state->StructError,
+ "repeat count given without format specifier");
+ return -1;
+ }
+ }
+ else
+ num = 1;
+
+ e = getentry(state, c, f);
+ if (e == NULL)
+ return -1;
+
+ switch (c) {
+ case 's': /* fall through */
+ case 'p': len++; ncodes++; break;
+ case 'x': break;
+ default: len += num; if (num) ncodes++; break;
+ }
+
+ itemsize = e->size;
+ size = align(size, c, e);
+ if (size == -1)
+ goto overflow;
+
+ /* if (size + num * itemsize > PY_SSIZE_T_MAX) { ... } */
+ if (num > (PY_SSIZE_T_MAX - size) / itemsize)
+ goto overflow;
+ size += num * itemsize;
+ }
+
+ /* check for overflow */
+ if ((ncodes + 1) > ((size_t)PY_SSIZE_T_MAX / sizeof(formatcode))) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ self->s_size = size;
+ self->s_len = len;
+ codes = PyMem_Malloc((ncodes + 1) * sizeof(formatcode));
+ if (codes == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ /* Free any s_codes value left over from a previous initialization. */
+ if (self->s_codes != NULL)
+ PyMem_Free(self->s_codes);
+ self->s_codes = codes;
+
+ s = fmt;
+ size = 0;
+ while ((c = *s++) != '\0') {
+ if (Py_ISSPACE(c))
+ continue;
+ if ('0' <= c && c <= '9') {
+ num = c - '0';
+ while ('0' <= (c = *s++) && c <= '9')
+ num = num*10 + (c - '0');
+ }
+ else
+ num = 1;
+
+ e = getentry(state, c, f);
+
+ size = align(size, c, e);
+ if (c == 's' || c == 'p') {
+ codes->offset = size;
+ codes->size = num;
+ codes->fmtdef = e;
+ codes->repeat = 1;
+ codes++;
+ size += num;
+ } else if (c == 'x') {
+ size += num;
+ } else if (num) {
+ codes->offset = size;
+ codes->size = e->size;
+ codes->fmtdef = e;
+ codes->repeat = num;
+ codes++;
+ size += e->size * num;
+ }
+ }
+ codes->fmtdef = NULL;
+ codes->offset = size;
+ codes->size = 0;
+ codes->repeat = 0;
+
+ return 0;
+
+ overflow:
+ PyErr_SetString(state->StructError,
+ "total struct size too long");
+ return -1;
+}
+
+static PyObject *
+s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyObject *self;
+
+ assert(type != NULL);
+ allocfunc alloc_func = PyType_GetSlot(type, Py_tp_alloc);
+ assert(alloc_func != NULL);
+
+ self = alloc_func(type, 0);
+ if (self != NULL) {
+ PyStructObject *s = (PyStructObject*)self;
+ s->s_format = Py_NewRef(Py_None);
+ s->s_codes = NULL;
+ s->s_size = -1;
+ s->s_len = -1;
+ }
+ return self;
+}
+
+/*[clinic input]
+Struct.__init__
+
+ format: object
+
+Create a compiled struct object.
+
+Return a new Struct object which writes and reads binary data according to
+the format string.
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
+static int
+Struct___init___impl(PyStructObject *self, PyObject *format)
+/*[clinic end generated code: output=b8e80862444e92d0 input=192a4575a3dde802]*/
+{
+ int ret = 0;
+
+ if (PyUnicode_Check(format)) {
+ format = PyUnicode_AsASCIIString(format);
+ if (format == NULL)
+ return -1;
+ }
+ else {
+ Py_INCREF(format);
+ }
+
+ if (!PyBytes_Check(format)) {
+ Py_DECREF(format);
+ PyErr_Format(PyExc_TypeError,
+ "Struct() argument 1 must be a str or bytes object, "
+ "not %.200s",
+ _PyType_Name(Py_TYPE(format)));
+ return -1;
+ }
+
+ Py_SETREF(self->s_format, format);
+
+ ret = prepare_s(self);
+ return ret;
+}
+
+static int
+s_clear(PyStructObject *s)
+{
+ Py_CLEAR(s->s_format);
+ return 0;
+}
+
+static int
+s_traverse(PyStructObject *s, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(s));
+ Py_VISIT(s->s_format);
+ return 0;
+}
+
+static void
+s_dealloc(PyStructObject *s)
+{
+ PyTypeObject *tp = Py_TYPE(s);
+ PyObject_GC_UnTrack(s);
+ if (s->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *)s);
+ if (s->s_codes != NULL) {
+ PyMem_Free(s->s_codes);
+ }
+ Py_XDECREF(s->s_format);
+ freefunc free_func = PyType_GetSlot(Py_TYPE(s), Py_tp_free);
+ free_func(s);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+s_unpack_internal(PyStructObject *soself, const char *startfrom,
+ _structmodulestate *state) {
+ formatcode *code;
+ Py_ssize_t i = 0;
+ PyObject *result = PyTuple_New(soself->s_len);
+ if (result == NULL)
+ return NULL;
+
+ for (code = soself->s_codes; code->fmtdef != NULL; code++) {
+ const formatdef *e = code->fmtdef;
+ const char *res = startfrom + code->offset;
+ Py_ssize_t j = code->repeat;
+ while (j--) {
+ PyObject *v;
+ if (e->format == 's') {
+ v = PyBytes_FromStringAndSize(res, code->size);
+ } else if (e->format == 'p') {
+ Py_ssize_t n = *(unsigned char*)res;
+ if (n >= code->size)
+ n = code->size - 1;
+ v = PyBytes_FromStringAndSize(res + 1, n);
+ } else {
+ v = e->unpack(state, res, e);
+ }
+ if (v == NULL)
+ goto fail;
+ PyTuple_SET_ITEM(result, i++, v);
+ res += code->size;
+ }
+ }
+
+ return result;
+fail:
+ Py_DECREF(result);
+ return NULL;
+}
+
+
+/*[clinic input]
+Struct.unpack
+
+ buffer: Py_buffer
+ /
+
+Return a tuple containing unpacked values.
+
+Unpack according to the format string Struct.format. The buffer's size
+in bytes must be Struct.size.
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
+static PyObject *
+Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer)
+/*[clinic end generated code: output=873a24faf02e848a input=3113f8e7038b2f6c]*/
+{
+ _structmodulestate *state = get_struct_state_structinst(self);
+ assert(self->s_codes != NULL);
+ if (buffer->len != self->s_size) {
+ PyErr_Format(state->StructError,
+ "unpack requires a buffer of %zd bytes",
+ self->s_size);
+ return NULL;
+ }
+ return s_unpack_internal(self, buffer->buf, state);
+}
+
+/*[clinic input]
+Struct.unpack_from
+
+ buffer: Py_buffer
+ offset: Py_ssize_t = 0
+
+Return a tuple containing unpacked values.
+
+Values are unpacked according to the format string Struct.format.
+
+The buffer's size in bytes, starting at position offset, must be
+at least Struct.size.
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
+static PyObject *
+Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer,
+ Py_ssize_t offset)
+/*[clinic end generated code: output=57fac875e0977316 input=cafd4851d473c894]*/
+{
+ _structmodulestate *state = get_struct_state_structinst(self);
+ assert(self->s_codes != NULL);
+
+ if (offset < 0) {
+ if (offset + self->s_size > 0) {
+ PyErr_Format(state->StructError,
+ "not enough data to unpack %zd bytes at offset %zd",
+ self->s_size,
+ offset);
+ return NULL;
+ }
+
+ if (offset + buffer->len < 0) {
+ PyErr_Format(state->StructError,
+ "offset %zd out of range for %zd-byte buffer",
+ offset,
+ buffer->len);
+ return NULL;
+ }
+ offset += buffer->len;
+ }
+
+ if ((buffer->len - offset) < self->s_size) {
+ PyErr_Format(state->StructError,
+ "unpack_from requires a buffer of at least %zu bytes for "
+ "unpacking %zd bytes at offset %zd "
+ "(actual buffer size is %zd)",
+ (size_t)self->s_size + (size_t)offset,
+ self->s_size,
+ offset,
+ buffer->len);
+ return NULL;
+ }
+ return s_unpack_internal(self, (char*)buffer->buf + offset, state);
+}
+
+
+
+/* Unpack iterator type */
+
+typedef struct {
+ PyObject_HEAD
+ PyStructObject *so;
+ Py_buffer buf;
+ Py_ssize_t index;
+} unpackiterobject;
+
+static void
+unpackiter_dealloc(unpackiterobject *self)
+{
+ /* bpo-31095: UnTrack is needed before calling any callbacks */
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ Py_XDECREF(self->so);
+ PyBuffer_Release(&self->buf);
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static int
+unpackiter_traverse(unpackiterobject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->so);
+ Py_VISIT(self->buf.obj);
+ return 0;
+}
+
+static PyObject *
+unpackiter_len(unpackiterobject *self, PyObject *Py_UNUSED(ignored))
+{
+ Py_ssize_t len;
+ if (self->so == NULL)
+ len = 0;
+ else
+ len = (self->buf.len - self->index) / self->so->s_size;
+ return PyLong_FromSsize_t(len);
+}
+
+static PyMethodDef unpackiter_methods[] = {
+ {"__length_hint__", (PyCFunction) unpackiter_len, METH_NOARGS, NULL},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+unpackiter_iternext(unpackiterobject *self)
+{
+ _structmodulestate *state = get_struct_state_iterinst(self);
+ PyObject *result;
+ if (self->so == NULL)
+ return NULL;
+ if (self->index >= self->buf.len) {
+ /* Iterator exhausted */
+ Py_CLEAR(self->so);
+ PyBuffer_Release(&self->buf);
+ return NULL;
+ }
+ assert(self->index + self->so->s_size <= self->buf.len);
+ result = s_unpack_internal(self->so,
+ (char*) self->buf.buf + self->index,
+ state);
+ self->index += self->so->s_size;
+ return result;
+}
+
+static PyType_Slot unpackiter_type_slots[] = {
+ {Py_tp_dealloc, unpackiter_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, unpackiter_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, unpackiter_iternext},
+ {Py_tp_methods, unpackiter_methods},
+ {0, 0},
+};
+
+static PyType_Spec unpackiter_type_spec = {
+ "_struct.unpack_iterator",
+ sizeof(unpackiterobject),
+ 0,
+ (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ unpackiter_type_slots
+};
+
+/*[clinic input]
+Struct.iter_unpack
+
+ buffer: object
+ /
+
+Return an iterator yielding tuples.
+
+Tuples are unpacked from the given bytes source, like a repeated
+invocation of unpack_from().
+
+Requires that the bytes length be a multiple of the struct size.
+[clinic start generated code]*/
+
+static PyObject *
+Struct_iter_unpack(PyStructObject *self, PyObject *buffer)
+/*[clinic end generated code: output=172d83d0cd15dbab input=6d65b3f3107dbc99]*/
+{
+ _structmodulestate *state = get_struct_state_structinst(self);
+ unpackiterobject *iter;
+
+ assert(self->s_codes != NULL);
+
+ if (self->s_size == 0) {
+ PyErr_Format(state->StructError,
+ "cannot iteratively unpack with a struct of length 0");
+ return NULL;
+ }
+
+ iter = (unpackiterobject *) PyType_GenericAlloc((PyTypeObject *)state->unpackiter_type, 0);
+ if (iter == NULL)
+ return NULL;
+
+ if (PyObject_GetBuffer(buffer, &iter->buf, PyBUF_SIMPLE) < 0) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ if (iter->buf.len % self->s_size != 0) {
+ PyErr_Format(state->StructError,
+ "iterative unpacking requires a buffer of "
+ "a multiple of %zd bytes",
+ self->s_size);
+ Py_DECREF(iter);
+ return NULL;
+ }
+ iter->so = (PyStructObject*)Py_NewRef(self);
+ iter->index = 0;
+ return (PyObject *)iter;
+}
+
+
+/*
+ * Guts of the pack function.
+ *
+ * Takes a struct object, a tuple of arguments, and offset in that tuple of
+ * argument for where to start processing the arguments for packing, and a
+ * character buffer for writing the packed string. The caller must insure
+ * that the buffer may contain the required length for packing the arguments.
+ * 0 is returned on success, 1 is returned if there is an error.
+ *
+ */
+static int
+s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset,
+ char* buf, _structmodulestate *state)
+{
+ formatcode *code;
+ /* XXX(nnorwitz): why does i need to be a local? can we use
+ the offset parameter or do we need the wider width? */
+ Py_ssize_t i;
+
+ memset(buf, '\0', soself->s_size);
+ i = offset;
+ for (code = soself->s_codes; code->fmtdef != NULL; code++) {
+ const formatdef *e = code->fmtdef;
+ char *res = buf + code->offset;
+ Py_ssize_t j = code->repeat;
+ while (j--) {
+ PyObject *v = args[i++];
+ if (e->format == 's') {
+ Py_ssize_t n;
+ int isstring;
+ const void *p;
+ isstring = PyBytes_Check(v);
+ if (!isstring && !PyByteArray_Check(v)) {
+ PyErr_SetString(state->StructError,
+ "argument for 's' must be a bytes object");
+ return -1;
+ }
+ if (isstring) {
+ n = PyBytes_GET_SIZE(v);
+ p = PyBytes_AS_STRING(v);
+ }
+ else {
+ n = PyByteArray_GET_SIZE(v);
+ p = PyByteArray_AS_STRING(v);
+ }
+ if (n > code->size)
+ n = code->size;
+ if (n > 0)
+ memcpy(res, p, n);
+ } else if (e->format == 'p') {
+ Py_ssize_t n;
+ int isstring;
+ const void *p;
+ isstring = PyBytes_Check(v);
+ if (!isstring && !PyByteArray_Check(v)) {
+ PyErr_SetString(state->StructError,
+ "argument for 'p' must be a bytes object");
+ return -1;
+ }
+ if (isstring) {
+ n = PyBytes_GET_SIZE(v);
+ p = PyBytes_AS_STRING(v);
+ }
+ else {
+ n = PyByteArray_GET_SIZE(v);
+ p = PyByteArray_AS_STRING(v);
+ }
+ if (n > (code->size - 1))
+ n = code->size - 1;
+ if (n > 0)
+ memcpy(res + 1, p, n);
+ if (n > 255)
+ n = 255;
+ *res = Py_SAFE_DOWNCAST(n, Py_ssize_t, unsigned char);
+ } else {
+ if (e->pack(state, res, v, e) < 0) {
+ if (PyLong_Check(v) && PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_SetString(state->StructError,
+ "int too large to convert");
+ return -1;
+ }
+ }
+ res += code->size;
+ }
+ }
+
+ /* Success */
+ return 0;
+}
+
+
+PyDoc_STRVAR(s_pack__doc__,
+"S.pack(v1, v2, ...) -> bytes\n\
+\n\
+Return a bytes object containing values v1, v2, ... packed according\n\
+to the format string S.format. See help(struct) for more on format\n\
+strings.");
+
+static PyObject *
+s_pack(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ char *buf;
+ PyStructObject *soself;
+ _structmodulestate *state = get_struct_state_structinst(self);
+
+ /* Validate arguments. */
+ soself = (PyStructObject *)self;
+ assert(PyStruct_Check(self, state));
+ assert(soself->s_codes != NULL);
+ if (nargs != soself->s_len)
+ {
+ PyErr_Format(state->StructError,
+ "pack expected %zd items for packing (got %zd)", soself->s_len, nargs);
+ return NULL;
+ }
+
+ /* Allocate a new string */
+ _PyBytesWriter writer;
+ _PyBytesWriter_Init(&writer);
+ buf = _PyBytesWriter_Alloc(&writer, soself->s_size);
+ if (buf == NULL) {
+ _PyBytesWriter_Dealloc(&writer);
+ return NULL;
+ }
+
+ /* Call the guts */
+ if ( s_pack_internal(soself, args, 0, buf, state) != 0 ) {
+ _PyBytesWriter_Dealloc(&writer);
+ return NULL;
+ }
+
+ return _PyBytesWriter_Finish(&writer, buf + soself->s_size);
+}
+
+PyDoc_STRVAR(s_pack_into__doc__,
+"S.pack_into(buffer, offset, v1, v2, ...)\n\
+\n\
+Pack the values v1, v2, ... according to the format string S.format\n\
+and write the packed bytes into the writable buffer buf starting at\n\
+offset. Note that the offset is a required argument. See\n\
+help(struct) for more on format strings.");
+
+static PyObject *
+s_pack_into(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyStructObject *soself;
+ Py_buffer buffer;
+ Py_ssize_t offset;
+ _structmodulestate *state = get_struct_state_structinst(self);
+
+ /* Validate arguments. +1 is for the first arg as buffer. */
+ soself = (PyStructObject *)self;
+ assert(PyStruct_Check(self, state));
+ assert(soself->s_codes != NULL);
+ if (nargs != (soself->s_len + 2))
+ {
+ if (nargs == 0) {
+ PyErr_Format(state->StructError,
+ "pack_into expected buffer argument");
+ }
+ else if (nargs == 1) {
+ PyErr_Format(state->StructError,
+ "pack_into expected offset argument");
+ }
+ else {
+ PyErr_Format(state->StructError,
+ "pack_into expected %zd items for packing (got %zd)",
+ soself->s_len, (nargs - 2));
+ }
+ return NULL;
+ }
+
+ /* Extract a writable memory buffer from the first argument */
+ if (!PyArg_Parse(args[0], "w*", &buffer))
+ return NULL;
+ assert(buffer.len >= 0);
+
+ /* Extract the offset from the first argument */
+ offset = PyNumber_AsSsize_t(args[1], PyExc_IndexError);
+ if (offset == -1 && PyErr_Occurred()) {
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ /* Support negative offsets. */
+ if (offset < 0) {
+ /* Check that negative offset is low enough to fit data */
+ if (offset + soself->s_size > 0) {
+ PyErr_Format(state->StructError,
+ "no space to pack %zd bytes at offset %zd",
+ soself->s_size,
+ offset);
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ /* Check that negative offset is not crossing buffer boundary */
+ if (offset + buffer.len < 0) {
+ PyErr_Format(state->StructError,
+ "offset %zd out of range for %zd-byte buffer",
+ offset,
+ buffer.len);
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ offset += buffer.len;
+ }
+
+ /* Check boundaries */
+ if ((buffer.len - offset) < soself->s_size) {
+ assert(offset >= 0);
+ assert(soself->s_size >= 0);
+
+ PyErr_Format(state->StructError,
+ "pack_into requires a buffer of at least %zu bytes for "
+ "packing %zd bytes at offset %zd "
+ "(actual buffer size is %zd)",
+ (size_t)soself->s_size + (size_t)offset,
+ soself->s_size,
+ offset,
+ buffer.len);
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ /* Call the guts */
+ if (s_pack_internal(soself, args, 2, (char*)buffer.buf + offset, state) != 0) {
+ PyBuffer_Release(&buffer);
+ return NULL;
+ }
+
+ PyBuffer_Release(&buffer);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+s_get_format(PyStructObject *self, void *unused)
+{
+ return PyUnicode_FromStringAndSize(PyBytes_AS_STRING(self->s_format),
+ PyBytes_GET_SIZE(self->s_format));
+}
+
+static PyObject *
+s_get_size(PyStructObject *self, void *unused)
+{
+ return PyLong_FromSsize_t(self->s_size);
+}
+
+PyDoc_STRVAR(s_sizeof__doc__,
+"S.__sizeof__() -> size of S in memory, in bytes");
+
+static PyObject *
+s_sizeof(PyStructObject *self, void *unused)
+{
+ size_t size = _PyObject_SIZE(Py_TYPE(self)) + sizeof(formatcode);
+ for (formatcode *code = self->s_codes; code->fmtdef != NULL; code++) {
+ size += sizeof(formatcode);
+ }
+ return PyLong_FromSize_t(size);
+}
+
+/* List of functions */
+
+static struct PyMethodDef s_methods[] = {
+ STRUCT_ITER_UNPACK_METHODDEF
+ {"pack", _PyCFunction_CAST(s_pack), METH_FASTCALL, s_pack__doc__},
+ {"pack_into", _PyCFunction_CAST(s_pack_into), METH_FASTCALL, s_pack_into__doc__},
+ STRUCT_UNPACK_METHODDEF
+ STRUCT_UNPACK_FROM_METHODDEF
+ {"__sizeof__", (PyCFunction)s_sizeof, METH_NOARGS, s_sizeof__doc__},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyMemberDef s_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(PyStructObject, weakreflist), READONLY},
+ {NULL} /* sentinel */
+};
+
+static PyGetSetDef s_getsetlist[] = {
+ {"format", (getter)s_get_format, (setter)NULL, "struct format string", NULL},
+ {"size", (getter)s_get_size, (setter)NULL, "struct size in bytes", NULL},
+ {NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(s__doc__,
+"Struct(fmt) --> compiled struct object\n"
+"\n"
+);
+
+static PyType_Slot PyStructType_slots[] = {
+ {Py_tp_dealloc, s_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_setattro, PyObject_GenericSetAttr},
+ {Py_tp_doc, (void*)s__doc__},
+ {Py_tp_traverse, s_traverse},
+ {Py_tp_clear, s_clear},
+ {Py_tp_methods, s_methods},
+ {Py_tp_members, s_members},
+ {Py_tp_getset, s_getsetlist},
+ {Py_tp_init, Struct___init__},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, s_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, 0},
+};
+
+static PyType_Spec PyStructType_spec = {
+ "_struct.Struct",
+ sizeof(PyStructObject),
+ 0,
+ (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_BASETYPE | Py_TPFLAGS_IMMUTABLETYPE),
+ PyStructType_slots
+};
+
+
+/* ---- Standalone functions ---- */
+
+#define MAXCACHE 100
+
+static int
+cache_struct_converter(PyObject *module, PyObject *fmt, PyStructObject **ptr)
+{
+ PyObject * s_object;
+ _structmodulestate *state = get_struct_state(module);
+
+ if (fmt == NULL) {
+ Py_SETREF(*ptr, NULL);
+ return 1;
+ }
+
+ if (state->cache == NULL) {
+ state->cache = PyDict_New();
+ if (state->cache == NULL)
+ return 0;
+ }
+
+ s_object = PyDict_GetItemWithError(state->cache, fmt);
+ if (s_object != NULL) {
+ *ptr = (PyStructObject *)Py_NewRef(s_object);
+ return Py_CLEANUP_SUPPORTED;
+ }
+ else if (PyErr_Occurred()) {
+ return 0;
+ }
+
+ s_object = PyObject_CallOneArg(state->PyStructType, fmt);
+ if (s_object != NULL) {
+ if (PyDict_GET_SIZE(state->cache) >= MAXCACHE)
+ PyDict_Clear(state->cache);
+ /* Attempt to cache the result */
+ if (PyDict_SetItem(state->cache, fmt, s_object) == -1)
+ PyErr_Clear();
+ *ptr = (PyStructObject *)s_object;
+ return Py_CLEANUP_SUPPORTED;
+ }
+ return 0;
+}
+
+/*[clinic input]
+_clearcache
+
+Clear the internal cache.
+[clinic start generated code]*/
+
+static PyObject *
+_clearcache_impl(PyObject *module)
+/*[clinic end generated code: output=ce4fb8a7bf7cb523 input=463eaae04bab3211]*/
+{
+ Py_CLEAR(get_struct_state(module)->cache);
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+calcsize -> Py_ssize_t
+
+ format as s_object: cache_struct
+ /
+
+Return size in bytes of the struct described by the format string.
+[clinic start generated code]*/
+
+static Py_ssize_t
+calcsize_impl(PyObject *module, PyStructObject *s_object)
+/*[clinic end generated code: output=db7d23d09c6932c4 input=96a6a590c7717ecd]*/
+{
+ return s_object->s_size;
+}
+
+PyDoc_STRVAR(pack_doc,
+"pack(format, v1, v2, ...) -> bytes\n\
+\n\
+Return a bytes object containing the values v1, v2, ... packed according\n\
+to the format string. See help(struct) for more on format strings.");
+
+static PyObject *
+pack(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *s_object = NULL;
+ PyObject *format, *result;
+
+ if (nargs == 0) {
+ PyErr_SetString(PyExc_TypeError, "missing format argument");
+ return NULL;
+ }
+ format = args[0];
+
+ if (!cache_struct_converter(module, format, (PyStructObject **)&s_object)) {
+ return NULL;
+ }
+ result = s_pack(s_object, args + 1, nargs - 1);
+ Py_DECREF(s_object);
+ return result;
+}
+
+PyDoc_STRVAR(pack_into_doc,
+"pack_into(format, buffer, offset, v1, v2, ...)\n\
+\n\
+Pack the values v1, v2, ... according to the format string and write\n\
+the packed bytes into the writable buffer buf starting at offset. Note\n\
+that the offset is a required argument. See help(struct) for more\n\
+on format strings.");
+
+static PyObject *
+pack_into(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *s_object = NULL;
+ PyObject *format, *result;
+
+ if (nargs == 0) {
+ PyErr_SetString(PyExc_TypeError, "missing format argument");
+ return NULL;
+ }
+ format = args[0];
+
+ if (!cache_struct_converter(module, format, (PyStructObject **)&s_object)) {
+ return NULL;
+ }
+ result = s_pack_into(s_object, args + 1, nargs - 1);
+ Py_DECREF(s_object);
+ return result;
+}
+
+/*[clinic input]
+unpack
+
+ format as s_object: cache_struct
+ buffer: Py_buffer
+ /
+
+Return a tuple containing values unpacked according to the format string.
+
+The buffer's size in bytes must be calcsize(format).
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
+static PyObject *
+unpack_impl(PyObject *module, PyStructObject *s_object, Py_buffer *buffer)
+/*[clinic end generated code: output=48ddd4d88eca8551 input=05fa3b91678da727]*/
+{
+ return Struct_unpack_impl(s_object, buffer);
+}
+
+/*[clinic input]
+unpack_from
+
+ format as s_object: cache_struct
+ /
+ buffer: Py_buffer
+ offset: Py_ssize_t = 0
+
+Return a tuple containing values unpacked according to the format string.
+
+The buffer's size, minus offset, must be at least calcsize(format).
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
+static PyObject *
+unpack_from_impl(PyObject *module, PyStructObject *s_object,
+ Py_buffer *buffer, Py_ssize_t offset)
+/*[clinic end generated code: output=1042631674c6e0d3 input=6e80a5398e985025]*/
+{
+ return Struct_unpack_from_impl(s_object, buffer, offset);
+}
+
+/*[clinic input]
+iter_unpack
+
+ format as s_object: cache_struct
+ buffer: object
+ /
+
+Return an iterator yielding tuples unpacked from the given bytes.
+
+The bytes are unpacked according to the format string, like
+a repeated invocation of unpack_from().
+
+Requires that the bytes length be a multiple of the format struct size.
+[clinic start generated code]*/
+
+static PyObject *
+iter_unpack_impl(PyObject *module, PyStructObject *s_object,
+ PyObject *buffer)
+/*[clinic end generated code: output=0ae50e250d20e74d input=b214a58869a3c98d]*/
+{
+ return Struct_iter_unpack(s_object, buffer);
+}
+
+static struct PyMethodDef module_functions[] = {
+ _CLEARCACHE_METHODDEF
+ CALCSIZE_METHODDEF
+ ITER_UNPACK_METHODDEF
+ {"pack", _PyCFunction_CAST(pack), METH_FASTCALL, pack_doc},
+ {"pack_into", _PyCFunction_CAST(pack_into), METH_FASTCALL, pack_into_doc},
+ UNPACK_METHODDEF
+ UNPACK_FROM_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* Module initialization */
+
+PyDoc_STRVAR(module_doc,
+"Functions to convert between Python values and C structs.\n\
+Python bytes objects are used to hold the data representing the C struct\n\
+and also as format strings (explained below) to describe the layout of data\n\
+in the C struct.\n\
+\n\
+The optional first format char indicates byte order, size and alignment:\n\
+ @: native order, size & alignment (default)\n\
+ =: native order, std. size & alignment\n\
+ <: little-endian, std. size & alignment\n\
+ >: big-endian, std. size & alignment\n\
+ !: same as >\n\
+\n\
+The remaining chars indicate types of args and must match exactly;\n\
+these can be preceded by a decimal repeat count:\n\
+ x: pad byte (no data); c:char; b:signed byte; B:unsigned byte;\n\
+ ?: _Bool (requires C99; if not available, char is used instead)\n\
+ h:short; H:unsigned short; i:int; I:unsigned int;\n\
+ l:long; L:unsigned long; f:float; d:double; e:half-float.\n\
+Special cases (preceding decimal count indicates length):\n\
+ s:string (array of char); p: pascal string (with count byte).\n\
+Special cases (only available in native format):\n\
+ n:ssize_t; N:size_t;\n\
+ P:an integer type that is wide enough to hold a pointer.\n\
+Special case (not in native mode unless 'long long' in platform C):\n\
+ q:long long; Q:unsigned long long\n\
+Whitespace between formats is ignored.\n\
+\n\
+The variable struct.error is an exception raised on errors.\n");
+
+
+static int
+_structmodule_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _structmodulestate *state = get_struct_state(module);
+ if (state) {
+ Py_VISIT(state->cache);
+ Py_VISIT(state->PyStructType);
+ Py_VISIT(state->unpackiter_type);
+ Py_VISIT(state->StructError);
+ }
+ return 0;
+}
+
+static int
+_structmodule_clear(PyObject *module)
+{
+ _structmodulestate *state = get_struct_state(module);
+ if (state) {
+ Py_CLEAR(state->cache);
+ Py_CLEAR(state->PyStructType);
+ Py_CLEAR(state->unpackiter_type);
+ Py_CLEAR(state->StructError);
+ }
+ return 0;
+}
+
+static void
+_structmodule_free(void *module)
+{
+ _structmodule_clear((PyObject *)module);
+}
+
+static int
+_structmodule_exec(PyObject *m)
+{
+ _structmodulestate *state = get_struct_state(m);
+
+ state->PyStructType = PyType_FromModuleAndSpec(
+ m, &PyStructType_spec, NULL);
+ if (state->PyStructType == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(m, (PyTypeObject *)state->PyStructType) < 0) {
+ return -1;
+ }
+
+ state->unpackiter_type = PyType_FromModuleAndSpec(
+ m, &unpackiter_type_spec, NULL);
+ if (state->unpackiter_type == NULL) {
+ return -1;
+ }
+
+ /* Check endian and swap in faster functions */
+ {
+ const formatdef *native = native_table;
+ formatdef *other, *ptr;
+#if PY_LITTLE_ENDIAN
+ other = lilendian_table;
+#else
+ other = bigendian_table;
+#endif
+ /* Scan through the native table, find a matching
+ entry in the endian table and swap in the
+ native implementations whenever possible
+ (64-bit platforms may not have "standard" sizes) */
+ while (native->format != '\0' && other->format != '\0') {
+ ptr = other;
+ while (ptr->format != '\0') {
+ if (ptr->format == native->format) {
+ /* Match faster when formats are
+ listed in the same order */
+ if (ptr == other)
+ other++;
+ /* Only use the trick if the
+ size matches */
+ if (ptr->size != native->size)
+ break;
+ /* Skip float and double, could be
+ "unknown" float format */
+ if (ptr->format == 'd' || ptr->format == 'f')
+ break;
+ /* Skip _Bool, semantics are different for standard size */
+ if (ptr->format == '?')
+ break;
+ ptr->pack = native->pack;
+ ptr->unpack = native->unpack;
+ break;
+ }
+ ptr++;
+ }
+ native++;
+ }
+ }
+
+ /* Add some symbolic constants to the module */
+ state->StructError = PyErr_NewException("struct.error", NULL, NULL);
+ if (state->StructError == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(m, "error", state->StructError) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot _structmodule_slots[] = {
+ {Py_mod_exec, _structmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _structmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_struct",
+ .m_doc = module_doc,
+ .m_size = sizeof(_structmodulestate),
+ .m_methods = module_functions,
+ .m_slots = _structmodule_slots,
+ .m_traverse = _structmodule_traverse,
+ .m_clear = _structmodule_clear,
+ .m_free = _structmodule_free,
+};
+
+PyMODINIT_FUNC
+PyInit__struct(void)
+{
+ return PyModuleDef_Init(&_structmodule);
+}
diff --git a/contrib/tools/python3/Modules/_threadmodule.c b/contrib/tools/python3/Modules/_threadmodule.c
new file mode 100644
index 00000000000..568fe8375d1
--- /dev/null
+++ b/contrib/tools/python3/Modules/_threadmodule.c
@@ -0,0 +1,1788 @@
+
+/* Thread module */
+/* Interface to Sjoerd's portable C thread library */
+
+#include "Python.h"
+#include "pycore_interp.h" // _PyInterpreterState.threads.count
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_pylifecycle.h"
+#include "pycore_pystate.h" // _PyThreadState_SetCurrent()
+#include <stddef.h> // offsetof()
+#include "structmember.h" // PyMemberDef
+
+#ifdef HAVE_SIGNAL_H
+# include <signal.h> // SIGINT
+#endif
+
+// ThreadError is just an alias to PyExc_RuntimeError
+#define ThreadError PyExc_RuntimeError
+
+
+// Forward declarations
+static struct PyModuleDef thread_module;
+
+
+typedef struct {
+ PyTypeObject *excepthook_type;
+ PyTypeObject *lock_type;
+ PyTypeObject *local_type;
+ PyTypeObject *local_dummy_type;
+} thread_module_state;
+
+static inline thread_module_state*
+get_thread_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (thread_module_state *)state;
+}
+
+
+/* Lock objects */
+
+typedef struct {
+ PyObject_HEAD
+ PyThread_type_lock lock_lock;
+ PyObject *in_weakreflist;
+ char locked; /* for sanity checking */
+} lockobject;
+
+static int
+lock_traverse(lockobject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+lock_dealloc(lockobject *self)
+{
+ PyObject_GC_UnTrack(self);
+ if (self->in_weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject *) self);
+ }
+ if (self->lock_lock != NULL) {
+ /* Unlock the lock so it's safe to free it */
+ if (self->locked)
+ PyThread_release_lock(self->lock_lock);
+ PyThread_free_lock(self->lock_lock);
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject*)self);
+ Py_DECREF(tp);
+}
+
+/* Helper to acquire an interruptible lock with a timeout. If the lock acquire
+ * is interrupted, signal handlers are run, and if they raise an exception,
+ * PY_LOCK_INTR is returned. Otherwise, PY_LOCK_ACQUIRED or PY_LOCK_FAILURE
+ * are returned, depending on whether the lock can be acquired within the
+ * timeout.
+ */
+static PyLockStatus
+acquire_timed(PyThread_type_lock lock, _PyTime_t timeout)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ _PyTime_t endtime = 0;
+ if (timeout > 0) {
+ endtime = _PyDeadline_Init(timeout);
+ }
+
+ PyLockStatus r;
+ do {
+ _PyTime_t microseconds;
+ microseconds = _PyTime_AsMicroseconds(timeout, _PyTime_ROUND_CEILING);
+
+ /* first a simple non-blocking try without releasing the GIL */
+ r = PyThread_acquire_lock_timed(lock, 0, 0);
+ if (r == PY_LOCK_FAILURE && microseconds != 0) {
+ Py_BEGIN_ALLOW_THREADS
+ r = PyThread_acquire_lock_timed(lock, microseconds, 1);
+ Py_END_ALLOW_THREADS
+ }
+
+ if (r == PY_LOCK_INTR) {
+ /* Run signal handlers if we were interrupted. Propagate
+ * exceptions from signal handlers, such as KeyboardInterrupt, by
+ * passing up PY_LOCK_INTR. */
+ if (_PyEval_MakePendingCalls(tstate) < 0) {
+ return PY_LOCK_INTR;
+ }
+
+ /* If we're using a timeout, recompute the timeout after processing
+ * signals, since those can take time. */
+ if (timeout > 0) {
+ timeout = _PyDeadline_Get(endtime);
+
+ /* Check for negative values, since those mean block forever.
+ */
+ if (timeout < 0) {
+ r = PY_LOCK_FAILURE;
+ }
+ }
+ }
+ } while (r == PY_LOCK_INTR); /* Retry if we were interrupted. */
+
+ return r;
+}
+
+static int
+lock_acquire_parse_args(PyObject *args, PyObject *kwds,
+ _PyTime_t *timeout)
+{
+ char *kwlist[] = {"blocking", "timeout", NULL};
+ int blocking = 1;
+ PyObject *timeout_obj = NULL;
+ const _PyTime_t unset_timeout = _PyTime_FromSeconds(-1);
+
+ *timeout = unset_timeout ;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|pO:acquire", kwlist,
+ &blocking, &timeout_obj))
+ return -1;
+
+ if (timeout_obj
+ && _PyTime_FromSecondsObject(timeout,
+ timeout_obj, _PyTime_ROUND_TIMEOUT) < 0)
+ return -1;
+
+ if (!blocking && *timeout != unset_timeout ) {
+ PyErr_SetString(PyExc_ValueError,
+ "can't specify a timeout for a non-blocking call");
+ return -1;
+ }
+ if (*timeout < 0 && *timeout != unset_timeout) {
+ PyErr_SetString(PyExc_ValueError,
+ "timeout value must be positive");
+ return -1;
+ }
+ if (!blocking)
+ *timeout = 0;
+ else if (*timeout != unset_timeout) {
+ _PyTime_t microseconds;
+
+ microseconds = _PyTime_AsMicroseconds(*timeout, _PyTime_ROUND_TIMEOUT);
+ if (microseconds > PY_TIMEOUT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout value is too large");
+ return -1;
+ }
+ }
+ return 0;
+}
+
+static PyObject *
+lock_PyThread_acquire_lock(lockobject *self, PyObject *args, PyObject *kwds)
+{
+ _PyTime_t timeout;
+ if (lock_acquire_parse_args(args, kwds, &timeout) < 0)
+ return NULL;
+
+ PyLockStatus r = acquire_timed(self->lock_lock, timeout);
+ if (r == PY_LOCK_INTR) {
+ return NULL;
+ }
+
+ if (r == PY_LOCK_ACQUIRED)
+ self->locked = 1;
+ return PyBool_FromLong(r == PY_LOCK_ACQUIRED);
+}
+
+PyDoc_STRVAR(acquire_doc,
+"acquire(blocking=True, timeout=-1) -> bool\n\
+(acquire_lock() is an obsolete synonym)\n\
+\n\
+Lock the lock. Without argument, this blocks if the lock is already\n\
+locked (even by the same thread), waiting for another thread to release\n\
+the lock, and return True once the lock is acquired.\n\
+With an argument, this will only block if the argument is true,\n\
+and the return value reflects whether the lock is acquired.\n\
+The blocking operation is interruptible.");
+
+static PyObject *
+lock_PyThread_release_lock(lockobject *self, PyObject *Py_UNUSED(ignored))
+{
+ /* Sanity check: the lock must be locked */
+ if (!self->locked) {
+ PyErr_SetString(ThreadError, "release unlocked lock");
+ return NULL;
+ }
+
+ PyThread_release_lock(self->lock_lock);
+ self->locked = 0;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(release_doc,
+"release()\n\
+(release_lock() is an obsolete synonym)\n\
+\n\
+Release the lock, allowing another thread that is blocked waiting for\n\
+the lock to acquire the lock. The lock must be in the locked state,\n\
+but it needn't be locked by the same thread that unlocks it.");
+
+static PyObject *
+lock_locked_lock(lockobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return PyBool_FromLong((long)self->locked);
+}
+
+PyDoc_STRVAR(locked_doc,
+"locked() -> bool\n\
+(locked_lock() is an obsolete synonym)\n\
+\n\
+Return whether the lock is in the locked state.");
+
+static PyObject *
+lock_repr(lockobject *self)
+{
+ return PyUnicode_FromFormat("<%s %s object at %p>",
+ self->locked ? "locked" : "unlocked", Py_TYPE(self)->tp_name, self);
+}
+
+#ifdef HAVE_FORK
+static PyObject *
+lock__at_fork_reinit(lockobject *self, PyObject *Py_UNUSED(args))
+{
+ if (_PyThread_at_fork_reinit(&self->lock_lock) < 0) {
+ PyErr_SetString(ThreadError, "failed to reinitialize lock at fork");
+ return NULL;
+ }
+
+ self->locked = 0;
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_FORK */
+
+
+static PyMethodDef lock_methods[] = {
+ {"acquire_lock", _PyCFunction_CAST(lock_PyThread_acquire_lock),
+ METH_VARARGS | METH_KEYWORDS, acquire_doc},
+ {"acquire", _PyCFunction_CAST(lock_PyThread_acquire_lock),
+ METH_VARARGS | METH_KEYWORDS, acquire_doc},
+ {"release_lock", (PyCFunction)lock_PyThread_release_lock,
+ METH_NOARGS, release_doc},
+ {"release", (PyCFunction)lock_PyThread_release_lock,
+ METH_NOARGS, release_doc},
+ {"locked_lock", (PyCFunction)lock_locked_lock,
+ METH_NOARGS, locked_doc},
+ {"locked", (PyCFunction)lock_locked_lock,
+ METH_NOARGS, locked_doc},
+ {"__enter__", _PyCFunction_CAST(lock_PyThread_acquire_lock),
+ METH_VARARGS | METH_KEYWORDS, acquire_doc},
+ {"__exit__", (PyCFunction)lock_PyThread_release_lock,
+ METH_VARARGS, release_doc},
+#ifdef HAVE_FORK
+ {"_at_fork_reinit", (PyCFunction)lock__at_fork_reinit,
+ METH_NOARGS, NULL},
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(lock_doc,
+"A lock object is a synchronization primitive. To create a lock,\n\
+call threading.Lock(). Methods are:\n\
+\n\
+acquire() -- lock the lock, possibly blocking until it can be obtained\n\
+release() -- unlock of the lock\n\
+locked() -- test whether the lock is currently locked\n\
+\n\
+A lock is not owned by the thread that locked it; another thread may\n\
+unlock it. A thread attempting to lock a lock that it has already locked\n\
+will block until another thread unlocks it. Deadlocks may ensue.");
+
+static PyMemberDef lock_type_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(lockobject, in_weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot lock_type_slots[] = {
+ {Py_tp_dealloc, (destructor)lock_dealloc},
+ {Py_tp_repr, (reprfunc)lock_repr},
+ {Py_tp_doc, (void *)lock_doc},
+ {Py_tp_methods, lock_methods},
+ {Py_tp_traverse, lock_traverse},
+ {Py_tp_members, lock_type_members},
+ {0, 0}
+};
+
+static PyType_Spec lock_type_spec = {
+ .name = "_thread.lock",
+ .basicsize = sizeof(lockobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = lock_type_slots,
+};
+
+/* Recursive lock objects */
+
+typedef struct {
+ PyObject_HEAD
+ PyThread_type_lock rlock_lock;
+ unsigned long rlock_owner;
+ unsigned long rlock_count;
+ PyObject *in_weakreflist;
+} rlockobject;
+
+static int
+rlock_traverse(rlockobject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+
+static void
+rlock_dealloc(rlockobject *self)
+{
+ PyObject_GC_UnTrack(self);
+ if (self->in_weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ /* self->rlock_lock can be NULL if PyThread_allocate_lock() failed
+ in rlock_new() */
+ if (self->rlock_lock != NULL) {
+ /* Unlock the lock so it's safe to free it */
+ if (self->rlock_count > 0)
+ PyThread_release_lock(self->rlock_lock);
+
+ PyThread_free_lock(self->rlock_lock);
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+rlock_acquire(rlockobject *self, PyObject *args, PyObject *kwds)
+{
+ _PyTime_t timeout;
+ unsigned long tid;
+ PyLockStatus r = PY_LOCK_ACQUIRED;
+
+ if (lock_acquire_parse_args(args, kwds, &timeout) < 0)
+ return NULL;
+
+ tid = PyThread_get_thread_ident();
+ if (self->rlock_count > 0 && tid == self->rlock_owner) {
+ unsigned long count = self->rlock_count + 1;
+ if (count <= self->rlock_count) {
+ PyErr_SetString(PyExc_OverflowError,
+ "Internal lock count overflowed");
+ return NULL;
+ }
+ self->rlock_count = count;
+ Py_RETURN_TRUE;
+ }
+ r = acquire_timed(self->rlock_lock, timeout);
+ if (r == PY_LOCK_ACQUIRED) {
+ assert(self->rlock_count == 0);
+ self->rlock_owner = tid;
+ self->rlock_count = 1;
+ }
+ else if (r == PY_LOCK_INTR) {
+ return NULL;
+ }
+
+ return PyBool_FromLong(r == PY_LOCK_ACQUIRED);
+}
+
+PyDoc_STRVAR(rlock_acquire_doc,
+"acquire(blocking=True) -> bool\n\
+\n\
+Lock the lock. `blocking` indicates whether we should wait\n\
+for the lock to be available or not. If `blocking` is False\n\
+and another thread holds the lock, the method will return False\n\
+immediately. If `blocking` is True and another thread holds\n\
+the lock, the method will wait for the lock to be released,\n\
+take it and then return True.\n\
+(note: the blocking operation is interruptible.)\n\
+\n\
+In all other cases, the method will return True immediately.\n\
+Precisely, if the current thread already holds the lock, its\n\
+internal counter is simply incremented. If nobody holds the lock,\n\
+the lock is taken and its internal counter initialized to 1.");
+
+static PyObject *
+rlock_release(rlockobject *self, PyObject *Py_UNUSED(ignored))
+{
+ unsigned long tid = PyThread_get_thread_ident();
+
+ if (self->rlock_count == 0 || self->rlock_owner != tid) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot release un-acquired lock");
+ return NULL;
+ }
+ if (--self->rlock_count == 0) {
+ self->rlock_owner = 0;
+ PyThread_release_lock(self->rlock_lock);
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(rlock_release_doc,
+"release()\n\
+\n\
+Release the lock, allowing another thread that is blocked waiting for\n\
+the lock to acquire the lock. The lock must be in the locked state,\n\
+and must be locked by the same thread that unlocks it; otherwise a\n\
+`RuntimeError` is raised.\n\
+\n\
+Do note that if the lock was acquire()d several times in a row by the\n\
+current thread, release() needs to be called as many times for the lock\n\
+to be available for other threads.");
+
+static PyObject *
+rlock_acquire_restore(rlockobject *self, PyObject *args)
+{
+ unsigned long owner;
+ unsigned long count;
+ int r = 1;
+
+ if (!PyArg_ParseTuple(args, "(kk):_acquire_restore", &count, &owner))
+ return NULL;
+
+ if (!PyThread_acquire_lock(self->rlock_lock, 0)) {
+ Py_BEGIN_ALLOW_THREADS
+ r = PyThread_acquire_lock(self->rlock_lock, 1);
+ Py_END_ALLOW_THREADS
+ }
+ if (!r) {
+ PyErr_SetString(ThreadError, "couldn't acquire lock");
+ return NULL;
+ }
+ assert(self->rlock_count == 0);
+ self->rlock_owner = owner;
+ self->rlock_count = count;
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(rlock_acquire_restore_doc,
+"_acquire_restore(state) -> None\n\
+\n\
+For internal use by `threading.Condition`.");
+
+static PyObject *
+rlock_release_save(rlockobject *self, PyObject *Py_UNUSED(ignored))
+{
+ unsigned long owner;
+ unsigned long count;
+
+ if (self->rlock_count == 0) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot release un-acquired lock");
+ return NULL;
+ }
+
+ owner = self->rlock_owner;
+ count = self->rlock_count;
+ self->rlock_count = 0;
+ self->rlock_owner = 0;
+ PyThread_release_lock(self->rlock_lock);
+ return Py_BuildValue("kk", count, owner);
+}
+
+PyDoc_STRVAR(rlock_release_save_doc,
+"_release_save() -> tuple\n\
+\n\
+For internal use by `threading.Condition`.");
+
+static PyObject *
+rlock_recursion_count(rlockobject *self, PyObject *Py_UNUSED(ignored))
+{
+ unsigned long tid = PyThread_get_thread_ident();
+ return PyLong_FromUnsignedLong(
+ self->rlock_owner == tid ? self->rlock_count : 0UL);
+}
+
+PyDoc_STRVAR(rlock_recursion_count_doc,
+"_recursion_count() -> int\n\
+\n\
+For internal use by reentrancy checks.");
+
+static PyObject *
+rlock_is_owned(rlockobject *self, PyObject *Py_UNUSED(ignored))
+{
+ unsigned long tid = PyThread_get_thread_ident();
+
+ if (self->rlock_count > 0 && self->rlock_owner == tid) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+PyDoc_STRVAR(rlock_is_owned_doc,
+"_is_owned() -> bool\n\
+\n\
+For internal use by `threading.Condition`.");
+
+static PyObject *
+rlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ rlockobject *self = (rlockobject *) type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+ self->in_weakreflist = NULL;
+ self->rlock_owner = 0;
+ self->rlock_count = 0;
+
+ self->rlock_lock = PyThread_allocate_lock();
+ if (self->rlock_lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(ThreadError, "can't allocate lock");
+ return NULL;
+ }
+ return (PyObject *) self;
+}
+
+static PyObject *
+rlock_repr(rlockobject *self)
+{
+ return PyUnicode_FromFormat("<%s %s object owner=%ld count=%lu at %p>",
+ self->rlock_count ? "locked" : "unlocked",
+ Py_TYPE(self)->tp_name, self->rlock_owner,
+ self->rlock_count, self);
+}
+
+
+#ifdef HAVE_FORK
+static PyObject *
+rlock__at_fork_reinit(rlockobject *self, PyObject *Py_UNUSED(args))
+{
+ if (_PyThread_at_fork_reinit(&self->rlock_lock) < 0) {
+ PyErr_SetString(ThreadError, "failed to reinitialize lock at fork");
+ return NULL;
+ }
+
+ self->rlock_owner = 0;
+ self->rlock_count = 0;
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_FORK */
+
+
+static PyMethodDef rlock_methods[] = {
+ {"acquire", _PyCFunction_CAST(rlock_acquire),
+ METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc},
+ {"release", (PyCFunction)rlock_release,
+ METH_NOARGS, rlock_release_doc},
+ {"_is_owned", (PyCFunction)rlock_is_owned,
+ METH_NOARGS, rlock_is_owned_doc},
+ {"_acquire_restore", (PyCFunction)rlock_acquire_restore,
+ METH_VARARGS, rlock_acquire_restore_doc},
+ {"_release_save", (PyCFunction)rlock_release_save,
+ METH_NOARGS, rlock_release_save_doc},
+ {"_recursion_count", (PyCFunction)rlock_recursion_count,
+ METH_NOARGS, rlock_recursion_count_doc},
+ {"__enter__", _PyCFunction_CAST(rlock_acquire),
+ METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc},
+ {"__exit__", (PyCFunction)rlock_release,
+ METH_VARARGS, rlock_release_doc},
+#ifdef HAVE_FORK
+ {"_at_fork_reinit", (PyCFunction)rlock__at_fork_reinit,
+ METH_NOARGS, NULL},
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+
+static PyMemberDef rlock_type_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(rlockobject, in_weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot rlock_type_slots[] = {
+ {Py_tp_dealloc, (destructor)rlock_dealloc},
+ {Py_tp_repr, (reprfunc)rlock_repr},
+ {Py_tp_methods, rlock_methods},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, rlock_new},
+ {Py_tp_members, rlock_type_members},
+ {Py_tp_traverse, rlock_traverse},
+ {0, 0},
+};
+
+static PyType_Spec rlock_type_spec = {
+ .name = "_thread.RLock",
+ .basicsize = sizeof(rlockobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = rlock_type_slots,
+};
+
+static lockobject *
+newlockobject(PyObject *module)
+{
+ thread_module_state *state = get_thread_state(module);
+
+ PyTypeObject *type = state->lock_type;
+ lockobject *self = (lockobject *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->lock_lock = PyThread_allocate_lock();
+ self->locked = 0;
+ self->in_weakreflist = NULL;
+
+ if (self->lock_lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(ThreadError, "can't allocate lock");
+ return NULL;
+ }
+ return self;
+}
+
+/* Thread-local objects */
+
+/* Quick overview:
+
+ We need to be able to reclaim reference cycles as soon as possible
+ (both when a thread is being terminated, or a thread-local object
+ becomes unreachable from user data). Constraints:
+ - it must not be possible for thread-state dicts to be involved in
+ reference cycles (otherwise the cyclic GC will refuse to consider
+ objects referenced from a reachable thread-state dict, even though
+ local_dealloc would clear them)
+ - the death of a thread-state dict must still imply destruction of the
+ corresponding local dicts in all thread-local objects.
+
+ Our implementation uses small "localdummy" objects in order to break
+ the reference chain. These trivial objects are hashable (using the
+ default scheme of identity hashing) and weakrefable.
+ Each thread-state holds a separate localdummy for each local object
+ (as a /strong reference/),
+ and each thread-local object holds a dict mapping /weak references/
+ of localdummies to local dicts.
+
+ Therefore:
+ - only the thread-state dict holds a strong reference to the dummies
+ - only the thread-local object holds a strong reference to the local dicts
+ - only outside objects (application- or library-level) hold strong
+ references to the thread-local objects
+ - as soon as a thread-state dict is destroyed, the weakref callbacks of all
+ dummies attached to that thread are called, and destroy the corresponding
+ local dicts from thread-local objects
+ - as soon as a thread-local object is destroyed, its local dicts are
+ destroyed and its dummies are manually removed from all thread states
+ - the GC can do its work correctly when a thread-local object is dangling,
+ without any interference from the thread-state dicts
+
+ As an additional optimization, each localdummy holds a borrowed reference
+ to the corresponding localdict. This borrowed reference is only used
+ by the thread-local object which has created the localdummy, which should
+ guarantee that the localdict still exists when accessed.
+*/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *localdict; /* Borrowed reference! */
+ PyObject *weakreflist; /* List of weak references to self */
+} localdummyobject;
+
+static void
+localdummy_dealloc(localdummyobject *self)
+{
+ if (self->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) self);
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject*)self);
+ Py_DECREF(tp);
+}
+
+static PyMemberDef local_dummy_type_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(localdummyobject, weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot local_dummy_type_slots[] = {
+ {Py_tp_dealloc, (destructor)localdummy_dealloc},
+ {Py_tp_doc, "Thread-local dummy"},
+ {Py_tp_members, local_dummy_type_members},
+ {0, 0}
+};
+
+static PyType_Spec local_dummy_type_spec = {
+ .name = "_thread._localdummy",
+ .basicsize = sizeof(localdummyobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = local_dummy_type_slots,
+};
+
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *key;
+ PyObject *args;
+ PyObject *kw;
+ PyObject *weakreflist; /* List of weak references to self */
+ /* A {localdummy weakref -> localdict} dict */
+ PyObject *dummies;
+ /* The callback for weakrefs to localdummies */
+ PyObject *wr_callback;
+} localobject;
+
+/* Forward declaration */
+static PyObject *_ldict(localobject *self, thread_module_state *state);
+static PyObject *_localdummy_destroyed(PyObject *meth_self, PyObject *dummyweakref);
+
+/* Create and register the dummy for the current thread.
+ Returns a borrowed reference of the corresponding local dict */
+static PyObject *
+_local_create_dummy(localobject *self, thread_module_state *state)
+{
+ PyObject *ldict = NULL, *wr = NULL;
+ localdummyobject *dummy = NULL;
+ PyTypeObject *type = state->local_dummy_type;
+
+ PyObject *tdict = PyThreadState_GetDict();
+ if (tdict == NULL) {
+ PyErr_SetString(PyExc_SystemError,
+ "Couldn't get thread-state dictionary");
+ goto err;
+ }
+
+ ldict = PyDict_New();
+ if (ldict == NULL) {
+ goto err;
+ }
+ dummy = (localdummyobject *) type->tp_alloc(type, 0);
+ if (dummy == NULL) {
+ goto err;
+ }
+ dummy->localdict = ldict;
+ wr = PyWeakref_NewRef((PyObject *) dummy, self->wr_callback);
+ if (wr == NULL) {
+ goto err;
+ }
+
+ /* As a side-effect, this will cache the weakref's hash before the
+ dummy gets deleted */
+ int r = PyDict_SetItem(self->dummies, wr, ldict);
+ if (r < 0) {
+ goto err;
+ }
+ Py_CLEAR(wr);
+ r = PyDict_SetItem(tdict, self->key, (PyObject *) dummy);
+ if (r < 0) {
+ goto err;
+ }
+ Py_CLEAR(dummy);
+
+ Py_DECREF(ldict);
+ return ldict;
+
+err:
+ Py_XDECREF(ldict);
+ Py_XDECREF(wr);
+ Py_XDECREF(dummy);
+ return NULL;
+}
+
+static PyObject *
+local_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ static PyMethodDef wr_callback_def = {
+ "_localdummy_destroyed", (PyCFunction) _localdummy_destroyed, METH_O
+ };
+
+ if (type->tp_init == PyBaseObject_Type.tp_init) {
+ int rc = 0;
+ if (args != NULL)
+ rc = PyObject_IsTrue(args);
+ if (rc == 0 && kw != NULL)
+ rc = PyObject_IsTrue(kw);
+ if (rc != 0) {
+ if (rc > 0) {
+ PyErr_SetString(PyExc_TypeError,
+ "Initialization arguments are not supported");
+ }
+ return NULL;
+ }
+ }
+
+ PyObject *module = PyType_GetModuleByDef(type, &thread_module);
+ thread_module_state *state = get_thread_state(module);
+
+ localobject *self = (localobject *)type->tp_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ self->args = Py_XNewRef(args);
+ self->kw = Py_XNewRef(kw);
+ self->key = PyUnicode_FromFormat("thread.local.%p", self);
+ if (self->key == NULL) {
+ goto err;
+ }
+
+ self->dummies = PyDict_New();
+ if (self->dummies == NULL) {
+ goto err;
+ }
+
+ /* We use a weak reference to self in the callback closure
+ in order to avoid spurious reference cycles */
+ PyObject *wr = PyWeakref_NewRef((PyObject *) self, NULL);
+ if (wr == NULL) {
+ goto err;
+ }
+ self->wr_callback = PyCFunction_NewEx(&wr_callback_def, wr, NULL);
+ Py_DECREF(wr);
+ if (self->wr_callback == NULL) {
+ goto err;
+ }
+ if (_local_create_dummy(self, state) == NULL) {
+ goto err;
+ }
+ return (PyObject *)self;
+
+ err:
+ Py_DECREF(self);
+ return NULL;
+}
+
+static int
+local_traverse(localobject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->args);
+ Py_VISIT(self->kw);
+ Py_VISIT(self->dummies);
+ return 0;
+}
+
+static int
+local_clear(localobject *self)
+{
+ Py_CLEAR(self->args);
+ Py_CLEAR(self->kw);
+ Py_CLEAR(self->dummies);
+ Py_CLEAR(self->wr_callback);
+ /* Remove all strong references to dummies from the thread states */
+ if (self->key) {
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ _PyRuntimeState *runtime = &_PyRuntime;
+ HEAD_LOCK(runtime);
+ PyThreadState *tstate = PyInterpreterState_ThreadHead(interp);
+ HEAD_UNLOCK(runtime);
+ while (tstate) {
+ if (tstate->dict) {
+ PyObject *v = _PyDict_Pop(tstate->dict, self->key, Py_None);
+ if (v != NULL) {
+ Py_DECREF(v);
+ }
+ else {
+ PyErr_Clear();
+ }
+ }
+ HEAD_LOCK(runtime);
+ tstate = PyThreadState_Next(tstate);
+ HEAD_UNLOCK(runtime);
+ }
+ }
+ return 0;
+}
+
+static void
+local_dealloc(localobject *self)
+{
+ /* Weakrefs must be invalidated right now, otherwise they can be used
+ from code called below, which is very dangerous since Py_REFCNT(self) == 0 */
+ if (self->weakreflist != NULL) {
+ PyObject_ClearWeakRefs((PyObject *) self);
+ }
+
+ PyObject_GC_UnTrack(self);
+
+ local_clear(self);
+ Py_XDECREF(self->key);
+
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free((PyObject*)self);
+ Py_DECREF(tp);
+}
+
+/* Returns a borrowed reference to the local dict, creating it if necessary */
+static PyObject *
+_ldict(localobject *self, thread_module_state *state)
+{
+ PyObject *tdict = PyThreadState_GetDict();
+ if (tdict == NULL) {
+ PyErr_SetString(PyExc_SystemError,
+ "Couldn't get thread-state dictionary");
+ return NULL;
+ }
+
+ PyObject *ldict;
+ PyObject *dummy = PyDict_GetItemWithError(tdict, self->key);
+ if (dummy == NULL) {
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ ldict = _local_create_dummy(self, state);
+ if (ldict == NULL)
+ return NULL;
+
+ if (Py_TYPE(self)->tp_init != PyBaseObject_Type.tp_init &&
+ Py_TYPE(self)->tp_init((PyObject*)self,
+ self->args, self->kw) < 0) {
+ /* we need to get rid of ldict from thread so
+ we create a new one the next time we do an attr
+ access */
+ PyDict_DelItem(tdict, self->key);
+ return NULL;
+ }
+ }
+ else {
+ assert(Py_IS_TYPE(dummy, state->local_dummy_type));
+ ldict = ((localdummyobject *) dummy)->localdict;
+ }
+
+ return ldict;
+}
+
+static int
+local_setattro(localobject *self, PyObject *name, PyObject *v)
+{
+ PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
+ thread_module_state *state = get_thread_state(module);
+
+ PyObject *ldict = _ldict(self, state);
+ if (ldict == NULL) {
+ return -1;
+ }
+
+ int r = PyObject_RichCompareBool(name, &_Py_ID(__dict__), Py_EQ);
+ if (r == -1) {
+ return -1;
+ }
+ if (r == 1) {
+ PyErr_Format(PyExc_AttributeError,
+ "'%.100s' object attribute '%U' is read-only",
+ Py_TYPE(self)->tp_name, name);
+ return -1;
+ }
+
+ return _PyObject_GenericSetAttrWithDict((PyObject *)self, name, v, ldict);
+}
+
+static PyObject *local_getattro(localobject *, PyObject *);
+
+static PyMemberDef local_type_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(localobject, weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot local_type_slots[] = {
+ {Py_tp_dealloc, (destructor)local_dealloc},
+ {Py_tp_getattro, (getattrofunc)local_getattro},
+ {Py_tp_setattro, (setattrofunc)local_setattro},
+ {Py_tp_doc, "Thread-local data"},
+ {Py_tp_traverse, (traverseproc)local_traverse},
+ {Py_tp_clear, (inquiry)local_clear},
+ {Py_tp_new, local_new},
+ {Py_tp_members, local_type_members},
+ {0, 0}
+};
+
+static PyType_Spec local_type_spec = {
+ .name = "_thread._local",
+ .basicsize = sizeof(localobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = local_type_slots,
+};
+
+static PyObject *
+local_getattro(localobject *self, PyObject *name)
+{
+ PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
+ thread_module_state *state = get_thread_state(module);
+
+ PyObject *ldict = _ldict(self, state);
+ if (ldict == NULL)
+ return NULL;
+
+ int r = PyObject_RichCompareBool(name, &_Py_ID(__dict__), Py_EQ);
+ if (r == 1) {
+ return Py_NewRef(ldict);
+ }
+ if (r == -1) {
+ return NULL;
+ }
+
+ if (!Py_IS_TYPE(self, state->local_type)) {
+ /* use generic lookup for subtypes */
+ return _PyObject_GenericGetAttrWithDict((PyObject *)self, name,
+ ldict, 0);
+ }
+
+ /* Optimization: just look in dict ourselves */
+ PyObject *value = PyDict_GetItemWithError(ldict, name);
+ if (value != NULL) {
+ return Py_NewRef(value);
+ }
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
+ /* Fall back on generic to get __class__ and __dict__ */
+ return _PyObject_GenericGetAttrWithDict(
+ (PyObject *)self, name, ldict, 0);
+}
+
+/* Called when a dummy is destroyed. */
+static PyObject *
+_localdummy_destroyed(PyObject *localweakref, PyObject *dummyweakref)
+{
+ assert(PyWeakref_CheckRef(localweakref));
+ PyObject *obj = PyWeakref_GET_OBJECT(localweakref);
+ if (obj == Py_None) {
+ Py_RETURN_NONE;
+ }
+
+ /* If the thread-local object is still alive and not being cleared,
+ remove the corresponding local dict */
+ localobject *self = (localobject *)Py_NewRef(obj);
+ if (self->dummies != NULL) {
+ PyObject *ldict;
+ ldict = PyDict_GetItemWithError(self->dummies, dummyweakref);
+ if (ldict != NULL) {
+ PyDict_DelItem(self->dummies, dummyweakref);
+ }
+ if (PyErr_Occurred())
+ PyErr_WriteUnraisable(obj);
+ }
+ Py_DECREF(obj);
+ Py_RETURN_NONE;
+}
+
+/* Module functions */
+
+struct bootstate {
+ PyThreadState *tstate;
+ PyObject *func;
+ PyObject *args;
+ PyObject *kwargs;
+};
+
+
+static void
+thread_bootstate_free(struct bootstate *boot, int decref)
+{
+ if (decref) {
+ Py_DECREF(boot->func);
+ Py_DECREF(boot->args);
+ Py_XDECREF(boot->kwargs);
+ }
+ PyMem_RawFree(boot);
+}
+
+
+static void
+thread_run(void *boot_raw)
+{
+ struct bootstate *boot = (struct bootstate *) boot_raw;
+ PyThreadState *tstate = boot->tstate;
+
+ // gh-108987: If _thread.start_new_thread() is called before or while
+ // Python is being finalized, thread_run() can called *after*.
+ // _PyRuntimeState_SetFinalizing() is called. At this point, all Python
+ // threads must exit, except of the thread calling Py_Finalize() whch holds
+ // the GIL and must not exit.
+ //
+ // At this stage, tstate can be a dangling pointer (point to freed memory),
+ // it's ok to call _PyThreadState_MustExit() with a dangling pointer.
+ if (_PyThreadState_MustExit(tstate)) {
+ // Don't call PyThreadState_Clear() nor _PyThreadState_DeleteCurrent().
+ // These functions are called on tstate indirectly by Py_Finalize()
+ // which calls _PyInterpreterState_Clear().
+ //
+ // Py_DECREF() cannot be called because the GIL is not held: leak
+ // references on purpose. Python is being finalized anyway.
+ thread_bootstate_free(boot, 0);
+ goto exit;
+ }
+
+ _PyThreadState_Bind(tstate);
+ PyEval_AcquireThread(tstate);
+ tstate->interp->threads.count++;
+
+ PyObject *res = PyObject_Call(boot->func, boot->args, boot->kwargs);
+ if (res == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_SystemExit))
+ /* SystemExit is ignored silently */
+ PyErr_Clear();
+ else {
+ _PyErr_WriteUnraisableMsg("in thread started by", boot->func);
+ }
+ }
+ else {
+ Py_DECREF(res);
+ }
+
+ thread_bootstate_free(boot, 1);
+
+ tstate->interp->threads.count--;
+ PyThreadState_Clear(tstate);
+ _PyThreadState_DeleteCurrent(tstate);
+
+exit:
+ // bpo-44434: Don't call explicitly PyThread_exit_thread(). On Linux with
+ // the glibc, pthread_exit() can abort the whole process if dlopen() fails
+ // to open the libgcc_s.so library (ex: EMFILE error).
+ return;
+}
+
+static PyObject *
+thread_daemon_threads_allowed(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyInterpreterState *interp = _PyInterpreterState_Get();
+ if (interp->feature_flags & Py_RTFLAGS_DAEMON_THREADS) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+PyDoc_STRVAR(daemon_threads_allowed_doc,
+"daemon_threads_allowed()\n\
+\n\
+Return True if daemon threads are allowed in the current interpreter,\n\
+and False otherwise.\n");
+
+static PyObject *
+thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs)
+{
+ PyObject *func, *args, *kwargs = NULL;
+
+ if (!PyArg_UnpackTuple(fargs, "start_new_thread", 2, 3,
+ &func, &args, &kwargs))
+ return NULL;
+ if (!PyCallable_Check(func)) {
+ PyErr_SetString(PyExc_TypeError,
+ "first arg must be callable");
+ return NULL;
+ }
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "2nd arg must be a tuple");
+ return NULL;
+ }
+ if (kwargs != NULL && !PyDict_Check(kwargs)) {
+ PyErr_SetString(PyExc_TypeError,
+ "optional 3rd arg must be a dictionary");
+ return NULL;
+ }
+
+ if (PySys_Audit("_thread.start_new_thread", "OOO",
+ func, args, kwargs ? kwargs : Py_None) < 0) {
+ return NULL;
+ }
+
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_THREADS)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "thread is not supported for isolated subinterpreters");
+ return NULL;
+ }
+ if (interp->finalizing) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "can't create new thread at interpreter shutdown");
+ return NULL;
+ }
+
+ // gh-109795: Use PyMem_RawMalloc() instead of PyMem_Malloc(),
+ // because it should be possible to call thread_bootstate_free()
+ // without holding the GIL.
+ struct bootstate *boot = PyMem_RawMalloc(sizeof(struct bootstate));
+ if (boot == NULL) {
+ return PyErr_NoMemory();
+ }
+ boot->tstate = _PyThreadState_New(interp);
+ if (boot->tstate == NULL) {
+ PyMem_RawFree(boot);
+ if (!PyErr_Occurred()) {
+ return PyErr_NoMemory();
+ }
+ return NULL;
+ }
+ boot->func = Py_NewRef(func);
+ boot->args = Py_NewRef(args);
+ boot->kwargs = Py_XNewRef(kwargs);
+
+ unsigned long ident = PyThread_start_new_thread(thread_run, (void*) boot);
+ if (ident == PYTHREAD_INVALID_THREAD_ID) {
+ PyErr_SetString(ThreadError, "can't start new thread");
+ PyThreadState_Clear(boot->tstate);
+ thread_bootstate_free(boot, 1);
+ return NULL;
+ }
+ return PyLong_FromUnsignedLong(ident);
+}
+
+PyDoc_STRVAR(start_new_doc,
+"start_new_thread(function, args[, kwargs])\n\
+(start_new() is an obsolete synonym)\n\
+\n\
+Start a new thread and return its identifier. The thread will call the\n\
+function with positional arguments from the tuple args and keyword arguments\n\
+taken from the optional dictionary kwargs. The thread exits when the\n\
+function returns; the return value is ignored. The thread will also exit\n\
+when the function raises an unhandled exception; a stack trace will be\n\
+printed unless the exception is SystemExit.\n");
+
+static PyObject *
+thread_PyThread_exit_thread(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyErr_SetNone(PyExc_SystemExit);
+ return NULL;
+}
+
+PyDoc_STRVAR(exit_doc,
+"exit()\n\
+(exit_thread() is an obsolete synonym)\n\
+\n\
+This is synonymous to ``raise SystemExit''. It will cause the current\n\
+thread to exit silently unless the exception is caught.");
+
+static PyObject *
+thread_PyThread_interrupt_main(PyObject *self, PyObject *args)
+{
+ int signum = SIGINT;
+ if (!PyArg_ParseTuple(args, "|i:signum", &signum)) {
+ return NULL;
+ }
+
+ if (PyErr_SetInterruptEx(signum)) {
+ PyErr_SetString(PyExc_ValueError, "signal number out of range");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(interrupt_doc,
+"interrupt_main(signum=signal.SIGINT, /)\n\
+\n\
+Simulate the arrival of the given signal in the main thread,\n\
+where the corresponding signal handler will be executed.\n\
+If *signum* is omitted, SIGINT is assumed.\n\
+A subthread can use this function to interrupt the main thread.\n\
+\n\
+Note: the default signal handler for SIGINT raises ``KeyboardInterrupt``."
+);
+
+static lockobject *newlockobject(PyObject *module);
+
+static PyObject *
+thread_PyThread_allocate_lock(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return (PyObject *) newlockobject(module);
+}
+
+PyDoc_STRVAR(allocate_doc,
+"allocate_lock() -> lock object\n\
+(allocate() is an obsolete synonym)\n\
+\n\
+Create a new lock object. See help(type(threading.Lock())) for\n\
+information about locks.");
+
+static PyObject *
+thread_get_ident(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ unsigned long ident = PyThread_get_thread_ident();
+ if (ident == PYTHREAD_INVALID_THREAD_ID) {
+ PyErr_SetString(ThreadError, "no current thread ident");
+ return NULL;
+ }
+ return PyLong_FromUnsignedLong(ident);
+}
+
+PyDoc_STRVAR(get_ident_doc,
+"get_ident() -> integer\n\
+\n\
+Return a non-zero integer that uniquely identifies the current thread\n\
+amongst other threads that exist simultaneously.\n\
+This may be used to identify per-thread resources.\n\
+Even though on some platforms threads identities may appear to be\n\
+allocated consecutive numbers starting at 1, this behavior should not\n\
+be relied upon, and the number should be seen purely as a magic cookie.\n\
+A thread's identity may be reused for another thread after it exits.");
+
+#ifdef PY_HAVE_THREAD_NATIVE_ID
+static PyObject *
+thread_get_native_id(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ unsigned long native_id = PyThread_get_thread_native_id();
+ return PyLong_FromUnsignedLong(native_id);
+}
+
+PyDoc_STRVAR(get_native_id_doc,
+"get_native_id() -> integer\n\
+\n\
+Return a non-negative integer identifying the thread as reported\n\
+by the OS (kernel). This may be used to uniquely identify a\n\
+particular thread within a system.");
+#endif
+
+static PyObject *
+thread__count(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ return PyLong_FromLong(interp->threads.count);
+}
+
+PyDoc_STRVAR(_count_doc,
+"_count() -> integer\n\
+\n\
+\
+Return the number of currently running Python threads, excluding\n\
+the main thread. The returned number comprises all threads created\n\
+through `start_new_thread()` as well as `threading.Thread`, and not\n\
+yet finished.\n\
+\n\
+This function is meant for internal and specialized purposes only.\n\
+In most applications `threading.enumerate()` should be used instead.");
+
+static void
+release_sentinel(void *wr_raw)
+{
+ PyObject *wr = _PyObject_CAST(wr_raw);
+ /* Tricky: this function is called when the current thread state
+ is being deleted. Therefore, only simple C code can safely
+ execute here. */
+ PyObject *obj = PyWeakref_GET_OBJECT(wr);
+ lockobject *lock;
+ if (obj != Py_None) {
+ lock = (lockobject *) obj;
+ if (lock->locked) {
+ PyThread_release_lock(lock->lock_lock);
+ lock->locked = 0;
+ }
+ }
+ /* Deallocating a weakref with a NULL callback only calls
+ PyObject_GC_Del(), which can't call any Python code. */
+ Py_DECREF(wr);
+}
+
+static PyObject *
+thread__set_sentinel(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *wr;
+ PyThreadState *tstate = _PyThreadState_GET();
+ lockobject *lock;
+
+ if (tstate->on_delete_data != NULL) {
+ /* We must support the re-creation of the lock from a
+ fork()ed child. */
+ assert(tstate->on_delete == &release_sentinel);
+ wr = (PyObject *) tstate->on_delete_data;
+ tstate->on_delete = NULL;
+ tstate->on_delete_data = NULL;
+ Py_DECREF(wr);
+ }
+ lock = newlockobject(module);
+ if (lock == NULL)
+ return NULL;
+ /* The lock is owned by whoever called _set_sentinel(), but the weakref
+ hangs to the thread state. */
+ wr = PyWeakref_NewRef((PyObject *) lock, NULL);
+ if (wr == NULL) {
+ Py_DECREF(lock);
+ return NULL;
+ }
+ tstate->on_delete_data = (void *) wr;
+ tstate->on_delete = &release_sentinel;
+ return (PyObject *) lock;
+}
+
+PyDoc_STRVAR(_set_sentinel_doc,
+"_set_sentinel() -> lock\n\
+\n\
+Set a sentinel lock that will be released when the current thread\n\
+state is finalized (after it is untied from the interpreter).\n\
+\n\
+This is a private API for the threading module.");
+
+static PyObject *
+thread_stack_size(PyObject *self, PyObject *args)
+{
+ size_t old_size;
+ Py_ssize_t new_size = 0;
+ int rc;
+
+ if (!PyArg_ParseTuple(args, "|n:stack_size", &new_size))
+ return NULL;
+
+ if (new_size < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "size must be 0 or a positive value");
+ return NULL;
+ }
+
+ old_size = PyThread_get_stacksize();
+
+ rc = PyThread_set_stacksize((size_t) new_size);
+ if (rc == -1) {
+ PyErr_Format(PyExc_ValueError,
+ "size not valid: %zd bytes",
+ new_size);
+ return NULL;
+ }
+ if (rc == -2) {
+ PyErr_SetString(ThreadError,
+ "setting stack size not supported");
+ return NULL;
+ }
+
+ return PyLong_FromSsize_t((Py_ssize_t) old_size);
+}
+
+PyDoc_STRVAR(stack_size_doc,
+"stack_size([size]) -> size\n\
+\n\
+Return the thread stack size used when creating new threads. The\n\
+optional size argument specifies the stack size (in bytes) to be used\n\
+for subsequently created threads, and must be 0 (use platform or\n\
+configured default) or a positive integer value of at least 32,768 (32k).\n\
+If changing the thread stack size is unsupported, a ThreadError\n\
+exception is raised. If the specified size is invalid, a ValueError\n\
+exception is raised, and the stack size is unmodified. 32k bytes\n\
+ currently the minimum supported stack size value to guarantee\n\
+sufficient stack space for the interpreter itself.\n\
+\n\
+Note that some platforms may have particular restrictions on values for\n\
+the stack size, such as requiring a minimum stack size larger than 32 KiB or\n\
+requiring allocation in multiples of the system memory page size\n\
+- platform documentation should be referred to for more information\n\
+(4 KiB pages are common; using multiples of 4096 for the stack size is\n\
+the suggested approach in the absence of more specific information).");
+
+static int
+thread_excepthook_file(PyObject *file, PyObject *exc_type, PyObject *exc_value,
+ PyObject *exc_traceback, PyObject *thread)
+{
+ /* print(f"Exception in thread {thread.name}:", file=file) */
+ if (PyFile_WriteString("Exception in thread ", file) < 0) {
+ return -1;
+ }
+
+ PyObject *name = NULL;
+ if (thread != Py_None) {
+ if (_PyObject_LookupAttr(thread, &_Py_ID(name), &name) < 0) {
+ return -1;
+ }
+ }
+ if (name != NULL) {
+ if (PyFile_WriteObject(name, file, Py_PRINT_RAW) < 0) {
+ Py_DECREF(name);
+ return -1;
+ }
+ Py_DECREF(name);
+ }
+ else {
+ unsigned long ident = PyThread_get_thread_ident();
+ PyObject *str = PyUnicode_FromFormat("%lu", ident);
+ if (str != NULL) {
+ if (PyFile_WriteObject(str, file, Py_PRINT_RAW) < 0) {
+ Py_DECREF(str);
+ return -1;
+ }
+ Py_DECREF(str);
+ }
+ else {
+ PyErr_Clear();
+
+ if (PyFile_WriteString("<failed to get thread name>", file) < 0) {
+ return -1;
+ }
+ }
+ }
+
+ if (PyFile_WriteString(":\n", file) < 0) {
+ return -1;
+ }
+
+ /* Display the traceback */
+ _PyErr_Display(file, exc_type, exc_value, exc_traceback);
+
+ /* Call file.flush() */
+ PyObject *res = PyObject_CallMethodNoArgs(file, &_Py_ID(flush));
+ if (!res) {
+ return -1;
+ }
+ Py_DECREF(res);
+
+ return 0;
+}
+
+
+PyDoc_STRVAR(ExceptHookArgs__doc__,
+"ExceptHookArgs\n\
+\n\
+Type used to pass arguments to threading.excepthook.");
+
+static PyStructSequence_Field ExceptHookArgs_fields[] = {
+ {"exc_type", "Exception type"},
+ {"exc_value", "Exception value"},
+ {"exc_traceback", "Exception traceback"},
+ {"thread", "Thread"},
+ {0}
+};
+
+static PyStructSequence_Desc ExceptHookArgs_desc = {
+ .name = "_thread._ExceptHookArgs",
+ .doc = ExceptHookArgs__doc__,
+ .fields = ExceptHookArgs_fields,
+ .n_in_sequence = 4
+};
+
+
+static PyObject *
+thread_excepthook(PyObject *module, PyObject *args)
+{
+ thread_module_state *state = get_thread_state(module);
+
+ if (!Py_IS_TYPE(args, state->excepthook_type)) {
+ PyErr_SetString(PyExc_TypeError,
+ "_thread.excepthook argument type "
+ "must be ExceptHookArgs");
+ return NULL;
+ }
+
+ /* Borrowed reference */
+ PyObject *exc_type = PyStructSequence_GET_ITEM(args, 0);
+ if (exc_type == PyExc_SystemExit) {
+ /* silently ignore SystemExit */
+ Py_RETURN_NONE;
+ }
+
+ /* Borrowed references */
+ PyObject *exc_value = PyStructSequence_GET_ITEM(args, 1);
+ PyObject *exc_tb = PyStructSequence_GET_ITEM(args, 2);
+ PyObject *thread = PyStructSequence_GET_ITEM(args, 3);
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ PyObject *file = _PySys_GetAttr(tstate, &_Py_ID(stderr));
+ if (file == NULL || file == Py_None) {
+ if (thread == Py_None) {
+ /* do nothing if sys.stderr is None and thread is None */
+ Py_RETURN_NONE;
+ }
+
+ file = PyObject_GetAttrString(thread, "_stderr");
+ if (file == NULL) {
+ return NULL;
+ }
+ if (file == Py_None) {
+ Py_DECREF(file);
+ /* do nothing if sys.stderr is None and sys.stderr was None
+ when the thread was created */
+ Py_RETURN_NONE;
+ }
+ }
+ else {
+ Py_INCREF(file);
+ }
+
+ int res = thread_excepthook_file(file, exc_type, exc_value, exc_tb,
+ thread);
+ Py_DECREF(file);
+ if (res < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(excepthook_doc,
+"excepthook(exc_type, exc_value, exc_traceback, thread)\n\
+\n\
+Handle uncaught Thread.run() exception.");
+
+static PyObject *
+thread__is_main_interpreter(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ return PyBool_FromLong(_Py_IsMainInterpreter(interp));
+}
+
+PyDoc_STRVAR(thread__is_main_interpreter_doc,
+"_is_main_interpreter()\n\
+\n\
+Return True if the current interpreter is the main Python interpreter.");
+
+static PyMethodDef thread_methods[] = {
+ {"start_new_thread", (PyCFunction)thread_PyThread_start_new_thread,
+ METH_VARARGS, start_new_doc},
+ {"start_new", (PyCFunction)thread_PyThread_start_new_thread,
+ METH_VARARGS, start_new_doc},
+ {"daemon_threads_allowed", (PyCFunction)thread_daemon_threads_allowed,
+ METH_NOARGS, daemon_threads_allowed_doc},
+ {"allocate_lock", thread_PyThread_allocate_lock,
+ METH_NOARGS, allocate_doc},
+ {"allocate", thread_PyThread_allocate_lock,
+ METH_NOARGS, allocate_doc},
+ {"exit_thread", thread_PyThread_exit_thread,
+ METH_NOARGS, exit_doc},
+ {"exit", thread_PyThread_exit_thread,
+ METH_NOARGS, exit_doc},
+ {"interrupt_main", (PyCFunction)thread_PyThread_interrupt_main,
+ METH_VARARGS, interrupt_doc},
+ {"get_ident", thread_get_ident,
+ METH_NOARGS, get_ident_doc},
+#ifdef PY_HAVE_THREAD_NATIVE_ID
+ {"get_native_id", thread_get_native_id,
+ METH_NOARGS, get_native_id_doc},
+#endif
+ {"_count", thread__count,
+ METH_NOARGS, _count_doc},
+ {"stack_size", (PyCFunction)thread_stack_size,
+ METH_VARARGS, stack_size_doc},
+ {"_set_sentinel", thread__set_sentinel,
+ METH_NOARGS, _set_sentinel_doc},
+ {"_excepthook", thread_excepthook,
+ METH_O, excepthook_doc},
+ {"_is_main_interpreter", thread__is_main_interpreter,
+ METH_NOARGS, thread__is_main_interpreter_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* Initialization function */
+
+static int
+thread_module_exec(PyObject *module)
+{
+ thread_module_state *state = get_thread_state(module);
+ PyObject *d = PyModule_GetDict(module);
+
+ // Initialize the C thread library
+ PyThread_init_thread();
+
+ // Lock
+ state->lock_type = (PyTypeObject *)PyType_FromSpec(&lock_type_spec);
+ if (state->lock_type == NULL) {
+ return -1;
+ }
+ if (PyDict_SetItemString(d, "LockType", (PyObject *)state->lock_type) < 0) {
+ return -1;
+ }
+
+ // RLock
+ PyTypeObject *rlock_type = (PyTypeObject *)PyType_FromSpec(&rlock_type_spec);
+ if (rlock_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, rlock_type) < 0) {
+ Py_DECREF(rlock_type);
+ return -1;
+ }
+ Py_DECREF(rlock_type);
+
+ // Local dummy
+ state->local_dummy_type = (PyTypeObject *)PyType_FromSpec(&local_dummy_type_spec);
+ if (state->local_dummy_type == NULL) {
+ return -1;
+ }
+
+ // Local
+ state->local_type = (PyTypeObject *)PyType_FromModuleAndSpec(module, &local_type_spec, NULL);
+ if (state->local_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->local_type) < 0) {
+ return -1;
+ }
+
+ // Add module attributes
+ if (PyDict_SetItemString(d, "error", ThreadError) < 0) {
+ return -1;
+ }
+
+ // _ExceptHookArgs type
+ state->excepthook_type = PyStructSequence_NewType(&ExceptHookArgs_desc);
+ if (state->excepthook_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->excepthook_type) < 0) {
+ return -1;
+ }
+
+ // TIMEOUT_MAX
+ double timeout_max = (double)PY_TIMEOUT_MAX * 1e-6;
+ double time_max = _PyTime_AsSecondsDouble(_PyTime_MAX);
+ timeout_max = Py_MIN(timeout_max, time_max);
+ // Round towards minus infinity
+ timeout_max = floor(timeout_max);
+
+ if (_PyModule_Add(module, "TIMEOUT_MAX",
+ PyFloat_FromDouble(timeout_max)) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int
+thread_module_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ thread_module_state *state = get_thread_state(module);
+ Py_VISIT(state->excepthook_type);
+ Py_VISIT(state->lock_type);
+ Py_VISIT(state->local_type);
+ Py_VISIT(state->local_dummy_type);
+ return 0;
+}
+
+static int
+thread_module_clear(PyObject *module)
+{
+ thread_module_state *state = get_thread_state(module);
+ Py_CLEAR(state->excepthook_type);
+ Py_CLEAR(state->lock_type);
+ Py_CLEAR(state->local_type);
+ Py_CLEAR(state->local_dummy_type);
+ return 0;
+}
+
+static void
+thread_module_free(void *module)
+{
+ thread_module_clear((PyObject *)module);
+}
+
+
+
+PyDoc_STRVAR(thread_doc,
+"This module provides primitive operations to write multi-threaded programs.\n\
+The 'threading' module provides a more convenient interface.");
+
+static PyModuleDef_Slot thread_module_slots[] = {
+ {Py_mod_exec, thread_module_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef thread_module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_thread",
+ .m_doc = thread_doc,
+ .m_size = sizeof(thread_module_state),
+ .m_methods = thread_methods,
+ .m_traverse = thread_module_traverse,
+ .m_clear = thread_module_clear,
+ .m_free = thread_module_free,
+ .m_slots = thread_module_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__thread(void)
+{
+ return PyModuleDef_Init(&thread_module);
+}
diff --git a/contrib/tools/python3/Modules/_tracemalloc.c b/contrib/tools/python3/Modules/_tracemalloc.c
new file mode 100644
index 00000000000..f3f4af9aba0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_tracemalloc.c
@@ -0,0 +1,228 @@
+#include "Python.h"
+
+#include "clinic/_tracemalloc.c.h"
+
+
+/*[clinic input]
+module _tracemalloc
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=708a98302fc46e5f]*/
+
+
+/*[clinic input]
+_tracemalloc.is_tracing
+
+Return True if the tracemalloc module is tracing Python memory allocations.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_is_tracing_impl(PyObject *module)
+/*[clinic end generated code: output=2d763b42601cd3ef input=af104b0a00192f63]*/
+{
+ return PyBool_FromLong(_PyTraceMalloc_IsTracing());
+}
+
+
+/*[clinic input]
+_tracemalloc.clear_traces
+
+Clear traces of memory blocks allocated by Python.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_clear_traces_impl(PyObject *module)
+/*[clinic end generated code: output=a86080ee41b84197 input=0dab5b6c785183a5]*/
+{
+ _PyTraceMalloc_ClearTraces();
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_tracemalloc._get_traces
+
+Get traces of all memory blocks allocated by Python.
+
+Return a list of (size: int, traceback: tuple) tuples.
+traceback is a tuple of (filename: str, lineno: int) tuples.
+
+Return an empty list if the tracemalloc module is disabled.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc__get_traces_impl(PyObject *module)
+/*[clinic end generated code: output=e9929876ced4b5cc input=6c7d2230b24255aa]*/
+{
+ return _PyTraceMalloc_GetTraces();
+}
+
+
+
+/*[clinic input]
+_tracemalloc._get_object_traceback
+
+ obj: object
+ /
+
+Get the traceback where the Python object obj was allocated.
+
+Return a tuple of (filename: str, lineno: int) tuples.
+Return None if the tracemalloc module is disabled or did not
+trace the allocation of the object.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc__get_object_traceback(PyObject *module, PyObject *obj)
+/*[clinic end generated code: output=41ee0553a658b0aa input=29495f1b21c53212]*/
+{
+ return _PyTraceMalloc_GetObjectTraceback(obj);
+}
+
+
+/*[clinic input]
+_tracemalloc.start
+
+ nframe: int = 1
+ /
+
+Start tracing Python memory allocations.
+
+Also set the maximum number of frames stored in the traceback of a
+trace to nframe.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_start_impl(PyObject *module, int nframe)
+/*[clinic end generated code: output=caae05c23c159d3c input=40d849b5b29d1933]*/
+{
+ if (_PyTraceMalloc_Start(nframe) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_tracemalloc.stop
+
+Stop tracing Python memory allocations.
+
+Also clear traces of memory blocks allocated by Python.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_stop_impl(PyObject *module)
+/*[clinic end generated code: output=c3c42ae03e3955cd input=7478f075e51dae18]*/
+{
+ _PyTraceMalloc_Stop();
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_tracemalloc.get_traceback_limit
+
+Get the maximum number of frames stored in the traceback of a trace.
+
+By default, a trace of an allocated memory block only stores
+the most recent frame: the limit is 1.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_get_traceback_limit_impl(PyObject *module)
+/*[clinic end generated code: output=d556d9306ba95567 input=da3cd977fc68ae3b]*/
+{
+ return PyLong_FromLong(_PyTraceMalloc_GetTracebackLimit());
+}
+
+/*[clinic input]
+_tracemalloc.get_tracemalloc_memory
+
+Get the memory usage in bytes of the tracemalloc module.
+
+This memory is used internally to trace memory allocations.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_get_tracemalloc_memory_impl(PyObject *module)
+/*[clinic end generated code: output=e3f14e280a55f5aa input=5d919c0f4d5132ad]*/
+{
+ return PyLong_FromSize_t(_PyTraceMalloc_GetMemory());
+}
+
+
+/*[clinic input]
+_tracemalloc.get_traced_memory
+
+Get the current size and peak size of memory blocks traced by tracemalloc.
+
+Returns a tuple: (current: int, peak: int).
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_get_traced_memory_impl(PyObject *module)
+/*[clinic end generated code: output=5b167189adb9e782 input=61ddb5478400ff66]*/
+{
+ return _PyTraceMalloc_GetTracedMemory();
+}
+
+/*[clinic input]
+_tracemalloc.reset_peak
+
+Set the peak size of memory blocks traced by tracemalloc to the current size.
+
+Do nothing if the tracemalloc module is not tracing memory allocations.
+
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_reset_peak_impl(PyObject *module)
+/*[clinic end generated code: output=140c2870f691dbb2 input=18afd0635066e9ce]*/
+{
+ _PyTraceMalloc_ResetPeak();
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef module_methods[] = {
+ _TRACEMALLOC_IS_TRACING_METHODDEF
+ _TRACEMALLOC_CLEAR_TRACES_METHODDEF
+ _TRACEMALLOC__GET_TRACES_METHODDEF
+ _TRACEMALLOC__GET_OBJECT_TRACEBACK_METHODDEF
+ _TRACEMALLOC_START_METHODDEF
+ _TRACEMALLOC_STOP_METHODDEF
+ _TRACEMALLOC_GET_TRACEBACK_LIMIT_METHODDEF
+ _TRACEMALLOC_GET_TRACEMALLOC_MEMORY_METHODDEF
+ _TRACEMALLOC_GET_TRACED_MEMORY_METHODDEF
+ _TRACEMALLOC_RESET_PEAK_METHODDEF
+ /* sentinel */
+ {NULL, NULL}
+};
+
+PyDoc_STRVAR(module_doc,
+"Debug module to trace memory blocks allocated by Python.");
+
+static struct PyModuleDef module_def = {
+ PyModuleDef_HEAD_INIT,
+ "_tracemalloc",
+ module_doc,
+ 0, /* non-negative size to be able to unload the module */
+ module_methods,
+ NULL,
+};
+
+PyMODINIT_FUNC
+PyInit__tracemalloc(void)
+{
+ PyObject *m;
+ m = PyModule_Create(&module_def);
+ if (m == NULL)
+ return NULL;
+
+ if (_PyTraceMalloc_Init() < 0) {
+ Py_DECREF(m);
+ return NULL;
+ }
+
+ return m;
+}
diff --git a/contrib/tools/python3/Modules/_typingmodule.c b/contrib/tools/python3/Modules/_typingmodule.c
new file mode 100644
index 00000000000..39a124a26ad
--- /dev/null
+++ b/contrib/tools/python3/Modules/_typingmodule.c
@@ -0,0 +1,90 @@
+/* typing accelerator C extension: _typing module. */
+
+#ifndef Py_BUILD_CORE
+#define Py_BUILD_CORE
+#endif
+
+#include "Python.h"
+#include "internal/pycore_interp.h"
+#include "internal/pycore_typevarobject.h"
+#include "clinic/_typingmodule.c.h"
+
+/*[clinic input]
+module _typing
+
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=1db35baf1c72942b]*/
+
+/* helper function to make typing.NewType.__call__ method faster */
+
+/*[clinic input]
+_typing._idfunc -> object
+
+ x: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_typing__idfunc(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=63c38be4a6ec5f2c input=49f17284b43de451]*/
+{
+ return Py_NewRef(x);
+}
+
+
+static PyMethodDef typing_methods[] = {
+ _TYPING__IDFUNC_METHODDEF
+ {NULL, NULL, 0, NULL}
+};
+
+PyDoc_STRVAR(typing_doc,
+"Accelerators for the typing module.\n");
+
+static int
+_typing_exec(PyObject *m)
+{
+ PyInterpreterState *interp = PyInterpreterState_Get();
+
+#define EXPORT_TYPE(name, typename) \
+ if (PyModule_AddObjectRef(m, name, \
+ (PyObject *)interp->cached_objects.typename) < 0) { \
+ return -1; \
+ }
+
+ EXPORT_TYPE("TypeVar", typevar_type);
+ EXPORT_TYPE("TypeVarTuple", typevartuple_type);
+ EXPORT_TYPE("ParamSpec", paramspec_type);
+ EXPORT_TYPE("ParamSpecArgs", paramspecargs_type);
+ EXPORT_TYPE("ParamSpecKwargs", paramspeckwargs_type);
+ EXPORT_TYPE("Generic", generic_type);
+#undef EXPORT_TYPE
+ if (PyModule_AddObjectRef(m, "TypeAliasType", (PyObject *)&_PyTypeAlias_Type) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static struct PyModuleDef_Slot _typingmodule_slots[] = {
+ {Py_mod_exec, _typing_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef typingmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_typing",
+ typing_doc,
+ 0,
+ typing_methods,
+ _typingmodule_slots,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__typing(void)
+{
+ return PyModuleDef_Init(&typingmodule);
+}
diff --git a/contrib/tools/python3/Modules/_weakref.c b/contrib/tools/python3/Modules/_weakref.c
new file mode 100644
index 00000000000..387b8fa9d0a
--- /dev/null
+++ b/contrib/tools/python3/Modules/_weakref.c
@@ -0,0 +1,197 @@
+#include "Python.h"
+#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR
+
+
+#define GET_WEAKREFS_LISTPTR(o) \
+ ((PyWeakReference **) _PyObject_GET_WEAKREFS_LISTPTR(o))
+
+/*[clinic input]
+module _weakref
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ffec73b85846596d]*/
+
+#include "clinic/_weakref.c.h"
+
+/*[clinic input]
+
+_weakref.getweakrefcount -> Py_ssize_t
+
+ object: object
+ /
+
+Return the number of weak references to 'object'.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_weakref_getweakrefcount_impl(PyObject *module, PyObject *object)
+/*[clinic end generated code: output=301806d59558ff3e input=cedb69711b6a2507]*/
+{
+ PyWeakReference **list;
+
+ if (!_PyType_SUPPORTS_WEAKREFS(Py_TYPE(object)))
+ return 0;
+
+ list = GET_WEAKREFS_LISTPTR(object);
+ return _PyWeakref_GetWeakrefCount(*list);
+}
+
+
+static int
+is_dead_weakref(PyObject *value)
+{
+ if (!PyWeakref_Check(value)) {
+ PyErr_SetString(PyExc_TypeError, "not a weakref");
+ return -1;
+ }
+ return PyWeakref_GET_OBJECT(value) == Py_None;
+}
+
+/*[clinic input]
+
+_weakref._remove_dead_weakref -> object
+
+ dct: object(subclass_of='&PyDict_Type')
+ key: object
+ /
+
+Atomically remove key from dict if it points to a dead weakref.
+[clinic start generated code]*/
+
+static PyObject *
+_weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct,
+ PyObject *key)
+/*[clinic end generated code: output=d9ff53061fcb875c input=19fc91f257f96a1d]*/
+{
+ if (_PyDict_DelItemIf(dct, key, is_dead_weakref) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError))
+ /* This function is meant to allow safe weak-value dicts
+ with GC in another thread (see issue #28427), so it's
+ ok if the key doesn't exist anymore.
+ */
+ PyErr_Clear();
+ else
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_weakref.getweakrefs
+ object: object
+ /
+
+Return a list of all weak reference objects pointing to 'object'.
+[clinic start generated code]*/
+
+static PyObject *
+_weakref_getweakrefs(PyObject *module, PyObject *object)
+/*[clinic end generated code: output=25c7731d8e011824 input=00c6d0e5d3206693]*/
+{
+ PyObject *result = NULL;
+
+ if (_PyType_SUPPORTS_WEAKREFS(Py_TYPE(object))) {
+ PyWeakReference **list = GET_WEAKREFS_LISTPTR(object);
+ Py_ssize_t count = _PyWeakref_GetWeakrefCount(*list);
+
+ result = PyList_New(count);
+ if (result != NULL) {
+ PyWeakReference *current = *list;
+ Py_ssize_t i;
+ for (i = 0; i < count; ++i) {
+ PyList_SET_ITEM(result, i, (PyObject *) current);
+ Py_INCREF(current);
+ current = current->wr_next;
+ }
+ }
+ }
+ else {
+ result = PyList_New(0);
+ }
+ return result;
+}
+
+
+/*[clinic input]
+
+_weakref.proxy
+ object: object
+ callback: object(c_default="NULL") = None
+ /
+
+Create a proxy object that weakly references 'object'.
+
+'callback', if given, is called with a reference to the
+proxy when 'object' is about to be finalized.
+[clinic start generated code]*/
+
+static PyObject *
+_weakref_proxy_impl(PyObject *module, PyObject *object, PyObject *callback)
+/*[clinic end generated code: output=d68fa4ad9ea40519 input=4808adf22fd137e7]*/
+{
+ return PyWeakref_NewProxy(object, callback);
+}
+
+
+static PyMethodDef
+weakref_functions[] = {
+ _WEAKREF_GETWEAKREFCOUNT_METHODDEF
+ _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF
+ _WEAKREF_GETWEAKREFS_METHODDEF
+ _WEAKREF_PROXY_METHODDEF
+ {NULL, NULL, 0, NULL}
+};
+
+static int
+weakref_exec(PyObject *module)
+{
+ Py_INCREF(&_PyWeakref_RefType);
+ if (PyModule_AddObject(module, "ref", (PyObject *) &_PyWeakref_RefType) < 0) {
+ Py_DECREF(&_PyWeakref_RefType);
+ return -1;
+ }
+ Py_INCREF(&_PyWeakref_RefType);
+ if (PyModule_AddObject(module, "ReferenceType",
+ (PyObject *) &_PyWeakref_RefType) < 0) {
+ Py_DECREF(&_PyWeakref_RefType);
+ return -1;
+ }
+ Py_INCREF(&_PyWeakref_ProxyType);
+ if (PyModule_AddObject(module, "ProxyType",
+ (PyObject *) &_PyWeakref_ProxyType) < 0) {
+ Py_DECREF(&_PyWeakref_ProxyType);
+ return -1;
+ }
+ Py_INCREF(&_PyWeakref_CallableProxyType);
+ if (PyModule_AddObject(module, "CallableProxyType",
+ (PyObject *) &_PyWeakref_CallableProxyType) < 0) {
+ Py_DECREF(&_PyWeakref_CallableProxyType);
+ return -1;
+ }
+
+ return 0;
+}
+
+static struct PyModuleDef_Slot weakref_slots[] = {
+ {Py_mod_exec, weakref_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef weakrefmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_weakref",
+ "Weak-reference support module.",
+ 0,
+ weakref_functions,
+ weakref_slots,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__weakref(void)
+{
+ return PyModuleDef_Init(&weakrefmodule);
+}
diff --git a/contrib/tools/python3/Modules/_winapi.c b/contrib/tools/python3/Modules/_winapi.c
new file mode 100644
index 00000000000..2784a815696
--- /dev/null
+++ b/contrib/tools/python3/Modules/_winapi.c
@@ -0,0 +1,2590 @@
+/*
+ * Support routines from the Windows API
+ *
+ * This module was originally created by merging PC/_subprocess.c with
+ * Modules/_multiprocessing/win32_functions.c.
+ *
+ * Copyright (c) 2004 by Fredrik Lundh <[email protected]>
+ * Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com
+ * Copyright (c) 2004 by Peter Astrand <[email protected]>
+ *
+ * By obtaining, using, and/or copying this software and/or its
+ * associated documentation, you agree that you have read, understood,
+ * and will comply with the following terms and conditions:
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its associated documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice appears in
+ * all copies, and that both that copyright notice and this permission
+ * notice appear in supporting documentation, and that the name of the
+ * authors not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission.
+ *
+ * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/* Licensed to PSF under a Contributor Agreement. */
+/* See https://www.python.org/2.4/license for licensing details. */
+
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "structmember.h" // PyMemberDef
+
+
+#ifndef WINDOWS_LEAN_AND_MEAN
+#define WINDOWS_LEAN_AND_MEAN
+#endif
+#include "windows.h"
+#include <winioctl.h>
+#include <crtdbg.h>
+#include "winreparse.h"
+
+#if defined(MS_WIN32) && !defined(MS_WIN64)
+#define HANDLE_TO_PYNUM(handle) \
+ PyLong_FromUnsignedLong((unsigned long) handle)
+#define PYNUM_TO_HANDLE(obj) ((HANDLE)PyLong_AsUnsignedLong(obj))
+#define F_POINTER "k"
+#define T_POINTER T_ULONG
+#else
+#define HANDLE_TO_PYNUM(handle) \
+ PyLong_FromUnsignedLongLong((unsigned long long) handle)
+#define PYNUM_TO_HANDLE(obj) ((HANDLE)PyLong_AsUnsignedLongLong(obj))
+#define F_POINTER "K"
+#define T_POINTER T_ULONGLONG
+#endif
+
+#define F_HANDLE F_POINTER
+#define F_DWORD "k"
+
+#define T_HANDLE T_POINTER
+
+// winbase.h limits the STARTF_* flags to the desktop API as of 10.0.19041.
+#ifndef STARTF_USESHOWWINDOW
+#define STARTF_USESHOWWINDOW 0x00000001
+#endif
+#ifndef STARTF_USESTDHANDLES
+#define STARTF_USESTDHANDLES 0x00000100
+#endif
+
+typedef struct {
+ PyTypeObject *overlapped_type;
+} WinApiState;
+
+static inline WinApiState*
+winapi_get_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (WinApiState *)state;
+}
+
+/*
+ * A Python object wrapping an OVERLAPPED structure and other useful data
+ * for overlapped I/O
+ */
+
+typedef struct {
+ PyObject_HEAD
+ OVERLAPPED overlapped;
+ /* For convenience, we store the file handle too */
+ HANDLE handle;
+ /* Whether there's I/O in flight */
+ int pending;
+ /* Whether I/O completed successfully */
+ int completed;
+ /* Buffer used for reading (optional) */
+ PyObject *read_buffer;
+ /* Buffer used for writing (optional) */
+ Py_buffer write_buffer;
+} OverlappedObject;
+
+/*
+Note: tp_clear (overlapped_clear) is not implemented because it
+requires cancelling the IO operation if it's pending and the cancellation is
+quite complex and can fail (see: overlapped_dealloc).
+*/
+static int
+overlapped_traverse(OverlappedObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->read_buffer);
+ Py_VISIT(self->write_buffer.obj);
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+overlapped_dealloc(OverlappedObject *self)
+{
+ DWORD bytes;
+ int err = GetLastError();
+
+ PyObject_GC_UnTrack(self);
+ if (self->pending) {
+ if (CancelIoEx(self->handle, &self->overlapped) &&
+ GetOverlappedResult(self->handle, &self->overlapped, &bytes, TRUE))
+ {
+ /* The operation is no longer pending -- nothing to do. */
+ }
+ else if (_Py_IsInterpreterFinalizing(PyInterpreterState_Get()))
+ {
+ /* The operation is still pending -- give a warning. This
+ will probably only happen on Windows XP. */
+ PyErr_SetString(PyExc_RuntimeError,
+ "I/O operations still in flight while destroying "
+ "Overlapped object, the process may crash");
+ PyErr_WriteUnraisable(NULL);
+ }
+ else
+ {
+ /* The operation is still pending, but the process is
+ probably about to exit, so we need not worry too much
+ about memory leaks. Leaking self prevents a potential
+ crash. This can happen when a daemon thread is cleaned
+ up at exit -- see #19565. We only expect to get here
+ on Windows XP. */
+ CloseHandle(self->overlapped.hEvent);
+ SetLastError(err);
+ return;
+ }
+ }
+
+ CloseHandle(self->overlapped.hEvent);
+ SetLastError(err);
+ if (self->write_buffer.obj)
+ PyBuffer_Release(&self->write_buffer);
+ Py_CLEAR(self->read_buffer);
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+module _winapi
+class _winapi.Overlapped "OverlappedObject *" "&OverlappedType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c13d3f5fd1dabb84]*/
+
+/*[python input]
+def create_converter(type_, format_unit):
+ name = type_ + '_converter'
+ # registered upon creation by CConverter's metaclass
+ type(name, (CConverter,), {'type': type_, 'format_unit': format_unit})
+
+# format unit differs between platforms for these
+create_converter('HANDLE', '" F_HANDLE "')
+create_converter('HMODULE', '" F_HANDLE "')
+create_converter('LPSECURITY_ATTRIBUTES', '" F_POINTER "')
+create_converter('LPCVOID', '" F_POINTER "')
+
+create_converter('BOOL', 'i') # F_BOOL used previously (always 'i')
+create_converter('DWORD', 'k') # F_DWORD is always "k" (which is much shorter)
+create_converter('LPCTSTR', 's')
+create_converter('UINT', 'I') # F_UINT used previously (always 'I')
+
+class LPCWSTR_converter(Py_UNICODE_converter):
+ type = 'LPCWSTR'
+
+class HANDLE_return_converter(CReturnConverter):
+ type = 'HANDLE'
+
+ def render(self, function, data):
+ self.declare(data)
+ self.err_occurred_if("_return_value == INVALID_HANDLE_VALUE", data)
+ data.return_conversion.append(
+ 'if (_return_value == NULL) {\n Py_RETURN_NONE;\n}\n')
+ data.return_conversion.append(
+ 'return_value = HANDLE_TO_PYNUM(_return_value);\n')
+
+class DWORD_return_converter(CReturnConverter):
+ type = 'DWORD'
+
+ def render(self, function, data):
+ self.declare(data)
+ self.err_occurred_if("_return_value == PY_DWORD_MAX", data)
+ data.return_conversion.append(
+ 'return_value = Py_BuildValue("k", _return_value);\n')
+
+class LPVOID_return_converter(CReturnConverter):
+ type = 'LPVOID'
+
+ def render(self, function, data):
+ self.declare(data)
+ self.err_occurred_if("_return_value == NULL", data)
+ data.return_conversion.append(
+ 'return_value = HANDLE_TO_PYNUM(_return_value);\n')
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=011ee0c3a2244bfe]*/
+
+#include "clinic/_winapi.c.h"
+
+/*[clinic input]
+_winapi.Overlapped.GetOverlappedResult
+
+ wait: bool
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_Overlapped_GetOverlappedResult_impl(OverlappedObject *self, int wait)
+/*[clinic end generated code: output=bdd0c1ed6518cd03 input=194505ee8e0e3565]*/
+{
+ BOOL res;
+ DWORD transferred = 0;
+ DWORD err;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = GetOverlappedResult(self->handle, &self->overlapped, &transferred,
+ wait != 0);
+ Py_END_ALLOW_THREADS
+
+ err = res ? ERROR_SUCCESS : GetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_MORE_DATA:
+ case ERROR_OPERATION_ABORTED:
+ self->completed = 1;
+ self->pending = 0;
+ break;
+ case ERROR_IO_INCOMPLETE:
+ break;
+ default:
+ self->pending = 0;
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, err);
+ }
+ if (self->completed && self->read_buffer != NULL) {
+ assert(PyBytes_CheckExact(self->read_buffer));
+ if (transferred != PyBytes_GET_SIZE(self->read_buffer) &&
+ _PyBytes_Resize(&self->read_buffer, transferred))
+ return NULL;
+ }
+ return Py_BuildValue("II", (unsigned) transferred, (unsigned) err);
+}
+
+/*[clinic input]
+_winapi.Overlapped.getbuffer
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_Overlapped_getbuffer_impl(OverlappedObject *self)
+/*[clinic end generated code: output=95a3eceefae0f748 input=347fcfd56b4ceabd]*/
+{
+ PyObject *res;
+ if (!self->completed) {
+ PyErr_SetString(PyExc_ValueError,
+ "can't get read buffer before GetOverlappedResult() "
+ "signals the operation completed");
+ return NULL;
+ }
+ res = self->read_buffer ? self->read_buffer : Py_None;
+ return Py_NewRef(res);
+}
+
+/*[clinic input]
+_winapi.Overlapped.cancel
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_Overlapped_cancel_impl(OverlappedObject *self)
+/*[clinic end generated code: output=fcb9ab5df4ebdae5 input=cbf3da142290039f]*/
+{
+ BOOL res = TRUE;
+
+ if (self->pending) {
+ Py_BEGIN_ALLOW_THREADS
+ res = CancelIoEx(self->handle, &self->overlapped);
+ Py_END_ALLOW_THREADS
+ }
+
+ /* CancelIoEx returns ERROR_NOT_FOUND if the I/O completed in-between */
+ if (!res && GetLastError() != ERROR_NOT_FOUND)
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ self->pending = 0;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef overlapped_methods[] = {
+ _WINAPI_OVERLAPPED_GETOVERLAPPEDRESULT_METHODDEF
+ _WINAPI_OVERLAPPED_GETBUFFER_METHODDEF
+ _WINAPI_OVERLAPPED_CANCEL_METHODDEF
+ {NULL}
+};
+
+static PyMemberDef overlapped_members[] = {
+ {"event", T_HANDLE,
+ offsetof(OverlappedObject, overlapped) + offsetof(OVERLAPPED, hEvent),
+ READONLY, "overlapped event handle"},
+ {NULL}
+};
+
+static PyType_Slot winapi_overlapped_type_slots[] = {
+ {Py_tp_traverse, overlapped_traverse},
+ {Py_tp_dealloc, overlapped_dealloc},
+ {Py_tp_doc, "OVERLAPPED structure wrapper"},
+ {Py_tp_methods, overlapped_methods},
+ {Py_tp_members, overlapped_members},
+ {0,0}
+};
+
+static PyType_Spec winapi_overlapped_type_spec = {
+ .name = "_winapi.Overlapped",
+ .basicsize = sizeof(OverlappedObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = winapi_overlapped_type_slots,
+};
+
+static OverlappedObject *
+new_overlapped(PyObject *module, HANDLE handle)
+{
+ WinApiState *st = winapi_get_state(module);
+ OverlappedObject *self = PyObject_GC_New(OverlappedObject, st->overlapped_type);
+ if (!self)
+ return NULL;
+
+ self->handle = handle;
+ self->read_buffer = NULL;
+ self->pending = 0;
+ self->completed = 0;
+ memset(&self->overlapped, 0, sizeof(OVERLAPPED));
+ memset(&self->write_buffer, 0, sizeof(Py_buffer));
+ /* Manual reset, initially non-signalled */
+ self->overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+
+ PyObject_GC_Track(self);
+ return self;
+}
+
+/* -------------------------------------------------------------------- */
+/* windows API functions */
+
+/*[clinic input]
+_winapi.CloseHandle
+
+ handle: HANDLE
+ /
+
+Close handle.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_CloseHandle_impl(PyObject *module, HANDLE handle)
+/*[clinic end generated code: output=7ad37345f07bd782 input=7f0e4ac36e0352b8]*/
+{
+ BOOL success;
+
+ Py_BEGIN_ALLOW_THREADS
+ success = CloseHandle(handle);
+ Py_END_ALLOW_THREADS
+
+ if (!success)
+ return PyErr_SetFromWindowsErr(0);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_winapi.ConnectNamedPipe
+
+ handle: HANDLE
+ overlapped as use_overlapped: bool = False
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
+ int use_overlapped)
+/*[clinic end generated code: output=335a0e7086800671 input=a80e56e8bd370e31]*/
+{
+ BOOL success;
+ OverlappedObject *overlapped = NULL;
+
+ if (use_overlapped) {
+ overlapped = new_overlapped(module, handle);
+ if (!overlapped)
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ success = ConnectNamedPipe(handle,
+ overlapped ? &overlapped->overlapped : NULL);
+ Py_END_ALLOW_THREADS
+
+ if (overlapped) {
+ int err = GetLastError();
+ /* Overlapped ConnectNamedPipe never returns a success code */
+ assert(success == 0);
+ if (err == ERROR_IO_PENDING)
+ overlapped->pending = 1;
+ else if (err == ERROR_PIPE_CONNECTED)
+ SetEvent(overlapped->overlapped.hEvent);
+ else {
+ Py_DECREF(overlapped);
+ return PyErr_SetFromWindowsErr(err);
+ }
+ return (PyObject *) overlapped;
+ }
+ if (!success)
+ return PyErr_SetFromWindowsErr(0);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_winapi.CreateFile -> HANDLE
+
+ file_name: LPCWSTR
+ desired_access: DWORD
+ share_mode: DWORD
+ security_attributes: LPSECURITY_ATTRIBUTES
+ creation_disposition: DWORD
+ flags_and_attributes: DWORD
+ template_file: HANDLE
+ /
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_CreateFile_impl(PyObject *module, LPCWSTR file_name,
+ DWORD desired_access, DWORD share_mode,
+ LPSECURITY_ATTRIBUTES security_attributes,
+ DWORD creation_disposition,
+ DWORD flags_and_attributes, HANDLE template_file)
+/*[clinic end generated code: output=818c811e5e04d550 input=1fa870ed1c2e3d69]*/
+{
+ HANDLE handle;
+
+ if (PySys_Audit("_winapi.CreateFile", "uIIII",
+ file_name, desired_access, share_mode,
+ creation_disposition, flags_and_attributes) < 0) {
+ return INVALID_HANDLE_VALUE;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ handle = CreateFileW(file_name, desired_access,
+ share_mode, security_attributes,
+ creation_disposition,
+ flags_and_attributes, template_file);
+ Py_END_ALLOW_THREADS
+
+ if (handle == INVALID_HANDLE_VALUE) {
+ PyErr_SetFromWindowsErr(0);
+ }
+
+ return handle;
+}
+
+/*[clinic input]
+_winapi.CreateFileMapping -> HANDLE
+
+ file_handle: HANDLE
+ security_attributes: LPSECURITY_ATTRIBUTES
+ protect: DWORD
+ max_size_high: DWORD
+ max_size_low: DWORD
+ name: LPCWSTR
+ /
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_CreateFileMapping_impl(PyObject *module, HANDLE file_handle,
+ LPSECURITY_ATTRIBUTES security_attributes,
+ DWORD protect, DWORD max_size_high,
+ DWORD max_size_low, LPCWSTR name)
+/*[clinic end generated code: output=6c0a4d5cf7f6fcc6 input=3dc5cf762a74dee8]*/
+{
+ HANDLE handle;
+
+ Py_BEGIN_ALLOW_THREADS
+ handle = CreateFileMappingW(file_handle, security_attributes,
+ protect, max_size_high, max_size_low,
+ name);
+ Py_END_ALLOW_THREADS
+
+ if (handle == NULL) {
+ PyObject *temp = PyUnicode_FromWideChar(name, -1);
+ PyErr_SetExcFromWindowsErrWithFilenameObject(PyExc_OSError, 0, temp);
+ Py_XDECREF(temp);
+ handle = INVALID_HANDLE_VALUE;
+ }
+
+ return handle;
+}
+
+/*[clinic input]
+_winapi.CreateJunction
+
+ src_path: LPCWSTR
+ dst_path: LPCWSTR
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_CreateJunction_impl(PyObject *module, LPCWSTR src_path,
+ LPCWSTR dst_path)
+/*[clinic end generated code: output=44b3f5e9bbcc4271 input=963d29b44b9384a7]*/
+{
+ /* Privilege adjustment */
+ HANDLE token = NULL;
+ struct {
+ TOKEN_PRIVILEGES base;
+ /* overallocate by a few array elements */
+ LUID_AND_ATTRIBUTES privs[4];
+ } tp, previousTp;
+ int previousTpSize = 0;
+
+ /* Reparse data buffer */
+ const USHORT prefix_len = 4;
+ USHORT print_len = 0;
+ USHORT rdb_size = 0;
+ _Py_PREPARSE_DATA_BUFFER rdb = NULL;
+
+ /* Junction point creation */
+ HANDLE junction = NULL;
+ DWORD ret = 0;
+
+ if (src_path == NULL || dst_path == NULL)
+ return PyErr_SetFromWindowsErr(ERROR_INVALID_PARAMETER);
+
+ if (wcsncmp(src_path, L"\\??\\", prefix_len) == 0)
+ return PyErr_SetFromWindowsErr(ERROR_INVALID_PARAMETER);
+
+ if (PySys_Audit("_winapi.CreateJunction", "uu", src_path, dst_path) < 0) {
+ return NULL;
+ }
+
+ /* Adjust privileges to allow rewriting directory entry as a
+ junction point. */
+ if (!OpenProcessToken(GetCurrentProcess(),
+ TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) {
+ goto cleanup;
+ }
+
+ if (!LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &tp.base.Privileges[0].Luid)) {
+ goto cleanup;
+ }
+
+ tp.base.PrivilegeCount = 1;
+ tp.base.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+ if (!AdjustTokenPrivileges(token, FALSE, &tp.base, sizeof(previousTp),
+ &previousTp.base, &previousTpSize)) {
+ goto cleanup;
+ }
+
+ if (GetFileAttributesW(src_path) == INVALID_FILE_ATTRIBUTES)
+ goto cleanup;
+
+ /* Store the absolute link target path length in print_len. */
+ print_len = (USHORT)GetFullPathNameW(src_path, 0, NULL, NULL);
+ if (print_len == 0)
+ goto cleanup;
+
+ /* NUL terminator should not be part of print_len. */
+ --print_len;
+
+ /* REPARSE_DATA_BUFFER usage is heavily under-documented, especially for
+ junction points. Here's what I've learned along the way:
+ - A junction point has two components: a print name and a substitute
+ name. They both describe the link target, but the substitute name is
+ the physical target and the print name is shown in directory listings.
+ - The print name must be a native name, prefixed with "\??\".
+ - Both names are stored after each other in the same buffer (the
+ PathBuffer) and both must be NUL-terminated.
+ - There are four members defining their respective offset and length
+ inside PathBuffer: SubstituteNameOffset, SubstituteNameLength,
+ PrintNameOffset and PrintNameLength.
+ - The total size we need to allocate for the REPARSE_DATA_BUFFER, thus,
+ is the sum of:
+ - the fixed header size (REPARSE_DATA_BUFFER_HEADER_SIZE)
+ - the size of the MountPointReparseBuffer member without the PathBuffer
+ - the size of the prefix ("\??\") in bytes
+ - the size of the print name in bytes
+ - the size of the substitute name in bytes
+ - the size of two NUL terminators in bytes */
+ rdb_size = _Py_REPARSE_DATA_BUFFER_HEADER_SIZE +
+ sizeof(rdb->MountPointReparseBuffer) -
+ sizeof(rdb->MountPointReparseBuffer.PathBuffer) +
+ /* Two +1's for NUL terminators. */
+ (prefix_len + print_len + 1 + print_len + 1) * sizeof(WCHAR);
+ rdb = (_Py_PREPARSE_DATA_BUFFER)PyMem_RawCalloc(1, rdb_size);
+ if (rdb == NULL)
+ goto cleanup;
+
+ rdb->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
+ rdb->ReparseDataLength = rdb_size - _Py_REPARSE_DATA_BUFFER_HEADER_SIZE;
+ rdb->MountPointReparseBuffer.SubstituteNameOffset = 0;
+ rdb->MountPointReparseBuffer.SubstituteNameLength =
+ (prefix_len + print_len) * sizeof(WCHAR);
+ rdb->MountPointReparseBuffer.PrintNameOffset =
+ rdb->MountPointReparseBuffer.SubstituteNameLength + sizeof(WCHAR);
+ rdb->MountPointReparseBuffer.PrintNameLength = print_len * sizeof(WCHAR);
+
+ /* Store the full native path of link target at the substitute name
+ offset (0). */
+ wcscpy(rdb->MountPointReparseBuffer.PathBuffer, L"\\??\\");
+ if (GetFullPathNameW(src_path, print_len + 1,
+ rdb->MountPointReparseBuffer.PathBuffer + prefix_len,
+ NULL) == 0)
+ goto cleanup;
+
+ /* Copy everything but the native prefix to the print name offset. */
+ wcscpy(rdb->MountPointReparseBuffer.PathBuffer +
+ prefix_len + print_len + 1,
+ rdb->MountPointReparseBuffer.PathBuffer + prefix_len);
+
+ /* Create a directory for the junction point. */
+ if (!CreateDirectoryW(dst_path, NULL))
+ goto cleanup;
+
+ junction = CreateFileW(dst_path, GENERIC_READ | GENERIC_WRITE, 0, NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (junction == INVALID_HANDLE_VALUE)
+ goto cleanup;
+
+ /* Make the directory entry a junction point. */
+ if (!DeviceIoControl(junction, FSCTL_SET_REPARSE_POINT, rdb, rdb_size,
+ NULL, 0, &ret, NULL))
+ goto cleanup;
+
+cleanup:
+ ret = GetLastError();
+
+ if (previousTpSize) {
+ AdjustTokenPrivileges(token, FALSE, &previousTp.base, previousTpSize,
+ NULL, NULL);
+ }
+
+ if (token != NULL)
+ CloseHandle(token);
+ if (junction != NULL)
+ CloseHandle(junction);
+ PyMem_RawFree(rdb);
+
+ if (ret != 0)
+ return PyErr_SetFromWindowsErr(ret);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_winapi.CreateNamedPipe -> HANDLE
+
+ name: LPCTSTR
+ open_mode: DWORD
+ pipe_mode: DWORD
+ max_instances: DWORD
+ out_buffer_size: DWORD
+ in_buffer_size: DWORD
+ default_timeout: DWORD
+ security_attributes: LPSECURITY_ATTRIBUTES
+ /
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode,
+ DWORD pipe_mode, DWORD max_instances,
+ DWORD out_buffer_size, DWORD in_buffer_size,
+ DWORD default_timeout,
+ LPSECURITY_ATTRIBUTES security_attributes)
+/*[clinic end generated code: output=80f8c07346a94fbc input=5a73530b84d8bc37]*/
+{
+ HANDLE handle;
+
+ if (PySys_Audit("_winapi.CreateNamedPipe", "uII",
+ name, open_mode, pipe_mode) < 0) {
+ return INVALID_HANDLE_VALUE;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ handle = CreateNamedPipe(name, open_mode, pipe_mode,
+ max_instances, out_buffer_size,
+ in_buffer_size, default_timeout,
+ security_attributes);
+ Py_END_ALLOW_THREADS
+
+ if (handle == INVALID_HANDLE_VALUE)
+ PyErr_SetFromWindowsErr(0);
+
+ return handle;
+}
+
+/*[clinic input]
+_winapi.CreatePipe
+
+ pipe_attrs: object
+ Ignored internally, can be None.
+ size: DWORD
+ /
+
+Create an anonymous pipe.
+
+Returns a 2-tuple of handles, to the read and write ends of the pipe.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_CreatePipe_impl(PyObject *module, PyObject *pipe_attrs, DWORD size)
+/*[clinic end generated code: output=1c4411d8699f0925 input=c4f2cfa56ef68d90]*/
+{
+ HANDLE read_pipe;
+ HANDLE write_pipe;
+ BOOL result;
+
+ if (PySys_Audit("_winapi.CreatePipe", NULL) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ result = CreatePipe(&read_pipe, &write_pipe, NULL, size);
+ Py_END_ALLOW_THREADS
+
+ if (! result)
+ return PyErr_SetFromWindowsErr(GetLastError());
+
+ return Py_BuildValue(
+ "NN", HANDLE_TO_PYNUM(read_pipe), HANDLE_TO_PYNUM(write_pipe));
+}
+
+/* helpers for createprocess */
+
+static unsigned long
+getulong(PyObject* obj, const char* name)
+{
+ PyObject* value;
+ unsigned long ret;
+
+ value = PyObject_GetAttrString(obj, name);
+ if (! value) {
+ PyErr_Clear(); /* FIXME: propagate error? */
+ return 0;
+ }
+ ret = PyLong_AsUnsignedLong(value);
+ Py_DECREF(value);
+ return ret;
+}
+
+static HANDLE
+gethandle(PyObject* obj, const char* name)
+{
+ PyObject* value;
+ HANDLE ret;
+
+ value = PyObject_GetAttrString(obj, name);
+ if (! value) {
+ PyErr_Clear(); /* FIXME: propagate error? */
+ return NULL;
+ }
+ if (value == Py_None)
+ ret = NULL;
+ else
+ ret = PYNUM_TO_HANDLE(value);
+ Py_DECREF(value);
+ return ret;
+}
+
+static PyObject *
+sortenvironmentkey(PyObject *module, PyObject *item)
+{
+ return _winapi_LCMapStringEx_impl(NULL, LOCALE_NAME_INVARIANT,
+ LCMAP_UPPERCASE, item);
+}
+
+static PyMethodDef sortenvironmentkey_def = {
+ "sortenvironmentkey", _PyCFunction_CAST(sortenvironmentkey), METH_O, "",
+};
+
+static int
+sort_environment_keys(PyObject *keys)
+{
+ PyObject *keyfunc = PyCFunction_New(&sortenvironmentkey_def, NULL);
+ if (keyfunc == NULL) {
+ return -1;
+ }
+ PyObject *kwnames = Py_BuildValue("(s)", "key");
+ if (kwnames == NULL) {
+ Py_DECREF(keyfunc);
+ return -1;
+ }
+ PyObject *args[] = { keys, keyfunc };
+ PyObject *ret = PyObject_VectorcallMethod(&_Py_ID(sort), args, 1, kwnames);
+ Py_DECREF(keyfunc);
+ Py_DECREF(kwnames);
+ if (ret == NULL) {
+ return -1;
+ }
+ Py_DECREF(ret);
+
+ return 0;
+}
+
+static int
+compare_string_ordinal(PyObject *str1, PyObject *str2, int *result)
+{
+ wchar_t *s1 = PyUnicode_AsWideCharString(str1, NULL);
+ if (s1 == NULL) {
+ return -1;
+ }
+ wchar_t *s2 = PyUnicode_AsWideCharString(str2, NULL);
+ if (s2 == NULL) {
+ PyMem_Free(s1);
+ return -1;
+ }
+ *result = CompareStringOrdinal(s1, -1, s2, -1, TRUE);
+ PyMem_Free(s1);
+ PyMem_Free(s2);
+ return 0;
+}
+
+static PyObject *
+dedup_environment_keys(PyObject *keys)
+{
+ PyObject *result = PyList_New(0);
+ if (result == NULL) {
+ return NULL;
+ }
+
+ // Iterate over the pre-ordered keys, check whether the current key is equal
+ // to the next key (ignoring case), if different, insert the current value
+ // into the result list. If they are equal, do nothing because we always
+ // want to keep the last inserted one.
+ for (Py_ssize_t i = 0; i < PyList_GET_SIZE(keys); i++) {
+ PyObject *key = PyList_GET_ITEM(keys, i);
+
+ // The last key will always be kept.
+ if (i + 1 == PyList_GET_SIZE(keys)) {
+ if (PyList_Append(result, key) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ continue;
+ }
+
+ PyObject *next_key = PyList_GET_ITEM(keys, i + 1);
+ int compare_result;
+ if (compare_string_ordinal(key, next_key, &compare_result) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (compare_result == CSTR_EQUAL) {
+ continue;
+ }
+ if (PyList_Append(result, key) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+
+ return result;
+}
+
+static PyObject *
+normalize_environment(PyObject *environment)
+{
+ PyObject *keys = PyMapping_Keys(environment);
+ if (keys == NULL) {
+ return NULL;
+ }
+
+ if (sort_environment_keys(keys) < 0) {
+ Py_DECREF(keys);
+ return NULL;
+ }
+
+ PyObject *normalized_keys = dedup_environment_keys(keys);
+ Py_DECREF(keys);
+ if (normalized_keys == NULL) {
+ return NULL;
+ }
+
+ PyObject *result = PyDict_New();
+ if (result == NULL) {
+ Py_DECREF(normalized_keys);
+ return NULL;
+ }
+
+ for (int i = 0; i < PyList_GET_SIZE(normalized_keys); i++) {
+ PyObject *key = PyList_GET_ITEM(normalized_keys, i);
+ PyObject *value = PyObject_GetItem(environment, key);
+ if (value == NULL) {
+ Py_DECREF(normalized_keys);
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ int ret = PyObject_SetItem(result, key, value);
+ Py_DECREF(value);
+ if (ret < 0) {
+ Py_DECREF(normalized_keys);
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+
+ Py_DECREF(normalized_keys);
+
+ return result;
+}
+
+static wchar_t *
+getenvironment(PyObject* environment)
+{
+ Py_ssize_t i, envsize, totalsize;
+ wchar_t *buffer = NULL, *p, *end;
+ PyObject *normalized_environment = NULL;
+ PyObject *keys = NULL;
+ PyObject *values = NULL;
+
+ /* convert environment dictionary to windows environment string */
+ if (! PyMapping_Check(environment)) {
+ PyErr_SetString(
+ PyExc_TypeError, "environment must be dictionary or None");
+ return NULL;
+ }
+
+ normalized_environment = normalize_environment(environment);
+ if (normalize_environment == NULL) {
+ return NULL;
+ }
+
+ keys = PyMapping_Keys(normalized_environment);
+ if (!keys) {
+ goto error;
+ }
+ values = PyMapping_Values(normalized_environment);
+ if (!values) {
+ goto error;
+ }
+
+ envsize = PyList_GET_SIZE(keys);
+
+ if (envsize == 0) {
+ // A environment block must be terminated by two null characters --
+ // one for the last string and one for the block.
+ buffer = PyMem_Calloc(2, sizeof(wchar_t));
+ if (!buffer) {
+ PyErr_NoMemory();
+ }
+ goto cleanup;
+ }
+
+ if (PyList_GET_SIZE(values) != envsize) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "environment changed size during iteration");
+ goto error;
+ }
+
+ totalsize = 1; /* trailing null character */
+ for (i = 0; i < envsize; i++) {
+ PyObject* key = PyList_GET_ITEM(keys, i);
+ PyObject* value = PyList_GET_ITEM(values, i);
+ Py_ssize_t size;
+
+ if (! PyUnicode_Check(key) || ! PyUnicode_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "environment can only contain strings");
+ goto error;
+ }
+ if (PyUnicode_FindChar(key, '\0', 0, PyUnicode_GET_LENGTH(key), 1) != -1 ||
+ PyUnicode_FindChar(value, '\0', 0, PyUnicode_GET_LENGTH(value), 1) != -1)
+ {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto error;
+ }
+ /* Search from index 1 because on Windows starting '=' is allowed for
+ defining hidden environment variables. */
+ if (PyUnicode_GET_LENGTH(key) == 0 ||
+ PyUnicode_FindChar(key, '=', 1, PyUnicode_GET_LENGTH(key), 1) != -1)
+ {
+ PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
+ goto error;
+ }
+
+ size = PyUnicode_AsWideChar(key, NULL, 0);
+ assert(size > 1);
+ if (totalsize > PY_SSIZE_T_MAX - size) {
+ PyErr_SetString(PyExc_OverflowError, "environment too long");
+ goto error;
+ }
+ totalsize += size; /* including '=' */
+
+ size = PyUnicode_AsWideChar(value, NULL, 0);
+ assert(size > 0);
+ if (totalsize > PY_SSIZE_T_MAX - size) {
+ PyErr_SetString(PyExc_OverflowError, "environment too long");
+ goto error;
+ }
+ totalsize += size; /* including trailing '\0' */
+ }
+
+ buffer = PyMem_NEW(wchar_t, totalsize);
+ if (! buffer) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ p = buffer;
+ end = buffer + totalsize;
+
+ for (i = 0; i < envsize; i++) {
+ PyObject* key = PyList_GET_ITEM(keys, i);
+ PyObject* value = PyList_GET_ITEM(values, i);
+ Py_ssize_t size = PyUnicode_AsWideChar(key, p, end - p);
+ assert(1 <= size && size < end - p);
+ p += size;
+ *p++ = L'=';
+ size = PyUnicode_AsWideChar(value, p, end - p);
+ assert(0 <= size && size < end - p);
+ p += size + 1;
+ }
+
+ /* add trailing null character */
+ *p++ = L'\0';
+ assert(p == end);
+
+cleanup:
+error:
+ Py_XDECREF(normalized_environment);
+ Py_XDECREF(keys);
+ Py_XDECREF(values);
+ return buffer;
+}
+
+static LPHANDLE
+gethandlelist(PyObject *mapping, const char *name, Py_ssize_t *size)
+{
+ LPHANDLE ret = NULL;
+ PyObject *value_fast = NULL;
+ PyObject *value;
+ Py_ssize_t i;
+
+ value = PyMapping_GetItemString(mapping, name);
+ if (!value) {
+ PyErr_Clear();
+ return NULL;
+ }
+
+ if (value == Py_None) {
+ goto cleanup;
+ }
+
+ value_fast = PySequence_Fast(value, "handle_list must be a sequence or None");
+ if (value_fast == NULL)
+ goto cleanup;
+
+ *size = PySequence_Fast_GET_SIZE(value_fast) * sizeof(HANDLE);
+
+ /* Passing an empty array causes CreateProcess to fail so just don't set it */
+ if (*size == 0) {
+ goto cleanup;
+ }
+
+ ret = PyMem_Malloc(*size);
+ if (ret == NULL)
+ goto cleanup;
+
+ for (i = 0; i < PySequence_Fast_GET_SIZE(value_fast); i++) {
+ ret[i] = PYNUM_TO_HANDLE(PySequence_Fast_GET_ITEM(value_fast, i));
+ if (ret[i] == (HANDLE)-1 && PyErr_Occurred()) {
+ PyMem_Free(ret);
+ ret = NULL;
+ goto cleanup;
+ }
+ }
+
+cleanup:
+ Py_DECREF(value);
+ Py_XDECREF(value_fast);
+ return ret;
+}
+
+typedef struct {
+ LPPROC_THREAD_ATTRIBUTE_LIST attribute_list;
+ LPHANDLE handle_list;
+} AttributeList;
+
+static void
+freeattributelist(AttributeList *attribute_list)
+{
+ if (attribute_list->attribute_list != NULL) {
+ DeleteProcThreadAttributeList(attribute_list->attribute_list);
+ PyMem_Free(attribute_list->attribute_list);
+ }
+
+ PyMem_Free(attribute_list->handle_list);
+
+ memset(attribute_list, 0, sizeof(*attribute_list));
+}
+
+static int
+getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list)
+{
+ int ret = 0;
+ DWORD err;
+ BOOL result;
+ PyObject *value;
+ Py_ssize_t handle_list_size;
+ DWORD attribute_count = 0;
+ SIZE_T attribute_list_size = 0;
+
+ value = PyObject_GetAttrString(obj, name);
+ if (!value) {
+ PyErr_Clear(); /* FIXME: propagate error? */
+ return 0;
+ }
+
+ if (value == Py_None) {
+ ret = 0;
+ goto cleanup;
+ }
+
+ if (!PyMapping_Check(value)) {
+ ret = -1;
+ PyErr_Format(PyExc_TypeError, "%s must be a mapping or None", name);
+ goto cleanup;
+ }
+
+ attribute_list->handle_list = gethandlelist(value, "handle_list", &handle_list_size);
+ if (attribute_list->handle_list == NULL && PyErr_Occurred()) {
+ ret = -1;
+ goto cleanup;
+ }
+
+ if (attribute_list->handle_list != NULL)
+ ++attribute_count;
+
+ /* Get how many bytes we need for the attribute list */
+ result = InitializeProcThreadAttributeList(NULL, attribute_count, 0, &attribute_list_size);
+ if (result || GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
+ ret = -1;
+ PyErr_SetFromWindowsErr(GetLastError());
+ goto cleanup;
+ }
+
+ attribute_list->attribute_list = PyMem_Malloc(attribute_list_size);
+ if (attribute_list->attribute_list == NULL) {
+ ret = -1;
+ goto cleanup;
+ }
+
+ result = InitializeProcThreadAttributeList(
+ attribute_list->attribute_list,
+ attribute_count,
+ 0,
+ &attribute_list_size);
+ if (!result) {
+ err = GetLastError();
+
+ /* So that we won't call DeleteProcThreadAttributeList */
+ PyMem_Free(attribute_list->attribute_list);
+ attribute_list->attribute_list = NULL;
+
+ ret = -1;
+ PyErr_SetFromWindowsErr(err);
+ goto cleanup;
+ }
+
+ if (attribute_list->handle_list != NULL) {
+ result = UpdateProcThreadAttribute(
+ attribute_list->attribute_list,
+ 0,
+ PROC_THREAD_ATTRIBUTE_HANDLE_LIST,
+ attribute_list->handle_list,
+ handle_list_size,
+ NULL,
+ NULL);
+ if (!result) {
+ ret = -1;
+ PyErr_SetFromWindowsErr(GetLastError());
+ goto cleanup;
+ }
+ }
+
+cleanup:
+ Py_DECREF(value);
+
+ if (ret < 0)
+ freeattributelist(attribute_list);
+
+ return ret;
+}
+
+/*[clinic input]
+_winapi.CreateProcess
+
+ application_name: Py_UNICODE(accept={str, NoneType})
+ command_line: object
+ Can be str or None
+ proc_attrs: object
+ Ignored internally, can be None.
+ thread_attrs: object
+ Ignored internally, can be None.
+ inherit_handles: BOOL
+ creation_flags: DWORD
+ env_mapping: object
+ current_directory: Py_UNICODE(accept={str, NoneType})
+ startup_info: object
+ /
+
+Create a new process and its primary thread.
+
+The return value is a tuple of the process handle, thread handle,
+process ID, and thread ID.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_CreateProcess_impl(PyObject *module,
+ const Py_UNICODE *application_name,
+ PyObject *command_line, PyObject *proc_attrs,
+ PyObject *thread_attrs, BOOL inherit_handles,
+ DWORD creation_flags, PyObject *env_mapping,
+ const Py_UNICODE *current_directory,
+ PyObject *startup_info)
+/*[clinic end generated code: output=9b2423a609230132 input=42ac293eaea03fc4]*/
+{
+ PyObject *ret = NULL;
+ BOOL result;
+ PROCESS_INFORMATION pi;
+ STARTUPINFOEXW si;
+ wchar_t *wenvironment = NULL;
+ wchar_t *command_line_copy = NULL;
+ AttributeList attribute_list = {0};
+
+ if (PySys_Audit("_winapi.CreateProcess", "uuu", application_name,
+ command_line, current_directory) < 0) {
+ return NULL;
+ }
+
+ ZeroMemory(&si, sizeof(si));
+ si.StartupInfo.cb = sizeof(si);
+
+ /* note: we only support a small subset of all SI attributes */
+ si.StartupInfo.dwFlags = getulong(startup_info, "dwFlags");
+ si.StartupInfo.wShowWindow = (WORD)getulong(startup_info, "wShowWindow");
+ si.StartupInfo.hStdInput = gethandle(startup_info, "hStdInput");
+ si.StartupInfo.hStdOutput = gethandle(startup_info, "hStdOutput");
+ si.StartupInfo.hStdError = gethandle(startup_info, "hStdError");
+ if (PyErr_Occurred())
+ goto cleanup;
+
+ if (env_mapping != Py_None) {
+ wenvironment = getenvironment(env_mapping);
+ if (wenvironment == NULL) {
+ goto cleanup;
+ }
+ }
+
+ if (getattributelist(startup_info, "lpAttributeList", &attribute_list) < 0)
+ goto cleanup;
+
+ si.lpAttributeList = attribute_list.attribute_list;
+ if (PyUnicode_Check(command_line)) {
+ command_line_copy = PyUnicode_AsWideCharString(command_line, NULL);
+ if (command_line_copy == NULL) {
+ goto cleanup;
+ }
+ }
+ else if (command_line != Py_None) {
+ PyErr_Format(PyExc_TypeError,
+ "CreateProcess() argument 2 must be str or None, not %s",
+ Py_TYPE(command_line)->tp_name);
+ goto cleanup;
+ }
+
+
+ Py_BEGIN_ALLOW_THREADS
+ result = CreateProcessW(application_name,
+ command_line_copy,
+ NULL,
+ NULL,
+ inherit_handles,
+ creation_flags | EXTENDED_STARTUPINFO_PRESENT |
+ CREATE_UNICODE_ENVIRONMENT,
+ wenvironment,
+ current_directory,
+ (LPSTARTUPINFOW)&si,
+ &pi);
+ Py_END_ALLOW_THREADS
+
+ if (!result) {
+ PyErr_SetFromWindowsErr(GetLastError());
+ goto cleanup;
+ }
+
+ ret = Py_BuildValue("NNkk",
+ HANDLE_TO_PYNUM(pi.hProcess),
+ HANDLE_TO_PYNUM(pi.hThread),
+ pi.dwProcessId,
+ pi.dwThreadId);
+
+cleanup:
+ PyMem_Free(command_line_copy);
+ PyMem_Free(wenvironment);
+ freeattributelist(&attribute_list);
+
+ return ret;
+}
+
+/*[clinic input]
+_winapi.DuplicateHandle -> HANDLE
+
+ source_process_handle: HANDLE
+ source_handle: HANDLE
+ target_process_handle: HANDLE
+ desired_access: DWORD
+ inherit_handle: BOOL
+ options: DWORD = 0
+ /
+
+Return a duplicate handle object.
+
+The duplicate handle refers to the same object as the original
+handle. Therefore, any changes to the object are reflected
+through both handles.
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_DuplicateHandle_impl(PyObject *module, HANDLE source_process_handle,
+ HANDLE source_handle,
+ HANDLE target_process_handle,
+ DWORD desired_access, BOOL inherit_handle,
+ DWORD options)
+/*[clinic end generated code: output=ad9711397b5dcd4e input=b933e3f2356a8c12]*/
+{
+ HANDLE target_handle;
+ BOOL result;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = DuplicateHandle(
+ source_process_handle,
+ source_handle,
+ target_process_handle,
+ &target_handle,
+ desired_access,
+ inherit_handle,
+ options
+ );
+ Py_END_ALLOW_THREADS
+
+ if (! result) {
+ PyErr_SetFromWindowsErr(GetLastError());
+ return INVALID_HANDLE_VALUE;
+ }
+
+ return target_handle;
+}
+
+/*[clinic input]
+_winapi.ExitProcess
+
+ ExitCode: UINT
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_ExitProcess_impl(PyObject *module, UINT ExitCode)
+/*[clinic end generated code: output=a387deb651175301 input=4f05466a9406c558]*/
+{
+ #if defined(Py_DEBUG)
+#ifdef MS_WINDOWS_DESKTOP
+ SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|
+ SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX);
+#endif
+ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
+ #endif
+
+ ExitProcess(ExitCode);
+
+ return NULL;
+}
+
+/*[clinic input]
+_winapi.GetCurrentProcess -> HANDLE
+
+Return a handle object for the current process.
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_GetCurrentProcess_impl(PyObject *module)
+/*[clinic end generated code: output=ddeb4dd2ffadf344 input=b213403fd4b96b41]*/
+{
+ return GetCurrentProcess();
+}
+
+/*[clinic input]
+_winapi.GetExitCodeProcess -> DWORD
+
+ process: HANDLE
+ /
+
+Return the termination status of the specified process.
+[clinic start generated code]*/
+
+static DWORD
+_winapi_GetExitCodeProcess_impl(PyObject *module, HANDLE process)
+/*[clinic end generated code: output=b4620bdf2bccf36b input=61b6bfc7dc2ee374]*/
+{
+ DWORD exit_code;
+ BOOL result;
+
+ result = GetExitCodeProcess(process, &exit_code);
+
+ if (! result) {
+ PyErr_SetFromWindowsErr(GetLastError());
+ exit_code = PY_DWORD_MAX;
+ }
+
+ return exit_code;
+}
+
+/*[clinic input]
+_winapi.GetLastError -> DWORD
+[clinic start generated code]*/
+
+static DWORD
+_winapi_GetLastError_impl(PyObject *module)
+/*[clinic end generated code: output=8585b827cb1a92c5 input=62d47fb9bce038ba]*/
+{
+ return GetLastError();
+}
+
+/*[clinic input]
+_winapi.GetModuleFileName
+
+ module_handle: HMODULE
+ /
+
+Return the fully-qualified path for the file that contains module.
+
+The module must have been loaded by the current process.
+
+The module parameter should be a handle to the loaded module
+whose path is being requested. If this parameter is 0,
+GetModuleFileName retrieves the path of the executable file
+of the current process.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_GetModuleFileName_impl(PyObject *module, HMODULE module_handle)
+/*[clinic end generated code: output=85b4b728c5160306 input=6d66ff7deca5d11f]*/
+{
+ BOOL result;
+ WCHAR filename[MAX_PATH];
+
+ Py_BEGIN_ALLOW_THREADS
+ result = GetModuleFileNameW(module_handle, filename, MAX_PATH);
+ filename[MAX_PATH-1] = '\0';
+ Py_END_ALLOW_THREADS
+
+ if (! result)
+ return PyErr_SetFromWindowsErr(GetLastError());
+
+ return PyUnicode_FromWideChar(filename, wcslen(filename));
+}
+
+/*[clinic input]
+_winapi.GetStdHandle -> HANDLE
+
+ std_handle: DWORD
+ One of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, or STD_ERROR_HANDLE.
+ /
+
+Return a handle to the specified standard device.
+
+The integer associated with the handle object is returned.
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_GetStdHandle_impl(PyObject *module, DWORD std_handle)
+/*[clinic end generated code: output=0e613001e73ab614 input=07016b06a2fc8826]*/
+{
+ HANDLE handle;
+
+ Py_BEGIN_ALLOW_THREADS
+ handle = GetStdHandle(std_handle);
+ Py_END_ALLOW_THREADS
+
+ if (handle == INVALID_HANDLE_VALUE)
+ PyErr_SetFromWindowsErr(GetLastError());
+
+ return handle;
+}
+
+/*[clinic input]
+_winapi.GetVersion -> long
+
+Return the version number of the current operating system.
+[clinic start generated code]*/
+
+static long
+_winapi_GetVersion_impl(PyObject *module)
+/*[clinic end generated code: output=e41f0db5a3b82682 input=e21dff8d0baeded2]*/
+/* Disable deprecation warnings about GetVersionEx as the result is
+ being passed straight through to the caller, who is responsible for
+ using it correctly. */
+#pragma warning(push)
+#pragma warning(disable:4996)
+
+{
+ return GetVersion();
+}
+
+#pragma warning(pop)
+
+/*[clinic input]
+_winapi.MapViewOfFile -> LPVOID
+
+ file_map: HANDLE
+ desired_access: DWORD
+ file_offset_high: DWORD
+ file_offset_low: DWORD
+ number_bytes: size_t
+ /
+[clinic start generated code]*/
+
+static LPVOID
+_winapi_MapViewOfFile_impl(PyObject *module, HANDLE file_map,
+ DWORD desired_access, DWORD file_offset_high,
+ DWORD file_offset_low, size_t number_bytes)
+/*[clinic end generated code: output=f23b1ee4823663e3 input=177471073be1a103]*/
+{
+ LPVOID address;
+
+ Py_BEGIN_ALLOW_THREADS
+ address = MapViewOfFile(file_map, desired_access, file_offset_high,
+ file_offset_low, number_bytes);
+ Py_END_ALLOW_THREADS
+
+ if (address == NULL)
+ PyErr_SetFromWindowsErr(0);
+
+ return address;
+}
+
+/*[clinic input]
+_winapi.UnmapViewOfFile
+
+ address: LPCVOID
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_UnmapViewOfFile_impl(PyObject *module, LPCVOID address)
+/*[clinic end generated code: output=4f7e18ac75d19744 input=8c4b6119ad9288a3]*/
+{
+ BOOL success;
+
+ Py_BEGIN_ALLOW_THREADS
+ success = UnmapViewOfFile(address);
+ Py_END_ALLOW_THREADS
+
+ if (!success) {
+ return PyErr_SetFromWindowsErr(0);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_winapi.OpenFileMapping -> HANDLE
+
+ desired_access: DWORD
+ inherit_handle: BOOL
+ name: LPCWSTR
+ /
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_OpenFileMapping_impl(PyObject *module, DWORD desired_access,
+ BOOL inherit_handle, LPCWSTR name)
+/*[clinic end generated code: output=08cc44def1cb11f1 input=131f2a405359de7f]*/
+{
+ HANDLE handle;
+
+ Py_BEGIN_ALLOW_THREADS
+ handle = OpenFileMappingW(desired_access, inherit_handle, name);
+ Py_END_ALLOW_THREADS
+
+ if (handle == NULL) {
+ PyObject *temp = PyUnicode_FromWideChar(name, -1);
+ PyErr_SetExcFromWindowsErrWithFilenameObject(PyExc_OSError, 0, temp);
+ Py_XDECREF(temp);
+ handle = INVALID_HANDLE_VALUE;
+ }
+
+ return handle;
+}
+
+/*[clinic input]
+_winapi.OpenProcess -> HANDLE
+
+ desired_access: DWORD
+ inherit_handle: BOOL
+ process_id: DWORD
+ /
+[clinic start generated code]*/
+
+static HANDLE
+_winapi_OpenProcess_impl(PyObject *module, DWORD desired_access,
+ BOOL inherit_handle, DWORD process_id)
+/*[clinic end generated code: output=b42b6b81ea5a0fc3 input=ec98c4cf4ea2ec36]*/
+{
+ HANDLE handle;
+
+ if (PySys_Audit("_winapi.OpenProcess", "II",
+ process_id, desired_access) < 0) {
+ return INVALID_HANDLE_VALUE;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ handle = OpenProcess(desired_access, inherit_handle, process_id);
+ Py_END_ALLOW_THREADS
+ if (handle == NULL) {
+ PyErr_SetFromWindowsErr(GetLastError());
+ handle = INVALID_HANDLE_VALUE;
+ }
+
+ return handle;
+}
+
+/*[clinic input]
+_winapi.PeekNamedPipe
+
+ handle: HANDLE
+ size: int = 0
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_PeekNamedPipe_impl(PyObject *module, HANDLE handle, int size)
+/*[clinic end generated code: output=d0c3e29e49d323dd input=c7aa53bfbce69d70]*/
+{
+ PyObject *buf = NULL;
+ DWORD nread, navail, nleft;
+ BOOL ret;
+
+ if (size < 0) {
+ PyErr_SetString(PyExc_ValueError, "negative size");
+ return NULL;
+ }
+
+ if (size) {
+ buf = PyBytes_FromStringAndSize(NULL, size);
+ if (!buf)
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+ ret = PeekNamedPipe(handle, PyBytes_AS_STRING(buf), size, &nread,
+ &navail, &nleft);
+ Py_END_ALLOW_THREADS
+ if (!ret) {
+ Py_DECREF(buf);
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ }
+ if (_PyBytes_Resize(&buf, nread))
+ return NULL;
+ return Py_BuildValue("NII", buf, navail, nleft);
+ }
+ else {
+ Py_BEGIN_ALLOW_THREADS
+ ret = PeekNamedPipe(handle, NULL, 0, NULL, &navail, &nleft);
+ Py_END_ALLOW_THREADS
+ if (!ret) {
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ }
+ return Py_BuildValue("II", navail, nleft);
+ }
+}
+
+/*[clinic input]
+_winapi.LCMapStringEx
+
+ locale: LPCWSTR
+ flags: DWORD
+ src: unicode
+
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_LCMapStringEx_impl(PyObject *module, LPCWSTR locale, DWORD flags,
+ PyObject *src)
+/*[clinic end generated code: output=b90e6b26e028ff0a input=3e3dcd9b8164012f]*/
+{
+ if (flags & (LCMAP_SORTHANDLE | LCMAP_HASH | LCMAP_BYTEREV |
+ LCMAP_SORTKEY)) {
+ return PyErr_Format(PyExc_ValueError, "unsupported flags");
+ }
+
+ Py_ssize_t src_size;
+ wchar_t *src_ = PyUnicode_AsWideCharString(src, &src_size);
+ if (!src_) {
+ return NULL;
+ }
+ if (src_size > INT_MAX) {
+ PyMem_Free(src_);
+ PyErr_SetString(PyExc_OverflowError, "input string is too long");
+ return NULL;
+ }
+
+ int dest_size = LCMapStringEx(locale, flags, src_, (int)src_size, NULL, 0,
+ NULL, NULL, 0);
+ if (dest_size <= 0) {
+ DWORD error = GetLastError();
+ PyMem_Free(src_);
+ return PyErr_SetFromWindowsErr(error);
+ }
+
+ wchar_t* dest = PyMem_NEW(wchar_t, dest_size);
+ if (dest == NULL) {
+ PyMem_Free(src_);
+ return PyErr_NoMemory();
+ }
+
+ int nmapped = LCMapStringEx(locale, flags, src_, (int)src_size, dest, dest_size,
+ NULL, NULL, 0);
+ if (nmapped <= 0) {
+ DWORD error = GetLastError();
+ PyMem_Free(src_);
+ PyMem_DEL(dest);
+ return PyErr_SetFromWindowsErr(error);
+ }
+
+ PyMem_Free(src_);
+ PyObject *ret = PyUnicode_FromWideChar(dest, nmapped);
+ PyMem_DEL(dest);
+
+ return ret;
+}
+
+/*[clinic input]
+_winapi.ReadFile
+
+ handle: HANDLE
+ size: DWORD
+ overlapped as use_overlapped: bool = False
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_ReadFile_impl(PyObject *module, HANDLE handle, DWORD size,
+ int use_overlapped)
+/*[clinic end generated code: output=d3d5b44a8201b944 input=4f82f8e909ad91ad]*/
+{
+ DWORD nread;
+ PyObject *buf;
+ BOOL ret;
+ DWORD err;
+ OverlappedObject *overlapped = NULL;
+
+ buf = PyBytes_FromStringAndSize(NULL, size);
+ if (!buf)
+ return NULL;
+ if (use_overlapped) {
+ overlapped = new_overlapped(module, handle);
+ if (!overlapped) {
+ Py_DECREF(buf);
+ return NULL;
+ }
+ /* Steals reference to buf */
+ overlapped->read_buffer = buf;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = ReadFile(handle, PyBytes_AS_STRING(buf), size, &nread,
+ overlapped ? &overlapped->overlapped : NULL);
+ Py_END_ALLOW_THREADS
+
+ err = ret ? 0 : GetLastError();
+
+ if (overlapped) {
+ if (!ret) {
+ if (err == ERROR_IO_PENDING)
+ overlapped->pending = 1;
+ else if (err != ERROR_MORE_DATA) {
+ Py_DECREF(overlapped);
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ }
+ }
+ return Py_BuildValue("NI", (PyObject *) overlapped, err);
+ }
+
+ if (!ret && err != ERROR_MORE_DATA) {
+ Py_DECREF(buf);
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ }
+ if (_PyBytes_Resize(&buf, nread))
+ return NULL;
+ return Py_BuildValue("NI", buf, err);
+}
+
+/*[clinic input]
+_winapi.SetNamedPipeHandleState
+
+ named_pipe: HANDLE
+ mode: object
+ max_collection_count: object
+ collect_data_timeout: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_SetNamedPipeHandleState_impl(PyObject *module, HANDLE named_pipe,
+ PyObject *mode,
+ PyObject *max_collection_count,
+ PyObject *collect_data_timeout)
+/*[clinic end generated code: output=f2129d222cbfa095 input=9142d72163d0faa6]*/
+{
+ PyObject *oArgs[3] = {mode, max_collection_count, collect_data_timeout};
+ DWORD dwArgs[3], *pArgs[3] = {NULL, NULL, NULL};
+ int i;
+ BOOL b;
+
+ for (i = 0 ; i < 3 ; i++) {
+ if (oArgs[i] != Py_None) {
+ dwArgs[i] = PyLong_AsUnsignedLongMask(oArgs[i]);
+ if (PyErr_Occurred())
+ return NULL;
+ pArgs[i] = &dwArgs[i];
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ b = SetNamedPipeHandleState(named_pipe, pArgs[0], pArgs[1], pArgs[2]);
+ Py_END_ALLOW_THREADS
+
+ if (!b)
+ return PyErr_SetFromWindowsErr(0);
+
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+_winapi.TerminateProcess
+
+ handle: HANDLE
+ exit_code: UINT
+ /
+
+Terminate the specified process and all of its threads.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_TerminateProcess_impl(PyObject *module, HANDLE handle,
+ UINT exit_code)
+/*[clinic end generated code: output=f4e99ac3f0b1f34a input=d6bc0aa1ee3bb4df]*/
+{
+ BOOL result;
+
+ if (PySys_Audit("_winapi.TerminateProcess", "nI",
+ (Py_ssize_t)handle, exit_code) < 0) {
+ return NULL;
+ }
+
+ result = TerminateProcess(handle, exit_code);
+
+ if (! result)
+ return PyErr_SetFromWindowsErr(GetLastError());
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_winapi.VirtualQuerySize -> size_t
+
+ address: LPCVOID
+ /
+[clinic start generated code]*/
+
+static size_t
+_winapi_VirtualQuerySize_impl(PyObject *module, LPCVOID address)
+/*[clinic end generated code: output=40c8e0ff5ec964df input=6b784a69755d0bb6]*/
+{
+ SIZE_T size_of_buf;
+ MEMORY_BASIC_INFORMATION mem_basic_info;
+ SIZE_T region_size;
+
+ Py_BEGIN_ALLOW_THREADS
+ size_of_buf = VirtualQuery(address, &mem_basic_info, sizeof(mem_basic_info));
+ Py_END_ALLOW_THREADS
+
+ if (size_of_buf == 0)
+ PyErr_SetFromWindowsErr(0);
+
+ region_size = mem_basic_info.RegionSize;
+ return region_size;
+}
+
+/*[clinic input]
+_winapi.WaitNamedPipe
+
+ name: LPCTSTR
+ timeout: DWORD
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_WaitNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD timeout)
+/*[clinic end generated code: output=c2866f4439b1fe38 input=36fc781291b1862c]*/
+{
+ BOOL success;
+
+ Py_BEGIN_ALLOW_THREADS
+ success = WaitNamedPipe(name, timeout);
+ Py_END_ALLOW_THREADS
+
+ if (!success)
+ return PyErr_SetFromWindowsErr(0);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_winapi.WaitForMultipleObjects
+
+ handle_seq: object
+ wait_flag: BOOL
+ milliseconds: DWORD(c_default='INFINITE') = _winapi.INFINITE
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_WaitForMultipleObjects_impl(PyObject *module, PyObject *handle_seq,
+ BOOL wait_flag, DWORD milliseconds)
+/*[clinic end generated code: output=295e3f00b8e45899 input=36f76ca057cd28a0]*/
+{
+ DWORD result;
+ HANDLE handles[MAXIMUM_WAIT_OBJECTS];
+ HANDLE sigint_event = NULL;
+ Py_ssize_t nhandles, i;
+
+ if (!PySequence_Check(handle_seq)) {
+ PyErr_Format(PyExc_TypeError,
+ "sequence type expected, got '%s'",
+ Py_TYPE(handle_seq)->tp_name);
+ return NULL;
+ }
+ nhandles = PySequence_Length(handle_seq);
+ if (nhandles == -1)
+ return NULL;
+ if (nhandles < 0 || nhandles > MAXIMUM_WAIT_OBJECTS - 1) {
+ PyErr_Format(PyExc_ValueError,
+ "need at most %zd handles, got a sequence of length %zd",
+ MAXIMUM_WAIT_OBJECTS - 1, nhandles);
+ return NULL;
+ }
+ for (i = 0; i < nhandles; i++) {
+ HANDLE h;
+ PyObject *v = PySequence_GetItem(handle_seq, i);
+ if (v == NULL)
+ return NULL;
+ if (!PyArg_Parse(v, F_HANDLE, &h)) {
+ Py_DECREF(v);
+ return NULL;
+ }
+ handles[i] = h;
+ Py_DECREF(v);
+ }
+ /* If this is the main thread then make the wait interruptible
+ by Ctrl-C unless we are waiting for *all* handles */
+ if (!wait_flag && _PyOS_IsMainThread()) {
+ sigint_event = _PyOS_SigintEvent();
+ assert(sigint_event != NULL);
+ handles[nhandles++] = sigint_event;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ if (sigint_event != NULL)
+ ResetEvent(sigint_event);
+ result = WaitForMultipleObjects((DWORD) nhandles, handles,
+ wait_flag, milliseconds);
+ Py_END_ALLOW_THREADS
+
+ if (result == WAIT_FAILED)
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ else if (sigint_event != NULL && result == WAIT_OBJECT_0 + nhandles - 1) {
+ errno = EINTR;
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+
+ return PyLong_FromLong((int) result);
+}
+
+/*[clinic input]
+_winapi.WaitForSingleObject -> long
+
+ handle: HANDLE
+ milliseconds: DWORD
+ /
+
+Wait for a single object.
+
+Wait until the specified object is in the signaled state or
+the time-out interval elapses. The timeout value is specified
+in milliseconds.
+[clinic start generated code]*/
+
+static long
+_winapi_WaitForSingleObject_impl(PyObject *module, HANDLE handle,
+ DWORD milliseconds)
+/*[clinic end generated code: output=3c4715d8f1b39859 input=443d1ab076edc7b1]*/
+{
+ DWORD result;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = WaitForSingleObject(handle, milliseconds);
+ Py_END_ALLOW_THREADS
+
+ if (result == WAIT_FAILED) {
+ PyErr_SetFromWindowsErr(GetLastError());
+ return -1;
+ }
+
+ return result;
+}
+
+/*[clinic input]
+_winapi.WriteFile
+
+ handle: HANDLE
+ buffer: object
+ overlapped as use_overlapped: bool = False
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_WriteFile_impl(PyObject *module, HANDLE handle, PyObject *buffer,
+ int use_overlapped)
+/*[clinic end generated code: output=2ca80f6bf3fa92e3 input=2badb008c8a2e2a0]*/
+{
+ Py_buffer _buf, *buf;
+ DWORD len, written;
+ BOOL ret;
+ DWORD err;
+ OverlappedObject *overlapped = NULL;
+
+ if (use_overlapped) {
+ overlapped = new_overlapped(module, handle);
+ if (!overlapped)
+ return NULL;
+ buf = &overlapped->write_buffer;
+ }
+ else
+ buf = &_buf;
+
+ if (!PyArg_Parse(buffer, "y*", buf)) {
+ Py_XDECREF(overlapped);
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ len = (DWORD)Py_MIN(buf->len, PY_DWORD_MAX);
+ ret = WriteFile(handle, buf->buf, len, &written,
+ overlapped ? &overlapped->overlapped : NULL);
+ Py_END_ALLOW_THREADS
+
+ err = ret ? 0 : GetLastError();
+
+ if (overlapped) {
+ if (!ret) {
+ if (err == ERROR_IO_PENDING)
+ overlapped->pending = 1;
+ else {
+ Py_DECREF(overlapped);
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ }
+ }
+ return Py_BuildValue("NI", (PyObject *) overlapped, err);
+ }
+
+ PyBuffer_Release(buf);
+ if (!ret)
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, 0);
+ return Py_BuildValue("II", written, err);
+}
+
+/*[clinic input]
+_winapi.GetACP
+
+Get the current Windows ANSI code page identifier.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_GetACP_impl(PyObject *module)
+/*[clinic end generated code: output=f7ee24bf705dbb88 input=1433c96d03a05229]*/
+{
+ return PyLong_FromUnsignedLong(GetACP());
+}
+
+/*[clinic input]
+_winapi.GetFileType -> DWORD
+
+ handle: HANDLE
+[clinic start generated code]*/
+
+static DWORD
+_winapi_GetFileType_impl(PyObject *module, HANDLE handle)
+/*[clinic end generated code: output=92b8466ac76ecc17 input=0058366bc40bbfbf]*/
+{
+ DWORD result;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = GetFileType(handle);
+ Py_END_ALLOW_THREADS
+
+ if (result == FILE_TYPE_UNKNOWN && GetLastError() != NO_ERROR) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+
+ return result;
+}
+
+
+/*[clinic input]
+_winapi._mimetypes_read_windows_registry
+
+ on_type_read: object
+
+Optimized function for reading all known MIME types from the registry.
+
+*on_type_read* is a callable taking *type* and *ext* arguments, as for
+MimeTypes.add_type.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi__mimetypes_read_windows_registry_impl(PyObject *module,
+ PyObject *on_type_read)
+/*[clinic end generated code: output=20829f00bebce55b input=cd357896d6501f68]*/
+{
+#define CCH_EXT 128
+#define CB_TYPE 510
+ struct {
+ wchar_t ext[CCH_EXT];
+ wchar_t type[CB_TYPE / sizeof(wchar_t) + 1];
+ } entries[64];
+ int entry = 0;
+ HKEY hkcr = NULL;
+ LRESULT err;
+
+ Py_BEGIN_ALLOW_THREADS
+ err = RegOpenKeyExW(HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, &hkcr);
+ for (DWORD i = 0; err == ERROR_SUCCESS || err == ERROR_MORE_DATA; ++i) {
+ LPWSTR ext = entries[entry].ext;
+ LPWSTR type = entries[entry].type;
+ DWORD cchExt = CCH_EXT;
+ DWORD cbType = CB_TYPE;
+ HKEY subkey;
+ DWORD regType;
+
+ err = RegEnumKeyExW(hkcr, i, ext, &cchExt, NULL, NULL, NULL, NULL);
+ if (err != ERROR_SUCCESS || (cchExt && ext[0] != L'.')) {
+ continue;
+ }
+
+ err = RegOpenKeyExW(hkcr, ext, 0, KEY_READ, &subkey);
+ if (err == ERROR_FILE_NOT_FOUND) {
+ err = ERROR_SUCCESS;
+ continue;
+ } else if (err != ERROR_SUCCESS) {
+ continue;
+ }
+
+ err = RegQueryValueExW(subkey, L"Content Type", NULL,
+ &regType, (LPBYTE)type, &cbType);
+ RegCloseKey(subkey);
+ if (err == ERROR_FILE_NOT_FOUND) {
+ err = ERROR_SUCCESS;
+ continue;
+ } else if (err != ERROR_SUCCESS) {
+ continue;
+ } else if (regType != REG_SZ || !cbType) {
+ continue;
+ }
+ type[cbType / sizeof(wchar_t)] = L'\0';
+
+ entry += 1;
+
+ /* Flush our cached entries if we are full */
+ if (entry == sizeof(entries) / sizeof(entries[0])) {
+ Py_BLOCK_THREADS
+ for (int j = 0; j < entry; ++j) {
+ PyObject *r = PyObject_CallFunction(
+ on_type_read, "uu", entries[j].type, entries[j].ext
+ );
+ if (!r) {
+ /* We blocked threads, so safe to return from here */
+ RegCloseKey(hkcr);
+ return NULL;
+ }
+ Py_DECREF(r);
+ }
+ Py_UNBLOCK_THREADS
+ entry = 0;
+ }
+ }
+ if (hkcr) {
+ RegCloseKey(hkcr);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (err != ERROR_SUCCESS && err != ERROR_NO_MORE_ITEMS) {
+ PyErr_SetFromWindowsErr((int)err);
+ return NULL;
+ }
+
+ for (int j = 0; j < entry; ++j) {
+ PyObject *r = PyObject_CallFunction(
+ on_type_read, "uu", entries[j].type, entries[j].ext
+ );
+ if (!r) {
+ return NULL;
+ }
+ Py_DECREF(r);
+ }
+
+ Py_RETURN_NONE;
+#undef CCH_EXT
+#undef CB_TYPE
+}
+
+/*[clinic input]
+_winapi.NeedCurrentDirectoryForExePath -> bool
+
+ exe_name: LPCWSTR
+ /
+[clinic start generated code]*/
+
+static int
+_winapi_NeedCurrentDirectoryForExePath_impl(PyObject *module,
+ LPCWSTR exe_name)
+/*[clinic end generated code: output=a65ec879502b58fc input=972aac88a1ec2f00]*/
+{
+ BOOL result;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = NeedCurrentDirectoryForExePathW(exe_name);
+ Py_END_ALLOW_THREADS
+
+ return result;
+}
+
+
+/*[clinic input]
+_winapi.CopyFile2
+
+ existing_file_name: LPCWSTR
+ new_file_name: LPCWSTR
+ flags: DWORD
+ progress_routine: object = None
+
+Copies a file from one name to a new name.
+
+This is implemented using the CopyFile2 API, which preserves all stat
+and metadata information apart from security attributes.
+
+progress_routine is reserved for future use, but is currently not
+implemented. Its value is ignored.
+[clinic start generated code]*/
+
+static PyObject *
+_winapi_CopyFile2_impl(PyObject *module, LPCWSTR existing_file_name,
+ LPCWSTR new_file_name, DWORD flags,
+ PyObject *progress_routine)
+/*[clinic end generated code: output=43d960d9df73d984 input=fb976b8d1492d130]*/
+{
+ HRESULT hr;
+ COPYFILE2_EXTENDED_PARAMETERS params = { sizeof(COPYFILE2_EXTENDED_PARAMETERS) };
+
+ if (PySys_Audit("_winapi.CopyFile2", "uuI",
+ existing_file_name, new_file_name, flags) < 0) {
+ return NULL;
+ }
+
+ params.dwCopyFlags = flags;
+ /* For future implementation. We ignore the value for now so that
+ users only have to test for 'CopyFile2' existing and not whether
+ the additional parameter exists.
+ if (progress_routine != Py_None) {
+ params.pProgressRoutine = _winapi_CopyFile2ProgressRoutine;
+ params.pvCallbackContext = Py_NewRef(progress_routine);
+ }
+ */
+ Py_BEGIN_ALLOW_THREADS;
+ hr = CopyFile2(existing_file_name, new_file_name, &params);
+ Py_END_ALLOW_THREADS;
+ /* For future implementation.
+ if (progress_routine != Py_None) {
+ Py_DECREF(progress_routine);
+ }
+ */
+ if (FAILED(hr)) {
+ if ((hr & 0xFFFF0000) == 0x80070000) {
+ PyErr_SetFromWindowsErr(hr & 0xFFFF);
+ } else {
+ PyErr_SetFromWindowsErr(hr);
+ }
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef winapi_functions[] = {
+ _WINAPI_CLOSEHANDLE_METHODDEF
+ _WINAPI_CONNECTNAMEDPIPE_METHODDEF
+ _WINAPI_CREATEFILE_METHODDEF
+ _WINAPI_CREATEFILEMAPPING_METHODDEF
+ _WINAPI_CREATENAMEDPIPE_METHODDEF
+ _WINAPI_CREATEPIPE_METHODDEF
+ _WINAPI_CREATEPROCESS_METHODDEF
+ _WINAPI_CREATEJUNCTION_METHODDEF
+ _WINAPI_DUPLICATEHANDLE_METHODDEF
+ _WINAPI_EXITPROCESS_METHODDEF
+ _WINAPI_GETCURRENTPROCESS_METHODDEF
+ _WINAPI_GETEXITCODEPROCESS_METHODDEF
+ _WINAPI_GETLASTERROR_METHODDEF
+ _WINAPI_GETMODULEFILENAME_METHODDEF
+ _WINAPI_GETSTDHANDLE_METHODDEF
+ _WINAPI_GETVERSION_METHODDEF
+ _WINAPI_MAPVIEWOFFILE_METHODDEF
+ _WINAPI_OPENFILEMAPPING_METHODDEF
+ _WINAPI_OPENPROCESS_METHODDEF
+ _WINAPI_PEEKNAMEDPIPE_METHODDEF
+ _WINAPI_LCMAPSTRINGEX_METHODDEF
+ _WINAPI_READFILE_METHODDEF
+ _WINAPI_SETNAMEDPIPEHANDLESTATE_METHODDEF
+ _WINAPI_TERMINATEPROCESS_METHODDEF
+ _WINAPI_UNMAPVIEWOFFILE_METHODDEF
+ _WINAPI_VIRTUALQUERYSIZE_METHODDEF
+ _WINAPI_WAITNAMEDPIPE_METHODDEF
+ _WINAPI_WAITFORMULTIPLEOBJECTS_METHODDEF
+ _WINAPI_WAITFORSINGLEOBJECT_METHODDEF
+ _WINAPI_WRITEFILE_METHODDEF
+ _WINAPI_GETACP_METHODDEF
+ _WINAPI_GETFILETYPE_METHODDEF
+ _WINAPI__MIMETYPES_READ_WINDOWS_REGISTRY_METHODDEF
+ _WINAPI_NEEDCURRENTDIRECTORYFOREXEPATH_METHODDEF
+ _WINAPI_COPYFILE2_METHODDEF
+ {NULL, NULL}
+};
+
+#define WINAPI_CONSTANT(fmt, con) \
+ do { \
+ PyObject *value = Py_BuildValue(fmt, con); \
+ if (value == NULL) { \
+ return -1; \
+ } \
+ if (PyDict_SetItemString(d, #con, value) < 0) { \
+ Py_DECREF(value); \
+ return -1; \
+ } \
+ Py_DECREF(value); \
+ } while (0)
+
+static int winapi_exec(PyObject *m)
+{
+ WinApiState *st = winapi_get_state(m);
+
+ st->overlapped_type = (PyTypeObject *)PyType_FromModuleAndSpec(m, &winapi_overlapped_type_spec, NULL);
+ if (st->overlapped_type == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(m, st->overlapped_type) < 0) {
+ return -1;
+ }
+
+ PyObject *d = PyModule_GetDict(m);
+
+ /* constants */
+ WINAPI_CONSTANT(F_DWORD, CREATE_NEW_CONSOLE);
+ WINAPI_CONSTANT(F_DWORD, CREATE_NEW_PROCESS_GROUP);
+ WINAPI_CONSTANT(F_DWORD, DUPLICATE_SAME_ACCESS);
+ WINAPI_CONSTANT(F_DWORD, DUPLICATE_CLOSE_SOURCE);
+ WINAPI_CONSTANT(F_DWORD, ERROR_ACCESS_DENIED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_ALREADY_EXISTS);
+ WINAPI_CONSTANT(F_DWORD, ERROR_BROKEN_PIPE);
+ WINAPI_CONSTANT(F_DWORD, ERROR_IO_PENDING);
+ WINAPI_CONSTANT(F_DWORD, ERROR_MORE_DATA);
+ WINAPI_CONSTANT(F_DWORD, ERROR_NETNAME_DELETED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_NO_SYSTEM_RESOURCES);
+ WINAPI_CONSTANT(F_DWORD, ERROR_MORE_DATA);
+ WINAPI_CONSTANT(F_DWORD, ERROR_NETNAME_DELETED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_NO_DATA);
+ WINAPI_CONSTANT(F_DWORD, ERROR_NO_SYSTEM_RESOURCES);
+ WINAPI_CONSTANT(F_DWORD, ERROR_OPERATION_ABORTED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_PIPE_BUSY);
+ WINAPI_CONSTANT(F_DWORD, ERROR_PIPE_CONNECTED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_PRIVILEGE_NOT_HELD);
+ WINAPI_CONSTANT(F_DWORD, ERROR_SEM_TIMEOUT);
+ WINAPI_CONSTANT(F_DWORD, FILE_FLAG_FIRST_PIPE_INSTANCE);
+ WINAPI_CONSTANT(F_DWORD, FILE_FLAG_OVERLAPPED);
+ WINAPI_CONSTANT(F_DWORD, FILE_GENERIC_READ);
+ WINAPI_CONSTANT(F_DWORD, FILE_GENERIC_WRITE);
+ WINAPI_CONSTANT(F_DWORD, FILE_MAP_ALL_ACCESS);
+ WINAPI_CONSTANT(F_DWORD, FILE_MAP_COPY);
+ WINAPI_CONSTANT(F_DWORD, FILE_MAP_EXECUTE);
+ WINAPI_CONSTANT(F_DWORD, FILE_MAP_READ);
+ WINAPI_CONSTANT(F_DWORD, FILE_MAP_WRITE);
+ WINAPI_CONSTANT(F_DWORD, GENERIC_READ);
+ WINAPI_CONSTANT(F_DWORD, GENERIC_WRITE);
+ WINAPI_CONSTANT(F_DWORD, INFINITE);
+ WINAPI_CONSTANT(F_HANDLE, INVALID_HANDLE_VALUE);
+ WINAPI_CONSTANT(F_DWORD, MEM_COMMIT);
+ WINAPI_CONSTANT(F_DWORD, MEM_FREE);
+ WINAPI_CONSTANT(F_DWORD, MEM_IMAGE);
+ WINAPI_CONSTANT(F_DWORD, MEM_MAPPED);
+ WINAPI_CONSTANT(F_DWORD, MEM_PRIVATE);
+ WINAPI_CONSTANT(F_DWORD, MEM_RESERVE);
+ WINAPI_CONSTANT(F_DWORD, NMPWAIT_WAIT_FOREVER);
+ WINAPI_CONSTANT(F_DWORD, OPEN_EXISTING);
+ WINAPI_CONSTANT(F_DWORD, PAGE_EXECUTE);
+ WINAPI_CONSTANT(F_DWORD, PAGE_EXECUTE_READ);
+ WINAPI_CONSTANT(F_DWORD, PAGE_EXECUTE_READWRITE);
+ WINAPI_CONSTANT(F_DWORD, PAGE_EXECUTE_WRITECOPY);
+ WINAPI_CONSTANT(F_DWORD, PAGE_GUARD);
+ WINAPI_CONSTANT(F_DWORD, PAGE_NOACCESS);
+ WINAPI_CONSTANT(F_DWORD, PAGE_NOCACHE);
+ WINAPI_CONSTANT(F_DWORD, PAGE_READONLY);
+ WINAPI_CONSTANT(F_DWORD, PAGE_READWRITE);
+ WINAPI_CONSTANT(F_DWORD, PAGE_WRITECOMBINE);
+ WINAPI_CONSTANT(F_DWORD, PAGE_WRITECOPY);
+ WINAPI_CONSTANT(F_DWORD, PIPE_ACCESS_DUPLEX);
+ WINAPI_CONSTANT(F_DWORD, PIPE_ACCESS_INBOUND);
+ WINAPI_CONSTANT(F_DWORD, PIPE_READMODE_MESSAGE);
+ WINAPI_CONSTANT(F_DWORD, PIPE_TYPE_MESSAGE);
+ WINAPI_CONSTANT(F_DWORD, PIPE_UNLIMITED_INSTANCES);
+ WINAPI_CONSTANT(F_DWORD, PIPE_WAIT);
+ WINAPI_CONSTANT(F_DWORD, PROCESS_ALL_ACCESS);
+ WINAPI_CONSTANT(F_DWORD, SYNCHRONIZE);
+ WINAPI_CONSTANT(F_DWORD, PROCESS_DUP_HANDLE);
+ WINAPI_CONSTANT(F_DWORD, SEC_COMMIT);
+ WINAPI_CONSTANT(F_DWORD, SEC_IMAGE);
+ WINAPI_CONSTANT(F_DWORD, SEC_LARGE_PAGES);
+ WINAPI_CONSTANT(F_DWORD, SEC_NOCACHE);
+ WINAPI_CONSTANT(F_DWORD, SEC_RESERVE);
+ WINAPI_CONSTANT(F_DWORD, SEC_WRITECOMBINE);
+ WINAPI_CONSTANT(F_DWORD, STARTF_USESHOWWINDOW);
+ WINAPI_CONSTANT(F_DWORD, STARTF_USESTDHANDLES);
+ WINAPI_CONSTANT(F_DWORD, STD_INPUT_HANDLE);
+ WINAPI_CONSTANT(F_DWORD, STD_OUTPUT_HANDLE);
+ WINAPI_CONSTANT(F_DWORD, STD_ERROR_HANDLE);
+ WINAPI_CONSTANT(F_DWORD, STILL_ACTIVE);
+ WINAPI_CONSTANT(F_DWORD, SW_HIDE);
+ WINAPI_CONSTANT(F_DWORD, WAIT_OBJECT_0);
+ WINAPI_CONSTANT(F_DWORD, WAIT_ABANDONED_0);
+ WINAPI_CONSTANT(F_DWORD, WAIT_TIMEOUT);
+
+ WINAPI_CONSTANT(F_DWORD, ABOVE_NORMAL_PRIORITY_CLASS);
+ WINAPI_CONSTANT(F_DWORD, BELOW_NORMAL_PRIORITY_CLASS);
+ WINAPI_CONSTANT(F_DWORD, HIGH_PRIORITY_CLASS);
+ WINAPI_CONSTANT(F_DWORD, IDLE_PRIORITY_CLASS);
+ WINAPI_CONSTANT(F_DWORD, NORMAL_PRIORITY_CLASS);
+ WINAPI_CONSTANT(F_DWORD, REALTIME_PRIORITY_CLASS);
+
+ WINAPI_CONSTANT(F_DWORD, CREATE_NO_WINDOW);
+ WINAPI_CONSTANT(F_DWORD, DETACHED_PROCESS);
+ WINAPI_CONSTANT(F_DWORD, CREATE_DEFAULT_ERROR_MODE);
+ WINAPI_CONSTANT(F_DWORD, CREATE_BREAKAWAY_FROM_JOB);
+
+ WINAPI_CONSTANT(F_DWORD, FILE_TYPE_UNKNOWN);
+ WINAPI_CONSTANT(F_DWORD, FILE_TYPE_DISK);
+ WINAPI_CONSTANT(F_DWORD, FILE_TYPE_CHAR);
+ WINAPI_CONSTANT(F_DWORD, FILE_TYPE_PIPE);
+ WINAPI_CONSTANT(F_DWORD, FILE_TYPE_REMOTE);
+
+ WINAPI_CONSTANT("u", LOCALE_NAME_INVARIANT);
+ WINAPI_CONSTANT(F_DWORD, LOCALE_NAME_MAX_LENGTH);
+ WINAPI_CONSTANT("u", LOCALE_NAME_SYSTEM_DEFAULT);
+ WINAPI_CONSTANT("u", LOCALE_NAME_USER_DEFAULT);
+
+ WINAPI_CONSTANT(F_DWORD, LCMAP_FULLWIDTH);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_HALFWIDTH);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_HIRAGANA);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_KATAKANA);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_LINGUISTIC_CASING);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_LOWERCASE);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_SIMPLIFIED_CHINESE);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_TITLECASE);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_TRADITIONAL_CHINESE);
+ WINAPI_CONSTANT(F_DWORD, LCMAP_UPPERCASE);
+
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_ALLOW_DECRYPTED_DESTINATION);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_COPY_SYMLINK);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_FAIL_IF_EXISTS);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_NO_BUFFERING);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_NO_OFFLOAD);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_OPEN_SOURCE_FOR_WRITE);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_RESTARTABLE);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_REQUEST_SECURITY_PRIVILEGES);
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_RESUME_FROM_PAUSE);
+#ifndef COPY_FILE_REQUEST_COMPRESSED_TRAFFIC
+ // Only defined in newer WinSDKs
+ #define COPY_FILE_REQUEST_COMPRESSED_TRAFFIC 0x10000000
+#endif
+ WINAPI_CONSTANT(F_DWORD, COPY_FILE_REQUEST_COMPRESSED_TRAFFIC);
+
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_CALLBACK_CHUNK_STARTED);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_CALLBACK_CHUNK_FINISHED);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_CALLBACK_STREAM_STARTED);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_CALLBACK_STREAM_FINISHED);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_CALLBACK_POLL_CONTINUE);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_CALLBACK_ERROR);
+
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_PROGRESS_CONTINUE);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_PROGRESS_CANCEL);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_PROGRESS_STOP);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_PROGRESS_QUIET);
+ WINAPI_CONSTANT(F_DWORD, COPYFILE2_PROGRESS_PAUSE);
+
+ WINAPI_CONSTANT("i", NULL);
+
+ return 0;
+}
+
+static PyModuleDef_Slot winapi_slots[] = {
+ {Py_mod_exec, winapi_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+winapi_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ WinApiState *st = winapi_get_state(module);
+ Py_VISIT(st->overlapped_type);
+ return 0;
+}
+
+static int
+winapi_clear(PyObject *module)
+{
+ WinApiState *st = winapi_get_state(module);
+ Py_CLEAR(st->overlapped_type);
+ return 0;
+}
+
+static void
+winapi_free(void *module)
+{
+ winapi_clear((PyObject *)module);
+}
+
+static struct PyModuleDef winapi_module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_winapi",
+ .m_size = sizeof(WinApiState),
+ .m_methods = winapi_functions,
+ .m_slots = winapi_slots,
+ .m_traverse = winapi_traverse,
+ .m_clear = winapi_clear,
+ .m_free = winapi_free,
+};
+
+PyMODINIT_FUNC
+PyInit__winapi(void)
+{
+ return PyModuleDef_Init(&winapi_module);
+}
diff --git a/contrib/tools/python3/Modules/_xxinterpchannelsmodule.c b/contrib/tools/python3/Modules/_xxinterpchannelsmodule.c
new file mode 100644
index 00000000000..6bee11c1218
--- /dev/null
+++ b/contrib/tools/python3/Modules/_xxinterpchannelsmodule.c
@@ -0,0 +1,2479 @@
+
+/* interpreters module */
+/* low-level access to interpreter primitives */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "interpreteridobject.h"
+#include "pycore_pystate.h" // _PyCrossInterpreterData_ReleaseAndRawFree()
+
+
+/*
+This module has the following process-global state:
+
+_globals (static struct globals):
+ module_count (int)
+ channels (struct _channels):
+ numopen (int64_t)
+ next_id; (int64_t)
+ mutex (PyThread_type_lock)
+ head (linked list of struct _channelref *):
+ id (int64_t)
+ objcount (Py_ssize_t)
+ next (struct _channelref *):
+ ...
+ chan (struct _channel *):
+ open (int)
+ mutex (PyThread_type_lock)
+ closing (struct _channel_closing *):
+ ref (struct _channelref *):
+ ...
+ ends (struct _channelends *):
+ numsendopen (int64_t)
+ numrecvopen (int64_t)
+ send (struct _channelend *):
+ interp (int64_t)
+ open (int)
+ next (struct _channelend *)
+ recv (struct _channelend *):
+ ...
+ queue (struct _channelqueue *):
+ count (int64_t)
+ first (struct _channelitem *):
+ next (struct _channelitem *):
+ ...
+ data (_PyCrossInterpreterData *):
+ data (void *)
+ obj (PyObject *)
+ interp (int64_t)
+ new_object (xid_newobjectfunc)
+ free (xid_freefunc)
+ last (struct _channelitem *):
+ ...
+
+The above state includes the following allocations by the module:
+
+* 1 top-level mutex (to protect the rest of the state)
+* for each channel:
+ * 1 struct _channelref
+ * 1 struct _channel
+ * 0-1 struct _channel_closing
+ * 1 struct _channelends
+ * 2 struct _channelend
+ * 1 struct _channelqueue
+* for each item in each channel:
+ * 1 struct _channelitem
+ * 1 _PyCrossInterpreterData
+
+The only objects in that global state are the references held by each
+channel's queue, which are safely managed via the _PyCrossInterpreterData_*()
+API.. The module does not create any objects that are shared globally.
+*/
+
+#define MODULE_NAME "_xxinterpchannels"
+
+
+#define GLOBAL_MALLOC(TYPE) \
+ PyMem_RawMalloc(sizeof(TYPE))
+#define GLOBAL_FREE(VAR) \
+ PyMem_RawFree(VAR)
+
+
+static PyInterpreterState *
+_get_current_interp(void)
+{
+ // PyInterpreterState_Get() aborts if lookup fails, so don't need
+ // to check the result for NULL.
+ return PyInterpreterState_Get();
+}
+
+static PyObject *
+_get_current_module(void)
+{
+ PyObject *name = PyUnicode_FromString(MODULE_NAME);
+ if (name == NULL) {
+ return NULL;
+ }
+ PyObject *mod = PyImport_GetModule(name);
+ Py_DECREF(name);
+ if (mod == NULL) {
+ return NULL;
+ }
+ assert(mod != Py_None);
+ return mod;
+}
+
+static PyObject *
+get_module_from_owned_type(PyTypeObject *cls)
+{
+ assert(cls != NULL);
+ return _get_current_module();
+ // XXX Use the more efficient API now that we use heap types:
+ //return PyType_GetModule(cls);
+}
+
+static struct PyModuleDef moduledef;
+
+static PyObject *
+get_module_from_type(PyTypeObject *cls)
+{
+ assert(cls != NULL);
+ return _get_current_module();
+ // XXX Use the more efficient API now that we use heap types:
+ //return PyType_GetModuleByDef(cls, &moduledef);
+}
+
+static PyObject *
+add_new_exception(PyObject *mod, const char *name, PyObject *base)
+{
+ assert(!PyObject_HasAttrString(mod, name));
+ PyObject *exctype = PyErr_NewException(name, base, NULL);
+ if (exctype == NULL) {
+ return NULL;
+ }
+ int res = PyModule_AddType(mod, (PyTypeObject *)exctype);
+ if (res < 0) {
+ Py_DECREF(exctype);
+ return NULL;
+ }
+ return exctype;
+}
+
+#define ADD_NEW_EXCEPTION(MOD, NAME, BASE) \
+ add_new_exception(MOD, MODULE_NAME "." Py_STRINGIFY(NAME), BASE)
+
+static PyTypeObject *
+add_new_type(PyObject *mod, PyType_Spec *spec, crossinterpdatafunc shared)
+{
+ PyTypeObject *cls = (PyTypeObject *)PyType_FromMetaclass(
+ NULL, mod, spec, NULL);
+ if (cls == NULL) {
+ return NULL;
+ }
+ if (PyModule_AddType(mod, cls) < 0) {
+ Py_DECREF(cls);
+ return NULL;
+ }
+ if (shared != NULL) {
+ if (_PyCrossInterpreterData_RegisterClass(cls, shared)) {
+ Py_DECREF(cls);
+ return NULL;
+ }
+ }
+ return cls;
+}
+
+#define XID_IGNORE_EXC 1
+#define XID_FREE 2
+
+static int
+_release_xid_data(_PyCrossInterpreterData *data, int flags)
+{
+ int ignoreexc = flags & XID_IGNORE_EXC;
+ PyObject *exc;
+ if (ignoreexc) {
+ exc = PyErr_GetRaisedException();
+ }
+ int res;
+ if (flags & XID_FREE) {
+ res = _PyCrossInterpreterData_ReleaseAndRawFree(data);
+ }
+ else {
+ res = _PyCrossInterpreterData_Release(data);
+ }
+ if (res < 0) {
+ /* The owning interpreter is already destroyed. */
+ if (ignoreexc) {
+ // XXX Emit a warning?
+ PyErr_Clear();
+ }
+ }
+ if (flags & XID_FREE) {
+ /* Either way, we free the data. */
+ }
+ if (ignoreexc) {
+ PyErr_SetRaisedException(exc);
+ }
+ return res;
+}
+
+
+/* module state *************************************************************/
+
+typedef struct {
+ /* heap types */
+ PyTypeObject *ChannelIDType;
+
+ /* exceptions */
+ PyObject *ChannelError;
+ PyObject *ChannelNotFoundError;
+ PyObject *ChannelClosedError;
+ PyObject *ChannelEmptyError;
+ PyObject *ChannelNotEmptyError;
+} module_state;
+
+static inline module_state *
+get_module_state(PyObject *mod)
+{
+ assert(mod != NULL);
+ module_state *state = PyModule_GetState(mod);
+ assert(state != NULL);
+ return state;
+}
+
+static int
+traverse_module_state(module_state *state, visitproc visit, void *arg)
+{
+ /* heap types */
+ Py_VISIT(state->ChannelIDType);
+
+ /* exceptions */
+ Py_VISIT(state->ChannelError);
+ Py_VISIT(state->ChannelNotFoundError);
+ Py_VISIT(state->ChannelClosedError);
+ Py_VISIT(state->ChannelEmptyError);
+ Py_VISIT(state->ChannelNotEmptyError);
+
+ return 0;
+}
+
+static int
+clear_module_state(module_state *state)
+{
+ /* heap types */
+ if (state->ChannelIDType != NULL) {
+ (void)_PyCrossInterpreterData_UnregisterClass(state->ChannelIDType);
+ }
+ Py_CLEAR(state->ChannelIDType);
+
+ /* exceptions */
+ Py_CLEAR(state->ChannelError);
+ Py_CLEAR(state->ChannelNotFoundError);
+ Py_CLEAR(state->ChannelClosedError);
+ Py_CLEAR(state->ChannelEmptyError);
+ Py_CLEAR(state->ChannelNotEmptyError);
+
+ return 0;
+}
+
+
+/* channel-specific code ****************************************************/
+
+#define CHANNEL_SEND 1
+#define CHANNEL_BOTH 0
+#define CHANNEL_RECV -1
+
+/* channel errors */
+
+#define ERR_CHANNEL_NOT_FOUND -2
+#define ERR_CHANNEL_CLOSED -3
+#define ERR_CHANNEL_INTERP_CLOSED -4
+#define ERR_CHANNEL_EMPTY -5
+#define ERR_CHANNEL_NOT_EMPTY -6
+#define ERR_CHANNEL_MUTEX_INIT -7
+#define ERR_CHANNELS_MUTEX_INIT -8
+#define ERR_NO_NEXT_CHANNEL_ID -9
+
+static int
+exceptions_init(PyObject *mod)
+{
+ module_state *state = get_module_state(mod);
+ if (state == NULL) {
+ return -1;
+ }
+
+#define ADD(NAME, BASE) \
+ do { \
+ assert(state->NAME == NULL); \
+ state->NAME = ADD_NEW_EXCEPTION(mod, NAME, BASE); \
+ if (state->NAME == NULL) { \
+ return -1; \
+ } \
+ } while (0)
+
+ // A channel-related operation failed.
+ ADD(ChannelError, PyExc_RuntimeError);
+ // An operation tried to use a channel that doesn't exist.
+ ADD(ChannelNotFoundError, state->ChannelError);
+ // An operation tried to use a closed channel.
+ ADD(ChannelClosedError, state->ChannelError);
+ // An operation tried to pop from an empty channel.
+ ADD(ChannelEmptyError, state->ChannelError);
+ // An operation tried to close a non-empty channel.
+ ADD(ChannelNotEmptyError, state->ChannelError);
+#undef ADD
+
+ return 0;
+}
+
+static int
+handle_channel_error(int err, PyObject *mod, int64_t cid)
+{
+ if (err == 0) {
+ assert(!PyErr_Occurred());
+ return 0;
+ }
+ assert(err < 0);
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ if (err == ERR_CHANNEL_NOT_FOUND) {
+ PyErr_Format(state->ChannelNotFoundError,
+ "channel %" PRId64 " not found", cid);
+ }
+ else if (err == ERR_CHANNEL_CLOSED) {
+ PyErr_Format(state->ChannelClosedError,
+ "channel %" PRId64 " is closed", cid);
+ }
+ else if (err == ERR_CHANNEL_INTERP_CLOSED) {
+ PyErr_Format(state->ChannelClosedError,
+ "channel %" PRId64 " is already closed", cid);
+ }
+ else if (err == ERR_CHANNEL_EMPTY) {
+ PyErr_Format(state->ChannelEmptyError,
+ "channel %" PRId64 " is empty", cid);
+ }
+ else if (err == ERR_CHANNEL_NOT_EMPTY) {
+ PyErr_Format(state->ChannelNotEmptyError,
+ "channel %" PRId64 " may not be closed "
+ "if not empty (try force=True)",
+ cid);
+ }
+ else if (err == ERR_CHANNEL_MUTEX_INIT) {
+ PyErr_SetString(state->ChannelError,
+ "can't initialize mutex for new channel");
+ }
+ else if (err == ERR_CHANNELS_MUTEX_INIT) {
+ PyErr_SetString(state->ChannelError,
+ "can't initialize mutex for channel management");
+ }
+ else if (err == ERR_NO_NEXT_CHANNEL_ID) {
+ PyErr_SetString(state->ChannelError,
+ "failed to get a channel ID");
+ }
+ else {
+ assert(PyErr_Occurred());
+ }
+ return 1;
+}
+
+/* the channel queue */
+
+struct _channelitem;
+
+typedef struct _channelitem {
+ _PyCrossInterpreterData *data;
+ struct _channelitem *next;
+} _channelitem;
+
+static _channelitem *
+_channelitem_new(void)
+{
+ _channelitem *item = GLOBAL_MALLOC(_channelitem);
+ if (item == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ item->data = NULL;
+ item->next = NULL;
+ return item;
+}
+
+static void
+_channelitem_clear(_channelitem *item)
+{
+ if (item->data != NULL) {
+ // It was allocated in _channel_send().
+ (void)_release_xid_data(item->data, XID_IGNORE_EXC & XID_FREE);
+ item->data = NULL;
+ }
+ item->next = NULL;
+}
+
+static void
+_channelitem_free(_channelitem *item)
+{
+ _channelitem_clear(item);
+ GLOBAL_FREE(item);
+}
+
+static void
+_channelitem_free_all(_channelitem *item)
+{
+ while (item != NULL) {
+ _channelitem *last = item;
+ item = item->next;
+ _channelitem_free(last);
+ }
+}
+
+static _PyCrossInterpreterData *
+_channelitem_popped(_channelitem *item)
+{
+ _PyCrossInterpreterData *data = item->data;
+ item->data = NULL;
+ _channelitem_free(item);
+ return data;
+}
+
+typedef struct _channelqueue {
+ int64_t count;
+ _channelitem *first;
+ _channelitem *last;
+} _channelqueue;
+
+static _channelqueue *
+_channelqueue_new(void)
+{
+ _channelqueue *queue = GLOBAL_MALLOC(_channelqueue);
+ if (queue == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ queue->count = 0;
+ queue->first = NULL;
+ queue->last = NULL;
+ return queue;
+}
+
+static void
+_channelqueue_clear(_channelqueue *queue)
+{
+ _channelitem_free_all(queue->first);
+ queue->count = 0;
+ queue->first = NULL;
+ queue->last = NULL;
+}
+
+static void
+_channelqueue_free(_channelqueue *queue)
+{
+ _channelqueue_clear(queue);
+ GLOBAL_FREE(queue);
+}
+
+static int
+_channelqueue_put(_channelqueue *queue, _PyCrossInterpreterData *data)
+{
+ _channelitem *item = _channelitem_new();
+ if (item == NULL) {
+ return -1;
+ }
+ item->data = data;
+
+ queue->count += 1;
+ if (queue->first == NULL) {
+ queue->first = item;
+ }
+ else {
+ queue->last->next = item;
+ }
+ queue->last = item;
+ return 0;
+}
+
+static _PyCrossInterpreterData *
+_channelqueue_get(_channelqueue *queue)
+{
+ _channelitem *item = queue->first;
+ if (item == NULL) {
+ return NULL;
+ }
+ queue->first = item->next;
+ if (queue->last == item) {
+ queue->last = NULL;
+ }
+ queue->count -= 1;
+
+ return _channelitem_popped(item);
+}
+
+static void
+_channelqueue_drop_interpreter(_channelqueue *queue, int64_t interp)
+{
+ _channelitem *prev = NULL;
+ _channelitem *next = queue->first;
+ while (next != NULL) {
+ _channelitem *item = next;
+ next = item->next;
+ if (item->data->interp == interp) {
+ if (prev == NULL) {
+ queue->first = item->next;
+ }
+ else {
+ prev->next = item->next;
+ }
+ _channelitem_free(item);
+ queue->count -= 1;
+ }
+ else {
+ prev = item;
+ }
+ }
+}
+
+/* channel-interpreter associations */
+
+struct _channelend;
+
+typedef struct _channelend {
+ struct _channelend *next;
+ int64_t interp;
+ int open;
+} _channelend;
+
+static _channelend *
+_channelend_new(int64_t interp)
+{
+ _channelend *end = GLOBAL_MALLOC(_channelend);
+ if (end == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ end->next = NULL;
+ end->interp = interp;
+ end->open = 1;
+ return end;
+}
+
+static void
+_channelend_free(_channelend *end)
+{
+ GLOBAL_FREE(end);
+}
+
+static void
+_channelend_free_all(_channelend *end)
+{
+ while (end != NULL) {
+ _channelend *last = end;
+ end = end->next;
+ _channelend_free(last);
+ }
+}
+
+static _channelend *
+_channelend_find(_channelend *first, int64_t interp, _channelend **pprev)
+{
+ _channelend *prev = NULL;
+ _channelend *end = first;
+ while (end != NULL) {
+ if (end->interp == interp) {
+ break;
+ }
+ prev = end;
+ end = end->next;
+ }
+ if (pprev != NULL) {
+ *pprev = prev;
+ }
+ return end;
+}
+
+typedef struct _channelassociations {
+ // Note that the list entries are never removed for interpreter
+ // for which the channel is closed. This should not be a problem in
+ // practice. Also, a channel isn't automatically closed when an
+ // interpreter is destroyed.
+ int64_t numsendopen;
+ int64_t numrecvopen;
+ _channelend *send;
+ _channelend *recv;
+} _channelends;
+
+static _channelends *
+_channelends_new(void)
+{
+ _channelends *ends = GLOBAL_MALLOC(_channelends);
+ if (ends== NULL) {
+ return NULL;
+ }
+ ends->numsendopen = 0;
+ ends->numrecvopen = 0;
+ ends->send = NULL;
+ ends->recv = NULL;
+ return ends;
+}
+
+static void
+_channelends_clear(_channelends *ends)
+{
+ _channelend_free_all(ends->send);
+ ends->send = NULL;
+ ends->numsendopen = 0;
+
+ _channelend_free_all(ends->recv);
+ ends->recv = NULL;
+ ends->numrecvopen = 0;
+}
+
+static void
+_channelends_free(_channelends *ends)
+{
+ _channelends_clear(ends);
+ GLOBAL_FREE(ends);
+}
+
+static _channelend *
+_channelends_add(_channelends *ends, _channelend *prev, int64_t interp,
+ int send)
+{
+ _channelend *end = _channelend_new(interp);
+ if (end == NULL) {
+ return NULL;
+ }
+
+ if (prev == NULL) {
+ if (send) {
+ ends->send = end;
+ }
+ else {
+ ends->recv = end;
+ }
+ }
+ else {
+ prev->next = end;
+ }
+ if (send) {
+ ends->numsendopen += 1;
+ }
+ else {
+ ends->numrecvopen += 1;
+ }
+ return end;
+}
+
+static int
+_channelends_associate(_channelends *ends, int64_t interp, int send)
+{
+ _channelend *prev;
+ _channelend *end = _channelend_find(send ? ends->send : ends->recv,
+ interp, &prev);
+ if (end != NULL) {
+ if (!end->open) {
+ return ERR_CHANNEL_CLOSED;
+ }
+ // already associated
+ return 0;
+ }
+ if (_channelends_add(ends, prev, interp, send) == NULL) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+_channelends_is_open(_channelends *ends)
+{
+ if (ends->numsendopen != 0 || ends->numrecvopen != 0) {
+ return 1;
+ }
+ if (ends->send == NULL && ends->recv == NULL) {
+ return 1;
+ }
+ return 0;
+}
+
+static void
+_channelends_close_end(_channelends *ends, _channelend *end, int send)
+{
+ end->open = 0;
+ if (send) {
+ ends->numsendopen -= 1;
+ }
+ else {
+ ends->numrecvopen -= 1;
+ }
+}
+
+static int
+_channelends_close_interpreter(_channelends *ends, int64_t interp, int which)
+{
+ _channelend *prev;
+ _channelend *end;
+ if (which >= 0) { // send/both
+ end = _channelend_find(ends->send, interp, &prev);
+ if (end == NULL) {
+ // never associated so add it
+ end = _channelends_add(ends, prev, interp, 1);
+ if (end == NULL) {
+ return -1;
+ }
+ }
+ _channelends_close_end(ends, end, 1);
+ }
+ if (which <= 0) { // recv/both
+ end = _channelend_find(ends->recv, interp, &prev);
+ if (end == NULL) {
+ // never associated so add it
+ end = _channelends_add(ends, prev, interp, 0);
+ if (end == NULL) {
+ return -1;
+ }
+ }
+ _channelends_close_end(ends, end, 0);
+ }
+ return 0;
+}
+
+static void
+_channelends_drop_interpreter(_channelends *ends, int64_t interp)
+{
+ _channelend *end;
+ end = _channelend_find(ends->send, interp, NULL);
+ if (end != NULL) {
+ _channelends_close_end(ends, end, 1);
+ }
+ end = _channelend_find(ends->recv, interp, NULL);
+ if (end != NULL) {
+ _channelends_close_end(ends, end, 0);
+ }
+}
+
+static void
+_channelends_close_all(_channelends *ends, int which, int force)
+{
+ // XXX Handle the ends.
+ // XXX Handle force is True.
+
+ // Ensure all the "send"-associated interpreters are closed.
+ _channelend *end;
+ for (end = ends->send; end != NULL; end = end->next) {
+ _channelends_close_end(ends, end, 1);
+ }
+
+ // Ensure all the "recv"-associated interpreters are closed.
+ for (end = ends->recv; end != NULL; end = end->next) {
+ _channelends_close_end(ends, end, 0);
+ }
+}
+
+/* channels */
+
+struct _channel;
+struct _channel_closing;
+static void _channel_clear_closing(struct _channel *);
+static void _channel_finish_closing(struct _channel *);
+
+typedef struct _channel {
+ PyThread_type_lock mutex;
+ _channelqueue *queue;
+ _channelends *ends;
+ int open;
+ struct _channel_closing *closing;
+} _PyChannelState;
+
+static _PyChannelState *
+_channel_new(PyThread_type_lock mutex)
+{
+ _PyChannelState *chan = GLOBAL_MALLOC(_PyChannelState);
+ if (chan == NULL) {
+ return NULL;
+ }
+ chan->mutex = mutex;
+ chan->queue = _channelqueue_new();
+ if (chan->queue == NULL) {
+ GLOBAL_FREE(chan);
+ return NULL;
+ }
+ chan->ends = _channelends_new();
+ if (chan->ends == NULL) {
+ _channelqueue_free(chan->queue);
+ GLOBAL_FREE(chan);
+ return NULL;
+ }
+ chan->open = 1;
+ chan->closing = NULL;
+ return chan;
+}
+
+static void
+_channel_free(_PyChannelState *chan)
+{
+ _channel_clear_closing(chan);
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+ _channelqueue_free(chan->queue);
+ _channelends_free(chan->ends);
+ PyThread_release_lock(chan->mutex);
+
+ PyThread_free_lock(chan->mutex);
+ GLOBAL_FREE(chan);
+}
+
+static int
+_channel_add(_PyChannelState *chan, int64_t interp,
+ _PyCrossInterpreterData *data)
+{
+ int res = -1;
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+
+ if (!chan->open) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+ if (_channelends_associate(chan->ends, interp, 1) != 0) {
+ res = ERR_CHANNEL_INTERP_CLOSED;
+ goto done;
+ }
+
+ if (_channelqueue_put(chan->queue, data) != 0) {
+ goto done;
+ }
+
+ res = 0;
+done:
+ PyThread_release_lock(chan->mutex);
+ return res;
+}
+
+static int
+_channel_next(_PyChannelState *chan, int64_t interp,
+ _PyCrossInterpreterData **res)
+{
+ int err = 0;
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+
+ if (!chan->open) {
+ err = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+ if (_channelends_associate(chan->ends, interp, 0) != 0) {
+ err = ERR_CHANNEL_INTERP_CLOSED;
+ goto done;
+ }
+
+ _PyCrossInterpreterData *data = _channelqueue_get(chan->queue);
+ if (data == NULL && !PyErr_Occurred() && chan->closing != NULL) {
+ chan->open = 0;
+ }
+ *res = data;
+
+done:
+ PyThread_release_lock(chan->mutex);
+ if (chan->queue->count == 0) {
+ _channel_finish_closing(chan);
+ }
+ return err;
+}
+
+static int
+_channel_close_interpreter(_PyChannelState *chan, int64_t interp, int end)
+{
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+
+ int res = -1;
+ if (!chan->open) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+
+ if (_channelends_close_interpreter(chan->ends, interp, end) != 0) {
+ goto done;
+ }
+ chan->open = _channelends_is_open(chan->ends);
+
+ res = 0;
+done:
+ PyThread_release_lock(chan->mutex);
+ return res;
+}
+
+static void
+_channel_drop_interpreter(_PyChannelState *chan, int64_t interp)
+{
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+
+ _channelqueue_drop_interpreter(chan->queue, interp);
+ _channelends_drop_interpreter(chan->ends, interp);
+ chan->open = _channelends_is_open(chan->ends);
+
+ PyThread_release_lock(chan->mutex);
+}
+
+static int
+_channel_close_all(_PyChannelState *chan, int end, int force)
+{
+ int res = -1;
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+
+ if (!chan->open) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+
+ if (!force && chan->queue->count > 0) {
+ res = ERR_CHANNEL_NOT_EMPTY;
+ goto done;
+ }
+
+ chan->open = 0;
+
+ // We *could* also just leave these in place, since we've marked
+ // the channel as closed already.
+ _channelends_close_all(chan->ends, end, force);
+
+ res = 0;
+done:
+ PyThread_release_lock(chan->mutex);
+ return res;
+}
+
+/* the set of channels */
+
+struct _channelref;
+
+typedef struct _channelref {
+ int64_t id;
+ _PyChannelState *chan;
+ struct _channelref *next;
+ Py_ssize_t objcount;
+} _channelref;
+
+static _channelref *
+_channelref_new(int64_t id, _PyChannelState *chan)
+{
+ _channelref *ref = GLOBAL_MALLOC(_channelref);
+ if (ref == NULL) {
+ return NULL;
+ }
+ ref->id = id;
+ ref->chan = chan;
+ ref->next = NULL;
+ ref->objcount = 0;
+ return ref;
+}
+
+//static void
+//_channelref_clear(_channelref *ref)
+//{
+// ref->id = -1;
+// ref->chan = NULL;
+// ref->next = NULL;
+// ref->objcount = 0;
+//}
+
+static void
+_channelref_free(_channelref *ref)
+{
+ if (ref->chan != NULL) {
+ _channel_clear_closing(ref->chan);
+ }
+ //_channelref_clear(ref);
+ GLOBAL_FREE(ref);
+}
+
+static _channelref *
+_channelref_find(_channelref *first, int64_t id, _channelref **pprev)
+{
+ _channelref *prev = NULL;
+ _channelref *ref = first;
+ while (ref != NULL) {
+ if (ref->id == id) {
+ break;
+ }
+ prev = ref;
+ ref = ref->next;
+ }
+ if (pprev != NULL) {
+ *pprev = prev;
+ }
+ return ref;
+}
+
+typedef struct _channels {
+ PyThread_type_lock mutex;
+ _channelref *head;
+ int64_t numopen;
+ int64_t next_id;
+} _channels;
+
+static void
+_channels_init(_channels *channels, PyThread_type_lock mutex)
+{
+ channels->mutex = mutex;
+ channels->head = NULL;
+ channels->numopen = 0;
+ channels->next_id = 0;
+}
+
+static void
+_channels_fini(_channels *channels)
+{
+ assert(channels->numopen == 0);
+ assert(channels->head == NULL);
+ if (channels->mutex != NULL) {
+ PyThread_free_lock(channels->mutex);
+ channels->mutex = NULL;
+ }
+}
+
+static int64_t
+_channels_next_id(_channels *channels) // needs lock
+{
+ int64_t id = channels->next_id;
+ if (id < 0) {
+ /* overflow */
+ return -1;
+ }
+ channels->next_id += 1;
+ return id;
+}
+
+static int
+_channels_lookup(_channels *channels, int64_t id, PyThread_type_lock *pmutex,
+ _PyChannelState **res)
+{
+ int err = -1;
+ _PyChannelState *chan = NULL;
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+ if (pmutex != NULL) {
+ *pmutex = NULL;
+ }
+
+ _channelref *ref = _channelref_find(channels->head, id, NULL);
+ if (ref == NULL) {
+ err = ERR_CHANNEL_NOT_FOUND;
+ goto done;
+ }
+ if (ref->chan == NULL || !ref->chan->open) {
+ err = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+
+ if (pmutex != NULL) {
+ // The mutex will be closed by the caller.
+ *pmutex = channels->mutex;
+ }
+
+ chan = ref->chan;
+ err = 0;
+
+done:
+ if (pmutex == NULL || *pmutex == NULL) {
+ PyThread_release_lock(channels->mutex);
+ }
+ *res = chan;
+ return err;
+}
+
+static int64_t
+_channels_add(_channels *channels, _PyChannelState *chan)
+{
+ int64_t cid = -1;
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+
+ // Create a new ref.
+ int64_t id = _channels_next_id(channels);
+ if (id < 0) {
+ cid = ERR_NO_NEXT_CHANNEL_ID;
+ goto done;
+ }
+ _channelref *ref = _channelref_new(id, chan);
+ if (ref == NULL) {
+ goto done;
+ }
+
+ // Add it to the list.
+ // We assume that the channel is a new one (not already in the list).
+ ref->next = channels->head;
+ channels->head = ref;
+ channels->numopen += 1;
+
+ cid = id;
+done:
+ PyThread_release_lock(channels->mutex);
+ return cid;
+}
+
+/* forward */
+static int _channel_set_closing(struct _channelref *, PyThread_type_lock);
+
+static int
+_channels_close(_channels *channels, int64_t cid, _PyChannelState **pchan,
+ int end, int force)
+{
+ int res = -1;
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+ if (pchan != NULL) {
+ *pchan = NULL;
+ }
+
+ _channelref *ref = _channelref_find(channels->head, cid, NULL);
+ if (ref == NULL) {
+ res = ERR_CHANNEL_NOT_FOUND;
+ goto done;
+ }
+
+ if (ref->chan == NULL) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+ else if (!force && end == CHANNEL_SEND && ref->chan->closing != NULL) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+ else {
+ int err = _channel_close_all(ref->chan, end, force);
+ if (err != 0) {
+ if (end == CHANNEL_SEND && err == ERR_CHANNEL_NOT_EMPTY) {
+ if (ref->chan->closing != NULL) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+ // Mark the channel as closing and return. The channel
+ // will be cleaned up in _channel_next().
+ PyErr_Clear();
+ int err = _channel_set_closing(ref, channels->mutex);
+ if (err != 0) {
+ res = err;
+ goto done;
+ }
+ if (pchan != NULL) {
+ *pchan = ref->chan;
+ }
+ res = 0;
+ }
+ else {
+ res = err;
+ }
+ goto done;
+ }
+ if (pchan != NULL) {
+ *pchan = ref->chan;
+ }
+ else {
+ _channel_free(ref->chan);
+ }
+ ref->chan = NULL;
+ }
+
+ res = 0;
+done:
+ PyThread_release_lock(channels->mutex);
+ return res;
+}
+
+static void
+_channels_remove_ref(_channels *channels, _channelref *ref, _channelref *prev,
+ _PyChannelState **pchan)
+{
+ if (ref == channels->head) {
+ channels->head = ref->next;
+ }
+ else {
+ prev->next = ref->next;
+ }
+ channels->numopen -= 1;
+
+ if (pchan != NULL) {
+ *pchan = ref->chan;
+ }
+ _channelref_free(ref);
+}
+
+static int
+_channels_remove(_channels *channels, int64_t id, _PyChannelState **pchan)
+{
+ int res = -1;
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+
+ if (pchan != NULL) {
+ *pchan = NULL;
+ }
+
+ _channelref *prev = NULL;
+ _channelref *ref = _channelref_find(channels->head, id, &prev);
+ if (ref == NULL) {
+ res = ERR_CHANNEL_NOT_FOUND;
+ goto done;
+ }
+
+ _channels_remove_ref(channels, ref, prev, pchan);
+
+ res = 0;
+done:
+ PyThread_release_lock(channels->mutex);
+ return res;
+}
+
+static int
+_channels_add_id_object(_channels *channels, int64_t id)
+{
+ int res = -1;
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+
+ _channelref *ref = _channelref_find(channels->head, id, NULL);
+ if (ref == NULL) {
+ res = ERR_CHANNEL_NOT_FOUND;
+ goto done;
+ }
+ ref->objcount += 1;
+
+ res = 0;
+done:
+ PyThread_release_lock(channels->mutex);
+ return res;
+}
+
+static void
+_channels_drop_id_object(_channels *channels, int64_t id)
+{
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+
+ _channelref *prev = NULL;
+ _channelref *ref = _channelref_find(channels->head, id, &prev);
+ if (ref == NULL) {
+ // Already destroyed.
+ goto done;
+ }
+ ref->objcount -= 1;
+
+ // Destroy if no longer used.
+ if (ref->objcount == 0) {
+ _PyChannelState *chan = NULL;
+ _channels_remove_ref(channels, ref, prev, &chan);
+ if (chan != NULL) {
+ _channel_free(chan);
+ }
+ }
+
+done:
+ PyThread_release_lock(channels->mutex);
+}
+
+static int64_t *
+_channels_list_all(_channels *channels, int64_t *count)
+{
+ int64_t *cids = NULL;
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+ int64_t *ids = PyMem_NEW(int64_t, (Py_ssize_t)(channels->numopen));
+ if (ids == NULL) {
+ goto done;
+ }
+ _channelref *ref = channels->head;
+ for (int64_t i=0; ref != NULL; ref = ref->next, i++) {
+ ids[i] = ref->id;
+ }
+ *count = channels->numopen;
+
+ cids = ids;
+done:
+ PyThread_release_lock(channels->mutex);
+ return cids;
+}
+
+static void
+_channels_drop_interpreter(_channels *channels, int64_t interp)
+{
+ PyThread_acquire_lock(channels->mutex, WAIT_LOCK);
+
+ _channelref *ref = channels->head;
+ for (; ref != NULL; ref = ref->next) {
+ if (ref->chan != NULL) {
+ _channel_drop_interpreter(ref->chan, interp);
+ }
+ }
+
+ PyThread_release_lock(channels->mutex);
+}
+
+/* support for closing non-empty channels */
+
+struct _channel_closing {
+ struct _channelref *ref;
+};
+
+static int
+_channel_set_closing(struct _channelref *ref, PyThread_type_lock mutex) {
+ struct _channel *chan = ref->chan;
+ if (chan == NULL) {
+ // already closed
+ return 0;
+ }
+ int res = -1;
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+ if (chan->closing != NULL) {
+ res = ERR_CHANNEL_CLOSED;
+ goto done;
+ }
+ chan->closing = GLOBAL_MALLOC(struct _channel_closing);
+ if (chan->closing == NULL) {
+ goto done;
+ }
+ chan->closing->ref = ref;
+
+ res = 0;
+done:
+ PyThread_release_lock(chan->mutex);
+ return res;
+}
+
+static void
+_channel_clear_closing(struct _channel *chan) {
+ PyThread_acquire_lock(chan->mutex, WAIT_LOCK);
+ if (chan->closing != NULL) {
+ GLOBAL_FREE(chan->closing);
+ chan->closing = NULL;
+ }
+ PyThread_release_lock(chan->mutex);
+}
+
+static void
+_channel_finish_closing(struct _channel *chan) {
+ struct _channel_closing *closing = chan->closing;
+ if (closing == NULL) {
+ return;
+ }
+ _channelref *ref = closing->ref;
+ _channel_clear_closing(chan);
+ // Do the things that would have been done in _channels_close().
+ ref->chan = NULL;
+ _channel_free(chan);
+}
+
+/* "high"-level channel-related functions */
+
+static int64_t
+_channel_create(_channels *channels)
+{
+ PyThread_type_lock mutex = PyThread_allocate_lock();
+ if (mutex == NULL) {
+ return ERR_CHANNEL_MUTEX_INIT;
+ }
+ _PyChannelState *chan = _channel_new(mutex);
+ if (chan == NULL) {
+ PyThread_free_lock(mutex);
+ return -1;
+ }
+ int64_t id = _channels_add(channels, chan);
+ if (id < 0) {
+ _channel_free(chan);
+ }
+ return id;
+}
+
+static int
+_channel_destroy(_channels *channels, int64_t id)
+{
+ _PyChannelState *chan = NULL;
+ int err = _channels_remove(channels, id, &chan);
+ if (err != 0) {
+ return err;
+ }
+ if (chan != NULL) {
+ _channel_free(chan);
+ }
+ return 0;
+}
+
+static int
+_channel_send(_channels *channels, int64_t id, PyObject *obj)
+{
+ PyInterpreterState *interp = _get_current_interp();
+ if (interp == NULL) {
+ return -1;
+ }
+
+ // Look up the channel.
+ PyThread_type_lock mutex = NULL;
+ _PyChannelState *chan = NULL;
+ int err = _channels_lookup(channels, id, &mutex, &chan);
+ if (err != 0) {
+ return err;
+ }
+ assert(chan != NULL);
+ // Past this point we are responsible for releasing the mutex.
+
+ if (chan->closing != NULL) {
+ PyThread_release_lock(mutex);
+ return ERR_CHANNEL_CLOSED;
+ }
+
+ // Convert the object to cross-interpreter data.
+ _PyCrossInterpreterData *data = GLOBAL_MALLOC(_PyCrossInterpreterData);
+ if (data == NULL) {
+ PyThread_release_lock(mutex);
+ return -1;
+ }
+ if (_PyObject_GetCrossInterpreterData(obj, data) != 0) {
+ PyThread_release_lock(mutex);
+ GLOBAL_FREE(data);
+ return -1;
+ }
+
+ // Add the data to the channel.
+ int res = _channel_add(chan, PyInterpreterState_GetID(interp), data);
+ PyThread_release_lock(mutex);
+ if (res != 0) {
+ // We may chain an exception here:
+ (void)_release_xid_data(data, 0);
+ GLOBAL_FREE(data);
+ return res;
+ }
+
+ return 0;
+}
+
+static int
+_channel_recv(_channels *channels, int64_t id, PyObject **res)
+{
+ int err;
+ *res = NULL;
+
+ PyInterpreterState *interp = _get_current_interp();
+ if (interp == NULL) {
+ // XXX Is this always an error?
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return 0;
+ }
+
+ // Look up the channel.
+ PyThread_type_lock mutex = NULL;
+ _PyChannelState *chan = NULL;
+ err = _channels_lookup(channels, id, &mutex, &chan);
+ if (err != 0) {
+ return err;
+ }
+ assert(chan != NULL);
+ // Past this point we are responsible for releasing the mutex.
+
+ // Pop off the next item from the channel.
+ _PyCrossInterpreterData *data = NULL;
+ err = _channel_next(chan, PyInterpreterState_GetID(interp), &data);
+ PyThread_release_lock(mutex);
+ if (err != 0) {
+ return err;
+ }
+ else if (data == NULL) {
+ assert(!PyErr_Occurred());
+ return 0;
+ }
+
+ // Convert the data back to an object.
+ PyObject *obj = _PyCrossInterpreterData_NewObject(data);
+ if (obj == NULL) {
+ assert(PyErr_Occurred());
+ // It was allocated in _channel_send(), so we free it.
+ (void)_release_xid_data(data, XID_IGNORE_EXC | XID_FREE);
+ return -1;
+ }
+ // It was allocated in _channel_send(), so we free it.
+ int release_res = _release_xid_data(data, XID_FREE);
+ if (release_res < 0) {
+ // The source interpreter has been destroyed already.
+ assert(PyErr_Occurred());
+ Py_DECREF(obj);
+ return -1;
+ }
+
+ *res = obj;
+ return 0;
+}
+
+static int
+_channel_drop(_channels *channels, int64_t id, int send, int recv)
+{
+ PyInterpreterState *interp = _get_current_interp();
+ if (interp == NULL) {
+ return -1;
+ }
+
+ // Look up the channel.
+ PyThread_type_lock mutex = NULL;
+ _PyChannelState *chan = NULL;
+ int err = _channels_lookup(channels, id, &mutex, &chan);
+ if (err != 0) {
+ return err;
+ }
+ // Past this point we are responsible for releasing the mutex.
+
+ // Close one or both of the two ends.
+ int res = _channel_close_interpreter(chan, PyInterpreterState_GetID(interp), send-recv);
+ PyThread_release_lock(mutex);
+ return res;
+}
+
+static int
+_channel_close(_channels *channels, int64_t id, int end, int force)
+{
+ return _channels_close(channels, id, NULL, end, force);
+}
+
+static int
+_channel_is_associated(_channels *channels, int64_t cid, int64_t interp,
+ int send)
+{
+ _PyChannelState *chan = NULL;
+ int err = _channels_lookup(channels, cid, NULL, &chan);
+ if (err != 0) {
+ return err;
+ }
+ else if (send && chan->closing != NULL) {
+ return ERR_CHANNEL_CLOSED;
+ }
+
+ _channelend *end = _channelend_find(send ? chan->ends->send : chan->ends->recv,
+ interp, NULL);
+
+ return (end != NULL && end->open);
+}
+
+/* ChannelID class */
+
+typedef struct channelid {
+ PyObject_HEAD
+ int64_t id;
+ int end;
+ int resolve;
+ _channels *channels;
+} channelid;
+
+struct channel_id_converter_data {
+ PyObject *module;
+ int64_t cid;
+};
+
+static int
+channel_id_converter(PyObject *arg, void *ptr)
+{
+ int64_t cid;
+ struct channel_id_converter_data *data = ptr;
+ module_state *state = get_module_state(data->module);
+ assert(state != NULL);
+ if (PyObject_TypeCheck(arg, state->ChannelIDType)) {
+ cid = ((channelid *)arg)->id;
+ }
+ else if (PyIndex_Check(arg)) {
+ cid = PyLong_AsLongLong(arg);
+ if (cid == -1 && PyErr_Occurred()) {
+ return 0;
+ }
+ if (cid < 0) {
+ PyErr_Format(PyExc_ValueError,
+ "channel ID must be a non-negative int, got %R", arg);
+ return 0;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "channel ID must be an int, got %.100s",
+ Py_TYPE(arg)->tp_name);
+ return 0;
+ }
+ data->cid = cid;
+ return 1;
+}
+
+static int
+newchannelid(PyTypeObject *cls, int64_t cid, int end, _channels *channels,
+ int force, int resolve, channelid **res)
+{
+ *res = NULL;
+
+ channelid *self = PyObject_New(channelid, cls);
+ if (self == NULL) {
+ return -1;
+ }
+ self->id = cid;
+ self->end = end;
+ self->resolve = resolve;
+ self->channels = channels;
+
+ int err = _channels_add_id_object(channels, cid);
+ if (err != 0) {
+ if (force && err == ERR_CHANNEL_NOT_FOUND) {
+ assert(!PyErr_Occurred());
+ }
+ else {
+ Py_DECREF((PyObject *)self);
+ return err;
+ }
+ }
+
+ *res = self;
+ return 0;
+}
+
+static _channels * _global_channels(void);
+
+static PyObject *
+_channelid_new(PyObject *mod, PyTypeObject *cls,
+ PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"id", "send", "recv", "force", "_resolve", NULL};
+ int64_t cid;
+ struct channel_id_converter_data cid_data = {
+ .module = mod,
+ };
+ int send = -1;
+ int recv = -1;
+ int force = 0;
+ int resolve = 0;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O&|$pppp:ChannelID.__new__", kwlist,
+ channel_id_converter, &cid_data,
+ &send, &recv, &force, &resolve)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+
+ // Handle "send" and "recv".
+ if (send == 0 && recv == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "'send' and 'recv' cannot both be False");
+ return NULL;
+ }
+
+ int end = 0;
+ if (send == 1) {
+ if (recv == 0 || recv == -1) {
+ end = CHANNEL_SEND;
+ }
+ }
+ else if (recv == 1) {
+ end = CHANNEL_RECV;
+ }
+
+ PyObject *id = NULL;
+ int err = newchannelid(cls, cid, end, _global_channels(),
+ force, resolve,
+ (channelid **)&id);
+ if (handle_channel_error(err, mod, cid)) {
+ assert(id == NULL);
+ return NULL;
+ }
+ assert(id != NULL);
+ return id;
+}
+
+static void
+channelid_dealloc(PyObject *self)
+{
+ int64_t cid = ((channelid *)self)->id;
+ _channels *channels = ((channelid *)self)->channels;
+
+ PyTypeObject *tp = Py_TYPE(self);
+ tp->tp_free(self);
+ /* "Instances of heap-allocated types hold a reference to their type."
+ * See: https://docs.python.org/3.11/howto/isolating-extensions.html#garbage-collection-protocol
+ * See: https://docs.python.org/3.11/c-api/typeobj.html#c.PyTypeObject.tp_traverse
+ */
+ // XXX Why don't we implement Py_TPFLAGS_HAVE_GC, e.g. Py_tp_traverse,
+ // like we do for _abc._abc_data?
+ Py_DECREF(tp);
+
+ _channels_drop_id_object(channels, cid);
+}
+
+static PyObject *
+channelid_repr(PyObject *self)
+{
+ PyTypeObject *type = Py_TYPE(self);
+ const char *name = _PyType_Name(type);
+
+ channelid *cid = (channelid *)self;
+ const char *fmt;
+ if (cid->end == CHANNEL_SEND) {
+ fmt = "%s(%" PRId64 ", send=True)";
+ }
+ else if (cid->end == CHANNEL_RECV) {
+ fmt = "%s(%" PRId64 ", recv=True)";
+ }
+ else {
+ fmt = "%s(%" PRId64 ")";
+ }
+ return PyUnicode_FromFormat(fmt, name, cid->id);
+}
+
+static PyObject *
+channelid_str(PyObject *self)
+{
+ channelid *cid = (channelid *)self;
+ return PyUnicode_FromFormat("%" PRId64 "", cid->id);
+}
+
+static PyObject *
+channelid_int(PyObject *self)
+{
+ channelid *cid = (channelid *)self;
+ return PyLong_FromLongLong(cid->id);
+}
+
+static Py_hash_t
+channelid_hash(PyObject *self)
+{
+ channelid *cid = (channelid *)self;
+ PyObject *id = PyLong_FromLongLong(cid->id);
+ if (id == NULL) {
+ return -1;
+ }
+ Py_hash_t hash = PyObject_Hash(id);
+ Py_DECREF(id);
+ return hash;
+}
+
+static PyObject *
+channelid_richcompare(PyObject *self, PyObject *other, int op)
+{
+ PyObject *res = NULL;
+ if (op != Py_EQ && op != Py_NE) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+ PyObject *mod = get_module_from_type(Py_TYPE(self));
+ if (mod == NULL) {
+ return NULL;
+ }
+ module_state *state = get_module_state(mod);
+ if (state == NULL) {
+ goto done;
+ }
+
+ if (!PyObject_TypeCheck(self, state->ChannelIDType)) {
+ res = Py_NewRef(Py_NotImplemented);
+ goto done;
+ }
+
+ channelid *cid = (channelid *)self;
+ int equal;
+ if (PyObject_TypeCheck(other, state->ChannelIDType)) {
+ channelid *othercid = (channelid *)other;
+ equal = (cid->end == othercid->end) && (cid->id == othercid->id);
+ }
+ else if (PyLong_Check(other)) {
+ /* Fast path */
+ int overflow;
+ long long othercid = PyLong_AsLongLongAndOverflow(other, &overflow);
+ if (othercid == -1 && PyErr_Occurred()) {
+ goto done;
+ }
+ equal = !overflow && (othercid >= 0) && (cid->id == othercid);
+ }
+ else if (PyNumber_Check(other)) {
+ PyObject *pyid = PyLong_FromLongLong(cid->id);
+ if (pyid == NULL) {
+ goto done;
+ }
+ res = PyObject_RichCompare(pyid, other, op);
+ Py_DECREF(pyid);
+ goto done;
+ }
+ else {
+ res = Py_NewRef(Py_NotImplemented);
+ goto done;
+ }
+
+ if ((op == Py_EQ && equal) || (op == Py_NE && !equal)) {
+ res = Py_NewRef(Py_True);
+ }
+ else {
+ res = Py_NewRef(Py_False);
+ }
+
+done:
+ Py_DECREF(mod);
+ return res;
+}
+
+static PyObject *
+_channel_from_cid(PyObject *cid, int end)
+{
+ PyObject *highlevel = PyImport_ImportModule("interpreters");
+ if (highlevel == NULL) {
+ PyErr_Clear();
+ highlevel = PyImport_ImportModule("test.support.interpreters");
+ if (highlevel == NULL) {
+ return NULL;
+ }
+ }
+ const char *clsname = (end == CHANNEL_RECV) ? "RecvChannel" :
+ "SendChannel";
+ PyObject *cls = PyObject_GetAttrString(highlevel, clsname);
+ Py_DECREF(highlevel);
+ if (cls == NULL) {
+ return NULL;
+ }
+ PyObject *chan = PyObject_CallFunctionObjArgs(cls, cid, NULL);
+ Py_DECREF(cls);
+ if (chan == NULL) {
+ return NULL;
+ }
+ return chan;
+}
+
+struct _channelid_xid {
+ int64_t id;
+ int end;
+ int resolve;
+};
+
+static PyObject *
+_channelid_from_xid(_PyCrossInterpreterData *data)
+{
+ struct _channelid_xid *xid = (struct _channelid_xid *)data->data;
+
+ // It might not be imported yet, so we can't use _get_current_module().
+ PyObject *mod = PyImport_ImportModule(MODULE_NAME);
+ if (mod == NULL) {
+ return NULL;
+ }
+ assert(mod != Py_None);
+ module_state *state = get_module_state(mod);
+ if (state == NULL) {
+ return NULL;
+ }
+
+ // Note that we do not preserve the "resolve" flag.
+ PyObject *cid = NULL;
+ int err = newchannelid(state->ChannelIDType, xid->id, xid->end,
+ _global_channels(), 0, 0,
+ (channelid **)&cid);
+ if (err != 0) {
+ assert(cid == NULL);
+ (void)handle_channel_error(err, mod, xid->id);
+ goto done;
+ }
+ assert(cid != NULL);
+ if (xid->end == 0) {
+ goto done;
+ }
+ if (!xid->resolve) {
+ goto done;
+ }
+
+ /* Try returning a high-level channel end but fall back to the ID. */
+ PyObject *chan = _channel_from_cid(cid, xid->end);
+ if (chan == NULL) {
+ PyErr_Clear();
+ goto done;
+ }
+ Py_DECREF(cid);
+ cid = chan;
+
+done:
+ Py_DECREF(mod);
+ return cid;
+}
+
+static int
+_channelid_shared(PyThreadState *tstate, PyObject *obj,
+ _PyCrossInterpreterData *data)
+{
+ if (_PyCrossInterpreterData_InitWithSize(
+ data, tstate->interp, sizeof(struct _channelid_xid), obj,
+ _channelid_from_xid
+ ) < 0)
+ {
+ return -1;
+ }
+ struct _channelid_xid *xid = (struct _channelid_xid *)data->data;
+ xid->id = ((channelid *)obj)->id;
+ xid->end = ((channelid *)obj)->end;
+ xid->resolve = ((channelid *)obj)->resolve;
+ return 0;
+}
+
+static PyObject *
+channelid_end(PyObject *self, void *end)
+{
+ int force = 1;
+ channelid *cid = (channelid *)self;
+ if (end != NULL) {
+ PyObject *id = NULL;
+ int err = newchannelid(Py_TYPE(self), cid->id, *(int *)end,
+ cid->channels, force, cid->resolve,
+ (channelid **)&id);
+ if (err != 0) {
+ assert(id == NULL);
+ PyObject *mod = get_module_from_type(Py_TYPE(self));
+ if (mod == NULL) {
+ return NULL;
+ }
+ (void)handle_channel_error(err, mod, cid->id);
+ Py_DECREF(mod);
+ return NULL;
+ }
+ assert(id != NULL);
+ return id;
+ }
+
+ if (cid->end == CHANNEL_SEND) {
+ return PyUnicode_InternFromString("send");
+ }
+ if (cid->end == CHANNEL_RECV) {
+ return PyUnicode_InternFromString("recv");
+ }
+ return PyUnicode_InternFromString("both");
+}
+
+static int _channelid_end_send = CHANNEL_SEND;
+static int _channelid_end_recv = CHANNEL_RECV;
+
+static PyGetSetDef channelid_getsets[] = {
+ {"end", (getter)channelid_end, NULL,
+ PyDoc_STR("'send', 'recv', or 'both'")},
+ {"send", (getter)channelid_end, NULL,
+ PyDoc_STR("the 'send' end of the channel"), &_channelid_end_send},
+ {"recv", (getter)channelid_end, NULL,
+ PyDoc_STR("the 'recv' end of the channel"), &_channelid_end_recv},
+ {NULL}
+};
+
+PyDoc_STRVAR(channelid_doc,
+"A channel ID identifies a channel and may be used as an int.");
+
+static PyType_Slot ChannelIDType_slots[] = {
+ {Py_tp_dealloc, (destructor)channelid_dealloc},
+ {Py_tp_doc, (void *)channelid_doc},
+ {Py_tp_repr, (reprfunc)channelid_repr},
+ {Py_tp_str, (reprfunc)channelid_str},
+ {Py_tp_hash, channelid_hash},
+ {Py_tp_richcompare, channelid_richcompare},
+ {Py_tp_getset, channelid_getsets},
+ // number slots
+ {Py_nb_int, (unaryfunc)channelid_int},
+ {Py_nb_index, (unaryfunc)channelid_int},
+ {0, NULL},
+};
+
+static PyType_Spec ChannelIDType_spec = {
+ .name = MODULE_NAME ".ChannelID",
+ .basicsize = sizeof(channelid),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = ChannelIDType_slots,
+};
+
+
+/* module level code ********************************************************/
+
+/* globals is the process-global state for the module. It holds all
+ the data that we need to share between interpreters, so it cannot
+ hold PyObject values. */
+static struct globals {
+ int module_count;
+ _channels channels;
+} _globals = {0};
+
+static int
+_globals_init(void)
+{
+ // XXX This isn't thread-safe.
+ _globals.module_count++;
+ if (_globals.module_count > 1) {
+ // Already initialized.
+ return 0;
+ }
+
+ assert(_globals.channels.mutex == NULL);
+ PyThread_type_lock mutex = PyThread_allocate_lock();
+ if (mutex == NULL) {
+ return ERR_CHANNELS_MUTEX_INIT;
+ }
+ _channels_init(&_globals.channels, mutex);
+ return 0;
+}
+
+static void
+_globals_fini(void)
+{
+ // XXX This isn't thread-safe.
+ _globals.module_count--;
+ if (_globals.module_count > 0) {
+ return;
+ }
+
+ _channels_fini(&_globals.channels);
+}
+
+static _channels *
+_global_channels(void) {
+ return &_globals.channels;
+}
+
+
+static void
+clear_interpreter(void *data)
+{
+ if (_globals.module_count == 0) {
+ return;
+ }
+ PyInterpreterState *interp = (PyInterpreterState *)data;
+ assert(interp == _get_current_interp());
+ int64_t id = PyInterpreterState_GetID(interp);
+ _channels_drop_interpreter(&_globals.channels, id);
+}
+
+
+static PyObject *
+channel_create(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ int64_t cid = _channel_create(&_globals.channels);
+ if (cid < 0) {
+ (void)handle_channel_error(-1, self, cid);
+ return NULL;
+ }
+ module_state *state = get_module_state(self);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyObject *id = NULL;
+ int err = newchannelid(state->ChannelIDType, cid, 0,
+ &_globals.channels, 0, 0,
+ (channelid **)&id);
+ if (handle_channel_error(err, self, cid)) {
+ assert(id == NULL);
+ err = _channel_destroy(&_globals.channels, cid);
+ if (handle_channel_error(err, self, cid)) {
+ // XXX issue a warning?
+ }
+ return NULL;
+ }
+ assert(id != NULL);
+ assert(((channelid *)id)->channels != NULL);
+ return id;
+}
+
+PyDoc_STRVAR(channel_create_doc,
+"channel_create() -> cid\n\
+\n\
+Create a new cross-interpreter channel and return a unique generated ID.");
+
+static PyObject *
+channel_destroy(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"cid", NULL};
+ int64_t cid;
+ struct channel_id_converter_data cid_data = {
+ .module = self,
+ };
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&:channel_destroy", kwlist,
+ channel_id_converter, &cid_data)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+
+ int err = _channel_destroy(&_globals.channels, cid);
+ if (handle_channel_error(err, self, cid)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(channel_destroy_doc,
+"channel_destroy(cid)\n\
+\n\
+Close and finalize the channel. Afterward attempts to use the channel\n\
+will behave as though it never existed.");
+
+static PyObject *
+channel_list_all(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ int64_t count = 0;
+ int64_t *cids = _channels_list_all(&_globals.channels, &count);
+ if (cids == NULL) {
+ if (count == 0) {
+ return PyList_New(0);
+ }
+ return NULL;
+ }
+ PyObject *ids = PyList_New((Py_ssize_t)count);
+ if (ids == NULL) {
+ goto finally;
+ }
+ module_state *state = get_module_state(self);
+ if (state == NULL) {
+ Py_DECREF(ids);
+ ids = NULL;
+ goto finally;
+ }
+ int64_t *cur = cids;
+ for (int64_t i=0; i < count; cur++, i++) {
+ PyObject *id = NULL;
+ int err = newchannelid(state->ChannelIDType, *cur, 0,
+ &_globals.channels, 0, 0,
+ (channelid **)&id);
+ if (handle_channel_error(err, self, *cur)) {
+ assert(id == NULL);
+ Py_SETREF(ids, NULL);
+ break;
+ }
+ assert(id != NULL);
+ PyList_SET_ITEM(ids, (Py_ssize_t)i, id);
+ }
+
+finally:
+ PyMem_Free(cids);
+ return ids;
+}
+
+PyDoc_STRVAR(channel_list_all_doc,
+"channel_list_all() -> [cid]\n\
+\n\
+Return the list of all IDs for active channels.");
+
+static PyObject *
+channel_list_interpreters(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"cid", "send", NULL};
+ int64_t cid; /* Channel ID */
+ struct channel_id_converter_data cid_data = {
+ .module = self,
+ };
+ int send = 0; /* Send or receive end? */
+ int64_t id;
+ PyObject *ids, *id_obj;
+ PyInterpreterState *interp;
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kwds, "O&$p:channel_list_interpreters",
+ kwlist, channel_id_converter, &cid_data, &send)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+
+ ids = PyList_New(0);
+ if (ids == NULL) {
+ goto except;
+ }
+
+ interp = PyInterpreterState_Head();
+ while (interp != NULL) {
+ id = PyInterpreterState_GetID(interp);
+ assert(id >= 0);
+ int res = _channel_is_associated(&_globals.channels, cid, id, send);
+ if (res < 0) {
+ (void)handle_channel_error(res, self, cid);
+ goto except;
+ }
+ if (res) {
+ id_obj = _PyInterpreterState_GetIDObject(interp);
+ if (id_obj == NULL) {
+ goto except;
+ }
+ res = PyList_Insert(ids, 0, id_obj);
+ Py_DECREF(id_obj);
+ if (res < 0) {
+ goto except;
+ }
+ }
+ interp = PyInterpreterState_Next(interp);
+ }
+
+ goto finally;
+
+except:
+ Py_CLEAR(ids);
+
+finally:
+ return ids;
+}
+
+PyDoc_STRVAR(channel_list_interpreters_doc,
+"channel_list_interpreters(cid, *, send) -> [id]\n\
+\n\
+Return the list of all interpreter IDs associated with an end of the channel.\n\
+\n\
+The 'send' argument should be a boolean indicating whether to use the send or\n\
+receive end.");
+
+
+static PyObject *
+channel_send(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"cid", "obj", NULL};
+ int64_t cid;
+ struct channel_id_converter_data cid_data = {
+ .module = self,
+ };
+ PyObject *obj;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O:channel_send", kwlist,
+ channel_id_converter, &cid_data, &obj)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+
+ int err = _channel_send(&_globals.channels, cid, obj);
+ if (handle_channel_error(err, self, cid)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(channel_send_doc,
+"channel_send(cid, obj)\n\
+\n\
+Add the object's data to the channel's queue.");
+
+static PyObject *
+channel_recv(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"cid", "default", NULL};
+ int64_t cid;
+ struct channel_id_converter_data cid_data = {
+ .module = self,
+ };
+ PyObject *dflt = NULL;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O:channel_recv", kwlist,
+ channel_id_converter, &cid_data, &dflt)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+
+ PyObject *obj = NULL;
+ int err = _channel_recv(&_globals.channels, cid, &obj);
+ if (handle_channel_error(err, self, cid)) {
+ return NULL;
+ }
+ Py_XINCREF(dflt);
+ if (obj == NULL) {
+ // Use the default.
+ if (dflt == NULL) {
+ (void)handle_channel_error(ERR_CHANNEL_EMPTY, self, cid);
+ return NULL;
+ }
+ obj = Py_NewRef(dflt);
+ }
+ Py_XDECREF(dflt);
+ return obj;
+}
+
+PyDoc_STRVAR(channel_recv_doc,
+"channel_recv(cid, [default]) -> obj\n\
+\n\
+Return a new object from the data at the front of the channel's queue.\n\
+\n\
+If there is nothing to receive then raise ChannelEmptyError, unless\n\
+a default value is provided. In that case return it.");
+
+static PyObject *
+channel_close(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"cid", "send", "recv", "force", NULL};
+ int64_t cid;
+ struct channel_id_converter_data cid_data = {
+ .module = self,
+ };
+ int send = 0;
+ int recv = 0;
+ int force = 0;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O&|$ppp:channel_close", kwlist,
+ channel_id_converter, &cid_data,
+ &send, &recv, &force)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+
+ int err = _channel_close(&_globals.channels, cid, send-recv, force);
+ if (handle_channel_error(err, self, cid)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(channel_close_doc,
+"channel_close(cid, *, send=None, recv=None, force=False)\n\
+\n\
+Close the channel for all interpreters.\n\
+\n\
+If the channel is empty then the keyword args are ignored and both\n\
+ends are immediately closed. Otherwise, if 'force' is True then\n\
+all queued items are released and both ends are immediately\n\
+closed.\n\
+\n\
+If the channel is not empty *and* 'force' is False then following\n\
+happens:\n\
+\n\
+ * recv is True (regardless of send):\n\
+ - raise ChannelNotEmptyError\n\
+ * recv is None and send is None:\n\
+ - raise ChannelNotEmptyError\n\
+ * send is True and recv is not True:\n\
+ - fully close the 'send' end\n\
+ - close the 'recv' end to interpreters not already receiving\n\
+ - fully close it once empty\n\
+\n\
+Closing an already closed channel results in a ChannelClosedError.\n\
+\n\
+Once the channel's ID has no more ref counts in any interpreter\n\
+the channel will be destroyed.");
+
+static PyObject *
+channel_release(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ // Note that only the current interpreter is affected.
+ static char *kwlist[] = {"cid", "send", "recv", "force", NULL};
+ int64_t cid;
+ struct channel_id_converter_data cid_data = {
+ .module = self,
+ };
+ int send = 0;
+ int recv = 0;
+ int force = 0;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O&|$ppp:channel_release", kwlist,
+ channel_id_converter, &cid_data,
+ &send, &recv, &force)) {
+ return NULL;
+ }
+ cid = cid_data.cid;
+ if (send == 0 && recv == 0) {
+ send = 1;
+ recv = 1;
+ }
+
+ // XXX Handle force is True.
+ // XXX Fix implicit release.
+
+ int err = _channel_drop(&_globals.channels, cid, send, recv);
+ if (handle_channel_error(err, self, cid)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(channel_release_doc,
+"channel_release(cid, *, send=None, recv=None, force=True)\n\
+\n\
+Close the channel for the current interpreter. 'send' and 'recv'\n\
+(bool) may be used to indicate the ends to close. By default both\n\
+ends are closed. Closing an already closed end is a noop.");
+
+static PyObject *
+channel__channel_id(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ module_state *state = get_module_state(self);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyTypeObject *cls = state->ChannelIDType;
+ PyObject *mod = get_module_from_owned_type(cls);
+ if (mod == NULL) {
+ return NULL;
+ }
+ PyObject *cid = _channelid_new(mod, cls, args, kwds);
+ Py_DECREF(mod);
+ return cid;
+}
+
+static PyMethodDef module_functions[] = {
+ {"create", channel_create,
+ METH_NOARGS, channel_create_doc},
+ {"destroy", _PyCFunction_CAST(channel_destroy),
+ METH_VARARGS | METH_KEYWORDS, channel_destroy_doc},
+ {"list_all", channel_list_all,
+ METH_NOARGS, channel_list_all_doc},
+ {"list_interpreters", _PyCFunction_CAST(channel_list_interpreters),
+ METH_VARARGS | METH_KEYWORDS, channel_list_interpreters_doc},
+ {"send", _PyCFunction_CAST(channel_send),
+ METH_VARARGS | METH_KEYWORDS, channel_send_doc},
+ {"recv", _PyCFunction_CAST(channel_recv),
+ METH_VARARGS | METH_KEYWORDS, channel_recv_doc},
+ {"close", _PyCFunction_CAST(channel_close),
+ METH_VARARGS | METH_KEYWORDS, channel_close_doc},
+ {"release", _PyCFunction_CAST(channel_release),
+ METH_VARARGS | METH_KEYWORDS, channel_release_doc},
+ {"_channel_id", _PyCFunction_CAST(channel__channel_id),
+ METH_VARARGS | METH_KEYWORDS, NULL},
+
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* initialization function */
+
+PyDoc_STRVAR(module_doc,
+"This module provides primitive operations to manage Python interpreters.\n\
+The 'interpreters' module provides a more convenient interface.");
+
+static int
+module_exec(PyObject *mod)
+{
+ if (_globals_init() != 0) {
+ return -1;
+ }
+
+ /* Add exception types */
+ if (exceptions_init(mod) != 0) {
+ goto error;
+ }
+
+ /* Add other types */
+ module_state *state = get_module_state(mod);
+ if (state == NULL) {
+ goto error;
+ }
+
+ // ChannelID
+ state->ChannelIDType = add_new_type(
+ mod, &ChannelIDType_spec, _channelid_shared);
+ if (state->ChannelIDType == NULL) {
+ goto error;
+ }
+
+ // Make sure chnnels drop objects owned by this interpreter
+ PyInterpreterState *interp = _get_current_interp();
+ _Py_AtExit(interp, clear_interpreter, (void *)interp);
+
+ return 0;
+
+error:
+ _globals_fini();
+ return -1;
+}
+
+static struct PyModuleDef_Slot module_slots[] = {
+ {Py_mod_exec, module_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static int
+module_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ traverse_module_state(state, visit, arg);
+ return 0;
+}
+
+static int
+module_clear(PyObject *mod)
+{
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ clear_module_state(state);
+ return 0;
+}
+
+static void
+module_free(void *mod)
+{
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ clear_module_state(state);
+ _globals_fini();
+}
+
+static struct PyModuleDef moduledef = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = MODULE_NAME,
+ .m_doc = module_doc,
+ .m_size = sizeof(module_state),
+ .m_methods = module_functions,
+ .m_slots = module_slots,
+ .m_traverse = module_traverse,
+ .m_clear = module_clear,
+ .m_free = (freefunc)module_free,
+};
+
+PyMODINIT_FUNC
+PyInit__xxinterpchannels(void)
+{
+ return PyModuleDef_Init(&moduledef);
+}
diff --git a/contrib/tools/python3/Modules/_xxsubinterpretersmodule.c b/contrib/tools/python3/Modules/_xxsubinterpretersmodule.c
new file mode 100644
index 00000000000..c0958c65dd0
--- /dev/null
+++ b/contrib/tools/python3/Modules/_xxsubinterpretersmodule.c
@@ -0,0 +1,862 @@
+
+/* interpreters module */
+/* low-level access to interpreter primitives */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_initconfig.h" // _PyErr_SetFromPyStatus()
+#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
+#include "pycore_pystate.h" // _PyInterpreterState_SetRunningMain()
+#include "interpreteridobject.h"
+
+
+#define MODULE_NAME "_xxsubinterpreters"
+
+
+static const char *
+_copy_raw_string(PyObject *strobj)
+{
+ const char *str = PyUnicode_AsUTF8(strobj);
+ if (str == NULL) {
+ return NULL;
+ }
+ char *copied = PyMem_RawMalloc(strlen(str)+1);
+ if (copied == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ strcpy(copied, str);
+ return copied;
+}
+
+static PyInterpreterState *
+_get_current_interp(void)
+{
+ // PyInterpreterState_Get() aborts if lookup fails, so don't need
+ // to check the result for NULL.
+ return PyInterpreterState_Get();
+}
+
+static PyObject *
+add_new_exception(PyObject *mod, const char *name, PyObject *base)
+{
+ assert(!PyObject_HasAttrString(mod, name));
+ PyObject *exctype = PyErr_NewException(name, base, NULL);
+ if (exctype == NULL) {
+ return NULL;
+ }
+ int res = PyModule_AddType(mod, (PyTypeObject *)exctype);
+ if (res < 0) {
+ Py_DECREF(exctype);
+ return NULL;
+ }
+ return exctype;
+}
+
+#define ADD_NEW_EXCEPTION(MOD, NAME, BASE) \
+ add_new_exception(MOD, MODULE_NAME "." Py_STRINGIFY(NAME), BASE)
+
+static int
+_release_xid_data(_PyCrossInterpreterData *data)
+{
+ PyObject *exc = PyErr_GetRaisedException();
+ int res = _PyCrossInterpreterData_Release(data);
+ if (res < 0) {
+ /* The owning interpreter is already destroyed. */
+ _PyCrossInterpreterData_Clear(NULL, data);
+ // XXX Emit a warning?
+ PyErr_Clear();
+ }
+ PyErr_SetRaisedException(exc);
+ return res;
+}
+
+
+/* module state *************************************************************/
+
+typedef struct {
+ /* exceptions */
+ PyObject *RunFailedError;
+} module_state;
+
+static inline module_state *
+get_module_state(PyObject *mod)
+{
+ assert(mod != NULL);
+ module_state *state = PyModule_GetState(mod);
+ assert(state != NULL);
+ return state;
+}
+
+static int
+traverse_module_state(module_state *state, visitproc visit, void *arg)
+{
+ /* exceptions */
+ Py_VISIT(state->RunFailedError);
+
+ return 0;
+}
+
+static int
+clear_module_state(module_state *state)
+{
+ /* exceptions */
+ Py_CLEAR(state->RunFailedError);
+
+ return 0;
+}
+
+
+/* data-sharing-specific code ***********************************************/
+
+struct _sharednsitem {
+ const char *name;
+ _PyCrossInterpreterData data;
+};
+
+static void _sharednsitem_clear(struct _sharednsitem *); // forward
+
+static int
+_sharednsitem_init(struct _sharednsitem *item, PyObject *key, PyObject *value)
+{
+ item->name = _copy_raw_string(key);
+ if (item->name == NULL) {
+ return -1;
+ }
+ if (_PyObject_GetCrossInterpreterData(value, &item->data) != 0) {
+ _sharednsitem_clear(item);
+ return -1;
+ }
+ return 0;
+}
+
+static void
+_sharednsitem_clear(struct _sharednsitem *item)
+{
+ if (item->name != NULL) {
+ PyMem_RawFree((void *)item->name);
+ item->name = NULL;
+ }
+ (void)_release_xid_data(&item->data);
+}
+
+static int
+_sharednsitem_apply(struct _sharednsitem *item, PyObject *ns)
+{
+ PyObject *name = PyUnicode_FromString(item->name);
+ if (name == NULL) {
+ return -1;
+ }
+ PyObject *value = _PyCrossInterpreterData_NewObject(&item->data);
+ if (value == NULL) {
+ Py_DECREF(name);
+ return -1;
+ }
+ int res = PyDict_SetItem(ns, name, value);
+ Py_DECREF(name);
+ Py_DECREF(value);
+ return res;
+}
+
+typedef struct _sharedns {
+ Py_ssize_t len;
+ struct _sharednsitem* items;
+} _sharedns;
+
+static _sharedns *
+_sharedns_new(Py_ssize_t len)
+{
+ _sharedns *shared = PyMem_RawCalloc(sizeof(_sharedns), 1);
+ if (shared == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ shared->len = len;
+ shared->items = PyMem_RawCalloc(sizeof(struct _sharednsitem), len);
+ if (shared->items == NULL) {
+ PyErr_NoMemory();
+ PyMem_RawFree(shared);
+ return NULL;
+ }
+ return shared;
+}
+
+static void
+_sharedns_free(_sharedns *shared)
+{
+ for (Py_ssize_t i=0; i < shared->len; i++) {
+ _sharednsitem_clear(&shared->items[i]);
+ }
+ PyMem_RawFree(shared->items);
+ PyMem_RawFree(shared);
+}
+
+static _sharedns *
+_get_shared_ns(PyObject *shareable)
+{
+ if (shareable == NULL || shareable == Py_None) {
+ return NULL;
+ }
+ Py_ssize_t len = PyDict_Size(shareable);
+ if (len == 0) {
+ return NULL;
+ }
+
+ _sharedns *shared = _sharedns_new(len);
+ if (shared == NULL) {
+ return NULL;
+ }
+ Py_ssize_t pos = 0;
+ for (Py_ssize_t i=0; i < len; i++) {
+ PyObject *key, *value;
+ if (PyDict_Next(shareable, &pos, &key, &value) == 0) {
+ break;
+ }
+ if (_sharednsitem_init(&shared->items[i], key, value) != 0) {
+ break;
+ }
+ }
+ if (PyErr_Occurred()) {
+ _sharedns_free(shared);
+ return NULL;
+ }
+ return shared;
+}
+
+static int
+_sharedns_apply(_sharedns *shared, PyObject *ns)
+{
+ for (Py_ssize_t i=0; i < shared->len; i++) {
+ if (_sharednsitem_apply(&shared->items[i], ns) != 0) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+// Ultimately we'd like to preserve enough information about the
+// exception and traceback that we could re-constitute (or at least
+// simulate, a la traceback.TracebackException), and even chain, a copy
+// of the exception in the calling interpreter.
+
+typedef struct _sharedexception {
+ const char *name;
+ const char *msg;
+} _sharedexception;
+
+static const struct _sharedexception no_exception = {
+ .name = NULL,
+ .msg = NULL,
+};
+
+static void
+_sharedexception_clear(_sharedexception *exc)
+{
+ if (exc->name != NULL) {
+ PyMem_RawFree((void *)exc->name);
+ }
+ if (exc->msg != NULL) {
+ PyMem_RawFree((void *)exc->msg);
+ }
+}
+
+static const char *
+_sharedexception_bind(PyObject *exc, _sharedexception *sharedexc)
+{
+ assert(exc != NULL);
+ const char *failure = NULL;
+
+ PyObject *nameobj = PyUnicode_FromFormat("%S", Py_TYPE(exc));
+ if (nameobj == NULL) {
+ failure = "unable to format exception type name";
+ goto error;
+ }
+ sharedexc->name = _copy_raw_string(nameobj);
+ Py_DECREF(nameobj);
+ if (sharedexc->name == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_MemoryError)) {
+ failure = "out of memory copying exception type name";
+ } else {
+ failure = "unable to encode and copy exception type name";
+ }
+ goto error;
+ }
+
+ if (exc != NULL) {
+ PyObject *msgobj = PyUnicode_FromFormat("%S", exc);
+ if (msgobj == NULL) {
+ failure = "unable to format exception message";
+ goto error;
+ }
+ sharedexc->msg = _copy_raw_string(msgobj);
+ Py_DECREF(msgobj);
+ if (sharedexc->msg == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_MemoryError)) {
+ failure = "out of memory copying exception message";
+ } else {
+ failure = "unable to encode and copy exception message";
+ }
+ goto error;
+ }
+ }
+
+ return NULL;
+
+error:
+ assert(failure != NULL);
+ PyErr_Clear();
+ _sharedexception_clear(sharedexc);
+ *sharedexc = no_exception;
+ return failure;
+}
+
+static void
+_sharedexception_apply(_sharedexception *exc, PyObject *wrapperclass)
+{
+ if (exc->name != NULL) {
+ if (exc->msg != NULL) {
+ PyErr_Format(wrapperclass, "%s: %s", exc->name, exc->msg);
+ }
+ else {
+ PyErr_SetString(wrapperclass, exc->name);
+ }
+ }
+ else if (exc->msg != NULL) {
+ PyErr_SetString(wrapperclass, exc->msg);
+ }
+ else {
+ PyErr_SetNone(wrapperclass);
+ }
+}
+
+
+/* interpreter-specific code ************************************************/
+
+static int
+exceptions_init(PyObject *mod)
+{
+ module_state *state = get_module_state(mod);
+ if (state == NULL) {
+ return -1;
+ }
+
+#define ADD(NAME, BASE) \
+ do { \
+ assert(state->NAME == NULL); \
+ state->NAME = ADD_NEW_EXCEPTION(mod, NAME, BASE); \
+ if (state->NAME == NULL) { \
+ return -1; \
+ } \
+ } while (0)
+
+ // An uncaught exception came out of interp_run_string().
+ ADD(RunFailedError, PyExc_RuntimeError);
+#undef ADD
+
+ return 0;
+}
+
+static int
+_run_script(PyInterpreterState *interp, const char *codestr,
+ _sharedns *shared, _sharedexception *sharedexc)
+{
+ if (_PyInterpreterState_SetRunningMain(interp) < 0) {
+ // We skip going through the shared exception.
+ return -1;
+ }
+
+ PyObject *excval = NULL;
+ PyObject *main_mod = _PyInterpreterState_GetMainModule(interp);
+ if (main_mod == NULL) {
+ goto error;
+ }
+ PyObject *ns = PyModule_GetDict(main_mod); // borrowed
+ Py_DECREF(main_mod);
+ if (ns == NULL) {
+ goto error;
+ }
+ Py_INCREF(ns);
+
+ // Apply the cross-interpreter data.
+ if (shared != NULL) {
+ if (_sharedns_apply(shared, ns) != 0) {
+ Py_DECREF(ns);
+ goto error;
+ }
+ }
+
+ // Run the string (see PyRun_SimpleStringFlags).
+ PyObject *result = PyRun_StringFlags(codestr, Py_file_input, ns, ns, NULL);
+ Py_DECREF(ns);
+ if (result == NULL) {
+ goto error;
+ }
+ else {
+ Py_DECREF(result); // We throw away the result.
+ }
+ _PyInterpreterState_SetNotRunningMain(interp);
+
+ *sharedexc = no_exception;
+ return 0;
+
+error:
+ excval = PyErr_GetRaisedException();
+ const char *failure = _sharedexception_bind(excval, sharedexc);
+ if (failure != NULL) {
+ fprintf(stderr,
+ "RunFailedError: script raised an uncaught exception (%s)",
+ failure);
+ PyErr_Clear();
+ }
+ Py_XDECREF(excval);
+ assert(!PyErr_Occurred());
+ _PyInterpreterState_SetNotRunningMain(interp);
+ return -1;
+}
+
+static int
+_run_script_in_interpreter(PyObject *mod, PyInterpreterState *interp,
+ const char *codestr, PyObject *shareables)
+{
+ module_state *state = get_module_state(mod);
+
+ _sharedns *shared = _get_shared_ns(shareables);
+ if (shared == NULL && PyErr_Occurred()) {
+ return -1;
+ }
+
+ // Switch to interpreter.
+ PyThreadState *save_tstate = NULL;
+ if (interp != PyInterpreterState_Get()) {
+ // XXX gh-109860: Using the "head" thread isn't strictly correct.
+ PyThreadState *tstate = PyInterpreterState_ThreadHead(interp);
+ assert(tstate != NULL);
+ // Hack (until gh-109860): The interpreter's initial thread state
+ // is least likely to break.
+ while(tstate->next != NULL) {
+ tstate = tstate->next;
+ }
+ // We must do this check before switching interpreters, so any
+ // exception gets raised in the right one.
+ // XXX gh-109860: Drop this redundant check once we stop
+ // re-using tstates that might already be in use.
+ if (_PyInterpreterState_IsRunningMain(interp)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "interpreter already running");
+ if (shared != NULL) {
+ _sharedns_free(shared);
+ }
+ return -1;
+ }
+ // XXX Possible GILState issues?
+ save_tstate = PyThreadState_Swap(tstate);
+ }
+
+ // Run the script.
+ _sharedexception exc = {NULL, NULL};
+ int result = _run_script(interp, codestr, shared, &exc);
+
+ // Switch back.
+ if (save_tstate != NULL) {
+ PyThreadState_Swap(save_tstate);
+ }
+
+ // Propagate any exception out to the caller.
+ if (exc.name != NULL) {
+ assert(state != NULL);
+ _sharedexception_apply(&exc, state->RunFailedError);
+ }
+ else if (result != 0) {
+ if (!PyErr_Occurred()) {
+ // We were unable to allocate a shared exception.
+ PyErr_NoMemory();
+ }
+ }
+
+ if (shared != NULL) {
+ _sharedns_free(shared);
+ }
+
+ return result;
+}
+
+
+/* module level code ********************************************************/
+
+static PyObject *
+interp_create(PyObject *self, PyObject *args, PyObject *kwds)
+{
+
+ static char *kwlist[] = {"isolated", NULL};
+ int isolated = 1;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$i:create", kwlist,
+ &isolated)) {
+ return NULL;
+ }
+
+ // Create and initialize the new interpreter.
+ PyThreadState *save_tstate = PyThreadState_Get();
+ assert(save_tstate != NULL);
+ const PyInterpreterConfig config = isolated
+ ? (PyInterpreterConfig)_PyInterpreterConfig_INIT
+ : (PyInterpreterConfig)_PyInterpreterConfig_LEGACY_INIT;
+ // XXX Possible GILState issues?
+ PyThreadState *tstate = NULL;
+ PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);
+ PyThreadState_Swap(save_tstate);
+ if (PyStatus_Exception(status)) {
+ /* Since no new thread state was created, there is no exception to
+ propagate; raise a fresh one after swapping in the old thread
+ state. */
+ _PyErr_SetFromPyStatus(status);
+ PyObject *exc = PyErr_GetRaisedException();
+ PyErr_SetString(PyExc_RuntimeError, "interpreter creation failed");
+ _PyErr_ChainExceptions1(exc);
+ return NULL;
+ }
+ assert(tstate != NULL);
+ PyInterpreterState *interp = PyThreadState_GetInterpreter(tstate);
+ PyObject *idobj = _PyInterpreterState_GetIDObject(interp);
+ if (idobj == NULL) {
+ // XXX Possible GILState issues?
+ save_tstate = PyThreadState_Swap(tstate);
+ Py_EndInterpreter(tstate);
+ PyThreadState_Swap(save_tstate);
+ return NULL;
+ }
+ _PyInterpreterState_RequireIDRef(interp, 1);
+ return idobj;
+}
+
+PyDoc_STRVAR(create_doc,
+"create() -> ID\n\
+\n\
+Create a new interpreter and return a unique generated ID.");
+
+
+static PyObject *
+interp_destroy(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"id", NULL};
+ PyObject *id;
+ // XXX Use "L" for id?
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O:destroy", kwlist, &id)) {
+ return NULL;
+ }
+
+ // Look up the interpreter.
+ PyInterpreterState *interp = _PyInterpreterID_LookUp(id);
+ if (interp == NULL) {
+ return NULL;
+ }
+
+ // Ensure we don't try to destroy the current interpreter.
+ PyInterpreterState *current = _get_current_interp();
+ if (current == NULL) {
+ return NULL;
+ }
+ if (interp == current) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot destroy the current interpreter");
+ return NULL;
+ }
+
+ // Ensure the interpreter isn't running.
+ /* XXX We *could* support destroying a running interpreter but
+ aren't going to worry about it for now. */
+ if (_PyInterpreterState_IsRunningMain(interp)) {
+ PyErr_Format(PyExc_RuntimeError, "interpreter running");
+ return NULL;
+ }
+
+ // Destroy the interpreter.
+ // XXX gh-109860: Using the "head" thread isn't strictly correct.
+ PyThreadState *tstate = PyInterpreterState_ThreadHead(interp);
+ assert(tstate != NULL);
+ // Hack (until gh-109860): The interpreter's initial thread state
+ // is least likely to break.
+ while(tstate->next != NULL) {
+ tstate = tstate->next;
+ }
+ // XXX Possible GILState issues?
+ PyThreadState *save_tstate = PyThreadState_Swap(tstate);
+ Py_EndInterpreter(tstate);
+ PyThreadState_Swap(save_tstate);
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(destroy_doc,
+"destroy(id)\n\
+\n\
+Destroy the identified interpreter.\n\
+\n\
+Attempting to destroy the current interpreter results in a RuntimeError.\n\
+So does an unrecognized ID.");
+
+
+static PyObject *
+interp_list_all(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *ids, *id;
+ PyInterpreterState *interp;
+
+ ids = PyList_New(0);
+ if (ids == NULL) {
+ return NULL;
+ }
+
+ interp = PyInterpreterState_Head();
+ while (interp != NULL) {
+ id = _PyInterpreterState_GetIDObject(interp);
+ if (id == NULL) {
+ Py_DECREF(ids);
+ return NULL;
+ }
+ // insert at front of list
+ int res = PyList_Insert(ids, 0, id);
+ Py_DECREF(id);
+ if (res < 0) {
+ Py_DECREF(ids);
+ return NULL;
+ }
+
+ interp = PyInterpreterState_Next(interp);
+ }
+
+ return ids;
+}
+
+PyDoc_STRVAR(list_all_doc,
+"list_all() -> [ID]\n\
+\n\
+Return a list containing the ID of every existing interpreter.");
+
+
+static PyObject *
+interp_get_current(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyInterpreterState *interp =_get_current_interp();
+ if (interp == NULL) {
+ return NULL;
+ }
+ return _PyInterpreterState_GetIDObject(interp);
+}
+
+PyDoc_STRVAR(get_current_doc,
+"get_current() -> ID\n\
+\n\
+Return the ID of current interpreter.");
+
+
+static PyObject *
+interp_get_main(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ // Currently, 0 is always the main interpreter.
+ int64_t id = 0;
+ return _PyInterpreterID_New(id);
+}
+
+PyDoc_STRVAR(get_main_doc,
+"get_main() -> ID\n\
+\n\
+Return the ID of main interpreter.");
+
+
+static PyObject *
+interp_run_string(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"id", "script", "shared", NULL};
+ PyObject *id, *code;
+ PyObject *shared = NULL;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "OU|O:run_string", kwlist,
+ &id, &code, &shared)) {
+ return NULL;
+ }
+
+ // Look up the interpreter.
+ PyInterpreterState *interp = _PyInterpreterID_LookUp(id);
+ if (interp == NULL) {
+ return NULL;
+ }
+
+ // Extract code.
+ Py_ssize_t size;
+ const char *codestr = PyUnicode_AsUTF8AndSize(code, &size);
+ if (codestr == NULL) {
+ return NULL;
+ }
+ if (strlen(codestr) != (size_t)size) {
+ PyErr_SetString(PyExc_ValueError,
+ "source code string cannot contain null bytes");
+ return NULL;
+ }
+
+ // Run the code in the interpreter.
+ if (_run_script_in_interpreter(self, interp, codestr, shared) != 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(run_string_doc,
+"run_string(id, script, shared)\n\
+\n\
+Execute the provided string in the identified interpreter.\n\
+\n\
+See PyRun_SimpleStrings.");
+
+
+static PyObject *
+object_is_shareable(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"obj", NULL};
+ PyObject *obj;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O:is_shareable", kwlist, &obj)) {
+ return NULL;
+ }
+
+ if (_PyObject_CheckCrossInterpreterData(obj) == 0) {
+ Py_RETURN_TRUE;
+ }
+ PyErr_Clear();
+ Py_RETURN_FALSE;
+}
+
+PyDoc_STRVAR(is_shareable_doc,
+"is_shareable(obj) -> bool\n\
+\n\
+Return True if the object's data may be shared between interpreters and\n\
+False otherwise.");
+
+
+static PyObject *
+interp_is_running(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"id", NULL};
+ PyObject *id;
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O:is_running", kwlist, &id)) {
+ return NULL;
+ }
+
+ PyInterpreterState *interp = _PyInterpreterID_LookUp(id);
+ if (interp == NULL) {
+ return NULL;
+ }
+ if (_PyInterpreterState_IsRunningMain(interp)) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+PyDoc_STRVAR(is_running_doc,
+"is_running(id) -> bool\n\
+\n\
+Return whether or not the identified interpreter is running.");
+
+
+static PyMethodDef module_functions[] = {
+ {"create", _PyCFunction_CAST(interp_create),
+ METH_VARARGS | METH_KEYWORDS, create_doc},
+ {"destroy", _PyCFunction_CAST(interp_destroy),
+ METH_VARARGS | METH_KEYWORDS, destroy_doc},
+ {"list_all", interp_list_all,
+ METH_NOARGS, list_all_doc},
+ {"get_current", interp_get_current,
+ METH_NOARGS, get_current_doc},
+ {"get_main", interp_get_main,
+ METH_NOARGS, get_main_doc},
+
+ {"is_running", _PyCFunction_CAST(interp_is_running),
+ METH_VARARGS | METH_KEYWORDS, is_running_doc},
+ {"run_string", _PyCFunction_CAST(interp_run_string),
+ METH_VARARGS | METH_KEYWORDS, run_string_doc},
+
+ {"is_shareable", _PyCFunction_CAST(object_is_shareable),
+ METH_VARARGS | METH_KEYWORDS, is_shareable_doc},
+
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* initialization function */
+
+PyDoc_STRVAR(module_doc,
+"This module provides primitive operations to manage Python interpreters.\n\
+The 'interpreters' module provides a more convenient interface.");
+
+static int
+module_exec(PyObject *mod)
+{
+ /* Add exception types */
+ if (exceptions_init(mod) != 0) {
+ goto error;
+ }
+
+ // PyInterpreterID
+ if (PyModule_AddType(mod, &_PyInterpreterID_Type) < 0) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ return -1;
+}
+
+static struct PyModuleDef_Slot module_slots[] = {
+ {Py_mod_exec, module_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static int
+module_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ traverse_module_state(state, visit, arg);
+ return 0;
+}
+
+static int
+module_clear(PyObject *mod)
+{
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ clear_module_state(state);
+ return 0;
+}
+
+static void
+module_free(void *mod)
+{
+ module_state *state = get_module_state(mod);
+ assert(state != NULL);
+ clear_module_state(state);
+}
+
+static struct PyModuleDef moduledef = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = MODULE_NAME,
+ .m_doc = module_doc,
+ .m_size = sizeof(module_state),
+ .m_methods = module_functions,
+ .m_slots = module_slots,
+ .m_traverse = module_traverse,
+ .m_clear = module_clear,
+ .m_free = (freefunc)module_free,
+};
+
+PyMODINIT_FUNC
+PyInit__xxsubinterpreters(void)
+{
+ return PyModuleDef_Init(&moduledef);
+}
diff --git a/contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c b/contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c
new file mode 100644
index 00000000000..e0694de6719
--- /dev/null
+++ b/contrib/tools/python3/Modules/_xxtestfuzz/_xxtestfuzz.c
@@ -0,0 +1,48 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+static PyObject* _fuzz_run(PyObject* self, PyObject* args) {
+ const char* buf;
+ Py_ssize_t size;
+ if (!PyArg_ParseTuple(args, "s#", &buf, &size)) {
+ return NULL;
+ }
+ int rv = LLVMFuzzerTestOneInput((const uint8_t*)buf, size);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ if (rv != 0) {
+ // Nonzero return codes are reserved for future use.
+ PyErr_Format(
+ PyExc_RuntimeError, "Nonzero return code from fuzzer: %d", rv);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef module_methods[] = {
+ {"run", (PyCFunction)_fuzz_run, METH_VARARGS, ""},
+ {NULL},
+};
+
+static struct PyModuleDef _fuzzmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_fuzz",
+ NULL,
+ 0,
+ module_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__xxtestfuzz(void)
+{
+ return PyModule_Create(&_fuzzmodule);
+}
diff --git a/contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c b/contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c
new file mode 100644
index 00000000000..cd97206d181
--- /dev/null
+++ b/contrib/tools/python3/Modules/_xxtestfuzz/fuzzer.c
@@ -0,0 +1,569 @@
+/* A fuzz test for CPython.
+
+ The only exposed function is LLVMFuzzerTestOneInput, which is called by
+ fuzzers and by the _fuzz module for smoke tests.
+
+ To build exactly one fuzz test, as when running in oss-fuzz etc.,
+ build with -D _Py_FUZZ_ONE and -D _Py_FUZZ_<test_name>. e.g. to build
+ LLVMFuzzerTestOneInput to only run "fuzz_builtin_float", build this file with
+ -D _Py_FUZZ_ONE -D _Py_FUZZ_fuzz_builtin_float.
+
+ See the source code for LLVMFuzzerTestOneInput for details. */
+
+#include <Python.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+/* Fuzz PyFloat_FromString as a proxy for float(str). */
+static int fuzz_builtin_float(const char* data, size_t size) {
+ PyObject* s = PyBytes_FromStringAndSize(data, size);
+ if (s == NULL) return 0;
+ PyObject* f = PyFloat_FromString(s);
+ if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ }
+
+ Py_XDECREF(f);
+ Py_DECREF(s);
+ return 0;
+}
+
+#define MAX_INT_TEST_SIZE 0x10000
+
+/* Fuzz PyLong_FromUnicodeObject as a proxy for int(str). */
+static int fuzz_builtin_int(const char* data, size_t size) {
+ /* Ignore test cases with very long ints to avoid timeouts
+ int("9" * 1000000) is not a very interesting test caase */
+ if (size > MAX_INT_TEST_SIZE) {
+ return 0;
+ }
+ /* Pick a random valid base. (When the fuzzed function takes extra
+ parameters, it's somewhat normal to hash the input to generate those
+ parameters. We want to exercise all code paths, so we do so here.) */
+ int base = _Py_HashBytes(data, size) % 37;
+ if (base == 1) {
+ // 1 is the only number between 0 and 36 that is not a valid base.
+ base = 0;
+ }
+ if (base == -1) {
+ return 0; // An error occurred, bail early.
+ }
+ if (base < 0) {
+ base = -base;
+ }
+
+ PyObject* s = PyUnicode_FromStringAndSize(data, size);
+ if (s == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
+ PyErr_Clear();
+ }
+ return 0;
+ }
+ PyObject* l = PyLong_FromUnicodeObject(s, base);
+ if (l == NULL && PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ }
+ PyErr_Clear();
+ Py_XDECREF(l);
+ Py_DECREF(s);
+ return 0;
+}
+
+/* Fuzz PyUnicode_FromStringAndSize as a proxy for unicode(str). */
+static int fuzz_builtin_unicode(const char* data, size_t size) {
+ PyObject* s = PyUnicode_FromStringAndSize(data, size);
+ if (s == NULL && PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) {
+ PyErr_Clear();
+ }
+ Py_XDECREF(s);
+ return 0;
+}
+
+
+PyObject* struct_unpack_method = NULL;
+PyObject* struct_error = NULL;
+/* Called by LLVMFuzzerTestOneInput for initialization */
+static int init_struct_unpack(void) {
+ /* Import struct.unpack */
+ PyObject* struct_module = PyImport_ImportModule("struct");
+ if (struct_module == NULL) {
+ return 0;
+ }
+ struct_error = PyObject_GetAttrString(struct_module, "error");
+ if (struct_error == NULL) {
+ return 0;
+ }
+ struct_unpack_method = PyObject_GetAttrString(struct_module, "unpack");
+ return struct_unpack_method != NULL;
+}
+/* Fuzz struct.unpack(x, y) */
+static int fuzz_struct_unpack(const char* data, size_t size) {
+ /* Everything up to the first null byte is considered the
+ format. Everything after is the buffer */
+ const char* first_null = memchr(data, '\0', size);
+ if (first_null == NULL) {
+ return 0;
+ }
+
+ size_t format_length = first_null - data;
+ size_t buffer_length = size - format_length - 1;
+
+ PyObject* pattern = PyBytes_FromStringAndSize(data, format_length);
+ if (pattern == NULL) {
+ return 0;
+ }
+ PyObject* buffer = PyBytes_FromStringAndSize(first_null + 1, buffer_length);
+ if (buffer == NULL) {
+ Py_DECREF(pattern);
+ return 0;
+ }
+
+ PyObject* unpacked = PyObject_CallFunctionObjArgs(
+ struct_unpack_method, pattern, buffer, NULL);
+ /* Ignore any overflow errors, these are easily triggered accidentally */
+ if (unpacked == NULL && PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Clear();
+ }
+ /* The pascal format string will throw a negative size when passing 0
+ like: struct.unpack('0p', b'') */
+ if (unpacked == NULL && PyErr_ExceptionMatches(PyExc_SystemError)) {
+ PyErr_Clear();
+ }
+ /* Ignore any struct.error exceptions, these can be caused by invalid
+ formats or incomplete buffers both of which are common. */
+ if (unpacked == NULL && PyErr_ExceptionMatches(struct_error)) {
+ PyErr_Clear();
+ }
+
+ Py_XDECREF(unpacked);
+ Py_DECREF(pattern);
+ Py_DECREF(buffer);
+ return 0;
+}
+
+
+#define MAX_JSON_TEST_SIZE 0x100000
+
+PyObject* json_loads_method = NULL;
+/* Called by LLVMFuzzerTestOneInput for initialization */
+static int init_json_loads(void) {
+ /* Import json.loads */
+ PyObject* json_module = PyImport_ImportModule("json");
+ if (json_module == NULL) {
+ return 0;
+ }
+ json_loads_method = PyObject_GetAttrString(json_module, "loads");
+ return json_loads_method != NULL;
+}
+/* Fuzz json.loads(x) */
+static int fuzz_json_loads(const char* data, size_t size) {
+ /* Since python supports arbitrarily large ints in JSON,
+ long inputs can lead to timeouts on boring inputs like
+ `json.loads("9" * 100000)` */
+ if (size > MAX_JSON_TEST_SIZE) {
+ return 0;
+ }
+ PyObject* input_bytes = PyBytes_FromStringAndSize(data, size);
+ if (input_bytes == NULL) {
+ return 0;
+ }
+ PyObject* parsed = PyObject_CallOneArg(json_loads_method, input_bytes);
+ if (parsed == NULL) {
+ /* Ignore ValueError as the fuzzer will more than likely
+ generate some invalid json and values */
+ if (PyErr_ExceptionMatches(PyExc_ValueError) ||
+ /* Ignore RecursionError as the fuzzer generates long sequences of
+ arrays such as `[[[...` */
+ PyErr_ExceptionMatches(PyExc_RecursionError) ||
+ /* Ignore unicode errors, invalid byte sequences are common */
+ PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)
+ ) {
+ PyErr_Clear();
+ }
+ }
+ Py_DECREF(input_bytes);
+ Py_XDECREF(parsed);
+ return 0;
+}
+
+#define MAX_RE_TEST_SIZE 0x10000
+
+PyObject* re_compile_method = NULL;
+PyObject* re_error_exception = NULL;
+int RE_FLAG_DEBUG = 0;
+/* Called by LLVMFuzzerTestOneInput for initialization */
+static int init_sre_compile(void) {
+ /* Import sre_compile.compile and sre.error */
+ PyObject* re_module = PyImport_ImportModule("re");
+ if (re_module == NULL) {
+ return 0;
+ }
+ re_compile_method = PyObject_GetAttrString(re_module, "compile");
+ if (re_compile_method == NULL) {
+ return 0;
+ }
+
+ re_error_exception = PyObject_GetAttrString(re_module, "error");
+ if (re_error_exception == NULL) {
+ return 0;
+ }
+ PyObject* debug_flag = PyObject_GetAttrString(re_module, "DEBUG");
+ if (debug_flag == NULL) {
+ return 0;
+ }
+ RE_FLAG_DEBUG = PyLong_AsLong(debug_flag);
+ return 1;
+}
+/* Fuzz re.compile(x) */
+static int fuzz_sre_compile(const char* data, size_t size) {
+ /* Ignore really long regex patterns that will timeout the fuzzer */
+ if (size > MAX_RE_TEST_SIZE) {
+ return 0;
+ }
+ /* We treat the first 2 bytes of the input as a number for the flags */
+ if (size < 2) {
+ return 0;
+ }
+ uint16_t flags = ((uint16_t*) data)[0];
+ /* We remove the SRE_FLAG_DEBUG if present. This is because it
+ prints to stdout which greatly decreases fuzzing speed */
+ flags &= ~RE_FLAG_DEBUG;
+
+ /* Pull the pattern from the remaining bytes */
+ PyObject* pattern_bytes = PyBytes_FromStringAndSize(data + 2, size - 2);
+ if (pattern_bytes == NULL) {
+ return 0;
+ }
+ PyObject* flags_obj = PyLong_FromUnsignedLong(flags);
+ if (flags_obj == NULL) {
+ Py_DECREF(pattern_bytes);
+ return 0;
+ }
+
+ /* compiled = re.compile(data[2:], data[0:2] */
+ PyObject* compiled = PyObject_CallFunctionObjArgs(
+ re_compile_method, pattern_bytes, flags_obj, NULL);
+ /* Ignore ValueError as the fuzzer will more than likely
+ generate some invalid combination of flags */
+ if (compiled == NULL && PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ }
+ /* Ignore some common errors thrown by sre_parse:
+ Overflow, Assertion, Recursion and Index */
+ if (compiled == NULL && (PyErr_ExceptionMatches(PyExc_OverflowError) ||
+ PyErr_ExceptionMatches(PyExc_AssertionError) ||
+ PyErr_ExceptionMatches(PyExc_RecursionError) ||
+ PyErr_ExceptionMatches(PyExc_IndexError))
+ ) {
+ PyErr_Clear();
+ }
+ /* Ignore re.error */
+ if (compiled == NULL && PyErr_ExceptionMatches(re_error_exception)) {
+ PyErr_Clear();
+ }
+
+ Py_DECREF(pattern_bytes);
+ Py_DECREF(flags_obj);
+ Py_XDECREF(compiled);
+ return 0;
+}
+
+/* Some random patterns used to test re.match.
+ Be careful not to add catostraphically slow regexes here, we want to
+ exercise the matching code without causing timeouts.*/
+static const char* regex_patterns[] = {
+ ".", "^", "abc", "abc|def", "^xxx$", "\\b", "()", "[a-zA-Z0-9]",
+ "abc+", "[^A-Z]", "[x]", "(?=)", "a{z}", "a+b", "a*?", "a??", "a+?",
+ "{}", "a{,}", "{", "}", "^\\(*\\d{3}\\)*( |-)*\\d{3}( |-)*\\d{4}$",
+ "(?:a*)*", "a{1,2}?"
+};
+const size_t NUM_PATTERNS = sizeof(regex_patterns) / sizeof(regex_patterns[0]);
+PyObject** compiled_patterns = NULL;
+/* Called by LLVMFuzzerTestOneInput for initialization */
+static int init_sre_match(void) {
+ PyObject* re_module = PyImport_ImportModule("re");
+ if (re_module == NULL) {
+ return 0;
+ }
+ compiled_patterns = (PyObject**) PyMem_RawMalloc(
+ sizeof(PyObject*) * NUM_PATTERNS);
+ if (compiled_patterns == NULL) {
+ PyErr_NoMemory();
+ return 0;
+ }
+
+ /* Precompile all the regex patterns on the first run for faster fuzzing */
+ for (size_t i = 0; i < NUM_PATTERNS; i++) {
+ PyObject* compiled = PyObject_CallMethod(
+ re_module, "compile", "y", regex_patterns[i]);
+ /* Bail if any of the patterns fail to compile */
+ if (compiled == NULL) {
+ return 0;
+ }
+ compiled_patterns[i] = compiled;
+ }
+ return 1;
+}
+/* Fuzz re.match(x) */
+static int fuzz_sre_match(const char* data, size_t size) {
+ if (size < 1 || size > MAX_RE_TEST_SIZE) {
+ return 0;
+ }
+ /* Use the first byte as a uint8_t specifying the index of the
+ regex to use */
+ unsigned char idx = (unsigned char) data[0];
+ idx = idx % NUM_PATTERNS;
+
+ /* Pull the string to match from the remaining bytes */
+ PyObject* to_match = PyBytes_FromStringAndSize(data + 1, size - 1);
+ if (to_match == NULL) {
+ return 0;
+ }
+
+ PyObject* pattern = compiled_patterns[idx];
+ PyObject* match_callable = PyObject_GetAttrString(pattern, "match");
+
+ PyObject* matches = PyObject_CallOneArg(match_callable, to_match);
+
+ Py_XDECREF(matches);
+ Py_DECREF(match_callable);
+ Py_DECREF(to_match);
+ return 0;
+}
+
+#define MAX_CSV_TEST_SIZE 0x100000
+PyObject* csv_module = NULL;
+PyObject* csv_error = NULL;
+/* Called by LLVMFuzzerTestOneInput for initialization */
+static int init_csv_reader(void) {
+ /* Import csv and csv.Error */
+ csv_module = PyImport_ImportModule("csv");
+ if (csv_module == NULL) {
+ return 0;
+ }
+ csv_error = PyObject_GetAttrString(csv_module, "Error");
+ return csv_error != NULL;
+}
+/* Fuzz csv.reader([x]) */
+static int fuzz_csv_reader(const char* data, size_t size) {
+ if (size < 1 || size > MAX_CSV_TEST_SIZE) {
+ return 0;
+ }
+ /* Ignore non null-terminated strings since _csv can't handle
+ embedded nulls */
+ if (memchr(data, '\0', size) == NULL) {
+ return 0;
+ }
+
+ PyObject* s = PyUnicode_FromString(data);
+ /* Ignore exceptions until we have a valid string */
+ if (s == NULL) {
+ PyErr_Clear();
+ return 0;
+ }
+
+ /* Split on \n so we can test multiple lines */
+ PyObject* lines = PyObject_CallMethod(s, "split", "s", "\n");
+ if (lines == NULL) {
+ Py_DECREF(s);
+ return 0;
+ }
+
+ PyObject* reader = PyObject_CallMethod(csv_module, "reader", "N", lines);
+ if (reader) {
+ /* Consume all of the reader as an iterator */
+ PyObject* parsed_line;
+ while ((parsed_line = PyIter_Next(reader))) {
+ Py_DECREF(parsed_line);
+ }
+ }
+
+ /* Ignore csv.Error because we're probably going to generate
+ some bad files (embedded new-lines, unterminated quotes etc) */
+ if (PyErr_ExceptionMatches(csv_error)) {
+ PyErr_Clear();
+ }
+
+ Py_XDECREF(reader);
+ Py_DECREF(s);
+ return 0;
+}
+
+#define MAX_AST_LITERAL_EVAL_TEST_SIZE 0x100000
+PyObject* ast_literal_eval_method = NULL;
+/* Called by LLVMFuzzerTestOneInput for initialization */
+static int init_ast_literal_eval(void) {
+ PyObject* ast_module = PyImport_ImportModule("ast");
+ if (ast_module == NULL) {
+ return 0;
+ }
+ ast_literal_eval_method = PyObject_GetAttrString(ast_module, "literal_eval");
+ return ast_literal_eval_method != NULL;
+}
+/* Fuzz ast.literal_eval(x) */
+static int fuzz_ast_literal_eval(const char* data, size_t size) {
+ if (size > MAX_AST_LITERAL_EVAL_TEST_SIZE) {
+ return 0;
+ }
+ /* Ignore non null-terminated strings since ast can't handle
+ embedded nulls */
+ if (memchr(data, '\0', size) == NULL) {
+ return 0;
+ }
+
+ PyObject* s = PyUnicode_FromString(data);
+ /* Ignore exceptions until we have a valid string */
+ if (s == NULL) {
+ PyErr_Clear();
+ return 0;
+ }
+
+ PyObject* literal = PyObject_CallOneArg(ast_literal_eval_method, s);
+ /* Ignore some common errors thrown by ast.literal_eval */
+ if (literal == NULL && (PyErr_ExceptionMatches(PyExc_ValueError) ||
+ PyErr_ExceptionMatches(PyExc_TypeError) ||
+ PyErr_ExceptionMatches(PyExc_SyntaxError) ||
+ PyErr_ExceptionMatches(PyExc_MemoryError) ||
+ PyErr_ExceptionMatches(PyExc_RecursionError))
+ ) {
+ PyErr_Clear();
+ }
+
+ Py_XDECREF(literal);
+ Py_DECREF(s);
+ return 0;
+}
+
+/* Run fuzzer and abort on failure. */
+static int _run_fuzz(const uint8_t *data, size_t size, int(*fuzzer)(const char* , size_t)) {
+ int rv = fuzzer((const char*) data, size);
+ if (PyErr_Occurred()) {
+ /* Fuzz tests should handle expected errors for themselves.
+ This is last-ditch check in case they didn't. */
+ PyErr_Print();
+ abort();
+ }
+ /* Someday the return value might mean something, propagate it. */
+ return rv;
+}
+
+/* CPython generates a lot of leak warnings for whatever reason. */
+int __lsan_is_turned_off(void) { return 1; }
+
+
+int LLVMFuzzerInitialize(int *argc, char ***argv) {
+ PyConfig config;
+ PyConfig_InitPythonConfig(&config);
+ config.install_signal_handlers = 0;
+ /* Raise the limit above the default allows exercising larger things
+ * now that we fall back to the _pylong module for large values. */
+ config.int_max_str_digits = 8086;
+ PyStatus status;
+ status = PyConfig_SetBytesString(&config, &config.program_name, *argv[0]);
+ if (PyStatus_Exception(status)) {
+ goto fail;
+ }
+
+ status = Py_InitializeFromConfig(&config);
+ if (PyStatus_Exception(status)) {
+ goto fail;
+ }
+ PyConfig_Clear(&config);
+
+ return 0;
+
+fail:
+ PyConfig_Clear(&config);
+ Py_ExitStatusException(status);
+}
+
+/* Fuzz test interface.
+ This returns the bitwise or of all fuzz test's return values.
+
+ All fuzz tests must return 0, as all nonzero return codes are reserved for
+ future use -- we propagate the return values for that future case.
+ (And we bitwise or when running multiple tests to verify that normally we
+ only return 0.) */
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ assert(Py_IsInitialized());
+
+ int rv = 0;
+
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_builtin_float)
+ rv |= _run_fuzz(data, size, fuzz_builtin_float);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_builtin_int)
+ rv |= _run_fuzz(data, size, fuzz_builtin_int);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_builtin_unicode)
+ rv |= _run_fuzz(data, size, fuzz_builtin_unicode);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_struct_unpack)
+ static int STRUCT_UNPACK_INITIALIZED = 0;
+ if (!STRUCT_UNPACK_INITIALIZED && !init_struct_unpack()) {
+ PyErr_Print();
+ abort();
+ } else {
+ STRUCT_UNPACK_INITIALIZED = 1;
+ }
+ rv |= _run_fuzz(data, size, fuzz_struct_unpack);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_json_loads)
+ static int JSON_LOADS_INITIALIZED = 0;
+ if (!JSON_LOADS_INITIALIZED && !init_json_loads()) {
+ PyErr_Print();
+ abort();
+ } else {
+ JSON_LOADS_INITIALIZED = 1;
+ }
+
+ rv |= _run_fuzz(data, size, fuzz_json_loads);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_sre_compile)
+ static int SRE_COMPILE_INITIALIZED = 0;
+ if (!SRE_COMPILE_INITIALIZED && !init_sre_compile()) {
+ PyErr_Print();
+ abort();
+ } else {
+ SRE_COMPILE_INITIALIZED = 1;
+ }
+
+ if (SRE_COMPILE_INITIALIZED) {
+ rv |= _run_fuzz(data, size, fuzz_sre_compile);
+ }
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_sre_match)
+ static int SRE_MATCH_INITIALIZED = 0;
+ if (!SRE_MATCH_INITIALIZED && !init_sre_match()) {
+ PyErr_Print();
+ abort();
+ } else {
+ SRE_MATCH_INITIALIZED = 1;
+ }
+
+ rv |= _run_fuzz(data, size, fuzz_sre_match);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_csv_reader)
+ static int CSV_READER_INITIALIZED = 0;
+ if (!CSV_READER_INITIALIZED && !init_csv_reader()) {
+ PyErr_Print();
+ abort();
+ } else {
+ CSV_READER_INITIALIZED = 1;
+ }
+
+ rv |= _run_fuzz(data, size, fuzz_csv_reader);
+#endif
+#if !defined(_Py_FUZZ_ONE) || defined(_Py_FUZZ_fuzz_ast_literal_eval)
+ static int AST_LITERAL_EVAL_INITIALIZED = 0;
+ if (!AST_LITERAL_EVAL_INITIALIZED && !init_ast_literal_eval()) {
+ PyErr_Print();
+ abort();
+ } else {
+ AST_LITERAL_EVAL_INITIALIZED = 1;
+ }
+
+ rv |= _run_fuzz(data, size, fuzz_ast_literal_eval);
+#endif
+ return rv;
+}
diff --git a/contrib/tools/python3/Modules/_zoneinfo.c b/contrib/tools/python3/Modules/_zoneinfo.c
new file mode 100644
index 00000000000..8fc86162410
--- /dev/null
+++ b/contrib/tools/python3/Modules/_zoneinfo.c
@@ -0,0 +1,2784 @@
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_long.h" // _PyLong_GetOne()
+#include "structmember.h"
+
+#include <ctype.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "datetime.h"
+
+#include "clinic/_zoneinfo.c.h"
+/*[clinic input]
+module zoneinfo
+class zoneinfo.ZoneInfo "PyObject *" "PyTypeObject *"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d12c73c0eef36df8]*/
+
+
+typedef struct TransitionRuleType TransitionRuleType;
+typedef struct StrongCacheNode StrongCacheNode;
+
+typedef struct {
+ PyObject *utcoff;
+ PyObject *dstoff;
+ PyObject *tzname;
+ long utcoff_seconds;
+} _ttinfo;
+
+typedef struct {
+ _ttinfo std;
+ _ttinfo dst;
+ int dst_diff;
+ TransitionRuleType *start;
+ TransitionRuleType *end;
+ unsigned char std_only;
+} _tzrule;
+
+typedef struct {
+ PyDateTime_TZInfo base;
+ PyObject *key;
+ PyObject *file_repr;
+ PyObject *weakreflist;
+ size_t num_transitions;
+ size_t num_ttinfos;
+ int64_t *trans_list_utc;
+ int64_t *trans_list_wall[2];
+ _ttinfo **trans_ttinfos; // References to the ttinfo for each transition
+ _ttinfo *ttinfo_before;
+ _tzrule tzrule_after;
+ _ttinfo *_ttinfos; // Unique array of ttinfos for ease of deallocation
+ unsigned char fixed_offset;
+ unsigned char source;
+} PyZoneInfo_ZoneInfo;
+
+struct TransitionRuleType {
+ int64_t (*year_to_timestamp)(TransitionRuleType *, int);
+};
+
+typedef struct {
+ TransitionRuleType base;
+ uint8_t month; /* 1 - 12 */
+ uint8_t week; /* 1 - 5 */
+ uint8_t day; /* 0 - 6 */
+ int16_t hour; /* -167 - 167, RFC 8536 §3.3.1 */
+ int8_t minute; /* signed 2 digits */
+ int8_t second; /* signed 2 digits */
+} CalendarRule;
+
+typedef struct {
+ TransitionRuleType base;
+ uint8_t julian; /* 0, 1 */
+ uint16_t day; /* 0 - 365 */
+ int16_t hour; /* -167 - 167, RFC 8536 §3.3.1 */
+ int8_t minute; /* signed 2 digits */
+ int8_t second; /* signed 2 digits */
+} DayRule;
+
+struct StrongCacheNode {
+ StrongCacheNode *next;
+ StrongCacheNode *prev;
+ PyObject *key;
+ PyObject *zone;
+};
+
+typedef struct {
+ PyTypeObject *ZoneInfoType;
+
+ // Imports
+ PyObject *io_open;
+ PyObject *_tzpath_find_tzfile;
+ PyObject *_common_mod;
+
+ // Caches
+ PyObject *TIMEDELTA_CACHE;
+ PyObject *ZONEINFO_WEAK_CACHE;
+ StrongCacheNode *ZONEINFO_STRONG_CACHE;
+
+ _ttinfo NO_TTINFO;
+} zoneinfo_state;
+
+// Constants
+static const int EPOCHORDINAL = 719163;
+static int DAYS_IN_MONTH[] = {
+ -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
+};
+
+static int DAYS_BEFORE_MONTH[] = {
+ -1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,
+};
+
+static const int SOURCE_NOCACHE = 0;
+static const int SOURCE_CACHE = 1;
+static const int SOURCE_FILE = 2;
+
+static const size_t ZONEINFO_STRONG_CACHE_MAX_SIZE = 8;
+
+// Forward declarations
+static int
+load_data(zoneinfo_state *state, PyZoneInfo_ZoneInfo *self,
+ PyObject *file_obj);
+static void
+utcoff_to_dstoff(size_t *trans_idx, long *utcoffs, long *dstoffs,
+ unsigned char *isdsts, size_t num_transitions,
+ size_t num_ttinfos);
+static int
+ts_to_local(size_t *trans_idx, int64_t *trans_utc, long *utcoff,
+ int64_t *trans_local[2], size_t num_ttinfos,
+ size_t num_transitions);
+
+static int
+parse_tz_str(zoneinfo_state *state, PyObject *tz_str_obj, _tzrule *out);
+
+static int
+parse_abbr(const char **p, PyObject **abbr);
+static int
+parse_tz_delta(const char **p, long *total_seconds);
+static int
+parse_transition_time(const char **p, int *hour, int *minute, int *second);
+static int
+parse_transition_rule(const char **p, TransitionRuleType **out);
+
+static _ttinfo *
+find_tzrule_ttinfo(_tzrule *rule, int64_t ts, unsigned char fold, int year);
+static _ttinfo *
+find_tzrule_ttinfo_fromutc(_tzrule *rule, int64_t ts, int year,
+ unsigned char *fold);
+
+static int
+build_ttinfo(zoneinfo_state *state, long utcoffset, long dstoffset,
+ PyObject *tzname, _ttinfo *out);
+static void
+xdecref_ttinfo(_ttinfo *ttinfo);
+static int
+ttinfo_eq(const _ttinfo *const tti0, const _ttinfo *const tti1);
+
+static int
+build_tzrule(zoneinfo_state *state, PyObject *std_abbr, PyObject *dst_abbr,
+ long std_offset, long dst_offset, TransitionRuleType *start,
+ TransitionRuleType *end, _tzrule *out);
+static void
+free_tzrule(_tzrule *tzrule);
+
+static PyObject *
+load_timedelta(zoneinfo_state *state, long seconds);
+
+static int
+get_local_timestamp(PyObject *dt, int64_t *local_ts);
+static _ttinfo *
+find_ttinfo(zoneinfo_state *state, PyZoneInfo_ZoneInfo *self, PyObject *dt);
+
+static int
+ymd_to_ord(int y, int m, int d);
+static int
+is_leap_year(int year);
+
+static size_t
+_bisect(const int64_t value, const int64_t *arr, size_t size);
+
+static int
+eject_from_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
+ PyObject *key);
+static void
+clear_strong_cache(zoneinfo_state *state, const PyTypeObject *const type);
+static void
+update_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
+ PyObject *key, PyObject *zone);
+static PyObject *
+zone_from_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
+ PyObject *const key);
+
+static inline zoneinfo_state *
+zoneinfo_get_state(PyObject *mod)
+{
+ zoneinfo_state *state = (zoneinfo_state *)PyModule_GetState(mod);
+ assert(state != NULL);
+ return state;
+}
+
+static inline zoneinfo_state *
+zoneinfo_get_state_by_cls(PyTypeObject *cls)
+{
+ zoneinfo_state *state = (zoneinfo_state *)_PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return state;
+}
+
+static struct PyModuleDef zoneinfomodule;
+
+static inline zoneinfo_state *
+zoneinfo_get_state_by_self(PyTypeObject *self)
+{
+ PyObject *mod = PyType_GetModuleByDef(self, &zoneinfomodule);
+ assert(mod != NULL);
+ return zoneinfo_get_state(mod);
+}
+
+static PyObject *
+zoneinfo_new_instance(zoneinfo_state *state, PyTypeObject *type, PyObject *key)
+{
+ PyObject *file_obj = NULL;
+ PyObject *file_path = NULL;
+
+ file_path = PyObject_CallFunctionObjArgs(state->_tzpath_find_tzfile,
+ key, NULL);
+ if (file_path == NULL) {
+ return NULL;
+ }
+ else if (file_path == Py_None) {
+ PyObject *meth = state->_common_mod;
+ file_obj = PyObject_CallMethod(meth, "load_tzdata", "O", key);
+ if (file_obj == NULL) {
+ Py_DECREF(file_path);
+ return NULL;
+ }
+ }
+
+ PyObject *self = (PyObject *)(type->tp_alloc(type, 0));
+ if (self == NULL) {
+ goto error;
+ }
+
+ if (file_obj == NULL) {
+ PyObject *func = state->io_open;
+ file_obj = PyObject_CallFunction(func, "Os", file_path, "rb");
+ if (file_obj == NULL) {
+ goto error;
+ }
+ }
+
+ if (load_data(state, (PyZoneInfo_ZoneInfo *)self, file_obj)) {
+ goto error;
+ }
+
+ PyObject *rv = PyObject_CallMethod(file_obj, "close", NULL);
+ Py_SETREF(file_obj, NULL);
+ if (rv == NULL) {
+ goto error;
+ }
+ Py_DECREF(rv);
+
+ ((PyZoneInfo_ZoneInfo *)self)->key = Py_NewRef(key);
+
+ goto cleanup;
+error:
+ Py_CLEAR(self);
+cleanup:
+ if (file_obj != NULL) {
+ PyObject *exc = PyErr_GetRaisedException();
+ PyObject *tmp = PyObject_CallMethod(file_obj, "close", NULL);
+ _PyErr_ChainExceptions1(exc);
+ if (tmp == NULL) {
+ Py_CLEAR(self);
+ }
+ Py_XDECREF(tmp);
+ Py_DECREF(file_obj);
+ }
+ Py_DECREF(file_path);
+ return self;
+}
+
+static PyObject *
+get_weak_cache(zoneinfo_state *state, PyTypeObject *type)
+{
+ if (type == state->ZoneInfoType) {
+ return state->ZONEINFO_WEAK_CACHE;
+ }
+ else {
+ PyObject *cache =
+ PyObject_GetAttrString((PyObject *)type, "_weak_cache");
+ // We are assuming that the type lives at least as long as the function
+ // that calls get_weak_cache, and that it holds a reference to the
+ // cache, so we'll return a "borrowed reference".
+ Py_XDECREF(cache);
+ return cache;
+ }
+}
+
+static PyObject *
+zoneinfo_new(PyTypeObject *type, PyObject *args, PyObject *kw)
+{
+ PyObject *key = NULL;
+ static char *kwlist[] = {"key", NULL};
+ if (PyArg_ParseTupleAndKeywords(args, kw, "O", kwlist, &key) == 0) {
+ return NULL;
+ }
+
+ zoneinfo_state *state = zoneinfo_get_state_by_self(type);
+ PyObject *instance = zone_from_strong_cache(state, type, key);
+ if (instance != NULL || PyErr_Occurred()) {
+ return instance;
+ }
+
+ PyObject *weak_cache = get_weak_cache(state, type);
+ instance = PyObject_CallMethod(weak_cache, "get", "O", key, Py_None);
+ if (instance == NULL) {
+ return NULL;
+ }
+
+ if (instance == Py_None) {
+ Py_DECREF(instance);
+ PyObject *tmp = zoneinfo_new_instance(state, type, key);
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ instance =
+ PyObject_CallMethod(weak_cache, "setdefault", "OO", key, tmp);
+ Py_DECREF(tmp);
+ if (instance == NULL) {
+ return NULL;
+ }
+ ((PyZoneInfo_ZoneInfo *)instance)->source = SOURCE_CACHE;
+ }
+
+ update_strong_cache(state, type, key, instance);
+ return instance;
+}
+
+static int
+zoneinfo_traverse(PyZoneInfo_ZoneInfo *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->key);
+ return 0;
+}
+
+static int
+zoneinfo_clear(PyZoneInfo_ZoneInfo *self)
+{
+ Py_CLEAR(self->key);
+ Py_CLEAR(self->file_repr);
+ return 0;
+}
+
+static void
+zoneinfo_dealloc(PyObject *obj_self)
+{
+ PyZoneInfo_ZoneInfo *self = (PyZoneInfo_ZoneInfo *)obj_self;
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+
+ if (self->weakreflist != NULL) {
+ PyObject_ClearWeakRefs(obj_self);
+ }
+
+ if (self->trans_list_utc != NULL) {
+ PyMem_Free(self->trans_list_utc);
+ }
+
+ for (size_t i = 0; i < 2; i++) {
+ if (self->trans_list_wall[i] != NULL) {
+ PyMem_Free(self->trans_list_wall[i]);
+ }
+ }
+
+ if (self->_ttinfos != NULL) {
+ for (size_t i = 0; i < self->num_ttinfos; ++i) {
+ xdecref_ttinfo(&(self->_ttinfos[i]));
+ }
+ PyMem_Free(self->_ttinfos);
+ }
+
+ if (self->trans_ttinfos != NULL) {
+ PyMem_Free(self->trans_ttinfos);
+ }
+
+ free_tzrule(&(self->tzrule_after));
+
+ zoneinfo_clear(self);
+ tp->tp_free(obj_self);
+ Py_DECREF(tp);
+}
+
+/*[clinic input]
+@classmethod
+zoneinfo.ZoneInfo.from_file
+
+ cls: defining_class
+ file_obj: object
+ /
+ key: object = None
+
+Create a ZoneInfo file from a file object.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo_from_file_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *file_obj, PyObject *key)
+/*[clinic end generated code: output=77887d1d56a48324 input=d26111f29eed6863]*/
+{
+ PyObject *file_repr = NULL;
+ PyZoneInfo_ZoneInfo *self = NULL;
+
+ PyObject *obj_self = (PyObject *)(type->tp_alloc(type, 0));
+ self = (PyZoneInfo_ZoneInfo *)obj_self;
+ if (self == NULL) {
+ return NULL;
+ }
+
+ file_repr = PyUnicode_FromFormat("%R", file_obj);
+ if (file_repr == NULL) {
+ goto error;
+ }
+
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ if (load_data(state, self, file_obj)) {
+ goto error;
+ }
+
+ self->source = SOURCE_FILE;
+ self->file_repr = file_repr;
+ self->key = Py_NewRef(key);
+ return obj_self;
+
+error:
+ Py_XDECREF(file_repr);
+ Py_XDECREF(self);
+ return NULL;
+}
+
+/*[clinic input]
+@classmethod
+zoneinfo.ZoneInfo.no_cache
+
+ cls: defining_class
+ /
+ key: object
+
+Get a new instance of ZoneInfo, bypassing the cache.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo_no_cache_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *key)
+/*[clinic end generated code: output=b0b09b3344c171b7 input=0238f3d56b1ea3f1]*/
+{
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ PyObject *out = zoneinfo_new_instance(state, type, key);
+ if (out != NULL) {
+ ((PyZoneInfo_ZoneInfo *)out)->source = SOURCE_NOCACHE;
+ }
+
+ return out;
+}
+
+/*[clinic input]
+@classmethod
+zoneinfo.ZoneInfo.clear_cache
+
+ cls: defining_class
+ /
+ *
+ only_keys: object = None
+
+Clear the ZoneInfo cache.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo_clear_cache_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *only_keys)
+/*[clinic end generated code: output=114d9b7c8a22e660 input=e32ca3bb396788ba]*/
+{
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ PyObject *weak_cache = get_weak_cache(state, type);
+
+ if (only_keys == NULL || only_keys == Py_None) {
+ PyObject *rv = PyObject_CallMethod(weak_cache, "clear", NULL);
+ if (rv != NULL) {
+ Py_DECREF(rv);
+ }
+
+ clear_strong_cache(state, type);
+ }
+ else {
+ PyObject *item = NULL;
+ PyObject *pop = PyUnicode_FromString("pop");
+ if (pop == NULL) {
+ return NULL;
+ }
+
+ PyObject *iter = PyObject_GetIter(only_keys);
+ if (iter == NULL) {
+ Py_DECREF(pop);
+ return NULL;
+ }
+
+ while ((item = PyIter_Next(iter))) {
+ // Remove from strong cache
+ if (eject_from_strong_cache(state, type, item) < 0) {
+ Py_DECREF(item);
+ break;
+ }
+
+ // Remove from weak cache
+ PyObject *tmp = PyObject_CallMethodObjArgs(weak_cache, pop, item,
+ Py_None, NULL);
+
+ Py_DECREF(item);
+ if (tmp == NULL) {
+ break;
+ }
+ Py_DECREF(tmp);
+ }
+ Py_DECREF(iter);
+ Py_DECREF(pop);
+ }
+
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+zoneinfo.ZoneInfo.utcoffset
+
+ cls: defining_class
+ dt: object
+ /
+
+Retrieve a timedelta representing the UTC offset in a zone at the given datetime.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo_utcoffset_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *dt)
+/*[clinic end generated code: output=b71016c319ba1f91 input=2bb6c5364938f19c]*/
+{
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ _ttinfo *tti = find_ttinfo(state, (PyZoneInfo_ZoneInfo *)self, dt);
+ if (tti == NULL) {
+ return NULL;
+ }
+ return Py_NewRef(tti->utcoff);
+}
+
+/*[clinic input]
+zoneinfo.ZoneInfo.dst
+
+ cls: defining_class
+ dt: object
+ /
+
+Retrieve a timedelta representing the amount of DST applied in a zone at the given datetime.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo_dst_impl(PyObject *self, PyTypeObject *cls, PyObject *dt)
+/*[clinic end generated code: output=cb6168d7723a6ae6 input=2167fb80cf8645c6]*/
+{
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ _ttinfo *tti = find_ttinfo(state, (PyZoneInfo_ZoneInfo *)self, dt);
+ if (tti == NULL) {
+ return NULL;
+ }
+ return Py_NewRef(tti->dstoff);
+}
+
+/*[clinic input]
+zoneinfo.ZoneInfo.tzname
+
+ cls: defining_class
+ dt: object
+ /
+
+Retrieve a string containing the abbreviation for the time zone that applies in a zone at a given datetime.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo_tzname_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *dt)
+/*[clinic end generated code: output=3b6ae6c3053ea75a input=15a59a4f92ed1f1f]*/
+{
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ _ttinfo *tti = find_ttinfo(state, (PyZoneInfo_ZoneInfo *)self, dt);
+ if (tti == NULL) {
+ return NULL;
+ }
+ return Py_NewRef(tti->tzname);
+}
+
+#define GET_DT_TZINFO PyDateTime_DATE_GET_TZINFO
+
+static PyObject *
+zoneinfo_fromutc(PyObject *obj_self, PyObject *dt)
+{
+ if (!PyDateTime_Check(dt)) {
+ PyErr_SetString(PyExc_TypeError,
+ "fromutc: argument must be a datetime");
+ return NULL;
+ }
+ if (GET_DT_TZINFO(dt) != obj_self) {
+ PyErr_SetString(PyExc_ValueError,
+ "fromutc: dt.tzinfo "
+ "is not self");
+ return NULL;
+ }
+
+ PyZoneInfo_ZoneInfo *self = (PyZoneInfo_ZoneInfo *)obj_self;
+
+ int64_t timestamp;
+ if (get_local_timestamp(dt, &timestamp)) {
+ return NULL;
+ }
+ size_t num_trans = self->num_transitions;
+
+ _ttinfo *tti = NULL;
+ unsigned char fold = 0;
+
+ if (num_trans >= 1 && timestamp < self->trans_list_utc[0]) {
+ tti = self->ttinfo_before;
+ }
+ else if (num_trans == 0 ||
+ timestamp > self->trans_list_utc[num_trans - 1]) {
+ tti = find_tzrule_ttinfo_fromutc(&(self->tzrule_after), timestamp,
+ PyDateTime_GET_YEAR(dt), &fold);
+
+ // Immediately after the last manual transition, the fold/gap is
+ // between self->trans_ttinfos[num_transitions - 1] and whatever
+ // ttinfo applies immediately after the last transition, not between
+ // the STD and DST rules in the tzrule_after, so we may need to
+ // adjust the fold value.
+ if (num_trans) {
+ _ttinfo *tti_prev = NULL;
+ if (num_trans == 1) {
+ tti_prev = self->ttinfo_before;
+ }
+ else {
+ tti_prev = self->trans_ttinfos[num_trans - 2];
+ }
+ int64_t diff = tti_prev->utcoff_seconds - tti->utcoff_seconds;
+ if (diff > 0 &&
+ timestamp < (self->trans_list_utc[num_trans - 1] + diff)) {
+ fold = 1;
+ }
+ }
+ }
+ else {
+ size_t idx = _bisect(timestamp, self->trans_list_utc, num_trans);
+ _ttinfo *tti_prev = NULL;
+
+ if (idx >= 2) {
+ tti_prev = self->trans_ttinfos[idx - 2];
+ tti = self->trans_ttinfos[idx - 1];
+ }
+ else {
+ tti_prev = self->ttinfo_before;
+ tti = self->trans_ttinfos[0];
+ }
+
+ // Detect fold
+ int64_t shift =
+ (int64_t)(tti_prev->utcoff_seconds - tti->utcoff_seconds);
+ if (shift > (timestamp - self->trans_list_utc[idx - 1])) {
+ fold = 1;
+ }
+ }
+
+ PyObject *tmp = PyNumber_Add(dt, tti->utcoff);
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ if (fold) {
+ if (PyDateTime_CheckExact(tmp)) {
+ ((PyDateTime_DateTime *)tmp)->fold = 1;
+ dt = tmp;
+ }
+ else {
+ PyObject *replace = PyObject_GetAttrString(tmp, "replace");
+ Py_DECREF(tmp);
+ if (replace == NULL) {
+ return NULL;
+ }
+ PyObject *args = PyTuple_New(0);
+ if (args == NULL) {
+ Py_DECREF(replace);
+ return NULL;
+ }
+ PyObject *kwargs = PyDict_New();
+ if (kwargs == NULL) {
+ Py_DECREF(replace);
+ Py_DECREF(args);
+ return NULL;
+ }
+
+ dt = NULL;
+ if (!PyDict_SetItemString(kwargs, "fold", _PyLong_GetOne())) {
+ dt = PyObject_Call(replace, args, kwargs);
+ }
+
+ Py_DECREF(args);
+ Py_DECREF(kwargs);
+ Py_DECREF(replace);
+
+ if (dt == NULL) {
+ return NULL;
+ }
+ }
+ }
+ else {
+ dt = tmp;
+ }
+ return dt;
+}
+
+static PyObject *
+zoneinfo_repr(PyZoneInfo_ZoneInfo *self)
+{
+ PyObject *rv = NULL;
+ const char *type_name = Py_TYPE((PyObject *)self)->tp_name;
+ if (!(self->key == Py_None)) {
+ rv = PyUnicode_FromFormat("%s(key=%R)", type_name, self->key);
+ }
+ else {
+ assert(PyUnicode_Check(self->file_repr));
+ rv = PyUnicode_FromFormat("%s.from_file(%U)", type_name,
+ self->file_repr);
+ }
+
+ return rv;
+}
+
+static PyObject *
+zoneinfo_str(PyZoneInfo_ZoneInfo *self)
+{
+ if (!(self->key == Py_None)) {
+ return Py_NewRef(self->key);
+ }
+ else {
+ return zoneinfo_repr(self);
+ }
+}
+
+/* Pickles the ZoneInfo object by key and source.
+ *
+ * ZoneInfo objects are pickled by reference to the TZif file that they came
+ * from, which means that the exact transitions may be different or the file
+ * may not un-pickle if the data has changed on disk in the interim.
+ *
+ * It is necessary to include a bit indicating whether or not the object
+ * was constructed from the cache, because from-cache objects will hit the
+ * unpickling process's cache, whereas no-cache objects will bypass it.
+ *
+ * Objects constructed from ZoneInfo.from_file cannot be pickled.
+ */
+static PyObject *
+zoneinfo_reduce(PyObject *obj_self, PyObject *unused)
+{
+ PyZoneInfo_ZoneInfo *self = (PyZoneInfo_ZoneInfo *)obj_self;
+ if (self->source == SOURCE_FILE) {
+ // Objects constructed from files cannot be pickled.
+ PyObject *pickle_error =
+ _PyImport_GetModuleAttrString("pickle", "PicklingError");
+ if (pickle_error == NULL) {
+ return NULL;
+ }
+
+ PyErr_Format(pickle_error,
+ "Cannot pickle a ZoneInfo file from a file stream.");
+ Py_DECREF(pickle_error);
+ return NULL;
+ }
+
+ unsigned char from_cache = self->source == SOURCE_CACHE ? 1 : 0;
+ PyObject *constructor = PyObject_GetAttrString(obj_self, "_unpickle");
+
+ if (constructor == NULL) {
+ return NULL;
+ }
+
+ PyObject *rv = Py_BuildValue("O(OB)", constructor, self->key, from_cache);
+ Py_DECREF(constructor);
+ return rv;
+}
+
+/*[clinic input]
+@classmethod
+zoneinfo.ZoneInfo._unpickle
+
+ cls: defining_class
+ key: object
+ from_cache: unsigned_char(bitwise=True)
+ /
+
+Private method used in unpickling.
+[clinic start generated code]*/
+
+static PyObject *
+zoneinfo_ZoneInfo__unpickle_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *key, unsigned char from_cache)
+/*[clinic end generated code: output=556712fc709deecb input=6ac8c73eed3de316]*/
+{
+ if (from_cache) {
+ PyObject *val_args = Py_BuildValue("(O)", key);
+ if (val_args == NULL) {
+ return NULL;
+ }
+
+ PyObject *rv = zoneinfo_new(type, val_args, NULL);
+
+ Py_DECREF(val_args);
+ return rv;
+ }
+ else {
+ zoneinfo_state *state = zoneinfo_get_state_by_cls(cls);
+ return zoneinfo_new_instance(state, type, key);
+ }
+}
+
+/* It is relatively expensive to construct new timedelta objects, and in most
+ * cases we're looking at a relatively small number of timedeltas, such as
+ * integer number of hours, etc. We will keep a cache so that we construct
+ * a minimal number of these.
+ *
+ * Possibly this should be replaced with an LRU cache so that it's not possible
+ * for the memory usage to explode from this, but in order for this to be a
+ * serious problem, one would need to deliberately craft a malicious time zone
+ * file with many distinct offsets. As of tzdb 2019c, loading every single zone
+ * fills the cache with ~450 timedeltas for a total size of ~12kB.
+ *
+ * This returns a new reference to the timedelta.
+ */
+static PyObject *
+load_timedelta(zoneinfo_state *state, long seconds)
+{
+ PyObject *rv;
+ PyObject *pyoffset = PyLong_FromLong(seconds);
+ if (pyoffset == NULL) {
+ return NULL;
+ }
+ rv = PyDict_GetItemWithError(state->TIMEDELTA_CACHE, pyoffset);
+ if (rv == NULL) {
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ PyObject *tmp = PyDateTimeAPI->Delta_FromDelta(
+ 0, seconds, 0, 1, PyDateTimeAPI->DeltaType);
+
+ if (tmp == NULL) {
+ goto error;
+ }
+
+ rv = PyDict_SetDefault(state->TIMEDELTA_CACHE, pyoffset, tmp);
+ Py_DECREF(tmp);
+ }
+
+ Py_XINCREF(rv);
+ Py_DECREF(pyoffset);
+ return rv;
+error:
+ Py_DECREF(pyoffset);
+ return NULL;
+}
+
+/* Constructor for _ttinfo object - this starts by initializing the _ttinfo
+ * to { NULL, NULL, NULL }, so that Py_XDECREF will work on partially
+ * initialized _ttinfo objects.
+ */
+static int
+build_ttinfo(zoneinfo_state *state, long utcoffset, long dstoffset,
+ PyObject *tzname, _ttinfo *out)
+{
+ out->utcoff = NULL;
+ out->dstoff = NULL;
+ out->tzname = NULL;
+
+ out->utcoff_seconds = utcoffset;
+ out->utcoff = load_timedelta(state, utcoffset);
+ if (out->utcoff == NULL) {
+ return -1;
+ }
+
+ out->dstoff = load_timedelta(state, dstoffset);
+ if (out->dstoff == NULL) {
+ return -1;
+ }
+
+ out->tzname = Py_NewRef(tzname);
+
+ return 0;
+}
+
+/* Decrease reference count on any non-NULL members of a _ttinfo */
+static void
+xdecref_ttinfo(_ttinfo *ttinfo)
+{
+ if (ttinfo != NULL) {
+ Py_XDECREF(ttinfo->utcoff);
+ Py_XDECREF(ttinfo->dstoff);
+ Py_XDECREF(ttinfo->tzname);
+ }
+}
+
+/* Equality function for _ttinfo. */
+static int
+ttinfo_eq(const _ttinfo *const tti0, const _ttinfo *const tti1)
+{
+ int rv;
+ if ((rv = PyObject_RichCompareBool(tti0->utcoff, tti1->utcoff, Py_EQ)) <
+ 1) {
+ goto end;
+ }
+
+ if ((rv = PyObject_RichCompareBool(tti0->dstoff, tti1->dstoff, Py_EQ)) <
+ 1) {
+ goto end;
+ }
+
+ if ((rv = PyObject_RichCompareBool(tti0->tzname, tti1->tzname, Py_EQ)) <
+ 1) {
+ goto end;
+ }
+end:
+ return rv;
+}
+
+/* Given a file-like object, this populates a ZoneInfo object
+ *
+ * The current version calls into a Python function to read the data from
+ * file into Python objects, and this translates those Python objects into
+ * C values and calculates derived values (e.g. dstoff) in C.
+ *
+ * This returns 0 on success and -1 on failure.
+ *
+ * The function will never return while `self` is partially initialized —
+ * the object only needs to be freed / deallocated if this succeeds.
+ */
+static int
+load_data(zoneinfo_state *state, PyZoneInfo_ZoneInfo *self, PyObject *file_obj)
+{
+ PyObject *data_tuple = NULL;
+
+ long *utcoff = NULL;
+ long *dstoff = NULL;
+ size_t *trans_idx = NULL;
+ unsigned char *isdst = NULL;
+
+ self->trans_list_utc = NULL;
+ self->trans_list_wall[0] = NULL;
+ self->trans_list_wall[1] = NULL;
+ self->trans_ttinfos = NULL;
+ self->_ttinfos = NULL;
+ self->file_repr = NULL;
+
+ size_t ttinfos_allocated = 0;
+
+ data_tuple = PyObject_CallMethod(state->_common_mod, "load_data", "O",
+ file_obj);
+
+ if (data_tuple == NULL) {
+ goto error;
+ }
+
+ if (!PyTuple_CheckExact(data_tuple)) {
+ PyErr_Format(PyExc_TypeError, "Invalid data result type: %r",
+ data_tuple);
+ goto error;
+ }
+
+ // Unpack the data tuple
+ PyObject *trans_idx_list = PyTuple_GetItem(data_tuple, 0);
+ if (trans_idx_list == NULL) {
+ goto error;
+ }
+
+ PyObject *trans_utc = PyTuple_GetItem(data_tuple, 1);
+ if (trans_utc == NULL) {
+ goto error;
+ }
+
+ PyObject *utcoff_list = PyTuple_GetItem(data_tuple, 2);
+ if (utcoff_list == NULL) {
+ goto error;
+ }
+
+ PyObject *isdst_list = PyTuple_GetItem(data_tuple, 3);
+ if (isdst_list == NULL) {
+ goto error;
+ }
+
+ PyObject *abbr = PyTuple_GetItem(data_tuple, 4);
+ if (abbr == NULL) {
+ goto error;
+ }
+
+ PyObject *tz_str = PyTuple_GetItem(data_tuple, 5);
+ if (tz_str == NULL) {
+ goto error;
+ }
+
+ // Load the relevant sizes
+ Py_ssize_t num_transitions = PyTuple_Size(trans_utc);
+ if (num_transitions < 0) {
+ goto error;
+ }
+
+ Py_ssize_t num_ttinfos = PyTuple_Size(utcoff_list);
+ if (num_ttinfos < 0) {
+ goto error;
+ }
+
+ self->num_transitions = (size_t)num_transitions;
+ self->num_ttinfos = (size_t)num_ttinfos;
+
+ // Load the transition indices and list
+ self->trans_list_utc =
+ PyMem_Malloc(self->num_transitions * sizeof(int64_t));
+ if (self->trans_list_utc == NULL) {
+ goto error;
+ }
+ trans_idx = PyMem_Malloc(self->num_transitions * sizeof(Py_ssize_t));
+ if (trans_idx == NULL) {
+ goto error;
+ }
+
+ for (size_t i = 0; i < self->num_transitions; ++i) {
+ PyObject *num = PyTuple_GetItem(trans_utc, i);
+ if (num == NULL) {
+ goto error;
+ }
+ self->trans_list_utc[i] = PyLong_AsLongLong(num);
+ if (self->trans_list_utc[i] == -1 && PyErr_Occurred()) {
+ goto error;
+ }
+
+ num = PyTuple_GetItem(trans_idx_list, i);
+ if (num == NULL) {
+ goto error;
+ }
+
+ Py_ssize_t cur_trans_idx = PyLong_AsSsize_t(num);
+ if (cur_trans_idx == -1) {
+ goto error;
+ }
+
+ trans_idx[i] = (size_t)cur_trans_idx;
+ if (trans_idx[i] > self->num_ttinfos) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "Invalid transition index found while reading TZif: %zd",
+ cur_trans_idx);
+
+ goto error;
+ }
+ }
+
+ // Load UTC offsets and isdst (size num_ttinfos)
+ utcoff = PyMem_Malloc(self->num_ttinfos * sizeof(long));
+ isdst = PyMem_Malloc(self->num_ttinfos * sizeof(unsigned char));
+
+ if (utcoff == NULL || isdst == NULL) {
+ goto error;
+ }
+ for (size_t i = 0; i < self->num_ttinfos; ++i) {
+ PyObject *num = PyTuple_GetItem(utcoff_list, i);
+ if (num == NULL) {
+ goto error;
+ }
+
+ utcoff[i] = PyLong_AsLong(num);
+ if (utcoff[i] == -1 && PyErr_Occurred()) {
+ goto error;
+ }
+
+ num = PyTuple_GetItem(isdst_list, i);
+ if (num == NULL) {
+ goto error;
+ }
+
+ int isdst_with_error = PyObject_IsTrue(num);
+ if (isdst_with_error == -1) {
+ goto error;
+ }
+ else {
+ isdst[i] = (unsigned char)isdst_with_error;
+ }
+ }
+
+ dstoff = PyMem_Calloc(self->num_ttinfos, sizeof(long));
+ if (dstoff == NULL) {
+ goto error;
+ }
+
+ // Derive dstoff and trans_list_wall from the information we've loaded
+ utcoff_to_dstoff(trans_idx, utcoff, dstoff, isdst, self->num_transitions,
+ self->num_ttinfos);
+
+ if (ts_to_local(trans_idx, self->trans_list_utc, utcoff,
+ self->trans_list_wall, self->num_ttinfos,
+ self->num_transitions)) {
+ goto error;
+ }
+
+ // Build _ttinfo objects from utcoff, dstoff and abbr
+ self->_ttinfos = PyMem_Malloc(self->num_ttinfos * sizeof(_ttinfo));
+ if (self->_ttinfos == NULL) {
+ goto error;
+ }
+ for (size_t i = 0; i < self->num_ttinfos; ++i) {
+ PyObject *tzname = PyTuple_GetItem(abbr, i);
+ if (tzname == NULL) {
+ goto error;
+ }
+
+ ttinfos_allocated++;
+ int rc = build_ttinfo(state, utcoff[i], dstoff[i], tzname,
+ &(self->_ttinfos[i]));
+ if (rc) {
+ goto error;
+ }
+ }
+
+ // Build our mapping from transition to the ttinfo that applies
+ self->trans_ttinfos =
+ PyMem_Calloc(self->num_transitions, sizeof(_ttinfo *));
+ if (self->trans_ttinfos == NULL) {
+ goto error;
+ }
+ for (size_t i = 0; i < self->num_transitions; ++i) {
+ size_t ttinfo_idx = trans_idx[i];
+ assert(ttinfo_idx < self->num_ttinfos);
+ self->trans_ttinfos[i] = &(self->_ttinfos[ttinfo_idx]);
+ }
+
+ // Set ttinfo_before to the first non-DST transition
+ for (size_t i = 0; i < self->num_ttinfos; ++i) {
+ if (!isdst[i]) {
+ self->ttinfo_before = &(self->_ttinfos[i]);
+ break;
+ }
+ }
+
+ // If there are only DST ttinfos, pick the first one, if there are no
+ // ttinfos at all, set ttinfo_before to NULL
+ if (self->ttinfo_before == NULL && self->num_ttinfos > 0) {
+ self->ttinfo_before = &(self->_ttinfos[0]);
+ }
+
+ if (tz_str != Py_None && PyObject_IsTrue(tz_str)) {
+ if (parse_tz_str(state, tz_str, &(self->tzrule_after))) {
+ goto error;
+ }
+ }
+ else {
+ if (!self->num_ttinfos) {
+ PyErr_Format(PyExc_ValueError, "No time zone information found.");
+ goto error;
+ }
+
+ size_t idx;
+ if (!self->num_transitions) {
+ idx = self->num_ttinfos - 1;
+ }
+ else {
+ idx = trans_idx[self->num_transitions - 1];
+ }
+
+ _ttinfo *tti = &(self->_ttinfos[idx]);
+ build_tzrule(state, tti->tzname, NULL, tti->utcoff_seconds, 0, NULL,
+ NULL, &(self->tzrule_after));
+
+ // We've abused the build_tzrule constructor to construct an STD-only
+ // rule mimicking whatever ttinfo we've picked up, but it's possible
+ // that the one we've picked up is a DST zone, so we need to make sure
+ // that the dstoff is set correctly in that case.
+ if (PyObject_IsTrue(tti->dstoff)) {
+ _ttinfo *tti_after = &(self->tzrule_after.std);
+ Py_SETREF(tti_after->dstoff, Py_NewRef(tti->dstoff));
+ }
+ }
+
+ // Determine if this is a "fixed offset" zone, meaning that the output of
+ // the utcoffset, dst and tzname functions does not depend on the specific
+ // datetime passed.
+ //
+ // We make three simplifying assumptions here:
+ //
+ // 1. If tzrule_after is not std_only, it has transitions that might occur
+ // (it is possible to construct TZ strings that specify STD and DST but
+ // no transitions ever occur, such as AAA0BBB,0/0,J365/25).
+ // 2. If self->_ttinfos contains more than one _ttinfo object, the objects
+ // represent different offsets.
+ // 3. self->ttinfos contains no unused _ttinfos (in which case an otherwise
+ // fixed-offset zone with extra _ttinfos defined may appear to *not* be
+ // a fixed offset zone).
+ //
+ // Violations to these assumptions would be fairly exotic, and exotic
+ // zones should almost certainly not be used with datetime.time (the
+ // only thing that would be affected by this).
+ if (self->num_ttinfos > 1 || !self->tzrule_after.std_only) {
+ self->fixed_offset = 0;
+ }
+ else if (self->num_ttinfos == 0) {
+ self->fixed_offset = 1;
+ }
+ else {
+ int constant_offset =
+ ttinfo_eq(&(self->_ttinfos[0]), &self->tzrule_after.std);
+ if (constant_offset < 0) {
+ goto error;
+ }
+ else {
+ self->fixed_offset = constant_offset;
+ }
+ }
+
+ int rv = 0;
+ goto cleanup;
+error:
+ // These resources only need to be freed if we have failed, if we succeed
+ // in initializing a PyZoneInfo_ZoneInfo object, we can rely on its dealloc
+ // method to free the relevant resources.
+ if (self->trans_list_utc != NULL) {
+ PyMem_Free(self->trans_list_utc);
+ self->trans_list_utc = NULL;
+ }
+
+ for (size_t i = 0; i < 2; ++i) {
+ if (self->trans_list_wall[i] != NULL) {
+ PyMem_Free(self->trans_list_wall[i]);
+ self->trans_list_wall[i] = NULL;
+ }
+ }
+
+ if (self->_ttinfos != NULL) {
+ for (size_t i = 0; i < ttinfos_allocated; ++i) {
+ xdecref_ttinfo(&(self->_ttinfos[i]));
+ }
+ PyMem_Free(self->_ttinfos);
+ self->_ttinfos = NULL;
+ }
+
+ if (self->trans_ttinfos != NULL) {
+ PyMem_Free(self->trans_ttinfos);
+ self->trans_ttinfos = NULL;
+ }
+
+ rv = -1;
+cleanup:
+ Py_XDECREF(data_tuple);
+
+ if (utcoff != NULL) {
+ PyMem_Free(utcoff);
+ }
+
+ if (dstoff != NULL) {
+ PyMem_Free(dstoff);
+ }
+
+ if (isdst != NULL) {
+ PyMem_Free(isdst);
+ }
+
+ if (trans_idx != NULL) {
+ PyMem_Free(trans_idx);
+ }
+
+ return rv;
+}
+
+/* Function to calculate the local timestamp of a transition from the year. */
+int64_t
+calendarrule_year_to_timestamp(TransitionRuleType *base_self, int year)
+{
+ CalendarRule *self = (CalendarRule *)base_self;
+
+ // We want (year, month, day of month); we have year and month, but we
+ // need to turn (week, day-of-week) into day-of-month
+ //
+ // Week 1 is the first week in which day `day` (where 0 = Sunday) appears.
+ // Week 5 represents the last occurrence of day `day`, so we need to know
+ // the first weekday of the month and the number of days in the month.
+ int8_t first_day = (ymd_to_ord(year, self->month, 1) + 6) % 7;
+ uint8_t days_in_month = DAYS_IN_MONTH[self->month];
+ if (self->month == 2 && is_leap_year(year)) {
+ days_in_month += 1;
+ }
+
+ // This equation seems magical, so I'll break it down:
+ // 1. calendar says 0 = Monday, POSIX says 0 = Sunday so we need first_day
+ // + 1 to get 1 = Monday -> 7 = Sunday, which is still equivalent
+ // because this math is mod 7
+ // 2. Get first day - desired day mod 7 (adjusting by 7 for negative
+ // numbers so that -1 % 7 = 6).
+ // 3. Add 1 because month days are a 1-based index.
+ int8_t month_day = ((int8_t)(self->day) - (first_day + 1)) % 7;
+ if (month_day < 0) {
+ month_day += 7;
+ }
+ month_day += 1;
+
+ // Now use a 0-based index version of `week` to calculate the w-th
+ // occurrence of `day`
+ month_day += ((int8_t)(self->week) - 1) * 7;
+
+ // month_day will only be > days_in_month if w was 5, and `w` means "last
+ // occurrence of `d`", so now we just check if we over-shot the end of the
+ // month and if so knock off 1 week.
+ if (month_day > days_in_month) {
+ month_day -= 7;
+ }
+
+ int64_t ordinal = ymd_to_ord(year, self->month, month_day) - EPOCHORDINAL;
+ return ordinal * 86400 + (int64_t)self->hour * 3600 +
+ (int64_t)self->minute * 60 + self->second;
+}
+
+/* Constructor for CalendarRule. */
+int
+calendarrule_new(int month, int week, int day, int hour,
+ int minute, int second, CalendarRule *out)
+{
+ // These bounds come from the POSIX standard, which describes an Mm.n.d
+ // rule as:
+ //
+ // The d'th day (0 <= d <= 6) of week n of month m of the year (1 <= n <=
+ // 5, 1 <= m <= 12, where week 5 means "the last d day in month m" which
+ // may occur in either the fourth or the fifth week). Week 1 is the first
+ // week in which the d'th day occurs. Day zero is Sunday.
+ if (month < 1 || month > 12) {
+ PyErr_Format(PyExc_ValueError, "Month must be in [1, 12]");
+ return -1;
+ }
+
+ if (week < 1 || week > 5) {
+ PyErr_Format(PyExc_ValueError, "Week must be in [1, 5]");
+ return -1;
+ }
+
+ if (day < 0 || day > 6) {
+ PyErr_Format(PyExc_ValueError, "Day must be in [0, 6]");
+ return -1;
+ }
+
+ if (hour < -167 || hour > 167) {
+ PyErr_Format(PyExc_ValueError, "Hour must be in [0, 167]");
+ return -1;
+ }
+
+ TransitionRuleType base = {&calendarrule_year_to_timestamp};
+
+ CalendarRule new_offset = {
+ .base = base,
+ .month = (uint8_t)month,
+ .week = (uint8_t)week,
+ .day = (uint8_t)day,
+ .hour = (int16_t)hour,
+ .minute = (int8_t)minute,
+ .second = (int8_t)second,
+ };
+
+ *out = new_offset;
+ return 0;
+}
+
+/* Function to calculate the local timestamp of a transition from the year.
+ *
+ * This translates the day of the year into a local timestamp — either a
+ * 1-based Julian day, not including leap days, or the 0-based year-day,
+ * including leap days.
+ * */
+int64_t
+dayrule_year_to_timestamp(TransitionRuleType *base_self, int year)
+{
+ // The function signature requires a TransitionRuleType pointer, but this
+ // function is only applicable to DayRule* objects.
+ DayRule *self = (DayRule *)base_self;
+
+ // ymd_to_ord calculates the number of days since 0001-01-01, but we want
+ // to know the number of days since 1970-01-01, so we must subtract off
+ // the equivalent of ymd_to_ord(1970, 1, 1).
+ //
+ // We subtract off an additional 1 day to account for January 1st (we want
+ // the number of full days *before* the date of the transition - partial
+ // days are accounted for in the hour, minute and second portions.
+ int64_t days_before_year = ymd_to_ord(year, 1, 1) - EPOCHORDINAL - 1;
+
+ // The Julian day specification skips over February 29th in leap years,
+ // from the POSIX standard:
+ //
+ // Leap days shall not be counted. That is, in all years-including leap
+ // years-February 28 is day 59 and March 1 is day 60. It is impossible to
+ // refer explicitly to the occasional February 29.
+ //
+ // This is actually more useful than you'd think — if you want a rule that
+ // always transitions on a given calendar day (other than February 29th),
+ // you would use a Julian day, e.g. J91 always refers to April 1st and J365
+ // always refers to December 31st.
+ uint16_t day = self->day;
+ if (self->julian && day >= 59 && is_leap_year(year)) {
+ day += 1;
+ }
+
+ return (days_before_year + day) * 86400 + (int64_t)self->hour * 3600 +
+ (int64_t)self->minute * 60 + self->second;
+}
+
+/* Constructor for DayRule. */
+static int
+dayrule_new(int julian, int day, int hour, int minute,
+ int second, DayRule *out)
+{
+ // The POSIX standard specifies that Julian days must be in the range (1 <=
+ // n <= 365) and that non-Julian (they call it "0-based Julian") days must
+ // be in the range (0 <= n <= 365).
+ if (day < julian || day > 365) {
+ PyErr_Format(PyExc_ValueError, "day must be in [%d, 365], not: %d",
+ julian, day);
+ return -1;
+ }
+
+ if (hour < -167 || hour > 167) {
+ PyErr_Format(PyExc_ValueError, "Hour must be in [0, 167]");
+ return -1;
+ }
+
+ TransitionRuleType base = {
+ &dayrule_year_to_timestamp,
+ };
+
+ DayRule tmp = {
+ .base = base,
+ .julian = (uint8_t)julian,
+ .day = (int16_t)day,
+ .hour = (int16_t)hour,
+ .minute = (int8_t)minute,
+ .second = (int8_t)second,
+ };
+
+ *out = tmp;
+
+ return 0;
+}
+
+/* Calculate the start and end rules for a _tzrule in the given year. */
+static void
+tzrule_transitions(_tzrule *rule, int year, int64_t *start, int64_t *end)
+{
+ assert(rule->start != NULL);
+ assert(rule->end != NULL);
+ *start = rule->start->year_to_timestamp(rule->start, year);
+ *end = rule->end->year_to_timestamp(rule->end, year);
+}
+
+/* Calculate the _ttinfo that applies at a given local time from a _tzrule.
+ *
+ * This takes a local timestamp and fold for disambiguation purposes; the year
+ * could technically be calculated from the timestamp, but given that the
+ * callers of this function already have the year information accessible from
+ * the datetime struct, it is taken as an additional parameter to reduce
+ * unnecessary calculation.
+ * */
+static _ttinfo *
+find_tzrule_ttinfo(_tzrule *rule, int64_t ts, unsigned char fold, int year)
+{
+ if (rule->std_only) {
+ return &(rule->std);
+ }
+
+ int64_t start, end;
+ uint8_t isdst;
+
+ tzrule_transitions(rule, year, &start, &end);
+
+ // With fold = 0, the period (denominated in local time) with the smaller
+ // offset starts at the end of the gap and ends at the end of the fold;
+ // with fold = 1, it runs from the start of the gap to the beginning of the
+ // fold.
+ //
+ // So in order to determine the DST boundaries we need to know both the
+ // fold and whether DST is positive or negative (rare), and it turns out
+ // that this boils down to fold XOR is_positive.
+ if (fold == (rule->dst_diff >= 0)) {
+ end -= rule->dst_diff;
+ }
+ else {
+ start += rule->dst_diff;
+ }
+
+ if (start < end) {
+ isdst = (ts >= start) && (ts < end);
+ }
+ else {
+ isdst = (ts < end) || (ts >= start);
+ }
+
+ if (isdst) {
+ return &(rule->dst);
+ }
+ else {
+ return &(rule->std);
+ }
+}
+
+/* Calculate the ttinfo and fold that applies for a _tzrule at an epoch time.
+ *
+ * This function can determine the _ttinfo that applies at a given epoch time,
+ * (analogous to trans_list_utc), and whether or not the datetime is in a fold.
+ * This is to be used in the .fromutc() function.
+ *
+ * The year is technically a redundant parameter, because it can be calculated
+ * from the timestamp, but all callers of this function should have the year
+ * in the datetime struct anyway, so taking it as a parameter saves unnecessary
+ * calculation.
+ **/
+static _ttinfo *
+find_tzrule_ttinfo_fromutc(_tzrule *rule, int64_t ts, int year,
+ unsigned char *fold)
+{
+ if (rule->std_only) {
+ *fold = 0;
+ return &(rule->std);
+ }
+
+ int64_t start, end;
+ uint8_t isdst;
+ tzrule_transitions(rule, year, &start, &end);
+ start -= rule->std.utcoff_seconds;
+ end -= rule->dst.utcoff_seconds;
+
+ if (start < end) {
+ isdst = (ts >= start) && (ts < end);
+ }
+ else {
+ isdst = (ts < end) || (ts >= start);
+ }
+
+ // For positive DST, the ambiguous period is one dst_diff after the end of
+ // DST; for negative DST, the ambiguous period is one dst_diff before the
+ // start of DST.
+ int64_t ambig_start, ambig_end;
+ if (rule->dst_diff > 0) {
+ ambig_start = end;
+ ambig_end = end + rule->dst_diff;
+ }
+ else {
+ ambig_start = start;
+ ambig_end = start - rule->dst_diff;
+ }
+
+ *fold = (ts >= ambig_start) && (ts < ambig_end);
+
+ if (isdst) {
+ return &(rule->dst);
+ }
+ else {
+ return &(rule->std);
+ }
+}
+
+/* Parse a TZ string in the format specified by the POSIX standard:
+ *
+ * std offset[dst[offset],start[/time],end[/time]]
+ *
+ * std and dst must be 3 or more characters long and must not contain a
+ * leading colon, embedded digits, commas, nor a plus or minus signs; The
+ * spaces between "std" and "offset" are only for display and are not actually
+ * present in the string.
+ *
+ * The format of the offset is ``[+|-]hh[:mm[:ss]]``
+ *
+ * See the POSIX.1 spec: IEE Std 1003.1-2018 §8.3:
+ *
+ * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
+ */
+static int
+parse_tz_str(zoneinfo_state *state, PyObject *tz_str_obj, _tzrule *out)
+{
+ PyObject *std_abbr = NULL;
+ PyObject *dst_abbr = NULL;
+ TransitionRuleType *start = NULL;
+ TransitionRuleType *end = NULL;
+ // Initialize offsets to invalid value (> 24 hours)
+ long std_offset = 1 << 20;
+ long dst_offset = 1 << 20;
+
+ const char *tz_str = PyBytes_AsString(tz_str_obj);
+ if (tz_str == NULL) {
+ return -1;
+ }
+ const char *p = tz_str;
+
+ // Read the `std` abbreviation, which must be at least 3 characters long.
+ if (parse_abbr(&p, &std_abbr)) {
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError, "Invalid STD format in %R", tz_str_obj);
+ }
+ goto error;
+ }
+
+ // Now read the STD offset, which is required
+ if (parse_tz_delta(&p, &std_offset)) {
+ PyErr_Format(PyExc_ValueError, "Invalid STD offset in %R", tz_str_obj);
+ goto error;
+ }
+
+ // If the string ends here, there is no DST, otherwise we must parse the
+ // DST abbreviation and start and end dates and times.
+ if (*p == '\0') {
+ goto complete;
+ }
+
+ if (parse_abbr(&p, &dst_abbr)) {
+ if (!PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError, "Invalid DST format in %R", tz_str_obj);
+ }
+ goto error;
+ }
+
+ if (*p == ',') {
+ // From the POSIX standard:
+ //
+ // If no offset follows dst, the alternative time is assumed to be one
+ // hour ahead of standard time.
+ dst_offset = std_offset + 3600;
+ }
+ else {
+ if (parse_tz_delta(&p, &dst_offset)) {
+ PyErr_Format(PyExc_ValueError, "Invalid DST offset in %R",
+ tz_str_obj);
+ goto error;
+ }
+ }
+
+ TransitionRuleType **transitions[2] = {&start, &end};
+ for (size_t i = 0; i < 2; ++i) {
+ if (*p != ',') {
+ PyErr_Format(PyExc_ValueError,
+ "Missing transition rules in TZ string: %R",
+ tz_str_obj);
+ goto error;
+ }
+ p++;
+
+ if (parse_transition_rule(&p, transitions[i])) {
+ PyErr_Format(PyExc_ValueError,
+ "Malformed transition rule in TZ string: %R",
+ tz_str_obj);
+ goto error;
+ }
+ }
+
+ if (*p != '\0') {
+ PyErr_Format(PyExc_ValueError,
+ "Extraneous characters at end of TZ string: %R",
+ tz_str_obj);
+ goto error;
+ }
+
+complete:
+ build_tzrule(state, std_abbr, dst_abbr, std_offset, dst_offset,
+ start, end, out);
+ Py_DECREF(std_abbr);
+ Py_XDECREF(dst_abbr);
+
+ return 0;
+error:
+ Py_XDECREF(std_abbr);
+ if (dst_abbr != NULL && dst_abbr != Py_None) {
+ Py_DECREF(dst_abbr);
+ }
+
+ if (start != NULL) {
+ PyMem_Free(start);
+ }
+
+ if (end != NULL) {
+ PyMem_Free(end);
+ }
+
+ return -1;
+}
+
+static int
+parse_digits(const char **p, int min, int max, int *value)
+{
+ assert(max <= 3);
+ *value = 0;
+ for (int i = 0; i < max; i++, (*p)++) {
+ if (!Py_ISDIGIT(**p)) {
+ return (i < min) ? -1 : 0;
+ }
+ *value *= 10;
+ *value += (**p) - '0';
+ }
+ return 0;
+}
+
+/* Parse the STD and DST abbreviations from a TZ string. */
+static int
+parse_abbr(const char **p, PyObject **abbr)
+{
+ const char *ptr = *p;
+ const char *str_start;
+ const char *str_end;
+
+ if (*ptr == '<') {
+ char buff;
+ ptr++;
+ str_start = ptr;
+ while ((buff = *ptr) != '>') {
+ // From the POSIX standard:
+ //
+ // In the quoted form, the first character shall be the less-than
+ // ( '<' ) character and the last character shall be the
+ // greater-than ( '>' ) character. All characters between these
+ // quoting characters shall be alphanumeric characters from the
+ // portable character set in the current locale, the plus-sign (
+ // '+' ) character, or the minus-sign ( '-' ) character. The std
+ // and dst fields in this case shall not include the quoting
+ // characters.
+ if (!isalpha(buff) && !isdigit(buff) && buff != '+' &&
+ buff != '-') {
+ return -1;
+ }
+ ptr++;
+ }
+ str_end = ptr;
+ ptr++;
+ }
+ else {
+ str_start = ptr;
+ // From the POSIX standard:
+ //
+ // In the unquoted form, all characters in these fields shall be
+ // alphabetic characters from the portable character set in the
+ // current locale.
+ while (isalpha(*ptr)) {
+ ptr++;
+ }
+ str_end = ptr;
+ if (str_end == str_start) {
+ return -1;
+ }
+ }
+
+ *abbr = PyUnicode_FromStringAndSize(str_start, str_end - str_start);
+ if (*abbr == NULL) {
+ return -1;
+ }
+
+ *p = ptr;
+ return 0;
+}
+
+/* Parse a UTC offset from a TZ str. */
+static int
+parse_tz_delta(const char **p, long *total_seconds)
+{
+ // From the POSIX spec:
+ //
+ // Indicates the value added to the local time to arrive at Coordinated
+ // Universal Time. The offset has the form:
+ //
+ // hh[:mm[:ss]]
+ //
+ // One or more digits may be used; the value is always interpreted as a
+ // decimal number.
+ //
+ // The POSIX spec says that the values for `hour` must be between 0 and 24
+ // hours, but RFC 8536 §3.3.1 specifies that the hours part of the
+ // transition times may be signed and range from -167 to 167.
+ int hours = 0;
+ int minutes = 0;
+ int seconds = 0;
+
+ if (parse_transition_time(p, &hours, &minutes, &seconds)) {
+ return -1;
+ }
+
+ if (hours > 24 || hours < -24) {
+ return -1;
+ }
+
+ // Negative numbers correspond to *positive* offsets, from the spec:
+ //
+ // If preceded by a '-', the timezone shall be east of the Prime
+ // Meridian; otherwise, it shall be west (which may be indicated by
+ // an optional preceding '+' ).
+ *total_seconds = -((hours * 3600L) + (minutes * 60) + seconds);
+ return 0;
+}
+
+/* Parse the date portion of a transition rule. */
+static int
+parse_transition_rule(const char **p, TransitionRuleType **out)
+{
+ // The full transition rule indicates when to change back and forth between
+ // STD and DST, and has the form:
+ //
+ // date[/time],date[/time]
+ //
+ // This function parses an individual date[/time] section, and returns
+ // the number of characters that contributed to the transition rule. This
+ // does not include the ',' at the end of the first rule.
+ //
+ // The POSIX spec states that if *time* is not given, the default is 02:00.
+ const char *ptr = *p;
+ int hour = 2;
+ int minute = 0;
+ int second = 0;
+
+ // Rules come in one of three flavors:
+ //
+ // 1. Jn: Julian day n, with no leap days.
+ // 2. n: Day of year (0-based, with leap days)
+ // 3. Mm.n.d: Specifying by month, week and day-of-week.
+
+ if (*ptr == 'M') {
+ int month, week, day;
+ ptr++;
+
+ if (parse_digits(&ptr, 1, 2, &month)) {
+ return -1;
+ }
+ if (*ptr++ != '.') {
+ return -1;
+ }
+ if (parse_digits(&ptr, 1, 1, &week)) {
+ return -1;
+ }
+ if (*ptr++ != '.') {
+ return -1;
+ }
+ if (parse_digits(&ptr, 1, 1, &day)) {
+ return -1;
+ }
+
+ if (*ptr == '/') {
+ ptr++;
+ if (parse_transition_time(&ptr, &hour, &minute, &second)) {
+ return -1;
+ }
+ }
+
+ CalendarRule *rv = PyMem_Calloc(1, sizeof(CalendarRule));
+ if (rv == NULL) {
+ return -1;
+ }
+
+ if (calendarrule_new(month, week, day, hour, minute, second, rv)) {
+ PyMem_Free(rv);
+ return -1;
+ }
+
+ *out = (TransitionRuleType *)rv;
+ }
+ else {
+ int julian = 0;
+ int day = 0;
+ if (*ptr == 'J') {
+ julian = 1;
+ ptr++;
+ }
+
+ if (parse_digits(&ptr, 1, 3, &day)) {
+ return -1;
+ }
+
+ if (*ptr == '/') {
+ ptr++;
+ if (parse_transition_time(&ptr, &hour, &minute, &second)) {
+ return -1;
+ }
+ }
+
+ DayRule *rv = PyMem_Calloc(1, sizeof(DayRule));
+ if (rv == NULL) {
+ return -1;
+ }
+
+ if (dayrule_new(julian, day, hour, minute, second, rv)) {
+ PyMem_Free(rv);
+ return -1;
+ }
+ *out = (TransitionRuleType *)rv;
+ }
+
+ *p = ptr;
+ return 0;
+}
+
+/* Parse the time portion of a transition rule (e.g. following an /) */
+static int
+parse_transition_time(const char **p, int *hour, int *minute, int *second)
+{
+ // From the spec:
+ //
+ // The time has the same format as offset except that no leading sign
+ // ( '-' or '+' ) is allowed.
+ //
+ // The format for the offset is:
+ //
+ // h[h][:mm[:ss]]
+ //
+ // RFC 8536 also allows transition times to be signed and to range from
+ // -167 to +167.
+ const char *ptr = *p;
+ int sign = 1;
+
+ if (*ptr == '-' || *ptr == '+') {
+ if (*ptr == '-') {
+ sign = -1;
+ }
+ ptr++;
+ }
+
+ // The hour can be 1 to 3 numeric characters
+ if (parse_digits(&ptr, 1, 3, hour)) {
+ return -1;
+ }
+ *hour *= sign;
+
+ // Minutes and seconds always of the format ":dd"
+ if (*ptr == ':') {
+ ptr++;
+ if (parse_digits(&ptr, 2, 2, minute)) {
+ return -1;
+ }
+ *minute *= sign;
+
+ if (*ptr == ':') {
+ ptr++;
+ if (parse_digits(&ptr, 2, 2, second)) {
+ return -1;
+ }
+ *second *= sign;
+ }
+ }
+
+ *p = ptr;
+ return 0;
+}
+
+/* Constructor for a _tzrule.
+ *
+ * If `dst_abbr` is NULL, this will construct an "STD-only" _tzrule, in which
+ * case `dst_offset` will be ignored and `start` and `end` are expected to be
+ * NULL as well.
+ *
+ * Returns 0 on success.
+ */
+static int
+build_tzrule(zoneinfo_state *state, PyObject *std_abbr, PyObject *dst_abbr,
+ long std_offset, long dst_offset, TransitionRuleType *start,
+ TransitionRuleType *end, _tzrule *out)
+{
+ _tzrule rv = {{0}};
+
+ rv.start = start;
+ rv.end = end;
+
+ if (build_ttinfo(state, std_offset, 0, std_abbr, &rv.std)) {
+ goto error;
+ }
+
+ if (dst_abbr != NULL) {
+ rv.dst_diff = dst_offset - std_offset;
+ if (build_ttinfo(state, dst_offset, rv.dst_diff, dst_abbr, &rv.dst)) {
+ goto error;
+ }
+ }
+ else {
+ rv.std_only = 1;
+ }
+
+ *out = rv;
+
+ return 0;
+error:
+ xdecref_ttinfo(&rv.std);
+ xdecref_ttinfo(&rv.dst);
+ return -1;
+}
+
+/* Destructor for _tzrule. */
+static void
+free_tzrule(_tzrule *tzrule)
+{
+ xdecref_ttinfo(&(tzrule->std));
+ if (!tzrule->std_only) {
+ xdecref_ttinfo(&(tzrule->dst));
+ }
+
+ if (tzrule->start != NULL) {
+ PyMem_Free(tzrule->start);
+ }
+
+ if (tzrule->end != NULL) {
+ PyMem_Free(tzrule->end);
+ }
+}
+
+/* Calculate DST offsets from transitions and UTC offsets
+ *
+ * This is necessary because each C `ttinfo` only contains the UTC offset,
+ * time zone abbreviation and an isdst boolean - it does not include the
+ * amount of the DST offset, but we need the amount for the dst() function.
+ *
+ * Thus function uses heuristics to infer what the offset should be, so it
+ * is not guaranteed that this will work for all zones. If we cannot assign
+ * a value for a given DST offset, we'll assume it's 1H rather than 0H, so
+ * bool(dt.dst()) will always match ttinfo.isdst.
+ */
+static void
+utcoff_to_dstoff(size_t *trans_idx, long *utcoffs, long *dstoffs,
+ unsigned char *isdsts, size_t num_transitions,
+ size_t num_ttinfos)
+{
+ size_t dst_count = 0;
+ size_t dst_found = 0;
+ for (size_t i = 0; i < num_ttinfos; ++i) {
+ dst_count++;
+ }
+
+ for (size_t i = 1; i < num_transitions; ++i) {
+ if (dst_count == dst_found) {
+ break;
+ }
+
+ size_t idx = trans_idx[i];
+ size_t comp_idx = trans_idx[i - 1];
+
+ // Only look at DST offsets that have nto been assigned already
+ if (!isdsts[idx] || dstoffs[idx] != 0) {
+ continue;
+ }
+
+ long dstoff = 0;
+ long utcoff = utcoffs[idx];
+
+ if (!isdsts[comp_idx]) {
+ dstoff = utcoff - utcoffs[comp_idx];
+ }
+
+ if (!dstoff && idx < (num_ttinfos - 1)) {
+ comp_idx = trans_idx[i + 1];
+
+ // If the following transition is also DST and we couldn't find
+ // the DST offset by this point, we're going to have to skip it
+ // and hope this transition gets assigned later
+ if (isdsts[comp_idx]) {
+ continue;
+ }
+
+ dstoff = utcoff - utcoffs[comp_idx];
+ }
+
+ if (dstoff) {
+ dst_found++;
+ dstoffs[idx] = dstoff;
+ }
+ }
+
+ if (dst_found < dst_count) {
+ // If there are time zones we didn't find a value for, we'll end up
+ // with dstoff = 0 for something where isdst=1. This is obviously
+ // wrong — one hour will be a much better guess than 0.
+ for (size_t idx = 0; idx < num_ttinfos; ++idx) {
+ if (isdsts[idx] && !dstoffs[idx]) {
+ dstoffs[idx] = 3600;
+ }
+ }
+ }
+}
+
+#define _swap(x, y, buffer) \
+ buffer = x; \
+ x = y; \
+ y = buffer;
+
+/* Calculate transitions in local time from UTC time and offsets.
+ *
+ * We want to know when each transition occurs, denominated in the number of
+ * nominal wall-time seconds between 1970-01-01T00:00:00 and the transition in
+ * *local time* (note: this is *not* equivalent to the output of
+ * datetime.timestamp, which is the total number of seconds actual elapsed
+ * since 1970-01-01T00:00:00Z in UTC).
+ *
+ * This is an ambiguous question because "local time" can be ambiguous — but it
+ * is disambiguated by the `fold` parameter, so we allocate two arrays:
+ *
+ * trans_local[0]: The wall-time transitions for fold=0
+ * trans_local[1]: The wall-time transitions for fold=1
+ *
+ * This returns 0 on success and a negative number of failure. The trans_local
+ * arrays must be freed if they are not NULL.
+ */
+static int
+ts_to_local(size_t *trans_idx, int64_t *trans_utc, long *utcoff,
+ int64_t *trans_local[2], size_t num_ttinfos,
+ size_t num_transitions)
+{
+ if (num_transitions == 0) {
+ return 0;
+ }
+
+ // Copy the UTC transitions into each array to be modified in place later
+ for (size_t i = 0; i < 2; ++i) {
+ trans_local[i] = PyMem_Malloc(num_transitions * sizeof(int64_t));
+ if (trans_local[i] == NULL) {
+ return -1;
+ }
+
+ memcpy(trans_local[i], trans_utc, num_transitions * sizeof(int64_t));
+ }
+
+ int64_t offset_0, offset_1, buff;
+ if (num_ttinfos > 1) {
+ offset_0 = utcoff[0];
+ offset_1 = utcoff[trans_idx[0]];
+
+ if (offset_1 > offset_0) {
+ _swap(offset_0, offset_1, buff);
+ }
+ }
+ else {
+ offset_0 = utcoff[0];
+ offset_1 = utcoff[0];
+ }
+
+ trans_local[0][0] += offset_0;
+ trans_local[1][0] += offset_1;
+
+ for (size_t i = 1; i < num_transitions; ++i) {
+ offset_0 = utcoff[trans_idx[i - 1]];
+ offset_1 = utcoff[trans_idx[i]];
+
+ if (offset_1 > offset_0) {
+ _swap(offset_1, offset_0, buff);
+ }
+
+ trans_local[0][i] += offset_0;
+ trans_local[1][i] += offset_1;
+ }
+
+ return 0;
+}
+
+/* Simple bisect_right binary search implementation */
+static size_t
+_bisect(const int64_t value, const int64_t *arr, size_t size)
+{
+ size_t lo = 0;
+ size_t hi = size;
+ size_t m;
+
+ while (lo < hi) {
+ m = (lo + hi) / 2;
+ if (arr[m] > value) {
+ hi = m;
+ }
+ else {
+ lo = m + 1;
+ }
+ }
+
+ return hi;
+}
+
+/* Find the ttinfo rules that apply at a given local datetime. */
+static _ttinfo *
+find_ttinfo(zoneinfo_state *state, PyZoneInfo_ZoneInfo *self, PyObject *dt)
+{
+ // datetime.time has a .tzinfo attribute that passes None as the dt
+ // argument; it only really has meaning for fixed-offset zones.
+ if (dt == Py_None) {
+ if (self->fixed_offset) {
+ return &(self->tzrule_after.std);
+ }
+ else {
+ return &(state->NO_TTINFO);
+ }
+ }
+
+ int64_t ts;
+ if (get_local_timestamp(dt, &ts)) {
+ return NULL;
+ }
+
+ unsigned char fold = PyDateTime_DATE_GET_FOLD(dt);
+ assert(fold < 2);
+ int64_t *local_transitions = self->trans_list_wall[fold];
+ size_t num_trans = self->num_transitions;
+
+ if (num_trans && ts < local_transitions[0]) {
+ return self->ttinfo_before;
+ }
+ else if (!num_trans || ts > local_transitions[self->num_transitions - 1]) {
+ return find_tzrule_ttinfo(&(self->tzrule_after), ts, fold,
+ PyDateTime_GET_YEAR(dt));
+ }
+ else {
+ size_t idx = _bisect(ts, local_transitions, self->num_transitions) - 1;
+ assert(idx < self->num_transitions);
+ return self->trans_ttinfos[idx];
+ }
+}
+
+static int
+is_leap_year(int year)
+{
+ const unsigned int ayear = (unsigned int)year;
+ return ayear % 4 == 0 && (ayear % 100 != 0 || ayear % 400 == 0);
+}
+
+/* Calculates ordinal datetime from year, month and day. */
+static int
+ymd_to_ord(int y, int m, int d)
+{
+ y -= 1;
+ int days_before_year = (y * 365) + (y / 4) - (y / 100) + (y / 400);
+ int yearday = DAYS_BEFORE_MONTH[m];
+ if (m > 2 && is_leap_year(y + 1)) {
+ yearday += 1;
+ }
+
+ return days_before_year + yearday + d;
+}
+
+/* Calculate the number of seconds since 1970-01-01 in local time.
+ *
+ * This gets a datetime in the same "units" as self->trans_list_wall so that we
+ * can easily determine which transitions a datetime falls between. See the
+ * comment above ts_to_local for more information.
+ * */
+static int
+get_local_timestamp(PyObject *dt, int64_t *local_ts)
+{
+ assert(local_ts != NULL);
+
+ int hour, minute, second;
+ int ord;
+ if (PyDateTime_CheckExact(dt)) {
+ int y = PyDateTime_GET_YEAR(dt);
+ int m = PyDateTime_GET_MONTH(dt);
+ int d = PyDateTime_GET_DAY(dt);
+ hour = PyDateTime_DATE_GET_HOUR(dt);
+ minute = PyDateTime_DATE_GET_MINUTE(dt);
+ second = PyDateTime_DATE_GET_SECOND(dt);
+
+ ord = ymd_to_ord(y, m, d);
+ }
+ else {
+ PyObject *num = PyObject_CallMethod(dt, "toordinal", NULL);
+ if (num == NULL) {
+ return -1;
+ }
+
+ ord = PyLong_AsLong(num);
+ Py_DECREF(num);
+ if (ord == -1 && PyErr_Occurred()) {
+ return -1;
+ }
+
+ num = PyObject_GetAttrString(dt, "hour");
+ if (num == NULL) {
+ return -1;
+ }
+ hour = PyLong_AsLong(num);
+ Py_DECREF(num);
+ if (hour == -1) {
+ return -1;
+ }
+
+ num = PyObject_GetAttrString(dt, "minute");
+ if (num == NULL) {
+ return -1;
+ }
+ minute = PyLong_AsLong(num);
+ Py_DECREF(num);
+ if (minute == -1) {
+ return -1;
+ }
+
+ num = PyObject_GetAttrString(dt, "second");
+ if (num == NULL) {
+ return -1;
+ }
+ second = PyLong_AsLong(num);
+ Py_DECREF(num);
+ if (second == -1) {
+ return -1;
+ }
+ }
+
+ *local_ts = (int64_t)(ord - EPOCHORDINAL) * 86400L +
+ (int64_t)(hour * 3600L + minute * 60 + second);
+
+ return 0;
+}
+
+/////
+// Functions for cache handling
+
+/* Constructor for StrongCacheNode */
+static StrongCacheNode *
+strong_cache_node_new(PyObject *key, PyObject *zone)
+{
+ StrongCacheNode *node = PyMem_Malloc(sizeof(StrongCacheNode));
+ if (node == NULL) {
+ return NULL;
+ }
+
+ node->next = NULL;
+ node->prev = NULL;
+ node->key = Py_NewRef(key);
+ node->zone = Py_NewRef(zone);
+
+ return node;
+}
+
+/* Destructor for StrongCacheNode */
+void
+strong_cache_node_free(StrongCacheNode *node)
+{
+ Py_XDECREF(node->key);
+ Py_XDECREF(node->zone);
+
+ PyMem_Free(node);
+}
+
+/* Frees all nodes at or after a specified root in the strong cache.
+ *
+ * This can be used on the root node to free the entire cache or it can be used
+ * to clear all nodes that have been expired (which, if everything is going
+ * right, will actually only be 1 node at a time).
+ */
+void
+strong_cache_free(StrongCacheNode *root)
+{
+ StrongCacheNode *node = root;
+ StrongCacheNode *next_node;
+ while (node != NULL) {
+ next_node = node->next;
+ strong_cache_node_free(node);
+
+ node = next_node;
+ }
+}
+
+/* Removes a node from the cache and update its neighbors.
+ *
+ * This is used both when ejecting a node from the cache and when moving it to
+ * the front of the cache.
+ */
+static void
+remove_from_strong_cache(zoneinfo_state *state, StrongCacheNode *node)
+{
+ if (state->ZONEINFO_STRONG_CACHE == node) {
+ state->ZONEINFO_STRONG_CACHE = node->next;
+ }
+
+ if (node->prev != NULL) {
+ node->prev->next = node->next;
+ }
+
+ if (node->next != NULL) {
+ node->next->prev = node->prev;
+ }
+
+ node->next = NULL;
+ node->prev = NULL;
+}
+
+/* Retrieves the node associated with a key, if it exists.
+ *
+ * This traverses the strong cache until it finds a matching key and returns a
+ * pointer to the relevant node if found. Returns NULL if no node is found.
+ *
+ * root may be NULL, indicating an empty cache.
+ */
+static StrongCacheNode *
+find_in_strong_cache(const StrongCacheNode *const root, PyObject *const key)
+{
+ const StrongCacheNode *node = root;
+ while (node != NULL) {
+ int rv = PyObject_RichCompareBool(key, node->key, Py_EQ);
+ if (rv < 0) {
+ return NULL;
+ }
+ if (rv) {
+ return (StrongCacheNode *)node;
+ }
+
+ node = node->next;
+ }
+
+ return NULL;
+}
+
+/* Ejects a given key from the class's strong cache, if applicable.
+ *
+ * This function is used to enable the per-key functionality in clear_cache.
+ */
+static int
+eject_from_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
+ PyObject *key)
+{
+ if (type != state->ZoneInfoType) {
+ return 0;
+ }
+
+ StrongCacheNode *cache = state->ZONEINFO_STRONG_CACHE;
+ StrongCacheNode *node = find_in_strong_cache(cache, key);
+ if (node != NULL) {
+ remove_from_strong_cache(state, node);
+
+ strong_cache_node_free(node);
+ }
+ else if (PyErr_Occurred()) {
+ return -1;
+ }
+ return 0;
+}
+
+/* Moves a node to the front of the LRU cache.
+ *
+ * The strong cache is an LRU cache, so whenever a given node is accessed, if
+ * it is not at the front of the cache, it needs to be moved there.
+ */
+static void
+move_strong_cache_node_to_front(zoneinfo_state *state, StrongCacheNode **root,
+ StrongCacheNode *node)
+{
+ StrongCacheNode *root_p = *root;
+ if (root_p == node) {
+ return;
+ }
+
+ remove_from_strong_cache(state, node);
+
+ node->prev = NULL;
+ node->next = root_p;
+
+ if (root_p != NULL) {
+ root_p->prev = node;
+ }
+
+ *root = node;
+}
+
+/* Retrieves a ZoneInfo from the strong cache if it's present.
+ *
+ * This function finds the ZoneInfo by key and if found will move the node to
+ * the front of the LRU cache and return a new reference to it. It returns NULL
+ * if the key is not in the cache.
+ *
+ * The strong cache is currently only implemented for the base class, so this
+ * always returns a cache miss for subclasses.
+ */
+static PyObject *
+zone_from_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
+ PyObject *const key)
+{
+ if (type != state->ZoneInfoType) {
+ return NULL; // Strong cache currently only implemented for base class
+ }
+
+ StrongCacheNode *cache = state->ZONEINFO_STRONG_CACHE;
+ StrongCacheNode *node = find_in_strong_cache(cache, key);
+
+ if (node != NULL) {
+ StrongCacheNode **root = &(state->ZONEINFO_STRONG_CACHE);
+ move_strong_cache_node_to_front(state, root, node);
+ return Py_NewRef(node->zone);
+ }
+
+ return NULL; // Cache miss
+}
+
+/* Inserts a new key into the strong LRU cache.
+ *
+ * This function is only to be used after a cache miss — it creates a new node
+ * at the front of the cache and ejects any stale entries (keeping the size of
+ * the cache to at most ZONEINFO_STRONG_CACHE_MAX_SIZE).
+ */
+static void
+update_strong_cache(zoneinfo_state *state, const PyTypeObject *const type,
+ PyObject *key, PyObject *zone)
+{
+ if (type != state->ZoneInfoType) {
+ return;
+ }
+
+ StrongCacheNode *new_node = strong_cache_node_new(key, zone);
+ StrongCacheNode **root = &(state->ZONEINFO_STRONG_CACHE);
+ move_strong_cache_node_to_front(state, root, new_node);
+
+ StrongCacheNode *node = new_node->next;
+ for (size_t i = 1; i < ZONEINFO_STRONG_CACHE_MAX_SIZE; ++i) {
+ if (node == NULL) {
+ return;
+ }
+ node = node->next;
+ }
+
+ // Everything beyond this point needs to be freed
+ if (node != NULL) {
+ if (node->prev != NULL) {
+ node->prev->next = NULL;
+ }
+ strong_cache_free(node);
+ }
+}
+
+/* Clears all entries into a type's strong cache.
+ *
+ * Because the strong cache is not implemented for subclasses, this is a no-op
+ * for everything except the base class.
+ */
+void
+clear_strong_cache(zoneinfo_state *state, const PyTypeObject *const type)
+{
+ if (type != state->ZoneInfoType) {
+ return;
+ }
+
+ strong_cache_free(state->ZONEINFO_STRONG_CACHE);
+ state->ZONEINFO_STRONG_CACHE = NULL;
+}
+
+static PyObject *
+new_weak_cache(void)
+{
+ PyObject *WeakValueDictionary =
+ _PyImport_GetModuleAttrString("weakref", "WeakValueDictionary");
+ if (WeakValueDictionary == NULL) {
+ return NULL;
+ }
+ PyObject *weak_cache = PyObject_CallNoArgs(WeakValueDictionary);
+ Py_DECREF(WeakValueDictionary);
+ return weak_cache;
+}
+
+// This function is not idempotent and must be called on a new module object.
+static int
+initialize_caches(zoneinfo_state *state)
+{
+ state->TIMEDELTA_CACHE = PyDict_New();
+ if (state->TIMEDELTA_CACHE == NULL) {
+ return -1;
+ }
+
+ state->ZONEINFO_WEAK_CACHE = new_weak_cache();
+ if (state->ZONEINFO_WEAK_CACHE == NULL) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyObject *
+zoneinfo_init_subclass(PyTypeObject *cls, PyObject *args, PyObject **kwargs)
+{
+ PyObject *weak_cache = new_weak_cache();
+ if (weak_cache == NULL) {
+ return NULL;
+ }
+
+ if (PyObject_SetAttrString((PyObject *)cls, "_weak_cache",
+ weak_cache) < 0) {
+ Py_DECREF(weak_cache);
+ return NULL;
+ }
+ Py_DECREF(weak_cache);
+ Py_RETURN_NONE;
+}
+
+/////
+// Specify the ZoneInfo type
+static PyMethodDef zoneinfo_methods[] = {
+ ZONEINFO_ZONEINFO_CLEAR_CACHE_METHODDEF
+ ZONEINFO_ZONEINFO_NO_CACHE_METHODDEF
+ ZONEINFO_ZONEINFO_FROM_FILE_METHODDEF
+ ZONEINFO_ZONEINFO_UTCOFFSET_METHODDEF
+ ZONEINFO_ZONEINFO_DST_METHODDEF
+ ZONEINFO_ZONEINFO_TZNAME_METHODDEF
+ {"fromutc", (PyCFunction)zoneinfo_fromutc, METH_O,
+ PyDoc_STR("Given a datetime with local time in UTC, retrieve an adjusted "
+ "datetime in local time.")},
+ {"__reduce__", (PyCFunction)zoneinfo_reduce, METH_NOARGS,
+ PyDoc_STR("Function for serialization with the pickle protocol.")},
+ ZONEINFO_ZONEINFO__UNPICKLE_METHODDEF
+ {"__init_subclass__", (PyCFunction)(void (*)(void))zoneinfo_init_subclass,
+ METH_VARARGS | METH_KEYWORDS | METH_CLASS,
+ PyDoc_STR("Function to initialize subclasses.")},
+ {NULL} /* Sentinel */
+};
+
+static PyMemberDef zoneinfo_members[] = {
+ {.name = "key",
+ .offset = offsetof(PyZoneInfo_ZoneInfo, key),
+ .type = T_OBJECT_EX,
+ .flags = READONLY,
+ .doc = NULL},
+ {.name = "__weaklistoffset__",
+ .offset = offsetof(PyZoneInfo_ZoneInfo, weakreflist),
+ .type = T_PYSSIZET,
+ .flags = READONLY},
+ {NULL}, /* Sentinel */
+};
+
+static PyType_Slot zoneinfo_slots[] = {
+ {Py_tp_repr, zoneinfo_repr},
+ {Py_tp_str, zoneinfo_str},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_methods, zoneinfo_methods},
+ {Py_tp_members, zoneinfo_members},
+ {Py_tp_new, zoneinfo_new},
+ {Py_tp_dealloc, zoneinfo_dealloc},
+ {Py_tp_traverse, zoneinfo_traverse},
+ {Py_tp_clear, zoneinfo_clear},
+ {0, NULL},
+};
+
+static PyType_Spec zoneinfo_spec = {
+ .name = "zoneinfo.ZoneInfo",
+ .basicsize = sizeof(PyZoneInfo_ZoneInfo),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = zoneinfo_slots,
+};
+
+/////
+// Specify the _zoneinfo module
+static PyMethodDef module_methods[] = {{NULL, NULL}};
+
+static int
+module_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ zoneinfo_state *state = zoneinfo_get_state(mod);
+
+ Py_VISIT(state->ZoneInfoType);
+ Py_VISIT(state->io_open);
+ Py_VISIT(state->_tzpath_find_tzfile);
+ Py_VISIT(state->_common_mod);
+ Py_VISIT(state->TIMEDELTA_CACHE);
+ Py_VISIT(state->ZONEINFO_WEAK_CACHE);
+
+ StrongCacheNode *node = state->ZONEINFO_STRONG_CACHE;
+ while (node != NULL) {
+ StrongCacheNode *next = node->next;
+ Py_VISIT(node->key);
+ Py_VISIT(node->zone);
+ node = next;
+ }
+
+ Py_VISIT(state->NO_TTINFO.utcoff);
+ Py_VISIT(state->NO_TTINFO.dstoff);
+ Py_VISIT(state->NO_TTINFO.tzname);
+
+ return 0;
+}
+
+static int
+module_clear(PyObject *mod)
+{
+ zoneinfo_state *state = zoneinfo_get_state(mod);
+
+ Py_CLEAR(state->ZoneInfoType);
+ Py_CLEAR(state->io_open);
+ Py_CLEAR(state->_tzpath_find_tzfile);
+ Py_CLEAR(state->_common_mod);
+ Py_CLEAR(state->TIMEDELTA_CACHE);
+ Py_CLEAR(state->ZONEINFO_WEAK_CACHE);
+ clear_strong_cache(state, state->ZoneInfoType);
+ Py_CLEAR(state->NO_TTINFO.utcoff);
+ Py_CLEAR(state->NO_TTINFO.dstoff);
+ Py_CLEAR(state->NO_TTINFO.tzname);
+
+ return 0;
+}
+
+static void
+module_free(void *mod)
+{
+ (void)module_clear((PyObject *)mod);
+}
+
+static int
+zoneinfomodule_exec(PyObject *m)
+{
+ PyDateTime_IMPORT;
+ if (PyDateTimeAPI == NULL) {
+ goto error;
+ }
+
+ zoneinfo_state *state = zoneinfo_get_state(m);
+ PyObject *base = (PyObject *)PyDateTimeAPI->TZInfoType;
+ state->ZoneInfoType = (PyTypeObject *)PyType_FromModuleAndSpec(m,
+ &zoneinfo_spec, base);
+ if (state->ZoneInfoType == NULL) {
+ goto error;
+ }
+
+ int rc = PyModule_AddObjectRef(m, "ZoneInfo",
+ (PyObject *)state->ZoneInfoType);
+ if (rc < 0) {
+ goto error;
+ }
+
+ /* Populate imports */
+ state->_tzpath_find_tzfile =
+ _PyImport_GetModuleAttrString("zoneinfo._tzpath", "find_tzfile");
+ if (state->_tzpath_find_tzfile == NULL) {
+ goto error;
+ }
+
+ state->io_open = _PyImport_GetModuleAttrString("io", "open");
+ if (state->io_open == NULL) {
+ goto error;
+ }
+
+ state->_common_mod = PyImport_ImportModule("zoneinfo._common");
+ if (state->_common_mod == NULL) {
+ goto error;
+ }
+
+ if (state->NO_TTINFO.utcoff == NULL) {
+ state->NO_TTINFO.utcoff = Py_NewRef(Py_None);
+ state->NO_TTINFO.dstoff = Py_NewRef(Py_None);
+ state->NO_TTINFO.tzname = Py_NewRef(Py_None);
+ }
+
+ if (initialize_caches(state)) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ return -1;
+}
+
+static PyModuleDef_Slot zoneinfomodule_slots[] = {
+ {Py_mod_exec, zoneinfomodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static struct PyModuleDef zoneinfomodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_zoneinfo",
+ .m_doc = "C implementation of the zoneinfo module",
+ .m_size = sizeof(zoneinfo_state),
+ .m_methods = module_methods,
+ .m_slots = zoneinfomodule_slots,
+ .m_traverse = module_traverse,
+ .m_clear = module_clear,
+ .m_free = module_free,
+};
+
+PyMODINIT_FUNC
+PyInit__zoneinfo(void)
+{
+ return PyModuleDef_Init(&zoneinfomodule);
+}
diff --git a/contrib/tools/python3/Modules/addrinfo.h b/contrib/tools/python3/Modules/addrinfo.h
new file mode 100644
index 00000000000..66e5a795f86
--- /dev/null
+++ b/contrib/tools/python3/Modules/addrinfo.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef HAVE_GETADDRINFO
+
+/*
+ * Error return codes from getaddrinfo()
+ */
+#ifdef EAI_ADDRFAMILY
+/* If this is defined, there is a conflicting implementation
+ in the C library, which can't be used for some reason.
+ Make sure it won't interfere with this emulation. */
+
+#undef EAI_ADDRFAMILY
+#undef EAI_AGAIN
+#undef EAI_BADFLAGS
+#undef EAI_FAIL
+#undef EAI_FAMILY
+#undef EAI_MEMORY
+#undef EAI_NODATA
+#undef EAI_NONAME
+#undef EAI_SERVICE
+#undef EAI_SOCKTYPE
+#undef EAI_SYSTEM
+#undef EAI_BADHINTS
+#undef EAI_PROTOCOL
+#undef EAI_MAX
+#undef getaddrinfo
+#define getaddrinfo fake_getaddrinfo
+#endif /* EAI_ADDRFAMILY */
+
+#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
+#define EAI_AGAIN 2 /* temporary failure in name resolution */
+#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
+#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
+#define EAI_FAMILY 5 /* ai_family not supported */
+#define EAI_MEMORY 6 /* memory allocation failure */
+#define EAI_NODATA 7 /* no address associated with hostname */
+#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
+#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
+#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
+#define EAI_SYSTEM 11 /* system error returned in errno */
+#define EAI_BADHINTS 12
+#define EAI_PROTOCOL 13
+#define EAI_MAX 14
+
+/*
+ * Flag values for getaddrinfo()
+ */
+#ifdef AI_PASSIVE
+#undef AI_PASSIVE
+#undef AI_CANONNAME
+#undef AI_NUMERICHOST
+#undef AI_MASK
+#undef AI_ALL
+#undef AI_V4MAPPED_CFG
+#undef AI_ADDRCONFIG
+#undef AI_V4MAPPED
+#undef AI_DEFAULT
+#endif /* AI_PASSIVE */
+
+#define AI_PASSIVE 0x00000001 /* get address to use bind() */
+#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
+#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
+/* valid flags for addrinfo */
+#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
+
+#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
+#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
+#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
+#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
+/* special recommended flags for getipnodebyname */
+#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
+
+#endif /* !HAVE_GETADDRINFO */
+
+#ifndef HAVE_GETNAMEINFO
+
+/*
+ * Constants for getnameinfo()
+ */
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#define NI_MAXSERV 32
+#endif /* !NI_MAXHOST */
+
+/*
+ * Flag values for getnameinfo()
+ */
+#ifndef NI_NOFQDN
+#define NI_NOFQDN 0x00000001
+#define NI_NUMERICHOST 0x00000002
+#define NI_NAMEREQD 0x00000004
+#define NI_NUMERICSERV 0x00000008
+#define NI_DGRAM 0x00000010
+#endif /* !NI_NOFQDN */
+
+#endif /* !HAVE_GETNAMEINFO */
+
+#ifndef HAVE_ADDRINFO
+struct addrinfo {
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ size_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for hostname */
+ struct sockaddr *ai_addr; /* binary address */
+ struct addrinfo *ai_next; /* next structure in linked list */
+};
+#endif /* !HAVE_ADDRINFO */
+
+#ifndef HAVE_SOCKADDR_STORAGE
+/*
+ * RFC 2553: protocol-independent placeholder for socket addresses
+ */
+#define _SS_MAXSIZE 128
+#define _SS_ALIGNSIZE (sizeof(long long))
+#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) * 2)
+#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) * 2 - \
+ _SS_PAD1SIZE - _SS_ALIGNSIZE)
+
+struct sockaddr_storage {
+#ifdef HAVE_SOCKADDR_SA_LEN
+ unsigned char ss_len; /* address length */
+ unsigned char ss_family; /* address family */
+#else
+ unsigned short ss_family; /* address family */
+#endif /* HAVE_SOCKADDR_SA_LEN */
+ char __ss_pad1[_SS_PAD1SIZE];
+ long long __ss_align; /* force desired structure storage alignment */
+ char __ss_pad2[_SS_PAD2SIZE];
+};
+#endif /* !HAVE_SOCKADDR_STORAGE */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef ENABLE_IPV6
+extern void freehostent(struct hostent *);
+#endif
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/tools/python3/Modules/arraymodule.c b/contrib/tools/python3/Modules/arraymodule.c
new file mode 100644
index 00000000000..6680820d8e6
--- /dev/null
+++ b/contrib/tools/python3/Modules/arraymodule.c
@@ -0,0 +1,3138 @@
+/* Array object implementation */
+
+/* An array is a uniform list -- all items have the same type.
+ The item type is restricted to simple C types like int or float */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_bytesobject.h" // _PyBytes_Repeat
+#include "structmember.h" // PyMemberDef
+#include <stddef.h> // offsetof()
+
+/*[clinic input]
+module array
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=7d1b8d7f5958fd83]*/
+
+struct arrayobject; /* Forward */
+static struct PyModuleDef arraymodule;
+
+/* All possible arraydescr values are defined in the vector "descriptors"
+ * below. That's defined later because the appropriate get and set
+ * functions aren't visible yet.
+ */
+struct arraydescr {
+ char typecode;
+ int itemsize;
+ PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
+ int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
+ int (*compareitems)(const void *, const void *, Py_ssize_t);
+ const char *formats;
+ int is_integer_type;
+ int is_signed;
+};
+
+typedef struct arrayobject {
+ PyObject_VAR_HEAD
+ char *ob_item;
+ Py_ssize_t allocated;
+ const struct arraydescr *ob_descr;
+ PyObject *weakreflist; /* List of weak references */
+ Py_ssize_t ob_exports; /* Number of exported buffers */
+} arrayobject;
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t index;
+ arrayobject *ao;
+ PyObject* (*getitem)(struct arrayobject *, Py_ssize_t);
+} arrayiterobject;
+
+typedef struct {
+ PyTypeObject *ArrayType;
+ PyTypeObject *ArrayIterType;
+
+ PyObject *array_reconstructor;
+
+ PyObject *str_read;
+ PyObject *str_write;
+ PyObject *str___dict__;
+ PyObject *str_iter;
+} array_state;
+
+static array_state *
+get_array_state(PyObject *module)
+{
+ return (array_state *)_PyModule_GetState(module);
+}
+
+#define find_array_state_by_type(tp) \
+ (get_array_state(PyType_GetModuleByDef(tp, &arraymodule)))
+#define get_array_state_by_class(cls) \
+ (get_array_state(PyType_GetModule(cls)))
+
+enum machine_format_code {
+ UNKNOWN_FORMAT = -1,
+ /* UNKNOWN_FORMAT is used to indicate that the machine format for an
+ * array type code cannot be interpreted. When this occurs, a list of
+ * Python objects is used to represent the content of the array
+ * instead of using the memory content of the array directly. In that
+ * case, the array_reconstructor mechanism is bypassed completely, and
+ * the standard array constructor is used instead.
+ *
+ * This is will most likely occur when the machine doesn't use IEEE
+ * floating-point numbers.
+ */
+
+ UNSIGNED_INT8 = 0,
+ SIGNED_INT8 = 1,
+ UNSIGNED_INT16_LE = 2,
+ UNSIGNED_INT16_BE = 3,
+ SIGNED_INT16_LE = 4,
+ SIGNED_INT16_BE = 5,
+ UNSIGNED_INT32_LE = 6,
+ UNSIGNED_INT32_BE = 7,
+ SIGNED_INT32_LE = 8,
+ SIGNED_INT32_BE = 9,
+ UNSIGNED_INT64_LE = 10,
+ UNSIGNED_INT64_BE = 11,
+ SIGNED_INT64_LE = 12,
+ SIGNED_INT64_BE = 13,
+ IEEE_754_FLOAT_LE = 14,
+ IEEE_754_FLOAT_BE = 15,
+ IEEE_754_DOUBLE_LE = 16,
+ IEEE_754_DOUBLE_BE = 17,
+ UTF16_LE = 18,
+ UTF16_BE = 19,
+ UTF32_LE = 20,
+ UTF32_BE = 21
+};
+#define MACHINE_FORMAT_CODE_MIN 0
+#define MACHINE_FORMAT_CODE_MAX 21
+
+
+/*
+ * Must come after arrayobject, arrayiterobject,
+ * and enum machine_code_type definitions.
+ */
+#include "clinic/arraymodule.c.h"
+
+#define array_Check(op, state) PyObject_TypeCheck(op, state->ArrayType)
+
+static int
+array_resize(arrayobject *self, Py_ssize_t newsize)
+{
+ char *items;
+ size_t _new_size;
+
+ if (self->ob_exports > 0 && newsize != Py_SIZE(self)) {
+ PyErr_SetString(PyExc_BufferError,
+ "cannot resize an array that is exporting buffers");
+ return -1;
+ }
+
+ /* Bypass realloc() when a previous overallocation is large enough
+ to accommodate the newsize. If the newsize is 16 smaller than the
+ current size, then proceed with the realloc() to shrink the array.
+ */
+
+ if (self->allocated >= newsize &&
+ Py_SIZE(self) < newsize + 16 &&
+ self->ob_item != NULL) {
+ Py_SET_SIZE(self, newsize);
+ return 0;
+ }
+
+ if (newsize == 0) {
+ PyMem_Free(self->ob_item);
+ self->ob_item = NULL;
+ Py_SET_SIZE(self, 0);
+ self->allocated = 0;
+ return 0;
+ }
+
+ /* This over-allocates proportional to the array size, making room
+ * for additional growth. The over-allocation is mild, but is
+ * enough to give linear-time amortized behavior over a long
+ * sequence of appends() in the presence of a poorly-performing
+ * system realloc().
+ * The growth pattern is: 0, 4, 8, 16, 25, 34, 46, 56, 67, 79, ...
+ * Note, the pattern starts out the same as for lists but then
+ * grows at a smaller rate so that larger arrays only overallocate
+ * by about 1/16th -- this is done because arrays are presumed to be more
+ * memory critical.
+ */
+
+ _new_size = (newsize >> 4) + (Py_SIZE(self) < 8 ? 3 : 7) + newsize;
+ items = self->ob_item;
+ /* XXX The following multiplication and division does not optimize away
+ like it does for lists since the size is not known at compile time */
+ if (_new_size <= ((~(size_t)0) / self->ob_descr->itemsize))
+ PyMem_RESIZE(items, char, (_new_size * self->ob_descr->itemsize));
+ else
+ items = NULL;
+ if (items == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->ob_item = items;
+ Py_SET_SIZE(self, newsize);
+ self->allocated = _new_size;
+ return 0;
+}
+
+/****************************************************************************
+Get and Set functions for each type.
+A Get function takes an arrayobject* and an integer index, returning the
+array value at that index wrapped in an appropriate PyObject*.
+A Set function takes an arrayobject, integer index, and PyObject*; sets
+the array value at that index to the raw C data extracted from the PyObject*,
+and returns 0 if successful, else nonzero on failure (PyObject* not of an
+appropriate type or value).
+Note that the basic Get and Set functions do NOT check that the index is
+in bounds; that's the responsibility of the caller.
+****************************************************************************/
+
+static PyObject *
+b_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ long x = ((signed char *)ap->ob_item)[i];
+ return PyLong_FromLong(x);
+}
+
+static int
+b_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ short x;
+ /* PyArg_Parse's 'b' formatter is for an unsigned char, therefore
+ must use the next size up that is signed ('h') and manually do
+ the overflow checking */
+ if (!PyArg_Parse(v, "h;array item must be integer", &x))
+ return -1;
+ else if (x < -128) {
+ PyErr_SetString(PyExc_OverflowError,
+ "signed char is less than minimum");
+ return -1;
+ }
+ else if (x > 127) {
+ PyErr_SetString(PyExc_OverflowError,
+ "signed char is greater than maximum");
+ return -1;
+ }
+ if (i >= 0)
+ ((char *)ap->ob_item)[i] = (char)x;
+ return 0;
+}
+
+static PyObject *
+BB_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ long x = ((unsigned char *)ap->ob_item)[i];
+ return PyLong_FromLong(x);
+}
+
+static int
+BB_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ unsigned char x;
+ /* 'B' == unsigned char, maps to PyArg_Parse's 'b' formatter */
+ if (!PyArg_Parse(v, "b;array item must be integer", &x))
+ return -1;
+ if (i >= 0)
+ ((char *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+static PyObject *
+u_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyUnicode_FromOrdinal(((wchar_t *) ap->ob_item)[i]);
+}
+
+static int
+u_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ PyObject *u;
+ if (!PyArg_Parse(v, "U;array item must be unicode character", &u)) {
+ return -1;
+ }
+
+ Py_ssize_t len = PyUnicode_AsWideChar(u, NULL, 0);
+ if (len != 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "array item must be unicode character");
+ return -1;
+ }
+
+ wchar_t w;
+ len = PyUnicode_AsWideChar(u, &w, 1);
+ assert(len == 1);
+
+ if (i >= 0) {
+ ((wchar_t *)ap->ob_item)[i] = w;
+ }
+ return 0;
+}
+
+
+static PyObject *
+h_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromLong((long) ((short *)ap->ob_item)[i]);
+}
+
+
+static int
+h_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ short x;
+ /* 'h' == signed short, maps to PyArg_Parse's 'h' formatter */
+ if (!PyArg_Parse(v, "h;array item must be integer", &x))
+ return -1;
+ if (i >= 0)
+ ((short *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+static PyObject *
+HH_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromLong((long) ((unsigned short *)ap->ob_item)[i]);
+}
+
+static int
+HH_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ int x;
+ /* PyArg_Parse's 'h' formatter is for a signed short, therefore
+ must use the next size up and manually do the overflow checking */
+ if (!PyArg_Parse(v, "i;array item must be integer", &x))
+ return -1;
+ else if (x < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "unsigned short is less than minimum");
+ return -1;
+ }
+ else if (x > USHRT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "unsigned short is greater than maximum");
+ return -1;
+ }
+ if (i >= 0)
+ ((short *)ap->ob_item)[i] = (short)x;
+ return 0;
+}
+
+static PyObject *
+i_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromLong((long) ((int *)ap->ob_item)[i]);
+}
+
+static int
+i_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ int x;
+ /* 'i' == signed int, maps to PyArg_Parse's 'i' formatter */
+ if (!PyArg_Parse(v, "i;array item must be integer", &x))
+ return -1;
+ if (i >= 0)
+ ((int *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+static PyObject *
+II_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromUnsignedLong(
+ (unsigned long) ((unsigned int *)ap->ob_item)[i]);
+}
+
+static int
+II_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ unsigned long x;
+ int do_decref = 0; /* if nb_int was called */
+
+ if (!PyLong_Check(v)) {
+ v = _PyNumber_Index(v);
+ if (NULL == v) {
+ return -1;
+ }
+ do_decref = 1;
+ }
+ x = PyLong_AsUnsignedLong(v);
+ if (x == (unsigned long)-1 && PyErr_Occurred()) {
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return -1;
+ }
+ if (x > UINT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "unsigned int is greater than maximum");
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return -1;
+ }
+ if (i >= 0)
+ ((unsigned int *)ap->ob_item)[i] = (unsigned int)x;
+
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return 0;
+}
+
+static PyObject *
+l_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromLong(((long *)ap->ob_item)[i]);
+}
+
+static int
+l_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ long x;
+ if (!PyArg_Parse(v, "l;array item must be integer", &x))
+ return -1;
+ if (i >= 0)
+ ((long *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+static PyObject *
+LL_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromUnsignedLong(((unsigned long *)ap->ob_item)[i]);
+}
+
+static int
+LL_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ unsigned long x;
+ int do_decref = 0; /* if nb_int was called */
+
+ if (!PyLong_Check(v)) {
+ v = _PyNumber_Index(v);
+ if (NULL == v) {
+ return -1;
+ }
+ do_decref = 1;
+ }
+ x = PyLong_AsUnsignedLong(v);
+ if (x == (unsigned long)-1 && PyErr_Occurred()) {
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return -1;
+ }
+ if (i >= 0)
+ ((unsigned long *)ap->ob_item)[i] = x;
+
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return 0;
+}
+
+static PyObject *
+q_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromLongLong(((long long *)ap->ob_item)[i]);
+}
+
+static int
+q_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ long long x;
+ if (!PyArg_Parse(v, "L;array item must be integer", &x))
+ return -1;
+ if (i >= 0)
+ ((long long *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+static PyObject *
+QQ_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyLong_FromUnsignedLongLong(
+ ((unsigned long long *)ap->ob_item)[i]);
+}
+
+static int
+QQ_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ unsigned long long x;
+ int do_decref = 0; /* if nb_int was called */
+
+ if (!PyLong_Check(v)) {
+ v = _PyNumber_Index(v);
+ if (NULL == v) {
+ return -1;
+ }
+ do_decref = 1;
+ }
+ x = PyLong_AsUnsignedLongLong(v);
+ if (x == (unsigned long long)-1 && PyErr_Occurred()) {
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return -1;
+ }
+ if (i >= 0)
+ ((unsigned long long *)ap->ob_item)[i] = x;
+
+ if (do_decref) {
+ Py_DECREF(v);
+ }
+ return 0;
+}
+
+static PyObject *
+f_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyFloat_FromDouble((double) ((float *)ap->ob_item)[i]);
+}
+
+static int
+f_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ float x;
+ if (!PyArg_Parse(v, "f;array item must be float", &x))
+ return -1;
+ if (i >= 0)
+ ((float *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+static PyObject *
+d_getitem(arrayobject *ap, Py_ssize_t i)
+{
+ return PyFloat_FromDouble(((double *)ap->ob_item)[i]);
+}
+
+static int
+d_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
+{
+ double x;
+ if (!PyArg_Parse(v, "d;array item must be float", &x))
+ return -1;
+ if (i >= 0)
+ ((double *)ap->ob_item)[i] = x;
+ return 0;
+}
+
+#define DEFINE_COMPAREITEMS(code, type) \
+ static int \
+ code##_compareitems(const void *lhs, const void *rhs, Py_ssize_t length) \
+ { \
+ const type *a = lhs, *b = rhs; \
+ for (Py_ssize_t i = 0; i < length; ++i) \
+ if (a[i] != b[i]) \
+ return a[i] < b[i] ? -1 : 1; \
+ return 0; \
+ }
+
+DEFINE_COMPAREITEMS(b, signed char)
+DEFINE_COMPAREITEMS(BB, unsigned char)
+DEFINE_COMPAREITEMS(u, wchar_t)
+DEFINE_COMPAREITEMS(h, short)
+DEFINE_COMPAREITEMS(HH, unsigned short)
+DEFINE_COMPAREITEMS(i, int)
+DEFINE_COMPAREITEMS(II, unsigned int)
+DEFINE_COMPAREITEMS(l, long)
+DEFINE_COMPAREITEMS(LL, unsigned long)
+DEFINE_COMPAREITEMS(q, long long)
+DEFINE_COMPAREITEMS(QQ, unsigned long long)
+
+/* Description of types.
+ *
+ * Don't forget to update typecode_to_mformat_code() if you add a new
+ * typecode.
+ */
+static const struct arraydescr descriptors[] = {
+ {'b', 1, b_getitem, b_setitem, b_compareitems, "b", 1, 1},
+ {'B', 1, BB_getitem, BB_setitem, BB_compareitems, "B", 1, 0},
+ {'u', sizeof(wchar_t), u_getitem, u_setitem, u_compareitems, "u", 0, 0},
+ {'h', sizeof(short), h_getitem, h_setitem, h_compareitems, "h", 1, 1},
+ {'H', sizeof(short), HH_getitem, HH_setitem, HH_compareitems, "H", 1, 0},
+ {'i', sizeof(int), i_getitem, i_setitem, i_compareitems, "i", 1, 1},
+ {'I', sizeof(int), II_getitem, II_setitem, II_compareitems, "I", 1, 0},
+ {'l', sizeof(long), l_getitem, l_setitem, l_compareitems, "l", 1, 1},
+ {'L', sizeof(long), LL_getitem, LL_setitem, LL_compareitems, "L", 1, 0},
+ {'q', sizeof(long long), q_getitem, q_setitem, q_compareitems, "q", 1, 1},
+ {'Q', sizeof(long long), QQ_getitem, QQ_setitem, QQ_compareitems, "Q", 1, 0},
+ {'f', sizeof(float), f_getitem, f_setitem, NULL, "f", 0, 0},
+ {'d', sizeof(double), d_getitem, d_setitem, NULL, "d", 0, 0},
+ {'\0', 0, 0, 0, 0, 0, 0} /* Sentinel */
+};
+
+/****************************************************************************
+Implementations of array object methods.
+****************************************************************************/
+/*[clinic input]
+class array.array "arrayobject *" "ArrayType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=a5c29edf59f176a3]*/
+
+static PyObject *
+newarrayobject(PyTypeObject *type, Py_ssize_t size, const struct arraydescr *descr)
+{
+ arrayobject *op;
+ size_t nbytes;
+
+ if (size < 0) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
+ /* Check for overflow */
+ if (size > PY_SSIZE_T_MAX / descr->itemsize) {
+ return PyErr_NoMemory();
+ }
+ nbytes = size * descr->itemsize;
+ op = (arrayobject *) type->tp_alloc(type, 0);
+ if (op == NULL) {
+ return NULL;
+ }
+ op->ob_descr = descr;
+ op->allocated = size;
+ op->weakreflist = NULL;
+ Py_SET_SIZE(op, size);
+ if (size <= 0) {
+ op->ob_item = NULL;
+ }
+ else {
+ op->ob_item = PyMem_NEW(char, nbytes);
+ if (op->ob_item == NULL) {
+ Py_DECREF(op);
+ return PyErr_NoMemory();
+ }
+ }
+ op->ob_exports = 0;
+ return (PyObject *) op;
+}
+
+static PyObject *
+getarrayitem(PyObject *op, Py_ssize_t i)
+{
+#ifndef NDEBUG
+ array_state *state = find_array_state_by_type(Py_TYPE(op));
+ assert(array_Check(op, state));
+#endif
+ arrayobject *ap;
+ ap = (arrayobject *)op;
+ assert(i>=0 && i<Py_SIZE(ap));
+ return (*ap->ob_descr->getitem)(ap, i);
+}
+
+static int
+ins1(arrayobject *self, Py_ssize_t where, PyObject *v)
+{
+ char *items;
+ Py_ssize_t n = Py_SIZE(self);
+ if (v == NULL) {
+ PyErr_BadInternalCall();
+ return -1;
+ }
+ if ((*self->ob_descr->setitem)(self, -1, v) < 0)
+ return -1;
+
+ if (array_resize(self, n+1) == -1)
+ return -1;
+ items = self->ob_item;
+ if (where < 0) {
+ where += n;
+ if (where < 0)
+ where = 0;
+ }
+ if (where > n)
+ where = n;
+ /* appends don't need to call memmove() */
+ if (where != n)
+ memmove(items + (where+1)*self->ob_descr->itemsize,
+ items + where*self->ob_descr->itemsize,
+ (n-where)*self->ob_descr->itemsize);
+ return (*self->ob_descr->setitem)(self, where, v);
+}
+
+/* Methods */
+
+static int
+array_tp_traverse(arrayobject *op, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(op));
+ return 0;
+}
+
+static void
+array_dealloc(arrayobject *op)
+{
+ PyTypeObject *tp = Py_TYPE(op);
+ PyObject_GC_UnTrack(op);
+
+ if (op->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) op);
+ if (op->ob_item != NULL)
+ PyMem_Free(op->ob_item);
+ tp->tp_free(op);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+array_richcompare(PyObject *v, PyObject *w, int op)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(v));
+ arrayobject *va, *wa;
+ PyObject *vi = NULL;
+ PyObject *wi = NULL;
+ Py_ssize_t i, k;
+ PyObject *res;
+
+ if (!array_Check(v, state) || !array_Check(w, state))
+ Py_RETURN_NOTIMPLEMENTED;
+
+ va = (arrayobject *)v;
+ wa = (arrayobject *)w;
+
+ if (Py_SIZE(va) != Py_SIZE(wa) && (op == Py_EQ || op == Py_NE)) {
+ /* Shortcut: if the lengths differ, the arrays differ */
+ if (op == Py_EQ)
+ res = Py_False;
+ else
+ res = Py_True;
+ return Py_NewRef(res);
+ }
+
+ if (va->ob_descr == wa->ob_descr && va->ob_descr->compareitems != NULL) {
+ /* Fast path:
+ arrays with same types can have their buffers compared directly */
+ Py_ssize_t common_length = Py_MIN(Py_SIZE(va), Py_SIZE(wa));
+ int result = va->ob_descr->compareitems(va->ob_item, wa->ob_item,
+ common_length);
+ if (result == 0)
+ goto compare_sizes;
+
+ int cmp;
+ switch (op) {
+ case Py_LT: cmp = result < 0; break;
+ case Py_LE: cmp = result <= 0; break;
+ case Py_EQ: cmp = result == 0; break;
+ case Py_NE: cmp = result != 0; break;
+ case Py_GT: cmp = result > 0; break;
+ case Py_GE: cmp = result >= 0; break;
+ default: return NULL; /* cannot happen */
+ }
+ PyObject *res = cmp ? Py_True : Py_False;
+ return Py_NewRef(res);
+ }
+
+
+ /* Search for the first index where items are different */
+ k = 1;
+ for (i = 0; i < Py_SIZE(va) && i < Py_SIZE(wa); i++) {
+ vi = getarrayitem(v, i);
+ if (vi == NULL) {
+ return NULL;
+ }
+ wi = getarrayitem(w, i);
+ if (wi == NULL) {
+ Py_DECREF(vi);
+ return NULL;
+ }
+ k = PyObject_RichCompareBool(vi, wi, Py_EQ);
+ if (k == 0)
+ break; /* Keeping vi and wi alive! */
+ Py_DECREF(vi);
+ Py_DECREF(wi);
+ if (k < 0)
+ return NULL;
+ }
+
+ if (k) {
+ /* No more items to compare -- compare sizes */
+ compare_sizes: ;
+ Py_ssize_t vs = Py_SIZE(va);
+ Py_ssize_t ws = Py_SIZE(wa);
+ int cmp;
+ switch (op) {
+ case Py_LT: cmp = vs < ws; break;
+ case Py_LE: cmp = vs <= ws; break;
+ /* If the lengths were not equal,
+ the earlier fast-path check would have caught that. */
+ case Py_EQ: assert(vs == ws); cmp = 1; break;
+ case Py_NE: assert(vs == ws); cmp = 0; break;
+ case Py_GT: cmp = vs > ws; break;
+ case Py_GE: cmp = vs >= ws; break;
+ default: return NULL; /* cannot happen */
+ }
+ if (cmp)
+ res = Py_True;
+ else
+ res = Py_False;
+ return Py_NewRef(res);
+ }
+
+ /* We have an item that differs. First, shortcuts for EQ/NE */
+ if (op == Py_EQ) {
+ res = Py_NewRef(Py_False);
+ }
+ else if (op == Py_NE) {
+ res = Py_NewRef(Py_True);
+ }
+ else {
+ /* Compare the final item again using the proper operator */
+ res = PyObject_RichCompare(vi, wi, op);
+ }
+ Py_DECREF(vi);
+ Py_DECREF(wi);
+ return res;
+}
+
+static Py_ssize_t
+array_length(arrayobject *a)
+{
+ return Py_SIZE(a);
+}
+
+static PyObject *
+array_item(arrayobject *a, Py_ssize_t i)
+{
+ if (i < 0 || i >= Py_SIZE(a)) {
+ PyErr_SetString(PyExc_IndexError, "array index out of range");
+ return NULL;
+ }
+ return getarrayitem((PyObject *)a, i);
+}
+
+static PyObject *
+array_slice(arrayobject *a, Py_ssize_t ilow, Py_ssize_t ihigh)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(a));
+ arrayobject *np;
+
+ if (ilow < 0)
+ ilow = 0;
+ else if (ilow > Py_SIZE(a))
+ ilow = Py_SIZE(a);
+ if (ihigh < 0)
+ ihigh = 0;
+ if (ihigh < ilow)
+ ihigh = ilow;
+ else if (ihigh > Py_SIZE(a))
+ ihigh = Py_SIZE(a);
+ np = (arrayobject *) newarrayobject(state->ArrayType, ihigh - ilow, a->ob_descr);
+ if (np == NULL)
+ return NULL;
+ if (ihigh > ilow) {
+ memcpy(np->ob_item, a->ob_item + ilow * a->ob_descr->itemsize,
+ (ihigh-ilow) * a->ob_descr->itemsize);
+ }
+ return (PyObject *)np;
+}
+
+
+/*[clinic input]
+array.array.__copy__
+
+Return a copy of the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array___copy___impl(arrayobject *self)
+/*[clinic end generated code: output=dec7c3f925d9619e input=ad1ee5b086965f09]*/
+{
+ return array_slice(self, 0, Py_SIZE(self));
+}
+
+/*[clinic input]
+array.array.__deepcopy__
+
+ unused: object
+ /
+
+Return a copy of the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array___deepcopy__(arrayobject *self, PyObject *unused)
+/*[clinic end generated code: output=1ec748d8e14a9faa input=2405ecb4933748c4]*/
+{
+ return array_array___copy___impl(self);
+}
+
+static PyObject *
+array_concat(arrayobject *a, PyObject *bb)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(a));
+ Py_ssize_t size;
+ arrayobject *np;
+ if (!array_Check(bb, state)) {
+ PyErr_Format(PyExc_TypeError,
+ "can only append array (not \"%.200s\") to array",
+ Py_TYPE(bb)->tp_name);
+ return NULL;
+ }
+#define b ((arrayobject *)bb)
+ if (a->ob_descr != b->ob_descr) {
+ PyErr_BadArgument();
+ return NULL;
+ }
+ if (Py_SIZE(a) > PY_SSIZE_T_MAX - Py_SIZE(b)) {
+ return PyErr_NoMemory();
+ }
+ size = Py_SIZE(a) + Py_SIZE(b);
+ np = (arrayobject *) newarrayobject(state->ArrayType, size, a->ob_descr);
+ if (np == NULL) {
+ return NULL;
+ }
+ if (Py_SIZE(a) > 0) {
+ memcpy(np->ob_item, a->ob_item, Py_SIZE(a)*a->ob_descr->itemsize);
+ }
+ if (Py_SIZE(b) > 0) {
+ memcpy(np->ob_item + Py_SIZE(a)*a->ob_descr->itemsize,
+ b->ob_item, Py_SIZE(b)*b->ob_descr->itemsize);
+ }
+ return (PyObject *)np;
+#undef b
+}
+
+static PyObject *
+array_repeat(arrayobject *a, Py_ssize_t n)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(a));
+
+ if (n < 0)
+ n = 0;
+ const Py_ssize_t array_length = Py_SIZE(a);
+ if ((array_length != 0) && (n > PY_SSIZE_T_MAX / array_length)) {
+ return PyErr_NoMemory();
+ }
+ Py_ssize_t size = array_length * n;
+ arrayobject* np = (arrayobject *) newarrayobject(state->ArrayType, size, a->ob_descr);
+ if (np == NULL)
+ return NULL;
+ if (size == 0)
+ return (PyObject *)np;
+
+ const Py_ssize_t oldbytes = array_length * a->ob_descr->itemsize;
+ const Py_ssize_t newbytes = oldbytes * n;
+ _PyBytes_Repeat(np->ob_item, newbytes, a->ob_item, oldbytes);
+
+ return (PyObject *)np;
+}
+
+static int
+array_del_slice(arrayobject *a, Py_ssize_t ilow, Py_ssize_t ihigh)
+{
+ char *item;
+ Py_ssize_t d; /* Change in size */
+ if (ilow < 0)
+ ilow = 0;
+ else if (ilow > Py_SIZE(a))
+ ilow = Py_SIZE(a);
+ if (ihigh < 0)
+ ihigh = 0;
+ if (ihigh < ilow)
+ ihigh = ilow;
+ else if (ihigh > Py_SIZE(a))
+ ihigh = Py_SIZE(a);
+ item = a->ob_item;
+ d = ihigh-ilow;
+ /* Issue #4509: If the array has exported buffers and the slice
+ assignment would change the size of the array, fail early to make
+ sure we don't modify it. */
+ if (d != 0 && a->ob_exports > 0) {
+ PyErr_SetString(PyExc_BufferError,
+ "cannot resize an array that is exporting buffers");
+ return -1;
+ }
+ if (d > 0) { /* Delete d items */
+ memmove(item + (ihigh-d)*a->ob_descr->itemsize,
+ item + ihigh*a->ob_descr->itemsize,
+ (Py_SIZE(a)-ihigh)*a->ob_descr->itemsize);
+ if (array_resize(a, Py_SIZE(a) - d) == -1)
+ return -1;
+ }
+ return 0;
+}
+
+static int
+array_ass_item(arrayobject *a, Py_ssize_t i, PyObject *v)
+{
+ if (i < 0 || i >= Py_SIZE(a)) {
+ PyErr_SetString(PyExc_IndexError,
+ "array assignment index out of range");
+ return -1;
+ }
+ if (v == NULL)
+ return array_del_slice(a, i, i+1);
+ return (*a->ob_descr->setitem)(a, i, v);
+}
+
+static int
+setarrayitem(PyObject *a, Py_ssize_t i, PyObject *v)
+{
+#ifndef NDEBUG
+ array_state *state = find_array_state_by_type(Py_TYPE(a));
+ assert(array_Check(a, state));
+#endif
+ return array_ass_item((arrayobject *)a, i, v);
+}
+
+static int
+array_iter_extend(arrayobject *self, PyObject *bb)
+{
+ PyObject *it, *v;
+
+ it = PyObject_GetIter(bb);
+ if (it == NULL)
+ return -1;
+
+ while ((v = PyIter_Next(it)) != NULL) {
+ if (ins1(self, Py_SIZE(self), v) != 0) {
+ Py_DECREF(v);
+ Py_DECREF(it);
+ return -1;
+ }
+ Py_DECREF(v);
+ }
+ Py_DECREF(it);
+ if (PyErr_Occurred())
+ return -1;
+ return 0;
+}
+
+static int
+array_do_extend(array_state *state, arrayobject *self, PyObject *bb)
+{
+ Py_ssize_t size, oldsize, bbsize;
+
+ if (!array_Check(bb, state))
+ return array_iter_extend(self, bb);
+#define b ((arrayobject *)bb)
+ if (self->ob_descr != b->ob_descr) {
+ PyErr_SetString(PyExc_TypeError,
+ "can only extend with array of same kind");
+ return -1;
+ }
+ if ((Py_SIZE(self) > PY_SSIZE_T_MAX - Py_SIZE(b)) ||
+ ((Py_SIZE(self) + Py_SIZE(b)) > PY_SSIZE_T_MAX / self->ob_descr->itemsize)) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ oldsize = Py_SIZE(self);
+ /* Get the size of bb before resizing the array since bb could be self. */
+ bbsize = Py_SIZE(bb);
+ size = oldsize + Py_SIZE(b);
+ if (array_resize(self, size) == -1)
+ return -1;
+ if (bbsize > 0) {
+ memcpy(self->ob_item + oldsize * self->ob_descr->itemsize,
+ b->ob_item, bbsize * b->ob_descr->itemsize);
+ }
+
+ return 0;
+#undef b
+}
+
+static PyObject *
+array_inplace_concat(arrayobject *self, PyObject *bb)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(self));
+
+ if (!array_Check(bb, state)) {
+ PyErr_Format(PyExc_TypeError,
+ "can only extend array with array (not \"%.200s\")",
+ Py_TYPE(bb)->tp_name);
+ return NULL;
+ }
+ if (array_do_extend(state, self, bb) == -1)
+ return NULL;
+ return Py_NewRef(self);
+}
+
+static PyObject *
+array_inplace_repeat(arrayobject *self, Py_ssize_t n)
+{
+ const Py_ssize_t array_size = Py_SIZE(self);
+
+ if (array_size > 0 && n != 1 ) {
+ if (n < 0)
+ n = 0;
+ if ((self->ob_descr->itemsize != 0) &&
+ (array_size > PY_SSIZE_T_MAX / self->ob_descr->itemsize)) {
+ return PyErr_NoMemory();
+ }
+ Py_ssize_t size = array_size * self->ob_descr->itemsize;
+ if (n > 0 && size > PY_SSIZE_T_MAX / n) {
+ return PyErr_NoMemory();
+ }
+ if (array_resize(self, n * array_size) == -1)
+ return NULL;
+
+ _PyBytes_Repeat(self->ob_item, n*size, self->ob_item, size);
+ }
+ return Py_NewRef(self);
+}
+
+
+static PyObject *
+ins(arrayobject *self, Py_ssize_t where, PyObject *v)
+{
+ if (ins1(self, where, v) != 0)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.count
+
+ v: object
+ /
+
+Return number of occurrences of v in the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_count(arrayobject *self, PyObject *v)
+/*[clinic end generated code: output=3dd3624bf7135a3a input=d9bce9d65e39d1f5]*/
+{
+ Py_ssize_t count = 0;
+ Py_ssize_t i;
+
+ for (i = 0; i < Py_SIZE(self); i++) {
+ PyObject *selfi;
+ int cmp;
+
+ selfi = getarrayitem((PyObject *)self, i);
+ if (selfi == NULL)
+ return NULL;
+ cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+ Py_DECREF(selfi);
+ if (cmp > 0)
+ count++;
+ else if (cmp < 0)
+ return NULL;
+ }
+ return PyLong_FromSsize_t(count);
+}
+
+
+/*[clinic input]
+array.array.index
+
+ v: object
+ start: slice_index(accept={int}) = 0
+ stop: slice_index(accept={int}, c_default="PY_SSIZE_T_MAX") = sys.maxsize
+ /
+
+Return index of first occurrence of v in the array.
+
+Raise ValueError if the value is not present.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_index_impl(arrayobject *self, PyObject *v, Py_ssize_t start,
+ Py_ssize_t stop)
+/*[clinic end generated code: output=c45e777880c99f52 input=089dff7baa7e5a7e]*/
+{
+ if (start < 0) {
+ start += Py_SIZE(self);
+ if (start < 0) {
+ start = 0;
+ }
+ }
+ if (stop < 0) {
+ stop += Py_SIZE(self);
+ }
+ // Use Py_SIZE() for every iteration in case the array is mutated
+ // during PyObject_RichCompareBool()
+ for (Py_ssize_t i = start; i < stop && i < Py_SIZE(self); i++) {
+ PyObject *selfi;
+ int cmp;
+
+ selfi = getarrayitem((PyObject *)self, i);
+ if (selfi == NULL)
+ return NULL;
+ cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+ Py_DECREF(selfi);
+ if (cmp > 0) {
+ return PyLong_FromSsize_t(i);
+ }
+ else if (cmp < 0)
+ return NULL;
+ }
+ PyErr_SetString(PyExc_ValueError, "array.index(x): x not in array");
+ return NULL;
+}
+
+static int
+array_contains(arrayobject *self, PyObject *v)
+{
+ Py_ssize_t i;
+ int cmp;
+
+ for (i = 0, cmp = 0 ; cmp == 0 && i < Py_SIZE(self); i++) {
+ PyObject *selfi = getarrayitem((PyObject *)self, i);
+ if (selfi == NULL)
+ return -1;
+ cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+ Py_DECREF(selfi);
+ }
+ return cmp;
+}
+
+/*[clinic input]
+array.array.remove
+
+ v: object
+ /
+
+Remove the first occurrence of v in the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_remove(arrayobject *self, PyObject *v)
+/*[clinic end generated code: output=bef06be9fdf9dceb input=0b1e5aed25590027]*/
+{
+ Py_ssize_t i;
+
+ for (i = 0; i < Py_SIZE(self); i++) {
+ PyObject *selfi;
+ int cmp;
+
+ selfi = getarrayitem((PyObject *)self,i);
+ if (selfi == NULL)
+ return NULL;
+ cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
+ Py_DECREF(selfi);
+ if (cmp > 0) {
+ if (array_del_slice(self, i, i+1) != 0)
+ return NULL;
+ Py_RETURN_NONE;
+ }
+ else if (cmp < 0)
+ return NULL;
+ }
+ PyErr_SetString(PyExc_ValueError, "array.remove(x): x not in array");
+ return NULL;
+}
+
+/*[clinic input]
+array.array.pop
+
+ i: Py_ssize_t = -1
+ /
+
+Return the i-th element and delete it from the array.
+
+i defaults to -1.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_pop_impl(arrayobject *self, Py_ssize_t i)
+/*[clinic end generated code: output=bc1f0c54fe5308e4 input=8e5feb4c1a11cd44]*/
+{
+ PyObject *v;
+
+ if (Py_SIZE(self) == 0) {
+ /* Special-case most common failure cause */
+ PyErr_SetString(PyExc_IndexError, "pop from empty array");
+ return NULL;
+ }
+ if (i < 0)
+ i += Py_SIZE(self);
+ if (i < 0 || i >= Py_SIZE(self)) {
+ PyErr_SetString(PyExc_IndexError, "pop index out of range");
+ return NULL;
+ }
+ v = getarrayitem((PyObject *)self, i);
+ if (v == NULL)
+ return NULL;
+ if (array_del_slice(self, i, i+1) != 0) {
+ Py_DECREF(v);
+ return NULL;
+ }
+ return v;
+}
+
+/*[clinic input]
+array.array.extend
+
+ cls: defining_class
+ bb: object
+ /
+
+Append items to the end of the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_extend_impl(arrayobject *self, PyTypeObject *cls, PyObject *bb)
+/*[clinic end generated code: output=e65eb7588f0bc266 input=8eb6817ec4d2cb62]*/
+{
+ array_state *state = get_array_state_by_class(cls);
+
+ if (array_do_extend(state, self, bb) == -1)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.insert
+
+ i: Py_ssize_t
+ v: object
+ /
+
+Insert a new item v into the array before position i.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v)
+/*[clinic end generated code: output=5a3648e278348564 input=5577d1b4383e9313]*/
+{
+ return ins(self, i, v);
+}
+
+/*[clinic input]
+array.array.buffer_info
+
+Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array's contents.
+
+The length should be multiplied by the itemsize attribute to calculate
+the buffer length in bytes.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_buffer_info_impl(arrayobject *self)
+/*[clinic end generated code: output=9b2a4ec3ae7e98e7 input=a58bae5c6e1ac6a6]*/
+{
+ PyObject *retval = NULL, *v;
+
+ retval = PyTuple_New(2);
+ if (!retval)
+ return NULL;
+
+ v = PyLong_FromVoidPtr(self->ob_item);
+ if (v == NULL) {
+ Py_DECREF(retval);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(retval, 0, v);
+
+ v = PyLong_FromSsize_t(Py_SIZE(self));
+ if (v == NULL) {
+ Py_DECREF(retval);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(retval, 1, v);
+
+ return retval;
+}
+
+/*[clinic input]
+array.array.append
+
+ v: object
+ /
+
+Append new value v to the end of the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_append(arrayobject *self, PyObject *v)
+/*[clinic end generated code: output=745a0669bf8db0e2 input=0b98d9d78e78f0fa]*/
+{
+ return ins(self, Py_SIZE(self), v);
+}
+
+/*[clinic input]
+array.array.byteswap
+
+Byteswap all items of the array.
+
+If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is
+raised.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_byteswap_impl(arrayobject *self)
+/*[clinic end generated code: output=5f8236cbdf0d90b5 input=6a85591b950a0186]*/
+{
+ char *p;
+ Py_ssize_t i;
+
+ switch (self->ob_descr->itemsize) {
+ case 1:
+ break;
+ case 2:
+ for (p = self->ob_item, i = Py_SIZE(self); --i >= 0; p += 2) {
+ char p0 = p[0];
+ p[0] = p[1];
+ p[1] = p0;
+ }
+ break;
+ case 4:
+ for (p = self->ob_item, i = Py_SIZE(self); --i >= 0; p += 4) {
+ char p0 = p[0];
+ char p1 = p[1];
+ p[0] = p[3];
+ p[1] = p[2];
+ p[2] = p1;
+ p[3] = p0;
+ }
+ break;
+ case 8:
+ for (p = self->ob_item, i = Py_SIZE(self); --i >= 0; p += 8) {
+ char p0 = p[0];
+ char p1 = p[1];
+ char p2 = p[2];
+ char p3 = p[3];
+ p[0] = p[7];
+ p[1] = p[6];
+ p[2] = p[5];
+ p[3] = p[4];
+ p[4] = p3;
+ p[5] = p2;
+ p[6] = p1;
+ p[7] = p0;
+ }
+ break;
+ default:
+ PyErr_SetString(PyExc_RuntimeError,
+ "don't know how to byteswap this array type");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.reverse
+
+Reverse the order of the items in the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_reverse_impl(arrayobject *self)
+/*[clinic end generated code: output=c04868b36f6f4089 input=cd904f01b27d966a]*/
+{
+ Py_ssize_t itemsize = self->ob_descr->itemsize;
+ char *p, *q;
+ /* little buffer to hold items while swapping */
+ char tmp[256]; /* 8 is probably enough -- but why skimp */
+ assert((size_t)itemsize <= sizeof(tmp));
+
+ if (Py_SIZE(self) > 1) {
+ for (p = self->ob_item,
+ q = self->ob_item + (Py_SIZE(self) - 1)*itemsize;
+ p < q;
+ p += itemsize, q -= itemsize) {
+ /* memory areas guaranteed disjoint, so memcpy
+ * is safe (& memmove may be slower).
+ */
+ memcpy(tmp, p, itemsize);
+ memcpy(p, q, itemsize);
+ memcpy(q, tmp, itemsize);
+ }
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.fromfile
+
+ cls: defining_class
+ f: object
+ n: Py_ssize_t
+ /
+
+Read n objects from the file object f and append them to the end of the array.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_fromfile_impl(arrayobject *self, PyTypeObject *cls, PyObject *f,
+ Py_ssize_t n)
+/*[clinic end generated code: output=83a667080b345ebc input=3822e907c1c11f1a]*/
+{
+ PyObject *b, *res;
+ Py_ssize_t itemsize = self->ob_descr->itemsize;
+ Py_ssize_t nbytes;
+ int not_enough_bytes;
+
+ if (n < 0) {
+ PyErr_SetString(PyExc_ValueError, "negative count");
+ return NULL;
+ }
+ if (n > PY_SSIZE_T_MAX / itemsize) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+
+ array_state *state = get_array_state_by_class(cls);
+ assert(state != NULL);
+
+ nbytes = n * itemsize;
+
+ b = _PyObject_CallMethod(f, state->str_read, "n", nbytes);
+ if (b == NULL)
+ return NULL;
+
+ if (!PyBytes_Check(b)) {
+ PyErr_SetString(PyExc_TypeError,
+ "read() didn't return bytes");
+ Py_DECREF(b);
+ return NULL;
+ }
+
+ not_enough_bytes = (PyBytes_GET_SIZE(b) != nbytes);
+
+ res = array_array_frombytes(self, b);
+ Py_DECREF(b);
+ if (res == NULL)
+ return NULL;
+
+ if (not_enough_bytes) {
+ PyErr_SetString(PyExc_EOFError,
+ "read() didn't return enough bytes");
+ Py_DECREF(res);
+ return NULL;
+ }
+
+ return res;
+}
+
+/*[clinic input]
+array.array.tofile
+
+ cls: defining_class
+ f: object
+ /
+
+Write all items (as machine values) to the file object f.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_tofile_impl(arrayobject *self, PyTypeObject *cls, PyObject *f)
+/*[clinic end generated code: output=4560c628d9c18bc2 input=5a24da7a7b407b52]*/
+{
+ Py_ssize_t nbytes = Py_SIZE(self) * self->ob_descr->itemsize;
+ /* Write 64K blocks at a time */
+ /* XXX Make the block size settable */
+ int BLOCKSIZE = 64*1024;
+ Py_ssize_t nblocks = (nbytes + BLOCKSIZE - 1) / BLOCKSIZE;
+ Py_ssize_t i;
+
+ if (Py_SIZE(self) == 0)
+ goto done;
+
+
+ array_state *state = get_array_state_by_class(cls);
+ assert(state != NULL);
+
+ for (i = 0; i < nblocks; i++) {
+ char* ptr = self->ob_item + i*BLOCKSIZE;
+ Py_ssize_t size = BLOCKSIZE;
+ PyObject *bytes, *res;
+
+ if (i*BLOCKSIZE + size > nbytes)
+ size = nbytes - i*BLOCKSIZE;
+ bytes = PyBytes_FromStringAndSize(ptr, size);
+ if (bytes == NULL)
+ return NULL;
+ res = PyObject_CallMethodOneArg(f, state->str_write, bytes);
+ Py_DECREF(bytes);
+ if (res == NULL)
+ return NULL;
+ Py_DECREF(res); /* drop write result */
+ }
+
+ done:
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.fromlist
+
+ list: object
+ /
+
+Append items to array from list.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_fromlist(arrayobject *self, PyObject *list)
+/*[clinic end generated code: output=26411c2d228a3e3f input=be2605a96c49680f]*/
+{
+ Py_ssize_t n;
+
+ if (!PyList_Check(list)) {
+ PyErr_SetString(PyExc_TypeError, "arg must be list");
+ return NULL;
+ }
+ n = PyList_Size(list);
+ if (n > 0) {
+ Py_ssize_t i, old_size;
+ old_size = Py_SIZE(self);
+ if (array_resize(self, old_size + n) == -1)
+ return NULL;
+ for (i = 0; i < n; i++) {
+ PyObject *v = PyList_GET_ITEM(list, i);
+ if ((*self->ob_descr->setitem)(self,
+ Py_SIZE(self) - n + i, v) != 0) {
+ array_resize(self, old_size);
+ return NULL;
+ }
+ if (n != PyList_GET_SIZE(list)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "list changed size during iteration");
+ array_resize(self, old_size);
+ return NULL;
+ }
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.tolist
+
+Convert array to an ordinary list with the same items.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_tolist_impl(arrayobject *self)
+/*[clinic end generated code: output=00b60cc9eab8ef89 input=a8d7784a94f86b53]*/
+{
+ PyObject *list = PyList_New(Py_SIZE(self));
+ Py_ssize_t i;
+
+ if (list == NULL)
+ return NULL;
+ for (i = 0; i < Py_SIZE(self); i++) {
+ PyObject *v = getarrayitem((PyObject *)self, i);
+ if (v == NULL)
+ goto error;
+ PyList_SET_ITEM(list, i, v);
+ }
+ return list;
+
+error:
+ Py_DECREF(list);
+ return NULL;
+}
+
+static PyObject *
+frombytes(arrayobject *self, Py_buffer *buffer)
+{
+ int itemsize = self->ob_descr->itemsize;
+ Py_ssize_t n;
+ if (buffer->itemsize != 1) {
+ PyBuffer_Release(buffer);
+ PyErr_SetString(PyExc_TypeError, "a bytes-like object is required");
+ return NULL;
+ }
+ n = buffer->len;
+ if (n % itemsize != 0) {
+ PyBuffer_Release(buffer);
+ PyErr_SetString(PyExc_ValueError,
+ "bytes length not a multiple of item size");
+ return NULL;
+ }
+ n = n / itemsize;
+ if (n > 0) {
+ Py_ssize_t old_size = Py_SIZE(self);
+ if ((n > PY_SSIZE_T_MAX - old_size) ||
+ ((old_size + n) > PY_SSIZE_T_MAX / itemsize)) {
+ PyBuffer_Release(buffer);
+ return PyErr_NoMemory();
+ }
+ if (array_resize(self, old_size + n) == -1) {
+ PyBuffer_Release(buffer);
+ return NULL;
+ }
+ memcpy(self->ob_item + old_size * itemsize,
+ buffer->buf, n * itemsize);
+ }
+ PyBuffer_Release(buffer);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.frombytes
+
+ buffer: Py_buffer
+ /
+
+Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer)
+/*[clinic end generated code: output=d9842c8f7510a516 input=378db226dfac949e]*/
+{
+ return frombytes(self, buffer);
+}
+
+/*[clinic input]
+array.array.tobytes
+
+Convert the array to an array of machine values and return the bytes representation.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_tobytes_impl(arrayobject *self)
+/*[clinic end generated code: output=87318e4edcdc2bb6 input=90ee495f96de34f5]*/
+{
+ if (Py_SIZE(self) <= PY_SSIZE_T_MAX / self->ob_descr->itemsize) {
+ return PyBytes_FromStringAndSize(self->ob_item,
+ Py_SIZE(self) * self->ob_descr->itemsize);
+ } else {
+ return PyErr_NoMemory();
+ }
+}
+
+/*[clinic input]
+array.array.fromunicode
+
+ ustr: unicode
+ /
+
+Extends this array with data from the unicode string ustr.
+
+The array must be a unicode type array; otherwise a ValueError is raised.
+Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of
+some other type.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_fromunicode_impl(arrayobject *self, PyObject *ustr)
+/*[clinic end generated code: output=24359f5e001a7f2b input=025db1fdade7a4ce]*/
+{
+ if (self->ob_descr->typecode != 'u') {
+ PyErr_SetString(PyExc_ValueError,
+ "fromunicode() may only be called on "
+ "unicode type arrays");
+ return NULL;
+ }
+
+ Py_ssize_t ustr_length = PyUnicode_AsWideChar(ustr, NULL, 0);
+ assert(ustr_length > 0);
+ if (ustr_length > 1) {
+ ustr_length--; /* trim trailing NUL character */
+ Py_ssize_t old_size = Py_SIZE(self);
+ if (array_resize(self, old_size + ustr_length) == -1) {
+ return NULL;
+ }
+
+ // must not fail
+ PyUnicode_AsWideChar(
+ ustr, ((wchar_t *)self->ob_item) + old_size, ustr_length);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+array.array.tounicode
+
+Extends this array with data from the unicode string ustr.
+
+Convert the array to a unicode string. The array must be a unicode type array;
+otherwise a ValueError is raised. Use array.tobytes().decode() to obtain a
+unicode string from an array of some other type.
+[clinic start generated code]*/
+
+static PyObject *
+array_array_tounicode_impl(arrayobject *self)
+/*[clinic end generated code: output=08e442378336e1ef input=127242eebe70b66d]*/
+{
+ if (self->ob_descr->typecode != 'u') {
+ PyErr_SetString(PyExc_ValueError,
+ "tounicode() may only be called on unicode type arrays");
+ return NULL;
+ }
+ return PyUnicode_FromWideChar((wchar_t *) self->ob_item, Py_SIZE(self));
+}
+
+/*[clinic input]
+array.array.__sizeof__
+
+Size of the array in memory, in bytes.
+[clinic start generated code]*/
+
+static PyObject *
+array_array___sizeof___impl(arrayobject *self)
+/*[clinic end generated code: output=d8e1c61ebbe3eaed input=805586565bf2b3c6]*/
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ res += (size_t)self->allocated * (size_t)self->ob_descr->itemsize;
+ return PyLong_FromSize_t(res);
+}
+
+
+/*********************** Pickling support ************************/
+
+static const struct mformatdescr {
+ size_t size;
+ int is_signed;
+ int is_big_endian;
+} mformat_descriptors[] = {
+ {1, 0, 0}, /* 0: UNSIGNED_INT8 */
+ {1, 1, 0}, /* 1: SIGNED_INT8 */
+ {2, 0, 0}, /* 2: UNSIGNED_INT16_LE */
+ {2, 0, 1}, /* 3: UNSIGNED_INT16_BE */
+ {2, 1, 0}, /* 4: SIGNED_INT16_LE */
+ {2, 1, 1}, /* 5: SIGNED_INT16_BE */
+ {4, 0, 0}, /* 6: UNSIGNED_INT32_LE */
+ {4, 0, 1}, /* 7: UNSIGNED_INT32_BE */
+ {4, 1, 0}, /* 8: SIGNED_INT32_LE */
+ {4, 1, 1}, /* 9: SIGNED_INT32_BE */
+ {8, 0, 0}, /* 10: UNSIGNED_INT64_LE */
+ {8, 0, 1}, /* 11: UNSIGNED_INT64_BE */
+ {8, 1, 0}, /* 12: SIGNED_INT64_LE */
+ {8, 1, 1}, /* 13: SIGNED_INT64_BE */
+ {4, 0, 0}, /* 14: IEEE_754_FLOAT_LE */
+ {4, 0, 1}, /* 15: IEEE_754_FLOAT_BE */
+ {8, 0, 0}, /* 16: IEEE_754_DOUBLE_LE */
+ {8, 0, 1}, /* 17: IEEE_754_DOUBLE_BE */
+ {4, 0, 0}, /* 18: UTF16_LE */
+ {4, 0, 1}, /* 19: UTF16_BE */
+ {8, 0, 0}, /* 20: UTF32_LE */
+ {8, 0, 1} /* 21: UTF32_BE */
+};
+
+
+/*
+ * Internal: This function is used to find the machine format of a given
+ * array type code. This returns UNKNOWN_FORMAT when the machine format cannot
+ * be found.
+ */
+static enum machine_format_code
+typecode_to_mformat_code(char typecode)
+{
+ const int is_big_endian = PY_BIG_ENDIAN;
+
+ size_t intsize;
+ int is_signed;
+
+ switch (typecode) {
+ case 'b':
+ return SIGNED_INT8;
+ case 'B':
+ return UNSIGNED_INT8;
+
+ case 'u':
+ if (sizeof(Py_UNICODE) == 2) {
+ return UTF16_LE + is_big_endian;
+ }
+ if (sizeof(Py_UNICODE) == 4) {
+ return UTF32_LE + is_big_endian;
+ }
+ return UNKNOWN_FORMAT;
+
+ case 'f':
+ if (sizeof(float) == 4) {
+ const float y = 16711938.0;
+ if (memcmp(&y, "\x4b\x7f\x01\x02", 4) == 0)
+ return IEEE_754_FLOAT_BE;
+ if (memcmp(&y, "\x02\x01\x7f\x4b", 4) == 0)
+ return IEEE_754_FLOAT_LE;
+ }
+ return UNKNOWN_FORMAT;
+
+ case 'd':
+ if (sizeof(double) == 8) {
+ const double x = 9006104071832581.0;
+ if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0)
+ return IEEE_754_DOUBLE_BE;
+ if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0)
+ return IEEE_754_DOUBLE_LE;
+ }
+ return UNKNOWN_FORMAT;
+
+ /* Integers */
+ case 'h':
+ intsize = sizeof(short);
+ is_signed = 1;
+ break;
+ case 'H':
+ intsize = sizeof(short);
+ is_signed = 0;
+ break;
+ case 'i':
+ intsize = sizeof(int);
+ is_signed = 1;
+ break;
+ case 'I':
+ intsize = sizeof(int);
+ is_signed = 0;
+ break;
+ case 'l':
+ intsize = sizeof(long);
+ is_signed = 1;
+ break;
+ case 'L':
+ intsize = sizeof(long);
+ is_signed = 0;
+ break;
+ case 'q':
+ intsize = sizeof(long long);
+ is_signed = 1;
+ break;
+ case 'Q':
+ intsize = sizeof(long long);
+ is_signed = 0;
+ break;
+ default:
+ return UNKNOWN_FORMAT;
+ }
+ switch (intsize) {
+ case 2:
+ return UNSIGNED_INT16_LE + is_big_endian + (2 * is_signed);
+ case 4:
+ return UNSIGNED_INT32_LE + is_big_endian + (2 * is_signed);
+ case 8:
+ return UNSIGNED_INT64_LE + is_big_endian + (2 * is_signed);
+ default:
+ return UNKNOWN_FORMAT;
+ }
+}
+
+/* Forward declaration. */
+static PyObject *array_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
+
+/*
+ * Internal: This function wraps the array constructor--i.e., array_new()--to
+ * allow the creation of array objects from C code without having to deal
+ * directly the tuple argument of array_new(). The typecode argument is a
+ * Unicode character value, like 'i' or 'f' for example, representing an array
+ * type code. The items argument is a bytes or a list object from which
+ * contains the initial value of the array.
+ *
+ * On success, this functions returns the array object created. Otherwise,
+ * NULL is returned to indicate a failure.
+ */
+static PyObject *
+make_array(PyTypeObject *arraytype, char typecode, PyObject *items)
+{
+ PyObject *new_args;
+ PyObject *array_obj;
+ PyObject *typecode_obj;
+
+ assert(arraytype != NULL);
+ assert(items != NULL);
+
+ typecode_obj = PyUnicode_FromOrdinal(typecode);
+ if (typecode_obj == NULL)
+ return NULL;
+
+ new_args = PyTuple_New(2);
+ if (new_args == NULL) {
+ Py_DECREF(typecode_obj);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(new_args, 0, typecode_obj);
+ PyTuple_SET_ITEM(new_args, 1, Py_NewRef(items));
+
+ array_obj = array_new(arraytype, new_args, NULL);
+ Py_DECREF(new_args);
+ if (array_obj == NULL)
+ return NULL;
+
+ return array_obj;
+}
+
+/*
+ * This functions is a special constructor used when unpickling an array. It
+ * provides a portable way to rebuild an array from its memory representation.
+ */
+/*[clinic input]
+array._array_reconstructor
+
+ arraytype: object(type="PyTypeObject *")
+ typecode: int(accept={str})
+ mformat_code: int(type="enum machine_format_code")
+ items: object
+ /
+
+Internal. Used for pickling support.
+[clinic start generated code]*/
+
+static PyObject *
+array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
+ int typecode,
+ enum machine_format_code mformat_code,
+ PyObject *items)
+/*[clinic end generated code: output=e05263141ba28365 input=2464dc8f4c7736b5]*/
+{
+ array_state *state = get_array_state(module);
+ PyObject *converted_items;
+ PyObject *result;
+ const struct arraydescr *descr;
+
+ if (!PyType_Check(arraytype)) {
+ PyErr_Format(PyExc_TypeError,
+ "first argument must be a type object, not %.200s",
+ Py_TYPE(arraytype)->tp_name);
+ return NULL;
+ }
+ if (!PyType_IsSubtype(arraytype, state->ArrayType)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s is not a subtype of %.200s",
+ arraytype->tp_name, state->ArrayType->tp_name);
+ return NULL;
+ }
+ for (descr = descriptors; descr->typecode != '\0'; descr++) {
+ if ((int)descr->typecode == typecode)
+ break;
+ }
+ if (descr->typecode == '\0') {
+ PyErr_SetString(PyExc_ValueError,
+ "second argument must be a valid type code");
+ return NULL;
+ }
+ if (mformat_code < MACHINE_FORMAT_CODE_MIN ||
+ mformat_code > MACHINE_FORMAT_CODE_MAX) {
+ PyErr_SetString(PyExc_ValueError,
+ "third argument must be a valid machine format code.");
+ return NULL;
+ }
+ if (!PyBytes_Check(items)) {
+ PyErr_Format(PyExc_TypeError,
+ "fourth argument should be bytes, not %.200s",
+ Py_TYPE(items)->tp_name);
+ return NULL;
+ }
+
+ /* Fast path: No decoding has to be done. */
+ if (mformat_code == typecode_to_mformat_code((char)typecode) ||
+ mformat_code == UNKNOWN_FORMAT) {
+ return make_array(arraytype, (char)typecode, items);
+ }
+
+ /* Slow path: Decode the byte string according to the given machine
+ * format code. This occurs when the computer unpickling the array
+ * object is architecturally different from the one that pickled the
+ * array.
+ */
+ if (Py_SIZE(items) % mformat_descriptors[mformat_code].size != 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "string length not a multiple of item size");
+ return NULL;
+ }
+ switch (mformat_code) {
+ case IEEE_754_FLOAT_LE:
+ case IEEE_754_FLOAT_BE: {
+ Py_ssize_t i;
+ int le = (mformat_code == IEEE_754_FLOAT_LE) ? 1 : 0;
+ Py_ssize_t itemcount = Py_SIZE(items) / 4;
+ const char *memstr = PyBytes_AS_STRING(items);
+
+ converted_items = PyList_New(itemcount);
+ if (converted_items == NULL)
+ return NULL;
+ for (i = 0; i < itemcount; i++) {
+ PyObject *pyfloat = PyFloat_FromDouble(
+ PyFloat_Unpack4(&memstr[i * 4], le));
+ if (pyfloat == NULL) {
+ Py_DECREF(converted_items);
+ return NULL;
+ }
+ PyList_SET_ITEM(converted_items, i, pyfloat);
+ }
+ break;
+ }
+ case IEEE_754_DOUBLE_LE:
+ case IEEE_754_DOUBLE_BE: {
+ Py_ssize_t i;
+ int le = (mformat_code == IEEE_754_DOUBLE_LE) ? 1 : 0;
+ Py_ssize_t itemcount = Py_SIZE(items) / 8;
+ const char *memstr = PyBytes_AS_STRING(items);
+
+ converted_items = PyList_New(itemcount);
+ if (converted_items == NULL)
+ return NULL;
+ for (i = 0; i < itemcount; i++) {
+ PyObject *pyfloat = PyFloat_FromDouble(
+ PyFloat_Unpack8(&memstr[i * 8], le));
+ if (pyfloat == NULL) {
+ Py_DECREF(converted_items);
+ return NULL;
+ }
+ PyList_SET_ITEM(converted_items, i, pyfloat);
+ }
+ break;
+ }
+ case UTF16_LE:
+ case UTF16_BE: {
+ int byteorder = (mformat_code == UTF16_LE) ? -1 : 1;
+ converted_items = PyUnicode_DecodeUTF16(
+ PyBytes_AS_STRING(items), Py_SIZE(items),
+ "strict", &byteorder);
+ if (converted_items == NULL)
+ return NULL;
+ break;
+ }
+ case UTF32_LE:
+ case UTF32_BE: {
+ int byteorder = (mformat_code == UTF32_LE) ? -1 : 1;
+ converted_items = PyUnicode_DecodeUTF32(
+ PyBytes_AS_STRING(items), Py_SIZE(items),
+ "strict", &byteorder);
+ if (converted_items == NULL)
+ return NULL;
+ break;
+ }
+
+ case UNSIGNED_INT8:
+ case SIGNED_INT8:
+ case UNSIGNED_INT16_LE:
+ case UNSIGNED_INT16_BE:
+ case SIGNED_INT16_LE:
+ case SIGNED_INT16_BE:
+ case UNSIGNED_INT32_LE:
+ case UNSIGNED_INT32_BE:
+ case SIGNED_INT32_LE:
+ case SIGNED_INT32_BE:
+ case UNSIGNED_INT64_LE:
+ case UNSIGNED_INT64_BE:
+ case SIGNED_INT64_LE:
+ case SIGNED_INT64_BE: {
+ Py_ssize_t i;
+ const struct mformatdescr mf_descr =
+ mformat_descriptors[mformat_code];
+ Py_ssize_t itemcount = Py_SIZE(items) / mf_descr.size;
+ const unsigned char *memstr =
+ (unsigned char *)PyBytes_AS_STRING(items);
+ const struct arraydescr *descr;
+
+ /* If possible, try to pack array's items using a data type
+ * that fits better. This may result in an array with narrower
+ * or wider elements.
+ *
+ * For example, if a 32-bit machine pickles an L-code array of
+ * unsigned longs, then the array will be unpickled by 64-bit
+ * machine as an I-code array of unsigned ints.
+ *
+ * XXX: Is it possible to write a unit test for this?
+ */
+ for (descr = descriptors; descr->typecode != '\0'; descr++) {
+ if (descr->is_integer_type &&
+ (size_t)descr->itemsize == mf_descr.size &&
+ descr->is_signed == mf_descr.is_signed)
+ typecode = descr->typecode;
+ }
+
+ converted_items = PyList_New(itemcount);
+ if (converted_items == NULL)
+ return NULL;
+ for (i = 0; i < itemcount; i++) {
+ PyObject *pylong;
+
+ pylong = _PyLong_FromByteArray(
+ &memstr[i * mf_descr.size],
+ mf_descr.size,
+ !mf_descr.is_big_endian,
+ mf_descr.is_signed);
+ if (pylong == NULL) {
+ Py_DECREF(converted_items);
+ return NULL;
+ }
+ PyList_SET_ITEM(converted_items, i, pylong);
+ }
+ break;
+ }
+ case UNKNOWN_FORMAT:
+ /* Impossible, but needed to shut up GCC about the unhandled
+ * enumeration value.
+ */
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+
+ result = make_array(arraytype, (char)typecode, converted_items);
+ Py_DECREF(converted_items);
+ return result;
+}
+
+/*[clinic input]
+array.array.__reduce_ex__
+
+ cls: defining_class
+ value: object
+ /
+
+Return state information for pickling.
+[clinic start generated code]*/
+
+static PyObject *
+array_array___reduce_ex___impl(arrayobject *self, PyTypeObject *cls,
+ PyObject *value)
+/*[clinic end generated code: output=4958ee5d79452ad5 input=19968cf0f91d3eea]*/
+{
+ PyObject *dict;
+ PyObject *result;
+ PyObject *array_str;
+ int typecode = self->ob_descr->typecode;
+ int mformat_code;
+ long protocol;
+
+ array_state *state = get_array_state_by_class(cls);
+ assert(state != NULL);
+
+ if (state->array_reconstructor == NULL) {
+ state->array_reconstructor = _PyImport_GetModuleAttrString(
+ "array", "_array_reconstructor");
+ if (state->array_reconstructor == NULL) {
+ return NULL;
+ }
+ }
+
+ if (!PyLong_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "__reduce_ex__ argument should be an integer");
+ return NULL;
+ }
+ protocol = PyLong_AsLong(value);
+ if (protocol == -1 && PyErr_Occurred())
+ return NULL;
+
+ if (_PyObject_LookupAttr((PyObject *)self, state->str___dict__, &dict) < 0) {
+ return NULL;
+ }
+ if (dict == NULL) {
+ dict = Py_NewRef(Py_None);
+ }
+
+ mformat_code = typecode_to_mformat_code(typecode);
+ if (mformat_code == UNKNOWN_FORMAT || protocol < 3) {
+ /* Convert the array to a list if we got something weird
+ * (e.g., non-IEEE floats), or we are pickling the array using
+ * a Python 2.x compatible protocol.
+ *
+ * It is necessary to use a list representation for Python 2.x
+ * compatible pickle protocol, since Python 2's str objects
+ * are unpickled as unicode by Python 3. Thus it is impossible
+ * to make arrays unpicklable by Python 3 by using their memory
+ * representation, unless we resort to ugly hacks such as
+ * coercing unicode objects to bytes in array_reconstructor.
+ */
+ PyObject *list;
+ list = array_array_tolist_impl(self);
+ if (list == NULL) {
+ Py_DECREF(dict);
+ return NULL;
+ }
+ result = Py_BuildValue(
+ "O(CO)O", Py_TYPE(self), typecode, list, dict);
+ Py_DECREF(list);
+ Py_DECREF(dict);
+ return result;
+ }
+
+ array_str = array_array_tobytes_impl(self);
+ if (array_str == NULL) {
+ Py_DECREF(dict);
+ return NULL;
+ }
+
+ assert(state->array_reconstructor != NULL);
+ result = Py_BuildValue(
+ "O(OCiN)O", state->array_reconstructor, Py_TYPE(self), typecode,
+ mformat_code, array_str, dict);
+ Py_DECREF(dict);
+ return result;
+}
+
+static PyObject *
+array_get_typecode(arrayobject *a, void *closure)
+{
+ char typecode = a->ob_descr->typecode;
+ return PyUnicode_FromOrdinal(typecode);
+}
+
+static PyObject *
+array_get_itemsize(arrayobject *a, void *closure)
+{
+ return PyLong_FromLong((long)a->ob_descr->itemsize);
+}
+
+static PyGetSetDef array_getsets [] = {
+ {"typecode", (getter) array_get_typecode, NULL,
+ "the typecode character used to create the array"},
+ {"itemsize", (getter) array_get_itemsize, NULL,
+ "the size, in bytes, of one array item"},
+ {NULL}
+};
+
+static PyMethodDef array_methods[] = {
+ ARRAY_ARRAY_APPEND_METHODDEF
+ ARRAY_ARRAY_BUFFER_INFO_METHODDEF
+ ARRAY_ARRAY_BYTESWAP_METHODDEF
+ ARRAY_ARRAY___COPY___METHODDEF
+ ARRAY_ARRAY_COUNT_METHODDEF
+ ARRAY_ARRAY___DEEPCOPY___METHODDEF
+ ARRAY_ARRAY_EXTEND_METHODDEF
+ ARRAY_ARRAY_FROMFILE_METHODDEF
+ ARRAY_ARRAY_FROMLIST_METHODDEF
+ ARRAY_ARRAY_FROMBYTES_METHODDEF
+ ARRAY_ARRAY_FROMUNICODE_METHODDEF
+ ARRAY_ARRAY_INDEX_METHODDEF
+ ARRAY_ARRAY_INSERT_METHODDEF
+ ARRAY_ARRAY_POP_METHODDEF
+ ARRAY_ARRAY___REDUCE_EX___METHODDEF
+ ARRAY_ARRAY_REMOVE_METHODDEF
+ ARRAY_ARRAY_REVERSE_METHODDEF
+ ARRAY_ARRAY_TOFILE_METHODDEF
+ ARRAY_ARRAY_TOLIST_METHODDEF
+ ARRAY_ARRAY_TOBYTES_METHODDEF
+ ARRAY_ARRAY_TOUNICODE_METHODDEF
+ ARRAY_ARRAY___SIZEOF___METHODDEF
+ {"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+array_repr(arrayobject *a)
+{
+ char typecode;
+ PyObject *s, *v = NULL;
+ Py_ssize_t len;
+
+ len = Py_SIZE(a);
+ typecode = a->ob_descr->typecode;
+ if (len == 0) {
+ return PyUnicode_FromFormat("%s('%c')",
+ _PyType_Name(Py_TYPE(a)), (int)typecode);
+ }
+ if (typecode == 'u') {
+ v = array_array_tounicode_impl(a);
+ } else {
+ v = array_array_tolist_impl(a);
+ }
+ if (v == NULL)
+ return NULL;
+
+ s = PyUnicode_FromFormat("%s('%c', %R)",
+ _PyType_Name(Py_TYPE(a)), (int)typecode, v);
+ Py_DECREF(v);
+ return s;
+}
+
+static PyObject*
+array_subscr(arrayobject* self, PyObject* item)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(self));
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+ if (i==-1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ if (i < 0)
+ i += Py_SIZE(self);
+ return array_item(self, i);
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelength, i;
+ size_t cur;
+ PyObject* result;
+ arrayobject* ar;
+ int itemsize = self->ob_descr->itemsize;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return NULL;
+ }
+ slicelength = PySlice_AdjustIndices(Py_SIZE(self), &start, &stop,
+ step);
+
+ if (slicelength <= 0) {
+ return newarrayobject(state->ArrayType, 0, self->ob_descr);
+ }
+ else if (step == 1) {
+ PyObject *result = newarrayobject(state->ArrayType,
+ slicelength, self->ob_descr);
+ if (result == NULL)
+ return NULL;
+ memcpy(((arrayobject *)result)->ob_item,
+ self->ob_item + start * itemsize,
+ slicelength * itemsize);
+ return result;
+ }
+ else {
+ result = newarrayobject(state->ArrayType, slicelength, self->ob_descr);
+ if (!result) return NULL;
+
+ ar = (arrayobject*)result;
+
+ for (cur = start, i = 0; i < slicelength;
+ cur += step, i++) {
+ memcpy(ar->ob_item + i*itemsize,
+ self->ob_item + cur*itemsize,
+ itemsize);
+ }
+
+ return result;
+ }
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "array indices must be integers");
+ return NULL;
+ }
+}
+
+static int
+array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value)
+{
+ Py_ssize_t start, stop, step, slicelength, needed;
+ array_state* state = find_array_state_by_type(Py_TYPE(self));
+ arrayobject* other;
+ int itemsize;
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+
+ if (i == -1 && PyErr_Occurred())
+ return -1;
+ if (i < 0)
+ i += Py_SIZE(self);
+ if (i < 0 || i >= Py_SIZE(self)) {
+ PyErr_SetString(PyExc_IndexError,
+ "array assignment index out of range");
+ return -1;
+ }
+ if (value == NULL) {
+ /* Fall through to slice assignment */
+ start = i;
+ stop = i + 1;
+ step = 1;
+ slicelength = 1;
+ }
+ else
+ return (*self->ob_descr->setitem)(self, i, value);
+ }
+ else if (PySlice_Check(item)) {
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return -1;
+ }
+ slicelength = PySlice_AdjustIndices(Py_SIZE(self), &start, &stop,
+ step);
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "array indices must be integers");
+ return -1;
+ }
+ if (value == NULL) {
+ other = NULL;
+ needed = 0;
+ }
+ else if (array_Check(value, state)) {
+ other = (arrayobject *)value;
+ needed = Py_SIZE(other);
+ if (self == other) {
+ /* Special case "self[i:j] = self" -- copy self first */
+ int ret;
+ value = array_slice(other, 0, needed);
+ if (value == NULL)
+ return -1;
+ ret = array_ass_subscr(self, item, value);
+ Py_DECREF(value);
+ return ret;
+ }
+ if (other->ob_descr != self->ob_descr) {
+ PyErr_BadArgument();
+ return -1;
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "can only assign array (not \"%.200s\") to array slice",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ itemsize = self->ob_descr->itemsize;
+ /* for 'a[2:1] = ...', the insertion point is 'start', not 'stop' */
+ if ((step > 0 && stop < start) ||
+ (step < 0 && stop > start))
+ stop = start;
+
+ /* Issue #4509: If the array has exported buffers and the slice
+ assignment would change the size of the array, fail early to make
+ sure we don't modify it. */
+ if ((needed == 0 || slicelength != needed) && self->ob_exports > 0) {
+ PyErr_SetString(PyExc_BufferError,
+ "cannot resize an array that is exporting buffers");
+ return -1;
+ }
+
+ if (step == 1) {
+ if (slicelength > needed) {
+ memmove(self->ob_item + (start + needed) * itemsize,
+ self->ob_item + stop * itemsize,
+ (Py_SIZE(self) - stop) * itemsize);
+ if (array_resize(self, Py_SIZE(self) +
+ needed - slicelength) < 0)
+ return -1;
+ }
+ else if (slicelength < needed) {
+ if (array_resize(self, Py_SIZE(self) +
+ needed - slicelength) < 0)
+ return -1;
+ memmove(self->ob_item + (start + needed) * itemsize,
+ self->ob_item + stop * itemsize,
+ (Py_SIZE(self) - start - needed) * itemsize);
+ }
+ if (needed > 0)
+ memcpy(self->ob_item + start * itemsize,
+ other->ob_item, needed * itemsize);
+ return 0;
+ }
+ else if (needed == 0) {
+ /* Delete slice */
+ size_t cur;
+ Py_ssize_t i;
+
+ if (step < 0) {
+ stop = start + 1;
+ start = stop + step * (slicelength - 1) - 1;
+ step = -step;
+ }
+ for (cur = start, i = 0; i < slicelength;
+ cur += step, i++) {
+ Py_ssize_t lim = step - 1;
+
+ if (cur + step >= (size_t)Py_SIZE(self))
+ lim = Py_SIZE(self) - cur - 1;
+ memmove(self->ob_item + (cur - i) * itemsize,
+ self->ob_item + (cur + 1) * itemsize,
+ lim * itemsize);
+ }
+ cur = start + (size_t)slicelength * step;
+ if (cur < (size_t)Py_SIZE(self)) {
+ memmove(self->ob_item + (cur-slicelength) * itemsize,
+ self->ob_item + cur * itemsize,
+ (Py_SIZE(self) - cur) * itemsize);
+ }
+ if (array_resize(self, Py_SIZE(self) - slicelength) < 0)
+ return -1;
+ return 0;
+ }
+ else {
+ size_t cur;
+ Py_ssize_t i;
+
+ if (needed != slicelength) {
+ PyErr_Format(PyExc_ValueError,
+ "attempt to assign array of size %zd "
+ "to extended slice of size %zd",
+ needed, slicelength);
+ return -1;
+ }
+ for (cur = start, i = 0; i < slicelength;
+ cur += step, i++) {
+ memcpy(self->ob_item + cur * itemsize,
+ other->ob_item + i * itemsize,
+ itemsize);
+ }
+ return 0;
+ }
+}
+
+static const void *emptybuf = "";
+
+
+static int
+array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags)
+{
+ if (view == NULL) {
+ PyErr_SetString(PyExc_BufferError,
+ "array_buffer_getbuf: view==NULL argument is obsolete");
+ return -1;
+ }
+
+ view->buf = (void *)self->ob_item;
+ view->obj = Py_NewRef(self);
+ if (view->buf == NULL)
+ view->buf = (void *)emptybuf;
+ view->len = Py_SIZE(self) * self->ob_descr->itemsize;
+ view->readonly = 0;
+ view->ndim = 1;
+ view->itemsize = self->ob_descr->itemsize;
+ view->suboffsets = NULL;
+ view->shape = NULL;
+ if ((flags & PyBUF_ND)==PyBUF_ND) {
+ view->shape = &((PyVarObject*)self)->ob_size;
+ }
+ view->strides = NULL;
+ if ((flags & PyBUF_STRIDES)==PyBUF_STRIDES)
+ view->strides = &(view->itemsize);
+ view->format = NULL;
+ view->internal = NULL;
+ if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) {
+ view->format = (char *)self->ob_descr->formats;
+#ifdef Py_UNICODE_WIDE
+ if (self->ob_descr->typecode == 'u') {
+ view->format = "w";
+ }
+#endif
+ }
+
+ self->ob_exports++;
+ return 0;
+}
+
+static void
+array_buffer_relbuf(arrayobject *self, Py_buffer *view)
+{
+ self->ob_exports--;
+}
+
+static PyObject *
+array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ array_state *state = find_array_state_by_type(type);
+ int c;
+ PyObject *initial = NULL, *it = NULL;
+ const struct arraydescr *descr;
+
+ if ((type == state->ArrayType ||
+ type->tp_init == state->ArrayType->tp_init) &&
+ !_PyArg_NoKeywords("array.array", kwds))
+ return NULL;
+
+ if (!PyArg_ParseTuple(args, "C|O:array", &c, &initial))
+ return NULL;
+
+ if (PySys_Audit("array.__new__", "CO",
+ c, initial ? initial : Py_None) < 0) {
+ return NULL;
+ }
+
+ if (initial && c != 'u') {
+ if (PyUnicode_Check(initial)) {
+ PyErr_Format(PyExc_TypeError, "cannot use a str to initialize "
+ "an array with typecode '%c'", c);
+ return NULL;
+ }
+ else if (array_Check(initial, state) &&
+ ((arrayobject*)initial)->ob_descr->typecode == 'u') {
+ PyErr_Format(PyExc_TypeError, "cannot use a unicode array to "
+ "initialize an array with typecode '%c'", c);
+ return NULL;
+ }
+ }
+
+ if (!(initial == NULL || PyList_Check(initial)
+ || PyByteArray_Check(initial)
+ || PyBytes_Check(initial)
+ || PyTuple_Check(initial)
+ || ((c=='u') && PyUnicode_Check(initial))
+ || (array_Check(initial, state)
+ && c == ((arrayobject*)initial)->ob_descr->typecode))) {
+ it = PyObject_GetIter(initial);
+ if (it == NULL)
+ return NULL;
+ /* We set initial to NULL so that the subsequent code
+ will create an empty array of the appropriate type
+ and afterwards we can use array_iter_extend to populate
+ the array.
+ */
+ initial = NULL;
+ }
+ for (descr = descriptors; descr->typecode != '\0'; descr++) {
+ if (descr->typecode == c) {
+ PyObject *a;
+ Py_ssize_t len;
+
+ if (initial == NULL)
+ len = 0;
+ else if (PyList_Check(initial))
+ len = PyList_GET_SIZE(initial);
+ else if (PyTuple_Check(initial) || array_Check(initial, state))
+ len = Py_SIZE(initial);
+ else
+ len = 0;
+
+ a = newarrayobject(type, len, descr);
+ if (a == NULL)
+ return NULL;
+
+ if (len > 0 && !array_Check(initial, state)) {
+ Py_ssize_t i;
+ for (i = 0; i < len; i++) {
+ PyObject *v =
+ PySequence_GetItem(initial, i);
+ if (v == NULL) {
+ Py_DECREF(a);
+ return NULL;
+ }
+ if (setarrayitem(a, i, v) != 0) {
+ Py_DECREF(v);
+ Py_DECREF(a);
+ return NULL;
+ }
+ Py_DECREF(v);
+ }
+ }
+ else if (initial != NULL && (PyByteArray_Check(initial) ||
+ PyBytes_Check(initial))) {
+ PyObject *v;
+ v = array_array_frombytes((arrayobject *)a,
+ initial);
+ if (v == NULL) {
+ Py_DECREF(a);
+ return NULL;
+ }
+ Py_DECREF(v);
+ }
+ else if (initial != NULL && PyUnicode_Check(initial)) {
+ Py_ssize_t n;
+ wchar_t *ustr = PyUnicode_AsWideCharString(initial, &n);
+ if (ustr == NULL) {
+ Py_DECREF(a);
+ return NULL;
+ }
+
+ if (n > 0) {
+ arrayobject *self = (arrayobject *)a;
+ // self->ob_item may be NULL but it is safe.
+ PyMem_Free(self->ob_item);
+ self->ob_item = (char *)ustr;
+ Py_SET_SIZE(self, n);
+ self->allocated = n;
+ }
+ }
+ else if (initial != NULL && array_Check(initial, state) && len > 0) {
+ arrayobject *self = (arrayobject *)a;
+ arrayobject *other = (arrayobject *)initial;
+ memcpy(self->ob_item, other->ob_item, len * other->ob_descr->itemsize);
+ }
+ if (it != NULL) {
+ if (array_iter_extend((arrayobject *)a, it) == -1) {
+ Py_DECREF(it);
+ Py_DECREF(a);
+ return NULL;
+ }
+ Py_DECREF(it);
+ }
+ return a;
+ }
+ }
+ PyErr_SetString(PyExc_ValueError,
+ "bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)");
+ return NULL;
+}
+
+
+PyDoc_STRVAR(module_doc,
+"This module defines an object type which can efficiently represent\n\
+an array of basic values: characters, integers, floating point\n\
+numbers. Arrays are sequence types and behave very much like lists,\n\
+except that the type of objects stored in them is constrained.\n");
+
+PyDoc_STRVAR(arraytype_doc,
+"array(typecode [, initializer]) -> array\n\
+\n\
+Return a new array whose items are restricted by typecode, and\n\
+initialized from the optional initializer value, which must be a list,\n\
+string or iterable over elements of the appropriate type.\n\
+\n\
+Arrays represent basic values and behave very much like lists, except\n\
+the type of objects stored in them is constrained. The type is specified\n\
+at object creation time by using a type code, which is a single character.\n\
+The following type codes are defined:\n\
+\n\
+ Type code C Type Minimum size in bytes\n\
+ 'b' signed integer 1\n\
+ 'B' unsigned integer 1\n\
+ 'u' Unicode character 2 (see note)\n\
+ 'h' signed integer 2\n\
+ 'H' unsigned integer 2\n\
+ 'i' signed integer 2\n\
+ 'I' unsigned integer 2\n\
+ 'l' signed integer 4\n\
+ 'L' unsigned integer 4\n\
+ 'q' signed integer 8 (see note)\n\
+ 'Q' unsigned integer 8 (see note)\n\
+ 'f' floating point 4\n\
+ 'd' floating point 8\n\
+\n\
+NOTE: The 'u' typecode corresponds to Python's unicode character. On\n\
+narrow builds this is 2-bytes on wide builds this is 4-bytes.\n\
+\n\
+NOTE: The 'q' and 'Q' type codes are only available if the platform\n\
+C compiler used to build Python supports 'long long', or, on Windows,\n\
+'__int64'.\n\
+\n\
+Methods:\n\
+\n\
+append() -- append a new item to the end of the array\n\
+buffer_info() -- return information giving the current memory info\n\
+byteswap() -- byteswap all the items of the array\n\
+count() -- return number of occurrences of an object\n\
+extend() -- extend array by appending multiple elements from an iterable\n\
+fromfile() -- read items from a file object\n\
+fromlist() -- append items from the list\n\
+frombytes() -- append items from the string\n\
+index() -- return index of first occurrence of an object\n\
+insert() -- insert a new item into the array at a provided position\n\
+pop() -- remove and return item (default last)\n\
+remove() -- remove first occurrence of an object\n\
+reverse() -- reverse the order of the items in the array\n\
+tofile() -- write all items to a file object\n\
+tolist() -- return the array converted to an ordinary list\n\
+tobytes() -- return the array converted to a string\n\
+\n\
+Attributes:\n\
+\n\
+typecode -- the typecode character used to create the array\n\
+itemsize -- the length in bytes of one array item\n\
+");
+
+static PyObject *array_iter(arrayobject *ao);
+
+static struct PyMemberDef array_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(arrayobject, weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot array_slots[] = {
+ {Py_tp_dealloc, array_dealloc},
+ {Py_tp_repr, array_repr},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)arraytype_doc},
+ {Py_tp_richcompare, array_richcompare},
+ {Py_tp_iter, array_iter},
+ {Py_tp_methods, array_methods},
+ {Py_tp_members, array_members},
+ {Py_tp_getset, array_getsets},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, array_new},
+ {Py_tp_traverse, array_tp_traverse},
+
+ /* as sequence */
+ {Py_sq_length, array_length},
+ {Py_sq_concat, array_concat},
+ {Py_sq_repeat, array_repeat},
+ {Py_sq_item, array_item},
+ {Py_sq_ass_item, array_ass_item},
+ {Py_sq_contains, array_contains},
+ {Py_sq_inplace_concat, array_inplace_concat},
+ {Py_sq_inplace_repeat, array_inplace_repeat},
+
+ /* as mapping */
+ {Py_mp_length, array_length},
+ {Py_mp_subscript, array_subscr},
+ {Py_mp_ass_subscript, array_ass_subscr},
+
+ /* as buffer */
+ {Py_bf_getbuffer, array_buffer_getbuf},
+ {Py_bf_releasebuffer, array_buffer_relbuf},
+
+ {0, NULL},
+};
+
+static PyType_Spec array_spec = {
+ .name = "array.array",
+ .basicsize = sizeof(arrayobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_SEQUENCE),
+ .slots = array_slots,
+};
+
+/*********************** Array Iterator **************************/
+
+/*[clinic input]
+class array.arrayiterator "arrayiterobject *" "find_array_state_by_type(type)->ArrayIterType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=fb46d5ef98dd95ff]*/
+
+static PyObject *
+array_iter(arrayobject *ao)
+{
+ array_state *state = find_array_state_by_type(Py_TYPE(ao));
+ arrayiterobject *it;
+
+ if (!array_Check(ao, state)) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
+ it = PyObject_GC_New(arrayiterobject, state->ArrayIterType);
+ if (it == NULL)
+ return NULL;
+
+ it->ao = (arrayobject*)Py_NewRef(ao);
+ it->index = 0;
+ it->getitem = ao->ob_descr->getitem;
+ PyObject_GC_Track(it);
+ return (PyObject *)it;
+}
+
+static PyObject *
+arrayiter_next(arrayiterobject *it)
+{
+ arrayobject *ao;
+
+ assert(it != NULL);
+#ifndef NDEBUG
+ array_state *state = find_array_state_by_type(Py_TYPE(it));
+ assert(PyObject_TypeCheck(it, state->ArrayIterType));
+#endif
+ ao = it->ao;
+ if (ao == NULL) {
+ return NULL;
+ }
+#ifndef NDEBUG
+ assert(array_Check(ao, state));
+#endif
+ if (it->index < Py_SIZE(ao)) {
+ return (*it->getitem)(ao, it->index++);
+ }
+ it->ao = NULL;
+ Py_DECREF(ao);
+ return NULL;
+}
+
+static void
+arrayiter_dealloc(arrayiterobject *it)
+{
+ PyTypeObject *tp = Py_TYPE(it);
+
+ PyObject_GC_UnTrack(it);
+ Py_XDECREF(it->ao);
+ PyObject_GC_Del(it);
+ Py_DECREF(tp);
+}
+
+static int
+arrayiter_traverse(arrayiterobject *it, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(it));
+ Py_VISIT(it->ao);
+ return 0;
+}
+
+/*[clinic input]
+array.arrayiterator.__reduce__
+
+ cls: defining_class
+ /
+
+Return state information for pickling.
+[clinic start generated code]*/
+
+static PyObject *
+array_arrayiterator___reduce___impl(arrayiterobject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=4b032417a2c8f5e6 input=ac64e65a87ad452e]*/
+{
+
+ array_state *state = get_array_state_by_class(cls);
+ assert(state != NULL);
+ PyObject *func = _PyEval_GetBuiltin(state->str_iter);
+ if (self->ao == NULL) {
+ return Py_BuildValue("N(())", func);
+ }
+ return Py_BuildValue("N(O)n", func, self->ao, self->index);
+}
+
+/*[clinic input]
+array.arrayiterator.__setstate__
+
+ state: object
+ /
+
+Set state information for unpickling.
+[clinic start generated code]*/
+
+static PyObject *
+array_arrayiterator___setstate__(arrayiterobject *self, PyObject *state)
+/*[clinic end generated code: output=397da9904e443cbe input=f47d5ceda19e787b]*/
+{
+ Py_ssize_t index = PyLong_AsSsize_t(state);
+ if (index == -1 && PyErr_Occurred())
+ return NULL;
+ if (index < 0)
+ index = 0;
+ else if (index > Py_SIZE(self->ao))
+ index = Py_SIZE(self->ao); /* iterator exhausted */
+ self->index = index;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef arrayiter_methods[] = {
+ ARRAY_ARRAYITERATOR___REDUCE___METHODDEF
+ ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot arrayiter_slots[] = {
+ {Py_tp_dealloc, arrayiter_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, arrayiter_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, arrayiter_next},
+ {Py_tp_methods, arrayiter_methods},
+ {0, NULL},
+};
+
+static PyType_Spec arrayiter_spec = {
+ .name = "array.arrayiterator",
+ .basicsize = sizeof(arrayiterobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = arrayiter_slots,
+};
+
+
+/*********************** Install Module **************************/
+
+static int
+array_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ array_state *state = get_array_state(module);
+ Py_VISIT(state->ArrayType);
+ Py_VISIT(state->ArrayIterType);
+ Py_VISIT(state->array_reconstructor);
+ return 0;
+}
+
+static int
+array_clear(PyObject *module)
+{
+ array_state *state = get_array_state(module);
+ Py_CLEAR(state->ArrayType);
+ Py_CLEAR(state->ArrayIterType);
+ Py_CLEAR(state->array_reconstructor);
+ Py_CLEAR(state->str_read);
+ Py_CLEAR(state->str_write);
+ Py_CLEAR(state->str___dict__);
+ Py_CLEAR(state->str_iter);
+ return 0;
+}
+
+static void
+array_free(void *module)
+{
+ array_clear((PyObject *)module);
+}
+
+/* No functions in array module. */
+static PyMethodDef a_methods[] = {
+ ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF
+ {NULL, NULL, 0, NULL} /* Sentinel */
+};
+
+#define CREATE_TYPE(module, type, spec) \
+do { \
+ type = (PyTypeObject *)PyType_FromModuleAndSpec(module, spec, NULL); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+} while (0)
+
+#define ADD_INTERNED(state, string) \
+do { \
+ PyObject *tmp = PyUnicode_InternFromString(#string); \
+ if (tmp == NULL) { \
+ return -1; \
+ } \
+ state->str_ ## string = tmp; \
+} while (0)
+
+static int
+array_modexec(PyObject *m)
+{
+ array_state *state = get_array_state(m);
+ char buffer[Py_ARRAY_LENGTH(descriptors)], *p;
+ PyObject *typecodes;
+ const struct arraydescr *descr;
+
+ state->array_reconstructor = NULL;
+ /* Add interned strings */
+ ADD_INTERNED(state, read);
+ ADD_INTERNED(state, write);
+ ADD_INTERNED(state, __dict__);
+ ADD_INTERNED(state, iter);
+
+ CREATE_TYPE(m, state->ArrayType, &array_spec);
+ CREATE_TYPE(m, state->ArrayIterType, &arrayiter_spec);
+ Py_SET_TYPE(state->ArrayIterType, &PyType_Type);
+
+ if (PyModule_AddObject(m, "ArrayType",
+ Py_NewRef((PyObject *)state->ArrayType)) < 0) {
+ Py_DECREF((PyObject *)state->ArrayType);
+ return -1;
+ }
+
+ PyObject *mutablesequence = _PyImport_GetModuleAttrString(
+ "collections.abc", "MutableSequence");
+ if (!mutablesequence) {
+ Py_DECREF((PyObject *)state->ArrayType);
+ return -1;
+ }
+ PyObject *res = PyObject_CallMethod(mutablesequence, "register", "O",
+ (PyObject *)state->ArrayType);
+ Py_DECREF(mutablesequence);
+ if (!res) {
+ Py_DECREF((PyObject *)state->ArrayType);
+ return -1;
+ }
+ Py_DECREF(res);
+
+ if (PyModule_AddType(m, state->ArrayType) < 0) {
+ return -1;
+ }
+
+ p = buffer;
+ for (descr = descriptors; descr->typecode != '\0'; descr++) {
+ *p++ = (char)descr->typecode;
+ }
+ typecodes = PyUnicode_DecodeASCII(buffer, p - buffer, NULL);
+ if (PyModule_AddObject(m, "typecodes", typecodes) < 0) {
+ Py_XDECREF(typecodes);
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot arrayslots[] = {
+ {Py_mod_exec, array_modexec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+
+static struct PyModuleDef arraymodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "array",
+ .m_size = sizeof(array_state),
+ .m_doc = module_doc,
+ .m_methods = a_methods,
+ .m_slots = arrayslots,
+ .m_traverse = array_traverse,
+ .m_clear = array_clear,
+ .m_free = array_free,
+};
+
+
+PyMODINIT_FUNC
+PyInit_array(void)
+{
+ return PyModuleDef_Init(&arraymodule);
+}
diff --git a/contrib/tools/python3/Modules/atexitmodule.c b/contrib/tools/python3/Modules/atexitmodule.c
new file mode 100644
index 00000000000..5882d405636
--- /dev/null
+++ b/contrib/tools/python3/Modules/atexitmodule.c
@@ -0,0 +1,335 @@
+/*
+ * atexit - allow programmer to define multiple exit functions to be executed
+ * upon normal program termination.
+ *
+ * Translated from atexit.py by Collin Winter.
+ + Copyright 2007 Python Software Foundation.
+ */
+
+#include "Python.h"
+#include "pycore_atexit.h"
+#include "pycore_initconfig.h" // _PyStatus_NO_MEMORY
+#include "pycore_interp.h" // PyInterpreterState.atexit
+#include "pycore_pystate.h" // _PyInterpreterState_GET
+
+/* ===================================================================== */
+/* Callback machinery. */
+
+static inline struct atexit_state*
+get_atexit_state(void)
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ return &interp->atexit;
+}
+
+
+int
+_Py_AtExit(PyInterpreterState *interp,
+ atexit_datacallbackfunc func, void *data)
+{
+ assert(interp == _PyInterpreterState_GET());
+ atexit_callback *callback = PyMem_Malloc(sizeof(atexit_callback));
+ if (callback == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ callback->func = func;
+ callback->data = data;
+ callback->next = NULL;
+
+ struct atexit_state *state = &interp->atexit;
+ if (state->ll_callbacks == NULL) {
+ state->ll_callbacks = callback;
+ state->last_ll_callback = callback;
+ }
+ else {
+ state->last_ll_callback->next = callback;
+ }
+ return 0;
+}
+
+
+static void
+atexit_delete_cb(struct atexit_state *state, int i)
+{
+ atexit_py_callback *cb = state->callbacks[i];
+ state->callbacks[i] = NULL;
+
+ Py_DECREF(cb->func);
+ Py_DECREF(cb->args);
+ Py_XDECREF(cb->kwargs);
+ PyMem_Free(cb);
+}
+
+
+/* Clear all callbacks without calling them */
+static void
+atexit_cleanup(struct atexit_state *state)
+{
+ atexit_py_callback *cb;
+ for (int i = 0; i < state->ncallbacks; i++) {
+ cb = state->callbacks[i];
+ if (cb == NULL)
+ continue;
+
+ atexit_delete_cb(state, i);
+ }
+ state->ncallbacks = 0;
+}
+
+
+PyStatus
+_PyAtExit_Init(PyInterpreterState *interp)
+{
+ struct atexit_state *state = &interp->atexit;
+ // _PyAtExit_Init() must only be called once
+ assert(state->callbacks == NULL);
+
+ state->callback_len = 32;
+ state->ncallbacks = 0;
+ state->callbacks = PyMem_New(atexit_py_callback*, state->callback_len);
+ if (state->callbacks == NULL) {
+ return _PyStatus_NO_MEMORY();
+ }
+ return _PyStatus_OK();
+}
+
+
+void
+_PyAtExit_Fini(PyInterpreterState *interp)
+{
+ struct atexit_state *state = &interp->atexit;
+ atexit_cleanup(state);
+ PyMem_Free(state->callbacks);
+ state->callbacks = NULL;
+
+ atexit_callback *next = state->ll_callbacks;
+ state->ll_callbacks = NULL;
+ while (next != NULL) {
+ atexit_callback *callback = next;
+ next = callback->next;
+ atexit_datacallbackfunc exitfunc = callback->func;
+ void *data = callback->data;
+ // It was allocated in _PyAtExit_AddCallback().
+ PyMem_Free(callback);
+ exitfunc(data);
+ }
+}
+
+
+static void
+atexit_callfuncs(struct atexit_state *state)
+{
+ assert(!PyErr_Occurred());
+
+ if (state->ncallbacks == 0) {
+ return;
+ }
+
+ for (int i = state->ncallbacks - 1; i >= 0; i--) {
+ atexit_py_callback *cb = state->callbacks[i];
+ if (cb == NULL) {
+ continue;
+ }
+
+ // bpo-46025: Increment the refcount of cb->func as the call itself may unregister it
+ PyObject* the_func = Py_NewRef(cb->func);
+ PyObject *res = PyObject_Call(cb->func, cb->args, cb->kwargs);
+ if (res == NULL) {
+ _PyErr_WriteUnraisableMsg("in atexit callback", the_func);
+ }
+ else {
+ Py_DECREF(res);
+ }
+ Py_DECREF(the_func);
+ }
+
+ atexit_cleanup(state);
+
+ assert(!PyErr_Occurred());
+}
+
+
+void
+_PyAtExit_Call(PyInterpreterState *interp)
+{
+ struct atexit_state *state = &interp->atexit;
+ atexit_callfuncs(state);
+}
+
+
+/* ===================================================================== */
+/* Module methods. */
+
+
+PyDoc_STRVAR(atexit_register__doc__,
+"register(func, *args, **kwargs) -> func\n\
+\n\
+Register a function to be executed upon normal program termination\n\
+\n\
+ func - function to be called at exit\n\
+ args - optional arguments to pass to func\n\
+ kwargs - optional keyword arguments to pass to func\n\
+\n\
+ func is returned to facilitate usage as a decorator.");
+
+static PyObject *
+atexit_register(PyObject *module, PyObject *args, PyObject *kwargs)
+{
+ if (PyTuple_GET_SIZE(args) == 0) {
+ PyErr_SetString(PyExc_TypeError,
+ "register() takes at least 1 argument (0 given)");
+ return NULL;
+ }
+
+ PyObject *func = PyTuple_GET_ITEM(args, 0);
+ if (!PyCallable_Check(func)) {
+ PyErr_SetString(PyExc_TypeError,
+ "the first argument must be callable");
+ return NULL;
+ }
+
+ struct atexit_state *state = get_atexit_state();
+ if (state->ncallbacks >= state->callback_len) {
+ atexit_py_callback **r;
+ state->callback_len += 16;
+ size_t size = sizeof(atexit_py_callback*) * (size_t)state->callback_len;
+ r = (atexit_py_callback**)PyMem_Realloc(state->callbacks, size);
+ if (r == NULL) {
+ return PyErr_NoMemory();
+ }
+ state->callbacks = r;
+ }
+
+ atexit_py_callback *callback = PyMem_Malloc(sizeof(atexit_py_callback));
+ if (callback == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ callback->args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
+ if (callback->args == NULL) {
+ PyMem_Free(callback);
+ return NULL;
+ }
+ callback->func = Py_NewRef(func);
+ callback->kwargs = Py_XNewRef(kwargs);
+
+ state->callbacks[state->ncallbacks++] = callback;
+
+ return Py_NewRef(func);
+}
+
+PyDoc_STRVAR(atexit_run_exitfuncs__doc__,
+"_run_exitfuncs() -> None\n\
+\n\
+Run all registered exit functions.\n\
+\n\
+If a callback raises an exception, it is logged with sys.unraisablehook.");
+
+static PyObject *
+atexit_run_exitfuncs(PyObject *module, PyObject *unused)
+{
+ struct atexit_state *state = get_atexit_state();
+ atexit_callfuncs(state);
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(atexit_clear__doc__,
+"_clear() -> None\n\
+\n\
+Clear the list of previously registered exit functions.");
+
+static PyObject *
+atexit_clear(PyObject *module, PyObject *unused)
+{
+ atexit_cleanup(get_atexit_state());
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(atexit_ncallbacks__doc__,
+"_ncallbacks() -> int\n\
+\n\
+Return the number of registered exit functions.");
+
+static PyObject *
+atexit_ncallbacks(PyObject *module, PyObject *unused)
+{
+ struct atexit_state *state = get_atexit_state();
+ return PyLong_FromSsize_t(state->ncallbacks);
+}
+
+PyDoc_STRVAR(atexit_unregister__doc__,
+"unregister(func) -> None\n\
+\n\
+Unregister an exit function which was previously registered using\n\
+atexit.register\n\
+\n\
+ func - function to be unregistered");
+
+static PyObject *
+atexit_unregister(PyObject *module, PyObject *func)
+{
+ struct atexit_state *state = get_atexit_state();
+ for (int i = 0; i < state->ncallbacks; i++)
+ {
+ atexit_py_callback *cb = state->callbacks[i];
+ if (cb == NULL) {
+ continue;
+ }
+
+ int eq = PyObject_RichCompareBool(cb->func, func, Py_EQ);
+ if (eq < 0) {
+ return NULL;
+ }
+ if (eq) {
+ atexit_delete_cb(state, i);
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef atexit_methods[] = {
+ {"register", _PyCFunction_CAST(atexit_register), METH_VARARGS|METH_KEYWORDS,
+ atexit_register__doc__},
+ {"_clear", (PyCFunction) atexit_clear, METH_NOARGS,
+ atexit_clear__doc__},
+ {"unregister", (PyCFunction) atexit_unregister, METH_O,
+ atexit_unregister__doc__},
+ {"_run_exitfuncs", (PyCFunction) atexit_run_exitfuncs, METH_NOARGS,
+ atexit_run_exitfuncs__doc__},
+ {"_ncallbacks", (PyCFunction) atexit_ncallbacks, METH_NOARGS,
+ atexit_ncallbacks__doc__},
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* ===================================================================== */
+/* Initialization function. */
+
+PyDoc_STRVAR(atexit__doc__,
+"allow programmer to define multiple exit functions to be executed\n\
+upon normal program termination.\n\
+\n\
+Two public functions, register and unregister, are defined.\n\
+");
+
+static PyModuleDef_Slot atexitmodule_slots[] = {
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef atexitmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "atexit",
+ .m_doc = atexit__doc__,
+ .m_size = 0,
+ .m_methods = atexit_methods,
+ .m_slots = atexitmodule_slots,
+};
+
+PyMODINIT_FUNC
+PyInit_atexit(void)
+{
+ return PyModuleDef_Init(&atexitmodule);
+}
diff --git a/contrib/tools/python3/Modules/audioop.c b/contrib/tools/python3/Modules/audioop.c
new file mode 100644
index 00000000000..94e82f1c2e6
--- /dev/null
+++ b/contrib/tools/python3/Modules/audioop.c
@@ -0,0 +1,2003 @@
+/* The audioop module uses the code base in g777.c file of the Sox project.
+ Source: https://sourceforge.net/projects/sox/files/sox/12.17.7/sox-12.17.7.tar.gz
+
+ Copyright of g771.c:
+
+ * This source code is a product of Sun Microsystems, Inc. and is provided
+ * for unrestricted use. Users may copy or modify this source code without
+ * charge.
+ *
+ * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING
+ * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun source code is provided with no support and without any obligation on
+ * the part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043 */
+
+/* audioopmodule - Module to detect peak values in arrays */
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+
+static const int maxvals[] = {0, 0x7F, 0x7FFF, 0x7FFFFF, 0x7FFFFFFF};
+/* -1 trick is needed on Windows to support -0x80000000 without a warning */
+static const int minvals[] = {0, -0x80, -0x8000, -0x800000, -0x7FFFFFFF-1};
+static const unsigned int masks[] = {0, 0xFF, 0xFFFF, 0xFFFFFF, 0xFFFFFFFF};
+
+static int
+fbound(double val, double minval, double maxval)
+{
+ if (val > maxval) {
+ val = maxval;
+ }
+ else if (val < minval + 1.0) {
+ val = minval;
+ }
+
+ /* Round towards minus infinity (-inf) */
+ val = floor(val);
+
+ /* Cast double to integer: round towards zero */
+ return (int)val;
+}
+
+
+#define BIAS 0x84 /* define the add-in bias for 16 bit samples */
+#define CLIP 32635
+#define SIGN_BIT (0x80) /* Sign bit for an A-law byte. */
+#define QUANT_MASK (0xf) /* Quantization field mask. */
+#define SEG_SHIFT (4) /* Left shift for segment number. */
+#define SEG_MASK (0x70) /* Segment field mask. */
+
+static const int16_t seg_aend[8] = {
+ 0x1F, 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF
+};
+static const int16_t seg_uend[8] = {
+ 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF
+};
+
+static int16_t
+search(int16_t val, const int16_t *table, int size)
+{
+ assert(0 <= size);
+ assert(size < INT16_MAX);
+ int i;
+
+ for (i = 0; i < size; i++) {
+ if (val <= *table++)
+ return (i);
+ }
+ return (size);
+}
+#define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc])
+#define st_alaw2linear16(uc) (_st_alaw2linear16[uc])
+
+static const int16_t _st_ulaw2linear16[256] = {
+ -32124, -31100, -30076, -29052, -28028, -27004, -25980,
+ -24956, -23932, -22908, -21884, -20860, -19836, -18812,
+ -17788, -16764, -15996, -15484, -14972, -14460, -13948,
+ -13436, -12924, -12412, -11900, -11388, -10876, -10364,
+ -9852, -9340, -8828, -8316, -7932, -7676, -7420,
+ -7164, -6908, -6652, -6396, -6140, -5884, -5628,
+ -5372, -5116, -4860, -4604, -4348, -4092, -3900,
+ -3772, -3644, -3516, -3388, -3260, -3132, -3004,
+ -2876, -2748, -2620, -2492, -2364, -2236, -2108,
+ -1980, -1884, -1820, -1756, -1692, -1628, -1564,
+ -1500, -1436, -1372, -1308, -1244, -1180, -1116,
+ -1052, -988, -924, -876, -844, -812, -780,
+ -748, -716, -684, -652, -620, -588, -556,
+ -524, -492, -460, -428, -396, -372, -356,
+ -340, -324, -308, -292, -276, -260, -244,
+ -228, -212, -196, -180, -164, -148, -132,
+ -120, -112, -104, -96, -88, -80, -72,
+ -64, -56, -48, -40, -32, -24, -16,
+ -8, 0, 32124, 31100, 30076, 29052, 28028,
+ 27004, 25980, 24956, 23932, 22908, 21884, 20860,
+ 19836, 18812, 17788, 16764, 15996, 15484, 14972,
+ 14460, 13948, 13436, 12924, 12412, 11900, 11388,
+ 10876, 10364, 9852, 9340, 8828, 8316, 7932,
+ 7676, 7420, 7164, 6908, 6652, 6396, 6140,
+ 5884, 5628, 5372, 5116, 4860, 4604, 4348,
+ 4092, 3900, 3772, 3644, 3516, 3388, 3260,
+ 3132, 3004, 2876, 2748, 2620, 2492, 2364,
+ 2236, 2108, 1980, 1884, 1820, 1756, 1692,
+ 1628, 1564, 1500, 1436, 1372, 1308, 1244,
+ 1180, 1116, 1052, 988, 924, 876, 844,
+ 812, 780, 748, 716, 684, 652, 620,
+ 588, 556, 524, 492, 460, 428, 396,
+ 372, 356, 340, 324, 308, 292, 276,
+ 260, 244, 228, 212, 196, 180, 164,
+ 148, 132, 120, 112, 104, 96, 88,
+ 80, 72, 64, 56, 48, 40, 32,
+ 24, 16, 8, 0
+};
+
+/*
+ * linear2ulaw() accepts a 14-bit signed integer and encodes it as u-law data
+ * stored in an unsigned char. This function should only be called with
+ * the data shifted such that it only contains information in the lower
+ * 14-bits.
+ *
+ * In order to simplify the encoding process, the original linear magnitude
+ * is biased by adding 33 which shifts the encoding range from (0 - 8158) to
+ * (33 - 8191). The result can be seen in the following encoding table:
+ *
+ * Biased Linear Input Code Compressed Code
+ * ------------------------ ---------------
+ * 00000001wxyza 000wxyz
+ * 0000001wxyzab 001wxyz
+ * 000001wxyzabc 010wxyz
+ * 00001wxyzabcd 011wxyz
+ * 0001wxyzabcde 100wxyz
+ * 001wxyzabcdef 101wxyz
+ * 01wxyzabcdefg 110wxyz
+ * 1wxyzabcdefgh 111wxyz
+ *
+ * Each biased linear code has a leading 1 which identifies the segment
+ * number. The value of the segment number is equal to 7 minus the number
+ * of leading 0's. The quantization interval is directly available as the
+ * four bits wxyz. * The trailing bits (a - h) are ignored.
+ *
+ * Ordinarily the complement of the resulting code word is used for
+ * transmission, and so the code word is complemented before it is returned.
+ *
+ * For further information see John C. Bellamy's Digital Telephony, 1982,
+ * John Wiley & Sons, pps 98-111 and 472-476.
+ */
+static unsigned char
+st_14linear2ulaw(int16_t pcm_val) /* 2's complement (14-bit range) */
+{
+ int16_t mask;
+ int16_t seg;
+ unsigned char uval;
+
+ /* u-law inverts all bits */
+ /* Get the sign and the magnitude of the value. */
+ if (pcm_val < 0) {
+ pcm_val = -pcm_val;
+ mask = 0x7F;
+ } else {
+ mask = 0xFF;
+ }
+ if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */
+ pcm_val += (BIAS >> 2);
+
+ /* Convert the scaled magnitude to segment number. */
+ seg = search(pcm_val, seg_uend, 8);
+
+ /*
+ * Combine the sign, segment, quantization bits;
+ * and complement the code word.
+ */
+ if (seg >= 8) /* out of range, return maximum value. */
+ return (unsigned char) (0x7F ^ mask);
+ else {
+ assert(seg >= 0);
+ uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF);
+ return (uval ^ mask);
+ }
+
+}
+
+static const int16_t _st_alaw2linear16[256] = {
+ -5504, -5248, -6016, -5760, -4480, -4224, -4992,
+ -4736, -7552, -7296, -8064, -7808, -6528, -6272,
+ -7040, -6784, -2752, -2624, -3008, -2880, -2240,
+ -2112, -2496, -2368, -3776, -3648, -4032, -3904,
+ -3264, -3136, -3520, -3392, -22016, -20992, -24064,
+ -23040, -17920, -16896, -19968, -18944, -30208, -29184,
+ -32256, -31232, -26112, -25088, -28160, -27136, -11008,
+ -10496, -12032, -11520, -8960, -8448, -9984, -9472,
+ -15104, -14592, -16128, -15616, -13056, -12544, -14080,
+ -13568, -344, -328, -376, -360, -280, -264,
+ -312, -296, -472, -456, -504, -488, -408,
+ -392, -440, -424, -88, -72, -120, -104,
+ -24, -8, -56, -40, -216, -200, -248,
+ -232, -152, -136, -184, -168, -1376, -1312,
+ -1504, -1440, -1120, -1056, -1248, -1184, -1888,
+ -1824, -2016, -1952, -1632, -1568, -1760, -1696,
+ -688, -656, -752, -720, -560, -528, -624,
+ -592, -944, -912, -1008, -976, -816, -784,
+ -880, -848, 5504, 5248, 6016, 5760, 4480,
+ 4224, 4992, 4736, 7552, 7296, 8064, 7808,
+ 6528, 6272, 7040, 6784, 2752, 2624, 3008,
+ 2880, 2240, 2112, 2496, 2368, 3776, 3648,
+ 4032, 3904, 3264, 3136, 3520, 3392, 22016,
+ 20992, 24064, 23040, 17920, 16896, 19968, 18944,
+ 30208, 29184, 32256, 31232, 26112, 25088, 28160,
+ 27136, 11008, 10496, 12032, 11520, 8960, 8448,
+ 9984, 9472, 15104, 14592, 16128, 15616, 13056,
+ 12544, 14080, 13568, 344, 328, 376, 360,
+ 280, 264, 312, 296, 472, 456, 504,
+ 488, 408, 392, 440, 424, 88, 72,
+ 120, 104, 24, 8, 56, 40, 216,
+ 200, 248, 232, 152, 136, 184, 168,
+ 1376, 1312, 1504, 1440, 1120, 1056, 1248,
+ 1184, 1888, 1824, 2016, 1952, 1632, 1568,
+ 1760, 1696, 688, 656, 752, 720, 560,
+ 528, 624, 592, 944, 912, 1008, 976,
+ 816, 784, 880, 848
+};
+
+/*
+ * linear2alaw() accepts a 13-bit signed integer and encodes it as A-law data
+ * stored in an unsigned char. This function should only be called with
+ * the data shifted such that it only contains information in the lower
+ * 13-bits.
+ *
+ * Linear Input Code Compressed Code
+ * ------------------------ ---------------
+ * 0000000wxyza 000wxyz
+ * 0000001wxyza 001wxyz
+ * 000001wxyzab 010wxyz
+ * 00001wxyzabc 011wxyz
+ * 0001wxyzabcd 100wxyz
+ * 001wxyzabcde 101wxyz
+ * 01wxyzabcdef 110wxyz
+ * 1wxyzabcdefg 111wxyz
+ *
+ * For further information see John C. Bellamy's Digital Telephony, 1982,
+ * John Wiley & Sons, pps 98-111 and 472-476.
+ */
+static unsigned char
+st_linear2alaw(int16_t pcm_val) /* 2's complement (13-bit range) */
+{
+ int16_t mask;
+ int16_t seg;
+ unsigned char aval;
+
+ /* A-law using even bit inversion */
+ if (pcm_val >= 0) {
+ mask = 0xD5; /* sign (7th) bit = 1 */
+ } else {
+ mask = 0x55; /* sign bit = 0 */
+ pcm_val = -pcm_val - 1;
+ }
+
+ /* Convert the scaled magnitude to segment number. */
+ seg = search(pcm_val, seg_aend, 8);
+
+ /* Combine the sign, segment, and quantization bits. */
+
+ if (seg >= 8) /* out of range, return maximum value. */
+ return (unsigned char) (0x7F ^ mask);
+ else {
+ aval = (unsigned char) seg << SEG_SHIFT;
+ if (seg < 2)
+ aval |= (pcm_val >> 1) & QUANT_MASK;
+ else
+ aval |= (pcm_val >> seg) & QUANT_MASK;
+ return (aval ^ mask);
+ }
+}
+/* End of code taken from sox */
+
+/* Intel ADPCM step variation table */
+static const int indexTable[16] = {
+ -1, -1, -1, -1, 2, 4, 6, 8,
+ -1, -1, -1, -1, 2, 4, 6, 8,
+};
+
+static const int stepsizeTable[89] = {
+ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
+ 19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
+ 50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
+ 130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
+ 337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
+ 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
+ 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
+ 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
+ 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
+};
+
+#define GETINTX(T, cp, i) (*(T *)((unsigned char *)(cp) + (i)))
+#define SETINTX(T, cp, i, val) do { \
+ *(T *)((unsigned char *)(cp) + (i)) = (T)(val); \
+ } while (0)
+
+
+#define GETINT8(cp, i) GETINTX(signed char, (cp), (i))
+#define GETINT16(cp, i) GETINTX(int16_t, (cp), (i))
+#define GETINT32(cp, i) GETINTX(int32_t, (cp), (i))
+
+#ifdef WORDS_BIGENDIAN
+#define GETINT24(cp, i) ( \
+ ((unsigned char *)(cp) + (i))[2] + \
+ (((unsigned char *)(cp) + (i))[1] * (1 << 8)) + \
+ (((signed char *)(cp) + (i))[0] * (1 << 16)) )
+#else
+#define GETINT24(cp, i) ( \
+ ((unsigned char *)(cp) + (i))[0] + \
+ (((unsigned char *)(cp) + (i))[1] * (1 << 8)) + \
+ (((signed char *)(cp) + (i))[2] * (1 << 16)) )
+#endif
+
+
+#define SETINT8(cp, i, val) SETINTX(signed char, (cp), (i), (val))
+#define SETINT16(cp, i, val) SETINTX(int16_t, (cp), (i), (val))
+#define SETINT32(cp, i, val) SETINTX(int32_t, (cp), (i), (val))
+
+#ifdef WORDS_BIGENDIAN
+#define SETINT24(cp, i, val) do { \
+ ((unsigned char *)(cp) + (i))[2] = (int)(val); \
+ ((unsigned char *)(cp) + (i))[1] = (int)(val) >> 8; \
+ ((signed char *)(cp) + (i))[0] = (int)(val) >> 16; \
+ } while (0)
+#else
+#define SETINT24(cp, i, val) do { \
+ ((unsigned char *)(cp) + (i))[0] = (int)(val); \
+ ((unsigned char *)(cp) + (i))[1] = (int)(val) >> 8; \
+ ((signed char *)(cp) + (i))[2] = (int)(val) >> 16; \
+ } while (0)
+#endif
+
+
+#define GETRAWSAMPLE(size, cp, i) ( \
+ (size == 1) ? (int)GETINT8((cp), (i)) : \
+ (size == 2) ? (int)GETINT16((cp), (i)) : \
+ (size == 3) ? (int)GETINT24((cp), (i)) : \
+ (int)GETINT32((cp), (i)))
+
+#define SETRAWSAMPLE(size, cp, i, val) do { \
+ if (size == 1) \
+ SETINT8((cp), (i), (val)); \
+ else if (size == 2) \
+ SETINT16((cp), (i), (val)); \
+ else if (size == 3) \
+ SETINT24((cp), (i), (val)); \
+ else \
+ SETINT32((cp), (i), (val)); \
+ } while(0)
+
+
+#define GETSAMPLE32(size, cp, i) ( \
+ (size == 1) ? (int)GETINT8((cp), (i)) * (1 << 24) : \
+ (size == 2) ? (int)GETINT16((cp), (i)) * (1 << 16) : \
+ (size == 3) ? (int)GETINT24((cp), (i)) * (1 << 8) : \
+ (int)GETINT32((cp), (i)))
+
+#define SETSAMPLE32(size, cp, i, val) do { \
+ if (size == 1) \
+ SETINT8((cp), (i), (val) >> 24); \
+ else if (size == 2) \
+ SETINT16((cp), (i), (val) >> 16); \
+ else if (size == 3) \
+ SETINT24((cp), (i), (val) >> 8); \
+ else \
+ SETINT32((cp), (i), (val)); \
+ } while(0)
+
+static PyModuleDef audioopmodule;
+
+typedef struct {
+ PyObject *AudioopError;
+} audioop_state;
+
+static inline audioop_state *
+get_audioop_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (audioop_state *)state;
+}
+
+static int
+audioop_check_size(PyObject *module, int size)
+{
+ if (size < 1 || size > 4) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Size should be 1, 2, 3 or 4");
+ return 0;
+ }
+ else
+ return 1;
+}
+
+static int
+audioop_check_parameters(PyObject *module, Py_ssize_t len, int size)
+{
+ if (!audioop_check_size(module, size))
+ return 0;
+ if (len % size != 0) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "not a whole number of frames");
+ return 0;
+ }
+ return 1;
+}
+
+/*[clinic input]
+module audioop
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=8fa8f6611be3591a]*/
+
+/*[clinic input]
+audioop.getsample
+
+ fragment: Py_buffer
+ width: int
+ index: Py_ssize_t
+ /
+
+Return the value of sample index from the fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width,
+ Py_ssize_t index)
+/*[clinic end generated code: output=8fe1b1775134f39a input=88edbe2871393549]*/
+{
+ int val;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ if (index < 0 || index >= fragment->len/width) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Index out of range");
+ return NULL;
+ }
+ val = GETRAWSAMPLE(width, fragment->buf, index*width);
+ return PyLong_FromLong(val);
+}
+
+/*[clinic input]
+audioop.max
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the maximum of the absolute value of all samples in a fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_max_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=e6c5952714f1c3f0 input=32bea5ea0ac8c223]*/
+{
+ Py_ssize_t i;
+ unsigned int absval, max = 0;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETRAWSAMPLE(width, fragment->buf, i);
+ /* Cast to unsigned before negating. Unsigned overflow is well-
+ defined, but signed overflow is not. */
+ if (val < 0) absval = (unsigned int)-(int64_t)val;
+ else absval = val;
+ if (absval > max) max = absval;
+ }
+ return PyLong_FromUnsignedLong(max);
+}
+
+/*[clinic input]
+audioop.minmax
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the minimum and maximum values of all samples in the sound fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=473fda66b15c836e input=89848e9b927a0696]*/
+{
+ Py_ssize_t i;
+ /* -1 trick below is needed on Windows to support -0x80000000 without
+ a warning */
+ int min = 0x7fffffff, max = -0x7FFFFFFF-1;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETRAWSAMPLE(width, fragment->buf, i);
+ if (val > max) max = val;
+ if (val < min) min = val;
+ }
+ return Py_BuildValue("(ii)", min, max);
+}
+
+/*[clinic input]
+audioop.avg
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the average over all samples in the fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=4410a4c12c3586e6 input=1114493c7611334d]*/
+{
+ Py_ssize_t i;
+ int avg;
+ double sum = 0.0;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ for (i = 0; i < fragment->len; i += width)
+ sum += GETRAWSAMPLE(width, fragment->buf, i);
+ if (fragment->len == 0)
+ avg = 0;
+ else
+ avg = (int)floor(sum / (double)(fragment->len/width));
+ return PyLong_FromLong(avg);
+}
+
+/*[clinic input]
+audioop.rms
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).
+[clinic start generated code]*/
+
+static PyObject *
+audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=1e7871c826445698 input=4cc57c6c94219d78]*/
+{
+ Py_ssize_t i;
+ unsigned int res;
+ double sum_squares = 0.0;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ for (i = 0; i < fragment->len; i += width) {
+ double val = GETRAWSAMPLE(width, fragment->buf, i);
+ sum_squares += val*val;
+ }
+ if (fragment->len == 0)
+ res = 0;
+ else
+ res = (unsigned int)sqrt(sum_squares / (double)(fragment->len/width));
+ return PyLong_FromUnsignedLong(res);
+}
+
+static double _sum2(const int16_t *a, const int16_t *b, Py_ssize_t len)
+{
+ Py_ssize_t i;
+ double sum = 0.0;
+
+ for( i=0; i<len; i++) {
+ sum = sum + (double)a[i]*(double)b[i];
+ }
+ return sum;
+}
+
+/*
+** Findfit tries to locate a sample within another sample. Its main use
+** is in echo-cancellation (to find the feedback of the output signal in
+** the input signal).
+** The method used is as follows:
+**
+** let R be the reference signal (length n) and A the input signal (length N)
+** with N > n, and let all sums be over i from 0 to n-1.
+**
+** Now, for each j in {0..N-n} we compute a factor fj so that -fj*R matches A
+** as good as possible, i.e. sum( (A[j+i]+fj*R[i])^2 ) is minimal. This
+** equation gives fj = sum( A[j+i]R[i] ) / sum(R[i]^2).
+**
+** Next, we compute the relative distance between the original signal and
+** the modified signal and minimize that over j:
+** vj = sum( (A[j+i]-fj*R[i])^2 ) / sum( A[j+i]^2 ) =>
+** vj = ( sum(A[j+i]^2)*sum(R[i]^2) - sum(A[j+i]R[i])^2 ) / sum( A[j+i]^2 )
+**
+** In the code variables correspond as follows:
+** cp1 A
+** cp2 R
+** len1 N
+** len2 n
+** aj_m1 A[j-1]
+** aj_lm1 A[j+n-1]
+** sum_ri_2 sum(R[i]^2)
+** sum_aij_2 sum(A[i+j]^2)
+** sum_aij_ri sum(A[i+j]R[i])
+**
+** sum_ri is calculated once, sum_aij_2 is updated each step and sum_aij_ri
+** is completely recalculated each step.
+*/
+/*[clinic input]
+audioop.findfit
+
+ fragment: Py_buffer
+ reference: Py_buffer
+ /
+
+Try to match reference as well as possible to a portion of fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
+ Py_buffer *reference)
+/*[clinic end generated code: output=5752306d83cbbada input=62c305605e183c9a]*/
+{
+ const int16_t *cp1, *cp2;
+ Py_ssize_t len1, len2;
+ Py_ssize_t j, best_j;
+ double aj_m1, aj_lm1;
+ double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor;
+
+ if (fragment->len & 1 || reference->len & 1) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Strings should be even-sized");
+ return NULL;
+ }
+ cp1 = (const int16_t *)fragment->buf;
+ len1 = fragment->len >> 1;
+ cp2 = (const int16_t *)reference->buf;
+ len2 = reference->len >> 1;
+
+ if (len1 < len2) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "First sample should be longer");
+ return NULL;
+ }
+ sum_ri_2 = _sum2(cp2, cp2, len2);
+ sum_aij_2 = _sum2(cp1, cp1, len2);
+ sum_aij_ri = _sum2(cp1, cp2, len2);
+
+ result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) / sum_aij_2;
+
+ best_result = result;
+ best_j = 0;
+
+ for ( j=1; j<=len1-len2; j++) {
+ aj_m1 = (double)cp1[j-1];
+ aj_lm1 = (double)cp1[j+len2-1];
+
+ sum_aij_2 = sum_aij_2 + aj_lm1*aj_lm1 - aj_m1*aj_m1;
+ sum_aij_ri = _sum2(cp1+j, cp2, len2);
+
+ result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri)
+ / sum_aij_2;
+
+ if ( result < best_result ) {
+ best_result = result;
+ best_j = j;
+ }
+
+ }
+
+ factor = _sum2(cp1+best_j, cp2, len2) / sum_ri_2;
+
+ return Py_BuildValue("(nf)", best_j, factor);
+}
+
+/*
+** findfactor finds a factor f so that the energy in A-fB is minimal.
+** See the comment for findfit for details.
+*/
+/*[clinic input]
+audioop.findfactor
+
+ fragment: Py_buffer
+ reference: Py_buffer
+ /
+
+Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
+ Py_buffer *reference)
+/*[clinic end generated code: output=14ea95652c1afcf8 input=816680301d012b21]*/
+{
+ const int16_t *cp1, *cp2;
+ Py_ssize_t len;
+ double sum_ri_2, sum_aij_ri, result;
+
+ if (fragment->len & 1 || reference->len & 1) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Strings should be even-sized");
+ return NULL;
+ }
+ if (fragment->len != reference->len) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Samples should be same size");
+ return NULL;
+ }
+ cp1 = (const int16_t *)fragment->buf;
+ cp2 = (const int16_t *)reference->buf;
+ len = fragment->len >> 1;
+ sum_ri_2 = _sum2(cp2, cp2, len);
+ sum_aij_ri = _sum2(cp1, cp2, len);
+
+ result = sum_aij_ri / sum_ri_2;
+
+ return PyFloat_FromDouble(result);
+}
+
+/*
+** findmax returns the index of the n-sized segment of the input sample
+** that contains the most energy.
+*/
+/*[clinic input]
+audioop.findmax
+
+ fragment: Py_buffer
+ length: Py_ssize_t
+ /
+
+Search fragment for a slice of specified number of samples with maximum energy.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
+ Py_ssize_t length)
+/*[clinic end generated code: output=f008128233523040 input=2f304801ed42383c]*/
+{
+ const int16_t *cp1;
+ Py_ssize_t len1;
+ Py_ssize_t j, best_j;
+ double aj_m1, aj_lm1;
+ double result, best_result;
+
+ if (fragment->len & 1) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Strings should be even-sized");
+ return NULL;
+ }
+ cp1 = (const int16_t *)fragment->buf;
+ len1 = fragment->len >> 1;
+
+ if (length < 0 || len1 < length) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Input sample should be longer");
+ return NULL;
+ }
+
+ result = _sum2(cp1, cp1, length);
+
+ best_result = result;
+ best_j = 0;
+
+ for ( j=1; j<=len1-length; j++) {
+ aj_m1 = (double)cp1[j-1];
+ aj_lm1 = (double)cp1[j+length-1];
+
+ result = result + aj_lm1*aj_lm1 - aj_m1*aj_m1;
+
+ if ( result > best_result ) {
+ best_result = result;
+ best_j = j;
+ }
+
+ }
+
+ return PyLong_FromSsize_t(best_j);
+}
+
+/*[clinic input]
+audioop.avgpp
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the average peak-peak value over all samples in the fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=269596b0d5ae0b2b input=0b3cceeae420a7d9]*/
+{
+ Py_ssize_t i;
+ int prevval, prevextremevalid = 0, prevextreme = 0;
+ double sum = 0.0;
+ unsigned int avg;
+ int diff, prevdiff, nextreme = 0;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ if (fragment->len <= width)
+ return PyLong_FromLong(0);
+ prevval = GETRAWSAMPLE(width, fragment->buf, 0);
+ prevdiff = 17; /* Anything != 0, 1 */
+ for (i = width; i < fragment->len; i += width) {
+ int val = GETRAWSAMPLE(width, fragment->buf, i);
+ if (val != prevval) {
+ diff = val < prevval;
+ if (prevdiff == !diff) {
+ /* Derivative changed sign. Compute difference to last
+ ** extreme value and remember.
+ */
+ if (prevextremevalid) {
+ if (prevval < prevextreme)
+ sum += (double)((unsigned int)prevextreme -
+ (unsigned int)prevval);
+ else
+ sum += (double)((unsigned int)prevval -
+ (unsigned int)prevextreme);
+ nextreme++;
+ }
+ prevextremevalid = 1;
+ prevextreme = prevval;
+ }
+ prevval = val;
+ prevdiff = diff;
+ }
+ }
+ if ( nextreme == 0 )
+ avg = 0;
+ else
+ avg = (unsigned int)(sum / (double)nextreme);
+ return PyLong_FromUnsignedLong(avg);
+}
+
+/*[clinic input]
+audioop.maxpp
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the maximum peak-peak value in the sound fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=5b918ed5dbbdb978 input=671a13e1518f80a1]*/
+{
+ Py_ssize_t i;
+ int prevval, prevextremevalid = 0, prevextreme = 0;
+ unsigned int max = 0, extremediff;
+ int diff, prevdiff;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ if (fragment->len <= width)
+ return PyLong_FromLong(0);
+ prevval = GETRAWSAMPLE(width, fragment->buf, 0);
+ prevdiff = 17; /* Anything != 0, 1 */
+ for (i = width; i < fragment->len; i += width) {
+ int val = GETRAWSAMPLE(width, fragment->buf, i);
+ if (val != prevval) {
+ diff = val < prevval;
+ if (prevdiff == !diff) {
+ /* Derivative changed sign. Compute difference to
+ ** last extreme value and remember.
+ */
+ if (prevextremevalid) {
+ if (prevval < prevextreme)
+ extremediff = (unsigned int)prevextreme -
+ (unsigned int)prevval;
+ else
+ extremediff = (unsigned int)prevval -
+ (unsigned int)prevextreme;
+ if ( extremediff > max )
+ max = extremediff;
+ }
+ prevextremevalid = 1;
+ prevextreme = prevval;
+ }
+ prevval = val;
+ prevdiff = diff;
+ }
+ }
+ return PyLong_FromUnsignedLong(max);
+}
+
+/*[clinic input]
+audioop.cross
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the number of zero crossings in the fragment passed as an argument.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=5938dcdd74a1f431 input=b1b3f15b83f6b41a]*/
+{
+ Py_ssize_t i;
+ int prevval;
+ Py_ssize_t ncross;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ ncross = -1;
+ prevval = 17; /* Anything <> 0,1 */
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETRAWSAMPLE(width, fragment->buf, i) < 0;
+ if (val != prevval) ncross++;
+ prevval = val;
+ }
+ return PyLong_FromSsize_t(ncross);
+}
+
+/*[clinic input]
+audioop.mul
+
+ fragment: Py_buffer
+ width: int
+ factor: double
+ /
+
+Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width,
+ double factor)
+/*[clinic end generated code: output=6cd48fe796da0ea4 input=c726667baa157d3c]*/
+{
+ signed char *ncp;
+ Py_ssize_t i;
+ double maxval, minval;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ maxval = (double) maxvals[width];
+ minval = (double) minvals[width];
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment->len; i += width) {
+ double val = GETRAWSAMPLE(width, fragment->buf, i);
+ int ival = fbound(val * factor, minval, maxval);
+ SETRAWSAMPLE(width, ncp, i, ival);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.tomono
+
+ fragment: Py_buffer
+ width: int
+ lfactor: double
+ rfactor: double
+ /
+
+Convert a stereo fragment to a mono fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width,
+ double lfactor, double rfactor)
+/*[clinic end generated code: output=235c8277216d4e4e input=c4ec949b3f4dddfa]*/
+{
+ signed char *cp, *ncp;
+ Py_ssize_t len, i;
+ double maxval, minval;
+ PyObject *rv;
+
+ cp = fragment->buf;
+ len = fragment->len;
+ if (!audioop_check_parameters(module, len, width))
+ return NULL;
+ if (((len / width) & 1) != 0) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "not a whole number of frames");
+ return NULL;
+ }
+
+ maxval = (double) maxvals[width];
+ minval = (double) minvals[width];
+
+ rv = PyBytes_FromStringAndSize(NULL, len/2);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < len; i += width*2) {
+ double val1 = GETRAWSAMPLE(width, cp, i);
+ double val2 = GETRAWSAMPLE(width, cp, i + width);
+ double val = val1 * lfactor + val2 * rfactor;
+ int ival = fbound(val, minval, maxval);
+ SETRAWSAMPLE(width, ncp, i/2, ival);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.tostereo
+
+ fragment: Py_buffer
+ width: int
+ lfactor: double
+ rfactor: double
+ /
+
+Generate a stereo fragment from a mono fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width,
+ double lfactor, double rfactor)
+/*[clinic end generated code: output=046f13defa5f1595 input=27b6395ebfdff37a]*/
+{
+ signed char *ncp;
+ Py_ssize_t i;
+ double maxval, minval;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ maxval = (double) maxvals[width];
+ minval = (double) minvals[width];
+
+ if (fragment->len > PY_SSIZE_T_MAX/2) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return NULL;
+ }
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len*2);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment->len; i += width) {
+ double val = GETRAWSAMPLE(width, fragment->buf, i);
+ int val1 = fbound(val * lfactor, minval, maxval);
+ int val2 = fbound(val * rfactor, minval, maxval);
+ SETRAWSAMPLE(width, ncp, i*2, val1);
+ SETRAWSAMPLE(width, ncp, i*2 + width, val2);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.add
+
+ fragment1: Py_buffer
+ fragment2: Py_buffer
+ width: int
+ /
+
+Return a fragment which is the addition of the two samples passed as parameters.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_add_impl(PyObject *module, Py_buffer *fragment1,
+ Py_buffer *fragment2, int width)
+/*[clinic end generated code: output=60140af4d1aab6f2 input=4a8d4bae4c1605c7]*/
+{
+ signed char *ncp;
+ Py_ssize_t i;
+ int minval, maxval, newval;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment1->len, width))
+ return NULL;
+ if (fragment1->len != fragment2->len) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "Lengths should be the same");
+ return NULL;
+ }
+
+ maxval = maxvals[width];
+ minval = minvals[width];
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment1->len);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment1->len; i += width) {
+ int val1 = GETRAWSAMPLE(width, fragment1->buf, i);
+ int val2 = GETRAWSAMPLE(width, fragment2->buf, i);
+
+ if (width < 4) {
+ newval = val1 + val2;
+ /* truncate in case of overflow */
+ if (newval > maxval)
+ newval = maxval;
+ else if (newval < minval)
+ newval = minval;
+ }
+ else {
+ double fval = (double)val1 + (double)val2;
+ /* truncate in case of overflow */
+ newval = fbound(fval, minval, maxval);
+ }
+
+ SETRAWSAMPLE(width, ncp, i, newval);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.bias
+
+ fragment: Py_buffer
+ width: int
+ bias: int
+ /
+
+Return a fragment that is the original fragment with a bias added to each sample.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias)
+/*[clinic end generated code: output=6e0aa8f68f045093 input=2b5cce5c3bb4838c]*/
+{
+ signed char *ncp;
+ Py_ssize_t i;
+ unsigned int val = 0, mask;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+
+ mask = masks[width];
+
+ for (i = 0; i < fragment->len; i += width) {
+ if (width == 1)
+ val = GETINTX(unsigned char, fragment->buf, i);
+ else if (width == 2)
+ val = GETINTX(uint16_t, fragment->buf, i);
+ else if (width == 3)
+ val = ((unsigned int)GETINT24(fragment->buf, i)) & 0xffffffu;
+ else {
+ assert(width == 4);
+ val = GETINTX(uint32_t, fragment->buf, i);
+ }
+
+ val += (unsigned int)bias;
+ /* wrap around in case of overflow */
+ val &= mask;
+
+ if (width == 1)
+ SETINTX(unsigned char, ncp, i, val);
+ else if (width == 2)
+ SETINTX(uint16_t, ncp, i, val);
+ else if (width == 3)
+ SETINT24(ncp, i, (int)val);
+ else {
+ assert(width == 4);
+ SETINTX(uint32_t, ncp, i, val);
+ }
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.reverse
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Reverse the samples in a fragment and returns the modified fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=b44135698418da14 input=668f890cf9f9d225]*/
+{
+ unsigned char *ncp;
+ Py_ssize_t i;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+ if (rv == NULL)
+ return NULL;
+ ncp = (unsigned char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETRAWSAMPLE(width, fragment->buf, i);
+ SETRAWSAMPLE(width, ncp, fragment->len - i - width, val);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.byteswap
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Convert big-endian samples to little-endian and vice versa.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=50838a9e4b87cd4d input=fae7611ceffa5c82]*/
+{
+ unsigned char *ncp;
+ Py_ssize_t i;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len);
+ if (rv == NULL)
+ return NULL;
+ ncp = (unsigned char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment->len; i += width) {
+ int j;
+ for (j = 0; j < width; j++)
+ ncp[i + width - 1 - j] = ((unsigned char *)fragment->buf)[i + j];
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.lin2lin
+
+ fragment: Py_buffer
+ width: int
+ newwidth: int
+ /
+
+Convert samples between 1-, 2-, 3- and 4-byte formats.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width,
+ int newwidth)
+/*[clinic end generated code: output=17b14109248f1d99 input=5ce08c8aa2f24d96]*/
+{
+ unsigned char *ncp;
+ Py_ssize_t i, j;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+ if (!audioop_check_size(module, newwidth))
+ return NULL;
+
+ if (fragment->len/width > PY_SSIZE_T_MAX/newwidth) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return NULL;
+ }
+ rv = PyBytes_FromStringAndSize(NULL, (fragment->len/width)*newwidth);
+ if (rv == NULL)
+ return NULL;
+ ncp = (unsigned char *)PyBytes_AsString(rv);
+
+ for (i = j = 0; i < fragment->len; i += width, j += newwidth) {
+ int val = GETSAMPLE32(width, fragment->buf, i);
+ SETSAMPLE32(newwidth, ncp, j, val);
+ }
+ return rv;
+}
+
+static int
+gcd(int a, int b)
+{
+ while (b > 0) {
+ int tmp = a % b;
+ a = b;
+ b = tmp;
+ }
+ return a;
+}
+
+/*[clinic input]
+audioop.ratecv
+
+ fragment: Py_buffer
+ width: int
+ nchannels: int
+ inrate: int
+ outrate: int
+ state: object
+ weightA: int = 1
+ weightB: int = 0
+ /
+
+Convert the frame rate of the input fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
+ int nchannels, int inrate, int outrate, PyObject *state,
+ int weightA, int weightB)
+/*[clinic end generated code: output=624038e843243139 input=aff3acdc94476191]*/
+{
+ char *cp, *ncp;
+ Py_ssize_t len;
+ int chan, d, *prev_i, *cur_i, cur_o;
+ PyObject *samps, *str, *rv = NULL, *channel;
+ int bytes_per_frame;
+
+ if (!audioop_check_size(module, width))
+ return NULL;
+ if (nchannels < 1) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "# of channels should be >= 1");
+ return NULL;
+ }
+ if (width > INT_MAX / nchannels) {
+ /* This overflow test is rigorously correct because
+ both multiplicands are >= 1. Use the argument names
+ from the docs for the error msg. */
+ PyErr_SetString(PyExc_OverflowError,
+ "width * nchannels too big for a C int");
+ return NULL;
+ }
+ bytes_per_frame = width * nchannels;
+ if (weightA < 1 || weightB < 0) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "weightA should be >= 1, weightB should be >= 0");
+ return NULL;
+ }
+ assert(fragment->len >= 0);
+ if (fragment->len % bytes_per_frame != 0) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "not a whole number of frames");
+ return NULL;
+ }
+ if (inrate <= 0 || outrate <= 0) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "sampling rate not > 0");
+ return NULL;
+ }
+ /* divide inrate and outrate by their greatest common divisor */
+ d = gcd(inrate, outrate);
+ inrate /= d;
+ outrate /= d;
+ /* divide weightA and weightB by their greatest common divisor */
+ d = gcd(weightA, weightB);
+ weightA /= d;
+ weightB /= d;
+
+ if ((size_t)nchannels > SIZE_MAX/sizeof(int)) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return NULL;
+ }
+ prev_i = (int *) PyMem_Malloc(nchannels * sizeof(int));
+ cur_i = (int *) PyMem_Malloc(nchannels * sizeof(int));
+ if (prev_i == NULL || cur_i == NULL) {
+ (void) PyErr_NoMemory();
+ goto exit;
+ }
+
+ len = fragment->len / bytes_per_frame; /* # of frames */
+
+ if (state == Py_None) {
+ d = -outrate;
+ for (chan = 0; chan < nchannels; chan++)
+ prev_i[chan] = cur_i[chan] = 0;
+ }
+ else {
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+ goto exit;
+ }
+ if (!PyArg_ParseTuple(state,
+ "iO!;ratecv(): illegal state argument",
+ &d, &PyTuple_Type, &samps))
+ goto exit;
+ if (PyTuple_Size(samps) != nchannels) {
+ PyErr_SetString(get_audioop_state(module)->AudioopError,
+ "illegal state argument");
+ goto exit;
+ }
+ for (chan = 0; chan < nchannels; chan++) {
+ channel = PyTuple_GetItem(samps, chan);
+ if (!PyTuple_Check(channel)) {
+ PyErr_SetString(PyExc_TypeError,
+ "ratecv(): illegal state argument");
+ goto exit;
+ }
+ if (!PyArg_ParseTuple(channel,
+ "ii;ratecv(): illegal state argument",
+ &prev_i[chan], &cur_i[chan]))
+ {
+ goto exit;
+ }
+ }
+ }
+
+ /* str <- Space for the output buffer. */
+ if (len == 0)
+ str = PyBytes_FromStringAndSize(NULL, 0);
+ else {
+ /* There are len input frames, so we need (mathematically)
+ ceiling(len*outrate/inrate) output frames, and each frame
+ requires bytes_per_frame bytes. Computing this
+ without spurious overflow is the challenge; we can
+ settle for a reasonable upper bound, though, in this
+ case ceiling(len/inrate) * outrate. */
+
+ /* compute ceiling(len/inrate) without overflow */
+ Py_ssize_t q = 1 + (len - 1) / inrate;
+ if (outrate > PY_SSIZE_T_MAX / q / bytes_per_frame)
+ str = NULL;
+ else
+ str = PyBytes_FromStringAndSize(NULL,
+ q * outrate * bytes_per_frame);
+ }
+ if (str == NULL) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ goto exit;
+ }
+ ncp = PyBytes_AsString(str);
+ cp = fragment->buf;
+
+ for (;;) {
+ while (d < 0) {
+ if (len == 0) {
+ samps = PyTuple_New(nchannels);
+ if (samps == NULL)
+ goto exit;
+ for (chan = 0; chan < nchannels; chan++)
+ PyTuple_SetItem(samps, chan,
+ Py_BuildValue("(ii)",
+ prev_i[chan],
+ cur_i[chan]));
+ if (PyErr_Occurred())
+ goto exit;
+ /* We have checked before that the length
+ * of the string fits into int. */
+ len = (Py_ssize_t)(ncp - PyBytes_AsString(str));
+ rv = PyBytes_FromStringAndSize
+ (PyBytes_AsString(str), len);
+ Py_SETREF(str, rv);
+ if (str == NULL)
+ goto exit;
+ rv = Py_BuildValue("(O(iO))", str, d, samps);
+ Py_DECREF(samps);
+ Py_DECREF(str);
+ goto exit; /* return rv */
+ }
+ for (chan = 0; chan < nchannels; chan++) {
+ prev_i[chan] = cur_i[chan];
+ cur_i[chan] = GETSAMPLE32(width, cp, 0);
+ cp += width;
+ /* implements a simple digital filter */
+ cur_i[chan] = (int)(
+ ((double)weightA * (double)cur_i[chan] +
+ (double)weightB * (double)prev_i[chan]) /
+ ((double)weightA + (double)weightB));
+ }
+ len--;
+ d += outrate;
+ }
+ while (d >= 0) {
+ for (chan = 0; chan < nchannels; chan++) {
+ cur_o = (int)(((double)prev_i[chan] * (double)d +
+ (double)cur_i[chan] * (double)(outrate - d)) /
+ (double)outrate);
+ SETSAMPLE32(width, ncp, 0, cur_o);
+ ncp += width;
+ }
+ d -= inrate;
+ }
+ }
+ exit:
+ PyMem_Free(prev_i);
+ PyMem_Free(cur_i);
+ return rv;
+}
+
+/*[clinic input]
+audioop.lin2ulaw
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Convert samples in the audio fragment to u-LAW encoding.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=14fb62b16fe8ea8e input=2450d1b870b6bac2]*/
+{
+ unsigned char *ncp;
+ Py_ssize_t i;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len/width);
+ if (rv == NULL)
+ return NULL;
+ ncp = (unsigned char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETSAMPLE32(width, fragment->buf, i);
+ *ncp++ = st_14linear2ulaw(val >> 18);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.ulaw2lin
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=378356b047521ba2 input=45d53ddce5be7d06]*/
+{
+ unsigned char *cp;
+ signed char *ncp;
+ Py_ssize_t i;
+ PyObject *rv;
+
+ if (!audioop_check_size(module, width))
+ return NULL;
+
+ if (fragment->len > PY_SSIZE_T_MAX/width) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return NULL;
+ }
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len*width);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+
+ cp = fragment->buf;
+ for (i = 0; i < fragment->len*width; i += width) {
+ int val = st_ulaw2linear16(*cp++) * (1 << 16);
+ SETSAMPLE32(width, ncp, i, val);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.lin2alaw
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Convert samples in the audio fragment to a-LAW encoding.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=d076f130121a82f0 input=ffb1ef8bb39da945]*/
+{
+ unsigned char *ncp;
+ Py_ssize_t i;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len/width);
+ if (rv == NULL)
+ return NULL;
+ ncp = (unsigned char *)PyBytes_AsString(rv);
+
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETSAMPLE32(width, fragment->buf, i);
+ *ncp++ = st_linear2alaw(val >> 19);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.alaw2lin
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=85c365ec559df647 input=4140626046cd1772]*/
+{
+ unsigned char *cp;
+ signed char *ncp;
+ Py_ssize_t i;
+ int val;
+ PyObject *rv;
+
+ if (!audioop_check_size(module, width))
+ return NULL;
+
+ if (fragment->len > PY_SSIZE_T_MAX/width) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return NULL;
+ }
+ rv = PyBytes_FromStringAndSize(NULL, fragment->len*width);
+ if (rv == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(rv);
+ cp = fragment->buf;
+
+ for (i = 0; i < fragment->len*width; i += width) {
+ val = st_alaw2linear16(*cp++) * (1 << 16);
+ SETSAMPLE32(width, ncp, i, val);
+ }
+ return rv;
+}
+
+/*[clinic input]
+audioop.lin2adpcm
+
+ fragment: Py_buffer
+ width: int
+ state: object
+ /
+
+Convert samples to 4 bit Intel/DVI ADPCM encoding.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width,
+ PyObject *state)
+/*[clinic end generated code: output=cc19f159f16c6793 input=12919d549b90c90a]*/
+{
+ signed char *ncp;
+ Py_ssize_t i;
+ int step, valpred, delta,
+ index, sign, vpdiff, diff;
+ PyObject *rv = NULL, *str;
+ int outputbuffer = 0, bufferstep;
+
+ if (!audioop_check_parameters(module, fragment->len, width))
+ return NULL;
+
+ /* Decode state, should have (value, step) */
+ if ( state == Py_None ) {
+ /* First time, it seems. Set defaults */
+ valpred = 0;
+ index = 0;
+ }
+ else if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+ return NULL;
+ }
+ else if (!PyArg_ParseTuple(state, "ii;lin2adpcm(): illegal state argument",
+ &valpred, &index))
+ {
+ return NULL;
+ }
+ else if (valpred >= 0x8000 || valpred < -0x8000 ||
+ (size_t)index >= Py_ARRAY_LENGTH(stepsizeTable)) {
+ PyErr_SetString(PyExc_ValueError, "bad state");
+ return NULL;
+ }
+
+ str = PyBytes_FromStringAndSize(NULL, fragment->len/(width*2));
+ if (str == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(str);
+
+ step = stepsizeTable[index];
+ bufferstep = 1;
+
+ for (i = 0; i < fragment->len; i += width) {
+ int val = GETSAMPLE32(width, fragment->buf, i) >> 16;
+
+ /* Step 1 - compute difference with previous value */
+ if (val < valpred) {
+ diff = valpred - val;
+ sign = 8;
+ }
+ else {
+ diff = val - valpred;
+ sign = 0;
+ }
+
+ /* Step 2 - Divide and clamp */
+ /* Note:
+ ** This code *approximately* computes:
+ ** delta = diff*4/step;
+ ** vpdiff = (delta+0.5)*step/4;
+ ** but in shift step bits are dropped. The net result of this
+ ** is that even if you have fast mul/div hardware you cannot
+ ** put it to good use since the fixup would be too expensive.
+ */
+ delta = 0;
+ vpdiff = (step >> 3);
+
+ if ( diff >= step ) {
+ delta = 4;
+ diff -= step;
+ vpdiff += step;
+ }
+ step >>= 1;
+ if ( diff >= step ) {
+ delta |= 2;
+ diff -= step;
+ vpdiff += step;
+ }
+ step >>= 1;
+ if ( diff >= step ) {
+ delta |= 1;
+ vpdiff += step;
+ }
+
+ /* Step 3 - Update previous value */
+ if ( sign )
+ valpred -= vpdiff;
+ else
+ valpred += vpdiff;
+
+ /* Step 4 - Clamp previous value to 16 bits */
+ if ( valpred > 32767 )
+ valpred = 32767;
+ else if ( valpred < -32768 )
+ valpred = -32768;
+
+ /* Step 5 - Assemble value, update index and step values */
+ delta |= sign;
+
+ index += indexTable[delta];
+ if ( index < 0 ) index = 0;
+ if ( index > 88 ) index = 88;
+ step = stepsizeTable[index];
+
+ /* Step 6 - Output value */
+ if ( bufferstep ) {
+ outputbuffer = (delta * (1 << 4)) & 0xf0;
+ } else {
+ *ncp++ = (delta & 0x0f) | outputbuffer;
+ }
+ bufferstep = !bufferstep;
+ }
+ rv = Py_BuildValue("(O(ii))", str, valpred, index);
+ Py_DECREF(str);
+ return rv;
+}
+
+/*[clinic input]
+audioop.adpcm2lin
+
+ fragment: Py_buffer
+ width: int
+ state: object
+ /
+
+Decode an Intel/DVI ADPCM coded fragment to a linear fragment.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width,
+ PyObject *state)
+/*[clinic end generated code: output=3440ea105acb3456 input=f5221144f5ca9ef0]*/
+{
+ signed char *cp;
+ signed char *ncp;
+ Py_ssize_t i, outlen;
+ int valpred, step, delta, index, sign, vpdiff;
+ PyObject *rv, *str;
+ int inputbuffer = 0, bufferstep;
+
+ if (!audioop_check_size(module, width))
+ return NULL;
+
+ /* Decode state, should have (value, step) */
+ if ( state == Py_None ) {
+ /* First time, it seems. Set defaults */
+ valpred = 0;
+ index = 0;
+ }
+ else if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None");
+ return NULL;
+ }
+ else if (!PyArg_ParseTuple(state, "ii;adpcm2lin(): illegal state argument",
+ &valpred, &index))
+ {
+ return NULL;
+ }
+ else if (valpred >= 0x8000 || valpred < -0x8000 ||
+ (size_t)index >= Py_ARRAY_LENGTH(stepsizeTable)) {
+ PyErr_SetString(PyExc_ValueError, "bad state");
+ return NULL;
+ }
+
+ if (fragment->len > (PY_SSIZE_T_MAX/2)/width) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return NULL;
+ }
+ outlen = fragment->len*width*2;
+ str = PyBytes_FromStringAndSize(NULL, outlen);
+ if (str == NULL)
+ return NULL;
+ ncp = (signed char *)PyBytes_AsString(str);
+ cp = fragment->buf;
+
+ step = stepsizeTable[index];
+ bufferstep = 0;
+
+ for (i = 0; i < outlen; i += width) {
+ /* Step 1 - get the delta value and compute next index */
+ if ( bufferstep ) {
+ delta = inputbuffer & 0xf;
+ } else {
+ inputbuffer = *cp++;
+ delta = (inputbuffer >> 4) & 0xf;
+ }
+
+ bufferstep = !bufferstep;
+
+ /* Step 2 - Find new index value (for later) */
+ index += indexTable[delta];
+ if ( index < 0 ) index = 0;
+ if ( index > 88 ) index = 88;
+
+ /* Step 3 - Separate sign and magnitude */
+ sign = delta & 8;
+ delta = delta & 7;
+
+ /* Step 4 - Compute difference and new predicted value */
+ /*
+ ** Computes 'vpdiff = (delta+0.5)*step/4', but see comment
+ ** in adpcm_coder.
+ */
+ vpdiff = step >> 3;
+ if ( delta & 4 ) vpdiff += step;
+ if ( delta & 2 ) vpdiff += step>>1;
+ if ( delta & 1 ) vpdiff += step>>2;
+
+ if ( sign )
+ valpred -= vpdiff;
+ else
+ valpred += vpdiff;
+
+ /* Step 5 - clamp output value */
+ if ( valpred > 32767 )
+ valpred = 32767;
+ else if ( valpred < -32768 )
+ valpred = -32768;
+
+ /* Step 6 - Update step value */
+ step = stepsizeTable[index];
+
+ /* Step 6 - Output value */
+ SETSAMPLE32(width, ncp, i, valpred * (1 << 16));
+ }
+
+ rv = Py_BuildValue("(O(ii))", str, valpred, index);
+ Py_DECREF(str);
+ return rv;
+}
+
+#include "clinic/audioop.c.h"
+
+static PyMethodDef audioop_methods[] = {
+ AUDIOOP_MAX_METHODDEF
+ AUDIOOP_MINMAX_METHODDEF
+ AUDIOOP_AVG_METHODDEF
+ AUDIOOP_MAXPP_METHODDEF
+ AUDIOOP_AVGPP_METHODDEF
+ AUDIOOP_RMS_METHODDEF
+ AUDIOOP_FINDFIT_METHODDEF
+ AUDIOOP_FINDMAX_METHODDEF
+ AUDIOOP_FINDFACTOR_METHODDEF
+ AUDIOOP_CROSS_METHODDEF
+ AUDIOOP_MUL_METHODDEF
+ AUDIOOP_ADD_METHODDEF
+ AUDIOOP_BIAS_METHODDEF
+ AUDIOOP_ULAW2LIN_METHODDEF
+ AUDIOOP_LIN2ULAW_METHODDEF
+ AUDIOOP_ALAW2LIN_METHODDEF
+ AUDIOOP_LIN2ALAW_METHODDEF
+ AUDIOOP_LIN2LIN_METHODDEF
+ AUDIOOP_ADPCM2LIN_METHODDEF
+ AUDIOOP_LIN2ADPCM_METHODDEF
+ AUDIOOP_TOMONO_METHODDEF
+ AUDIOOP_TOSTEREO_METHODDEF
+ AUDIOOP_GETSAMPLE_METHODDEF
+ AUDIOOP_REVERSE_METHODDEF
+ AUDIOOP_BYTESWAP_METHODDEF
+ AUDIOOP_RATECV_METHODDEF
+ { 0, 0 }
+};
+
+static int
+audioop_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ audioop_state *state = get_audioop_state(module);
+ Py_VISIT(state->AudioopError);
+ return 0;
+}
+
+static int
+audioop_clear(PyObject *module)
+{
+ audioop_state *state = get_audioop_state(module);
+ Py_CLEAR(state->AudioopError);
+ return 0;
+}
+
+static void
+audioop_free(void *module) {
+ audioop_clear((PyObject *)module);
+}
+
+static int
+audioop_exec(PyObject* module)
+{
+ audioop_state *state = get_audioop_state(module);
+
+ state->AudioopError = PyErr_NewException("audioop.error", NULL, NULL);
+ if (state->AudioopError == NULL) {
+ return -1;
+ }
+
+ Py_INCREF(state->AudioopError);
+ if (PyModule_AddObject(module, "error", state->AudioopError) < 0) {
+ Py_DECREF(state->AudioopError);
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot audioop_slots[] = {
+ {Py_mod_exec, audioop_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef audioopmodule = {
+ PyModuleDef_HEAD_INIT,
+ "audioop",
+ NULL,
+ sizeof(audioop_state),
+ audioop_methods,
+ audioop_slots,
+ audioop_traverse,
+ audioop_clear,
+ audioop_free
+};
+
+PyMODINIT_FUNC
+PyInit_audioop(void)
+{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "'audioop' is deprecated and slated for removal in "
+ "Python 3.13",
+ 7)) {
+ return NULL;
+ }
+
+ return PyModuleDef_Init(&audioopmodule);
+}
diff --git a/contrib/tools/python3/Modules/binascii.c b/contrib/tools/python3/Modules/binascii.c
new file mode 100644
index 00000000000..0614edf4bc0
--- /dev/null
+++ b/contrib/tools/python3/Modules/binascii.c
@@ -0,0 +1,1346 @@
+/*
+** Routines to represent binary data in ASCII and vice-versa
+**
+** This module currently supports the following encodings:
+** uuencode:
+** each line encodes 45 bytes (except possibly the last)
+** First char encodes (binary) length, rest data
+** each char encodes 6 bits, as follows:
+** binary: 01234567 abcdefgh ijklmnop
+** ascii: 012345 67abcd efghij klmnop
+** ASCII encoding method is "excess-space": 000000 is encoded as ' ', etc.
+** short binary data is zero-extended (so the bits are always in the
+** right place), this does *not* reflect in the length.
+** base64:
+** Line breaks are insignificant, but lines are at most 76 chars
+** each char encodes 6 bits, in similar order as uucode/hqx. Encoding
+** is done via a table.
+** Short binary data is filled (in ASCII) with '='.
+** hqx:
+** File starts with introductory text, real data starts and ends
+** with colons.
+** Data consists of three similar parts: info, datafork, resourcefork.
+** Each part is protected (at the end) with a 16-bit crc
+** The binary data is run-length encoded, and then ascii-fied:
+** binary: 01234567 abcdefgh ijklmnop
+** ascii: 012345 67abcd efghij klmnop
+** ASCII encoding is table-driven, see the code.
+** Short binary data results in the runt ascii-byte being output with
+** the bits in the right place.
+**
+** While I was reading dozens of programs that encode or decode the formats
+** here (documentation? hihi:-) I have formulated Jansen's Observation:
+**
+** Programs that encode binary data in ASCII are written in
+** such a style that they are as unreadable as possible. Devices used
+** include unnecessary global variables, burying important tables
+** in unrelated sourcefiles, putting functions in include files,
+** using seemingly-descriptive variable names for different purposes,
+** calls to empty subroutines and a host of others.
+**
+** I have attempted to break with this tradition, but I guess that that
+** does make the performance sub-optimal. Oh well, too bad...
+**
+** Jack Jansen, CWI, July 1995.
+**
+** Added support for quoted-printable encoding, based on rfc 1521 et al
+** quoted-printable encoding specifies that non printable characters (anything
+** below 32 and above 126) be encoded as =XX where XX is the hexadecimal value
+** of the character. It also specifies some other behavior to enable 8bit data
+** in a mail message with little difficulty (maximum line sizes, protecting
+** some cases of whitespace, etc).
+**
+** Brandon Long, September 2001.
+*/
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "pycore_long.h" // _PyLong_DigitValue
+#include "pycore_strhex.h" // _Py_strhex_bytes_with_sep()
+#ifdef USE_ZLIB_CRC32
+# include "zlib.h"
+#endif
+
+typedef struct binascii_state {
+ PyObject *Error;
+ PyObject *Incomplete;
+} binascii_state;
+
+static inline binascii_state *
+get_binascii_state(PyObject *module)
+{
+ return (binascii_state *)PyModule_GetState(module);
+}
+
+
+static const unsigned char table_a2b_base64[] = {
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, /* Note PAD->0 */
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1,
+
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+};
+
+#define BASE64_PAD '='
+
+/* Max binary chunk size; limited only by available memory */
+#define BASE64_MAXBIN ((PY_SSIZE_T_MAX - 3) / 2)
+
+static const unsigned char table_b2a_base64[] =
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+
+static const unsigned short crctab_hqx[256] = {
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
+};
+
+/*[clinic input]
+module binascii
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=de89fb46bcaf3fec]*/
+
+/*[python input]
+
+class ascii_buffer_converter(CConverter):
+ type = 'Py_buffer'
+ converter = 'ascii_buffer_converter'
+ impl_by_reference = True
+ c_default = "{NULL, NULL}"
+
+ def cleanup(self):
+ name = self.name
+ return "".join(["if (", name, ".obj)\n PyBuffer_Release(&", name, ");\n"])
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=3eb7b63610da92cd]*/
+
+static int
+ascii_buffer_converter(PyObject *arg, Py_buffer *buf)
+{
+ if (arg == NULL) {
+ PyBuffer_Release(buf);
+ return 1;
+ }
+ if (PyUnicode_Check(arg)) {
+ if (PyUnicode_READY(arg) < 0)
+ return 0;
+ if (!PyUnicode_IS_ASCII(arg)) {
+ PyErr_SetString(PyExc_ValueError,
+ "string argument should contain only ASCII characters");
+ return 0;
+ }
+ assert(PyUnicode_KIND(arg) == PyUnicode_1BYTE_KIND);
+ buf->buf = (void *) PyUnicode_1BYTE_DATA(arg);
+ buf->len = PyUnicode_GET_LENGTH(arg);
+ buf->obj = NULL;
+ return 1;
+ }
+ if (PyObject_GetBuffer(arg, buf, PyBUF_SIMPLE) != 0) {
+ PyErr_Format(PyExc_TypeError,
+ "argument should be bytes, buffer or ASCII string, "
+ "not '%.100s'", Py_TYPE(arg)->tp_name);
+ return 0;
+ }
+ if (!PyBuffer_IsContiguous(buf, 'C')) {
+ PyErr_Format(PyExc_TypeError,
+ "argument should be a contiguous buffer, "
+ "not '%.100s'", Py_TYPE(arg)->tp_name);
+ PyBuffer_Release(buf);
+ return 0;
+ }
+ return Py_CLEANUP_SUPPORTED;
+}
+
+#include "clinic/binascii.c.h"
+
+/*[clinic input]
+binascii.a2b_uu
+
+ data: ascii_buffer
+ /
+
+Decode a line of uuencoded data.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_a2b_uu_impl(PyObject *module, Py_buffer *data)
+/*[clinic end generated code: output=e027f8e0b0598742 input=7cafeaf73df63d1c]*/
+{
+ const unsigned char *ascii_data;
+ unsigned char *bin_data;
+ int leftbits = 0;
+ unsigned char this_ch;
+ unsigned int leftchar = 0;
+ PyObject *rv;
+ Py_ssize_t ascii_len, bin_len;
+ binascii_state *state;
+
+ ascii_data = data->buf;
+ ascii_len = data->len;
+
+ assert(ascii_len >= 0);
+
+ /* First byte: binary data length (in bytes) */
+ bin_len = (*ascii_data++ - ' ') & 077;
+ ascii_len--;
+
+ /* Allocate the buffer */
+ if ( (rv=PyBytes_FromStringAndSize(NULL, bin_len)) == NULL )
+ return NULL;
+ bin_data = (unsigned char *)PyBytes_AS_STRING(rv);
+
+ for( ; bin_len > 0 ; ascii_len--, ascii_data++ ) {
+ /* XXX is it really best to add NULs if there's no more data */
+ this_ch = (ascii_len > 0) ? *ascii_data : 0;
+ if ( this_ch == '\n' || this_ch == '\r' || ascii_len <= 0) {
+ /*
+ ** Whitespace. Assume some spaces got eaten at
+ ** end-of-line. (We check this later)
+ */
+ this_ch = 0;
+ } else {
+ /* Check the character for legality
+ ** The 64 in stead of the expected 63 is because
+ ** there are a few uuencodes out there that use
+ ** '`' as zero instead of space.
+ */
+ if ( this_ch < ' ' || this_ch > (' ' + 64)) {
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyErr_SetString(state->Error, "Illegal char");
+ Py_DECREF(rv);
+ return NULL;
+ }
+ this_ch = (this_ch - ' ') & 077;
+ }
+ /*
+ ** Shift it in on the low end, and see if there's
+ ** a byte ready for output.
+ */
+ leftchar = (leftchar << 6) | (this_ch);
+ leftbits += 6;
+ if ( leftbits >= 8 ) {
+ leftbits -= 8;
+ *bin_data++ = (leftchar >> leftbits) & 0xff;
+ leftchar &= ((1 << leftbits) - 1);
+ bin_len--;
+ }
+ }
+ /*
+ ** Finally, check that if there's anything left on the line
+ ** that it's whitespace only.
+ */
+ while( ascii_len-- > 0 ) {
+ this_ch = *ascii_data++;
+ /* Extra '`' may be written as padding in some cases */
+ if ( this_ch != ' ' && this_ch != ' '+64 &&
+ this_ch != '\n' && this_ch != '\r' ) {
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyErr_SetString(state->Error, "Trailing garbage");
+ Py_DECREF(rv);
+ return NULL;
+ }
+ }
+ return rv;
+}
+
+/*[clinic input]
+binascii.b2a_uu
+
+ data: Py_buffer
+ /
+ *
+ backtick: bool = False
+
+Uuencode line of data.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_b2a_uu_impl(PyObject *module, Py_buffer *data, int backtick)
+/*[clinic end generated code: output=b1b99de62d9bbeb8 input=beb27822241095cd]*/
+{
+ unsigned char *ascii_data;
+ const unsigned char *bin_data;
+ int leftbits = 0;
+ unsigned char this_ch;
+ unsigned int leftchar = 0;
+ binascii_state *state;
+ Py_ssize_t bin_len, out_len;
+ _PyBytesWriter writer;
+
+ _PyBytesWriter_Init(&writer);
+ bin_data = data->buf;
+ bin_len = data->len;
+ if ( bin_len > 45 ) {
+ /* The 45 is a limit that appears in all uuencode's */
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyErr_SetString(state->Error, "At most 45 bytes at once");
+ return NULL;
+ }
+
+ /* We're lazy and allocate to much (fixed up later) */
+ out_len = 2 + (bin_len + 2) / 3 * 4;
+ ascii_data = _PyBytesWriter_Alloc(&writer, out_len);
+ if (ascii_data == NULL)
+ return NULL;
+
+ /* Store the length */
+ if (backtick && !bin_len)
+ *ascii_data++ = '`';
+ else
+ *ascii_data++ = ' ' + (unsigned char)bin_len;
+
+ for( ; bin_len > 0 || leftbits != 0 ; bin_len--, bin_data++ ) {
+ /* Shift the data (or padding) into our buffer */
+ if ( bin_len > 0 ) /* Data */
+ leftchar = (leftchar << 8) | *bin_data;
+ else /* Padding */
+ leftchar <<= 8;
+ leftbits += 8;
+
+ /* See if there are 6-bit groups ready */
+ while ( leftbits >= 6 ) {
+ this_ch = (leftchar >> (leftbits-6)) & 0x3f;
+ leftbits -= 6;
+ if (backtick && !this_ch)
+ *ascii_data++ = '`';
+ else
+ *ascii_data++ = this_ch + ' ';
+ }
+ }
+ *ascii_data++ = '\n'; /* Append a courtesy newline */
+
+ return _PyBytesWriter_Finish(&writer, ascii_data);
+}
+
+/*[clinic input]
+binascii.a2b_base64
+
+ data: ascii_buffer
+ /
+ *
+ strict_mode: bool = False
+
+Decode a line of base64 data.
+
+ strict_mode
+ When set to True, bytes that are not part of the base64 standard are not allowed.
+ The same applies to excess data after padding (= / ==).
+[clinic start generated code]*/
+
+static PyObject *
+binascii_a2b_base64_impl(PyObject *module, Py_buffer *data, int strict_mode)
+/*[clinic end generated code: output=5409557788d4f975 input=c0c15fd0f8f9a62d]*/
+{
+ assert(data->len >= 0);
+
+ const unsigned char *ascii_data = data->buf;
+ size_t ascii_len = data->len;
+ binascii_state *state = NULL;
+ char padding_started = 0;
+
+ /* Allocate the buffer */
+ Py_ssize_t bin_len = ((ascii_len+3)/4)*3; /* Upper bound, corrected later */
+ _PyBytesWriter writer;
+ _PyBytesWriter_Init(&writer);
+ unsigned char *bin_data = _PyBytesWriter_Alloc(&writer, bin_len);
+ if (bin_data == NULL)
+ return NULL;
+ unsigned char *bin_data_start = bin_data;
+
+ if (strict_mode && ascii_len > 0 && ascii_data[0] == '=') {
+ state = get_binascii_state(module);
+ if (state) {
+ PyErr_SetString(state->Error, "Leading padding not allowed");
+ }
+ goto error_end;
+ }
+
+ int quad_pos = 0;
+ unsigned char leftchar = 0;
+ int pads = 0;
+ for (size_t i = 0; i < ascii_len; i++) {
+ unsigned char this_ch = ascii_data[i];
+
+ /* Check for pad sequences and ignore
+ ** the invalid ones.
+ */
+ if (this_ch == BASE64_PAD) {
+ padding_started = 1;
+
+ if (quad_pos >= 2 && quad_pos + ++pads >= 4) {
+ /* A pad sequence means we should not parse more input.
+ ** We've already interpreted the data from the quad at this point.
+ ** in strict mode, an error should raise if there's excess data after the padding.
+ */
+ if (strict_mode && i + 1 < ascii_len) {
+ state = get_binascii_state(module);
+ if (state) {
+ PyErr_SetString(state->Error, "Excess data after padding");
+ }
+ goto error_end;
+ }
+
+ goto done;
+ }
+ continue;
+ }
+
+ this_ch = table_a2b_base64[this_ch];
+ if (this_ch >= 64) {
+ if (strict_mode) {
+ state = get_binascii_state(module);
+ if (state) {
+ PyErr_SetString(state->Error, "Only base64 data is allowed");
+ }
+ goto error_end;
+ }
+ continue;
+ }
+
+ // Characters that are not '=', in the middle of the padding, are not allowed
+ if (strict_mode && padding_started) {
+ state = get_binascii_state(module);
+ if (state) {
+ PyErr_SetString(state->Error, "Discontinuous padding not allowed");
+ }
+ goto error_end;
+ }
+ pads = 0;
+
+ switch (quad_pos) {
+ case 0:
+ quad_pos = 1;
+ leftchar = this_ch;
+ break;
+ case 1:
+ quad_pos = 2;
+ *bin_data++ = (leftchar << 2) | (this_ch >> 4);
+ leftchar = this_ch & 0x0f;
+ break;
+ case 2:
+ quad_pos = 3;
+ *bin_data++ = (leftchar << 4) | (this_ch >> 2);
+ leftchar = this_ch & 0x03;
+ break;
+ case 3:
+ quad_pos = 0;
+ *bin_data++ = (leftchar << 6) | (this_ch);
+ leftchar = 0;
+ break;
+ }
+ }
+
+ if (quad_pos != 0) {
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ /* error already set, from get_binascii_state */
+ } else if (quad_pos == 1) {
+ /*
+ ** There is exactly one extra valid, non-padding, base64 character.
+ ** This is an invalid length, as there is no possible input that
+ ** could encoded into such a base64 string.
+ */
+ PyErr_Format(state->Error,
+ "Invalid base64-encoded string: "
+ "number of data characters (%zd) cannot be 1 more "
+ "than a multiple of 4",
+ (bin_data - bin_data_start) / 3 * 4 + 1);
+ } else {
+ PyErr_SetString(state->Error, "Incorrect padding");
+ }
+ error_end:
+ _PyBytesWriter_Dealloc(&writer);
+ return NULL;
+ }
+
+done:
+ return _PyBytesWriter_Finish(&writer, bin_data);
+}
+
+
+/*[clinic input]
+binascii.b2a_base64
+
+ data: Py_buffer
+ /
+ *
+ newline: bool = True
+
+Base64-code line of data.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_b2a_base64_impl(PyObject *module, Py_buffer *data, int newline)
+/*[clinic end generated code: output=4ad62c8e8485d3b3 input=0e20ff59c5f2e3e1]*/
+{
+ unsigned char *ascii_data;
+ const unsigned char *bin_data;
+ int leftbits = 0;
+ unsigned char this_ch;
+ unsigned int leftchar = 0;
+ Py_ssize_t bin_len, out_len;
+ _PyBytesWriter writer;
+ binascii_state *state;
+
+ bin_data = data->buf;
+ bin_len = data->len;
+ _PyBytesWriter_Init(&writer);
+
+ assert(bin_len >= 0);
+
+ if ( bin_len > BASE64_MAXBIN ) {
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyErr_SetString(state->Error, "Too much data for base64 line");
+ return NULL;
+ }
+
+ /* We're lazy and allocate too much (fixed up later).
+ "+2" leaves room for up to two pad characters.
+ Note that 'b' gets encoded as 'Yg==\n' (1 in, 5 out). */
+ out_len = bin_len*2 + 2;
+ if (newline)
+ out_len++;
+ ascii_data = _PyBytesWriter_Alloc(&writer, out_len);
+ if (ascii_data == NULL)
+ return NULL;
+
+ for( ; bin_len > 0 ; bin_len--, bin_data++ ) {
+ /* Shift the data into our buffer */
+ leftchar = (leftchar << 8) | *bin_data;
+ leftbits += 8;
+
+ /* See if there are 6-bit groups ready */
+ while ( leftbits >= 6 ) {
+ this_ch = (leftchar >> (leftbits-6)) & 0x3f;
+ leftbits -= 6;
+ *ascii_data++ = table_b2a_base64[this_ch];
+ }
+ }
+ if ( leftbits == 2 ) {
+ *ascii_data++ = table_b2a_base64[(leftchar&3) << 4];
+ *ascii_data++ = BASE64_PAD;
+ *ascii_data++ = BASE64_PAD;
+ } else if ( leftbits == 4 ) {
+ *ascii_data++ = table_b2a_base64[(leftchar&0xf) << 2];
+ *ascii_data++ = BASE64_PAD;
+ }
+ if (newline)
+ *ascii_data++ = '\n'; /* Append a courtesy newline */
+
+ return _PyBytesWriter_Finish(&writer, ascii_data);
+}
+
+
+/*[clinic input]
+binascii.crc_hqx
+
+ data: Py_buffer
+ crc: unsigned_int(bitwise=True)
+ /
+
+Compute CRC-CCITT incrementally.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc)
+/*[clinic end generated code: output=2fde213d0f547a98 input=56237755370a951c]*/
+{
+ const unsigned char *bin_data;
+ Py_ssize_t len;
+
+ crc &= 0xffff;
+ bin_data = data->buf;
+ len = data->len;
+
+ while(len-- > 0) {
+ crc = ((crc<<8)&0xff00) ^ crctab_hqx[(crc>>8)^*bin_data++];
+ }
+
+ return PyLong_FromUnsignedLong(crc);
+}
+
+#ifndef USE_ZLIB_CRC32
+/* Crc - 32 BIT ANSI X3.66 CRC checksum files
+ Also known as: ISO 3307
+**********************************************************************|
+* *|
+* Demonstration program to compute the 32-bit CRC used as the frame *|
+* check sequence in ADCCP (ANSI X3.66, also known as FIPS PUB 71 *|
+* and FED-STD-1003, the U.S. versions of CCITT's X.25 link-level *|
+* protocol). The 32-bit FCS was added via the Federal Register, *|
+* 1 June 1982, p.23798. I presume but don't know for certain that *|
+* this polynomial is or will be included in CCITT V.41, which *|
+* defines the 16-bit CRC (often called CRC-CCITT) polynomial. FIPS *|
+* PUB 78 says that the 32-bit FCS reduces otherwise undetected *|
+* errors by a factor of 10^-5 over 16-bit FCS. *|
+* *|
+**********************************************************************|
+
+ Copyright (C) 1986 Gary S. Brown. You may use this program, or
+ code or tables extracted from it, as desired without restriction.
+
+ First, the polynomial itself and its table of feedback terms. The
+ polynomial is
+ X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
+ Note that we take it "backwards" and put the highest-order term in
+ the lowest-order bit. The X^32 term is "implied"; the LSB is the
+ X^31 term, etc. The X^0 term (usually shown as "+1") results in
+ the MSB being 1.
+
+ Note that the usual hardware shift register implementation, which
+ is what we're using (we're merely optimizing it by doing eight-bit
+ chunks at a time) shifts bits into the lowest-order term. In our
+ implementation, that means shifting towards the right. Why do we
+ do it this way? Because the calculated CRC must be transmitted in
+ order from highest-order term to lowest-order term. UARTs transmit
+ characters in order from LSB to MSB. By storing the CRC this way,
+ we hand it to the UART in the order low-byte to high-byte; the UART
+ sends each low-bit to hight-bit; and the result is transmission bit
+ by bit from highest- to lowest-order term without requiring any bit
+ shuffling on our part. Reception works similarly.
+
+ The feedback terms table consists of 256, 32-bit entries. Notes:
+
+ 1. The table can be generated at runtime if desired; code to do so
+ is shown later. It might not be obvious, but the feedback
+ terms simply represent the results of eight shift/xor opera-
+ tions for all combinations of data and CRC register values.
+
+ 2. The CRC accumulation logic is the same for all CRC polynomials,
+ be they sixteen or thirty-two bits wide. You simply choose the
+ appropriate table. Alternatively, because the table can be
+ generated at runtime, you can start by generating the table for
+ the polynomial in question and use exactly the same "updcrc",
+ if your application needn't simultaneously handle two CRC
+ polynomials. (Note, however, that XMODEM is strange.)
+
+ 3. For 16-bit CRCs, the table entries need be only 16 bits wide;
+ of course, 32-bit entries work OK if the high 16 bits are zero.
+
+ 4. The values must be right-shifted by eight bits by the "updcrc"
+ logic; the shift must be unsigned (bring in zeroes). On some
+ hardware you could probably optimize the shift in assembler by
+ using byte-swap instructions.
+********************************************************************/
+
+static const unsigned int crc_32_tab[256] = {
+0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,
+0x706af48fU, 0xe963a535U, 0x9e6495a3U, 0x0edb8832U, 0x79dcb8a4U,
+0xe0d5e91eU, 0x97d2d988U, 0x09b64c2bU, 0x7eb17cbdU, 0xe7b82d07U,
+0x90bf1d91U, 0x1db71064U, 0x6ab020f2U, 0xf3b97148U, 0x84be41deU,
+0x1adad47dU, 0x6ddde4ebU, 0xf4d4b551U, 0x83d385c7U, 0x136c9856U,
+0x646ba8c0U, 0xfd62f97aU, 0x8a65c9ecU, 0x14015c4fU, 0x63066cd9U,
+0xfa0f3d63U, 0x8d080df5U, 0x3b6e20c8U, 0x4c69105eU, 0xd56041e4U,
+0xa2677172U, 0x3c03e4d1U, 0x4b04d447U, 0xd20d85fdU, 0xa50ab56bU,
+0x35b5a8faU, 0x42b2986cU, 0xdbbbc9d6U, 0xacbcf940U, 0x32d86ce3U,
+0x45df5c75U, 0xdcd60dcfU, 0xabd13d59U, 0x26d930acU, 0x51de003aU,
+0xc8d75180U, 0xbfd06116U, 0x21b4f4b5U, 0x56b3c423U, 0xcfba9599U,
+0xb8bda50fU, 0x2802b89eU, 0x5f058808U, 0xc60cd9b2U, 0xb10be924U,
+0x2f6f7c87U, 0x58684c11U, 0xc1611dabU, 0xb6662d3dU, 0x76dc4190U,
+0x01db7106U, 0x98d220bcU, 0xefd5102aU, 0x71b18589U, 0x06b6b51fU,
+0x9fbfe4a5U, 0xe8b8d433U, 0x7807c9a2U, 0x0f00f934U, 0x9609a88eU,
+0xe10e9818U, 0x7f6a0dbbU, 0x086d3d2dU, 0x91646c97U, 0xe6635c01U,
+0x6b6b51f4U, 0x1c6c6162U, 0x856530d8U, 0xf262004eU, 0x6c0695edU,
+0x1b01a57bU, 0x8208f4c1U, 0xf50fc457U, 0x65b0d9c6U, 0x12b7e950U,
+0x8bbeb8eaU, 0xfcb9887cU, 0x62dd1ddfU, 0x15da2d49U, 0x8cd37cf3U,
+0xfbd44c65U, 0x4db26158U, 0x3ab551ceU, 0xa3bc0074U, 0xd4bb30e2U,
+0x4adfa541U, 0x3dd895d7U, 0xa4d1c46dU, 0xd3d6f4fbU, 0x4369e96aU,
+0x346ed9fcU, 0xad678846U, 0xda60b8d0U, 0x44042d73U, 0x33031de5U,
+0xaa0a4c5fU, 0xdd0d7cc9U, 0x5005713cU, 0x270241aaU, 0xbe0b1010U,
+0xc90c2086U, 0x5768b525U, 0x206f85b3U, 0xb966d409U, 0xce61e49fU,
+0x5edef90eU, 0x29d9c998U, 0xb0d09822U, 0xc7d7a8b4U, 0x59b33d17U,
+0x2eb40d81U, 0xb7bd5c3bU, 0xc0ba6cadU, 0xedb88320U, 0x9abfb3b6U,
+0x03b6e20cU, 0x74b1d29aU, 0xead54739U, 0x9dd277afU, 0x04db2615U,
+0x73dc1683U, 0xe3630b12U, 0x94643b84U, 0x0d6d6a3eU, 0x7a6a5aa8U,
+0xe40ecf0bU, 0x9309ff9dU, 0x0a00ae27U, 0x7d079eb1U, 0xf00f9344U,
+0x8708a3d2U, 0x1e01f268U, 0x6906c2feU, 0xf762575dU, 0x806567cbU,
+0x196c3671U, 0x6e6b06e7U, 0xfed41b76U, 0x89d32be0U, 0x10da7a5aU,
+0x67dd4accU, 0xf9b9df6fU, 0x8ebeeff9U, 0x17b7be43U, 0x60b08ed5U,
+0xd6d6a3e8U, 0xa1d1937eU, 0x38d8c2c4U, 0x4fdff252U, 0xd1bb67f1U,
+0xa6bc5767U, 0x3fb506ddU, 0x48b2364bU, 0xd80d2bdaU, 0xaf0a1b4cU,
+0x36034af6U, 0x41047a60U, 0xdf60efc3U, 0xa867df55U, 0x316e8eefU,
+0x4669be79U, 0xcb61b38cU, 0xbc66831aU, 0x256fd2a0U, 0x5268e236U,
+0xcc0c7795U, 0xbb0b4703U, 0x220216b9U, 0x5505262fU, 0xc5ba3bbeU,
+0xb2bd0b28U, 0x2bb45a92U, 0x5cb36a04U, 0xc2d7ffa7U, 0xb5d0cf31U,
+0x2cd99e8bU, 0x5bdeae1dU, 0x9b64c2b0U, 0xec63f226U, 0x756aa39cU,
+0x026d930aU, 0x9c0906a9U, 0xeb0e363fU, 0x72076785U, 0x05005713U,
+0x95bf4a82U, 0xe2b87a14U, 0x7bb12baeU, 0x0cb61b38U, 0x92d28e9bU,
+0xe5d5be0dU, 0x7cdcefb7U, 0x0bdbdf21U, 0x86d3d2d4U, 0xf1d4e242U,
+0x68ddb3f8U, 0x1fda836eU, 0x81be16cdU, 0xf6b9265bU, 0x6fb077e1U,
+0x18b74777U, 0x88085ae6U, 0xff0f6a70U, 0x66063bcaU, 0x11010b5cU,
+0x8f659effU, 0xf862ae69U, 0x616bffd3U, 0x166ccf45U, 0xa00ae278U,
+0xd70dd2eeU, 0x4e048354U, 0x3903b3c2U, 0xa7672661U, 0xd06016f7U,
+0x4969474dU, 0x3e6e77dbU, 0xaed16a4aU, 0xd9d65adcU, 0x40df0b66U,
+0x37d83bf0U, 0xa9bcae53U, 0xdebb9ec5U, 0x47b2cf7fU, 0x30b5ffe9U,
+0xbdbdf21cU, 0xcabac28aU, 0x53b39330U, 0x24b4a3a6U, 0xbad03605U,
+0xcdd70693U, 0x54de5729U, 0x23d967bfU, 0xb3667a2eU, 0xc4614ab8U,
+0x5d681b02U, 0x2a6f2b94U, 0xb40bbe37U, 0xc30c8ea1U, 0x5a05df1bU,
+0x2d02ef8dU
+};
+
+static unsigned int
+internal_crc32(const unsigned char *bin_data, Py_ssize_t len, unsigned int crc)
+{ /* By Jim Ahlstrom; All rights transferred to CNRI */
+ unsigned int result;
+
+ crc = ~ crc;
+ while (len-- > 0) {
+ crc = crc_32_tab[(crc ^ *bin_data++) & 0xff] ^ (crc >> 8);
+ /* Note: (crc >> 8) MUST zero fill on left */
+ }
+
+ result = (crc ^ 0xFFFFFFFF);
+ return result & 0xffffffff;
+}
+#endif /* USE_ZLIB_CRC32 */
+
+/*[clinic input]
+binascii.crc32 -> unsigned_int
+
+ data: Py_buffer
+ crc: unsigned_int(bitwise=True) = 0
+ /
+
+Compute CRC-32 incrementally.
+[clinic start generated code]*/
+
+static unsigned int
+binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc)
+/*[clinic end generated code: output=52cf59056a78593b input=bbe340bc99d25aa8]*/
+
+#ifdef USE_ZLIB_CRC32
+/* This is the same as zlibmodule.c zlib_crc32_impl. It exists in two
+ * modules for historical reasons. */
+{
+ /* Releasing the GIL for very small buffers is inefficient
+ and may lower performance */
+ if (data->len > 1024*5) {
+ unsigned char *buf = data->buf;
+ Py_ssize_t len = data->len;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* Avoid truncation of length for very large buffers. crc32() takes
+ length as an unsigned int, which may be narrower than Py_ssize_t.
+ We further limit size due to bugs in Apple's macOS zlib.
+ See https://github.com/python/cpython/issues/105967
+ */
+#define ZLIB_CRC_CHUNK_SIZE 0x40000000
+#if ZLIB_CRC_CHUNK_SIZE > INT_MAX
+# error "unsupported less than 32-bit platform?"
+#endif
+ while ((size_t)len > ZLIB_CRC_CHUNK_SIZE) {
+ crc = crc32(crc, buf, ZLIB_CRC_CHUNK_SIZE);
+ buf += (size_t) ZLIB_CRC_CHUNK_SIZE;
+ len -= (size_t) ZLIB_CRC_CHUNK_SIZE;
+ }
+#undef ZLIB_CRC_CHUNK_SIZE
+ crc = crc32(crc, buf, (unsigned int)len);
+ Py_END_ALLOW_THREADS
+ } else {
+ crc = crc32(crc, data->buf, (unsigned int)data->len);
+ }
+ return crc & 0xffffffff;
+}
+#else /* USE_ZLIB_CRC32 */
+{
+ const unsigned char *bin_data = data->buf;
+ Py_ssize_t len = data->len;
+
+ /* Releasing the GIL for very small buffers is inefficient
+ and may lower performance */
+ if (len > 1024*5) {
+ unsigned int result;
+ Py_BEGIN_ALLOW_THREADS
+ result = internal_crc32(bin_data, len, crc);
+ Py_END_ALLOW_THREADS
+ return result;
+ } else {
+ return internal_crc32(bin_data, len, crc);
+ }
+}
+#endif /* USE_ZLIB_CRC32 */
+
+/*[clinic input]
+binascii.b2a_hex
+
+ data: Py_buffer
+ sep: object = NULL
+ An optional single character or byte to separate hex bytes.
+ bytes_per_sep: int = 1
+ How many bytes between separators. Positive values count from the
+ right, negative values count from the left.
+
+Hexadecimal representation of binary data.
+
+The return value is a bytes object. This function is also
+available as "hexlify()".
+
+Example:
+>>> binascii.b2a_hex(b'\xb9\x01\xef')
+b'b901ef'
+>>> binascii.hexlify(b'\xb9\x01\xef', ':')
+b'b9:01:ef'
+>>> binascii.b2a_hex(b'\xb9\x01\xef', b'_', 2)
+b'b9_01ef'
+[clinic start generated code]*/
+
+static PyObject *
+binascii_b2a_hex_impl(PyObject *module, Py_buffer *data, PyObject *sep,
+ int bytes_per_sep)
+/*[clinic end generated code: output=a26937946a81d2c7 input=ec0ade6ba2e43543]*/
+{
+ return _Py_strhex_bytes_with_sep((const char *)data->buf, data->len,
+ sep, bytes_per_sep);
+}
+
+/*[clinic input]
+binascii.hexlify = binascii.b2a_hex
+
+Hexadecimal representation of binary data.
+
+The return value is a bytes object. This function is also
+available as "b2a_hex()".
+[clinic start generated code]*/
+
+static PyObject *
+binascii_hexlify_impl(PyObject *module, Py_buffer *data, PyObject *sep,
+ int bytes_per_sep)
+/*[clinic end generated code: output=d12aa1b001b15199 input=bc317bd4e241f76b]*/
+{
+ return _Py_strhex_bytes_with_sep((const char *)data->buf, data->len,
+ sep, bytes_per_sep);
+}
+
+/*[clinic input]
+binascii.a2b_hex
+
+ hexstr: ascii_buffer
+ /
+
+Binary data of hexadecimal representation.
+
+hexstr must contain an even number of hex digits (upper or lower case).
+This function is also available as "unhexlify()".
+[clinic start generated code]*/
+
+static PyObject *
+binascii_a2b_hex_impl(PyObject *module, Py_buffer *hexstr)
+/*[clinic end generated code: output=0cc1a139af0eeecb input=9e1e7f2f94db24fd]*/
+{
+ const char* argbuf;
+ Py_ssize_t arglen;
+ PyObject *retval;
+ char* retbuf;
+ Py_ssize_t i, j;
+ binascii_state *state;
+
+ argbuf = hexstr->buf;
+ arglen = hexstr->len;
+
+ assert(arglen >= 0);
+
+ /* XXX What should we do about strings with an odd length? Should
+ * we add an implicit leading zero, or a trailing zero? For now,
+ * raise an exception.
+ */
+ if (arglen % 2) {
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyErr_SetString(state->Error, "Odd-length string");
+ return NULL;
+ }
+
+ retval = PyBytes_FromStringAndSize(NULL, (arglen/2));
+ if (!retval)
+ return NULL;
+ retbuf = PyBytes_AS_STRING(retval);
+
+ for (i=j=0; i < arglen; i += 2) {
+ unsigned int top = _PyLong_DigitValue[Py_CHARMASK(argbuf[i])];
+ unsigned int bot = _PyLong_DigitValue[Py_CHARMASK(argbuf[i+1])];
+ if (top >= 16 || bot >= 16) {
+ state = get_binascii_state(module);
+ if (state == NULL) {
+ return NULL;
+ }
+ PyErr_SetString(state->Error,
+ "Non-hexadecimal digit found");
+ goto finally;
+ }
+ retbuf[j++] = (top << 4) + bot;
+ }
+ return retval;
+
+ finally:
+ Py_DECREF(retval);
+ return NULL;
+}
+
+/*[clinic input]
+binascii.unhexlify = binascii.a2b_hex
+
+Binary data of hexadecimal representation.
+
+hexstr must contain an even number of hex digits (upper or lower case).
+[clinic start generated code]*/
+
+static PyObject *
+binascii_unhexlify_impl(PyObject *module, Py_buffer *hexstr)
+/*[clinic end generated code: output=51a64c06c79629e3 input=dd8c012725f462da]*/
+{
+ return binascii_a2b_hex_impl(module, hexstr);
+}
+
+#define MAXLINESIZE 76
+
+
+/*[clinic input]
+binascii.a2b_qp
+
+ data: ascii_buffer
+ header: bool = False
+
+Decode a string of qp-encoded data.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_a2b_qp_impl(PyObject *module, Py_buffer *data, int header)
+/*[clinic end generated code: output=e99f7846cfb9bc53 input=bdfb31598d4e47b9]*/
+{
+ Py_ssize_t in, out;
+ char ch;
+ const unsigned char *ascii_data;
+ unsigned char *odata;
+ Py_ssize_t datalen = 0;
+ PyObject *rv;
+
+ ascii_data = data->buf;
+ datalen = data->len;
+
+ /* We allocate the output same size as input, this is overkill.
+ */
+ odata = (unsigned char *) PyMem_Calloc(1, datalen);
+ if (odata == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ in = out = 0;
+ while (in < datalen) {
+ if (ascii_data[in] == '=') {
+ in++;
+ if (in >= datalen) break;
+ /* Soft line breaks */
+ if ((ascii_data[in] == '\n') || (ascii_data[in] == '\r')) {
+ if (ascii_data[in] != '\n') {
+ while (in < datalen && ascii_data[in] != '\n') in++;
+ }
+ if (in < datalen) in++;
+ }
+ else if (ascii_data[in] == '=') {
+ /* broken case from broken python qp */
+ odata[out++] = '=';
+ in++;
+ }
+ else if ((in + 1 < datalen) &&
+ ((ascii_data[in] >= 'A' && ascii_data[in] <= 'F') ||
+ (ascii_data[in] >= 'a' && ascii_data[in] <= 'f') ||
+ (ascii_data[in] >= '0' && ascii_data[in] <= '9')) &&
+ ((ascii_data[in+1] >= 'A' && ascii_data[in+1] <= 'F') ||
+ (ascii_data[in+1] >= 'a' && ascii_data[in+1] <= 'f') ||
+ (ascii_data[in+1] >= '0' && ascii_data[in+1] <= '9'))) {
+ /* hexval */
+ ch = _PyLong_DigitValue[ascii_data[in]] << 4;
+ in++;
+ ch |= _PyLong_DigitValue[ascii_data[in]];
+ in++;
+ odata[out++] = ch;
+ }
+ else {
+ odata[out++] = '=';
+ }
+ }
+ else if (header && ascii_data[in] == '_') {
+ odata[out++] = ' ';
+ in++;
+ }
+ else {
+ odata[out] = ascii_data[in];
+ in++;
+ out++;
+ }
+ }
+ rv = PyBytes_FromStringAndSize((char *)odata, out);
+ PyMem_Free(odata);
+ return rv;
+}
+
+static int
+to_hex (unsigned char ch, unsigned char *s)
+{
+ unsigned int uvalue = ch;
+
+ s[1] = "0123456789ABCDEF"[uvalue % 16];
+ uvalue = (uvalue / 16);
+ s[0] = "0123456789ABCDEF"[uvalue % 16];
+ return 0;
+}
+
+/* XXX: This is ridiculously complicated to be backward compatible
+ * (mostly) with the quopri module. It doesn't re-create the quopri
+ * module bug where text ending in CRLF has the CR encoded */
+
+/*[clinic input]
+binascii.b2a_qp
+
+ data: Py_buffer
+ quotetabs: bool = False
+ istext: bool = True
+ header: bool = False
+
+Encode a string using quoted-printable encoding.
+
+On encoding, when istext is set, newlines are not encoded, and white
+space at end of lines is. When istext is not set, \r and \n (CR/LF)
+are both encoded. When quotetabs is set, space and tabs are encoded.
+[clinic start generated code]*/
+
+static PyObject *
+binascii_b2a_qp_impl(PyObject *module, Py_buffer *data, int quotetabs,
+ int istext, int header)
+/*[clinic end generated code: output=e9884472ebb1a94c input=e9102879afb0defd]*/
+{
+ Py_ssize_t in, out;
+ const unsigned char *databuf;
+ unsigned char *odata;
+ Py_ssize_t datalen = 0, odatalen = 0;
+ PyObject *rv;
+ unsigned int linelen = 0;
+ unsigned char ch;
+ int crlf = 0;
+ const unsigned char *p;
+
+ databuf = data->buf;
+ datalen = data->len;
+
+ /* See if this string is using CRLF line ends */
+ /* XXX: this function has the side effect of converting all of
+ * the end of lines to be the same depending on this detection
+ * here */
+ p = (const unsigned char *) memchr(databuf, '\n', datalen);
+ if ((p != NULL) && (p > databuf) && (*(p-1) == '\r'))
+ crlf = 1;
+
+ /* First, scan to see how many characters need to be encoded */
+ in = 0;
+ while (in < datalen) {
+ Py_ssize_t delta = 0;
+ if ((databuf[in] > 126) ||
+ (databuf[in] == '=') ||
+ (header && databuf[in] == '_') ||
+ ((databuf[in] == '.') && (linelen == 0) &&
+ (in + 1 == datalen || databuf[in+1] == '\n' ||
+ databuf[in+1] == '\r' || databuf[in+1] == 0)) ||
+ (!istext && ((databuf[in] == '\r') || (databuf[in] == '\n'))) ||
+ ((databuf[in] == '\t' || databuf[in] == ' ') && (in + 1 == datalen)) ||
+ ((databuf[in] < 33) &&
+ (databuf[in] != '\r') && (databuf[in] != '\n') &&
+ (quotetabs || ((databuf[in] != '\t') && (databuf[in] != ' ')))))
+ {
+ if ((linelen + 3) >= MAXLINESIZE) {
+ linelen = 0;
+ if (crlf)
+ delta += 3;
+ else
+ delta += 2;
+ }
+ linelen += 3;
+ delta += 3;
+ in++;
+ }
+ else {
+ if (istext &&
+ ((databuf[in] == '\n') ||
+ ((in+1 < datalen) && (databuf[in] == '\r') &&
+ (databuf[in+1] == '\n'))))
+ {
+ linelen = 0;
+ /* Protect against whitespace on end of line */
+ if (in && ((databuf[in-1] == ' ') || (databuf[in-1] == '\t')))
+ delta += 2;
+ if (crlf)
+ delta += 2;
+ else
+ delta += 1;
+ if (databuf[in] == '\r')
+ in += 2;
+ else
+ in++;
+ }
+ else {
+ if ((in + 1 != datalen) &&
+ (databuf[in+1] != '\n') &&
+ (linelen + 1) >= MAXLINESIZE) {
+ linelen = 0;
+ if (crlf)
+ delta += 3;
+ else
+ delta += 2;
+ }
+ linelen++;
+ delta++;
+ in++;
+ }
+ }
+ if (PY_SSIZE_T_MAX - delta < odatalen) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ odatalen += delta;
+ }
+
+ /* We allocate the output same size as input, this is overkill.
+ */
+ odata = (unsigned char *) PyMem_Calloc(1, odatalen);
+ if (odata == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ in = out = linelen = 0;
+ while (in < datalen) {
+ if ((databuf[in] > 126) ||
+ (databuf[in] == '=') ||
+ (header && databuf[in] == '_') ||
+ ((databuf[in] == '.') && (linelen == 0) &&
+ (in + 1 == datalen || databuf[in+1] == '\n' ||
+ databuf[in+1] == '\r' || databuf[in+1] == 0)) ||
+ (!istext && ((databuf[in] == '\r') || (databuf[in] == '\n'))) ||
+ ((databuf[in] == '\t' || databuf[in] == ' ') && (in + 1 == datalen)) ||
+ ((databuf[in] < 33) &&
+ (databuf[in] != '\r') && (databuf[in] != '\n') &&
+ (quotetabs || ((databuf[in] != '\t') && (databuf[in] != ' ')))))
+ {
+ if ((linelen + 3 )>= MAXLINESIZE) {
+ odata[out++] = '=';
+ if (crlf) odata[out++] = '\r';
+ odata[out++] = '\n';
+ linelen = 0;
+ }
+ odata[out++] = '=';
+ to_hex(databuf[in], &odata[out]);
+ out += 2;
+ in++;
+ linelen += 3;
+ }
+ else {
+ if (istext &&
+ ((databuf[in] == '\n') ||
+ ((in+1 < datalen) && (databuf[in] == '\r') &&
+ (databuf[in+1] == '\n'))))
+ {
+ linelen = 0;
+ /* Protect against whitespace on end of line */
+ if (out && ((odata[out-1] == ' ') || (odata[out-1] == '\t'))) {
+ ch = odata[out-1];
+ odata[out-1] = '=';
+ to_hex(ch, &odata[out]);
+ out += 2;
+ }
+
+ if (crlf) odata[out++] = '\r';
+ odata[out++] = '\n';
+ if (databuf[in] == '\r')
+ in += 2;
+ else
+ in++;
+ }
+ else {
+ if ((in + 1 != datalen) &&
+ (databuf[in+1] != '\n') &&
+ (linelen + 1) >= MAXLINESIZE) {
+ odata[out++] = '=';
+ if (crlf) odata[out++] = '\r';
+ odata[out++] = '\n';
+ linelen = 0;
+ }
+ linelen++;
+ if (header && databuf[in] == ' ') {
+ odata[out++] = '_';
+ in++;
+ }
+ else {
+ odata[out++] = databuf[in++];
+ }
+ }
+ }
+ }
+ rv = PyBytes_FromStringAndSize((char *)odata, out);
+ PyMem_Free(odata);
+ return rv;
+}
+
+/* List of functions defined in the module */
+
+static struct PyMethodDef binascii_module_methods[] = {
+ BINASCII_A2B_UU_METHODDEF
+ BINASCII_B2A_UU_METHODDEF
+ BINASCII_A2B_BASE64_METHODDEF
+ BINASCII_B2A_BASE64_METHODDEF
+ BINASCII_A2B_HEX_METHODDEF
+ BINASCII_B2A_HEX_METHODDEF
+ BINASCII_HEXLIFY_METHODDEF
+ BINASCII_UNHEXLIFY_METHODDEF
+ BINASCII_CRC_HQX_METHODDEF
+ BINASCII_CRC32_METHODDEF
+ BINASCII_A2B_QP_METHODDEF
+ BINASCII_B2A_QP_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* Initialization function for the module (*must* be called PyInit_binascii) */
+PyDoc_STRVAR(doc_binascii, "Conversion between binary data and ASCII");
+
+static int
+binascii_exec(PyObject *module) {
+ int result;
+ binascii_state *state = PyModule_GetState(module);
+ if (state == NULL) {
+ return -1;
+ }
+
+ state->Error = PyErr_NewException("binascii.Error", PyExc_ValueError, NULL);
+ if (state->Error == NULL) {
+ return -1;
+ }
+ Py_INCREF(state->Error);
+ result = PyModule_AddObject(module, "Error", state->Error);
+ if (result == -1) {
+ Py_DECREF(state->Error);
+ return -1;
+ }
+
+ state->Incomplete = PyErr_NewException("binascii.Incomplete", NULL, NULL);
+ if (state->Incomplete == NULL) {
+ return -1;
+ }
+ Py_INCREF(state->Incomplete);
+ result = PyModule_AddObject(module, "Incomplete", state->Incomplete);
+ if (result == -1) {
+ Py_DECREF(state->Incomplete);
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot binascii_slots[] = {
+ {Py_mod_exec, binascii_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+binascii_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ binascii_state *state = get_binascii_state(module);
+ Py_VISIT(state->Error);
+ Py_VISIT(state->Incomplete);
+ return 0;
+}
+
+static int
+binascii_clear(PyObject *module)
+{
+ binascii_state *state = get_binascii_state(module);
+ Py_CLEAR(state->Error);
+ Py_CLEAR(state->Incomplete);
+ return 0;
+}
+
+static void
+binascii_free(void *module)
+{
+ binascii_clear((PyObject *)module);
+}
+
+static struct PyModuleDef binasciimodule = {
+ PyModuleDef_HEAD_INIT,
+ "binascii",
+ doc_binascii,
+ sizeof(binascii_state),
+ binascii_module_methods,
+ binascii_slots,
+ binascii_traverse,
+ binascii_clear,
+ binascii_free
+};
+
+PyMODINIT_FUNC
+PyInit_binascii(void)
+{
+ return PyModuleDef_Init(&binasciimodule);
+}
diff --git a/contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c
new file mode 100644
index 00000000000..e2c7908c9bb
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_cn.c
@@ -0,0 +1,470 @@
+/*
+ * _codecs_cn.c: Codecs collection for Mainland Chinese encodings
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#include "cjkcodecs.h"
+#include "mappings_cn.h"
+
+/**
+ * hz is predefined as 100 on AIX. So we undefine it to avoid
+ * conflict against hz codec's.
+ */
+#ifdef _AIX
+#undef hz
+#endif
+
+/* GBK and GB2312 map differently in few code points that are listed below:
+ *
+ * gb2312 gbk
+ * A1A4 U+30FB KATAKANA MIDDLE DOT U+00B7 MIDDLE DOT
+ * A1AA U+2015 HORIZONTAL BAR U+2014 EM DASH
+ * A844 undefined U+2015 HORIZONTAL BAR
+ */
+
+#define GBK_DECODE(dc1, dc2, writer) \
+ if ((dc1) == 0xa1 && (dc2) == 0xaa) { \
+ OUTCHAR(0x2014); \
+ } \
+ else if ((dc1) == 0xa8 && (dc2) == 0x44) { \
+ OUTCHAR(0x2015); \
+ } \
+ else if ((dc1) == 0xa1 && (dc2) == 0xa4) { \
+ OUTCHAR(0x00b7); \
+ } \
+ else if (TRYMAP_DEC(gb2312, decoded, dc1 ^ 0x80, dc2 ^ 0x80)) { \
+ OUTCHAR(decoded); \
+ } \
+ else if (TRYMAP_DEC(gbkext, decoded, dc1, dc2)) { \
+ OUTCHAR(decoded); \
+ }
+
+#define GBK_ENCODE(code, assi) \
+ if ((code) == 0x2014) { \
+ (assi) = 0xa1aa; \
+ } else if ((code) == 0x2015) { \
+ (assi) = 0xa844; \
+ } else if ((code) == 0x00b7) { \
+ (assi) = 0xa1a4; \
+ } else if ((code) != 0x30fb && TRYMAP_ENC(gbcommon, assi, code)) { \
+ ; \
+ }
+
+/*
+ * codecs in this file use the first byte of MultibyteCodec_State.c[8]
+ * to store a 0 or 1 state value
+ */
+#define CN_STATE_OFFSET 0
+
+/*
+ * GB2312 codec
+ */
+
+ENCODER(gb2312)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+ if (TRYMAP_ENC(gbcommon, code, c))
+ ;
+ else
+ return 1;
+
+ if (code & 0x8000) /* MSB set: GBK */
+ return 1;
+
+ OUTBYTE1((code >> 8) | 0x80);
+ OUTBYTE2((code & 0xFF) | 0x80);
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(gb2312)
+{
+ while (inleft > 0) {
+ unsigned char c = **inbuf;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+ if (TRYMAP_DEC(gb2312, decoded, c ^ 0x80, INBYTE2 ^ 0x80)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ }
+ else
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * GBK codec
+ */
+
+ENCODER(gbk)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+
+ GBK_ENCODE(c, code)
+ else
+ return 1;
+
+ OUTBYTE1((code >> 8) | 0x80);
+ if (code & 0x8000)
+ OUTBYTE2((code & 0xFF)); /* MSB set: GBK */
+ else
+ OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: GB2312 */
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(gbk)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+
+ GBK_DECODE(c, INBYTE2, writer)
+ else
+ return 1;
+
+ NEXT_IN(2);
+ }
+
+ return 0;
+}
+
+
+/*
+ * GB18030 codec
+ */
+
+ENCODER(gb18030)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1(c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c >= 0x10000) {
+ Py_UCS4 tc = c - 0x10000;
+ assert (c <= 0x10FFFF);
+
+ REQUIRE_OUTBUF(4);
+
+ OUTBYTE4((unsigned char)(tc % 10) + 0x30);
+ tc /= 10;
+ OUTBYTE3((unsigned char)(tc % 126) + 0x81);
+ tc /= 126;
+ OUTBYTE2((unsigned char)(tc % 10) + 0x30);
+ tc /= 10;
+ OUTBYTE1((unsigned char)(tc + 0x90));
+
+ NEXT(1, 4);
+ continue;
+ }
+
+ REQUIRE_OUTBUF(2);
+
+ GBK_ENCODE(c, code)
+ else if (TRYMAP_ENC(gb18030ext, code, c))
+ ;
+ else {
+ const struct _gb18030_to_unibmp_ranges *utrrange;
+
+ REQUIRE_OUTBUF(4);
+
+ for (utrrange = gb18030_to_unibmp_ranges;
+ utrrange->first != 0;
+ utrrange++)
+ if (utrrange->first <= c &&
+ c <= utrrange->last) {
+ Py_UCS4 tc;
+
+ tc = c - utrrange->first +
+ utrrange->base;
+
+ OUTBYTE4((unsigned char)(tc % 10) + 0x30);
+ tc /= 10;
+ OUTBYTE3((unsigned char)(tc % 126) + 0x81);
+ tc /= 126;
+ OUTBYTE2((unsigned char)(tc % 10) + 0x30);
+ tc /= 10;
+ OUTBYTE1((unsigned char)tc + 0x81);
+
+ NEXT(1, 4);
+ break;
+ }
+
+ if (utrrange->first == 0)
+ return 1;
+ continue;
+ }
+
+ OUTBYTE1((code >> 8) | 0x80);
+ if (code & 0x8000)
+ OUTBYTE2((code & 0xFF)); /* MSB set: GBK or GB18030ext */
+ else
+ OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: GB2312 */
+
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(gb18030)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1, c2;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+
+ c2 = INBYTE2;
+ if (c2 >= 0x30 && c2 <= 0x39) { /* 4 bytes seq */
+ const struct _gb18030_to_unibmp_ranges *utr;
+ unsigned char c3, c4;
+ Py_UCS4 lseq;
+
+ REQUIRE_INBUF(4);
+ c3 = INBYTE3;
+ c4 = INBYTE4;
+ if (c < 0x81 || c > 0xFE ||
+ c3 < 0x81 || c3 > 0xFE ||
+ c4 < 0x30 || c4 > 0x39)
+ return 1;
+ c -= 0x81; c2 -= 0x30;
+ c3 -= 0x81; c4 -= 0x30;
+
+ if (c < 4) { /* U+0080 - U+FFFF */
+ lseq = ((Py_UCS4)c * 10 + c2) * 1260 +
+ (Py_UCS4)c3 * 10 + c4;
+ if (lseq < 39420) {
+ for (utr = gb18030_to_unibmp_ranges;
+ lseq >= (utr + 1)->base;
+ utr++) ;
+ OUTCHAR(utr->first - utr->base + lseq);
+ NEXT_IN(4);
+ continue;
+ }
+ }
+ else if (c >= 15) { /* U+10000 - U+10FFFF */
+ lseq = 0x10000 + (((Py_UCS4)c-15) * 10 + c2)
+ * 1260 + (Py_UCS4)c3 * 10 + c4;
+ if (lseq <= 0x10FFFF) {
+ OUTCHAR(lseq);
+ NEXT_IN(4);
+ continue;
+ }
+ }
+ return 1;
+ }
+
+ GBK_DECODE(c, c2, writer)
+ else if (TRYMAP_DEC(gb18030ext, decoded, c, c2))
+ OUTCHAR(decoded);
+ else
+ return 1;
+
+ NEXT_IN(2);
+ }
+
+ return 0;
+}
+
+
+/*
+ * HZ codec
+ */
+
+ENCODER_INIT(hz)
+{
+ state->c[CN_STATE_OFFSET] = 0;
+ return 0;
+}
+
+ENCODER_RESET(hz)
+{
+ if (state->c[CN_STATE_OFFSET] != 0) {
+ WRITEBYTE2('~', '}');
+ state->c[CN_STATE_OFFSET] = 0;
+ NEXT_OUT(2);
+ }
+ return 0;
+}
+
+ENCODER(hz)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ if (state->c[CN_STATE_OFFSET]) {
+ WRITEBYTE2('~', '}');
+ NEXT_OUT(2);
+ state->c[CN_STATE_OFFSET] = 0;
+ }
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ if (c == '~') {
+ WRITEBYTE1('~');
+ NEXT_OUT(1);
+ }
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ if (TRYMAP_ENC(gbcommon, code, c))
+ ;
+ else
+ return 1;
+
+ if (code & 0x8000) /* MSB set: GBK */
+ return 1;
+
+ if (state->c[CN_STATE_OFFSET] == 0) {
+ WRITEBYTE4('~', '{', code >> 8, code & 0xff);
+ NEXT(1, 4);
+ state->c[CN_STATE_OFFSET] = 1;
+ }
+ else {
+ WRITEBYTE2(code >> 8, code & 0xff);
+ NEXT(1, 2);
+ }
+ }
+
+ return 0;
+}
+
+DECODER_INIT(hz)
+{
+ state->c[CN_STATE_OFFSET] = 0;
+ return 0;
+}
+
+DECODER_RESET(hz)
+{
+ state->c[CN_STATE_OFFSET] = 0;
+ return 0;
+}
+
+DECODER(hz)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c == '~') {
+ unsigned char c2 = INBYTE2;
+
+ REQUIRE_INBUF(2);
+ if (c2 == '~' && state->c[CN_STATE_OFFSET] == 0)
+ OUTCHAR('~');
+ else if (c2 == '{' && state->c[CN_STATE_OFFSET] == 0)
+ state->c[CN_STATE_OFFSET] = 1; /* set GB */
+ else if (c2 == '\n' && state->c[CN_STATE_OFFSET] == 0)
+ ; /* line-continuation */
+ else if (c2 == '}' && state->c[CN_STATE_OFFSET] == 1)
+ state->c[CN_STATE_OFFSET] = 0; /* set ASCII */
+ else
+ return 1;
+ NEXT_IN(2);
+ continue;
+ }
+
+ if (c & 0x80)
+ return 1;
+
+ if (state->c[CN_STATE_OFFSET] == 0) { /* ASCII mode */
+ OUTCHAR(c);
+ NEXT_IN(1);
+ }
+ else { /* GB mode */
+ REQUIRE_INBUF(2);
+ if (TRYMAP_DEC(gb2312, decoded, c, INBYTE2)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ }
+ else
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+BEGIN_MAPPINGS_LIST(4)
+ MAPPING_DECONLY(gb2312)
+ MAPPING_DECONLY(gbkext)
+ MAPPING_ENCONLY(gbcommon)
+ MAPPING_ENCDEC(gb18030ext)
+END_MAPPINGS_LIST
+
+BEGIN_CODECS_LIST(4)
+ CODEC_STATELESS(gb2312)
+ CODEC_STATELESS(gbk)
+ CODEC_STATELESS(gb18030)
+ CODEC_STATEFUL(hz)
+END_CODECS_LIST
+
+I_AM_A_MODULE_FOR(cn)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c
new file mode 100644
index 00000000000..e7273bf18e3
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_hk.c
@@ -0,0 +1,190 @@
+/*
+ * _codecs_hk.c: Codecs collection for encodings from Hong Kong
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#define USING_IMPORTED_MAPS
+
+#define CJK_MOD_SPECIFIC_STATE \
+ const encode_map *big5_encmap; \
+ const decode_map *big5_decmap;
+
+#include "cjkcodecs.h"
+#include "mappings_hk.h"
+
+/*
+ * BIG5HKSCS codec
+ */
+
+CODEC_INIT(big5hkscs)
+{
+ cjkcodecs_module_state *st = codec->modstate;
+ if (IMPORT_MAP(tw, big5, &st->big5_encmap, &st->big5_decmap)) {
+ return -1;
+ }
+ return 0;
+}
+
+/*
+ * There are four possible pair unicode -> big5hkscs maps as in HKSCS 2004:
+ * U+00CA U+0304 -> 8862 (U+00CA alone is mapped to 8866)
+ * U+00CA U+030C -> 8864
+ * U+00EA U+0304 -> 88a3 (U+00EA alone is mapped to 88a7)
+ * U+00EA U+030C -> 88a5
+ * These are handled by not mapping tables but a hand-written code.
+ */
+static const DBCHAR big5hkscs_pairenc_table[4] = {0x8862, 0x8864, 0x88a3, 0x88a5};
+
+ENCODER(big5hkscs)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+ Py_ssize_t insize;
+
+ if (c < 0x80) {
+ REQUIRE_OUTBUF(1);
+ **outbuf = (unsigned char)c;
+ NEXT(1, 1);
+ continue;
+ }
+
+ insize = 1;
+ REQUIRE_OUTBUF(2);
+
+ if (c < 0x10000) {
+ if (TRYMAP_ENC(big5hkscs_bmp, code, c)) {
+ if (code == MULTIC) {
+ Py_UCS4 c2;
+ if (inlen - *inpos >= 2)
+ c2 = INCHAR2;
+ else
+ c2 = 0;
+
+ if (inlen - *inpos >= 2 &&
+ ((c & 0xffdf) == 0x00ca) &&
+ ((c2 & 0xfff7) == 0x0304)) {
+ code = big5hkscs_pairenc_table[
+ ((c >> 4) |
+ (c2 >> 3)) & 3];
+ insize = 2;
+ }
+ else if (inlen - *inpos < 2 &&
+ !(flags & MBENC_FLUSH))
+ return MBERR_TOOFEW;
+ else {
+ if (c == 0xca)
+ code = 0x8866;
+ else /* c == 0xea */
+ code = 0x88a7;
+ }
+ }
+ }
+ else if (TRYMAP_ENC_ST(big5, code, c))
+ ;
+ else
+ return 1;
+ }
+ else if (c < 0x20000)
+ return insize;
+ else if (c < 0x30000) {
+ if (TRYMAP_ENC(big5hkscs_nonbmp, code, c & 0xffff))
+ ;
+ else
+ return insize;
+ }
+ else
+ return insize;
+
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xFF);
+ NEXT(insize, 2);
+ }
+
+ return 0;
+}
+
+#define BH2S(c1, c2) (((c1) - 0x87) * (0xfe - 0x40 + 1) + ((c2) - 0x40))
+
+DECODER(big5hkscs)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+
+ if (0xc6 > c || c > 0xc8 || (c < 0xc7 && INBYTE2 < 0xa1)) {
+ if (TRYMAP_DEC_ST(big5, decoded, c, INBYTE2)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ continue;
+ }
+ }
+
+ if (TRYMAP_DEC(big5hkscs, decoded, c, INBYTE2))
+ {
+ int s = BH2S(c, INBYTE2);
+ const unsigned char *hintbase;
+
+ assert(0x87 <= c && c <= 0xfe);
+ assert(0x40 <= INBYTE2 && INBYTE2 <= 0xfe);
+
+ if (BH2S(0x87, 0x40) <= s && s <= BH2S(0xa0, 0xfe)) {
+ hintbase = big5hkscs_phint_0;
+ s -= BH2S(0x87, 0x40);
+ }
+ else if (BH2S(0xc6,0xa1) <= s && s <= BH2S(0xc8,0xfe)){
+ hintbase = big5hkscs_phint_12130;
+ s -= BH2S(0xc6, 0xa1);
+ }
+ else if (BH2S(0xf9,0xd6) <= s && s <= BH2S(0xfe,0xfe)){
+ hintbase = big5hkscs_phint_21924;
+ s -= BH2S(0xf9, 0xd6);
+ }
+ else
+ return MBERR_INTERNAL;
+
+ if (hintbase[s >> 3] & (1 << (s & 7))) {
+ OUTCHAR(decoded | 0x20000);
+ NEXT_IN(2);
+ }
+ else {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ }
+ continue;
+ }
+
+ switch ((c << 8) | INBYTE2) {
+ case 0x8862: OUTCHAR2(0x00ca, 0x0304); break;
+ case 0x8864: OUTCHAR2(0x00ca, 0x030c); break;
+ case 0x88a3: OUTCHAR2(0x00ea, 0x0304); break;
+ case 0x88a5: OUTCHAR2(0x00ea, 0x030c); break;
+ default: return 1;
+ }
+
+ NEXT_IN(2); /* all decoded code points are pairs, above. */
+ }
+
+ return 0;
+}
+
+BEGIN_MAPPINGS_LIST(3)
+ MAPPING_DECONLY(big5hkscs)
+ MAPPING_ENCONLY(big5hkscs_bmp)
+ MAPPING_ENCONLY(big5hkscs_nonbmp)
+END_MAPPINGS_LIST
+
+BEGIN_CODECS_LIST(1)
+ CODEC_STATELESS_WINIT(big5hkscs)
+END_CODECS_LIST
+
+I_AM_A_MODULE_FOR(hk)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c
new file mode 100644
index 00000000000..e8835ad0909
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_iso2022.c
@@ -0,0 +1,1150 @@
+/*
+ * _codecs_iso2022.c: Codecs collection for ISO-2022 encodings.
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#define USING_IMPORTED_MAPS
+#define USING_BINARY_PAIR_SEARCH
+#define EXTERN_JISX0213_PAIR
+#define EMULATE_JISX0213_2000_ENCODE_INVALID MAP_UNMAPPABLE
+#define EMULATE_JISX0213_2000_DECODE_INVALID MAP_UNMAPPABLE
+
+#define CJK_MOD_SPECIFIC_STATE \
+ /* kr */ \
+ const encode_map *cp949_encmap; \
+ const decode_map *ksx1001_decmap; \
+ \
+ /* jp */ \
+ const encode_map *jisxcommon_encmap; \
+ const decode_map *jisx0208_decmap; \
+ const decode_map *jisx0212_decmap; \
+ const encode_map *jisx0213_bmp_encmap; \
+ const decode_map *jisx0213_1_bmp_decmap; \
+ const decode_map *jisx0213_2_bmp_decmap; \
+ const encode_map *jisx0213_emp_encmap; \
+ const decode_map *jisx0213_1_emp_decmap; \
+ const decode_map *jisx0213_2_emp_decmap; \
+ \
+ /* cn */ \
+ const encode_map *gbcommon_encmap; \
+ const decode_map *gb2312_decmap;
+
+
+#include "cjkcodecs.h"
+#include "alg_jisx0201.h"
+#include "emu_jisx0213_2000.h"
+#include "mappings_jisx0213_pair.h"
+
+/* STATE
+
+ state->c[0-3]
+
+ 00000000
+ ||^^^^^|
+ |+-----+---- G0-3 Character Set
+ +----------- Is G0-3 double byte?
+
+ state->c[4]
+
+ 00000000
+ ||
+ |+---- Locked-Shift?
+ +----- ESC Throughout
+*/
+
+#define ESC 0x1B
+#define SO 0x0E
+#define SI 0x0F
+#define LF 0x0A
+
+#define MAX_ESCSEQLEN 16
+
+#define CHARSET_ISO8859_1 'A'
+#define CHARSET_ASCII 'B'
+#define CHARSET_ISO8859_7 'F'
+#define CHARSET_JISX0201_K 'I'
+#define CHARSET_JISX0201_R 'J'
+
+#define CHARSET_GB2312 ('A'|CHARSET_DBCS)
+#define CHARSET_JISX0208 ('B'|CHARSET_DBCS)
+#define CHARSET_KSX1001 ('C'|CHARSET_DBCS)
+#define CHARSET_JISX0212 ('D'|CHARSET_DBCS)
+#define CHARSET_GB2312_8565 ('E'|CHARSET_DBCS)
+#define CHARSET_CNS11643_1 ('G'|CHARSET_DBCS)
+#define CHARSET_CNS11643_2 ('H'|CHARSET_DBCS)
+#define CHARSET_JISX0213_2000_1 ('O'|CHARSET_DBCS)
+#define CHARSET_JISX0213_2 ('P'|CHARSET_DBCS)
+#define CHARSET_JISX0213_2004_1 ('Q'|CHARSET_DBCS)
+#define CHARSET_JISX0208_O ('@'|CHARSET_DBCS)
+
+#define CHARSET_DBCS 0x80
+#define ESCMARK(mark) ((mark) & 0x7f)
+
+#define IS_ESCEND(c) (((c) >= 'A' && (c) <= 'Z') || (c) == '@')
+#define IS_ISO2022ESC(c2) \
+ ((c2) == '(' || (c2) == ')' || (c2) == '$' || \
+ (c2) == '.' || (c2) == '&')
+ /* this is not a complete list of ISO-2022 escape sequence headers.
+ * but, it's enough to implement CJK instances of iso-2022. */
+
+#define MAP_UNMAPPABLE 0xFFFF
+#define MAP_MULTIPLE_AVAIL 0xFFFE /* for JIS X 0213 */
+
+#define F_SHIFTED 0x01
+#define F_ESCTHROUGHOUT 0x02
+
+#define STATE_SETG(dn, v) do { ((state)->c[dn]) = (v); } while (0)
+#define STATE_GETG(dn) ((state)->c[dn])
+
+#define STATE_G0 STATE_GETG(0)
+#define STATE_G1 STATE_GETG(1)
+#define STATE_G2 STATE_GETG(2)
+#define STATE_G3 STATE_GETG(3)
+#define STATE_SETG0(v) STATE_SETG(0, v)
+#define STATE_SETG1(v) STATE_SETG(1, v)
+#define STATE_SETG2(v) STATE_SETG(2, v)
+#define STATE_SETG3(v) STATE_SETG(3, v)
+
+#define STATE_SETFLAG(f) do { ((state)->c[4]) |= (f); } while (0)
+#define STATE_GETFLAG(f) ((state)->c[4] & (f))
+#define STATE_CLEARFLAG(f) do { ((state)->c[4]) &= ~(f); } while (0)
+#define STATE_CLEARFLAGS() do { ((state)->c[4]) = 0; } while (0)
+
+#define ISO2022_CONFIG ((const struct iso2022_config *)(codec->config))
+#define CONFIG_ISSET(flag) (ISO2022_CONFIG->flags & (flag))
+#define CONFIG_DESIGNATIONS (ISO2022_CONFIG->designations)
+
+/* iso2022_config.flags */
+#define NO_SHIFT 0x01
+#define USE_G2 0x02
+#define USE_JISX0208_EXT 0x04
+
+/*-*- internal data structures -*-*/
+
+typedef int (*iso2022_init_func)(const MultibyteCodec *codec);
+typedef Py_UCS4 (*iso2022_decode_func)(const MultibyteCodec *codec,
+ const unsigned char *data);
+typedef DBCHAR (*iso2022_encode_func)(const MultibyteCodec *codec,
+ const Py_UCS4 *data,
+ Py_ssize_t *length);
+
+struct iso2022_designation {
+ unsigned char mark;
+ unsigned char plane;
+ unsigned char width;
+ iso2022_init_func initializer;
+ iso2022_decode_func decoder;
+ iso2022_encode_func encoder;
+};
+
+struct iso2022_config {
+ int flags;
+ const struct iso2022_designation *designations; /* non-ascii desigs */
+};
+
+/*-*- iso-2022 codec implementation -*-*/
+
+CODEC_INIT(iso2022)
+{
+ const struct iso2022_designation *desig;
+ for (desig = CONFIG_DESIGNATIONS; desig->mark; desig++) {
+ if (desig->initializer != NULL && desig->initializer(codec) != 0) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+ENCODER_INIT(iso2022)
+{
+ STATE_CLEARFLAGS();
+ STATE_SETG0(CHARSET_ASCII);
+ STATE_SETG1(CHARSET_ASCII);
+ return 0;
+}
+
+ENCODER_RESET(iso2022)
+{
+ if (STATE_GETFLAG(F_SHIFTED)) {
+ WRITEBYTE1(SI);
+ NEXT_OUT(1);
+ STATE_CLEARFLAG(F_SHIFTED);
+ }
+ if (STATE_G0 != CHARSET_ASCII) {
+ WRITEBYTE3(ESC, '(', 'B');
+ NEXT_OUT(3);
+ STATE_SETG0(CHARSET_ASCII);
+ }
+ return 0;
+}
+
+ENCODER(iso2022)
+{
+ while (*inpos < inlen) {
+ const struct iso2022_designation *dsg;
+ DBCHAR encoded;
+ Py_UCS4 c = INCHAR1;
+ Py_ssize_t insize;
+
+ if (c < 0x80) {
+ if (STATE_G0 != CHARSET_ASCII) {
+ WRITEBYTE3(ESC, '(', 'B');
+ STATE_SETG0(CHARSET_ASCII);
+ NEXT_OUT(3);
+ }
+ if (STATE_GETFLAG(F_SHIFTED)) {
+ WRITEBYTE1(SI);
+ STATE_CLEARFLAG(F_SHIFTED);
+ NEXT_OUT(1);
+ }
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ insize = 1;
+
+ encoded = MAP_UNMAPPABLE;
+ for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++) {
+ Py_UCS4 buf[2] = {c, 0};
+ Py_ssize_t length = 1;
+ encoded = dsg->encoder(codec, buf, &length);
+ if (encoded == MAP_MULTIPLE_AVAIL) {
+ /* this implementation won't work for pair
+ * of non-bmp characters. */
+ if (inlen - *inpos < 2) {
+ if (!(flags & MBENC_FLUSH))
+ return MBERR_TOOFEW;
+ length = -1;
+ }
+ else {
+ buf[1] = INCHAR2;
+ length = 2;
+ }
+ encoded = dsg->encoder(codec, buf, &length);
+ if (encoded != MAP_UNMAPPABLE) {
+ insize = length;
+ break;
+ }
+ }
+ else if (encoded != MAP_UNMAPPABLE)
+ break;
+ }
+
+ if (!dsg->mark)
+ return 1;
+ assert(dsg->width == 1 || dsg->width == 2);
+
+ switch (dsg->plane) {
+ case 0: /* G0 */
+ if (STATE_GETFLAG(F_SHIFTED)) {
+ WRITEBYTE1(SI);
+ STATE_CLEARFLAG(F_SHIFTED);
+ NEXT_OUT(1);
+ }
+ if (STATE_G0 != dsg->mark) {
+ if (dsg->width == 1) {
+ WRITEBYTE3(ESC, '(', ESCMARK(dsg->mark));
+ STATE_SETG0(dsg->mark);
+ NEXT_OUT(3);
+ }
+ else if (dsg->mark == CHARSET_JISX0208) {
+ WRITEBYTE3(ESC, '$', ESCMARK(dsg->mark));
+ STATE_SETG0(dsg->mark);
+ NEXT_OUT(3);
+ }
+ else {
+ WRITEBYTE4(ESC, '$', '(',
+ ESCMARK(dsg->mark));
+ STATE_SETG0(dsg->mark);
+ NEXT_OUT(4);
+ }
+ }
+ break;
+ case 1: /* G1 */
+ if (STATE_G1 != dsg->mark) {
+ if (dsg->width == 1) {
+ WRITEBYTE3(ESC, ')', ESCMARK(dsg->mark));
+ STATE_SETG1(dsg->mark);
+ NEXT_OUT(3);
+ }
+ else {
+ WRITEBYTE4(ESC, '$', ')', ESCMARK(dsg->mark));
+ STATE_SETG1(dsg->mark);
+ NEXT_OUT(4);
+ }
+ }
+ if (!STATE_GETFLAG(F_SHIFTED)) {
+ WRITEBYTE1(SO);
+ STATE_SETFLAG(F_SHIFTED);
+ NEXT_OUT(1);
+ }
+ break;
+ default: /* G2 and G3 is not supported: no encoding in
+ * CJKCodecs are using them yet */
+ return MBERR_INTERNAL;
+ }
+
+ if (dsg->width == 1) {
+ WRITEBYTE1((unsigned char)encoded);
+ NEXT_OUT(1);
+ }
+ else {
+ WRITEBYTE2(encoded >> 8, encoded & 0xff);
+ NEXT_OUT(2);
+ }
+ NEXT_INCHAR(insize);
+ }
+
+ return 0;
+}
+
+DECODER_INIT(iso2022)
+{
+ STATE_CLEARFLAGS();
+ STATE_SETG0(CHARSET_ASCII);
+ STATE_SETG1(CHARSET_ASCII);
+ STATE_SETG2(CHARSET_ASCII);
+ return 0;
+}
+
+DECODER_RESET(iso2022)
+{
+ STATE_SETG0(CHARSET_ASCII);
+ STATE_CLEARFLAG(F_SHIFTED);
+ return 0;
+}
+
+static Py_ssize_t
+iso2022processesc(const MultibyteCodec *codec, MultibyteCodec_State *state,
+ const unsigned char **inbuf, Py_ssize_t *inleft)
+{
+ unsigned char charset, designation;
+ Py_ssize_t i, esclen = 0;
+
+ for (i = 1;i < MAX_ESCSEQLEN;i++) {
+ if (i >= *inleft)
+ return MBERR_TOOFEW;
+ if (IS_ESCEND((*inbuf)[i])) {
+ esclen = i + 1;
+ break;
+ }
+ else if (CONFIG_ISSET(USE_JISX0208_EXT) && i+1 < *inleft &&
+ (*inbuf)[i] == '&' && (*inbuf)[i+1] == '@') {
+ i += 2;
+ }
+ }
+
+ switch (esclen) {
+ case 0:
+ return 1; /* unterminated escape sequence */
+ case 3:
+ if (INBYTE2 == '$') {
+ charset = INBYTE3 | CHARSET_DBCS;
+ designation = 0;
+ }
+ else {
+ charset = INBYTE3;
+ if (INBYTE2 == '(')
+ designation = 0;
+ else if (INBYTE2 == ')')
+ designation = 1;
+ else if (CONFIG_ISSET(USE_G2) && INBYTE2 == '.')
+ designation = 2;
+ else
+ return 3;
+ }
+ break;
+ case 4:
+ if (INBYTE2 != '$')
+ return 4;
+
+ charset = INBYTE4 | CHARSET_DBCS;
+ if (INBYTE3 == '(')
+ designation = 0;
+ else if (INBYTE3 == ')')
+ designation = 1;
+ else
+ return 4;
+ break;
+ case 6: /* designation with prefix */
+ if (CONFIG_ISSET(USE_JISX0208_EXT) &&
+ (*inbuf)[3] == ESC && (*inbuf)[4] == '$' &&
+ (*inbuf)[5] == 'B') {
+ charset = 'B' | CHARSET_DBCS;
+ designation = 0;
+ }
+ else
+ return 6;
+ break;
+ default:
+ return esclen;
+ }
+
+ /* raise error when the charset is not designated for this encoding */
+ if (charset != CHARSET_ASCII) {
+ const struct iso2022_designation *dsg;
+
+ for (dsg = CONFIG_DESIGNATIONS; dsg->mark; dsg++) {
+ if (dsg->mark == charset)
+ break;
+ }
+ if (!dsg->mark)
+ return esclen;
+ }
+
+ STATE_SETG(designation, charset);
+ *inleft -= esclen;
+ (*inbuf) += esclen;
+ return 0;
+}
+
+#define ISO8859_7_DECODE(c, writer) \
+ if ((c) < 0xa0) { \
+ OUTCHAR(c); \
+ } else if ((c) < 0xc0 && (0x288f3bc9L & (1L << ((c)-0xa0)))) { \
+ OUTCHAR(c); \
+ } else if ((c) >= 0xb4 && (c) <= 0xfe && ((c) >= 0xd4 || \
+ (0xbffffd77L & (1L << ((c)-0xb4))))) { \
+ OUTCHAR(0x02d0 + (c)); \
+ } else if ((c) == 0xa1) { \
+ OUTCHAR(0x2018); \
+ } else if ((c) == 0xa2) { \
+ OUTCHAR(0x2019); \
+ } else if ((c) == 0xaf) { \
+ OUTCHAR(0x2015); \
+ }
+
+static Py_ssize_t
+iso2022processg2(const MultibyteCodec *codec, MultibyteCodec_State *state,
+ const unsigned char **inbuf, Py_ssize_t *inleft,
+ _PyUnicodeWriter *writer)
+{
+ /* not written to use encoder, decoder functions because only few
+ * encodings use G2 designations in CJKCodecs */
+ if (STATE_G2 == CHARSET_ISO8859_1) {
+ if (INBYTE3 < 0x80)
+ OUTCHAR(INBYTE3 + 0x80);
+ else
+ return 3;
+ }
+ else if (STATE_G2 == CHARSET_ISO8859_7) {
+ ISO8859_7_DECODE(INBYTE3 ^ 0x80, writer)
+ else
+ return 3;
+ }
+ else if (STATE_G2 == CHARSET_ASCII) {
+ if (INBYTE3 & 0x80)
+ return 3;
+ else
+ OUTCHAR(INBYTE3);
+ }
+ else
+ return MBERR_INTERNAL;
+
+ (*inbuf) += 3;
+ *inleft -= 3;
+ return 0;
+}
+
+DECODER(iso2022)
+{
+ const struct iso2022_designation *dsgcache = NULL;
+
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_ssize_t err;
+
+ if (STATE_GETFLAG(F_ESCTHROUGHOUT)) {
+ /* ESC throughout mode:
+ * for non-iso2022 escape sequences */
+ OUTCHAR(c); /* assume as ISO-8859-1 */
+ NEXT_IN(1);
+ if (IS_ESCEND(c)) {
+ STATE_CLEARFLAG(F_ESCTHROUGHOUT);
+ }
+ continue;
+ }
+
+ switch (c) {
+ case ESC:
+ REQUIRE_INBUF(2);
+ if (IS_ISO2022ESC(INBYTE2)) {
+ err = iso2022processesc(codec, state,
+ inbuf, &inleft);
+ if (err != 0)
+ return err;
+ }
+ else if (CONFIG_ISSET(USE_G2) && INBYTE2 == 'N') {/* SS2 */
+ REQUIRE_INBUF(3);
+ err = iso2022processg2(codec, state,
+ inbuf, &inleft, writer);
+ if (err != 0)
+ return err;
+ }
+ else {
+ OUTCHAR(ESC);
+ STATE_SETFLAG(F_ESCTHROUGHOUT);
+ NEXT_IN(1);
+ }
+ break;
+ case SI:
+ if (CONFIG_ISSET(NO_SHIFT))
+ goto bypass;
+ STATE_CLEARFLAG(F_SHIFTED);
+ NEXT_IN(1);
+ break;
+ case SO:
+ if (CONFIG_ISSET(NO_SHIFT))
+ goto bypass;
+ STATE_SETFLAG(F_SHIFTED);
+ NEXT_IN(1);
+ break;
+ case LF:
+ STATE_CLEARFLAG(F_SHIFTED);
+ OUTCHAR(LF);
+ NEXT_IN(1);
+ break;
+ default:
+ if (c < 0x20) /* C0 */
+ goto bypass;
+ else if (c >= 0x80)
+ return 1;
+ else {
+ const struct iso2022_designation *dsg;
+ unsigned char charset;
+ Py_UCS4 decoded;
+
+ if (STATE_GETFLAG(F_SHIFTED))
+ charset = STATE_G1;
+ else
+ charset = STATE_G0;
+
+ if (charset == CHARSET_ASCII) {
+bypass:
+ OUTCHAR(c);
+ NEXT_IN(1);
+ break;
+ }
+
+ if (dsgcache != NULL &&
+ dsgcache->mark == charset)
+ dsg = dsgcache;
+ else {
+ for (dsg = CONFIG_DESIGNATIONS;
+ dsg->mark != charset
+#ifdef Py_DEBUG
+ && dsg->mark != '\0'
+#endif
+ ; dsg++)
+ {
+ /* noop */
+ }
+ assert(dsg->mark != '\0');
+ dsgcache = dsg;
+ }
+
+ REQUIRE_INBUF(dsg->width);
+ decoded = dsg->decoder(codec, *inbuf);
+ if (decoded == MAP_UNMAPPABLE)
+ return dsg->width;
+
+ if (decoded < 0x10000) {
+ OUTCHAR(decoded);
+ }
+ else if (decoded < 0x30000) {
+ OUTCHAR(decoded);
+ }
+ else { /* JIS X 0213 pairs */
+ OUTCHAR2(decoded >> 16, decoded & 0xffff);
+ }
+ NEXT_IN(dsg->width);
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+/*-*- mapping access functions -*-*/
+
+static int
+ksx1001_init(const MultibyteCodec *codec)
+{
+ cjkcodecs_module_state *st = codec->modstate;
+ if (IMPORT_MAP(kr, cp949, &st->cp949_encmap, NULL) ||
+ IMPORT_MAP(kr, ksx1001, NULL, &st->ksx1001_decmap))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+static Py_UCS4
+ksx1001_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ if (TRYMAP_DEC_ST(ksx1001, u, data[0], data[1]))
+ return u;
+ else
+ return MAP_UNMAPPABLE;
+}
+
+static DBCHAR
+ksx1001_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded;
+ assert(*length == 1);
+ if (*data < 0x10000) {
+ if (TRYMAP_ENC_ST(cp949, coded, *data)) {
+ if (!(coded & 0x8000))
+ return coded;
+ }
+ }
+ return MAP_UNMAPPABLE;
+}
+
+static int
+jisx0208_init(const MultibyteCodec *codec)
+{
+ cjkcodecs_module_state *st = codec->modstate;
+ if (IMPORT_MAP(jp, jisxcommon, &st->jisxcommon_encmap, NULL) ||
+ IMPORT_MAP(jp, jisx0208, NULL, &st->jisx0208_decmap))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+static Py_UCS4
+jisx0208_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ if (data[0] == 0x21 && data[1] == 0x40) /* F/W REVERSE SOLIDUS */
+ return 0xff3c;
+ else if (TRYMAP_DEC_ST(jisx0208, u, data[0], data[1]))
+ return u;
+ else
+ return MAP_UNMAPPABLE;
+}
+
+static DBCHAR
+jisx0208_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded;
+ assert(*length == 1);
+ if (*data < 0x10000) {
+ if (*data == 0xff3c) /* F/W REVERSE SOLIDUS */
+ return 0x2140;
+ else if (TRYMAP_ENC_ST(jisxcommon, coded, *data)) {
+ if (!(coded & 0x8000))
+ return coded;
+ }
+ }
+ return MAP_UNMAPPABLE;
+}
+
+static int
+jisx0212_init(const MultibyteCodec *codec)
+{
+ cjkcodecs_module_state *st = codec->modstate;
+ if (IMPORT_MAP(jp, jisxcommon, &st->jisxcommon_encmap, NULL) ||
+ IMPORT_MAP(jp, jisx0212, NULL, &st->jisx0212_decmap))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+static Py_UCS4
+jisx0212_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ if (TRYMAP_DEC_ST(jisx0212, u, data[0], data[1]))
+ return u;
+ else
+ return MAP_UNMAPPABLE;
+}
+
+static DBCHAR
+jisx0212_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded;
+ assert(*length == 1);
+ if (*data < 0x10000) {
+ if (TRYMAP_ENC_ST(jisxcommon, coded, *data)) {
+ if (coded & 0x8000)
+ return coded & 0x7fff;
+ }
+ }
+ return MAP_UNMAPPABLE;
+}
+
+static int
+jisx0213_init(const MultibyteCodec *codec)
+{
+ cjkcodecs_module_state *st = codec->modstate;
+ if (jisx0208_init(codec) ||
+ IMPORT_MAP(jp, jisx0213_bmp, &st->jisx0213_bmp_encmap, NULL) ||
+ IMPORT_MAP(jp, jisx0213_1_bmp, NULL, &st->jisx0213_1_bmp_decmap) ||
+ IMPORT_MAP(jp, jisx0213_2_bmp, NULL, &st->jisx0213_2_bmp_decmap) ||
+ IMPORT_MAP(jp, jisx0213_emp, &st->jisx0213_emp_encmap, NULL) ||
+ IMPORT_MAP(jp, jisx0213_1_emp, NULL, &st->jisx0213_1_emp_decmap) ||
+ IMPORT_MAP(jp, jisx0213_2_emp, NULL, &st->jisx0213_2_emp_decmap) ||
+ IMPORT_MAP(jp, jisx0213_pair,
+ &jisx0213_pair_encmap, &jisx0213_pair_decmap))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+#define config ((void *)2000)
+static Py_UCS4
+jisx0213_2000_1_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ EMULATE_JISX0213_2000_DECODE_PLANE1(config, u, data[0], data[1])
+ else if (data[0] == 0x21 && data[1] == 0x40) /* F/W REVERSE SOLIDUS */
+ return 0xff3c;
+ else if (TRYMAP_DEC_ST(jisx0208, u, data[0], data[1]))
+ ;
+ else if (TRYMAP_DEC_ST(jisx0213_1_bmp, u, data[0], data[1]))
+ ;
+ else if (TRYMAP_DEC_ST(jisx0213_1_emp, u, data[0], data[1]))
+ u |= 0x20000;
+ else if (TRYMAP_DEC(jisx0213_pair, u, data[0], data[1]))
+ ;
+ else
+ return MAP_UNMAPPABLE;
+ return u;
+}
+
+static Py_UCS4
+jisx0213_2000_2_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ EMULATE_JISX0213_2000_DECODE_PLANE2_CHAR(config, u, data[0], data[1])
+ if (TRYMAP_DEC_ST(jisx0213_2_bmp, u, data[0], data[1]))
+ ;
+ else if (TRYMAP_DEC_ST(jisx0213_2_emp, u, data[0], data[1]))
+ u |= 0x20000;
+ else
+ return MAP_UNMAPPABLE;
+ return u;
+}
+#undef config
+
+static Py_UCS4
+jisx0213_2004_1_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ if (data[0] == 0x21 && data[1] == 0x40) /* F/W REVERSE SOLIDUS */
+ return 0xff3c;
+ else if (TRYMAP_DEC_ST(jisx0208, u, data[0], data[1]))
+ ;
+ else if (TRYMAP_DEC_ST(jisx0213_1_bmp, u, data[0], data[1]))
+ ;
+ else if (TRYMAP_DEC_ST(jisx0213_1_emp, u, data[0], data[1]))
+ u |= 0x20000;
+ else if (TRYMAP_DEC(jisx0213_pair, u, data[0], data[1]))
+ ;
+ else
+ return MAP_UNMAPPABLE;
+ return u;
+}
+
+static Py_UCS4
+jisx0213_2004_2_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ if (TRYMAP_DEC_ST(jisx0213_2_bmp, u, data[0], data[1]))
+ ;
+ else if (TRYMAP_DEC_ST(jisx0213_2_emp, u, data[0], data[1]))
+ u |= 0x20000;
+ else
+ return MAP_UNMAPPABLE;
+ return u;
+}
+
+static DBCHAR
+jisx0213_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length, const void *config)
+{
+ DBCHAR coded;
+
+ switch (*length) {
+ case 1: /* first character */
+ if (*data >= 0x10000) {
+ if ((*data) >> 16 == 0x20000 >> 16) {
+ EMULATE_JISX0213_2000_ENCODE_EMP(config, coded, *data)
+ else if (TRYMAP_ENC_ST(jisx0213_emp, coded, (*data) & 0xffff))
+ return coded;
+ }
+ return MAP_UNMAPPABLE;
+ }
+
+ EMULATE_JISX0213_2000_ENCODE_BMP(config, coded, *data)
+ else if (TRYMAP_ENC_ST(jisx0213_bmp, coded, *data)) {
+ if (coded == MULTIC)
+ return MAP_MULTIPLE_AVAIL;
+ }
+ else if (TRYMAP_ENC_ST(jisxcommon, coded, *data)) {
+ if (coded & 0x8000)
+ return MAP_UNMAPPABLE;
+ }
+ else
+ return MAP_UNMAPPABLE;
+ return coded;
+
+ case 2: /* second character of unicode pair */
+ coded = find_pairencmap((ucs2_t)data[0], (ucs2_t)data[1],
+ jisx0213_pair_encmap, JISX0213_ENCPAIRS);
+ if (coded != DBCINV)
+ return coded;
+ /* fall through */
+
+ case -1: /* flush unterminated */
+ *length = 1;
+ coded = find_pairencmap((ucs2_t)data[0], 0,
+ jisx0213_pair_encmap, JISX0213_ENCPAIRS);
+ if (coded == DBCINV)
+ return MAP_UNMAPPABLE;
+ else
+ return coded;
+ break;
+
+ default:
+ return MAP_UNMAPPABLE;
+ }
+}
+
+static DBCHAR
+jisx0213_2000_1_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded = jisx0213_encoder(codec, data, length, (void *)2000);
+ if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
+ return coded;
+ else if (coded & 0x8000)
+ return MAP_UNMAPPABLE;
+ else
+ return coded;
+}
+
+static DBCHAR
+jisx0213_2000_1_encoder_paironly(const MultibyteCodec *codec,
+ const Py_UCS4 *data, Py_ssize_t *length)
+{
+ DBCHAR coded;
+ Py_ssize_t ilength = *length;
+
+ coded = jisx0213_encoder(codec, data, length, (void *)2000);
+ switch (ilength) {
+ case 1:
+ if (coded == MAP_MULTIPLE_AVAIL)
+ return MAP_MULTIPLE_AVAIL;
+ else
+ return MAP_UNMAPPABLE;
+ case 2:
+ if (*length != 2)
+ return MAP_UNMAPPABLE;
+ else
+ return coded;
+ default:
+ return MAP_UNMAPPABLE;
+ }
+}
+
+static DBCHAR
+jisx0213_2000_2_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded = jisx0213_encoder(codec, data, length, (void *)2000);
+ if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
+ return coded;
+ else if (coded & 0x8000)
+ return coded & 0x7fff;
+ else
+ return MAP_UNMAPPABLE;
+}
+
+static DBCHAR
+jisx0213_2004_1_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded = jisx0213_encoder(codec, data, length, NULL);
+ if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
+ return coded;
+ else if (coded & 0x8000)
+ return MAP_UNMAPPABLE;
+ else
+ return coded;
+}
+
+static DBCHAR
+jisx0213_2004_1_encoder_paironly(const MultibyteCodec *codec,
+ const Py_UCS4 *data, Py_ssize_t *length)
+{
+ DBCHAR coded;
+ Py_ssize_t ilength = *length;
+
+ coded = jisx0213_encoder(codec, data, length, NULL);
+ switch (ilength) {
+ case 1:
+ if (coded == MAP_MULTIPLE_AVAIL)
+ return MAP_MULTIPLE_AVAIL;
+ else
+ return MAP_UNMAPPABLE;
+ case 2:
+ if (*length != 2)
+ return MAP_UNMAPPABLE;
+ else
+ return coded;
+ default:
+ return MAP_UNMAPPABLE;
+ }
+}
+
+static DBCHAR
+jisx0213_2004_2_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded = jisx0213_encoder(codec, data, length, NULL);
+ if (coded == MAP_UNMAPPABLE || coded == MAP_MULTIPLE_AVAIL)
+ return coded;
+ else if (coded & 0x8000)
+ return coded & 0x7fff;
+ else
+ return MAP_UNMAPPABLE;
+}
+
+static Py_UCS4
+jisx0201_r_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ JISX0201_R_DECODE_CHAR(*data, u)
+ else
+ return MAP_UNMAPPABLE;
+ return u;
+}
+
+static DBCHAR
+jisx0201_r_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded;
+ JISX0201_R_ENCODE(*data, coded)
+ else
+ return MAP_UNMAPPABLE;
+ return coded;
+}
+
+static Py_UCS4
+jisx0201_k_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ JISX0201_K_DECODE_CHAR(*data ^ 0x80, u)
+ else
+ return MAP_UNMAPPABLE;
+ return u;
+}
+
+static DBCHAR
+jisx0201_k_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded;
+ JISX0201_K_ENCODE(*data, coded)
+ else
+ return MAP_UNMAPPABLE;
+ return coded - 0x80;
+}
+
+static int
+gb2312_init(const MultibyteCodec *codec)
+{
+ cjkcodecs_module_state *st = codec->modstate;
+ if (IMPORT_MAP(cn, gbcommon, &st->gbcommon_encmap, NULL) ||
+ IMPORT_MAP(cn, gb2312, NULL, &st->gb2312_decmap))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+static Py_UCS4
+gb2312_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ Py_UCS4 u;
+ if (TRYMAP_DEC_ST(gb2312, u, data[0], data[1]))
+ return u;
+ else
+ return MAP_UNMAPPABLE;
+}
+
+static DBCHAR
+gb2312_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ DBCHAR coded;
+ assert(*length == 1);
+ if (*data < 0x10000) {
+ if (TRYMAP_ENC_ST(gbcommon, coded, *data)) {
+ if (!(coded & 0x8000))
+ return coded;
+ }
+ }
+ return MAP_UNMAPPABLE;
+}
+
+
+static Py_UCS4
+dummy_decoder(const MultibyteCodec *codec, const unsigned char *data)
+{
+ return MAP_UNMAPPABLE;
+}
+
+static DBCHAR
+dummy_encoder(const MultibyteCodec *codec, const Py_UCS4 *data,
+ Py_ssize_t *length)
+{
+ return MAP_UNMAPPABLE;
+}
+
+/*-*- registry tables -*-*/
+
+#define REGISTRY_KSX1001_G0 { CHARSET_KSX1001, 0, 2, \
+ ksx1001_init, \
+ ksx1001_decoder, ksx1001_encoder }
+#define REGISTRY_KSX1001_G1 { CHARSET_KSX1001, 1, 2, \
+ ksx1001_init, \
+ ksx1001_decoder, ksx1001_encoder }
+#define REGISTRY_JISX0201_R { CHARSET_JISX0201_R, 0, 1, \
+ NULL, \
+ jisx0201_r_decoder, jisx0201_r_encoder }
+#define REGISTRY_JISX0201_K { CHARSET_JISX0201_K, 0, 1, \
+ NULL, \
+ jisx0201_k_decoder, jisx0201_k_encoder }
+#define REGISTRY_JISX0208 { CHARSET_JISX0208, 0, 2, \
+ jisx0208_init, \
+ jisx0208_decoder, jisx0208_encoder }
+#define REGISTRY_JISX0208_O { CHARSET_JISX0208_O, 0, 2, \
+ jisx0208_init, \
+ jisx0208_decoder, jisx0208_encoder }
+#define REGISTRY_JISX0212 { CHARSET_JISX0212, 0, 2, \
+ jisx0212_init, \
+ jisx0212_decoder, jisx0212_encoder }
+#define REGISTRY_JISX0213_2000_1 { CHARSET_JISX0213_2000_1, 0, 2, \
+ jisx0213_init, \
+ jisx0213_2000_1_decoder, \
+ jisx0213_2000_1_encoder }
+#define REGISTRY_JISX0213_2000_1_PAIRONLY { CHARSET_JISX0213_2000_1, 0, 2, \
+ jisx0213_init, \
+ jisx0213_2000_1_decoder, \
+ jisx0213_2000_1_encoder_paironly }
+#define REGISTRY_JISX0213_2000_2 { CHARSET_JISX0213_2, 0, 2, \
+ jisx0213_init, \
+ jisx0213_2000_2_decoder, \
+ jisx0213_2000_2_encoder }
+#define REGISTRY_JISX0213_2004_1 { CHARSET_JISX0213_2004_1, 0, 2, \
+ jisx0213_init, \
+ jisx0213_2004_1_decoder, \
+ jisx0213_2004_1_encoder }
+#define REGISTRY_JISX0213_2004_1_PAIRONLY { CHARSET_JISX0213_2004_1, 0, 2, \
+ jisx0213_init, \
+ jisx0213_2004_1_decoder, \
+ jisx0213_2004_1_encoder_paironly }
+#define REGISTRY_JISX0213_2004_2 { CHARSET_JISX0213_2, 0, 2, \
+ jisx0213_init, \
+ jisx0213_2004_2_decoder, \
+ jisx0213_2004_2_encoder }
+#define REGISTRY_GB2312 { CHARSET_GB2312, 0, 2, \
+ gb2312_init, \
+ gb2312_decoder, gb2312_encoder }
+#define REGISTRY_CNS11643_1 { CHARSET_CNS11643_1, 1, 2, \
+ cns11643_init, \
+ cns11643_1_decoder, cns11643_1_encoder }
+#define REGISTRY_CNS11643_2 { CHARSET_CNS11643_2, 2, 2, \
+ cns11643_init, \
+ cns11643_2_decoder, cns11643_2_encoder }
+#define REGISTRY_ISO8859_1 { CHARSET_ISO8859_1, 2, 1, \
+ NULL, dummy_decoder, dummy_encoder }
+#define REGISTRY_ISO8859_7 { CHARSET_ISO8859_7, 2, 1, \
+ NULL, dummy_decoder, dummy_encoder }
+#define REGISTRY_SENTINEL { 0, }
+#define CONFIGDEF(var, attrs) \
+ static const struct iso2022_config iso2022_##var##_config = { \
+ attrs, iso2022_##var##_designations \
+ };
+
+static const struct iso2022_designation iso2022_kr_designations[] = {
+ REGISTRY_KSX1001_G1, REGISTRY_SENTINEL
+};
+CONFIGDEF(kr, 0)
+
+static const struct iso2022_designation iso2022_jp_designations[] = {
+ REGISTRY_JISX0208, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
+ REGISTRY_SENTINEL
+};
+CONFIGDEF(jp, NO_SHIFT | USE_JISX0208_EXT)
+
+static const struct iso2022_designation iso2022_jp_1_designations[] = {
+ REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_JISX0201_R,
+ REGISTRY_JISX0208_O, REGISTRY_SENTINEL
+};
+CONFIGDEF(jp_1, NO_SHIFT | USE_JISX0208_EXT)
+
+static const struct iso2022_designation iso2022_jp_2_designations[] = {
+ REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_KSX1001_G0,
+ REGISTRY_GB2312, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
+ REGISTRY_ISO8859_1, REGISTRY_ISO8859_7, REGISTRY_SENTINEL
+};
+CONFIGDEF(jp_2, NO_SHIFT | USE_G2 | USE_JISX0208_EXT)
+
+static const struct iso2022_designation iso2022_jp_2004_designations[] = {
+ REGISTRY_JISX0213_2004_1_PAIRONLY, REGISTRY_JISX0208,
+ REGISTRY_JISX0213_2004_1, REGISTRY_JISX0213_2004_2, REGISTRY_SENTINEL
+};
+CONFIGDEF(jp_2004, NO_SHIFT | USE_JISX0208_EXT)
+
+static const struct iso2022_designation iso2022_jp_3_designations[] = {
+ REGISTRY_JISX0213_2000_1_PAIRONLY, REGISTRY_JISX0208,
+ REGISTRY_JISX0213_2000_1, REGISTRY_JISX0213_2000_2, REGISTRY_SENTINEL
+};
+CONFIGDEF(jp_3, NO_SHIFT | USE_JISX0208_EXT)
+
+static const struct iso2022_designation iso2022_jp_ext_designations[] = {
+ REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_JISX0201_R,
+ REGISTRY_JISX0201_K, REGISTRY_JISX0208_O, REGISTRY_SENTINEL
+};
+CONFIGDEF(jp_ext, NO_SHIFT | USE_JISX0208_EXT)
+
+
+BEGIN_MAPPINGS_LIST(0)
+ /* no mapping table here */
+END_MAPPINGS_LIST
+
+#define ISO2022_CODEC(variation) \
+NEXT_CODEC = (MultibyteCodec){ \
+ "iso2022_" #variation, \
+ &iso2022_##variation##_config, \
+ iso2022_codec_init, \
+ _STATEFUL_METHODS(iso2022) \
+};
+
+BEGIN_CODECS_LIST(7)
+ ISO2022_CODEC(kr)
+ ISO2022_CODEC(jp)
+ ISO2022_CODEC(jp_1)
+ ISO2022_CODEC(jp_2)
+ ISO2022_CODEC(jp_2004)
+ ISO2022_CODEC(jp_3)
+ ISO2022_CODEC(jp_ext)
+END_CODECS_LIST
+
+I_AM_A_MODULE_FOR(iso2022)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c
new file mode 100644
index 00000000000..f7127487aa5
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_jp.c
@@ -0,0 +1,765 @@
+/*
+ * _codecs_jp.c: Codecs collection for Japanese encodings
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#define USING_BINARY_PAIR_SEARCH
+#define EMPBASE 0x20000
+
+#include "cjkcodecs.h"
+#include "mappings_jp.h"
+#include "mappings_jisx0213_pair.h"
+#include "alg_jisx0201.h"
+#include "emu_jisx0213_2000.h"
+
+/*
+ * CP932 codec
+ */
+
+ENCODER(cp932)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+ unsigned char c1, c2;
+
+ if (c <= 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+ else if (c >= 0xff61 && c <= 0xff9f) {
+ WRITEBYTE1(c - 0xfec0);
+ NEXT(1, 1);
+ continue;
+ }
+ else if (c >= 0xf8f0 && c <= 0xf8f3) {
+ /* Windows compatibility */
+ REQUIRE_OUTBUF(1);
+ if (c == 0xf8f0)
+ OUTBYTE1(0xa0);
+ else
+ OUTBYTE1(c - 0xf8f1 + 0xfd);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+ REQUIRE_OUTBUF(2);
+
+ if (TRYMAP_ENC(cp932ext, code, c)) {
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xff);
+ }
+ else if (TRYMAP_ENC(jisxcommon, code, c)) {
+ if (code & 0x8000) /* MSB set: JIS X 0212 */
+ return 1;
+
+ /* JIS X 0208 */
+ c1 = code >> 8;
+ c2 = code & 0xff;
+ c2 = (((c1 - 0x21) & 1) ? 0x5e : 0) + (c2 - 0x21);
+ c1 = (c1 - 0x21) >> 1;
+ OUTBYTE1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1);
+ OUTBYTE2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
+ }
+ else if (c >= 0xe000 && c < 0xe758) {
+ /* User-defined area */
+ c1 = (Py_UCS4)(c - 0xe000) / 188;
+ c2 = (Py_UCS4)(c - 0xe000) % 188;
+ OUTBYTE1(c1 + 0xf0);
+ OUTBYTE2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
+ }
+ else
+ return 1;
+
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(cp932)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1, c2;
+ Py_UCS4 decoded;
+
+ if (c <= 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+ else if (c >= 0xa0 && c <= 0xdf) {
+ if (c == 0xa0)
+ OUTCHAR(0xf8f0); /* half-width katakana */
+ else
+ OUTCHAR(0xfec0 + c);
+ NEXT_IN(1);
+ continue;
+ }
+ else if (c >= 0xfd/* && c <= 0xff*/) {
+ /* Windows compatibility */
+ OUTCHAR(0xf8f1 - 0xfd + c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+
+ if (TRYMAP_DEC(cp932ext, decoded, c, c2))
+ OUTCHAR(decoded);
+ else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)){
+ if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
+ return 1;
+
+ c = (c < 0xe0 ? c - 0x81 : c - 0xc1);
+ c2 = (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41);
+ c = (2 * c + (c2 < 0x5e ? 0 : 1) + 0x21);
+ c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21;
+
+ if (TRYMAP_DEC(jisx0208, decoded, c, c2))
+ OUTCHAR(decoded);
+ else
+ return 1;
+ }
+ else if (c >= 0xf0 && c <= 0xf9) {
+ if ((c2 >= 0x40 && c2 <= 0x7e) ||
+ (c2 >= 0x80 && c2 <= 0xfc))
+ OUTCHAR(0xe000 + 188 * (c - 0xf0) +
+ (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41));
+ else
+ return 1;
+ }
+ else
+ return 1;
+
+ NEXT_IN(2);
+ }
+
+ return 0;
+}
+
+
+/*
+ * EUC-JIS-2004 codec
+ */
+
+ENCODER(euc_jis_2004)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+ Py_ssize_t insize;
+
+ if (c < 0x80) {
+ WRITEBYTE1(c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ insize = 1;
+
+ if (c <= 0xFFFF) {
+ EMULATE_JISX0213_2000_ENCODE_BMP(codec->config, code, c)
+ else if (TRYMAP_ENC(jisx0213_bmp, code, c)) {
+ if (code == MULTIC) {
+ if (inlen - *inpos < 2) {
+ if (flags & MBENC_FLUSH) {
+ code = find_pairencmap(
+ (ucs2_t)c, 0,
+ jisx0213_pair_encmap,
+ JISX0213_ENCPAIRS);
+ if (code == DBCINV)
+ return 1;
+ }
+ else
+ return MBERR_TOOFEW;
+ }
+ else {
+ Py_UCS4 c2 = INCHAR2;
+ code = find_pairencmap(
+ (ucs2_t)c, c2,
+ jisx0213_pair_encmap,
+ JISX0213_ENCPAIRS);
+ if (code == DBCINV) {
+ code = find_pairencmap(
+ (ucs2_t)c, 0,
+ jisx0213_pair_encmap,
+ JISX0213_ENCPAIRS);
+ if (code == DBCINV)
+ return 1;
+ } else
+ insize = 2;
+ }
+ }
+ }
+ else if (TRYMAP_ENC(jisxcommon, code, c))
+ ;
+ else if (c >= 0xff61 && c <= 0xff9f) {
+ /* JIS X 0201 half-width katakana */
+ WRITEBYTE2(0x8e, c - 0xfec0);
+ NEXT(1, 2);
+ continue;
+ }
+ else if (c == 0xff3c)
+ /* F/W REVERSE SOLIDUS (see NOTES) */
+ code = 0x2140;
+ else if (c == 0xff5e)
+ /* F/W TILDE (see NOTES) */
+ code = 0x2232;
+ else
+ return 1;
+ }
+ else if (c >> 16 == EMPBASE >> 16) {
+ EMULATE_JISX0213_2000_ENCODE_EMP(codec->config, code, c)
+ else if (TRYMAP_ENC(jisx0213_emp, code, c & 0xffff))
+ ;
+ else
+ return insize;
+ }
+ else
+ return insize;
+
+ if (code & 0x8000) {
+ /* Codeset 2 */
+ WRITEBYTE3(0x8f, code >> 8, (code & 0xFF) | 0x80);
+ NEXT(insize, 3);
+ } else {
+ /* Codeset 1 */
+ WRITEBYTE2((code >> 8) | 0x80, (code & 0xFF) | 0x80);
+ NEXT(insize, 2);
+ }
+ }
+
+ return 0;
+}
+
+DECODER(euc_jis_2004)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 code, decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ if (c == 0x8e) {
+ /* JIS X 0201 half-width katakana */
+ unsigned char c2;
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+ if (c2 >= 0xa1 && c2 <= 0xdf) {
+ OUTCHAR(0xfec0 + c2);
+ NEXT_IN(2);
+ }
+ else
+ return 1;
+ }
+ else if (c == 0x8f) {
+ unsigned char c2, c3;
+
+ REQUIRE_INBUF(3);
+ c2 = INBYTE2 ^ 0x80;
+ c3 = INBYTE3 ^ 0x80;
+
+ /* JIS X 0213 Plane 2 or JIS X 0212 (see NOTES) */
+ EMULATE_JISX0213_2000_DECODE_PLANE2(codec->config, writer, c2, c3)
+ else if (TRYMAP_DEC(jisx0213_2_bmp, decoded, c2, c3))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(jisx0213_2_emp, code, c2, c3)) {
+ OUTCHAR(EMPBASE | code);
+ NEXT_IN(3);
+ continue;
+ }
+ else if (TRYMAP_DEC(jisx0212, decoded, c2, c3))
+ OUTCHAR(decoded);
+ else
+ return 1;
+ NEXT_IN(3);
+ }
+ else {
+ unsigned char c2;
+
+ REQUIRE_INBUF(2);
+ c ^= 0x80;
+ c2 = INBYTE2 ^ 0x80;
+
+ /* JIS X 0213 Plane 1 */
+ EMULATE_JISX0213_2000_DECODE_PLANE1(codec->config, writer, c, c2)
+ else if (c == 0x21 && c2 == 0x40)
+ OUTCHAR(0xff3c);
+ else if (c == 0x22 && c2 == 0x32)
+ OUTCHAR(0xff5e);
+ else if (TRYMAP_DEC(jisx0208, decoded, c, c2))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(jisx0213_1_bmp, decoded, c, c2))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(jisx0213_1_emp, code, c, c2)) {
+ OUTCHAR(EMPBASE | code);
+ NEXT_IN(2);
+ continue;
+ }
+ else if (TRYMAP_DEC(jisx0213_pair, code, c, c2)) {
+ OUTCHAR2(code >> 16, code & 0xffff);
+ NEXT_IN(2);
+ continue;
+ }
+ else
+ return 1;
+ NEXT_IN(2);
+ }
+ }
+
+ return 0;
+}
+
+
+/*
+ * EUC-JP codec
+ */
+
+ENCODER(euc_jp)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ if (TRYMAP_ENC(jisxcommon, code, c))
+ ;
+ else if (c >= 0xff61 && c <= 0xff9f) {
+ /* JIS X 0201 half-width katakana */
+ WRITEBYTE2(0x8e, c - 0xfec0);
+ NEXT(1, 2);
+ continue;
+ }
+#ifndef STRICT_BUILD
+ else if (c == 0xff3c) /* FULL-WIDTH REVERSE SOLIDUS */
+ code = 0x2140;
+ else if (c == 0xa5) { /* YEN SIGN */
+ WRITEBYTE1(0x5c);
+ NEXT(1, 1);
+ continue;
+ } else if (c == 0x203e) { /* OVERLINE */
+ WRITEBYTE1(0x7e);
+ NEXT(1, 1);
+ continue;
+ }
+#endif
+ else
+ return 1;
+
+ if (code & 0x8000) {
+ /* JIS X 0212 */
+ WRITEBYTE3(0x8f, code >> 8, (code & 0xFF) | 0x80);
+ NEXT(1, 3);
+ } else {
+ /* JIS X 0208 */
+ WRITEBYTE2((code >> 8) | 0x80, (code & 0xFF) | 0x80);
+ NEXT(1, 2);
+ }
+ }
+
+ return 0;
+}
+
+DECODER(euc_jp)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ if (c == 0x8e) {
+ /* JIS X 0201 half-width katakana */
+ unsigned char c2;
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+ if (c2 >= 0xa1 && c2 <= 0xdf) {
+ OUTCHAR(0xfec0 + c2);
+ NEXT_IN(2);
+ }
+ else
+ return 1;
+ }
+ else if (c == 0x8f) {
+ unsigned char c2, c3;
+
+ REQUIRE_INBUF(3);
+ c2 = INBYTE2;
+ c3 = INBYTE3;
+ /* JIS X 0212 */
+ if (TRYMAP_DEC(jisx0212, decoded, c2 ^ 0x80, c3 ^ 0x80)) {
+ OUTCHAR(decoded);
+ NEXT_IN(3);
+ }
+ else
+ return 1;
+ }
+ else {
+ unsigned char c2;
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+ /* JIS X 0208 */
+#ifndef STRICT_BUILD
+ if (c == 0xa1 && c2 == 0xc0)
+ /* FULL-WIDTH REVERSE SOLIDUS */
+ OUTCHAR(0xff3c);
+ else
+#endif
+ if (TRYMAP_DEC(jisx0208, decoded, c ^ 0x80, c2 ^ 0x80))
+ OUTCHAR(decoded);
+ else
+ return 1;
+ NEXT_IN(2);
+ }
+ }
+
+ return 0;
+}
+
+
+/*
+ * SHIFT_JIS codec
+ */
+
+ENCODER(shift_jis)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+ unsigned char c1, c2;
+
+#ifdef STRICT_BUILD
+ JISX0201_R_ENCODE(c, code)
+#else
+ if (c < 0x80)
+ code = c;
+ else if (c == 0x00a5)
+ code = 0x5c; /* YEN SIGN */
+ else if (c == 0x203e)
+ code = 0x7e; /* OVERLINE */
+#endif
+ else JISX0201_K_ENCODE(c, code)
+ else if (c > 0xFFFF)
+ return 1;
+ else
+ code = NOCHAR;
+
+ if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
+ REQUIRE_OUTBUF(1);
+
+ OUTBYTE1((unsigned char)code);
+ NEXT(1, 1);
+ continue;
+ }
+
+ REQUIRE_OUTBUF(2);
+
+ if (code == NOCHAR) {
+ if (TRYMAP_ENC(jisxcommon, code, c))
+ ;
+#ifndef STRICT_BUILD
+ else if (c == 0xff3c)
+ code = 0x2140; /* FULL-WIDTH REVERSE SOLIDUS */
+#endif
+ else
+ return 1;
+
+ if (code & 0x8000) /* MSB set: JIS X 0212 */
+ return 1;
+ }
+
+ c1 = code >> 8;
+ c2 = code & 0xff;
+ c2 = (((c1 - 0x21) & 1) ? 0x5e : 0) + (c2 - 0x21);
+ c1 = (c1 - 0x21) >> 1;
+ OUTBYTE1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1);
+ OUTBYTE2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41);
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(shift_jis)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+#ifdef STRICT_BUILD
+ JISX0201_R_DECODE(c, writer)
+#else
+ if (c < 0x80)
+ OUTCHAR(c);
+#endif
+ else JISX0201_K_DECODE(c, writer)
+ else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)){
+ unsigned char c1, c2;
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+ if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
+ return 1;
+
+ c1 = (c < 0xe0 ? c - 0x81 : c - 0xc1);
+ c2 = (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41);
+ c1 = (2 * c1 + (c2 < 0x5e ? 0 : 1) + 0x21);
+ c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21;
+
+#ifndef STRICT_BUILD
+ if (c1 == 0x21 && c2 == 0x40) {
+ /* FULL-WIDTH REVERSE SOLIDUS */
+ OUTCHAR(0xff3c);
+ NEXT_IN(2);
+ continue;
+ }
+#endif
+ if (TRYMAP_DEC(jisx0208, decoded, c1, c2)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ continue;
+ }
+ else
+ return 1;
+ }
+ else
+ return 1;
+
+ NEXT_IN(1); /* JIS X 0201 */
+ }
+
+ return 0;
+}
+
+
+/*
+ * SHIFT_JIS-2004 codec
+ */
+
+ENCODER(shift_jis_2004)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code = NOCHAR;
+ int c1, c2;
+ Py_ssize_t insize;
+
+ JISX0201_ENCODE(c, code)
+
+ if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) {
+ WRITEBYTE1((unsigned char)code);
+ NEXT(1, 1);
+ continue;
+ }
+
+ REQUIRE_OUTBUF(2);
+ insize = 1;
+
+ if (code == NOCHAR) {
+ if (c <= 0xffff) {
+ EMULATE_JISX0213_2000_ENCODE_BMP(codec->config, code, c)
+ else if (TRYMAP_ENC(jisx0213_bmp, code, c)) {
+ if (code == MULTIC) {
+ if (inlen - *inpos < 2) {
+ if (flags & MBENC_FLUSH) {
+ code = find_pairencmap
+ ((ucs2_t)c, 0,
+ jisx0213_pair_encmap,
+ JISX0213_ENCPAIRS);
+ if (code == DBCINV)
+ return 1;
+ }
+ else
+ return MBERR_TOOFEW;
+ }
+ else {
+ Py_UCS4 ch2 = INCHAR2;
+ code = find_pairencmap(
+ (ucs2_t)c, ch2,
+ jisx0213_pair_encmap,
+ JISX0213_ENCPAIRS);
+ if (code == DBCINV) {
+ code = find_pairencmap(
+ (ucs2_t)c, 0,
+ jisx0213_pair_encmap,
+ JISX0213_ENCPAIRS);
+ if (code == DBCINV)
+ return 1;
+ }
+ else
+ insize = 2;
+ }
+ }
+ }
+ else if (TRYMAP_ENC(jisxcommon, code, c)) {
+ /* abandon JIS X 0212 codes */
+ if (code & 0x8000)
+ return 1;
+ }
+ else
+ return 1;
+ }
+ else if (c >> 16 == EMPBASE >> 16) {
+ EMULATE_JISX0213_2000_ENCODE_EMP(codec->config, code, c)
+ else if (TRYMAP_ENC(jisx0213_emp, code, c&0xffff))
+ ;
+ else
+ return insize;
+ }
+ else
+ return insize;
+ }
+
+ c1 = code >> 8;
+ c2 = (code & 0xff) - 0x21;
+
+ if (c1 & 0x80) {
+ /* Plane 2 */
+ if (c1 >= 0xee)
+ c1 -= 0x87;
+ else if (c1 >= 0xac || c1 == 0xa8)
+ c1 -= 0x49;
+ else
+ c1 -= 0x43;
+ }
+ else {
+ /* Plane 1 */
+ c1 -= 0x21;
+ }
+
+ if (c1 & 1)
+ c2 += 0x5e;
+ c1 >>= 1;
+ OUTBYTE1(c1 + (c1 < 0x1f ? 0x81 : 0xc1));
+ OUTBYTE2(c2 + (c2 < 0x3f ? 0x40 : 0x41));
+
+ NEXT(insize, 2);
+ }
+
+ return 0;
+}
+
+DECODER(shift_jis_2004)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+
+ JISX0201_DECODE(c, writer)
+ else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)){
+ unsigned char c1, c2;
+ Py_UCS4 code, decoded;
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+ if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
+ return 1;
+
+ c1 = (c < 0xe0 ? c - 0x81 : c - 0xc1);
+ c2 = (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41);
+ c1 = (2 * c1 + (c2 < 0x5e ? 0 : 1));
+ c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21;
+
+ if (c1 < 0x5e) { /* Plane 1 */
+ c1 += 0x21;
+ EMULATE_JISX0213_2000_DECODE_PLANE1(codec->config, writer,
+ c1, c2)
+ else if (TRYMAP_DEC(jisx0208, decoded, c1, c2))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(jisx0213_1_bmp, decoded, c1, c2))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(jisx0213_1_emp, code, c1, c2))
+ OUTCHAR(EMPBASE | code);
+ else if (TRYMAP_DEC(jisx0213_pair, code, c1, c2))
+ OUTCHAR2(code >> 16, code & 0xffff);
+ else
+ return 1;
+ NEXT_IN(2);
+ }
+ else { /* Plane 2 */
+ if (c1 >= 0x67)
+ c1 += 0x07;
+ else if (c1 >= 0x63 || c1 == 0x5f)
+ c1 -= 0x37;
+ else
+ c1 -= 0x3d;
+
+ EMULATE_JISX0213_2000_DECODE_PLANE2(codec->config, writer,
+ c1, c2)
+ else if (TRYMAP_DEC(jisx0213_2_bmp, decoded, c1, c2))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(jisx0213_2_emp, code, c1, c2)) {
+ OUTCHAR(EMPBASE | code);
+ NEXT_IN(2);
+ continue;
+ }
+ else
+ return 1;
+ NEXT_IN(2);
+ }
+ continue;
+ }
+ else
+ return 1;
+
+ NEXT_IN(1); /* JIS X 0201 */
+ }
+
+ return 0;
+}
+
+
+BEGIN_MAPPINGS_LIST(11)
+ MAPPING_DECONLY(jisx0208)
+ MAPPING_DECONLY(jisx0212)
+ MAPPING_ENCONLY(jisxcommon)
+ MAPPING_DECONLY(jisx0213_1_bmp)
+ MAPPING_DECONLY(jisx0213_2_bmp)
+ MAPPING_ENCONLY(jisx0213_bmp)
+ MAPPING_DECONLY(jisx0213_1_emp)
+ MAPPING_DECONLY(jisx0213_2_emp)
+ MAPPING_ENCONLY(jisx0213_emp)
+ MAPPING_ENCDEC(jisx0213_pair)
+ MAPPING_ENCDEC(cp932ext)
+END_MAPPINGS_LIST
+
+#define CODEC_CUSTOM(NAME, N, METH) \
+ NEXT_CODEC = (MultibyteCodec){NAME, (void *)N, NULL, _STATELESS_METHODS(METH)};
+
+BEGIN_CODECS_LIST(7)
+ CODEC_STATELESS(shift_jis)
+ CODEC_STATELESS(cp932)
+ CODEC_STATELESS(euc_jp)
+ CODEC_STATELESS(shift_jis_2004)
+ CODEC_STATELESS(euc_jis_2004)
+ CODEC_CUSTOM("euc_jisx0213", 2000, euc_jis_2004)
+ CODEC_CUSTOM("shift_jisx0213", 2000, shift_jis_2004)
+END_CODECS_LIST
+
+#undef CODEC_CUSTOM
+
+I_AM_A_MODULE_FOR(jp)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c
new file mode 100644
index 00000000000..fd9a9fd92db
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_kr.c
@@ -0,0 +1,468 @@
+/*
+ * _codecs_kr.c: Codecs collection for Korean encodings
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#include "cjkcodecs.h"
+#include "mappings_kr.h"
+
+/*
+ * EUC-KR codec
+ */
+
+#define EUCKR_JAMO_FIRSTBYTE 0xA4
+#define EUCKR_JAMO_FILLER 0xD4
+
+static const unsigned char u2cgk_choseong[19] = {
+ 0xa1, 0xa2, 0xa4, 0xa7, 0xa8, 0xa9, 0xb1, 0xb2,
+ 0xb3, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb,
+ 0xbc, 0xbd, 0xbe
+};
+static const unsigned char u2cgk_jungseong[21] = {
+ 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6,
+ 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce,
+ 0xcf, 0xd0, 0xd1, 0xd2, 0xd3
+};
+static const unsigned char u2cgk_jongseong[28] = {
+ 0xd4, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,
+ 0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xba,
+ 0xbb, 0xbc, 0xbd, 0xbe
+};
+
+ENCODER(euc_kr)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+ if (TRYMAP_ENC(cp949, code, c))
+ ;
+ else
+ return 1;
+
+ if ((code & 0x8000) == 0) {
+ /* KS X 1001 coded character */
+ OUTBYTE1((code >> 8) | 0x80);
+ OUTBYTE2((code & 0xFF) | 0x80);
+ NEXT(1, 2);
+ }
+ else {
+ /* Mapping is found in CP949 extension,
+ but we encode it in KS X 1001:1998,
+ make-up sequence for EUC-KR. */
+
+ REQUIRE_OUTBUF(8);
+
+ /* syllable composition precedence */
+ OUTBYTE1(EUCKR_JAMO_FIRSTBYTE);
+ OUTBYTE2(EUCKR_JAMO_FILLER);
+
+ /* All code points in CP949 extension are in unicode
+ * Hangul Syllable area. */
+ assert(0xac00 <= c && c <= 0xd7a3);
+ c -= 0xac00;
+
+ OUTBYTE3(EUCKR_JAMO_FIRSTBYTE);
+ OUTBYTE4(u2cgk_choseong[c / 588]);
+ NEXT_OUT(4);
+
+ OUTBYTE1(EUCKR_JAMO_FIRSTBYTE);
+ OUTBYTE2(u2cgk_jungseong[(c / 28) % 21]);
+ OUTBYTE3(EUCKR_JAMO_FIRSTBYTE);
+ OUTBYTE4(u2cgk_jongseong[c % 28]);
+ NEXT(1, 4);
+ }
+ }
+
+ return 0;
+}
+
+#define NONE 127
+
+static const unsigned char cgk2u_choseong[] = { /* [A1, BE] */
+ 0, 1, NONE, 2, NONE, NONE, 3, 4,
+ 5, NONE, NONE, NONE, NONE, NONE, NONE, NONE,
+ 6, 7, 8, NONE, 9, 10, 11, 12,
+ 13, 14, 15, 16, 17, 18
+};
+static const unsigned char cgk2u_jongseong[] = { /* [A1, BE] */
+ 1, 2, 3, 4, 5, 6, 7, NONE,
+ 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, NONE, 18, 19, 20, 21, 22,
+ NONE, 23, 24, 25, 26, 27
+};
+
+DECODER(euc_kr)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+
+ if (c == EUCKR_JAMO_FIRSTBYTE &&
+ INBYTE2 == EUCKR_JAMO_FILLER) {
+ /* KS X 1001:1998 make-up sequence */
+ DBCHAR cho, jung, jong;
+
+ REQUIRE_INBUF(8);
+ if ((*inbuf)[2] != EUCKR_JAMO_FIRSTBYTE ||
+ (*inbuf)[4] != EUCKR_JAMO_FIRSTBYTE ||
+ (*inbuf)[6] != EUCKR_JAMO_FIRSTBYTE)
+ return 1;
+
+ c = (*inbuf)[3];
+ if (0xa1 <= c && c <= 0xbe)
+ cho = cgk2u_choseong[c - 0xa1];
+ else
+ cho = NONE;
+
+ c = (*inbuf)[5];
+ jung = (0xbf <= c && c <= 0xd3) ? c - 0xbf : NONE;
+
+ c = (*inbuf)[7];
+ if (c == EUCKR_JAMO_FILLER)
+ jong = 0;
+ else if (0xa1 <= c && c <= 0xbe)
+ jong = cgk2u_jongseong[c - 0xa1];
+ else
+ jong = NONE;
+
+ if (cho == NONE || jung == NONE || jong == NONE)
+ return 1;
+
+ OUTCHAR(0xac00 + cho*588 + jung*28 + jong);
+ NEXT_IN(8);
+ }
+ else if (TRYMAP_DEC(ksx1001, decoded, c ^ 0x80, INBYTE2 ^ 0x80)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ }
+ else
+ return 1;
+ }
+
+ return 0;
+}
+#undef NONE
+
+
+/*
+ * CP949 codec
+ */
+
+ENCODER(cp949)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+ if (TRYMAP_ENC(cp949, code, c))
+ ;
+ else
+ return 1;
+
+ OUTBYTE1((code >> 8) | 0x80);
+ if (code & 0x8000)
+ OUTBYTE2(code & 0xFF); /* MSB set: CP949 */
+ else
+ OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: ks x 1001 */
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(cp949)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+ if (TRYMAP_DEC(ksx1001, decoded, c ^ 0x80, INBYTE2 ^ 0x80))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(cp949ext, decoded, c, INBYTE2))
+ OUTCHAR(decoded);
+ else
+ return 1;
+
+ NEXT_IN(2);
+ }
+
+ return 0;
+}
+
+
+/*
+ * JOHAB codec
+ */
+
+static const unsigned char u2johabidx_choseong[32] = {
+ 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14,
+};
+static const unsigned char u2johabidx_jungseong[32] = {
+ 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x1a, 0x1b, 0x1c, 0x1d,
+};
+static const unsigned char u2johabidx_jongseong[32] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
+};
+static const DBCHAR u2johabjamo[] = {
+ 0x8841, 0x8c41, 0x8444, 0x9041, 0x8446, 0x8447, 0x9441,
+ 0x9841, 0x9c41, 0x844a, 0x844b, 0x844c, 0x844d, 0x844e, 0x844f,
+ 0x8450, 0xa041, 0xa441, 0xa841, 0x8454, 0xac41, 0xb041, 0xb441,
+ 0xb841, 0xbc41, 0xc041, 0xc441, 0xc841, 0xcc41, 0xd041, 0x8461,
+ 0x8481, 0x84a1, 0x84c1, 0x84e1, 0x8541, 0x8561, 0x8581, 0x85a1,
+ 0x85c1, 0x85e1, 0x8641, 0x8661, 0x8681, 0x86a1, 0x86c1, 0x86e1,
+ 0x8741, 0x8761, 0x8781, 0x87a1,
+};
+
+ENCODER(johab)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+
+ if (c >= 0xac00 && c <= 0xd7a3) {
+ c -= 0xac00;
+ code = 0x8000 |
+ (u2johabidx_choseong[c / 588] << 10) |
+ (u2johabidx_jungseong[(c / 28) % 21] << 5) |
+ u2johabidx_jongseong[c % 28];
+ }
+ else if (c >= 0x3131 && c <= 0x3163)
+ code = u2johabjamo[c - 0x3131];
+ else if (TRYMAP_ENC(cp949, code, c)) {
+ unsigned char c1, c2, t2;
+ unsigned short t1;
+
+ assert((code & 0x8000) == 0);
+ c1 = code >> 8;
+ c2 = code & 0xff;
+ if (((c1 >= 0x21 && c1 <= 0x2c) ||
+ (c1 >= 0x4a && c1 <= 0x7d)) &&
+ (c2 >= 0x21 && c2 <= 0x7e)) {
+ t1 = (c1 < 0x4a ? (c1 - 0x21 + 0x1b2) :
+ (c1 - 0x21 + 0x197));
+ t2 = ((t1 & 1) ? 0x5e : 0) + (c2 - 0x21);
+ OUTBYTE1(t1 >> 1);
+ OUTBYTE2(t2 < 0x4e ? t2 + 0x31 : t2 + 0x43);
+ NEXT(1, 2);
+ continue;
+ }
+ else
+ return 1;
+ }
+ else
+ return 1;
+
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xff);
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+#define FILL 0xfd
+#define NONE 0xff
+
+static const unsigned char johabidx_choseong[32] = {
+ NONE, FILL, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,
+ 0x0e, 0x0f, 0x10, 0x11, 0x12, NONE, NONE, NONE,
+ NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE,
+};
+static const unsigned char johabidx_jungseong[32] = {
+ NONE, NONE, FILL, 0x00, 0x01, 0x02, 0x03, 0x04,
+ NONE, NONE, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
+ NONE, NONE, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ NONE, NONE, 0x11, 0x12, 0x13, 0x14, NONE, NONE,
+};
+static const unsigned char johabidx_jongseong[32] = {
+ NONE, FILL, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
+ 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f, 0x10, NONE, 0x11, 0x12, 0x13, 0x14, 0x15,
+ 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, NONE, NONE,
+};
+
+static const unsigned char johabjamo_choseong[32] = {
+ NONE, FILL, 0x31, 0x32, 0x34, 0x37, 0x38, 0x39,
+ 0x41, 0x42, 0x43, 0x45, 0x46, 0x47, 0x48, 0x49,
+ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, NONE, NONE, NONE,
+ NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE,
+};
+static const unsigned char johabjamo_jungseong[32] = {
+ NONE, NONE, FILL, 0x4f, 0x50, 0x51, 0x52, 0x53,
+ NONE, NONE, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
+ NONE, NONE, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ NONE, NONE, 0x60, 0x61, 0x62, 0x63, NONE, NONE,
+};
+static const unsigned char johabjamo_jongseong[32] = {
+ NONE, FILL, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
+ 0x37, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+ 0x40, 0x41, NONE, 0x42, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, NONE, NONE,
+};
+
+DECODER(johab)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1, c2;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+ c2 = INBYTE2;
+
+ if (c < 0xd8) {
+ /* johab hangul */
+ unsigned char c_cho, c_jung, c_jong;
+ unsigned char i_cho, i_jung, i_jong;
+
+ c_cho = (c >> 2) & 0x1f;
+ c_jung = ((c << 3) | c2 >> 5) & 0x1f;
+ c_jong = c2 & 0x1f;
+
+ i_cho = johabidx_choseong[c_cho];
+ i_jung = johabidx_jungseong[c_jung];
+ i_jong = johabidx_jongseong[c_jong];
+
+ if (i_cho == NONE || i_jung == NONE || i_jong == NONE)
+ return 1;
+
+ /* we don't use U+1100 hangul jamo yet. */
+ if (i_cho == FILL) {
+ if (i_jung == FILL) {
+ if (i_jong == FILL)
+ OUTCHAR(0x3000);
+ else
+ OUTCHAR(0x3100 |
+ johabjamo_jongseong[c_jong]);
+ }
+ else {
+ if (i_jong == FILL)
+ OUTCHAR(0x3100 |
+ johabjamo_jungseong[c_jung]);
+ else
+ return 1;
+ }
+ } else {
+ if (i_jung == FILL) {
+ if (i_jong == FILL)
+ OUTCHAR(0x3100 |
+ johabjamo_choseong[c_cho]);
+ else
+ return 1;
+ }
+ else
+ OUTCHAR(0xac00 +
+ i_cho * 588 +
+ i_jung * 28 +
+ (i_jong == FILL ? 0 : i_jong));
+ }
+ NEXT_IN(2);
+ } else {
+ /* KS X 1001 except hangul jamos and syllables */
+ if (c == 0xdf || c > 0xf9 ||
+ c2 < 0x31 || (c2 >= 0x80 && c2 < 0x91) ||
+ (c2 & 0x7f) == 0x7f ||
+ (c == 0xda && (c2 >= 0xa1 && c2 <= 0xd3)))
+ return 1;
+ else {
+ unsigned char t1, t2;
+
+ t1 = (c < 0xe0 ? 2 * (c - 0xd9) :
+ 2 * c - 0x197);
+ t2 = (c2 < 0x91 ? c2 - 0x31 : c2 - 0x43);
+ t1 = t1 + (t2 < 0x5e ? 0 : 1) + 0x21;
+ t2 = (t2 < 0x5e ? t2 : t2 - 0x5e) + 0x21;
+
+ if (TRYMAP_DEC(ksx1001, decoded, t1, t2)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ }
+ else {
+ return 1;
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+#undef NONE
+#undef FILL
+
+
+BEGIN_MAPPINGS_LIST(3)
+ MAPPING_DECONLY(ksx1001)
+ MAPPING_ENCONLY(cp949)
+ MAPPING_DECONLY(cp949ext)
+END_MAPPINGS_LIST
+
+BEGIN_CODECS_LIST(3)
+ CODEC_STATELESS(euc_kr)
+ CODEC_STATELESS(cp949)
+ CODEC_STATELESS(johab)
+END_CODECS_LIST
+
+I_AM_A_MODULE_FOR(kr)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c b/contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c
new file mode 100644
index 00000000000..3e440991414
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/_codecs_tw.c
@@ -0,0 +1,143 @@
+/*
+ * _codecs_tw.c: Codecs collection for Taiwan's encodings
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#include "cjkcodecs.h"
+#include "mappings_tw.h"
+
+/*
+ * BIG5 codec
+ */
+
+ENCODER(big5)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ REQUIRE_OUTBUF(1);
+ **outbuf = (unsigned char)c;
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+
+ if (TRYMAP_ENC(big5, code, c))
+ ;
+ else
+ return 1;
+
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xFF);
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(big5)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+ if (TRYMAP_DEC(big5, decoded, c, INBYTE2)) {
+ OUTCHAR(decoded);
+ NEXT_IN(2);
+ }
+ else return 1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * CP950 codec
+ */
+
+ENCODER(cp950)
+{
+ while (*inpos < inlen) {
+ Py_UCS4 c = INCHAR1;
+ DBCHAR code;
+
+ if (c < 0x80) {
+ WRITEBYTE1((unsigned char)c);
+ NEXT(1, 1);
+ continue;
+ }
+
+ if (c > 0xFFFF)
+ return 1;
+
+ REQUIRE_OUTBUF(2);
+ if (TRYMAP_ENC(cp950ext, code, c))
+ ;
+ else if (TRYMAP_ENC(big5, code, c))
+ ;
+ else
+ return 1;
+
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xFF);
+ NEXT(1, 2);
+ }
+
+ return 0;
+}
+
+DECODER(cp950)
+{
+ while (inleft > 0) {
+ unsigned char c = INBYTE1;
+ Py_UCS4 decoded;
+
+ if (c < 0x80) {
+ OUTCHAR(c);
+ NEXT_IN(1);
+ continue;
+ }
+
+ REQUIRE_INBUF(2);
+
+ if (TRYMAP_DEC(cp950ext, decoded, c, INBYTE2))
+ OUTCHAR(decoded);
+ else if (TRYMAP_DEC(big5, decoded, c, INBYTE2))
+ OUTCHAR(decoded);
+ else
+ return 1;
+
+ NEXT_IN(2);
+ }
+
+ return 0;
+}
+
+
+
+BEGIN_MAPPINGS_LIST(2)
+ MAPPING_ENCDEC(big5)
+ MAPPING_ENCDEC(cp950ext)
+END_MAPPINGS_LIST
+
+BEGIN_CODECS_LIST(2)
+ CODEC_STATELESS(big5)
+ CODEC_STATELESS(cp950)
+END_CODECS_LIST
+
+I_AM_A_MODULE_FOR(tw)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h b/contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h
new file mode 100644
index 00000000000..3034b5ab9df
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/alg_jisx0201.h
@@ -0,0 +1,65 @@
+#define JISX0201_R_ENCODE(c, assi) \
+ if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) { \
+ (assi) = (c); \
+ } \
+ else if ((c) == 0x00a5) { \
+ (assi) = 0x5c; \
+ } \
+ else if ((c) == 0x203e) { \
+ (assi) = 0x7e; \
+ }
+
+#define JISX0201_K_ENCODE(c, assi) \
+ if ((c) >= 0xff61 && (c) <= 0xff9f) { \
+ (assi) = (c) - 0xfec0; \
+ }
+
+#define JISX0201_ENCODE(c, assi) \
+ JISX0201_R_ENCODE(c, assi) \
+ else JISX0201_K_ENCODE(c, assi)
+
+#define JISX0201_R_DECODE_CHAR(c, assi) \
+ if ((c) < 0x5c) { \
+ (assi) = (c); \
+ } \
+ else if ((c) == 0x5c) { \
+ (assi) = 0x00a5; \
+ } \
+ else if ((c) < 0x7e) { \
+ (assi) = (c); \
+ } \
+ else if ((c) == 0x7e) { \
+ (assi) = 0x203e; \
+ } \
+ else if ((c) == 0x7f) { \
+ (assi) = 0x7f; \
+ }
+
+#define JISX0201_R_DECODE(c, writer) \
+ if ((c) < 0x5c) { \
+ OUTCHAR(c); \
+ } \
+ else if ((c) == 0x5c) { \
+ OUTCHAR(0x00a5); \
+ } \
+ else if ((c) < 0x7e) { \
+ OUTCHAR(c); \
+ } \
+ else if ((c) == 0x7e) { \
+ OUTCHAR(0x203e); \
+ } \
+ else if ((c) == 0x7f) { \
+ OUTCHAR(0x7f); \
+ }
+
+#define JISX0201_K_DECODE(c, writer) \
+ if ((c) >= 0xa1 && (c) <= 0xdf) { \
+ OUTCHAR(0xfec0 + (c)); \
+ }
+#define JISX0201_K_DECODE_CHAR(c, assi) \
+ if ((c) >= 0xa1 && (c) <= 0xdf) { \
+ (assi) = 0xfec0 + (c); \
+ }
+#define JISX0201_DECODE(c, writer) \
+ JISX0201_R_DECODE(c, writer) \
+ else JISX0201_K_DECODE(c, writer)
diff --git a/contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h b/contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h
new file mode 100644
index 00000000000..36bc7024df9
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/cjkcodecs.h
@@ -0,0 +1,525 @@
+/*
+ * cjkcodecs.h: common header for cjkcodecs
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#ifndef _CJKCODECS_H_
+#define _CJKCODECS_H_
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "multibytecodec.h"
+
+
+/* a unicode "undefined" code point */
+#define UNIINV 0xFFFE
+
+/* internal-use DBCS code points which aren't used by any charsets */
+#define NOCHAR 0xFFFF
+#define MULTIC 0xFFFE
+#define DBCINV 0xFFFD
+
+/* shorter macros to save source size of mapping tables */
+#define U UNIINV
+#define N NOCHAR
+#define M MULTIC
+#define D DBCINV
+
+struct dbcs_index {
+ const ucs2_t *map;
+ unsigned char bottom, top;
+};
+typedef struct dbcs_index decode_map;
+
+struct widedbcs_index {
+ const Py_UCS4 *map;
+ unsigned char bottom, top;
+};
+typedef struct widedbcs_index widedecode_map;
+
+struct unim_index {
+ const DBCHAR *map;
+ unsigned char bottom, top;
+};
+typedef struct unim_index encode_map;
+
+struct unim_index_bytebased {
+ const unsigned char *map;
+ unsigned char bottom, top;
+};
+
+struct dbcs_map {
+ const char *charset;
+ const struct unim_index *encmap;
+ const struct dbcs_index *decmap;
+};
+
+struct pair_encodemap {
+ Py_UCS4 uniseq;
+ DBCHAR code;
+};
+
+#ifndef CJK_MOD_SPECIFIC_STATE
+#define CJK_MOD_SPECIFIC_STATE
+#endif
+
+typedef struct _cjk_mod_state {
+ int num_mappings;
+ int num_codecs;
+ struct dbcs_map *mapping_list;
+ MultibyteCodec *codec_list;
+
+ CJK_MOD_SPECIFIC_STATE
+} cjkcodecs_module_state;
+
+static inline cjkcodecs_module_state *
+get_module_state(PyObject *mod)
+{
+ void *state = PyModule_GetState(mod);
+ assert(state != NULL);
+ return (cjkcodecs_module_state *)state;
+}
+
+#define CODEC_INIT(encoding) \
+ static int encoding##_codec_init(const MultibyteCodec *codec)
+
+#define ENCODER_INIT(encoding) \
+ static int encoding##_encode_init( \
+ MultibyteCodec_State *state, const MultibyteCodec *codec)
+#define ENCODER(encoding) \
+ static Py_ssize_t encoding##_encode( \
+ MultibyteCodec_State *state, const MultibyteCodec *codec, \
+ int kind, const void *data, \
+ Py_ssize_t *inpos, Py_ssize_t inlen, \
+ unsigned char **outbuf, Py_ssize_t outleft, int flags)
+#define ENCODER_RESET(encoding) \
+ static Py_ssize_t encoding##_encode_reset( \
+ MultibyteCodec_State *state, const MultibyteCodec *codec, \
+ unsigned char **outbuf, Py_ssize_t outleft)
+
+#define DECODER_INIT(encoding) \
+ static int encoding##_decode_init( \
+ MultibyteCodec_State *state, const MultibyteCodec *codec)
+#define DECODER(encoding) \
+ static Py_ssize_t encoding##_decode( \
+ MultibyteCodec_State *state, const MultibyteCodec *codec, \
+ const unsigned char **inbuf, Py_ssize_t inleft, \
+ _PyUnicodeWriter *writer)
+#define DECODER_RESET(encoding) \
+ static Py_ssize_t encoding##_decode_reset( \
+ MultibyteCodec_State *state, const MultibyteCodec *codec)
+
+#define NEXT_IN(i) \
+ do { \
+ (*inbuf) += (i); \
+ (inleft) -= (i); \
+ } while (0)
+#define NEXT_INCHAR(i) \
+ do { \
+ (*inpos) += (i); \
+ } while (0)
+#define NEXT_OUT(o) \
+ do { \
+ (*outbuf) += (o); \
+ (outleft) -= (o); \
+ } while (0)
+#define NEXT(i, o) \
+ do { \
+ NEXT_INCHAR(i); \
+ NEXT_OUT(o); \
+ } while (0)
+
+#define REQUIRE_INBUF(n) \
+ do { \
+ if (inleft < (n)) \
+ return MBERR_TOOFEW; \
+ } while (0)
+
+#define REQUIRE_OUTBUF(n) \
+ do { \
+ if (outleft < (n)) \
+ return MBERR_TOOSMALL; \
+ } while (0)
+
+#define INBYTE1 ((*inbuf)[0])
+#define INBYTE2 ((*inbuf)[1])
+#define INBYTE3 ((*inbuf)[2])
+#define INBYTE4 ((*inbuf)[3])
+
+#define INCHAR1 (PyUnicode_READ(kind, data, *inpos))
+#define INCHAR2 (PyUnicode_READ(kind, data, *inpos + 1))
+
+#define OUTCHAR(c) \
+ do { \
+ if (_PyUnicodeWriter_WriteChar(writer, (c)) < 0) \
+ return MBERR_EXCEPTION; \
+ } while (0)
+
+#define OUTCHAR2(c1, c2) \
+ do { \
+ Py_UCS4 _c1 = (c1); \
+ Py_UCS4 _c2 = (c2); \
+ if (_PyUnicodeWriter_Prepare(writer, 2, Py_MAX(_c1, c2)) < 0) \
+ return MBERR_EXCEPTION; \
+ PyUnicode_WRITE(writer->kind, writer->data, writer->pos, _c1); \
+ PyUnicode_WRITE(writer->kind, writer->data, writer->pos + 1, _c2); \
+ writer->pos += 2; \
+ } while (0)
+
+#define OUTBYTEI(c, i) \
+ do { \
+ assert((unsigned char)(c) == (c)); \
+ ((*outbuf)[i]) = (c); \
+ } while (0)
+
+#define OUTBYTE1(c) OUTBYTEI(c, 0)
+#define OUTBYTE2(c) OUTBYTEI(c, 1)
+#define OUTBYTE3(c) OUTBYTEI(c, 2)
+#define OUTBYTE4(c) OUTBYTEI(c, 3)
+
+#define WRITEBYTE1(c1) \
+ do { \
+ REQUIRE_OUTBUF(1); \
+ OUTBYTE1(c1); \
+ } while (0)
+#define WRITEBYTE2(c1, c2) \
+ do { \
+ REQUIRE_OUTBUF(2); \
+ OUTBYTE1(c1); \
+ OUTBYTE2(c2); \
+ } while (0)
+#define WRITEBYTE3(c1, c2, c3) \
+ do { \
+ REQUIRE_OUTBUF(3); \
+ OUTBYTE1(c1); \
+ OUTBYTE2(c2); \
+ OUTBYTE3(c3); \
+ } while (0)
+#define WRITEBYTE4(c1, c2, c3, c4) \
+ do { \
+ REQUIRE_OUTBUF(4); \
+ OUTBYTE1(c1); \
+ OUTBYTE2(c2); \
+ OUTBYTE3(c3); \
+ OUTBYTE4(c4); \
+ } while (0)
+
+#define _TRYMAP_ENC(m, assi, val) \
+ ((m)->map != NULL && (val) >= (m)->bottom && \
+ (val)<= (m)->top && ((assi) = (m)->map[(val) - \
+ (m)->bottom]) != NOCHAR)
+#define TRYMAP_ENC(charset, assi, uni) \
+ _TRYMAP_ENC(&charset##_encmap[(uni) >> 8], assi, (uni) & 0xff)
+#define TRYMAP_ENC_ST(charset, assi, uni) \
+ _TRYMAP_ENC(&(codec->modstate->charset##_encmap)[(uni) >> 8], \
+ assi, (uni) & 0xff)
+
+#define _TRYMAP_DEC(m, assi, val) \
+ ((m)->map != NULL && \
+ (val) >= (m)->bottom && \
+ (val)<= (m)->top && \
+ ((assi) = (m)->map[(val) - (m)->bottom]) != UNIINV)
+#define TRYMAP_DEC(charset, assi, c1, c2) \
+ _TRYMAP_DEC(&charset##_decmap[c1], assi, c2)
+#define TRYMAP_DEC_ST(charset, assi, c1, c2) \
+ _TRYMAP_DEC(&(codec->modstate->charset##_decmap)[c1], assi, c2)
+
+#define BEGIN_MAPPINGS_LIST(NUM) \
+static int \
+add_mappings(cjkcodecs_module_state *st) \
+{ \
+ int idx = 0; \
+ (void)idx; \
+ st->num_mappings = NUM; \
+ st->mapping_list = PyMem_Calloc(NUM, sizeof(struct dbcs_map)); \
+ if (st->mapping_list == NULL) { \
+ return -1; \
+ }
+
+#define MAPPING_ENCONLY(enc) \
+ st->mapping_list[idx++] = (struct dbcs_map){#enc, (void*)enc##_encmap, NULL};
+#define MAPPING_DECONLY(enc) \
+ st->mapping_list[idx++] = (struct dbcs_map){#enc, NULL, (void*)enc##_decmap};
+#define MAPPING_ENCDEC(enc) \
+ st->mapping_list[idx++] = (struct dbcs_map){#enc, (void*)enc##_encmap, (void*)enc##_decmap};
+
+#define END_MAPPINGS_LIST \
+ assert(st->num_mappings == idx); \
+ return 0; \
+}
+
+#define BEGIN_CODECS_LIST(NUM) \
+static int \
+add_codecs(cjkcodecs_module_state *st) \
+{ \
+ int idx = 0; \
+ (void)idx; \
+ st->num_codecs = NUM; \
+ st->codec_list = PyMem_Calloc(NUM, sizeof(MultibyteCodec)); \
+ if (st->codec_list == NULL) { \
+ return -1; \
+ }
+
+#define _STATEFUL_METHODS(enc) \
+ enc##_encode, \
+ enc##_encode_init, \
+ enc##_encode_reset, \
+ enc##_decode, \
+ enc##_decode_init, \
+ enc##_decode_reset,
+#define _STATELESS_METHODS(enc) \
+ enc##_encode, NULL, NULL, \
+ enc##_decode, NULL, NULL,
+
+#define NEXT_CODEC \
+ st->codec_list[idx++]
+
+#define CODEC_STATEFUL(enc) \
+ NEXT_CODEC = (MultibyteCodec){#enc, NULL, NULL, _STATEFUL_METHODS(enc)};
+#define CODEC_STATELESS(enc) \
+ NEXT_CODEC = (MultibyteCodec){#enc, NULL, NULL, _STATELESS_METHODS(enc)};
+#define CODEC_STATELESS_WINIT(enc) \
+ NEXT_CODEC = (MultibyteCodec){#enc, NULL, enc##_codec_init, _STATELESS_METHODS(enc)};
+
+#define END_CODECS_LIST \
+ assert(st->num_codecs == idx); \
+ for (int i = 0; i < st->num_codecs; i++) { \
+ st->codec_list[i].modstate = st; \
+ } \
+ return 0; \
+}
+
+
+
+static PyObject *
+getmultibytecodec(void)
+{
+ return _PyImport_GetModuleAttrString("_multibytecodec", "__create_codec");
+}
+
+static void
+destroy_codec_capsule(PyObject *capsule)
+{
+ void *ptr = PyCapsule_GetPointer(capsule, CODEC_CAPSULE);
+ codec_capsule *data = (codec_capsule *)ptr;
+ Py_DECREF(data->cjk_module);
+ PyMem_Free(ptr);
+}
+
+static codec_capsule *
+capsulate_codec(PyObject *mod, const MultibyteCodec *codec)
+{
+ codec_capsule *data = PyMem_Malloc(sizeof(codec_capsule));
+ if (data == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ data->codec = codec;
+ data->cjk_module = Py_NewRef(mod);
+ return data;
+}
+
+static PyObject *
+_getcodec(PyObject *self, const MultibyteCodec *codec)
+{
+ PyObject *cofunc = getmultibytecodec();
+ if (cofunc == NULL) {
+ return NULL;
+ }
+
+ codec_capsule *data = capsulate_codec(self, codec);
+ if (data == NULL) {
+ Py_DECREF(cofunc);
+ return NULL;
+ }
+ PyObject *codecobj = PyCapsule_New(data, CODEC_CAPSULE,
+ destroy_codec_capsule);
+ if (codecobj == NULL) {
+ PyMem_Free(data);
+ Py_DECREF(cofunc);
+ return NULL;
+ }
+
+ PyObject *res = PyObject_CallOneArg(cofunc, codecobj);
+ Py_DECREF(codecobj);
+ Py_DECREF(cofunc);
+ return res;
+}
+
+static PyObject *
+getcodec(PyObject *self, PyObject *encoding)
+{
+ if (!PyUnicode_Check(encoding)) {
+ PyErr_SetString(PyExc_TypeError,
+ "encoding name must be a string.");
+ return NULL;
+ }
+ const char *enc = PyUnicode_AsUTF8(encoding);
+ if (enc == NULL) {
+ return NULL;
+ }
+
+ cjkcodecs_module_state *st = get_module_state(self);
+ for (int i = 0; i < st->num_codecs; i++) {
+ const MultibyteCodec *codec = &st->codec_list[i];
+ if (strcmp(codec->encoding, enc) == 0) {
+ return _getcodec(self, codec);
+ }
+ }
+
+ PyErr_SetString(PyExc_LookupError,
+ "no such codec is supported.");
+ return NULL;
+}
+
+static int add_mappings(cjkcodecs_module_state *);
+static int add_codecs(cjkcodecs_module_state *);
+
+static int
+register_maps(PyObject *module)
+{
+ // Init module state.
+ cjkcodecs_module_state *st = get_module_state(module);
+ if (add_mappings(st) < 0) {
+ return -1;
+ }
+ if (add_codecs(st) < 0) {
+ return -1;
+ }
+
+ for (int i = 0; i < st->num_mappings; i++) {
+ const struct dbcs_map *h = &st->mapping_list[i];
+ char mhname[256] = "__map_";
+ strcpy(mhname + sizeof("__map_") - 1, h->charset);
+
+ PyObject *capsule = PyCapsule_New((void *)h, MAP_CAPSULE, NULL);
+ if (capsule == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObject(module, mhname, capsule) < 0) {
+ Py_DECREF(capsule);
+ return -1;
+ }
+ }
+ return 0;
+}
+
+#ifdef USING_BINARY_PAIR_SEARCH
+static DBCHAR
+find_pairencmap(ucs2_t body, ucs2_t modifier,
+ const struct pair_encodemap *haystack, int haystacksize)
+{
+ int pos, min, max;
+ Py_UCS4 value = body << 16 | modifier;
+
+ min = 0;
+ max = haystacksize;
+
+ for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) {
+ if (value < haystack[pos].uniseq) {
+ if (max != pos) {
+ max = pos;
+ continue;
+ }
+ }
+ else if (value > haystack[pos].uniseq) {
+ if (min != pos) {
+ min = pos;
+ continue;
+ }
+ }
+ break;
+ }
+
+ if (value == haystack[pos].uniseq) {
+ return haystack[pos].code;
+ }
+ return DBCINV;
+}
+#endif
+
+#ifdef USING_IMPORTED_MAPS
+#define IMPORT_MAP(locale, charset, encmap, decmap) \
+ importmap("_codecs_" #locale, "__map_" #charset, \
+ (const void**)encmap, (const void**)decmap)
+
+static int
+importmap(const char *modname, const char *symbol,
+ const void **encmap, const void **decmap)
+{
+ PyObject *o, *mod;
+
+ mod = PyImport_ImportModule(modname);
+ if (mod == NULL)
+ return -1;
+
+ o = PyObject_GetAttrString(mod, symbol);
+ if (o == NULL)
+ goto errorexit;
+ else if (!PyCapsule_IsValid(o, MAP_CAPSULE)) {
+ PyErr_SetString(PyExc_ValueError,
+ "map data must be a Capsule.");
+ goto errorexit;
+ }
+ else {
+ struct dbcs_map *map;
+ map = PyCapsule_GetPointer(o, MAP_CAPSULE);
+ if (encmap != NULL)
+ *encmap = map->encmap;
+ if (decmap != NULL)
+ *decmap = map->decmap;
+ Py_DECREF(o);
+ }
+
+ Py_DECREF(mod);
+ return 0;
+
+errorexit:
+ Py_DECREF(mod);
+ return -1;
+}
+#endif
+
+static int
+_cjk_exec(PyObject *module)
+{
+ return register_maps(module);
+}
+
+static void
+_cjk_free(void *mod)
+{
+ cjkcodecs_module_state *st = get_module_state((PyObject *)mod);
+ PyMem_Free(st->mapping_list);
+ PyMem_Free(st->codec_list);
+}
+
+static struct PyMethodDef _cjk_methods[] = {
+ {"getcodec", (PyCFunction)getcodec, METH_O, ""},
+ {NULL, NULL},
+};
+
+static PyModuleDef_Slot _cjk_slots[] = {
+ {Py_mod_exec, _cjk_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+#define I_AM_A_MODULE_FOR(loc) \
+ static struct PyModuleDef _cjk_module = { \
+ PyModuleDef_HEAD_INIT, \
+ .m_name = "_codecs_"#loc, \
+ .m_size = sizeof(cjkcodecs_module_state), \
+ .m_methods = _cjk_methods, \
+ .m_slots = _cjk_slots, \
+ .m_free = _cjk_free, \
+ }; \
+ \
+ PyMODINIT_FUNC \
+ PyInit__codecs_##loc(void) \
+ { \
+ return PyModuleDef_Init(&_cjk_module); \
+ }
+
+#endif
diff --git a/contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h b/contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h
new file mode 100644
index 00000000000..3f200405f4d
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/clinic/multibytecodec.c.h
@@ -0,0 +1,693 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__,
+"encode($self, /, input, errors=None)\n"
+"--\n"
+"\n"
+"Return an encoded string version of `input\'.\n"
+"\n"
+"\'errors\' may be given to set a different error handling scheme. Default is\n"
+"\'strict\' meaning that encoding errors raise a UnicodeEncodeError. Other possible\n"
+"values are \'ignore\', \'replace\' and \'xmlcharrefreplace\' as well as any other name\n"
+"registered with codecs.register_error that can handle UnicodeEncodeErrors.");
+
+#define _MULTIBYTECODEC_MULTIBYTECODEC_ENCODE_METHODDEF \
+ {"encode", _PyCFunction_CAST(_multibytecodec_MultibyteCodec_encode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
+ PyObject *input,
+ const char *errors);
+
+static PyObject *
+_multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(input), &_Py_ID(errors), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"input", "errors", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "encode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *input;
+ const char *errors = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ input = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("encode", "argument 'errors'", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _multibytecodec_MultibyteCodec_encode_impl(self, input, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__,
+"decode($self, /, input, errors=None)\n"
+"--\n"
+"\n"
+"Decodes \'input\'.\n"
+"\n"
+"\'errors\' may be given to set a different error handling scheme. Default is\n"
+"\'strict\' meaning that encoding errors raise a UnicodeDecodeError. Other possible\n"
+"values are \'ignore\' and \'replace\' as well as any other name registered with\n"
+"codecs.register_error that is able to handle UnicodeDecodeErrors.\"");
+
+#define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF \
+ {"decode", _PyCFunction_CAST(_multibytecodec_MultibyteCodec_decode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
+ Py_buffer *input,
+ const char *errors);
+
+static PyObject *
+_multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(input), &_Py_ID(errors), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"input", "errors", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer input = {NULL, NULL};
+ const char *errors = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &input, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&input, 'C')) {
+ _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("decode", "argument 'errors'", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _multibytecodec_MultibyteCodec_decode_impl(self, &input, errors);
+
+exit:
+ /* Cleanup for input */
+ if (input.obj) {
+ PyBuffer_Release(&input);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
+"encode($self, /, input, final=False)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \
+ {"encode", _PyCFunction_CAST(_multibytecodec_MultibyteIncrementalEncoder_encode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
+ PyObject *input,
+ int final);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(input), &_Py_ID(final), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"input", "final", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "encode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *input;
+ int final = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ input = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ final = PyObject_IsTrue(args[1]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _multibytecodec_MultibyteIncrementalEncoder_encode_impl(self, input, final);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_getstate__doc__,
+"getstate($self, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF \
+ {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_getstate(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(self);
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__,
+"setstate($self, state, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF \
+ {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self,
+ PyLongObject *statelong);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoderObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyLongObject *statelong;
+
+ if (!PyLong_Check(arg)) {
+ _PyArg_BadArgument("setstate", "argument", "int", arg);
+ goto exit;
+ }
+ statelong = (PyLongObject *)arg;
+ return_value = _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(self, statelong);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__,
+"reset($self, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \
+ {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self);
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
+"decode($self, /, input, final=False)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \
+ {"decode", _PyCFunction_CAST(_multibytecodec_MultibyteIncrementalDecoder_decode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
+ Py_buffer *input,
+ int final);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(input), &_Py_ID(final), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"input", "final", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer input = {NULL, NULL};
+ int final = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &input, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&input, 'C')) {
+ _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ final = PyObject_IsTrue(args[1]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _multibytecodec_MultibyteIncrementalDecoder_decode_impl(self, &input, final);
+
+exit:
+ /* Cleanup for input */
+ if (input.obj) {
+ PyBuffer_Release(&input);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_getstate__doc__,
+"getstate($self, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF \
+ {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_getstate(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(self);
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__,
+"setstate($self, state, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF \
+ {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self,
+ PyObject *state);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoderObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *state;
+
+ if (!PyTuple_Check(arg)) {
+ _PyArg_BadArgument("setstate", "argument", "tuple", arg);
+ goto exit;
+ }
+ state = arg;
+ return_value = _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(self, state);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__,
+"reset($self, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \
+ {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self);
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self);
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
+"read($self, sizeobj=None, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_multibytecodec_MultibyteStreamReader_read), METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
+ PyObject *sizeobj);
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sizeobj = Py_None;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ sizeobj = args[0];
+skip_optional:
+ return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
+"readline($self, sizeobj=None, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \
+ {"readline", _PyCFunction_CAST(_multibytecodec_MultibyteStreamReader_readline), METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
+ PyObject *sizeobj);
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sizeobj = Py_None;
+
+ if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ sizeobj = args[0];
+skip_optional:
+ return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
+"readlines($self, sizehintobj=None, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \
+ {"readlines", _PyCFunction_CAST(_multibytecodec_MultibyteStreamReader_readlines), METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
+ PyObject *sizehintobj);
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *sizehintobj = Py_None;
+
+ if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ sizehintobj = args[0];
+skip_optional:
+ return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__,
+"reset($self, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \
+ {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self);
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _multibytecodec_MultibyteStreamReader_reset_impl(self);
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__,
+"write($self, strobj, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF \
+ {"write", _PyCFunction_CAST(_multibytecodec_MultibyteStreamWriter_write), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteStreamWriter_write__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_write_impl(MultibyteStreamWriterObject *self,
+ PyTypeObject *cls,
+ PyObject *strobj);
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_write(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "write",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *strobj;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ strobj = args[0];
+ return_value = _multibytecodec_MultibyteStreamWriter_write_impl(self, cls, strobj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__,
+"writelines($self, lines, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF \
+ {"writelines", _PyCFunction_CAST(_multibytecodec_MultibyteStreamWriter_writelines), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteStreamWriter_writelines__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_writelines_impl(MultibyteStreamWriterObject *self,
+ PyTypeObject *cls,
+ PyObject *lines);
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_writelines(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "writelines",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *lines;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ lines = args[0];
+ return_value = _multibytecodec_MultibyteStreamWriter_writelines_impl(self, cls, lines);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__,
+"reset($self, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF \
+ {"reset", _PyCFunction_CAST(_multibytecodec_MultibyteStreamWriter_reset), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteStreamWriter_reset__doc__},
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self,
+ PyTypeObject *cls);
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "reset() takes no arguments");
+ return NULL;
+ }
+ return _multibytecodec_MultibyteStreamWriter_reset_impl(self, cls);
+}
+
+PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
+"__create_codec($module, arg, /)\n"
+"--\n"
+"\n");
+
+#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
+ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
+/*[clinic end generated code: output=57bae129ab6c7a67 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h b/contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h
new file mode 100644
index 00000000000..c30c948a2b1
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/emu_jisx0213_2000.h
@@ -0,0 +1,54 @@
+/* These routines may be quite inefficient, but it's used only to emulate old
+ * standards. */
+
+#ifndef EMULATE_JISX0213_2000_ENCODE_INVALID
+# define EMULATE_JISX0213_2000_ENCODE_INVALID 1
+#endif
+
+#define EMULATE_JISX0213_2000_ENCODE_BMP(config, assi, c) \
+ if ((config) == (void *)2000 && ( \
+ (c) == 0x9B1C || (c) == 0x4FF1 || \
+ (c) == 0x525D || (c) == 0x541E || \
+ (c) == 0x5653 || (c) == 0x59F8 || \
+ (c) == 0x5C5B || (c) == 0x5E77 || \
+ (c) == 0x7626 || (c) == 0x7E6B)) { \
+ return EMULATE_JISX0213_2000_ENCODE_INVALID; \
+ } \
+ else if ((config) == (void *)2000 && (c) == 0x9B1D) { \
+ (assi) = 0x8000 | 0x7d3b; \
+ }
+
+#define EMULATE_JISX0213_2000_ENCODE_EMP(config, assi, c) \
+ if ((config) == (void *)2000 && (c) == 0x20B9F) { \
+ return EMULATE_JISX0213_2000_ENCODE_INVALID; \
+ }
+
+#ifndef EMULATE_JISX0213_2000_DECODE_INVALID
+# define EMULATE_JISX0213_2000_DECODE_INVALID 2
+#endif
+
+#define EMULATE_JISX0213_2000_DECODE_PLANE1(config, assi, c1, c2) \
+ if ((config) == (void *)2000 && \
+ (((c1) == 0x2E && (c2) == 0x21) || \
+ ((c1) == 0x2F && (c2) == 0x7E) || \
+ ((c1) == 0x4F && (c2) == 0x54) || \
+ ((c1) == 0x4F && (c2) == 0x7E) || \
+ ((c1) == 0x74 && (c2) == 0x27) || \
+ ((c1) == 0x7E && (c2) == 0x7A) || \
+ ((c1) == 0x7E && (c2) == 0x7B) || \
+ ((c1) == 0x7E && (c2) == 0x7C) || \
+ ((c1) == 0x7E && (c2) == 0x7D) || \
+ ((c1) == 0x7E && (c2) == 0x7E))) { \
+ return EMULATE_JISX0213_2000_DECODE_INVALID; \
+ }
+
+#define EMULATE_JISX0213_2000_DECODE_PLANE2(config, writer, c1, c2) \
+ if ((config) == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) { \
+ OUTCHAR(0x9B1D); \
+ }
+
+#define EMULATE_JISX0213_2000_DECODE_PLANE2_CHAR(config, assi, c1, c2) \
+ if ((config) == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) { \
+ (assi) = 0x9B1D; \
+ }
+
diff --git a/contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h
new file mode 100644
index 00000000000..87ca0de784a
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_cn.h
@@ -0,0 +1,4104 @@
+// AUTO-GENERATED FILE FROM genmap_schinese.py: DO NOT EDIT
+static const ucs2_t __gb2312_decmap[7482] = {
+12288,12289,12290,12539,713,711,168,12291,12293,8213,65374,8214,8230,8216,
+8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,
+12310,12311,12304,12305,177,215,247,8758,8743,8744,8721,8719,8746,8745,8712,
+8759,8730,8869,8741,8736,8978,8857,8747,8750,8801,8780,8776,8765,8733,8800,
+8814,8815,8804,8805,8734,8757,8756,9794,9792,176,8242,8243,8451,65284,164,
+65504,65505,8240,167,8470,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,
+9650,8251,8594,8592,8593,8595,12307,9352,9353,9354,9355,9356,9357,9358,9359,
+9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9332,9333,9334,
+9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,
+9350,9351,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,U,U,12832,12833,
+12834,12835,12836,12837,12838,12839,12840,12841,U,U,8544,8545,8546,8547,8548,
+8549,8550,8551,8552,8553,8554,8555,65281,65282,65283,65509,65285,65286,65287,
+65288,65289,65290,65291,65292,65293,65294,65295,65296,65297,65298,65299,65300,
+65301,65302,65303,65304,65305,65306,65307,65308,65309,65310,65311,65312,65313,
+65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,
+65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65339,
+65340,65341,65342,65343,65344,65345,65346,65347,65348,65349,65350,65351,65352,
+65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,
+65366,65367,65368,65369,65370,65371,65372,65373,65507,12353,12354,12355,12356,
+12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,
+12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,
+12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,
+12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,
+12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,
+12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,
+12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,
+12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,
+12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,
+12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,
+12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,
+12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,
+12526,12527,12528,12529,12530,12531,12532,12533,12534,913,914,915,916,917,918,
+919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,U,U,U,
+U,U,U,U,U,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,
+963,964,965,966,967,968,969,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,
+1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,
+1064,1065,1066,1067,1068,1069,1070,1071,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,1072,
+1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,
+1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,
+1102,1103,257,225,462,224,275,233,283,232,299,237,464,236,333,243,466,242,363,
+250,468,249,470,472,474,476,252,234,U,U,U,U,U,U,U,U,U,U,12549,12550,12551,
+12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,
+12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,
+12578,12579,12580,12581,12582,12583,12584,12585,9472,9473,9474,9475,9476,9477,
+9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,
+9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,
+9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,
+9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,
+9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,21834,38463,22467,25384,
+21710,21769,21696,30353,30284,34108,30702,33406,30861,29233,38552,38797,27688,
+23433,20474,25353,26263,23736,33018,26696,32942,26114,30414,20985,25942,29100,
+32753,34948,20658,22885,25034,28595,33453,25420,25170,21485,21543,31494,20843,
+30116,24052,25300,36299,38774,25226,32793,22365,38712,32610,29240,30333,26575,
+30334,25670,20336,36133,25308,31255,26001,29677,25644,25203,33324,39041,26495,
+29256,25198,25292,20276,29923,21322,21150,32458,37030,24110,26758,27036,33152,
+32465,26834,30917,34444,38225,20621,35876,33502,32990,21253,35090,21093,34180,
+38649,20445,22561,39281,23453,25265,25253,26292,35961,40077,29190,26479,30865,
+24754,21329,21271,36744,32972,36125,38049,20493,29384,22791,24811,28953,34987,
+22868,33519,26412,31528,23849,32503,29997,27893,36454,36856,36924,40763,27604,
+37145,31508,24444,30887,34006,34109,27605,27609,27606,24065,24199,30201,38381,
+25949,24330,24517,36767,22721,33218,36991,38491,38829,36793,32534,36140,25153,
+20415,21464,21342,36776,36777,36779,36941,26631,24426,33176,34920,40150,24971,
+21035,30250,24428,25996,28626,28392,23486,25672,20853,20912,26564,19993,31177,
+39292,28851,30149,24182,29627,33760,25773,25320,38069,27874,21338,21187,25615,
+38082,31636,20271,24091,33334,33046,33162,28196,27850,39539,25429,21340,21754,
+34917,22496,19981,24067,27493,31807,37096,24598,25830,29468,35009,26448,25165,
+36130,30572,36393,37319,24425,33756,34081,39184,21442,34453,27531,24813,24808,
+28799,33485,33329,20179,27815,34255,25805,31961,27133,26361,33609,21397,31574,
+20391,20876,27979,23618,36461,25554,21449,33580,33590,26597,30900,25661,23519,
+23700,24046,35815,25286,26612,35962,25600,25530,34633,39307,35863,32544,38130,
+20135,38416,39076,26124,29462,22330,23581,24120,38271,20607,32928,21378,25950,
+30021,21809,20513,36229,25220,38046,26397,22066,28526,24034,21557,28818,36710,
+25199,25764,25507,24443,28552,37108,33251,36784,23576,26216,24561,27785,38472,
+36225,34924,25745,31216,22478,27225,25104,21576,20056,31243,24809,28548,35802,
+25215,36894,39563,31204,21507,30196,25345,21273,27744,36831,24347,39536,32827,
+40831,20360,23610,36196,32709,26021,28861,20805,20914,34411,23815,23456,25277,
+37228,30068,36364,31264,24833,31609,20167,32504,30597,19985,33261,21021,20986,
+27249,21416,36487,38148,38607,28353,38500,26970,30784,20648,30679,25616,35302,
+22788,25571,24029,31359,26941,20256,33337,21912,20018,30126,31383,24162,24202,
+38383,21019,21561,28810,25462,38180,22402,26149,26943,37255,21767,28147,32431,
+34850,25139,32496,30133,33576,30913,38604,36766,24904,29943,35789,27492,21050,
+36176,27425,32874,33905,22257,21254,20174,19995,20945,31895,37259,31751,20419,
+36479,31713,31388,25703,23828,20652,33030,30209,31929,28140,32736,26449,23384,
+23544,30923,25774,25619,25514,25387,38169,25645,36798,31572,30249,25171,22823,
+21574,27513,20643,25140,24102,27526,20195,36151,34955,24453,36910,24608,32829,
+25285,20025,21333,37112,25528,32966,26086,27694,20294,24814,28129,35806,24377,
+34507,24403,25377,20826,33633,26723,20992,25443,36424,20498,23707,31095,23548,
+21040,31291,24764,36947,30423,24503,24471,30340,36460,28783,30331,31561,30634,
+20979,37011,22564,20302,28404,36842,25932,31515,29380,28068,32735,23265,25269,
+24213,22320,33922,31532,24093,24351,36882,32532,39072,25474,28359,30872,28857,
+20856,38747,22443,30005,20291,30008,24215,24806,22880,28096,27583,30857,21500,
+38613,20939,20993,25481,21514,38035,35843,36300,29241,30879,34678,36845,35853,
+21472,19969,30447,21486,38025,39030,40718,38189,23450,35746,20002,19996,20908,
+33891,25026,21160,26635,20375,24683,20923,27934,20828,25238,26007,38497,35910,
+36887,30168,37117,30563,27602,29322,29420,35835,22581,30585,36172,26460,38208,
+32922,24230,28193,22930,31471,30701,38203,27573,26029,32526,22534,20817,38431,
+23545,22697,21544,36466,25958,39039,22244,38045,30462,36929,25479,21702,22810,
+22842,22427,36530,26421,36346,33333,21057,24816,22549,34558,23784,40517,20420,
+39069,35769,23077,24694,21380,25212,36943,37122,39295,24681,32780,20799,32819,
+23572,39285,27953,20108,36144,21457,32602,31567,20240,20047,38400,27861,29648,
+34281,24070,30058,32763,27146,30718,38034,32321,20961,28902,21453,36820,33539,
+36137,29359,39277,27867,22346,33459,26041,32938,25151,38450,22952,20223,35775,
+32442,25918,33778,38750,21857,39134,32933,21290,35837,21536,32954,24223,27832,
+36153,33452,37210,21545,27675,20998,32439,22367,28954,27774,31881,22859,20221,
+24575,24868,31914,20016,23553,26539,34562,23792,38155,39118,30127,28925,36898,
+20911,32541,35773,22857,20964,20315,21542,22827,25975,32932,23413,25206,25282,
+36752,24133,27679,31526,20239,20440,26381,28014,28074,31119,34993,24343,29995,
+25242,36741,20463,37340,26023,33071,33105,24220,33104,36212,21103,35206,36171,
+22797,20613,20184,38428,29238,33145,36127,23500,35747,38468,22919,32538,21648,
+22134,22030,35813,25913,27010,38041,30422,28297,24178,29976,26438,26577,31487,
+32925,36214,24863,31174,25954,36195,20872,21018,38050,32568,32923,32434,23703,
+28207,26464,31705,30347,39640,33167,32660,31957,25630,38224,31295,21578,21733,
+27468,25601,25096,40509,33011,30105,21106,38761,33883,26684,34532,38401,38548,
+38124,20010,21508,32473,26681,36319,32789,26356,24218,32697,22466,32831,26775,
+24037,25915,21151,24685,40858,20379,36524,20844,23467,24339,24041,27742,25329,
+36129,20849,38057,21246,27807,33503,29399,22434,26500,36141,22815,36764,33735,
+21653,31629,20272,27837,23396,22993,40723,21476,34506,39592,35895,32929,25925,
+39038,22266,38599,21038,29916,21072,23521,25346,35074,20054,25296,24618,26874,
+20851,23448,20896,35266,31649,39302,32592,24815,28748,36143,20809,24191,36891,
+29808,35268,22317,30789,24402,40863,38394,36712,39740,35809,30328,26690,26588,
+36330,36149,21053,36746,28378,26829,38149,37101,22269,26524,35065,36807,21704,
+39608,23401,28023,27686,20133,23475,39559,37219,25000,37039,38889,21547,28085,
+23506,20989,21898,32597,32752,25788,25421,26097,25022,24717,28938,27735,27721,
+22831,26477,33322,22741,22158,35946,27627,37085,22909,32791,21495,28009,21621,
+21917,33655,33743,26680,31166,21644,20309,21512,30418,35977,38402,27827,28088,
+36203,35088,40548,36154,22079,40657,30165,24456,29408,24680,21756,20136,27178,
+34913,24658,36720,21700,28888,34425,40511,27946,23439,24344,32418,21897,20399,
+29492,21564,21402,20505,21518,21628,20046,24573,29786,22774,33899,32993,34676,
+29392,31946,28246,24359,34382,21804,25252,20114,27818,25143,33457,21719,21326,
+29502,28369,30011,21010,21270,35805,27088,24458,24576,28142,22351,27426,29615,
+26707,36824,32531,25442,24739,21796,30186,35938,28949,28067,23462,24187,33618,
+24908,40644,30970,34647,31783,30343,20976,24822,29004,26179,24140,24653,35854,
+28784,25381,36745,24509,24674,34516,22238,27585,24724,24935,21321,24800,26214,
+36159,31229,20250,28905,27719,35763,35826,32472,33636,26127,23130,39746,27985,
+28151,35905,27963,20249,28779,33719,25110,24785,38669,36135,31096,20987,22334,
+22522,26426,30072,31293,31215,31637,32908,39269,36857,28608,35749,40481,23020,
+32489,32521,21513,26497,26840,36753,31821,38598,21450,24613,30142,27762,21363,
+23241,32423,25380,20960,33034,24049,34015,25216,20864,23395,20238,31085,21058,
+24760,27982,23492,23490,35745,35760,26082,24524,38469,22931,32487,32426,22025,
+26551,22841,20339,23478,21152,33626,39050,36158,30002,38078,20551,31292,20215,
+26550,39550,23233,27516,30417,22362,23574,31546,38388,29006,20860,32937,33392,
+22904,32516,33575,26816,26604,30897,30839,25315,25441,31616,20461,21098,20943,
+33616,27099,37492,36341,36145,35265,38190,31661,20214,20581,33328,21073,39279,
+28176,28293,28071,24314,20725,23004,23558,27974,27743,30086,33931,26728,22870,
+35762,21280,37233,38477,34121,26898,30977,28966,33014,20132,37066,27975,39556,
+23047,22204,25605,38128,30699,20389,33050,29409,35282,39290,32564,32478,21119,
+25945,37237,36735,36739,21483,31382,25581,25509,30342,31224,34903,38454,25130,
+21163,33410,26708,26480,25463,30571,31469,27905,32467,35299,22992,25106,34249,
+33445,30028,20511,20171,30117,35819,23626,24062,31563,26020,37329,20170,27941,
+35167,32039,38182,20165,35880,36827,38771,26187,31105,36817,28908,28024,23613,
+21170,33606,20834,33550,30555,26230,40120,20140,24778,31934,31923,32463,20117,
+35686,26223,39048,38745,22659,25964,38236,24452,30153,38742,31455,31454,20928,
+28847,31384,25578,31350,32416,29590,38893,20037,28792,20061,37202,21417,25937,
+26087,33276,33285,21646,23601,30106,38816,25304,29401,30141,23621,39545,33738,
+23616,21632,30697,20030,27822,32858,25298,25454,24040,20855,36317,36382,38191,
+20465,21477,24807,28844,21095,25424,40515,23071,20518,30519,21367,32482,25733,
+25899,25225,25496,20500,29237,35273,20915,35776,32477,22343,33740,38055,20891,
+21531,23803,20426,31459,27994,37089,39567,21888,21654,21345,21679,24320,25577,
+26999,20975,24936,21002,22570,21208,22350,30733,30475,24247,24951,31968,25179,
+25239,20130,28821,32771,25335,28900,38752,22391,33499,26607,26869,30933,39063,
+31185,22771,21683,21487,28212,20811,21051,23458,35838,32943,21827,22438,24691,
+22353,21549,31354,24656,23380,25511,25248,21475,25187,23495,26543,21741,31391,
+33510,37239,24211,35044,22840,22446,25358,36328,33007,22359,31607,20393,24555,
+23485,27454,21281,31568,29378,26694,30719,30518,26103,20917,20111,30420,23743,
+31397,33909,22862,39745,20608,39304,24871,28291,22372,26118,25414,22256,25324,
+25193,24275,38420,22403,25289,21895,34593,33098,36771,21862,33713,26469,36182,
+34013,23146,26639,25318,31726,38417,20848,28572,35888,25597,35272,25042,32518,
+28866,28389,29701,27028,29436,24266,37070,26391,28010,25438,21171,29282,32769,
+20332,23013,37226,28889,28061,21202,20048,38647,38253,34174,30922,32047,20769,
+22418,25794,32907,31867,27882,26865,26974,20919,21400,26792,29313,40654,31729,
+29432,31163,28435,29702,26446,37324,40100,31036,33673,33620,21519,26647,20029,
+21385,21169,30782,21382,21033,20616,20363,20432,30178,31435,31890,27813,38582,
+21147,29827,21737,20457,32852,33714,36830,38256,24265,24604,28063,24088,25947,
+33080,38142,24651,28860,32451,31918,20937,26753,31921,33391,20004,36742,37327,
+26238,20142,35845,25769,32842,20698,30103,29134,23525,36797,28518,20102,25730,
+38243,24278,26009,21015,35010,28872,21155,29454,29747,26519,30967,38678,20020,
+37051,40158,28107,20955,36161,21533,25294,29618,33777,38646,40836,38083,20278,
+32666,20940,28789,38517,23725,39046,21478,20196,28316,29705,27060,30827,39311,
+30041,21016,30244,27969,26611,20845,40857,32843,21657,31548,31423,38534,22404,
+25314,38471,27004,23044,25602,31699,28431,38475,33446,21346,39045,24208,28809,
+25523,21348,34383,40065,40595,30860,38706,36335,36162,40575,28510,31108,24405,
+38470,25134,39540,21525,38109,20387,26053,23653,23649,32533,34385,27695,24459,
+29575,28388,32511,23782,25371,23402,28390,21365,20081,25504,30053,25249,36718,
+20262,20177,27814,32438,35770,33821,34746,32599,36923,38179,31657,39585,35064,
+33853,27931,39558,32476,22920,40635,29595,30721,34434,39532,39554,22043,21527,
+22475,20080,40614,21334,36808,33033,30610,39314,34542,28385,34067,26364,24930,
+28459,35881,33426,33579,30450,27667,24537,33725,29483,33541,38170,27611,30683,
+38086,21359,33538,20882,24125,35980,36152,20040,29611,26522,26757,37238,38665,
+29028,27809,30473,23186,38209,27599,32654,26151,23504,22969,23194,38376,38391,
+20204,33804,33945,27308,30431,38192,29467,26790,23391,30511,37274,38753,31964,
+36855,35868,24357,31859,31192,35269,27852,34588,23494,24130,26825,30496,32501,
+20885,20813,21193,23081,32517,38754,33495,25551,30596,34256,31186,28218,24217,
+22937,34065,28781,27665,25279,30399,25935,24751,38397,26126,34719,40483,38125,
+21517,21629,35884,25720,25721,34321,27169,33180,30952,25705,39764,25273,26411,
+33707,22696,40664,27819,28448,23518,38476,35851,29279,26576,25287,29281,20137,
+22982,27597,22675,26286,24149,21215,24917,26408,30446,30566,29287,31302,25343,
+21738,21584,38048,37027,23068,32435,27670,20035,22902,32784,22856,21335,30007,
+38590,22218,25376,33041,24700,38393,28118,21602,39297,20869,23273,33021,22958,
+38675,20522,27877,23612,25311,20320,21311,33147,36870,28346,34091,25288,24180,
+30910,25781,25467,24565,23064,37247,40479,23615,25423,32834,23421,21870,38218,
+38221,28037,24744,26592,29406,20957,23425,25319,27870,29275,25197,38062,32445,
+33043,27987,20892,24324,22900,21162,24594,22899,26262,34384,30111,25386,25062,
+31983,35834,21734,27431,40485,27572,34261,21589,20598,27812,21866,36276,29228,
+24085,24597,29750,25293,25490,29260,24472,28227,27966,25856,28504,30424,30928,
+30460,30036,21028,21467,20051,24222,26049,32810,32982,25243,21638,21032,28846,
+34957,36305,27873,21624,32986,22521,35060,36180,38506,37197,20329,27803,21943,
+30406,30768,25256,28921,28558,24429,34028,26842,30844,31735,33192,26379,40527,
+25447,30896,22383,30738,38713,25209,25259,21128,29749,27607,21860,33086,30130,
+30382,21305,30174,20731,23617,35692,31687,20559,29255,39575,39128,28418,29922,
+31080,25735,30629,25340,39057,36139,21697,32856,20050,22378,33529,33805,24179,
+20973,29942,35780,23631,22369,27900,39047,23110,30772,39748,36843,31893,21078,
+25169,38138,20166,33670,33889,33769,33970,22484,26420,22275,26222,28006,35889,
+26333,28689,26399,27450,26646,25114,22971,19971,20932,28422,26578,27791,20854,
+26827,22855,27495,30054,23822,33040,40784,26071,31048,31041,39569,36215,23682,
+20062,20225,21551,22865,30732,22120,27668,36804,24323,27773,27875,35755,25488,
+24688,27965,29301,25190,38030,38085,21315,36801,31614,20191,35878,20094,40660,
+38065,38067,21069,28508,36963,27973,35892,22545,23884,27424,27465,26538,21595,
+33108,32652,22681,34103,24378,25250,27207,38201,25970,24708,26725,30631,20052,
+20392,24039,38808,25772,32728,23789,20431,31373,20999,33540,19988,24623,31363,
+38054,20405,20146,31206,29748,21220,33465,25810,31165,23517,27777,38738,36731,
+27682,20542,21375,28165,25806,26228,27696,24773,39031,35831,24198,29756,31351,
+31179,19992,37041,29699,27714,22234,37195,27845,36235,21306,34502,26354,36527,
+23624,39537,28192,21462,23094,40843,36259,21435,22280,39079,26435,37275,27849,
+20840,30154,25331,29356,21048,21149,32570,28820,30264,21364,40522,27063,30830,
+38592,35033,32676,28982,29123,20873,26579,29924,22756,25880,22199,35753,39286,
+25200,32469,24825,28909,22764,20161,20154,24525,38887,20219,35748,20995,22922,
+32427,25172,20173,26085,25102,33592,33993,33635,34701,29076,28342,23481,32466,
+20887,25545,26580,32905,33593,34837,20754,23418,22914,36785,20083,27741,20837,
+35109,36719,38446,34122,29790,38160,38384,28070,33509,24369,25746,27922,33832,
+33134,40131,22622,36187,19977,21441,20254,25955,26705,21971,20007,25620,39578,
+25195,23234,29791,33394,28073,26862,20711,33678,30722,26432,21049,27801,32433,
+20667,21861,29022,31579,26194,29642,33515,26441,23665,21024,29053,34923,38378,
+38485,25797,36193,33203,21892,27733,25159,32558,22674,20260,21830,36175,26188,
+19978,23578,35059,26786,25422,31245,28903,33421,21242,38902,23569,21736,37045,
+32461,22882,36170,34503,33292,33293,36198,25668,23556,24913,28041,31038,35774,
+30775,30003,21627,20280,36523,28145,23072,32453,31070,27784,23457,23158,29978,
+32958,24910,28183,22768,29983,29989,29298,21319,32499,30465,30427,21097,32988,
+22307,24072,22833,29422,26045,28287,35799,23608,34417,21313,30707,25342,26102,
+20160,39135,34432,23454,35782,21490,30690,20351,23630,39542,22987,24335,31034,
+22763,19990,26623,20107,25325,35475,36893,21183,26159,21980,22124,36866,20181,
+20365,37322,39280,27663,24066,24643,23460,35270,35797,25910,25163,39318,23432,
+23551,25480,21806,21463,30246,20861,34092,26530,26803,27530,25234,36755,21460,
+33298,28113,30095,20070,36174,23408,29087,34223,26257,26329,32626,34560,40653,
+40736,23646,26415,36848,26641,26463,25101,31446,22661,24246,25968,28465,24661,
+21047,32781,25684,34928,29993,24069,26643,25332,38684,21452,29245,35841,27700,
+30561,31246,21550,30636,39034,33308,35828,30805,26388,28865,26031,25749,22070,
+24605,31169,21496,19997,27515,32902,23546,21987,22235,20282,20284,39282,24051,
+26494,32824,24578,39042,36865,23435,35772,35829,25628,33368,25822,22013,33487,
+37221,20439,32032,36895,31903,20723,22609,28335,23487,35785,32899,37240,33948,
+31639,34429,38539,38543,32485,39635,30862,23681,31319,36930,38567,31071,23385,
+25439,31499,34001,26797,21766,32553,29712,32034,38145,25152,22604,20182,23427,
+22905,22612,29549,25374,36427,36367,32974,33492,25260,21488,27888,37214,22826,
+24577,27760,22349,25674,36138,30251,28393,22363,27264,30192,28525,35885,35848,
+22374,27631,34962,30899,25506,21497,28845,27748,22616,25642,22530,26848,33179,
+21776,31958,20504,36538,28108,36255,28907,25487,28059,28372,32486,33796,26691,
+36867,28120,38518,35752,22871,29305,34276,33150,30140,35466,26799,21076,36386,
+38161,25552,39064,36420,21884,20307,26367,22159,24789,28053,21059,23625,22825,
+28155,22635,30000,29980,24684,33300,33094,25361,26465,36834,30522,36339,36148,
+38081,24086,21381,21548,28867,27712,24311,20572,20141,24237,25402,33351,36890,
+26704,37230,30643,21516,38108,24420,31461,26742,25413,31570,32479,30171,20599,
+25237,22836,36879,20984,31171,31361,22270,24466,36884,28034,23648,22303,21520,
+20820,28237,22242,25512,39059,33151,34581,35114,36864,21534,23663,33216,25302,
+25176,33073,40501,38464,39534,39548,26925,22949,25299,21822,25366,21703,34521,
+27964,23043,29926,34972,27498,22806,35916,24367,28286,29609,39037,20024,28919,
+23436,30871,25405,26202,30358,24779,23451,23113,19975,33109,27754,29579,20129,
+26505,32593,24448,26106,26395,24536,22916,23041,24013,24494,21361,38886,36829,
+26693,22260,21807,24799,20026,28493,32500,33479,33806,22996,20255,20266,23614,
+32428,26410,34074,21619,30031,32963,21890,39759,20301,28205,35859,23561,24944,
+21355,30239,28201,34442,25991,38395,32441,21563,31283,32010,38382,21985,32705,
+29934,25373,34583,28065,31389,25105,26017,21351,25569,27779,24043,21596,38056,
+20044,27745,35820,23627,26080,33436,26791,21566,21556,27595,27494,20116,25410,
+21320,33310,20237,20398,22366,25098,38654,26212,29289,21247,21153,24735,35823,
+26132,29081,26512,35199,30802,30717,26224,22075,21560,38177,29306,31232,24687,
+24076,24713,33181,22805,24796,29060,28911,28330,27728,29312,27268,34989,24109,
+20064,23219,21916,38115,27927,31995,38553,25103,32454,30606,34430,21283,38686,
+36758,26247,23777,20384,29421,19979,21414,22799,21523,25472,38184,20808,20185,
+40092,32420,21688,36132,34900,33335,38386,28046,24358,23244,26174,38505,29616,
+29486,21439,33146,39301,32673,23466,38519,38480,32447,30456,21410,38262,39321,
+31665,35140,28248,20065,32724,31077,35814,24819,21709,20139,39033,24055,27233,
+20687,21521,35937,33831,30813,38660,21066,21742,22179,38144,28040,23477,28102,
+26195,23567,23389,26657,32918,21880,31505,25928,26964,20123,27463,34638,38795,
+21327,25375,25658,37034,26012,32961,35856,20889,26800,21368,34809,25032,27844,
+27899,35874,23633,34218,33455,38156,27427,36763,26032,24571,24515,20449,34885,
+26143,33125,29481,24826,20852,21009,22411,24418,37026,34892,37266,24184,26447,
+24615,22995,20804,20982,33016,21256,27769,38596,29066,20241,20462,32670,26429,
+21957,38152,31168,34966,32483,22687,25100,38656,34394,22040,39035,24464,35768,
+33988,37207,21465,26093,24207,30044,24676,32110,23167,32490,32493,36713,21927,
+23459,24748,26059,29572,36873,30307,30505,32474,38772,34203,23398,31348,38634,
+34880,21195,29071,24490,26092,35810,23547,39535,24033,27529,27739,35757,35759,
+36874,36805,21387,25276,40486,40493,21568,20011,33469,29273,34460,23830,34905,
+28079,38597,21713,20122,35766,28937,21693,38409,28895,28153,30416,20005,30740,
+34578,23721,24310,35328,39068,38414,28814,27839,22852,25513,30524,34893,28436,
+33395,22576,29141,21388,30746,38593,21761,24422,28976,23476,35866,39564,27523,
+22830,40495,31207,26472,25196,20335,30113,32650,27915,38451,27687,20208,30162,
+20859,26679,28478,36992,33136,22934,29814,25671,23591,36965,31377,35875,23002,
+21676,33280,33647,35201,32768,26928,22094,32822,29239,37326,20918,20063,39029,
+25494,19994,21494,26355,33099,22812,28082,19968,22777,21307,25558,38129,20381,
+20234,34915,39056,22839,36951,31227,20202,33008,30097,27778,23452,23016,24413,
+26885,34433,20506,24050,20057,30691,20197,33402,25233,26131,37009,23673,20159,
+24441,33222,36920,32900,30123,20134,35028,24847,27589,24518,20041,30410,28322,
+35811,35758,35850,35793,24322,32764,32716,32462,33589,33643,22240,27575,38899,
+38452,23035,21535,38134,28139,23493,39278,23609,24341,38544,21360,33521,27185,
+23156,40560,24212,32552,33721,33828,33829,33639,34631,36814,36194,30408,24433,
+39062,30828,26144,21727,25317,20323,33219,30152,24248,38605,36362,34553,21647,
+27891,28044,27704,24703,21191,29992,24189,20248,24736,24551,23588,30001,37038,
+38080,29369,27833,28216,37193,26377,21451,21491,20305,37321,35825,21448,24188,
+36802,28132,20110,30402,27014,34398,24858,33286,20313,20446,36926,40060,24841,
+28189,28180,38533,20104,23089,38632,19982,23679,31161,23431,35821,32701,29577,
+22495,33419,37057,21505,36935,21947,23786,24481,24840,27442,29425,32946,35465,
+28020,23507,35029,39044,35947,39533,40499,28170,20900,20803,22435,34945,21407,
+25588,36757,22253,21592,22278,29503,28304,32536,36828,33489,24895,24616,38498,
+26352,32422,36234,36291,38053,23731,31908,26376,24742,38405,32792,20113,37095,
+21248,38504,20801,36816,34164,37213,26197,38901,23381,21277,30776,26434,26685,
+21705,28798,23472,36733,20877,22312,21681,25874,26242,36190,36163,33039,33900,
+36973,31967,20991,34299,26531,26089,28577,34468,36481,22122,36896,30338,28790,
+29157,36131,25321,21017,27901,36156,24590,22686,24974,26366,36192,25166,21939,
+28195,26413,36711,38113,38392,30504,26629,27048,21643,20045,28856,35784,25688,
+25995,23429,31364,20538,23528,30651,27617,35449,31896,27838,30415,26025,36759,
+23853,23637,34360,26632,21344,25112,31449,28251,32509,27167,31456,24432,28467,
+24352,25484,28072,26454,19976,24080,36134,20183,32960,30260,38556,25307,26157,
+25214,27836,36213,29031,32617,20806,32903,21484,36974,25240,21746,34544,36761,
+32773,38167,34071,36825,27993,29645,26015,30495,29956,30759,33275,36126,38024,
+20390,26517,30137,35786,38663,25391,38215,38453,33976,25379,30529,24449,29424,
+20105,24596,25972,25327,27491,25919,24103,30151,37073,35777,33437,26525,25903,
+21553,34584,30693,32930,33026,27713,20043,32455,32844,30452,26893,27542,25191,
+20540,20356,22336,25351,27490,36286,21482,26088,32440,24535,25370,25527,33267,
+33268,32622,24092,23769,21046,26234,31209,31258,36136,28825,30164,28382,27835,
+31378,20013,30405,24544,38047,34935,32456,31181,32959,37325,20210,20247,33311,
+21608,24030,27954,35788,31909,36724,32920,24090,21650,30385,23449,26172,39588,
+29664,26666,34523,26417,29482,35832,35803,36880,31481,28891,29038,25284,30633,
+22065,20027,33879,26609,21161,34496,36142,38136,31569,20303,27880,31069,39547,
+25235,29226,25341,19987,30742,36716,25776,36186,31686,26729,24196,35013,22918,
+25758,22766,29366,26894,38181,36861,36184,22368,32512,35846,20934,25417,25305,
+21331,26700,29730,33537,37196,21828,30528,28796,27978,20857,21672,36164,23039,
+28363,28100,23388,32043,20180,31869,28371,23376,33258,28173,23383,39683,26837,
+36394,23447,32508,24635,32437,37049,36208,22863,25549,31199,36275,21330,26063,
+31062,35781,38459,32452,38075,32386,22068,37257,26368,32618,23562,36981,26152,
+24038,20304,26590,20570,20316,22352,24231,20109,19980,20800,19984,24319,21317,
+19989,20120,19998,39730,23404,22121,20008,31162,20031,21269,20039,22829,29243,
+21358,27664,22239,32996,39319,27603,30590,40727,20022,20127,40720,20060,20073,
+20115,33416,23387,21868,22031,20164,21389,21405,21411,21413,21422,38757,36189,
+21274,21493,21286,21294,21310,36188,21350,21347,20994,21000,21006,21037,21043,
+21055,21056,21068,21086,21089,21084,33967,21117,21122,21121,21136,21139,20866,
+32596,20155,20163,20169,20162,20200,20193,20203,20190,20251,20211,20258,20324,
+20213,20261,20263,20233,20267,20318,20327,25912,20314,20317,20319,20311,20274,
+20285,20342,20340,20369,20361,20355,20367,20350,20347,20394,20348,20396,20372,
+20454,20456,20458,20421,20442,20451,20444,20433,20447,20472,20521,20556,20467,
+20524,20495,20526,20525,20478,20508,20492,20517,20520,20606,20547,20565,20552,
+20558,20588,20603,20645,20647,20649,20666,20694,20742,20717,20716,20710,20718,
+20743,20747,20189,27709,20312,20325,20430,40864,27718,31860,20846,24061,40649,
+39320,20865,22804,21241,21261,35335,21264,20971,22809,20821,20128,20822,20147,
+34926,34980,20149,33044,35026,31104,23348,34819,32696,20907,20913,20925,20924,
+20935,20886,20898,20901,35744,35750,35751,35754,35764,35765,35767,35778,35779,
+35787,35791,35790,35794,35795,35796,35798,35800,35801,35804,35807,35808,35812,
+35816,35817,35822,35824,35827,35830,35833,35836,35839,35840,35842,35844,35847,
+35852,35855,35857,35858,35860,35861,35862,35865,35867,35864,35869,35871,35872,
+35873,35877,35879,35882,35883,35886,35887,35890,35891,35893,35894,21353,21370,
+38429,38434,38433,38449,38442,38461,38460,38466,38473,38484,38495,38503,38508,
+38514,38516,38536,38541,38551,38576,37015,37019,37021,37017,37036,37025,37044,
+37043,37046,37050,37048,37040,37071,37061,37054,37072,37060,37063,37075,37094,
+37090,37084,37079,37083,37099,37103,37118,37124,37154,37150,37155,37169,37167,
+37177,37187,37190,21005,22850,21154,21164,21165,21182,21759,21200,21206,21232,
+21471,29166,30669,24308,20981,20988,39727,21430,24321,30042,24047,22348,22441,
+22433,22654,22716,22725,22737,22313,22316,22314,22323,22329,22318,22319,22364,
+22331,22338,22377,22405,22379,22406,22396,22395,22376,22381,22390,22387,22445,
+22436,22412,22450,22479,22439,22452,22419,22432,22485,22488,22490,22489,22482,
+22456,22516,22511,22520,22500,22493,22539,22541,22525,22509,22528,22558,22553,
+22596,22560,22629,22636,22657,22665,22682,22656,39336,40729,25087,33401,33405,
+33407,33423,33418,33448,33412,33422,33425,33431,33433,33451,33464,33470,33456,
+33480,33482,33507,33432,33463,33454,33483,33484,33473,33449,33460,33441,33450,
+33439,33476,33486,33444,33505,33545,33527,33508,33551,33543,33500,33524,33490,
+33496,33548,33531,33491,33553,33562,33542,33556,33557,33504,33493,33564,33617,
+33627,33628,33544,33682,33596,33588,33585,33691,33630,33583,33615,33607,33603,
+33631,33600,33559,33632,33581,33594,33587,33638,33637,33640,33563,33641,33644,
+33642,33645,33646,33712,33656,33715,33716,33696,33706,33683,33692,33669,33660,
+33718,33705,33661,33720,33659,33688,33694,33704,33722,33724,33729,33793,33765,
+33752,22535,33816,33803,33757,33789,33750,33820,33848,33809,33798,33748,33759,
+33807,33795,33784,33785,33770,33733,33728,33830,33776,33761,33884,33873,33882,
+33881,33907,33927,33928,33914,33929,33912,33852,33862,33897,33910,33932,33934,
+33841,33901,33985,33997,34000,34022,33981,34003,33994,33983,33978,34016,33953,
+33977,33972,33943,34021,34019,34060,29965,34104,34032,34105,34079,34106,34134,
+34107,34047,34044,34137,34120,34152,34148,34142,34170,30626,34115,34162,34171,
+34212,34216,34183,34191,34169,34222,34204,34181,34233,34231,34224,34259,34241,
+34268,34303,34343,34309,34345,34326,34364,24318,24328,22844,22849,32823,22869,
+22874,22872,21263,23586,23589,23596,23604,25164,25194,25247,25275,25290,25306,
+25303,25326,25378,25334,25401,25419,25411,25517,25590,25457,25466,25486,25524,
+25453,25516,25482,25449,25518,25532,25586,25592,25568,25599,25540,25566,25550,
+25682,25542,25534,25669,25665,25611,25627,25632,25612,25638,25633,25694,25732,
+25709,25750,25722,25783,25784,25753,25786,25792,25808,25815,25828,25826,25865,
+25893,25902,24331,24530,29977,24337,21343,21489,21501,21481,21480,21499,21522,
+21526,21510,21579,21586,21587,21588,21590,21571,21537,21591,21593,21539,21554,
+21634,21652,21623,21617,21604,21658,21659,21636,21622,21606,21661,21712,21677,
+21698,21684,21714,21671,21670,21715,21716,21618,21667,21717,21691,21695,21708,
+21721,21722,21724,21673,21674,21668,21725,21711,21726,21787,21735,21792,21757,
+21780,21747,21794,21795,21775,21777,21799,21802,21863,21903,21941,21833,21869,
+21825,21845,21823,21840,21820,21815,21846,21877,21878,21879,21811,21808,21852,
+21899,21970,21891,21937,21945,21896,21889,21919,21886,21974,21905,21883,21983,
+21949,21950,21908,21913,21994,22007,21961,22047,21969,21995,21996,21972,21990,
+21981,21956,21999,21989,22002,22003,21964,21965,21992,22005,21988,36756,22046,
+22024,22028,22017,22052,22051,22014,22016,22055,22061,22104,22073,22103,22060,
+22093,22114,22105,22108,22092,22100,22150,22116,22129,22123,22139,22140,22149,
+22163,22191,22228,22231,22237,22241,22261,22251,22265,22271,22276,22282,22281,
+22300,24079,24089,24084,24081,24113,24123,24124,24119,24132,24148,24155,24158,
+24161,23692,23674,23693,23696,23702,23688,23704,23705,23697,23706,23708,23733,
+23714,23741,23724,23723,23729,23715,23745,23735,23748,23762,23780,23755,23781,
+23810,23811,23847,23846,23854,23844,23838,23814,23835,23896,23870,23860,23869,
+23916,23899,23919,23901,23915,23883,23882,23913,23924,23938,23961,23965,35955,
+23991,24005,24435,24439,24450,24455,24457,24460,24469,24473,24476,24488,24493,
+24501,24508,34914,24417,29357,29360,29364,29367,29368,29379,29377,29390,29389,
+29394,29416,29423,29417,29426,29428,29431,29441,29427,29443,29434,29435,29463,
+29459,29473,29450,29470,29469,29461,29474,29497,29477,29484,29496,29489,29520,
+29517,29527,29536,29548,29551,29566,33307,22821,39143,22820,22786,39267,39271,
+39272,39273,39274,39275,39276,39284,39287,39293,39296,39300,39303,39306,39309,
+39312,39313,39315,39316,39317,24192,24209,24203,24214,24229,24224,24249,24245,
+24254,24243,36179,24274,24273,24283,24296,24298,33210,24516,24521,24534,24527,
+24579,24558,24580,24545,24548,24574,24581,24582,24554,24557,24568,24601,24629,
+24614,24603,24591,24589,24617,24619,24586,24639,24609,24696,24697,24699,24698,
+24642,24682,24701,24726,24730,24749,24733,24707,24722,24716,24731,24812,24763,
+24753,24797,24792,24774,24794,24756,24864,24870,24853,24867,24820,24832,24846,
+24875,24906,24949,25004,24980,24999,25015,25044,25077,24541,38579,38377,38379,
+38385,38387,38389,38390,38396,38398,38403,38404,38406,38408,38410,38411,38412,
+38413,38415,38418,38421,38422,38423,38425,38426,20012,29247,25109,27701,27732,
+27740,27722,27811,27781,27792,27796,27788,27752,27753,27764,27766,27782,27817,
+27856,27860,27821,27895,27896,27889,27863,27826,27872,27862,27898,27883,27886,
+27825,27859,27887,27902,27961,27943,27916,27971,27976,27911,27908,27929,27918,
+27947,27981,27950,27957,27930,27983,27986,27988,27955,28049,28015,28062,28064,
+27998,28051,28052,27996,28000,28028,28003,28186,28103,28101,28126,28174,28095,
+28128,28177,28134,28125,28121,28182,28075,28172,28078,28203,28270,28238,28267,
+28338,28255,28294,28243,28244,28210,28197,28228,28383,28337,28312,28384,28461,
+28386,28325,28327,28349,28347,28343,28375,28340,28367,28303,28354,28319,28514,
+28486,28487,28452,28437,28409,28463,28470,28491,28532,28458,28425,28457,28553,
+28557,28556,28536,28530,28540,28538,28625,28617,28583,28601,28598,28610,28641,
+28654,28638,28640,28655,28698,28707,28699,28729,28725,28751,28766,23424,23428,
+23445,23443,23461,23480,29999,39582,25652,23524,23534,35120,23536,36423,35591,
+36790,36819,36821,36837,36846,36836,36841,36838,36851,36840,36869,36868,36875,
+36902,36881,36877,36886,36897,36917,36918,36909,36911,36932,36945,36946,36944,
+36968,36952,36962,36955,26297,36980,36989,36994,37000,36995,37003,24400,24407,
+24406,24408,23611,21675,23632,23641,23409,23651,23654,32700,24362,24361,24365,
+33396,24380,39739,23662,22913,22915,22925,22953,22954,22947,22935,22986,22955,
+22942,22948,22994,22962,22959,22999,22974,23045,23046,23005,23048,23011,23000,
+23033,23052,23049,23090,23092,23057,23075,23059,23104,23143,23114,23125,23100,
+23138,23157,33004,23210,23195,23159,23162,23230,23275,23218,23250,23252,23224,
+23264,23267,23281,23254,23270,23256,23260,23305,23319,23318,23346,23351,23360,
+23573,23580,23386,23397,23411,23377,23379,23394,39541,39543,39544,39546,39551,
+39549,39552,39553,39557,39560,39562,39568,39570,39571,39574,39576,39579,39580,
+39581,39583,39584,39586,39587,39589,39591,32415,32417,32419,32421,32424,32425,
+32429,32432,32446,32448,32449,32450,32457,32459,32460,32464,32468,32471,32475,
+32480,32481,32488,32491,32494,32495,32497,32498,32525,32502,32506,32507,32510,
+32513,32514,32515,32519,32520,32523,32524,32527,32529,32530,32535,32537,32540,
+32539,32543,32545,32546,32547,32548,32549,32550,32551,32554,32555,32556,32557,
+32559,32560,32561,32562,32563,32565,24186,30079,24027,30014,37013,29582,29585,
+29614,29602,29599,29647,29634,29649,29623,29619,29632,29641,29640,29669,29657,
+39036,29706,29673,29671,29662,29626,29682,29711,29738,29787,29734,29733,29736,
+29744,29742,29740,29723,29722,29761,29788,29783,29781,29785,29815,29805,29822,
+29852,29838,29824,29825,29831,29835,29854,29864,29865,29840,29863,29906,29882,
+38890,38891,38892,26444,26451,26462,26440,26473,26533,26503,26474,26483,26520,
+26535,26485,26536,26526,26541,26507,26487,26492,26608,26633,26584,26634,26601,
+26544,26636,26585,26549,26586,26547,26589,26624,26563,26552,26594,26638,26561,
+26621,26674,26675,26720,26721,26702,26722,26692,26724,26755,26653,26709,26726,
+26689,26727,26688,26686,26698,26697,26665,26805,26767,26740,26743,26771,26731,
+26818,26990,26876,26911,26912,26873,26916,26864,26891,26881,26967,26851,26896,
+26993,26937,26976,26946,26973,27012,26987,27008,27032,27000,26932,27084,27015,
+27016,27086,27017,26982,26979,27001,27035,27047,27067,27051,27053,27092,27057,
+27073,27082,27103,27029,27104,27021,27135,27183,27117,27159,27160,27237,27122,
+27204,27198,27296,27216,27227,27189,27278,27257,27197,27176,27224,27260,27281,
+27280,27305,27287,27307,29495,29522,27521,27522,27527,27524,27538,27539,27533,
+27546,27547,27553,27562,36715,36717,36721,36722,36723,36725,36726,36728,36727,
+36729,36730,36732,36734,36737,36738,36740,36743,36747,36749,36750,36751,36760,
+36762,36558,25099,25111,25115,25119,25122,25121,25125,25124,25132,33255,29935,
+29940,29951,29967,29969,29971,25908,26094,26095,26096,26122,26137,26482,26115,
+26133,26112,28805,26359,26141,26164,26161,26166,26165,32774,26207,26196,26177,
+26191,26198,26209,26199,26231,26244,26252,26279,26269,26302,26331,26332,26342,
+26345,36146,36147,36150,36155,36157,36160,36165,36166,36168,36169,36167,36173,
+36181,36185,35271,35274,35275,35276,35278,35279,35280,35281,29294,29343,29277,
+29286,29295,29310,29311,29316,29323,29325,29327,29330,25352,25394,25520,25663,
+25816,32772,27626,27635,27645,27637,27641,27653,27655,27654,27661,27669,27672,
+27673,27674,27681,27689,27684,27690,27698,25909,25941,25963,29261,29266,29270,
+29232,34402,21014,32927,32924,32915,32956,26378,32957,32945,32939,32941,32948,
+32951,32999,33000,33001,33002,32987,32962,32964,32985,32973,32983,26384,32989,
+33003,33009,33012,33005,33037,33038,33010,33020,26389,33042,35930,33078,33054,
+33068,33048,33074,33096,33100,33107,33140,33113,33114,33137,33120,33129,33148,
+33149,33133,33127,22605,23221,33160,33154,33169,28373,33187,33194,33228,26406,
+33226,33211,33217,33190,27428,27447,27449,27459,27462,27481,39121,39122,39123,
+39125,39129,39130,27571,24384,27586,35315,26000,40785,26003,26044,26054,26052,
+26051,26060,26062,26066,26070,28800,28828,28822,28829,28859,28864,28855,28843,
+28849,28904,28874,28944,28947,28950,28975,28977,29043,29020,29032,28997,29042,
+29002,29048,29050,29080,29107,29109,29096,29088,29152,29140,29159,29177,29213,
+29224,28780,28952,29030,29113,25150,25149,25155,25160,25161,31035,31040,31046,
+31049,31067,31068,31059,31066,31074,31063,31072,31087,31079,31098,31109,31114,
+31130,31143,31155,24529,24528,24636,24669,24666,24679,24641,24665,24675,24747,
+24838,24845,24925,25001,24989,25035,25041,25094,32896,32895,27795,27894,28156,
+30710,30712,30720,30729,30743,30744,30737,26027,30765,30748,30749,30777,30778,
+30779,30751,30780,30757,30764,30755,30761,30798,30829,30806,30807,30758,30800,
+30791,30796,30826,30875,30867,30874,30855,30876,30881,30883,30898,30905,30885,
+30932,30937,30921,30956,30962,30981,30964,30995,31012,31006,31028,40859,40697,
+40699,40700,30449,30468,30477,30457,30471,30472,30490,30498,30489,30509,30502,
+30517,30520,30544,30545,30535,30531,30554,30568,30562,30565,30591,30605,30589,
+30592,30604,30609,30623,30624,30640,30645,30653,30010,30016,30030,30027,30024,
+30043,30066,30073,30083,32600,32609,32607,35400,32616,32628,32625,32633,32641,
+32638,30413,30437,34866,38021,38022,38023,38027,38026,38028,38029,38031,38032,
+38036,38039,38037,38042,38043,38044,38051,38052,38059,38058,38061,38060,38063,
+38064,38066,38068,38070,38071,38072,38073,38074,38076,38077,38079,38084,38088,
+38089,38090,38091,38092,38093,38094,38096,38097,38098,38101,38102,38103,38105,
+38104,38107,38110,38111,38112,38114,38116,38117,38119,38120,38122,38121,38123,
+38126,38127,38131,38132,38133,38135,38137,38140,38141,38143,38147,38146,38150,
+38151,38153,38154,38157,38158,38159,38162,38163,38164,38165,38166,38168,38171,
+38173,38174,38175,38178,38186,38187,38185,38188,38193,38194,38196,38198,38199,
+38200,38204,38206,38207,38210,38197,38212,38213,38214,38217,38220,38222,38223,
+38226,38227,38228,38230,38231,38232,38233,38235,38238,38239,38237,38241,38242,
+38244,38245,38246,38247,38248,38249,38250,38251,38252,38255,38257,38258,38259,
+38202,30695,30700,38601,31189,31213,31203,31211,31238,23879,31235,31234,31262,
+31252,31289,31287,31313,40655,39333,31344,30344,30350,30355,30361,30372,29918,
+29920,29996,40480,40482,40488,40489,40490,40491,40492,40498,40497,40502,40504,
+40503,40505,40506,40510,40513,40514,40516,40518,40519,40520,40521,40523,40524,
+40526,40529,40533,40535,40538,40539,40540,40542,40547,40550,40551,40552,40553,
+40554,40555,40556,40561,40557,40563,30098,30100,30102,30112,30109,30124,30115,
+30131,30132,30136,30148,30129,30128,30147,30146,30166,30157,30179,30184,30182,
+30180,30187,30183,30211,30193,30204,30207,30224,30208,30213,30220,30231,30218,
+30245,30232,30229,30233,30235,30268,30242,30240,30272,30253,30256,30271,30261,
+30275,30270,30259,30285,30302,30292,30300,30294,30315,30319,32714,31462,31352,
+31353,31360,31366,31368,31381,31398,31392,31404,31400,31405,31411,34916,34921,
+34930,34941,34943,34946,34978,35014,34999,35004,35017,35042,35022,35043,35045,
+35057,35098,35068,35048,35070,35056,35105,35097,35091,35099,35082,35124,35115,
+35126,35137,35174,35195,30091,32997,30386,30388,30684,32786,32788,32790,32796,
+32800,32802,32805,32806,32807,32809,32808,32817,32779,32821,32835,32838,32845,
+32850,32873,32881,35203,39032,39040,39043,39049,39052,39053,39055,39060,39066,
+39067,39070,39071,39073,39074,39077,39078,34381,34388,34412,34414,34431,34426,
+34428,34427,34472,34445,34443,34476,34461,34471,34467,34474,34451,34473,34486,
+34500,34485,34510,34480,34490,34481,34479,34505,34511,34484,34537,34545,34546,
+34541,34547,34512,34579,34526,34548,34527,34520,34513,34563,34567,34552,34568,
+34570,34573,34569,34595,34619,34590,34597,34606,34586,34622,34632,34612,34609,
+34601,34615,34623,34690,34594,34685,34686,34683,34656,34672,34636,34670,34699,
+34643,34659,34684,34660,34649,34661,34707,34735,34728,34770,34758,34696,34693,
+34733,34711,34691,34731,34789,34732,34741,34739,34763,34771,34749,34769,34752,
+34762,34779,34794,34784,34798,34838,34835,34814,34826,34843,34849,34873,34876,
+32566,32578,32580,32581,33296,31482,31485,31496,31491,31492,31509,31498,31531,
+31503,31559,31544,31530,31513,31534,31537,31520,31525,31524,31539,31550,31518,
+31576,31578,31557,31605,31564,31581,31584,31598,31611,31586,31602,31601,31632,
+31654,31655,31672,31660,31645,31656,31621,31658,31644,31650,31659,31668,31697,
+31681,31692,31709,31706,31717,31718,31722,31756,31742,31740,31759,31766,31755,
+31775,31786,31782,31800,31809,31808,33278,33281,33282,33284,33260,34884,33313,
+33314,33315,33325,33327,33320,33323,33336,33339,33331,33332,33342,33348,33353,
+33355,33359,33370,33375,33384,34942,34949,34952,35032,35039,35166,32669,32671,
+32679,32687,32688,32690,31868,25929,31889,31901,31900,31902,31906,31922,31932,
+31933,31937,31943,31948,31949,31944,31941,31959,31976,33390,26280,32703,32718,
+32725,32741,32737,32742,32745,32750,32755,31992,32119,32166,32174,32327,32411,
+40632,40628,36211,36228,36244,36241,36273,36199,36205,35911,35913,37194,37200,
+37198,37199,37220,37218,37217,37232,37225,37231,37245,37246,37234,37236,37241,
+37260,37253,37264,37261,37265,37282,37283,37290,37293,37294,37295,37301,37300,
+37306,35925,40574,36280,36331,36357,36441,36457,36277,36287,36284,36282,36292,
+36310,36311,36314,36318,36302,36303,36315,36294,36332,36343,36344,36323,36345,
+36347,36324,36361,36349,36372,36381,36383,36396,36398,36387,36399,36410,36416,
+36409,36405,36413,36401,36425,36417,36418,36433,36434,36426,36464,36470,36476,
+36463,36468,36485,36495,36500,36496,36508,36510,35960,35970,35978,35973,35992,
+35988,26011,35286,35294,35290,35292,35301,35307,35311,35390,35622,38739,38633,
+38643,38639,38662,38657,38664,38671,38670,38698,38701,38704,38718,40832,40835,
+40837,40838,40839,40840,40841,40842,40844,40702,40715,40717,38585,38588,38589,
+38606,38610,30655,38624,37518,37550,37576,37694,37738,37834,37775,37950,37995,
+40063,40066,40069,40070,40071,40072,31267,40075,40078,40080,40081,40082,40084,
+40085,40090,40091,40094,40095,40096,40097,40098,40099,40101,40102,40103,40104,
+40105,40107,40109,40110,40112,40113,40114,40115,40116,40117,40118,40119,40122,
+40123,40124,40125,40132,40133,40134,40135,40138,40139,40140,40141,40142,40143,
+40144,40147,40148,40149,40151,40152,40153,40156,40157,40159,40162,38780,38789,
+38801,38802,38804,38831,38827,38819,38834,38836,39601,39600,39607,40536,39606,
+39610,39612,39617,39616,39621,39618,39627,39628,39633,39749,39747,39751,39753,
+39752,39757,39761,39144,39181,39214,39253,39252,39647,39649,39654,39663,39659,
+39675,39661,39673,39688,39695,39699,39711,39715,40637,40638,32315,40578,40583,
+40584,40587,40594,37846,40605,40607,40667,40668,40669,40672,40671,40674,40681,
+40679,40677,40682,40687,40738,40748,40751,40761,40759,40765,40766,40772,
+};
+
+static const struct dbcs_index gb2312_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gb2312_decmap+0,33,126},{__gb2312_decmap+94,
+49,124},{__gb2312_decmap+170,33,126},{__gb2312_decmap+264,33,115},{
+__gb2312_decmap+347,33,118},{__gb2312_decmap+433,33,88},{__gb2312_decmap+489,
+33,113},{__gb2312_decmap+570,33,105},{__gb2312_decmap+643,36,111},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gb2312_decmap+719,33,126},{
+__gb2312_decmap+813,33,126},{__gb2312_decmap+907,33,126},{__gb2312_decmap+1001
+,33,126},{__gb2312_decmap+1095,33,126},{__gb2312_decmap+1189,33,126},{
+__gb2312_decmap+1283,33,126},{__gb2312_decmap+1377,33,126},{__gb2312_decmap+
+1471,33,126},{__gb2312_decmap+1565,33,126},{__gb2312_decmap+1659,33,126},{
+__gb2312_decmap+1753,33,126},{__gb2312_decmap+1847,33,126},{__gb2312_decmap+
+1941,33,126},{__gb2312_decmap+2035,33,126},{__gb2312_decmap+2129,33,126},{
+__gb2312_decmap+2223,33,126},{__gb2312_decmap+2317,33,126},{__gb2312_decmap+
+2411,33,126},{__gb2312_decmap+2505,33,126},{__gb2312_decmap+2599,33,126},{
+__gb2312_decmap+2693,33,126},{__gb2312_decmap+2787,33,126},{__gb2312_decmap+
+2881,33,126},{__gb2312_decmap+2975,33,126},{__gb2312_decmap+3069,33,126},{
+__gb2312_decmap+3163,33,126},{__gb2312_decmap+3257,33,126},{__gb2312_decmap+
+3351,33,126},{__gb2312_decmap+3445,33,126},{__gb2312_decmap+3539,33,126},{
+__gb2312_decmap+3633,33,126},{__gb2312_decmap+3727,33,126},{__gb2312_decmap+
+3821,33,126},{__gb2312_decmap+3915,33,126},{__gb2312_decmap+4009,33,126},{
+__gb2312_decmap+4103,33,126},{__gb2312_decmap+4197,33,126},{__gb2312_decmap+
+4291,33,126},{__gb2312_decmap+4385,33,121},{__gb2312_decmap+4474,33,126},{
+__gb2312_decmap+4568,33,126},{__gb2312_decmap+4662,33,126},{__gb2312_decmap+
+4756,33,126},{__gb2312_decmap+4850,33,126},{__gb2312_decmap+4944,33,126},{
+__gb2312_decmap+5038,33,126},{__gb2312_decmap+5132,33,126},{__gb2312_decmap+
+5226,33,126},{__gb2312_decmap+5320,33,126},{__gb2312_decmap+5414,33,126},{
+__gb2312_decmap+5508,33,126},{__gb2312_decmap+5602,33,126},{__gb2312_decmap+
+5696,33,126},{__gb2312_decmap+5790,33,126},{__gb2312_decmap+5884,33,126},{
+__gb2312_decmap+5978,33,126},{__gb2312_decmap+6072,33,126},{__gb2312_decmap+
+6166,33,126},{__gb2312_decmap+6260,33,126},{__gb2312_decmap+6354,33,126},{
+__gb2312_decmap+6448,33,126},{__gb2312_decmap+6542,33,126},{__gb2312_decmap+
+6636,33,126},{__gb2312_decmap+6730,33,126},{__gb2312_decmap+6824,33,126},{
+__gb2312_decmap+6918,33,126},{__gb2312_decmap+7012,33,126},{__gb2312_decmap+
+7106,33,126},{__gb2312_decmap+7200,33,126},{__gb2312_decmap+7294,33,126},{
+__gb2312_decmap+7388,33,126},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const ucs2_t __gbkext_decmap[14531] = {
+19970,19972,19973,19974,19983,19986,19991,19999,20000,20001,20003,20006,20009,
+20014,20015,20017,20019,20021,20023,20028,20032,20033,20034,20036,20038,20042,
+20049,20053,20055,20058,20059,20066,20067,20068,20069,20071,20072,20074,20075,
+20076,20077,20078,20079,20082,20084,20085,20086,20087,20088,20089,20090,20091,
+20092,20093,20095,20096,20097,20098,20099,20100,20101,20103,20106,U,20112,
+20118,20119,20121,20124,20125,20126,20131,20138,20143,20144,20145,20148,20150,
+20151,20152,20153,20156,20157,20158,20168,20172,20175,20176,20178,20186,20187,
+20188,20192,20194,20198,20199,20201,20205,20206,20207,20209,20212,20216,20217,
+20218,20220,20222,20224,20226,20227,20228,20229,20230,20231,20232,20235,20236,
+20242,20243,20244,20245,20246,20252,20253,20257,20259,20264,20265,20268,20269,
+20270,20273,20275,20277,20279,20281,20283,20286,20287,20288,20289,20290,20292,
+20293,20295,20296,20297,20298,20299,20300,20306,20308,20310,20321,20322,20326,
+20328,20330,20331,20333,20334,20337,20338,20341,20343,20344,20345,20346,20349,
+20352,20353,20354,20357,20358,20359,20362,20364,20366,20368,20370,20371,20373,
+20374,20376,20377,20378,20380,20382,20383,20385,20386,20388,20395,20397,20400,
+20401,20402,20403,20404,20406,20407,20408,20409,20410,20411,20412,20413,20414,
+20416,20417,20418,20422,20423,20424,20425,20427,20428,20429,20434,20435,20436,
+20437,20438,20441,20443,20448,20450,20452,20453,20455,20459,20460,20464,20466,
+20468,20469,20470,20471,20473,20475,20476,20477,20479,20480,20481,20482,20483,
+20484,20485,20486,20487,20488,20489,20490,U,20491,20494,20496,20497,20499,
+20501,20502,20503,20507,20509,20510,20512,20514,20515,20516,20519,20523,20527,
+20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20539,20541,20543,
+20544,20545,20546,20548,20549,20550,20553,20554,20555,20557,20560,20561,20562,
+20563,20564,20566,20567,20568,20569,20571,20573,20574,20575,20576,20577,20578,
+20579,20580,20582,20583,20584,20585,20586,20587,20589,20590,20591,20592,20593,
+20594,20595,20596,20597,20600,20601,20602,20604,20605,20609,20610,20611,20612,
+20614,20615,20617,20618,20619,20620,20622,20623,20624,20625,20626,20627,20628,
+20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,
+20642,20644,20646,20650,20651,20653,20654,20655,20656,20657,20659,20660,20661,
+20662,20663,20664,20665,20668,20669,20670,20671,20672,20673,20674,20675,20676,
+20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20688,20689,20690,
+20691,20692,20693,20695,20696,20697,20699,20700,20701,20702,20703,20704,20705,
+20706,20707,20708,20709,20712,20713,20714,20715,20719,20720,20721,20722,20724,
+20726,20727,20728,20729,20730,20732,20733,20734,20735,20736,20737,20738,20739,
+20740,20741,20744,U,20745,20746,20748,20749,20750,20751,20752,20753,20755,
+20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,
+20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,
+20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,
+20796,20797,20798,20802,20807,20810,20812,20814,20815,20816,20818,20819,20823,
+20824,20825,20827,20829,20830,20831,20832,20833,20835,20836,20838,20839,20841,
+20842,20847,20850,20858,20862,20863,20867,20868,20870,20871,20874,20875,20878,
+20879,20880,20881,20883,20884,20888,20890,20893,20894,20895,20897,20899,20902,
+20903,20904,20905,20906,20909,20910,20916,20920,20921,20922,20926,20927,20929,
+20930,20931,20933,20936,20938,20941,20942,20944,20946,20947,20948,20949,20950,
+20951,20952,20953,20954,20956,20958,20959,20962,20963,20965,20966,20967,20968,
+20969,20970,20972,20974,20977,20978,20980,20983,20990,20996,20997,21001,21003,
+21004,21007,21008,21011,21012,21013,21020,21022,21023,21025,21026,21027,21029,
+21030,21031,21034,21036,21039,21041,21042,21044,21045,21052,21054,21060,21061,
+21062,21063,21064,21065,21067,21070,21071,21074,21075,21077,21079,21080,U,
+21081,21082,21083,21085,21087,21088,21090,21091,21092,21094,21096,21099,21100,
+21101,21102,21104,21105,21107,21108,21109,21110,21111,21112,21113,21114,21115,
+21116,21118,21120,21123,21124,21125,21126,21127,21129,21130,21131,21132,21133,
+21134,21135,21137,21138,21140,21141,21142,21143,21144,21145,21146,21148,21156,
+21157,21158,21159,21166,21167,21168,21172,21173,21174,21175,21176,21177,21178,
+21179,21180,21181,21184,21185,21186,21188,21189,21190,21192,21194,21196,21197,
+21198,21199,21201,21203,21204,21205,21207,21209,21210,21211,21212,21213,21214,
+21216,21217,21218,21219,21221,21222,21223,21224,21225,21226,21227,21228,21229,
+21230,21231,21233,21234,21235,21236,21237,21238,21239,21240,21243,21244,21245,
+21249,21250,21251,21252,21255,21257,21258,21259,21260,21262,21265,21266,21267,
+21268,21272,21275,21276,21278,21279,21282,21284,21285,21287,21288,21289,21291,
+21292,21293,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21308,
+21309,21312,21314,21316,21318,21323,21324,21325,21328,21332,21336,21337,21339,
+21341,21349,21352,21354,21356,21357,21362,21366,21369,21371,21372,21373,21374,
+21376,21377,21379,21383,21384,21386,21390,21391,U,21392,21393,21394,21395,
+21396,21398,21399,21401,21403,21404,21406,21408,21409,21412,21415,21418,21419,
+21420,21421,21423,21424,21425,21426,21427,21428,21429,21431,21432,21433,21434,
+21436,21437,21438,21440,21443,21444,21445,21446,21447,21454,21455,21456,21458,
+21459,21461,21466,21468,21469,21470,21473,21474,21479,21492,21498,21502,21503,
+21504,21506,21509,21511,21515,21524,21528,21529,21530,21532,21538,21540,21541,
+21546,21552,21555,21558,21559,21562,21565,21567,21569,21570,21572,21573,21575,
+21577,21580,21581,21582,21583,21585,21594,21597,21598,21599,21600,21601,21603,
+21605,21607,21609,21610,21611,21612,21613,21614,21615,21616,21620,21625,21626,
+21630,21631,21633,21635,21637,21639,21640,21641,21642,21645,21649,21651,21655,
+21656,21660,21662,21663,21664,21665,21666,21669,21678,21680,21682,21685,21686,
+21687,21689,21690,21692,21694,21699,21701,21706,21707,21718,21720,21723,21728,
+21729,21730,21731,21732,21739,21740,21743,21744,21745,21748,21749,21750,21751,
+21752,21753,21755,21758,21760,21762,21763,21764,21765,21768,21770,21771,21772,
+21773,21774,21778,21779,21781,21782,21783,21784,21785,21786,21788,21789,21790,
+21791,21793,21797,21798,U,21800,21801,21803,21805,21810,21812,21813,21814,
+21816,21817,21818,21819,21821,21824,21826,21829,21831,21832,21835,21836,21837,
+21838,21839,21841,21842,21843,21844,21847,21848,21849,21850,21851,21853,21854,
+21855,21856,21858,21859,21864,21865,21867,21871,21872,21873,21874,21875,21876,
+21881,21882,21885,21887,21893,21894,21900,21901,21902,21904,21906,21907,21909,
+21910,21911,21914,21915,21918,21920,21921,21922,21923,21924,21925,21926,21928,
+21929,21930,21931,21932,21933,21934,21935,21936,21938,21940,21942,21944,21946,
+21948,21951,21952,21953,21954,21955,21958,21959,21960,21962,21963,21966,21967,
+21968,21973,21975,21976,21977,21978,21979,21982,21984,21986,21991,21993,21997,
+21998,22000,22001,22004,22006,22008,22009,22010,22011,22012,22015,22018,22019,
+22020,22021,22022,22023,22026,22027,22029,22032,22033,22034,22035,22036,22037,
+22038,22039,22041,22042,22044,22045,22048,22049,22050,22053,22054,22056,22057,
+22058,22059,22062,22063,22064,22067,22069,22071,22072,22074,22076,22077,22078,
+22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22095,
+22096,22097,22098,22099,22101,22102,22106,22107,22109,22110,22111,22112,22113,
+U,22115,22117,22118,22119,22125,22126,22127,22128,22130,22131,22132,22133,
+22135,22136,22137,22138,22141,22142,22143,22144,22145,22146,22147,22148,22151,
+22152,22153,22154,22155,22156,22157,22160,22161,22162,22164,22165,22166,22167,
+22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22180,22181,
+22182,22183,22184,22185,22186,22187,22188,22189,22190,22192,22193,22194,22195,
+22196,22197,22198,22200,22201,22202,22203,22205,22206,22207,22208,22209,22210,
+22211,22212,22213,22214,22215,22216,22217,22219,22220,22221,22222,22223,22224,
+22225,22226,22227,22229,22230,22232,22233,22236,22243,22245,22246,22247,22248,
+22249,22250,22252,22254,22255,22258,22259,22262,22263,22264,22267,22268,22272,
+22273,22274,22277,22279,22283,22284,22285,22286,22287,22288,22289,22290,22291,
+22292,22293,22294,22295,22296,22297,22298,22299,22301,22302,22304,22305,22306,
+22308,22309,22310,22311,22315,22321,22322,22324,22325,22326,22327,22328,22332,
+22333,22335,22337,22339,22340,22341,22342,22344,22345,22347,22354,22355,22356,
+22357,22358,22360,22361,22370,22371,22373,22375,22380,22382,22384,22385,22386,
+22388,22389,22392,22393,22394,22397,22398,22399,22400,U,22401,22407,22408,
+22409,22410,22413,22414,22415,22416,22417,22420,22421,22422,22423,22424,22425,
+22426,22428,22429,22430,22431,22437,22440,22442,22444,22447,22448,22449,22451,
+22453,22454,22455,22457,22458,22459,22460,22461,22462,22463,22464,22465,22468,
+22469,22470,22471,22472,22473,22474,22476,22477,22480,22481,22483,22486,22487,
+22491,22492,22494,22497,22498,22499,22501,22502,22503,22504,22505,22506,22507,
+22508,22510,22512,22513,22514,22515,22517,22518,22519,22523,22524,22526,22527,
+22529,22531,22532,22533,22536,22537,22538,22540,22542,22543,22544,22546,22547,
+22548,22550,22551,22552,22554,22555,22556,22557,22559,22562,22563,22565,22566,
+22567,22568,22569,22571,22572,22573,22574,22575,22577,22578,22579,22580,22582,
+22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,
+22597,22598,22599,22600,22601,22602,22603,22606,22607,22608,22610,22611,22613,
+22614,22615,22617,22618,22619,22620,22621,22623,22624,22625,22626,22627,22628,
+22630,22631,22632,22633,22634,22637,22638,22639,22640,22641,22642,22643,22644,
+22645,22646,22647,22648,22649,22650,22651,22652,22653,22655,22658,22660,22662,
+22663,22664,22666,22667,22668,U,22669,22670,22671,22672,22673,22676,22677,
+22678,22679,22680,22683,22684,22685,22688,22689,22690,22691,22692,22693,22694,
+22695,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,
+22710,22711,22712,22713,22714,22715,22717,22718,22719,22720,22722,22723,22724,
+22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22738,22739,
+22740,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,
+22754,22755,22757,22758,22759,22760,22761,22762,22765,22767,22769,22770,22772,
+22773,22775,22776,22778,22779,22780,22781,22782,22783,22784,22785,22787,22789,
+22790,22792,22793,22794,22795,22796,22798,22800,22801,22802,22803,22807,22808,
+22811,22813,22814,22816,22817,22818,22819,22822,22824,22828,22832,22834,22835,
+22837,22838,22843,22845,22846,22847,22848,22851,22853,22854,22858,22860,22861,
+22864,22866,22867,22873,22875,22876,22877,22878,22879,22881,22883,22884,22886,
+22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22901,
+22903,22906,22907,22908,22910,22911,22912,22917,22921,22923,22924,22926,22927,
+22928,22929,22932,22933,22936,22938,22939,22940,22941,22943,22944,22945,22946,
+22950,U,22951,22956,22957,22960,22961,22963,22964,22965,22966,22967,22968,
+22970,22972,22973,22975,22976,22977,22978,22979,22980,22981,22983,22984,22985,
+22988,22989,22990,22991,22997,22998,23001,23003,23006,23007,23008,23009,23010,
+23012,23014,23015,23017,23018,23019,23021,23022,23023,23024,23025,23026,23027,
+23028,23029,23030,23031,23032,23034,23036,23037,23038,23040,23042,23050,23051,
+23053,23054,23055,23056,23058,23060,23061,23062,23063,23065,23066,23067,23069,
+23070,23073,23074,23076,23078,23079,23080,23082,23083,23084,23085,23086,23087,
+23088,23091,23093,23095,23096,23097,23098,23099,23101,23102,23103,23105,23106,
+23107,23108,23109,23111,23112,23115,23116,23117,23118,23119,23120,23121,23122,
+23123,23124,23126,23127,23128,23129,23131,23132,23133,23134,23135,23136,23137,
+23139,23140,23141,23142,23144,23145,23147,23148,23149,23150,23151,23152,23153,
+23154,23155,23160,23161,23163,23164,23165,23166,23168,23169,23170,23171,23172,
+23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,
+23187,23188,23189,23190,23191,23192,23193,23196,23197,23198,23199,23200,23201,
+23202,23203,23204,23205,23206,23207,23208,23209,23211,23212,U,23213,23214,
+23215,23216,23217,23220,23222,23223,23225,23226,23227,23228,23229,23231,23232,
+23235,23236,23237,23238,23239,23240,23242,23243,23245,23246,23247,23248,23249,
+23251,23253,23255,23257,23258,23259,23261,23262,23263,23266,23268,23269,23271,
+23272,23274,23276,23277,23278,23279,23280,23282,23283,23284,23285,23286,23287,
+23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,
+23301,23302,23303,23304,23306,23307,23308,23309,23310,23311,23312,23313,23314,
+23315,23316,23317,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,
+23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,
+23343,23344,23345,23347,23349,23350,23352,23353,23354,23355,23356,23357,23358,
+23359,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,
+23373,23374,23375,23378,23382,23390,23392,23393,23399,23400,23403,23405,23406,
+23407,23410,23412,23414,23415,23416,23417,23419,23420,23422,23423,23426,23430,
+23434,23437,23438,23440,23441,23442,23444,23446,23455,23463,23464,23465,23468,
+23469,23470,23471,23473,23474,23479,23482,23483,23484,23488,23489,23491,23496,
+23497,23498,23499,23501,23502,23503,U,23505,23508,23509,23510,23511,23512,
+23513,23514,23515,23516,23520,23522,23523,23526,23527,23529,23530,23531,23532,
+23533,23535,23537,23538,23539,23540,23541,23542,23543,23549,23550,23552,23554,
+23555,23557,23559,23560,23563,23564,23565,23566,23568,23570,23571,23575,23577,
+23579,23582,23583,23584,23585,23587,23590,23592,23593,23594,23595,23597,23598,
+23599,23600,23602,23603,23605,23606,23607,23619,23620,23622,23623,23628,23629,
+23634,23635,23636,23638,23639,23640,23642,23643,23644,23645,23647,23650,23652,
+23655,23656,23657,23658,23659,23660,23661,23664,23666,23667,23668,23669,23670,
+23671,23672,23675,23676,23677,23678,23680,23683,23684,23685,23686,23687,23689,
+23690,23691,23694,23695,23698,23699,23701,23709,23710,23711,23712,23713,23716,
+23717,23718,23719,23720,23722,23726,23727,23728,23730,23732,23734,23737,23738,
+23739,23740,23742,23744,23746,23747,23749,23750,23751,23752,23753,23754,23756,
+23757,23758,23759,23760,23761,23763,23764,23765,23766,23767,23768,23770,23771,
+23772,23773,23774,23775,23776,23778,23779,23783,23785,23787,23788,23790,23791,
+23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23804,23805,23806,
+23807,23808,U,23809,23812,23813,23816,23817,23818,23819,23820,23821,23823,
+23824,23825,23826,23827,23829,23831,23832,23833,23834,23836,23837,23839,23840,
+23841,23842,23843,23845,23848,23850,23851,23852,23855,23856,23857,23858,23859,
+23861,23862,23863,23864,23865,23866,23867,23868,23871,23872,23873,23874,23875,
+23876,23877,23878,23880,23881,23885,23886,23887,23888,23889,23890,23891,23892,
+23893,23894,23895,23897,23898,23900,23902,23903,23904,23905,23906,23907,23908,
+23909,23910,23911,23912,23914,23917,23918,23920,23921,23922,23923,23925,23926,
+23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23939,23940,
+23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,
+23954,23955,23956,23957,23958,23959,23960,23962,23963,23964,23966,23967,23968,
+23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,
+23982,23983,23984,23985,23986,23987,23988,23989,23990,23992,23993,23994,23995,
+23996,23997,23998,23999,24000,24001,24002,24003,24004,24006,24007,24008,24009,
+24010,24011,24012,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,
+24024,24025,24026,24028,24031,24032,24035,24036,24042,24044,24045,U,24048,
+24053,24054,24056,24057,24058,24059,24060,24063,24064,24068,24071,24073,24074,
+24075,24077,24078,24082,24083,24087,24094,24095,24096,24097,24098,24099,24100,
+24101,24104,24105,24106,24107,24108,24111,24112,24114,24115,24116,24117,24118,
+24121,24122,24126,24127,24128,24129,24131,24134,24135,24136,24137,24138,24139,
+24141,24142,24143,24144,24145,24146,24147,24150,24151,24152,24153,24154,24156,
+24157,24159,24160,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,
+24173,24174,24175,24176,24177,24181,24183,24185,24190,24193,24194,24195,24197,
+24200,24201,24204,24205,24206,24210,24216,24219,24221,24225,24226,24227,24228,
+24232,24233,24234,24235,24236,24238,24239,24240,24241,24242,24244,24250,24251,
+24252,24253,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24267,
+24268,24269,24270,24271,24272,24276,24277,24279,24280,24281,24282,24284,24285,
+24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24297,24299,24300,
+24301,24302,24303,24304,24305,24306,24307,24309,24312,24313,24315,24316,24317,
+24325,24326,24327,24329,24332,24333,24334,24336,24338,24340,24342,24345,24346,
+24348,24349,24350,24353,24354,24355,24356,U,24360,24363,24364,24366,24368,
+24370,24371,24372,24373,24374,24375,24376,24379,24381,24382,24383,24385,24386,
+24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,
+24401,24404,24409,24410,24411,24412,24414,24415,24416,24419,24421,24423,24424,
+24427,24430,24431,24434,24436,24437,24438,24440,24442,24445,24446,24447,24451,
+24454,24461,24462,24463,24465,24467,24468,24470,24474,24475,24477,24478,24479,
+24480,24482,24483,24484,24485,24486,24487,24489,24491,24492,24495,24496,24497,
+24498,24499,24500,24502,24504,24505,24506,24507,24510,24511,24512,24513,24514,
+24519,24520,24522,24523,24526,24531,24532,24533,24538,24539,24540,24542,24543,
+24546,24547,24549,24550,24552,24553,24556,24559,24560,24562,24563,24564,24566,
+24567,24569,24570,24572,24583,24584,24585,24587,24588,24592,24593,24595,24599,
+24600,24602,24606,24607,24610,24611,24612,24620,24621,24622,24624,24625,24626,
+24627,24628,24630,24631,24632,24633,24634,24637,24638,24640,24644,24645,24646,
+24647,24648,24649,24650,24652,24654,24655,24657,24659,24660,24662,24663,24664,
+24667,24668,24670,24671,24672,24673,24677,24678,24686,24689,24690,24692,24693,
+24695,24702,24704,U,24705,24706,24709,24710,24711,24712,24714,24715,24718,
+24719,24720,24721,24723,24725,24727,24728,24729,24732,24734,24737,24738,24740,
+24741,24743,24745,24746,24750,24752,24755,24757,24758,24759,24761,24762,24765,
+24766,24767,24768,24769,24770,24771,24772,24775,24776,24777,24780,24781,24782,
+24783,24784,24786,24787,24788,24790,24791,24793,24795,24798,24801,24802,24803,
+24804,24805,24810,24817,24818,24821,24823,24824,24827,24828,24829,24830,24831,
+24834,24835,24836,24837,24839,24842,24843,24844,24848,24849,24850,24851,24852,
+24854,24855,24856,24857,24859,24860,24861,24862,24865,24866,24869,24872,24873,
+24874,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,
+24888,24889,24890,24891,24892,24893,24894,24896,24897,24898,24899,24900,24901,
+24902,24903,24905,24907,24909,24911,24912,24914,24915,24916,24918,24919,24920,
+24921,24922,24923,24924,24926,24927,24928,24929,24931,24932,24933,24934,24937,
+24938,24939,24940,24941,24942,24943,24945,24946,24947,24948,24950,24952,24953,
+24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,
+24967,24968,24969,24970,24972,24973,24975,24976,24977,24978,24979,24981,U,
+24982,24983,24984,24985,24986,24987,24988,24990,24991,24992,24993,24994,24995,
+24996,24997,24998,25002,25003,25005,25006,25007,25008,25009,25010,25011,25012,
+25013,25014,25016,25017,25018,25019,25020,25021,25023,25024,25025,25027,25028,
+25029,25030,25031,25033,25036,25037,25038,25039,25040,25043,25045,25046,25047,
+25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,
+25061,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,
+25075,25076,25078,25079,25080,25081,25082,25083,25084,25085,25086,25088,25089,
+25090,25091,25092,25093,25095,25097,25107,25108,25113,25116,25117,25118,25120,
+25123,25126,25127,25128,25129,25131,25133,25135,25136,25137,25138,25141,25142,
+25144,25145,25146,25147,25148,25154,25156,25157,25158,25162,25167,25168,25173,
+25174,25175,25177,25178,25180,25181,25182,25183,25184,25185,25186,25188,25189,
+25192,25201,25202,25204,25205,25207,25208,25210,25211,25213,25217,25218,25219,
+25221,25222,25223,25224,25227,25228,25229,25230,25231,25232,25236,25241,25244,
+25245,25246,25251,25254,25255,25257,25258,25261,25262,25263,25264,25266,25267,
+25268,25270,25271,25272,25274,25278,25280,25281,U,25283,25291,25295,25297,
+25301,25309,25310,25312,25313,25316,25322,25323,25328,25330,25333,25336,25337,
+25338,25339,25344,25347,25348,25349,25350,25354,25355,25356,25357,25359,25360,
+25362,25363,25364,25365,25367,25368,25369,25372,25382,25383,25385,25388,25389,
+25390,25392,25393,25395,25396,25397,25398,25399,25400,25403,25404,25406,25407,
+25408,25409,25412,25415,25416,25418,25425,25426,25427,25428,25430,25431,25432,
+25433,25434,25435,25436,25437,25440,25444,25445,25446,25448,25450,25451,25452,
+25455,25456,25458,25459,25460,25461,25464,25465,25468,25469,25470,25471,25473,
+25475,25476,25477,25478,25483,25485,25489,25491,25492,25493,25495,25497,25498,
+25499,25500,25501,25502,25503,25505,25508,25510,25515,25519,25521,25522,25525,
+25526,25529,25531,25533,25535,25536,25537,25538,25539,25541,25543,25544,25546,
+25547,25548,25553,25555,25556,25557,25559,25560,25561,25562,25563,25564,25565,
+25567,25570,25572,25573,25574,25575,25576,25579,25580,25582,25583,25584,25585,
+25587,25589,25591,25593,25594,25595,25596,25598,25603,25604,25606,25607,25608,
+25609,25610,25613,25614,25617,25618,25621,25622,25623,25624,25625,25626,25629,
+25631,25634,25635,25636,U,25637,25639,25640,25641,25643,25646,25647,25648,
+25649,25650,25651,25653,25654,25655,25656,25657,25659,25660,25662,25664,25666,
+25667,25673,25675,25676,25677,25678,25679,25680,25681,25683,25685,25686,25687,
+25689,25690,25691,25692,25693,25695,25696,25697,25698,25699,25700,25701,25702,
+25704,25706,25707,25708,25710,25711,25712,25713,25714,25715,25716,25717,25718,
+25719,25723,25724,25725,25726,25727,25728,25729,25731,25734,25736,25737,25738,
+25739,25740,25741,25742,25743,25744,25747,25748,25751,25752,25754,25755,25756,
+25757,25759,25760,25761,25762,25763,25765,25766,25767,25768,25770,25771,25775,
+25777,25778,25779,25780,25782,25785,25787,25789,25790,25791,25793,25795,25796,
+25798,25799,25800,25801,25802,25803,25804,25807,25809,25811,25812,25813,25814,
+25817,25818,25819,25820,25821,25823,25824,25825,25827,25829,25831,25832,25833,
+25834,25835,25836,25837,25838,25839,25840,25841,25842,25843,25844,25845,25846,
+25847,25848,25849,25850,25851,25852,25853,25854,25855,25857,25858,25859,25860,
+25861,25862,25863,25864,25866,25867,25868,25869,25870,25871,25872,25873,25875,
+25876,25877,25878,25879,25881,25882,25883,25884,25885,25886,25887,25888,25889,
+U,25890,25891,25892,25894,25895,25896,25897,25898,25900,25901,25904,25905,
+25906,25907,25911,25914,25916,25917,25920,25921,25922,25923,25924,25926,25927,
+25930,25931,25933,25934,25936,25938,25939,25940,25943,25944,25946,25948,25951,
+25952,25953,25956,25957,25959,25960,25961,25962,25965,25966,25967,25969,25971,
+25973,25974,25976,25977,25978,25979,25980,25981,25982,25983,25984,25985,25986,
+25987,25988,25989,25990,25992,25993,25994,25997,25998,25999,26002,26004,26005,
+26006,26008,26010,26013,26014,26016,26018,26019,26022,26024,26026,26028,26030,
+26033,26034,26035,26036,26037,26038,26039,26040,26042,26043,26046,26047,26048,
+26050,26055,26056,26057,26058,26061,26064,26065,26067,26068,26069,26072,26073,
+26074,26075,26076,26077,26078,26079,26081,26083,26084,26090,26091,26098,26099,
+26100,26101,26104,26105,26107,26108,26109,26110,26111,26113,26116,26117,26119,
+26120,26121,26123,26125,26128,26129,26130,26134,26135,26136,26138,26139,26140,
+26142,26145,26146,26147,26148,26150,26153,26154,26155,26156,26158,26160,26162,
+26163,26167,26168,26169,26170,26171,26173,26175,26176,26178,26180,26181,26182,
+26183,26184,26185,26186,26189,26190,26192,26193,26200,U,26201,26203,26204,
+26205,26206,26208,26210,26211,26213,26215,26217,26218,26219,26220,26221,26225,
+26226,26227,26229,26232,26233,26235,26236,26237,26239,26240,26241,26243,26245,
+26246,26248,26249,26250,26251,26253,26254,26255,26256,26258,26259,26260,26261,
+26264,26265,26266,26267,26268,26270,26271,26272,26273,26274,26275,26276,26277,
+26278,26281,26282,26283,26284,26285,26287,26288,26289,26290,26291,26293,26294,
+26295,26296,26298,26299,26300,26301,26303,26304,26305,26306,26307,26308,26309,
+26310,26311,26312,26313,26314,26315,26316,26317,26318,26319,26320,26321,26322,
+26323,26324,26325,26326,26327,26328,26330,26334,26335,26336,26337,26338,26339,
+26340,26341,26343,26344,26346,26347,26348,26349,26350,26351,26353,26357,26358,
+26360,26362,26363,26365,26369,26370,26371,26372,26373,26374,26375,26380,26382,
+26383,26385,26386,26387,26390,26392,26393,26394,26396,26398,26400,26401,26402,
+26403,26404,26405,26407,26409,26414,26416,26418,26419,26422,26423,26424,26425,
+26427,26428,26430,26431,26433,26436,26437,26439,26442,26443,26445,26450,26452,
+26453,26455,26456,26457,26458,26459,26461,26466,26467,26468,26470,26471,26475,
+26476,26478,26481,26484,26486,U,26488,26489,26490,26491,26493,26496,26498,
+26499,26501,26502,26504,26506,26508,26509,26510,26511,26513,26514,26515,26516,
+26518,26521,26523,26527,26528,26529,26532,26534,26537,26540,26542,26545,26546,
+26548,26553,26554,26555,26556,26557,26558,26559,26560,26562,26565,26566,26567,
+26568,26569,26570,26571,26572,26573,26574,26581,26582,26583,26587,26591,26593,
+26595,26596,26598,26599,26600,26602,26603,26605,26606,26610,26613,26614,26615,
+26616,26617,26618,26619,26620,26622,26625,26626,26627,26628,26630,26637,26640,
+26642,26644,26645,26648,26649,26650,26651,26652,26654,26655,26656,26658,26659,
+26660,26661,26662,26663,26664,26667,26668,26669,26670,26671,26672,26673,26676,
+26677,26678,26682,26683,26687,26695,26699,26701,26703,26706,26710,26711,26712,
+26713,26714,26715,26716,26717,26718,26719,26730,26732,26733,26734,26735,26736,
+26737,26738,26739,26741,26744,26745,26746,26747,26748,26749,26750,26751,26752,
+26754,26756,26759,26760,26761,26762,26763,26764,26765,26766,26768,26769,26770,
+26772,26773,26774,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,
+26787,26788,26789,26793,26794,26795,26796,26798,26801,26802,26804,26806,26807,
+26808,U,26809,26810,26811,26812,26813,26814,26815,26817,26819,26820,26821,
+26822,26823,26824,26826,26828,26830,26831,26832,26833,26835,26836,26838,26839,
+26841,26843,26844,26845,26846,26847,26849,26850,26852,26853,26854,26855,26856,
+26857,26858,26859,26860,26861,26863,26866,26867,26868,26870,26871,26872,26875,
+26877,26878,26879,26880,26882,26883,26884,26886,26887,26888,26889,26890,26892,
+26895,26897,26899,26900,26901,26902,26903,26904,26905,26906,26907,26908,26909,
+26910,26913,26914,26915,26917,26918,26919,26920,26921,26922,26923,26924,26926,
+26927,26929,26930,26931,26933,26934,26935,26936,26938,26939,26940,26942,26944,
+26945,26947,26948,26949,26950,26951,26952,26953,26954,26955,26956,26957,26958,
+26959,26960,26961,26962,26963,26965,26966,26968,26969,26971,26972,26975,26977,
+26978,26980,26981,26983,26984,26985,26986,26988,26989,26991,26992,26994,26995,
+26996,26997,26998,27002,27003,27005,27006,27007,27009,27011,27013,27018,27019,
+27020,27022,27023,27024,27025,27026,27027,27030,27031,27033,27034,27037,27038,
+27039,27040,27041,27042,27043,27044,27045,27046,27049,27050,27052,27054,27055,
+27056,27058,27059,27061,27062,27064,27065,27066,27068,27069,U,27070,27071,
+27072,27074,27075,27076,27077,27078,27079,27080,27081,27083,27085,27087,27089,
+27090,27091,27093,27094,27095,27096,27097,27098,27100,27101,27102,27105,27106,
+27107,27108,27109,27110,27111,27112,27113,27114,27115,27116,27118,27119,27120,
+27121,27123,27124,27125,27126,27127,27128,27129,27130,27131,27132,27134,27136,
+27137,27138,27139,27140,27141,27142,27143,27144,27145,27147,27148,27149,27150,
+27151,27152,27153,27154,27155,27156,27157,27158,27161,27162,27163,27164,27165,
+27166,27168,27170,27171,27172,27173,27174,27175,27177,27179,27180,27181,27182,
+27184,27186,27187,27188,27190,27191,27192,27193,27194,27195,27196,27199,27200,
+27201,27202,27203,27205,27206,27208,27209,27210,27211,27212,27213,27214,27215,
+27217,27218,27219,27220,27221,27222,27223,27226,27228,27229,27230,27231,27232,
+27234,27235,27236,27238,27239,27240,27241,27242,27243,27244,27245,27246,27247,
+27248,27250,27251,27252,27253,27254,27255,27256,27258,27259,27261,27262,27263,
+27265,27266,27267,27269,27270,27271,27272,27273,27274,27275,27276,27277,27279,
+27282,27283,27284,27285,27286,27288,27289,27290,27291,27292,27293,27294,27295,
+27297,27298,27299,27300,27301,27302,U,27303,27304,27306,27309,27310,27311,
+27312,27313,27314,27315,27316,27317,27318,27319,27320,27321,27322,27323,27324,
+27325,27326,27327,27328,27329,27330,27331,27332,27333,27334,27335,27336,27337,
+27338,27339,27340,27341,27342,27343,27344,27345,27346,27347,27348,27349,27350,
+27351,27352,27353,27354,27355,27356,27357,27358,27359,27360,27361,27362,27363,
+27364,27365,27366,27367,27368,27369,27370,27371,27372,27373,27374,27375,27376,
+27377,27378,27379,27380,27381,27382,27383,27384,27385,27386,27387,27388,27389,
+27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,
+27403,27404,27405,27406,27407,27408,27409,27410,27411,27412,27413,27414,27415,
+27416,27417,27418,27419,27420,27421,27422,27423,27429,27430,27432,27433,27434,
+27435,27436,27437,27438,27439,27440,27441,27443,27444,27445,27446,27448,27451,
+27452,27453,27455,27456,27457,27458,27460,27461,27464,27466,27467,27469,27470,
+27471,27472,27473,27474,27475,27476,27477,27478,27479,27480,27482,27483,27484,
+27485,27486,27487,27488,27489,27496,27497,27499,27500,27501,27502,27503,27504,
+27505,27506,27507,27508,27509,27510,27511,27512,27514,27517,27518,27519,27520,
+27525,27528,U,27532,27534,27535,27536,27537,27540,27541,27543,27544,27545,
+27548,27549,27550,27551,27552,27554,27555,27556,27557,27558,27559,27560,27561,
+27563,27564,27565,27566,27567,27568,27569,27570,27574,27576,27577,27578,27579,
+27580,27581,27582,27584,27587,27588,27590,27591,27592,27593,27594,27596,27598,
+27600,27601,27608,27610,27612,27613,27614,27615,27616,27618,27619,27620,27621,
+27622,27623,27624,27625,27628,27629,27630,27632,27633,27634,27636,27638,27639,
+27640,27642,27643,27644,27646,27647,27648,27649,27650,27651,27652,27656,27657,
+27658,27659,27660,27662,27666,27671,27676,27677,27678,27680,27683,27685,27691,
+27692,27693,27697,27699,27702,27703,27705,27706,27707,27708,27710,27711,27715,
+27716,27717,27720,27723,27724,27725,27726,27727,27729,27730,27731,27734,27736,
+27737,27738,27746,27747,27749,27750,27751,27755,27756,27757,27758,27759,27761,
+27763,27765,27767,27768,27770,27771,27772,27775,27776,27780,27783,27786,27787,
+27789,27790,27793,27794,27797,27798,27799,27800,27802,27804,27805,27806,27808,
+27810,27816,27820,27823,27824,27828,27829,27830,27831,27834,27840,27841,27842,
+27843,27846,27847,27848,27851,27853,27854,27855,27857,27858,27864,U,27865,
+27866,27868,27869,27871,27876,27878,27879,27881,27884,27885,27890,27892,27897,
+27903,27904,27906,27907,27909,27910,27912,27913,27914,27917,27919,27920,27921,
+27923,27924,27925,27926,27928,27932,27933,27935,27936,27937,27938,27939,27940,
+27942,27944,27945,27948,27949,27951,27952,27956,27958,27959,27960,27962,27967,
+27968,27970,27972,27977,27980,27984,27989,27990,27991,27992,27995,27997,27999,
+28001,28002,28004,28005,28007,28008,28011,28012,28013,28016,28017,28018,28019,
+28021,28022,28025,28026,28027,28029,28030,28031,28032,28033,28035,28036,28038,
+28039,28042,28043,28045,28047,28048,28050,28054,28055,28056,28057,28058,28060,
+28066,28069,28076,28077,28080,28081,28083,28084,28086,28087,28089,28090,28091,
+28092,28093,28094,28097,28098,28099,28104,28105,28106,28109,28110,28111,28112,
+28114,28115,28116,28117,28119,28122,28123,28124,28127,28130,28131,28133,28135,
+28136,28137,28138,28141,28143,28144,28146,28148,28149,28150,28152,28154,28157,
+28158,28159,28160,28161,28162,28163,28164,28166,28167,28168,28169,28171,28175,
+28178,28179,28181,28184,28185,28187,28188,28190,28191,28194,28198,28199,28200,
+28202,28204,28206,28208,28209,28211,28213,U,28214,28215,28217,28219,28220,
+28221,28222,28223,28224,28225,28226,28229,28230,28231,28232,28233,28234,28235,
+28236,28239,28240,28241,28242,28245,28247,28249,28250,28252,28253,28254,28256,
+28257,28258,28259,28260,28261,28262,28263,28264,28265,28266,28268,28269,28271,
+28272,28273,28274,28275,28276,28277,28278,28279,28280,28281,28282,28283,28284,
+28285,28288,28289,28290,28292,28295,28296,28298,28299,28300,28301,28302,28305,
+28306,28307,28308,28309,28310,28311,28313,28314,28315,28317,28318,28320,28321,
+28323,28324,28326,28328,28329,28331,28332,28333,28334,28336,28339,28341,28344,
+28345,28348,28350,28351,28352,28355,28356,28357,28358,28360,28361,28362,28364,
+28365,28366,28368,28370,28374,28376,28377,28379,28380,28381,28387,28391,28394,
+28395,28396,28397,28398,28399,28400,28401,28402,28403,28405,28406,28407,28408,
+28410,28411,28412,28413,28414,28415,28416,28417,28419,28420,28421,28423,28424,
+28426,28427,28428,28429,28430,28432,28433,28434,28438,28439,28440,28441,28442,
+28443,28444,28445,28446,28447,28449,28450,28451,28453,28454,28455,28456,28460,
+28462,28464,28466,28468,28469,28471,28472,28473,28474,28475,28476,28477,28479,
+28480,28481,28482,U,28483,28484,28485,28488,28489,28490,28492,28494,28495,
+28496,28497,28498,28499,28500,28501,28502,28503,28505,28506,28507,28509,28511,
+28512,28513,28515,28516,28517,28519,28520,28521,28522,28523,28524,28527,28528,
+28529,28531,28533,28534,28535,28537,28539,28541,28542,28543,28544,28545,28546,
+28547,28549,28550,28551,28554,28555,28559,28560,28561,28562,28563,28564,28565,
+28566,28567,28568,28569,28570,28571,28573,28574,28575,28576,28578,28579,28580,
+28581,28582,28584,28585,28586,28587,28588,28589,28590,28591,28592,28593,28594,
+28596,28597,28599,28600,28602,28603,28604,28605,28606,28607,28609,28611,28612,
+28613,28614,28615,28616,28618,28619,28620,28621,28622,28623,28624,28627,28628,
+28629,28630,28631,28632,28633,28634,28635,28636,28637,28639,28642,28643,28644,
+28645,28646,28647,28648,28649,28650,28651,28652,28653,28656,28657,28658,28659,
+28660,28661,28662,28663,28664,28665,28666,28667,28668,28669,28670,28671,28672,
+28673,28674,28675,28676,28677,28678,28679,28680,28681,28682,28683,28684,28685,
+28686,28687,28688,28690,28691,28692,28693,28694,28695,28696,28697,28700,28701,
+28702,28703,28704,28705,28706,28708,28709,28710,28711,28712,28713,28714,U,
+28715,28716,28717,28718,28719,28720,28721,28722,28723,28724,28726,28727,28728,
+28730,28731,28732,28733,28734,28735,28736,28737,28738,28739,28740,28741,28742,
+28743,28744,28745,28746,28747,28749,28750,28752,28753,28754,28755,28756,28757,
+28758,28759,28760,28761,28762,28763,28764,28765,28767,28768,28769,28770,28771,
+28772,28773,28774,28775,28776,28777,28778,28782,28785,28786,28787,28788,28791,
+28793,28794,28795,28797,28801,28802,28803,28804,28806,28807,28808,28811,28812,
+28813,28815,28816,28817,28819,28823,28824,28826,28827,28830,28831,28832,28833,
+28834,28835,28836,28837,28838,28839,28840,28841,28842,28848,28850,28852,28853,
+28854,28858,28862,28863,28868,28869,28870,28871,28873,28875,28876,28877,28878,
+28879,28880,28881,28882,28883,28884,28885,28886,28887,28890,28892,28893,28894,
+28896,28897,28898,28899,28901,28906,28910,28912,28913,28914,28915,28916,28917,
+28918,28920,28922,28923,28924,28926,28927,28928,28929,28930,28931,28932,28933,
+28934,28935,28936,28939,28940,28941,28942,28943,28945,28946,28948,28951,28955,
+28956,28957,28958,28959,28960,28961,28962,28963,28964,28965,28967,28968,28969,
+28970,28971,28972,28973,28974,28978,28979,28980,U,28981,28983,28984,28985,
+28986,28987,28988,28989,28990,28991,28992,28993,28994,28995,28996,28998,28999,
+29000,29001,29003,29005,29007,29008,29009,29010,29011,29012,29013,29014,29015,
+29016,29017,29018,29019,29021,29023,29024,29025,29026,29027,29029,29033,29034,
+29035,29036,29037,29039,29040,29041,29044,29045,29046,29047,29049,29051,29052,
+29054,29055,29056,29057,29058,29059,29061,29062,29063,29064,29065,29067,29068,
+29069,29070,29072,29073,29074,29075,29077,29078,29079,29082,29083,29084,29085,
+29086,29089,29090,29091,29092,29093,29094,29095,29097,29098,29099,29101,29102,
+29103,29104,29105,29106,29108,29110,29111,29112,29114,29115,29116,29117,29118,
+29119,29120,29121,29122,29124,29125,29126,29127,29128,29129,29130,29131,29132,
+29133,29135,29136,29137,29138,29139,29142,29143,29144,29145,29146,29147,29148,
+29149,29150,29151,29153,29154,29155,29156,29158,29160,29161,29162,29163,29164,
+29165,29167,29168,29169,29170,29171,29172,29173,29174,29175,29176,29178,29179,
+29180,29181,29182,29183,29184,29185,29186,29187,29188,29189,29191,29192,29193,
+29194,29195,29196,29197,29198,29199,29200,29201,29202,29203,29204,29205,29206,
+29207,29208,29209,29210,U,29211,29212,29214,29215,29216,29217,29218,29219,
+29220,29221,29222,29223,29225,29227,29229,29230,29231,29234,29235,29236,29242,
+29244,29246,29248,29249,29250,29251,29252,29253,29254,29257,29258,29259,29262,
+29263,29264,29265,29267,29268,29269,29271,29272,29274,29276,29278,29280,29283,
+29284,29285,29288,29290,29291,29292,29293,29296,29297,29299,29300,29302,29303,
+29304,29307,29308,29309,29314,29315,29317,29318,29319,29320,29321,29324,29326,
+29328,29329,29331,29332,29333,29334,29335,29336,29337,29338,29339,29340,29341,
+29342,29344,29345,29346,29347,29348,29349,29350,29351,29352,29353,29354,29355,
+29358,29361,29362,29363,29365,29370,29371,29372,29373,29374,29375,29376,29381,
+29382,29383,29385,29386,29387,29388,29391,29393,29395,29396,29397,29398,29400,
+29402,29403,183,U,U,U,U,U,8212,8560,8561,8562,8563,8564,8565,8566,8567,8568,
+8569,65077,65078,65081,65082,65087,65088,65085,65086,65089,65090,65091,65092,
+U,U,65083,65084,65079,65080,65073,U,65075,65076,714,715,729,8211,8213,8229,
+8245,8453,8457,8598,8599,8600,8601,8725,8735,8739,8786,8806,8807,8895,9552,
+9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,
+9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,
+9583,9584,9585,9586,9587,9601,9602,9603,9604,9605,9606,9607,U,9608,9609,9610,
+9611,9612,9613,9614,9615,9619,9620,9621,9660,9661,9698,9699,9700,9701,9737,
+8853,12306,12317,12318,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,593,U,324,328,U,609,12321,12322,12323,12324,12325,12326,
+12327,12328,12329,12963,13198,13199,13212,13213,13214,13217,13252,13262,13265,
+13266,13269,65072,65506,65508,U,8481,12849,U,8208,U,U,U,12540,12443,12444,
+12541,12542,12294,12445,12446,65097,65098,65099,65100,65101,65102,65103,65104,
+65105,65106,65108,65109,65110,65111,65113,65114,65115,65116,65117,65118,65119,
+65120,65121,U,65122,65123,65124,65125,65126,65128,65129,65130,65131,U,U,U,U,U,
+U,U,U,U,U,U,U,U,12295,29404,29405,29407,29410,29411,29412,29413,29414,29415,
+29418,29419,29429,29430,29433,29437,29438,29439,29440,29442,29444,29445,29446,
+29447,29448,29449,29451,29452,29453,29455,29456,29457,29458,29460,29464,29465,
+29466,29471,29472,29475,29476,29478,29479,29480,29485,29487,29488,29490,29491,
+29493,29494,29498,29499,29500,29501,29504,29505,29506,29507,29508,29509,29510,
+29511,29512,U,29513,29514,29515,29516,29518,29519,29521,29523,29524,29525,
+29526,29528,29529,29530,29531,29532,29533,29534,29535,29537,29538,29539,29540,
+29541,29542,29543,29544,29545,29546,29547,29550,29552,29553,29554,29555,29556,
+29557,29558,29559,29560,29561,29562,29563,29564,29565,29567,29568,29569,29570,
+29571,29573,29574,29576,29578,29580,29581,29583,29584,29586,29587,29588,29589,
+29591,29592,29593,29594,29596,29597,29598,29600,29601,29603,29604,29605,29606,
+29607,29608,29610,29612,29613,29617,29620,29621,29622,29624,29625,29628,29629,
+29630,29631,29633,29635,29636,29637,29638,29639,U,29643,29644,29646,29650,
+29651,29652,29653,29654,29655,29656,29658,29659,29660,29661,29663,29665,29666,
+29667,29668,29670,29672,29674,29675,29676,29678,29679,29680,29681,29683,29684,
+29685,29686,29687,29688,29689,29690,29691,29692,29693,29694,29695,29696,29697,
+29698,29700,29703,29704,29707,29708,29709,29710,29713,29714,29715,29716,29717,
+29718,29719,29720,29721,29724,29725,29726,29727,29728,29729,29731,29732,29735,
+29737,29739,29741,29743,29745,29746,29751,29752,29753,29754,29755,29757,29758,
+29759,29760,29762,29763,29764,29765,29766,29767,29768,29769,29770,29771,29772,
+29773,U,29774,29775,29776,29777,29778,29779,29780,29782,29784,29789,29792,
+29793,29794,29795,29796,29797,29798,29799,29800,29801,29802,29803,29804,29806,
+29807,29809,29810,29811,29812,29813,29816,29817,29818,29819,29820,29821,29823,
+29826,29828,29829,29830,29832,29833,29834,29836,29837,29839,29841,29842,29843,
+29844,29845,29846,29847,29848,29849,29850,29851,29853,29855,29856,29857,29858,
+29859,29860,29861,29862,29866,29867,29868,29869,29870,29871,29872,29873,29874,
+29875,29876,29877,29878,29879,29880,29881,29883,29884,29885,29886,29887,29888,
+29889,29890,29891,29892,29893,29894,29895,U,29896,29897,29898,29899,29900,
+29901,29902,29903,29904,29905,29907,29908,29909,29910,29911,29912,29913,29914,
+29915,29917,29919,29921,29925,29927,29928,29929,29930,29931,29932,29933,29936,
+29937,29938,29939,29941,29944,29945,29946,29947,29948,29949,29950,29952,29953,
+29954,29955,29957,29958,29959,29960,29961,29962,29963,29964,29966,29968,29970,
+29972,29973,29974,29975,29979,29981,29982,29984,29985,29986,29987,29988,29990,
+29991,29994,29998,30004,30006,30009,30012,30013,30015,30017,30018,30019,30020,
+30022,30023,30025,30026,30029,30032,30033,30034,30035,30037,30038,30039,30040,
+U,30045,30046,30047,30048,30049,30050,30051,30052,30055,30056,30057,30059,
+30060,30061,30062,30063,30064,30065,30067,30069,30070,30071,30074,30075,30076,
+30077,30078,30080,30081,30082,30084,30085,30087,30088,30089,30090,30092,30093,
+30094,30096,30099,30101,30104,30107,30108,30110,30114,30118,30119,30120,30121,
+30122,30125,30134,30135,30138,30139,30143,30144,30145,30150,30155,30156,30158,
+30159,30160,30161,30163,30167,30169,30170,30172,30173,30175,30176,30177,30181,
+30185,30188,30189,30190,30191,30194,30195,30197,30198,30199,30200,30202,30203,
+30205,30206,30210,30212,30214,30215,U,30216,30217,30219,30221,30222,30223,
+30225,30226,30227,30228,30230,30234,30236,30237,30238,30241,30243,30247,30248,
+30252,30254,30255,30257,30258,30262,30263,30265,30266,30267,30269,30273,30274,
+30276,30277,30278,30279,30280,30281,30282,30283,30286,30287,30288,30289,30290,
+30291,30293,30295,30296,30297,30298,30299,30301,30303,30304,30305,30306,30308,
+30309,30310,30311,30312,30313,30314,30316,30317,30318,30320,30321,30322,30323,
+30324,30325,30326,30327,30329,30330,30332,30335,30336,30337,30339,30341,30345,
+30346,30348,30349,30351,30352,30354,30356,30357,30359,30360,30362,30363,U,
+30364,30365,30366,30367,30368,30369,30370,30371,30373,30374,30375,30376,30377,
+30378,30379,30380,30381,30383,30384,30387,30389,30390,30391,30392,30393,30394,
+30395,30396,30397,30398,30400,30401,30403,30404,30407,30409,30411,30412,30419,
+30421,30425,30426,30428,30429,30430,30432,30433,30434,30435,30436,30438,30439,
+30440,30441,30442,30443,30444,30445,30448,30451,30453,30454,30455,30458,30459,
+30461,30463,30464,30466,30467,30469,30470,30474,30476,30478,30479,30480,30481,
+30482,30483,30484,30485,30486,30487,30488,30491,30492,30493,30494,30497,30499,
+30500,30501,30503,30506,30507,U,30508,30510,30512,30513,30514,30515,30516,
+30521,30523,30525,30526,30527,30530,30532,30533,30534,30536,30537,30538,30539,
+30540,30541,30542,30543,30546,30547,30548,30549,30550,30551,30552,30553,30556,
+30557,30558,30559,30560,30564,30567,30569,30570,30573,30574,30575,30576,30577,
+30578,30579,30580,30581,30582,30583,30584,30586,30587,30588,30593,30594,30595,
+30598,30599,30600,30601,30602,30603,30607,30608,30611,30612,30613,30614,30615,
+30616,30617,30618,30619,30620,30621,30622,30625,30627,30628,30630,30632,30635,
+30637,30638,30639,30641,30642,30644,30646,30647,30648,30649,30650,U,30652,
+30654,30656,30657,30658,30659,30660,30661,30662,30663,30664,30665,30666,30667,
+30668,30670,30671,30672,30673,30674,30675,30676,30677,30678,30680,30681,30682,
+30685,30686,30687,30688,30689,30692,30694,30696,30698,30703,30704,30705,30706,
+30708,30709,30711,30713,30714,30715,30716,30723,30724,30725,30726,30727,30728,
+30730,30731,30734,30735,30736,30739,30741,30745,30747,30750,30752,30753,30754,
+30756,30760,30762,30763,30766,30767,30769,30770,30771,30773,30774,30781,30783,
+30785,30786,30787,30788,30790,30792,30793,30794,30795,30797,30799,30801,30803,
+30804,30808,30809,30810,U,30811,30812,30814,30815,30816,30817,30818,30819,
+30820,30821,30822,30823,30824,30825,30831,30832,30833,30834,30835,30836,30837,
+30838,30840,30841,30842,30843,30845,30846,30847,30848,30849,30850,30851,30852,
+30853,30854,30856,30858,30859,30863,30864,30866,30868,30869,30870,30873,30877,
+30878,30880,30882,30884,30886,30888,30889,30890,30891,30892,30893,30894,30895,
+30901,30902,30903,30904,30906,30907,30908,30909,30911,30912,30914,30915,30916,
+30918,30919,30920,30924,30925,30926,30927,30929,30930,30931,30934,30935,30936,
+30938,30939,30940,30941,30942,30943,30944,30945,30946,30947,U,30948,30949,
+30950,30951,30953,30954,30955,30957,30958,30959,30960,30961,30963,30965,30966,
+30968,30969,30971,30972,30973,30974,30975,30976,30978,30979,30980,30982,30983,
+30984,30985,30986,30987,30988,30989,30990,30991,30992,30993,30994,30996,30997,
+30998,30999,31000,31001,31002,31003,31004,31005,31007,31008,31009,31010,31011,
+31013,31014,31015,31016,31017,31018,31019,31020,31021,31022,31023,31024,31025,
+31026,31027,31029,31030,31031,31032,31033,31037,31039,31042,31043,31044,31045,
+31047,31050,31051,31052,31053,31054,31055,31056,31057,31058,31060,31061,31064,
+31065,31073,31075,U,31076,31078,31081,31082,31083,31084,31086,31088,31089,
+31090,31091,31092,31093,31094,31097,31099,31100,31101,31102,31103,31106,31107,
+31110,31111,31112,31113,31115,31116,31117,31118,31120,31121,31122,31123,31124,
+31125,31126,31127,31128,31129,31131,31132,31133,31134,31135,31136,31137,31138,
+31139,31140,31141,31142,31144,31145,31146,31147,31148,31149,31150,31151,31152,
+31153,31154,31156,31157,31158,31159,31160,31164,31167,31170,31172,31173,31175,
+31176,31178,31180,31182,31183,31184,31187,31188,31190,31191,31193,31194,31195,
+31196,31197,31198,31200,31201,31202,31205,31208,31210,U,31212,31214,31217,
+31218,31219,31220,31221,31222,31223,31225,31226,31228,31230,31231,31233,31236,
+31237,31239,31240,31241,31242,31244,31247,31248,31249,31250,31251,31253,31254,
+31256,31257,31259,31260,31261,31263,31265,31266,31268,31269,31270,31271,31272,
+31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31284,31285,31286,
+31288,31290,31294,31296,31297,31298,31299,31300,31301,31303,31304,31305,31306,
+31307,31308,31309,31310,31311,31312,31314,31315,31316,31317,31318,31320,31321,
+31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,
+31335,31336,U,31337,31338,31339,31340,31341,31342,31343,31345,31346,31347,
+31349,31355,31356,31357,31358,31362,31365,31367,31369,31370,31371,31372,31374,
+31375,31376,31379,31380,31385,31386,31387,31390,31393,31394,31395,31396,31399,
+31401,31402,31403,31406,31407,31408,31409,31410,31412,31413,31414,31415,31416,
+31417,31418,31419,31420,31421,31422,31424,31425,31426,31427,31428,31429,31430,
+31431,31432,31433,31434,31436,31437,31438,31439,31440,31441,31442,31443,31444,
+31445,31447,31448,31450,31451,31452,31453,31457,31458,31460,31463,31464,31465,
+31466,31467,31468,31470,31472,31473,31474,31475,U,31476,31477,31478,31479,
+31480,31483,31484,31486,31488,31489,31490,31493,31495,31497,31500,31501,31502,
+31504,31506,31507,31510,31511,31512,31514,31516,31517,31519,31521,31522,31523,
+31527,31529,31533,31535,31536,31538,31540,31541,31542,31543,31545,31547,31549,
+31551,31552,31553,31554,31555,31556,31558,31560,31562,31565,31566,31571,31573,
+31575,31577,31580,31582,31583,31585,31587,31588,31589,31590,31591,31592,31593,
+31594,31595,31596,31597,31599,31600,31603,31604,31606,31608,31610,31612,31613,
+31615,31617,31618,31619,31620,31622,31623,31624,31625,31626,31627,31628,31630,
+31631,U,31633,31634,31635,31638,31640,31641,31642,31643,31646,31647,31648,
+31651,31652,31653,31662,31663,31664,31666,31667,31669,31670,31671,31673,31674,
+31675,31676,31677,31678,31679,31680,31682,31683,31684,31685,31688,31689,31690,
+31691,31693,31694,31695,31696,31698,31700,31701,31702,31703,31704,31707,31708,
+31710,31711,31712,31714,31715,31716,31719,31720,31721,31723,31724,31725,31727,
+31728,31730,31731,31732,31733,31734,31736,31737,31738,31739,31741,31743,31744,
+31745,31746,31747,31748,31749,31750,31752,31753,31754,31757,31758,31760,31761,
+31762,31763,31764,31765,31767,31768,31769,U,31770,31771,31772,31773,31774,
+31776,31777,31778,31779,31780,31781,31784,31785,31787,31788,31789,31790,31791,
+31792,31793,31794,31795,31796,31797,31798,31799,31801,31802,31803,31804,31805,
+31806,31810,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31822,
+31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,
+31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,
+31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31861,31862,31863,
+31864,31865,31866,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,
+U,31880,31882,31883,31884,31885,31886,31887,31888,31891,31892,31894,31897,
+31898,31899,31904,31905,31907,31910,31911,31912,31913,31915,31916,31917,31919,
+31920,31924,31925,31926,31927,31928,31930,31931,31935,31936,31938,31939,31940,
+31942,31945,31947,31950,31951,31952,31953,31954,31955,31956,31960,31962,31963,
+31965,31966,31969,31970,31971,31972,31973,31974,31975,31977,31978,31979,31980,
+31981,31982,31984,31985,31986,31987,31988,31989,31990,31991,31993,31994,31996,
+31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,
+32011,32012,32013,32014,32015,32016,U,32017,32018,32019,32020,32021,32022,
+32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32035,32036,32037,
+32038,32040,32041,32042,32044,32045,32046,32048,32049,32050,32051,32052,32053,
+32054,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,
+32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,
+32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,
+32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,
+32106,32107,32108,32109,32111,32112,32113,32114,32115,32116,32117,32118,U,
+32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,
+32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,
+32146,32147,32148,32149,32150,32151,32152,32153,32154,32155,32156,32157,32158,
+32159,32160,32161,32162,32163,32164,32165,32167,32168,32169,32170,32171,32172,
+32173,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,
+32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,
+32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,
+32213,32214,32215,32216,32217,U,32218,32219,32220,32221,32222,32223,32224,
+32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,
+32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,
+32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,
+32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,
+32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,
+32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,
+32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,U,32314,
+32316,32317,32318,32319,32320,32322,32323,32324,32325,32326,32328,32329,32330,
+32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,
+32344,32345,32346,32347,32348,32349,32350,32351,32352,32353,32354,32355,32356,
+32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,
+32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,
+32383,32384,32385,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,
+32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,
+32410,32412,32413,32414,U,32430,32436,32443,32444,32470,32484,32492,32505,
+32522,32528,32542,32567,32569,32571,32572,32573,32574,32575,32576,32577,32579,
+32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32594,32595,32598,
+32601,32603,32604,32605,32606,32608,32611,32612,32613,32614,32615,32619,32620,
+32621,32623,32624,32627,32629,32630,32631,32632,32634,32635,32636,32637,32639,
+32640,32642,32643,32644,32645,32646,32647,32648,32649,32651,32653,32655,32656,
+32657,32658,32659,32661,32662,32663,32664,32665,32667,32668,32672,32674,32675,
+32677,32678,32680,32681,32682,32683,32684,32685,32686,32689,U,32691,32692,
+32693,32694,32695,32698,32699,32702,32704,32706,32707,32708,32710,32711,32712,
+32713,32715,32717,32719,32720,32721,32722,32723,32726,32727,32729,32730,32731,
+32732,32733,32734,32738,32739,32740,32743,32744,32746,32747,32748,32749,32751,
+32754,32756,32757,32758,32759,32760,32761,32762,32765,32766,32767,32770,32775,
+32776,32777,32778,32782,32783,32785,32787,32794,32795,32797,32798,32799,32801,
+32803,32804,32811,32812,32813,32814,32815,32816,32818,32820,32825,32826,32828,
+32830,32832,32833,32836,32837,32839,32840,32841,32846,32847,32848,32849,32851,
+32853,32854,32855,U,32857,32859,32860,32861,32862,32863,32864,32865,32866,
+32867,32868,32869,32870,32871,32872,32875,32876,32877,32878,32879,32880,32882,
+32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,32894,32897,
+32898,32901,32904,32906,32909,32910,32911,32912,32913,32914,32916,32917,32919,
+32921,32926,32931,32934,32935,32936,32940,32944,32947,32949,32950,32952,32953,
+32955,32965,32967,32968,32969,32970,32971,32975,32976,32977,32978,32979,32980,
+32981,32984,32991,32992,32994,32995,32998,33006,33013,33015,33017,33019,33022,
+33023,33024,33025,33027,33028,33029,33031,33032,33035,U,33036,33045,33047,
+33049,33051,33052,33053,33055,33056,33057,33058,33059,33060,33061,33062,33063,
+33064,33065,33066,33067,33069,33070,33072,33075,33076,33077,33079,33081,33082,
+33083,33084,33085,33087,33088,33089,33090,33091,33092,33093,33095,33097,33101,
+33102,33103,33106,33110,33111,33112,33115,33116,33117,33118,33119,33121,33122,
+33123,33124,33126,33128,33130,33131,33132,33135,33138,33139,33141,33142,33143,
+33144,33153,33155,33156,33157,33158,33159,33161,33163,33164,33165,33166,33168,
+33170,33171,33172,33173,33174,33175,33177,33178,33182,33183,33184,33185,33186,
+33188,33189,U,33191,33193,33195,33196,33197,33198,33199,33200,33201,33202,
+33204,33205,33206,33207,33208,33209,33212,33213,33214,33215,33220,33221,33223,
+33224,33225,33227,33229,33230,33231,33232,33233,33234,33235,33236,33237,33238,
+33239,33240,33241,33242,33243,33244,33245,33246,33247,33248,33249,33250,33252,
+33253,33254,33256,33257,33259,33262,33263,33264,33265,33266,33269,33270,33271,
+33272,33273,33274,33277,33279,33283,33287,33288,33289,33290,33291,33294,33295,
+33297,33299,33301,33302,33303,33304,33305,33306,33309,33312,33316,33317,33318,
+33319,33321,33326,33330,33338,33340,33341,33343,U,33344,33345,33346,33347,
+33349,33350,33352,33354,33356,33357,33358,33360,33361,33362,33363,33364,33365,
+33366,33367,33369,33371,33372,33373,33374,33376,33377,33378,33379,33380,33381,
+33382,33383,33385,33386,33387,33388,33389,33393,33397,33398,33399,33400,33403,
+33404,33408,33409,33411,33413,33414,33415,33417,33420,33424,33427,33428,33429,
+33430,33434,33435,33438,33440,33442,33443,33447,33458,33461,33462,33466,33467,
+33468,33471,33472,33474,33475,33477,33478,33481,33488,33494,33497,33498,33501,
+33506,33511,33512,33513,33514,33516,33517,33518,33520,33522,33523,33525,33526,
+33528,U,33530,33532,33533,33534,33535,33536,33546,33547,33549,33552,33554,
+33555,33558,33560,33561,33565,33566,33567,33568,33569,33570,33571,33572,33573,
+33574,33577,33578,33582,33584,33586,33591,33595,33597,33598,33599,33601,33602,
+33604,33605,33608,33610,33611,33612,33613,33614,33619,33621,33622,33623,33624,
+33625,33629,33634,33648,33649,33650,33651,33652,33653,33654,33657,33658,33662,
+33663,33664,33665,33666,33667,33668,33671,33672,33674,33675,33676,33677,33679,
+33680,33681,33684,33685,33686,33687,33689,33690,33693,33695,33697,33698,33699,
+33700,33701,33702,33703,33708,33709,33710,U,33711,33717,33723,33726,33727,
+33730,33731,33732,33734,33736,33737,33739,33741,33742,33744,33745,33746,33747,
+33749,33751,33753,33754,33755,33758,33762,33763,33764,33766,33767,33768,33771,
+33772,33773,33774,33775,33779,33780,33781,33782,33783,33786,33787,33788,33790,
+33791,33792,33794,33797,33799,33800,33801,33802,33808,33810,33811,33812,33813,
+33814,33815,33817,33818,33819,33822,33823,33824,33825,33826,33827,33833,33834,
+33835,33836,33837,33838,33839,33840,33842,33843,33844,33845,33846,33847,33849,
+33850,33851,33854,33855,33856,33857,33858,33859,33860,33861,33863,33864,33865,
+U,33866,33867,33868,33869,33870,33871,33872,33874,33875,33876,33877,33878,
+33880,33885,33886,33887,33888,33890,33892,33893,33894,33895,33896,33898,33902,
+33903,33904,33906,33908,33911,33913,33915,33916,33917,33918,33919,33920,33921,
+33923,33924,33925,33926,33930,33933,33935,33936,33937,33938,33939,33940,33941,
+33942,33944,33946,33947,33949,33950,33951,33952,33954,33955,33956,33957,33958,
+33959,33960,33961,33962,33963,33964,33965,33966,33968,33969,33971,33973,33974,
+33975,33979,33980,33982,33984,33986,33987,33989,33990,33991,33992,33995,33996,
+33998,33999,34002,34004,34005,34007,U,34008,34009,34010,34011,34012,34014,
+34017,34018,34020,34023,34024,34025,34026,34027,34029,34030,34031,34033,34034,
+34035,34036,34037,34038,34039,34040,34041,34042,34043,34045,34046,34048,34049,
+34050,34051,34052,34053,34054,34055,34056,34057,34058,34059,34061,34062,34063,
+34064,34066,34068,34069,34070,34072,34073,34075,34076,34077,34078,34080,34082,
+34083,34084,34085,34086,34087,34088,34089,34090,34093,34094,34095,34096,34097,
+34098,34099,34100,34101,34102,34110,34111,34112,34113,34114,34116,34117,34118,
+34119,34123,34124,34125,34126,34127,34128,34129,34130,34131,34132,34133,U,
+34135,34136,34138,34139,34140,34141,34143,34144,34145,34146,34147,34149,34150,
+34151,34153,34154,34155,34156,34157,34158,34159,34160,34161,34163,34165,34166,
+34167,34168,34172,34173,34175,34176,34177,34178,34179,34182,34184,34185,34186,
+34187,34188,34189,34190,34192,34193,34194,34195,34196,34197,34198,34199,34200,
+34201,34202,34205,34206,34207,34208,34209,34210,34211,34213,34214,34215,34217,
+34219,34220,34221,34225,34226,34227,34228,34229,34230,34232,34234,34235,34236,
+34237,34238,34239,34240,34242,34243,34244,34245,34246,34247,34248,34250,34251,
+34252,34253,34254,34257,34258,U,34260,34262,34263,34264,34265,34266,34267,
+34269,34270,34271,34272,34273,34274,34275,34277,34278,34279,34280,34282,34283,
+34284,34285,34286,34287,34288,34289,34290,34291,34292,34293,34294,34295,34296,
+34297,34298,34300,34301,34302,34304,34305,34306,34307,34308,34310,34311,34312,
+34313,34314,34315,34316,34317,34318,34319,34320,34322,34323,34324,34325,34327,
+34328,34329,34330,34331,34332,34333,34334,34335,34336,34337,34338,34339,34340,
+34341,34342,34344,34346,34347,34348,34349,34350,34351,34352,34353,34354,34355,
+34356,34357,34358,34359,34361,34362,34363,34365,34366,34367,34368,U,34369,
+34370,34371,34372,34373,34374,34375,34376,34377,34378,34379,34380,34386,34387,
+34389,34390,34391,34392,34393,34395,34396,34397,34399,34400,34401,34403,34404,
+34405,34406,34407,34408,34409,34410,34413,34415,34416,34418,34419,34420,34421,
+34422,34423,34424,34435,34436,34437,34438,34439,34440,34441,34446,34447,34448,
+34449,34450,34452,34454,34455,34456,34457,34458,34459,34462,34463,34464,34465,
+34466,34469,34470,34475,34477,34478,34482,34483,34487,34488,34489,34491,34492,
+34493,34494,34495,34497,34498,34499,34501,34504,34508,34509,34514,34515,34517,
+34518,34519,34522,34524,U,34525,34528,34529,34530,34531,34533,34534,34535,
+34536,34538,34539,34540,34543,34549,34550,34551,34554,34555,34556,34557,34559,
+34561,34564,34565,34566,34571,34572,34574,34575,34576,34577,34580,34582,34585,
+34587,34589,34591,34592,34596,34598,34599,34600,34602,34603,34604,34605,34607,
+34608,34610,34611,34613,34614,34616,34617,34618,34620,34621,34624,34625,34626,
+34627,34628,34629,34630,34634,34635,34637,34639,34640,34641,34642,34644,34645,
+34646,34648,34650,34651,34652,34653,34654,34655,34657,34658,34662,34663,34664,
+34665,34666,34667,34668,34669,34671,34673,34674,34675,34677,U,34679,34680,
+34681,34682,34687,34688,34689,34692,34694,34695,34697,34698,34700,34702,34703,
+34704,34705,34706,34708,34709,34710,34712,34713,34714,34715,34716,34717,34718,
+34720,34721,34722,34723,34724,34725,34726,34727,34729,34730,34734,34736,34737,
+34738,34740,34742,34743,34744,34745,34747,34748,34750,34751,34753,34754,34755,
+34756,34757,34759,34760,34761,34764,34765,34766,34767,34768,34772,34773,34774,
+34775,34776,34777,34778,34780,34781,34782,34783,34785,34786,34787,34788,34790,
+34791,34792,34793,34795,34796,34797,34799,34800,34801,34802,34803,34804,34805,
+34806,34807,34808,U,34810,34811,34812,34813,34815,34816,34817,34818,34820,
+34821,34822,34823,34824,34825,34827,34828,34829,34830,34831,34832,34833,34834,
+34836,34839,34840,34841,34842,34844,34845,34846,34847,34848,34851,34852,34853,
+34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34867,
+34868,34869,34870,34871,34872,34874,34875,34877,34878,34879,34881,34882,34883,
+34886,34887,34888,34889,34890,34891,34894,34895,34896,34897,34898,34899,34901,
+34902,34904,34906,34907,34908,34909,34910,34911,34912,34918,34919,34922,34925,
+34927,34929,34931,34932,34933,34934,34936,34937,34938,U,34939,34940,34944,
+34947,34950,34951,34953,34954,34956,34958,34959,34960,34961,34963,34964,34965,
+34967,34968,34969,34970,34971,34973,34974,34975,34976,34977,34979,34981,34982,
+34983,34984,34985,34986,34988,34990,34991,34992,34994,34995,34996,34997,34998,
+35000,35001,35002,35003,35005,35006,35007,35008,35011,35012,35015,35016,35018,
+35019,35020,35021,35023,35024,35025,35027,35030,35031,35034,35035,35036,35037,
+35038,35040,35041,35046,35047,35049,35050,35051,35052,35053,35054,35055,35058,
+35061,35062,35063,35066,35067,35069,35071,35072,35073,35075,35076,35077,35078,
+35079,35080,U,35081,35083,35084,35085,35086,35087,35089,35092,35093,35094,
+35095,35096,35100,35101,35102,35103,35104,35106,35107,35108,35110,35111,35112,
+35113,35116,35117,35118,35119,35121,35122,35123,35125,35127,35128,35129,35130,
+35131,35132,35133,35134,35135,35136,35138,35139,35141,35142,35143,35144,35145,
+35146,35147,35148,35149,35150,35151,35152,35153,35154,35155,35156,35157,35158,
+35159,35160,35161,35162,35163,35164,35165,35168,35169,35170,35171,35172,35173,
+35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,35185,35186,35187,
+35188,35189,35190,35191,35192,35193,35194,35196,U,35197,35198,35200,35202,
+35204,35205,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,
+35218,35219,35220,35221,35222,35223,35224,35225,35226,35227,35228,35229,35230,
+35231,35232,35233,35234,35235,35236,35237,35238,35239,35240,35241,35242,35243,
+35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,
+35257,35258,35259,35260,35261,35262,35263,35264,35267,35277,35283,35284,35285,
+35287,35288,35289,35291,35293,35295,35296,35297,35298,35300,35303,35304,35305,
+35306,35308,35309,35310,35312,35313,35314,35316,35317,35318,35319,35320,35321,
+35322,U,35323,35324,35325,35326,35327,35329,35330,35331,35332,35333,35334,
+35336,35337,35338,35339,35340,35341,35342,35343,35344,35345,35346,35347,35348,
+35349,35350,35351,35352,35353,35354,35355,35356,35357,35358,35359,35360,35361,
+35362,35363,35364,35365,35366,35367,35368,35369,35370,35371,35372,35373,35374,
+35375,35376,35377,35378,35379,35380,35381,35382,35383,35384,35385,35386,35387,
+35388,35389,35391,35392,35393,35394,35395,35396,35397,35398,35399,35401,35402,
+35403,35404,35405,35406,35407,35408,35409,35410,35411,35412,35413,35414,35415,
+35416,35417,35418,35419,35420,35421,35422,U,35423,35424,35425,35426,35427,
+35428,35429,35430,35431,35432,35433,35434,35435,35436,35437,35438,35439,35440,
+35441,35442,35443,35444,35445,35446,35447,35448,35450,35451,35452,35453,35454,
+35455,35456,35457,35458,35459,35460,35461,35462,35463,35464,35467,35468,35469,
+35470,35471,35472,35473,35474,35476,35477,35478,35479,35480,35481,35482,35483,
+35484,35485,35486,35487,35488,35489,35490,35491,35492,35493,35494,35495,35496,
+35497,35498,35499,35500,35501,35502,35503,35504,35505,35506,35507,35508,35509,
+35510,35511,35512,35513,35514,35515,35516,35517,35518,35519,35520,35521,35522,
+U,35523,35524,35525,35526,35527,35528,35529,35530,35531,35532,35533,35534,
+35535,35536,35537,35538,35539,35540,35541,35542,35543,35544,35545,35546,35547,
+35548,35549,35550,35551,35552,35553,35554,35555,35556,35557,35558,35559,35560,
+35561,35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,
+35574,35575,35576,35577,35578,35579,35580,35581,35582,35583,35584,35585,35586,
+35587,35588,35589,35590,35592,35593,35594,35595,35596,35597,35598,35599,35600,
+35601,35602,35603,35604,35605,35606,35607,35608,35609,35610,35611,35612,35613,
+35614,35615,35616,35617,35618,35619,U,35620,35621,35623,35624,35625,35626,
+35627,35628,35629,35630,35631,35632,35633,35634,35635,35636,35637,35638,35639,
+35640,35641,35642,35643,35644,35645,35646,35647,35648,35649,35650,35651,35652,
+35653,35654,35655,35656,35657,35658,35659,35660,35661,35662,35663,35664,35665,
+35666,35667,35668,35669,35670,35671,35672,35673,35674,35675,35676,35677,35678,
+35679,35680,35681,35682,35683,35684,35685,35687,35688,35689,35690,35691,35693,
+35694,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,
+35707,35708,35709,35710,35711,35712,35713,35714,35715,35716,35717,35718,U,
+35719,35720,35721,35722,35723,35724,35725,35726,35727,35728,35729,35730,35731,
+35732,35733,35734,35735,35736,35737,35738,35739,35740,35741,35742,35743,35756,
+35761,35771,35783,35792,35818,35849,35870,35896,35897,35898,35899,35900,35901,
+35902,35903,35904,35906,35907,35908,35909,35912,35914,35915,35917,35918,35919,
+35920,35921,35922,35923,35924,35926,35927,35928,35929,35931,35932,35933,35934,
+35935,35936,35939,35940,35941,35942,35943,35944,35945,35948,35949,35950,35951,
+35952,35953,35954,35956,35957,35958,35959,35963,35964,35965,35966,35967,35968,
+35969,35971,35972,35974,35975,U,35976,35979,35981,35982,35983,35984,35985,
+35986,35987,35989,35990,35991,35993,35994,35995,35996,35997,35998,35999,36000,
+36001,36002,36003,36004,36005,36006,36007,36008,36009,36010,36011,36012,36013,
+36014,36015,36016,36017,36018,36019,36020,36021,36022,36023,36024,36025,36026,
+36027,36028,36029,36030,36031,36032,36033,36034,36035,36036,36037,36038,36039,
+36040,36041,36042,36043,36044,36045,36046,36047,36048,36049,36050,36051,36052,
+36053,36054,36055,36056,36057,36058,36059,36060,36061,36062,36063,36064,36065,
+36066,36067,36068,36069,36070,36071,36072,36073,36074,36075,36076,U,36077,
+36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,36090,
+36091,36092,36093,36094,36095,36096,36097,36098,36099,36100,36101,36102,36103,
+36104,36105,36106,36107,36108,36109,36110,36111,36112,36113,36114,36115,36116,
+36117,36118,36119,36120,36121,36122,36123,36124,36128,36177,36178,36183,36191,
+36197,36200,36201,36202,36204,36206,36207,36209,36210,36216,36217,36218,36219,
+36220,36221,36222,36223,36224,36226,36227,36230,36231,36232,36233,36236,36237,
+36238,36239,36240,36242,36243,36245,36246,36247,36248,36249,36250,36251,36252,
+36253,36254,36256,36257,U,36258,36260,36261,36262,36263,36264,36265,36266,
+36267,36268,36269,36270,36271,36272,36274,36278,36279,36281,36283,36285,36288,
+36289,36290,36293,36295,36296,36297,36298,36301,36304,36306,36307,36308,36309,
+36312,36313,36316,36320,36321,36322,36325,36326,36327,36329,36333,36334,36336,
+36337,36338,36340,36342,36348,36350,36351,36352,36353,36354,36355,36356,36358,
+36359,36360,36363,36365,36366,36368,36369,36370,36371,36373,36374,36375,36376,
+36377,36378,36379,36380,36384,36385,36388,36389,36390,36391,36392,36395,36397,
+36400,36402,36403,36404,36406,36407,36408,36411,36412,36414,U,36415,36419,
+36421,36422,36428,36429,36430,36431,36432,36435,36436,36437,36438,36439,36440,
+36442,36443,36444,36445,36446,36447,36448,36449,36450,36451,36452,36453,36455,
+36456,36458,36459,36462,36465,36467,36469,36471,36472,36473,36474,36475,36477,
+36478,36480,36482,36483,36484,36486,36488,36489,36490,36491,36492,36493,36494,
+36497,36498,36499,36501,36502,36503,36504,36505,36506,36507,36509,36511,36512,
+36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36525,36526,36528,
+36529,36531,36532,36533,36534,36535,36536,36537,36539,36540,36541,36542,36543,
+36544,36545,36546,U,36547,36548,36549,36550,36551,36552,36553,36554,36555,
+36556,36557,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,
+36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,36581,36582,
+36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,
+36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,
+36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,
+36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,
+36635,36636,36637,36638,36639,36640,36641,36642,36643,U,36644,36645,36646,
+36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,
+36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,
+36673,36674,36675,36676,36677,36678,36679,36680,36681,36682,36683,36684,36685,
+36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,
+36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36714,36736,
+36748,36754,36765,36768,36769,36770,36772,36773,36774,36775,36778,36780,36781,
+36782,36783,36786,36787,36788,36789,36791,36792,36794,36795,36796,36799,36800,
+36803,36806,U,36809,36810,36811,36812,36813,36815,36818,36822,36823,36826,
+36832,36833,36835,36839,36844,36847,36849,36850,36852,36853,36854,36858,36859,
+36860,36862,36863,36871,36872,36876,36878,36883,36885,36888,36889,36892,36899,
+36900,36901,36903,36904,36905,36906,36907,36908,36912,36913,36914,36915,36916,
+36919,36921,36922,36925,36927,36928,36931,36933,36934,36936,36937,36938,36939,
+36940,36942,36948,36949,36950,36953,36954,36956,36957,36958,36959,36960,36961,
+36964,36966,36967,36969,36970,36971,36972,36975,36976,36977,36978,36979,36982,
+36983,36984,36985,36986,36987,36988,36990,36993,U,36996,36997,36998,36999,
+37001,37002,37004,37005,37006,37007,37008,37010,37012,37014,37016,37018,37020,
+37022,37023,37024,37028,37029,37031,37032,37033,37035,37037,37042,37047,37052,
+37053,37055,37056,37058,37059,37062,37064,37065,37067,37068,37069,37074,37076,
+37077,37078,37080,37081,37082,37086,37087,37088,37091,37092,37093,37097,37098,
+37100,37102,37104,37105,37106,37107,37109,37110,37111,37113,37114,37115,37116,
+37119,37120,37121,37123,37125,37126,37127,37128,37129,37130,37131,37132,37133,
+37134,37135,37136,37137,37138,37139,37140,37141,37142,37143,37144,37146,37147,
+37148,U,37149,37151,37152,37153,37156,37157,37158,37159,37160,37161,37162,
+37163,37164,37165,37166,37168,37170,37171,37172,37173,37174,37175,37176,37178,
+37179,37180,37181,37182,37183,37184,37185,37186,37188,37189,37191,37192,37201,
+37203,37204,37205,37206,37208,37209,37211,37212,37215,37216,37222,37223,37224,
+37227,37229,37235,37242,37243,37244,37248,37249,37250,37251,37252,37254,37256,
+37258,37262,37263,37267,37268,37269,37270,37271,37272,37273,37276,37277,37278,
+37279,37280,37281,37284,37285,37286,37287,37288,37289,37291,37292,37296,37297,
+37298,37299,37302,37303,37304,37305,37307,U,37308,37309,37310,37311,37312,
+37313,37314,37315,37316,37317,37318,37320,37323,37328,37330,37331,37332,37333,
+37334,37335,37336,37337,37338,37339,37341,37342,37343,37344,37345,37346,37347,
+37348,37349,37350,37351,37352,37353,37354,37355,37356,37357,37358,37359,37360,
+37361,37362,37363,37364,37365,37366,37367,37368,37369,37370,37371,37372,37373,
+37374,37375,37376,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,
+37387,37388,37389,37390,37391,37392,37393,37394,37395,37396,37397,37398,37399,
+37400,37401,37402,37403,37404,37405,37406,37407,37408,37409,37410,37411,37412,
+U,37413,37414,37415,37416,37417,37418,37419,37420,37421,37422,37423,37424,
+37425,37426,37427,37428,37429,37430,37431,37432,37433,37434,37435,37436,37437,
+37438,37439,37440,37441,37442,37443,37444,37445,37446,37447,37448,37449,37450,
+37451,37452,37453,37454,37455,37456,37457,37458,37459,37460,37461,37462,37463,
+37464,37465,37466,37467,37468,37469,37470,37471,37472,37473,37474,37475,37476,
+37477,37478,37479,37480,37481,37482,37483,37484,37485,37486,37487,37488,37489,
+37490,37491,37493,37494,37495,37496,37497,37498,37499,37500,37501,37502,37503,
+37504,37505,37506,37507,37508,37509,U,37510,37511,37512,37513,37514,37515,
+37516,37517,37519,37520,37521,37522,37523,37524,37525,37526,37527,37528,37529,
+37530,37531,37532,37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,
+37543,37544,37545,37546,37547,37548,37549,37551,37552,37553,37554,37555,37556,
+37557,37558,37559,37560,37561,37562,37563,37564,37565,37566,37567,37568,37569,
+37570,37571,37572,37573,37574,37575,37577,37578,37579,37580,37581,37582,37583,
+37584,37585,37586,37587,37588,37589,37590,37591,37592,37593,37594,37595,37596,
+37597,37598,37599,37600,37601,37602,37603,37604,37605,37606,37607,37608,U,
+37609,37610,37611,37612,37613,37614,37615,37616,37617,37618,37619,37620,37621,
+37622,37623,37624,37625,37626,37627,37628,37629,37630,37631,37632,37633,37634,
+37635,37636,37637,37638,37639,37640,37641,37642,37643,37644,37645,37646,37647,
+37648,37649,37650,37651,37652,37653,37654,37655,37656,37657,37658,37659,37660,
+37661,37662,37663,37664,37665,37666,37667,37668,37669,37670,37671,37672,37673,
+37674,37675,37676,37677,37678,37679,37680,37681,37682,37683,37684,37685,37686,
+37687,37688,37689,37690,37691,37692,37693,37695,37696,37697,37698,37699,37700,
+37701,37702,37703,37704,37705,U,37706,37707,37708,37709,37710,37711,37712,
+37713,37714,37715,37716,37717,37718,37719,37720,37721,37722,37723,37724,37725,
+37726,37727,37728,37729,37730,37731,37732,37733,37734,37735,37736,37737,37739,
+37740,37741,37742,37743,37744,37745,37746,37747,37748,37749,37750,37751,37752,
+37753,37754,37755,37756,37757,37758,37759,37760,37761,37762,37763,37764,37765,
+37766,37767,37768,37769,37770,37771,37772,37773,37774,37776,37777,37778,37779,
+37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,
+37793,37794,37795,37796,37797,37798,37799,37800,37801,37802,37803,U,37804,
+37805,37806,37807,37808,37809,37810,37811,37812,37813,37814,37815,37816,37817,
+37818,37819,37820,37821,37822,37823,37824,37825,37826,37827,37828,37829,37830,
+37831,37832,37833,37835,37836,37837,37838,37839,37840,37841,37842,37843,37844,
+37845,37847,37848,37849,37850,37851,37852,37853,37854,37855,37856,37857,37858,
+37859,37860,37861,37862,37863,37864,37865,37866,37867,37868,37869,37870,37871,
+37872,37873,37874,37875,37876,37877,37878,37879,37880,37881,37882,37883,37884,
+37885,37886,37887,37888,37889,37890,37891,37892,37893,37894,37895,37896,37897,
+37898,37899,37900,37901,U,37902,37903,37904,37905,37906,37907,37908,37909,
+37910,37911,37912,37913,37914,37915,37916,37917,37918,37919,37920,37921,37922,
+37923,37924,37925,37926,37927,37928,37929,37930,37931,37932,37933,37934,37935,
+37936,37937,37938,37939,37940,37941,37942,37943,37944,37945,37946,37947,37948,
+37949,37951,37952,37953,37954,37955,37956,37957,37958,37959,37960,37961,37962,
+37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,
+37976,37977,37978,37979,37980,37981,37982,37983,37984,37985,37986,37987,37988,
+37989,37990,37991,37992,37993,37994,37996,37997,37998,37999,U,38000,38001,
+38002,38003,38004,38005,38006,38007,38008,38009,38010,38011,38012,38013,38014,
+38015,38016,38017,38018,38019,38020,38033,38038,38040,38087,38095,38099,38100,
+38106,38118,38139,38172,38176,38183,38195,38205,38211,38216,38219,38229,38234,
+38240,38254,38260,38261,38263,38264,38265,38266,38267,38268,38269,38270,38272,
+38273,38274,38275,38276,38277,38278,38279,38280,38281,38282,38283,38284,38285,
+38286,38287,38288,38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,
+38299,38300,38301,38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,
+38312,38313,38314,U,38315,38316,38317,38318,38319,38320,38321,38322,38323,
+38324,38325,38326,38327,38328,38329,38330,38331,38332,38333,38334,38335,38336,
+38337,38338,38339,38340,38341,38342,38343,38344,38345,38346,38347,38348,38349,
+38350,38351,38352,38353,38354,38355,38356,38357,38358,38359,38360,38361,38362,
+38363,38364,38365,38366,38367,38368,38369,38370,38371,38372,38373,38374,38375,
+38380,38399,38407,38419,38424,38427,38430,38432,38435,38436,38437,38438,38439,
+38440,38441,38443,38444,38445,38447,38448,38455,38456,38457,38458,38462,38465,
+38467,38474,38478,38479,38481,38482,38483,38486,38487,U,38488,38489,38490,
+38492,38493,38494,38496,38499,38501,38502,38507,38509,38510,38511,38512,38513,
+38515,38520,38521,38522,38523,38524,38525,38526,38527,38528,38529,38530,38531,
+38532,38535,38537,38538,38540,38542,38545,38546,38547,38549,38550,38554,38555,
+38557,38558,38559,38560,38561,38562,38563,38564,38565,38566,38568,38569,38570,
+38571,38572,38573,38574,38575,38577,38578,38580,38581,38583,38584,38586,38587,
+38591,38594,38595,38600,38602,38603,38608,38609,38611,38612,38614,38615,38616,
+38617,38618,38619,38620,38621,38622,38623,38625,38626,38627,38628,38629,38630,
+38631,38635,U,38636,38637,38638,38640,38641,38642,38644,38645,38648,38650,
+38651,38652,38653,38655,38658,38659,38661,38666,38667,38668,38672,38673,38674,
+38676,38677,38679,38680,38681,38682,38683,38685,38687,38688,38689,38690,38691,
+38692,38693,38694,38695,38696,38697,38699,38700,38702,38703,38705,38707,38708,
+38709,38710,38711,38714,38715,38716,38717,38719,38720,38721,38722,38723,38724,
+38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,
+38740,38741,38743,38744,38746,38748,38749,38751,38755,38756,38758,38759,38760,
+38762,38763,38764,38765,38766,38767,38768,38769,U,38770,38773,38775,38776,
+38777,38778,38779,38781,38782,38783,38784,38785,38786,38787,38788,38790,38791,
+38792,38793,38794,38796,38798,38799,38800,38803,38805,38806,38807,38809,38810,
+38811,38812,38813,38814,38815,38817,38818,38820,38821,38822,38823,38824,38825,
+38826,38828,38830,38832,38833,38835,38837,38838,38839,38840,38841,38842,38843,
+38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,
+38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,
+38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,
+38883,U,38884,38885,38888,38894,38895,38896,38897,38898,38900,38903,38904,
+38905,38906,38907,38908,38909,38910,38911,38912,38913,38914,38915,38916,38917,
+38918,38919,38920,38921,38922,38923,38924,38925,38926,38927,38928,38929,38930,
+38931,38932,38933,38934,38935,38936,38937,38938,38939,38940,38941,38942,38943,
+38944,38945,38946,38947,38948,38949,38950,38951,38952,38953,38954,38955,38956,
+38957,38958,38959,38960,38961,38962,38963,38964,38965,38966,38967,38968,38969,
+38970,38971,38972,38973,38974,38975,38976,38977,38978,38979,38980,38981,38982,
+38983,38984,38985,38986,38987,38988,38989,U,38990,38991,38992,38993,38994,
+38995,38996,38997,38998,38999,39000,39001,39002,39003,39004,39005,39006,39007,
+39008,39009,39010,39011,39012,39013,39014,39015,39016,39017,39018,39019,39020,
+39021,39022,39023,39024,39025,39026,39027,39028,39051,39054,39058,39061,39065,
+39075,39080,39081,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,
+39092,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,39103,39104,
+39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,39115,39116,39117,
+39119,39120,39124,39126,39127,39131,39132,39133,39136,39137,39138,39139,39140,
+U,39141,39142,39145,39146,39147,39148,39149,39150,39151,39152,39153,39154,
+39155,39156,39157,39158,39159,39160,39161,39162,39163,39164,39165,39166,39167,
+39168,39169,39170,39171,39172,39173,39174,39175,39176,39177,39178,39179,39180,
+39182,39183,39185,39186,39187,39188,39189,39190,39191,39192,39193,39194,39195,
+39196,39197,39198,39199,39200,39201,39202,39203,39204,39205,39206,39207,39208,
+39209,39210,39211,39212,39213,39215,39216,39217,39218,39219,39220,39221,39222,
+39223,39224,39225,39226,39227,39228,39229,39230,39231,39232,39233,39234,39235,
+39236,39237,39238,39239,39240,39241,U,39242,39243,39244,39245,39246,39247,
+39248,39249,39250,39251,39254,39255,39256,39257,39258,39259,39260,39261,39262,
+39263,39264,39265,39266,39268,39270,39283,39288,39289,39291,39294,39298,39299,
+39305,39308,39310,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,
+39332,39334,39335,39337,39338,39339,39340,39341,39342,39343,39344,39345,39346,
+39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,39358,39359,
+39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,39371,39372,
+39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,39384,U,
+39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,39397,
+39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,39410,
+39411,39412,39413,39414,39415,39416,39417,39418,39419,39420,39421,39422,39423,
+39424,39425,39426,39427,39428,39429,39430,39431,39432,39433,39434,39435,39436,
+39437,39438,39439,39440,39441,39442,39443,39444,39445,39446,39447,39448,39449,
+39450,39451,39452,39453,39454,39455,39456,39457,39458,39459,39460,39461,39462,
+39463,39464,39465,39466,39467,39468,39469,39470,39471,39472,39473,39474,39475,
+39476,39477,39478,39479,39480,U,39481,39482,39483,39484,39485,39486,39487,
+39488,39489,39490,39491,39492,39493,39494,39495,39496,39497,39498,39499,39500,
+39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,
+39514,39515,39516,39517,39518,39519,39520,39521,39522,39523,39524,39525,39526,
+39527,39528,39529,39530,39531,39538,39555,39561,39565,39566,39572,39573,39577,
+39590,39593,39594,39595,39596,39597,39598,39599,39602,39603,39604,39605,39609,
+39611,39613,39614,39615,39619,39620,39622,39623,39624,39625,39626,39629,39630,
+39631,39632,39634,39636,39637,39638,39639,39641,39642,39643,39644,U,39645,
+39646,39648,39650,39651,39652,39653,39655,39656,39657,39658,39660,39662,39664,
+39665,39666,39667,39668,39669,39670,39671,39672,39674,39676,39677,39678,39679,
+39680,39681,39682,39684,39685,39686,39687,39689,39690,39691,39692,39693,39694,
+39696,39697,39698,39700,39701,39702,39703,39704,39705,39706,39707,39708,39709,
+39710,39712,39713,39714,39716,39717,39718,39719,39720,39721,39722,39723,39724,
+39725,39726,39728,39729,39731,39732,39733,39734,39735,39736,39737,39738,39741,
+39742,39743,39744,39750,39754,39755,39756,39758,39760,39762,39763,39765,39766,
+39767,39768,39769,39770,U,39771,39772,39773,39774,39775,39776,39777,39778,
+39779,39780,39781,39782,39783,39784,39785,39786,39787,39788,39789,39790,39791,
+39792,39793,39794,39795,39796,39797,39798,39799,39800,39801,39802,39803,39804,
+39805,39806,39807,39808,39809,39810,39811,39812,39813,39814,39815,39816,39817,
+39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,39830,
+39831,39832,39833,39834,39835,39836,39837,39838,39839,39840,39841,39842,39843,
+39844,39845,39846,39847,39848,39849,39850,39851,39852,39853,39854,39855,39856,
+39857,39858,39859,39860,39861,39862,39863,39864,39865,39866,U,39867,39868,
+39869,39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,
+39882,39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,
+39895,39896,39897,39898,39899,39900,39901,39902,39903,39904,39905,39906,39907,
+39908,39909,39910,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,
+39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,
+39934,39935,39936,39937,39938,39939,39940,39941,39942,39943,39944,39945,39946,
+39947,39948,39949,39950,39951,39952,39953,39954,39955,39956,39957,39958,39959,
+39960,39961,39962,U,39963,39964,39965,39966,39967,39968,39969,39970,39971,
+39972,39973,39974,39975,39976,39977,39978,39979,39980,39981,39982,39983,39984,
+39985,39986,39987,39988,39989,39990,39991,39992,39993,39994,39995,39996,39997,
+39998,39999,40000,40001,40002,40003,40004,40005,40006,40007,40008,40009,40010,
+40011,40012,40013,40014,40015,40016,40017,40018,40019,40020,40021,40022,40023,
+40024,40025,40026,40027,40028,40029,40030,40031,40032,40033,40034,40035,40036,
+40037,40038,40039,40040,40041,40042,40043,40044,40045,40046,40047,40048,40049,
+40050,40051,40052,40053,40054,40055,40056,40057,40058,U,40059,40061,40062,
+40064,40067,40068,40073,40074,40076,40079,40083,40086,40087,40088,40089,40093,
+40106,40108,40111,40121,40126,40127,40128,40129,40130,40136,40137,40145,40146,
+40154,40155,40160,40161,40163,40164,40165,40166,40167,40168,40169,40170,40171,
+40172,40173,40174,40175,40176,40177,40178,40179,40180,40181,40182,40183,40184,
+40185,40186,40187,40188,40189,40190,40191,40192,40193,40194,40195,40196,40197,
+40198,40199,40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,
+40211,40212,40213,40214,40215,40216,40217,40218,40219,40220,40221,40222,40223,
+40224,40225,U,40226,40227,40228,40229,40230,40231,40232,40233,40234,40235,
+40236,40237,40238,40239,40240,40241,40242,40243,40244,40245,40246,40247,40248,
+40249,40250,40251,40252,40253,40254,40255,40256,40257,40258,40259,40260,40261,
+40262,40263,40264,40265,40266,40267,40268,40269,40270,40271,40272,40273,40274,
+40275,40276,40277,40278,40279,40280,40281,40282,40283,40284,40285,40286,40287,
+40288,40289,40290,40291,40292,40293,40294,40295,40296,40297,40298,40299,40300,
+40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,40311,40312,40313,
+40314,40315,40316,40317,40318,40319,40320,40321,U,40322,40323,40324,40325,
+40326,40327,40328,40329,40330,40331,40332,40333,40334,40335,40336,40337,40338,
+40339,40340,40341,40342,40343,40344,40345,40346,40347,40348,40349,40350,40351,
+40352,40353,40354,40355,40356,40357,40358,40359,40360,40361,40362,40363,40364,
+40365,40366,40367,40368,40369,40370,40371,40372,40373,40374,40375,40376,40377,
+40378,40379,40380,40381,40382,40383,40384,40385,40386,40387,40388,40389,40390,
+40391,40392,40393,40394,40395,40396,40397,40398,40399,40400,40401,40402,40403,
+40404,40405,40406,40407,40408,40409,40410,40411,40412,40413,40414,40415,40416,
+40417,U,40418,40419,40420,40421,40422,40423,40424,40425,40426,40427,40428,
+40429,40430,40431,40432,40433,40434,40435,40436,40437,40438,40439,40440,40441,
+40442,40443,40444,40445,40446,40447,40448,40449,40450,40451,40452,40453,40454,
+40455,40456,40457,40458,40459,40460,40461,40462,40463,40464,40465,40466,40467,
+40468,40469,40470,40471,40472,40473,40474,40475,40476,40477,40478,40484,40487,
+40494,40496,40500,40507,40508,40512,40525,40528,40530,40531,40532,40534,40537,
+40541,40543,40544,40545,40546,40549,40558,40559,40562,40564,40565,40566,40567,
+40568,40569,40570,40571,40572,40573,40576,U,40577,40579,40580,40581,40582,
+40585,40586,40588,40589,40590,40591,40592,40593,40596,40597,40598,40599,40600,
+40601,40602,40603,40604,40606,40608,40609,40610,40611,40612,40613,40615,40616,
+40617,40618,40619,40620,40621,40622,40623,40624,40625,40626,40627,40629,40630,
+40631,40633,40634,40636,40639,40640,40641,40642,40643,40645,40646,40647,40648,
+40650,40651,40652,40656,40658,40659,40661,40662,40663,40665,40666,40670,40673,
+40675,40676,40678,40680,40683,40684,40685,40686,40688,40689,40690,40691,40692,
+40693,40694,40695,40696,40698,40701,40703,40704,40705,40706,40707,40708,40709,
+U,40710,40711,40712,40713,40714,40716,40719,40721,40722,40724,40725,40726,
+40728,40730,40731,40732,40733,40734,40735,40737,40739,40740,40741,40742,40743,
+40744,40745,40746,40747,40749,40750,40752,40753,40754,40755,40756,40757,40758,
+40760,40762,40764,40767,40768,40769,40770,40771,40773,40774,40775,40776,40777,
+40778,40779,40780,40781,40782,40783,40786,40787,40788,40789,40790,40791,40792,
+40793,40794,40795,40796,40797,40798,40799,40800,40801,40802,40803,40804,40805,
+40806,40807,40808,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,
+40819,40820,40821,40822,40823,40824,U,40825,40826,40827,40828,40829,40830,
+40833,40834,40845,40846,40847,40848,40849,40850,40851,40852,40853,40854,40855,
+40856,40860,40861,40862,40865,40866,40867,40868,40869,63788,63865,63893,63975,
+63985,64012,64013,64014,64015,64017,64019,64020,64024,64031,64032,64033,64035,
+64036,64039,64040,64041,
+};
+
+static const struct dbcs_index gbkext_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{__gbkext_decmap+0,64,254},{__gbkext_decmap+191,64,
+254},{__gbkext_decmap+382,64,254},{__gbkext_decmap+573,64,254},{
+__gbkext_decmap+764,64,254},{__gbkext_decmap+955,64,254},{__gbkext_decmap+1146
+,64,254},{__gbkext_decmap+1337,64,254},{__gbkext_decmap+1528,64,254},{
+__gbkext_decmap+1719,64,254},{__gbkext_decmap+1910,64,254},{__gbkext_decmap+
+2101,64,254},{__gbkext_decmap+2292,64,254},{__gbkext_decmap+2483,64,254},{
+__gbkext_decmap+2674,64,254},{__gbkext_decmap+2865,64,254},{__gbkext_decmap+
+3056,64,254},{__gbkext_decmap+3247,64,254},{__gbkext_decmap+3438,64,254},{
+__gbkext_decmap+3629,64,254},{__gbkext_decmap+3820,64,254},{__gbkext_decmap+
+4011,64,254},{__gbkext_decmap+4202,64,254},{__gbkext_decmap+4393,64,254},{
+__gbkext_decmap+4584,64,254},{__gbkext_decmap+4775,64,254},{__gbkext_decmap+
+4966,64,254},{__gbkext_decmap+5157,64,254},{__gbkext_decmap+5348,64,254},{
+__gbkext_decmap+5539,64,254},{__gbkext_decmap+5730,64,254},{__gbkext_decmap+
+5921,64,254},{__gbkext_decmap+6112,164,170},{__gbkext_decmap+6119,161,170},{0,
+0,0},{0,0,0},{0,0,0},{__gbkext_decmap+6129,224,245},{0,0,0},{__gbkext_decmap+
+6151,64,192},{__gbkext_decmap+6280,64,150},{__gbkext_decmap+6367,64,160},{
+__gbkext_decmap+6464,64,160},{__gbkext_decmap+6561,64,160},{__gbkext_decmap+
+6658,64,160},{__gbkext_decmap+6755,64,160},{__gbkext_decmap+6852,64,160},{
+__gbkext_decmap+6949,64,160},{__gbkext_decmap+7046,64,160},{__gbkext_decmap+
+7143,64,160},{__gbkext_decmap+7240,64,160},{__gbkext_decmap+7337,64,160},{
+__gbkext_decmap+7434,64,160},{__gbkext_decmap+7531,64,160},{__gbkext_decmap+
+7628,64,160},{__gbkext_decmap+7725,64,160},{__gbkext_decmap+7822,64,160},{
+__gbkext_decmap+7919,64,160},{__gbkext_decmap+8016,64,160},{__gbkext_decmap+
+8113,64,160},{__gbkext_decmap+8210,64,160},{__gbkext_decmap+8307,64,160},{
+__gbkext_decmap+8404,64,160},{__gbkext_decmap+8501,64,160},{__gbkext_decmap+
+8598,64,160},{__gbkext_decmap+8695,64,160},{__gbkext_decmap+8792,64,160},{
+__gbkext_decmap+8889,64,160},{__gbkext_decmap+8986,64,160},{__gbkext_decmap+
+9083,64,160},{__gbkext_decmap+9180,64,160},{__gbkext_decmap+9277,64,160},{
+__gbkext_decmap+9374,64,160},{__gbkext_decmap+9471,64,160},{__gbkext_decmap+
+9568,64,160},{__gbkext_decmap+9665,64,160},{__gbkext_decmap+9762,64,160},{
+__gbkext_decmap+9859,64,160},{__gbkext_decmap+9956,64,160},{__gbkext_decmap+
+10053,64,160},{__gbkext_decmap+10150,64,160},{__gbkext_decmap+10247,64,160},{
+__gbkext_decmap+10344,64,160},{__gbkext_decmap+10441,64,160},{__gbkext_decmap+
+10538,64,160},{__gbkext_decmap+10635,64,160},{__gbkext_decmap+10732,64,160},{
+__gbkext_decmap+10829,64,160},{__gbkext_decmap+10926,64,160},{__gbkext_decmap+
+11023,64,160},{__gbkext_decmap+11120,64,160},{__gbkext_decmap+11217,64,160},{
+__gbkext_decmap+11314,64,160},{__gbkext_decmap+11411,64,160},{__gbkext_decmap+
+11508,64,160},{__gbkext_decmap+11605,64,160},{__gbkext_decmap+11702,64,160},{
+__gbkext_decmap+11799,64,160},{__gbkext_decmap+11896,64,160},{__gbkext_decmap+
+11993,64,160},{__gbkext_decmap+12090,64,160},{__gbkext_decmap+12187,64,160},{
+__gbkext_decmap+12284,64,160},{__gbkext_decmap+12381,64,160},{__gbkext_decmap+
+12478,64,160},{__gbkext_decmap+12575,64,160},{__gbkext_decmap+12672,64,160},{
+__gbkext_decmap+12769,64,160},{__gbkext_decmap+12866,64,160},{__gbkext_decmap+
+12963,64,160},{__gbkext_decmap+13060,64,160},{__gbkext_decmap+13157,64,160},{
+__gbkext_decmap+13254,64,160},{__gbkext_decmap+13351,64,160},{__gbkext_decmap+
+13448,64,160},{__gbkext_decmap+13545,64,160},{__gbkext_decmap+13642,64,160},{
+__gbkext_decmap+13739,64,160},{__gbkext_decmap+13836,64,160},{__gbkext_decmap+
+13933,64,160},{__gbkext_decmap+14030,64,160},{__gbkext_decmap+14127,64,160},{
+__gbkext_decmap+14224,64,160},{__gbkext_decmap+14321,64,160},{__gbkext_decmap+
+14418,64,160},{__gbkext_decmap+14515,64,79},{0,0,0},
+};
+
+static const DBCHAR __gbcommon_encmap[23231] = {
+8552,N,N,8556,8487,N,N,N,N,N,N,N,8547,8512,N,N,N,N,N,41380,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8513,N,N,N,N,N,N,N,N,10276,10274,
+N,N,N,N,N,N,10280,10278,10298,N,10284,10282,N,N,N,N,10288,10286,N,N,N,8514,N,
+10292,10290,N,10297,10273,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10277,N,N,N,N,N,N,
+N,10279,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10281,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,43197,N,N,N,43198,N,N,N,N,10285,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,10289,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10275,
+N,10283,N,10287,N,10291,N,10293,N,10294,N,10295,N,10296,43195,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,43200,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8486,N,8485,
+43072,43073,N,N,N,N,N,N,N,N,N,N,N,N,N,43074,9761,9762,9763,9764,9765,9766,
+9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,N,9778,9779,9780,9781,
+9782,9783,9784,N,N,N,N,N,N,N,9793,9794,9795,9796,9797,9798,9799,9800,9801,
+9802,9803,9804,9805,9806,9807,9808,9809,N,9810,9811,9812,9813,9814,9815,9816,
+10023,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10017,10018,10019,10020,10021,10022,10024,
+10025,10026,10027,10028,10029,10030,10031,10032,10033,10034,10035,10036,10037,
+10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10048,10049,10065,
+10066,10067,10068,10069,10070,10072,10073,10074,10075,10076,10077,10078,10079,
+10080,10081,10082,10083,10084,10085,10086,10087,10088,10089,10090,10091,10092,
+10093,10094,10095,10096,10097,N,10071,43356,N,N,43075,41386,8490,8492,N,8494,
+8495,N,N,8496,8497,N,N,N,N,N,N,N,43077,8493,N,N,N,N,N,N,N,N,N,8555,N,8548,
+8549,N,43078,N,N,N,N,N,8569,8550,N,43079,N,N,N,43080,N,N,N,N,N,N,N,N,N,N,N,N,
+8557,N,N,N,N,N,N,N,N,N,N,43353,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,N,N,N,N,41633,
+41634,41635,41636,41637,41638,41639,41640,41641,41642,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,8571,8572,8570,8573,N,N,43081,43082,43083,43084,8522,N,N,
+N,N,N,N,8519,N,8518,N,N,N,43085,N,N,N,N,8524,N,N,8536,8542,43086,8527,N,N,
+43087,N,8526,N,8516,8517,8521,8520,8530,N,N,8531,N,N,N,N,N,8544,8543,8515,
+8523,N,N,N,N,N,8535,N,N,N,N,N,N,N,N,N,N,8534,N,N,N,8533,N,N,N,N,N,43088,N,N,N,
+N,N,N,N,N,N,N,N,N,N,8537,8532,N,N,8540,8541,43089,43090,N,N,N,N,N,N,8538,8539,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43154,N,N,N,8529,N,N,N,N,N,N,N,N,N,N,N,8525,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,43091,8528,8793,8794,8795,8796,8797,8798,8799,8800,8801,8802,
+N,N,N,N,N,N,N,N,N,N,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,
+8784,8785,8786,8787,8788,8789,8790,8791,8792,8753,8754,8755,8756,8757,8758,
+8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,10532,
+10533,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543,10544,10545,
+10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557,10558,
+10559,10560,10561,10562,10563,10564,10565,10566,10567,10568,10569,10570,10571,
+10572,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,10583,10584,
+10585,10586,10587,10588,10589,10590,10591,10592,10593,10594,10595,10596,10597,
+10598,10599,10600,10601,10602,10603,10604,10605,10606,10607,N,N,N,N,43092,
+43093,43094,43095,43096,43097,43098,43099,43100,43101,43102,43103,43104,43105,
+43106,43107,43108,43109,43110,43111,43112,43113,43114,43115,43116,43117,43118,
+43119,43120,43121,43122,43123,43124,43125,43126,43127,N,N,N,N,N,N,N,N,N,N,N,N,
+N,43128,43129,43130,43131,43132,43133,43134,43136,43137,43138,43139,43140,
+43141,43142,43143,N,N,N,43144,43145,43146,N,N,N,N,N,N,N,N,N,N,8566,8565,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,8568,8567,N,N,N,N,N,N,N,N,43147,43148,N,N,N,N,N,N,N,
+N,8564,8563,N,N,N,8560,N,N,8562,8561,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43149,43150,43151,43152,8559,8558,N,N,43153,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+8546,N,8545,8481,8482,8483,8488,N,8489,43365,43414,8500,8501,8502,8503,8504,
+8505,8506,8507,8510,8511,43155,8574,8498,8499,8508,8509,N,N,N,N,N,43156,43157,
+N,N,43328,43329,43330,43331,43332,43333,43334,43335,43336,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,9249,9250,9251,9252,9253,9254,9255,9256,9257,9258,
+9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,
+9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,
+9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,
+9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,
+9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,N,N,N,N,N,N,
+N,43361,43362,43366,43367,N,N,9505,9506,9507,9508,9509,9510,9511,9512,9513,
+9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,
+9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,
+9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,
+9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,
+9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,
+9589,9590,N,N,N,N,8484,43360,43363,43364,10309,10310,10311,10312,10313,10314,
+10315,10316,10317,10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,
+10328,10329,10330,10331,10332,10333,10334,10335,10336,10337,10338,10339,10340,
+10341,10342,10343,10344,10345,8805,8806,8807,8808,8809,8810,8811,8812,8813,
+8814,N,N,N,N,N,N,N,43354,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,43337,43338,43339,N,N,N,N,N,N,N,N,N,N,N,N,43340,43341,43342,
+N,N,43343,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43344,N,N,N,N,N,N,N,N,N,43345,N,N,43346,43347,N,N,43348,21051,13857,33088,
+18015,33089,33090,33091,19826,21833,18557,18767,20290,22562,12859,21355,33092,
+22564,13171,33093,22312,18258,22567,19008,33094,18288,12667,21045,13396,13867,
+19263,22569,33095,33096,33097,13866,33098,16701,20815,33099,18725,22573,33100,
+14454,20798,25436,22096,33101,33102,14177,33103,13358,33104,16729,33105,22588,
+33106,19816,13604,20010,22135,33107,16502,15961,22575,33108,33109,33110,17483,
+33111,15939,33112,22577,17204,21093,33113,22062,20058,21799,14965,14118,16470,
+33114,17977,17746,18247,33115,14676,33116,13131,21074,33117,33118,22591,15941,
+18034,21042,20272,20327,33119,33120,33121,33122,19049,33123,33124,22592,33125,
+33126,33127,33128,33129,33130,17010,16978,33131,18537,33132,33133,33134,33135,
+33136,33137,33138,33139,33140,33141,18220,33142,33143,33144,33145,33146,33147,
+33148,16715,33149,21352,21881,33150,19010,13950,22561,21338,16247,33152,21574,
+15141,22593,20069,15918,33153,33154,22568,33155,20807,20521,33156,33157,33158,
+22589,22895,19830,16186,33159,15675,14885,21088,12922,14944,17462,33160,20333,
+15913,19748,16705,33161,33162,33163,18263,22897,33164,22900,33165,33166,33167,
+33168,18507,22633,33169,33170,33171,21082,18994,18506,22636,22634,22598,15734,
+17997,13168,33172,22635,15729,15721,33173,18516,13395,33174,33175,16984,33176,
+12886,22352,19019,19323,21836,14390,20297,33177,33178,33179,22874,22640,18218,
+33180,22638,33181,13434,16750,21076,33182,33183,22637,33184,21063,22639,17223,
+33185,33186,33187,20854,33188,22105,22642,33189,22645,15486,15451,33190,33191,
+33192,18510,33193,14173,33194,14146,33195,18035,33196,33197,33198,33199,33200,
+33201,33202,22648,21057,33203,33204,20073,15423,14204,14117,20573,33205,33206,
+33207,33208,33209,22106,21317,15215,15201,22641,33210,33211,18721,20016,13355,
+33212,22643,33213,18763,22646,16983,22647,33214,33215,20017,22649,33216,33217,
+33218,12846,14656,33219,22819,33220,12393,33221,16742,33222,18796,33223,19269,
+33224,19270,22820,33225,33226,33227,33228,33229,13672,33230,33231,13611,33232,
+33233,33234,33235,33236,33237,20027,13645,22305,22388,21331,33238,19557,33239,
+14926,33240,22818,22876,21344,22653,14192,22391,22654,22650,22817,17507,33241,
+33242,21302,22644,22877,33243,22651,33244,17765,33245,33246,16464,33247,33248,
+20848,12379,33249,33250,15441,22822,33251,22821,33252,33253,33254,33255,22828,
+22830,33256,22827,19001,33257,33258,33259,22825,22070,33260,33261,33262,13150,
+22824,33263,16509,33264,19020,33265,22826,33266,22823,33267,33268,22832,33269,
+33270,13873,33271,33272,33273,14633,33274,21056,33275,33276,20288,33277,33278,
+16962,33344,15684,21868,12896,18248,16235,22829,33345,22831,33346,20074,14958,
+33347,33348,33349,33350,33351,18262,33352,33353,33354,33355,33356,33357,33358,
+33359,33360,12643,33361,33362,33363,13401,13933,22836,33364,33365,33366,33367,
+16161,33368,33369,33370,22878,18254,16510,22840,33371,33372,33373,33374,33375,
+19287,14205,33376,22837,33377,22839,12579,21345,22841,33378,20549,33379,22838,
+33380,33381,22833,33382,22834,16681,22835,33383,33384,15475,20574,14377,33385,
+15971,33386,22845,33387,33388,33389,33390,22842,33391,12339,33392,33393,33394,
+22850,33395,33396,33397,33398,33399,33400,33401,33402,33403,33404,33405,33406,
+33408,22852,12598,33409,22847,33410,33411,13625,33412,15987,33413,33414,33415,
+19528,14962,21072,33416,22851,33417,33418,15720,33419,13099,33420,33421,33422,
+22853,15979,33423,22854,22843,17503,33424,22846,22849,22848,33425,33426,33427,
+33428,33429,33430,33431,33432,33433,33434,33435,21806,33436,22069,33437,18275,
+33438,33439,33440,33441,22856,33442,33443,33444,15449,22858,33445,33446,33447,
+22844,33448,22859,17963,33449,33450,33451,33452,33453,22857,33454,33455,33456,
+33457,22390,33458,19747,33459,33460,33461,33462,33463,33464,33465,33466,15649,
+33467,33468,33469,33470,33471,33472,22860,33473,33474,33475,33476,33477,33478,
+33479,33480,33481,17724,19765,33482,33483,33484,22861,33485,33486,22855,13093,
+16254,33487,33488,33489,33490,14389,33491,33492,16508,33493,33494,33495,33496,
+12408,33497,33498,33499,33500,33501,33502,33503,33504,33505,33506,33507,33508,
+33509,33510,33511,33512,33513,33514,33515,33516,33517,13430,33518,22862,33519,
+22863,13346,22864,33520,33521,13407,33522,33523,33524,33525,33526,12353,33527,
+33528,33529,33530,33531,33532,33533,22865,18741,33534,33600,33601,33602,33603,
+33604,33605,33606,33607,33608,33609,33610,33611,33612,33613,33614,33615,33616,
+33617,20337,33618,33619,33620,33621,33622,33623,22866,33624,33625,33626,16709,
+33627,33628,33629,33630,33631,33632,33633,33634,33635,33636,33637,22870,18734,
+33638,33639,33640,33641,22869,22868,22871,33642,33643,33644,33645,19291,33646,
+15657,33647,33648,33649,33650,33651,17959,33652,33653,33654,33655,33656,33657,
+33658,33659,33660,33661,22867,22872,33662,33664,33665,22873,33666,33667,33668,
+33669,33670,33671,18533,33672,33673,33674,33675,33676,33677,33678,33679,33680,
+33681,33682,33683,33684,33685,16476,33686,33687,33688,33689,33690,33691,33692,
+33693,33694,33695,33696,33697,33698,33699,33700,33701,33702,33703,33704,33705,
+33706,33707,33708,33709,33710,33711,33712,33713,33714,13945,22563,21578,33715,
+21546,20566,13156,21847,33716,20296,14690,33717,16203,33718,17250,33719,33720,
+33721,13906,33722,33723,19779,22894,22896,33724,33725,33726,13619,33727,13877,
+33728,33729,33730,33731,33732,15908,33733,33734,18539,33735,33736,18475,33737,
+33738,12363,14635,16761,22882,33739,16444,14642,33740,14680,20555,12664,18020,
+15967,13668,22344,33741,20856,15462,19038,33742,33743,15421,22886,22631,33744,
+33745,17498,33746,33747,14420,18493,33748,33749,12897,21593,33750,33751,33752,
+33753,17200,33754,33755,17249,23074,18527,33756,20532,33757,15996,17705,33758,
+33759,33760,14682,33761,23075,33762,21545,23076,33763,33764,33765,33766,33767,
+22907,13868,33768,33769,14187,12665,22908,13157,15990,33770,16246,21041,16484,
+33771,33772,33773,13875,22910,22909,33774,33775,15931,33776,33777,33778,18016,
+33779,22332,23073,33780,16697,33781,13682,16744,33782,33783,15477,33784,13397,
+33785,33786,33787,33788,33789,33790,33856,33857,33858,16733,33859,17533,33860,
+33861,15416,14130,33862,33863,14191,33864,33865,33866,33867,33868,33869,22892,
+33870,17982,33871,16173,15179,33872,33873,13642,33874,23369,20567,33875,19769,
+12348,13174,15223,23370,14895,33876,21604,13622,13683,22614,18512,33877,33878,
+14166,18256,22615,33879,16175,33880,33881,23355,22616,33882,33883,20556,15150,
+33884,33885,33886,27454,16720,16757,21618,14421,13364,33887,13173,33888,33889,
+18750,33890,33891,33892,17744,33893,33894,33895,17753,16507,33896,12656,33897,
+22617,14670,33898,13629,33899,33900,22618,33901,33902,22086,19234,18479,18738,
+13388,16204,33903,14708,33904,22619,22620,13927,15425,19562,33905,33906,33907,
+33908,33909,33910,20343,33911,22621,18224,33912,33913,14672,15651,33914,33915,
+19550,33916,17994,33917,33918,33920,33921,33922,22624,33923,22622,33924,33925,
+22623,33926,33927,33928,12414,33929,15975,33930,18979,15476,33931,33932,33933,
+33934,14385,33935,33936,14446,33937,33938,33939,33940,33941,33942,33943,33944,
+33945,33946,22626,33947,15691,33948,22628,22627,33949,33950,33951,33952,33953,
+17788,33954,33955,33956,33957,33958,33959,33960,22629,33961,33962,22630,33963,
+33964,33965,33966,33967,33968,33969,16678,33970,18480,12396,14630,15443,20081,
+23357,16723,33971,33972,33973,33974,13871,22138,17708,15705,23358,23359,33975,
+33976,33977,16504,15906,16461,33978,33979,33980,33981,33982,33983,33984,33985,
+33986,33987,23360,19014,33988,33989,33990,12842,33991,33992,33993,21314,33994,
+17251,33995,20779,33996,33997,33998,33999,23362,34000,16469,34001,34002,34003,
+23363,34004,16177,34005,34006,34007,34008,34009,34010,17468,34011,34012,34013,
+34014,18266,34015,34016,34017,34018,34019,34020,34021,34022,34023,34024,34025,
+23364,34026,34027,34028,34029,34030,34031,34032,34033,22888,18775,34034,34035,
+34036,14644,20080,21576,34037,34038,34039,34040,12412,13394,34041,20569,34042,
+34043,34044,34045,22889,34046,24139,22891,34112,34113,34114,34115,22576,15151,
+12593,34116,13143,22606,34117,34118,21585,34119,34120,15667,16239,34121,20283,
+34122,34123,22608,34124,34125,34126,14155,34127,34128,34129,22609,34130,34131,
+34132,34133,34134,34135,34136,34137,34138,34139,17957,18296,21053,34140,34141,
+22610,17508,34142,18990,34143,18215,34144,22566,34145,18813,20071,15196,12395,
+34146,34147,34148,15146,20525,34149,12592,22372,22335,34150,13605,17012,17487,
+34151,34152,12841,34153,12855,34154,12645,24370,21820,16168,16940,22613,16945,
+34155,22612,20052,34156,23136,34157,20032,34158,34159,22580,17198,21281,20003,
+34160,15412,18484,16977,34161,15981,20534,34162,23137,34163,34164,34165,34166,
+18276,34167,34168,13095,34169,13938,19580,16506,34170,34171,16503,34172,20793,
+20833,22599,34173,34174,34176,34177,34178,34179,34180,12894,34181,34182,16485,
+34183,14961,34184,34185,22600,34186,21549,34187,34188,20321,22601,34189,22602,
+20291,34190,13176,15943,34191,34192,34193,34194,22603,34195,34196,34197,34198,
+34199,34200,34201,23372,34202,34203,34204,34205,18469,34206,34207,34208,20312,
+34209,18558,12878,34210,34211,34212,34213,34214,21334,12902,15408,21329,19243,
+14132,34215,34216,34217,14114,34218,34219,19045,34220,18465,19036,12644,20592,
+34221,17745,34222,34223,34224,23365,13694,34225,34226,16218,14661,15972,16749,
+34227,24374,24373,22075,15696,21849,12360,13859,16201,19496,24371,18999,21330,
+34228,22607,21046,14917,19262,19518,34229,24375,13680,24372,34230,34231,34232,
+21365,34233,13140,14455,34234,24378,34235,14927,15402,13685,34236,19756,17275,
+14963,16500,19778,20338,24376,20293,34237,16960,24377,17008,34238,34239,34240,
+15997,34241,16735,19788,21111,14157,24385,34242,24388,34243,34244,14193,12361,
+13910,14164,34245,14892,19581,16212,19249,18036,34246,22056,24389,34247,20066,
+13107,34248,34249,20092,13365,34250,20039,14960,34251,20065,34252,20797,34253,
+34254,24384,34255,34256,13428,34257,13130,34258,14438,24379,34259,34260,34261,
+34262,17477,34263,24380,24381,24382,17723,24383,24386,21553,24387,34264,18234,
+20056,34265,34266,34267,34268,34269,17496,34270,24394,34271,24399,34272,22108,
+34273,34274,34275,34276,34277,34278,34279,34280,24393,24410,20022,34281,14919,
+24398,24392,17758,34282,34283,18795,14964,17276,34284,34285,15959,34286,24390,
+34287,24397,34288,17752,34289,34290,34291,34292,21798,14925,34293,15948,21309,
+14400,34294,22116,34295,24391,14654,16167,34296,34297,16764,24395,24396,34298,
+24400,34299,34300,34301,34302,34368,24411,24421,34369,24407,24406,22345,24419,
+24420,25963,21031,24402,34370,16169,34371,21595,34372,16200,24404,34373,34374,
+34375,20300,34376,34377,24413,34378,20810,34379,24414,12327,17975,24403,34380,
+14949,34381,13919,19803,14718,21589,34382,34383,24415,20332,12325,24423,24401,
+20806,24405,24408,24409,24412,34384,15145,34385,24416,24417,34386,24418,24422,
+24424,21300,34387,34388,34389,34390,34391,14439,17718,24426,18778,16680,17476,
+34392,34393,16222,20344,34394,34395,34396,21852,24430,34397,34398,34399,34400,
+34401,34402,12856,34403,14943,24428,34404,23361,34405,20836,34406,34407,34408,
+34409,19316,13373,34410,12326,34411,34412,34413,34414,34415,24433,19526,24434,
+34416,34417,24429,34418,34419,34420,34421,34422,34423,24425,34424,34425,34426,
+34427,24427,34428,24431,24432,15165,34429,34430,24435,34432,34433,24436,34434,
+15139,34435,19035,20008,24615,13098,34436,24614,34437,34438,34439,24609,34440,
+34441,34442,34443,24446,34444,19801,24444,34445,24442,34446,16208,22340,34447,
+18764,34448,34449,24440,12321,34450,34451,34452,34453,34454,24445,34455,34456,
+34457,34458,24443,24610,34459,34460,34461,34462,34463,24616,34464,34465,34466,
+34467,14152,34468,34469,17953,18742,16434,24437,34470,34471,17726,34472,22596,
+24441,17526,34473,34474,34475,34476,34477,34478,24611,24612,24613,20517,34479,
+34480,24628,19556,34481,24625,34482,16166,24623,20025,24619,18758,34483,34484,
+16430,24622,14957,14896,24617,34485,34486,34487,24438,34488,24627,34489,34490,
+24632,34491,34492,34493,13357,24633,34494,34495,20274,14920,34496,24624,34497,
+34498,34499,34500,34501,34502,34503,20602,34504,34505,34506,34507,34508,34509,
+34510,34511,34512,24620,34513,21627,34514,24439,34515,17767,34516,24621,34517,
+21367,34518,24630,24631,34519,34520,34521,34522,34523,24644,20577,34524,34525,
+34526,24636,34527,34528,24649,24650,34529,34530,34531,24638,24618,18724,24641,
+34532,24626,34533,34534,34535,34536,34537,19016,24643,34538,24629,34539,20043,
+34540,19267,24653,24646,24642,34541,24651,34542,24634,24639,24640,34543,34544,
+24645,34545,34546,24647,24648,34547,24652,34548,24635,34549,34550,34551,34552,
+34553,19284,24661,34554,24662,24658,34555,34556,34557,34558,34624,34625,24656,
+15438,34626,34627,24657,34628,14402,22597,34629,34630,34631,34632,34633,34634,
+34635,34636,20586,34637,34638,17007,34639,34640,24655,24637,34641,34642,34643,
+24660,24659,34644,34645,24663,34646,34647,34648,34649,24668,24664,34650,34651,
+34652,22134,13104,34653,22380,34654,19259,34655,34656,24666,34657,20091,34658,
+34659,34660,14937,34661,34662,34663,34664,34665,34666,34667,34668,34669,34670,
+34671,34672,24673,24669,21037,34673,34674,34675,34676,34677,24674,34678,34679,
+24667,24665,24671,34680,34681,24672,34682,34683,34684,34685,34686,24670,34688,
+24676,34689,34690,34691,18039,22572,21611,24678,19017,34692,34693,34694,34695,
+24677,34696,34697,34698,34699,14401,34700,34701,34702,34703,24679,24680,34704,
+34705,34706,34707,34708,34709,34710,34711,24681,24675,34712,34713,34714,34715,
+34716,34717,34718,14911,19559,34719,34720,34721,24682,34722,34723,34724,34725,
+34726,34727,34728,34729,34730,34731,34732,34733,34734,34735,34736,20345,34737,
+34738,34739,34740,34741,34742,34743,34744,34745,34746,34747,24683,34748,34749,
+34750,34751,34752,34753,34754,18498,34755,34756,34757,34758,15680,34759,34760,
+34761,34762,34763,34764,34765,34766,34767,34768,34769,34770,34771,17490,34772,
+34773,34774,34775,34776,34777,34778,34779,34780,24684,34781,34782,24685,34783,
+34784,18292,19268,34785,24686,15192,22582,21106,24687,19781,34786,13914,34787,
+34788,34789,34790,34791,34792,24689,34793,21552,34794,34795,16423,13393,34796,
+34797,20007,24688,34798,34799,34800,24690,14668,34801,34802,14714,19772,24691,
+34803,34804,34805,18004,24692,34806,21554,34807,18470,24694,24693,34808,34809,
+34810,34811,34812,34813,34814,34880,34881,34882,34883,34884,34885,34886,34887,
+34888,34889,24695,34890,34891,19777,34892,34893,34894,18981,34895,34896,34897,
+34898,21594,23383,23385,34899,23384,14695,23388,23389,13656,34900,34901,23386,
+34902,34903,34904,34905,34906,23387,13089,23391,34907,34908,15224,34909,22071,
+34910,23392,34911,34912,34913,34914,15993,34915,34916,14139,34917,23376,19502,
+16178,15157,22392,16211,34918,34919,34920,34921,34922,16233,34923,34924,15457,
+19507,23390,12371,20075,14168,22329,17986,34925,34926,16420,34927,19513,34928,
+23399,23393,17978,23395,34929,23400,34930,17783,34931,34932,34933,23402,34934,
+34935,23401,16192,34936,34937,34938,23398,23397,34939,34940,34941,34942,34944,
+13369,16428,16930,23394,23396,34945,34946,34947,34948,20557,23405,34949,34950,
+34951,34952,34953,16477,23410,34954,34955,34956,34957,34958,34959,34960,13922,
+34961,34962,34963,34964,23411,23378,14648,21547,23404,34965,16209,23408,34966,
+23377,34967,13670,34968,23403,16229,34969,34970,34971,23406,34972,23409,34973,
+34974,34975,23417,34976,34977,34978,34979,34980,34981,34982,34983,34984,14625,
+12323,34985,34986,34987,34988,34989,34990,34991,17009,34992,34993,13127,23407,
+34994,34995,23416,34996,18002,23412,34997,34998,23413,23415,23414,34999,35000,
+23422,35001,21362,12858,35002,35003,35004,23421,35005,35006,35007,35008,35009,
+35010,35011,35012,23588,35013,23419,35014,35015,35016,35017,23418,35018,35019,
+35020,23420,17760,15225,35021,35022,23587,35023,35024,23589,35025,19523,35026,
+35027,35028,13905,23872,35029,35030,35031,23585,35032,23586,35033,35034,35035,
+18229,35036,35037,35038,13929,35039,35040,35041,23591,35042,35043,35044,35045,
+23590,35046,23593,12580,35047,35048,13644,35049,35050,35051,35052,35053,16176,
+35054,35055,35056,35057,35058,20831,35059,35060,35061,35062,13890,35063,35064,
+35065,35066,35067,35068,35069,35070,35136,35137,35138,35139,35140,35141,23592,
+35142,35143,35144,35145,35146,35147,35148,19322,27507,35149,35150,35151,19292,
+35152,35153,19326,35154,35155,35156,19521,35157,35158,35159,35160,35161,18555,
+35162,35163,35164,35165,35166,35167,23594,35168,35169,35170,35171,35172,19566,
+23595,35173,35174,35175,35176,35177,35178,35179,35180,35181,35182,35183,35184,
+35185,35186,35187,35188,35189,23379,35190,23599,23596,35191,15923,35192,19067,
+35193,35194,35195,23597,35196,35197,35198,35200,35201,35202,35203,35204,18762,
+17465,35205,35206,35207,35208,35209,18237,23598,35210,35211,35212,21622,20582,
+35213,35214,35215,35216,35217,35218,35219,35220,17451,13909,35221,35222,35223,
+35224,35225,35226,35227,35228,35229,35230,35231,35232,35233,35234,35235,35236,
+35237,35238,23380,35239,35240,35241,35242,12634,35243,35244,35245,23381,35246,
+35247,35248,35249,35250,35251,35252,35253,35254,35255,35256,23382,35257,35258,
+35259,14910,35260,35261,35262,35263,35264,35265,35266,35267,35268,35269,35270,
+35271,35272,35273,18496,35274,35275,35276,35277,35278,35279,19007,18505,35280,
+22323,35281,18809,35282,35283,16199,35284,35285,14968,35286,35287,21052,35288,
+35289,35290,35291,35292,35293,35294,35295,25146,35296,13350,35297,35298,12600,
+35299,35300,35301,35302,35303,14388,35304,20292,35305,35306,35307,35308,22887,
+20262,19810,35309,35310,22893,13920,35311,21049,35312,35313,14651,35314,35315,
+35316,35317,25145,25143,35318,13427,35319,19564,19499,14194,35320,22578,20843,
+14907,35321,18983,35322,35323,19767,35324,35325,21060,16228,15440,13921,35326,
+24133,35392,35393,35394,35395,24134,23356,35396,20825,35397,35398,18022,17486,
+14190,35399,14172,35400,35401,16252,22368,35402,18037,35403,35404,12604,24136,
+15665,19543,24138,35405,24137,35406,35407,35408,35409,35410,13676,35411,18781,
+35412,35413,12354,35414,35415,35416,35417,35418,35419,35420,35421,35422,35423,
+35424,35425,35426,17710,17707,35427,17484,35428,15465,19325,35429,35430,35431,
+14915,35432,35433,35434,25977,18535,25978,19837,35435,22321,14398,17000,35436,
+18513,35437,35438,25979,35439,35440,35441,35442,13898,15435,35443,35444,20861,
+26145,35445,17262,35446,35447,35448,35449,26148,35450,35451,35452,35453,25982,
+26149,19799,35454,35456,14145,25980,25981,26147,35457,35458,17501,26152,35459,
+35460,26151,35461,35462,35463,35464,35465,35466,17219,35467,18014,35468,35469,
+26154,35470,35471,35472,35473,35474,35475,35476,17463,35477,35478,35479,26146,
+19004,35480,35481,35482,35483,15715,14659,26150,20565,20015,35484,35485,26153,
+26160,35486,21030,35487,15658,26157,35488,35489,35490,35491,35492,26159,35493,
+16465,35494,35495,21068,35496,35497,35498,15399,35499,35500,35501,35502,35503,
+35504,35505,35506,35507,35508,35509,35510,26161,35511,21110,35512,35513,35514,
+22347,35515,19838,35516,19806,16934,26155,26156,15679,26158,26163,35517,35518,
+26162,35519,35520,35521,35522,26166,35523,26168,35524,35525,35526,35527,17519,
+35528,35529,35530,17480,35531,35532,15978,18799,35533,35534,26167,35535,13936,
+35536,35537,35538,17252,35539,35540,35541,35542,35543,35544,35545,21353,26164,
+35546,26165,35547,18466,35548,35549,35550,35551,35552,26173,35553,35554,35555,
+26169,35556,35557,35558,35559,35560,17989,35561,35562,19825,26171,35563,35564,
+35565,35566,35567,35568,35569,35570,35571,35572,26172,35573,35574,35575,35576,
+15209,35577,35578,35579,35580,35581,35582,35648,26174,35649,35650,35651,35652,
+26170,35653,35654,16439,35655,35656,35657,35658,35659,35660,35661,35662,35663,
+21284,26175,18804,26179,35664,35665,26180,35666,35667,35668,35669,20598,35670,
+35671,35672,35673,35674,35675,35676,35677,35678,35679,35680,35681,35682,35683,
+35684,35685,35686,35687,17213,35688,35689,35690,35691,35692,35693,35694,17220,
+26178,35695,35696,35697,35698,35699,35700,35701,35702,35703,35704,35705,35706,
+35707,35708,26177,35709,35710,35712,35713,35714,35715,35716,26183,20273,35717,
+27508,35718,35719,26186,35720,35721,35722,35723,35724,26181,35725,35726,15454,
+18729,35727,35728,35729,35730,35731,35732,15413,35733,35734,20307,35735,35736,
+35737,35738,35739,26184,35740,26185,35741,26190,35742,26192,35743,35744,35745,
+26193,35746,35747,35748,26187,13653,35749,26188,35750,35751,26191,35752,35753,
+17499,35754,26182,35755,35756,35757,35758,35759,26189,35760,35761,35762,35763,
+35764,35765,35766,35767,35768,35769,35770,35771,35772,35773,35774,35775,35776,
+35777,35778,35779,35780,35781,35782,26194,35783,35784,35785,35786,35787,35788,
+35789,35790,35791,35792,35793,35794,26196,26195,35795,35796,35797,35798,35799,
+35800,35801,35802,35803,35804,35805,35806,35807,35808,35809,35810,35811,35812,
+35813,35814,35815,35816,35817,35818,35819,35820,26197,35821,22904,35822,35823,
+26198,35824,35825,35826,35827,35828,35829,35830,35831,26199,35832,35833,35834,
+35835,35836,35837,35838,35904,35905,35906,35907,35908,35909,35910,35911,22355,
+26205,35912,26206,16215,21584,35913,22358,13414,19311,26202,22595,22350,20514,
+35914,17231,35915,35916,26207,15422,14658,26203,20775,35917,35918,14882,16975,
+35919,22571,35920,35921,35922,19051,25966,35923,26204,35924,14197,35925,35926,
+35927,35928,18534,35929,35930,17525,35931,35932,25906,17534,35933,19324,25907,
+21804,35934,21358,19032,12338,35935,19278,19818,35936,35937,14954,35938,35939,
+35940,25909,35941,25908,35942,22362,14681,22118,13864,19824,21067,12582,18997,
+35943,13160,18803,16205,20603,19026,25910,15170,35944,35945,35946,20316,14636,
+35947,35948,35949,35950,21591,35951,35952,14886,20839,20348,15442,35953,25911,
+18525,35954,35955,35956,16237,12662,19294,35957,35958,15429,35959,15428,21114,
+17244,16220,35960,35961,35962,35963,14395,35964,35965,35966,17218,35968,14894,
+21538,35969,35970,35971,35972,35973,35974,35975,35976,35977,18270,17455,12908,
+35978,14673,35979,35980,25915,16712,35981,35982,21807,35983,35984,35985,35986,
+35987,25916,35988,25918,35989,35990,35991,35992,35993,35994,35995,13415,13908,
+19266,20784,13628,35996,35997,19033,35998,14178,35999,36000,18788,36001,15659,
+36002,36003,20030,22384,36004,36005,36006,36007,20513,36008,18777,36009,36010,
+13947,26200,15458,36011,13118,36012,18768,36013,26201,13090,36014,36015,36016,
+36017,24140,36018,21320,24141,36019,21026,36020,36021,36022,36023,24142,36024,
+36025,36026,36027,15949,36028,36029,24143,36030,36031,36032,18988,21116,13151,
+25962,17505,15905,20018,17522,15958,17960,12899,36033,36034,15955,36035,36036,
+18300,19563,15724,20061,36037,36038,19002,17985,25964,20540,36039,36040,36041,
+21817,36042,36043,36044,25965,36045,36046,36047,36048,19060,36049,19776,16965,
+36050,25967,36051,16964,25968,36052,36053,36054,36055,36056,36057,36058,25976,
+19789,36059,18749,36060,36061,36062,36063,36064,36065,36066,21081,24872,36067,
+36068,36069,36070,21356,36071,19306,18033,36072,36073,36074,36075,36076,24876,
+36077,36078,36079,24871,24873,36080,36081,24874,24879,36082,36083,12909,36084,
+24875,14426,24877,24878,24880,13626,24881,36085,36086,36087,36088,36089,24883,
+24888,36090,36091,36092,36093,36094,20818,36160,24886,24885,16747,36161,36162,
+36163,24887,36164,21568,36165,24882,36166,24890,12342,36167,36168,36169,36170,
+24884,36171,16249,36172,24889,36173,36174,24891,36175,36176,36177,36178,36179,
+36180,24894,36181,36182,36183,36184,36185,36186,24892,36187,36188,36189,36190,
+36191,36192,22085,36193,36194,36195,36196,36197,36198,36199,20287,36200,36201,
+24893,24895,16973,36202,13931,36203,21368,36204,36205,18253,36206,36207,14181,
+36208,36209,36210,36211,36212,36213,36214,36215,36216,36217,15998,36218,36219,
+36220,36221,36222,36224,24896,24897,36225,36226,24903,13159,36227,36228,36229,
+36230,36231,36232,18025,36233,36234,36235,36236,36237,13406,36238,20802,36239,
+36240,36241,36242,24904,36243,36244,24902,36245,36246,36247,36248,36249,24901,
+36250,24899,24898,36251,12608,36252,36253,36254,21816,24900,36255,36256,36257,
+36258,36259,24907,36260,36261,36262,36263,36264,36265,36266,36267,24908,24906,
+36268,36269,36270,36271,36272,36273,36274,36275,28538,36276,36277,24915,24914,
+18230,36278,36279,36280,36281,36282,36283,36284,36285,36286,36287,36288,24905,
+36289,36290,24910,36291,24912,36292,36293,36294,36295,36296,36297,36298,36299,
+36300,36301,36302,24916,36303,24913,24909,36304,36305,24911,36306,36307,36308,
+36309,24917,36310,36311,36312,36313,36314,36315,36316,36317,36318,36319,36320,
+36321,36322,24918,36323,36324,36325,36326,36327,36328,36329,36330,36331,36332,
+36333,36334,36335,36336,36337,36338,36339,36340,36341,36342,36343,36344,24919,
+36345,36346,36347,24920,36348,36349,36350,36416,36417,36418,36419,36420,36421,
+36422,36423,36424,36425,36426,36427,36428,36429,36430,36431,36432,36433,36434,
+36435,36436,36437,24922,36438,36439,36440,36441,36442,36443,36444,36445,36446,
+36447,36448,36449,36450,24923,36451,36452,36453,36454,36455,36456,36457,20001,
+36458,36459,36460,36461,36462,36463,36464,36465,36466,36467,36468,36469,36470,
+26461,36471,13352,22109,36472,36473,20786,13106,36474,36475,14628,22387,18249,
+15966,14638,36476,20055,36477,36478,12910,23375,36480,15418,21073,19272,12365,
+36481,36482,20335,36483,36484,36485,36486,36487,22883,15725,36488,36489,12626,
+19024,12860,36490,19239,14123,36491,18982,36492,36493,36494,20259,36495,36496,
+24696,21834,24699,36497,36498,24698,17729,19579,36499,16689,24697,22115,12847,
+22084,13659,36500,36501,36502,36503,36504,36505,36506,36507,13432,22049,36508,
+36509,36510,36511,36512,20271,12399,36513,36514,24700,36515,36516,36517,36518,
+36519,24865,13091,36520,36521,24701,24702,17201,36522,36523,36524,36525,17245,
+36526,24866,14201,36527,36528,36529,36530,36531,36532,15183,36533,36534,36535,
+36536,36537,36538,36539,24867,17467,36540,36541,36542,36543,36544,24868,36545,
+36546,24869,36547,36548,24870,13361,36549,36550,36551,36552,36553,36554,36555,
+36556,36557,36558,36559,36560,36561,36562,36563,14409,17981,17514,36564,12834,
+36565,20562,36566,26459,15171,21335,21316,36567,14691,25167,36568,36569,36570,
+22319,36571,18284,12627,36572,36573,13362,25169,36574,36575,36576,20594,16942,
+25168,36577,16226,21286,13655,25170,13674,36578,17261,14461,36579,14382,36580,
+17747,14159,25172,36581,36582,36583,36584,25171,13896,22393,36585,36586,36587,
+36588,36589,19749,36590,36591,36592,36593,36594,25176,36595,25174,19068,16181,
+21305,25173,36596,36597,36598,36599,25175,36600,36601,36602,36603,36604,36605,
+36606,36672,36673,36674,16686,16456,36675,36676,36677,36678,36679,36680,25179,
+25178,16426,36681,36682,16718,36683,36684,36685,36686,25180,36687,36688,36689,
+36690,36691,36692,36693,36694,36695,36696,36697,36698,25181,36699,25182,36700,
+36701,36702,36703,36704,36705,36706,36707,36708,23368,36709,20819,19746,36710,
+36711,15656,36712,36713,36714,24131,22565,16170,23373,21100,18042,17706,36715,
+36716,36717,24132,36718,12631,24366,36719,36720,36721,19005,36722,24369,36723,
+14637,36724,21117,36725,14373,14955,36726,36727,13146,36728,36729,36730,13660,
+21829,36731,36732,36733,36734,17238,20306,15137,36736,25971,25970,36737,36738,
+25972,36739,19812,36740,18549,36741,36742,36743,36744,36745,36746,36747,13615,
+18239,36748,25974,36749,36750,36751,27696,36752,36753,36754,36755,36756,36757,
+36758,36759,36760,36761,36762,36763,36764,36765,36766,25958,36767,14697,13617,
+36768,16956,25960,25959,25961,36769,36770,36771,36772,21069,36773,36774,36775,
+24938,20558,36776,19758,36777,20837,36778,36779,12874,12651,36780,12658,17773,
+36781,36782,21827,21296,36783,24924,36784,36785,36786,24925,36787,21083,36788,
+13113,12619,36789,36790,36791,19833,21879,24926,36792,15926,13437,36793,24927,
+14940,24928,15154,16969,24929,36794,36795,36796,20588,36797,19773,36798,36799,
+24930,36800,13635,17735,24931,36801,36802,24932,36803,36804,36805,36806,21369,
+36807,36808,36809,36810,36811,36812,24933,36813,20781,36814,36815,24934,20002,
+36816,36817,36818,36819,36820,36821,24935,36822,13634,36823,36824,36825,36826,
+24936,15189,36827,36828,36829,36830,36831,20548,25184,12632,21092,36832,36833,
+25185,36834,36835,15433,18508,36836,25187,27774,27773,24367,36837,36838,36839,
+25186,22078,19836,17190,36840,36841,36842,25411,36843,36844,22098,25191,36845,
+36846,25192,36847,36848,21319,36849,36850,25196,16236,36851,25197,25189,36852,
+36853,13120,36854,36855,36856,17518,36857,36858,25198,36859,36860,20547,36861,
+14966,25193,14174,15155,19500,19275,25188,25190,25194,25195,36862,36928,36929,
+25207,36930,36931,25204,21621,25203,36932,36933,17709,36934,21882,17730,12864,
+36935,36936,25199,36937,25202,16687,19260,36938,36939,13601,25209,36940,36941,
+36942,15409,25201,20564,21561,25205,14678,25206,36943,36944,36945,18259,36946,
+36947,36948,36949,36950,25200,36951,36952,36953,36954,36955,22364,27937,36956,
+36957,25208,36958,27941,25214,19025,36959,36960,36961,36962,36963,36964,36965,
+16693,36966,15184,36967,36968,16214,36969,14947,36970,36971,19233,36972,36973,
+36974,27942,27939,36975,36976,27938,36977,36978,36979,36980,15190,27943,20596,
+36981,36982,27940,14942,13943,25377,13874,19569,14631,36983,20258,18209,36984,
+36985,16210,36986,36987,13937,36988,25210,25211,25213,25212,17493,25378,36989,
+21313,36990,36992,36993,25383,18244,36994,36995,36996,36997,20260,36998,36999,
+25385,14903,37000,37001,37002,37003,25384,37004,15194,37005,25379,37006,37007,
+37008,25380,25386,37009,25382,37010,20082,21318,37011,37012,15164,37013,37014,
+21571,37015,17530,37016,37017,27944,20604,25381,37018,17269,37019,25389,12591,
+37020,25394,37021,37022,37023,15426,37024,37025,25388,13631,37026,37027,37028,
+37029,37030,37031,37032,37033,18281,25392,37034,37035,37036,15914,19823,37037,
+37038,37039,37040,37041,15219,37042,37043,37044,19560,37045,37046,25391,37047,
+25393,37048,20263,25390,37049,20009,15197,37050,37051,37052,37053,37054,13675,
+15973,12882,13133,37055,12601,25387,12881,13612,14687,13928,37056,37057,20331,
+25399,37058,15180,37059,37060,18503,20554,37061,37062,37063,37064,37065,25400,
+13166,37066,37067,37068,37069,27945,37070,21370,21348,37071,37072,37073,27946,
+25401,21090,37074,37075,37076,37077,37078,25397,37079,37080,37081,37082,21342,
+37083,37084,37085,37086,14416,25395,37087,37088,25398,14175,37089,25396,16418,
+37090,37091,37092,25402,37093,37094,37095,37096,37097,37098,37099,37100,37101,
+37102,37103,37104,37105,37106,37107,37108,37109,37110,37111,21560,37112,37113,
+37114,37115,37116,37117,37118,37184,13384,37185,25403,37186,15173,37187,18807,
+37188,37189,18789,37190,37191,37192,17469,37193,37194,37195,37196,37197,37198,
+37199,27947,37200,37201,37202,37203,17021,37204,37205,37206,37207,15195,16174,
+37208,37209,37210,37211,37212,37213,37214,20031,37215,37216,37217,37218,25404,
+37219,16182,37220,37221,37222,37223,37224,37225,37226,37227,37228,37229,37230,
+37231,37232,37233,37234,37235,37236,37237,37238,12655,37239,37240,21623,37241,
+37242,37243,37244,37245,25406,37246,37248,37249,37250,37251,37252,37253,37254,
+27949,37255,37256,37257,37258,37259,37260,37261,37262,37263,25407,14889,27948,
+37264,37265,25405,37266,37267,37268,37269,37270,37271,37272,37273,37274,37275,
+25408,37276,37277,37278,37279,37280,37281,14902,37282,37283,37284,13870,37285,
+37286,37287,37288,37289,20536,37290,12355,27950,37291,37292,37293,37294,37295,
+27951,16449,37296,25409,37297,37298,37299,37300,37301,37302,37303,37304,37305,
+37306,37307,37308,37309,37310,37311,37312,37313,17715,37314,37315,37316,37317,
+37318,37319,37320,37321,37322,37323,37324,37325,37326,37327,25410,37328,37329,
+37330,37331,37332,37333,37334,37335,37336,23602,37337,37338,37339,37340,37341,
+37342,27952,37343,14442,37344,20076,27175,20583,19065,18518,20279,13129,20050,
+15716,37345,37346,25438,15218,27176,21821,37347,18013,27177,37348,37349,37350,
+27178,37351,27180,27179,37352,27182,27181,37353,37354,37355,37356,15704,37357,
+27183,37358,16958,37359,37360,37361,37362,13377,13431,37363,37364,15143,37365,
+37366,37367,37368,37369,27750,27749,14143,19321,12642,37370,27751,37371,37372,
+37373,18760,27752,27753,37374,19030,24144,12869,21626,37440,37441,17995,12359,
+13426,18515,37442,37443,37444,19792,37445,37446,16184,37447,37448,37449,37450,
+37451,37452,37453,16219,37454,37455,18212,22068,37456,16425,24145,18728,20847,
+17700,12391,13110,18501,37457,37458,12386,37459,37460,14198,37461,37462,17786,
+37463,37464,13939,37465,21842,13136,15420,37466,37467,37468,13101,37469,37470,
+37471,37472,15985,12369,37473,37474,37475,37476,37477,37478,21078,19043,22309,
+37479,19766,13878,16185,21851,37480,14375,17751,37481,37482,37483,24146,16217,
+16981,18240,37484,15140,12584,37485,37486,17770,37487,37488,17787,19495,37489,
+37490,37491,37492,12583,37493,37494,37495,13654,37496,37497,37498,17448,37499,
+24147,20794,13161,37500,17266,37501,37502,14199,37504,22132,13603,12912,17460,
+17513,16429,24148,37505,12392,17732,16736,37506,14677,37507,15964,19800,12366,
+37508,19791,24150,15952,22334,24149,21840,12381,37509,37510,17506,37511,37512,
+16931,15472,37513,21301,16441,17697,12838,21617,37514,37515,16424,19011,24151,
+21884,37516,14640,37517,18477,19241,37518,24153,16189,37519,37520,37521,37522,
+17972,22311,18992,17475,37523,13142,14674,37524,37525,37526,37527,22072,27260,
+12340,37528,37529,37530,37531,16230,37532,37533,19572,37534,37535,37536,37537,
+19802,37538,37539,37540,22079,16974,37541,20046,19490,20526,17491,13618,24152,
+21877,15415,15187,37542,37543,12324,37544,17714,13420,37545,37546,37547,21873,
+37548,37549,27261,37550,37551,37552,37553,37554,37555,24154,19750,37556,37557,
+19820,37558,37559,37560,37561,20070,24156,37562,19761,16422,37563,37564,22333,
+37565,24155,12358,14900,18771,17523,15976,37566,37567,37568,37569,12854,37570,
+37571,37572,37573,37574,37575,37576,37577,16460,19312,37578,15473,15163,13623,
+37579,37580,37581,17781,37582,24166,37583,37584,37585,24163,15965,37586,37587,
+24159,37588,37589,37590,37591,13367,15709,37592,37593,24160,17517,37594,37595,
+37596,37597,20294,37598,13664,37599,37600,37601,37602,13918,19034,13684,24165,
+37603,21830,37604,24161,19533,18046,37605,17733,37606,37607,37608,21044,37609,
+15986,37610,37611,37612,37613,37614,37615,37616,16979,37617,19517,13112,37618,
+15699,37619,16216,19782,20826,13419,37620,24164,24157,24167,37621,27262,37622,
+37623,16944,24162,37624,37625,22080,13607,37626,12916,37627,24168,37628,24178,
+37629,37630,37696,37697,37698,24173,37699,24177,37700,37701,18528,37702,37703,
+37704,22369,24175,17256,19553,37705,12901,37706,37707,37708,21054,37709,37710,
+37711,37712,37713,37714,37715,24174,37716,24171,20053,37717,13351,37718,37719,
+37720,37721,37722,16171,15934,37723,37724,15698,37725,37726,37727,37728,24169,
+37729,21550,37730,24158,37731,24170,37732,37733,37734,37735,16447,37736,24172,
+12915,14441,16935,37737,37738,15681,37739,37740,37741,37742,37743,24181,24184,
+37744,37745,12843,13348,37746,37747,13418,18726,37748,37749,37750,37751,37752,
+37753,24182,19281,37754,14435,37755,24183,24186,37756,37757,37758,37760,24185,
+37761,37762,37763,19522,37764,12385,13422,37765,37766,37767,37768,37769,37770,
+25914,37771,37772,37773,37774,37775,20527,37776,37777,12907,37778,27425,37779,
+24180,37780,37781,18787,24179,12378,21025,12663,37782,19503,37783,37784,37785,
+37786,37787,37788,37789,24176,37790,19236,37791,37792,37793,21802,37794,37795,
+37796,37797,37798,24187,37799,37800,37801,37802,37803,37804,37805,37806,13405,
+37807,17446,37808,37809,37810,24189,37811,37812,37813,37814,37815,37816,37817,
+37818,37819,37820,17278,17441,24353,37821,37822,37823,37824,37825,37826,37827,
+16716,37828,24188,15983,37829,17970,37830,37831,37832,37833,37834,37835,37836,
+37837,37838,13125,18550,37839,37840,19258,24190,37841,37842,24356,37843,37844,
+37845,37846,22322,37847,37848,37849,37850,37851,13111,37852,37853,37854,37855,
+16707,37856,37857,18251,12837,13417,37858,22315,37859,37860,37861,37862,17516,
+37863,24354,24355,37864,24357,37865,14899,37866,37867,37868,24358,37869,16478,
+37870,37871,18755,37872,37873,37874,37875,37876,37877,37878,12889,18278,37879,
+24359,37880,18268,37881,37882,37883,37884,24360,27426,37885,37886,37952,37953,
+37954,19283,37955,37956,37957,24362,37958,24361,37959,12865,37960,37961,37962,
+37963,37964,37965,37966,37967,37968,37969,37970,37971,37972,37973,37974,37975,
+37976,37977,37978,37979,37980,37981,37982,37983,37984,17738,37985,37986,37987,
+37988,37989,37990,37991,37992,24363,37993,37994,37995,37996,37997,37998,37999,
+38000,21596,38001,38002,38003,38004,38005,18497,38006,38007,38008,38009,38010,
+38011,38012,38013,38014,38016,38017,38018,24364,38019,38020,38021,38022,38023,
+15984,38024,38025,24365,22055,38026,38027,38028,38029,27191,27446,19029,38030,
+22652,14404,38031,14629,38032,38033,14149,21886,38034,38035,38036,38037,38038,
+14666,38039,38040,20519,29773,38041,38042,13648,38043,38044,17268,38045,15944,
+38046,38047,38048,27447,12349,38049,38050,15692,38051,16690,38052,12630,13096,
+38053,38054,38055,14418,18722,38056,38057,13912,38058,38059,38060,38061,27448,
+15924,38062,38063,38064,19069,38065,18243,38066,21883,38067,38068,14195,38069,
+38070,38071,38072,38073,38074,38075,38076,38077,38078,38079,38080,38081,38082,
+38083,20036,38084,38085,38086,21803,12659,38087,38088,38089,27699,12383,38090,
+27701,38091,38092,38093,13879,38094,16719,38095,30074,20529,38096,38097,21861,
+38098,20051,38099,38100,15727,13154,38101,14379,38102,21814,38103,27965,38104,
+13903,38105,19257,20546,38106,38107,38108,38109,38110,38111,38112,38113,14141,
+38114,38115,27702,18985,38116,38117,38118,17748,38119,27705,27704,16963,27703,
+38120,38121,38122,38123,20605,27706,38124,27707,22373,38125,38126,27708,38127,
+38128,38129,27709,18028,38130,38131,38132,38133,38134,38135,38136,38137,20062,
+38138,15432,38139,38140,18517,13609,15945,22076,21607,38141,38142,20782,20593,
+27192,27193,27194,14901,38208,38209,38210,38211,18993,16245,38212,38213,19834,
+38214,38215,38216,38217,38218,27200,38219,12346,27198,38220,38221,16421,38222,
+38223,38224,27195,38225,12925,38226,17271,15208,38227,38228,38229,21079,20084,
+27199,38230,38231,38232,27196,38233,38234,38235,27203,38236,20551,21299,38237,
+38238,38239,38240,13370,38241,17217,22386,38242,38243,38244,38245,21841,38246,
+19015,38247,27205,38248,38249,27204,27207,27206,38250,38251,38252,38253,38254,
+22119,38255,20308,38256,38257,27211,38258,15182,38259,38260,38261,38262,38263,
+38264,38265,15738,18766,38266,38267,27212,38268,38269,18745,20350,27210,21582,
+27213,27215,38270,38272,19821,38273,38274,38275,38276,27209,38277,27214,38278,
+38279,20078,38280,15198,38281,13119,38282,38283,38284,38285,38286,18005,15920,
+20090,38287,38288,38289,18279,38290,15911,27216,38291,38292,22087,38293,38294,
+38295,16704,38296,38297,38298,21597,38299,27217,38300,38301,20286,38302,38303,
+38304,38305,27218,38306,38307,38308,38309,19054,38310,38311,38312,38313,17711,
+12341,38314,38315,38316,38317,38318,27220,38319,38320,38321,38322,38323,38324,
+38325,38326,38327,27219,29791,38328,38329,38330,38331,38332,17466,38333,38334,
+38335,38336,38337,12585,38338,38339,38340,38341,25951,38342,38343,38344,38345,
+27221,38346,38347,38348,38349,38350,38351,38352,38353,38354,38355,38356,38357,
+38358,38359,38360,38361,38362,38363,38364,38365,38366,38367,38368,38369,38370,
+38371,19055,38372,27222,27223,18008,38373,38374,38375,38376,38377,38378,38379,
+38380,27224,38381,38382,27225,38383,38384,38385,38386,38387,38388,21563,38389,
+18298,21047,14460,38390,38391,27202,38392,12892,38393,38394,17020,38395,21624,
+19558,22382,38396,38397,38398,38464,38465,38466,38467,21570,21328,27459,17779,
+38468,14206,38469,38470,27476,38471,38472,38473,19255,27486,38474,16458,38475,
+38476,38477,19835,38478,13103,38479,18010,38480,38481,38482,38483,38484,38485,
+27516,38486,17470,38487,20020,17449,12606,21629,38488,19061,38489,22124,38490,
+38491,18003,13924,38492,38493,38494,38495,15226,38496,38497,20576,38498,38499,
+18737,38500,21587,18472,38501,38502,14411,38503,26686,18748,38504,38505,26683,
+38506,16494,20563,12868,13413,38507,26684,38508,38509,21832,38510,38511,38512,
+38513,38514,13893,38515,26685,19064,14428,19573,38516,38517,38518,16436,38519,
+38520,20846,26687,26690,38521,38522,14908,38523,12589,15708,38524,27197,26691,
+38525,26694,38526,26699,38528,38529,38530,38531,26700,38532,19273,12389,38533,
+15403,38534,38535,14649,38536,38537,26689,38538,19831,38539,26698,38540,38541,
+38542,38543,20086,38544,38545,38546,38547,21869,38548,16726,26692,38549,17206,
+38550,14715,22054,26696,38551,38552,38553,19040,21606,38554,26688,38555,26693,
+26695,38556,18233,14179,38557,26697,38558,16221,26706,38559,38560,26711,38561,
+26709,15452,15439,26715,38562,38563,38564,38565,38566,38567,38568,38569,26718,
+38570,26714,12666,38571,38572,38573,38574,38575,38576,38577,38578,38579,38580,
+12376,17459,14412,18018,18494,18529,38581,38582,38583,26703,26708,26710,38584,
+14705,26712,22389,38585,17531,38586,26716,38587,38588,12905,38589,38590,38591,
+26705,38592,38593,15469,38594,38595,16194,26701,22137,38596,16760,12913,38597,
+38598,38599,38600,38601,38602,38603,38604,26719,38605,19009,26713,38606,38607,
+38608,38609,21796,38610,12650,21819,26702,26704,13872,26707,38611,26717,16440,
+38612,19063,38613,19240,38614,38615,18012,16501,38616,38617,38618,38619,38620,
+26729,38621,38622,38623,20515,38624,38625,38626,38627,38628,38629,38630,26738,
+22122,38631,38632,38633,38634,38635,38636,38637,26720,26721,38638,38639,38640,
+20857,14923,14457,38641,38642,14449,21588,26735,38643,26734,26732,14704,19538,
+26726,20006,16242,38644,12344,26737,26736,38645,22336,38646,26724,38647,19753,
+18723,38648,15160,15707,26730,38649,38650,38651,38652,38653,38654,38720,38721,
+38722,38723,26722,26723,26725,13621,26727,18245,26731,26733,15664,22318,38724,
+26744,38725,38726,38727,38728,38729,38730,38731,38732,26741,38733,19760,26742,
+38734,38735,38736,38737,38738,38739,38740,38741,38742,16698,38743,26728,38744,
+17207,12400,38745,38746,38747,38748,38749,38750,38751,38752,26740,38753,38754,
+38755,26743,38756,38757,38758,14627,38759,38760,38761,38762,38763,38764,38765,
+38766,38767,38768,18770,38769,38770,38771,17230,20064,16486,38772,38773,38774,
+38775,19315,38776,19549,20533,38777,38778,19041,38779,26739,38780,38781,38782,
+38784,38785,38786,38787,38788,38789,38790,15468,38791,26745,38792,38793,38794,
+38795,38796,38797,17246,38798,18021,38799,14711,38800,38801,38802,38803,12404,
+38804,38805,22360,38806,38807,15404,38808,17775,38809,38810,38811,38812,38813,
+19524,38814,38815,26918,38816,38817,38818,38819,38820,38821,38822,38823,38824,
+38825,18733,38826,26914,16482,38827,38828,38829,16195,38830,38831,38832,26750,
+14679,38833,26747,38834,38835,38836,38837,26916,38838,38839,38840,21070,38841,
+38842,38843,38844,38845,26915,38846,22066,22325,38847,26919,38848,15671,38849,
+38850,38851,38852,38853,38854,38855,38856,38857,38858,38859,38860,26748,26749,
+38861,38862,38863,26913,38864,38865,38866,38867,38868,38869,38870,38871,19798,
+38872,38873,21036,38874,38875,38876,26930,38877,38878,38879,38880,26921,38881,
+38882,38883,13354,38884,13371,38885,38886,26923,38887,38888,38889,38890,38891,
+38892,38893,38894,38895,38896,38897,38898,38899,38900,38901,38902,38903,20520,
+38904,38905,26917,38906,38907,13182,38908,38909,26924,16483,38910,26922,38976,
+38977,26937,38978,38979,26936,38980,38981,38982,38983,26926,38984,38985,26746,
+38986,38987,26920,38988,38989,38990,38991,38992,16172,26929,26938,38993,38994,
+16933,38995,38996,38997,26927,38998,14405,38999,26925,39000,21340,26932,26933,
+26935,39001,39002,39003,26951,39004,39005,39006,39007,39008,39009,16454,26949,
+39010,39011,26928,39012,39013,26939,12401,39014,39015,39016,39017,39018,39019,
+39020,39021,39022,39023,26940,21797,39024,39025,26942,39026,26943,39027,39028,
+39029,26945,39030,39031,16753,39032,39033,18486,39034,39035,39036,26941,39037,
+39038,39040,39041,39042,26946,39043,39044,39045,39046,39047,39048,39049,39050,
+26947,39051,26931,39052,26934,39053,15153,39054,39055,39056,26944,39057,39058,
+39059,39060,39061,39062,15479,39063,39064,39065,26948,26950,39066,39067,39068,
+39069,39070,39071,39072,39073,39074,39075,39076,39077,26954,39078,39079,39080,
+39081,26958,39082,39083,39084,39085,39086,39087,39088,39089,39090,39091,12891,
+39092,26952,39093,39094,39095,39096,39097,39098,39099,39100,39101,39102,14126,
+39103,39104,39105,39106,39107,39108,39109,39110,39111,39112,39113,39114,26955,
+26956,39115,39116,39117,39118,39119,39120,21825,39121,17443,39122,39123,39124,
+39125,39126,39127,26968,39128,14945,39129,39130,39131,39132,26953,39133,21283,
+39134,39135,39136,26964,39137,39138,39139,39140,39141,39142,39143,26967,26960,
+39144,39145,39146,39147,39148,26959,39149,39150,18241,39151,39152,39153,39154,
+39155,39156,39157,39158,26962,39159,39160,39161,39162,39163,39164,39165,26969,
+13128,39166,26963,39232,39233,39234,39235,39236,20336,39237,39238,39239,26957,
+39240,39241,39242,39243,39244,39245,39246,39247,39248,39249,39250,13175,39251,
+39252,39253,39254,39255,39256,39257,26966,39258,39259,26970,39260,39261,39262,
+19508,39263,39264,39265,20269,39266,39267,39268,39269,39270,39271,39272,39273,
+39274,26965,39275,26972,26971,39276,39277,39278,39279,39280,26974,39281,39282,
+39283,39284,39285,39286,39287,39288,26961,39289,39290,39291,39292,39293,39294,
+39296,39297,26973,39298,26975,17226,39299,39300,39301,39302,39303,39304,39305,
+39306,39307,39308,39309,39310,39311,39312,39313,39314,39315,39316,39317,39318,
+39319,39320,39321,39322,39323,39324,39325,39326,39327,39328,39329,39330,39331,
+39332,39333,39334,39335,39336,39337,39338,39339,39340,39341,39342,39343,39344,
+39345,39346,39347,39348,39349,39350,39351,39352,39353,39354,39355,39356,39357,
+39358,39359,39360,39361,39362,39363,39364,39365,39366,39367,39368,39369,39370,
+39371,39372,39373,39374,39375,39376,39377,39378,39379,39380,39381,39382,39383,
+39384,39385,39386,39387,39388,39389,39390,39391,39392,39393,39394,39395,39396,
+39397,39398,39399,39400,39401,39402,39403,39404,39405,39406,39407,39408,39409,
+39410,39411,39412,39413,18231,13390,15158,20544,27683,39414,39415,17719,39416,
+39417,39418,39419,39420,39421,39422,39488,39489,39490,21371,39491,39492,39493,
+39494,27684,39495,27685,18011,39496,39497,39498,16238,39499,39500,39501,39502,
+27686,39503,39504,27687,20522,39505,18232,39506,39507,14440,39508,39509,39510,
+39511,39512,39513,39514,39515,39516,39517,39518,39519,27688,39520,39521,39522,
+39523,39524,39525,39526,39527,22073,21885,13387,12861,20068,18023,39528,39529,
+19809,39530,39531,39532,39533,39534,39535,39536,39537,39538,39539,39540,39541,
+39542,39543,13429,39544,19264,15455,39545,39546,39547,39548,26978,26979,20842,
+26981,39549,13433,26980,39550,20787,19042,12880,39552,26984,39553,39554,39555,
+39556,26982,26983,39557,39558,22067,39559,39560,39561,26985,26986,39562,39563,
+39564,39565,39566,26987,39567,39568,39569,39570,39571,39572,39573,39574,26988,
+39575,39576,39577,39578,39579,39580,39581,39582,27695,17721,13902,39583,21107,
+39584,39585,39586,39587,39588,39589,39590,13678,39591,15193,27697,39592,39593,
+21091,39594,39595,39596,39597,39598,20067,39599,17464,39600,17215,39601,39602,
+13886,22585,12616,12623,12625,17790,39603,12624,39604,17195,39605,39606,39607,
+39608,39609,21809,39610,39611,39612,39613,39614,39615,39616,39617,27428,14913,
+39618,39619,39620,19514,39621,39622,39623,27429,39624,27431,39625,39626,39627,
+27432,39628,39629,39630,27430,39631,39632,39633,39634,39635,39636,39637,27433,
+27435,27434,39638,39639,39640,39641,39642,27436,39643,19023,22581,17265,39644,
+17189,18040,27437,17482,39645,27438,27439,27440,14165,39646,39647,39648,14202,
+39649,27441,18274,39650,27443,39651,14884,20853,12337,27442,27444,39652,39653,
+39654,13610,16968,18280,39655,27445,39656,19246,25439,39657,39658,21312,39659,
+39660,39661,39662,22875,39663,39664,19745,22061,18291,39665,39666,39667,22880,
+15203,39668,14906,25442,39669,39670,39671,39672,39673,20267,39674,39675,39676,
+25440,18759,39677,14905,39678,39744,39745,20788,25441,18538,14639,15661,13144,
+20059,39746,39747,19520,39748,39749,39750,25448,25449,19828,39751,39752,39753,
+39754,39755,19501,39756,15411,39757,25450,39758,25451,39759,39760,20570,39761,
+39762,39763,18043,14170,39764,39765,18271,21066,20054,39766,25444,25452,39767,
+18802,13121,39768,39769,25447,39770,39771,18019,25445,39772,39773,27955,25446,
+39774,39775,39776,39777,18739,39778,17766,39779,39780,39781,14645,39782,17211,
+39783,25443,17725,16676,16985,12887,39784,25453,15142,17453,39785,25456,15962,
+39786,39787,25467,25461,14931,39788,39789,39790,39791,14160,21325,39792,22094,
+21843,14657,21812,20824,39793,39794,39795,39796,20537,18294,39797,39798,39799,
+18474,12852,39800,17242,39801,39802,39803,25454,39804,39805,25468,25455,14120,
+25463,25460,39806,39808,39809,14138,39810,39811,17698,39812,25462,17757,12840,
+18044,39813,17504,39814,39815,22306,39816,16481,25465,39817,39818,25466,25469,
+19497,25459,39819,21310,39820,12611,27956,25457,25458,39821,25464,20538,17987,
+21619,25470,39822,39823,15712,39824,39825,25639,39826,39827,25638,39828,39829,
+39830,20851,25635,39831,25641,39832,39833,39834,18551,39835,39836,39837,39838,
+20276,39839,25640,25646,16997,39840,39841,13876,39842,39843,39844,39845,39846,
+39847,15730,39848,25634,39849,39850,14953,25642,39851,39852,25644,39853,39854,
+13949,22110,25650,39855,25645,39856,39857,39858,25633,39859,15214,19805,18210,
+17737,39860,39861,16759,39862,25636,39863,18227,15660,15677,25637,39864,22343,
+12898,39865,25643,15427,25647,39866,15211,25648,17704,25649,39867,39868,39869,
+39870,21859,16163,39871,25658,39872,25655,39873,25659,39874,39875,25661,39876,
+39877,18006,39878,39879,14918,16459,39880,39881,39882,14369,25652,39883,39884,
+39885,39886,21537,39887,39888,14883,15742,39889,39890,39891,25660,39892,39893,
+39894,39895,39896,19775,39897,39898,17529,39899,39900,20347,18790,39901,39902,
+21311,39903,20305,39904,39905,25651,39906,25656,25657,19561,39907,39908,39909,
+39910,39911,19534,39912,16468,25653,16688,25654,20048,39913,15169,13651,39914,
+18547,15655,21831,18732,14370,25674,39915,39916,25676,20804,39917,39918,21050,
+39919,39920,14893,39921,39922,14932,39923,39924,39925,39926,39927,39928,25667,
+13677,39929,39930,39931,22349,25664,20349,25663,39932,39933,39934,16732,19530,
+40000,40001,40002,40003,19047,40004,40005,40006,40007,17495,40008,19540,25672,
+40009,40010,40011,25671,25665,40012,25668,13613,40013,40014,21337,40015,25670,
+40016,40017,40018,40019,21113,13411,40020,15156,40021,40022,18798,40023,13374,
+40024,40025,40026,15212,40027,20813,40028,19565,27957,40029,40030,40031,40032,
+40033,40034,40035,40036,18277,40037,40038,40039,40040,21544,40041,25675,22357,
+25666,40042,15653,25669,40043,40044,21350,40045,25673,18808,40046,40047,25662,
+40048,40049,21349,40050,40051,18302,13897,40052,21628,12851,25687,40053,40054,
+40055,20034,40056,25677,40057,20028,40058,14427,40059,40060,25686,40061,16202,
+40062,40064,40065,21326,40066,17260,40067,40068,40069,40070,40071,40072,40073,
+40074,17736,25688,40075,40076,40077,40078,40079,40080,40081,40082,19780,25679,
+40083,40084,40085,40086,25684,25685,40087,14974,40088,20326,40089,40090,21823,
+40091,40092,40093,25682,40094,40095,40096,40097,40098,40099,40100,40101,40102,
+40103,40104,25680,40105,40106,25678,40107,40108,40109,40110,40111,40112,40113,
+40114,40115,40116,40117,40118,40119,40120,40121,19813,18986,40122,40123,40124,
+16419,40125,15654,25683,40126,40127,14408,40128,40129,40130,40131,40132,25703,
+21556,40133,40134,40135,40136,40137,40138,40139,25691,40140,40141,40142,16751,
+40143,40144,25705,40145,40146,21095,40147,40148,25695,40149,25696,40150,40151,
+20266,40152,40153,40154,40155,19293,40156,25690,25681,40157,25701,40158,18524,
+25699,40159,40160,17511,25698,40161,25697,40162,40163,40164,13180,25704,40165,
+40166,40167,40168,13665,40169,40170,40171,22348,40172,40173,40174,25702,40175,
+15148,40176,22354,19535,27512,40177,25700,40178,40179,14710,40180,40181,40182,
+22093,25689,25692,17018,25694,40183,16971,16452,16976,40184,12661,19506,40185,
+40186,40187,40188,40189,40190,40256,40257,40258,40259,13646,40260,40261,40262,
+40263,25711,40264,40265,40266,40267,40268,40269,40270,40271,17967,40272,40273,
+40274,18017,40275,40276,25717,40277,40278,40279,40280,40281,16937,40282,40283,
+40284,16492,20829,25710,40285,40286,40287,40288,40289,40290,40291,40292,40293,
+40294,17454,40295,40296,40297,25709,40298,40299,40300,40301,25718,25716,17022,
+40302,25693,40303,25712,40304,19070,40305,21828,40306,40307,25713,40308,40309,
+40310,40311,40312,40313,40314,20858,40315,40316,40317,40318,40320,40321,40322,
+25707,25708,40323,40324,40325,25714,40326,20011,40327,40328,40329,40330,40331,
+40332,40333,40334,40335,40336,17739,40337,40338,40339,18225,40340,16954,40341,
+40342,40343,25706,40344,40345,40346,16714,40347,40348,40349,40350,40351,40352,
+19510,13105,40353,40354,40355,25723,40356,25715,40357,40358,40359,25722,40360,
+25725,40361,25724,40362,40363,40364,40365,40366,40367,40368,13134,40369,40370,
+40371,13114,25719,40372,40373,25721,25720,17772,40374,40375,40376,40377,40378,
+40379,40380,40381,40382,40383,40384,40385,40386,16445,40387,40388,40389,40390,
+21608,40391,40392,40393,40394,40395,25890,40396,40397,40398,40399,40400,40401,
+40402,40403,40404,40405,40406,12356,40407,40408,25892,40409,40410,25891,40411,
+40412,40413,40414,40415,40416,15396,40417,25893,40418,40419,40420,40421,40422,
+40423,25889,40424,40425,40426,40427,40428,40429,40430,25726,12660,40431,40432,
+40433,40434,40435,40436,40437,40438,40439,40440,40441,25896,40442,25897,25894,
+40443,40444,40445,40446,40512,40513,40514,40515,40516,40517,40518,40519,25895,
+25898,40520,40521,40522,40523,40524,40525,40526,40527,40528,40529,40530,40531,
+40532,40533,40534,40535,40536,40537,40538,40539,40540,40541,40542,40543,40544,
+40545,40546,40547,40548,40549,40550,40551,40552,18009,40553,40554,40555,40556,
+40557,40558,40559,40560,25899,25901,40561,40562,40563,40564,40565,40566,40567,
+25900,40568,40569,40570,40571,40572,40573,40574,40576,40577,40578,40579,40580,
+40581,40582,40583,40584,40585,25903,40586,40587,40588,25902,40589,40590,40591,
+40592,40593,40594,40595,40596,40597,40598,40599,40600,40601,40602,40603,40604,
+40605,40606,14688,40607,40608,25904,40609,40610,40611,40612,40613,40614,40615,
+40616,40617,40618,40619,40620,40621,40622,25905,40623,40624,40625,40626,40627,
+40628,40629,40630,40631,40632,40633,40634,15216,27745,17264,40635,13638,15186,
+40636,40637,40638,40639,16745,21614,40640,15940,40641,40642,40643,22342,40644,
+21590,12883,27710,40645,40646,40647,40648,27201,40649,40650,40651,16943,13366,
+40652,40653,40654,20823,40655,40656,40657,13108,40658,18482,16187,27712,40659,
+40660,22091,40661,40662,27711,27713,40663,40664,40665,40666,40667,40668,40669,
+40670,40671,40672,40673,40674,40675,27717,15974,19519,17754,15932,40676,27718,
+40677,12670,40678,40679,40680,27716,21800,13667,40681,27714,16694,13155,40682,
+40683,27715,19256,16451,19582,40684,40685,40686,40687,16722,40688,27720,40689,
+40690,40691,40692,40693,40694,40695,40696,40697,40698,40699,40700,40701,14950,
+16467,40702,22130,40768,40769,40770,20812,40771,40772,40773,40774,16190,40775,
+14131,18773,27719,15202,40776,19532,15741,18504,40777,20265,40778,40779,40780,
+40781,40782,40783,40784,19817,40785,17771,40786,40787,40788,14185,40789,40790,
+40791,40792,40793,40794,40795,40796,40797,40798,40799,20809,14904,40800,40801,
+40802,40803,40804,27721,40805,40806,27722,40807,15168,27723,40808,27746,12602,
+14169,40809,40810,40811,40812,40813,40814,40815,40816,40817,40818,40819,15673,
+40820,40821,40822,40823,40824,40825,40826,40827,27724,20838,27725,40828,40829,
+40830,40832,18491,40833,40834,40835,40836,40837,40838,40839,40840,40841,40842,
+40843,40844,40845,40846,27729,40847,40848,40849,40850,27731,40851,15181,40852,
+15461,40853,40854,40855,40856,40857,40858,40859,40860,40861,40862,40863,40864,
+40865,27727,40866,18743,40867,40868,40869,40870,40871,17210,40872,27747,21845,
+27728,40873,40874,40875,40876,40877,22131,40878,40879,40880,27730,27726,40881,
+40882,40883,40884,27732,40885,27733,40886,40887,18751,40888,40889,40890,40891,
+40892,40893,20264,40894,40895,40896,40897,40898,20572,40899,40900,40901,40902,
+20780,40903,40904,40905,40906,18523,40907,40908,40909,27734,20085,40910,40911,
+40912,40913,40914,19052,27738,40915,40916,40917,40918,40919,40920,40921,27737,
+40922,40923,40924,12350,40925,40926,40927,40928,40929,40930,27735,40931,27736,
+40932,40933,40934,27748,40935,40936,40937,40938,40939,40940,40941,40942,40943,
+18492,40944,40945,40946,40947,40948,40949,40950,40951,40952,40953,16711,40954,
+40955,40956,40957,40958,27740,20832,41024,41025,41026,41027,41028,41029,41030,
+41031,41032,41033,27739,41034,41035,41036,41037,21615,41038,27741,41039,41040,
+41041,41042,41043,41044,23366,41045,41046,41047,41048,41049,41050,41051,41052,
+41053,41054,27742,41055,41056,41057,41058,41059,41060,41061,41062,41063,41064,
+41065,41066,12588,41067,41068,41069,41070,41071,41072,41073,41074,41075,41076,
+41077,41078,41079,41080,41081,41082,41083,41084,41085,41086,41088,41089,27743,
+41090,41091,41092,41093,41094,41095,41096,41097,41098,41099,27744,41100,22310,
+41101,17728,41102,41103,41104,27452,12334,41105,41106,41107,15988,14392,21039,
+12374,13689,41108,22579,41109,19244,41110,25437,41111,41112,41113,41114,41115,
+41116,41117,17964,12390,41118,41119,41120,17734,27449,41121,41122,41123,41124,
+27450,41125,41126,41127,27451,41128,41129,20800,41130,17699,41131,27250,41132,
+17458,41133,17461,16462,41134,41135,41136,27251,17473,41137,20079,41138,41139,
+41140,41141,27248,27252,41142,41143,18812,41144,41145,18211,41146,41147,41148,
+19544,20094,41149,41150,41151,27253,27254,20268,16487,41152,41153,27255,41154,
+41155,41156,41157,41158,13887,27256,41159,27257,41160,27258,41161,41162,27259,
+41163,41164,41165,41166,41167,41168,41169,41170,41171,41172,41173,41174,27249,
+41175,41176,41177,41178,41179,41180,41181,41182,41183,41184,41185,41186,18478,
+24939,41187,14136,24940,41188,41189,41190,24941,41191,22324,24942,24943,21324,
+41192,41193,41194,41195,41196,41197,41198,24945,16241,24944,13650,41199,41200,
+41201,12599,41202,41203,41204,41205,24947,24946,41206,14972,41207,24948,41208,
+41209,41210,41211,14647,41212,15953,41213,41214,43584,43585,17532,43586,14941,
+15686,43587,43588,43589,43590,43591,43592,24949,24951,43593,43594,13888,20289,
+18984,24950,21880,21372,24952,24956,24953,43595,43596,24954,16490,43597,24958,
+25121,16455,43598,43599,43600,43601,24955,43602,24957,43603,43604,43605,43606,
+43607,43608,25125,43609,43610,43611,16724,43612,43613,43614,43615,25123,43616,
+25128,12926,25122,43617,43618,43619,17229,12866,25127,25126,43620,43621,25124,
+25129,43622,43623,25131,43624,43625,43626,20553,22125,17192,25132,43627,20311,
+43628,43629,25134,43630,43631,14959,43632,43633,26976,25133,25130,43634,43635,
+43636,43637,15147,21555,43638,43639,43640,43641,43642,43643,43644,43645,43646,
+43648,43649,43650,43651,25136,43652,43653,25135,43654,26977,43655,43656,43657,
+43658,25137,43659,43660,43661,43662,43663,43664,43665,43666,25138,43667,43668,
+43669,43670,43671,43672,43673,43674,43675,43676,43677,25139,19489,43678,25140,
+43679,43680,43840,43841,43842,43843,43844,43845,43846,43847,43848,43849,43850,
+43851,25141,43852,43853,43854,43855,43856,20606,43857,43858,16970,43859,21361,
+43860,19829,43861,43862,26464,43863,43864,26465,43865,43866,43867,43868,15937,
+43869,43870,43871,43872,17002,43873,43874,43875,26468,43876,43877,26467,43878,
+43879,43880,43881,43882,43883,19814,43884,17205,43885,43886,26466,15159,20310,
+43887,16737,26473,43888,43889,43890,26472,43891,43892,26484,12835,43893,43894,
+43895,43896,26474,43897,26470,43898,43899,43900,43901,43902,26476,26475,18746,
+43904,43905,21860,43906,26469,14121,26471,43907,43908,43909,43910,43911,43912,
+43913,26478,43914,43915,43916,43917,26483,43918,22121,43919,43920,43921,43922,
+26477,43923,26482,43924,26481,43925,43926,43927,12384,43928,43929,43930,43931,
+26485,43932,43933,43934,43935,43936,44096,44097,44098,44099,44100,44101,44102,
+44103,44104,44105,44106,18290,44107,16453,16493,44108,44109,16752,26480,44110,
+44111,44112,44113,26486,19318,44114,44115,44116,44117,44118,44119,44120,44121,
+44122,26658,26657,44123,44124,44125,44126,44127,44128,22337,44129,44130,26490,
+26489,44131,26491,44132,26487,44133,26494,44134,26493,44135,26492,44136,44137,
+16725,18265,17789,17731,44138,44139,44140,44141,44142,18285,44143,44144,44145,
+44146,26659,44147,44148,44149,44150,44151,44152,44153,44154,44155,44156,44157,
+44158,44160,44161,44162,44163,44164,44165,44166,26662,44167,26661,44168,26663,
+14967,26488,26660,44169,18544,18730,44170,44171,44172,44173,44174,44175,44176,
+44177,44178,44179,44180,44181,44182,26665,44183,44184,14693,44185,44186,44187,
+44188,44189,20862,26664,44190,44191,44192,44352,44353,44354,26666,44355,26669,
+26670,44356,16679,44357,44358,44359,26671,44360,44361,44362,26672,44363,44364,
+26668,44365,26676,44366,44367,44368,44369,44370,44371,44372,44373,44374,44375,
+44376,26667,44377,26673,44378,44379,44380,44381,44382,44383,44384,44385,26677,
+26674,26675,44386,44387,44388,44389,44390,44391,44392,44393,44394,44395,44396,
+44397,44398,44399,44400,44401,26679,44402,44403,44404,44405,44406,44407,44408,
+44409,44410,44411,44412,44413,44414,44416,44417,44418,44419,44420,44421,44422,
+44423,44424,44425,26678,44426,44427,44428,44429,44430,44431,44432,44433,44434,
+14671,44435,28716,44436,28717,44437,17968,12394,18495,44438,19807,44439,44440,
+44441,44442,44443,44444,44445,20045,27185,44446,44447,44448,44608,27186,44609,
+17983,13385,44610,44611,44612,44613,44614,44615,44616,27187,44617,44618,44619,
+44620,21863,44621,44622,44623,44624,44625,44626,44627,44628,23929,44629,27188,
+44630,27189,44631,27190,44632,44633,44634,44635,14410,24368,18805,44636,19568,
+44637,44638,18810,44639,44640,44641,44642,44643,18811,44644,44645,21315,19238,
+44646,14374,28718,12610,44647,25912,19567,21321,15447,18794,44648,13671,44649,
+17488,13673,44650,28206,15149,44651,44652,26462,44653,28207,44654,44655,44656,
+44657,13097,44658,44659,28210,44660,44661,28209,15719,44662,28208,20023,44663,
+44664,44665,44666,17743,44667,44668,44669,44670,16756,23374,28211,20595,44672,
+44673,44674,44675,44676,44677,44678,44679,16980,18024,44680,44681,44682,14124,
+44683,44684,44685,44686,44687,44688,44689,28212,44690,13163,44691,44692,44693,
+15227,28213,44694,44695,44696,44697,44698,26460,44699,44700,44701,28214,44702,
+44703,15662,44704,44864,44865,44866,29026,44867,44868,44869,19048,44870,21065,
+28762,44871,28763,44872,28764,16710,44873,14445,15950,44874,44875,28766,44876,
+17713,28765,20849,44877,28768,12364,15722,44878,44879,44880,44881,44882,21087,
+28767,44883,13359,14184,28774,28773,17955,28769,28770,13379,44884,44885,28771,
+21870,44886,44887,19547,15954,15410,44888,44889,44890,28776,28775,28772,12833,
+44891,22050,21304,15927,18476,44892,44893,28778,44894,44895,44896,44897,20855,
+44898,22092,14939,28777,44899,13883,44900,44901,19764,44902,44903,17958,44904,
+44905,44906,16673,28779,28782,44907,28781,28784,28780,44908,15166,28783,44909,
+44910,44911,44912,19509,28786,44913,44914,13141,44915,44916,44917,44918,12628,
+44919,44920,28787,44921,44922,28788,28790,13409,44923,28785,44924,28791,44925,
+44926,44928,44929,28794,44930,28792,44931,44932,44933,28789,44934,44935,44936,
+44937,28797,44938,28793,28796,28798,44939,28961,44940,44941,44942,20033,28964,
+44943,28963,44944,16758,28795,19037,44945,44946,13425,12657,19505,44947,28966,
+44948,44949,28967,44950,44951,28972,21838,28969,44952,44953,18483,44954,44955,
+44956,28962,44957,28971,28968,28965,44958,44959,28970,44960,45120,45121,45122,
+45123,45124,45125,45126,12329,28973,45127,45128,45129,45130,45131,45132,28975,
+45133,28977,45134,45135,45136,45137,45138,28976,45139,28974,45140,45141,45142,
+45143,20770,45144,45145,45146,45147,45148,45149,45150,28978,45151,45152,45153,
+28979,45154,45155,45156,45157,45158,45159,45160,45161,14703,45162,45163,13639,
+45164,12375,12377,45165,45166,45167,21613,45168,13636,45169,15700,15178,28711,
+45170,45171,14430,45172,45173,28712,45174,45175,12328,45176,28713,45177,45178,
+19822,45179,45180,28714,45181,45182,45184,45185,45186,45187,45188,45189,45190,
+45191,28715,45192,45193,45194,45195,45196,45197,45198,45199,45200,17956,45201,
+45202,22117,29028,45203,29029,45204,45205,45206,45207,45208,45209,45210,45211,
+45212,45213,17267,45214,45215,21339,45216,45376,22097,17768,45377,21295,45378,
+21094,45379,45380,28225,12347,21813,20814,15456,14928,45381,16248,45382,14407,
+13633,17740,45383,45384,18978,45385,45386,45387,17227,45388,45389,45390,45391,
+45392,28226,45393,45394,45395,45396,45397,45398,45399,45400,17471,13858,45401,
+28012,17188,45402,22065,45403,45404,45405,20320,28015,45406,45407,17742,45408,
+13916,45409,45410,18977,45411,45412,28013,45413,45414,28016,28017,17212,45415,
+16180,45416,28014,45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,
+45427,28020,28018,45428,45429,45430,45431,21862,17247,45432,28019,45433,45434,
+45435,28022,45436,21795,20771,45437,45438,45440,28021,45441,17232,45442,45443,
+45444,45445,45446,28023,16244,15980,28024,45447,19575,45448,20827,45449,45450,
+45451,22341,21878,45452,28028,45453,45454,45455,28027,45456,45457,45458,45459,
+45460,45461,45462,45463,28025,28026,45464,45465,45466,45467,45468,45469,45470,
+45471,28029,15910,45472,45632,45633,45634,45635,19247,28193,13885,45636,28194,
+17472,45637,28030,45638,45639,15710,12871,45640,45641,45642,45643,45644,45645,
+45646,45647,45648,45649,45650,45651,13891,45652,45653,45654,28197,22586,28195,
+28198,45655,45656,45657,17257,13170,45658,45659,45660,45661,45662,45663,28199,
+28196,20281,45664,45665,28200,17015,45666,45667,45668,45669,45670,45671,45672,
+45673,45674,45675,45676,45677,28201,28202,45678,24107,45679,45680,17971,45681,
+18246,45682,22133,13641,45683,19250,45684,45685,45686,28203,45687,45688,19755,
+45689,28204,45690,45691,45692,45693,45694,21808,45696,28205,45697,30276,45698,
+45699,45700,45701,45702,45703,45704,45705,45706,45707,45708,45709,45710,23367,
+45711,45712,45713,45714,45715,45716,45717,45718,45719,13347,45720,45721,45722,
+17196,29030,45723,45724,45725,45726,45727,19000,21075,45728,22058,45888,28530,
+45889,15960,45890,15683,28531,13900,12331,45891,45892,45893,45894,18991,45895,
+45896,27958,45897,27959,45898,45899,45900,45901,20089,14127,16243,27960,17003,
+18736,45902,45903,45904,45905,45906,45907,27961,45908,45909,18038,16179,45910,
+45911,45912,27964,17784,45913,20816,45914,22313,27962,27963,45915,20834,45916,
+27967,27968,45917,27972,45918,45919,45920,27976,45921,27974,27982,21864,45922,
+27977,45923,45924,27975,27966,45925,45926,17769,45927,45928,45929,17990,45930,
+45931,18793,21586,27969,27970,27971,27973,45932,16505,45933,13345,45934,45935,
+45936,45937,14696,45938,27984,45939,45940,45941,45942,27985,45943,27978,45944,
+27983,45945,20088,45946,45947,19254,27980,27981,45948,45949,45950,45952,45953,
+20341,45954,45955,45956,45957,45958,45959,45960,45961,45962,45963,45964,45965,
+27986,16754,21298,27979,18487,45966,45967,45968,45969,45970,45971,45972,45973,
+15471,45974,45975,45976,45977,17776,45978,45979,45980,45981,45982,45983,45984,
+46144,46145,46146,27990,46147,13679,46148,46149,16949,12333,19305,46150,46151,
+12590,46152,27988,46153,46154,46155,19819,13666,46156,27989,27987,27991,46157,
+46158,13690,46159,27992,46160,27993,46161,27996,46162,12620,46163,46164,46165,
+46166,46167,46168,46169,46170,17782,15470,27994,19516,12906,46171,46172,46173,
+46174,27995,46175,46176,46177,46178,17515,46179,46180,13381,46181,46182,46183,
+12405,46184,46185,46186,27999,16474,13416,46187,46188,46189,46190,17741,46191,
+46192,46193,27997,16196,46194,46195,46196,27998,46197,46198,46199,46200,46201,
+46202,46203,46204,46205,46206,46208,46209,46210,46211,17445,46212,46213,46214,
+28000,46215,46216,46217,46218,46219,28001,46220,28003,46221,46222,16727,46223,
+46224,15175,46225,46226,46227,46228,46229,46230,15672,46231,46232,46233,28002,
+46234,46235,46236,46237,46238,46239,46240,46400,46401,46402,46403,46404,46405,
+28004,46406,46407,46408,46409,46410,46411,46412,46413,46414,46415,28006,46416,
+46417,46418,46419,46420,28005,46421,46422,46423,46424,46425,46426,46427,46428,
+46429,46430,46431,46432,46433,46434,46435,28007,46436,46437,46438,46439,46440,
+19006,27754,16497,46441,18791,46442,27755,18030,46443,46444,46445,46446,27756,
+46447,18029,27757,46448,46449,46450,46451,46452,46453,46454,46455,46456,27760,
+46457,46458,22374,27763,46459,46460,27761,27758,27759,22307,18801,19310,27764,
+46461,27762,46462,46464,20329,46465,27766,17969,46466,46467,46468,46469,15424,
+46470,27765,46471,46472,46473,46474,46475,46476,46477,13627,15222,46478,27767,
+46479,46480,46481,46482,46483,22903,15739,46484,46485,16955,27768,46486,46487,
+46488,46489,27769,46490,46491,46492,46493,14371,46494,46495,46496,46656,46657,
+46658,46659,46660,46661,46662,27770,46663,46664,46665,46666,46667,46668,46669,
+46670,46671,46672,46673,46674,27771,46675,46676,46677,46678,46679,46680,46681,
+46682,46683,46684,46685,27772,46686,46687,46688,46689,46690,21357,22574,16491,
+46691,18269,14924,46692,20579,19261,46693,19770,46694,46695,14417,46696,46697,
+12668,46698,18287,46699,22102,46700,46701,46702,16198,17259,46703,46704,28533,
+46705,46706,17240,46707,46708,46709,46710,46711,46712,22370,46713,46714,46715,
+28535,13139,46716,18264,20845,46717,22088,46718,28536,46720,28534,46721,15229,
+13126,46722,46723,46724,46725,46726,46727,46728,15701,46729,46730,21062,46731,
+15200,46732,46733,20257,46734,28540,28539,46735,46736,28537,46737,46738,46739,
+46740,13132,46741,18772,19248,46742,46743,46744,46745,46746,28542,46747,46748,
+12382,46749,46750,22089,46751,46752,46912,28541,46913,13165,46914,46915,30293,
+46916,46917,46918,46919,46920,46921,46922,46923,46924,46925,46926,46927,46928,
+46929,46930,20040,46931,46932,46933,28706,46934,28705,46935,13630,15450,15228,
+46936,14437,46937,46938,46939,46940,46941,46942,17474,46943,46944,46945,46946,
+46947,46948,46949,46950,46951,46952,28707,46953,46954,46955,46956,46957,19307,
+46958,46959,46960,46961,46962,46963,46964,46965,46966,46967,46968,46969,46970,
+46971,46972,46973,46974,46976,46977,46978,46979,46980,46981,46982,28710,46983,
+46984,46985,20776,46986,15935,18286,28982,28983,16213,46987,46988,46989,46990,
+13353,28984,19771,46991,18260,21805,46992,28985,46993,28986,46994,46995,46996,
+46997,18255,46998,46999,47000,21028,22095,47001,47002,28987,15697,13360,15933,
+47003,47004,47005,13404,20049,47006,16223,28989,47007,47008,47168,47169,16250,
+28988,47170,28991,47171,47172,47173,28990,28992,47174,47175,47176,47177,47178,
+28993,47179,47180,47181,47182,47183,47184,47185,47186,47187,47188,47189,16766,
+47190,47191,47192,47193,47194,47195,47196,47197,47198,47199,47200,16674,47201,
+47202,47203,47204,47205,47206,47207,47208,47209,47210,19066,47211,47212,21822,
+47213,47214,47215,47216,15930,15929,21826,47217,47218,16162,47219,19759,28981,
+47220,47221,47222,47223,47224,47225,15711,47226,13899,47227,47228,47229,47230,
+47232,47233,47234,47235,47236,22129,29507,47237,47238,29508,47239,14413,47240,
+47241,47242,29510,29511,47243,12362,47244,29509,47245,29513,19313,47246,47247,
+47248,29515,47249,20518,47250,47251,12618,29512,47252,47253,47254,29519,47255,
+13649,47256,47257,29527,47258,29522,47259,47260,47261,29524,29523,14203,47262,
+12607,47263,29518,29514,13658,47264,29520,47424,47425,29521,47426,29525,47427,
+47428,47429,47430,29517,47431,15459,47432,16765,47433,29526,47434,47435,47436,
+47437,47438,47439,29530,47440,29516,47441,13640,47442,15726,29532,47443,47444,
+14116,16240,22142,19762,47445,13424,47446,12895,47447,29528,47448,29529,18744,
+47449,29533,47450,47451,29534,47452,29537,47453,47454,47455,47456,47457,47458,
+47459,47460,47461,47462,47463,29535,47464,47465,29539,29538,47466,47467,29531,
+47468,16234,47469,13167,47470,29536,47471,47472,18217,47473,15474,47474,47475,
+47476,47477,29547,47478,47479,47480,47481,47482,47483,47484,14655,47485,47486,
+29540,47488,47489,47490,12845,15230,47491,19299,47492,47493,47494,47495,29549,
+29545,47496,47497,47498,14684,29550,47499,47500,47501,29541,29542,29546,16993,
+29548,29551,29544,15485,47502,47503,47504,20324,47505,47506,29552,47507,47508,
+47509,29543,47510,47511,47512,47513,47514,47515,47516,47517,29554,47518,47519,
+47520,47680,22317,17962,47681,47682,47683,47684,29555,47685,47686,47687,47688,
+29553,47689,16936,47690,47691,47692,47693,47694,14429,29557,47695,47696,29556,
+47697,47698,47699,13403,47700,47701,47702,29558,29559,47703,47704,47705,29560,
+47706,47707,47708,16442,47709,47710,16489,47711,47712,47713,47714,47715,17777,
+47716,47717,47718,47719,29563,47720,29562,47721,47722,47723,47724,47725,47726,
+47727,47728,13400,47729,47730,47731,29566,29561,47732,47733,29564,47734,47735,
+47736,47737,47738,47739,29565,47740,47741,47742,47744,47745,47746,47747,47748,
+29729,47749,47750,47751,47752,47753,47754,29731,15177,47755,47756,29730,47757,
+47758,47759,47760,47761,47762,47763,47764,47765,47766,47767,47768,47769,29732,
+47770,47771,47772,47773,47774,47775,12862,29734,29733,47776,47936,47937,47938,
+47939,47940,47941,47942,47943,47944,47945,15406,47946,47947,47948,47949,47950,
+47951,47952,47953,47954,47955,47956,47957,47958,47959,47960,47961,47962,47963,
+47964,47965,47966,47967,47968,47969,47970,47971,47972,47973,47974,47975,47976,
+47977,47978,47979,47980,47981,47982,17239,22881,47983,47984,47985,47986,47987,
+47988,16480,29772,22353,47989,47990,47991,47992,47993,47994,47995,47996,47997,
+47998,48000,14171,48001,48002,48003,48004,48005,48006,48007,29774,16675,48008,
+48009,17993,48010,13398,21811,48011,48012,48013,29776,29775,29777,19290,48014,
+48015,29778,48016,21569,22112,48017,48018,48019,48020,14176,48021,48022,48023,
+16696,48024,48025,16699,29779,15916,48026,48027,48028,48029,48030,13410,48031,
+48032,29780,29781,15915,48192,48193,29782,48194,48195,48196,29787,48197,29783,
+29786,48198,14973,48199,29784,29785,48200,48201,48202,48203,48204,48205,48206,
+14434,19527,29788,48207,12890,48208,48209,17235,48210,48211,21603,16183,48212,
+48213,48214,48215,48216,48217,48218,29789,48219,48220,48221,48222,48223,48224,
+17716,48225,48226,48227,48228,48229,48230,48231,48232,29801,48233,48234,20277,
+48235,48236,48237,48238,48239,48240,48241,48242,48243,48244,48245,48246,48247,
+48248,20041,48249,48250,48251,48252,48253,48254,48256,48257,48258,48259,48260,
+48261,48262,48263,48264,48265,48266,48267,48268,48269,48270,19288,48271,19319,
+48272,48273,48274,48275,15732,48276,48277,48278,22351,48279,48280,48281,16475,
+48282,48283,48284,48285,48286,48287,48288,48448,48449,48450,48451,48452,48453,
+48454,48455,48456,48457,48458,48459,48460,48461,48462,48463,48464,48465,48466,
+48467,48468,48469,48470,48471,48472,48473,48474,48475,48476,48477,48478,48479,
+48480,48481,48482,48483,48484,48485,48486,48487,48488,48489,48490,48491,48492,
+48493,48494,48495,48496,48497,48498,48499,48500,48501,48502,20597,48503,48504,
+48505,48506,48507,48508,48509,48510,29802,48512,48513,48514,48515,48516,48517,
+48518,48519,48520,48521,48522,48523,48524,48525,48526,48527,48528,48529,48530,
+48531,48532,48533,48534,48535,48536,48537,48538,48539,48540,48541,48542,48543,
+48544,48704,48705,48706,48707,48708,48709,48710,48711,48712,48713,48714,48715,
+48716,29803,48717,48718,48719,48720,48721,48722,48723,29804,48724,48725,48726,
+48727,48728,48729,48730,48731,48732,48733,48734,48735,48736,48737,48738,48739,
+48740,48741,48742,48743,48744,48745,48746,48747,48748,48749,48750,48751,48752,
+48753,48754,48755,48756,48757,48758,48759,48760,48761,48762,48763,48764,48765,
+48766,48768,48769,48770,48771,48772,48773,48774,48775,48776,48777,48778,48779,
+48780,48781,48782,48783,48784,48785,48786,48787,48788,48789,48790,48791,48792,
+48793,48794,48795,48796,48797,48798,48799,48800,48960,48961,48962,48963,48964,
+48965,48966,48967,48968,48969,48970,48971,48972,48973,48974,48975,48976,48977,
+48978,48979,48980,48981,48982,48983,48984,48985,48986,48987,48988,48989,48990,
+48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,49001,49002,49003,
+49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,49014,49015,49016,
+49017,49018,49019,49020,49021,49022,49024,30563,49025,49026,49027,49028,49029,
+14129,49030,49031,49032,49033,49034,29805,49035,49036,49037,49038,49039,49040,
+49041,49042,49043,49044,49045,49046,49047,49048,49049,49050,49051,49052,49053,
+49054,49055,49056,49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,
+49226,49227,49228,49229,49230,49231,49232,49233,49234,49235,49236,49237,49238,
+49239,49240,49241,49242,49243,49244,49245,49246,49247,49248,49249,49250,49251,
+22379,49252,49253,49254,49255,49256,49257,49258,49259,49260,49261,49262,49263,
+49264,49265,49266,49267,49268,49269,49270,49271,49272,49273,49274,49275,29806,
+49276,49277,49278,26233,15936,26234,14956,26235,20299,26236,21564,15414,26237,
+26238,15437,18514,20019,26401,49280,13375,26402,18740,14425,17481,49281,22365,
+16986,14167,22077,20038,14148,49282,49283,17702,26403,20319,26404,26405,26406,
+16695,22377,18800,20280,22063,22101,26407,12397,26408,26409,18780,21103,15917,
+26410,12403,18526,15713,26411,18502,49284,26412,15206,14456,20772,26413,16999,
+15992,15690,19763,26414,26415,15982,20581,49285,19303,19536,15436,26416,15400,
+20599,26417,49286,20600,26418,26419,13378,26420,26421,18814,20012,17248,26423,
+12609,13169,49287,26424,26425,22363,21824,26426,16972,22330,26427,26428,26429,
+15466,17253,16450,26430,26431,15401,49288,26432,26433,26422,13904,26434,49289,
+26435,26436,15162,13662,16966,12640,26437,21557,26438,14399,26440,26439,14188,
+49290,26441,12920,26442,26443,26444,26445,26446,26447,26448,21287,19317,26449,
+26450,26451,26452,18761,26453,26454,26455,26456,26457,15689,26458,29502,49291,
+14423,49292,18481,49293,49294,49295,49296,49297,49298,49299,29503,49300,29504,
+29505,49301,49302,49303,49304,49305,49306,49307,49308,49309,49310,14686,19832,
+49311,49312,22632,14897,49472,16990,28215,49473,14115,49474,49475,49476,49477,
+28217,49478,28216,12373,49479,49480,49481,49482,49483,28219,21846,22383,49484,
+49485,49486,22083,49487,49488,28221,19056,49489,28220,49490,49491,49492,49493,
+28222,49494,49495,49496,49497,28224,49498,49499,28223,49500,49501,49502,49503,
+49504,49505,49506,49507,20850,49508,18236,49509,17216,49510,49511,49512,49513,
+49514,14433,49515,49516,49517,49518,49519,16743,49520,49521,29766,20575,29767,
+49522,20315,49523,49524,18490,49525,49526,29768,49527,49528,49529,49530,49531,
+49532,49533,29769,29770,49534,29771,49536,49537,49538,49539,49540,22906,14462,
+49541,49542,25969,21360,49543,29792,49544,20044,49545,49546,49547,13153,49548,
+49549,49550,49551,28980,49552,21102,49553,29793,49554,49555,49556,49557,49558,
+20328,29794,49559,49560,18252,49561,49562,49563,49564,49565,49566,13652,13412,
+29796,49567,49568,49728,29795,29797,49729,49730,29798,49731,49732,49733,49734,
+29799,49735,14898,12351,49736,29800,49737,49738,49739,49740,49741,49742,49743,
+14125,21101,49744,49745,49746,21035,16463,49747,16188,27427,21855,27208,49748,
+49749,49750,49751,29043,13944,19235,49752,49753,17485,49754,29031,49755,29032,
+14459,29033,14916,21573,12370,49756,49757,29034,49758,49759,49760,29035,49761,
+29036,49762,49763,29037,29038,29039,29041,29040,17749,49764,49765,49766,49767,
+49768,49769,29042,49770,13946,49771,29044,21038,24135,19274,49772,49773,13148,
+49774,13602,49775,14626,49776,49777,17524,29045,49778,49779,29046,49780,49781,
+49782,16708,16763,22064,29047,49783,49784,49785,49786,29048,49787,16682,49788,
+49789,49790,17976,49792,15963,49793,49794,49795,49796,49797,49798,49799,49800,
+49801,49802,49803,49804,49805,49806,29049,13391,49807,49808,49809,49810,49811,
+49812,29050,49813,49814,49815,49816,49817,49818,49819,49820,49821,49822,49823,
+49824,49984,27954,27953,49985,49986,19296,21086,49987,19265,21848,49988,18530,
+49989,16479,15393,49990,49991,49992,49993,49994,49995,27457,49996,49997,20516,
+49998,22114,49999,13895,14424,27456,14414,50000,27455,13094,14665,22059,50001,
+14196,14154,50002,50003,50004,15463,14142,27462,50005,27463,12345,16207,50006,
+27461,21373,50007,27464,50008,50009,27465,50010,50011,14158,50012,27458,27460,
+18806,22103,21837,20530,27471,20024,27472,50013,13608,50014,50015,50016,50017,
+50018,12595,27474,19493,50019,50020,50021,50022,50023,50024,50025,17750,27475,
+50026,27473,17759,27470,18980,27477,12411,50027,50028,14970,50029,50030,22583,
+29027,50031,27466,27467,27468,27469,27478,26176,27481,50032,16232,21064,27479,
+27484,14444,27480,50033,15674,50034,20568,50035,12343,50036,27485,17500,50037,
+50038,50039,50040,22060,50041,50042,50043,13408,50044,50045,17014,15417,50046,
+50048,27482,27483,21600,18026,17492,27487,17703,22901,50049,12849,50050,27492,
+50051,15685,50052,50053,50054,27490,50055,50056,50057,50058,50059,50060,50061,
+50062,50063,50064,50065,50066,50067,27491,50068,50069,14380,50070,19793,27493,
+50071,50072,50073,27489,50074,16691,50075,50076,50077,50078,50079,17954,50080,
+50240,50241,50242,50243,50244,50245,19571,50246,27494,50247,16432,21048,27495,
+50248,50249,50250,14383,14381,50251,27496,18235,19827,50252,50253,50254,27498,
+27499,50255,50256,50257,50258,50259,27501,50260,50261,50262,50263,20552,50264,
+27506,50265,27502,50266,50267,50268,27505,18553,50269,20860,27500,50270,50271,
+27497,50272,50273,50274,50275,14393,20313,17509,27503,27504,19546,19784,12402,
+50276,27510,50277,50278,50279,50280,50281,27509,50282,12850,50283,50284,50285,
+50286,14432,50287,27511,50288,50289,50290,50291,50292,50293,12652,50294,50295,
+19525,17444,20261,50296,50297,50298,50299,50300,27513,50301,50302,27682,50304,
+17778,50305,27514,50306,50307,50308,50309,50310,50311,50312,50313,18757,50314,
+50315,50316,50317,50318,50319,25183,27518,50320,50321,50322,50323,19790,27681,
+12635,21303,50324,50325,21084,50326,50327,50328,27517,50329,27515,50330,50331,
+50332,50333,50334,50335,50336,50496,50497,50498,50499,50500,50501,50502,50503,
+50504,50505,50506,50507,50508,50509,50510,13116,50511,50512,50513,27184,50514,
+50515,22356,50516,29739,13172,50517,50518,50519,50520,50521,22081,22082,50522,
+50523,50524,50525,50526,50527,21865,15946,50528,29735,50529,21032,29736,29737,
+50530,29738,15947,21343,50531,50532,50533,50534,50535,18784,18785,50536,50537,
+29506,50538,19046,50539,19570,50540,50541,50542,50543,50544,50545,25142,19252,
+50546,20072,22107,50547,29741,29742,29743,50548,50549,50550,50551,29746,50552,
+14909,29747,12387,29744,50553,29745,15650,12885,50554,29750,29751,13926,12848,
+20303,29748,13356,50555,29749,50556,50557,29752,50558,50560,50561,50562,50563,
+29753,50564,50565,19751,50566,29754,50567,29755,50568,50569,50570,29756,50571,
+50572,50573,50574,50575,50576,50577,50578,19282,50579,29757,50580,50581,50582,
+50583,29758,50584,50585,50586,50587,50588,50589,50590,50591,29759,50592,50752,
+50753,50754,50755,29790,16700,15464,50756,18731,20830,25973,50757,50758,50759,
+50760,23603,21077,50761,50762,23604,12332,23605,50763,50764,15706,50765,23609,
+50766,50767,50768,22594,50769,23607,21363,50770,18774,23610,23606,50771,23611,
+17186,50772,50773,50774,50775,23612,23621,23613,50776,50777,20063,22053,50778,
+23631,50779,23629,50780,50781,23634,15718,16939,50782,23608,23627,23630,23614,
+14162,12357,23623,20542,23617,15144,50783,14140,23628,50784,50785,23622,23615,
+18267,50786,50787,50788,20799,23616,50789,50790,23626,50791,50792,23632,50793,
+50794,20013,23618,50795,23619,23624,23625,12884,23633,19285,50796,21559,23643,
+23647,19494,23654,50797,17255,23644,50798,50799,16193,23641,50800,12410,14646,
+23653,23635,50801,23620,23638,18548,16224,50802,50803,50804,50805,18747,50806,
+50807,50808,12605,50809,21282,50810,50811,23642,50812,50813,23637,50814,17979,
+50816,23646,50817,50818,50819,50820,50821,22338,17199,14134,18257,17193,23650,
+23640,23659,23636,50822,50823,23645,50824,15909,23639,50825,23648,50826,50827,
+23651,23652,50828,23672,50829,50830,23649,23842,23655,50831,50832,50833,50834,
+50835,50836,50837,50838,50839,50840,15467,13380,50841,50842,17187,12903,23674,
+50843,23666,50844,23663,50845,23676,23662,21104,12904,50846,18519,18531,23675,
+50847,23661,50848,51008,51009,23671,51010,51011,23669,51012,51013,15907,23668,
+51014,12893,51015,51016,51017,51018,51019,23667,15478,23656,15172,51020,16499,
+51021,51022,51023,51024,51025,15444,23657,23658,51026,23665,23670,23673,13620,
+51027,18521,15207,23678,23677,21291,23841,23843,23845,21105,23844,23846,23847,
+21033,51028,51029,51030,51031,51032,51033,51034,14921,23849,51035,51036,23862,
+23857,23860,51037,51038,51039,51040,51041,51042,51043,23856,17998,51044,51045,
+16498,51046,51047,51048,51049,18735,51050,51051,51052,23660,23854,51053,51054,
+51055,51056,23863,51057,51058,23664,23855,51059,23864,51060,23852,51061,51062,
+51063,51064,51065,51066,51067,23865,23859,23853,17450,51068,51069,51070,51072,
+23848,16435,16683,23850,23851,51073,23858,15217,23861,21288,23866,51074,23867,
+17191,51075,51076,23890,23868,51077,51078,51079,23889,51080,14653,51081,51082,
+15957,51083,15994,51084,51085,14922,51086,51087,51088,51089,23882,51090,23877,
+51091,23871,51092,51093,51094,12875,23875,51095,23883,12836,23893,51096,51097,
+51098,23870,51099,51100,51101,18000,23888,51102,51103,51104,51264,51265,23892,
+16738,14150,51266,51267,51268,51269,51270,23886,23887,51271,51272,51273,23876,
+51274,51275,51276,23869,51277,23885,19537,51278,23881,51279,51280,51281,51282,
+23874,17224,17980,20014,23884,51283,23880,51284,51285,51286,51287,51288,51289,
+23873,51290,51291,51292,23878,16988,51293,51294,51295,51296,51297,51298,21289,
+21290,23891,20340,18552,51299,51300,51301,51302,51303,51304,51305,51306,23910,
+51307,51308,51309,51310,51311,51312,23879,51313,51314,51315,23904,16996,51316,
+51317,51318,51319,51320,51321,51322,51323,23905,51324,51325,51326,51328,51329,
+51330,51331,51332,51333,51334,23895,51335,51336,51337,51338,51339,22136,51340,
+23897,23896,14448,23894,51341,51342,51343,51344,17999,51345,13869,51346,51347,
+51348,51349,51350,23906,51351,14969,21601,23911,51352,51353,51354,13392,51355,
+23898,51356,16251,23907,51357,23903,51358,23901,51359,51360,51520,51521,51522,
+51523,51524,13657,51525,51526,51527,51528,23899,23900,23902,51529,15663,23908,
+51530,23909,51531,51532,51533,51534,51535,51536,51537,51538,23925,51539,17225,
+51540,51541,19298,51542,51543,51544,51545,23922,51546,51547,51548,51549,51550,
+51551,51552,51553,51554,51555,51556,51557,51558,22625,51559,51560,18001,51561,
+23924,51562,51563,51564,21876,23923,23920,51565,51566,23916,51567,23919,51568,
+23912,51569,51570,20590,51571,51572,51573,51574,18520,23918,51575,51576,23913,
+51577,51578,23914,19314,51579,23917,51580,51581,12621,51582,51584,51585,51586,
+51587,51588,16438,51589,15419,23921,51590,51591,23927,51592,23926,23915,51593,
+51594,51595,51596,51597,17774,51598,51599,51600,23931,51601,51602,51603,51604,
+51605,51606,51607,51608,51609,51610,51611,24100,51612,51613,24099,51614,51615,
+51616,51776,51777,51778,51779,51780,51781,51782,51783,51784,23928,51785,51786,
+51787,51788,17263,51789,17019,51790,51791,51792,21857,51793,51794,20021,51795,
+51796,51797,51798,23933,51799,12876,51800,51801,51802,51803,51804,51805,51806,
+51807,51808,17512,19039,51809,51810,51811,51812,51813,51814,51815,51816,51817,
+51818,18238,23930,23932,23934,24098,12330,12622,51819,51820,51821,51822,51823,
+24108,51824,51825,51826,51827,24102,15670,18543,51828,51829,51830,51831,51832,
+51833,51834,51835,51836,51837,51838,24097,51840,51841,24101,51842,51843,51844,
+51845,24105,51846,51847,51848,51849,51850,24104,51851,51852,51853,24103,51854,
+51855,51856,51857,51858,51859,51860,51861,51862,24109,51863,21580,51864,51865,
+51866,51867,24115,24106,24110,51868,51869,16473,51870,51871,51872,52032,52033,
+12577,24118,52034,24113,52035,52036,52037,52038,52039,52040,52041,24114,52042,
+52043,52044,52045,52046,52047,52048,52049,52050,52051,52052,20774,24117,52053,
+52054,52055,52056,52057,52058,52059,24111,52060,52061,52062,24112,52063,20541,
+52064,52065,52066,24116,19053,24121,52067,52068,52069,52070,52071,52072,24120,
+52073,24119,52074,52075,52076,52077,52078,52079,52080,24123,52081,52082,52083,
+52084,52085,52086,52087,15717,52088,52089,52090,52091,52092,12888,17258,52093,
+52094,24122,52096,17722,52097,52098,52099,52100,52101,52102,24124,52103,52104,
+52105,52106,52107,52108,52109,19545,52110,52111,52112,52113,14122,52114,52115,
+52116,52117,52118,52119,52120,52121,52122,52123,52124,52125,52126,52127,52128,
+52288,52289,21605,52290,52291,52292,24125,52293,52294,52295,52296,52297,24127,
+52298,52299,52300,52301,52302,52303,52304,52305,52306,52307,52308,17442,52309,
+52310,52311,52312,24129,52313,52314,52315,52316,52317,52318,52319,52320,52321,
+52322,52323,52324,52325,52326,52327,52328,24126,52329,24128,52330,52331,52332,
+52333,52334,52335,52336,52337,52338,52339,52340,52341,52342,52343,21818,52344,
+52345,52346,24130,52347,52348,52349,52350,52352,52353,52354,52355,52356,52357,
+52358,52359,52360,52361,52362,52363,29230,15138,16946,17712,16967,52364,52365,
+29231,52366,52367,52368,52369,52370,20585,52371,52372,52373,21341,52374,52375,
+52376,27453,52377,52378,52379,52380,52381,52382,52383,52384,13158,29232,52544,
+29233,52545,52546,18989,52547,52548,52549,52550,52551,52552,52553,14951,29235,
+29237,29236,19300,20282,29234,18996,21071,17004,52554,52555,52556,52557,52558,
+52559,52560,20035,29240,12406,29239,52561,52562,52563,52564,52565,29246,52566,
+12879,52567,52568,52569,52570,52571,52572,20801,29242,52573,52574,52575,52576,
+52577,29244,21609,52578,52579,29243,29238,29247,29245,52580,29241,52581,52582,
+29255,29252,29254,52583,52584,29258,29250,29248,52585,52586,52587,29253,52588,
+52589,52590,52591,52592,22139,52593,52594,52595,29249,52596,18297,18783,52597,
+29256,14662,13616,52598,52599,29251,29257,29264,29270,52600,52601,15191,52602,
+52603,52604,29269,19804,52605,22123,52606,52608,29266,29268,52609,52610,52611,
+52612,14450,52613,52614,52615,52616,29259,52617,52618,52619,29262,17017,52620,
+21853,29260,29261,29263,29267,52621,52622,52623,29273,21308,52624,52625,52626,
+52627,13930,52628,19057,52629,14180,29271,52630,52631,52632,29272,29274,29277,
+29275,52633,52634,29276,52635,52636,52637,52638,20817,29265,52639,19785,52640,
+20047,22057,52800,29283,52801,17243,52802,29280,52803,52804,16431,29292,29278,
+52805,29281,52806,52807,52808,29288,52809,52810,52811,52812,29282,52813,52814,
+29287,52815,52816,29286,52817,52818,29289,52819,52820,52821,29279,52822,52823,
+29284,29290,52824,52825,52826,52827,52828,52829,52830,21292,29285,12917,52831,
+52832,29298,52833,20523,52834,52835,52836,52837,29301,52838,52839,52840,15176,
+52841,29305,52842,52843,52844,52845,52846,52847,29296,52848,52849,29302,29304,
+29306,52850,52851,52852,52853,52854,52855,52856,52857,29299,52858,29297,52859,
+52860,52861,14971,52862,13691,52864,52865,52866,52867,29295,29303,29293,29294,
+52868,52869,52870,29291,29478,52871,29475,52872,52873,29474,52874,52875,29300,
+52876,18522,52877,52878,52879,52880,52881,29307,52882,52883,52884,29477,52885,
+52886,52887,52888,52889,52890,52891,17272,52892,52893,52894,52895,52896,53056,
+53057,53058,29309,53059,53060,29479,29481,29476,53061,29308,53062,53063,53064,
+29483,53065,29482,53066,53067,53068,53069,16989,53070,53071,29486,53072,53073,
+29488,53074,53075,53076,53077,53078,29473,53079,53080,53081,29489,29484,53082,
+53083,53084,53085,53086,29487,29310,29485,53087,53088,53089,53090,53091,53092,
+53093,29490,53094,53095,53096,53097,29492,53098,53099,53100,53101,29480,53102,
+53103,53104,53105,29491,53106,53107,53108,29493,53109,53110,53111,53112,53113,
+53114,53115,53116,53117,53118,20535,53120,53121,53122,53123,29496,53124,53125,
+53126,53127,22905,53128,53129,53130,53131,53132,53133,29497,53134,53135,53136,
+53137,53138,53139,53140,53141,29495,53142,18532,29494,53143,53144,53145,53146,
+29498,53147,53148,53149,53150,53151,29499,13376,53152,53312,53313,53314,53315,
+53316,53317,53318,53319,53320,53321,53322,53323,53324,53325,28227,53326,53327,
+53328,53329,53330,53331,29500,53332,53333,29501,53334,53335,53336,20778,53337,
+53338,53339,29740,20550,53340,53341,53342,53343,53344,53345,20560,20828,53346,
+53347,53348,53349,53350,53351,20302,53352,53353,15702,53354,20803,53355,53356,
+53357,53358,53359,53360,53361,14946,24937,21058,28994,12857,53362,53363,12653,
+28995,53364,18752,13124,53365,22898,53366,19237,53367,28996,53368,53369,53370,
+53371,22100,53372,53373,53374,53376,53377,28997,29760,28998,53378,21548,28999,
+53379,12352,29761,53380,53381,29762,53382,53383,13436,53384,17755,53385,53386,
+53387,53388,19515,53389,53390,53391,20580,53392,53393,53394,53395,53396,19808,
+53397,53398,53399,53400,53401,29000,53402,22899,53403,53404,53405,53406,53407,
+53408,12603,53568,20270,53569,53570,53571,14372,53572,53573,53574,53575,53576,
+29002,53577,53578,53579,53580,29003,53581,53582,53583,53584,12867,16721,53585,
+53586,22320,29001,53587,53588,29004,53589,53590,53591,53592,29006,53593,53594,
+53595,22902,53596,21089,21539,53597,53598,29763,18489,53599,53600,53601,53602,
+53603,29764,53604,53605,29005,29007,16227,29008,53606,53607,29012,53608,53609,
+53610,53611,53612,53613,53614,29014,29009,53615,18769,17761,53616,53617,53618,
+16995,14716,53619,53620,29011,53621,29013,53622,53623,53624,14675,53625,53626,
+53627,53628,53629,53630,53632,29019,53633,53634,53635,53636,53637,14934,53638,
+12413,29017,53639,53640,53641,53642,53643,29016,29010,29018,53644,53645,53646,
+53647,53648,29015,53649,53650,53651,18540,53652,53653,53654,53655,19786,29021,
+53656,53657,53658,53659,25917,53660,53661,53662,29020,53663,29022,53664,53824,
+53825,53826,53827,53828,53829,53830,53831,53832,29023,53833,53834,20325,53835,
+53836,53837,53838,53839,53840,53841,53842,53843,53844,53845,53846,53847,53848,
+53849,53850,53851,53852,53853,53854,53855,53856,53857,53858,53859,29765,15731,
+53860,53861,53862,53863,53864,53865,29024,53866,53867,53868,53869,53870,53871,
+53872,53873,53874,53875,53876,53877,53878,53879,53880,53881,53882,53883,53884,
+53885,29025,53886,53888,53889,20087,53890,21034,53891,29051,53892,53893,14386,
+53894,53895,53896,53897,53898,53899,53900,53901,53902,53903,53904,53905,53906,
+53907,53908,53909,53910,53911,53912,53913,53914,53915,53916,53917,53918,53919,
+53920,54080,54081,54082,54083,54084,54085,54086,54087,54088,54089,54090,54091,
+54092,54093,54094,54095,54096,54097,54098,54099,54100,54101,54102,54103,54104,
+54105,54106,54107,54108,54109,54110,15483,14683,54111,14694,17241,19027,27240,
+16448,15989,27241,27242,27243,54112,27244,27245,27246,27247,15687,54113,54114,
+54115,30075,54116,54117,54118,30077,54119,30078,54120,30076,54121,54122,54123,
+54124,15714,54125,30241,13349,54126,54127,54128,54129,30242,54130,54131,54132,
+30243,54133,54134,54135,27698,54136,54137,54138,54139,54140,54141,54142,54144,
+54145,54146,54147,54148,20820,54149,54150,54151,54152,54153,54154,22890,54155,
+54156,54157,54158,54159,54160,54161,54162,54163,54164,54165,54166,54167,54168,
+54169,54170,54171,54172,54173,54174,54175,54176,54336,54337,54338,54339,54340,
+54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,54352,54353,
+54354,54355,54356,54357,54358,54359,54360,54361,54362,54363,54364,54365,54366,
+54367,30244,54368,54369,54370,54371,54372,54373,54374,54375,54376,28218,54377,
+54378,54379,54380,54381,54382,54383,54384,54385,54386,54387,54388,54389,54390,
+54391,54392,54393,54394,54395,54396,54397,54398,54400,54401,54402,54403,54404,
+54405,54406,54407,54408,54409,54410,54411,54412,54413,54414,54415,54416,54417,
+54418,54419,54420,54421,54422,54423,54424,54425,21810,54426,54427,54428,54429,
+54430,54431,54432,54592,54593,54594,54595,54596,54597,54598,54599,21374,19548,
+54600,54601,54602,54603,54604,54605,54606,54607,19012,54608,54609,54610,54611,
+54612,54613,54614,54615,54616,54617,54618,54619,54620,54621,54622,54623,54624,
+54625,54626,54627,54628,54629,54630,54631,54632,54633,54634,54635,54636,54637,
+54638,54639,54640,54641,54642,54643,54644,54645,54646,54647,54648,54649,54650,
+54651,54652,54653,54654,54656,54657,54658,54659,54660,54661,54662,54663,54664,
+54665,54666,54667,54668,54669,54670,54671,54672,54673,54674,54675,54676,54677,
+54678,54679,54680,54681,54682,54683,54684,54685,54686,54687,54688,54848,54849,
+54850,54851,54852,54853,54854,54855,54856,54857,54858,54859,54860,54861,54862,
+54863,54864,54865,54866,54867,54868,54869,54870,54871,54872,54873,54874,54875,
+54876,54877,54878,54879,54880,54881,54882,25920,54883,54884,54885,54886,54887,
+54888,54889,54890,54891,54892,54893,54894,54895,54896,54897,54898,54899,54900,
+54901,54902,54903,54904,54905,54906,54907,54908,54909,54910,54912,54913,30245,
+54914,54915,54916,54917,54918,54919,54920,54921,54922,54923,54924,54925,54926,
+54927,54928,54929,54930,54931,54932,54933,54934,54935,54936,54937,54938,54939,
+54940,54941,54942,54943,54944,55104,55105,55106,55107,55108,55109,55110,55111,
+55112,55113,55114,55115,55116,55117,55118,55119,55120,55121,55122,55123,55124,
+55125,55126,55127,55128,55129,55130,55131,55132,55133,55134,55135,15919,55136,
+55137,55138,55139,55140,17961,55141,55142,55143,55144,55145,55146,55147,55148,
+55149,55150,55151,55152,55153,55154,55155,55156,55157,55158,55159,55160,55161,
+55162,55163,55164,55165,55166,55168,55169,55170,55171,55172,55173,55174,55175,
+55176,55177,55178,55179,55180,55181,55182,55183,55184,55185,55186,55187,55188,
+55189,55190,55191,55192,23077,15430,13865,14396,18511,15397,23078,23079,19542,
+18499,23080,18045,55193,20789,21097,20790,15431,55194,15666,15204,23081,23082,
+20808,23083,20589,13935,16987,55195,19279,14189,18792,14147,15991,22052,23084,
+23085,17984,22375,18998,55196,21801,19295,21871,23086,22111,13386,23088,23087,
+55197,21099,23089,23090,23091,19028,23092,18987,23093,23094,13135,22127,23095,
+15152,13614,23096,23097,14702,20783,21096,23098,14403,20330,12911,23099,23100,
+55198,15723,20060,21359,23101,20083,23102,21333,15205,23103,19253,19280,23104,
+18283,22126,23105,17717,13889,23106,14156,16206,23107,23108,19245,23109,13687,
+23110,16706,22331,23111,19512,55199,21098,17457,23112,13693,15185,23113,20531,
+23114,23115,20029,23116,23117,23118,12919,23121,23119,20840,23120,17237,23122,
+55200,23123,23124,23125,20539,21029,12409,23126,18219,23127,15735,17185,23128,
+23129,17277,19511,23130,23131,16446,18007,23132,23133,18228,23134,23135,14664,
+55360,55361,55362,55363,55364,55365,55366,55367,55368,15213,55369,55370,55371,
+55372,13881,29816,55373,29817,55374,55375,19811,55376,55377,55378,55379,55380,
+55381,55382,55383,30009,55384,55385,55386,55387,27488,55388,55389,55390,55391,
+55392,55393,20339,15167,55394,55395,55396,55397,55398,55399,55400,14912,21541,
+55401,55402,55403,55404,55405,55406,55407,24921,55408,55409,55410,55411,30068,
+12586,12914,55412,55413,55414,55415,55416,55417,55418,30069,55419,55420,30071,
+55421,55422,55424,14929,30070,55425,17202,55426,55427,55428,55429,55430,55431,
+55432,30073,55433,55434,55435,30072,55436,55437,55438,55439,55440,55441,55442,
+55443,55444,55445,55446,55447,55448,55449,55450,55451,55452,55453,55454,55455,
+55456,55616,55617,55618,55619,55620,55621,55622,55623,55624,55625,55626,55627,
+55628,55629,55630,55631,55632,55633,55634,55635,55636,55637,55638,55639,55640,
+55641,55642,55643,55644,55645,55646,55647,55648,55649,55650,55651,55652,55653,
+55654,55655,55656,55657,55658,55659,55660,55661,55662,55663,55664,55665,55666,
+55667,55668,55669,55670,55671,55672,55673,55674,55675,55676,55677,55678,55680,
+55681,55682,55683,55684,55685,55686,55687,55688,55689,55690,55691,55692,55693,
+55694,55695,55696,55697,55698,55699,55700,55701,55702,55703,55704,55705,55706,
+55707,55708,55709,55710,55711,55712,55872,55873,55874,55875,55876,55877,55878,
+55879,55880,55881,55882,55883,55884,55885,55886,12596,21866,14394,55887,14641,
+12870,21616,20301,12380,21835,15221,22090,14135,19504,17974,12641,14650,22140,
+14689,14113,15482,27226,27227,19577,14707,27228,13435,17203,14161,14936,27229,
+21620,27230,15446,15199,27231,16734,16952,21599,22346,27232,27233,27236,27234,
+27235,18782,14387,13892,27237,19050,18765,13389,55888,55889,25177,17762,27238,
+16437,55890,22328,27239,22316,18556,22611,22605,21598,55891,21625,18756,21294,
+14419,13152,55892,18786,29814,55893,55894,55895,14933,55896,29815,55897,55898,
+22367,55899,55900,29809,14384,21844,14415,18032,55901,55902,55903,55904,55905,
+55906,55907,55908,55909,13123,55910,55911,29810,13100,55912,55913,55914,55915,
+21565,18295,55916,55917,55918,55919,55920,29812,55921,55922,29811,55923,55924,
+55925,55926,55927,55928,55929,55930,55931,55932,19531,55933,55934,55936,18468,
+55937,55938,55939,55940,55941,55942,55943,55944,55945,55946,55947,55948,55949,
+29813,55950,22371,17727,30016,55951,55952,30011,55953,30019,55954,30018,55955,
+22074,30017,55956,55957,55958,21566,30020,55959,30028,55960,55961,55962,55963,
+12367,13688,55964,30025,30026,55965,17756,55966,55967,55968,56128,30021,30022,
+56129,56130,30023,30027,56131,15968,30024,14458,56132,56133,56134,30032,30035,
+56135,56136,56137,16231,56138,14706,30012,30029,56139,56140,16951,56141,56142,
+56143,19576,56144,15481,56145,30030,30031,30033,13925,30034,56146,30037,56147,
+56148,56149,56150,56151,56152,56153,30013,56154,56155,56156,30036,21307,56157,
+13164,56158,56159,19492,56160,56161,56162,56163,30038,56164,56165,56166,56167,
+56168,56169,56170,56171,30039,15969,30040,56172,56173,19551,30043,56174,56175,
+56176,56177,56178,12872,22361,56179,30041,56180,30042,30044,56181,30050,56182,
+56183,56184,30048,56185,56186,56187,30047,30045,56188,56189,30049,56190,56192,
+30046,30052,30053,56193,19555,56194,56195,25919,13624,30051,30056,19491,56196,
+56197,56198,56199,56200,30054,30055,56201,56202,56203,56204,56205,56206,30014,
+56207,56208,56209,56210,56211,56212,56213,56214,56215,56216,56217,56218,12612,
+56219,56220,30015,56221,56222,13637,12900,56223,30060,30057,56224,13911,56384,
+30061,56385,30058,56386,56387,56388,56389,56390,30059,56391,56392,13402,56393,
+21610,56394,56395,56396,30062,56397,13177,56398,56399,56400,56401,56402,56403,
+56404,30063,30065,56405,56406,56407,30064,56408,56409,56410,56411,56412,56413,
+56414,30066,56415,30067,56416,56417,56418,56419,56420,56421,56422,56423,56424,
+56425,56426,56427,18797,14634,56428,56429,18299,56430,56431,13923,56432,56433,
+56434,56435,56436,56437,56438,19529,56439,56440,56441,56442,56443,56444,56445,
+56446,56448,56449,56450,56451,56452,56453,56454,56455,56456,56457,56458,27174,
+56459,56460,56461,56462,56463,56464,56465,56466,56467,56468,56469,56470,56471,
+56472,56473,56474,56475,56476,56477,56478,56479,56480,56640,56641,56642,56643,
+56644,56645,56646,56647,56648,56649,56650,56651,56652,56653,56654,56655,56656,
+56657,56658,56659,56660,56661,56662,56663,56664,56665,56666,56667,56668,56669,
+56670,56671,56672,56673,56674,56675,56676,56677,56678,56679,56680,56681,56682,
+56683,56684,56685,56686,56687,56688,56689,56690,56691,56692,56693,56694,56695,
+56696,56697,56698,56699,56700,56701,56702,56704,56705,56706,56707,56708,56709,
+56710,56711,56712,56713,56714,56715,56716,56717,56718,56719,56720,56721,56722,
+56723,56724,56725,56726,56727,56728,56729,56730,56731,56732,56733,56734,56735,
+56736,56896,56897,56898,56899,56900,56901,56902,56903,56904,56905,56906,56907,
+56908,56909,56910,56911,56912,56913,56914,56915,56916,56917,56918,56919,56920,
+56921,56922,56923,56924,56925,56926,56927,56928,13109,21630,14700,20601,56929,
+26989,22314,26990,16982,18541,14948,26991,26992,26993,22113,26994,26995,26997,
+26996,26998,26999,18273,27000,21592,27001,15694,56930,27002,27003,15695,27004,
+14376,16702,27005,12594,15188,14709,27006,56931,27169,27170,27171,14200,15405,
+56932,19044,24654,21551,20285,21815,27172,21854,27173,20545,14652,56933,13383,
+12633,56934,56935,56936,16433,56937,56938,56939,56940,12646,12647,56941,12648,
+56942,56943,56944,56945,13117,18536,56946,56947,56948,56949,25921,56950,56951,
+12639,56952,56953,56954,16713,13423,56955,56956,18216,21336,56957,18041,20792,
+56958,14717,17013,56960,56961,56962,56963,56964,21293,56965,21579,15740,56966,
+25922,14133,25923,56967,56968,15161,21858,56969,15736,21558,20005,16684,13145,
+56970,56971,19574,56972,25926,25924,25928,56973,25930,25927,13647,17992,56974,
+13692,25925,56975,19062,56976,56977,25929,56978,56979,56980,17236,12613,15395,
+56981,56982,56983,22327,56984,56985,19787,19277,19018,19539,25932,25931,17510,
+56986,56987,20769,20791,25933,56988,25936,56989,19768,22128,25935,13661,56990,
+19774,56991,25937,13882,56992,57152,19752,14692,57153,19013,13137,19289,21612,
+25938,14186,57154,57155,57156,25934,57157,57158,57159,57160,57161,57162,25941,
+13438,25942,57163,57164,57165,57166,57167,25939,25940,57168,21085,57169,57170,
+16991,12614,57171,21346,57172,57173,13917,19308,57174,25943,57175,57176,21366,
+57177,57178,57179,57180,57181,12649,57182,13940,25946,25944,25945,13632,57183,
+57184,57185,21061,25948,57186,57187,25950,57188,57189,57190,57191,57192,57193,
+25949,18226,57194,21027,57195,57196,25947,57197,57198,57199,57200,21602,21850,
+57201,57202,57203,57204,57205,25952,22385,57206,57207,57208,57209,57210,57211,
+57212,25953,57213,12636,20859,57214,25954,25956,57216,57217,57218,57219,25955,
+57220,57221,25957,57222,57223,57224,57225,57226,21080,57227,13643,57228,26463,
+57229,23157,57230,23160,57231,23158,57232,23159,57233,57234,57235,23162,20559,
+17479,57236,57237,12398,57238,57239,57240,20528,57241,23161,57242,21322,14890,
+23330,18289,57243,23164,23163,18779,23165,57244,23329,22366,23166,16730,57245,
+57246,23333,57247,57248,21364,57408,57409,23335,23332,57410,23336,57411,57412,
+15676,57413,57414,57415,16457,23331,23334,22051,57416,23337,57417,57418,57419,
+23341,57420,57421,57422,23342,23340,14914,57423,57424,57425,16164,23339,57426,
+57427,57428,23338,21575,12863,57429,57430,23343,57431,14713,57432,23344,57433,
+57434,57435,57436,13115,57437,57438,57439,13606,57440,57441,57442,57443,13884,
+23345,57444,57445,57446,13941,57447,23346,57448,57449,57450,57451,57452,57453,
+57454,57455,57456,57457,57458,57459,57460,57461,57462,57463,57464,57465,57466,
+57467,12617,57468,57469,57470,57472,23348,57473,57474,57475,23347,23349,57476,
+57477,57478,57479,57480,57481,57482,57483,57484,57485,57486,23351,57487,23350,
+57488,57489,57490,57491,57492,57493,57494,23352,57495,57496,57497,57498,57499,
+57500,57501,57502,57503,23353,57504,57664,23354,57665,57666,21327,29818,18293,
+22339,17764,29820,29821,29819,57667,15942,57668,57669,57670,57671,20591,57672,
+57673,14163,57674,57675,21581,19498,57676,57677,29986,29985,14888,29822,19286,
+57678,57679,57680,29988,16466,57681,13162,57682,19754,29989,29987,15668,29992,
+57683,29993,15693,17208,16225,19297,29994,57684,57685,57686,29990,29991,17520,
+57687,57688,57689,57690,57691,29996,57692,13372,57693,22381,57694,13399,29995,
+29998,57695,57696,29997,29999,20561,57697,57698,57699,57700,57701,57702,57703,
+17233,18473,57704,57705,57706,57707,57708,57709,30000,30001,57710,57711,57712,
+57713,57714,57715,30002,57716,57717,30003,30004,30005,57718,57719,57720,57721,
+30007,30006,57722,57723,57724,57725,30008,57726,57728,57729,57730,57731,57732,
+57733,57734,57735,57736,57737,57738,12873,57739,21332,19021,57740,16495,22104,
+21040,16703,57741,15728,57742,57743,57744,57745,57746,57747,57748,57749,57750,
+57751,14378,57752,57753,57754,57755,57756,57757,57758,57759,57760,57920,57921,
+57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,57934,
+57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,57947,
+57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,57960,
+57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,57973,
+57974,57975,57976,57977,57978,57979,57980,57981,57982,57984,57985,57986,57987,
+57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,57999,58000,
+58001,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,58012,58013,
+58014,58015,58016,58176,58177,58178,58179,58180,58181,58182,58183,58184,58185,
+58186,58187,58188,58189,58190,58191,58192,58193,58194,58195,58196,58197,58198,
+58199,58200,58201,58202,58203,58204,58205,58206,58207,58208,58209,58210,58211,
+58212,58213,58214,58215,58216,58217,58218,58219,58220,58221,15480,58222,58223,
+58224,58225,58226,58227,58228,58229,58230,58231,58232,58233,58234,58235,58236,
+58237,58238,58240,58241,58242,58243,58244,58245,58246,58247,30278,58248,58249,
+58250,58251,58252,58253,58254,58255,58256,58257,58258,58259,58260,58261,58262,
+58263,58264,58265,58266,58267,58268,58269,58270,58271,58272,58432,58433,58434,
+58435,58436,58437,30279,58438,58439,58440,58441,58442,58443,58444,58445,58446,
+58447,58448,58449,58450,58451,58452,58453,58454,58455,58456,58457,58458,58459,
+58460,58461,58462,30280,58463,58464,58465,58466,58467,58468,58469,58470,58471,
+58472,58473,58474,58475,58476,58477,58478,58479,58480,58481,58482,58483,58484,
+58485,58486,58487,58488,58489,58490,58491,58492,58493,58494,58496,58497,58498,
+58499,58500,58501,58502,58503,58504,58505,58506,58507,58508,58509,58510,58511,
+58512,58513,58514,58515,58516,58517,58518,58519,58520,58521,58522,58523,58524,
+58525,58526,58527,58528,58688,58689,58690,58691,58692,58693,58694,58695,58696,
+58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,58708,58709,
+58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,58721,58722,
+58723,58724,58725,58726,58727,58728,58729,58730,58731,58732,58733,58734,58735,
+58736,58737,58738,58739,30281,58740,58741,58742,58743,58744,58745,58746,58747,
+58748,58749,58750,58752,58753,58754,58755,58756,58757,58758,58759,58760,58761,
+58762,58763,58764,58765,58766,58767,58768,58769,58770,58771,58772,58773,58774,
+58775,58776,58777,58778,58779,58780,58781,58782,58783,30282,58784,58944,58945,
+58946,58947,58948,58949,58950,58951,58952,58953,58954,58955,58956,58957,58958,
+58959,58960,58961,58962,58963,58964,58965,58966,58967,58968,58969,58970,58971,
+58972,58973,58974,58975,58976,58977,58978,30284,58979,58980,58981,58982,58983,
+58984,58985,58986,58987,58988,58989,58990,58991,58992,58993,58994,58995,58996,
+58997,58998,58999,59000,59001,59002,59003,59004,59005,59006,59008,59009,59010,
+59011,59012,59013,59014,59015,59016,59017,59018,59019,59020,59021,59022,59023,
+59024,59025,59026,59027,59028,59029,59030,59031,59032,59033,59034,59035,59036,
+59037,30283,59038,59039,59040,59200,59201,59202,59203,59204,59205,59206,59207,
+30569,59208,59209,59210,59211,59212,59213,59214,59215,59216,59217,59218,59219,
+59220,59221,59222,59223,59224,59225,59226,59227,59228,59229,59230,59231,59232,
+59233,59234,59235,59236,59237,59238,59239,59240,59241,59242,59243,59244,59245,
+59246,59247,59248,59249,59250,59251,59252,59253,59254,59255,59256,59257,59258,
+59259,59260,59261,59262,59264,59265,59266,59267,59268,59269,59270,59271,59272,
+59273,59274,59275,59276,59277,59278,59279,59280,59281,59282,59283,59284,59285,
+59286,59287,59288,59289,59290,59291,59292,59293,59294,59295,59296,59456,59457,
+59458,59459,59460,59461,59462,59463,59464,59465,59466,59467,59468,59469,59470,
+30285,59471,59472,59473,59474,59475,59476,59477,59478,59479,59480,59481,59482,
+59483,59484,59485,59486,59487,59488,59489,59490,59491,59492,59493,59494,59495,
+59496,59497,59498,59499,59500,59501,59502,59503,59504,59505,59506,59507,59508,
+59509,59510,59511,59512,59513,59514,30286,59515,59516,59517,59518,59520,59521,
+59522,59523,59524,59525,59526,59527,59528,59529,59530,59531,59532,59533,59534,
+59535,59536,59537,59538,59539,59540,28228,28229,28230,21867,13860,28232,28231,
+28233,28234,18213,28235,28236,59541,14128,13686,28237,28239,59542,28238,59543,
+14406,28240,28241,28242,13915,13102,22099,17478,12597,14422,28243,28244,21567,
+18261,15995,20057,14643,28246,28245,28248,28247,17701,28249,28250,18222,28251,
+18223,28252,12839,28253,28254,28255,28256,28257,22378,28258,28259,15448,28260,
+21323,19578,12844,16741,28261,18214,17197,59544,28262,28263,28264,28265,28266,
+28267,28268,59545,28269,28270,28271,59546,59547,28272,28273,28274,28276,28275,
+59548,28277,19757,16961,28278,28279,28280,21793,28281,20275,28282,28283,59549,
+28284,28285,28449,28286,28450,14453,17274,28451,28452,15682,21055,12921,28453,
+28454,28455,21112,28456,22141,28457,17996,59550,28458,28459,16692,28460,20346,
+19320,28462,28461,13178,14712,28463,28464,20578,28465,28466,14182,20543,28467,
+28468,28469,18545,19552,28470,28471,28472,28473,28474,21856,28475,13421,17194,
+28476,59551,28477,28478,28479,59552,20093,28480,16992,13368,22326,15733,59712,
+20295,28483,28481,28482,28484,13863,15484,15970,17228,28485,28486,59713,28487,
+28495,28488,28489,28490,18242,28529,13901,28491,59714,28492,28493,13894,17214,
+28494,59715,28496,28497,28498,21874,59716,28499,17527,59717,28500,17528,28501,
+28502,14436,12407,28503,28504,28505,59718,28506,28507,28508,28509,59719,28510,
+15925,28513,28511,28512,59720,28514,28515,16717,28516,28517,28518,28519,28520,
+28521,28522,28523,28524,16472,59721,28525,16685,28526,28527,28528,59722,59723,
+20322,59724,59725,59726,59727,59728,59729,59730,59731,13092,59732,59733,59734,
+59735,59736,59737,59738,59739,59740,59741,59742,59743,59744,59745,59746,59747,
+59748,59749,59750,59751,59752,59753,59754,59755,59756,59757,59758,59759,59760,
+59761,59762,59763,59764,59765,59766,59767,59768,59769,59770,59771,59772,59773,
+59774,59776,59777,59778,59779,59780,59781,59782,59783,59784,59785,59786,59787,
+59788,59789,59790,59791,59792,59793,59794,59795,59796,59797,59798,59799,59800,
+59801,59802,59803,59804,59805,59806,59807,59808,59968,59969,59970,59971,59972,
+59973,59974,59975,59976,59977,59978,59979,59980,59981,59982,59983,59984,59985,
+59986,59987,59988,59989,59990,59991,59992,59993,59994,59995,17221,25413,18753,
+25414,59996,12629,20042,13363,18546,25415,20304,25416,15460,25417,25418,17222,
+21794,17494,14699,20037,25419,17270,25420,59997,14119,14451,14930,25421,25422,
+21572,25423,59998,25424,20811,25425,25426,25427,25428,20822,25429,12923,16443,
+25430,59999,16427,25431,25432,25433,60000,25434,25435,60001,14391,23138,60002,
+13907,60003,23140,23139,60004,60005,60006,60007,60008,60009,60010,23142,60011,
+60012,60013,18542,60014,60015,23141,14144,20852,21109,21875,15703,60016,60017,
+60018,60019,22376,23144,23143,60020,12322,19795,60021,23145,60022,14397,15434,
+16957,16932,13122,23146,60023,16938,17456,15669,60024,60025,20318,60026,60027,
+60028,23147,18754,60029,60030,60032,60033,60034,12637,60035,60036,60037,23148,
+60038,13880,21562,60039,13181,60040,60041,23149,21577,20309,17763,60042,23150,
+60043,60044,60045,60046,60047,23151,60048,23152,16746,19541,20317,60049,60050,
+60051,60052,60053,60054,60055,60056,60057,60058,60059,60060,60061,21351,16929,
+60062,23153,60063,60064,19301,60224,23154,60225,19302,21118,60226,60227,60228,
+14452,60229,60230,23155,12335,20278,60231,60232,21839,60233,60234,60235,60236,
+60237,60238,60239,60240,60241,60242,19309,60243,60244,60245,60246,60247,60248,
+60249,60250,23156,60251,60252,25412,60253,60254,16677,60255,60256,30271,60257,
+60258,30272,30273,17489,60259,18488,20835,60260,60261,20571,20805,15407,14669,
+60262,28532,60263,60264,13382,21306,30274,13179,60265,60266,30275,60267,60268,
+13681,60269,60270,60271,60272,60273,60274,60275,60276,60277,60278,30277,60279,
+60280,60281,60282,60283,60284,60285,21354,30247,20777,60286,60288,60289,60290,
+30249,60291,60292,60293,30248,60294,60295,16739,16471,60296,12578,60297,60298,
+60299,60300,20077,60301,20584,30251,60302,60303,20342,60304,30250,21872,30252,
+17209,60305,60306,60307,15220,30254,30253,60308,60309,60310,17502,60311,60312,
+16728,60313,60314,60315,60316,60317,19242,60318,20284,60319,60320,60480,60481,
+60482,60483,60484,60485,60486,60487,60488,30255,60489,60490,30256,60491,60492,
+30257,60493,16950,60494,60495,60496,60497,60498,12372,17785,60499,60500,60501,
+60502,30258,60503,60504,60505,60506,60507,60508,60509,60510,60511,60512,60513,
+60514,60515,60516,60517,60518,60519,60520,60521,18272,30246,60522,60523,15928,
+60524,60525,15922,60526,13669,60527,60528,14151,60529,16191,17234,17254,60530,
+60531,22604,60532,60533,60534,14447,60535,60536,60537,60538,60539,60540,60541,
+60542,60544,15737,20773,60545,12368,60546,60547,60548,60549,60550,30512,60551,
+60552,60553,60554,60555,60556,60557,60558,30513,60559,60560,60561,60562,60563,
+20524,60564,12336,60565,60566,60567,30514,30515,60568,30516,60569,60570,60571,
+18250,60572,60573,60574,60575,60576,60736,60737,15951,60738,60739,30519,60740,
+60741,60742,60743,60744,60745,60746,30518,60747,12638,60748,30517,60749,60750,
+30520,60751,30521,60752,60753,60754,60755,60756,60757,60758,60759,60760,60761,
+60762,60763,60764,60765,60766,60767,60768,60769,60770,60771,60772,60773,60774,
+60775,60776,60777,60778,60779,60780,60781,60782,60783,60784,60785,60786,60787,
+60788,60789,60790,60791,60792,60793,60794,60795,60796,60797,60798,60800,60801,
+20004,18509,60802,14891,26680,26681,26682,15938,60803,60804,60805,60806,60807,
+21108,60808,21583,18776,60809,60810,60811,60812,60813,60814,60815,60816,60817,
+60818,60819,60820,60821,60822,60823,60824,60825,60826,60827,60828,60829,60830,
+60831,60832,60992,60993,60994,60995,60996,60997,60998,60999,61000,61001,61002,
+61003,61004,61005,61006,61007,61008,61009,61010,61011,61012,61013,61014,61015,
+61016,61017,61018,61019,61020,61021,61022,61023,61024,61025,61026,61027,61028,
+61029,61030,61031,61032,61033,61034,61035,61036,61037,61038,61039,61040,61041,
+61042,61043,61044,61045,61046,61047,61048,61049,61050,61051,61052,61053,61054,
+61056,61057,61058,61059,61060,61061,61062,61063,61064,61065,61066,61067,61068,
+61069,61070,61071,61072,61073,61074,61075,61076,61077,61078,61079,61080,61081,
+61082,61083,61084,61085,61086,61087,61088,61248,61249,61250,61251,61252,61253,
+21043,13861,18282,29052,20334,19251,20587,26479,19815,14667,13913,29053,12388,
+19276,29054,21540,16941,16748,17988,15921,29217,15445,61254,29218,29219,61255,
+29220,21059,17973,61256,19783,29221,61257,21297,16197,19554,61258,29222,29223,
+20821,13934,29224,29225,13663,29226,29227,61259,12924,29228,29229,18471,61260,
+61261,61262,61263,61264,61265,61266,61267,61268,61269,61270,61271,61272,61273,
+61274,61275,61276,61277,61278,61279,61280,61281,61282,61283,61284,61285,61286,
+61287,61288,61289,61290,61291,61292,61293,61294,61295,61296,61297,14183,61298,
+61299,27689,27690,27691,61300,27692,61301,61302,17966,27693,27694,61303,61304,
+61305,14153,18995,61306,61307,61308,61309,61310,61312,61313,25144,30543,61314,
+61315,61316,61317,61318,61319,61320,61321,61322,61323,61324,61325,61326,61327,
+61328,61329,61330,61331,61332,61333,61334,61335,61336,61337,61338,61339,61340,
+61341,61342,61343,61344,61504,61505,61506,61507,61508,30544,61509,61510,12877,
+61511,61512,61513,61514,61515,61516,61517,61518,61519,61520,61521,61522,61523,
+61524,61525,61526,61527,61528,61529,61530,61531,61532,61533,61534,61535,61536,
+61537,61538,61539,30545,61540,61541,61542,61543,61544,61545,61546,61547,61548,
+61549,61550,61551,61552,61553,61554,61555,61556,61557,61558,61559,61560,61561,
+61562,61563,61564,61565,61566,61568,61569,61570,61571,61572,61573,61574,61575,
+61576,61577,30547,30546,61578,61579,61580,61581,61582,61583,61584,61585,61586,
+61587,61588,61589,61590,25147,61591,15394,61592,25148,25149,25150,25151,25152,
+25153,14137,21115,15652,19022,12581,19271,61593,25154,13948,18500,25155,61594,
+61595,15688,61596,12669,25156,61597,13942,25157,17497,61598,61599,25158,20314,
+14685,25159,16417,61600,25160,12918,61760,25161,61761,16755,25162,25163,17016,
+25164,25165,25166,19031,22584,22885,20323,61762,61763,61764,61765,61766,61767,
+61768,61769,61770,61771,61772,28709,61773,61774,23600,61775,61776,61777,61778,
+61779,61780,61781,61782,61783,61784,61785,61786,61787,61788,61789,61790,61791,
+61792,61793,61794,61795,61796,61797,61798,61799,61800,61801,61802,61803,61804,
+61805,61806,61807,61808,61809,61810,61811,61812,61813,61814,61815,61816,61817,
+61818,61819,61820,61821,61822,61824,61825,61826,61827,61828,61829,61830,61831,
+61832,61833,61834,61835,61836,61837,61838,61839,61840,61841,61842,61843,61844,
+61845,61846,61847,61848,61849,61850,61851,61852,61853,61854,61855,61856,62016,
+62017,62018,62019,62020,62021,62022,62023,62024,62025,62026,62027,62028,62029,
+62030,62031,62032,62033,62034,62035,62036,62037,62038,62039,62040,62041,62042,
+62043,62044,62045,62046,62047,62048,62049,62050,62051,62052,62053,62054,62055,
+62056,62057,62058,62059,62060,62061,62062,62063,62064,62065,62066,62067,62068,
+62069,62070,62071,62072,62073,62074,62075,62076,62077,62078,62080,62081,62082,
+62083,62084,62085,62086,62087,62088,62089,62090,62091,62092,62093,62094,62095,
+62096,62097,62098,62099,62100,62101,62102,62103,62104,62105,62106,62107,62108,
+62109,62110,62111,62112,62272,62273,62274,62275,62276,62277,62278,62279,62280,
+62281,62282,62283,62284,62285,62286,62287,62288,62289,17005,21542,19796,20785,
+13147,18301,62290,12853,16959,26208,19003,26209,26210,15956,26211,22308,19797,
+26213,15453,26212,26214,26215,17006,62291,15678,26216,16998,14887,26217,62292,
+26218,13138,20841,62293,62294,16165,26219,18031,26220,26221,62295,62296,26222,
+17965,26223,62297,18727,26224,26225,26226,25913,26227,26228,16994,26229,26230,
+22120,26231,62298,26232,14663,62299,62300,62301,62302,62303,62304,62305,30523,
+30522,62306,62307,62308,62309,30526,30524,14881,62310,30527,62311,30528,62312,
+62313,62314,30530,30529,30532,62315,62316,30531,62317,62318,62319,62320,62321,
+30533,30534,62322,62323,62324,62325,30535,62326,19304,62327,62328,62329,62330,
+14431,62331,62332,62333,62334,62336,62337,30548,62338,30549,62339,62340,62341,
+62342,30550,62343,62344,62345,62346,30552,62347,30554,62348,30551,62349,62350,
+62351,62352,62353,62354,62355,62356,62357,30555,62358,30553,62359,62360,62361,
+62362,62363,62364,62365,22359,62366,62367,62368,62528,30556,62529,62530,62531,
+62532,62533,62534,30557,62535,62536,62537,30558,62538,62539,62540,62541,62542,
+62543,62544,62545,62546,62547,62548,30559,62549,62550,62551,30560,62552,62553,
+62554,62555,62556,62557,62558,62559,62560,62561,62562,23371,62563,62564,22570,
+62565,62566,62567,62568,62569,62570,62571,62572,25975,14701,62573,62574,62575,
+62576,16253,15210,30537,17991,30536,62577,30538,30540,30539,62578,62579,62580,
+30541,62581,20026,62582,30542,62583,62584,17447,62585,62586,62587,62588,62589,
+62590,62592,62593,62594,62595,62596,62597,62598,62599,62600,62601,62602,62603,
+62604,62605,62606,62607,62608,62609,62610,62611,62612,62613,62614,62615,62616,
+62617,62618,62619,62620,62621,62622,62623,62624,62784,62785,62786,62787,62788,
+62789,62790,62791,62792,62793,62794,62795,62796,62797,62798,62799,62800,62801,
+62802,62803,62804,62805,62806,62807,62808,62809,62810,62811,62812,62813,62814,
+62815,62816,62817,62818,62819,62820,62821,62822,62823,62824,62825,62826,62827,
+62828,62829,62830,62831,62832,62833,62834,62835,62836,62837,62838,62839,62840,
+62841,62842,62843,62844,62845,62846,62848,62849,62850,62851,62852,62853,62854,
+62855,62856,62857,62858,62859,62860,62861,62862,62863,62864,62865,62866,62867,
+62868,62869,62870,62871,62872,62873,62874,62875,62876,62877,62878,62879,62880,
+63040,63041,63042,63043,63044,63045,63046,63047,63048,63049,63050,63051,63052,
+63053,63054,63055,63056,63057,63058,63059,63060,63061,63062,63063,63064,63065,
+63066,63067,63068,63069,63070,63071,63072,63073,63074,63075,63076,63077,63078,
+63079,63080,63081,63082,63083,63084,63085,63086,63087,63088,63089,63090,63091,
+63092,63093,63094,63095,63096,63097,63098,63099,63100,63101,63102,63104,63105,
+63106,63107,63108,63109,63110,63111,63112,63113,63114,63115,63116,63117,63118,
+63119,63120,63121,63122,63123,63124,63125,63126,63127,63128,63129,63130,63131,
+63132,63133,63134,63135,63136,63296,63297,63298,63299,63300,63301,63302,63303,
+63304,63305,63306,63307,63308,63309,63310,63311,63312,63313,63314,63315,63316,
+63317,63318,63319,63320,63321,63322,63323,63324,63325,63326,63327,63328,63329,
+63330,63331,63332,63333,63334,63335,63336,63337,63338,63339,63340,63341,63342,
+63343,63344,63345,63346,63347,63348,63349,63350,63351,63352,63353,63354,63355,
+63356,63357,63358,63360,21347,63361,63362,30287,63363,16947,30288,63364,63365,
+30289,30290,30291,30292,63366,63367,30294,63368,12587,30295,63369,30296,30297,
+30298,63370,30299,30300,63371,63372,63373,63374,30301,30302,20298,63375,30303,
+30304,30305,30306,30307,30308,16496,30309,30310,30311,30312,30313,63376,30314,
+63377,30315,30316,63378,30317,30318,30319,30320,30321,30322,30323,30324,15912,
+63379,30325,30326,30327,30328,63380,63381,63382,63383,63384,18554,30329,30330,
+30331,30332,63385,63386,30333,30334,30497,30498,30499,30500,30501,63387,63388,
+30502,30503,30504,12654,30505,30506,30507,63389,63390,30508,30509,16731,30510,
+63391,63392,30511,63552,63553,63554,63555,63556,63557,63558,63559,63560,63561,
+63562,63563,63564,63565,63566,63567,63568,63569,63570,63571,63572,63573,63574,
+63575,63576,63577,63578,63579,63580,63581,63582,63583,63584,63585,63586,63587,
+63588,63589,63590,63591,63592,63593,63594,63595,63596,63597,63598,63599,63600,
+63601,63602,63603,63604,63605,63606,63607,63608,63609,63610,63611,63612,63613,
+63614,63616,63617,63618,63619,63620,63621,63622,63623,63624,63625,63626,63627,
+63628,63629,63630,63631,63632,63633,63634,63635,63636,63637,63638,63639,63640,
+63641,63642,63643,63644,63645,63646,63647,63648,63808,63809,63810,63811,63812,
+63813,63814,63815,63816,63817,63818,63819,63820,63821,63822,63823,63824,63825,
+63826,63827,63828,63829,63830,63831,63832,63833,63834,63835,63836,63837,63838,
+63839,63840,63841,63842,63843,63844,63845,63846,63847,63848,63849,63850,63851,
+63852,63853,63854,63855,63856,63857,63858,63859,63860,63861,63862,63863,63864,
+63865,63866,63867,63868,63869,63870,63872,63873,63874,63875,63876,63877,63878,
+63879,63880,63881,63882,63883,63884,63885,63886,63887,63888,63889,63890,63891,
+63892,63893,63894,63895,63896,63897,63898,63899,63900,63901,63902,63903,63904,
+64064,64065,64066,64067,64068,64069,64070,64071,64072,64073,64074,64075,64076,
+64077,64078,64079,64080,64081,64082,64083,64084,64085,64086,64087,64088,64089,
+64090,64091,64092,64093,64094,64095,64096,64097,64098,64099,64100,64101,64102,
+64103,64104,64105,64106,64107,64108,64109,64110,64111,64112,64113,64114,64115,
+64116,64117,64118,64119,64120,64121,64122,64123,64124,64125,64126,64128,64129,
+64130,64131,64132,64133,64134,64135,64136,64137,64138,64139,64140,64141,64142,
+64143,64144,64145,64146,64147,64148,64149,64150,64151,64152,64153,64154,64155,
+64156,64157,64158,64159,64160,64320,64321,64322,64323,64324,64325,64326,64327,
+64328,64329,64330,64331,64332,64333,64334,64335,64336,64337,64338,64339,64340,
+64341,64342,64343,64344,64345,64346,64347,17521,28719,15398,28720,17273,64348,
+17720,20795,64349,28721,28722,28723,28724,28725,20796,64350,20844,64351,28727,
+28726,21543,64352,19794,28728,28730,28729,28731,28732,64353,64354,14443,28733,
+14952,64355,28734,28735,15977,28736,13932,28737,28738,28739,28740,18485,28741,
+28742,64356,28743,17780,64357,28744,64358,64359,64360,28745,64361,28746,30525,
+64362,28747,28748,28749,64363,28750,64364,64365,64366,64367,28751,14935,64368,
+28752,28753,28754,28755,28756,28757,28758,28760,64369,64370,21285,28759,64371,
+28761,64372,64373,64374,64375,64376,64377,64378,64379,64380,64381,30010,16953,
+64382,64384,30564,64385,64386,64387,64388,30565,30566,64389,64390,30567,64391,
+64392,64393,64394,64395,64396,30568,16948,64397,64398,64399,64400,64401,64402,
+64403,64404,64405,30570,64406,30571,64407,64408,64409,64410,64411,64412,17011,
+64413,64414,64415,64416,64576,64577,64578,64579,64580,64581,64582,64583,64584,
+29808,64585,64586,64587,29807,64588,64589,17001,64590,30561,30562,64591,64592,
+64593,64594,64595,15174,64596,64597,64598,64599,22884,64600,64601,64602,19058,
+16488,28708,64603,14938,64604,64605,18221,64606,64607,64608,17452,64609,64610,
+30572,30573,30574,64611,30576,30575,64612,30577,64613,64614,30580,64615,30579,
+64616,30578,30581,64617,64618,64619,64620,30582,64621,64622,64623,64624,64625,
+64626,64627,64628,64629,28009,64630,28010,28011,64631,30268,64632,64633,64634,
+64635,64636,64637,64638,64640,64641,64642,64643,64644,30269,64645,30270,13862,
+64646,22590,64647,64648,14660,64649,64650,64651,22587,64652,23601,64653,64654,
+64655,64656,64657,64658,19059,64659,30583,64660,64661,64662,64663,64664,64665,
+64666,64667,64668,30584,64669,64670,30585,64671,64672,64832,64833,64834,64835,
+64836,30587,64837,30586,64838,12615,64839,30588,30589,64840,64841,64842,64843,
+64844,30590,64845,64846,64847,64848,64849,64850,64851,64852,64853,64854,64855,
+18027,27700,64856,64857,64858,64859,64860,64861,64862,64863,64864,64865,64866,
+64867,64868,64869,64870,64871,64872,64873,64874,64875,64876,64877,64878,64879,
+64880,64881,64882,64883,64884,64885,64886,64887,64888,64889,64890,64891,64892,
+64893,64894,64896,64897,64898,64899,64900,64901,13149,30259,64902,64903,30260,
+16740,30261,30262,30263,30264,30265,30266,18467,30267,64904,64905,64906,64907,
+64908,64909,64910,64911,64912,64913,64914,64915,16762,14632,28008,64916,64917,
+64918,14698,22879,64919,64920,64921,64922,64923,64924,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64925,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64926,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64927,N,N,N,N,N,N,N,N,N,64928,
+65088,65089,65090,65091,N,65092,N,65093,65094,N,N,N,65095,N,N,N,N,N,N,65096,
+65097,65098,N,65099,65100,N,N,65101,65102,65103,43349,42738,N,42740,42741,
+42720,42721,42736,42737,42722,42723,42734,42735,42726,42727,42724,42725,42728,
+42729,42730,42731,N,N,N,N,43368,43369,43370,43371,43372,43373,43374,43375,
+43376,43377,N,43378,43379,43380,43381,N,43382,43383,43384,43385,43386,43387,
+43388,43389,43390,43392,43393,43394,43395,43396,N,43397,43398,43399,43400,
+8993,8994,8995,8551,8997,8998,8999,9000,9001,9002,9003,9004,9005,9006,9007,
+9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,
+9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,
+9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,
+9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,9064,9065,9066,9067,
+9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,
+9083,9084,9085,8491,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8553,8554,43350,9086,43351,8996,
+};
+
+static const struct unim_index gbcommon_encmap[256] = {
+{__gbcommon_encmap+0,164,252},{__gbcommon_encmap+89,1,220},{__gbcommon_encmap+
+309,81,217},{__gbcommon_encmap+446,145,201},{__gbcommon_encmap+503,1,81},{0,0,
+0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gbcommon_encmap+584,
+16,59},{__gbcommon_encmap+628,3,153},{__gbcommon_encmap+779,8,191},{
+__gbcommon_encmap+963,18,18},{__gbcommon_encmap+964,96,155},{__gbcommon_encmap
++1024,0,229},{__gbcommon_encmap+1254,5,66},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gbcommon_encmap+1316,0,254},{
+__gbcommon_encmap+1571,5,41},{__gbcommon_encmap+1608,32,163},{
+__gbcommon_encmap+1740,142,213},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{__gbcommon_encmap+1812,0,255},{__gbcommon_encmap+2068,0,255},{
+__gbcommon_encmap+2324,0,255},{__gbcommon_encmap+2580,0,255},{
+__gbcommon_encmap+2836,0,255},{__gbcommon_encmap+3092,0,255},{
+__gbcommon_encmap+3348,0,255},{__gbcommon_encmap+3604,0,255},{
+__gbcommon_encmap+3860,0,255},{__gbcommon_encmap+4116,0,255},{
+__gbcommon_encmap+4372,0,255},{__gbcommon_encmap+4628,0,255},{
+__gbcommon_encmap+4884,0,255},{__gbcommon_encmap+5140,0,255},{
+__gbcommon_encmap+5396,0,255},{__gbcommon_encmap+5652,0,255},{
+__gbcommon_encmap+5908,0,255},{__gbcommon_encmap+6164,0,255},{
+__gbcommon_encmap+6420,0,255},{__gbcommon_encmap+6676,0,255},{
+__gbcommon_encmap+6932,0,255},{__gbcommon_encmap+7188,0,255},{
+__gbcommon_encmap+7444,0,255},{__gbcommon_encmap+7700,0,255},{
+__gbcommon_encmap+7956,0,255},{__gbcommon_encmap+8212,0,255},{
+__gbcommon_encmap+8468,0,255},{__gbcommon_encmap+8724,0,255},{
+__gbcommon_encmap+8980,0,255},{__gbcommon_encmap+9236,0,255},{
+__gbcommon_encmap+9492,0,255},{__gbcommon_encmap+9748,0,255},{
+__gbcommon_encmap+10004,0,255},{__gbcommon_encmap+10260,0,255},{
+__gbcommon_encmap+10516,0,255},{__gbcommon_encmap+10772,0,255},{
+__gbcommon_encmap+11028,0,255},{__gbcommon_encmap+11284,0,255},{
+__gbcommon_encmap+11540,0,255},{__gbcommon_encmap+11796,0,255},{
+__gbcommon_encmap+12052,0,255},{__gbcommon_encmap+12308,0,255},{
+__gbcommon_encmap+12564,0,255},{__gbcommon_encmap+12820,0,255},{
+__gbcommon_encmap+13076,0,255},{__gbcommon_encmap+13332,0,255},{
+__gbcommon_encmap+13588,0,255},{__gbcommon_encmap+13844,0,255},{
+__gbcommon_encmap+14100,0,255},{__gbcommon_encmap+14356,0,255},{
+__gbcommon_encmap+14612,0,255},{__gbcommon_encmap+14868,0,255},{
+__gbcommon_encmap+15124,0,255},{__gbcommon_encmap+15380,0,255},{
+__gbcommon_encmap+15636,0,255},{__gbcommon_encmap+15892,0,255},{
+__gbcommon_encmap+16148,0,255},{__gbcommon_encmap+16404,0,255},{
+__gbcommon_encmap+16660,0,255},{__gbcommon_encmap+16916,0,255},{
+__gbcommon_encmap+17172,0,255},{__gbcommon_encmap+17428,0,255},{
+__gbcommon_encmap+17684,0,255},{__gbcommon_encmap+17940,0,255},{
+__gbcommon_encmap+18196,0,255},{__gbcommon_encmap+18452,0,255},{
+__gbcommon_encmap+18708,0,255},{__gbcommon_encmap+18964,0,255},{
+__gbcommon_encmap+19220,0,255},{__gbcommon_encmap+19476,0,255},{
+__gbcommon_encmap+19732,0,255},{__gbcommon_encmap+19988,0,255},{
+__gbcommon_encmap+20244,0,255},{__gbcommon_encmap+20500,0,255},{
+__gbcommon_encmap+20756,0,255},{__gbcommon_encmap+21012,0,255},{
+__gbcommon_encmap+21268,0,255},{__gbcommon_encmap+21524,0,255},{
+__gbcommon_encmap+21780,0,255},{__gbcommon_encmap+22036,0,255},{
+__gbcommon_encmap+22292,0,255},{__gbcommon_encmap+22548,0,165},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{__gbcommon_encmap+22714,44,241},{__gbcommon_encmap+22912,12,41},{0,0,0},{0,
+0,0},{0,0,0},{__gbcommon_encmap+22942,48,107},{__gbcommon_encmap+23002,1,229},
+};
+
+static const ucs2_t __gb18030ext_decmap[2729] = {
+58566,58567,58568,58569,58570,58571,58572,58573,58574,58575,58576,58577,58578,
+58579,58580,58581,58582,58583,58584,58585,58586,58587,58588,58589,58590,58591,
+58592,58593,58594,58595,58596,58597,58598,58599,58600,58601,58602,58603,58604,
+58605,58606,58607,58608,58609,58610,58611,58612,58613,58614,58615,58616,58617,
+58618,58619,58620,58621,58622,58623,58624,58625,58626,58627,58628,U,58629,
+58630,58631,58632,58633,58634,58635,58636,58637,58638,58639,58640,58641,58642,
+58643,58644,58645,58646,58647,58648,58649,58650,58651,58652,58653,58654,58655,
+58656,58657,58658,58659,58660,58661,58662,58663,58664,58665,58666,58667,58668,
+58669,58670,58671,58672,58673,58674,58675,58676,58677,58678,58679,58680,58681,
+58682,58683,58684,58685,58686,58687,58688,58689,58690,58691,58692,58693,58694,
+58695,58696,58697,58698,58699,58700,58701,58702,58703,58704,58705,58706,58707,
+58708,58709,58710,58711,58712,58713,58714,58715,58716,58717,58718,58719,58720,
+58721,58722,58723,58724,U,58725,58726,58727,58728,58729,58730,58731,58732,
+58733,58734,58735,58736,58737,58738,58739,58740,58741,58742,58743,58744,58745,
+58746,58747,58748,58749,58750,58751,58752,58753,58754,58755,58756,58757,U,U,U,
+U,U,U,U,U,U,U,59238,59239,59240,59241,59242,59243,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,8364,
+59245,U,U,U,U,U,U,U,U,U,U,59246,59247,U,U,U,U,U,U,U,U,U,U,U,U,59248,59249,
+58758,58759,58760,58761,58762,58763,58764,58765,58766,58767,58768,58769,58770,
+58771,58772,58773,58774,58775,58776,58777,58778,58779,58780,58781,58782,58783,
+58784,58785,58786,58787,58788,58789,58790,58791,58792,58793,58794,58795,58796,
+58797,58798,58799,58800,58801,58802,58803,58804,58805,58806,58807,58808,58809,
+58810,58811,58812,58813,58814,58815,58816,58817,58818,58819,58820,U,58821,
+58822,58823,58824,58825,58826,58827,58828,58829,58830,58831,58832,58833,58834,
+58835,58836,58837,58838,58839,58840,58841,58842,58843,58844,58845,58846,58847,
+58848,58849,58850,58851,58852,58853,58854,58855,58856,58857,58858,58859,58860,
+58861,58862,58863,58864,58865,58866,58867,58868,58869,58870,58871,58872,58873,
+58874,58875,58876,58877,58878,58879,58880,58881,58882,58883,58884,58885,58886,
+58887,58888,58889,58890,58891,58892,58893,58894,58895,58896,58897,58898,58899,
+58900,58901,58902,58903,58904,58905,58906,58907,58908,58909,58910,58911,58912,
+58913,58914,58915,58916,U,58917,58918,58919,58920,58921,58922,58923,58924,
+58925,58926,58927,58928,58929,58930,58931,58932,58933,58934,58935,58936,58937,
+58938,58939,58940,58941,58942,58943,58944,58945,58946,58947,58948,58949,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,59250,59251,59252,59253,59254,59255,59256,59257,59258,59259,59260,58950,
+58951,58952,58953,58954,58955,58956,58957,58958,58959,58960,58961,58962,58963,
+58964,58965,58966,58967,58968,58969,58970,58971,58972,58973,58974,58975,58976,
+58977,58978,58979,58980,58981,58982,58983,58984,58985,58986,58987,58988,58989,
+58990,58991,58992,58993,58994,58995,58996,58997,58998,58999,59000,59001,59002,
+59003,59004,59005,59006,59007,59008,59009,59010,59011,59012,U,59013,59014,
+59015,59016,59017,59018,59019,59020,59021,59022,59023,59024,59025,59026,59027,
+59028,59029,59030,59031,59032,59033,59034,59035,59036,59037,59038,59039,59040,
+59041,59042,59043,59044,59045,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,59261,59262,59263,59264,59265,
+59266,59267,59268,59046,59047,59048,59049,59050,59051,59052,59053,59054,59055,
+59056,59057,59058,59059,59060,59061,59062,59063,59064,59065,59066,59067,59068,
+59069,59070,59071,59072,59073,59074,59075,59076,59077,59078,59079,59080,59081,
+59082,59083,59084,59085,59086,59087,59088,59089,59090,59091,59092,59093,59094,
+59095,59096,59097,59098,59099,59100,59101,59102,59103,59104,59105,59106,59107,
+59108,U,59109,59110,59111,59112,59113,59114,59115,59116,59117,59118,59119,
+59120,59121,59122,59123,59124,59125,59126,59127,59128,59129,59130,59131,59132,
+59133,59134,59135,59136,59137,59138,59139,59140,59141,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,59269,59270,59271,59272,59273,59274,59275,59276,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,59277,59278,59279,59280,59281,59282,
+59283,U,U,U,U,U,U,U,U,U,U,U,U,59284,59285,U,U,U,U,U,59286,U,U,59287,59288,
+59289,59290,59291,59292,59293,59294,59295,59142,59143,59144,59145,59146,59147,
+59148,59149,59150,59151,59152,59153,59154,59155,59156,59157,59158,59159,59160,
+59161,59162,59163,59164,59165,59166,59167,59168,59169,59170,59171,59172,59173,
+59174,59175,59176,59177,59178,59179,59180,59181,59182,59183,59184,59185,59186,
+59187,59188,59189,59190,59191,59192,59193,59194,59195,59196,59197,59198,59199,
+59200,59201,59202,59203,59204,U,59205,59206,59207,59208,59209,59210,59211,
+59212,59213,59214,59215,59216,59217,59218,59219,59220,59221,59222,59223,59224,
+59225,59226,59227,59228,59229,59230,59231,59232,59233,59234,59235,59236,59237,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,59296,59297,
+59298,59299,59300,59301,59302,59303,59304,59305,59306,59307,59308,59309,59310,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,59311,59312,
+59313,59314,59315,59316,59317,59318,59319,59320,59321,59322,59323,59324,59325,
+59326,59327,59328,59329,59330,59331,59332,59333,59334,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,59335,U,U,505,U,59337,59338,59339,59340,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,59341,59342,
+59343,59344,59345,59346,59347,59348,59349,59350,59351,59352,59353,59354,59355,
+59356,59357,59358,59359,59360,59361,59362,U,U,59363,U,59364,59365,59366,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+12350,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,
+U,59380,59381,59382,59383,59384,59385,59386,59387,59388,59389,59390,59391,
+59392,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,59393,59394,59395,59396,59397,59398,59399,59400,59401,59402,59403,59404,
+59405,59406,59407,57344,57345,57346,57347,57348,57349,57350,57351,57352,57353,
+57354,57355,57356,57357,57358,57359,57360,57361,57362,57363,57364,57365,57366,
+57367,57368,57369,57370,57371,57372,57373,57374,57375,57376,57377,57378,57379,
+57380,57381,57382,57383,57384,57385,57386,57387,57388,57389,57390,57391,57392,
+57393,57394,57395,57396,57397,57398,57399,57400,57401,57402,57403,57404,57405,
+57406,57407,57408,57409,57410,57411,57412,57413,57414,57415,57416,57417,57418,
+57419,57420,57421,57422,57423,57424,57425,57426,57427,57428,57429,57430,57431,
+57432,57433,57434,57435,57436,57437,57438,57439,57440,57441,57442,57443,57444,
+57445,57446,57447,57448,57449,57450,57451,57452,57453,57454,57455,57456,57457,
+57458,57459,57460,57461,57462,57463,57464,57465,57466,57467,57468,57469,57470,
+57471,57472,57473,57474,57475,57476,57477,57478,57479,57480,57481,57482,57483,
+57484,57485,57486,57487,57488,57489,57490,57491,57492,57493,57494,57495,57496,
+57497,57498,57499,57500,57501,57502,57503,57504,57505,57506,57507,57508,57509,
+57510,57511,57512,57513,57514,57515,57516,57517,57518,57519,57520,57521,57522,
+57523,57524,57525,57526,57527,57528,57529,57530,57531,57532,57533,57534,57535,
+57536,57537,57538,57539,57540,57541,57542,57543,57544,57545,57546,57547,57548,
+57549,57550,57551,57552,57553,57554,57555,57556,57557,57558,57559,57560,57561,
+57562,57563,57564,57565,57566,57567,57568,57569,57570,57571,57572,57573,57574,
+57575,57576,57577,57578,57579,57580,57581,57582,57583,57584,57585,57586,57587,
+57588,57589,57590,57591,57592,57593,57594,57595,57596,57597,57598,57599,57600,
+57601,57602,57603,57604,57605,57606,57607,57608,57609,57610,57611,57612,57613,
+57614,57615,57616,57617,57618,57619,57620,57621,57622,57623,57624,57625,57626,
+57627,57628,57629,57630,57631,57632,57633,57634,57635,57636,57637,57638,57639,
+57640,57641,57642,57643,57644,57645,57646,57647,57648,57649,57650,57651,57652,
+57653,57654,57655,57656,57657,57658,57659,57660,57661,57662,57663,57664,57665,
+57666,57667,57668,57669,57670,57671,57672,57673,57674,57675,57676,57677,57678,
+57679,57680,57681,57682,57683,57684,57685,57686,57687,57688,57689,57690,57691,
+57692,57693,57694,57695,57696,57697,57698,57699,57700,57701,57702,57703,57704,
+57705,57706,57707,57708,57709,57710,57711,57712,57713,57714,57715,57716,57717,
+57718,57719,57720,57721,57722,57723,57724,57725,57726,57727,57728,57729,57730,
+57731,57732,57733,57734,57735,57736,57737,57738,57739,57740,57741,57742,57743,
+57744,57745,57746,57747,57748,57749,57750,57751,57752,57753,57754,57755,57756,
+57757,57758,57759,57760,57761,57762,57763,57764,57765,57766,57767,57768,57769,
+57770,57771,57772,57773,57774,57775,57776,57777,57778,57779,57780,57781,57782,
+57783,57784,57785,57786,57787,57788,57789,57790,57791,57792,57793,57794,57795,
+57796,57797,57798,57799,57800,57801,57802,57803,57804,57805,57806,57807,57808,
+57809,57810,57811,57812,57813,57814,57815,57816,57817,57818,57819,57820,57821,
+57822,57823,57824,57825,57826,57827,57828,57829,57830,57831,57832,57833,57834,
+57835,57836,57837,57838,57839,57840,57841,57842,57843,57844,57845,57846,57847,
+57848,57849,57850,57851,57852,57853,57854,57855,57856,57857,57858,57859,57860,
+57861,57862,57863,57864,57865,57866,57867,57868,57869,57870,57871,57872,57873,
+57874,57875,57876,57877,57878,57879,57880,57881,57882,57883,57884,57885,57886,
+57887,57888,57889,57890,57891,57892,57893,57894,57895,57896,57897,57898,57899,
+57900,57901,57902,57903,57904,57905,57906,57907,59408,59409,59410,59411,59412,
+57908,57909,57910,57911,57912,57913,57914,57915,57916,57917,57918,57919,57920,
+57921,57922,57923,57924,57925,57926,57927,57928,57929,57930,57931,57932,57933,
+57934,57935,57936,57937,57938,57939,57940,57941,57942,57943,57944,57945,57946,
+57947,57948,57949,57950,57951,57952,57953,57954,57955,57956,57957,57958,57959,
+57960,57961,57962,57963,57964,57965,57966,57967,57968,57969,57970,57971,57972,
+57973,57974,57975,57976,57977,57978,57979,57980,57981,57982,57983,57984,57985,
+57986,57987,57988,57989,57990,57991,57992,57993,57994,57995,57996,57997,57998,
+57999,58000,58001,58002,58003,58004,58005,58006,58007,58008,58009,58010,58011,
+58012,58013,58014,58015,58016,58017,58018,58019,58020,58021,58022,58023,58024,
+58025,58026,58027,58028,58029,58030,58031,58032,58033,58034,58035,58036,58037,
+58038,58039,58040,58041,58042,58043,58044,58045,58046,58047,58048,58049,58050,
+58051,58052,58053,58054,58055,58056,58057,58058,58059,58060,58061,58062,58063,
+58064,58065,58066,58067,58068,58069,58070,58071,58072,58073,58074,58075,58076,
+58077,58078,58079,58080,58081,58082,58083,58084,58085,58086,58087,58088,58089,
+58090,58091,58092,58093,58094,58095,58096,58097,58098,58099,58100,58101,58102,
+58103,58104,58105,58106,58107,58108,58109,58110,58111,58112,58113,58114,58115,
+58116,58117,58118,58119,58120,58121,58122,58123,58124,58125,58126,58127,58128,
+58129,58130,58131,58132,58133,58134,58135,58136,58137,58138,58139,58140,58141,
+58142,58143,58144,58145,58146,58147,58148,58149,58150,58151,58152,58153,58154,
+58155,58156,58157,58158,58159,58160,58161,58162,58163,58164,58165,58166,58167,
+58168,58169,58170,58171,58172,58173,58174,58175,58176,58177,58178,58179,58180,
+58181,58182,58183,58184,58185,58186,58187,58188,58189,58190,58191,58192,58193,
+58194,58195,58196,58197,58198,58199,58200,58201,58202,58203,58204,58205,58206,
+58207,58208,58209,58210,58211,58212,58213,58214,58215,58216,58217,58218,58219,
+58220,58221,58222,58223,58224,58225,58226,58227,58228,58229,58230,58231,58232,
+58233,58234,58235,58236,58237,58238,58239,58240,58241,58242,58243,58244,58245,
+58246,58247,58248,58249,58250,58251,58252,58253,58254,58255,58256,58257,58258,
+58259,58260,58261,58262,58263,58264,58265,58266,58267,58268,58269,58270,58271,
+58272,58273,58274,58275,58276,58277,58278,58279,58280,58281,58282,58283,58284,
+58285,58286,58287,58288,58289,58290,58291,58292,58293,58294,58295,58296,58297,
+58298,58299,58300,58301,58302,58303,58304,58305,58306,58307,58308,58309,58310,
+58311,58312,58313,58314,58315,58316,58317,58318,58319,58320,58321,58322,58323,
+58324,58325,58326,58327,58328,58329,58330,58331,58332,58333,58334,58335,58336,
+58337,58338,58339,58340,58341,58342,58343,58344,58345,58346,58347,58348,58349,
+58350,58351,58352,58353,58354,58355,58356,58357,58358,58359,58360,58361,58362,
+58363,58364,58365,58366,58367,58368,58369,58370,58371,58372,58373,58374,58375,
+58376,58377,58378,58379,58380,58381,58382,58383,58384,58385,58386,58387,58388,
+58389,58390,58391,58392,58393,58394,58395,58396,58397,58398,58399,58400,58401,
+58402,58403,58404,58405,58406,58407,58408,58409,58410,58411,58412,58413,58414,
+58415,58416,58417,58418,58419,58420,58421,58422,58423,58424,58425,58426,58427,
+58428,58429,58430,58431,58432,58433,58434,58435,58436,58437,58438,58439,58440,
+58441,58442,58443,58444,58445,58446,58447,58448,58449,58450,58451,58452,58453,
+58454,58455,58456,58457,58458,58459,58460,58461,58462,58463,58464,58465,58466,
+58467,58468,58469,58470,58471,11905,59414,59415,59416,11908,13427,13383,11912,
+11915,59422,13726,13850,13838,11916,11927,14702,14616,59430,14799,14815,14963,
+14800,59435,59436,15182,15470,15584,11943,59441,59442,11946,16470,16735,11950,
+17207,11955,11958,11959,59451,17329,17324,11963,17373,17622,18017,17996,59459,
+U,18211,18217,18300,18317,11978,18759,18810,18813,18818,18819,18821,18822,
+18847,18843,18871,18870,59476,59477,19619,19615,19616,19617,19575,19618,19731,
+19732,19733,19734,19735,19736,19737,19886,59492,58472,58473,58474,58475,58476,
+58477,58478,58479,58480,58481,58482,58483,58484,58485,58486,58487,58488,58489,
+58490,58491,58492,58493,58494,58495,58496,58497,58498,58499,58500,58501,58502,
+58503,58504,58505,58506,58507,58508,58509,58510,58511,58512,58513,58514,58515,
+58516,58517,58518,58519,58520,58521,58522,58523,58524,58525,58526,58527,58528,
+58529,58530,58531,58532,58533,58534,58535,58536,58537,58538,58539,58540,58541,
+58542,58543,58544,58545,58546,58547,58548,58549,58550,58551,58552,58553,58554,
+58555,58556,58557,58558,58559,58560,58561,58562,58563,58564,58565,
+};
+
+static const struct dbcs_index gb18030ext_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gb18030ext_decmap+0,64,
+160},{__gb18030ext_decmap+97,64,254},{__gb18030ext_decmap+288,64,160},{
+__gb18030ext_decmap+385,64,254},{__gb18030ext_decmap+576,64,254},{
+__gb18030ext_decmap+767,64,254},{__gb18030ext_decmap+958,64,254},{
+__gb18030ext_decmap+1149,150,254},{__gb18030ext_decmap+1254,88,254},{
+__gb18030ext_decmap+1421,161,254},{__gb18030ext_decmap+1515,161,254},{
+__gb18030ext_decmap+1609,161,254},{__gb18030ext_decmap+1703,161,254},{
+__gb18030ext_decmap+1797,161,254},{__gb18030ext_decmap+1891,161,254},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__gb18030ext_decmap+1985,250,254},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gb18030ext_decmap
++1990,161,254},{__gb18030ext_decmap+2084,161,254},{__gb18030ext_decmap+2178,
+161,254},{__gb18030ext_decmap+2272,161,254},{__gb18030ext_decmap+2366,161,254
+},{__gb18030ext_decmap+2460,161,254},{__gb18030ext_decmap+2554,80,254},{0,0,0
+},
+};
+
+static const DBCHAR __gb18030ext_encmap[3227] = {
+43199,41699,65104,N,N,65108,N,N,N,65111,N,N,65112,65117,N,N,N,N,N,N,N,N,N,N,
+65118,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65131,N,N,65134,N,N,N,65137,N,N,N,N,65139,
+N,N,65140,65141,N,N,N,65145,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65156,43402,43403,
+43404,43405,43406,43407,43408,43409,43410,43411,43412,43413,43401,65110,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,65109,65114,65116,N,N,N,N,N,N,N,N,N,N,N,65115,65120,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65119,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65122,65125,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65123,
+65124,65128,65129,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,65130,65135,65136,65138,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65144,N,N,N,N,65143,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65146,65147,65149,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65148,65152,N,N,N,N,N,65153,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+65154,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65155,65157,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65158,
+N,N,65159,N,N,N,N,65160,65161,N,65162,65163,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,65165,N,N,N,65164,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65167,
+65166,65174,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,65171,65172,65173,65175,65170,65176,65177,65178,65179,65180,65181,
+65182,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65183,
+43681,43682,43683,43684,43685,43686,43687,43688,43689,43690,43691,43692,43693,
+43694,43695,43696,43697,43698,43699,43700,43701,43702,43703,43704,43705,43706,
+43707,43708,43709,43710,43711,43712,43713,43714,43715,43716,43717,43718,43719,
+43720,43721,43722,43723,43724,43725,43726,43727,43728,43729,43730,43731,43732,
+43733,43734,43735,43736,43737,43738,43739,43740,43741,43742,43743,43744,43745,
+43746,43747,43748,43749,43750,43751,43752,43753,43754,43755,43756,43757,43758,
+43759,43760,43761,43762,43763,43764,43765,43766,43767,43768,43769,43770,43771,
+43772,43773,43774,43937,43938,43939,43940,43941,43942,43943,43944,43945,43946,
+43947,43948,43949,43950,43951,43952,43953,43954,43955,43956,43957,43958,43959,
+43960,43961,43962,43963,43964,43965,43966,43967,43968,43969,43970,43971,43972,
+43973,43974,43975,43976,43977,43978,43979,43980,43981,43982,43983,43984,43985,
+43986,43987,43988,43989,43990,43991,43992,43993,43994,43995,43996,43997,43998,
+43999,44000,44001,44002,44003,44004,44005,44006,44007,44008,44009,44010,44011,
+44012,44013,44014,44015,44016,44017,44018,44019,44020,44021,44022,44023,44024,
+44025,44026,44027,44028,44029,44030,44193,44194,44195,44196,44197,44198,44199,
+44200,44201,44202,44203,44204,44205,44206,44207,44208,44209,44210,44211,44212,
+44213,44214,44215,44216,44217,44218,44219,44220,44221,44222,44223,44224,44225,
+44226,44227,44228,44229,44230,44231,44232,44233,44234,44235,44236,44237,44238,
+44239,44240,44241,44242,44243,44244,44245,44246,44247,44248,44249,44250,44251,
+44252,44253,44254,44255,44256,44257,44258,44259,44260,44261,44262,44263,44264,
+44265,44266,44267,44268,44269,44270,44271,44272,44273,44274,44275,44276,44277,
+44278,44279,44280,44281,44282,44283,44284,44285,44286,44449,44450,44451,44452,
+44453,44454,44455,44456,44457,44458,44459,44460,44461,44462,44463,44464,44465,
+44466,44467,44468,44469,44470,44471,44472,44473,44474,44475,44476,44477,44478,
+44479,44480,44481,44482,44483,44484,44485,44486,44487,44488,44489,44490,44491,
+44492,44493,44494,44495,44496,44497,44498,44499,44500,44501,44502,44503,44504,
+44505,44506,44507,44508,44509,44510,44511,44512,44513,44514,44515,44516,44517,
+44518,44519,44520,44521,44522,44523,44524,44525,44526,44527,44528,44529,44530,
+44531,44532,44533,44534,44535,44536,44537,44538,44539,44540,44541,44542,44705,
+44706,44707,44708,44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,
+44719,44720,44721,44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,
+44732,44733,44734,44735,44736,44737,44738,44739,44740,44741,44742,44743,44744,
+44745,44746,44747,44748,44749,44750,44751,44752,44753,44754,44755,44756,44757,
+44758,44759,44760,44761,44762,44763,44764,44765,44766,44767,44768,44769,44770,
+44771,44772,44773,44774,44775,44776,44777,44778,44779,44780,44781,44782,44783,
+44784,44785,44786,44787,44788,44789,44790,44791,44792,44793,44794,44795,44796,
+44797,44798,44961,44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,
+44972,44973,44974,44975,44976,44977,44978,44979,44980,44981,44982,44983,44984,
+44985,44986,44987,44988,44989,44990,44991,44992,44993,44994,44995,44996,44997,
+44998,44999,45000,45001,45002,45003,45004,45005,45006,45007,45008,45009,45010,
+45011,45012,45013,45014,45015,45016,45017,45018,45019,45020,45021,45022,45023,
+45024,45025,45026,45027,45028,45029,45030,45031,45032,45033,45034,45035,45036,
+45037,45038,45039,45040,45041,45042,45043,45044,45045,45046,45047,45048,45049,
+45050,45051,45052,45053,45054,63649,63650,63651,63652,63653,63654,63655,63656,
+63657,63658,63659,63660,63661,63662,63663,63664,63665,63666,63667,63668,63669,
+63670,63671,63672,63673,63674,63675,63676,63677,63678,63679,63680,63681,63682,
+63683,63684,63685,63686,63687,63688,63689,63690,63691,63692,63693,63694,63695,
+63696,63697,63698,63699,63700,63701,63702,63703,63704,63705,63706,63707,63708,
+63709,63710,63711,63712,63713,63714,63715,63716,63717,63718,63719,63720,63721,
+63722,63723,63724,63725,63726,63727,63728,63729,63730,63731,63732,63733,63734,
+63735,63736,63737,63738,63739,63740,63741,63742,63905,63906,63907,63908,63909,
+63910,63911,63912,63913,63914,63915,63916,63917,63918,63919,63920,63921,63922,
+63923,63924,63925,63926,63927,63928,63929,63930,63931,63932,63933,63934,63935,
+63936,63937,63938,63939,63940,63941,63942,63943,63944,63945,63946,63947,63948,
+63949,63950,63951,63952,63953,63954,63955,63956,63957,63958,63959,63960,63961,
+63962,63963,63964,63965,63966,63967,63968,63969,63970,63971,63972,63973,63974,
+63975,63976,63977,63978,63979,63980,63981,63982,63983,63984,63985,63986,63987,
+63988,63989,63990,63991,63992,63993,63994,63995,63996,63997,63998,64161,64162,
+64163,64164,64165,64166,64167,64168,64169,64170,64171,64172,64173,64174,64175,
+64176,64177,64178,64179,64180,64181,64182,64183,64184,64185,64186,64187,64188,
+64189,64190,64191,64192,64193,64194,64195,64196,64197,64198,64199,64200,64201,
+64202,64203,64204,64205,64206,64207,64208,64209,64210,64211,64212,64213,64214,
+64215,64216,64217,64218,64219,64220,64221,64222,64223,64224,64225,64226,64227,
+64228,64229,64230,64231,64232,64233,64234,64235,64236,64237,64238,64239,64240,
+64241,64242,64243,64244,64245,64246,64247,64248,64249,64250,64251,64252,64253,
+64254,64417,64418,64419,64420,64421,64422,64423,64424,64425,64426,64427,64428,
+64429,64430,64431,64432,64433,64434,64435,64436,64437,64438,64439,64440,64441,
+64442,64443,64444,64445,64446,64447,64448,64449,64450,64451,64452,64453,64454,
+64455,64456,64457,64458,64459,64460,64461,64462,64463,64464,64465,64466,64467,
+64468,64469,64470,64471,64472,64473,64474,64475,64476,64477,64478,64479,64480,
+64481,64482,64483,64484,64485,64486,64487,64488,64489,64490,64491,64492,64493,
+64494,64495,64496,64497,64498,64499,64500,64501,64502,64503,64504,64505,64506,
+64507,64508,64509,64510,64673,64674,64675,64676,64677,64678,64679,64680,64681,
+64682,64683,64684,64685,64686,64687,64688,64689,64690,64691,64692,64693,64694,
+64695,64696,64697,64698,64699,64700,64701,64702,64703,64704,64705,64706,64707,
+64708,64709,64710,64711,64712,64713,64714,64715,64716,64717,64718,64719,64720,
+64721,64722,64723,64724,64725,64726,64727,64728,64729,64730,64731,64732,64733,
+64734,64735,64736,64737,64738,64739,64740,64741,64742,64743,64744,64745,64746,
+64747,64748,64749,64750,64751,64752,64753,64754,64755,64756,64757,64758,64759,
+64760,64761,64762,64763,64764,64765,64766,64929,64930,64931,64932,64933,64934,
+64935,64936,64937,64938,64939,64940,64941,64942,64943,64944,64945,64946,64947,
+64948,64949,64950,64951,64952,64953,64954,64955,64956,64957,64958,64959,64960,
+64961,64962,64963,64964,64965,64966,64967,64968,64969,64970,64971,64972,64973,
+64974,64975,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,
+64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,
+65000,65001,65002,65003,65004,65005,65006,65007,65008,65009,65010,65011,65012,
+65013,65014,65015,65016,65017,65018,65019,65020,65021,65022,65185,65186,65187,
+65188,65189,65190,65191,65192,65193,65194,65195,65196,65197,65198,65199,65200,
+65201,65202,65203,65204,65205,65206,65207,65208,65209,65210,65211,65212,65213,
+65214,65215,65216,65217,65218,65219,65220,65221,65222,65223,65224,65225,65226,
+65227,65228,65229,65230,65231,65232,65233,65234,65235,65236,65237,65238,65239,
+65240,65241,65242,65243,65244,65245,65246,65247,65248,65249,65250,65251,65252,
+65253,65254,65255,65256,65257,65258,65259,65260,65261,65262,65263,65264,65265,
+65266,65267,65268,65269,65270,65271,65272,65273,65274,65275,65276,65277,65278,
+41280,41281,41282,41283,41284,41285,41286,41287,41288,41289,41290,41291,41292,
+41293,41294,41295,41296,41297,41298,41299,41300,41301,41302,41303,41304,41305,
+41306,41307,41308,41309,41310,41311,41312,41313,41314,41315,41316,41317,41318,
+41319,41320,41321,41322,41323,41324,41325,41326,41327,41328,41329,41330,41331,
+41332,41333,41334,41335,41336,41337,41338,41339,41340,41341,41342,41344,41345,
+41346,41347,41348,41349,41350,41351,41352,41353,41354,41355,41356,41357,41358,
+41359,41360,41361,41362,41363,41364,41365,41366,41367,41368,41369,41370,41371,
+41372,41373,41374,41375,41376,41536,41537,41538,41539,41540,41541,41542,41543,
+41544,41545,41546,41547,41548,41549,41550,41551,41552,41553,41554,41555,41556,
+41557,41558,41559,41560,41561,41562,41563,41564,41565,41566,41567,41568,41569,
+41570,41571,41572,41573,41574,41575,41576,41577,41578,41579,41580,41581,41582,
+41583,41584,41585,41586,41587,41588,41589,41590,41591,41592,41593,41594,41595,
+41596,41597,41598,41600,41601,41602,41603,41604,41605,41606,41607,41608,41609,
+41610,41611,41612,41613,41614,41615,41616,41617,41618,41619,41620,41621,41622,
+41623,41624,41625,41626,41627,41628,41629,41630,41631,41632,41792,41793,41794,
+41795,41796,41797,41798,41799,41800,41801,41802,41803,41804,41805,41806,41807,
+41808,41809,41810,41811,41812,41813,41814,41815,41816,41817,41818,41819,41820,
+41821,41822,41823,41824,41825,41826,41827,41828,41829,41830,41831,41832,41833,
+41834,41835,41836,41837,41838,41839,41840,41841,41842,41843,41844,41845,41846,
+41847,41848,41849,41850,41851,41852,41853,41854,41856,41857,41858,41859,41860,
+41861,41862,41863,41864,41865,41866,41867,41868,41869,41870,41871,41872,41873,
+41874,41875,41876,41877,41878,41879,41880,41881,41882,41883,41884,41885,41886,
+41887,41888,42048,42049,42050,42051,42052,42053,42054,42055,42056,42057,42058,
+42059,42060,42061,42062,42063,42064,42065,42066,42067,42068,42069,42070,42071,
+42072,42073,42074,42075,42076,42077,42078,42079,42080,42081,42082,42083,42084,
+42085,42086,42087,42088,42089,42090,42091,42092,42093,42094,42095,42096,42097,
+42098,42099,42100,42101,42102,42103,42104,42105,42106,42107,42108,42109,42110,
+42112,42113,42114,42115,42116,42117,42118,42119,42120,42121,42122,42123,42124,
+42125,42126,42127,42128,42129,42130,42131,42132,42133,42134,42135,42136,42137,
+42138,42139,42140,42141,42142,42143,42144,42304,42305,42306,42307,42308,42309,
+42310,42311,42312,42313,42314,42315,42316,42317,42318,42319,42320,42321,42322,
+42323,42324,42325,42326,42327,42328,42329,42330,42331,42332,42333,42334,42335,
+42336,42337,42338,42339,42340,42341,42342,42343,42344,42345,42346,42347,42348,
+42349,42350,42351,42352,42353,42354,42355,42356,42357,42358,42359,42360,42361,
+42362,42363,42364,42365,42366,42368,42369,42370,42371,42372,42373,42374,42375,
+42376,42377,42378,42379,42380,42381,42382,42383,42384,42385,42386,42387,42388,
+42389,42390,42391,42392,42393,42394,42395,42396,42397,42398,42399,42400,42560,
+42561,42562,42563,42564,42565,42566,42567,42568,42569,42570,42571,42572,42573,
+42574,42575,42576,42577,42578,42579,42580,42581,42582,42583,42584,42585,42586,
+42587,42588,42589,42590,42591,42592,42593,42594,42595,42596,42597,42598,42599,
+42600,42601,42602,42603,42604,42605,42606,42607,42608,42609,42610,42611,42612,
+42613,42614,42615,42616,42617,42618,42619,42620,42621,42622,42624,42625,42626,
+42627,42628,42629,42630,42631,42632,42633,42634,42635,42636,42637,42638,42639,
+42640,42641,42642,42643,42644,42645,42646,42647,42648,42649,42650,42651,42652,
+42653,42654,42655,42656,42816,42817,42818,42819,42820,42821,42822,42823,42824,
+42825,42826,42827,42828,42829,42830,42831,42832,42833,42834,42835,42836,42837,
+42838,42839,42840,42841,42842,42843,42844,42845,42846,42847,42848,42849,42850,
+42851,42852,42853,42854,42855,42856,42857,42858,42859,42860,42861,42862,42863,
+42864,42865,42866,42867,42868,42869,42870,42871,42872,42873,42874,42875,42876,
+42877,42878,42880,42881,42882,42883,42884,42885,42886,42887,42888,42889,42890,
+42891,42892,42893,42894,42895,42896,42897,42898,42899,42900,42901,42902,42903,
+42904,42905,42906,42907,42908,42909,42910,42911,42912,41643,41644,41645,41646,
+41647,41648,N,41700,41711,41712,41725,41726,42228,42229,42230,42231,42232,
+42233,42234,42235,42236,42237,42238,42487,42488,42489,42490,42491,42492,42493,
+42494,42681,42682,42683,42684,42685,42686,42687,42688,42713,42714,42715,42716,
+42717,42718,42719,42732,42733,42739,42742,42743,42744,42745,42746,42747,42748,
+42749,42750,42946,42947,42948,42949,42950,42951,42952,42953,42954,42955,42956,
+42957,42958,42959,42960,42994,42995,42996,42997,42998,42999,43000,43001,43002,
+43003,43004,43005,43006,43158,43159,43160,43161,43162,43163,43164,43165,43166,
+43167,43168,43196,N,43201,43202,43203,43204,43242,43243,43244,43245,43246,
+43247,43248,43249,43250,43251,43252,43253,43254,43255,43256,43257,43258,43259,
+43260,43261,43262,43352,43355,43357,43358,43359,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43415,43416,43417,43418,43419,43420,43421,43422,43423,43424,43425,43426,43427,
+43504,43505,43506,43507,43508,43509,43510,43511,43512,43513,43514,43515,43516,
+43517,43518,55290,55291,55292,55293,55294,N,65105,65106,65107,N,N,N,N,N,65113,
+N,N,N,N,N,N,N,65121,N,N,N,N,65126,65127,N,N,N,N,65132,65133,N,N,N,N,N,N,N,N,
+65142,N,N,N,N,N,N,N,65150,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65168,65169,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,65184,
+};
+
+static const struct unim_index gb18030ext_encmap[256] = {
+{0,0,0},{__gb18030ext_encmap+0,249,249},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__gb18030ext_encmap+1,172,172
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{__gb18030ext_encmap+2,129,202},{
+__gb18030ext_encmap+76,240,251},{__gb18030ext_encmap+88,62,62},{0,0,0},{0,0,0
+},{0,0,0},{__gb18030ext_encmap+89,71,115},{__gb18030ext_encmap+134,158,158},{
+__gb18030ext_encmap+135,14,26},{0,0,0},{0,0,0},{__gb18030ext_encmap+148,24,223
+},{__gb18030ext_encmap+348,115,115},{__gb18030ext_encmap+349,78,78},{
+__gb18030ext_encmap+350,110,224},{0,0,0},{0,0,0},{0,0,0},{__gb18030ext_encmap+
+465,86,86},{__gb18030ext_encmap+466,95,95},{0,0,0},{__gb18030ext_encmap+467,
+55,221},{__gb18030ext_encmap+634,214,214},{0,0,0},{__gb18030ext_encmap+635,76,
+97},{__gb18030ext_encmap+657,35,141},{0,0,0},{__gb18030ext_encmap+764,71,183},
+{0,0,0},{0,0,0},{__gb18030ext_encmap+877,119,163},{__gb18030ext_encmap+922,19,
+174},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{__gb18030ext_encmap+1078,0,255},{__gb18030ext_encmap+1334,0,255
+},{__gb18030ext_encmap+1590,0,255},{__gb18030ext_encmap+1846,0,255},{
+__gb18030ext_encmap+2102,0,255},{__gb18030ext_encmap+2358,0,255},{
+__gb18030ext_encmap+2614,0,255},{__gb18030ext_encmap+2870,0,255},{
+__gb18030ext_encmap+3126,0,100},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+
+static const struct _gb18030_to_unibmp_ranges {
+ Py_UCS4 first, last;
+ DBCHAR base;
+} gb18030_to_unibmp_ranges[] = {
+{128,163,0},{165,166,36},{169,175,38},{178,182,45},{184,214,50},{216,223,81},{
+226,231,89},{235,235,95},{238,241,96},{244,246,100},{248,248,103},{251,251,104
+},{253,256,105},{258,274,109},{276,282,126},{284,298,133},{300,323,148},{325,
+327,172},{329,332,175},{334,362,179},{364,461,208},{463,463,306},{465,465,307
+},{467,467,308},{469,469,309},{471,471,310},{473,473,311},{475,475,312},{477,
+504,313},{506,592,341},{594,608,428},{610,710,443},{712,712,544},{716,728,545
+},{730,912,558},{930,930,741},{938,944,742},{962,962,749},{970,1024,750},{1026
+,1039,805},{1104,1104,819},{1106,8207,820},{8209,8210,7922},{8215,8215,7924},{
+8218,8219,7925},{8222,8228,7927},{8231,8239,7934},{8241,8241,7943},{8244,8244,
+7944},{8246,8250,7945},{8252,8363,7950},{8365,8450,8062},{8452,8452,8148},{
+8454,8456,8149},{8458,8469,8152},{8471,8480,8164},{8482,8543,8174},{8556,8559,
+8236},{8570,8591,8240},{8596,8597,8262},{8602,8711,8264},{8713,8718,8374},{
+8720,8720,8380},{8722,8724,8381},{8726,8729,8384},{8731,8732,8388},{8737,8738,
+8390},{8740,8740,8392},{8742,8742,8393},{8748,8749,8394},{8751,8755,8396},{
+8760,8764,8401},{8766,8775,8406},{8777,8779,8416},{8781,8785,8419},{8787,8799,
+8424},{8802,8803,8437},{8808,8813,8439},{8816,8852,8445},{8854,8856,8482},{
+8858,8868,8485},{8870,8894,8496},{8896,8977,8521},{8979,9311,8603},{9322,9331,
+8936},{9372,9471,8946},{9548,9551,9046},{9588,9600,9050},{9616,9618,9063},{
+9622,9631,9066},{9634,9649,9076},{9652,9659,9092},{9662,9669,9100},{9672,9674,
+9108},{9676,9677,9111},{9680,9697,9113},{9702,9732,9131},{9735,9736,9162},{
+9738,9791,9164},{9793,9793,9218},{9795,11904,9219},{11906,11907,11329},{11909,
+11911,11331},{11913,11914,11334},{11917,11926,11336},{11928,11942,11346},{
+11944,11945,11361},{11947,11949,11363},{11951,11954,11366},{11956,11957,11370
+},{11960,11962,11372},{11964,11977,11375},{11979,12271,11389},{12284,12287,
+11682},{12292,12292,11686},{12312,12316,11687},{12319,12320,11692},{12330,
+12349,11694},{12351,12352,11714},{12436,12442,11716},{12447,12448,11723},{
+12535,12539,11725},{12543,12548,11730},{12586,12831,11736},{12842,12848,11982
+},{12850,12962,11989},{12964,13197,12102},{13200,13211,12336},{13215,13216,
+12348},{13218,13251,12350},{13253,13261,12384},{13263,13264,12393},{13267,
+13268,12395},{13270,13382,12397},{13384,13426,12510},{13428,13725,12553},{
+13727,13837,12851},{13839,13849,12962},{13851,14615,12973},{14617,14701,13738
+},{14703,14798,13823},{14801,14814,13919},{14816,14962,13933},{14964,15181,
+14080},{15183,15469,14298},{15471,15583,14585},{15585,16469,14698},{16471,
+16734,15583},{16736,17206,15847},{17208,17323,16318},{17325,17328,16434},{
+17330,17372,16438},{17374,17621,16481},{17623,17995,16729},{17997,18016,17102
+},{18018,18210,17122},{18212,18216,17315},{18218,18299,17320},{18301,18316,
+17402},{18318,18758,17418},{18760,18809,17859},{18811,18812,17909},{18814,
+18817,17911},{18820,18820,17915},{18823,18842,17916},{18844,18846,17936},{
+18848,18869,17939},{18872,19574,17961},{19576,19614,18664},{19620,19730,18703
+},{19738,19885,18814},{19887,19967,18962},{40870,55295,19043},{59244,59244,
+33469},{59336,59336,33470},{59367,59379,33471},{59413,59413,33484},{59417,
+59421,33485},{59423,59429,33490},{59431,59434,33497},{59437,59440,33501},{
+59443,59450,33505},{59452,59458,33513},{59460,59475,33520},{59478,59491,33536
+},{59493,63787,33550},{63789,63864,37845},{63866,63892,37921},{63894,63974,
+37948},{63976,63984,38029},{63986,64011,38038},{64016,64016,38064},{64018,
+64018,38065},{64021,64023,38066},{64025,64030,38069},{64034,64034,38075},{
+64037,64038,38076},{64042,65071,38078},{65074,65074,39108},{65093,65096,39109
+},{65107,65107,39113},{65112,65112,39114},{65127,65127,39115},{65132,65280,
+39116},{65375,65503,39265},{65510,65535,39394},{0,0,39420}};
diff --git a/contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h
new file mode 100644
index 00000000000..9012ae350c4
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_hk.h
@@ -0,0 +1,2379 @@
+// AUTO-GENERATED FILE FROM genmap_tchinese.py: DO NOT EDIT
+static const ucs2_t __big5hkscs_decmap[6219] = {
+17392,19506,17923,17830,17784,29287,19831,17843,31921,19682,31941,15253,18230,
+18244,19527,19520,17087,13847,29522,28299,28882,19543,41809,18255,17882,19589,
+31852,19719,19108,18081,27427,29221,23124,6755,15878,16225,26189,22267,U,
+32149,22813,35769,15860,38708,31727,23515,7518,23204,13861,40624,23249,23479,
+23804,26478,34195,39237,29793,29853,12736,12737,12738,12739,12740,268,12741,
+209,205,12742,12743,203,8168,12744,202,12745,12746,12747,12748,270,12749,
+12750,256,193,461,192,274,201,282,200,332,211,465,210,U,7870,U,7872,202,257,
+225,462,224,593,275,233,283,232,299,237,464,236,333,243,466,242,363,250,468,
+249,470,472,474,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,476,252,U,7871,U,7873,234,609,9178,9179,41897,4421,U,25866,U,U,20029,
+28381,40270,37343,U,U,30517,25745,20250,20264,20392,20822,20852,20892,20964,
+21153,21160,21307,21326,21457,21464,22242,22768,22788,22791,22834,22836,23398,
+23454,23455,23706,24198,24635,25993,26622,26628,26725,27982,28860,30005,32420,
+32428,32442,32455,32463,32479,32518,32567,33402,33487,33647,35270,35774,35810,
+36710,36711,36718,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,29713,31996,32205,26950,31433,21031,U,U,U,U,37260,30904,37214,32956,U,
+36107,33014,2535,U,U,32927,40647,19661,40393,40460,19518,40438,28686,40458,
+41267,13761,U,28314,33342,29977,U,18705,39532,39567,40857,31111,33900,7626,
+1488,10982,20004,20097,20096,20103,20159,20203,20279,13388,20413,15944,20483,
+20616,13437,13459,13477,20870,22789,20955,20988,20997,20105,21113,21136,21287,
+13767,21417,13649,21424,13651,21442,21539,13677,13682,13953,21651,21667,21684,
+21689,21712,21743,21784,21795,21800,13720,21823,13733,13759,21975,13765,32132,
+21797,U,3138,3349,20779,21904,11462,14828,833,36422,19896,38117,16467,32958,
+30586,11320,14900,18389,33117,27122,19946,25821,3452,4020,3285,4340,25741,
+36478,3734,3083,3940,11433,33366,17619,U,3398,39501,33001,18420,20135,11458,
+39602,14951,38388,16365,13574,21191,38868,30920,11588,40302,38933,U,17369,
+24741,25780,21731,11596,11210,4215,14843,4207,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,26330,26390,31136,25834,20562,3139,36456,
+8609,35660,1841,U,18443,425,16378,22643,11661,U,17864,1276,24727,3916,3478,
+21881,16571,17338,U,19124,10854,4253,33194,39157,3484,25465,14846,10101,36288,
+22177,25724,15939,U,42497,3593,10959,11465,U,4296,14786,14738,14854,33435,
+13688,24137,8391,22098,3889,11442,38688,13500,27709,20027,U,U,30068,11915,
+8712,42587,36045,3706,3124,26652,32659,4303,10243,10553,13819,20963,3724,3981,
+3754,16275,3888,3399,4431,3660,U,3755,2985,3400,4288,4413,16377,9878,25650,
+4013,13300,30265,11214,3454,3455,11345,11349,14872,3736,4295,3886,42546,27472,
+36050,36249,36042,38314,21708,33476,21945,U,40643,39974,39606,30558,11758,
+28992,33133,33004,23580,25970,33076,14231,21343,32957,37302,3834,3599,3703,
+3835,13789,19947,13833,3286,22191,10165,4297,3600,3704,4216,4424,33287,5205,
+3705,20048,11684,23124,4125,4126,4341,4342,22428,3601,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30356,33485,4021,3707,20862,14083,
+4022,4480,21208,41661,18906,6202,16759,33404,22681,21096,13850,22333,31666,
+23400,18432,19244,40743,18919,39967,39821,23412,12605,22011,13810,22153,20008,
+22786,7105,63608,38737,134,20059,20155,13630,23587,24401,24516,14586,25164,
+25909,27514,27701,27706,28780,29227,20012,29357,18665,32594,31035,31993,32595,
+25194,13505,U,25419,32770,32896,26130,26961,21341,34916,35265,30898,35744,
+36125,38021,38264,38271,38376,36367,38886,39029,39118,39134,39267,38928,40060,
+40479,40644,27503,63751,20023,135,38429,25143,38050,20539,28158,40051,40870,
+15817,34959,16718,28791,23797,19232,20941,13657,23856,24866,35378,36775,37366,
+29073,26393,29626,12929,41223,15499,6528,19216,30948,29698,20910,34575,16393,
+27235,41658,16931,34319,2671,31274,39239,35562,38741,28749,21284,8318,37876,
+30425,35299,40871,30685,20131,20464,20668,20015,20247,40872,21556,32139,22674,
+22736,7606,24210,24217,24514,10002,25995,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,13305,26905,27203,15459,27903,U,29184,17669,
+29580,16091,18963,23317,29881,35715,23716,22165,31379,31724,31939,32364,33528,
+34199,40873,34960,40874,36537,40875,36815,34143,39392,37409,40876,36281,5183,
+16497,17058,23066,U,U,U,39016,26475,17014,22333,U,34262,18811,33471,28941,
+19585,28020,23931,27413,28606,40877,40878,23446,40879,26343,32347,28247,31178,
+15752,17603,12886,10134,17306,17718,U,23765,15130,35577,23672,15634,13649,
+23928,40882,29015,17752,16620,7715,19575,14712,13386,420,27713,35532,20404,
+569,22975,33132,38998,39162,24379,2975,U,8641,35181,16642,18107,36985,16135,
+40883,41397,16632,14294,18167,27718,16764,34482,29695,17773,14548,21658,17761,
+17691,19849,19579,19830,17898,16328,19215,13921,17630,17597,16877,23870,23880,
+23894,15868,14351,23972,23993,14368,14392,24130,24253,24357,24451,14600,14612,
+14655,14669,24791,24893,23781,14729,25015,25017,25039,14776,25132,25232,25317,
+25368,14840,22193,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,14851,25570,25595,25607,25690,14923,25792,23829,22049,40863,14999,
+25990,15037,26111,26195,15090,26258,15138,26390,15170,26532,26624,15192,26698,
+26756,15218,15217,15227,26889,26947,29276,26980,27039,27013,15292,27094,15325,
+27237,27252,27249,27266,15340,27289,15346,27307,27317,27348,27382,27521,27585,
+27626,27765,27818,15563,27906,27910,27942,28033,15599,28068,28081,28181,28184,
+28201,28294,35264,28347,28386,28378,40831,28392,28393,28452,28468,15686,16193,
+28545,28606,15722,15733,29111,23705,15754,28716,15761,28752,28756,28783,28799,
+28809,805,17345,13809,3800,16087,22462,28371,28990,22496,13902,27042,35817,
+23412,31305,22753,38105,31333,31357,22956,31419,31408,31426,31427,29137,25741,
+16842,31450,31453,31466,16879,21682,23553,31499,31573,31529,21262,23806,31650,
+31599,33692,23476,27775,31696,33825,31634,U,23840,15789,23653,33938,31738,U,
+31797,23745,31812,31875,18562,31910,26237,17784,31945,31943,31974,31860,31987,
+31989,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+32359,17693,28228,32093,28374,29837,32137,32171,28981,32179,U,16471,24617,
+32228,15635,32245,6137,32229,33645,U,24865,24922,32366,32402,17195,37996,
+32295,32576,32577,32583,31030,25296,39393,32663,25425,32675,5729,104,17756,
+14182,17667,33594,32762,25737,U,32776,32797,U,32815,41095,27843,32827,32828,
+32865,10004,18825,26150,15843,26344,26405,32935,35400,33031,33050,22704,9974,
+27775,25752,20408,25831,5258,33304,6238,27219,19045,19093,17530,33321,2829,
+27218,15742,20473,5373,34018,33634,27402,18855,13616,6003,15864,33450,26907,
+63892,16859,34123,33488,33562,3606,6068,14017,12669,13658,33403,33506,33560,
+16011,28067,27397,27543,13774,15807,33565,21996,33669,17675,28069,33708,U,
+33747,13438,28372,27223,34138,13462,28226,12015,33880,23524,33905,15827,17636,
+27303,33866,15541,31064,U,27542,28279,28227,34014,U,33681,17568,33939,34020,
+23697,16960,23744,17731,34100,23282,28313,17703,34163,17686,26559,34326,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,34341,34363,
+34241,28808,34306,5506,28877,63922,17770,34344,13896,6306,21495,29594,34430,
+34673,41208,34798,11303,34737,34778,34831,22113,34412,26710,17935,34885,34886,
+30176,15801,30180,34910,34972,18011,34996,34997,25537,35013,30583,30479,35207,
+35210,U,U,35239,35260,35365,35303,31012,31421,35484,30611,37374,35472,31321,
+31465,31546,16271,18195,31544,29052,35596,35615,21552,21861,35647,35660,35661,
+35497,19066,35728,35739,35503,5855,17941,34895,35995,32084,32143,63956,14117,
+32083,36054,32152,32189,36114,36099,6416,36059,28764,36113,19657,16080,36265,
+32770,4116,18826,15228,33212,28940,31463,36525,36534,36547,37588,36633,36653,
+33637,33810,36773,37635,41631,2640,36787,18730,35294,34109,15803,24312,12898,
+36857,40980,34492,34049,8997,14720,28375,36919,34108,31422,36961,34156,34315,
+37032,34579,37060,34534,37038,U,37223,15088,37289,37316,31916,35123,7817,
+37390,27807,37441,37474,21945,U,35526,15515,35596,21979,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,3377,37676,37739,35553,35819,
+28815,23235,35554,35557,18789,37444,35820,35897,35839,37747,37979,36540,38277,
+38310,37926,38304,28662,17081,9850,34520,4732,15918,18911,27676,38523,38550,
+16748,38563,28373,25050,38582,30965,35552,38589,21452,18849,27832,628,25616,
+37039,37093,19153,6421,13066,38705,34370,38710,18959,17725,17797,19177,28789,
+23361,38683,U,37333,38743,23370,37355,38751,37925,20688,12471,12476,38793,
+38815,38833,38846,38848,38866,38880,21612,38894,29724,37939,U,38901,37917,
+31098,19153,38964,38963,38987,39014,15118,29045,15697,1584,16732,22278,39114,
+39095,39112,39111,19199,27943,5843,21936,39137,39142,39148,37752,39225,18985,
+19314,38999,39173,39413,39436,39483,39440,39512,22309,14020,37041,39893,39648,
+39650,39685,39668,19470,39700,39725,34304,20532,39732,27048,14531,12413,39760,
+39744,40254,23109,6243,39822,16971,39938,39935,39948,40552,40404,40887,41362,
+41387,41185,41251,41439,40318,40323,41268,40462,26760,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40388,8539,41363,41504,6459,41523,
+40249,41145,41652,40592,40597,40606,40610,19764,40618,40623,17252,40641,15200,
+14821,15645,20274,14270,35883,40706,40712,19350,37924,28066,40727,U,40761,
+22175,22154,40773,39352,37003,38898,33919,40802,40809,31452,40846,29206,19390,
+18805,18875,29047,18936,17224,19025,29598,35802,6394,31135,35198,36406,37737,
+37875,35396,37612,37761,37835,35180,17593,29207,16107,30578,31299,28880,17523,
+17400,29054,6127,28835,6334,13721,16071,6277,21551,6136,14114,5883,6201,14049,
+6004,6353,24395,14115,5824,22363,18981,5118,4776,5062,5302,34051,13990,U,
+33877,18836,29029,15921,21852,16123,28754,17652,14062,39325,28454,26617,14131,
+15381,15847,22636,6434,26640,16471,14143,16609,16523,16655,27681,21707,22174,
+26289,22162,4063,2984,3597,37830,35603,37788,20216,20779,14361,17462,20156,
+1125,895,20299,20362,22097,23144,427,971,14745,778,1044,13365,20265,704,36531,
+629,35546,524,20120,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,20685,20749,20386,20227,18958,16010,20290,20526,20588,20609,20428,
+20453,20568,20732,U,U,U,U,28278,13717,15929,16063,28018,6276,16009,20904,
+20931,1504,17629,1187,1170,1169,36218,35484,1806,21081,21156,2163,21217,U,
+18042,29068,17292,3104,18860,4324,27089,3613,U,16094,29849,29716,29782,29592,
+19342,19132,16525,21456,13700,29199,16585,21940,837,21709,3014,22301,37469,
+38644,37734,22493,22413,22399,13886,22731,23193,35398,5882,5999,5904,23084,
+22968,37519,23166,23247,23058,22854,6643,6241,17045,14069,27909,29763,23073,
+24195,23169,35799,1043,37856,29836,4867,28933,18802,37896,35323,37821,14240,
+23582,23710,24158,24136,6550,6524,15086,24269,23375,6403,6404,14081,6304,
+14045,5886,14035,33066,35399,7610,13426,35240,24332,24334,6439,6059,23147,
+5947,23364,34324,30205,34912,24702,10336,9771,24539,16056,9647,9662,37000,
+28531,25024,62,70,9755,24985,24984,24693,11419,11527,18132,37197,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,25713,18021,11114,
+14889,11042,13392,39146,11896,25399,42075,25782,25393,25553,18915,11623,25252,
+11425,25659,25963,26994,15348,12430,12973,18825,12971,21773,13024,6361,37951,
+26318,12937,12723,15072,16784,21892,35618,21903,5884,21851,21541,30958,12547,
+6186,12852,13412,12815,12674,17097,26254,27940,26219,19347,26160,30832,7659,
+26211,13010,13025,26142,22642,14545,14394,14268,15257,14242,13310,29904,15254,
+26511,17962,26806,26654,15300,27326,14435,14293,17543,27187,27218,27337,27397,
+6418,25873,26776,27212,15319,27258,27479,16320,15514,37792,37618,35818,35531,
+37513,32798,35292,37991,28069,28427,18924,U,16255,15759,28164,16444,23101,
+28170,22599,27940,30786,28987,17178,17014,28913,29264,29319,29332,18319,18213,
+20857,19108,1515,29818,16120,13919,19018,18711,24545,16134,16049,19167,35875,
+16181,24743,16115,29900,29756,37767,29751,17567,28138,17745,30083,16227,19673,
+19718,16216,30037,30323,42438,15129,29800,35532,18859,18830,15099,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,15821,19022,16127,
+18885,18675,37370,22322,37698,35555,6244,20703,21025,20967,30584,12850,30478,
+30479,30587,18071,14209,14942,18672,29752,29851,16063,19130,19143,16584,19094,
+25006,37639,21889,30750,30861,30856,30930,29648,31065,30529,22243,16654,U,
+33942,31141,27181,16122,31290,31220,16750,5862,16690,37429,31217,3404,18828,
+665,15802,5998,13719,21867,13680,13994,468,3085,31458,23129,9973,23215,23196,
+23053,603,30960,23082,23494,31486,16889,31837,31853,16913,23475,24252,24230,
+31949,18937,6064,31886,31868,31918,27314,32220,32263,32211,32590,25185,24924,
+31560,32151,24194,17002,27509,2326,26582,78,13775,22468,25618,25592,18786,
+32733,31527,2092,23273,23875,31500,24078,39398,34373,39523,27164,13375,14818,
+18935,26029,39455,26016,33920,28967,27857,17642,33079,17410,32966,33033,33090,
+26548,39107,27202,33378,33381,27217,33875,28071,34320,29211,23174,16767,6208,
+23339,6305,23268,6360,34464,63932,15759,34861,29730,23042,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,34926,20293,34951,35007,35046,
+35173,35149,22147,35156,30597,30596,35829,35801,35740,35321,16045,33955,18165,
+18127,14322,35389,35356,37960,24397,37419,17028,26068,28969,28868,6213,40301,
+35999,36073,32220,22938,30659,23024,17262,14036,36394,36519,19465,36656,36682,
+17140,27736,28603,8993,18587,28537,28299,6106,39913,14005,18735,37051,U,21873,
+18694,37307,37892,35403,16482,35580,37927,35869,35899,34021,35371,38297,38311,
+38295,38294,36148,29765,16066,18687,19010,17386,16103,12837,38543,36583,36454,
+36453,16076,18925,19064,16366,29714,29803,16124,38721,37040,26695,18973,37011,
+22495,U,37736,35209,35878,35631,25534,37562,23313,35689,18748,29689,16923,
+38811,38769,39224,3878,24001,35781,19122,38943,38106,37622,38359,37349,17600,
+35664,19047,35684,39132,35397,16128,37418,18725,33812,39227,39245,31494,15869,
+39323,19311,39338,39516,35685,22728,27279,39457,23294,39471,39153,19344,39240,
+39356,19389,19351,37757,22642,4866,22562,18872,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,5352,30788,10015,15800,26821,15741,
+37976,14631,24912,10113,10603,24839,40015,40019,40059,39989,39952,39807,39887,
+40493,39839,41461,41214,40225,19630,16644,40472,19632,40204,41396,41197,41203,
+39215,40357,33981,28178,28639,27522,34300,17715,28068,28292,28144,33824,34286,
+28160,14295,24676,31202,13724,13888,18733,18910,15714,37851,37566,37704,703,
+30905,37495,37965,20452,13376,36964,21853,30781,30804,30902,30795,5975,12745,
+18753,13978,20338,28634,28633,U,28702,21524,16821,22459,22771,22410,40214,
+22487,28980,13487,16812,29163,27712,20375,U,6069,35401,24844,23246,23051,
+17084,17544,14124,19323,35324,37819,37816,6358,3869,33906,27840,5139,17146,
+11302,17345,22932,15799,26433,32168,24923,24740,18873,18827,35322,37605,29666,
+16105,29876,35683,6303,16097,19123,27352,29683,29691,16086,19006,19092,6105,
+19046,935,5156,18917,29768,18710,28837,18806,37508,29670,37727,1278,37681,
+35534,35350,37766,35815,21973,18741,35458,29035,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,18755,3327,22180,1562,3051,3256,21762,
+31172,6138,32254,5826,19024,6226,17710,37889,14090,35520,18861,22960,6335,
+6275,29828,23201,14050,15707,14000,37471,23161,35457,6242,37748,15565,2740,
+19094,14730,20724,15721,15692,5020,29045,17147,33304,28175,37092,17643,27991,
+32335,28775,27823,15574,16365,15917,28162,28428,15727,1013,30033,14012,13512,
+18048,16090,18545,22980,37486,18750,36673,35868,27584,22546,22472,14038,5202,
+28926,17250,19057,12259,4784,9149,26809,26983,5016,13541,31732,14047,35459,
+14294,13306,19615,27162,13997,27831,33854,17631,17614,27942,27985,27778,28638,
+28439,28937,33597,5946,33773,27776,28755,6107,22921,23170,6067,23137,23153,
+6405,16892,14125,23023,5948,14023,29070,37776,26266,17061,23150,23083,17043,
+27179,16121,30518,17499,17098,28957,16985,35297,20400,27944,23746,17614,32333,
+17341,27148,16982,4868,28838,28979,17385,15781,27871,63525,19023,32357,23019,
+23855,15859,24412,19037,6111,32164,33830,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,21637,15098,13056,532,22398,2261,1561,16357,
+8094,41654,28675,37211,23920,29583,31955,35417,37920,20424,32743,29389,29456,
+31476,29496,29497,22262,29505,29512,16041,31512,36972,29173,18674,29665,33270,
+16074,30476,16081,27810,22269,29721,29726,29727,16098,16112,16116,16122,29907,
+16142,16211,30018,30061,30066,30093,16252,30152,30172,16320,30285,16343,30324,
+16348,30330,20316,29064,22051,35200,22633,16413,30531,16441,26465,16453,13787,
+30616,16490,16495,23646,30654,30667,22770,30744,28857,30748,16552,30777,30791,
+30801,30822,33864,21813,31027,26627,31026,16643,16649,31121,31129,36795,31238,
+36796,16743,31377,16818,31420,33401,16836,31439,31451,16847,20001,31586,31596,
+31611,31762,31771,16992,17018,31867,31900,17036,31928,17044,31981,36755,28864,
+3279,32207,32212,32208,32253,32686,32692,29343,17303,32800,32805,31545,32814,
+32817,32852,15820,22452,28832,32951,33001,17389,33036,29482,33038,33042,30048,
+33044,17409,15161,33110,33113,33114,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,17427,22586,33148,33156,17445,33171,17453,33189,
+22511,33217,33252,33364,17551,33446,33398,33482,33496,33535,17584,33623,38505,
+27018,33797,28917,33892,24803,33928,17668,33982,34017,34040,34064,34104,34130,
+17723,34159,34160,34272,17783,34418,34450,34482,34543,38469,34699,17926,17943,
+34990,35071,35108,35143,35217,31079,35369,35384,35476,35508,35921,36052,36082,
+36124,18328,22623,36291,18413,20206,36410,21976,22356,36465,22005,36528,18487,
+36558,36578,36580,36589,36594,36791,36801,36810,36812,36915,39364,18605,39136,
+37395,18718,37416,37464,37483,37553,37550,37567,37603,37611,37619,37620,37629,
+37699,37764,37805,18757,18769,40639,37911,21249,37917,37933,37950,18794,37972,
+38009,38189,38306,18855,38388,38451,18917,26528,18980,38720,18997,38834,38850,
+22100,19172,24808,39097,19225,39153,22596,39182,39193,20916,39196,39223,39234,
+39261,39266,19312,39365,19357,39484,39695,31363,39785,39809,39901,39921,39924,
+19565,39968,14191,7106,40265,39994,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,40702,22096,40339,40381,40384,40444,38134,36790,
+40571,40620,40625,40637,40646,38108,40674,40689,40696,31432,40772,148,695,928,
+26906,38083,22956,1239,22592,38081,14265,1493,1557,1654,5818,22359,29043,2754,
+2765,3007,21610,63547,3019,21662,3067,3131,3155,3173,3196,24807,3213,22138,
+3253,3293,3309,3439,3506,3528,26965,39983,34725,3588,3598,3799,3984,3885,3699,
+23584,4028,24075,4188,4175,4214,26398,4219,4232,4246,13895,4287,4307,4399,
+4411,21348,33965,4835,4981,4918,35713,5495,5657,6083,6087,20088,28859,6189,
+6506,6701,6725,7210,7280,7340,7880,25283,7893,7957,29080,26709,8261,27113,
+14024,8828,9175,9210,10026,10353,10575,33533,10599,10643,10965,35237,10984,
+36768,11022,38840,11071,38983,39613,11340,U,11400,11447,23528,11528,11538,
+11703,11669,11842,12148,12236,12339,12390,13087,13278,24497,26184,26303,31353,
+13671,13811,U,18874,U,13850,14102,U,838,22709,26382,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,26904,15015,30295,24546,15889,16057,
+30206,8346,18640,19128,16665,35482,17134,17165,16443,17204,17302,19013,1482,
+20946,1553,22943,7848,15294,15615,17412,17622,22408,18036,14747,18223,34280,
+39369,14178,8643,35678,35662,U,18450,18683,18965,29193,19136,3192,22885,20133,
+20358,1913,36570,20524,21135,22335,29041,21145,21529,16202,19111,21948,21574,
+21614,27474,U,13427,21823,30258,21854,18200,21858,21862,22471,18751,22621,
+20582,13563,13260,U,22787,18300,35144,23214,23433,23558,7568,22433,29009,U,
+24834,31762,36950,25010,20378,35682,25602,25674,23899,27639,U,25732,6428,
+35562,18934,25736,16367,25874,19392,26047,26293,10011,37989,22497,24981,23079,
+63693,U,22201,17697,26364,20074,18740,38486,28047,27837,13848,35191,26521,
+26734,25617,26718,U,26823,31554,37056,2577,26918,U,26937,31301,U,27130,39462,
+27181,13919,25705,33,31107,27188,27483,23852,13593,U,27549,18128,27812,30011,
+34917,28078,22710,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,14108,9613,28747,29133,15444,29312,29317,37505,8570,29323,37680,29414,
+18896,27705,38047,29776,3832,34855,35061,10534,33907,6065,28344,18986,6176,
+14756,14009,U,U,17727,26294,40109,39076,35139,30668,30808,22230,16607,5642,
+14753,14127,33000,5061,29101,33638,31197,37288,U,19639,28847,35243,31229,
+31242,31499,32102,16762,31555,31102,32777,28597,41695,27139,33560,21410,28167,
+37823,26678,38749,33135,32803,27061,5101,12847,32840,23941,35888,32899,22293,
+38947,35145,23979,18824,26046,27093,21458,19109,16257,15377,26422,32912,33012,
+33070,8097,33103,33161,33199,33306,33542,33583,33674,13770,33896,34474,18682,
+25574,35158,30728,37461,35256,17394,35303,17375,35304,35654,35796,23032,35849,
+U,36805,37100,U,37136,37180,15863,37214,19146,36816,29327,22155,38119,38377,
+38320,38328,38706,39121,39241,39274,39363,39464,39694,40282,40347,32415,40696,
+40739,19620,38215,41619,29090,41727,19857,36882,42443,19868,3228,36798,21953,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,36794,
+9392,36793,19091,17673,32383,28502,27313,20202,13540,35628,30877,14138,36480,
+6133,32804,35692,35737,31294,26287,15851,30293,15543,22069,22870,20122,24193,
+25176,22207,3693,36366,23405,16008,19614,25566,U,6134,6267,25904,22061,23626,
+21530,21265,15814,40344,19581,22050,22046,32585,24280,22901,15680,34672,19996,
+4074,3401,14010,33047,40286,36120,30267,40005,30286,30649,37701,21554,33096,
+33527,22053,33074,33816,32957,21994,31074,22083,21526,3741,13774,22021,22001,
+26353,33506,13869,30004,22000,21946,21655,21874,3137,3222,24272,20808,3702,
+11362,3746,40619,32090,21982,4213,25245,38765,21652,36045,29174,37238,25596,
+25529,25598,21865,11075,40050,11955,20890,13535,3495,20903,21581,21790,21779,
+30310,36397,26762,30129,32950,34820,34694,35015,33206,33820,4289,17644,29444,
+18182,23440,33547,26771,22139,9972,32047,16803,32115,28368,29366,37232,4569,
+37384,15612,42665,3756,3833,29286,7330,18254,20418,32761,4075,16634,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40029,25887,11680,
+18675,18400,40316,4076,3594,U,30115,4077,U,24648,4487,29091,32398,40272,19994,
+19972,13687,23309,27826,21351,13996,14812,21373,13989,17944,22682,19310,33325,
+21579,22442,23189,2425,U,14930,9317,29556,40620,19721,39917,15614,40752,19547,
+20393,38302,40926,33884,15798,29362,26547,14112,25390,32037,16119,15916,14890,
+36872,21196,15988,13946,17897,1166,30272,23280,3766,30842,32558,22695,16575,
+22140,39819,23924,30292,42036,40581,19681,U,14331,24857,12506,17394,U,22109,
+4777,22439,18787,40454,21044,28846,13741,U,40316,31830,39737,22494,5996,23635,
+25811,38096,25397,29028,34477,3368,27938,19170,3441,U,20990,7951,23950,38659,
+7633,40577,36940,31519,39682,23761,31651,25192,25397,39679,31695,39722,31870,
+U,31810,31878,39957,31740,39689,U,39963,18750,40794,21875,23491,20477,40600,
+20466,21088,15878,21201,22375,20566,22967,24082,38856,40363,36700,21609,38836,
+39232,38842,21292,24880,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,26924,21466,39946,40194,19515,38465,27008,20646,30022,5997,
+39386,21107,U,37209,38529,37212,U,37201,36503,25471,27939,27338,22033,37262,
+30074,25221,1020,29519,31856,23585,15613,U,18713,30422,39837,20010,3284,33726,
+34882,U,23626,27072,U,22394,21023,24053,20174,27697,498,20281,21660,21722,
+21146,36226,13822,U,13811,U,27474,37244,40869,39831,38958,39092,39610,40616,
+40580,29050,31508,U,27642,34840,32632,U,22048,42570,36471,40787,U,36308,36431,
+40476,36353,25218,33661,36392,36469,31443,19063,31294,30936,27882,35431,30215,
+35418,40742,27854,34774,30147,41650,30803,63552,36108,29410,29553,35629,29442,
+29937,36075,19131,34351,24506,34976,17591,U,6203,28165,U,35454,9499,U,24829,
+30311,39639,40260,37742,39823,34805,U,U,36087,29484,38689,39856,13782,29362,
+19463,31825,39242,24921,24921,19460,40598,24957,U,22367,24943,25254,25145,U,
+14940,25058,21418,13301,25444,26626,13778,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,23895,35778,36826,36409,U,20697,7494,30982,
+21298,38456,3899,16485,U,30718,U,31938,24346,31962,31277,32870,32867,32077,
+29957,29938,35220,33306,26380,32866,29830,32859,29936,33027,30500,35209,26572,
+30035,28369,34729,34766,33224,34700,35401,36013,35651,30507,29944,34010,13877,
+27058,36262,U,35241,U,28089,34753,16401,29927,15835,29046,24740,24988,15569,U,
+24695,U,32625,35629,U,24809,19326,21024,15384,15559,24279,30294,21809,6468,
+4862,39171,28124,28845,23745,25005,35343,13943,238,26694,20238,17762,23327,
+25420,40784,40614,25195,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,
+9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,8560,8561,8562,8563,8564,
+8565,8566,8567,8568,8569,20022,20031,20101,20128,20866,20886,20907,21241,
+21304,21353,21430,22794,23424,24027,12083,24191,U,24400,24417,25908,U,30098,U,
+36789,U,168,710,12541,12542,12445,12446,U,U,12293,12294,12295,12540,65339,
+65341,10045,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,
+12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,
+12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,
+12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,
+12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,
+12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,
+12429,12430,12431,12432,12433,12434,12435,12449,12450,12451,12452,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,12453,12454,12455,
+12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,
+12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,
+12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,
+12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,
+12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,
+12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,
+12534,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,
+1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,
+1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,
+1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,
+1097,1098,1099,1100,1101,1102,1103,8679,8632,8633,12751,204,20058,138,20994,
+17553,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+40880,20872,40881,30215,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,65506,65508,65287,65282,12849,8470,8481,12443,12444,
+11904,11908,11910,11911,11912,11914,11916,11917,11925,11932,11933,11941,11943,
+11946,11948,11950,11958,11964,11966,11974,11978,11980,11981,11983,11990,11991,
+11998,12003,U,U,U,643,592,603,596,629,339,248,331,650,618,30849,37561,35023,
+22715,24658,31911,23290,9556,9574,9559,9568,9580,9571,9562,9577,9565,9554,
+9572,9557,9566,9578,9569,9560,9575,9563,9555,9573,9558,9567,9579,9570,9561,
+9576,9564,9553,9552,9581,9582,9584,9583,65517,1351,37595,1503,16325,34124,
+17077,29679,20917,13897,18754,35300,37700,6619,33518,15560,30780,26436,25311,
+18739,35242,672,27571,4869,20395,9453,20488,27945,31364,13824,19121,9491,U,
+894,24484,896,839,28379,1055,U,20737,13434,20750,39020,14147,33814,18852,1159,
+20832,13236,20842,3071,8444,741,9520,1422,12851,6531,23426,34685,1459,15513,
+20914,20920,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,40244,20937,20943,20945,15580,20947,19110,20915,20962,21314,20973,33741,
+26942,14125,24443,21003,21030,21052,21173,21079,21140,21177,21189,31765,34114,
+21216,34317,27411,U,35550,21833,28377,16256,2388,16364,21299,U,3042,27851,
+5926,26651,29653,24650,16042,14540,5864,29149,17570,21357,21364,34475,21374,U,
+5526,5651,30694,21395,35483,21408,21419,21422,29607,22386,16217,29596,21441,
+21445,27721,20041,22526,21465,15019,2959,21472,16363,11683,21494,3191,21523,
+28793,21803,26199,27995,21613,27475,3444,21853,21647,21668,18342,5901,3805,
+15796,3405,35260,9880,21831,19693,21551,29719,21894,21929,U,6359,16442,17746,
+17461,26291,4276,22071,26317,12938,26276,26285,22093,22095,30961,22257,38791,
+21502,22272,22255,22253,35686,13859,4687,22342,16805,27758,28811,22338,14001,
+27774,22502,5142,22531,5204,17251,22566,19445,22620,22698,13665,22752,22748,
+4668,22779,23551,22339,41296,17016,37843,13729,22815,26790,14019,28249,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,5694,23076,
+21843,5778,34053,22985,3406,27777,27946,6108,23001,6139,6066,28070,28017,6184,
+5845,23033,28229,23211,23139,14054,18857,U,14088,23190,29797,23251,28577,9556,
+15749,6417,14130,5816,24195,21200,23414,25992,23420,31246,16388,18525,516,
+23509,24928,6708,22988,1445,23539,23453,19728,23557,6980,23571,29646,23572,
+7333,27432,23625,18653,23685,23785,23791,23947,7673,7735,23824,23832,23878,
+7844,23738,24023,33532,14381,18689,8265,8563,33415,14390,15298,24110,27274,U,
+24186,17596,3283,21414,20151,U,21416,6001,24073,24308,33922,24313,24315,14496,
+24316,26686,37915,24333,449,63636,15070,18606,4922,24378,26760,9168,U,9329,
+24419,38845,28270,24434,37696,35382,24487,23990,15711,21072,8042,28920,9832,
+37334,670,35369,24625,26245,6263,14691,15815,13881,22416,10164,31089,15936,
+24734,U,24755,18818,18831,31315,29860,20705,23200,24932,33828,24898,63654,
+28370,24961,20980,1622,24967,23466,16311,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,10335,25043,35741,39261,25040,14642,10624,
+10433,24611,24924,25886,25483,280,25285,6000,25301,11789,25452,18911,14871,
+25656,25592,5006,6140,U,28554,11830,38932,16524,22301,25825,25829,38011,14950,
+25658,14935,25933,28438,18984,18979,25989,25965,25951,12414,26037,18752,19255,
+26065,16600,6185,26080,26083,24543,13312,26136,12791,12792,26180,12708,12709,
+26187,3701,26215,20966,26227,U,7741,12849,34292,12744,21267,30661,10487,39332,
+26370,17308,18977,15147,27130,14274,U,26471,26466,16845,37101,26583,17641,
+26658,28240,37436,26625,13286,28064,26717,13423,27105,27147,35551,26995,26819,
+13773,26881,26880,15666,14849,13884,15232,26540,26977,35402,17148,26934,27032,
+15265,969,33635,20624,27129,13913,8490,27205,14083,27293,15347,26545,27336,
+37276,15373,27421,2339,24798,27445,27508,10189,28341,15067,949,6488,14144,
+21537,15194,27617,16124,27612,27703,9355,18673,27473,27738,33318,27769,15804,
+17605,15805,16804,18700,18688,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,15561,14053,15595,3378,39811,12793,9361,32655,26679,27941,
+28065,28139,28054,27996,28284,28420,18815,16517,28274,34099,28532,20935,U,U,
+33838,35617,U,15919,29779,16258,31180,28239,23185,12363,28664,14093,28573,
+15920,28410,5271,16445,17749,37872,28484,28508,15694,28532,37232,15675,28575,
+16708,28627,16529,16725,16441,16368,16308,16703,20959,16726,16727,16704,25053,
+28747,28798,28839,28801,28876,28885,28886,28895,16644,15848,29108,29078,17015,
+28971,28997,23176,29002,U,23708,17253,29007,37730,17089,28972,17498,18983,
+18978,29114,35816,28861,29198,37954,29205,22801,37955,29220,37697,22021,29230,
+29248,18804,26813,29269,29271,15957,12356,26637,28477,29314,U,29483,18467,
+34859,18669,34820,29480,29486,29647,29610,3130,27182,29641,29769,16866,5863,
+18980,26147,14021,18871,18829,18939,29687,29717,26883,18982,29753,1475,16087,
+U,10413,29792,36530,29767,29668,29814,33721,29804,14128,29812,37873,27180,
+29826,18771,19084,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,16735,19065,35727,23366,35843,6302,29896,6536,29966,U,29982,36569,
+6731,23511,36524,37765,30029,30026,30055,30062,20354,16132,19731,30094,29789,
+30110,30132,30210,30252,30289,30287,30319,30326,25589,30352,33263,14328,26897,
+26894,30369,30373,30391,30412,28575,33890,20637,20861,7708,30494,30502,30528,
+25775,21024,30552,12972,30639,35172,35176,5825,30708,U,4982,18962,26826,30895,
+30919,30931,38565,31022,21984,30935,31028,30897,30220,36792,34948,35627,24707,
+9756,31110,35072,26882,31104,22615,31133,31545,31036,31145,28202,28966,16040,
+31174,37133,31188,
+};
+
+static const struct dbcs_index big5hkscs_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__big5hkscs_decmap+0,64,121},{__big5hkscs_decmap+58,64,170},{
+__big5hkscs_decmap+165,64,254},{__big5hkscs_decmap+356,64,254},{
+__big5hkscs_decmap+547,64,253},{__big5hkscs_decmap+737,64,254},{
+__big5hkscs_decmap+928,64,254},{__big5hkscs_decmap+1119,64,254},{
+__big5hkscs_decmap+1310,64,253},{__big5hkscs_decmap+1500,64,254},{
+__big5hkscs_decmap+1691,64,254},{__big5hkscs_decmap+1882,64,254},{
+__big5hkscs_decmap+2073,64,254},{__big5hkscs_decmap+2264,64,254},{
+__big5hkscs_decmap+2455,64,254},{__big5hkscs_decmap+2646,64,254},{
+__big5hkscs_decmap+2837,64,254},{__big5hkscs_decmap+3028,64,254},{
+__big5hkscs_decmap+3219,64,254},{__big5hkscs_decmap+3410,64,254},{
+__big5hkscs_decmap+3601,64,254},{__big5hkscs_decmap+3792,64,254},{
+__big5hkscs_decmap+3983,64,254},{__big5hkscs_decmap+4174,64,254},{
+__big5hkscs_decmap+4365,64,254},{__big5hkscs_decmap+4556,64,254},{0,0,0},{0,0,
+0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__big5hkscs_decmap+4747,
+161,254},{__big5hkscs_decmap+4841,64,254},{__big5hkscs_decmap+5032,64,254},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__big5hkscs_decmap+5223,214,254},{__big5hkscs_decmap+5264,64,254},{
+__big5hkscs_decmap+5455,64,254},{__big5hkscs_decmap+5646,64,254},{
+__big5hkscs_decmap+5837,64,254},{__big5hkscs_decmap+6028,64,254},{0,0,0},
+};
+
+static const unsigned char big5hkscs_phint_0[] = {
+32,5,95,68,15,82,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,208,44,4,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,4,0,0,0,0,0,0,0,0,0,0,0,0,1,22,0,15,0,0,0,0,0,
+32,87,43,247,252,110,242,144,11,0,0,0,192,237,164,15,38,193,155,118,242,239,
+222,251,250,247,15,50,68,175,254,239,5,0,0,0,224,251,71,128,193,2,0,132,100,4,
+130,64,32,162,130,133,164,145,0,16,1,0,0,0,144,72,12,0,48,0,84,3,48,68,24,19,
+53,137,38,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,64,0,32,43,153,32,16,99,40,36,
+1,0,0,0,0,80,96,212,0,210,42,24,157,104,53,151,79,216,248,32,196,130,28,40,2,
+0,0,0,0,214,81,10,224,0,129,134,22,67,196,53,17,55,96,230,122,109,5,12,61,0,0,
+0,0,153,57,128,7,34,254,129,144,24,144,12,116,48,208,160,9,41,21,253,4,0,0,0,
+0,223,128,64,8,8,176,219,196,96,237,118,125,249,29,228,211,133,166,205,5,0,0,
+0,0,12,0,110,186,9,47,96,84,0,30,120,104,34,112,86,158,37,243,142,7,0,0,0,192,
+94,44,188,155,223,93,108,109,4,67,96,54,74,96,216,62,7,196,200,1,0,0,0,160,
+177,197,98,11,12,34,62,204,37,184,1,174,237,92,104,13,148,74,181,0,0,0,0,0,
+244,3,18,17,16,68,2,53,144,235,14,153,7,209,202,5,130,161,160,0,0,0,0,52,24,
+160,137,231,156,91,8,132,3,2,218,144,236,219,135,133,191,162,45,0,0,0,0,118,
+58,118,98,130,148,24,1,24,125,254,141,87,39,19,210,91,55,25,12,0,0,0,0,110,
+139,33,145,0,0,0,64,0,0,0,2,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,
+0,0,0,0,0,0,0,2,0,0,0,0,0,0,142,120,110,95,63,126,221,61,247,252,155,252,174,
+210,255,143,107,1,0,0,0,192,159,255,234,186,186,93,188,115,159,250,216,214,
+222,37,75,94,151,218,42,1,0,0,0,224,182,153,27,216,116,230,79,21,191,41,230,
+255,38,117,109,227,255,155,82,0,0,0,0,80,96,126,111,153,169,80,14,0,128,16,
+216,35,0,37,16,144,244,235,117,0,0,0,0,208,219,0,160,152,178,123,6,82,32,152,
+22,200,61,9,0,0,1,0,0,0,0,0,0,0,4,40,200,34,0,2,0,0,16,32,130,80,64,48,1,0,16,
+0,4,0,0,0,0,74,4,1,16,20,0,128,0,4,255,253,36,
+};
+
+static const unsigned char big5hkscs_phint_12130[] = {
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,128,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,
+};
+
+static const unsigned char big5hkscs_phint_21924[] = {
+0,0,0,0,0,26,172,248,250,90,192,250,51,0,0,0,0,0,129,0,160,156,130,144,9,1,
+180,192,176,3,86,2,160,66,45,136,1,0,0,0,0,146,119,139,96,5,201,33,6,70,56,96,
+72,192,180,36,222,132,224,192,36,0,0,0,0,205,80,197,52,192,40,162,173,124,153,
+24,88,18,34,196,66,162,83,142,30,0,0,0,128,52,135,11,21,209,64,250,61,0,4,210,
+5,72,8,22,230,28,165,0,8,0,0,0,192,45,22,20,128,24,58,212,25,136,28,138,4,
+};
+
+static const DBCHAR __big5hkscs_bmp_encmap[26401] = {
+50904,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34905,34903,N,N,N,N,N,N,
+34909,34907,M,N,N,N,N,N,N,N,34913,34911,N,N,N,N,N,N,N,N,N,N,N,N,34922,34920,N,
+N,N,N,N,N,34927,34925,M,N,34931,34929,N,N,N,N,34935,34933,N,N,N,N,51451,34939,
+34937,N,34978,34902,34919,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34906,34924,N,N,N,N,
+N,N,34908,34926,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34928,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,51452,34910,34932,N,N,N,N,N,51450,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34936,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,34904,34921,N,34930,34912,34934,N,34938,N,34940,N,34941,N,34942,N,34977,
+51446,34923,N,N,51448,N,N,N,N,N,N,51447,N,N,N,N,N,34984,N,N,N,N,N,N,N,N,51454,
+N,N,N,N,N,N,N,N,N,N,51449,N,N,N,N,N,N,N,N,N,N,N,N,N,51445,N,N,N,N,N,N,51453,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,50905,51193,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+51187,51188,51189,51190,51191,51192,51194,51195,51196,51197,51198,51264,51265,
+51266,51267,51268,51269,51270,51271,51272,51273,51274,51275,51276,51277,51278,
+51279,51280,51281,51282,51283,51284,51285,51286,51287,51288,51289,51290,51292,
+51293,51294,51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,
+51306,51307,51308,51309,51310,51311,51312,51313,51314,51315,51316,51317,N,
+51291,34915,34980,34917,34982,51410,N,N,N,N,N,N,N,N,N,N,51411,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,50869,50870,
+50871,50872,50873,50874,50875,50876,50877,50878,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,51319,51320,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,51318,34985,34986,50849,50850,50851,
+50852,50853,50854,50855,50856,50857,50858,N,N,N,N,N,N,N,N,N,N,50859,50860,
+50861,50862,50863,50864,50865,50866,50867,50868,63993,63992,63974,63983,63965,
+63976,63985,63967,63980,63989,63971,63982,63991,63973,63977,63986,63968,63979,
+63988,63970,63975,63984,63966,63981,63990,63972,63978,63987,63969,63994,63995,
+63997,63996,50918,51414,N,N,N,51415,N,51416,51417,51418,N,51419,N,51420,51421,
+N,N,N,N,N,N,N,51422,N,N,N,N,N,N,51423,51424,N,N,N,N,N,N,N,51425,N,51426,N,N,
+51427,N,51428,N,51429,N,N,N,N,N,N,N,51430,N,N,N,N,N,51431,N,51432,N,N,N,N,N,N,
+N,51433,N,N,N,51434,N,51435,51436,N,51437,N,N,N,N,N,N,51438,51439,N,N,N,N,N,N,
+51440,N,N,N,N,51441,50893,50912,50913,50914,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,50919,50920,50921,50922,50923,50924,50925,50926,50927,50928,50929,50930,
+50931,50932,50933,50934,50935,50936,50937,50938,50939,50940,50941,50942,51008,
+51009,51010,51011,51012,51013,51014,51015,51016,51017,51018,51019,51020,51021,
+51022,51023,51024,51025,51026,51027,51028,51029,51030,51031,51032,51033,51034,
+51035,51036,51037,51038,51039,51040,51041,51042,51043,51044,51045,51046,51047,
+51048,51049,51050,51051,51052,51053,51054,51055,51056,51057,51058,51059,51060,
+51061,51062,51063,51064,51065,51066,N,N,N,N,N,N,N,51412,51413,50908,50909,N,N,
+51067,51068,51069,51070,51105,51106,51107,51108,51109,51110,51111,51112,51113,
+51114,51115,51116,51117,51118,51119,51120,51121,51122,51123,51124,51125,51126,
+51127,51128,51129,51130,51131,51132,51133,51134,51135,51136,51137,51138,51139,
+51140,51141,51142,51143,51144,51145,51146,51147,51148,51149,51150,51151,51152,
+51153,51154,51155,51156,51157,51158,51159,51160,51161,51162,51163,51164,51165,
+51166,51167,51168,51169,51170,51171,51172,51173,51174,51175,51176,51177,51178,
+51179,51180,51181,51182,51183,51184,51185,51186,N,N,N,N,N,50915,50906,50907,
+34880,34881,34882,34883,34884,34886,34889,34890,34893,34895,34896,34897,34898,
+34900,34901,51321,51409,37495,N,N,N,N,N,N,N,N,N,N,38623,N,N,N,N,N,N,N,N,N,
+36084,N,35285,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37837,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,39903,N,N,N,N,N,N,64104,N,N,35290,36697,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,35291,N,N,36701,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35292,N,N,N,N,N,
+N,N,N,N,38647,N,N,N,N,N,N,N,N,N,N,N,N,35546,N,N,N,N,35804,N,N,N,N,N,N,38875,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40531,N,N,N,N,40362,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,39914,35438,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35784,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35304,N,35306,N,N,N,N,N,35915,N,N,N,N,N,N,
+N,64368,N,N,N,N,N,N,N,N,N,N,N,35309,N,N,38109,N,35310,N,N,N,N,40628,35539,N,N,
+N,N,N,N,N,N,N,N,N,37595,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38107,35321,N,N,N,
+N,N,N,N,N,64378,N,N,N,35323,N,N,N,N,N,N,N,40700,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,35324,N,35263,N,N,N,35326,N,35302,N,N,40262,N,N,N,40430,N,N,N,41086,N,N,N,
+41064,N,N,N,N,39145,N,35688,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36349,35774,
+40921,N,N,N,N,N,N,N,35563,N,N,40919,35690,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40028,N,
+35761,N,N,N,N,N,N,N,N,64350,N,34672,N,N,N,N,N,N,N,40435,N,N,N,N,N,N,N,41168,N,
+N,N,64614,N,N,N,N,37609,N,N,N,N,N,N,N,N,39660,36779,64072,N,N,N,N,36421,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40047,N,36188,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40670,N,N,N,N,N,N,35311,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,38633,N,N,N,N,N,N,N,N,N,N,40635,N,N,N,N,38110,N,40632,N,N,N,38842,64357,N,
+N,N,38358,N,N,N,40123,N,N,38874,N,N,N,N,36677,N,64381,37208,65124,N,38998,
+39757,N,N,N,N,N,N,N,N,N,N,37723,38343,N,38887,N,N,N,N,N,N,37721,N,N,N,37365,
+38840,N,N,64930,64438,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37626,37719,N,35750,N,N,N,N,
+64441,N,38832,N,N,64964,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40097,N,N,N,N,N,37362,
+37369,N,36849,N,N,N,N,N,N,38725,38995,N,N,65144,N,64449,37457,N,N,N,N,N,N,
+40365,N,N,N,N,N,64876,N,N,64107,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,39874,N,N,N,N,N,N,N,N,N,N,N,N,39547,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35680,N,N,N,N,N,N,N,N,37707,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39613,N,N,N,N,37303,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36171,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,38324,N,N,N,N,N,65221,N,N,40688,36196,N,N,N,N,N,N,N,N,N,
+37481,N,N,N,N,N,N,36199,N,N,N,N,N,N,N,N,N,N,N,N,64490,N,N,N,N,N,N,N,N,64495,N,
+36200,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,37867,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64578,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37222,N,N,N,N,N,N,N,N,
+64205,N,N,N,N,37853,N,N,36178,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,35788,36205,N,N,N,N,N,N,N,N,N,N,N,36206,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,38568,N,N,N,N,N,N,N,N,N,N,64678,N,N,N,N,N,N,N,N,N,N,N,
+N,36207,N,N,N,N,N,N,N,N,N,N,N,N,N,36208,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,64612,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36083,N,N,N,N,N,N,N,36960,N,
+N,N,N,N,N,N,N,36212,38851,N,N,N,N,N,N,N,35536,N,N,N,N,N,N,37492,N,39870,N,N,N,
+N,N,40136,N,N,40122,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36216,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40633,N,N,N,N,N,38234,
+N,N,37300,N,N,N,N,N,N,35400,N,N,N,N,N,N,N,N,N,N,N,36221,N,N,35453,N,N,35522,
+64842,N,36257,N,N,35537,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64692,35655,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37796,40666,N,N,N,N,N,N,N,N,N,35409,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,36262,N,N,N,N,N,N,40645,N,N,N,N,64708,N,N,N,N,41080,N,
+38069,N,N,N,N,N,N,N,64706,35435,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36267,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64232,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36269,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64585,N,37825,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36975,N,36272,N,N,N,N,N,N,N,N,38014,37114,N,N,N,N,N,N,N,N,N,N,
+38009,N,N,N,N,N,N,N,N,36274,N,N,N,N,N,N,N,N,64750,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39291,N,N,N,N,N,N,N,N,36276,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36279,N,
+N,N,N,N,N,N,37299,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36283,36282,N,N,N,N,N,N,N,N,
+36284,36932,N,N,N,64844,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34635,37860,N,
+N,37856,N,N,N,N,N,N,N,64851,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,36291,N,39864,N,N,N,64496,N,37865,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37878,
+N,N,N,N,N,36293,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36298,N,N,N,N,N,36300,64861,37813,
+64865,N,N,N,40184,N,N,N,37458,N,N,41192,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40101,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35926,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,36310,N,38848,N,N,N,41182,N,N,N,N,38866,N,N,N,N,N,64165,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64931,N,N,N,36315,36074,36527,N,N,N,N,N,N,N,N,N,37301,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64841,N,N,N,N,N,N,N,N,64977,N,N,N,N,N,N,N,
+N,N,N,36331,N,N,N,N,N,38854,N,64974,N,N,37116,N,N,N,N,N,N,N,N,N,N,N,N,N,64601,
+N,N,38614,N,N,N,N,N,N,38853,36335,N,N,N,N,38871,N,N,N,N,N,36336,N,N,N,N,N,N,N,
+38566,N,N,N,N,N,N,N,64447,N,N,36063,N,36339,N,N,N,N,37961,N,36341,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,39026,N,N,N,N,N,N,N,36459,N,N,N,N,N,N,64253,N,N,N,N,
+N,N,N,N,N,N,36688,N,N,N,N,N,N,40396,64613,N,35908,N,N,39278,38049,N,N,N,N,N,
+36707,N,N,N,N,N,N,N,41178,N,N,N,N,N,N,N,N,N,N,N,37459,65001,N,N,40373,N,N,N,N,
+N,N,N,39033,34666,N,N,40285,N,N,N,N,36195,38505,40816,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64618,N,N,35527,N,N,N,N,35287,N,N,N,N,N,N,N,N,N,N,N,N,65101,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40669,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,65275,39100,64204,N,N,38320,N,N,N,37988,N,N,N,N,N,N,37743,N,N,N,N,N,N,
+38073,N,N,38380,N,N,N,N,37358,N,N,39107,N,38390,N,N,N,36861,39109,N,N,N,N,
+38758,65134,N,N,38877,36010,N,N,37586,N,N,38753,39115,N,N,N,N,38384,N,38749,N,
+37347,N,N,N,N,39116,N,N,37993,39117,N,N,N,N,N,39118,N,38396,N,N,38051,38498,N,
+N,N,65206,N,37987,36167,N,N,N,N,N,N,39120,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39121,N,N,N,N,38005,64224,N,N,N,N,N,N,N,N,N,38002,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39126,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,35568,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39129,N,N,N,N,N,N,N,36186,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,39131,N,N,N,N,39133,N,N,N,N,N,N,N,N,39080,N,N,N,N,N,N,N,35437,N,N,N,N,N,
+N,N,N,N,N,N,35579,35502,64457,N,N,N,N,35933,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,39140,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39142,N,N,N,N,
+N,N,N,N,N,N,N,39144,N,N,N,N,N,N,N,N,N,N,N,N,N,35405,N,N,N,37463,N,N,N,N,N,N,N,
+N,N,N,38367,N,N,41132,N,N,N,N,39147,N,N,N,N,39148,N,36035,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39156,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35512,N,N,N,40679,N,N,N,N,
+N,N,N,N,38076,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64721,N,N,N,N,N,N,40134,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36170,N,40574,36164,39166,65000,N,N,N,N,
+39232,N,N,N,N,38089,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,38099,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39238,N,N,N,N,37056,N,38097,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36174,N,N,38259,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37826,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39240,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,39243,N,N,N,N,N,36437,N,N,N,N,39246,N,N,N,N,N,N,N,N,N,
+N,N,36606,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36191,N,36441,N,N,N,N,N,N,N,N,N,
+38124,38127,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35936,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36724,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,39253,N,N,N,N,N,N,N,N,N,38212,N,N,N,N,N,N,N,N,N,N,N,36043,
+N,N,N,39254,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39257,N,N,N,N,N,N,N,39259,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36036,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64069,N,N,N,
+37047,N,N,38723,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38349,N,N,N,N,N,N,38857,64848,
+36537,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38342,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39271,N,N,
+36067,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35513,N,N,
+N,N,N,N,36348,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35446,N,N,N,N,N,
+40273,N,N,N,N,N,N,N,N,N,N,N,N,N,39283,N,N,34624,N,40271,39290,38244,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39329,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39333,N,N,N,N,N,
+N,N,39335,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,36589,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39341,N,51326,N,N,N,N,N,N,
+N,N,N,N,N,N,N,37998,36720,N,64208,N,N,N,N,N,N,N,N,N,N,N,N,N,39347,N,N,N,N,N,N,
+41043,N,N,N,N,N,36190,N,N,38492,N,N,36064,N,64890,N,N,N,N,N,N,N,N,38910,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37565,36189,38909,N,N,N,N,36708,N,N,N,N,64759,38242,
+38861,40548,N,N,N,N,N,N,N,37452,36553,39356,N,N,N,N,40357,N,36692,N,N,N,N,N,N,
+N,N,N,N,36732,N,N,N,N,36181,N,36514,N,N,N,N,N,N,N,N,N,36730,N,N,N,N,N,N,38830,
+N,N,N,N,38600,N,N,36068,N,N,N,N,39363,N,37078,N,40126,N,N,N,36726,N,N,N,N,N,N,
+N,N,N,N,N,N,N,38000,64331,N,N,64970,N,N,36079,N,N,N,36551,N,N,N,N,36180,41209,
+N,N,N,N,N,N,N,36777,N,N,36177,N,N,N,N,N,N,N,N,N,39367,34628,N,N,N,N,N,N,N,N,N,
+N,N,N,37079,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+34627,N,N,N,N,N,N,N,N,N,N,N,N,34631,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34648,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40671,
+36185,34626,N,N,39374,N,N,N,N,N,N,N,N,36794,N,N,N,N,N,36843,N,39375,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36802,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37577,N,N,N,N,N,38876,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34653,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36165,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38323,40057,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38322,N,
+36172,36827,N,N,N,N,39907,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,34636,N,N,N,N,N,N,N,N,N,N,N,N,N,34637,N,N,N,N,N,N,N,N,N,40570,34647,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,39918,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39390,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64250,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35410,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,39393,N,N,N,N,N,N,35431,35765,N,N,N,N,N,N,N,N,N,N,35500,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39401,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64458,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38878,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38353,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39413,64586,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39849,N,N,N,N,N,N,N,N,N,N,N,N,64476,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,65110,N,N,N,N,N,40612,N,N,N,N,N,N,40265,38363,N,N,N,N,N,N,N,N,N,N,35269,
+N,N,N,N,N,N,N,N,N,N,N,N,39416,N,N,N,N,N,N,38500,N,N,N,N,36949,N,N,38612,N,N,N,
+N,N,N,N,38780,N,N,N,N,N,N,38477,N,38881,N,N,N,N,N,N,39496,N,N,N,N,N,N,N,N,N,N,
+N,39497,N,65149,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37034,N,N,N,N,39504,N,N,N,N,
+N,N,N,37703,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36568,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37065,N,N,N,N,N,39509,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37052,N,N,N,N,N,39512,N,35768,37077,N,N,N,N,N,N,N,N,N,N,N,N,N,38465,N,N,
+N,N,N,N,39514,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39516,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,38850,N,N,N,N,N,N,N,N,N,N,N,N,N,34652,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35515,N,N,N,39850,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37109,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39520,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,37189,35928,N,N,N,N,N,N,N,N,39523,N,N,N,N,N,N,35913,N,N,N,N,N,N,N,N,
+N,N,N,35766,N,N,N,N,N,N,N,N,N,N,64719,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38507,
+39534,N,37199,N,N,N,N,N,N,N,N,38726,N,N,41190,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37591,N,38517,N,N,37844,N,N,37307,38521,N,N,N,N,N,39536,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38520,37325,N,40010,41071,N,N,41066,N,
+N,N,N,N,N,37215,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,34625,N,N,N,N,N,N,N,N,40869,N,N,35258,N,34639,N,N,N,N,N,N,34638,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,34645,N,N,N,40653,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39545,N,N,N,N,N,N,N,N,N,36082,N,N,N,36183,N,40398,N,N,N,36050,N,N,N,34649,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40307,N,N,N,N,N,N,N,N,
+N,38585,N,38588,N,N,N,N,N,N,40145,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35255,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40686,34633,N,N,N,N,N,N,N,N,N,N,
+64323,34651,N,40649,N,N,N,N,N,N,64467,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37294,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,36184,34630,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36182,N,N,N,N,N,N,N,
+40312,N,N,N,N,N,N,N,N,N,N,40315,40627,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40626,N,40406,N,N,N,N,39247,N,N,35278,N,N,N,35776,N,40900,N,35796,N,N,35954,
+N,N,N,N,N,N,50879,35833,N,N,N,N,N,35142,N,50880,N,N,N,N,N,N,N,N,N,64229,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,51323,35782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40023,N,N,N,
+N,N,N,N,N,N,N,N,N,N,39675,N,N,N,N,N,N,N,35280,35279,N,N,N,50881,N,35281,N,
+35298,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37502,N,40378,N,N,N,N,N,50882,N,N,35951,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64504,N,N,N,35783,37483,N,N,35282,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,40911,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40361,35283,N,N,39394,N,N,N,N,N,N,N,N,N,37479,37540,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,35955,N,N,35150,N,N,N,N,N,N,N,N,N,N,N,N,N,35151,37496,N,N,N,N,N,N,
+N,N,37302,N,N,N,N,35284,N,40914,N,N,N,N,N,N,N,N,37543,N,N,38306,N,N,N,N,N,
+37486,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,38634,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37487,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37539,N,N,N,N,N,35152,N,N,64087,N,N,N,N,39014,N,
+N,N,36088,N,N,N,N,N,N,N,N,35286,N,N,N,N,N,N,N,N,N,N,39090,N,N,N,37547,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38622,37548,N,N,N,N,N,N,N,N,N,N,35952,N,
+40814,N,N,N,N,N,N,36594,N,N,N,40812,35288,N,N,N,N,64089,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37544,N,N,N,N,N,37219,N,N,
+N,N,N,N,35904,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40819,N,
+37549,N,N,N,N,N,N,N,N,N,N,N,N,N,39913,N,N,N,N,N,37545,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,37546,N,N,N,N,N,N,35289,N,N,N,N,N,N,N,64854,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,40872,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35953,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37537,N,N,37091,N,N,N,N,N,N,N,N,41126,N,N,N,N,
+N,38059,N,64626,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38852,N,N,N,N,N,N,N,37550,
+64103,N,N,N,N,N,N,N,N,N,N,N,37538,64105,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,37480,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35153,N,N,N,N,N,N,N,N,N,64111,N,N,N,N,N,N,N,N,N,
+64113,N,N,N,N,N,N,N,N,N,35154,N,N,N,N,37978,N,N,N,N,N,N,N,N,50883,N,N,N,35293,
+N,51362,N,N,N,N,N,N,N,N,N,N,N,N,N,50884,N,N,N,40530,N,35155,N,N,N,N,N,N,N,N,N,
+N,40533,37562,N,N,50885,N,N,35931,N,N,N,64125,64168,39528,64071,N,N,64126,N,N,
+N,N,N,N,N,N,N,N,37563,N,N,N,64950,N,64162,N,N,N,N,N,64163,N,64164,39860,64166,
+N,N,N,N,N,N,N,35295,N,N,N,64987,N,N,64169,N,35156,N,N,N,N,N,N,N,N,64171,N,N,N,
+N,N,N,64634,N,N,N,N,N,N,N,35296,N,40783,51325,N,N,35297,N,N,N,N,N,64176,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40909,41191,N,N,N,N,N,64177,35238,N,N,N,N,N,N,
+N,N,N,N,N,N,40698,N,N,N,N,N,N,N,64178,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64180,N,37572,N,N,N,N,N,N,40815,N,N,N,N,N,N,N,35760,N,N,N,N,N,N,N,
+N,N,N,40876,N,N,N,N,N,35299,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39891,
+35300,N,N,N,64181,N,N,N,N,N,40917,N,N,N,N,N,N,35157,N,N,37573,N,N,N,35158,N,N,
+N,N,N,N,N,N,N,N,N,N,64179,N,N,N,64182,N,N,N,N,N,N,N,N,N,N,N,64183,N,N,N,N,N,N,
+40668,N,N,N,64452,40817,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64186,37575,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,50886,39500,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35944,N,N,35301,N,N,N,N,40829,N,N,N,N,N,
+41129,64196,N,N,N,N,50887,N,N,35159,N,N,N,N,N,N,64170,N,N,N,N,N,N,N,N,N,N,N,
+35160,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35811,N,35681,N,N,N,N,39665,N,N,40631,N,
+50888,N,N,N,64209,N,N,N,N,N,N,64210,N,N,N,N,N,N,N,N,40634,64212,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64217,N,N,N,N,N,N,N,N,N,N,N,N,64219,N,40160,N,N,N,
+64503,N,64506,35303,41082,64220,N,N,64221,N,35305,N,N,N,N,N,50889,N,N,N,N,N,N,
+N,N,N,N,64226,35307,N,N,64227,N,N,N,N,N,N,37064,N,N,N,37594,35161,40181,N,N,N,
+N,N,35162,64231,40866,N,N,N,N,N,64234,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64237,36781,N,N,N,N,N,N,64345,64239,38639,N,40428,N,N,N,40394,N,N,N,N,N,N,
+64877,N,35308,N,N,N,N,N,N,N,N,N,N,N,64324,N,N,40418,N,35957,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40640,N,40534,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,40825,39623,N,N,64244,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,39073,N,N,N,N,N,N,N,N,N,64248,N,N,N,35312,40519,N,N,40439,N,N,N,N,40915,
+N,39626,N,N,N,N,35313,64249,N,N,N,N,N,N,N,N,N,N,N,N,N,36442,N,35314,N,N,N,N,
+35315,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37469,35665,37600,N,N,35316,N,N,N,N,N,
+N,N,N,N,40916,N,N,N,N,N,N,N,N,35449,N,N,N,N,N,N,N,N,N,N,N,35317,38823,N,N,N,N,
+N,N,N,N,N,N,37818,N,N,N,N,N,40536,N,N,N,N,35318,N,N,N,N,N,40535,N,N,N,N,35319,
+N,35393,N,N,35320,N,N,64241,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35322,N,N,N,
+N,N,N,N,64322,N,64191,N,N,N,N,N,N,N,N,N,64419,N,N,N,N,N,N,N,N,N,64247,N,N,N,N,
+N,N,N,N,N,N,N,40526,N,38108,N,N,N,N,N,38362,40440,40810,N,N,N,N,N,35511,N,N,N,
+N,N,N,N,N,N,N,N,N,64326,N,N,N,N,N,N,N,N,N,35398,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64327,N,N,N,N,N,N,37192,N,N,N,37598,N,N,N,N,35667,40438,N,
+39898,N,N,N,N,40318,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35325,39396,N,N,
+N,N,N,40515,N,N,N,N,N,N,N,N,N,N,N,40425,N,36690,N,N,N,40437,40432,N,N,N,39399,
+N,N,N,N,N,35773,40431,N,N,N,N,N,N,N,N,N,N,N,40887,N,N,N,N,N,N,N,N,N,N,N,N,
+40400,N,40939,36265,40399,39137,N,40421,N,N,N,N,N,N,N,40392,N,N,N,N,N,N,N,N,N,
+64335,N,N,N,N,N,N,N,N,N,N,N,40427,N,N,N,N,N,N,N,N,N,64340,N,64341,39586,N,
+35542,N,39519,N,N,N,N,N,N,N,N,40693,N,N,N,36791,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39634,40554,40680,N,N,N,N,N,N,N,N,N,N,N,N,35775,37314,40290,
+N,N,N,N,N,N,37472,N,N,N,N,N,N,N,N,N,N,N,37470,37313,N,35525,N,N,38819,N,N,N,N,
+N,N,N,N,N,N,35692,N,36222,N,N,N,N,N,N,N,40020,N,N,N,N,N,40381,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,40133,N,N,N,N,N,N,N,N,N,N,N,35163,N,N,N,N,N,N,N,N,
+N,N,64348,N,64347,N,64343,N,N,N,N,N,N,N,N,N,34661,N,39111,64346,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40174,N,N,N,N,N,N,N,37602,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,38055,N,N,N,N,N,N,N,N,N,N,36044,N,39892,N,N,64356,64374,N,N,
+64352,N,N,N,N,N,N,N,N,N,N,N,N,N,39397,N,N,39618,N,N,N,37371,N,N,N,41075,N,N,N,
+N,N,N,N,40818,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40908,N,N,N,39077,37608,N,N,
+N,N,N,N,N,N,39868,N,38643,N,N,37607,N,N,64615,N,N,N,N,N,N,N,N,N,N,N,35709,N,N,
+N,N,39924,N,N,N,N,N,40695,N,N,40641,N,N,N,N,N,N,N,N,N,39279,N,N,N,N,N,N,38641,
+N,N,36417,N,N,N,N,N,38218,N,N,N,38886,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38645,N,N,N,
+N,N,37606,40770,N,N,N,N,N,N,N,64359,N,N,N,N,N,N,N,N,39337,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,64230,64361,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38885,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,38525,N,N,N,64364,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39330,N,N,N,N,N,
+39611,N,N,N,39525,N,N,37966,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64366,N,N,
+39391,N,N,N,N,N,N,N,N,N,39139,N,N,37460,N,N,N,N,N,38523,35503,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35959,N,N,N,N,N,N,35759,40637,N,N,
+N,N,N,N,N,N,N,N,N,N,40678,N,N,64367,N,N,N,N,N,36577,N,N,N,N,39805,40062,N,N,N,
+N,63961,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37610,N,N,N,N,35960,N,N,N,N,N,N,N,N,N,N,
+N,64370,N,N,N,64369,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35164,N,39152,38642,N,N,N,N,
+N,N,N,64372,35777,N,35165,35294,N,35166,N,N,50890,N,N,N,N,N,N,65090,N,N,N,N,N,
+N,N,N,N,N,N,34664,N,64379,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35167,N,35168,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,39885,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40403,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,38988,N,N,N,N,N,N,N,N,N,N,38738,N,N,N,N,N,38339,N,N,N,N,
+39862,N,N,N,N,N,N,N,N,N,N,N,N,39609,N,N,N,38835,N,N,N,N,N,N,40820,37617,N,N,N,
+N,N,N,36090,N,N,N,N,38879,N,N,N,N,64422,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64427,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39031,N,N,N,38996,38341,N,N,N,N,N,N,N,40277,
+64434,38270,N,N,N,N,N,N,N,N,38722,N,38118,N,N,N,N,37621,N,N,N,N,N,N,N,36037,N,
+N,N,N,N,N,37629,N,N,64418,N,N,40017,N,N,38121,39004,37616,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,37964,N,N,N,N,N,N,N,37227,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35704,N,N,N,
+N,38114,N,N,N,N,N,N,N,38991,N,64437,N,N,N,N,37489,N,N,37733,N,N,39003,N,N,
+38992,N,N,N,N,N,N,N,38844,N,N,N,N,37619,N,N,37696,38989,N,N,N,38258,N,65007,N,
+N,N,N,N,N,N,N,64961,N,N,N,N,64442,N,N,37611,N,N,N,N,N,N,64627,38839,N,N,34671,
+N,N,N,N,N,N,64436,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37031,N,N,N,N,
+N,N,N,N,N,N,38721,37620,N,34674,N,64444,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38263,
+N,N,N,N,N,N,N,N,N,N,N,40674,N,36728,N,N,N,N,N,N,N,63964,N,N,N,38514,40629,N,N,
+N,38475,N,N,N,36012,N,N,N,N,N,N,N,N,N,41210,N,N,N,N,N,N,N,N,N,N,N,38261,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37082,N,N,37735,N,65188,N,N,N,37087,N,N,N,
+N,37716,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35169,N,35764,N,N,N,N,
+40384,N,N,N,N,N,N,36424,N,64453,N,N,N,N,N,64455,N,N,N,50891,N,64121,N,N,N,N,N,
+N,N,N,N,N,N,N,N,40551,N,N,N,N,N,36057,N,N,N,N,N,N,64466,35170,35171,N,N,N,N,N,
+N,N,N,N,N,64637,N,N,N,N,N,N,N,N,N,N,N,N,34675,N,N,N,N,N,N,N,N,N,N,N,40811,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64460,N,65198,N,N,N,34669,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64465,N,N,N,N,N,N,N,N,N,N,N,64373,64468,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64470,64472,N,N,N,N,N,N,N,35677,N,37708,N,39650,N,N,35785,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64475,40905,
+N,N,N,N,N,N,N,N,40772,N,N,N,N,N,N,N,N,N,N,39149,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36073,N,N,N,N,N,N,N,N,N,N,N,N,64477,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,36338,35172,N,65010,N,37709,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64487,N,N,N,N,N,N,41202,39016,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40792,N,N,N,36070,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36211,N,N,N,64478,N,N,N,N,N,
+64479,N,N,N,N,N,35912,N,N,N,N,N,N,34676,64483,N,N,N,N,36264,N,N,64484,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40053,N,N,39032,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36192,N,N,N,N,N,N,N,64485,N,36193,N,N,N,N,N,N,N,N,N,N,N,N,N,36194,41121,N,N,N,
+40000,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39085,N,N,N,40682,N,N,N,36076,N,
+N,36052,N,N,N,N,N,N,N,N,N,40171,N,N,N,N,N,64480,N,N,40785,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36197,N,N,N,N,N,N,40177,N,N,N,N,N,N,N,N,N,N,64600,N,N,
+36198,N,N,N,N,N,N,N,38484,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64488,N,N,
+N,50892,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40910,64508,N,39652,
+N,N,N,N,N,N,40821,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64497,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36201,N,N,N,N,N,37711,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37710,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,64500,N,N,N,N,50894,N,N,N,64451,N,N,35173,N,N,N,N,N,N,N,N,N,N,N,35962,N,
+N,N,N,N,N,35963,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,36202,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37715,N,N,40443,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64509,N,N,N,36953,64576,N,
+64577,64579,37729,64582,37730,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36203,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64588,36094,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,38328,N,N,50896,35786,N,N,N,N,N,N,N,N,N,N,39034,N,N,N,N,50897,N,
+64593,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64596,N,N,N,N,N,N,N,N,64175,N,N,N,N,N,N,N,
+36204,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64097,N,
+N,64599,N,N,N,N,N,N,N,N,N,39792,N,N,N,N,N,N,N,N,41041,N,N,N,N,N,N,N,35964,N,
+35787,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37742,N,N,N,64725,64681,N,N,
+N,N,N,N,N,N,N,N,N,N,N,64609,N,N,N,N,N,N,N,N,N,35174,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64203,N,N,N,N,N,N,N,63962,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,37754,N,41184,N,N,N,N,N,N,37739,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64619,N,N,N,N,N,41180,N,N,37992,N,N,N,N,N,N,
+N,N,N,N,N,64621,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,36209,N,N,N,N,N,N,64868,N,N,N,N,39354,N,N,N,39632,39521,41189,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41051,38572,N,N,N,N,38720,N,N,N,N,N,N,N,N,N,N,N,
+N,40689,N,N,N,N,N,N,N,N,35917,N,N,N,N,N,N,N,N,N,N,N,N,N,40830,N,N,N,N,N,N,N,N,
+N,N,N,N,36210,N,N,N,N,64630,N,N,N,N,N,N,N,N,N,N,N,N,N,38569,N,N,N,N,N,N,N,N,
+41070,N,N,64682,N,N,N,64461,N,N,N,64628,N,N,N,N,N,N,N,N,N,N,41076,N,N,N,N,N,N,
+N,N,N,N,N,N,N,41073,N,N,N,64633,N,N,N,N,N,64636,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40016,N,N,37753,37752,N,N,41181,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,36213,N,36214,N,N,N,N,N,N,37748,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36215,64677,
+N,N,64674,N,N,N,N,N,N,37059,N,N,N,N,N,N,N,41081,36217,N,N,N,N,N,N,N,N,N,N,
+35836,N,41078,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35789,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40794,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40948,N,N,40890,N,N,N,N,N,N,N,N,N,N,36218,N,N,N,N,N,N,N,N,N,N,N,N,
+40517,N,N,N,N,N,N,37808,N,41077,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39750,N,64686,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64688,N,N,N,N,N,N,N,N,N,
+64081,N,N,N,N,N,36219,36220,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40662,N,
+N,37804,N,N,N,40795,N,37801,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41084,N,N,N,N,N,N,N,64690,N,N,N,N,N,N,N,
+N,N,N,N,N,35521,N,N,N,N,N,40884,N,N,N,N,N,N,N,N,N,N,N,64684,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40524,
+N,N,N,N,N,N,N,36805,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37805,N,N,N,N,N,N,N,N,N,N,N,
+N,40387,N,N,N,36258,N,N,N,40266,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64694,N,N,
+36259,40523,N,40525,36260,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35581,N,N,N,N,N,64693,N,64707,37810,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36261,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37793,N,N,N,N,N,N,N,N,N,N,35526,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,35419,N,N,N,35149,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,65236,N,N,N,N,35448,N,37803,N,N,N,N,N,N,N,N,N,36263,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,40773,N,N,N,N,N,N,N,N,N,35414,N,N,N,64703,N,N,N,64704,N,36582,
+N,N,35492,35139,N,N,N,N,N,N,37875,N,N,N,N,N,N,N,N,N,N,N,N,64683,40610,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,40391,N,N,N,50898,35790,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,64709,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64715,N,N,N,N,N,N,N,N,
+N,N,N,37811,N,64714,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64713,36268,
+N,64454,35175,N,35966,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64717,N,N,N,N,N,N,N,N,40179,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64720,N,N,38331,N,N,N,N,N,N,N,N,N,N,N,64723,N,N,64724,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36270,64727,N,N,N,N,N,37851,N,N,N,N,
+65123,N,N,N,N,N,N,N,N,N,N,N,N,37845,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64730,N,N,N,39793,N,N,64733,N,34660,N,N,N,N,N,36271,N,N,N,64242,N,N,N,N,N,N,N,
+N,N,N,N,37848,N,N,N,64735,N,N,N,37843,N,N,N,N,N,N,N,64737,N,N,N,N,N,N,N,N,N,
+36470,N,N,N,N,N,N,N,64610,N,N,N,N,N,N,N,N,37841,N,N,N,36273,N,N,N,N,N,N,N,
+39001,N,N,N,N,N,N,N,N,N,64338,N,N,N,N,N,N,N,N,64339,N,N,N,N,N,64333,N,N,40127,
+N,N,N,N,N,N,N,N,39794,N,N,N,N,N,N,N,N,N,N,N,N,N,64336,37822,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36059,N,N,N,N,N,N,N,N,N,40433,64747,N,N,N,N,N,N,
+N,N,N,41147,N,39806,N,N,N,N,N,N,N,36275,N,N,35922,N,N,N,N,39656,N,N,N,N,N,N,
+36572,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40185,N,N,N,N,N,N,N,N,N,N,N,N,N,64080,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39143,64755,N,N,N,N,
+64754,N,N,N,36042,N,N,34677,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,37861,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39513,N,N,N,36277,N,N,N,N,
+N,N,N,64845,N,N,N,N,64862,N,N,N,N,N,N,N,N,N,N,N,N,N,36733,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,38215,64758,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37456,N,N,N,N,35176,36278,64763,41085,39164,35177,N,N,
+N,N,N,N,N,N,65103,N,N,37462,N,N,N,N,N,N,N,N,N,N,64201,N,N,37864,N,N,N,64760,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40163,64937,N,N,N,N,N,N,64580,N,N,N,N,N,N,
+N,N,38464,N,N,36280,N,N,N,N,N,N,N,N,N,N,39754,36793,N,N,N,N,N,N,64766,N,N,N,N,
+N,N,N,35178,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36281,
+N,N,N,37246,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37876,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64380,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37863,N,N,38895,N,N,N,65098,N,N,N,N,N,
+64837,N,38565,N,N,N,N,65248,64840,64839,65266,65130,N,N,N,N,N,36285,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39841,36002,39607,36604,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40865,N,N,N,N,N,N,N,N,N,64849,N,N,N,N,N,N,N,64173,N,N,N,N,36286,N,N,35236,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,39641,N,N,N,N,N,N,N,N,N,N,N,64846,N,N,36288,N,N,38896,
+N,N,N,N,N,N,N,N,N,N,37812,64836,N,N,N,N,N,N,N,N,N,N,N,N,40871,N,N,N,N,36290,N,
+N,N,N,39350,N,N,N,N,N,N,N,N,N,N,N,N,N,64850,N,N,N,N,N,N,36289,N,N,36422,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,41169,N,N,N,N,N,N,N,N,N,N,N,N,N,40906,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,37583,N,N,N,40180,36292,N,N,N,N,N,N,N,N,N,N,64833,N,N,N,N,N,N,
+N,39756,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64855,64751,40158,N,N,N,N,N,N,N,64834,
+39020,N,N,N,N,N,N,N,N,N,N,N,N,N,38905,N,38232,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39006,65147,38093,N,N,N,N,N,37870,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36003,N,64858,
+N,N,N,N,N,N,37877,N,N,N,N,N,37871,36586,N,N,N,36699,N,N,N,N,N,N,N,N,N,N,N,
+35934,N,36294,N,N,N,N,N,N,N,N,N,N,N,36296,N,N,36295,N,N,N,N,N,37879,N,N,N,N,N,
+N,N,36297,N,N,N,N,N,N,N,64498,N,N,N,N,38512,N,N,N,N,N,N,N,N,N,36299,N,N,N,
+64860,N,N,N,N,N,N,N,N,N,36709,N,N,N,36301,N,N,N,N,N,40360,38137,N,N,36302,N,N,
+N,N,N,N,N,N,37866,N,N,N,N,N,N,N,N,N,64863,37872,40886,N,N,N,N,N,N,N,N,N,36303,
+N,N,N,38755,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36304,
+37873,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64866,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64869,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40923,N,N,N,N,37880,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35831,N,N,N,N,64870,N,N,N,N,N,35791,N,N,N,N,N,N,36305,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,36306,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,64881,N,N,N,N,64879,N,N,N,N,N,N,N,N,36307,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40935,37053,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40912,N,N,N,35792,N,64882,
+N,40110,35793,N,N,35547,N,N,N,N,N,N,N,N,N,N,N,64228,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,38350,N,64886,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64354,N,N,N,N,N,N,36308,
+N,N,N,64888,N,N,N,N,N,36579,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36982,N,N,39110,N,N,N,N,N,N,N,36309,N,N,N,N,38865,N,N,40630,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64199,N,N,41026,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,39027,N,N,N,N,N,N,N,N,N,N,40956,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,36005,36311,N,N,37627,36312,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,37967,N,36313,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,35179,N,N,N,N,N,N,N,N,38862,N,N,N,64243,64942,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64431,37559,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36314,N,N,N,N,N,N,N,N,N,N,N,N,N,40026,N,N,N,N,N,N,64941,N,N,N,N,N,N,N,N,N,N,N,
+N,N,36316,37956,N,N,N,N,N,N,N,N,N,N,N,36317,N,N,N,N,N,N,N,41174,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35905,38869,N,37962,N,N,N,N,N,
+37965,N,N,N,N,38859,N,N,N,N,N,36318,N,N,36319,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36320,65273,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,64960,64761,N,N,N,N,N,N,36061,N,64382,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37555,N,N,N,N,N,64943,N,N,N,N,N,N,N,N,N,36321,N,N,N,N,
+38355,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35265,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64872,N,N,40119,N,N,36323,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64192,36325,64100,N,35143,N,N,N,N,36324,N,N,N,N,N,36327,
+36328,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64967,64944,N,N,N,N,N,N,37957,38870,N,N,
+N,N,N,N,N,N,N,64710,38980,N,N,N,N,N,N,N,N,N,N,N,N,36329,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,36330,N,N,N,N,N,N,N,N,65104,N,N,N,N,N,N,64972,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40359,N,N,N,N,N,64973,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64975,N,N,N,N,38354,N,N,N,N,N,N,N,36333,N,N,N,N,N,N,N,N,64698,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64965,N,64978,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40156,N,N,N,N,N,38351,N,N,36334,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64980,
+N,N,N,N,N,38636,38635,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37046,N,64963,39083,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38638,
+N,N,N,N,N,N,N,N,N,N,N,N,N,36340,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64992,N,35943,N,N,36342,N,N,N,36343,N,N,N,N,N,N,N,36858,N,N,N,N,
+N,N,N,N,N,N,38864,N,N,N,N,35794,N,N,36344,N,N,N,N,N,37081,N,35911,N,64240,N,N,
+N,N,64993,36345,N,64995,N,N,N,N,N,N,N,36346,N,64355,N,N,N,37030,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39280,N,N,37355,N,38768,39023,64994,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39154,N,39676,35180,65021,N,N,39262,N,N,N,38333,N,N,N,N,N,N,N,64996,
+N,N,N,37350,N,N,N,N,64997,64998,N,N,N,N,N,N,N,N,64999,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,37972,N,N,N,39352,N,N,N,N,N,N,N,N,38889,37702,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,39011,N,N,N,N,N,N,N,N,N,N,N,38332,N,65005,65015,N,N,N,
+N,N,N,39024,38646,36521,N,N,N,N,N,37969,N,N,36419,N,35674,N,N,N,N,65006,N,N,N,
+N,65008,N,N,N,N,65012,N,39925,N,N,N,N,N,36078,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,38782,N,N,N,N,N,39893,N,39619,N,38856,41179,37328,N,N,40932,N,36829,N,
+37353,N,N,N,N,N,N,N,N,N,39136,N,N,N,37578,N,38999,N,N,35921,N,N,N,N,65003,N,
+39753,N,N,N,N,N,N,N,N,N,40310,40623,N,N,N,N,N,N,N,N,N,40140,N,N,N,N,N,N,65002,
+N,N,36337,N,N,65019,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36435,N,N,N,N,
+N,N,N,N,N,N,N,64207,N,N,N,N,N,N,N,N,N,N,N,N,N,38649,N,N,N,N,N,N,N,N,N,39103,
+40521,36007,N,N,N,N,N,N,N,N,39882,N,N,N,N,65022,37596,N,N,N,N,N,65089,37324,
+37346,N,N,N,N,N,N,N,N,N,N,N,N,65092,34655,N,N,N,N,N,35795,N,N,65095,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,65096,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37973,N,N,N,N,
+65099,N,65100,N,N,N,N,36287,N,N,N,N,N,N,N,N,N,40568,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,65105,N,N,N,N,37974,N,N,N,N,N,N,N,40289,N,N,N,N,
+37975,N,N,N,N,N,N,N,N,N,N,39270,N,N,N,N,N,N,N,N,N,N,N,N,N,35797,N,N,N,N,41065,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39092,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,41033,41036,N,40549,N,N,N,N,N,N,N,N,N,N,N,39093,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65112,N,39285,65107,41061,N,65113,N,N,N,N,
+N,N,N,N,N,39095,39096,N,N,N,N,N,N,N,39098,N,N,N,N,N,N,39099,N,N,N,N,N,N,40892,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41034,N,N,
+40647,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36009,N,N,39086,N,N,N,N,N,
+N,N,N,37590,N,N,N,64225,N,37332,N,N,N,N,N,N,N,N,64222,N,N,65115,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,35923,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65118,N,N,N,N,64471,65114,
+38085,N,N,N,N,64202,N,N,N,N,N,N,N,N,N,N,N,39105,38748,N,65140,N,38771,N,N,N,N,
+N,N,N,N,64070,N,N,N,38756,N,N,N,65128,N,38478,N,38757,35930,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,35233,38394,N,37588,65129,N,64325,N,39112,N,N,37103,N,39113,39114,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37997,38071,65132,N,N,37995,N,N,N,
+N,N,N,37628,N,38379,N,65139,38766,65119,N,N,N,N,N,N,N,N,N,64957,N,N,37589,N,N,
+N,N,N,N,65209,N,N,65137,34680,N,N,N,64443,N,N,38010,N,N,38395,65143,N,N,N,N,N,
+N,N,65145,N,65141,N,N,N,37981,N,N,N,N,N,N,N,65148,N,N,N,N,N,N,N,N,N,37700,
+36518,N,N,N,N,N,N,N,N,N,N,N,37587,N,38072,N,34681,N,N,N,N,N,N,64625,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,38750,N,N,N,N,36013,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65191,N,N,
+N,37994,N,N,N,37859,N,N,39119,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41177,N,N,
+N,N,N,N,N,N,41151,41037,41144,N,N,N,N,N,41166,41143,N,N,N,N,N,N,N,N,65193,N,N,
+N,N,N,N,N,N,N,N,35267,N,N,N,N,65195,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40436,35181,N,N,N,N,N,40059,N,N,N,N,N,N,39122,N,N,N,40873,N,N,N,65202,N,N,
+65201,N,N,N,38873,N,41156,N,38006,N,N,N,N,N,N,N,N,N,N,39288,N,N,N,N,N,N,65203,
+N,N,N,N,N,39123,65204,N,N,N,39124,N,N,N,N,N,N,N,40889,N,N,N,N,N,N,N,N,38001,N,
+N,N,N,N,N,N,N,N,39125,65208,N,N,N,50900,N,N,N,N,N,N,N,N,N,N,N,65210,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40540,N,N,65211,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41028,N,
+N,N,N,39127,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39128,65212,N,N,N,N,40958,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65213,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40413,N,N,N,N,40673,N,N,N,N,N,N,N,N,N,N,N,N,39130,
+40415,65215,N,65214,N,N,40683,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40537,41052,N,
+N,N,N,N,N,N,65216,N,N,N,38007,39132,N,65217,N,N,N,39134,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,65219,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65224,N,N,N,65225,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65226,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+65227,N,N,N,N,N,N,N,N,N,40898,N,N,35947,39108,N,38064,38065,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,65233,N,N,N,N,N,41153,N,65234,N,N,N,N,41165,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,65235,N,N,39141,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65238,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37348,N,N,N,N,36807,38062,N,
+35407,38066,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36820,N,N,N,N,39146,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65240,N,N,N,N,N,N,N,N,N,40416,N,N,
+N,N,39150,N,N,N,N,38340,N,64744,N,N,N,N,N,39151,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,35950,N,N,N,N,N,N,N,N,64216,N,N,N,N,N,N,N,N,N,N,N,N,N,65244,N,N,N,N,N,N,N,
+N,N,41134,40268,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39153,N,N,N,39155,N,38081,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39157,N,N,64079,38626,N,N,N,N,
+37968,N,38562,N,N,39158,N,N,N,38629,N,N,N,N,N,39159,N,41030,38627,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39160,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40676,N,N,N,
+N,N,N,63958,N,N,N,N,N,N,38083,N,N,N,N,38082,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65249,N,65257,N,N,N,N,38628,N,35244,38619,N,N,
+N,N,N,N,N,N,N,N,N,N,N,65250,N,N,N,N,N,N,N,N,N,N,38084,65251,N,N,N,65255,40955,
+N,N,N,N,N,N,N,N,N,N,N,35929,N,N,N,N,N,N,N,N,N,37833,N,38120,64342,N,N,N,37061,
+41128,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,65253,N,N,N,39165,39163,65256,N,36543,N,N,N,N,35800,65271,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36712,38086,N,N,N,N,N,N,N,N,40426,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64617,N,N,N,N,N,N,N,N,N,N,N,N,40154,N,65267,N,N,40050,
+N,N,65264,35273,N,N,N,N,N,N,N,N,N,39233,N,N,N,N,N,N,N,39234,N,N,N,65269,N,
+37335,N,N,N,N,N,38092,N,N,N,65272,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,38824,N,65276,N,N,N,36062,N,64959,N,N,N,N,N,N,N,65278,N,N,N,N,N,N,N,N,
+N,N,N,N,N,38609,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38101,N,N,38096,39236,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35939,N,N,41139,N,N,
+N,N,N,N,N,N,N,N,N,N,38095,N,N,N,40954,N,N,N,N,37349,N,40042,N,N,N,36425,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36428,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36429,N,N,N,N,N,39539,N,N,N,N,N,N,N,N,N,N,N,N,N,39239,N,
+36017,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36432,N,N,N,N,N,
+N,N,N,N,N,36431,39241,N,N,N,N,N,36433,36434,N,N,N,N,39602,35237,N,N,N,N,N,
+39244,N,N,N,40952,N,N,N,N,N,N,36438,39245,37322,36439,N,N,N,N,38113,N,N,N,N,
+36935,N,36824,36440,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38123,36444,38227,N,
+N,N,N,N,N,N,40933,N,N,N,N,N,N,N,N,N,N,40790,N,N,N,N,N,N,N,38223,N,36446,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,39274,N,N,N,N,N,N,N,N,40036,40153,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,36445,N,N,N,N,N,N,N,N,N,N,N,N,39248,N,N,N,N,N,N,N,N,N,39249,N,N,
+36450,N,N,N,N,N,N,N,N,N,N,N,39250,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36456,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36449,40793,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35763,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40797,36454,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36018,N,N,N,N,N,N,N,N,N,N,N,
+N,N,36462,N,40804,39251,N,N,64184,N,N,N,N,N,39252,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36464,N,N,N,N,N,N,N,N,N,N,N,N,40801,N,36466,N,N,N,N,N,N,
+N,N,N,N,N,N,41067,N,N,N,N,40768,N,N,N,N,N,N,38125,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,38126,N,N,40893,N,N,N,36475,N,N,N,N,N,N,39255,38135,N,40799,N,N,N,N,36467,N,
+N,40802,N,N,N,N,N,N,N,38134,N,N,N,N,N,N,N,N,N,N,N,N,N,39256,N,N,N,N,N,N,N,N,N,
+36469,63963,N,N,N,N,36978,N,38136,N,N,N,N,N,N,N,N,N,39258,N,N,N,N,N,N,N,N,N,
+41136,36019,N,N,N,36473,N,36472,N,N,N,38131,N,N,N,N,N,39087,N,N,N,N,N,N,41138,
+N,N,N,N,N,N,N,N,N,N,N,36474,N,N,N,N,N,N,39260,N,N,N,N,N,36476,N,36477,N,N,N,
+35801,N,N,35234,40663,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,41142,N,N,N,N,N,N,N,N,N,N,N,N,40514,N,N,36516,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36519,N,35958,N,N,N,N,N,N,N,N,N,34663,N,38210,N,N,N,N,N,N,N,N,N,N,N,N,39037,N,
+N,N,38741,N,N,36520,N,N,N,N,N,N,N,36522,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,35235,N,39264,39266,N,N,38140,39265,N,N,N,N,N,N,N,38138,N,N,N,N,N,
+N,N,36526,36530,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36528,N,N,N,N,N,N,N,39267,38826,
+38139,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36539,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36060,N,N,N,N,N,N,N,N,N,39030,N,36513,N,N,N,N,36020,N,
+36535,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40358,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40624,
+N,N,N,36536,N,N,N,N,N,N,N,N,N,N,N,N,40304,N,N,N,N,35182,N,N,N,N,N,N,N,35183,N,
+N,N,N,N,N,N,N,N,N,N,N,N,35184,N,N,N,N,N,N,N,N,N,N,N,N,35185,N,N,N,N,N,N,N,
+35186,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35187,35188,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35189,N,N,N,
+N,N,N,N,N,36540,36541,N,N,N,N,N,36542,N,40401,N,N,N,N,38141,N,N,N,35799,35802,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41186,N,N,N,N,N,N,
+40937,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64936,N,N,N,35559,N,N,N,
+36546,N,N,N,N,N,N,N,N,N,N,N,36548,N,N,N,N,N,N,N,N,N,N,39268,N,N,N,N,N,39269,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38222,N,N,N,N,N,N,N,N,N,39091,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36555,35807,
+N,N,N,N,N,36558,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36559,N,N,39272,N,N,N,
+N,39273,N,N,N,N,N,N,N,N,39275,36561,N,39276,N,N,N,N,N,N,N,N,N,36564,36565,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39277,N,N,N,N,N,N,41150,N,N,N,N,N,
+36566,41148,41141,N,N,41140,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35808,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35253,N,N,N,
+N,N,N,N,36573,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40541,39281,N,N,N,N,35246,40424,N,N,
+N,N,N,N,N,N,38245,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,39282,N,N,35676,N,N,N,N,N,N,N,N,N,35249,41152,N,N,N,36575,N,38246,N,N,
+39284,N,39286,N,N,N,39287,N,39289,N,N,40410,N,N,36576,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37724,N,N,N,N,N,N,N,40422,N,35679,N,N,38243,N,N,N,N,N,N,N,N,N,N,38247,N,
+N,N,N,N,40419,N,N,N,N,N,N,N,N,N,N,N,N,N,39292,N,N,39293,39294,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,36091,35675,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39331,N,N,N,N,N,N,N,
+39332,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39334,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39336,N,N,N,N,35518,N,N,N,N,N,N,N,N,N,N,N,40545,N,N,N,N,N,N,N,N,N,N,39338,N,N,
+N,N,N,N,41160,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39339,N,N,
+N,N,N,N,N,N,N,N,65220,N,N,N,N,N,N,39106,36584,N,41146,N,N,N,N,N,N,N,N,N,N,N,
+64887,N,N,36590,N,N,N,40639,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35266,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39340,N,N,N,N,N,N,N,N,N,N,N,N,N,38251,N,N,38252,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39343,N,N,39242,35190,36680,N,N,N,N,N,N,N,N,N,
+N,N,64494,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39342,N,
+N,N,36603,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36048,N,N,N,N,35666,N,N,N,N,
+N,39344,N,N,N,N,35191,36673,N,N,N,N,N,N,N,39345,N,N,N,N,N,N,N,N,N,36681,N,N,N,
+N,N,N,N,N,N,N,N,64077,N,N,N,N,N,N,N,N,40420,36021,N,N,N,64489,39764,N,39346,
+40552,N,N,N,N,N,N,N,N,N,N,N,N,36682,N,36674,N,N,36689,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38982,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,39348,N,N,N,N,N,N,N,N,N,N,36597,64853,N,N,40141,N,N,N,N,N,N,N,
+N,35192,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36691,N,N,N,N,N,N,N,N,N,N,N,
+36719,N,N,N,N,N,N,N,N,N,N,36451,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36694,N,N,N,N,N,
+N,N,N,N,N,N,N,65142,N,N,N,N,40902,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64172,N,N,N,N,N,
+36696,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38984,39351,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,38501,N,64108,N,40423,N,N,N,40546,N,N,N,38604,36455,N,N,
+64629,N,39038,N,N,N,N,N,N,N,64953,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38908,N,N,N,N,
+N,N,N,N,N,39161,N,36710,N,N,N,N,N,N,N,N,38254,N,37445,N,N,36704,N,N,N,40657,N,
+N,N,N,N,65229,N,39353,N,N,N,N,N,N,N,N,N,N,N,N,36706,38732,N,N,N,N,N,N,N,N,N,N,
+N,N,37319,38239,N,N,N,N,N,N,N,39355,N,N,N,N,N,N,N,N,N,36461,36721,N,N,38091,N,
+N,N,N,N,N,N,N,N,N,N,N,38321,N,N,N,N,N,N,N,N,N,39666,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,38595,39357,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41167,N,
+N,N,36717,N,N,39358,36596,N,36722,38372,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39359,37442,N,64421,N,N,N,N,N,N,N,N,N,N,39360,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64948,36727,N,N,N,39361,N,N,N,N,N,N,N,N,N,
+64185,N,N,N,N,N,N,N,N,36672,64068,N,N,N,N,N,39362,N,N,N,N,N,N,N,36700,N,N,N,N,
+36029,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39364,39365,N,N,36731,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34678,N,N,N,36022,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36771,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36046,N,N,N,N,N,N,N,N,N,39366,N,N,N,N,N,N,N,N,
+N,N,N,N,N,38605,N,N,N,N,N,N,N,N,N,N,N,N,N,38599,36773,N,N,N,N,N,N,N,N,N,N,
+64187,N,35937,38256,N,N,N,37736,N,36734,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36778,N,N,N,N,N,N,41040,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37075,N,N,38230,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36792,N,N,N,N,N,39368,N,N,N,N,N,N,N,N,N,N,N,36783,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39369,N,N,N,N,N,N,N,N,N,N,N,N,N,38265,N,N,N,N,N,N,N,N,N,N,N,N,40777,
+N,N,N,N,39370,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39371,40405,36784,N,N,
+N,N,N,N,N,N,N,N,N,64122,N,N,N,N,N,N,N,N,40543,N,N,N,N,39373,41161,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39643,N,N,N,41158,N,N,N,N,N,N,N,36788,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,41175,N,N,N,N,N,N,N,N,N,N,N,N,41159,N,N,N,N,N,N,N,
+41027,N,N,N,36789,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36786,N,N,N,N,N,N,
+41057,40542,N,N,N,N,N,N,N,N,N,N,36790,N,N,N,N,N,N,N,N,40936,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40114,N,N,N,N,N,38268,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40903,
+N,N,36795,36796,N,N,N,N,N,N,N,N,36844,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36800,N,
+37738,N,N,N,35812,40060,N,N,N,N,N,N,N,N,38305,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,65260,N,N,38307,N,N,N,N,N,N,N,35909,36024,N,N,N,N,N,N,N,N,N,N,N,
+36801,N,N,N,41042,N,N,N,N,N,N,N,N,N,N,N,N,N,39376,N,N,N,N,N,36803,36804,N,N,N,
+N,N,N,N,N,N,38308,N,N,N,N,N,36806,N,40544,N,N,N,N,N,N,N,63960,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38309,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40115,N,N,N,N,N,
+N,N,N,N,39377,65265,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,39378,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40130,N,N,N,39379,N,N,N,N,N,38311,N,N,N,N,N,N,38313,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,38310,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40029,N,N,N,N,N,N,N,N,39138,N,N,
+N,N,N,N,36809,N,41154,36810,N,N,N,N,N,N,39380,N,N,41145,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39768,N,36813,N,41172,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36814,N,N,
+N,N,35813,N,N,N,N,35193,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,36816,38326,N,N,N,N,N,N,N,N,N,N,N,N,39382,N,38373,N,N,N,N,N,N,N,N,N,
+N,N,N,39383,N,N,N,N,38325,N,N,N,N,N,N,N,N,N,N,N,41162,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40957,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,41048,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36822,N,N,N,39384,N,N,N,N,N,N,N,
+36819,N,N,N,N,N,N,N,N,N,N,N,N,36837,N,N,N,N,N,36841,N,N,N,N,39385,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36087,N,N,N,N,N,N,N,N,N,N,N,N,N,37500,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,40005,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36072,36830,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,36831,N,N,N,N,N,N,N,N,N,N,N,N,N,41035,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36834,N,N,N,41164,N,N,N,N,N,N,N,N,36835,36836,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39876,N,N,N,39932,N,N,N,N,N,N,38476,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,39670,N,36014,N,N,N,N,N,N,N,N,N,N,N,N,36839,N,N,N,N,
+N,N,N,N,N,N,36840,N,N,N,N,35815,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,35194,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,35195,39386,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36845,N,N,N,38336,N,N,N,N,N,N,N,N,N,N,N,N,N,41163,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40520,N,N,N,N,N,N,39387,N,36851,
+N,N,N,N,36857,N,N,N,N,N,N,N,N,N,N,N,N,N,38337,N,41038,N,N,N,N,N,N,39388,N,N,N,
+N,41060,36855,N,N,N,N,N,N,N,35248,41032,N,N,N,N,36859,36854,N,N,N,N,N,40412,N,
+N,N,39389,35816,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37569,N,N,N,N,N,N,N,40918,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41170,N,N,36928,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35524,N,N,39392,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,40944,40947,N,N,N,N,N,N,N,N,N,N,N,N,40383,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,40950,N,38344,N,N,40538,N,N,N,N,N,N,N,N,N,N,N,N,
+39395,N,N,N,N,N,N,N,N,N,N,N,35402,N,N,N,N,N,N,N,N,40945,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,35495,N,N,N,N,N,N,N,N,39398,N,N,N,40951,N,40941,N,N,
+N,N,N,N,35420,N,40366,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,38345,N,N,N,N,N,36936,N,N,39400,N,N,N,N,N,36937,N,N,36026,
+N,N,37041,N,N,N,N,N,N,36938,N,N,N,N,N,N,N,N,N,N,39402,N,N,N,N,N,N,N,N,N,N,N,
+39889,N,N,N,N,N,N,N,39403,N,39404,N,N,N,N,N,N,N,N,39405,N,N,N,N,39406,36940,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36941,N,N,38347,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,38882,N,N,N,N,N,N,N,N,38348,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40824,N,N,
+N,N,N,N,N,N,N,35196,35197,N,N,N,N,N,N,35198,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39261,N,N,N,N,N,N,N,N,N,N,N,N,39770,N,N,
+N,N,36944,N,35919,N,N,N,N,N,N,N,N,N,N,N,36948,N,50902,39592,39407,65259,40355,
+40353,39235,39237,N,40317,N,N,39408,N,N,N,N,N,N,N,N,39409,N,39410,N,N,36028,
+40288,N,N,N,N,N,N,N,N,N,41123,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36955,40667,N,N,N,N,N,N,N,N,N,40313,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39411,N,N,N,36962,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,40789,N,N,N,N,N,N,N,N,N,39929,N,N,N,N,N,N,N,N,N,N,36965,N,N,
+38624,N,N,N,N,N,N,N,39102,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36968,N,N,N,
+N,N,36972,N,N,N,N,N,N,N,N,N,N,N,N,38360,N,N,N,N,N,N,N,N,36970,40882,N,N,N,N,N,
+N,N,40878,N,N,40880,N,35245,N,N,N,N,N,N,N,N,36974,N,N,N,N,N,N,N,N,40561,N,N,N,
+N,N,40522,N,N,N,N,N,40924,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35243,N,40888,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36976,N,N,N,N,N,N,N,N,N,N,N,N,
+35683,N,N,N,N,38364,N,N,N,N,N,N,N,N,36977,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64606,N,N,N,N,N,N,N,N,35145,N,N,N,N,N,38491,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35920,N,N,N,38054,N,N,N,36821,40563,N,N,N,N,N,36981,N,N,N,N,39415,N,N,N,N,N,N,
+N,N,N,N,N,N,N,36031,N,N,N,N,N,N,39417,N,38499,38329,N,N,N,N,N,N,N,N,N,38100,N,
+N,N,N,N,N,64762,N,N,N,N,36983,N,N,37035,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40269,
+N,N,39418,N,N,N,N,37603,N,38843,N,N,36984,N,N,N,N,N,N,N,N,39419,N,N,38880,N,N,
+N,N,N,N,N,N,38620,N,N,N,N,N,N,N,N,N,40104,N,N,38770,N,N,N,N,37952,N,N,N,N,N,
+37618,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39421,N,N,
+39420,N,N,N,N,N,N,N,63959,38474,N,N,N,38616,39422,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36939,N,N,N,N,N,N,64065,N,N,N,N,N,N,N,39488,N,38747,N,N,N,N,N,
+39489,37341,N,N,N,N,N,37884,39490,39491,N,38489,N,N,N,N,N,N,39492,36945,N,N,N,
+38079,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37026,N,N,N,40107,38774,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64597,65093,38056,39493,
+64075,40417,N,N,38617,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38772,N,N,
+65013,N,N,N,37605,N,38469,37338,N,37027,N,N,41055,N,N,N,N,37039,38847,N,N,N,
+37196,N,N,N,N,38522,N,N,N,37342,N,N,39494,65200,38777,37996,N,N,N,N,N,N,N,N,
+39000,N,N,N,N,N,N,N,N,N,N,N,37478,N,N,N,37883,N,N,N,N,N,N,N,N,N,N,N,N,39495,N,
+N,N,N,N,N,N,N,N,N,38729,N,N,38728,N,37706,N,40162,N,N,N,N,N,N,37476,N,N,N,N,
+37343,N,N,N,N,N,N,N,64377,N,N,N,N,N,N,N,38615,N,N,N,N,37699,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64971,65146,N,37339,35946,38831,N,N,38365,N,N,N,37704,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,39499,N,N,N,64581,N,39501,N,N,N,N,N,N,37308,37090,37044,38369,
+N,N,N,N,N,39502,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39503,N,N,N,65088,65091,N,N,N,
+N,N,N,N,N,N,38621,N,N,N,N,N,N,39505,N,N,N,38567,N,N,37040,N,N,N,N,N,N,N,N,N,
+40014,N,37955,N,N,N,N,36538,N,N,N,N,N,N,N,N,N,N,N,N,39506,N,64705,N,N,N,N,N,N,
+N,N,N,35817,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40111,N,N,35837,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39612,N,39608,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39598,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39591,39507,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,40308,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35818,N,N,N,N,N,N,35819,N,N,N,N,N,37042,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,38377,38376,N,38374,N,N,N,N,N,N,37045,N,39508,N,N,N,
+37043,38375,N,N,35664,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35820,N,N,N,
+N,N,N,N,N,N,N,N,39510,35835,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39511,N,
+N,N,N,41130,N,N,N,N,N,N,N,N,40870,N,N,N,39372,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40025,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39349,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,37054,N,N,N,N,N,40879,N,N,N,N,N,N,N,N,N,N,N,N,N,38386,N,N,N,N,N,N,37055,N,
+N,N,N,N,N,N,N,N,N,N,N,37057,N,65252,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37060,N,N,
+N,N,N,N,37063,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37604,40786,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37083,N,N,N,N,N,41062,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37074,N,N,34667,N,37076,N,N,N,N,N,N,N,N,N,39515,38397,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,35780,N,N,N,35942,N,37086,N,N,N,N,N,40164,N,37089,N,N,N,N,N,N,N,N,N,N,N,
+N,N,40518,N,N,N,38481,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64344,N,37094,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38480,N,N,N,37095,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,37096,39517,N,40826,N,N,N,39772,N,40828,N,N,64594,37097,N,37098,N,
+39518,N,N,N,N,N,40822,N,N,N,N,N,N,N,N,N,37099,N,N,N,N,N,N,N,N,N,N,N,N,N,37100,
+N,N,N,N,N,35822,N,N,N,N,N,N,N,37102,N,N,N,37318,N,N,37106,64700,35444,N,N,N,N,
+N,N,N,N,N,38487,N,N,N,40175,N,N,N,N,N,N,N,N,N,N,40927,N,N,N,N,37111,37110,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39774,N,N,N,37112,N,N,N,N,N,N,N,N,N,N,36092,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,37113,N,36041,N,N,N,64106,N,N,N,N,N,N,N,N,35823,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40928,N,N,37186,N,39522,N,N,N,N,N,
+N,N,N,N,38249,N,N,N,37188,37187,N,37185,N,N,N,35824,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38496,N,35825,N,39414,37193,N,N,N,N,37194,N,N,N,N,N,37195,N,N,N,N,39524,N,N,N,
+35519,39526,N,N,N,N,N,N,N,N,N,N,39527,N,N,39529,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39530,38482,37197,N,38502,N,N,N,N,40827,N,39531,N,N,N,N,
+N,N,N,41068,N,N,38503,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39532,N,N,N,N,39533,35826,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38506,N,N,N,N,N,N,N,N,64746,N,N,N,N,N,38508,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37316,N,N,N,38519,N,N,N,N,N,N,N,39412,39535,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40875,N,N,N,N,N,36030,36545,N,N,N,N,38229,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37202,37203,N,N,N,37205,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38237,N,38513,N,N,N,N,40045,N,N,N,N,N,N,N,N,38515,N,N,N,N,N,N,N,N,N,N,N,37204,
+39537,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37206,N,N,N,38509,
+N,N,N,N,N,N,38231,N,N,N,N,N,N,N,N,35270,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35271,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,35434,N,N,N,35671,N,N,N,40929,N,N,39775,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41053,N,N,N,N,N,N,N,N,37211,N,37212,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37214,N,N,N,N,N,N,N,N,N,N,40796,40791,N,N,N,N,N,
+N,40805,N,N,N,N,N,39538,N,N,N,N,37216,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40798,N,N,37217,N,N,N,N,N,N,37220,N,N,N,N,40769,N,N,N,N,N,N,37225,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,37224,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39540,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38578,N,39541,N,64933,N,N,N,N,
+N,N,N,40681,N,35770,37229,41056,N,N,N,N,N,N,N,40926,N,N,N,N,N,40899,N,38581,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41063,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,38579,N,N,N,N,N,N,N,N,N,N,N,N,N,39542,N,N,N,N,N,N,N,N,N,N,N,
+38357,N,N,N,40650,N,N,N,39543,N,N,39544,N,N,N,N,N,N,N,N,N,N,37232,37231,N,N,N,
+N,N,N,N,40867,N,37233,N,N,N,38577,N,N,N,N,40803,N,N,N,N,N,40807,N,N,N,35769,
+39546,N,N,N,N,N,35670,N,N,N,N,N,N,N,N,39642,N,N,N,N,N,38576,N,N,N,N,39550,N,N,
+N,N,N,N,N,N,N,N,40414,N,N,N,N,N,N,N,N,N,38573,N,N,N,38574,N,N,N,N,N,N,N,N,N,
+40609,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40528,N,N,N,N,N,N,N,N,38575,
+35828,40868,N,N,N,N,N,N,N,N,N,38589,N,N,N,N,N,N,N,N,N,38644,N,N,N,N,N,N,N,N,N,
+N,38584,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64161,N,N,N,N,37287,N,N,N,N,N,N,N,
+N,N,N,41054,N,N,N,N,39549,N,N,N,N,35144,N,40625,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40411,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38335,35443,N,N,N,N,N,N,N,N,N,N,N,N,N,40702,
+N,37242,N,N,N,N,37243,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39587,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,38594,N,N,N,N,N,40823,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39588,N,
+N,39589,N,N,N,37281,N,N,N,N,35256,N,N,N,N,N,N,N,N,N,N,37235,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39590,35261,N,
+35257,N,37245,N,N,N,N,N,N,N,N,N,38587,N,N,N,40946,N,N,35829,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,39593,N,N,N,N,N,40788,N,N,40931,40685,N,N,N,N,N,N,N,N,N,N,37290,N,N,N,
+N,37291,41072,N,40813,N,N,N,N,N,37292,N,N,N,37293,N,N,N,41213,N,40930,N,37295,
+40513,39594,N,N,37296,N,39595,N,N,N,N,N,N,N,N,N,N,N,39596,N,39498,N,37298,N,N,
+35830,N,39597,35254,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39599,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,39600,N,N,N,N,N,N,39601,N,N,N,N,N,39585,37305,N,N,
+N,N,N,37306,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37310,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41025,35767,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37312,N,N,N,N,N,N,N,N,N,N,39603,
+37315,N,N,N,N,N,N,N,N,N,N,41212,N,N,40942,N,N,N,N,N,N,40809,N,N,N,N,N,N,N,
+37320,N,N,N,N,N,N,37321,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36326,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37323,N,N,N,N,N,N,N,N,N,N,35272,N,N,N,N,N,36266,N,N,N,N,
+N,40925,35907,35949,35956,36023,36025,36027,36032,36055,36056,36058,51361,
+51363,36077,36168,35832,51408,N,N,N,N,51407,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,50916,N,
+50917,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,51405,N,51406,N,N,N,N,N,N,N,N,63998,
+};
+
+static const struct unim_index big5hkscs_bmp_encmap[256] = {
+{__big5hkscs_bmp_encmap+0,168,252},{__big5hkscs_bmp_encmap+85,0,220},{
+__big5hkscs_bmp_encmap+306,80,198},{0,0,0},{__big5hkscs_bmp_encmap+425,1,81},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__big5hkscs_bmp_encmap+506,190,
+193},{0,0,0},{0,0,0},{__big5hkscs_bmp_encmap+510,22,231},{0,0,0},{
+__big5hkscs_bmp_encmap+720,218,219},{__big5hkscs_bmp_encmap+722,96,125},{
+__big5hkscs_bmp_encmap+752,80,112},{0,0,0},{__big5hkscs_bmp_encmap+785,61,61},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__big5hkscs_bmp_encmap+786,
+128,227},{__big5hkscs_bmp_encmap+886,51,51},{__big5hkscs_bmp_encmap+887,5,254
+},{__big5hkscs_bmp_encmap+1137,192,207},{__big5hkscs_bmp_encmap+1153,49,49},{
+0,0,0},{__big5hkscs_bmp_encmap+1154,53,251},{__big5hkscs_bmp_encmap+1353,6,254
+},{__big5hkscs_bmp_encmap+1602,9,245},{__big5hkscs_bmp_encmap+1839,1,251},{
+__big5hkscs_bmp_encmap+2090,15,250},{__big5hkscs_bmp_encmap+2326,8,254},{
+__big5hkscs_bmp_encmap+2573,1,251},{__big5hkscs_bmp_encmap+2824,14,244},{
+__big5hkscs_bmp_encmap+3055,13,239},{__big5hkscs_bmp_encmap+3282,18,253},{
+__big5hkscs_bmp_encmap+3518,6,255},{__big5hkscs_bmp_encmap+3768,0,250},{
+__big5hkscs_bmp_encmap+4019,4,250},{__big5hkscs_bmp_encmap+4266,2,249},{
+__big5hkscs_bmp_encmap+4514,17,252},{__big5hkscs_bmp_encmap+4750,43,242},{
+__big5hkscs_bmp_encmap+4950,1,244},{__big5hkscs_bmp_encmap+5194,3,234},{
+__big5hkscs_bmp_encmap+5426,3,247},{__big5hkscs_bmp_encmap+5671,19,244},{
+__big5hkscs_bmp_encmap+5897,0,250},{__big5hkscs_bmp_encmap+6148,6,231},{
+__big5hkscs_bmp_encmap+6374,15,255},{__big5hkscs_bmp_encmap+6615,16,192},{
+__big5hkscs_bmp_encmap+6792,4,237},{__big5hkscs_bmp_encmap+7026,7,156},{
+__big5hkscs_bmp_encmap+7176,4,248},{__big5hkscs_bmp_encmap+7421,3,253},{
+__big5hkscs_bmp_encmap+7672,3,252},{__big5hkscs_bmp_encmap+7922,1,254},{
+__big5hkscs_bmp_encmap+8176,2,249},{__big5hkscs_bmp_encmap+8424,1,254},{
+__big5hkscs_bmp_encmap+8678,19,239},{__big5hkscs_bmp_encmap+8899,2,251},{
+__big5hkscs_bmp_encmap+9149,5,253},{__big5hkscs_bmp_encmap+9398,0,254},{
+__big5hkscs_bmp_encmap+9653,3,251},{__big5hkscs_bmp_encmap+9902,2,249},{
+__big5hkscs_bmp_encmap+10150,2,254},{__big5hkscs_bmp_encmap+10403,13,255},{
+__big5hkscs_bmp_encmap+10646,5,252},{__big5hkscs_bmp_encmap+10894,16,245},{
+__big5hkscs_bmp_encmap+11124,9,252},{__big5hkscs_bmp_encmap+11368,12,223},{
+__big5hkscs_bmp_encmap+11580,35,253},{__big5hkscs_bmp_encmap+11799,7,226},{
+__big5hkscs_bmp_encmap+12019,44,229},{__big5hkscs_bmp_encmap+12205,24,254},{
+__big5hkscs_bmp_encmap+12436,7,234},{__big5hkscs_bmp_encmap+12664,10,255},{
+__big5hkscs_bmp_encmap+12910,24,241},{__big5hkscs_bmp_encmap+13128,2,254},{
+__big5hkscs_bmp_encmap+13381,0,202},{__big5hkscs_bmp_encmap+13584,0,250},{
+__big5hkscs_bmp_encmap+13835,3,246},{__big5hkscs_bmp_encmap+14079,5,250},{
+__big5hkscs_bmp_encmap+14325,28,255},{__big5hkscs_bmp_encmap+14553,2,254},{
+__big5hkscs_bmp_encmap+14806,2,250},{__big5hkscs_bmp_encmap+15055,4,248},{
+__big5hkscs_bmp_encmap+15300,3,254},{__big5hkscs_bmp_encmap+15552,5,246},{
+__big5hkscs_bmp_encmap+15794,0,226},{__big5hkscs_bmp_encmap+16021,2,251},{
+__big5hkscs_bmp_encmap+16271,2,248},{__big5hkscs_bmp_encmap+16518,5,220},{
+__big5hkscs_bmp_encmap+16734,2,217},{__big5hkscs_bmp_encmap+16950,12,254},{
+__big5hkscs_bmp_encmap+17193,8,245},{__big5hkscs_bmp_encmap+17431,6,244},{
+__big5hkscs_bmp_encmap+17670,6,254},{__big5hkscs_bmp_encmap+17919,11,252},{
+__big5hkscs_bmp_encmap+18161,18,252},{__big5hkscs_bmp_encmap+18396,37,254},{
+__big5hkscs_bmp_encmap+18614,7,223},{__big5hkscs_bmp_encmap+18831,6,250},{
+__big5hkscs_bmp_encmap+19076,2,246},{__big5hkscs_bmp_encmap+19321,3,246},{
+__big5hkscs_bmp_encmap+19565,24,255},{__big5hkscs_bmp_encmap+19797,11,237},{
+__big5hkscs_bmp_encmap+20024,5,248},{__big5hkscs_bmp_encmap+20268,3,252},{
+__big5hkscs_bmp_encmap+20518,2,239},{__big5hkscs_bmp_encmap+20756,112,245},{
+__big5hkscs_bmp_encmap+20890,4,255},{__big5hkscs_bmp_encmap+21142,0,231},{
+__big5hkscs_bmp_encmap+21374,28,249},{__big5hkscs_bmp_encmap+21596,12,226},{
+__big5hkscs_bmp_encmap+21811,81,247},{__big5hkscs_bmp_encmap+21978,3,212},{
+__big5hkscs_bmp_encmap+22188,1,242},{__big5hkscs_bmp_encmap+22430,25,249},{
+__big5hkscs_bmp_encmap+22655,8,196},{__big5hkscs_bmp_encmap+22844,81,254},{
+__big5hkscs_bmp_encmap+23018,8,253},{__big5hkscs_bmp_encmap+23264,3,244},{
+__big5hkscs_bmp_encmap+23506,1,246},{__big5hkscs_bmp_encmap+23752,45,244},{
+__big5hkscs_bmp_encmap+23952,29,244},{__big5hkscs_bmp_encmap+24168,3,245},{
+__big5hkscs_bmp_encmap+24411,20,245},{__big5hkscs_bmp_encmap+24637,14,245},{
+__big5hkscs_bmp_encmap+24869,12,255},{__big5hkscs_bmp_encmap+25113,2,255},{
+__big5hkscs_bmp_encmap+25367,2,124},{__big5hkscs_bmp_encmap+25490,2,252},{
+__big5hkscs_bmp_encmap+25741,10,254},{__big5hkscs_bmp_encmap+25986,2,179},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{__big5hkscs_bmp_encmap+26164,7,7},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{__big5hkscs_bmp_encmap+26165,2,237},
+};
+
+static const DBCHAR __big5hkscs_nonbmp_encmap[29306] = {
+40049,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37749,N,N,N,N,N,
+N,N,37750,N,N,N,N,N,N,N,38216,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,36550,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35781,35834,
+N,N,51324,N,N,N,N,N,N,N,N,N,39604,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34894,34891,
+51322,34888,N,N,N,34887,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,41206,34885,N,34899,N,N,N,N,N,N,N,N,N,64685,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36085,N,N,N,N,35501,N,37490,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,64583,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38111,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40913,64459,N,N,N,N,N,N,N,37501,N,N,N,N,N,N,N,
+39076,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36089,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38119,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37067,37499,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38104,N,N,N,N,64607,N,
+64084,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39605,N,N,N,N,N,N,N,38618,
+37497,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64116,37493,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36347,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35401,N,N,N,37599,39804,64099,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,64096,37485,64098,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39606,N,N,N,N,N,N,38763,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64874,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64852,N,37491,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38872,N,N,N,N,
+N,N,40891,37698,37494,N,N,N,N,N,N,N,N,N,N,64101,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37484,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64110,N,N,N,N,N,N,40672,N,N,37568,37567,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,37566,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39610,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35507,N,38773,64064,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64118,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64464,N,N,N,N,N,N,N,N,N,N,N,N,N,64123,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,65133,N,N,N,N,N,N,39859,N,N,N,N,N,35276,N,N,N,N,39614,N,N,N,N,N,
+N,N,N,N,64066,37564,N,N,N,N,N,N,N,N,N,N,37980,39861,N,N,N,39615,N,N,N,39079,
+38820,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37117,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64635,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39616,37571,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35498,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39888,38224,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37574,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39078,38214,N,N,N,N,N,N,N,N,N,N,N,N,64867,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64194,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40643,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35250,40038,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36947,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,35938,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,38849,N,N,N,N,N,N,N,N,N,N,N,N,N,39620,N,N,N,N,N,N,N,N,N,N,39621,36591,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64233,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36160,N,N,N,N,N,N,N,N,
+37474,35575,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39622,N,N,N,N,N,N,37601,
+N,N,N,N,39625,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64198,N,N,N,N,N,N,N,
+N,38821,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39627,N,N,N,64114,35422,N,38112,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,37580,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35557,
+N,N,N,N,N,65116,39628,N,N,N,N,N,40441,35395,35494,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,39629,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39630,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,64238,39884,N,N,N,39631,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39633,N,N,N,N,N,N,
+N,N,40442,N,N,N,N,N,40316,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39635,N,N,38822,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39263,N,N,N,64502,
+40901,35417,35691,N,N,N,N,N,N,39636,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39637,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38818,35396,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40778,N,N,N,N,N,N,N,N,37025,64932,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35428,
+35570,35576,40408,N,N,38102,64254,64423,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,39638,N,40781,N,N,64246,N,N,N,N,N,N,N,35415,N,35651,
+35652,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35510,N,N,N,N,N,35520,N,N,N,
+N,N,N,N,N,N,N,40532,N,N,N,N,N,N,N,N,N,N,39639,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39640,39644,N,N,N,N,35530,40616,N,N,37475,39645,35685,35695,35710,N,
+N,N,N,36675,N,N,N,N,N,N,37584,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35572,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40382,N,N,N,N,N,39649,N,64734,40445,35686,
+35696,35701,35556,35748,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35565,N,N,N,N,N,N,N,N,
+N,35421,N,35656,N,N,N,N,40429,N,N,N,N,40512,N,N,N,N,N,N,N,35567,35574,40566,N,
+N,N,N,N,N,N,N,N,40675,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,39646,36350,N,N,N,N,64252,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,40113,40567,35684,35687,38731,N,N,N,N,N,N,N,N,38483,N,N,N,N,N,N,39648,
+35658,N,35569,35543,N,N,N,N,N,N,N,N,N,41131,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35509,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35423,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35566,N,N,39647,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35582,N,N,N,N,N,N,35416,
+35747,35751,N,N,N,N,N,39651,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,37473,N,N,N,N,N,N,N,N,N,N,40407,40573,40615,40619,36930,N,N,
+N,N,N,N,N,N,35705,35706,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39654,N,N,N,N,N,N,N,N,N,N,N,N,39653,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35454,N,N,N,N,N,40516,39655,35452,35697,N,
+N,39657,N,N,N,N,N,N,N,N,N,N,N,N,39658,N,N,N,N,N,N,N,N,N,N,N,N,N,39659,N,N,N,N,
+N,N,35517,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64334,N,N,N,N,N,N,N,N,N,
+N,39661,35577,40547,N,N,N,N,N,35657,35534,35694,N,N,N,N,N,35560,N,N,N,39662,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37582,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35418,35707,
+35708,39663,N,N,N,N,N,N,N,N,N,N,N,39664,N,35578,N,N,N,N,N,N,N,35137,N,N,35698,
+N,N,N,N,N,N,35571,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35752,N,N,N,N,N,N,40622,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40562,64371,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64351,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37050,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37374,40694,
+N,N,N,N,N,N,38893,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39667,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,41198,38524,37701,39022,64086,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39669,N,N,
+N,64587,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39668,65246,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64695,N,N,N,N,N,N,N,N,N,38897,N,N,N,38855,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40139,
+37440,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,40168,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37373,38734,N,N,64360,N,N,N,N,N,N,N,
+N,N,N,N,N,N,38764,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36034,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38888,N,64362,35700,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,36583,N,N,N,N,N,N,N,N,N,N,N,N,64968,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,37441,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38561,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,36595,39671,N,N,N,N,N,N,N,N,N,N,36774,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64214,40135,N,N,N,N,N,N,N,N,64215,N,N,N,N,N,39672,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64417,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36549,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64420,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64450,N,39617,N,N,N,N,N,37370,65243,38827,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37191,N,64433,N,N,N,N,N,N,N,N,N,36842,N,N,N,N,N,N,38098,65121,64206,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37613,37363,37830,N,37722,64251,N,N,37615,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64200,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38983,37734,38997,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38630,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40771,40874,38106,37614,64687,64507,N,
+36601,37366,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37732,N,N,N,N,38133,40118,64429,
+38990,36676,38653,N,N,N,N,N,N,N,N,N,N,N,N,N,39673,N,N,N,39674,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,38761,38356,38987,64426,N,N,39036,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,37354,N,N,N,N,N,40367,40389,N,37361,36529,38825,64428,64696,40121,N,N,N,N,
+N,N,N,64432,64722,37835,N,N,39677,N,N,N,N,N,N,N,N,N,N,N,37364,35756,41045,N,N,
+N,N,38260,N,N,N,N,38334,N,N,N,N,N,N,N,N,N,N,N,N,38829,N,N,N,N,N,N,N,N,N,N,N,
+36585,N,N,37624,38846,37228,38058,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64611,N,
+N,N,40390,N,N,N,N,N,N,N,38837,37560,37359,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,65190,38752,37720,38262,36780,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,37356,38836,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37367,N,N,N,N,
+38730,64329,38264,37820,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,37334,37717,37718,38993,N,N,N,N,N,N,N,N,N,N,36856,64448,37874,N,N,
+37072,N,N,N,N,N,N,40004,N,N,N,N,N,37461,N,N,N,N,37731,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,37285,N,N,N,N,N,N,N,N,41197,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64875,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39678,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,37713,N,N,N,35927,N,N,64120,N,N,N,N,65192,N,N,N,N,N,N,N,N,N,N,N,N,N,37712,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64076,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37623,39744,N,N,N,N,N,N,64462,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,39745,N,N,N,N,N,65197,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,34657,64469,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35778,39548,39746,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39747,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40569,N,N,64473,N,N,
+N,N,N,N,39748,41127,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34670,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,39923,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,35961,N,N,N,37726,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35275,N,N,N,N,
+N,N,40787,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37847,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64481,65232,N,N,N,N,N,N,36081,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,64482,N,N,N,N,N,64739,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36980,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64486,N,N,N,39863,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,39749,N,N,N,N,N,N,N,N,N,N,N,N,39751,40784,N,N,N,N,N,39752,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64603,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,39081,N,N,40189,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,34892,39755,N,N,N,64492,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35945,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39848,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35541,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64115,64857,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37282,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64493,N,N,N,N,N,N,40105,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35496,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36162,N,39875,35553,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39758,38352,N,
+N,N,36959,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38894,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64590,N,N,N,N,N,N,39759,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39760,40646,N,N,N,N,N,
+N,N,N,N,N,N,64592,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64883,N,N,
+N,N,N,64935,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40354,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64088,64094,N,N,N,N,N,N,N,41049,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64117,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64446,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40098,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37744,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,37745,37751,65263,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37741,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64605,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,37048,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35580,N,
+64321,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40555,38115,36578,35965,N,36567,N,N,N,N,N,N,
+40013,N,N,N,38563,N,N,N,N,N,N,N,N,N,N,39761,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35523,N,N,N,N,N,N,N,N,N,N,N,38570,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36066,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64616,35693,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64871,35561,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64673,37740,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,39762,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65136,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,64680,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64745,40116,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,35562,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39763,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39765,N,N,N,38571,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,64679,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39766,35516,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35531,N,N,N,N,N,39767,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,35277,N,39769,39771,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37797,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39773,N,N,
+N,40527,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37795,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35451,N,N,N,35650,38736,36787,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35408,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39776,N,N,N,N,35653,N,N,N,35654,N,N,N,N,N,N,N,N,N,N,N,N,40446,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39778,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37755,N,N,N,N,N,37809,N,N,N,N,N,N,N,35424,N,N,N,N,N,N,N,
+N,35544,N,N,N,N,39779,N,N,N,N,N,N,N,N,N,N,35433,N,N,N,35399,N,N,35532,37756,
+39781,N,N,N,N,N,N,N,N,N,39782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35442,N,N,N,N,N,N,N,35450,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37807,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35504,N,N,N,N,N,N,N,39784,
+N,N,N,N,N,N,N,N,N,N,40611,N,N,64236,35703,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39783,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35673,64689,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64699,N,N,N,N,N,N,N,N,N,N,N,
+39785,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37800,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35552,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,40529,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36703,39786,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,39787,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38892,39788,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,65102,N,N,N,N,N,N,64962,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39789,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37223,
+64716,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37814,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37092,N,N,N,N,37093,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40690,37834,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,35772,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36678,N,N,
+N,N,37839,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64731,64732,N,N,N,N,N,N,N,N,N,N,N,N,N,37824,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,64742,38631,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64728,64729,64934,37838,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,38385,N,N,N,N,N,N,N,N,N,40169,N,64740,38063,64119,37836,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36065,N,N,N,N,N,
+N,N,N,N,N,N,36954,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35924,N,N,N,N,N,N,N,37823,64337,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,37817,65239,37815,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37849,N,N,N,N,N,N,N,N,N,N,N,N,N,37819,37850,
+39075,N,N,N,N,N,N,N,N,N,37073,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39790,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64112,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39915,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39791,N,N,N,N,N,N,N,64764,N,N,N,N,N,N,N,N,N,N,N,N,N,35648,41083,N,N,N,36001,
+38903,N,N,N,37858,64726,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38233,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37798,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64832,N,N,37727,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38898,40054,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,36600,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36075,N,N,N,N,N,N,N,N,36679,N,N,N,N,N,N,N,N,N,N,N,N,39796,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37556,N,
+N,N,37357,N,N,38610,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64838,36687,38217,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39797,64092,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,34641,N,N,39801,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64843,N,N,N,38611,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64856,N,N,N,N,N,37983,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,41205,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,37443,N,N,N,N,N,N,38906,N,N,N,N,N,N,N,N,N,N,N,N,
+40409,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38900,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37453,64859,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,39802,N,N,N,N,N,N,N,N,N,40661,N,N,N,N,N,N,N,N,N,N,N,N,64174,N,40137,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37464,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,36552,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,38068,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37857,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37855,N,N,N,N,N,64752,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37868,38902,38607,37854,35535,39842,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64873,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37714,N,N,N,N,N,N,
+N,N,N,N,N,39074,36071,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64878,
+36004,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64124,37882,36988,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,36711,N,40375,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41193,
+64078,64929,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40564,40895,40651,39865,40404,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38841,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36593,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38267,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40658,38739,38564,36798,38105,36952,64889,64891,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36570,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36602,34658,N,N,N,N,N,N,N,N,N,N,39845,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,40665,38868,37051,64956,64966,37448,N,N,N,N,N,N,N,
+37557,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,40385,37561,37542,36683,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39846,N,N,N,N,N,37558,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36416,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,40664,37982,39007,38094,37450,64880,37991,N,N,N,N,N,N,N,
+N,N,N,N,36332,N,N,N,N,N,N,N,N,39896,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,34659,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37960,64193,
+40183,64958,N,N,N,N,N,N,N,N,N,N,N,N,36826,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64985,N,N,64638,N,N,N,N,N,N,N,N,37881,N,N,
+N,N,64067,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,64235,64195,38867,38393,40008,64984,41176,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64983,64330,39855,37963,64969,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36524,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64946,N,N,
+N,N,N,37466,64701,37593,N,N,N,64981,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37597,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37465,N,N,N,N,N,N,N,N,N,N,36080,
+38586,N,N,N,N,N,N,N,N,N,N,37467,N,N,N,N,N,N,N,N,N,39851,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64986,64990,N,N,N,64979,N,
+N,N,N,N,N,N,N,N,35910,N,N,N,N,N,N,64982,64988,64989,N,N,N,N,37118,N,N,65185,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35757,N,N,40152,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40557,64892,
+64353,N,N,N,N,N,N,38648,N,N,N,N,N,N,N,N,38640,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64756,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65120,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38994,38479,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37230,N,N,N,
+N,N,N,N,N,N,N,39021,N,N,39012,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,37971,65004,64376,N,N,N,N,N,N,N,N,N,N,N,38330,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,39005,N,37625,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39002,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,34640,N,65014,N,N,N,N,N,N,N,37840,39010,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39853,N,N,N,N,N,N,N,
+N,N,N,N,38735,39854,N,N,N,N,N,N,N,N,N,N,N,N,37970,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39856,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37330,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38890,64363,37297,65011,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37579,N,N,N,
+N,N,N,N,N,N,39857,N,N,N,N,N,64748,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,39019,N,N,N,38737,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39025,38383,N,N,N,N,N,N,N,40691,N,N,N,N,
+N,37352,39866,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64332,37482,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65016,39009,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,37351,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37869,38724,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,37345,N,N,64501,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39017,N,N,N,N,
+35426,N,N,39867,36008,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40021,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36471,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35506,40636,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37862,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37794,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39869,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38067,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37757,40550,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37977,N,N,N,N,N,N,N,N,N,39871,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,37976,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40613,39879,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,65108,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36468,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,35798,N,N,N,N,N,N,38070,64884,39104,38053,N,N,N,N,N,N,N,
+39880,N,N,N,38381,64894,64491,N,N,N,N,N,N,N,N,N,N,64893,N,N,N,N,N,N,N,N,N,
+38767,37985,N,40897,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38359,N,N,N,
+64082,40024,N,N,N,N,N,N,N,N,N,40808,39911,64718,38632,64073,38817,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38221,40696,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,65097,37326,38769,N,N,N,N,36047,N,N,N,64945,N,N,64622,N,N,N,N,N,
+40178,37816,36931,38745,38103,65126,38013,64623,N,N,N,N,37446,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64109,N,N,36599,N,64439,N,38012,37581,38834,N,N,N,N,N,N,N,N,N,
+65125,38526,38744,39799,37327,N,N,N,N,N,N,N,N,N,38052,N,N,N,N,N,N,N,N,N,N,
+40109,N,N,N,N,N,N,N,N,N,35755,N,N,N,38613,64691,N,N,N,37806,N,38765,N,N,N,N,N,
+N,37958,38391,N,N,N,N,N,N,N,N,40006,38235,37329,38132,N,65127,37541,N,N,N,
+65247,36011,N,39881,N,N,N,N,N,N,N,N,N,N,N,64749,65018,64712,65122,37372,65131,
+65017,64711,37198,40120,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38759,N,N,N,
+38382,N,N,39858,N,N,N,N,37984,N,N,N,38050,39029,38828,37331,N,N,N,N,N,N,N,N,N,
+N,N,39035,N,N,N,N,N,N,N,36587,38762,38494,N,N,N,N,N,N,N,N,N,38891,N,N,N,N,N,
+40953,38392,65186,36838,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65150,N,N,N,N,N,N,
+40356,38760,36588,38077,N,N,N,N,N,N,N,N,N,N,N,N,N,37979,40182,64167,39897,N,N,
+N,N,N,N,N,N,N,64093,38486,38754,N,N,N,N,N,N,38074,41039,37592,N,N,N,39883,N,N,
+N,N,N,N,38075,N,N,40287,N,N,N,N,N,N,37071,N,N,N,N,N,N,N,N,N,N,N,N,N,37989,N,N,
+40780,N,N,N,N,N,N,37080,36187,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40638,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64365,38346,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,40386,38904,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36860,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38003,
+38004,N,N,N,N,N,N,N,N,N,N,N,N,65207,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35403,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35413,35689,35548,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35702,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39886,N,35432,41208,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,39135,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,65205,N,N,N,39887,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38651,N,
+N,39931,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40654,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36581,N,
+N,N,N,N,N,N,N,N,40571,39890,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,35493,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,65230,35397,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,40444,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65231,35749,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35914,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,35564,N,N,64736,38061,65237,38060,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64602,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39894,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,35439,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35753,36447,N,N,40395,N,
+64743,39895,N,N,N,N,N,N,N,N,N,N,N,37832,N,N,N,N,N,N,N,N,N,37360,36832,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39899,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37101,N,39900,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36179,41196,N,N,N,
+39162,N,N,N,N,N,N,N,N,N,39904,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37831,37449,38625,39906,N,N,N,39908,N,N,36833,39909,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38080,N,N,37827,N,N,N,N,N,N,N,N,N,N,37829,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36985,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38779,N,N,N,N,N,
+36990,N,N,N,N,65254,65094,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40376,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,37488,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38312,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36016,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,38088,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39097,37184,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64702,N,N,N,N,N,N,N,37207,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35762,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64223,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,39910,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38467,36420,40015,65268,
+N,N,N,N,N,39912,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37852,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38511,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36426,39917,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37622,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40377,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,36430,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,64463,34656,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40642,
+N,N,N,N,N,N,38117,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39920,38116,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,38225,35771,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39921,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,38128,36452,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38122,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36705,N,N,N,39780,36443,N,N,N,N,
+39922,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40894,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40393,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36460,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36723,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,36015,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,36725,36465,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36448,36458,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,35916,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38226,38228,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35540,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40379,38211,37630,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,38130,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38129,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41194,40402,41137,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37368,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37986,39844,
+36525,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40621,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38608,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65262,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,35508,N,N,N,N,N,N,N,N,N,N,N,N,38743,35447,39927,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36533,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41069,
+36534,38742,38208,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,41203,38078,N,N,N,39930,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64991,40380,N,N,N,N,N,N,N,
+N,38142,N,N,N,N,N,N,N,N,35803,41214,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,36544,40775,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35806,41211,N,N,N,N,
+36547,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38473,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,65218,N,N,38220,39933,N,N,N,N,N,N,N,N,N,N,N,N,N,37068,
+40032,38219,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39934,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40048,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,40003,N,N,N,40007,36556,N,N,N,36436,N,N,N,N,N,N,N,N,N,N,36580,
+40009,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35678,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38238,N,N,N,N,N,N,N,
+N,N,N,N,N,38236,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40011,35809,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36569,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40372,N,
+37471,N,N,N,40012,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,35489,N,N,N,N,N,N,N,N,N,N,N,N,N,36571,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40022,35490,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38740,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40030,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40660,38248,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,41155,35558,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,41207,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40033,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40031,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64589,N,40539,N,N,N,N,N,N,N,N,40553,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40035,65223,N,N,65222,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40039,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40041,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,37221,N,N,N,N,N,N,N,N,N,N,N,N,40167,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,35412,N,N,N,N,N,N,N,40044,40046,65117,N,N,N,N,N,40051,N,
+N,N,N,N,N,N,N,N,N,N,N,N,38250,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38253,36592,36685,N,
+N,N,N,36598,N,N,N,N,N,N,N,N,64188,N,36053,N,N,N,N,N,N,N,N,N,N,N,N,N,34654,N,N,
+N,N,64474,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,35660,64885,39901,64245,N,N,N,N,N,N,N,40052,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,38213,N,N,N,N,N,N,N,N,N,N,N,N,38598,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,36714,36686,N,N,N,N,N,40056,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64085,N,N,N,N,N,N,N,N,N,N,N,N,38884,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40001,37468,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38650,36086,N,N,N,N,36173,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64358,36453,38985,
+64424,38978,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40058,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38907,37066,N,N,N,N,40027,N,N,38733,
+N,N,36563,N,N,N,N,N,N,N,N,N,N,N,N,N,38241,40779,40885,37842,64938,38976,37190,
+39015,64090,64425,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,38977,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,36051,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64765,64939,37309,36684,38601,36693,64430,38255,N,N,
+N,N,N,N,40061,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,41200,N,N,N,N,N,N,N,N,N,N,N,N,N,37999,64940,N,N,N,N,
+38603,38606,N,N,N,N,41046,N,40161,N,N,N,N,N,N,N,N,N,N,38596,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+36702,36716,36515,64435,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64595,N,N,N,64947,N,N,N,N,36715,N,N,N,N,N,N,N,N,N,N,
+N,N,38602,N,N,N,N,N,N,34643,N,N,N,N,N,N,N,N,N,N,N,N,N,36729,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,40559,41157,64632,36418,36698,37058,36517,36961,37455,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37747,64949,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,65228,N,64445,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36054,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38979,38597,
+35260,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40099,N,N,N,N,N,N,37451,38986,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,36772,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,41201,40699,40146,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,36775,N,N,N,N,34644,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64604,38981,N,N,36934,36049,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65274,38240,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,40776,37447,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37115,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40100,38257,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,34629,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40102,N,N,N,N,
+40103,N,N,N,N,N,40106,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,40659,N,N,N,40560,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40108,34642,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36782,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,36176,38269,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40112,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38838,N,41149,35551,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40618,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,36797,N,N,N,36799,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37737,
+39847,51364,N,N,N,N,65258,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,39905,N,N,N,N,N,N,35649,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,40374,41195,39843,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,35745,36808,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,35148,39008,N,N,N,N,N,N,N,N,N,N,38087,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,35672,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38315,38314,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,40131,40132,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37846,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,40364,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35814,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35441,36817,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,39381,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37108,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35491,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40142,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40148,40149,N,N,N,64456,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40371,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64624,N,N,N,N,N,36823,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39795,N,N,N,N,N,N,N,N,N,N,64091,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36818,36964,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39094,
+38504,N,N,N,N,40150,N,N,N,N,N,N,N,N,N,N,N,N,39101,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36828,65270,36825,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38209,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,34668,N,N,N,N,38899,39928,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+34650,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34632,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34634,40556,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36850,36846,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40151,N,N,N,N,N,N,N,N,N,N,N,N,40558,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35392,N,
+N,N,N,N,N,N,N,N,N,36847,N,N,N,N,N,N,N,N,36852,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36853,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38338,39018,N,38863,40677,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40572,
+36929,N,N,N,N,N,N,40155,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37953,N,N,N,N,
+40166,40368,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,40170,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40173,N,N,N,N,N,N,N,N,N,N,N,N,
+40186,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,35682,35406,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40138,35430,N,N,N,N,N,N,N,N,N,N,40187,40188,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40190,N,N,N,N,N,
+N,N,N,N,N,N,N,N,35411,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40165,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40256,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40257,N,N,N,N,N,N,N,N,N,N,N,N,36933,35699,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38858,N,40258,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,35425,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,35758,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35538,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,35746,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40434,
+40259,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40159,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,40260,N,N,N,N,N,N,N,N,N,N,36554,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36942,N,N,N,N,N,N,N,36531,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,40949,N,N,N,N,N,N,N,N,N,N,N,N,40261,36943,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,40263,N,N,N,35274,N,N,N,N,N,N,40117,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64510,
+36958,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36963,36951,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36966,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,39872,N,N,N,N,N,N,N,N,N,N,N,64741,37218,N,N,N,N,N,N,N,N,N,N,36967,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36769,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,36770,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40264,64211,N,N,N,N,N,N,36175,N,N,N,N,N,N,N,N,N,36957,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37049,N,N,N,N,N,N,N,N,N,N,N,N,N,36971,
+35932,N,N,N,36969,65111,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,65109,36979,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+39919,40176,N,N,N,N,N,N,N,N,N,N,N,N,40267,N,N,N,N,N,N,N,N,N,N,N,N,N,65241,N,N,
+N,65242,N,N,N,37344,36163,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37336,N,N,N,N,N,N,N,
+N,N,N,38470,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37728,
+N,64083,40147,N,N,N,N,N,N,N,N,N,N,N,N,40270,N,N,N,64320,N,N,N,36322,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37954,N,36950,N,N,39013,N,35948,
+64074,N,N,40272,40274,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38319,38746,37705,38727,
+41204,N,N,N,N,N,N,38776,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36815,N,N,N,64608,N,N,N,N,
+N,N,N,N,35918,N,N,N,64598,N,N,N,N,N,N,N,N,N,N,N,N,N,37340,38497,37612,37725,
+36574,38654,64847,38366,N,N,N,N,N,N,N,N,N,N,N,N,N,39088,41024,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38845,38781,38901,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39852,64218,37570,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38833,N,N,N,N,N,36987,N,
+N,N,N,37886,38011,N,38775,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64190,64835,37062,
+37028,37032,38057,N,37033,N,N,N,N,35941,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38368,36989,N,N,N,N,N,N,37477,N,N,N,N,N,N,N,N,N,N,N,N,N,64954,37828,N,N,N,N,N,
+N,N,N,65261,40363,41187,N,38472,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40275,N,N,N,N,N,35497,N,39877,N,38493,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+38751,38495,38510,64349,N,N,N,N,N,40369,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65187,N,N,N,N,N,N,N,N,N,40370,N,N,38318,64675,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34665,N,N,N,N,N,N,N,N,
+41122,N,N,38485,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40276,N,N,37697,N,38317,37333,N,N,
+N,N,N,N,N,N,N,N,N,N,38778,65020,36423,37885,37029,37036,N,N,N,N,N,N,N,N,38316,
+N,N,N,N,N,N,N,N,N,37038,65189,N,N,N,N,N,40278,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,38883,38370,N,N,N,N,N,37990,N,N,38471,N,N,N,N,37304,N,N,N,N,40172,N,N,N,N,
+N,N,N,N,37037,N,38371,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35663,
+N,N,35555,N,N,N,N,35661,38378,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35662,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36033,
+35821,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,37337,N,N,41124,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38389,38388,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40883,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,65199,N,N,N,N,N,65138,37498,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65196,N,N,N,N,N,N,N,N,N,N,N,
+N,N,38387,40280,36166,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37746,N,N,37317,N,N,N,N,N,N,
+N,38466,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37069,38398,
+37209,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40037,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38860,37070,N,N,N,N,N,N,40281,64757,65277,N,N,
+40283,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,40284,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37758,N,N,N,N,N,N,N,N,N,N,
+N,N,N,39084,N,N,40286,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64976,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64864,N,
+N,N,N,N,N,N,N,N,N,N,40143,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37085,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37088,37107,N,N,39089,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37104,N,N,N,N,
+N,N,N,N,N,N,N,37821,N,N,N,N,N,N,N,N,38327,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40774,N,N,N,N,N,N,N,N,36427,38488,N,N,N,N,N,N,N,N,N,N,35404,N,40291,40655,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40293,N,N,N,N,N,N,N,40294,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38490,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40292,N,N,N,N,N,N,N,N,N,N,35436,35545,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40295,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,35440,35827,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37200,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,40129,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,40296,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37799,N,N,N,N,N,N,38516,N,N,N,N,N,N,N,N,36093,41199,N,37201,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38593,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34679,N,35940,38518,40297,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,64676,N,N,N,N,N,N,N,N,N,N,N,N,40298,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37454,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,40299,N,N,N,N,N,39873,40300,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,35429,37213,N,N,N,N,N,N,N,N,40301,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37210,35906,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40128,37226,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,40302,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,40614,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40397,N,N,40303,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35259,40697,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,38580,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,37234,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+40648,N,N,N,34673,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35669,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,40305,40306,N,N,N,N,N,N,N,N,N,N,N,N,40652,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,37236,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,40656,36956,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,36562,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37288,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37239,N,N,N,N,N,N,N,N,N,N,N,
+38591,N,N,N,N,N,38592,N,N,N,N,36785,N,N,N,N,N,38583,35925,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37240,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35262,
+37244,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64375,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37237,37283,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,37238,N,N,N,N,N,N,N,N,38590,36169,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,37241,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,38582,37284,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+37286,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40309,N,N,N,N,N,N,N,N,N,N,N,36946,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41029,N,37289,N,39082,N,N,N,35935,N,N,35754,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40157,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40311,34646,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,35136,40684,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,37802,38008,N,N,N,N,40314,35529,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35659,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40940,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+35554,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,40565,39028,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,39624,N,N,N,N,41031,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,35779,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64584,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64631,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,40018,36605,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36776,N,N,N,N,N,N,N,N,N,
+38266,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,36848,
+};
+
+static const struct unim_index big5hkscs_nonbmp_encmap[256] = {
+{__big5hkscs_nonbmp_encmap+0,33,238},{__big5hkscs_nonbmp_encmap+206,12,242},{
+__big5hkscs_nonbmp_encmap+437,4,229},{__big5hkscs_nonbmp_encmap+663,10,252},{
+__big5hkscs_nonbmp_encmap+906,19,254},{__big5hkscs_nonbmp_encmap+1142,71,235},
+{__big5hkscs_nonbmp_encmap+1307,17,118},{__big5hkscs_nonbmp_encmap+1409,14,121
+},{__big5hkscs_nonbmp_encmap+1517,44,213},{__big5hkscs_nonbmp_encmap+1687,22,
+231},{__big5hkscs_nonbmp_encmap+1897,17,205},{__big5hkscs_nonbmp_encmap+2086,
+13,255},{__big5hkscs_nonbmp_encmap+2329,11,255},{__big5hkscs_nonbmp_encmap+
+2574,21,200},{__big5hkscs_nonbmp_encmap+2754,4,251},{__big5hkscs_nonbmp_encmap
++3002,29,237},{__big5hkscs_nonbmp_encmap+3211,20,246},{
+__big5hkscs_nonbmp_encmap+3438,47,217},{__big5hkscs_nonbmp_encmap+3609,60,254
+},{__big5hkscs_nonbmp_encmap+3804,2,254},{__big5hkscs_nonbmp_encmap+4057,19,
+253},{__big5hkscs_nonbmp_encmap+4292,119,150},{__big5hkscs_nonbmp_encmap+4324,
+10,254},{__big5hkscs_nonbmp_encmap+4569,13,252},{__big5hkscs_nonbmp_encmap+
+4809,32,250},{__big5hkscs_nonbmp_encmap+5028,3,243},{__big5hkscs_nonbmp_encmap
++5269,45,99},{__big5hkscs_nonbmp_encmap+5324,68,194},{
+__big5hkscs_nonbmp_encmap+5451,42,172},{__big5hkscs_nonbmp_encmap+5582,70,249
+},{__big5hkscs_nonbmp_encmap+5762,28,213},{__big5hkscs_nonbmp_encmap+5948,15,
+232},{__big5hkscs_nonbmp_encmap+6166,69,252},{__big5hkscs_nonbmp_encmap+6350,
+42,195},{__big5hkscs_nonbmp_encmap+6504,8,124},{__big5hkscs_nonbmp_encmap+6621
+,33,250},{__big5hkscs_nonbmp_encmap+6839,101,237},{__big5hkscs_nonbmp_encmap+
+6976,19,190},{__big5hkscs_nonbmp_encmap+7148,27,246},{
+__big5hkscs_nonbmp_encmap+7368,18,205},{__big5hkscs_nonbmp_encmap+7556,3,247},
+{__big5hkscs_nonbmp_encmap+7801,38,147},{__big5hkscs_nonbmp_encmap+7911,102,
+232},{__big5hkscs_nonbmp_encmap+8042,14,206},{__big5hkscs_nonbmp_encmap+8235,
+38,201},{__big5hkscs_nonbmp_encmap+8399,7,238},{__big5hkscs_nonbmp_encmap+8631
+,13,239},{__big5hkscs_nonbmp_encmap+8858,116,227},{__big5hkscs_nonbmp_encmap+
+8970,51,218},{__big5hkscs_nonbmp_encmap+9138,3,249},{__big5hkscs_nonbmp_encmap
++9385,15,225},{__big5hkscs_nonbmp_encmap+9596,0,254},{
+__big5hkscs_nonbmp_encmap+9851,0,229},{__big5hkscs_nonbmp_encmap+10081,25,243
+},{__big5hkscs_nonbmp_encmap+10300,0,238},{__big5hkscs_nonbmp_encmap+10539,3,
+215},{__big5hkscs_nonbmp_encmap+10752,58,58},{__big5hkscs_nonbmp_encmap+10753,
+194,194},{__big5hkscs_nonbmp_encmap+10754,167,250},{__big5hkscs_nonbmp_encmap+
+10838,26,90},{__big5hkscs_nonbmp_encmap+10903,99,255},{
+__big5hkscs_nonbmp_encmap+11060,64,248},{__big5hkscs_nonbmp_encmap+11245,6,252
+},{__big5hkscs_nonbmp_encmap+11492,53,240},{__big5hkscs_nonbmp_encmap+11680,
+17,236},{__big5hkscs_nonbmp_encmap+11900,4,252},{__big5hkscs_nonbmp_encmap+
+12149,27,250},{__big5hkscs_nonbmp_encmap+12373,13,248},{
+__big5hkscs_nonbmp_encmap+12609,4,214},{__big5hkscs_nonbmp_encmap+12820,5,200
+},{__big5hkscs_nonbmp_encmap+13016,24,212},{__big5hkscs_nonbmp_encmap+13205,6,
+224},{__big5hkscs_nonbmp_encmap+13424,18,255},{__big5hkscs_nonbmp_encmap+13662
+,0,251},{__big5hkscs_nonbmp_encmap+13914,14,233},{__big5hkscs_nonbmp_encmap+
+14134,15,245},{__big5hkscs_nonbmp_encmap+14365,9,217},{
+__big5hkscs_nonbmp_encmap+14574,6,235},{__big5hkscs_nonbmp_encmap+14804,59,167
+},{__big5hkscs_nonbmp_encmap+14913,14,194},{__big5hkscs_nonbmp_encmap+15094,
+44,157},{__big5hkscs_nonbmp_encmap+15208,43,231},{__big5hkscs_nonbmp_encmap+
+15397,32,216},{__big5hkscs_nonbmp_encmap+15582,14,19},{
+__big5hkscs_nonbmp_encmap+15588,25,154},{__big5hkscs_nonbmp_encmap+15718,49,
+224},{__big5hkscs_nonbmp_encmap+15894,5,246},{__big5hkscs_nonbmp_encmap+16136,
+6,225},{__big5hkscs_nonbmp_encmap+16356,87,225},{__big5hkscs_nonbmp_encmap+
+16495,3,204},{__big5hkscs_nonbmp_encmap+16697,84,233},{
+__big5hkscs_nonbmp_encmap+16847,116,232},{__big5hkscs_nonbmp_encmap+16964,1,
+254},{__big5hkscs_nonbmp_encmap+17218,32,67},{__big5hkscs_nonbmp_encmap+17254,
+14,216},{__big5hkscs_nonbmp_encmap+17457,26,226},{__big5hkscs_nonbmp_encmap+
+17658,41,165},{__big5hkscs_nonbmp_encmap+17783,2,221},{
+__big5hkscs_nonbmp_encmap+18003,88,208},{__big5hkscs_nonbmp_encmap+18124,53,
+248},{__big5hkscs_nonbmp_encmap+18320,2,152},{__big5hkscs_nonbmp_encmap+18471,
+18,191},{__big5hkscs_nonbmp_encmap+18645,18,252},{__big5hkscs_nonbmp_encmap+
+18880,22,204},{__big5hkscs_nonbmp_encmap+19063,28,199},{
+__big5hkscs_nonbmp_encmap+19235,14,250},{__big5hkscs_nonbmp_encmap+19472,45,82
+},{__big5hkscs_nonbmp_encmap+19510,5,247},{__big5hkscs_nonbmp_encmap+19753,33,
+209},{__big5hkscs_nonbmp_encmap+19930,34,240},{__big5hkscs_nonbmp_encmap+20137
+,0,215},{__big5hkscs_nonbmp_encmap+20353,38,223},{__big5hkscs_nonbmp_encmap+
+20539,14,248},{__big5hkscs_nonbmp_encmap+20774,9,205},{
+__big5hkscs_nonbmp_encmap+20971,27,230},{__big5hkscs_nonbmp_encmap+21175,82,
+255},{__big5hkscs_nonbmp_encmap+21349,34,134},{__big5hkscs_nonbmp_encmap+21450
+,116,254},{__big5hkscs_nonbmp_encmap+21589,7,148},{__big5hkscs_nonbmp_encmap+
+21731,15,204},{__big5hkscs_nonbmp_encmap+21921,88,200},{
+__big5hkscs_nonbmp_encmap+22034,36,253},{__big5hkscs_nonbmp_encmap+22252,10,
+244},{__big5hkscs_nonbmp_encmap+22487,6,244},{__big5hkscs_nonbmp_encmap+22726,
+18,197},{__big5hkscs_nonbmp_encmap+22906,47,220},{__big5hkscs_nonbmp_encmap+
+23080,77,79},{__big5hkscs_nonbmp_encmap+23083,46,249},{
+__big5hkscs_nonbmp_encmap+23287,2,244},{__big5hkscs_nonbmp_encmap+23530,46,188
+},{__big5hkscs_nonbmp_encmap+23673,7,226},{__big5hkscs_nonbmp_encmap+23893,6,
+138},{__big5hkscs_nonbmp_encmap+24026,18,130},{__big5hkscs_nonbmp_encmap+24139
+,1,244},{__big5hkscs_nonbmp_encmap+24383,0,230},{__big5hkscs_nonbmp_encmap+
+24614,15,19},{__big5hkscs_nonbmp_encmap+24619,4,43},{__big5hkscs_nonbmp_encmap
++24659,51,252},{__big5hkscs_nonbmp_encmap+24861,15,252},{
+__big5hkscs_nonbmp_encmap+25099,12,255},{__big5hkscs_nonbmp_encmap+25343,3,210
+},{__big5hkscs_nonbmp_encmap+25551,52,185},{__big5hkscs_nonbmp_encmap+25685,
+15,231},{__big5hkscs_nonbmp_encmap+25902,197,197},{__big5hkscs_nonbmp_encmap+
+25903,121,237},{__big5hkscs_nonbmp_encmap+26020,13,235},{0,0,0},{0,0,0},{
+__big5hkscs_nonbmp_encmap+26243,29,231},{__big5hkscs_nonbmp_encmap+26446,158,
+244},{0,0,0},{__big5hkscs_nonbmp_encmap+26533,32,212},{
+__big5hkscs_nonbmp_encmap+26714,16,250},{__big5hkscs_nonbmp_encmap+26949,3,201
+},{__big5hkscs_nonbmp_encmap+27148,40,77},{__big5hkscs_nonbmp_encmap+27186,5,
+213},{__big5hkscs_nonbmp_encmap+27395,115,173},{__big5hkscs_nonbmp_encmap+
+27454,62,246},{__big5hkscs_nonbmp_encmap+27639,6,248},{
+__big5hkscs_nonbmp_encmap+27882,35,222},{__big5hkscs_nonbmp_encmap+28070,20,
+254},{__big5hkscs_nonbmp_encmap+28305,7,245},{__big5hkscs_nonbmp_encmap+28544,
+32,255},{__big5hkscs_nonbmp_encmap+28768,81,169},{__big5hkscs_nonbmp_encmap+
+28857,52,91},{__big5hkscs_nonbmp_encmap+28897,198,203},{
+__big5hkscs_nonbmp_encmap+28903,1,169},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__big5hkscs_nonbmp_encmap+29072,37,205},{__big5hkscs_nonbmp_encmap+29241,148,
+212},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
diff --git a/contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h
new file mode 100644
index 00000000000..c96f20142b7
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_jisx0213_pair.h
@@ -0,0 +1,60 @@
+// AUTO-GENERATED FILE FROM genmap_japanese.py: DO NOT EDIT
+#define JISX0213_ENCPAIRS 46
+#ifdef EXTERN_JISX0213_PAIR
+static const struct widedbcs_index *jisx0213_pair_decmap;
+static const struct pair_encodemap *jisx0213_pair_encmap;
+#else
+static const Py_UCS4 __jisx0213_pair_decmap[49] = {
+810234010,810365082,810496154,810627226,810758298,816525466,816656538,
+816787610,816918682,817049754,817574042,818163866,818426010,838283418,
+15074048,U,U,U,39060224,39060225,42730240,42730241,39387904,39387905,39453440,
+39453441,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,48825061,48562921,
+};
+
+static const struct widedbcs_index jisx0213_pair_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_pair_decmap
++0,119,123},{__jisx0213_pair_decmap+5,119,126},{__jisx0213_pair_decmap+13,120,
+120},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_pair_decmap+14,68,102},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const struct pair_encodemap jisx0213_pair_encmap[JISX0213_ENCPAIRS] = {
+{0x00e60000,0x295c},{0x00e60300,0x2b44},{0x02540000,0x2b38},{0x02540300,0x2b48
+},{0x02540301,0x2b49},{0x02590000,0x2b30},{0x02590300,0x2b4c},{0x02590301,
+0x2b4d},{0x025a0000,0x2b43},{0x025a0300,0x2b4e},{0x025a0301,0x2b4f},{
+0x028c0000,0x2b37},{0x028c0300,0x2b4a},{0x028c0301,0x2b4b},{0x02e50000,0x2b60
+},{0x02e502e9,0x2b66},{0x02e90000,0x2b64},{0x02e902e5,0x2b65},{0x304b0000,
+0x242b},{0x304b309a,0x2477},{0x304d0000,0x242d},{0x304d309a,0x2478},{
+0x304f0000,0x242f},{0x304f309a,0x2479},{0x30510000,0x2431},{0x3051309a,0x247a
+},{0x30530000,0x2433},{0x3053309a,0x247b},{0x30ab0000,0x252b},{0x30ab309a,
+0x2577},{0x30ad0000,0x252d},{0x30ad309a,0x2578},{0x30af0000,0x252f},{
+0x30af309a,0x2579},{0x30b10000,0x2531},{0x30b1309a,0x257a},{0x30b30000,0x2533
+},{0x30b3309a,0x257b},{0x30bb0000,0x253b},{0x30bb309a,0x257c},{0x30c40000,
+0x2544},{0x30c4309a,0x257d},{0x30c80000,0x2548},{0x30c8309a,0x257e},{
+0x31f70000,0x2675},{0x31f7309a,0x2678},
+};
+#endif
diff --git a/contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h
new file mode 100644
index 00000000000..409aeae25c9
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_jp.h
@@ -0,0 +1,4766 @@
+// AUTO-GENERATED FILE FROM genmap_japanese.py: DO NOT EDIT
+static const ucs2_t __jisx0208_decmap[6956] = {
+12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180,
+65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294,
+12295,12540,8213,8208,65295,92,12316,8214,65372,8230,8229,8216,8217,8220,8221,
+65288,65289,12308,12309,65339,65341,65371,65373,12296,12297,12298,12299,12300,
+12301,12302,12303,12304,12305,65291,8722,177,215,247,65309,8800,65308,65310,
+8806,8807,8734,8756,9794,9792,176,8242,8243,8451,65509,65284,162,163,65285,
+65283,65286,65290,65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,
+9650,9661,9660,8251,12306,8594,8592,8593,8595,12307,U,U,U,U,U,U,U,U,U,U,U,
+8712,8715,8838,8839,8834,8835,8746,8745,U,U,U,U,U,U,U,U,8743,8744,172,8658,
+8660,8704,8707,U,U,U,U,U,U,U,U,U,U,U,8736,8869,8978,8706,8711,8801,8786,8810,
+8811,8730,8765,8733,8757,8747,8748,U,U,U,U,U,U,U,8491,8240,9839,9837,9834,
+8224,8225,182,U,U,U,U,9711,65296,65297,65298,65299,65300,65301,65302,65303,
+65304,65305,U,U,U,U,U,U,U,65313,65314,65315,65316,65317,65318,65319,65320,
+65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,65333,
+65334,65335,65336,65337,65338,U,U,U,U,U,U,65345,65346,65347,65348,65349,65350,
+65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,
+65364,65365,65366,65367,65368,65369,65370,12353,12354,12355,12356,12357,12358,
+12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,
+12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,
+12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,
+12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,
+12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,
+12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12449,
+12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,
+12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,
+12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,
+12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,
+12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,
+12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,
+12528,12529,12530,12531,12532,12533,12534,913,914,915,916,917,918,919,920,921,
+922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,U,U,U,U,U,U,U,U,
+945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,963,964,
+965,966,967,968,969,1040,1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,
+1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,
+1065,1066,1067,1068,1069,1070,1071,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,1072,1073,
+1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,
+1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,
+1103,9472,9474,9484,9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,
+9491,9499,9495,9507,9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,
+9509,9528,9538,20124,21782,23043,38463,21696,24859,25384,23030,36898,33909,
+33564,31312,24746,25569,28197,26093,33894,33446,39925,26771,22311,26017,25201,
+23451,22992,34427,39156,32098,32190,39822,25110,31903,34999,23433,24245,25353,
+26263,26696,38343,38797,26447,20197,20234,20301,20381,20553,22258,22839,22996,
+23041,23561,24799,24847,24944,26131,26885,28858,30031,30064,31227,32173,32239,
+32963,33806,34915,35586,36949,36986,21307,20117,20133,22495,32946,37057,30959,
+19968,22769,28322,36920,31282,33576,33419,39983,20801,21360,21693,21729,22240,
+23035,24341,39154,28139,32996,34093,38498,38512,38560,38907,21515,21491,23431,
+28879,32701,36802,38632,21359,40284,31418,19985,30867,33276,28198,22040,21764,
+27421,34074,39995,23013,21417,28006,29916,38287,22082,20113,36939,38642,33615,
+39180,21473,21942,23344,24433,26144,26355,26628,27704,27891,27945,29787,30408,
+31310,38964,33521,34907,35424,37613,28082,30123,30410,39365,24742,35585,36234,
+38322,27022,21421,20870,22290,22576,22852,23476,24310,24616,25513,25588,27839,
+28436,28814,28948,29017,29141,29503,32257,33398,33489,34199,36960,37467,40219,
+22633,26044,27738,29989,20985,22830,22885,24448,24540,25276,26106,27178,27431,
+27572,29579,32705,35158,40236,40206,40644,23713,27798,33659,20740,23627,25014,
+33222,26742,29281,20057,20474,21368,24681,28201,31311,38899,19979,21270,20206,
+20309,20285,20385,20339,21152,21487,22025,22799,23233,23478,23521,31185,26247,
+26524,26550,27468,27827,28779,29634,31117,31166,31292,31623,33457,33499,33540,
+33655,33775,33747,34662,35506,22057,36008,36838,36942,38686,34442,20420,23784,
+25105,29273,30011,33253,33469,34558,36032,38597,39187,39381,20171,20250,35299,
+22238,22602,22730,24315,24555,24618,24724,24674,25040,25106,25296,25913,39745,
+26214,26800,28023,28784,30028,30342,32117,33445,34809,38283,38542,35997,20977,
+21182,22806,21683,23475,23830,24936,27010,28079,30861,33995,34903,35442,37799,
+39608,28012,39336,34521,22435,26623,34510,37390,21123,22151,21508,24275,25313,
+25785,26684,26680,27579,29554,30906,31339,35226,35282,36203,36611,37101,38307,
+38548,38761,23398,23731,27005,38989,38990,25499,31520,27179,27263,26806,39949,
+28511,21106,21917,24688,25324,27963,28167,28369,33883,35088,36676,19988,39993,
+21494,26907,27194,38788,26666,20828,31427,33970,37340,37772,22107,40232,26658,
+33541,33841,31909,21000,33477,29926,20094,20355,20896,23506,21002,21208,21223,
+24059,21914,22570,23014,23436,23448,23515,24178,24185,24739,24863,24931,25022,
+25563,25954,26577,26707,26874,27454,27475,27735,28450,28567,28485,29872,29976,
+30435,30475,31487,31649,31777,32233,32566,32752,32925,33382,33694,35251,35532,
+36011,36996,37969,38291,38289,38306,38501,38867,39208,33304,20024,21547,23736,
+24012,29609,30284,30524,23721,32747,36107,38593,38929,38996,39000,20225,20238,
+21361,21916,22120,22522,22855,23305,23492,23696,24076,24190,24524,25582,26426,
+26071,26082,26399,26827,26820,27231,24112,27589,27671,27773,30079,31048,23395,
+31232,32000,24509,35215,35352,36020,36215,36556,36637,39138,39438,39740,20096,
+20605,20736,22931,23452,25135,25216,25836,27450,29344,30097,31047,32681,34811,
+35516,35696,25516,33738,38816,21513,21507,21931,26708,27224,35440,30759,26485,
+40653,21364,23458,33050,34384,36870,19992,20037,20167,20241,21450,21560,23470,
+24339,24613,25937,26429,27714,27762,27875,28792,29699,31350,31406,31496,32026,
+31998,32102,26087,29275,21435,23621,24040,25298,25312,25369,28192,34394,35377,
+36317,37624,28417,31142,39770,20136,20139,20140,20379,20384,20689,20807,31478,
+20849,20982,21332,21281,21375,21483,21932,22659,23777,24375,24394,24623,24656,
+24685,25375,25945,27211,27841,29378,29421,30703,33016,33029,33288,34126,37111,
+37857,38911,39255,39514,20208,20957,23597,26241,26989,23616,26354,26997,29577,
+26704,31873,20677,21220,22343,24062,37670,26020,27427,27453,29748,31105,31165,
+31563,32202,33465,33740,34943,35167,35641,36817,37329,21535,37504,20061,20534,
+21477,21306,29399,29590,30697,33510,36527,39366,39368,39378,20855,24858,34398,
+21936,31354,20598,23507,36935,38533,20018,27355,37351,23633,23624,25496,31391,
+27795,38772,36705,31402,29066,38536,31874,26647,32368,26705,37740,21234,21531,
+34219,35347,32676,36557,37089,21350,34952,31041,20418,20670,21009,20804,21843,
+22317,29674,22411,22865,24418,24452,24693,24950,24935,25001,25522,25658,25964,
+26223,26690,28179,30054,31293,31995,32076,32153,32331,32619,33550,33610,34509,
+35336,35427,35686,36605,38938,40335,33464,36814,39912,21127,25119,25731,28608,
+38553,26689,20625,27424,27770,28500,31348,32080,34880,35363,26376,20214,20537,
+20518,20581,20860,21048,21091,21927,22287,22533,23244,24314,25010,25080,25331,
+25458,26908,27177,29309,29356,29486,30740,30831,32121,30476,32937,35211,35609,
+36066,36562,36963,37749,38522,38997,39443,40568,20803,21407,21427,24187,24358,
+28187,28304,29572,29694,32067,33335,35328,35578,38480,20046,20491,21476,21628,
+22266,22993,23396,24049,24235,24359,25144,25925,26543,28246,29392,31946,34996,
+32929,32993,33776,34382,35463,36328,37431,38599,39015,40723,20116,20114,20237,
+21320,21577,21566,23087,24460,24481,24735,26791,27278,29786,30849,35486,35492,
+35703,37264,20062,39881,20132,20348,20399,20505,20502,20809,20844,21151,21177,
+21246,21402,21475,21521,21518,21897,22353,22434,22909,23380,23389,23439,24037,
+24039,24055,24184,24195,24218,24247,24344,24658,24908,25239,25304,25511,25915,
+26114,26179,26356,26477,26657,26775,27083,27743,27946,28009,28207,28317,30002,
+30343,30828,31295,31968,32005,32024,32094,32177,32789,32771,32943,32945,33108,
+33167,33322,33618,34892,34913,35611,36002,36092,37066,37237,37489,30783,37628,
+38308,38477,38917,39321,39640,40251,21083,21163,21495,21512,22741,25335,28640,
+35946,36703,40633,20811,21051,21578,22269,31296,37239,40288,40658,29508,28425,
+33136,29969,24573,24794,39592,29403,36796,27492,38915,20170,22256,22372,22718,
+23130,24680,25031,26127,26118,26681,26801,28151,30165,32058,33390,39746,20123,
+20304,21449,21766,23919,24038,24046,26619,27801,29811,30722,35408,37782,35039,
+22352,24231,25387,20661,20652,20877,26368,21705,22622,22971,23472,24425,25165,
+25505,26685,27507,28168,28797,37319,29312,30741,30758,31085,25998,32048,33756,
+35009,36617,38555,21092,22312,26448,32618,36001,20916,22338,38442,22586,27018,
+32948,21682,23822,22524,30869,40442,20316,21066,21643,25662,26152,26388,26613,
+31364,31574,32034,37679,26716,39853,31545,21273,20874,21047,23519,25334,25774,
+25830,26413,27578,34217,38609,30352,39894,25420,37638,39851,30399,26194,19977,
+20632,21442,23665,24808,25746,25955,26719,29158,29642,29987,31639,32386,34453,
+35715,36059,37240,39184,26028,26283,27531,20181,20180,20282,20351,21050,21496,
+21490,21987,22235,22763,22987,22985,23039,23376,23629,24066,24107,24535,24605,
+25351,25903,23388,26031,26045,26088,26525,27490,27515,27663,29509,31049,31169,
+31992,32025,32043,32930,33026,33267,35222,35422,35433,35430,35468,35566,36039,
+36060,38604,39164,27503,20107,20284,20365,20816,23383,23546,24904,25345,26178,
+27425,28363,27835,29246,29885,30164,30913,31034,32780,32819,33258,33940,36766,
+27728,40575,24335,35672,40235,31482,36600,23437,38635,19971,21489,22519,22833,
+23241,23460,24713,28287,28422,30142,36074,23455,34048,31712,20594,26612,33437,
+23649,34122,32286,33294,20889,23556,25448,36198,26012,29038,31038,32023,32773,
+35613,36554,36974,34503,37034,20511,21242,23610,26451,28796,29237,37196,37320,
+37675,33509,23490,24369,24825,20027,21462,23432,25163,26417,27530,29417,29664,
+31278,33131,36259,37202,39318,20754,21463,21610,23551,25480,27193,32172,38656,
+22234,21454,21608,23447,23601,24030,20462,24833,25342,27954,31168,31179,32066,
+32333,32722,33261,33311,33936,34886,35186,35728,36468,36655,36913,37195,37228,
+38598,37276,20160,20303,20805,21313,24467,25102,26580,27713,28171,29539,32294,
+37325,37507,21460,22809,23487,28113,31069,32302,31899,22654,29087,20986,34899,
+36848,20426,23803,26149,30636,31459,33308,39423,20934,24490,26092,26991,27529,
+28147,28310,28516,30462,32020,24033,36981,37255,38918,20966,21021,25152,26257,
+26329,28186,24246,32210,32626,26360,34223,34295,35576,21161,21465,22899,24207,
+24464,24661,37604,38500,20663,20767,21213,21280,21319,21484,21736,21830,21809,
+22039,22888,22974,23100,23477,23558,23567,23569,23578,24196,24202,24288,24432,
+25215,25220,25307,25484,25463,26119,26124,26157,26230,26494,26786,27167,27189,
+27836,28040,28169,28248,28988,28966,29031,30151,30465,30813,30977,31077,31216,
+31456,31505,31911,32057,32918,33750,33931,34121,34909,35059,35359,35388,35412,
+35443,35937,36062,37284,37478,37758,37912,38556,38808,19978,19976,19998,20055,
+20887,21104,22478,22580,22732,23330,24120,24773,25854,26465,26454,27972,29366,
+30067,31331,33976,35698,37304,37664,22065,22516,39166,25325,26893,27542,29165,
+32340,32887,33394,35302,39135,34645,36785,23611,20280,20449,20405,21767,23072,
+23517,23529,24515,24910,25391,26032,26187,26862,27035,28024,28145,30003,30137,
+30495,31070,31206,32051,33251,33455,34218,35242,35386,36523,36763,36914,37341,
+38663,20154,20161,20995,22645,22764,23563,29978,23613,33102,35338,36805,38499,
+38765,31525,35535,38920,37218,22259,21416,36887,21561,22402,24101,25512,27700,
+28810,30561,31883,32736,34928,36930,37204,37648,37656,38543,29790,39620,23815,
+23913,25968,26530,36264,38619,25454,26441,26905,33733,38935,38592,35070,28548,
+25722,23544,19990,28716,30045,26159,20932,21046,21218,22995,24449,24615,25104,
+25919,25972,26143,26228,26866,26646,27491,28165,29298,29983,30427,31934,32854,
+22768,35069,35199,35488,35475,35531,36893,37266,38738,38745,25993,31246,33030,
+38587,24109,24796,25114,26021,26132,26512,30707,31309,31821,32318,33034,36012,
+36196,36321,36447,30889,20999,25305,25509,25666,25240,35373,31363,31680,35500,
+38634,32118,33292,34633,20185,20808,21315,21344,23459,23554,23574,24029,25126,
+25159,25776,26643,26676,27849,27973,27927,26579,28508,29006,29053,26059,31359,
+31661,32218,32330,32680,33146,33307,33337,34214,35438,36046,36341,36984,36983,
+37549,37521,38275,39854,21069,21892,28472,28982,20840,31109,32341,33203,31950,
+22092,22609,23720,25514,26366,26365,26970,29401,30095,30094,30990,31062,31199,
+31895,32032,32068,34311,35380,38459,36961,40736,20711,21109,21452,21474,20489,
+21930,22766,22863,29245,23435,23652,21277,24803,24819,25436,25475,25407,25531,
+25805,26089,26361,24035,27085,27133,28437,29157,20105,30185,30456,31379,31967,
+32207,32156,32865,33609,33624,33900,33980,34299,35013,36208,36865,36973,37783,
+38684,39442,20687,22679,24974,33235,34101,36104,36896,20419,20596,21063,21363,
+24687,25417,26463,28204,36275,36895,20439,23646,36042,26063,32154,21330,34966,
+20854,25539,23384,23403,23562,25613,26449,36956,20182,22810,22826,27760,35409,
+21822,22549,22949,24816,25171,26561,33333,26965,38464,39364,39464,20307,22534,
+23550,32784,23729,24111,24453,24608,24907,25140,26367,27888,28382,32974,33151,
+33492,34955,36024,36864,36910,38538,40667,39899,20195,21488,22823,31532,37261,
+38988,40441,28381,28711,21331,21828,23429,25176,25246,25299,27810,28655,29730,
+35351,37944,28609,35582,33592,20967,34552,21482,21481,20294,36948,36784,22890,
+33073,24061,31466,36799,26842,35895,29432,40008,27197,35504,20025,21336,22022,
+22374,25285,25506,26086,27470,28129,28251,28845,30701,31471,31658,32187,32829,
+32966,34507,35477,37723,22243,22727,24382,26029,26262,27264,27573,30007,35527,
+20516,30693,22320,24347,24677,26234,27744,30196,31258,32622,33268,34584,36933,
+39347,31689,30044,31481,31569,33988,36880,31209,31378,33590,23265,30528,20013,
+20210,23449,24544,25277,26172,26609,27880,34411,34935,35387,37198,37619,39376,
+27159,28710,29482,33511,33879,36015,19969,20806,20939,21899,23541,24086,24115,
+24193,24340,24373,24427,24500,25074,25361,26274,26397,28526,29266,30010,30522,
+32884,33081,33144,34678,35519,35548,36229,36339,37530,38263,38914,40165,21189,
+25431,30452,26389,27784,29645,36035,37806,38515,27941,22684,26894,27084,36861,
+37786,30171,36890,22618,26626,25524,27131,20291,28460,26584,36795,34086,32180,
+37716,26943,28528,22378,22775,23340,32044,29226,21514,37347,40372,20141,20302,
+20572,20597,21059,35998,21576,22564,23450,24093,24213,24237,24311,24351,24716,
+25269,25402,25552,26799,27712,30855,31118,31243,32224,33351,35330,35558,36420,
+36883,37048,37165,37336,40718,27877,25688,25826,25973,28404,30340,31515,36969,
+37841,28346,21746,24505,25764,36685,36845,37444,20856,22635,22825,23637,24215,
+28155,32399,29980,36028,36578,39003,28857,20253,27583,28593,30000,38651,20814,
+21520,22581,22615,22956,23648,24466,26007,26460,28193,30331,33759,36077,36884,
+37117,37709,30757,30778,21162,24230,22303,22900,24594,20498,20826,20908,20941,
+20992,21776,22612,22616,22871,23445,23798,23947,24764,25237,25645,26481,26691,
+26812,26847,30423,28120,28271,28059,28783,29128,24403,30168,31095,31561,31572,
+31570,31958,32113,21040,33891,34153,34276,35342,35588,35910,36367,36867,36879,
+37913,38518,38957,39472,38360,20685,21205,21516,22530,23566,24999,25758,27934,
+30643,31461,33012,33796,36947,37509,23776,40199,21311,24471,24499,28060,29305,
+30563,31167,31716,27602,29420,35501,26627,27233,20984,31361,26932,23626,40182,
+33515,23493,37193,28702,22136,23663,24775,25958,27788,35930,36929,38931,21585,
+26311,37389,22856,37027,20869,20045,20970,34201,35598,28760,25466,37707,26978,
+39348,32260,30071,21335,26976,36575,38627,27741,20108,23612,24336,36841,21250,
+36049,32905,34425,24319,26085,20083,20837,22914,23615,38894,20219,22922,24525,
+35469,28641,31152,31074,23527,33905,29483,29105,24180,24565,25467,25754,29123,
+31896,20035,24316,20043,22492,22178,24745,28611,32013,33021,33075,33215,36786,
+35223,34468,24052,25226,25773,35207,26487,27874,27966,29750,30772,23110,32629,
+33453,39340,20467,24259,25309,25490,25943,26479,30403,29260,32972,32954,36649,
+37197,20493,22521,23186,26757,26995,29028,29437,36023,22770,36064,38506,36889,
+34687,31204,30695,33833,20271,21093,21338,25293,26575,27850,30333,31636,31893,
+33334,34180,36843,26333,28448,29190,32283,33707,39361,40614,20989,31665,30834,
+31672,32903,31560,27368,24161,32908,30033,30048,20843,37474,28300,30330,37271,
+39658,20240,32624,25244,31567,38309,40169,22138,22617,34532,38588,20276,21028,
+21322,21453,21467,24070,25644,26001,26495,27710,27726,29256,29359,29677,30036,
+32321,33324,34281,36009,31684,37318,29033,38930,39151,25405,26217,30058,30436,
+30928,34115,34542,21290,21329,21542,22915,24199,24444,24754,25161,25209,25259,
+26000,27604,27852,30130,30382,30865,31192,32203,32631,32933,34987,35513,36027,
+36991,38750,39131,27147,31800,20633,23614,24494,26503,27608,29749,30473,32654,
+40763,26570,31255,21305,30091,39661,24422,33181,33777,32920,24380,24517,30050,
+31558,36924,26727,23019,23195,32016,30334,35628,20469,24426,27161,27703,28418,
+29922,31080,34920,35413,35961,24287,25551,30149,31186,33495,37672,37618,33948,
+34541,39981,21697,24428,25996,27996,28693,36007,36051,38971,25935,29942,19981,
+20184,22496,22827,23142,23500,20904,24067,24220,24598,25206,25975,26023,26222,
+28014,29238,31526,33104,33178,33433,35676,36000,36070,36212,38428,38468,20398,
+25771,27494,33310,33889,34154,37096,23553,26963,39080,33914,34135,20239,21103,
+24489,24133,26381,31119,33145,35079,35206,28149,24343,25173,27832,20175,29289,
+39826,20998,21563,22132,22707,24996,25198,28954,22894,31881,31966,32027,38640,
+25991,32862,19993,20341,20853,22592,24163,24179,24330,26564,20006,34109,38281,
+38491,31859,38913,20731,22721,30294,30887,21029,30629,34065,31622,20559,22793,
+29255,31687,32232,36794,36820,36941,20415,21193,23081,24321,38829,20445,33303,
+37610,22275,25429,27497,29995,35036,36628,31298,21215,22675,24917,25098,26286,
+27597,31807,33769,20515,20472,21253,21574,22577,22857,23453,23792,23791,23849,
+24214,25265,25447,25918,26041,26379,27861,27873,28921,30770,32299,32990,33459,
+33804,34028,34562,35090,35370,35914,37030,37586,39165,40179,40300,20047,20129,
+20621,21078,22346,22952,24125,24536,24537,25151,26292,26395,26576,26834,20882,
+32033,32938,33192,35584,35980,36031,37502,38450,21536,38956,21271,20693,21340,
+22696,25778,26420,29287,30566,31302,37350,21187,27809,27526,22528,24140,22868,
+26412,32763,20961,30406,25705,30952,39764,40635,22475,22969,26151,26522,27598,
+21737,27097,24149,33180,26517,39850,26622,40018,26717,20134,20451,21448,25273,
+26411,27819,36804,20397,32365,40639,19975,24930,28288,28459,34067,21619,26410,
+39749,24051,31637,23724,23494,34588,28234,34001,31252,33032,22937,31885,27665,
+30496,21209,22818,28961,29279,30683,38695,40289,26891,23167,23064,20901,21517,
+21629,26126,30431,36855,37528,40180,23018,29277,28357,20813,26825,32191,32236,
+38754,40634,25720,27169,33538,22916,23391,27611,29467,30450,32178,32791,33945,
+20786,26408,40665,30446,26466,21247,39173,23588,25147,31870,36016,21839,24758,
+32011,38272,21249,20063,20918,22812,29242,32822,37326,24357,30690,21380,24441,
+32004,34220,35379,36493,38742,26611,34222,37971,24841,24840,27833,30290,35565,
+36664,21807,20305,20778,21191,21451,23461,24189,24736,24962,25558,26377,26586,
+28263,28044,29494,29495,30001,31056,35029,35480,36938,37009,37109,38596,34701,
+22805,20104,20313,19982,35465,36671,38928,20653,24188,22934,23481,24248,25562,
+25594,25793,26332,26954,27096,27915,28342,29076,29992,31407,32650,32768,33865,
+33993,35201,35617,36362,36965,38525,39178,24958,25233,27442,27779,28020,32716,
+32764,28096,32645,34746,35064,26469,33713,38972,38647,27931,32097,33853,37226,
+20081,21365,23888,27396,28651,34253,34349,35239,21033,21519,23653,26446,26792,
+29702,29827,30178,35023,35041,37324,38626,38520,24459,29575,31435,33870,25504,
+30053,21129,27969,28316,29705,30041,30827,31890,38534,31452,40845,20406,24942,
+26053,34396,20102,20142,20698,20001,20940,23534,26009,26753,28092,29471,30274,
+30637,31260,31975,33391,35538,36988,37327,38517,38936,21147,32209,20523,21400,
+26519,28107,29136,29747,33256,36650,38563,40023,40607,29792,22593,28057,32047,
+39006,20196,20278,20363,20919,21169,23994,24604,29618,31036,33491,37428,38583,
+38646,38666,40599,40802,26278,27508,21015,21155,28872,35010,24265,24651,24976,
+28451,29001,31806,32244,32879,34030,36899,37676,21570,39791,27347,28809,36034,
+36335,38706,21172,23105,24266,24324,26391,27004,27028,28010,28431,29282,29436,
+31725,32769,32894,34635,37070,20845,40595,31108,32907,37682,35542,20525,21644,
+35441,27498,36036,33031,24785,26528,40434,20121,20120,39952,35435,34241,34152,
+26880,28286,30871,33109,24332,19984,19989,20010,20017,20022,20028,20031,20034,
+20054,20056,20098,20101,35947,20106,33298,24333,20110,20126,20127,20128,20130,
+20144,20147,20150,20174,20173,20164,20166,20162,20183,20190,20205,20191,20215,
+20233,20314,20272,20315,20317,20311,20295,20342,20360,20367,20376,20347,20329,
+20336,20369,20335,20358,20374,20760,20436,20447,20430,20440,20443,20433,20442,
+20432,20452,20453,20506,20520,20500,20522,20517,20485,20252,20470,20513,20521,
+20524,20478,20463,20497,20486,20547,20551,26371,20565,20560,20552,20570,20566,
+20588,20600,20608,20634,20613,20660,20658,20681,20682,20659,20674,20694,20702,
+20709,20717,20707,20718,20729,20725,20745,20737,20738,20758,20757,20756,20762,
+20769,20794,20791,20796,20795,20799,20800,20818,20812,20820,20834,31480,20841,
+20842,20846,20864,20866,22232,20876,20873,20879,20881,20883,20885,20886,20900,
+20902,20898,20905,20906,20907,20915,20913,20914,20912,20917,20925,20933,20937,
+20955,20960,34389,20969,20973,20976,20981,20990,20996,21003,21012,21006,21031,
+21034,21038,21043,21049,21071,21060,21067,21068,21086,21076,21098,21108,21097,
+21107,21119,21117,21133,21140,21138,21105,21128,21137,36776,36775,21164,21165,
+21180,21173,21185,21197,21207,21214,21219,21222,39149,21216,21235,21237,21240,
+21241,21254,21256,30008,21261,21264,21263,21269,21274,21283,21295,21297,21299,
+21304,21312,21318,21317,19991,21321,21325,20950,21342,21353,21358,22808,21371,
+21367,21378,21398,21408,21414,21413,21422,21424,21430,21443,31762,38617,21471,
+26364,29166,21486,21480,21485,21498,21505,21565,21568,21548,21549,21564,21550,
+21558,21545,21533,21582,21647,21621,21646,21599,21617,21623,21616,21650,21627,
+21632,21622,21636,21648,21638,21703,21666,21688,21669,21676,21700,21704,21672,
+21675,21698,21668,21694,21692,21720,21733,21734,21775,21780,21757,21742,21741,
+21754,21730,21817,21824,21859,21836,21806,21852,21829,21846,21847,21816,21811,
+21853,21913,21888,21679,21898,21919,21883,21886,21912,21918,21934,21884,21891,
+21929,21895,21928,21978,21957,21983,21956,21980,21988,21972,22036,22007,22038,
+22014,22013,22043,22009,22094,22096,29151,22068,22070,22066,22072,22123,22116,
+22063,22124,22122,22150,22144,22154,22176,22164,22159,22181,22190,22198,22196,
+22210,22204,22209,22211,22208,22216,22222,22225,22227,22231,22254,22265,22272,
+22271,22276,22281,22280,22283,22285,22291,22296,22294,21959,22300,22310,22327,
+22328,22350,22331,22336,22351,22377,22464,22408,22369,22399,22409,22419,22432,
+22451,22436,22442,22448,22467,22470,22484,22482,22483,22538,22486,22499,22539,
+22553,22557,22642,22561,22626,22603,22640,27584,22610,22589,22649,22661,22713,
+22687,22699,22714,22750,22715,22712,22702,22725,22739,22737,22743,22745,22744,
+22757,22748,22756,22751,22767,22778,22777,22779,22780,22781,22786,22794,22800,
+22811,26790,22821,22828,22829,22834,22840,22846,31442,22869,22864,22862,22874,
+22872,22882,22880,22887,22892,22889,22904,22913,22941,20318,20395,22947,22962,
+22982,23016,23004,22925,23001,23002,23077,23071,23057,23068,23049,23066,23104,
+23148,23113,23093,23094,23138,23146,23194,23228,23230,23243,23234,23229,23267,
+23255,23270,23273,23254,23290,23291,23308,23307,23318,23346,23248,23338,23350,
+23358,23363,23365,23360,23377,23381,23386,23387,23397,23401,23408,23411,23413,
+23416,25992,23418,23424,23427,23462,23480,23491,23495,23497,23508,23504,23524,
+23526,23522,23518,23525,23531,23536,23542,23539,23557,23559,23560,23565,23571,
+23584,23586,23592,23608,23609,23617,23622,23630,23635,23632,23631,23409,23660,
+23662,20066,23670,23673,23692,23697,23700,22939,23723,23739,23734,23740,23735,
+23749,23742,23751,23769,23785,23805,23802,23789,23948,23786,23819,23829,23831,
+23900,23839,23835,23825,23828,23842,23834,23833,23832,23884,23890,23886,23883,
+23916,23923,23926,23943,23940,23938,23970,23965,23980,23982,23997,23952,23991,
+23996,24009,24013,24019,24018,24022,24027,24043,24050,24053,24075,24090,24089,
+24081,24091,24118,24119,24132,24131,24128,24142,24151,24148,24159,24162,24164,
+24135,24181,24182,24186,40636,24191,24224,24257,24258,24264,24272,24271,24278,
+24291,24285,24282,24283,24290,24289,24296,24297,24300,24305,24307,24304,24308,
+24312,24318,24323,24329,24413,24412,24331,24337,24342,24361,24365,24376,24385,
+24392,24396,24398,24367,24401,24406,24407,24409,24417,24429,24435,24439,24451,
+24450,24447,24458,24456,24465,24455,24478,24473,24472,24480,24488,24493,24508,
+24534,24571,24548,24568,24561,24541,24755,24575,24609,24672,24601,24592,24617,
+24590,24625,24603,24597,24619,24614,24591,24634,24666,24641,24682,24695,24671,
+24650,24646,24653,24675,24643,24676,24642,24684,24683,24665,24705,24717,24807,
+24707,24730,24708,24731,24726,24727,24722,24743,24715,24801,24760,24800,24787,
+24756,24560,24765,24774,24757,24792,24909,24853,24838,24822,24823,24832,24820,
+24826,24835,24865,24827,24817,24845,24846,24903,24894,24872,24871,24906,24895,
+24892,24876,24884,24893,24898,24900,24947,24951,24920,24921,24922,24939,24948,
+24943,24933,24945,24927,24925,24915,24949,24985,24982,24967,25004,24980,24986,
+24970,24977,25003,25006,25036,25034,25033,25079,25032,25027,25030,25018,25035,
+32633,25037,25062,25059,25078,25082,25076,25087,25085,25084,25086,25088,25096,
+25097,25101,25100,25108,25115,25118,25121,25130,25134,25136,25138,25139,25153,
+25166,25182,25187,25179,25184,25192,25212,25218,25225,25214,25234,25235,25238,
+25300,25219,25236,25303,25297,25275,25295,25343,25286,25812,25288,25308,25292,
+25290,25282,25287,25243,25289,25356,25326,25329,25383,25346,25352,25327,25333,
+25424,25406,25421,25628,25423,25494,25486,25472,25515,25462,25507,25487,25481,
+25503,25525,25451,25449,25534,25577,25536,25542,25571,25545,25554,25590,25540,
+25622,25652,25606,25619,25638,25654,25885,25623,25640,25615,25703,25711,25718,
+25678,25898,25749,25747,25765,25769,25736,25788,25818,25810,25797,25799,25787,
+25816,25794,25841,25831,33289,25824,25825,25260,25827,25839,25900,25846,25844,
+25842,25850,25856,25853,25880,25884,25861,25892,25891,25899,25908,25909,25911,
+25910,25912,30027,25928,25942,25941,25933,25944,25950,25949,25970,25976,25986,
+25987,35722,26011,26015,26027,26039,26051,26054,26049,26052,26060,26066,26075,
+26073,26080,26081,26097,26482,26122,26115,26107,26483,26165,26166,26164,26140,
+26191,26180,26185,26177,26206,26205,26212,26215,26216,26207,26210,26224,26243,
+26248,26254,26249,26244,26264,26269,26305,26297,26313,26302,26300,26308,26296,
+26326,26330,26336,26175,26342,26345,26352,26357,26359,26383,26390,26398,26406,
+26407,38712,26414,26431,26422,26433,26424,26423,26438,26462,26464,26457,26467,
+26468,26505,26480,26537,26492,26474,26508,26507,26534,26529,26501,26551,26607,
+26548,26604,26547,26601,26552,26596,26590,26589,26594,26606,26553,26574,26566,
+26599,27292,26654,26694,26665,26688,26701,26674,26702,26803,26667,26713,26723,
+26743,26751,26783,26767,26797,26772,26781,26779,26755,27310,26809,26740,26805,
+26784,26810,26895,26765,26750,26881,26826,26888,26840,26914,26918,26849,26892,
+26829,26836,26855,26837,26934,26898,26884,26839,26851,26917,26873,26848,26863,
+26920,26922,26906,26915,26913,26822,27001,26999,26972,27000,26987,26964,27006,
+26990,26937,26996,26941,26969,26928,26977,26974,26973,27009,26986,27058,27054,
+27088,27071,27073,27091,27070,27086,23528,27082,27101,27067,27075,27047,27182,
+27025,27040,27036,27029,27060,27102,27112,27138,27163,27135,27402,27129,27122,
+27111,27141,27057,27166,27117,27156,27115,27146,27154,27329,27171,27155,27204,
+27148,27250,27190,27256,27207,27234,27225,27238,27208,27192,27170,27280,27277,
+27296,27268,27298,27299,27287,34327,27323,27331,27330,27320,27315,27308,27358,
+27345,27359,27306,27354,27370,27387,27397,34326,27386,27410,27414,39729,27423,
+27448,27447,30428,27449,39150,27463,27459,27465,27472,27481,27476,27483,27487,
+27489,27512,27513,27519,27520,27524,27523,27533,27544,27541,27550,27556,27562,
+27563,27567,27570,27569,27571,27575,27580,27590,27595,27603,27615,27628,27627,
+27635,27631,40638,27656,27667,27668,27675,27684,27683,27742,27733,27746,27754,
+27778,27789,27802,27777,27803,27774,27752,27763,27794,27792,27844,27889,27859,
+27837,27863,27845,27869,27822,27825,27838,27834,27867,27887,27865,27882,27935,
+34893,27958,27947,27965,27960,27929,27957,27955,27922,27916,28003,28051,28004,
+27994,28025,27993,28046,28053,28644,28037,28153,28181,28170,28085,28103,28134,
+28088,28102,28140,28126,28108,28136,28114,28101,28154,28121,28132,28117,28138,
+28142,28205,28270,28206,28185,28274,28255,28222,28195,28267,28203,28278,28237,
+28191,28227,28218,28238,28196,28415,28189,28216,28290,28330,28312,28361,28343,
+28371,28349,28335,28356,28338,28372,28373,28303,28325,28354,28319,28481,28433,
+28748,28396,28408,28414,28479,28402,28465,28399,28466,28364,28478,28435,28407,
+28550,28538,28536,28545,28544,28527,28507,28659,28525,28546,28540,28504,28558,
+28561,28610,28518,28595,28579,28577,28580,28601,28614,28586,28639,28629,28652,
+28628,28632,28657,28654,28635,28681,28683,28666,28689,28673,28687,28670,28699,
+28698,28532,28701,28696,28703,28720,28734,28722,28753,28771,28825,28818,28847,
+28913,28844,28856,28851,28846,28895,28875,28893,28889,28937,28925,28956,28953,
+29029,29013,29064,29030,29026,29004,29014,29036,29071,29179,29060,29077,29096,
+29100,29143,29113,29118,29138,29129,29140,29134,29152,29164,29159,29173,29180,
+29177,29183,29197,29200,29211,29224,29229,29228,29232,29234,29243,29244,29247,
+29248,29254,29259,29272,29300,29310,29314,29313,29319,29330,29334,29346,29351,
+29369,29362,29379,29382,29380,29390,29394,29410,29408,29409,29433,29431,20495,
+29463,29450,29468,29462,29469,29492,29487,29481,29477,29502,29518,29519,40664,
+29527,29546,29544,29552,29560,29557,29563,29562,29640,29619,29646,29627,29632,
+29669,29678,29662,29858,29701,29807,29733,29688,29746,29754,29781,29759,29791,
+29785,29761,29788,29801,29808,29795,29802,29814,29822,29835,29854,29863,29898,
+29903,29908,29681,29920,29923,29927,29929,29934,29938,29936,29937,29944,29943,
+29956,29955,29957,29964,29966,29965,29973,29971,29982,29990,29996,30012,30020,
+30029,30026,30025,30043,30022,30042,30057,30052,30055,30059,30061,30072,30070,
+30086,30087,30068,30090,30089,30082,30100,30106,30109,30117,30115,30146,30131,
+30147,30133,30141,30136,30140,30129,30157,30154,30162,30169,30179,30174,30206,
+30207,30204,30209,30192,30202,30194,30195,30219,30221,30217,30239,30247,30240,
+30241,30242,30244,30260,30256,30267,30279,30280,30278,30300,30296,30305,30306,
+30312,30313,30314,30311,30316,30320,30322,30326,30328,30332,30336,30339,30344,
+30347,30350,30358,30355,30361,30362,30384,30388,30392,30393,30394,30402,30413,
+30422,30418,30430,30433,30437,30439,30442,34351,30459,30472,30471,30468,30505,
+30500,30494,30501,30502,30491,30519,30520,30535,30554,30568,30571,30555,30565,
+30591,30590,30585,30606,30603,30609,30624,30622,30640,30646,30649,30655,30652,
+30653,30651,30663,30669,30679,30682,30684,30691,30702,30716,30732,30738,31014,
+30752,31018,30789,30862,30836,30854,30844,30874,30860,30883,30901,30890,30895,
+30929,30918,30923,30932,30910,30908,30917,30922,30956,30951,30938,30973,30964,
+30983,30994,30993,31001,31020,31019,31040,31072,31063,31071,31066,31061,31059,
+31098,31103,31114,31133,31143,40779,31146,31150,31155,31161,31162,31177,31189,
+31207,31212,31201,31203,31240,31245,31256,31257,31264,31263,31104,31281,31291,
+31294,31287,31299,31319,31305,31329,31330,31337,40861,31344,31353,31357,31368,
+31383,31381,31384,31382,31401,31432,31408,31414,31429,31428,31423,36995,31431,
+31434,31437,31439,31445,31443,31449,31450,31453,31457,31458,31462,31469,31472,
+31490,31503,31498,31494,31539,31512,31513,31518,31541,31528,31542,31568,31610,
+31492,31565,31499,31564,31557,31605,31589,31604,31591,31600,31601,31596,31598,
+31645,31640,31647,31629,31644,31642,31627,31634,31631,31581,31641,31691,31681,
+31692,31695,31668,31686,31709,31721,31761,31764,31718,31717,31840,31744,31751,
+31763,31731,31735,31767,31757,31734,31779,31783,31786,31775,31799,31787,31805,
+31820,31811,31828,31823,31808,31824,31832,31839,31844,31830,31845,31852,31861,
+31875,31888,31908,31917,31906,31915,31905,31912,31923,31922,31921,31918,31929,
+31933,31936,31941,31938,31960,31954,31964,31970,39739,31983,31986,31988,31990,
+31994,32006,32002,32028,32021,32010,32069,32075,32046,32050,32063,32053,32070,
+32115,32086,32078,32114,32104,32110,32079,32099,32147,32137,32091,32143,32125,
+32155,32186,32174,32163,32181,32199,32189,32171,32317,32162,32175,32220,32184,
+32159,32176,32216,32221,32228,32222,32251,32242,32225,32261,32266,32291,32289,
+32274,32305,32287,32265,32267,32290,32326,32358,32315,32309,32313,32323,32311,
+32306,32314,32359,32349,32342,32350,32345,32346,32377,32362,32361,32380,32379,
+32387,32213,32381,36782,32383,32392,32393,32396,32402,32400,32403,32404,32406,
+32398,32411,32412,32568,32570,32581,32588,32589,32590,32592,32593,32597,32596,
+32600,32607,32608,32616,32617,32615,32632,32642,32646,32643,32648,32647,32652,
+32660,32670,32669,32666,32675,32687,32690,32697,32686,32694,32696,35697,32709,
+32710,32714,32725,32724,32737,32742,32745,32755,32761,39132,32774,32772,32779,
+32786,32792,32793,32796,32801,32808,32831,32827,32842,32838,32850,32856,32858,
+32863,32866,32872,32883,32882,32880,32886,32889,32893,32895,32900,32902,32901,
+32923,32915,32922,32941,20880,32940,32987,32997,32985,32989,32964,32986,32982,
+33033,33007,33009,33051,33065,33059,33071,33099,38539,33094,33086,33107,33105,
+33020,33137,33134,33125,33126,33140,33155,33160,33162,33152,33154,33184,33173,
+33188,33187,33119,33171,33193,33200,33205,33214,33208,33213,33216,33218,33210,
+33225,33229,33233,33241,33240,33224,33242,33247,33248,33255,33274,33275,33278,
+33281,33282,33285,33287,33290,33293,33296,33302,33321,33323,33336,33331,33344,
+33369,33368,33373,33370,33375,33380,33378,33384,33386,33387,33326,33393,33399,
+33400,33406,33421,33426,33451,33439,33467,33452,33505,33507,33503,33490,33524,
+33523,33530,33683,33539,33531,33529,33502,33542,33500,33545,33497,33589,33588,
+33558,33586,33585,33600,33593,33616,33605,33583,33579,33559,33560,33669,33690,
+33706,33695,33698,33686,33571,33678,33671,33674,33660,33717,33651,33653,33696,
+33673,33704,33780,33811,33771,33742,33789,33795,33752,33803,33729,33783,33799,
+33760,33778,33805,33826,33824,33725,33848,34054,33787,33901,33834,33852,34138,
+33924,33911,33899,33965,33902,33922,33897,33862,33836,33903,33913,33845,33994,
+33890,33977,33983,33951,34009,33997,33979,34010,34000,33985,33990,34006,33953,
+34081,34047,34036,34071,34072,34092,34079,34069,34068,34044,34112,34147,34136,
+34120,34113,34306,34123,34133,34176,34212,34184,34193,34186,34216,34157,34196,
+34203,34282,34183,34204,34167,34174,34192,34249,34234,34255,34233,34256,34261,
+34269,34277,34268,34297,34314,34323,34315,34302,34298,34310,34338,34330,34352,
+34367,34381,20053,34388,34399,34407,34417,34451,34467,34473,34474,34443,34444,
+34486,34479,34500,34502,34480,34505,34851,34475,34516,34526,34537,34540,34527,
+34523,34543,34578,34566,34568,34560,34563,34555,34577,34569,34573,34553,34570,
+34612,34623,34615,34619,34597,34601,34586,34656,34655,34680,34636,34638,34676,
+34647,34664,34670,34649,34643,34659,34666,34821,34722,34719,34690,34735,34763,
+34749,34752,34768,38614,34731,34756,34739,34759,34758,34747,34799,34802,34784,
+34831,34829,34814,34806,34807,34830,34770,34833,34838,34837,34850,34849,34865,
+34870,34873,34855,34875,34884,34882,34898,34905,34910,34914,34923,34945,34942,
+34974,34933,34941,34997,34930,34946,34967,34962,34990,34969,34978,34957,34980,
+34992,35007,34993,35011,35012,35028,35032,35033,35037,35065,35074,35068,35060,
+35048,35058,35076,35084,35082,35091,35139,35102,35109,35114,35115,35137,35140,
+35131,35126,35128,35148,35101,35168,35166,35174,35172,35181,35178,35183,35188,
+35191,35198,35203,35208,35210,35219,35224,35233,35241,35238,35244,35247,35250,
+35258,35261,35263,35264,35290,35292,35293,35303,35316,35320,35331,35350,35344,
+35340,35355,35357,35365,35382,35393,35419,35410,35398,35400,35452,35437,35436,
+35426,35461,35458,35460,35496,35489,35473,35493,35494,35482,35491,35524,35533,
+35522,35546,35563,35571,35559,35556,35569,35604,35552,35554,35575,35550,35547,
+35596,35591,35610,35553,35606,35600,35607,35616,35635,38827,35622,35627,35646,
+35624,35649,35660,35663,35662,35657,35670,35675,35674,35691,35679,35692,35695,
+35700,35709,35712,35724,35726,35730,35731,35734,35737,35738,35898,35905,35903,
+35912,35916,35918,35920,35925,35938,35948,35960,35962,35970,35977,35973,35978,
+35981,35982,35988,35964,35992,25117,36013,36010,36029,36018,36019,36014,36022,
+36040,36033,36068,36067,36058,36093,36090,36091,36100,36101,36106,36103,36111,
+36109,36112,40782,36115,36045,36116,36118,36199,36205,36209,36211,36225,36249,
+36290,36286,36282,36303,36314,36310,36300,36315,36299,36330,36331,36319,36323,
+36348,36360,36361,36351,36381,36382,36368,36383,36418,36405,36400,36404,36426,
+36423,36425,36428,36432,36424,36441,36452,36448,36394,36451,36437,36470,36466,
+36476,36481,36487,36485,36484,36491,36490,36499,36497,36500,36505,36522,36513,
+36524,36528,36550,36529,36542,36549,36552,36555,36571,36579,36604,36603,36587,
+36606,36618,36613,36629,36626,36633,36627,36636,36639,36635,36620,36646,36659,
+36667,36665,36677,36674,36670,36684,36681,36678,36686,36695,36700,36706,36707,
+36708,36764,36767,36771,36781,36783,36791,36826,36837,36834,36842,36847,36999,
+36852,36869,36857,36858,36881,36885,36897,36877,36894,36886,36875,36903,36918,
+36917,36921,36856,36943,36944,36945,36946,36878,36937,36926,36950,36952,36958,
+36968,36975,36982,38568,36978,36994,36989,36993,36992,37002,37001,37007,37032,
+37039,37041,37045,37090,37092,25160,37083,37122,37138,37145,37170,37168,37194,
+37206,37208,37219,37221,37225,37235,37234,37259,37257,37250,37282,37291,37295,
+37290,37301,37300,37306,37312,37313,37321,37323,37328,37334,37343,37345,37339,
+37372,37365,37366,37406,37375,37396,37420,37397,37393,37470,37463,37445,37449,
+37476,37448,37525,37439,37451,37456,37532,37526,37523,37531,37466,37583,37561,
+37559,37609,37647,37626,37700,37678,37657,37666,37658,37667,37690,37685,37691,
+37724,37728,37756,37742,37718,37808,37804,37805,37780,37817,37846,37847,37864,
+37861,37848,37827,37853,37840,37832,37860,37914,37908,37907,37891,37895,37904,
+37942,37931,37941,37921,37946,37953,37970,37956,37979,37984,37986,37982,37994,
+37417,38000,38005,38007,38013,37978,38012,38014,38017,38015,38274,38279,38282,
+38292,38294,38296,38297,38304,38312,38311,38317,38332,38331,38329,38334,38346,
+28662,38339,38349,38348,38357,38356,38358,38364,38369,38373,38370,38433,38440,
+38446,38447,38466,38476,38479,38475,38519,38492,38494,38493,38495,38502,38514,
+38508,38541,38552,38549,38551,38570,38567,38577,38578,38576,38580,38582,38584,
+38585,38606,38603,38601,38605,35149,38620,38669,38613,38649,38660,38662,38664,
+38675,38670,38673,38671,38678,38681,38692,38698,38704,38713,38717,38718,38724,
+38726,38728,38722,38729,38748,38752,38756,38758,38760,21202,38763,38769,38777,
+38789,38780,38785,38778,38790,38795,38799,38800,38812,38824,38822,38819,38835,
+38836,38851,38854,38856,38859,38876,38893,40783,38898,31455,38902,38901,38927,
+38924,38968,38948,38945,38967,38973,38982,38991,38987,39019,39023,39024,39025,
+39028,39027,39082,39087,39089,39094,39108,39107,39110,39145,39147,39171,39177,
+39186,39188,39192,39201,39197,39198,39204,39200,39212,39214,39229,39230,39234,
+39241,39237,39248,39243,39249,39250,39244,39253,39319,39320,39333,39341,39342,
+39356,39391,39387,39389,39384,39377,39405,39406,39409,39410,39419,39416,39425,
+39439,39429,39394,39449,39467,39479,39493,39490,39488,39491,39486,39509,39501,
+39515,39511,39519,39522,39525,39524,39529,39531,39530,39597,39600,39612,39616,
+39631,39633,39635,39636,39646,39647,39650,39651,39654,39663,39659,39662,39668,
+39665,39671,39675,39686,39704,39706,39711,39714,39715,39717,39719,39720,39721,
+39722,39726,39727,39730,39748,39747,39759,39757,39758,39761,39768,39796,39827,
+39811,39825,39830,39831,39839,39840,39848,39860,39872,39882,39865,39878,39887,
+39889,39890,39907,39906,39908,39892,39905,39994,39922,39921,39920,39957,39956,
+39945,39955,39948,39942,39944,39954,39946,39940,39982,39963,39973,39972,39969,
+39984,40007,39986,40006,39998,40026,40032,40039,40054,40056,40167,40172,40176,
+40201,40200,40171,40195,40198,40234,40230,40367,40227,40223,40260,40213,40210,
+40257,40255,40254,40262,40264,40285,40286,40292,40273,40272,40281,40306,40329,
+40327,40363,40303,40314,40346,40356,40361,40370,40388,40385,40379,40376,40378,
+40390,40399,40386,40409,40403,40440,40422,40429,40431,40445,40474,40475,40478,
+40565,40569,40573,40577,40584,40587,40588,40594,40597,40593,40605,40613,40617,
+40632,40618,40621,38753,40652,40654,40655,40656,40660,40668,40670,40669,40672,
+40677,40680,40687,40692,40694,40695,40697,40699,40700,40701,40711,40712,30391,
+40725,40737,40748,40766,40778,40786,40788,40803,40799,40800,40801,40806,40807,
+40812,40810,40823,40818,40822,40853,40860,40864,22575,27079,36953,29796,20956,
+29081,
+};
+
+static const struct dbcs_index jisx0208_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0208_decmap+0,33,126},{__jisx0208_decmap
++94,33,126},{__jisx0208_decmap+188,48,122},{__jisx0208_decmap+263,33,115},{
+__jisx0208_decmap+346,33,118},{__jisx0208_decmap+432,33,88},{__jisx0208_decmap
++488,33,113},{__jisx0208_decmap+569,33,64},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{__jisx0208_decmap+601,33,126},{__jisx0208_decmap+695,33,
+126},{__jisx0208_decmap+789,33,126},{__jisx0208_decmap+883,33,126},{
+__jisx0208_decmap+977,33,126},{__jisx0208_decmap+1071,33,126},{
+__jisx0208_decmap+1165,33,126},{__jisx0208_decmap+1259,33,126},{
+__jisx0208_decmap+1353,33,126},{__jisx0208_decmap+1447,33,126},{
+__jisx0208_decmap+1541,33,126},{__jisx0208_decmap+1635,33,126},{
+__jisx0208_decmap+1729,33,126},{__jisx0208_decmap+1823,33,126},{
+__jisx0208_decmap+1917,33,126},{__jisx0208_decmap+2011,33,126},{
+__jisx0208_decmap+2105,33,126},{__jisx0208_decmap+2199,33,126},{
+__jisx0208_decmap+2293,33,126},{__jisx0208_decmap+2387,33,126},{
+__jisx0208_decmap+2481,33,126},{__jisx0208_decmap+2575,33,126},{
+__jisx0208_decmap+2669,33,126},{__jisx0208_decmap+2763,33,126},{
+__jisx0208_decmap+2857,33,126},{__jisx0208_decmap+2951,33,126},{
+__jisx0208_decmap+3045,33,126},{__jisx0208_decmap+3139,33,126},{
+__jisx0208_decmap+3233,33,126},{__jisx0208_decmap+3327,33,126},{
+__jisx0208_decmap+3421,33,126},{__jisx0208_decmap+3515,33,83},{
+__jisx0208_decmap+3566,33,126},{__jisx0208_decmap+3660,33,126},{
+__jisx0208_decmap+3754,33,126},{__jisx0208_decmap+3848,33,126},{
+__jisx0208_decmap+3942,33,126},{__jisx0208_decmap+4036,33,126},{
+__jisx0208_decmap+4130,33,126},{__jisx0208_decmap+4224,33,126},{
+__jisx0208_decmap+4318,33,126},{__jisx0208_decmap+4412,33,126},{
+__jisx0208_decmap+4506,33,126},{__jisx0208_decmap+4600,33,126},{
+__jisx0208_decmap+4694,33,126},{__jisx0208_decmap+4788,33,126},{
+__jisx0208_decmap+4882,33,126},{__jisx0208_decmap+4976,33,126},{
+__jisx0208_decmap+5070,33,126},{__jisx0208_decmap+5164,33,126},{
+__jisx0208_decmap+5258,33,126},{__jisx0208_decmap+5352,33,126},{
+__jisx0208_decmap+5446,33,126},{__jisx0208_decmap+5540,33,126},{
+__jisx0208_decmap+5634,33,126},{__jisx0208_decmap+5728,33,126},{
+__jisx0208_decmap+5822,33,126},{__jisx0208_decmap+5916,33,126},{
+__jisx0208_decmap+6010,33,126},{__jisx0208_decmap+6104,33,126},{
+__jisx0208_decmap+6198,33,126},{__jisx0208_decmap+6292,33,126},{
+__jisx0208_decmap+6386,33,126},{__jisx0208_decmap+6480,33,126},{
+__jisx0208_decmap+6574,33,126},{__jisx0208_decmap+6668,33,126},{
+__jisx0208_decmap+6762,33,126},{__jisx0208_decmap+6856,33,126},{
+__jisx0208_decmap+6950,33,38},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const ucs2_t __jisx0212_decmap[6179] = {
+728,711,184,729,733,175,731,730,126,900,901,U,U,U,U,U,U,U,U,161,166,191,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,186,170,
+169,174,8482,164,8470,902,904,905,906,938,U,908,U,910,939,U,911,U,U,U,U,940,
+941,942,943,970,912,972,962,973,971,944,974,1026,1027,1028,1029,1030,1031,
+1032,1033,1034,1035,1036,1038,1039,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,
+1116,1118,1119,198,272,U,294,U,306,U,321,319,U,330,216,338,U,358,222,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,230,273,240,295,305,307,312,322,320,329,331,248,339,
+223,359,254,193,192,196,194,258,461,256,260,197,195,262,264,268,199,266,270,
+201,200,203,202,282,278,274,280,U,284,286,290,288,292,205,204,207,206,463,304,
+298,302,296,308,310,313,317,315,323,327,325,209,211,210,214,212,465,336,332,
+213,340,344,342,346,348,352,350,356,354,218,217,220,219,364,467,368,362,370,
+366,360,471,475,473,469,372,221,376,374,377,381,379,225,224,228,226,259,462,
+257,261,229,227,263,265,269,231,267,271,233,232,235,234,283,279,275,281,501,
+285,287,U,289,293,237,236,239,238,464,U,299,303,297,309,311,314,318,316,324,
+328,326,241,243,242,246,244,466,337,333,245,341,345,343,347,349,353,351,357,
+355,250,249,252,251,365,468,369,363,371,367,361,472,476,474,470,373,253,255,
+375,378,382,380,19970,19972,19973,19980,19986,19999,20003,20004,20008,20011,
+20014,20015,20016,20021,20032,20033,20036,20039,20049,20058,20060,20067,20072,
+20073,20084,20085,20089,20095,20109,20118,20119,20125,20143,20153,20163,20176,
+20186,20187,20192,20193,20194,20200,20207,20209,20211,20213,20221,20222,20223,
+20224,20226,20227,20232,20235,20236,20242,20245,20246,20247,20249,20270,20273,
+20320,20275,20277,20279,20281,20283,20286,20288,20290,20296,20297,20299,20300,
+20306,20308,20310,20312,20319,20323,20330,20332,20334,20337,20343,20344,20345,
+20346,20349,20350,20353,20354,20356,20357,20361,20362,20364,20366,20368,20370,
+20371,20372,20375,20377,20378,20382,20383,20402,20407,20409,20411,20412,20413,
+20414,20416,20417,20421,20422,20424,20425,20427,20428,20429,20431,20434,20444,
+20448,20450,20464,20466,20476,20477,20479,20480,20481,20484,20487,20490,20492,
+20494,20496,20499,20503,20504,20507,20508,20509,20510,20514,20519,20526,20528,
+20530,20531,20533,20544,20545,20546,20549,20550,20554,20556,20558,20561,20562,
+20563,20567,20569,20575,20576,20578,20579,20582,20583,20586,20589,20592,20593,
+20539,20609,20611,20612,20614,20618,20622,20623,20624,20626,20627,20628,20630,
+20635,20636,20638,20639,20640,20641,20642,20650,20655,20656,20665,20666,20669,
+20672,20675,20676,20679,20684,20686,20688,20691,20692,20696,20700,20701,20703,
+20706,20708,20710,20712,20713,20719,20721,20726,20730,20734,20739,20742,20743,
+20744,20747,20748,20749,20750,20722,20752,20759,20761,20763,20764,20765,20766,
+20771,20775,20776,20780,20781,20783,20785,20787,20788,20789,20792,20793,20802,
+20810,20815,20819,20821,20823,20824,20831,20836,20838,20862,20867,20868,20875,
+20878,20888,20893,20897,20899,20909,20920,20922,20924,20926,20927,20930,20936,
+20943,20945,20946,20947,20949,20952,20958,20962,20965,20974,20978,20979,20980,
+20983,20993,20994,20997,21010,21011,21013,21014,21016,21026,21032,21041,21042,
+21045,21052,21061,21065,21077,21079,21080,21082,21084,21087,21088,21089,21094,
+21102,21111,21112,21113,21120,21122,21125,21130,21132,21139,21141,21142,21143,
+21144,21146,21148,21156,21157,21158,21159,21167,21168,21174,21175,21176,21178,
+21179,21181,21184,21188,21190,21192,21196,21199,21201,21204,21206,21211,21212,
+21217,21221,21224,21225,21226,21228,21232,21233,21236,21238,21239,21248,21251,
+21258,21259,21260,21265,21267,21272,21275,21276,21278,21279,21285,21287,21288,
+21289,21291,21292,21293,21296,21298,21301,21308,21309,21310,21314,21324,21323,
+21337,21339,21345,21347,21349,21356,21357,21362,21369,21374,21379,21383,21384,
+21390,21395,21396,21401,21405,21409,21412,21418,21419,21423,21426,21428,21429,
+21431,21432,21434,21437,21440,21445,21455,21458,21459,21461,21466,21469,21470,
+21472,21478,21479,21493,21506,21523,21530,21537,21543,21544,21546,21551,21553,
+21556,21557,21571,21572,21575,21581,21583,21598,21602,21604,21606,21607,21609,
+21611,21613,21614,21620,21631,21633,21635,21637,21640,21641,21645,21649,21653,
+21654,21660,21663,21665,21670,21671,21673,21674,21677,21678,21681,21687,21689,
+21690,21691,21695,21702,21706,21709,21710,21728,21738,21740,21743,21750,21756,
+21758,21759,21760,21761,21765,21768,21769,21772,21773,21774,21781,21802,21803,
+21810,21813,21814,21819,21820,21821,21825,21831,21833,21834,21837,21840,21841,
+21848,21850,21851,21854,21856,21857,21860,21862,21887,21889,21890,21894,21896,
+21902,21903,21905,21906,21907,21908,21911,21923,21924,21933,21938,21951,21953,
+21955,21958,21961,21963,21964,21966,21969,21970,21971,21975,21976,21979,21982,
+21986,21993,22006,22015,22021,22024,22026,22029,22030,22031,22032,22033,22034,
+22041,22060,22064,22067,22069,22071,22073,22075,22076,22077,22079,22080,22081,
+22083,22084,22086,22089,22091,22093,22095,22100,22110,22112,22113,22114,22115,
+22118,22121,22125,22127,22129,22130,22133,22148,22149,22152,22155,22156,22165,
+22169,22170,22173,22174,22175,22182,22183,22184,22185,22187,22188,22189,22193,
+22195,22199,22206,22213,22217,22218,22219,22223,22224,22220,22221,22233,22236,
+22237,22239,22241,22244,22245,22246,22247,22248,22257,22251,22253,22262,22263,
+22273,22274,22279,22282,22284,22289,22293,22298,22299,22301,22304,22306,22307,
+22308,22309,22313,22314,22316,22318,22319,22323,22324,22333,22334,22335,22341,
+22342,22348,22349,22354,22370,22373,22375,22376,22379,22381,22382,22383,22384,
+22385,22387,22388,22389,22391,22393,22394,22395,22396,22398,22401,22403,22412,
+22420,22423,22425,22426,22428,22429,22430,22431,22433,22421,22439,22440,22441,
+22444,22456,22461,22471,22472,22476,22479,22485,22493,22494,22500,22502,22503,
+22505,22509,22512,22517,22518,22520,22525,22526,22527,22531,22532,22536,22537,
+22497,22540,22541,22555,22558,22559,22560,22566,22567,22573,22578,22585,22591,
+22601,22604,22605,22607,22608,22613,22623,22625,22628,22631,22632,22648,22652,
+22655,22656,22657,22663,22664,22665,22666,22668,22669,22671,22672,22676,22678,
+22685,22688,22689,22690,22694,22697,22705,22706,22724,22716,22722,22728,22733,
+22734,22736,22738,22740,22742,22746,22749,22753,22754,22761,22771,22789,22790,
+22795,22796,22802,22803,22804,34369,22813,22817,22819,22820,22824,22831,22832,
+22835,22837,22838,22847,22851,22854,22866,22867,22873,22875,22877,22878,22879,
+22881,22883,22891,22893,22895,22898,22901,22902,22905,22907,22908,22923,22924,
+22926,22930,22933,22935,22943,22948,22951,22957,22958,22959,22960,22963,22967,
+22970,22972,22977,22979,22980,22984,22986,22989,22994,23005,23006,23007,23011,
+23012,23015,23022,23023,23025,23026,23028,23031,23040,23044,23052,23053,23054,
+23058,23059,23070,23075,23076,23079,23080,23082,23085,23088,23108,23109,23111,
+23112,23116,23120,23125,23134,23139,23141,23143,23149,23159,23162,23163,23166,
+23179,23184,23187,23190,23193,23196,23198,23199,23200,23202,23207,23212,23217,
+23218,23219,23221,23224,23226,23227,23231,23236,23238,23240,23247,23258,23260,
+23264,23269,23274,23278,23285,23286,23293,23296,23297,23304,23319,23348,23321,
+23323,23325,23329,23333,23341,23352,23361,23371,23372,23378,23382,23390,23400,
+23406,23407,23420,23421,23422,23423,23425,23428,23430,23434,23438,23440,23441,
+23443,23444,23446,23464,23465,23468,23469,23471,23473,23474,23479,23482,23484,
+23488,23489,23501,23503,23510,23511,23512,23513,23514,23520,23535,23537,23540,
+23549,23564,23575,23582,23583,23587,23590,23593,23595,23596,23598,23600,23602,
+23605,23606,23641,23642,23644,23650,23651,23655,23656,23657,23661,23664,23668,
+23669,23674,23675,23676,23677,23687,23688,23690,23695,23698,23709,23711,23712,
+23714,23715,23718,23722,23730,23732,23733,23738,23753,23755,23762,23773,23767,
+23790,23793,23794,23796,23809,23814,23821,23826,23851,23843,23844,23846,23847,
+23857,23860,23865,23869,23871,23874,23875,23878,23880,23893,23889,23897,23882,
+23903,23904,23905,23906,23908,23914,23917,23920,23929,23930,23934,23935,23937,
+23939,23944,23946,23954,23955,23956,23957,23961,23963,23967,23968,23975,23979,
+23984,23988,23992,23993,24003,24007,24011,24016,24014,24024,24025,24032,24036,
+24041,24056,24057,24064,24071,24077,24082,24084,24085,24088,24095,24096,24110,
+24104,24114,24117,24126,24139,24144,24137,24145,24150,24152,24155,24156,24158,
+24168,24170,24171,24172,24173,24174,24176,24192,24203,24206,24226,24228,24229,
+24232,24234,24236,24241,24243,24253,24254,24255,24262,24268,24267,24270,24273,
+24274,24276,24277,24284,24286,24293,24299,24322,24326,24327,24328,24334,24345,
+24348,24349,24353,24354,24355,24356,24360,24363,24364,24366,24368,24372,24374,
+24379,24381,24383,24384,24388,24389,24391,24397,24400,24404,24408,24411,24416,
+24419,24420,24423,24431,24434,24436,24437,24440,24442,24445,24446,24457,24461,
+24463,24470,24476,24477,24482,24487,24491,24484,24492,24495,24496,24497,24504,
+24516,24519,24520,24521,24523,24528,24529,24530,24531,24532,24542,24545,24546,
+24552,24553,24554,24556,24557,24558,24559,24562,24563,24566,24570,24572,24583,
+24586,24589,24595,24596,24599,24600,24602,24607,24612,24621,24627,24629,24640,
+24647,24648,24649,24652,24657,24660,24662,24663,24669,24673,24679,24689,24702,
+24703,24706,24710,24712,24714,24718,24721,24723,24725,24728,24733,24734,24738,
+24740,24741,24744,24752,24753,24759,24763,24766,24770,24772,24776,24777,24778,
+24779,24782,24783,24788,24789,24793,24795,24797,24798,24802,24805,24818,24821,
+24824,24828,24829,24834,24839,24842,24844,24848,24849,24850,24851,24852,24854,
+24855,24857,24860,24862,24866,24874,24875,24880,24881,24885,24886,24887,24889,
+24897,24901,24902,24905,24926,24928,24940,24946,24952,24955,24956,24959,24960,
+24961,24963,24964,24971,24973,24978,24979,24983,24984,24988,24989,24991,24992,
+24997,25000,25002,25005,25016,25017,25020,25024,25025,25026,25038,25039,25045,
+25052,25053,25054,25055,25057,25058,25063,25065,25061,25068,25069,25071,25089,
+25091,25092,25095,25107,25109,25116,25120,25122,25123,25127,25129,25131,25145,
+25149,25154,25155,25156,25158,25164,25168,25169,25170,25172,25174,25178,25180,
+25188,25197,25199,25203,25210,25213,25229,25230,25231,25232,25254,25256,25267,
+25270,25271,25274,25278,25279,25284,25294,25301,25302,25306,25322,25330,25332,
+25340,25341,25347,25348,25354,25355,25357,25360,25363,25366,25368,25385,25386,
+25389,25397,25398,25401,25404,25409,25410,25411,25412,25414,25418,25419,25422,
+25426,25427,25428,25432,25435,25445,25446,25452,25453,25457,25460,25461,25464,
+25468,25469,25471,25474,25476,25479,25482,25488,25492,25493,25497,25498,25502,
+25508,25510,25517,25518,25519,25533,25537,25541,25544,25550,25553,25555,25556,
+25557,25564,25568,25573,25578,25580,25586,25587,25589,25592,25593,25609,25610,
+25616,25618,25620,25624,25630,25632,25634,25636,25637,25641,25642,25647,25648,
+25653,25661,25663,25675,25679,25681,25682,25683,25684,25690,25691,25692,25693,
+25695,25696,25697,25699,25709,25715,25716,25723,25725,25733,25735,25743,25744,
+25745,25752,25753,25755,25757,25759,25761,25763,25766,25768,25772,25779,25789,
+25790,25791,25796,25801,25802,25803,25804,25806,25808,25809,25813,25815,25828,
+25829,25833,25834,25837,25840,25845,25847,25851,25855,25857,25860,25864,25865,
+25866,25871,25875,25876,25878,25881,25883,25886,25887,25890,25894,25897,25902,
+25905,25914,25916,25917,25923,25927,25929,25936,25938,25940,25951,25952,25959,
+25963,25978,25981,25985,25989,25994,26002,26005,26008,26013,26016,26019,26022,
+26030,26034,26035,26036,26047,26050,26056,26057,26062,26064,26068,26070,26072,
+26079,26096,26098,26100,26101,26105,26110,26111,26112,26116,26120,26121,26125,
+26129,26130,26133,26134,26141,26142,26145,26146,26147,26148,26150,26153,26154,
+26155,26156,26158,26160,26161,26163,26169,26167,26176,26181,26182,26186,26188,
+26193,26190,26199,26200,26201,26203,26204,26208,26209,26363,26218,26219,26220,
+26238,26227,26229,26239,26231,26232,26233,26235,26240,26236,26251,26252,26253,
+26256,26258,26265,26266,26267,26268,26271,26272,26276,26285,26289,26290,26293,
+26299,26303,26304,26306,26307,26312,26316,26318,26319,26324,26331,26335,26344,
+26347,26348,26350,26362,26373,26375,26382,26387,26393,26396,26400,26402,26419,
+26430,26437,26439,26440,26444,26452,26453,26461,26470,26476,26478,26484,26486,
+26491,26497,26500,26510,26511,26513,26515,26518,26520,26521,26523,26544,26545,
+26546,26549,26555,26556,26557,26617,26560,26562,26563,26565,26568,26569,26578,
+26583,26585,26588,26593,26598,26608,26610,26614,26615,26706,26644,26649,26653,
+26655,26664,26663,26668,26669,26671,26672,26673,26675,26683,26687,26692,26693,
+26698,26700,26709,26711,26712,26715,26731,26734,26735,26736,26737,26738,26741,
+26745,26746,26747,26748,26754,26756,26758,26760,26774,26776,26778,26780,26785,
+26787,26789,26793,26794,26798,26802,26811,26821,26824,26828,26831,26832,26833,
+26835,26838,26841,26844,26845,26853,26856,26858,26859,26860,26861,26864,26865,
+26869,26870,26875,26876,26877,26886,26889,26890,26896,26897,26899,26902,26903,
+26929,26931,26933,26936,26939,26946,26949,26953,26958,26967,26971,26979,26980,
+26981,26982,26984,26985,26988,26992,26993,26994,27002,27003,27007,27008,27021,
+27026,27030,27032,27041,27045,27046,27048,27051,27053,27055,27063,27064,27066,
+27068,27077,27080,27089,27094,27095,27106,27109,27118,27119,27121,27123,27125,
+27134,27136,27137,27139,27151,27153,27157,27162,27165,27168,27172,27176,27184,
+27186,27188,27191,27195,27198,27199,27205,27206,27209,27210,27214,27216,27217,
+27218,27221,27222,27227,27236,27239,27242,27249,27251,27262,27265,27267,27270,
+27271,27273,27275,27281,27291,27293,27294,27295,27301,27307,27311,27312,27313,
+27316,27325,27326,27327,27334,27337,27336,27340,27344,27348,27349,27350,27356,
+27357,27364,27367,27372,27376,27377,27378,27388,27389,27394,27395,27398,27399,
+27401,27407,27408,27409,27415,27419,27422,27428,27432,27435,27436,27439,27445,
+27446,27451,27455,27462,27466,27469,27474,27478,27480,27485,27488,27495,27499,
+27502,27504,27509,27517,27518,27522,27525,27543,27547,27551,27552,27554,27555,
+27560,27561,27564,27565,27566,27568,27576,27577,27581,27582,27587,27588,27593,
+27596,27606,27610,27617,27619,27622,27623,27630,27633,27639,27641,27647,27650,
+27652,27653,27657,27661,27662,27664,27666,27673,27679,27686,27687,27688,27692,
+27694,27699,27701,27702,27706,27707,27711,27722,27723,27725,27727,27730,27732,
+27737,27739,27740,27755,27757,27759,27764,27766,27768,27769,27771,27781,27782,
+27783,27785,27796,27797,27799,27800,27804,27807,27824,27826,27828,27842,27846,
+27853,27855,27856,27857,27858,27860,27862,27866,27868,27872,27879,27881,27883,
+27884,27886,27890,27892,27908,27911,27914,27918,27919,27921,27923,27930,27942,
+27943,27944,27751,27950,27951,27953,27961,27964,27967,27991,27998,27999,28001,
+28005,28007,28015,28016,28028,28034,28039,28049,28050,28052,28054,28055,28056,
+28074,28076,28084,28087,28089,28093,28095,28100,28104,28106,28110,28111,28118,
+28123,28125,28127,28128,28130,28133,28137,28143,28144,28148,28150,28156,28160,
+28164,28190,28194,28199,28210,28214,28217,28219,28220,28228,28229,28232,28233,
+28235,28239,28241,28242,28243,28244,28247,28252,28253,28254,28258,28259,28264,
+28275,28283,28285,28301,28307,28313,28320,28327,28333,28334,28337,28339,28347,
+28351,28352,28353,28355,28359,28360,28362,28365,28366,28367,28395,28397,28398,
+28409,28411,28413,28420,28424,28426,28428,28429,28438,28440,28442,28443,28454,
+28457,28458,28463,28464,28467,28470,28475,28476,28461,28495,28497,28498,28499,
+28503,28505,28506,28509,28510,28513,28514,28520,28524,28541,28542,28547,28551,
+28552,28555,28556,28557,28560,28562,28563,28564,28566,28570,28575,28576,28581,
+28582,28583,28584,28590,28591,28592,28597,28598,28604,28613,28615,28616,28618,
+28634,28638,28648,28649,28656,28661,28665,28668,28669,28672,28677,28678,28679,
+28685,28695,28704,28707,28719,28724,28727,28729,28732,28739,28740,28744,28745,
+28746,28747,28756,28757,28765,28766,28750,28772,28773,28780,28782,28789,28790,
+28798,28801,28805,28806,28820,28821,28822,28823,28824,28827,28836,28843,28848,
+28849,28852,28855,28874,28881,28883,28884,28885,28886,28888,28892,28900,28922,
+28931,28932,28933,28934,28935,28939,28940,28943,28958,28960,28971,28973,28975,
+28976,28977,28984,28993,28997,28998,28999,29002,29003,29008,29010,29015,29018,
+29020,29022,29024,29032,29049,29056,29061,29063,29068,29074,29082,29083,29088,
+29090,29103,29104,29106,29107,29114,29119,29120,29121,29124,29131,29132,29139,
+29142,29145,29146,29148,29176,29182,29184,29191,29192,29193,29203,29207,29210,
+29213,29215,29220,29227,29231,29236,29240,29241,29249,29250,29251,29253,29262,
+29263,29264,29267,29269,29270,29274,29276,29278,29280,29283,29288,29291,29294,
+29295,29297,29303,29304,29307,29308,29311,29316,29321,29325,29326,29331,29339,
+29352,29357,29358,29361,29364,29374,29377,29383,29385,29388,29397,29398,29400,
+29407,29413,29427,29428,29434,29435,29438,29442,29444,29445,29447,29451,29453,
+29458,29459,29464,29465,29470,29474,29476,29479,29480,29484,29489,29490,29493,
+29498,29499,29501,29507,29517,29520,29522,29526,29528,29533,29534,29535,29536,
+29542,29543,29545,29547,29548,29550,29551,29553,29559,29561,29564,29568,29569,
+29571,29573,29574,29582,29584,29587,29589,29591,29592,29596,29598,29599,29600,
+29602,29605,29606,29610,29611,29613,29621,29623,29625,29628,29629,29631,29637,
+29638,29641,29643,29644,29647,29650,29651,29654,29657,29661,29665,29667,29670,
+29671,29673,29684,29685,29687,29689,29690,29691,29693,29695,29696,29697,29700,
+29703,29706,29713,29722,29723,29732,29734,29736,29737,29738,29739,29740,29741,
+29742,29743,29744,29745,29753,29760,29763,29764,29766,29767,29771,29773,29777,
+29778,29783,29789,29794,29798,29799,29800,29803,29805,29806,29809,29810,29824,
+29825,29829,29830,29831,29833,29839,29840,29841,29842,29848,29849,29850,29852,
+29855,29856,29857,29859,29862,29864,29865,29866,29867,29870,29871,29873,29874,
+29877,29881,29883,29887,29896,29897,29900,29904,29907,29912,29914,29915,29918,
+29919,29924,29928,29930,29931,29935,29940,29946,29947,29948,29951,29958,29970,
+29974,29975,29984,29985,29988,29991,29993,29994,29999,30006,30009,30013,30014,
+30015,30016,30019,30023,30024,30030,30032,30034,30039,30046,30047,30049,30063,
+30065,30073,30074,30075,30076,30077,30078,30081,30085,30096,30098,30099,30101,
+30105,30108,30114,30116,30132,30138,30143,30144,30145,30148,30150,30156,30158,
+30159,30167,30172,30175,30176,30177,30180,30183,30188,30190,30191,30193,30201,
+30208,30210,30211,30212,30215,30216,30218,30220,30223,30226,30227,30229,30230,
+30233,30235,30236,30237,30238,30243,30245,30246,30249,30253,30258,30259,30261,
+30264,30265,30266,30268,30282,30272,30273,30275,30276,30277,30281,30283,30293,
+30297,30303,30308,30309,30317,30318,30319,30321,30324,30337,30341,30348,30349,
+30357,30363,30364,30365,30367,30368,30370,30371,30372,30373,30374,30375,30376,
+30378,30381,30397,30401,30405,30409,30411,30412,30414,30420,30425,30432,30438,
+30440,30444,30448,30449,30454,30457,30460,30464,30470,30474,30478,30482,30484,
+30485,30487,30489,30490,30492,30498,30504,30509,30510,30511,30516,30517,30518,
+30521,30525,30526,30530,30533,30534,30538,30541,30542,30543,30546,30550,30551,
+30556,30558,30559,30560,30562,30564,30567,30570,30572,30576,30578,30579,30580,
+30586,30589,30592,30596,30604,30605,30612,30613,30614,30618,30623,30626,30631,
+30634,30638,30639,30641,30645,30654,30659,30665,30673,30674,30677,30681,30686,
+30687,30688,30692,30694,30698,30700,30704,30705,30708,30712,30715,30725,30726,
+30729,30733,30734,30737,30749,30753,30754,30755,30765,30766,30768,30773,30775,
+30787,30788,30791,30792,30796,30798,30802,30812,30814,30816,30817,30819,30820,
+30824,30826,30830,30842,30846,30858,30863,30868,30872,30881,30877,30878,30879,
+30884,30888,30892,30893,30896,30897,30898,30899,30907,30909,30911,30919,30920,
+30921,30924,30926,30930,30931,30933,30934,30948,30939,30943,30944,30945,30950,
+30954,30962,30963,30976,30966,30967,30970,30971,30975,30982,30988,30992,31002,
+31004,31006,31007,31008,31013,31015,31017,31021,31025,31028,31029,31035,31037,
+31039,31044,31045,31046,31050,31051,31055,31057,31060,31064,31067,31068,31079,
+31081,31083,31090,31097,31099,31100,31102,31115,31116,31121,31123,31124,31125,
+31126,31128,31131,31132,31137,31144,31145,31147,31151,31153,31156,31160,31163,
+31170,31172,31175,31176,31178,31183,31188,31190,31194,31197,31198,31200,31202,
+31205,31210,31211,31213,31217,31224,31228,31234,31235,31239,31241,31242,31244,
+31249,31253,31259,31262,31265,31271,31275,31277,31279,31280,31284,31285,31288,
+31289,31290,31300,31301,31303,31304,31308,31317,31318,31321,31324,31325,31327,
+31328,31333,31335,31338,31341,31349,31352,31358,31360,31362,31365,31366,31370,
+31371,31376,31377,31380,31390,31392,31395,31404,31411,31413,31417,31419,31420,
+31430,31433,31436,31438,31441,31451,31464,31465,31467,31468,31473,31476,31483,
+31485,31486,31495,31508,31519,31523,31527,31529,31530,31531,31533,31534,31535,
+31536,31537,31540,31549,31551,31552,31553,31559,31566,31573,31584,31588,31590,
+31593,31594,31597,31599,31602,31603,31607,31620,31625,31630,31632,31633,31638,
+31643,31646,31648,31653,31660,31663,31664,31666,31669,31670,31674,31675,31676,
+31677,31682,31685,31688,31690,31700,31702,31703,31705,31706,31707,31720,31722,
+31730,31732,31733,31736,31737,31738,31740,31742,31745,31746,31747,31748,31750,
+31753,31755,31756,31758,31759,31769,31771,31776,31781,31782,31784,31788,31793,
+31795,31796,31798,31801,31802,31814,31818,31829,31825,31826,31827,31833,31834,
+31835,31836,31837,31838,31841,31843,31847,31849,31853,31854,31856,31858,31865,
+31868,31869,31878,31879,31887,31892,31902,31904,31910,31920,31926,31927,31930,
+31931,31932,31935,31940,31943,31944,31945,31949,31951,31955,31956,31957,31959,
+31961,31962,31965,31974,31977,31979,31989,32003,32007,32008,32009,32015,32017,
+32018,32019,32022,32029,32030,32035,32038,32042,32045,32049,32060,32061,32062,
+32064,32065,32071,32072,32077,32081,32083,32087,32089,32090,32092,32093,32101,
+32103,32106,32112,32120,32122,32123,32127,32129,32130,32131,32133,32134,32136,
+32139,32140,32141,32145,32150,32151,32157,32158,32166,32167,32170,32179,32182,
+32183,32185,32194,32195,32196,32197,32198,32204,32205,32206,32215,32217,32256,
+32226,32229,32230,32234,32235,32237,32241,32245,32246,32249,32250,32264,32272,
+32273,32277,32279,32284,32285,32288,32295,32296,32300,32301,32303,32307,32310,
+32319,32324,32325,32327,32334,32336,32338,32344,32351,32353,32354,32357,32363,
+32366,32367,32371,32376,32382,32385,32390,32391,32394,32397,32401,32405,32408,
+32410,32413,32414,32572,32571,32573,32574,32575,32579,32580,32583,32591,32594,
+32595,32603,32604,32605,32609,32611,32612,32613,32614,32621,32625,32637,32638,
+32639,32640,32651,32653,32655,32656,32657,32662,32663,32668,32673,32674,32678,
+32682,32685,32692,32700,32703,32704,32707,32712,32718,32719,32731,32735,32739,
+32741,32744,32748,32750,32751,32754,32762,32765,32766,32767,32775,32776,32778,
+32781,32782,32783,32785,32787,32788,32790,32797,32798,32799,32800,32804,32806,
+32812,32814,32816,32820,32821,32823,32825,32826,32828,32830,32832,32836,32864,
+32868,32870,32877,32881,32885,32897,32904,32910,32924,32926,32934,32935,32939,
+32952,32953,32968,32973,32975,32978,32980,32981,32983,32984,32992,33005,33006,
+33008,33010,33011,33014,33017,33018,33022,33027,33035,33046,33047,33048,33052,
+33054,33056,33060,33063,33068,33072,33077,33082,33084,33093,33095,33098,33100,
+33106,33111,33120,33121,33127,33128,33129,33133,33135,33143,33153,33168,33156,
+33157,33158,33163,33166,33174,33176,33179,33182,33186,33198,33202,33204,33211,
+33227,33219,33221,33226,33230,33231,33237,33239,33243,33245,33246,33249,33252,
+33259,33260,33264,33265,33266,33269,33270,33272,33273,33277,33279,33280,33283,
+33295,33299,33300,33305,33306,33309,33313,33314,33320,33330,33332,33338,33347,
+33348,33349,33350,33355,33358,33359,33361,33366,33372,33376,33379,33383,33389,
+33396,33403,33405,33407,33408,33409,33411,33412,33415,33417,33418,33422,33425,
+33428,33430,33432,33434,33435,33440,33441,33443,33444,33447,33448,33449,33450,
+33454,33456,33458,33460,33463,33466,33468,33470,33471,33478,33488,33493,33498,
+33504,33506,33508,33512,33514,33517,33519,33526,33527,33533,33534,33536,33537,
+33543,33544,33546,33547,33620,33563,33565,33566,33567,33569,33570,33580,33581,
+33582,33584,33587,33591,33594,33596,33597,33602,33603,33604,33607,33613,33614,
+33617,33621,33622,33623,33648,33656,33661,33663,33664,33666,33668,33670,33677,
+33682,33684,33685,33688,33689,33691,33692,33693,33702,33703,33705,33708,33726,
+33727,33728,33735,33737,33743,33744,33745,33748,33757,33619,33768,33770,33782,
+33784,33785,33788,33793,33798,33802,33807,33809,33813,33817,33709,33839,33849,
+33861,33863,33864,33866,33869,33871,33873,33874,33878,33880,33881,33882,33884,
+33888,33892,33893,33895,33898,33904,33907,33908,33910,33912,33916,33917,33921,
+33925,33938,33939,33941,33950,33958,33960,33961,33962,33967,33969,33972,33978,
+33981,33982,33984,33986,33991,33992,33996,33999,34003,34012,34023,34026,34031,
+34032,34033,34034,34039,34098,34042,34043,34045,34050,34051,34055,34060,34062,
+34064,34076,34078,34082,34083,34084,34085,34087,34090,34091,34095,34099,34100,
+34102,34111,34118,34127,34128,34129,34130,34131,34134,34137,34140,34141,34142,
+34143,34144,34145,34146,34148,34155,34159,34169,34170,34171,34173,34175,34177,
+34181,34182,34185,34187,34188,34191,34195,34200,34205,34207,34208,34210,34213,
+34215,34228,34230,34231,34232,34236,34237,34238,34239,34242,34247,34250,34251,
+34254,34221,34264,34266,34271,34272,34278,34280,34285,34291,34294,34300,34303,
+34304,34308,34309,34317,34318,34320,34321,34322,34328,34329,34331,34334,34337,
+34343,34345,34358,34360,34362,34364,34365,34368,34370,34374,34386,34387,34390,
+34391,34392,34393,34397,34400,34401,34402,34403,34404,34409,34412,34415,34421,
+34422,34423,34426,34445,34449,34454,34456,34458,34460,34465,34470,34471,34472,
+34477,34481,34483,34484,34485,34487,34488,34489,34495,34496,34497,34499,34501,
+34513,34514,34517,34519,34522,34524,34528,34531,34533,34535,34440,34554,34556,
+34557,34564,34565,34567,34571,34574,34575,34576,34579,34580,34585,34590,34591,
+34593,34595,34600,34606,34607,34609,34610,34617,34618,34620,34621,34622,34624,
+34627,34629,34637,34648,34653,34657,34660,34661,34671,34673,34674,34683,34691,
+34692,34693,34694,34695,34696,34697,34699,34700,34704,34707,34709,34711,34712,
+34713,34718,34720,34723,34727,34732,34733,34734,34737,34741,34750,34751,34753,
+34760,34761,34762,34766,34773,34774,34777,34778,34780,34783,34786,34787,34788,
+34794,34795,34797,34801,34803,34808,34810,34815,34817,34819,34822,34825,34826,
+34827,34832,34841,34834,34835,34836,34840,34842,34843,34844,34846,34847,34856,
+34861,34862,34864,34866,34869,34874,34876,34881,34883,34885,34888,34889,34890,
+34891,34894,34897,34901,34902,34904,34906,34908,34911,34912,34916,34921,34929,
+34937,34939,34944,34968,34970,34971,34972,34975,34976,34984,34986,35002,35005,
+35006,35008,35018,35019,35020,35021,35022,35025,35026,35027,35035,35038,35047,
+35055,35056,35057,35061,35063,35073,35078,35085,35086,35087,35093,35094,35096,
+35097,35098,35100,35104,35110,35111,35112,35120,35121,35122,35125,35129,35130,
+35134,35136,35138,35141,35142,35145,35151,35154,35159,35162,35163,35164,35169,
+35170,35171,35179,35182,35184,35187,35189,35194,35195,35196,35197,35209,35213,
+35216,35220,35221,35227,35228,35231,35232,35237,35248,35252,35253,35254,35255,
+35260,35284,35285,35286,35287,35288,35301,35305,35307,35309,35313,35315,35318,
+35321,35325,35327,35332,35333,35335,35343,35345,35346,35348,35349,35358,35360,
+35362,35364,35366,35371,35372,35375,35381,35383,35389,35390,35392,35395,35397,
+35399,35401,35405,35406,35411,35414,35415,35416,35420,35421,35425,35429,35431,
+35445,35446,35447,35449,35450,35451,35454,35455,35456,35459,35462,35467,35471,
+35472,35474,35478,35479,35481,35487,35495,35497,35502,35503,35507,35510,35511,
+35515,35518,35523,35526,35528,35529,35530,35537,35539,35540,35541,35543,35549,
+35551,35564,35568,35572,35573,35574,35580,35583,35589,35590,35595,35601,35612,
+35614,35615,35594,35629,35632,35639,35644,35650,35651,35652,35653,35654,35656,
+35666,35667,35668,35673,35661,35678,35683,35693,35702,35704,35705,35708,35710,
+35713,35716,35717,35723,35725,35727,35732,35733,35740,35742,35743,35896,35897,
+35901,35902,35909,35911,35913,35915,35919,35921,35923,35924,35927,35928,35931,
+35933,35929,35939,35940,35942,35944,35945,35949,35955,35957,35958,35963,35966,
+35974,35975,35979,35984,35986,35987,35993,35995,35996,36004,36025,36026,36037,
+36038,36041,36043,36047,36054,36053,36057,36061,36065,36072,36076,36079,36080,
+36082,36085,36087,36088,36094,36095,36097,36099,36105,36114,36119,36123,36197,
+36201,36204,36206,36223,36226,36228,36232,36237,36240,36241,36245,36254,36255,
+36256,36262,36267,36268,36271,36274,36277,36279,36281,36283,36288,36293,36294,
+36295,36296,36298,36302,36305,36308,36309,36311,36313,36324,36325,36327,36332,
+36336,36284,36337,36338,36340,36349,36353,36356,36357,36358,36363,36369,36372,
+36374,36384,36385,36386,36387,36390,36391,36401,36403,36406,36407,36408,36409,
+36413,36416,36417,36427,36429,36430,36431,36436,36443,36444,36445,36446,36449,
+36450,36457,36460,36461,36463,36464,36465,36473,36474,36475,36482,36483,36489,
+36496,36498,36501,36506,36507,36509,36510,36514,36519,36521,36525,36526,36531,
+36533,36538,36539,36544,36545,36547,36548,36551,36559,36561,36564,36572,36584,
+36590,36592,36593,36599,36601,36602,36589,36608,36610,36615,36616,36623,36624,
+36630,36631,36632,36638,36640,36641,36643,36645,36647,36648,36652,36653,36654,
+36660,36661,36662,36663,36666,36672,36673,36675,36679,36687,36689,36690,36691,
+36692,36693,36696,36701,36702,36709,36765,36768,36769,36772,36773,36774,36789,
+36790,36792,36798,36800,36801,36806,36810,36811,36813,36816,36818,36819,36821,
+36832,36835,36836,36840,36846,36849,36853,36854,36859,36862,36866,36868,36872,
+36876,36888,36891,36904,36905,36911,36906,36908,36909,36915,36916,36919,36927,
+36931,36932,36940,36955,36957,36962,36966,36967,36972,36976,36980,36985,36997,
+37000,37003,37004,37006,37008,37013,37015,37016,37017,37019,37024,37025,37026,
+37029,37040,37042,37043,37044,37046,37053,37068,37054,37059,37060,37061,37063,
+37064,37077,37079,37080,37081,37084,37085,37087,37093,37074,37110,37099,37103,
+37104,37108,37118,37119,37120,37124,37125,37126,37128,37133,37136,37140,37142,
+37143,37144,37146,37148,37150,37152,37157,37154,37155,37159,37161,37166,37167,
+37169,37172,37174,37175,37177,37178,37180,37181,37187,37191,37192,37199,37203,
+37207,37209,37210,37211,37217,37220,37223,37229,37236,37241,37242,37243,37249,
+37251,37253,37254,37258,37262,37265,37267,37268,37269,37272,37278,37281,37286,
+37288,37292,37293,37294,37296,37297,37298,37299,37302,37307,37308,37309,37311,
+37314,37315,37317,37331,37332,37335,37337,37338,37342,37348,37349,37353,37354,
+37356,37357,37358,37359,37360,37361,37367,37369,37371,37373,37376,37377,37380,
+37381,37382,37383,37385,37386,37388,37392,37394,37395,37398,37400,37404,37405,
+37411,37412,37413,37414,37416,37422,37423,37424,37427,37429,37430,37432,37433,
+37434,37436,37438,37440,37442,37443,37446,37447,37450,37453,37454,37455,37457,
+37464,37465,37468,37469,37472,37473,37477,37479,37480,37481,37486,37487,37488,
+37493,37494,37495,37496,37497,37499,37500,37501,37503,37512,37513,37514,37517,
+37518,37522,37527,37529,37535,37536,37540,37541,37543,37544,37547,37551,37554,
+37558,37560,37562,37563,37564,37565,37567,37568,37569,37570,37571,37573,37574,
+37575,37576,37579,37580,37581,37582,37584,37587,37589,37591,37592,37593,37596,
+37597,37599,37600,37601,37603,37605,37607,37608,37612,37614,37616,37625,37627,
+37631,37632,37634,37640,37645,37649,37652,37653,37660,37661,37662,37663,37665,
+37668,37669,37671,37673,37674,37683,37684,37686,37687,37703,37704,37705,37712,
+37713,37714,37717,37719,37720,37722,37726,37732,37733,37735,37737,37738,37741,
+37743,37744,37745,37747,37748,37750,37754,37757,37759,37760,37761,37762,37768,
+37770,37771,37773,37775,37778,37781,37784,37787,37790,37793,37795,37796,37798,
+37800,37803,37812,37813,37814,37818,37801,37825,37828,37829,37830,37831,37833,
+37834,37835,37836,37837,37843,37849,37852,37854,37855,37858,37862,37863,37881,
+37879,37880,37882,37883,37885,37889,37890,37892,37896,37897,37901,37902,37903,
+37909,37910,37911,37919,37934,37935,37937,37938,37939,37940,37947,37951,37949,
+37955,37957,37960,37962,37964,37973,37977,37980,37983,37985,37987,37992,37995,
+37997,37998,37999,38001,38002,38020,38019,38264,38265,38270,38276,38280,38284,
+38285,38286,38301,38302,38303,38305,38310,38313,38315,38316,38324,38326,38330,
+38333,38335,38342,38344,38345,38347,38352,38353,38354,38355,38361,38362,38365,
+38366,38367,38368,38372,38374,38429,38430,38434,38436,38437,38438,38444,38449,
+38451,38455,38456,38457,38458,38460,38461,38465,38482,38484,38486,38487,38488,
+38497,38510,38516,38523,38524,38526,38527,38529,38530,38531,38532,38537,38545,
+38550,38554,38557,38559,38564,38565,38566,38569,38574,38575,38579,38586,38602,
+38610,23986,38616,38618,38621,38622,38623,38633,38639,38641,38650,38658,38659,
+38661,38665,38682,38683,38685,38689,38690,38691,38696,38705,38707,38721,38723,
+38730,38734,38735,38741,38743,38744,38746,38747,38755,38759,38762,38766,38771,
+38774,38775,38776,38779,38781,38783,38784,38793,38805,38806,38807,38809,38810,
+38814,38815,38818,38828,38830,38833,38834,38837,38838,38840,38841,38842,38844,
+38846,38847,38849,38852,38853,38855,38857,38858,38860,38861,38862,38864,38865,
+38868,38871,38872,38873,38877,38878,38880,38875,38881,38884,38895,38897,38900,
+38903,38904,38906,38919,38922,38937,38925,38926,38932,38934,38940,38942,38944,
+38947,38950,38955,38958,38959,38960,38962,38963,38965,38949,38974,38980,38983,
+38986,38993,38994,38995,38998,38999,39001,39002,39010,39011,39013,39014,39018,
+39020,39083,39085,39086,39088,39092,39095,39096,39098,39099,39103,39106,39109,
+39112,39116,39137,39139,39141,39142,39143,39146,39155,39158,39170,39175,39176,
+39185,39189,39190,39191,39194,39195,39196,39199,39202,39206,39207,39211,39217,
+39218,39219,39220,39221,39225,39226,39227,39228,39232,39233,39238,39239,39240,
+39245,39246,39252,39256,39257,39259,39260,39262,39263,39264,39323,39325,39327,
+39334,39344,39345,39346,39349,39353,39354,39357,39359,39363,39369,39379,39380,
+39385,39386,39388,39390,39399,39402,39403,39404,39408,39412,39413,39417,39421,
+39422,39426,39427,39428,39435,39436,39440,39441,39446,39454,39456,39458,39459,
+39460,39463,39469,39470,39475,39477,39478,39480,39495,39489,39492,39498,39499,
+39500,39502,39505,39508,39510,39517,39594,39596,39598,39599,39602,39604,39605,
+39606,39609,39611,39614,39615,39617,39619,39622,39624,39630,39632,39634,39637,
+39638,39639,39643,39644,39648,39652,39653,39655,39657,39660,39666,39667,39669,
+39673,39674,39677,39679,39680,39681,39682,39683,39684,39685,39688,39689,39691,
+39692,39693,39694,39696,39698,39702,39705,39707,39708,39712,39718,39723,39725,
+39731,39732,39733,39735,39737,39738,39741,39752,39755,39756,39765,39766,39767,
+39771,39774,39777,39779,39781,39782,39784,39786,39787,39788,39789,39790,39795,
+39797,39799,39800,39801,39807,39808,39812,39813,39814,39815,39817,39818,39819,
+39821,39823,39824,39828,39834,39837,39838,39846,39847,39849,39852,39856,39857,
+39858,39863,39864,39867,39868,39870,39871,39873,39879,39880,39886,39888,39895,
+39896,39901,39903,39909,39911,39914,39915,39919,39923,39927,39928,39929,39930,
+39933,39935,39936,39938,39947,39951,39953,39958,39960,39961,39962,39964,39966,
+39970,39971,39974,39975,39976,39977,39978,39985,39989,39990,39991,39997,40001,
+40003,40004,40005,40009,40010,40014,40015,40016,40019,40020,40022,40024,40027,
+40029,40030,40031,40035,40041,40042,40028,40043,40040,40046,40048,40050,40053,
+40055,40059,40166,40178,40183,40185,40203,40194,40209,40215,40216,40220,40221,
+40222,40239,40240,40242,40243,40244,40250,40252,40261,40253,40258,40259,40263,
+40266,40275,40276,40287,40291,40290,40293,40297,40298,40299,40304,40310,40311,
+40315,40316,40318,40323,40324,40326,40330,40333,40334,40338,40339,40341,40342,
+40343,40344,40353,40362,40364,40366,40369,40373,40377,40380,40383,40387,40391,
+40393,40394,40404,40405,40406,40407,40410,40414,40415,40416,40421,40423,40425,
+40427,40430,40432,40435,40436,40446,40458,40450,40455,40462,40464,40465,40466,
+40469,40470,40473,40476,40477,40570,40571,40572,40576,40578,40579,40580,40581,
+40583,40590,40591,40598,40600,40603,40606,40612,40616,40620,40622,40623,40624,
+40627,40628,40629,40646,40648,40651,40661,40671,40676,40679,40684,40685,40686,
+40688,40689,40690,40693,40696,40703,40706,40707,40713,40719,40720,40721,40722,
+40724,40726,40727,40729,40730,40731,40735,40738,40742,40746,40747,40751,40753,
+40754,40756,40759,40761,40762,40764,40765,40767,40769,40771,40772,40773,40774,
+40775,40787,40789,40790,40791,40792,40794,40797,40798,40808,40809,40813,40814,
+40815,40816,40817,40819,40821,40826,40829,40847,40848,40849,40850,40852,40854,
+40855,40862,40865,40866,40867,40869,
+};
+
+static const struct dbcs_index jisx0212_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0212_decmap+0,47,113},{0,0,0},{
+0,0,0},{0,0,0},{__jisx0212_decmap+67,97,124},{__jisx0212_decmap+95,66,126},{0,
+0,0},{__jisx0212_decmap+156,33,80},{__jisx0212_decmap+204,33,119},{
+__jisx0212_decmap+291,33,119},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__jisx0212_decmap+378,33,126},{__jisx0212_decmap+472,33,126},{
+__jisx0212_decmap+566,33,126},{__jisx0212_decmap+660,33,126},{
+__jisx0212_decmap+754,33,126},{__jisx0212_decmap+848,33,126},{
+__jisx0212_decmap+942,33,126},{__jisx0212_decmap+1036,33,126},{
+__jisx0212_decmap+1130,33,126},{__jisx0212_decmap+1224,33,126},{
+__jisx0212_decmap+1318,33,126},{__jisx0212_decmap+1412,33,126},{
+__jisx0212_decmap+1506,33,126},{__jisx0212_decmap+1600,33,126},{
+__jisx0212_decmap+1694,33,126},{__jisx0212_decmap+1788,33,126},{
+__jisx0212_decmap+1882,33,126},{__jisx0212_decmap+1976,33,126},{
+__jisx0212_decmap+2070,33,126},{__jisx0212_decmap+2164,33,126},{
+__jisx0212_decmap+2258,33,126},{__jisx0212_decmap+2352,33,126},{
+__jisx0212_decmap+2446,33,126},{__jisx0212_decmap+2540,33,126},{
+__jisx0212_decmap+2634,33,126},{__jisx0212_decmap+2728,33,126},{
+__jisx0212_decmap+2822,33,126},{__jisx0212_decmap+2916,33,126},{
+__jisx0212_decmap+3010,33,126},{__jisx0212_decmap+3104,33,126},{
+__jisx0212_decmap+3198,33,126},{__jisx0212_decmap+3292,33,126},{
+__jisx0212_decmap+3386,33,126},{__jisx0212_decmap+3480,33,126},{
+__jisx0212_decmap+3574,33,126},{__jisx0212_decmap+3668,33,126},{
+__jisx0212_decmap+3762,33,126},{__jisx0212_decmap+3856,33,126},{
+__jisx0212_decmap+3950,33,126},{__jisx0212_decmap+4044,33,126},{
+__jisx0212_decmap+4138,33,126},{__jisx0212_decmap+4232,33,126},{
+__jisx0212_decmap+4326,33,126},{__jisx0212_decmap+4420,33,126},{
+__jisx0212_decmap+4514,33,126},{__jisx0212_decmap+4608,33,126},{
+__jisx0212_decmap+4702,33,126},{__jisx0212_decmap+4796,33,126},{
+__jisx0212_decmap+4890,33,126},{__jisx0212_decmap+4984,33,126},{
+__jisx0212_decmap+5078,33,126},{__jisx0212_decmap+5172,33,126},{
+__jisx0212_decmap+5266,33,126},{__jisx0212_decmap+5360,33,126},{
+__jisx0212_decmap+5454,33,126},{__jisx0212_decmap+5548,33,126},{
+__jisx0212_decmap+5642,33,126},{__jisx0212_decmap+5736,33,126},{
+__jisx0212_decmap+5830,33,126},{__jisx0212_decmap+5924,33,126},{
+__jisx0212_decmap+6018,33,126},{__jisx0212_decmap+6112,33,99},{0,0,0},{0,0,0},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __jisxcommon_encmap[22016] = {
+8512,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41527,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41538,
+8561,8562,41584,N,41539,8568,8495,41581,41580,N,8780,N,41582,41524,8555,8542,
+N,N,8493,N,8825,N,41521,N,41579,N,N,N,N,41540,43554,43553,43556,43562,43555,
+43561,43297,43566,43570,43569,43572,43571,43584,43583,43586,43585,N,43600,
+43602,43601,43604,43608,43603,8543,43308,43619,43618,43621,43620,43634,43312,
+43342,43810,43809,43812,43818,43811,43817,43329,43822,43826,43825,43828,43827,
+43840,43839,43842,43841,43331,43856,43858,43857,43860,43864,43859,8544,43340,
+43875,43874,43877,43876,43890,43344,43891,43559,43815,43557,43813,43560,43816,
+43563,43819,43564,43820,43567,43823,43565,43821,43568,43824,43298,43330,43575,
+43831,N,N,43574,43830,43576,43832,43573,43829,43578,43834,43579,43835,43581,
+43837,43580,N,43582,43838,43300,43332,43591,43847,43589,43845,N,N,43590,43846,
+43588,43333,43302,43334,43592,43848,43593,43849,43335,43594,43850,43596,43852,
+43595,43851,43305,43337,43304,43336,43597,43853,43599,43855,43598,43854,43338,
+43307,43339,43607,43863,N,N,43606,43862,43309,43341,43609,43865,43611,43867,
+43610,43866,43612,43868,43613,43869,43615,43871,43614,43870,43617,43873,43616,
+43872,43311,43343,43628,43884,43625,43881,43622,43878,43627,43883,43624,43880,
+43626,43882,43633,43889,43636,43892,43635,43637,43893,43639,43895,43638,43894,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43558,43814,43587,43843,43605,43861,43623,43879,43632,43888,43629,43885,43631,
+43887,43630,43886,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43833,41520,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41519,41522,41526,41525,N,41523,41528,41529,
+42593,N,42594,42595,42596,N,42599,N,42601,42604,42614,9761,9762,9763,9764,
+9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,N,9778,9779,
+9780,9781,9782,9783,9784,42597,42602,42609,42610,42611,42612,42619,9793,9794,
+9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,
+42616,9810,9811,9812,9813,9814,9815,9816,42613,42618,42615,42617,42620,10023,
+42818,42819,42820,42821,42822,42823,42824,42825,42826,42827,42828,N,42829,
+42830,10017,10018,10019,10020,10021,10022,10024,10025,10026,10027,10028,10029,
+10030,10031,10032,10033,10034,10035,10036,10037,10038,10039,10040,10041,10042,
+10043,10044,10045,10046,10047,10048,10049,10065,10066,10067,10068,10069,10070,
+10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10084,
+10085,10086,10087,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,
+N,10071,42866,42867,42868,42869,42870,42871,42872,42873,42874,42875,42876,N,
+42877,42878,8510,N,N,N,N,8509,8514,N,8518,8519,N,N,8520,8521,N,N,8823,8824,N,
+N,N,8517,8516,N,N,N,N,N,N,N,N,N,8819,N,8556,8557,N,N,N,N,N,N,N,8744,8558,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41585,N,N,N,N,N,N,N,N,N,N,N,41583,N,N,N,N,N,N,
+N,N,8818,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8747,8748,8746,8749,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8781,N,8782,8783,N,8799,8784,N,N,N,
+8800,8762,N,N,8763,N,N,N,N,N,N,8541,N,N,N,N,N,N,N,8805,N,N,8807,8551,N,8796,N,
+N,N,N,N,N,8778,8779,8769,8768,8809,8810,N,N,N,N,N,N,N,8552,8808,N,N,N,N,N,N,N,
+8806,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8802,N,N,N,N,N,N,N,N,N,N,N,N,N,
+8546,8801,N,N,N,N,8549,8550,N,N,8803,8804,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,8766,8767,N,N,8764,8765,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,8797,8798,10273,10284,10274,10285,N,N,N,N,N,N,N,N,10275,N,N,10286,
+10276,N,N,10287,10278,N,N,10289,10277,N,N,10288,10279,10300,N,N,10295,N,N,
+10290,10281,10302,N,N,10297,N,N,10292,10280,N,N,10296,10301,N,N,10291,10282,N,
+N,10298,10303,N,N,10293,10283,N,N,10299,N,N,10304,N,N,N,N,N,N,N,N,10294,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,8739,8738,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8741,8740,N,N,N,N,N,N,N,N,
+8743,8742,N,N,N,N,N,N,N,N,8737,8574,N,N,N,8571,N,N,8573,8572,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8830,8570,8569,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,8554,N,8553,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8822,N,N,8821,N,8820,8481,8482,8483,8503,N,
+8505,8506,8507,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8745,8750,
+8524,8525,N,N,N,N,N,N,8513,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,9249,9250,9251,9252,9253,9254,9255,9256,9257,9258,9259,
+9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,
+9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,
+9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,
+9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,
+9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,N,N,N,N,N,N,N,
+8491,8492,8501,8502,N,N,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,
+9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,
+9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,
+9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,
+9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,
+9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,9589,
+9590,N,N,N,N,8486,8508,8499,8500,12396,17274,45089,15415,45090,45091,N,19324,
+15974,15152,15973,12860,45092,18772,19775,N,20514,12591,45093,N,13166,20515,
+16420,21058,13654,19002,N,N,N,N,15975,45094,N,20030,N,45095,45096,N,19010,N,
+45097,N,20516,45098,N,17254,45099,45100,45101,20517,13946,N,N,45102,20518,N,
+13405,17200,N,15463,20519,N,N,20520,45103,45104,20521,18229,45105,13655,N,
+45106,N,N,N,18231,N,18019,14403,19251,N,45107,N,N,N,26953,20522,15976,20523,
+12853,45108,N,45109,13925,14448,19561,N,N,22054,45110,N,N,N,N,45111,45112,N,N,
+N,N,N,N,N,19824,N,18045,45113,45114,N,N,N,45115,N,N,N,N,13349,45116,13621,N,
+20524,N,N,20525,20027,N,19773,16744,20527,15222,18035,45117,20530,N,N,12606,
+14431,N,14430,12390,45118,45119,20299,20298,N,14899,12321,45120,20531,20532,
+20533,19252,20534,N,14450,12391,19314,N,13692,N,N,13693,13694,17506,20028,
+45121,20535,N,N,20536,N,N,20537,N,N,45122,16205,N,N,N,N,N,15674,16206,20542,
+45123,20540,N,20541,13656,N,N,14883,12912,N,20539,20538,18985,45124,N,N,N,
+15174,15173,16958,20543,18773,16487,45125,45126,N,8504,20544,20546,45127,
+45128,45129,16997,20065,12362,N,N,45130,N,N,N,N,20545,12862,45131,13892,45132,
+17255,45133,N,45134,14191,20547,N,N,N,18212,N,45135,45136,45137,45138,13419,
+45139,45140,N,N,N,N,45141,20548,12363,45142,45143,14432,13420,18810,18482,
+13657,45144,N,N,45145,45146,45147,N,45148,12913,N,20583,17729,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,45149,18284,20550,45150,N,45152,18492,45153,20066,45154,16173,
+45155,15175,45156,15223,12864,45157,N,45158,N,45159,17489,N,N,17186,20554,
+45160,45161,N,45162,45163,12364,17507,15675,14900,19748,45164,16974,45165,
+12863,45166,20553,45167,19774,20549,20551,14958,20552,21796,45168,45151,N,N,
+45169,N,N,N,N,N,20560,45170,N,45171,N,45172,20563,20561,45173,N,12866,N,19003,
+20555,45174,45175,45176,45177,20559,14451,45178,45179,15176,N,45180,45181,
+13350,45182,45345,20564,N,20556,45346,45347,20067,45348,15224,45349,20557,
+45350,20562,45351,45352,45353,N,20565,45354,20558,45355,45356,13857,N,12365,
+45357,45358,13858,12865,N,N,N,N,N,N,N,N,N,21797,N,19321,18798,14452,N,N,45359,
+N,N,16175,20023,45360,N,45361,N,45362,45363,45364,45365,19032,45366,45367,
+14136,16933,12900,45368,45369,N,45370,45371,15699,45372,45373,45374,20569,
+45375,20574,20572,45376,N,20567,N,N,16943,20570,N,20573,20571,45377,19037,N,
+20568,45378,16174,45379,19315,20575,20576,N,N,N,N,N,N,N,N,15652,20589,45380,N,
+45381,18256,N,18742,20584,N,19056,N,12854,N,45382,45383,20588,45384,45385,
+45386,N,N,45387,20582,20591,45388,N,16722,45389,14404,45390,18268,45391,24647,
+45392,20590,17757,45393,20579,N,14454,45394,45395,14453,20577,45396,45397,
+45398,45399,15450,N,20585,45400,19055,17229,20581,14193,45401,20578,20586,
+20580,20049,20587,20289,45402,N,45403,N,45404,45405,N,45406,13926,N,N,14192,N,
+45430,N,N,N,N,45407,45408,45409,20592,N,45410,45411,20593,20597,12366,45412,N,
+45413,N,45414,19024,20596,45415,45416,45417,N,20595,20599,45418,N,45419,20598,
+N,17508,N,N,45420,45421,N,45422,45423,N,14194,45424,45425,N,N,45426,N,20600,
+45427,N,N,45428,45429,15429,N,16934,17509,13942,N,20601,N,N,N,N,13622,N,N,
+20602,45431,N,45432,45433,20604,45434,N,N,N,45435,N,N,19253,45436,45437,45438,
+14182,45601,45602,45603,N,45604,N,15153,18551,20603,45605,45606,N,45607,45608,
+45609,45610,45611,N,N,N,N,N,N,N,45612,N,14917,19779,N,45613,45614,N,20606,
+20771,20605,14916,N,15741,N,45615,45616,N,N,45617,14137,N,45618,N,20772,45619,
+45620,13903,N,45621,N,20769,20770,N,45622,17967,45623,16764,45624,13859,N,
+45625,45626,19277,20773,N,45627,N,20029,N,45628,45629,20774,45630,N,N,45631,
+20777,45632,20775,45633,16718,45634,45635,N,N,N,20776,20778,45636,N,45637,
+45649,N,N,20780,45638,N,N,20779,45639,19016,N,N,45640,13623,20782,20783,45641,
+12847,N,45642,45643,45644,20781,N,45645,45646,45647,45648,N,45650,N,15476,N,
+20786,20785,20784,45651,20566,45652,20787,45653,45654,45655,45656,15742,N,
+20788,N,45657,N,N,N,45658,45659,N,19749,N,45660,45661,N,45662,N,45663,19545,
+45664,45665,45666,N,20790,45667,45668,20789,20792,20791,N,N,20793,20794,12404,
+45669,14389,14139,15676,17275,13860,16488,14455,45670,14702,20796,19528,17734,
+45671,15225,N,20795,45672,20797,45673,N,45674,45675,N,17758,N,13173,N,N,45676,
+N,N,20798,N,45677,18046,45678,N,16692,20800,20801,18476,14456,20283,20802,N,N,
+13862,N,N,N,19004,16950,13937,17717,N,N,N,14195,N,45679,N,20803,N,20804,45680,
+45681,18018,12639,N,N,20807,14973,45682,20806,14918,45683,20808,26222,20809,
+19265,20810,N,20811,20812,15977,45684,15436,N,N,N,45685,N,N,13351,45686,20815,
+45687,20813,19517,20814,N,18778,20816,20817,20818,17759,45688,N,N,20822,20820,
+20821,20819,14947,20823,19562,20068,45689,N,45690,N,45691,20824,45692,45693,N,
+N,45694,N,16424,20825,15706,N,45857,20826,N,17276,20031,17760,N,45858,N,45859,
+45860,45861,N,45862,21061,N,45863,N,N,20827,29733,13893,45864,N,20828,19294,
+45865,N,N,45866,15720,17020,N,20830,18020,N,N,20831,45867,N,20832,13102,45868,
+45869,45870,20833,13863,45871,17996,12666,15696,N,N,18465,20834,17761,45872,
+45873,16207,20835,45874,18988,16474,13346,N,13353,20836,N,N,20838,N,N,14138,
+45875,45876,20837,45877,45878,20083,45879,N,N,N,N,15721,N,N,N,N,45880,N,18493,
+19020,N,20839,45881,19832,20840,N,N,N,20841,N,17790,45882,45883,20842,N,45884,
+16425,14974,14196,20843,15177,14703,45885,N,N,N,N,N,N,17510,20845,45886,N,
+16935,N,45887,14959,20846,20847,16688,N,20844,N,N,N,N,20849,45888,19254,45889,
+45890,N,45891,14692,45892,N,20848,45893,45894,45895,N,14197,14942,18285,45896,
+N,N,20852,20850,N,N,N,45897,18811,15978,20859,13156,20853,20851,16719,N,45898,
+45899,45900,N,N,N,20855,N,20854,45901,N,45902,13124,N,45903,N,14176,20860,
+20013,45904,N,45905,20856,N,N,N,20861,20858,45906,20857,45907,45908,45909,
+45910,N,45911,20047,45912,N,N,14457,12867,N,N,20084,45913,45914,45915,45916,N,
+15733,17752,14693,21026,21027,N,45917,45918,20069,N,N,20267,21029,45919,45920,
+45921,14458,45922,45923,21028,45924,13103,N,45925,21030,N,19286,45926,17468,
+45927,19750,45928,19033,N,N,45929,21031,N,45930,N,45931,28757,N,45932,17968,
+45933,21032,13354,19507,N,45934,45935,15905,21033,19047,21037,45936,16426,
+21034,13904,45937,21035,13355,45938,45939,45940,N,45941,N,N,N,45942,45943,
+14126,21038,45944,21039,45945,45946,21040,21041,15451,N,N,N,14459,19550,45947,
+19560,18039,45948,N,19057,21042,N,21043,N,45949,45950,46113,21045,N,21047,
+21046,46114,N,46115,N,21048,12861,19276,46116,14972,21049,46117,46118,16729,
+46119,46120,15906,13865,N,21050,N,46121,N,46122,46123,46124,18523,46125,46126,
+46127,N,21051,46128,21052,46129,21053,N,46130,N,N,21054,18724,13928,12389,
+46131,46132,46133,17983,21055,15677,46134,16489,N,21057,21056,15907,14433,
+21059,18494,46136,46135,21060,N,N,N,18524,16948,17006,13864,N,N,18030,17201,
+46137,18286,46138,19278,N,21062,N,16490,46139,N,46140,N,46141,14133,N,N,21063,
+N,N,46142,46143,21064,12588,12405,13421,46144,16936,13649,19825,N,21067,12855,
+46145,N,21066,N,N,46146,13866,N,N,21068,46147,19569,N,N,46148,46149,N,N,N,N,N,
+46150,N,N,N,N,46151,46152,N,21069,N,20050,46153,14460,N,N,46154,N,14390,21070,
+46155,N,N,46156,21072,21071,N,16223,12601,46157,46158,N,12638,21073,46159,
+21074,N,46160,14391,46161,46162,21075,46163,46164,N,46165,13678,N,46166,N,N,
+46167,N,15154,21076,N,46168,N,N,19316,14901,13658,19751,16720,18495,15485,
+46169,N,N,46170,46171,15687,46172,15464,15477,N,15734,46173,18496,N,46174,
+46175,21079,46176,12611,16721,14461,14405,13927,46177,46178,21083,17185,17022,
+13867,15908,21084,21082,12868,16998,15416,15179,12582,N,46179,13168,14694,
+15178,N,21085,21086,46180,13641,13126,N,N,N,14695,13640,17503,12581,17969,
+19518,14625,19833,17735,14462,N,46181,N,N,N,N,N,N,46182,14127,N,21095,N,13923,
+19274,46183,N,N,N,N,18525,46184,46185,21094,46186,13406,21089,21090,21092,
+46187,N,46188,N,N,46189,46190,21093,N,13659,16225,N,18989,21091,21087,14435,N,
+21088,N,20260,46191,46192,N,19058,46193,17512,14434,14704,N,N,46194,21096,
+46195,N,18013,N,N,N,N,N,N,N,N,N,N,N,N,46196,21100,N,N,46197,N,46198,N,46199,
+46200,15486,46201,15478,46202,N,46203,46204,N,21103,21101,N,19491,46205,21098,
+21107,21102,N,N,N,21105,14406,19519,N,46206,21106,46369,N,46370,21108,46371,
+21110,N,46372,46373,N,14960,20290,46374,21099,21097,21109,46375,21104,N,N,
+46376,46377,N,N,N,N,N,46378,N,N,46379,N,46380,21112,N,21283,21114,46381,46382,
+21118,46383,46384,21281,21115,46385,46386,21310,N,46387,14953,13105,N,N,N,
+46388,21113,46389,46390,46391,21285,12406,21284,46392,12325,18762,21282,N,
+21116,N,46393,21111,21117,14920,46394,N,N,46395,46396,N,N,N,N,N,N,N,N,N,21286,
+N,N,N,N,N,N,N,46397,12407,21295,N,N,21287,21288,N,15909,19305,46398,N,46399,
+21293,21292,46400,N,N,17711,N,N,N,46401,N,N,N,21294,N,46402,21291,46403,46404,
+46405,46406,N,N,12596,46407,14902,16176,46408,46409,N,N,46410,46411,46412,
+21289,17762,N,N,N,21290,46413,12322,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+46414,46415,N,N,21300,19747,N,15911,46416,21306,N,46417,46418,N,21305,21296,N,
+46419,46420,46421,16963,N,21297,46422,N,N,17007,21302,15910,46423,N,46424,
+46425,N,21299,46426,N,19556,46427,46428,N,14140,N,N,21303,21304,46429,N,46430,
+46431,21301,21307,46432,N,46433,46434,N,21298,46435,N,46436,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,21313,21318,N,21314,46437,21309,46438,46439,21319,16689,
+N,46440,21321,46441,14626,21311,17277,N,N,46442,46443,N,46444,46445,46446,
+46447,N,N,46448,21315,21308,13357,N,13422,13157,21316,21312,N,N,N,46449,46450,
+N,N,14198,21322,21320,16723,13642,13868,46451,21317,N,13940,N,46452,N,N,N,
+12612,N,N,N,N,N,N,N,N,46453,N,46454,N,46455,21326,21324,46456,21543,N,46457,N,
+46458,46459,N,46460,N,N,46461,46462,46625,21329,N,N,46626,46627,N,21323,46628,
+21327,N,46629,21325,N,N,46630,15180,21328,N,N,N,N,46631,N,N,N,N,N,N,N,N,N,N,N,
+N,46632,21331,N,21336,N,N,N,21334,21333,46633,46634,17202,N,46635,12869,46636,
+N,N,46637,46638,46639,46640,46641,46642,N,21330,N,21332,15912,12595,46643,N,
+21335,N,N,N,N,N,N,N,N,N,N,N,N,N,12894,N,N,46644,N,N,21346,46645,15996,21342,
+46646,21340,46647,21341,46648,21343,46649,N,46650,46651,46652,N,46653,46654,
+46655,12605,46656,46657,N,46658,N,N,46659,N,46660,16697,46661,21337,46662,
+21338,N,N,N,46663,N,N,N,N,N,N,13178,N,N,46664,N,46665,46666,46667,46668,21345,
+N,46669,N,13423,46670,21348,21344,21347,46671,N,46672,N,46673,46674,N,18990,
+46675,N,N,18005,N,18488,N,N,N,N,N,21350,N,N,N,46676,46677,21349,13125,46678,N,
+21351,46679,46680,N,N,21354,N,N,N,N,21353,46681,N,N,N,46682,46683,N,N,46684,
+46685,46686,21352,N,18233,N,N,21355,46687,46688,46689,46690,N,46691,46692,
+46693,21356,N,N,46694,N,46695,21358,N,21357,46696,N,N,N,N,21360,N,46697,N,
+21363,21361,21359,21362,N,46698,N,N,21364,46699,46700,46701,46704,46705,21365,
+46702,46703,21366,N,21367,N,N,N,21368,20805,46706,15484,15181,46707,46708,
+12915,46709,12408,46710,N,17220,46711,46712,46713,46714,46715,N,N,46717,N,
+46718,21369,N,14884,46716,12367,16222,N,N,46881,46882,N,21370,14407,N,N,14705,
+N,21372,21371,46883,46884,19040,21373,N,N,46885,21537,21374,46886,21538,46887,
+21539,N,14199,N,46888,12640,21540,N,46889,21542,N,21541,N,46890,46891,21544,
+46892,N,17754,46893,N,46894,46895,46896,46897,21545,12341,14943,46898,46899,N,
+46900,14141,46901,46902,17231,N,N,46903,46904,N,N,21546,21547,N,N,21549,N,
+46905,46906,46907,21550,N,14948,N,N,46908,46909,13905,N,N,19255,N,46910,46911,
+21548,21551,14913,14627,46912,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21555,46913,N,14885,
+46914,17203,46915,46916,21552,17498,46917,N,46918,46919,46920,46921,46922,N,
+46923,46924,46925,N,46926,N,46927,46928,46929,46930,N,46931,21556,N,46932,
+16226,46933,N,N,N,N,21554,21557,N,14143,46934,N,N,N,N,N,N,21558,46935,46944,N,
+46936,N,46937,46938,N,46939,46940,46941,46942,21559,46943,14628,13120,21561,N,
+N,46945,46946,46947,21562,N,46948,N,N,N,21563,N,N,21560,N,N,N,N,46949,N,N,N,N,
+46950,N,N,21553,N,N,21564,N,N,21565,46951,46952,N,N,19300,46953,N,15979,46954,
+N,N,21567,21568,21566,46955,21570,N,N,N,N,N,18232,46956,46957,12392,18774,
+46974,N,21571,46958,N,46959,46960,N,46961,N,N,N,46962,N,N,46963,N,N,N,15997,
+46964,46965,15417,46966,18269,13424,N,14955,46967,46968,46969,19289,N,17970,
+46970,46971,14200,16975,N,46972,46973,21569,21572,47137,47138,N,N,N,N,N,N,N,
+16964,N,N,N,21573,N,47139,N,21574,47140,47141,47142,21576,N,N,17513,N,47143,
+47144,N,N,13358,N,N,47145,N,29729,12641,19059,47146,N,15980,17736,N,N,N,47147,
+14950,N,N,21582,N,47148,19005,20061,N,N,N,N,N,N,N,47149,12916,21578,47150,
+47151,N,47152,47153,16698,21581,N,17763,47154,N,17737,17764,18489,17485,N,N,N,
+14921,47155,N,47156,21577,N,47157,N,N,47158,47159,12662,N,17718,N,N,N,N,21579,
+N,21575,N,N,16208,N,N,47160,21583,N,N,47161,N,15694,47162,47163,47164,N,13869,
+N,21584,N,47165,47166,47167,47168,N,47169,47170,N,47171,47172,N,N,19048,47173,
+N,47174,16765,N,N,N,N,17478,47175,N,21586,47176,47177,47178,N,N,N,47179,N,
+19279,47180,N,21587,N,N,21592,N,N,47181,47182,18991,N,N,N,N,21591,21585,21588,
+21590,47184,N,14886,N,N,19017,47185,N,47183,21593,N,17221,47186,N,12917,N,
+15981,47187,47188,N,47189,21595,47190,21594,47191,14696,47192,21596,21598,
+21597,47193,N,21600,47194,21589,21602,N,47195,47196,N,21601,21599,N,N,N,47197,
+N,15182,16209,N,16724,21603,16444,12397,18276,47198,N,N,N,17499,N,21605,21604,
+21606,21607,21608,21609,N,N,47199,47200,N,N,19025,21610,47201,47202,N,N,12870,
+21611,N,47203,47204,47205,19772,13104,N,21065,15688,16959,21612,19563,47207,N,
+N,N,47208,19508,47209,47210,21614,N,16999,47211,17719,16960,18775,21615,21616,
+12667,47212,47213,15418,21617,47214,N,47215,47216,12368,21618,N,N,N,N,N,21619,
+47217,N,N,N,47218,12642,N,47219,13425,18016,19060,N,N,N,N,21623,16725,21622,
+14144,47220,47221,19291,21621,N,17765,21625,47222,21624,47223,N,47224,47225,
+47226,21627,47227,21626,47228,N,12668,N,21628,15913,21630,17189,47229,21629,
+47230,18995,47393,N,N,47394,15735,17755,47395,47396,N,21793,47397,N,47398,
+47399,14629,N,N,N,21794,18209,18526,19537,N,N,N,N,N,18213,47400,47401,21803,
+47402,N,N,N,47403,13624,N,47404,19781,47405,N,19503,N,22060,N,21795,N,47406,N,
+N,N,21798,47407,16965,N,47408,19256,N,N,N,17738,47409,47410,47411,47412,N,
+21799,47413,N,N,N,47414,N,19301,47415,14922,47416,N,15914,N,N,47417,N,47418,
+47419,N,21800,N,47420,15184,47421,15183,N,47422,N,N,12345,14408,47423,16427,
+12369,N,N,N,N,21804,21805,N,21802,47424,47425,47426,N,N,N,47427,47428,12600,
+13359,47429,21801,N,19525,18737,N,N,47430,47431,N,47432,47433,N,47434,N,12328,
+47435,N,N,N,12409,N,N,N,15185,47436,12370,N,12323,47437,N,N,N,N,21810,N,N,
+47438,47439,47440,N,N,21808,47441,47442,N,N,N,N,19516,N,21811,N,21809,N,47443,
+21807,16177,N,N,47444,47445,21806,N,47446,47447,19034,47448,N,N,47449,N,14436,
+47450,N,N,N,N,21815,21816,N,N,N,N,N,15915,N,N,N,21812,20268,N,N,47451,47452,
+18252,47453,47454,21814,N,N,47455,N,N,N,47456,N,N,N,N,47457,N,N,N,N,14887,N,N,
+N,47458,N,N,N,21817,47459,N,47460,18776,47461,N,N,21818,N,21813,47462,N,N,N,N,
+N,N,N,N,N,47463,N,N,47464,47465,N,N,47466,19515,N,N,N,N,N,N,N,N,N,N,N,47467,N,
+N,N,N,47468,N,18270,47469,N,N,47470,N,N,47471,21819,18738,47472,N,47473,47474,
+47475,N,47476,N,N,N,N,47477,N,N,N,N,47478,N,N,N,N,47479,47480,47481,N,47482,N,
+N,47483,N,47484,47485,21820,21824,21821,47486,N,12871,21823,N,47649,N,47650,N,
+47651,15419,N,21822,14201,N,N,47652,21836,N,N,N,N,N,21829,21826,N,N,47653,N,
+47654,N,N,N,47655,17252,N,21825,N,47656,21827,N,N,21828,47657,N,N,N,47658,N,N,
+N,N,N,N,47659,47660,N,N,N,21830,21831,N,47661,47662,47663,N,N,N,N,N,N,47664,
+13426,N,21833,21832,N,N,N,N,N,N,N,N,N,21834,47665,N,47667,N,47668,N,47669,N,N,
+N,47670,15982,N,N,47671,N,N,N,N,21837,N,17500,47672,N,N,12613,N,21835,N,47666,
+N,21838,N,47673,N,N,N,N,N,21839,N,21842,47674,N,21840,N,21841,N,N,N,N,N,47675,
+47676,N,N,N,15186,21843,47677,N,14630,21844,47678,15226,16952,N,21845,21846,
+15194,14631,47679,19538,N,N,N,13608,14409,21847,13144,N,47680,21848,N,16953,N,
+N,47681,47682,21849,22051,N,21850,N,21851,N,N,21852,N,21854,N,47683,47684,
+47685,47686,21855,47687,N,21856,47688,17008,47689,12583,15465,12354,47690,
+16727,13360,15413,47691,14632,47692,47693,N,47694,47695,17766,47696,15649,
+13361,17256,17514,12344,13625,19061,N,15426,N,N,13650,16491,15420,19752,21857,
+N,47697,47698,N,N,47699,47700,13660,47701,14923,47702,47703,13106,12643,15916,
+12872,47704,21858,19782,47705,N,47706,N,N,15689,47707,47708,15460,21859,13427,
+18002,19497,21860,N,21861,N,N,18777,47709,N,47710,21863,N,13352,13943,21862,N,
+47711,47712,47713,47714,47715,13362,N,16178,21867,15137,47716,12873,21866,N,
+21864,21868,21865,18219,23629,16179,N,21869,N,N,20032,47717,21870,47718,N,
+21872,47719,17278,21871,N,16419,N,15227,N,N,47720,16976,15479,18805,16492,N,
+15437,21873,15917,21874,21875,12371,16954,16210,47721,21876,17971,15918,N,
+15919,N,21877,N,N,16493,47722,N,N,15920,N,N,N,47723,47724,21878,N,21879,47725,
+19552,N,47726,N,21880,47727,N,47728,47729,13894,47730,N,47731,15650,47732,N,N,
+47733,47734,N,21881,21882,15452,16172,18036,16212,18552,18210,13897,21883,N,N,
+N,13679,21884,N,13950,N,17999,12848,N,15187,21885,22050,22049,13949,N,21886,N,
+17720,N,N,N,47735,47736,N,47737,N,16944,N,17739,15432,47738,47739,16728,19834,
+N,47740,47741,47742,N,N,22052,47905,22053,18006,47906,15155,N,N,47907,47908,
+22055,N,N,22056,47909,47910,47911,47912,N,N,N,N,N,N,N,N,N,47913,47914,N,47915,
+N,22057,N,N,47916,13428,22058,47917,N,22059,N,N,N,N,N,N,N,N,47918,N,47919,
+47920,12844,47921,47922,N,N,47923,N,16699,13412,47924,22061,19496,N,N,N,N,
+16978,47925,13145,47926,47927,22063,22065,13407,N,47928,22062,22064,N,22067,N,
+N,N,N,N,N,22066,N,22068,N,47929,N,47930,N,N,N,N,N,N,47931,N,N,N,N,47933,N,
+22069,N,N,N,47932,N,N,17981,13870,N,N,N,N,N,N,12901,22070,22075,N,N,22073,
+47934,19063,19062,47935,47936,N,47937,N,17767,N,N,N,22072,15700,N,22071,47938,
+N,N,N,N,47939,16242,N,N,N,22076,N,47940,14954,N,N,22082,47941,N,22083,22077,
+13107,22078,22087,22086,22085,22081,N,N,N,22080,N,N,22084,47943,47944,N,47945,
+47946,N,19064,N,47942,N,N,N,N,N,47947,N,N,47948,N,N,N,N,47949,N,N,N,47950,N,
+47951,N,N,47952,47953,N,N,47954,N,47955,N,47959,22091,22088,N,22090,N,19826,
+47957,22089,N,N,47956,N,N,N,47958,N,N,22079,N,N,47960,47961,47962,47963,N,
+47964,N,N,N,N,16243,47965,N,22092,47966,N,14903,47967,N,N,22093,N,N,22094,N,N,
+47968,47969,N,N,N,47970,47971,N,47972,22097,47973,22096,N,N,22095,47974,N,
+47975,17768,22074,N,N,N,22103,N,47976,47977,47978,47979,N,N,N,47980,N,47981,N,
+22099,N,47982,47983,N,22098,N,N,N,N,47984,N,N,N,47985,22100,N,22101,N,47986,N,
+58996,N,47987,N,N,22104,47988,47989,20070,N,22105,22102,N,N,N,N,N,47990,N,N,N,
+47991,N,22106,N,47992,13408,22107,47994,N,47993,N,22109,22108,N,N,22110,N,
+47995,47996,N,22111,N,16494,15651,N,47997,15716,N,16739,47998,14633,14904,
+14634,13680,48161,N,22112,N,N,14905,N,N,14410,22113,19494,18243,22114,N,14635,
+48162,48163,N,13356,N,17191,13906,48164,N,15188,18779,N,N,18497,48165,N,N,N,
+22115,13429,48166,N,N,N,22118,48167,N,48168,48169,17441,N,48170,22117,22116,
+22119,N,17515,N,48171,48172,N,N,N,N,16227,N,N,48174,N,N,15189,N,16458,48173,
+16979,13602,N,48175,17442,N,48176,22120,22121,15983,N,N,N,N,19257,48177,N,
+22124,N,N,22123,22122,18813,N,22131,N,48180,N,48178,19290,N,22125,N,48179,
+48181,N,N,22127,19307,48182,22126,48183,N,N,48184,48185,N,48186,22128,N,18472,
+22129,19006,22130,N,N,N,48187,N,48188,48189,48190,48191,48192,N,48193,N,13363,
+19007,18223,22132,22133,N,14636,13364,22134,14392,19780,19753,13430,22136,
+48194,17443,N,14637,15921,N,N,18527,N,N,15922,48195,N,N,48196,15736,N,N,N,N,N,
+17516,19065,17721,N,N,14638,N,18780,N,N,N,22137,N,48197,N,48198,48199,17753,
+14914,48200,N,48201,14411,48202,17517,N,N,N,48203,N,48204,N,12355,15726,14639,
+19783,N,N,N,N,48205,48206,48207,N,22138,22139,18257,N,N,48208,N,22140,20087,
+20269,48210,48209,N,48211,22142,22141,48212,48213,13127,48214,48215,22305,N,N,
+N,22308,22309,48216,22307,48217,18752,15923,22311,22310,22306,N,48218,N,N,
+22312,22313,N,48219,22314,N,N,N,22317,22315,N,22316,22318,N,12644,17518,22319,
+N,14202,12918,18230,N,22320,18043,19035,48220,22321,20270,N,48221,48222,48223,
+22322,19008,22325,20513,20529,48224,15408,18037,22326,N,13661,17444,12410,
+22327,18982,14640,48225,N,17232,48226,48227,N,17519,N,48228,48229,48230,48231,
+19567,14393,14412,48232,22328,N,48233,48234,22329,48235,22335,48236,15461,N,N,
+48237,17445,48238,13871,22330,N,N,48239,18731,48240,17222,48241,48242,22331,N,
+N,48243,48244,N,48245,22332,N,13872,N,22333,48246,22334,N,48247,22336,N,17782,
+48248,N,22337,22338,48249,22339,N,48250,22324,22323,N,N,48251,22340,14145,
+48252,48253,N,18727,48254,N,14924,18743,17446,18763,22341,N,48417,15924,12614,
+48418,22342,48419,48420,N,22343,48421,19570,48422,N,18528,48423,48424,22346,
+12669,16428,22345,22344,14146,16980,N,22350,22348,48425,22347,20007,14437,
+48426,N,48427,15737,22349,17740,15678,N,N,48428,17984,22353,22352,N,N,48429,
+48430,22351,N,22354,14438,48431,N,48434,N,N,48432,22355,18812,15707,48433,
+48435,22356,18553,48436,48437,48438,N,17985,17447,N,N,N,48439,17712,N,N,22357,
+13611,N,N,N,N,N,16180,48440,18732,N,48441,48442,48443,N,48444,13431,18214,N,N,
+48445,48446,48447,48448,48449,N,22358,15190,19258,19259,N,N,12670,22363,48450,
+N,17257,48451,48452,N,22360,N,N,N,48453,48454,48455,12919,48456,48457,48458,
+48459,22573,22362,48460,48461,N,18224,48462,N,22361,N,48463,22359,48464,14714,
+N,22365,48465,N,N,48466,N,N,48467,22371,22377,22369,N,17756,48468,48469,22374,
+18781,48470,48471,22368,48472,22373,20071,15191,N,48473,16981,22366,N,N,48474,
+13662,22376,16429,12645,22370,12920,22375,N,48475,N,13873,N,22372,N,48476,N,
+48477,N,N,N,N,22378,N,N,N,N,N,48478,22380,22390,22388,N,N,22385,48479,48480,
+48481,22384,20088,48482,22386,N,N,13874,48483,14641,N,48484,15738,48485,48486,
+N,22393,22379,N,N,48487,N,22383,22367,48488,12922,22387,22389,17233,N,48489,
+14888,12856,22381,22392,22391,13875,N,16937,13158,48490,N,N,N,14147,N,22382,N,
+N,N,N,N,N,48491,48492,N,22394,48493,22397,22561,N,48494,N,48495,15421,48496,
+22567,17520,22395,48497,N,N,48498,22565,48499,12921,48500,22563,22564,48501,N,
+22398,22562,N,48502,48503,14439,19754,N,48504,13365,48505,48506,12633,22566,
+48507,18234,12333,N,N,N,N,N,48508,48509,18529,22364,22572,22576,19557,48510,
+22569,N,N,48673,17769,22574,48674,N,N,N,48675,N,48676,15984,22575,18007,48677,
+48678,48679,48680,N,N,48681,48682,N,20295,N,22571,48683,48684,N,N,22577,48685,
+14715,48686,16459,48687,48688,12372,22570,22568,48689,16730,N,48690,N,22396,
+15156,N,N,N,N,N,N,N,16966,22589,48691,16731,22584,48692,22581,22582,48693,
+15462,22585,22588,48694,48695,22583,15653,48696,22586,N,N,22580,48697,19580,
+19579,48698,N,48699,22590,22591,12373,48700,48701,48702,48703,48704,22579,
+48705,48706,N,48707,13938,12326,48708,N,48709,13366,N,22587,48710,N,N,N,N,
+22595,22594,N,48711,48712,22599,N,N,N,48713,48714,N,N,22600,48715,48716,48717,
+N,48718,N,N,22598,22601,22593,22597,N,48719,22602,N,22603,48720,48721,22592,
+15228,48722,22596,16982,14642,22578,16181,N,N,N,N,22616,N,19049,N,N,22606,
+22607,22608,N,N,22615,48723,22614,48724,N,19325,13367,N,22612,N,14149,13108,N,
+N,22609,48725,N,20024,22611,12374,22613,48726,22604,22610,22617,14148,22605,
+48727,N,N,48728,48729,N,19805,48730,48731,48732,19755,48733,48734,N,N,22620,N,
+N,22624,48735,N,48736,16766,N,20089,22625,48737,48738,22622,N,22619,48739,
+48740,22618,22623,N,48741,48742,N,48743,48744,N,N,N,18992,48745,N,17972,48746,
+14150,48747,22626,22621,48748,22627,N,N,N,14203,N,N,N,12849,N,48749,48750,
+22635,N,48751,N,13368,N,48752,48753,48754,22633,N,N,22634,14889,22632,22630,
+22629,22636,22628,22638,48755,48756,12923,N,N,N,N,48757,N,N,N,N,N,N,48758,
+48759,48760,48761,N,48762,48763,22640,N,48766,22639,48764,N,48765,N,N,48929,
+48930,N,48931,N,N,17448,N,22643,N,22641,22631,14204,N,22642,N,22646,22645,
+22647,22644,22648,48932,N,48933,48934,N,N,48935,22649,22650,19050,N,22652,
+22651,15679,N,16430,12902,12924,48936,22653,48937,12351,N,N,N,16460,22654,
+48938,27715,22817,14177,48939,22818,48940,48941,N,N,16495,48942,N,48943,22819,
+48944,N,N,22820,13626,22821,N,22822,22823,16983,N,N,N,14413,48945,N,19553,N,
+48946,N,19260,15722,22824,48947,48948,48949,N,48950,16496,28221,18530,N,15466,
+48951,14925,22825,N,48952,48953,48954,16967,48955,18983,48956,N,17009,N,48957,
+22828,48958,N,22826,N,22829,N,N,22827,48959,N,N,N,22830,N,N,N,N,48960,18993,
+48961,N,12343,N,48962,N,N,18782,N,N,18531,48963,N,22831,48964,22834,15925,
+13627,N,22832,22839,15926,N,N,N,N,22833,18244,N,N,48965,48966,48967,48968,
+19806,22835,22836,22840,17770,22837,14643,16478,N,N,22854,18484,N,17010,N,N,N,
+N,N,N,N,48969,N,48970,N,N,18532,23085,N,N,N,N,19066,N,48971,N,17521,48972,
+48973,N,19317,48974,22843,12833,17258,48975,48976,N,N,22852,N,48977,17204,
+22846,22853,22848,22855,22851,N,22850,18287,48978,22844,12925,22842,13681,
+17011,22838,48979,48980,22841,14644,16475,48981,15927,22849,18258,N,N,13682,
+13128,N,N,N,N,N,N,N,N,48982,N,13159,16161,22857,22862,N,22858,48983,14205,
+48984,22863,15138,14697,N,N,N,N,48985,48986,15654,22845,15229,22860,48987,
+48988,N,N,15192,22861,12356,48989,48990,22856,48991,N,N,48992,17449,N,48993,N,
+N,48994,N,48995,13683,N,N,N,N,N,13876,N,N,N,N,N,N,N,22859,12327,48996,48997,
+14915,N,48998,N,16182,N,N,N,N,N,48999,49000,N,N,49001,17522,N,49002,18516,
+22865,16734,N,49003,49004,49005,49006,N,49007,N,N,16938,49008,49009,15147,
+22866,49010,22868,22864,N,49011,49012,49013,19041,N,17469,49014,N,N,49015,
+16732,N,N,N,N,N,N,N,N,49016,49017,19067,15438,22880,N,22879,49018,49019,16248,
+N,N,49020,14206,N,49021,49022,22873,15929,49185,N,18024,18225,49186,49187,N,
+49188,22871,N,49189,16733,49190,N,N,49191,15480,22876,49192,N,15928,N,22870,
+22875,49193,N,18259,N,49194,49195,22869,N,14113,49196,49197,13149,N,N,49198,
+22877,20011,14926,17205,22874,49199,16476,49200,14645,16228,12646,16700,22872,
+13637,49201,49202,49203,N,N,14151,N,17487,22878,N,N,N,N,N,16735,N,49204,22881,
+N,22883,49205,N,16951,22889,49206,22884,N,49207,22886,N,N,N,N,49208,18753,
+17523,49209,22887,49210,49211,49212,19756,N,N,N,19784,13369,49213,N,N,N,49214,
+12334,N,22885,N,49215,N,N,N,22882,49216,N,49217,N,13432,N,N,N,49218,49219,
+12647,49220,22888,N,49221,49222,19785,22892,N,N,49223,49224,N,N,16955,N,22899,
+49225,N,49226,22893,49227,N,22890,22897,49228,N,N,N,22867,N,49229,N,49230,N,
+49231,N,49232,49233,22894,N,22898,49234,49235,N,18498,17771,N,49236,49237,N,N,
+N,22891,49238,22895,N,N,N,14152,N,N,49239,14961,49240,N,N,16477,N,N,N,N,N,N,N,
+N,49241,N,N,22903,49242,N,49243,49244,49245,49246,N,N,N,17702,N,49247,49248,
+49249,49250,N,49251,49252,49253,N,49254,N,N,N,22900,N,19296,N,N,N,49255,N,
+22901,N,N,N,49256,49257,N,22902,N,19534,N,16418,49258,N,49259,N,N,N,N,N,14178,
+N,49260,N,49261,22909,N,N,N,N,N,N,49262,49263,49264,15157,22906,N,22905,N,N,
+49265,49266,18226,49267,N,49268,17973,49269,N,49270,N,49271,17713,22907,49272,
+N,49273,22908,N,18799,49274,18245,15139,N,16497,N,19280,49275,N,N,N,N,N,13129,
+N,23077,22910,49276,49277,49278,N,19786,23079,N,49441,23075,N,23076,N,49442,
+49443,49444,49445,16736,49446,N,49447,49448,23074,N,22847,49449,N,49450,23078,
+N,23073,N,N,N,N,N,23083,23084,17703,23086,49451,49452,15140,23081,N,49453,
+49454,N,13628,49455,N,23087,49456,23080,23091,N,23090,49457,23089,49458,N,N,
+23092,49459,N,23094,15985,49460,23093,49461,N,N,49462,23097,N,N,49463,49464,
+49465,N,N,N,N,49466,N,N,N,49467,49468,N,49469,N,23095,49470,N,49471,23096,
+22896,49472,49473,N,N,49474,23099,23098,N,49475,N,N,49476,22904,23100,23088,N,
+49477,15193,N,49478,N,N,23101,23102,23104,23103,23105,12926,49479,14646,49480,
+49481,19068,16431,N,N,N,49482,N,14414,N,49483,23107,49484,N,N,N,23110,N,18770,
+49485,13663,49486,N,49487,23109,23108,18260,23111,13877,N,N,N,23113,23112,
+49488,49489,N,13370,15158,N,N,18008,49490,N,N,N,49491,14153,N,N,N,16244,N,
+23114,N,16432,17704,N,18783,23115,N,49492,N,N,49493,N,N,N,49494,23116,23117,N,
+49495,N,19000,21853,16454,49496,N,18764,N,14936,N,18533,18499,49497,N,N,49498,
+N,17741,49499,20033,N,23119,15440,49500,N,23120,49501,12342,N,49502,13908,
+16461,49503,18784,N,N,N,23121,15170,17223,49504,15195,16183,N,49505,49506,
+49507,N,N,23122,N,19069,N,N,12663,15196,N,49508,N,23125,49509,23123,23126,
+20025,23124,N,49510,49511,N,16507,23127,N,49512,16946,49513,N,23128,N,49514,N,
+49515,13434,49516,23130,N,23129,N,N,N,49517,23131,23132,13435,N,N,18044,17206,
+13676,15197,16737,N,N,15708,12336,N,N,49518,23133,49519,N,49520,49521,N,N,N,
+49522,12834,23137,N,N,49523,49524,49525,N,14647,23136,49526,N,14891,15930,
+49527,49528,23135,N,15931,49529,19520,14890,N,49530,49531,12375,16462,49532,
+49533,N,N,N,N,N,23142,49534,49697,16433,12615,49698,49699,49700,49701,15701,
+49702,19302,14962,49703,49704,49705,49706,15932,49707,16423,49708,49709,N,
+49710,23141,23139,23140,49712,N,49711,N,N,17259,N,N,23334,49713,23146,15230,
+14648,23144,49714,49715,N,N,23145,49716,16184,49717,N,49719,23143,N,49718,
+15151,N,N,N,N,49720,49721,49722,N,49723,49724,23148,23147,23152,49725,49726,
+23153,N,23149,N,13090,23150,23151,18517,49728,49729,49730,N,18785,14154,23154,
+N,N,49732,16434,49733,15933,49735,49736,49737,17234,49738,49740,N,49731,49734,
+49739,13895,N,23155,23159,N,N,12875,23156,23158,N,49741,49742,49743,23157,N,
+49744,15723,49745,N,N,N,17224,12357,23160,49746,49747,49748,49749,23161,N,
+49750,49751,N,17450,N,49752,N,20081,N,N,N,N,15171,N,49753,19051,N,N,49754,
+49755,N,19261,49756,N,N,23330,23163,N,49757,23166,N,23165,49758,49759,23162,
+49760,49761,23329,N,N,18014,49762,23164,N,N,49763,N,49764,49765,N,N,N,N,49766,
+N,23331,N,N,15724,23332,49767,19787,18296,N,49768,23333,N,N,N,N,N,23335,N,
+49769,23336,N,49770,49771,N,49772,N,23337,N,13898,12616,14649,23338,N,23339,
+15729,16738,49773,49727,21080,16702,16701,16984,14919,N,N,20594,N,49774,N,
+49775,14190,19757,N,19070,N,18814,49776,23340,N,N,N,49777,14963,17471,23341,
+20271,N,49778,N,19262,49779,17451,23342,13436,49780,N,49781,N,N,N,23343,23344,
+19546,N,19492,19318,19292,15141,23346,N,N,15467,N,49782,19281,N,23348,23351,
+23350,N,13433,N,N,13664,49783,23347,N,23349,N,N,N,49784,23352,49785,49786,
+16249,N,N,49787,N,19835,12361,14944,16956,N,15453,49788,49789,15987,N,N,23355,
+N,N,17742,49790,23353,16939,23354,15986,19549,23356,23357,19816,49953,N,N,N,
+23362,N,49954,14650,49955,18261,23359,17772,23134,23138,49956,13647,49957,
+18247,N,N,N,49958,23361,N,15934,18500,N,49959,N,N,49960,23367,N,18554,N,23358,
+N,23364,23363,N,49961,49962,16463,49963,N,49964,N,19309,49965,20051,49966,
+49967,19303,49968,12876,15198,N,N,20296,23366,16245,N,N,N,23365,N,N,23360,N,N,
+N,N,N,14415,49969,49970,49971,23372,23370,49972,12877,23368,23374,23380,N,
+49973,49974,49975,N,N,49977,16968,49978,49979,19009,49980,23382,N,49981,49982,
+18722,N,N,N,23381,18288,19263,13371,49983,16503,15680,N,N,49984,17491,49985,
+19758,N,49986,23377,23376,N,N,49987,23378,N,23375,N,49988,23383,N,23373,N,N,
+23371,N,23379,23369,49989,17260,49990,19576,15430,14964,49991,49992,N,49976,N,
+14906,N,N,19311,13121,17486,17994,12617,N,N,N,N,N,N,N,N,N,N,N,N,N,N,16498,
+49994,N,16436,14122,N,49995,N,N,N,49996,23385,49997,N,14651,13180,N,N,N,N,
+49999,49998,23387,13172,23393,50000,50001,N,50002,50003,50004,23390,50005,
+16499,N,N,N,13131,14892,N,50006,13130,14927,N,50007,23388,14181,14155,17773,
+50008,50009,23386,N,12358,N,50010,N,50011,23389,23391,N,13901,14124,49993,
+13372,13643,50012,N,50013,50014,23394,N,50015,14969,19313,N,15159,N,N,N,23395,
+N,N,N,18736,N,N,N,50016,N,N,50017,50018,50019,50020,50021,N,23407,50022,12851,
+23396,N,50023,50024,50025,50026,N,23413,23397,N,20034,50027,23404,50028,18271,
+50029,N,50030,N,N,N,N,23412,N,23399,N,N,N,12340,23401,N,50031,14652,50032,N,
+50033,23403,50034,23402,N,23398,23409,50035,15935,50036,N,50037,21613,14440,
+19836,50038,50039,N,N,23400,50040,17524,13091,14893,50041,23392,N,23408,13153,
+N,N,23406,23410,50042,17774,N,N,N,N,N,N,N,13438,50043,23602,N,50044,19529,
+23415,13437,50045,23422,N,50046,50209,50210,19264,50211,23585,23587,50212,
+23591,23417,50213,17194,N,50214,50215,N,17775,23595,23420,N,23592,N,50216,N,
+23586,50217,N,50218,50219,50220,50221,16185,23596,50222,50223,16435,N,N,50224,
+50225,N,N,23594,13373,50226,50227,50228,20304,23414,N,N,23590,12376,50229,N,
+23416,50230,50231,19514,23421,16162,17479,23411,50232,50233,23589,50234,N,N,
+50235,50236,N,16250,23599,13169,14369,N,N,N,N,23601,23418,23600,N,23593,23419,
+N,23597,N,23598,N,N,N,N,N,23615,50237,N,50238,17998,50239,23588,N,50240,23611,
+N,50241,N,23613,N,17496,N,N,50242,N,N,50243,N,N,N,50244,19788,N,N,N,50245,N,N,
+N,N,18806,23608,16970,N,50246,N,23614,16703,50247,23605,23618,23617,N,18031,
+23616,18026,50248,50249,50250,50251,N,50252,50253,23620,23607,50254,13896,
+23610,15709,50255,50256,50257,18272,23612,13899,N,23604,23606,23603,50258,
+50259,20272,13146,23609,50260,50261,23619,13109,N,N,N,N,N,N,N,14951,N,N,50262,
+12637,N,N,23636,50263,N,20273,23639,50264,N,50265,N,N,16186,23638,N,N,N,23637,
+50266,N,N,N,50267,50268,23634,50269,N,N,50270,N,50271,23622,50272,N,23651,
+23621,N,23640,N,N,50273,50274,N,50275,23632,50276,N,23627,23624,N,23625,N,
+23633,N,50277,N,29730,50278,N,23630,14653,17480,16740,23628,N,23623,50279,N,
+23626,N,N,50280,50281,19789,19306,N,N,N,23631,23641,N,N,N,50282,N,N,50283,N,
+23649,23642,N,N,23655,N,23653,50284,50285,N,50286,23648,50287,N,50288,N,N,N,
+23647,N,17488,N,16741,50289,23645,50290,50291,23643,50292,N,23650,N,N,N,N,
+23656,18549,23662,N,N,50293,N,50294,23657,23660,23654,50295,N,17268,N,18744,
+50296,23644,N,50297,23652,15936,50298,19535,23672,23659,50299,N,N,N,50300,
+14370,12835,13151,N,N,23635,N,50301,N,50302,N,50465,15937,23664,50466,23671,
+15481,13170,50467,N,17198,50468,50469,N,N,N,N,23661,50470,50471,23666,23670,
+50472,50473,13878,N,N,50474,N,50475,50476,50477,N,N,50478,50479,N,13644,23668,
+N,50480,N,N,N,13601,N,17995,23667,N,50481,N,23669,50482,N,N,50483,N,N,N,N,N,N,
+50484,23663,50485,N,N,N,N,23665,N,N,N,N,N,50486,13152,17225,50487,N,50488,
+23676,N,50489,50490,N,50491,N,50492,N,23674,14441,N,23673,50493,N,N,N,N,N,
+23841,N,N,N,50494,23384,50495,50496,50497,23675,N,23677,23678,N,50498,N,N,N,N,
+23852,50499,23848,N,23405,50500,50501,50502,N,23847,50503,N,N,N,23846,N,N,
+23843,N,50504,50505,50506,N,23658,23845,23844,N,N,50507,N,50509,50508,N,N,
+50510,N,N,N,50511,23850,N,20262,50512,50513,50514,N,N,N,23853,13947,50515,
+50516,23849,23851,N,N,N,N,50517,N,N,50518,18471,N,23854,N,50519,N,N,N,50520,
+50521,50522,N,N,N,N,N,N,N,23858,23855,50523,50524,50525,50526,19827,23856,
+50527,50528,N,50529,23646,N,N,N,N,50530,50531,50532,23859,N,N,N,23860,50533,N,
+N,N,50534,N,12597,50535,23862,14183,15393,N,13909,50536,N,N,12836,50537,N,N,
+50538,50539,N,N,50540,N,N,19807,N,N,50541,50542,23864,23863,23866,13629,50543,
+N,13910,13374,50544,N,N,N,23869,N,N,50545,23868,N,23870,50546,N,12878,50547,
+17207,N,23871,N,50548,13375,23873,N,50549,N,50550,23872,N,23874,N,50551,N,
+23875,50552,23876,15199,16437,14881,N,18800,50553,N,19042,20292,50554,N,N,
+50555,15221,50556,N,N,14928,20082,50557,N,N,23877,23878,N,15200,N,50558,50721,
+23879,23880,N,50722,23882,23881,50723,19288,N,N,15710,15468,15172,N,23883,N,N,
+N,N,N,N,N,23885,16163,50724,23884,N,N,50725,N,N,23886,50726,50727,N,50728,
+50729,23887,N,N,N,50730,50731,23888,23889,50732,50733,50734,23890,50735,23892,
+23891,23893,12837,17226,N,23894,50736,50737,15142,13132,23895,50738,50739,
+17730,21580,N,N,50740,50741,13603,23896,N,N,50742,N,23897,50743,19052,19304,N,
+N,N,17991,23898,18534,N,50744,N,18555,N,50745,19539,N,N,N,23899,N,50746,N,
+50747,N,N,50748,50749,N,N,N,23901,23900,N,50750,23903,N,50751,N,23902,N,N,N,
+50752,N,50753,N,N,N,N,N,50754,50755,N,50756,50757,N,N,23905,50758,N,N,N,50759,
+50760,15201,50761,19505,50762,23906,23907,N,N,13604,N,50763,N,23908,N,N,N,
+50764,N,N,N,23910,23909,N,50765,50766,50767,N,N,N,50768,N,50769,N,N,N,N,50770,
+16229,50771,50772,18745,12618,N,50773,50774,N,N,18501,50775,17525,15681,13665,
+N,N,N,N,N,N,N,50776,50777,N,50778,18502,50779,15406,N,50780,N,50781,23912,N,
+13376,N,50782,12664,50783,50784,18034,23911,14654,17235,N,23913,N,N,N,N,50998,
+23921,N,23914,50785,N,50786,N,50787,16961,N,13666,23922,50788,N,50789,N,50790,
+50791,14184,50792,N,13605,23920,N,N,23918,23915,19808,N,50793,50794,50795,
+17472,50796,N,N,18009,23916,N,N,23924,N,23923,14115,50797,50798,12845,50799,
+50800,14907,23917,23919,50801,N,N,50802,N,19287,17012,N,N,N,N,N,N,N,N,19319,N,
+N,23932,N,50803,23933,50804,12879,50805,N,N,N,18984,19581,24097,15395,15938,
+23928,23934,12648,N,13879,50806,N,23925,23930,50807,N,N,16500,18289,N,18535,
+50808,N,50809,50810,50811,50812,23927,50813,19233,50814,23929,N,24100,50977,
+24098,50978,23931,N,N,50979,19234,18248,13667,N,17701,N,50980,17261,50981,
+24101,50982,50983,N,50984,24099,16985,23926,50985,12619,50986,50987,N,N,50988,
+N,N,50989,19790,24112,N,50990,50991,N,50992,24111,50993,N,N,N,16502,N,24108,
+50994,19820,N,N,17974,24102,N,N,N,N,N,17477,50995,50996,50997,12620,14655,
+24105,N,N,50999,51000,N,51001,15655,24110,N,24109,24104,N,24107,51002,N,13160,
+51003,24106,18249,51004,N,20014,N,N,15988,16501,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,51005,N,24118,24116,N,18765,N,51006,51007,N,51008,N,24113,24115,51009,
+12602,51010,N,14656,20274,N,13117,N,18786,51011,51012,N,N,N,19809,N,N,13092,
+16187,24117,N,N,51013,N,N,N,N,N,51014,N,N,24122,N,51015,15939,N,N,N,19760,N,
+24119,N,N,51016,51017,24114,51018,24120,51019,51020,51021,20062,N,17779,17986,
+N,N,N,N,N,N,N,N,N,N,N,N,N,51022,N,51023,N,N,13110,N,N,12629,N,51024,24126,N,
+51025,24129,51026,N,N,20035,51027,N,51028,19812,N,N,N,51029,24136,24130,24127,
+51030,N,51031,20052,24133,N,51032,51033,N,15690,24135,N,N,24140,51034,N,17777,
+24138,N,51035,N,51036,24132,51037,51038,17208,51039,N,24139,51040,24128,N,
+24134,51041,24141,12412,24131,N,24142,51042,51043,16188,N,15711,51044,18981,
+51045,14894,N,24123,24137,17722,51046,51047,N,N,N,51048,16438,N,13161,14929,
+15940,24125,15682,N,N,N,N,N,N,N,14156,N,24124,N,N,N,24146,15725,14394,N,24161,
+51049,24155,13684,17743,51050,24150,24159,12335,12594,51051,N,12857,N,24152,
+16940,24143,24145,14657,N,N,51052,N,N,N,51053,N,24162,51054,24157,51055,51056,
+N,24149,N,N,N,N,24156,51057,51058,N,N,51059,51060,19499,51061,N,24154,24158,
+51062,N,51063,51064,51065,51066,N,14416,51067,15941,N,N,17209,51068,51069,
+51070,24148,N,N,51233,51234,N,N,N,19759,51235,N,N,24151,N,N,24144,17778,N,N,
+24147,51236,N,N,24153,N,N,N,N,51237,N,51238,20305,15422,19326,N,24163,N,N,N,N,
+N,N,N,N,N,18478,51239,N,24175,14395,N,N,51240,N,N,15712,N,24165,51241,N,N,
+20015,14658,N,24178,51242,N,12398,N,N,24176,N,51243,N,N,24164,N,N,51244,51245,
+24170,N,51246,24172,51247,N,N,19791,24167,N,N,17710,51248,N,24169,N,51249,
+51250,51251,24177,51252,24171,19527,N,51253,51254,24166,51255,15394,24190,
+51256,51257,51258,N,13162,N,24168,24173,24174,N,N,N,N,N,N,N,17004,16986,N,N,N,
+N,N,N,N,N,N,N,N,N,51259,24182,51260,51261,24188,N,N,24186,N,17705,N,N,24355,
+24183,51262,N,51263,N,51264,24184,24160,13689,18746,N,51265,N,15423,N,51266,
+14711,51267,N,51268,51269,N,20275,N,24180,N,24354,12649,16742,51270,N,51271,N,
+51272,51273,N,N,N,N,18297,N,13377,20090,N,N,51274,N,N,51275,51276,19489,17490,
+51283,N,51277,51278,24187,24189,51279,N,N,51280,N,16690,N,N,51281,51282,N,
+24353,24185,N,24179,N,N,N,13379,N,N,N,N,N,N,N,N,N,51284,N,51285,51286,51287,
+14185,N,N,51288,24367,51289,51290,24362,16504,51291,51292,13155,N,51293,51294,
+N,15713,N,24371,N,51295,N,N,N,51296,24364,17452,24361,17497,N,N,N,24396,N,N,N,
+24358,N,24357,N,24366,51297,51298,N,24360,24359,24365,51299,16417,N,24356,
+51300,51301,N,N,51302,51303,51304,24368,N,51305,24369,51306,51307,51308,N,
+51309,13378,N,N,51310,N,N,N,N,51311,51312,24374,N,24373,24375,51313,51314,
+51315,51316,N,24378,N,N,N,51317,51318,51319,17731,N,24372,N,51320,51321,N,N,
+24376,N,N,51322,N,N,N,14179,17017,24370,18235,N,51323,24377,51324,51325,N,
+51326,N,N,N,N,N,N,N,N,N,24382,24380,N,N,24383,N,51489,24386,N,N,51490,24379,
+14698,18216,N,N,24121,N,N,N,51491,51492,N,19828,24381,N,24385,17013,51493,
+24384,N,24363,N,51494,28521,N,N,51495,24389,N,51496,51497,24393,51498,24391,N,
+N,N,51499,51500,51501,N,24387,N,24388,N,51502,N,24392,N,24390,N,N,N,18766,N,
+51503,24398,N,24395,24394,N,24397,18004,24399,51504,N,N,51505,N,N,17269,17005,
+N,N,N,N,16421,N,N,51506,24400,N,24402,N,51507,N,N,51508,N,51509,N,N,51510,N,
+24401,N,N,N,N,51511,51512,N,N,N,51513,51514,51515,51516,24181,N,51521,N,N,
+24403,N,N,51517,51518,N,N,18023,N,N,N,N,51519,51520,N,N,N,N,24404,51522,51523,
+N,N,N,N,N,12880,51524,N,51525,17780,13093,N,N,N,N,51526,51527,N,13668,N,N,N,
+15454,14930,51528,N,N,51529,N,N,N,51530,51531,N,N,20263,16230,N,N,N,12650,N,N,
+N,24406,N,51532,51533,51534,51535,51536,24405,N,51537,N,N,N,N,N,N,N,N,51538,N,
+N,N,N,N,N,51539,24409,17210,24412,24407,51540,51541,N,24411,51542,N,N,51543,
+24410,17728,12377,N,N,N,N,N,N,N,N,N,N,N,N,N,20085,N,51544,24414,N,N,N,12584,N,
+51545,N,51546,51547,51548,51549,N,51550,24416,N,N,51551,24415,N,24413,N,N,N,N,
+51552,N,N,N,N,N,N,N,N,N,N,N,N,24408,N,N,N,N,N,N,N,19235,51553,N,N,24418,51554,
+51555,51556,51557,51558,N,24417,N,51559,51560,N,N,51561,N,N,N,N,12651,N,N,N,N,
+24420,18994,N,24419,N,51562,N,51563,19509,N,N,N,N,15943,N,N,N,N,51564,N,51565,
+N,51566,51567,51568,N,N,N,N,16691,N,51569,N,N,N,15942,N,N,N,N,51570,N,N,N,
+51571,51572,51573,N,20091,51574,51575,24426,N,16505,N,51576,N,51577,N,N,24422,
+24427,51578,N,12652,51579,N,51580,N,51581,N,51582,N,24425,N,18273,24421,24424,
+15944,51745,18513,N,N,24428,N,15441,N,N,N,N,N,N,N,N,N,N,51746,N,N,N,16506,N,N,
+51747,N,N,N,24431,51748,N,51749,24423,N,14119,N,51750,N,N,24429,N,N,51751,N,
+19792,24432,N,N,N,29734,51752,51753,N,N,N,15695,51754,N,51755,N,N,N,N,N,24433,
+N,N,N,24434,N,N,51756,51757,18222,51758,51759,N,N,N,N,N,24436,51760,N,N,N,
+24437,51761,51762,51763,N,18227,51764,N,N,N,17781,24439,N,51765,51766,N,24441,
+N,20053,N,24438,51767,24440,12653,51768,24435,N,51769,51770,N,51771,N,N,21339,
+24442,N,N,N,N,16743,15160,24444,N,N,N,N,24443,16164,21081,N,N,N,N,N,N,24445,N,
+N,51772,24609,N,24430,24446,N,51773,24610,51774,N,N,N,N,N,18298,51775,51776,
+51777,N,N,N,24611,N,N,24612,N,N,51778,N,N,N,51779,N,N,51780,24613,N,51781,N,
+51782,N,N,N,N,51783,N,N,N,24614,N,17502,51784,24616,24615,N,51785,24617,N,
+24618,N,51786,15455,18787,N,51787,51788,19564,24619,24620,16726,15396,24621,
+24622,51789,51790,51791,N,51792,24623,19026,18503,N,N,24624,18263,N,51793,
+51794,51795,N,17453,51796,N,51797,51798,N,24625,12903,51799,13677,51800,19526,
+51801,19510,51802,12852,20276,51803,N,N,N,19282,51804,18986,N,51805,N,N,51806,
+51807,N,51808,16439,N,24626,N,N,51809,51810,17987,N,51811,51812,14371,24627,
+51813,14932,24629,24628,N,51814,N,N,24630,N,51815,N,N,N,51816,51817,N,N,N,
+24631,51818,N,N,24632,N,N,N,N,51819,N,N,N,N,13630,N,24633,N,N,N,N,24634,51820,
+N,N,N,14372,51821,51822,18504,N,51823,24636,N,51824,N,15989,N,N,24635,N,N,N,N,
+51825,N,N,51826,13880,24637,24639,N,24638,51827,N,51828,N,N,51829,N,24640,N,
+14417,N,24641,N,N,51830,51831,13929,51832,16704,N,14717,N,N,N,51833,24643,
+24644,24642,N,N,51834,N,N,N,15469,N,N,17992,13881,N,N,N,N,N,51835,51836,N,N,
+24646,17196,24645,51837,51838,20277,18274,52001,52002,N,52003,52004,N,52005,N,
+N,24649,52006,N,52007,N,N,N,N,52008,52009,N,N,24651,24648,52010,52011,N,19540,
+24650,24652,52012,20036,N,N,52013,N,52014,24656,N,52015,52016,24655,17270,
+18221,52017,N,14373,24654,N,52018,52019,N,24653,52020,19761,19762,N,N,52021,
+52022,N,52023,24657,12654,N,N,N,52024,14710,15202,N,N,N,N,N,N,N,52025,24658,
+24659,52026,N,52027,N,N,N,52028,24661,52029,N,N,N,N,52030,52031,52032,52033,N,
+N,15683,N,N,52034,52035,24663,52036,24662,52037,52038,N,52039,52040,24664,
+52041,13133,N,N,24666,N,52042,24665,52043,24668,24667,52044,N,N,N,52045,52046,
+N,52047,14396,52048,52049,20008,N,13900,N,12838,N,N,52050,N,52051,N,N,52052,N,
+52053,13930,52054,52055,N,N,N,52056,N,52057,52058,52059,N,52060,N,N,52061,
+52062,N,N,13409,52063,52064,N,52065,N,N,N,N,20072,24670,N,52066,N,52067,N,
+52068,N,24672,52069,52070,N,52071,24673,N,12881,N,N,52072,52073,N,24669,52074,
+15161,52075,52076,17473,24671,52077,N,N,52078,52079,N,N,52080,N,N,52081,N,N,N,
+52082,24676,N,15470,52083,N,52084,N,24674,52085,52086,N,52087,14142,N,N,18505,
+24675,N,N,24702,N,N,52088,52089,N,52090,24681,52091,52092,52093,N,52094,14397,
+52257,52258,52259,N,13669,52260,24678,19837,52261,N,20016,52262,N,N,N,N,N,N,
+52263,N,N,N,N,N,N,N,N,52264,52265,N,N,N,N,N,N,17014,N,52266,24680,52267,N,
+52268,52269,52270,52271,52272,52273,52274,52275,52276,52277,24682,20054,13911,
+18556,18250,N,N,52278,24683,N,N,N,N,24685,52279,24688,N,52280,52281,N,52282,
+52283,N,N,N,52284,N,52285,N,N,N,52286,52287,N,N,24684,N,52288,N,24687,14442,
+12621,24689,52289,16240,24686,20060,N,52290,24692,29732,N,52291,52292,52293,
+24690,24693,52294,N,52295,52296,24679,24691,52297,52298,14908,N,N,24694,N,N,N,
+N,N,N,N,24695,N,52299,52300,N,19838,N,52301,52302,52303,N,52304,N,24696,N,N,N,
+52305,52306,52307,52308,N,N,N,N,N,52309,52310,52311,N,52312,N,24697,52313,
+52314,52315,24677,52316,N,N,52317,24698,52318,52319,52320,52321,N,N,52322,
+52323,13380,52324,52325,N,N,52326,N,N,N,52327,N,52328,N,15397,N,52329,N,N,N,N,
+N,N,N,N,52330,52331,24699,N,52332,N,N,24700,52333,N,N,52334,24701,N,N,N,52335,
+N,52336,52337,12603,N,52338,52339,24865,N,18747,24866,52340,N,13348,24867,
+52341,24868,52342,52343,N,N,24869,52344,24871,24872,24870,N,52345,N,18771,
+24874,24873,N,52346,52347,52348,N,N,52349,24876,24875,24877,52350,N,N,N,N,N,
+24878,24880,24879,N,N,14713,52513,24882,N,24881,52514,52515,13381,N,16211,N,
+17724,N,24883,16440,52516,52517,N,15162,52518,12665,24884,52519,19793,52520,
+52521,19043,24885,N,N,52522,17732,19763,14659,16189,N,N,52523,17227,21044,
+52524,17454,12904,24886,52525,52526,52527,52528,N,N,52529,24887,N,24892,52530,
+52531,24890,24889,23106,13094,24888,52532,12378,52533,18474,52534,N,18506,N,N,
+52535,N,20017,24893,24891,17244,16422,52536,52537,18475,52538,18733,N,24895,
+20012,14157,24896,N,24894,18518,24897,N,24898,N,52539,12379,52540,N,15990,
+24903,N,24900,18029,24899,52541,52542,52543,52544,52545,52546,13606,N,52547,
+24906,N,N,52548,24901,24902,N,24905,24904,18725,N,N,16706,16705,52549,13631,
+52550,52551,24907,52552,N,N,N,52553,24908,N,52554,24909,N,N,N,N,52555,24911,
+52556,24910,N,N,N,N,N,12630,N,N,N,N,N,24919,18536,24913,52557,24915,N,N,24917,
+16190,52558,N,24918,24916,15424,52559,52560,52561,24912,24914,52562,18754,
+52563,15945,N,N,24921,N,52564,24920,52565,52566,N,N,24922,N,15398,14895,N,
+52567,17783,24923,N,17483,52568,N,24925,52569,52570,52571,20001,24924,52572,N,
+N,52573,N,16745,N,N,52574,N,52575,52576,24930,52577,24932,24933,17236,N,N,N,N,
+52578,24931,N,24928,N,24926,24927,52579,24929,52580,52581,52582,N,N,52583,
+52584,24936,52585,24934,52586,24935,N,52587,N,N,52588,52589,N,52590,52591,N,N,
+52592,N,52593,52594,52595,52596,24937,24939,24940,24941,52597,24942,52598,
+52599,24938,N,52600,N,N,N,52601,N,N,24944,N,52602,52603,24943,52604,N,N,52605,
+52606,52769,24945,52770,N,N,N,52772,52773,20037,52774,52775,52776,24948,24946,
+24947,52777,52771,52778,13410,N,N,N,N,N,19582,N,N,52779,19018,N,24950,52780,N,
+N,24949,N,N,52781,N,24951,24952,N,52782,52783,N,24956,24953,24954,24955,N,
+24957,52784,52785,52786,24958,52787,25121,N,52788,N,25122,N,25123,N,18479,
+17744,25124,18290,18740,N,25125,52789,N,25126,17706,52790,13095,14660,25127,N,
+N,25128,52791,52792,25129,N,15145,N,N,25131,N,52793,25130,N,N,25132,25133,
+52794,52795,52796,N,52797,52798,N,52799,52800,52801,52802,52803,52804,52805,N,
+52806,N,N,52807,18537,N,25134,N,N,N,25135,N,N,29545,25136,25137,25138,N,N,
+52808,N,15150,N,52809,25139,18262,N,52810,19295,N,12622,52811,12631,52812,
+52813,25140,52814,N,N,N,25142,N,52815,N,25141,17776,N,52816,N,16441,23865,N,
+25143,19521,52817,25144,N,13382,18519,25145,52818,25146,52819,N,25147,N,52820,
+N,19548,N,52821,52822,19541,N,17470,N,52823,N,16746,52824,N,25149,52825,N,
+15714,52826,15946,N,N,25152,N,52827,25151,25150,18557,52828,13383,14377,N,
+52829,N,N,N,52830,N,52831,52832,N,52833,N,52834,52835,25158,52836,N,25155,
+16191,19506,N,52837,N,25154,25156,25157,N,52838,25153,N,N,N,52839,52840,52841,
+N,N,N,N,52842,52843,52844,25159,25160,52845,17455,N,13411,52846,52847,N,17253,
+N,52848,N,N,52849,52850,25161,N,N,52851,N,N,52852,52853,52854,N,N,52855,N,N,N,
+52856,52857,N,N,25162,25165,52858,N,52859,52860,52861,16231,52862,17988,53025,
+25166,19283,53026,25163,N,53027,25164,53028,N,N,N,53029,N,53030,53031,53032,N,
+N,N,N,25169,53033,N,N,53034,25168,25167,53035,N,N,N,53036,N,N,N,N,N,N,25171,
+53037,53038,25170,N,N,25172,N,N,53039,53040,53041,N,N,N,53042,N,N,N,25174,
+53043,25173,N,53044,N,N,19021,N,53045,N,N,53046,N,15702,20038,53047,53048,
+25175,53049,N,17975,N,53050,25176,N,N,25177,N,25181,25179,25180,53051,25178,N,
+N,N,53052,N,N,N,25182,N,53053,N,N,N,25183,N,N,N,53054,53055,N,N,53056,N,25184,
+N,53057,25185,19511,25186,N,53058,53059,53060,N,19568,25187,53061,17230,53062,
+18282,N,13931,53063,N,53064,17211,25188,13882,53065,53066,N,16464,53067,N,N,N,
+53068,N,N,53069,25189,14909,N,N,53070,53071,N,N,53072,N,N,25190,53073,53074,N,
+N,53075,25191,N,14374,14933,N,N,N,N,N,N,N,53076,N,N,25193,53077,53078,53079,N,
+17750,14934,13646,N,N,N,N,N,53080,53081,N,53082,N,19236,N,18251,53083,N,53084,
+N,N,17751,N,N,N,N,14684,N,N,N,53085,53086,25195,N,53087,53088,N,N,N,53089,N,
+53090,N,N,N,53091,N,N,N,N,N,N,N,N,N,53092,15947,53093,N,53094,53095,N,53096,
+53097,N,N,N,53098,N,53099,20018,14661,N,53100,14375,N,N,18467,N,25197,N,N,N,N,
+N,53101,N,25199,N,53102,N,N,14443,N,N,N,N,25198,17526,N,N,53103,N,25201,13111,
+25196,53104,N,18538,N,12592,53105,14956,N,20306,53106,N,25200,N,N,53108,53109,
+53110,N,53107,N,25202,53111,N,N,19019,53112,16473,25204,N,53113,53114,N,25205,
+53115,53116,53117,53118,N,25203,N,N,N,N,13134,53281,25211,53282,25210,53283,N,
+15399,N,N,N,25212,25207,53284,53285,53286,25213,25208,53287,N,53288,N,18520,
+25206,53289,53290,25209,53291,53292,N,N,N,25378,53294,N,N,N,53295,53296,53297,
+N,N,53293,N,53298,25377,19297,N,53299,N,25214,N,N,12395,N,N,53300,53301,25380,
+N,53303,53304,N,N,53305,53306,N,25379,N,53307,53302,15948,N,N,N,N,53308,25381,
+N,N,N,N,53309,N,16707,N,53310,25383,25382,N,N,N,N,N,N,25384,53311,N,53312,N,
+53313,53314,53315,N,N,N,N,53316,25192,53317,N,53318,25194,25386,25385,53319,N,
+N,N,53320,N,N,53321,53322,N,N,N,N,15400,53323,20073,53324,15442,53325,25387,
+14135,N,N,53326,53327,53328,13632,13607,15203,53329,53330,N,N,N,53331,19764,
+53332,N,25393,53333,25392,16708,25389,53334,N,25391,53335,53336,15691,16192,
+25390,25388,N,18218,N,N,15949,N,53337,18748,53338,N,53339,N,14935,N,N,N,N,
+53340,N,N,N,N,17784,N,53341,25394,53342,53343,N,53344,25395,25417,13912,N,N,
+20285,16693,N,N,N,N,25396,53345,53346,12882,17527,18977,N,53347,N,53348,53349,
+53350,53351,N,53352,N,N,53353,53354,25397,N,N,N,53355,N,N,N,N,13690,25398,
+53356,53357,25400,53358,N,N,25401,53359,18217,53360,N,25402,53361,N,N,N,53362,
+25403,25404,53363,N,13913,12883,17989,15656,15204,53364,N,53365,N,N,53366,
+53367,25405,53368,15657,N,N,N,53369,N,12874,18755,N,53370,25406,53371,N,18539,
+N,53372,N,N,53373,53374,16709,53537,25409,53538,25410,18281,53539,16193,25407,
+N,17249,53540,53541,25408,53542,N,N,15950,53543,N,N,N,N,N,N,53544,N,N,12380,
+53545,13609,N,53546,53547,N,N,N,53548,25411,53549,53550,17528,53551,25412,
+16455,N,N,53552,N,N,19501,53553,N,18723,25413,25414,17237,53554,20039,N,53555,
+25416,25415,53556,N,N,N,N,N,53557,N,N,N,53558,N,53559,15471,53560,53561,25418,
+12400,N,53562,53563,N,25421,53564,53565,53566,25419,12884,14158,25420,14662,
+14706,N,19046,25422,53567,53568,19284,53569,53570,25424,N,N,53571,16465,12623,
+12858,12332,N,N,N,N,53572,53573,25423,N,53574,N,N,53575,53576,N,53577,53578,
+25425,25426,15991,N,53579,N,53580,N,25427,53581,13135,N,53582,N,N,25429,N,N,N,
+14186,53583,13670,N,53584,25430,13941,N,N,25431,53585,16508,53586,17997,53587,
+16480,14965,53588,53589,N,25432,N,53590,53591,N,N,N,N,53592,53593,17250,16747,
+53594,25434,25436,25433,25435,N,N,N,N,N,53595,14114,53596,N,N,53597,N,N,N,N,N,
+25437,14118,N,53598,N,13671,19794,25439,N,N,53599,N,53600,25440,N,N,53601,
+12590,53602,53603,N,N,25443,N,N,N,13174,25442,25441,53604,25445,25438,53605,
+25446,20009,53606,25447,53607,25448,N,53608,21620,25450,N,25449,N,N,N,25451,
+25452,53609,20021,25453,N,28783,15951,25454,25455,15703,N,17976,25456,N,53610,
+53611,17192,53612,53613,25457,N,17212,25458,53614,N,N,53615,N,13861,N,20799,
+17245,15411,53616,N,53617,53618,13384,25459,N,25634,N,25462,53619,13672,N,
+25461,25636,N,N,N,25460,N,15952,N,N,53620,N,N,N,25464,25465,N,17707,N,N,25466,
+53621,13150,N,N,53622,N,16218,18788,53623,25468,53624,53625,53626,17000,53627,
+53628,53629,53630,53793,N,25463,53794,25467,25469,N,N,14971,N,N,N,53795,N,
+53796,53797,53798,N,N,N,25638,18734,53799,18470,17785,N,13914,25637,25635,
+53800,18485,25470,17246,17787,N,17786,53801,14966,N,N,N,N,N,N,25656,N,N,53802,
+N,N,N,53803,25640,53804,25642,N,53805,53806,N,25645,53807,25646,53808,25643,
+25644,53809,53810,25641,25639,N,53811,N,N,25633,N,N,N,N,N,N,N,N,N,53812,N,
+19023,12885,N,53813,N,25653,N,25650,53814,25655,53815,53816,25654,N,18291,
+19495,53817,15163,25648,25657,25652,53818,25651,25647,53819,25649,53820,13385,
+N,N,N,53821,N,N,N,N,17213,N,53822,16509,N,53823,53824,18466,53825,N,25662,
+53826,53827,N,18468,N,53828,53829,53830,53831,N,N,16481,25659,53832,N,18511,
+53833,25663,19027,53834,17243,53835,25658,25660,N,N,25661,N,N,N,N,53836,N,
+53837,53838,N,53839,53840,53841,N,25664,N,N,15428,N,N,N,17990,25669,25668,N,
+53842,25665,53843,N,N,20278,N,N,N,N,53844,25674,53845,53846,25678,25675,53847,
+53848,53849,N,53850,N,53851,25671,53852,53853,53854,53855,N,53856,25672,N,
+53857,N,53858,53859,25677,53860,53861,N,25666,21077,25673,25667,N,N,25676,N,
+53862,N,53863,N,N,N,25682,53864,13386,N,25679,N,53865,53866,25680,53867,N,
+25681,25684,53868,N,N,N,N,53869,N,53870,53871,N,53872,25683,18550,53873,53874,
+N,N,25685,20092,19053,25690,N,N,25687,N,N,53875,N,N,N,53876,N,25686,16466,N,
+25689,25691,53878,53879,53880,25688,53877,25695,N,25692,53881,53882,53883,
+53884,53885,53886,25693,25670,54049,N,54050,25694,25696,N,54051,N,54052,N,N,
+25697,54053,54054,N,54055,N,54056,19014,N,25698,N,N,N,54057,N,N,54058,54059,
+19554,N,N,13902,14121,25699,N,N,54060,54061,N,18996,N,16232,N,19504,N,54062,
+25700,N,20019,N,54063,18292,N,16710,18228,N,N,15693,N,N,54064,12352,54065,
+25705,25703,N,25701,13345,54066,15953,25706,N,N,25704,N,25702,25710,N,54067,
+25709,25708,25707,N,N,54068,54069,N,25711,54070,54071,54072,25712,16442,54073,
+25713,N,25715,N,54074,25714,N,54075,54076,54077,14418,N,N,54078,16696,54079,N,
+N,25717,54080,54081,54082,17788,54083,25716,54084,54085,N,25718,54086,18997,
+16748,14663,N,25719,N,N,N,54087,20040,N,54088,N,54089,N,N,N,25721,N,N,25722,N,
+25723,54090,25724,N,15205,N,25725,14159,N,N,13674,13610,N,25889,54091,19571,
+14664,25726,54092,54093,54094,25892,19558,N,18236,N,54095,18739,54096,54097,
+54098,15715,25891,54099,15443,14665,15206,13673,18998,25890,54100,54101,N,
+16711,19266,14967,54102,N,N,54103,N,N,N,54104,15207,17501,54105,25895,20063,
+14937,54106,25896,16194,N,25898,N,N,N,15954,14896,N,54107,54108,54109,25897,
+54110,54111,15658,14398,16712,25893,25899,54112,54113,N,N,25894,14160,54114,
+25902,25906,14187,54115,N,54116,N,N,25901,54117,N,54118,54119,25910,54120,
+54121,14666,N,N,19821,12348,25907,N,54122,13675,54123,25904,N,54124,N,N,N,
+25905,N,54125,17789,25903,25900,N,13096,16484,N,54126,14376,54127,54128,N,
+25912,N,54129,N,54130,54131,54132,N,54133,54134,N,54135,25909,N,54136,54137,
+54138,N,25911,N,54139,N,25908,N,N,54140,54141,N,14161,16947,25913,16750,54142,
+54305,25926,N,N,25922,25916,N,N,54306,54307,N,N,54308,25920,15482,12381,25915,
+25923,25927,14667,19542,54309,17494,25917,54310,54311,25925,54312,25914,17214,
+N,25919,12349,19530,N,N,54313,54314,54315,54316,54317,25918,N,N,13915,18540,
+54318,54319,54320,16749,N,20048,15727,N,N,25966,N,54321,25928,54322,16510,N,
+25924,25929,25931,N,17529,25934,54324,N,25930,54325,54326,N,19028,13387,54327,
+54328,19531,54329,N,12382,N,54330,25933,N,20093,54331,54332,N,N,54333,54334,
+25932,54323,12655,N,N,18028,25935,N,N,54335,25942,25936,25943,N,N,N,N,54336,
+54337,25939,N,N,54338,N,54339,N,N,N,18299,54340,54341,15434,25941,54342,25938,
+25944,25937,N,N,15684,54343,54344,N,N,19237,54345,54346,15692,54347,N,25940,
+25952,54348,N,25948,54349,25951,N,25949,25953,25947,N,25921,16467,54350,N,
+18507,N,25950,54351,54352,25945,54353,N,N,16673,14162,N,15659,54354,N,54355,N,
+54356,N,16165,16694,25956,N,54357,25958,25959,N,N,25955,25957,54358,N,54359,
+54360,N,N,54361,25946,25954,N,25962,25961,54362,N,19322,54363,54364,14123,N,N,
+54365,N,N,N,N,54366,25960,N,25964,25963,25967,54367,25969,N,54368,15164,25965,
+N,N,54369,54370,25970,25971,54371,N,25972,54372,25978,17723,25974,54373,25973,
+25975,25976,54374,25977,N,54375,N,54376,25979,25980,54377,54378,13388,N,25981,
+N,25982,54380,54379,54381,54382,54383,N,N,N,54384,54385,26145,N,54386,N,N,N,N,
+26146,26147,26148,54387,26149,26150,54388,54389,26152,26151,N,N,26153,N,N,
+54390,54391,54392,N,26154,26155,54393,N,54394,54395,54396,54397,26158,26156,
+26157,14945,14163,N,54398,17238,N,18483,54561,15728,N,N,18253,N,18541,26159,
+22637,N,N,N,54562,54563,54564,54565,N,26160,26162,N,19813,26161,26164,26163,N,
+19795,54566,26165,54567,18558,54568,54569,54570,N,N,26166,N,54571,54572,N,N,
+26169,N,54573,26168,26167,N,N,54574,54575,26170,14130,N,54576,N,16674,13633,
+54577,N,N,54578,26174,26171,N,N,26172,N,54579,N,26175,N,26176,26173,N,N,54580,
+12585,N,54581,54582,12839,N,54583,N,26178,26179,N,54584,N,26180,N,19810,N,
+54585,54586,N,N,15660,N,26182,26181,N,N,N,N,N,54587,N,N,N,54588,16233,26183,N,
+54589,N,54590,26184,N,54591,26185,N,13413,54592,N,54593,54594,13389,N,54595,
+26186,N,N,N,N,N,26187,54596,19293,19811,54597,54598,54599,19796,20279,N,14669,
+26190,15444,26189,54600,54601,N,54602,26191,15401,54603,54604,54605,16977,
+54606,26192,54607,54608,14668,54609,19543,26193,26194,N,N,26195,54610,54611,
+54612,54613,26196,N,N,54614,N,54615,N,26197,N,N,N,54616,N,54617,N,54618,N,N,
+15402,54619,54620,19565,54621,N,54622,54623,26199,54624,17215,54625,26198,
+54626,N,N,N,54627,N,26201,N,N,N,26200,N,N,N,N,N,N,N,26202,N,N,N,16443,N,26203,
+N,26204,N,N,N,19001,26205,54628,16751,26206,N,54629,N,54630,N,26207,N,N,N,N,
+54631,N,20094,26210,54632,26209,26208,17456,54633,26211,16166,N,26212,N,N,N,
+26213,20280,26214,N,54634,N,N,26215,26217,26216,18469,54635,18041,N,20286,
+18473,N,54636,N,N,N,N,26219,N,N,15955,N,18730,N,26220,26218,54637,13390,54638,
+N,N,14420,15208,N,N,18542,54639,54640,N,14378,19267,54641,26223,26221,N,14670,
+N,14671,12393,N,14952,N,N,N,54642,54643,18265,N,N,N,N,N,N,N,N,12383,26228,N,
+17216,N,54644,N,N,N,18264,54645,16987,54646,N,N,54647,N,54648,54649,26230,
+54650,54651,26226,26229,26224,N,26227,19238,N,54652,14421,N,N,12413,26225,N,N,
+N,N,N,N,N,54653,54654,26232,54817,26233,54818,54819,17977,N,54820,N,13883,
+54821,54822,N,26406,18237,54823,15209,54824,N,13884,16456,20294,19502,26231,
+16468,54825,N,N,N,N,N,N,N,N,N,N,54826,54827,54828,N,13651,26234,54829,N,54830,
+N,54831,N,N,26236,54832,N,N,54833,N,26235,N,N,54834,N,N,26237,54835,17190,N,
+18238,N,54836,N,N,N,17457,54837,N,54838,N,26403,N,N,N,N,N,N,54839,26402,54840,
+N,N,54841,26238,54842,N,16213,N,18789,26405,54843,26404,14672,20307,N,54844,N,
+N,N,N,N,N,N,26421,54845,54846,N,N,N,26409,26410,54847,54848,54849,N,15472,N,
+54850,26408,54851,14712,26407,N,N,26411,N,N,54852,17458,18978,16675,N,N,N,N,
+16988,26415,54853,26416,26412,54855,54856,54857,N,26413,N,26414,54858,N,N,
+54859,14673,54854,N,N,26422,N,26418,54860,N,54861,N,18790,54862,19308,18728,
+54863,N,26417,N,54864,26420,26419,N,N,N,19268,26423,N,N,N,N,54865,N,26424,N,
+54866,16695,54867,26425,N,N,26427,N,26431,54868,N,26428,26426,18239,26429,N,
+26430,54870,N,54871,12850,N,26437,26432,54872,54869,N,26433,54873,54874,N,
+26434,N,16929,N,54875,N,54876,26436,26435,26438,54877,N,54878,54879,26439,
+26440,54880,N,16195,54881,12905,N,26441,20055,N,15403,54882,54883,15661,N,N,
+54884,54885,54886,15210,17239,54887,54888,N,54889,54890,26442,26443,12593,
+54891,26444,54892,54893,26445,26446,54894,N,26447,N,26448,13885,23082,26449,N,
+16485,26450,15435,54895,26451,N,20528,54896,54897,N,26452,19038,13404,54898,
+54899,16676,15704,54900,18801,15662,N,54901,54902,N,N,N,N,N,54903,26453,14674,
+26454,18508,N,26468,N,N,N,54904,26456,54905,16969,18293,14399,26455,16677,
+54906,N,N,N,N,N,26457,N,N,54907,54908,54909,54910,17530,N,N,N,55073,N,N,55074,
+55075,N,55076,N,N,N,N,55077,N,26459,26458,26461,N,55078,26460,N,26462,55079,N,
+26464,55080,26463,N,13391,55081,26465,N,26466,26467,N,55082,14897,20041,N,
+26469,16167,N,55083,N,12656,26470,26471,N,N,55084,N,55085,26472,55086,55087,
+55088,N,55089,55090,N,N,55091,N,55092,55093,12402,N,26473,55094,N,N,55095,
+26474,N,55096,N,55097,N,55098,18791,55099,55100,N,15431,N,26476,55101,55102,N,
+55103,55104,13097,12338,55105,55106,55107,55108,26475,26478,18254,55109,16196,
+55110,12886,55111,19239,55112,N,N,55113,14173,13916,55114,26477,55115,12906,
+55116,55117,N,N,N,N,N,13347,55118,N,N,N,N,N,N,N,N,N,55119,12657,26482,20074,
+16989,55120,N,18756,N,26494,55121,12887,26492,N,26490,26481,55122,26479,55123,
+26480,55124,15459,13932,17271,55125,N,55126,18001,N,55127,N,55128,N,12625,N,
+26484,26483,N,55129,55130,N,26489,26485,26488,N,55131,55132,55133,55134,19536,
+26487,12888,13181,26491,55135,55136,26493,55137,55138,N,N,14164,N,N,N,N,N,N,N,
+26659,26668,26669,N,N,55140,12331,55141,55142,55143,N,55144,55145,26676,N,N,N,
+N,12401,N,N,26667,55146,55147,55148,26666,55149,26661,26660,55150,26658,26657,
+17251,55151,17019,26663,55152,N,55153,55154,N,N,26662,N,55155,55156,55157,
+26665,N,55158,N,16752,14165,N,N,55159,55160,12609,26664,55161,14675,55358,
+55139,55162,55163,55164,16753,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+55165,N,N,26682,N,26683,N,12889,55166,N,N,12846,26680,55329,N,55330,55331,N,
+55332,N,55333,26670,55334,26678,N,26685,26679,N,N,55335,26677,N,N,N,55336,
+26486,55337,55338,26675,N,55339,55340,26671,55341,55342,55343,13392,26673,
+26684,N,26674,N,N,N,55344,55345,26686,55346,26672,18300,55347,55372,N,N,N,
+19817,N,N,N,26681,N,N,N,N,N,N,N,26703,55348,55349,55350,26695,N,N,N,16251,N,
+55351,N,55352,13638,N,13917,N,26690,55353,55354,55355,N,12891,55356,N,15956,N,
+26693,N,N,N,14938,55357,N,17745,26698,N,N,N,N,N,N,N,55359,19054,55360,26689,N,
+N,N,12890,14422,18729,26699,N,26687,N,55361,26696,55362,55363,N,26706,55364,
+26691,55365,N,26692,17978,N,55366,26697,N,N,55367,26694,19240,26700,12384,
+55368,N,55369,N,26688,N,55370,N,N,N,55371,N,N,N,N,N,N,26702,N,26701,N,N,N,N,N,
+N,18283,26708,N,26719,N,N,55373,N,13182,N,N,N,26722,N,N,26704,55374,N,N,26709,
+19822,N,N,N,N,N,N,N,55375,26718,55376,55377,19797,55378,N,N,55379,20010,55380,
+N,55381,55382,N,N,N,55383,17272,55384,55385,55386,13163,55387,N,N,N,55388,
+18802,26724,17953,55389,55390,12337,55391,N,26717,55392,26713,16754,26707,
+26715,26720,55393,18220,N,55394,55395,12330,55396,26712,55397,26721,18808,N,
+55398,55399,N,N,N,55400,26716,N,26711,55401,N,N,N,N,N,15957,N,N,N,N,15663,N,
+55402,55403,15404,55404,N,N,N,19544,N,N,18759,N,55405,26727,N,26736,N,N,N,N,
+55406,N,55407,55408,55409,N,N,26714,N,55410,N,55411,13175,N,55412,N,N,N,15992,
+26725,55413,26730,16755,55414,55415,26726,55416,26733,55417,N,17247,N,26734,
+55418,55419,19798,26723,13112,55420,26729,N,55421,26732,19500,N,55422,N,N,
+26735,N,N,26728,26731,N,55585,N,N,N,N,N,N,N,N,N,N,55586,N,N,55587,N,19241,N,
+20257,55588,55589,55590,55591,N,26739,N,N,55592,N,N,55594,55595,26746,55596,N,
+26738,15427,N,55597,55598,N,N,26705,55599,N,N,N,N,55600,N,55601,N,55602,19022,
+N,19490,26745,26744,N,26740,26741,N,12598,N,55603,N,55604,26743,N,26737,55605,
+55606,55607,55608,17493,55609,N,N,55610,55611,26742,12414,N,55612,N,N,55593,
+55613,55614,16930,55615,N,N,N,N,N,N,19011,N,55616,26747,26913,N,18521,N,N,
+55617,N,26750,15958,15433,26915,N,N,13886,55618,55619,55620,55621,55622,N,
+26916,55623,18809,26749,55624,26710,N,55625,55626,55627,55628,55629,55630,
+55631,26748,55632,N,N,N,20303,17954,18803,55633,N,26923,N,55634,N,N,N,N,N,N,N,
+26929,N,55635,55636,55637,N,55638,26930,55639,26917,55640,N,N,18294,55641,
+55642,26927,26919,55643,26921,55644,55645,N,N,55646,26931,26920,N,55647,26924,
+N,N,12658,55648,18021,N,26925,26928,55649,N,55650,55651,N,55652,N,26918,55653,
+16678,55654,26922,15143,16197,14128,19572,55668,19577,15730,N,N,N,N,55655,N,
+55656,55657,55658,26935,26933,N,55659,55660,55661,55662,N,20302,55663,N,N,N,N,
+55664,N,26932,55665,55666,N,19829,55667,26934,26936,N,N,N,N,26937,N,N,55669,N,
+55670,N,26940,26938,N,55671,55672,N,N,N,17955,26939,55673,N,55674,18509,26926,
+N,N,55675,N,N,N,N,N,55676,N,N,55677,15731,N,26941,26946,16756,55678,N,26945,
+55841,55842,N,26914,N,55843,55844,26947,16713,N,N,26942,26944,N,55845,55846,N,
+55847,55848,55849,26943,N,N,23857,23842,55850,55851,26949,55852,N,N,55853,N,N,
+55854,26948,N,N,N,N,55855,N,55856,N,N,N,19830,N,25148,26950,N,N,N,N,N,55857,N,
+55858,N,55859,N,55860,55861,N,26951,55862,47206,55863,N,N,N,55864,N,N,N,N,N,N,
+26952,14423,N,13652,N,55865,55866,26954,20829,55867,55868,55869,55870,13685,N,
+20026,55871,13939,26955,55872,55873,55874,55875,55876,N,N,26956,N,55877,N,
+17262,55878,N,N,55879,N,26957,N,N,N,55880,55881,55882,N,18042,55883,12346,N,N,
+N,N,N,N,N,N,N,N,N,N,55917,N,12899,26962,26963,55884,N,N,N,55885,N,26958,N,
+15165,55886,N,55887,N,55888,N,55889,N,N,N,N,55890,N,26959,18242,N,55891,55892,
+55893,26960,26961,26971,N,55894,N,26965,26968,55895,N,55896,55897,55898,26964,
+55899,55900,55901,N,N,N,N,N,55902,55903,55904,N,55905,26966,55906,26967,15448,
+N,26969,N,17217,N,14166,13122,N,N,55907,55908,N,26972,55909,N,55910,N,13119,
+55911,26977,55912,N,26973,26976,55913,N,N,55914,18490,55915,N,55916,N,26974,N,
+N,26975,18760,18522,26978,N,N,N,N,N,N,N,N,17021,26988,55918,26984,55919,55920,
+12907,26982,N,19242,26983,55921,55922,26980,55923,26981,26986,26989,55924,N,
+26987,55925,55926,55927,26985,26979,55928,55929,N,N,N,17240,55930,26996,N,
+19498,N,55931,55932,N,55933,N,55934,N,26994,N,N,56097,26995,N,N,N,N,56098,
+56099,N,56100,56101,N,26990,N,N,26992,N,56102,56103,26993,56104,56105,56106,
+26991,56107,N,N,56108,N,56109,N,N,N,16486,N,20281,27000,56110,27001,N,N,N,N,
+27169,N,16170,N,27003,56111,27006,N,N,N,56112,N,26998,26997,56113,N,27170,
+56114,56115,12892,N,27004,N,27171,N,N,N,27005,56116,N,56117,56118,N,27002,N,
+17459,N,26999,N,N,56119,N,N,N,18280,N,N,27175,56120,56121,56122,56123,56124,
+56125,56126,N,56127,56128,19771,N,N,56129,N,N,56130,N,56131,N,56132,56133,
+56134,N,N,N,N,56135,27174,56136,N,27173,56137,N,N,N,56138,N,N,N,27182,56139,
+56140,56141,27176,N,56142,N,27184,N,56143,N,N,N,N,19814,27187,N,27178,56144,
+56145,27179,56146,N,N,27183,N,27186,27185,56147,56148,56149,27177,N,N,56150,N,
+27180,N,27197,N,N,56151,56152,N,N,56153,56154,N,56155,N,N,56156,27190,N,56157,
+56158,56159,N,N,N,N,N,56160,56161,N,56162,N,27188,N,56163,27189,56164,N,N,
+27194,27195,56165,13098,56166,13634,N,N,27193,56167,56168,N,56169,N,27172,
+56170,N,N,56171,56172,56173,N,27192,27196,27191,56174,27198,56176,56177,56178,
+27200,27199,N,56179,56175,56180,56181,56182,N,56183,56184,N,27202,27201,26970,
+N,N,N,27206,56185,N,N,N,N,56186,56187,N,56188,27203,56189,N,N,56190,27204,N,N,
+27205,56353,27207,56354,N,N,N,14188,56355,27209,56356,27208,56357,15664,N,
+56358,56359,56360,56361,14676,24103,56362,N,N,56363,27210,15697,N,56364,56365,
+13113,56366,27211,56367,12626,56368,15959,27212,56369,56370,14677,27213,12385,
+56371,N,N,N,18749,56372,N,27214,N,N,N,N,16234,56373,27221,N,N,27218,N,17263,N,
+56374,N,56375,N,27219,27216,13918,56376,27215,27222,N,N,N,N,N,14134,N,N,16990,
+N,27228,N,N,N,N,27224,N,N,N,16949,27223,56377,27226,56378,56379,56380,N,27217,
+56381,56382,N,27227,N,27229,N,N,N,56383,N,56384,18543,N,N,27225,N,27230,27232,
+N,N,14419,27220,N,12353,N,N,56385,N,N,56386,56387,27231,56388,14939,20086,
+27233,27234,16757,N,N,N,N,56389,56390,56391,56392,56393,20002,N,56394,56395,
+56396,27235,19765,N,N,27236,27237,N,56397,19044,27238,56398,14912,N,20003,N,N,
+N,N,N,56399,27243,N,N,N,N,N,N,56400,56401,56402,27244,15960,27242,56403,N,
+56404,19815,27239,N,N,27241,16445,16254,56405,27240,N,27245,N,56406,18979,N,N,
+27247,N,27246,56407,56408,56409,13164,N,19243,27248,N,56410,56411,N,56412,
+56413,56414,N,56415,27260,27250,N,56416,N,N,N,N,27251,56417,56418,56419,N,
+27252,27253,N,N,N,N,56420,56421,56422,N,N,56423,27257,N,27258,56424,56425,
+27256,N,N,56426,N,56427,27254,56428,27249,27255,56429,56430,N,N,56431,N,N,
+27259,28727,N,56432,N,N,56433,N,N,N,12840,56434,N,N,56435,56436,56437,N,27262,
+13919,27261,56438,56439,56440,27426,N,27425,N,N,N,27428,56441,N,27427,56442,
+27429,56443,N,15665,56444,27430,56445,N,27431,N,N,56446,56609,56610,56611,
+27432,16446,N,19799,N,27433,N,N,18980,18246,27434,56612,27435,14379,N,56613,N,
+13612,56614,N,N,27436,56615,56616,15211,18241,27437,N,13136,56617,56618,N,N,
+56619,56620,27438,N,N,N,56621,27440,19831,N,27439,16198,N,27441,N,N,27442,
+56622,N,27443,13393,56623,56624,56625,56626,N,N,27444,N,56627,27445,N,27446,
+27447,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,13137,N,56628,56629,56630,56631,56632,
+N,27448,N,27449,27450,N,N,N,N,N,12914,N,56633,16168,27451,N,56634,N,56635,N,
+56636,N,N,N,56637,N,56638,27452,N,56639,N,27453,56640,N,N,N,56641,N,56642,
+14400,N,17531,27454,56643,56644,N,56645,14167,N,16214,N,27457,N,17956,56646,
+27456,56647,56648,14129,56649,56650,27455,17015,13613,N,N,27458,N,27459,56651,
+15961,56652,N,56653,14189,56654,27460,56655,N,N,N,19244,56656,56657,16479,N,
+56658,N,13686,N,19573,16714,56659,27461,56660,N,N,16199,17264,15962,56661,
+56662,N,56663,27462,N,56664,N,56665,27465,56666,27466,56667,N,N,N,56668,56669,
+N,14910,16962,27464,56670,15963,18750,56671,56672,56673,N,N,27463,56674,56675,
+15212,N,12627,56676,27470,14168,N,56677,15214,56678,N,15213,N,20301,27469,
+27468,16679,N,13645,20291,13114,15964,N,56679,56680,56681,N,56682,56683,56684,
+27467,N,56685,56686,56687,N,27472,56688,27473,27471,56689,14424,N,19776,N,
+56690,15215,18215,N,56691,56692,27476,56693,16448,N,17218,56694,56695,19766,
+56696,27479,N,N,N,14444,56697,16447,27475,N,27480,14445,27477,27478,56698,
+27474,56699,N,N,16482,17993,56700,56701,17199,N,12893,56702,N,N,56865,56866,N,
+18544,N,56867,13635,N,56868,17460,N,N,27483,56869,27481,N,56870,17228,56871,
+56872,56873,16449,13394,27482,N,16219,N,56874,20042,56875,56876,56877,20288,
+56878,N,N,27484,27495,17461,56879,27494,56880,27491,27499,27492,N,27488,N,
+17532,27487,N,N,N,27485,56881,19745,15216,N,56882,27489,N,27486,56883,56884,
+56885,27493,15732,N,14401,N,56886,N,17018,56887,19269,12634,12386,N,17957,
+56888,56889,27497,N,N,56895,56890,27496,N,18022,N,27501,56891,N,N,27490,N,
+27500,27502,N,14380,27498,14678,56892,15445,56893,56894,27503,19800,N,N,N,N,
+27506,N,27509,N,N,27507,18741,56896,N,N,56897,N,N,27504,N,N,N,56898,N,13920,N,
+N,56899,N,27508,N,N,27510,56900,56901,56902,56903,56904,N,56905,27514,N,N,
+27511,56910,27513,27512,N,N,56906,56907,56908,N,27515,N,15409,56909,27517,
+27516,18792,N,56911,27681,N,N,N,56912,N,N,14169,N,N,N,N,27518,27682,56913,N,
+27683,13636,26177,15993,N,27684,N,56914,14446,56915,56916,N,N,56917,27685,
+56918,N,27686,56919,N,15166,56920,56921,N,N,N,N,23118,56922,27687,56923,27688,
+56924,15666,N,27689,27690,56925,56926,27691,N,N,27692,27693,N,56927,N,56928,
+56929,17195,56930,56931,27694,N,N,56932,56933,27696,N,27695,N,N,N,56934,17958,
+56935,27697,56936,19245,56937,27698,N,27699,56938,27700,56939,N,56940,56941,
+27701,N,56942,56943,56946,18010,56944,N,56945,N,N,N,15965,27702,56947,56948,N,
+56949,N,56950,56951,14699,20526,27703,56952,N,N,N,N,N,56953,N,56954,56955,N,
+27704,18751,27705,56956,27713,N,56957,N,N,N,27706,N,N,27708,56958,57121,N,
+27707,27709,57122,19270,27710,27711,N,57123,N,57124,57125,27712,N,N,N,27714,
+57126,N,57127,57128,13101,17511,N,18793,14946,14679,N,57129,N,N,18767,12895,
+18510,27717,13395,16469,27716,27721,17273,19555,N,27719,27720,13614,N,27722,
+18275,16991,57130,57131,18545,17725,27718,N,19271,12908,27724,20264,17474,
+20293,57132,57133,15217,27723,57134,16945,57135,N,27740,16680,57136,N,18040,N,
+18768,N,57138,57137,N,N,57139,27727,15167,15218,57140,15966,N,18277,57141,
+14381,27726,27725,N,18794,N,57142,N,15425,N,57143,17746,N,57144,57145,N,57146,
+N,N,57147,N,57148,57149,N,27729,27730,14680,27728,57150,57151,57152,N,57153,
+27731,27732,N,27734,16931,57154,27733,13414,N,27736,N,27735,27737,N,57155,
+27739,27741,N,27742,57156,N,N,N,57157,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,16470,57158,15439,27743,N,57159,N,13138,57160,27744,
+57161,N,16758,27745,N,27746,18795,N,N,13615,N,N,N,N,N,N,N,57162,N,27747,57163,
+N,57164,17462,N,N,57165,N,12635,N,N,57166,N,N,57167,57168,N,N,N,57169,N,N,N,
+27748,N,N,N,N,57170,57171,57172,N,N,15473,N,N,57173,N,16246,N,N,57174,57175,N,
+N,57176,N,N,57177,16941,N,57178,N,57179,N,57180,27751,57181,57199,N,27750,N,
+57182,N,27749,N,N,57183,57184,57185,57186,N,57187,27757,27755,N,57188,27752,N,
+57189,N,N,57190,57191,27754,57192,N,57193,27753,27756,N,13687,N,27760,N,16471,
+N,27761,57194,57195,N,57196,14425,N,27758,27759,57197,N,N,20265,57198,57200,
+57201,17463,57202,16681,N,N,N,N,N,N,27762,57203,N,27765,57204,N,N,57205,57206,
+57207,N,27763,27764,19801,57208,N,N,N,17959,27768,57209,N,N,57210,N,57211,N,N,
+N,N,N,N,27766,27767,27769,57212,57213,57214,57377,N,N,57378,57379,N,N,27945,N,
+N,N,N,N,27772,57380,N,57381,27773,27771,57382,57383,57384,57385,N,N,N,57386,N,
+N,57387,57388,27770,N,17533,N,N,27937,27941,27938,27774,57389,27939,57390,
+57391,57392,27940,N,N,N,57393,27947,N,N,N,27942,N,57394,57395,57396,57397,
+16472,27944,57398,57399,27946,27943,N,N,N,N,57400,N,N,57401,57402,N,57403,
+57404,57405,27949,N,15667,N,27948,N,N,57406,57407,57408,27950,N,N,N,N,27951,
+57409,57410,27954,27953,N,27952,N,57411,27956,27955,N,19574,N,N,57412,27958,
+57413,27957,27959,57414,N,N,N,27960,57415,57416,N,57417,57418,N,N,27962,57419,
+N,N,N,N,57420,N,57421,27961,16200,27963,57422,57423,13933,27964,27966,N,57424,
+N,57425,N,N,N,N,57426,57427,N,N,27967,N,57428,57429,N,57430,57431,27968,27965,
+57432,27969,N,15446,27970,13616,14131,N,57433,N,57434,14382,N,57435,N,N,N,N,N,
+N,27971,57436,N,N,18032,N,N,17726,27972,N,N,N,N,57437,N,N,27975,N,57444,57438,
+N,57439,57440,N,N,N,N,N,57441,15412,57442,57443,27974,27973,14170,27976,57445,
+N,57446,13139,N,27978,N,57447,57448,14940,27977,N,27986,N,N,57449,57450,N,
+27980,27982,19045,27979,57451,57452,57453,27981,N,27985,27983,13617,57454,
+27984,57455,57456,N,57457,N,57458,27987,57459,57460,18266,20056,N,57461,57462,
+57463,15668,N,N,N,27988,57464,57465,57466,57467,19746,27990,57468,27989,N,N,
+27993,19777,57469,57470,27992,57633,13165,27991,27996,57634,N,27995,N,N,27994,
+17714,27997,57635,N,57636,57637,57638,57639,57640,N,27998,57641,N,N,N,27999,
+57642,57643,14700,N,14117,28000,28001,28002,57644,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+16201,28003,57645,15405,28004,57646,57647,N,28005,57648,57649,57650,21025,
+20862,N,N,N,N,28006,25968,28007,17188,16171,18240,N,N,57651,57652,28008,57653,
+N,19029,17492,14718,N,57654,17193,57655,57656,12586,N,19320,16215,57657,N,N,N,
+57658,57659,N,57660,14174,N,57661,13921,57662,57663,19030,57664,N,N,N,N,28009,
+N,N,N,N,N,57665,N,28011,57666,57667,28010,12896,N,57668,18038,28012,18295,N,
+17715,57669,28013,15698,57670,N,N,28015,57671,57672,19522,28030,28017,28018,
+57673,N,17481,57674,16992,16759,57675,17960,57676,28016,13653,N,57677,N,N,
+28025,57678,28022,28197,17961,17248,28019,N,17534,17747,28020,28024,16224,
+57679,18279,17484,57680,N,16450,28023,16942,16932,28021,12329,20258,N,N,N,
+28026,57681,57682,57684,N,57685,57686,16993,57683,N,15669,16202,57687,57688,
+28028,28027,57689,12399,28029,N,N,18735,N,28199,57690,N,18011,16235,57691,
+57692,17241,N,13944,N,28198,19767,12607,57693,19031,12897,28193,28194,28195,
+28196,17979,17187,12387,28200,N,28201,29731,N,57694,16957,57695,28202,N,12659,
+16716,57696,14383,N,19802,57697,57698,28203,17708,N,N,57699,16760,15447,28204,
+57700,N,28207,N,57701,15717,28205,16683,16682,57702,12388,N,20043,28209,N,
+18546,28211,28210,28208,25444,13396,57703,N,28014,57704,28213,28212,57705,
+57706,N,57707,28214,57708,19768,N,N,N,57709,N,57710,57711,57712,N,57713,N,N,N,
+N,57714,57715,57716,18017,N,57717,19246,N,28215,N,15449,N,N,N,N,28216,57718,
+28217,57719,57720,57721,28218,57722,N,17697,N,N,N,N,57723,57725,N,N,12394,N,
+57726,57889,57890,N,57891,57892,N,14681,N,57724,N,20282,N,N,N,57901,N,N,57893,
+N,57894,57895,57896,N,28222,57897,57898,N,57899,N,14132,28219,N,28220,57900,N,
+N,18804,N,N,57903,N,13140,N,57904,57905,N,N,N,57906,19769,57902,13887,N,N,N,N,
+N,17748,57907,57908,57909,N,28223,N,57910,57911,57912,N,57913,N,N,N,N,57914,N,
+N,57915,N,28224,N,57916,N,57917,57918,57919,28225,57920,N,57921,N,57922,N,
+57923,N,57925,57926,N,57924,N,57927,N,57928,N,N,N,17698,57929,57930,28227,
+57931,28226,N,57932,N,57933,57934,N,57935,57936,N,57937,57938,N,N,N,N,N,57939,
+N,N,N,57940,57941,18003,28228,15670,15456,18267,17265,57942,N,N,15474,57943,
+16236,N,28229,57944,28230,57945,57946,57947,N,N,N,N,N,57948,16221,28231,57949,
+28232,N,57950,N,28233,19823,N,15671,57951,N,N,N,N,28235,28234,57952,14682,N,
+14707,15168,57953,57954,57955,N,N,N,N,N,57956,28238,57957,N,57958,57959,15718,
+N,28237,57960,28236,N,17001,57961,N,14447,57962,16451,57963,57964,57965,N,
+18480,57966,N,N,N,15673,N,57967,N,N,57968,28239,N,15967,N,57969,N,57970,N,
+28242,28240,57971,57972,57973,28241,57974,57975,57976,57977,28244,28243,57978,
+N,15994,N,28245,57979,57980,57981,N,57982,28246,28247,58145,58146,N,58147,
+18512,14931,15457,28248,N,28249,20004,15685,19566,20044,28250,13922,N,58148,
+58149,N,28251,58150,17699,58151,58152,28254,13176,16203,58153,28252,N,28253,N,
+17504,58154,58155,19285,13948,N,58156,58157,N,58158,58159,58160,58161,58162,
+58163,N,N,N,28256,28257,58164,N,58165,N,58166,28255,58167,N,28259,58168,58169,
+N,N,58170,58171,58172,58173,N,58174,58175,N,58176,18015,13123,N,58177,28263,
+58178,58179,28260,28262,58180,N,58181,N,N,N,58182,58183,28258,N,N,N,N,58184,
+58185,58186,58187,N,58188,28495,N,N,28261,N,58189,58190,58191,N,N,58192,20075,
+58193,58194,14426,58195,58196,58197,N,58198,N,58199,28271,58200,N,58201,58202,
+17716,28266,58203,58204,28269,28267,58205,28272,N,58206,58207,58208,28273,
+58209,N,N,N,N,N,28265,58210,58211,28278,12660,58212,58213,28264,N,58214,58215,
+18477,N,28268,58216,15968,58217,58218,58219,N,N,N,N,58220,58221,58222,14683,N,
+N,N,58223,58224,58225,58226,58227,N,58228,58229,58230,19272,58231,13924,N,N,
+15686,N,17980,N,N,58232,58233,58234,N,N,58235,58236,N,N,16685,58237,28276,N,
+28270,28275,58238,19523,58401,17464,28277,28274,N,N,58402,58403,N,N,N,58404,
+58405,N,58406,58407,N,N,58408,N,16684,N,58409,N,N,58410,N,N,N,58411,28281,
+58412,28280,58413,58414,58415,58416,N,58417,58418,58419,58420,58421,N,58422,
+58423,58424,58425,N,N,58426,58427,58428,58429,28279,58430,N,19247,58431,N,
+58432,N,58433,58434,58435,N,N,58436,58437,N,58438,58439,58440,N,58441,15739,
+58442,N,58443,58444,28282,19039,N,58445,12628,58446,N,58447,N,18758,17266,N,N,
+N,N,13688,58448,28284,58449,14685,N,N,58450,58451,N,58452,N,N,N,15148,N,58453,
+N,N,N,N,58454,N,28283,16237,58455,N,N,58456,58457,N,N,16238,28449,28451,N,
+58458,58459,58460,58461,15995,58462,28450,28452,58463,58464,13907,58465,18757,
+58466,58467,15458,20259,N,28286,14968,N,N,20287,58468,58469,28454,58470,58471,
+N,N,28453,28455,N,N,N,N,N,N,N,N,28285,N,N,58472,58473,58474,N,18025,N,17749,N,
+N,58475,58476,58477,N,17495,58478,28460,58479,58480,N,58481,17219,28456,N,
+58482,N,28457,N,N,N,58483,58484,N,58485,N,58486,58487,N,14125,58488,28459,
+58489,58490,58491,N,58492,58493,14384,58494,N,N,N,58657,N,28458,58658,15969,
+58659,58660,58661,58662,N,N,N,N,N,58663,N,58664,58665,13177,58666,N,58667,N,N,
+58668,N,28464,58669,14911,16761,58670,N,17482,58671,N,N,58672,N,N,58673,N,
+58674,58675,N,58676,13115,58677,58683,N,58678,28462,28463,17475,N,28461,N,N,N,
+58679,58680,58681,N,N,28465,58682,N,N,N,N,N,N,58684,N,28471,58685,58686,58687,
+58688,28474,58689,58690,58691,58692,58693,N,N,28473,17709,N,58694,N,N,28466,
+28467,28470,58695,N,N,58696,28472,58697,58698,N,13888,58699,N,28475,28469,
+58700,58701,28468,N,N,N,N,N,N,N,N,N,N,N,N,N,N,58703,58704,58702,58705,58706,N,
+58707,58708,58709,28479,58710,N,N,28480,58711,58712,N,N,N,58713,58714,58715,
+28481,N,N,28478,28477,58716,58717,58718,15970,17962,28476,N,N,N,N,58719,N,
+28485,N,N,N,N,N,N,N,N,N,28483,N,N,58720,58721,N,58722,58723,58724,58725,28484,
+28482,N,17016,N,28486,58726,N,58728,N,58727,N,28487,N,58729,28489,58730,N,N,
+58731,N,58732,N,58733,N,N,N,N,13397,28488,19578,N,58734,N,N,N,58735,28500,
+28490,58736,N,28493,58737,28491,58738,28492,58739,N,N,N,N,58740,N,28494,58741,
+N,58742,58743,58744,28496,58745,58746,N,N,28497,N,28498,N,N,N,N,28501,28499,
+28502,28504,N,28503,N,58748,58747,17465,58749,58750,N,N,N,N,58913,N,19559,N,
+28505,16686,58914,N,N,28506,58915,19012,28507,13099,58916,58917,58918,12604,N,
+13399,N,13398,28508,N,28509,N,28510,28511,N,N,N,58919,58920,58921,28512,58922,
+13400,13141,14686,18486,58923,28514,28513,58924,N,58925,58926,28515,N,N,N,N,
+12636,N,58927,N,58928,N,N,28518,58929,28517,28516,58930,28519,58931,N,N,N,
+28522,N,N,58932,12359,58933,58934,28520,58935,28524,28523,N,N,58936,58937,
+58938,58939,28526,28525,28527,N,17966,58940,58941,N,28528,58942,58943,58944,
+58945,28529,28531,N,58946,28530,58947,18796,58948,58949,N,N,28532,58950,N,
+58951,58952,58953,N,28533,N,14949,N,58954,N,28534,28535,N,58955,19273,58956,N,
+N,N,58957,58958,58959,58960,16715,58961,58962,N,12324,16971,58963,28536,N,
+18797,N,N,N,N,N,N,28539,28537,14687,N,28538,14402,N,58964,N,58965,N,58966,
+58967,58968,N,N,19013,28541,28705,28542,28706,N,58969,12577,16216,15740,13401,
+28707,N,N,N,18278,N,28709,N,58970,N,12578,N,28708,17476,58971,20045,17963,
+28540,20006,N,14385,58972,58973,19803,58974,58975,N,58976,58977,58978,58979,
+13945,20020,N,14120,58980,16994,26401,N,28710,13100,16239,N,58981,N,N,13142,
+28712,58982,28713,28711,14180,58983,14941,15971,58984,N,58985,12579,N,N,20057,
+58986,58987,58988,28715,28206,58989,28714,N,N,N,58990,58991,28718,28716,28717,
+58992,28719,N,28720,20076,28721,28722,58993,16457,18491,N,N,N,16253,13415,N,N,
+19770,12909,15672,14427,N,28725,58994,28724,15219,28726,28723,N,N,15144,58995,
+N,N,28730,27181,N,58997,21078,58998,16247,28728,58999,59000,59001,N,N,20005,
+18033,N,N,N,N,12587,59002,16483,15414,N,N,N,59003,18999,59004,12608,N,N,N,
+20077,19819,N,28731,59005,17733,15483,N,59006,59169,28732,59170,28733,16204,
+28734,59171,20078,N,N,28729,28736,28738,N,28737,N,28735,N,N,28739,N,N,28740,
+59172,59173,16762,59174,12898,N,N,59175,59176,59177,28741,N,N,19512,59178,N,
+28742,N,N,N,N,N,28743,59179,20266,59180,N,N,N,N,23345,28744,N,N,N,28745,28746,
+N,N,59181,28750,59182,28747,N,28748,N,28749,28751,59183,N,N,N,59184,59185,N,N,
+16452,N,N,59186,19575,59187,59188,16453,59189,59190,28752,N,18547,N,28753,
+29523,19532,59191,28754,N,28755,59192,28756,13143,59193,28758,N,16217,59194,N,
+N,28759,N,59195,14116,N,59196,59197,59198,28760,28764,59199,28762,59200,N,
+59201,59202,28763,N,N,13171,28761,28765,N,N,59203,N,28766,N,12360,N,28767,
+28768,N,N,N,N,59204,59205,59206,15972,59207,59208,N,28769,N,59209,59210,13639,
+N,59211,28772,N,N,28771,N,28770,N,N,27505,59212,19036,59213,N,N,59214,59215,
+28773,28774,59216,59217,N,59218,59219,59220,N,59221,N,59222,59223,N,59224,N,
+28775,59225,59226,28776,59227,28777,59228,59229,28778,59230,59231,59232,N,
+59233,59234,N,13402,59235,N,N,59236,59237,59238,N,59242,28779,59239,59240,N,
+59241,59243,N,N,59244,N,N,N,N,N,N,N,N,28780,18211,59245,N,59246,28782,12859,
+59247,28785,28784,59248,59249,N,59250,12580,N,N,N,13889,19015,17466,14882,N,
+14688,15719,59251,16220,N,59252,N,28787,59254,59255,28786,19778,13416,18514,
+18012,59256,N,59257,16252,20046,59253,14171,N,59258,N,59259,N,59260,28790,N,
+59261,28789,59432,59262,N,N,N,N,59425,19275,17964,59426,59427,59428,N,59429,
+59430,12624,59431,N,28791,28788,N,N,18769,19818,28792,59433,N,N,N,N,N,59434,N,
+28793,59435,N,N,59436,28795,17002,13147,13148,28794,N,59437,59438,59439,13417,
+14386,59440,59441,13418,59442,59443,17727,N,N,20064,N,N,N,59444,59445,N,59446,
+59447,14428,N,N,59448,28796,59449,N,N,28797,28798,28961,N,28963,28962,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,18807,N,28964,59450,N,59451,59452,28965,59453,28966,N,N,59454,
+N,28967,59455,59456,N,59457,59458,N,N,N,59459,N,N,59460,28969,28968,59461,
+28970,N,59462,N,N,N,59463,N,N,N,N,N,N,N,N,N,N,N,N,N,N,18548,26188,N,N,16169,N,
+59464,13618,59465,N,59466,59467,59468,N,28971,59469,28972,N,21036,23867,18515,
+N,N,12411,59470,12347,N,59471,N,N,N,N,N,15220,19248,15998,59472,28973,N,19551,
+N,59473,59474,28974,19804,N,12610,N,N,N,15169,59475,28975,12910,28976,59476,
+59477,59478,28977,N,59479,59480,59481,28979,28980,59482,28982,28978,59483,N,
+28981,N,59484,59485,13403,N,N,59486,28983,N,28984,N,N,59487,59488,59489,59490,
+59491,N,N,N,59492,59493,59494,59495,28985,28986,N,59496,59497,28987,N,N,28989,
+59498,59499,59500,28988,N,28991,28994,59501,59502,N,28990,28992,28993,N,59503,
+28995,N,13890,59504,59505,N,59506,59507,N,59508,59509,59510,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,15475,28996,28997,14689,N,59511,N,59512,N,59513,N,N,N,N,N,28998,
+59514,N,13118,N,N,N,18255,28999,29000,N,59515,59516,59517,17242,18027,59518,N,
+N,N,59681,59682,N,29001,59683,N,59684,N,18301,N,59685,16972,12632,13934,N,
+13935,59686,N,N,N,N,N,N,17267,29006,13936,59687,59688,12911,N,N,29005,59689,
+59690,29003,59691,29004,59692,29002,N,N,29016,N,N,N,N,59693,N,N,59694,59695,
+59696,29007,29008,N,59697,29009,29010,N,59698,59699,N,N,29012,59700,N,29011,N,
+59701,59702,15705,29013,59703,59704,59705,29015,N,N,N,N,N,59706,59707,N,13619,
+29014,59708,59709,16763,14387,N,N,59710,N,N,29017,N,N,N,N,59711,N,59712,N,
+59713,59714,59715,N,N,59716,16973,N,N,29018,N,59717,59718,N,17965,N,N,59719,N,
+59720,59721,29019,59722,N,N,N,N,N,29024,N,29022,59724,29021,29023,59725,29020,
+N,59723,N,N,59726,59727,59728,29026,59729,N,N,59730,N,N,59731,29025,59732,
+29028,N,N,13891,29027,N,59733,N,29029,N,N,29030,N,29032,29031,N,N,N,29033,
+29035,29034,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,14716,N,59734,N,59735,
+29036,59736,59737,29037,N,59738,N,59739,59740,59741,N,13116,59742,N,59743,
+29038,N,59744,59745,29039,59746,N,59747,16241,N,59748,N,59749,N,N,N,N,N,59750,
+29040,59751,29041,59752,29042,29043,59753,59754,59755,14690,N,N,59756,59757,N,
+29044,29045,59758,N,29046,29047,59759,59760,29048,59761,N,59762,18481,29050,
+59763,18726,29051,29049,N,29053,59764,59765,29052,59766,N,29054,N,59767,59768,
+29217,N,59769,N,59770,59771,59772,59773,59774,59937,59938,29218,N,59939,59940,
+N,59941,59942,59943,59944,N,59945,N,59946,N,N,N,59947,N,29219,59948,29220,
+59949,59950,N,N,29221,59951,N,29222,29223,N,29224,59952,29225,29226,29227,
+29228,59953,N,59954,29229,29230,N,23861,29231,59955,59956,59957,N,59958,N,
+59959,59960,25720,13620,59961,N,N,N,13089,14898,29233,29232,19493,N,N,59962,N,
+N,59963,59964,29235,29236,29234,N,29237,N,N,19298,59965,59966,59967,29238,N,
+13691,59968,N,N,59969,N,N,59970,N,59971,N,59972,59973,N,59974,N,59975,59976,
+59977,59978,59979,20261,N,N,N,59980,29239,59981,N,59982,59983,59984,N,N,N,N,N,
+59985,59986,N,N,29241,59987,59988,59989,59990,N,59991,59992,59993,N,59994,
+12350,59995,59996,29242,18987,29240,59997,N,29243,29244,N,N,59998,N,N,59999,
+60000,29245,29246,N,N,N,N,N,60001,60002,29247,60003,19310,15149,60004,14970,
+16687,N,60005,60006,60007,N,29248,N,N,60008,60009,29251,N,60010,60011,N,60012,
+60013,29249,60014,N,N,N,N,29252,60015,60016,14449,29250,N,N,N,60017,29253,
+60018,29254,29255,N,29259,N,15146,60019,60020,N,N,16996,N,60021,N,60022,N,
+29260,29257,29256,29258,60023,N,60024,14175,N,60025,60026,N,N,N,60027,29264,
+29263,29262,60028,N,12339,N,60029,60030,60193,60194,N,N,60195,N,60196,60197,N,
+60198,N,29274,N,29270,N,29271,29267,29273,60199,29269,13154,N,60200,20300,
+60201,29272,29268,29266,29265,60202,N,60203,60204,60205,29276,60206,N,60207,N,
+N,29279,60208,60209,29278,29277,60210,60211,60212,60213,60214,N,N,18761,29275,
+12403,29280,60215,29282,N,N,60216,60217,60218,N,13167,29261,12599,N,60219,
+29284,N,N,60220,N,60221,60222,60223,29283,29281,17197,60224,60225,N,N,N,60226,
+60227,60228,N,19312,60229,60230,N,60231,20058,60232,N,29285,60233,60240,60234,
+60235,60236,29286,N,N,60237,N,N,N,29287,60242,60238,60239,60241,N,N,60243,N,
+60244,N,60245,N,N,60246,29288,60247,29289,N,N,60248,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,17467,60249,29290,N,18487,N,29295,29291,N,N,N,
+29292,N,60250,19249,19524,N,18000,60251,N,60252,60254,29296,N,N,29297,17982,
+29294,29293,N,60253,N,N,12842,N,N,60255,29305,N,N,29304,N,60256,60257,N,N,
+12661,60258,60259,60260,29302,N,N,N,29301,N,N,29299,N,13179,N,29298,15410,
+12841,N,N,60261,60262,N,60263,60264,60265,N,N,N,N,N,60266,14691,60267,60269,
+29308,29307,N,29306,60270,60271,29303,60268,29309,60272,29310,N,60273,N,N,N,N,
+N,29477,29476,N,60274,60275,N,N,N,N,29478,N,N,12589,29473,29474,60276,14708,
+19513,60278,60277,29475,60279,N,N,N,60280,60281,60282,19250,N,N,29483,60283,N,
+29479,N,N,N,60284,60285,N,N,29484,60286,60449,N,60450,N,N,N,N,60451,60452,N,
+60453,29481,N,29480,60454,N,N,60455,60456,14172,N,N,60457,60458,N,60459,60460,
+60461,60462,N,29485,N,N,N,N,N,N,60463,N,N,29486,N,N,N,N,29487,60464,29482,
+60465,N,60466,29300,N,60467,29488,N,17505,60468,N,N,29492,60469,29493,29491,
+60470,N,N,60471,N,29490,29496,60472,29489,N,29494,60473,N,60474,60475,N,N,N,N,
+29495,N,N,N,29498,60476,60477,60478,60479,N,29497,60480,N,N,N,60481,60482,
+60483,N,N,N,N,60484,29500,60485,N,60486,N,60487,N,29501,60488,29502,60489,N,
+20297,60490,60491,N,N,N,29499,17003,14957,N,N,29503,60492,60494,N,N,N,N,60495,
+N,N,60493,N,N,N,60496,N,60497,60498,60499,N,N,60500,60501,N,N,60502,29504,
+29505,60503,60504,29506,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29507,N,N,14388,29508,60505,60506,
+60507,29509,N,15407,60508,29510,60509,60510,60511,60512,N,60513,29511,N,N,
+29512,29513,N,60514,60515,N,29516,29514,20284,N,29515,60516,20079,60517,N,N,
+60518,N,29517,60519,20059,N,N,N,N,60520,29518,18302,N,60521,29519,29521,N,
+60522,29522,60523,60524,60525,N,N,60526,60527,60528,N,N,29520,14701,19533,
+19299,22135,N,23904,19323,N,N,N,N,12843,N,60529,N,60530,N,N,60531,29524,13648,
+29525,29526,29527,N,14709,N,29528,60532,N,N,24660,19547,N,16995,29529,29531,
+29530,60533,29532,N,N,N,60534,29533,N,60535,29534,N,N,N,60536,60537,60538,
+29535,60539,60540,60541,N,29536,60542,29537,29538,60705,29539,N,29540,29541,
+29542,N,60706,60707,60708,N,N,N,29543,29544,60709,N,N,N,N,17700,60710,60711,
+60712,60713,14429,60714,29546,60715,60716,N,60717,60718,60719,N,N,N,60720,
+16717,29547,60721,N,N,N,60722,N,N,N,60723,60724,29548,N,N,60725,N,60726,60727,
+N,60728,N,N,60729,N,60730,60731,18721,60732,60733,29549,60734,N,60735,N,60736,
+60737,60738,60739,60740,N,N,29550,25399,N,N,27738,28781,N,N,29551,60741,29552,
+60742,60743,60744,60745,N,60746,N,N,60747,60748,29554,29555,29556,20080,29553,
+N,N,29557,29558,60749,60750,29560,N,29559,60751,60752,60753,60754,60755,29562,
+60756,N,60757,29563,29561,N,N,60758,N,N,60759,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+20022,N,60760,60761,60762,60763,N,60764,29564,60765,60766,N,N,N,N,29565,25428,
+60767,N,29566,60768,60769,60770,N,60771,8490,N,8564,8560,8563,8565,N,8522,
+8523,8566,8540,8484,N,8485,8511,9008,9009,9010,9011,9012,9013,9014,9015,9016,
+9017,8487,8488,8547,8545,8548,8489,8567,9025,9026,9027,9028,9029,9030,9031,
+9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,
+9047,9048,9049,9050,8526,N,8527,8496,8498,8494,9057,9058,9059,9060,9061,9062,
+9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,
+9078,9079,9080,9081,9082,8528,8515,8529,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8497,
+N,8559,
+};
+
+static const struct unim_index jisxcommon_encmap[256] = {
+{__jisxcommon_encmap+0,92,255},{__jisxcommon_encmap+164,0,245},{
+__jisxcommon_encmap+410,199,221},{__jisxcommon_encmap+433,132,206},{
+__jisxcommon_encmap+508,1,95},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{__jisxcommon_encmap+603,16,59},{__jisxcommon_encmap+647,3,212},{
+__jisxcommon_encmap+857,0,165},{__jisxcommon_encmap+1023,18,18},{0,0,0},{
+__jisxcommon_encmap+1024,0,239},{__jisxcommon_encmap+1264,5,111},{0,0,0},{0,0,
+0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__jisxcommon_encmap+1371,0,254},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisxcommon_encmap+1626,0,255},{
+__jisxcommon_encmap+1882,0,255},{__jisxcommon_encmap+2138,0,254},{
+__jisxcommon_encmap+2393,0,254},{__jisxcommon_encmap+2648,0,255},{
+__jisxcommon_encmap+2904,0,250},{__jisxcommon_encmap+3155,1,255},{
+__jisxcommon_encmap+3410,0,255},{__jisxcommon_encmap+3666,5,255},{
+__jisxcommon_encmap+3917,0,255},{__jisxcommon_encmap+4173,0,253},{
+__jisxcommon_encmap+4427,2,255},{__jisxcommon_encmap+4681,0,253},{
+__jisxcommon_encmap+4935,0,255},{__jisxcommon_encmap+5191,1,253},{
+__jisxcommon_encmap+5444,1,254},{__jisxcommon_encmap+5698,0,255},{
+__jisxcommon_encmap+5954,1,255},{__jisxcommon_encmap+6209,7,253},{
+__jisxcommon_encmap+6456,0,255},{__jisxcommon_encmap+6712,0,255},{
+__jisxcommon_encmap+6968,1,250},{__jisxcommon_encmap+7218,6,255},{
+__jisxcommon_encmap+7468,0,255},{__jisxcommon_encmap+7724,0,255},{
+__jisxcommon_encmap+7980,0,255},{__jisxcommon_encmap+8236,2,253},{
+__jisxcommon_encmap+8488,0,255},{__jisxcommon_encmap+8744,0,253},{
+__jisxcommon_encmap+8998,2,255},{__jisxcommon_encmap+9252,2,244},{
+__jisxcommon_encmap+9495,4,252},{__jisxcommon_encmap+9744,0,255},{
+__jisxcommon_encmap+10000,1,254},{__jisxcommon_encmap+10254,0,253},{
+__jisxcommon_encmap+10508,3,255},{__jisxcommon_encmap+10761,0,254},{
+__jisxcommon_encmap+11016,2,255},{__jisxcommon_encmap+11270,0,255},{
+__jisxcommon_encmap+11526,3,255},{__jisxcommon_encmap+11779,0,254},{
+__jisxcommon_encmap+12034,0,252},{__jisxcommon_encmap+12287,2,255},{
+__jisxcommon_encmap+12541,0,252},{__jisxcommon_encmap+12794,0,255},{
+__jisxcommon_encmap+13050,2,254},{__jisxcommon_encmap+13303,0,254},{
+__jisxcommon_encmap+13558,0,251},{__jisxcommon_encmap+13810,0,158},{
+__jisxcommon_encmap+13969,54,255},{__jisxcommon_encmap+14171,0,254},{
+__jisxcommon_encmap+14426,2,255},{__jisxcommon_encmap+14680,0,254},{
+__jisxcommon_encmap+14935,0,253},{__jisxcommon_encmap+15189,1,255},{
+__jisxcommon_encmap+15444,0,255},{__jisxcommon_encmap+15700,0,254},{
+__jisxcommon_encmap+15955,0,255},{__jisxcommon_encmap+16211,1,254},{
+__jisxcommon_encmap+16465,1,255},{__jisxcommon_encmap+16720,0,255},{
+__jisxcommon_encmap+16976,0,159},{__jisxcommon_encmap+17136,55,255},{
+__jisxcommon_encmap+17337,1,255},{__jisxcommon_encmap+17592,1,254},{
+__jisxcommon_encmap+17846,0,254},{__jisxcommon_encmap+18101,0,255},{
+__jisxcommon_encmap+18357,0,255},{__jisxcommon_encmap+18613,0,255},{
+__jisxcommon_encmap+18869,0,253},{__jisxcommon_encmap+19123,1,132},{
+__jisxcommon_encmap+19255,119,230},{__jisxcommon_encmap+19367,28,251},{
+__jisxcommon_encmap+19591,0,255},{__jisxcommon_encmap+19847,1,254},{
+__jisxcommon_encmap+20101,2,255},{__jisxcommon_encmap+20355,1,255},{
+__jisxcommon_encmap+20610,0,255},{__jisxcommon_encmap+20866,0,249},{
+__jisxcommon_encmap+21116,2,254},{__jisxcommon_encmap+21369,2,255},{
+__jisxcommon_encmap+21623,2,165},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,
+0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{__jisxcommon_encmap+21787,1,229},
+};
+
+static const ucs2_t __cp932ext_decmap[969] = {
+65340,65374,8741,65372,8230,8229,8216,8217,8220,8221,65288,65289,12308,12309,
+65339,65341,65371,65373,12296,12297,12298,12299,12300,12301,12302,12303,12304,
+12305,65291,65293,177,215,U,247,65309,8800,65308,65310,8806,8807,8734,8756,
+9794,9792,176,8242,8243,8451,65509,65284,65504,65505,65285,65283,65286,65290,
+65312,167,9734,9733,9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,
+8251,12306,8594,8592,8593,8595,12307,U,U,U,U,U,U,U,U,U,U,U,8712,8715,8838,
+8839,8834,8835,8746,8745,U,U,U,U,U,U,U,U,8743,8744,65506,9312,9313,9314,9315,
+9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,
+9331,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,U,13129,13076,13090,
+13133,13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,
+13212,13213,13214,13198,13199,13252,13217,U,U,U,U,U,U,U,U,13179,U,12317,12319,
+8470,13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,
+13180,8786,8801,8747,8750,8721,8730,8869,8736,8735,8895,8757,8745,8746,32394,
+35100,37704,37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,
+20220,20224,20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,
+20510,20550,20592,20546,20628,20724,20696,20810,20836,20893,20926,20972,21013,
+21148,21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,
+21642,21673,21759,21894,22361,22373,22444,22472,22471,64015,U,64016,22686,
+22706,22795,22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,
+23582,23718,23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,
+24372,24423,24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,
+24880,24984,25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,
+26158,26142,26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,
+26382,63785,26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,
+27106,27184,27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,
+27866,27908,28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,
+28220,28351,28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,
+28998,28999,64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,
+29667,29650,29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,
+30338,30364,30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,
+64024,64025,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,
+32092,32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,
+33864,33972,34131,34137,U,34155,64031,34224,64032,64033,34823,35061,35346,
+35383,35449,35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,
+64035,36559,64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,
+37358,37348,37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,
+37479,37543,37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,
+37665,37627,64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,
+37937,37957,37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,
+38737,38741,38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,
+39794,39823,39857,39867,39936,40304,40299,64045,40473,40657,U,U,8560,8561,
+8562,8563,8564,8565,8566,8567,8568,8569,65506,65508,65287,65282,8560,8561,
+8562,8563,8564,8565,8566,8567,8568,8569,8544,8545,8546,8547,8548,8549,8550,
+8551,8552,8553,65506,65508,65287,65282,12849,8470,8481,8757,32394,35100,37704,
+37512,34012,20425,28859,26161,26824,37625,26363,24389,20008,20193,20220,20224,
+20227,20281,20310,20370,20362,20378,20372,20429,20544,20514,20479,20510,20550,
+20592,20546,20628,20724,20696,20810,U,20836,20893,20926,20972,21013,21148,
+21158,21184,21211,21248,21255,21284,21362,21395,21426,21469,64014,21660,21642,
+21673,21759,21894,22361,22373,22444,22472,22471,64015,64016,22686,22706,22795,
+22867,22875,22877,22883,22948,22970,23382,23488,29999,23512,23532,23582,23718,
+23738,23797,23847,23891,64017,23874,23917,23992,23993,24016,24353,24372,24423,
+24503,24542,24669,24709,24714,24798,24789,24864,24818,24849,24887,24880,24984,
+25107,25254,25589,25696,25757,25806,25934,26112,26133,26171,26121,26158,26142,
+26148,26213,26199,26201,64018,26227,26265,26272,26290,26303,26362,26382,63785,
+26470,26555,26706,26560,26625,26692,26831,64019,26984,64020,27032,27106,27184,
+27243,27206,27251,27262,27362,27364,27606,27711,27740,27782,27759,27866,27908,
+28039,28015,28054,28076,28111,28152,28146,28156,28217,28252,28199,28220,28351,
+28552,28597,28661,28677,28679,28712,28805,28843,28943,28932,29020,28998,28999,
+64021,29121,29182,29361,29374,29476,64022,29559,29629,29641,29654,29667,29650,
+29703,29685,29734,29738,29737,29742,29794,29833,29855,29953,30063,30338,30364,
+30366,30363,30374,64023,30534,21167,30753,30798,30820,30842,31024,64024,64025,
+U,64026,31124,64027,31131,31441,31463,64028,31467,31646,64029,32072,32092,
+32183,32160,32214,32338,32583,32673,64030,33537,33634,33663,33735,33782,33864,
+33972,34131,34137,34155,64031,34224,64032,64033,34823,35061,35346,35383,35449,
+35495,35518,35551,64034,35574,35667,35711,36080,36084,36114,36214,64035,36559,
+64036,64037,36967,37086,64038,37141,37159,37338,37335,37342,37357,37358,37348,
+37349,37382,37392,37386,37434,37440,37436,37454,37465,37457,37433,37479,37543,
+37495,37496,37607,37591,37593,37584,64039,37589,37600,37587,37669,37665,37627,
+64040,37662,37631,37661,37634,37744,37719,37796,37830,37854,37880,37937,37957,
+37960,38290,63964,64041,38557,38575,38707,38715,38723,38733,38735,38737,38741,
+38999,39013,64042,64043,39207,64044,39326,39502,39641,39644,39797,39794,39823,
+39857,39867,39936,40304,40299,64045,40473,40657,
+};
+
+static const struct dbcs_index cp932ext_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{__cp932ext_decmap+0,95,202},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{__cp932ext_decmap+108,64,156},{0,0,0},{0,0,0},{0,0,0},{0,0,
+0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{__cp932ext_decmap+201,64,252},{__cp932ext_decmap+390,64,252},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__cp932ext_decmap+579,64,252},{__cp932ext_decmap+768,64,252},{
+__cp932ext_decmap+957,64,75},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __cp932ext_encmap[9686] = {
+34690,N,N,N,N,N,N,N,N,N,N,34692,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+34644,34645,34646,34647,34648,34649,34650,34651,34652,34653,N,N,N,N,N,N,61167,
+61168,61169,61170,61171,61172,61173,61174,61175,61176,34708,N,N,N,N,N,N,N,N,N,
+N,N,N,N,34712,N,N,N,N,N,33121,N,N,N,N,N,N,N,N,34707,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,34713,34624,34625,34626,34627,34628,34629,34630,
+34631,34632,34633,34634,34635,34636,34637,34638,34639,34640,34641,34642,34643,
+34688,N,34689,34698,34699,N,N,N,N,N,N,34700,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,34693,34694,34695,34696,34697,34661,N,N,N,N,N,N,N,N,N,
+34665,N,N,N,N,N,N,34656,N,N,N,34659,N,N,N,N,N,N,N,N,N,34657,34667,N,N,34666,
+34660,N,N,N,34668,N,N,N,N,N,N,N,N,N,N,34662,N,N,N,N,34670,N,N,N,N,N,N,N,N,N,N,
+N,N,N,34655,34669,N,N,34658,N,N,N,34663,N,N,N,N,N,34664,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,34686,34703,34702,34701,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,34674,34675,N,N,N,N,N,N,N,N,N,N,N,N,34671,34672,34673,
+N,N,34677,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+34676,N,N,N,N,N,N,N,N,34691,60748,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,60749,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60750,
+60751,N,N,60752,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60753,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,60754,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60756,N,N,N,N,N,N,N,
+60755,N,60758,N,N,N,N,N,60757,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60741,N,N,N,60759,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,60762,60763,N,N,N,60761,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,60760,N,60766,N,N,N,60764,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60765,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60767,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,60769,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,60768,60770,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60771,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,60772,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,60773,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60774,60775,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,60776,N,N,N,N,N,N,N,N,N,60777,N,N,N,N,N,N,N,N,61019,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,60778,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60779,
+60780,N,N,N,N,N,N,60781,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,60782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,60783,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+60784,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60785,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+60786,60789,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60788,N,N,N,N,N,N,N,N,N,N,N,N,
+60790,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,60791,60792,60793,N,N,N,N,N,N,N,N,N,N,N,60794,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60795,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60797,60796,60801,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,60802,60803,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,60804,N,N,N,N,N,N,N,60805,N,60806,N,N,N,N,N,60807,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,60808,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+60809,60810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60811,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60813,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,60814,60815,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60816,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,60817,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60818,60819,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60822,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,60820,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60823,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60824,60825,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60826,60827,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,60828,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60747,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60829,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60830,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60831,60832,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60833,N,N,
+N,N,60834,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,60836,N,N,N,N,N,N,N,N,60835,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60838,
+60839,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60837,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60841,N,
+N,N,N,N,N,60840,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60842,60843,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60844,60845,60846,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,60847,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60848,60849,60850,N,N,N,N,N,
+N,N,N,60853,N,N,N,N,N,N,N,N,N,N,N,60851,N,N,N,N,N,N,N,N,60855,N,N,N,N,N,60856,
+N,N,N,N,N,N,N,N,N,60854,N,N,60743,N,N,N,N,N,N,N,N,N,60852,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60858,N,60859,N,N,N,N,N,N,N,N,N,N,N,60857,N,
+N,N,N,N,N,N,N,N,N,N,N,N,60861,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,60862,N,N,N,N,N,N,60863,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,60864,N,N,N,N,N,N,N,N,N,N,N,N,60865,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,60866,60746,60867,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60869,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60870,N,N,N,N,60872,
+60873,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60874,N,N,N,N,N,N,
+N,N,N,N,N,N,N,60871,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,60744,N,N,N,N,N,N,60875,60877,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60879,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60880,60881,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60883,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60882,N,N,N,N,N,N,N,60884,N,N,N,N,N,N,N,
+N,N,N,60885,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60886,N,60887,60888,
+60889,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60890,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,60892,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+60891,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,60893,60894,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,60896,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60895,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,60897,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60898,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60899,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60901,N,N,N,N,N,60900,N,
+N,N,60902,60905,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60903,N,N,60906,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60904,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,60907,60908,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60909,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,60910,60911,N,60912,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,60913,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60914,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60915,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,60742,60917,N,N,N,N,N,N,N,N,N,N,60916,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,60919,60920,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60918,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60922,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+60923,60924,N,N,N,N,N,N,N,N,N,N,N,N,60992,60993,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60995,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60996,N,N,N,N,N,N,N,N,N,N,N,60997,
+N,N,N,N,N,N,N,N,61000,N,N,N,60998,N,N,N,N,N,N,N,N,N,N,N,N,60999,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,61002,61001,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,61003,N,N,61005,61004,N,N,N,61006,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61007,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61008,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61009,61010,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60812,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61011,61012,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61015,61013,N,61014,N,N,N,N,N,N,N,61016,61018,
+61020,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,61021,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61022,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61023,61024,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,61028,N,N,N,N,N,N,61030,61031,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,61032,N,N,N,61034,61035,61037,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61038,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61040,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,61039,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,61041,61042,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60736,61043,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,61044,61046,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61047,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61048,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61049,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61050,61051,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61052,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60740,61053,N,N,N,N,
+N,61054,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61056,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,61058,61061,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61062,60737,61063,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61064,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61065,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61066,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,61067,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,61068,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61070,
+61071,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,61072,61073,N,N,N,61074,61075,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,61076,61078,61081,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,61082,61084,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61085,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61087,N,N,61086,N,N,N,61088,N,N,N,
+N,N,61091,61092,N,N,N,N,N,N,N,61089,61090,61093,N,N,N,61095,N,N,N,N,N,61094,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61102,61096,N,61098,N,N,N,61097,N,N,N,N,N,N,N,N,N,N,N,N,N,61099,N,N,61101,N,N,
+N,N,N,N,N,61100,N,N,N,N,N,N,N,N,N,N,N,N,N,61103,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61105,61106,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60739,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61104,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61110,N,N,61114,N,61112,N,61108,N,61109,
+N,N,N,N,N,N,61113,N,N,N,N,N,N,61107,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60745,N,
+61117,N,N,N,61120,61122,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61121,61119,N,N,61116,N,N,N,61115,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,60738,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61124,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61123,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61125,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61126,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61127,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,61128,61129,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61130,N,N,61131,
+61132,61135,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61136,61137,N,N,N,N,N,N,N,61138,
+N,N,N,N,N,N,N,61139,N,N,N,N,N,N,N,N,N,61140,N,61141,N,61142,N,N,N,61143,61144,
+N,N,N,N,N,N,N,N,N,N,N,N,N,61145,61148,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61150,61151,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,61152,N,N,61153,61155,N,N,61154,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,61156,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,61157,N,N,N,N,N,N,N,N,N,61158,61159,61161,N,N,N,N,61160,61163,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61164,60868,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61133,60787,60798,60800,60821,60860,60876,60878,
+60921,60994,61017,61025,61026,61027,61029,61033,61036,61045,61057,61059,61060,
+61069,61077,61079,61080,61083,61111,61118,61134,61146,61147,61149,61162,61180,
+N,N,N,N,61179,N,N,N,N,N,33148,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,33119,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,33120,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,33169,
+33170,33226,N,61178,
+};
+
+static const struct unim_index cp932ext_encmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp932ext_encmap+0,22,121},{__cp932ext_encmap
++100,17,191},{0,0,0},{__cp932ext_encmap+275,96,115},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__cp932ext_encmap+295,29,31},{0,0,0},{__cp932ext_encmap+298,49,168},{
+__cp932ext_encmap+418,3,205},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{__cp932ext_encmap+621,40,252},{__cp932ext_encmap+834,0,255},{
+__cp932ext_encmap+1090,30,244},{__cp932ext_encmap+1305,74,236},{
+__cp932ext_encmap+1468,21,219},{__cp932ext_encmap+1667,0,221},{
+__cp932ext_encmap+1889,138,255},{__cp932ext_encmap+2007,134,134},{0,0,0},{
+__cp932ext_encmap+2008,89,200},{__cp932ext_encmap+2120,158,178},{
+__cp932ext_encmap+2141,11,186},{0,0,0},{__cp932ext_encmap+2317,86,236},{
+__cp932ext_encmap+2468,30,245},{__cp932ext_encmap+2684,39,208},{0,0,0},{
+__cp932ext_encmap+2854,33,222},{__cp932ext_encmap+3044,93,242},{
+__cp932ext_encmap+3194,17,152},{__cp932ext_encmap+3330,19,166},{
+__cp932ext_encmap+3478,245,245},{__cp932ext_encmap+3479,96,206},{
+__cp932ext_encmap+3590,78,78},{__cp932ext_encmap+3591,0,251},{
+__cp932ext_encmap+3843,14,192},{__cp932ext_encmap+4022,1,207},{
+__cp932ext_encmap+4229,104,226},{__cp932ext_encmap+4352,48,228},{
+__cp932ext_encmap+4533,214,214},{__cp932ext_encmap+4534,63,218},{
+__cp932ext_encmap+4690,4,252},{__cp932ext_encmap+4939,39,191},{
+__cp932ext_encmap+5092,136,245},{__cp932ext_encmap+5202,5,187},{
+__cp932ext_encmap+5385,4,254},{__cp932ext_encmap+5636,177,190},{
+__cp932ext_encmap+5650,36,245},{__cp932ext_encmap+5860,7,159},{
+__cp932ext_encmap+6013,1,111},{__cp932ext_encmap+6124,130,166},{
+__cp932ext_encmap+6161,70,70},{__cp932ext_encmap+6162,33,122},{
+__cp932ext_encmap+6252,48,155},{__cp932ext_encmap+6360,209,235},{
+__cp932ext_encmap+6387,158,158},{0,0,0},{__cp932ext_encmap+6388,72,214},{
+__cp932ext_encmap+6531,82,138},{__cp932ext_encmap+6588,71,161},{0,0,0},{0,0,0
+},{0,0,0},{__cp932ext_encmap+6679,1,246},{__cp932ext_encmap+6925,72,220},{
+__cp932ext_encmap+7074,83,176},{0,0,0},{0,0,0},{__cp932ext_encmap+7168,7,245},
+{__cp932ext_encmap+7407,28,28},{__cp932ext_encmap+7408,18,246},{
+__cp932ext_encmap+7637,83,127},{__cp932ext_encmap+7682,240,244},{
+__cp932ext_encmap+7687,18,118},{__cp932ext_encmap+7788,207,207},{0,0,0},{
+__cp932ext_encmap+7789,103,222},{__cp932ext_encmap+7909,21,238},{
+__cp932ext_encmap+8127,6,255},{__cp932ext_encmap+8377,2,248},{
+__cp932ext_encmap+8624,49,72},{__cp932ext_encmap+8648,146,146},{
+__cp932ext_encmap+8649,157,175},{__cp932ext_encmap+8668,51,85},{
+__cp932ext_encmap+8703,87,101},{__cp932ext_encmap+8718,39,158},{
+__cp932ext_encmap+8838,78,220},{__cp932ext_encmap+8981,114,187},{
+__cp932ext_encmap+9055,0,0},{__cp932ext_encmap+9056,107,112},{
+__cp932ext_encmap+9062,25,209},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp932ext_encmap+9247
+,41,220},{__cp932ext_encmap+9427,14,45},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__cp932ext_encmap+9459,2,228},
+};
+
+static const ucs2_t __jisx0213_1_bmp_decmap[2197] = {
+65287,65282,65293,126,12339,12340,12341,12347,12348,12543,12447,U,U,U,U,U,U,U,
+U,8836,8837,8842,8843,8713,8709,8965,8966,U,U,U,U,U,U,U,8853,8854,8855,8741,
+8742,10629,10630,12312,12313,12310,12311,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,8802,
+8771,8773,8776,8822,8823,8596,U,U,U,U,U,U,U,U,9838,9835,9836,9833,9655,9654,
+9665,9664,8599,8600,8598,8601,8644,8680,8678,8679,8681,10548,10549,U,U,U,U,U,
+U,U,U,U,U,10687,9673,12349,65094,65093,9702,8226,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,8723,8501,8463,13259,8467,8487,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,12448,8211,10746,10747,12363,U,12365,U,12367,U,
+12369,U,12371,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,12436,12437,
+12438,12459,U,12461,U,12463,U,12465,U,12467,U,U,U,U,U,U,U,12475,U,U,U,U,U,U,U,
+U,12484,U,U,U,12488,9828,9824,9826,9830,9825,9829,9831,9827,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,962,9461,9462,9463,9464,9465,9466,9467,9468,
+9469,9470,9750,9751,12320,9742,9728,9729,9730,9731,9832,9649,12784,12785,
+12786,12787,12788,12789,12790,12791,12792,12793,U,12794,12795,12796,12797,
+12798,12799,9150,9151,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,
+9163,9164,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+12535,12536,12537,12538,8922,8923,8531,8532,8533,10003,8984,9251,9166,12881,
+12882,12883,12884,12885,12886,12887,12888,12889,12890,12891,12892,12893,12894,
+12895,12977,12978,12979,12980,12981,12982,12983,12984,12985,12986,12987,12988,
+12989,12990,12991,U,U,U,U,U,U,U,U,9680,9681,9682,9683,8252,8263,8264,8265,461,
+462,464,7742,7743,504,505,465,466,468,470,472,474,476,8364,160,161,164,166,
+169,170,171,173,174,175,178,179,183,184,185,186,187,188,189,190,191,192,193,
+194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,
+213,214,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,
+233,234,235,236,237,238,239,240,241,242,243,244,245,246,248,249,250,251,252,
+253,254,255,256,298,362,274,332,257,299,363,275,333,260,728,321,317,346,352,
+350,356,377,381,379,261,731,322,318,347,711,353,351,357,378,733,382,380,340,
+258,313,262,268,280,282,270,323,327,336,344,366,368,354,341,259,314,263,269,
+281,283,271,273,324,328,337,345,367,369,355,729,264,284,292,308,348,364,265,
+285,293,309,349,365,625,651,638,643,658,620,622,633,648,598,627,637,642,656,
+635,621,607,626,669,654,609,331,624,641,295,661,660,614,664,450,595,599,644,
+608,403,339,338,616,649,600,629,601,604,606,592,623,650,612,652,596,593,594,
+653,613,674,673,597,657,634,615,602,U,509,8048,8049,U,U,U,U,U,U,U,U,8050,8051,
+865,712,716,720,721,774,8255,779,769,772,768,783,780,770,741,742,743,744,745,
+U,U,805,812,825,796,799,800,776,829,809,815,734,804,816,828,820,797,798,792,
+793,810,826,827,771,794,10102,10103,10104,10105,10106,10107,10108,10109,10110,
+10111,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,8560,8561,8562,8563,
+8564,8565,8566,8567,8568,8569,8570,8571,9424,9425,9426,9427,9428,9429,9430,
+9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,
+9446,9447,9448,9449,13008,13009,13010,13011,13012,13013,13014,13015,13016,
+13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13050,13033,
+13029,13037,13036,U,U,U,U,U,U,U,U,U,8273,8258,9312,9313,9314,9315,9316,9317,
+9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,8544,
+8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,13129,13076,13090,13133,
+13080,13095,13059,13110,13137,13143,13069,13094,13091,13099,13130,13115,13212,
+13213,13214,13198,13199,13252,13217,8555,U,U,U,U,U,U,U,13179,12317,12319,8470,
+13261,8481,12964,12965,12966,12967,12968,12849,12850,12857,13182,13181,13180,
+U,U,U,8750,U,U,U,U,8735,8895,U,U,U,10070,9758,20465,U,13314,20008,20015,20016,
+20109,20193,20221,20223,20227,20235,20320,20296,20297,20310,20319,20330,20332,
+20350,20362,20372,20375,64048,20425,20448,20481,20482,20494,20504,20519,20526,
+20544,20539,20545,20628,20684,20722,20688,20710,64049,20742,20739,20747,20766,
+20789,20810,64050,20821,20823,13493,20893,20931,20938,20958,20962,20974,20993,
+13531,21011,21013,21065,21079,21089,21139,21192,64051,21196,21200,21206,21211,
+64052,21232,21243,21248,21255,21276,64053,21345,21347,21373,21395,21405,21426,
+21522,21543,21581,21660,21611,21620,21631,21640,21654,21665,21673,21702,21759,
+21774,21803,21813,21840,21854,21889,21894,21902,64054,21933,21966,64055,22024,
+22030,22075,22089,22134,22118,64056,22127,22129,22130,22169,22174,22185,22188,
+22195,22217,22218,22282,U,22305,22319,22323,22324,22384,22391,22396,22428,
+64015,U,22456,22471,22472,22479,22500,22509,22517,22518,22527,22537,64016,
+22625,22628,64057,22652,22665,22686,64058,22697,U,22738,22734,22740,22746,
+22752,22761,22796,34369,22877,22893,22923,22930,22948,22979,22994,23005,23059,
+23075,23143,23149,23159,23166,23172,23198,23207,23236,U,23321,23333,21085,
+23361,23382,23421,23443,23512,23532,23570,23582,23587,23595,14221,23650,64059,
+64060,U,23674,23695,23711,23715,23722,23738,23755,23760,23762,23796,U,14306,
+23821,23847,64017,23878,23879,23891,23882,23917,23937,23968,23972,23975,23992,
+24011,21534,22099,24034,24084,24088,24152,24158,24254,63784,24267,24313,24320,
+24322,24327,24349,24355,24372,24374,24381,24384,24389,24404,24408,24420,24423,
+24445,24457,24476,24487,24495,24501,24503,24521,24542,24545,24553,24589,24596,
+24600,24627,24629,24647,64061,24733,24734,24779,24788,24789,24797,24824,24860,
+24875,24880,24887,64062,24973,64063,25020,25017,64064,25122,25150,25155,25174,
+25178,25199,25221,25284,25302,25340,25354,25368,25401,25411,25445,25468,25573,
+25581,25589,25616,25620,25634,25721,25681,25696,25709,25806,25790,25791,25796,
+25802,25808,25847,25851,25890,25897,64065,25959,26013,64066,26112,26121,26133,
+26142,26170,26146,26148,26155,26160,26161,26163,26363,26184,26188,U,26201,
+26202,26209,26213,26227,26231,26232,26253,64067,26272,26290,26299,26310,26312,
+15138,26331,26344,26362,26387,63785,26419,26470,26439,26440,26491,26497,26515,
+26520,26523,26555,26617,26560,26583,26620,26625,26706,26653,26668,26673,26715,
+26738,26741,64068,26787,26789,26802,26824,26832,26856,26861,26864,26865,26876,
+26890,26953,U,26933,26946,26967,26979,26980,26984,27008,64020,27045,27053,
+27087,15286,15299,27106,27113,27114,27125,27126,27151,27157,U,27195,27198,
+27205,27216,27222,27227,27243,27251,U,27273,27284,27293,27294,27301,27364,
+27367,15375,63773,27419,27422,27436,27445,27462,27478,27488,27493,27495,27511,
+27522,27561,27565,63856,27599,27606,27607,27647,27653,27664,27699,27737,27740,
+27818,27764,27766,27781,27782,27800,27804,27899,27846,27860,27872,27883,27886,
+U,27908,27918,27950,27953,27961,27967,27992,28005,64069,28034,28039,28041,
+28052,28074,28076,28095,28100,28118,28122,28123,28125,28156,64070,28212,28228,
+28252,28254,28331,28337,28353,28359,28366,28432,28442,64071,28458,28463,28467,
+28497,28505,28510,28513,28514,28542,28552,28556,28557,28564,28576,28583,28598,
+28604,28615,28618,28665,28656,28661,28677,28678,28712,28746,28765,28766,28750,
+28772,28789,28805,28836,28843,28855,28884,28888,28900,28943,28971,28958,28960,
+28974,28976,28998,28999,29009,64072,29010,29020,29024,29032,64021,29061,29063,
+29074,29121,29114,29124,29182,29184,29205,29269,29270,15935,29325,29339,29374,
+29376,29435,U,29479,29480,64022,29520,29542,29564,29589,29599,29600,29602,
+29606,29611,29641,29647,29654,29657,29667,29673,29703,29706,29722,29723,64074,
+29734,29736,29738,29739,29740,29742,29743,29744,29764,29766,29767,29771,29783,
+29794,29803,29805,29830,29831,29833,29848,29852,29855,29859,29840,29862,29864,
+29865,29877,29887,29896,29897,29914,29951,29953,29975,29999,30063,30073,30098,
+16242,30158,30180,30208,30210,30216,30229,30230,30233,30238,30253,30261,30275,
+30283,30308,30309,30317,30319,30321,30337,30363,30365,30366,30374,30378,30390,
+30405,30412,30414,30420,30438,30449,30460,30474,30489,30516,30518,30534,30541,
+30542,30556,30559,30562,30586,30592,30612,30634,30688,30765,30787,30798,30799,
+30801,30824,30830,64075,30896,U,30893,30948,30962,30976,30967,31004,31022,
+31025,31028,64076,64077,31045,31046,64078,64079,64080,31068,64081,64025,64026,
+31097,64082,64083,64027,31128,31153,31160,31176,31178,U,31188,31198,31211,
+31213,31235,64084,31289,31325,31341,64085,31365,31392,U,31411,31419,31438,
+31467,31485,31506,31533,31547,31559,31566,31584,31597,31599,31602,31646,64086,
+31703,31705,31745,31793,31774,31776,31795,31798,16996,U,31833,31853,31865,
+31887,31892,31904,31932,31957,31961,31965,32007,32008,32019,32029,32035,32049,
+32065,32072,32083,32092,32122,32131,32139,32160,32166,32194,32204,32214,32227,
+64087,32296,32264,32273,32277,64089,32327,32338,32353,32394,32397,32583,64090,
+32657,32663,32703,32718,32731,32735,32748,32750,32762,64091,32788,32806,32821,
+32823,32828,32970,32983,32992,33011,33048,33098,33120,33127,33128,33133,33211,
+33226,33231,33239,64092,17491,17499,33376,33396,U,33422,33441,33443,33444,
+33449,33454,33463,33470,33471,33478,33493,33533,33534,33536,33537,33634,33570,
+33581,33594,33603,33607,33617,33621,33661,33670,33682,33688,33703,33705,33727,
+33728,33735,33743,33745,33761,33770,33793,33798,33802,64095,33864,33887,33904,
+33907,33925,33950,33967,33972,33978,33984,33986,U,34098,34078,34083,34095,
+34137,34148,64031,34221,34170,34188,34191,34210,34224,34251,34254,34285,34322,
+34303,34308,34309,34320,U,34328,34345,34360,34391,34395,63798,34402,17821,
+34412,34421,34456,34488,34554,34556,34557,34571,34673,34695,34696,34732,34733,
+34741,17898,34774,34796,34822,34826,34832,34836,34847,34968,34986,35018,35022,
+U,35061,35100,64096,35096,35097,35098,35111,35120,35122,35129,35136,35220,
+64097,35284,35301,35318,35346,35349,35362,35383,35399,35406,35421,35425,35445,
+35449,35495,35536,35551,35572,35574,64034,64098,64099,35654,35668,35673,35689,
+35741,35913,35944,64100,36065,36084,36088,36094,64101,36114,36123,36271,36302,
+36305,36311,36384,36387,36413,36464,36475,U,36544,18500,36602,36638,36653,
+36662,36692,U,36774,36789,36836,36840,36846,36872,36909,64103,37000,37013,
+37015,37017,37019,37026,37043,37054,37060,37061,37063,37079,37085,37086,37103,
+37108,64038,37140,37141,37142,37154,37155,37159,37167,37169,37172,37181,37192,
+37211,37251,37278,37292,37297,37308,37335,37371,37348,37349,37357,37361,37383,
+37392,37432,37433,37434,37436,37440,37443,37455,37496,37512,37570,37579,37580,
+37587,37600,37631,37636,37663,37665,37669,37704,37705,37706,37732,37733,37738,
+37744,37787,37795,37818,37830,37854,37855,37892,37885,37939,37962,37987,37995,
+38001,38002,38286,38303,38310,38313,38316,38326,38333,38347,38352,38355,18864,
+38362,38366,38488,38532,63964,38557,38564,38565,38610,38622,64104,38633,38639,
+38707,38715,38733,38734,38735,38746,38766,38771,38805,38830,38842,38849,38857,
+38878,38875,38900,64105,38922,38942,38955,38960,64106,38994,38995,38998,38999,
+39001,39002,63952,39013,39020,39098,39112,39143,39256,39326,39426,39427,39460,
+39469,39470,39480,39498,39502,39506,39606,39617,39619,39630,39638,39673,39682,
+39688,39712,19479,39725,39774,39801,39782,39794,39797,39812,39818,39823,39838,
+39847,39873,39886,39909,39928,39933,39936,39971,40001,40015,40016,40019,40035,
+40037,40055,40221,40222,40259,40263,40274,40291,40304,40316,40330,40342,40384,
+40364,40380,40407,U,40423,40455,40469,40572,40606,40612,40620,40623,40628,
+40629,40643,40657,40720,40761,40791,40848,40852,40855,40866,23032,23643,24183,
+30246,32363,
+};
+
+static const struct dbcs_index jisx0213_1_bmp_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_1_bmp_decmap+0,47,125},{
+__jisx0213_1_bmp_decmap+79,33,126},{__jisx0213_1_bmp_decmap+173,43,118},{
+__jisx0213_1_bmp_decmap+249,43,72},{__jisx0213_1_bmp_decmap+279,57,126},{
+__jisx0213_1_bmp_decmap+349,66,126},{__jisx0213_1_bmp_decmap+410,65,124},{
+__jisx0213_1_bmp_decmap+470,33,126},{__jisx0213_1_bmp_decmap+564,33,126},{
+__jisx0213_1_bmp_decmap+658,33,126},{__jisx0213_1_bmp_decmap+752,33,126},{
+__jisx0213_1_bmp_decmap+846,33,126},{__jisx0213_1_bmp_decmap+940,33,126},{
+__jisx0213_1_bmp_decmap+1034,33,126},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_1_bmp_decmap+
+1128,85,126},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__jisx0213_1_bmp_decmap+1170,39,126},{__jisx0213_1_bmp_decmap+1258,33,126},{
+__jisx0213_1_bmp_decmap+1352,33,126},{__jisx0213_1_bmp_decmap+1446,33,126},{
+__jisx0213_1_bmp_decmap+1540,33,125},{__jisx0213_1_bmp_decmap+1633,33,126},{
+__jisx0213_1_bmp_decmap+1727,33,126},{__jisx0213_1_bmp_decmap+1821,33,126},{
+__jisx0213_1_bmp_decmap+1915,33,126},{__jisx0213_1_bmp_decmap+2009,33,126},{
+__jisx0213_1_bmp_decmap+2103,33,126},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const ucs2_t __jisx0213_2_bmp_decmap[2425] = {
+19970,19983,19986,20009,20011,20014,20032,20039,20040,U,20049,13318,U,20058,
+20073,20125,13356,13358,20153,20155,U,20156,20163,20168,20176,20203,20186,
+20209,20213,20224,20246,20324,20279,20286,20308,20312,U,20343,20344,20346,
+20349,20354,20357,20370,20378,20454,20402,20414,20421,20427,20431,20434,13418,
+20466,20480,20496,20499,20508,20510,20514,13416,20546,20550,20558,20563,20567,
+20579,20582,20586,20592,20643,20616,20626,20627,20629,20630,20636,20650,U,
+20657,20666,20667,20676,20679,20723,U,20686,U,20692,20697,20705,20713,13458,
+20744,U,20759,20763,U,20832,U,20851,20867,20875,13500,20888,20899,20909,13511,
+20924,U,U,20979,20980,20994,21010,21014,U,21077,21084,21100,21111,21124,21122,
+U,21144,U,21156,21158,21167,21178,21179,21194,13599,21201,U,21239,21258,21259,
+21284,21301,21310,21314,U,U,21351,21356,21370,21412,21428,U,21431,21440,U,
+13661,13662,21461,21466,13667,21492,21493,21589,21540,21544,13678,21571,21602,
+21606,21612,21642,21645,21653,21664,21670,21677,21678,21687,21690,21695,21699,
+U,21740,21743,21745,21747,21760,21761,21769,21820,21825,13734,21831,21834,
+13736,21856,21857,21860,U,21885,21890,21896,21905,13765,21970,U,U,21951,21961,
+21964,21969,21981,13786,21986,U,21993,22056,U,22023,22032,22064,22071,13812,
+22077,22079,22080,22087,22110,22112,22125,13829,22152,22156,22165,22170,22173,
+22184,22189,22194,22213,22221,22239,22248,22262,22263,U,22293,22307,U,22313,U,
+22341,22342,22348,22349,U,22376,22383,22387,22388,22389,22395,U,U,22444,22426,
+22429,22430,22440,22487,U,22476,U,U,22494,22502,22512,13898,22520,22523,22525,
+22532,22558,22560,22567,22578,22585,U,22601,22604,22631,22666,22667,22669,
+22671,22672,22676,22685,22698,22705,U,22723,22733,22754,22771,22772,22789,
+22790,22795,22797,22804,22820,U,13969,22845,13977,22854,13974,U,22875,22879,U,
+22901,22902,22908,22943,22958,22972,22984,22989,23006,23011,23012,23015,23022,
+U,U,14031,23052,23053,23063,23079,23085,23125,23141,23162,23179,23196,23199,
+23200,23202,23217,23219,23221,23226,23231,23258,23260,23264,23269,23280,23278,
+23285,23296,23304,23319,23348,23341,23372,23378,23400,23407,23420,23423,23425,
+23428,23446,23468,14177,23488,14178,23502,23510,14188,14187,23537,23549,14197,
+23555,23593,23600,U,23647,23651,23655,23656,23657,23664,U,U,23676,U,U,23688,
+23690,14273,U,U,23712,23714,23718,23719,U,23725,23733,U,23753,U,U,23814,23824,
+23851,23837,23840,23844,23846,23857,23865,23874,14312,23905,23914,14324,23920,
+U,14333,23944,14336,23954,23956,23959,23961,23984,23986,23988,U,23993,24017,
+24023,24024,24032,U,24036,24041,14383,24064,14390,24082,24085,14400,24095,
+24110,24126,24137,14428,24150,14433,24171,24172,24173,24174,U,24229,24234,
+24236,24249,24255,24262,24274,24281,U,24317,24328,24334,24348,U,24350,24391,
+24419,24434,24446,24463,24482,24484,24504,24516,14586,24519,24523,24530,24531,
+24532,24546,24558,24559,24563,24572,14615,24599,24610,24612,14618,24652,24703,
+24714,24725,24744,U,24752,24753,24766,24776,24793,24795,24814,24818,24821,
+24848,24850,24851,24857,24862,24890,14703,24897,24902,24928,24956,U,24978,
+24979,24983,24984,24997,25000,25005,U,25045,25053,25055,25077,U,25109,25123,
+25129,25158,25164,25169,25170,25185,25188,25211,25197,25203,25241,25254,25301,
+U,25341,25347,25357,25360,U,U,25394,25397,25403,25404,25409,25412,25422,U,
+25433,U,U,25452,25476,25497,U,25492,25533,25591,25556,25557,25564,25568,25579,
+25580,25586,25609,25630,25637,25641,25647,25690,25691,25693,25715,25725,25735,
+25745,25757,25759,25803,25804,25813,25815,U,25828,25829,25855,25860,14958,
+25871,25876,25878,14963,25886,25906,25924,25940,25963,25978,25985,25988,25989,
+25994,26034,26037,26040,26047,26050,26057,26068,15062,26098,26105,26108,26116,
+26120,26145,26154,26181,26193,26190,15082,U,26199,26203,26211,U,U,26218,26219,
+26220,26221,26235,26240,26256,26258,26265,15118,26285,26289,26293,15130,26303,
+15132,26348,15063,26369,26373,26386,U,26393,U,U,26444,26445,26452,26461,U,U,U,
+26484,26486,U,26514,U,33635,26640,26544,26546,26563,26568,26578,26585,26587,
+26608,26615,U,U,U,26648,26655,26669,U,26675,26683,26686,26692,26693,26697,
+26700,26709,26711,15223,26731,26734,26746,26748,26754,26768,26774,15213,26776,
+26777,26778,26780,26794,26795,26804,26811,26875,U,U,64019,26819,26821,26828,
+26831,26838,26841,26852,26853,26860,26871,26883,26887,15239,15240,U,26939,
+15245,26950,26985,26988,26994,27002,27007,27026,15268,27030,27032,27046,27056,
+27063,27066,27068,27072,27089,27094,U,U,27184,U,U,27107,27118,27119,27123,
+15309,27124,27134,27153,27162,27165,U,27186,27187,27188,27199,27206,27209,
+27258,27214,27218,27236,U,27262,27267,27275,15344,27281,27295,27297,U,27307,
+27325,27334,27348,27344,27356,27357,U,U,27372,27377,27378,27379,27389,U,27403,
+27407,27408,27409,U,27415,15398,27439,27466,27480,27500,27509,27514,27521,
+27547,27566,U,27581,27582,27591,27592,27593,27610,27622,27623,27630,27633,
+27650,27658,27662,27701,27702,27706,U,27711,27725,27739,27757,27780,27785,
+15555,27796,27797,27799,27821,27842,27856,15570,27862,27866,27868,27881,27884,
+27885,U,27904,27914,27940,27942,27943,27751,27951,27964,27995,27998,28000,
+28016,28032,28033,28042,28045,28049,28056,U,28183,U,U,U,28075,28078,28084,
+28098,27956,28104,28110,28111,28112,28127,28137,28150,28214,28190,28194,28199,
+15633,28210,28220,28232,28233,28235,28236,28239,28241,28243,28244,28247,28259,
+15646,28307,28327,28340,28351,28355,28362,28377,28469,28395,28409,28411,28426,
+28428,28440,28453,28470,28476,U,28498,28503,28506,28512,28520,28568,28541,
+28560,28566,28606,28575,28581,28591,15716,28597,28616,28617,28634,28638,28649,
+U,28668,28672,28679,28682,28707,U,28729,28730,28732,28739,28743,28747,15770,
+28756,28773,28777,28780,28782,28790,28798,28801,28806,28821,28823,28859,U,
+28831,28849,U,28908,28874,28881,28883,28892,28931,28932,28934,28935,28936,
+28940,15808,28975,28977,29008,29002,29011,29022,15828,29078,29056,29083,29088,
+29090,29102,29103,29107,U,29131,29139,29145,29148,29191,15877,64073,29227,
+29236,29240,29241,20012,29250,29267,29271,29283,U,29294,29295,29304,29311,
+29326,U,29357,29358,29360,29361,29377,15968,29388,15974,15976,29427,29434,
+29447,29458,29464,29465,16003,29497,29484,29489,29491,29501,29522,16020,29547,
+29548,U,29550,29551,29553,29559,29569,29573,29578,29588,29592,29596,29598,
+29605,29608,29621,29623,29625,29628,29631,29637,29643,29665,29671,29689,29715,
+29690,29697,29732,29745,29753,29779,29760,29763,29773,29778,29789,29809,29825,
+29829,29832,U,29842,29847,29849,29856,29857,29861,29866,29867,29881,29883,
+29882,29910,29912,29918,29935,29931,U,29946,U,29984,29988,29994,16215,U,30013,
+30014,30016,30024,30030,30032,30034,30060,30066,30065,30074,30077,30078,30081,
+U,30092,16245,30114,16247,30128,30135,30143,30144,30150,30159,30163,30173,
+30175,30176,30183,30188,30190,30193,30201,30211,30232,30215,30223,16302,U,
+30227,30235,30236,U,30245,30248,30268,30259,U,16329,30273,U,30281,30293,16343,
+30318,30357,30364,30369,30368,30375,30376,30383,U,30409,U,30440,30444,U,30487,
+30490,30509,30517,16441,U,U,30552,30560,30570,U,30578,30588,30589,U,16472,
+30618,30623,30626,30628,30633,30686,30687,30692,30694,30698,30700,16531,30704,
+30708,30715,U,30725,30726,30729,30733,30745,30753,30764,30791,30820,30826,U,
+30858,30868,30884,30877,30878,30879,30907,30920,30924,30926,30933,30944,30945,
+30950,30969,30970,30971,30974,U,30992,31003,31024,31013,31035,31050,31064,
+31067,16645,31079,31090,31124,31125,31126,31131,31137,31145,31156,31163,31170,
+31175,31180,31181,31190,16712,U,U,16719,31242,31249,31253,31259,31262,16739,
+31277,31288,31303,31308,31318,31321,31324,31327,31328,31335,31338,31349,31352,
+31362,31370,31376,31395,31404,U,16820,31417,31420,31422,16831,31436,31441,
+31463,31464,31476,U,U,31495,U,31549,31527,31530,31534,31535,31537,16870,16883,
+31615,31553,16878,31573,31609,31588,31590,31593,31603,U,16903,31632,31633,
+31643,16910,31663,31669,31676,31685,31690,U,U,31700,31702,31706,31722,31728,
+31747,31755,31758,31759,31782,31813,31818,31825,31831,31838,31841,31849,31854,
+31855,31856,U,U,U,31910,U,31926,31927,31935,U,31940,U,31944,31949,U,31959,U,
+31974,31979,U,31989,32003,32009,17094,32018,32030,U,U,32061,32062,32064,32071,
+U,U,17110,32089,32090,32106,32112,17117,32127,U,32134,32136,32140,32151,U,
+32157,32167,32170,32182,32183,32192,32215,32217,32230,32241,32249,17154,U,
+64088,32272,32279,32285,32288,32295,32300,32325,32371,32373,32382,32390,32391,
+17195,32401,32408,32410,17219,32572,32571,32574,32579,32580,32591,13505,U,
+32594,U,32609,32611,32612,32621,32637,32638,U,32656,20859,U,32662,32668,32685,
+U,32707,32719,32739,32741,32751,32754,32770,32778,32776,32782,32785,32790,
+32804,32812,32816,32835,32870,32881,32885,32891,32921,32924,32932,32935,32952,
+U,32965,32981,32984,32998,U,33037,33013,33019,17390,33077,33046,33054,17392,
+33060,33063,33068,U,33085,17416,33129,17431,33153,17436,33156,33157,17442,
+33176,33202,33217,33219,33238,33243,U,33252,U,33260,U,33277,33279,U,33284,U,
+33305,33313,33314,U,33330,33332,33340,33350,33353,33349,U,33355,17526,33359,
+17530,33367,U,33372,33379,U,64093,64094,33401,17553,33405,33407,33411,33418,
+33427,33447,33448,33458,33460,33466,33468,33506,33512,33527,33543,33544,33548,
+33620,33563,33565,33584,33596,33604,33623,17598,33663,17620,17587,33677,33684,
+33685,33691,33693,33737,33744,33748,33757,33765,33785,33807,33809,33813,U,
+33815,33849,33866,33871,33873,33874,33881,33882,33884,U,33893,33910,33912,
+33916,33921,17677,34012,33943,33958,33982,17672,33998,33999,34003,U,34023,
+34026,34031,34032,34033,34042,34045,34060,34075,34084,34085,34091,34100,34127,
+34159,17701,17731,34110,34129,34131,34142,34145,34146,U,34171,34173,34175,
+34177,34182,34195,34205,34207,34231,34236,34247,34250,34264,34265,34271,34273,
+34278,34294,34304,34321,34334,34337,34340,34343,U,34361,34364,U,34368,64032,
+34387,34390,34415,34423,34426,34439,34441,34445,34449,34460,34461,34472,64033,
+34481,34483,34497,34499,34513,34517,34519,34531,34534,17848,34565,34567,34574,
+34576,34579,34585,34591,34593,34595,34609,34618,34622,34624,34627,34641,34648,
+34660,34661,34674,34684,U,U,34727,34697,34699,34707,34720,U,17893,34750,U,
+34753,34766,34805,34783,U,34787,34789,34790,34794,34795,34797,34817,34819,
+34827,34835,34856,34862,34866,34876,17935,34890,34904,34911,34916,U,U,34921,U,
+34927,34976,35004,35005,35006,35008,35026,U,35025,35027,35035,35056,35057,
+17985,35073,U,35127,U,35138,35141,35145,U,18021,35170,35200,35209,35216,35231,
+35248,35255,35286,35288,35307,18081,35313,35315,35325,35327,18095,35345,35348,
+U,35361,35381,35390,35397,35405,35416,35502,35472,35511,35518,35543,35580,U,
+35594,35589,35597,35612,35615,35629,35651,18188,35665,35678,35702,35711,35713,
+35723,35732,35733,35740,35742,35897,U,35901,U,U,35909,35911,35919,35924,35927,
+35945,35949,35955,U,35987,35986,35993,18276,35995,36004,36054,36053,36057,U,
+36080,36081,U,36105,36110,36204,36228,36245,36262,U,36294,36296,36313,36332,
+36364,18429,36349,36358,U,36372,36374,36385,36386,36391,U,18454,36406,36409,
+36427,36436,36450,36460,36461,36463,36504,36510,36526,36531,36533,36534,36539,
+U,36561,36564,18510,36601,U,36608,36616,36631,36651,36672,36682,36696,U,36772,
+36788,64102,36790,U,36801,36806,64036,36810,36813,36819,36821,36832,36849,
+36853,36859,36866,36876,36919,U,36931,36932,36957,36997,37004,37008,38429,
+37025,18613,37040,37046,37059,37064,U,37084,37087,U,37110,37106,37120,37099,
+37118,37119,37124,37126,37144,37148,37150,37175,37177,37178,37190,37191,37207,
+37209,37217,37220,37236,37241,37253,37262,37288,37294,37299,37302,37315,37316,
+37338,U,U,37356,37358,37377,37386,37398,37399,U,37427,37442,37447,37450,37454,
+37457,37462,37465,37472,37473,37477,37479,37480,U,U,37500,37501,37503,37513,
+37517,37527,37529,37535,37543,37547,U,U,37554,37567,37568,37574,37582,37584,
+37591,37593,37605,37607,37649,37623,37625,37627,37634,37645,37653,37661,37662,
+37671,37673,U,U,37703,37713,37719,37722,37739,37745,37747,37793,U,U,37768,
+37771,37775,37790,37877,U,U,37873,37825,37831,37852,37858,37863,37897,37903,
+37910,37911,37883,37938,37940,37947,37957,U,U,37997,37999,38264,38265,38278,
+38284,38285,U,38315,38324,U,38344,U,U,38444,38451,38452,U,38460,38465,38497,U,
+38530,U,38554,U,18919,38569,38575,38579,38586,38589,18938,U,38616,38618,38621,
+18948,38676,38691,18985,38710,38721,38727,38741,38743,38747,38762,U,U,38806,
+38810,38814,38818,38833,38834,38846,38860,38865,38868,38872,38873,38881,38897,
+38916,38925,38926,38932,38934,19132,U,38947,38962,38963,38949,38983,39014,
+39083,39085,39088,U,39095,39096,39099,39100,39103,39106,39111,39115,39136,U,
+39137,39139,39141,39146,39152,39153,39155,39176,19259,U,39190,39191,U,39194,
+39195,39196,U,39217,39218,39219,39226,39227,39228,39232,39233,39238,39245,
+39246,39260,39263,39264,39331,39334,39353,39357,39359,39363,39369,39380,39385,
+39390,U,39408,39417,39420,39434,39441,39446,39450,39456,39473,39478,39492,
+39500,39512,19394,39599,19402,39607,19410,39609,U,39622,39632,39634,39637,
+19432,39644,39648,39653,39657,39683,39692,39696,39698,39702,39708,39723,39731,
+39741,19488,39755,39779,39781,39787,39788,39795,39798,39799,39846,39852,39857,
+U,U,39858,39864,39870,39879,39923,39896,39901,39911,39914,39915,39919,39918,U,
+39930,U,39927,U,39958,39960,39961,39962,39965,39970,39975,39977,39978,U,39985,
+39990,39991,40005,40028,U,40009,40010,U,40020,40024,40027,40029,40031,40041,
+40042,40043,40045,40046,40048,40050,40053,40058,40166,40178,40203,40194,U,
+40209,40215,40216,U,19652,U,40242,19665,40258,40266,40287,40290,U,40297,40299,
+U,40307,40310,40311,40318,40324,40333,40345,40353,40383,40373,40377,40381,
+40387,40391,40393,40406,40410,40415,40416,40419,40436,19719,40458,40450,40461,
+40473,40476,40477,40571,U,40576,40581,40603,40616,U,40637,U,40671,40679,40686,
+40703,40706,19831,40707,40727,40729,40751,40759,40762,40765,40769,40773,40774,
+40787,40789,40792,U,40797,U,40809,U,40813,40816,40821,
+};
+
+static const struct dbcs_index jisx0213_2_bmp_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_2_bmp_decmap+0,34,126},{0,0,0},{
+__jisx0213_2_bmp_decmap+93,33,126},{__jisx0213_2_bmp_decmap+187,33,126},{
+__jisx0213_2_bmp_decmap+281,33,125},{0,0,0},{0,0,0},{__jisx0213_2_bmp_decmap+
+374,33,126},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_2_bmp_decmap+468,33,126},{
+__jisx0213_2_bmp_decmap+562,33,126},{__jisx0213_2_bmp_decmap+656,33,126},{
+__jisx0213_2_bmp_decmap+750,33,126},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__jisx0213_2_bmp_decmap+844,33,126},{__jisx0213_2_bmp_decmap+938,33,126},{
+__jisx0213_2_bmp_decmap+1032,33,126},{__jisx0213_2_bmp_decmap+1126,33,126},{
+__jisx0213_2_bmp_decmap+1220,34,126},{__jisx0213_2_bmp_decmap+1313,33,126},{
+__jisx0213_2_bmp_decmap+1407,33,126},{__jisx0213_2_bmp_decmap+1501,33,126},{
+__jisx0213_2_bmp_decmap+1595,33,125},{__jisx0213_2_bmp_decmap+1688,35,126},{
+__jisx0213_2_bmp_decmap+1780,33,126},{__jisx0213_2_bmp_decmap+1874,33,125},{
+__jisx0213_2_bmp_decmap+1967,34,125},{__jisx0213_2_bmp_decmap+2059,34,126},{
+__jisx0213_2_bmp_decmap+2152,33,126},{__jisx0213_2_bmp_decmap+2246,33,126},{
+__jisx0213_2_bmp_decmap+2340,33,117},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __jisx0213_bmp_encmap[27287] = {
+8754,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10530,
+10531,N,N,10532,N,10533,N,N,10534,10535,10536,N,10537,10538,10539,N,N,10540,
+10541,N,N,N,10542,10543,10544,10545,10546,10547,10548,10549,10550,10551,10552,
+10553,10554,10555,10556,10557,10558,10559,10560,10561,10562,10563,10564,10565,
+10566,10567,10568,10569,10570,10571,10572,10573,N,10574,10575,10576,10577,
+10578,10579,10580,10581,10582,10583,10584,10585,10586,10587,M,10589,10590,
+10591,10592,10593,10594,10595,10596,10597,10598,10599,10600,10601,10602,10603,
+10604,N,10605,10606,10607,10608,10609,10610,10611,10612,10613,10618,10810,
+10825,10785,10796,10812,10827,10841,10847,N,N,10813,10828,10816,10831,N,10832,
+10616,10621,N,N,N,N,10814,10829,10815,10830,10842,10848,N,N,N,N,N,N,10843,
+10849,N,10877,N,N,10614,10619,N,N,N,N,N,N,N,N,10844,10850,N,N,N,10811,10826,N,
+N,10788,10799,N,N,10787,10798,10817,10833,N,N,10818,10834,N,N,10874,10617,
+10622,N,N,10819,10835,11051,11050,10809,10824,N,N,10820,10836,10789,10800,
+10845,10851,10791,10803,10790,10802,10823,10839,10792,10804,N,N,N,N,10615,
+10620,10846,10852,10821,10837,10822,10838,N,N,N,N,N,N,N,10793,10805,10795,
+10808,10794,10807,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11049,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+11044,N,N,N,N,N,N,N,N,N,N,10351,10352,N,10353,10358,10359,N,10360,N,10361,N,
+10362,N,10363,N,10364,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+10356,10357,N,N,N,11077,11059,11065,11066,11045,M,11071,10862,11046,11054,M,M,
+N,11057,N,11058,10869,11048,10873,N,N,11062,11068,11042,11074,11052,N,N,N,
+10858,10868,10859,11060,10875,10853,10870,10863,N,11055,N,N,N,10860,11073,
+10867,N,10864,10855,N,N,10876,10865,10856,11047,N,N,N,10861,11053,11061,10854,
+M,11067,10872,N,10866,11072,10857,N,11041,10878,N,N,11043,N,N,N,N,10871,N,N,N,
+11070,11069,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,10801,11091,N,N,N,11092,N,N,N,11093,11094,N,N,N,N,N,N,10786,10840,N,
+10797,N,10806,11121,N,N,N,N,N,N,M,11105,11106,11107,M,11100,11098,11103,11133,
+11099,N,11095,N,11117,N,N,11097,11102,N,N,11101,N,N,N,N,N,N,N,N,11128,11129,
+11134,N,11114,11126,11127,11115,11116,N,N,N,11122,11111,N,N,N,11119,11130,N,
+11112,N,N,11120,11123,N,N,N,11125,N,N,N,N,11113,11131,11132,11124,11118,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11090,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,9817,10354,10355,11078,11079,11088,11089,9084,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,9024,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,10347,N,N,11096,N,N,11390,N,N,N,N,10348,10349,10350,N,N,N,N,N,N,N,11389,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,10529,9053,N,N,N,9055,N,N,11618,N,N,N,N,N,N,N,N,N,N,11620,
+N,N,N,N,N,9056,N,N,N,N,N,N,N,N,N,N,N,N,N,9052,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,10104,10105,10106,N,N,N,N,N,N,N,N,N,N,11573,11574,
+11575,11576,11577,11578,11579,11580,11581,11582,11583,11607,N,N,N,N,11317,
+11318,11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8817,N,8999,8997,8998,9000,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,9001,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,9003,9004,
+9002,9005,8775,N,N,N,8774,N,N,N,N,N,N,N,N,N,9051,N,N,N,N,N,N,N,N,N,N,N,11640,
+N,N,N,N,N,8788,8789,N,N,N,N,N,N,N,11635,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,8812,N,8813,N,N,8814,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8811,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8815,8816,N,N,N,N,N,N,N,N,N,N,N,N,8770,
+8771,N,N,N,N,8772,8773,N,N,N,N,N,N,N,N,N,8785,8786,8787,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11641,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10102,10103,8776,8777,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,10108,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10050,10051,10052,10053,10054,10055,
+10056,10057,10058,10059,10060,10061,10062,10063,10064,N,10110,10109,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11553,11554,11555,11556,11557,11558,11559,
+11560,11561,11562,11563,11564,11565,11566,11567,11568,11569,11570,11571,11572,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,11329,11330,11331,11332,11333,11334,11335,11336,
+11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,11348,11349,
+11350,11351,11352,11353,11354,N,11307,11308,11309,11310,11311,11312,11313,
+11314,11315,11316,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9837,N,N,
+N,N,8994,8993,N,N,N,N,N,N,N,N,8996,8995,N,N,N,N,N,N,N,9019,N,N,N,N,N,N,10343,
+10344,10345,10346,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,9023,9832,9833,9834,
+9835,N,N,N,N,N,N,N,N,N,N,9831,N,N,N,N,N,N,N,9828,9829,N,N,N,N,N,N,11646,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,9786,9789,9787,9792,9785,9790,
+9788,9791,9836,8829,N,8827,8828,N,8826,10107,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,11645,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,11297,11298,11299,11300,11301,11302,11303,11304,11305,11306,9006,
+9007,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,8790,8791,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,9018,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,9085,9086,8794,8795,8792,8793,N,N,N,11616,N,11617,9830,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8755,8756,8757,N,N,N,N,N,8758,8759,9020,N,N,N,
+N,N,N,N,N,N,N,N,N,N,M,N,M,N,M,N,M,N,M,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,9332,9333,9334,N,N,N,N,N,N,N,N,8761,9083,N,N,N,N,N,N,N,N,N,N,M,N,M,
+N,M,N,M,N,M,N,N,N,N,N,N,N,M,N,N,N,N,N,N,N,N,M,N,N,N,M,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10098,
+10099,10100,10101,N,N,N,N,8760,9838,9839,9840,9841,9842,9843,9844,M,9846,9847,
+9849,9850,9851,9852,9853,9854,11626,11627,N,N,N,N,N,N,11628,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,10305,10306,10307,10308,10309,10310,10311,10312,
+10313,10314,10315,10316,10317,10318,10319,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,11621,11622,11623,11624,11625,N,N,N,N,N,N,N,N,10320,
+10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,
+10334,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11355,11356,11357,11358,11359,11360,
+11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,
+11374,N,11377,N,N,N,11376,N,N,11379,11378,N,N,N,N,N,N,N,N,N,N,N,N,11375,11590,
+N,N,N,N,N,N,N,N,N,11594,N,N,N,N,N,N,11585,N,N,N,11588,N,N,N,N,N,N,N,N,N,11586,
+11596,N,N,11595,11589,N,N,N,11597,N,N,N,N,N,N,N,N,N,N,11591,N,N,N,N,11599,N,N,
+N,N,N,N,N,N,N,N,N,N,N,11584,11598,N,N,11587,N,N,N,11592,N,N,N,N,N,11593,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11615,11631,
+11630,11629,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11603,11604,N,N,N,N,N,N,N,N,N,N,N,N,
+11600,11601,11602,N,N,11606,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,11605,N,N,N,N,N,N,9054,N,11619,11811,N,N,N,41261,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41266,N,41267,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41310,N,41302,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41342,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11859,N,N,N,N,N,N,41771,N,N,N,N,
+62568,N,N,N,N,N,41775,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11867,41800,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41821,41822,N,N,N,N,41825,N,N,N,N,N,N,N,
+N,N,N,41831,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42019,N,42022,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42031,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,42040,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42050,42058,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42105,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42303,N,N,N,N,42307,N,N,42305,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,42327,43043,43045,N,N,N,N,N,N,N,N,43049,43048,N,N,N,N,N,
+N,N,N,43052,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20319,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,43070,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,20335,N,N,N,N,N,43094,N,N,N,N,N,N,N,N,N,N,N,43097,N,N,N,N,N,N,N,N,43100,
+43102,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,43119,N,N,N,N,N,N,43121,N,N,N,N,N,N,N,N,N,43124,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43129,N,N,N,N,43131,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44091,44102,N,N,44106,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44128,44379,N,N,N,N,44383,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+44401,44598,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44412,44590,N,N,N,N,N,N,N,N,N,
+N,N,44594,N,44596,N,N,N,N,N,30025,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,44653,N,N,N,N,N,N,N,N,N,44645,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,44840,44841,N,N,N,N,44844,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+44852,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30078,N,N,N,N,N,N,N,N,N,N,N,N,30241,N,
+N,N,N,N,N,N,N,N,44872,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44893,30266,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44919,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+60987,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60994,61041,N,N,N,N,N,N,N,N,N,N,N,N,61054,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61248,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,61268,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,61296,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61303,61480,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30566,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,61503,N,N,N,N,N,61505,N,61506,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,61513,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61520,61748,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30797,N,N,61766,N,61768,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,61788,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,61799,N,N,N,N,N,N,N,N,N,N,N,N,N,61804,61986,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61997,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+62009,62052,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62068,N,N,N,
+N,N,N,62071,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62077,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62259,N,N,N,N,N,N,
+N,N,N,N,62263,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,62279,N,N,N,N,N,N,N,62283,N,N,N,N,62280,62291,N,N,N,N,N,N,62295,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,31085,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62507,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,62518,N,N,N,N,N,N,62523,62542,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62557,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,62561,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62782,N,62786,62792,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,62794,N,N,N,N,62796,N,N,N,N,N,62799,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+31321,N,N,N,N,N,N,N,31322,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+62828,N,N,N,62830,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62839,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63029,N,N,N,N,N,N,N,N,
+N,N,63026,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63028,63065,N,N,N,N,63060,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63085,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63086,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31569,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63311,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63340,N,N,N,N,31584,
+63524,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,63546,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,63555,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63566,N,
+N,N,N,N,N,N,N,N,N,N,N,N,63571,63595,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63785,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63807,63817,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+31819,N,N,N,N,N,N,N,N,N,63836,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64039,32088,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64362,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,64368,64373,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,64376,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64567,64597,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64806,N,N,N,N,N,N,N,64808,N,N,N,
+N,N,N,N,64810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64817,32318,N,N,N,N,N,
+N,N,N,64831,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,65066,N,N,N,N,N,N,N,N,N,N,N,N,65069,65099,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65120,41250,N,N,N,N,N,
+N,N,N,N,N,N,N,41251,N,N,41252,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11812,
+41253,N,41254,61486,N,41255,11813,11814,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41256,N,
+N,N,N,N,N,41257,41258,N,N,N,N,N,N,N,N,41260,N,N,N,N,N,N,N,N,41263,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,41264,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,11815,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41265,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41268,N,41269,41271,N,N,N,N,N,N,41272,N,N,N,N,
+41273,N,N,N,N,N,N,N,41274,N,N,N,N,N,N,N,N,N,41276,N,N,N,N,N,N,11816,N,N,N,N,N,
+N,N,N,N,41275,N,N,N,N,N,41277,N,N,N,41278,N,N,N,N,N,N,N,11817,N,11818,41279,N,
+N,11819,N,N,N,N,N,N,N,11820,N,N,N,N,N,N,N,N,N,N,41280,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41282,N,N,N,N,N,N,41283,N,N,N,N,N,N,N,
+N,N,11822,11823,N,N,N,N,N,N,N,N,N,N,41284,N,11824,N,41285,N,N,N,N,N,N,11825,
+11821,N,N,N,41281,N,N,N,N,N,11826,N,11827,N,N,N,N,N,N,N,N,N,N,41287,41288,N,
+41289,N,N,41290,11828,N,N,N,41291,N,N,41292,N,N,N,N,11829,N,N,N,N,N,N,N,41293,
+N,11830,N,N,11831,N,N,41294,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41296,N,N,N,N,N,N,N,N,N,N,N,41297,N,N,N,N,N,N,41298,N,N,N,11833,N,41299,N,N,N,
+41300,N,N,41301,N,N,N,N,N,N,N,N,N,N,N,N,N,11834,N,N,N,N,N,41295,N,N,N,N,N,N,N,
+N,N,N,11809,41303,41304,11835,11836,N,N,N,N,N,N,N,N,N,N,N,11837,N,41305,N,N,
+41306,N,N,N,N,11838,N,N,N,41307,N,41308,N,N,N,41309,N,N,N,N,11839,N,N,N,N,N,N,
+11840,N,N,N,N,N,N,N,N,N,N,N,N,11842,N,N,N,N,11841,11843,41311,N,N,N,41312,N,N,
+N,N,N,N,N,41313,N,N,N,N,41314,N,N,N,41315,N,N,N,N,N,N,N,N,N,N,N,41316,N,N,
+41317,N,N,N,41318,N,N,N,N,N,41319,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,41321,N,N,N,N,N,N,N,N,N,41322,41323,11844,41324,41325,N,N,N,N,N,41326,N,N,N,
+N,N,N,41320,N,N,N,N,N,N,41327,N,N,N,N,N,N,41329,N,N,N,N,N,N,N,N,41330,41331,N,
+N,N,N,N,N,N,N,41332,N,N,41333,N,N,N,N,11845,N,41336,N,11847,N,N,N,41338,N,N,N,
+N,41339,N,N,N,N,N,N,N,41340,N,N,N,N,11848,N,N,41341,N,N,N,N,N,N,N,N,11846,
+41334,11851,N,N,11850,N,41761,N,N,11852,N,N,N,N,N,N,N,N,N,N,N,41763,N,N,N,
+41764,N,N,11853,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11854,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,11855,N,N,N,N,N,N,N,N,N,N,11857,N,11858,N,N,N,N,N,
+N,N,N,41766,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41768,N,N,N,N,N,N,N,62580,N,N,
+N,N,N,N,N,41769,N,N,N,N,N,N,N,41770,N,N,N,N,N,N,N,N,N,N,N,N,41772,N,N,N,N,
+11860,N,N,N,N,N,41773,N,N,N,N,N,N,N,N,N,41774,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41776,N,N,N,N,N,N,11861,N,N,N,N,N,N,11862,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,11863,N,N,N,11864,N,N,N,N,N,N,N,N,N,N,N,11865,N,N,N,N,41779,41780,11866,
+41781,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41782,11868,N,11869,41783,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,11870,N,N,N,N,N,N,N,N,N,N,N,41785,N,11871,N,N,N,N,41786,12158,N,N,N,
+11872,N,N,N,N,N,N,N,N,N,N,41787,N,N,N,N,N,N,N,N,N,N,41788,N,N,N,N,N,N,N,N,N,N,
+41790,N,41789,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11873,N,N,N,N,41792,N,N,N,N,N,N,N,N,
+N,N,N,41794,N,41795,N,N,N,N,N,N,N,N,41796,N,N,N,N,N,N,N,N,N,N,41797,41798,N,N,
+N,N,N,N,N,N,N,N,N,N,11874,N,41799,N,11876,N,N,N,11877,41801,N,N,N,N,11878,N,N,
+N,N,11879,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11881,N,N,N,N,N,N,41803,N,N,
+N,11882,11883,N,N,N,N,N,N,11884,N,N,41804,41805,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,11885,N,N,N,N,N,N,N,41806,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41807,N,N,N,N,N,N,
+N,N,41808,N,N,N,41809,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,11887,N,11888,N,N,N,41812,N,N,N,N,41813,N,N,N,N,N,N,N,N,N,N,N,N,N,41814,N,
+N,11889,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11890,N,N,N,N,N,N,N,N,N,
+11891,N,N,N,N,N,N,41815,N,N,N,N,N,N,N,N,N,N,N,N,N,11892,N,41816,N,N,41818,N,N,
+N,N,N,N,N,N,41819,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41823,N,N,N,N,41824,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41826,41827,11893,N,N,N,N,N,
+N,N,N,N,N,N,20350,N,N,N,N,N,41829,N,N,11894,41830,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,41832,N,N,N,N,N,N,N,N,N,11895,N,N,N,N,N,N,N,41828,N,N,
+N,N,N,N,N,N,N,N,N,N,41833,N,N,N,41834,N,N,N,N,11897,41835,N,N,N,N,N,N,N,11898,
+N,N,N,N,N,N,N,N,N,N,11899,N,N,N,N,N,N,N,N,11900,N,41836,N,N,41837,N,N,N,N,N,N,
+N,41838,11901,N,N,N,N,N,11896,N,N,N,41839,11902,N,N,N,N,41840,N,N,12065,N,N,N,
+41841,41842,N,N,N,N,N,N,N,N,41843,N,N,41844,N,N,N,N,41845,N,N,N,41846,N,N,
+12066,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,41848,N,N,41849,N,41850,N,41851,N,N,N,N,N,N,N,N,N,N,N,12067,41852,41853,N,N,
+N,N,N,N,N,41854,N,N,N,N,12068,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,12069,N,N,N,N,N,N,N,N,N,12070,N,N,N,N,N,N,42017,N,N,N,N,42018,N,N,N,N,
+N,42020,N,N,42021,N,N,N,N,N,12071,N,N,N,N,N,N,N,N,N,N,N,N,N,12072,N,42023,
+42024,N,N,42025,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42027,N,N,N,
+12073,42028,N,N,N,12074,N,42029,N,N,N,N,N,12075,N,N,42030,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,12077,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+42035,N,N,N,N,N,N,N,N,N,42036,N,N,42037,N,12078,N,N,42038,42032,N,N,N,N,N,N,N,
+N,N,N,42039,N,N,N,N,42041,N,N,N,N,N,N,42043,42046,12080,N,N,N,N,N,12081,N,
+42047,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42044,N,N,N,N,N,N,N,42048,
+N,N,N,N,N,N,42049,N,N,N,12082,N,42051,N,42052,42053,N,N,N,N,N,N,42054,N,12083,
+N,N,N,N,N,N,N,N,N,29735,N,N,N,N,N,N,N,N,N,N,42055,N,42056,N,N,N,N,N,12085,N,N,
+N,N,N,N,42057,N,12087,N,12088,12089,N,N,N,12084,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,42059,N,N,N,42060,N,N,N,N,N,N,N,N,42061,N,N,N,12090,42062,N,N,42063,12091,
+N,N,N,N,N,N,N,N,N,42064,12092,N,N,12093,42065,N,N,N,N,42066,12094,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,42067,N,N,N,12095,12096,N,N,42068,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,42069,N,N,N,N,N,N,N,N,42070,N,N,N,N,N,N,N,N,N,N,N,N,N,42071,42072,
+12097,N,N,N,N,N,N,N,N,N,N,42074,N,N,N,N,N,N,N,N,N,N,N,12099,N,42075,N,N,N,N,N,
+42077,N,N,N,N,N,12100,N,N,N,12101,12102,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42079,
+42080,N,N,N,N,N,42081,42082,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,42084,N,N,N,N,N,N,42085,12103,N,N,42086,42087,42088,N,12104,N,N,N,42089,
+12105,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42093,N,12106,
+42094,42095,N,N,N,N,N,N,N,N,N,42096,N,N,N,42092,N,N,N,N,N,N,N,N,N,N,N,12109,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,12110,12111,N,N,N,42099,N,N,12112,N,N,N,N,N,N,N,
+42097,N,N,N,N,N,N,42102,N,N,N,N,N,12113,N,42103,N,N,N,N,N,N,12114,N,N,42104,N,
+N,N,N,12115,12116,N,42106,N,N,42107,N,42108,N,12117,42109,N,N,N,N,12118,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42110,N,42273,N,N,N,N,N,N,42274,N,N,N,N,N,N,
+N,N,N,N,42275,N,N,N,N,N,N,42276,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42278,N,N,42279,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,12120,N,N,12121,N,N,42280,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,12123,N,N,N,N,N,N,N,N,N,N,N,N,12124,42281,42282,N,
+42283,N,42284,42285,N,N,N,42286,N,N,N,N,N,N,N,N,42287,12125,N,N,N,N,N,N,N,N,N,
+N,12127,42288,N,N,N,N,N,N,42289,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42291,N,N,N,
+N,N,N,N,N,N,42292,12130,N,N,N,12129,N,12131,N,N,N,N,N,12132,N,N,N,N,N,12133,N,
+42293,N,N,N,N,N,N,12134,N,N,N,N,N,N,N,N,N,42294,42295,42296,42297,N,N,N,N,
+42298,12135,42299,N,N,N,N,N,N,42300,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42301,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42304,N,N,N,N,N,N,N,N,42306,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42309,N,12137,N,42310,N,N,N,N,N,N,N,N,N,N,N,N,
+N,12138,N,N,N,N,N,N,N,42312,42313,N,N,N,N,N,42314,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+12139,N,N,N,N,N,N,12140,N,N,N,N,N,N,N,N,N,N,N,N,42315,N,N,N,N,12141,N,N,N,N,N,
+N,N,N,N,42316,N,N,N,N,N,N,N,N,N,N,N,N,N,42317,N,N,N,N,N,N,12142,N,N,N,N,42318,
+N,N,N,N,42319,N,N,N,N,12143,N,N,N,N,N,N,N,N,N,N,12144,42320,N,N,N,N,42321,
+42322,N,N,42323,N,N,N,N,N,N,42324,N,N,N,N,N,N,N,N,N,32378,42328,42329,N,N,N,N,
+N,12145,N,N,N,42330,N,N,N,N,N,N,N,N,N,N,N,12146,N,N,N,42331,N,N,N,N,N,42332,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+42333,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42334,N,12147,N,N,N,N,N,12148,N,N,N,N,N,N,
+N,N,N,12149,N,N,42335,N,N,N,12150,N,N,N,N,N,12151,N,N,N,N,N,N,42336,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,42337,N,12152,42338,42339,N,42340,N,N,N,N,12153,N,N,N,N,
+N,N,N,N,N,42341,N,42342,N,42343,N,N,N,N,42344,N,N,N,N,42345,N,N,N,N,12154,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42346,N,42347,N,N,N,42348,N,N,N,N,42349,
+N,N,N,N,N,N,N,N,42351,N,42350,N,N,N,N,42352,42353,N,N,N,N,N,N,N,42354,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,42355,N,12156,N,N,N,N,N,N,N,N,N,N,N,12157,N,N,N,N,N,N,N,
+42357,N,N,N,N,N,N,42356,N,N,N,N,N,N,N,N,N,N,N,N,20309,N,N,N,N,N,N,N,N,N,N,
+42358,N,N,N,N,N,42359,N,N,N,20310,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42360,N,N,
+N,N,N,N,42361,N,N,N,N,N,N,N,N,N,N,N,N,42362,20311,N,42363,N,42364,N,N,42365,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,20312,N,N,43041,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,43042,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43044,N,N,N,N,N,N,N,N,N,N,N,
+N,N,43046,N,N,N,N,N,N,N,43047,N,20313,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+20314,N,N,N,N,43050,N,N,N,N,N,N,N,N,N,N,N,43051,43053,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,20315,N,N,N,N,N,N,N,N,N,N,N,20316,N,N,N,N,20317,N,N,N,N,N,43054,N,20318,N,
+N,N,N,43055,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,32379,N,N,N,43057,N,N,20320,43058,N,N,N,43059,43060,43061,N,
+N,N,N,N,N,43062,N,N,N,N,N,N,N,N,N,20324,N,43065,N,N,N,N,N,N,N,N,N,N,N,43068,N,
+43069,N,N,N,N,20325,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20326,43073,N,43074,20327,N,
+N,43075,43076,N,N,20328,N,N,43078,N,N,N,N,N,N,N,43079,N,N,N,N,20329,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,43081,N,20330,N,N,N,N,20331,N,20332,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20333,43084,N,N,N,N,N,N,20336,N,N,
+43085,N,N,N,N,N,N,N,N,N,N,N,N,43087,N,N,43088,N,N,N,43089,N,43090,20337,N,N,N,
+43086,N,N,N,N,N,43091,N,N,N,N,N,N,N,43092,N,N,N,N,N,N,N,N,43093,N,N,N,20339,
+20340,N,N,20342,N,N,N,N,N,N,N,N,20341,N,N,N,N,N,N,N,N,N,N,N,N,N,43095,N,N,N,N,
+N,N,N,N,43096,N,N,20343,N,N,43098,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20344,N,N,N,
+N,N,N,43101,N,N,N,N,N,N,N,N,N,43103,N,43104,N,N,43105,N,43106,N,N,N,N,N,N,
+20345,N,N,N,20346,N,N,20347,N,N,N,N,N,N,N,N,43107,N,43108,N,43109,N,N,N,20348,
+43111,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20349,N,N,N,N,N,43112,N,N,N,N,N,43113,
+43114,N,N,N,N,N,N,N,43115,N,29736,N,43117,N,N,N,N,43118,43120,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,43122,N,29737,43123,N,N,29738,N,N,N,N,N,N,43125,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,43126,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43127,N,N,N,N,N,N,N,N,N,N,
+43128,N,N,N,N,N,N,N,N,N,N,N,N,43130,N,29739,N,N,N,N,N,29740,N,N,N,N,N,N,N,N,N,
+N,N,N,43132,43133,43134,44065,N,N,N,N,N,N,N,N,32380,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44067,N,N,N,N,
+44068,N,44069,N,N,N,N,N,N,N,N,N,N,N,N,44070,N,N,N,N,29741,44071,N,N,N,N,N,N,
+44072,N,N,N,N,29743,N,N,N,N,N,N,44073,N,N,N,N,N,N,44074,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29744,N,N,N,44076,29745,N,29746,N,N,N,
+N,29747,44077,N,N,N,N,N,44078,N,N,N,N,N,N,N,N,N,N,N,N,N,44079,29748,44081,N,N,
+N,N,29749,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29750,N,29751,N,N,N,N,N,N,29752,N,N,
+29753,N,N,N,N,29754,N,44082,N,N,N,N,N,N,N,N,N,N,N,N,29755,N,N,N,29756,N,N,N,N,
+N,N,N,N,N,N,44083,29757,N,N,29758,N,N,N,N,N,N,N,N,N,N,44084,N,N,N,N,N,N,N,N,N,
+N,29759,44085,N,N,N,N,N,N,N,N,N,N,29760,N,N,N,N,N,44086,N,N,N,N,N,N,N,N,N,N,N,
+N,29761,N,N,N,N,N,44087,N,44088,N,N,29762,N,N,N,N,N,N,N,29763,N,N,N,N,N,29764,
+N,29765,44089,N,N,N,N,N,N,N,N,N,N,N,44090,N,N,44092,N,29766,N,44093,N,N,N,N,N,
+N,44094,44095,44096,N,N,N,N,N,N,N,N,N,29767,N,N,29768,44097,N,N,N,N,N,N,29769,
+N,N,N,N,44098,44099,N,N,N,44100,N,N,N,N,N,N,N,N,44101,29770,N,N,N,N,N,N,29771,
+N,N,44103,29772,N,N,N,N,N,N,N,N,N,44104,N,44105,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+29773,N,29774,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29775,N,N,N,N,44107,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44108,N,N,N,N,N,N,N,N,N,N,44109,N,N,N,N,N,N,N,N,N,N,44110,N,N,N,N,
+N,N,N,29777,29778,N,N,N,N,N,N,N,N,N,44111,N,N,N,N,N,N,N,44113,44114,N,N,N,N,N,
+N,N,N,N,N,N,N,44115,N,N,N,N,N,N,N,N,N,44116,N,N,29779,N,N,N,N,N,N,N,N,29780,
+29781,N,N,N,44117,N,44118,N,29782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44119,N,N,N,
+44120,N,N,44121,N,N,29783,44122,N,44123,44124,N,N,N,N,N,44125,N,N,29784,N,
+44126,N,N,N,N,N,N,N,N,N,N,N,N,29785,N,N,N,N,29786,N,N,N,N,N,N,29787,N,N,44127,
+N,N,N,N,N,N,44129,N,N,N,N,44130,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,44131,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44132,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,29789,N,N,N,N,44134,44135,N,N,N,44136,44137,N,N,N,N,N,
+N,N,N,N,N,N,N,44138,N,N,44139,N,N,N,N,44140,N,N,N,N,N,N,N,N,N,N,N,29792,N,N,
+29791,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44142,N,N,N,N,N,N,N,
+44143,N,44144,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44145,44147,N,N,N,N,N,
+N,N,N,N,N,N,N,29794,44148,N,N,N,N,N,44149,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,29795,N,N,N,N,29796,N,N,44150,N,N,N,N,N,44151,N,N,N,N,44152,44153,N,N,N,
+29797,N,N,N,29798,N,N,N,N,N,N,44154,N,N,44155,N,N,N,N,N,N,N,N,44157,N,29799,N,
+N,N,44158,N,N,N,N,N,N,N,44156,N,N,N,N,N,N,N,N,N,29800,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,44321,N,N,N,N,N,N,N,N,N,N,N,N,44322,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29801,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44323,
+29802,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,29803,44325,44326,N,N,N,N,N,N,29804,N,N,44327,N,N,44328,N,N,N,N,N,N,N,29805,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44331,N,N,44332,N,N,N,29806,
+N,44333,44334,N,N,N,N,44335,N,29807,44336,N,N,N,N,N,N,N,N,N,44337,N,N,N,N,N,N,
+N,N,N,N,44339,N,N,N,N,N,N,N,N,N,N,N,29808,N,N,N,N,N,N,44342,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,29809,N,N,N,N,N,N,N,44343,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44346,N,N,
+N,N,44344,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,44347,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44349,44350,N,N,N,N,N,N,
+44351,N,N,N,44352,N,N,N,N,29810,N,N,N,N,N,44353,44354,29811,N,N,N,N,44355,N,N,
+29812,N,44348,44356,N,N,N,N,N,N,29813,N,N,N,29814,N,N,N,N,N,N,N,N,N,44357,N,N,
+N,29815,N,N,44358,N,N,N,44359,N,N,N,N,N,44360,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29817,N,N,N,N,N,N,N,N,44361,44362,N,44363,N,
+N,29818,N,N,N,N,N,N,N,N,N,N,N,N,29819,N,N,N,N,N,44364,N,N,N,N,N,29816,N,N,N,
+44365,N,N,N,N,N,N,N,N,N,44366,N,N,N,N,N,N,N,N,N,44367,N,N,N,N,N,N,N,N,N,N,N,
+44368,N,44369,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+29821,29822,N,N,N,N,29985,N,N,N,N,N,29986,44370,44371,N,29820,N,29987,N,N,N,N,
+44372,N,44373,N,N,N,N,N,N,N,N,N,N,N,N,44375,44376,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,29988,N,N,N,29989,N,N,N,44377,44378,N,N,N,N,N,N,N,N,N,N,44380,N,N,N,N,
+44381,N,44382,N,N,N,N,N,N,N,44384,N,N,N,29990,N,N,N,N,N,N,29991,N,N,N,N,N,N,N,
+N,44385,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44386,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+44387,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29993,N,N,N,44388,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,44389,N,N,N,N,N,N,44390,N,N,44391,44392,N,N,N,N,44393,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,29994,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44394,N,N,
+44395,N,N,44396,N,N,N,N,N,N,44397,N,N,44398,N,N,N,N,N,N,44399,N,N,N,N,N,N,N,N,
+N,N,44400,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44402,N,N,
+N,N,N,N,44403,N,N,44404,29996,N,N,N,44405,N,N,N,44406,29997,N,N,N,N,N,N,N,N,N,
+N,N,29998,N,N,N,N,N,N,N,N,29999,N,N,44407,30001,N,30002,N,N,N,N,N,44408,30003,
+N,N,N,N,30004,30005,N,30006,N,N,N,N,N,N,30000,N,N,N,N,N,N,N,N,N,N,44409,N,N,
+30008,N,N,N,30009,N,44411,N,N,44410,N,N,N,N,N,44414,N,30011,30012,44577,N,N,N,
+N,N,30013,N,44578,N,30014,N,N,N,N,44581,44582,44583,44584,N,N,N,N,N,30015,N,N,
+N,30016,30017,N,N,44585,N,N,N,N,44586,N,N,N,N,N,N,N,N,N,N,N,N,30018,N,N,44587,
+N,44588,N,N,N,N,N,N,44589,N,N,N,N,N,N,30020,N,N,N,N,N,N,N,N,N,N,N,N,44591,N,N,
+N,44592,30021,N,N,44593,N,N,N,N,N,30022,N,N,N,44595,N,N,N,N,N,N,30023,N,30024,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30026,N,N,N,N,N,N,N,N,N,N,N,N,30027,N,N,N,
+44597,N,N,N,N,N,N,N,N,N,N,N,N,N,30028,30007,44599,N,N,N,44600,N,N,N,N,N,N,N,N,
+N,N,N,N,44601,30029,N,N,N,N,N,44603,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,30031,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30033,30034,N,N,N,44606,
+44607,N,N,N,N,N,N,44608,N,N,N,N,N,N,N,N,44609,N,N,N,N,N,N,N,N,30032,N,N,N,N,N,
+N,N,N,N,N,N,N,N,44613,N,44614,N,N,N,N,30035,N,N,N,N,N,30036,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,44616,30037,N,N,N,N,30038,N,N,30039,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44620,N,44621,N,N,N,N,N,N,N,N,30040,N,N,N,N,30042,N,N,44622,N,N,N,
+N,44623,N,N,N,N,N,N,N,N,N,44624,N,N,N,N,30043,N,44625,N,44626,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,44627,N,N,N,N,N,N,44628,N,30041,N,N,30044,30045,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,44619,N,N,N,N,N,N,N,44632,N,N,N,N,30047,N,44633,N,N,N,N,
+N,N,N,N,N,N,N,N,30048,44634,N,N,N,30049,N,44636,N,N,N,N,N,N,N,44637,N,N,44638,
+N,N,N,N,N,44639,44640,N,N,N,44641,N,N,44642,N,N,N,N,N,30046,N,N,44643,N,44644,
+N,N,N,30050,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44646,N,N,44647,N,N,N,30051,N,N,
+30052,N,N,N,N,44648,N,44649,N,N,N,N,N,44650,N,N,N,N,N,N,N,N,N,N,N,N,N,44651,N,
+N,N,N,N,44652,N,44654,44655,44656,N,44657,N,N,N,N,N,N,30054,N,30055,N,N,N,N,
+44658,44659,N,N,N,N,N,N,30056,N,44660,N,N,N,N,N,N,44661,N,N,N,N,N,N,N,44666,N,
+44667,N,N,30057,N,N,N,44668,N,N,44669,30058,N,N,N,N,N,44670,N,N,44833,N,N,N,N,
+N,N,N,N,N,N,44834,44835,N,N,30059,N,N,N,44836,30060,N,N,30061,30062,N,N,N,N,N,
+44837,N,N,N,44662,30063,44838,N,N,N,44839,N,N,30064,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30067,N,N,N,N,N,
+44843,N,N,N,N,N,N,30068,N,N,N,44845,N,N,30065,N,N,N,N,N,N,N,N,N,N,N,N,N,30069,
+N,N,N,N,N,N,N,N,N,N,N,30070,30071,N,N,N,30072,44846,N,N,44847,N,N,N,N,N,44848,
+N,N,N,N,N,N,N,44849,N,N,N,N,44850,30073,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+44851,N,N,N,44853,N,44854,N,N,N,N,N,N,N,N,N,N,N,N,30075,44855,N,N,N,N,N,N,
+30076,N,N,44856,N,N,N,N,N,N,44857,N,N,44858,N,44859,N,N,N,44860,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,30077,N,44861,N,N,N,N,44862,N,N,N,N,N,N,N,N,N,N,N,30242,44868,N,
+N,N,N,N,30243,30244,N,N,N,44869,44870,N,N,N,44871,44873,30245,30246,N,N,N,N,N,
+N,N,44874,30247,N,44875,N,N,N,30248,N,N,N,N,44876,N,N,44877,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,44865,N,44879,44880,44881,N,N,N,N,N,N,30250,N,N,30251,44882,
+N,N,N,N,N,30252,44883,N,N,44884,N,N,N,N,44886,N,30253,N,44887,N,N,N,30254,N,N,
+N,N,30255,N,N,N,N,N,N,N,N,44888,N,N,N,N,N,N,30256,N,N,N,N,N,N,N,30257,N,N,N,N,
+N,N,44885,N,N,N,44890,N,N,N,N,44891,N,N,N,N,N,30259,N,44892,N,N,N,N,N,44894,N,
+N,30260,N,N,N,N,N,N,N,N,30261,30262,44895,N,44896,N,N,N,30263,N,N,N,N,N,44898,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44899,N,N,N,N,N,N,N,N,44900,N,N,N,N,N,N,N,N,
+N,44902,N,N,N,44901,N,N,N,N,N,N,N,44903,44904,N,N,N,N,N,N,30264,N,N,30265,N,N,
+N,N,44907,N,N,N,N,44908,44909,44910,N,N,N,N,N,N,N,N,N,44911,44913,N,N,N,44914,
+44915,44916,N,N,N,N,N,44918,N,N,N,30268,N,N,30269,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30270,N,N,44920,N,N,N,N,N,30271,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30272,N,N,N,
+44921,N,N,N,N,N,N,N,N,N,N,N,30273,N,44922,N,N,N,N,N,N,N,30274,N,N,N,N,30275,N,
+30276,N,N,N,N,44923,N,N,N,N,N,N,N,N,44924,N,30277,N,N,44925,N,N,N,N,N,N,44926,
+30278,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60961,N,N,N,N,N,N,N,N,N,
+N,N,N,N,30279,N,N,N,30280,60962,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60964,60965,N,N,N,
+N,N,N,N,N,60966,60967,60968,N,N,N,N,N,30282,N,N,N,N,N,N,30283,30284,N,N,60969,
+N,N,N,N,N,N,N,N,N,N,N,60970,60971,N,N,N,N,N,N,60972,N,N,60973,N,N,N,N,N,N,N,N,
+N,N,N,N,N,30285,60974,N,N,30286,N,N,N,N,60975,N,N,N,60976,N,30287,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30288,N,60977,60978,N,
+N,N,60979,N,N,N,N,60981,N,N,N,N,N,N,N,N,N,N,N,N,N,60982,N,N,N,N,N,N,N,N,N,N,N,
+30289,N,60983,30290,N,N,N,N,N,N,N,N,N,N,61007,N,N,N,N,N,60984,N,N,N,N,N,N,
+30292,N,30293,N,N,N,N,N,N,N,N,N,N,N,N,N,60985,30294,30295,N,N,60986,N,N,N,N,N,
+N,N,N,N,N,60988,60989,N,60990,30296,N,N,N,30297,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30291,N,N,60991,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,60992,N,N,N,30299,N,N,
+N,N,N,N,N,N,N,60993,N,N,N,30300,N,60995,N,N,N,60996,N,60997,N,N,N,30301,N,N,N,
+N,N,N,N,N,60998,N,30302,60999,61000,30303,N,N,N,N,N,N,N,N,N,N,N,N,30298,61002,
+N,N,N,30305,N,N,N,N,N,61003,N,N,N,30306,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,61004,N,61005,61006,N,N,N,N,N,N,30307,61008,N,30308,N,N,61029,N,N,N,N,
+30309,N,N,61009,N,N,30310,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30311,N,N,61010,N,N,61011,N,61012,N,N,N,N,30312,N,N,N,N,N,N,N,N,N,N,61013,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,61014,61015,30314,N,N,N,N,30315,N,30316,61016,N,N,
+61017,N,N,N,61018,N,N,30317,N,N,N,61019,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30318,61025,30319,N,61026,N,N,N,N,N,61027,N,N,N,N,N,N,N,N,N,N,30320,N,N,61028,
+N,30321,N,N,N,61030,N,N,N,N,N,61031,61032,61033,N,N,N,N,N,30322,N,N,N,30323,
+30324,N,30325,N,61034,N,N,N,N,N,N,N,N,N,61035,N,N,N,N,N,N,N,N,N,N,N,N,61036,N,
+N,N,N,N,30326,61021,N,N,N,N,N,N,61038,N,N,N,61039,N,N,N,N,61040,N,N,N,N,N,N,N,
+N,N,N,61042,N,30328,N,61037,N,N,N,N,N,61043,N,N,N,N,N,N,N,30329,N,N,N,61044,
+61045,N,61046,61047,N,N,61048,N,61049,N,61050,61051,N,N,61052,N,N,N,N,30330,N,
+30331,N,N,N,N,61053,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61217,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,61218,N,N,N,30332,N,N,N,N,N,30333,N,N,61219,N,N,N,N,N,N,N,N,N,N,61220,N,
+30334,N,61221,N,N,N,30497,N,N,61222,N,N,N,30498,N,N,N,N,N,N,N,N,N,N,61223,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61225,N,N,N,N,N,N,N,N,N,N,N,N,N,61226,N,61227,
+61228,N,61229,N,N,N,30499,N,N,N,N,N,N,N,61230,N,30500,N,N,N,N,N,N,N,N,N,N,
+61231,N,N,N,N,30502,N,N,N,N,30503,N,N,N,30504,N,61224,61232,N,N,N,N,N,61233,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30505,61235,N,N,N,N,61236,N,30506,61237,
+N,N,N,30507,N,61238,30508,30509,N,N,N,N,N,61239,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,61241,30510,N,N,N,N,N,N,N,N,N,30511,N,N,N,30512,30513,N,N,61242,N,N,
+N,30514,N,61243,N,61240,N,N,N,N,N,N,61245,30515,N,N,N,N,61246,N,30516,N,N,N,N,
+N,N,N,61247,N,N,N,N,N,61249,30517,N,N,N,N,N,30518,N,61244,N,N,N,N,N,N,N,N,
+30519,61250,61251,30520,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61252,N,N,N,61253,N,N,N,
+N,N,N,N,N,N,N,61254,N,N,N,N,N,N,30522,N,N,N,N,30523,N,N,N,30521,N,N,61256,
+61257,N,N,N,N,30524,30525,61258,N,N,61259,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,61260,N,N,N,N,30526,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61262,61263,N,
+61264,N,N,N,N,N,N,61265,N,N,N,61266,N,N,30527,61267,N,N,30530,N,N,N,N,N,61269,
+N,N,N,N,N,N,N,N,30528,30529,N,N,N,N,N,30531,61270,N,N,N,61271,N,N,61272,N,
+61273,N,N,N,N,N,N,30532,61274,N,N,N,N,N,N,N,61275,N,N,61276,N,N,N,30533,61277,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,61278,N,61279,N,N,N,N,N,N,N,61282,N,N,N,N,30534,N,
+N,N,N,N,N,30535,N,N,N,N,N,61283,N,N,N,N,N,30536,N,N,N,61280,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,61286,N,N,N,N,N,N,61287,N,61288,30537,N,N,N,30538,N,N,N,61289,N,N,N,
+N,N,N,N,30539,N,N,N,N,N,N,N,61285,61290,61291,N,61292,61293,61294,N,N,N,61295,
+N,N,30540,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30542,N,30543,N,N,N,N,N,N,N,N,N,N,30541,
+N,N,30544,61297,30545,61298,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30546,
+30547,N,N,61300,N,N,N,N,N,61299,30548,30550,61301,N,N,N,N,N,N,N,N,30551,N,
+61302,N,30552,N,N,N,N,N,N,N,30553,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,61305,N,N,N,N,30555,N,30556,N,N,N,N,N,N,N,N,N,N,30557,N,N,N,61304,N,N,N,N,
+61306,N,N,N,N,61307,N,61308,N,N,N,N,N,N,N,N,N,N,N,61309,61310,N,N,N,61473,N,N,
+N,N,N,N,30559,N,N,N,N,N,N,30558,N,N,30560,N,N,N,N,N,N,61475,N,N,N,N,N,N,N,
+61476,N,N,N,N,N,61477,N,N,61478,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,30561,30562,N,N,N,N,N,N,61479,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30563,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61482,N,N,N,N,N,N,N,N,61483,N,
+N,N,61484,61485,N,N,N,N,N,N,N,N,61487,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61488,N,
+30564,30565,61489,N,N,N,N,N,N,N,N,N,N,N,61490,N,N,N,N,N,N,N,N,N,N,61492,61493,
+N,N,N,N,N,N,N,N,61494,N,N,N,N,N,N,61495,N,N,N,N,N,N,N,N,N,N,N,N,N,30567,61496,
+N,N,N,N,N,N,N,N,N,N,N,N,30568,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61498,61499,N,
+61500,61501,N,N,N,N,N,N,N,N,N,N,N,N,30569,N,30570,61502,N,N,N,N,N,N,N,N,N,N,
+61504,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,61507,N,N,N,N,N,N,61508,30571,61509,N,N,N,N,N,N,N,N,N,N,61510,N,N,N,N,N,
+61511,61512,N,N,N,N,N,N,N,N,N,N,N,N,N,30573,30574,N,N,N,61515,N,N,N,N,61516,N,
+61517,N,N,N,N,N,61514,N,N,N,61518,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30576,N,
+61519,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30577,N,N,N,N,61521,61522,N,61524,
+61525,N,61526,N,N,N,N,N,61527,N,N,N,N,30578,N,N,N,N,61528,N,N,N,61529,N,N,N,N,
+61530,N,N,N,N,N,N,N,N,N,61531,30579,N,N,61532,N,N,N,61533,N,61534,30580,30581,
+N,30582,N,N,61535,30583,N,61536,N,N,30584,N,N,N,N,N,N,N,N,N,61537,N,61538,N,
+61539,N,N,61540,N,N,61541,N,N,N,N,N,61542,N,N,N,30585,N,61543,N,N,N,30586,N,N,
+N,N,N,N,30587,N,N,30588,N,N,N,N,N,N,N,61544,N,30589,N,N,N,61545,N,30590,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,61546,61548,61549,N,N,N,N,N,30753,N,N,30754,N,N,N,N,N,
+N,N,N,61547,N,N,N,N,N,N,30755,30756,N,N,N,N,N,N,N,N,61550,N,30758,N,30759,N,
+30760,30761,30762,N,30763,30764,30765,61551,N,N,N,N,N,N,N,61552,N,N,N,N,N,N,
+61554,N,N,61555,30766,N,30767,30768,N,N,N,30769,N,61556,N,N,N,N,61557,61553,N,
+N,N,30770,N,N,N,N,N,61558,N,N,N,N,30771,N,N,N,N,N,N,N,N,30772,N,30773,N,N,N,
+61559,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61560,N,N,N,61561,30774,30775,61562,30776,
+N,N,N,N,N,N,30781,N,61564,N,N,N,N,61565,30777,61566,N,N,30778,N,N,30779,61729,
+61730,N,30780,N,61731,30782,N,30783,30784,61732,61733,N,N,N,N,N,N,N,N,N,30785,
+N,N,N,61734,61736,61735,N,N,N,30786,N,N,N,N,N,N,N,N,30787,30788,N,N,N,N,N,N,N,
+N,N,N,N,N,61737,N,61738,N,30789,N,N,N,61739,N,N,N,N,N,N,N,N,N,N,N,N,61741,N,N,
+N,61740,N,N,N,N,N,N,N,N,N,N,61743,N,N,N,N,30790,30791,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,30792,N,N,N,N,N,N,N,N,61745,N,N,N,61746,N,N,N,N,N,61747,N,N,
+N,N,30793,N,N,N,N,N,N,N,N,N,N,N,N,N,61750,61751,N,61752,N,N,N,N,N,N,N,61753,N,
+N,N,N,N,61754,N,61755,N,61756,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,61757,N,N,30794,N,61759,61758,N,N,N,N,N,N,30795,61760,N,N,61761,61762,N,N,
+61763,N,N,N,N,N,N,N,N,N,N,61765,N,N,N,N,N,30796,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61767,N,N,N,N,N,N,N,N,N,N,N,N,N,61769,N,N,N,N,N,N,61770,N,N,N,N,N,N,N,61771,
+61772,N,N,N,N,N,61773,N,N,N,N,N,N,N,30798,61774,N,N,N,61775,N,N,N,N,N,N,N,N,N,
+61776,N,61777,61778,N,N,N,30799,N,N,61779,N,N,N,N,61780,N,61781,N,N,61782,N,N,
+N,N,N,N,N,61783,30800,N,30801,61784,N,N,N,61786,30802,N,N,N,N,N,N,61787,N,N,N,
+61790,N,30803,30804,N,61785,30805,N,61791,61792,N,30806,N,N,N,N,N,N,61794,
+32381,N,61795,N,N,N,N,30807,N,N,N,N,N,61797,N,30808,N,N,N,N,N,N,61796,N,N,N,N,
+61800,N,30809,N,N,N,N,N,61802,N,30810,N,N,N,N,N,N,N,N,N,61803,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,30811,30812,N,N,N,N,N,N,N,30813,61805,30814,N,30815,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,30816,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61806,N,N,N,N,N,
+30817,61807,30818,30819,N,61809,61808,N,N,N,N,30820,61810,61811,N,30821,N,N,N,
+N,61812,N,N,N,N,N,N,30822,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30823,N,N,N,61814,N,N,
+30824,N,30825,N,N,N,N,N,30826,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30827,N,61816,
+N,N,N,61817,N,N,N,N,30828,N,N,N,N,N,N,N,N,N,N,30829,30830,N,N,N,N,N,N,N,N,N,N,
+N,N,61819,N,30831,61820,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61821,N,N,N,N,N,N,
+30832,61822,30833,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30834,N,N,N,N,N,N,30835,30836,
+N,N,N,N,N,N,N,N,N,61989,N,N,N,30837,N,N,30838,61990,N,30839,N,N,N,N,N,N,N,
+61991,N,N,N,N,N,N,N,61993,N,N,N,N,N,N,N,30840,N,61994,61995,N,N,30841,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30842,N,N,N,N,N,61998,N,N,N,N,61999,N,N,62000,N,
+62001,N,N,N,N,62002,30843,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62003,62004,30844,N,N,N,
+62005,N,62006,N,N,N,62007,N,62008,N,N,N,62010,N,N,N,62011,N,N,N,N,N,N,62012,
+62014,62015,N,N,62016,N,N,N,62017,N,N,N,N,N,N,N,N,N,N,N,62018,N,N,N,N,N,N,N,
+62019,N,N,N,N,N,N,N,N,N,N,62020,30845,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,31009,N,N,N,62021,N,N,N,N,N,N,31010,31011,N,31012,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,62022,N,N,N,31013,N,62023,N,N,N,31014,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,62025,N,N,N,N,N,N,N,N,N,62026,N,N,N,N,N,N,N,N,62028,
+62029,62030,N,N,N,N,62027,N,N,N,N,N,N,N,N,31018,N,N,31016,N,N,N,N,N,N,N,N,N,N,
+62031,N,N,N,N,N,N,N,N,N,N,N,N,62032,N,N,N,62033,N,62034,N,N,N,N,N,N,62035,N,N,
+N,N,N,N,N,N,N,N,62036,62037,N,N,31019,N,62038,N,N,N,N,N,N,N,N,N,N,N,31020,N,N,
+N,N,31022,N,62039,62040,62041,N,N,62042,31021,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+62044,N,N,N,N,N,N,N,N,N,N,62045,31023,N,N,N,N,N,N,N,N,62047,N,N,N,N,N,N,N,N,
+31024,N,62046,31025,N,N,31026,N,N,N,N,N,N,62048,N,N,N,N,N,N,N,N,N,31029,31030,
+N,N,N,62049,N,N,N,N,N,N,N,N,N,N,N,N,N,62050,N,N,62051,31034,N,N,N,N,N,N,N,N,N,
+N,62053,N,N,N,N,N,N,N,N,N,N,62054,N,N,N,N,N,N,31038,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,62055,62056,62057,N,31042,N,N,62058,N,N,N,N,N,62059,
+N,N,N,N,N,N,N,62060,N,N,N,N,N,N,N,31043,N,N,62061,N,N,N,31044,N,N,62062,N,N,N,
+N,N,N,62063,N,N,N,N,62064,31045,N,31046,N,62065,62066,N,N,N,N,N,N,31048,N,
+62067,N,N,N,N,N,N,N,31049,N,N,N,N,N,N,N,N,N,N,N,N,31050,N,31051,31052,N,N,N,N,
+N,N,62072,N,N,N,N,N,N,62073,N,N,N,62074,N,N,N,N,N,62075,N,N,62076,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,62078,N,N,N,N,N,N,N,N,N,N,62241,31054,N,N,N,N,N,N,N,N,N,N,N,N,
+N,62242,N,N,N,N,62243,N,N,N,N,N,N,N,N,N,62244,N,N,62245,N,N,62246,31055,N,
+62247,62248,N,N,N,N,N,N,62249,N,N,62250,N,N,31056,N,N,N,N,N,N,N,62251,N,N,
+62252,N,N,N,N,N,N,N,N,N,62253,N,N,31058,N,N,N,N,62254,N,N,N,N,N,62255,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,31059,N,N,62256,N,N,N,N,N,N,N,N,62257,N,N,N,N,N,N,31061,
+N,N,N,N,N,62260,N,31062,62261,N,62262,N,N,N,N,N,N,N,N,N,N,N,N,N,62264,N,31063,
+N,N,62265,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62266,62267,N,N,31064,N,N,
+N,N,N,N,N,N,62268,N,N,N,N,N,N,N,N,31065,62271,N,N,N,N,N,N,N,N,N,N,31066,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62274,N,N,62275,N,N,31067,62276,62277,N,
+62278,N,N,N,N,N,N,N,N,N,31068,N,62273,N,N,N,62282,N,N,N,N,N,31069,N,N,N,N,N,N,
+31070,N,N,N,N,N,N,62284,N,N,N,N,N,N,N,N,N,N,31071,N,N,N,62286,N,62287,N,N,
+62288,N,N,N,31072,N,31073,N,N,31074,62289,N,N,N,N,N,62285,N,N,N,N,N,62281,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,62292,62293,N,N,N,N,N,N,N,N,N,62294,N,N,31075,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,62296,N,N,N,N,N,62297,N,N,N,N,N,N,62298,N,N,N,N,N,
+N,N,N,62299,N,N,N,N,62300,N,N,N,N,N,N,N,N,N,62303,N,62304,31077,N,31078,62305,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62306,N,N,N,N,N,62307,31079,N,62308,N,N,N,N,N,N,
+N,62309,N,N,62310,62311,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31081,N,31082,N,N,N,N,N,
+62312,N,N,N,N,N,N,N,N,N,N,31080,N,31083,N,N,31084,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+62313,N,N,N,N,62314,N,N,N,N,N,N,62315,N,N,N,N,N,62316,N,31087,N,N,N,N,62317,N,
+N,62318,N,N,N,N,N,N,N,62319,N,N,N,31088,62320,62321,62322,N,N,N,N,N,N,N,N,
+31089,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31090,N,N,N,N,31091,N,N,N,N,N,
+N,N,N,N,N,N,31092,N,N,N,N,N,62326,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62328,62329,N,
+N,N,N,31093,N,N,62330,N,N,N,N,62332,N,N,N,62334,N,N,N,N,62497,N,N,N,N,N,N,N,
+31094,N,62499,N,31095,N,N,N,31096,N,N,N,N,N,N,N,N,62501,N,N,N,N,62502,N,N,N,N,
+N,N,N,N,N,62504,62505,N,N,N,31097,31098,62506,N,N,N,N,N,N,N,N,62508,31099,N,N,
+N,N,N,N,N,N,N,31100,62509,N,N,N,N,31101,N,N,N,N,N,N,N,N,N,N,N,N,N,31102,N,N,N,
+N,N,N,N,N,N,N,N,62512,62513,N,62514,31265,N,N,N,N,N,62515,31266,N,N,N,N,N,N,N,
+N,N,N,31267,N,N,N,N,N,62519,62520,N,31268,N,N,N,N,N,N,N,N,N,N,N,N,N,62521,N,N,
+N,N,N,62522,N,N,N,N,N,N,N,N,N,31269,N,N,N,N,62524,N,N,N,31270,N,N,62526,N,
+62527,N,N,31271,62528,N,N,N,N,N,N,N,N,N,N,62529,N,N,N,N,N,62531,N,N,31272,N,N,
+N,N,N,31273,62532,N,N,62533,N,N,N,N,N,N,N,N,N,N,N,62534,62535,N,N,N,N,N,N,N,N,
+62536,N,31274,N,N,N,N,N,N,N,N,N,31275,N,N,N,N,N,N,N,N,N,31276,62537,N,62538,N,
+N,N,N,N,N,N,N,N,31277,N,N,62539,N,N,N,N,N,N,N,N,N,N,62540,N,N,N,N,N,N,N,62541,
+31280,N,N,N,N,N,N,N,62545,31281,N,N,N,31282,N,62546,N,N,N,N,N,62547,N,N,62548,
+N,N,N,N,N,N,62549,31279,N,N,N,62550,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,62551,N,31284,N,N,N,N,N,N,N,N,N,N,31285,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+31286,N,N,N,N,N,N,N,N,N,32382,N,N,N,N,N,N,N,62552,N,62553,N,N,N,N,N,N,N,N,
+62554,N,N,N,N,N,N,N,62555,62556,N,N,31287,N,N,31288,N,N,N,62558,N,N,N,N,N,N,
+62559,N,62560,62563,62562,N,62564,N,N,N,N,62565,62566,N,N,31289,N,N,N,N,N,N,N,
+62567,N,N,62570,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62572,N,62573,62574,N,N,N,N,N,N,N,
+N,62575,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62576,62577,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,62579,31291,N,N,N,N,62582,31292,N,N,N,N,62583,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,62584,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31293,N,N,N,62586,N,N,N,N,N,N,N,
+N,N,N,31294,62587,N,N,N,N,N,N,N,N,N,N,N,31295,N,N,N,31296,N,N,N,62588,N,62589,
+N,N,N,N,N,N,31297,N,31298,62590,N,N,62753,N,N,N,N,N,N,N,31299,62754,N,N,N,N,N,
+62756,N,62755,N,N,N,62757,N,N,62758,N,N,31301,N,62759,N,N,N,N,N,N,N,N,N,N,N,N,
+N,62760,N,31302,N,N,N,N,N,62761,N,N,N,62762,N,N,N,N,31303,N,31304,N,N,N,N,
+31305,N,N,N,N,N,N,62763,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,62764,N,N,N,N,N,N,N,N,N,N,62765,N,N,N,62766,N,N,N,N,N,62767,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62768,N,N,62769,N,N,N,N,
+N,N,N,62770,N,N,62771,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62772,N,N,N,N,N,N,N,N,N,
+N,N,N,62774,N,N,N,N,31306,N,N,N,N,N,N,N,N,N,N,62775,N,31307,62776,N,N,N,N,N,N,
+N,31308,N,N,N,N,N,62777,N,N,N,N,N,N,N,N,N,N,N,N,31309,N,62780,N,N,N,N,N,62781,
+62779,N,N,N,N,N,N,N,N,62784,N,31310,N,N,N,N,N,62785,N,N,N,N,N,62787,N,N,62788,
+N,N,N,N,62789,N,N,N,N,N,N,N,N,62783,N,N,N,N,N,N,N,62791,N,N,N,N,N,N,N,N,N,N,N,
+N,31311,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31312,N,N,N,N,N,N,31313,
+31314,62793,N,N,N,31315,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62795,N,N,62797,
+62798,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62800,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,62801,N,N,N,N,N,N,N,N,31316,N,N,N,N,N,62802,N,62803,N,N,N,
+N,N,N,31317,N,N,N,N,31318,N,N,N,N,N,N,62804,31319,N,N,N,62805,N,N,N,N,N,N,N,N,
+62807,N,N,N,N,N,N,N,62809,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62811,N,62812,62814,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62816,N,N,N,N,N,N,N,62817,62818,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,62820,N,62821,N,N,N,N,N,N,N,62822,N,N,N,N,N,N,N,N,
+62825,62823,N,N,62824,N,62827,N,N,N,62829,N,N,N,N,N,N,N,62831,N,N,N,N,62833,N,
+N,N,31323,N,N,62834,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31324,N,N,N,N,62838,N,N,N,
+62840,N,62841,N,N,N,62842,N,N,N,N,N,N,62843,N,N,N,31326,N,N,N,N,62844,N,N,N,N,
+N,N,N,N,N,N,N,N,N,31327,N,31328,31329,N,N,62845,62846,31330,N,N,N,N,31331,N,N,
+N,63009,N,63010,N,N,31332,N,N,63011,N,63012,N,31333,31334,N,N,N,N,N,N,31335,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,31336,N,N,N,N,N,N,N,N,N,N,N,N,63013,N,N,N,N,N,63014,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,63015,N,N,N,N,N,31337,31338,31339,31340,N,N,N,N,N,
+63016,63017,N,N,N,63018,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63020,N,63021,N,N,N,N,
+31342,N,N,N,N,N,N,N,N,N,N,31343,N,N,63022,N,N,N,N,N,N,N,N,N,31344,N,63023,N,N,
+N,N,N,N,31345,63024,N,N,31346,N,N,N,N,N,N,N,N,N,31347,N,N,63019,31348,N,63025,
+N,N,N,N,N,N,N,N,N,N,31341,44618,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,31349,N,63027,N,N,N,N,N,N,31350,N,N,N,N,N,N,63030,N,N,N,N,31351,N,63031,
+63032,N,N,31352,N,N,63033,N,63034,N,N,N,N,N,N,N,N,N,31353,N,31354,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31355,31356,N,N,N,N,N,N,31357,N,63035,N,N,N,N,N,
+31358,63036,31521,N,N,63037,N,N,N,N,N,N,N,N,63038,N,N,N,31522,N,N,N,63039,N,N,
+N,N,31523,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63040,31524,N,N,N,N,31525,N,N,N,31526,N,
+N,N,N,63041,N,63042,N,N,N,63043,N,63045,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,63046,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31528,N,63047,N,
+N,N,N,63048,N,63049,63050,N,N,N,N,N,N,63051,63052,N,63053,N,N,31529,N,N,N,N,N,
+63055,N,N,N,N,N,N,N,N,N,N,31530,N,N,31531,N,N,63056,N,63057,N,N,N,63058,N,N,N,
+N,63059,N,N,N,31532,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63062,N,N,N,N,N,N,31533,
+N,N,N,N,N,N,N,63063,N,N,N,N,N,N,N,N,31534,N,N,N,N,31535,N,N,N,N,N,31536,N,N,N,
+63064,N,31537,N,31538,N,N,N,N,N,N,N,N,N,N,N,63066,63067,N,N,N,63068,N,N,N,N,N,
+N,N,N,63061,N,N,N,N,N,N,N,N,N,N,63070,N,N,63071,N,N,N,N,63072,63073,63074,N,N,
+N,N,N,N,N,N,63075,N,N,63076,63077,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63078,N,N,31541,
+N,N,N,N,31542,63079,63080,N,N,N,N,N,63081,N,N,N,31543,N,N,31540,N,63082,N,N,N,
+N,N,N,N,N,N,63087,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63083,N,63088,N,63089,N,N,N,
+N,N,31544,N,N,N,N,63090,N,N,63091,63092,N,31545,N,N,N,N,N,N,N,N,N,N,63084,N,N,
+N,N,N,N,N,N,N,N,31548,63094,N,63095,N,63096,N,63097,N,N,N,N,63098,N,N,N,N,N,
+31549,N,N,31550,N,N,N,63099,N,N,N,N,N,N,N,N,N,63100,N,63101,N,N,31551,N,N,N,N,
+N,N,N,N,N,N,31547,N,N,31552,N,N,N,N,N,N,63267,N,N,N,N,63268,N,N,N,N,N,N,N,N,N,
+N,63269,N,N,63270,31553,N,N,31554,N,N,N,N,N,N,N,N,N,63271,63272,N,N,N,N,N,
+63273,N,63274,N,N,N,N,63275,N,N,N,N,N,N,31555,N,N,N,N,N,N,N,N,63276,N,N,N,N,N,
+N,N,N,31557,63277,N,N,N,31558,31559,N,N,N,N,N,N,N,N,N,N,31560,63278,31556,N,N,
+N,N,N,31562,N,N,N,N,N,63279,N,N,63280,N,N,63281,N,N,63282,N,31563,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,31564,63284,N,N,63285,N,N,N,63287,12136,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,63289,N,N,63290,31565,N,N,N,31566,N,N,N,N,N,N,31568,N,N,N,N,N,N,N,
+N,N,31570,N,N,63291,N,N,N,N,N,31571,N,63292,N,N,63293,N,N,N,N,N,N,N,N,N,N,N,N,
+63294,N,63295,N,N,N,63296,N,N,N,63297,N,N,N,N,N,N,31572,N,N,N,63298,63299,N,N,
+N,N,N,N,N,N,N,N,63300,N,N,N,N,N,N,N,N,63302,N,63303,N,N,N,N,31573,N,N,N,N,N,N,
+N,N,63304,N,63305,N,N,N,N,N,N,N,N,N,N,N,N,N,63306,N,N,N,63307,N,63308,N,N,N,N,
+N,N,N,N,N,N,N,63309,N,N,63310,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31574,N,
+31575,31576,63312,N,63313,N,N,N,31577,N,N,63314,N,63315,N,N,63316,N,N,N,N,N,
+63317,N,N,N,N,N,63318,N,63319,N,63320,N,N,N,N,N,N,N,N,N,N,N,N,N,63321,N,N,N,N,
+N,N,N,N,63322,N,N,N,63323,N,63324,N,N,63325,N,N,N,N,N,N,N,N,N,N,N,N,N,63326,N,
+N,N,N,N,N,63327,N,N,N,N,N,N,N,N,N,N,N,63328,63329,N,N,N,N,N,N,N,N,N,N,N,31578,
+63330,N,N,N,N,N,N,N,N,N,63331,N,N,N,N,N,N,N,N,N,N,31579,31580,63335,N,63336,N,
+N,N,N,N,N,N,63337,N,N,N,N,N,N,N,N,N,N,N,N,63338,N,N,N,N,N,N,63334,N,N,N,N,
+31581,31582,N,N,N,N,N,N,N,31583,N,N,N,N,N,N,N,N,63341,N,N,63343,N,N,N,N,N,N,N,
+N,N,N,N,N,63344,N,N,N,N,N,N,N,31585,N,N,N,N,N,N,N,N,63346,N,N,N,63348,N,63349,
+63350,N,N,N,63351,63352,31586,63353,N,N,N,N,N,N,N,63345,63354,N,63355,N,N,
+31587,N,N,N,31588,63356,N,N,N,N,31589,N,N,63357,31590,N,N,N,N,N,N,N,N,N,N,
+31591,N,N,N,N,N,N,N,N,63358,N,N,N,N,N,63521,N,N,N,63522,N,N,N,N,N,N,N,N,N,
+63523,N,N,N,N,N,N,N,N,N,N,N,N,N,63525,N,N,N,N,N,N,N,N,N,N,N,N,N,63526,N,N,N,N,
+N,N,63527,N,N,N,N,63528,N,N,N,N,63531,N,N,N,N,N,63533,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31592,N,N,N,N,N,N,N,
+63534,N,N,N,N,N,N,N,N,N,31593,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63535,63536,
+63537,N,63538,N,N,N,N,N,N,N,N,N,31594,N,N,N,31595,N,N,63541,63539,63542,N,N,N,
+N,N,N,N,63543,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63544,63545,N,N,N,31597,
+63547,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31600,31601,31602,N,31598,N,
+N,N,N,N,N,N,N,N,N,31603,N,N,N,N,N,N,N,N,31604,N,31605,N,N,N,N,63549,N,31606,N,
+N,N,N,N,N,31607,N,63551,N,N,63552,N,N,N,63553,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,63556,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,63557,N,N,N,N,N,N,N,N,63558,N,N,N,N,N,N,63559,N,N,N,31608,N,N,N,N,N,N,N,N,N,
+N,63560,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63561,N,N,N,N,N,N,63562,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31610,N,63563,N,63564,N,N,N,N,N,N,N,
+N,N,N,N,N,31611,N,N,N,N,N,63565,N,N,N,N,N,63567,N,63568,N,N,31612,N,N,N,N,N,N,
+63569,N,63570,63572,31613,N,63573,31614,N,N,N,N,N,N,N,N,N,N,N,63575,31777,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63576,N,31778,N,N,N,N,N,N,63577,N,N,N,N,N,N,
+63578,N,31779,N,N,N,N,N,63579,31780,N,N,N,N,N,N,N,N,N,63580,N,N,N,N,31781,N,N,
+N,31782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31783,N,N,N,31784,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63582,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,31785,N,N,N,N,N,N,63581,N,N,N,N,N,N,N,N,63583,N,N,N,N,N,N,63584,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,31786,N,N,N,N,N,N,63585,N,N,N,N,N,N,N,31787,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,31788,N,31789,N,N,N,N,N,63586,63589,N,N,N,N,63588,
+N,N,63590,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63591,N,N,63592,N,N,N,N,N,N,N,N,N,N,N,N,
+N,63593,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63594,N,N,31793,N,N,N,N,N,N,
+N,N,N,N,63596,N,N,31794,N,N,N,N,31795,N,N,N,N,63597,N,N,N,N,N,N,N,N,N,N,31796,
+N,N,N,N,N,N,N,N,N,N,N,N,63598,N,N,N,N,N,N,N,N,63599,N,63600,N,N,N,N,N,N,N,N,N,
+63601,N,N,N,N,N,N,N,N,63602,63603,N,N,N,N,N,N,63604,31797,63605,63606,N,N,N,
+63608,N,N,N,N,N,N,N,63611,N,63612,N,31798,N,N,N,N,N,63613,N,N,N,N,63614,N,N,
+63777,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31799,63778,N,N,N,63779,N,N,N,N,N,63780,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63783,63782,N,N,N,
+N,N,63784,N,63786,N,N,N,N,N,N,N,N,63787,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63789,63788,N,N,
+63790,N,N,N,N,N,N,N,31801,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63792,63793,N,N,31802,N,
+N,N,31803,N,N,N,N,N,31804,63795,N,N,N,N,63796,N,N,N,31806,N,N,N,N,N,N,N,N,
+31807,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,63797,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63798,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,63799,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63800,N,N,N,N,N,N,
+N,N,31808,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63802,N,63803,N,N,N,N,N,
+31809,N,N,31810,N,N,N,N,N,31811,N,63804,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+63805,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63808,63809,N,N,N,N,N,63806,N,N,N,N,N,N,
+N,63811,N,63812,N,N,N,N,N,N,N,N,N,31812,63813,63814,31813,N,N,N,63815,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,63818,N,N,63819,N,N,N,31814,N,N,N,N,N,N,N,N,N,N,N,N,N,
+63820,N,N,N,N,N,N,N,N,63821,N,N,N,N,N,N,N,N,N,N,N,N,N,63822,N,N,N,N,N,N,N,N,N,
+63823,63824,N,63825,31815,N,N,N,N,N,N,N,N,N,N,31816,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63826,N,N,N,N,N,63827,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,63828,N,N,N,N,63829,N,63830,63831,N,N,N,N,63832,N,N,N,N,31818,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,63834,N,N,63835,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63837,31820,63839,N,N,N,N,N,N,N,63840,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,63841,N,N,N,N,N,N,31821,N,N,N,N,N,N,N,N,N,N,N,N,63842,N,
+31822,N,N,N,N,N,N,N,N,31823,N,N,N,N,N,N,N,N,N,63843,N,N,N,N,N,N,N,N,N,63844,N,
+N,N,N,N,N,N,N,N,31824,N,N,N,63845,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,63847,N,31826,N,N,N,N,N,N,N,N,N,N,N,N,N,63848,
+31827,63850,N,N,N,N,N,N,N,N,N,N,63852,N,N,N,N,63853,N,N,N,63855,N,N,63856,N,N,
+N,N,N,63857,N,63858,N,N,N,N,N,N,N,N,N,N,63859,N,N,N,31828,N,N,N,31829,N,N,N,N,
+N,31830,N,N,63860,N,N,N,63861,N,N,N,N,N,63862,63863,N,N,N,N,N,31831,N,N,N,
+63864,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31832,N,
+N,N,N,N,N,N,N,N,63865,N,N,N,N,N,N,N,N,N,N,N,63867,63868,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,63869,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64034,N,N,31834,N,N,N,64035,N,N,N,64036,N,N,N,
+N,31835,N,31836,N,31837,N,31838,N,N,N,N,N,64038,31839,N,N,N,N,N,N,N,N,N,N,N,N,
+N,64040,N,N,31840,N,N,64041,N,N,N,N,N,N,N,31841,N,N,N,N,64042,31842,31843,N,
+31844,64043,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31845,N,N,N,N,64045,31846,31847,64046,
+N,N,N,N,N,N,N,N,N,N,N,64051,N,N,N,31848,N,N,64049,N,31849,N,64048,N,N,N,N,N,N,
+N,64052,64053,64050,N,N,N,64054,N,64055,N,N,N,N,N,N,N,N,N,N,N,N,N,31851,31852,
+31853,N,64056,N,N,N,64057,N,64058,N,N,N,31854,31855,N,N,N,31856,N,N,N,N,N,N,N,
+31857,N,31858,N,N,31859,N,N,64059,N,64060,64061,N,N,31860,N,N,N,N,N,N,N,N,
+64062,64063,31861,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64064,N,64065,N,31862,N,N,N,N,N,
+64066,N,N,64067,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64068,N,N,N,N,64069,N,N,N,N,N,N,
+N,N,N,31863,N,64070,N,N,N,N,N,N,N,N,64071,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31864,
+N,N,N,N,N,N,N,N,N,64072,N,N,N,31865,N,64073,N,N,31866,N,64074,N,N,64075,N,N,N,
+N,N,31867,N,N,N,N,N,N,64076,64077,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31868,N,
+N,64078,N,N,N,N,N,N,N,N,N,31870,32033,N,N,N,N,N,N,64081,32034,64082,N,N,32035,
+N,N,N,N,N,N,N,N,N,31869,64083,N,N,N,N,N,32036,N,N,64084,N,N,N,N,N,32037,N,N,N,
+N,N,64085,64086,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64088,N,
+N,N,N,32038,32039,32040,N,32041,N,N,N,32042,N,64089,32043,N,N,N,64090,N,N,
+64091,N,N,N,64092,32044,N,64093,N,N,N,N,64094,N,N,64095,N,N,N,N,N,N,64096,
+64097,N,N,N,64098,N,64099,64100,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32045,N,N,N,
+64103,64104,N,64105,N,N,N,N,N,N,N,N,32046,64106,N,N,N,64107,N,N,N,N,N,N,N,N,N,
+64108,N,64109,N,N,N,N,N,64110,N,N,N,N,N,N,N,64111,N,N,N,64112,N,N,N,N,N,N,
+64115,N,N,N,N,N,N,N,N,N,N,N,N,64116,64117,N,32047,N,N,N,64118,N,N,N,N,32048,
+32049,N,64119,N,64120,N,N,32050,N,N,N,64121,N,64122,N,N,N,N,N,N,32051,N,N,N,N,
+64123,N,64124,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64290,N,64291,N,64292,N,N,N,32052,
+64293,N,32053,N,N,N,N,N,N,N,N,64294,N,N,N,64125,N,N,N,64295,N,N,N,N,N,N,N,
+64296,64297,32054,N,32055,N,N,N,32056,N,64298,N,64299,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64302,32057,32058,32059,N,N,N,N,N,N,64303,N,
+N,N,N,N,64304,N,N,64305,N,N,N,N,N,N,N,N,N,32060,32061,N,N,N,N,32062,64306,N,N,
+N,N,32063,64307,N,64308,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64312,N,N,
+64313,N,N,N,64314,N,N,N,N,N,N,N,N,N,N,N,32064,N,N,64315,N,N,64309,N,32065,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32066,N,N,N,N,N,N,64320,N,N,N,N,32067,
+64321,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64322,N,32068,32069,N,N,64323,N,
+N,N,N,64324,N,N,N,N,N,N,N,N,N,64319,N,N,N,64316,N,N,N,N,N,64329,N,32071,32070,
+N,N,N,N,64325,N,N,N,N,N,64326,N,N,N,N,N,N,64327,64328,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,64330,32072,64331,N,N,N,N,N,N,64332,N,N,N,N,N,N,N,
+N,N,64333,N,N,N,N,32073,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32074,
+N,N,N,N,N,N,N,32075,N,64336,N,64337,N,32076,32077,64338,64339,N,N,N,N,N,N,N,N,
+N,N,N,N,64340,N,N,N,N,N,64341,64342,32078,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+32079,N,N,N,N,N,N,32080,N,N,32081,N,64344,32082,N,N,N,N,N,N,N,64345,N,32083,N,
+N,N,N,N,N,32084,N,N,N,N,N,N,N,N,N,N,64347,N,N,32085,N,N,N,N,32086,N,N,32087,N,
+N,N,N,N,N,32089,N,N,N,32090,64037,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64350,N,N,N,N,N,
+N,64351,64352,N,N,N,N,N,N,N,64354,N,N,N,N,64355,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,32091,N,N,N,N,N,N,N,N,64356,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,64358,N,32092,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,64360,N,N,32094,N,N,N,N,N,N,32095,32096,N,N,N,64363,N,N,N,N,N,64364,N,N,
+N,64365,N,N,N,N,N,N,64366,N,N,64367,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+32097,N,N,N,N,N,64370,N,64371,N,N,64372,32098,N,N,N,N,N,N,N,N,N,N,32100,N,N,N,
+N,N,32101,64374,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64375,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,32102,N,N,64377,N,N,N,N,32103,N,N,N,N,N,64378,N,N,N,N,N,64379,N,N,N,N,N,
+32104,32105,32106,N,N,N,N,N,64380,N,64381,N,N,32107,64382,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,64545,N,N,N,32108,N,N,N,N,32109,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,32110,64548,N,N,N,64549,N,N,N,64550,N,N,N,64551,N,
+N,N,N,N,N,N,N,N,N,N,32111,N,N,64552,64553,N,N,N,N,N,N,N,32112,N,N,N,64554,N,N,
+32113,N,N,N,N,N,N,N,32114,N,N,64555,N,N,N,N,64556,N,N,64557,N,N,N,64558,64559,
+N,32116,N,N,32115,N,N,64560,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64561,N,N,32117,
+64562,N,N,N,N,N,32119,N,N,64563,64564,N,N,N,N,N,64565,N,64566,N,N,N,N,N,N,N,
+32120,N,N,N,N,64569,N,64572,N,N,N,N,N,32121,N,N,N,N,32122,N,64570,64571,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64573,N,N,N,N,N,N,N,N,N,N,32124,32125,N,N,
+32126,32289,N,32290,32291,N,N,N,N,N,N,N,N,N,N,32293,64574,N,N,N,N,N,32294,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64575,N,64576,N,N,64577,N,N,N,N,N,N,
+64579,64580,N,32295,64581,64582,N,N,64583,N,N,64584,N,N,N,N,64585,32296,N,N,
+64586,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64587,64589,N,64590,N,64591,N,
+32297,N,N,64592,N,N,N,N,N,64593,64594,N,64595,64596,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64599,64600,N,N,64602,64603,64604,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64606,64607,64608,N,N,N,N,N,N,64609,64610,64611,N,N,N,64612,64613,N,N,N,N,
+64614,N,N,N,N,N,N,64615,64616,N,N,N,N,N,N,N,N,N,32298,N,N,N,64617,N,N,64618,
+64619,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32299,N,N,N,N,64620,N,N,
+64621,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64622,N,N,N,64623,N,64624,N,N,N,
+64625,N,N,N,N,N,64626,N,N,N,N,N,N,N,N,N,N,64627,N,N,N,N,64628,N,N,N,N,64629,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64631,N,N,N,N,N,N,N,N,64632,N,N,64633,32300,
+32301,N,N,N,N,N,N,64634,N,N,N,N,N,N,64635,N,N,N,N,64636,N,N,N,64637,N,N,N,N,N,
+64638,N,N,N,32302,N,N,N,N,N,N,N,N,32303,32304,N,N,64801,N,N,N,N,64802,N,32305,
+N,N,N,N,N,N,N,N,N,N,N,64803,N,N,N,N,N,32306,N,64804,N,32307,N,N,N,32308,N,N,N,
+N,N,64805,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,64807,N,N,N,N,N,N,32309,64809,N,64811,N,N,N,N,N,N,N,
+32310,N,32311,N,N,64813,N,N,N,N,N,N,N,32312,N,64814,N,64815,N,N,64816,32313,N,
+N,N,N,N,64818,N,N,N,64819,N,N,N,N,64820,N,N,N,64821,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,32314,32315,64822,N,N,N,N,32316,N,N,N,64823,N,N,N,64824,N,64825,N,N,N,
+64826,N,N,N,N,N,64827,N,N,N,32317,N,N,N,N,N,N,N,N,N,N,64828,N,32319,N,N,N,N,N,
+64829,N,N,N,N,N,N,N,N,N,64830,N,N,N,N,N,N,N,N,N,N,N,N,N,64832,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,32320,N,N,N,N,64833,N,64834,32322,N,N,N,N,64835,64836,N,N,
+N,N,N,32323,64837,N,32324,64838,64839,N,32321,N,N,N,N,N,N,N,N,N,N,32325,N,N,N,
+N,N,32326,N,N,N,N,32327,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32328,N,N,N,N,N,N,N,64840,
+32329,N,N,N,N,64841,N,N,N,N,64842,64845,N,N,N,N,N,64846,N,N,N,N,N,64847,N,N,
+32330,N,N,N,N,N,64848,N,N,N,N,N,N,32331,N,N,N,N,N,N,N,N,N,64850,N,N,N,N,64851,
+N,N,N,N,N,N,N,32332,N,64852,N,N,64853,64854,N,N,64856,64855,N,N,N,64849,N,N,N,
+64860,32333,N,64858,N,N,32334,32335,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64862,N,64863,64864,64865,N,N,64866,N,N,N,N,64867,32336,N,N,N,64868,N,64869,
+64870,N,N,N,N,N,N,64872,N,N,N,N,64873,64874,N,N,N,N,N,N,N,N,N,32337,N,N,N,
+64875,N,N,N,64878,64879,N,N,N,N,32338,32339,N,N,32340,64881,N,N,N,64882,N,N,
+64883,64876,64884,N,64885,N,N,N,32341,N,32342,N,N,N,64886,64887,64888,N,64889,
+64890,N,64891,N,64892,N,N,64893,N,32343,N,N,64894,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65057,N,N,N,N,N,N,N,N,N,N,N,65058,65060,N,N,N,N,
+N,N,N,N,65059,N,N,N,N,N,65062,N,N,N,N,N,65063,65064,N,N,N,N,32344,32345,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65068,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65070,
+32346,N,N,N,32347,N,N,65071,N,N,N,N,N,N,N,32348,N,N,N,N,N,N,N,N,N,N,N,N,65072,
+N,N,65073,32349,N,N,N,N,N,65075,N,65076,N,N,N,N,32350,N,N,65078,N,N,65079,
+65080,N,N,N,N,32351,N,65081,N,N,N,N,N,65082,N,N,N,N,N,32352,N,N,65083,N,N,N,N,
+N,N,N,N,32353,N,N,65084,N,N,N,N,N,N,N,65085,N,N,N,N,N,N,N,N,N,N,32355,N,N,N,N,
+N,N,N,N,65087,N,N,N,65088,N,N,32356,65089,N,65086,32354,N,N,65090,N,N,N,65091,
+N,65092,N,N,N,N,N,N,N,N,N,N,N,N,65093,32357,N,N,65094,N,N,N,N,65095,65096,N,N,
+65097,N,N,N,32359,N,N,N,N,N,N,N,N,N,N,N,N,65098,65101,N,N,N,N,32360,N,N,65100,
+N,N,65102,N,N,N,N,N,N,N,32361,N,N,N,65103,N,N,65104,65105,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,65106,32362,N,N,N,65108,N,N,N,N,65109,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,65110,N,N,32363,N,N,N,N,N,32364,N,N,N,65111,N,N,N,32365,N,N,32366,
+N,N,N,N,32367,32368,N,N,N,N,N,N,N,65113,N,N,N,N,N,32369,N,N,N,N,N,N,N,N,N,N,N,
+N,N,32370,N,N,N,N,N,N,N,N,N,N,N,N,N,65115,N,N,N,N,N,N,N,65116,N,N,N,N,N,N,
+65117,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65118,65119,65121,N,N,N,N,N,N,N,N,N,N,N,
+N,32371,N,N,N,N,N,N,65122,N,65123,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+65124,N,N,N,N,N,N,N,65125,N,32372,65126,N,N,65127,N,N,N,65128,N,N,N,65129,
+65130,N,N,N,N,N,N,N,N,N,N,N,N,65131,N,65132,N,32373,65133,N,N,N,N,65135,N,N,N,
+N,N,N,N,N,N,N,N,65137,N,N,N,65139,N,N,65140,N,N,N,N,65141,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32374,N,N,N,32375,N,N,32376,N,N,N,N,N,N,N,N,N,
+N,32377,30267,N,N,N,N,N,N,N,N,N,N,29742,30030,N,N,N,N,N,N,N,N,N,N,N,N,31567,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30281,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+32292,N,N,N,N,N,N,N,N,N,N,N,32093,12107,12119,20338,N,44665,30074,30554,30575,
+N,N,31036,31037,31041,N,N,N,31546,63288,63301,31790,N,63854,N,31850,N,N,N,N,N,
+N,N,N,N,11832,11849,11856,11875,11880,11886,12076,12079,12086,12122,12126,
+20321,20322,29776,29788,29790,29793,29992,29995,30019,30053,30313,30327,30501,
+30549,61481,30757,31015,31027,31028,31031,31032,31033,31035,31039,31040,31053,
+31057,31076,31278,62544,31283,31290,31300,31320,62836,62837,31527,31599,31609,
+31791,31792,31800,31805,63849,31833,32099,32118,32123,9022,9021,8752,N,N,N,N,
+8751,N,N,N,N,N,8753,
+};
+
+static const struct unim_index jisx0213_bmp_encmap[256] = {
+{__jisx0213_bmp_encmap+0,126,255},{__jisx0213_bmp_encmap+130,0,253},{
+__jisx0213_bmp_encmap+384,80,233},{__jisx0213_bmp_encmap+538,0,194},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_bmp_encmap+733,62,63
+},{__jisx0213_bmp_encmap+735,112,115},{__jisx0213_bmp_encmap+739,19,172},{
+__jisx0213_bmp_encmap+893,15,233},{__jisx0213_bmp_encmap+1112,5,219},{
+__jisx0213_bmp_encmap+1327,5,206},{__jisx0213_bmp_encmap+1529,35,254},{
+__jisx0213_bmp_encmap+1749,177,230},{__jisx0213_bmp_encmap+1803,0,110},{
+__jisx0213_bmp_encmap+1914,19,127},{0,0,0},{__jisx0213_bmp_encmap+2023,52,251
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_bmp_encmap+2223,
+22,255},{__jisx0213_bmp_encmap+2457,240,255},{__jisx0213_bmp_encmap+2473,49,
+250},{__jisx0213_bmp_encmap+2675,3,205},{__jisx0213_bmp_encmap+2878,2,219},{
+__jisx0213_bmp_encmap+3096,31,244},{__jisx0213_bmp_encmap+3310,5,207},{
+__jisx0213_bmp_encmap+3513,97,253},{__jisx0213_bmp_encmap+3670,0,250},{
+__jisx0213_bmp_encmap+3921,23,111},{__jisx0213_bmp_encmap+4010,110,234},{
+__jisx0213_bmp_encmap+4135,14,240},{__jisx0213_bmp_encmap+4362,15,210},{
+__jisx0213_bmp_encmap+4558,17,212},{__jisx0213_bmp_encmap+4754,5,148},{
+__jisx0213_bmp_encmap+4898,87,215},{__jisx0213_bmp_encmap+5027,57,147},{
+__jisx0213_bmp_encmap+5118,5,243},{__jisx0213_bmp_encmap+5357,7,221},{
+__jisx0213_bmp_encmap+5572,2,240},{__jisx0213_bmp_encmap+5811,8,212},{
+__jisx0213_bmp_encmap+6016,8,234},{__jisx0213_bmp_encmap+6243,15,175},{
+__jisx0213_bmp_encmap+6404,12,253},{__jisx0213_bmp_encmap+6646,22,181},{
+__jisx0213_bmp_encmap+6806,176,250},{__jisx0213_bmp_encmap+6881,4,188},{
+__jisx0213_bmp_encmap+7066,59,232},{__jisx0213_bmp_encmap+7240,23,209},{
+__jisx0213_bmp_encmap+7427,7,119},{__jisx0213_bmp_encmap+7540,2,255},{
+__jisx0213_bmp_encmap+7794,0,242},{__jisx0213_bmp_encmap+8037,0,243},{
+__jisx0213_bmp_encmap+8281,3,244},{__jisx0213_bmp_encmap+8523,1,251},{
+__jisx0213_bmp_encmap+8774,0,245},{__jisx0213_bmp_encmap+9020,18,255},{
+__jisx0213_bmp_encmap+9258,0,233},{__jisx0213_bmp_encmap+9492,7,247},{
+__jisx0213_bmp_encmap+9733,10,255},{__jisx0213_bmp_encmap+9979,4,244},{
+__jisx0213_bmp_encmap+10220,5,248},{__jisx0213_bmp_encmap+10464,12,245},{
+__jisx0213_bmp_encmap+10698,0,253},{__jisx0213_bmp_encmap+10952,3,244},{
+__jisx0213_bmp_encmap+11194,6,233},{__jisx0213_bmp_encmap+11422,0,253},{
+__jisx0213_bmp_encmap+11676,0,252},{__jisx0213_bmp_encmap+11929,13,248},{
+__jisx0213_bmp_encmap+12165,16,245},{__jisx0213_bmp_encmap+12395,21,253},{
+__jisx0213_bmp_encmap+12628,3,247},{__jisx0213_bmp_encmap+12873,9,255},{
+__jisx0213_bmp_encmap+13120,4,252},{__jisx0213_bmp_encmap+13369,0,251},{
+__jisx0213_bmp_encmap+13621,1,252},{__jisx0213_bmp_encmap+13873,1,252},{
+__jisx0213_bmp_encmap+14125,3,254},{__jisx0213_bmp_encmap+14377,15,253},{
+__jisx0213_bmp_encmap+14616,11,255},{__jisx0213_bmp_encmap+14861,2,251},{
+__jisx0213_bmp_encmap+15111,0,252},{__jisx0213_bmp_encmap+15364,23,251},{
+__jisx0213_bmp_encmap+15593,10,252},{__jisx0213_bmp_encmap+15836,0,236},{
+__jisx0213_bmp_encmap+16073,3,254},{__jisx0213_bmp_encmap+16325,0,251},{
+__jisx0213_bmp_encmap+16577,7,250},{__jisx0213_bmp_encmap+16821,1,255},{
+__jisx0213_bmp_encmap+17076,1,249},{__jisx0213_bmp_encmap+17325,0,252},{
+__jisx0213_bmp_encmap+17578,10,251},{__jisx0213_bmp_encmap+17820,5,254},{
+__jisx0213_bmp_encmap+18070,0,237},{__jisx0213_bmp_encmap+18308,3,253},{
+__jisx0213_bmp_encmap+18559,7,240},{__jisx0213_bmp_encmap+18793,1,245},{
+__jisx0213_bmp_encmap+19038,3,249},{__jisx0213_bmp_encmap+19285,8,154},{
+__jisx0213_bmp_encmap+19432,59,250},{__jisx0213_bmp_encmap+19624,2,251},{
+__jisx0213_bmp_encmap+19874,13,255},{__jisx0213_bmp_encmap+20117,4,254},{
+__jisx0213_bmp_encmap+20368,0,249},{__jisx0213_bmp_encmap+20618,1,253},{
+__jisx0213_bmp_encmap+20871,12,255},{__jisx0213_bmp_encmap+21115,0,253},{
+__jisx0213_bmp_encmap+21369,5,245},{__jisx0213_bmp_encmap+21610,1,245},{
+__jisx0213_bmp_encmap+21855,1,255},{__jisx0213_bmp_encmap+22110,17,252},{
+__jisx0213_bmp_encmap+22346,5,158},{__jisx0213_bmp_encmap+22500,57,254},{
+__jisx0213_bmp_encmap+22698,9,253},{__jisx0213_bmp_encmap+22943,6,250},{
+__jisx0213_bmp_encmap+23188,0,251},{__jisx0213_bmp_encmap+23440,2,255},{
+__jisx0213_bmp_encmap+23694,0,251},{__jisx0213_bmp_encmap+23946,1,255},{
+__jisx0213_bmp_encmap+24201,2,253},{__jisx0213_bmp_encmap+24453,4,114},{
+__jisx0213_bmp_encmap+24564,120,222},{__jisx0213_bmp_encmap+24667,29,239},{
+__jisx0213_bmp_encmap+24878,20,244},{__jisx0213_bmp_encmap+25103,4,243},{
+__jisx0213_bmp_encmap+25343,8,252},{__jisx0213_bmp_encmap+25588,2,249},{
+__jisx0213_bmp_encmap+25836,2,253},{__jisx0213_bmp_encmap+26088,0,242},{
+__jisx0213_bmp_encmap+26331,2,244},{__jisx0213_bmp_encmap+26574,2,255},{
+__jisx0213_bmp_encmap+26828,2,162},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_bmp_encmap+26989
+,29,220},{__jisx0213_bmp_encmap+27181,15,106},{0,0,0},{0,0,0},{0,0,0},{
+__jisx0213_bmp_encmap+27273,69,70},{__jisx0213_bmp_encmap+27275,2,13},
+};
+
+static const ucs2_t __jisx0213_1_emp_decmap[340] = {
+11,4669,U,U,U,U,U,U,U,U,U,4891,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,5230,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,6333,2975,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,5812,U,U,U,U,U,U,U,U,U,U,7732,12740,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+13764,14143,U,U,U,U,U,U,U,U,14179,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,15614,18417,21646,21774,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,22385,U,U,U,U,U,U,U,U,U,U,U,
+U,22980,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,23969,27391,28224,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,28916,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30340,33399,U,U,U,U,U,U,U,33741,41360,
+};
+
+static const struct dbcs_index jisx0213_1_emp_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__jisx0213_1_emp_decmap+0,34,34},{__jisx0213_1_emp_decmap+1,66,123},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{__jisx0213_1_emp_decmap+59,84,110},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_1_emp_decmap+86,58,114},{
+__jisx0213_1_emp_decmap+143,41,96},{__jisx0213_1_emp_decmap+199,108,108},{
+__jisx0213_1_emp_decmap+200,126,126},{__jisx0213_1_emp_decmap+201,41,110},{
+__jisx0213_1_emp_decmap+271,93,93},{__jisx0213_1_emp_decmap+272,51,108},{
+__jisx0213_1_emp_decmap+330,73,81},{0,0,0},{__jisx0213_1_emp_decmap+339,102,
+102},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const ucs2_t __jisx0213_2_emp_decmap[2053] = {
+137,U,U,U,U,U,U,U,U,U,162,U,U,164,U,U,U,U,U,U,U,418,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,531,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,811,U,U,U,U,U,U,897,U,881,1017,U,U,1098,U,1289,U,U,U,U,U,U,U,U,U,
+1494,1576,U,U,U,U,U,1871,U,U,U,U,U,U,2055,U,2106,U,U,U,U,U,U,U,U,2233,U,U,U,U,
+U,U,U,2428,2461,U,U,U,U,U,2771,U,U,2845,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,3397,3553,U,U,U,U,U,U,3733,3693,U,U,U,U,U,U,U,3684,U,U,3935,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,4609,U,U,4693,U,4731,U,U,U,
+U,4724,U,U,U,U,U,U,4836,4823,U,U,U,U,U,U,4861,U,4918,4932,5060,U,U,U,U,U,U,U,
+U,U,U,U,U,5229,U,U,U,U,U,U,U,U,U,U,U,5591,U,U,U,U,U,27689,U,U,5703,U,U,U,U,U,
+U,U,U,U,U,U,U,U,5894,5954,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,6595,7254,U,U,U,U,U,U,7469,7493,U,7544,7522,U,U,U,
+7585,7580,U,U,U,U,7570,U,U,7607,U,7648,7731,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+7966,U,U,U,U,U,U,U,U,U,U,8054,U,U,U,U,U,8186,8571,U,U,U,U,U,U,U,U,8990,U,U,U,
+U,9133,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,9971,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,10331,U,U,U,U,U,U,U,10411,U,U,U,U,10639,
+10936,U,U,U,U,11087,11088,U,U,U,U,U,U,U,11078,U,11293,11174,U,U,U,11300,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,11745,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,12739,12789,12726,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,13170,U,13267,13266,U,U,U,U,13264,13284,
+13269,U,U,13274,U,13279,U,U,U,U,U,U,U,U,U,U,U,13386,13393,13387,U,U,U,13413,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,13540,13658,13716,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,13881,13895,U,13880,13882,U,U,U,U,U,U,U,U,U,U,
+14108,U,U,U,U,U,U,U,U,U,U,14092,U,U,U,U,U,U,U,14180,U,U,U,U,U,U,U,14335,14311,
+U,U,U,U,U,14372,U,U,U,U,14397,15000,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,15487,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,15616,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+15680,U,15866,15865,15827,16254,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,16534,
+U,U,U,U,U,16643,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,16838,U,U,16894,17340,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,17961,U,U,U,U,U,18085,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,18582,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,19021,19286,U,19311,U,U,U,U,19478,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,19732,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,19982,U,U,
+U,20023,U,U,U,U,20074,U,U,20107,U,U,U,U,U,U,U,U,U,U,U,20554,U,20565,U,U,20770,
+20905,U,20965,20941,U,U,U,21022,U,U,U,21068,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+21550,U,U,U,U,U,U,U,U,U,U,21721,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,21927,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,22441,22452,22996,U,U,U,U,U,U,U,
+U,U,U,23268,23267,U,23281,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,23474,U,U,U,U,U,U,
+U,U,U,U,23627,23652,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24110,24150,24165,
+U,24162,U,U,U,24280,U,24258,24296,U,24355,U,U,24412,U,U,U,U,U,U,24544,24532,U,
+U,U,U,24588,24571,U,U,U,U,U,U,U,24599,U,U,U,U,24672,U,U,U,U,U,U,U,U,U,U,U,U,
+24813,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,25200,U,25222,U,U,U,U,
+U,U,25420,U,U,15630,U,U,U,25602,26238,U,U,U,U,26288,U,U,U,U,U,U,U,U,U,U,U,
+26397,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,26845,U,26858,U,26961,U,U,26991,U,27101,U,
+U,U,27166,U,U,U,U,U,U,27224,U,U,U,U,U,27276,U,U,27319,27763,U,U,U,U,U,U,U,U,U,
+27869,U,U,U,U,U,U,U,U,U,U,U,U,U,U,28261,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,28564,U,U,U,U,U,U,U,U,28664,28662,28663,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,28941,U,U,28985,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,29659,29658,U,U,U,U,U,29694,U,U,29712,U,U,U,U,
+29769,30229,30228,U,30257,U,U,U,U,U,U,U,30355,U,U,U,U,U,U,U,30478,U,30499,U,U,
+U,30546,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,31109,U,U,U,U,U,U,U,U,U,U,U,U,
+31364,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,31667,U,31678,31687,31928,U,U,U,U,
+U,U,U,U,U,32160,U,U,32272,U,U,U,U,U,U,32695,U,U,U,U,U,U,U,U,32906,U,U,U,U,U,
+32955,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33410,U,U,U,U,33523,U,U,U,U,U,U,U,33804,
+U,U,U,U,33877,U,U,U,U,U,U,U,U,U,U,U,U,U,U,34155,U,U,U,34248,34249,U,U,U,U,U,U,
+U,U,U,U,34519,U,U,34554,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,35145,35142,U,U,U,U,U,U,35179,U,U,U,U,U,U,U,U,U,U,U,U,U,35207,35208,U,
+U,U,U,U,U,U,U,U,U,35258,35259,U,U,U,U,U,U,U,U,U,U,U,35358,35369,U,U,U,U,U,U,U,
+U,U,U,35441,35395,U,U,U,U,U,U,U,U,35481,35533,U,U,U,U,U,35556,35549,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,35777,35823,U,U,U,U,U,U,U,36112,U,U,36209,U,36347,36383,U,
+U,U,36406,U,U,U,36489,U,36587,U,36658,U,U,U,U,U,U,U,36856,37536,37553,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,38032,U,U,U,U,U,U,U,U,U,38351,U,U,U,U,U,U,U,U,
+U,38527,U,U,U,U,U,U,U,U,U,38640,U,U,38681,U,U,U,38736,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,39110,39538,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,40411,40509,U,U,U,U,U,U,U,U,U,U,U,U,40469,U,40586,U,40521,U,
+U,U,U,U,U,U,U,U,40644,U,U,U,U,U,40681,U,U,40667,40910,U,U,U,41007,U,40986,U,U,
+U,U,U,U,41209,U,U,41090,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,8728,U,U,U,U,41868,U,42039,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,42481,U,
+42498,U,42522,U,U,U,42674,
+};
+
+static const struct dbcs_index jisx0213_2_emp_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_2_emp_decmap+0,33,121},{0,0,0},{
+__jisx0213_2_emp_decmap+89,34,119},{__jisx0213_2_emp_decmap+175,42,117},{
+__jisx0213_2_emp_decmap+251,37,126},{0,0,0},{0,0,0},{__jisx0213_2_emp_decmap+
+341,48,108},{0,0,0},{0,0,0},{0,0,0},{__jisx0213_2_emp_decmap+402,34,114},{
+__jisx0213_2_emp_decmap+483,36,125},{__jisx0213_2_emp_decmap+573,35,120},{
+__jisx0213_2_emp_decmap+659,42,117},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+__jisx0213_2_emp_decmap+735,35,96},{__jisx0213_2_emp_decmap+797,50,100},{
+__jisx0213_2_emp_decmap+848,34,123},{__jisx0213_2_emp_decmap+938,46,122},{
+__jisx0213_2_emp_decmap+1015,33,118},{__jisx0213_2_emp_decmap+1101,50,125},{
+__jisx0213_2_emp_decmap+1177,34,121},{__jisx0213_2_emp_decmap+1265,53,115},{
+__jisx0213_2_emp_decmap+1328,68,126},{__jisx0213_2_emp_decmap+1387,33,115},{
+__jisx0213_2_emp_decmap+1470,41,122},{__jisx0213_2_emp_decmap+1552,37,126},{
+__jisx0213_2_emp_decmap+1642,33,126},{__jisx0213_2_emp_decmap+1736,33,113},{
+__jisx0213_2_emp_decmap+1817,34,118},{__jisx0213_2_emp_decmap+1902,44,112},{
+__jisx0213_2_emp_decmap+1971,37,118},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __jisx0213_emp_encmap[8787] = {
+11810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,41249,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41259,N,41262,41270,41286,41328,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,41337,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41335,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41762,41765,41767,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,41777,41778,41784,41791,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41793,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,41802,41810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,41811,41817,41820,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20308,41847,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42026,42042,N,N,N,
+N,N,N,N,N,42034,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,42033,42045,42073,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+12098,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42076,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42083,N,N,N,N,N,N,42078,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,42091,N,N,N,N,N,N,N,N,N,N,N,N,42090,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,42098,12108,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,42100,N,N,N,N,N,N,N,N,N,N,N,N,N,42101,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42277,42290,
+12128,42302,42311,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+20323,42325,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,42326,12155,42366,43056,
+43063,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43064,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43067,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,43066,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43077,N,N,N,N,N,
+N,N,N,N,43072,N,N,N,N,43071,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43080,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43082,43083,20334,43099,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43110,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+43116,44066,65107,44075,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+44080,44112,44133,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,44141,44146,44324,44338,N,N,N,N,N,N,N,N,44329,44330,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,44341,44340,N,N,N,N,N,N,44345,44374,44580,N,N,N,N,N,N,N,N,N,N,N,N,
+44413,30010,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44579,44602,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44610,
+N,44605,44604,N,44612,N,N,N,N,44615,N,N,N,N,44617,N,N,N,N,44611,44629,44631,N,
+N,N,N,N,44630,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44635,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+44663,44664,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44842,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30066,
+44866,44863,44867,N,N,N,N,N,N,N,N,N,N,N,N,44864,44889,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,44878,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,30249,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30258,44897,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44906,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44905,44912,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44917,
+60963,60980,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30304,61001,N,N,N,N,N,N,N,N,N,N,N,N,N,62581,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,61020,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,61024,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,61023,61022,61234,61255,61261,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61281,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61284,
+61474,61491,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,61497,30572,61523,61563,61742,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,61744,61749,61764,61789,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61793,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+61798,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61801,
+61813,N,N,N,N,N,N,N,N,N,N,61815,61818,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61985,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61988,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61987,61992,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,61996,
+62013,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30846,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62024,31017,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62043,31047,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,62069,N,N,N,N,N,N,N,N,N,N,62070,31060,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+62258,62270,62269,N,N,N,N,N,N,N,N,N,N,N,N,62272,62290,62301,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62302,31086,62323,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62324,N,N,N,N,N,N,N,N,N,N,N,
+62327,N,N,62325,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62333,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,62331,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62498,62500,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,62503,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,62511,N,N,N,N,N,N,N,N,N,N,N,62510,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62517,62516,N,N,N,N,N,N,N,N,N,N,62525,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62530,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62543,62569,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,62571,62578,62585,62773,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62778,62790,62806,N,N,
+N,N,N,N,N,N,N,N,N,N,62808,62810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,62813,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,62815,62819,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,62826,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,62832,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,62835,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,31325,42308,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,63044,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63054,
+31539,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+63069,63093,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63265,63266,63102,31561,
+63283,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,63286,63333,63332,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,63339,63342,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63347,
+63530,63529,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63532,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,31596,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63540,63548,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,63550,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63554,63574,63587,63607,N,N,N,N,N,N,N,N,N,N,
+63609,N,N,N,N,N,N,N,N,63610,63781,63791,63794,63801,63810,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+63816,31817,N,N,N,N,N,N,N,N,N,N,63833,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,63838,31825,63846,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,63851,63866,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+63870,64033,64044,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,64047,64080,N,N,64079,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64087,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64101,64102,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64113,64114,64126,N,N,N,N,N,N,N,N,N,N,64289,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64301,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64300,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64310,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64311,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64318,N,N,N,N,N,N,
+64317,64334,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,64335,64343,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64346,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64348,64349,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,64353,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64357,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64359,64361,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,64369,64546,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64547,64568,64578,
+64588,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64598,64601,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64605,64630,64812,64843,64857,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64844,
+N,N,N,N,N,N,N,N,N,N,N,64861,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+64859,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,64871,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,64880,N,N,N,N,N,N,N,N,N,N,N,N,N,64877,65061,65067,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,65065,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65077,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65074,32358,65112,65114,65134,
+65136,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65138,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,65142,
+};
+
+static const struct unim_index jisx0213_emp_encmap[256] = {
+{__jisx0213_emp_encmap+0,11,164},{__jisx0213_emp_encmap+154,162,162},{
+__jisx0213_emp_encmap+155,19,19},{__jisx0213_emp_encmap+156,43,249},{
+__jisx0213_emp_encmap+363,74,74},{__jisx0213_emp_encmap+364,9,214},{
+__jisx0213_emp_encmap+570,40,40},{__jisx0213_emp_encmap+571,79,79},{
+__jisx0213_emp_encmap+572,7,185},{__jisx0213_emp_encmap+751,124,157},{
+__jisx0213_emp_encmap+785,211,211},{__jisx0213_emp_encmap+786,29,159},{0,0,0},
+{__jisx0213_emp_encmap+917,69,225},{__jisx0213_emp_encmap+1074,100,149},{
+__jisx0213_emp_encmap+1124,95,95},{0,0,0},{0,0,0},{__jisx0213_emp_encmap+1125,
+1,253},{__jisx0213_emp_encmap+1378,27,196},{__jisx0213_emp_encmap+1548,109,110
+},{__jisx0213_emp_encmap+1550,215,215},{__jisx0213_emp_encmap+1551,71,180},{
+__jisx0213_emp_encmap+1661,6,66},{__jisx0213_emp_encmap+1722,189,189},{
+__jisx0213_emp_encmap+1723,195,195},{0,0,0},{0,0,0},{__jisx0213_emp_encmap+
+1724,86,86},{__jisx0213_emp_encmap+1725,45,224},{__jisx0213_emp_encmap+1905,
+51,52},{__jisx0213_emp_encmap+1907,30,250},{0,0,0},{__jisx0213_emp_encmap+2128
+,123,123},{__jisx0213_emp_encmap+2129,24,24},{__jisx0213_emp_encmap+2130,30,
+173},{0,0,0},{0,0,0},{__jisx0213_emp_encmap+2274,243,243},{0,0,0},{
+__jisx0213_emp_encmap+2275,91,171},{__jisx0213_emp_encmap+2356,143,143},{
+__jisx0213_emp_encmap+2357,184,184},{__jisx0213_emp_encmap+2358,70,166},{
+__jisx0213_emp_encmap+2455,29,36},{__jisx0213_emp_encmap+2463,225,225},{0,0,0
+},{0,0,0},{0,0,0},{__jisx0213_emp_encmap+2464,182,245},{0,0,0},{
+__jisx0213_emp_encmap+2528,114,228},{__jisx0213_emp_encmap+2643,74,228},{
+__jisx0213_emp_encmap+2798,90,196},{__jisx0213_emp_encmap+2905,56,71},{
+__jisx0213_emp_encmap+2921,12,255},{__jisx0213_emp_encmap+3165,36,61},{0,0,0},
+{__jisx0213_emp_encmap+3191,152,152},{0,0,0},{__jisx0213_emp_encmap+3192,127,
+254},{__jisx0213_emp_encmap+3320,0,250},{0,0,0},{__jisx0213_emp_encmap+3571,
+126,126},{__jisx0213_emp_encmap+3572,150,150},{__jisx0213_emp_encmap+3573,3,
+254},{0,0,0},{__jisx0213_emp_encmap+3825,188,188},{0,0,0},{0,0,0},{
+__jisx0213_emp_encmap+3826,41,165},{__jisx0213_emp_encmap+3951,241,241},{
+__jisx0213_emp_encmap+3952,150,150},{0,0,0},{__jisx0213_emp_encmap+3953,77,77
+},{__jisx0213_emp_encmap+3954,86,111},{__jisx0213_emp_encmap+3980,22,22},{
+__jisx0213_emp_encmap+3981,20,20},{__jisx0213_emp_encmap+3982,14,139},{0,0,0},
+{__jisx0213_emp_encmap+4108,74,85},{__jisx0213_emp_encmap+4120,34,229},{
+__jisx0213_emp_encmap+4316,30,76},{0,0,0},{__jisx0213_emp_encmap+4363,46,217},
+{__jisx0213_emp_encmap+4535,14,167},{0,0,0},{__jisx0213_emp_encmap+4689,113,
+180},{0,0,0},{__jisx0213_emp_encmap+4757,196,212},{__jisx0213_emp_encmap+4774,
+227,241},{__jisx0213_emp_encmap+4789,178,178},{__jisx0213_emp_encmap+4790,75,
+100},{__jisx0213_emp_encmap+4816,161,161},{__jisx0213_emp_encmap+4817,46,232},
+{__jisx0213_emp_encmap+5004,35,251},{__jisx0213_emp_encmap+5221,12,237},{0,0,0
+},{__jisx0213_emp_encmap+5447,112,134},{__jisx0213_emp_encmap+5470,76,76},{
+__jisx0213_emp_encmap+5471,2,2},{0,0,0},{__jisx0213_emp_encmap+5472,126,176},{
+__jisx0213_emp_encmap+5523,29,29},{__jisx0213_emp_encmap+5524,221,234},{
+__jisx0213_emp_encmap+5538,81,221},{__jisx0213_emp_encmap+5679,30,255},{0,0,0
+},{__jisx0213_emp_encmap+5905,41,221},{0,0,0},{__jisx0213_emp_encmap+6086,64,
+101},{__jisx0213_emp_encmap+6124,148,248},{__jisx0213_emp_encmap+6225,244,244
+},{__jisx0213_emp_encmap+6226,13,57},{0,0,0},{__jisx0213_emp_encmap+6271,218,
+254},{__jisx0213_emp_encmap+6308,16,73},{0,0,0},{__jisx0213_emp_encmap+6366,
+20,147},{__jisx0213_emp_encmap+6494,14,82},{0,0,0},{__jisx0213_emp_encmap+6563
+,133,133},{__jisx0213_emp_encmap+6564,132,132},{__jisx0213_emp_encmap+6565,
+179,199},{__jisx0213_emp_encmap+6586,184,184},{__jisx0213_emp_encmap+6587,160,
+160},{__jisx0213_emp_encmap+6588,16,16},{__jisx0213_emp_encmap+6589,183,183},{
+__jisx0213_emp_encmap+6590,138,187},{0,0,0},{__jisx0213_emp_encmap+6640,119,
+243},{__jisx0213_emp_encmap+6765,205,205},{__jisx0213_emp_encmap+6766,12,85},{
+__jisx0213_emp_encmap+6840,107,201},{__jisx0213_emp_encmap+6935,215,250},{0,0,
+0},{0,0,0},{__jisx0213_emp_encmap+6971,70,187},{__jisx0213_emp_encmap+7089,30,
+228},{__jisx0213_emp_encmap+7288,193,239},{0,0,0},{__jisx0213_emp_encmap+7335,
+16,251},{__jisx0213_emp_encmap+7571,31,235},{__jisx0213_emp_encmap+7776,50,248
+},{0,0,0},{0,0,0},{__jisx0213_emp_encmap+7975,160,177},{0,0,0},{
+__jisx0213_emp_encmap+7993,144,144},{__jisx0213_emp_encmap+7994,207,207},{
+__jisx0213_emp_encmap+7995,127,240},{__jisx0213_emp_encmap+8109,25,80},{
+__jisx0213_emp_encmap+8165,198,198},{0,0,0},{__jisx0213_emp_encmap+8166,114,
+114},{0,0,0},{0,0,0},{__jisx0213_emp_encmap+8167,219,219},{
+__jisx0213_emp_encmap+8168,21,233},{__jisx0213_emp_encmap+8381,206,206},{
+__jisx0213_emp_encmap+8382,26,249},{__jisx0213_emp_encmap+8606,144,144},{0,0,0
+},{__jisx0213_emp_encmap+8607,140,140},{__jisx0213_emp_encmap+8608,55,55},{
+__jisx0213_emp_encmap+8609,241,241},{__jisx0213_emp_encmap+8610,2,178},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},
+};
+
diff --git a/contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h
new file mode 100644
index 00000000000..bb59acccc1e
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_kr.h
@@ -0,0 +1,3253 @@
+// AUTO-GENERATED FILE FROM genmap_korean.py: DO NOT EDIT
+static const ucs2_t __ksx1001_decmap[8264] = {
+12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217,
+8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304,
+12305,177,215,247,8800,8804,8805,8734,8756,176,8242,8243,8451,8491,65504,
+65505,65509,9794,9792,8736,8869,8978,8706,8711,8801,8786,167,8251,9734,9733,
+9675,9679,9678,9671,9670,9633,9632,9651,9650,9661,9660,8594,8592,8593,8595,
+8596,12307,8810,8811,8730,8765,8733,8757,8747,8748,8712,8715,8838,8839,8834,
+8835,8746,8745,8743,8744,65506,8658,8660,8704,8707,180,65374,711,728,733,730,
+729,184,731,161,191,720,8750,8721,8719,164,8457,8240,9665,9664,9655,9654,9828,
+9824,9825,9829,9831,9827,8857,9672,9635,9680,9681,9618,9636,9637,9640,9639,
+9638,9641,9832,9743,9742,9756,9758,182,8224,8225,8597,8599,8601,8598,8600,
+9837,9833,9834,9836,12927,12828,8470,13255,8482,13250,13272,8481,8364,174,
+65281,65282,65283,65284,65285,65286,65287,65288,65289,65290,65291,65292,65293,
+65294,65295,65296,65297,65298,65299,65300,65301,65302,65303,65304,65305,65306,
+65307,65308,65309,65310,65311,65312,65313,65314,65315,65316,65317,65318,65319,
+65320,65321,65322,65323,65324,65325,65326,65327,65328,65329,65330,65331,65332,
+65333,65334,65335,65336,65337,65338,65339,65510,65341,65342,65343,65344,65345,
+65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,65357,65358,
+65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,
+65372,65373,65507,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,
+12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,
+12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,
+12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,
+12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,
+12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,
+12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,
+12681,12682,12683,12684,12685,12686,8560,8561,8562,8563,8564,8565,8566,8567,
+8568,8569,U,U,U,U,U,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,U,U,U,U,
+U,U,U,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,
+932,933,934,935,936,937,U,U,U,U,U,U,U,U,945,946,947,948,949,950,951,952,953,
+954,955,956,957,958,959,960,961,963,964,965,966,967,968,969,9472,9474,9484,
+9488,9496,9492,9500,9516,9508,9524,9532,9473,9475,9487,9491,9499,9495,9507,
+9523,9515,9531,9547,9504,9519,9512,9527,9535,9501,9520,9509,9528,9538,9490,
+9489,9498,9497,9494,9493,9486,9485,9502,9503,9505,9506,9510,9511,9513,9514,
+9517,9518,9521,9522,9525,9526,9529,9530,9533,9534,9536,9537,9539,9540,9541,
+9542,9543,9544,9545,9546,13205,13206,13207,8467,13208,13252,13219,13220,13221,
+13222,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13258,13197,
+13198,13199,13263,13192,13193,13256,13223,13224,13232,13233,13234,13235,13236,
+13237,13238,13239,13240,13241,13184,13185,13186,13187,13188,13242,13243,13244,
+13245,13246,13247,13200,13201,13202,13203,13204,8486,13248,13249,13194,13195,
+13196,13270,13253,13229,13230,13231,13275,13225,13226,13227,13228,13277,13264,
+13267,13251,13257,13276,13254,198,208,170,294,U,306,U,319,321,216,338,186,222,
+358,330,U,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,
+12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,
+12920,12921,12922,12923,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,
+9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,
+9449,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,
+9326,189,8531,8532,188,190,8539,8540,8541,8542,230,273,240,295,305,307,312,
+320,322,248,339,223,254,359,331,329,12800,12801,12802,12803,12804,12805,12806,
+12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,
+12820,12821,12822,12823,12824,12825,12826,12827,9372,9373,9374,9375,9376,9377,
+9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,
+9393,9394,9395,9396,9397,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,
+9342,9343,9344,9345,9346,185,178,179,8308,8319,8321,8322,8323,8324,12353,
+12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,
+12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,
+12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,
+12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,
+12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,
+12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,
+12432,12433,12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,
+12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,
+12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,
+12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,
+12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,
+12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,
+12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,1040,
+1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,
+1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,
+1070,1071,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,1072,1073,1074,1075,1076,1077,1105,
+1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,
+1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,44032,44033,44036,
+44039,44040,44041,44042,44048,44049,44050,44051,44052,44053,44054,44055,44057,
+44058,44059,44060,44061,44064,44068,44076,44077,44079,44080,44081,44088,44089,
+44092,44096,44107,44109,44116,44120,44124,44144,44145,44148,44151,44152,44154,
+44160,44161,44163,44164,44165,44166,44169,44170,44171,44172,44176,44180,44188,
+44189,44191,44192,44193,44200,44201,44202,44204,44207,44208,44216,44217,44219,
+44220,44221,44225,44228,44232,44236,44245,44247,44256,44257,44260,44263,44264,
+44266,44268,44271,44272,44273,44275,44277,44278,44284,44285,44288,44292,44294,
+44300,44301,44303,44305,44312,44316,44320,44329,44332,44333,44340,44341,44344,
+44348,44356,44357,44359,44361,44368,44372,44376,44385,44387,44396,44397,44400,
+44403,44404,44405,44406,44411,44412,44413,44415,44417,44418,44424,44425,44428,
+44432,44444,44445,44452,44471,44480,44481,44484,44488,44496,44497,44499,44508,
+44512,44516,44536,44537,44540,44543,44544,44545,44552,44553,44555,44557,44564,
+44592,44593,44596,44599,44600,44602,44608,44609,44611,44613,44614,44618,44620,
+44621,44622,44624,44628,44630,44636,44637,44639,44640,44641,44645,44648,44649,
+44652,44656,44664,44665,44667,44668,44669,44676,44677,44684,44732,44733,44734,
+44736,44740,44748,44749,44751,44752,44753,44760,44761,44764,44776,44779,44781,
+44788,44792,44796,44807,44808,44813,44816,44844,44845,44848,44850,44852,44860,
+44861,44863,44865,44866,44867,44872,44873,44880,44892,44893,44900,44901,44921,
+44928,44932,44936,44944,44945,44949,44956,44984,44985,44988,44992,44999,45000,
+45001,45003,45005,45006,45012,45020,45032,45033,45040,45041,45044,45048,45056,
+45057,45060,45068,45072,45076,45084,45085,45096,45124,45125,45128,45130,45132,
+45134,45139,45140,45141,45143,45145,45149,45180,45181,45184,45188,45196,45197,
+45199,45201,45208,45209,45210,45212,45215,45216,45217,45218,45224,45225,45227,
+45228,45229,45230,45231,45233,45235,45236,45237,45240,45244,45252,45253,45255,
+45256,45257,45264,45265,45268,45272,45280,45285,45320,45321,45323,45324,45328,
+45330,45331,45336,45337,45339,45340,45341,45347,45348,45349,45352,45356,45364,
+45365,45367,45368,45369,45376,45377,45380,45384,45392,45393,45396,45397,45400,
+45404,45408,45432,45433,45436,45440,45442,45448,45449,45451,45453,45458,45459,
+45460,45464,45468,45480,45516,45520,45524,45532,45533,45535,45544,45545,45548,
+45552,45561,45563,45565,45572,45573,45576,45579,45580,45588,45589,45591,45593,
+45600,45620,45628,45656,45660,45664,45672,45673,45684,45685,45692,45700,45701,
+45705,45712,45713,45716,45720,45721,45722,45728,45729,45731,45733,45734,45738,
+45740,45744,45748,45768,45769,45772,45776,45778,45784,45785,45787,45789,45794,
+45796,45797,45798,45800,45803,45804,45805,45806,45807,45811,45812,45813,45815,
+45816,45817,45818,45819,45823,45824,45825,45828,45832,45840,45841,45843,45844,
+45845,45852,45908,45909,45910,45912,45915,45916,45918,45919,45924,45925,45927,
+45929,45931,45934,45936,45937,45940,45944,45952,45953,45955,45956,45957,45964,
+45968,45972,45984,45985,45992,45996,46020,46021,46024,46027,46028,46030,46032,
+46036,46037,46039,46041,46043,46045,46048,46052,46056,46076,46096,46104,46108,
+46112,46120,46121,46123,46132,46160,46161,46164,46168,46176,46177,46179,46181,
+46188,46208,46216,46237,46244,46248,46252,46261,46263,46265,46272,46276,46280,
+46288,46293,46300,46301,46304,46307,46308,46310,46316,46317,46319,46321,46328,
+46356,46357,46360,46363,46364,46372,46373,46375,46376,46377,46378,46384,46385,
+46388,46392,46400,46401,46403,46404,46405,46411,46412,46413,46416,46420,46428,
+46429,46431,46432,46433,46496,46497,46500,46504,46506,46507,46512,46513,46515,
+46516,46517,46523,46524,46525,46528,46532,46540,46541,46543,46544,46545,46552,
+46572,46608,46609,46612,46616,46629,46636,46644,46664,46692,46696,46748,46749,
+46752,46756,46763,46764,46769,46804,46832,46836,46840,46848,46849,46853,46888,
+46889,46892,46895,46896,46904,46905,46907,46916,46920,46924,46932,46933,46944,
+46948,46952,46960,46961,46963,46965,46972,46973,46976,46980,46988,46989,46991,
+46992,46993,46994,46998,46999,47000,47001,47004,47008,47016,47017,47019,47020,
+47021,47028,47029,47032,47047,47049,47084,47085,47088,47092,47100,47101,47103,
+47104,47105,47111,47112,47113,47116,47120,47128,47129,47131,47133,47140,47141,
+47144,47148,47156,47157,47159,47160,47161,47168,47172,47185,47187,47196,47197,
+47200,47204,47212,47213,47215,47217,47224,47228,47245,47272,47280,47284,47288,
+47296,47297,47299,47301,47308,47312,47316,47325,47327,47329,47336,47337,47340,
+47344,47352,47353,47355,47357,47364,47384,47392,47420,47421,47424,47428,47436,
+47439,47441,47448,47449,47452,47456,47464,47465,47467,47469,47476,47477,47480,
+47484,47492,47493,47495,47497,47498,47501,47502,47532,47533,47536,47540,47548,
+47549,47551,47553,47560,47561,47564,47566,47567,47568,47569,47570,47576,47577,
+47579,47581,47582,47585,47587,47588,47589,47592,47596,47604,47605,47607,47608,
+47609,47610,47616,47617,47624,47637,47672,47673,47676,47680,47682,47688,47689,
+47691,47693,47694,47699,47700,47701,47704,47708,47716,47717,47719,47720,47721,
+47728,47729,47732,47736,47747,47748,47749,47751,47756,47784,47785,47787,47788,
+47792,47794,47800,47801,47803,47805,47812,47816,47832,47833,47868,47872,47876,
+47885,47887,47889,47896,47900,47904,47913,47915,47924,47925,47926,47928,47931,
+47932,47933,47934,47940,47941,47943,47945,47949,47951,47952,47956,47960,47969,
+47971,47980,48008,48012,48016,48036,48040,48044,48052,48055,48064,48068,48072,
+48080,48083,48120,48121,48124,48127,48128,48130,48136,48137,48139,48140,48141,
+48143,48145,48148,48149,48150,48151,48152,48155,48156,48157,48158,48159,48164,
+48165,48167,48169,48173,48176,48177,48180,48184,48192,48193,48195,48196,48197,
+48201,48204,48205,48208,48221,48260,48261,48264,48267,48268,48270,48276,48277,
+48279,48281,48282,48288,48289,48292,48295,48296,48304,48305,48307,48308,48309,
+48316,48317,48320,48324,48333,48335,48336,48337,48341,48344,48348,48372,48373,
+48374,48376,48380,48388,48389,48391,48393,48400,48404,48420,48428,48448,48456,
+48457,48460,48464,48472,48473,48484,48488,48512,48513,48516,48519,48520,48521,
+48522,48528,48529,48531,48533,48537,48538,48540,48548,48560,48568,48596,48597,
+48600,48604,48617,48624,48628,48632,48640,48643,48645,48652,48653,48656,48660,
+48668,48669,48671,48708,48709,48712,48716,48718,48724,48725,48727,48729,48730,
+48731,48736,48737,48740,48744,48746,48752,48753,48755,48756,48757,48763,48764,
+48765,48768,48772,48780,48781,48783,48784,48785,48792,48793,48808,48848,48849,
+48852,48855,48856,48864,48867,48868,48869,48876,48897,48904,48905,48920,48921,
+48923,48924,48925,48960,48961,48964,48968,48976,48977,48981,49044,49072,49093,
+49100,49101,49104,49108,49116,49119,49121,49212,49233,49240,49244,49248,49256,
+49257,49296,49297,49300,49304,49312,49313,49315,49317,49324,49325,49327,49328,
+49331,49332,49333,49334,49340,49341,49343,49344,49345,49349,49352,49353,49356,
+49360,49368,49369,49371,49372,49373,49380,49381,49384,49388,49396,49397,49399,
+49401,49408,49412,49416,49424,49429,49436,49437,49438,49439,49440,49443,49444,
+49446,49447,49452,49453,49455,49456,49457,49462,49464,49465,49468,49472,49480,
+49481,49483,49484,49485,49492,49493,49496,49500,49508,49509,49511,49512,49513,
+49520,49524,49528,49541,49548,49549,49550,49552,49556,49558,49564,49565,49567,
+49569,49573,49576,49577,49580,49584,49597,49604,49608,49612,49620,49623,49624,
+49632,49636,49640,49648,49649,49651,49660,49661,49664,49668,49676,49677,49679,
+49681,49688,49689,49692,49695,49696,49704,49705,49707,49709,49711,49713,49714,
+49716,49736,49744,49745,49748,49752,49760,49765,49772,49773,49776,49780,49788,
+49789,49791,49793,49800,49801,49808,49816,49819,49821,49828,49829,49832,49836,
+49837,49844,49845,49847,49849,49884,49885,49888,49891,49892,49899,49900,49901,
+49903,49905,49910,49912,49913,49915,49916,49920,49928,49929,49932,49933,49939,
+49940,49941,49944,49948,49956,49957,49960,49961,49989,50024,50025,50028,50032,
+50034,50040,50041,50044,50045,50052,50056,50060,50112,50136,50137,50140,50143,
+50144,50146,50152,50153,50157,50164,50165,50168,50184,50192,50212,50220,50224,
+50228,50236,50237,50248,50276,50277,50280,50284,50292,50293,50297,50304,50324,
+50332,50360,50364,50409,50416,50417,50420,50424,50426,50431,50432,50433,50444,
+50448,50452,50460,50472,50473,50476,50480,50488,50489,50491,50493,50500,50501,
+50504,50505,50506,50508,50509,50510,50515,50516,50517,50519,50520,50521,50525,
+50526,50528,50529,50532,50536,50544,50545,50547,50548,50549,50556,50557,50560,
+50564,50567,50572,50573,50575,50577,50581,50583,50584,50588,50592,50601,50612,
+50613,50616,50617,50619,50620,50621,50622,50628,50629,50630,50631,50632,50633,
+50634,50636,50638,50640,50641,50644,50648,50656,50657,50659,50661,50668,50669,
+50670,50672,50676,50678,50679,50684,50685,50686,50687,50688,50689,50693,50694,
+50695,50696,50700,50704,50712,50713,50715,50716,50724,50725,50728,50732,50733,
+50734,50736,50739,50740,50741,50743,50745,50747,50752,50753,50756,50760,50768,
+50769,50771,50772,50773,50780,50781,50784,50796,50799,50801,50808,50809,50812,
+50816,50824,50825,50827,50829,50836,50837,50840,50844,50852,50853,50855,50857,
+50864,50865,50868,50872,50873,50874,50880,50881,50883,50885,50892,50893,50896,
+50900,50908,50909,50912,50913,50920,50921,50924,50928,50936,50937,50941,50948,
+50949,50952,50956,50964,50965,50967,50969,50976,50977,50980,50984,50992,50993,
+50995,50997,50999,51004,51005,51008,51012,51018,51020,51021,51023,51025,51026,
+51027,51028,51029,51030,51031,51032,51036,51040,51048,51051,51060,51061,51064,
+51068,51069,51070,51075,51076,51077,51079,51080,51081,51082,51086,51088,51089,
+51092,51094,51095,51096,51098,51104,51105,51107,51108,51109,51110,51116,51117,
+51120,51124,51132,51133,51135,51136,51137,51144,51145,51148,51150,51152,51160,
+51165,51172,51176,51180,51200,51201,51204,51208,51210,51216,51217,51219,51221,
+51222,51228,51229,51232,51236,51244,51245,51247,51249,51256,51260,51264,51272,
+51273,51276,51277,51284,51312,51313,51316,51320,51322,51328,51329,51331,51333,
+51334,51335,51339,51340,51341,51348,51357,51359,51361,51368,51388,51389,51396,
+51400,51404,51412,51413,51415,51417,51424,51425,51428,51445,51452,51453,51456,
+51460,51461,51462,51468,51469,51471,51473,51480,51500,51508,51536,51537,51540,
+51544,51552,51553,51555,51564,51568,51572,51580,51592,51593,51596,51600,51608,
+51609,51611,51613,51648,51649,51652,51655,51656,51658,51664,51665,51667,51669,
+51670,51673,51674,51676,51677,51680,51682,51684,51687,51692,51693,51695,51696,
+51697,51704,51705,51708,51712,51720,51721,51723,51724,51725,51732,51736,51753,
+51788,51789,51792,51796,51804,51805,51807,51808,51809,51816,51837,51844,51864,
+51900,51901,51904,51908,51916,51917,51919,51921,51923,51928,51929,51936,51948,
+51956,51976,51984,51988,51992,52000,52001,52033,52040,52041,52044,52048,52056,
+52057,52061,52068,52088,52089,52124,52152,52180,52196,52199,52201,52236,52237,
+52240,52244,52252,52253,52257,52258,52263,52264,52265,52268,52270,52272,52280,
+52281,52283,52284,52285,52286,52292,52293,52296,52300,52308,52309,52311,52312,
+52313,52320,52324,52326,52328,52336,52341,52376,52377,52380,52384,52392,52393,
+52395,52396,52397,52404,52405,52408,52412,52420,52421,52423,52425,52432,52436,
+52452,52460,52464,52481,52488,52489,52492,52496,52504,52505,52507,52509,52516,
+52520,52524,52537,52572,52576,52580,52588,52589,52591,52593,52600,52616,52628,
+52629,52632,52636,52644,52645,52647,52649,52656,52676,52684,52688,52712,52716,
+52720,52728,52729,52731,52733,52740,52744,52748,52756,52761,52768,52769,52772,
+52776,52784,52785,52787,52789,52824,52825,52828,52831,52832,52833,52840,52841,
+52843,52845,52852,52853,52856,52860,52868,52869,52871,52873,52880,52881,52884,
+52888,52896,52897,52899,52900,52901,52908,52909,52929,52964,52965,52968,52971,
+52972,52980,52981,52983,52984,52985,52992,52993,52996,53000,53008,53009,53011,
+53013,53020,53024,53028,53036,53037,53039,53040,53041,53048,53076,53077,53080,
+53084,53092,53093,53095,53097,53104,53105,53108,53112,53120,53125,53132,53153,
+53160,53168,53188,53216,53217,53220,53224,53232,53233,53235,53237,53244,53248,
+53252,53265,53272,53293,53300,53301,53304,53308,53316,53317,53319,53321,53328,
+53332,53336,53344,53356,53357,53360,53364,53372,53373,53377,53412,53413,53416,
+53420,53428,53429,53431,53433,53440,53441,53444,53448,53449,53456,53457,53459,
+53460,53461,53468,53469,53472,53476,53484,53485,53487,53488,53489,53496,53517,
+53552,53553,53556,53560,53562,53568,53569,53571,53572,53573,53580,53581,53584,
+53588,53596,53597,53599,53601,53608,53612,53628,53636,53640,53664,53665,53668,
+53672,53680,53681,53683,53685,53690,53692,53696,53720,53748,53752,53767,53769,
+53776,53804,53805,53808,53812,53820,53821,53823,53825,53832,53852,53860,53888,
+53889,53892,53896,53904,53905,53909,53916,53920,53924,53932,53937,53944,53945,
+53948,53951,53952,53954,53960,53961,53963,53972,53976,53980,53988,53989,54000,
+54001,54004,54008,54016,54017,54019,54021,54028,54029,54030,54032,54036,54038,
+54044,54045,54047,54048,54049,54053,54056,54057,54060,54064,54072,54073,54075,
+54076,54077,54084,54085,54140,54141,54144,54148,54156,54157,54159,54160,54161,
+54168,54169,54172,54176,54184,54185,54187,54189,54196,54200,54204,54212,54213,
+54216,54217,54224,54232,54241,54243,54252,54253,54256,54260,54268,54269,54271,
+54273,54280,54301,54336,54340,54364,54368,54372,54381,54383,54392,54393,54396,
+54399,54400,54402,54408,54409,54411,54413,54420,54441,54476,54480,54484,54492,
+54495,54504,54508,54512,54520,54523,54525,54532,54536,54540,54548,54549,54551,
+54588,54589,54592,54596,54604,54605,54607,54609,54616,54617,54620,54624,54629,
+54632,54633,54635,54637,54644,54645,54648,54652,54660,54661,54663,54664,54665,
+54672,54693,54728,54729,54732,54736,54738,54744,54745,54747,54749,54756,54757,
+54760,54764,54772,54773,54775,54777,54784,54785,54788,54792,54800,54801,54803,
+54804,54805,54812,54816,54820,54829,54840,54841,54844,54848,54853,54856,54857,
+54859,54861,54865,54868,54869,54872,54876,54887,54889,54896,54897,54900,54915,
+54917,54924,54925,54928,54932,54941,54943,54945,54952,54956,54960,54969,54971,
+54980,54981,54984,54988,54993,54996,54999,55001,55008,55012,55016,55024,55029,
+55036,55037,55040,55044,55057,55064,55065,55068,55072,55080,55081,55083,55085,
+55092,55093,55096,55100,55108,55111,55113,55120,55121,55124,55126,55127,55128,
+55129,55136,55137,55139,55141,55145,55148,55152,55156,55164,55165,55169,55176,
+55177,55180,55184,55192,55193,55195,55197,20285,20339,20551,20729,21152,21487,
+21621,21733,22025,23233,23478,26247,26550,26551,26607,27468,29634,30146,31292,
+33499,33540,34903,34952,35382,36040,36303,36603,36838,39381,21051,21364,21508,
+24682,24932,27580,29647,33050,35258,35282,38307,20355,21002,22718,22904,23014,
+24178,24185,25031,25536,26438,26604,26751,28567,30286,30475,30965,31240,31487,
+31777,32925,33390,33393,35563,38291,20075,21917,26359,28212,30883,31469,33883,
+35088,34638,38824,21208,22350,22570,23884,24863,25022,25121,25954,26577,27204,
+28187,29976,30131,30435,30640,32058,37039,37969,37970,40853,21283,23724,30002,
+32987,37440,38296,21083,22536,23004,23713,23831,24247,24378,24394,24951,27743,
+30074,30086,31968,32115,32177,32652,33108,33313,34193,35137,35611,37628,38477,
+40007,20171,20215,20491,20977,22607,24887,24894,24936,25913,27114,28433,30117,
+30342,30422,31623,33445,33995,63744,37799,38283,21888,23458,22353,63745,31923,
+32697,37301,20520,21435,23621,24040,25298,25454,25818,25831,28192,28844,31067,
+36317,36382,63746,36989,37445,37624,20094,20214,20581,24062,24314,24838,26967,
+33137,34388,36423,37749,39467,20062,20625,26480,26688,20745,21133,21138,27298,
+30652,37392,40660,21163,24623,36850,20552,25001,25581,25802,26684,27268,28608,
+33160,35233,38548,22533,29309,29356,29956,32121,32365,32937,35211,35700,36963,
+40273,25225,27770,28500,32080,32570,35363,20860,24906,31645,35609,37463,37772,
+20140,20435,20510,20670,20742,21185,21197,21375,22384,22659,24218,24465,24950,
+25004,25806,25964,26223,26299,26356,26775,28039,28805,28913,29855,29861,29898,
+30169,30828,30956,31455,31478,32069,32147,32789,32831,33051,33686,35686,36629,
+36885,37857,38915,38968,39514,39912,20418,21843,22586,22865,23395,23622,24760,
+25106,26690,26800,26856,28330,30028,30328,30926,31293,31995,32363,32380,35336,
+35489,35903,38542,40388,21476,21481,21578,21617,22266,22993,23396,23611,24235,
+25335,25911,25925,25970,26272,26543,27073,27837,30204,30352,30590,31295,32660,
+32771,32929,33167,33510,33533,33776,34241,34865,34996,35493,63747,36764,37678,
+38599,39015,39640,40723,21741,26011,26354,26767,31296,35895,40288,22256,22372,
+23825,26118,26801,26829,28414,29736,34974,39908,27752,63748,39592,20379,20844,
+20849,21151,23380,24037,24656,24685,25329,25511,25915,29657,31354,34467,36002,
+38799,20018,23521,25096,26524,29916,31185,33747,35463,35506,36328,36942,37707,
+38982,24275,27112,34303,37101,63749,20896,23448,23532,24931,26874,27454,28748,
+29743,29912,31649,32592,33733,35264,36011,38364,39208,21038,24669,25324,36866,
+20362,20809,21281,22745,24291,26336,27960,28826,29378,29654,31568,33009,37979,
+21350,25499,32619,20054,20608,22602,22750,24618,24871,25296,27088,39745,23439,
+32024,32945,36703,20132,20689,21676,21932,23308,23968,24039,25898,25934,26657,
+27211,29409,30350,30703,32094,32761,33184,34126,34527,36611,36686,37066,39171,
+39509,39851,19992,20037,20061,20167,20465,20855,21246,21312,21475,21477,21646,
+22036,22389,22434,23495,23943,24272,25084,25304,25937,26552,26601,27083,27472,
+27590,27628,27714,28317,28792,29399,29590,29699,30655,30697,31350,32127,32777,
+33276,33285,33290,33503,34914,35635,36092,36544,36881,37041,37476,37558,39378,
+39493,40169,40407,40860,22283,23616,33738,38816,38827,40628,21531,31384,32676,
+35033,36557,37089,22528,23624,25496,31391,23470,24339,31353,31406,33422,36524,
+20518,21048,21240,21367,22280,25331,25458,27402,28099,30519,21413,29527,34152,
+36470,38357,26426,27331,28528,35437,36556,39243,63750,26231,27512,36020,39740,
+63751,21483,22317,22862,25542,27131,29674,30789,31418,31429,31998,33909,35215,
+36211,36917,38312,21243,22343,30023,31584,33740,37406,63752,27224,20811,21067,
+21127,25119,26840,26997,38553,20677,21156,21220,25027,26020,26681,27135,29822,
+31563,33465,33771,35250,35641,36817,39241,63753,20170,22935,25810,26129,27278,
+29748,31105,31165,33449,34942,34943,35167,63754,37670,20235,21450,24613,25201,
+27762,32026,32102,20120,20834,30684,32943,20225,20238,20854,20864,21980,22120,
+22331,22522,22524,22804,22855,22931,23492,23696,23822,24049,24190,24524,25216,
+26071,26083,26398,26399,26462,26827,26820,27231,27450,27683,27773,27778,28103,
+29592,29734,29738,29826,29859,30072,30079,30849,30959,31041,31047,31048,31098,
+31637,32000,32186,32648,32774,32813,32908,35352,35663,35912,36215,37665,37668,
+39138,39249,39438,39439,39525,40594,32202,20342,21513,25326,26708,37329,21931,
+20794,63755,63756,23068,25062,63757,25295,25343,63758,63759,63760,63761,63762,
+63763,37027,63764,63765,63766,63767,63768,35582,63769,63770,63771,63772,26262,
+63773,29014,63774,63775,38627,63776,25423,25466,21335,63777,26511,26976,28275,
+63778,30007,63779,63780,63781,32013,63782,63783,34930,22218,23064,63784,63785,
+63786,63787,63788,20035,63789,20839,22856,26608,32784,63790,22899,24180,25754,
+31178,24565,24684,25288,25467,23527,23511,21162,63791,22900,24361,24594,63792,
+63793,63794,29785,63795,63796,63797,63798,63799,63800,39377,63801,63802,63803,
+63804,63805,63806,63807,63808,63809,63810,63811,28611,63812,63813,33215,36786,
+24817,63814,63815,33126,63816,63817,23615,63818,63819,63820,63821,63822,63823,
+63824,63825,23273,35365,26491,32016,63826,63827,63828,63829,63830,63831,33021,
+63832,63833,23612,27877,21311,28346,22810,33590,20025,20150,20294,21934,22296,
+22727,24406,26039,26086,27264,27573,28237,30701,31471,31774,32222,34507,34962,
+37170,37723,25787,28606,29562,30136,36948,21846,22349,25018,25812,26311,28129,
+28251,28525,28601,30192,32835,33213,34113,35203,35527,35674,37663,27795,30035,
+31572,36367,36957,21776,22530,22616,24162,25095,25758,26848,30070,31958,34739,
+40680,20195,22408,22382,22823,23565,23729,24118,24453,25140,25825,29619,33274,
+34955,36024,38538,40667,23429,24503,24755,20498,20992,21040,22294,22581,22615,
+23566,23648,23798,23947,24230,24466,24764,25361,25481,25623,26691,26873,27330,
+28120,28193,28372,28644,29182,30428,30585,31153,31291,33796,35241,36077,36339,
+36424,36867,36884,36947,37117,37709,38518,38876,27602,28678,29272,29346,29544,
+30563,31167,31716,32411,35712,22697,24775,25958,26109,26302,27788,28958,29129,
+35930,38931,20077,31361,20189,20908,20941,21205,21516,24999,26481,26704,26847,
+27934,28540,30140,30643,31461,33012,33891,37509,20828,26007,26460,26515,30168,
+31431,33651,63834,35910,36887,38957,23663,33216,33434,36929,36975,37389,24471,
+23965,27225,29128,30331,31561,34276,35588,37159,39472,21895,25078,63835,30313,
+32645,34367,34746,35064,37007,63836,27931,28889,29662,32097,33853,63837,37226,
+39409,63838,20098,21365,27396,27410,28734,29211,34349,40478,21068,36771,23888,
+25829,25900,27414,28651,31811,32412,34253,35172,35261,25289,33240,34847,24266,
+26391,28010,29436,29701,29807,34690,37086,20358,23821,24480,33802,20919,25504,
+30053,20142,20486,20841,20937,26753,27153,31918,31921,31975,33391,35538,36635,
+37327,20406,20791,21237,21570,24300,24942,25150,26053,27354,28670,31018,34268,
+34851,38317,39522,39530,40599,40654,21147,26310,27511,28701,31019,36706,38722,
+24976,25088,25891,28451,29001,29833,32244,32879,34030,36646,36899,37706,20925,
+21015,21155,27916,28872,35010,24265,25986,27566,28610,31806,29557,20196,20278,
+22265,63839,23738,23994,24604,29618,31533,32666,32718,32838,36894,37428,38646,
+38728,38936,40801,20363,28583,31150,37300,38583,21214,63840,25736,25796,27347,
+28510,28696,29200,30439,32769,34310,34396,36335,36613,38706,39791,40442,40565,
+30860,31103,32160,33737,37636,40575,40595,35542,22751,24324,26407,28711,29903,
+31840,32894,20769,28712,29282,30922,36034,36058,36084,38647,20102,20698,23534,
+24278,26009,29134,30274,30637,32842,34044,36988,39719,40845,22744,23105,23650,
+27155,28122,28431,30267,32047,32311,34078,35128,37860,38475,21129,26066,26611,
+27060,27969,28316,28687,29705,29792,30041,30244,30827,35628,39006,20845,25134,
+38520,20374,20523,23833,28138,32184,36650,24459,24900,26647,63841,38534,21202,
+32907,20956,20940,26974,31260,32190,33777,38517,20442,21033,21400,21519,21774,
+23653,24743,26446,26792,28012,29313,29432,29702,29827,63842,30178,31852,32633,
+32696,33673,35023,35041,37324,37328,38626,39881,21533,28542,29136,29848,34298,
+36522,38563,40023,40607,26519,28107,29747,33256,38678,30764,31435,31520,31890,
+25705,29802,30194,30908,30952,39340,39764,40635,23518,24149,28448,33180,33707,
+37000,19975,21325,23081,24018,24398,24930,25405,26217,26364,28415,28459,28771,
+30622,33836,34067,34875,36627,39237,39995,21788,25273,26411,27819,33545,35178,
+38778,20129,22916,24536,24537,26395,32178,32596,33426,33579,33725,36638,37017,
+22475,22969,23186,23504,26151,26522,26757,27599,29028,32629,36023,36067,36993,
+39749,33032,35978,38476,39488,40613,23391,27667,29467,30450,30431,33804,20906,
+35219,20813,20885,21193,26825,27796,30468,30496,32191,32236,38754,40629,28357,
+34065,20901,21517,21629,26126,26269,26919,28319,30399,30609,33559,33986,34719,
+37225,37528,40180,34946,20398,20882,21215,22982,24125,24917,25720,25721,26286,
+26576,27169,27597,27611,29279,29281,29761,30520,30683,32791,33468,33541,35584,
+35624,35980,26408,27792,29287,30446,30566,31302,40361,27519,27794,22818,26406,
+33945,21359,22675,22937,24287,25551,26164,26483,28218,29483,31447,33495,37672,
+21209,24043,25006,25035,25098,25287,25771,26080,26969,27494,27595,28961,29687,
+30045,32326,33310,33538,34154,35491,36031,38695,40289,22696,40664,20497,21006,
+21563,21839,25991,27766,32010,32011,32862,34442,38272,38639,21247,27797,29289,
+21619,23194,23614,23883,24396,24494,26410,26806,26979,28220,28228,30473,31859,
+32654,34183,35598,36855,38753,40692,23735,24758,24845,25003,25935,26107,26108,
+27665,27887,29599,29641,32225,38292,23494,34588,35600,21085,21338,25293,25615,
+25778,26420,27192,27850,29632,29854,31636,31893,32283,33162,33334,34180,36843,
+38649,39361,20276,21322,21453,21467,25292,25644,25856,26001,27075,27886,28504,
+29677,30036,30242,30436,30460,30928,30971,31020,32070,33324,34784,36820,38930,
+39151,21187,25300,25765,28196,28497,30332,36299,37297,37474,39662,39747,20515,
+20621,22346,22952,23592,24135,24439,25151,25918,26041,26049,26121,26507,27036,
+28354,30917,32033,32938,33152,33323,33459,33953,34444,35370,35607,37030,38450,
+40848,20493,20467,63843,22521,24472,25308,25490,26479,28227,28953,30403,32972,
+32986,35060,35061,35097,36064,36649,37197,38506,20271,20336,24091,26575,26658,
+30333,30334,39748,24161,27146,29033,29140,30058,63844,32321,34115,34281,39132,
+20240,31567,32624,38309,20961,24070,26805,27710,27726,27867,29359,31684,33539,
+27861,29754,20731,21128,22721,25816,27287,29863,30294,30887,34327,38370,38713,
+63845,21342,24321,35722,36776,36783,37002,21029,30629,40009,40712,19993,20482,
+20853,23643,24183,26142,26170,26564,26821,28851,29953,30149,31177,31453,36647,
+39200,39432,20445,22561,22577,23542,26222,27493,27921,28282,28541,29668,29995,
+33769,35036,35091,35676,36628,20239,20693,21264,21340,23443,24489,26381,31119,
+33145,33583,34068,35079,35206,36665,36667,39333,39954,26412,20086,20472,22857,
+23553,23791,23792,25447,26834,28925,29090,29739,32299,34028,34562,36898,37586,
+40179,19981,20184,20463,20613,21078,21103,21542,21648,22496,22827,23142,23386,
+23413,23500,24220,63846,25206,25975,26023,28014,28325,29238,31526,31807,32566,
+33104,33105,33178,33344,33433,33705,35331,36000,36070,36091,36212,36282,37096,
+37340,38428,38468,39385,40167,21271,20998,21545,22132,22707,22868,22894,24575,
+24996,25198,26128,27774,28954,30406,31881,31966,32027,33452,36033,38640,63847,
+20315,24343,24447,25282,23849,26379,26842,30844,32323,40300,19989,20633,21269,
+21290,21329,22915,23138,24199,24754,24970,25161,25209,26000,26503,27047,27604,
+27606,27607,27608,27832,63848,29749,30202,30738,30865,31189,31192,31875,32203,
+32737,32933,33086,33218,33778,34586,35048,35513,35692,36027,37145,38750,39131,
+40763,22188,23338,24428,25996,27315,27567,27996,28657,28693,29277,29613,36007,
+36051,38971,24977,27703,32856,39425,20045,20107,20123,20181,20282,20284,20351,
+20447,20735,21490,21496,21766,21987,22235,22763,22882,23057,23531,23546,23556,
+24051,24107,24473,24605,25448,26012,26031,26614,26619,26797,27515,27801,27863,
+28195,28681,29509,30722,31038,31040,31072,31169,31721,32023,32114,32902,33293,
+33678,34001,34503,35039,35408,35422,35613,36060,36198,36781,37034,39164,39391,
+40605,21066,63849,26388,63850,20632,21034,23665,25955,27733,29642,29987,30109,
+31639,33948,37240,38704,20087,25746,27578,29022,34217,19977,63851,26441,26862,
+28183,33439,34072,34923,25591,28545,37394,39087,19978,20663,20687,20767,21830,
+21930,22039,23360,23577,23776,24120,24202,24224,24258,24819,26705,27233,28248,
+29245,29248,29376,30456,31077,31665,32724,35059,35316,35443,35937,36062,38684,
+22622,29885,36093,21959,63852,31329,32034,33394,29298,29983,29989,63853,31513,
+22661,22779,23996,24207,24246,24464,24661,25234,25471,25933,26257,26329,26360,
+26646,26866,29312,29790,31598,32110,32214,32626,32997,33298,34223,35199,35475,
+36893,37604,40653,40736,22805,22893,24109,24796,26132,26227,26512,27728,28101,
+28511,30707,30889,33990,37323,37675,20185,20682,20808,21892,23307,23459,25159,
+25982,26059,28210,29053,29697,29764,29831,29887,30316,31146,32218,32341,32680,
+33146,33203,33337,34330,34796,35445,36323,36984,37521,37925,39245,39854,21352,
+23633,26964,27844,27945,28203,33292,34203,35131,35373,35498,38634,40807,21089,
+26297,27570,32406,34814,36109,38275,38493,25885,28041,29166,63854,22478,22995,
+23468,24615,24826,25104,26143,26207,29481,29689,30427,30465,31596,32854,32882,
+33125,35488,37266,19990,21218,27506,27927,31237,31545,32048,63855,36016,21484,
+22063,22609,23477,23567,23569,24034,25152,25475,25620,26157,26803,27836,28040,
+28335,28703,28836,29138,29990,30095,30094,30233,31505,31712,31787,32032,32057,
+34092,34157,34311,35380,36877,36961,37045,37559,38902,39479,20439,23660,26463,
+28049,31903,32396,35606,36118,36895,23403,24061,25613,33984,36956,39137,29575,
+23435,24730,26494,28126,35359,35494,36865,38924,21047,63856,28753,30862,37782,
+34928,37335,20462,21463,22013,22234,22402,22781,23234,23432,23723,23744,24101,
+24833,25101,25163,25480,25628,25910,25976,27193,27530,27700,27929,28465,29159,
+29417,29560,29703,29874,30246,30561,31168,31319,31466,31929,32143,32172,32353,
+32670,33065,33585,33936,34010,34282,34966,35504,35728,36664,36930,36995,37228,
+37526,37561,38539,38567,38568,38614,38656,38920,39318,39635,39706,21460,22654,
+22809,23408,23487,28113,28506,29087,29729,29881,32901,33789,24033,24455,24490,
+24642,26092,26642,26991,27219,27529,27957,28147,29667,30462,30636,31565,32020,
+33059,33308,33600,34036,34147,35426,35524,37255,37662,38918,39348,25100,34899,
+36848,37477,23815,23847,23913,29791,33181,34664,28629,25342,32722,35126,35186,
+19998,20056,20711,21213,21319,25215,26119,32361,34821,38494,20365,21273,22070,
+22987,23204,23608,23630,23629,24066,24337,24643,26045,26159,26178,26558,26612,
+29468,30690,31034,32709,33940,33997,35222,35430,35433,35553,35925,35962,22516,
+23508,24335,24687,25325,26893,27542,28252,29060,31698,34645,35672,36606,39135,
+39166,20280,20353,20449,21627,23072,23480,24892,26032,26216,29180,30003,31070,
+32051,33102,33251,33688,34218,34254,34563,35338,36523,36763,63857,36805,22833,
+23460,23526,24713,23529,23563,24515,27777,63858,28145,28683,29978,33455,35574,
+20160,21313,63859,38617,27663,20126,20420,20818,21854,23077,23784,25105,29273,
+33469,33706,34558,34905,35357,38463,38597,39187,40201,40285,22538,23731,23997,
+24132,24801,24853,25569,27138,28197,37122,37716,38990,39952,40823,23433,23736,
+25353,26191,26696,30524,38593,38797,38996,39839,26017,35585,36555,38332,21813,
+23721,24022,24245,26263,30284,33780,38343,22739,25276,29390,40232,20208,22830,
+24591,26171,27523,31207,40230,21395,21696,22467,23830,24859,26326,28079,30861,
+33406,38552,38724,21380,25212,25494,28082,32266,33099,38989,27387,32588,40367,
+40474,20063,20539,20918,22812,24825,25590,26928,29242,32822,63860,37326,24369,
+63861,63862,32004,33509,33903,33979,34277,36493,63863,20335,63864,63865,22756,
+23363,24665,25562,25880,25965,26264,63866,26954,27171,27915,28673,29036,30162,
+30221,31155,31344,63867,32650,63868,35140,63869,35731,37312,38525,63870,39178,
+22276,24481,26044,28417,30208,31142,35486,39341,39770,40812,20740,25014,25233,
+27277,33222,20547,22576,24422,28937,35328,35578,23420,34326,20474,20796,22196,
+22852,25513,28153,23978,26989,20870,20104,20313,63871,63872,63873,22914,63874,
+63875,27487,27741,63876,29877,30998,63877,33287,33349,33593,36671,36701,63878,
+39192,63879,63880,63881,20134,63882,22495,24441,26131,63883,63884,30123,32377,
+35695,63885,36870,39515,22181,22567,23032,23071,23476,63886,24310,63887,63888,
+25424,25403,63889,26941,27783,27839,28046,28051,28149,28436,63890,28895,28982,
+29017,63891,29123,29141,63892,30799,30831,63893,31605,32227,63894,32303,63895,
+34893,36575,63896,63897,63898,37467,63899,40182,63900,63901,63902,24709,28037,
+63903,29105,63904,63905,38321,21421,63906,63907,63908,26579,63909,28814,28976,
+29744,33398,33490,63910,38331,39653,40573,26308,63911,29121,33865,63912,63913,
+22603,63914,63915,23992,24433,63916,26144,26254,27001,27054,27704,27891,28214,
+28481,28634,28699,28719,29008,29151,29552,63917,29787,63918,29908,30408,31310,
+32403,63919,63920,33521,35424,36814,63921,37704,63922,38681,63923,63924,20034,
+20522,63925,21000,21473,26355,27757,28618,29450,30591,31330,33454,34269,34306,
+63926,35028,35427,35709,35947,63927,37555,63928,38675,38928,20116,20237,20425,
+20658,21320,21566,21555,21978,22626,22714,22887,23067,23524,24735,63929,25034,
+25942,26111,26212,26791,27738,28595,28879,29100,29522,31613,34568,35492,39986,
+40711,23627,27779,29508,29577,37434,28331,29797,30239,31337,32277,34314,20800,
+22725,25793,29934,29973,30320,32705,37013,38605,39252,28198,29926,31401,31402,
+33253,34521,34680,35355,23113,23436,23451,26785,26880,28003,29609,29715,29740,
+30871,32233,32747,33048,33109,33694,35916,38446,38929,26352,24448,26106,26505,
+27754,29579,20525,23043,27498,30702,22806,23916,24013,29477,30031,63930,63931,
+20709,20985,22575,22829,22934,23002,23525,63932,63933,23970,25303,25622,25747,
+25854,63934,26332,63935,27208,63936,29183,29796,63937,31368,31407,32327,32350,
+32768,33136,63938,34799,35201,35616,36953,63939,36992,39250,24958,27442,28020,
+32287,35109,36785,20433,20653,20887,21191,22471,22665,23481,24248,24898,27029,
+28044,28263,28342,29076,29794,29992,29996,32883,33592,33993,36362,37780,37854,
+63940,20110,20305,20598,20778,21448,21451,21491,23431,23507,23588,24858,24962,
+26100,29275,29591,29760,30402,31056,31121,31161,32006,32701,33419,34261,34398,
+36802,36935,37109,37354,38533,38632,38633,21206,24423,26093,26161,26671,29020,
+31286,37057,38922,20113,63941,27218,27550,28560,29065,32792,33464,34131,36939,
+38549,38642,38907,34074,39729,20112,29066,38596,20803,21407,21729,22291,22290,
+22435,23195,23236,23491,24616,24895,25588,27781,27961,28274,28304,29232,29503,
+29783,33489,34945,36677,36960,63942,38498,39000,40219,26376,36234,37470,20301,
+20553,20702,21361,22285,22996,23041,23561,24944,26256,28205,29234,29771,32239,
+32963,33806,33894,34111,34655,34907,35096,35586,36949,38859,39759,20083,20369,
+20754,20842,63943,21807,21929,23418,23461,24188,24189,24254,24736,24799,24840,
+24841,25540,25912,26377,63944,26580,26586,63945,26977,26978,27833,27943,63946,
+28216,63947,28641,29494,29495,63948,29788,30001,63949,30290,63950,63951,32173,
+33278,33848,35029,35480,35547,35565,36400,36418,36938,36926,36986,37193,37321,
+37742,63952,63953,22537,63954,27603,32905,32946,63955,63956,20801,22891,23609,
+63957,63958,28516,29607,32996,36103,63959,37399,38287,63960,63961,63962,63963,
+32895,25102,28700,32104,34701,63964,22432,24681,24903,27575,35518,37504,38577,
+20057,21535,28139,34093,38512,38899,39150,25558,27875,37009,20957,25033,33210,
+40441,20381,20506,20736,23452,24847,25087,25836,26885,27589,30097,30691,32681,
+33380,34191,34811,34915,35516,35696,37291,20108,20197,20234,63965,63966,22839,
+23016,63967,24050,24347,24411,24609,63968,63969,63970,63971,29246,29669,63972,
+30064,30157,63973,31227,63974,32780,32819,32900,33505,33617,63975,63976,36029,
+36019,36999,63977,63978,39156,39180,63979,63980,28727,30410,32714,32716,32764,
+35610,20154,20161,20995,21360,63981,21693,22240,23035,23493,24341,24525,28270,
+63982,63983,32106,33589,63984,34451,35469,63985,38765,38775,63986,63987,19968,
+20314,20350,22777,26085,28322,36920,37808,39353,20219,22764,22922,23001,24641,
+63988,63989,31252,63990,33615,36035,20837,21316,63991,63992,63993,20173,21097,
+23381,33471,20180,21050,21672,22985,23039,23376,23383,23388,24675,24904,28363,
+28825,29038,29574,29943,30133,30913,32043,32773,33258,33576,34071,34249,35566,
+36039,38604,20316,21242,22204,26027,26152,28796,28856,29237,32189,33421,37196,
+38592,40306,23409,26855,27544,28538,30430,23697,26283,28507,31668,31786,34870,
+38620,19976,20183,21280,22580,22715,22767,22892,23559,24115,24196,24373,25484,
+26290,26454,27167,27299,27404,28479,29254,63994,29520,29835,31456,31911,33144,
+33247,33255,33674,33900,34083,34196,34255,35037,36115,37292,38263,38556,20877,
+21705,22312,23472,25165,26448,26685,26771,28221,28371,28797,32289,35009,36001,
+36617,40779,40782,29229,31631,35533,37658,20295,20302,20786,21632,22992,24213,
+25269,26485,26990,27159,27822,28186,29401,29482,30141,31672,32053,33511,33785,
+33879,34295,35419,36015,36487,36889,37048,38606,40799,21219,21514,23265,23490,
+25688,25973,28404,29380,63995,30340,31309,31515,31821,32318,32735,33659,35627,
+36042,36196,36321,36447,36842,36857,36969,37841,20291,20346,20659,20840,20856,
+21069,21098,22625,22652,22880,23560,23637,24283,24731,25136,26643,27583,27656,
+28593,29006,29728,30000,30008,30033,30322,31564,31627,31661,31686,32399,35438,
+36670,36681,37439,37523,37666,37931,38651,39002,39019,39198,20999,25130,25240,
+27993,30308,31434,31680,32118,21344,23742,24215,28472,28857,31896,38673,39822,
+40670,25509,25722,34678,19969,20117,20141,20572,20597,21576,22979,23450,24128,
+24237,24311,24449,24773,25402,25919,25972,26060,26230,26232,26622,26984,27273,
+27491,27712,28096,28136,28191,28254,28702,28833,29582,29693,30010,30555,30855,
+31118,31243,31357,31934,32142,33351,35330,35562,35998,37165,37194,37336,37478,
+37580,37664,38662,38742,38748,38914,40718,21046,21137,21884,22564,24093,24351,
+24716,25552,26799,28639,31085,31532,33229,34234,35069,35576,36420,37261,38500,
+38555,38717,38988,40778,20430,20806,20939,21161,22066,24340,24427,25514,25805,
+26089,26177,26362,26361,26397,26781,26839,27133,28437,28526,29031,29157,29226,
+29866,30522,31062,31066,31199,31264,31381,31895,31967,32068,32368,32903,34299,
+34468,35412,35519,36249,36481,36896,36973,37347,38459,38613,40165,26063,31751,
+36275,37827,23384,23562,21330,25305,29469,20519,23447,24478,24752,24939,26837,
+28121,29742,31278,32066,32156,32305,33131,36394,36405,37758,37912,20304,22352,
+24038,24231,25387,32618,20027,20303,20367,20570,23005,32964,21610,21608,22014,
+22863,23449,24030,24282,26205,26417,26609,26666,27880,27954,28234,28557,28855,
+29664,30087,31820,32002,32044,32162,33311,34523,35387,35461,36208,36490,36659,
+36913,37198,37202,37956,39376,31481,31909,20426,20737,20934,22472,23535,23803,
+26201,27197,27994,28310,28652,28940,30063,31459,34850,36897,36981,38603,39423,
+33537,20013,20210,34886,37325,21373,27355,26987,27713,33914,22686,24974,26366,
+25327,28893,29969,30151,32338,33976,35657,36104,20043,21482,21675,22320,22336,
+24535,25345,25351,25711,25903,26088,26234,26525,26547,27490,27744,27802,28460,
+30693,30757,31049,31063,32025,32930,33026,33267,33437,33463,34584,35468,63996,
+36100,36286,36978,30452,31257,31287,32340,32887,21767,21972,22645,25391,25634,
+26185,26187,26733,27035,27524,27941,28337,29645,29800,29857,30043,30137,30433,
+30494,30603,31206,32265,32285,33275,34095,34967,35386,36049,36587,36784,36914,
+37805,38499,38515,38663,20356,21489,23018,23241,24089,26702,29894,30142,31209,
+31378,33187,34541,36074,36300,36845,26015,26389,63997,22519,28503,32221,36655,
+37878,38598,24501,25074,28548,19988,20376,20511,21449,21983,23919,24046,27425,
+27492,30923,31642,63998,36425,36554,36974,25417,25662,30528,31364,37679,38015,
+40810,25776,28591,29158,29864,29914,31428,31762,32386,31922,32408,35738,36106,
+38013,39184,39244,21049,23519,25830,26413,32046,20717,21443,22649,24920,24921,
+25082,26028,31449,35730,35734,20489,20513,21109,21809,23100,24288,24432,24884,
+25950,26124,26166,26274,27085,28356,28466,29462,30241,31379,33081,33369,33750,
+33980,20661,22512,23488,23528,24425,25505,30758,32181,33756,34081,37319,37365,
+20874,26613,31574,36012,20932,22971,24765,34389,20508,63999,21076,23610,24957,
+25114,25299,25842,26021,28364,30240,33034,36448,38495,38587,20191,21315,21912,
+22825,24029,25797,27849,28154,29588,31359,33307,34214,36068,36368,36983,37351,
+38369,38433,38854,20984,21746,21894,24505,25764,28552,32180,36639,36685,37941,
+20681,23574,27838,28155,29979,30651,31805,31844,35449,35522,22558,22974,24086,
+25463,29266,30090,30571,35548,36028,36626,24307,26228,28152,32893,33729,35531,
+38737,39894,64000,21059,26367,28053,28399,32224,35558,36910,36958,39636,21021,
+21119,21736,24980,25220,25307,26786,26898,26970,27189,28818,28966,30813,30977,
+30990,31186,31245,32918,33400,33493,33609,34121,35970,36229,37218,37259,37294,
+20419,22225,29165,30679,34560,35320,23544,24534,26449,37032,21474,22618,23541,
+24740,24961,25696,32317,32880,34085,37507,25774,20652,23828,26368,22684,25277,
+25512,26894,27000,27166,28267,30394,31179,33467,33833,35535,36264,36861,37138,
+37195,37276,37648,37656,37786,38619,39478,39949,19985,30044,31069,31482,31569,
+31689,32302,33988,36441,36468,36600,36880,26149,26943,29763,20986,26414,40668,
+20805,24544,27798,34802,34909,34935,24756,33205,33795,36101,21462,21561,22068,
+23094,23601,28810,32736,32858,33030,33261,36259,37257,39519,40434,20596,20164,
+21408,24827,28204,23652,20360,20516,21988,23769,24159,24677,26772,27835,28100,
+29118,30164,30196,30305,31258,31305,32199,32251,32622,33268,34473,36636,38601,
+39347,40786,21063,21189,39149,35242,19971,26578,28422,20405,23522,26517,27784,
+28024,29723,30759,37341,37756,34756,31204,31281,24555,20182,21668,21822,22702,
+22949,24816,25171,25302,26422,26965,33333,38464,39345,39389,20524,21331,21828,
+22396,64001,25176,64002,25826,26219,26589,28609,28655,29730,29752,35351,37944,
+21585,22022,22374,24392,24986,27470,28760,28845,32187,35477,22890,33067,25506,
+30472,32829,36010,22612,25645,27067,23445,24081,28271,64003,34153,20812,21488,
+22826,24608,24907,27526,27760,27888,31518,32974,33492,36294,37040,39089,64004,
+25799,28580,25745,25860,20814,21520,22303,35342,24927,26742,64005,30171,31570,
+32113,36890,22534,27084,33151,35114,36864,38969,20600,22871,22956,25237,36879,
+39722,24925,29305,38358,22369,23110,24052,25226,25773,25850,26487,27874,27966,
+29228,29750,30772,32631,33453,36315,38935,21028,22338,26495,29256,29923,36009,
+36774,37393,38442,20843,21485,25420,20329,21764,24726,25943,27803,28031,29260,
+29437,31255,35207,35997,24429,28558,28921,33192,24846,20415,20559,25153,29255,
+31687,32232,32745,36941,38829,39449,36022,22378,24179,26544,33805,35413,21536,
+23318,24163,24290,24330,25987,32954,34109,38281,38491,20296,21253,21261,21263,
+21638,21754,22275,24067,24598,25243,25265,25429,64006,27873,28006,30129,30770,
+32990,33071,33502,33889,33970,34957,35090,36875,37610,39165,39825,24133,26292,
+26333,28689,29190,64007,20469,21117,24426,24915,26451,27161,28418,29922,31080,
+34920,35961,39111,39108,39491,21697,31263,26963,35575,35914,39080,39342,24444,
+25259,30130,30382,34987,36991,38466,21305,24380,24517,27852,29644,30050,30091,
+31558,33534,39325,20047,36924,19979,20309,21414,22799,24264,26160,27827,29781,
+33655,34662,36032,36944,38686,39957,22737,23416,34384,35604,40372,23506,24680,
+24717,26097,27735,28450,28579,28698,32597,32752,38289,38290,38480,38867,21106,
+36676,20989,21547,21688,21859,21898,27323,28085,32216,33382,37532,38519,40569,
+21512,21704,30418,34532,38308,38356,38492,20130,20233,23022,23270,24055,24658,
+25239,26477,26689,27782,28207,32568,32923,33322,64008,64009,38917,20133,20565,
+21683,22419,22874,23401,23475,25032,26999,28023,28707,34809,35299,35442,35559,
+36994,39405,39608,21182,26680,20502,24184,26447,33607,34892,20139,21521,22190,
+29670,37141,38911,39177,39255,39321,22099,22687,34395,35377,25010,27382,29563,
+36562,27463,38570,39511,22869,29184,36203,38761,20436,23796,24358,25080,26203,
+27883,28843,29572,29625,29694,30505,30541,32067,32098,32291,33335,34898,64010,
+36066,37449,39023,23377,31348,34880,38913,23244,20448,21332,22846,23805,25406,
+28025,29433,33029,33031,33698,37583,38960,20136,20804,21009,22411,24418,27842,
+28366,28677,28752,28847,29074,29673,29801,33610,34722,34913,36872,37026,37795,
+39336,20846,24407,24800,24935,26291,34137,36426,37295,38795,20046,20114,21628,
+22741,22778,22909,23733,24359,25142,25160,26122,26215,27627,28009,28111,28246,
+28408,28564,28640,28649,28765,29392,29733,29786,29920,30355,31068,31946,32286,
+32993,33446,33899,33983,34382,34399,34676,35703,35946,37804,38912,39013,24785,
+25110,37239,23130,26127,28151,28222,29759,39746,24573,24794,31503,21700,24344,
+27742,27859,27946,28888,32005,34425,35340,40251,21270,21644,23301,27194,28779,
+30069,31117,31166,33457,33775,35441,35649,36008,38772,64011,25844,25899,30906,
+30907,31339,20024,21914,22864,23462,24187,24739,25563,27489,26213,26707,28185,
+29029,29872,32008,36996,39529,39973,27963,28369,29502,35905,38346,20976,24140,
+24488,24653,24822,24880,24908,26179,26180,27045,27841,28255,28361,28514,29004,
+29852,30343,31681,31783,33618,34647,36945,38541,40643,21295,22238,24315,24458,
+24674,24724,25079,26214,26371,27292,28142,28590,28784,29546,32362,33214,33588,
+34516,35496,36036,21123,29554,23446,27243,37892,21742,22150,23389,25928,25989,
+26313,26783,28045,28102,29243,32948,37237,39501,20399,20505,21402,21518,21564,
+21897,21957,24127,24460,26429,29030,29661,36869,21211,21235,22628,22734,28932,
+29071,29179,34224,35347,26248,34216,21927,26244,29002,33841,21321,21913,27585,
+24409,24509,25582,26249,28999,35569,36637,40638,20241,25658,28875,30054,34407,
+24676,35662,40440,20807,20982,21256,27958,33016,40657,26133,27427,28824,30165,
+21507,23673,32007,35350,27424,27453,27462,21560,24688,27965,32725,33288,20694,
+20958,21916,22123,22221,23020,23305,24076,24985,24984,25137,26206,26342,29081,
+29113,29114,29351,31143,31232,32690,35440,
+};
+
+static const struct dbcs_index ksx1001_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__ksx1001_decmap+0,33,126},{__ksx1001_decmap+
+94,33,103},{__ksx1001_decmap+165,33,126},{__ksx1001_decmap+259,33,126},{
+__ksx1001_decmap+353,33,120},{__ksx1001_decmap+441,33,100},{__ksx1001_decmap+
+509,33,111},{__ksx1001_decmap+588,33,126},{__ksx1001_decmap+682,33,126},{
+__ksx1001_decmap+776,33,115},{__ksx1001_decmap+859,33,118},{__ksx1001_decmap+
+945,33,113},{0,0,0},{0,0,0},{0,0,0},{__ksx1001_decmap+1026,33,126},{
+__ksx1001_decmap+1120,33,126},{__ksx1001_decmap+1214,33,126},{__ksx1001_decmap
++1308,33,126},{__ksx1001_decmap+1402,33,126},{__ksx1001_decmap+1496,33,126},{
+__ksx1001_decmap+1590,33,126},{__ksx1001_decmap+1684,33,126},{__ksx1001_decmap
++1778,33,126},{__ksx1001_decmap+1872,33,126},{__ksx1001_decmap+1966,33,126},{
+__ksx1001_decmap+2060,33,126},{__ksx1001_decmap+2154,33,126},{__ksx1001_decmap
++2248,33,126},{__ksx1001_decmap+2342,33,126},{__ksx1001_decmap+2436,33,126},{
+__ksx1001_decmap+2530,33,126},{__ksx1001_decmap+2624,33,126},{__ksx1001_decmap
++2718,33,126},{__ksx1001_decmap+2812,33,126},{__ksx1001_decmap+2906,33,126},{
+__ksx1001_decmap+3000,33,126},{__ksx1001_decmap+3094,33,126},{__ksx1001_decmap
++3188,33,126},{__ksx1001_decmap+3282,33,126},{0,0,0},{__ksx1001_decmap+3376,
+33,126},{__ksx1001_decmap+3470,33,126},{__ksx1001_decmap+3564,33,126},{
+__ksx1001_decmap+3658,33,126},{__ksx1001_decmap+3752,33,126},{__ksx1001_decmap
++3846,33,126},{__ksx1001_decmap+3940,33,126},{__ksx1001_decmap+4034,33,126},{
+__ksx1001_decmap+4128,33,126},{__ksx1001_decmap+4222,33,126},{__ksx1001_decmap
++4316,33,126},{__ksx1001_decmap+4410,33,126},{__ksx1001_decmap+4504,33,126},{
+__ksx1001_decmap+4598,33,126},{__ksx1001_decmap+4692,33,126},{__ksx1001_decmap
++4786,33,126},{__ksx1001_decmap+4880,33,126},{__ksx1001_decmap+4974,33,126},{
+__ksx1001_decmap+5068,33,126},{__ksx1001_decmap+5162,33,126},{__ksx1001_decmap
++5256,33,126},{__ksx1001_decmap+5350,33,126},{__ksx1001_decmap+5444,33,126},{
+__ksx1001_decmap+5538,33,126},{__ksx1001_decmap+5632,33,126},{__ksx1001_decmap
++5726,33,126},{__ksx1001_decmap+5820,33,126},{__ksx1001_decmap+5914,33,126},{
+__ksx1001_decmap+6008,33,126},{__ksx1001_decmap+6102,33,126},{__ksx1001_decmap
++6196,33,126},{__ksx1001_decmap+6290,33,126},{__ksx1001_decmap+6384,33,126},{
+__ksx1001_decmap+6478,33,126},{__ksx1001_decmap+6572,33,126},{__ksx1001_decmap
++6666,33,126},{__ksx1001_decmap+6760,33,126},{__ksx1001_decmap+6854,33,126},{
+__ksx1001_decmap+6948,33,126},{__ksx1001_decmap+7042,33,126},{__ksx1001_decmap
++7136,33,126},{__ksx1001_decmap+7230,33,126},{__ksx1001_decmap+7324,33,126},{
+__ksx1001_decmap+7418,33,126},{__ksx1001_decmap+7512,33,126},{__ksx1001_decmap
++7606,33,126},{__ksx1001_decmap+7700,33,126},{__ksx1001_decmap+7794,33,126},{
+__ksx1001_decmap+7888,33,126},{__ksx1001_decmap+7982,33,126},{__ksx1001_decmap
++8076,33,126},{__ksx1001_decmap+8170,33,126},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},
+};
+
+static const ucs2_t __cp949ext_decmap[9650] = {
+44034,44035,44037,44038,44043,44044,44045,44046,44047,44056,44062,44063,44065,
+44066,44067,44069,44070,44071,44072,44073,44074,44075,44078,44082,44083,44084,
+U,U,U,U,U,U,44085,44086,44087,44090,44091,44093,44094,44095,44097,44098,44099,
+44100,44101,44102,44103,44104,44105,44106,44108,44110,44111,44112,44113,44114,
+44115,44117,U,U,U,U,U,U,44118,44119,44121,44122,44123,44125,44126,44127,44128,
+44129,44130,44131,44132,44133,44134,44135,44136,44137,44138,44139,44140,44141,
+44142,44143,44146,44147,44149,44150,44153,44155,44156,44157,44158,44159,44162,
+44167,44168,44173,44174,44175,44177,44178,44179,44181,44182,44183,44184,44185,
+44186,44187,44190,44194,44195,44196,44197,44198,44199,44203,44205,44206,44209,
+44210,44211,44212,44213,44214,44215,44218,44222,44223,44224,44226,44227,44229,
+44230,44231,44233,44234,44235,44237,44238,44239,44240,44241,44242,44243,44244,
+44246,44248,44249,44250,44251,44252,44253,44254,44255,44258,44259,44261,44262,
+44265,44267,44269,44270,44274,44276,44279,44280,44281,44282,44283,44286,44287,
+44289,44290,44291,44293,44295,44296,44297,44298,44299,44302,44304,44306,44307,
+44308,44309,44310,44311,44313,44314,44315,44317,44318,44319,44321,44322,44323,
+44324,44325,44326,44327,44328,44330,44331,44334,44335,44336,44337,44338,44339,
+U,U,U,U,U,U,44342,44343,44345,44346,44347,44349,44350,44351,44352,44353,44354,
+44355,44358,44360,44362,44363,44364,44365,44366,44367,44369,44370,44371,44373,
+44374,44375,U,U,U,U,U,U,44377,44378,44379,44380,44381,44382,44383,44384,44386,
+44388,44389,44390,44391,44392,44393,44394,44395,44398,44399,44401,44402,44407,
+44408,44409,44410,44414,44416,44419,44420,44421,44422,44423,44426,44427,44429,
+44430,44431,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,44443,
+44446,44447,44448,44449,44450,44451,44453,44454,44455,44456,44457,44458,44459,
+44460,44461,44462,44463,44464,44465,44466,44467,44468,44469,44470,44472,44473,
+44474,44475,44476,44477,44478,44479,44482,44483,44485,44486,44487,44489,44490,
+44491,44492,44493,44494,44495,44498,44500,44501,44502,44503,44504,44505,44506,
+44507,44509,44510,44511,44513,44514,44515,44517,44518,44519,44520,44521,44522,
+44523,44524,44525,44526,44527,44528,44529,44530,44531,44532,44533,44534,44535,
+44538,44539,44541,44542,44546,44547,44548,44549,44550,44551,44554,44556,44558,
+44559,44560,44561,44562,44563,44565,44566,44567,44568,44569,44570,44571,44572,
+U,U,U,U,U,U,44573,44574,44575,44576,44577,44578,44579,44580,44581,44582,44583,
+44584,44585,44586,44587,44588,44589,44590,44591,44594,44595,44597,44598,44601,
+44603,44604,U,U,U,U,U,U,44605,44606,44607,44610,44612,44615,44616,44617,44619,
+44623,44625,44626,44627,44629,44631,44632,44633,44634,44635,44638,44642,44643,
+44644,44646,44647,44650,44651,44653,44654,44655,44657,44658,44659,44660,44661,
+44662,44663,44666,44670,44671,44672,44673,44674,44675,44678,44679,44680,44681,
+44682,44683,44685,44686,44687,44688,44689,44690,44691,44692,44693,44694,44695,
+44696,44697,44698,44699,44700,44701,44702,44703,44704,44705,44706,44707,44708,
+44709,44710,44711,44712,44713,44714,44715,44716,44717,44718,44719,44720,44721,
+44722,44723,44724,44725,44726,44727,44728,44729,44730,44731,44735,44737,44738,
+44739,44741,44742,44743,44744,44745,44746,44747,44750,44754,44755,44756,44757,
+44758,44759,44762,44763,44765,44766,44767,44768,44769,44770,44771,44772,44773,
+44774,44775,44777,44778,44780,44782,44783,44784,44785,44786,44787,44789,44790,
+44791,44793,44794,44795,44797,44798,44799,44800,44801,44802,44803,44804,44805,
+U,U,U,U,U,U,44806,44809,44810,44811,44812,44814,44815,44817,44818,44819,44820,
+44821,44822,44823,44824,44825,44826,44827,44828,44829,44830,44831,44832,44833,
+44834,44835,U,U,U,U,U,U,44836,44837,44838,44839,44840,44841,44842,44843,44846,
+44847,44849,44851,44853,44854,44855,44856,44857,44858,44859,44862,44864,44868,
+44869,44870,44871,44874,44875,44876,44877,44878,44879,44881,44882,44883,44884,
+44885,44886,44887,44888,44889,44890,44891,44894,44895,44896,44897,44898,44899,
+44902,44903,44904,44905,44906,44907,44908,44909,44910,44911,44912,44913,44914,
+44915,44916,44917,44918,44919,44920,44922,44923,44924,44925,44926,44927,44929,
+44930,44931,44933,44934,44935,44937,44938,44939,44940,44941,44942,44943,44946,
+44947,44948,44950,44951,44952,44953,44954,44955,44957,44958,44959,44960,44961,
+44962,44963,44964,44965,44966,44967,44968,44969,44970,44971,44972,44973,44974,
+44975,44976,44977,44978,44979,44980,44981,44982,44983,44986,44987,44989,44990,
+44991,44993,44994,44995,44996,44997,44998,45002,45004,45007,45008,45009,45010,
+45011,45013,45014,45015,45016,45017,45018,45019,45021,45022,45023,45024,45025,
+U,U,U,U,U,U,45026,45027,45028,45029,45030,45031,45034,45035,45036,45037,45038,
+45039,45042,45043,45045,45046,45047,45049,45050,45051,45052,45053,45054,45055,
+45058,45059,U,U,U,U,U,U,45061,45062,45063,45064,45065,45066,45067,45069,45070,
+45071,45073,45074,45075,45077,45078,45079,45080,45081,45082,45083,45086,45087,
+45088,45089,45090,45091,45092,45093,45094,45095,45097,45098,45099,45100,45101,
+45102,45103,45104,45105,45106,45107,45108,45109,45110,45111,45112,45113,45114,
+45115,45116,45117,45118,45119,45120,45121,45122,45123,45126,45127,45129,45131,
+45133,45135,45136,45137,45138,45142,45144,45146,45147,45148,45150,45151,45152,
+45153,45154,45155,45156,45157,45158,45159,45160,45161,45162,45163,45164,45165,
+45166,45167,45168,45169,45170,45171,45172,45173,45174,45175,45176,45177,45178,
+45179,45182,45183,45185,45186,45187,45189,45190,45191,45192,45193,45194,45195,
+45198,45200,45202,45203,45204,45205,45206,45207,45211,45213,45214,45219,45220,
+45221,45222,45223,45226,45232,45234,45238,45239,45241,45242,45243,45245,45246,
+45247,45248,45249,45250,45251,45254,45258,45259,45260,45261,45262,45263,45266,
+U,U,U,U,U,U,45267,45269,45270,45271,45273,45274,45275,45276,45277,45278,45279,
+45281,45282,45283,45284,45286,45287,45288,45289,45290,45291,45292,45293,45294,
+45295,45296,U,U,U,U,U,U,45297,45298,45299,45300,45301,45302,45303,45304,45305,
+45306,45307,45308,45309,45310,45311,45312,45313,45314,45315,45316,45317,45318,
+45319,45322,45325,45326,45327,45329,45332,45333,45334,45335,45338,45342,45343,
+45344,45345,45346,45350,45351,45353,45354,45355,45357,45358,45359,45360,45361,
+45362,45363,45366,45370,45371,45372,45373,45374,45375,45378,45379,45381,45382,
+45383,45385,45386,45387,45388,45389,45390,45391,45394,45395,45398,45399,45401,
+45402,45403,45405,45406,45407,45409,45410,45411,45412,45413,45414,45415,45416,
+45417,45418,45419,45420,45421,45422,45423,45424,45425,45426,45427,45428,45429,
+45430,45431,45434,45435,45437,45438,45439,45441,45443,45444,45445,45446,45447,
+45450,45452,45454,45455,45456,45457,45461,45462,45463,45465,45466,45467,45469,
+45470,45471,45472,45473,45474,45475,45476,45477,45478,45479,45481,45482,45483,
+45484,45485,45486,45487,45488,45489,45490,45491,45492,45493,45494,45495,45496,
+U,U,U,U,U,U,45497,45498,45499,45500,45501,45502,45503,45504,45505,45506,45507,
+45508,45509,45510,45511,45512,45513,45514,45515,45517,45518,45519,45521,45522,
+45523,45525,U,U,U,U,U,U,45526,45527,45528,45529,45530,45531,45534,45536,45537,
+45538,45539,45540,45541,45542,45543,45546,45547,45549,45550,45551,45553,45554,
+45555,45556,45557,45558,45559,45560,45562,45564,45566,45567,45568,45569,45570,
+45571,45574,45575,45577,45578,45581,45582,45583,45584,45585,45586,45587,45590,
+45592,45594,45595,45596,45597,45598,45599,45601,45602,45603,45604,45605,45606,
+45607,45608,45609,45610,45611,45612,45613,45614,45615,45616,45617,45618,45619,
+45621,45622,45623,45624,45625,45626,45627,45629,45630,45631,45632,45633,45634,
+45635,45636,45637,45638,45639,45640,45641,45642,45643,45644,45645,45646,45647,
+45648,45649,45650,45651,45652,45653,45654,45655,45657,45658,45659,45661,45662,
+45663,45665,45666,45667,45668,45669,45670,45671,45674,45675,45676,45677,45678,
+45679,45680,45681,45682,45683,45686,45687,45688,45689,45690,45691,45693,45694,
+45695,45696,45697,45698,45699,45702,45703,45704,45706,45707,45708,45709,45710,
+U,U,U,U,U,U,45711,45714,45715,45717,45718,45719,45723,45724,45725,45726,45727,
+45730,45732,45735,45736,45737,45739,45741,45742,45743,45745,45746,45747,45749,
+45750,45751,U,U,U,U,U,U,45752,45753,45754,45755,45756,45757,45758,45759,45760,
+45761,45762,45763,45764,45765,45766,45767,45770,45771,45773,45774,45775,45777,
+45779,45780,45781,45782,45783,45786,45788,45790,45791,45792,45793,45795,45799,
+45801,45802,45808,45809,45810,45814,45820,45821,45822,45826,45827,45829,45830,
+45831,45833,45834,45835,45836,45837,45838,45839,45842,45846,45847,45848,45849,
+45850,45851,45853,45854,45855,45856,45857,45858,45859,45860,45861,45862,45863,
+45864,45865,45866,45867,45868,45869,45870,45871,45872,45873,45874,45875,45876,
+45877,45878,45879,45880,45881,45882,45883,45884,45885,45886,45887,45888,45889,
+45890,45891,45892,45893,45894,45895,45896,45897,45898,45899,45900,45901,45902,
+45903,45904,45905,45906,45907,45911,45913,45914,45917,45920,45921,45922,45923,
+45926,45928,45930,45932,45933,45935,45938,45939,45941,45942,45943,45945,45946,
+45947,45948,45949,45950,45951,45954,45958,45959,45960,45961,45962,45963,45965,
+U,U,U,U,U,U,45966,45967,45969,45970,45971,45973,45974,45975,45976,45977,45978,
+45979,45980,45981,45982,45983,45986,45987,45988,45989,45990,45991,45993,45994,
+45995,45997,U,U,U,U,U,U,45998,45999,46000,46001,46002,46003,46004,46005,46006,
+46007,46008,46009,46010,46011,46012,46013,46014,46015,46016,46017,46018,46019,
+46022,46023,46025,46026,46029,46031,46033,46034,46035,46038,46040,46042,46044,
+46046,46047,46049,46050,46051,46053,46054,46055,46057,46058,46059,46060,46061,
+46062,46063,46064,46065,46066,46067,46068,46069,46070,46071,46072,46073,46074,
+46075,46077,46078,46079,46080,46081,46082,46083,46084,46085,46086,46087,46088,
+46089,46090,46091,46092,46093,46094,46095,46097,46098,46099,46100,46101,46102,
+46103,46105,46106,46107,46109,46110,46111,46113,46114,46115,46116,46117,46118,
+46119,46122,46124,46125,46126,46127,46128,46129,46130,46131,46133,46134,46135,
+46136,46137,46138,46139,46140,46141,46142,46143,46144,46145,46146,46147,46148,
+46149,46150,46151,46152,46153,46154,46155,46156,46157,46158,46159,46162,46163,
+46165,46166,46167,46169,46170,46171,46172,46173,46174,46175,46178,46180,46182,
+U,U,U,U,U,U,46183,46184,46185,46186,46187,46189,46190,46191,46192,46193,46194,
+46195,46196,46197,46198,46199,46200,46201,46202,46203,46204,46205,46206,46207,
+46209,46210,U,U,U,U,U,U,46211,46212,46213,46214,46215,46217,46218,46219,46220,
+46221,46222,46223,46224,46225,46226,46227,46228,46229,46230,46231,46232,46233,
+46234,46235,46236,46238,46239,46240,46241,46242,46243,46245,46246,46247,46249,
+46250,46251,46253,46254,46255,46256,46257,46258,46259,46260,46262,46264,46266,
+46267,46268,46269,46270,46271,46273,46274,46275,46277,46278,46279,46281,46282,
+46283,46284,46285,46286,46287,46289,46290,46291,46292,46294,46295,46296,46297,
+46298,46299,46302,46303,46305,46306,46309,46311,46312,46313,46314,46315,46318,
+46320,46322,46323,46324,46325,46326,46327,46329,46330,46331,46332,46333,46334,
+46335,46336,46337,46338,46339,46340,46341,46342,46343,46344,46345,46346,46347,
+46348,46349,46350,46351,46352,46353,46354,46355,46358,46359,46361,46362,46365,
+46366,46367,46368,46369,46370,46371,46374,46379,46380,46381,46382,46383,46386,
+46387,46389,46390,46391,46393,46394,46395,46396,46397,46398,46399,46402,46406,
+U,U,U,U,U,U,46407,46408,46409,46410,46414,46415,46417,46418,46419,46421,46422,
+46423,46424,46425,46426,46427,46430,46434,46435,46436,46437,46438,46439,46440,
+46441,46442,U,U,U,U,U,U,46443,46444,46445,46446,46447,46448,46449,46450,46451,
+46452,46453,46454,46455,46456,46457,46458,46459,46460,46461,46462,46463,46464,
+46465,46466,46467,46468,46469,46470,46471,46472,46473,46474,46475,46476,46477,
+46478,46479,46480,46481,46482,46483,46484,46485,46486,46487,46488,46489,46490,
+46491,46492,46493,46494,46495,46498,46499,46501,46502,46503,46505,46508,46509,
+46510,46511,46514,46518,46519,46520,46521,46522,46526,46527,46529,46530,46531,
+46533,46534,46535,46536,46537,46538,46539,46542,46546,46547,46548,46549,46550,
+46551,46553,46554,46555,46556,46557,46558,46559,46560,46561,46562,46563,46564,
+46565,46566,46567,46568,46569,46570,46571,46573,46574,46575,46576,46577,46578,
+46579,46580,46581,46582,46583,46584,46585,46586,46587,46588,46589,46590,46591,
+46592,46593,46594,46595,46596,46597,46598,46599,46600,46601,46602,46603,46604,
+46605,46606,46607,46610,46611,46613,46614,46615,46617,46618,46619,46620,46621,
+U,U,U,U,U,U,46622,46623,46624,46625,46626,46627,46628,46630,46631,46632,46633,
+46634,46635,46637,46638,46639,46640,46641,46642,46643,46645,46646,46647,46648,
+46649,46650,U,U,U,U,U,U,46651,46652,46653,46654,46655,46656,46657,46658,46659,
+46660,46661,46662,46663,46665,46666,46667,46668,46669,46670,46671,46672,46673,
+46674,46675,46676,46677,46678,46679,46680,46681,46682,46683,46684,46685,46686,
+46687,46688,46689,46690,46691,46693,46694,46695,46697,46698,46699,46700,46701,
+46702,46703,46704,46705,46706,46707,46708,46709,46710,46711,46712,46713,46714,
+46715,46716,46717,46718,46719,46720,46721,46722,46723,46724,46725,46726,46727,
+46728,46729,46730,46731,46732,46733,46734,46735,46736,46737,46738,46739,46740,
+46741,46742,46743,46744,46745,46746,46747,46750,46751,46753,46754,46755,46757,
+46758,46759,46760,46761,46762,46765,46766,46767,46768,46770,46771,46772,46773,
+46774,46775,46776,46777,46778,46779,46780,46781,46782,46783,46784,46785,46786,
+46787,46788,46789,46790,46791,46792,46793,46794,46795,46796,46797,46798,46799,
+46800,46801,46802,46803,46805,46806,46807,46808,46809,46810,46811,46812,46813,
+U,U,U,U,U,U,46814,46815,46816,46817,46818,46819,46820,46821,46822,46823,46824,
+46825,46826,46827,46828,46829,46830,46831,46833,46834,46835,46837,46838,46839,
+46841,46842,U,U,U,U,U,U,46843,46844,46845,46846,46847,46850,46851,46852,46854,
+46855,46856,46857,46858,46859,46860,46861,46862,46863,46864,46865,46866,46867,
+46868,46869,46870,46871,46872,46873,46874,46875,46876,46877,46878,46879,46880,
+46881,46882,46883,46884,46885,46886,46887,46890,46891,46893,46894,46897,46898,
+46899,46900,46901,46902,46903,46906,46908,46909,46910,46911,46912,46913,46914,
+46915,46917,46918,46919,46921,46922,46923,46925,46926,46927,46928,46929,46930,
+46931,46934,46935,46936,46937,46938,46939,46940,46941,46942,46943,46945,46946,
+46947,46949,46950,46951,46953,46954,46955,46956,46957,46958,46959,46962,46964,
+46966,46967,46968,46969,46970,46971,46974,46975,46977,46978,46979,46981,46982,
+46983,46984,46985,46986,46987,46990,46995,46996,46997,47002,47003,47005,47006,
+47007,47009,47010,47011,47012,47013,47014,47015,47018,47022,47023,47024,47025,
+47026,47027,47030,47031,47033,47034,47035,47036,47037,47038,47039,47040,47041,
+U,U,U,U,U,U,47042,47043,47044,47045,47046,47048,47050,47051,47052,47053,47054,
+47055,47056,47057,47058,47059,47060,47061,47062,47063,47064,47065,47066,47067,
+47068,47069,U,U,U,U,U,U,47070,47071,47072,47073,47074,47075,47076,47077,47078,
+47079,47080,47081,47082,47083,47086,47087,47089,47090,47091,47093,47094,47095,
+47096,47097,47098,47099,47102,47106,47107,47108,47109,47110,47114,47115,47117,
+47118,47119,47121,47122,47123,47124,47125,47126,47127,47130,47132,47134,47135,
+47136,47137,47138,47139,47142,47143,47145,47146,47147,47149,47150,47151,47152,
+47153,47154,47155,47158,47162,47163,47164,47165,47166,47167,47169,47170,47171,
+47173,47174,47175,47176,47177,47178,47179,47180,47181,47182,47183,47184,47186,
+47188,47189,47190,47191,47192,47193,47194,47195,47198,47199,47201,47202,47203,
+47205,47206,47207,47208,47209,47210,47211,47214,47216,47218,47219,47220,47221,
+47222,47223,47225,47226,47227,47229,47230,47231,47232,47233,47234,47235,47236,
+47237,47238,47239,47240,47241,47242,47243,47244,47246,47247,47248,47249,47250,
+47251,47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,
+U,U,U,U,U,U,47264,47265,47266,47267,47268,47269,47270,47271,47273,47274,47275,
+47276,47277,47278,47279,47281,47282,47283,47285,47286,47287,47289,47290,47291,
+47292,47293,U,U,U,U,U,U,47294,47295,47298,47300,47302,47303,47304,47305,47306,
+47307,47309,47310,47311,47313,47314,47315,47317,47318,47319,47320,47321,47322,
+47323,47324,47326,47328,47330,47331,47332,47333,47334,47335,47338,47339,47341,
+47342,47343,47345,47346,47347,47348,47349,47350,47351,47354,47356,47358,47359,
+47360,47361,47362,47363,47365,47366,47367,47368,47369,47370,47371,47372,47373,
+47374,47375,47376,47377,47378,47379,47380,47381,47382,47383,47385,47386,47387,
+47388,47389,47390,47391,47393,47394,47395,47396,47397,47398,47399,47400,47401,
+47402,47403,47404,47405,47406,47407,47408,47409,47410,47411,47412,47413,47414,
+47415,47416,47417,47418,47419,47422,47423,47425,47426,47427,47429,47430,47431,
+47432,47433,47434,47435,47437,47438,47440,47442,47443,47444,47445,47446,47447,
+47450,47451,47453,47454,47455,47457,47458,47459,47460,47461,47462,47463,47466,
+47468,47470,47471,47472,47473,47474,47475,47478,47479,47481,47482,47483,47485,
+U,U,U,U,U,U,47486,47487,47488,47489,47490,47491,47494,47496,47499,47500,47503,
+47504,47505,47506,47507,47508,47509,47510,47511,47512,47513,47514,47515,47516,
+47517,47518,U,U,U,U,U,U,47519,47520,47521,47522,47523,47524,47525,47526,47527,
+47528,47529,47530,47531,47534,47535,47537,47538,47539,47541,47542,47543,47544,
+47545,47546,47547,47550,47552,47554,47555,47556,47557,47558,47559,47562,47563,
+47565,47571,47572,47573,47574,47575,47578,47580,47583,47584,47586,47590,47591,
+47593,47594,47595,47597,47598,47599,47600,47601,47602,47603,47606,47611,47612,
+47613,47614,47615,47618,47619,47620,47621,47622,47623,47625,47626,47627,47628,
+47629,47630,47631,47632,47633,47634,47635,47636,47638,47639,47640,47641,47642,
+47643,47644,47645,47646,47647,47648,47649,47650,47651,47652,47653,47654,47655,
+47656,47657,47658,47659,47660,47661,47662,47663,47664,47665,47666,47667,47668,
+47669,47670,47671,47674,47675,47677,47678,47679,47681,47683,47684,47685,47686,
+47687,47690,47692,47695,47696,47697,47698,47702,47703,47705,47706,47707,47709,
+47710,47711,47712,47713,47714,47715,47718,47722,47723,47724,47725,47726,47727,
+U,U,U,U,U,U,47730,47731,47733,47734,47735,47737,47738,47739,47740,47741,47742,
+47743,47744,47745,47746,47750,47752,47753,47754,47755,47757,47758,47759,47760,
+47761,47762,U,U,U,U,U,U,47763,47764,47765,47766,47767,47768,47769,47770,47771,
+47772,47773,47774,47775,47776,47777,47778,47779,47780,47781,47782,47783,47786,
+47789,47790,47791,47793,47795,47796,47797,47798,47799,47802,47804,47806,47807,
+47808,47809,47810,47811,47813,47814,47815,47817,47818,47819,47820,47821,47822,
+47823,47824,47825,47826,47827,47828,47829,47830,47831,47834,47835,47836,47837,
+47838,47839,47840,47841,47842,47843,47844,47845,47846,47847,47848,47849,47850,
+47851,47852,47853,47854,47855,47856,47857,47858,47859,47860,47861,47862,47863,
+47864,47865,47866,47867,47869,47870,47871,47873,47874,47875,47877,47878,47879,
+47880,47881,47882,47883,47884,47886,47888,47890,47891,47892,47893,47894,47895,
+47897,47898,47899,47901,47902,47903,47905,47906,47907,47908,47909,47910,47911,
+47912,47914,47916,47917,47918,47919,47920,47921,47922,47923,47927,47929,47930,
+47935,47936,47937,47938,47939,47942,47944,47946,47947,47948,47950,47953,47954,
+U,U,U,U,U,U,47955,47957,47958,47959,47961,47962,47963,47964,47965,47966,47967,
+47968,47970,47972,47973,47974,47975,47976,47977,47978,47979,47981,47982,47983,
+47984,47985,U,U,U,U,U,U,47986,47987,47988,47989,47990,47991,47992,47993,47994,
+47995,47996,47997,47998,47999,48000,48001,48002,48003,48004,48005,48006,48007,
+48009,48010,48011,48013,48014,48015,48017,48018,48019,48020,48021,48022,48023,
+48024,48025,48026,48027,48028,48029,48030,48031,48032,48033,48034,48035,48037,
+48038,48039,48041,48042,48043,48045,48046,48047,48048,48049,48050,48051,48053,
+48054,48056,48057,48058,48059,48060,48061,48062,48063,48065,48066,48067,48069,
+48070,48071,48073,48074,48075,48076,48077,48078,48079,48081,48082,48084,48085,
+48086,48087,48088,48089,48090,48091,48092,48093,48094,48095,48096,48097,48098,
+48099,48100,48101,48102,48103,48104,48105,48106,48107,48108,48109,48110,48111,
+48112,48113,48114,48115,48116,48117,48118,48119,48122,48123,48125,48126,48129,
+48131,48132,48133,48134,48135,48138,48142,48144,48146,48147,48153,48154,48160,
+48161,48162,48163,48166,48168,48170,48171,48172,48174,48175,48178,48179,48181,
+U,U,U,U,U,U,48182,48183,48185,48186,48187,48188,48189,48190,48191,48194,48198,
+48199,48200,48202,48203,48206,48207,48209,48210,48211,48212,48213,48214,48215,
+48216,48217,U,U,U,U,U,U,48218,48219,48220,48222,48223,48224,48225,48226,48227,
+48228,48229,48230,48231,48232,48233,48234,48235,48236,48237,48238,48239,48240,
+48241,48242,48243,48244,48245,48246,48247,48248,48249,48250,48251,48252,48253,
+48254,48255,48256,48257,48258,48259,48262,48263,48265,48266,48269,48271,48272,
+48273,48274,48275,48278,48280,48283,48284,48285,48286,48287,48290,48291,48293,
+48294,48297,48298,48299,48300,48301,48302,48303,48306,48310,48311,48312,48313,
+48314,48315,48318,48319,48321,48322,48323,48325,48326,48327,48328,48329,48330,
+48331,48332,48334,48338,48339,48340,48342,48343,48345,48346,48347,48349,48350,
+48351,48352,48353,48354,48355,48356,48357,48358,48359,48360,48361,48362,48363,
+48364,48365,48366,48367,48368,48369,48370,48371,48375,48377,48378,48379,48381,
+48382,48383,48384,48385,48386,48387,48390,48392,48394,48395,48396,48397,48398,
+48399,48401,48402,48403,48405,48406,48407,48408,48409,48410,48411,48412,48413,
+U,U,U,U,U,U,48414,48415,48416,48417,48418,48419,48421,48422,48423,48424,48425,
+48426,48427,48429,48430,48431,48432,48433,48434,48435,48436,48437,48438,48439,
+48440,48441,U,U,U,U,U,U,48442,48443,48444,48445,48446,48447,48449,48450,48451,
+48452,48453,48454,48455,48458,48459,48461,48462,48463,48465,48466,48467,48468,
+48469,48470,48471,48474,48475,48476,48477,48478,48479,48480,48481,48482,48483,
+48485,48486,48487,48489,48490,48491,48492,48493,48494,48495,48496,48497,48498,
+48499,48500,48501,48502,48503,48504,48505,48506,48507,48508,48509,48510,48511,
+48514,48515,48517,48518,48523,48524,48525,48526,48527,48530,48532,48534,48535,
+48536,48539,48541,48542,48543,48544,48545,48546,48547,48549,48550,48551,48552,
+48553,48554,48555,48556,48557,48558,48559,48561,48562,48563,48564,48565,48566,
+48567,48569,48570,48571,48572,48573,48574,48575,48576,48577,48578,48579,48580,
+48581,48582,48583,48584,48585,48586,48587,48588,48589,48590,48591,48592,48593,
+48594,48595,48598,48599,48601,48602,48603,48605,48606,48607,48608,48609,48610,
+48611,48612,48613,48614,48615,48616,48618,48619,48620,48621,48622,48623,48625,
+U,U,U,U,U,U,48626,48627,48629,48630,48631,48633,48634,48635,48636,48637,48638,
+48639,48641,48642,48644,48646,48647,48648,48649,48650,48651,48654,48655,48657,
+48658,48659,U,U,U,U,U,U,48661,48662,48663,48664,48665,48666,48667,48670,48672,
+48673,48674,48675,48676,48677,48678,48679,48680,48681,48682,48683,48684,48685,
+48686,48687,48688,48689,48690,48691,48692,48693,48694,48695,48696,48697,48698,
+48699,48700,48701,48702,48703,48704,48705,48706,48707,48710,48711,48713,48714,
+48715,48717,48719,48720,48721,48722,48723,48726,48728,48732,48733,48734,48735,
+48738,48739,48741,48742,48743,48745,48747,48748,48749,48750,48751,48754,48758,
+48759,48760,48761,48762,48766,48767,48769,48770,48771,48773,48774,48775,48776,
+48777,48778,48779,48782,48786,48787,48788,48789,48790,48791,48794,48795,48796,
+48797,48798,48799,48800,48801,48802,48803,48804,48805,48806,48807,48809,48810,
+48811,48812,48813,48814,48815,48816,48817,48818,48819,48820,48821,48822,48823,
+48824,48825,48826,48827,48828,48829,48830,48831,48832,48833,48834,48835,48836,
+48837,48838,48839,48840,48841,48842,48843,48844,48845,48846,48847,48850,48851,
+U,U,U,U,U,U,48853,48854,48857,48858,48859,48860,48861,48862,48863,48865,48866,
+48870,48871,48872,48873,48874,48875,48877,48878,48879,48880,48881,48882,48883,
+48884,48885,U,U,U,U,U,U,48886,48887,48888,48889,48890,48891,48892,48893,48894,
+48895,48896,48898,48899,48900,48901,48902,48903,48906,48907,48908,48909,48910,
+48911,48912,48913,48914,48915,48916,48917,48918,48919,48922,48926,48927,48928,
+48929,48930,48931,48932,48933,48934,48935,48936,48937,48938,48939,48940,48941,
+48942,48943,48944,48945,48946,48947,48948,48949,48950,48951,48952,48953,48954,
+48955,48956,48957,48958,48959,48962,48963,48965,48966,48967,48969,48970,48971,
+48972,48973,48974,48975,48978,48979,48980,48982,48983,48984,48985,48986,48987,
+48988,48989,48990,48991,48992,48993,48994,48995,48996,48997,48998,48999,49000,
+49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,49012,49013,
+49014,49015,49016,49017,49018,49019,49020,49021,49022,49023,49024,49025,49026,
+49027,49028,49029,49030,49031,49032,49033,49034,49035,49036,49037,49038,49039,
+49040,49041,49042,49043,49045,49046,49047,49048,49049,49050,49051,49052,49053,
+U,U,U,U,U,U,49054,49055,49056,49057,49058,49059,49060,49061,49062,49063,49064,
+49065,49066,49067,49068,49069,49070,49071,49073,49074,49075,49076,49077,49078,
+49079,49080,U,U,U,U,U,U,49081,49082,49083,49084,49085,49086,49087,49088,49089,
+49090,49091,49092,49094,49095,49096,49097,49098,49099,49102,49103,49105,49106,
+49107,49109,49110,49111,49112,49113,49114,49115,49117,49118,49120,49122,49123,
+49124,49125,49126,49127,49128,49129,49130,49131,49132,49133,49134,49135,49136,
+49137,49138,49139,49140,49141,49142,49143,49144,49145,49146,49147,49148,49149,
+49150,49151,49152,49153,49154,49155,49156,49157,49158,49159,49160,49161,49162,
+49163,49164,49165,49166,49167,49168,49169,49170,49171,49172,49173,49174,49175,
+49176,49177,49178,49179,49180,49181,49182,49183,49184,49185,49186,49187,49188,
+49189,49190,49191,49192,49193,49194,49195,49196,49197,49198,49199,49200,49201,
+49202,49203,49204,49205,49206,49207,49208,49209,49210,49211,49213,49214,49215,
+49216,49217,49218,49219,49220,49221,49222,49223,49224,49225,49226,49227,49228,
+49229,49230,49231,49232,49234,49235,49236,49237,49238,49239,49241,49242,49243,
+U,U,U,U,U,U,49245,49246,49247,49249,49250,49251,49252,49253,49254,49255,49258,
+49259,49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,
+49272,49273,U,U,U,U,U,U,49274,49275,49276,49277,49278,49279,49280,49281,49282,
+49283,49284,49285,49286,49287,49288,49289,49290,49291,49292,49293,49294,49295,
+49298,49299,49301,49302,49303,49305,49306,49307,49308,49309,49310,49311,49314,
+49316,49318,49319,49320,49321,49322,49323,49326,49329,49330,49335,49336,49337,
+49338,49339,49342,49346,49347,49348,49350,49351,49354,49355,49357,49358,49359,
+49361,49362,49363,49364,49365,49366,49367,49370,49374,49375,49376,49377,49378,
+49379,49382,49383,49385,49386,49387,49389,49390,49391,49392,49393,49394,49395,
+49398,49400,49402,49403,49404,49405,49406,49407,49409,49410,49411,49413,49414,
+49415,49417,49418,49419,49420,49421,49422,49423,49425,49426,49427,49428,49430,
+49431,49432,49433,49434,49435,49441,49442,49445,49448,49449,49450,49451,49454,
+49458,49459,49460,49461,49463,49466,49467,49469,49470,49471,49473,49474,49475,
+49476,49477,49478,49479,49482,49486,49487,49488,49489,49490,49491,49494,49495,
+U,U,U,U,U,U,49497,49498,49499,49501,49502,49503,49504,49505,49506,49507,49510,
+49514,49515,49516,49517,49518,49519,49521,49522,49523,49525,49526,49527,49529,
+49530,49531,U,U,U,U,U,U,49532,49533,49534,49535,49536,49537,49538,49539,49540,
+49542,49543,49544,49545,49546,49547,49551,49553,49554,49555,49557,49559,49560,
+49561,49562,49563,49566,49568,49570,49571,49572,49574,49575,49578,49579,49581,
+49582,49583,49585,49586,49587,49588,49589,49590,49591,49592,49593,49594,49595,
+49596,49598,49599,49600,49601,49602,49603,49605,49606,49607,49609,49610,49611,
+49613,49614,49615,49616,49617,49618,49619,49621,49622,49625,49626,49627,49628,
+49629,49630,49631,49633,49634,49635,49637,49638,49639,49641,49642,49643,49644,
+49645,49646,49647,49650,49652,49653,49654,49655,49656,49657,49658,49659,49662,
+49663,49665,49666,49667,49669,49670,49671,49672,49673,49674,49675,49678,49680,
+49682,49683,49684,49685,49686,49687,49690,49691,49693,49694,49697,49698,49699,
+49700,49701,49702,49703,49706,49708,49710,49712,49715,49717,49718,49719,49720,
+49721,49722,49723,49724,49725,49726,49727,49728,49729,49730,49731,49732,49733,
+U,U,U,U,U,U,49734,49735,49737,49738,49739,49740,49741,49742,49743,49746,49747,
+49749,49750,49751,49753,49754,49755,49756,49757,49758,49759,49761,49762,49763,
+49764,49766,U,U,U,U,U,U,49767,49768,49769,49770,49771,49774,49775,49777,49778,
+49779,49781,49782,49783,49784,49785,49786,49787,49790,49792,49794,49795,49796,
+49797,49798,49799,49802,49803,49804,49805,49806,49807,49809,49810,49811,49812,
+49813,49814,49815,49817,49818,49820,49822,49823,49824,49825,49826,49827,49830,
+49831,49833,49834,49835,49838,49839,49840,49841,49842,49843,49846,49848,49850,
+49851,49852,49853,49854,49855,49856,49857,49858,49859,49860,49861,49862,49863,
+49864,49865,49866,49867,49868,49869,49870,49871,49872,49873,49874,49875,49876,
+49877,49878,49879,49880,49881,49882,49883,49886,49887,49889,49890,49893,49894,
+49895,49896,49897,49898,49902,49904,49906,49907,49908,49909,49911,49914,49917,
+49918,49919,49921,49922,49923,49924,49925,49926,49927,49930,49931,49934,49935,
+49936,49937,49938,49942,49943,49945,49946,49947,49949,49950,49951,49952,49953,
+49954,49955,49958,49959,49962,49963,49964,49965,49966,49967,49968,49969,49970,
+U,U,U,U,U,U,49971,49972,49973,49974,49975,49976,49977,49978,49979,49980,49981,
+49982,49983,49984,49985,49986,49987,49988,49990,49991,49992,49993,49994,49995,
+49996,49997,U,U,U,U,U,U,49998,49999,50000,50001,50002,50003,50004,50005,50006,
+50007,50008,50009,50010,50011,50012,50013,50014,50015,50016,50017,50018,50019,
+50020,50021,50022,50023,50026,50027,50029,50030,50031,50033,50035,50036,50037,
+50038,50039,50042,50043,50046,50047,50048,50049,50050,50051,50053,50054,50055,
+50057,50058,50059,50061,50062,50063,50064,50065,50066,50067,50068,50069,50070,
+50071,50072,50073,50074,50075,50076,50077,50078,50079,50080,50081,50082,50083,
+50084,50085,50086,50087,50088,50089,50090,50091,50092,50093,50094,50095,50096,
+50097,50098,50099,50100,50101,50102,50103,50104,50105,50106,50107,50108,50109,
+50110,50111,50113,50114,50115,50116,50117,50118,50119,50120,50121,50122,50123,
+50124,50125,50126,50127,50128,50129,50130,50131,50132,50133,50134,50135,50138,
+50139,50141,50142,50145,50147,50148,50149,50150,50151,50154,50155,50156,50158,
+50159,50160,50161,50162,50163,50166,50167,50169,50170,50171,50172,50173,50174,
+U,U,U,U,U,U,50175,50176,50177,50178,50179,50180,50181,50182,50183,50185,50186,
+50187,50188,50189,50190,50191,50193,50194,50195,50196,50197,50198,50199,50200,
+50201,50202,U,U,U,U,U,U,50203,50204,50205,50206,50207,50208,50209,50210,50211,
+50213,50214,50215,50216,50217,50218,50219,50221,50222,50223,50225,50226,50227,
+50229,50230,50231,50232,50233,50234,50235,50238,50239,50240,50241,50242,50243,
+50244,50245,50246,50247,50249,50250,50251,50252,50253,50254,50255,50256,50257,
+50258,50259,50260,50261,50262,50263,50264,50265,50266,50267,50268,50269,50270,
+50271,50272,50273,50274,50275,50278,50279,50281,50282,50283,50285,50286,50287,
+50288,50289,50290,50291,50294,50295,50296,50298,50299,50300,50301,50302,50303,
+50305,50306,50307,50308,50309,50310,50311,50312,50313,50314,50315,50316,50317,
+50318,50319,50320,50321,50322,50323,50325,50326,50327,50328,50329,50330,50331,
+50333,50334,50335,50336,50337,50338,50339,50340,50341,50342,50343,50344,50345,
+50346,50347,50348,50349,50350,50351,50352,50353,50354,50355,50356,50357,50358,
+50359,50361,50362,50363,50365,50366,50367,50368,50369,50370,50371,50372,50373,
+U,U,U,U,U,U,50374,50375,50376,50377,50378,50379,50380,50381,50382,50383,50384,
+50385,50386,50387,50388,50389,50390,50391,50392,50393,50394,50395,50396,50397,
+50398,50399,U,U,U,U,U,U,50400,50401,50402,50403,50404,50405,50406,50407,50408,
+50410,50411,50412,50413,50414,50415,50418,50419,50421,50422,50423,50425,50427,
+50428,50429,50430,50434,50435,50436,50437,50438,50439,50440,50441,50442,50443,
+50445,50446,50447,50449,50450,50451,50453,50454,50455,50456,50457,50458,50459,
+50461,50462,50463,50464,50465,50466,50467,50468,50469,50470,50471,50474,50475,
+50477,50478,50479,50481,50482,50483,50484,50485,50486,50487,50490,50492,50494,
+50495,50496,50497,50498,50499,50502,50503,50507,50511,50512,50513,50514,50518,
+50522,50523,50524,50527,50530,50531,50533,50534,50535,50537,50538,50539,50540,
+50541,50542,50543,50546,50550,50551,50552,50553,50554,50555,50558,50559,50561,
+50562,50563,50565,50566,50568,50569,50570,50571,50574,50576,50578,50579,50580,
+50582,50585,50586,50587,50589,50590,50591,50593,50594,50595,50596,50597,50598,
+50599,50600,50602,50603,50604,50605,50606,50607,50608,50609,50610,50611,50614,
+U,U,U,U,U,U,50615,50618,50623,50624,50625,50626,50627,50635,50637,50639,50642,
+50643,50645,50646,50647,50649,50650,50651,50652,50653,50654,50655,50658,50660,
+50662,50663,U,U,U,U,U,U,50664,50665,50666,50667,50671,50673,50674,50675,50677,
+50680,50681,50682,50683,50690,50691,50692,50697,50698,50699,50701,50702,50703,
+50705,50706,50707,50708,50709,50710,50711,50714,50717,50718,50719,50720,50721,
+50722,50723,50726,50727,50729,50730,50731,50735,50737,50738,50742,50744,50746,
+50748,50749,50750,50751,50754,50755,50757,50758,50759,50761,50762,50763,50764,
+50765,50766,50767,50770,50774,50775,50776,50777,50778,50779,50782,50783,50785,
+50786,50787,50788,50789,50790,50791,50792,50793,50794,50795,50797,50798,50800,
+50802,50803,50804,50805,50806,50807,50810,50811,50813,50814,50815,50817,50818,
+50819,50820,50821,50822,50823,50826,50828,50830,50831,50832,50833,50834,50835,
+50838,50839,50841,50842,50843,50845,50846,50847,50848,50849,50850,50851,50854,
+50856,50858,50859,50860,50861,50862,50863,50866,50867,50869,50870,50871,50875,
+50876,50877,50878,50879,50882,50884,50886,50887,50888,50889,50890,50891,50894,
+U,U,U,U,U,U,50895,50897,50898,50899,50901,50902,50903,50904,50905,50906,50907,
+50910,50911,50914,50915,50916,50917,50918,50919,50922,50923,50925,50926,50927,
+50929,50930,U,U,U,U,U,U,50931,50932,50933,50934,50935,50938,50939,50940,50942,
+50943,50944,50945,50946,50947,50950,50951,50953,50954,50955,50957,50958,50959,
+50960,50961,50962,50963,50966,50968,50970,50971,50972,50973,50974,50975,50978,
+50979,50981,50982,50983,50985,50986,50987,50988,50989,50990,50991,50994,50996,
+50998,51000,51001,51002,51003,51006,51007,51009,51010,51011,51013,51014,51015,
+51016,51017,51019,51022,51024,51033,51034,51035,51037,51038,51039,51041,51042,
+51043,51044,51045,51046,51047,51049,51050,51052,51053,51054,51055,51056,51057,
+51058,51059,51062,51063,51065,51066,51067,51071,51072,51073,51074,51078,51083,
+51084,51085,51087,51090,51091,51093,51097,51099,51100,51101,51102,51103,51106,
+51111,51112,51113,51114,51115,51118,51119,51121,51122,51123,51125,51126,51127,
+51128,51129,51130,51131,51134,51138,51139,51140,51141,51142,51143,51146,51147,
+51149,51151,51153,51154,51155,51156,51157,51158,51159,51161,51162,51163,51164,
+U,U,U,U,U,U,51166,51167,51168,51169,51170,51171,51173,51174,51175,51177,51178,
+51179,51181,51182,51183,51184,51185,51186,51187,51188,51189,51190,51191,51192,
+51193,51194,U,U,U,U,U,U,51195,51196,51197,51198,51199,51202,51203,51205,51206,
+51207,51209,51211,51212,51213,51214,51215,51218,51220,51223,51224,51225,51226,
+51227,51230,51231,51233,51234,51235,51237,51238,51239,51240,51241,51242,51243,
+51246,51248,51250,51251,51252,51253,51254,51255,51257,51258,51259,51261,51262,
+51263,51265,51266,51267,51268,51269,51270,51271,51274,51275,51278,51279,51280,
+51281,51282,51283,51285,51286,51287,51288,51289,51290,51291,51292,51293,51294,
+51295,51296,51297,51298,51299,51300,51301,51302,51303,51304,51305,51306,51307,
+51308,51309,51310,51311,51314,51315,51317,51318,51319,51321,51323,51324,51325,
+51326,51327,51330,51332,51336,51337,51338,51342,51343,51344,51345,51346,51347,
+51349,51350,51351,51352,51353,51354,51355,51356,51358,51360,51362,51363,51364,
+51365,51366,51367,51369,51370,51371,51372,51373,51374,51375,51376,51377,51378,
+51379,51380,51381,51382,51383,51384,51385,51386,51387,51390,51391,51392,51393,
+U,U,U,U,U,U,51394,51395,51397,51398,51399,51401,51402,51403,51405,51406,51407,
+51408,51409,51410,51411,51414,51416,51418,51419,51420,51421,51422,51423,51426,
+51427,51429,U,U,U,U,U,U,51430,51431,51432,51433,51434,51435,51436,51437,51438,
+51439,51440,51441,51442,51443,51444,51446,51447,51448,51449,51450,51451,51454,
+51455,51457,51458,51459,51463,51464,51465,51466,51467,51470,51472,51474,51475,
+51476,51477,51478,51479,51481,51482,51483,51484,51485,51486,51487,51488,51489,
+51490,51491,51492,51493,51494,51495,51496,51497,51498,51499,U,U,U,U,U,U,51501,
+51502,51503,51504,51505,51506,51507,51509,51510,51511,51512,51513,51514,51515,
+51516,51517,51518,51519,51520,51521,51522,51523,51524,51525,51526,51527,U,U,U,
+U,U,U,51528,51529,51530,51531,51532,51533,51534,51535,51538,51539,51541,51542,
+51543,51545,51546,51547,51548,51549,51550,51551,51554,51556,51557,51558,51559,
+51560,51561,51562,51563,51565,51566,51567,51569,51570,51571,51573,51574,51575,
+51576,51577,51578,51579,51581,51582,51583,51584,51585,51586,51587,51588,51589,
+51590,51591,51594,51595,51597,51598,51599,U,U,U,U,U,U,51601,51602,51603,51604,
+51605,51606,51607,51610,51612,51614,51615,51616,51617,51618,51619,51620,51621,
+51622,51623,51624,51625,51626,51627,51628,51629,51630,U,U,U,U,U,U,51631,51632,
+51633,51634,51635,51636,51637,51638,51639,51640,51641,51642,51643,51644,51645,
+51646,51647,51650,51651,51653,51654,51657,51659,51660,51661,51662,51663,51666,
+51668,51671,51672,51675,51678,51679,51681,51683,51685,51686,51688,51689,51690,
+51691,51694,51698,51699,51700,51701,51702,51703,51706,51707,51709,51710,51711,
+51713,51714,51715,51716,U,U,U,U,U,U,51717,51718,51719,51722,51726,51727,51728,
+51729,51730,51731,51733,51734,51735,51737,51738,51739,51740,51741,51742,51743,
+51744,51745,51746,51747,51748,51749,U,U,U,U,U,U,51750,51751,51752,51754,51755,
+51756,51757,51758,51759,51760,51761,51762,51763,51764,51765,51766,51767,51768,
+51769,51770,51771,51772,51773,51774,51775,51776,51777,51778,51779,51780,51781,
+51782,51783,51784,51785,51786,51787,51790,51791,51793,51794,51795,51797,51798,
+51799,51800,51801,51802,51803,51806,51810,51811,51812,51813,51814,51815,51817,
+51818,U,U,U,U,U,U,51819,51820,51821,51822,51823,51824,51825,51826,51827,51828,
+51829,51830,51831,51832,51833,51834,51835,51836,51838,51839,51840,51841,51842,
+51843,51845,51846,U,U,U,U,U,U,51847,51848,51849,51850,51851,51852,51853,51854,
+51855,51856,51857,51858,51859,51860,51861,51862,51863,51865,51866,51867,51868,
+51869,51870,51871,51872,51873,51874,51875,51876,51877,51878,51879,51880,51881,
+51882,51883,51884,51885,51886,51887,51888,51889,51890,51891,51892,51893,51894,
+51895,51896,51897,51898,51899,51902,51903,51905,51906,51907,51909,U,U,U,U,U,U,
+51910,51911,51912,51913,51914,51915,51918,51920,51922,51924,51925,51926,51927,
+51930,51931,51932,51933,51934,51935,51937,51938,51939,51940,51941,51942,51943,
+U,U,U,U,U,U,51944,51945,51946,51947,51949,51950,51951,51952,51953,51954,51955,
+51957,51958,51959,51960,51961,51962,51963,51964,51965,51966,51967,51968,51969,
+51970,51971,51972,51973,51974,51975,51977,51978,51979,51980,51981,51982,51983,
+51985,51986,51987,51989,51990,51991,51993,51994,51995,51996,51997,51998,51999,
+52002,52003,52004,52005,52006,52007,52008,52009,U,U,U,U,U,U,52010,52011,52012,
+52013,52014,52015,52016,52017,52018,52019,52020,52021,52022,52023,52024,52025,
+52026,52027,52028,52029,52030,52031,52032,52034,52035,52036,U,U,U,U,U,U,52037,
+52038,52039,52042,52043,52045,52046,52047,52049,52050,52051,52052,52053,52054,
+52055,52058,52059,52060,52062,52063,52064,52065,52066,52067,52069,52070,52071,
+52072,52073,52074,52075,52076,52077,52078,52079,52080,52081,52082,52083,52084,
+52085,52086,52087,52090,52091,52092,52093,52094,52095,52096,52097,52098,52099,
+52100,52101,52102,52103,52104,U,U,U,U,U,U,52105,52106,52107,52108,52109,52110,
+52111,52112,52113,52114,52115,52116,52117,52118,52119,52120,52121,52122,52123,
+52125,52126,52127,52128,52129,52130,52131,U,U,U,U,U,U,52132,52133,52134,52135,
+52136,52137,52138,52139,52140,52141,52142,52143,52144,52145,52146,52147,52148,
+52149,52150,52151,52153,52154,52155,52156,52157,52158,52159,52160,52161,52162,
+52163,52164,52165,52166,52167,52168,52169,52170,52171,52172,52173,52174,52175,
+52176,52177,52178,52179,52181,52182,52183,52184,52185,52186,52187,52188,52189,
+52190,52191,U,U,U,U,U,U,52192,52193,52194,52195,52197,52198,52200,52202,52203,
+52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,
+52217,52218,52219,52220,U,U,U,U,U,U,52221,52222,52223,52224,52225,52226,52227,
+52228,52229,52230,52231,52232,52233,52234,52235,52238,52239,52241,52242,52243,
+52245,52246,52247,52248,52249,52250,52251,52254,52255,52256,52259,52260,52261,
+52262,52266,52267,52269,52271,52273,52274,52275,52276,52277,52278,52279,52282,
+52287,52288,52289,52290,52291,52294,52295,52297,52298,52299,52301,52302,U,U,U,
+U,U,U,52303,52304,52305,52306,52307,52310,52314,52315,52316,52317,52318,52319,
+52321,52322,52323,52325,52327,52329,52330,52331,52332,52333,52334,52335,52337,
+52338,U,U,U,U,U,U,52339,52340,52342,52343,52344,52345,52346,52347,52348,52349,
+52350,52351,52352,52353,52354,52355,52356,52357,52358,52359,52360,52361,52362,
+52363,52364,52365,52366,52367,52368,52369,52370,52371,52372,52373,52374,52375,
+52378,52379,52381,52382,52383,52385,52386,52387,52388,52389,52390,52391,52394,
+52398,52399,52400,52401,52402,52403,52406,52407,52409,U,U,U,U,U,U,52410,52411,
+52413,52414,52415,52416,52417,52418,52419,52422,52424,52426,52427,52428,52429,
+52430,52431,52433,52434,52435,52437,52438,52439,52440,52441,52442,U,U,U,U,U,U,
+52443,52444,52445,52446,52447,52448,52449,52450,52451,52453,52454,52455,52456,
+52457,52458,52459,52461,52462,52463,52465,52466,52467,52468,52469,52470,52471,
+52472,52473,52474,52475,52476,52477,52478,52479,52480,52482,52483,52484,52485,
+52486,52487,52490,52491,52493,52494,52495,52497,52498,52499,52500,52501,52502,
+52503,52506,52508,52510,52511,52512,U,U,U,U,U,U,52513,52514,52515,52517,52518,
+52519,52521,52522,52523,52525,52526,52527,52528,52529,52530,52531,52532,52533,
+52534,52535,52536,52538,52539,52540,52541,52542,U,U,U,U,U,U,52543,52544,52545,
+52546,52547,52548,52549,52550,52551,52552,52553,52554,52555,52556,52557,52558,
+52559,52560,52561,52562,52563,52564,52565,52566,52567,52568,52569,52570,52571,
+52573,52574,52575,52577,52578,52579,52581,52582,52583,52584,52585,52586,52587,
+52590,52592,52594,52595,52596,52597,52598,52599,52601,52602,52603,52604,52605,
+52606,52607,52608,U,U,U,U,U,U,52609,52610,52611,52612,52613,52614,52615,52617,
+52618,52619,52620,52621,52622,52623,52624,52625,52626,52627,52630,52631,52633,
+52634,52635,52637,52638,52639,U,U,U,U,U,U,52640,52641,52642,52643,52646,52648,
+52650,52651,52652,52653,52654,52655,52657,52658,52659,52660,52661,52662,52663,
+52664,52665,52666,52667,52668,52669,52670,52671,52672,52673,52674,52675,52677,
+52678,52679,52680,52681,52682,52683,52685,52686,52687,52689,52690,52691,52692,
+52693,52694,52695,52696,52697,52698,52699,52700,52701,52702,52703,52704,52705,
+U,U,U,U,U,U,52706,52707,52708,52709,52710,52711,52713,52714,52715,52717,52718,
+52719,52721,52722,52723,52724,52725,52726,52727,52730,52732,52734,52735,52736,
+52737,52738,U,U,U,U,U,U,52739,52741,52742,52743,52745,52746,52747,52749,52750,
+52751,52752,52753,52754,52755,52757,52758,52759,52760,52762,52763,52764,52765,
+52766,52767,52770,52771,52773,52774,52775,52777,52778,52779,52780,52781,52782,
+52783,52786,52788,52790,52791,52792,52793,52794,52795,52796,52797,52798,52799,
+52800,52801,52802,52803,52804,52805,52806,52807,52808,52809,U,U,U,U,U,U,52810,
+52811,52812,52813,52814,52815,52816,52817,52818,52819,52820,52821,52822,52823,
+52826,52827,52829,52830,52834,52835,52836,52837,52838,52839,52842,52844,U,U,U,
+U,U,U,52846,52847,52848,52849,52850,52851,52854,52855,52857,52858,52859,52861,
+52862,52863,52864,52865,52866,52867,52870,52872,52874,52875,52876,52877,52878,
+52879,52882,52883,52885,52886,52887,52889,52890,52891,52892,52893,52894,52895,
+52898,52902,52903,52904,52905,52906,52907,52910,52911,52912,52913,52914,52915,
+52916,52917,52918,52919,52920,52921,52922,U,U,U,U,U,U,52923,52924,52925,52926,
+52927,52928,52930,52931,52932,52933,52934,52935,52936,52937,52938,52939,52940,
+52941,52942,52943,52944,52945,52946,52947,52948,52949,U,U,U,U,U,U,52950,52951,
+52952,52953,52954,52955,52956,52957,52958,52959,52960,52961,52962,52963,52966,
+52967,52969,52970,52973,52974,52975,52976,52977,52978,52979,52982,52986,52987,
+52988,52989,52990,52991,52994,52995,52997,52998,52999,53001,53002,53003,53004,
+53005,53006,53007,53010,53012,53014,53015,53016,53017,53018,53019,53021,53022,
+53023,53025,53026,53027,U,U,U,U,U,U,53029,53030,53031,53032,53033,53034,53035,
+53038,53042,53043,53044,53045,53046,53047,53049,53050,53051,53052,53053,53054,
+53055,53056,53057,53058,53059,53060,U,U,U,U,U,U,53061,53062,53063,53064,53065,
+53066,53067,53068,53069,53070,53071,53072,53073,53074,53075,53078,53079,53081,
+53082,53083,53085,53086,53087,53088,53089,53090,53091,53094,53096,53098,53099,
+53100,53101,53102,53103,53106,53107,53109,53110,53111,53113,53114,53115,53116,
+53117,53118,53119,53121,53122,53123,53124,53126,53127,53128,53129,53130,53131,
+53133,U,U,U,U,U,U,53134,53135,53136,53137,53138,53139,53140,53141,53142,53143,
+53144,53145,53146,53147,53148,53149,53150,53151,53152,53154,53155,53156,53157,
+53158,53159,53161,U,U,U,U,U,U,53162,53163,53164,53165,53166,53167,53169,53170,
+53171,53172,53173,53174,53175,53176,53177,53178,53179,53180,53181,53182,53183,
+53184,53185,53186,53187,53189,53190,53191,53192,53193,53194,53195,53196,53197,
+53198,53199,53200,53201,53202,53203,53204,53205,53206,53207,53208,53209,53210,
+53211,53212,53213,53214,53215,53218,53219,53221,53222,53223,53225,U,U,U,U,U,U,
+53226,53227,53228,53229,53230,53231,53234,53236,53238,53239,53240,53241,53242,
+53243,53245,53246,53247,53249,53250,53251,53253,53254,53255,53256,53257,53258,
+U,U,U,U,U,U,53259,53260,53261,53262,53263,53264,53266,53267,53268,53269,53270,
+53271,53273,53274,53275,53276,53277,53278,53279,53280,53281,53282,53283,53284,
+53285,53286,53287,53288,53289,53290,53291,53292,53294,53295,53296,53297,53298,
+53299,53302,53303,53305,53306,53307,53309,53310,53311,53312,53313,53314,53315,
+53318,53320,53322,53323,53324,53325,53326,53327,U,U,U,U,U,U,53329,53330,53331,
+53333,53334,53335,53337,53338,53339,53340,53341,53342,53343,53345,53346,53347,
+53348,53349,53350,53351,53352,53353,53354,53355,53358,53359,U,U,U,U,U,U,53361,
+53362,53363,53365,53366,53367,53368,53369,53370,53371,53374,53375,53376,53378,
+53379,53380,53381,53382,53383,53384,53385,53386,53387,53388,53389,53390,53391,
+53392,53393,53394,53395,53396,53397,53398,53399,53400,53401,53402,53403,53404,
+53405,53406,53407,53408,53409,53410,53411,53414,53415,53417,53418,53419,53421,
+53422,53423,53424,53425,53426,U,U,U,U,U,U,53427,53430,53432,53434,53435,53436,
+53437,53438,53439,53442,53443,53445,53446,53447,53450,53451,53452,53453,53454,
+53455,53458,53462,53463,53464,53465,53466,U,U,U,U,U,U,53467,53470,53471,53473,
+53474,53475,53477,53478,53479,53480,53481,53482,53483,53486,53490,53491,53492,
+53493,53494,53495,53497,53498,53499,53500,53501,53502,53503,53504,53505,53506,
+53507,53508,53509,53510,53511,53512,53513,53514,53515,53516,53518,53519,53520,
+53521,53522,53523,53524,53525,53526,53527,53528,53529,53530,53531,53532,53533,
+53534,53535,U,U,U,U,U,U,53536,53537,53538,53539,53540,53541,53542,53543,53544,
+53545,53546,53547,53548,53549,53550,53551,53554,53555,53557,53558,53559,53561,
+53563,53564,53565,53566,U,U,U,U,U,U,53567,53570,53574,53575,53576,53577,53578,
+53579,53582,53583,53585,53586,53587,53589,53590,53591,53592,53593,53594,53595,
+53598,53600,53602,53603,53604,53605,53606,53607,53609,53610,53611,53613,53614,
+53615,53616,53617,53618,53619,53620,53621,53622,53623,53624,53625,53626,53627,
+53629,53630,53631,53632,53633,53634,53635,53637,53638,53639,53641,53642,U,U,U,
+U,U,U,53643,53644,53645,53646,53647,53648,53649,53650,53651,53652,53653,53654,
+53655,53656,53657,53658,53659,53660,53661,53662,53663,53666,53667,53669,53670,
+53671,U,U,U,U,U,U,53673,53674,53675,53676,53677,53678,53679,53682,53684,53686,
+53687,53688,53689,53691,53693,53694,53695,53697,53698,53699,53700,53701,53702,
+53703,53704,53705,53706,53707,53708,53709,53710,53711,53712,53713,53714,53715,
+53716,53717,53718,53719,53721,53722,53723,53724,53725,53726,53727,53728,53729,
+53730,53731,53732,53733,53734,53735,53736,53737,53738,U,U,U,U,U,U,53739,53740,
+53741,53742,53743,53744,53745,53746,53747,53749,53750,53751,53753,53754,53755,
+53756,53757,53758,53759,53760,53761,53762,53763,53764,53765,53766,U,U,U,U,U,U,
+53768,53770,53771,53772,53773,53774,53775,53777,53778,53779,53780,53781,53782,
+53783,53784,53785,53786,53787,53788,53789,53790,53791,53792,53793,53794,53795,
+53796,53797,53798,53799,53800,53801,53802,53803,53806,53807,53809,53810,53811,
+53813,53814,53815,53816,53817,53818,53819,53822,53824,53826,53827,53828,53829,
+53830,53831,53833,53834,53835,53836,U,U,U,U,U,U,53837,53838,53839,53840,53841,
+53842,53843,53844,53845,53846,53847,53848,53849,53850,53851,53853,53854,53855,
+53856,53857,53858,53859,53861,53862,53863,53864,U,U,U,U,U,U,53865,53866,53867,
+53868,53869,53870,53871,53872,53873,53874,53875,53876,53877,53878,53879,53880,
+53881,53882,53883,53884,53885,53886,53887,53890,53891,53893,53894,53895,53897,
+53898,53899,53900,53901,53902,53903,53906,53907,53908,53910,53911,53912,53913,
+53914,53915,53917,53918,53919,53921,53922,53923,53925,53926,53927,53928,53929,
+53930,53931,53933,U,U,U,U,U,U,53934,53935,53936,53938,53939,53940,53941,53942,
+53943,53946,53947,53949,53950,53953,53955,53956,53957,53958,53959,53962,53964,
+53965,53966,53967,53968,53969,U,U,U,U,U,U,53970,53971,53973,53974,53975,53977,
+53978,53979,53981,53982,53983,53984,53985,53986,53987,53990,53991,53992,53993,
+53994,53995,53996,53997,53998,53999,54002,54003,54005,54006,54007,54009,54010,
+54011,54012,54013,54014,54015,54018,54020,54022,54023,54024,54025,54026,54027,
+54031,54033,54034,54035,54037,54039,54040,54041,54042,54043,54046,54050,54051,
+U,U,U,U,U,U,54052,54054,54055,54058,54059,54061,54062,54063,54065,54066,54067,
+54068,54069,54070,54071,54074,54078,54079,54080,54081,54082,54083,54086,54087,
+54088,54089,U,U,U,U,U,U,54090,54091,54092,54093,54094,54095,54096,54097,54098,
+54099,54100,54101,54102,54103,54104,54105,54106,54107,54108,54109,54110,54111,
+54112,54113,54114,54115,54116,54117,54118,54119,54120,54121,54122,54123,54124,
+54125,54126,54127,54128,54129,54130,54131,54132,54133,54134,54135,54136,54137,
+54138,54139,54142,54143,54145,54146,54147,54149,54150,54151,U,U,U,U,U,U,54152,
+54153,54154,54155,54158,54162,54163,54164,54165,54166,54167,54170,54171,54173,
+54174,54175,54177,54178,54179,54180,54181,54182,54183,54186,54188,54190,U,U,U,
+U,U,U,54191,54192,54193,54194,54195,54197,54198,54199,54201,54202,54203,54205,
+54206,54207,54208,54209,54210,54211,54214,54215,54218,54219,54220,54221,54222,
+54223,54225,54226,54227,54228,54229,54230,54231,54233,54234,54235,54236,54237,
+54238,54239,54240,54242,54244,54245,54246,54247,54248,54249,54250,54251,54254,
+54255,54257,54258,54259,54261,54262,54263,U,U,U,U,U,U,54264,54265,54266,54267,
+54270,54272,54274,54275,54276,54277,54278,54279,54281,54282,54283,54284,54285,
+54286,54287,54288,54289,54290,54291,54292,54293,54294,U,U,U,U,U,U,54295,54296,
+54297,54298,54299,54300,54302,54303,54304,54305,54306,54307,54308,54309,54310,
+54311,54312,54313,54314,54315,54316,54317,54318,54319,54320,54321,54322,54323,
+54324,54325,54326,54327,54328,54329,54330,54331,54332,54333,54334,54335,54337,
+54338,54339,54341,54342,54343,54344,54345,54346,54347,54348,54349,54350,54351,
+54352,54353,54354,54355,U,U,U,U,U,U,54356,54357,54358,54359,54360,54361,54362,
+54363,54365,54366,54367,54369,54370,54371,54373,54374,54375,54376,54377,54378,
+54379,54380,54382,54384,54385,54386,U,U,U,U,U,U,54387,54388,54389,54390,54391,
+54394,54395,54397,54398,54401,54403,54404,54405,54406,54407,54410,54412,54414,
+54415,54416,54417,54418,54419,54421,54422,54423,54424,54425,54426,54427,54428,
+54429,54430,54431,54432,54433,54434,54435,54436,54437,54438,54439,54440,54442,
+54443,54444,54445,54446,54447,54448,54449,54450,54451,54452,54453,54454,54455,
+54456,U,U,U,U,U,U,54457,54458,54459,54460,54461,54462,54463,54464,54465,54466,
+54467,54468,54469,54470,54471,54472,54473,54474,54475,54477,54478,54479,54481,
+54482,54483,54485,U,U,U,U,U,U,54486,54487,54488,54489,54490,54491,54493,54494,
+54496,54497,54498,54499,54500,54501,54502,54503,54505,54506,54507,54509,54510,
+54511,54513,54514,54515,54516,54517,54518,54519,54521,54522,54524,54526,54527,
+54528,54529,54530,54531,54533,54534,54535,54537,54538,54539,54541,54542,54543,
+54544,54545,54546,54547,54550,54552,54553,54554,54555,54556,54557,U,U,U,U,U,U,
+54558,54559,54560,54561,54562,54563,54564,54565,54566,54567,54568,54569,54570,
+54571,54572,54573,54574,54575,54576,54577,54578,54579,54580,54581,54582,54583,
+U,U,U,U,U,U,54584,54585,54586,54587,54590,54591,54593,54594,54595,54597,54598,
+54599,54600,54601,54602,54603,54606,54608,54610,54611,54612,54613,54614,54615,
+54618,54619,54621,54622,54623,54625,54626,54627,54628,54630,54631,54634,54636,
+54638,54639,54640,54641,54642,54643,54646,54647,54649,54650,54651,54653,54654,
+54655,54656,54657,54658,54659,54662,54666,54667,U,U,U,U,U,U,54668,54669,54670,
+54671,54673,54674,54675,54676,54677,54678,54679,54680,54681,54682,54683,54684,
+54685,54686,54687,54688,54689,54690,54691,54692,54694,54695,U,U,U,U,U,U,54696,
+54697,54698,54699,54700,54701,54702,54703,54704,54705,54706,54707,54708,54709,
+54710,54711,54712,54713,54714,54715,54716,54717,54718,54719,54720,54721,54722,
+54723,54724,54725,54726,54727,54730,54731,54733,54734,54735,54737,54739,54740,
+54741,54742,54743,54746,54748,54750,54751,54752,54753,54754,54755,54758,54759,
+54761,54762,54763,54765,54766,U,U,U,U,U,U,54767,54768,54769,54770,54771,54774,
+54776,54778,54779,54780,54781,54782,54783,54786,54787,54789,54790,54791,54793,
+54794,54795,54796,54797,54798,54799,54802,U,U,U,U,U,U,54806,54807,54808,54809,
+54810,54811,54813,54814,54815,54817,54818,54819,54821,54822,54823,54824,54825,
+54826,54827,54828,54830,54831,54832,54833,54834,54835,54836,54837,54838,54839,
+54842,54843,54845,54846,54847,54849,54850,54851,54852,54854,54855,54858,54860,
+54862,54863,54864,54866,54867,54870,54871,54873,54874,54875,54877,54878,54879,
+54880,54881,U,U,U,U,U,U,54882,54883,54884,54885,54886,54888,54890,54891,54892,
+54893,54894,54895,54898,54899,54901,54902,54903,54904,54905,54906,54907,54908,
+54909,54910,54911,54912,U,U,U,U,U,U,54913,54914,54916,54918,54919,54920,54921,
+54922,54923,54926,54927,54929,54930,54931,54933,54934,54935,54936,54937,54938,
+54939,54940,54942,54944,54946,54947,54948,54949,54950,54951,54953,54954,54955,
+54957,54958,54959,54961,54962,54963,54964,54965,54966,54967,54968,54970,54972,
+54973,54974,54975,54976,54977,54978,54979,54982,54983,54985,54986,54987,U,U,U,
+U,U,U,54989,54990,54991,54992,54994,54995,54997,54998,55000,55002,55003,55004,
+55005,55006,55007,55009,55010,55011,55013,55014,55015,55017,55018,55019,55020,
+55021,U,U,U,U,U,U,55022,55023,55025,55026,55027,55028,55030,55031,55032,55033,
+55034,55035,55038,55039,55041,55042,55043,55045,55046,55047,55048,55049,55050,
+55051,55052,55053,55054,55055,55056,55058,55059,55060,55061,55062,55063,55066,
+55067,55069,55070,55071,55073,55074,55075,55076,55077,55078,55079,55082,55084,
+55086,55087,55088,55089,55090,55091,55094,55095,55097,U,U,U,U,U,U,55098,55099,
+55101,55102,55103,55104,55105,55106,55107,55109,55110,55112,55114,55115,55116,
+55117,55118,55119,55122,55123,55125,55130,55131,55132,55133,55134,U,U,U,U,U,U,
+55135,55138,55140,55142,55143,55144,55146,55147,55149,55150,55151,55153,55154,
+55155,55157,55158,55159,55160,55161,55162,55163,55166,55167,55168,55170,55171,
+55172,55173,55174,55175,55178,55179,55181,55182,55183,55185,55186,55187,55188,
+55189,55190,55191,55194,55196,55198,55199,55200,55201,55202,55203,
+};
+
+static const struct dbcs_index cp949ext_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{__cp949ext_decmap+0,65,254},{__cp949ext_decmap+190,
+65,254},{__cp949ext_decmap+380,65,254},{__cp949ext_decmap+570,65,254},{
+__cp949ext_decmap+760,65,254},{__cp949ext_decmap+950,65,254},{
+__cp949ext_decmap+1140,65,254},{__cp949ext_decmap+1330,65,254},{
+__cp949ext_decmap+1520,65,254},{__cp949ext_decmap+1710,65,254},{
+__cp949ext_decmap+1900,65,254},{__cp949ext_decmap+2090,65,254},{
+__cp949ext_decmap+2280,65,254},{__cp949ext_decmap+2470,65,254},{
+__cp949ext_decmap+2660,65,254},{__cp949ext_decmap+2850,65,254},{
+__cp949ext_decmap+3040,65,254},{__cp949ext_decmap+3230,65,254},{
+__cp949ext_decmap+3420,65,254},{__cp949ext_decmap+3610,65,254},{
+__cp949ext_decmap+3800,65,254},{__cp949ext_decmap+3990,65,254},{
+__cp949ext_decmap+4180,65,254},{__cp949ext_decmap+4370,65,254},{
+__cp949ext_decmap+4560,65,254},{__cp949ext_decmap+4750,65,254},{
+__cp949ext_decmap+4940,65,254},{__cp949ext_decmap+5130,65,254},{
+__cp949ext_decmap+5320,65,254},{__cp949ext_decmap+5510,65,254},{
+__cp949ext_decmap+5700,65,254},{__cp949ext_decmap+5890,65,254},{
+__cp949ext_decmap+6080,65,160},{__cp949ext_decmap+6176,65,160},{
+__cp949ext_decmap+6272,65,160},{__cp949ext_decmap+6368,65,160},{
+__cp949ext_decmap+6464,65,160},{__cp949ext_decmap+6560,65,160},{
+__cp949ext_decmap+6656,65,160},{__cp949ext_decmap+6752,65,160},{
+__cp949ext_decmap+6848,65,160},{__cp949ext_decmap+6944,65,160},{
+__cp949ext_decmap+7040,65,160},{__cp949ext_decmap+7136,65,160},{
+__cp949ext_decmap+7232,65,160},{__cp949ext_decmap+7328,65,160},{
+__cp949ext_decmap+7424,65,160},{__cp949ext_decmap+7520,65,160},{
+__cp949ext_decmap+7616,65,160},{__cp949ext_decmap+7712,65,160},{
+__cp949ext_decmap+7808,65,160},{__cp949ext_decmap+7904,65,160},{
+__cp949ext_decmap+8000,65,160},{__cp949ext_decmap+8096,65,160},{
+__cp949ext_decmap+8192,65,160},{__cp949ext_decmap+8288,65,160},{
+__cp949ext_decmap+8384,65,160},{__cp949ext_decmap+8480,65,160},{
+__cp949ext_decmap+8576,65,160},{__cp949ext_decmap+8672,65,160},{
+__cp949ext_decmap+8768,65,160},{__cp949ext_decmap+8864,65,160},{
+__cp949ext_decmap+8960,65,160},{__cp949ext_decmap+9056,65,160},{
+__cp949ext_decmap+9152,65,160},{__cp949ext_decmap+9248,65,160},{
+__cp949ext_decmap+9344,65,160},{__cp949ext_decmap+9440,65,160},{
+__cp949ext_decmap+9536,65,160},{__cp949ext_decmap+9632,65,82},{0,0,0},{0,0,0},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __cp949_encmap[33133] = {
+8750,N,N,8756,N,N,8535,8487,N,10275,N,N,8489,8807,N,8518,8510,10615,10616,
+8741,N,8786,8484,8748,10614,10284,N,10361,10358,10362,8751,N,N,N,N,N,N,10273,
+N,N,N,N,N,N,N,N,N,10274,N,N,N,N,N,N,8511,10282,N,N,N,N,N,10285,10540,N,N,N,N,
+N,N,10529,N,N,N,N,N,N,N,N,N,10531,N,N,N,N,N,N,8512,10538,N,N,N,N,N,10541,
+10530,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10276,10532,N,N,N,N,N,N,N,N,N,
+10533,10278,10534,N,N,N,N,10535,N,N,N,N,N,N,10280,10536,10281,10537,N,N,N,N,N,
+N,10544,10287,10543,N,N,N,N,N,N,10283,10539,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,10286,10542,8743,N,N,N,N,N,N,N,N,8752,N,N,N,N,N,N,N,8744,8747,8746,8749,N,
+8745,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,
+9551,9552,9553,N,9554,9555,9556,9557,9558,9559,9560,N,N,N,N,N,N,N,9569,9570,
+9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,N,
+9586,9587,9588,9589,9590,9591,9592,11303,N,N,N,N,N,N,N,N,N,N,N,N,N,N,11297,
+11298,11299,11300,11301,11302,11304,11305,11306,11307,11308,11309,11310,11311,
+11312,11313,11314,11315,11316,11317,11318,11319,11320,11321,11322,11323,11324,
+11325,11326,11327,11328,11329,11345,11346,11347,11348,11349,11350,11352,11353,
+11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11366,
+11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,N,11351,
+8490,N,N,8494,8495,N,N,8496,8497,N,N,8787,8788,N,N,N,8485,8486,N,N,N,N,N,N,N,
+N,N,8758,N,8519,8520,N,N,N,N,N,N,N,8536,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+10617,N,N,N,N,N,N,N,N,N,N,10618,N,10619,10620,10621,10622,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8806,8521,N,N,N,N,N,
+8757,N,N,N,N,N,N,N,N,N,10020,N,N,8800,N,N,N,N,N,N,N,N,N,N,8805,8802,N,N,N,
+10073,N,N,N,N,8522,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,10359,10360,N,N,N,N,N,N,10363,10364,10365,10366,N,9520,
+9521,9522,9523,9524,9525,9526,9527,9528,9529,N,N,N,N,N,N,9505,9506,9507,9508,
+9509,9510,9511,9512,9513,9514,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+8551,8552,8550,8553,8554,8789,8792,8790,8793,8791,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,8737,N,8738,8739,N,8531,8740,N,N,N,8532,8564,N,N,8565,N,N,N,8755,N,8754,
+N,N,N,N,N,N,N,N,8558,N,N,8560,8516,N,8528,N,N,N,N,8491,N,8572,8573,8571,8570,
+8562,8563,N,8753,N,N,N,N,N,8517,8561,N,N,N,N,N,N,8493,8559,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,8534,N,N,N,N,N,N,N,N,N,N,N,N,N,8513,8533,N,N,8514,8515,
+N,N,N,N,8556,8557,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8568,8569,N,N,
+8566,8567,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8769,N,N,N,N,N,N,N,N,N,N,N,8529,
+8530,10343,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,
+10355,10356,10357,N,N,N,N,N,10599,10600,10601,10602,10603,10604,10605,10606,
+10607,10608,10609,10610,10611,10612,10613,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,
+10583,10584,10585,10586,10587,10588,10589,10590,10591,10592,10593,10594,10595,
+10596,10597,10598,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10317,
+10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,
+10331,10332,10333,10334,10335,10336,10337,10338,10339,10340,10341,10342,9761,
+9772,9762,9773,N,N,N,N,N,N,N,N,9763,9800,9799,9774,9764,9794,9793,9775,9766,
+9798,9797,9777,9765,9796,9795,9776,9767,9788,9801,9802,9783,9803,9804,9778,
+9769,9790,9805,9806,9785,9807,9808,9780,9768,9809,9810,9784,9789,9811,9812,
+9779,9770,9813,9814,9786,9791,9815,9816,9781,9771,9817,9818,9787,9819,9820,
+9792,9821,9822,9823,9824,9825,9826,9827,9828,9782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8774,N,N,N,N,N,N,N,N,N,N,N,N,N,8545,8544,N,
+8771,8775,8776,8779,8778,8777,8780,N,N,N,N,N,N,N,N,8547,8546,N,N,8762,8761,N,
+N,N,N,8549,8548,N,N,8760,8759,N,N,N,N,8543,8542,8770,N,N,8539,N,N,8541,8540,
+8772,8773,8538,8537,N,N,N,N,N,N,N,8783,8782,N,N,N,N,N,N,N,N,N,N,N,N,8784,N,
+8785,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8527,N,
+8526,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,8764,8765,N,
+8768,8763,8766,N,8767,8781,8795,8796,N,8797,8794,8481,8482,8483,8488,N,N,N,N,
+8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,N,8555,8498,8499,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+10785,10786,10787,10788,10789,10790,10791,10792,10793,10794,10795,10796,10797,
+10798,10799,10800,10801,10802,10803,10804,10805,10806,10807,10808,10809,10810,
+10811,10812,10813,10814,10815,10816,10817,10818,10819,10820,10821,10822,10823,
+10824,10825,10826,10827,10828,10829,10830,10831,10832,10833,10834,10835,10836,
+10837,10838,10839,10840,10841,10842,10843,10844,10845,10846,10847,10848,10849,
+10850,10851,10852,10853,10854,10855,10856,10857,10858,10859,10860,10861,10862,
+10863,10864,10865,10866,10867,N,N,N,N,N,N,N,N,N,N,N,N,N,11041,11042,11043,
+11044,11045,11046,11047,11048,11049,11050,11051,11052,11053,11054,11055,11056,
+11057,11058,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,
+11070,11071,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,
+11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11094,11095,
+11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11106,11107,11108,
+11109,11110,11111,11112,11113,11114,11115,11116,11117,11118,11119,11120,11121,
+11122,11123,11124,11125,11126,9249,9250,9251,9252,9253,9254,9255,9256,9257,
+9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,
+9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,
+9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,
+9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,
+9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,
+9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,10545,10546,10547,10548,
+10549,10550,10551,10552,10553,10554,10555,10556,10557,10558,10559,10560,10561,
+10562,10563,10564,10565,10566,10567,10568,10569,10570,10571,10572,8799,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,10289,10290,10291,10292,
+10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303,10304,10305,
+10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,N,N,N,8798,
+10057,10058,10059,10060,10061,N,N,N,10042,10043,10076,10077,10078,10038,10039,
+10040,10068,10069,10070,10071,10072,10017,10018,10019,10021,10027,10028,10029,
+10030,10031,10032,10033,10034,10035,10036,10023,10024,10025,10026,10045,10046,
+10085,10086,10087,10088,10081,10082,10083,10047,10048,10049,10050,10051,10052,
+10053,10054,10055,10056,10062,10063,10064,10065,10066,10067,10074,10075,8803,
+10092,10022,10080,10095,8801,10044,10093,10037,N,N,N,N,10041,10090,N,N,10091,
+N,N,10079,N,8804,N,N,10084,10094,10089,27753,28491,N,30290,N,N,N,22578,27995,
+24370,24382,31035,N,23668,N,N,N,30052,N,N,29478,23904,24870,N,20088,23600,N,N,
+N,N,25386,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29033,N,N,N,N,19834,N,N,N,N,N,31791,
+21281,N,28971,N,N,N,N,N,N,26449,21036,N,20089,N,N,N,N,N,29053,N,24127,31546,
+31033,N,N,N,N,N,N,20050,N,25387,27488,N,N,N,20090,19319,25893,N,N,N,N,N,N,N,N,
+N,N,N,19041,N,21580,N,N,N,N,N,27233,N,N,23651,24365,N,N,N,N,N,N,19307,N,N,N,
+21807,N,N,N,22133,N,25976,N,N,24128,27683,N,26957,N,27175,26998,31547,N,26473,
+28492,N,N,20582,N,N,24129,N,N,25644,N,N,22604,31089,N,20063,31268,26162,N,
+31355,N,N,31293,19528,28493,21845,N,N,N,N,N,N,N,21282,N,N,N,27729,N,N,N,N,N,
+25639,27730,N,N,30257,N,N,20091,N,N,20561,19263,N,27940,N,N,N,N,N,N,27944,
+24130,30306,27996,23669,24633,N,N,N,21582,N,29749,N,N,N,21339,22069,27684,N,N,
+N,N,N,N,N,N,N,N,25702,N,29034,N,N,N,19308,19264,N,N,N,27762,20586,N,N,N,N,N,N,
+N,31090,27685,20575,N,26474,20587,23633,23401,32076,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,23383,N,N,N,N,23137,N,22070,N,25439,N,24131,N,
+24132,18977,N,N,N,N,N,28268,N,N,21283,28215,30799,N,N,N,N,27208,28216,28972,
+28965,26958,N,N,N,31036,N,N,N,25977,27754,23894,27970,N,N,N,N,N,N,N,N,N,N,N,N,
+30757,N,N,N,N,N,25914,23384,N,N,18978,N,N,20813,N,N,N,28269,N,N,N,27755,24133,
+N,25440,N,19017,29289,N,21838,N,30262,N,20034,22087,N,25396,N,28973,N,27234,N,
+N,N,N,22338,N,29479,N,N,19818,N,27502,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22834,
+32037,N,N,N,N,N,30293,21858,N,N,N,N,N,N,N,N,30773,N,N,19573,30005,25645,N,N,N,
+N,26475,29013,N,N,N,28731,N,N,26933,N,19529,31317,N,N,24916,N,N,22358,N,N,
+23617,N,24134,31343,25441,N,N,N,N,N,N,N,N,N,N,N,N,24947,23670,N,20092,N,23364,
+N,30833,N,N,23652,N,25967,23601,N,N,N,21846,N,N,29530,N,19265,N,23363,N,N,N,
+22906,21358,N,N,N,31288,N,N,32038,27503,N,29734,N,19530,29480,N,29531,N,23335,
+30263,N,20326,28786,19290,N,26450,22339,30320,26718,N,N,N,N,N,N,N,N,N,N,N,N,N,
+25894,N,N,N,N,N,N,N,25959,N,N,N,18979,19495,27209,N,N,N,N,N,30774,N,N,N,N,N,
+31269,N,N,N,N,28974,N,28494,N,N,N,N,N,N,N,N,19309,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30256,28495,26959,N,30558,N,N,N,N,N,N,N,20051,N,N,N,N,23671,N,N,N,N,N,N,N,
+23336,N,N,N,19320,N,N,N,N,N,N,24353,23905,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+30026,26934,N,N,N,N,26476,28270,N,29552,N,24383,N,N,N,N,N,N,19531,N,N,N,N,N,N,
+20545,N,N,N,29778,24634,N,N,N,N,24384,N,20064,N,N,N,23634,32106,N,N,N,22134,N,
+N,N,27210,N,N,N,N,N,N,26729,N,25388,N,N,N,N,N,29520,N,N,N,N,N,N,N,N,N,N,N,
+18980,N,23416,N,N,N,24135,27504,29014,N,N,25954,N,19532,N,N,19323,N,N,N,N,N,N,
+N,N,27235,N,N,N,N,N,N,N,N,N,N,N,N,24385,N,22125,N,N,N,N,N,N,N,N,26960,N,N,N,N,
+N,N,N,28217,N,N,N,N,21859,N,N,20819,N,25968,N,N,N,26676,27459,N,27178,31356,
+30070,28732,32084,24635,20035,N,20538,30522,22643,30541,N,N,N,25646,N,N,N,N,N,
+N,N,N,N,21599,N,N,N,N,N,20583,N,N,27773,N,21038,28271,21847,27236,30754,19819,
+22335,31537,N,N,19820,N,N,N,23602,20588,20093,28272,N,N,N,19522,N,N,N,20589,N,
+N,N,N,N,25975,N,N,N,29564,N,N,28194,N,N,N,N,22835,N,N,22644,N,26935,N,N,N,N,N,
+N,N,N,20014,N,N,N,N,22818,N,N,N,N,22641,N,21583,N,N,N,N,N,N,N,N,N,25895,21842,
+N,N,N,N,N,22057,N,N,N,N,N,N,29730,N,29015,N,N,21848,N,28733,22352,21584,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,22351,27498,32107,N,N,23405,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+31813,19266,N,N,N,N,32085,N,29768,26730,30067,N,N,31070,21359,N,N,27731,N,N,
+23874,28471,26452,N,19018,N,N,N,22907,N,N,31357,N,N,N,N,N,22058,N,N,N,N,N,
+29816,N,N,N,N,N,N,30583,23596,N,N,N,22359,24354,N,N,N,20030,N,21360,N,N,N,N,N,
+28708,24940,20327,29515,27945,19006,N,N,N,N,N,N,N,29807,N,N,N,30286,N,N,24187,
+20539,21815,28273,N,N,N,N,N,N,29736,N,23672,N,N,N,N,19239,N,23118,N,N,N,24678,
+N,N,N,N,N,N,N,27941,28274,N,N,N,N,23673,N,N,31068,N,N,29532,N,N,N,N,N,N,N,
+30834,N,29817,N,N,N,31857,N,N,N,20540,23417,22321,N,N,N,19324,N,N,N,28709,
+19325,N,N,N,N,N,N,N,N,21876,N,N,N,19821,18981,N,N,22059,20546,N,N,N,N,28734,
+21053,19492,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31286,N,N,19533,N,23162,N,
+30287,N,26936,N,22645,N,N,N,19534,N,N,N,N,22349,N,N,21585,26989,N,19051,22882,
+N,32050,N,25389,22092,22836,N,N,24871,28243,20547,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+32051,N,21860,N,N,20328,N,27971,20530,N,N,20094,23080,30800,N,N,32086,N,N,N,N,
+30801,N,30802,23635,N,N,N,N,23906,31609,23873,N,25397,N,N,N,N,N,N,27997,20036,
+N,19233,N,N,N,N,N,N,23907,N,N,N,N,31837,N,N,N,N,N,N,N,N,N,31023,N,N,N,N,N,
+21115,20257,25640,N,29750,27774,N,N,25390,26477,32065,23138,N,N,22579,N,N,N,
+23908,28783,30321,31344,N,N,20853,N,N,23119,N,23636,N,23590,N,28479,N,N,N,N,N,
+20047,N,24665,N,N,N,N,N,N,22870,27732,27211,N,N,19007,21808,N,20329,N,N,N,N,N,
+29037,N,19535,N,N,N,N,25720,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25709,N,N,N,N,22360,N,
+32039,N,N,N,N,27179,30258,N,N,N,N,20336,31037,N,N,N,N,N,N,26228,N,N,N,N,N,N,N,
+N,N,N,N,N,N,19291,N,N,N,N,N,N,N,29521,N,N,N,N,26961,29481,20576,26962,N,23139,
+N,N,N,N,N,N,25170,N,30242,24948,N,N,N,23140,N,N,N,N,N,26453,30015,20258,19759,
+20259,N,N,N,19760,29054,20515,24879,30755,N,18982,30523,29290,24136,26963,N,N,
+N,N,24137,32094,19008,N,N,N,31082,20814,28244,N,21586,22819,32040,22361,30542,
+31294,N,N,N,N,N,N,N,N,N,20310,N,22384,N,27489,30789,N,N,N,N,N,23674,N,N,23875,
+N,31071,N,N,N,N,N,N,N,26479,N,N,N,N,32101,30243,N,22908,32041,N,26478,N,N,N,
+21861,N,N,N,N,N,28496,N,19761,N,N,N,N,N,N,30498,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,28978,N,28977,N,N,N,N,N,N,19762,N,23083,N,18983,N,N,N,N,N,25442,
+31548,22820,N,N,28218,N,N,N,N,N,30803,N,N,N,N,N,31610,N,20260,N,23675,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30307,N,N,N,27946,N,N,29217,20065,N,N,N,N,N,N,
+31270,N,N,N,N,31072,N,N,N,N,27734,N,N,25710,31009,N,N,31599,N,N,N,31083,28195,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27180,N,N,N,18984,N,N,29818,N,N,
+N,N,19798,31862,N,N,N,29769,N,N,N,N,N,N,N,30804,30758,N,24138,29254,N,N,N,N,N,
+N,22362,N,21328,N,N,N,N,N,N,N,N,N,N,N,22597,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,27238,N,29533,N,N,N,25690,N,N,N,N,N,N,N,N,30308,N,N,N,N,N,30322,N,24386,N,N,
+N,N,N,N,N,N,22909,N,N,N,19574,N,N,21306,N,N,N,N,N,N,N,25647,N,N,N,N,31073,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28710,N,N,N,19283,N,N,N,24636,N,
+29770,21626,N,32042,31074,N,N,N,N,N,N,N,N,N,N,N,N,N,29751,32066,31792,N,32108,
+19042,N,N,N,N,N,N,N,N,N,32061,N,27239,24387,20818,20066,N,21284,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,32043,N,24416,N,N,N,N,N,N,N,N,N,N,N,N,29255,N,N,
+N,N,N,26480,N,20590,N,N,29482,N,N,N,24139,30264,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,24949,28979,30499,N,N,18985,N,N,N,N,N,N,N,N,N,N,20261,N,N,
+24388,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24880,N,N,28735,N,30244,N,
+25398,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31302,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20591,N,N,32109,N,N,N,N,N,N,N,N,23876,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,31863,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,26175,N,N,N,N,N,N,24109,N,31295,N,N,N,N,N,25969,N,N,N,N,N,N,N,
+27972,N,N,N,N,N,N,N,N,N,N,N,N,N,21029,N,N,32110,N,N,N,30006,N,N,N,N,N,N,N,N,
+24950,24140,N,N,31838,N,27735,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19805,N,N,N,N,N,N,
+N,N,22071,19763,30805,25944,N,N,N,20330,N,N,20304,N,27212,N,N,N,N,27182,27181,
+N,N,21361,N,21285,N,N,N,N,N,N,30543,N,N,N,N,N,N,N,N,28196,N,N,N,N,20516,N,N,
+29218,N,N,N,N,N,N,N,N,N,N,20592,N,N,N,N,29219,N,30584,N,N,N,N,20531,N,N,23337,
+N,N,21307,19052,N,28966,19285,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30567,N,N,19806,N,
+30500,N,N,N,30784,N,N,N,21341,N,19536,N,N,N,N,20262,N,N,N,N,N,N,30323,N,N,N,N,
+N,24951,N,N,N,N,N,21340,N,N,31358,N,N,N,N,N,N,N,31271,N,N,N,N,N,N,N,N,N,N,N,N,
+27481,N,20263,27183,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,25711,N,N,N,26937,29016,N,N,22616,N,N,24690,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,26164,23676,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29553,N,N,N,25424,N,N,29307,N,
+23366,20593,N,20594,20316,N,21329,N,N,19505,30552,N,19240,27452,25662,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29788,N,N,23618,N,N,28711,N,N,26176,N,N,19053,N,
+N,N,N,26731,25960,23619,N,N,27998,21362,N,N,N,N,19575,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,20052,26411,N,N,N,19267,N,24881,N,N,30514,N,N,21363,21330,N,30016,N,N,N,
+24413,N,N,28275,26481,N,32052,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29256,N,N,N,
+29522,N,N,28276,N,25171,N,N,N,N,19537,N,24426,N,N,N,26938,N,N,N,N,N,N,N,N,N,
+22871,N,N,N,N,N,N,N,N,30029,N,29042,31303,N,N,N,N,N,N,N,N,22904,21570,N,N,N,N,
+30309,N,N,N,N,23877,N,N,N,N,N,N,26482,27999,N,N,19019,N,N,23418,N,N,N,26677,N,
+21286,N,N,N,N,N,N,32053,N,N,31049,N,25698,N,31549,N,N,22308,20037,N,N,N,N,
+20053,22118,N,N,N,N,25917,N,N,N,N,N,N,24141,27763,N,N,28000,N,N,N,N,N,N,N,N,N,
+27756,31550,24427,N,24952,31038,N,N,N,N,20595,24618,26722,N,N,25172,21117,N,
+25896,N,N,N,N,N,22867,N,N,N,N,21342,N,29752,30524,23677,N,26732,25703,N,N,
+25463,N,N,N,N,N,27688,N,N,N,N,N,N,31345,N,N,N,N,N,25970,N,N,20596,21039,23653,
+N,N,N,N,20517,28980,31793,19576,N,N,23878,31313,N,30559,N,N,31272,N,N,N,N,N,
+28277,N,24142,N,N,N,N,26483,N,N,30508,27460,28001,24619,23879,N,N,N,N,21043,
+21055,N,N,N,19020,N,N,N,N,31551,N,N,N,N,25981,23909,22605,N,N,N,N,N,27764,N,N,
+N,N,N,N,N,N,20597,N,N,26733,20562,N,22872,N,N,N,N,N,N,N,N,N,N,N,30310,N,N,
+23338,N,N,N,30560,N,N,N,N,N,N,N,N,N,N,N,N,22617,N,29731,N,N,29789,N,N,N,N,
+28497,N,N,22837,N,N,27947,N,25399,N,N,N,N,28219,19764,N,24691,27213,N,N,N,N,
+27765,26734,N,19241,28975,N,N,N,N,N,N,N,N,19021,N,27689,N,29291,N,32111,N,
+31091,N,N,N,N,N,N,N,N,N,26177,N,N,27736,N,N,N,27948,27214,N,26719,N,N,N,N,N,N,
+N,N,N,N,N,N,N,24143,N,N,N,N,N,N,21030,N,N,26484,20822,N,N,26178,25443,N,N,N,N,
+25648,N,N,N,22580,N,N,N,N,N,N,N,N,N,N,N,N,30245,N,N,N,N,N,29534,N,N,N,N,22309,
+N,N,N,N,30568,N,N,26694,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31590,N,N,N,N,N,N,N,
+23910,N,N,N,23678,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,22618,N,N,N,N,N,N,N,23084,27184,N,N,N,N,N,N,N,N,
+25400,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,18986,24953,N,
+27185,N,N,N,N,29292,N,N,31342,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28245,N,
+N,N,N,31092,N,N,21100,31611,N,N,N,32112,N,24637,20067,N,N,N,N,N,N,N,N,N,30790,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24110,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,24389,N,N,25918,N,N,N,N,N,N,N,N,N,N,N,N,27949,31338,N,N,19822,27942,N,
+27950,28781,N,23841,N,27951,31864,N,22635,N,N,N,19577,19765,N,N,N,N,31273,N,
+24925,N,N,N,N,25173,27983,N,N,N,23842,N,N,31050,N,27240,N,25965,N,N,N,N,N,N,N,
+N,21355,N,26964,24954,25676,N,24932,26695,N,N,20059,N,N,N,23637,N,30517,31859,
+28787,20015,28981,28498,26696,27505,N,N,N,N,N,19284,24638,25464,27241,31794,N,
+N,N,N,N,24692,N,20320,N,28197,N,N,31274,26179,24882,18987,N,25444,26939,N,N,N,
+N,N,25174,29554,N,28246,27186,20598,27737,23115,20264,N,N,N,N,23843,N,N,N,
+22619,N,31054,26965,25425,N,N,21052,N,N,N,N,N,N,22572,29516,N,19835,30294,N,
+26485,26735,25465,21051,29555,25467,N,24144,20016,N,22135,29017,N,N,N,N,N,
+30017,23620,N,30011,N,24145,23654,N,N,24146,N,N,28002,28278,27215,28782,25468,
+N,21343,21364,24883,N,24884,N,N,N,N,29779,N,N,24390,N,N,N,N,N,N,N,N,N,N,26966,
+N,N,N,23339,N,N,N,N,N,N,N,N,30246,N,N,N,N,N,N,25401,27461,29737,19766,21113,N,
+23085,21091,20305,N,N,N,N,19292,19578,N,20317,N,N,26665,N,25403,25402,N,N,
+24666,N,N,N,28279,N,N,N,N,N,23603,N,N,N,N,21365,N,22310,N,30261,22363,N,N,N,N,
+N,N,24917,N,N,21610,N,24355,N,N,N,N,N,N,N,32095,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,20599,27988,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19242,N,N,N,N,N,N,N,
+25691,N,24955,19234,N,N,N,N,21344,N,25663,N,31552,N,23102,25677,N,22073,N,N,N,
+28480,N,24956,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30265,N,N,N,N,N,
+N,24391,N,N,N,N,N,N,N,25649,N,N,N,N,N,N,23655,23656,N,N,N,31318,N,21366,N,N,N,
+N,29018,N,31346,25213,N,N,N,N,N,21839,20600,N,N,19807,N,N,30027,N,25712,19243,
+N,22340,N,N,N,N,N,N,N,N,N,N,N,N,N,25214,N,23898,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,23086,19054,N,N,N,21817,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25377,N,N,26723,N,N,29483,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,20265,N,N,N,21367,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+21617,N,N,20068,N,26738,N,N,N,N,N,N,N,25973,N,N,N,N,N,N,N,N,N,N,N,N,N,26414,N,
+22074,N,24428,25664,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,26724,N,N,N,N,22581,N,N,N,
+25692,N,N,N,N,N,N,29753,28982,N,N,25182,24885,N,N,19823,28967,20069,19293,N,N,
+22883,N,N,29484,N,N,20601,27691,24147,30569,N,N,31093,N,N,N,N,N,24926,19310,
+25404,30806,N,N,23406,N,N,N,N,N,32113,N,N,N,N,30518,N,N,N,N,29790,N,N,29293,N,
+23385,N,28712,N,N,N,N,N,N,N,24957,N,N,N,N,N,24148,N,24620,N,N,N,N,N,28003,N,N,
+21345,N,24392,N,N,N,N,22838,N,32044,28499,N,N,N,25665,30827,N,23340,N,N,N,N,
+31814,N,N,N,N,N,N,N,N,22573,N,N,N,N,N,N,N,N,N,30266,N,23391,21331,30791,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,19022,30785,21044,N,N,23604,31289,19023,N,31795,27242,
+27243,20602,N,N,N,N,N,28004,N,N,23911,N,N,24393,N,N,N,N,24429,N,N,N,N,N,28220,
+N,28481,N,N,19538,N,23844,N,N,N,24394,N,N,N,N,N,21368,28968,N,N,N,19767,N,
+28500,N,N,N,N,N,N,N,25693,24430,19244,26940,N,N,N,N,N,27244,N,N,N,24395,N,N,N,
+N,N,31039,22063,21830,N,N,N,N,N,20266,N,N,20009,N,N,22136,N,N,N,28983,28280,N,
+N,N,22873,29535,N,30792,20038,N,N,N,N,N,N,N,N,21862,N,N,N,N,N,N,29798,N,N,
+26181,28501,N,N,19311,31839,23591,N,N,22119,N,N,N,N,N,30793,N,N,N,N,25426,N,
+25405,N,20321,28736,27738,N,23895,31600,N,N,27692,N,N,N,28713,N,N,N,N,N,N,
+31319,31553,N,21056,N,N,N,N,N,N,N,25904,N,N,N,28005,N,N,N,N,19245,N,31024,N,N,
+N,N,N,N,N,N,N,N,N,30501,N,19246,N,23087,N,22582,N,N,N,N,N,N,N,21287,31538,N,
+32068,N,27693,N,N,N,N,N,N,31521,N,N,N,25961,26990,N,29556,30835,28737,24111,
+30768,N,N,29536,26415,N,N,N,N,N,23341,N,26165,N,N,31016,N,N,23896,26713,28502,
+N,N,N,21346,N,25183,N,N,31840,22344,32045,N,N,N,24431,19539,21369,N,N,N,N,
+21616,23367,24149,N,N,N,N,28788,N,21840,25945,N,N,N,N,N,N,31815,23638,25184,N,
+N,N,23088,N,N,N,N,N,N,29475,N,21356,N,29771,N,N,N,32069,N,N,N,N,N,25469,N,
+31025,N,N,N,N,N,N,20603,27739,N,N,N,N,N,N,N,N,30012,29220,22606,22607,N,N,N,N,
+N,N,30071,N,N,N,N,N,N,N,N,N,N,30305,N,N,N,N,N,N,N,N,N,21047,N,N,N,N,N,N,N,
+31596,N,23880,25704,N,N,21057,N,N,N,30807,N,N,N,N,N,22075,24150,N,N,30525,
+27694,N,N,N,20577,N,24693,27187,N,20054,N,N,N,N,19493,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,27766,25185,25406,N,N,N,N,N,N,N,N,N,31816,N,N,19824,N,31094,N,N,
+24432,N,N,N,25919,N,N,N,20031,N,N,N,N,31841,27952,32081,30267,N,N,31055,27482,
+19009,N,21048,19825,N,25427,32102,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+26221,N,N,N,25466,N,N,28714,31056,N,N,N,N,N,N,31842,N,30759,N,N,N,24933,28281,
+N,N,N,26486,27245,N,N,31796,30018,N,N,22364,N,N,N,N,N,N,N,N,28789,N,23912,
+21357,30076,N,23103,N,19579,N,N,N,21370,29732,N,N,N,N,N,N,N,28503,N,21571,N,N,
+N,N,N,N,N,N,N,31587,N,N,N,N,N,N,N,N,31597,N,24621,N,N,27246,31539,25666,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,30311,21085,N,24396,N,N,31817,N,N,25897,24694,30259,
+24958,N,N,N,N,19312,N,27247,27248,N,N,N,23104,30772,27506,N,N,N,N,N,25667,N,N,
+N,N,26967,25713,N,N,N,19055,N,N,N,N,N,N,N,20055,N,N,N,N,N,N,N,N,31818,N,N,N,
+29537,N,N,19268,N,N,N,N,25445,N,19269,27188,N,N,26941,N,22345,N,N,27483,27953,
+N,19523,30526,31819,N,N,N,N,N,N,30836,N,22839,N,N,29523,29524,N,N,N,30564,N,
+30545,N,N,22583,20017,19010,N,N,31540,19270,N,N,28790,N,N,21863,N,27216,N,N,N,
+N,N,19540,19247,N,N,N,N,N,29738,26927,N,N,30019,26968,N,N,N,N,N,N,N,23913,N,N,
+N,29043,N,21883,24123,N,N,29819,N,N,N,32115,32114,30502,N,N,N,N,N,N,N,N,N,
+23881,N,N,21587,N,19496,N,23105,19541,N,22884,N,N,N,31306,N,N,N,25955,N,N,N,
+21308,N,N,N,19056,N,N,N,N,20548,N,N,N,19024,31275,27499,26488,22885,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20823,N,N,N,N,N,N,N,N,N,N,N,29476,N,
+N,N,21627,31843,31320,N,29525,N,20267,N,N,27507,21884,N,N,N,N,N,N,21332,19836,
+N,22886,N,25209,25121,27476,N,24695,25650,19580,N,N,N,31588,N,N,N,29739,N,N,N,
+N,20541,N,19057,N,N,N,N,N,N,N,N,28472,N,N,N,22336,N,28282,32116,N,N,21347,N,
+31554,N,N,N,N,N,N,N,21864,23342,24886,30775,N,N,N,N,N,24639,31555,23914,N,
+25122,N,28198,N,N,N,N,N,30312,N,N,N,N,30325,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,23882,N,N,20578,N,N,N,N,23846,N,N,23915,N,N,25721,N,N,25391,20604,N,N,
+N,29820,N,N,N,N,19516,30570,N,N,N,N,N,N,25956,24433,N,N,30561,N,31095,28473,N,
+N,30808,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31017,N,N,N,N,N,30809,N,N,N,28221,N,N,N,
+22598,N,N,25699,30030,N,N,N,N,23897,N,N,N,N,22887,21049,21827,N,N,23141,23120,
+N,20825,20056,N,19294,29740,23163,N,30313,26739,20268,28784,N,29821,23368,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,20032,25428,20815,29045,N,19826,N,20331,N,N,N,19768,
+N,N,N,N,N,N,25382,20826,29221,N,N,N,N,N,29222,N,25678,N,N,N,N,N,N,N,21371,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28969,N,N,N,29257,N,N,N,N,N,N,N,
+N,N,N,28504,26185,N,22584,31347,N,N,N,N,N,N,N,N,N,N,29493,N,N,30756,N,N,20851,
+26184,N,N,N,N,30810,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,23657,24151,N,N,N,N,N,
+19295,N,N,N,20332,N,N,N,N,29791,N,N,20852,21050,N,N,N,24434,N,N,N,24887,N,N,N,
+N,25123,21372,N,N,28006,N,N,N,N,N,23369,N,N,N,25722,N,20318,N,N,20048,N,N,N,N,
+21843,29557,30510,N,N,28488,N,19827,30031,25971,28738,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,19025,N,N,N,27249,N,20518,N,N,N,N,N,N,N,N,22874,28715,N,N,N,
+N,N,27495,N,N,N,25920,31797,N,N,N,N,N,25668,N,N,N,N,N,N,N,N,N,N,N,19497,32070,
+N,N,N,N,N,27189,N,25898,24378,24927,N,23121,N,N,N,N,24888,N,26740,21373,N,N,N,
+N,25124,N,N,N,N,N,29258,N,N,N,N,N,N,N,N,N,23142,30515,N,N,N,N,N,N,N,N,N,N,N,N,
+32077,N,N,N,29494,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28247,N,N,
+N,N,N,N,N,30020,N,N,N,N,N,N,N,N,22564,N,N,N,N,N,29223,N,N,N,N,N,N,N,N,22840,
+22841,28489,N,N,N,N,N,N,N,N,N,N,N,N,N,22094,N,N,N,N,N,N,N,N,30539,24366,26741,
+N,N,N,N,N,N,21045,N,N,N,21333,N,N,N,N,N,29772,23164,N,N,N,N,N,22888,N,30571,
+30025,N,29500,N,23122,N,N,N,N,N,N,N,N,21301,N,N,N,N,N,26678,N,N,22095,29754,N,
+30537,N,N,19498,N,N,28739,19542,N,N,N,20563,N,21309,N,N,N,23419,N,19296,N,N,N,
+N,N,N,21348,30327,N,N,21818,29517,19297,N,N,N,N,27508,N,N,N,N,N,29741,N,31786,
+N,N,N,N,N,30572,N,N,N,26742,23143,N,N,N,30540,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,25921,N,N,N,N,24686,N,N,N,N,N,21885,N,N,N,N,N,N,20070,31787,21819,N,N,
+29224,N,N,N,N,N,N,25125,19769,27250,19271,N,19828,N,N,23343,28505,N,N,N,N,N,
+19770,N,N,31865,N,N,N,N,24435,20071,23106,N,20269,N,N,N,N,26489,30760,N,N,N,N,
+N,N,29538,N,N,N,19058,24356,N,N,21572,N,N,N,N,N,19543,25922,N,N,N,N,19771,N,
+28506,28248,N,23847,25126,N,N,N,N,N,24640,N,N,N,22064,30794,N,31866,N,22910,N,
+N,N,N,24112,N,N,N,23916,23144,N,N,N,N,N,21600,N,22137,N,19799,24152,N,N,29304,
+N,25686,N,N,20549,29742,N,23848,N,N,N,27973,29526,N,N,24153,25446,N,N,N,N,N,N,
+21288,N,23344,N,N,25946,25407,N,N,N,23345,N,N,N,21865,N,N,N,N,N,24641,28507,N,
+N,28777,N,N,22322,N,N,N,N,20605,N,N,N,N,N,N,N,N,22889,N,N,20606,N,27757,21289,
+N,29225,28740,N,N,25186,26991,N,N,N,31057,N,N,26969,N,N,N,N,N,26714,23107,
+23108,21573,N,26490,19808,25392,N,23346,31556,N,29539,N,22821,31591,23883,
+20564,N,26166,24622,32090,N,N,N,N,N,N,N,N,23605,24696,26417,N,N,N,N,30064,N,
+22620,27974,N,N,N,N,24889,N,25408,31040,26992,N,N,22875,N,29540,N,N,N,23606,
+25705,N,N,N,N,N,28741,25409,31820,31821,N,N,N,N,29259,N,29260,N,N,N,25679,N,N,
+N,N,N,N,N,N,N,29019,N,31321,N,28984,32117,24697,N,N,N,N,26491,31799,31844,
+31557,25447,22585,N,30328,N,N,23621,19544,N,N,N,24623,29799,N,28508,20348,
+28509,N,29226,N,N,N,N,N,N,N,N,N,32062,N,N,18988,32059,32071,N,N,N,N,26418,N,
+27217,24436,N,N,N,N,20844,25694,25923,N,N,N,N,22822,N,N,19772,N,29541,N,N,N,N,
+N,N,N,N,27989,N,N,22842,N,N,N,28007,31541,30828,N,N,N,N,24679,N,19545,N,N,
+21574,N,N,N,N,N,26405,N,21877,21310,N,31867,N,N,N,N,N,N,N,N,N,N,N,N,25714,N,N,
+24437,N,N,26744,30829,N,N,20039,N,N,N,N,N,32118,N,N,N,N,N,N,N,N,N,26712,N,
+19800,26454,19546,N,N,19043,24438,28743,28742,N,22586,N,29044,29808,30028,N,N,
+31845,N,N,N,N,27205,27251,N,23899,N,23639,N,N,N,N,N,N,24189,29305,N,21831,N,N,
+N,22608,N,28744,20769,20770,N,N,N,N,N,N,22868,22120,22858,N,23089,22599,23650,
+29518,30068,N,N,28985,N,N,23123,N,30314,N,N,N,20341,N,N,32046,N,N,N,N,N,N,N,N,
+19026,N,N,24372,N,N,N,N,22365,31290,28199,30013,N,30837,N,N,28008,N,N,N,N,N,
+21601,N,20771,24918,N,N,N,N,N,N,N,N,N,N,N,N,N,31096,N,23370,19321,21588,N,
+22876,N,28222,N,30573,N,N,N,21102,N,N,24934,30585,N,N,N,N,N,N,N,23917,N,26715,
+N,23347,N,N,N,20855,24624,N,N,21602,N,30295,N,22393,N,N,22621,N,19837,29227,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19773,30786,N,N,29228,N,N,18989,18990,20270,N,
+N,N,N,N,25410,N,N,N,N,N,23607,N,N,N,N,N,N,N,N,N,N,23386,22843,19059,30291,
+26232,27253,N,N,N,N,N,27254,N,N,30329,N,N,N,N,N,N,N,N,N,N,N,20271,N,N,19027,N,
+N,18991,21040,28986,N,22323,25411,29565,24154,N,N,N,N,24155,N,N,28510,25187,
+28283,N,N,24439,22346,N,N,N,N,N,N,N,N,N,20072,23387,N,N,N,N,N,N,N,28987,N,N,N,
+N,26993,N,N,N,N,N,N,N,N,31287,20550,N,N,19499,28200,N,N,19322,31097,19581,
+21374,N,N,N,N,25680,N,N,N,N,N,29294,N,21589,24397,N,31800,20816,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29261,N,N,N,N,N,N,N,N,30546,N,N,N,N,N,N,N,N,
+19028,N,21849,N,N,N,22622,N,N,N,N,N,N,N,N,N,19801,N,N,N,28201,30268,N,N,19547,
+N,N,N,N,N,28745,N,31868,N,26697,29822,N,N,N,N,26492,22366,N,N,N,N,24156,N,
+28716,19582,19809,N,24890,N,23407,23090,N,N,N,N,N,N,N,N,N,N,N,N,N,20773,23608,
+N,N,N,22646,N,20772,N,19810,N,N,N,N,23658,N,N,28791,N,28746,20542,N,23900,N,N,
+N,N,21590,21334,N,N,N,N,N,N,27984,19745,N,N,N,N,N,24373,N,N,N,24440,N,N,N,N,N,
+N,21537,20018,26698,N,N,N,N,27509,N,N,N,N,N,N,N,25429,30032,N,N,N,29985,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22823,N,N,N,N,N,N,N,N,25899,N,N,N,N,N,N,N,N,
+N,N,N,N,26187,N,30065,N,N,N,N,N,N,N,N,N,N,25925,N,N,N,N,N,N,N,N,31011,24667,
+30315,N,19313,N,22890,29986,N,N,N,22353,N,20856,27256,27257,23091,N,N,N,N,
+28511,N,N,29039,N,25974,28223,25188,N,N,N,N,N,20543,N,31276,30033,26419,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,26942,N,N,N,N,N,29262,23348,N,
+N,N,N,N,N,N,N,31822,N,23918,N,N,N,N,N,N,26420,N,N,N,N,N,22324,N,N,N,N,N,N,
+30516,N,N,N,N,N,19774,N,23145,N,N,N,N,N,N,N,20272,30553,29542,N,N,20057,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20010,N,19272,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,20519,N,28747,N,20551,25669,N,N,N,N,N,N,N,23392,N,N,N,N,N,N,21850,N,
+22311,N,N,N,28224,N,30838,N,N,N,N,30034,28009,N,22844,N,25926,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,29987,N,N,23124,25127,31612,N,N,29020,N,N,N,N,N,N,19060,N,N,
+N,26746,N,N,20073,N,N,N,N,N,N,27000,25189,N,N,N,N,20537,21618,N,N,N,N,N,20774,
+N,24398,N,N,N,N,N,N,N,N,N,31860,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21290,
+N,N,N,19500,N,N,N,N,28512,N,N,N,25957,20565,N,N,N,N,N,N,N,N,23420,N,N,N,N,
+31846,N,N,N,N,N,19326,28010,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24113,N,N,N,N,N,N,N,
+31075,N,N,N,N,N,N,21538,20342,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22096,N,N,N,N,N,N,
+21866,29038,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31307,N,N,N,N,
+25889,21809,N,N,N,N,N,20333,N,28011,N,N,N,N,N,21810,N,N,N,21820,N,N,N,N,N,N,N,
+N,N,32098,29485,N,32091,N,N,N,N,N,N,N,N,N,N,N,N,N,N,26928,N,N,N,N,N,N,N,20775,
+N,N,32099,20019,N,N,N,N,N,N,N,32100,31310,N,N,N,N,18992,N,30503,N,20273,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,26146,N,31798,29229,28513,29486,23622,22891,N,N,N,26720,
+N,N,N,N,N,N,N,24872,N,N,N,N,21878,20349,N,N,24157,N,N,N,22865,N,N,N,25706,
+29263,N,30527,N,N,25190,25128,N,N,N,N,N,N,N,N,N,N,N,25430,N,27985,N,N,N,N,N,
+27001,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22065,24114,N,N,24680,N,N,21291,N,27484,N,
+N,24367,N,19011,N,N,28284,N,32067,N,N,N,27510,20274,N,N,N,N,22892,N,22845,N,
+22623,N,N,21560,27454,23919,N,23920,23921,23922,N,N,22846,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,31558,20275,28285,N,N,N,N,N,N,25643,N,23109,N,22636,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,20776,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25129,N,N,24124,26421,N,N,
+N,N,N,23408,N,28514,29040,20276,N,N,N,N,N,N,N,N,N,N,N,23409,N,24625,N,N,N,N,
+24357,N,31058,N,N,26493,N,N,26147,31601,19248,29230,N,N,N,N,N,N,N,19815,N,
+26716,N,N,26455,N,N,30528,N,20579,N,N,N,23073,N,N,N,19517,N,N,20777,23884,N,N,
+25470,20778,26666,N,27190,31098,26188,30296,N,N,N,21575,N,N,N,22859,N,22866,
+21323,22647,23081,30072,N,N,24158,29231,30761,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+22600,N,N,28225,N,N,N,N,31041,N,N,N,N,23923,27258,N,30269,24891,19775,29780,
+26189,N,31823,31522,N,24668,N,N,N,N,29755,23125,N,31026,N,N,N,N,N,N,31602,N,
+23414,N,24159,N,N,N,23410,N,N,N,N,N,30812,30574,27496,N,21114,N,N,28988,N,N,
+31322,N,N,23146,23110,30529,N,N,26422,25927,22060,N,N,N,N,23623,N,N,N,N,N,
+24873,N,25130,N,21798,N,N,21591,N,N,N,N,N,N,29264,N,27259,N,24669,31603,N,N,N,
+N,N,N,N,28989,N,N,25191,32087,N,20040,27191,N,31808,N,32103,30575,N,N,22325,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28474,29021,N,24115,N,N,N,N,N,N,
+26699,N,N,30813,N,N,31559,21832,N,22367,N,23849,N,N,N,N,N,26929,N,N,31277,
+30297,31348,N,N,N,N,N,30762,N,N,N,N,N,26222,N,19548,24892,24687,N,N,26943,
+31869,26190,N,N,24919,N,26191,N,29809,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,25715,N,N,25723,N,N,31076,N,N,N,N,N,N,N,N,N,N,28515,N,N,20334,30270,
+24626,31870,20779,N,N,N,22394,N,N,N,31560,N,25175,N,N,N,N,N,N,21539,28792,
+22312,N,N,N,24935,N,N,21311,N,N,N,N,N,N,28516,N,22341,27490,N,N,31847,N,N,
+25634,N,25192,N,26192,N,31592,29800,25972,29756,29781,24374,N,31801,28226,
+19061,N,N,N,28517,19298,21540,N,24160,23165,25670,26686,N,N,N,N,24670,30260,
+27218,N,31099,N,N,24642,N,19044,N,26423,N,27261,N,22877,N,23092,28202,31593,N,
+N,N,N,23371,23093,N,N,N,N,N,28990,N,N,21292,N,N,N,N,N,N,N,N,31561,N,24399,N,N,
+21312,25431,N,28518,31824,N,N,N,N,N,N,N,26944,N,N,N,30035,N,N,27740,30519,N,N,
+27192,20857,N,N,N,N,N,N,23624,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27193,
+N,N,N,N,N,29022,N,N,N,N,N,22326,20277,N,22824,N,N,27758,N,N,23850,N,N,N,N,
+19746,26670,N,N,N,24893,N,29265,N,N,N,N,26945,N,N,N,21116,N,N,N,N,N,N,N,23349,
+N,29543,22654,N,N,N,31825,N,27954,29743,N,31523,N,N,31809,N,28203,21541,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29810,N,N,N,N,28249,N,N,N,31562,
+N,N,N,N,N,19811,22587,25947,30839,N,N,N,30292,N,N,N,N,N,N,N,N,22313,N,19273,N,
+N,26193,28748,N,N,N,N,N,N,N,N,N,N,22574,N,31059,21886,N,N,N,N,N,N,N,22588,
+29232,N,N,N,N,25131,29544,N,N,N,N,N,28482,N,N,N,N,N,N,28012,N,26424,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,23166,N,N,19518,N,N,29308,23147,N,25176,27990,N,N,22097,
+24627,N,N,31826,N,27464,N,N,N,N,N,N,N,N,21313,28749,N,20343,N,N,N,N,N,N,N,N,N,
+27986,N,21592,23625,22385,N,N,24379,N,N,29477,N,N,N,29773,N,N,N,N,28991,30769,
+N,27002,N,N,N,31563,N,N,19029,N,N,N,N,N,N,N,N,N,N,N,31060,30538,N,N,22088,N,N,
+N,N,N,N,31848,29501,N,28286,N,26494,N,N,N,N,N,21314,N,N,N,N,21302,N,19501,
+30330,22066,21080,N,N,N,N,N,N,26456,N,N,N,N,N,N,N,N,N,N,25381,N,N,N,N,26425,N,
+N,N,N,28717,31564,27425,N,N,21542,N,N,N,N,31565,N,21821,29023,N,N,30331,N,
+24116,N,N,N,N,N,N,N,N,N,N,N,N,21867,25928,N,N,N,31524,21561,N,N,24161,N,25635,
+N,N,N,22327,N,30830,N,N,N,24117,N,N,22098,N,31061,26426,27477,21879,28519,
+24894,N,N,N,31278,N,N,N,22121,22126,N,N,N,N,N,N,26427,N,N,N,N,N,N,N,27723,N,N,
+N,N,N,N,21811,N,N,N,N,N,N,N,N,N,N,N,N,N,20020,N,N,N,31525,24942,N,N,N,N,N,N,
+30504,N,N,N,N,31566,N,N,N,N,N,22589,N,N,N,N,N,N,N,31613,N,N,N,N,31849,N,N,N,N,
+N,N,N,20278,N,N,N,27975,28204,N,N,N,N,N,N,N,19549,N,N,N,N,30247,N,N,N,26234,N,
+N,N,29988,N,N,N,N,N,32092,27955,20041,N,N,N,N,N,N,28520,N,N,24895,N,N,N,N,N,N,
+31323,19299,30505,N,31526,N,N,N,23609,N,N,N,28992,27976,28483,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,22061,N,N,32078,N,N,N,26657,N,N,N,N,N,N,N,N,31604,21799,N,N,N,
+29046,N,26195,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19550,N,N,N,N,N,N,N,30770,N,N,
+N,23659,32054,N,N,N,N,25962,N,N,29024,N,N,N,N,N,N,N,N,N,N,N,N,23372,23885,N,N,
+N,21576,N,N,22893,N,N,N,N,29989,N,N,N,N,N,N,N,N,N,26235,N,N,N,N,N,26196,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,32072,N,22049,32063,N,31827,N,28449,N,26428,N,N,N,N,
+N,20846,N,N,26197,N,N,26994,N,24368,N,N,N,N,N,22624,31802,32047,28750,N,23393,
+N,N,25929,N,27956,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24643,N,N,N,N,N,N,25432,N,N,N,N,
+27003,27176,N,N,N,N,32055,N,N,31527,N,26946,N,N,N,N,32119,N,N,N,N,N,25177,N,N,
+23660,N,N,N,N,N,N,N,N,N,26658,N,N,N,N,26224,N,N,N,N,N,N,N,32120,32121,N,N,N,
+30271,N,N,26407,N,26199,N,N,N,N,21619,21577,N,N,N,N,22138,N,22386,N,24896,N,
+23394,26200,N,N,N,N,N,N,N,N,N,26429,N,N,N,N,N,28751,29502,25132,N,N,N,N,N,
+30007,24688,N,N,N,N,N,N,N,N,N,N,N,N,32056,25448,N,21543,26748,31314,N,N,N,N,N,
+30831,N,N,N,N,N,N,N,N,N,22099,N,N,N,N,N,N,N,N,N,N,21812,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,28752,N,30576,28211,N,N,27194,N,27219,N,N,27977,23851,N,N,N,25900,32033,
+N,24400,27699,N,24401,N,N,N,N,N,28013,30776,30586,N,N,N,30763,N,N,N,N,N,29792,
+N,N,N,N,N,21562,25651,N,26970,N,24118,N,22847,N,22848,22127,N,N,N,N,22860,N,
+23082,N,N,N,N,N,N,N,N,24421,N,N,N,N,N,N,30565,N,N,N,19506,N,N,24441,22368,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21563,N,N,N,N,
+32122,N,N,N,N,19507,N,N,23411,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24402,N,20042,N,
+28250,N,N,N,N,N,N,N,N,N,25700,N,31567,N,N,N,N,N,N,20279,N,28227,N,N,N,N,N,N,N,
+20074,N,N,N,N,N,N,N,25133,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22369,31349,N,N,21833,
+30764,26457,N,N,N,N,N,N,N,N,N,N,N,29545,N,N,N,N,22637,25412,28785,N,N,N,N,N,N,
+N,26725,N,N,N,24698,28228,22878,N,N,N,N,N,N,N,N,N,N,27426,27427,N,N,N,N,N,N,
+31810,27195,N,N,N,N,26667,24162,N,N,N,N,N,N,N,N,N,N,28015,N,26659,N,N,N,N,
+20337,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21564,N,31850,N,N,N,N,N,26430,N,31858,N,
+N,22068,N,N,25134,N,21303,31308,N,N,N,N,N,N,N,N,31324,N,27957,24931,N,26668,N,
+26717,N,N,28521,N,N,N,N,N,29757,N,20280,26971,20780,N,N,N,N,N,N,23111,N,N,N,N,
+N,N,N,27465,N,26700,N,N,N,24119,N,N,N,N,22076,21349,N,N,N,N,N,31325,N,N,N,N,N,
+N,23126,N,18993,N,N,N,N,N,N,23112,24358,N,31027,29266,N,19012,N,N,N,N,N,N,
+20043,N,N,19829,N,N,N,32048,21800,N,28993,N,N,25193,23626,27700,31296,N,N,
+31528,20520,N,N,23148,N,N,N,N,N,N,N,N,N,22894,N,24699,N,N,N,28522,31326,24644,
+N,20281,N,21834,22370,25135,N,22328,N,N,N,N,N,N,N,N,N,26701,N,N,N,N,N,N,N,
+30298,N,N,N,N,28450,25178,30332,N,N,31568,20781,N,19812,N,20782,23661,26702,N,
+28793,20021,26236,N,N,22395,20566,23925,30577,N,30333,N,23415,N,N,N,N,31594,
+26972,22849,N,30066,24645,N,N,N,N,N,N,27220,N,N,N,N,N,N,N,N,N,31042,N,27196,N,
+21061,31569,26432,27429,N,24442,25378,22329,N,26947,N,26749,26671,N,N,29267,
+31529,22565,N,N,N,N,21835,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20552,N,N,N,20783,22371,
+N,N,N,24646,N,22050,N,28016,N,N,N,N,N,N,N,N,N,N,N,N,22387,N,N,N,31828,N,23127,
+19551,N,29268,N,20784,N,19552,N,23421,29503,N,28753,N,N,N,N,N,31803,N,25136,N,
+N,26149,N,N,N,25179,N,N,N,24414,N,24647,N,N,N,N,N,N,29295,N,N,N,19553,N,N,N,N,
+22122,N,N,N,N,26434,N,N,N,20022,N,29504,N,19838,N,N,N,31570,N,30840,30587,N,N,
+26687,N,N,N,N,N,N,N,26679,N,N,N,N,N,N,N,N,27958,23610,N,N,19508,N,N,N,N,N,N,N,
+N,N,N,N,N,29047,N,N,N,26680,N,N,19062,N,25636,29782,N,N,N,24422,N,N,N,24359,N,
+24423,24897,N,26948,N,N,23627,26949,N,N,N,28451,27430,19235,25449,N,N,N,20859,
+28452,N,28523,N,N,N,N,N,N,N,N,N,N,N,N,20532,N,N,N,N,19747,N,N,26726,N,28453,N,
+21324,23149,N,N,N,N,22330,N,29269,30053,22895,N,N,N,N,31028,N,N,21844,32079,N,
+N,N,23395,N,N,N,N,29025,27702,N,N,N,N,31614,21335,N,20785,N,19249,N,N,N,N,
+20786,N,N,N,N,N,N,19250,28994,N,N,29793,31029,N,N,24899,24898,N,27511,N,N,N,N,
+N,N,N,N,N,N,N,24360,N,N,N,N,N,N,N,19274,N,N,N,N,N,26169,N,N,N,N,N,30814,31018,
+19063,N,27959,N,N,21304,29270,N,N,21593,28229,29296,N,N,N,18994,N,N,23611,N,
+29048,N,N,N,N,N,27703,N,N,N,N,25930,N,30272,32093,N,N,21603,19554,N,30548,N,N,
+N,N,N,N,22373,N,N,N,N,N,N,N,N,N,N,N,N,N,21315,N,22566,N,30273,N,N,N,N,N,23926,
+N,19776,25948,N,N,N,N,N,N,N,N,N,N,N,N,25931,N,N,N,N,N,N,N,N,N,N,N,24900,N,N,N,
+N,N,26672,29744,29546,23150,N,22331,N,25137,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,22314,N,N,N,N,N,N,22139,N,N,N,N,N,N,N,N,N,25695,N,19030,N,N,N,27432,N,N,
+N,23422,N,N,N,N,N,N,N,N,N,N,30274,N,N,28475,N,N,N,N,21629,N,N,24648,N,N,N,
+26681,N,28454,N,N,N,N,N,19748,N,N,21620,23329,23388,23389,N,N,N,N,N,28252,N,
+19275,31829,N,N,N,N,N,N,20075,N,19777,N,N,31571,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,31019,N,N,N,N,N,N,N,N,N,N,N,30036,N,N,N,N,22825,N,N,
+26973,23373,N,N,23886,N,26435,N,27724,N,N,N,N,N,N,N,31084,N,N,N,19276,N,N,N,N,
+24700,21544,N,27987,22639,N,29271,N,19064,23151,N,N,22100,N,N,N,N,N,N,22861,N,
+N,N,22638,N,29249,N,N,N,24403,N,N,N,23152,N,25194,24701,N,N,22648,N,N,N,30511,
+23094,N,19031,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29272,N,22649,N,N,N,N,N,N,N,
+N,31327,N,N,N,N,N,N,N,N,N,N,N,N,N,20335,22850,N,28754,N,25681,N,N,N,29495,N,N,
+N,N,N,N,N,N,N,N,N,N,31328,N,N,N,N,N,N,N,N,N,N,N,N,N,28524,N,N,N,N,N,25138,N,
+21565,N,N,22862,N,N,N,N,29794,N,N,N,N,N,N,N,N,N,N,N,N,N,21545,N,N,N,N,19778,
+26458,N,N,N,N,N,N,N,N,N,N,N,29273,N,N,N,N,N,22826,N,N,N,N,N,N,N,N,N,N,N,N,
+22590,N,N,N,N,N,N,23597,N,N,N,N,N,N,25195,22140,N,N,19065,N,N,21594,N,N,N,N,N,
+N,N,29783,19489,N,N,20282,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30008,
+N,N,N,22851,20584,N,N,N,N,N,25413,27512,N,29233,N,N,N,20283,N,N,N,21293,26721,
+20076,N,N,N,24628,24163,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,23927,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,29234,29558,30299,N,N,N,N,22398,N,N,N,N,N,30815,N,30578,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,20521,N,N,N,N,N,N,N,N,N,26202,N,N,N,N,N,N,N,N,N,N,
+N,N,N,29990,N,N,N,N,N,N,N,N,N,N,N,N,N,22332,19555,N,N,26203,N,N,N,N,N,N,N,N,N,
+N,N,N,23901,N,N,N,N,20787,N,N,N,N,N,28525,N,N,N,N,22110,25716,24943,N,N,23928,
+N,N,N,N,N,26703,N,N,N,N,N,N,N,N,N,N,N,19045,N,N,N,23585,N,24629,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,31788,31789,22567,N,N,N,N,27960,N,N,N,23350,N,N,N,N,22128,
+29487,N,N,19749,N,23153,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22568,N,
+N,N,19556,N,N,20788,N,N,N,N,N,19032,N,N,N,N,N,23154,29991,N,N,N,N,N,N,N,N,N,N,
+N,N,29992,N,N,N,N,N,N,N,26150,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21868,
+21880,23155,N,N,N,N,N,N,N,N,N,N,N,N,N,25414,N,N,N,24164,N,24165,20789,N,N,N,N,
+N,20790,20791,29235,N,N,N,N,N,N,26974,N,N,N,N,N,28755,29236,N,N,28756,19300,
+31572,30054,25450,N,24166,N,N,N,N,24404,N,N,30841,N,N,N,N,28718,N,N,N,N,N,N,N,
+N,N,N,N,N,20792,N,N,N,N,22111,N,20567,N,N,N,N,N,N,N,N,N,N,N,31777,28526,23640,
+N,26975,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25949,32123,N,N,24649,N,N,N,
+22089,N,N,21546,N,25932,N,N,N,N,N,26976,N,N,N,20568,31778,21566,25139,24167,N,
+N,N,N,N,N,N,23612,21046,30037,N,N,N,N,N,20001,29993,N,N,23929,N,N,23930,N,N,N,
+N,N,N,28757,N,N,N,N,30303,N,29274,25707,N,29297,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,27705,32124,N,N,N,N,24874,N,N,19033,N,N,28527,N,29994,N,N,N,N,N,N,27769,N,
+N,30765,N,29250,30275,N,22354,N,N,31010,28758,N,N,N,N,N,N,N,N,N,N,N,N,N,28794,
+N,N,30304,N,N,N,N,26995,29251,N,N,N,21547,18995,19750,N,19779,19802,N,N,N,N,N,
+22863,N,N,30276,N,N,N,28253,26436,N,N,N,N,N,N,N,N,25140,N,N,N,N,N,N,N,N,N,
+24418,26459,N,N,N,N,N,N,26673,N,31790,N,N,N,N,25933,N,N,N,31339,N,20284,N,N,
+20322,19830,N,N,28528,N,29758,N,21581,N,N,29496,N,N,N,26913,N,N,N,N,N,N,N,N,N,
+29298,29547,N,28759,N,N,20311,N,N,N,N,N,N,20319,N,N,N,N,N,N,N,N,N,26688,26689,
+N,N,N,20323,26914,N,N,N,N,N,N,N,N,N,N,20522,N,N,N,N,N,N,N,N,N,29505,20523,N,
+21604,N,N,28476,22561,N,N,N,N,N,N,N,N,N,N,N,22879,N,29527,N,N,N,23613,N,19557,
+28017,N,N,29026,N,21595,N,N,N,N,25141,N,N,19046,N,21294,N,N,N,N,N,N,19558,N,N,
+29011,30055,N,N,N,N,19034,31598,N,24901,N,N,N,N,N,N,N,24425,N,28254,N,N,30530,
+N,22562,N,N,N,N,N,23852,N,N,N,N,N,28719,22077,N,N,N,N,N,N,N,N,N,N,N,24875,N,N,
+N,N,N,N,N,N,N,N,N,N,31030,N,N,21621,N,20553,28455,25196,N,23402,20044,30056,
+30549,N,21325,N,29566,N,N,N,N,N,N,N,N,N,20533,N,N,N,N,N,N,N,N,N,N,N,24702,N,
+24443,N,N,N,N,N,N,26205,N,N,N,N,N,N,N,26660,N,N,N,N,N,N,N,N,N,19277,N,N,N,
+28456,N,N,N,28212,N,N,N,N,23128,20793,N,24361,N,N,29488,N,N,19524,N,N,N,20023,
+N,N,N,N,N,N,N,N,N,N,N,28457,N,N,N,24405,N,N,27991,N,N,N,28230,N,N,N,N,N,N,N,
+28477,31830,N,N,23412,N,28458,30777,N,30057,N,N,N,N,N,N,N,N,25433,N,N,N,N,N,N,
+N,N,N,N,N,N,N,24902,N,N,N,21567,N,N,N,N,24168,28778,N,N,N,N,N,N,N,N,N,N,29506,
+N,N,N,N,N,N,N,N,N,N,N,21295,N,N,19035,N,N,N,N,N,31831,N,N,27992,24903,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,29784,22067,23853,N,N,N,21822,N,N,N,N,N,N,N,N,28995,
+28255,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22123,N,N,N,29785,N,N,N,N,N,N,N,
+22374,N,N,N,N,N,N,23095,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,23931,N,N,N,N,N,23887,N,
+N,N,N,N,N,N,N,22563,N,N,23129,N,28760,28484,N,N,N,N,N,N,24920,N,N,N,N,N,29012,
+N,28018,N,N,N,N,N,N,21851,N,N,21852,29508,19287,N,N,N,N,N,25142,N,N,N,N,28529,
+N,N,N,N,N,N,N,N,N,N,N,31573,N,N,N,N,N,N,N,N,N,N,N,21336,N,N,N,N,N,N,N,23888,
+28761,19251,N,N,N,N,N,N,21853,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19751,N,N,
+20524,20794,N,28996,N,25907,31605,26977,32096,31804,N,23074,23075,N,21025,N,N,
+21103,N,N,N,25197,N,N,24169,20060,29237,20580,23889,N,N,N,N,24904,23351,24419,
+N,N,N,N,N,N,N,N,27961,28997,N,29519,22315,24876,N,N,25451,N,28231,N,N,N,24905,
+19066,N,N,N,N,N,N,N,28795,31329,28762,19559,23156,N,N,N,N,N,N,N,N,N,19519,N,N,
+N,N,N,N,N,N,N,N,N,N,N,20077,N,N,21801,31330,N,N,N,20581,N,27478,N,27743,N,N,N,
+24444,N,N,30550,24170,19252,N,N,28478,N,N,19509,N,N,N,N,N,20285,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,28530,25143,N,N,N,19560,N,N,N,N,N,N,N,N,28796,N,N,N,22112,N,
+28998,N,N,N,N,N,N,N,N,N,25144,27435,N,N,N,19253,22609,N,29774,29559,N,N,22342,
+N,20795,30506,N,27978,22355,22650,N,N,N,N,N,N,N,30277,N,N,20812,23932,N,N,N,N,
+N,N,N,N,N,N,24445,N,31077,N,24650,N,N,29309,21296,N,29811,23113,N,26206,N,N,N,
+N,30778,26704,N,N,22651,N,N,27221,N,N,N,N,22051,N,N,N,N,N,N,30278,29275,25724,
+N,N,N,N,N,N,N,N,N,N,26674,N,N,N,N,N,23130,N,29276,31574,26930,N,28205,N,31331,
+N,N,N,N,N,N,N,23662,N,N,30058,26208,N,28797,N,N,N,N,N,22316,N,N,N,N,N,30021,
+28256,N,N,23397,N,23902,N,N,22896,26915,N,N,N,N,N,N,N,N,N,N,29049,N,29252,
+24651,N,N,N,N,N,N,N,N,26916,N,N,25145,N,N,N,N,N,N,N,25393,31851,19752,N,19510,
+N,N,28763,N,N,N,N,N,N,N,N,26170,N,N,19753,N,N,N,N,N,29507,N,N,N,N,N,N,N,N,N,
+24921,N,N,28459,N,N,N,26437,N,N,24681,N,29509,N,N,21568,21823,23854,N,31100,N,
+19520,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25890,N,N,N,20024,N,N,N,22610,31062,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28970,20049,N,N,30279,N,23403,N,24446,N,
+N,22625,N,30579,N,22375,N,N,N,N,N,N,N,N,N,N,N,21630,N,N,20796,N,25935,N,19254,
+N,23096,N,N,N,N,N,19780,N,N,N,N,N,22078,N,N,N,25146,N,N,N,N,N,20312,N,N,N,
+24652,27513,N,N,N,N,N,N,N,N,32125,N,N,N,N,N,22376,19288,N,N,N,26978,N,N,N,
+26682,N,N,N,25415,N,N,N,N,27725,N,27726,N,22079,N,N,N,25383,N,24406,32104,N,N,
+N,N,N,N,N,N,N,28257,30248,23933,N,N,N,N,N,N,N,30779,N,26705,N,N,N,N,31063,N,N,
+N,N,N,N,N,N,20078,N,N,27727,26917,22101,N,19781,N,27962,20797,N,N,20286,N,N,
+27707,N,N,N,21041,N,N,N,N,19561,N,22852,27004,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,20798,N,N,N,N,N,27708,N,N,25901,N,N,N,N,N,N,30512,N,19562,N,N,N,21316,
+N,N,22080,N,N,N,22141,N,N,N,N,N,N,N,N,N,N,N,24865,N,24125,N,30249,N,N,N,23076,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22052,30022,N,24866,26950,N,N,N,29253,N,N,N,N,
+N,29801,22124,27475,N,N,N,N,27709,25180,24171,28764,N,27455,N,22350,20799,N,N,
+N,N,N,N,N,N,N,29995,N,N,N,N,31101,N,19036,N,N,N,19782,29238,N,N,23934,N,N,N,
+19511,23352,N,N,N,N,20585,N,20061,27456,N,32034,N,N,N,N,N,30795,N,N,N,N,N,N,N,
+N,27222,28976,N,N,N,N,N,N,N,23374,N,30531,N,N,N,N,N,N,N,N,N,N,N,23375,19236,N,
+N,30816,N,N,31575,N,N,27466,24609,N,N,N,N,N,N,N,N,N,N,N,20045,N,N,21596,N,N,N,
+32088,N,N,N,N,21110,29239,N,N,31350,30250,31351,22630,N,29745,N,N,N,N,N,N,N,N,
+N,N,N,N,N,26706,N,19013,19563,N,N,N,N,N,N,N,25198,N,N,N,N,N,25147,N,30509,N,N,
+N,30817,N,N,N,N,N,N,N,N,N,29548,N,N,N,N,24097,N,N,N,N,N,N,N,N,N,N,N,N,25725,N,
+N,25452,N,23855,23856,N,N,19255,26707,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24867,
+21088,N,N,N,N,28798,N,N,N,N,26918,19314,N,N,N,N,N,N,28019,23641,24653,N,N,N,N,
+30554,23353,N,N,N,N,N,N,N,19502,N,23131,N,N,N,N,19783,N,N,N,N,N,N,N,N,N,N,
+23857,N,22575,25379,N,N,20079,N,N,29299,N,N,N,N,30771,N,N,N,N,N,N,N,N,N,N,
+24654,N,30077,N,N,N,N,27500,N,N,21317,31852,21083,21611,N,24098,N,N,N,25958,N,
+N,N,N,N,N,28720,N,N,N,N,N,N,N,N,N,N,21828,N,N,N,N,N,N,28020,N,N,N,25453,N,
+26690,N,28021,22396,N,27963,N,N,30251,N,N,N,N,N,29240,30280,N,N,N,N,N,21350,
+29277,20287,N,27436,20288,N,26152,32105,N,20289,N,24671,24172,N,N,N,N,24610,N,
+N,N,N,N,N,N,N,29759,25199,N,22897,28999,N,19256,N,N,N,N,N,N,N,N,31102,23354,
+23157,N,N,N,N,N,N,N,N,30316,23132,31332,N,24655,N,N,N,N,N,N,23858,N,N,N,N,
+26153,N,28531,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29549,N,N,N,N,N,N,N,N,N,N,
+27514,N,31078,N,N,N,N,N,N,N,19037,21854,N,19038,24420,N,N,N,26237,N,29996,N,N,
+N,N,N,25717,N,N,N,N,N,N,N,N,N,N,N,N,26979,N,27979,20324,N,N,N,22611,N,N,N,N,N,
+N,23859,21612,N,N,29241,N,24375,N,N,N,N,N,19278,31576,N,N,20569,N,N,23890,
+30580,26460,25637,N,31779,N,23355,N,N,N,29242,27005,20554,N,30038,22853,25652,
+N,27943,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27197,26238,N,30532,29997,N,22880,N,
+N,N,18996,N,N,30818,20290,N,27710,N,N,N,25908,19784,28232,N,N,N,N,N,N,N,N,N,
+26440,N,N,N,N,N,N,N,N,N,N,N,19785,31031,29032,22898,23413,18997,22854,N,N,N,
+22601,N,N,N,N,N,N,N,N,N,N,N,N,N,22827,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27964,N,
+N,22612,N,N,N,23642,N,25148,N,N,31853,27744,21118,N,26951,26154,N,N,N,N,N,N,
+25200,N,N,N,N,N,N,31291,N,29998,31530,N,N,N,N,27771,N,27711,31832,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21605,N,N,N,31043,N,N,N,
+28258,N,N,N,N,N,N,N,N,N,N,N,N,N,22377,28022,N,N,N,24173,N,N,N,N,N,N,N,19564,N,
+25454,N,N,N,N,N,26708,N,N,N,31352,N,N,N,N,N,N,23860,25653,22576,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,22613,N,N,N,29802,N,N,N,20025,N,N,N,22113,20306,N,20534,N,
+N,N,N,N,N,20002,N,N,29550,N,N,N,N,N,29560,N,N,N,N,N,N,N,N,N,N,N,N,23628,N,
+20555,N,N,N,31780,19786,22356,24099,N,25696,N,N,N,N,28233,N,N,N,25181,30078,
+21548,N,N,N,N,N,21841,N,22640,30787,27223,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,30039,N,N,22591,N,N,N,N,32064,N,N,N,N,N,N,27437,N,N,N,N,21802,
+N,N,N,N,N,N,N,N,N,N,N,26408,N,N,N,N,N,N,N,N,N,N,N,N,N,28234,N,N,N,19047,N,N,N,
+N,N,30819,N,21597,N,N,27224,N,N,N,N,31577,28023,N,N,25909,N,N,N,N,N,20525,N,N,
+N,N,29041,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25149,N,N,N,25416,N,N,N,N,
+22869,N,N,24362,N,N,N,N,23356,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30820,N,N,N,N,N,
+29050,N,N,25910,29551,N,N,31578,24928,N,22828,N,30059,N,24630,N,N,26952,N,
+19279,N,25417,N,N,N,24174,N,N,N,N,N,N,N,N,25150,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,23663,N,22053,N,N,N,N,N,25201,N,N,N,N,N,N,N,22142,22817,N,22592,23643,N,N,
+27965,24376,N,27173,N,N,N,22317,N,N,29561,N,28024,N,30023,N,N,N,N,N,N,24906,
+27491,N,29278,N,N,N,N,N,N,N,N,N,N,N,N,N,30796,N,27225,N,21318,N,23398,N,N,N,N,
+N,29999,N,N,N,N,20080,N,N,N,N,27006,N,N,N,N,N,31542,N,N,N,N,N,N,N,N,N,25202,N,
+N,N,N,20338,30521,22899,N,N,24907,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+23133,N,N,23097,N,N,N,N,N,N,N,27515,N,19257,N,N,28025,N,N,N,N,N,N,24672,N,N,N,
+N,N,N,N,N,N,N,29760,N,32060,24369,25455,N,N,N,N,24611,32057,N,N,N,N,N,N,N,N,N,
+28721,N,N,N,N,N,N,19787,N,N,N,N,N,N,N,27966,N,N,N,21824,25456,28026,N,N,N,N,N,
+26980,N,N,N,N,N,N,21869,26461,N,N,N,N,N,N,21622,25911,N,N,N,23399,25151,N,N,N,
+N,N,N,N,N,N,N,N,N,28235,N,N,22388,28765,N,N,N,20011,26462,N,N,N,22102,24908,N,
+N,26675,N,N,N,N,N,N,N,N,N,N,N,25966,23586,N,N,24656,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,21813,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21793,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,31579,N,31051,N,N,N,19315,29733,N,N,N,N,N,31304,22103,N,26981,31580,N,N,
+N,N,N,N,N,32080,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31606,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,23077,N,23357,N,N,N,N,N,N,27746,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19831,
+28766,N,N,N,N,30281,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+24175,N,N,N,21297,N,N,N,N,N,N,N,N,31854,N,N,N,N,26691,N,29000,N,N,N,20081,N,N,
+N,N,31085,N,N,N,N,N,N,N,N,29300,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25654,30009,N,
+23664,25457,N,N,N,N,26661,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29243,N,24100,N,23116,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,19049,N,N,N,N,N,N,25434,N,31833,N,N,N,N,N,N,N,27226,N,N,N,
+N,N,N,31044,N,25380,N,N,N,N,N,N,N,N,N,N,N,31581,N,28490,N,26692,N,N,N,N,N,N,N,
+N,N,21836,N,N,N,N,N,N,N,N,N,N,27479,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22829,N,
+N,31531,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21337,N,N,N,N,N,N,21794,N,N,N,N,N,N,N,
+N,N,30302,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,23158,N,N,N,N,
+N,N,N,N,N,N,N,24657,N,N,26920,N,N,30073,N,N,N,N,N,N,31279,N,27516,N,N,24682,
+25394,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,21829,N,N,29027,21870,
+N,N,N,N,N,N,N,N,N,N,N,N,N,19788,N,N,N,N,27993,N,N,N,N,22593,N,N,N,N,31340,N,N,
+N,N,N,29035,N,N,N,N,N,31292,26210,N,N,N,N,31333,25210,N,N,N,18998,N,25655,N,
+27227,N,30074,N,N,N,31532,20291,27517,N,N,N,N,30842,N,N,24377,N,N,N,N,24945,N,
+21028,N,N,N,N,30075,N,N,N,N,N,N,20570,20571,N,27198,22833,N,N,N,N,N,18999,N,N,
+21351,N,30821,N,N,N,N,21298,N,N,N,25152,29279,N,N,N,N,N,N,19813,N,N,N,N,N,N,N,
+N,N,N,N,N,31020,N,N,N,N,N,N,N,N,19789,N,N,N,N,N,N,N,N,N,N,N,N,28206,22062,N,N,
+N,N,N,N,N,N,N,N,N,N,22378,N,N,N,N,26464,27438,N,N,N,20313,N,N,23629,28027,N,
+24176,N,22379,N,N,N,N,N,N,24101,N,N,N,N,N,N,N,N,N,N,24407,23376,23377,N,N,
+21795,N,N,N,N,28722,23644,N,N,N,N,N,N,N,N,19048,N,30822,23630,N,N,N,N,27228,
+23378,N,N,N,N,N,N,N,N,N,N,N,26931,N,N,N,N,30555,N,N,N,N,N,N,N,N,N,N,N,25384,N,
+22318,N,N,24673,N,N,N,N,N,19258,N,N,25937,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,20572,N,N,N,N,21825,N,N,N,N,N,22602,N,N,N,N,N,N,N,25385,N,N,N,
+N,N,N,N,N,N,N,N,N,24612,N,26921,N,21319,N,N,23645,30766,N,N,N,19512,N,N,N,
+20526,N,N,N,22642,N,N,25418,N,N,N,N,N,N,N,N,N,N,19503,N,N,N,N,N,N,N,21549,
+30289,N,N,N,N,N,N,N,20556,N,N,N,N,N,N,N,19014,N,N,21826,N,N,20026,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,19015,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31280,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,24408,N,N,N,30010,25963,N,28532,23861,N,N,N,N,19754,N,
+25458,N,31607,N,30544,N,N,N,N,32058,N,N,32097,30334,20800,N,N,26693,N,25656,N,
+24936,N,N,N,19521,N,21101,N,N,N,N,23358,N,N,24674,N,N,N,31305,N,N,24909,N,
+19000,N,N,N,29280,29001,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24177,N,N,N,
+28767,30788,N,N,N,N,N,28236,N,N,24178,N,26441,N,25203,26465,N,N,25419,N,N,
+25420,N,N,N,20344,28460,N,32126,31781,31281,24409,N,24658,N,N,N,29786,N,N,N,N,
+N,N,N,N,N,N,N,29002,N,20003,N,N,N,N,29244,27747,N,N,N,N,N,24613,N,30507,N,N,
+27439,N,N,N,N,N,25950,N,24868,19755,N,22900,26662,19790,24937,N,31855,N,24675,
+N,N,N,N,N,25153,N,20004,N,N,N,N,N,N,24102,N,N,27518,N,27485,28768,N,N,29787,N,
+25204,N,N,21320,N,N,N,29803,N,28213,N,30040,N,N,21855,N,N,N,22117,N,N,N,N,
+27440,29795,N,N,N,N,25421,N,N,N,N,29812,31282,N,N,28533,19039,N,27441,27967,N,
+N,32073,N,N,N,N,25638,31012,28723,N,25964,N,N,N,20839,22855,25687,27229,N,
+21623,N,N,N,N,N,N,N,N,N,23098,N,23117,N,N,N,31052,N,24922,23359,N,19525,27728,
+19259,N,24179,N,N,26922,N,N,N,N,N,N,N,22856,N,N,28259,22333,N,N,N,N,N,N,20292,
+N,N,N,N,N,20557,N,N,N,N,N,N,N,31782,N,N,N,N,N,N,N,29051,N,N,N,N,32082,20801,N,
+N,N,N,N,N,N,N,25435,N,21321,N,23631,N,N,N,N,N,N,N,N,N,19565,N,N,N,N,N,24103,N,
+N,26171,27681,N,N,N,19513,N,N,31582,N,N,N,N,N,26466,N,N,21569,N,N,N,N,N,N,N,N,
+N,23592,N,N,N,N,N,25154,N,29528,25939,N,N,29529,N,N,N,29510,19803,N,N,N,N,N,N,
+N,19756,N,31811,N,N,N,N,21607,N,20802,N,31013,N,26709,N,N,N,N,N,N,N,N,25422,N,
+N,N,N,21578,N,N,N,N,N,N,24410,N,N,N,N,N,N,N,N,31583,26467,N,N,N,N,N,N,N,N,N,N,
+N,N,N,30843,25423,N,N,N,N,N,N,N,30000,N,N,N,N,N,N,N,22631,N,22857,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,30767,28534,N,23862,28207,19832,N,N,N,N,24120,31783,30588,
+30513,20027,29729,N,N,28237,24878,N,N,27715,20350,N,30783,22626,21352,N,N,
+24104,29796,27714,N,22901,31045,23891,22129,27772,31856,N,N,27968,19001,N,
+28260,N,N,N,N,N,N,29281,N,24121,N,N,N,N,N,N,22130,N,24180,N,24411,N,23379,N,
+31335,22627,29761,N,23863,N,N,N,29301,N,N,21550,N,N,N,N,N,N,22131,N,N,N,N,N,N,
+23864,20293,24415,29246,30241,N,27467,29052,N,29511,N,N,24683,N,N,N,N,N,28028,
+N,N,24923,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,28261,N,24181,N,N,N,N,31315,N,N,N,N,29003,N,N,20527,23865,N,N,20803,N,
+N,N,N,N,N,N,N,N,N,N,N,N,30001,N,N,N,N,27206,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28769,
+N,N,N,N,N,N,N,N,N,30252,N,N,N,N,30041,N,N,N,N,N,N,N,N,N,N,28779,N,N,N,N,N,N,
+23866,N,N,N,29247,N,N,N,N,N,N,N,30533,N,N,N,N,23330,29302,N,N,19002,N,N,N,N,N,
+N,N,N,N,N,N,30581,N,19301,N,N,N,28262,N,24659,N,N,N,N,20005,N,N,N,N,N,N,22104,
+N,N,N,21551,26953,N,N,N,N,21326,29762,N,N,N,N,N,N,N,N,N,N,N,N,N,19302,N,N,N,N,
+N,N,N,N,N,N,N,28961,N,N,N,N,N,27442,N,N,N,N,28962,N,N,N,N,N,N,N,N,N,N,N,N,
+27443,N,28724,N,N,19316,21552,29490,31543,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30060,N,
+N,N,N,N,28263,29746,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30061,N,20339,N,N,N,
+N,N,N,N,N,N,N,28770,N,N,N,N,N,28238,N,N,29004,N,N,25912,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22389,25459,20325,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,20294,N,N,N,N,N,N,N,N,N,29491,25688,20345,20314,N,N,N,N,31309,N,N,
+N,N,N,N,N,N,N,N,N,N,26211,N,N,N,N,N,N,N,N,N,N,N,29282,N,N,N,N,N,N,N,N,N,N,N,N,
+30062,N,N,19003,N,N,25436,20082,N,22105,N,N,N,28208,N,N,N,N,N,N,N,N,29797,
+22594,23632,19566,N,N,N,N,N,21856,30282,32074,22614,29775,N,N,N,N,N,N,22054,
+23614,N,23380,22343,N,N,N,N,29310,N,N,N,29005,N,N,N,N,25155,23646,N,23647,N,N,
+28461,26155,N,N,N,N,31069,27199,N,N,N,28462,N,N,N,29776,20083,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,26156,N,20062,N,N,21881,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25460,
+19792,N,N,N,N,N,N,21816,N,N,30589,N,23593,N,N,N,N,24182,N,23594,29283,26932,
+21084,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,26982,N,N,25462,N,N,N,N,N,N,N,N,26442,N,N,
+20558,N,N,23159,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19004,N,N,N,28264,23134,N,
+29303,N,N,25211,N,19494,N,N,N,N,23099,N,28265,N,N,N,30042,30556,24938,20033,
+21553,N,32049,26173,N,31533,N,N,30823,N,24910,N,30562,30063,20295,N,N,21554,
+19567,N,21608,N,28239,30551,N,N,24614,22081,24924,28771,29028,23665,22055,N,N,
+N,N,N,N,N,N,N,N,29813,N,N,29006,29284,N,N,20528,N,N,27759,N,N,N,31034,N,27445,
+N,N,21613,25156,N,N,N,N,26983,N,N,27444,27169,N,30780,20006,N,31046,31834,N,
+21555,21305,27230,N,N,N,26923,N,N,24929,21327,29814,N,27200,24911,N,19514,N,N,
+N,N,N,28266,N,N,N,28772,29492,21614,N,N,29248,N,N,29029,N,29763,24660,N,27446,
+N,22305,19304,N,31021,26925,22628,31283,25157,31805,N,N,27716,22577,N,23595,N,
+N,N,N,21796,N,27497,N,N,N,26683,N,N,N,22615,N,N,N,N,N,N,N,N,31534,20833,N,N,
+23360,N,30014,N,24183,N,N,N,N,19067,30534,20296,N,N,N,24912,N,N,28240,N,N,N,N,
+N,N,N,N,26996,N,N,N,N,N,N,N,N,20084,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+21837,N,N,20315,N,N,N,N,N,N,23867,N,N,N,N,20012,N,N,N,N,N,N,N,26984,N,N,N,N,N,
+N,N,21556,25671,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,30043,N,N,31297,N,N,N,24105,N,N,
+N,N,N,N,N,N,N,N,N,N,N,21624,N,N,N,N,N,28535,N,N,N,N,21299,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,27447,28536,30044,27980,23381,29007,N,N,N,29008,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,30002,N,N,N,N,N,N,22830,21804,N,25158,N,N,N,N,N,N,N,N,
+32035,N,31589,24363,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25205,N,30253,N,30003,N,28725,
+N,N,N,N,24869,N,N,N,N,N,N,N,N,N,30045,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27682,28029,
+N,30004,31544,N,23331,N,N,22090,19289,N,N,N,N,N,N,N,N,N,N,25940,N,N,N,N,N,N,
+29562,N,27448,N,24631,22380,29036,25903,21857,22381,20817,N,N,N,N,N,24946,
+28537,N,N,N,23868,30300,N,N,N,N,N,28773,N,N,N,29764,N,N,26985,N,N,N,N,N,N,N,N,
+N,N,29563,21615,N,N,19490,30590,24380,N,N,N,N,27469,N,N,N,N,N,N,20535,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22082,N,N,N,N,N,26669,N,N,N,N,28463,19237,N,
+N,N,N,19305,N,N,N,31336,N,N,N,N,N,N,N,N,N,N,N,N,N,19526,N,N,N,26215,N,N,27207,
+N,N,N,23332,N,20297,25212,28538,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,27486,N,N,30024,N,21598,N,N,N,N,N,N,N,N,N,N,N,24661,N,28464,N,N,25159,N,
+22831,N,N,N,31079,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,26469,N,N,20298,
+24913,N,25160,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28539,N,N,31353,N,N,23666,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,24615,N,N,N,N,N,30824,N,N,N,N,N,N,N,N,N,N,N,N,
+N,19306,N,N,N,19260,22114,N,N,N,N,N,N,N,N,N,N,N,30046,N,N,N,N,N,N,N,30047,N,
+28214,N,N,N,25206,21322,28540,20804,28465,N,20805,N,20574,N,22881,N,N,24632,N,
+N,19793,29497,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,26444,N,22056,
+20007,N,21557,N,N,N,N,N,N,25672,N,N,N,N,N,N,21300,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,27449,N,N,N,N,N,N,19317,N,N,N,N,N,N,30301,N,28963,N,N,N,N,N,N,N,N,N,N,
+N,N,N,19527,N,N,N,N,N,N,N,26954,N,24944,N,N,N,30048,N,N,N,N,N,N,N,N,31535,N,N,
+N,19281,N,N,N,N,31584,29285,N,N,27760,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+28780,N,N,N,N,N,N,N,N,N,N,N,N,N,28267,N,N,N,N,N,N,N,N,N,N,N,N,26955,N,N,19568,
+N,N,22319,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29473,31861,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,28964,N,N,N,N,N,N,N,N,N,N,N,N,24662,N,N,N,N,N,28466,N,N,N,N,N,
+N,N,N,N,29777,N,N,30497,N,N,N,N,N,N,N,N,N,N,N,29009,N,N,N,N,N,N,N,N,N,N,N,N,
+19068,19069,N,N,N,N,N,N,N,N,20046,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,29512,N,29498,28030,N,N,N,N,N,N,N,N,23078,N,N,24684,N,N,
+N,N,N,30797,N,19282,N,N,N,27470,N,31064,31065,19040,23114,N,N,N,19238,N,N,N,N,
+N,N,N,N,N,N,19016,31086,23404,N,N,20529,N,N,N,N,21871,N,N,N,26227,N,N,N,N,N,N,
+N,N,N,26402,25689,N,N,N,N,N,N,N,N,N,N,25697,N,N,31812,N,N,N,N,N,N,N,N,N,31087,
+20340,30566,N,N,N,N,N,20028,N,N,N,N,29765,23587,23869,N,N,N,N,29766,N,N,N,N,N,
+N,N,N,30753,N,N,N,26710,N,N,N,23361,N,N,N,N,N,N,N,N,28774,N,N,N,25657,30317,N,
+31022,N,23870,N,N,N,N,N,N,22320,22632,19261,N,N,31066,N,N,N,N,N,N,N,N,N,N,
+30798,31088,24685,25395,29747,N,N,27202,29286,28726,N,N,N,N,N,23382,N,N,N,N,N,
+27492,N,N,29287,N,22357,21558,31080,22337,N,N,N,N,25941,N,N,N,N,N,N,N,26986,
+22348,N,N,N,21353,25161,N,31835,19757,N,N,N,N,N,19504,27170,N,N,25718,20544,N,
+28727,28193,N,N,N,N,N,N,22390,N,N,N,25162,25163,N,31311,N,N,N,N,N,N,27487,N,N,
+N,N,N,22091,N,N,N,29748,N,N,N,N,27981,25682,N,N,27177,25658,29474,19794,N,
+30283,N,29030,27969,26684,28241,N,N,N,N,N,N,28775,25164,N,N,25642,N,30049,
+27994,N,N,N,N,N,22382,20849,N,N,N,N,26987,26988,24676,N,N,N,N,23079,23892,N,
+27171,N,N,N,22083,22132,N,23135,N,28467,25165,N,N,N,N,N,28541,29288,N,N,N,N,N,
+N,N,N,N,28485,N,26471,N,N,22397,N,N,26446,N,N,24412,N,31047,N,N,N,N,N,N,N,N,
+22902,N,N,N,N,N,N,N,N,24364,N,22106,N,N,N,N,N,N,23588,N,N,N,28728,N,N,N,N,
+21882,N,25719,N,N,N,22084,N,N,N,N,N,N,N,N,29804,N,N,N,N,28542,N,N,N,N,N,28705,
+N,24106,N,N,23100,22652,N,N,N,N,N,N,31316,N,N,N,27749,N,N,N,N,N,N,31784,N,N,
+27750,N,N,22603,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31545,N,25683,N,19833,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,20307,N,N,N,N,N,N,N,19050,N,N,20308,N,30781,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29767,N,N,N,N,27231,N,N,N,N,N,N,N,31067,
+N,N,N,N,N,N,N,N,21559,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27493,N,N,
+24914,N,N,N,N,27172,N,N,N,31298,31585,31341,28706,19569,N,31267,25207,N,25166,
+N,26997,N,24939,N,N,N,26472,26711,23160,21579,N,N,N,30582,22085,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,21609,N,N,31354,N,N,N,N,N,N,N,19570,30557,N,24122,N,
+N,N,N,N,N,N,N,N,N,20008,N,N,N,N,N,28729,25726,25673,N,N,N,N,N,25684,N,N,N,
+27203,N,28468,N,N,N,22334,N,N,N,N,N,N,31586,N,19795,N,N,N,28469,N,N,N,31337,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31014,N,N,N,N,N,N,24381,N,30535,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,30845,N,N,30844,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+24107,23400,N,N,25437,N,24930,20806,N,N,N,N,N,N,N,N,N,N,30288,27494,23161,N,N,
+N,N,27719,N,N,N,N,N,N,N,24184,30825,25438,20085,N,N,N,N,N,31299,25943,N,27720,
+N,N,N,29513,N,N,25659,N,N,N,N,26158,N,N,N,N,N,28470,N,23615,N,N,N,N,N,N,N,
+20029,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22595,N,N,N,
+20559,N,20346,29514,24663,N,N,N,20807,26926,N,26685,N,N,31300,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25167,N,N,31301,N,N,N,31032,N,N,N,N,N,N,N,23648,
+N,N,31536,N,N,N,22569,25951,31015,N,N,30318,N,30284,25208,N,N,N,N,27761,N,N,N,
+N,N,N,N,23136,N,N,N,N,N,N,N,N,N,N,N,N,N,N,29010,21068,20299,N,N,19005,N,N,N,
+23871,N,N,N,30319,N,24185,N,N,N,N,N,N,N,N,N,N,N,N,N,31284,N,N,N,21805,N,N,N,N,
+N,N,N,N,N,N,N,N,N,29031,24126,N,N,N,N,N,N,23616,N,N,N,N,N,20808,20809,N,N,N,N,
+N,N,N,N,N,30782,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19318,N,N,N,N,21625,N,N,N,N,
+N,30050,24915,N,N,N,N,N,N,N,N,22633,N,N,30846,N,20300,N,N,N,N,N,N,N,32036,N,N,
+N,N,N,N,N,20086,N,31312,N,N,19571,26174,N,N,N,30254,N,N,21872,N,N,20810,N,N,N,
+31806,21873,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19817,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,31285,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,25168,
+29815,N,N,N,19796,N,N,N,N,N,N,N,N,N,N,N,N,26403,N,N,N,N,N,N,N,N,23333,25169,N,
+N,N,N,N,N,N,N,N,N,N,N,22306,N,N,30563,N,N,N,N,N,N,27174,N,N,N,N,N,N,N,N,N,N,
+20513,N,N,N,N,20058,31595,23334,23390,22629,N,N,N,N,N,N,N,N,N,27232,N,N,N,N,
+22570,N,N,N,N,N,25952,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22107,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28486,N,N,30826,N,N,N,N,N,N,
+N,N,N,N,N,N,N,25685,N,N,N,N,N,N,N,N,N,N,N,20087,N,N,24664,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22383,N,N,N,N,N,N,N,N,N,N,N,N,29805,N,N,N,N,N,
+N,N,N,N,N,N,N,N,19814,N,N,N,19572,30051,N,N,25674,N,23649,N,N,31048,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,31807,N,N,N,N,N,N,N,N,N,N,N,N,26663,N,N,N,N,N,N,N,N,22596,
+N,N,N,N,N,N,N,N,N,N,N,19262,N,23598,N,N,N,N,N,N,N,N,N,N,N,N,N,22391,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28776,N,23872,N,20301,N,N,N,N,N,N,N,N,N,
+23667,22832,N,26217,25660,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,27204,N,N,N,N,N,N,
+N,N,N,N,25708,N,25701,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,31608,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,19515,N,N,N,N,N,N,N,N,N,N,N,25661,N,N,19804,22903,
+N,N,N,N,N,N,N,N,N,N,23903,N,N,N,N,N,27982,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22864,
+N,N,N,N,N,25891,N,N,N,N,31053,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,19758,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,20302,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,30255,N,N,N,N,N,32083,27501,22108,25892,N,N,N,21814,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22109,
+N,N,N,31081,N,N,N,26404,N,22115,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,20811,
+22116,N,N,N,21874,N,N,N,N,N,24186,N,22392,N,N,N,N,N,22634,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,20309,22653,N,N,N,N,N,22571,N,N,32075,N,N,N,N,31836,N,N,N,N,N,N,N,N,N,
+24616,21875,N,N,32089,N,N,19491,N,N,N,22905,N,N,21354,30069,N,28487,N,N,N,N,N,
+N,N,N,N,21338,N,N,N,N,N,N,N,N,N,N,N,23101,26664,23599,N,N,N,N,N,28707,N,N,N,N,
+19797,N,N,N,N,N,N,N,N,N,N,N,N,24617,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,24108,N,N,N,N,N,N,N,N,N,N,N,N,N,N,28730,28209,N,N,28210,N,N,N,30285,
+N,N,N,N,N,N,N,N,N,N,N,N,28242,N,22086,N,N,N,N,N,24677,N,N,29499,N,25953,N,N,N,
+N,N,N,N,N,N,N,25675,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,22307,N,N,23362,
+N,N,N,N,19070,N,N,N,N,N,N,20303,12321,12322,33089,33090,12323,33091,33092,
+12324,12325,12326,12327,33093,33094,33095,33096,33097,12328,12329,12330,12331,
+12332,12333,12334,12335,33098,12336,12337,12338,12339,12340,33099,33100,12341,
+33101,33102,33103,12342,33104,33105,33106,33107,33108,33109,33110,12343,12344,
+33111,12345,12346,12347,33112,33113,33114,33121,33122,33123,12348,12349,33124,
+33125,12350,33126,33127,33128,12351,33129,33130,33131,33132,33133,33134,33135,
+33136,33137,33138,12352,33139,12353,33140,33141,33142,33143,33144,33145,12354,
+33146,33153,33154,12355,33155,33156,33157,12356,33158,33159,33160,33161,33162,
+33163,33164,33165,33166,33167,33168,33169,33170,33171,33172,33173,33174,33175,
+33176,12357,12358,33177,33178,12359,33179,33180,12360,12361,33181,12362,33182,
+33183,33184,33185,33186,12363,12364,33187,12365,12366,12367,12368,33188,33189,
+12369,12370,12371,12372,33190,33191,33192,12373,33193,33194,33195,12374,33196,
+33197,33198,33199,33200,33201,33202,12375,12376,33203,12377,12378,12379,33204,
+33205,33206,33207,33208,33209,12380,12381,12382,33210,12383,33211,33212,12384,
+12385,33213,33214,33215,33216,33217,33218,33219,12386,12387,33220,12388,12389,
+12390,33221,33222,33223,12391,33224,33225,12392,33226,33227,33228,12393,33229,
+33230,33231,12394,33232,33233,33234,33235,33236,33237,33238,33239,12395,33240,
+12396,33241,33242,33243,33244,33245,33246,33247,33248,12397,12398,33249,33250,
+12399,33251,33252,12400,12401,33253,12402,33254,12403,33255,33256,12404,12405,
+12406,33257,12407,33258,12408,12409,33259,33260,33261,33262,33263,12410,12411,
+33264,33265,12412,33266,33267,33268,12413,33269,12414,33270,33271,33272,33273,
+33274,12577,12578,33275,12579,33276,12580,33277,33278,33345,33346,33347,33348,
+12581,33349,33350,33351,12582,33352,33353,33354,12583,33355,33356,33357,33358,
+33359,33360,33361,33362,12584,33363,33364,12585,12586,33365,33366,33367,33368,
+33369,33370,12587,12588,33377,33378,12589,33379,33380,33381,12590,33382,33383,
+33384,33385,33386,33387,33388,12591,12592,33389,12593,33390,12594,33391,33392,
+33393,33394,33395,33396,12595,33397,33398,33399,12596,33400,33401,33402,12597,
+33409,33410,33411,33412,33413,33414,33415,33416,12598,33417,12599,33418,33419,
+33420,33421,33422,33423,33424,33425,12600,12601,33426,33427,12602,33428,33429,
+12603,12604,12605,12606,33430,33431,33432,33433,12607,12608,12609,33434,12610,
+33435,12611,12612,33436,33437,33438,33439,33440,12613,12614,33441,33442,12615,
+33443,33444,33445,12616,33446,33447,33448,33449,33450,33451,33452,33453,33454,
+33455,33456,12617,12618,33457,33458,33459,33460,33461,33462,12619,33463,33464,
+33465,33466,33467,33468,33469,33470,33471,33472,33473,33474,33475,33476,33477,
+33478,33479,33480,12620,33481,33482,33483,33484,33485,33486,33487,33488,12621,
+12622,33489,33490,12623,33491,33492,33493,12624,33494,33495,33496,33497,33498,
+33499,33500,12625,12626,33501,12627,33502,33503,33504,33505,33506,33507,33508,
+33509,12628,33510,33511,33512,12629,33513,33514,33515,12630,33516,33517,33518,
+33519,33520,33521,33522,33523,33524,33525,33526,33527,33528,33529,33530,33531,
+33532,33533,33534,12631,12632,33601,33602,12633,33603,33604,12634,12635,12636,
+33605,33606,33607,33608,33609,33610,12637,12638,33611,12639,33612,12640,33613,
+33614,33615,33616,33617,33618,12641,33619,33620,33621,33622,33623,33624,33625,
+33626,33633,33634,33635,33636,33637,33638,33639,33640,33641,33642,33643,33644,
+33645,33646,33647,33648,33649,33650,33651,12642,12643,33652,33653,12644,33654,
+33655,12645,12646,33656,12647,33657,33658,33665,33666,33667,12648,12649,33668,
+12650,33669,12651,12652,33670,33671,33672,12653,33673,12654,12655,12656,33674,
+12657,33675,33676,33677,12658,33678,12659,33679,33680,33681,33682,33683,12660,
+12661,33684,12662,12663,12664,33685,33686,33687,12665,33688,33689,12666,12667,
+33690,33691,12668,33692,33693,33694,12669,33695,33696,33697,33698,33699,33700,
+33701,12670,12833,33702,12834,12835,12836,33703,33704,33705,33706,33707,33708,
+12837,12838,33709,33710,33711,33712,33713,33714,12839,33715,33716,33717,33718,
+33719,33720,33721,33722,33723,33724,33725,33726,33727,33728,33729,33730,33731,
+33732,33733,33734,33735,33736,33737,33738,33739,33740,33741,33742,33743,33744,
+33745,33746,33747,33748,33749,33750,33751,33752,33753,33754,33755,33756,33757,
+33758,33759,33760,33761,12840,12841,12842,33762,12843,33763,33764,33765,12844,
+33766,33767,33768,33769,33770,33771,33772,12845,12846,33773,12847,12848,12849,
+33774,33775,33776,33777,33778,33779,12850,12851,33780,33781,12852,33782,33783,
+33784,33785,33786,33787,33788,33789,33790,33857,33858,12853,33859,33860,12854,
+33861,12855,33862,33863,33864,33865,33866,33867,12856,33868,33869,33870,12857,
+33871,33872,33873,12858,33874,33875,33876,33877,33878,33879,33880,33881,33882,
+33889,12859,12860,33890,33891,33892,33893,12861,33894,33895,12862,33896,33897,
+33898,33899,33900,33901,33902,33903,33904,33905,33906,33907,33908,33909,33910,
+33911,33912,33913,33914,33921,33922,33923,33924,33925,33926,33927,33928,12863,
+12864,33929,33930,12865,33931,12866,33932,12867,33933,33934,33935,33936,33937,
+33938,33939,12868,12869,33940,12870,33941,12871,12872,12873,33942,33943,33944,
+33945,12874,12875,33946,33947,33948,33949,33950,33951,12876,33952,33953,33954,
+33955,33956,33957,33958,33959,33960,33961,33962,12877,12878,33963,33964,33965,
+33966,33967,33968,12879,12880,33969,33970,33971,33972,33973,33974,33975,33976,
+33977,33978,33979,33980,33981,33982,33983,33984,33985,33986,33987,12881,33988,
+33989,33990,33991,33992,33993,12882,33994,33995,33996,12883,33997,33998,33999,
+12884,34000,34001,34002,34003,34004,34005,34006,12885,12886,34007,34008,34009,
+12887,34010,34011,34012,34013,34014,34015,12888,34016,34017,34018,34019,34020,
+34021,34022,34023,34024,34025,34026,34027,34028,34029,34030,34031,34032,34033,
+34034,34035,34036,34037,34038,34039,34040,34041,34042,12889,12890,34043,34044,
+12891,34045,34046,34113,12892,34114,34115,34116,34117,34118,34119,12893,12894,
+12895,34120,12896,34121,12897,12898,34122,34123,34124,34125,34126,12899,34127,
+34128,34129,34130,34131,34132,34133,12900,34134,34135,34136,34137,34138,34145,
+34146,34147,34148,34149,34150,12901,12902,34151,34152,34153,34154,34155,34156,
+12903,12904,34157,34158,12905,34159,34160,34161,12906,34162,34163,34164,34165,
+34166,34167,34168,12907,12908,34169,34170,12909,34177,34178,34179,34180,34181,
+34182,34183,12910,34184,34185,34186,12911,34187,34188,34189,12912,34190,34191,
+34192,34193,34194,34195,34196,12913,12914,34197,34198,34199,34200,34201,34202,
+34203,34204,34205,34206,12915,34207,34208,34209,34210,34211,34212,34213,34214,
+34215,34216,34217,34218,34219,34220,34221,34222,34223,34224,34225,34226,34227,
+34228,34229,34230,34231,34232,34233,12916,12917,34234,34235,12918,34236,12919,
+34237,12920,34238,12921,34239,34240,34241,34242,12922,12923,12924,34243,12925,
+34244,12926,34245,34246,34247,13089,34248,34249,34250,34251,34252,34253,34254,
+34255,34256,34257,34258,34259,34260,34261,34262,34263,34264,34265,34266,34267,
+34268,34269,34270,34271,34272,34273,34274,34275,34276,34277,13090,13091,34278,
+34279,13092,34280,34281,34282,13093,34283,34284,34285,34286,34287,34288,34289,
+13094,13095,34290,13096,34291,13097,34292,34293,34294,34295,34296,34297,13098,
+13099,13100,34298,13101,34299,34300,13102,13103,13104,13105,34301,34302,34369,
+34370,34371,13106,13107,34372,13108,13109,13110,13111,13112,34373,13113,34374,
+13114,13115,13116,34375,34376,13117,34377,34378,34379,13118,34380,34381,34382,
+34383,34384,34385,34386,13119,13120,34387,13121,13122,13123,34388,34389,34390,
+34391,34392,34393,13124,13125,34394,34401,13126,34402,34403,34404,13127,34405,
+34406,34407,34408,34409,34410,34411,13128,34412,34413,34414,34415,13129,34416,
+34417,34418,34419,34420,34421,34422,34423,34424,34425,34426,34433,34434,34435,
+34436,34437,34438,34439,34440,34441,34442,34443,34444,34445,34446,34447,34448,
+34449,34450,34451,34452,34453,34454,34455,13130,13131,34456,13132,13133,34457,
+34458,34459,13134,34460,13135,13136,34461,34462,34463,34464,13137,13138,34465,
+13139,13140,13141,34466,34467,34468,34469,34470,13142,13143,13144,34471,34472,
+13145,34473,34474,34475,13146,34476,34477,34478,34479,34480,34481,34482,13147,
+13148,34483,13149,13150,13151,34484,34485,34486,34487,34488,34489,13152,13153,
+34490,34491,13154,34492,34493,34494,13155,34495,34496,34497,34498,34499,34500,
+34501,13156,13157,34502,34503,13158,13159,34504,34505,13160,34506,34507,34508,
+13161,34509,34510,34511,13162,34512,34513,34514,34515,34516,34517,34518,34519,
+34520,34521,34522,34523,34524,34525,34526,34527,34528,34529,34530,34531,34532,
+34533,34534,13163,13164,34535,34536,13165,34537,34538,34539,13166,34540,13167,
+34541,34542,34543,34544,34545,13168,13169,34546,13170,34547,13171,34548,34549,
+34550,34551,13172,13173,13174,34552,34553,34554,13175,34555,34556,34557,13176,
+34558,34625,34626,34627,34628,34629,34630,34631,34632,34633,34634,13177,34635,
+34636,34637,34638,34639,34640,34641,34642,34643,34644,34645,34646,34647,34648,
+34649,34650,34657,34658,34659,34660,34661,34662,34663,34664,34665,34666,34667,
+34668,34669,34670,34671,34672,34673,34674,34675,13178,34676,34677,34678,13179,
+34679,34680,34681,13180,34682,34689,34690,34691,34692,34693,34694,13181,13182,
+34695,13345,34696,34697,34698,34699,34700,34701,34702,34703,13346,13347,34704,
+34705,13348,34706,34707,34708,13349,34709,34710,34711,34712,34713,34714,34715,
+34716,13350,34717,13351,34718,13352,34719,34720,34721,34722,34723,34724,13353,
+13354,34725,34726,13355,34727,34728,13356,13357,34729,34730,34731,34732,34733,
+34734,34735,13358,13359,34736,13360,34737,13361,34738,34739,34740,34741,34742,
+34743,13362,34744,34745,34746,34747,34748,34749,34750,34751,34752,34753,34754,
+34755,34756,34757,34758,34759,34760,34761,34762,13363,34763,34764,34765,34766,
+34767,34768,34769,13364,34770,34771,34772,34773,34774,34775,34776,34777,34778,
+34779,34780,34781,34782,34783,34784,34785,34786,34787,34788,34789,34790,34791,
+34792,34793,34794,34795,34796,13365,34797,34798,34799,13366,34800,34801,34802,
+13367,34803,34804,34805,34806,34807,34808,34809,13368,13369,34810,34811,34812,
+34813,34814,34881,34882,34883,34884,34885,13370,13371,34886,34887,34888,34889,
+34890,34891,13372,34892,34893,34894,34895,34896,34897,34898,13373,13374,34899,
+34900,34901,13375,34902,34903,34904,34905,34906,34913,13376,13377,34914,34915,
+13378,34916,34917,34918,13379,13380,13381,34919,34920,34921,34922,34923,13382,
+13383,34924,13384,34925,13385,13386,34926,34927,34928,13387,34929,13388,34930,
+34931,34932,13389,34933,34934,34935,13390,34936,34937,34938,34945,34946,34947,
+34948,34949,34950,34951,34952,34953,34954,34955,34956,34957,34958,34959,34960,
+13391,13392,34961,34962,13393,34963,34964,34965,13394,34966,13395,34967,34968,
+34969,34970,34971,13396,13397,34972,13398,34973,13399,34974,34975,34976,34977,
+13400,34978,13401,13402,13403,34979,13404,34980,34981,13405,13406,13407,13408,
+13409,34982,34983,34984,13410,13411,13412,34985,13413,13414,13415,13416,13417,
+34986,34987,34988,13418,13419,13420,34989,34990,13421,34991,34992,34993,13422,
+34994,34995,34996,34997,34998,34999,35000,13423,13424,35001,13425,13426,13427,
+35002,35003,35004,35005,35006,35007,13428,35008,35009,35010,35011,35012,35013,
+35014,35015,35016,35017,35018,35019,35020,35021,35022,35023,35024,35025,35026,
+35027,35028,35029,35030,35031,35032,35033,35034,35035,35036,35037,35038,35039,
+35040,35041,35042,35043,35044,35045,35046,35047,35048,35049,35050,35051,35052,
+35053,35054,35055,35056,35057,35058,35059,35060,35061,35062,13429,13430,13431,
+35063,13432,35064,35065,13433,13434,35066,13435,13436,35067,35068,35069,35070,
+13437,13438,35137,13601,35138,13602,35139,13603,35140,35141,13604,35142,13605,
+13606,35143,35144,13607,35145,35146,35147,13608,35148,35149,35150,35151,35152,
+35153,35154,13609,13610,35155,13611,13612,13613,35156,35157,35158,35159,35160,
+35161,13614,35162,35169,35170,13615,35171,35172,35173,13616,35174,35175,35176,
+35177,35178,35179,35180,35181,35182,35183,35184,13617,13618,35185,35186,35187,
+35188,35189,35190,13619,35191,35192,35193,13620,35194,35201,35202,35203,35204,
+35205,35206,35207,35208,35209,35210,35211,35212,35213,35214,35215,35216,35217,
+35218,35219,35220,35221,35222,13621,13622,35223,35224,13623,35225,35226,13624,
+13625,35227,13626,35228,13627,35229,35230,35231,13628,13629,35232,13630,35233,
+13631,35234,13632,35235,13633,35236,35237,13634,35238,35239,35240,13635,35241,
+35242,35243,13636,35244,35245,35246,35247,35248,35249,35250,35251,35252,35253,
+35254,35255,35256,35257,35258,35259,35260,35261,35262,13637,35263,35264,35265,
+35266,35267,35268,35269,35270,35271,35272,35273,35274,35275,35276,35277,35278,
+35279,35280,35281,13638,35282,35283,35284,35285,35286,35287,35288,13639,35289,
+35290,35291,13640,35292,35293,35294,13641,35295,35296,35297,35298,35299,35300,
+35301,13642,13643,35302,13644,35303,35304,35305,35306,35307,35308,35309,35310,
+13645,35311,35312,35313,35314,35315,35316,35317,35318,35319,35320,35321,35322,
+35323,35324,35325,35326,35393,35394,35395,35396,35397,35398,35399,35400,35401,
+35402,35403,13646,13647,35404,35405,13648,35406,35407,35408,13649,35409,35410,
+35411,35412,35413,35414,35415,13650,13651,35416,13652,35417,13653,35418,35425,
+35426,35427,35428,35429,13654,35430,35431,35432,35433,35434,35435,35436,35437,
+35438,35439,35440,35441,35442,35443,35444,35445,35446,35447,35448,13655,35449,
+35450,35457,35458,35459,35460,35461,13656,35462,35463,35464,35465,35466,35467,
+35468,35469,35470,35471,35472,35473,35474,35475,35476,35477,35478,35479,35480,
+35481,13657,35482,35483,35484,35485,35486,35487,13658,35488,35489,35490,13659,
+35491,35492,35493,13660,35494,35495,35496,35497,35498,35499,35500,35501,13661,
+35502,13662,35503,13663,35504,35505,35506,35507,35508,35509,13664,35510,35511,
+35512,13665,35513,35514,35515,13666,35516,35517,35518,35519,35520,35521,35522,
+13667,35523,35524,35525,35526,13668,35527,35528,35529,35530,35531,35532,13669,
+13670,35533,35534,13671,35535,35536,13672,13673,35537,13674,35538,35539,35540,
+35541,35542,13675,13676,35543,13677,35544,13678,35545,35546,35547,35548,35549,
+35550,13679,35551,35552,35553,35554,35555,35556,35557,35558,35559,35560,35561,
+35562,35563,35564,35565,35566,35567,35568,35569,35570,35571,35572,35573,35574,
+35575,35576,35577,13680,13681,35578,35579,13682,35580,35581,13683,13684,35582,
+35649,35650,35651,35652,35653,35654,13685,13686,35655,13687,13688,13689,13690,
+35656,35657,35658,35659,35660,13691,13692,35661,35662,13693,35663,35664,35665,
+13694,35666,35667,35668,35669,35670,35671,35672,13857,13858,35673,13859,13860,
+13861,35674,35681,35682,35683,35684,13862,13863,13864,35685,35686,13865,35687,
+35688,35689,13866,35690,35691,35692,35693,35694,35695,35696,13867,13868,35697,
+13869,13870,13871,35698,35699,35700,35701,35702,35703,35704,35705,35706,35713,
+35714,35715,35716,35717,35718,35719,35720,35721,35722,35723,35724,35725,35726,
+35727,35728,35729,35730,35731,35732,35733,35734,35735,35736,35737,35738,35739,
+35740,35741,35742,35743,35744,35745,35746,35747,35748,35749,35750,35751,35752,
+35753,35754,35755,35756,35757,35758,35759,35760,35761,35762,35763,35764,35765,
+13872,13873,35766,35767,13874,35768,35769,35770,13875,35771,13876,13877,35772,
+35773,35774,35775,13878,13879,35776,13880,13881,13882,35777,35778,35779,35780,
+35781,13883,13884,13885,35782,35783,13886,35784,35785,35786,13887,35787,35788,
+35789,35790,35791,35792,35793,13888,13889,35794,13890,13891,13892,35795,35796,
+35797,35798,35799,35800,13893,35801,35802,35803,35804,35805,35806,35807,35808,
+35809,35810,35811,35812,35813,35814,35815,35816,35817,35818,35819,13894,35820,
+35821,35822,35823,35824,35825,35826,35827,35828,35829,35830,35831,35832,35833,
+35834,35835,35836,35837,35838,35905,35906,35907,35908,35909,35910,35911,35912,
+35913,35914,35915,35916,35917,35918,35919,35920,13895,13896,35921,35922,13897,
+35923,35924,35925,13898,35926,35927,35928,35929,35930,35937,35938,35939,35940,
+35941,35942,35943,13899,35944,35945,35946,35947,35948,35949,13900,35950,35951,
+35952,35953,35954,35955,35956,13901,35957,35958,35959,35960,35961,35962,35969,
+35970,35971,35972,35973,35974,35975,35976,35977,35978,35979,35980,35981,13902,
+35982,35983,35984,35985,35986,35987,35988,35989,35990,35991,35992,35993,35994,
+35995,35996,35997,35998,35999,36000,36001,36002,36003,36004,36005,36006,36007,
+36008,13903,36009,36010,36011,13904,36012,36013,36014,36015,36016,36017,36018,
+36019,36020,36021,36022,36023,36024,36025,36026,36027,36028,36029,36030,36031,
+36032,36033,36034,36035,36036,36037,36038,36039,36040,36041,36042,36043,36044,
+36045,36046,36047,36048,36049,36050,36051,36052,36053,36054,36055,36056,36057,
+36058,36059,36060,36061,36062,13905,13906,36063,36064,13907,36065,36066,36067,
+13908,36068,36069,36070,36071,36072,36073,13909,13910,36074,36075,36076,36077,
+13911,36078,36079,36080,36081,36082,36083,36084,36085,36086,36087,36088,36089,
+36090,36091,36092,36093,36094,36161,36162,36163,36164,36165,36166,36167,36168,
+36169,36170,36171,36172,36173,36174,36175,36176,36177,13912,36178,36179,36180,
+36181,36182,36183,36184,36185,36186,36193,36194,36195,36196,36197,36198,36199,
+36200,36201,36202,36203,36204,36205,36206,36207,36208,36209,36210,13913,36211,
+36212,36213,13914,36214,36215,36216,13915,36217,36218,36225,36226,36227,36228,
+36229,13916,13917,36230,36231,36232,13918,36233,36234,36235,36236,36237,36238,
+36239,36240,36241,36242,36243,36244,36245,36246,36247,36248,36249,36250,36251,
+36252,36253,36254,36255,36256,36257,36258,36259,36260,36261,36262,36263,36264,
+36265,36266,13919,13920,36267,36268,13921,36269,36270,13922,13923,36271,36272,
+36273,36274,36275,36276,36277,13924,13925,36278,13926,36279,36280,36281,36282,
+36283,36284,36285,36286,13927,36287,36288,36289,13928,36290,36291,36292,13929,
+36293,36294,36295,36296,36297,36298,36299,13930,13931,36300,36301,36302,36303,
+36304,36305,36306,36307,36308,36309,13932,36310,36311,36312,13933,36313,36314,
+36315,13934,36316,36317,36318,36319,36320,36321,36322,13935,13936,36323,13937,
+36324,13938,36325,36326,36327,36328,36329,36330,13939,13940,36331,36332,13941,
+36333,36334,36335,13942,36336,36337,36338,36339,36340,36341,36342,13943,13944,
+36343,13945,13946,13947,13948,36344,36345,36346,13949,13950,14113,14114,36347,
+36348,14115,36349,36350,36417,14116,36418,36419,36420,36421,36422,36423,36424,
+14117,14118,36425,14119,14120,14121,36426,36427,36428,36429,36430,36431,14122,
+14123,36432,36433,14124,36434,36435,36436,36437,36438,36439,36440,36441,36442,
+36449,36450,36451,36452,36453,14125,36454,14126,36455,36456,36457,36458,36459,
+36460,36461,36462,36463,36464,36465,36466,36467,36468,36469,36470,36471,36472,
+36473,36474,36481,36482,36483,36484,36485,36486,36487,36488,36489,36490,36491,
+36492,36493,36494,14127,14128,36495,36496,14129,36497,36498,36499,14130,36500,
+36501,36502,36503,36504,36505,36506,14131,14132,36507,14133,14134,14135,36508,
+36509,36510,36511,36512,14136,14137,14138,36513,36514,14139,36515,36516,36517,
+14140,36518,36519,36520,36521,36522,36523,36524,14141,14142,36525,14143,36526,
+14144,36527,36528,36529,36530,36531,36532,14145,14146,36533,36534,14147,36535,
+36536,36537,14148,36538,36539,36540,36541,36542,36543,36544,14149,14150,36545,
+14151,14152,14153,36546,36547,36548,36549,36550,36551,14154,36552,36553,36554,
+14155,36555,36556,36557,36558,36559,36560,36561,36562,36563,36564,36565,36566,
+14156,36567,14157,36568,36569,36570,36571,36572,36573,36574,36575,14158,14159,
+36576,36577,14160,36578,36579,36580,14161,36581,36582,36583,36584,36585,36586,
+36587,14162,14163,36588,14164,36589,14165,36590,36591,36592,36593,36594,36595,
+14166,36596,36597,36598,14167,36599,36600,36601,36602,36603,36604,36605,36606,
+36673,36674,36675,36676,36677,36678,36679,36680,14168,36681,36682,36683,36684,
+36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,
+36698,36705,36706,36707,36708,36709,36710,36711,36712,14169,36713,36714,36715,
+36716,36717,36718,36719,14170,36720,36721,36722,14171,36723,36724,36725,14172,
+36726,36727,36728,36729,36730,36737,36738,14173,14174,36739,14175,36740,14176,
+36741,36742,36743,36744,36745,36746,14177,36747,36748,36749,14178,36750,36751,
+36752,14179,36753,36754,36755,36756,36757,36758,36759,36760,14180,36761,14181,
+36762,14182,36763,36764,36765,36766,36767,36768,14183,14184,36769,36770,14185,
+36771,36772,36773,14186,36774,36775,36776,36777,36778,36779,36780,14187,14188,
+36781,14189,36782,14190,36783,36784,36785,36786,36787,36788,14191,36789,36790,
+36791,36792,36793,36794,36795,36796,36797,36798,36799,36800,36801,36802,36803,
+36804,36805,36806,36807,14192,36808,36809,36810,36811,36812,36813,36814,14193,
+36815,36816,36817,36818,36819,36820,36821,36822,36823,36824,36825,36826,36827,
+36828,36829,36830,36831,36832,36833,36834,36835,36836,36837,36838,36839,36840,
+36841,14194,14195,36842,36843,14196,36844,36845,36846,14197,36847,36848,36849,
+36850,36851,36852,36853,14198,36854,36855,14199,36856,14200,36857,36858,36859,
+36860,36861,36862,14201,14202,36929,36930,14203,36931,36932,36933,14204,36934,
+36935,36936,36937,36938,36939,36940,14205,14206,36941,14369,36942,14370,36943,
+36944,36945,36946,36947,36948,14371,14372,36949,36950,14373,36951,36952,36953,
+14374,36954,36961,36962,36963,36964,36965,36966,14375,14376,36967,14377,36968,
+14378,14379,36969,36970,14380,14381,36971,36972,36973,36974,36975,36976,36977,
+36978,36979,36980,36981,36982,36983,36984,36985,36986,36993,36994,36995,36996,
+36997,36998,36999,37000,37001,37002,37003,37004,37005,14382,14383,37006,37007,
+14384,37008,37009,37010,14385,37011,37012,37013,37014,37015,37016,37017,14386,
+14387,37018,14388,37019,14389,37020,37021,37022,37023,37024,37025,14390,14391,
+37026,37027,14392,37028,14393,14394,14395,14396,14397,37029,37030,37031,37032,
+37033,14398,14399,37034,14400,37035,14401,14402,37036,37037,14403,37038,14404,
+14405,14406,37039,37040,14407,37041,37042,37043,14408,37044,37045,37046,37047,
+37048,37049,37050,14409,14410,37051,14411,14412,14413,14414,37052,37053,37054,
+37055,37056,14415,14416,37057,37058,37059,37060,37061,37062,14417,37063,37064,
+37065,37066,37067,37068,37069,37070,37071,37072,37073,37074,14418,37075,37076,
+37077,37078,37079,37080,37081,37082,37083,37084,37085,37086,37087,37088,37089,
+37090,37091,37092,37093,37094,37095,37096,37097,37098,37099,37100,37101,37102,
+37103,37104,37105,37106,37107,37108,14419,14420,37109,37110,14421,37111,37112,
+37113,14422,37114,14423,37115,37116,37117,37118,37185,14424,14425,37186,14426,
+37187,14427,14428,37188,37189,37190,37191,14429,14430,14431,37192,37193,14432,
+37194,37195,37196,14433,37197,37198,37199,37200,37201,37202,37203,14434,14435,
+37204,14436,14437,14438,37205,37206,37207,37208,37209,37210,14439,14440,37217,
+37218,14441,37219,37220,37221,14442,37222,37223,37224,37225,37226,37227,37228,
+37229,37230,37231,14443,14444,14445,37232,14446,37233,37234,37235,37236,14447,
+37237,37238,37239,37240,37241,37242,37249,37250,37251,37252,37253,37254,37255,
+37256,37257,37258,37259,37260,37261,37262,37263,37264,37265,37266,37267,37268,
+37269,14448,14449,37270,14450,14451,37271,37272,37273,14452,37274,14453,37275,
+37276,37277,37278,37279,14454,14455,37280,14456,37281,14457,37282,37283,37284,
+37285,37286,37287,14458,37288,37289,37290,14459,37291,37292,37293,37294,37295,
+37296,37297,37298,37299,37300,37301,37302,37303,37304,37305,14460,14461,37306,
+37307,37308,37309,37310,37311,37312,37313,37314,37315,37316,37317,37318,37319,
+37320,37321,37322,37323,37324,37325,37326,37327,37328,37329,37330,37331,37332,
+37333,37334,37335,37336,37337,37338,37339,14462,37340,37341,37342,14625,37343,
+37344,37345,14626,37346,37347,37348,37349,37350,37351,37352,37353,14627,37354,
+14628,37355,14629,37356,37357,37358,37359,37360,37361,14630,37362,37363,37364,
+14631,37365,37366,37367,14632,37368,37369,37370,37371,37372,37373,37374,37441,
+14633,37442,14634,37443,37444,37445,37446,37447,37448,37449,37450,14635,14636,
+14637,37451,14638,37452,37453,14639,14640,14641,14642,37454,37455,37456,37457,
+37458,14643,14644,37459,14645,37460,14646,37461,37462,37463,14647,37464,14648,
+14649,37465,37466,37473,14650,37474,37475,37476,14651,37477,37478,37479,37480,
+37481,37482,37483,37484,14652,37485,14653,37486,37487,37488,37489,37490,37491,
+37492,37493,14654,37494,37495,37496,37497,37498,37505,37506,37507,37508,37509,
+37510,37511,37512,37513,37514,37515,37516,37517,37518,37519,37520,37521,37522,
+37523,37524,37525,37526,14655,37527,37528,37529,14656,37530,37531,37532,14657,
+37533,37534,37535,37536,37537,37538,37539,37540,37541,37542,37543,37544,37545,
+37546,37547,37548,37549,37550,37551,14658,37552,37553,37554,14659,37555,37556,
+37557,14660,37558,37559,37560,37561,37562,37563,37564,14661,37565,37566,14662,
+37567,37568,37569,37570,37571,37572,37573,37574,14663,37575,37576,37577,14664,
+37578,37579,37580,14665,37581,37582,37583,37584,37585,37586,37587,14666,37588,
+37589,14667,37590,37591,37592,37593,37594,37595,37596,37597,37598,37599,37600,
+37601,37602,37603,37604,37605,37606,37607,37608,37609,37610,37611,37612,37613,
+37614,37615,37616,37617,37618,37619,37620,37621,37622,37623,37624,37625,14668,
+14669,37626,37627,14670,37628,37629,14671,14672,37630,14673,37697,37698,37699,
+37700,37701,14674,14675,37702,14676,14677,14678,37703,14679,37704,14680,37705,
+37706,14681,14682,14683,14684,14685,37707,37708,14686,14687,14688,14689,14690,
+37709,37710,37711,37712,14691,14692,37713,14693,37714,14694,37715,37716,37717,
+14695,37718,37719,14696,14697,37720,37721,14698,37722,37729,37730,14699,37731,
+37732,37733,37734,37735,37736,37737,14700,14701,37738,14702,14703,14704,37739,
+37740,37741,14705,37742,37743,14706,14707,37744,37745,14708,37746,37747,37748,
+37749,37750,37751,37752,37753,37754,37761,37762,37763,14709,37764,37765,37766,
+37767,37768,37769,37770,37771,37772,37773,37774,37775,37776,37777,37778,37779,
+37780,37781,37782,37783,37784,37785,37786,37787,37788,37789,37790,37791,37792,
+37793,37794,37795,37796,37797,37798,37799,37800,37801,14710,14711,37802,37803,
+14712,37804,37805,14713,14714,37806,14715,37807,37808,37809,37810,37811,14716,
+14717,37812,14718,37813,14881,14882,37814,37815,37816,37817,37818,14883,14884,
+37819,37820,14885,37821,37822,14886,14887,37823,37824,37825,37826,37827,37828,
+37829,14888,14889,37830,14890,14891,14892,37831,37832,37833,37834,37835,37836,
+14893,14894,37837,37838,14895,37839,37840,37841,14896,37842,37843,37844,37845,
+37846,37847,37848,37849,14897,37850,14898,14899,14900,37851,37852,37853,14901,
+37854,37855,14902,37856,37857,37858,14903,37859,37860,37861,37862,37863,37864,
+37865,37866,37867,37868,37869,37870,37871,37872,37873,37874,37875,37876,37877,
+37878,37879,37880,37881,14904,14905,14906,37882,14907,37883,37884,37885,14908,
+37886,37953,37954,37955,37956,37957,37958,14909,14910,37959,14911,37960,14912,
+37961,37962,37963,37964,37965,37966,14913,37967,37968,37969,14914,37970,37971,
+37972,37973,37974,37975,37976,37977,37978,37985,37986,37987,37988,37989,37990,
+14915,37991,37992,37993,37994,37995,37996,37997,14916,37998,37999,38000,38001,
+38002,38003,38004,38005,38006,38007,38008,38009,38010,38017,38018,38019,38020,
+38021,38022,14917,38023,38024,38025,38026,38027,38028,38029,14918,14919,38030,
+38031,14920,38032,38033,38034,14921,38035,38036,38037,38038,38039,38040,38041,
+14922,14923,38042,38043,38044,38045,38046,38047,38048,38049,38050,38051,14924,
+38052,38053,38054,14925,38055,38056,38057,38058,38059,38060,38061,38062,38063,
+38064,38065,38066,38067,38068,38069,38070,38071,38072,38073,38074,38075,38076,
+38077,14926,14927,38078,38079,14928,38080,38081,14929,14930,14931,14932,38082,
+38083,38084,38085,38086,14933,14934,38087,14935,38088,14936,38089,38090,38091,
+14937,14938,38092,14939,38093,38094,38095,38096,38097,38098,38099,14940,38100,
+38101,38102,38103,38104,38105,38106,38107,38108,38109,38110,14941,38111,38112,
+38113,38114,38115,38116,38117,14942,38118,38119,38120,38121,38122,38123,38124,
+38125,38126,38127,38128,38129,38130,38131,38132,38133,38134,38135,38136,38137,
+38138,38139,38140,38141,38142,38209,38210,14943,14944,38211,38212,14945,38213,
+38214,38215,14946,38216,38217,38218,38219,38220,38221,38222,38223,38224,38225,
+38226,38227,14947,38228,38229,38230,38231,38232,38233,14948,38234,38241,38242,
+14949,38243,38244,38245,14950,38246,38247,38248,38249,38250,38251,38252,14951,
+38253,38254,14952,38255,14953,38256,38257,38258,38259,38260,38261,14954,14955,
+38262,38263,14956,38264,38265,38266,14957,38273,38274,38275,38276,38277,38278,
+38279,14958,14959,38280,14960,38281,38282,38283,38284,38285,38286,38287,38288,
+38289,38290,38291,38292,38293,38294,38295,38296,38297,38298,38299,38300,38301,
+38302,38303,38304,38305,38306,38307,38308,38309,38310,38311,38312,38313,38314,
+38315,38316,14961,14962,38317,38318,14963,38319,38320,38321,14964,38322,14965,
+38323,38324,38325,38326,38327,14966,14967,38328,14968,38329,14969,14970,14971,
+38330,38331,38332,38333,14972,14973,38334,38335,14974,38336,38337,38338,15137,
+38339,15138,38340,38341,38342,38343,38344,15139,15140,38345,15141,15142,15143,
+38346,38347,38348,38349,38350,15144,15145,15146,38351,38352,15147,38353,38354,
+38355,15148,38356,38357,38358,38359,38360,38361,38362,15149,15150,38363,15151,
+15152,15153,38364,38365,38366,38367,38368,38369,15154,15155,38370,38371,38372,
+38373,38374,38375,38376,38377,38378,38379,38380,38381,38382,38383,15156,38384,
+38385,38386,38387,38388,38389,38390,38391,38392,38393,38394,38395,38396,38397,
+38398,38465,38466,38467,38468,38469,38470,38471,38472,38473,38474,38475,38476,
+38477,38478,38479,38480,38481,38482,38483,38484,38485,38486,38487,38488,15157,
+15158,38489,38490,15159,38497,38498,15160,15161,38499,38500,38501,38502,38503,
+38504,38505,15162,38506,38507,15163,15164,15165,38508,38509,38510,38511,38512,
+38513,15166,38514,38515,38516,38517,38518,38519,38520,38521,38522,38529,38530,
+38531,38532,38533,38534,38535,38536,38537,38538,38539,15167,38540,38541,38542,
+38543,38544,38545,15168,15169,38546,38547,38548,38549,38550,38551,38552,38553,
+38554,38555,38556,38557,38558,38559,15170,15171,38560,15172,15173,15174,38561,
+38562,38563,38564,38565,38566,38567,38568,38569,38570,38571,38572,38573,38574,
+38575,38576,38577,38578,38579,38580,38581,38582,38583,38584,38585,38586,38587,
+38588,38589,38590,38591,38592,38593,38594,15175,15176,38595,38596,15177,38597,
+38598,38599,15178,38600,38601,38602,38603,38604,38605,38606,15179,15180,38607,
+38608,38609,15181,38610,38611,38612,38613,38614,38615,38616,38617,38618,38619,
+38620,38621,38622,38623,38624,38625,38626,38627,38628,38629,38630,38631,38632,
+38633,38634,38635,38636,38637,38638,38639,38640,38641,38642,38643,38644,38645,
+38646,38647,38648,38649,38650,38651,38652,38653,38654,38721,38722,38723,38724,
+38725,38726,38727,38728,38729,38730,38731,38732,38733,38734,38735,38736,38737,
+15182,38738,38739,38740,38741,38742,38743,38744,38745,38746,38753,38754,38755,
+38756,38757,38758,38759,38760,38761,38762,38763,38764,38765,38766,38767,38768,
+38769,38770,15183,38771,38772,38773,38774,38775,38776,38777,38778,38785,38786,
+38787,38788,38789,38790,38791,38792,38793,38794,38795,38796,15184,38797,38798,
+38799,38800,38801,38802,15185,15186,38803,38804,15187,38805,38806,38807,15188,
+38808,38809,38810,38811,38812,38813,38814,15189,38815,38816,15190,38817,15191,
+38818,38819,38820,38821,38822,38823,38824,38825,38826,38827,38828,38829,38830,
+38831,38832,38833,38834,38835,38836,38837,38838,38839,38840,38841,38842,38843,
+38844,38845,38846,38847,38848,38849,38850,38851,38852,38853,38854,38855,38856,
+38857,38858,38859,38860,38861,38862,38863,38864,38865,38866,38867,38868,38869,
+38870,38871,38872,38873,38874,38875,38876,38877,38878,38879,38880,38881,38882,
+38883,38884,38885,38886,38887,38888,38889,38890,38891,38892,38893,38894,38895,
+38896,38897,38898,38899,38900,38901,38902,38903,38904,38905,38906,38907,15192,
+38908,38909,38910,38977,38978,38979,38980,38981,38982,38983,38984,38985,38986,
+38987,38988,38989,38990,38991,38992,38993,15193,38994,38995,38996,38997,38998,
+38999,15194,39000,39001,39002,15195,39009,39010,39011,15196,39012,39013,39014,
+39015,39016,39017,39018,15197,15198,39019,39020,39021,39022,39023,39024,39025,
+39026,39027,39028,39029,39030,39031,39032,39033,39034,39041,39042,39043,39044,
+39045,39046,39047,39048,39049,39050,39051,39052,39053,39054,39055,39056,39057,
+39058,39059,39060,39061,39062,15199,15200,39063,39064,15201,39065,39066,39067,
+15202,39068,39069,39070,39071,39072,39073,39074,15203,15204,39075,15205,39076,
+15206,39077,39078,39079,39080,39081,39082,15207,15208,39083,15209,15210,39084,
+39085,15211,15212,15213,15214,39086,39087,39088,39089,39090,15215,15216,39091,
+15217,15218,15219,39092,39093,39094,15220,39095,39096,15221,15222,39097,39098,
+15223,39099,39100,39101,15224,39102,39103,39104,39105,39106,39107,39108,15225,
+15226,39109,15227,15228,15229,39110,39111,39112,39113,39114,39115,15230,15393,
+39116,39117,15394,39118,39119,39120,15395,39121,39122,39123,39124,39125,39126,
+39127,15396,15397,39128,15398,39129,15399,39130,39131,39132,39133,39134,39135,
+15400,39136,39137,39138,15401,39139,39140,39141,15402,39142,39143,39144,39145,
+39146,39147,39148,15403,39149,39150,39151,39152,15404,39153,39154,39155,39156,
+39157,39158,15405,15406,15407,15408,15409,39159,39160,15410,15411,39161,15412,
+15413,39162,39163,39164,39165,15414,15415,39166,15416,15417,15418,39233,39234,
+39235,39236,15419,39237,15420,15421,39238,39239,15422,39240,39241,39242,15423,
+39243,39244,39245,39246,39247,39248,39249,15424,15425,39250,15426,15427,15428,
+39251,39252,39253,39254,39255,39256,15429,15430,39257,39258,15431,39265,39266,
+39267,15432,39268,39269,39270,39271,39272,39273,39274,15433,15434,39275,15435,
+15436,15437,39276,39277,39278,39279,39280,39281,15438,39282,39283,39284,15439,
+39285,39286,39287,15440,39288,39289,39290,39297,39298,39299,39300,39301,39302,
+39303,39304,39305,15441,39306,39307,39308,39309,39310,39311,15442,15443,15444,
+39312,15445,39313,39314,39315,15446,39316,15447,39317,39318,39319,39320,39321,
+15448,15449,39322,15450,39323,15451,39324,39325,39326,15452,39327,39328,15453,
+15454,39329,39330,15455,39331,39332,39333,15456,39334,39335,39336,39337,39338,
+39339,39340,39341,39342,39343,39344,39345,15457,39346,39347,39348,39349,39350,
+39351,15458,39352,39353,39354,15459,39355,39356,39357,15460,39358,39359,39360,
+39361,39362,39363,39364,15461,39365,39366,15462,15463,39367,39368,39369,39370,
+39371,39372,39373,15464,39374,39375,39376,15465,39377,39378,39379,15466,39380,
+39381,39382,39383,39384,39385,39386,15467,15468,39387,15469,39388,39389,39390,
+39391,39392,39393,39394,39395,15470,15471,39396,39397,15472,39398,39399,39400,
+15473,39401,39402,39403,39404,39405,39406,39407,15474,15475,39408,15476,39409,
+15477,39410,39411,39412,39413,39414,39415,15478,15479,39416,39417,15480,39418,
+39419,15481,15482,39420,39421,39422,39489,39490,39491,39492,15483,15484,39493,
+15485,39494,15486,39495,15649,39496,15650,15651,39497,15652,39498,39499,39500,
+39501,39502,39503,39504,39505,39506,39507,39508,39509,39510,39511,39512,39513,
+39514,39521,39522,15653,39523,39524,39525,39526,39527,39528,39529,15654,15655,
+39530,39531,15656,39532,39533,39534,15657,39535,39536,39537,39538,39539,39540,
+39541,15658,39542,39543,39544,39545,15659,39546,39553,39554,39555,39556,39557,
+15660,15661,39558,39559,15662,39560,39561,39562,15663,39563,39564,39565,39566,
+39567,39568,39569,15664,15665,39570,15666,39571,15667,39572,39573,39574,39575,
+39576,39577,15668,15669,39578,39579,39580,39581,39582,39583,15670,39584,39585,
+39586,39587,39588,39589,39590,15671,39591,39592,15672,39593,15673,39594,39595,
+39596,39597,39598,39599,15674,15675,39600,39601,15676,39602,39603,39604,15677,
+15678,39605,39606,39607,39608,39609,39610,15679,15680,39611,15681,39612,15682,
+39613,39614,39615,39616,39617,39618,39619,39620,39621,39622,39623,39624,39625,
+39626,39627,39628,39629,39630,39631,39632,39633,39634,39635,39636,39637,39638,
+39639,39640,39641,39642,39643,39644,39645,39646,15683,15684,39647,39648,15685,
+39649,39650,15686,15687,39651,39652,39653,39654,39655,39656,15688,15689,15690,
+39657,15691,39658,15692,39659,39660,39661,39662,15693,39663,15694,15695,39664,
+15696,15697,39665,39666,39667,15698,39668,39669,39670,39671,39672,39673,39674,
+15699,15700,39675,39676,15701,15702,39677,39678,39745,39746,39747,15703,15704,
+15705,39748,39749,15706,39750,39751,39752,15707,39753,39754,39755,39756,39757,
+39758,39759,15708,15709,39760,39761,15710,15711,39762,39763,39764,39765,39766,
+39767,39768,39769,39770,39777,39778,39779,39780,39781,39782,39783,39784,39785,
+39786,39787,39788,39789,39790,39791,39792,39793,39794,15712,39795,39796,39797,
+39798,39799,39800,39801,39802,39809,39810,39811,39812,39813,39814,39815,39816,
+39817,39818,39819,39820,39821,39822,39823,39824,39825,39826,39827,39828,39829,
+39830,39831,39832,39833,39834,15713,15714,39835,39836,15715,39837,39838,39839,
+15716,39840,15717,39841,39842,39843,39844,39845,15718,15719,39846,39847,15720,
+15721,39848,39849,39850,39851,39852,39853,15722,39854,39855,39856,15723,39857,
+39858,39859,15724,39860,39861,39862,39863,39864,39865,39866,39867,39868,39869,
+39870,39871,39872,39873,39874,39875,39876,39877,39878,39879,39880,39881,39882,
+39883,39884,39885,39886,39887,39888,39889,39890,39891,39892,39893,39894,39895,
+39896,39897,39898,39899,39900,39901,39902,39903,39904,39905,39906,39907,39908,
+39909,39910,15725,39911,39912,39913,39914,39915,39916,39917,39918,39919,39920,
+39921,39922,39923,39924,39925,39926,39927,39928,39929,39930,39931,39932,39933,
+15726,15727,39934,40001,15728,40002,40003,15729,15730,40004,15731,40005,40006,
+40007,40008,40009,15732,15733,40010,40011,40012,15734,40013,40014,40015,40016,
+40017,40018,15735,15736,40019,40020,15737,40021,40022,40023,40024,40025,40026,
+40033,40034,40035,40036,40037,40038,40039,40040,40041,15738,40042,40043,40044,
+40045,40046,40047,40048,15739,40049,40050,40051,40052,40053,40054,40055,40056,
+40057,40058,40065,40066,40067,40068,40069,40070,40071,40072,40073,15740,40074,
+40075,40076,40077,40078,40079,40080,15741,40081,40082,40083,15742,40084,40085,
+40086,15905,40087,40088,40089,40090,40091,40092,40093,15906,15907,40094,40095,
+40096,40097,40098,40099,40100,40101,40102,40103,15908,40104,40105,40106,40107,
+40108,40109,40110,40111,40112,40113,40114,40115,40116,40117,40118,40119,40120,
+40121,40122,40123,40124,40125,40126,40127,40128,40129,40130,15909,15910,40131,
+40132,15911,40133,40134,40135,15912,40136,40137,40138,40139,40140,40141,40142,
+15913,15914,40143,40144,40145,15915,40146,40147,40148,40149,40150,40151,15916,
+40152,40153,40154,40155,40156,40157,40158,40159,40160,40161,40162,40163,40164,
+40165,40166,40167,40168,40169,40170,15917,40171,40172,40173,40174,40175,40176,
+40177,15918,40178,40179,40180,40181,40182,40183,40184,40185,40186,40187,40188,
+40189,40190,40257,40258,40259,40260,40261,40262,40263,40264,40265,40266,40267,
+40268,40269,40270,15919,40271,40272,40273,15920,40274,40275,40276,40277,40278,
+40279,40280,40281,40282,40289,40290,40291,40292,40293,40294,40295,40296,40297,
+40298,40299,40300,40301,40302,40303,40304,40305,40306,40307,40308,40309,40310,
+40311,40312,40313,40314,40321,40322,40323,40324,40325,40326,40327,40328,40329,
+15921,40330,40331,40332,40333,40334,40335,15922,15923,40336,40337,15924,40338,
+40339,40340,15925,40341,15926,40342,40343,40344,40345,15927,15928,15929,40346,
+40347,40348,40349,40350,40351,40352,40353,40354,40355,15930,40356,40357,40358,
+15931,40359,40360,40361,15932,40362,40363,40364,40365,40366,40367,40368,15933,
+40369,40370,40371,40372,40373,40374,40375,40376,40377,40378,40379,15934,15935,
+40380,40381,15936,40382,40383,40384,15937,40385,40386,40387,40388,40389,40390,
+40391,15938,15939,40392,15940,40393,15941,40394,40395,40396,40397,40398,40399,
+15942,15943,40400,40401,15944,15945,15946,40402,15947,15948,15949,40403,40404,
+40405,40406,15950,15951,15952,40407,15953,15954,15955,40408,40409,40410,15956,
+15957,40411,15958,15959,40412,40413,15960,40414,40415,40416,15961,40417,40418,
+40419,40420,40421,40422,40423,15962,15963,40424,15964,15965,15966,40425,40426,
+40427,40428,40429,40430,15967,15968,40431,40432,15969,40433,40434,40435,15970,
+40436,40437,15971,40438,40439,40440,40441,15972,15973,40442,15974,40443,15975,
+40444,40445,40446,15976,40513,15977,15978,40514,40515,40516,15979,40517,40518,
+40519,15980,40520,40521,40522,40523,40524,40525,40526,40527,15981,40528,40529,
+40530,40531,40532,40533,40534,40535,40536,40537,15982,15983,40538,40545,15984,
+15985,40546,15986,15987,15988,15989,40547,40548,40549,40550,40551,15990,15991,
+15992,15993,15994,15995,15996,40552,15997,40553,15998,40554,16161,16162,40555,
+40556,16163,40557,40558,40559,16164,40560,40561,40562,40563,40564,40565,40566,
+16165,16166,40567,16167,40568,16168,40569,40570,40577,40578,40579,40580,16169,
+16170,16171,40581,16172,40582,40583,40584,16173,40585,16174,16175,40586,40587,
+40588,40589,16176,16177,16178,16179,16180,16181,40590,40591,40592,16182,16183,
+16184,16185,40593,40594,40595,16186,40596,40597,40598,16187,40599,40600,40601,
+40602,40603,40604,40605,16188,16189,40606,16190,16191,40607,40608,40609,40610,
+40611,40612,40613,16192,16193,40614,40615,16194,40616,40617,40618,16195,16196,
+16197,40619,16198,40620,40621,16199,16200,16201,40622,16202,40623,16203,40624,
+16204,40625,40626,40627,40628,16205,16206,40629,40630,16207,40631,40632,40633,
+16208,40634,40635,40636,40637,40638,40639,40640,16209,16210,40641,16211,16212,
+16213,40642,40643,40644,40645,40646,40647,16214,16215,40648,40649,16216,40650,
+40651,40652,40653,40654,40655,40656,40657,40658,40659,40660,16217,40661,40662,
+16218,40663,16219,40664,40665,40666,40667,40668,40669,16220,16221,40670,40671,
+16222,40672,40673,40674,16223,40675,40676,40677,40678,40679,40680,40681,16224,
+16225,40682,16226,40683,16227,40684,40685,40686,40687,40688,40689,16228,16229,
+40690,40691,16230,40692,40693,40694,16231,40695,40696,40697,40698,40699,40700,
+40701,16232,16233,40702,16234,40769,16235,40770,40771,40772,40773,40774,40775,
+16236,16237,40776,40777,16238,40778,40779,40780,16239,16240,16241,40781,40782,
+40783,40784,40785,16242,16243,40786,16244,40787,16245,40788,40789,40790,40791,
+40792,40793,16246,16247,40794,40801,16248,40802,40803,40804,16249,40805,40806,
+40807,40808,40809,40810,40811,16250,16251,40812,40813,16252,16253,40814,40815,
+40816,40817,40818,40819,16254,16417,40820,40821,16418,40822,40823,40824,16419,
+40825,40826,40833,40834,40835,40836,40837,16420,16421,40838,40839,40840,16422,
+40841,40842,40843,40844,40845,40846,16423,16424,40847,40848,16425,40849,40850,
+40851,16426,40852,40853,40854,40855,40856,40857,40858,16427,16428,40859,16429,
+40860,16430,40861,40862,40863,40864,40865,40866,16431,16432,40867,40868,16433,
+40869,40870,40871,16434,40872,40873,40874,40875,40876,40877,40878,16435,16436,
+40879,16437,40880,16438,40881,16439,40882,40883,40884,40885,16440,16441,40886,
+40887,16442,40888,40889,40890,16443,40891,40892,40893,40894,40895,16444,40896,
+16445,16446,40897,16447,40898,16448,16449,16450,16451,16452,16453,16454,16455,
+40899,40900,40901,16456,40902,40903,40904,16457,40905,40906,40907,40908,40909,
+40910,40911,16458,40912,40913,16459,40914,40915,40916,40917,40918,40919,40920,
+40921,16460,16461,40922,40923,16462,40924,40925,40926,16463,16464,16465,40927,
+40928,40929,40930,16466,16467,16468,40931,16469,16470,16471,16472,40932,40933,
+40934,16473,40935,16474,16475,40936,40937,16476,40938,16477,16478,16479,40939,
+16480,40940,40941,40942,40943,40944,16481,16482,40945,16483,16484,16485,16486,
+40946,40947,40948,40949,40950,16487,16488,40951,40952,16489,40953,40954,40955,
+16490,40956,40957,40958,41025,41026,41027,41028,16491,16492,41029,16493,16494,
+16495,41030,41031,41032,41033,41034,41035,16496,16497,41036,41037,16498,41038,
+16499,41039,16500,41040,41041,41042,41043,41044,41045,41046,16501,41047,41048,
+41049,41050,16502,41057,41058,41059,41060,41061,41062,16503,41063,41064,41065,
+16504,41066,41067,41068,16505,41069,41070,41071,41072,41073,41074,41075,41076,
+41077,41078,41079,41080,41081,41082,41089,41090,41091,41092,41093,16506,16507,
+41094,41095,16508,41096,41097,41098,16509,41099,16510,41100,41101,41102,41103,
+41104,16673,16674,41105,16675,41106,16676,16677,41107,41108,41109,41110,41111,
+16678,16679,41112,41113,16680,41114,41115,41116,16681,41117,41118,41119,41120,
+41121,41122,41123,16682,16683,41124,16684,41125,16685,41126,41127,41128,41129,
+41130,41131,16686,41132,41133,41134,16687,41135,41136,41137,16688,41138,41139,
+41140,41141,41142,41143,41144,16689,16690,41145,41146,16691,16692,41147,41148,
+41149,41150,41151,41152,16693,41153,41154,41155,41156,41157,41158,41159,41160,
+41161,41162,41163,41164,41165,41166,41167,41168,41169,41170,41171,41172,41173,
+41174,41175,41176,41177,41178,41179,16694,16695,41180,41181,16696,41182,41183,
+41184,16697,41185,16698,41186,41187,41188,41189,41190,16699,16700,41191,16701,
+41192,16702,16703,16704,41193,41194,41195,16705,16706,16707,41196,41197,41198,
+41199,41200,41201,16708,41202,41203,41204,41205,41206,41207,41208,41209,16709,
+41210,16710,41211,16711,41212,41213,41214,41281,41282,41283,16712,41284,41285,
+41286,41287,41288,41289,41290,41291,41292,41293,41294,41295,41296,41297,41298,
+41299,41300,41301,41302,16713,16714,41303,41304,41305,41306,41313,41314,16715,
+41315,41316,41317,16716,41318,41319,41320,16717,41321,41322,41323,41324,41325,
+41326,41327,16718,16719,41328,16720,41329,16721,41330,41331,41332,41333,41334,
+41335,16722,16723,41336,41337,16724,41338,41345,41346,41347,41348,41349,41350,
+41351,41352,41353,41354,41355,41356,41357,41358,41359,16725,41360,41361,41362,
+41363,41364,41365,16726,16727,41366,41367,16728,41368,41369,41370,16729,16730,
+16731,41371,41372,41373,41374,41375,16732,16733,41376,16734,41537,16735,41538,
+41539,41540,41541,41542,41543,16736,41544,41545,41546,41547,41548,41549,41550,
+41551,41552,41553,41554,41555,41556,41557,41558,41559,41560,41561,41562,16737,
+41569,41570,41571,41572,41573,41574,41575,16738,41576,41577,41578,41579,41580,
+41581,41582,41583,41584,41585,41586,41587,41588,41589,41590,41591,41592,41593,
+41594,41601,41602,41603,41604,41605,41606,41607,41608,16739,16740,41609,41610,
+16741,41611,41612,41613,16742,41614,41615,41616,41617,41618,41619,41620,16743,
+16744,41621,16745,41622,41623,41624,41625,41626,41627,41628,41629,16746,41630,
+41631,41632,16747,41793,41794,41795,16748,41796,41797,41798,41799,41800,41801,
+41802,16749,41803,41804,41805,41806,41807,41808,41809,41810,41811,41812,41813,
+16750,16751,41814,41815,16752,41816,41817,41818,16753,41825,41826,41827,41828,
+41829,41830,41831,16754,16755,41832,16756,41833,16757,41834,41835,41836,41837,
+41838,41839,41840,41841,41842,41843,41844,41845,41846,41847,41848,41849,41850,
+41857,41858,41859,41860,41861,41862,41863,41864,41865,41866,41867,41868,41869,
+41870,41871,41872,41873,16758,16759,41874,41875,16760,41876,41877,16761,16762,
+41878,16763,41879,41880,41881,41882,41883,16764,16765,41884,16766,41885,16929,
+16930,41886,41887,16931,16932,41888,16933,16934,42049,42050,16935,42051,16936,
+42052,16937,42053,42054,16938,42055,42056,42057,42058,16939,16940,42059,16941,
+16942,16943,42060,42061,42062,42063,42064,42065,16944,16945,42066,42067,16946,
+42068,42069,42070,16947,42071,42072,42073,42074,42081,42082,42083,16948,16949,
+42084,16950,16951,16952,42085,42086,42087,42088,42089,42090,16953,42091,42092,
+42093,16954,42094,42095,42096,42097,42098,42099,42100,42101,42102,42103,42104,
+42105,42106,42113,42114,42115,16955,42116,42117,42118,42119,42120,42121,42122,
+42123,42124,42125,42126,42127,42128,42129,42130,42131,42132,42133,42134,42135,
+42136,42137,42138,42139,42140,42141,42142,42143,42144,42305,42306,42307,42308,
+42309,16956,16957,42310,42311,16958,42312,42313,42314,16959,42315,42316,42317,
+42318,42319,42320,42321,16960,16961,42322,16962,16963,16964,42323,42324,42325,
+42326,42327,42328,16965,42329,42330,42337,42338,42339,42340,42341,42342,42343,
+42344,42345,42346,42347,42348,42349,42350,42351,42352,42353,42354,16966,42355,
+42356,42357,42358,42359,42360,16967,42361,42362,42369,42370,42371,42372,42373,
+42374,42375,42376,42377,42378,42379,42380,42381,42382,42383,42384,42385,16968,
+42386,42387,42388,42389,42390,42391,42392,42393,42394,42395,42396,42397,42398,
+42399,42400,42561,42562,42563,42564,42565,42566,42567,42568,42569,42570,42571,
+42572,42573,42574,42575,42576,42577,42578,42579,42580,16969,16970,42581,42582,
+16971,42583,42584,42585,16972,42586,42593,42594,42595,42596,42597,42598,16973,
+16974,42599,16975,42600,16976,42601,16977,42602,42603,42604,42605,16978,16979,
+42606,42607,42608,42609,42610,42611,16980,42612,42613,42614,42615,42616,42617,
+42618,42625,42626,42627,42628,16981,42629,42630,42631,42632,42633,42634,42635,
+16982,42636,42637,42638,42639,42640,42641,42642,42643,42644,42645,42646,42647,
+42648,42649,42650,42651,42652,42653,42654,16983,42655,42656,42817,42818,42819,
+42820,42821,16984,42822,42823,42824,16985,42825,42826,42827,16986,42828,42829,
+42830,42831,42832,42833,42834,16987,16988,42835,42836,42837,42838,42839,42840,
+42841,42842,42849,42850,42851,42852,42853,42854,42855,42856,42857,42858,42859,
+42860,42861,42862,42863,42864,42865,42866,42867,42868,42869,42870,42871,16989,
+42872,42873,42874,42881,42882,42883,16990,16991,42884,42885,16992,42886,42887,
+42888,16993,42889,42890,42891,42892,42893,42894,42895,16994,16995,42896,42897,
+42898,16996,42899,42900,42901,42902,42903,42904,16997,42905,42906,42907,42908,
+42909,42910,42911,42912,43073,43074,43075,43076,43077,43078,43079,43080,43081,
+43082,43083,16998,16999,43084,43085,43086,43087,43088,43089,43090,43091,43092,
+43093,43094,43095,43096,43097,43098,43105,43106,43107,43108,43109,43110,43111,
+43112,43113,43114,43115,43116,43117,43118,43119,43120,43121,43122,43123,17000,
+43124,43125,43126,43127,43128,43129,43130,43137,43138,43139,43140,43141,43142,
+43143,43144,43145,43146,43147,43148,43149,43150,43151,43152,43153,43154,43155,
+43156,17001,43157,43158,43159,43160,43161,43162,43163,43164,43165,43166,43167,
+43168,43329,43330,43331,43332,43333,43334,43335,43336,43337,43338,43339,43340,
+43341,43342,43343,17002,43344,43345,43346,43347,43348,43349,43350,43351,43352,
+43353,43354,43361,43362,43363,43364,17003,43365,43366,17004,43367,17005,43368,
+43369,43370,43371,43372,43373,43374,43375,43376,43377,43378,43379,43380,43381,
+43382,43383,43384,43385,43386,43393,43394,43395,43396,43397,43398,43399,43400,
+43401,43402,43403,43404,43405,43406,43407,17006,17007,43408,43409,17008,43410,
+43411,43412,17009,43413,43414,43415,43416,43417,43418,43419,17010,17011,43420,
+43421,43422,17012,17013,43423,43424,43585,43586,17014,17015,17016,43587,43588,
+17017,43589,17018,43590,17019,43591,43592,43593,43594,43595,43596,43597,17020,
+17021,43598,17022,17185,17186,17187,43599,43600,43601,43602,43603,17188,17189,
+43604,43605,17190,43606,43607,43608,17191,43609,43610,43617,43618,43619,43620,
+43621,17192,17193,43622,17194,17195,17196,43623,43624,43625,43626,43627,43628,
+17197,43629,43630,43631,17198,43632,17199,43633,17200,43634,43635,43636,43637,
+43638,43639,43640,17201,43641,43642,43649,43650,17202,43651,43652,43653,43654,
+43655,43656,43657,43658,43659,43660,43661,43662,43663,43664,43665,43666,43667,
+43668,43669,43670,43671,43672,43673,43674,43675,43676,43677,43678,43679,43680,
+43841,43842,43843,43844,17203,17204,43845,43846,17205,43847,43848,43849,17206,
+43850,43851,43852,43853,43854,43855,43856,17207,17208,43857,17209,17210,17211,
+43858,43859,43860,43861,43862,43863,17212,17213,43864,43865,17214,43866,43873,
+43874,17215,43875,43876,43877,43878,43879,43880,43881,17216,17217,43882,17218,
+43883,17219,43884,43885,43886,43887,43888,43889,17220,43890,43891,43892,17221,
+43893,43894,43895,43896,43897,43898,43905,43906,43907,43908,43909,43910,43911,
+43912,43913,17222,43914,43915,43916,43917,43918,43919,43920,17223,43921,43922,
+43923,17224,43924,43925,43926,43927,43928,43929,43930,43931,43932,43933,43934,
+43935,43936,44097,44098,44099,17225,44100,44101,44102,44103,44104,44105,17226,
+17227,44106,44107,17228,44108,44109,44110,17229,44111,44112,44113,44114,44115,
+44116,44117,17230,17231,44118,17232,44119,17233,44120,44121,44122,44129,44130,
+44131,17234,44132,44133,44134,17235,44135,44136,44137,17236,44138,44139,44140,
+44141,44142,44143,44144,44145,44146,44147,44148,44149,17237,44150,44151,44152,
+44153,44154,44161,44162,44163,44164,44165,44166,44167,44168,44169,44170,44171,
+44172,44173,44174,44175,44176,44177,44178,44179,44180,44181,44182,44183,44184,
+44185,44186,44187,44188,44189,17238,44190,44191,44192,17239,44353,44354,44355,
+17240,44356,44357,44358,44359,44360,44361,44362,17241,17242,44363,17243,44364,
+17244,44365,44366,44367,44368,44369,44370,17245,44371,44372,44373,44374,44375,
+44376,44377,44378,44385,44386,44387,44388,44389,44390,44391,17246,44392,44393,
+44394,44395,44396,44397,44398,44399,44400,44401,44402,17247,17248,44403,44404,
+17249,44405,44406,44407,17250,44408,44409,44410,44417,44418,44419,44420,17251,
+17252,44421,17253,44422,17254,44423,44424,44425,44426,44427,44428,17255,44429,
+44430,44431,44432,44433,44434,44435,44436,44437,44438,44439,44440,44441,44442,
+44443,44444,44445,44446,44447,17256,44448,44609,44610,44611,44612,44613,44614,
+17257,44615,44616,44617,17258,44618,44619,44620,44621,44622,44623,44624,44625,
+44626,44627,44628,44629,44630,44631,44632,44633,44634,44641,44642,44643,44644,
+44645,44646,17259,44647,44648,44649,17260,44650,44651,44652,17261,44653,44654,
+44655,44656,44657,44658,44659,17262,17263,44660,17264,44661,17265,44662,44663,
+44664,44665,44666,44673,17266,44674,44675,44676,17267,44677,44678,44679,17268,
+44680,44681,44682,44683,44684,44685,44686,17269,44687,44688,44689,44690,17270,
+44691,44692,44693,44694,44695,44696,17271,17272,44697,44698,17273,44699,44700,
+44701,17274,44702,44703,44704,44865,44866,44867,44868,17275,17276,44869,17277,
+44870,17278,44871,44872,44873,44874,44875,44876,44877,44878,44879,44880,44881,
+44882,44883,44884,44885,44886,44887,44888,44889,44890,44897,44898,44899,44900,
+44901,44902,44903,44904,44905,44906,44907,44908,44909,44910,17441,17442,44911,
+44912,17443,44913,44914,17444,17445,17446,44915,44916,44917,44918,44919,44920,
+17447,17448,44921,17449,44922,17450,44929,44930,44931,44932,44933,44934,17451,
+17452,44935,44936,17453,44937,44938,44939,17454,44940,44941,44942,44943,44944,
+44945,44946,17455,17456,44947,17457,44948,17458,44949,44950,44951,44952,44953,
+44954,17459,17460,44955,44956,17461,44957,44958,44959,17462,44960,45121,45122,
+45123,45124,45125,45126,17463,17464,45127,17465,17466,17467,45128,45129,45130,
+45131,45132,45133,17468,17469,45134,45135,45136,45137,45138,45139,45140,45141,
+45142,45143,45144,45145,45146,45153,45154,45155,45156,45157,45158,17470,45159,
+45160,45161,45162,45163,45164,45165,45166,45167,45168,45169,45170,45171,45172,
+45173,45174,45175,45176,45177,45178,45185,45186,45187,45188,45189,45190,45191,
+45192,45193,45194,45195,45196,45197,45198,17471,17472,45199,45200,17473,45201,
+45202,17474,17475,45203,45204,45205,45206,45207,45208,45209,17476,17477,45210,
+17478,17479,17480,45211,45212,45213,45214,45215,45216,17481,17482,45377,45378,
+17483,45379,45380,45381,17484,45382,45383,45384,45385,45386,45387,45388,17485,
+17486,45389,17487,45390,17488,45391,45392,45393,45394,45395,45396,17489,45397,
+45398,45399,17490,45400,45401,45402,17491,45409,45410,45411,45412,45413,45414,
+45415,17492,17493,45416,17494,17495,17496,45417,45418,45419,45420,45421,45422,
+17497,45423,45424,45425,45426,45427,45428,45429,45430,45431,45432,45433,45434,
+45441,45442,45443,45444,45445,45446,45447,45448,45449,45450,45451,45452,45453,
+45454,45455,17498,17499,45456,45457,17500,45458,45459,45460,17501,45461,45462,
+45463,45464,45465,45466,45467,17502,17503,45468,17504,45469,17505,45470,45471,
+45472,45633,45634,45635,17506,17507,45636,45637,17508,45638,45639,45640,17509,
+45641,45642,45643,45644,45645,45646,45647,17510,45648,45649,45650,45651,17511,
+45652,45653,45654,45655,45656,45657,17512,45658,45665,45666,45667,45668,45669,
+45670,45671,45672,45673,45674,45675,45676,45677,45678,45679,45680,45681,45682,
+45683,17513,45684,45685,45686,45687,45688,45689,17514,45690,45697,45698,45699,
+45700,45701,45702,17515,45703,45704,45705,45706,45707,45708,45709,45710,45711,
+45712,45713,45714,45715,45716,45717,45718,45719,45720,45721,17516,45722,45723,
+45724,45725,45726,45727,45728,45889,45890,45891,45892,45893,45894,45895,45896,
+45897,45898,45899,45900,45901,45902,45903,45904,45905,45906,45907,45908,17517,
+17518,45909,45910,17519,45911,45912,45913,17520,45914,45921,45922,45923,45924,
+45925,45926,17521,17522,45927,17523,45928,17524,45929,45930,45931,45932,45933,
+45934,17525,45935,45936,45937,17526,45938,45939,45940,17527,45941,45942,45943,
+45944,45945,45946,45953,45954,45955,45956,45957,45958,17528,45959,45960,45961,
+45962,45963,45964,17529,45965,45966,45967,45968,45969,45970,45971,45972,45973,
+45974,45975,45976,45977,45978,45979,45980,45981,45982,45983,45984,17530,46145,
+46146,46147,46148,46149,46150,17531,17532,46151,46152,17533,46153,46154,46155,
+17534,46156,46157,46158,46159,46160,46161,46162,17697,17698,46163,17699,46164,
+17700,46165,46166,46167,46168,46169,46170,17701,46177,46178,46179,17702,46180,
+46181,46182,17703,46183,46184,46185,46186,46187,46188,46189,17704,46190,46191,
+46192,46193,46194,46195,46196,46197,46198,46199,46200,17705,17706,46201,46202,
+17707,46209,46210,46211,17708,46212,46213,46214,46215,46216,46217,46218,17709,
+17710,46219,46220,46221,17711,46222,46223,46224,46225,46226,46227,46228,46229,
+46230,46231,46232,46233,46234,46235,46236,46237,46238,46239,46240,46401,46402,
+46403,46404,46405,46406,46407,46408,46409,46410,46411,46412,46413,46414,46415,
+17712,17713,46416,46417,17714,46418,46419,46420,17715,46421,46422,46423,46424,
+46425,46426,46433,17716,17717,46434,17718,46435,17719,46436,46437,46438,46439,
+46440,46441,17720,17721,46442,46443,17722,46444,46445,46446,17723,17724,46447,
+46448,46449,46450,46451,46452,17725,17726,46453,17727,17728,17729,46454,46455,
+46456,46457,46458,46465,17730,17731,46466,46467,17732,46468,46469,46470,17733,
+46471,46472,46473,46474,46475,46476,46477,17734,17735,46478,17736,17737,17738,
+46479,46480,46481,46482,46483,46484,17739,46485,46486,46487,46488,46489,46490,
+46491,46492,46493,46494,46495,46496,46657,46658,46659,46660,46661,46662,46663,
+46664,17740,46665,46666,46667,46668,46669,46670,46671,46672,46673,46674,46675,
+46676,46677,46678,46679,46680,46681,46682,46689,46690,46691,46692,46693,46694,
+46695,46696,46697,46698,46699,46700,46701,46702,46703,46704,17741,17742,46705,
+46706,17743,46707,46708,46709,17744,46710,17745,46711,46712,46713,46714,46721,
+17746,17747,46722,17748,17749,17750,46723,46724,46725,46726,46727,46728,17751,
+17752,46729,46730,17753,46731,46732,46733,17754,46734,46735,46736,46737,46738,
+46739,46740,17755,17756,46741,17757,46742,17758,46743,46744,46745,46746,46747,
+46748,17759,46749,46750,46751,17760,46752,46913,46914,46915,46916,46917,46918,
+46919,46920,46921,46922,46923,46924,46925,46926,17761,46927,46928,46929,46930,
+46931,46932,46933,17762,46934,46935,46936,17763,46937,46938,46945,46946,46947,
+46948,46949,46950,46951,46952,46953,46954,46955,46956,46957,46958,46959,46960,
+46961,46962,46963,46964,46965,17764,17765,46966,46967,17766,46968,46969,46970,
+17767,46977,46978,46979,46980,46981,46982,46983,17768,17769,46984,17770,46985,
+17771,46986,46987,46988,46989,17772,46990,17773,46991,46992,46993,17774,46994,
+46995,46996,46997,46998,46999,47000,47001,47002,47003,47004,47005,47006,47007,
+47008,47169,47170,47171,47172,47173,47174,47175,47176,17775,47177,47178,47179,
+47180,47181,47182,47183,47184,47185,47186,47187,47188,47189,47190,47191,47192,
+47193,47194,47201,47202,47203,47204,47205,47206,47207,47208,47209,17776,47210,
+47211,47212,17777,47213,47214,47215,47216,47217,47218,47219,47220,47221,47222,
+47223,47224,47225,47226,17778,47233,17779,47234,47235,47236,47237,47238,47239,
+17780,47240,47241,47242,47243,47244,47245,47246,47247,47248,47249,47250,47251,
+47252,47253,47254,47255,47256,47257,47258,47259,47260,47261,47262,47263,47264,
+47425,47426,17781,17782,47427,47428,17783,47429,47430,47431,17784,47432,47433,
+47434,47435,47436,47437,47438,17785,17786,47439,17787,47440,17788,47441,47442,
+47443,47444,47445,47446,17789,47447,47448,47449,47450,47457,47458,47459,47460,
+47461,47462,47463,47464,47465,47466,47467,47468,47469,47470,47471,17790,47472,
+47473,47474,47475,47476,47477,47478,17953,47479,47480,47481,47482,47489,47490,
+47491,47492,47493,47494,47495,47496,47497,47498,47499,47500,47501,47502,47503,
+47504,47505,47506,47507,47508,47509,47510,47511,17954,17955,47512,47513,17956,
+47514,47515,47516,17957,47517,47518,47519,47520,47681,47682,47683,17958,17959,
+47684,47685,47686,17960,47687,47688,47689,47690,47691,47692,17961,47693,47694,
+47695,17962,47696,47697,47698,17963,47699,47700,47701,47702,47703,47704,47705,
+17964,47706,47713,47714,47715,17965,47716,47717,47718,47719,47720,47721,17966,
+17967,47722,47723,17968,47724,47725,17969,17970,47726,17971,47727,47728,47729,
+47730,47731,17972,17973,47732,17974,47733,47734,47735,47736,47737,47738,47745,
+47746,17975,47747,47748,47749,17976,47750,47751,47752,17977,47753,47754,47755,
+47756,47757,47758,47759,17978,17979,47760,47761,47762,47763,47764,47765,47766,
+47767,47768,47769,17980,17981,47770,47771,17982,47772,47773,47774,17983,47775,
+47776,47937,47938,47939,47940,47941,17984,17985,47942,17986,47943,17987,47944,
+47945,47946,47947,47948,47949,17988,17989,17990,47950,17991,47951,47952,47953,
+17992,47954,17993,47955,47956,47957,47958,47959,17994,17995,47960,17996,17997,
+17998,47961,47962,47969,17999,47970,47971,18000,18001,47972,47973,18002,47974,
+47975,47976,18003,47977,47978,47979,47980,47981,47982,47983,18004,18005,47984,
+18006,18007,18008,47985,47986,47987,47988,47989,47990,18009,18010,47991,47992,
+47993,47994,48001,48002,48003,48004,48005,48006,48007,48008,48009,48010,48011,
+48012,48013,48014,48015,48016,48017,48018,48019,48020,48021,48022,48023,48024,
+48025,48026,48027,48028,48029,48030,48031,48032,48193,48194,48195,48196,48197,
+48198,48199,48200,48201,48202,48203,48204,48205,48206,48207,48208,48209,48210,
+18011,18012,48211,48212,18013,48213,48214,48215,18014,48216,48217,48218,48225,
+48226,48227,48228,18015,18016,48229,18017,18018,18019,48230,48231,48232,48233,
+48234,48235,18020,18021,48236,48237,18022,48238,48239,48240,18023,48241,48242,
+48243,48244,48245,48246,48247,18024,18025,48248,18026,48249,18027,48250,48257,
+48258,48259,48260,48261,18028,48262,48263,48264,18029,48265,48266,48267,18030,
+48268,48269,48270,48271,48272,48273,48274,18031,18032,48275,48276,18033,18034,
+48277,48278,48279,48280,48281,48282,18035,48283,48284,48285,48286,48287,48288,
+48449,18036,48450,48451,48452,48453,48454,48455,48456,48457,18037,48458,18038,
+48459,48460,48461,48462,48463,48464,48465,48466,18039,18040,48467,48468,18041,
+48469,48470,48471,18042,48472,48473,48474,48481,48482,48483,48484,18043,18044,
+48485,18045,48486,18046,48487,48488,48489,48490,48491,48492,18209,48493,48494,
+48495,48496,48497,48498,48499,48500,48501,48502,48503,48504,48505,48506,48513,
+48514,48515,48516,48517,48518,18210,48519,48520,48521,48522,48523,48524,48525,
+48526,48527,48528,48529,48530,48531,48532,48533,48534,48535,48536,48537,48538,
+48539,48540,48541,48542,48543,48544,48705,48706,48707,48708,48709,48710,48711,
+48712,18211,48713,48714,48715,18212,48716,48717,48718,48719,48720,48721,48722,
+48723,48724,48725,48726,48727,48728,48729,48730,48737,48738,48739,48740,48741,
+48742,48743,48744,18213,48745,48746,48747,18214,48748,48749,48750,18215,48751,
+48752,48753,48754,48755,48756,48757,48758,18216,48759,18217,48760,48761,48762,
+48769,48770,48771,48772,48773,18218,18219,48774,48775,18220,48776,48777,18221,
+18222,48778,18223,48779,48780,48781,48782,48783,18224,18225,48784,18226,48785,
+18227,48786,48787,48788,48789,48790,48791,18228,48792,48793,48794,48795,48796,
+48797,48798,48799,48800,48961,48962,48963,48964,48965,48966,48967,48968,48969,
+48970,48971,18229,48972,48973,48974,48975,48976,48977,48978,48979,48980,48981,
+48982,48983,48984,48985,48986,48993,48994,48995,48996,48997,48998,48999,49000,
+49001,49002,49003,49004,49005,49006,49007,49008,49009,49010,49011,18230,49012,
+49013,49014,18231,49015,49016,49017,18232,49018,49025,49026,49027,49028,49029,
+49030,18233,49031,49032,18234,49033,49034,49035,49036,49037,49038,49039,49040,
+18235,49041,49042,49043,18236,49044,49045,49046,18237,49047,49048,49049,49050,
+49051,49052,49053,18238,49054,49055,18239,49056,18240,49217,49218,49219,49220,
+49221,49222,18241,49223,49224,49225,18242,49226,49227,49228,18243,49229,49230,
+49231,49232,49233,49234,49235,18244,18245,49236,18246,49237,49238,49239,49240,
+49241,49242,49249,49250,49251,49252,49253,49254,49255,49256,49257,49258,49259,
+49260,49261,49262,49263,49264,49265,49266,49267,49268,49269,49270,49271,49272,
+49273,49274,49281,49282,49283,49284,18247,18248,49285,49286,18249,49287,49288,
+49289,18250,49290,49291,49292,49293,49294,49295,49296,18251,18252,49297,18253,
+49298,18254,49299,49300,49301,49302,49303,49304,18255,18256,49305,49306,18257,
+49307,49308,49309,18258,49310,49311,49312,49473,18259,49474,49475,18260,18261,
+49476,18262,49477,18263,49478,49479,49480,49481,49482,49483,18264,18265,49484,
+49485,18266,49486,49487,49488,18267,49489,49490,49491,49492,49493,49494,49495,
+18268,18269,49496,18270,18271,18272,49497,49498,49505,49506,49507,49508,18273,
+49509,49510,49511,49512,49513,49514,49515,49516,49517,49518,49519,49520,49521,
+49522,49523,49524,49525,49526,49527,49528,18274,49529,49530,49537,49538,49539,
+49540,49541,49542,49543,49544,49545,49546,49547,49548,49549,49550,49551,49552,
+49553,49554,49555,49556,49557,49558,49559,49560,49561,49562,49563,49564,49565,
+49566,49567,49568,18275,18276,49729,49730,18277,49731,49732,49733,18278,49734,
+18279,49735,49736,49737,49738,49739,18280,18281,49740,18282,49741,18283,49742,
+49743,49744,49745,49746,49747,18284,18285,49748,49749,18286,49750,49751,49752,
+18287,49753,49754,49761,49762,49763,49764,49765,18288,18289,49766,18290,49767,
+18291,49768,49769,49770,49771,49772,49773,18292,18293,49774,49775,18294,49776,
+49777,49778,18295,49779,49780,49781,49782,49783,49784,49785,18296,18297,49786,
+18298,18299,18300,49793,49794,49795,49796,49797,49798,18301,49799,49800,49801,
+18302,49802,49803,49804,18465,49805,49806,49807,49808,49809,49810,49811,49812,
+18466,49813,49814,49815,49816,49817,49818,49819,49820,49821,49822,18467,18468,
+49823,49824,18469,49985,49986,49987,18470,49988,49989,49990,49991,18471,49992,
+49993,18472,18473,49994,18474,49995,18475,49996,49997,49998,18476,49999,50000,
+18477,18478,50001,50002,18479,50003,50004,50005,18480,50006,50007,50008,50009,
+50010,50017,50018,50019,50020,50021,18481,50022,18482,50023,50024,50025,50026,
+50027,50028,18483,18484,50029,50030,18485,50031,50032,50033,50034,50035,50036,
+50037,50038,50039,50040,50041,50042,50049,50050,18486,50051,18487,50052,50053,
+50054,50055,50056,50057,18488,18489,50058,50059,18490,50060,50061,50062,18491,
+50063,50064,50065,50066,50067,50068,50069,50070,18492,50071,18493,50072,18494,
+50073,50074,50075,50076,50077,50078,18495,50079,50080,50241,18496,50242,50243,
+50244,18497,50245,50246,50247,50248,50249,50250,50251,50252,18498,50253,18499,
+50254,50255,50256,50257,50258,50259,50260,50261,18500,18501,50262,50263,18502,
+50264,50265,50266,18503,50273,50274,50275,50276,18504,50277,50278,18505,50279,
+50280,18506,50281,18507,50282,50283,50284,50285,50286,50287,18508,50288,50289,
+50290,18509,50291,50292,50293,18510,50294,50295,50296,50297,50298,50305,50306,
+18511,50307,50308,50309,50310,18512,50311,50312,50313,50314,50315,50316,18513,
+18514,50317,50318,18515,50319,50320,50321,18516,50322,50323,50324,50325,50326,
+50327,50328,50329,50330,50331,50332,50333,18517,50334,50335,50336,50497,50498,
+50499,18518,18519,50500,50501,18520,50502,50503,50504,18521,50505,50506,50507,
+50508,50509,50510,50511,18522,18523,50512,18524,50513,18525,50514,50515,50516,
+50517,50518,50519,18526,18527,50520,50521,18528,50522,50529,50530,18529,50531,
+50532,50533,50534,50535,50536,50537,18530,50538,50539,18531,50540,18532,50541,
+50542,50543,50544,50545,50546,18533,18534,50547,50548,18535,50549,18536,18537,
+18538,18539,50550,50551,50552,50553,50554,50561,18540,18541,50562,18542,50563,
+18543,50564,50565,50566,18544,50567,50568,18545,50569,50570,50571,18546,50572,
+50573,50574,18547,50575,50576,50577,50578,50579,50580,50581,18548,18549,50582,
+50583,50584,18550,50585,50586,50587,50588,50589,50590,18551,18552,50591,50592,
+18553,50753,50754,50755,18554,50756,50757,50758,50759,50760,50761,50762,18555,
+18556,50763,18557,50764,18558,50765,50766,50767,50768,50769,50770,19280,19286,
+19303,19791,19816,20013,20347,20514,20536,20560,20573,20820,20821,20824,20827,
+20828,20829,20830,20831,20832,20834,20835,20836,20837,20838,20840,20841,20842,
+20843,20845,20847,20848,20850,20854,20858,20860,20861,20862,21026,21027,21031,
+21032,21033,21034,21035,21037,21042,21054,21058,21059,21060,21062,21063,21064,
+21065,21066,21067,21069,21070,21071,21072,21073,21074,21075,21076,21077,21078,
+21079,21081,21082,21086,21087,21089,21090,21092,21093,21094,21095,21096,21097,
+21098,21099,21104,21105,21106,21107,21108,21109,21111,21112,21606,21628,21797,
+21803,21806,22072,22093,22347,22372,23365,23396,23589,23845,23893,23924,24188,
+24190,24371,24417,24424,24689,24877,24941,25461,25633,25641,25902,25905,25906,
+25913,25915,25916,25924,25934,25936,25938,25942,25978,25979,25980,25982,26145,
+26148,26151,26157,26159,26160,26161,26163,26167,26168,26172,26180,26182,26183,
+26186,26194,26198,26201,26204,26207,26209,26212,26213,26214,26216,26218,26219,
+26220,26223,26225,26226,26229,26230,26231,26233,26401,26406,26409,26410,26412,
+26413,26416,26431,26433,26438,26439,26443,26445,26447,26448,26451,26463,26468,
+26470,26487,26727,26728,26736,26737,26743,26745,26747,26750,26919,26924,26956,
+26999,27201,27237,27252,27255,27260,27262,27428,27431,27433,27434,27450,27451,
+27453,27457,27458,27462,27463,27468,27471,27472,27473,27474,27480,27686,27687,
+27690,27695,27696,27697,27698,27701,27704,27706,27712,27713,27717,27718,27721,
+27722,27733,27741,27742,27745,27748,27751,27752,27767,27768,27770,27937,27938,
+27939,28014,28251,29245,29306,29489,29735,29806,30324,30326,30520,30536,30547,
+30811,30832,31265,31266,31334,31785,8993,8994,8995,8996,8997,8998,8999,9000,
+9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,
+9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,
+9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,
+9046,9047,9048,9049,9050,9051,8492,9053,9054,9055,9056,9057,9058,9059,9060,
+9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,
+9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,8742,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,8523,8524,8574,9086,N,8525,9052,
+};
+
+static const struct unim_index cp949_encmap[256] = {
+{__cp949_encmap+0,161,254},{__cp949_encmap+94,17,103},{__cp949_encmap+181,199,
+221},{__cp949_encmap+204,145,201},{__cp949_encmap+261,1,81},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp949_encmap+342,21,172},{
+__cp949_encmap+494,3,212},{__cp949_encmap+704,0,165},{__cp949_encmap+870,18,18
+},{__cp949_encmap+871,96,233},{__cp949_encmap+1009,0,209},{__cp949_encmap+1219
+,5,109},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{__cp949_encmap+1324,0,246},{__cp949_encmap+1571,49,142},{__cp949_encmap+
+1665,0,127},{__cp949_encmap+1793,128,221},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{__cp949_encmap+1887,0,251},{__cp949_encmap+2139,1,250},{
+__cp949_encmap+2389,2,255},{__cp949_encmap+2643,0,253},{__cp949_encmap+2897,0,
+255},{__cp949_encmap+3153,5,248},{__cp949_encmap+3397,3,250},{__cp949_encmap+
+3645,4,254},{__cp949_encmap+3896,6,250},{__cp949_encmap+4141,3,252},{
+__cp949_encmap+4391,0,253},{__cp949_encmap+4645,15,255},{__cp949_encmap+4886,
+1,233},{__cp949_encmap+5119,5,250},{__cp949_encmap+5365,1,253},{__cp949_encmap
++5618,7,254},{__cp949_encmap+5866,2,251},{__cp949_encmap+6116,1,255},{
+__cp949_encmap+6371,15,251},{__cp949_encmap+6608,1,255},{__cp949_encmap+6863,
+0,255},{__cp949_encmap+7119,1,247},{__cp949_encmap+7366,13,254},{
+__cp949_encmap+7608,0,255},{__cp949_encmap+7864,6,255},{__cp949_encmap+8114,0,
+254},{__cp949_encmap+8369,18,250},{__cp949_encmap+8602,0,255},{__cp949_encmap+
+8858,2,251},{__cp949_encmap+9108,4,236},{__cp949_encmap+9341,8,243},{
+__cp949_encmap+9577,11,251},{__cp949_encmap+9818,23,255},{__cp949_encmap+10051
+,1,254},{__cp949_encmap+10305,1,253},{__cp949_encmap+10558,4,255},{
+__cp949_encmap+10810,0,253},{__cp949_encmap+11064,10,254},{__cp949_encmap+
+11309,1,247},{__cp949_encmap+11556,1,252},{__cp949_encmap+11808,0,254},{
+__cp949_encmap+12063,1,243},{__cp949_encmap+12306,2,251},{__cp949_encmap+12556
+,1,251},{__cp949_encmap+12807,0,255},{__cp949_encmap+13063,15,233},{
+__cp949_encmap+13282,7,254},{__cp949_encmap+13530,0,251},{__cp949_encmap+13782
+,9,156},{__cp949_encmap+13930,54,252},{__cp949_encmap+14129,0,253},{
+__cp949_encmap+14383,2,254},{__cp949_encmap+14636,5,254},{__cp949_encmap+14886
+,1,253},{__cp949_encmap+15139,3,252},{__cp949_encmap+15389,17,255},{
+__cp949_encmap+15628,2,254},{__cp949_encmap+15881,0,254},{__cp949_encmap+16136
+,5,253},{__cp949_encmap+16385,7,248},{__cp949_encmap+16627,0,254},{
+__cp949_encmap+16882,0,154},{__cp949_encmap+17037,55,253},{__cp949_encmap+
+17236,4,243},{__cp949_encmap+17476,10,254},{__cp949_encmap+17721,3,253},{
+__cp949_encmap+17972,0,253},{__cp949_encmap+18226,2,245},{__cp949_encmap+18470
+,13,252},{__cp949_encmap+18710,4,246},{__cp949_encmap+18953,4,127},{
+__cp949_encmap+19077,119,226},{__cp949_encmap+19185,28,251},{__cp949_encmap+
+19409,0,255},{__cp949_encmap+19665,0,254},{__cp949_encmap+19920,3,255},{
+__cp949_encmap+20173,1,238},{__cp949_encmap+20411,26,232},{__cp949_encmap+
+20618,13,246},{__cp949_encmap+20852,9,250},{__cp949_encmap+21094,26,244},{
+__cp949_encmap+21313,7,156},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp949_encmap+21463,0,255},{
+__cp949_encmap+21719,0,255},{__cp949_encmap+21975,0,255},{__cp949_encmap+22231
+,0,255},{__cp949_encmap+22487,0,255},{__cp949_encmap+22743,0,255},{
+__cp949_encmap+22999,0,255},{__cp949_encmap+23255,0,255},{__cp949_encmap+23511
+,0,255},{__cp949_encmap+23767,0,255},{__cp949_encmap+24023,0,255},{
+__cp949_encmap+24279,0,255},{__cp949_encmap+24535,0,255},{__cp949_encmap+24791
+,0,255},{__cp949_encmap+25047,0,255},{__cp949_encmap+25303,0,255},{
+__cp949_encmap+25559,0,255},{__cp949_encmap+25815,0,255},{__cp949_encmap+26071
+,0,255},{__cp949_encmap+26327,0,255},{__cp949_encmap+26583,0,255},{
+__cp949_encmap+26839,0,255},{__cp949_encmap+27095,0,255},{__cp949_encmap+27351
+,0,255},{__cp949_encmap+27607,0,255},{__cp949_encmap+27863,0,255},{
+__cp949_encmap+28119,0,255},{__cp949_encmap+28375,0,255},{__cp949_encmap+28631
+,0,255},{__cp949_encmap+28887,0,255},{__cp949_encmap+29143,0,255},{
+__cp949_encmap+29399,0,255},{__cp949_encmap+29655,0,255},{__cp949_encmap+29911
+,0,255},{__cp949_encmap+30167,0,255},{__cp949_encmap+30423,0,255},{
+__cp949_encmap+30679,0,255},{__cp949_encmap+30935,0,255},{__cp949_encmap+31191
+,0,255},{__cp949_encmap+31447,0,255},{__cp949_encmap+31703,0,255},{
+__cp949_encmap+31959,0,255},{__cp949_encmap+32215,0,255},{__cp949_encmap+32471
+,0,163},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp949_encmap+32635,0,255},{
+__cp949_encmap+32891,0,11},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp949_encmap+
+32903,1,230},
+};
+
diff --git a/contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h b/contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h
new file mode 100644
index 00000000000..ceb4bc56a21
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/mappings_tw.h
@@ -0,0 +1,2635 @@
+// AUTO-GENERATED FILE FROM genmap_tchinese.py: DO NOT EDIT
+static const ucs2_t __big5_decmap[16702] = {
+12288,65292,12289,12290,65294,8226,65307,65306,65311,65281,65072,8230,8229,
+65104,65380,65106,183,65108,65109,65110,65111,65372,8211,65073,8212,65075,
+9588,65076,65103,65288,65289,65077,65078,65371,65373,65079,65080,12308,12309,
+65081,65082,12304,12305,65083,65084,12298,12299,65085,65086,12296,12297,65087,
+65088,12300,12301,65089,65090,12302,12303,65091,65092,65113,65114,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,65115,65116,65117,
+65118,8216,8217,8220,8221,12317,12318,8245,8242,65283,65286,65290,8251,167,
+12291,9675,9679,9651,9650,9678,9734,9733,9671,9670,9633,9632,9661,9660,12963,
+8453,8254,65507,65343,717,65097,65098,65101,65102,65099,65100,65119,65120,
+65121,65291,65293,215,247,177,8730,65308,65310,65309,8806,8807,8800,8734,8786,
+8801,65122,65123,65124,65125,65126,8764,8745,8746,8869,8736,8735,8895,13266,
+13265,8747,8750,8757,8756,9792,9794,9793,9737,8593,8595,8592,8594,8598,8599,
+8601,8600,8741,8739,65295,65340,65295,65340,65284,165,12306,162,163,65285,
+65312,8451,8457,65129,65130,65131,13269,13212,13213,13214,13262,13217,13198,
+13199,13252,176,20825,20827,20830,20829,20833,20835,21991,29929,31950,9601,
+9602,9603,9604,9605,9606,9607,9608,9615,9614,9613,9612,9611,9610,9609,9532,
+9524,9516,9508,9500,9620,9472,9474,9621,9484,9488,9492,9496,9581,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,9582,9584,9583,9552,
+9566,9578,9569,9698,9699,9701,9700,9585,9586,9587,65296,65297,65298,65299,
+65300,65301,65302,65303,65304,65305,8544,8545,8546,8547,8548,8549,8550,8551,
+8552,8553,12321,12322,12323,12324,12325,12326,12327,12328,12329,21313,21316,
+21317,65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,
+65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,65337,
+65338,65345,65346,65347,65348,65349,65350,65351,65352,65353,65354,65355,65356,
+65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,
+65370,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,
+932,933,934,935,936,937,945,946,947,948,949,950,951,952,953,954,955,956,957,
+958,959,960,961,963,964,965,966,967,968,969,12549,12550,12551,12552,12553,
+12554,12555,12556,12557,12558,12559,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,12560,12561,12562,12563,12564,12565,12566,12567,
+12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,
+12581,12582,12583,12584,12585,729,713,714,711,715,19968,20057,19969,19971,
+20035,20061,20102,20108,20154,20799,20837,20843,20960,20992,20993,21147,21269,
+21313,21340,21448,19977,19979,19976,19978,20011,20024,20961,20037,20040,20063,
+20062,20110,20129,20800,20995,21242,21315,21449,21475,22303,22763,22805,22823,
+22899,23376,23377,23379,23544,23567,23586,23608,23665,24029,24037,24049,24050,
+24051,24062,24178,24318,24331,24339,25165,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,19985,19984,19981,20013,20016,20025,20043,
+23609,20104,20113,20117,20114,20116,20130,20161,20160,20163,20166,20167,20173,
+20170,20171,20164,20803,20801,20839,20845,20846,20844,20887,20982,20998,20999,
+21000,21243,21246,21247,21270,21305,21320,21319,21317,21342,21380,21451,21450,
+21453,22764,22825,22827,22826,22829,23380,23569,23588,23610,23663,24052,24187,
+24319,24340,24341,24515,25096,25142,25163,25166,25903,25991,26007,26020,26041,
+26085,26352,26376,26408,27424,27490,27513,27595,27604,27611,27663,27700,28779,
+29226,29238,29243,29255,29273,29275,29356,29579,19993,19990,19989,19988,19992,
+20027,20045,20047,20046,20197,20184,20180,20181,20182,20183,20195,20196,20185,
+20190,20805,20804,20873,20874,20908,20985,20986,20984,21002,21152,21151,21253,
+21254,21271,21277,20191,21322,21321,21345,21344,21359,21358,21435,21487,21476,
+21491,21484,21486,21481,21480,21500,21496,21493,21483,21478,21482,21490,21489,
+21488,21477,21485,21499,22235,22234,22806,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,22830,22833,22900,22902,23381,23427,23612,
+24040,24039,24038,24066,24067,24179,24188,24321,24344,24343,24517,25098,25171,
+25172,25170,25169,26021,26086,26414,26412,26410,26411,26413,27491,27597,27665,
+27664,27704,27713,27712,27710,29359,29572,29577,29916,29926,29976,29983,29992,
+29993,30000,30001,30002,30003,30091,30333,30382,30399,30446,30683,30690,30707,
+31034,31166,31348,31435,19998,19999,20050,20051,20073,20121,20132,20134,20133,
+20223,20233,20249,20234,20245,20237,20240,20241,20239,20210,20214,20219,20208,
+20211,20221,20225,20235,20809,20807,20806,20808,20840,20849,20877,20912,21015,
+21009,21010,21006,21014,21155,21256,21281,21280,21360,21361,21513,21519,21516,
+21514,21520,21505,21515,21508,21521,21517,21512,21507,21518,21510,21522,22240,
+22238,22237,22323,22320,22312,22317,22316,22319,22313,22809,22810,22839,22840,
+22916,22904,22915,22909,22905,22914,22913,23383,23384,23431,23432,23429,23433,
+23546,23574,23673,24030,24070,24182,24180,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24335,24347,24537,24534,25102,25100,25101,
+25104,25187,25179,25176,25910,26089,26088,26092,26093,26354,26355,26377,26429,
+26420,26417,26421,27425,27492,27515,27670,27741,27735,27737,27743,27744,27728,
+27733,27745,27739,27725,27726,28784,29279,29277,30334,31481,31859,31992,32566,
+32650,32701,32769,32771,32780,32786,32819,32895,32905,32907,32908,33251,33258,
+33267,33276,33292,33307,33311,33390,33394,33406,34411,34880,34892,34915,35199,
+38433,20018,20136,20301,20303,20295,20311,20318,20276,20315,20309,20272,20304,
+20305,20285,20282,20280,20291,20308,20284,20294,20323,20316,20320,20271,20302,
+20278,20313,20317,20296,20314,20812,20811,20813,20853,20918,20919,21029,21028,
+21033,21034,21032,21163,21161,21162,21164,21283,21363,21365,21533,21549,21534,
+21566,21542,21582,21543,21574,21571,21555,21576,21570,21531,21545,21578,21561,
+21563,21560,21550,21557,21558,21536,21564,21568,21553,21547,21535,21548,22250,
+22256,22244,22251,22346,22353,22336,22349,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,22343,22350,22334,22352,22351,22331,22767,
+22846,22941,22930,22952,22942,22947,22937,22934,22925,22948,22931,22922,22949,
+23389,23388,23386,23387,23436,23435,23439,23596,23616,23617,23615,23614,23696,
+23697,23700,23692,24043,24076,24207,24199,24202,24311,24324,24351,24420,24418,
+24439,24441,24536,24524,24535,24525,24561,24555,24568,24554,25106,25105,25220,
+25239,25238,25216,25206,25225,25197,25226,25212,25214,25209,25203,25234,25199,
+25240,25198,25237,25235,25233,25222,25913,25915,25912,26097,26356,26463,26446,
+26447,26448,26449,26460,26454,26462,26441,26438,26464,26451,26455,27493,27599,
+27714,27742,27801,27777,27784,27785,27781,27803,27754,27770,27792,27760,27788,
+27752,27798,27794,27773,27779,27762,27774,27764,27782,27766,27789,27796,27800,
+27778,28790,28796,28797,28792,29282,29281,29280,29380,29378,29590,29996,29995,
+30007,30008,30338,30447,30691,31169,31168,31167,31350,31995,32597,32918,32915,
+32925,32920,32923,32922,32946,33391,33426,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33419,33421,35211,35282,35328,35895,35910,
+35925,35997,36196,36208,36275,36523,36554,36763,36784,36802,36806,36805,36804,
+24033,37009,37026,37034,37030,37027,37193,37318,37324,38450,38446,38449,38442,
+38444,20006,20054,20083,20107,20123,20126,20139,20140,20335,20381,20365,20339,
+20351,20332,20379,20363,20358,20355,20336,20341,20360,20329,20347,20374,20350,
+20367,20369,20346,20820,20818,20821,20841,20855,20854,20856,20925,20989,21051,
+21048,21047,21050,21040,21038,21046,21057,21182,21179,21330,21332,21331,21329,
+21350,21367,21368,21369,21462,21460,21463,21619,21621,21654,21624,21653,21632,
+21627,21623,21636,21650,21638,21628,21648,21617,21622,21644,21658,21602,21608,
+21643,21629,21646,22266,22403,22391,22378,22377,22369,22374,22372,22396,22812,
+22857,22855,22856,22852,22868,22974,22971,22996,22969,22958,22993,22982,22992,
+22989,22987,22995,22986,22959,22963,22994,22981,23391,23396,23395,23447,23450,
+23448,23452,23449,23451,23578,23624,23621,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,23622,23735,23713,23736,23721,23723,23729,
+23731,24088,24090,24086,24085,24091,24081,24184,24218,24215,24220,24213,24214,
+24310,24358,24359,24361,24448,24449,24447,24444,24541,24544,24573,24565,24575,
+24591,24596,24623,24629,24598,24618,24597,24609,24615,24617,24619,24603,25110,
+25109,25151,25150,25152,25215,25289,25292,25284,25279,25282,25273,25298,25307,
+25259,25299,25300,25291,25288,25256,25277,25276,25296,25305,25287,25293,25269,
+25306,25265,25304,25302,25303,25286,25260,25294,25918,26023,26044,26106,26132,
+26131,26124,26118,26114,26126,26112,26127,26133,26122,26119,26381,26379,26477,
+26507,26517,26481,26524,26483,26487,26503,26525,26519,26479,26480,26495,26505,
+26494,26512,26485,26522,26515,26492,26474,26482,27427,27494,27495,27519,27667,
+27675,27875,27880,27891,27825,27852,27877,27827,27837,27838,27836,27874,27819,
+27861,27859,27832,27844,27833,27841,27822,27863,27845,27889,27839,27835,27873,
+27867,27850,27820,27887,27868,27862,27872,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,28821,28814,28818,28810,28825,29228,29229,
+29240,29256,29287,29289,29376,29390,29401,29399,29392,29609,29608,29599,29611,
+29605,30013,30109,30105,30106,30340,30402,30450,30452,30693,30717,31038,31040,
+31041,31177,31176,31354,31353,31482,31998,32596,32652,32651,32773,32954,32933,
+32930,32945,32929,32939,32937,32948,32938,32943,33253,33278,33293,33459,33437,
+33433,33453,33469,33439,33465,33457,33452,33445,33455,33464,33443,33456,33470,
+33463,34382,34417,21021,34920,36555,36814,36820,36817,37045,37048,37041,37046,
+37319,37329,38263,38272,38428,38464,38463,38459,38468,38466,38585,38632,38738,
+38750,20127,20141,20142,20449,20405,20399,20415,20448,20433,20431,20445,20419,
+20406,20440,20447,20426,20439,20398,20432,20420,20418,20442,20430,20446,20407,
+20823,20882,20881,20896,21070,21059,21066,21069,21068,21067,21063,21191,21193,
+21187,21185,21261,21335,21371,21402,21467,21676,21696,21672,21710,21705,21688,
+21670,21683,21703,21698,21693,21674,21697,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,21700,21704,21679,21675,21681,21691,21673,
+21671,21695,22271,22402,22411,22432,22435,22434,22478,22446,22419,22869,22865,
+22863,22862,22864,23004,23000,23039,23011,23016,23043,23013,23018,23002,23014,
+23041,23035,23401,23459,23462,23460,23458,23461,23553,23630,23631,23629,23627,
+23769,23762,24055,24093,24101,24095,24189,24224,24230,24314,24328,24365,24421,
+24456,24453,24458,24459,24455,24460,24457,24594,24605,24608,24613,24590,24616,
+24653,24688,24680,24674,24646,24643,24684,24683,24682,24676,25153,25308,25366,
+25353,25340,25325,25345,25326,25341,25351,25329,25335,25327,25324,25342,25332,
+25361,25346,25919,25925,26027,26045,26082,26149,26157,26144,26151,26159,26143,
+26152,26161,26148,26359,26623,26579,26609,26580,26576,26604,26550,26543,26613,
+26601,26607,26564,26577,26548,26586,26597,26552,26575,26590,26611,26544,26585,
+26594,26589,26578,27498,27523,27526,27573,27602,27607,27679,27849,27915,27954,
+27946,27969,27941,27916,27953,27934,27927,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,27963,27965,27966,27958,27931,27893,27961,
+27943,27960,27945,27950,27957,27918,27947,28843,28858,28851,28844,28847,28845,
+28856,28846,28836,29232,29298,29295,29300,29417,29408,29409,29623,29642,29627,
+29618,29645,29632,29619,29978,29997,30031,30028,30030,30027,30123,30116,30117,
+30114,30115,30328,30342,30343,30344,30408,30406,30403,30405,30465,30457,30456,
+30473,30475,30462,30460,30471,30684,30722,30740,30732,30733,31046,31049,31048,
+31047,31161,31162,31185,31186,31179,31359,31361,31487,31485,31869,32002,32005,
+32000,32009,32007,32004,32006,32568,32654,32703,32772,32784,32781,32785,32822,
+32982,32997,32986,32963,32964,32972,32993,32987,32974,32990,32996,32989,33268,
+33314,33511,33539,33541,33507,33499,33510,33540,33509,33538,33545,33490,33495,
+33521,33537,33500,33492,33489,33502,33491,33503,33519,33542,34384,34425,34427,
+34426,34893,34923,35201,35284,35336,35330,35331,35998,36000,36212,36211,36276,
+36557,36556,36848,36838,36834,36842,36837,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,36845,36843,36836,36840,37066,37070,37057,
+37059,37195,37194,37325,38274,38480,38475,38476,38477,38754,38761,38859,38893,
+38899,38913,39080,39131,39135,39318,39321,20056,20147,20492,20493,20515,20463,
+20518,20517,20472,20521,20502,20486,20540,20511,20506,20498,20497,20474,20480,
+20500,20520,20465,20513,20491,20505,20504,20467,20462,20525,20522,20478,20523,
+20489,20860,20900,20901,20898,20941,20940,20934,20939,21078,21084,21076,21083,
+21085,21290,21375,21407,21405,21471,21736,21776,21761,21815,21756,21733,21746,
+21766,21754,21780,21737,21741,21729,21769,21742,21738,21734,21799,21767,21757,
+21775,22275,22276,22466,22484,22475,22467,22537,22799,22871,22872,22874,23057,
+23064,23068,23071,23067,23059,23020,23072,23075,23081,23077,23052,23049,23403,
+23640,23472,23475,23478,23476,23470,23477,23481,23480,23556,23633,23637,23632,
+23789,23805,23803,23786,23784,23792,23798,23809,23796,24046,24109,24107,24235,
+24237,24231,24369,24466,24465,24464,24665,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24675,24677,24656,24661,24685,24681,24687,
+24708,24735,24730,24717,24724,24716,24709,24726,25159,25331,25352,25343,25422,
+25406,25391,25429,25410,25414,25423,25417,25402,25424,25405,25386,25387,25384,
+25421,25420,25928,25929,26009,26049,26053,26178,26185,26191,26179,26194,26188,
+26181,26177,26360,26388,26389,26391,26657,26680,26696,26694,26707,26681,26690,
+26708,26665,26803,26647,26700,26705,26685,26612,26704,26688,26684,26691,26666,
+26693,26643,26648,26689,27530,27529,27575,27683,27687,27688,27686,27684,27888,
+28010,28053,28040,28039,28006,28024,28023,27993,28051,28012,28041,28014,27994,
+28020,28009,28044,28042,28025,28037,28005,28052,28874,28888,28900,28889,28872,
+28879,29241,29305,29436,29433,29437,29432,29431,29574,29677,29705,29678,29664,
+29674,29662,30036,30045,30044,30042,30041,30142,30149,30151,30130,30131,30141,
+30140,30137,30146,30136,30347,30384,30410,30413,30414,30505,30495,30496,30504,
+30697,30768,30759,30776,30749,30772,30775,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30757,30765,30752,30751,30770,31061,31056,
+31072,31071,31062,31070,31069,31063,31066,31204,31203,31207,31199,31206,31209,
+31192,31364,31368,31449,31494,31505,31881,32033,32023,32011,32010,32032,32034,
+32020,32016,32021,32026,32028,32013,32025,32027,32570,32607,32660,32709,32705,
+32774,32792,32789,32793,32791,32829,32831,33009,33026,33008,33029,33005,33012,
+33030,33016,33011,33032,33021,33034,33020,33007,33261,33260,33280,33296,33322,
+33323,33320,33324,33467,33579,33618,33620,33610,33592,33616,33609,33589,33588,
+33615,33586,33593,33590,33559,33600,33585,33576,33603,34388,34442,34474,34451,
+34468,34473,34444,34467,34460,34928,34935,34945,34946,34941,34937,35352,35344,
+35342,35340,35349,35338,35351,35347,35350,35343,35345,35912,35962,35961,36001,
+36002,36215,36524,36562,36564,36559,36785,36865,36870,36855,36864,36858,36852,
+36867,36861,36869,36856,37013,37089,37085,37090,37202,37197,37196,37336,37341,
+37335,37340,37337,38275,38498,38499,38497,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,38491,38493,38500,38488,38494,38587,39138,
+39340,39592,39640,39717,39730,39740,20094,20602,20605,20572,20551,20547,20556,
+20570,20553,20581,20598,20558,20565,20597,20596,20599,20559,20495,20591,20589,
+20828,20885,20976,21098,21103,21202,21209,21208,21205,21264,21263,21273,21311,
+21312,21310,21443,26364,21830,21866,21862,21828,21854,21857,21827,21834,21809,
+21846,21839,21845,21807,21860,21816,21806,21852,21804,21859,21811,21825,21847,
+22280,22283,22281,22495,22533,22538,22534,22496,22500,22522,22530,22581,22519,
+22521,22816,22882,23094,23105,23113,23142,23146,23104,23100,23138,23130,23110,
+23114,23408,23495,23493,23492,23490,23487,23494,23561,23560,23559,23648,23644,
+23645,23815,23814,23822,23835,23830,23842,23825,23849,23828,23833,23844,23847,
+23831,24034,24120,24118,24115,24119,24247,24248,24246,24245,24254,24373,24375,
+24407,24428,24425,24427,24471,24473,24478,24472,24481,24480,24476,24703,24739,
+24713,24736,24744,24779,24756,24806,24765,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24773,24763,24757,24796,24764,24792,24789,
+24774,24799,24760,24794,24775,25114,25115,25160,25504,25511,25458,25494,25506,
+25509,25463,25447,25496,25514,25457,25513,25481,25475,25499,25451,25512,25476,
+25480,25497,25505,25516,25490,25487,25472,25467,25449,25448,25466,25949,25942,
+25937,25945,25943,21855,25935,25944,25941,25940,26012,26011,26028,26063,26059,
+26060,26062,26205,26202,26212,26216,26214,26206,26361,21207,26395,26753,26799,
+26786,26771,26805,26751,26742,26801,26791,26775,26800,26755,26820,26797,26758,
+26757,26772,26781,26792,26783,26785,26754,27442,27578,27627,27628,27691,28046,
+28092,28147,28121,28082,28129,28108,28132,28155,28154,28165,28103,28107,28079,
+28113,28078,28126,28153,28088,28151,28149,28101,28114,28186,28085,28122,28139,
+28120,28138,28145,28142,28136,28102,28100,28074,28140,28095,28134,28921,28937,
+28938,28925,28911,29245,29309,29313,29468,29467,29462,29459,29465,29575,29701,
+29706,29699,29702,29694,29709,29920,29942,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,29943,29980,29986,30053,30054,30050,30064,
+30095,30164,30165,30133,30154,30157,30350,30420,30418,30427,30519,30526,30524,
+30518,30520,30522,30827,30787,30798,31077,31080,31085,31227,31378,31381,31520,
+31528,31515,31532,31526,31513,31518,31534,31890,31895,31893,32070,32067,32113,
+32046,32057,32060,32064,32048,32051,32068,32047,32066,32050,32049,32573,32670,
+32666,32716,32718,32722,32796,32842,32838,33071,33046,33059,33067,33065,33072,
+33060,33282,33333,33335,33334,33337,33678,33694,33688,33656,33698,33686,33725,
+33707,33682,33674,33683,33673,33696,33655,33659,33660,33670,33703,34389,24426,
+34503,34496,34486,34500,34485,34502,34507,34481,34479,34505,34899,34974,34952,
+34987,34962,34966,34957,34955,35219,35215,35370,35357,35363,35365,35377,35373,
+35359,35355,35362,35913,35930,36009,36012,36011,36008,36010,36007,36199,36198,
+36286,36282,36571,36575,36889,36877,36890,36887,36899,36895,36893,36880,36885,
+36894,36896,36879,36898,36886,36891,36884,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,37096,37101,37117,37207,37326,37365,37350,
+37347,37351,37357,37353,38281,38506,38517,38515,38520,38512,38516,38518,38519,
+38508,38592,38634,38633,31456,31455,38914,38915,39770,40165,40565,40575,40613,
+40635,20642,20621,20613,20633,20625,20608,20630,20632,20634,26368,20977,21106,
+21108,21109,21097,21214,21213,21211,21338,21413,21883,21888,21927,21884,21898,
+21917,21912,21890,21916,21930,21908,21895,21899,21891,21939,21934,21919,21822,
+21938,21914,21947,21932,21937,21886,21897,21931,21913,22285,22575,22570,22580,
+22564,22576,22577,22561,22557,22560,22777,22778,22880,23159,23194,23167,23186,
+23195,23207,23411,23409,23506,23500,23507,23504,23562,23563,23601,23884,23888,
+23860,23879,24061,24133,24125,24128,24131,24190,24266,24257,24258,24260,24380,
+24429,24489,24490,24488,24785,24801,24754,24758,24800,24860,24867,24826,24853,
+24816,24827,24820,24936,24817,24846,24822,24841,24832,24850,25119,25161,25507,
+25484,25551,25536,25577,25545,25542,25549,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,25554,25571,25552,25569,25558,25581,25582,
+25462,25588,25578,25563,25682,25562,25593,25950,25958,25954,25955,26001,26000,
+26031,26222,26224,26228,26230,26223,26257,26234,26238,26231,26366,26367,26399,
+26397,26874,26837,26848,26840,26839,26885,26847,26869,26862,26855,26873,26834,
+26866,26851,26827,26829,26893,26898,26894,26825,26842,26990,26875,27454,27450,
+27453,27544,27542,27580,27631,27694,27695,27692,28207,28216,28244,28193,28210,
+28263,28234,28192,28197,28195,28187,28251,28248,28196,28246,28270,28205,28198,
+28271,28212,28237,28218,28204,28227,28189,28222,28363,28297,28185,28238,28259,
+28228,28274,28265,28255,28953,28954,28966,28976,28961,28982,29038,28956,29260,
+29316,29312,29494,29477,29492,29481,29754,29738,29747,29730,29733,29749,29750,
+29748,29743,29723,29734,29736,29989,29990,30059,30058,30178,30171,30179,30169,
+30168,30174,30176,30331,30332,30358,30355,30388,30428,30543,30701,30813,30828,
+30831,31245,31240,31243,31237,31232,31384,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,31383,31382,31461,31459,31561,31574,31558,
+31568,31570,31572,31565,31563,31567,31569,31903,31909,32094,32080,32104,32085,
+32043,32110,32114,32097,32102,32098,32112,32115,21892,32724,32725,32779,32850,
+32901,33109,33108,33099,33105,33102,33081,33094,33086,33100,33107,33140,33298,
+33308,33769,33795,33784,33805,33760,33733,33803,33729,33775,33777,33780,33879,
+33802,33776,33804,33740,33789,33778,33738,33848,33806,33796,33756,33799,33748,
+33759,34395,34527,34521,34541,34516,34523,34532,34512,34526,34903,35009,35010,
+34993,35203,35222,35387,35424,35413,35422,35388,35393,35412,35419,35408,35398,
+35380,35386,35382,35414,35937,35970,36015,36028,36019,36029,36033,36027,36032,
+36020,36023,36022,36031,36024,36234,36229,36225,36302,36317,36299,36314,36305,
+36300,36315,36294,36603,36600,36604,36764,36910,36917,36913,36920,36914,36918,
+37122,37109,37129,37118,37219,37221,37327,37396,37397,37411,37385,37406,37389,
+37392,37383,37393,38292,38287,38283,38289,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,38291,38290,38286,38538,38542,38539,38525,
+38533,38534,38541,38514,38532,38593,38597,38596,38598,38599,38639,38642,38860,
+38917,38918,38920,39143,39146,39151,39145,39154,39149,39342,39341,40643,40653,
+40657,20098,20653,20661,20658,20659,20677,20670,20652,20663,20667,20655,20679,
+21119,21111,21117,21215,21222,21220,21218,21219,21295,21983,21992,21971,21990,
+21966,21980,21959,21969,21987,21988,21999,21978,21985,21957,21958,21989,21961,
+22290,22291,22622,22609,22616,22615,22618,22612,22635,22604,22637,22602,22626,
+22610,22603,22887,23233,23241,23244,23230,23229,23228,23219,23234,23218,23913,
+23919,24140,24185,24265,24264,24338,24409,24492,24494,24858,24847,24904,24863,
+24819,24859,24825,24833,24840,24910,24908,24900,24909,24894,24884,24871,24845,
+24838,24887,25121,25122,25619,25662,25630,25642,25645,25661,25644,25615,25628,
+25620,25613,25654,25622,25623,25606,25964,26015,26032,26263,26249,26247,26248,
+26262,26244,26264,26253,26371,27028,26989,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,26970,26999,26976,26964,26997,26928,27010,
+26954,26984,26987,26974,26963,27001,27014,26973,26979,26971,27463,27506,27584,
+27583,27603,27645,28322,28335,28371,28342,28354,28304,28317,28359,28357,28325,
+28312,28348,28346,28331,28369,28310,28316,28356,28372,28330,28327,28340,29006,
+29017,29033,29028,29001,29031,29020,29036,29030,29004,29029,29022,28998,29032,
+29014,29242,29266,29495,29509,29503,29502,29807,29786,29781,29791,29790,29761,
+29759,29785,29787,29788,30070,30072,30208,30192,30209,30194,30193,30202,30207,
+30196,30195,30430,30431,30555,30571,30566,30558,30563,30585,30570,30572,30556,
+30565,30568,30562,30702,30862,30896,30871,30872,30860,30857,30844,30865,30867,
+30847,31098,31103,31105,33836,31165,31260,31258,31264,31252,31263,31262,31391,
+31392,31607,31680,31584,31598,31591,31921,31923,31925,32147,32121,32145,32129,
+32143,32091,32622,32617,32618,32626,32681,32680,32676,32854,32856,32902,32900,
+33137,33136,33144,33125,33134,33139,33131,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33145,33146,33126,33285,33351,33922,33911,
+33853,33841,33909,33894,33899,33865,33900,33883,33852,33845,33889,33891,33897,
+33901,33862,34398,34396,34399,34553,34579,34568,34567,34560,34558,34555,34562,
+34563,34566,34570,34905,35039,35028,35033,35036,35032,35037,35041,35018,35029,
+35026,35228,35299,35435,35442,35443,35430,35433,35440,35463,35452,35427,35488,
+35441,35461,35437,35426,35438,35436,35449,35451,35390,35432,35938,35978,35977,
+36042,36039,36040,36036,36018,36035,36034,36037,36321,36319,36328,36335,36339,
+36346,36330,36324,36326,36530,36611,36617,36606,36618,36767,36786,36939,36938,
+36947,36930,36948,36924,36949,36944,36935,36943,36942,36941,36945,36926,36929,
+37138,37143,37228,37226,37225,37321,37431,37463,37432,37437,37440,37438,37467,
+37451,37476,37457,37428,37449,37453,37445,37433,37439,37466,38296,38552,38548,
+38549,38605,38603,38601,38602,38647,38651,38649,38646,38742,38772,38774,38928,
+38929,38931,38922,38930,38924,39164,39156,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,39165,39166,39347,39345,39348,39649,40169,
+40578,40718,40723,40736,20711,20718,20709,20694,20717,20698,20693,20687,20689,
+20721,20686,20713,20834,20979,21123,21122,21297,21421,22014,22016,22043,22039,
+22013,22036,22022,22025,22029,22030,22007,22038,22047,22024,22032,22006,22296,
+22294,22645,22654,22659,22675,22666,22649,22661,22653,22781,22821,22818,22820,
+22890,22889,23265,23270,23273,23255,23254,23256,23267,23413,23518,23527,23521,
+23525,23526,23528,23522,23524,23519,23565,23650,23940,23943,24155,24163,24149,
+24151,24148,24275,24278,24330,24390,24432,24505,24903,24895,24907,24951,24930,
+24931,24927,24922,24920,24949,25130,25735,25688,25684,25764,25720,25695,25722,
+25681,25703,25652,25709,25723,25970,26017,26071,26070,26274,26280,26269,27036,
+27048,27029,27073,27054,27091,27083,27035,27063,27067,27051,27060,27088,27085,
+27053,27084,27046,27075,27043,27465,27468,27699,28467,28436,28414,28435,28404,
+28457,28478,28448,28460,28431,28418,28450,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,28415,28399,28422,28465,28472,28466,28451,
+28437,28459,28463,28552,28458,28396,28417,28402,28364,28407,29076,29081,29053,
+29066,29060,29074,29246,29330,29334,29508,29520,29796,29795,29802,29808,29805,
+29956,30097,30247,30221,30219,30217,30227,30433,30435,30596,30589,30591,30561,
+30913,30879,30887,30899,30889,30883,31118,31119,31117,31278,31281,31402,31401,
+31469,31471,31649,31637,31627,31605,31639,31645,31636,31631,31672,31623,31620,
+31929,31933,31934,32187,32176,32156,32189,32190,32160,32202,32180,32178,32177,
+32186,32162,32191,32181,32184,32173,32210,32199,32172,32624,32736,32737,32735,
+32862,32858,32903,33104,33152,33167,33160,33162,33151,33154,33255,33274,33287,
+33300,33310,33355,33993,33983,33990,33988,33945,33950,33970,33948,33995,33976,
+33984,34003,33936,33980,34001,33994,34623,34588,34619,34594,34597,34612,34584,
+34645,34615,34601,35059,35074,35060,35065,35064,35069,35048,35098,35055,35494,
+35468,35486,35491,35469,35489,35475,35492,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,35498,35493,35496,35480,35473,35482,35495,
+35946,35981,35980,36051,36049,36050,36203,36249,36245,36348,36628,36626,36629,
+36627,36771,36960,36952,36956,36963,36953,36958,36962,36957,36955,37145,37144,
+37150,37237,37240,37239,37236,37496,37504,37509,37528,37526,37499,37523,37532,
+37544,37500,37521,38305,38312,38313,38307,38309,38308,38553,38556,38555,38604,
+38610,38656,38780,38789,38902,38935,38936,39087,39089,39171,39173,39180,39177,
+39361,39599,39600,39654,39745,39746,40180,40182,40179,40636,40763,40778,20740,
+20736,20731,20725,20729,20738,20744,20745,20741,20956,21127,21128,21129,21133,
+21130,21232,21426,22062,22075,22073,22066,22079,22068,22057,22099,22094,22103,
+22132,22070,22063,22064,22656,22687,22686,22707,22684,22702,22697,22694,22893,
+23305,23291,23307,23285,23308,23304,23534,23532,23529,23531,23652,23653,23965,
+23956,24162,24159,24161,24290,24282,24287,24285,24291,24288,24392,24433,24503,
+24501,24950,24935,24942,24925,24917,24962,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24956,24944,24939,24958,24999,24976,25003,
+24974,25004,24986,24996,24980,25006,25134,25705,25711,25721,25758,25778,25736,
+25744,25776,25765,25747,25749,25769,25746,25774,25773,25771,25754,25772,25753,
+25762,25779,25973,25975,25976,26286,26283,26292,26289,27171,27167,27112,27137,
+27166,27161,27133,27169,27155,27146,27123,27138,27141,27117,27153,27472,27470,
+27556,27589,27590,28479,28540,28548,28497,28518,28500,28550,28525,28507,28536,
+28526,28558,28538,28528,28516,28567,28504,28373,28527,28512,28511,29087,29100,
+29105,29096,29270,29339,29518,29527,29801,29835,29827,29822,29824,30079,30240,
+30249,30239,30244,30246,30241,30242,30362,30394,30436,30606,30599,30604,30609,
+30603,30923,30917,30906,30922,30910,30933,30908,30928,31295,31292,31296,31293,
+31287,31291,31407,31406,31661,31665,31684,31668,31686,31687,31681,31648,31692,
+31946,32224,32244,32239,32251,32216,32236,32221,32232,32227,32218,32222,32233,
+32158,32217,32242,32249,32629,32631,32687,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,32745,32806,33179,33180,33181,33184,33178,
+33176,34071,34109,34074,34030,34092,34093,34067,34065,34083,34081,34068,34028,
+34085,34047,34054,34690,34676,34678,34656,34662,34680,34664,34649,34647,34636,
+34643,34907,34909,35088,35079,35090,35091,35093,35082,35516,35538,35527,35524,
+35477,35531,35576,35506,35529,35522,35519,35504,35542,35533,35510,35513,35547,
+35916,35918,35948,36064,36062,36070,36068,36076,36077,36066,36067,36060,36074,
+36065,36205,36255,36259,36395,36368,36381,36386,36367,36393,36383,36385,36382,
+36538,36637,36635,36639,36649,36646,36650,36636,36638,36645,36969,36974,36968,
+36973,36983,37168,37165,37159,37169,37255,37257,37259,37251,37573,37563,37559,
+37610,37548,37604,37569,37555,37564,37586,37575,37616,37554,38317,38321,38660,
+38662,38663,38665,38752,38797,38795,38799,38945,38955,38940,39091,39178,39187,
+39186,39192,39389,39376,39391,39387,39377,39381,39378,39385,39607,39662,39663,
+39719,39749,39748,39799,39791,40198,40201,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40195,40617,40638,40654,22696,40786,20754,
+20760,20756,20752,20757,20864,20906,20957,21137,21139,21235,22105,22123,22137,
+22121,22116,22136,22122,22120,22117,22129,22127,22124,22114,22134,22721,22718,
+22727,22725,22894,23325,23348,23416,23536,23566,24394,25010,24977,25001,24970,
+25037,25014,25022,25034,25032,25136,25797,25793,25803,25787,25788,25818,25796,
+25799,25794,25805,25791,25810,25812,25790,25972,26310,26313,26297,26308,26311,
+26296,27197,27192,27194,27225,27243,27224,27193,27204,27234,27233,27211,27207,
+27189,27231,27208,27481,27511,27653,28610,28593,28577,28611,28580,28609,28583,
+28595,28608,28601,28598,28582,28576,28596,29118,29129,29136,29138,29128,29141,
+29113,29134,29145,29148,29123,29124,29544,29852,29859,29848,29855,29854,29922,
+29964,29965,30260,30264,30266,30439,30437,30624,30622,30623,30629,30952,30938,
+30956,30951,31142,31309,31310,31302,31308,31307,31418,31705,31761,31689,31716,
+31707,31713,31721,31718,31957,31958,32266,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,32273,32264,32283,32291,32286,32285,32265,
+32272,32633,32690,32752,32753,32750,32808,33203,33193,33192,33275,33288,33368,
+33369,34122,34137,34120,34152,34153,34115,34121,34157,34154,34142,34691,34719,
+34718,34722,34701,34913,35114,35122,35109,35115,35105,35242,35238,35558,35578,
+35563,35569,35584,35548,35559,35566,35582,35585,35586,35575,35565,35571,35574,
+35580,35947,35949,35987,36084,36420,36401,36404,36418,36409,36405,36667,36655,
+36664,36659,36776,36774,36981,36980,36984,36978,36988,36986,37172,37266,37664,
+37686,37624,37683,37679,37666,37628,37675,37636,37658,37648,37670,37665,37653,
+37678,37657,38331,38567,38568,38570,38613,38670,38673,38678,38669,38675,38671,
+38747,38748,38758,38808,38960,38968,38971,38967,38957,38969,38948,39184,39208,
+39198,39195,39201,39194,39405,39394,39409,39608,39612,39675,39661,39720,39825,
+40213,40227,40230,40232,40210,40219,40664,40660,40845,40860,20778,20767,20769,
+20786,21237,22158,22144,22160,22149,22151,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,22159,22741,22739,22737,22734,23344,23338,
+23332,23418,23607,23656,23996,23994,23997,23992,24171,24396,24509,25033,25026,
+25031,25062,25035,25138,25140,25806,25802,25816,25824,25840,25830,25836,25841,
+25826,25837,25986,25987,26329,26326,27264,27284,27268,27298,27292,27355,27299,
+27262,27287,27280,27296,27484,27566,27610,27656,28632,28657,28639,28640,28635,
+28644,28651,28655,28544,28652,28641,28649,28629,28654,28656,29159,29151,29166,
+29158,29157,29165,29164,29172,29152,29237,29254,29552,29554,29865,29872,29862,
+29864,30278,30274,30284,30442,30643,30634,30640,30636,30631,30637,30703,30967,
+30970,30964,30959,30977,31143,31146,31319,31423,31751,31757,31742,31735,31756,
+31712,31968,31964,31966,31970,31967,31961,31965,32302,32318,32326,32311,32306,
+32323,32299,32317,32305,32325,32321,32308,32313,32328,32309,32319,32303,32580,
+32755,32764,32881,32882,32880,32879,32883,33222,33219,33210,33218,33216,33215,
+33213,33225,33214,33256,33289,33393,34218,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,34180,34174,34204,34193,34196,34223,34203,
+34183,34216,34186,34407,34752,34769,34739,34770,34758,34731,34747,34746,34760,
+34763,35131,35126,35140,35128,35133,35244,35598,35607,35609,35611,35594,35616,
+35613,35588,35600,35905,35903,35955,36090,36093,36092,36088,36091,36264,36425,
+36427,36424,36426,36676,36670,36674,36677,36671,36991,36989,36996,36993,36994,
+36992,37177,37283,37278,37276,37709,37762,37672,37749,37706,37733,37707,37656,
+37758,37740,37723,37744,37722,37716,38346,38347,38348,38344,38342,38577,38584,
+38614,38684,38686,38816,38867,38982,39094,39221,39425,39423,39854,39851,39850,
+39853,40251,40255,40587,40655,40670,40668,40669,40667,40766,40779,21474,22165,
+22190,22745,22744,23352,24413,25059,25139,25844,25842,25854,25862,25850,25851,
+25847,26039,26332,26406,27315,27308,27331,27323,27320,27330,27310,27311,27487,
+27512,27567,28681,28683,28670,28678,28666,28689,28687,29179,29180,29182,29176,
+29559,29557,29863,29887,29973,30294,30296,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30290,30653,30655,30651,30652,30990,31150,
+31329,31330,31328,31428,31429,31787,31783,31786,31774,31779,31777,31975,32340,
+32341,32350,32346,32353,32338,32345,32584,32761,32763,32887,32886,33229,33231,
+33290,34255,34217,34253,34256,34249,34224,34234,34233,34214,34799,34796,34802,
+34784,35206,35250,35316,35624,35641,35628,35627,35920,36101,36441,36451,36454,
+36452,36447,36437,36544,36681,36685,36999,36995,37000,37291,37292,37328,37780,
+37770,37782,37794,37811,37806,37804,37808,37784,37786,37783,38356,38358,38352,
+38357,38626,38620,38617,38619,38622,38692,38819,38822,38829,38905,38989,38991,
+38988,38990,38995,39098,39230,39231,39229,39214,39333,39438,39617,39683,39686,
+39759,39758,39757,39882,39881,39933,39880,39872,40273,40285,40288,40672,40725,
+40748,20787,22181,22750,22751,22754,23541,40848,24300,25074,25079,25078,25077,
+25856,25871,26336,26333,27365,27357,27354,27347,28699,28703,28712,28698,28701,
+28693,28696,29190,29197,29272,29346,29560,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,29562,29885,29898,29923,30087,30086,30303,
+30305,30663,31001,31153,31339,31337,31806,31807,31800,31805,31799,31808,32363,
+32365,32377,32361,32362,32645,32371,32694,32697,32696,33240,34281,34269,34282,
+34261,34276,34277,34295,34811,34821,34829,34809,34814,35168,35167,35158,35166,
+35649,35676,35672,35657,35674,35662,35663,35654,35673,36104,36106,36476,36466,
+36487,36470,36460,36474,36468,36692,36686,36781,37002,37003,37297,37294,37857,
+37841,37855,37827,37832,37852,37853,37846,37858,37837,37848,37860,37847,37864,
+38364,38580,38627,38698,38695,38753,38876,38907,39006,39000,39003,39100,39237,
+39241,39446,39449,39693,39912,39911,39894,39899,40329,40289,40306,40298,40300,
+40594,40599,40595,40628,21240,22184,22199,22198,22196,22204,22756,23360,23363,
+23421,23542,24009,25080,25082,25880,25876,25881,26342,26407,27372,28734,28720,
+28722,29200,29563,29903,30306,30309,31014,31018,31020,31019,31431,31478,31820,
+31811,31821,31983,31984,36782,32381,32380,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,32386,32588,32768,33242,33382,34299,34297,
+34321,34298,34310,34315,34311,34314,34836,34837,35172,35258,35320,35696,35692,
+35686,35695,35679,35691,36111,36109,36489,36481,36485,36482,37300,37323,37912,
+37891,37885,38369,38704,39108,39250,39249,39336,39467,39472,39479,39477,39955,
+39949,40569,40629,40680,40751,40799,40803,40801,20791,20792,22209,22208,22210,
+22804,23660,24013,25084,25086,25885,25884,26005,26345,27387,27396,27386,27570,
+28748,29211,29351,29910,29908,30313,30675,31824,32399,32396,32700,34327,34349,
+34330,34851,34850,34849,34847,35178,35180,35261,35700,35703,35709,36115,36490,
+36493,36491,36703,36783,37306,37934,37939,37941,37946,37944,37938,37931,38370,
+38712,38713,38706,38911,39015,39013,39255,39493,39491,39488,39486,39631,39764,
+39761,39981,39973,40367,40372,40386,40376,40605,40687,40729,40796,40806,40807,
+20796,20795,22216,22218,22217,23423,24020,24018,24398,25087,25892,27402,27489,
+28753,28760,29568,29924,30090,30318,30316,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,31155,31840,31839,32894,32893,33247,35186,
+35183,35324,35712,36118,36119,36497,36499,36705,37192,37956,37969,37970,38717,
+38718,38851,38849,39019,39253,39509,39501,39634,39706,40009,39985,39998,39995,
+40403,40407,40756,40812,40810,40852,22220,24022,25088,25891,25899,25898,26348,
+27408,29914,31434,31844,31843,31845,32403,32406,32404,33250,34360,34367,34865,
+35722,37008,37007,37987,37984,37988,38760,39023,39260,39514,39515,39511,39635,
+39636,39633,40020,40023,40022,40421,40607,40692,22225,22761,25900,28766,30321,
+30322,30679,32592,32648,34870,34873,34914,35731,35730,35734,33399,36123,37312,
+37994,38722,38728,38724,38854,39024,39519,39714,39768,40031,40441,40442,40572,
+40573,40711,40823,40818,24307,27414,28771,31852,31854,34875,35264,36513,37313,
+38002,38000,39025,39262,39638,39715,40652,28772,30682,35738,38007,38857,39522,
+39525,32412,35740,36522,37317,38013,38014,38012,40055,40056,40695,35924,38015,
+40474,29224,39530,39729,40475,40478,31858,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,12542,12445,12446,12293,12353,12354,12355,
+12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,
+12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,
+12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,
+12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,
+12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,
+12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,
+12434,12435,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,
+12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,
+12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,
+12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,
+12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,
+12512,12513,12514,12515,12516,12517,12518,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,12519,12520,12521,12522,12523,12524,12525,
+12526,12527,12528,12529,12530,12531,12532,12533,12534,1044,1045,1025,1046,
+1047,1048,1049,1050,1051,1052,1059,1060,1061,1062,1063,1064,1065,1066,1067,
+1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,
+1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,
+1097,1098,1099,1100,1101,1102,1103,9312,9313,9314,9315,9316,9317,9318,9319,
+9320,9321,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,20034,20060,20981,
+21274,21378,19975,19980,20039,20109,22231,64012,23662,24435,19983,20871,19982,
+20014,20115,20162,20169,20168,20888,21244,21356,21433,22304,22787,22828,23568,
+24063,26081,27571,27596,27668,29247,20017,20028,20200,20188,20201,20193,20189,
+20186,21004,21276,21324,22306,22307,22807,22831,23425,23428,23570,23611,23668,
+23667,24068,24192,24194,24521,25097,25168,27669,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,27702,27715,27711,27707,29358,29360,
+29578,31160,32906,38430,20238,20248,20268,20213,20244,20209,20224,20215,20232,
+20253,20226,20229,20258,20243,20228,20212,20242,20913,21011,21001,21008,21158,
+21282,21279,21325,21386,21511,22241,22239,22318,22314,22324,22844,22912,22908,
+22917,22907,22910,22903,22911,23382,23573,23589,23676,23674,23675,23678,24031,
+24181,24196,24322,24346,24436,24533,24532,24527,25180,25182,25188,25185,25190,
+25186,25177,25184,25178,25189,26095,26094,26430,26425,26424,26427,26426,26431,
+26428,26419,27672,27718,27730,27740,27727,27722,27732,27723,27724,28785,29278,
+29364,29365,29582,29994,30335,31349,32593,33400,33404,33408,33405,33407,34381,
+35198,37017,37015,37016,37019,37012,38434,38436,38432,38435,20310,20283,20322,
+20297,20307,20324,20286,20327,20306,20319,20289,20312,20269,20275,20287,20321,
+20879,20921,21020,21022,21025,21165,21166,21257,21347,21362,21390,21391,21552,
+21559,21546,21588,21573,21529,21532,21541,21528,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,21565,21583,21569,21544,21540,21575,
+22254,22247,22245,22337,22341,22348,22345,22347,22354,22790,22848,22950,22936,
+22944,22935,22926,22946,22928,22927,22951,22945,23438,23442,23592,23594,23693,
+23695,23688,23691,23689,23698,23690,23686,23699,23701,24032,24074,24078,24203,
+24201,24204,24200,24205,24325,24349,24440,24438,24530,24529,24528,24557,24552,
+24558,24563,24545,24548,24547,24570,24559,24567,24571,24576,24564,25146,25219,
+25228,25230,25231,25236,25223,25201,25211,25210,25200,25217,25224,25207,25213,
+25202,25204,25911,26096,26100,26099,26098,26101,26437,26439,26457,26453,26444,
+26440,26461,26445,26458,26443,27600,27673,27674,27768,27751,27755,27780,27787,
+27791,27761,27759,27753,27802,27757,27783,27797,27804,27750,27763,27749,27771,
+27790,28788,28794,29283,29375,29373,29379,29382,29377,29370,29381,29589,29591,
+29587,29588,29586,30010,30009,30100,30101,30337,31037,32820,32917,32921,32912,
+32914,32924,33424,33423,33413,33422,33425,33427,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33418,33411,33412,35960,36809,36799,
+37023,37025,37029,37022,37031,37024,38448,38440,38447,38445,20019,20376,20348,
+20357,20349,20352,20359,20342,20340,20361,20356,20343,20300,20375,20330,20378,
+20345,20353,20344,20368,20380,20372,20382,20370,20354,20373,20331,20334,20894,
+20924,20926,21045,21042,21043,21062,21041,21180,21258,21259,21308,21394,21396,
+21639,21631,21633,21649,21634,21640,21611,21626,21630,21605,21612,21620,21606,
+21645,21615,21601,21600,21656,21603,21607,21604,22263,22265,22383,22386,22381,
+22379,22385,22384,22390,22400,22389,22395,22387,22388,22370,22376,22397,22796,
+22853,22965,22970,22991,22990,22962,22988,22977,22966,22972,22979,22998,22961,
+22973,22976,22984,22964,22983,23394,23397,23443,23445,23620,23623,23726,23716,
+23712,23733,23727,23720,23724,23711,23715,23725,23714,23722,23719,23709,23717,
+23734,23728,23718,24087,24084,24089,24360,24354,24355,24356,24404,24450,24446,
+24445,24542,24549,24621,24614,24601,24626,24587,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24628,24586,24599,24627,24602,24606,
+24620,24610,24589,24592,24622,24595,24593,24588,24585,24604,25108,25149,25261,
+25268,25297,25278,25258,25270,25290,25262,25267,25263,25275,25257,25264,25272,
+25917,26024,26043,26121,26108,26116,26130,26120,26107,26115,26123,26125,26117,
+26109,26129,26128,26358,26378,26501,26476,26510,26514,26486,26491,26520,26502,
+26500,26484,26509,26508,26490,26527,26513,26521,26499,26493,26497,26488,26489,
+26516,27429,27520,27518,27614,27677,27795,27884,27883,27886,27865,27830,27860,
+27821,27879,27831,27856,27842,27834,27843,27846,27885,27890,27858,27869,27828,
+27786,27805,27776,27870,27840,27952,27853,27847,27824,27897,27855,27881,27857,
+28820,28824,28805,28819,28806,28804,28817,28822,28802,28826,28803,29290,29398,
+29387,29400,29385,29404,29394,29396,29402,29388,29393,29604,29601,29613,29606,
+29602,29600,29612,29597,29917,29928,30015,30016,30014,30092,30104,30383,30451,
+30449,30448,30453,30712,30716,30713,30715,30714,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30711,31042,31039,31173,31352,31355,
+31483,31861,31997,32821,32911,32942,32931,32952,32949,32941,33312,33440,33472,
+33451,33434,33432,33435,33461,33447,33454,33468,33438,33466,33460,33448,33441,
+33449,33474,33444,33475,33462,33442,34416,34415,34413,34414,35926,36818,36811,
+36819,36813,36822,36821,36823,37042,37044,37039,37043,37040,38457,38461,38460,
+38458,38467,20429,20421,20435,20402,20425,20427,20417,20436,20444,20441,20411,
+20403,20443,20423,20438,20410,20416,20409,20460,21060,21065,21184,21186,21309,
+21372,21399,21398,21401,21400,21690,21665,21677,21669,21711,21699,33549,21687,
+21678,21718,21686,21701,21702,21664,21616,21692,21666,21694,21618,21726,21680,
+22453,22430,22431,22436,22412,22423,22429,22427,22420,22424,22415,22425,22437,
+22426,22421,22772,22797,22867,23009,23006,23022,23040,23025,23005,23034,23037,
+23036,23030,23012,23026,23031,23003,23017,23027,23029,23008,23038,23028,23021,
+23464,23628,23760,23768,23756,23767,23755,23771,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,23774,23770,23753,23751,23754,23766,
+23763,23764,23759,23752,23750,23758,23775,23800,24057,24097,24098,24099,24096,
+24100,24240,24228,24226,24219,24227,24229,24327,24366,24406,24454,24631,24633,
+24660,24690,24670,24645,24659,24647,24649,24667,24652,24640,24642,24671,24612,
+24644,24664,24678,24686,25154,25155,25295,25357,25355,25333,25358,25347,25323,
+25337,25359,25356,25336,25334,25344,25363,25364,25338,25365,25339,25328,25921,
+25923,26026,26047,26166,26145,26162,26165,26140,26150,26146,26163,26155,26170,
+26141,26164,26169,26158,26383,26384,26561,26610,26568,26554,26588,26555,26616,
+26584,26560,26551,26565,26603,26596,26591,26549,26573,26547,26615,26614,26606,
+26595,26562,26553,26574,26599,26608,26546,26620,26566,26605,26572,26542,26598,
+26587,26618,26569,26570,26563,26602,26571,27432,27522,27524,27574,27606,27608,
+27616,27680,27681,27944,27956,27949,27935,27964,27967,27922,27914,27866,27955,
+27908,27929,27962,27930,27921,27904,27933,27970,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,27905,27928,27959,27907,27919,27968,
+27911,27936,27948,27912,27938,27913,27920,28855,28831,28862,28849,28848,28833,
+28852,28853,28841,29249,29257,29258,29292,29296,29299,29294,29386,29412,29416,
+29419,29407,29418,29414,29411,29573,29644,29634,29640,29637,29625,29622,29621,
+29620,29675,29631,29639,29630,29635,29638,29624,29643,29932,29934,29998,30023,
+30024,30119,30122,30329,30404,30472,30467,30468,30469,30474,30455,30459,30458,
+30695,30696,30726,30737,30738,30725,30736,30735,30734,30729,30723,30739,31050,
+31052,31051,31045,31044,31189,31181,31183,31190,31182,31360,31358,31441,31488,
+31489,31866,31864,31865,31871,31872,31873,32003,32008,32001,32600,32657,32653,
+32702,32775,32782,32783,32788,32823,32984,32967,32992,32977,32968,32962,32976,
+32965,32995,32985,32988,32970,32981,32969,32975,32983,32998,32973,33279,33313,
+33428,33497,33534,33529,33543,33512,33536,33493,33594,33515,33494,33524,33516,
+33505,33522,33525,33548,33531,33526,33520,33514,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33508,33504,33530,33523,33517,34423,
+34420,34428,34419,34881,34894,34919,34922,34921,35283,35332,35335,36210,36835,
+36833,36846,36832,37105,37053,37055,37077,37061,37054,37063,37067,37064,37332,
+37331,38484,38479,38481,38483,38474,38478,20510,20485,20487,20499,20514,20528,
+20507,20469,20468,20531,20535,20524,20470,20471,20503,20508,20512,20519,20533,
+20527,20529,20494,20826,20884,20883,20938,20932,20933,20936,20942,21089,21082,
+21074,21086,21087,21077,21090,21197,21262,21406,21798,21730,21783,21778,21735,
+21747,21732,21786,21759,21764,21768,21739,21777,21765,21745,21770,21755,21751,
+21752,21728,21774,21763,21771,22273,22274,22476,22578,22485,22482,22458,22470,
+22461,22460,22456,22454,22463,22471,22480,22457,22465,22798,22858,23065,23062,
+23085,23086,23061,23055,23063,23050,23070,23091,23404,23463,23469,23468,23555,
+23638,23636,23788,23807,23790,23793,23799,23808,23801,24105,24104,24232,24238,
+24234,24236,24371,24368,24423,24669,24666,24679,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24641,24738,24712,24704,24722,24705,
+24733,24707,24725,24731,24727,24711,24732,24718,25113,25158,25330,25360,25430,
+25388,25412,25413,25398,25411,25572,25401,25419,25418,25404,25385,25409,25396,
+25432,25428,25433,25389,25415,25395,25434,25425,25400,25431,25408,25416,25930,
+25926,26054,26051,26052,26050,26186,26207,26183,26193,26386,26387,26655,26650,
+26697,26674,26675,26683,26699,26703,26646,26673,26652,26677,26667,26669,26671,
+26702,26692,26676,26653,26642,26644,26662,26664,26670,26701,26682,26661,26656,
+27436,27439,27437,27441,27444,27501,32898,27528,27622,27620,27624,27619,27618,
+27623,27685,28026,28003,28004,28022,27917,28001,28050,27992,28002,28013,28015,
+28049,28045,28143,28031,28038,27998,28007,28000,28055,28016,28028,27999,28034,
+28056,27951,28008,28043,28030,28032,28036,27926,28035,28027,28029,28021,28048,
+28892,28883,28881,28893,28875,32569,28898,28887,28882,28894,28896,28884,28877,
+28869,28870,28871,28890,28878,28897,29250,29304,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,29303,29302,29440,29434,29428,29438,
+29430,29427,29435,29441,29651,29657,29669,29654,29628,29671,29667,29673,29660,
+29650,29659,29652,29661,29658,29655,29656,29672,29918,29919,29940,29941,29985,
+30043,30047,30128,30145,30139,30148,30144,30143,30134,30138,30346,30409,30493,
+30491,30480,30483,30482,30499,30481,30485,30489,30490,30498,30503,30755,30764,
+30754,30773,30767,30760,30766,30763,30753,30761,30771,30762,30769,31060,31067,
+31055,31068,31059,31058,31057,31211,31212,31200,31214,31213,31210,31196,31198,
+31197,31366,31369,31365,31371,31372,31370,31367,31448,31504,31492,31507,31493,
+31503,31496,31498,31502,31497,31506,31876,31889,31882,31884,31880,31885,31877,
+32030,32029,32017,32014,32024,32022,32019,32031,32018,32015,32012,32604,32609,
+32606,32608,32605,32603,32662,32658,32707,32706,32704,32790,32830,32825,33018,
+33010,33017,33013,33025,33019,33024,33281,33327,33317,33587,33581,33604,33561,
+33617,33573,33622,33599,33601,33574,33564,33570,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33602,33614,33563,33578,33544,33596,
+33613,33558,33572,33568,33591,33583,33577,33607,33605,33612,33619,33566,33580,
+33611,33575,33608,34387,34386,34466,34472,34454,34445,34449,34462,34439,34455,
+34438,34443,34458,34437,34469,34457,34465,34471,34453,34456,34446,34461,34448,
+34452,34883,34884,34925,34933,34934,34930,34944,34929,34943,34927,34947,34942,
+34932,34940,35346,35911,35927,35963,36004,36003,36214,36216,36277,36279,36278,
+36561,36563,36862,36853,36866,36863,36859,36868,36860,36854,37078,37088,37081,
+37082,37091,37087,37093,37080,37083,37079,37084,37092,37200,37198,37199,37333,
+37346,37338,38492,38495,38588,39139,39647,39727,20095,20592,20586,20577,20574,
+20576,20563,20555,20573,20594,20552,20557,20545,20571,20554,20578,20501,20549,
+20575,20585,20587,20579,20580,20550,20544,20590,20595,20567,20561,20944,21099,
+21101,21100,21102,21206,21203,21293,21404,21877,21878,21820,21837,21840,21812,
+21802,21841,21858,21814,21813,21808,21842,21829,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,21772,21810,21861,21838,21817,21832,
+21805,21819,21824,21835,22282,22279,22523,22548,22498,22518,22492,22516,22528,
+22509,22525,22536,22520,22539,22515,22479,22535,22510,22499,22514,22501,22508,
+22497,22542,22524,22544,22503,22529,22540,22513,22505,22512,22541,22532,22876,
+23136,23128,23125,23143,23134,23096,23093,23149,23120,23135,23141,23148,23123,
+23140,23127,23107,23133,23122,23108,23131,23112,23182,23102,23117,23097,23116,
+23152,23145,23111,23121,23126,23106,23132,23410,23406,23489,23488,23641,23838,
+23819,23837,23834,23840,23820,23848,23821,23846,23845,23823,23856,23826,23843,
+23839,23854,24126,24116,24241,24244,24249,24242,24243,24374,24376,24475,24470,
+24479,24714,24720,24710,24766,24752,24762,24787,24788,24783,24804,24793,24797,
+24776,24753,24795,24759,24778,24767,24771,24781,24768,25394,25445,25482,25474,
+25469,25533,25502,25517,25501,25495,25515,25486,25455,25479,25488,25454,25519,
+25461,25500,25453,25518,25468,25508,25403,25503,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,25464,25477,25473,25489,25485,25456,
+25939,26061,26213,26209,26203,26201,26204,26210,26392,26745,26759,26768,26780,
+26733,26734,26798,26795,26966,26735,26787,26796,26793,26741,26740,26802,26767,
+26743,26770,26748,26731,26738,26794,26752,26737,26750,26779,26774,26763,26784,
+26761,26788,26744,26747,26769,26764,26762,26749,27446,27443,27447,27448,27537,
+27535,27533,27534,27532,27690,28096,28075,28084,28083,28276,28076,28137,28130,
+28087,28150,28116,28160,28104,28128,28127,28118,28094,28133,28124,28125,28123,
+28148,28106,28093,28141,28144,28090,28117,28098,28111,28105,28112,28146,28115,
+28157,28119,28109,28131,28091,28922,28941,28919,28951,28916,28940,28912,28932,
+28915,28944,28924,28927,28934,28947,28928,28920,28918,28939,28930,28942,29310,
+29307,29308,29311,29469,29463,29447,29457,29464,29450,29448,29439,29455,29470,
+29576,29686,29688,29685,29700,29697,29693,29703,29696,29690,29692,29695,29708,
+29707,29684,29704,30052,30051,30158,30162,30159,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30155,30156,30161,30160,30351,30345,
+30419,30521,30511,30509,30513,30514,30516,30515,30525,30501,30523,30517,30792,
+30802,30793,30797,30794,30796,30758,30789,30800,31076,31079,31081,31082,31075,
+31083,31073,31163,31226,31224,31222,31223,31375,31380,31376,31541,31559,31540,
+31525,31536,31522,31524,31539,31512,31530,31517,31537,31531,31533,31535,31538,
+31544,31514,31523,31892,31896,31894,31907,32053,32061,32056,32054,32058,32069,
+32044,32041,32065,32071,32062,32063,32074,32059,32040,32611,32661,32668,32669,
+32667,32714,32715,32717,32720,32721,32711,32719,32713,32799,32798,32795,32839,
+32835,32840,33048,33061,33049,33051,33069,33055,33068,33054,33057,33045,33063,
+33053,33058,33297,33336,33331,33338,33332,33330,33396,33680,33699,33704,33677,
+33658,33651,33700,33652,33679,33665,33685,33689,33653,33684,33705,33661,33667,
+33676,33693,33691,33706,33675,33662,33701,33711,33672,33687,33712,33663,33702,
+33671,33710,33654,33690,34393,34390,34495,34487,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,34498,34497,34501,34490,34480,34504,
+34489,34483,34488,34508,34484,34491,34492,34499,34493,34494,34898,34953,34965,
+34984,34978,34986,34970,34961,34977,34975,34968,34983,34969,34971,34967,34980,
+34988,34956,34963,34958,35202,35286,35289,35285,35376,35367,35372,35358,35897,
+35899,35932,35933,35965,36005,36221,36219,36217,36284,36290,36281,36287,36289,
+36568,36574,36573,36572,36567,36576,36577,36900,36875,36881,36892,36876,36897,
+37103,37098,37104,37108,37106,37107,37076,37099,37100,37097,37206,37208,37210,
+37203,37205,37356,37364,37361,37363,37368,37348,37369,37354,37355,37367,37352,
+37358,38266,38278,38280,38524,38509,38507,38513,38511,38591,38762,38916,39141,
+39319,20635,20629,20628,20638,20619,20643,20611,20620,20622,20637,20584,20636,
+20626,20610,20615,20831,20948,21266,21265,21412,21415,21905,21928,21925,21933,
+21879,22085,21922,21907,21896,21903,21941,21889,21923,21906,21924,21885,21900,
+21926,21887,21909,21921,21902,22284,22569,22583,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,22553,22558,22567,22563,22568,22517,
+22600,22565,22556,22555,22579,22591,22582,22574,22585,22584,22573,22572,22587,
+22881,23215,23188,23199,23162,23202,23198,23160,23206,23164,23205,23212,23189,
+23214,23095,23172,23178,23191,23171,23179,23209,23163,23165,23180,23196,23183,
+23187,23197,23530,23501,23499,23508,23505,23498,23502,23564,23600,23863,23875,
+23915,23873,23883,23871,23861,23889,23886,23893,23859,23866,23890,23869,23857,
+23897,23874,23865,23881,23864,23868,23858,23862,23872,23877,24132,24129,24408,
+24486,24485,24491,24777,24761,24780,24802,24782,24772,24852,24818,24842,24854,
+24837,24821,24851,24824,24828,24830,24769,24835,24856,24861,24848,24831,24836,
+24843,25162,25492,25521,25520,25550,25573,25576,25583,25539,25757,25587,25546,
+25568,25590,25557,25586,25589,25697,25567,25534,25565,25564,25540,25560,25555,
+25538,25543,25548,25547,25544,25584,25559,25561,25906,25959,25962,25956,25948,
+25960,25957,25996,26013,26014,26030,26064,26066,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,26236,26220,26235,26240,26225,26233,
+26218,26226,26369,26892,26835,26884,26844,26922,26860,26858,26865,26895,26838,
+26871,26859,26852,26870,26899,26896,26867,26849,26887,26828,26888,26992,26804,
+26897,26863,26822,26900,26872,26832,26877,26876,26856,26891,26890,26903,26830,
+26824,26845,26846,26854,26868,26833,26886,26836,26857,26901,26917,26823,27449,
+27451,27455,27452,27540,27543,27545,27541,27581,27632,27634,27635,27696,28156,
+28230,28231,28191,28233,28296,28220,28221,28229,28258,28203,28223,28225,28253,
+28275,28188,28211,28235,28224,28241,28219,28163,28206,28254,28264,28252,28257,
+28209,28200,28256,28273,28267,28217,28194,28208,28243,28261,28199,28280,28260,
+28279,28245,28281,28242,28262,28213,28214,28250,28960,28958,28975,28923,28974,
+28977,28963,28965,28962,28978,28959,28968,28986,28955,29259,29274,29320,29321,
+29318,29317,29323,29458,29451,29488,29474,29489,29491,29479,29490,29485,29478,
+29475,29493,29452,29742,29740,29744,29739,29718,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,29722,29729,29741,29745,29732,29731,
+29725,29737,29728,29746,29947,29999,30063,30060,30183,30170,30177,30182,30173,
+30175,30180,30167,30357,30354,30426,30534,30535,30532,30541,30533,30538,30542,
+30539,30540,30686,30700,30816,30820,30821,30812,30829,30833,30826,30830,30832,
+30825,30824,30814,30818,31092,31091,31090,31088,31234,31242,31235,31244,31236,
+31385,31462,31460,31562,31547,31556,31560,31564,31566,31552,31576,31557,31906,
+31902,31912,31905,32088,32111,32099,32083,32086,32103,32106,32079,32109,32092,
+32107,32082,32084,32105,32081,32095,32078,32574,32575,32613,32614,32674,32672,
+32673,32727,32849,32847,32848,33022,32980,33091,33098,33106,33103,33095,33085,
+33101,33082,33254,33262,33271,33272,33273,33284,33340,33341,33343,33397,33595,
+33743,33785,33827,33728,33768,33810,33767,33764,33788,33782,33808,33734,33736,
+33771,33763,33727,33793,33757,33765,33752,33791,33761,33739,33742,33750,33781,
+33737,33801,33807,33758,33809,33798,33730,33779,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33749,33786,33735,33745,33770,33811,
+33731,33772,33774,33732,33787,33751,33762,33819,33755,33790,34520,34530,34534,
+34515,34531,34522,34538,34525,34539,34524,34540,34537,34519,34536,34513,34888,
+34902,34901,35002,35031,35001,35000,35008,35006,34998,35004,34999,35005,34994,
+35073,35017,35221,35224,35223,35293,35290,35291,35406,35405,35385,35417,35392,
+35415,35416,35396,35397,35410,35400,35409,35402,35404,35407,35935,35969,35968,
+36026,36030,36016,36025,36021,36228,36224,36233,36312,36307,36301,36295,36310,
+36316,36303,36309,36313,36296,36311,36293,36591,36599,36602,36601,36582,36590,
+36581,36597,36583,36584,36598,36587,36593,36588,36596,36585,36909,36916,36911,
+37126,37164,37124,37119,37116,37128,37113,37115,37121,37120,37127,37125,37123,
+37217,37220,37215,37218,37216,37377,37386,37413,37379,37402,37414,37391,37388,
+37376,37394,37375,37373,37382,37380,37415,37378,37404,37412,37401,37399,37381,
+37398,38267,38285,38284,38288,38535,38526,38536,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,38537,38531,38528,38594,38600,38595,
+38641,38640,38764,38768,38766,38919,39081,39147,40166,40697,20099,20100,20150,
+20669,20671,20678,20654,20676,20682,20660,20680,20674,20656,20673,20666,20657,
+20683,20681,20662,20664,20951,21114,21112,21115,21116,21955,21979,21964,21968,
+21963,21962,21981,21952,21972,21956,21993,21951,21970,21901,21967,21973,21986,
+21974,21960,22002,21965,21977,21954,22292,22611,22632,22628,22607,22605,22601,
+22639,22613,22606,22621,22617,22629,22619,22589,22627,22641,22780,23239,23236,
+23243,23226,23224,23217,23221,23216,23231,23240,23227,23238,23223,23232,23242,
+23220,23222,23245,23225,23184,23510,23512,23513,23583,23603,23921,23907,23882,
+23909,23922,23916,23902,23912,23911,23906,24048,24143,24142,24138,24141,24139,
+24261,24268,24262,24267,24263,24384,24495,24493,24823,24905,24906,24875,24901,
+24886,24882,24878,24902,24879,24911,24873,24896,25120,37224,25123,25125,25124,
+25541,25585,25579,25616,25618,25609,25632,25636,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,25651,25667,25631,25621,25624,25657,
+25655,25634,25635,25612,25638,25648,25640,25665,25653,25647,25610,25626,25664,
+25637,25639,25611,25575,25627,25646,25633,25614,25967,26002,26067,26246,26252,
+26261,26256,26251,26250,26265,26260,26232,26400,26982,26975,26936,26958,26978,
+26993,26943,26949,26986,26937,26946,26967,26969,27002,26952,26953,26933,26988,
+26931,26941,26981,26864,27000,26932,26985,26944,26991,26948,26998,26968,26945,
+26996,26956,26939,26955,26935,26972,26959,26961,26930,26962,26927,27003,26940,
+27462,27461,27459,27458,27464,27457,27547,64013,27643,27644,27641,27639,27640,
+28315,28374,28360,28303,28352,28319,28307,28308,28320,28337,28345,28358,28370,
+28349,28353,28318,28361,28343,28336,28365,28326,28367,28338,28350,28355,28380,
+28376,28313,28306,28302,28301,28324,28321,28351,28339,28368,28362,28311,28334,
+28323,28999,29012,29010,29027,29024,28993,29021,29026,29042,29048,29034,29025,
+28994,29016,28995,29003,29040,29023,29008,29011,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,28996,29005,29018,29263,29325,29324,
+29329,29328,29326,29500,29506,29499,29498,29504,29514,29513,29764,29770,29771,
+29778,29777,29783,29760,29775,29776,29774,29762,29766,29773,29780,29921,29951,
+29950,29949,29981,30073,30071,27011,30191,30223,30211,30199,30206,30204,30201,
+30200,30224,30203,30198,30189,30197,30205,30361,30389,30429,30549,30559,30560,
+30546,30550,30554,30569,30567,30548,30553,30573,30688,30855,30874,30868,30863,
+30852,30869,30853,30854,30881,30851,30841,30873,30848,30870,30843,31100,31106,
+31101,31097,31249,31256,31257,31250,31255,31253,31266,31251,31259,31248,31395,
+31394,31390,31467,31590,31588,31597,31604,31593,31602,31589,31603,31601,31600,
+31585,31608,31606,31587,31922,31924,31919,32136,32134,32128,32141,32127,32133,
+32122,32142,32123,32131,32124,32140,32148,32132,32125,32146,32621,32619,32615,
+32616,32620,32678,32677,32679,32731,32732,32801,33124,33120,33143,33116,33129,
+33115,33122,33138,26401,33118,33142,33127,33135,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33092,33121,33309,33353,33348,33344,
+33346,33349,34033,33855,33878,33910,33913,33935,33933,33893,33873,33856,33926,
+33895,33840,33869,33917,33882,33881,33908,33907,33885,34055,33886,33847,33850,
+33844,33914,33859,33912,33842,33861,33833,33753,33867,33839,33858,33837,33887,
+33904,33849,33870,33868,33874,33903,33989,33934,33851,33863,33846,33843,33896,
+33918,33860,33835,33888,33876,33902,33872,34571,34564,34551,34572,34554,34518,
+34549,34637,34552,34574,34569,34561,34550,34573,34565,35030,35019,35021,35022,
+35038,35035,35034,35020,35024,35205,35227,35295,35301,35300,35297,35296,35298,
+35292,35302,35446,35462,35455,35425,35391,35447,35458,35460,35445,35459,35457,
+35444,35450,35900,35915,35914,35941,35940,35942,35974,35972,35973,36044,36200,
+36201,36241,36236,36238,36239,36237,36243,36244,36240,36242,36336,36320,36332,
+36337,36334,36304,36329,36323,36322,36327,36338,36331,36340,36614,36607,36609,
+36608,36613,36615,36616,36610,36619,36946,36927,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,36932,36937,36925,37136,37133,37135,
+37137,37142,37140,37131,37134,37230,37231,37448,37458,37424,37434,37478,37427,
+37477,37470,37507,37422,37450,37446,37485,37484,37455,37472,37479,37487,37430,
+37473,37488,37425,37460,37475,37456,37490,37454,37459,37452,37462,37426,38303,
+38300,38302,38299,38546,38547,38545,38551,38606,38650,38653,38648,38645,38771,
+38775,38776,38770,38927,38925,38926,39084,39158,39161,39343,39346,39344,39349,
+39597,39595,39771,40170,40173,40167,40576,40701,20710,20692,20695,20712,20723,
+20699,20714,20701,20708,20691,20716,20720,20719,20707,20704,20952,21120,21121,
+21225,21227,21296,21420,22055,22037,22028,22034,22012,22031,22044,22017,22035,
+22018,22010,22045,22020,22015,22009,22665,22652,22672,22680,22662,22657,22655,
+22644,22667,22650,22663,22673,22670,22646,22658,22664,22651,22676,22671,22782,
+22891,23260,23278,23269,23253,23274,23258,23277,23275,23283,23266,23264,23259,
+23276,23262,23261,23257,23272,23263,23415,23520,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,23523,23651,23938,23936,23933,23942,
+23930,23937,23927,23946,23945,23944,23934,23932,23949,23929,23935,24152,24153,
+24147,24280,24273,24279,24270,24284,24277,24281,24274,24276,24388,24387,24431,
+24502,24876,24872,24897,24926,24945,24947,24914,24915,24946,24940,24960,24948,
+24916,24954,24923,24933,24891,24938,24929,24918,25129,25127,25131,25643,25677,
+25691,25693,25716,25718,25714,25715,25725,25717,25702,25766,25678,25730,25694,
+25692,25675,25683,25696,25680,25727,25663,25708,25707,25689,25701,25719,25971,
+26016,26273,26272,26271,26373,26372,26402,27057,27062,27081,27040,27086,27030,
+27056,27052,27068,27025,27033,27022,27047,27021,27049,27070,27055,27071,27076,
+27069,27044,27092,27065,27082,27034,27087,27059,27027,27050,27041,27038,27097,
+27031,27024,27074,27061,27045,27078,27466,27469,27467,27550,27551,27552,27587,
+27588,27646,28366,28405,28401,28419,28453,28408,28471,28411,28462,28425,28494,
+28441,28442,28455,28440,28475,28434,28397,28426,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,28470,28531,28409,28398,28461,28480,
+28464,28476,28469,28395,28423,28430,28483,28421,28413,28406,28473,28444,28412,
+28474,28447,28429,28446,28424,28449,29063,29072,29065,29056,29061,29058,29071,
+29051,29062,29057,29079,29252,29267,29335,29333,29331,29507,29517,29521,29516,
+29794,29811,29809,29813,29810,29799,29806,29952,29954,29955,30077,30096,30230,
+30216,30220,30229,30225,30218,30228,30392,30593,30588,30597,30594,30574,30592,
+30575,30590,30595,30898,30890,30900,30893,30888,30846,30891,30878,30885,30880,
+30892,30882,30884,31128,31114,31115,31126,31125,31124,31123,31127,31112,31122,
+31120,31275,31306,31280,31279,31272,31270,31400,31403,31404,31470,31624,31644,
+31626,31633,31632,31638,31629,31628,31643,31630,31621,31640,21124,31641,31652,
+31618,31931,31935,31932,31930,32167,32183,32194,32163,32170,32193,32192,32197,
+32157,32206,32196,32198,32203,32204,32175,32185,32150,32188,32159,32166,32174,
+32169,32161,32201,32627,32738,32739,32741,32734,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,32804,32861,32860,33161,33158,33155,
+33159,33165,33164,33163,33301,33943,33956,33953,33951,33978,33998,33986,33964,
+33966,33963,33977,33972,33985,33997,33962,33946,33969,34000,33949,33959,33979,
+33954,33940,33991,33996,33947,33961,33967,33960,34006,33944,33974,33999,33952,
+34007,34004,34002,34011,33968,33937,34401,34611,34595,34600,34667,34624,34606,
+34590,34593,34585,34587,34627,34604,34625,34622,34630,34592,34610,34602,34605,
+34620,34578,34618,34609,34613,34626,34598,34599,34616,34596,34586,34608,34577,
+35063,35047,35057,35058,35066,35070,35054,35068,35062,35067,35056,35052,35051,
+35229,35233,35231,35230,35305,35307,35304,35499,35481,35467,35474,35471,35478,
+35901,35944,35945,36053,36047,36055,36246,36361,36354,36351,36365,36349,36362,
+36355,36359,36358,36357,36350,36352,36356,36624,36625,36622,36621,37155,37148,
+37152,37154,37151,37149,37146,37156,37153,37147,37242,37234,37241,37235,37541,
+37540,37494,37531,37498,37536,37524,37546,37517,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,37542,37530,37547,37497,37527,37503,
+37539,37614,37518,37506,37525,37538,37501,37512,37537,37514,37510,37516,37529,
+37543,37502,37511,37545,37533,37515,37421,38558,38561,38655,38744,38781,38778,
+38782,38787,38784,38786,38779,38788,38785,38783,38862,38861,38934,39085,39086,
+39170,39168,39175,39325,39324,39363,39353,39355,39354,39362,39357,39367,39601,
+39651,39655,39742,39743,39776,39777,39775,40177,40178,40181,40615,20735,20739,
+20784,20728,20742,20743,20726,20734,20747,20748,20733,20746,21131,21132,21233,
+21231,22088,22082,22092,22069,22081,22090,22089,22086,22104,22106,22080,22067,
+22077,22060,22078,22072,22058,22074,22298,22699,22685,22705,22688,22691,22703,
+22700,22693,22689,22783,23295,23284,23293,23287,23286,23299,23288,23298,23289,
+23297,23303,23301,23311,23655,23961,23959,23967,23954,23970,23955,23957,23968,
+23964,23969,23962,23966,24169,24157,24160,24156,32243,24283,24286,24289,24393,
+24498,24971,24963,24953,25009,25008,24994,24969,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,24987,24979,25007,25005,24991,24978,
+25002,24993,24973,24934,25011,25133,25710,25712,25750,25760,25733,25751,25756,
+25743,25739,25738,25740,25763,25759,25704,25777,25752,25974,25978,25977,25979,
+26034,26035,26293,26288,26281,26290,26295,26282,26287,27136,27142,27159,27109,
+27128,27157,27121,27108,27168,27135,27116,27106,27163,27165,27134,27175,27122,
+27118,27156,27127,27111,27200,27144,27110,27131,27149,27132,27115,27145,27140,
+27160,27173,27151,27126,27174,27143,27124,27158,27473,27557,27555,27554,27558,
+27649,27648,27647,27650,28481,28454,28542,28551,28614,28562,28557,28553,28556,
+28514,28495,28549,28506,28566,28534,28524,28546,28501,28530,28498,28496,28503,
+28564,28563,28509,28416,28513,28523,28541,28519,28560,28499,28555,28521,28543,
+28565,28515,28535,28522,28539,29106,29103,29083,29104,29088,29082,29097,29109,
+29085,29093,29086,29092,29089,29098,29084,29095,29107,29336,29338,29528,29522,
+29534,29535,29536,29533,29531,29537,29530,29529,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,29538,29831,29833,29834,29830,29825,
+29821,29829,29832,29820,29817,29960,29959,30078,30245,30238,30233,30237,30236,
+30243,30234,30248,30235,30364,30365,30366,30363,30605,30607,30601,30600,30925,
+30907,30927,30924,30929,30926,30932,30920,30915,30916,30921,31130,31137,31136,
+31132,31138,31131,27510,31289,31410,31412,31411,31671,31691,31678,31660,31694,
+31663,31673,31690,31669,31941,31944,31948,31947,32247,32219,32234,32231,32215,
+32225,32259,32250,32230,32246,32241,32240,32238,32223,32630,32684,32688,32685,
+32749,32747,32746,32748,32742,32744,32868,32871,33187,33183,33182,33173,33186,
+33177,33175,33302,33359,33363,33362,33360,33358,33361,34084,34107,34063,34048,
+34089,34062,34057,34061,34079,34058,34087,34076,34043,34091,34042,34056,34060,
+34036,34090,34034,34069,34039,34027,34035,34044,34066,34026,34025,34070,34046,
+34088,34077,34094,34050,34045,34078,34038,34097,34086,34023,34024,34032,34031,
+34041,34072,34080,34096,34059,34073,34095,34402,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,34646,34659,34660,34679,34785,34675,
+34648,34644,34651,34642,34657,34650,34641,34654,34669,34666,34640,34638,34655,
+34653,34671,34668,34682,34670,34652,34661,34639,34683,34677,34658,34663,34665,
+34906,35077,35084,35092,35083,35095,35096,35097,35078,35094,35089,35086,35081,
+35234,35236,35235,35309,35312,35308,35535,35526,35512,35539,35537,35540,35541,
+35515,35543,35518,35520,35525,35544,35523,35514,35517,35545,35902,35917,35983,
+36069,36063,36057,36072,36058,36061,36071,36256,36252,36257,36251,36384,36387,
+36389,36388,36398,36373,36379,36374,36369,36377,36390,36391,36372,36370,36376,
+36371,36380,36375,36378,36652,36644,36632,36634,36640,36643,36630,36631,36979,
+36976,36975,36967,36971,37167,37163,37161,37162,37170,37158,37166,37253,37254,
+37258,37249,37250,37252,37248,37584,37571,37572,37568,37593,37558,37583,37617,
+37599,37592,37609,37591,37597,37580,37615,37570,37608,37578,37576,37582,37606,
+37581,37589,37577,37600,37598,37607,37585,37587,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,37557,37601,37574,37556,38268,38316,
+38315,38318,38320,38564,38562,38611,38661,38664,38658,38746,38794,38798,38792,
+38864,38863,38942,38941,38950,38953,38952,38944,38939,38951,39090,39176,39162,
+39185,39188,39190,39191,39189,39388,39373,39375,39379,39380,39374,39369,39382,
+39384,39371,39383,39372,39603,39660,39659,39667,39666,39665,39750,39747,39783,
+39796,39793,39782,39798,39797,39792,39784,39780,39788,40188,40186,40189,40191,
+40183,40199,40192,40185,40187,40200,40197,40196,40579,40659,40719,40720,20764,
+20755,20759,20762,20753,20958,21300,21473,22128,22112,22126,22131,22118,22115,
+22125,22130,22110,22135,22300,22299,22728,22717,22729,22719,22714,22722,22716,
+22726,23319,23321,23323,23329,23316,23315,23312,23318,23336,23322,23328,23326,
+23535,23980,23985,23977,23975,23989,23984,23982,23978,23976,23986,23981,23983,
+23988,24167,24168,24166,24175,24297,24295,24294,24296,24293,24395,24508,24989,
+25000,24982,25029,25012,25030,25025,25036,25018,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,25023,25016,24972,25815,25814,25808,
+25807,25801,25789,25737,25795,25819,25843,25817,25907,25983,25980,26018,26312,
+26302,26304,26314,26315,26319,26301,26299,26298,26316,26403,27188,27238,27209,
+27239,27186,27240,27198,27229,27245,27254,27227,27217,27176,27226,27195,27199,
+27201,27242,27236,27216,27215,27220,27247,27241,27232,27196,27230,27222,27221,
+27213,27214,27206,27477,27476,27478,27559,27562,27563,27592,27591,27652,27651,
+27654,28589,28619,28579,28615,28604,28622,28616,28510,28612,28605,28574,28618,
+28584,28676,28581,28590,28602,28588,28586,28623,28607,28600,28578,28617,28587,
+28621,28591,28594,28592,29125,29122,29119,29112,29142,29120,29121,29131,29140,
+29130,29127,29135,29117,29144,29116,29126,29146,29147,29341,29342,29545,29542,
+29543,29548,29541,29547,29546,29823,29850,29856,29844,29842,29845,29857,29963,
+30080,30255,30253,30257,30269,30259,30268,30261,30258,30256,30395,30438,30618,
+30621,30625,30620,30619,30626,30627,30613,30617,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30615,30941,30953,30949,30954,30942,
+30947,30939,30945,30946,30957,30943,30944,31140,31300,31304,31303,31414,31416,
+31413,31409,31415,31710,31715,31719,31709,31701,31717,31706,31720,31737,31700,
+31722,31714,31708,31723,31704,31711,31954,31956,31959,31952,31953,32274,32289,
+32279,32268,32287,32288,32275,32270,32284,32277,32282,32290,32267,32271,32278,
+32269,32276,32293,32292,32579,32635,32636,32634,32689,32751,32810,32809,32876,
+33201,33190,33198,33209,33205,33195,33200,33196,33204,33202,33207,33191,33266,
+33365,33366,33367,34134,34117,34155,34125,34131,34145,34136,34112,34118,34148,
+34113,34146,34116,34129,34119,34147,34110,34139,34161,34126,34158,34165,34133,
+34151,34144,34188,34150,34141,34132,34149,34156,34403,34405,34404,34715,34703,
+34711,34707,34706,34696,34689,34710,34712,34681,34695,34723,34693,34704,34705,
+34717,34692,34708,34716,34714,34697,35102,35110,35120,35117,35118,35111,35121,
+35106,35113,35107,35119,35116,35103,35313,35552,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,35554,35570,35572,35573,35549,35604,
+35556,35551,35568,35528,35550,35553,35560,35583,35567,35579,35985,35986,35984,
+36085,36078,36081,36080,36083,36204,36206,36261,36263,36403,36414,36408,36416,
+36421,36406,36412,36413,36417,36400,36415,36541,36662,36654,36661,36658,36665,
+36663,36660,36982,36985,36987,36998,37114,37171,37173,37174,37267,37264,37265,
+37261,37263,37671,37662,37640,37663,37638,37647,37754,37688,37692,37659,37667,
+37650,37633,37702,37677,37646,37645,37579,37661,37626,37669,37651,37625,37623,
+37684,37634,37668,37631,37673,37689,37685,37674,37652,37644,37643,37630,37641,
+37632,37627,37654,38332,38349,38334,38329,38330,38326,38335,38325,38333,38569,
+38612,38667,38674,38672,38809,38807,38804,38896,38904,38965,38959,38962,39204,
+39199,39207,39209,39326,39406,39404,39397,39396,39408,39395,39402,39401,39399,
+39609,39615,39604,39611,39670,39674,39673,39671,39731,39808,39813,39815,39804,
+39806,39803,39810,39827,39826,39824,39802,39829,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,39805,39816,40229,40215,40224,40222,
+40212,40233,40221,40216,40226,40208,40217,40223,40584,40582,40583,40622,40621,
+40661,40662,40698,40722,40765,20774,20773,20770,20772,20768,20777,21236,22163,
+22156,22157,22150,22148,22147,22142,22146,22143,22145,22742,22740,22735,22738,
+23341,23333,23346,23331,23340,23335,23334,23343,23342,23419,23537,23538,23991,
+24172,24170,24510,24507,25027,25013,25020,25063,25056,25061,25060,25064,25054,
+25839,25833,25827,25835,25828,25832,25985,25984,26038,26074,26322,27277,27286,
+27265,27301,27273,27295,27291,27297,27294,27271,27283,27278,27285,27267,27304,
+27300,27281,27263,27302,27290,27269,27276,27282,27483,27565,27657,28620,28585,
+28660,28628,28643,28636,28653,28647,28646,28638,28658,28637,28642,28648,29153,
+29169,29160,29170,29156,29168,29154,29555,29550,29551,29847,29874,29867,29840,
+29866,29869,29873,29861,29871,29968,29969,29970,29967,30084,30275,30280,30281,
+30279,30372,30441,30645,30635,30642,30647,30646,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,30644,30641,30632,30704,30963,30973,
+30978,30971,30972,30962,30981,30969,30974,30980,31147,31144,31324,31323,31318,
+31320,31316,31322,31422,31424,31425,31749,31759,31730,31744,31743,31739,31758,
+31732,31755,31731,31746,31753,31747,31745,31736,31741,31750,31728,31729,31760,
+31754,31976,32301,32316,32322,32307,38984,32312,32298,32329,32320,32327,32297,
+32332,32304,32315,32310,32324,32314,32581,32639,32638,32637,32756,32754,32812,
+33211,33220,33228,33226,33221,33223,33212,33257,33371,33370,33372,34179,34176,
+34191,34215,34197,34208,34187,34211,34171,34212,34202,34206,34167,34172,34185,
+34209,34170,34168,34135,34190,34198,34182,34189,34201,34205,34177,34210,34178,
+34184,34181,34169,34166,34200,34192,34207,34408,34750,34730,34733,34757,34736,
+34732,34745,34741,34748,34734,34761,34755,34754,34764,34743,34735,34756,34762,
+34740,34742,34751,34744,34749,34782,34738,35125,35123,35132,35134,35137,35154,
+35127,35138,35245,35247,35246,35314,35315,35614,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,35608,35606,35601,35589,35595,35618,
+35599,35602,35605,35591,35597,35592,35590,35612,35603,35610,35919,35952,35954,
+35953,35951,35989,35988,36089,36207,36430,36429,36435,36432,36428,36423,36675,
+36672,36997,36990,37176,37274,37282,37275,37273,37279,37281,37277,37280,37793,
+37763,37807,37732,37718,37703,37756,37720,37724,37750,37705,37712,37713,37728,
+37741,37775,37708,37738,37753,37719,37717,37714,37711,37745,37751,37755,37729,
+37726,37731,37735,37760,37710,37721,38343,38336,38345,38339,38341,38327,38574,
+38576,38572,38688,38687,38680,38685,38681,38810,38817,38812,38814,38813,38869,
+38868,38897,38977,38980,38986,38985,38981,38979,39205,39211,39212,39210,39219,
+39218,39215,39213,39217,39216,39320,39331,39329,39426,39418,39412,39415,39417,
+39416,39414,39419,39421,39422,39420,39427,39614,39678,39677,39681,39676,39752,
+39834,39848,39838,39835,39846,39841,39845,39844,39814,39842,39840,39855,40243,
+40257,40295,40246,40238,40239,40241,40248,40240,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40261,40258,40259,40254,40247,40256,
+40253,32757,40237,40586,40585,40589,40624,40648,40666,40699,40703,40740,40739,
+40738,40788,40864,20785,20781,20782,22168,22172,22167,22170,22173,22169,22896,
+23356,23657,23658,24000,24173,24174,25048,25055,25069,25070,25073,25066,25072,
+25067,25046,25065,25855,25860,25853,25848,25857,25859,25852,26004,26075,26330,
+26331,26328,27333,27321,27325,27361,27334,27322,27318,27319,27335,27316,27309,
+27486,27593,27659,28679,28684,28685,28673,28677,28692,28686,28671,28672,28667,
+28710,28668,28663,28682,29185,29183,29177,29187,29181,29558,29880,29888,29877,
+29889,29886,29878,29883,29890,29972,29971,30300,30308,30297,30288,30291,30295,
+30298,30374,30397,30444,30658,30650,30975,30988,30995,30996,30985,30992,30994,
+30993,31149,31148,31327,31772,31785,31769,31776,31775,31789,31773,31782,31784,
+31778,31781,31792,32348,32336,32342,32355,32344,32354,32351,32337,32352,32343,
+32339,32693,32691,32759,32760,32885,33233,33234,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,33232,33375,33374,34228,34246,34240,
+34243,34242,34227,34229,34237,34247,34244,34239,34251,34254,34248,34245,34225,
+34230,34258,34340,34232,34231,34238,34409,34791,34790,34786,34779,34795,34794,
+34789,34783,34803,34788,34772,34780,34771,34797,34776,34787,34724,34775,34777,
+34817,34804,34792,34781,35155,35147,35151,35148,35142,35152,35153,35145,35626,
+35623,35619,35635,35632,35637,35655,35631,35644,35646,35633,35621,35639,35622,
+35638,35630,35620,35643,35645,35642,35906,35957,35993,35992,35991,36094,36100,
+36098,36096,36444,36450,36448,36439,36438,36446,36453,36455,36443,36442,36449,
+36445,36457,36436,36678,36679,36680,36683,37160,37178,37179,37182,37288,37285,
+37287,37295,37290,37813,37772,37778,37815,37787,37789,37769,37799,37774,37802,
+37790,37798,37781,37768,37785,37791,37773,37809,37777,37810,37796,37800,37812,
+37795,37797,38354,38355,38353,38579,38615,38618,24002,38623,38616,38621,38691,
+38690,38693,38828,38830,38824,38827,38820,38826,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,38818,38821,38871,38873,38870,38872,
+38906,38992,38993,38994,39096,39233,39228,39226,39439,39435,39433,39437,39428,
+39441,39434,39429,39431,39430,39616,39644,39688,39684,39685,39721,39733,39754,
+39756,39755,39879,39878,39875,39871,39873,39861,39864,39891,39862,39876,39865,
+39869,40284,40275,40271,40266,40283,40267,40281,40278,40268,40279,40274,40276,
+40287,40280,40282,40590,40588,40671,40705,40704,40726,40741,40747,40746,40745,
+40744,40780,40789,20788,20789,21142,21239,21428,22187,22189,22182,22183,22186,
+22188,22746,22749,22747,22802,23357,23358,23359,24003,24176,24511,25083,25863,
+25872,25869,25865,25868,25870,25988,26078,26077,26334,27367,27360,27340,27345,
+27353,27339,27359,27356,27344,27371,27343,27341,27358,27488,27568,27660,28697,
+28711,28704,28694,28715,28705,28706,28707,28713,28695,28708,28700,28714,29196,
+29194,29191,29186,29189,29349,29350,29348,29347,29345,29899,29893,29879,29891,
+29974,30304,30665,30666,30660,30705,31005,31003,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,31009,31004,30999,31006,31152,31335,
+31336,31795,31804,31801,31788,31803,31980,31978,32374,32373,32376,32368,32375,
+32367,32378,32370,32372,32360,32587,32586,32643,32646,32695,32765,32766,32888,
+33239,33237,33380,33377,33379,34283,34289,34285,34265,34273,34280,34266,34263,
+34284,34290,34296,34264,34271,34275,34268,34257,34288,34278,34287,34270,34274,
+34816,34810,34819,34806,34807,34825,34828,34827,34822,34812,34824,34815,34826,
+34818,35170,35162,35163,35159,35169,35164,35160,35165,35161,35208,35255,35254,
+35318,35664,35656,35658,35648,35667,35670,35668,35659,35669,35665,35650,35666,
+35671,35907,35959,35958,35994,36102,36103,36105,36268,36266,36269,36267,36461,
+36472,36467,36458,36463,36475,36546,36690,36689,36687,36688,36691,36788,37184,
+37183,37296,37293,37854,37831,37839,37826,37850,37840,37881,37868,37836,37849,
+37801,37862,37834,37844,37870,37859,37845,37828,37838,37824,37842,37863,38269,
+38362,38363,38625,38697,38699,38700,38696,38694,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,38835,38839,38838,38877,38878,38879,
+39004,39001,39005,38999,39103,39101,39099,39102,39240,39239,39235,39334,39335,
+39450,39445,39461,39453,39460,39451,39458,39456,39463,39459,39454,39452,39444,
+39618,39691,39690,39694,39692,39735,39914,39915,39904,39902,39908,39910,39906,
+39920,39892,39895,39916,39900,39897,39909,39893,39905,39898,40311,40321,40330,
+40324,40328,40305,40320,40312,40326,40331,40332,40317,40299,40308,40309,40304,
+40297,40325,40307,40315,40322,40303,40313,40319,40327,40296,40596,40593,40640,
+40700,40749,40768,40769,40781,40790,40791,40792,21303,22194,22197,22195,22755,
+23365,24006,24007,24302,24303,24512,24513,25081,25879,25878,25877,25875,26079,
+26344,26339,26340,27379,27376,27370,27368,27385,27377,27374,27375,28732,28725,
+28719,28727,28724,28721,28738,28728,28735,28730,28729,28736,28731,28723,28737,
+29203,29204,29352,29565,29564,29882,30379,30378,30398,30445,30668,30670,30671,
+30669,30706,31013,31011,31015,31016,31012,31017,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,31154,31342,31340,31341,31479,31817,
+31816,31818,31815,31813,31982,32379,32382,32385,32384,32698,32767,32889,33243,
+33241,33291,33384,33385,34338,34303,34305,34302,34331,34304,34294,34308,34313,
+34309,34316,34301,34841,34832,34833,34839,34835,34838,35171,35174,35257,35319,
+35680,35690,35677,35688,35683,35685,35687,35693,36270,36486,36488,36484,36697,
+36694,36695,36693,36696,36698,37005,37187,37185,37303,37301,37298,37299,37899,
+37907,37883,37920,37903,37908,37886,37909,37904,37928,37913,37901,37877,37888,
+37879,37895,37902,37910,37906,37882,37897,37880,37898,37887,37884,37900,37878,
+37905,37894,38366,38368,38367,38702,38703,38841,38843,38909,38910,39008,39010,
+39011,39007,39105,39106,39248,39246,39257,39244,39243,39251,39474,39476,39473,
+39468,39466,39478,39465,39470,39480,39469,39623,39626,39622,39696,39698,39697,
+39947,39944,39927,39941,39954,39928,40000,39943,39950,39942,39959,39956,39945,
+40351,40345,40356,40349,40338,40344,40336,40347,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40352,40340,40348,40362,40343,40353,
+40346,40354,40360,40350,40355,40383,40361,40342,40358,40359,40601,40603,40602,
+40677,40676,40679,40678,40752,40750,40795,40800,40798,40797,40793,40849,20794,
+20793,21144,21143,22211,22205,22206,23368,23367,24011,24015,24305,25085,25883,
+27394,27388,27395,27384,27392,28739,28740,28746,28744,28745,28741,28742,29213,
+29210,29209,29566,29975,30314,30672,31021,31025,31023,31828,31827,31986,32394,
+32391,32392,32395,32390,32397,32589,32699,32816,33245,34328,34346,34342,34335,
+34339,34332,34329,34343,34350,34337,34336,34345,34334,34341,34857,34845,34843,
+34848,34852,34844,34859,34890,35181,35177,35182,35179,35322,35705,35704,35653,
+35706,35707,36112,36116,36271,36494,36492,36702,36699,36701,37190,37188,37189,
+37305,37951,37947,37942,37929,37949,37948,37936,37945,37930,37943,37932,37952,
+37937,38373,38372,38371,38709,38714,38847,38881,39012,39113,39110,39104,39256,
+39254,39481,39485,39494,39492,39490,39489,39482,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,39487,39629,39701,39703,39704,39702,
+39738,39762,39979,39965,39964,39980,39971,39976,39977,39972,39969,40375,40374,
+40380,40385,40391,40394,40399,40382,40389,40387,40379,40373,40398,40377,40378,
+40364,40392,40369,40365,40396,40371,40397,40370,40570,40604,40683,40686,40685,
+40731,40728,40730,40753,40782,40805,40804,40850,20153,22214,22213,22219,22897,
+23371,23372,24021,24017,24306,25889,25888,25894,25890,27403,27400,27401,27661,
+28757,28758,28759,28754,29214,29215,29353,29567,29912,29909,29913,29911,30317,
+30381,31029,31156,31344,31345,31831,31836,31833,31835,31834,31988,31985,32401,
+32591,32647,33246,33387,34356,34357,34355,34348,34354,34358,34860,34856,34854,
+34858,34853,35185,35263,35262,35323,35710,35716,35714,35718,35717,35711,36117,
+36501,36500,36506,36498,36496,36502,36503,36704,36706,37191,37964,37968,37962,
+37963,37967,37959,37957,37960,37961,37958,38719,38883,39018,39017,39115,39252,
+39259,39502,39507,39508,39500,39503,39496,39498,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,39497,39506,39504,39632,39705,39723,
+39739,39766,39765,40006,40008,39999,40004,39993,39987,40001,39996,39991,39988,
+39986,39997,39990,40411,40402,40414,40410,40395,40400,40412,40401,40415,40425,
+40409,40408,40406,40437,40405,40413,40630,40688,40757,40755,40754,40770,40811,
+40853,40866,20797,21145,22760,22759,22898,23373,24024,34863,24399,25089,25091,
+25092,25897,25893,26006,26347,27409,27410,27407,27594,28763,28762,29218,29570,
+29569,29571,30320,30676,31847,31846,32405,33388,34362,34368,34361,34364,34353,
+34363,34366,34864,34866,34862,34867,35190,35188,35187,35326,35724,35726,35723,
+35720,35909,36121,36504,36708,36707,37308,37986,37973,37981,37975,37982,38852,
+38853,38912,39510,39513,39710,39711,39712,40018,40024,40016,40010,40013,40011,
+40021,40025,40012,40014,40443,40439,40431,40419,40427,40440,40420,40438,40417,
+40430,40422,40434,40432,40418,40428,40436,40435,40424,40429,40642,40656,40690,
+40691,40710,40732,40760,40759,40758,40771,40783,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40817,40816,40814,40815,22227,22221,
+23374,23661,25901,26349,26350,27411,28767,28769,28765,28768,29219,29915,29925,
+30677,31032,31159,31158,31850,32407,32649,33389,34371,34872,34871,34869,34891,
+35732,35733,36510,36511,36512,36509,37310,37309,37314,37995,37992,37993,38629,
+38726,38723,38727,38855,38885,39518,39637,39769,40035,40039,40038,40034,40030,
+40032,40450,40446,40455,40451,40454,40453,40448,40449,40457,40447,40445,40452,
+40608,40734,40774,40820,40821,40822,22228,25902,26040,27416,27417,27415,27418,
+28770,29222,29354,30680,30681,31033,31849,31851,31990,32410,32408,32411,32409,
+33248,33249,34374,34375,34376,35193,35194,35196,35195,35327,35736,35737,36517,
+36516,36515,37998,37997,37999,38001,38003,38729,39026,39263,40040,40046,40045,
+40459,40461,40464,40463,40466,40465,40609,40693,40713,40775,40824,40827,40826,
+40825,22302,28774,31855,34876,36274,36518,37315,38004,38008,38006,38005,39520,
+40052,40051,40049,40053,40468,40467,40694,40714,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,40868,28776,28773,31991,34410,34878,
+34877,34879,35742,35996,36521,36553,38731,39027,39028,39116,39265,39339,39524,
+39526,39527,39716,40469,40471,40776,25095,27422,29223,34380,36520,38018,38016,
+38017,39529,39528,39726,40473,29225,34379,35743,38019,40057,40631,30325,39531,
+40058,40477,28777,28778,40612,40830,40777,40856,
+};
+
+static const struct dbcs_index big5_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__big5_decmap+0,64,254},{
+__big5_decmap+191,64,254},{__big5_decmap+382,64,191},{__big5_decmap+510,64,254
+},{__big5_decmap+701,64,254},{__big5_decmap+892,64,254},{__big5_decmap+1083,
+64,254},{__big5_decmap+1274,64,254},{__big5_decmap+1465,64,254},{__big5_decmap
++1656,64,254},{__big5_decmap+1847,64,254},{__big5_decmap+2038,64,254},{
+__big5_decmap+2229,64,254},{__big5_decmap+2420,64,254},{__big5_decmap+2611,64,
+254},{__big5_decmap+2802,64,254},{__big5_decmap+2993,64,254},{__big5_decmap+
+3184,64,254},{__big5_decmap+3375,64,254},{__big5_decmap+3566,64,254},{
+__big5_decmap+3757,64,254},{__big5_decmap+3948,64,254},{__big5_decmap+4139,64,
+254},{__big5_decmap+4330,64,254},{__big5_decmap+4521,64,254},{__big5_decmap+
+4712,64,254},{__big5_decmap+4903,64,254},{__big5_decmap+5094,64,254},{
+__big5_decmap+5285,64,254},{__big5_decmap+5476,64,254},{__big5_decmap+5667,64,
+254},{__big5_decmap+5858,64,254},{__big5_decmap+6049,64,254},{__big5_decmap+
+6240,64,254},{__big5_decmap+6431,64,254},{__big5_decmap+6622,64,254},{
+__big5_decmap+6813,64,254},{__big5_decmap+7004,64,254},{__big5_decmap+7195,64,
+252},{0,0,0},{__big5_decmap+7384,64,254},{__big5_decmap+7575,64,254},{
+__big5_decmap+7766,64,254},{__big5_decmap+7957,64,254},{__big5_decmap+8148,64,
+254},{__big5_decmap+8339,64,254},{__big5_decmap+8530,64,254},{__big5_decmap+
+8721,64,254},{__big5_decmap+8912,64,254},{__big5_decmap+9103,64,254},{
+__big5_decmap+9294,64,254},{__big5_decmap+9485,64,254},{__big5_decmap+9676,64,
+254},{__big5_decmap+9867,64,254},{__big5_decmap+10058,64,254},{__big5_decmap+
+10249,64,254},{__big5_decmap+10440,64,254},{__big5_decmap+10631,64,254},{
+__big5_decmap+10822,64,254},{__big5_decmap+11013,64,254},{__big5_decmap+11204,
+64,254},{__big5_decmap+11395,64,254},{__big5_decmap+11586,64,254},{
+__big5_decmap+11777,64,254},{__big5_decmap+11968,64,254},{__big5_decmap+12159,
+64,254},{__big5_decmap+12350,64,254},{__big5_decmap+12541,64,254},{
+__big5_decmap+12732,64,254},{__big5_decmap+12923,64,254},{__big5_decmap+13114,
+64,254},{__big5_decmap+13305,64,254},{__big5_decmap+13496,64,254},{
+__big5_decmap+13687,64,254},{__big5_decmap+13878,64,254},{__big5_decmap+14069,
+64,254},{__big5_decmap+14260,64,254},{__big5_decmap+14451,64,254},{
+__big5_decmap+14642,64,254},{__big5_decmap+14833,64,254},{__big5_decmap+15024,
+64,254},{__big5_decmap+15215,64,254},{__big5_decmap+15406,64,254},{
+__big5_decmap+15597,64,254},{__big5_decmap+15788,64,254},{__big5_decmap+15979,
+64,254},{__big5_decmap+16170,64,254},{__big5_decmap+16361,64,254},{
+__big5_decmap+16552,64,213},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __big5_encmap[21764] = {
+41542,41543,N,41540,N,41393,N,N,N,N,N,N,N,N,41560,41427,N,N,N,N,N,41296,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41425,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41426,41918,N,41916,41917,41919,
+N,41413,N,N,N,N,N,N,N,N,N,N,N,41915,41796,41797,41798,41799,41800,41801,41802,
+41803,41804,41805,41806,41807,41808,41809,41810,41811,41812,N,41813,41814,
+41815,41816,41817,41818,41819,N,N,N,N,N,N,N,41820,41821,41822,41823,41824,
+41825,41826,41827,41828,41829,41830,41831,41832,41833,41834,41835,41836,N,
+41837,41838,41839,41840,41841,41842,41843,51123,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,51121,51122,51124,51125,51126,51127,51128,51129,51130,N,N,N,N,N,N,51131,
+51132,51133,51134,51135,51136,51137,51138,51139,51140,51141,51142,51143,51144,
+51145,51146,51147,51148,51149,51151,51152,51153,51154,51155,51156,51157,51158,
+51159,51160,51161,51162,51163,51164,51165,51166,51167,51168,51169,51170,51171,
+51172,51173,51174,51175,51176,N,51150,41302,41304,N,N,N,41381,41382,N,N,41383,
+41384,N,N,N,N,41285,N,N,41292,41291,N,N,N,N,N,N,N,N,N,N,N,41388,N,N,41387,N,N,
+N,N,N,41392,N,N,41410,41546,N,41409,N,N,N,41547,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41657,41658,
+41659,41660,41661,41662,41663,41664,41665,41666,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41462,41460,41463,41461,N,N,
+41464,41465,41467,41466,41428,N,N,N,41435,41448,41447,N,N,41469,N,41468,N,N,N,
+41444,41445,41452,N,N,41453,N,N,N,N,N,41455,41454,N,N,N,N,N,N,41443,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41436,N,N,N,N,N,N,N,N,N,N,N,N,N,41434,41437,N,
+N,N,N,41432,41433,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41446,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41449,51177,51178,51179,51180,51181,
+51182,51183,51184,51185,51186,N,N,N,N,N,N,N,N,N,N,51187,51188,51189,51190,
+51191,51192,51193,51194,51195,51196,41591,N,41592,N,N,N,N,N,N,N,N,N,41594,N,N,
+N,41595,N,N,N,41596,N,N,N,41597,N,N,N,41589,N,N,N,N,N,N,N,41588,N,N,N,N,N,N,N,
+41587,N,N,N,N,N,N,N,41586,N,N,N,N,N,N,N,41585,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,41636,N,N,N,N,N,N,N,N,N,N,N,N,N,41637,N,N,41639,N,N,N,N,N,N,N,N,41638,N,
+N,41598,41633,41635,41634,41644,41645,41646,41306,N,N,N,N,N,N,N,N,N,N,N,N,
+41570,41571,41572,41573,41574,41575,41576,41577,41584,41583,41582,41581,41580,
+41579,41578,N,N,N,N,41590,41593,N,N,N,N,N,N,N,N,N,N,41405,41404,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,41398,41397,N,N,N,N,N,N,N,N,41407,41406,N,N,N,N,N,N,N,N,
+41403,41402,N,N,N,41395,N,N,41399,41396,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41640,41641,41643,41642,41401,41400,N,N,41459,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41456,41458,41457,41280,41282,41283,41394,N,50852,N,N,41329,41330,41325,41326,
+41333,41334,41337,41338,41321,41322,41541,N,41317,41318,N,N,N,N,N,N,N,41385,
+41386,N,N,41667,41668,41669,41670,41671,41672,41673,41674,41675,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,50853,50854,50855,50856,50857,50858,50859,
+50860,50861,50862,50863,50864,50865,50866,50867,50868,50869,50870,50871,50872,
+50873,50874,50875,50876,50877,50878,50879,50880,50881,50882,50883,50884,50885,
+50886,50887,50888,50889,50890,50891,50892,50893,50894,50895,50896,50897,50898,
+50899,50900,50901,50902,50903,50904,50905,50906,50907,50908,50909,50910,50911,
+50912,50913,50914,50915,50916,50917,50918,50919,50920,50921,50922,50923,50924,
+50925,50926,50927,50928,50929,50930,50931,50932,50933,50934,50935,N,N,N,N,N,N,
+N,N,N,50850,50851,N,N,50936,50937,50938,50939,50940,50941,50942,51008,51009,
+51010,51011,51012,51013,51014,51015,51016,51017,51018,51019,51020,51021,51022,
+51023,51024,51025,51026,51027,51028,51029,51030,51031,51032,51033,51034,51035,
+51036,51037,51038,51039,51040,51041,51042,51043,51044,51045,51046,51047,51048,
+51049,51050,51051,51052,51053,51054,51055,51056,51057,51058,51059,51060,51061,
+51062,51063,51064,51065,51066,51067,51068,51069,51070,51105,51106,51107,51108,
+51109,51110,51111,51112,51113,51114,51115,51116,51117,51118,51119,51120,N,N,N,
+N,N,N,N,50849,41844,41845,41846,41847,41848,41849,41850,41851,41852,41853,
+41854,41889,41890,41891,41892,41893,41894,41895,41896,41897,41898,41899,41900,
+41901,41902,41903,41904,41905,41906,41907,41908,41909,41910,41911,41912,41913,
+41914,41408,41557,41558,N,N,N,N,N,N,N,N,N,N,N,N,41552,41553,41554,N,N,41556,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41559,N,N,N,
+N,N,N,N,N,N,41555,N,N,41451,41450,N,N,41551,42048,42050,N,42051,N,N,N,51525,
+42070,42068,42071,42069,51526,42147,51535,51533,42146,42145,N,N,42306,42305,
+42304,N,42307,42238,N,N,N,N,42464,42465,N,N,N,N,N,N,43203,N,N,N,N,42072,N,
+42148,51536,N,42149,51555,42730,52145,N,N,N,N,42073,42150,N,42308,51556,N,N,N,
+N,N,51520,42052,N,42075,N,51527,42076,N,N,42151,N,42309,42311,42310,N,N,42466,
+42467,N,N,43204,N,44476,42049,N,N,51521,42053,42078,42077,N,N,N,N,N,N,N,N,N,
+42468,N,N,N,N,N,N,N,N,N,43205,N,N,N,N,N,N,N,N,N,N,45230,54347,N,N,46787,56497,
+56498,N,42054,N,42153,N,N,43206,42055,51528,42079,N,N,42154,42156,51537,42157,
+42155,N,N,N,42469,N,43207,N,N,43208,43845,N,42080,42158,N,42470,42472,42471,N,
+42731,N,N,43209,43210,43846,43847,N,N,N,N,44477,N,N,56499,N,N,63190,42056,N,N,
+N,N,N,42160,42159,51538,42161,42167,N,42162,42163,51540,51539,42165,42166,N,
+42164,N,N,N,N,N,N,42314,42315,42316,42317,42313,42320,51562,N,51558,51561,
+42321,42337,N,51560,N,42318,42319,42312,N,N,51557,51559,N,N,N,N,N,N,42485,
+51632,42482,42486,51642,51630,42483,51634,N,N,N,42484,N,42487,N,42473,51633,
+42488,51637,N,51641,51638,N,N,51635,42474,42476,42489,N,42478,51627,42481,
+42479,42480,51643,51640,51631,42477,N,N,51628,42475,N,N,N,51636,N,N,N,N,51639,
+N,N,N,N,N,N,N,N,N,51629,51814,N,42818,42740,N,N,51815,42737,N,42820,N,42745,N,
+42744,51803,42748,42743,51808,51816,N,51812,N,42746,N,N,42749,42734,42823,
+51805,N,N,52157,42732,42819,42733,42741,42742,51810,51806,42747,42739,51802,
+42735,51813,42821,42824,42738,42816,42822,42736,51811,42817,51817,51804,42750,
+51807,N,N,51809,N,43224,52159,52171,43216,N,52172,43211,43221,N,N,43214,52153,
+43222,52152,52156,52163,52161,43230,43225,52147,52149,43227,43215,52150,52162,
+52169,43220,52155,52148,43219,52151,43223,52154,N,43218,N,43213,N,43228,52164,
+43229,52168,N,52166,52170,43226,52158,52146,N,52160,43217,52165,43212,52167,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,43862,43850,N,N,52704,52712,N,43849,43857,43869,N,
+52718,52716,52711,N,N,N,43851,52717,52707,43865,43856,43864,52702,N,52714,N,
+52705,43860,52706,N,52701,43867,43854,43863,43853,N,52703,52708,N,52715,43861,
+43858,52710,43866,52713,52709,43855,43868,43859,43852,43848,N,N,N,N,N,N,N,N,N,
+N,52719,N,44503,44481,N,44497,N,44502,53456,53455,53460,53461,44484,N,44493,N,
+N,N,44506,44494,N,N,N,N,53449,44487,53450,N,44508,N,44499,44478,44479,53469,
+45247,N,44492,44491,53451,44495,54363,44486,53462,44501,44500,44490,53454,
+53463,N,53448,44489,53464,44498,53452,44480,N,44483,44482,53465,44496,44485,
+44505,44507,53459,44504,N,53467,53453,53468,N,53457,N,53466,N,53458,N,N,N,N,
+44488,N,N,N,54371,54359,N,45235,N,54364,54370,45234,54357,45238,54361,54354,
+45236,54358,45241,45246,N,54375,N,54353,N,45242,N,54374,N,N,45237,54360,45233,
+54355,54351,54365,54352,54350,54362,54368,54369,45239,N,N,55387,54366,54349,
+54367,N,45249,54372,45248,54348,N,54356,54373,45244,45243,45240,45245,N,N,
+45231,N,N,45232,N,N,46024,N,55390,55383,N,46021,N,55391,N,N,N,55381,55384,
+46020,55385,N,N,46023,55389,N,55379,55378,46025,N,46026,46022,46027,55377,
+55388,55386,55380,N,N,N,46019,55382,N,N,N,N,N,N,N,N,46794,46788,56503,46797,
+56509,56512,46790,46791,56506,46789,56515,46795,56516,N,56511,46796,N,56500,
+46793,56501,N,56510,56508,N,56504,46792,56502,46798,56507,56514,56505,56513,N,
+N,47542,47539,N,47540,N,57593,57585,47538,47535,57586,N,N,47537,57589,N,57591,
+N,N,57598,N,N,57597,57592,47534,57584,47532,57587,47543,57590,N,57594,47536,
+47533,57596,57595,47541,N,57588,N,48120,58604,N,58601,48121,N,48119,N,58608,
+58605,58598,48118,N,48122,58599,48117,48125,58602,58603,48123,48124,58609,
+58606,58607,N,N,N,48810,59640,48807,59637,48809,48811,N,59638,48808,N,59639,N,
+59636,N,N,49270,60605,49271,60603,N,60604,60602,60601,N,N,60606,49269,N,N,
+61368,61369,N,58600,61367,49272,50015,61931,61932,N,50391,50392,62913,62912,
+50540,50539,63440,N,42057,42081,42169,N,42168,42323,42322,42492,42491,42493,
+42490,N,42826,42825,42827,N,N,N,N,43232,N,43231,43233,N,43870,N,41561,53470,
+41562,45250,41564,41563,55392,N,41565,47544,41566,N,42058,N,42170,42494,43234,
+N,42059,42173,42171,42172,N,N,42560,N,N,N,42828,43236,43235,43237,N,N,N,44509,
+N,N,N,48812,N,N,N,N,N,N,51534,N,42324,42325,N,N,42561,N,51818,N,43872,43871,
+53472,53471,45251,N,42174,51541,N,N,N,N,N,52173,N,43873,N,44512,N,44510,44511,
+N,N,N,N,48813,N,42326,N,N,N,42562,51644,N,N,N,N,42829,42830,N,51819,N,N,52174,
+43238,52175,N,N,N,N,N,53474,53475,44515,N,53476,N,53473,44516,44514,44513,
+53477,N,54376,N,N,N,55393,N,N,56517,57664,N,N,N,48126,48814,59641,N,42060,
+42074,N,N,N,N,N,N,N,N,N,N,N,N,N,N,45252,46029,N,47545,N,51522,42175,N,42329,
+42327,42328,N,N,43239,42061,42062,N,42082,N,N,42176,42177,42178,51646,42330,N,
+51563,N,42566,N,51647,42564,42565,51645,N,N,42567,42563,N,N,N,N,51820,43756,
+51821,N,N,51822,N,N,42832,42831,N,N,42835,42833,42834,N,N,N,43245,N,43244,
+52180,52177,52178,N,52176,43246,43242,43241,N,43243,43240,N,N,N,N,N,43247,N,
+43875,52720,N,52179,43880,N,52721,43876,43879,43878,43877,43874,N,N,N,53480,N,
+44519,53483,44517,N,N,N,53479,44520,44518,44521,53481,53482,N,53478,53484,N,N,
+N,N,N,N,46033,45253,54377,54379,54378,54380,45254,N,N,46030,N,46031,46032,N,
+46800,56519,N,56518,56520,56521,46801,N,46799,57665,57666,47547,47546,58202,N,
+N,48192,48193,48194,48196,58610,58611,48195,N,N,N,48815,N,48816,N,N,61933,
+62915,62914,63441,N,42063,N,N,N,42332,42331,N,N,42568,N,N,51648,N,N,42837,
+42838,42836,42839,51823,51824,N,N,N,N,N,N,N,N,N,N,N,N,43249,52181,N,43248,N,
+52722,43884,52723,43883,N,N,N,43881,N,43882,N,N,N,53485,N,N,N,N,45255,54382,N,
+45258,54381,45541,45257,45256,N,46036,N,46035,46034,46802,N,N,46805,46806,
+46804,N,46803,N,N,57667,N,57668,N,N,N,58613,48197,58612,N,48817,60607,49273,N,
+61934,50261,N,42083,42179,51542,N,42180,42181,42333,42334,N,42569,51825,52182,
+52183,N,43885,53486,45260,45259,55395,55394,N,N,42064,42182,42335,N,45261,
+51523,N,51564,42336,N,51650,42571,42570,51649,42840,N,N,N,N,N,N,44522,N,N,
+54383,N,46807,57669,47548,N,N,59642,N,N,62461,N,42183,N,N,52184,52724,45264,
+45262,45263,42065,N,42084,41677,42186,N,42185,42184,42339,42338,N,51565,51651,
+N,N,N,43253,43250,43252,43251,N,N,43886,N,N,46037,N,42066,N,42187,N,42341,
+42340,N,51826,N,N,43254,N,N,N,N,N,51543,N,42343,42342,42572,42573,51827,42841,
+N,42842,N,43255,43256,43257,N,43887,52725,N,N,44523,N,N,51524,N,42188,N,N,N,N,
+N,51652,N,N,N,51828,51829,N,N,52185,N,52186,N,52727,52726,52729,52728,43888,N,
+54384,44525,53487,44524,N,N,N,N,55396,46038,N,55397,N,N,N,N,57670,47549,N,N,N,
+N,48198,N,61935,N,N,N,N,51544,N,42344,N,N,N,N,N,N,N,45265,N,N,N,N,42067,42085,
+42190,42189,N,42191,N,N,N,N,N,N,43259,N,43258,43260,N,N,N,43889,N,N,N,44526,N,
+59643,49743,42086,42346,42361,42356,N,42351,42350,42357,42355,42348,42362,
+42349,42345,42360,42359,42358,42347,N,42354,N,N,42353,N,N,42363,42352,42579,N,
+42585,42581,N,42587,51653,42584,42574,42577,42580,42576,42583,42586,42575,
+42578,42582,42588,N,N,N,N,N,51838,51835,N,42855,51836,42843,42845,42869,42864,
+N,N,N,51877,51837,42847,42849,51876,42856,51832,42868,42870,42844,42861,N,
+51830,42867,N,42852,N,42862,42863,51831,42860,42858,N,42859,42865,51873,42846,
+N,42866,51875,42854,42851,N,51834,42850,51878,42853,N,42857,N,N,N,42848,51874,
+N,N,N,N,51833,N,N,N,N,N,N,N,N,N,N,N,52203,52202,43343,52205,52207,52196,52199,
+52206,43344,N,N,52193,52197,N,N,52201,52809,43339,52813,43261,52198,43262,
+43340,43333,43329,N,52194,43332,43337,43346,52195,52188,43331,52189,52191,N,
+43334,N,43336,52187,52192,N,N,43345,43341,52200,43347,N,43338,52190,43335,N,N,
+43330,43328,N,52204,N,43342,N,N,N,N,N,52808,52731,52811,N,N,52733,43896,43944,
+43892,43943,43901,43940,43890,52732,52803,43939,52815,43941,N,43897,N,N,52805,
+52802,43895,N,52730,43942,52810,43900,52812,43945,43891,43902,43899,52800,
+43937,52806,52807,43898,43938,43894,N,N,N,N,43893,52734,N,N,N,N,N,N,52804,N,N,
+N,N,N,N,N,52814,N,53572,44539,53489,N,53494,44532,44608,53492,44527,44537,
+44542,53499,N,44538,44541,N,N,53502,44533,53493,N,N,N,53570,53571,N,44535,
+53569,44531,44611,N,53496,44529,N,53574,53497,53501,44534,44610,53498,44540,
+53568,53575,54433,N,53573,44612,44528,53500,53491,N,44536,N,N,53490,N,N,53495,
+N,N,N,N,N,N,N,N,N,N,N,53488,44609,N,N,54391,N,45284,54439,45282,45279,54396,
+45275,54434,45286,54390,54395,54394,44530,45281,54437,N,54440,54387,N,46056,N,
+54441,45287,N,45273,45270,54398,45267,N,54438,N,45274,54442,N,54388,54436,
+45277,54389,54392,54397,N,N,45278,45276,45288,N,N,N,N,45283,N,45271,45522,N,
+45272,54393,45285,45280,54435,45269,N,N,N,45268,N,N,N,N,N,N,N,N,N,N,54385,
+54386,55402,N,N,N,46039,46042,55413,46062,55416,46040,55409,46046,46052,46525,
+N,N,46050,55406,46063,46043,46051,55414,56535,55419,55407,N,55398,55411,55405,
+46049,55417,N,N,46045,46065,46058,N,46047,46044,N,46055,N,55418,55404,55410,
+55412,55400,55415,46041,55399,N,46048,46064,46060,55401,46054,N,N,46061,46057,
+46053,N,55408,N,N,N,N,N,46059,N,N,N,56533,56529,N,56544,56522,56531,46821,
+46822,46814,56540,46824,56527,56526,56524,56542,46812,56536,56525,46815,56534,
+46810,56530,56537,56539,N,N,56543,46819,56523,46813,56528,N,46808,N,46820,
+56538,46816,46817,46823,46811,41567,46809,56532,N,N,N,N,N,46818,N,N,56541,N,N,
+N,47565,47560,N,57685,57681,N,57675,47554,47550,57684,47551,57678,57680,N,
+57683,N,47556,N,47563,47557,N,N,57673,47558,47559,57676,47564,N,57674,57679,
+47555,57672,47561,47553,N,N,N,47552,57677,57682,N,47562,N,N,N,N,N,N,N,57671,N,
+48205,58695,N,58692,N,48199,48211,48212,N,48202,58690,48204,58617,48210,N,
+58694,48201,58696,48200,N,58691,58693,48203,58689,58618,58615,N,N,55403,58621,
+N,58614,58620,58619,N,58616,N,48207,N,N,N,N,48206,N,N,N,48208,58622,48818,
+58688,N,N,N,59717,N,59645,N,48830,59714,48822,48826,59713,N,48825,48821,48824,
+48819,48829,59715,59646,48828,59644,48827,59716,59712,48209,N,48831,59718,
+48823,48820,N,N,N,N,60614,60616,49275,60617,60615,60613,60612,49277,60611,
+49278,N,N,N,N,60609,60610,49274,49313,49276,N,N,60608,N,49744,N,61372,61370,
+61375,61373,N,61371,61374,N,N,N,N,N,N,N,50016,61938,61939,50262,N,61940,61936,
+61941,61937,49745,N,N,N,62462,62529,50265,62528,50264,50263,N,N,N,N,50266,
+62917,62918,N,50394,50393,50395,62916,N,63192,63191,N,50541,50543,50542,63193,
+50632,63654,N,N,N,50673,N,63653,63726,N,N,51529,N,N,42365,42364,N,42591,42590,
+51655,42589,51654,N,N,42873,51881,N,51880,N,N,42871,42874,N,N,51879,N,42872,N,
+N,N,N,N,N,52208,N,52209,43348,N,N,N,N,43946,53576,53577,44613,44614,N,N,54444,
+45289,45291,54443,45290,55420,46066,N,N,N,N,46825,46826,56545,N,47567,N,47566,
+N,58697,59720,59719,N,63851,42087,51545,N,51566,51567,N,N,N,N,42594,42598,
+51657,N,42596,42595,51656,42597,42593,N,N,42592,51658,N,N,N,N,N,N,42918,N,N,
+42915,N,42877,51882,N,N,N,51883,N,42913,N,51885,42875,51886,51884,42878,42914,
+42917,42916,42876,51887,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43353,52222,N,43355,N,
+43354,N,52288,43352,43351,52213,N,52212,N,52210,52215,52214,52211,52220,52221,
+52218,52216,43350,N,N,N,52219,43356,52289,N,N,52217,N,43947,43349,N,N,N,N,N,N,
+N,43948,52820,N,N,52826,N,N,N,43954,52824,52830,N,52821,52825,52827,52829,
+52823,N,52822,52817,52818,43949,N,43951,43950,52819,52828,N,N,N,N,N,N,N,N,
+43953,N,N,N,N,N,N,52816,53587,N,53586,53591,53582,N,53585,53584,N,53588,N,
+53592,44615,44618,N,N,53583,53589,N,N,N,44617,53578,N,43952,54458,53590,N,
+53581,N,44616,53580,N,N,N,N,N,N,54449,N,N,45292,45296,54465,54447,54461,45297,
+54463,N,54469,N,54473,N,N,54464,54452,54460,N,54474,54472,54462,54457,54450,
+55462,54448,45301,54455,45302,45298,54445,54467,54453,54451,54470,45299,N,
+54476,45293,45295,54459,54454,44619,45294,54456,54471,54475,54466,N,54468,N,N,
+N,54446,N,N,N,N,55457,N,55466,55465,46074,55458,N,46075,46073,N,55460,46070,
+55464,N,55459,55461,55421,46068,N,55474,55473,55470,46067,46071,46072,53579,
+55467,46069,45300,55469,55422,55472,55471,N,55475,N,56559,N,55468,N,N,N,N,N,N,
+N,N,55463,56551,46836,46839,46834,56550,56554,56549,N,46828,46838,56546,46832,
+56553,N,46830,46829,56556,46831,56558,N,56555,46827,N,N,N,46837,56560,56548,
+56557,N,N,56547,N,N,46833,N,46835,N,56552,N,56561,N,N,57693,47568,57699,N,N,
+47573,57695,57702,57687,47575,47569,57692,48213,57691,57700,47570,N,47574,
+57690,57696,57701,57686,47572,57694,N,N,57698,57704,57688,57697,N,47571,57703,
+N,N,N,57689,N,N,N,48217,58699,48215,48214,58701,58706,N,58702,N,58705,48220,N,
+48805,48219,N,58698,58704,N,48218,58703,N,58700,N,48216,N,N,N,N,N,N,59725,N,
+59727,59722,48833,59724,N,48832,59726,N,N,48835,59728,48834,59721,59723,N,N,N,
+N,49317,60620,N,49316,60621,49315,60619,49314,60618,N,49747,49746,61942,61944,
+N,61943,50017,50018,N,N,50019,62530,50267,N,N,63443,63442,50674,N,42088,42192,
+N,N,42919,N,N,N,N,52831,N,N,N,N,46076,46077,N,56562,47576,57705,58707,51546,N,
+N,51888,N,N,N,N,N,52290,52832,53593,44620,N,N,61945,N,50396,42089,42366,51568,
+N,42599,42600,N,43357,N,N,N,45303,N,47578,N,47579,47577,N,42090,N,42193,42195,
+42194,51547,42196,42401,51569,N,42402,N,N,N,N,N,42601,42602,N,N,N,51659,N,
+42920,N,51889,N,N,N,43361,52291,N,43359,43360,43358,53594,N,N,N,43958,43957,
+43959,43956,N,52833,43362,43955,N,44621,44622,N,44623,N,54477,N,N,N,46078,
+55476,45304,N,N,N,N,46840,N,47581,47580,57706,N,48221,48836,N,61376,63194,
+63444,42091,42403,N,42404,51665,42604,42607,N,51663,51661,42606,51664,51666,
+51660,42609,42608,42605,42603,51662,N,N,N,N,42931,N,N,42928,51894,51897,51896,
+N,42922,42930,N,N,42927,51893,51891,42926,N,N,N,42921,42924,N,51892,51899,
+51895,42925,42929,42932,51890,51898,42923,N,N,N,N,N,43367,43375,N,52303,52296,
+43376,52307,52292,52299,N,N,43366,52293,43364,52300,52304,43363,N,52305,52298,
+N,52301,N,43378,43369,52308,52306,N,43374,43372,52297,43371,52295,52294,43370,
+43368,43377,43373,43365,N,52302,N,43961,N,43968,52847,43960,52839,52835,N,
+52851,52834,N,43963,52844,43966,43969,N,43964,52848,43967,N,44630,52854,52836,
+N,N,52838,52845,52849,52853,52850,52843,52846,N,N,52840,43971,52842,52841,
+52852,43962,52837,43970,N,43965,N,N,N,N,N,44636,53602,N,44635,N,N,53600,N,
+44624,N,44629,N,53599,53596,53601,44625,53595,N,44628,44626,N,53603,44627,
+44631,N,N,44632,N,44634,N,N,N,44633,N,N,N,53597,53598,N,N,N,N,53604,N,54484,
+45305,55490,54483,54502,N,N,45376,N,54500,N,45310,45306,54509,54493,54496,N,
+45379,54506,54498,45307,45380,N,54503,54501,N,N,54486,54507,54495,54490,N,
+54480,54508,54492,54479,N,45378,54497,54510,54494,54482,54487,54478,N,45377,N,
+54491,54488,45308,54481,N,54505,45309,N,54489,54485,N,N,54504,N,N,N,N,N,N,
+46144,55483,N,55480,55497,55485,55498,N,46146,N,N,N,55494,55491,N,N,N,N,N,
+55492,55495,55499,N,54499,55501,56647,N,46147,55502,55478,55488,N,55493,N,N,
+46145,46148,55500,55503,55482,55479,N,N,55481,N,N,55486,55484,46149,N,55496,N,
+N,55487,N,55489,55477,56570,56568,46914,46912,56643,56569,56644,56640,56567,
+56646,56566,56573,46846,46845,46844,56571,56641,46841,46913,N,56564,N,56574,
+56563,56572,46842,56642,56565,46843,56645,N,N,N,N,N,N,N,57710,47586,47585,
+47587,57722,57712,57718,57707,57721,57720,57724,57717,47582,57716,47588,N,
+57709,47583,N,57723,47584,57711,57714,57719,57713,57708,N,N,N,N,57715,58709,
+48225,58712,58711,58714,58716,N,48223,N,58710,N,58708,58717,58715,58713,N,
+58719,N,58718,48227,48222,N,48224,48226,N,N,58720,59735,N,N,59734,59733,N,
+59736,59729,N,59730,59738,59731,N,48837,59740,N,59739,59732,N,60625,49320,
+60623,60628,60627,59737,N,49319,N,60626,60622,60630,60629,49318,N,60624,N,
+48838,N,N,N,49748,N,N,N,61377,61946,61947,61948,50268,N,N,50269,N,62531,N,
+62920,62919,N,N,63195,63196,63445,63655,N,42092,42093,N,42094,42197,42405,
+51667,42610,42611,N,42935,42936,42934,42933,N,43379,N,N,52309,43381,43380,
+52310,N,N,N,43972,N,44637,53605,N,54512,N,45381,46151,54511,46150,N,47589,N,
+57725,48839,N,49321,60631,N,50270,N,50544,N,51570,N,42406,51571,42614,N,42612,
+42613,42615,N,42938,42937,N,51900,42939,N,N,51901,52311,N,52312,N,43382,43384,
+43386,43383,43387,43385,N,N,N,N,N,43976,43973,43975,43977,43974,53606,52855,N,
+N,N,53608,53607,44643,N,44639,N,N,44640,44642,44644,44641,N,44646,44645,N,N,N,
+N,N,45386,54514,54513,45385,N,45384,45383,45387,45382,N,N,55509,55506,46153,
+55505,55510,N,46155,55508,46152,46154,55507,N,56648,N,56649,56650,N,N,N,N,
+47590,47598,57726,47592,47596,57761,47597,47593,47594,47591,47595,48230,55504,
+48231,48229,N,48228,59741,48840,60632,60633,N,N,50020,50271,N,42095,N,42616,
+43978,N,53609,44647,N,N,45390,45389,45388,46156,46157,55511,47599,48841,42096,
+51548,42198,51572,N,N,51668,42617,N,N,N,43388,N,N,N,N,56651,N,N,42097,N,42199,
+51669,N,N,51902,N,51903,N,42940,N,N,N,55512,46158,N,56652,N,N,N,49322,42098,
+42152,42200,51573,42407,N,42944,42943,42941,42942,N,N,52313,43390,43425,52314,
+43389,N,N,43982,52856,43981,43979,43980,44650,44648,N,N,53611,44649,53610,N,
+44638,54515,N,N,45392,45393,N,N,45391,N,47600,57762,48232,48233,N,58721,49323,
+61378,61379,N,50397,63656,51531,42201,N,42099,N,51575,51574,N,N,N,N,42618,
+51671,51672,51670,N,51673,N,N,N,N,N,N,N,51911,N,51906,51908,51910,51907,42948,
+51904,N,51905,42945,42946,51909,51912,42947,51913,N,N,N,N,N,N,N,52328,N,52322,
+52317,43427,52325,52323,52316,52329,52332,52327,52320,43429,52326,43430,52321,
+52324,52315,52319,52331,43431,N,43432,N,52318,52330,43426,43428,N,N,N,N,N,N,N,
+N,N,N,N,N,N,52907,52900,52906,52899,52901,52861,52859,N,52908,52905,52857,N,
+43984,52903,52904,N,52902,52860,52858,43983,52898,52862,N,N,52897,52909,N,N,N,
+N,N,N,N,N,44655,N,44654,N,53612,44651,53614,N,44656,53615,N,N,44659,N,44657,
+53616,52910,53618,N,44653,N,44652,N,53613,53617,44658,N,N,N,N,45395,45394,N,N,
+N,54517,54521,54523,45396,54526,N,45400,54593,N,45402,N,45398,45406,N,45403,
+54519,45397,N,54518,54516,54595,54520,N,45399,54594,45404,54525,54524,45405,
+54522,45401,N,N,N,N,54596,N,54592,55527,55534,55523,46161,55519,55535,55513,
+55532,55530,55524,N,55533,55526,N,55518,55536,55516,55529,55514,N,55537,N,
+46162,N,55531,56655,55517,46159,N,55521,N,46160,55520,55525,N,N,55522,N,N,N,
+55528,N,N,N,N,56659,N,N,N,56662,56654,N,56656,N,56661,56660,46915,N,55515,
+56658,N,N,46916,N,56653,56657,N,N,N,N,57769,N,57776,57767,N,57774,57765,57773,
+57777,57764,57768,57763,N,47601,N,57766,47602,57772,57771,57770,N,N,57775,N,N,
+N,N,58725,58727,48235,58728,N,58723,N,58722,58732,N,58730,48234,58733,58724,
+58729,58731,58726,N,N,N,N,59745,59750,59744,59749,N,59742,59752,59748,59753,
+59747,59743,59751,N,59754,59746,N,60634,49327,N,49325,N,49324,49326,N,N,61380,
+N,61810,61949,N,N,62532,62533,N,50272,N,62921,N,50398,N,62922,N,63198,50546,N,
+50545,63197,50633,N,63446,N,N,N,N,42100,42619,51674,51914,43189,45407,N,N,
+42101,42410,42409,42408,N,N,42949,N,N,44660,N,56663,42102,42103,42104,42202,N,
+N,43985,N,52911,N,N,N,46163,42105,51549,42411,42412,51576,N,42620,N,N,N,51915,
+N,42950,N,51916,N,N,43438,N,N,52334,43436,43435,52333,43433,52335,43434,43437,
+N,43986,N,43988,52915,52912,52913,52914,52916,43987,N,N,53620,53619,N,44662,N,
+44661,N,N,N,N,N,45410,54598,N,45409,45411,45408,N,N,N,N,46165,54597,N,46166,
+55539,N,46167,55538,46164,N,N,N,N,56666,56668,46917,56667,56665,56664,N,N,N,
+57780,47607,47605,N,47606,57778,57779,N,47603,58737,58735,N,48237,58736,48238,
+48236,47604,N,N,59757,59755,59756,58734,60636,49328,60635,61381,61382,59758,
+61950,N,42106,42413,42622,51675,42621,N,43439,46918,N,42203,42414,43989,46168,
+N,51577,N,51578,N,51676,N,N,42952,51920,51918,42953,51917,51919,51921,N,42951,
+N,N,N,N,N,43443,43444,43441,N,N,43440,52920,43442,N,N,N,43990,N,52919,52921,
+52918,52922,43991,44665,53621,N,53623,44663,53624,44664,53622,N,52917,54599,
+54602,54603,54600,45415,45414,45412,45413,54601,N,N,N,N,45416,N,N,46170,46171,
+N,46172,56669,56671,56673,46920,46919,46169,56672,56670,N,57784,N,N,57782,
+57788,47608,57789,57786,47609,57783,57781,57787,48240,58739,57785,48242,58740,
+48241,48244,58741,48239,48243,N,59763,59761,59760,59762,59759,N,N,50022,N,
+62534,62535,N,62923,63199,50773,N,N,43445,42954,N,N,43992,N,N,N,42107,42204,
+42415,51677,N,42955,51922,N,52923,43993,N,47610,42108,N,N,N,42657,N,N,46921,
+42109,42205,42206,N,42417,42416,N,51678,42658,N,51923,N,42956,N,N,52337,52338,
+52339,N,43446,43447,52336,43448,N,N,N,43994,52924,N,53626,44666,N,53625,N,
+45417,54604,45418,54605,N,N,N,46173,N,N,N,56674,N,N,57791,57790,N,47611,N,
+48245,58742,48842,59764,49329,N,50547,63448,N,N,N,N,52340,N,52925,45419,55540,
+46922,N,N,N,49749,N,N,N,N,42958,N,42957,43995,N,53627,N,45421,45891,45422,
+45420,46174,N,57792,47612,48246,N,51532,51679,N,51925,42959,51924,42960,N,N,
+43452,52343,52342,43451,43449,43450,52341,N,N,43997,52926,44000,43996,44002,
+43998,43999,44001,N,N,N,44669,44668,44667,N,N,N,54607,45423,45426,45424,N,
+54606,45429,N,45425,54608,45428,45427,N,N,N,55542,55541,N,46177,46175,46176,
+55543,46923,56676,46924,56675,N,N,58743,N,N,48248,57793,48247,N,47613,N,60638,
+59765,49330,60637,62016,62536,62537,N,42207,N,42418,N,N,N,51579,N,N,42962,
+42964,N,51682,51928,51927,51926,N,51681,51680,42660,42963,42961,42659,N,N,N,
+43453,52344,N,43454,51933,N,51935,51934,52345,N,N,51930,N,42968,42966,N,51929,
+51931,51937,N,42965,N,51932,51941,43456,N,51938,42967,N,51936,51939,N,43455,N,
+43457,51940,N,N,N,N,N,N,N,N,52399,52386,52350,52398,52393,44007,43458,52394,
+52397,44003,52396,43459,43464,43462,52387,N,52348,52389,43469,52400,44004,
+52390,N,44005,43465,52392,N,52941,44006,52347,43466,44008,43467,43463,43468,
+52391,52346,52395,43460,N,N,52349,52388,52385,43461,N,52927,N,52928,N,N,N,N,N,
+N,52938,53665,52939,44014,52942,52932,44013,52934,N,52935,N,N,52937,44009,N,N,
+44707,N,N,52933,52929,44708,N,N,52943,44670,53629,52936,N,53628,52931,52940,N,
+N,44012,44705,44018,44706,52944,53630,44011,44710,44017,44016,44015,44709,
+52945,44711,44010,N,52930,N,N,N,N,N,N,N,N,N,N,N,N,45430,53668,53670,N,53672,
+44712,44718,54611,53676,53667,45432,54609,N,44717,44715,53678,N,54610,N,53669,
+N,44716,53673,44719,53675,N,N,44714,53674,53677,53671,N,44713,45433,N,53666,
+45431,N,N,N,N,45434,N,N,N,N,N,N,N,54613,54622,46180,N,45436,45475,46181,54624,
+45482,55545,54614,45474,45477,45438,54612,54626,54629,55625,N,54627,55549,
+45473,45480,45484,54621,55544,54625,45435,55546,54628,55548,54617,N,46178,N,
+54615,54616,45479,N,N,45478,54619,45483,54623,45476,54620,N,45481,46182,46179,
+55547,N,54618,N,45437,N,N,N,N,N,N,N,N,N,46187,46191,55616,46929,46189,55620,
+46193,56677,55622,46931,46185,46188,55623,N,55624,55630,46195,46932,N,55626,
+55631,55619,46942,N,46933,46194,55617,55632,N,46941,46192,46926,55629,N,46196,
+55621,55550,46186,55618,N,55627,N,46925,46930,46183,55628,N,46928,N,N,N,46184,
+N,N,N,46940,57795,56688,N,56680,57794,N,56684,56686,N,N,56683,N,46939,N,56682,
+46943,N,N,N,57810,N,N,46938,47680,56689,57796,N,N,46936,56681,56685,47614,
+46927,56678,56679,47681,46935,46937,46934,56687,N,N,57800,57801,57806,48253,
+57813,N,47687,N,47686,57808,N,48252,57797,47685,N,57812,47683,47684,N,57809,
+58794,48250,46190,N,57811,48291,57803,N,48251,N,48290,57798,57802,57799,57805,
+47688,48249,47682,N,58746,57807,N,48289,N,48292,N,57804,N,48254,58745,N,N,N,N,
+N,58750,48846,58744,59811,58793,48296,N,48294,48844,58790,58786,48300,N,59768,
+N,N,N,48298,58785,N,59766,N,58789,N,58792,58749,N,48299,N,N,48293,59767,48845,
+58791,48295,48297,58788,48301,58787,58748,58747,48843,58795,59770,60640,48848,
+N,59810,N,59774,N,60641,N,48849,59809,N,59772,49332,60639,N,59769,59771,49333,
+48851,49331,48850,49335,59773,48847,N,N,N,N,N,N,N,N,61391,N,61383,N,N,N,N,N,
+60647,61384,60643,N,N,49750,60645,60644,49334,60642,60646,61392,61388,61390,N,
+61385,61386,N,61389,61387,50023,N,N,50026,50025,50024,50273,62538,50274,62017,
+50399,62924,50400,50548,50634,63449,N,63450,63451,N,N,63930,42208,51580,42419,
+N,42662,42663,42661,N,42664,42970,42969,N,52401,43471,43470,N,N,53679,45485,
+45486,N,N,N,46197,56690,46944,46945,56692,56694,56693,N,57815,N,57814,47689,
+57816,N,58796,48302,N,48852,N,49336,49751,49337,N,42209,N,N,N,51942,N,N,52402,
+43473,43472,43474,44019,52946,52947,N,N,53680,44720,45487,46198,55633,42210,N,
+42110,42211,N,51581,42423,42422,42420,42421,N,N,N,42667,51689,51691,42666,
+51683,N,51684,N,51690,51686,51688,42665,51685,51692,51687,N,N,N,N,N,N,42977,
+42986,42984,51952,51949,51957,42982,51958,N,42975,51955,N,42981,51951,51950,
+42979,51956,42980,43475,42974,51953,N,51943,42971,N,42990,51948,51954,42976,
+42978,N,51944,N,51945,51946,N,42989,42983,42988,51947,42987,42973,42972,42985,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43489,52414,52407,43484,43503,52403,52410,52412,
+52415,43498,N,52411,52404,43496,52408,N,52416,43481,N,52413,43491,43490,52406,
+43479,N,N,43480,N,43478,N,43502,43494,43488,43476,52409,43487,43477,43495,
+43504,52948,43492,52405,43482,43485,43486,N,43500,43501,43499,43493,43497,
+43483,44020,N,N,N,N,N,N,N,N,N,N,N,N,N,N,52954,44097,44024,44026,44096,52966,
+44029,53681,44721,44099,52951,52959,44030,52958,52955,52963,52965,44023,44027,
+44098,44723,52960,44025,44101,52953,N,N,N,44028,44722,44022,N,52950,52957,
+52949,52952,52956,53682,44100,N,52961,52962,52964,44021,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44737,53694,44735,44736,53684,53700,N,44726,N,N,54630,53702,53696,
+N,53687,N,53705,53690,44732,54653,53693,44734,44725,N,53707,53695,44728,53688,
+53685,53686,44729,53701,53708,44731,53692,53691,44739,44738,44724,44730,44733,
+53704,N,N,53698,44727,53683,53706,53697,53699,53703,N,N,N,N,N,N,N,N,N,N,54631,
+N,45495,45515,45514,N,45503,N,54649,54645,54642,54694,45498,45490,N,N,54647,
+46248,45494,54689,N,45516,45513,54651,54634,N,N,45512,54691,54633,45501,45505,
+54690,N,54643,45506,45500,54632,N,46200,54693,54641,45511,54644,54692,45510,N,
+55634,N,45491,54639,45496,45507,N,45502,54648,54638,54636,54654,45488,45508,
+45492,46199,54652,45493,N,45489,45504,45499,45497,54640,45509,54637,54650,
+54646,55636,55635,N,N,N,N,N,N,N,N,N,N,N,54635,55652,N,46202,N,55658,55641,
+55655,56695,46205,55659,55662,46204,55644,55661,55660,46206,55637,46201,46243,
+N,46241,55657,N,55647,46245,55664,55656,55665,46253,46251,55654,55653,N,55651,
+55645,46244,N,46242,53689,55638,N,56759,55639,46203,46250,56697,N,46246,46247,
+55640,55663,56696,55648,55643,46249,55649,55646,N,N,46254,46960,N,N,56700,
+56753,56758,56746,46956,56763,46953,56698,N,56699,46946,46955,56740,46958,
+46959,56741,N,56754,56760,46954,N,46948,56739,56701,56762,56744,56745,56702,
+56756,56747,56757,56749,N,46949,57817,46952,46950,56761,56752,56748,N,N,56737,
+47699,56751,46957,56743,N,56742,N,N,N,46951,46947,57838,56755,56750,N,56738,N,
+N,N,N,N,N,N,57833,N,57818,57829,N,57836,47697,46252,57834,47692,N,N,N,47691,
+57841,N,57819,57832,57820,57831,47695,57835,55650,N,N,N,57842,57827,47698,
+58810,48303,N,57840,57839,47700,58797,48304,58798,N,57823,57824,57821,57826,
+57822,57843,47694,48305,47696,47701,N,57825,N,57837,N,N,57830,N,N,58801,N,
+47690,48308,59818,58806,58805,58807,N,N,58804,48309,N,48315,48312,N,48313,
+58799,58802,58812,48321,48319,N,58803,55642,48306,58809,58800,N,48322,58808,
+47693,48311,57828,N,N,48314,N,48318,48320,48317,48316,N,48310,58811,48307,
+48323,N,N,N,N,N,N,N,48856,48857,59817,48866,48863,N,48854,48861,59819,48859,
+48853,N,48860,N,59816,49339,48855,N,48862,49338,59815,59814,N,48864,N,48865,N,
+59813,59812,49340,59822,48858,59820,N,N,N,N,49341,N,49346,60650,60652,N,49343,
+N,60653,60649,N,60651,49344,49347,N,60648,49342,49345,49753,59821,49752,N,N,
+49758,61396,N,49756,49757,61399,61395,49754,61393,50027,61397,N,61398,61394,N,
+49755,62018,N,62021,N,N,62022,62020,62023,50028,62019,N,N,62542,50276,62541,
+62540,62539,50275,50277,N,62925,50402,50401,N,N,63201,63200,63203,50635,50549,
+63453,63202,N,N,63452,50637,50636,50675,63657,63727,42212,N,N,55666,59823,N,N,
+42668,51959,42993,42991,N,42992,N,52417,43505,44102,N,52967,N,52968,N,44103,
+53710,N,44740,44741,53709,N,N,N,N,45523,N,45519,N,54695,45526,45525,45518,
+45521,45524,45520,N,N,55670,45517,46255,N,N,N,46257,46258,55669,55672,46256,
+55667,55671,N,55668,N,46961,N,N,56764,N,N,47702,57844,48867,48324,58813,48325,
+48326,58815,58814,58816,59825,N,N,59824,60655,60654,49348,49349,62024,N,N,
+42213,N,N,N,N,55673,N,N,N,46260,46259,56765,N,61400,50403,63454,42214,N,44742,
+N,45528,45527,55674,55675,46962,57845,47703,59826,N,42215,42424,N,43506,52418,
+N,52969,44104,45529,N,55676,46261,46963,N,58817,58818,N,N,60656,49759,63728,
+42216,N,52419,43507,44105,N,52970,N,44743,53714,53712,53713,44744,53711,N,N,N,
+N,45531,45532,54696,45533,45530,55677,N,55678,56766,N,N,47705,47704,N,N,60657,
+61401,N,62026,62025,62543,N,51550,44106,N,N,42217,42425,N,42670,42669,N,N,
+42671,42672,51694,51693,51960,42994,51963,51962,51961,51964,N,N,N,N,43508,
+52425,52421,52430,43515,N,43513,52426,52422,52429,43512,43584,52424,52420,
+43518,52427,43511,52428,43514,43516,52432,52431,52423,43510,43509,43517,N,N,N,
+N,N,N,52975,52981,N,44112,44109,52972,52977,N,44115,44107,52976,44110,44113,N,
+N,52979,N,44108,52984,44111,N,44114,52973,52978,52982,52974,52971,N,N,52983,
+52980,N,N,N,N,N,N,44752,44745,44748,N,44751,N,53717,N,44746,53715,N,44750,N,N,
+44747,N,53718,44749,N,N,N,N,N,N,54700,45535,54699,54701,45534,45539,53716,N,
+54698,54702,N,45536,54697,45538,N,45537,N,55719,N,55714,N,46262,46266,46263,
+55717,55720,N,46264,N,46265,46270,56775,55718,46268,55715,55713,N,46269,N,
+55716,N,N,N,46969,N,56767,46966,46967,46965,56772,56771,56768,46971,N,N,56770,
+46267,N,N,56774,56769,46968,46964,46970,56773,N,N,N,47708,N,57848,57847,57846,
+47706,N,N,N,N,N,47707,58821,58824,48328,N,N,48327,58825,58820,48330,58822,N,
+48329,58819,N,58823,48873,48870,59835,59834,N,59833,59828,N,59829,N,N,N,48871,
+N,48868,48872,59827,48869,59830,59831,59836,N,N,59832,N,N,60658,N,N,N,49351,N,
+61404,49350,61402,61403,49760,50030,62027,N,50029,N,N,62545,62546,N,50278,N,
+62544,50404,N,63455,50638,63658,63659,N,42218,N,42673,42674,42995,N,52433,
+44116,44753,45540,N,N,45266,N,46271,46272,46028,55721,N,46972,57850,57849,N,N,
+42219,42675,52434,43586,N,43585,N,52985,52986,N,53719,53720,44754,44755,N,
+44756,54703,N,N,45542,N,46274,N,46273,56776,57210,57851,59837,N,N,49761,50279,
+42220,N,42428,42429,42427,42430,42426,N,N,42678,N,51702,42677,42679,N,N,51697,
+51696,51699,51698,51701,42676,51695,51700,N,N,N,N,N,51965,43005,51966,52035,
+43004,N,52039,52034,52037,42997,42998,42999,43000,N,43072,N,52033,43002,43073,
+N,52032,52038,N,43001,52036,43003,42996,43006,N,N,N,N,N,N,N,N,N,43607,N,52436,
+43587,N,43597,43598,43590,43608,43592,52444,43603,52439,43593,52454,52455,
+52447,52440,43606,52452,43601,43599,N,52453,N,52451,52443,52435,52442,43594,N,
+43600,N,43588,52446,52445,52437,N,43602,52449,52438,43605,52456,43589,N,43596,
+52441,52450,43604,N,43591,43595,N,52448,N,N,N,N,N,N,N,N,N,N,N,N,N,N,53083,
+44124,44137,N,53078,53068,44130,53066,44123,53061,44133,53074,52990,53057,N,N,
+N,N,53060,52987,53073,53089,44128,53062,53080,N,52989,53087,53088,53091,53082,
+53067,53075,44134,44121,44129,44141,44118,44120,N,N,N,53059,44138,44131,53085,
+53056,44140,44135,53065,N,N,44139,53072,53064,44132,53084,53076,N,44126,53090,
+53063,44122,53081,53071,44127,53077,44119,52988,44136,44771,44125,53070,53069,
+53058,N,53086,N,53079,N,N,44117,53740,44778,53741,N,53729,44767,44779,N,53722,
+N,53731,53739,N,53721,53748,44757,N,N,N,53747,53742,N,53743,44765,44776,53733,
+N,53734,53744,53735,N,53730,53724,53725,53738,53732,N,N,44758,44762,53746,
+53726,44774,44770,N,N,44773,44780,44763,44775,53737,44777,44760,N,44759,53723,
+N,53727,44768,53745,53736,53728,44772,44769,N,44761,44764,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,54724,N,54708,54709,54713,N,54728,54725,N,54718,54717,
+45549,54721,54736,54704,N,54737,54723,54741,54729,45548,54727,45543,45564,
+45554,N,45558,45557,54705,N,54734,54740,54732,54739,N,N,54720,54706,54738,
+54722,45546,45559,N,54731,45552,N,N,N,54730,54707,45560,N,45562,54733,45563,
+45545,54714,54735,N,N,45551,45561,54716,54726,54711,54715,45556,54710,45544,
+45553,45550,54719,44766,55744,45547,N,N,N,N,N,N,N,N,N,N,N,N,N,N,45555,N,55747,
+55769,55758,46294,N,46289,55741,46290,55757,N,55750,55763,46286,55723,55765,
+46276,55731,46279,46278,N,46295,N,55725,55759,55760,46281,46277,55739,N,46288,
+55734,N,55761,46284,55753,55766,55728,55733,55727,N,46283,55746,56798,55729,
+46287,55738,55762,46282,55735,55732,55749,46285,46275,46297,55752,55751,55724,
+46280,55764,55740,55742,N,55755,55754,55722,46291,46293,55730,55737,55745,
+46292,55736,55748,55767,N,55756,N,N,N,N,N,N,N,N,N,N,N,N,N,55768,N,N,N,N,55726,
+N,N,N,N,56818,47014,N,56816,56795,56800,56793,N,56812,56779,56786,N,56810,
+56820,56796,N,56783,56802,56807,56787,N,56804,56784,N,N,56791,56792,47016,
+56811,56809,N,56780,56814,N,56815,56817,47020,47012,N,54712,56788,56806,56789,
+47009,47025,56813,47023,47019,56778,47011,N,56781,47024,N,56797,56777,N,47017,
+56801,56785,47018,56794,46974,46296,56803,55743,56782,N,N,56808,47013,56805,
+47010,56799,47021,56790,56819,N,N,N,N,N,N,47015,57030,N,N,47022,N,N,N,N,N,N,
+57930,57928,N,57950,57926,N,57944,46973,47711,57922,57949,N,57927,57941,47716,
+47709,N,57947,N,57920,57946,N,47727,57937,57953,47725,57929,47710,57931,57945,
+47719,57924,47723,47713,57933,57923,57852,N,57943,47720,57952,57853,47717,N,
+57939,N,47718,57925,57936,57932,57934,N,47712,57951,47726,57935,N,57954,N,N,
+57854,57940,47715,47724,47722,57921,57942,47721,N,N,47714,57938,N,N,N,N,57948,
+N,N,N,N,N,N,N,N,58837,N,58833,58829,58849,58846,48333,N,N,58853,58836,48344,
+58843,N,N,58832,58842,48341,58862,N,58859,58845,58830,N,N,58850,58852,48337,
+58840,58835,58826,48334,48342,N,58855,48343,58827,58861,58848,58854,48340,N,N,
+58851,N,58858,N,48345,N,48339,58844,58831,58863,58828,58856,48336,N,58838,N,
+58839,48335,48332,58834,48338,N,48331,N,58857,58860,58841,59850,N,N,N,N,N,N,N,
+N,N,59842,N,59838,48886,N,N,48875,48880,48876,59852,59863,48874,59844,59853,
+58847,59854,N,N,48881,N,59869,48885,48888,59840,N,48884,N,59867,59868,59858,
+59857,59849,N,N,59859,59866,59865,N,48879,48877,59851,59848,N,59845,59864,
+48887,59862,48883,48882,N,59856,N,59839,59841,59843,59861,59855,48878,N,59846,
+N,59860,N,N,N,N,N,N,59847,N,N,N,N,N,N,N,49359,60741,49352,60661,N,60737,49354,
+60744,N,60668,N,60663,N,N,60745,60659,60670,N,49361,60740,60746,60669,49353,
+60736,60660,49360,N,N,60743,60665,49356,N,60667,60664,49362,60666,49355,49358,
+60739,60662,60742,N,60738,N,N,N,49763,61415,49768,49769,N,N,N,49762,61414,N,
+61411,61412,49766,61406,61410,49765,N,61407,N,N,N,N,49767,49764,N,61405,61409,
+61413,N,N,N,62033,62030,62039,N,62038,62036,62031,N,50034,N,N,N,N,N,62032,
+50033,49357,62035,50032,62040,62034,62029,61408,N,N,N,50031,N,62028,62550,N,
+62549,62037,50280,N,62553,62554,62548,62552,N,62547,N,N,N,N,62929,62551,50407,
+50405,62927,62930,N,62926,62928,50406,N,N,N,63205,63206,50550,63204,N,N,N,
+63458,50639,63456,63457,63660,N,N,50774,63731,63729,63730,63732,N,N,N,63931,N,
+42221,42680,N,43609,N,52457,N,N,53092,N,N,N,53749,53751,N,53750,N,53752,45565,
+54743,53753,N,54742,54744,54745,55770,46299,55771,55773,46300,46298,55772,N,
+56826,56824,56823,N,56822,56821,47026,56825,47728,57955,57957,47729,57956,
+48347,N,48346,58864,N,N,59871,59870,59872,N,N,48889,N,60747,49363,N,61416,
+49770,62041,50551,42222,42431,42681,43074,43610,43611,N,N,44142,N,N,53754,N,N,
+N,N,47027,N,N,N,59089,48890,49771,42223,N,42682,N,N,52459,43612,52458,N,53093,
+44143,53094,N,44144,N,53756,44782,44781,N,54750,54748,54749,54747,N,54746,N,N,
+55774,55777,46302,55775,46301,55776,N,56827,N,N,57958,57959,57960,N,58867,
+58866,48348,58865,58868,59873,N,N,59874,59875,N,60748,49364,49772,62042,N,
+50408,51551,N,44145,53095,44783,N,N,45566,N,46303,55778,N,47029,47028,N,N,
+57961,57962,48349,48350,59877,59876,61417,63459,42224,51552,42432,N,43075,
+52040,N,44146,47030,42225,N,53096,44147,53097,N,49365,42226,N,N,52460,N,53098,
+N,53826,53825,53758,N,53757,53827,53824,N,N,45632,45633,N,N,46304,55779,N,
+55780,55781,N,N,N,56897,56898,56896,N,56829,56830,47031,57963,58871,58870,
+58869,58872,59879,59878,48891,59880,N,49366,60749,N,61418,62043,63207,N,42227,
+42434,42433,N,43613,51553,51582,42683,N,51703,52041,52042,43614,N,52461,N,
+44148,53099,53100,N,44784,44788,53828,44787,44785,44786,N,54751,45634,46307,N,
+46305,46306,55782,N,N,47730,42228,N,51617,N,42435,N,N,51620,N,N,42438,51619,
+42437,42436,43076,51618,N,N,51704,N,N,N,51708,51710,51776,42693,42694,51707,
+42689,N,51705,N,51709,42690,N,42685,N,42686,N,42692,51706,42684,43077,42687,
+42688,42691,N,N,N,52059,52057,52044,43089,52051,43084,52045,N,52053,N,52050,
+43087,52049,43094,52058,43096,N,43098,N,52043,N,43085,52060,N,43092,43095,N,
+52549,43079,43102,43093,52046,43082,43097,52054,43080,43081,52547,52047,43088,
+43099,52061,52048,43086,N,43091,52462,43100,52055,43090,N,43101,43078,52052,
+43083,52056,52548,N,N,N,N,N,N,N,N,N,N,N,N,N,43626,43642,52469,43633,N,52555,
+43618,N,43621,52546,N,52467,52471,43629,43631,52474,43638,43624,43622,43623,
+43637,52551,43632,52473,52475,43630,43635,52476,52554,N,44149,43641,N,43619,
+52553,N,52557,52472,52559,52544,43628,52468,43627,43645,43634,N,52466,53109,
+43640,43644,52545,52550,N,43646,43639,43625,43615,N,43620,N,52470,43616,52558,
+N,52464,52463,52477,52465,43643,44789,43636,52478,43617,N,44198,N,N,N,52556,
+53116,53153,N,53156,53111,N,N,53159,53162,53164,53108,44150,44155,53833,44205,
+53157,53165,53115,53107,N,N,N,53860,44158,53154,53112,53114,44197,N,53117,
+44157,53104,53160,N,53163,N,N,44154,N,44200,53101,44202,44152,44206,53161,
+53103,44203,53854,52552,44156,44151,53110,53102,44204,44196,53155,44201,44199,
+53113,44193,53105,44194,44195,53106,53158,44153,53118,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,53836,44797,44867,N,N,N,53845,53851,53847,53834,53837,53830,
+53831,44874,44794,53846,53855,44869,44790,N,44864,53838,44866,53839,53849,N,N,
+N,44868,53864,53832,44796,44795,44872,53829,53862,53850,53863,53857,53843,
+53858,N,53852,53861,53859,44873,53844,44793,44792,44865,44871,53856,44870,
+53841,45635,N,53865,53840,53835,44798,44875,44791,N,53848,53853,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,45669,54753,54757,N,45650,45648,N,N,45639,54755,54754,
+45659,N,54760,45653,N,54778,54855,45636,54775,54768,45671,54752,N,54780,N,
+45668,45656,45667,45646,54764,54782,54774,45647,45641,54853,N,54781,54848,
+45649,45657,54850,54762,54779,54767,54852,45662,45638,45660,54772,54770,54771,
+45651,54766,54765,45640,54759,54854,45642,54769,45672,N,45666,54758,45663,
+45661,45670,54776,45665,53842,54777,45664,54849,45637,54773,45655,54761,45654,
+N,45652,45644,45643,55783,54851,54763,N,N,55804,N,45645,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,46401,45658,46318,55798,46332,N,55786,46315,46311,55881,46317,
+46321,46316,46325,55885,55876,N,N,55793,46330,46324,55805,46308,55882,55875,
+46312,55799,46327,55893,55894,N,46309,55880,46329,55803,55789,55790,46333,
+55794,55801,55795,N,46331,46404,55791,55784,55785,N,55787,46314,55800,N,46328,
+46402,N,N,55802,55891,55883,46310,55889,46322,N,46320,N,55895,46319,55873,
+55796,55806,46407,55877,55874,55792,46403,55887,55884,55892,46313,55872,46406,
+N,55879,N,N,46323,46326,N,55878,46405,55797,54756,N,N,55888,55886,55890,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,55788,46400,N,N,N,56929,56928,56902,47037,N,56927,56905,
+56906,N,47047,56936,47042,56926,N,56899,47048,47038,56914,56904,56907,56931,
+47032,56938,56930,47041,56919,47052,N,N,47051,47045,N,N,56937,47033,56917,
+56908,56921,56933,47053,N,47035,56916,N,56909,47044,N,47043,56912,56922,56932,
+56903,56913,47036,56923,47049,47040,56910,47039,56901,56915,56935,46334,47792,
+56918,57964,56920,56934,47046,56911,47034,47050,48368,56900,N,56925,N,N,N,
+56924,N,N,N,N,N,N,N,N,N,N,N,N,N,N,58026,47789,57981,58020,47778,N,57966,47791,
+N,47735,57965,58032,47793,57969,58019,N,57971,58035,58031,47733,47777,58963,
+47790,47741,57967,N,58030,47779,58027,58040,57973,57982,N,N,58038,58028,47740,
+N,N,57980,47734,47732,47784,N,N,57978,57975,57976,N,58034,N,58039,58037,47738,
+58041,47742,47783,N,57968,58874,57977,N,47736,47788,47785,47739,58021,57972,
+47786,58023,47780,47782,47731,N,58025,58017,57970,47781,58033,58036,57979,
+58024,N,47737,48351,58022,58873,N,58029,N,N,N,N,N,N,N,N,N,N,57974,58948,58958,
+48354,58957,58969,48356,58955,N,58959,48367,N,58950,48359,N,58962,59888,48371,
+48370,58964,58947,58974,48365,N,48355,58967,N,58971,58976,58965,58953,48358,
+48361,48369,48364,N,58956,58018,N,N,58952,58975,48360,N,48363,58977,48352,
+58966,58875,58972,49375,N,58954,N,48353,58949,48357,58876,47787,58945,N,58970,
+58946,58944,48362,N,58968,N,58878,58961,58960,58973,58951,48366,N,N,N,N,N,N,
+59891,N,48969,48894,59968,59883,48961,59895,48968,48963,59893,60751,59899,
+59970,59898,59881,59896,59972,59974,48893,59973,48964,48970,N,48967,N,59902,
+48966,59897,N,59885,59890,N,59901,48965,48962,48892,48960,59889,N,58877,59884,
+59887,59969,59892,59882,60750,59971,59886,59900,N,N,N,N,60753,49379,N,N,49367,
+N,N,49371,60755,60761,60759,49369,49370,49377,60762,60754,49372,N,60758,60757,
+60763,49378,N,49373,49376,60756,49380,49374,49381,49368,60760,N,60752,N,N,
+61431,N,N,49777,61428,61430,N,49775,61426,61427,61422,N,N,59894,61423,49776,
+61419,N,49773,61432,49774,61420,61421,61425,49779,N,49778,N,N,61424,50040,
+62047,62053,50041,62044,50038,50035,62055,50039,N,50036,62046,62049,62050,
+62051,62054,N,61429,62045,50037,62052,62056,62048,N,N,N,62557,50282,62560,
+50283,62568,62559,62556,N,62558,62562,62565,62564,62567,62555,N,50281,62563,
+62566,62569,62561,62931,62932,62936,62937,N,62934,62935,62933,N,50409,N,N,N,N,
+50552,63211,N,N,63208,63209,63210,50553,N,63461,63460,N,63663,50676,63661,
+63664,63662,63733,50775,50789,63907,63852,N,63906,63952,63953,42229,N,N,N,N,
+42695,51777,N,N,52062,N,43103,N,43106,N,52063,N,43104,43105,N,N,N,N,52568,
+52570,52565,52562,52564,N,N,N,43684,N,N,N,43682,N,N,52566,43683,52563,52560,
+43681,52567,N,52561,43685,52569,N,N,N,N,53167,N,53171,N,N,44215,N,N,N,N,53174,
+N,44207,44210,44212,44214,44211,53170,53169,N,44209,53172,53173,N,53166,44213,
+N,44208,N,N,N,53168,N,N,N,N,N,N,53879,53880,53881,44880,N,44876,53870,N,53878,
+53883,44881,N,53868,53874,53867,53877,N,N,53873,44877,44879,53882,N,53866,
+53869,53875,N,53876,53884,53872,N,44878,N,N,N,N,N,N,N,N,N,N,45677,54862,N,N,
+54864,54860,N,54872,54858,54871,45673,54856,55899,54866,45676,N,54867,54870,N,
+54874,N,54863,N,54868,N,N,45674,45675,54873,54861,54857,54875,N,54865,N,N,
+54869,N,N,N,54859,N,46408,46409,55909,46415,N,55897,55906,55896,46412,55904,
+55902,N,55903,46410,N,55907,N,N,N,N,N,55900,55898,46411,55901,55905,N,N,N,
+46413,N,N,N,55908,N,N,N,N,N,N,56944,56951,56953,56993,N,47066,56939,N,47058,N,
+56954,47063,56994,47054,N,56957,N,56941,56958,56940,N,47068,N,56952,47055,
+56995,N,47060,56945,47065,56956,56943,56950,56946,56942,47057,47064,47062,
+47059,47067,47056,56949,N,47061,N,46414,N,56955,N,56947,N,N,N,N,N,56948,N,N,
+58049,N,47796,N,N,58045,58051,58047,N,47798,58046,58050,58042,N,58044,47797,N,
+N,N,N,58048,58043,N,47799,N,47794,N,N,58052,N,47795,58983,58980,58992,58986,
+58988,48372,58982,58990,N,N,58989,58987,N,58993,48375,58984,58991,N,48373,N,N,
+58979,58981,48374,58978,58994,N,58985,N,N,59978,48977,N,N,59989,59987,48971,
+59977,59980,59981,59976,48981,48982,59975,59990,59985,48975,48972,59984,59982,
+N,N,48978,59986,48973,N,48974,N,59983,48976,59979,N,59988,48979,59991,59992,
+48980,N,N,49383,49390,60764,60770,N,60768,49386,49385,49382,60766,N,N,N,49388,
+49387,49384,N,60769,60765,60767,N,49389,N,N,N,49783,61435,N,49780,49781,61437,
+49782,61434,61433,62060,61436,N,62061,50042,62059,N,N,62058,N,62057,50043,N,N,
+50284,N,N,62570,62571,N,N,N,N,62940,62939,50410,N,62938,63212,63213,N,N,63462,
+63665,N,N,63734,63932,50809,63942,42230,N,43686,43687,N,N,44216,N,N,N,N,49391,
+42231,N,43688,44882,47069,42232,N,45678,47800,51554,N,53175,53885,N,58053,N,
+49392,42233,43689,53176,53177,55910,46416,N,N,56996,N,N,47070,58054,N,N,48376,
+N,50044,42234,55911,42235,N,42697,51778,42696,43109,43108,43107,52064,N,N,N,
+43690,N,43691,52571,N,53178,N,53181,44218,53179,N,44217,53180,44219,N,53922,
+53921,53886,44883,N,54877,54878,45679,54876,54879,46418,45680,N,N,46417,55915,
+55914,N,55912,55913,N,55916,56998,56997,57001,N,57000,56999,47801,58057,N,
+58056,47802,58055,58995,N,58996,48377,N,59993,59994,N,N,62066,50045,62065,
+62064,62062,62063,50411,62572,63214,63735,N,42236,N,51621,42439,51622,N,N,N,
+51779,51780,N,N,N,N,52070,N,N,52066,N,52065,43692,52069,43111,52067,43110,
+52071,52068,N,N,52575,53182,52573,52580,N,43693,N,43696,52581,52577,N,52578,N,
+52572,43695,52574,43694,52579,N,52576,N,N,53186,44221,44222,N,53189,53183,N,
+53188,N,53184,44220,53187,53185,N,N,N,N,N,N,N,53928,53925,N,53927,44888,44887,
+44885,53924,53929,44884,44886,53926,54887,53923,53930,N,N,N,N,N,54882,54886,N,
+54885,55918,55929,N,N,54888,N,54883,55917,45684,N,N,45683,54881,54884,45685,N,
+45682,45681,54880,54889,N,N,N,55920,55927,N,46420,55926,55923,N,46422,N,N,N,
+55925,N,N,55919,55921,55924,55922,46421,55928,46419,47071,N,N,57005,57004,
+57002,N,47074,47073,57006,N,57003,58058,47803,47072,N,N,N,57008,57007,N,58061,
+58059,48378,N,47804,58060,58998,N,N,N,N,48379,58997,59006,59005,59003,N,59002,
+58999,59000,59001,59004,59041,N,N,59999,59996,59997,48983,59995,60001,60000,
+59998,N,60772,60773,49393,N,49394,60771,N,49785,61438,49784,50046,N,50081,
+50285,62574,62573,62941,63215,50554,63464,63463,63465,42440,53190,44889,45686,
+54890,42441,51623,42237,N,N,51781,N,N,N,52076,52074,52075,52072,43112,52073,N,
+N,N,N,N,52589,N,43699,52587,52583,52586,N,52582,43701,52585,N,43698,43697,N,
+43700,52588,52584,N,N,N,N,44226,44229,53198,53197,53196,44223,53205,53195,N,
+44225,53935,N,53202,53200,44228,N,53192,53203,N,53194,53204,53201,53193,N,
+44224,53206,53191,44227,N,N,N,N,53940,53931,53942,N,53934,53945,53946,53932,
+53944,53941,53939,53943,44895,N,44893,N,N,53937,N,53933,N,53936,53947,53938,
+44894,53199,N,44890,44892,N,N,N,N,N,54904,54893,54891,N,54892,N,54899,N,54900,
+54896,45691,54901,54898,54895,N,45689,54894,45687,45690,54897,54905,44891,
+45688,54903,54902,45692,N,N,N,N,N,N,N,N,55934,N,N,N,55969,46432,N,55975,N,N,
+55977,55970,46426,55974,55973,46427,46433,N,46434,55976,46424,55933,55931,
+55971,55930,46431,55932,55972,55978,46425,46430,46428,46429,N,N,N,46423,N,N,N,
+N,47081,57015,47080,57019,N,57009,N,57020,N,N,N,57010,57011,N,57021,57018,
+57016,57017,57013,57012,N,57022,47077,N,57014,N,47082,47076,47083,47084,N,
+47079,47078,N,N,58062,47806,47805,N,N,58067,N,48380,47807,N,N,47809,58068,
+47075,47808,58064,58066,58063,N,58065,N,N,N,59051,N,N,59050,59047,48448,60002,
+48449,59046,N,48382,N,59048,59045,59042,59049,59043,59044,48381,N,N,N,N,60777,
+N,60006,N,60005,60007,N,60774,48986,N,60003,N,48984,N,48988,48987,60004,60008,
+N,48985,N,60781,49397,49786,49398,49395,60778,60776,N,60779,N,60782,49396,
+60780,60775,N,N,61506,61509,62069,61504,N,62575,61510,N,50082,61508,49787,
+61505,61507,61511,62070,N,62068,N,N,N,N,50083,62067,N,N,N,50286,N,N,N,N,50413,
+63217,50412,63219,63216,63218,50640,63666,42442,52590,53948,53949,45693,57023,
+48989,50084,50555,63667,42443,N,52591,41568,N,N,53207,N,53208,N,N,N,N,N,53950,
+53951,45694,45729,N,N,N,55979,N,57026,57025,57024,58069,N,58070,58071,47810,N,
+N,59053,59052,N,N,60009,48990,48991,N,60786,60783,60784,60785,61513,61512,
+49788,62071,62942,42444,N,44230,N,45730,57027,N,42445,N,53952,45731,N,N,46435,
+46436,N,42446,42447,51782,43114,43113,44231,53209,55980,42448,42449,42450,
+42451,N,N,N,43115,43116,52078,52077,N,N,43702,52594,52592,52593,N,N,N,N,N,N,
+53210,53211,N,N,44235,44233,N,44234,44232,N,N,N,N,44896,N,N,N,N,44900,44899,
+53953,44898,44897,N,53954,N,N,45734,54907,54906,45732,45733,N,N,N,46438,46437,
+55982,N,N,55981,45735,N,N,N,N,N,47085,57029,47086,57028,N,N,N,58072,59054,
+48450,60010,N,N,N,60787,N,50086,50085,N,N,50556,42452,52595,N,N,45736,58073,
+47811,N,N,52079,52080,N,N,52596,43704,43705,N,N,43703,N,N,N,N,44239,44240,
+44237,44238,N,53212,N,N,53213,44236,N,N,N,N,53955,N,44904,44905,N,45739,53961,
+N,44910,44908,53962,53957,44907,44906,44901,53960,53959,53956,44909,N,53958,
+44902,N,44903,N,N,45740,54945,54946,45741,54908,54910,54948,54947,54909,N,
+45737,45738,N,55990,46443,46442,55984,46440,N,55987,46444,55988,46445,55985,
+46439,46441,55989,N,55986,55983,N,N,N,N,N,57042,N,57031,47088,47091,47090,
+47095,47094,57043,57041,57034,57038,57037,47092,57040,57036,57044,57035,47093,
+47087,47089,N,57033,N,N,N,N,58075,47815,58079,47814,58076,47813,N,57032,57039,
+58078,N,47816,58080,58077,58074,N,N,59057,59061,59063,59059,59058,59056,48453,
+48451,48456,48457,59060,48454,59055,48455,47812,59062,48452,N,N,N,60012,N,
+60011,60019,60013,60018,60015,48992,60017,N,N,48993,N,48994,N,60016,60014,N,N,
+N,N,49400,60788,N,N,49399,60791,60789,60790,N,N,49401,N,N,N,61517,N,49825,
+61518,N,N,49789,61519,49790,61516,61520,N,61514,N,N,50087,62072,50088,50287,N,
+61515,50288,N,N,N,50414,62943,N,50558,63220,50557,N,63466,50677,50678,N,N,
+63948,N,N,44241,53214,N,46446,46447,42453,42698,51783,N,52081,43117,N,43706,N,
+44242,44243,44244,54950,53963,44911,N,N,45742,54949,N,N,55992,46449,N,55991,
+46448,N,N,57045,48458,59067,59064,59065,59066,N,N,N,N,N,60792,N,61521,N,N,N,
+62577,62576,N,63221,42454,52597,44912,N,N,N,46450,57046,N,N,58081,N,48459,
+60020,N,61522,62578,42455,N,N,43707,44247,53215,44248,44246,N,44245,53964,
+44913,N,N,44914,44915,N,N,N,45744,54951,45743,N,N,N,N,N,55993,45745,46451,
+57047,47096,47097,N,47817,N,47818,48460,48996,60021,48995,N,60793,49402,N,
+61523,62579,42456,43118,52600,52599,43708,52598,43709,52601,N,53221,44251,
+44250,53223,53222,44255,N,44254,44249,N,53217,53218,53219,N,44256,53216,44252,
+53220,44253,N,N,N,N,53967,53971,53969,53968,N,53972,N,N,N,53973,53974,53966,N,
+53965,N,44917,44918,N,53975,53970,N,54960,N,53976,44919,44916,N,N,N,54954,N,
+54953,N,54955,54956,54958,54957,54962,45749,45746,45750,54952,45751,54961,
+45748,54959,45747,N,N,N,N,N,55996,55998,55994,55995,N,N,55999,56001,56002,
+55997,56000,46452,N,N,57051,N,57056,57048,57052,N,N,57057,57053,47098,47171,N,
+47101,57049,57050,47822,47174,47102,N,47172,47100,57055,47173,57054,47169,
+47099,47170,57058,58086,58088,N,N,N,N,N,N,N,N,N,47168,N,N,58083,47820,58089,
+47821,58087,58082,58085,58090,47819,58084,N,48462,59071,59070,N,48465,48463,
+59068,48461,59069,N,48464,N,N,N,60029,N,60065,N,60030,60022,60026,60025,60023,
+48998,48999,48997,60024,60027,60028,N,49000,N,49472,60835,N,49404,60795,49406,
+49473,N,N,49405,60834,60796,49403,60833,60794,60798,60797,N,N,61525,49828,
+49829,49826,N,49827,N,N,61524,N,62075,N,N,50089,N,62073,62074,N,62580,62583,
+62581,62582,62944,N,N,50415,63467,63668,N,50679,63736,63737,50790,42457,44257,
+N,56003,N,57059,N,42458,43119,N,43710,N,53224,53225,44920,N,N,56004,46453,
+47175,49474,60836,62076,62584,42459,N,N,N,52641,52602,52604,52606,52605,52603,
+43711,44258,53234,N,53229,53226,N,N,53233,N,N,44260,44261,53232,53231,53230,
+53227,53228,53235,44259,N,N,N,N,N,N,N,N,44924,N,44964,44963,53985,53979,53977,
+N,44961,54969,44922,53982,53986,53988,53984,53978,44962,53983,53981,44921,
+53989,44965,53987,44925,53980,N,44926,44923,N,N,N,N,N,N,N,N,N,N,45753,N,54970,
+N,N,54963,54965,54967,N,54968,54966,45754,N,54971,N,54964,N,N,N,N,N,N,N,N,N,
+56008,46454,56016,N,56005,N,56017,N,56006,56007,N,N,56015,56014,56011,45752,
+46455,56009,56012,46456,56013,56010,N,N,N,N,N,N,N,57070,N,57074,47182,N,58096,
+47185,57072,N,N,57069,57064,57066,57067,57060,N,47181,N,N,47180,N,47176,57063,
+N,47183,N,47184,57062,57065,57073,47178,47179,57071,57061,N,N,N,58098,47824,
+58100,57068,58102,47828,58103,58099,N,47825,58095,47827,58092,58097,58101,
+58094,N,N,47177,N,58091,47826,58093,N,N,N,N,N,48468,59073,48472,N,48470,N,N,
+47823,N,59080,59081,48467,N,N,59079,59082,48469,48466,59075,59072,59077,59074,
+48473,59076,N,N,59078,48471,N,N,N,N,49002,60072,N,60066,60070,60076,60077,
+60073,60074,60071,N,60068,N,49004,49001,60067,60069,N,49003,60075,N,49478,N,N,
+60842,60837,49477,N,N,49475,N,60844,49476,60840,60841,60838,60845,61526,49479,
+60839,N,60846,60843,N,N,N,61530,N,N,61527,N,49830,N,61531,61533,61532,61528,
+61529,N,N,62115,N,50090,N,62078,62114,62077,62116,N,N,62113,N,62586,62589,
+62585,50289,62587,62588,62590,50290,50292,50291,62945,N,62947,N,62946,N,N,N,
+63222,N,N,63669,63738,42460,N,N,52082,43712,52643,43713,43714,52642,N,53240,
+53239,44262,44265,44264,44263,53236,53238,53237,N,N,53992,44967,53996,53995,
+53994,53990,44966,44970,44973,N,N,44974,53991,53993,44972,44971,44969,44968,
+54978,N,54976,54972,45755,N,54973,45756,54974,54975,54977,N,45757,N,N,56021,N,
+56020,56019,56018,N,N,N,N,57078,47186,N,57075,57077,N,47187,N,47188,57076,N,N,
+N,N,N,58177,N,58105,58106,N,47831,47829,47830,58179,N,58178,58110,58109,58108,
+58107,58176,58104,N,59083,59088,59086,N,N,N,59085,59084,59087,N,60078,N,49005,
+49480,60848,N,49481,60847,61535,61534,49831,N,62117,50091,62625,50593,63223,N,
+63671,63670,51624,44266,44267,54979,N,47190,42461,43122,43121,43120,N,N,N,
+52644,N,N,43716,43715,N,44270,N,53242,53245,53243,N,44268,44269,N,N,53241,
+53244,N,44981,N,N,N,54003,54005,54004,44978,53999,N,N,44976,44975,N,44979,
+44977,N,44980,54002,53997,53998,54001,54000,N,N,N,N,N,N,N,54982,54983,54981,N,
+54980,45758,46461,N,56022,56024,56026,46460,N,N,46458,N,56023,46459,56025,
+46457,N,N,57153,57079,57082,57086,47194,57084,N,57083,57080,57081,47192,57152,
+47191,N,47196,47195,47193,N,57085,N,N,N,58185,N,58184,N,N,58180,N,N,47832,
+58183,58182,47833,N,N,N,N,N,48478,N,59090,N,48479,48475,48477,N,48474,48476,N,
+N,N,60079,N,49008,60081,60080,N,58181,49010,49009,49006,49007,N,N,N,N,N,60853,
+N,60851,49482,60852,N,60854,60850,60849,N,N,61536,49834,49832,49833,N,N,N,N,
+62118,62119,50093,N,50092,62627,62628,62626,N,63224,63225,N,N,42462,51784,
+43123,N,52645,43718,43717,52646,N,N,53312,44271,53246,44272,N,N,44982,54008,
+54006,54012,44983,54007,54011,54009,54010,N,N,54984,54986,N,45759,N,54985,
+45760,46498,46497,46462,56027,N,N,N,N,57156,47197,47198,N,57155,57154,N,N,N,N,
+58186,47835,47834,58187,58188,N,48481,48480,N,60085,59091,59093,59092,60084,
+60082,60086,60083,N,49011,N,N,N,60855,49483,60856,60857,N,N,49835,49836,N,
+50293,N,N,50641,42463,N,N,N,N,N,53313,N,N,N,N,N,N,54013,44984,N,N,N,N,N,46010,
+46009,N,N,46500,56029,46499,56028,N,N,N,N,57157,N,47836,58189,47837,N,N,N,N,N,
+N,50294,62629,N,42699,43719,52647,N,44274,N,44273,53314,53315,N,N,54080,54082,
+44985,N,54084,54087,54085,N,N,N,54086,54083,54014,44986,54088,54081,N,N,N,N,
+54995,45766,55004,45763,N,54997,45767,N,45761,N,54992,55005,54993,54990,45765,
+N,45762,N,54996,54999,45764,55000,45768,55001,54991,54998,55002,54994,54989,
+54987,N,N,55003,N,N,56031,N,N,N,N,56036,N,N,N,56032,56038,46503,54988,56033,
+46501,56030,46508,56034,46507,56035,46509,46504,46510,46505,N,46506,N,46502,N,
+56037,N,N,N,N,N,N,N,47201,57168,N,57171,57159,57164,57158,47203,N,57162,N,N,N,
+57160,47202,N,57167,57166,57163,57165,57161,47841,57170,47199,57169,N,N,N,N,N,
+N,N,N,N,58205,N,47848,58200,N,47847,58190,N,58192,47840,58197,58196,58199,
+47845,58194,58193,N,N,47844,47839,58195,47842,58201,58203,N,58198,58191,47843,
+N,N,48489,47838,N,N,58204,N,N,N,N,N,N,N,59097,48482,N,59099,N,48483,N,N,48485,
+59102,N,59094,47846,59100,N,N,N,N,59096,N,47200,48488,N,N,48484,N,48486,48487,
+N,49014,59101,59095,48490,N,59098,N,N,N,N,N,60096,60091,N,N,60101,49012,60093,
+49016,60099,60090,60087,60102,49489,49017,60098,60088,49015,60092,49019,60089,
+60094,49018,60097,60100,N,N,N,N,60875,60876,60860,60867,60865,N,N,49487,60872,
+60095,N,60863,N,60873,49486,60862,60861,60871,60868,60870,N,60858,60874,49484,
+N,60869,60878,60866,49488,49485,60864,60859,60877,49013,N,N,N,N,N,N,N,61539,N,
+N,61537,61543,49840,61541,61540,49842,61546,49841,N,61547,61544,49838,61545,
+61538,49839,49837,62123,61542,N,N,61548,N,N,62120,N,N,N,50098,50096,62122,N,
+62124,62121,50097,50094,50095,50099,N,N,50296,N,62634,N,62633,62631,62630,
+62632,N,50295,50297,N,N,50416,N,N,62949,62948,N,N,63226,N,63228,63230,63229,
+63227,N,N,50595,50594,N,N,50643,50642,50644,63469,63468,N,63739,63672,63740,
+50776,N,50777,63853,N,N,50814,42700,N,52648,N,N,53317,53318,53316,N,N,44275,N,
+53319,53320,53321,N,N,54089,54095,N,N,54093,44987,54091,N,54092,54094,N,N,N,
+54090,45769,N,55006,45771,55008,45770,55007,N,N,N,N,N,56040,46511,N,56042,
+56039,55009,N,46512,N,N,56041,N,N,N,N,N,N,57174,N,47204,57172,47205,57173,
+47206,N,N,N,47849,58209,58206,58208,47850,47851,58207,N,N,N,N,N,59103,N,N,
+59104,N,48491,59106,59105,N,41569,N,60106,60107,60103,N,60104,49020,49021,
+60105,N,49495,N,N,49491,49496,49492,49494,49490,N,49493,N,N,N,N,49843,60879,N,
+62126,N,62125,N,62635,50298,50299,63297,62950,N,63296,N,63741,63908,42701,N,N,
+43124,N,52649,43720,44278,53324,44276,53322,44281,44277,44282,44280,53323,
+44279,44991,44990,54106,44999,54099,54105,44995,54098,54104,54102,44994,44996,
+54101,44989,54100,45000,44997,45001,44998,54097,54096,54103,44992,44988,44993,
+N,N,N,N,N,55024,55017,N,46517,55016,N,45775,45782,45779,45785,45784,45780,N,
+55010,55013,N,55012,45776,55014,55023,45777,55011,55020,55021,45778,55018,
+45783,45773,45781,55015,45772,55019,N,N,55022,N,N,N,56059,56050,46514,56057,
+56054,56046,56055,46516,56047,N,56043,N,N,47212,56052,N,46513,56058,N,46520,
+46522,56045,N,N,46521,56048,46515,56056,56049,56053,N,56051,46518,56044,46523,
+45774,46519,46524,N,N,N,N,N,47208,57181,57183,57185,57189,N,57179,57177,47210,
+N,57184,57188,57180,57176,N,57175,N,N,N,57186,57178,57182,47211,N,47209,57190,
+47207,57187,N,58226,N,N,N,N,N,47854,58218,48504,58228,47857,58232,47863,58213,
+N,N,58229,58210,N,58231,58214,N,47870,47867,58230,58224,47853,47861,47860,N,
+47859,47865,N,58211,47866,58225,47862,47852,58227,47855,47856,47864,58216,
+58215,58212,N,58220,58217,58221,47869,N,58233,47858,58222,58223,N,58219,N,N,N,
+47868,N,N,N,N,59111,48496,48505,48501,59108,N,48498,48502,59120,48492,59112,N,
+48500,N,N,59115,59110,48499,48503,59109,N,48497,N,59119,48494,59118,59117,
+48506,58738,48493,N,59116,59107,N,48507,59114,48495,59113,N,N,N,N,49058,49063,
+49022,60120,60111,60123,60115,60121,49064,49057,60108,60114,60124,60117,60122,
+60110,N,N,60118,49059,60116,49062,49061,60112,60113,60109,60119,49060,60126,
+60125,N,N,N,60890,60886,49503,N,60880,49497,49513,60892,49505,49501,60883,
+49508,49511,60894,49500,60885,49509,60896,60893,60881,49504,49498,49512,60888,
+49507,60882,49502,60895,49506,49499,60889,49510,60887,N,N,60891,N,N,N,61550,
+61556,49849,61559,49844,49845,61551,61558,61553,49850,49847,N,61549,N,49846,
+61555,61557,49848,61554,61552,N,N,N,N,62136,50103,50104,50100,N,50101,N,62132,
+62130,N,62134,50106,62135,62128,62127,62131,62129,50102,62133,62636,50302,
+50301,62637,N,62639,62638,50337,N,N,N,62955,62952,62953,N,62951,62954,50418,
+62956,N,50417,N,63298,N,50645,50647,63470,50646,63673,63808,63810,63742,63809,
+50796,42702,N,44283,53871,45002,N,N,45786,56060,56061,N,N,N,60127,49514,60897,
+N,N,49851,N,62138,62137,50338,62957,N,63299,50680,51785,N,N,43721,43125,N,N,
+53325,N,N,54112,54107,54111,54109,45003,54110,54108,N,55025,N,56062,56128,
+57193,57194,47214,47215,57192,57195,57191,47213,N,47936,N,47216,58234,N,48508,
+59121,48509,N,49065,60130,60128,60129,60900,60899,60898,N,N,N,62139,N,50105,
+62140,63300,50681,63674,42703,43723,43722,53327,44284,N,N,53326,54114,N,45004,
+55026,54113,N,N,N,45788,55029,55027,55028,45787,N,56130,56131,56129,N,47219,
+57197,57196,57198,47218,47217,N,N,59122,59124,N,48510,59123,60131,49066,61561,
+N,61560,50107,62141,50109,50108,62640,62958,50419,42704,53328,44285,54117,
+45006,54116,54115,N,45005,N,55035,N,55037,55030,55031,45789,55032,45790,55036,
+55033,55034,45791,N,46526,46527,N,56132,N,N,N,57199,57200,N,58238,47939,47937,
+47938,58235,58236,N,58237,59129,N,59130,48545,59127,59126,59128,59125,49069,
+60132,49067,49068,60902,49515,60901,61352,N,61562,61563,49852,N,49853,49516,
+62142,62143,62641,50339,42705,N,42706,44286,43724,45007,53329,N,N,N,46528,
+42707,44353,53330,53331,44352,44354,42708,N,53332,45009,54118,45011,45008,
+45010,N,55105,45792,N,55104,55038,N,57201,N,N,58273,N,48546,N,49070,60134,
+60133,N,60903,N,N,N,62959,N,N,42709,52083,52650,44355,53333,N,54120,N,N,N,
+45012,54119,45013,N,N,N,55107,N,N,45794,55106,55108,N,45793,N,N,N,N,56134,
+56135,56133,46529,N,N,N,47220,N,47221,N,47941,N,58275,58274,47940,N,N,N,N,N,
+59131,N,N,59132,N,N,N,N,60135,N,N,49520,49519,49517,49518,49521,N,61564,49855,
+49854,62144,62642,N,N,N,50597,50596,42710,N,N,53755,N,47223,46530,47222,47942,
+N,42711,51625,42712,42713,N,N,52651,52086,N,52087,43127,N,52084,43126,N,43129,
+52085,43131,43130,52088,43128,N,N,N,43729,43727,52653,N,43726,N,N,N,43731,
+43733,43730,N,52656,52652,43734,N,43728,43132,N,43732,52655,N,N,52654,N,43725,
+N,N,N,N,N,N,N,53339,44359,44360,53341,N,53335,53338,53347,53345,N,44361,53351,
+44364,53348,53340,53337,N,N,56137,53346,44356,53349,53334,53343,44358,44363,
+53344,44367,44365,N,53336,44362,N,53342,44366,44357,53350,N,N,N,N,N,N,45018,N,
+45027,45016,45014,54122,45022,45019,54124,N,N,45021,54123,54121,54126,45026,
+45024,56136,54127,54125,45015,N,N,45017,45020,N,45023,N,45025,N,N,N,N,N,N,N,N,
+N,N,55118,45796,N,55109,55111,N,55112,N,55120,55116,55114,N,55117,55121,45797,
+45801,55110,N,55119,N,45799,N,45798,55115,55113,N,45795,45800,N,N,N,N,N,N,N,N,
+46536,56145,N,N,56143,46538,N,N,N,N,56138,57249,N,46537,56142,N,N,56139,46533,
+46539,56144,46535,56141,47943,46534,56140,46540,46532,46531,N,N,N,N,N,57207,
+57205,N,57211,N,57203,57250,57208,N,57202,47227,47267,57213,N,57206,N,47230,N,
+N,47228,57214,47225,47224,57209,47229,46541,N,57212,57204,47226,47265,47266,N,
+N,N,N,47948,47944,N,47949,58278,N,N,58277,58279,47946,58276,47947,58282,58281,
+58280,N,47945,N,N,N,N,N,59201,N,59204,48552,59203,48551,48547,48548,48549,
+59200,59134,48550,N,59202,59133,N,N,60137,60147,49073,49072,N,60141,60143,N,
+60138,N,60142,60136,60145,49071,60144,60140,N,60146,N,60139,49524,60904,60910,
+49528,49530,49527,49526,N,49525,49523,60905,60908,49522,60909,N,49529,60907,N,
+60906,49856,N,49857,61601,61565,61566,N,N,62146,N,62145,50110,62644,50340,
+62643,N,62960,63301,50598,63811,63812,50648,42714,N,43735,56146,47950,49531,
+60911,42715,N,45029,45028,56147,N,N,N,60148,42716,44368,N,N,56148,56149,56150,
+47951,49074,42717,N,43736,53352,45030,54128,45802,N,56151,47268,N,47952,49075,
+49532,49858,62645,42718,43737,N,N,45031,55122,46542,N,47953,58283,59205,N,N,N,
+N,42719,46543,57251,47954,42720,52657,53353,44369,N,N,54130,N,N,45034,N,45032,
+45033,45035,N,N,54129,N,N,55127,55124,55126,45803,45805,45804,55123,45806,
+55125,N,56152,56153,N,56154,57254,N,57255,N,57253,57256,N,47269,N,57252,N,
+47955,N,N,59210,59206,59209,59211,59208,59207,N,60149,60150,60151,49076,49077,
+60913,60912,60914,N,61603,61602,N,62148,N,62149,62147,N,50341,N,62646,62647,N,
+63302,63471,63675,42721,43133,N,49533,42722,N,55128,56155,N,50753,51786,N,N,N,
+51787,51789,42723,51790,51788,N,N,52130,52131,52091,N,N,N,N,52129,43169,N,
+43170,52092,52090,52089,52093,43134,52094,53354,N,N,N,52662,43740,52661,52663,
+N,43739,52668,43743,52658,52672,52678,43750,52675,43747,N,52665,52671,52673,N,
+52660,43746,43741,52666,43748,43751,43745,N,43738,52670,52664,52677,43753,
+43749,43744,52669,45036,52667,43742,43752,N,52659,N,52674,52676,N,N,N,N,N,N,N,
+N,N,N,N,N,N,44386,44380,44388,44385,53361,53364,44381,N,53355,N,44374,44384,N,
+44387,44389,53410,53367,N,44373,53409,44377,44375,44370,53359,N,53374,53363,
+53366,53413,N,44390,53373,44382,53368,53412,53365,53369,53372,N,N,53357,53411,
+53371,N,N,53356,53360,44383,44378,44371,44376,44372,44391,53358,54181,44379,N,
+N,53370,52801,N,N,N,N,N,N,N,N,54184,45050,N,54134,N,54179,54141,N,54194,N,
+54186,N,54142,N,54185,54136,54140,54197,45053,54189,54180,45037,54195,54132,N,
+54188,N,45052,45047,54131,45045,45044,45049,54187,45041,45048,53362,56156,
+54182,N,N,54138,45051,54139,54177,45054,54133,54191,N,54190,54198,45043,45040,
+54196,54192,54183,54178,45046,45042,54135,45038,54193,45039,N,54137,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,55134,55136,55141,55161,45820,
+45810,N,55133,45821,45822,55144,55151,55157,N,55138,N,55145,N,N,45888,55159,
+55154,45818,45816,55150,55146,55132,45807,55137,55129,N,45815,45817,55142,
+55139,45812,55155,45809,55140,55162,55148,N,55147,45808,N,45819,N,45811,55130,
+55135,55152,55158,45889,55131,55143,55149,45814,N,N,55160,55153,55156,N,N,N,N,
+N,N,N,N,N,N,N,N,45813,N,56172,56160,46551,56189,56231,56234,46549,56168,56227,
+56169,56183,46562,56179,46559,N,56180,56157,N,56228,N,N,46568,56225,56181,
+56236,56176,57288,N,56239,46566,56174,56186,46569,46548,56178,56237,56171,
+56164,56175,N,56163,56161,46544,56229,56170,56232,N,56233,46552,46557,46553,
+46561,56190,46554,56182,56166,N,46546,56158,56226,56235,56165,46560,56240,
+56177,56173,N,46545,46565,N,56188,46567,N,56184,46556,46550,46558,46547,46564,
+56185,56167,56187,56162,56230,N,N,N,N,N,N,N,56238,N,N,N,N,N,N,N,56159,N,N,N,N,
+N,57287,N,57309,47189,57292,N,57290,57269,47273,57285,57305,57281,47281,57304,
+57279,46563,57295,57280,57302,47280,47272,N,57258,57266,N,57291,57283,57308,
+57286,47286,57303,N,47277,N,57289,57297,57270,57296,N,57313,57265,57298,N,
+57311,N,57259,46555,N,57273,57272,47279,N,57276,57278,57293,57310,47282,N,
+47283,N,57264,47275,57268,57306,47284,N,47276,47278,47285,57312,57299,57294,N,
+N,57275,57274,47274,57260,47271,57284,57261,57282,N,N,57271,57307,N,N,N,47270,
+N,N,N,57267,N,N,N,N,N,N,57263,57301,57262,47968,58323,N,N,58306,N,N,58284,
+58314,47960,58299,58309,47963,58302,47961,58287,58317,58286,58305,N,58285,N,N,
+58303,58312,58310,58298,58293,58291,N,58292,58311,58322,58300,47962,N,58295,N,
+58315,N,47965,58294,58288,58304,47969,N,N,47957,47966,58296,58290,N,47959,
+57300,47958,58307,N,47956,47971,47964,58308,58297,58289,58316,58301,47970,
+58320,47967,58319,N,58313,58318,N,N,N,58321,N,N,N,N,N,N,N,N,N,N,N,59251,59252,
+59239,59238,59234,48564,N,48556,59254,59253,57257,59231,59235,59229,N,59248,
+59233,N,59255,59226,59224,59236,59246,59241,48566,59215,N,59245,N,N,N,48567,
+57277,59227,59218,59221,59259,59228,59219,59217,59214,N,48560,59237,48559,
+48563,59232,59240,48553,59256,59260,48555,N,59223,59243,59247,59220,59257,
+48562,N,48561,59212,48565,59250,59222,59242,59216,59230,59225,48557,48558,
+59244,59261,59258,59249,N,N,N,N,N,N,N,N,N,59213,N,48554,60233,N,60224,60227,N,
+49083,60229,60153,60225,60231,49080,49084,49078,N,N,60155,60236,N,N,60230,N,
+60156,60245,60239,60152,60998,60158,49079,N,60234,N,60244,49087,N,60241,60157,
+60228,60232,60226,60246,60243,60240,49081,49082,49086,60154,60247,49085,60237,
+N,N,60235,N,N,N,60238,61011,60992,60997,61010,60996,60923,60993,N,49570,N,
+60916,61005,61007,60915,49569,61009,61001,49576,61008,60994,49578,60921,60242,
+61002,60999,60917,61013,49572,N,N,49573,60919,61000,N,61012,61003,60925,49575,
+49571,61004,60926,61014,60920,60995,61006,60922,60924,N,49867,60918,49577,
+49860,49534,N,N,N,N,49574,49864,61619,N,61609,61604,61610,61620,61624,61623,
+49866,49865,N,N,61611,61625,61614,61606,N,61608,61607,61613,61618,61605,61612,
+61617,49863,N,61615,N,49861,61616,49859,49862,62165,61621,N,N,50114,N,62157,
+62161,62153,62156,N,62164,50112,62169,62162,N,62154,62170,62163,50115,50116,
+62167,N,62155,50111,50113,62150,62158,62152,N,62168,62166,62151,62159,N,N,N,
+62654,50117,62160,50343,50345,50342,N,62659,62651,62649,62653,62650,N,N,62655,
+62657,50346,50348,N,62656,50349,50347,62658,N,N,N,N,50344,N,N,N,N,N,50420,
+62961,62967,50422,62652,62966,N,62973,62964,62971,62970,62648,62965,61622,
+62974,62963,62968,N,62972,62962,N,63306,50421,62969,N,N,63476,63307,63305,
+63303,63304,63308,N,50649,63474,63472,63477,63475,N,63478,50650,63473,N,N,
+63676,N,N,63813,63814,63815,N,N,63943,63933,51791,43754,N,44392,N,54200,54199,
+45120,45890,55164,N,N,55163,N,46570,47288,N,47287,47289,N,58324,59262,60248,
+60250,60249,N,49579,61015,61626,63909,42724,N,52681,52682,52680,52679,43755,N,
+53417,53415,N,N,53414,N,44393,44395,44394,53416,N,N,N,N,N,N,N,N,54212,54209,
+54207,N,N,45121,54210,45126,54204,54219,N,54221,54205,N,45123,54222,54217,
+54203,54208,54218,54214,54211,N,45128,54220,54206,N,N,54215,54201,45127,45124,
+54213,N,54216,54202,45125,45122,N,N,N,N,45900,55205,45899,N,55208,55211,45896,
+45894,55166,55209,55207,55204,55212,55213,55215,55216,55165,45893,55202,55201,
+55214,45895,55203,45897,45892,55206,45901,N,45898,55210,N,N,N,46577,56255,N,
+56244,46574,N,57319,56253,56241,46572,56246,46575,56250,56248,46578,46571,N,N,
+56242,56245,46576,N,56243,N,56254,56252,56247,56249,56251,46573,N,N,N,N,N,N,N,
+57320,57326,57316,57322,47290,57318,47296,N,N,47295,47294,57325,47297,47298,
+57315,57328,47299,47293,47292,57324,47300,57314,57317,57327,57323,N,N,58356,
+58345,47291,N,N,N,N,47978,58333,58354,58334,47973,N,58331,N,58340,58332,47975,
+58326,58353,47976,58350,58351,58327,47981,58342,N,58336,58343,58330,N,58355,
+58347,58341,58325,47977,58348,N,47980,58352,N,58346,47974,58344,N,58338,47972,
+58329,58337,58349,58335,N,N,58339,N,N,N,N,N,48577,57321,59314,59323,59313,
+59309,59306,48578,59304,47979,59297,48576,59303,48575,59308,59305,59321,59316,
+59310,59315,48571,59307,59326,59298,59299,59322,48572,59327,48574,59328,59312,
+58328,59318,59311,59320,59317,N,N,N,59302,48569,59325,48570,59300,48573,60260,
+59319,59324,N,N,N,N,N,60257,48568,49088,60267,60263,N,60261,60256,60271,N,N,N,
+49092,N,60252,60264,60265,60255,60254,60268,N,60258,60253,60259,N,60270,60251,
+60269,60266,49090,49089,N,N,49091,60262,61643,N,N,N,N,N,61017,49585,61021,
+61018,61025,61031,61020,N,61040,49582,61034,61023,61035,61030,61037,61022,
+49587,49586,61024,61038,61016,61036,49580,N,61028,61027,61032,61019,49584,N,
+49588,61026,61033,49589,61029,N,N,N,N,49581,49583,61639,61637,N,N,61644,61641,
+61645,N,61630,61638,61649,61039,61634,49871,59301,61629,61642,61636,61633,
+61628,61627,61648,N,61632,61631,49869,61640,N,49868,N,N,49870,61635,61647,N,
+62174,62175,N,50121,62172,50118,62180,N,50122,62182,62171,61646,62184,62173,N,
+50119,62179,N,62181,62176,62183,62178,62177,50120,N,N,62661,62662,N,62664,
+50350,50351,62665,62663,N,62660,N,63042,63045,63041,N,50426,63043,50425,50424,
+50423,63044,63313,63311,N,63310,63040,63312,63046,63309,N,63481,63447,63479,
+50651,63480,63482,N,63679,50682,63678,63677,50683,N,50778,63854,63911,63910,
+63912,42725,53418,N,54223,54224,N,N,N,56256,N,63047,63680,42726,44396,53419,N,
+N,N,55217,45902,N,56258,56257,46579,N,47301,59329,48579,N,48580,N,N,N,49093,
+50684,42727,N,N,N,53420,43757,53422,53421,44397,N,54225,N,54232,45129,54230,
+54228,N,54235,54226,54227,45130,N,45134,N,N,54236,45133,54234,54231,54229,
+45131,45132,54233,N,N,N,N,45904,55218,N,45909,55234,45908,55236,N,N,55224,
+45906,55235,N,55219,45907,55231,55227,55229,55223,55230,N,N,45903,55226,N,
+55225,55221,N,55232,N,N,55228,55220,N,55222,45905,55233,N,N,N,N,46582,56269,N,
+N,N,56265,56267,56262,56261,56259,N,56266,56268,56264,N,56263,46580,46581,N,N,
+N,N,N,N,56271,47309,57330,57336,57331,57332,N,57337,N,47311,N,47303,47310,
+57329,56260,47306,47304,57335,57334,47305,47307,57333,47302,N,47308,N,N,N,N,N,
+58358,47988,N,N,58434,58433,N,58363,47990,58432,58359,58360,47982,47984,N,
+58365,58357,47986,47985,58361,58366,58364,47987,58362,56270,47983,N,N,59330,
+59337,48582,N,59341,48586,59333,59331,N,59340,N,48581,59339,48583,48584,59332,
+48585,59338,59334,59335,59336,47989,N,N,N,60272,60284,N,49098,60279,60281,N,
+49096,60273,60277,N,60280,49094,49097,60283,60275,60276,60282,60274,60278,
+49095,61042,N,61041,49591,61047,49593,N,N,49590,61043,49594,61044,N,N,61045,
+61048,N,49592,N,61654,N,N,61657,N,61651,61653,N,N,61652,61655,61656,61046,
+61650,N,N,50125,62188,62191,62193,62186,62187,62190,62192,50126,50124,50123,
+62189,62185,62666,50352,N,62667,N,N,63049,50427,63051,50428,63048,63050,50600,
+N,63314,50599,63485,63484,N,63483,N,N,63816,63817,63819,63818,N,51792,42728,N,
+44398,55237,46583,N,57338,49872,N,62194,N,N,43171,N,N,N,45911,N,N,N,45910,N,
+56272,46584,56274,56273,N,N,57339,47312,58435,58438,58437,N,58436,59342,59344,
+59343,N,49100,N,N,N,49099,N,49595,61049,61051,61050,N,N,49873,N,N,N,62196,
+62195,N,62668,50353,N,N,50429,63316,63315,50779,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,43172,53423,44399,55240,55238,N,N,55239,56276,56277,57411,56275,N,57340,
+57409,57408,57410,47313,57342,57341,57412,N,58441,58439,N,58440,59347,59345,N,
+N,59346,60285,61052,61053,49874,N,62197,62669,50354,N,63052,63317,50601,N,
+63486,63820,43173,N,44401,44402,53424,N,N,53425,44400,N,45140,N,45138,N,45137,
+45144,45136,45145,54237,45142,N,45139,45143,45141,45135,N,N,45919,N,45913,
+55244,45918,N,N,45920,45914,N,45915,N,55242,N,N,45912,N,55243,45917,N,N,55241,
+45916,N,N,46660,N,46662,N,N,56280,46661,46585,46589,N,47332,57417,56282,46590,
+N,N,56285,56286,46659,N,56288,N,56290,N,56291,56279,56278,56292,46658,56289,
+56287,N,46656,46587,46663,56283,56284,56281,N,46657,N,N,46588,N,46586,57416,
+47327,47322,N,N,47317,N,47333,47318,N,47314,47329,47326,47328,N,47319,47324,
+47315,47316,57424,57421,57413,57418,N,47330,57425,47331,47321,N,N,57415,N,
+57423,57419,57422,57420,47325,57414,47320,N,N,N,58444,47992,47995,N,58446,N,
+48037,58445,47997,N,48591,58447,N,48036,58443,48038,N,N,N,47993,N,47323,47996,
+N,47994,47998,48034,47991,48039,48035,N,48033,58442,N,N,N,N,48598,N,48594,N,N,
+N,48601,N,59350,48602,59362,59355,48587,59363,59357,48597,59358,N,48596,59361,
+48590,59359,59349,48589,60330,48595,N,48592,N,48600,N,59348,N,59352,48588,
+59351,59353,59354,48599,59356,59360,59364,N,48603,49106,60325,60331,60328,
+60286,60332,60321,N,60327,N,49101,49107,60333,N,N,49103,N,49113,49108,60335,
+60329,49104,60322,49114,60323,60324,49115,49112,48593,N,49102,60336,49116,N,
+49109,60334,49105,49110,49111,N,49603,61092,61101,61098,61100,N,49600,61093,N,
+61099,49596,61095,49604,61091,61096,61103,60326,61097,61090,49597,61089,49598,
+61104,49599,61102,49602,61054,N,49601,N,61094,61660,61674,61669,61671,61659,
+49875,N,61658,49878,49877,N,61673,61665,61662,61668,N,61661,N,61663,61672,
+61670,N,49876,61677,61675,61666,61676,61667,N,62201,50127,62273,N,N,63055,
+50134,61664,62199,50130,62200,62205,N,N,50132,50133,62198,62272,62274,62202,
+62204,62206,62203,62275,50129,50135,50131,N,50128,62672,N,50359,62670,N,N,
+62674,N,62675,50357,62676,62673,N,62671,50360,50356,62677,N,50358,50355,N,N,N,
+50430,N,N,50496,63054,63053,63056,63057,N,50497,63318,63323,50602,N,63320,N,
+63319,63322,63321,N,63555,N,50652,63554,63552,N,63553,N,N,N,50686,50685,63681,
+63682,50752,N,63821,63822,50791,N,50797,N,63913,63944,43174,N,55245,N,55246,
+57426,58448,59365,49606,N,49605,61678,62276,N,63556,43175,54238,45146,45921,
+57428,57427,48604,59366,48605,61105,49879,N,N,N,50806,43176,52683,54239,N,N,
+45922,N,55247,55248,N,56293,N,46664,47334,N,57430,57429,57431,N,58449,58450,
+48040,49117,48606,49118,N,61109,61106,61108,61107,49607,N,61679,62278,62277,
+52132,45148,45147,54240,N,55249,N,N,56295,56294,46665,N,57433,57434,57432,N,N,
+47336,47335,N,48042,48041,N,59367,60339,60337,60338,49119,61111,61110,N,61682,
+61681,61680,62279,N,63914,43177,44403,N,44404,45149,45150,54242,54241,55250,N,
+45928,45926,45923,45927,45925,45924,N,N,46666,56298,N,47341,46668,46673,56300,
+46675,46674,46677,56299,56296,46671,46667,46669,56297,46676,46672,46670,47343,
+47342,47340,47344,N,47338,47339,N,47337,N,57435,N,N,58452,N,48044,48045,48043,
+N,58451,N,58453,N,59370,59372,N,48615,59373,48608,59369,48607,48617,48613,
+48614,48610,59368,48609,59374,59371,N,48616,N,48611,48612,60341,N,60343,60342,
+N,60344,49120,60340,N,N,49611,61112,49608,49612,49610,49609,61683,61686,N,
+61685,N,61684,49880,62280,62281,50136,62282,50137,N,N,50362,N,50361,63058,N,N,
+50498,63059,63324,50603,50604,N,63557,N,50754,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43178,N,45930,45929,57436,57437,N,48046,
+60345,48618,60346,61113,43179,N,53426,44406,44405,N,54243,45151,54244,55253,N,
+55252,N,55251,N,N,56302,46680,N,N,56301,46679,N,N,N,56303,46678,N,57439,57442,
+57440,57441,57445,57438,57446,57443,57444,48048,58454,N,N,48047,N,59378,59376,
+N,N,48619,59375,59377,N,48620,N,60347,N,60348,49613,N,62284,62286,62283,62285,
+62678,63060,N,N,63855,43180,44407,54245,54247,54246,N,55256,45932,N,55254,N,
+45931,55257,N,55258,55255,N,N,56315,46688,56307,56313,N,N,46683,46686,56306,
+46681,56310,57452,46685,N,56305,N,56311,56308,56314,56304,56312,46684,46687,
+56309,46682,N,47346,57448,47345,57455,57454,47352,N,47353,57456,47347,57453,
+47351,57458,57449,N,57451,47348,57447,57450,57457,47349,57459,N,N,N,N,N,47350,
+N,48049,58459,58465,58457,58466,N,58456,58461,58467,58464,58463,58462,N,58455,
+58460,N,N,58458,N,48625,48622,59387,59457,59459,59456,59384,59386,59461,59458,
+59388,59462,59385,59460,48623,48629,48627,59379,48628,48624,59380,59382,59381,
+59389,59390,N,48626,N,48621,N,N,59383,N,60358,49122,N,60349,49123,49126,60354,
+N,60351,49125,N,N,60355,60356,60350,60359,60352,60357,49124,N,49121,60353,N,
+61119,49616,49614,49617,49615,61118,61115,61114,N,61117,N,N,61116,61765,49886,
+61691,61690,N,49881,61761,61760,61687,61763,61692,49885,61689,61762,61688,
+49882,49884,61693,49883,61694,N,61764,62290,N,50142,62287,N,62291,N,N,50139,
+62289,50144,N,50141,N,62288,N,50143,62292,50138,N,N,N,N,50364,50366,N,62681,
+50365,62679,50140,62680,50363,50499,50501,63062,50500,63061,N,63329,50605,
+63328,50606,63326,63325,63330,63331,63558,N,63327,N,N,63686,63683,63684,63685,
+50780,N,63825,63824,63823,63856,N,63934,63915,50798,43181,45152,N,N,N,N,N,
+47354,N,N,N,N,N,N,N,48630,N,N,60360,N,N,49887,N,62293,N,N,N,N,N,N,63916,43182,
+43758,44409,44408,N,45155,N,54248,45153,54249,45154,N,N,55263,55259,N,N,45933,
+55262,55261,55260,45934,55264,55265,N,N,N,56387,56385,56389,56390,56396,N,
+56392,56394,N,56386,56316,N,56393,N,N,56395,56388,56391,56317,46690,56384,
+56318,46689,46691,N,47357,57461,57463,57462,57467,47355,N,57464,57460,57465,
+57466,47356,47358,57468,N,58471,58470,N,58468,58469,48051,48053,48050,48052,
+59469,59470,59465,N,59466,48632,48637,48631,48638,48633,59467,N,N,59468,59464,
+48704,48635,N,N,48634,48636,N,59463,N,60362,49128,N,N,60364,49130,60367,60363,
+60361,60366,49129,60365,N,49127,N,N,49619,49622,61121,N,49620,61120,49618,
+49621,61766,61767,61768,49888,N,61769,N,49889,50146,62296,62297,62295,62294,
+62298,50145,62685,62683,62684,62686,62682,62687,63064,N,63065,63063,50502,
+63332,50607,63333,63560,63559,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,43183,46692,N,N,
+47424,N,N,N,48054,N,N,49132,N,49131,N,N,N,N,50147,50300,50503,43184,45156,
+47425,N,62299,N,N,N,N,N,N,N,N,N,N,52134,N,N,43185,N,43188,43187,43186,N,N,
+52133,N,52685,N,52687,43759,N,N,43761,52684,52686,43760,52689,52688,52690,N,N,
+N,N,N,N,N,N,53430,53428,44412,53427,44451,44414,44411,N,44452,N,44413,44450,N,
+44449,53429,N,44410,N,N,N,45162,54251,54257,45159,45166,N,45161,54254,54256,
+45164,54250,54253,45160,45157,54252,45163,54255,45165,45158,N,N,N,N,55267,
+55270,45936,N,45946,45942,55268,N,N,45950,45943,45948,45938,N,45935,45937,
+45949,55269,45941,45944,45940,45945,55271,45947,45939,55266,N,N,N,N,N,N,N,N,
+56397,46693,56399,N,46695,46697,N,56398,46694,46698,N,46696,N,N,N,47431,57507,
+47439,57470,N,47440,47429,N,57505,N,N,47434,N,57506,47427,47426,N,47437,47436,
+47435,47433,47438,57469,47428,47430,47432,N,N,48056,48059,N,48063,48057,48062,
+48060,N,48055,N,48061,48058,N,N,N,59474,48707,48705,N,59475,N,48708,48706,
+59473,59472,N,49136,59471,49134,49133,60368,48709,49135,60369,49138,60370,
+49137,49624,61123,49623,49628,49626,49627,49891,49625,61122,60371,49890,49892,
+N,50148,50149,N,62688,N,50654,50653,43190,N,N,51797,45167,N,51794,51795,51793,
+N,51796,N,N,52138,52135,52140,52136,43191,43194,N,52137,43193,52139,N,N,43192,
+N,N,N,N,52693,52695,43764,52691,52694,52692,43762,43765,N,43763,N,N,N,N,53432,
+53436,53433,N,44455,N,44456,N,53435,N,53437,53439,N,44453,53438,N,N,44454,N,N,
+N,N,N,55278,53434,54258,54267,54265,54260,54261,54266,54268,45169,N,54263,
+54259,45168,45170,54262,54269,54264,N,N,45985,55281,55273,55279,55280,45986,N,
+55272,55274,53431,55276,55277,55275,46700,N,N,N,56406,60372,56407,56404,45987,
+46702,56403,56409,56408,46699,56412,56402,56411,56400,56410,56405,46701,N,
+57514,N,57509,57515,57510,57508,57511,47441,N,57513,N,57512,47442,48065,48064,
+58478,58481,58473,58477,48066,58476,58474,58480,58475,58472,58479,N,59481,
+48712,61770,59478,59479,59477,56401,48711,59482,59476,48710,48713,59480,60373,
+49139,60374,60375,N,61124,49629,61771,61772,N,N,61773,62301,62300,62690,N,
+62689,63067,63068,63066,63334,50608,43195,44458,44457,45173,45172,54336,54337,
+54270,N,45171,55285,N,55286,55282,45988,55283,N,55284,N,N,N,N,56415,56417,
+56413,56416,46703,56414,46704,N,N,56691,47445,47444,N,47443,N,57516,57517,N,N,
+58483,58485,48070,48067,N,48069,48068,58484,58482,N,N,N,N,N,59489,59486,59487,
+48717,59488,59483,59484,48714,N,48715,59485,48716,N,60379,N,60380,60377,60378,
+49140,60376,N,N,N,N,N,61128,61125,61127,49632,61131,49631,61129,61132,61130,
+61126,49630,N,61775,N,61776,61774,N,61778,49893,49894,62303,50151,61777,62302,
+50150,62693,62694,50367,62692,N,62691,N,63069,50504,N,63561,63688,63687,N,
+50755,50781,63689,63857,N,50799,43196,43766,N,47446,N,50368,43197,44459,45989,
+46705,49895,43767,N,53441,53440,54338,N,45176,45174,45178,54340,N,45177,45175,
+N,N,N,N,54339,45992,55292,N,45991,45993,55362,45995,55294,55360,55287,45994,
+55363,N,N,55289,N,55290,55288,45990,N,55361,55291,55293,N,N,N,56429,N,56428,
+56426,56418,56433,56421,56431,56438,56430,46713,N,46709,56419,N,56425,46711,N,
+56424,46712,46714,56427,N,46706,46707,56439,56437,N,56436,56422,N,56434,N,
+46710,N,N,N,N,46708,56435,56420,56423,56432,N,N,N,N,N,58554,57527,N,57520,
+57539,57548,57523,47457,N,57536,47447,47449,47461,57521,N,N,47450,47452,47462,
+47451,N,N,N,N,47460,57529,N,57518,47458,57528,47454,57546,47459,57544,57532,
+57542,47456,57519,57545,57540,N,57547,47448,N,N,47463,47453,N,N,57525,N,57533,
+57537,N,57541,47455,57524,57522,57534,N,N,N,N,57531,57530,N,57535,57538,N,
+57543,N,N,N,58488,N,48071,58532,58490,48076,48080,58541,58549,58534,48072,N,
+58538,57526,N,48073,58545,58550,58542,N,58544,58553,58546,58494,58537,N,N,
+48081,N,48077,58492,58539,48075,58533,48074,58547,58530,58489,48078,58552,N,N,
+58491,58543,58540,58535,58487,58486,58529,58548,48079,58551,58493,58531,48722,
+N,N,N,N,N,48730,48725,59556,59553,59495,48720,N,N,N,48719,48726,N,N,N,59493,
+48724,59505,59491,59492,48718,59555,48728,59508,59513,59507,60398,59503,59511,
+59509,59496,59490,59517,48727,59518,N,59512,N,59501,59499,59494,N,N,N,59502,
+59515,59498,59514,59554,N,N,48723,N,59510,59516,59506,59500,48721,N,N,N,58536,
+59504,48729,59497,N,N,N,N,N,60404,49143,60403,60400,60484,49147,N,60481,60408,
+60483,60393,60406,N,49149,N,60385,N,60383,60482,N,60480,60414,60397,60396,
+60386,49216,N,60392,60402,60413,49219,60485,N,49640,49221,49150,60390,N,60399,
+60382,60384,49141,49218,49146,60391,60407,60401,49217,60381,49635,60409,60412,
+49148,N,60395,49220,49145,N,N,N,49144,60405,60411,49142,N,60388,60410,N,N,
+60389,N,N,N,N,N,N,N,N,N,60394,61138,N,61143,49637,49639,61149,49633,61164,
+61155,61144,61145,61154,N,49646,61153,61137,61152,61140,61165,49645,49643,
+61141,N,61160,N,61146,61159,N,61161,61136,49638,N,61162,N,N,61150,N,49642,
+61147,N,N,49644,61156,N,N,N,49636,61142,61157,N,61151,60387,61158,61139,N,
+49641,N,61163,N,49634,61134,N,N,N,N,61792,61785,49897,N,61780,61795,61787,
+61148,N,61797,61781,N,49896,61791,49898,49906,49904,61793,49905,61783,N,61784,
+61789,61794,N,61133,49899,61802,61799,61803,61790,61786,61800,62314,61788,N,
+49902,N,49901,61135,49903,61796,61798,49900,61801,61779,N,61782,N,N,N,N,N,N,N,
+N,62323,N,62307,50155,62321,N,N,62305,50156,N,62316,N,62312,50161,62322,62306,
+62309,50153,62324,N,62317,62320,50159,50164,50162,62313,62308,N,50157,50158,
+62304,50154,N,50152,50160,62319,50163,N,62315,62325,50165,N,N,N,62311,N,62318,
+N,N,N,N,N,N,62707,62786,62709,62716,62310,62714,62697,62784,50371,62701,62718,
+62708,N,N,50370,N,N,62788,62710,N,62715,62717,62695,62785,62706,62711,62699,
+62703,62787,62713,62696,62700,62702,62712,N,50369,62705,N,N,N,N,N,N,62698,N,N,
+N,N,N,N,N,62704,63073,63078,50511,63080,N,50505,N,63076,63082,50510,50506,N,
+50507,63072,63079,50509,63077,50508,63071,63075,63074,N,63070,63081,N,N,N,
+50609,63341,63344,63340,63342,63343,63337,63338,63335,N,N,63339,63336,50610,
+50611,N,N,63563,N,63565,N,N,N,N,N,63564,63566,N,50656,N,63562,50655,50657,N,N,
+N,63691,63692,50756,63690,N,63827,63826,63828,50783,63829,50782,63830,63858,
+63861,63860,50792,63859,N,N,N,50802,50800,50801,50807,63936,63937,63935,63945,
+43768,N,N,55364,56440,59557,62326,N,N,43769,N,44460,45179,N,N,55365,N,55366,
+45996,N,46717,56442,56441,46755,46716,56443,46718,46754,46753,46715,N,N,N,
+47464,N,N,57552,57550,N,57551,57549,N,48082,N,48085,48087,48086,N,N,48083,
+48084,N,59559,59558,48731,59560,N,59561,48732,N,N,N,60493,60491,61171,N,60489,
+60490,49222,60486,60494,60488,60492,61167,N,N,61169,N,61170,49651,61166,49650,
+61168,49647,49648,49649,60487,N,N,49909,61806,61804,61805,49907,49910,49908,N,
+N,N,62327,62328,50166,N,62789,62791,62790,50372,50512,63085,63084,63083,43770,
+N,51626,N,51800,42729,51798,51801,51799,N,N,N,52142,N,43201,N,43202,52144,
+43199,52143,52141,43200,43198,N,N,N,N,N,N,52696,52699,43773,52698,52697,N,
+43772,43771,N,43840,52700,43774,N,N,N,N,N,53446,44462,44463,44464,53447,53443,
+44461,53444,N,53445,53442,N,N,N,45220,N,N,45217,54341,45218,45221,54342,N,
+45182,45180,45181,45219,N,N,N,N,N,45997,55369,46005,55368,N,55371,46001,55370,
+46763,45999,46002,45998,46003,46004,46000,N,N,N,55367,46759,56445,N,56483,N,N,
+56482,46764,46760,46761,56444,56446,56481,46756,46758,N,46762,46757,N,N,57555,
+57553,57554,47466,47467,N,57556,47465,48088,N,48090,48089,N,58555,N,N,58556,
+59563,N,59562,N,N,49223,49224,60495,49225,N,61174,N,61172,N,61173,49652,N,
+61807,50167,N,N,N,49653,43841,N,45222,54343,N,N,55372,46006,46765,56484,56486,
+46767,46766,46768,46769,56485,47470,47471,47469,48091,47468,57557,N,N,N,48092,
+59564,60496,49226,49654,61808,61812,49913,61809,49914,49912,61813,49915,61811,
+N,62329,49911,50168,N,63693,N,N,43842,46008,46007,N,N,N,N,46770,56488,56487,
+46771,N,N,57561,47475,47472,57560,47474,57558,47473,N,57559,N,58557,48093,N,
+59567,N,48733,59565,48734,48735,59566,48736,N,60497,N,49230,49227,49232,60499,
+49228,60498,49231,N,N,49229,N,61177,61179,N,N,49655,61178,49656,61176,61175,N,
+61815,61814,49916,61816,62334,50170,62333,62330,50169,62331,62332,N,62792,
+62793,50373,N,50515,N,N,63086,N,N,50513,50514,63087,N,N,50612,50613,63345,N,N,
+50757,63695,50759,N,63694,63696,50758,63831,N,63917,N,N,N,N,N,N,43843,N,N,N,
+47476,N,58558,N,59568,49233,49234,N,43844,N,48737,50171,44465,N,N,N,49235,N,
+50658,44466,55373,N,56489,N,56491,N,56490,N,57565,57562,47477,N,47478,57563,
+57564,N,58560,58565,48094,58559,58561,58568,58563,58567,58564,58562,58566,
+48095,N,N,59571,N,59569,48739,N,48738,59570,48740,N,N,N,N,60502,N,N,60501,
+49236,60500,61180,N,61182,61249,61248,N,49657,61181,61857,49917,61821,61858,
+49918,N,61819,N,61822,61820,61817,49984,61818,N,N,N,N,62369,N,N,62371,62370,N,
+62794,N,62795,N,N,N,63088,N,50615,N,50614,63567,63568,50760,63697,N,50793,N,
+44467,46772,58570,58569,59573,59572,N,N,49658,61251,61250,61861,61859,61862,
+61860,N,N,50172,62372,62373,62374,N,63089,N,63346,N,63698,N,N,N,N,N,N,N,44468,
+N,N,60503,61252,N,44469,N,N,48096,N,60504,49985,61863,50173,N,62796,62797,
+50516,63569,44470,46011,46012,55374,46773,46774,56492,46775,N,47482,N,47484,
+57567,57568,57566,47479,47480,47483,47481,N,N,58571,48097,48098,N,N,59580,
+48743,59575,59574,N,59579,48741,N,N,49243,N,59576,59581,59578,59577,N,48742,N,
+49241,N,60506,49237,N,60507,N,N,60505,N,49240,49238,49242,N,49239,N,N,N,N,N,
+61253,N,61258,61254,61257,49659,N,60884,61256,61255,N,49988,49986,49989,49987,
+61864,61865,61866,49990,N,N,N,62378,50240,62376,N,50241,62375,62377,50174,
+62801,62798,N,62799,62800,63090,50518,N,50517,N,63348,63347,50616,N,N,N,50659,
+50761,50784,63832,63918,63919,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44471,56493,N,N,57569,
+58572,58573,48099,N,48100,59582,48744,N,N,49660,N,61867,N,49991,62381,50242,
+62380,62382,62379,63093,62802,62803,N,50374,N,63092,N,N,63091,N,63349,63920,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,44472,N,N,N,44473,N,N,45223,54344,N,55375,N,46776,N,
+46779,46777,56494,N,46781,N,46778,N,N,46780,N,47486,N,57570,N,N,57571,59584,N,
+47485,47521,47522,58575,N,58574,48101,N,48102,N,58576,59583,48104,48745,N,
+48103,N,N,N,49244,59585,48747,48746,59586,59589,59587,59588,48748,N,49249,
+49247,N,N,49246,60509,N,49248,N,N,60508,61259,N,60510,49245,60511,61262,61260,
+61261,61266,49995,61265,61268,61267,61264,61263,N,49661,N,N,N,N,61870,N,61869,
+49994,49992,49993,N,61868,N,62385,N,50243,N,62384,62383,50244,N,62808,62807,N,
+62805,N,62804,50376,50375,62809,63350,50617,63095,50519,63094,62806,N,63351,
+50660,N,50785,63833,N,63921,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,44474,55376,61269,44475,
+N,N,58578,58577,60512,N,N,61271,N,61270,N,49996,62386,62387,50377,N,N,63922,
+45224,46783,46782,57572,57574,47524,57573,47523,47525,57575,N,N,N,58580,58582,
+58581,N,58584,N,N,N,48105,58583,58579,N,N,N,58585,N,59596,N,59599,59601,59591,
+59595,59592,48750,48753,48755,59593,59594,48754,59597,59600,59598,48756,N,
+48752,59590,48749,N,48751,N,N,49251,60518,60516,60515,N,60521,N,60520,60519,N,
+60514,49250,60513,N,60517,49252,N,N,61274,N,61278,61275,61277,61276,61273,
+61279,61282,61280,61281,49728,49662,61272,61283,61875,61878,61880,61879,N,
+61873,61877,61872,N,61874,49997,61871,N,61876,N,N,62400,62389,50245,N,N,50246,
+62388,62393,62399,62391,62398,N,62395,N,62394,62397,62392,62390,N,62396,N,
+62816,62814,50378,62813,62819,62817,N,50379,62812,62810,N,62811,50381,62815,
+50380,62818,63096,63102,N,N,63097,50523,63137,50522,63101,63100,50521,63099,
+50520,63098,N,63357,63393,63358,N,63355,50619,63352,63356,63395,N,63394,63353,
+63354,50618,63570,50663,N,63571,50661,50662,N,N,63699,50762,63862,N,50794,N,
+63923,50795,63924,63925,63939,63938,50810,63949,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,45225,N,N,57577,N,57576,N,48106,48107,58586,N,59602,60524,N,N,
+48757,49253,60522,N,60525,49254,N,61284,60523,61881,49998,62401,N,N,N,62822,
+62820,N,N,62821,N,N,63138,N,50524,63396,50666,50620,50664,50665,63700,50786,N,
+45226,N,N,N,61882,N,N,54345,N,47526,N,58587,N,N,48108,58588,N,N,N,59604,59603,
+49256,48758,48759,N,59607,59606,59605,N,N,60526,60529,N,60528,60527,49255,
+61288,61286,61285,61287,N,49999,61884,61885,50000,N,61883,N,62403,62402,62405,
+50247,62404,N,62823,62825,62824,N,N,63139,63142,63140,63141,63397,50621,N,N,N,
+63572,63573,63574,N,50763,50787,63926,45227,N,48760,49257,61886,N,63398,N,N,
+63940,54346,N,50811,45228,60530,N,61887,N,62406,N,N,63143,63399,45229,N,58589,
+58590,N,48109,48110,59609,48762,48761,59608,N,61289,N,61888,61890,61889,50003,
+50002,50001,N,50526,63144,N,50525,63401,63400,N,50764,63701,46013,57578,N,N,N,
+58593,58591,58592,N,N,59618,N,59613,59610,59617,N,N,N,59619,N,N,48764,59616,
+59612,N,N,59611,59615,59614,48763,N,N,60541,60536,60534,60577,60535,N,60531,N,
+60537,N,N,60532,61298,60533,60578,N,N,N,N,N,N,N,60540,49258,60539,60538,N,
+60542,N,N,N,N,61290,61293,N,N,61292,N,61300,61295,61299,N,61297,61296,61294,N,
+61291,N,49731,49730,N,49732,49729,61301,N,N,N,N,N,61896,61899,N,61897,61901,N,
+N,N,61902,N,61894,50008,61895,N,61893,61900,N,61892,61891,50007,50005,50004,N,
+N,N,N,N,N,N,N,61898,62415,62421,50250,62416,N,62419,62423,50251,62418,N,62410,
+N,62409,62422,62413,N,62411,62420,62412,50249,50248,N,62407,62408,62417,N,N,N,
+62414,N,N,N,N,N,N,62828,62831,N,N,N,N,50006,62829,62835,62833,62827,62838,N,
+62826,N,50383,62834,N,N,N,62830,50382,62837,N,N,62836,N,N,N,N,63147,63146,N,N,
+N,63153,N,63149,63152,50528,N,N,63150,63151,N,63145,63148,50527,N,N,N,50623,
+63412,63407,63411,N,63414,63410,N,63406,N,50625,63409,63413,50624,63404,62832,
+63408,N,N,63405,N,63402,N,63403,50622,63578,63580,63583,63579,63584,N,63577,N,
+63575,N,50667,63581,50669,50668,63576,63582,N,N,N,N,63706,50765,63707,N,63705,
+63702,N,N,63704,63703,63834,N,N,N,N,63836,63835,N,N,63865,N,63864,63863,63866,
+N,50803,50804,63946,63950,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,46014,56495,57581,N,47527,57579,N,N,57580,N,N,N,58594,58595,48113,48111,
+58596,48112,59624,N,59627,59621,59628,59620,59622,N,59623,59626,N,N,48801,
+59631,59630,48765,59625,59629,48766,N,N,N,N,N,N,60588,N,49263,N,60583,49259,N,
+60580,60586,60589,N,49264,N,60585,60582,60590,60581,N,60587,49260,N,60579,
+49261,N,49262,60584,N,N,N,61353,61306,61307,61310,61308,N,61302,N,N,61305,
+61349,61309,N,N,49733,N,61351,61348,49734,61350,61303,61346,61347,N,61345,N,N,
+N,N,61906,61908,61911,N,N,61905,N,50009,61913,61904,61914,N,61910,61912,61916,
+61909,61917,61907,61903,50010,N,61915,50011,50253,N,N,N,N,N,61304,62449,62440,
+50255,62436,50256,N,N,62445,62439,62429,50254,62442,62437,62438,N,62424,62431,
+62446,N,62443,N,62435,N,62447,62430,62425,62444,N,62427,62441,62432,62448,
+62428,50252,62426,62433,62434,N,N,N,62845,N,62843,N,62882,N,62894,62885,62844,
+62840,62887,62846,62883,62842,62890,62839,62881,62886,62888,62891,62841,N,
+62895,62896,62889,62893,62884,N,63169,63172,N,50529,N,63171,63176,63174,50530,
+63165,63155,63154,50532,63167,63168,63164,63156,N,63161,62892,N,63157,50531,
+63163,N,63162,N,63158,63170,N,63159,63419,63173,63175,63166,63160,63420,63422,
+63416,50626,N,63429,63427,50627,63426,63425,63418,63415,63421,63430,63417,
+63423,N,63593,63598,63588,63591,50670,63595,N,63602,63424,N,63589,63599,63603,
+63594,63587,63597,N,63596,63601,63600,63428,63592,63586,63590,50766,50767,
+63585,N,63718,63709,63717,63714,63715,63708,63711,63719,63713,63712,63710,N,
+63716,N,63837,N,63838,N,63840,63839,63842,63841,63868,63867,63927,N,63928,N,
+63941,50808,50812,N,63951,50813,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,46015,N,N,N,50384,63177,N,
+50768,50769,N,46016,57582,N,47528,59632,N,N,60592,60593,60591,61355,61354,
+49735,61919,61356,61918,N,N,62451,50257,50259,62450,N,N,50258,N,62897,62899,
+62898,63178,50533,N,50671,63720,63843,N,N,63954,46017,N,58597,N,48802,N,N,N,
+60595,60594,N,61357,N,N,N,50260,50385,63431,63947,N,N,N,46018,48114,N,48803,N,
+62452,N,63604,46784,N,N,N,N,61358,N,N,N,50788,46785,48804,49736,63605,46786,N,
+59633,49266,60596,60597,N,49265,N,61359,49740,49738,49739,49737,61920,50012,N,
+N,N,62901,62900,62903,62902,50386,N,N,63179,N,63181,63180,50534,63432,N,63606,
+63607,50672,63844,63869,50805,N,56496,60598,61360,62453,57583,N,61361,61922,
+61921,N,N,N,N,63608,50770,N,63845,63870,N,N,N,47529,59634,59635,N,60599,47530,
+N,50013,61923,N,63183,50535,63184,63182,63609,N,63721,N,47531,N,61364,61363,
+61362,61924,N,N,61928,61927,61926,61925,50014,62454,62905,50387,62904,63185,
+63435,63434,50628,63433,63612,63611,63610,N,N,48115,N,60600,49741,N,62455,
+62456,63436,63613,N,N,63722,63846,63929,63956,48116,49742,61929,62457,63186,
+63614,N,N,48806,N,61365,61930,62458,62459,62460,62910,N,62906,50536,62909,
+62908,50388,62907,50390,N,50389,63188,63187,50537,50538,N,N,50630,63437,50629,
+N,63651,63652,63650,63649,50772,N,63723,63724,63725,50771,63847,63850,63849,
+63848,N,N,63955,N,N,N,N,N,N,N,N,N,N,N,N,N,N,49267,N,N,50021,62911,63189,N,
+50631,63438,N,N,63957,N,N,N,49268,N,N,N,61366,N,63439,N,63905,51530,56828,
+41290,41303,N,41305,41307,41311,41312,41315,41316,41319,41320,41323,41324,
+41327,41328,41331,41332,41335,41336,41339,41340,N,N,N,N,41414,41415,41418,
+41419,41416,41417,41308,41293,N,41295,N,41297,41298,41299,41300,N,41341,41342,
+41377,41378,41379,41380,41420,41421,41422,41438,41439,41440,41441,41442,N,N,
+41548,41549,41550,41289,N,41389,41539,41544,41390,N,41309,41310,41391,41423,
+41281,41424,41284,41537,41647,41648,41649,41650,41651,41652,41653,41654,41655,
+41656,41287,41286,41429,41431,41430,41288,41545,41679,41680,41681,41682,41683,
+41684,41685,41686,41687,41688,41689,41690,41691,41692,41693,41694,41695,41696,
+41697,41698,41699,41700,41701,41702,41703,41704,N,41538,N,N,41412,N,41705,
+41706,41707,41708,41709,41710,41711,41712,41713,41714,41715,41716,41717,41718,
+41719,41720,41721,41722,41723,41724,41725,41726,41792,41793,41794,41795,41313,
+41301,41314,N,N,N,N,N,N,41294,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41411,
+};
+
+static const struct unim_index big5_encmap[256] = {
+{__big5_encmap+0,162,247},{0,0,0},{__big5_encmap+86,199,217},{__big5_encmap+
+105,145,201},{__big5_encmap+162,1,81},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{__big5_encmap+243,19,62},{__big5_encmap+287,3,153},{
+__big5_encmap+438,26,191},{0,0,0},{__big5_encmap+604,96,125},{__big5_encmap+
+634,0,229},{__big5_encmap+864,5,66},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{__big5_encmap+926,0,254},{__big5_encmap+1181,
+5,41},{__big5_encmap+1218,163,163},{__big5_encmap+1219,142,213},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__big5_encmap+1291,0,255},{
+__big5_encmap+1547,0,254},{__big5_encmap+1802,0,255},{__big5_encmap+2058,0,253
+},{__big5_encmap+2312,0,255},{__big5_encmap+2568,5,252},{__big5_encmap+2816,1,
+255},{__big5_encmap+3071,1,255},{__big5_encmap+3326,0,255},{__big5_encmap+3582
+,1,253},{__big5_encmap+3835,0,255},{__big5_encmap+4091,3,255},{__big5_encmap+
+4344,0,255},{__big5_encmap+4600,1,250},{__big5_encmap+4850,1,255},{
+__big5_encmap+5105,0,255},{__big5_encmap+5361,2,255},{__big5_encmap+5615,1,255
+},{__big5_encmap+5870,0,255},{__big5_encmap+6126,0,255},{__big5_encmap+6382,0,
+255},{__big5_encmap+6638,0,249},{__big5_encmap+6888,6,255},{__big5_encmap+7138
+,0,253},{__big5_encmap+7392,0,255},{__big5_encmap+7648,0,255},{__big5_encmap+
+7904,18,253},{__big5_encmap+8140,4,255},{__big5_encmap+8392,0,252},{
+__big5_encmap+8645,0,255},{__big5_encmap+8901,0,249},{__big5_encmap+9151,0,253
+},{__big5_encmap+9405,0,255},{__big5_encmap+9661,0,255},{__big5_encmap+9917,0,
+255},{__big5_encmap+10173,0,255},{__big5_encmap+10429,1,255},{__big5_encmap+
+10684,0,255},{__big5_encmap+10940,0,255},{__big5_encmap+11196,0,255},{
+__big5_encmap+11452,0,254},{__big5_encmap+11707,1,253},{__big5_encmap+11960,2,
+255},{__big5_encmap+12214,1,251},{__big5_encmap+12465,0,255},{__big5_encmap+
+12721,0,255},{__big5_encmap+12977,0,254},{__big5_encmap+13232,0,251},{
+__big5_encmap+13484,3,156},{__big5_encmap+13638,54,255},{__big5_encmap+13840,
+0,254},{__big5_encmap+14095,0,255},{__big5_encmap+14351,0,254},{__big5_encmap+
+14606,0,255},{__big5_encmap+14862,1,255},{__big5_encmap+15117,0,255},{
+__big5_encmap+15373,0,254},{__big5_encmap+15628,0,255},{__big5_encmap+15884,0,
+254},{__big5_encmap+16139,1,255},{__big5_encmap+16394,0,255},{__big5_encmap+
+16650,0,159},{__big5_encmap+16810,55,254},{__big5_encmap+17010,0,255},{
+__big5_encmap+17266,0,255},{__big5_encmap+17522,0,255},{__big5_encmap+17778,0,
+255},{__big5_encmap+18034,0,255},{__big5_encmap+18290,0,255},{__big5_encmap+
+18546,0,255},{__big5_encmap+18802,0,131},{__big5_encmap+18934,119,229},{
+__big5_encmap+19045,28,255},{__big5_encmap+19273,0,255},{__big5_encmap+19529,
+0,254},{__big5_encmap+19784,0,255},{__big5_encmap+20040,1,254},{__big5_encmap+
+20294,1,253},{__big5_encmap+20547,5,255},{__big5_encmap+20798,0,255},{
+__big5_encmap+21054,0,255},{__big5_encmap+21310,0,164},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{__big5_encmap+21475,12,13},{0,0,0},{0,0,0},{0,0,0},{__big5_encmap+21477,48,
+107},{__big5_encmap+21537,1,227},
+};
+
+static const ucs2_t __cp950ext_decmap[224] = {
+8231,U,U,U,U,U,U,U,U,65105,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,U,U,U,U,U,175,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,
+U,U,U,U,U,U,U,65374,U,U,U,U,U,U,U,U,U,U,U,U,U,U,8853,8857,8725,65128,U,65509,
+U,65504,65505,8364,30849,37561,35023,22715,24658,31911,23290,9556,9574,9559,
+9568,9580,9571,9562,9577,9565,9554,9572,9557,9566,9578,9569,9560,9575,9563,
+9555,9573,9558,9567,9579,9570,9561,9576,9564,9553,9552,9581,9582,9584,9583,
+9619,
+};
+
+static const struct dbcs_index cp950ext_decmap[256] = {
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_decmap+0,69,243
+},{__cp950ext_decmap+175,65,71},{__cp950ext_decmap+182,225,225},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_decmap+183,214,254
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+};
+
+static const DBCHAR __cp950ext_encmap[581] = {
+41410,41285,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41953,41537,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+41458,N,N,N,41459,63992,63974,63983,63965,63976,63985,63967,63980,63989,63971,
+63982,63991,63973,N,63986,63968,N,63988,63970,63975,63984,63966,63981,63990,
+63972,N,63987,63969,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,63998,63961,63964,63962,63958,63963,63960,63959,41294,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41538,41470,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41536,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,41443,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,
+N,N,N,41542,41543,N,N,N,41540,
+};
+
+static const struct unim_index cp950ext_encmap[256] = {
+{__cp950ext_encmap+0,175,175},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},
+{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_encmap+1,39,172},{0,
+0,0},{__cp950ext_encmap+135,21,153},{0,0,0},{0,0,0},{__cp950ext_encmap+268,81,
+147},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{__cp950ext_encmap+335,187,187},{0,0,0},{__cp950ext_encmap+
+336,250,250},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_encmap+337,
+82,82},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_encmap+338,129,129},{0,0,0},{
+0,0,0},{0,0,0},{__cp950ext_encmap+339,167,167},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_encmap+
+340,207,207},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{__cp950ext_encmap+341,185,185},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{
+0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
+},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,
+0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp950ext_encmap+342,81,104},{
+__cp950ext_encmap+366,15,229},
+};
+
diff --git a/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c
new file mode 100644
index 00000000000..b501e4fb923
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.c
@@ -0,0 +1,2084 @@
+/*
+ * multibytecodec.c: Common Multibyte Codec Implementation
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+#include "multibytecodec.h"
+#include "clinic/multibytecodec.c.h"
+
+#define MODULE_NAME "_multibytecodec"
+
+typedef struct {
+ PyTypeObject *encoder_type;
+ PyTypeObject *decoder_type;
+ PyTypeObject *reader_type;
+ PyTypeObject *writer_type;
+ PyTypeObject *multibytecodec_type;
+ PyObject *str_write;
+} module_state;
+
+static module_state *
+get_module_state(PyObject *module)
+{
+ module_state *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return state;
+}
+
+static struct PyModuleDef _multibytecodecmodule;
+
+static module_state *
+find_state_by_def(PyTypeObject *type)
+{
+ PyObject *module = PyType_GetModuleByDef(type, &_multibytecodecmodule);
+ assert(module != NULL);
+ return get_module_state(module);
+}
+
+#define clinic_get_state() find_state_by_def(type)
+/*[clinic input]
+module _multibytecodec
+class _multibytecodec.MultibyteCodec "MultibyteCodecObject *" "clinic_get_state()->multibytecodec_type"
+class _multibytecodec.MultibyteIncrementalEncoder "MultibyteIncrementalEncoderObject *" "clinic_get_state()->encoder_type"
+class _multibytecodec.MultibyteIncrementalDecoder "MultibyteIncrementalDecoderObject *" "clinic_get_state()->decoder_type"
+class _multibytecodec.MultibyteStreamReader "MultibyteStreamReaderObject *" "clinic_get_state()->reader_type"
+class _multibytecodec.MultibyteStreamWriter "MultibyteStreamWriterObject *" "clinic_get_state()->writer_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=305a76dfdd24b99c]*/
+#undef clinic_get_state
+
+typedef struct {
+ PyObject *inobj;
+ Py_ssize_t inpos, inlen;
+ unsigned char *outbuf, *outbuf_end;
+ PyObject *excobj, *outobj;
+} MultibyteEncodeBuffer;
+
+typedef struct {
+ const unsigned char *inbuf, *inbuf_top, *inbuf_end;
+ PyObject *excobj;
+ _PyUnicodeWriter writer;
+} MultibyteDecodeBuffer;
+
+static char *incnewkwarglist[] = {"errors", NULL};
+static char *streamkwarglist[] = {"stream", "errors", NULL};
+
+static PyObject *multibytecodec_encode(const MultibyteCodec *,
+ MultibyteCodec_State *, PyObject *, Py_ssize_t *,
+ PyObject *, int);
+
+#define MBENC_RESET MBENC_MAX<<1 /* reset after an encoding session */
+
+static PyObject *
+make_tuple(PyObject *object, Py_ssize_t len)
+{
+ PyObject *v, *w;
+
+ if (object == NULL)
+ return NULL;
+
+ v = PyTuple_New(2);
+ if (v == NULL) {
+ Py_DECREF(object);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(v, 0, object);
+
+ w = PyLong_FromSsize_t(len);
+ if (w == NULL) {
+ Py_DECREF(v);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(v, 1, w);
+
+ return v;
+}
+
+static PyObject *
+internal_error_callback(const char *errors)
+{
+ if (errors == NULL || strcmp(errors, "strict") == 0)
+ return ERROR_STRICT;
+ else if (strcmp(errors, "ignore") == 0)
+ return ERROR_IGNORE;
+ else if (strcmp(errors, "replace") == 0)
+ return ERROR_REPLACE;
+ else
+ return PyUnicode_FromString(errors);
+}
+
+static PyObject *
+call_error_callback(PyObject *errors, PyObject *exc)
+{
+ PyObject *cb, *r;
+ const char *str;
+
+ assert(PyUnicode_Check(errors));
+ str = PyUnicode_AsUTF8(errors);
+ if (str == NULL)
+ return NULL;
+ cb = PyCodec_LookupError(str);
+ if (cb == NULL)
+ return NULL;
+
+ r = PyObject_CallOneArg(cb, exc);
+ Py_DECREF(cb);
+ return r;
+}
+
+static PyObject *
+codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored))
+{
+ const char *errors;
+
+ if (self->errors == ERROR_STRICT)
+ errors = "strict";
+ else if (self->errors == ERROR_IGNORE)
+ errors = "ignore";
+ else if (self->errors == ERROR_REPLACE)
+ errors = "replace";
+ else {
+ return Py_NewRef(self->errors);
+ }
+
+ return PyUnicode_FromString(errors);
+}
+
+static int
+codecctx_errors_set(MultibyteStatefulCodecContext *self, PyObject *value,
+ void *closure)
+{
+ PyObject *cb;
+ const char *str;
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
+ if (!PyUnicode_Check(value)) {
+ PyErr_SetString(PyExc_TypeError, "errors must be a string");
+ return -1;
+ }
+
+ str = PyUnicode_AsUTF8(value);
+ if (str == NULL)
+ return -1;
+
+ cb = internal_error_callback(str);
+ if (cb == NULL)
+ return -1;
+
+ ERROR_DECREF(self->errors);
+ self->errors = cb;
+ return 0;
+}
+
+/* This getset handlers list is used by all the stateful codec objects */
+static PyGetSetDef codecctx_getsets[] = {
+ {"errors", (getter)codecctx_errors_get,
+ (setter)codecctx_errors_set,
+ PyDoc_STR("how to treat errors")},
+ {NULL,}
+};
+
+static int
+expand_encodebuffer(MultibyteEncodeBuffer *buf, Py_ssize_t esize)
+{
+ Py_ssize_t orgpos, orgsize, incsize;
+
+ orgpos = (Py_ssize_t)((char *)buf->outbuf -
+ PyBytes_AS_STRING(buf->outobj));
+ orgsize = PyBytes_GET_SIZE(buf->outobj);
+ incsize = (esize < (orgsize >> 1) ? (orgsize >> 1) | 1 : esize);
+
+ if (orgsize > PY_SSIZE_T_MAX - incsize) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ if (_PyBytes_Resize(&buf->outobj, orgsize + incsize) == -1)
+ return -1;
+
+ buf->outbuf = (unsigned char *)PyBytes_AS_STRING(buf->outobj) +orgpos;
+ buf->outbuf_end = (unsigned char *)PyBytes_AS_STRING(buf->outobj)
+ + PyBytes_GET_SIZE(buf->outobj);
+
+ return 0;
+}
+#define REQUIRE_ENCODEBUFFER(buf, s) do { \
+ if ((s) < 0 || (s) > (buf)->outbuf_end - (buf)->outbuf) \
+ if (expand_encodebuffer(buf, s) == -1) \
+ goto errorexit; \
+} while(0)
+
+
+/**
+ * MultibyteCodec object
+ */
+
+static int
+multibytecodec_encerror(const MultibyteCodec *codec,
+ MultibyteCodec_State *state,
+ MultibyteEncodeBuffer *buf,
+ PyObject *errors, Py_ssize_t e)
+{
+ PyObject *retobj = NULL, *retstr = NULL, *tobj;
+ Py_ssize_t retstrsize, newpos;
+ Py_ssize_t esize, start, end;
+ const char *reason;
+
+ if (e > 0) {
+ reason = "illegal multibyte sequence";
+ esize = e;
+ }
+ else {
+ switch (e) {
+ case MBERR_TOOSMALL:
+ REQUIRE_ENCODEBUFFER(buf, -1);
+ return 0; /* retry it */
+ case MBERR_TOOFEW:
+ reason = "incomplete multibyte sequence";
+ esize = (Py_ssize_t)buf->inpos;
+ break;
+ case MBERR_INTERNAL:
+ PyErr_SetString(PyExc_RuntimeError,
+ "internal codec error");
+ return -1;
+ default:
+ PyErr_SetString(PyExc_RuntimeError,
+ "unknown runtime error");
+ return -1;
+ }
+ }
+
+ if (errors == ERROR_REPLACE) {
+ PyObject *replchar;
+ Py_ssize_t r;
+ Py_ssize_t inpos;
+ int kind;
+ const void *data;
+
+ replchar = PyUnicode_FromOrdinal('?');
+ if (replchar == NULL)
+ goto errorexit;
+ kind = PyUnicode_KIND(replchar);
+ data = PyUnicode_DATA(replchar);
+
+ inpos = 0;
+ for (;;) {
+ Py_ssize_t outleft = (Py_ssize_t)(buf->outbuf_end - buf->outbuf);
+
+ r = codec->encode(state, codec,
+ kind, data, &inpos, 1,
+ &buf->outbuf, outleft, 0);
+ if (r == MBERR_TOOSMALL) {
+ REQUIRE_ENCODEBUFFER(buf, -1);
+ continue;
+ }
+ else
+ break;
+ }
+
+ Py_DECREF(replchar);
+
+ if (r != 0) {
+ REQUIRE_ENCODEBUFFER(buf, 1);
+ *buf->outbuf++ = '?';
+ }
+ }
+ if (errors == ERROR_IGNORE || errors == ERROR_REPLACE) {
+ buf->inpos += esize;
+ return 0;
+ }
+
+ start = (Py_ssize_t)buf->inpos;
+ end = start + esize;
+
+ /* use cached exception object if available */
+ if (buf->excobj == NULL) {
+ buf->excobj = PyObject_CallFunction(PyExc_UnicodeEncodeError,
+ "sOnns",
+ codec->encoding, buf->inobj,
+ start, end, reason);
+ if (buf->excobj == NULL)
+ goto errorexit;
+ }
+ else
+ if (PyUnicodeEncodeError_SetStart(buf->excobj, start) != 0 ||
+ PyUnicodeEncodeError_SetEnd(buf->excobj, end) != 0 ||
+ PyUnicodeEncodeError_SetReason(buf->excobj, reason) != 0)
+ goto errorexit;
+
+ if (errors == ERROR_STRICT) {
+ PyCodec_StrictErrors(buf->excobj);
+ goto errorexit;
+ }
+
+ retobj = call_error_callback(errors, buf->excobj);
+ if (retobj == NULL)
+ goto errorexit;
+
+ if (!PyTuple_Check(retobj) || PyTuple_GET_SIZE(retobj) != 2 ||
+ (!PyUnicode_Check((tobj = PyTuple_GET_ITEM(retobj, 0))) && !PyBytes_Check(tobj)) ||
+ !PyLong_Check(PyTuple_GET_ITEM(retobj, 1))) {
+ PyErr_SetString(PyExc_TypeError,
+ "encoding error handler must return "
+ "(str, int) tuple");
+ goto errorexit;
+ }
+
+ if (PyUnicode_Check(tobj)) {
+ Py_ssize_t inpos;
+
+ retstr = multibytecodec_encode(codec, state, tobj,
+ &inpos, ERROR_STRICT,
+ MBENC_FLUSH);
+ if (retstr == NULL)
+ goto errorexit;
+ }
+ else {
+ retstr = Py_NewRef(tobj);
+ }
+
+ assert(PyBytes_Check(retstr));
+ retstrsize = PyBytes_GET_SIZE(retstr);
+ if (retstrsize > 0) {
+ REQUIRE_ENCODEBUFFER(buf, retstrsize);
+ memcpy(buf->outbuf, PyBytes_AS_STRING(retstr), retstrsize);
+ buf->outbuf += retstrsize;
+ }
+
+ newpos = PyLong_AsSsize_t(PyTuple_GET_ITEM(retobj, 1));
+ if (newpos < 0 && !PyErr_Occurred())
+ newpos += (Py_ssize_t)buf->inlen;
+ if (newpos < 0 || newpos > buf->inlen) {
+ PyErr_Clear();
+ PyErr_Format(PyExc_IndexError,
+ "position %zd from error handler out of bounds",
+ newpos);
+ goto errorexit;
+ }
+ buf->inpos = newpos;
+
+ Py_DECREF(retobj);
+ Py_DECREF(retstr);
+ return 0;
+
+errorexit:
+ Py_XDECREF(retobj);
+ Py_XDECREF(retstr);
+ return -1;
+}
+
+static int
+multibytecodec_decerror(const MultibyteCodec *codec,
+ MultibyteCodec_State *state,
+ MultibyteDecodeBuffer *buf,
+ PyObject *errors, Py_ssize_t e)
+{
+ PyObject *retobj = NULL, *retuni = NULL;
+ Py_ssize_t newpos;
+ const char *reason;
+ Py_ssize_t esize, start, end;
+
+ if (e > 0) {
+ reason = "illegal multibyte sequence";
+ esize = e;
+ }
+ else {
+ switch (e) {
+ case MBERR_TOOSMALL:
+ return 0; /* retry it */
+ case MBERR_TOOFEW:
+ reason = "incomplete multibyte sequence";
+ esize = (Py_ssize_t)(buf->inbuf_end - buf->inbuf);
+ break;
+ case MBERR_INTERNAL:
+ PyErr_SetString(PyExc_RuntimeError,
+ "internal codec error");
+ return -1;
+ case MBERR_EXCEPTION:
+ return -1;
+ default:
+ PyErr_SetString(PyExc_RuntimeError,
+ "unknown runtime error");
+ return -1;
+ }
+ }
+
+ if (errors == ERROR_REPLACE) {
+ if (_PyUnicodeWriter_WriteChar(&buf->writer,
+ Py_UNICODE_REPLACEMENT_CHARACTER) < 0)
+ goto errorexit;
+ }
+ if (errors == ERROR_IGNORE || errors == ERROR_REPLACE) {
+ buf->inbuf += esize;
+ return 0;
+ }
+
+ start = (Py_ssize_t)(buf->inbuf - buf->inbuf_top);
+ end = start + esize;
+
+ /* use cached exception object if available */
+ if (buf->excobj == NULL) {
+ buf->excobj = PyUnicodeDecodeError_Create(codec->encoding,
+ (const char *)buf->inbuf_top,
+ (Py_ssize_t)(buf->inbuf_end - buf->inbuf_top),
+ start, end, reason);
+ if (buf->excobj == NULL)
+ goto errorexit;
+ }
+ else
+ if (PyUnicodeDecodeError_SetStart(buf->excobj, start) ||
+ PyUnicodeDecodeError_SetEnd(buf->excobj, end) ||
+ PyUnicodeDecodeError_SetReason(buf->excobj, reason))
+ goto errorexit;
+
+ if (errors == ERROR_STRICT) {
+ PyCodec_StrictErrors(buf->excobj);
+ goto errorexit;
+ }
+
+ retobj = call_error_callback(errors, buf->excobj);
+ if (retobj == NULL)
+ goto errorexit;
+
+ if (!PyTuple_Check(retobj) || PyTuple_GET_SIZE(retobj) != 2 ||
+ !PyUnicode_Check((retuni = PyTuple_GET_ITEM(retobj, 0))) ||
+ !PyLong_Check(PyTuple_GET_ITEM(retobj, 1))) {
+ PyErr_SetString(PyExc_TypeError,
+ "decoding error handler must return "
+ "(str, int) tuple");
+ goto errorexit;
+ }
+
+ if (_PyUnicodeWriter_WriteStr(&buf->writer, retuni) < 0)
+ goto errorexit;
+
+ newpos = PyLong_AsSsize_t(PyTuple_GET_ITEM(retobj, 1));
+ if (newpos < 0 && !PyErr_Occurred())
+ newpos += (Py_ssize_t)(buf->inbuf_end - buf->inbuf_top);
+ if (newpos < 0 || buf->inbuf_top + newpos > buf->inbuf_end) {
+ PyErr_Clear();
+ PyErr_Format(PyExc_IndexError,
+ "position %zd from error handler out of bounds",
+ newpos);
+ goto errorexit;
+ }
+ buf->inbuf = buf->inbuf_top + newpos;
+ Py_DECREF(retobj);
+ return 0;
+
+errorexit:
+ Py_XDECREF(retobj);
+ return -1;
+}
+
+static PyObject *
+multibytecodec_encode(const MultibyteCodec *codec,
+ MultibyteCodec_State *state,
+ PyObject *text, Py_ssize_t *inpos_t,
+ PyObject *errors, int flags)
+{
+ MultibyteEncodeBuffer buf;
+ Py_ssize_t finalsize, r = 0;
+ Py_ssize_t datalen;
+ int kind;
+ const void *data;
+
+ if (PyUnicode_READY(text) < 0)
+ return NULL;
+ datalen = PyUnicode_GET_LENGTH(text);
+
+ if (datalen == 0 && !(flags & MBENC_RESET))
+ return PyBytes_FromStringAndSize(NULL, 0);
+
+ buf.excobj = NULL;
+ buf.outobj = NULL;
+ buf.inobj = text; /* borrowed reference */
+ buf.inpos = 0;
+ buf.inlen = datalen;
+ kind = PyUnicode_KIND(buf.inobj);
+ data = PyUnicode_DATA(buf.inobj);
+
+ if (datalen > (PY_SSIZE_T_MAX - 16) / 2) {
+ PyErr_NoMemory();
+ goto errorexit;
+ }
+
+ buf.outobj = PyBytes_FromStringAndSize(NULL, datalen * 2 + 16);
+ if (buf.outobj == NULL)
+ goto errorexit;
+ buf.outbuf = (unsigned char *)PyBytes_AS_STRING(buf.outobj);
+ buf.outbuf_end = buf.outbuf + PyBytes_GET_SIZE(buf.outobj);
+
+ while (buf.inpos < buf.inlen) {
+ /* we don't reuse inleft and outleft here.
+ * error callbacks can relocate the cursor anywhere on buffer*/
+ Py_ssize_t outleft = (Py_ssize_t)(buf.outbuf_end - buf.outbuf);
+
+ r = codec->encode(state, codec,
+ kind, data,
+ &buf.inpos, buf.inlen,
+ &buf.outbuf, outleft, flags);
+ if ((r == 0) || (r == MBERR_TOOFEW && !(flags & MBENC_FLUSH)))
+ break;
+ else if (multibytecodec_encerror(codec, state, &buf, errors,r))
+ goto errorexit;
+ else if (r == MBERR_TOOFEW)
+ break;
+ }
+
+ if (codec->encreset != NULL && (flags & MBENC_RESET))
+ for (;;) {
+ Py_ssize_t outleft;
+
+ outleft = (Py_ssize_t)(buf.outbuf_end - buf.outbuf);
+ r = codec->encreset(state, codec, &buf.outbuf,
+ outleft);
+ if (r == 0)
+ break;
+ else if (multibytecodec_encerror(codec, state,
+ &buf, errors, r))
+ goto errorexit;
+ }
+
+ finalsize = (Py_ssize_t)((char *)buf.outbuf -
+ PyBytes_AS_STRING(buf.outobj));
+
+ if (finalsize != PyBytes_GET_SIZE(buf.outobj))
+ if (_PyBytes_Resize(&buf.outobj, finalsize) == -1)
+ goto errorexit;
+
+ if (inpos_t)
+ *inpos_t = buf.inpos;
+ Py_XDECREF(buf.excobj);
+ return buf.outobj;
+
+errorexit:
+ Py_XDECREF(buf.excobj);
+ Py_XDECREF(buf.outobj);
+ return NULL;
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteCodec.encode
+
+ input: object
+ errors: str(accept={str, NoneType}) = None
+
+Return an encoded string version of `input'.
+
+'errors' may be given to set a different error handling scheme. Default is
+'strict' meaning that encoding errors raise a UnicodeEncodeError. Other possible
+values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name
+registered with codecs.register_error that can handle UnicodeEncodeErrors.
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
+ PyObject *input,
+ const char *errors)
+/*[clinic end generated code: output=7b26652045ba56a9 input=606d0e128a577bae]*/
+{
+ MultibyteCodec_State state;
+ PyObject *errorcb, *r, *ucvt;
+ Py_ssize_t datalen;
+
+ if (PyUnicode_Check(input))
+ ucvt = NULL;
+ else {
+ input = ucvt = PyObject_Str(input);
+ if (input == NULL)
+ return NULL;
+ else if (!PyUnicode_Check(input)) {
+ PyErr_SetString(PyExc_TypeError,
+ "couldn't convert the object to unicode.");
+ Py_DECREF(ucvt);
+ return NULL;
+ }
+ }
+
+ if (PyUnicode_READY(input) < 0) {
+ Py_XDECREF(ucvt);
+ return NULL;
+ }
+ datalen = PyUnicode_GET_LENGTH(input);
+
+ errorcb = internal_error_callback(errors);
+ if (errorcb == NULL) {
+ Py_XDECREF(ucvt);
+ return NULL;
+ }
+
+ if (self->codec->encinit != NULL &&
+ self->codec->encinit(&state, self->codec) != 0)
+ goto errorexit;
+ r = multibytecodec_encode(self->codec, &state,
+ input, NULL, errorcb,
+ MBENC_FLUSH | MBENC_RESET);
+ if (r == NULL)
+ goto errorexit;
+
+ ERROR_DECREF(errorcb);
+ Py_XDECREF(ucvt);
+ return make_tuple(r, datalen);
+
+errorexit:
+ ERROR_DECREF(errorcb);
+ Py_XDECREF(ucvt);
+ return NULL;
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteCodec.decode
+
+ input: Py_buffer
+ errors: str(accept={str, NoneType}) = None
+
+Decodes 'input'.
+
+'errors' may be given to set a different error handling scheme. Default is
+'strict' meaning that encoding errors raise a UnicodeDecodeError. Other possible
+values are 'ignore' and 'replace' as well as any other name registered with
+codecs.register_error that is able to handle UnicodeDecodeErrors."
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
+ Py_buffer *input,
+ const char *errors)
+/*[clinic end generated code: output=ff419f65bad6cc77 input=e0c78fc7ab190def]*/
+{
+ MultibyteCodec_State state;
+ MultibyteDecodeBuffer buf;
+ PyObject *errorcb, *res;
+ const char *data;
+ Py_ssize_t datalen;
+
+ data = input->buf;
+ datalen = input->len;
+
+ errorcb = internal_error_callback(errors);
+ if (errorcb == NULL) {
+ return NULL;
+ }
+
+ if (datalen == 0) {
+ ERROR_DECREF(errorcb);
+ return make_tuple(PyUnicode_New(0, 0), 0);
+ }
+
+ _PyUnicodeWriter_Init(&buf.writer);
+ buf.writer.min_length = datalen;
+ buf.excobj = NULL;
+ buf.inbuf = buf.inbuf_top = (unsigned char *)data;
+ buf.inbuf_end = buf.inbuf_top + datalen;
+
+ if (self->codec->decinit != NULL &&
+ self->codec->decinit(&state, self->codec) != 0)
+ goto errorexit;
+
+ while (buf.inbuf < buf.inbuf_end) {
+ Py_ssize_t inleft, r;
+
+ inleft = (Py_ssize_t)(buf.inbuf_end - buf.inbuf);
+
+ r = self->codec->decode(&state, self->codec,
+ &buf.inbuf, inleft, &buf.writer);
+ if (r == 0)
+ break;
+ else if (multibytecodec_decerror(self->codec, &state,
+ &buf, errorcb, r))
+ goto errorexit;
+ }
+
+ res = _PyUnicodeWriter_Finish(&buf.writer);
+ if (res == NULL)
+ goto errorexit;
+
+ Py_XDECREF(buf.excobj);
+ ERROR_DECREF(errorcb);
+ return make_tuple(res, datalen);
+
+errorexit:
+ ERROR_DECREF(errorcb);
+ Py_XDECREF(buf.excobj);
+ _PyUnicodeWriter_Dealloc(&buf.writer);
+
+ return NULL;
+}
+
+static struct PyMethodDef multibytecodec_methods[] = {
+ _MULTIBYTECODEC_MULTIBYTECODEC_ENCODE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF
+ {NULL, NULL},
+};
+
+static int
+multibytecodec_clear(MultibyteCodecObject *self)
+{
+ Py_CLEAR(self->cjk_module);
+ return 0;
+}
+
+static int
+multibytecodec_traverse(MultibyteCodecObject *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ Py_VISIT(self->cjk_module);
+ return 0;
+}
+
+static void
+multibytecodec_dealloc(MultibyteCodecObject *self)
+{
+ PyObject_GC_UnTrack(self);
+ PyTypeObject *tp = Py_TYPE(self);
+ (void)multibytecodec_clear(self);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot multibytecodec_slots[] = {
+ {Py_tp_dealloc, multibytecodec_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_methods, multibytecodec_methods},
+ {Py_tp_traverse, multibytecodec_traverse},
+ {Py_tp_clear, multibytecodec_clear},
+ {0, NULL},
+};
+
+static PyType_Spec multibytecodec_spec = {
+ .name = MODULE_NAME ".MultibyteCodec",
+ .basicsize = sizeof(MultibyteCodecObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = multibytecodec_slots,
+};
+
+
+/**
+ * Utility functions for stateful codec mechanism
+ */
+
+#define STATEFUL_DCTX(o) ((MultibyteStatefulDecoderContext *)(o))
+#define STATEFUL_ECTX(o) ((MultibyteStatefulEncoderContext *)(o))
+
+static PyObject *
+encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
+ PyObject *unistr, int final)
+{
+ PyObject *ucvt, *r = NULL;
+ PyObject *inbuf = NULL;
+ Py_ssize_t inpos, datalen;
+ PyObject *origpending = NULL;
+
+ if (PyUnicode_Check(unistr))
+ ucvt = NULL;
+ else {
+ unistr = ucvt = PyObject_Str(unistr);
+ if (unistr == NULL)
+ return NULL;
+ else if (!PyUnicode_Check(unistr)) {
+ PyErr_SetString(PyExc_TypeError,
+ "couldn't convert the object to str.");
+ Py_DECREF(ucvt);
+ return NULL;
+ }
+ }
+
+ if (ctx->pending) {
+ PyObject *inbuf_tmp;
+
+ origpending = Py_NewRef(ctx->pending);
+
+ inbuf_tmp = Py_NewRef(ctx->pending);
+ PyUnicode_Append(&inbuf_tmp, unistr);
+ if (inbuf_tmp == NULL)
+ goto errorexit;
+ Py_CLEAR(ctx->pending);
+ inbuf = inbuf_tmp;
+ }
+ else {
+ origpending = NULL;
+
+ inbuf = Py_NewRef(unistr);
+ }
+ if (PyUnicode_READY(inbuf) < 0)
+ goto errorexit;
+ inpos = 0;
+ datalen = PyUnicode_GET_LENGTH(inbuf);
+
+ r = multibytecodec_encode(ctx->codec, &ctx->state,
+ inbuf, &inpos,
+ ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0);
+ if (r == NULL) {
+ /* recover the original pending buffer */
+ Py_XSETREF(ctx->pending, origpending);
+ origpending = NULL;
+ goto errorexit;
+ }
+ Py_XDECREF(origpending);
+
+ if (inpos < datalen) {
+ if (datalen - inpos > MAXENCPENDING) {
+ /* normal codecs can't reach here */
+ PyErr_SetString(PyExc_UnicodeError,
+ "pending buffer overflow");
+ goto errorexit;
+ }
+ ctx->pending = PyUnicode_Substring(inbuf, inpos, datalen);
+ if (ctx->pending == NULL) {
+ /* normal codecs can't reach here */
+ goto errorexit;
+ }
+ }
+
+ Py_DECREF(inbuf);
+ Py_XDECREF(ucvt);
+ return r;
+
+errorexit:
+ Py_XDECREF(r);
+ Py_XDECREF(ucvt);
+ Py_XDECREF(origpending);
+ Py_XDECREF(inbuf);
+ return NULL;
+}
+
+static int
+decoder_append_pending(MultibyteStatefulDecoderContext *ctx,
+ MultibyteDecodeBuffer *buf)
+{
+ Py_ssize_t npendings;
+
+ npendings = (Py_ssize_t)(buf->inbuf_end - buf->inbuf);
+ if (npendings + ctx->pendingsize > MAXDECPENDING ||
+ npendings > PY_SSIZE_T_MAX - ctx->pendingsize) {
+ PyErr_SetString(PyExc_UnicodeError, "pending buffer overflow");
+ return -1;
+ }
+ memcpy(ctx->pending + ctx->pendingsize, buf->inbuf, npendings);
+ ctx->pendingsize += npendings;
+ return 0;
+}
+
+static int
+decoder_prepare_buffer(MultibyteDecodeBuffer *buf, const char *data,
+ Py_ssize_t size)
+{
+ buf->inbuf = buf->inbuf_top = (const unsigned char *)data;
+ buf->inbuf_end = buf->inbuf_top + size;
+ buf->writer.min_length += size;
+ return 0;
+}
+
+static int
+decoder_feed_buffer(MultibyteStatefulDecoderContext *ctx,
+ MultibyteDecodeBuffer *buf)
+{
+ while (buf->inbuf < buf->inbuf_end) {
+ Py_ssize_t inleft;
+ Py_ssize_t r;
+
+ inleft = (Py_ssize_t)(buf->inbuf_end - buf->inbuf);
+
+ r = ctx->codec->decode(&ctx->state, ctx->codec,
+ &buf->inbuf, inleft, &buf->writer);
+ if (r == 0 || r == MBERR_TOOFEW)
+ break;
+ else if (multibytecodec_decerror(ctx->codec, &ctx->state,
+ buf, ctx->errors, r))
+ return -1;
+ }
+ return 0;
+}
+
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalEncoder.encode
+
+ input: object
+ final: bool = False
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
+ PyObject *input,
+ int final)
+/*[clinic end generated code: output=123361b6c505e2c1 input=bd5f7d40d43e99b0]*/
+{
+ return encoder_encode_stateful(STATEFUL_ECTX(self), input, final);
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalEncoder.getstate
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self)
+/*[clinic end generated code: output=9794a5ace70d7048 input=4a2a82874ffa40bb]*/
+{
+ /* state made up of 1 byte for buffer size, up to MAXENCPENDING*4 bytes
+ for UTF-8 encoded buffer (each character can use up to 4
+ bytes), and required bytes for MultibyteCodec_State.c. A byte
+ array is used to avoid different compilers generating different
+ values for the same state, e.g. as a result of struct padding.
+ */
+ unsigned char statebytes[1 + MAXENCPENDING*4 + sizeof(self->state.c)];
+ Py_ssize_t statesize;
+ const char *pendingbuffer = NULL;
+ Py_ssize_t pendingsize;
+
+ if (self->pending != NULL) {
+ pendingbuffer = PyUnicode_AsUTF8AndSize(self->pending, &pendingsize);
+ if (pendingbuffer == NULL) {
+ return NULL;
+ }
+ if (pendingsize > MAXENCPENDING*4) {
+ PyErr_SetString(PyExc_UnicodeError, "pending buffer too large");
+ return NULL;
+ }
+ statebytes[0] = (unsigned char)pendingsize;
+ memcpy(statebytes + 1, pendingbuffer, pendingsize);
+ statesize = 1 + pendingsize;
+ } else {
+ statebytes[0] = 0;
+ statesize = 1;
+ }
+ memcpy(statebytes+statesize, self->state.c,
+ sizeof(self->state.c));
+ statesize += sizeof(self->state.c);
+
+ return (PyObject *)_PyLong_FromByteArray(statebytes, statesize,
+ 1 /* little-endian */ ,
+ 0 /* unsigned */ );
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalEncoder.setstate
+ state as statelong: object(type='PyLongObject *', subclass_of='&PyLong_Type')
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self,
+ PyLongObject *statelong)
+/*[clinic end generated code: output=4e5e98ac1f4039ca input=c80fb5830d4d2f76]*/
+{
+ PyObject *pending = NULL;
+ unsigned char statebytes[1 + MAXENCPENDING*4 + sizeof(self->state.c)];
+
+ if (_PyLong_AsByteArray(statelong, statebytes, sizeof(statebytes),
+ 1 /* little-endian */ ,
+ 0 /* unsigned */ ) < 0) {
+ goto errorexit;
+ }
+
+ if (statebytes[0] > MAXENCPENDING*4) {
+ PyErr_SetString(PyExc_UnicodeError, "pending buffer too large");
+ return NULL;
+ }
+
+ pending = PyUnicode_DecodeUTF8((const char *)statebytes+1,
+ statebytes[0], "strict");
+ if (pending == NULL) {
+ goto errorexit;
+ }
+
+ Py_XSETREF(self->pending, pending);
+ memcpy(self->state.c, statebytes+1+statebytes[0],
+ sizeof(self->state.c));
+
+ Py_RETURN_NONE;
+
+errorexit:
+ Py_XDECREF(pending);
+ return NULL;
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalEncoder.reset
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self)
+/*[clinic end generated code: output=b4125d8f537a253f input=930f06760707b6ea]*/
+{
+ /* Longest output: 4 bytes (b'\x0F\x1F(B') with ISO 2022 */
+ unsigned char buffer[4], *outbuf;
+ Py_ssize_t r;
+ if (self->codec->encreset != NULL) {
+ outbuf = buffer;
+ r = self->codec->encreset(&self->state, self->codec,
+ &outbuf, sizeof(buffer));
+ if (r != 0)
+ return NULL;
+ }
+ Py_CLEAR(self->pending);
+ Py_RETURN_NONE;
+}
+
+static struct PyMethodDef mbiencoder_methods[] = {
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF
+ {NULL, NULL},
+};
+
+static PyObject *
+mbiencoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ MultibyteIncrementalEncoderObject *self;
+ PyObject *codec = NULL;
+ char *errors = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|s:IncrementalEncoder",
+ incnewkwarglist, &errors))
+ return NULL;
+
+ self = (MultibyteIncrementalEncoderObject *)type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ codec = PyObject_GetAttrString((PyObject *)type, "codec");
+ if (codec == NULL)
+ goto errorexit;
+
+ module_state *state = find_state_by_def(type);
+ if (!MultibyteCodec_Check(state, codec)) {
+ PyErr_SetString(PyExc_TypeError, "codec is unexpected type");
+ goto errorexit;
+ }
+
+ self->codec = ((MultibyteCodecObject *)codec)->codec;
+ self->pending = NULL;
+ self->errors = internal_error_callback(errors);
+ if (self->errors == NULL)
+ goto errorexit;
+ if (self->codec->encinit != NULL &&
+ self->codec->encinit(&self->state, self->codec) != 0)
+ goto errorexit;
+
+ Py_DECREF(codec);
+ return (PyObject *)self;
+
+errorexit:
+ Py_XDECREF(self);
+ Py_XDECREF(codec);
+ return NULL;
+}
+
+static int
+mbiencoder_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
+mbiencoder_traverse(MultibyteIncrementalEncoderObject *self,
+ visitproc visit, void *arg)
+{
+ if (ERROR_ISCUSTOM(self->errors))
+ Py_VISIT(self->errors);
+ return 0;
+}
+
+static void
+mbiencoder_dealloc(MultibyteIncrementalEncoderObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ ERROR_DECREF(self->errors);
+ Py_CLEAR(self->pending);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot encoder_slots[] = {
+ {Py_tp_dealloc, mbiencoder_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, mbiencoder_traverse},
+ {Py_tp_methods, mbiencoder_methods},
+ {Py_tp_getset, codecctx_getsets},
+ {Py_tp_init, mbiencoder_init},
+ {Py_tp_new, mbiencoder_new},
+ {0, NULL},
+};
+
+static PyType_Spec encoder_spec = {
+ .name = MODULE_NAME ".MultibyteIncrementalEncoder",
+ .basicsize = sizeof(MultibyteIncrementalEncoderObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = encoder_slots,
+};
+
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalDecoder.decode
+
+ input: Py_buffer
+ final: bool = False
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
+ Py_buffer *input,
+ int final)
+/*[clinic end generated code: output=b9b9090e8a9ce2ba input=8795fbb20860027a]*/
+{
+ MultibyteDecodeBuffer buf;
+ char *data, *wdata = NULL;
+ Py_ssize_t wsize, size, origpending;
+ PyObject *res;
+
+ data = input->buf;
+ size = input->len;
+
+ _PyUnicodeWriter_Init(&buf.writer);
+ buf.excobj = NULL;
+ origpending = self->pendingsize;
+
+ if (self->pendingsize == 0) {
+ wsize = size;
+ wdata = data;
+ }
+ else {
+ if (size > PY_SSIZE_T_MAX - self->pendingsize) {
+ PyErr_NoMemory();
+ goto errorexit;
+ }
+ wsize = size + self->pendingsize;
+ wdata = PyMem_Malloc(wsize);
+ if (wdata == NULL) {
+ PyErr_NoMemory();
+ goto errorexit;
+ }
+ memcpy(wdata, self->pending, self->pendingsize);
+ memcpy(wdata + self->pendingsize, data, size);
+ self->pendingsize = 0;
+ }
+
+ if (decoder_prepare_buffer(&buf, wdata, wsize) != 0)
+ goto errorexit;
+
+ if (decoder_feed_buffer(STATEFUL_DCTX(self), &buf))
+ goto errorexit;
+
+ if (final && buf.inbuf < buf.inbuf_end) {
+ if (multibytecodec_decerror(self->codec, &self->state,
+ &buf, self->errors, MBERR_TOOFEW)) {
+ /* recover the original pending buffer */
+ memcpy(self->pending, wdata, origpending);
+ self->pendingsize = origpending;
+ goto errorexit;
+ }
+ }
+
+ if (buf.inbuf < buf.inbuf_end) { /* pending sequence still exists */
+ if (decoder_append_pending(STATEFUL_DCTX(self), &buf) != 0)
+ goto errorexit;
+ }
+
+ res = _PyUnicodeWriter_Finish(&buf.writer);
+ if (res == NULL)
+ goto errorexit;
+
+ if (wdata != data)
+ PyMem_Free(wdata);
+ Py_XDECREF(buf.excobj);
+ return res;
+
+errorexit:
+ if (wdata != NULL && wdata != data)
+ PyMem_Free(wdata);
+ Py_XDECREF(buf.excobj);
+ _PyUnicodeWriter_Dealloc(&buf.writer);
+ return NULL;
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalDecoder.getstate
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self)
+/*[clinic end generated code: output=255009c4713b7f82 input=4006aa49bddbaa75]*/
+{
+ PyObject *buffer;
+ PyObject *statelong;
+
+ buffer = PyBytes_FromStringAndSize((const char *)self->pending,
+ self->pendingsize);
+ if (buffer == NULL) {
+ return NULL;
+ }
+
+ statelong = (PyObject *)_PyLong_FromByteArray(self->state.c,
+ sizeof(self->state.c),
+ 1 /* little-endian */ ,
+ 0 /* unsigned */ );
+ if (statelong == NULL) {
+ Py_DECREF(buffer);
+ return NULL;
+ }
+
+ return Py_BuildValue("NN", buffer, statelong);
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalDecoder.setstate
+ state: object(subclass_of='&PyTuple_Type')
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self,
+ PyObject *state)
+/*[clinic end generated code: output=106b2fbca3e2dcc2 input=e5d794e8baba1a47]*/
+{
+ PyObject *buffer;
+ PyLongObject *statelong;
+ Py_ssize_t buffersize;
+ const char *bufferstr;
+ unsigned char statebytes[8];
+
+ if (!PyArg_ParseTuple(state, "SO!;setstate(): illegal state argument",
+ &buffer, &PyLong_Type, &statelong))
+ {
+ return NULL;
+ }
+
+ if (_PyLong_AsByteArray(statelong, statebytes, sizeof(statebytes),
+ 1 /* little-endian */ ,
+ 0 /* unsigned */ ) < 0) {
+ return NULL;
+ }
+
+ buffersize = PyBytes_Size(buffer);
+ if (buffersize == -1) {
+ return NULL;
+ }
+
+ if (buffersize > MAXDECPENDING) {
+ PyErr_SetString(PyExc_UnicodeError, "pending buffer too large");
+ return NULL;
+ }
+
+ bufferstr = PyBytes_AsString(buffer);
+ if (bufferstr == NULL) {
+ return NULL;
+ }
+ self->pendingsize = buffersize;
+ memcpy(self->pending, bufferstr, self->pendingsize);
+ memcpy(self->state.c, statebytes, sizeof(statebytes));
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_multibytecodec.MultibyteIncrementalDecoder.reset
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self)
+/*[clinic end generated code: output=da423b1782c23ed1 input=3b63b3be85b2fb45]*/
+{
+ if (self->codec->decreset != NULL &&
+ self->codec->decreset(&self->state, self->codec) != 0)
+ return NULL;
+ self->pendingsize = 0;
+
+ Py_RETURN_NONE;
+}
+
+static struct PyMethodDef mbidecoder_methods[] = {
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF
+ {NULL, NULL},
+};
+
+static PyObject *
+mbidecoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ MultibyteIncrementalDecoderObject *self;
+ PyObject *codec = NULL;
+ char *errors = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|s:IncrementalDecoder",
+ incnewkwarglist, &errors))
+ return NULL;
+
+ self = (MultibyteIncrementalDecoderObject *)type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ codec = PyObject_GetAttrString((PyObject *)type, "codec");
+ if (codec == NULL)
+ goto errorexit;
+
+ module_state *state = find_state_by_def(type);
+ if (!MultibyteCodec_Check(state, codec)) {
+ PyErr_SetString(PyExc_TypeError, "codec is unexpected type");
+ goto errorexit;
+ }
+
+ self->codec = ((MultibyteCodecObject *)codec)->codec;
+ self->pendingsize = 0;
+ self->errors = internal_error_callback(errors);
+ if (self->errors == NULL)
+ goto errorexit;
+ if (self->codec->decinit != NULL &&
+ self->codec->decinit(&self->state, self->codec) != 0)
+ goto errorexit;
+
+ Py_DECREF(codec);
+ return (PyObject *)self;
+
+errorexit:
+ Py_XDECREF(self);
+ Py_XDECREF(codec);
+ return NULL;
+}
+
+static int
+mbidecoder_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
+mbidecoder_traverse(MultibyteIncrementalDecoderObject *self,
+ visitproc visit, void *arg)
+{
+ if (ERROR_ISCUSTOM(self->errors))
+ Py_VISIT(self->errors);
+ return 0;
+}
+
+static void
+mbidecoder_dealloc(MultibyteIncrementalDecoderObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ ERROR_DECREF(self->errors);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot decoder_slots[] = {
+ {Py_tp_dealloc, mbidecoder_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, mbidecoder_traverse},
+ {Py_tp_methods, mbidecoder_methods},
+ {Py_tp_getset, codecctx_getsets},
+ {Py_tp_init, mbidecoder_init},
+ {Py_tp_new, mbidecoder_new},
+ {0, NULL},
+};
+
+static PyType_Spec decoder_spec = {
+ .name = MODULE_NAME ".MultibyteIncrementalDecoder",
+ .basicsize = sizeof(MultibyteIncrementalDecoderObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = decoder_slots,
+};
+
+static PyObject *
+mbstreamreader_iread(MultibyteStreamReaderObject *self,
+ const char *method, Py_ssize_t sizehint)
+{
+ MultibyteDecodeBuffer buf;
+ PyObject *cres, *res;
+ Py_ssize_t rsize;
+
+ if (sizehint == 0)
+ return PyUnicode_New(0, 0);
+
+ _PyUnicodeWriter_Init(&buf.writer);
+ buf.excobj = NULL;
+ cres = NULL;
+
+ for (;;) {
+ int endoffile;
+
+ if (sizehint < 0)
+ cres = PyObject_CallMethod(self->stream,
+ method, NULL);
+ else
+ cres = PyObject_CallMethod(self->stream,
+ method, "i", sizehint);
+ if (cres == NULL)
+ goto errorexit;
+
+ if (!PyBytes_Check(cres)) {
+ PyErr_Format(PyExc_TypeError,
+ "stream function returned a "
+ "non-bytes object (%.100s)",
+ Py_TYPE(cres)->tp_name);
+ goto errorexit;
+ }
+
+ endoffile = (PyBytes_GET_SIZE(cres) == 0);
+
+ if (self->pendingsize > 0) {
+ PyObject *ctr;
+ char *ctrdata;
+
+ if (PyBytes_GET_SIZE(cres) > PY_SSIZE_T_MAX - self->pendingsize) {
+ PyErr_NoMemory();
+ goto errorexit;
+ }
+ rsize = PyBytes_GET_SIZE(cres) + self->pendingsize;
+ ctr = PyBytes_FromStringAndSize(NULL, rsize);
+ if (ctr == NULL)
+ goto errorexit;
+ ctrdata = PyBytes_AS_STRING(ctr);
+ memcpy(ctrdata, self->pending, self->pendingsize);
+ memcpy(ctrdata + self->pendingsize,
+ PyBytes_AS_STRING(cres),
+ PyBytes_GET_SIZE(cres));
+ Py_SETREF(cres, ctr);
+ self->pendingsize = 0;
+ }
+
+ rsize = PyBytes_GET_SIZE(cres);
+ if (decoder_prepare_buffer(&buf, PyBytes_AS_STRING(cres),
+ rsize) != 0)
+ goto errorexit;
+
+ if (rsize > 0 && decoder_feed_buffer(
+ (MultibyteStatefulDecoderContext *)self, &buf))
+ goto errorexit;
+
+ if (endoffile || sizehint < 0) {
+ if (buf.inbuf < buf.inbuf_end &&
+ multibytecodec_decerror(self->codec, &self->state,
+ &buf, self->errors, MBERR_TOOFEW))
+ goto errorexit;
+ }
+
+ if (buf.inbuf < buf.inbuf_end) { /* pending sequence exists */
+ if (decoder_append_pending(STATEFUL_DCTX(self),
+ &buf) != 0)
+ goto errorexit;
+ }
+
+ Py_SETREF(cres, NULL);
+
+ if (sizehint < 0 || buf.writer.pos != 0 || rsize == 0)
+ break;
+
+ sizehint = 1; /* read 1 more byte and retry */
+ }
+
+ res = _PyUnicodeWriter_Finish(&buf.writer);
+ if (res == NULL)
+ goto errorexit;
+
+ Py_XDECREF(cres);
+ Py_XDECREF(buf.excobj);
+ return res;
+
+errorexit:
+ Py_XDECREF(cres);
+ Py_XDECREF(buf.excobj);
+ _PyUnicodeWriter_Dealloc(&buf.writer);
+ return NULL;
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamReader.read
+
+ sizeobj: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
+ PyObject *sizeobj)
+/*[clinic end generated code: output=35621eb75355d5b8 input=015b0d3ff2fca485]*/
+{
+ Py_ssize_t size;
+
+ if (sizeobj == Py_None)
+ size = -1;
+ else if (PyLong_Check(sizeobj))
+ size = PyLong_AsSsize_t(sizeobj);
+ else {
+ PyErr_SetString(PyExc_TypeError, "arg 1 must be an integer");
+ return NULL;
+ }
+
+ if (size == -1 && PyErr_Occurred())
+ return NULL;
+
+ return mbstreamreader_iread(self, "read", size);
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamReader.readline
+
+ sizeobj: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
+ PyObject *sizeobj)
+/*[clinic end generated code: output=4fbfaae1ed457a11 input=41ccc64f9bb0cec3]*/
+{
+ Py_ssize_t size;
+
+ if (sizeobj == Py_None)
+ size = -1;
+ else if (PyLong_Check(sizeobj))
+ size = PyLong_AsSsize_t(sizeobj);
+ else {
+ PyErr_SetString(PyExc_TypeError, "arg 1 must be an integer");
+ return NULL;
+ }
+
+ if (size == -1 && PyErr_Occurred())
+ return NULL;
+
+ return mbstreamreader_iread(self, "readline", size);
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamReader.readlines
+
+ sizehintobj: object = None
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
+ PyObject *sizehintobj)
+/*[clinic end generated code: output=e7c4310768ed2ad4 input=54932f5d4d88e880]*/
+{
+ PyObject *r, *sr;
+ Py_ssize_t sizehint;
+
+ if (sizehintobj == Py_None)
+ sizehint = -1;
+ else if (PyLong_Check(sizehintobj))
+ sizehint = PyLong_AsSsize_t(sizehintobj);
+ else {
+ PyErr_SetString(PyExc_TypeError, "arg 1 must be an integer");
+ return NULL;
+ }
+
+ if (sizehint == -1 && PyErr_Occurred())
+ return NULL;
+
+ r = mbstreamreader_iread(self, "read", sizehint);
+ if (r == NULL)
+ return NULL;
+
+ sr = PyUnicode_Splitlines(r, 1);
+ Py_DECREF(r);
+ return sr;
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamReader.reset
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self)
+/*[clinic end generated code: output=138490370a680abc input=5d4140db84b5e1e2]*/
+{
+ if (self->codec->decreset != NULL &&
+ self->codec->decreset(&self->state, self->codec) != 0)
+ return NULL;
+ self->pendingsize = 0;
+
+ Py_RETURN_NONE;
+}
+
+static struct PyMethodDef mbstreamreader_methods[] = {
+ _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF
+ {NULL, NULL},
+};
+
+static PyMemberDef mbstreamreader_members[] = {
+ {"stream", T_OBJECT,
+ offsetof(MultibyteStreamReaderObject, stream),
+ READONLY, NULL},
+ {NULL,}
+};
+
+static PyObject *
+mbstreamreader_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ MultibyteStreamReaderObject *self;
+ PyObject *stream, *codec = NULL;
+ char *errors = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s:StreamReader",
+ streamkwarglist, &stream, &errors))
+ return NULL;
+
+ self = (MultibyteStreamReaderObject *)type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ codec = PyObject_GetAttrString((PyObject *)type, "codec");
+ if (codec == NULL)
+ goto errorexit;
+
+ module_state *state = find_state_by_def(type);
+ if (!MultibyteCodec_Check(state, codec)) {
+ PyErr_SetString(PyExc_TypeError, "codec is unexpected type");
+ goto errorexit;
+ }
+
+ self->codec = ((MultibyteCodecObject *)codec)->codec;
+ self->stream = Py_NewRef(stream);
+ self->pendingsize = 0;
+ self->errors = internal_error_callback(errors);
+ if (self->errors == NULL)
+ goto errorexit;
+ if (self->codec->decinit != NULL &&
+ self->codec->decinit(&self->state, self->codec) != 0)
+ goto errorexit;
+
+ Py_DECREF(codec);
+ return (PyObject *)self;
+
+errorexit:
+ Py_XDECREF(self);
+ Py_XDECREF(codec);
+ return NULL;
+}
+
+static int
+mbstreamreader_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
+mbstreamreader_traverse(MultibyteStreamReaderObject *self,
+ visitproc visit, void *arg)
+{
+ if (ERROR_ISCUSTOM(self->errors))
+ Py_VISIT(self->errors);
+ Py_VISIT(self->stream);
+ return 0;
+}
+
+static void
+mbstreamreader_dealloc(MultibyteStreamReaderObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ ERROR_DECREF(self->errors);
+ Py_XDECREF(self->stream);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot reader_slots[] = {
+ {Py_tp_dealloc, mbstreamreader_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, mbstreamreader_traverse},
+ {Py_tp_methods, mbstreamreader_methods},
+ {Py_tp_members, mbstreamreader_members},
+ {Py_tp_getset, codecctx_getsets},
+ {Py_tp_init, mbstreamreader_init},
+ {Py_tp_new, mbstreamreader_new},
+ {0, NULL},
+};
+
+static PyType_Spec reader_spec = {
+ .name = MODULE_NAME ".MultibyteStreamReader",
+ .basicsize = sizeof(MultibyteStreamReaderObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = reader_slots,
+};
+
+static int
+mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
+ PyObject *unistr, PyObject *str_write)
+{
+ PyObject *str, *wr;
+
+ str = encoder_encode_stateful(STATEFUL_ECTX(self), unistr, 0);
+ if (str == NULL)
+ return -1;
+
+ wr = _PyObject_CallMethodOneArg(self->stream, str_write, str);
+ Py_DECREF(str);
+ if (wr == NULL)
+ return -1;
+
+ Py_DECREF(wr);
+ return 0;
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamWriter.write
+
+ cls: defining_class
+ strobj: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_write_impl(MultibyteStreamWriterObject *self,
+ PyTypeObject *cls,
+ PyObject *strobj)
+/*[clinic end generated code: output=68ade3aea26410ac input=199f26f68bd8425a]*/
+{
+ module_state *state = PyType_GetModuleState(cls);
+ assert(state != NULL);
+ if (mbstreamwriter_iwrite(self, strobj, state->str_write)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamWriter.writelines
+
+ cls: defining_class
+ lines: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_writelines_impl(MultibyteStreamWriterObject *self,
+ PyTypeObject *cls,
+ PyObject *lines)
+/*[clinic end generated code: output=b4c99d2cf23ffb88 input=a6d5fe7c74972a34]*/
+{
+ PyObject *strobj;
+ int i, r;
+
+ if (!PySequence_Check(lines)) {
+ PyErr_SetString(PyExc_TypeError,
+ "arg must be a sequence object");
+ return NULL;
+ }
+
+ module_state *state = PyType_GetModuleState(cls);
+ assert(state != NULL);
+ for (i = 0; i < PySequence_Length(lines); i++) {
+ /* length can be changed even within this loop */
+ strobj = PySequence_GetItem(lines, i);
+ if (strobj == NULL)
+ return NULL;
+
+ r = mbstreamwriter_iwrite(self, strobj, state->str_write);
+ Py_DECREF(strobj);
+ if (r == -1)
+ return NULL;
+ }
+ /* PySequence_Length() can fail */
+ if (PyErr_Occurred())
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+ _multibytecodec.MultibyteStreamWriter.reset
+
+ cls: defining_class
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self,
+ PyTypeObject *cls)
+/*[clinic end generated code: output=32ef224c2a38aa3d input=28af6a9cd38d1979]*/
+{
+ PyObject *pwrt;
+
+ if (!self->pending)
+ Py_RETURN_NONE;
+
+ pwrt = multibytecodec_encode(self->codec, &self->state,
+ self->pending, NULL, self->errors,
+ MBENC_FLUSH | MBENC_RESET);
+ /* some pending buffer can be truncated when UnicodeEncodeError is
+ * raised on 'strict' mode. but, 'reset' method is designed to
+ * reset the pending buffer or states so failed string sequence
+ * ought to be missed */
+ Py_CLEAR(self->pending);
+ if (pwrt == NULL)
+ return NULL;
+
+ assert(PyBytes_Check(pwrt));
+
+ module_state *state = PyType_GetModuleState(cls);
+ assert(state != NULL);
+
+ if (PyBytes_Size(pwrt) > 0) {
+ PyObject *wr;
+
+ wr = _PyObject_CallMethodOneArg(self->stream, state->str_write, pwrt);
+ if (wr == NULL) {
+ Py_DECREF(pwrt);
+ return NULL;
+ }
+ }
+ Py_DECREF(pwrt);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+mbstreamwriter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ MultibyteStreamWriterObject *self;
+ PyObject *stream, *codec = NULL;
+ char *errors = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s:StreamWriter",
+ streamkwarglist, &stream, &errors))
+ return NULL;
+
+ self = (MultibyteStreamWriterObject *)type->tp_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ codec = PyObject_GetAttrString((PyObject *)type, "codec");
+ if (codec == NULL)
+ goto errorexit;
+
+ module_state *state = find_state_by_def(type);
+ if (!MultibyteCodec_Check(state, codec)) {
+ PyErr_SetString(PyExc_TypeError, "codec is unexpected type");
+ goto errorexit;
+ }
+
+ self->codec = ((MultibyteCodecObject *)codec)->codec;
+ self->stream = Py_NewRef(stream);
+ self->pending = NULL;
+ self->errors = internal_error_callback(errors);
+ if (self->errors == NULL)
+ goto errorexit;
+ if (self->codec->encinit != NULL &&
+ self->codec->encinit(&self->state, self->codec) != 0)
+ goto errorexit;
+
+ Py_DECREF(codec);
+ return (PyObject *)self;
+
+errorexit:
+ Py_XDECREF(self);
+ Py_XDECREF(codec);
+ return NULL;
+}
+
+static int
+mbstreamwriter_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
+mbstreamwriter_traverse(MultibyteStreamWriterObject *self,
+ visitproc visit, void *arg)
+{
+ if (ERROR_ISCUSTOM(self->errors))
+ Py_VISIT(self->errors);
+ Py_VISIT(self->stream);
+ return 0;
+}
+
+static void
+mbstreamwriter_dealloc(MultibyteStreamWriterObject *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ ERROR_DECREF(self->errors);
+ Py_XDECREF(self->stream);
+ tp->tp_free(self);
+ Py_DECREF(tp);
+}
+
+static struct PyMethodDef mbstreamwriter_methods[] = {
+ _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF
+ _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF
+ {NULL, NULL},
+};
+
+static PyMemberDef mbstreamwriter_members[] = {
+ {"stream", T_OBJECT,
+ offsetof(MultibyteStreamWriterObject, stream),
+ READONLY, NULL},
+ {NULL,}
+};
+
+static PyType_Slot writer_slots[] = {
+ {Py_tp_dealloc, mbstreamwriter_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, mbstreamwriter_traverse},
+ {Py_tp_methods, mbstreamwriter_methods},
+ {Py_tp_members, mbstreamwriter_members},
+ {Py_tp_getset, codecctx_getsets},
+ {Py_tp_init, mbstreamwriter_init},
+ {Py_tp_new, mbstreamwriter_new},
+ {0, NULL},
+};
+
+static PyType_Spec writer_spec = {
+ .name = MODULE_NAME ".MultibyteStreamWriter",
+ .basicsize = sizeof(MultibyteStreamWriterObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = writer_slots,
+};
+
+
+/*[clinic input]
+_multibytecodec.__create_codec
+
+ arg: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+_multibytecodec___create_codec(PyObject *module, PyObject *arg)
+/*[clinic end generated code: output=cfa3dce8260e809d input=6840b2a6b183fcfa]*/
+{
+ MultibyteCodecObject *self;
+
+ if (!PyCapsule_IsValid(arg, CODEC_CAPSULE)) {
+ PyErr_SetString(PyExc_ValueError, "argument type invalid");
+ return NULL;
+ }
+
+ codec_capsule *data = PyCapsule_GetPointer(arg, CODEC_CAPSULE);
+ const MultibyteCodec *codec = data->codec;
+ if (codec->codecinit != NULL && codec->codecinit(codec) != 0)
+ return NULL;
+
+ module_state *state = get_module_state(module);
+ self = PyObject_GC_New(MultibyteCodecObject, state->multibytecodec_type);
+ if (self == NULL)
+ return NULL;
+ self->codec = codec;
+ self->cjk_module = Py_NewRef(data->cjk_module);
+
+ PyObject_GC_Track(self);
+ return (PyObject *)self;
+}
+
+static int
+_multibytecodec_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ module_state *state = get_module_state(mod);
+ Py_VISIT(state->multibytecodec_type);
+ Py_VISIT(state->encoder_type);
+ Py_VISIT(state->decoder_type);
+ Py_VISIT(state->reader_type);
+ Py_VISIT(state->writer_type);
+ return 0;
+}
+
+static int
+_multibytecodec_clear(PyObject *mod)
+{
+ module_state *state = get_module_state(mod);
+ Py_CLEAR(state->multibytecodec_type);
+ Py_CLEAR(state->encoder_type);
+ Py_CLEAR(state->decoder_type);
+ Py_CLEAR(state->reader_type);
+ Py_CLEAR(state->writer_type);
+ Py_CLEAR(state->str_write);
+ return 0;
+}
+
+static void
+_multibytecodec_free(void *mod)
+{
+ _multibytecodec_clear((PyObject *)mod);
+}
+
+#define CREATE_TYPE(module, type, spec) \
+ do { \
+ type = (PyTypeObject *)PyType_FromModuleAndSpec(module, spec, NULL); \
+ if (!type) { \
+ return -1; \
+ } \
+ } while (0)
+
+#define ADD_TYPE(module, type) \
+ do { \
+ if (PyModule_AddType(module, type) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+static int
+_multibytecodec_exec(PyObject *mod)
+{
+ module_state *state = get_module_state(mod);
+ state->str_write = PyUnicode_InternFromString("write");
+ if (state->str_write == NULL) {
+ return -1;
+ }
+ CREATE_TYPE(mod, state->multibytecodec_type, &multibytecodec_spec);
+ CREATE_TYPE(mod, state->encoder_type, &encoder_spec);
+ CREATE_TYPE(mod, state->decoder_type, &decoder_spec);
+ CREATE_TYPE(mod, state->reader_type, &reader_spec);
+ CREATE_TYPE(mod, state->writer_type, &writer_spec);
+
+ ADD_TYPE(mod, state->encoder_type);
+ ADD_TYPE(mod, state->decoder_type);
+ ADD_TYPE(mod, state->reader_type);
+ ADD_TYPE(mod, state->writer_type);
+ return 0;
+}
+
+#undef CREATE_TYPE
+#undef ADD_TYPE
+
+static struct PyMethodDef _multibytecodec_methods[] = {
+ _MULTIBYTECODEC___CREATE_CODEC_METHODDEF
+ {NULL, NULL},
+};
+
+static PyModuleDef_Slot _multibytecodec_slots[] = {
+ {Py_mod_exec, _multibytecodec_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _multibytecodecmodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_multibytecodec",
+ .m_size = sizeof(module_state),
+ .m_methods = _multibytecodec_methods,
+ .m_slots = _multibytecodec_slots,
+ .m_traverse = _multibytecodec_traverse,
+ .m_clear = _multibytecodec_clear,
+ .m_free = _multibytecodec_free,
+};
+
+PyMODINIT_FUNC
+PyInit__multibytecodec(void)
+{
+ return PyModuleDef_Init(&_multibytecodecmodule);
+}
diff --git a/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h
new file mode 100644
index 00000000000..f59362205d2
--- /dev/null
+++ b/contrib/tools/python3/Modules/cjkcodecs/multibytecodec.h
@@ -0,0 +1,150 @@
+/*
+ * multibytecodec.h: Common Multibyte Codec Implementation
+ *
+ * Written by Hye-Shik Chang <[email protected]>
+ */
+
+#ifndef _PYTHON_MULTIBYTECODEC_H_
+#define _PYTHON_MULTIBYTECODEC_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef uint16_t
+typedef uint16_t ucs2_t, DBCHAR;
+#else
+typedef unsigned short ucs2_t, DBCHAR;
+#endif
+
+/*
+ * A struct that provides 8 bytes of state for multibyte
+ * codecs. Codecs are free to use this how they want. Note: if you
+ * need to add a new field to this struct, ensure that its byte order
+ * is independent of CPU endianness so that the return value of
+ * getstate doesn't differ between little and big endian CPUs.
+ */
+typedef struct {
+ unsigned char c[8];
+} MultibyteCodec_State;
+
+struct _cjk_mod_state;
+struct _multibyte_codec;
+
+typedef int (*mbcodec_init)(const struct _multibyte_codec *codec);
+typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state,
+ const struct _multibyte_codec *codec,
+ int kind, const void *data,
+ Py_ssize_t *inpos, Py_ssize_t inlen,
+ unsigned char **outbuf, Py_ssize_t outleft,
+ int flags);
+typedef int (*mbencodeinit_func)(MultibyteCodec_State *state,
+ const struct _multibyte_codec *codec);
+typedef Py_ssize_t (*mbencodereset_func)(MultibyteCodec_State *state,
+ const struct _multibyte_codec *codec,
+ unsigned char **outbuf, Py_ssize_t outleft);
+typedef Py_ssize_t (*mbdecode_func)(MultibyteCodec_State *state,
+ const struct _multibyte_codec *codec,
+ const unsigned char **inbuf, Py_ssize_t inleft,
+ _PyUnicodeWriter *writer);
+typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state,
+ const struct _multibyte_codec *codec);
+typedef Py_ssize_t (*mbdecodereset_func)(MultibyteCodec_State *state,
+ const struct _multibyte_codec *codec);
+
+typedef struct _multibyte_codec {
+ const char *encoding;
+ const void *config;
+ mbcodec_init codecinit;
+ mbencode_func encode;
+ mbencodeinit_func encinit;
+ mbencodereset_func encreset;
+ mbdecode_func decode;
+ mbdecodeinit_func decinit;
+ mbdecodereset_func decreset;
+ struct _cjk_mod_state *modstate;
+} MultibyteCodec;
+
+typedef struct {
+ PyObject_HEAD
+ const MultibyteCodec *codec;
+ PyObject *cjk_module;
+} MultibyteCodecObject;
+
+#define MultibyteCodec_Check(state, op) Py_IS_TYPE((op), state->multibytecodec_type)
+
+#define _MultibyteStatefulCodec_HEAD \
+ PyObject_HEAD \
+ const MultibyteCodec *codec; \
+ MultibyteCodec_State state; \
+ PyObject *errors;
+typedef struct {
+ _MultibyteStatefulCodec_HEAD
+} MultibyteStatefulCodecContext;
+
+#define MAXENCPENDING 2
+#define _MultibyteStatefulEncoder_HEAD \
+ _MultibyteStatefulCodec_HEAD \
+ PyObject *pending;
+typedef struct {
+ _MultibyteStatefulEncoder_HEAD
+} MultibyteStatefulEncoderContext;
+
+#define MAXDECPENDING 8
+#define _MultibyteStatefulDecoder_HEAD \
+ _MultibyteStatefulCodec_HEAD \
+ unsigned char pending[MAXDECPENDING]; \
+ Py_ssize_t pendingsize;
+typedef struct {
+ _MultibyteStatefulDecoder_HEAD
+} MultibyteStatefulDecoderContext;
+
+typedef struct {
+ _MultibyteStatefulEncoder_HEAD
+} MultibyteIncrementalEncoderObject;
+
+typedef struct {
+ _MultibyteStatefulDecoder_HEAD
+} MultibyteIncrementalDecoderObject;
+
+typedef struct {
+ _MultibyteStatefulDecoder_HEAD
+ PyObject *stream;
+} MultibyteStreamReaderObject;
+
+typedef struct {
+ _MultibyteStatefulEncoder_HEAD
+ PyObject *stream;
+} MultibyteStreamWriterObject;
+
+/* positive values for illegal sequences */
+#define MBERR_TOOSMALL (-1) /* insufficient output buffer space */
+#define MBERR_TOOFEW (-2) /* incomplete input buffer */
+#define MBERR_INTERNAL (-3) /* internal runtime error */
+#define MBERR_EXCEPTION (-4) /* an exception has been raised */
+
+#define ERROR_STRICT (PyObject *)(1)
+#define ERROR_IGNORE (PyObject *)(2)
+#define ERROR_REPLACE (PyObject *)(3)
+#define ERROR_ISCUSTOM(p) ((p) < ERROR_STRICT || ERROR_REPLACE < (p))
+#define ERROR_DECREF(p) \
+ do { \
+ if (p != NULL && ERROR_ISCUSTOM(p)) \
+ Py_DECREF(p); \
+ } while (0);
+
+#define MBENC_FLUSH 0x0001 /* encode all characters encodable */
+#define MBENC_MAX MBENC_FLUSH
+
+typedef struct {
+ const MultibyteCodec *codec;
+ PyObject *cjk_module;
+} codec_capsule;
+
+#define MAP_CAPSULE "multibytecodec.map"
+#define CODEC_CAPSULE "multibytecodec.codec"
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/contrib/tools/python3/Modules/clinic/_abc.c.h b/contrib/tools/python3/Modules/clinic/_abc.c.h
new file mode 100644
index 00000000000..2adec818c91
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_abc.c.h
@@ -0,0 +1,168 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_abc__reset_registry__doc__,
+"_reset_registry($module, self, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper to reset registry of a given class.\n"
+"\n"
+"Should be only used by refleak.py");
+
+#define _ABC__RESET_REGISTRY_METHODDEF \
+ {"_reset_registry", (PyCFunction)_abc__reset_registry, METH_O, _abc__reset_registry__doc__},
+
+PyDoc_STRVAR(_abc__reset_caches__doc__,
+"_reset_caches($module, self, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper to reset both caches of a given class.\n"
+"\n"
+"Should be only used by refleak.py");
+
+#define _ABC__RESET_CACHES_METHODDEF \
+ {"_reset_caches", (PyCFunction)_abc__reset_caches, METH_O, _abc__reset_caches__doc__},
+
+PyDoc_STRVAR(_abc__get_dump__doc__,
+"_get_dump($module, self, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper for cache and registry debugging.\n"
+"\n"
+"Return shallow copies of registry, of both caches, and\n"
+"negative cache version. Don\'t call this function directly,\n"
+"instead use ABC._dump_registry() for a nice repr.");
+
+#define _ABC__GET_DUMP_METHODDEF \
+ {"_get_dump", (PyCFunction)_abc__get_dump, METH_O, _abc__get_dump__doc__},
+
+PyDoc_STRVAR(_abc__abc_init__doc__,
+"_abc_init($module, self, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper for class set-up. Should be never used outside abc module.");
+
+#define _ABC__ABC_INIT_METHODDEF \
+ {"_abc_init", (PyCFunction)_abc__abc_init, METH_O, _abc__abc_init__doc__},
+
+PyDoc_STRVAR(_abc__abc_register__doc__,
+"_abc_register($module, self, subclass, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper for subclasss registration. Should be never used outside abc module.");
+
+#define _ABC__ABC_REGISTER_METHODDEF \
+ {"_abc_register", _PyCFunction_CAST(_abc__abc_register), METH_FASTCALL, _abc__abc_register__doc__},
+
+static PyObject *
+_abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass);
+
+static PyObject *
+_abc__abc_register(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *self;
+ PyObject *subclass;
+
+ if (!_PyArg_CheckPositional("_abc_register", nargs, 2, 2)) {
+ goto exit;
+ }
+ self = args[0];
+ subclass = args[1];
+ return_value = _abc__abc_register_impl(module, self, subclass);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_abc__abc_instancecheck__doc__,
+"_abc_instancecheck($module, self, instance, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper for instance checks. Should be never used outside abc module.");
+
+#define _ABC__ABC_INSTANCECHECK_METHODDEF \
+ {"_abc_instancecheck", _PyCFunction_CAST(_abc__abc_instancecheck), METH_FASTCALL, _abc__abc_instancecheck__doc__},
+
+static PyObject *
+_abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
+ PyObject *instance);
+
+static PyObject *
+_abc__abc_instancecheck(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *self;
+ PyObject *instance;
+
+ if (!_PyArg_CheckPositional("_abc_instancecheck", nargs, 2, 2)) {
+ goto exit;
+ }
+ self = args[0];
+ instance = args[1];
+ return_value = _abc__abc_instancecheck_impl(module, self, instance);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_abc__abc_subclasscheck__doc__,
+"_abc_subclasscheck($module, self, subclass, /)\n"
+"--\n"
+"\n"
+"Internal ABC helper for subclasss checks. Should be never used outside abc module.");
+
+#define _ABC__ABC_SUBCLASSCHECK_METHODDEF \
+ {"_abc_subclasscheck", _PyCFunction_CAST(_abc__abc_subclasscheck), METH_FASTCALL, _abc__abc_subclasscheck__doc__},
+
+static PyObject *
+_abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
+ PyObject *subclass);
+
+static PyObject *
+_abc__abc_subclasscheck(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *self;
+ PyObject *subclass;
+
+ if (!_PyArg_CheckPositional("_abc_subclasscheck", nargs, 2, 2)) {
+ goto exit;
+ }
+ self = args[0];
+ subclass = args[1];
+ return_value = _abc__abc_subclasscheck_impl(module, self, subclass);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_abc_get_cache_token__doc__,
+"get_cache_token($module, /)\n"
+"--\n"
+"\n"
+"Returns the current ABC cache token.\n"
+"\n"
+"The token is an opaque object (supporting equality testing) identifying the\n"
+"current version of the ABC cache for virtual subclasses. The token changes\n"
+"with every call to register() on any ABC.");
+
+#define _ABC_GET_CACHE_TOKEN_METHODDEF \
+ {"get_cache_token", (PyCFunction)_abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__},
+
+static PyObject *
+_abc_get_cache_token_impl(PyObject *module);
+
+static PyObject *
+_abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _abc_get_cache_token_impl(module);
+}
+/*[clinic end generated code: output=c2e69611a495c98d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_asynciomodule.c.h b/contrib/tools/python3/Modules/clinic/_asynciomodule.c.h
new file mode 100644
index 00000000000..860d55cb3bb
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_asynciomodule.c.h
@@ -0,0 +1,1490 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_asyncio_Future___init____doc__,
+"Future(*, loop=None)\n"
+"--\n"
+"\n"
+"This class is *almost* compatible with concurrent.futures.Future.\n"
+"\n"
+" Differences:\n"
+"\n"
+" - result() and exception() do not take a timeout argument and\n"
+" raise an exception when the future isn\'t done yet.\n"
+"\n"
+" - Callbacks registered with add_done_callback() are always called\n"
+" via the event loop\'s call_soon_threadsafe().\n"
+"\n"
+" - This class is not compatible with the wait() and as_completed()\n"
+" methods in the concurrent.futures package.");
+
+static int
+_asyncio_Future___init___impl(FutureObj *self, PyObject *loop);
+
+static int
+_asyncio_Future___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(loop), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"loop", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Future",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *loop = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 0, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ loop = fastargs[0];
+skip_optional_kwonly:
+ return_value = _asyncio_Future___init___impl((FutureObj *)self, loop);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Future_result__doc__,
+"result($self, /)\n"
+"--\n"
+"\n"
+"Return the result this future represents.\n"
+"\n"
+"If the future has been cancelled, raises CancelledError. If the\n"
+"future\'s result isn\'t yet available, raises InvalidStateError. If\n"
+"the future is done and has an exception set, this exception is raised.");
+
+#define _ASYNCIO_FUTURE_RESULT_METHODDEF \
+ {"result", (PyCFunction)_asyncio_Future_result, METH_NOARGS, _asyncio_Future_result__doc__},
+
+static PyObject *
+_asyncio_Future_result_impl(FutureObj *self);
+
+static PyObject *
+_asyncio_Future_result(FutureObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Future_result_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Future_exception__doc__,
+"exception($self, /)\n"
+"--\n"
+"\n"
+"Return the exception that was set on this future.\n"
+"\n"
+"The exception (or None if no exception was set) is returned only if\n"
+"the future is done. If the future has been cancelled, raises\n"
+"CancelledError. If the future isn\'t done yet, raises\n"
+"InvalidStateError.");
+
+#define _ASYNCIO_FUTURE_EXCEPTION_METHODDEF \
+ {"exception", _PyCFunction_CAST(_asyncio_Future_exception), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_exception__doc__},
+
+static PyObject *
+_asyncio_Future_exception_impl(FutureObj *self, PyTypeObject *cls);
+
+static PyObject *
+_asyncio_Future_exception(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "exception() takes no arguments");
+ return NULL;
+ }
+ return _asyncio_Future_exception_impl(self, cls);
+}
+
+PyDoc_STRVAR(_asyncio_Future_set_result__doc__,
+"set_result($self, result, /)\n"
+"--\n"
+"\n"
+"Mark the future done and set its result.\n"
+"\n"
+"If the future is already done when this method is called, raises\n"
+"InvalidStateError.");
+
+#define _ASYNCIO_FUTURE_SET_RESULT_METHODDEF \
+ {"set_result", _PyCFunction_CAST(_asyncio_Future_set_result), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_set_result__doc__},
+
+static PyObject *
+_asyncio_Future_set_result_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *result);
+
+static PyObject *
+_asyncio_Future_set_result(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "set_result",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *result;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ result = args[0];
+ return_value = _asyncio_Future_set_result_impl(self, cls, result);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Future_set_exception__doc__,
+"set_exception($self, exception, /)\n"
+"--\n"
+"\n"
+"Mark the future done and set an exception.\n"
+"\n"
+"If the future is already done when this method is called, raises\n"
+"InvalidStateError.");
+
+#define _ASYNCIO_FUTURE_SET_EXCEPTION_METHODDEF \
+ {"set_exception", _PyCFunction_CAST(_asyncio_Future_set_exception), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_set_exception__doc__},
+
+static PyObject *
+_asyncio_Future_set_exception_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *exception);
+
+static PyObject *
+_asyncio_Future_set_exception(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "set_exception",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *exception;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ exception = args[0];
+ return_value = _asyncio_Future_set_exception_impl(self, cls, exception);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Future_add_done_callback__doc__,
+"add_done_callback($self, fn, /, *, context=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Add a callback to be run when the future becomes done.\n"
+"\n"
+"The callback is called with a single argument - the future object. If\n"
+"the future is already done when this is called, the callback is\n"
+"scheduled with call_soon.");
+
+#define _ASYNCIO_FUTURE_ADD_DONE_CALLBACK_METHODDEF \
+ {"add_done_callback", _PyCFunction_CAST(_asyncio_Future_add_done_callback), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_add_done_callback__doc__},
+
+static PyObject *
+_asyncio_Future_add_done_callback_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *fn, PyObject *context);
+
+static PyObject *
+_asyncio_Future_add_done_callback(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(context), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "context", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "add_done_callback",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *fn;
+ PyObject *context = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fn = args[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ context = args[1];
+skip_optional_kwonly:
+ return_value = _asyncio_Future_add_done_callback_impl(self, cls, fn, context);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Future_remove_done_callback__doc__,
+"remove_done_callback($self, fn, /)\n"
+"--\n"
+"\n"
+"Remove all instances of a callback from the \"call when done\" list.\n"
+"\n"
+"Returns the number of callbacks removed.");
+
+#define _ASYNCIO_FUTURE_REMOVE_DONE_CALLBACK_METHODDEF \
+ {"remove_done_callback", _PyCFunction_CAST(_asyncio_Future_remove_done_callback), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_remove_done_callback__doc__},
+
+static PyObject *
+_asyncio_Future_remove_done_callback_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *fn);
+
+static PyObject *
+_asyncio_Future_remove_done_callback(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "remove_done_callback",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *fn;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fn = args[0];
+ return_value = _asyncio_Future_remove_done_callback_impl(self, cls, fn);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Future_cancel__doc__,
+"cancel($self, /, msg=None)\n"
+"--\n"
+"\n"
+"Cancel the future and schedule callbacks.\n"
+"\n"
+"If the future is already done or cancelled, return False. Otherwise,\n"
+"change the future\'s state to cancelled, schedule the callbacks and\n"
+"return True.");
+
+#define _ASYNCIO_FUTURE_CANCEL_METHODDEF \
+ {"cancel", _PyCFunction_CAST(_asyncio_Future_cancel), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_cancel__doc__},
+
+static PyObject *
+_asyncio_Future_cancel_impl(FutureObj *self, PyTypeObject *cls,
+ PyObject *msg);
+
+static PyObject *
+_asyncio_Future_cancel(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(msg), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"msg", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "cancel",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *msg = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ msg = args[0];
+skip_optional_pos:
+ return_value = _asyncio_Future_cancel_impl(self, cls, msg);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Future_cancelled__doc__,
+"cancelled($self, /)\n"
+"--\n"
+"\n"
+"Return True if the future was cancelled.");
+
+#define _ASYNCIO_FUTURE_CANCELLED_METHODDEF \
+ {"cancelled", (PyCFunction)_asyncio_Future_cancelled, METH_NOARGS, _asyncio_Future_cancelled__doc__},
+
+static PyObject *
+_asyncio_Future_cancelled_impl(FutureObj *self);
+
+static PyObject *
+_asyncio_Future_cancelled(FutureObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Future_cancelled_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Future_done__doc__,
+"done($self, /)\n"
+"--\n"
+"\n"
+"Return True if the future is done.\n"
+"\n"
+"Done means either that a result / exception are available, or that the\n"
+"future was cancelled.");
+
+#define _ASYNCIO_FUTURE_DONE_METHODDEF \
+ {"done", (PyCFunction)_asyncio_Future_done, METH_NOARGS, _asyncio_Future_done__doc__},
+
+static PyObject *
+_asyncio_Future_done_impl(FutureObj *self);
+
+static PyObject *
+_asyncio_Future_done(FutureObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Future_done_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Future_get_loop__doc__,
+"get_loop($self, /)\n"
+"--\n"
+"\n"
+"Return the event loop the Future is bound to.");
+
+#define _ASYNCIO_FUTURE_GET_LOOP_METHODDEF \
+ {"get_loop", _PyCFunction_CAST(_asyncio_Future_get_loop), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Future_get_loop__doc__},
+
+static PyObject *
+_asyncio_Future_get_loop_impl(FutureObj *self, PyTypeObject *cls);
+
+static PyObject *
+_asyncio_Future_get_loop(FutureObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "get_loop() takes no arguments");
+ return NULL;
+ }
+ return _asyncio_Future_get_loop_impl(self, cls);
+}
+
+PyDoc_STRVAR(_asyncio_Future__make_cancelled_error__doc__,
+"_make_cancelled_error($self, /)\n"
+"--\n"
+"\n"
+"Create the CancelledError to raise if the Future is cancelled.\n"
+"\n"
+"This should only be called once when handling a cancellation since\n"
+"it erases the context exception value.");
+
+#define _ASYNCIO_FUTURE__MAKE_CANCELLED_ERROR_METHODDEF \
+ {"_make_cancelled_error", (PyCFunction)_asyncio_Future__make_cancelled_error, METH_NOARGS, _asyncio_Future__make_cancelled_error__doc__},
+
+static PyObject *
+_asyncio_Future__make_cancelled_error_impl(FutureObj *self);
+
+static PyObject *
+_asyncio_Future__make_cancelled_error(FutureObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Future__make_cancelled_error_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task___init____doc__,
+"Task(coro, *, loop=None, name=None, context=None, eager_start=False)\n"
+"--\n"
+"\n"
+"A coroutine wrapped in a Future.");
+
+static int
+_asyncio_Task___init___impl(TaskObj *self, PyObject *coro, PyObject *loop,
+ PyObject *name, PyObject *context,
+ int eager_start);
+
+static int
+_asyncio_Task___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(coro), &_Py_ID(loop), &_Py_ID(name), &_Py_ID(context), &_Py_ID(eager_start), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"coro", "loop", "name", "context", "eager_start", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *coro;
+ PyObject *loop = Py_None;
+ PyObject *name = Py_None;
+ PyObject *context = Py_None;
+ int eager_start = 0;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ coro = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (fastargs[1]) {
+ loop = fastargs[1];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[2]) {
+ name = fastargs[2];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[3]) {
+ context = fastargs[3];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ eager_start = PyObject_IsTrue(fastargs[4]);
+ if (eager_start < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _asyncio_Task___init___impl((TaskObj *)self, coro, loop, name, context, eager_start);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Task__make_cancelled_error__doc__,
+"_make_cancelled_error($self, /)\n"
+"--\n"
+"\n"
+"Create the CancelledError to raise if the Task is cancelled.\n"
+"\n"
+"This should only be called once when handling a cancellation since\n"
+"it erases the context exception value.");
+
+#define _ASYNCIO_TASK__MAKE_CANCELLED_ERROR_METHODDEF \
+ {"_make_cancelled_error", (PyCFunction)_asyncio_Task__make_cancelled_error, METH_NOARGS, _asyncio_Task__make_cancelled_error__doc__},
+
+static PyObject *
+_asyncio_Task__make_cancelled_error_impl(TaskObj *self);
+
+static PyObject *
+_asyncio_Task__make_cancelled_error(TaskObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Task__make_cancelled_error_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task_cancel__doc__,
+"cancel($self, /, msg=None)\n"
+"--\n"
+"\n"
+"Request that this task cancel itself.\n"
+"\n"
+"This arranges for a CancelledError to be thrown into the\n"
+"wrapped coroutine on the next cycle through the event loop.\n"
+"The coroutine then has a chance to clean up or even deny\n"
+"the request using try/except/finally.\n"
+"\n"
+"Unlike Future.cancel, this does not guarantee that the\n"
+"task will be cancelled: the exception might be caught and\n"
+"acted upon, delaying cancellation of the task or preventing\n"
+"cancellation completely. The task may also return a value or\n"
+"raise a different exception.\n"
+"\n"
+"Immediately after this method is called, Task.cancelled() will\n"
+"not return True (unless the task was already cancelled). A\n"
+"task will be marked as cancelled when the wrapped coroutine\n"
+"terminates with a CancelledError exception (even if cancel()\n"
+"was not called).\n"
+"\n"
+"This also increases the task\'s count of cancellation requests.");
+
+#define _ASYNCIO_TASK_CANCEL_METHODDEF \
+ {"cancel", _PyCFunction_CAST(_asyncio_Task_cancel), METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_cancel__doc__},
+
+static PyObject *
+_asyncio_Task_cancel_impl(TaskObj *self, PyObject *msg);
+
+static PyObject *
+_asyncio_Task_cancel(TaskObj *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(msg), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"msg", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "cancel",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *msg = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ msg = args[0];
+skip_optional_pos:
+ return_value = _asyncio_Task_cancel_impl(self, msg);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Task_cancelling__doc__,
+"cancelling($self, /)\n"
+"--\n"
+"\n"
+"Return the count of the task\'s cancellation requests.\n"
+"\n"
+"This count is incremented when .cancel() is called\n"
+"and may be decremented using .uncancel().");
+
+#define _ASYNCIO_TASK_CANCELLING_METHODDEF \
+ {"cancelling", (PyCFunction)_asyncio_Task_cancelling, METH_NOARGS, _asyncio_Task_cancelling__doc__},
+
+static PyObject *
+_asyncio_Task_cancelling_impl(TaskObj *self);
+
+static PyObject *
+_asyncio_Task_cancelling(TaskObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Task_cancelling_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task_uncancel__doc__,
+"uncancel($self, /)\n"
+"--\n"
+"\n"
+"Decrement the task\'s count of cancellation requests.\n"
+"\n"
+"This should be used by tasks that catch CancelledError\n"
+"and wish to continue indefinitely until they are cancelled again.\n"
+"\n"
+"Returns the remaining number of cancellation requests.");
+
+#define _ASYNCIO_TASK_UNCANCEL_METHODDEF \
+ {"uncancel", (PyCFunction)_asyncio_Task_uncancel, METH_NOARGS, _asyncio_Task_uncancel__doc__},
+
+static PyObject *
+_asyncio_Task_uncancel_impl(TaskObj *self);
+
+static PyObject *
+_asyncio_Task_uncancel(TaskObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Task_uncancel_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task_get_stack__doc__,
+"get_stack($self, /, *, limit=None)\n"
+"--\n"
+"\n"
+"Return the list of stack frames for this task\'s coroutine.\n"
+"\n"
+"If the coroutine is not done, this returns the stack where it is\n"
+"suspended. If the coroutine has completed successfully or was\n"
+"cancelled, this returns an empty list. If the coroutine was\n"
+"terminated by an exception, this returns the list of traceback\n"
+"frames.\n"
+"\n"
+"The frames are always ordered from oldest to newest.\n"
+"\n"
+"The optional limit gives the maximum number of frames to\n"
+"return; by default all available frames are returned. Its\n"
+"meaning differs depending on whether a stack or a traceback is\n"
+"returned: the newest frames of a stack are returned, but the\n"
+"oldest frames of a traceback are returned. (This matches the\n"
+"behavior of the traceback module.)\n"
+"\n"
+"For reasons beyond our control, only one stack frame is\n"
+"returned for a suspended coroutine.");
+
+#define _ASYNCIO_TASK_GET_STACK_METHODDEF \
+ {"get_stack", _PyCFunction_CAST(_asyncio_Task_get_stack), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_get_stack__doc__},
+
+static PyObject *
+_asyncio_Task_get_stack_impl(TaskObj *self, PyTypeObject *cls,
+ PyObject *limit);
+
+static PyObject *
+_asyncio_Task_get_stack(TaskObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(limit), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"limit", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get_stack",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *limit = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ limit = args[0];
+skip_optional_kwonly:
+ return_value = _asyncio_Task_get_stack_impl(self, cls, limit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Task_print_stack__doc__,
+"print_stack($self, /, *, limit=None, file=None)\n"
+"--\n"
+"\n"
+"Print the stack or traceback for this task\'s coroutine.\n"
+"\n"
+"This produces output similar to that of the traceback module,\n"
+"for the frames retrieved by get_stack(). The limit argument\n"
+"is passed to get_stack(). The file argument is an I/O stream\n"
+"to which the output is written; by default output is written\n"
+"to sys.stderr.");
+
+#define _ASYNCIO_TASK_PRINT_STACK_METHODDEF \
+ {"print_stack", _PyCFunction_CAST(_asyncio_Task_print_stack), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _asyncio_Task_print_stack__doc__},
+
+static PyObject *
+_asyncio_Task_print_stack_impl(TaskObj *self, PyTypeObject *cls,
+ PyObject *limit, PyObject *file);
+
+static PyObject *
+_asyncio_Task_print_stack(TaskObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(limit), &_Py_ID(file), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"limit", "file", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "print_stack",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *limit = Py_None;
+ PyObject *file = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[0]) {
+ limit = args[0];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ file = args[1];
+skip_optional_kwonly:
+ return_value = _asyncio_Task_print_stack_impl(self, cls, limit, file);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_Task_set_result__doc__,
+"set_result($self, result, /)\n"
+"--\n"
+"\n");
+
+#define _ASYNCIO_TASK_SET_RESULT_METHODDEF \
+ {"set_result", (PyCFunction)_asyncio_Task_set_result, METH_O, _asyncio_Task_set_result__doc__},
+
+PyDoc_STRVAR(_asyncio_Task_set_exception__doc__,
+"set_exception($self, exception, /)\n"
+"--\n"
+"\n");
+
+#define _ASYNCIO_TASK_SET_EXCEPTION_METHODDEF \
+ {"set_exception", (PyCFunction)_asyncio_Task_set_exception, METH_O, _asyncio_Task_set_exception__doc__},
+
+PyDoc_STRVAR(_asyncio_Task_get_coro__doc__,
+"get_coro($self, /)\n"
+"--\n"
+"\n");
+
+#define _ASYNCIO_TASK_GET_CORO_METHODDEF \
+ {"get_coro", (PyCFunction)_asyncio_Task_get_coro, METH_NOARGS, _asyncio_Task_get_coro__doc__},
+
+static PyObject *
+_asyncio_Task_get_coro_impl(TaskObj *self);
+
+static PyObject *
+_asyncio_Task_get_coro(TaskObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Task_get_coro_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task_get_context__doc__,
+"get_context($self, /)\n"
+"--\n"
+"\n");
+
+#define _ASYNCIO_TASK_GET_CONTEXT_METHODDEF \
+ {"get_context", (PyCFunction)_asyncio_Task_get_context, METH_NOARGS, _asyncio_Task_get_context__doc__},
+
+static PyObject *
+_asyncio_Task_get_context_impl(TaskObj *self);
+
+static PyObject *
+_asyncio_Task_get_context(TaskObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Task_get_context_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task_get_name__doc__,
+"get_name($self, /)\n"
+"--\n"
+"\n");
+
+#define _ASYNCIO_TASK_GET_NAME_METHODDEF \
+ {"get_name", (PyCFunction)_asyncio_Task_get_name, METH_NOARGS, _asyncio_Task_get_name__doc__},
+
+static PyObject *
+_asyncio_Task_get_name_impl(TaskObj *self);
+
+static PyObject *
+_asyncio_Task_get_name(TaskObj *self, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_Task_get_name_impl(self);
+}
+
+PyDoc_STRVAR(_asyncio_Task_set_name__doc__,
+"set_name($self, value, /)\n"
+"--\n"
+"\n");
+
+#define _ASYNCIO_TASK_SET_NAME_METHODDEF \
+ {"set_name", (PyCFunction)_asyncio_Task_set_name, METH_O, _asyncio_Task_set_name__doc__},
+
+PyDoc_STRVAR(_asyncio__get_running_loop__doc__,
+"_get_running_loop($module, /)\n"
+"--\n"
+"\n"
+"Return the running event loop or None.\n"
+"\n"
+"This is a low-level function intended to be used by event loops.\n"
+"This function is thread-specific.");
+
+#define _ASYNCIO__GET_RUNNING_LOOP_METHODDEF \
+ {"_get_running_loop", (PyCFunction)_asyncio__get_running_loop, METH_NOARGS, _asyncio__get_running_loop__doc__},
+
+static PyObject *
+_asyncio__get_running_loop_impl(PyObject *module);
+
+static PyObject *
+_asyncio__get_running_loop(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio__get_running_loop_impl(module);
+}
+
+PyDoc_STRVAR(_asyncio__set_running_loop__doc__,
+"_set_running_loop($module, loop, /)\n"
+"--\n"
+"\n"
+"Set the running event loop.\n"
+"\n"
+"This is a low-level function intended to be used by event loops.\n"
+"This function is thread-specific.");
+
+#define _ASYNCIO__SET_RUNNING_LOOP_METHODDEF \
+ {"_set_running_loop", (PyCFunction)_asyncio__set_running_loop, METH_O, _asyncio__set_running_loop__doc__},
+
+PyDoc_STRVAR(_asyncio_get_event_loop__doc__,
+"get_event_loop($module, /)\n"
+"--\n"
+"\n"
+"Return an asyncio event loop.\n"
+"\n"
+"When called from a coroutine or a callback (e.g. scheduled with\n"
+"call_soon or similar API), this function will always return the\n"
+"running event loop.\n"
+"\n"
+"If there is no running event loop set, the function will return\n"
+"the result of `get_event_loop_policy().get_event_loop()` call.");
+
+#define _ASYNCIO_GET_EVENT_LOOP_METHODDEF \
+ {"get_event_loop", (PyCFunction)_asyncio_get_event_loop, METH_NOARGS, _asyncio_get_event_loop__doc__},
+
+static PyObject *
+_asyncio_get_event_loop_impl(PyObject *module);
+
+static PyObject *
+_asyncio_get_event_loop(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_get_event_loop_impl(module);
+}
+
+PyDoc_STRVAR(_asyncio_get_running_loop__doc__,
+"get_running_loop($module, /)\n"
+"--\n"
+"\n"
+"Return the running event loop. Raise a RuntimeError if there is none.\n"
+"\n"
+"This function is thread-specific.");
+
+#define _ASYNCIO_GET_RUNNING_LOOP_METHODDEF \
+ {"get_running_loop", (PyCFunction)_asyncio_get_running_loop, METH_NOARGS, _asyncio_get_running_loop__doc__},
+
+static PyObject *
+_asyncio_get_running_loop_impl(PyObject *module);
+
+static PyObject *
+_asyncio_get_running_loop(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _asyncio_get_running_loop_impl(module);
+}
+
+PyDoc_STRVAR(_asyncio__register_task__doc__,
+"_register_task($module, /, task)\n"
+"--\n"
+"\n"
+"Register a new task in asyncio as executed by loop.\n"
+"\n"
+"Returns None.");
+
+#define _ASYNCIO__REGISTER_TASK_METHODDEF \
+ {"_register_task", _PyCFunction_CAST(_asyncio__register_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__register_task__doc__},
+
+static PyObject *
+_asyncio__register_task_impl(PyObject *module, PyObject *task);
+
+static PyObject *
+_asyncio__register_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_register_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ task = args[0];
+ return_value = _asyncio__register_task_impl(module, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio__register_eager_task__doc__,
+"_register_eager_task($module, /, task)\n"
+"--\n"
+"\n"
+"Register a new task in asyncio as executed by loop.\n"
+"\n"
+"Returns None.");
+
+#define _ASYNCIO__REGISTER_EAGER_TASK_METHODDEF \
+ {"_register_eager_task", _PyCFunction_CAST(_asyncio__register_eager_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__register_eager_task__doc__},
+
+static PyObject *
+_asyncio__register_eager_task_impl(PyObject *module, PyObject *task);
+
+static PyObject *
+_asyncio__register_eager_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_register_eager_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ task = args[0];
+ return_value = _asyncio__register_eager_task_impl(module, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio__unregister_task__doc__,
+"_unregister_task($module, /, task)\n"
+"--\n"
+"\n"
+"Unregister a task.\n"
+"\n"
+"Returns None.");
+
+#define _ASYNCIO__UNREGISTER_TASK_METHODDEF \
+ {"_unregister_task", _PyCFunction_CAST(_asyncio__unregister_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__unregister_task__doc__},
+
+static PyObject *
+_asyncio__unregister_task_impl(PyObject *module, PyObject *task);
+
+static PyObject *
+_asyncio__unregister_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_unregister_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ task = args[0];
+ return_value = _asyncio__unregister_task_impl(module, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio__unregister_eager_task__doc__,
+"_unregister_eager_task($module, /, task)\n"
+"--\n"
+"\n"
+"Unregister a task.\n"
+"\n"
+"Returns None.");
+
+#define _ASYNCIO__UNREGISTER_EAGER_TASK_METHODDEF \
+ {"_unregister_eager_task", _PyCFunction_CAST(_asyncio__unregister_eager_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__unregister_eager_task__doc__},
+
+static PyObject *
+_asyncio__unregister_eager_task_impl(PyObject *module, PyObject *task);
+
+static PyObject *
+_asyncio__unregister_eager_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_unregister_eager_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ task = args[0];
+ return_value = _asyncio__unregister_eager_task_impl(module, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio__enter_task__doc__,
+"_enter_task($module, /, loop, task)\n"
+"--\n"
+"\n"
+"Enter into task execution or resume suspended task.\n"
+"\n"
+"Task belongs to loop.\n"
+"\n"
+"Returns None.");
+
+#define _ASYNCIO__ENTER_TASK_METHODDEF \
+ {"_enter_task", _PyCFunction_CAST(_asyncio__enter_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__enter_task__doc__},
+
+static PyObject *
+_asyncio__enter_task_impl(PyObject *module, PyObject *loop, PyObject *task);
+
+static PyObject *
+_asyncio__enter_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(loop), &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"loop", "task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_enter_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *loop;
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ loop = args[0];
+ task = args[1];
+ return_value = _asyncio__enter_task_impl(module, loop, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio__leave_task__doc__,
+"_leave_task($module, /, loop, task)\n"
+"--\n"
+"\n"
+"Leave task execution or suspend a task.\n"
+"\n"
+"Task belongs to loop.\n"
+"\n"
+"Returns None.");
+
+#define _ASYNCIO__LEAVE_TASK_METHODDEF \
+ {"_leave_task", _PyCFunction_CAST(_asyncio__leave_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__leave_task__doc__},
+
+static PyObject *
+_asyncio__leave_task_impl(PyObject *module, PyObject *loop, PyObject *task);
+
+static PyObject *
+_asyncio__leave_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(loop), &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"loop", "task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_leave_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *loop;
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ loop = args[0];
+ task = args[1];
+ return_value = _asyncio__leave_task_impl(module, loop, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio__swap_current_task__doc__,
+"_swap_current_task($module, /, loop, task)\n"
+"--\n"
+"\n"
+"Temporarily swap in the supplied task and return the original one (or None).\n"
+"\n"
+"This is intended for use during eager coroutine execution.");
+
+#define _ASYNCIO__SWAP_CURRENT_TASK_METHODDEF \
+ {"_swap_current_task", _PyCFunction_CAST(_asyncio__swap_current_task), METH_FASTCALL|METH_KEYWORDS, _asyncio__swap_current_task__doc__},
+
+static PyObject *
+_asyncio__swap_current_task_impl(PyObject *module, PyObject *loop,
+ PyObject *task);
+
+static PyObject *
+_asyncio__swap_current_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(loop), &_Py_ID(task), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"loop", "task", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_swap_current_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *loop;
+ PyObject *task;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ loop = args[0];
+ task = args[1];
+ return_value = _asyncio__swap_current_task_impl(module, loop, task);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_asyncio_current_task__doc__,
+"current_task($module, /, loop=None)\n"
+"--\n"
+"\n"
+"Return a currently executed task.");
+
+#define _ASYNCIO_CURRENT_TASK_METHODDEF \
+ {"current_task", _PyCFunction_CAST(_asyncio_current_task), METH_FASTCALL|METH_KEYWORDS, _asyncio_current_task__doc__},
+
+static PyObject *
+_asyncio_current_task_impl(PyObject *module, PyObject *loop);
+
+static PyObject *
+_asyncio_current_task(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(loop), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"loop", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "current_task",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *loop = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ loop = args[0];
+skip_optional_pos:
+ return_value = _asyncio_current_task_impl(module, loop);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=127ba6153250d769 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_bisectmodule.c.h b/contrib/tools/python3/Modules/clinic/_bisectmodule.c.h
new file mode 100644
index 00000000000..7944f5219b0
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_bisectmodule.c.h
@@ -0,0 +1,436 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_bisect_bisect_right__doc__,
+"bisect_right($module, /, a, x, lo=0, hi=None, *, key=None)\n"
+"--\n"
+"\n"
+"Return the index where to insert item x in list a, assuming a is sorted.\n"
+"\n"
+"The return value i is such that all e in a[:i] have e <= x, and all e in\n"
+"a[i:] have e > x. So if x already appears in the list, a.insert(i, x) will\n"
+"insert just after the rightmost x already there.\n"
+"\n"
+"Optional args lo (default 0) and hi (default len(a)) bound the\n"
+"slice of a to be searched.\n"
+"\n"
+"A custom key function can be supplied to customize the sort order.");
+
+#define _BISECT_BISECT_RIGHT_METHODDEF \
+ {"bisect_right", _PyCFunction_CAST(_bisect_bisect_right), METH_FASTCALL|METH_KEYWORDS, _bisect_bisect_right__doc__},
+
+static Py_ssize_t
+_bisect_bisect_right_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key);
+
+static PyObject *
+_bisect_bisect_right(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(a), &_Py_ID(x), &_Py_ID(lo), &_Py_ID(hi), &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "bisect_right",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *a;
+ PyObject *x;
+ Py_ssize_t lo = 0;
+ Py_ssize_t hi = -1;
+ PyObject *key = Py_None;
+ Py_ssize_t _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ a = args[0];
+ x = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ lo = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ if (!_Py_convert_optional_to_ssize_t(args[3], &hi)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ key = args[4];
+skip_optional_kwonly:
+ _return_value = _bisect_bisect_right_impl(module, a, x, lo, hi, key);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_bisect_insort_right__doc__,
+"insort_right($module, /, a, x, lo=0, hi=None, *, key=None)\n"
+"--\n"
+"\n"
+"Insert item x in list a, and keep it sorted assuming a is sorted.\n"
+"\n"
+"If x is already in a, insert it to the right of the rightmost x.\n"
+"\n"
+"Optional args lo (default 0) and hi (default len(a)) bound the\n"
+"slice of a to be searched.\n"
+"\n"
+"A custom key function can be supplied to customize the sort order.");
+
+#define _BISECT_INSORT_RIGHT_METHODDEF \
+ {"insort_right", _PyCFunction_CAST(_bisect_insort_right), METH_FASTCALL|METH_KEYWORDS, _bisect_insort_right__doc__},
+
+static PyObject *
+_bisect_insort_right_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key);
+
+static PyObject *
+_bisect_insort_right(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(a), &_Py_ID(x), &_Py_ID(lo), &_Py_ID(hi), &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "insort_right",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *a;
+ PyObject *x;
+ Py_ssize_t lo = 0;
+ Py_ssize_t hi = -1;
+ PyObject *key = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ a = args[0];
+ x = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ lo = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ if (!_Py_convert_optional_to_ssize_t(args[3], &hi)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ key = args[4];
+skip_optional_kwonly:
+ return_value = _bisect_insort_right_impl(module, a, x, lo, hi, key);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_bisect_bisect_left__doc__,
+"bisect_left($module, /, a, x, lo=0, hi=None, *, key=None)\n"
+"--\n"
+"\n"
+"Return the index where to insert item x in list a, assuming a is sorted.\n"
+"\n"
+"The return value i is such that all e in a[:i] have e < x, and all e in\n"
+"a[i:] have e >= x. So if x already appears in the list, a.insert(i, x) will\n"
+"insert just before the leftmost x already there.\n"
+"\n"
+"Optional args lo (default 0) and hi (default len(a)) bound the\n"
+"slice of a to be searched.\n"
+"\n"
+"A custom key function can be supplied to customize the sort order.");
+
+#define _BISECT_BISECT_LEFT_METHODDEF \
+ {"bisect_left", _PyCFunction_CAST(_bisect_bisect_left), METH_FASTCALL|METH_KEYWORDS, _bisect_bisect_left__doc__},
+
+static Py_ssize_t
+_bisect_bisect_left_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key);
+
+static PyObject *
+_bisect_bisect_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(a), &_Py_ID(x), &_Py_ID(lo), &_Py_ID(hi), &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "bisect_left",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *a;
+ PyObject *x;
+ Py_ssize_t lo = 0;
+ Py_ssize_t hi = -1;
+ PyObject *key = Py_None;
+ Py_ssize_t _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ a = args[0];
+ x = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ lo = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ if (!_Py_convert_optional_to_ssize_t(args[3], &hi)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ key = args[4];
+skip_optional_kwonly:
+ _return_value = _bisect_bisect_left_impl(module, a, x, lo, hi, key);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_bisect_insort_left__doc__,
+"insort_left($module, /, a, x, lo=0, hi=None, *, key=None)\n"
+"--\n"
+"\n"
+"Insert item x in list a, and keep it sorted assuming a is sorted.\n"
+"\n"
+"If x is already in a, insert it to the left of the leftmost x.\n"
+"\n"
+"Optional args lo (default 0) and hi (default len(a)) bound the\n"
+"slice of a to be searched.\n"
+"\n"
+"A custom key function can be supplied to customize the sort order.");
+
+#define _BISECT_INSORT_LEFT_METHODDEF \
+ {"insort_left", _PyCFunction_CAST(_bisect_insort_left), METH_FASTCALL|METH_KEYWORDS, _bisect_insort_left__doc__},
+
+static PyObject *
+_bisect_insort_left_impl(PyObject *module, PyObject *a, PyObject *x,
+ Py_ssize_t lo, Py_ssize_t hi, PyObject *key);
+
+static PyObject *
+_bisect_insort_left(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(a), &_Py_ID(x), &_Py_ID(lo), &_Py_ID(hi), &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"a", "x", "lo", "hi", "key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "insort_left",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *a;
+ PyObject *x;
+ Py_ssize_t lo = 0;
+ Py_ssize_t hi = -1;
+ PyObject *key = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ a = args[0];
+ x = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ lo = ival;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ if (!_Py_convert_optional_to_ssize_t(args[3], &hi)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ key = args[4];
+skip_optional_kwonly:
+ return_value = _bisect_insort_left_impl(module, a, x, lo, hi, key);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=5a7fa64bf9b262f3 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_bz2module.c.h b/contrib/tools/python3/Modules/clinic/_bz2module.c.h
new file mode 100644
index 00000000000..d7797d639ae
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_bz2module.c.h
@@ -0,0 +1,244 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__,
+"compress($self, data, /)\n"
+"--\n"
+"\n"
+"Provide data to the compressor object.\n"
+"\n"
+"Returns a chunk of compressed data if possible, or b\'\' otherwise.\n"
+"\n"
+"When you have finished providing data to the compressor, call the\n"
+"flush() method to finish the compression process.");
+
+#define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF \
+ {"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__},
+
+static PyObject *
+_bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data);
+
+static PyObject *
+_bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _bz2_BZ2Compressor_compress_impl(self, &data);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_bz2_BZ2Compressor_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n"
+"Finish the compression process.\n"
+"\n"
+"Returns the compressed data left in internal buffers.\n"
+"\n"
+"The compressor object may not be used after this method is called.");
+
+#define _BZ2_BZ2COMPRESSOR_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_bz2_BZ2Compressor_flush, METH_NOARGS, _bz2_BZ2Compressor_flush__doc__},
+
+static PyObject *
+_bz2_BZ2Compressor_flush_impl(BZ2Compressor *self);
+
+static PyObject *
+_bz2_BZ2Compressor_flush(BZ2Compressor *self, PyObject *Py_UNUSED(ignored))
+{
+ return _bz2_BZ2Compressor_flush_impl(self);
+}
+
+PyDoc_STRVAR(_bz2_BZ2Compressor__doc__,
+"BZ2Compressor(compresslevel=9, /)\n"
+"--\n"
+"\n"
+"Create a compressor object for compressing data incrementally.\n"
+"\n"
+" compresslevel\n"
+" Compression level, as a number between 1 and 9.\n"
+"\n"
+"For one-shot compression, use the compress() function instead.");
+
+static PyObject *
+_bz2_BZ2Compressor_impl(PyTypeObject *type, int compresslevel);
+
+static PyObject *
+_bz2_BZ2Compressor(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->bz2_compressor_type;
+ int compresslevel = 9;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("BZ2Compressor", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("BZ2Compressor", PyTuple_GET_SIZE(args), 0, 1)) {
+ goto exit;
+ }
+ if (PyTuple_GET_SIZE(args) < 1) {
+ goto skip_optional;
+ }
+ compresslevel = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0));
+ if (compresslevel == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _bz2_BZ2Compressor_impl(type, compresslevel);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_bz2_BZ2Decompressor_decompress__doc__,
+"decompress($self, /, data, max_length=-1)\n"
+"--\n"
+"\n"
+"Decompress *data*, returning uncompressed data as bytes.\n"
+"\n"
+"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
+"decompressed data. If this limit is reached and further output can be\n"
+"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
+"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
+"\n"
+"If all of the input data was decompressed and returned (either because this\n"
+"was less than *max_length* bytes, or because *max_length* was negative),\n"
+"*self.needs_input* will be set to True.\n"
+"\n"
+"Attempting to decompress data after the end of stream is reached raises an\n"
+"EOFError. Any data found after the end of the stream is ignored and saved in\n"
+"the unused_data attribute.");
+
+#define _BZ2_BZ2DECOMPRESSOR_DECOMPRESS_METHODDEF \
+ {"decompress", _PyCFunction_CAST(_bz2_BZ2Decompressor_decompress), METH_FASTCALL|METH_KEYWORDS, _bz2_BZ2Decompressor_decompress__doc__},
+
+static PyObject *
+_bz2_BZ2Decompressor_decompress_impl(BZ2Decompressor *self, Py_buffer *data,
+ Py_ssize_t max_length);
+
+static PyObject *
+_bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(max_length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "max_length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decompress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ Py_ssize_t max_length = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ max_length = ival;
+ }
+skip_optional_pos:
+ return_value = _bz2_BZ2Decompressor_decompress_impl(self, &data, max_length);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_bz2_BZ2Decompressor__doc__,
+"BZ2Decompressor()\n"
+"--\n"
+"\n"
+"Create a decompressor object for decompressing data incrementally.\n"
+"\n"
+"For one-shot decompression, use the decompress() function instead.");
+
+static PyObject *
+_bz2_BZ2Decompressor_impl(PyTypeObject *type);
+
+static PyObject *
+_bz2_BZ2Decompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->bz2_decompressor_type;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoPositional("BZ2Decompressor", args)) {
+ goto exit;
+ }
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("BZ2Decompressor", kwargs)) {
+ goto exit;
+ }
+ return_value = _bz2_BZ2Decompressor_impl(type);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=805400e4805098ec input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_codecsmodule.c.h b/contrib/tools/python3/Modules/clinic/_codecsmodule.c.h
new file mode 100644
index 00000000000..f11bcc8815b
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_codecsmodule.c.h
@@ -0,0 +1,2872 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_codecs_register__doc__,
+"register($module, search_function, /)\n"
+"--\n"
+"\n"
+"Register a codec search function.\n"
+"\n"
+"Search functions are expected to take one argument, the encoding name in\n"
+"all lower case letters, and either return None, or a tuple of functions\n"
+"(encoder, decoder, stream_reader, stream_writer) (or a CodecInfo object).");
+
+#define _CODECS_REGISTER_METHODDEF \
+ {"register", (PyCFunction)_codecs_register, METH_O, _codecs_register__doc__},
+
+PyDoc_STRVAR(_codecs_unregister__doc__,
+"unregister($module, search_function, /)\n"
+"--\n"
+"\n"
+"Unregister a codec search function and clear the registry\'s cache.\n"
+"\n"
+"If the search function is not registered, do nothing.");
+
+#define _CODECS_UNREGISTER_METHODDEF \
+ {"unregister", (PyCFunction)_codecs_unregister, METH_O, _codecs_unregister__doc__},
+
+PyDoc_STRVAR(_codecs_lookup__doc__,
+"lookup($module, encoding, /)\n"
+"--\n"
+"\n"
+"Looks up a codec tuple in the Python codec registry and returns a CodecInfo object.");
+
+#define _CODECS_LOOKUP_METHODDEF \
+ {"lookup", (PyCFunction)_codecs_lookup, METH_O, _codecs_lookup__doc__},
+
+static PyObject *
+_codecs_lookup_impl(PyObject *module, const char *encoding);
+
+static PyObject *
+_codecs_lookup(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *encoding;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("lookup", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(arg, &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _codecs_lookup_impl(module, encoding);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_encode__doc__,
+"encode($module, /, obj, encoding=\'utf-8\', errors=\'strict\')\n"
+"--\n"
+"\n"
+"Encodes obj using the codec registered for encoding.\n"
+"\n"
+"The default encoding is \'utf-8\'. errors may be given to set a\n"
+"different error handling scheme. Default is \'strict\' meaning that encoding\n"
+"errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n"
+"and \'backslashreplace\' as well as any other name registered with\n"
+"codecs.register_error that can handle ValueErrors.");
+
+#define _CODECS_ENCODE_METHODDEF \
+ {"encode", _PyCFunction_CAST(_codecs_encode), METH_FASTCALL|METH_KEYWORDS, _codecs_encode__doc__},
+
+static PyObject *
+_codecs_encode_impl(PyObject *module, PyObject *obj, const char *encoding,
+ const char *errors);
+
+static PyObject *
+_codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(obj), &_Py_ID(encoding), &_Py_ID(errors), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"obj", "encoding", "errors", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "encode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *obj;
+ const char *encoding = NULL;
+ const char *errors = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ obj = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("encode", "argument 'encoding'", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[1], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (!PyUnicode_Check(args[2])) {
+ _PyArg_BadArgument("encode", "argument 'errors'", "str", args[2]);
+ goto exit;
+ }
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[2], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _codecs_encode_impl(module, obj, encoding, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_decode__doc__,
+"decode($module, /, obj, encoding=\'utf-8\', errors=\'strict\')\n"
+"--\n"
+"\n"
+"Decodes obj using the codec registered for encoding.\n"
+"\n"
+"Default encoding is \'utf-8\'. errors may be given to set a\n"
+"different error handling scheme. Default is \'strict\' meaning that encoding\n"
+"errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n"
+"and \'backslashreplace\' as well as any other name registered with\n"
+"codecs.register_error that can handle ValueErrors.");
+
+#define _CODECS_DECODE_METHODDEF \
+ {"decode", _PyCFunction_CAST(_codecs_decode), METH_FASTCALL|METH_KEYWORDS, _codecs_decode__doc__},
+
+static PyObject *
+_codecs_decode_impl(PyObject *module, PyObject *obj, const char *encoding,
+ const char *errors);
+
+static PyObject *
+_codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(obj), &_Py_ID(encoding), &_Py_ID(errors), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"obj", "encoding", "errors", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *obj;
+ const char *encoding = NULL;
+ const char *errors = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ obj = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[1], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (!PyUnicode_Check(args[2])) {
+ _PyArg_BadArgument("decode", "argument 'errors'", "str", args[2]);
+ goto exit;
+ }
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[2], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _codecs_decode_impl(module, obj, encoding, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_escape_decode__doc__,
+"escape_decode($module, data, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_ESCAPE_DECODE_METHODDEF \
+ {"escape_decode", _PyCFunction_CAST(_codecs_escape_decode), METH_FASTCALL, _codecs_escape_decode__doc__},
+
+static PyObject *
+_codecs_escape_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors);
+
+static PyObject *
+_codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("escape_decode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyUnicode_Check(args[0])) {
+ Py_ssize_t len;
+ const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len);
+ if (ptr == NULL) {
+ goto exit;
+ }
+ PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, 0);
+ }
+ else { /* any bytes-like object */
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("escape_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("escape_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_escape_decode_impl(module, &data, errors);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_escape_encode__doc__,
+"escape_encode($module, data, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_ESCAPE_ENCODE_METHODDEF \
+ {"escape_encode", _PyCFunction_CAST(_codecs_escape_encode), METH_FASTCALL, _codecs_escape_encode__doc__},
+
+static PyObject *
+_codecs_escape_encode_impl(PyObject *module, PyObject *data,
+ const char *errors);
+
+static PyObject *
+_codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *data;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("escape_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyBytes_Check(args[0])) {
+ _PyArg_BadArgument("escape_encode", "argument 1", "bytes", args[0]);
+ goto exit;
+ }
+ data = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("escape_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_escape_encode_impl(module, data, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_7_decode__doc__,
+"utf_7_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_7_DECODE_METHODDEF \
+ {"utf_7_decode", _PyCFunction_CAST(_codecs_utf_7_decode), METH_FASTCALL, _codecs_utf_7_decode__doc__},
+
+static PyObject *
+_codecs_utf_7_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_7_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_7_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_7_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_7_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_8_decode__doc__,
+"utf_8_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_8_DECODE_METHODDEF \
+ {"utf_8_decode", _PyCFunction_CAST(_codecs_utf_8_decode), METH_FASTCALL, _codecs_utf_8_decode__doc__},
+
+static PyObject *
+_codecs_utf_8_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_8_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_8_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_8_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_8_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_decode__doc__,
+"utf_16_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_DECODE_METHODDEF \
+ {"utf_16_decode", _PyCFunction_CAST(_codecs_utf_16_decode), METH_FASTCALL, _codecs_utf_16_decode__doc__},
+
+static PyObject *
+_codecs_utf_16_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_16_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_16_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_le_decode__doc__,
+"utf_16_le_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_LE_DECODE_METHODDEF \
+ {"utf_16_le_decode", _PyCFunction_CAST(_codecs_utf_16_le_decode), METH_FASTCALL, _codecs_utf_16_le_decode__doc__},
+
+static PyObject *
+_codecs_utf_16_le_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_16_le_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_16_le_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_le_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_le_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_be_decode__doc__,
+"utf_16_be_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_BE_DECODE_METHODDEF \
+ {"utf_16_be_decode", _PyCFunction_CAST(_codecs_utf_16_be_decode), METH_FASTCALL, _codecs_utf_16_be_decode__doc__},
+
+static PyObject *
+_codecs_utf_16_be_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_16_be_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_16_be_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_be_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_be_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_ex_decode__doc__,
+"utf_16_ex_decode($module, data, errors=None, byteorder=0, final=False,\n"
+" /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_EX_DECODE_METHODDEF \
+ {"utf_16_ex_decode", _PyCFunction_CAST(_codecs_utf_16_ex_decode), METH_FASTCALL, _codecs_utf_16_ex_decode__doc__},
+
+static PyObject *
+_codecs_utf_16_ex_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int byteorder, int final);
+
+static PyObject *
+_codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int byteorder = 0;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_16_ex_decode", nargs, 1, 4)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_16_ex_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_ex_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ byteorder = _PyLong_AsInt(args[2]);
+ if (byteorder == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[3]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_ex_decode_impl(module, &data, errors, byteorder, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_decode__doc__,
+"utf_32_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_DECODE_METHODDEF \
+ {"utf_32_decode", _PyCFunction_CAST(_codecs_utf_32_decode), METH_FASTCALL, _codecs_utf_32_decode__doc__},
+
+static PyObject *
+_codecs_utf_32_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_32_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_32_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_le_decode__doc__,
+"utf_32_le_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_LE_DECODE_METHODDEF \
+ {"utf_32_le_decode", _PyCFunction_CAST(_codecs_utf_32_le_decode), METH_FASTCALL, _codecs_utf_32_le_decode__doc__},
+
+static PyObject *
+_codecs_utf_32_le_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_32_le_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_32_le_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_le_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_le_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_be_decode__doc__,
+"utf_32_be_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_BE_DECODE_METHODDEF \
+ {"utf_32_be_decode", _PyCFunction_CAST(_codecs_utf_32_be_decode), METH_FASTCALL, _codecs_utf_32_be_decode__doc__},
+
+static PyObject *
+_codecs_utf_32_be_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_32_be_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_32_be_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_be_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_be_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_ex_decode__doc__,
+"utf_32_ex_decode($module, data, errors=None, byteorder=0, final=False,\n"
+" /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_EX_DECODE_METHODDEF \
+ {"utf_32_ex_decode", _PyCFunction_CAST(_codecs_utf_32_ex_decode), METH_FASTCALL, _codecs_utf_32_ex_decode__doc__},
+
+static PyObject *
+_codecs_utf_32_ex_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int byteorder, int final);
+
+static PyObject *
+_codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int byteorder = 0;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("utf_32_ex_decode", nargs, 1, 4)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("utf_32_ex_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_ex_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ byteorder = _PyLong_AsInt(args[2]);
+ if (byteorder == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[3]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_ex_decode_impl(module, &data, errors, byteorder, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_unicode_escape_decode__doc__,
+"unicode_escape_decode($module, data, errors=None, final=True, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF \
+ {"unicode_escape_decode", _PyCFunction_CAST(_codecs_unicode_escape_decode), METH_FASTCALL, _codecs_unicode_escape_decode__doc__},
+
+static PyObject *
+_codecs_unicode_escape_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 1;
+
+ if (!_PyArg_CheckPositional("unicode_escape_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyUnicode_Check(args[0])) {
+ Py_ssize_t len;
+ const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len);
+ if (ptr == NULL) {
+ goto exit;
+ }
+ PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, 0);
+ }
+ else { /* any bytes-like object */
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("unicode_escape_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("unicode_escape_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_unicode_escape_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_raw_unicode_escape_decode__doc__,
+"raw_unicode_escape_decode($module, data, errors=None, final=True, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF \
+ {"raw_unicode_escape_decode", _PyCFunction_CAST(_codecs_raw_unicode_escape_decode), METH_FASTCALL, _codecs_raw_unicode_escape_decode__doc__},
+
+static PyObject *
+_codecs_raw_unicode_escape_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 1;
+
+ if (!_PyArg_CheckPositional("raw_unicode_escape_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyUnicode_Check(args[0])) {
+ Py_ssize_t len;
+ const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len);
+ if (ptr == NULL) {
+ goto exit;
+ }
+ PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, 0);
+ }
+ else { /* any bytes-like object */
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("raw_unicode_escape_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("raw_unicode_escape_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_raw_unicode_escape_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_latin_1_decode__doc__,
+"latin_1_decode($module, data, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_LATIN_1_DECODE_METHODDEF \
+ {"latin_1_decode", _PyCFunction_CAST(_codecs_latin_1_decode), METH_FASTCALL, _codecs_latin_1_decode__doc__},
+
+static PyObject *
+_codecs_latin_1_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors);
+
+static PyObject *
+_codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("latin_1_decode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("latin_1_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("latin_1_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_latin_1_decode_impl(module, &data, errors);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_ascii_decode__doc__,
+"ascii_decode($module, data, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_ASCII_DECODE_METHODDEF \
+ {"ascii_decode", _PyCFunction_CAST(_codecs_ascii_decode), METH_FASTCALL, _codecs_ascii_decode__doc__},
+
+static PyObject *
+_codecs_ascii_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors);
+
+static PyObject *
+_codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("ascii_decode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("ascii_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("ascii_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_ascii_decode_impl(module, &data, errors);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_charmap_decode__doc__,
+"charmap_decode($module, data, errors=None, mapping=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_CHARMAP_DECODE_METHODDEF \
+ {"charmap_decode", _PyCFunction_CAST(_codecs_charmap_decode), METH_FASTCALL, _codecs_charmap_decode__doc__},
+
+static PyObject *
+_codecs_charmap_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, PyObject *mapping);
+
+static PyObject *
+_codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ PyObject *mapping = Py_None;
+
+ if (!_PyArg_CheckPositional("charmap_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("charmap_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("charmap_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ mapping = args[2];
+skip_optional:
+ return_value = _codecs_charmap_decode_impl(module, &data, errors, mapping);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_codecs_mbcs_decode__doc__,
+"mbcs_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_MBCS_DECODE_METHODDEF \
+ {"mbcs_decode", _PyCFunction_CAST(_codecs_mbcs_decode), METH_FASTCALL, _codecs_mbcs_decode__doc__},
+
+static PyObject *
+_codecs_mbcs_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("mbcs_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("mbcs_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("mbcs_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_mbcs_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_codecs_oem_decode__doc__,
+"oem_decode($module, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_OEM_DECODE_METHODDEF \
+ {"oem_decode", _PyCFunction_CAST(_codecs_oem_decode), METH_FASTCALL, _codecs_oem_decode__doc__},
+
+static PyObject *
+_codecs_oem_decode_impl(PyObject *module, Py_buffer *data,
+ const char *errors, int final);
+
+static PyObject *
+_codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("oem_decode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("oem_decode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("oem_decode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[2]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_oem_decode_impl(module, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_codecs_code_page_decode__doc__,
+"code_page_decode($module, codepage, data, errors=None, final=False, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_CODE_PAGE_DECODE_METHODDEF \
+ {"code_page_decode", _PyCFunction_CAST(_codecs_code_page_decode), METH_FASTCALL, _codecs_code_page_decode__doc__},
+
+static PyObject *
+_codecs_code_page_decode_impl(PyObject *module, int codepage,
+ Py_buffer *data, const char *errors, int final);
+
+static PyObject *
+_codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int codepage;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+ int final = 0;
+
+ if (!_PyArg_CheckPositional("code_page_decode", nargs, 2, 4)) {
+ goto exit;
+ }
+ codepage = _PyLong_AsInt(args[0]);
+ if (codepage == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("code_page_decode", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ if (args[2] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[2])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[2], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("code_page_decode", "argument 3", "str or None", args[2]);
+ goto exit;
+ }
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ final = PyObject_IsTrue(args[3]);
+ if (final < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_code_page_decode_impl(module, codepage, &data, errors, final);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+PyDoc_STRVAR(_codecs_readbuffer_encode__doc__,
+"readbuffer_encode($module, data, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_READBUFFER_ENCODE_METHODDEF \
+ {"readbuffer_encode", _PyCFunction_CAST(_codecs_readbuffer_encode), METH_FASTCALL, _codecs_readbuffer_encode__doc__},
+
+static PyObject *
+_codecs_readbuffer_encode_impl(PyObject *module, Py_buffer *data,
+ const char *errors);
+
+static PyObject *
+_codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("readbuffer_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyUnicode_Check(args[0])) {
+ Py_ssize_t len;
+ const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len);
+ if (ptr == NULL) {
+ goto exit;
+ }
+ PyBuffer_FillInfo(&data, args[0], (void *)ptr, len, 1, 0);
+ }
+ else { /* any bytes-like object */
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("readbuffer_encode", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("readbuffer_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_readbuffer_encode_impl(module, &data, errors);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_7_encode__doc__,
+"utf_7_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_7_ENCODE_METHODDEF \
+ {"utf_7_encode", _PyCFunction_CAST(_codecs_utf_7_encode), METH_FASTCALL, _codecs_utf_7_encode__doc__},
+
+static PyObject *
+_codecs_utf_7_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("utf_7_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_7_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_7_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_7_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_8_encode__doc__,
+"utf_8_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_8_ENCODE_METHODDEF \
+ {"utf_8_encode", _PyCFunction_CAST(_codecs_utf_8_encode), METH_FASTCALL, _codecs_utf_8_encode__doc__},
+
+static PyObject *
+_codecs_utf_8_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("utf_8_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_8_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_8_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_8_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_encode__doc__,
+"utf_16_encode($module, str, errors=None, byteorder=0, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_ENCODE_METHODDEF \
+ {"utf_16_encode", _PyCFunction_CAST(_codecs_utf_16_encode), METH_FASTCALL, _codecs_utf_16_encode__doc__},
+
+static PyObject *
+_codecs_utf_16_encode_impl(PyObject *module, PyObject *str,
+ const char *errors, int byteorder);
+
+static PyObject *
+_codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+ int byteorder = 0;
+
+ if (!_PyArg_CheckPositional("utf_16_encode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_16_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ byteorder = _PyLong_AsInt(args[2]);
+ if (byteorder == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_encode_impl(module, str, errors, byteorder);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_le_encode__doc__,
+"utf_16_le_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_LE_ENCODE_METHODDEF \
+ {"utf_16_le_encode", _PyCFunction_CAST(_codecs_utf_16_le_encode), METH_FASTCALL, _codecs_utf_16_le_encode__doc__},
+
+static PyObject *
+_codecs_utf_16_le_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("utf_16_le_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_16_le_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_le_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_le_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_16_be_encode__doc__,
+"utf_16_be_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_16_BE_ENCODE_METHODDEF \
+ {"utf_16_be_encode", _PyCFunction_CAST(_codecs_utf_16_be_encode), METH_FASTCALL, _codecs_utf_16_be_encode__doc__},
+
+static PyObject *
+_codecs_utf_16_be_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("utf_16_be_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_16_be_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_16_be_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_16_be_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_encode__doc__,
+"utf_32_encode($module, str, errors=None, byteorder=0, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_ENCODE_METHODDEF \
+ {"utf_32_encode", _PyCFunction_CAST(_codecs_utf_32_encode), METH_FASTCALL, _codecs_utf_32_encode__doc__},
+
+static PyObject *
+_codecs_utf_32_encode_impl(PyObject *module, PyObject *str,
+ const char *errors, int byteorder);
+
+static PyObject *
+_codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+ int byteorder = 0;
+
+ if (!_PyArg_CheckPositional("utf_32_encode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_32_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ byteorder = _PyLong_AsInt(args[2]);
+ if (byteorder == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_encode_impl(module, str, errors, byteorder);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_le_encode__doc__,
+"utf_32_le_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_LE_ENCODE_METHODDEF \
+ {"utf_32_le_encode", _PyCFunction_CAST(_codecs_utf_32_le_encode), METH_FASTCALL, _codecs_utf_32_le_encode__doc__},
+
+static PyObject *
+_codecs_utf_32_le_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("utf_32_le_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_32_le_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_le_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_le_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_utf_32_be_encode__doc__,
+"utf_32_be_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UTF_32_BE_ENCODE_METHODDEF \
+ {"utf_32_be_encode", _PyCFunction_CAST(_codecs_utf_32_be_encode), METH_FASTCALL, _codecs_utf_32_be_encode__doc__},
+
+static PyObject *
+_codecs_utf_32_be_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("utf_32_be_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("utf_32_be_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("utf_32_be_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_utf_32_be_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_unicode_escape_encode__doc__,
+"unicode_escape_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF \
+ {"unicode_escape_encode", _PyCFunction_CAST(_codecs_unicode_escape_encode), METH_FASTCALL, _codecs_unicode_escape_encode__doc__},
+
+static PyObject *
+_codecs_unicode_escape_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("unicode_escape_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("unicode_escape_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("unicode_escape_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_unicode_escape_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_raw_unicode_escape_encode__doc__,
+"raw_unicode_escape_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF \
+ {"raw_unicode_escape_encode", _PyCFunction_CAST(_codecs_raw_unicode_escape_encode), METH_FASTCALL, _codecs_raw_unicode_escape_encode__doc__},
+
+static PyObject *
+_codecs_raw_unicode_escape_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("raw_unicode_escape_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("raw_unicode_escape_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("raw_unicode_escape_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_raw_unicode_escape_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_latin_1_encode__doc__,
+"latin_1_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_LATIN_1_ENCODE_METHODDEF \
+ {"latin_1_encode", _PyCFunction_CAST(_codecs_latin_1_encode), METH_FASTCALL, _codecs_latin_1_encode__doc__},
+
+static PyObject *
+_codecs_latin_1_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("latin_1_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("latin_1_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("latin_1_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_latin_1_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_ascii_encode__doc__,
+"ascii_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_ASCII_ENCODE_METHODDEF \
+ {"ascii_encode", _PyCFunction_CAST(_codecs_ascii_encode), METH_FASTCALL, _codecs_ascii_encode__doc__},
+
+static PyObject *
+_codecs_ascii_encode_impl(PyObject *module, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("ascii_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("ascii_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("ascii_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_ascii_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_charmap_encode__doc__,
+"charmap_encode($module, str, errors=None, mapping=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_CHARMAP_ENCODE_METHODDEF \
+ {"charmap_encode", _PyCFunction_CAST(_codecs_charmap_encode), METH_FASTCALL, _codecs_charmap_encode__doc__},
+
+static PyObject *
+_codecs_charmap_encode_impl(PyObject *module, PyObject *str,
+ const char *errors, PyObject *mapping);
+
+static PyObject *
+_codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+ PyObject *mapping = Py_None;
+
+ if (!_PyArg_CheckPositional("charmap_encode", nargs, 1, 3)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("charmap_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("charmap_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ mapping = args[2];
+skip_optional:
+ return_value = _codecs_charmap_encode_impl(module, str, errors, mapping);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_charmap_build__doc__,
+"charmap_build($module, map, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_CHARMAP_BUILD_METHODDEF \
+ {"charmap_build", (PyCFunction)_codecs_charmap_build, METH_O, _codecs_charmap_build__doc__},
+
+static PyObject *
+_codecs_charmap_build_impl(PyObject *module, PyObject *map);
+
+static PyObject *
+_codecs_charmap_build(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *map;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("charmap_build", "argument", "str", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ map = arg;
+ return_value = _codecs_charmap_build_impl(module, map);
+
+exit:
+ return return_value;
+}
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_codecs_mbcs_encode__doc__,
+"mbcs_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_MBCS_ENCODE_METHODDEF \
+ {"mbcs_encode", _PyCFunction_CAST(_codecs_mbcs_encode), METH_FASTCALL, _codecs_mbcs_encode__doc__},
+
+static PyObject *
+_codecs_mbcs_encode_impl(PyObject *module, PyObject *str, const char *errors);
+
+static PyObject *
+_codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("mbcs_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("mbcs_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("mbcs_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_mbcs_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_codecs_oem_encode__doc__,
+"oem_encode($module, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_OEM_ENCODE_METHODDEF \
+ {"oem_encode", _PyCFunction_CAST(_codecs_oem_encode), METH_FASTCALL, _codecs_oem_encode__doc__},
+
+static PyObject *
+_codecs_oem_encode_impl(PyObject *module, PyObject *str, const char *errors);
+
+static PyObject *
+_codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("oem_encode", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("oem_encode", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ str = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("oem_encode", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_oem_encode_impl(module, str, errors);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_codecs_code_page_encode__doc__,
+"code_page_encode($module, code_page, str, errors=None, /)\n"
+"--\n"
+"\n");
+
+#define _CODECS_CODE_PAGE_ENCODE_METHODDEF \
+ {"code_page_encode", _PyCFunction_CAST(_codecs_code_page_encode), METH_FASTCALL, _codecs_code_page_encode__doc__},
+
+static PyObject *
+_codecs_code_page_encode_impl(PyObject *module, int code_page, PyObject *str,
+ const char *errors);
+
+static PyObject *
+_codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int code_page;
+ PyObject *str;
+ const char *errors = NULL;
+
+ if (!_PyArg_CheckPositional("code_page_encode", nargs, 2, 3)) {
+ goto exit;
+ }
+ code_page = _PyLong_AsInt(args[0]);
+ if (code_page == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("code_page_encode", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[1]) == -1) {
+ goto exit;
+ }
+ str = args[1];
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ if (args[2] == Py_None) {
+ errors = NULL;
+ }
+ else if (PyUnicode_Check(args[2])) {
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[2], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("code_page_encode", "argument 3", "str or None", args[2]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _codecs_code_page_encode_impl(module, code_page, str, errors);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+PyDoc_STRVAR(_codecs_register_error__doc__,
+"register_error($module, errors, handler, /)\n"
+"--\n"
+"\n"
+"Register the specified error handler under the name errors.\n"
+"\n"
+"handler must be a callable object, that will be called with an exception\n"
+"instance containing information about the location of the encoding/decoding\n"
+"error and must return a (replacement, new position) tuple.");
+
+#define _CODECS_REGISTER_ERROR_METHODDEF \
+ {"register_error", _PyCFunction_CAST(_codecs_register_error), METH_FASTCALL, _codecs_register_error__doc__},
+
+static PyObject *
+_codecs_register_error_impl(PyObject *module, const char *errors,
+ PyObject *handler);
+
+static PyObject *
+_codecs_register_error(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *errors;
+ PyObject *handler;
+
+ if (!_PyArg_CheckPositional("register_error", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("register_error", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[0], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ handler = args[1];
+ return_value = _codecs_register_error_impl(module, errors, handler);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_codecs_lookup_error__doc__,
+"lookup_error($module, name, /)\n"
+"--\n"
+"\n"
+"lookup_error(errors) -> handler\n"
+"\n"
+"Return the error handler for the specified error handling name or raise a\n"
+"LookupError, if no handler exists under this name.");
+
+#define _CODECS_LOOKUP_ERROR_METHODDEF \
+ {"lookup_error", (PyCFunction)_codecs_lookup_error, METH_O, _codecs_lookup_error__doc__},
+
+static PyObject *
+_codecs_lookup_error_impl(PyObject *module, const char *name);
+
+static PyObject *
+_codecs_lookup_error(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *name;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("lookup_error", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t name_length;
+ name = PyUnicode_AsUTF8AndSize(arg, &name_length);
+ if (name == NULL) {
+ goto exit;
+ }
+ if (strlen(name) != (size_t)name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _codecs_lookup_error_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+#ifndef _CODECS_MBCS_DECODE_METHODDEF
+ #define _CODECS_MBCS_DECODE_METHODDEF
+#endif /* !defined(_CODECS_MBCS_DECODE_METHODDEF) */
+
+#ifndef _CODECS_OEM_DECODE_METHODDEF
+ #define _CODECS_OEM_DECODE_METHODDEF
+#endif /* !defined(_CODECS_OEM_DECODE_METHODDEF) */
+
+#ifndef _CODECS_CODE_PAGE_DECODE_METHODDEF
+ #define _CODECS_CODE_PAGE_DECODE_METHODDEF
+#endif /* !defined(_CODECS_CODE_PAGE_DECODE_METHODDEF) */
+
+#ifndef _CODECS_MBCS_ENCODE_METHODDEF
+ #define _CODECS_MBCS_ENCODE_METHODDEF
+#endif /* !defined(_CODECS_MBCS_ENCODE_METHODDEF) */
+
+#ifndef _CODECS_OEM_ENCODE_METHODDEF
+ #define _CODECS_OEM_ENCODE_METHODDEF
+#endif /* !defined(_CODECS_OEM_ENCODE_METHODDEF) */
+
+#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
+ #define _CODECS_CODE_PAGE_ENCODE_METHODDEF
+#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
+/*[clinic end generated code: output=603da07cf8dfeb4b input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h b/contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h
new file mode 100644
index 00000000000..3882d069216
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_collectionsmodule.c.h
@@ -0,0 +1,78 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_collections__count_elements__doc__,
+"_count_elements($module, mapping, iterable, /)\n"
+"--\n"
+"\n"
+"Count elements in the iterable, updating the mapping");
+
+#define _COLLECTIONS__COUNT_ELEMENTS_METHODDEF \
+ {"_count_elements", _PyCFunction_CAST(_collections__count_elements), METH_FASTCALL, _collections__count_elements__doc__},
+
+static PyObject *
+_collections__count_elements_impl(PyObject *module, PyObject *mapping,
+ PyObject *iterable);
+
+static PyObject *
+_collections__count_elements(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *mapping;
+ PyObject *iterable;
+
+ if (!_PyArg_CheckPositional("_count_elements", nargs, 2, 2)) {
+ goto exit;
+ }
+ mapping = args[0];
+ iterable = args[1];
+ return_value = _collections__count_elements_impl(module, mapping, iterable);
+
+exit:
+ return return_value;
+}
+
+static PyObject *
+tuplegetter_new_impl(PyTypeObject *type, Py_ssize_t index, PyObject *doc);
+
+static PyObject *
+tuplegetter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->tuplegetter_type;
+ Py_ssize_t index;
+ PyObject *doc;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("_tuplegetter", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("_tuplegetter", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(PyTuple_GET_ITEM(args, 0));
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ index = ival;
+ }
+ doc = PyTuple_GET_ITEM(args, 1);
+ return_value = tuplegetter_new_impl(type, index, doc);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=00e516317d2b8bed input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h b/contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h
new file mode 100644
index 00000000000..461d4845635
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_contextvarsmodule.c.h
@@ -0,0 +1,27 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_contextvars_copy_context__doc__,
+"copy_context($module, /)\n"
+"--\n"
+"\n");
+
+#define _CONTEXTVARS_COPY_CONTEXT_METHODDEF \
+ {"copy_context", (PyCFunction)_contextvars_copy_context, METH_NOARGS, _contextvars_copy_context__doc__},
+
+static PyObject *
+_contextvars_copy_context_impl(PyObject *module);
+
+static PyObject *
+_contextvars_copy_context(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _contextvars_copy_context_impl(module);
+}
+/*[clinic end generated code: output=1736c27450823e70 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_cryptmodule.c.h b/contrib/tools/python3/Modules/clinic/_cryptmodule.c.h
new file mode 100644
index 00000000000..97b70b3c17e
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_cryptmodule.c.h
@@ -0,0 +1,69 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(crypt_crypt__doc__,
+"crypt($module, word, salt, /)\n"
+"--\n"
+"\n"
+"Hash a *word* with the given *salt* and return the hashed password.\n"
+"\n"
+"*word* will usually be a user\'s password. *salt* (either a random 2 or 16\n"
+"character string, possibly prefixed with $digit$ to indicate the method)\n"
+"will be used to perturb the encryption algorithm and produce distinct\n"
+"results for a given *word*.");
+
+#define CRYPT_CRYPT_METHODDEF \
+ {"crypt", _PyCFunction_CAST(crypt_crypt), METH_FASTCALL, crypt_crypt__doc__},
+
+static PyObject *
+crypt_crypt_impl(PyObject *module, const char *word, const char *salt);
+
+static PyObject *
+crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *word;
+ const char *salt;
+
+ if (!_PyArg_CheckPositional("crypt", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("crypt", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t word_length;
+ word = PyUnicode_AsUTF8AndSize(args[0], &word_length);
+ if (word == NULL) {
+ goto exit;
+ }
+ if (strlen(word) != (size_t)word_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("crypt", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t salt_length;
+ salt = PyUnicode_AsUTF8AndSize(args[1], &salt_length);
+ if (salt == NULL) {
+ goto exit;
+ }
+ if (strlen(salt) != (size_t)salt_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = crypt_crypt_impl(module, word, salt);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=235ccef9211184f4 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_csv.c.h b/contrib/tools/python3/Modules/clinic/_csv.c.h
new file mode 100644
index 00000000000..8900946350a
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_csv.c.h
@@ -0,0 +1,209 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_csv_list_dialects__doc__,
+"list_dialects($module, /)\n"
+"--\n"
+"\n"
+"Return a list of all known dialect names.\n"
+"\n"
+" names = csv.list_dialects()");
+
+#define _CSV_LIST_DIALECTS_METHODDEF \
+ {"list_dialects", (PyCFunction)_csv_list_dialects, METH_NOARGS, _csv_list_dialects__doc__},
+
+static PyObject *
+_csv_list_dialects_impl(PyObject *module);
+
+static PyObject *
+_csv_list_dialects(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _csv_list_dialects_impl(module);
+}
+
+PyDoc_STRVAR(_csv_unregister_dialect__doc__,
+"unregister_dialect($module, /, name)\n"
+"--\n"
+"\n"
+"Delete the name/dialect mapping associated with a string name.\n"
+"\n"
+" csv.unregister_dialect(name)");
+
+#define _CSV_UNREGISTER_DIALECT_METHODDEF \
+ {"unregister_dialect", _PyCFunction_CAST(_csv_unregister_dialect), METH_FASTCALL|METH_KEYWORDS, _csv_unregister_dialect__doc__},
+
+static PyObject *
+_csv_unregister_dialect_impl(PyObject *module, PyObject *name);
+
+static PyObject *
+_csv_unregister_dialect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "unregister_dialect",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *name;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ name = args[0];
+ return_value = _csv_unregister_dialect_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_csv_get_dialect__doc__,
+"get_dialect($module, /, name)\n"
+"--\n"
+"\n"
+"Return the dialect instance associated with name.\n"
+"\n"
+" dialect = csv.get_dialect(name)");
+
+#define _CSV_GET_DIALECT_METHODDEF \
+ {"get_dialect", _PyCFunction_CAST(_csv_get_dialect), METH_FASTCALL|METH_KEYWORDS, _csv_get_dialect__doc__},
+
+static PyObject *
+_csv_get_dialect_impl(PyObject *module, PyObject *name);
+
+static PyObject *
+_csv_get_dialect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get_dialect",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *name;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ name = args[0];
+ return_value = _csv_get_dialect_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_csv_field_size_limit__doc__,
+"field_size_limit($module, /, new_limit=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Sets an upper limit on parsed fields.\n"
+"\n"
+" csv.field_size_limit([limit])\n"
+"\n"
+"Returns old limit. If limit is not given, no new limit is set and\n"
+"the old limit is returned");
+
+#define _CSV_FIELD_SIZE_LIMIT_METHODDEF \
+ {"field_size_limit", _PyCFunction_CAST(_csv_field_size_limit), METH_FASTCALL|METH_KEYWORDS, _csv_field_size_limit__doc__},
+
+static PyObject *
+_csv_field_size_limit_impl(PyObject *module, PyObject *new_limit);
+
+static PyObject *
+_csv_field_size_limit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(new_limit), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"new_limit", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "field_size_limit",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *new_limit = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ new_limit = args[0];
+skip_optional_pos:
+ return_value = _csv_field_size_limit_impl(module, new_limit);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=94374e41eb2806ee input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_datetimemodule.c.h b/contrib/tools/python3/Modules/clinic/_datetimemodule.c.h
new file mode 100644
index 00000000000..51e51e3791c
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_datetimemodule.c.h
@@ -0,0 +1,149 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(datetime_date_fromtimestamp__doc__,
+"fromtimestamp($type, timestamp, /)\n"
+"--\n"
+"\n"
+"Create a date from a POSIX timestamp.\n"
+"\n"
+"The timestamp is a number, e.g. created via time.time(), that is interpreted\n"
+"as local time.");
+
+#define DATETIME_DATE_FROMTIMESTAMP_METHODDEF \
+ {"fromtimestamp", (PyCFunction)datetime_date_fromtimestamp, METH_O|METH_CLASS, datetime_date_fromtimestamp__doc__},
+
+static PyObject *
+iso_calendar_date_new_impl(PyTypeObject *type, int year, int week,
+ int weekday);
+
+static PyObject *
+iso_calendar_date_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(year), &_Py_ID(week), &_Py_ID(weekday), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"year", "week", "weekday", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "IsoCalendarDate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ int year;
+ int week;
+ int weekday;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 3, 3, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ year = _PyLong_AsInt(fastargs[0]);
+ if (year == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ week = _PyLong_AsInt(fastargs[1]);
+ if (week == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ weekday = _PyLong_AsInt(fastargs[2]);
+ if (weekday == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = iso_calendar_date_new_impl(type, year, week, weekday);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(datetime_datetime_now__doc__,
+"now($type, /, tz=None)\n"
+"--\n"
+"\n"
+"Returns new datetime object representing current time local to tz.\n"
+"\n"
+" tz\n"
+" Timezone object.\n"
+"\n"
+"If no tz is specified, uses local timezone.");
+
+#define DATETIME_DATETIME_NOW_METHODDEF \
+ {"now", _PyCFunction_CAST(datetime_datetime_now), METH_FASTCALL|METH_KEYWORDS|METH_CLASS, datetime_datetime_now__doc__},
+
+static PyObject *
+datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz);
+
+static PyObject *
+datetime_datetime_now(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(tz), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"tz", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "now",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *tz = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ tz = args[0];
+skip_optional_pos:
+ return_value = datetime_datetime_now_impl(type, tz);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=42654669940e0e3a input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_elementtree.c.h b/contrib/tools/python3/Modules/clinic/_elementtree.c.h
new file mode 100644
index 00000000000..0b3a86159cc
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_elementtree.c.h
@@ -0,0 +1,1221 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_elementtree_Element_append__doc__,
+"append($self, subelement, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_APPEND_METHODDEF \
+ {"append", _PyCFunction_CAST(_elementtree_Element_append), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_append__doc__},
+
+static PyObject *
+_elementtree_Element_append_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *subelement);
+
+static PyObject *
+_elementtree_Element_append(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "append",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *subelement;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(args[0], clinic_state()->Element_Type)) {
+ _PyArg_BadArgument("append", "argument 1", (clinic_state()->Element_Type)->tp_name, args[0]);
+ goto exit;
+ }
+ subelement = args[0];
+ return_value = _elementtree_Element_append_impl(self, cls, subelement);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_clear__doc__,
+"clear($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_CLEAR_METHODDEF \
+ {"clear", (PyCFunction)_elementtree_Element_clear, METH_NOARGS, _elementtree_Element_clear__doc__},
+
+static PyObject *
+_elementtree_Element_clear_impl(ElementObject *self);
+
+static PyObject *
+_elementtree_Element_clear(ElementObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _elementtree_Element_clear_impl(self);
+}
+
+PyDoc_STRVAR(_elementtree_Element___copy____doc__,
+"__copy__($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT___COPY___METHODDEF \
+ {"__copy__", _PyCFunction_CAST(_elementtree_Element___copy__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element___copy____doc__},
+
+static PyObject *
+_elementtree_Element___copy___impl(ElementObject *self, PyTypeObject *cls);
+
+static PyObject *
+_elementtree_Element___copy__(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments");
+ return NULL;
+ }
+ return _elementtree_Element___copy___impl(self, cls);
+}
+
+PyDoc_STRVAR(_elementtree_Element___deepcopy____doc__,
+"__deepcopy__($self, memo, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT___DEEPCOPY___METHODDEF \
+ {"__deepcopy__", (PyCFunction)_elementtree_Element___deepcopy__, METH_O, _elementtree_Element___deepcopy____doc__},
+
+static PyObject *
+_elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo);
+
+static PyObject *
+_elementtree_Element___deepcopy__(ElementObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *memo;
+
+ if (!PyDict_Check(arg)) {
+ _PyArg_BadArgument("__deepcopy__", "argument", "dict", arg);
+ goto exit;
+ }
+ memo = arg;
+ return_value = _elementtree_Element___deepcopy___impl(self, memo);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT___SIZEOF___METHODDEF \
+ {"__sizeof__", (PyCFunction)_elementtree_Element___sizeof__, METH_NOARGS, _elementtree_Element___sizeof____doc__},
+
+static size_t
+_elementtree_Element___sizeof___impl(ElementObject *self);
+
+static PyObject *
+_elementtree_Element___sizeof__(ElementObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ size_t _return_value;
+
+ _return_value = _elementtree_Element___sizeof___impl(self);
+ if ((_return_value == (size_t)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element___getstate____doc__,
+"__getstate__($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT___GETSTATE___METHODDEF \
+ {"__getstate__", (PyCFunction)_elementtree_Element___getstate__, METH_NOARGS, _elementtree_Element___getstate____doc__},
+
+static PyObject *
+_elementtree_Element___getstate___impl(ElementObject *self);
+
+static PyObject *
+_elementtree_Element___getstate__(ElementObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _elementtree_Element___getstate___impl(self);
+}
+
+PyDoc_STRVAR(_elementtree_Element___setstate____doc__,
+"__setstate__($self, state, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT___SETSTATE___METHODDEF \
+ {"__setstate__", _PyCFunction_CAST(_elementtree_Element___setstate__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element___setstate____doc__},
+
+static PyObject *
+_elementtree_Element___setstate___impl(ElementObject *self,
+ PyTypeObject *cls, PyObject *state);
+
+static PyObject *
+_elementtree_Element___setstate__(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "__setstate__",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *state;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ state = args[0];
+ return_value = _elementtree_Element___setstate___impl(self, cls, state);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_extend__doc__,
+"extend($self, elements, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_EXTEND_METHODDEF \
+ {"extend", _PyCFunction_CAST(_elementtree_Element_extend), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_extend__doc__},
+
+static PyObject *
+_elementtree_Element_extend_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *elements);
+
+static PyObject *
+_elementtree_Element_extend(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "extend",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *elements;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ elements = args[0];
+ return_value = _elementtree_Element_extend_impl(self, cls, elements);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_find__doc__,
+"find($self, /, path, namespaces=None)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_FIND_METHODDEF \
+ {"find", _PyCFunction_CAST(_elementtree_Element_find), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_find__doc__},
+
+static PyObject *
+_elementtree_Element_find_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *namespaces);
+
+static PyObject *
+_elementtree_Element_find(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(namespaces), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "namespaces", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "find",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *path;
+ PyObject *namespaces = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ namespaces = args[1];
+skip_optional_pos:
+ return_value = _elementtree_Element_find_impl(self, cls, path, namespaces);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_findtext__doc__,
+"findtext($self, /, path, default=None, namespaces=None)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_FINDTEXT_METHODDEF \
+ {"findtext", _PyCFunction_CAST(_elementtree_Element_findtext), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_findtext__doc__},
+
+static PyObject *
+_elementtree_Element_findtext_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *default_value,
+ PyObject *namespaces);
+
+static PyObject *
+_elementtree_Element_findtext(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(default), &_Py_ID(namespaces), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "default", "namespaces", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "findtext",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *path;
+ PyObject *default_value = Py_None;
+ PyObject *namespaces = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ default_value = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ namespaces = args[2];
+skip_optional_pos:
+ return_value = _elementtree_Element_findtext_impl(self, cls, path, default_value, namespaces);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_findall__doc__,
+"findall($self, /, path, namespaces=None)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_FINDALL_METHODDEF \
+ {"findall", _PyCFunction_CAST(_elementtree_Element_findall), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_findall__doc__},
+
+static PyObject *
+_elementtree_Element_findall_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *namespaces);
+
+static PyObject *
+_elementtree_Element_findall(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(namespaces), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "namespaces", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "findall",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *path;
+ PyObject *namespaces = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ namespaces = args[1];
+skip_optional_pos:
+ return_value = _elementtree_Element_findall_impl(self, cls, path, namespaces);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_iterfind__doc__,
+"iterfind($self, /, path, namespaces=None)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_ITERFIND_METHODDEF \
+ {"iterfind", _PyCFunction_CAST(_elementtree_Element_iterfind), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_iterfind__doc__},
+
+static PyObject *
+_elementtree_Element_iterfind_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *path, PyObject *namespaces);
+
+static PyObject *
+_elementtree_Element_iterfind(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(namespaces), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "namespaces", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "iterfind",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *path;
+ PyObject *namespaces = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ namespaces = args[1];
+skip_optional_pos:
+ return_value = _elementtree_Element_iterfind_impl(self, cls, path, namespaces);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_get__doc__,
+"get($self, /, key, default=None)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_GET_METHODDEF \
+ {"get", _PyCFunction_CAST(_elementtree_Element_get), METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_get__doc__},
+
+static PyObject *
+_elementtree_Element_get_impl(ElementObject *self, PyObject *key,
+ PyObject *default_value);
+
+static PyObject *
+_elementtree_Element_get(ElementObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(key), &_Py_ID(default), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"key", "default", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *key;
+ PyObject *default_value = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ key = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ default_value = args[1];
+skip_optional_pos:
+ return_value = _elementtree_Element_get_impl(self, key, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_iter__doc__,
+"iter($self, /, tag=None)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_ITER_METHODDEF \
+ {"iter", _PyCFunction_CAST(_elementtree_Element_iter), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_iter__doc__},
+
+static PyObject *
+_elementtree_Element_iter_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *tag);
+
+static PyObject *
+_elementtree_Element_iter(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(tag), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"tag", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "iter",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *tag = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ tag = args[0];
+skip_optional_pos:
+ return_value = _elementtree_Element_iter_impl(self, cls, tag);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_itertext__doc__,
+"itertext($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_ITERTEXT_METHODDEF \
+ {"itertext", _PyCFunction_CAST(_elementtree_Element_itertext), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_itertext__doc__},
+
+static PyObject *
+_elementtree_Element_itertext_impl(ElementObject *self, PyTypeObject *cls);
+
+static PyObject *
+_elementtree_Element_itertext(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "itertext() takes no arguments");
+ return NULL;
+ }
+ return _elementtree_Element_itertext_impl(self, cls);
+}
+
+PyDoc_STRVAR(_elementtree_Element_insert__doc__,
+"insert($self, index, subelement, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_INSERT_METHODDEF \
+ {"insert", _PyCFunction_CAST(_elementtree_Element_insert), METH_FASTCALL, _elementtree_Element_insert__doc__},
+
+static PyObject *
+_elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index,
+ PyObject *subelement);
+
+static PyObject *
+_elementtree_Element_insert(ElementObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t index;
+ PyObject *subelement;
+
+ if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ index = ival;
+ }
+ if (!PyObject_TypeCheck(args[1], clinic_state()->Element_Type)) {
+ _PyArg_BadArgument("insert", "argument 2", (clinic_state()->Element_Type)->tp_name, args[1]);
+ goto exit;
+ }
+ subelement = args[1];
+ return_value = _elementtree_Element_insert_impl(self, index, subelement);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_items__doc__,
+"items($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_ITEMS_METHODDEF \
+ {"items", (PyCFunction)_elementtree_Element_items, METH_NOARGS, _elementtree_Element_items__doc__},
+
+static PyObject *
+_elementtree_Element_items_impl(ElementObject *self);
+
+static PyObject *
+_elementtree_Element_items(ElementObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _elementtree_Element_items_impl(self);
+}
+
+PyDoc_STRVAR(_elementtree_Element_keys__doc__,
+"keys($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_KEYS_METHODDEF \
+ {"keys", (PyCFunction)_elementtree_Element_keys, METH_NOARGS, _elementtree_Element_keys__doc__},
+
+static PyObject *
+_elementtree_Element_keys_impl(ElementObject *self);
+
+static PyObject *
+_elementtree_Element_keys(ElementObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _elementtree_Element_keys_impl(self);
+}
+
+PyDoc_STRVAR(_elementtree_Element_makeelement__doc__,
+"makeelement($self, tag, attrib, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF \
+ {"makeelement", _PyCFunction_CAST(_elementtree_Element_makeelement), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _elementtree_Element_makeelement__doc__},
+
+static PyObject *
+_elementtree_Element_makeelement_impl(ElementObject *self, PyTypeObject *cls,
+ PyObject *tag, PyObject *attrib);
+
+static PyObject *
+_elementtree_Element_makeelement(ElementObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "makeelement",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *tag;
+ PyObject *attrib;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ tag = args[0];
+ if (!PyDict_Check(args[1])) {
+ _PyArg_BadArgument("makeelement", "argument 2", "dict", args[1]);
+ goto exit;
+ }
+ attrib = args[1];
+ return_value = _elementtree_Element_makeelement_impl(self, cls, tag, attrib);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_remove__doc__,
+"remove($self, subelement, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_REMOVE_METHODDEF \
+ {"remove", (PyCFunction)_elementtree_Element_remove, METH_O, _elementtree_Element_remove__doc__},
+
+static PyObject *
+_elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement);
+
+static PyObject *
+_elementtree_Element_remove(ElementObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *subelement;
+
+ if (!PyObject_TypeCheck(arg, clinic_state()->Element_Type)) {
+ _PyArg_BadArgument("remove", "argument", (clinic_state()->Element_Type)->tp_name, arg);
+ goto exit;
+ }
+ subelement = arg;
+ return_value = _elementtree_Element_remove_impl(self, subelement);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_Element_set__doc__,
+"set($self, key, value, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_ELEMENT_SET_METHODDEF \
+ {"set", _PyCFunction_CAST(_elementtree_Element_set), METH_FASTCALL, _elementtree_Element_set__doc__},
+
+static PyObject *
+_elementtree_Element_set_impl(ElementObject *self, PyObject *key,
+ PyObject *value);
+
+static PyObject *
+_elementtree_Element_set(ElementObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *key;
+ PyObject *value;
+
+ if (!_PyArg_CheckPositional("set", nargs, 2, 2)) {
+ goto exit;
+ }
+ key = args[0];
+ value = args[1];
+ return_value = _elementtree_Element_set_impl(self, key, value);
+
+exit:
+ return return_value;
+}
+
+static int
+_elementtree_TreeBuilder___init___impl(TreeBuilderObject *self,
+ PyObject *element_factory,
+ PyObject *comment_factory,
+ PyObject *pi_factory,
+ int insert_comments, int insert_pis);
+
+static int
+_elementtree_TreeBuilder___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(element_factory), &_Py_ID(comment_factory), &_Py_ID(pi_factory), &_Py_ID(insert_comments), &_Py_ID(insert_pis), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"element_factory", "comment_factory", "pi_factory", "insert_comments", "insert_pis", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "TreeBuilder",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *element_factory = Py_None;
+ PyObject *comment_factory = Py_None;
+ PyObject *pi_factory = Py_None;
+ int insert_comments = 0;
+ int insert_pis = 0;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[0]) {
+ element_factory = fastargs[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (fastargs[1]) {
+ comment_factory = fastargs[1];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[2]) {
+ pi_factory = fastargs[2];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[3]) {
+ insert_comments = PyObject_IsTrue(fastargs[3]);
+ if (insert_comments < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ insert_pis = PyObject_IsTrue(fastargs[4]);
+ if (insert_pis < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _elementtree_TreeBuilder___init___impl((TreeBuilderObject *)self, element_factory, comment_factory, pi_factory, insert_comments, insert_pis);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree__set_factories__doc__,
+"_set_factories($module, comment_factory, pi_factory, /)\n"
+"--\n"
+"\n"
+"Change the factories used to create comments and processing instructions.\n"
+"\n"
+"For internal use only.");
+
+#define _ELEMENTTREE__SET_FACTORIES_METHODDEF \
+ {"_set_factories", _PyCFunction_CAST(_elementtree__set_factories), METH_FASTCALL, _elementtree__set_factories__doc__},
+
+static PyObject *
+_elementtree__set_factories_impl(PyObject *module, PyObject *comment_factory,
+ PyObject *pi_factory);
+
+static PyObject *
+_elementtree__set_factories(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *comment_factory;
+ PyObject *pi_factory;
+
+ if (!_PyArg_CheckPositional("_set_factories", nargs, 2, 2)) {
+ goto exit;
+ }
+ comment_factory = args[0];
+ pi_factory = args[1];
+ return_value = _elementtree__set_factories_impl(module, comment_factory, pi_factory);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_TreeBuilder_data__doc__,
+"data($self, data, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_TREEBUILDER_DATA_METHODDEF \
+ {"data", (PyCFunction)_elementtree_TreeBuilder_data, METH_O, _elementtree_TreeBuilder_data__doc__},
+
+PyDoc_STRVAR(_elementtree_TreeBuilder_end__doc__,
+"end($self, tag, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_TREEBUILDER_END_METHODDEF \
+ {"end", (PyCFunction)_elementtree_TreeBuilder_end, METH_O, _elementtree_TreeBuilder_end__doc__},
+
+PyDoc_STRVAR(_elementtree_TreeBuilder_comment__doc__,
+"comment($self, text, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_TREEBUILDER_COMMENT_METHODDEF \
+ {"comment", (PyCFunction)_elementtree_TreeBuilder_comment, METH_O, _elementtree_TreeBuilder_comment__doc__},
+
+PyDoc_STRVAR(_elementtree_TreeBuilder_pi__doc__,
+"pi($self, target, text=None, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_TREEBUILDER_PI_METHODDEF \
+ {"pi", _PyCFunction_CAST(_elementtree_TreeBuilder_pi), METH_FASTCALL, _elementtree_TreeBuilder_pi__doc__},
+
+static PyObject *
+_elementtree_TreeBuilder_pi_impl(TreeBuilderObject *self, PyObject *target,
+ PyObject *text);
+
+static PyObject *
+_elementtree_TreeBuilder_pi(TreeBuilderObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *target;
+ PyObject *text = Py_None;
+
+ if (!_PyArg_CheckPositional("pi", nargs, 1, 2)) {
+ goto exit;
+ }
+ target = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ text = args[1];
+skip_optional:
+ return_value = _elementtree_TreeBuilder_pi_impl(self, target, text);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_TreeBuilder_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_TREEBUILDER_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_elementtree_TreeBuilder_close, METH_NOARGS, _elementtree_TreeBuilder_close__doc__},
+
+static PyObject *
+_elementtree_TreeBuilder_close_impl(TreeBuilderObject *self);
+
+static PyObject *
+_elementtree_TreeBuilder_close(TreeBuilderObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _elementtree_TreeBuilder_close_impl(self);
+}
+
+PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__,
+"start($self, tag, attrs, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_TREEBUILDER_START_METHODDEF \
+ {"start", _PyCFunction_CAST(_elementtree_TreeBuilder_start), METH_FASTCALL, _elementtree_TreeBuilder_start__doc__},
+
+static PyObject *
+_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
+ PyObject *attrs);
+
+static PyObject *
+_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *tag;
+ PyObject *attrs;
+
+ if (!_PyArg_CheckPositional("start", nargs, 2, 2)) {
+ goto exit;
+ }
+ tag = args[0];
+ if (!PyDict_Check(args[1])) {
+ _PyArg_BadArgument("start", "argument 2", "dict", args[1]);
+ goto exit;
+ }
+ attrs = args[1];
+ return_value = _elementtree_TreeBuilder_start_impl(self, tag, attrs);
+
+exit:
+ return return_value;
+}
+
+static int
+_elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target,
+ const char *encoding);
+
+static int
+_elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(target), &_Py_ID(encoding), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"target", "encoding", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "XMLParser",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *target = Py_None;
+ const char *encoding = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 0, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (fastargs[0]) {
+ target = fastargs[0];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[1] == Py_None) {
+ encoding = NULL;
+ }
+ else if (PyUnicode_Check(fastargs[1])) {
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(fastargs[1], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("XMLParser", "argument 'encoding'", "str or None", fastargs[1]);
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _elementtree_XMLParser___init___impl((XMLParserObject *)self, target, encoding);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_elementtree_XMLParser_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_XMLPARSER_CLOSE_METHODDEF \
+ {"close", (PyCFunction)_elementtree_XMLParser_close, METH_NOARGS, _elementtree_XMLParser_close__doc__},
+
+static PyObject *
+_elementtree_XMLParser_close_impl(XMLParserObject *self);
+
+static PyObject *
+_elementtree_XMLParser_close(XMLParserObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _elementtree_XMLParser_close_impl(self);
+}
+
+PyDoc_STRVAR(_elementtree_XMLParser_feed__doc__,
+"feed($self, data, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_XMLPARSER_FEED_METHODDEF \
+ {"feed", (PyCFunction)_elementtree_XMLParser_feed, METH_O, _elementtree_XMLParser_feed__doc__},
+
+PyDoc_STRVAR(_elementtree_XMLParser__parse_whole__doc__,
+"_parse_whole($self, file, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_XMLPARSER__PARSE_WHOLE_METHODDEF \
+ {"_parse_whole", (PyCFunction)_elementtree_XMLParser__parse_whole, METH_O, _elementtree_XMLParser__parse_whole__doc__},
+
+PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__,
+"_setevents($self, events_queue, events_to_report=None, /)\n"
+"--\n"
+"\n");
+
+#define _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF \
+ {"_setevents", _PyCFunction_CAST(_elementtree_XMLParser__setevents), METH_FASTCALL, _elementtree_XMLParser__setevents__doc__},
+
+static PyObject *
+_elementtree_XMLParser__setevents_impl(XMLParserObject *self,
+ PyObject *events_queue,
+ PyObject *events_to_report);
+
+static PyObject *
+_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *events_queue;
+ PyObject *events_to_report = Py_None;
+
+ if (!_PyArg_CheckPositional("_setevents", nargs, 1, 2)) {
+ goto exit;
+ }
+ events_queue = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ events_to_report = args[1];
+skip_optional:
+ return_value = _elementtree_XMLParser__setevents_impl(self, events_queue, events_to_report);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=31c4780c4df68441 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h b/contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h
new file mode 100644
index 00000000000..9c79e643041
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_functoolsmodule.c.h
@@ -0,0 +1,104 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_functools_cmp_to_key__doc__,
+"cmp_to_key($module, /, mycmp)\n"
+"--\n"
+"\n"
+"Convert a cmp= function into a key= function.\n"
+"\n"
+" mycmp\n"
+" Function that compares two objects.");
+
+#define _FUNCTOOLS_CMP_TO_KEY_METHODDEF \
+ {"cmp_to_key", _PyCFunction_CAST(_functools_cmp_to_key), METH_FASTCALL|METH_KEYWORDS, _functools_cmp_to_key__doc__},
+
+static PyObject *
+_functools_cmp_to_key_impl(PyObject *module, PyObject *mycmp);
+
+static PyObject *
+_functools_cmp_to_key(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(mycmp), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"mycmp", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "cmp_to_key",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *mycmp;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ mycmp = args[0];
+ return_value = _functools_cmp_to_key_impl(module, mycmp);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_functools__lru_cache_wrapper_cache_info__doc__,
+"cache_info($self, /)\n"
+"--\n"
+"\n"
+"Report cache statistics");
+
+#define _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_INFO_METHODDEF \
+ {"cache_info", (PyCFunction)_functools__lru_cache_wrapper_cache_info, METH_NOARGS, _functools__lru_cache_wrapper_cache_info__doc__},
+
+static PyObject *
+_functools__lru_cache_wrapper_cache_info_impl(PyObject *self);
+
+static PyObject *
+_functools__lru_cache_wrapper_cache_info(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _functools__lru_cache_wrapper_cache_info_impl(self);
+}
+
+PyDoc_STRVAR(_functools__lru_cache_wrapper_cache_clear__doc__,
+"cache_clear($self, /)\n"
+"--\n"
+"\n"
+"Clear the cache and cache statistics");
+
+#define _FUNCTOOLS__LRU_CACHE_WRAPPER_CACHE_CLEAR_METHODDEF \
+ {"cache_clear", (PyCFunction)_functools__lru_cache_wrapper_cache_clear, METH_NOARGS, _functools__lru_cache_wrapper_cache_clear__doc__},
+
+static PyObject *
+_functools__lru_cache_wrapper_cache_clear_impl(PyObject *self);
+
+static PyObject *
+_functools__lru_cache_wrapper_cache_clear(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _functools__lru_cache_wrapper_cache_clear_impl(self);
+}
+/*[clinic end generated code: output=7e7f3bcf9ed61f23 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_hashopenssl.c.h b/contrib/tools/python3/Modules/clinic/_hashopenssl.c.h
new file mode 100644
index 00000000000..fb61a444018
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_hashopenssl.c.h
@@ -0,0 +1,1854 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(EVP_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define EVP_COPY_METHODDEF \
+ {"copy", (PyCFunction)EVP_copy, METH_NOARGS, EVP_copy__doc__},
+
+static PyObject *
+EVP_copy_impl(EVPobject *self);
+
+static PyObject *
+EVP_copy(EVPobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return EVP_copy_impl(self);
+}
+
+PyDoc_STRVAR(EVP_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define EVP_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)EVP_digest, METH_NOARGS, EVP_digest__doc__},
+
+static PyObject *
+EVP_digest_impl(EVPobject *self);
+
+static PyObject *
+EVP_digest(EVPobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return EVP_digest_impl(self);
+}
+
+PyDoc_STRVAR(EVP_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define EVP_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)EVP_hexdigest, METH_NOARGS, EVP_hexdigest__doc__},
+
+static PyObject *
+EVP_hexdigest_impl(EVPobject *self);
+
+static PyObject *
+EVP_hexdigest(EVPobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return EVP_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(EVP_update__doc__,
+"update($self, obj, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided string.");
+
+#define EVP_UPDATE_METHODDEF \
+ {"update", (PyCFunction)EVP_update, METH_O, EVP_update__doc__},
+
+#if defined(PY_OPENSSL_HAS_SHAKE)
+
+PyDoc_STRVAR(EVPXOF_digest__doc__,
+"digest($self, /, length)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define EVPXOF_DIGEST_METHODDEF \
+ {"digest", _PyCFunction_CAST(EVPXOF_digest), METH_FASTCALL|METH_KEYWORDS, EVPXOF_digest__doc__},
+
+static PyObject *
+EVPXOF_digest_impl(EVPobject *self, Py_ssize_t length);
+
+static PyObject *
+EVPXOF_digest(EVPobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "digest",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t length;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
+ }
+ return_value = EVPXOF_digest_impl(self, length);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHAKE) */
+
+#if defined(PY_OPENSSL_HAS_SHAKE)
+
+PyDoc_STRVAR(EVPXOF_hexdigest__doc__,
+"hexdigest($self, /, length)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define EVPXOF_HEXDIGEST_METHODDEF \
+ {"hexdigest", _PyCFunction_CAST(EVPXOF_hexdigest), METH_FASTCALL|METH_KEYWORDS, EVPXOF_hexdigest__doc__},
+
+static PyObject *
+EVPXOF_hexdigest_impl(EVPobject *self, Py_ssize_t length);
+
+static PyObject *
+EVPXOF_hexdigest(EVPobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "hexdigest",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t length;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
+ }
+ return_value = EVPXOF_hexdigest_impl(self, length);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHAKE) */
+
+PyDoc_STRVAR(EVP_new__doc__,
+"new($module, /, name, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new hash object using the named algorithm.\n"
+"\n"
+"An optional string argument may be provided and will be\n"
+"automatically hashed.\n"
+"\n"
+"The MD5 and SHA1 algorithms are always supported.");
+
+#define EVP_NEW_METHODDEF \
+ {"new", _PyCFunction_CAST(EVP_new), METH_FASTCALL|METH_KEYWORDS, EVP_new__doc__},
+
+static PyObject *
+EVP_new_impl(PyObject *module, PyObject *name_obj, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+EVP_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", "string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "new",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *name_obj;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ name_obj = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ data_obj = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[2]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = EVP_new_impl(module, name_obj, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_openssl_md5__doc__,
+"openssl_md5($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a md5 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_MD5_METHODDEF \
+ {"openssl_md5", _PyCFunction_CAST(_hashlib_openssl_md5), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_md5__doc__},
+
+static PyObject *
+_hashlib_openssl_md5_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_md5",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_md5_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_openssl_sha1__doc__,
+"openssl_sha1($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha1 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA1_METHODDEF \
+ {"openssl_sha1", _PyCFunction_CAST(_hashlib_openssl_sha1), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha1__doc__},
+
+static PyObject *
+_hashlib_openssl_sha1_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha1",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha1_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_openssl_sha224__doc__,
+"openssl_sha224($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha224 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA224_METHODDEF \
+ {"openssl_sha224", _PyCFunction_CAST(_hashlib_openssl_sha224), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha224__doc__},
+
+static PyObject *
+_hashlib_openssl_sha224_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha224",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha224_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_openssl_sha256__doc__,
+"openssl_sha256($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha256 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA256_METHODDEF \
+ {"openssl_sha256", _PyCFunction_CAST(_hashlib_openssl_sha256), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha256__doc__},
+
+static PyObject *
+_hashlib_openssl_sha256_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha256",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha256_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_openssl_sha384__doc__,
+"openssl_sha384($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha384 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA384_METHODDEF \
+ {"openssl_sha384", _PyCFunction_CAST(_hashlib_openssl_sha384), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha384__doc__},
+
+static PyObject *
+_hashlib_openssl_sha384_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha384",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha384_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_openssl_sha512__doc__,
+"openssl_sha512($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha512 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA512_METHODDEF \
+ {"openssl_sha512", _PyCFunction_CAST(_hashlib_openssl_sha512), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha512__doc__},
+
+static PyObject *
+_hashlib_openssl_sha512_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha512",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha512_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#if defined(PY_OPENSSL_HAS_SHA3)
+
+PyDoc_STRVAR(_hashlib_openssl_sha3_224__doc__,
+"openssl_sha3_224($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha3-224 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA3_224_METHODDEF \
+ {"openssl_sha3_224", _PyCFunction_CAST(_hashlib_openssl_sha3_224), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha3_224__doc__},
+
+static PyObject *
+_hashlib_openssl_sha3_224_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha3_224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha3_224",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha3_224_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHA3) */
+
+#if defined(PY_OPENSSL_HAS_SHA3)
+
+PyDoc_STRVAR(_hashlib_openssl_sha3_256__doc__,
+"openssl_sha3_256($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha3-256 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA3_256_METHODDEF \
+ {"openssl_sha3_256", _PyCFunction_CAST(_hashlib_openssl_sha3_256), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha3_256__doc__},
+
+static PyObject *
+_hashlib_openssl_sha3_256_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha3_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha3_256",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha3_256_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHA3) */
+
+#if defined(PY_OPENSSL_HAS_SHA3)
+
+PyDoc_STRVAR(_hashlib_openssl_sha3_384__doc__,
+"openssl_sha3_384($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha3-384 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA3_384_METHODDEF \
+ {"openssl_sha3_384", _PyCFunction_CAST(_hashlib_openssl_sha3_384), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha3_384__doc__},
+
+static PyObject *
+_hashlib_openssl_sha3_384_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha3_384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha3_384",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha3_384_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHA3) */
+
+#if defined(PY_OPENSSL_HAS_SHA3)
+
+PyDoc_STRVAR(_hashlib_openssl_sha3_512__doc__,
+"openssl_sha3_512($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a sha3-512 hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHA3_512_METHODDEF \
+ {"openssl_sha3_512", _PyCFunction_CAST(_hashlib_openssl_sha3_512), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_sha3_512__doc__},
+
+static PyObject *
+_hashlib_openssl_sha3_512_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_sha3_512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_sha3_512",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_sha3_512_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHA3) */
+
+#if defined(PY_OPENSSL_HAS_SHAKE)
+
+PyDoc_STRVAR(_hashlib_openssl_shake_128__doc__,
+"openssl_shake_128($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a shake-128 variable hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHAKE_128_METHODDEF \
+ {"openssl_shake_128", _PyCFunction_CAST(_hashlib_openssl_shake_128), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_128__doc__},
+
+static PyObject *
+_hashlib_openssl_shake_128_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_shake_128(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_shake_128",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_shake_128_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHAKE) */
+
+#if defined(PY_OPENSSL_HAS_SHAKE)
+
+PyDoc_STRVAR(_hashlib_openssl_shake_256__doc__,
+"openssl_shake_256($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Returns a shake-256 variable hash object; optionally initialized with a string");
+
+#define _HASHLIB_OPENSSL_SHAKE_256_METHODDEF \
+ {"openssl_shake_256", _PyCFunction_CAST(_hashlib_openssl_shake_256), METH_FASTCALL|METH_KEYWORDS, _hashlib_openssl_shake_256__doc__},
+
+static PyObject *
+_hashlib_openssl_shake_256_impl(PyObject *module, PyObject *data_obj,
+ int usedforsecurity);
+
+static PyObject *
+_hashlib_openssl_shake_256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openssl_shake_256",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *data_obj = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ data_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_openssl_shake_256_impl(module, data_obj, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SHAKE) */
+
+PyDoc_STRVAR(pbkdf2_hmac__doc__,
+"pbkdf2_hmac($module, /, hash_name, password, salt, iterations,\n"
+" dklen=None)\n"
+"--\n"
+"\n"
+"Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as pseudorandom function.");
+
+#define PBKDF2_HMAC_METHODDEF \
+ {"pbkdf2_hmac", _PyCFunction_CAST(pbkdf2_hmac), METH_FASTCALL|METH_KEYWORDS, pbkdf2_hmac__doc__},
+
+static PyObject *
+pbkdf2_hmac_impl(PyObject *module, const char *hash_name,
+ Py_buffer *password, Py_buffer *salt, long iterations,
+ PyObject *dklen_obj);
+
+static PyObject *
+pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(hash_name), &_Py_ID(password), &_Py_ID(salt), &_Py_ID(iterations), &_Py_ID(dklen), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"hash_name", "password", "salt", "iterations", "dklen", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "pbkdf2_hmac",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 4;
+ const char *hash_name;
+ Py_buffer password = {NULL, NULL};
+ Py_buffer salt = {NULL, NULL};
+ long iterations;
+ PyObject *dklen_obj = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 5, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("pbkdf2_hmac", "argument 'hash_name'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t hash_name_length;
+ hash_name = PyUnicode_AsUTF8AndSize(args[0], &hash_name_length);
+ if (hash_name == NULL) {
+ goto exit;
+ }
+ if (strlen(hash_name) != (size_t)hash_name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &password, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&password, 'C')) {
+ _PyArg_BadArgument("pbkdf2_hmac", "argument 'password'", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[2], &salt, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&salt, 'C')) {
+ _PyArg_BadArgument("pbkdf2_hmac", "argument 'salt'", "contiguous buffer", args[2]);
+ goto exit;
+ }
+ iterations = PyLong_AsLong(args[3]);
+ if (iterations == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ dklen_obj = args[4];
+skip_optional_pos:
+ return_value = pbkdf2_hmac_impl(module, hash_name, &password, &salt, iterations, dklen_obj);
+
+exit:
+ /* Cleanup for password */
+ if (password.obj) {
+ PyBuffer_Release(&password);
+ }
+ /* Cleanup for salt */
+ if (salt.obj) {
+ PyBuffer_Release(&salt);
+ }
+
+ return return_value;
+}
+
+#if defined(PY_OPENSSL_HAS_SCRYPT)
+
+PyDoc_STRVAR(_hashlib_scrypt__doc__,
+"scrypt($module, /, password, *, salt=None, n=None, r=None, p=None,\n"
+" maxmem=0, dklen=64)\n"
+"--\n"
+"\n"
+"scrypt password-based key derivation function.");
+
+#define _HASHLIB_SCRYPT_METHODDEF \
+ {"scrypt", _PyCFunction_CAST(_hashlib_scrypt), METH_FASTCALL|METH_KEYWORDS, _hashlib_scrypt__doc__},
+
+static PyObject *
+_hashlib_scrypt_impl(PyObject *module, Py_buffer *password, Py_buffer *salt,
+ PyObject *n_obj, PyObject *r_obj, PyObject *p_obj,
+ long maxmem, long dklen);
+
+static PyObject *
+_hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 7
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(password), &_Py_ID(salt), &_Py_ID(n), &_Py_ID(r), &_Py_ID(p), &_Py_ID(maxmem), &_Py_ID(dklen), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"password", "salt", "n", "r", "p", "maxmem", "dklen", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "scrypt",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[7];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer password = {NULL, NULL};
+ Py_buffer salt = {NULL, NULL};
+ PyObject *n_obj = Py_None;
+ PyObject *r_obj = Py_None;
+ PyObject *p_obj = Py_None;
+ long maxmem = 0;
+ long dklen = 64;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &password, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&password, 'C')) {
+ _PyArg_BadArgument("scrypt", "argument 'password'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[1]) {
+ if (PyObject_GetBuffer(args[1], &salt, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&salt, 'C')) {
+ _PyArg_BadArgument("scrypt", "argument 'salt'", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[2]) {
+ if (!PyLong_Check(args[2])) {
+ _PyArg_BadArgument("scrypt", "argument 'n'", "int", args[2]);
+ goto exit;
+ }
+ n_obj = args[2];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ if (!PyLong_Check(args[3])) {
+ _PyArg_BadArgument("scrypt", "argument 'r'", "int", args[3]);
+ goto exit;
+ }
+ r_obj = args[3];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[4]) {
+ if (!PyLong_Check(args[4])) {
+ _PyArg_BadArgument("scrypt", "argument 'p'", "int", args[4]);
+ goto exit;
+ }
+ p_obj = args[4];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[5]) {
+ maxmem = PyLong_AsLong(args[5]);
+ if (maxmem == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ dklen = PyLong_AsLong(args[6]);
+ if (dklen == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _hashlib_scrypt_impl(module, &password, &salt, n_obj, r_obj, p_obj, maxmem, dklen);
+
+exit:
+ /* Cleanup for password */
+ if (password.obj) {
+ PyBuffer_Release(&password);
+ }
+ /* Cleanup for salt */
+ if (salt.obj) {
+ PyBuffer_Release(&salt);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(PY_OPENSSL_HAS_SCRYPT) */
+
+PyDoc_STRVAR(_hashlib_hmac_singleshot__doc__,
+"hmac_digest($module, /, key, msg, digest)\n"
+"--\n"
+"\n"
+"Single-shot HMAC.");
+
+#define _HASHLIB_HMAC_SINGLESHOT_METHODDEF \
+ {"hmac_digest", _PyCFunction_CAST(_hashlib_hmac_singleshot), METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_singleshot__doc__},
+
+static PyObject *
+_hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key,
+ Py_buffer *msg, PyObject *digest);
+
+static PyObject *
+_hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digest), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"key", "msg", "digest", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "hmac_digest",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_buffer key = {NULL, NULL};
+ Py_buffer msg = {NULL, NULL};
+ PyObject *digest;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&key, 'C')) {
+ _PyArg_BadArgument("hmac_digest", "argument 'key'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&msg, 'C')) {
+ _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ digest = args[2];
+ return_value = _hashlib_hmac_singleshot_impl(module, &key, &msg, digest);
+
+exit:
+ /* Cleanup for key */
+ if (key.obj) {
+ PyBuffer_Release(&key);
+ }
+ /* Cleanup for msg */
+ if (msg.obj) {
+ PyBuffer_Release(&msg);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_hmac_new__doc__,
+"hmac_new($module, /, key, msg=b\'\', digestmod=None)\n"
+"--\n"
+"\n"
+"Return a new hmac object.");
+
+#define _HASHLIB_HMAC_NEW_METHODDEF \
+ {"hmac_new", _PyCFunction_CAST(_hashlib_hmac_new), METH_FASTCALL|METH_KEYWORDS, _hashlib_hmac_new__doc__},
+
+static PyObject *
+_hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj,
+ PyObject *digestmod);
+
+static PyObject *
+_hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(key), &_Py_ID(msg), &_Py_ID(digestmod), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"key", "msg", "digestmod", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "hmac_new",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer key = {NULL, NULL};
+ PyObject *msg_obj = NULL;
+ PyObject *digestmod = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&key, 'C')) {
+ _PyArg_BadArgument("hmac_new", "argument 'key'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ msg_obj = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ digestmod = args[2];
+skip_optional_pos:
+ return_value = _hashlib_hmac_new_impl(module, &key, msg_obj, digestmod);
+
+exit:
+ /* Cleanup for key */
+ if (key.obj) {
+ PyBuffer_Release(&key);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_HMAC_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy (\"clone\") of the HMAC object.");
+
+#define _HASHLIB_HMAC_COPY_METHODDEF \
+ {"copy", (PyCFunction)_hashlib_HMAC_copy, METH_NOARGS, _hashlib_HMAC_copy__doc__},
+
+static PyObject *
+_hashlib_HMAC_copy_impl(HMACobject *self);
+
+static PyObject *
+_hashlib_HMAC_copy(HMACobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _hashlib_HMAC_copy_impl(self);
+}
+
+PyDoc_STRVAR(_hashlib_HMAC_update__doc__,
+"update($self, /, msg)\n"
+"--\n"
+"\n"
+"Update the HMAC object with msg.");
+
+#define _HASHLIB_HMAC_UPDATE_METHODDEF \
+ {"update", _PyCFunction_CAST(_hashlib_HMAC_update), METH_FASTCALL|METH_KEYWORDS, _hashlib_HMAC_update__doc__},
+
+static PyObject *
+_hashlib_HMAC_update_impl(HMACobject *self, PyObject *msg);
+
+static PyObject *
+_hashlib_HMAC_update(HMACobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(msg), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"msg", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "update",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *msg;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ msg = args[0];
+ return_value = _hashlib_HMAC_update_impl(self, msg);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_HMAC_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest of the bytes passed to the update() method so far.");
+
+#define _HASHLIB_HMAC_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)_hashlib_HMAC_digest, METH_NOARGS, _hashlib_HMAC_digest__doc__},
+
+static PyObject *
+_hashlib_HMAC_digest_impl(HMACobject *self);
+
+static PyObject *
+_hashlib_HMAC_digest(HMACobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _hashlib_HMAC_digest_impl(self);
+}
+
+PyDoc_STRVAR(_hashlib_HMAC_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return hexadecimal digest of the bytes passed to the update() method so far.\n"
+"\n"
+"This may be used to exchange the value safely in email or other non-binary\n"
+"environments.");
+
+#define _HASHLIB_HMAC_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)_hashlib_HMAC_hexdigest, METH_NOARGS, _hashlib_HMAC_hexdigest__doc__},
+
+static PyObject *
+_hashlib_HMAC_hexdigest_impl(HMACobject *self);
+
+static PyObject *
+_hashlib_HMAC_hexdigest(HMACobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _hashlib_HMAC_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(_hashlib_get_fips_mode__doc__,
+"get_fips_mode($module, /)\n"
+"--\n"
+"\n"
+"Determine the OpenSSL FIPS mode of operation.\n"
+"\n"
+"For OpenSSL 3.0.0 and newer it returns the state of the default provider\n"
+"in the default OSSL context. It\'s not quite the same as FIPS_mode() but good\n"
+"enough for unittests.\n"
+"\n"
+"Effectively any non-zero return value indicates FIPS mode;\n"
+"values other than 1 may have additional significance.");
+
+#define _HASHLIB_GET_FIPS_MODE_METHODDEF \
+ {"get_fips_mode", (PyCFunction)_hashlib_get_fips_mode, METH_NOARGS, _hashlib_get_fips_mode__doc__},
+
+static int
+_hashlib_get_fips_mode_impl(PyObject *module);
+
+static PyObject *
+_hashlib_get_fips_mode(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _hashlib_get_fips_mode_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_hashlib_compare_digest__doc__,
+"compare_digest($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return \'a == b\'.\n"
+"\n"
+"This function uses an approach designed to prevent\n"
+"timing analysis, making it appropriate for cryptography.\n"
+"\n"
+"a and b must both be of the same type: either str (ASCII only),\n"
+"or any bytes-like object.\n"
+"\n"
+"Note: If a and b are of different lengths, or if an error occurs,\n"
+"a timing attack could theoretically reveal information about the\n"
+"types and lengths of a and b--but not their values.");
+
+#define _HASHLIB_COMPARE_DIGEST_METHODDEF \
+ {"compare_digest", _PyCFunction_CAST(_hashlib_compare_digest), METH_FASTCALL, _hashlib_compare_digest__doc__},
+
+static PyObject *
+_hashlib_compare_digest_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_hashlib_compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("compare_digest", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _hashlib_compare_digest_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+#ifndef EVPXOF_DIGEST_METHODDEF
+ #define EVPXOF_DIGEST_METHODDEF
+#endif /* !defined(EVPXOF_DIGEST_METHODDEF) */
+
+#ifndef EVPXOF_HEXDIGEST_METHODDEF
+ #define EVPXOF_HEXDIGEST_METHODDEF
+#endif /* !defined(EVPXOF_HEXDIGEST_METHODDEF) */
+
+#ifndef _HASHLIB_OPENSSL_SHA3_224_METHODDEF
+ #define _HASHLIB_OPENSSL_SHA3_224_METHODDEF
+#endif /* !defined(_HASHLIB_OPENSSL_SHA3_224_METHODDEF) */
+
+#ifndef _HASHLIB_OPENSSL_SHA3_256_METHODDEF
+ #define _HASHLIB_OPENSSL_SHA3_256_METHODDEF
+#endif /* !defined(_HASHLIB_OPENSSL_SHA3_256_METHODDEF) */
+
+#ifndef _HASHLIB_OPENSSL_SHA3_384_METHODDEF
+ #define _HASHLIB_OPENSSL_SHA3_384_METHODDEF
+#endif /* !defined(_HASHLIB_OPENSSL_SHA3_384_METHODDEF) */
+
+#ifndef _HASHLIB_OPENSSL_SHA3_512_METHODDEF
+ #define _HASHLIB_OPENSSL_SHA3_512_METHODDEF
+#endif /* !defined(_HASHLIB_OPENSSL_SHA3_512_METHODDEF) */
+
+#ifndef _HASHLIB_OPENSSL_SHAKE_128_METHODDEF
+ #define _HASHLIB_OPENSSL_SHAKE_128_METHODDEF
+#endif /* !defined(_HASHLIB_OPENSSL_SHAKE_128_METHODDEF) */
+
+#ifndef _HASHLIB_OPENSSL_SHAKE_256_METHODDEF
+ #define _HASHLIB_OPENSSL_SHAKE_256_METHODDEF
+#endif /* !defined(_HASHLIB_OPENSSL_SHAKE_256_METHODDEF) */
+
+#ifndef _HASHLIB_SCRYPT_METHODDEF
+ #define _HASHLIB_SCRYPT_METHODDEF
+#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
+/*[clinic end generated code: output=b339e255db698147 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_heapqmodule.c.h b/contrib/tools/python3/Modules/clinic/_heapqmodule.c.h
new file mode 100644
index 00000000000..3ee3f51702f
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_heapqmodule.c.h
@@ -0,0 +1,274 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_heapq_heappush__doc__,
+"heappush($module, heap, item, /)\n"
+"--\n"
+"\n"
+"Push item onto heap, maintaining the heap invariant.");
+
+#define _HEAPQ_HEAPPUSH_METHODDEF \
+ {"heappush", _PyCFunction_CAST(_heapq_heappush), METH_FASTCALL, _heapq_heappush__doc__},
+
+static PyObject *
+_heapq_heappush_impl(PyObject *module, PyObject *heap, PyObject *item);
+
+static PyObject *
+_heapq_heappush(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+ PyObject *item;
+
+ if (!_PyArg_CheckPositional("heappush", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyList_Check(args[0])) {
+ _PyArg_BadArgument("heappush", "argument 1", "list", args[0]);
+ goto exit;
+ }
+ heap = args[0];
+ item = args[1];
+ return_value = _heapq_heappush_impl(module, heap, item);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq_heappop__doc__,
+"heappop($module, heap, /)\n"
+"--\n"
+"\n"
+"Pop the smallest item off the heap, maintaining the heap invariant.");
+
+#define _HEAPQ_HEAPPOP_METHODDEF \
+ {"heappop", (PyCFunction)_heapq_heappop, METH_O, _heapq_heappop__doc__},
+
+static PyObject *
+_heapq_heappop_impl(PyObject *module, PyObject *heap);
+
+static PyObject *
+_heapq_heappop(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+
+ if (!PyList_Check(arg)) {
+ _PyArg_BadArgument("heappop", "argument", "list", arg);
+ goto exit;
+ }
+ heap = arg;
+ return_value = _heapq_heappop_impl(module, heap);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq_heapreplace__doc__,
+"heapreplace($module, heap, item, /)\n"
+"--\n"
+"\n"
+"Pop and return the current smallest value, and add the new item.\n"
+"\n"
+"This is more efficient than heappop() followed by heappush(), and can be\n"
+"more appropriate when using a fixed-size heap. Note that the value\n"
+"returned may be larger than item! That constrains reasonable uses of\n"
+"this routine unless written as part of a conditional replacement:\n"
+"\n"
+" if item > heap[0]:\n"
+" item = heapreplace(heap, item)");
+
+#define _HEAPQ_HEAPREPLACE_METHODDEF \
+ {"heapreplace", _PyCFunction_CAST(_heapq_heapreplace), METH_FASTCALL, _heapq_heapreplace__doc__},
+
+static PyObject *
+_heapq_heapreplace_impl(PyObject *module, PyObject *heap, PyObject *item);
+
+static PyObject *
+_heapq_heapreplace(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+ PyObject *item;
+
+ if (!_PyArg_CheckPositional("heapreplace", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyList_Check(args[0])) {
+ _PyArg_BadArgument("heapreplace", "argument 1", "list", args[0]);
+ goto exit;
+ }
+ heap = args[0];
+ item = args[1];
+ return_value = _heapq_heapreplace_impl(module, heap, item);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq_heappushpop__doc__,
+"heappushpop($module, heap, item, /)\n"
+"--\n"
+"\n"
+"Push item on the heap, then pop and return the smallest item from the heap.\n"
+"\n"
+"The combined action runs more efficiently than heappush() followed by\n"
+"a separate call to heappop().");
+
+#define _HEAPQ_HEAPPUSHPOP_METHODDEF \
+ {"heappushpop", _PyCFunction_CAST(_heapq_heappushpop), METH_FASTCALL, _heapq_heappushpop__doc__},
+
+static PyObject *
+_heapq_heappushpop_impl(PyObject *module, PyObject *heap, PyObject *item);
+
+static PyObject *
+_heapq_heappushpop(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+ PyObject *item;
+
+ if (!_PyArg_CheckPositional("heappushpop", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyList_Check(args[0])) {
+ _PyArg_BadArgument("heappushpop", "argument 1", "list", args[0]);
+ goto exit;
+ }
+ heap = args[0];
+ item = args[1];
+ return_value = _heapq_heappushpop_impl(module, heap, item);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq_heapify__doc__,
+"heapify($module, heap, /)\n"
+"--\n"
+"\n"
+"Transform list into a heap, in-place, in O(len(heap)) time.");
+
+#define _HEAPQ_HEAPIFY_METHODDEF \
+ {"heapify", (PyCFunction)_heapq_heapify, METH_O, _heapq_heapify__doc__},
+
+static PyObject *
+_heapq_heapify_impl(PyObject *module, PyObject *heap);
+
+static PyObject *
+_heapq_heapify(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+
+ if (!PyList_Check(arg)) {
+ _PyArg_BadArgument("heapify", "argument", "list", arg);
+ goto exit;
+ }
+ heap = arg;
+ return_value = _heapq_heapify_impl(module, heap);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq__heappop_max__doc__,
+"_heappop_max($module, heap, /)\n"
+"--\n"
+"\n"
+"Maxheap variant of heappop.");
+
+#define _HEAPQ__HEAPPOP_MAX_METHODDEF \
+ {"_heappop_max", (PyCFunction)_heapq__heappop_max, METH_O, _heapq__heappop_max__doc__},
+
+static PyObject *
+_heapq__heappop_max_impl(PyObject *module, PyObject *heap);
+
+static PyObject *
+_heapq__heappop_max(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+
+ if (!PyList_Check(arg)) {
+ _PyArg_BadArgument("_heappop_max", "argument", "list", arg);
+ goto exit;
+ }
+ heap = arg;
+ return_value = _heapq__heappop_max_impl(module, heap);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq__heapreplace_max__doc__,
+"_heapreplace_max($module, heap, item, /)\n"
+"--\n"
+"\n"
+"Maxheap variant of heapreplace.");
+
+#define _HEAPQ__HEAPREPLACE_MAX_METHODDEF \
+ {"_heapreplace_max", _PyCFunction_CAST(_heapq__heapreplace_max), METH_FASTCALL, _heapq__heapreplace_max__doc__},
+
+static PyObject *
+_heapq__heapreplace_max_impl(PyObject *module, PyObject *heap,
+ PyObject *item);
+
+static PyObject *
+_heapq__heapreplace_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+ PyObject *item;
+
+ if (!_PyArg_CheckPositional("_heapreplace_max", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyList_Check(args[0])) {
+ _PyArg_BadArgument("_heapreplace_max", "argument 1", "list", args[0]);
+ goto exit;
+ }
+ heap = args[0];
+ item = args[1];
+ return_value = _heapq__heapreplace_max_impl(module, heap, item);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_heapq__heapify_max__doc__,
+"_heapify_max($module, heap, /)\n"
+"--\n"
+"\n"
+"Maxheap variant of heapify.");
+
+#define _HEAPQ__HEAPIFY_MAX_METHODDEF \
+ {"_heapify_max", (PyCFunction)_heapq__heapify_max, METH_O, _heapq__heapify_max__doc__},
+
+static PyObject *
+_heapq__heapify_max_impl(PyObject *module, PyObject *heap);
+
+static PyObject *
+_heapq__heapify_max(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *heap;
+
+ if (!PyList_Check(arg)) {
+ _PyArg_BadArgument("_heapify_max", "argument", "list", arg);
+ goto exit;
+ }
+ heap = arg;
+ return_value = _heapq__heapify_max_impl(module, heap);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=29e99a48c57f82bb input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_localemodule.c.h b/contrib/tools/python3/Modules/clinic/_localemodule.c.h
new file mode 100644
index 00000000000..e6b99962d15
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_localemodule.c.h
@@ -0,0 +1,611 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_locale_setlocale__doc__,
+"setlocale($module, category, locale=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Activates/queries locale processing.");
+
+#define _LOCALE_SETLOCALE_METHODDEF \
+ {"setlocale", _PyCFunction_CAST(_locale_setlocale), METH_FASTCALL, _locale_setlocale__doc__},
+
+static PyObject *
+_locale_setlocale_impl(PyObject *module, int category, const char *locale);
+
+static PyObject *
+_locale_setlocale(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int category;
+ const char *locale = NULL;
+
+ if (!_PyArg_CheckPositional("setlocale", nargs, 1, 2)) {
+ goto exit;
+ }
+ category = _PyLong_AsInt(args[0]);
+ if (category == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (args[1] == Py_None) {
+ locale = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t locale_length;
+ locale = PyUnicode_AsUTF8AndSize(args[1], &locale_length);
+ if (locale == NULL) {
+ goto exit;
+ }
+ if (strlen(locale) != (size_t)locale_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("setlocale", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+skip_optional:
+ return_value = _locale_setlocale_impl(module, category, locale);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_locale_localeconv__doc__,
+"localeconv($module, /)\n"
+"--\n"
+"\n"
+"Returns numeric and monetary locale-specific parameters.");
+
+#define _LOCALE_LOCALECONV_METHODDEF \
+ {"localeconv", (PyCFunction)_locale_localeconv, METH_NOARGS, _locale_localeconv__doc__},
+
+static PyObject *
+_locale_localeconv_impl(PyObject *module);
+
+static PyObject *
+_locale_localeconv(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _locale_localeconv_impl(module);
+}
+
+#if defined(HAVE_WCSCOLL)
+
+PyDoc_STRVAR(_locale_strcoll__doc__,
+"strcoll($module, os1, os2, /)\n"
+"--\n"
+"\n"
+"Compares two strings according to the locale.");
+
+#define _LOCALE_STRCOLL_METHODDEF \
+ {"strcoll", _PyCFunction_CAST(_locale_strcoll), METH_FASTCALL, _locale_strcoll__doc__},
+
+static PyObject *
+_locale_strcoll_impl(PyObject *module, PyObject *os1, PyObject *os2);
+
+static PyObject *
+_locale_strcoll(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *os1;
+ PyObject *os2;
+
+ if (!_PyArg_CheckPositional("strcoll", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("strcoll", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ os1 = args[0];
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("strcoll", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[1]) == -1) {
+ goto exit;
+ }
+ os2 = args[1];
+ return_value = _locale_strcoll_impl(module, os1, os2);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WCSCOLL) */
+
+#if defined(HAVE_WCSXFRM)
+
+PyDoc_STRVAR(_locale_strxfrm__doc__,
+"strxfrm($module, string, /)\n"
+"--\n"
+"\n"
+"Return a string that can be used as a key for locale-aware comparisons.");
+
+#define _LOCALE_STRXFRM_METHODDEF \
+ {"strxfrm", (PyCFunction)_locale_strxfrm, METH_O, _locale_strxfrm__doc__},
+
+static PyObject *
+_locale_strxfrm_impl(PyObject *module, PyObject *str);
+
+static PyObject *
+_locale_strxfrm(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *str;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("strxfrm", "argument", "str", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ str = arg;
+ return_value = _locale_strxfrm_impl(module, str);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WCSXFRM) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(_locale__getdefaultlocale__doc__,
+"_getdefaultlocale($module, /)\n"
+"--\n"
+"\n");
+
+#define _LOCALE__GETDEFAULTLOCALE_METHODDEF \
+ {"_getdefaultlocale", (PyCFunction)_locale__getdefaultlocale, METH_NOARGS, _locale__getdefaultlocale__doc__},
+
+static PyObject *
+_locale__getdefaultlocale_impl(PyObject *module);
+
+static PyObject *
+_locale__getdefaultlocale(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _locale__getdefaultlocale_impl(module);
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(HAVE_LANGINFO_H)
+
+PyDoc_STRVAR(_locale_nl_langinfo__doc__,
+"nl_langinfo($module, key, /)\n"
+"--\n"
+"\n"
+"Return the value for the locale information associated with key.");
+
+#define _LOCALE_NL_LANGINFO_METHODDEF \
+ {"nl_langinfo", (PyCFunction)_locale_nl_langinfo, METH_O, _locale_nl_langinfo__doc__},
+
+static PyObject *
+_locale_nl_langinfo_impl(PyObject *module, int item);
+
+static PyObject *
+_locale_nl_langinfo(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int item;
+
+ item = _PyLong_AsInt(arg);
+ if (item == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _locale_nl_langinfo_impl(module, item);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LANGINFO_H) */
+
+#if defined(HAVE_LIBINTL_H)
+
+PyDoc_STRVAR(_locale_gettext__doc__,
+"gettext($module, msg, /)\n"
+"--\n"
+"\n"
+"gettext(msg) -> string\n"
+"\n"
+"Return translation of msg.");
+
+#define _LOCALE_GETTEXT_METHODDEF \
+ {"gettext", (PyCFunction)_locale_gettext, METH_O, _locale_gettext__doc__},
+
+static PyObject *
+_locale_gettext_impl(PyObject *module, const char *in);
+
+static PyObject *
+_locale_gettext(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *in;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("gettext", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t in_length;
+ in = PyUnicode_AsUTF8AndSize(arg, &in_length);
+ if (in == NULL) {
+ goto exit;
+ }
+ if (strlen(in) != (size_t)in_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _locale_gettext_impl(module, in);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LIBINTL_H) */
+
+#if defined(HAVE_LIBINTL_H)
+
+PyDoc_STRVAR(_locale_dgettext__doc__,
+"dgettext($module, domain, msg, /)\n"
+"--\n"
+"\n"
+"dgettext(domain, msg) -> string\n"
+"\n"
+"Return translation of msg in domain.");
+
+#define _LOCALE_DGETTEXT_METHODDEF \
+ {"dgettext", _PyCFunction_CAST(_locale_dgettext), METH_FASTCALL, _locale_dgettext__doc__},
+
+static PyObject *
+_locale_dgettext_impl(PyObject *module, const char *domain, const char *in);
+
+static PyObject *
+_locale_dgettext(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *domain;
+ const char *in;
+
+ if (!_PyArg_CheckPositional("dgettext", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (args[0] == Py_None) {
+ domain = NULL;
+ }
+ else if (PyUnicode_Check(args[0])) {
+ Py_ssize_t domain_length;
+ domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length);
+ if (domain == NULL) {
+ goto exit;
+ }
+ if (strlen(domain) != (size_t)domain_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("dgettext", "argument 1", "str or None", args[0]);
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("dgettext", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t in_length;
+ in = PyUnicode_AsUTF8AndSize(args[1], &in_length);
+ if (in == NULL) {
+ goto exit;
+ }
+ if (strlen(in) != (size_t)in_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _locale_dgettext_impl(module, domain, in);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LIBINTL_H) */
+
+#if defined(HAVE_LIBINTL_H)
+
+PyDoc_STRVAR(_locale_dcgettext__doc__,
+"dcgettext($module, domain, msg, category, /)\n"
+"--\n"
+"\n"
+"Return translation of msg in domain and category.");
+
+#define _LOCALE_DCGETTEXT_METHODDEF \
+ {"dcgettext", _PyCFunction_CAST(_locale_dcgettext), METH_FASTCALL, _locale_dcgettext__doc__},
+
+static PyObject *
+_locale_dcgettext_impl(PyObject *module, const char *domain,
+ const char *msgid, int category);
+
+static PyObject *
+_locale_dcgettext(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *domain;
+ const char *msgid;
+ int category;
+
+ if (!_PyArg_CheckPositional("dcgettext", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (args[0] == Py_None) {
+ domain = NULL;
+ }
+ else if (PyUnicode_Check(args[0])) {
+ Py_ssize_t domain_length;
+ domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length);
+ if (domain == NULL) {
+ goto exit;
+ }
+ if (strlen(domain) != (size_t)domain_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("dcgettext", "argument 1", "str or None", args[0]);
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("dcgettext", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t msgid_length;
+ msgid = PyUnicode_AsUTF8AndSize(args[1], &msgid_length);
+ if (msgid == NULL) {
+ goto exit;
+ }
+ if (strlen(msgid) != (size_t)msgid_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ category = _PyLong_AsInt(args[2]);
+ if (category == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _locale_dcgettext_impl(module, domain, msgid, category);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LIBINTL_H) */
+
+#if defined(HAVE_LIBINTL_H)
+
+PyDoc_STRVAR(_locale_textdomain__doc__,
+"textdomain($module, domain, /)\n"
+"--\n"
+"\n"
+"Set the C library\'s textdmain to domain, returning the new domain.");
+
+#define _LOCALE_TEXTDOMAIN_METHODDEF \
+ {"textdomain", (PyCFunction)_locale_textdomain, METH_O, _locale_textdomain__doc__},
+
+static PyObject *
+_locale_textdomain_impl(PyObject *module, const char *domain);
+
+static PyObject *
+_locale_textdomain(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *domain;
+
+ if (arg == Py_None) {
+ domain = NULL;
+ }
+ else if (PyUnicode_Check(arg)) {
+ Py_ssize_t domain_length;
+ domain = PyUnicode_AsUTF8AndSize(arg, &domain_length);
+ if (domain == NULL) {
+ goto exit;
+ }
+ if (strlen(domain) != (size_t)domain_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("textdomain", "argument", "str or None", arg);
+ goto exit;
+ }
+ return_value = _locale_textdomain_impl(module, domain);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LIBINTL_H) */
+
+#if defined(HAVE_LIBINTL_H)
+
+PyDoc_STRVAR(_locale_bindtextdomain__doc__,
+"bindtextdomain($module, domain, dir, /)\n"
+"--\n"
+"\n"
+"Bind the C library\'s domain to dir.");
+
+#define _LOCALE_BINDTEXTDOMAIN_METHODDEF \
+ {"bindtextdomain", _PyCFunction_CAST(_locale_bindtextdomain), METH_FASTCALL, _locale_bindtextdomain__doc__},
+
+static PyObject *
+_locale_bindtextdomain_impl(PyObject *module, const char *domain,
+ PyObject *dirname_obj);
+
+static PyObject *
+_locale_bindtextdomain(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *domain;
+ PyObject *dirname_obj;
+
+ if (!_PyArg_CheckPositional("bindtextdomain", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("bindtextdomain", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t domain_length;
+ domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length);
+ if (domain == NULL) {
+ goto exit;
+ }
+ if (strlen(domain) != (size_t)domain_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ dirname_obj = args[1];
+ return_value = _locale_bindtextdomain_impl(module, domain, dirname_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LIBINTL_H) */
+
+#if defined(HAVE_LIBINTL_H) && defined(HAVE_BIND_TEXTDOMAIN_CODESET)
+
+PyDoc_STRVAR(_locale_bind_textdomain_codeset__doc__,
+"bind_textdomain_codeset($module, domain, codeset, /)\n"
+"--\n"
+"\n"
+"Bind the C library\'s domain to codeset.");
+
+#define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF \
+ {"bind_textdomain_codeset", _PyCFunction_CAST(_locale_bind_textdomain_codeset), METH_FASTCALL, _locale_bind_textdomain_codeset__doc__},
+
+static PyObject *
+_locale_bind_textdomain_codeset_impl(PyObject *module, const char *domain,
+ const char *codeset);
+
+static PyObject *
+_locale_bind_textdomain_codeset(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *domain;
+ const char *codeset;
+
+ if (!_PyArg_CheckPositional("bind_textdomain_codeset", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("bind_textdomain_codeset", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t domain_length;
+ domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length);
+ if (domain == NULL) {
+ goto exit;
+ }
+ if (strlen(domain) != (size_t)domain_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (args[1] == Py_None) {
+ codeset = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t codeset_length;
+ codeset = PyUnicode_AsUTF8AndSize(args[1], &codeset_length);
+ if (codeset == NULL) {
+ goto exit;
+ }
+ if (strlen(codeset) != (size_t)codeset_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("bind_textdomain_codeset", "argument 2", "str or None", args[1]);
+ goto exit;
+ }
+ return_value = _locale_bind_textdomain_codeset_impl(module, domain, codeset);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LIBINTL_H) && defined(HAVE_BIND_TEXTDOMAIN_CODESET) */
+
+PyDoc_STRVAR(_locale_getencoding__doc__,
+"getencoding($module, /)\n"
+"--\n"
+"\n"
+"Get the current locale encoding.");
+
+#define _LOCALE_GETENCODING_METHODDEF \
+ {"getencoding", (PyCFunction)_locale_getencoding, METH_NOARGS, _locale_getencoding__doc__},
+
+static PyObject *
+_locale_getencoding_impl(PyObject *module);
+
+static PyObject *
+_locale_getencoding(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _locale_getencoding_impl(module);
+}
+
+#ifndef _LOCALE_STRCOLL_METHODDEF
+ #define _LOCALE_STRCOLL_METHODDEF
+#endif /* !defined(_LOCALE_STRCOLL_METHODDEF) */
+
+#ifndef _LOCALE_STRXFRM_METHODDEF
+ #define _LOCALE_STRXFRM_METHODDEF
+#endif /* !defined(_LOCALE_STRXFRM_METHODDEF) */
+
+#ifndef _LOCALE__GETDEFAULTLOCALE_METHODDEF
+ #define _LOCALE__GETDEFAULTLOCALE_METHODDEF
+#endif /* !defined(_LOCALE__GETDEFAULTLOCALE_METHODDEF) */
+
+#ifndef _LOCALE_NL_LANGINFO_METHODDEF
+ #define _LOCALE_NL_LANGINFO_METHODDEF
+#endif /* !defined(_LOCALE_NL_LANGINFO_METHODDEF) */
+
+#ifndef _LOCALE_GETTEXT_METHODDEF
+ #define _LOCALE_GETTEXT_METHODDEF
+#endif /* !defined(_LOCALE_GETTEXT_METHODDEF) */
+
+#ifndef _LOCALE_DGETTEXT_METHODDEF
+ #define _LOCALE_DGETTEXT_METHODDEF
+#endif /* !defined(_LOCALE_DGETTEXT_METHODDEF) */
+
+#ifndef _LOCALE_DCGETTEXT_METHODDEF
+ #define _LOCALE_DCGETTEXT_METHODDEF
+#endif /* !defined(_LOCALE_DCGETTEXT_METHODDEF) */
+
+#ifndef _LOCALE_TEXTDOMAIN_METHODDEF
+ #define _LOCALE_TEXTDOMAIN_METHODDEF
+#endif /* !defined(_LOCALE_TEXTDOMAIN_METHODDEF) */
+
+#ifndef _LOCALE_BINDTEXTDOMAIN_METHODDEF
+ #define _LOCALE_BINDTEXTDOMAIN_METHODDEF
+#endif /* !defined(_LOCALE_BINDTEXTDOMAIN_METHODDEF) */
+
+#ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
+ #define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
+#endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */
+/*[clinic end generated code: output=406842c3441559cb input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_lsprof.c.h b/contrib/tools/python3/Modules/clinic/_lsprof.c.h
new file mode 100644
index 00000000000..14af6b48c67
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_lsprof.c.h
@@ -0,0 +1,54 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_lsprof_Profiler_getstats__doc__,
+"getstats($self, /)\n"
+"--\n"
+"\n"
+"list of profiler_entry objects.\n"
+"\n"
+"getstats() -> list of profiler_entry objects\n"
+"\n"
+"Return all information collected by the profiler.\n"
+"Each profiler_entry is a tuple-like object with the\n"
+"following attributes:\n"
+"\n"
+" code code object\n"
+" callcount how many times this was called\n"
+" reccallcount how many times called recursively\n"
+" totaltime total time in this entry\n"
+" inlinetime inline time in this entry (not in subcalls)\n"
+" calls details of the calls\n"
+"\n"
+"The calls attribute is either None or a list of\n"
+"profiler_subentry objects:\n"
+"\n"
+" code called code object\n"
+" callcount how many times this is called\n"
+" reccallcount how many times this is called recursively\n"
+" totaltime total time spent in this call\n"
+" inlinetime inline time (not in further subcalls)");
+
+#define _LSPROF_PROFILER_GETSTATS_METHODDEF \
+ {"getstats", _PyCFunction_CAST(_lsprof_Profiler_getstats), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _lsprof_Profiler_getstats__doc__},
+
+static PyObject *
+_lsprof_Profiler_getstats_impl(ProfilerObject *self, PyTypeObject *cls);
+
+static PyObject *
+_lsprof_Profiler_getstats(ProfilerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "getstats() takes no arguments");
+ return NULL;
+ }
+ return _lsprof_Profiler_getstats_impl(self, cls);
+}
+/*[clinic end generated code: output=cc3b236bc414a372 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_lzmamodule.c.h b/contrib/tools/python3/Modules/clinic/_lzmamodule.c.h
new file mode 100644
index 00000000000..9b396a56683
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_lzmamodule.c.h
@@ -0,0 +1,341 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__,
+"compress($self, data, /)\n"
+"--\n"
+"\n"
+"Provide data to the compressor object.\n"
+"\n"
+"Returns a chunk of compressed data if possible, or b\'\' otherwise.\n"
+"\n"
+"When you have finished providing data to the compressor, call the\n"
+"flush() method to finish the compression process.");
+
+#define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF \
+ {"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__},
+
+static PyObject *
+_lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data);
+
+static PyObject *
+_lzma_LZMACompressor_compress(Compressor *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _lzma_LZMACompressor_compress_impl(self, &data);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_lzma_LZMACompressor_flush__doc__,
+"flush($self, /)\n"
+"--\n"
+"\n"
+"Finish the compression process.\n"
+"\n"
+"Returns the compressed data left in internal buffers.\n"
+"\n"
+"The compressor object may not be used after this method is called.");
+
+#define _LZMA_LZMACOMPRESSOR_FLUSH_METHODDEF \
+ {"flush", (PyCFunction)_lzma_LZMACompressor_flush, METH_NOARGS, _lzma_LZMACompressor_flush__doc__},
+
+static PyObject *
+_lzma_LZMACompressor_flush_impl(Compressor *self);
+
+static PyObject *
+_lzma_LZMACompressor_flush(Compressor *self, PyObject *Py_UNUSED(ignored))
+{
+ return _lzma_LZMACompressor_flush_impl(self);
+}
+
+PyDoc_STRVAR(_lzma_LZMADecompressor_decompress__doc__,
+"decompress($self, /, data, max_length=-1)\n"
+"--\n"
+"\n"
+"Decompress *data*, returning uncompressed data as bytes.\n"
+"\n"
+"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
+"decompressed data. If this limit is reached and further output can be\n"
+"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
+"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
+"\n"
+"If all of the input data was decompressed and returned (either because this\n"
+"was less than *max_length* bytes, or because *max_length* was negative),\n"
+"*self.needs_input* will be set to True.\n"
+"\n"
+"Attempting to decompress data after the end of stream is reached raises an\n"
+"EOFError. Any data found after the end of the stream is ignored and saved in\n"
+"the unused_data attribute.");
+
+#define _LZMA_LZMADECOMPRESSOR_DECOMPRESS_METHODDEF \
+ {"decompress", _PyCFunction_CAST(_lzma_LZMADecompressor_decompress), METH_FASTCALL|METH_KEYWORDS, _lzma_LZMADecompressor_decompress__doc__},
+
+static PyObject *
+_lzma_LZMADecompressor_decompress_impl(Decompressor *self, Py_buffer *data,
+ Py_ssize_t max_length);
+
+static PyObject *
+_lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(max_length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "max_length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decompress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ Py_ssize_t max_length = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ max_length = ival;
+ }
+skip_optional_pos:
+ return_value = _lzma_LZMADecompressor_decompress_impl(self, &data, max_length);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_lzma_LZMADecompressor__doc__,
+"LZMADecompressor(format=FORMAT_AUTO, memlimit=None, filters=None)\n"
+"--\n"
+"\n"
+"Create a decompressor object for decompressing data incrementally.\n"
+"\n"
+" format\n"
+" Specifies the container format of the input stream. If this is\n"
+" FORMAT_AUTO (the default), the decompressor will automatically detect\n"
+" whether the input is FORMAT_XZ or FORMAT_ALONE. Streams created with\n"
+" FORMAT_RAW cannot be autodetected.\n"
+" memlimit\n"
+" Limit the amount of memory used by the decompressor. This will cause\n"
+" decompression to fail if the input cannot be decompressed within the\n"
+" given limit.\n"
+" filters\n"
+" A custom filter chain. This argument is required for FORMAT_RAW, and\n"
+" not accepted with any other format. When provided, this should be a\n"
+" sequence of dicts, each indicating the ID and options for a single\n"
+" filter.\n"
+"\n"
+"For one-shot decompression, use the decompress() function instead.");
+
+static PyObject *
+_lzma_LZMADecompressor_impl(PyTypeObject *type, int format,
+ PyObject *memlimit, PyObject *filters);
+
+static PyObject *
+_lzma_LZMADecompressor(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(format), &_Py_ID(memlimit), &_Py_ID(filters), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"format", "memlimit", "filters", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "LZMADecompressor",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ int format = FORMAT_AUTO;
+ PyObject *memlimit = Py_None;
+ PyObject *filters = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 3, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[0]) {
+ format = _PyLong_AsInt(fastargs[0]);
+ if (format == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[1]) {
+ memlimit = fastargs[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ filters = fastargs[2];
+skip_optional_pos:
+ return_value = _lzma_LZMADecompressor_impl(type, format, memlimit, filters);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_lzma_is_check_supported__doc__,
+"is_check_supported($module, check_id, /)\n"
+"--\n"
+"\n"
+"Test whether the given integrity check is supported.\n"
+"\n"
+"Always returns True for CHECK_NONE and CHECK_CRC32.");
+
+#define _LZMA_IS_CHECK_SUPPORTED_METHODDEF \
+ {"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__},
+
+static PyObject *
+_lzma_is_check_supported_impl(PyObject *module, int check_id);
+
+static PyObject *
+_lzma_is_check_supported(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int check_id;
+
+ check_id = _PyLong_AsInt(arg);
+ if (check_id == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _lzma_is_check_supported_impl(module, check_id);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_lzma__decode_filter_properties__doc__,
+"_decode_filter_properties($module, filter_id, encoded_props, /)\n"
+"--\n"
+"\n"
+"Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).\n"
+"\n"
+"The result does not include the filter ID itself, only the options.");
+
+#define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \
+ {"_decode_filter_properties", _PyCFunction_CAST(_lzma__decode_filter_properties), METH_FASTCALL, _lzma__decode_filter_properties__doc__},
+
+static PyObject *
+_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
+ Py_buffer *encoded_props);
+
+static PyObject *
+_lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ lzma_vli filter_id;
+ Py_buffer encoded_props = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("_decode_filter_properties", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!lzma_vli_converter(args[0], &filter_id)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &encoded_props, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&encoded_props, 'C')) {
+ _PyArg_BadArgument("_decode_filter_properties", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
+
+exit:
+ /* Cleanup for encoded_props */
+ if (encoded_props.obj) {
+ PyBuffer_Release(&encoded_props);
+ }
+
+ return return_value;
+}
+/*[clinic end generated code: output=96c1fbdada1ef232 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_opcode.c.h b/contrib/tools/python3/Modules/clinic/_opcode.c.h
new file mode 100644
index 00000000000..3bd3ba02387
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_opcode.c.h
@@ -0,0 +1,106 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_opcode_stack_effect__doc__,
+"stack_effect($module, opcode, oparg=None, /, *, jump=None)\n"
+"--\n"
+"\n"
+"Compute the stack effect of the opcode.");
+
+#define _OPCODE_STACK_EFFECT_METHODDEF \
+ {"stack_effect", _PyCFunction_CAST(_opcode_stack_effect), METH_FASTCALL|METH_KEYWORDS, _opcode_stack_effect__doc__},
+
+static int
+_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg,
+ PyObject *jump);
+
+static PyObject *
+_opcode_stack_effect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(jump), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "", "jump", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "stack_effect",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ int opcode;
+ PyObject *oparg = Py_None;
+ PyObject *jump = Py_None;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ opcode = _PyLong_AsInt(args[0]);
+ if (opcode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional_posonly;
+ }
+ noptargs--;
+ oparg = args[1];
+skip_optional_posonly:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ jump = args[2];
+skip_optional_kwonly:
+ _return_value = _opcode_stack_effect_impl(module, opcode, oparg, jump);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_opcode_get_specialization_stats__doc__,
+"get_specialization_stats($module, /)\n"
+"--\n"
+"\n"
+"Return the specialization stats");
+
+#define _OPCODE_GET_SPECIALIZATION_STATS_METHODDEF \
+ {"get_specialization_stats", (PyCFunction)_opcode_get_specialization_stats, METH_NOARGS, _opcode_get_specialization_stats__doc__},
+
+static PyObject *
+_opcode_get_specialization_stats_impl(PyObject *module);
+
+static PyObject *
+_opcode_get_specialization_stats(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _opcode_get_specialization_stats_impl(module);
+}
+/*[clinic end generated code: output=21e3d53a659c651a input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_operator.c.h b/contrib/tools/python3/Modules/clinic/_operator.c.h
new file mode 100644
index 00000000000..b68e6e0144a
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_operator.c.h
@@ -0,0 +1,1495 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_operator_truth__doc__,
+"truth($module, a, /)\n"
+"--\n"
+"\n"
+"Return True if a is true, False otherwise.");
+
+#define _OPERATOR_TRUTH_METHODDEF \
+ {"truth", (PyCFunction)_operator_truth, METH_O, _operator_truth__doc__},
+
+static int
+_operator_truth_impl(PyObject *module, PyObject *a);
+
+static PyObject *
+_operator_truth(PyObject *module, PyObject *a)
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _operator_truth_impl(module, a);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_add__doc__,
+"add($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a + b.");
+
+#define _OPERATOR_ADD_METHODDEF \
+ {"add", _PyCFunction_CAST(_operator_add), METH_FASTCALL, _operator_add__doc__},
+
+static PyObject *
+_operator_add_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("add", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_add_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_sub__doc__,
+"sub($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a - b.");
+
+#define _OPERATOR_SUB_METHODDEF \
+ {"sub", _PyCFunction_CAST(_operator_sub), METH_FASTCALL, _operator_sub__doc__},
+
+static PyObject *
+_operator_sub_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_sub(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("sub", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_sub_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_mul__doc__,
+"mul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a * b.");
+
+#define _OPERATOR_MUL_METHODDEF \
+ {"mul", _PyCFunction_CAST(_operator_mul), METH_FASTCALL, _operator_mul__doc__},
+
+static PyObject *
+_operator_mul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("mul", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_mul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_matmul__doc__,
+"matmul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a @ b.");
+
+#define _OPERATOR_MATMUL_METHODDEF \
+ {"matmul", _PyCFunction_CAST(_operator_matmul), METH_FASTCALL, _operator_matmul__doc__},
+
+static PyObject *
+_operator_matmul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_matmul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("matmul", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_matmul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_floordiv__doc__,
+"floordiv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a // b.");
+
+#define _OPERATOR_FLOORDIV_METHODDEF \
+ {"floordiv", _PyCFunction_CAST(_operator_floordiv), METH_FASTCALL, _operator_floordiv__doc__},
+
+static PyObject *
+_operator_floordiv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_floordiv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("floordiv", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_floordiv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_truediv__doc__,
+"truediv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a / b.");
+
+#define _OPERATOR_TRUEDIV_METHODDEF \
+ {"truediv", _PyCFunction_CAST(_operator_truediv), METH_FASTCALL, _operator_truediv__doc__},
+
+static PyObject *
+_operator_truediv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_truediv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("truediv", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_truediv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_mod__doc__,
+"mod($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a % b.");
+
+#define _OPERATOR_MOD_METHODDEF \
+ {"mod", _PyCFunction_CAST(_operator_mod), METH_FASTCALL, _operator_mod__doc__},
+
+static PyObject *
+_operator_mod_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_mod(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("mod", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_mod_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_neg__doc__,
+"neg($module, a, /)\n"
+"--\n"
+"\n"
+"Same as -a.");
+
+#define _OPERATOR_NEG_METHODDEF \
+ {"neg", (PyCFunction)_operator_neg, METH_O, _operator_neg__doc__},
+
+PyDoc_STRVAR(_operator_pos__doc__,
+"pos($module, a, /)\n"
+"--\n"
+"\n"
+"Same as +a.");
+
+#define _OPERATOR_POS_METHODDEF \
+ {"pos", (PyCFunction)_operator_pos, METH_O, _operator_pos__doc__},
+
+PyDoc_STRVAR(_operator_abs__doc__,
+"abs($module, a, /)\n"
+"--\n"
+"\n"
+"Same as abs(a).");
+
+#define _OPERATOR_ABS_METHODDEF \
+ {"abs", (PyCFunction)_operator_abs, METH_O, _operator_abs__doc__},
+
+PyDoc_STRVAR(_operator_inv__doc__,
+"inv($module, a, /)\n"
+"--\n"
+"\n"
+"Same as ~a.");
+
+#define _OPERATOR_INV_METHODDEF \
+ {"inv", (PyCFunction)_operator_inv, METH_O, _operator_inv__doc__},
+
+PyDoc_STRVAR(_operator_invert__doc__,
+"invert($module, a, /)\n"
+"--\n"
+"\n"
+"Same as ~a.");
+
+#define _OPERATOR_INVERT_METHODDEF \
+ {"invert", (PyCFunction)_operator_invert, METH_O, _operator_invert__doc__},
+
+PyDoc_STRVAR(_operator_lshift__doc__,
+"lshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a << b.");
+
+#define _OPERATOR_LSHIFT_METHODDEF \
+ {"lshift", _PyCFunction_CAST(_operator_lshift), METH_FASTCALL, _operator_lshift__doc__},
+
+static PyObject *
+_operator_lshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_lshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("lshift", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_lshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_rshift__doc__,
+"rshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a >> b.");
+
+#define _OPERATOR_RSHIFT_METHODDEF \
+ {"rshift", _PyCFunction_CAST(_operator_rshift), METH_FASTCALL, _operator_rshift__doc__},
+
+static PyObject *
+_operator_rshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_rshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("rshift", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_rshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_not___doc__,
+"not_($module, a, /)\n"
+"--\n"
+"\n"
+"Same as not a.");
+
+#define _OPERATOR_NOT__METHODDEF \
+ {"not_", (PyCFunction)_operator_not_, METH_O, _operator_not___doc__},
+
+static int
+_operator_not__impl(PyObject *module, PyObject *a);
+
+static PyObject *
+_operator_not_(PyObject *module, PyObject *a)
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _operator_not__impl(module, a);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_and___doc__,
+"and_($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a & b.");
+
+#define _OPERATOR_AND__METHODDEF \
+ {"and_", _PyCFunction_CAST(_operator_and_), METH_FASTCALL, _operator_and___doc__},
+
+static PyObject *
+_operator_and__impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_and_(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("and_", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_and__impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_xor__doc__,
+"xor($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a ^ b.");
+
+#define _OPERATOR_XOR_METHODDEF \
+ {"xor", _PyCFunction_CAST(_operator_xor), METH_FASTCALL, _operator_xor__doc__},
+
+static PyObject *
+_operator_xor_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_xor(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("xor", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_xor_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_or___doc__,
+"or_($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a | b.");
+
+#define _OPERATOR_OR__METHODDEF \
+ {"or_", _PyCFunction_CAST(_operator_or_), METH_FASTCALL, _operator_or___doc__},
+
+static PyObject *
+_operator_or__impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_or_(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("or_", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_or__impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_iadd__doc__,
+"iadd($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a += b.");
+
+#define _OPERATOR_IADD_METHODDEF \
+ {"iadd", _PyCFunction_CAST(_operator_iadd), METH_FASTCALL, _operator_iadd__doc__},
+
+static PyObject *
+_operator_iadd_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_iadd(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("iadd", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_iadd_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_isub__doc__,
+"isub($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a -= b.");
+
+#define _OPERATOR_ISUB_METHODDEF \
+ {"isub", _PyCFunction_CAST(_operator_isub), METH_FASTCALL, _operator_isub__doc__},
+
+static PyObject *
+_operator_isub_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_isub(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("isub", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_isub_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_imul__doc__,
+"imul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a *= b.");
+
+#define _OPERATOR_IMUL_METHODDEF \
+ {"imul", _PyCFunction_CAST(_operator_imul), METH_FASTCALL, _operator_imul__doc__},
+
+static PyObject *
+_operator_imul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_imul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("imul", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_imul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_imatmul__doc__,
+"imatmul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a @= b.");
+
+#define _OPERATOR_IMATMUL_METHODDEF \
+ {"imatmul", _PyCFunction_CAST(_operator_imatmul), METH_FASTCALL, _operator_imatmul__doc__},
+
+static PyObject *
+_operator_imatmul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_imatmul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("imatmul", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_imatmul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ifloordiv__doc__,
+"ifloordiv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a //= b.");
+
+#define _OPERATOR_IFLOORDIV_METHODDEF \
+ {"ifloordiv", _PyCFunction_CAST(_operator_ifloordiv), METH_FASTCALL, _operator_ifloordiv__doc__},
+
+static PyObject *
+_operator_ifloordiv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ifloordiv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ifloordiv", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ifloordiv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_itruediv__doc__,
+"itruediv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a /= b.");
+
+#define _OPERATOR_ITRUEDIV_METHODDEF \
+ {"itruediv", _PyCFunction_CAST(_operator_itruediv), METH_FASTCALL, _operator_itruediv__doc__},
+
+static PyObject *
+_operator_itruediv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_itruediv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("itruediv", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_itruediv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_imod__doc__,
+"imod($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a %= b.");
+
+#define _OPERATOR_IMOD_METHODDEF \
+ {"imod", _PyCFunction_CAST(_operator_imod), METH_FASTCALL, _operator_imod__doc__},
+
+static PyObject *
+_operator_imod_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_imod(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("imod", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_imod_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ilshift__doc__,
+"ilshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a <<= b.");
+
+#define _OPERATOR_ILSHIFT_METHODDEF \
+ {"ilshift", _PyCFunction_CAST(_operator_ilshift), METH_FASTCALL, _operator_ilshift__doc__},
+
+static PyObject *
+_operator_ilshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ilshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ilshift", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ilshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_irshift__doc__,
+"irshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a >>= b.");
+
+#define _OPERATOR_IRSHIFT_METHODDEF \
+ {"irshift", _PyCFunction_CAST(_operator_irshift), METH_FASTCALL, _operator_irshift__doc__},
+
+static PyObject *
+_operator_irshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_irshift(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("irshift", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_irshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_iand__doc__,
+"iand($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a &= b.");
+
+#define _OPERATOR_IAND_METHODDEF \
+ {"iand", _PyCFunction_CAST(_operator_iand), METH_FASTCALL, _operator_iand__doc__},
+
+static PyObject *
+_operator_iand_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_iand(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("iand", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_iand_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ixor__doc__,
+"ixor($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a ^= b.");
+
+#define _OPERATOR_IXOR_METHODDEF \
+ {"ixor", _PyCFunction_CAST(_operator_ixor), METH_FASTCALL, _operator_ixor__doc__},
+
+static PyObject *
+_operator_ixor_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ixor(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ixor", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ixor_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ior__doc__,
+"ior($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a |= b.");
+
+#define _OPERATOR_IOR_METHODDEF \
+ {"ior", _PyCFunction_CAST(_operator_ior), METH_FASTCALL, _operator_ior__doc__},
+
+static PyObject *
+_operator_ior_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ior(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ior", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ior_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_concat__doc__,
+"concat($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a + b, for a and b sequences.");
+
+#define _OPERATOR_CONCAT_METHODDEF \
+ {"concat", _PyCFunction_CAST(_operator_concat), METH_FASTCALL, _operator_concat__doc__},
+
+static PyObject *
+_operator_concat_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_concat(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("concat", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_concat_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_iconcat__doc__,
+"iconcat($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a += b, for a and b sequences.");
+
+#define _OPERATOR_ICONCAT_METHODDEF \
+ {"iconcat", _PyCFunction_CAST(_operator_iconcat), METH_FASTCALL, _operator_iconcat__doc__},
+
+static PyObject *
+_operator_iconcat_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_iconcat(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("iconcat", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_iconcat_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_contains__doc__,
+"contains($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as b in a (note reversed operands).");
+
+#define _OPERATOR_CONTAINS_METHODDEF \
+ {"contains", _PyCFunction_CAST(_operator_contains), METH_FASTCALL, _operator_contains__doc__},
+
+static int
+_operator_contains_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_contains(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ int _return_value;
+
+ if (!_PyArg_CheckPositional("contains", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ _return_value = _operator_contains_impl(module, a, b);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_indexOf__doc__,
+"indexOf($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return the first index of b in a.");
+
+#define _OPERATOR_INDEXOF_METHODDEF \
+ {"indexOf", _PyCFunction_CAST(_operator_indexOf), METH_FASTCALL, _operator_indexOf__doc__},
+
+static Py_ssize_t
+_operator_indexOf_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_indexOf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("indexOf", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ _return_value = _operator_indexOf_impl(module, a, b);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_countOf__doc__,
+"countOf($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return the number of items in a which are, or which equal, b.");
+
+#define _OPERATOR_COUNTOF_METHODDEF \
+ {"countOf", _PyCFunction_CAST(_operator_countOf), METH_FASTCALL, _operator_countOf__doc__},
+
+static Py_ssize_t
+_operator_countOf_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_countOf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("countOf", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ _return_value = _operator_countOf_impl(module, a, b);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_getitem__doc__,
+"getitem($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a[b].");
+
+#define _OPERATOR_GETITEM_METHODDEF \
+ {"getitem", _PyCFunction_CAST(_operator_getitem), METH_FASTCALL, _operator_getitem__doc__},
+
+static PyObject *
+_operator_getitem_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_getitem(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("getitem", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_getitem_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_setitem__doc__,
+"setitem($module, a, b, c, /)\n"
+"--\n"
+"\n"
+"Same as a[b] = c.");
+
+#define _OPERATOR_SETITEM_METHODDEF \
+ {"setitem", _PyCFunction_CAST(_operator_setitem), METH_FASTCALL, _operator_setitem__doc__},
+
+static PyObject *
+_operator_setitem_impl(PyObject *module, PyObject *a, PyObject *b,
+ PyObject *c);
+
+static PyObject *
+_operator_setitem(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ PyObject *c;
+
+ if (!_PyArg_CheckPositional("setitem", nargs, 3, 3)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ c = args[2];
+ return_value = _operator_setitem_impl(module, a, b, c);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_delitem__doc__,
+"delitem($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as del a[b].");
+
+#define _OPERATOR_DELITEM_METHODDEF \
+ {"delitem", _PyCFunction_CAST(_operator_delitem), METH_FASTCALL, _operator_delitem__doc__},
+
+static PyObject *
+_operator_delitem_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_delitem(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("delitem", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_delitem_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_eq__doc__,
+"eq($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a == b.");
+
+#define _OPERATOR_EQ_METHODDEF \
+ {"eq", _PyCFunction_CAST(_operator_eq), METH_FASTCALL, _operator_eq__doc__},
+
+static PyObject *
+_operator_eq_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_eq(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("eq", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_eq_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ne__doc__,
+"ne($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a != b.");
+
+#define _OPERATOR_NE_METHODDEF \
+ {"ne", _PyCFunction_CAST(_operator_ne), METH_FASTCALL, _operator_ne__doc__},
+
+static PyObject *
+_operator_ne_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ne(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ne", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ne_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_lt__doc__,
+"lt($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a < b.");
+
+#define _OPERATOR_LT_METHODDEF \
+ {"lt", _PyCFunction_CAST(_operator_lt), METH_FASTCALL, _operator_lt__doc__},
+
+static PyObject *
+_operator_lt_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_lt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("lt", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_lt_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_le__doc__,
+"le($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a <= b.");
+
+#define _OPERATOR_LE_METHODDEF \
+ {"le", _PyCFunction_CAST(_operator_le), METH_FASTCALL, _operator_le__doc__},
+
+static PyObject *
+_operator_le_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_le(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("le", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_le_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_gt__doc__,
+"gt($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a > b.");
+
+#define _OPERATOR_GT_METHODDEF \
+ {"gt", _PyCFunction_CAST(_operator_gt), METH_FASTCALL, _operator_gt__doc__},
+
+static PyObject *
+_operator_gt_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_gt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("gt", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_gt_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ge__doc__,
+"ge($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a >= b.");
+
+#define _OPERATOR_GE_METHODDEF \
+ {"ge", _PyCFunction_CAST(_operator_ge), METH_FASTCALL, _operator_ge__doc__},
+
+static PyObject *
+_operator_ge_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ge(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ge", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ge_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_pow__doc__,
+"pow($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a ** b.");
+
+#define _OPERATOR_POW_METHODDEF \
+ {"pow", _PyCFunction_CAST(_operator_pow), METH_FASTCALL, _operator_pow__doc__},
+
+static PyObject *
+_operator_pow_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("pow", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_pow_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ipow__doc__,
+"ipow($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a **= b.");
+
+#define _OPERATOR_IPOW_METHODDEF \
+ {"ipow", _PyCFunction_CAST(_operator_ipow), METH_FASTCALL, _operator_ipow__doc__},
+
+static PyObject *
+_operator_ipow_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ipow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("ipow", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_ipow_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_index__doc__,
+"index($module, a, /)\n"
+"--\n"
+"\n"
+"Same as a.__index__()");
+
+#define _OPERATOR_INDEX_METHODDEF \
+ {"index", (PyCFunction)_operator_index, METH_O, _operator_index__doc__},
+
+PyDoc_STRVAR(_operator_is___doc__,
+"is_($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a is b.");
+
+#define _OPERATOR_IS__METHODDEF \
+ {"is_", _PyCFunction_CAST(_operator_is_), METH_FASTCALL, _operator_is___doc__},
+
+static PyObject *
+_operator_is__impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_is_(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("is_", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_is__impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_is_not__doc__,
+"is_not($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a is not b.");
+
+#define _OPERATOR_IS_NOT_METHODDEF \
+ {"is_not", _PyCFunction_CAST(_operator_is_not), METH_FASTCALL, _operator_is_not__doc__},
+
+static PyObject *
+_operator_is_not_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_is_not(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("is_not", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator_is_not_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_length_hint__doc__,
+"length_hint($module, obj, default=0, /)\n"
+"--\n"
+"\n"
+"Return an estimate of the number of items in obj.\n"
+"\n"
+"This is useful for presizing containers when building from an iterable.\n"
+"\n"
+"If the object supports len(), the result will be exact.\n"
+"Otherwise, it may over- or under-estimate by an arbitrary amount.\n"
+"The result will be an integer >= 0.");
+
+#define _OPERATOR_LENGTH_HINT_METHODDEF \
+ {"length_hint", _PyCFunction_CAST(_operator_length_hint), METH_FASTCALL, _operator_length_hint__doc__},
+
+static Py_ssize_t
+_operator_length_hint_impl(PyObject *module, PyObject *obj,
+ Py_ssize_t default_value);
+
+static PyObject *
+_operator_length_hint(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *obj;
+ Py_ssize_t default_value = 0;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("length_hint", nargs, 1, 2)) {
+ goto exit;
+ }
+ obj = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ default_value = ival;
+ }
+skip_optional:
+ _return_value = _operator_length_hint_impl(module, obj, default_value);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator__compare_digest__doc__,
+"_compare_digest($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return \'a == b\'.\n"
+"\n"
+"This function uses an approach designed to prevent\n"
+"timing analysis, making it appropriate for cryptography.\n"
+"\n"
+"a and b must both be of the same type: either str (ASCII only),\n"
+"or any bytes-like object.\n"
+"\n"
+"Note: If a and b are of different lengths, or if an error occurs,\n"
+"a timing attack could theoretically reveal information about the\n"
+"types and lengths of a and b--but not their values.");
+
+#define _OPERATOR__COMPARE_DIGEST_METHODDEF \
+ {"_compare_digest", _PyCFunction_CAST(_operator__compare_digest), METH_FASTCALL, _operator__compare_digest__doc__},
+
+static PyObject *
+_operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator__compare_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_CheckPositional("_compare_digest", nargs, 2, 2)) {
+ goto exit;
+ }
+ a = args[0];
+ b = args[1];
+ return_value = _operator__compare_digest_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=227cbcfed44f736e input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_pickle.c.h b/contrib/tools/python3/Modules/clinic/_pickle.c.h
new file mode 100644
index 00000000000..b39c04dcaac
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_pickle.c.h
@@ -0,0 +1,1037 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
+"clear_memo($self, /)\n"
+"--\n"
+"\n"
+"Clears the pickler\'s \"memo\".\n"
+"\n"
+"The memo is the data structure that remembers which objects the\n"
+"pickler has already seen, so that shared or recursive objects are\n"
+"pickled by reference and not by value. This method is useful when\n"
+"re-using picklers.");
+
+#define _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF \
+ {"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__},
+
+static PyObject *
+_pickle_Pickler_clear_memo_impl(PicklerObject *self);
+
+static PyObject *
+_pickle_Pickler_clear_memo(PicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_Pickler_clear_memo_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_Pickler_dump__doc__,
+"dump($self, obj, /)\n"
+"--\n"
+"\n"
+"Write a pickled representation of the given object to the open file.");
+
+#define _PICKLE_PICKLER_DUMP_METHODDEF \
+ {"dump", _PyCFunction_CAST(_pickle_Pickler_dump), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _pickle_Pickler_dump__doc__},
+
+static PyObject *
+_pickle_Pickler_dump_impl(PicklerObject *self, PyTypeObject *cls,
+ PyObject *obj);
+
+static PyObject *
+_pickle_Pickler_dump(PicklerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "dump",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *obj;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ obj = args[0];
+ return_value = _pickle_Pickler_dump_impl(self, cls, obj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Pickler___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Returns size in memory, in bytes.");
+
+#define _PICKLE_PICKLER___SIZEOF___METHODDEF \
+ {"__sizeof__", (PyCFunction)_pickle_Pickler___sizeof__, METH_NOARGS, _pickle_Pickler___sizeof____doc__},
+
+static size_t
+_pickle_Pickler___sizeof___impl(PicklerObject *self);
+
+static PyObject *
+_pickle_Pickler___sizeof__(PicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ size_t _return_value;
+
+ _return_value = _pickle_Pickler___sizeof___impl(self);
+ if ((_return_value == (size_t)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Pickler___init____doc__,
+"Pickler(file, protocol=None, fix_imports=True, buffer_callback=None)\n"
+"--\n"
+"\n"
+"This takes a binary file for writing a pickle data stream.\n"
+"\n"
+"The optional *protocol* argument tells the pickler to use the given\n"
+"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n"
+"protocol is 4. It was introduced in Python 3.4, and is incompatible\n"
+"with previous versions.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol\n"
+"version supported. The higher the protocol used, the more recent the\n"
+"version of Python needed to read the pickle produced.\n"
+"\n"
+"The *file* argument must have a write() method that accepts a single\n"
+"bytes argument. It can thus be a file object opened for binary\n"
+"writing, an io.BytesIO instance, or any other custom object that meets\n"
+"this interface.\n"
+"\n"
+"If *fix_imports* is True and protocol is less than 3, pickle will try\n"
+"to map the new Python 3 names to the old module names used in Python\n"
+"2, so that the pickle data stream is readable with Python 2.\n"
+"\n"
+"If *buffer_callback* is None (the default), buffer views are\n"
+"serialized into *file* as part of the pickle stream.\n"
+"\n"
+"If *buffer_callback* is not None, then it can be called any number\n"
+"of times with a buffer view. If the callback returns a false value\n"
+"(such as None), the given buffer is out-of-band; otherwise the\n"
+"buffer is serialized in-band, i.e. inside the pickle stream.\n"
+"\n"
+"It is an error if *buffer_callback* is not None and *protocol*\n"
+"is None or smaller than 5.");
+
+static int
+_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file,
+ PyObject *protocol, int fix_imports,
+ PyObject *buffer_callback);
+
+static int
+_pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file), &_Py_ID(protocol), &_Py_ID(fix_imports), &_Py_ID(buffer_callback), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"file", "protocol", "fix_imports", "buffer_callback", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Pickler",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *file;
+ PyObject *protocol = Py_None;
+ int fix_imports = 1;
+ PyObject *buffer_callback = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 4, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ file = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[1]) {
+ protocol = fastargs[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[2]) {
+ fix_imports = PyObject_IsTrue(fastargs[2]);
+ if (fix_imports < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ buffer_callback = fastargs[3];
+skip_optional_pos:
+ return_value = _pickle_Pickler___init___impl((PicklerObject *)self, file, protocol, fix_imports, buffer_callback);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__,
+"clear($self, /)\n"
+"--\n"
+"\n"
+"Remove all items from memo.");
+
+#define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF \
+ {"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__},
+
+static PyObject *
+_pickle_PicklerMemoProxy_clear_impl(PicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_PicklerMemoProxy_clear(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_PicklerMemoProxy_clear_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Copy the memo to a new object.");
+
+#define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF \
+ {"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__},
+
+static PyObject *
+_pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_PicklerMemoProxy_copy(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_PicklerMemoProxy_copy_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__,
+"__reduce__($self, /)\n"
+"--\n"
+"\n"
+"Implement pickle support.");
+
+#define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF \
+ {"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__},
+
+static PyObject *
+_pickle_PicklerMemoProxy___reduce___impl(PicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_PicklerMemoProxy___reduce__(PicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_PicklerMemoProxy___reduce___impl(self);
+}
+
+PyDoc_STRVAR(_pickle_Unpickler_load__doc__,
+"load($self, /)\n"
+"--\n"
+"\n"
+"Load a pickle.\n"
+"\n"
+"Read a pickled object representation from the open file object given\n"
+"in the constructor, and return the reconstituted object hierarchy\n"
+"specified therein.");
+
+#define _PICKLE_UNPICKLER_LOAD_METHODDEF \
+ {"load", _PyCFunction_CAST(_pickle_Unpickler_load), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _pickle_Unpickler_load__doc__},
+
+static PyObject *
+_pickle_Unpickler_load_impl(UnpicklerObject *self, PyTypeObject *cls);
+
+static PyObject *
+_pickle_Unpickler_load(UnpicklerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "load() takes no arguments");
+ return NULL;
+ }
+ return _pickle_Unpickler_load_impl(self, cls);
+}
+
+PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__,
+"find_class($self, module_name, global_name, /)\n"
+"--\n"
+"\n"
+"Return an object from a specified module.\n"
+"\n"
+"If necessary, the module will be imported. Subclasses may override\n"
+"this method (e.g. to restrict unpickling of arbitrary classes and\n"
+"functions).\n"
+"\n"
+"This method is called whenever a class or a function object is\n"
+"needed. Both arguments passed are str objects.");
+
+#define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \
+ {"find_class", _PyCFunction_CAST(_pickle_Unpickler_find_class), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _pickle_Unpickler_find_class__doc__},
+
+static PyObject *
+_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyTypeObject *cls,
+ PyObject *module_name,
+ PyObject *global_name);
+
+static PyObject *
+_pickle_Unpickler_find_class(UnpicklerObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "find_class",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *module_name;
+ PyObject *global_name;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ module_name = args[0];
+ global_name = args[1];
+ return_value = _pickle_Unpickler_find_class_impl(self, cls, module_name, global_name);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Unpickler___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Returns size in memory, in bytes.");
+
+#define _PICKLE_UNPICKLER___SIZEOF___METHODDEF \
+ {"__sizeof__", (PyCFunction)_pickle_Unpickler___sizeof__, METH_NOARGS, _pickle_Unpickler___sizeof____doc__},
+
+static size_t
+_pickle_Unpickler___sizeof___impl(UnpicklerObject *self);
+
+static PyObject *
+_pickle_Unpickler___sizeof__(UnpicklerObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ size_t _return_value;
+
+ _return_value = _pickle_Unpickler___sizeof___impl(self);
+ if ((_return_value == (size_t)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_Unpickler___init____doc__,
+"Unpickler(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\',\n"
+" buffers=())\n"
+"--\n"
+"\n"
+"This takes a binary file for reading a pickle data stream.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no\n"
+"protocol argument is needed. Bytes past the pickled object\'s\n"
+"representation are ignored.\n"
+"\n"
+"The argument *file* must have two methods, a read() method that takes\n"
+"an integer argument, and a readline() method that requires no\n"
+"arguments. Both methods should return bytes. Thus *file* can be a\n"
+"binary file object opened for reading, an io.BytesIO object, or any\n"
+"other custom object that meets this interface.\n"
+"\n"
+"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
+"which are used to control compatibility support for pickle stream\n"
+"generated by Python 2. If *fix_imports* is True, pickle will try to\n"
+"map the old Python 2 names to the new names used in Python 3. The\n"
+"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
+"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
+"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n"
+"string instances as bytes objects.");
+
+static int
+_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
+ int fix_imports, const char *encoding,
+ const char *errors, PyObject *buffers);
+
+static int
+_pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file), &_Py_ID(fix_imports), &_Py_ID(encoding), &_Py_ID(errors), &_Py_ID(buffers), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Unpickler",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *file;
+ int fix_imports = 1;
+ const char *encoding = "ASCII";
+ const char *errors = "strict";
+ PyObject *buffers = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ file = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (fastargs[1]) {
+ fix_imports = PyObject_IsTrue(fastargs[1]);
+ if (fix_imports < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[2]) {
+ if (!PyUnicode_Check(fastargs[2])) {
+ _PyArg_BadArgument("Unpickler", "argument 'encoding'", "str", fastargs[2]);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(fastargs[2], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (fastargs[3]) {
+ if (!PyUnicode_Check(fastargs[3])) {
+ _PyArg_BadArgument("Unpickler", "argument 'errors'", "str", fastargs[3]);
+ goto exit;
+ }
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(fastargs[3], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ buffers = fastargs[4];
+skip_optional_kwonly:
+ return_value = _pickle_Unpickler___init___impl((UnpicklerObject *)self, file, fix_imports, encoding, errors, buffers);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__,
+"clear($self, /)\n"
+"--\n"
+"\n"
+"Remove all items from memo.");
+
+#define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF \
+ {"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__},
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_clear_impl(UnpicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_UnpicklerMemoProxy_clear_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Copy the memo to a new object.");
+
+#define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF \
+ {"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__},
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_UnpicklerMemoProxy_copy(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_UnpicklerMemoProxy_copy_impl(self);
+}
+
+PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__,
+"__reduce__($self, /)\n"
+"--\n"
+"\n"
+"Implement pickling support.");
+
+#define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF \
+ {"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__},
+
+static PyObject *
+_pickle_UnpicklerMemoProxy___reduce___impl(UnpicklerMemoProxyObject *self);
+
+static PyObject *
+_pickle_UnpicklerMemoProxy___reduce__(UnpicklerMemoProxyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _pickle_UnpicklerMemoProxy___reduce___impl(self);
+}
+
+PyDoc_STRVAR(_pickle_dump__doc__,
+"dump($module, /, obj, file, protocol=None, *, fix_imports=True,\n"
+" buffer_callback=None)\n"
+"--\n"
+"\n"
+"Write a pickled representation of obj to the open file object file.\n"
+"\n"
+"This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may\n"
+"be more efficient.\n"
+"\n"
+"The optional *protocol* argument tells the pickler to use the given\n"
+"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n"
+"protocol is 4. It was introduced in Python 3.4, and is incompatible\n"
+"with previous versions.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol\n"
+"version supported. The higher the protocol used, the more recent the\n"
+"version of Python needed to read the pickle produced.\n"
+"\n"
+"The *file* argument must have a write() method that accepts a single\n"
+"bytes argument. It can thus be a file object opened for binary\n"
+"writing, an io.BytesIO instance, or any other custom object that meets\n"
+"this interface.\n"
+"\n"
+"If *fix_imports* is True and protocol is less than 3, pickle will try\n"
+"to map the new Python 3 names to the old module names used in Python\n"
+"2, so that the pickle data stream is readable with Python 2.\n"
+"\n"
+"If *buffer_callback* is None (the default), buffer views are serialized\n"
+"into *file* as part of the pickle stream. It is an error if\n"
+"*buffer_callback* is not None and *protocol* is None or smaller than 5.");
+
+#define _PICKLE_DUMP_METHODDEF \
+ {"dump", _PyCFunction_CAST(_pickle_dump), METH_FASTCALL|METH_KEYWORDS, _pickle_dump__doc__},
+
+static PyObject *
+_pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file,
+ PyObject *protocol, int fix_imports,
+ PyObject *buffer_callback);
+
+static PyObject *
+_pickle_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(obj), &_Py_ID(file), &_Py_ID(protocol), &_Py_ID(fix_imports), &_Py_ID(buffer_callback), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"obj", "file", "protocol", "fix_imports", "buffer_callback", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "dump",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *obj;
+ PyObject *file;
+ PyObject *protocol = Py_None;
+ int fix_imports = 1;
+ PyObject *buffer_callback = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ obj = args[0];
+ file = args[1];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ protocol = args[2];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[3]) {
+ fix_imports = PyObject_IsTrue(args[3]);
+ if (fix_imports < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ buffer_callback = args[4];
+skip_optional_kwonly:
+ return_value = _pickle_dump_impl(module, obj, file, protocol, fix_imports, buffer_callback);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_dumps__doc__,
+"dumps($module, /, obj, protocol=None, *, fix_imports=True,\n"
+" buffer_callback=None)\n"
+"--\n"
+"\n"
+"Return the pickled representation of the object as a bytes object.\n"
+"\n"
+"The optional *protocol* argument tells the pickler to use the given\n"
+"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n"
+"protocol is 4. It was introduced in Python 3.4, and is incompatible\n"
+"with previous versions.\n"
+"\n"
+"Specifying a negative protocol version selects the highest protocol\n"
+"version supported. The higher the protocol used, the more recent the\n"
+"version of Python needed to read the pickle produced.\n"
+"\n"
+"If *fix_imports* is True and *protocol* is less than 3, pickle will\n"
+"try to map the new Python 3 names to the old module names used in\n"
+"Python 2, so that the pickle data stream is readable with Python 2.\n"
+"\n"
+"If *buffer_callback* is None (the default), buffer views are serialized\n"
+"into *file* as part of the pickle stream. It is an error if\n"
+"*buffer_callback* is not None and *protocol* is None or smaller than 5.");
+
+#define _PICKLE_DUMPS_METHODDEF \
+ {"dumps", _PyCFunction_CAST(_pickle_dumps), METH_FASTCALL|METH_KEYWORDS, _pickle_dumps__doc__},
+
+static PyObject *
+_pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol,
+ int fix_imports, PyObject *buffer_callback);
+
+static PyObject *
+_pickle_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(obj), &_Py_ID(protocol), &_Py_ID(fix_imports), &_Py_ID(buffer_callback), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"obj", "protocol", "fix_imports", "buffer_callback", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "dumps",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *obj;
+ PyObject *protocol = Py_None;
+ int fix_imports = 1;
+ PyObject *buffer_callback = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ obj = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ protocol = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ fix_imports = PyObject_IsTrue(args[2]);
+ if (fix_imports < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ buffer_callback = args[3];
+skip_optional_kwonly:
+ return_value = _pickle_dumps_impl(module, obj, protocol, fix_imports, buffer_callback);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_load__doc__,
+"load($module, /, file, *, fix_imports=True, encoding=\'ASCII\',\n"
+" errors=\'strict\', buffers=())\n"
+"--\n"
+"\n"
+"Read and return an object from the pickle data stored in a file.\n"
+"\n"
+"This is equivalent to ``Unpickler(file).load()``, but may be more\n"
+"efficient.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no\n"
+"protocol argument is needed. Bytes past the pickled object\'s\n"
+"representation are ignored.\n"
+"\n"
+"The argument *file* must have two methods, a read() method that takes\n"
+"an integer argument, and a readline() method that requires no\n"
+"arguments. Both methods should return bytes. Thus *file* can be a\n"
+"binary file object opened for reading, an io.BytesIO object, or any\n"
+"other custom object that meets this interface.\n"
+"\n"
+"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
+"which are used to control compatibility support for pickle stream\n"
+"generated by Python 2. If *fix_imports* is True, pickle will try to\n"
+"map the old Python 2 names to the new names used in Python 3. The\n"
+"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
+"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
+"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n"
+"string instances as bytes objects.");
+
+#define _PICKLE_LOAD_METHODDEF \
+ {"load", _PyCFunction_CAST(_pickle_load), METH_FASTCALL|METH_KEYWORDS, _pickle_load__doc__},
+
+static PyObject *
+_pickle_load_impl(PyObject *module, PyObject *file, int fix_imports,
+ const char *encoding, const char *errors,
+ PyObject *buffers);
+
+static PyObject *
+_pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file), &_Py_ID(fix_imports), &_Py_ID(encoding), &_Py_ID(errors), &_Py_ID(buffers), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "load",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *file;
+ int fix_imports = 1;
+ const char *encoding = "ASCII";
+ const char *errors = "strict";
+ PyObject *buffers = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ file = args[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[1]) {
+ fix_imports = PyObject_IsTrue(args[1]);
+ if (fix_imports < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[2]) {
+ if (!PyUnicode_Check(args[2])) {
+ _PyArg_BadArgument("load", "argument 'encoding'", "str", args[2]);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[2], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ if (!PyUnicode_Check(args[3])) {
+ _PyArg_BadArgument("load", "argument 'errors'", "str", args[3]);
+ goto exit;
+ }
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[3], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ buffers = args[4];
+skip_optional_kwonly:
+ return_value = _pickle_load_impl(module, file, fix_imports, encoding, errors, buffers);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_pickle_loads__doc__,
+"loads($module, data, /, *, fix_imports=True, encoding=\'ASCII\',\n"
+" errors=\'strict\', buffers=())\n"
+"--\n"
+"\n"
+"Read and return an object from the given pickle data.\n"
+"\n"
+"The protocol version of the pickle is detected automatically, so no\n"
+"protocol argument is needed. Bytes past the pickled object\'s\n"
+"representation are ignored.\n"
+"\n"
+"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n"
+"which are used to control compatibility support for pickle stream\n"
+"generated by Python 2. If *fix_imports* is True, pickle will try to\n"
+"map the old Python 2 names to the new names used in Python 3. The\n"
+"*encoding* and *errors* tell pickle how to decode 8-bit string\n"
+"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n"
+"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n"
+"string instances as bytes objects.");
+
+#define _PICKLE_LOADS_METHODDEF \
+ {"loads", _PyCFunction_CAST(_pickle_loads), METH_FASTCALL|METH_KEYWORDS, _pickle_loads__doc__},
+
+static PyObject *
+_pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports,
+ const char *encoding, const char *errors,
+ PyObject *buffers);
+
+static PyObject *
+_pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fix_imports), &_Py_ID(encoding), &_Py_ID(errors), &_Py_ID(buffers), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "fix_imports", "encoding", "errors", "buffers", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "loads",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *data;
+ int fix_imports = 1;
+ const char *encoding = "ASCII";
+ const char *errors = "strict";
+ PyObject *buffers = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ data = args[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[1]) {
+ fix_imports = PyObject_IsTrue(args[1]);
+ if (fix_imports < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[2]) {
+ if (!PyUnicode_Check(args[2])) {
+ _PyArg_BadArgument("loads", "argument 'encoding'", "str", args[2]);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[2], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ if (!PyUnicode_Check(args[3])) {
+ _PyArg_BadArgument("loads", "argument 'errors'", "str", args[3]);
+ goto exit;
+ }
+ Py_ssize_t errors_length;
+ errors = PyUnicode_AsUTF8AndSize(args[3], &errors_length);
+ if (errors == NULL) {
+ goto exit;
+ }
+ if (strlen(errors) != (size_t)errors_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ buffers = args[4];
+skip_optional_kwonly:
+ return_value = _pickle_loads_impl(module, data, fix_imports, encoding, errors, buffers);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=5886b563df7b866d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h b/contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h
new file mode 100644
index 00000000000..f08878cf668
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_posixsubprocess.c.h
@@ -0,0 +1,162 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(subprocess_fork_exec__doc__,
+"fork_exec($module, args, executable_list, close_fds, pass_fds, cwd,\n"
+" env, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite,\n"
+" errpipe_read, errpipe_write, restore_signals, call_setsid,\n"
+" pgid_to_set, gid, extra_groups, uid, child_umask, preexec_fn,\n"
+" allow_vfork, /)\n"
+"--\n"
+"\n"
+"Spawn a fresh new child process.\n"
+"\n"
+"Fork a child process, close parent file descriptors as appropriate in the\n"
+"child and duplicate the few that are needed before calling exec() in the\n"
+"child process.\n"
+"\n"
+"If close_fds is True, close file descriptors 3 and higher, except those listed\n"
+"in the sorted tuple pass_fds.\n"
+"\n"
+"The preexec_fn, if supplied, will be called immediately before closing file\n"
+"descriptors and exec.\n"
+"\n"
+"WARNING: preexec_fn is NOT SAFE if your application uses threads.\n"
+" It may trigger infrequent, difficult to debug deadlocks.\n"
+"\n"
+"If an error occurs in the child process before the exec, it is\n"
+"serialized and written to the errpipe_write fd per subprocess.py.\n"
+"\n"
+"Returns: the child process\'s PID.\n"
+"\n"
+"Raises: Only on an error in the parent process.");
+
+#define SUBPROCESS_FORK_EXEC_METHODDEF \
+ {"fork_exec", _PyCFunction_CAST(subprocess_fork_exec), METH_FASTCALL, subprocess_fork_exec__doc__},
+
+static PyObject *
+subprocess_fork_exec_impl(PyObject *module, PyObject *process_args,
+ PyObject *executable_list, int close_fds,
+ PyObject *py_fds_to_keep, PyObject *cwd_obj,
+ PyObject *env_list, int p2cread, int p2cwrite,
+ int c2pread, int c2pwrite, int errread,
+ int errwrite, int errpipe_read, int errpipe_write,
+ int restore_signals, int call_setsid,
+ pid_t pgid_to_set, PyObject *gid_object,
+ PyObject *extra_groups_packed,
+ PyObject *uid_object, int child_umask,
+ PyObject *preexec_fn, int allow_vfork);
+
+static PyObject *
+subprocess_fork_exec(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *process_args;
+ PyObject *executable_list;
+ int close_fds;
+ PyObject *py_fds_to_keep;
+ PyObject *cwd_obj;
+ PyObject *env_list;
+ int p2cread;
+ int p2cwrite;
+ int c2pread;
+ int c2pwrite;
+ int errread;
+ int errwrite;
+ int errpipe_read;
+ int errpipe_write;
+ int restore_signals;
+ int call_setsid;
+ pid_t pgid_to_set;
+ PyObject *gid_object;
+ PyObject *extra_groups_packed;
+ PyObject *uid_object;
+ int child_umask;
+ PyObject *preexec_fn;
+ int allow_vfork;
+
+ if (!_PyArg_CheckPositional("fork_exec", nargs, 23, 23)) {
+ goto exit;
+ }
+ process_args = args[0];
+ executable_list = args[1];
+ close_fds = PyObject_IsTrue(args[2]);
+ if (close_fds < 0) {
+ goto exit;
+ }
+ if (!PyTuple_Check(args[3])) {
+ _PyArg_BadArgument("fork_exec", "argument 4", "tuple", args[3]);
+ goto exit;
+ }
+ py_fds_to_keep = args[3];
+ cwd_obj = args[4];
+ env_list = args[5];
+ p2cread = _PyLong_AsInt(args[6]);
+ if (p2cread == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ p2cwrite = _PyLong_AsInt(args[7]);
+ if (p2cwrite == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ c2pread = _PyLong_AsInt(args[8]);
+ if (c2pread == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ c2pwrite = _PyLong_AsInt(args[9]);
+ if (c2pwrite == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ errread = _PyLong_AsInt(args[10]);
+ if (errread == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ errwrite = _PyLong_AsInt(args[11]);
+ if (errwrite == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ errpipe_read = _PyLong_AsInt(args[12]);
+ if (errpipe_read == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ errpipe_write = _PyLong_AsInt(args[13]);
+ if (errpipe_write == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ restore_signals = PyObject_IsTrue(args[14]);
+ if (restore_signals < 0) {
+ goto exit;
+ }
+ call_setsid = PyObject_IsTrue(args[15]);
+ if (call_setsid < 0) {
+ goto exit;
+ }
+ pgid_to_set = PyLong_AsPid(args[16]);
+ if (pgid_to_set == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ gid_object = args[17];
+ extra_groups_packed = args[18];
+ uid_object = args[19];
+ child_umask = _PyLong_AsInt(args[20]);
+ if (child_umask == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ preexec_fn = args[21];
+ allow_vfork = PyObject_IsTrue(args[22]);
+ if (allow_vfork < 0) {
+ goto exit;
+ }
+ return_value = subprocess_fork_exec_impl(module, process_args, executable_list, close_fds, py_fds_to_keep, cwd_obj, env_list, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, errpipe_read, errpipe_write, restore_signals, call_setsid, pgid_to_set, gid_object, extra_groups_packed, uid_object, child_umask, preexec_fn, allow_vfork);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=46d71e86845c93d7 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_queuemodule.c.h b/contrib/tools/python3/Modules/clinic/_queuemodule.c.h
new file mode 100644
index 00000000000..906d0582a99
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_queuemodule.c.h
@@ -0,0 +1,334 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(simplequeue_new__doc__,
+"SimpleQueue()\n"
+"--\n"
+"\n"
+"Simple, unbounded, reentrant FIFO queue.");
+
+static PyObject *
+simplequeue_new_impl(PyTypeObject *type);
+
+static PyObject *
+simplequeue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = simplequeue_get_state_by_type(type)->SimpleQueueType;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoPositional("SimpleQueue", args)) {
+ goto exit;
+ }
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("SimpleQueue", kwargs)) {
+ goto exit;
+ }
+ return_value = simplequeue_new_impl(type);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_queue_SimpleQueue_put__doc__,
+"put($self, /, item, block=True, timeout=None)\n"
+"--\n"
+"\n"
+"Put the item on the queue.\n"
+"\n"
+"The optional \'block\' and \'timeout\' arguments are ignored, as this method\n"
+"never blocks. They are provided for compatibility with the Queue class.");
+
+#define _QUEUE_SIMPLEQUEUE_PUT_METHODDEF \
+ {"put", _PyCFunction_CAST(_queue_SimpleQueue_put), METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put__doc__},
+
+static PyObject *
+_queue_SimpleQueue_put_impl(simplequeueobject *self, PyObject *item,
+ int block, PyObject *timeout);
+
+static PyObject *
+_queue_SimpleQueue_put(simplequeueobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(item), &_Py_ID(block), &_Py_ID(timeout), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"item", "block", "timeout", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "put",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *item;
+ int block = 1;
+ PyObject *timeout = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ item = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ block = PyObject_IsTrue(args[1]);
+ if (block < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ timeout = args[2];
+skip_optional_pos:
+ return_value = _queue_SimpleQueue_put_impl(self, item, block, timeout);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_queue_SimpleQueue_put_nowait__doc__,
+"put_nowait($self, /, item)\n"
+"--\n"
+"\n"
+"Put an item into the queue without blocking.\n"
+"\n"
+"This is exactly equivalent to `put(item)` and is only provided\n"
+"for compatibility with the Queue class.");
+
+#define _QUEUE_SIMPLEQUEUE_PUT_NOWAIT_METHODDEF \
+ {"put_nowait", _PyCFunction_CAST(_queue_SimpleQueue_put_nowait), METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_put_nowait__doc__},
+
+static PyObject *
+_queue_SimpleQueue_put_nowait_impl(simplequeueobject *self, PyObject *item);
+
+static PyObject *
+_queue_SimpleQueue_put_nowait(simplequeueobject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(item), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"item", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "put_nowait",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *item;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ item = args[0];
+ return_value = _queue_SimpleQueue_put_nowait_impl(self, item);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_queue_SimpleQueue_get__doc__,
+"get($self, /, block=True, timeout=None)\n"
+"--\n"
+"\n"
+"Remove and return an item from the queue.\n"
+"\n"
+"If optional args \'block\' is true and \'timeout\' is None (the default),\n"
+"block if necessary until an item is available. If \'timeout\' is\n"
+"a non-negative number, it blocks at most \'timeout\' seconds and raises\n"
+"the Empty exception if no item was available within that time.\n"
+"Otherwise (\'block\' is false), return an item if one is immediately\n"
+"available, else raise the Empty exception (\'timeout\' is ignored\n"
+"in that case).");
+
+#define _QUEUE_SIMPLEQUEUE_GET_METHODDEF \
+ {"get", _PyCFunction_CAST(_queue_SimpleQueue_get), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_get__doc__},
+
+static PyObject *
+_queue_SimpleQueue_get_impl(simplequeueobject *self, PyTypeObject *cls,
+ int block, PyObject *timeout_obj);
+
+static PyObject *
+_queue_SimpleQueue_get(simplequeueobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(block), &_Py_ID(timeout), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"block", "timeout", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int block = 1;
+ PyObject *timeout_obj = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ block = PyObject_IsTrue(args[0]);
+ if (block < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ timeout_obj = args[1];
+skip_optional_pos:
+ return_value = _queue_SimpleQueue_get_impl(self, cls, block, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_queue_SimpleQueue_get_nowait__doc__,
+"get_nowait($self, /)\n"
+"--\n"
+"\n"
+"Remove and return an item from the queue without blocking.\n"
+"\n"
+"Only get an item if one is immediately available. Otherwise\n"
+"raise the Empty exception.");
+
+#define _QUEUE_SIMPLEQUEUE_GET_NOWAIT_METHODDEF \
+ {"get_nowait", _PyCFunction_CAST(_queue_SimpleQueue_get_nowait), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _queue_SimpleQueue_get_nowait__doc__},
+
+static PyObject *
+_queue_SimpleQueue_get_nowait_impl(simplequeueobject *self,
+ PyTypeObject *cls);
+
+static PyObject *
+_queue_SimpleQueue_get_nowait(simplequeueobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "get_nowait() takes no arguments");
+ return NULL;
+ }
+ return _queue_SimpleQueue_get_nowait_impl(self, cls);
+}
+
+PyDoc_STRVAR(_queue_SimpleQueue_empty__doc__,
+"empty($self, /)\n"
+"--\n"
+"\n"
+"Return True if the queue is empty, False otherwise (not reliable!).");
+
+#define _QUEUE_SIMPLEQUEUE_EMPTY_METHODDEF \
+ {"empty", (PyCFunction)_queue_SimpleQueue_empty, METH_NOARGS, _queue_SimpleQueue_empty__doc__},
+
+static int
+_queue_SimpleQueue_empty_impl(simplequeueobject *self);
+
+static PyObject *
+_queue_SimpleQueue_empty(simplequeueobject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _queue_SimpleQueue_empty_impl(self);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_queue_SimpleQueue_qsize__doc__,
+"qsize($self, /)\n"
+"--\n"
+"\n"
+"Return the approximate size of the queue (not reliable!).");
+
+#define _QUEUE_SIMPLEQUEUE_QSIZE_METHODDEF \
+ {"qsize", (PyCFunction)_queue_SimpleQueue_qsize, METH_NOARGS, _queue_SimpleQueue_qsize__doc__},
+
+static Py_ssize_t
+_queue_SimpleQueue_qsize_impl(simplequeueobject *self);
+
+static PyObject *
+_queue_SimpleQueue_qsize(simplequeueobject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t _return_value;
+
+ _return_value = _queue_SimpleQueue_qsize_impl(self);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=78816f171ecc4422 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_randommodule.c.h b/contrib/tools/python3/Modules/clinic/_randommodule.c.h
new file mode 100644
index 00000000000..ec8531ce006
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_randommodule.c.h
@@ -0,0 +1,118 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_random_Random_random__doc__,
+"random($self, /)\n"
+"--\n"
+"\n"
+"random() -> x in the interval [0, 1).");
+
+#define _RANDOM_RANDOM_RANDOM_METHODDEF \
+ {"random", (PyCFunction)_random_Random_random, METH_NOARGS, _random_Random_random__doc__},
+
+static PyObject *
+_random_Random_random_impl(RandomObject *self);
+
+static PyObject *
+_random_Random_random(RandomObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _random_Random_random_impl(self);
+}
+
+PyDoc_STRVAR(_random_Random_seed__doc__,
+"seed($self, n=None, /)\n"
+"--\n"
+"\n"
+"seed([n]) -> None.\n"
+"\n"
+"Defaults to use urandom and falls back to a combination\n"
+"of the current time and the process identifier.");
+
+#define _RANDOM_RANDOM_SEED_METHODDEF \
+ {"seed", _PyCFunction_CAST(_random_Random_seed), METH_FASTCALL, _random_Random_seed__doc__},
+
+static PyObject *
+_random_Random_seed_impl(RandomObject *self, PyObject *n);
+
+static PyObject *
+_random_Random_seed(RandomObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *n = Py_None;
+
+ if (!_PyArg_CheckPositional("seed", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ n = args[0];
+skip_optional:
+ return_value = _random_Random_seed_impl(self, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_random_Random_getstate__doc__,
+"getstate($self, /)\n"
+"--\n"
+"\n"
+"getstate() -> tuple containing the current state.");
+
+#define _RANDOM_RANDOM_GETSTATE_METHODDEF \
+ {"getstate", (PyCFunction)_random_Random_getstate, METH_NOARGS, _random_Random_getstate__doc__},
+
+static PyObject *
+_random_Random_getstate_impl(RandomObject *self);
+
+static PyObject *
+_random_Random_getstate(RandomObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _random_Random_getstate_impl(self);
+}
+
+PyDoc_STRVAR(_random_Random_setstate__doc__,
+"setstate($self, state, /)\n"
+"--\n"
+"\n"
+"setstate(state) -> None. Restores generator state.");
+
+#define _RANDOM_RANDOM_SETSTATE_METHODDEF \
+ {"setstate", (PyCFunction)_random_Random_setstate, METH_O, _random_Random_setstate__doc__},
+
+PyDoc_STRVAR(_random_Random_getrandbits__doc__,
+"getrandbits($self, k, /)\n"
+"--\n"
+"\n"
+"getrandbits(k) -> x. Generates an int with k random bits.");
+
+#define _RANDOM_RANDOM_GETRANDBITS_METHODDEF \
+ {"getrandbits", (PyCFunction)_random_Random_getrandbits, METH_O, _random_Random_getrandbits__doc__},
+
+static PyObject *
+_random_Random_getrandbits_impl(RandomObject *self, int k);
+
+static PyObject *
+_random_Random_getrandbits(RandomObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int k;
+
+ k = _PyLong_AsInt(arg);
+ if (k == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _random_Random_getrandbits_impl(self, k);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=bc17406a886824fc input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_ssl.c.h b/contrib/tools/python3/Modules/clinic/_ssl.c.h
new file mode 100644
index 00000000000..9f967ddc8e3
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_ssl.c.h
@@ -0,0 +1,1545 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__,
+"do_handshake($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_DO_HANDSHAKE_METHODDEF \
+ {"do_handshake", (PyCFunction)_ssl__SSLSocket_do_handshake, METH_NOARGS, _ssl__SSLSocket_do_handshake__doc__},
+
+static PyObject *
+_ssl__SSLSocket_do_handshake_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_do_handshake(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_do_handshake_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__test_decode_cert__doc__,
+"_test_decode_cert($module, path, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__TEST_DECODE_CERT_METHODDEF \
+ {"_test_decode_cert", (PyCFunction)_ssl__test_decode_cert, METH_O, _ssl__test_decode_cert__doc__},
+
+static PyObject *
+_ssl__test_decode_cert_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+_ssl__test_decode_cert(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *path;
+
+ if (!PyUnicode_FSConverter(arg, &path)) {
+ goto exit;
+ }
+ return_value = _ssl__test_decode_cert_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_getpeercert__doc__,
+"getpeercert($self, der=False, /)\n"
+"--\n"
+"\n"
+"Returns the certificate for the peer.\n"
+"\n"
+"If no certificate was provided, returns None. If a certificate was\n"
+"provided, but not validated, returns an empty dictionary. Otherwise\n"
+"returns a dict containing information about the peer certificate.\n"
+"\n"
+"If the optional argument is True, returns a DER-encoded copy of the\n"
+"peer certificate, or None if no certificate was provided. This will\n"
+"return the certificate even if it wasn\'t validated.");
+
+#define _SSL__SSLSOCKET_GETPEERCERT_METHODDEF \
+ {"getpeercert", _PyCFunction_CAST(_ssl__SSLSocket_getpeercert), METH_FASTCALL, _ssl__SSLSocket_getpeercert__doc__},
+
+static PyObject *
+_ssl__SSLSocket_getpeercert_impl(PySSLSocket *self, int binary_mode);
+
+static PyObject *
+_ssl__SSLSocket_getpeercert(PySSLSocket *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int binary_mode = 0;
+
+ if (!_PyArg_CheckPositional("getpeercert", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ binary_mode = PyObject_IsTrue(args[0]);
+ if (binary_mode < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _ssl__SSLSocket_getpeercert_impl(self, binary_mode);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_get_verified_chain__doc__,
+"get_verified_chain($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_GET_VERIFIED_CHAIN_METHODDEF \
+ {"get_verified_chain", (PyCFunction)_ssl__SSLSocket_get_verified_chain, METH_NOARGS, _ssl__SSLSocket_get_verified_chain__doc__},
+
+static PyObject *
+_ssl__SSLSocket_get_verified_chain_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_get_verified_chain(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_get_verified_chain_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_get_unverified_chain__doc__,
+"get_unverified_chain($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_GET_UNVERIFIED_CHAIN_METHODDEF \
+ {"get_unverified_chain", (PyCFunction)_ssl__SSLSocket_get_unverified_chain, METH_NOARGS, _ssl__SSLSocket_get_unverified_chain__doc__},
+
+static PyObject *
+_ssl__SSLSocket_get_unverified_chain_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_get_unverified_chain(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_get_unverified_chain_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_shared_ciphers__doc__,
+"shared_ciphers($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_SHARED_CIPHERS_METHODDEF \
+ {"shared_ciphers", (PyCFunction)_ssl__SSLSocket_shared_ciphers, METH_NOARGS, _ssl__SSLSocket_shared_ciphers__doc__},
+
+static PyObject *
+_ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_shared_ciphers(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_shared_ciphers_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_cipher__doc__,
+"cipher($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_CIPHER_METHODDEF \
+ {"cipher", (PyCFunction)_ssl__SSLSocket_cipher, METH_NOARGS, _ssl__SSLSocket_cipher__doc__},
+
+static PyObject *
+_ssl__SSLSocket_cipher_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_cipher(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_cipher_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_version__doc__,
+"version($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_VERSION_METHODDEF \
+ {"version", (PyCFunction)_ssl__SSLSocket_version, METH_NOARGS, _ssl__SSLSocket_version__doc__},
+
+static PyObject *
+_ssl__SSLSocket_version_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_version(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_version_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_selected_alpn_protocol__doc__,
+"selected_alpn_protocol($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_SELECTED_ALPN_PROTOCOL_METHODDEF \
+ {"selected_alpn_protocol", (PyCFunction)_ssl__SSLSocket_selected_alpn_protocol, METH_NOARGS, _ssl__SSLSocket_selected_alpn_protocol__doc__},
+
+static PyObject *
+_ssl__SSLSocket_selected_alpn_protocol_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_selected_alpn_protocol(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_selected_alpn_protocol_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_compression__doc__,
+"compression($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLSOCKET_COMPRESSION_METHODDEF \
+ {"compression", (PyCFunction)_ssl__SSLSocket_compression, METH_NOARGS, _ssl__SSLSocket_compression__doc__},
+
+static PyObject *
+_ssl__SSLSocket_compression_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_compression(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_compression_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_write__doc__,
+"write($self, b, /)\n"
+"--\n"
+"\n"
+"Writes the bytes-like object b into the SSL object.\n"
+"\n"
+"Returns the number of bytes written.");
+
+#define _SSL__SSLSOCKET_WRITE_METHODDEF \
+ {"write", (PyCFunction)_ssl__SSLSocket_write, METH_O, _ssl__SSLSocket_write__doc__},
+
+static PyObject *
+_ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b);
+
+static PyObject *
+_ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer b = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&b, 'C')) {
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _ssl__SSLSocket_write_impl(self, &b);
+
+exit:
+ /* Cleanup for b */
+ if (b.obj) {
+ PyBuffer_Release(&b);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_pending__doc__,
+"pending($self, /)\n"
+"--\n"
+"\n"
+"Returns the number of already decrypted bytes available for read, pending on the connection.");
+
+#define _SSL__SSLSOCKET_PENDING_METHODDEF \
+ {"pending", (PyCFunction)_ssl__SSLSocket_pending, METH_NOARGS, _ssl__SSLSocket_pending__doc__},
+
+static PyObject *
+_ssl__SSLSocket_pending_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_pending(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_pending_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_read__doc__,
+"read(size, [buffer])\n"
+"Read up to size bytes from the SSL socket.");
+
+#define _SSL__SSLSOCKET_READ_METHODDEF \
+ {"read", (PyCFunction)_ssl__SSLSocket_read, METH_VARARGS, _ssl__SSLSocket_read__doc__},
+
+static PyObject *
+_ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
+ int group_right_1, Py_buffer *buffer);
+
+static PyObject *
+_ssl__SSLSocket_read(PySSLSocket *self, PyObject *args)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t len;
+ int group_right_1 = 0;
+ Py_buffer buffer = {NULL, NULL};
+
+ switch (PyTuple_GET_SIZE(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "n:read", &len)) {
+ goto exit;
+ }
+ break;
+ case 2:
+ if (!PyArg_ParseTuple(args, "nw*:read", &len, &buffer)) {
+ goto exit;
+ }
+ group_right_1 = 1;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "_ssl._SSLSocket.read requires 1 to 2 arguments");
+ goto exit;
+ }
+ return_value = _ssl__SSLSocket_read_impl(self, len, group_right_1, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_shutdown__doc__,
+"shutdown($self, /)\n"
+"--\n"
+"\n"
+"Does the SSL shutdown handshake with the remote end.");
+
+#define _SSL__SSLSOCKET_SHUTDOWN_METHODDEF \
+ {"shutdown", (PyCFunction)_ssl__SSLSocket_shutdown, METH_NOARGS, _ssl__SSLSocket_shutdown__doc__},
+
+static PyObject *
+_ssl__SSLSocket_shutdown_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_shutdown(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_shutdown_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_get_channel_binding__doc__,
+"get_channel_binding($self, /, cb_type=\'tls-unique\')\n"
+"--\n"
+"\n"
+"Get channel binding data for current connection.\n"
+"\n"
+"Raise ValueError if the requested `cb_type` is not supported. Return bytes\n"
+"of the data or None if the data is not available (e.g. before the handshake).\n"
+"Only \'tls-unique\' channel binding data from RFC 5929 is supported.");
+
+#define _SSL__SSLSOCKET_GET_CHANNEL_BINDING_METHODDEF \
+ {"get_channel_binding", _PyCFunction_CAST(_ssl__SSLSocket_get_channel_binding), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLSocket_get_channel_binding__doc__},
+
+static PyObject *
+_ssl__SSLSocket_get_channel_binding_impl(PySSLSocket *self,
+ const char *cb_type);
+
+static PyObject *
+_ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(cb_type), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"cb_type", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get_channel_binding",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ const char *cb_type = "tls-unique";
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("get_channel_binding", "argument 'cb_type'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t cb_type_length;
+ cb_type = PyUnicode_AsUTF8AndSize(args[0], &cb_type_length);
+ if (cb_type == NULL) {
+ goto exit;
+ }
+ if (strlen(cb_type) != (size_t)cb_type_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _ssl__SSLSocket_get_channel_binding_impl(self, cb_type);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLSocket_verify_client_post_handshake__doc__,
+"verify_client_post_handshake($self, /)\n"
+"--\n"
+"\n"
+"Initiate TLS 1.3 post-handshake authentication");
+
+#define _SSL__SSLSOCKET_VERIFY_CLIENT_POST_HANDSHAKE_METHODDEF \
+ {"verify_client_post_handshake", (PyCFunction)_ssl__SSLSocket_verify_client_post_handshake, METH_NOARGS, _ssl__SSLSocket_verify_client_post_handshake__doc__},
+
+static PyObject *
+_ssl__SSLSocket_verify_client_post_handshake_impl(PySSLSocket *self);
+
+static PyObject *
+_ssl__SSLSocket_verify_client_post_handshake(PySSLSocket *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLSocket_verify_client_post_handshake_impl(self);
+}
+
+static PyObject *
+_ssl__SSLContext_impl(PyTypeObject *type, int proto_version);
+
+static PyObject *
+_ssl__SSLContext(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = get_state_type(type)->PySSLContext_Type;
+ int proto_version;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("_SSLContext", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("_SSLContext", PyTuple_GET_SIZE(args), 1, 1)) {
+ goto exit;
+ }
+ proto_version = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0));
+ if (proto_version == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _ssl__SSLContext_impl(type, proto_version);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_set_ciphers__doc__,
+"set_ciphers($self, cipherlist, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_SET_CIPHERS_METHODDEF \
+ {"set_ciphers", (PyCFunction)_ssl__SSLContext_set_ciphers, METH_O, _ssl__SSLContext_set_ciphers__doc__},
+
+static PyObject *
+_ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist);
+
+static PyObject *
+_ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *cipherlist;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("set_ciphers", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t cipherlist_length;
+ cipherlist = PyUnicode_AsUTF8AndSize(arg, &cipherlist_length);
+ if (cipherlist == NULL) {
+ goto exit;
+ }
+ if (strlen(cipherlist) != (size_t)cipherlist_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _ssl__SSLContext_set_ciphers_impl(self, cipherlist);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_get_ciphers__doc__,
+"get_ciphers($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_GET_CIPHERS_METHODDEF \
+ {"get_ciphers", (PyCFunction)_ssl__SSLContext_get_ciphers, METH_NOARGS, _ssl__SSLContext_get_ciphers__doc__},
+
+static PyObject *
+_ssl__SSLContext_get_ciphers_impl(PySSLContext *self);
+
+static PyObject *
+_ssl__SSLContext_get_ciphers(PySSLContext *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLContext_get_ciphers_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLContext__set_alpn_protocols__doc__,
+"_set_alpn_protocols($self, protos, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT__SET_ALPN_PROTOCOLS_METHODDEF \
+ {"_set_alpn_protocols", (PyCFunction)_ssl__SSLContext__set_alpn_protocols, METH_O, _ssl__SSLContext__set_alpn_protocols__doc__},
+
+static PyObject *
+_ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self,
+ Py_buffer *protos);
+
+static PyObject *
+_ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer protos = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&protos, 'C')) {
+ _PyArg_BadArgument("_set_alpn_protocols", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos);
+
+exit:
+ /* Cleanup for protos */
+ if (protos.obj) {
+ PyBuffer_Release(&protos);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_load_cert_chain__doc__,
+"load_cert_chain($self, /, certfile, keyfile=None, password=None)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_LOAD_CERT_CHAIN_METHODDEF \
+ {"load_cert_chain", _PyCFunction_CAST(_ssl__SSLContext_load_cert_chain), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_cert_chain__doc__},
+
+static PyObject *
+_ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile,
+ PyObject *keyfile, PyObject *password);
+
+static PyObject *
+_ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(certfile), &_Py_ID(keyfile), &_Py_ID(password), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"certfile", "keyfile", "password", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "load_cert_chain",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *certfile;
+ PyObject *keyfile = Py_None;
+ PyObject *password = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ certfile = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ keyfile = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ password = args[2];
+skip_optional_pos:
+ return_value = _ssl__SSLContext_load_cert_chain_impl(self, certfile, keyfile, password);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_load_verify_locations__doc__,
+"load_verify_locations($self, /, cafile=None, capath=None, cadata=None)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_LOAD_VERIFY_LOCATIONS_METHODDEF \
+ {"load_verify_locations", _PyCFunction_CAST(_ssl__SSLContext_load_verify_locations), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_load_verify_locations__doc__},
+
+static PyObject *
+_ssl__SSLContext_load_verify_locations_impl(PySSLContext *self,
+ PyObject *cafile,
+ PyObject *capath,
+ PyObject *cadata);
+
+static PyObject *
+_ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(cafile), &_Py_ID(capath), &_Py_ID(cadata), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"cafile", "capath", "cadata", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "load_verify_locations",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *cafile = Py_None;
+ PyObject *capath = Py_None;
+ PyObject *cadata = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ cafile = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[1]) {
+ capath = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ cadata = args[2];
+skip_optional_pos:
+ return_value = _ssl__SSLContext_load_verify_locations_impl(self, cafile, capath, cadata);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_load_dh_params__doc__,
+"load_dh_params($self, path, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_LOAD_DH_PARAMS_METHODDEF \
+ {"load_dh_params", (PyCFunction)_ssl__SSLContext_load_dh_params, METH_O, _ssl__SSLContext_load_dh_params__doc__},
+
+PyDoc_STRVAR(_ssl__SSLContext__wrap_socket__doc__,
+"_wrap_socket($self, /, sock, server_side, server_hostname=None, *,\n"
+" owner=None, session=None)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT__WRAP_SOCKET_METHODDEF \
+ {"_wrap_socket", _PyCFunction_CAST(_ssl__SSLContext__wrap_socket), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_socket__doc__},
+
+static PyObject *
+_ssl__SSLContext__wrap_socket_impl(PySSLContext *self, PyObject *sock,
+ int server_side, PyObject *hostname_obj,
+ PyObject *owner, PyObject *session);
+
+static PyObject *
+_ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(sock), &_Py_ID(server_side), &_Py_ID(server_hostname), &_Py_ID(owner), &_Py_ID(session), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"sock", "server_side", "server_hostname", "owner", "session", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_wrap_socket",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyObject *sock;
+ int server_side;
+ PyObject *hostname_obj = Py_None;
+ PyObject *owner = Py_None;
+ PyObject *session = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(args[0], get_state_ctx(self)->Sock_Type)) {
+ _PyArg_BadArgument("_wrap_socket", "argument 'sock'", (get_state_ctx(self)->Sock_Type)->tp_name, args[0]);
+ goto exit;
+ }
+ sock = args[0];
+ server_side = PyObject_IsTrue(args[1]);
+ if (server_side < 0) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ hostname_obj = args[2];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[3]) {
+ owner = args[3];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ session = args[4];
+skip_optional_kwonly:
+ return_value = _ssl__SSLContext__wrap_socket_impl(self, sock, server_side, hostname_obj, owner, session);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext__wrap_bio__doc__,
+"_wrap_bio($self, /, incoming, outgoing, server_side,\n"
+" server_hostname=None, *, owner=None, session=None)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT__WRAP_BIO_METHODDEF \
+ {"_wrap_bio", _PyCFunction_CAST(_ssl__SSLContext__wrap_bio), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext__wrap_bio__doc__},
+
+static PyObject *
+_ssl__SSLContext__wrap_bio_impl(PySSLContext *self, PySSLMemoryBIO *incoming,
+ PySSLMemoryBIO *outgoing, int server_side,
+ PyObject *hostname_obj, PyObject *owner,
+ PyObject *session);
+
+static PyObject *
+_ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 6
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(incoming), &_Py_ID(outgoing), &_Py_ID(server_side), &_Py_ID(server_hostname), &_Py_ID(owner), &_Py_ID(session), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"incoming", "outgoing", "server_side", "server_hostname", "owner", "session", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_wrap_bio",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[6];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ PySSLMemoryBIO *incoming;
+ PySSLMemoryBIO *outgoing;
+ int server_side;
+ PyObject *hostname_obj = Py_None;
+ PyObject *owner = Py_None;
+ PyObject *session = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(args[0], get_state_ctx(self)->PySSLMemoryBIO_Type)) {
+ _PyArg_BadArgument("_wrap_bio", "argument 'incoming'", (get_state_ctx(self)->PySSLMemoryBIO_Type)->tp_name, args[0]);
+ goto exit;
+ }
+ incoming = (PySSLMemoryBIO *)args[0];
+ if (!PyObject_TypeCheck(args[1], get_state_ctx(self)->PySSLMemoryBIO_Type)) {
+ _PyArg_BadArgument("_wrap_bio", "argument 'outgoing'", (get_state_ctx(self)->PySSLMemoryBIO_Type)->tp_name, args[1]);
+ goto exit;
+ }
+ outgoing = (PySSLMemoryBIO *)args[1];
+ server_side = PyObject_IsTrue(args[2]);
+ if (server_side < 0) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[3]) {
+ hostname_obj = args[3];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[4]) {
+ owner = args[4];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ session = args[5];
+skip_optional_kwonly:
+ return_value = _ssl__SSLContext__wrap_bio_impl(self, incoming, outgoing, server_side, hostname_obj, owner, session);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_session_stats__doc__,
+"session_stats($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_SESSION_STATS_METHODDEF \
+ {"session_stats", (PyCFunction)_ssl__SSLContext_session_stats, METH_NOARGS, _ssl__SSLContext_session_stats__doc__},
+
+static PyObject *
+_ssl__SSLContext_session_stats_impl(PySSLContext *self);
+
+static PyObject *
+_ssl__SSLContext_session_stats(PySSLContext *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLContext_session_stats_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_set_default_verify_paths__doc__,
+"set_default_verify_paths($self, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_SET_DEFAULT_VERIFY_PATHS_METHODDEF \
+ {"set_default_verify_paths", (PyCFunction)_ssl__SSLContext_set_default_verify_paths, METH_NOARGS, _ssl__SSLContext_set_default_verify_paths__doc__},
+
+static PyObject *
+_ssl__SSLContext_set_default_verify_paths_impl(PySSLContext *self);
+
+static PyObject *
+_ssl__SSLContext_set_default_verify_paths(PySSLContext *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLContext_set_default_verify_paths_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_set_ecdh_curve__doc__,
+"set_ecdh_curve($self, name, /)\n"
+"--\n"
+"\n");
+
+#define _SSL__SSLCONTEXT_SET_ECDH_CURVE_METHODDEF \
+ {"set_ecdh_curve", (PyCFunction)_ssl__SSLContext_set_ecdh_curve, METH_O, _ssl__SSLContext_set_ecdh_curve__doc__},
+
+PyDoc_STRVAR(_ssl__SSLContext_cert_store_stats__doc__,
+"cert_store_stats($self, /)\n"
+"--\n"
+"\n"
+"Returns quantities of loaded X.509 certificates.\n"
+"\n"
+"X.509 certificates with a CA extension and certificate revocation lists\n"
+"inside the context\'s cert store.\n"
+"\n"
+"NOTE: Certificates in a capath directory aren\'t loaded unless they have\n"
+"been used at least once.");
+
+#define _SSL__SSLCONTEXT_CERT_STORE_STATS_METHODDEF \
+ {"cert_store_stats", (PyCFunction)_ssl__SSLContext_cert_store_stats, METH_NOARGS, _ssl__SSLContext_cert_store_stats__doc__},
+
+static PyObject *
+_ssl__SSLContext_cert_store_stats_impl(PySSLContext *self);
+
+static PyObject *
+_ssl__SSLContext_cert_store_stats(PySSLContext *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl__SSLContext_cert_store_stats_impl(self);
+}
+
+PyDoc_STRVAR(_ssl__SSLContext_get_ca_certs__doc__,
+"get_ca_certs($self, /, binary_form=False)\n"
+"--\n"
+"\n"
+"Returns a list of dicts with information of loaded CA certs.\n"
+"\n"
+"If the optional argument is True, returns a DER-encoded copy of the CA\n"
+"certificate.\n"
+"\n"
+"NOTE: Certificates in a capath directory aren\'t loaded unless they have\n"
+"been used at least once.");
+
+#define _SSL__SSLCONTEXT_GET_CA_CERTS_METHODDEF \
+ {"get_ca_certs", _PyCFunction_CAST(_ssl__SSLContext_get_ca_certs), METH_FASTCALL|METH_KEYWORDS, _ssl__SSLContext_get_ca_certs__doc__},
+
+static PyObject *
+_ssl__SSLContext_get_ca_certs_impl(PySSLContext *self, int binary_form);
+
+static PyObject *
+_ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(binary_form), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"binary_form", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get_ca_certs",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int binary_form = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ binary_form = PyObject_IsTrue(args[0]);
+ if (binary_form < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _ssl__SSLContext_get_ca_certs_impl(self, binary_form);
+
+exit:
+ return return_value;
+}
+
+static PyObject *
+_ssl_MemoryBIO_impl(PyTypeObject *type);
+
+static PyObject *
+_ssl_MemoryBIO(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = get_state_type(type)->PySSLMemoryBIO_Type;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoPositional("MemoryBIO", args)) {
+ goto exit;
+ }
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("MemoryBIO", kwargs)) {
+ goto exit;
+ }
+ return_value = _ssl_MemoryBIO_impl(type);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_MemoryBIO_read__doc__,
+"read($self, size=-1, /)\n"
+"--\n"
+"\n"
+"Read up to size bytes from the memory BIO.\n"
+"\n"
+"If size is not specified, read the entire buffer.\n"
+"If the return value is an empty bytes instance, this means either\n"
+"EOF or that no data is available. Use the \"eof\" property to\n"
+"distinguish between the two.");
+
+#define _SSL_MEMORYBIO_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(_ssl_MemoryBIO_read), METH_FASTCALL, _ssl_MemoryBIO_read__doc__},
+
+static PyObject *
+_ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len);
+
+static PyObject *
+_ssl_MemoryBIO_read(PySSLMemoryBIO *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int len = -1;
+
+ if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ len = _PyLong_AsInt(args[0]);
+ if (len == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _ssl_MemoryBIO_read_impl(self, len);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_MemoryBIO_write__doc__,
+"write($self, b, /)\n"
+"--\n"
+"\n"
+"Writes the bytes b into the memory BIO.\n"
+"\n"
+"Returns the number of bytes written.");
+
+#define _SSL_MEMORYBIO_WRITE_METHODDEF \
+ {"write", (PyCFunction)_ssl_MemoryBIO_write, METH_O, _ssl_MemoryBIO_write__doc__},
+
+static PyObject *
+_ssl_MemoryBIO_write_impl(PySSLMemoryBIO *self, Py_buffer *b);
+
+static PyObject *
+_ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer b = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&b, 'C')) {
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = _ssl_MemoryBIO_write_impl(self, &b);
+
+exit:
+ /* Cleanup for b */
+ if (b.obj) {
+ PyBuffer_Release(&b);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_MemoryBIO_write_eof__doc__,
+"write_eof($self, /)\n"
+"--\n"
+"\n"
+"Write an EOF marker to the memory BIO.\n"
+"\n"
+"When all data has been read, the \"eof\" property will be True.");
+
+#define _SSL_MEMORYBIO_WRITE_EOF_METHODDEF \
+ {"write_eof", (PyCFunction)_ssl_MemoryBIO_write_eof, METH_NOARGS, _ssl_MemoryBIO_write_eof__doc__},
+
+static PyObject *
+_ssl_MemoryBIO_write_eof_impl(PySSLMemoryBIO *self);
+
+static PyObject *
+_ssl_MemoryBIO_write_eof(PySSLMemoryBIO *self, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl_MemoryBIO_write_eof_impl(self);
+}
+
+PyDoc_STRVAR(_ssl_RAND_add__doc__,
+"RAND_add($module, string, entropy, /)\n"
+"--\n"
+"\n"
+"Mix string into the OpenSSL PRNG state.\n"
+"\n"
+"entropy (a float) is a lower bound on the entropy contained in\n"
+"string. See RFC 4086.");
+
+#define _SSL_RAND_ADD_METHODDEF \
+ {"RAND_add", _PyCFunction_CAST(_ssl_RAND_add), METH_FASTCALL, _ssl_RAND_add__doc__},
+
+static PyObject *
+_ssl_RAND_add_impl(PyObject *module, Py_buffer *view, double entropy);
+
+static PyObject *
+_ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer view = {NULL, NULL};
+ double entropy;
+
+ if (!_PyArg_CheckPositional("RAND_add", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyUnicode_Check(args[0])) {
+ Py_ssize_t len;
+ const char *ptr = PyUnicode_AsUTF8AndSize(args[0], &len);
+ if (ptr == NULL) {
+ goto exit;
+ }
+ PyBuffer_FillInfo(&view, args[0], (void *)ptr, len, 1, 0);
+ }
+ else { /* any bytes-like object */
+ if (PyObject_GetBuffer(args[0], &view, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&view, 'C')) {
+ _PyArg_BadArgument("RAND_add", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ entropy = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ entropy = PyFloat_AsDouble(args[1]);
+ if (entropy == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = _ssl_RAND_add_impl(module, &view, entropy);
+
+exit:
+ /* Cleanup for view */
+ if (view.obj) {
+ PyBuffer_Release(&view);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_RAND_bytes__doc__,
+"RAND_bytes($module, n, /)\n"
+"--\n"
+"\n"
+"Generate n cryptographically strong pseudo-random bytes.");
+
+#define _SSL_RAND_BYTES_METHODDEF \
+ {"RAND_bytes", (PyCFunction)_ssl_RAND_bytes, METH_O, _ssl_RAND_bytes__doc__},
+
+static PyObject *
+_ssl_RAND_bytes_impl(PyObject *module, int n);
+
+static PyObject *
+_ssl_RAND_bytes(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int n;
+
+ n = _PyLong_AsInt(arg);
+ if (n == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _ssl_RAND_bytes_impl(module, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_RAND_status__doc__,
+"RAND_status($module, /)\n"
+"--\n"
+"\n"
+"Returns True if the OpenSSL PRNG has been seeded with enough data and False if not.\n"
+"\n"
+"It is necessary to seed the PRNG with RAND_add() on some platforms before\n"
+"using the ssl() function.");
+
+#define _SSL_RAND_STATUS_METHODDEF \
+ {"RAND_status", (PyCFunction)_ssl_RAND_status, METH_NOARGS, _ssl_RAND_status__doc__},
+
+static PyObject *
+_ssl_RAND_status_impl(PyObject *module);
+
+static PyObject *
+_ssl_RAND_status(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl_RAND_status_impl(module);
+}
+
+PyDoc_STRVAR(_ssl_get_default_verify_paths__doc__,
+"get_default_verify_paths($module, /)\n"
+"--\n"
+"\n"
+"Return search paths and environment vars that are used by SSLContext\'s set_default_verify_paths() to load default CAs.\n"
+"\n"
+"The values are \'cert_file_env\', \'cert_file\', \'cert_dir_env\', \'cert_dir\'.");
+
+#define _SSL_GET_DEFAULT_VERIFY_PATHS_METHODDEF \
+ {"get_default_verify_paths", (PyCFunction)_ssl_get_default_verify_paths, METH_NOARGS, _ssl_get_default_verify_paths__doc__},
+
+static PyObject *
+_ssl_get_default_verify_paths_impl(PyObject *module);
+
+static PyObject *
+_ssl_get_default_verify_paths(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _ssl_get_default_verify_paths_impl(module);
+}
+
+PyDoc_STRVAR(_ssl_txt2obj__doc__,
+"txt2obj($module, /, txt, name=False)\n"
+"--\n"
+"\n"
+"Lookup NID, short name, long name and OID of an ASN1_OBJECT.\n"
+"\n"
+"By default objects are looked up by OID. With name=True short and\n"
+"long name are also matched.");
+
+#define _SSL_TXT2OBJ_METHODDEF \
+ {"txt2obj", _PyCFunction_CAST(_ssl_txt2obj), METH_FASTCALL|METH_KEYWORDS, _ssl_txt2obj__doc__},
+
+static PyObject *
+_ssl_txt2obj_impl(PyObject *module, const char *txt, int name);
+
+static PyObject *
+_ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(txt), &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"txt", "name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "txt2obj",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ const char *txt;
+ int name = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("txt2obj", "argument 'txt'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t txt_length;
+ txt = PyUnicode_AsUTF8AndSize(args[0], &txt_length);
+ if (txt == NULL) {
+ goto exit;
+ }
+ if (strlen(txt) != (size_t)txt_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ name = PyObject_IsTrue(args[1]);
+ if (name < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _ssl_txt2obj_impl(module, txt, name);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_ssl_nid2obj__doc__,
+"nid2obj($module, nid, /)\n"
+"--\n"
+"\n"
+"Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID.");
+
+#define _SSL_NID2OBJ_METHODDEF \
+ {"nid2obj", (PyCFunction)_ssl_nid2obj, METH_O, _ssl_nid2obj__doc__},
+
+static PyObject *
+_ssl_nid2obj_impl(PyObject *module, int nid);
+
+static PyObject *
+_ssl_nid2obj(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int nid;
+
+ nid = _PyLong_AsInt(arg);
+ if (nid == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _ssl_nid2obj_impl(module, nid);
+
+exit:
+ return return_value;
+}
+
+#if defined(_MSC_VER)
+
+PyDoc_STRVAR(_ssl_enum_certificates__doc__,
+"enum_certificates($module, /, store_name)\n"
+"--\n"
+"\n"
+"Retrieve certificates from Windows\' cert store.\n"
+"\n"
+"store_name may be one of \'CA\', \'ROOT\' or \'MY\'. The system may provide\n"
+"more cert storages, too. The function returns a list of (bytes,\n"
+"encoding_type, trust) tuples. The encoding_type flag can be interpreted\n"
+"with X509_ASN_ENCODING or PKCS_7_ASN_ENCODING. The trust setting is either\n"
+"a set of OIDs or the boolean True.");
+
+#define _SSL_ENUM_CERTIFICATES_METHODDEF \
+ {"enum_certificates", _PyCFunction_CAST(_ssl_enum_certificates), METH_FASTCALL|METH_KEYWORDS, _ssl_enum_certificates__doc__},
+
+static PyObject *
+_ssl_enum_certificates_impl(PyObject *module, const char *store_name);
+
+static PyObject *
+_ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(store_name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"store_name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "enum_certificates",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ const char *store_name;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("enum_certificates", "argument 'store_name'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t store_name_length;
+ store_name = PyUnicode_AsUTF8AndSize(args[0], &store_name_length);
+ if (store_name == NULL) {
+ goto exit;
+ }
+ if (strlen(store_name) != (size_t)store_name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _ssl_enum_certificates_impl(module, store_name);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(_MSC_VER) */
+
+#if defined(_MSC_VER)
+
+PyDoc_STRVAR(_ssl_enum_crls__doc__,
+"enum_crls($module, /, store_name)\n"
+"--\n"
+"\n"
+"Retrieve CRLs from Windows\' cert store.\n"
+"\n"
+"store_name may be one of \'CA\', \'ROOT\' or \'MY\'. The system may provide\n"
+"more cert storages, too. The function returns a list of (bytes,\n"
+"encoding_type) tuples. The encoding_type flag can be interpreted with\n"
+"X509_ASN_ENCODING or PKCS_7_ASN_ENCODING.");
+
+#define _SSL_ENUM_CRLS_METHODDEF \
+ {"enum_crls", _PyCFunction_CAST(_ssl_enum_crls), METH_FASTCALL|METH_KEYWORDS, _ssl_enum_crls__doc__},
+
+static PyObject *
+_ssl_enum_crls_impl(PyObject *module, const char *store_name);
+
+static PyObject *
+_ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(store_name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"store_name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "enum_crls",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ const char *store_name;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("enum_crls", "argument 'store_name'", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t store_name_length;
+ store_name = PyUnicode_AsUTF8AndSize(args[0], &store_name_length);
+ if (store_name == NULL) {
+ goto exit;
+ }
+ if (strlen(store_name) != (size_t)store_name_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _ssl_enum_crls_impl(module, store_name);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(_MSC_VER) */
+
+#ifndef _SSL_ENUM_CERTIFICATES_METHODDEF
+ #define _SSL_ENUM_CERTIFICATES_METHODDEF
+#endif /* !defined(_SSL_ENUM_CERTIFICATES_METHODDEF) */
+
+#ifndef _SSL_ENUM_CRLS_METHODDEF
+ #define _SSL_ENUM_CRLS_METHODDEF
+#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
+/*[clinic end generated code: output=4d9b81fa81f520f0 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h b/contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h
new file mode 100644
index 00000000000..4dedadd2939
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_statisticsmodule.c.h
@@ -0,0 +1,74 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_statistics__normal_dist_inv_cdf__doc__,
+"_normal_dist_inv_cdf($module, p, mu, sigma, /)\n"
+"--\n"
+"\n");
+
+#define _STATISTICS__NORMAL_DIST_INV_CDF_METHODDEF \
+ {"_normal_dist_inv_cdf", _PyCFunction_CAST(_statistics__normal_dist_inv_cdf), METH_FASTCALL, _statistics__normal_dist_inv_cdf__doc__},
+
+static double
+_statistics__normal_dist_inv_cdf_impl(PyObject *module, double p, double mu,
+ double sigma);
+
+static PyObject *
+_statistics__normal_dist_inv_cdf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ double p;
+ double mu;
+ double sigma;
+ double _return_value;
+
+ if (!_PyArg_CheckPositional("_normal_dist_inv_cdf", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ p = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ p = PyFloat_AsDouble(args[0]);
+ if (p == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ mu = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ mu = PyFloat_AsDouble(args[1]);
+ if (mu == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[2])) {
+ sigma = PyFloat_AS_DOUBLE(args[2]);
+ }
+ else
+ {
+ sigma = PyFloat_AsDouble(args[2]);
+ if (sigma == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ _return_value = _statistics__normal_dist_inv_cdf_impl(module, p, mu, sigma);
+ if ((_return_value == -1.0) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyFloat_FromDouble(_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=6899dc752cc6b457 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_struct.c.h b/contrib/tools/python3/Modules/clinic/_struct.c.h
new file mode 100644
index 00000000000..b21d9ff2924
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_struct.c.h
@@ -0,0 +1,454 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(Struct___init____doc__,
+"Struct(format)\n"
+"--\n"
+"\n"
+"Create a compiled struct object.\n"
+"\n"
+"Return a new Struct object which writes and reads binary data according to\n"
+"the format string.\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+static int
+Struct___init___impl(PyStructObject *self, PyObject *format);
+
+static int
+Struct___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(format), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"format", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Struct",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ PyObject *format;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ format = fastargs[0];
+ return_value = Struct___init___impl((PyStructObject *)self, format);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(Struct_unpack__doc__,
+"unpack($self, buffer, /)\n"
+"--\n"
+"\n"
+"Return a tuple containing unpacked values.\n"
+"\n"
+"Unpack according to the format string Struct.format. The buffer\'s size\n"
+"in bytes must be Struct.size.\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define STRUCT_UNPACK_METHODDEF \
+ {"unpack", (PyCFunction)Struct_unpack, METH_O, Struct_unpack__doc__},
+
+static PyObject *
+Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer);
+
+static PyObject *
+Struct_unpack(PyStructObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("unpack", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = Struct_unpack_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(Struct_unpack_from__doc__,
+"unpack_from($self, /, buffer, offset=0)\n"
+"--\n"
+"\n"
+"Return a tuple containing unpacked values.\n"
+"\n"
+"Values are unpacked according to the format string Struct.format.\n"
+"\n"
+"The buffer\'s size in bytes, starting at position offset, must be\n"
+"at least Struct.size.\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define STRUCT_UNPACK_FROM_METHODDEF \
+ {"unpack_from", _PyCFunction_CAST(Struct_unpack_from), METH_FASTCALL|METH_KEYWORDS, Struct_unpack_from__doc__},
+
+static PyObject *
+Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer,
+ Py_ssize_t offset);
+
+static PyObject *
+Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(buffer), &_Py_ID(offset), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"buffer", "offset", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "unpack_from",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer buffer = {NULL, NULL};
+ Py_ssize_t offset = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ offset = ival;
+ }
+skip_optional_pos:
+ return_value = Struct_unpack_from_impl(self, &buffer, offset);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(Struct_iter_unpack__doc__,
+"iter_unpack($self, buffer, /)\n"
+"--\n"
+"\n"
+"Return an iterator yielding tuples.\n"
+"\n"
+"Tuples are unpacked from the given bytes source, like a repeated\n"
+"invocation of unpack_from().\n"
+"\n"
+"Requires that the bytes length be a multiple of the struct size.");
+
+#define STRUCT_ITER_UNPACK_METHODDEF \
+ {"iter_unpack", (PyCFunction)Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__},
+
+PyDoc_STRVAR(_clearcache__doc__,
+"_clearcache($module, /)\n"
+"--\n"
+"\n"
+"Clear the internal cache.");
+
+#define _CLEARCACHE_METHODDEF \
+ {"_clearcache", (PyCFunction)_clearcache, METH_NOARGS, _clearcache__doc__},
+
+static PyObject *
+_clearcache_impl(PyObject *module);
+
+static PyObject *
+_clearcache(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _clearcache_impl(module);
+}
+
+PyDoc_STRVAR(calcsize__doc__,
+"calcsize($module, format, /)\n"
+"--\n"
+"\n"
+"Return size in bytes of the struct described by the format string.");
+
+#define CALCSIZE_METHODDEF \
+ {"calcsize", (PyCFunction)calcsize, METH_O, calcsize__doc__},
+
+static Py_ssize_t
+calcsize_impl(PyObject *module, PyStructObject *s_object);
+
+static PyObject *
+calcsize(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyStructObject *s_object = NULL;
+ Py_ssize_t _return_value;
+
+ if (!cache_struct_converter(module, arg, &s_object)) {
+ goto exit;
+ }
+ _return_value = calcsize_impl(module, s_object);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(unpack__doc__,
+"unpack($module, format, buffer, /)\n"
+"--\n"
+"\n"
+"Return a tuple containing values unpacked according to the format string.\n"
+"\n"
+"The buffer\'s size in bytes must be calcsize(format).\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define UNPACK_METHODDEF \
+ {"unpack", _PyCFunction_CAST(unpack), METH_FASTCALL, unpack__doc__},
+
+static PyObject *
+unpack_impl(PyObject *module, PyStructObject *s_object, Py_buffer *buffer);
+
+static PyObject *
+unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyStructObject *s_object = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("unpack", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!cache_struct_converter(module, args[0], &s_object)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("unpack", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = unpack_impl(module, s_object, &buffer);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(unpack_from__doc__,
+"unpack_from($module, format, /, buffer, offset=0)\n"
+"--\n"
+"\n"
+"Return a tuple containing values unpacked according to the format string.\n"
+"\n"
+"The buffer\'s size, minus offset, must be at least calcsize(format).\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define UNPACK_FROM_METHODDEF \
+ {"unpack_from", _PyCFunction_CAST(unpack_from), METH_FASTCALL|METH_KEYWORDS, unpack_from__doc__},
+
+static PyObject *
+unpack_from_impl(PyObject *module, PyStructObject *s_object,
+ Py_buffer *buffer, Py_ssize_t offset);
+
+static PyObject *
+unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(buffer), &_Py_ID(offset), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "buffer", "offset", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "unpack_from",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ PyStructObject *s_object = NULL;
+ Py_buffer buffer = {NULL, NULL};
+ Py_ssize_t offset = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!cache_struct_converter(module, args[0], &s_object)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ offset = ival;
+ }
+skip_optional_pos:
+ return_value = unpack_from_impl(module, s_object, &buffer, offset);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(iter_unpack__doc__,
+"iter_unpack($module, format, buffer, /)\n"
+"--\n"
+"\n"
+"Return an iterator yielding tuples unpacked from the given bytes.\n"
+"\n"
+"The bytes are unpacked according to the format string, like\n"
+"a repeated invocation of unpack_from().\n"
+"\n"
+"Requires that the bytes length be a multiple of the format struct size.");
+
+#define ITER_UNPACK_METHODDEF \
+ {"iter_unpack", _PyCFunction_CAST(iter_unpack), METH_FASTCALL, iter_unpack__doc__},
+
+static PyObject *
+iter_unpack_impl(PyObject *module, PyStructObject *s_object,
+ PyObject *buffer);
+
+static PyObject *
+iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyStructObject *s_object = NULL;
+ PyObject *buffer;
+
+ if (!_PyArg_CheckPositional("iter_unpack", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!cache_struct_converter(module, args[0], &s_object)) {
+ goto exit;
+ }
+ buffer = args[1];
+ return_value = iter_unpack_impl(module, s_object, buffer);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+
+ return return_value;
+}
+/*[clinic end generated code: output=eca7df0e75f8919d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_tracemalloc.c.h b/contrib/tools/python3/Modules/clinic/_tracemalloc.c.h
new file mode 100644
index 00000000000..a89cd9aabca
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_tracemalloc.c.h
@@ -0,0 +1,221 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_tracemalloc_is_tracing__doc__,
+"is_tracing($module, /)\n"
+"--\n"
+"\n"
+"Return True if the tracemalloc module is tracing Python memory allocations.");
+
+#define _TRACEMALLOC_IS_TRACING_METHODDEF \
+ {"is_tracing", (PyCFunction)_tracemalloc_is_tracing, METH_NOARGS, _tracemalloc_is_tracing__doc__},
+
+static PyObject *
+_tracemalloc_is_tracing_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_is_tracing(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_is_tracing_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_clear_traces__doc__,
+"clear_traces($module, /)\n"
+"--\n"
+"\n"
+"Clear traces of memory blocks allocated by Python.");
+
+#define _TRACEMALLOC_CLEAR_TRACES_METHODDEF \
+ {"clear_traces", (PyCFunction)_tracemalloc_clear_traces, METH_NOARGS, _tracemalloc_clear_traces__doc__},
+
+static PyObject *
+_tracemalloc_clear_traces_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_clear_traces(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_clear_traces_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc__get_traces__doc__,
+"_get_traces($module, /)\n"
+"--\n"
+"\n"
+"Get traces of all memory blocks allocated by Python.\n"
+"\n"
+"Return a list of (size: int, traceback: tuple) tuples.\n"
+"traceback is a tuple of (filename: str, lineno: int) tuples.\n"
+"\n"
+"Return an empty list if the tracemalloc module is disabled.");
+
+#define _TRACEMALLOC__GET_TRACES_METHODDEF \
+ {"_get_traces", (PyCFunction)_tracemalloc__get_traces, METH_NOARGS, _tracemalloc__get_traces__doc__},
+
+static PyObject *
+_tracemalloc__get_traces_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc__get_traces(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc__get_traces_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc__get_object_traceback__doc__,
+"_get_object_traceback($module, obj, /)\n"
+"--\n"
+"\n"
+"Get the traceback where the Python object obj was allocated.\n"
+"\n"
+"Return a tuple of (filename: str, lineno: int) tuples.\n"
+"Return None if the tracemalloc module is disabled or did not\n"
+"trace the allocation of the object.");
+
+#define _TRACEMALLOC__GET_OBJECT_TRACEBACK_METHODDEF \
+ {"_get_object_traceback", (PyCFunction)_tracemalloc__get_object_traceback, METH_O, _tracemalloc__get_object_traceback__doc__},
+
+PyDoc_STRVAR(_tracemalloc_start__doc__,
+"start($module, nframe=1, /)\n"
+"--\n"
+"\n"
+"Start tracing Python memory allocations.\n"
+"\n"
+"Also set the maximum number of frames stored in the traceback of a\n"
+"trace to nframe.");
+
+#define _TRACEMALLOC_START_METHODDEF \
+ {"start", _PyCFunction_CAST(_tracemalloc_start), METH_FASTCALL, _tracemalloc_start__doc__},
+
+static PyObject *
+_tracemalloc_start_impl(PyObject *module, int nframe);
+
+static PyObject *
+_tracemalloc_start(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int nframe = 1;
+
+ if (!_PyArg_CheckPositional("start", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ nframe = _PyLong_AsInt(args[0]);
+ if (nframe == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _tracemalloc_start_impl(module, nframe);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_tracemalloc_stop__doc__,
+"stop($module, /)\n"
+"--\n"
+"\n"
+"Stop tracing Python memory allocations.\n"
+"\n"
+"Also clear traces of memory blocks allocated by Python.");
+
+#define _TRACEMALLOC_STOP_METHODDEF \
+ {"stop", (PyCFunction)_tracemalloc_stop, METH_NOARGS, _tracemalloc_stop__doc__},
+
+static PyObject *
+_tracemalloc_stop_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_stop(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_stop_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_get_traceback_limit__doc__,
+"get_traceback_limit($module, /)\n"
+"--\n"
+"\n"
+"Get the maximum number of frames stored in the traceback of a trace.\n"
+"\n"
+"By default, a trace of an allocated memory block only stores\n"
+"the most recent frame: the limit is 1.");
+
+#define _TRACEMALLOC_GET_TRACEBACK_LIMIT_METHODDEF \
+ {"get_traceback_limit", (PyCFunction)_tracemalloc_get_traceback_limit, METH_NOARGS, _tracemalloc_get_traceback_limit__doc__},
+
+static PyObject *
+_tracemalloc_get_traceback_limit_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_get_traceback_limit(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_get_traceback_limit_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_get_tracemalloc_memory__doc__,
+"get_tracemalloc_memory($module, /)\n"
+"--\n"
+"\n"
+"Get the memory usage in bytes of the tracemalloc module.\n"
+"\n"
+"This memory is used internally to trace memory allocations.");
+
+#define _TRACEMALLOC_GET_TRACEMALLOC_MEMORY_METHODDEF \
+ {"get_tracemalloc_memory", (PyCFunction)_tracemalloc_get_tracemalloc_memory, METH_NOARGS, _tracemalloc_get_tracemalloc_memory__doc__},
+
+static PyObject *
+_tracemalloc_get_tracemalloc_memory_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_get_tracemalloc_memory(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_get_tracemalloc_memory_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_get_traced_memory__doc__,
+"get_traced_memory($module, /)\n"
+"--\n"
+"\n"
+"Get the current size and peak size of memory blocks traced by tracemalloc.\n"
+"\n"
+"Returns a tuple: (current: int, peak: int).");
+
+#define _TRACEMALLOC_GET_TRACED_MEMORY_METHODDEF \
+ {"get_traced_memory", (PyCFunction)_tracemalloc_get_traced_memory, METH_NOARGS, _tracemalloc_get_traced_memory__doc__},
+
+static PyObject *
+_tracemalloc_get_traced_memory_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_get_traced_memory(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_get_traced_memory_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_reset_peak__doc__,
+"reset_peak($module, /)\n"
+"--\n"
+"\n"
+"Set the peak size of memory blocks traced by tracemalloc to the current size.\n"
+"\n"
+"Do nothing if the tracemalloc module is not tracing memory allocations.");
+
+#define _TRACEMALLOC_RESET_PEAK_METHODDEF \
+ {"reset_peak", (PyCFunction)_tracemalloc_reset_peak, METH_NOARGS, _tracemalloc_reset_peak__doc__},
+
+static PyObject *
+_tracemalloc_reset_peak_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_reset_peak(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_reset_peak_impl(module);
+}
+/*[clinic end generated code: output=44e3f8553aae2535 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_typingmodule.c.h b/contrib/tools/python3/Modules/clinic/_typingmodule.c.h
new file mode 100644
index 00000000000..f980aa0d084
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_typingmodule.c.h
@@ -0,0 +1,18 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_typing__idfunc__doc__,
+"_idfunc($module, x, /)\n"
+"--\n"
+"\n");
+
+#define _TYPING__IDFUNC_METHODDEF \
+ {"_idfunc", (PyCFunction)_typing__idfunc, METH_O, _typing__idfunc__doc__},
+/*[clinic end generated code: output=97457fda45072c7d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_weakref.c.h b/contrib/tools/python3/Modules/clinic/_weakref.c.h
new file mode 100644
index 00000000000..48feb042cac
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_weakref.c.h
@@ -0,0 +1,119 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_weakref_getweakrefcount__doc__,
+"getweakrefcount($module, object, /)\n"
+"--\n"
+"\n"
+"Return the number of weak references to \'object\'.");
+
+#define _WEAKREF_GETWEAKREFCOUNT_METHODDEF \
+ {"getweakrefcount", (PyCFunction)_weakref_getweakrefcount, METH_O, _weakref_getweakrefcount__doc__},
+
+static Py_ssize_t
+_weakref_getweakrefcount_impl(PyObject *module, PyObject *object);
+
+static PyObject *
+_weakref_getweakrefcount(PyObject *module, PyObject *object)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t _return_value;
+
+ _return_value = _weakref_getweakrefcount_impl(module, object);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_weakref__remove_dead_weakref__doc__,
+"_remove_dead_weakref($module, dct, key, /)\n"
+"--\n"
+"\n"
+"Atomically remove key from dict if it points to a dead weakref.");
+
+#define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \
+ {"_remove_dead_weakref", _PyCFunction_CAST(_weakref__remove_dead_weakref), METH_FASTCALL, _weakref__remove_dead_weakref__doc__},
+
+static PyObject *
+_weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct,
+ PyObject *key);
+
+static PyObject *
+_weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *dct;
+ PyObject *key;
+
+ if (!_PyArg_CheckPositional("_remove_dead_weakref", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyDict_Check(args[0])) {
+ _PyArg_BadArgument("_remove_dead_weakref", "argument 1", "dict", args[0]);
+ goto exit;
+ }
+ dct = args[0];
+ key = args[1];
+ return_value = _weakref__remove_dead_weakref_impl(module, dct, key);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_weakref_getweakrefs__doc__,
+"getweakrefs($module, object, /)\n"
+"--\n"
+"\n"
+"Return a list of all weak reference objects pointing to \'object\'.");
+
+#define _WEAKREF_GETWEAKREFS_METHODDEF \
+ {"getweakrefs", (PyCFunction)_weakref_getweakrefs, METH_O, _weakref_getweakrefs__doc__},
+
+PyDoc_STRVAR(_weakref_proxy__doc__,
+"proxy($module, object, callback=None, /)\n"
+"--\n"
+"\n"
+"Create a proxy object that weakly references \'object\'.\n"
+"\n"
+"\'callback\', if given, is called with a reference to the\n"
+"proxy when \'object\' is about to be finalized.");
+
+#define _WEAKREF_PROXY_METHODDEF \
+ {"proxy", _PyCFunction_CAST(_weakref_proxy), METH_FASTCALL, _weakref_proxy__doc__},
+
+static PyObject *
+_weakref_proxy_impl(PyObject *module, PyObject *object, PyObject *callback);
+
+static PyObject *
+_weakref_proxy(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *object;
+ PyObject *callback = NULL;
+
+ if (!_PyArg_CheckPositional("proxy", nargs, 1, 2)) {
+ goto exit;
+ }
+ object = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ callback = args[1];
+skip_optional:
+ return_value = _weakref_proxy_impl(module, object, callback);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=28265e89d583273d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_winapi.c.h b/contrib/tools/python3/Modules/clinic/_winapi.c.h
new file mode 100644
index 00000000000..5b87b24246f
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_winapi.c.h
@@ -0,0 +1,1485 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__,
+"GetOverlappedResult($self, wait, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_OVERLAPPED_GETOVERLAPPEDRESULT_METHODDEF \
+ {"GetOverlappedResult", (PyCFunction)_winapi_Overlapped_GetOverlappedResult, METH_O, _winapi_Overlapped_GetOverlappedResult__doc__},
+
+static PyObject *
+_winapi_Overlapped_GetOverlappedResult_impl(OverlappedObject *self, int wait);
+
+static PyObject *
+_winapi_Overlapped_GetOverlappedResult(OverlappedObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int wait;
+
+ wait = PyObject_IsTrue(arg);
+ if (wait < 0) {
+ goto exit;
+ }
+ return_value = _winapi_Overlapped_GetOverlappedResult_impl(self, wait);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_Overlapped_getbuffer__doc__,
+"getbuffer($self, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_OVERLAPPED_GETBUFFER_METHODDEF \
+ {"getbuffer", (PyCFunction)_winapi_Overlapped_getbuffer, METH_NOARGS, _winapi_Overlapped_getbuffer__doc__},
+
+static PyObject *
+_winapi_Overlapped_getbuffer_impl(OverlappedObject *self);
+
+static PyObject *
+_winapi_Overlapped_getbuffer(OverlappedObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _winapi_Overlapped_getbuffer_impl(self);
+}
+
+PyDoc_STRVAR(_winapi_Overlapped_cancel__doc__,
+"cancel($self, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_OVERLAPPED_CANCEL_METHODDEF \
+ {"cancel", (PyCFunction)_winapi_Overlapped_cancel, METH_NOARGS, _winapi_Overlapped_cancel__doc__},
+
+static PyObject *
+_winapi_Overlapped_cancel_impl(OverlappedObject *self);
+
+static PyObject *
+_winapi_Overlapped_cancel(OverlappedObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _winapi_Overlapped_cancel_impl(self);
+}
+
+PyDoc_STRVAR(_winapi_CloseHandle__doc__,
+"CloseHandle($module, handle, /)\n"
+"--\n"
+"\n"
+"Close handle.");
+
+#define _WINAPI_CLOSEHANDLE_METHODDEF \
+ {"CloseHandle", (PyCFunction)_winapi_CloseHandle, METH_O, _winapi_CloseHandle__doc__},
+
+static PyObject *
+_winapi_CloseHandle_impl(PyObject *module, HANDLE handle);
+
+static PyObject *
+_winapi_CloseHandle(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+
+ if (!PyArg_Parse(arg, "" F_HANDLE ":CloseHandle", &handle)) {
+ goto exit;
+ }
+ return_value = _winapi_CloseHandle_impl(module, handle);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_ConnectNamedPipe__doc__,
+"ConnectNamedPipe($module, /, handle, overlapped=False)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_CONNECTNAMEDPIPE_METHODDEF \
+ {"ConnectNamedPipe", _PyCFunction_CAST(_winapi_ConnectNamedPipe), METH_FASTCALL|METH_KEYWORDS, _winapi_ConnectNamedPipe__doc__},
+
+static PyObject *
+_winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
+ int use_overlapped);
+
+static PyObject *
+_winapi_ConnectNamedPipe(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(handle), &_Py_ID(overlapped), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"handle", "overlapped", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" F_HANDLE "|p:ConnectNamedPipe",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ HANDLE handle;
+ int use_overlapped = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &handle, &use_overlapped)) {
+ goto exit;
+ }
+ return_value = _winapi_ConnectNamedPipe_impl(module, handle, use_overlapped);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CreateFile__doc__,
+"CreateFile($module, file_name, desired_access, share_mode,\n"
+" security_attributes, creation_disposition,\n"
+" flags_and_attributes, template_file, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_CREATEFILE_METHODDEF \
+ {"CreateFile", _PyCFunction_CAST(_winapi_CreateFile), METH_FASTCALL, _winapi_CreateFile__doc__},
+
+static HANDLE
+_winapi_CreateFile_impl(PyObject *module, LPCWSTR file_name,
+ DWORD desired_access, DWORD share_mode,
+ LPSECURITY_ATTRIBUTES security_attributes,
+ DWORD creation_disposition,
+ DWORD flags_and_attributes, HANDLE template_file);
+
+static PyObject *
+_winapi_CreateFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ LPCWSTR file_name = NULL;
+ DWORD desired_access;
+ DWORD share_mode;
+ LPSECURITY_ATTRIBUTES security_attributes;
+ DWORD creation_disposition;
+ DWORD flags_and_attributes;
+ HANDLE template_file;
+ HANDLE _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "O&kk" F_POINTER "kk" F_HANDLE ":CreateFile",
+ _PyUnicode_WideCharString_Converter, &file_name, &desired_access, &share_mode, &security_attributes, &creation_disposition, &flags_and_attributes, &template_file)) {
+ goto exit;
+ }
+ _return_value = _winapi_CreateFile_impl(module, file_name, desired_access, share_mode, security_attributes, creation_disposition, flags_and_attributes, template_file);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ /* Cleanup for file_name */
+ PyMem_Free((void *)file_name);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CreateFileMapping__doc__,
+"CreateFileMapping($module, file_handle, security_attributes, protect,\n"
+" max_size_high, max_size_low, name, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_CREATEFILEMAPPING_METHODDEF \
+ {"CreateFileMapping", _PyCFunction_CAST(_winapi_CreateFileMapping), METH_FASTCALL, _winapi_CreateFileMapping__doc__},
+
+static HANDLE
+_winapi_CreateFileMapping_impl(PyObject *module, HANDLE file_handle,
+ LPSECURITY_ATTRIBUTES security_attributes,
+ DWORD protect, DWORD max_size_high,
+ DWORD max_size_low, LPCWSTR name);
+
+static PyObject *
+_winapi_CreateFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE file_handle;
+ LPSECURITY_ATTRIBUTES security_attributes;
+ DWORD protect;
+ DWORD max_size_high;
+ DWORD max_size_low;
+ LPCWSTR name = NULL;
+ HANDLE _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "" F_POINTER "kkkO&:CreateFileMapping",
+ &file_handle, &security_attributes, &protect, &max_size_high, &max_size_low, _PyUnicode_WideCharString_Converter, &name)) {
+ goto exit;
+ }
+ _return_value = _winapi_CreateFileMapping_impl(module, file_handle, security_attributes, protect, max_size_high, max_size_low, name);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ /* Cleanup for name */
+ PyMem_Free((void *)name);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CreateJunction__doc__,
+"CreateJunction($module, src_path, dst_path, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_CREATEJUNCTION_METHODDEF \
+ {"CreateJunction", _PyCFunction_CAST(_winapi_CreateJunction), METH_FASTCALL, _winapi_CreateJunction__doc__},
+
+static PyObject *
+_winapi_CreateJunction_impl(PyObject *module, LPCWSTR src_path,
+ LPCWSTR dst_path);
+
+static PyObject *
+_winapi_CreateJunction(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ LPCWSTR src_path = NULL;
+ LPCWSTR dst_path = NULL;
+
+ if (!_PyArg_CheckPositional("CreateJunction", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("CreateJunction", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ src_path = PyUnicode_AsWideCharString(args[0], NULL);
+ if (src_path == NULL) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("CreateJunction", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ dst_path = PyUnicode_AsWideCharString(args[1], NULL);
+ if (dst_path == NULL) {
+ goto exit;
+ }
+ return_value = _winapi_CreateJunction_impl(module, src_path, dst_path);
+
+exit:
+ /* Cleanup for src_path */
+ PyMem_Free((void *)src_path);
+ /* Cleanup for dst_path */
+ PyMem_Free((void *)dst_path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CreateNamedPipe__doc__,
+"CreateNamedPipe($module, name, open_mode, pipe_mode, max_instances,\n"
+" out_buffer_size, in_buffer_size, default_timeout,\n"
+" security_attributes, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_CREATENAMEDPIPE_METHODDEF \
+ {"CreateNamedPipe", _PyCFunction_CAST(_winapi_CreateNamedPipe), METH_FASTCALL, _winapi_CreateNamedPipe__doc__},
+
+static HANDLE
+_winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode,
+ DWORD pipe_mode, DWORD max_instances,
+ DWORD out_buffer_size, DWORD in_buffer_size,
+ DWORD default_timeout,
+ LPSECURITY_ATTRIBUTES security_attributes);
+
+static PyObject *
+_winapi_CreateNamedPipe(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ LPCTSTR name;
+ DWORD open_mode;
+ DWORD pipe_mode;
+ DWORD max_instances;
+ DWORD out_buffer_size;
+ DWORD in_buffer_size;
+ DWORD default_timeout;
+ LPSECURITY_ATTRIBUTES security_attributes;
+ HANDLE _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "skkkkkk" F_POINTER ":CreateNamedPipe",
+ &name, &open_mode, &pipe_mode, &max_instances, &out_buffer_size, &in_buffer_size, &default_timeout, &security_attributes)) {
+ goto exit;
+ }
+ _return_value = _winapi_CreateNamedPipe_impl(module, name, open_mode, pipe_mode, max_instances, out_buffer_size, in_buffer_size, default_timeout, security_attributes);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CreatePipe__doc__,
+"CreatePipe($module, pipe_attrs, size, /)\n"
+"--\n"
+"\n"
+"Create an anonymous pipe.\n"
+"\n"
+" pipe_attrs\n"
+" Ignored internally, can be None.\n"
+"\n"
+"Returns a 2-tuple of handles, to the read and write ends of the pipe.");
+
+#define _WINAPI_CREATEPIPE_METHODDEF \
+ {"CreatePipe", _PyCFunction_CAST(_winapi_CreatePipe), METH_FASTCALL, _winapi_CreatePipe__doc__},
+
+static PyObject *
+_winapi_CreatePipe_impl(PyObject *module, PyObject *pipe_attrs, DWORD size);
+
+static PyObject *
+_winapi_CreatePipe(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *pipe_attrs;
+ DWORD size;
+
+ if (!_PyArg_ParseStack(args, nargs, "Ok:CreatePipe",
+ &pipe_attrs, &size)) {
+ goto exit;
+ }
+ return_value = _winapi_CreatePipe_impl(module, pipe_attrs, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CreateProcess__doc__,
+"CreateProcess($module, application_name, command_line, proc_attrs,\n"
+" thread_attrs, inherit_handles, creation_flags,\n"
+" env_mapping, current_directory, startup_info, /)\n"
+"--\n"
+"\n"
+"Create a new process and its primary thread.\n"
+"\n"
+" command_line\n"
+" Can be str or None\n"
+" proc_attrs\n"
+" Ignored internally, can be None.\n"
+" thread_attrs\n"
+" Ignored internally, can be None.\n"
+"\n"
+"The return value is a tuple of the process handle, thread handle,\n"
+"process ID, and thread ID.");
+
+#define _WINAPI_CREATEPROCESS_METHODDEF \
+ {"CreateProcess", _PyCFunction_CAST(_winapi_CreateProcess), METH_FASTCALL, _winapi_CreateProcess__doc__},
+
+static PyObject *
+_winapi_CreateProcess_impl(PyObject *module,
+ const Py_UNICODE *application_name,
+ PyObject *command_line, PyObject *proc_attrs,
+ PyObject *thread_attrs, BOOL inherit_handles,
+ DWORD creation_flags, PyObject *env_mapping,
+ const Py_UNICODE *current_directory,
+ PyObject *startup_info);
+
+static PyObject *
+_winapi_CreateProcess(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const Py_UNICODE *application_name = NULL;
+ PyObject *command_line;
+ PyObject *proc_attrs;
+ PyObject *thread_attrs;
+ BOOL inherit_handles;
+ DWORD creation_flags;
+ PyObject *env_mapping;
+ const Py_UNICODE *current_directory = NULL;
+ PyObject *startup_info;
+
+ if (!_PyArg_ParseStack(args, nargs, "O&OOOikOO&O:CreateProcess",
+ _PyUnicode_WideCharString_Opt_Converter, &application_name, &command_line, &proc_attrs, &thread_attrs, &inherit_handles, &creation_flags, &env_mapping, _PyUnicode_WideCharString_Opt_Converter, &current_directory, &startup_info)) {
+ goto exit;
+ }
+ return_value = _winapi_CreateProcess_impl(module, application_name, command_line, proc_attrs, thread_attrs, inherit_handles, creation_flags, env_mapping, current_directory, startup_info);
+
+exit:
+ /* Cleanup for application_name */
+ PyMem_Free((void *)application_name);
+ /* Cleanup for current_directory */
+ PyMem_Free((void *)current_directory);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_DuplicateHandle__doc__,
+"DuplicateHandle($module, source_process_handle, source_handle,\n"
+" target_process_handle, desired_access, inherit_handle,\n"
+" options=0, /)\n"
+"--\n"
+"\n"
+"Return a duplicate handle object.\n"
+"\n"
+"The duplicate handle refers to the same object as the original\n"
+"handle. Therefore, any changes to the object are reflected\n"
+"through both handles.");
+
+#define _WINAPI_DUPLICATEHANDLE_METHODDEF \
+ {"DuplicateHandle", _PyCFunction_CAST(_winapi_DuplicateHandle), METH_FASTCALL, _winapi_DuplicateHandle__doc__},
+
+static HANDLE
+_winapi_DuplicateHandle_impl(PyObject *module, HANDLE source_process_handle,
+ HANDLE source_handle,
+ HANDLE target_process_handle,
+ DWORD desired_access, BOOL inherit_handle,
+ DWORD options);
+
+static PyObject *
+_winapi_DuplicateHandle(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE source_process_handle;
+ HANDLE source_handle;
+ HANDLE target_process_handle;
+ DWORD desired_access;
+ BOOL inherit_handle;
+ DWORD options = 0;
+ HANDLE _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "" F_HANDLE "" F_HANDLE "ki|k:DuplicateHandle",
+ &source_process_handle, &source_handle, &target_process_handle, &desired_access, &inherit_handle, &options)) {
+ goto exit;
+ }
+ _return_value = _winapi_DuplicateHandle_impl(module, source_process_handle, source_handle, target_process_handle, desired_access, inherit_handle, options);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_ExitProcess__doc__,
+"ExitProcess($module, ExitCode, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_EXITPROCESS_METHODDEF \
+ {"ExitProcess", (PyCFunction)_winapi_ExitProcess, METH_O, _winapi_ExitProcess__doc__},
+
+static PyObject *
+_winapi_ExitProcess_impl(PyObject *module, UINT ExitCode);
+
+static PyObject *
+_winapi_ExitProcess(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ UINT ExitCode;
+
+ if (!PyArg_Parse(arg, "I:ExitProcess", &ExitCode)) {
+ goto exit;
+ }
+ return_value = _winapi_ExitProcess_impl(module, ExitCode);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetCurrentProcess__doc__,
+"GetCurrentProcess($module, /)\n"
+"--\n"
+"\n"
+"Return a handle object for the current process.");
+
+#define _WINAPI_GETCURRENTPROCESS_METHODDEF \
+ {"GetCurrentProcess", (PyCFunction)_winapi_GetCurrentProcess, METH_NOARGS, _winapi_GetCurrentProcess__doc__},
+
+static HANDLE
+_winapi_GetCurrentProcess_impl(PyObject *module);
+
+static PyObject *
+_winapi_GetCurrentProcess(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ HANDLE _return_value;
+
+ _return_value = _winapi_GetCurrentProcess_impl(module);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetExitCodeProcess__doc__,
+"GetExitCodeProcess($module, process, /)\n"
+"--\n"
+"\n"
+"Return the termination status of the specified process.");
+
+#define _WINAPI_GETEXITCODEPROCESS_METHODDEF \
+ {"GetExitCodeProcess", (PyCFunction)_winapi_GetExitCodeProcess, METH_O, _winapi_GetExitCodeProcess__doc__},
+
+static DWORD
+_winapi_GetExitCodeProcess_impl(PyObject *module, HANDLE process);
+
+static PyObject *
+_winapi_GetExitCodeProcess(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE process;
+ DWORD _return_value;
+
+ if (!PyArg_Parse(arg, "" F_HANDLE ":GetExitCodeProcess", &process)) {
+ goto exit;
+ }
+ _return_value = _winapi_GetExitCodeProcess_impl(module, process);
+ if ((_return_value == PY_DWORD_MAX) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = Py_BuildValue("k", _return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetLastError__doc__,
+"GetLastError($module, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_GETLASTERROR_METHODDEF \
+ {"GetLastError", (PyCFunction)_winapi_GetLastError, METH_NOARGS, _winapi_GetLastError__doc__},
+
+static DWORD
+_winapi_GetLastError_impl(PyObject *module);
+
+static PyObject *
+_winapi_GetLastError(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ DWORD _return_value;
+
+ _return_value = _winapi_GetLastError_impl(module);
+ if ((_return_value == PY_DWORD_MAX) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = Py_BuildValue("k", _return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetModuleFileName__doc__,
+"GetModuleFileName($module, module_handle, /)\n"
+"--\n"
+"\n"
+"Return the fully-qualified path for the file that contains module.\n"
+"\n"
+"The module must have been loaded by the current process.\n"
+"\n"
+"The module parameter should be a handle to the loaded module\n"
+"whose path is being requested. If this parameter is 0,\n"
+"GetModuleFileName retrieves the path of the executable file\n"
+"of the current process.");
+
+#define _WINAPI_GETMODULEFILENAME_METHODDEF \
+ {"GetModuleFileName", (PyCFunction)_winapi_GetModuleFileName, METH_O, _winapi_GetModuleFileName__doc__},
+
+static PyObject *
+_winapi_GetModuleFileName_impl(PyObject *module, HMODULE module_handle);
+
+static PyObject *
+_winapi_GetModuleFileName(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HMODULE module_handle;
+
+ if (!PyArg_Parse(arg, "" F_HANDLE ":GetModuleFileName", &module_handle)) {
+ goto exit;
+ }
+ return_value = _winapi_GetModuleFileName_impl(module, module_handle);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetStdHandle__doc__,
+"GetStdHandle($module, std_handle, /)\n"
+"--\n"
+"\n"
+"Return a handle to the specified standard device.\n"
+"\n"
+" std_handle\n"
+" One of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, or STD_ERROR_HANDLE.\n"
+"\n"
+"The integer associated with the handle object is returned.");
+
+#define _WINAPI_GETSTDHANDLE_METHODDEF \
+ {"GetStdHandle", (PyCFunction)_winapi_GetStdHandle, METH_O, _winapi_GetStdHandle__doc__},
+
+static HANDLE
+_winapi_GetStdHandle_impl(PyObject *module, DWORD std_handle);
+
+static PyObject *
+_winapi_GetStdHandle(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ DWORD std_handle;
+ HANDLE _return_value;
+
+ if (!PyArg_Parse(arg, "k:GetStdHandle", &std_handle)) {
+ goto exit;
+ }
+ _return_value = _winapi_GetStdHandle_impl(module, std_handle);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetVersion__doc__,
+"GetVersion($module, /)\n"
+"--\n"
+"\n"
+"Return the version number of the current operating system.");
+
+#define _WINAPI_GETVERSION_METHODDEF \
+ {"GetVersion", (PyCFunction)_winapi_GetVersion, METH_NOARGS, _winapi_GetVersion__doc__},
+
+static long
+_winapi_GetVersion_impl(PyObject *module);
+
+static PyObject *
+_winapi_GetVersion(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ long _return_value;
+
+ _return_value = _winapi_GetVersion_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_MapViewOfFile__doc__,
+"MapViewOfFile($module, file_map, desired_access, file_offset_high,\n"
+" file_offset_low, number_bytes, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_MAPVIEWOFFILE_METHODDEF \
+ {"MapViewOfFile", _PyCFunction_CAST(_winapi_MapViewOfFile), METH_FASTCALL, _winapi_MapViewOfFile__doc__},
+
+static LPVOID
+_winapi_MapViewOfFile_impl(PyObject *module, HANDLE file_map,
+ DWORD desired_access, DWORD file_offset_high,
+ DWORD file_offset_low, size_t number_bytes);
+
+static PyObject *
+_winapi_MapViewOfFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE file_map;
+ DWORD desired_access;
+ DWORD file_offset_high;
+ DWORD file_offset_low;
+ size_t number_bytes;
+ LPVOID _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "kkkO&:MapViewOfFile",
+ &file_map, &desired_access, &file_offset_high, &file_offset_low, _PyLong_Size_t_Converter, &number_bytes)) {
+ goto exit;
+ }
+ _return_value = _winapi_MapViewOfFile_impl(module, file_map, desired_access, file_offset_high, file_offset_low, number_bytes);
+ if ((_return_value == NULL) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_UnmapViewOfFile__doc__,
+"UnmapViewOfFile($module, address, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_UNMAPVIEWOFFILE_METHODDEF \
+ {"UnmapViewOfFile", (PyCFunction)_winapi_UnmapViewOfFile, METH_O, _winapi_UnmapViewOfFile__doc__},
+
+static PyObject *
+_winapi_UnmapViewOfFile_impl(PyObject *module, LPCVOID address);
+
+static PyObject *
+_winapi_UnmapViewOfFile(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ LPCVOID address;
+
+ if (!PyArg_Parse(arg, "" F_POINTER ":UnmapViewOfFile", &address)) {
+ goto exit;
+ }
+ return_value = _winapi_UnmapViewOfFile_impl(module, address);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_OpenFileMapping__doc__,
+"OpenFileMapping($module, desired_access, inherit_handle, name, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_OPENFILEMAPPING_METHODDEF \
+ {"OpenFileMapping", _PyCFunction_CAST(_winapi_OpenFileMapping), METH_FASTCALL, _winapi_OpenFileMapping__doc__},
+
+static HANDLE
+_winapi_OpenFileMapping_impl(PyObject *module, DWORD desired_access,
+ BOOL inherit_handle, LPCWSTR name);
+
+static PyObject *
+_winapi_OpenFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ DWORD desired_access;
+ BOOL inherit_handle;
+ LPCWSTR name = NULL;
+ HANDLE _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "kiO&:OpenFileMapping",
+ &desired_access, &inherit_handle, _PyUnicode_WideCharString_Converter, &name)) {
+ goto exit;
+ }
+ _return_value = _winapi_OpenFileMapping_impl(module, desired_access, inherit_handle, name);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ /* Cleanup for name */
+ PyMem_Free((void *)name);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_OpenProcess__doc__,
+"OpenProcess($module, desired_access, inherit_handle, process_id, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_OPENPROCESS_METHODDEF \
+ {"OpenProcess", _PyCFunction_CAST(_winapi_OpenProcess), METH_FASTCALL, _winapi_OpenProcess__doc__},
+
+static HANDLE
+_winapi_OpenProcess_impl(PyObject *module, DWORD desired_access,
+ BOOL inherit_handle, DWORD process_id);
+
+static PyObject *
+_winapi_OpenProcess(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ DWORD desired_access;
+ BOOL inherit_handle;
+ DWORD process_id;
+ HANDLE _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "kik:OpenProcess",
+ &desired_access, &inherit_handle, &process_id)) {
+ goto exit;
+ }
+ _return_value = _winapi_OpenProcess_impl(module, desired_access, inherit_handle, process_id);
+ if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (_return_value == NULL) {
+ Py_RETURN_NONE;
+ }
+ return_value = HANDLE_TO_PYNUM(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_PeekNamedPipe__doc__,
+"PeekNamedPipe($module, handle, size=0, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_PEEKNAMEDPIPE_METHODDEF \
+ {"PeekNamedPipe", _PyCFunction_CAST(_winapi_PeekNamedPipe), METH_FASTCALL, _winapi_PeekNamedPipe__doc__},
+
+static PyObject *
+_winapi_PeekNamedPipe_impl(PyObject *module, HANDLE handle, int size);
+
+static PyObject *
+_winapi_PeekNamedPipe(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ int size = 0;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "|i:PeekNamedPipe",
+ &handle, &size)) {
+ goto exit;
+ }
+ return_value = _winapi_PeekNamedPipe_impl(module, handle, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_LCMapStringEx__doc__,
+"LCMapStringEx($module, /, locale, flags, src)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_LCMAPSTRINGEX_METHODDEF \
+ {"LCMapStringEx", _PyCFunction_CAST(_winapi_LCMapStringEx), METH_FASTCALL|METH_KEYWORDS, _winapi_LCMapStringEx__doc__},
+
+static PyObject *
+_winapi_LCMapStringEx_impl(PyObject *module, LPCWSTR locale, DWORD flags,
+ PyObject *src);
+
+static PyObject *
+_winapi_LCMapStringEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(locale), &_Py_ID(flags), &_Py_ID(src), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"locale", "flags", "src", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "O&kU:LCMapStringEx",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ LPCWSTR locale = NULL;
+ DWORD flags;
+ PyObject *src;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ _PyUnicode_WideCharString_Converter, &locale, &flags, &src)) {
+ goto exit;
+ }
+ return_value = _winapi_LCMapStringEx_impl(module, locale, flags, src);
+
+exit:
+ /* Cleanup for locale */
+ PyMem_Free((void *)locale);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_ReadFile__doc__,
+"ReadFile($module, /, handle, size, overlapped=False)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_READFILE_METHODDEF \
+ {"ReadFile", _PyCFunction_CAST(_winapi_ReadFile), METH_FASTCALL|METH_KEYWORDS, _winapi_ReadFile__doc__},
+
+static PyObject *
+_winapi_ReadFile_impl(PyObject *module, HANDLE handle, DWORD size,
+ int use_overlapped);
+
+static PyObject *
+_winapi_ReadFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(handle), &_Py_ID(size), &_Py_ID(overlapped), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"handle", "size", "overlapped", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" F_HANDLE "k|p:ReadFile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ HANDLE handle;
+ DWORD size;
+ int use_overlapped = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &handle, &size, &use_overlapped)) {
+ goto exit;
+ }
+ return_value = _winapi_ReadFile_impl(module, handle, size, use_overlapped);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_SetNamedPipeHandleState__doc__,
+"SetNamedPipeHandleState($module, named_pipe, mode,\n"
+" max_collection_count, collect_data_timeout, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_SETNAMEDPIPEHANDLESTATE_METHODDEF \
+ {"SetNamedPipeHandleState", _PyCFunction_CAST(_winapi_SetNamedPipeHandleState), METH_FASTCALL, _winapi_SetNamedPipeHandleState__doc__},
+
+static PyObject *
+_winapi_SetNamedPipeHandleState_impl(PyObject *module, HANDLE named_pipe,
+ PyObject *mode,
+ PyObject *max_collection_count,
+ PyObject *collect_data_timeout);
+
+static PyObject *
+_winapi_SetNamedPipeHandleState(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE named_pipe;
+ PyObject *mode;
+ PyObject *max_collection_count;
+ PyObject *collect_data_timeout;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "OOO:SetNamedPipeHandleState",
+ &named_pipe, &mode, &max_collection_count, &collect_data_timeout)) {
+ goto exit;
+ }
+ return_value = _winapi_SetNamedPipeHandleState_impl(module, named_pipe, mode, max_collection_count, collect_data_timeout);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_TerminateProcess__doc__,
+"TerminateProcess($module, handle, exit_code, /)\n"
+"--\n"
+"\n"
+"Terminate the specified process and all of its threads.");
+
+#define _WINAPI_TERMINATEPROCESS_METHODDEF \
+ {"TerminateProcess", _PyCFunction_CAST(_winapi_TerminateProcess), METH_FASTCALL, _winapi_TerminateProcess__doc__},
+
+static PyObject *
+_winapi_TerminateProcess_impl(PyObject *module, HANDLE handle,
+ UINT exit_code);
+
+static PyObject *
+_winapi_TerminateProcess(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ UINT exit_code;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "I:TerminateProcess",
+ &handle, &exit_code)) {
+ goto exit;
+ }
+ return_value = _winapi_TerminateProcess_impl(module, handle, exit_code);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_VirtualQuerySize__doc__,
+"VirtualQuerySize($module, address, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_VIRTUALQUERYSIZE_METHODDEF \
+ {"VirtualQuerySize", (PyCFunction)_winapi_VirtualQuerySize, METH_O, _winapi_VirtualQuerySize__doc__},
+
+static size_t
+_winapi_VirtualQuerySize_impl(PyObject *module, LPCVOID address);
+
+static PyObject *
+_winapi_VirtualQuerySize(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ LPCVOID address;
+ size_t _return_value;
+
+ if (!PyArg_Parse(arg, "" F_POINTER ":VirtualQuerySize", &address)) {
+ goto exit;
+ }
+ _return_value = _winapi_VirtualQuerySize_impl(module, address);
+ if ((_return_value == (size_t)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_WaitNamedPipe__doc__,
+"WaitNamedPipe($module, name, timeout, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_WAITNAMEDPIPE_METHODDEF \
+ {"WaitNamedPipe", _PyCFunction_CAST(_winapi_WaitNamedPipe), METH_FASTCALL, _winapi_WaitNamedPipe__doc__},
+
+static PyObject *
+_winapi_WaitNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD timeout);
+
+static PyObject *
+_winapi_WaitNamedPipe(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ LPCTSTR name;
+ DWORD timeout;
+
+ if (!_PyArg_ParseStack(args, nargs, "sk:WaitNamedPipe",
+ &name, &timeout)) {
+ goto exit;
+ }
+ return_value = _winapi_WaitNamedPipe_impl(module, name, timeout);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_WaitForMultipleObjects__doc__,
+"WaitForMultipleObjects($module, handle_seq, wait_flag,\n"
+" milliseconds=_winapi.INFINITE, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_WAITFORMULTIPLEOBJECTS_METHODDEF \
+ {"WaitForMultipleObjects", _PyCFunction_CAST(_winapi_WaitForMultipleObjects), METH_FASTCALL, _winapi_WaitForMultipleObjects__doc__},
+
+static PyObject *
+_winapi_WaitForMultipleObjects_impl(PyObject *module, PyObject *handle_seq,
+ BOOL wait_flag, DWORD milliseconds);
+
+static PyObject *
+_winapi_WaitForMultipleObjects(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *handle_seq;
+ BOOL wait_flag;
+ DWORD milliseconds = INFINITE;
+
+ if (!_PyArg_ParseStack(args, nargs, "Oi|k:WaitForMultipleObjects",
+ &handle_seq, &wait_flag, &milliseconds)) {
+ goto exit;
+ }
+ return_value = _winapi_WaitForMultipleObjects_impl(module, handle_seq, wait_flag, milliseconds);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_WaitForSingleObject__doc__,
+"WaitForSingleObject($module, handle, milliseconds, /)\n"
+"--\n"
+"\n"
+"Wait for a single object.\n"
+"\n"
+"Wait until the specified object is in the signaled state or\n"
+"the time-out interval elapses. The timeout value is specified\n"
+"in milliseconds.");
+
+#define _WINAPI_WAITFORSINGLEOBJECT_METHODDEF \
+ {"WaitForSingleObject", _PyCFunction_CAST(_winapi_WaitForSingleObject), METH_FASTCALL, _winapi_WaitForSingleObject__doc__},
+
+static long
+_winapi_WaitForSingleObject_impl(PyObject *module, HANDLE handle,
+ DWORD milliseconds);
+
+static PyObject *
+_winapi_WaitForSingleObject(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ DWORD milliseconds;
+ long _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "k:WaitForSingleObject",
+ &handle, &milliseconds)) {
+ goto exit;
+ }
+ _return_value = _winapi_WaitForSingleObject_impl(module, handle, milliseconds);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_WriteFile__doc__,
+"WriteFile($module, /, handle, buffer, overlapped=False)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_WRITEFILE_METHODDEF \
+ {"WriteFile", _PyCFunction_CAST(_winapi_WriteFile), METH_FASTCALL|METH_KEYWORDS, _winapi_WriteFile__doc__},
+
+static PyObject *
+_winapi_WriteFile_impl(PyObject *module, HANDLE handle, PyObject *buffer,
+ int use_overlapped);
+
+static PyObject *
+_winapi_WriteFile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(handle), &_Py_ID(buffer), &_Py_ID(overlapped), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"handle", "buffer", "overlapped", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" F_HANDLE "O|p:WriteFile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ HANDLE handle;
+ PyObject *buffer;
+ int use_overlapped = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &handle, &buffer, &use_overlapped)) {
+ goto exit;
+ }
+ return_value = _winapi_WriteFile_impl(module, handle, buffer, use_overlapped);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_GetACP__doc__,
+"GetACP($module, /)\n"
+"--\n"
+"\n"
+"Get the current Windows ANSI code page identifier.");
+
+#define _WINAPI_GETACP_METHODDEF \
+ {"GetACP", (PyCFunction)_winapi_GetACP, METH_NOARGS, _winapi_GetACP__doc__},
+
+static PyObject *
+_winapi_GetACP_impl(PyObject *module);
+
+static PyObject *
+_winapi_GetACP(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _winapi_GetACP_impl(module);
+}
+
+PyDoc_STRVAR(_winapi_GetFileType__doc__,
+"GetFileType($module, /, handle)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_GETFILETYPE_METHODDEF \
+ {"GetFileType", _PyCFunction_CAST(_winapi_GetFileType), METH_FASTCALL|METH_KEYWORDS, _winapi_GetFileType__doc__},
+
+static DWORD
+_winapi_GetFileType_impl(PyObject *module, HANDLE handle);
+
+static PyObject *
+_winapi_GetFileType(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(handle), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"handle", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" F_HANDLE ":GetFileType",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ HANDLE handle;
+ DWORD _return_value;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &handle)) {
+ goto exit;
+ }
+ _return_value = _winapi_GetFileType_impl(module, handle);
+ if ((_return_value == PY_DWORD_MAX) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = Py_BuildValue("k", _return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi__mimetypes_read_windows_registry__doc__,
+"_mimetypes_read_windows_registry($module, /, on_type_read)\n"
+"--\n"
+"\n"
+"Optimized function for reading all known MIME types from the registry.\n"
+"\n"
+"*on_type_read* is a callable taking *type* and *ext* arguments, as for\n"
+"MimeTypes.add_type.");
+
+#define _WINAPI__MIMETYPES_READ_WINDOWS_REGISTRY_METHODDEF \
+ {"_mimetypes_read_windows_registry", _PyCFunction_CAST(_winapi__mimetypes_read_windows_registry), METH_FASTCALL|METH_KEYWORDS, _winapi__mimetypes_read_windows_registry__doc__},
+
+static PyObject *
+_winapi__mimetypes_read_windows_registry_impl(PyObject *module,
+ PyObject *on_type_read);
+
+static PyObject *
+_winapi__mimetypes_read_windows_registry(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(on_type_read), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"on_type_read", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_mimetypes_read_windows_registry",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *on_type_read;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ on_type_read = args[0];
+ return_value = _winapi__mimetypes_read_windows_registry_impl(module, on_type_read);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_NeedCurrentDirectoryForExePath__doc__,
+"NeedCurrentDirectoryForExePath($module, exe_name, /)\n"
+"--\n"
+"\n");
+
+#define _WINAPI_NEEDCURRENTDIRECTORYFOREXEPATH_METHODDEF \
+ {"NeedCurrentDirectoryForExePath", (PyCFunction)_winapi_NeedCurrentDirectoryForExePath, METH_O, _winapi_NeedCurrentDirectoryForExePath__doc__},
+
+static int
+_winapi_NeedCurrentDirectoryForExePath_impl(PyObject *module,
+ LPCWSTR exe_name);
+
+static PyObject *
+_winapi_NeedCurrentDirectoryForExePath(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ LPCWSTR exe_name = NULL;
+ int _return_value;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("NeedCurrentDirectoryForExePath", "argument", "str", arg);
+ goto exit;
+ }
+ exe_name = PyUnicode_AsWideCharString(arg, NULL);
+ if (exe_name == NULL) {
+ goto exit;
+ }
+ _return_value = _winapi_NeedCurrentDirectoryForExePath_impl(module, exe_name);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ /* Cleanup for exe_name */
+ PyMem_Free((void *)exe_name);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_winapi_CopyFile2__doc__,
+"CopyFile2($module, /, existing_file_name, new_file_name, flags,\n"
+" progress_routine=None)\n"
+"--\n"
+"\n"
+"Copies a file from one name to a new name.\n"
+"\n"
+"This is implemented using the CopyFile2 API, which preserves all stat\n"
+"and metadata information apart from security attributes.\n"
+"\n"
+"progress_routine is reserved for future use, but is currently not\n"
+"implemented. Its value is ignored.");
+
+#define _WINAPI_COPYFILE2_METHODDEF \
+ {"CopyFile2", _PyCFunction_CAST(_winapi_CopyFile2), METH_FASTCALL|METH_KEYWORDS, _winapi_CopyFile2__doc__},
+
+static PyObject *
+_winapi_CopyFile2_impl(PyObject *module, LPCWSTR existing_file_name,
+ LPCWSTR new_file_name, DWORD flags,
+ PyObject *progress_routine);
+
+static PyObject *
+_winapi_CopyFile2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(existing_file_name), &_Py_ID(new_file_name), &_Py_ID(flags), &_Py_ID(progress_routine), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"existing_file_name", "new_file_name", "flags", "progress_routine", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "O&O&k|O:CopyFile2",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ LPCWSTR existing_file_name = NULL;
+ LPCWSTR new_file_name = NULL;
+ DWORD flags;
+ PyObject *progress_routine = Py_None;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ _PyUnicode_WideCharString_Converter, &existing_file_name, _PyUnicode_WideCharString_Converter, &new_file_name, &flags, &progress_routine)) {
+ goto exit;
+ }
+ return_value = _winapi_CopyFile2_impl(module, existing_file_name, new_file_name, flags, progress_routine);
+
+exit:
+ /* Cleanup for existing_file_name */
+ PyMem_Free((void *)existing_file_name);
+ /* Cleanup for new_file_name */
+ PyMem_Free((void *)new_file_name);
+
+ return return_value;
+}
+/*[clinic end generated code: output=a1f20d03c363db1d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/_zoneinfo.c.h b/contrib/tools/python3/Modules/clinic/_zoneinfo.c.h
new file mode 100644
index 00000000000..ae62865e0f6
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/_zoneinfo.c.h
@@ -0,0 +1,375 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo_from_file__doc__,
+"from_file($type, file_obj, /, key=None)\n"
+"--\n"
+"\n"
+"Create a ZoneInfo file from a file object.");
+
+#define ZONEINFO_ZONEINFO_FROM_FILE_METHODDEF \
+ {"from_file", _PyCFunction_CAST(zoneinfo_ZoneInfo_from_file), METH_METHOD|METH_FASTCALL|METH_KEYWORDS|METH_CLASS, zoneinfo_ZoneInfo_from_file__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo_from_file_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *file_obj, PyObject *key);
+
+static PyObject *
+zoneinfo_ZoneInfo_from_file(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "from_file",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *file_obj;
+ PyObject *key = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ file_obj = args[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ key = args[1];
+skip_optional_pos:
+ return_value = zoneinfo_ZoneInfo_from_file_impl(type, cls, file_obj, key);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo_no_cache__doc__,
+"no_cache($type, /, key)\n"
+"--\n"
+"\n"
+"Get a new instance of ZoneInfo, bypassing the cache.");
+
+#define ZONEINFO_ZONEINFO_NO_CACHE_METHODDEF \
+ {"no_cache", _PyCFunction_CAST(zoneinfo_ZoneInfo_no_cache), METH_METHOD|METH_FASTCALL|METH_KEYWORDS|METH_CLASS, zoneinfo_ZoneInfo_no_cache__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo_no_cache_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *key);
+
+static PyObject *
+zoneinfo_ZoneInfo_no_cache(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "no_cache",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *key;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ key = args[0];
+ return_value = zoneinfo_ZoneInfo_no_cache_impl(type, cls, key);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo_clear_cache__doc__,
+"clear_cache($type, /, *, only_keys=None)\n"
+"--\n"
+"\n"
+"Clear the ZoneInfo cache.");
+
+#define ZONEINFO_ZONEINFO_CLEAR_CACHE_METHODDEF \
+ {"clear_cache", _PyCFunction_CAST(zoneinfo_ZoneInfo_clear_cache), METH_METHOD|METH_FASTCALL|METH_KEYWORDS|METH_CLASS, zoneinfo_ZoneInfo_clear_cache__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo_clear_cache_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *only_keys);
+
+static PyObject *
+zoneinfo_ZoneInfo_clear_cache(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(only_keys), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"only_keys", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "clear_cache",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *only_keys = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ only_keys = args[0];
+skip_optional_kwonly:
+ return_value = zoneinfo_ZoneInfo_clear_cache_impl(type, cls, only_keys);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo_utcoffset__doc__,
+"utcoffset($self, dt, /)\n"
+"--\n"
+"\n"
+"Retrieve a timedelta representing the UTC offset in a zone at the given datetime.");
+
+#define ZONEINFO_ZONEINFO_UTCOFFSET_METHODDEF \
+ {"utcoffset", _PyCFunction_CAST(zoneinfo_ZoneInfo_utcoffset), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zoneinfo_ZoneInfo_utcoffset__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo_utcoffset_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *dt);
+
+static PyObject *
+zoneinfo_ZoneInfo_utcoffset(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "utcoffset",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *dt;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ dt = args[0];
+ return_value = zoneinfo_ZoneInfo_utcoffset_impl(self, cls, dt);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo_dst__doc__,
+"dst($self, dt, /)\n"
+"--\n"
+"\n"
+"Retrieve a timedelta representing the amount of DST applied in a zone at the given datetime.");
+
+#define ZONEINFO_ZONEINFO_DST_METHODDEF \
+ {"dst", _PyCFunction_CAST(zoneinfo_ZoneInfo_dst), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zoneinfo_ZoneInfo_dst__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo_dst_impl(PyObject *self, PyTypeObject *cls, PyObject *dt);
+
+static PyObject *
+zoneinfo_ZoneInfo_dst(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "dst",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *dt;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ dt = args[0];
+ return_value = zoneinfo_ZoneInfo_dst_impl(self, cls, dt);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo_tzname__doc__,
+"tzname($self, dt, /)\n"
+"--\n"
+"\n"
+"Retrieve a string containing the abbreviation for the time zone that applies in a zone at a given datetime.");
+
+#define ZONEINFO_ZONEINFO_TZNAME_METHODDEF \
+ {"tzname", _PyCFunction_CAST(zoneinfo_ZoneInfo_tzname), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zoneinfo_ZoneInfo_tzname__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo_tzname_impl(PyObject *self, PyTypeObject *cls,
+ PyObject *dt);
+
+static PyObject *
+zoneinfo_ZoneInfo_tzname(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "tzname",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *dt;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ dt = args[0];
+ return_value = zoneinfo_ZoneInfo_tzname_impl(self, cls, dt);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zoneinfo_ZoneInfo__unpickle__doc__,
+"_unpickle($type, key, from_cache, /)\n"
+"--\n"
+"\n"
+"Private method used in unpickling.");
+
+#define ZONEINFO_ZONEINFO__UNPICKLE_METHODDEF \
+ {"_unpickle", _PyCFunction_CAST(zoneinfo_ZoneInfo__unpickle), METH_METHOD|METH_FASTCALL|METH_KEYWORDS|METH_CLASS, zoneinfo_ZoneInfo__unpickle__doc__},
+
+static PyObject *
+zoneinfo_ZoneInfo__unpickle_impl(PyTypeObject *type, PyTypeObject *cls,
+ PyObject *key, unsigned char from_cache);
+
+static PyObject *
+zoneinfo_ZoneInfo__unpickle(PyTypeObject *type, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_unpickle",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *key;
+ unsigned char from_cache;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ key = args[0];
+ {
+ unsigned long ival = PyLong_AsUnsignedLongMask(args[1]);
+ if (ival == (unsigned long)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ else {
+ from_cache = (unsigned char) ival;
+ }
+ }
+ return_value = zoneinfo_ZoneInfo__unpickle_impl(type, cls, key, from_cache);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=54051388dfc408af input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/arraymodule.c.h b/contrib/tools/python3/Modules/clinic/arraymodule.c.h
new file mode 100644
index 00000000000..844865f44a5
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/arraymodule.c.h
@@ -0,0 +1,683 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(array_array___copy____doc__,
+"__copy__($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the array.");
+
+#define ARRAY_ARRAY___COPY___METHODDEF \
+ {"__copy__", (PyCFunction)array_array___copy__, METH_NOARGS, array_array___copy____doc__},
+
+static PyObject *
+array_array___copy___impl(arrayobject *self);
+
+static PyObject *
+array_array___copy__(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array___copy___impl(self);
+}
+
+PyDoc_STRVAR(array_array___deepcopy____doc__,
+"__deepcopy__($self, unused, /)\n"
+"--\n"
+"\n"
+"Return a copy of the array.");
+
+#define ARRAY_ARRAY___DEEPCOPY___METHODDEF \
+ {"__deepcopy__", (PyCFunction)array_array___deepcopy__, METH_O, array_array___deepcopy____doc__},
+
+PyDoc_STRVAR(array_array_count__doc__,
+"count($self, v, /)\n"
+"--\n"
+"\n"
+"Return number of occurrences of v in the array.");
+
+#define ARRAY_ARRAY_COUNT_METHODDEF \
+ {"count", (PyCFunction)array_array_count, METH_O, array_array_count__doc__},
+
+PyDoc_STRVAR(array_array_index__doc__,
+"index($self, v, start=0, stop=sys.maxsize, /)\n"
+"--\n"
+"\n"
+"Return index of first occurrence of v in the array.\n"
+"\n"
+"Raise ValueError if the value is not present.");
+
+#define ARRAY_ARRAY_INDEX_METHODDEF \
+ {"index", _PyCFunction_CAST(array_array_index), METH_FASTCALL, array_array_index__doc__},
+
+static PyObject *
+array_array_index_impl(arrayobject *self, PyObject *v, Py_ssize_t start,
+ Py_ssize_t stop);
+
+static PyObject *
+array_array_index(arrayobject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *v;
+ Py_ssize_t start = 0;
+ Py_ssize_t stop = PY_SSIZE_T_MAX;
+
+ if (!_PyArg_CheckPositional("index", nargs, 1, 3)) {
+ goto exit;
+ }
+ v = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (!_PyEval_SliceIndexNotNone(args[1], &start)) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ if (!_PyEval_SliceIndexNotNone(args[2], &stop)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = array_array_index_impl(self, v, start, stop);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_remove__doc__,
+"remove($self, v, /)\n"
+"--\n"
+"\n"
+"Remove the first occurrence of v in the array.");
+
+#define ARRAY_ARRAY_REMOVE_METHODDEF \
+ {"remove", (PyCFunction)array_array_remove, METH_O, array_array_remove__doc__},
+
+PyDoc_STRVAR(array_array_pop__doc__,
+"pop($self, i=-1, /)\n"
+"--\n"
+"\n"
+"Return the i-th element and delete it from the array.\n"
+"\n"
+"i defaults to -1.");
+
+#define ARRAY_ARRAY_POP_METHODDEF \
+ {"pop", _PyCFunction_CAST(array_array_pop), METH_FASTCALL, array_array_pop__doc__},
+
+static PyObject *
+array_array_pop_impl(arrayobject *self, Py_ssize_t i);
+
+static PyObject *
+array_array_pop(arrayobject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t i = -1;
+
+ if (!_PyArg_CheckPositional("pop", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ i = ival;
+ }
+skip_optional:
+ return_value = array_array_pop_impl(self, i);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_extend__doc__,
+"extend($self, bb, /)\n"
+"--\n"
+"\n"
+"Append items to the end of the array.");
+
+#define ARRAY_ARRAY_EXTEND_METHODDEF \
+ {"extend", _PyCFunction_CAST(array_array_extend), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, array_array_extend__doc__},
+
+static PyObject *
+array_array_extend_impl(arrayobject *self, PyTypeObject *cls, PyObject *bb);
+
+static PyObject *
+array_array_extend(arrayobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "extend",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *bb;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ bb = args[0];
+ return_value = array_array_extend_impl(self, cls, bb);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_insert__doc__,
+"insert($self, i, v, /)\n"
+"--\n"
+"\n"
+"Insert a new item v into the array before position i.");
+
+#define ARRAY_ARRAY_INSERT_METHODDEF \
+ {"insert", _PyCFunction_CAST(array_array_insert), METH_FASTCALL, array_array_insert__doc__},
+
+static PyObject *
+array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v);
+
+static PyObject *
+array_array_insert(arrayobject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t i;
+ PyObject *v;
+
+ if (!_PyArg_CheckPositional("insert", nargs, 2, 2)) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ i = ival;
+ }
+ v = args[1];
+ return_value = array_array_insert_impl(self, i, v);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_buffer_info__doc__,
+"buffer_info($self, /)\n"
+"--\n"
+"\n"
+"Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array\'s contents.\n"
+"\n"
+"The length should be multiplied by the itemsize attribute to calculate\n"
+"the buffer length in bytes.");
+
+#define ARRAY_ARRAY_BUFFER_INFO_METHODDEF \
+ {"buffer_info", (PyCFunction)array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__},
+
+static PyObject *
+array_array_buffer_info_impl(arrayobject *self);
+
+static PyObject *
+array_array_buffer_info(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_buffer_info_impl(self);
+}
+
+PyDoc_STRVAR(array_array_append__doc__,
+"append($self, v, /)\n"
+"--\n"
+"\n"
+"Append new value v to the end of the array.");
+
+#define ARRAY_ARRAY_APPEND_METHODDEF \
+ {"append", (PyCFunction)array_array_append, METH_O, array_array_append__doc__},
+
+PyDoc_STRVAR(array_array_byteswap__doc__,
+"byteswap($self, /)\n"
+"--\n"
+"\n"
+"Byteswap all items of the array.\n"
+"\n"
+"If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is\n"
+"raised.");
+
+#define ARRAY_ARRAY_BYTESWAP_METHODDEF \
+ {"byteswap", (PyCFunction)array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__},
+
+static PyObject *
+array_array_byteswap_impl(arrayobject *self);
+
+static PyObject *
+array_array_byteswap(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_byteswap_impl(self);
+}
+
+PyDoc_STRVAR(array_array_reverse__doc__,
+"reverse($self, /)\n"
+"--\n"
+"\n"
+"Reverse the order of the items in the array.");
+
+#define ARRAY_ARRAY_REVERSE_METHODDEF \
+ {"reverse", (PyCFunction)array_array_reverse, METH_NOARGS, array_array_reverse__doc__},
+
+static PyObject *
+array_array_reverse_impl(arrayobject *self);
+
+static PyObject *
+array_array_reverse(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_reverse_impl(self);
+}
+
+PyDoc_STRVAR(array_array_fromfile__doc__,
+"fromfile($self, f, n, /)\n"
+"--\n"
+"\n"
+"Read n objects from the file object f and append them to the end of the array.");
+
+#define ARRAY_ARRAY_FROMFILE_METHODDEF \
+ {"fromfile", _PyCFunction_CAST(array_array_fromfile), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, array_array_fromfile__doc__},
+
+static PyObject *
+array_array_fromfile_impl(arrayobject *self, PyTypeObject *cls, PyObject *f,
+ Py_ssize_t n);
+
+static PyObject *
+array_array_fromfile(arrayobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fromfile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *f;
+ Py_ssize_t n;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ f = args[0];
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ n = ival;
+ }
+ return_value = array_array_fromfile_impl(self, cls, f, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_tofile__doc__,
+"tofile($self, f, /)\n"
+"--\n"
+"\n"
+"Write all items (as machine values) to the file object f.");
+
+#define ARRAY_ARRAY_TOFILE_METHODDEF \
+ {"tofile", _PyCFunction_CAST(array_array_tofile), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, array_array_tofile__doc__},
+
+static PyObject *
+array_array_tofile_impl(arrayobject *self, PyTypeObject *cls, PyObject *f);
+
+static PyObject *
+array_array_tofile(arrayobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "tofile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *f;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ f = args[0];
+ return_value = array_array_tofile_impl(self, cls, f);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_fromlist__doc__,
+"fromlist($self, list, /)\n"
+"--\n"
+"\n"
+"Append items to array from list.");
+
+#define ARRAY_ARRAY_FROMLIST_METHODDEF \
+ {"fromlist", (PyCFunction)array_array_fromlist, METH_O, array_array_fromlist__doc__},
+
+PyDoc_STRVAR(array_array_tolist__doc__,
+"tolist($self, /)\n"
+"--\n"
+"\n"
+"Convert array to an ordinary list with the same items.");
+
+#define ARRAY_ARRAY_TOLIST_METHODDEF \
+ {"tolist", (PyCFunction)array_array_tolist, METH_NOARGS, array_array_tolist__doc__},
+
+static PyObject *
+array_array_tolist_impl(arrayobject *self);
+
+static PyObject *
+array_array_tolist(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_tolist_impl(self);
+}
+
+PyDoc_STRVAR(array_array_frombytes__doc__,
+"frombytes($self, buffer, /)\n"
+"--\n"
+"\n"
+"Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method.");
+
+#define ARRAY_ARRAY_FROMBYTES_METHODDEF \
+ {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__},
+
+static PyObject *
+array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer);
+
+static PyObject *
+array_array_frombytes(arrayobject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("frombytes", "argument", "contiguous buffer", arg);
+ goto exit;
+ }
+ return_value = array_array_frombytes_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_tobytes__doc__,
+"tobytes($self, /)\n"
+"--\n"
+"\n"
+"Convert the array to an array of machine values and return the bytes representation.");
+
+#define ARRAY_ARRAY_TOBYTES_METHODDEF \
+ {"tobytes", (PyCFunction)array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__},
+
+static PyObject *
+array_array_tobytes_impl(arrayobject *self);
+
+static PyObject *
+array_array_tobytes(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_tobytes_impl(self);
+}
+
+PyDoc_STRVAR(array_array_fromunicode__doc__,
+"fromunicode($self, ustr, /)\n"
+"--\n"
+"\n"
+"Extends this array with data from the unicode string ustr.\n"
+"\n"
+"The array must be a unicode type array; otherwise a ValueError is raised.\n"
+"Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of\n"
+"some other type.");
+
+#define ARRAY_ARRAY_FROMUNICODE_METHODDEF \
+ {"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__},
+
+static PyObject *
+array_array_fromunicode_impl(arrayobject *self, PyObject *ustr);
+
+static PyObject *
+array_array_fromunicode(arrayobject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *ustr;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("fromunicode", "argument", "str", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ ustr = arg;
+ return_value = array_array_fromunicode_impl(self, ustr);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array_tounicode__doc__,
+"tounicode($self, /)\n"
+"--\n"
+"\n"
+"Extends this array with data from the unicode string ustr.\n"
+"\n"
+"Convert the array to a unicode string. The array must be a unicode type array;\n"
+"otherwise a ValueError is raised. Use array.tobytes().decode() to obtain a\n"
+"unicode string from an array of some other type.");
+
+#define ARRAY_ARRAY_TOUNICODE_METHODDEF \
+ {"tounicode", (PyCFunction)array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__},
+
+static PyObject *
+array_array_tounicode_impl(arrayobject *self);
+
+static PyObject *
+array_array_tounicode(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array_tounicode_impl(self);
+}
+
+PyDoc_STRVAR(array_array___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Size of the array in memory, in bytes.");
+
+#define ARRAY_ARRAY___SIZEOF___METHODDEF \
+ {"__sizeof__", (PyCFunction)array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__},
+
+static PyObject *
+array_array___sizeof___impl(arrayobject *self);
+
+static PyObject *
+array_array___sizeof__(arrayobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return array_array___sizeof___impl(self);
+}
+
+PyDoc_STRVAR(array__array_reconstructor__doc__,
+"_array_reconstructor($module, arraytype, typecode, mformat_code, items,\n"
+" /)\n"
+"--\n"
+"\n"
+"Internal. Used for pickling support.");
+
+#define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \
+ {"_array_reconstructor", _PyCFunction_CAST(array__array_reconstructor), METH_FASTCALL, array__array_reconstructor__doc__},
+
+static PyObject *
+array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
+ int typecode,
+ enum machine_format_code mformat_code,
+ PyObject *items);
+
+static PyObject *
+array__array_reconstructor(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *arraytype;
+ int typecode;
+ enum machine_format_code mformat_code;
+ PyObject *items;
+
+ if (!_PyArg_CheckPositional("_array_reconstructor", nargs, 4, 4)) {
+ goto exit;
+ }
+ arraytype = (PyTypeObject *)args[0];
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[1])) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(args[1]) != 1) {
+ _PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]);
+ goto exit;
+ }
+ typecode = PyUnicode_READ_CHAR(args[1], 0);
+ mformat_code = _PyLong_AsInt(args[2]);
+ if (mformat_code == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ items = args[3];
+ return_value = array__array_reconstructor_impl(module, arraytype, typecode, mformat_code, items);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_array___reduce_ex____doc__,
+"__reduce_ex__($self, value, /)\n"
+"--\n"
+"\n"
+"Return state information for pickling.");
+
+#define ARRAY_ARRAY___REDUCE_EX___METHODDEF \
+ {"__reduce_ex__", _PyCFunction_CAST(array_array___reduce_ex__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, array_array___reduce_ex____doc__},
+
+static PyObject *
+array_array___reduce_ex___impl(arrayobject *self, PyTypeObject *cls,
+ PyObject *value);
+
+static PyObject *
+array_array___reduce_ex__(arrayobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "__reduce_ex__",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ value = args[0];
+ return_value = array_array___reduce_ex___impl(self, cls, value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(array_arrayiterator___reduce____doc__,
+"__reduce__($self, /)\n"
+"--\n"
+"\n"
+"Return state information for pickling.");
+
+#define ARRAY_ARRAYITERATOR___REDUCE___METHODDEF \
+ {"__reduce__", _PyCFunction_CAST(array_arrayiterator___reduce__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, array_arrayiterator___reduce____doc__},
+
+static PyObject *
+array_arrayiterator___reduce___impl(arrayiterobject *self, PyTypeObject *cls);
+
+static PyObject *
+array_arrayiterator___reduce__(arrayiterobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "__reduce__() takes no arguments");
+ return NULL;
+ }
+ return array_arrayiterator___reduce___impl(self, cls);
+}
+
+PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
+"__setstate__($self, state, /)\n"
+"--\n"
+"\n"
+"Set state information for unpickling.");
+
+#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
+ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
+/*[clinic end generated code: output=7478fe6a5e4096f5 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/audioop.c.h b/contrib/tools/python3/Modules/clinic/audioop.c.h
new file mode 100644
index 00000000000..1a7ccf8b828
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/audioop.c.h
@@ -0,0 +1,1318 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(audioop_getsample__doc__,
+"getsample($module, fragment, width, index, /)\n"
+"--\n"
+"\n"
+"Return the value of sample index from the fragment.");
+
+#define AUDIOOP_GETSAMPLE_METHODDEF \
+ {"getsample", _PyCFunction_CAST(audioop_getsample), METH_FASTCALL, audioop_getsample__doc__},
+
+static PyObject *
+audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width,
+ Py_ssize_t index);
+
+static PyObject *
+audioop_getsample(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ Py_ssize_t index;
+
+ if (!_PyArg_CheckPositional("getsample", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("getsample", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ index = ival;
+ }
+ return_value = audioop_getsample_impl(module, &fragment, width, index);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_max__doc__,
+"max($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the maximum of the absolute value of all samples in a fragment.");
+
+#define AUDIOOP_MAX_METHODDEF \
+ {"max", _PyCFunction_CAST(audioop_max), METH_FASTCALL, audioop_max__doc__},
+
+static PyObject *
+audioop_max_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("max", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("max", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_max_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_minmax__doc__,
+"minmax($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the minimum and maximum values of all samples in the sound fragment.");
+
+#define AUDIOOP_MINMAX_METHODDEF \
+ {"minmax", _PyCFunction_CAST(audioop_minmax), METH_FASTCALL, audioop_minmax__doc__},
+
+static PyObject *
+audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_minmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("minmax", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("minmax", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_minmax_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_avg__doc__,
+"avg($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the average over all samples in the fragment.");
+
+#define AUDIOOP_AVG_METHODDEF \
+ {"avg", _PyCFunction_CAST(audioop_avg), METH_FASTCALL, audioop_avg__doc__},
+
+static PyObject *
+audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_avg(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("avg", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("avg", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_avg_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_rms__doc__,
+"rms($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).");
+
+#define AUDIOOP_RMS_METHODDEF \
+ {"rms", _PyCFunction_CAST(audioop_rms), METH_FASTCALL, audioop_rms__doc__},
+
+static PyObject *
+audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_rms(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("rms", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("rms", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_rms_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_findfit__doc__,
+"findfit($module, fragment, reference, /)\n"
+"--\n"
+"\n"
+"Try to match reference as well as possible to a portion of fragment.");
+
+#define AUDIOOP_FINDFIT_METHODDEF \
+ {"findfit", _PyCFunction_CAST(audioop_findfit), METH_FASTCALL, audioop_findfit__doc__},
+
+static PyObject *
+audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
+ Py_buffer *reference);
+
+static PyObject *
+audioop_findfit(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ Py_buffer reference = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("findfit", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("findfit", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&reference, 'C')) {
+ _PyArg_BadArgument("findfit", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = audioop_findfit_impl(module, &fragment, &reference);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+ /* Cleanup for reference */
+ if (reference.obj) {
+ PyBuffer_Release(&reference);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_findfactor__doc__,
+"findfactor($module, fragment, reference, /)\n"
+"--\n"
+"\n"
+"Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.");
+
+#define AUDIOOP_FINDFACTOR_METHODDEF \
+ {"findfactor", _PyCFunction_CAST(audioop_findfactor), METH_FASTCALL, audioop_findfactor__doc__},
+
+static PyObject *
+audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
+ Py_buffer *reference);
+
+static PyObject *
+audioop_findfactor(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ Py_buffer reference = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("findfactor", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("findfactor", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&reference, 'C')) {
+ _PyArg_BadArgument("findfactor", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = audioop_findfactor_impl(module, &fragment, &reference);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+ /* Cleanup for reference */
+ if (reference.obj) {
+ PyBuffer_Release(&reference);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_findmax__doc__,
+"findmax($module, fragment, length, /)\n"
+"--\n"
+"\n"
+"Search fragment for a slice of specified number of samples with maximum energy.");
+
+#define AUDIOOP_FINDMAX_METHODDEF \
+ {"findmax", _PyCFunction_CAST(audioop_findmax), METH_FASTCALL, audioop_findmax__doc__},
+
+static PyObject *
+audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
+ Py_ssize_t length);
+
+static PyObject *
+audioop_findmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ Py_ssize_t length;
+
+ if (!_PyArg_CheckPositional("findmax", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("findmax", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
+ }
+ return_value = audioop_findmax_impl(module, &fragment, length);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_avgpp__doc__,
+"avgpp($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the average peak-peak value over all samples in the fragment.");
+
+#define AUDIOOP_AVGPP_METHODDEF \
+ {"avgpp", _PyCFunction_CAST(audioop_avgpp), METH_FASTCALL, audioop_avgpp__doc__},
+
+static PyObject *
+audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_avgpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("avgpp", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("avgpp", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_avgpp_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_maxpp__doc__,
+"maxpp($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the maximum peak-peak value in the sound fragment.");
+
+#define AUDIOOP_MAXPP_METHODDEF \
+ {"maxpp", _PyCFunction_CAST(audioop_maxpp), METH_FASTCALL, audioop_maxpp__doc__},
+
+static PyObject *
+audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_maxpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("maxpp", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("maxpp", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_maxpp_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_cross__doc__,
+"cross($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Return the number of zero crossings in the fragment passed as an argument.");
+
+#define AUDIOOP_CROSS_METHODDEF \
+ {"cross", _PyCFunction_CAST(audioop_cross), METH_FASTCALL, audioop_cross__doc__},
+
+static PyObject *
+audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_cross(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("cross", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("cross", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_cross_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_mul__doc__,
+"mul($module, fragment, width, factor, /)\n"
+"--\n"
+"\n"
+"Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.");
+
+#define AUDIOOP_MUL_METHODDEF \
+ {"mul", _PyCFunction_CAST(audioop_mul), METH_FASTCALL, audioop_mul__doc__},
+
+static PyObject *
+audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width,
+ double factor);
+
+static PyObject *
+audioop_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ double factor;
+
+ if (!_PyArg_CheckPositional("mul", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("mul", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[2])) {
+ factor = PyFloat_AS_DOUBLE(args[2]);
+ }
+ else
+ {
+ factor = PyFloat_AsDouble(args[2]);
+ if (factor == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = audioop_mul_impl(module, &fragment, width, factor);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_tomono__doc__,
+"tomono($module, fragment, width, lfactor, rfactor, /)\n"
+"--\n"
+"\n"
+"Convert a stereo fragment to a mono fragment.");
+
+#define AUDIOOP_TOMONO_METHODDEF \
+ {"tomono", _PyCFunction_CAST(audioop_tomono), METH_FASTCALL, audioop_tomono__doc__},
+
+static PyObject *
+audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width,
+ double lfactor, double rfactor);
+
+static PyObject *
+audioop_tomono(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ double lfactor;
+ double rfactor;
+
+ if (!_PyArg_CheckPositional("tomono", nargs, 4, 4)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("tomono", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[2])) {
+ lfactor = PyFloat_AS_DOUBLE(args[2]);
+ }
+ else
+ {
+ lfactor = PyFloat_AsDouble(args[2]);
+ if (lfactor == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[3])) {
+ rfactor = PyFloat_AS_DOUBLE(args[3]);
+ }
+ else
+ {
+ rfactor = PyFloat_AsDouble(args[3]);
+ if (rfactor == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = audioop_tomono_impl(module, &fragment, width, lfactor, rfactor);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_tostereo__doc__,
+"tostereo($module, fragment, width, lfactor, rfactor, /)\n"
+"--\n"
+"\n"
+"Generate a stereo fragment from a mono fragment.");
+
+#define AUDIOOP_TOSTEREO_METHODDEF \
+ {"tostereo", _PyCFunction_CAST(audioop_tostereo), METH_FASTCALL, audioop_tostereo__doc__},
+
+static PyObject *
+audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width,
+ double lfactor, double rfactor);
+
+static PyObject *
+audioop_tostereo(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ double lfactor;
+ double rfactor;
+
+ if (!_PyArg_CheckPositional("tostereo", nargs, 4, 4)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("tostereo", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[2])) {
+ lfactor = PyFloat_AS_DOUBLE(args[2]);
+ }
+ else
+ {
+ lfactor = PyFloat_AsDouble(args[2]);
+ if (lfactor == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[3])) {
+ rfactor = PyFloat_AS_DOUBLE(args[3]);
+ }
+ else
+ {
+ rfactor = PyFloat_AsDouble(args[3]);
+ if (rfactor == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = audioop_tostereo_impl(module, &fragment, width, lfactor, rfactor);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_add__doc__,
+"add($module, fragment1, fragment2, width, /)\n"
+"--\n"
+"\n"
+"Return a fragment which is the addition of the two samples passed as parameters.");
+
+#define AUDIOOP_ADD_METHODDEF \
+ {"add", _PyCFunction_CAST(audioop_add), METH_FASTCALL, audioop_add__doc__},
+
+static PyObject *
+audioop_add_impl(PyObject *module, Py_buffer *fragment1,
+ Py_buffer *fragment2, int width);
+
+static PyObject *
+audioop_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment1 = {NULL, NULL};
+ Py_buffer fragment2 = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("add", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment1, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment1, 'C')) {
+ _PyArg_BadArgument("add", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &fragment2, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment2, 'C')) {
+ _PyArg_BadArgument("add", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[2]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_add_impl(module, &fragment1, &fragment2, width);
+
+exit:
+ /* Cleanup for fragment1 */
+ if (fragment1.obj) {
+ PyBuffer_Release(&fragment1);
+ }
+ /* Cleanup for fragment2 */
+ if (fragment2.obj) {
+ PyBuffer_Release(&fragment2);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_bias__doc__,
+"bias($module, fragment, width, bias, /)\n"
+"--\n"
+"\n"
+"Return a fragment that is the original fragment with a bias added to each sample.");
+
+#define AUDIOOP_BIAS_METHODDEF \
+ {"bias", _PyCFunction_CAST(audioop_bias), METH_FASTCALL, audioop_bias__doc__},
+
+static PyObject *
+audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias);
+
+static PyObject *
+audioop_bias(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ int bias;
+
+ if (!_PyArg_CheckPositional("bias", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("bias", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ bias = _PyLong_AsInt(args[2]);
+ if (bias == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_bias_impl(module, &fragment, width, bias);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_reverse__doc__,
+"reverse($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Reverse the samples in a fragment and returns the modified fragment.");
+
+#define AUDIOOP_REVERSE_METHODDEF \
+ {"reverse", _PyCFunction_CAST(audioop_reverse), METH_FASTCALL, audioop_reverse__doc__},
+
+static PyObject *
+audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_reverse(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("reverse", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("reverse", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_reverse_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_byteswap__doc__,
+"byteswap($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert big-endian samples to little-endian and vice versa.");
+
+#define AUDIOOP_BYTESWAP_METHODDEF \
+ {"byteswap", _PyCFunction_CAST(audioop_byteswap), METH_FASTCALL, audioop_byteswap__doc__},
+
+static PyObject *
+audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_byteswap(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("byteswap", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("byteswap", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_byteswap_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2lin__doc__,
+"lin2lin($module, fragment, width, newwidth, /)\n"
+"--\n"
+"\n"
+"Convert samples between 1-, 2-, 3- and 4-byte formats.");
+
+#define AUDIOOP_LIN2LIN_METHODDEF \
+ {"lin2lin", _PyCFunction_CAST(audioop_lin2lin), METH_FASTCALL, audioop_lin2lin__doc__},
+
+static PyObject *
+audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width,
+ int newwidth);
+
+static PyObject *
+audioop_lin2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ int newwidth;
+
+ if (!_PyArg_CheckPositional("lin2lin", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("lin2lin", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ newwidth = _PyLong_AsInt(args[2]);
+ if (newwidth == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_lin2lin_impl(module, &fragment, width, newwidth);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_ratecv__doc__,
+"ratecv($module, fragment, width, nchannels, inrate, outrate, state,\n"
+" weightA=1, weightB=0, /)\n"
+"--\n"
+"\n"
+"Convert the frame rate of the input fragment.");
+
+#define AUDIOOP_RATECV_METHODDEF \
+ {"ratecv", _PyCFunction_CAST(audioop_ratecv), METH_FASTCALL, audioop_ratecv__doc__},
+
+static PyObject *
+audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
+ int nchannels, int inrate, int outrate, PyObject *state,
+ int weightA, int weightB);
+
+static PyObject *
+audioop_ratecv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ int nchannels;
+ int inrate;
+ int outrate;
+ PyObject *state;
+ int weightA = 1;
+ int weightB = 0;
+
+ if (!_PyArg_CheckPositional("ratecv", nargs, 6, 8)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("ratecv", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ nchannels = _PyLong_AsInt(args[2]);
+ if (nchannels == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ inrate = _PyLong_AsInt(args[3]);
+ if (inrate == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ outrate = _PyLong_AsInt(args[4]);
+ if (outrate == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ state = args[5];
+ if (nargs < 7) {
+ goto skip_optional;
+ }
+ weightA = _PyLong_AsInt(args[6]);
+ if (weightA == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 8) {
+ goto skip_optional;
+ }
+ weightB = _PyLong_AsInt(args[7]);
+ if (weightB == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = audioop_ratecv_impl(module, &fragment, width, nchannels, inrate, outrate, state, weightA, weightB);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2ulaw__doc__,
+"lin2ulaw($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert samples in the audio fragment to u-LAW encoding.");
+
+#define AUDIOOP_LIN2ULAW_METHODDEF \
+ {"lin2ulaw", _PyCFunction_CAST(audioop_lin2ulaw), METH_FASTCALL, audioop_lin2ulaw__doc__},
+
+static PyObject *
+audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_lin2ulaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("lin2ulaw", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("lin2ulaw", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_lin2ulaw_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_ulaw2lin__doc__,
+"ulaw2lin($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.");
+
+#define AUDIOOP_ULAW2LIN_METHODDEF \
+ {"ulaw2lin", _PyCFunction_CAST(audioop_ulaw2lin), METH_FASTCALL, audioop_ulaw2lin__doc__},
+
+static PyObject *
+audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_ulaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("ulaw2lin", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("ulaw2lin", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_ulaw2lin_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2alaw__doc__,
+"lin2alaw($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert samples in the audio fragment to a-LAW encoding.");
+
+#define AUDIOOP_LIN2ALAW_METHODDEF \
+ {"lin2alaw", _PyCFunction_CAST(audioop_lin2alaw), METH_FASTCALL, audioop_lin2alaw__doc__},
+
+static PyObject *
+audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_lin2alaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("lin2alaw", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("lin2alaw", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_lin2alaw_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_alaw2lin__doc__,
+"alaw2lin($module, fragment, width, /)\n"
+"--\n"
+"\n"
+"Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.");
+
+#define AUDIOOP_ALAW2LIN_METHODDEF \
+ {"alaw2lin", _PyCFunction_CAST(audioop_alaw2lin), METH_FASTCALL, audioop_alaw2lin__doc__},
+
+static PyObject *
+audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
+
+static PyObject *
+audioop_alaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+
+ if (!_PyArg_CheckPositional("alaw2lin", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("alaw2lin", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = audioop_alaw2lin_impl(module, &fragment, width);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_lin2adpcm__doc__,
+"lin2adpcm($module, fragment, width, state, /)\n"
+"--\n"
+"\n"
+"Convert samples to 4 bit Intel/DVI ADPCM encoding.");
+
+#define AUDIOOP_LIN2ADPCM_METHODDEF \
+ {"lin2adpcm", _PyCFunction_CAST(audioop_lin2adpcm), METH_FASTCALL, audioop_lin2adpcm__doc__},
+
+static PyObject *
+audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width,
+ PyObject *state);
+
+static PyObject *
+audioop_lin2adpcm(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ PyObject *state;
+
+ if (!_PyArg_CheckPositional("lin2adpcm", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("lin2adpcm", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ state = args[2];
+ return_value = audioop_lin2adpcm_impl(module, &fragment, width, state);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(audioop_adpcm2lin__doc__,
+"adpcm2lin($module, fragment, width, state, /)\n"
+"--\n"
+"\n"
+"Decode an Intel/DVI ADPCM coded fragment to a linear fragment.");
+
+#define AUDIOOP_ADPCM2LIN_METHODDEF \
+ {"adpcm2lin", _PyCFunction_CAST(audioop_adpcm2lin), METH_FASTCALL, audioop_adpcm2lin__doc__},
+
+static PyObject *
+audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width,
+ PyObject *state);
+
+static PyObject *
+audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer fragment = {NULL, NULL};
+ int width;
+ PyObject *state;
+
+ if (!_PyArg_CheckPositional("adpcm2lin", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &fragment, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&fragment, 'C')) {
+ _PyArg_BadArgument("adpcm2lin", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ width = _PyLong_AsInt(args[1]);
+ if (width == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ state = args[2];
+ return_value = audioop_adpcm2lin_impl(module, &fragment, width, state);
+
+exit:
+ /* Cleanup for fragment */
+ if (fragment.obj) {
+ PyBuffer_Release(&fragment);
+ }
+
+ return return_value;
+}
+/*[clinic end generated code: output=9a7e36f1179f0223 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/binascii.c.h b/contrib/tools/python3/Modules/clinic/binascii.c.h
new file mode 100644
index 00000000000..63566dfb10e
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/binascii.c.h
@@ -0,0 +1,798 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(binascii_a2b_uu__doc__,
+"a2b_uu($module, data, /)\n"
+"--\n"
+"\n"
+"Decode a line of uuencoded data.");
+
+#define BINASCII_A2B_UU_METHODDEF \
+ {"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__},
+
+static PyObject *
+binascii_a2b_uu_impl(PyObject *module, Py_buffer *data);
+
+static PyObject *
+binascii_a2b_uu(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+
+ if (!ascii_buffer_converter(arg, &data)) {
+ goto exit;
+ }
+ return_value = binascii_a2b_uu_impl(module, &data);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj)
+ PyBuffer_Release(&data);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_uu__doc__,
+"b2a_uu($module, data, /, *, backtick=False)\n"
+"--\n"
+"\n"
+"Uuencode line of data.");
+
+#define BINASCII_B2A_UU_METHODDEF \
+ {"b2a_uu", _PyCFunction_CAST(binascii_b2a_uu), METH_FASTCALL|METH_KEYWORDS, binascii_b2a_uu__doc__},
+
+static PyObject *
+binascii_b2a_uu_impl(PyObject *module, Py_buffer *data, int backtick);
+
+static PyObject *
+binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(backtick), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "backtick", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "b2a_uu",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int backtick = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("b2a_uu", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ backtick = PyObject_IsTrue(args[1]);
+ if (backtick < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = binascii_b2a_uu_impl(module, &data, backtick);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_base64__doc__,
+"a2b_base64($module, data, /, *, strict_mode=False)\n"
+"--\n"
+"\n"
+"Decode a line of base64 data.\n"
+"\n"
+" strict_mode\n"
+" When set to True, bytes that are not part of the base64 standard are not allowed.\n"
+" The same applies to excess data after padding (= / ==).");
+
+#define BINASCII_A2B_BASE64_METHODDEF \
+ {"a2b_base64", _PyCFunction_CAST(binascii_a2b_base64), METH_FASTCALL|METH_KEYWORDS, binascii_a2b_base64__doc__},
+
+static PyObject *
+binascii_a2b_base64_impl(PyObject *module, Py_buffer *data, int strict_mode);
+
+static PyObject *
+binascii_a2b_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(strict_mode), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "strict_mode", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "a2b_base64",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int strict_mode = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!ascii_buffer_converter(args[0], &data)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ strict_mode = PyObject_IsTrue(args[1]);
+ if (strict_mode < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = binascii_a2b_base64_impl(module, &data, strict_mode);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj)
+ PyBuffer_Release(&data);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_base64__doc__,
+"b2a_base64($module, data, /, *, newline=True)\n"
+"--\n"
+"\n"
+"Base64-code line of data.");
+
+#define BINASCII_B2A_BASE64_METHODDEF \
+ {"b2a_base64", _PyCFunction_CAST(binascii_b2a_base64), METH_FASTCALL|METH_KEYWORDS, binascii_b2a_base64__doc__},
+
+static PyObject *
+binascii_b2a_base64_impl(PyObject *module, Py_buffer *data, int newline);
+
+static PyObject *
+binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(newline), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "newline", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "b2a_base64",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int newline = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("b2a_base64", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ newline = PyObject_IsTrue(args[1]);
+ if (newline < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = binascii_b2a_base64_impl(module, &data, newline);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_crc_hqx__doc__,
+"crc_hqx($module, data, crc, /)\n"
+"--\n"
+"\n"
+"Compute CRC-CCITT incrementally.");
+
+#define BINASCII_CRC_HQX_METHODDEF \
+ {"crc_hqx", _PyCFunction_CAST(binascii_crc_hqx), METH_FASTCALL, binascii_crc_hqx__doc__},
+
+static PyObject *
+binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc);
+
+static PyObject *
+binascii_crc_hqx(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ unsigned int crc;
+
+ if (!_PyArg_CheckPositional("crc_hqx", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("crc_hqx", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ crc = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (crc == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = binascii_crc_hqx_impl(module, &data, crc);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_crc32__doc__,
+"crc32($module, data, crc=0, /)\n"
+"--\n"
+"\n"
+"Compute CRC-32 incrementally.");
+
+#define BINASCII_CRC32_METHODDEF \
+ {"crc32", _PyCFunction_CAST(binascii_crc32), METH_FASTCALL, binascii_crc32__doc__},
+
+static unsigned int
+binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc);
+
+static PyObject *
+binascii_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ unsigned int crc = 0;
+ unsigned int _return_value;
+
+ if (!_PyArg_CheckPositional("crc32", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ crc = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (crc == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ _return_value = binascii_crc32_impl(module, &data, crc);
+ if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_hex__doc__,
+"b2a_hex($module, /, data, sep=<unrepresentable>, bytes_per_sep=1)\n"
+"--\n"
+"\n"
+"Hexadecimal representation of binary data.\n"
+"\n"
+" sep\n"
+" An optional single character or byte to separate hex bytes.\n"
+" bytes_per_sep\n"
+" How many bytes between separators. Positive values count from the\n"
+" right, negative values count from the left.\n"
+"\n"
+"The return value is a bytes object. This function is also\n"
+"available as \"hexlify()\".\n"
+"\n"
+"Example:\n"
+">>> binascii.b2a_hex(b\'\\xb9\\x01\\xef\')\n"
+"b\'b901ef\'\n"
+">>> binascii.hexlify(b\'\\xb9\\x01\\xef\', \':\')\n"
+"b\'b9:01:ef\'\n"
+">>> binascii.b2a_hex(b\'\\xb9\\x01\\xef\', b\'_\', 2)\n"
+"b\'b9_01ef\'");
+
+#define BINASCII_B2A_HEX_METHODDEF \
+ {"b2a_hex", _PyCFunction_CAST(binascii_b2a_hex), METH_FASTCALL|METH_KEYWORDS, binascii_b2a_hex__doc__},
+
+static PyObject *
+binascii_b2a_hex_impl(PyObject *module, Py_buffer *data, PyObject *sep,
+ int bytes_per_sep);
+
+static PyObject *
+binascii_b2a_hex(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(sep), &_Py_ID(bytes_per_sep), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "sep", "bytes_per_sep", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "b2a_hex",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ PyObject *sep = NULL;
+ int bytes_per_sep = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("b2a_hex", "argument 'data'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ sep = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ bytes_per_sep = _PyLong_AsInt(args[2]);
+ if (bytes_per_sep == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = binascii_b2a_hex_impl(module, &data, sep, bytes_per_sep);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_hexlify__doc__,
+"hexlify($module, /, data, sep=<unrepresentable>, bytes_per_sep=1)\n"
+"--\n"
+"\n"
+"Hexadecimal representation of binary data.\n"
+"\n"
+" sep\n"
+" An optional single character or byte to separate hex bytes.\n"
+" bytes_per_sep\n"
+" How many bytes between separators. Positive values count from the\n"
+" right, negative values count from the left.\n"
+"\n"
+"The return value is a bytes object. This function is also\n"
+"available as \"b2a_hex()\".");
+
+#define BINASCII_HEXLIFY_METHODDEF \
+ {"hexlify", _PyCFunction_CAST(binascii_hexlify), METH_FASTCALL|METH_KEYWORDS, binascii_hexlify__doc__},
+
+static PyObject *
+binascii_hexlify_impl(PyObject *module, Py_buffer *data, PyObject *sep,
+ int bytes_per_sep);
+
+static PyObject *
+binascii_hexlify(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(sep), &_Py_ID(bytes_per_sep), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "sep", "bytes_per_sep", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "hexlify",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ PyObject *sep = NULL;
+ int bytes_per_sep = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("hexlify", "argument 'data'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ sep = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ bytes_per_sep = _PyLong_AsInt(args[2]);
+ if (bytes_per_sep == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = binascii_hexlify_impl(module, &data, sep, bytes_per_sep);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_hex__doc__,
+"a2b_hex($module, hexstr, /)\n"
+"--\n"
+"\n"
+"Binary data of hexadecimal representation.\n"
+"\n"
+"hexstr must contain an even number of hex digits (upper or lower case).\n"
+"This function is also available as \"unhexlify()\".");
+
+#define BINASCII_A2B_HEX_METHODDEF \
+ {"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__},
+
+static PyObject *
+binascii_a2b_hex_impl(PyObject *module, Py_buffer *hexstr);
+
+static PyObject *
+binascii_a2b_hex(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer hexstr = {NULL, NULL};
+
+ if (!ascii_buffer_converter(arg, &hexstr)) {
+ goto exit;
+ }
+ return_value = binascii_a2b_hex_impl(module, &hexstr);
+
+exit:
+ /* Cleanup for hexstr */
+ if (hexstr.obj)
+ PyBuffer_Release(&hexstr);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_unhexlify__doc__,
+"unhexlify($module, hexstr, /)\n"
+"--\n"
+"\n"
+"Binary data of hexadecimal representation.\n"
+"\n"
+"hexstr must contain an even number of hex digits (upper or lower case).");
+
+#define BINASCII_UNHEXLIFY_METHODDEF \
+ {"unhexlify", (PyCFunction)binascii_unhexlify, METH_O, binascii_unhexlify__doc__},
+
+static PyObject *
+binascii_unhexlify_impl(PyObject *module, Py_buffer *hexstr);
+
+static PyObject *
+binascii_unhexlify(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer hexstr = {NULL, NULL};
+
+ if (!ascii_buffer_converter(arg, &hexstr)) {
+ goto exit;
+ }
+ return_value = binascii_unhexlify_impl(module, &hexstr);
+
+exit:
+ /* Cleanup for hexstr */
+ if (hexstr.obj)
+ PyBuffer_Release(&hexstr);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_a2b_qp__doc__,
+"a2b_qp($module, /, data, header=False)\n"
+"--\n"
+"\n"
+"Decode a string of qp-encoded data.");
+
+#define BINASCII_A2B_QP_METHODDEF \
+ {"a2b_qp", _PyCFunction_CAST(binascii_a2b_qp), METH_FASTCALL|METH_KEYWORDS, binascii_a2b_qp__doc__},
+
+static PyObject *
+binascii_a2b_qp_impl(PyObject *module, Py_buffer *data, int header);
+
+static PyObject *
+binascii_a2b_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(header), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "header", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "a2b_qp",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int header = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!ascii_buffer_converter(args[0], &data)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ header = PyObject_IsTrue(args[1]);
+ if (header < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = binascii_a2b_qp_impl(module, &data, header);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj)
+ PyBuffer_Release(&data);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(binascii_b2a_qp__doc__,
+"b2a_qp($module, /, data, quotetabs=False, istext=True, header=False)\n"
+"--\n"
+"\n"
+"Encode a string using quoted-printable encoding.\n"
+"\n"
+"On encoding, when istext is set, newlines are not encoded, and white\n"
+"space at end of lines is. When istext is not set, \\r and \\n (CR/LF)\n"
+"are both encoded. When quotetabs is set, space and tabs are encoded.");
+
+#define BINASCII_B2A_QP_METHODDEF \
+ {"b2a_qp", _PyCFunction_CAST(binascii_b2a_qp), METH_FASTCALL|METH_KEYWORDS, binascii_b2a_qp__doc__},
+
+static PyObject *
+binascii_b2a_qp_impl(PyObject *module, Py_buffer *data, int quotetabs,
+ int istext, int header);
+
+static PyObject *
+binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(quotetabs), &_Py_ID(istext), &_Py_ID(header), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "quotetabs", "istext", "header", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "b2a_qp",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int quotetabs = 0;
+ int istext = 1;
+ int header = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("b2a_qp", "argument 'data'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ quotetabs = PyObject_IsTrue(args[1]);
+ if (quotetabs < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[2]) {
+ istext = PyObject_IsTrue(args[2]);
+ if (istext < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ header = PyObject_IsTrue(args[3]);
+ if (header < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = binascii_b2a_qp_impl(module, &data, quotetabs, istext, header);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+/*[clinic end generated code: output=ab156917c9db79d2 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/cmathmodule.c.h b/contrib/tools/python3/Modules/clinic/cmathmodule.c.h
new file mode 100644
index 00000000000..941448e76e8
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/cmathmodule.c.h
@@ -0,0 +1,985 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(cmath_acos__doc__,
+"acos($module, z, /)\n"
+"--\n"
+"\n"
+"Return the arc cosine of z.");
+
+#define CMATH_ACOS_METHODDEF \
+ {"acos", (PyCFunction)cmath_acos, METH_O, cmath_acos__doc__},
+
+static Py_complex
+cmath_acos_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_acos(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_acos_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_acosh__doc__,
+"acosh($module, z, /)\n"
+"--\n"
+"\n"
+"Return the inverse hyperbolic cosine of z.");
+
+#define CMATH_ACOSH_METHODDEF \
+ {"acosh", (PyCFunction)cmath_acosh, METH_O, cmath_acosh__doc__},
+
+static Py_complex
+cmath_acosh_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_acosh(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_acosh_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_asin__doc__,
+"asin($module, z, /)\n"
+"--\n"
+"\n"
+"Return the arc sine of z.");
+
+#define CMATH_ASIN_METHODDEF \
+ {"asin", (PyCFunction)cmath_asin, METH_O, cmath_asin__doc__},
+
+static Py_complex
+cmath_asin_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_asin(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_asin_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_asinh__doc__,
+"asinh($module, z, /)\n"
+"--\n"
+"\n"
+"Return the inverse hyperbolic sine of z.");
+
+#define CMATH_ASINH_METHODDEF \
+ {"asinh", (PyCFunction)cmath_asinh, METH_O, cmath_asinh__doc__},
+
+static Py_complex
+cmath_asinh_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_asinh(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_asinh_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_atan__doc__,
+"atan($module, z, /)\n"
+"--\n"
+"\n"
+"Return the arc tangent of z.");
+
+#define CMATH_ATAN_METHODDEF \
+ {"atan", (PyCFunction)cmath_atan, METH_O, cmath_atan__doc__},
+
+static Py_complex
+cmath_atan_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_atan(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_atan_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_atanh__doc__,
+"atanh($module, z, /)\n"
+"--\n"
+"\n"
+"Return the inverse hyperbolic tangent of z.");
+
+#define CMATH_ATANH_METHODDEF \
+ {"atanh", (PyCFunction)cmath_atanh, METH_O, cmath_atanh__doc__},
+
+static Py_complex
+cmath_atanh_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_atanh(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_atanh_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_cos__doc__,
+"cos($module, z, /)\n"
+"--\n"
+"\n"
+"Return the cosine of z.");
+
+#define CMATH_COS_METHODDEF \
+ {"cos", (PyCFunction)cmath_cos, METH_O, cmath_cos__doc__},
+
+static Py_complex
+cmath_cos_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_cos(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_cos_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_cosh__doc__,
+"cosh($module, z, /)\n"
+"--\n"
+"\n"
+"Return the hyperbolic cosine of z.");
+
+#define CMATH_COSH_METHODDEF \
+ {"cosh", (PyCFunction)cmath_cosh, METH_O, cmath_cosh__doc__},
+
+static Py_complex
+cmath_cosh_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_cosh(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_cosh_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_exp__doc__,
+"exp($module, z, /)\n"
+"--\n"
+"\n"
+"Return the exponential value e**z.");
+
+#define CMATH_EXP_METHODDEF \
+ {"exp", (PyCFunction)cmath_exp, METH_O, cmath_exp__doc__},
+
+static Py_complex
+cmath_exp_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_exp(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_exp_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_log10__doc__,
+"log10($module, z, /)\n"
+"--\n"
+"\n"
+"Return the base-10 logarithm of z.");
+
+#define CMATH_LOG10_METHODDEF \
+ {"log10", (PyCFunction)cmath_log10, METH_O, cmath_log10__doc__},
+
+static Py_complex
+cmath_log10_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_log10(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_log10_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_sin__doc__,
+"sin($module, z, /)\n"
+"--\n"
+"\n"
+"Return the sine of z.");
+
+#define CMATH_SIN_METHODDEF \
+ {"sin", (PyCFunction)cmath_sin, METH_O, cmath_sin__doc__},
+
+static Py_complex
+cmath_sin_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_sin(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_sin_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_sinh__doc__,
+"sinh($module, z, /)\n"
+"--\n"
+"\n"
+"Return the hyperbolic sine of z.");
+
+#define CMATH_SINH_METHODDEF \
+ {"sinh", (PyCFunction)cmath_sinh, METH_O, cmath_sinh__doc__},
+
+static Py_complex
+cmath_sinh_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_sinh(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_sinh_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_sqrt__doc__,
+"sqrt($module, z, /)\n"
+"--\n"
+"\n"
+"Return the square root of z.");
+
+#define CMATH_SQRT_METHODDEF \
+ {"sqrt", (PyCFunction)cmath_sqrt, METH_O, cmath_sqrt__doc__},
+
+static Py_complex
+cmath_sqrt_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_sqrt(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_sqrt_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_tan__doc__,
+"tan($module, z, /)\n"
+"--\n"
+"\n"
+"Return the tangent of z.");
+
+#define CMATH_TAN_METHODDEF \
+ {"tan", (PyCFunction)cmath_tan, METH_O, cmath_tan__doc__},
+
+static Py_complex
+cmath_tan_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_tan(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_tan_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_tanh__doc__,
+"tanh($module, z, /)\n"
+"--\n"
+"\n"
+"Return the hyperbolic tangent of z.");
+
+#define CMATH_TANH_METHODDEF \
+ {"tanh", (PyCFunction)cmath_tanh, METH_O, cmath_tanh__doc__},
+
+static Py_complex
+cmath_tanh_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_tanh(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+ Py_complex _return_value;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ /* modifications for z */
+ errno = 0;
+ _return_value = cmath_tanh_impl(module, z);
+ if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+ }
+ else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+ }
+ else {
+ return_value = PyComplex_FromCComplex(_return_value);
+ }
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_log__doc__,
+"log($module, z, base=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"log(z[, base]) -> the logarithm of z to the given base.\n"
+"\n"
+"If the base is not specified, returns the natural logarithm (base e) of z.");
+
+#define CMATH_LOG_METHODDEF \
+ {"log", _PyCFunction_CAST(cmath_log), METH_FASTCALL, cmath_log__doc__},
+
+static PyObject *
+cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj);
+
+static PyObject *
+cmath_log(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_complex x;
+ PyObject *y_obj = NULL;
+
+ if (!_PyArg_CheckPositional("log", nargs, 1, 2)) {
+ goto exit;
+ }
+ x = PyComplex_AsCComplex(args[0]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ y_obj = args[1];
+skip_optional:
+ return_value = cmath_log_impl(module, x, y_obj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_phase__doc__,
+"phase($module, z, /)\n"
+"--\n"
+"\n"
+"Return argument, also known as the phase angle, of a complex.");
+
+#define CMATH_PHASE_METHODDEF \
+ {"phase", (PyCFunction)cmath_phase, METH_O, cmath_phase__doc__},
+
+static PyObject *
+cmath_phase_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_phase(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = cmath_phase_impl(module, z);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_polar__doc__,
+"polar($module, z, /)\n"
+"--\n"
+"\n"
+"Convert a complex from rectangular coordinates to polar coordinates.\n"
+"\n"
+"r is the distance from 0 and phi the phase angle.");
+
+#define CMATH_POLAR_METHODDEF \
+ {"polar", (PyCFunction)cmath_polar, METH_O, cmath_polar__doc__},
+
+static PyObject *
+cmath_polar_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_polar(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = cmath_polar_impl(module, z);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_rect__doc__,
+"rect($module, r, phi, /)\n"
+"--\n"
+"\n"
+"Convert from polar coordinates to rectangular coordinates.");
+
+#define CMATH_RECT_METHODDEF \
+ {"rect", _PyCFunction_CAST(cmath_rect), METH_FASTCALL, cmath_rect__doc__},
+
+static PyObject *
+cmath_rect_impl(PyObject *module, double r, double phi);
+
+static PyObject *
+cmath_rect(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ double r;
+ double phi;
+
+ if (!_PyArg_CheckPositional("rect", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ r = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ r = PyFloat_AsDouble(args[0]);
+ if (r == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ phi = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ phi = PyFloat_AsDouble(args[1]);
+ if (phi == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = cmath_rect_impl(module, r, phi);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_isfinite__doc__,
+"isfinite($module, z, /)\n"
+"--\n"
+"\n"
+"Return True if both the real and imaginary parts of z are finite, else False.");
+
+#define CMATH_ISFINITE_METHODDEF \
+ {"isfinite", (PyCFunction)cmath_isfinite, METH_O, cmath_isfinite__doc__},
+
+static PyObject *
+cmath_isfinite_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_isfinite(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = cmath_isfinite_impl(module, z);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_isnan__doc__,
+"isnan($module, z, /)\n"
+"--\n"
+"\n"
+"Checks if the real or imaginary part of z not a number (NaN).");
+
+#define CMATH_ISNAN_METHODDEF \
+ {"isnan", (PyCFunction)cmath_isnan, METH_O, cmath_isnan__doc__},
+
+static PyObject *
+cmath_isnan_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_isnan(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = cmath_isnan_impl(module, z);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_isinf__doc__,
+"isinf($module, z, /)\n"
+"--\n"
+"\n"
+"Checks if the real or imaginary part of z is infinite.");
+
+#define CMATH_ISINF_METHODDEF \
+ {"isinf", (PyCFunction)cmath_isinf, METH_O, cmath_isinf__doc__},
+
+static PyObject *
+cmath_isinf_impl(PyObject *module, Py_complex z);
+
+static PyObject *
+cmath_isinf(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_complex z;
+
+ z = PyComplex_AsCComplex(arg);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = cmath_isinf_impl(module, z);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(cmath_isclose__doc__,
+"isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)\n"
+"--\n"
+"\n"
+"Determine whether two complex numbers are close in value.\n"
+"\n"
+" rel_tol\n"
+" maximum difference for being considered \"close\", relative to the\n"
+" magnitude of the input values\n"
+" abs_tol\n"
+" maximum difference for being considered \"close\", regardless of the\n"
+" magnitude of the input values\n"
+"\n"
+"Return True if a is close in value to b, and False otherwise.\n"
+"\n"
+"For the values to be considered close, the difference between them must be\n"
+"smaller than at least one of the tolerances.\n"
+"\n"
+"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is\n"
+"not close to anything, even itself. inf and -inf are only close to themselves.");
+
+#define CMATH_ISCLOSE_METHODDEF \
+ {"isclose", _PyCFunction_CAST(cmath_isclose), METH_FASTCALL|METH_KEYWORDS, cmath_isclose__doc__},
+
+static int
+cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
+ double rel_tol, double abs_tol);
+
+static PyObject *
+cmath_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(a), &_Py_ID(b), &_Py_ID(rel_tol), &_Py_ID(abs_tol), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "isclose",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ Py_complex a;
+ Py_complex b;
+ double rel_tol = 1e-09;
+ double abs_tol = 0.0;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ a = PyComplex_AsCComplex(args[0]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ b = PyComplex_AsCComplex(args[1]);
+ if (PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (PyFloat_CheckExact(args[2])) {
+ rel_tol = PyFloat_AS_DOUBLE(args[2]);
+ }
+ else
+ {
+ rel_tol = PyFloat_AsDouble(args[2]);
+ if (rel_tol == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (PyFloat_CheckExact(args[3])) {
+ abs_tol = PyFloat_AS_DOUBLE(args[3]);
+ }
+ else
+ {
+ abs_tol = PyFloat_AsDouble(args[3]);
+ if (abs_tol == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+skip_optional_kwonly:
+ _return_value = cmath_isclose_impl(module, a, b, rel_tol, abs_tol);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=87f609786ef270cd input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/fcntlmodule.c.h b/contrib/tools/python3/Modules/clinic/fcntlmodule.c.h
new file mode 100644
index 00000000000..20eb50b0e76
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/fcntlmodule.c.h
@@ -0,0 +1,252 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(fcntl_fcntl__doc__,
+"fcntl($module, fd, cmd, arg=0, /)\n"
+"--\n"
+"\n"
+"Perform the operation `cmd` on file descriptor fd.\n"
+"\n"
+"The values used for `cmd` are operating system dependent, and are available\n"
+"as constants in the fcntl module, using the same names as used in\n"
+"the relevant C header files. The argument arg is optional, and\n"
+"defaults to 0; it may be an int or a string. If arg is given as a string,\n"
+"the return value of fcntl is a string of that length, containing the\n"
+"resulting value put in the arg buffer by the operating system. The length\n"
+"of the arg string is not allowed to exceed 1024 bytes. If the arg given\n"
+"is an integer or if none is specified, the result value is an integer\n"
+"corresponding to the return value of the fcntl call in the C code.");
+
+#define FCNTL_FCNTL_METHODDEF \
+ {"fcntl", _PyCFunction_CAST(fcntl_fcntl), METH_FASTCALL, fcntl_fcntl__doc__},
+
+static PyObject *
+fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg);
+
+static PyObject *
+fcntl_fcntl(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int code;
+ PyObject *arg = NULL;
+
+ if (!_PyArg_CheckPositional("fcntl", nargs, 2, 3)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ code = _PyLong_AsInt(args[1]);
+ if (code == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ arg = args[2];
+skip_optional:
+ return_value = fcntl_fcntl_impl(module, fd, code, arg);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(fcntl_ioctl__doc__,
+"ioctl($module, fd, request, arg=0, mutate_flag=True, /)\n"
+"--\n"
+"\n"
+"Perform the operation `request` on file descriptor `fd`.\n"
+"\n"
+"The values used for `request` are operating system dependent, and are available\n"
+"as constants in the fcntl or termios library modules, using the same names as\n"
+"used in the relevant C header files.\n"
+"\n"
+"The argument `arg` is optional, and defaults to 0; it may be an int or a\n"
+"buffer containing character data (most likely a string or an array).\n"
+"\n"
+"If the argument is a mutable buffer (such as an array) and if the\n"
+"mutate_flag argument (which is only allowed in this case) is true then the\n"
+"buffer is (in effect) passed to the operating system and changes made by\n"
+"the OS will be reflected in the contents of the buffer after the call has\n"
+"returned. The return value is the integer returned by the ioctl system\n"
+"call.\n"
+"\n"
+"If the argument is a mutable buffer and the mutable_flag argument is false,\n"
+"the behavior is as if a string had been passed.\n"
+"\n"
+"If the argument is an immutable buffer (most likely a string) then a copy\n"
+"of the buffer is passed to the operating system and the return value is a\n"
+"string of the same length containing whatever the operating system put in\n"
+"the buffer. The length of the arg buffer in this case is not allowed to\n"
+"exceed 1024 bytes.\n"
+"\n"
+"If the arg given is an integer or if none is specified, the result value is\n"
+"an integer corresponding to the return value of the ioctl call in the C\n"
+"code.");
+
+#define FCNTL_IOCTL_METHODDEF \
+ {"ioctl", _PyCFunction_CAST(fcntl_ioctl), METH_FASTCALL, fcntl_ioctl__doc__},
+
+static PyObject *
+fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
+ PyObject *ob_arg, int mutate_arg);
+
+static PyObject *
+fcntl_ioctl(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ unsigned int code;
+ PyObject *ob_arg = NULL;
+ int mutate_arg = 1;
+
+ if (!_PyArg_CheckPositional("ioctl", nargs, 2, 4)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ code = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (code == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ ob_arg = args[2];
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ mutate_arg = PyObject_IsTrue(args[3]);
+ if (mutate_arg < 0) {
+ goto exit;
+ }
+skip_optional:
+ return_value = fcntl_ioctl_impl(module, fd, code, ob_arg, mutate_arg);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(fcntl_flock__doc__,
+"flock($module, fd, operation, /)\n"
+"--\n"
+"\n"
+"Perform the lock operation `operation` on file descriptor `fd`.\n"
+"\n"
+"See the Unix manual page for flock(2) for details (On some systems, this\n"
+"function is emulated using fcntl()).");
+
+#define FCNTL_FLOCK_METHODDEF \
+ {"flock", _PyCFunction_CAST(fcntl_flock), METH_FASTCALL, fcntl_flock__doc__},
+
+static PyObject *
+fcntl_flock_impl(PyObject *module, int fd, int code);
+
+static PyObject *
+fcntl_flock(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int code;
+
+ if (!_PyArg_CheckPositional("flock", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ code = _PyLong_AsInt(args[1]);
+ if (code == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = fcntl_flock_impl(module, fd, code);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(fcntl_lockf__doc__,
+"lockf($module, fd, cmd, len=0, start=0, whence=0, /)\n"
+"--\n"
+"\n"
+"A wrapper around the fcntl() locking calls.\n"
+"\n"
+"`fd` is the file descriptor of the file to lock or unlock, and operation is one\n"
+"of the following values:\n"
+"\n"
+" LOCK_UN - unlock\n"
+" LOCK_SH - acquire a shared lock\n"
+" LOCK_EX - acquire an exclusive lock\n"
+"\n"
+"When operation is LOCK_SH or LOCK_EX, it can also be bitwise ORed with\n"
+"LOCK_NB to avoid blocking on lock acquisition. If LOCK_NB is used and the\n"
+"lock cannot be acquired, an OSError will be raised and the exception will\n"
+"have an errno attribute set to EACCES or EAGAIN (depending on the operating\n"
+"system -- for portability, check for either value).\n"
+"\n"
+"`len` is the number of bytes to lock, with the default meaning to lock to\n"
+"EOF. `start` is the byte offset, relative to `whence`, to that the lock\n"
+"starts. `whence` is as with fileobj.seek(), specifically:\n"
+"\n"
+" 0 - relative to the start of the file (SEEK_SET)\n"
+" 1 - relative to the current buffer position (SEEK_CUR)\n"
+" 2 - relative to the end of the file (SEEK_END)");
+
+#define FCNTL_LOCKF_METHODDEF \
+ {"lockf", _PyCFunction_CAST(fcntl_lockf), METH_FASTCALL, fcntl_lockf__doc__},
+
+static PyObject *
+fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
+ PyObject *startobj, int whence);
+
+static PyObject *
+fcntl_lockf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int code;
+ PyObject *lenobj = NULL;
+ PyObject *startobj = NULL;
+ int whence = 0;
+
+ if (!_PyArg_CheckPositional("lockf", nargs, 2, 5)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ code = _PyLong_AsInt(args[1]);
+ if (code == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ lenobj = args[2];
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ startobj = args[3];
+ if (nargs < 5) {
+ goto skip_optional;
+ }
+ whence = _PyLong_AsInt(args[4]);
+ if (whence == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = fcntl_lockf_impl(module, fd, code, lenobj, startobj, whence);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=1db859412172dd53 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/gcmodule.c.h b/contrib/tools/python3/Modules/clinic/gcmodule.c.h
new file mode 100644
index 00000000000..2d18e2ee097
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/gcmodule.c.h
@@ -0,0 +1,427 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(gc_enable__doc__,
+"enable($module, /)\n"
+"--\n"
+"\n"
+"Enable automatic garbage collection.");
+
+#define GC_ENABLE_METHODDEF \
+ {"enable", (PyCFunction)gc_enable, METH_NOARGS, gc_enable__doc__},
+
+static PyObject *
+gc_enable_impl(PyObject *module);
+
+static PyObject *
+gc_enable(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_enable_impl(module);
+}
+
+PyDoc_STRVAR(gc_disable__doc__,
+"disable($module, /)\n"
+"--\n"
+"\n"
+"Disable automatic garbage collection.");
+
+#define GC_DISABLE_METHODDEF \
+ {"disable", (PyCFunction)gc_disable, METH_NOARGS, gc_disable__doc__},
+
+static PyObject *
+gc_disable_impl(PyObject *module);
+
+static PyObject *
+gc_disable(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_disable_impl(module);
+}
+
+PyDoc_STRVAR(gc_isenabled__doc__,
+"isenabled($module, /)\n"
+"--\n"
+"\n"
+"Returns true if automatic garbage collection is enabled.");
+
+#define GC_ISENABLED_METHODDEF \
+ {"isenabled", (PyCFunction)gc_isenabled, METH_NOARGS, gc_isenabled__doc__},
+
+static int
+gc_isenabled_impl(PyObject *module);
+
+static PyObject *
+gc_isenabled(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = gc_isenabled_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_collect__doc__,
+"collect($module, /, generation=2)\n"
+"--\n"
+"\n"
+"Run the garbage collector.\n"
+"\n"
+"With no arguments, run a full collection. The optional argument\n"
+"may be an integer specifying which generation to collect. A ValueError\n"
+"is raised if the generation number is invalid.\n"
+"\n"
+"The number of unreachable objects is returned.");
+
+#define GC_COLLECT_METHODDEF \
+ {"collect", _PyCFunction_CAST(gc_collect), METH_FASTCALL|METH_KEYWORDS, gc_collect__doc__},
+
+static Py_ssize_t
+gc_collect_impl(PyObject *module, int generation);
+
+static PyObject *
+gc_collect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(generation), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"generation", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "collect",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int generation = NUM_GENERATIONS - 1;
+ Py_ssize_t _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ generation = _PyLong_AsInt(args[0]);
+ if (generation == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ _return_value = gc_collect_impl(module, generation);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_set_debug__doc__,
+"set_debug($module, flags, /)\n"
+"--\n"
+"\n"
+"Set the garbage collection debugging flags.\n"
+"\n"
+" flags\n"
+" An integer that can have the following bits turned on:\n"
+" DEBUG_STATS - Print statistics during collection.\n"
+" DEBUG_COLLECTABLE - Print collectable objects found.\n"
+" DEBUG_UNCOLLECTABLE - Print unreachable but uncollectable objects\n"
+" found.\n"
+" DEBUG_SAVEALL - Save objects to gc.garbage rather than freeing them.\n"
+" DEBUG_LEAK - Debug leaking programs (everything but STATS).\n"
+"\n"
+"Debugging information is written to sys.stderr.");
+
+#define GC_SET_DEBUG_METHODDEF \
+ {"set_debug", (PyCFunction)gc_set_debug, METH_O, gc_set_debug__doc__},
+
+static PyObject *
+gc_set_debug_impl(PyObject *module, int flags);
+
+static PyObject *
+gc_set_debug(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int flags;
+
+ flags = _PyLong_AsInt(arg);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = gc_set_debug_impl(module, flags);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_get_debug__doc__,
+"get_debug($module, /)\n"
+"--\n"
+"\n"
+"Get the garbage collection debugging flags.");
+
+#define GC_GET_DEBUG_METHODDEF \
+ {"get_debug", (PyCFunction)gc_get_debug, METH_NOARGS, gc_get_debug__doc__},
+
+static int
+gc_get_debug_impl(PyObject *module);
+
+static PyObject *
+gc_get_debug(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = gc_get_debug_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_get_threshold__doc__,
+"get_threshold($module, /)\n"
+"--\n"
+"\n"
+"Return the current collection thresholds.");
+
+#define GC_GET_THRESHOLD_METHODDEF \
+ {"get_threshold", (PyCFunction)gc_get_threshold, METH_NOARGS, gc_get_threshold__doc__},
+
+static PyObject *
+gc_get_threshold_impl(PyObject *module);
+
+static PyObject *
+gc_get_threshold(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_threshold_impl(module);
+}
+
+PyDoc_STRVAR(gc_get_count__doc__,
+"get_count($module, /)\n"
+"--\n"
+"\n"
+"Return a three-tuple of the current collection counts.");
+
+#define GC_GET_COUNT_METHODDEF \
+ {"get_count", (PyCFunction)gc_get_count, METH_NOARGS, gc_get_count__doc__},
+
+static PyObject *
+gc_get_count_impl(PyObject *module);
+
+static PyObject *
+gc_get_count(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_count_impl(module);
+}
+
+PyDoc_STRVAR(gc_get_objects__doc__,
+"get_objects($module, /, generation=None)\n"
+"--\n"
+"\n"
+"Return a list of objects tracked by the collector (excluding the list returned).\n"
+"\n"
+" generation\n"
+" Generation to extract the objects from.\n"
+"\n"
+"If generation is not None, return only the objects tracked by the collector\n"
+"that are in that generation.");
+
+#define GC_GET_OBJECTS_METHODDEF \
+ {"get_objects", _PyCFunction_CAST(gc_get_objects), METH_FASTCALL|METH_KEYWORDS, gc_get_objects__doc__},
+
+static PyObject *
+gc_get_objects_impl(PyObject *module, Py_ssize_t generation);
+
+static PyObject *
+gc_get_objects(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(generation), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"generation", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "get_objects",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ Py_ssize_t generation = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (!_Py_convert_optional_to_ssize_t(args[0], &generation)) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = gc_get_objects_impl(module, generation);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_get_stats__doc__,
+"get_stats($module, /)\n"
+"--\n"
+"\n"
+"Return a list of dictionaries containing per-generation statistics.");
+
+#define GC_GET_STATS_METHODDEF \
+ {"get_stats", (PyCFunction)gc_get_stats, METH_NOARGS, gc_get_stats__doc__},
+
+static PyObject *
+gc_get_stats_impl(PyObject *module);
+
+static PyObject *
+gc_get_stats(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_stats_impl(module);
+}
+
+PyDoc_STRVAR(gc_is_tracked__doc__,
+"is_tracked($module, obj, /)\n"
+"--\n"
+"\n"
+"Returns true if the object is tracked by the garbage collector.\n"
+"\n"
+"Simple atomic objects will return false.");
+
+#define GC_IS_TRACKED_METHODDEF \
+ {"is_tracked", (PyCFunction)gc_is_tracked, METH_O, gc_is_tracked__doc__},
+
+PyDoc_STRVAR(gc_is_finalized__doc__,
+"is_finalized($module, obj, /)\n"
+"--\n"
+"\n"
+"Returns true if the object has been already finalized by the GC.");
+
+#define GC_IS_FINALIZED_METHODDEF \
+ {"is_finalized", (PyCFunction)gc_is_finalized, METH_O, gc_is_finalized__doc__},
+
+PyDoc_STRVAR(gc_freeze__doc__,
+"freeze($module, /)\n"
+"--\n"
+"\n"
+"Freeze all current tracked objects and ignore them for future collections.\n"
+"\n"
+"This can be used before a POSIX fork() call to make the gc copy-on-write friendly.\n"
+"Note: collection before a POSIX fork() call may free pages for future allocation\n"
+"which can cause copy-on-write.");
+
+#define GC_FREEZE_METHODDEF \
+ {"freeze", (PyCFunction)gc_freeze, METH_NOARGS, gc_freeze__doc__},
+
+static PyObject *
+gc_freeze_impl(PyObject *module);
+
+static PyObject *
+gc_freeze(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_freeze_impl(module);
+}
+
+PyDoc_STRVAR(gc_unfreeze__doc__,
+"unfreeze($module, /)\n"
+"--\n"
+"\n"
+"Unfreeze all objects in the permanent generation.\n"
+"\n"
+"Put all objects in the permanent generation back into oldest generation.");
+
+#define GC_UNFREEZE_METHODDEF \
+ {"unfreeze", (PyCFunction)gc_unfreeze, METH_NOARGS, gc_unfreeze__doc__},
+
+static PyObject *
+gc_unfreeze_impl(PyObject *module);
+
+static PyObject *
+gc_unfreeze(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_unfreeze_impl(module);
+}
+
+PyDoc_STRVAR(gc_get_freeze_count__doc__,
+"get_freeze_count($module, /)\n"
+"--\n"
+"\n"
+"Return the number of objects in the permanent generation.");
+
+#define GC_GET_FREEZE_COUNT_METHODDEF \
+ {"get_freeze_count", (PyCFunction)gc_get_freeze_count, METH_NOARGS, gc_get_freeze_count__doc__},
+
+static Py_ssize_t
+gc_get_freeze_count_impl(PyObject *module);
+
+static PyObject *
+gc_get_freeze_count(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t _return_value;
+
+ _return_value = gc_get_freeze_count_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=66432ac0e17fd04f input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/grpmodule.c.h b/contrib/tools/python3/Modules/clinic/grpmodule.c.h
new file mode 100644
index 00000000000..4914bc9abd6
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/grpmodule.c.h
@@ -0,0 +1,152 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(grp_getgrgid__doc__,
+"getgrgid($module, /, id)\n"
+"--\n"
+"\n"
+"Return the group database entry for the given numeric group ID.\n"
+"\n"
+"If id is not valid, raise KeyError.");
+
+#define GRP_GETGRGID_METHODDEF \
+ {"getgrgid", _PyCFunction_CAST(grp_getgrgid), METH_FASTCALL|METH_KEYWORDS, grp_getgrgid__doc__},
+
+static PyObject *
+grp_getgrgid_impl(PyObject *module, PyObject *id);
+
+static PyObject *
+grp_getgrgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(id), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"id", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "getgrgid",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *id;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ id = args[0];
+ return_value = grp_getgrgid_impl(module, id);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(grp_getgrnam__doc__,
+"getgrnam($module, /, name)\n"
+"--\n"
+"\n"
+"Return the group database entry for the given group name.\n"
+"\n"
+"If name is not valid, raise KeyError.");
+
+#define GRP_GETGRNAM_METHODDEF \
+ {"getgrnam", _PyCFunction_CAST(grp_getgrnam), METH_FASTCALL|METH_KEYWORDS, grp_getgrnam__doc__},
+
+static PyObject *
+grp_getgrnam_impl(PyObject *module, PyObject *name);
+
+static PyObject *
+grp_getgrnam(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "getgrnam",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *name;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("getgrnam", "argument 'name'", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ name = args[0];
+ return_value = grp_getgrnam_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(grp_getgrall__doc__,
+"getgrall($module, /)\n"
+"--\n"
+"\n"
+"Return a list of all available group entries, in arbitrary order.\n"
+"\n"
+"An entry whose name starts with \'+\' or \'-\' represents an instruction\n"
+"to use YP/NIS and may not be accessible via getgrnam or getgrgid.");
+
+#define GRP_GETGRALL_METHODDEF \
+ {"getgrall", (PyCFunction)grp_getgrall, METH_NOARGS, grp_getgrall__doc__},
+
+static PyObject *
+grp_getgrall_impl(PyObject *module);
+
+static PyObject *
+grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return grp_getgrall_impl(module);
+}
+/*[clinic end generated code: output=0916fdbcdeaf5d7d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h b/contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h
new file mode 100644
index 00000000000..32278bf715a
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/itertoolsmodule.c.h
@@ -0,0 +1,916 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(batched_new__doc__,
+"batched(iterable, n)\n"
+"--\n"
+"\n"
+"Batch data into tuples of length n. The last batch may be shorter than n.\n"
+"\n"
+"Loops over the input iterable and accumulates data into tuples\n"
+"up to size n. The input is consumed lazily, just enough to\n"
+"fill a batch. The result is yielded as soon as a batch is full\n"
+"or when the input iterable is exhausted.\n"
+"\n"
+" >>> for batch in batched(\'ABCDEFG\', 3):\n"
+" ... print(batch)\n"
+" ...\n"
+" (\'A\', \'B\', \'C\')\n"
+" (\'D\', \'E\', \'F\')\n"
+" (\'G\',)");
+
+static PyObject *
+batched_new_impl(PyTypeObject *type, PyObject *iterable, Py_ssize_t n);
+
+static PyObject *
+batched_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(iterable), &_Py_ID(n), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"iterable", "n", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "batched",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ PyObject *iterable;
+ Py_ssize_t n;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 2, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ iterable = fastargs[0];
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(fastargs[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ n = ival;
+ }
+ return_value = batched_new_impl(type, iterable, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pairwise_new__doc__,
+"pairwise(iterable, /)\n"
+"--\n"
+"\n"
+"Return an iterator of overlapping pairs taken from the input iterator.\n"
+"\n"
+" s -> (s0,s1), (s1,s2), (s2, s3), ...");
+
+static PyObject *
+pairwise_new_impl(PyTypeObject *type, PyObject *iterable);
+
+static PyObject *
+pairwise_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->pairwise_type;
+ PyObject *iterable;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("pairwise", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("pairwise", PyTuple_GET_SIZE(args), 1, 1)) {
+ goto exit;
+ }
+ iterable = PyTuple_GET_ITEM(args, 0);
+ return_value = pairwise_new_impl(type, iterable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_groupby__doc__,
+"groupby(iterable, key=None)\n"
+"--\n"
+"\n"
+"make an iterator that returns consecutive keys and groups from the iterable\n"
+"\n"
+" iterable\n"
+" Elements to divide into groups according to the key function.\n"
+" key\n"
+" A function for computing the group category for each element.\n"
+" If the key function is not specified or is None, the element itself\n"
+" is used for grouping.");
+
+static PyObject *
+itertools_groupby_impl(PyTypeObject *type, PyObject *it, PyObject *keyfunc);
+
+static PyObject *
+itertools_groupby(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(iterable), &_Py_ID(key), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"iterable", "key", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "groupby",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *it;
+ PyObject *keyfunc = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ it = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ keyfunc = fastargs[1];
+skip_optional_pos:
+ return_value = itertools_groupby_impl(type, it, keyfunc);
+
+exit:
+ return return_value;
+}
+
+static PyObject *
+itertools__grouper_impl(PyTypeObject *type, PyObject *parent,
+ PyObject *tgtkey);
+
+static PyObject *
+itertools__grouper(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->_grouper_type;
+ PyObject *parent;
+ PyObject *tgtkey;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("_grouper", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("_grouper", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), clinic_state_by_cls()->groupby_type)) {
+ _PyArg_BadArgument("_grouper", "argument 1", (clinic_state_by_cls()->groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0));
+ goto exit;
+ }
+ parent = PyTuple_GET_ITEM(args, 0);
+ tgtkey = PyTuple_GET_ITEM(args, 1);
+ return_value = itertools__grouper_impl(type, parent, tgtkey);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_teedataobject__doc__,
+"teedataobject(iterable, values, next, /)\n"
+"--\n"
+"\n"
+"Data container common to multiple tee objects.");
+
+static PyObject *
+itertools_teedataobject_impl(PyTypeObject *type, PyObject *it,
+ PyObject *values, PyObject *next);
+
+static PyObject *
+itertools_teedataobject(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->teedataobject_type;
+ PyObject *it;
+ PyObject *values;
+ PyObject *next;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("teedataobject", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("teedataobject", PyTuple_GET_SIZE(args), 3, 3)) {
+ goto exit;
+ }
+ it = PyTuple_GET_ITEM(args, 0);
+ if (!PyList_Check(PyTuple_GET_ITEM(args, 1))) {
+ _PyArg_BadArgument("teedataobject", "argument 2", "list", PyTuple_GET_ITEM(args, 1));
+ goto exit;
+ }
+ values = PyTuple_GET_ITEM(args, 1);
+ next = PyTuple_GET_ITEM(args, 2);
+ return_value = itertools_teedataobject_impl(type, it, values, next);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools__tee__doc__,
+"_tee(iterable, /)\n"
+"--\n"
+"\n"
+"Iterator wrapped to make it copyable.");
+
+static PyObject *
+itertools__tee_impl(PyTypeObject *type, PyObject *iterable);
+
+static PyObject *
+itertools__tee(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->tee_type;
+ PyObject *iterable;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("_tee", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("_tee", PyTuple_GET_SIZE(args), 1, 1)) {
+ goto exit;
+ }
+ iterable = PyTuple_GET_ITEM(args, 0);
+ return_value = itertools__tee_impl(type, iterable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_tee__doc__,
+"tee($module, iterable, n=2, /)\n"
+"--\n"
+"\n"
+"Returns a tuple of n independent iterators.");
+
+#define ITERTOOLS_TEE_METHODDEF \
+ {"tee", _PyCFunction_CAST(itertools_tee), METH_FASTCALL, itertools_tee__doc__},
+
+static PyObject *
+itertools_tee_impl(PyObject *module, PyObject *iterable, Py_ssize_t n);
+
+static PyObject *
+itertools_tee(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *iterable;
+ Py_ssize_t n = 2;
+
+ if (!_PyArg_CheckPositional("tee", nargs, 1, 2)) {
+ goto exit;
+ }
+ iterable = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ n = ival;
+ }
+skip_optional:
+ return_value = itertools_tee_impl(module, iterable, n);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_cycle__doc__,
+"cycle(iterable, /)\n"
+"--\n"
+"\n"
+"Return elements from the iterable until it is exhausted. Then repeat the sequence indefinitely.");
+
+static PyObject *
+itertools_cycle_impl(PyTypeObject *type, PyObject *iterable);
+
+static PyObject *
+itertools_cycle(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->cycle_type;
+ PyObject *iterable;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("cycle", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("cycle", PyTuple_GET_SIZE(args), 1, 1)) {
+ goto exit;
+ }
+ iterable = PyTuple_GET_ITEM(args, 0);
+ return_value = itertools_cycle_impl(type, iterable);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_dropwhile__doc__,
+"dropwhile(predicate, iterable, /)\n"
+"--\n"
+"\n"
+"Drop items from the iterable while predicate(item) is true.\n"
+"\n"
+"Afterwards, return every element until the iterable is exhausted.");
+
+static PyObject *
+itertools_dropwhile_impl(PyTypeObject *type, PyObject *func, PyObject *seq);
+
+static PyObject *
+itertools_dropwhile(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->dropwhile_type;
+ PyObject *func;
+ PyObject *seq;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("dropwhile", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("dropwhile", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ func = PyTuple_GET_ITEM(args, 0);
+ seq = PyTuple_GET_ITEM(args, 1);
+ return_value = itertools_dropwhile_impl(type, func, seq);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_takewhile__doc__,
+"takewhile(predicate, iterable, /)\n"
+"--\n"
+"\n"
+"Return successive entries from an iterable as long as the predicate evaluates to true for each entry.");
+
+static PyObject *
+itertools_takewhile_impl(PyTypeObject *type, PyObject *func, PyObject *seq);
+
+static PyObject *
+itertools_takewhile(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->takewhile_type;
+ PyObject *func;
+ PyObject *seq;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("takewhile", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("takewhile", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ func = PyTuple_GET_ITEM(args, 0);
+ seq = PyTuple_GET_ITEM(args, 1);
+ return_value = itertools_takewhile_impl(type, func, seq);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_starmap__doc__,
+"starmap(function, iterable, /)\n"
+"--\n"
+"\n"
+"Return an iterator whose values are returned from the function evaluated with an argument tuple taken from the given sequence.");
+
+static PyObject *
+itertools_starmap_impl(PyTypeObject *type, PyObject *func, PyObject *seq);
+
+static PyObject *
+itertools_starmap(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->starmap_type;
+ PyObject *func;
+ PyObject *seq;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("starmap", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("starmap", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ func = PyTuple_GET_ITEM(args, 0);
+ seq = PyTuple_GET_ITEM(args, 1);
+ return_value = itertools_starmap_impl(type, func, seq);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_chain_from_iterable__doc__,
+"from_iterable($type, iterable, /)\n"
+"--\n"
+"\n"
+"Alternative chain() constructor taking a single iterable argument that evaluates lazily.");
+
+#define ITERTOOLS_CHAIN_FROM_ITERABLE_METHODDEF \
+ {"from_iterable", (PyCFunction)itertools_chain_from_iterable, METH_O|METH_CLASS, itertools_chain_from_iterable__doc__},
+
+PyDoc_STRVAR(itertools_combinations__doc__,
+"combinations(iterable, r)\n"
+"--\n"
+"\n"
+"Return successive r-length combinations of elements in the iterable.\n"
+"\n"
+"combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)");
+
+static PyObject *
+itertools_combinations_impl(PyTypeObject *type, PyObject *iterable,
+ Py_ssize_t r);
+
+static PyObject *
+itertools_combinations(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(iterable), &_Py_ID(r), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"iterable", "r", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "combinations",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ PyObject *iterable;
+ Py_ssize_t r;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 2, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ iterable = fastargs[0];
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(fastargs[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ r = ival;
+ }
+ return_value = itertools_combinations_impl(type, iterable, r);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_combinations_with_replacement__doc__,
+"combinations_with_replacement(iterable, r)\n"
+"--\n"
+"\n"
+"Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.\n"
+"\n"
+"combinations_with_replacement(\'ABC\', 2) --> (\'A\',\'A\'), (\'A\',\'B\'), (\'A\',\'C\'), (\'B\',\'B\'), (\'B\',\'C\'), (\'C\',\'C\')");
+
+static PyObject *
+itertools_combinations_with_replacement_impl(PyTypeObject *type,
+ PyObject *iterable,
+ Py_ssize_t r);
+
+static PyObject *
+itertools_combinations_with_replacement(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(iterable), &_Py_ID(r), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"iterable", "r", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "combinations_with_replacement",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ PyObject *iterable;
+ Py_ssize_t r;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 2, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ iterable = fastargs[0];
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(fastargs[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ r = ival;
+ }
+ return_value = itertools_combinations_with_replacement_impl(type, iterable, r);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_permutations__doc__,
+"permutations(iterable, r=None)\n"
+"--\n"
+"\n"
+"Return successive r-length permutations of elements in the iterable.\n"
+"\n"
+"permutations(range(3), 2) --> (0,1), (0,2), (1,0), (1,2), (2,0), (2,1)");
+
+static PyObject *
+itertools_permutations_impl(PyTypeObject *type, PyObject *iterable,
+ PyObject *robj);
+
+static PyObject *
+itertools_permutations(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(iterable), &_Py_ID(r), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"iterable", "r", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "permutations",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *iterable;
+ PyObject *robj = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ iterable = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ robj = fastargs[1];
+skip_optional_pos:
+ return_value = itertools_permutations_impl(type, iterable, robj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_accumulate__doc__,
+"accumulate(iterable, func=None, *, initial=None)\n"
+"--\n"
+"\n"
+"Return series of accumulated sums (or other binary function results).");
+
+static PyObject *
+itertools_accumulate_impl(PyTypeObject *type, PyObject *iterable,
+ PyObject *binop, PyObject *initial);
+
+static PyObject *
+itertools_accumulate(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(iterable), &_Py_ID(func), &_Py_ID(initial), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"iterable", "func", "initial", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "accumulate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
+ PyObject *iterable;
+ PyObject *binop = Py_None;
+ PyObject *initial = Py_None;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ iterable = fastargs[0];
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[1]) {
+ binop = fastargs[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ initial = fastargs[2];
+skip_optional_kwonly:
+ return_value = itertools_accumulate_impl(type, iterable, binop, initial);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_compress__doc__,
+"compress(data, selectors)\n"
+"--\n"
+"\n"
+"Return data elements corresponding to true selector elements.\n"
+"\n"
+"Forms a shorter iterator from selected data elements using the selectors to\n"
+"choose the data elements.");
+
+static PyObject *
+itertools_compress_impl(PyTypeObject *type, PyObject *seq1, PyObject *seq2);
+
+static PyObject *
+itertools_compress(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(selectors), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "selectors", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "compress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ PyObject *seq1;
+ PyObject *seq2;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 2, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ seq1 = fastargs[0];
+ seq2 = fastargs[1];
+ return_value = itertools_compress_impl(type, seq1, seq2);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_filterfalse__doc__,
+"filterfalse(function, iterable, /)\n"
+"--\n"
+"\n"
+"Return those items of iterable for which function(item) is false.\n"
+"\n"
+"If function is None, return the items that are false.");
+
+static PyObject *
+itertools_filterfalse_impl(PyTypeObject *type, PyObject *func, PyObject *seq);
+
+static PyObject *
+itertools_filterfalse(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = clinic_state()->filterfalse_type;
+ PyObject *func;
+ PyObject *seq;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("filterfalse", kwargs)) {
+ goto exit;
+ }
+ if (!_PyArg_CheckPositional("filterfalse", PyTuple_GET_SIZE(args), 2, 2)) {
+ goto exit;
+ }
+ func = PyTuple_GET_ITEM(args, 0);
+ seq = PyTuple_GET_ITEM(args, 1);
+ return_value = itertools_filterfalse_impl(type, func, seq);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(itertools_count__doc__,
+"count(start=0, step=1)\n"
+"--\n"
+"\n"
+"Return a count object whose .__next__() method returns consecutive values.\n"
+"\n"
+"Equivalent to:\n"
+" def count(firstval=0, step=1):\n"
+" x = firstval\n"
+" while 1:\n"
+" yield x\n"
+" x += step");
+
+static PyObject *
+itertools_count_impl(PyTypeObject *type, PyObject *long_cnt,
+ PyObject *long_step);
+
+static PyObject *
+itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(start), &_Py_ID(step), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"start", "step", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "count",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *long_cnt = NULL;
+ PyObject *long_step = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[0]) {
+ long_cnt = fastargs[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ long_step = fastargs[1];
+skip_optional_pos:
+ return_value = itertools_count_impl(type, long_cnt, long_step);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=111cbd102c2a23c9 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/mathmodule.c.h b/contrib/tools/python3/Modules/clinic/mathmodule.c.h
new file mode 100644
index 00000000000..c16c1b08398
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/mathmodule.c.h
@@ -0,0 +1,953 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(math_ceil__doc__,
+"ceil($module, x, /)\n"
+"--\n"
+"\n"
+"Return the ceiling of x as an Integral.\n"
+"\n"
+"This is the smallest integer >= x.");
+
+#define MATH_CEIL_METHODDEF \
+ {"ceil", (PyCFunction)math_ceil, METH_O, math_ceil__doc__},
+
+PyDoc_STRVAR(math_floor__doc__,
+"floor($module, x, /)\n"
+"--\n"
+"\n"
+"Return the floor of x as an Integral.\n"
+"\n"
+"This is the largest integer <= x.");
+
+#define MATH_FLOOR_METHODDEF \
+ {"floor", (PyCFunction)math_floor, METH_O, math_floor__doc__},
+
+PyDoc_STRVAR(math_fsum__doc__,
+"fsum($module, seq, /)\n"
+"--\n"
+"\n"
+"Return an accurate floating point sum of values in the iterable seq.\n"
+"\n"
+"Assumes IEEE-754 floating point arithmetic.");
+
+#define MATH_FSUM_METHODDEF \
+ {"fsum", (PyCFunction)math_fsum, METH_O, math_fsum__doc__},
+
+PyDoc_STRVAR(math_isqrt__doc__,
+"isqrt($module, n, /)\n"
+"--\n"
+"\n"
+"Return the integer part of the square root of the input.");
+
+#define MATH_ISQRT_METHODDEF \
+ {"isqrt", (PyCFunction)math_isqrt, METH_O, math_isqrt__doc__},
+
+PyDoc_STRVAR(math_factorial__doc__,
+"factorial($module, n, /)\n"
+"--\n"
+"\n"
+"Find n!.\n"
+"\n"
+"Raise a ValueError if x is negative or non-integral.");
+
+#define MATH_FACTORIAL_METHODDEF \
+ {"factorial", (PyCFunction)math_factorial, METH_O, math_factorial__doc__},
+
+PyDoc_STRVAR(math_trunc__doc__,
+"trunc($module, x, /)\n"
+"--\n"
+"\n"
+"Truncates the Real x to the nearest Integral toward 0.\n"
+"\n"
+"Uses the __trunc__ magic method.");
+
+#define MATH_TRUNC_METHODDEF \
+ {"trunc", (PyCFunction)math_trunc, METH_O, math_trunc__doc__},
+
+PyDoc_STRVAR(math_frexp__doc__,
+"frexp($module, x, /)\n"
+"--\n"
+"\n"
+"Return the mantissa and exponent of x, as pair (m, e).\n"
+"\n"
+"m is a float and e is an int, such that x = m * 2.**e.\n"
+"If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.");
+
+#define MATH_FREXP_METHODDEF \
+ {"frexp", (PyCFunction)math_frexp, METH_O, math_frexp__doc__},
+
+static PyObject *
+math_frexp_impl(PyObject *module, double x);
+
+static PyObject *
+math_frexp(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_frexp_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_ldexp__doc__,
+"ldexp($module, x, i, /)\n"
+"--\n"
+"\n"
+"Return x * (2**i).\n"
+"\n"
+"This is essentially the inverse of frexp().");
+
+#define MATH_LDEXP_METHODDEF \
+ {"ldexp", _PyCFunction_CAST(math_ldexp), METH_FASTCALL, math_ldexp__doc__},
+
+static PyObject *
+math_ldexp_impl(PyObject *module, double x, PyObject *i);
+
+static PyObject *
+math_ldexp(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ double x;
+ PyObject *i;
+
+ if (!_PyArg_CheckPositional("ldexp", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ x = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(args[0]);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ i = args[1];
+ return_value = math_ldexp_impl(module, x, i);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_modf__doc__,
+"modf($module, x, /)\n"
+"--\n"
+"\n"
+"Return the fractional and integer parts of x.\n"
+"\n"
+"Both results carry the sign of x and are floats.");
+
+#define MATH_MODF_METHODDEF \
+ {"modf", (PyCFunction)math_modf, METH_O, math_modf__doc__},
+
+static PyObject *
+math_modf_impl(PyObject *module, double x);
+
+static PyObject *
+math_modf(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_modf_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_log2__doc__,
+"log2($module, x, /)\n"
+"--\n"
+"\n"
+"Return the base 2 logarithm of x.");
+
+#define MATH_LOG2_METHODDEF \
+ {"log2", (PyCFunction)math_log2, METH_O, math_log2__doc__},
+
+PyDoc_STRVAR(math_log10__doc__,
+"log10($module, x, /)\n"
+"--\n"
+"\n"
+"Return the base 10 logarithm of x.");
+
+#define MATH_LOG10_METHODDEF \
+ {"log10", (PyCFunction)math_log10, METH_O, math_log10__doc__},
+
+PyDoc_STRVAR(math_fmod__doc__,
+"fmod($module, x, y, /)\n"
+"--\n"
+"\n"
+"Return fmod(x, y), according to platform C.\n"
+"\n"
+"x % y may differ.");
+
+#define MATH_FMOD_METHODDEF \
+ {"fmod", _PyCFunction_CAST(math_fmod), METH_FASTCALL, math_fmod__doc__},
+
+static PyObject *
+math_fmod_impl(PyObject *module, double x, double y);
+
+static PyObject *
+math_fmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ double x;
+ double y;
+
+ if (!_PyArg_CheckPositional("fmod", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ x = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(args[0]);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ y = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ y = PyFloat_AsDouble(args[1]);
+ if (y == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_fmod_impl(module, x, y);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_dist__doc__,
+"dist($module, p, q, /)\n"
+"--\n"
+"\n"
+"Return the Euclidean distance between two points p and q.\n"
+"\n"
+"The points should be specified as sequences (or iterables) of\n"
+"coordinates. Both inputs must have the same dimension.\n"
+"\n"
+"Roughly equivalent to:\n"
+" sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))");
+
+#define MATH_DIST_METHODDEF \
+ {"dist", _PyCFunction_CAST(math_dist), METH_FASTCALL, math_dist__doc__},
+
+static PyObject *
+math_dist_impl(PyObject *module, PyObject *p, PyObject *q);
+
+static PyObject *
+math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *p;
+ PyObject *q;
+
+ if (!_PyArg_CheckPositional("dist", nargs, 2, 2)) {
+ goto exit;
+ }
+ p = args[0];
+ q = args[1];
+ return_value = math_dist_impl(module, p, q);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_sumprod__doc__,
+"sumprod($module, p, q, /)\n"
+"--\n"
+"\n"
+"Return the sum of products of values from two iterables p and q.\n"
+"\n"
+"Roughly equivalent to:\n"
+"\n"
+" sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))\n"
+"\n"
+"For float and mixed int/float inputs, the intermediate products\n"
+"and sums are computed with extended precision.");
+
+#define MATH_SUMPROD_METHODDEF \
+ {"sumprod", _PyCFunction_CAST(math_sumprod), METH_FASTCALL, math_sumprod__doc__},
+
+static PyObject *
+math_sumprod_impl(PyObject *module, PyObject *p, PyObject *q);
+
+static PyObject *
+math_sumprod(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *p;
+ PyObject *q;
+
+ if (!_PyArg_CheckPositional("sumprod", nargs, 2, 2)) {
+ goto exit;
+ }
+ p = args[0];
+ q = args[1];
+ return_value = math_sumprod_impl(module, p, q);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_pow__doc__,
+"pow($module, x, y, /)\n"
+"--\n"
+"\n"
+"Return x**y (x to the power of y).");
+
+#define MATH_POW_METHODDEF \
+ {"pow", _PyCFunction_CAST(math_pow), METH_FASTCALL, math_pow__doc__},
+
+static PyObject *
+math_pow_impl(PyObject *module, double x, double y);
+
+static PyObject *
+math_pow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ double x;
+ double y;
+
+ if (!_PyArg_CheckPositional("pow", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ x = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(args[0]);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ y = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ y = PyFloat_AsDouble(args[1]);
+ if (y == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_pow_impl(module, x, y);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_degrees__doc__,
+"degrees($module, x, /)\n"
+"--\n"
+"\n"
+"Convert angle x from radians to degrees.");
+
+#define MATH_DEGREES_METHODDEF \
+ {"degrees", (PyCFunction)math_degrees, METH_O, math_degrees__doc__},
+
+static PyObject *
+math_degrees_impl(PyObject *module, double x);
+
+static PyObject *
+math_degrees(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_degrees_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_radians__doc__,
+"radians($module, x, /)\n"
+"--\n"
+"\n"
+"Convert angle x from degrees to radians.");
+
+#define MATH_RADIANS_METHODDEF \
+ {"radians", (PyCFunction)math_radians, METH_O, math_radians__doc__},
+
+static PyObject *
+math_radians_impl(PyObject *module, double x);
+
+static PyObject *
+math_radians(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_radians_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isfinite__doc__,
+"isfinite($module, x, /)\n"
+"--\n"
+"\n"
+"Return True if x is neither an infinity nor a NaN, and False otherwise.");
+
+#define MATH_ISFINITE_METHODDEF \
+ {"isfinite", (PyCFunction)math_isfinite, METH_O, math_isfinite__doc__},
+
+static PyObject *
+math_isfinite_impl(PyObject *module, double x);
+
+static PyObject *
+math_isfinite(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_isfinite_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isnan__doc__,
+"isnan($module, x, /)\n"
+"--\n"
+"\n"
+"Return True if x is a NaN (not a number), and False otherwise.");
+
+#define MATH_ISNAN_METHODDEF \
+ {"isnan", (PyCFunction)math_isnan, METH_O, math_isnan__doc__},
+
+static PyObject *
+math_isnan_impl(PyObject *module, double x);
+
+static PyObject *
+math_isnan(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_isnan_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isinf__doc__,
+"isinf($module, x, /)\n"
+"--\n"
+"\n"
+"Return True if x is a positive or negative infinity, and False otherwise.");
+
+#define MATH_ISINF_METHODDEF \
+ {"isinf", (PyCFunction)math_isinf, METH_O, math_isinf__doc__},
+
+static PyObject *
+math_isinf_impl(PyObject *module, double x);
+
+static PyObject *
+math_isinf(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ return_value = math_isinf_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isclose__doc__,
+"isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)\n"
+"--\n"
+"\n"
+"Determine whether two floating point numbers are close in value.\n"
+"\n"
+" rel_tol\n"
+" maximum difference for being considered \"close\", relative to the\n"
+" magnitude of the input values\n"
+" abs_tol\n"
+" maximum difference for being considered \"close\", regardless of the\n"
+" magnitude of the input values\n"
+"\n"
+"Return True if a is close in value to b, and False otherwise.\n"
+"\n"
+"For the values to be considered close, the difference between them\n"
+"must be smaller than at least one of the tolerances.\n"
+"\n"
+"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That\n"
+"is, NaN is not close to anything, even itself. inf and -inf are\n"
+"only close to themselves.");
+
+#define MATH_ISCLOSE_METHODDEF \
+ {"isclose", _PyCFunction_CAST(math_isclose), METH_FASTCALL|METH_KEYWORDS, math_isclose__doc__},
+
+static int
+math_isclose_impl(PyObject *module, double a, double b, double rel_tol,
+ double abs_tol);
+
+static PyObject *
+math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(a), &_Py_ID(b), &_Py_ID(rel_tol), &_Py_ID(abs_tol), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "isclose",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ double a;
+ double b;
+ double rel_tol = 1e-09;
+ double abs_tol = 0.0;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ a = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ a = PyFloat_AsDouble(args[0]);
+ if (a == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ b = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ b = PyFloat_AsDouble(args[1]);
+ if (b == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (PyFloat_CheckExact(args[2])) {
+ rel_tol = PyFloat_AS_DOUBLE(args[2]);
+ }
+ else
+ {
+ rel_tol = PyFloat_AsDouble(args[2]);
+ if (rel_tol == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (PyFloat_CheckExact(args[3])) {
+ abs_tol = PyFloat_AS_DOUBLE(args[3]);
+ }
+ else
+ {
+ abs_tol = PyFloat_AsDouble(args[3]);
+ if (abs_tol == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+skip_optional_kwonly:
+ _return_value = math_isclose_impl(module, a, b, rel_tol, abs_tol);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_prod__doc__,
+"prod($module, iterable, /, *, start=1)\n"
+"--\n"
+"\n"
+"Calculate the product of all the elements in the input iterable.\n"
+"\n"
+"The default start value for the product is 1.\n"
+"\n"
+"When the iterable is empty, return the start value. This function is\n"
+"intended specifically for use with numeric values and may reject\n"
+"non-numeric types.");
+
+#define MATH_PROD_METHODDEF \
+ {"prod", _PyCFunction_CAST(math_prod), METH_FASTCALL|METH_KEYWORDS, math_prod__doc__},
+
+static PyObject *
+math_prod_impl(PyObject *module, PyObject *iterable, PyObject *start);
+
+static PyObject *
+math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(start), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "start", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "prod",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *iterable;
+ PyObject *start = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ iterable = args[0];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ start = args[1];
+skip_optional_kwonly:
+ return_value = math_prod_impl(module, iterable, start);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_perm__doc__,
+"perm($module, n, k=None, /)\n"
+"--\n"
+"\n"
+"Number of ways to choose k items from n items without repetition and with order.\n"
+"\n"
+"Evaluates to n! / (n - k)! when k <= n and evaluates\n"
+"to zero when k > n.\n"
+"\n"
+"If k is not specified or is None, then k defaults to n\n"
+"and the function returns n!.\n"
+"\n"
+"Raises TypeError if either of the arguments are not integers.\n"
+"Raises ValueError if either of the arguments are negative.");
+
+#define MATH_PERM_METHODDEF \
+ {"perm", _PyCFunction_CAST(math_perm), METH_FASTCALL, math_perm__doc__},
+
+static PyObject *
+math_perm_impl(PyObject *module, PyObject *n, PyObject *k);
+
+static PyObject *
+math_perm(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *n;
+ PyObject *k = Py_None;
+
+ if (!_PyArg_CheckPositional("perm", nargs, 1, 2)) {
+ goto exit;
+ }
+ n = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ k = args[1];
+skip_optional:
+ return_value = math_perm_impl(module, n, k);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_comb__doc__,
+"comb($module, n, k, /)\n"
+"--\n"
+"\n"
+"Number of ways to choose k items from n items without repetition and without order.\n"
+"\n"
+"Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates\n"
+"to zero when k > n.\n"
+"\n"
+"Also called the binomial coefficient because it is equivalent\n"
+"to the coefficient of k-th term in polynomial expansion of the\n"
+"expression (1 + x)**n.\n"
+"\n"
+"Raises TypeError if either of the arguments are not integers.\n"
+"Raises ValueError if either of the arguments are negative.");
+
+#define MATH_COMB_METHODDEF \
+ {"comb", _PyCFunction_CAST(math_comb), METH_FASTCALL, math_comb__doc__},
+
+static PyObject *
+math_comb_impl(PyObject *module, PyObject *n, PyObject *k);
+
+static PyObject *
+math_comb(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *n;
+ PyObject *k;
+
+ if (!_PyArg_CheckPositional("comb", nargs, 2, 2)) {
+ goto exit;
+ }
+ n = args[0];
+ k = args[1];
+ return_value = math_comb_impl(module, n, k);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_nextafter__doc__,
+"nextafter($module, x, y, /, *, steps=None)\n"
+"--\n"
+"\n"
+"Return the floating-point value the given number of steps after x towards y.\n"
+"\n"
+"If steps is not specified or is None, it defaults to 1.\n"
+"\n"
+"Raises a TypeError, if x or y is not a double, or if steps is not an integer.\n"
+"Raises ValueError if steps is negative.");
+
+#define MATH_NEXTAFTER_METHODDEF \
+ {"nextafter", _PyCFunction_CAST(math_nextafter), METH_FASTCALL|METH_KEYWORDS, math_nextafter__doc__},
+
+static PyObject *
+math_nextafter_impl(PyObject *module, double x, double y, PyObject *steps);
+
+static PyObject *
+math_nextafter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(steps), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "", "steps", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "nextafter",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ double x;
+ double y;
+ PyObject *steps = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyFloat_CheckExact(args[0])) {
+ x = PyFloat_AS_DOUBLE(args[0]);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(args[0]);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (PyFloat_CheckExact(args[1])) {
+ y = PyFloat_AS_DOUBLE(args[1]);
+ }
+ else
+ {
+ y = PyFloat_AsDouble(args[1]);
+ if (y == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ steps = args[2];
+skip_optional_kwonly:
+ return_value = math_nextafter_impl(module, x, y, steps);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_ulp__doc__,
+"ulp($module, x, /)\n"
+"--\n"
+"\n"
+"Return the value of the least significant bit of the float x.");
+
+#define MATH_ULP_METHODDEF \
+ {"ulp", (PyCFunction)math_ulp, METH_O, math_ulp__doc__},
+
+static double
+math_ulp_impl(PyObject *module, double x);
+
+static PyObject *
+math_ulp(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+ double _return_value;
+
+ if (PyFloat_CheckExact(arg)) {
+ x = PyFloat_AS_DOUBLE(arg);
+ }
+ else
+ {
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ goto exit;
+ }
+ }
+ _return_value = math_ulp_impl(module, x);
+ if ((_return_value == -1.0) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyFloat_FromDouble(_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=91a0357265a2a553 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/md5module.c.h b/contrib/tools/python3/Modules/clinic/md5module.c.h
new file mode 100644
index 00000000000..eb2ed49e9ef
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/md5module.c.h
@@ -0,0 +1,151 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(MD5Type_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define MD5TYPE_COPY_METHODDEF \
+ {"copy", _PyCFunction_CAST(MD5Type_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, MD5Type_copy__doc__},
+
+static PyObject *
+MD5Type_copy_impl(MD5object *self, PyTypeObject *cls);
+
+static PyObject *
+MD5Type_copy(MD5object *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
+ return NULL;
+ }
+ return MD5Type_copy_impl(self, cls);
+}
+
+PyDoc_STRVAR(MD5Type_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define MD5TYPE_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)MD5Type_digest, METH_NOARGS, MD5Type_digest__doc__},
+
+static PyObject *
+MD5Type_digest_impl(MD5object *self);
+
+static PyObject *
+MD5Type_digest(MD5object *self, PyObject *Py_UNUSED(ignored))
+{
+ return MD5Type_digest_impl(self);
+}
+
+PyDoc_STRVAR(MD5Type_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define MD5TYPE_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)MD5Type_hexdigest, METH_NOARGS, MD5Type_hexdigest__doc__},
+
+static PyObject *
+MD5Type_hexdigest_impl(MD5object *self);
+
+static PyObject *
+MD5Type_hexdigest(MD5object *self, PyObject *Py_UNUSED(ignored))
+{
+ return MD5Type_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(MD5Type_update__doc__,
+"update($self, obj, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided string.");
+
+#define MD5TYPE_UPDATE_METHODDEF \
+ {"update", (PyCFunction)MD5Type_update, METH_O, MD5Type_update__doc__},
+
+PyDoc_STRVAR(_md5_md5__doc__,
+"md5($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new MD5 hash object; optionally initialized with a string.");
+
+#define _MD5_MD5_METHODDEF \
+ {"md5", _PyCFunction_CAST(_md5_md5), METH_FASTCALL|METH_KEYWORDS, _md5_md5__doc__},
+
+static PyObject *
+_md5_md5_impl(PyObject *module, PyObject *string, int usedforsecurity);
+
+static PyObject *
+_md5_md5(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "md5",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *string = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ string = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _md5_md5_impl(module, string, usedforsecurity);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=d0082f6ba5dda0c6 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/overlapped.c.h b/contrib/tools/python3/Modules/clinic/overlapped.c.h
new file mode 100644
index 00000000000..9d9f2cbf6af
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/overlapped.c.h
@@ -0,0 +1,1265 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_overlapped_CreateIoCompletionPort__doc__,
+"CreateIoCompletionPort($module, handle, port, key, concurrency, /)\n"
+"--\n"
+"\n"
+"Create a completion port or register a handle with a port.");
+
+#define _OVERLAPPED_CREATEIOCOMPLETIONPORT_METHODDEF \
+ {"CreateIoCompletionPort", _PyCFunction_CAST(_overlapped_CreateIoCompletionPort), METH_FASTCALL, _overlapped_CreateIoCompletionPort__doc__},
+
+static PyObject *
+_overlapped_CreateIoCompletionPort_impl(PyObject *module, HANDLE FileHandle,
+ HANDLE ExistingCompletionPort,
+ ULONG_PTR CompletionKey,
+ DWORD NumberOfConcurrentThreads);
+
+static PyObject *
+_overlapped_CreateIoCompletionPort(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE FileHandle;
+ HANDLE ExistingCompletionPort;
+ ULONG_PTR CompletionKey;
+ DWORD NumberOfConcurrentThreads;
+
+ if (!_PyArg_CheckPositional("CreateIoCompletionPort", nargs, 4, 4)) {
+ goto exit;
+ }
+ FileHandle = PyLong_AsVoidPtr(args[0]);
+ if (!FileHandle && PyErr_Occurred()) {
+ goto exit;
+ }
+ ExistingCompletionPort = PyLong_AsVoidPtr(args[1]);
+ if (!ExistingCompletionPort && PyErr_Occurred()) {
+ goto exit;
+ }
+ CompletionKey = (uintptr_t)PyLong_AsVoidPtr(args[2]);
+ if (!CompletionKey && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[3], &NumberOfConcurrentThreads)) {
+ goto exit;
+ }
+ return_value = _overlapped_CreateIoCompletionPort_impl(module, FileHandle, ExistingCompletionPort, CompletionKey, NumberOfConcurrentThreads);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_GetQueuedCompletionStatus__doc__,
+"GetQueuedCompletionStatus($module, port, msecs, /)\n"
+"--\n"
+"\n"
+"Get a message from completion port.\n"
+"\n"
+"Wait for up to msecs milliseconds.");
+
+#define _OVERLAPPED_GETQUEUEDCOMPLETIONSTATUS_METHODDEF \
+ {"GetQueuedCompletionStatus", _PyCFunction_CAST(_overlapped_GetQueuedCompletionStatus), METH_FASTCALL, _overlapped_GetQueuedCompletionStatus__doc__},
+
+static PyObject *
+_overlapped_GetQueuedCompletionStatus_impl(PyObject *module,
+ HANDLE CompletionPort,
+ DWORD Milliseconds);
+
+static PyObject *
+_overlapped_GetQueuedCompletionStatus(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE CompletionPort;
+ DWORD Milliseconds;
+
+ if (!_PyArg_CheckPositional("GetQueuedCompletionStatus", nargs, 2, 2)) {
+ goto exit;
+ }
+ CompletionPort = PyLong_AsVoidPtr(args[0]);
+ if (!CompletionPort && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[1], &Milliseconds)) {
+ goto exit;
+ }
+ return_value = _overlapped_GetQueuedCompletionStatus_impl(module, CompletionPort, Milliseconds);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_PostQueuedCompletionStatus__doc__,
+"PostQueuedCompletionStatus($module, port, bytes, key, address, /)\n"
+"--\n"
+"\n"
+"Post a message to completion port.");
+
+#define _OVERLAPPED_POSTQUEUEDCOMPLETIONSTATUS_METHODDEF \
+ {"PostQueuedCompletionStatus", _PyCFunction_CAST(_overlapped_PostQueuedCompletionStatus), METH_FASTCALL, _overlapped_PostQueuedCompletionStatus__doc__},
+
+static PyObject *
+_overlapped_PostQueuedCompletionStatus_impl(PyObject *module,
+ HANDLE CompletionPort,
+ DWORD NumberOfBytes,
+ ULONG_PTR CompletionKey,
+ OVERLAPPED *Overlapped);
+
+static PyObject *
+_overlapped_PostQueuedCompletionStatus(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE CompletionPort;
+ DWORD NumberOfBytes;
+ ULONG_PTR CompletionKey;
+ OVERLAPPED *Overlapped;
+
+ if (!_PyArg_CheckPositional("PostQueuedCompletionStatus", nargs, 4, 4)) {
+ goto exit;
+ }
+ CompletionPort = PyLong_AsVoidPtr(args[0]);
+ if (!CompletionPort && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[1], &NumberOfBytes)) {
+ goto exit;
+ }
+ CompletionKey = (uintptr_t)PyLong_AsVoidPtr(args[2]);
+ if (!CompletionKey && PyErr_Occurred()) {
+ goto exit;
+ }
+ Overlapped = PyLong_AsVoidPtr(args[3]);
+ if (!Overlapped && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_PostQueuedCompletionStatus_impl(module, CompletionPort, NumberOfBytes, CompletionKey, Overlapped);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_RegisterWaitWithQueue__doc__,
+"RegisterWaitWithQueue($module, Object, CompletionPort, Overlapped,\n"
+" Timeout, /)\n"
+"--\n"
+"\n"
+"Register wait for Object; when complete CompletionPort is notified.");
+
+#define _OVERLAPPED_REGISTERWAITWITHQUEUE_METHODDEF \
+ {"RegisterWaitWithQueue", _PyCFunction_CAST(_overlapped_RegisterWaitWithQueue), METH_FASTCALL, _overlapped_RegisterWaitWithQueue__doc__},
+
+static PyObject *
+_overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object,
+ HANDLE CompletionPort,
+ OVERLAPPED *Overlapped,
+ DWORD Milliseconds);
+
+static PyObject *
+_overlapped_RegisterWaitWithQueue(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE Object;
+ HANDLE CompletionPort;
+ OVERLAPPED *Overlapped;
+ DWORD Milliseconds;
+
+ if (!_PyArg_CheckPositional("RegisterWaitWithQueue", nargs, 4, 4)) {
+ goto exit;
+ }
+ Object = PyLong_AsVoidPtr(args[0]);
+ if (!Object && PyErr_Occurred()) {
+ goto exit;
+ }
+ CompletionPort = PyLong_AsVoidPtr(args[1]);
+ if (!CompletionPort && PyErr_Occurred()) {
+ goto exit;
+ }
+ Overlapped = PyLong_AsVoidPtr(args[2]);
+ if (!Overlapped && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[3], &Milliseconds)) {
+ goto exit;
+ }
+ return_value = _overlapped_RegisterWaitWithQueue_impl(module, Object, CompletionPort, Overlapped, Milliseconds);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_UnregisterWait__doc__,
+"UnregisterWait($module, WaitHandle, /)\n"
+"--\n"
+"\n"
+"Unregister wait handle.");
+
+#define _OVERLAPPED_UNREGISTERWAIT_METHODDEF \
+ {"UnregisterWait", (PyCFunction)_overlapped_UnregisterWait, METH_O, _overlapped_UnregisterWait__doc__},
+
+static PyObject *
+_overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle);
+
+static PyObject *
+_overlapped_UnregisterWait(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE WaitHandle;
+
+ WaitHandle = PyLong_AsVoidPtr(arg);
+ if (!WaitHandle && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_UnregisterWait_impl(module, WaitHandle);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_UnregisterWaitEx__doc__,
+"UnregisterWaitEx($module, WaitHandle, Event, /)\n"
+"--\n"
+"\n"
+"Unregister wait handle.");
+
+#define _OVERLAPPED_UNREGISTERWAITEX_METHODDEF \
+ {"UnregisterWaitEx", _PyCFunction_CAST(_overlapped_UnregisterWaitEx), METH_FASTCALL, _overlapped_UnregisterWaitEx__doc__},
+
+static PyObject *
+_overlapped_UnregisterWaitEx_impl(PyObject *module, HANDLE WaitHandle,
+ HANDLE Event);
+
+static PyObject *
+_overlapped_UnregisterWaitEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE WaitHandle;
+ HANDLE Event;
+
+ if (!_PyArg_CheckPositional("UnregisterWaitEx", nargs, 2, 2)) {
+ goto exit;
+ }
+ WaitHandle = PyLong_AsVoidPtr(args[0]);
+ if (!WaitHandle && PyErr_Occurred()) {
+ goto exit;
+ }
+ Event = PyLong_AsVoidPtr(args[1]);
+ if (!Event && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_UnregisterWaitEx_impl(module, WaitHandle, Event);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_CreateEvent__doc__,
+"CreateEvent($module, EventAttributes, ManualReset, InitialState, Name,\n"
+" /)\n"
+"--\n"
+"\n"
+"Create an event.\n"
+"\n"
+"EventAttributes must be None.");
+
+#define _OVERLAPPED_CREATEEVENT_METHODDEF \
+ {"CreateEvent", _PyCFunction_CAST(_overlapped_CreateEvent), METH_FASTCALL, _overlapped_CreateEvent__doc__},
+
+static PyObject *
+_overlapped_CreateEvent_impl(PyObject *module, PyObject *EventAttributes,
+ BOOL ManualReset, BOOL InitialState,
+ const Py_UNICODE *Name);
+
+static PyObject *
+_overlapped_CreateEvent(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *EventAttributes;
+ BOOL ManualReset;
+ BOOL InitialState;
+ const Py_UNICODE *Name = NULL;
+
+ if (!_PyArg_CheckPositional("CreateEvent", nargs, 4, 4)) {
+ goto exit;
+ }
+ EventAttributes = args[0];
+ ManualReset = _PyLong_AsInt(args[1]);
+ if (ManualReset == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ InitialState = _PyLong_AsInt(args[2]);
+ if (InitialState == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (args[3] == Py_None) {
+ Name = NULL;
+ }
+ else if (PyUnicode_Check(args[3])) {
+ Name = PyUnicode_AsWideCharString(args[3], NULL);
+ if (Name == NULL) {
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("CreateEvent", "argument 4", "str or None", args[3]);
+ goto exit;
+ }
+ return_value = _overlapped_CreateEvent_impl(module, EventAttributes, ManualReset, InitialState, Name);
+
+exit:
+ /* Cleanup for Name */
+ PyMem_Free((void *)Name);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_SetEvent__doc__,
+"SetEvent($module, Handle, /)\n"
+"--\n"
+"\n"
+"Set event.");
+
+#define _OVERLAPPED_SETEVENT_METHODDEF \
+ {"SetEvent", (PyCFunction)_overlapped_SetEvent, METH_O, _overlapped_SetEvent__doc__},
+
+static PyObject *
+_overlapped_SetEvent_impl(PyObject *module, HANDLE Handle);
+
+static PyObject *
+_overlapped_SetEvent(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE Handle;
+
+ Handle = PyLong_AsVoidPtr(arg);
+ if (!Handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_SetEvent_impl(module, Handle);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_ResetEvent__doc__,
+"ResetEvent($module, Handle, /)\n"
+"--\n"
+"\n"
+"Reset event.");
+
+#define _OVERLAPPED_RESETEVENT_METHODDEF \
+ {"ResetEvent", (PyCFunction)_overlapped_ResetEvent, METH_O, _overlapped_ResetEvent__doc__},
+
+static PyObject *
+_overlapped_ResetEvent_impl(PyObject *module, HANDLE Handle);
+
+static PyObject *
+_overlapped_ResetEvent(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE Handle;
+
+ Handle = PyLong_AsVoidPtr(arg);
+ if (!Handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_ResetEvent_impl(module, Handle);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_BindLocal__doc__,
+"BindLocal($module, handle, family, /)\n"
+"--\n"
+"\n"
+"Bind a socket handle to an arbitrary local port.\n"
+"\n"
+"family should be AF_INET or AF_INET6.");
+
+#define _OVERLAPPED_BINDLOCAL_METHODDEF \
+ {"BindLocal", _PyCFunction_CAST(_overlapped_BindLocal), METH_FASTCALL, _overlapped_BindLocal__doc__},
+
+static PyObject *
+_overlapped_BindLocal_impl(PyObject *module, HANDLE Socket, int Family);
+
+static PyObject *
+_overlapped_BindLocal(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE Socket;
+ int Family;
+
+ if (!_PyArg_CheckPositional("BindLocal", nargs, 2, 2)) {
+ goto exit;
+ }
+ Socket = PyLong_AsVoidPtr(args[0]);
+ if (!Socket && PyErr_Occurred()) {
+ goto exit;
+ }
+ Family = _PyLong_AsInt(args[1]);
+ if (Family == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_BindLocal_impl(module, Socket, Family);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_FormatMessage__doc__,
+"FormatMessage($module, error_code, /)\n"
+"--\n"
+"\n"
+"Return error message for an error code.");
+
+#define _OVERLAPPED_FORMATMESSAGE_METHODDEF \
+ {"FormatMessage", (PyCFunction)_overlapped_FormatMessage, METH_O, _overlapped_FormatMessage__doc__},
+
+static PyObject *
+_overlapped_FormatMessage_impl(PyObject *module, DWORD code);
+
+static PyObject *
+_overlapped_FormatMessage(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ DWORD code;
+
+ if (!_PyLong_UnsignedLong_Converter(arg, &code)) {
+ goto exit;
+ }
+ return_value = _overlapped_FormatMessage_impl(module, code);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped__doc__,
+"Overlapped(event=_overlapped.INVALID_HANDLE_VALUE)\n"
+"--\n"
+"\n"
+"OVERLAPPED structure wrapper.");
+
+static PyObject *
+_overlapped_Overlapped_impl(PyTypeObject *type, HANDLE event);
+
+static PyObject *
+_overlapped_Overlapped(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(event), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"event", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Overlapped",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ HANDLE event = INVALID_HANDLE_VALUE;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ event = PyLong_AsVoidPtr(fastargs[0]);
+ if (!event && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = _overlapped_Overlapped_impl(type, event);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_cancel__doc__,
+"cancel($self, /)\n"
+"--\n"
+"\n"
+"Cancel overlapped operation.");
+
+#define _OVERLAPPED_OVERLAPPED_CANCEL_METHODDEF \
+ {"cancel", (PyCFunction)_overlapped_Overlapped_cancel, METH_NOARGS, _overlapped_Overlapped_cancel__doc__},
+
+static PyObject *
+_overlapped_Overlapped_cancel_impl(OverlappedObject *self);
+
+static PyObject *
+_overlapped_Overlapped_cancel(OverlappedObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _overlapped_Overlapped_cancel_impl(self);
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_getresult__doc__,
+"getresult($self, wait=False, /)\n"
+"--\n"
+"\n"
+"Retrieve result of operation.\n"
+"\n"
+"If wait is true then it blocks until the operation is finished. If wait\n"
+"is false and the operation is still pending then an error is raised.");
+
+#define _OVERLAPPED_OVERLAPPED_GETRESULT_METHODDEF \
+ {"getresult", _PyCFunction_CAST(_overlapped_Overlapped_getresult), METH_FASTCALL, _overlapped_Overlapped_getresult__doc__},
+
+static PyObject *
+_overlapped_Overlapped_getresult_impl(OverlappedObject *self, BOOL wait);
+
+static PyObject *
+_overlapped_Overlapped_getresult(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ BOOL wait = FALSE;
+
+ if (!_PyArg_CheckPositional("getresult", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ wait = _PyLong_AsInt(args[0]);
+ if (wait == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _overlapped_Overlapped_getresult_impl(self, wait);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_ReadFile__doc__,
+"ReadFile($self, handle, size, /)\n"
+"--\n"
+"\n"
+"Start overlapped read.");
+
+#define _OVERLAPPED_OVERLAPPED_READFILE_METHODDEF \
+ {"ReadFile", _PyCFunction_CAST(_overlapped_Overlapped_ReadFile), METH_FASTCALL, _overlapped_Overlapped_ReadFile__doc__},
+
+static PyObject *
+_overlapped_Overlapped_ReadFile_impl(OverlappedObject *self, HANDLE handle,
+ DWORD size);
+
+static PyObject *
+_overlapped_Overlapped_ReadFile(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ DWORD size;
+
+ if (!_PyArg_CheckPositional("ReadFile", nargs, 2, 2)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[1], &size)) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_ReadFile_impl(self, handle, size);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_ReadFileInto__doc__,
+"ReadFileInto($self, handle, buf, /)\n"
+"--\n"
+"\n"
+"Start overlapped receive.");
+
+#define _OVERLAPPED_OVERLAPPED_READFILEINTO_METHODDEF \
+ {"ReadFileInto", _PyCFunction_CAST(_overlapped_Overlapped_ReadFileInto), METH_FASTCALL, _overlapped_Overlapped_ReadFileInto__doc__},
+
+static PyObject *
+_overlapped_Overlapped_ReadFileInto_impl(OverlappedObject *self,
+ HANDLE handle, Py_buffer *bufobj);
+
+static PyObject *
+_overlapped_Overlapped_ReadFileInto(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer bufobj = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("ReadFileInto", nargs, 2, 2)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
+ _PyArg_BadArgument("ReadFileInto", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_ReadFileInto_impl(self, handle, &bufobj);
+
+exit:
+ /* Cleanup for bufobj */
+ if (bufobj.obj) {
+ PyBuffer_Release(&bufobj);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WSARecv__doc__,
+"WSARecv($self, handle, size, flags=0, /)\n"
+"--\n"
+"\n"
+"Start overlapped receive.");
+
+#define _OVERLAPPED_OVERLAPPED_WSARECV_METHODDEF \
+ {"WSARecv", _PyCFunction_CAST(_overlapped_Overlapped_WSARecv), METH_FASTCALL, _overlapped_Overlapped_WSARecv__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WSARecv_impl(OverlappedObject *self, HANDLE handle,
+ DWORD size, DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_WSARecv(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ DWORD size;
+ DWORD flags = 0;
+
+ if (!_PyArg_CheckPositional("WSARecv", nargs, 2, 3)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[1], &size)) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _overlapped_Overlapped_WSARecv_impl(self, handle, size, flags);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WSARecvInto__doc__,
+"WSARecvInto($self, handle, buf, flags, /)\n"
+"--\n"
+"\n"
+"Start overlapped receive.");
+
+#define _OVERLAPPED_OVERLAPPED_WSARECVINTO_METHODDEF \
+ {"WSARecvInto", _PyCFunction_CAST(_overlapped_Overlapped_WSARecvInto), METH_FASTCALL, _overlapped_Overlapped_WSARecvInto__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WSARecvInto_impl(OverlappedObject *self,
+ HANDLE handle, Py_buffer *bufobj,
+ DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_WSARecvInto(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer bufobj = {NULL, NULL};
+ DWORD flags;
+
+ if (!_PyArg_CheckPositional("WSARecvInto", nargs, 3, 3)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
+ _PyArg_BadArgument("WSARecvInto", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_WSARecvInto_impl(self, handle, &bufobj, flags);
+
+exit:
+ /* Cleanup for bufobj */
+ if (bufobj.obj) {
+ PyBuffer_Release(&bufobj);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WriteFile__doc__,
+"WriteFile($self, handle, buf, /)\n"
+"--\n"
+"\n"
+"Start overlapped write.");
+
+#define _OVERLAPPED_OVERLAPPED_WRITEFILE_METHODDEF \
+ {"WriteFile", _PyCFunction_CAST(_overlapped_Overlapped_WriteFile), METH_FASTCALL, _overlapped_Overlapped_WriteFile__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WriteFile_impl(OverlappedObject *self, HANDLE handle,
+ Py_buffer *bufobj);
+
+static PyObject *
+_overlapped_Overlapped_WriteFile(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer bufobj = {NULL, NULL};
+
+ if (!_PyArg_CheckPositional("WriteFile", nargs, 2, 2)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
+ _PyArg_BadArgument("WriteFile", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_WriteFile_impl(self, handle, &bufobj);
+
+exit:
+ /* Cleanup for bufobj */
+ if (bufobj.obj) {
+ PyBuffer_Release(&bufobj);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WSASend__doc__,
+"WSASend($self, handle, buf, flags, /)\n"
+"--\n"
+"\n"
+"Start overlapped send.");
+
+#define _OVERLAPPED_OVERLAPPED_WSASEND_METHODDEF \
+ {"WSASend", _PyCFunction_CAST(_overlapped_Overlapped_WSASend), METH_FASTCALL, _overlapped_Overlapped_WSASend__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WSASend_impl(OverlappedObject *self, HANDLE handle,
+ Py_buffer *bufobj, DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_WSASend(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer bufobj = {NULL, NULL};
+ DWORD flags;
+
+ if (!_PyArg_CheckPositional("WSASend", nargs, 3, 3)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
+ _PyArg_BadArgument("WSASend", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_WSASend_impl(self, handle, &bufobj, flags);
+
+exit:
+ /* Cleanup for bufobj */
+ if (bufobj.obj) {
+ PyBuffer_Release(&bufobj);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_AcceptEx__doc__,
+"AcceptEx($self, listen_handle, accept_handle, /)\n"
+"--\n"
+"\n"
+"Start overlapped wait for client to connect.");
+
+#define _OVERLAPPED_OVERLAPPED_ACCEPTEX_METHODDEF \
+ {"AcceptEx", _PyCFunction_CAST(_overlapped_Overlapped_AcceptEx), METH_FASTCALL, _overlapped_Overlapped_AcceptEx__doc__},
+
+static PyObject *
+_overlapped_Overlapped_AcceptEx_impl(OverlappedObject *self,
+ HANDLE ListenSocket,
+ HANDLE AcceptSocket);
+
+static PyObject *
+_overlapped_Overlapped_AcceptEx(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE ListenSocket;
+ HANDLE AcceptSocket;
+
+ if (!_PyArg_CheckPositional("AcceptEx", nargs, 2, 2)) {
+ goto exit;
+ }
+ ListenSocket = PyLong_AsVoidPtr(args[0]);
+ if (!ListenSocket && PyErr_Occurred()) {
+ goto exit;
+ }
+ AcceptSocket = PyLong_AsVoidPtr(args[1]);
+ if (!AcceptSocket && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_AcceptEx_impl(self, ListenSocket, AcceptSocket);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_ConnectEx__doc__,
+"ConnectEx($self, client_handle, address_as_bytes, /)\n"
+"--\n"
+"\n"
+"Start overlapped connect.\n"
+"\n"
+"client_handle should be unbound.");
+
+#define _OVERLAPPED_OVERLAPPED_CONNECTEX_METHODDEF \
+ {"ConnectEx", _PyCFunction_CAST(_overlapped_Overlapped_ConnectEx), METH_FASTCALL, _overlapped_Overlapped_ConnectEx__doc__},
+
+static PyObject *
+_overlapped_Overlapped_ConnectEx_impl(OverlappedObject *self,
+ HANDLE ConnectSocket,
+ PyObject *AddressObj);
+
+static PyObject *
+_overlapped_Overlapped_ConnectEx(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE ConnectSocket;
+ PyObject *AddressObj;
+
+ if (!_PyArg_CheckPositional("ConnectEx", nargs, 2, 2)) {
+ goto exit;
+ }
+ ConnectSocket = PyLong_AsVoidPtr(args[0]);
+ if (!ConnectSocket && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!PyTuple_Check(args[1])) {
+ _PyArg_BadArgument("ConnectEx", "argument 2", "tuple", args[1]);
+ goto exit;
+ }
+ AddressObj = args[1];
+ return_value = _overlapped_Overlapped_ConnectEx_impl(self, ConnectSocket, AddressObj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_DisconnectEx__doc__,
+"DisconnectEx($self, handle, flags, /)\n"
+"--\n"
+"\n");
+
+#define _OVERLAPPED_OVERLAPPED_DISCONNECTEX_METHODDEF \
+ {"DisconnectEx", _PyCFunction_CAST(_overlapped_Overlapped_DisconnectEx), METH_FASTCALL, _overlapped_Overlapped_DisconnectEx__doc__},
+
+static PyObject *
+_overlapped_Overlapped_DisconnectEx_impl(OverlappedObject *self,
+ HANDLE Socket, DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_DisconnectEx(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE Socket;
+ DWORD flags;
+
+ if (!_PyArg_CheckPositional("DisconnectEx", nargs, 2, 2)) {
+ goto exit;
+ }
+ Socket = PyLong_AsVoidPtr(args[0]);
+ if (!Socket && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[1], &flags)) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_DisconnectEx_impl(self, Socket, flags);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_TransmitFile__doc__,
+"TransmitFile($self, socket, file, offset, offset_high, count_to_write,\n"
+" count_per_send, flags, /)\n"
+"--\n"
+"\n"
+"Transmit file data over a connected socket.");
+
+#define _OVERLAPPED_OVERLAPPED_TRANSMITFILE_METHODDEF \
+ {"TransmitFile", _PyCFunction_CAST(_overlapped_Overlapped_TransmitFile), METH_FASTCALL, _overlapped_Overlapped_TransmitFile__doc__},
+
+static PyObject *
+_overlapped_Overlapped_TransmitFile_impl(OverlappedObject *self,
+ HANDLE Socket, HANDLE File,
+ DWORD offset, DWORD offset_high,
+ DWORD count_to_write,
+ DWORD count_per_send, DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_TransmitFile(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE Socket;
+ HANDLE File;
+ DWORD offset;
+ DWORD offset_high;
+ DWORD count_to_write;
+ DWORD count_per_send;
+ DWORD flags;
+
+ if (!_PyArg_CheckPositional("TransmitFile", nargs, 7, 7)) {
+ goto exit;
+ }
+ Socket = PyLong_AsVoidPtr(args[0]);
+ if (!Socket && PyErr_Occurred()) {
+ goto exit;
+ }
+ File = PyLong_AsVoidPtr(args[1]);
+ if (!File && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &offset)) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[3], &offset_high)) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[4], &count_to_write)) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[5], &count_per_send)) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[6], &flags)) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_TransmitFile_impl(self, Socket, File, offset, offset_high, count_to_write, count_per_send, flags);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_ConnectNamedPipe__doc__,
+"ConnectNamedPipe($self, handle, /)\n"
+"--\n"
+"\n"
+"Start overlapped wait for a client to connect.");
+
+#define _OVERLAPPED_OVERLAPPED_CONNECTNAMEDPIPE_METHODDEF \
+ {"ConnectNamedPipe", (PyCFunction)_overlapped_Overlapped_ConnectNamedPipe, METH_O, _overlapped_Overlapped_ConnectNamedPipe__doc__},
+
+static PyObject *
+_overlapped_Overlapped_ConnectNamedPipe_impl(OverlappedObject *self,
+ HANDLE Pipe);
+
+static PyObject *
+_overlapped_Overlapped_ConnectNamedPipe(OverlappedObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ HANDLE Pipe;
+
+ Pipe = PyLong_AsVoidPtr(arg);
+ if (!Pipe && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_ConnectNamedPipe_impl(self, Pipe);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_ConnectPipe__doc__,
+"ConnectPipe($self, addr, /)\n"
+"--\n"
+"\n"
+"Connect to the pipe for asynchronous I/O (overlapped).");
+
+#define _OVERLAPPED_OVERLAPPED_CONNECTPIPE_METHODDEF \
+ {"ConnectPipe", (PyCFunction)_overlapped_Overlapped_ConnectPipe, METH_O, _overlapped_Overlapped_ConnectPipe__doc__},
+
+static PyObject *
+_overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self,
+ const Py_UNICODE *Address);
+
+static PyObject *
+_overlapped_Overlapped_ConnectPipe(OverlappedObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const Py_UNICODE *Address = NULL;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("ConnectPipe", "argument", "str", arg);
+ goto exit;
+ }
+ Address = PyUnicode_AsWideCharString(arg, NULL);
+ if (Address == NULL) {
+ goto exit;
+ }
+ return_value = _overlapped_Overlapped_ConnectPipe_impl(self, Address);
+
+exit:
+ /* Cleanup for Address */
+ PyMem_Free((void *)Address);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_WSAConnect__doc__,
+"WSAConnect($module, client_handle, address_as_bytes, /)\n"
+"--\n"
+"\n"
+"Bind a remote address to a connectionless (UDP) socket.");
+
+#define _OVERLAPPED_WSACONNECT_METHODDEF \
+ {"WSAConnect", _PyCFunction_CAST(_overlapped_WSAConnect), METH_FASTCALL, _overlapped_WSAConnect__doc__},
+
+static PyObject *
+_overlapped_WSAConnect_impl(PyObject *module, HANDLE ConnectSocket,
+ PyObject *AddressObj);
+
+static PyObject *
+_overlapped_WSAConnect(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE ConnectSocket;
+ PyObject *AddressObj;
+
+ if (!_PyArg_CheckPositional("WSAConnect", nargs, 2, 2)) {
+ goto exit;
+ }
+ ConnectSocket = PyLong_AsVoidPtr(args[0]);
+ if (!ConnectSocket && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!PyTuple_Check(args[1])) {
+ _PyArg_BadArgument("WSAConnect", "argument 2", "tuple", args[1]);
+ goto exit;
+ }
+ AddressObj = args[1];
+ return_value = _overlapped_WSAConnect_impl(module, ConnectSocket, AddressObj);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WSASendTo__doc__,
+"WSASendTo($self, handle, buf, flags, address_as_bytes, /)\n"
+"--\n"
+"\n"
+"Start overlapped sendto over a connectionless (UDP) socket.");
+
+#define _OVERLAPPED_OVERLAPPED_WSASENDTO_METHODDEF \
+ {"WSASendTo", _PyCFunction_CAST(_overlapped_Overlapped_WSASendTo), METH_FASTCALL, _overlapped_Overlapped_WSASendTo__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WSASendTo_impl(OverlappedObject *self, HANDLE handle,
+ Py_buffer *bufobj, DWORD flags,
+ PyObject *AddressObj);
+
+static PyObject *
+_overlapped_Overlapped_WSASendTo(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer bufobj = {NULL, NULL};
+ DWORD flags;
+ PyObject *AddressObj;
+
+ if (!_PyArg_CheckPositional("WSASendTo", nargs, 4, 4)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
+ _PyArg_BadArgument("WSASendTo", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
+ goto exit;
+ }
+ if (!PyTuple_Check(args[3])) {
+ _PyArg_BadArgument("WSASendTo", "argument 4", "tuple", args[3]);
+ goto exit;
+ }
+ AddressObj = args[3];
+ return_value = _overlapped_Overlapped_WSASendTo_impl(self, handle, &bufobj, flags, AddressObj);
+
+exit:
+ /* Cleanup for bufobj */
+ if (bufobj.obj) {
+ PyBuffer_Release(&bufobj);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WSARecvFrom__doc__,
+"WSARecvFrom($self, handle, size, flags=0, /)\n"
+"--\n"
+"\n"
+"Start overlapped receive.");
+
+#define _OVERLAPPED_OVERLAPPED_WSARECVFROM_METHODDEF \
+ {"WSARecvFrom", _PyCFunction_CAST(_overlapped_Overlapped_WSARecvFrom), METH_FASTCALL, _overlapped_Overlapped_WSARecvFrom__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WSARecvFrom_impl(OverlappedObject *self,
+ HANDLE handle, DWORD size,
+ DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_WSARecvFrom(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ DWORD size;
+ DWORD flags = 0;
+
+ if (!_PyArg_CheckPositional("WSARecvFrom", nargs, 2, 3)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[1], &size)) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _overlapped_Overlapped_WSARecvFrom_impl(self, handle, size, flags);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_overlapped_Overlapped_WSARecvFromInto__doc__,
+"WSARecvFromInto($self, handle, buf, size, flags=0, /)\n"
+"--\n"
+"\n"
+"Start overlapped receive.");
+
+#define _OVERLAPPED_OVERLAPPED_WSARECVFROMINTO_METHODDEF \
+ {"WSARecvFromInto", _PyCFunction_CAST(_overlapped_Overlapped_WSARecvFromInto), METH_FASTCALL, _overlapped_Overlapped_WSARecvFromInto__doc__},
+
+static PyObject *
+_overlapped_Overlapped_WSARecvFromInto_impl(OverlappedObject *self,
+ HANDLE handle, Py_buffer *bufobj,
+ DWORD size, DWORD flags);
+
+static PyObject *
+_overlapped_Overlapped_WSARecvFromInto(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ HANDLE handle;
+ Py_buffer bufobj = {NULL, NULL};
+ DWORD size;
+ DWORD flags = 0;
+
+ if (!_PyArg_CheckPositional("WSARecvFromInto", nargs, 3, 4)) {
+ goto exit;
+ }
+ handle = PyLong_AsVoidPtr(args[0]);
+ if (!handle && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
+ _PyArg_BadArgument("WSARecvFromInto", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[2], &size)) {
+ goto exit;
+ }
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ if (!_PyLong_UnsignedLong_Converter(args[3], &flags)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = _overlapped_Overlapped_WSARecvFromInto_impl(self, handle, &bufobj, size, flags);
+
+exit:
+ /* Cleanup for bufobj */
+ if (bufobj.obj) {
+ PyBuffer_Release(&bufobj);
+ }
+
+ return return_value;
+}
+/*[clinic end generated code: output=b2e89694b8de3d00 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/posixmodule.c.h b/contrib/tools/python3/Modules/clinic/posixmodule.c.h
new file mode 100644
index 00000000000..3802182143c
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/posixmodule.c.h
@@ -0,0 +1,12002 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(os_stat__doc__,
+"stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Perform a stat system call on the given path.\n"
+"\n"
+" path\n"
+" Path to be examined; can be string, bytes, a path-like object or\n"
+" open-file-descriptor int.\n"
+" dir_fd\n"
+" If not None, it should be a file descriptor open to a directory,\n"
+" and path should be a relative string; path will then be relative to\n"
+" that directory.\n"
+" follow_symlinks\n"
+" If False, and the last element of the path is a symbolic link,\n"
+" stat will examine the symbolic link itself instead of the file\n"
+" the link points to.\n"
+"\n"
+"dir_fd and follow_symlinks may not be implemented\n"
+" on your platform. If they are unavailable, using them will raise a\n"
+" NotImplementedError.\n"
+"\n"
+"It\'s an error to use dir_fd or follow_symlinks when specifying path as\n"
+" an open file descriptor.");
+
+#define OS_STAT_METHODDEF \
+ {"stat", _PyCFunction_CAST(os_stat), METH_FASTCALL|METH_KEYWORDS, os_stat__doc__},
+
+static PyObject *
+os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks);
+
+static PyObject *
+os_stat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(dir_fd), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "dir_fd", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "stat",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("stat", "path", 0, 1);
+ int dir_fd = DEFAULT_DIR_FD;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[1]) {
+ if (!FSTATAT_DIR_FD_CONVERTER(args[1], &dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ follow_symlinks = PyObject_IsTrue(args[2]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_stat_impl(module, &path, dir_fd, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_lstat__doc__,
+"lstat($module, /, path, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Perform a stat system call on the given path, without following symbolic links.\n"
+"\n"
+"Like stat(), but do not follow symbolic links.\n"
+"Equivalent to stat(path, follow_symlinks=False).");
+
+#define OS_LSTAT_METHODDEF \
+ {"lstat", _PyCFunction_CAST(os_lstat), METH_FASTCALL|METH_KEYWORDS, os_lstat__doc__},
+
+static PyObject *
+os_lstat_impl(PyObject *module, path_t *path, int dir_fd);
+
+static PyObject *
+os_lstat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "lstat",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("lstat", "path", 0, 0);
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!FSTATAT_DIR_FD_CONVERTER(args[1], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_lstat_impl(module, &path, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_access__doc__,
+"access($module, /, path, mode, *, dir_fd=None, effective_ids=False,\n"
+" follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Use the real uid/gid to test for access to a path.\n"
+"\n"
+" path\n"
+" Path to be tested; can be string, bytes, or a path-like object.\n"
+" mode\n"
+" Operating-system mode bitfield. Can be F_OK to test existence,\n"
+" or the inclusive-OR of R_OK, W_OK, and X_OK.\n"
+" dir_fd\n"
+" If not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that\n"
+" directory.\n"
+" effective_ids\n"
+" If True, access will use the effective uid/gid instead of\n"
+" the real uid/gid.\n"
+" follow_symlinks\n"
+" If False, and the last element of the path is a symbolic link,\n"
+" access will examine the symbolic link itself instead of the file\n"
+" the link points to.\n"
+"\n"
+"dir_fd, effective_ids, and follow_symlinks may not be implemented\n"
+" on your platform. If they are unavailable, using them will raise a\n"
+" NotImplementedError.\n"
+"\n"
+"Note that most operations will use the effective uid/gid, therefore this\n"
+" routine can be used in a suid/sgid environment to test if the invoking user\n"
+" has the specified access to the path.");
+
+#define OS_ACCESS_METHODDEF \
+ {"access", _PyCFunction_CAST(os_access), METH_FASTCALL|METH_KEYWORDS, os_access__doc__},
+
+static int
+os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd,
+ int effective_ids, int follow_symlinks);
+
+static PyObject *
+os_access(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(mode), &_Py_ID(dir_fd), &_Py_ID(effective_ids), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "mode", "dir_fd", "effective_ids", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "access",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t path = PATH_T_INITIALIZE("access", "path", 0, 0);
+ int mode;
+ int dir_fd = DEFAULT_DIR_FD;
+ int effective_ids = 0;
+ int follow_symlinks = 1;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (!FACCESSAT_DIR_FD_CONVERTER(args[2], &dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ effective_ids = PyObject_IsTrue(args[3]);
+ if (effective_ids < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ follow_symlinks = PyObject_IsTrue(args[4]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ _return_value = os_access_impl(module, &path, mode, dir_fd, effective_ids, follow_symlinks);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(HAVE_TTYNAME)
+
+PyDoc_STRVAR(os_ttyname__doc__,
+"ttyname($module, fd, /)\n"
+"--\n"
+"\n"
+"Return the name of the terminal device connected to \'fd\'.\n"
+"\n"
+" fd\n"
+" Integer file descriptor handle.");
+
+#define OS_TTYNAME_METHODDEF \
+ {"ttyname", (PyCFunction)os_ttyname, METH_O, os_ttyname__doc__},
+
+static PyObject *
+os_ttyname_impl(PyObject *module, int fd);
+
+static PyObject *
+os_ttyname(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_ttyname_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_TTYNAME) */
+
+#if defined(HAVE_CTERMID)
+
+PyDoc_STRVAR(os_ctermid__doc__,
+"ctermid($module, /)\n"
+"--\n"
+"\n"
+"Return the name of the controlling terminal for this process.");
+
+#define OS_CTERMID_METHODDEF \
+ {"ctermid", (PyCFunction)os_ctermid, METH_NOARGS, os_ctermid__doc__},
+
+static PyObject *
+os_ctermid_impl(PyObject *module);
+
+static PyObject *
+os_ctermid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_ctermid_impl(module);
+}
+
+#endif /* defined(HAVE_CTERMID) */
+
+PyDoc_STRVAR(os_chdir__doc__,
+"chdir($module, /, path)\n"
+"--\n"
+"\n"
+"Change the current working directory to the specified path.\n"
+"\n"
+"path may always be specified as a string.\n"
+"On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.");
+
+#define OS_CHDIR_METHODDEF \
+ {"chdir", _PyCFunction_CAST(os_chdir), METH_FASTCALL|METH_KEYWORDS, os_chdir__doc__},
+
+static PyObject *
+os_chdir_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os_chdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "chdir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("chdir", "path", 0, PATH_HAVE_FCHDIR);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os_chdir_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(HAVE_FCHDIR)
+
+PyDoc_STRVAR(os_fchdir__doc__,
+"fchdir($module, /, fd)\n"
+"--\n"
+"\n"
+"Change to the directory of the given file descriptor.\n"
+"\n"
+"fd must be opened on a directory, not a file.\n"
+"Equivalent to os.chdir(fd).");
+
+#define OS_FCHDIR_METHODDEF \
+ {"fchdir", _PyCFunction_CAST(os_fchdir), METH_FASTCALL|METH_KEYWORDS, os_fchdir__doc__},
+
+static PyObject *
+os_fchdir_impl(PyObject *module, int fd);
+
+static PyObject *
+os_fchdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fchdir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ return_value = os_fchdir_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FCHDIR) */
+
+PyDoc_STRVAR(os_chmod__doc__,
+"chmod($module, /, path, mode, *, dir_fd=None, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Change the access permissions of a file.\n"
+"\n"
+" path\n"
+" Path to be modified. May always be specified as a str, bytes, or a path-like object.\n"
+" On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.\n"
+" mode\n"
+" Operating-system mode bitfield.\n"
+" Be careful when using number literals for *mode*. The conventional UNIX notation for\n"
+" numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in\n"
+" Python.\n"
+" dir_fd\n"
+" If not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that\n"
+" directory.\n"
+" follow_symlinks\n"
+" If False, and the last element of the path is a symbolic link,\n"
+" chmod will modify the symbolic link itself instead of the file\n"
+" the link points to.\n"
+"\n"
+"It is an error to use dir_fd or follow_symlinks when specifying path as\n"
+" an open file descriptor.\n"
+"dir_fd and follow_symlinks may not be implemented on your platform.\n"
+" If they are unavailable, using them will raise a NotImplementedError.");
+
+#define OS_CHMOD_METHODDEF \
+ {"chmod", _PyCFunction_CAST(os_chmod), METH_FASTCALL|METH_KEYWORDS, os_chmod__doc__},
+
+static PyObject *
+os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
+ int follow_symlinks);
+
+static PyObject *
+os_chmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(mode), &_Py_ID(dir_fd), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "mode", "dir_fd", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "chmod",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t path = PATH_T_INITIALIZE("chmod", "path", 0, PATH_HAVE_FCHMOD);
+ int mode;
+ int dir_fd = DEFAULT_DIR_FD;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (!FCHMODAT_DIR_FD_CONVERTER(args[2], &dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ follow_symlinks = PyObject_IsTrue(args[3]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_chmod_impl(module, &path, mode, dir_fd, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(HAVE_FCHMOD)
+
+PyDoc_STRVAR(os_fchmod__doc__,
+"fchmod($module, /, fd, mode)\n"
+"--\n"
+"\n"
+"Change the access permissions of the file given by file descriptor fd.\n"
+"\n"
+" fd\n"
+" The file descriptor of the file to be modified.\n"
+" mode\n"
+" Operating-system mode bitfield.\n"
+" Be careful when using number literals for *mode*. The conventional UNIX notation for\n"
+" numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in\n"
+" Python.\n"
+"\n"
+"Equivalent to os.chmod(fd, mode).");
+
+#define OS_FCHMOD_METHODDEF \
+ {"fchmod", _PyCFunction_CAST(os_fchmod), METH_FASTCALL|METH_KEYWORDS, os_fchmod__doc__},
+
+static PyObject *
+os_fchmod_impl(PyObject *module, int fd, int mode);
+
+static PyObject *
+os_fchmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(mode), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "mode", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fchmod",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ int fd;
+ int mode;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_fchmod_impl(module, fd, mode);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FCHMOD) */
+
+#if defined(HAVE_LCHMOD)
+
+PyDoc_STRVAR(os_lchmod__doc__,
+"lchmod($module, /, path, mode)\n"
+"--\n"
+"\n"
+"Change the access permissions of a file, without following symbolic links.\n"
+"\n"
+"If path is a symlink, this affects the link itself rather than the target.\n"
+"Equivalent to chmod(path, mode, follow_symlinks=False).\"");
+
+#define OS_LCHMOD_METHODDEF \
+ {"lchmod", _PyCFunction_CAST(os_lchmod), METH_FASTCALL|METH_KEYWORDS, os_lchmod__doc__},
+
+static PyObject *
+os_lchmod_impl(PyObject *module, path_t *path, int mode);
+
+static PyObject *
+os_lchmod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(mode), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "mode", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "lchmod",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ path_t path = PATH_T_INITIALIZE("lchmod", "path", 0, 0);
+ int mode;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_lchmod_impl(module, &path, mode);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_LCHMOD) */
+
+#if defined(HAVE_CHFLAGS)
+
+PyDoc_STRVAR(os_chflags__doc__,
+"chflags($module, /, path, flags, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Set file flags.\n"
+"\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, chflags will change flags on the symbolic link itself instead of the\n"
+" file the link points to.\n"
+"follow_symlinks may not be implemented on your platform. If it is\n"
+"unavailable, using it will raise a NotImplementedError.");
+
+#define OS_CHFLAGS_METHODDEF \
+ {"chflags", _PyCFunction_CAST(os_chflags), METH_FASTCALL|METH_KEYWORDS, os_chflags__doc__},
+
+static PyObject *
+os_chflags_impl(PyObject *module, path_t *path, unsigned long flags,
+ int follow_symlinks);
+
+static PyObject *
+os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(flags), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "flags", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "chflags",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t path = PATH_T_INITIALIZE("chflags", "path", 0, 0);
+ unsigned long flags;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!PyLong_Check(args[1])) {
+ _PyArg_BadArgument("chflags", "argument 'flags'", "int", args[1]);
+ goto exit;
+ }
+ flags = PyLong_AsUnsignedLongMask(args[1]);
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ follow_symlinks = PyObject_IsTrue(args[2]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_chflags_impl(module, &path, flags, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_CHFLAGS) */
+
+#if defined(HAVE_LCHFLAGS)
+
+PyDoc_STRVAR(os_lchflags__doc__,
+"lchflags($module, /, path, flags)\n"
+"--\n"
+"\n"
+"Set file flags.\n"
+"\n"
+"This function will not follow symbolic links.\n"
+"Equivalent to chflags(path, flags, follow_symlinks=False).");
+
+#define OS_LCHFLAGS_METHODDEF \
+ {"lchflags", _PyCFunction_CAST(os_lchflags), METH_FASTCALL|METH_KEYWORDS, os_lchflags__doc__},
+
+static PyObject *
+os_lchflags_impl(PyObject *module, path_t *path, unsigned long flags);
+
+static PyObject *
+os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "lchflags",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ path_t path = PATH_T_INITIALIZE("lchflags", "path", 0, 0);
+ unsigned long flags;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!PyLong_Check(args[1])) {
+ _PyArg_BadArgument("lchflags", "argument 'flags'", "int", args[1]);
+ goto exit;
+ }
+ flags = PyLong_AsUnsignedLongMask(args[1]);
+ return_value = os_lchflags_impl(module, &path, flags);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_LCHFLAGS) */
+
+#if defined(HAVE_CHROOT)
+
+PyDoc_STRVAR(os_chroot__doc__,
+"chroot($module, /, path)\n"
+"--\n"
+"\n"
+"Change root directory to path.");
+
+#define OS_CHROOT_METHODDEF \
+ {"chroot", _PyCFunction_CAST(os_chroot), METH_FASTCALL|METH_KEYWORDS, os_chroot__doc__},
+
+static PyObject *
+os_chroot_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os_chroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "chroot",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("chroot", "path", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os_chroot_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_CHROOT) */
+
+#if defined(HAVE_FSYNC)
+
+PyDoc_STRVAR(os_fsync__doc__,
+"fsync($module, /, fd)\n"
+"--\n"
+"\n"
+"Force write of fd to disk.");
+
+#define OS_FSYNC_METHODDEF \
+ {"fsync", _PyCFunction_CAST(os_fsync), METH_FASTCALL|METH_KEYWORDS, os_fsync__doc__},
+
+static PyObject *
+os_fsync_impl(PyObject *module, int fd);
+
+static PyObject *
+os_fsync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fsync",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ return_value = os_fsync_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FSYNC) */
+
+#if defined(HAVE_SYNC)
+
+PyDoc_STRVAR(os_sync__doc__,
+"sync($module, /)\n"
+"--\n"
+"\n"
+"Force write of everything to disk.");
+
+#define OS_SYNC_METHODDEF \
+ {"sync", (PyCFunction)os_sync, METH_NOARGS, os_sync__doc__},
+
+static PyObject *
+os_sync_impl(PyObject *module);
+
+static PyObject *
+os_sync(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_sync_impl(module);
+}
+
+#endif /* defined(HAVE_SYNC) */
+
+#if defined(HAVE_FDATASYNC)
+
+PyDoc_STRVAR(os_fdatasync__doc__,
+"fdatasync($module, /, fd)\n"
+"--\n"
+"\n"
+"Force write of fd to disk without forcing update of metadata.");
+
+#define OS_FDATASYNC_METHODDEF \
+ {"fdatasync", _PyCFunction_CAST(os_fdatasync), METH_FASTCALL|METH_KEYWORDS, os_fdatasync__doc__},
+
+static PyObject *
+os_fdatasync_impl(PyObject *module, int fd);
+
+static PyObject *
+os_fdatasync(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fdatasync",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ return_value = os_fdatasync_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FDATASYNC) */
+
+#if defined(HAVE_CHOWN)
+
+PyDoc_STRVAR(os_chown__doc__,
+"chown($module, /, path, uid, gid, *, dir_fd=None, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Change the owner and group id of path to the numeric uid and gid.\\\n"
+"\n"
+" path\n"
+" Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.\n"
+" dir_fd\n"
+" If not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that\n"
+" directory.\n"
+" follow_symlinks\n"
+" If False, and the last element of the path is a symbolic link,\n"
+" stat will examine the symbolic link itself instead of the file\n"
+" the link points to.\n"
+"\n"
+"path may always be specified as a string.\n"
+"On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, chown will modify the symbolic link itself instead of the file the\n"
+" link points to.\n"
+"It is an error to use dir_fd or follow_symlinks when specifying path as\n"
+" an open file descriptor.\n"
+"dir_fd and follow_symlinks may not be implemented on your platform.\n"
+" If they are unavailable, using them will raise a NotImplementedError.");
+
+#define OS_CHOWN_METHODDEF \
+ {"chown", _PyCFunction_CAST(os_chown), METH_FASTCALL|METH_KEYWORDS, os_chown__doc__},
+
+static PyObject *
+os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid,
+ int dir_fd, int follow_symlinks);
+
+static PyObject *
+os_chown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(uid), &_Py_ID(gid), &_Py_ID(dir_fd), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "uid", "gid", "dir_fd", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "chown",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ path_t path = PATH_T_INITIALIZE("chown", "path", 0, PATH_HAVE_FCHOWN);
+ uid_t uid;
+ gid_t gid;
+ int dir_fd = DEFAULT_DIR_FD;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[1], &uid)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[2], &gid)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[3]) {
+ if (!FCHOWNAT_DIR_FD_CONVERTER(args[3], &dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ follow_symlinks = PyObject_IsTrue(args[4]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_chown_impl(module, &path, uid, gid, dir_fd, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_CHOWN) */
+
+#if defined(HAVE_FCHOWN)
+
+PyDoc_STRVAR(os_fchown__doc__,
+"fchown($module, /, fd, uid, gid)\n"
+"--\n"
+"\n"
+"Change the owner and group id of the file specified by file descriptor.\n"
+"\n"
+"Equivalent to os.chown(fd, uid, gid).");
+
+#define OS_FCHOWN_METHODDEF \
+ {"fchown", _PyCFunction_CAST(os_fchown), METH_FASTCALL|METH_KEYWORDS, os_fchown__doc__},
+
+static PyObject *
+os_fchown_impl(PyObject *module, int fd, uid_t uid, gid_t gid);
+
+static PyObject *
+os_fchown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(uid), &_Py_ID(gid), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "uid", "gid", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fchown",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ int fd;
+ uid_t uid;
+ gid_t gid;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[1], &uid)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[2], &gid)) {
+ goto exit;
+ }
+ return_value = os_fchown_impl(module, fd, uid, gid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FCHOWN) */
+
+#if defined(HAVE_LCHOWN)
+
+PyDoc_STRVAR(os_lchown__doc__,
+"lchown($module, /, path, uid, gid)\n"
+"--\n"
+"\n"
+"Change the owner and group id of path to the numeric uid and gid.\n"
+"\n"
+"This function will not follow symbolic links.\n"
+"Equivalent to os.chown(path, uid, gid, follow_symlinks=False).");
+
+#define OS_LCHOWN_METHODDEF \
+ {"lchown", _PyCFunction_CAST(os_lchown), METH_FASTCALL|METH_KEYWORDS, os_lchown__doc__},
+
+static PyObject *
+os_lchown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid);
+
+static PyObject *
+os_lchown(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(uid), &_Py_ID(gid), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "uid", "gid", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "lchown",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ path_t path = PATH_T_INITIALIZE("lchown", "path", 0, 0);
+ uid_t uid;
+ gid_t gid;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[1], &uid)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[2], &gid)) {
+ goto exit;
+ }
+ return_value = os_lchown_impl(module, &path, uid, gid);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_LCHOWN) */
+
+PyDoc_STRVAR(os_getcwd__doc__,
+"getcwd($module, /)\n"
+"--\n"
+"\n"
+"Return a unicode string representing the current working directory.");
+
+#define OS_GETCWD_METHODDEF \
+ {"getcwd", (PyCFunction)os_getcwd, METH_NOARGS, os_getcwd__doc__},
+
+static PyObject *
+os_getcwd_impl(PyObject *module);
+
+static PyObject *
+os_getcwd(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getcwd_impl(module);
+}
+
+PyDoc_STRVAR(os_getcwdb__doc__,
+"getcwdb($module, /)\n"
+"--\n"
+"\n"
+"Return a bytes string representing the current working directory.");
+
+#define OS_GETCWDB_METHODDEF \
+ {"getcwdb", (PyCFunction)os_getcwdb, METH_NOARGS, os_getcwdb__doc__},
+
+static PyObject *
+os_getcwdb_impl(PyObject *module);
+
+static PyObject *
+os_getcwdb(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getcwdb_impl(module);
+}
+
+#if defined(HAVE_LINK)
+
+PyDoc_STRVAR(os_link__doc__,
+"link($module, /, src, dst, *, src_dir_fd=None, dst_dir_fd=None,\n"
+" follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Create a hard link to a file.\n"
+"\n"
+"If either src_dir_fd or dst_dir_fd is not None, it should be a file\n"
+" descriptor open to a directory, and the respective path string (src or dst)\n"
+" should be relative; the path will then be relative to that directory.\n"
+"If follow_symlinks is False, and the last element of src is a symbolic\n"
+" link, link will create a link to the symbolic link itself instead of the\n"
+" file the link points to.\n"
+"src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your\n"
+" platform. If they are unavailable, using them will raise a\n"
+" NotImplementedError.");
+
+#define OS_LINK_METHODDEF \
+ {"link", _PyCFunction_CAST(os_link), METH_FASTCALL|METH_KEYWORDS, os_link__doc__},
+
+static PyObject *
+os_link_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
+ int dst_dir_fd, int follow_symlinks);
+
+static PyObject *
+os_link(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(src), &_Py_ID(dst), &_Py_ID(src_dir_fd), &_Py_ID(dst_dir_fd), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"src", "dst", "src_dir_fd", "dst_dir_fd", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "link",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t src = PATH_T_INITIALIZE("link", "src", 0, 0);
+ path_t dst = PATH_T_INITIALIZE("link", "dst", 0, 0);
+ int src_dir_fd = DEFAULT_DIR_FD;
+ int dst_dir_fd = DEFAULT_DIR_FD;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &src)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &dst)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (!dir_fd_converter(args[2], &src_dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ if (!dir_fd_converter(args[3], &dst_dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ follow_symlinks = PyObject_IsTrue(args[4]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_link_impl(module, &src, &dst, src_dir_fd, dst_dir_fd, follow_symlinks);
+
+exit:
+ /* Cleanup for src */
+ path_cleanup(&src);
+ /* Cleanup for dst */
+ path_cleanup(&dst);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_LINK) */
+
+PyDoc_STRVAR(os_listdir__doc__,
+"listdir($module, /, path=None)\n"
+"--\n"
+"\n"
+"Return a list containing the names of the files in the directory.\n"
+"\n"
+"path can be specified as either str, bytes, or a path-like object. If path is bytes,\n"
+" the filenames returned will also be bytes; in all other circumstances\n"
+" the filenames returned will be str.\n"
+"If path is None, uses the path=\'.\'.\n"
+"On some platforms, path may also be specified as an open file descriptor;\\\n"
+" the file descriptor must refer to a directory.\n"
+" If this functionality is unavailable, using it raises NotImplementedError.\n"
+"\n"
+"The list is in arbitrary order. It does not include the special\n"
+"entries \'.\' and \'..\' even if they are present in the directory.");
+
+#define OS_LISTDIR_METHODDEF \
+ {"listdir", _PyCFunction_CAST(os_listdir), METH_FASTCALL|METH_KEYWORDS, os_listdir__doc__},
+
+static PyObject *
+os_listdir_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os_listdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "listdir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ path_t path = PATH_T_INITIALIZE("listdir", "path", 1, PATH_HAVE_FDOPENDIR);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_listdir_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_listdrives__doc__,
+"listdrives($module, /)\n"
+"--\n"
+"\n"
+"Return a list containing the names of drives in the system.\n"
+"\n"
+"A drive name typically looks like \'C:\\\\\'.");
+
+#define OS_LISTDRIVES_METHODDEF \
+ {"listdrives", (PyCFunction)os_listdrives, METH_NOARGS, os_listdrives__doc__},
+
+static PyObject *
+os_listdrives_impl(PyObject *module);
+
+static PyObject *
+os_listdrives(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_listdrives_impl(module);
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_listvolumes__doc__,
+"listvolumes($module, /)\n"
+"--\n"
+"\n"
+"Return a list containing the volumes in the system.\n"
+"\n"
+"Volumes are typically represented as a GUID path.");
+
+#define OS_LISTVOLUMES_METHODDEF \
+ {"listvolumes", (PyCFunction)os_listvolumes, METH_NOARGS, os_listvolumes__doc__},
+
+static PyObject *
+os_listvolumes_impl(PyObject *module);
+
+static PyObject *
+os_listvolumes(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_listvolumes_impl(module);
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_listmounts__doc__,
+"listmounts($module, /, volume)\n"
+"--\n"
+"\n"
+"Return a list containing mount points for a particular volume.\n"
+"\n"
+"\'volume\' should be a GUID path as returned from os.listvolumes.");
+
+#define OS_LISTMOUNTS_METHODDEF \
+ {"listmounts", _PyCFunction_CAST(os_listmounts), METH_FASTCALL|METH_KEYWORDS, os_listmounts__doc__},
+
+static PyObject *
+os_listmounts_impl(PyObject *module, path_t *volume);
+
+static PyObject *
+os_listmounts(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(volume), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"volume", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "listmounts",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t volume = PATH_T_INITIALIZE("listmounts", "volume", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &volume)) {
+ goto exit;
+ }
+ return_value = os_listmounts_impl(module, &volume);
+
+exit:
+ /* Cleanup for volume */
+ path_cleanup(&volume);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__path_isdevdrive__doc__,
+"_path_isdevdrive($module, /, path)\n"
+"--\n"
+"\n"
+"Determines whether the specified path is on a Windows Dev Drive.");
+
+#define OS__PATH_ISDEVDRIVE_METHODDEF \
+ {"_path_isdevdrive", _PyCFunction_CAST(os__path_isdevdrive), METH_FASTCALL|METH_KEYWORDS, os__path_isdevdrive__doc__},
+
+static PyObject *
+os__path_isdevdrive_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__path_isdevdrive(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_isdevdrive",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("_path_isdevdrive", "path", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os__path_isdevdrive_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__getfullpathname__doc__,
+"_getfullpathname($module, path, /)\n"
+"--\n"
+"\n");
+
+#define OS__GETFULLPATHNAME_METHODDEF \
+ {"_getfullpathname", (PyCFunction)os__getfullpathname, METH_O, os__getfullpathname__doc__},
+
+static PyObject *
+os__getfullpathname_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__getfullpathname(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ path_t path = PATH_T_INITIALIZE("_getfullpathname", "path", 0, 0);
+
+ if (!path_converter(arg, &path)) {
+ goto exit;
+ }
+ return_value = os__getfullpathname_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__getfinalpathname__doc__,
+"_getfinalpathname($module, path, /)\n"
+"--\n"
+"\n"
+"A helper function for samepath on windows.");
+
+#define OS__GETFINALPATHNAME_METHODDEF \
+ {"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_O, os__getfinalpathname__doc__},
+
+static PyObject *
+os__getfinalpathname_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__getfinalpathname(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ path_t path = PATH_T_INITIALIZE("_getfinalpathname", "path", 0, 0);
+
+ if (!path_converter(arg, &path)) {
+ goto exit;
+ }
+ return_value = os__getfinalpathname_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__getvolumepathname__doc__,
+"_getvolumepathname($module, /, path)\n"
+"--\n"
+"\n"
+"A helper function for ismount on Win32.");
+
+#define OS__GETVOLUMEPATHNAME_METHODDEF \
+ {"_getvolumepathname", _PyCFunction_CAST(os__getvolumepathname), METH_FASTCALL|METH_KEYWORDS, os__getvolumepathname__doc__},
+
+static PyObject *
+os__getvolumepathname_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__getvolumepathname(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_getvolumepathname",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("_getvolumepathname", "path", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os__getvolumepathname_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__path_splitroot__doc__,
+"_path_splitroot($module, /, path)\n"
+"--\n"
+"\n"
+"Removes everything after the root on Win32.");
+
+#define OS__PATH_SPLITROOT_METHODDEF \
+ {"_path_splitroot", _PyCFunction_CAST(os__path_splitroot), METH_FASTCALL|METH_KEYWORDS, os__path_splitroot__doc__},
+
+static PyObject *
+os__path_splitroot_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__path_splitroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_splitroot",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("_path_splitroot", "path", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os__path_splitroot_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__path_isdir__doc__,
+"_path_isdir($module, /, s)\n"
+"--\n"
+"\n"
+"Return true if the pathname refers to an existing directory.");
+
+#define OS__PATH_ISDIR_METHODDEF \
+ {"_path_isdir", _PyCFunction_CAST(os__path_isdir), METH_FASTCALL|METH_KEYWORDS, os__path_isdir__doc__},
+
+static PyObject *
+os__path_isdir_impl(PyObject *module, PyObject *s);
+
+static PyObject *
+os__path_isdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(s), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"s", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_isdir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *s;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ s = args[0];
+ return_value = os__path_isdir_impl(module, s);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__path_isfile__doc__,
+"_path_isfile($module, /, path)\n"
+"--\n"
+"\n"
+"Test whether a path is a regular file");
+
+#define OS__PATH_ISFILE_METHODDEF \
+ {"_path_isfile", _PyCFunction_CAST(os__path_isfile), METH_FASTCALL|METH_KEYWORDS, os__path_isfile__doc__},
+
+static PyObject *
+os__path_isfile_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+os__path_isfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_isfile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = os__path_isfile_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__path_exists__doc__,
+"_path_exists($module, /, path)\n"
+"--\n"
+"\n"
+"Test whether a path exists. Returns False for broken symbolic links");
+
+#define OS__PATH_EXISTS_METHODDEF \
+ {"_path_exists", _PyCFunction_CAST(os__path_exists), METH_FASTCALL|METH_KEYWORDS, os__path_exists__doc__},
+
+static PyObject *
+os__path_exists_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+os__path_exists(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_exists",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = os__path_exists_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__path_islink__doc__,
+"_path_islink($module, /, path)\n"
+"--\n"
+"\n"
+"Test whether a path is a symbolic link");
+
+#define OS__PATH_ISLINK_METHODDEF \
+ {"_path_islink", _PyCFunction_CAST(os__path_islink), METH_FASTCALL|METH_KEYWORDS, os__path_islink__doc__},
+
+static PyObject *
+os__path_islink_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+os__path_islink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_islink",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = os__path_islink_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+PyDoc_STRVAR(os__path_normpath__doc__,
+"_path_normpath($module, /, path)\n"
+"--\n"
+"\n"
+"Basic path normalization.");
+
+#define OS__PATH_NORMPATH_METHODDEF \
+ {"_path_normpath", _PyCFunction_CAST(os__path_normpath), METH_FASTCALL|METH_KEYWORDS, os__path_normpath__doc__},
+
+static PyObject *
+os__path_normpath_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+os__path_normpath(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_path_normpath",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = os__path_normpath_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_mkdir__doc__,
+"mkdir($module, /, path, mode=511, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Create a directory.\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.\n"
+"\n"
+"The mode argument is ignored on Windows. Where it is used, the current umask\n"
+"value is first masked out.");
+
+#define OS_MKDIR_METHODDEF \
+ {"mkdir", _PyCFunction_CAST(os_mkdir), METH_FASTCALL|METH_KEYWORDS, os_mkdir__doc__},
+
+static PyObject *
+os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd);
+
+static PyObject *
+os_mkdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(mode), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "mode", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "mkdir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("mkdir", "path", 0, 0);
+ int mode = 511;
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!MKDIRAT_DIR_FD_CONVERTER(args[2], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_mkdir_impl(module, &path, mode, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(HAVE_NICE)
+
+PyDoc_STRVAR(os_nice__doc__,
+"nice($module, increment, /)\n"
+"--\n"
+"\n"
+"Add increment to the priority of process and return the new priority.");
+
+#define OS_NICE_METHODDEF \
+ {"nice", (PyCFunction)os_nice, METH_O, os_nice__doc__},
+
+static PyObject *
+os_nice_impl(PyObject *module, int increment);
+
+static PyObject *
+os_nice(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int increment;
+
+ increment = _PyLong_AsInt(arg);
+ if (increment == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_nice_impl(module, increment);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_NICE) */
+
+#if defined(HAVE_GETPRIORITY)
+
+PyDoc_STRVAR(os_getpriority__doc__,
+"getpriority($module, /, which, who)\n"
+"--\n"
+"\n"
+"Return program scheduling priority.");
+
+#define OS_GETPRIORITY_METHODDEF \
+ {"getpriority", _PyCFunction_CAST(os_getpriority), METH_FASTCALL|METH_KEYWORDS, os_getpriority__doc__},
+
+static PyObject *
+os_getpriority_impl(PyObject *module, int which, int who);
+
+static PyObject *
+os_getpriority(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(which), &_Py_ID(who), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"which", "who", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "getpriority",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ int which;
+ int who;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ which = _PyLong_AsInt(args[0]);
+ if (which == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ who = _PyLong_AsInt(args[1]);
+ if (who == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_getpriority_impl(module, which, who);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETPRIORITY) */
+
+#if defined(HAVE_SETPRIORITY)
+
+PyDoc_STRVAR(os_setpriority__doc__,
+"setpriority($module, /, which, who, priority)\n"
+"--\n"
+"\n"
+"Set program scheduling priority.");
+
+#define OS_SETPRIORITY_METHODDEF \
+ {"setpriority", _PyCFunction_CAST(os_setpriority), METH_FASTCALL|METH_KEYWORDS, os_setpriority__doc__},
+
+static PyObject *
+os_setpriority_impl(PyObject *module, int which, int who, int priority);
+
+static PyObject *
+os_setpriority(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(which), &_Py_ID(who), &_Py_ID(priority), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"which", "who", "priority", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "setpriority",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ int which;
+ int who;
+ int priority;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ which = _PyLong_AsInt(args[0]);
+ if (which == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ who = _PyLong_AsInt(args[1]);
+ if (who == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ priority = _PyLong_AsInt(args[2]);
+ if (priority == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_setpriority_impl(module, which, who, priority);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETPRIORITY) */
+
+PyDoc_STRVAR(os_rename__doc__,
+"rename($module, /, src, dst, *, src_dir_fd=None, dst_dir_fd=None)\n"
+"--\n"
+"\n"
+"Rename a file or directory.\n"
+"\n"
+"If either src_dir_fd or dst_dir_fd is not None, it should be a file\n"
+" descriptor open to a directory, and the respective path string (src or dst)\n"
+" should be relative; the path will then be relative to that directory.\n"
+"src_dir_fd and dst_dir_fd, may not be implemented on your platform.\n"
+" If they are unavailable, using them will raise a NotImplementedError.");
+
+#define OS_RENAME_METHODDEF \
+ {"rename", _PyCFunction_CAST(os_rename), METH_FASTCALL|METH_KEYWORDS, os_rename__doc__},
+
+static PyObject *
+os_rename_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
+ int dst_dir_fd);
+
+static PyObject *
+os_rename(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(src), &_Py_ID(dst), &_Py_ID(src_dir_fd), &_Py_ID(dst_dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"src", "dst", "src_dir_fd", "dst_dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "rename",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t src = PATH_T_INITIALIZE("rename", "src", 0, 0);
+ path_t dst = PATH_T_INITIALIZE("rename", "dst", 0, 0);
+ int src_dir_fd = DEFAULT_DIR_FD;
+ int dst_dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &src)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &dst)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (!dir_fd_converter(args[2], &src_dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (!dir_fd_converter(args[3], &dst_dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_rename_impl(module, &src, &dst, src_dir_fd, dst_dir_fd);
+
+exit:
+ /* Cleanup for src */
+ path_cleanup(&src);
+ /* Cleanup for dst */
+ path_cleanup(&dst);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_replace__doc__,
+"replace($module, /, src, dst, *, src_dir_fd=None, dst_dir_fd=None)\n"
+"--\n"
+"\n"
+"Rename a file or directory, overwriting the destination.\n"
+"\n"
+"If either src_dir_fd or dst_dir_fd is not None, it should be a file\n"
+" descriptor open to a directory, and the respective path string (src or dst)\n"
+" should be relative; the path will then be relative to that directory.\n"
+"src_dir_fd and dst_dir_fd, may not be implemented on your platform.\n"
+" If they are unavailable, using them will raise a NotImplementedError.");
+
+#define OS_REPLACE_METHODDEF \
+ {"replace", _PyCFunction_CAST(os_replace), METH_FASTCALL|METH_KEYWORDS, os_replace__doc__},
+
+static PyObject *
+os_replace_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
+ int dst_dir_fd);
+
+static PyObject *
+os_replace(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(src), &_Py_ID(dst), &_Py_ID(src_dir_fd), &_Py_ID(dst_dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"src", "dst", "src_dir_fd", "dst_dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "replace",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t src = PATH_T_INITIALIZE("replace", "src", 0, 0);
+ path_t dst = PATH_T_INITIALIZE("replace", "dst", 0, 0);
+ int src_dir_fd = DEFAULT_DIR_FD;
+ int dst_dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &src)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &dst)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ if (!dir_fd_converter(args[2], &src_dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (!dir_fd_converter(args[3], &dst_dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_replace_impl(module, &src, &dst, src_dir_fd, dst_dir_fd);
+
+exit:
+ /* Cleanup for src */
+ path_cleanup(&src);
+ /* Cleanup for dst */
+ path_cleanup(&dst);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_rmdir__doc__,
+"rmdir($module, /, path, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Remove a directory.\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_RMDIR_METHODDEF \
+ {"rmdir", _PyCFunction_CAST(os_rmdir), METH_FASTCALL|METH_KEYWORDS, os_rmdir__doc__},
+
+static PyObject *
+os_rmdir_impl(PyObject *module, path_t *path, int dir_fd);
+
+static PyObject *
+os_rmdir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "rmdir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("rmdir", "path", 0, 0);
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!UNLINKAT_DIR_FD_CONVERTER(args[1], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_rmdir_impl(module, &path, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(HAVE_SYSTEM) && defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_system__doc__,
+"system($module, /, command)\n"
+"--\n"
+"\n"
+"Execute the command in a subshell.");
+
+#define OS_SYSTEM_METHODDEF \
+ {"system", _PyCFunction_CAST(os_system), METH_FASTCALL|METH_KEYWORDS, os_system__doc__},
+
+static long
+os_system_impl(PyObject *module, const Py_UNICODE *command);
+
+static PyObject *
+os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(command), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"command", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "system",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ const Py_UNICODE *command = NULL;
+ long _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("system", "argument 'command'", "str", args[0]);
+ goto exit;
+ }
+ command = PyUnicode_AsWideCharString(args[0], NULL);
+ if (command == NULL) {
+ goto exit;
+ }
+ _return_value = os_system_impl(module, command);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ /* Cleanup for command */
+ PyMem_Free((void *)command);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYSTEM) && defined(MS_WINDOWS) */
+
+#if defined(HAVE_SYSTEM) && !defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_system__doc__,
+"system($module, /, command)\n"
+"--\n"
+"\n"
+"Execute the command in a subshell.");
+
+#define OS_SYSTEM_METHODDEF \
+ {"system", _PyCFunction_CAST(os_system), METH_FASTCALL|METH_KEYWORDS, os_system__doc__},
+
+static long
+os_system_impl(PyObject *module, PyObject *command);
+
+static PyObject *
+os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(command), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"command", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "system",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *command = NULL;
+ long _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_FSConverter(args[0], &command)) {
+ goto exit;
+ }
+ _return_value = os_system_impl(module, command);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ /* Cleanup for command */
+ Py_XDECREF(command);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYSTEM) && !defined(MS_WINDOWS) */
+
+#if defined(HAVE_UMASK)
+
+PyDoc_STRVAR(os_umask__doc__,
+"umask($module, mask, /)\n"
+"--\n"
+"\n"
+"Set the current numeric umask and return the previous umask.");
+
+#define OS_UMASK_METHODDEF \
+ {"umask", (PyCFunction)os_umask, METH_O, os_umask__doc__},
+
+static PyObject *
+os_umask_impl(PyObject *module, int mask);
+
+static PyObject *
+os_umask(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int mask;
+
+ mask = _PyLong_AsInt(arg);
+ if (mask == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_umask_impl(module, mask);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_UMASK) */
+
+PyDoc_STRVAR(os_unlink__doc__,
+"unlink($module, /, path, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Remove a file (same as remove()).\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_UNLINK_METHODDEF \
+ {"unlink", _PyCFunction_CAST(os_unlink), METH_FASTCALL|METH_KEYWORDS, os_unlink__doc__},
+
+static PyObject *
+os_unlink_impl(PyObject *module, path_t *path, int dir_fd);
+
+static PyObject *
+os_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "unlink",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("unlink", "path", 0, 0);
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!UNLINKAT_DIR_FD_CONVERTER(args[1], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_unlink_impl(module, &path, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_remove__doc__,
+"remove($module, /, path, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Remove a file (same as unlink()).\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_REMOVE_METHODDEF \
+ {"remove", _PyCFunction_CAST(os_remove), METH_FASTCALL|METH_KEYWORDS, os_remove__doc__},
+
+static PyObject *
+os_remove_impl(PyObject *module, path_t *path, int dir_fd);
+
+static PyObject *
+os_remove(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "remove",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("remove", "path", 0, 0);
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!UNLINKAT_DIR_FD_CONVERTER(args[1], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_remove_impl(module, &path, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#if defined(HAVE_UNAME)
+
+PyDoc_STRVAR(os_uname__doc__,
+"uname($module, /)\n"
+"--\n"
+"\n"
+"Return an object identifying the current operating system.\n"
+"\n"
+"The object behaves like a named tuple with the following fields:\n"
+" (sysname, nodename, release, version, machine)");
+
+#define OS_UNAME_METHODDEF \
+ {"uname", (PyCFunction)os_uname, METH_NOARGS, os_uname__doc__},
+
+static PyObject *
+os_uname_impl(PyObject *module);
+
+static PyObject *
+os_uname(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_uname_impl(module);
+}
+
+#endif /* defined(HAVE_UNAME) */
+
+PyDoc_STRVAR(os_utime__doc__,
+"utime($module, /, path, times=None, *, ns=<unrepresentable>,\n"
+" dir_fd=None, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Set the access and modified time of path.\n"
+"\n"
+"path may always be specified as a string.\n"
+"On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.\n"
+"\n"
+"If times is not None, it must be a tuple (atime, mtime);\n"
+" atime and mtime should be expressed as float seconds since the epoch.\n"
+"If ns is specified, it must be a tuple (atime_ns, mtime_ns);\n"
+" atime_ns and mtime_ns should be expressed as integer nanoseconds\n"
+" since the epoch.\n"
+"If times is None and ns is unspecified, utime uses the current time.\n"
+"Specifying tuples for both times and ns is an error.\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, utime will modify the symbolic link itself instead of the file the\n"
+" link points to.\n"
+"It is an error to use dir_fd or follow_symlinks when specifying path\n"
+" as an open file descriptor.\n"
+"dir_fd and follow_symlinks may not be available on your platform.\n"
+" If they are unavailable, using them will raise a NotImplementedError.");
+
+#define OS_UTIME_METHODDEF \
+ {"utime", _PyCFunction_CAST(os_utime), METH_FASTCALL|METH_KEYWORDS, os_utime__doc__},
+
+static PyObject *
+os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns,
+ int dir_fd, int follow_symlinks);
+
+static PyObject *
+os_utime(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(times), &_Py_ID(ns), &_Py_ID(dir_fd), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "times", "ns", "dir_fd", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "utime",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("utime", "path", 0, PATH_UTIME_HAVE_FD);
+ PyObject *times = Py_None;
+ PyObject *ns = NULL;
+ int dir_fd = DEFAULT_DIR_FD;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ times = args[1];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[2]) {
+ ns = args[2];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[3]) {
+ if (!FUTIMENSAT_DIR_FD_CONVERTER(args[3], &dir_fd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ follow_symlinks = PyObject_IsTrue(args[4]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_utime_impl(module, &path, times, ns, dir_fd, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os__exit__doc__,
+"_exit($module, /, status)\n"
+"--\n"
+"\n"
+"Exit to the system with specified status, without normal exit processing.");
+
+#define OS__EXIT_METHODDEF \
+ {"_exit", _PyCFunction_CAST(os__exit), METH_FASTCALL|METH_KEYWORDS, os__exit__doc__},
+
+static PyObject *
+os__exit_impl(PyObject *module, int status);
+
+static PyObject *
+os__exit(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_exit",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os__exit_impl(module, status);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_EXECV)
+
+PyDoc_STRVAR(os_execv__doc__,
+"execv($module, path, argv, /)\n"
+"--\n"
+"\n"
+"Execute an executable path with arguments, replacing current process.\n"
+"\n"
+" path\n"
+" Path of executable file.\n"
+" argv\n"
+" Tuple or list of strings.");
+
+#define OS_EXECV_METHODDEF \
+ {"execv", _PyCFunction_CAST(os_execv), METH_FASTCALL, os_execv__doc__},
+
+static PyObject *
+os_execv_impl(PyObject *module, path_t *path, PyObject *argv);
+
+static PyObject *
+os_execv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ path_t path = PATH_T_INITIALIZE("execv", "path", 0, 0);
+ PyObject *argv;
+
+ if (!_PyArg_CheckPositional("execv", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ argv = args[1];
+ return_value = os_execv_impl(module, &path, argv);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_EXECV) */
+
+#if defined(HAVE_EXECV)
+
+PyDoc_STRVAR(os_execve__doc__,
+"execve($module, /, path, argv, env)\n"
+"--\n"
+"\n"
+"Execute an executable path with arguments, replacing current process.\n"
+"\n"
+" path\n"
+" Path of executable file.\n"
+" argv\n"
+" Tuple or list of strings.\n"
+" env\n"
+" Dictionary of strings mapping to strings.");
+
+#define OS_EXECVE_METHODDEF \
+ {"execve", _PyCFunction_CAST(os_execve), METH_FASTCALL|METH_KEYWORDS, os_execve__doc__},
+
+static PyObject *
+os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env);
+
+static PyObject *
+os_execve(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(argv), &_Py_ID(env), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "argv", "env", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "execve",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ path_t path = PATH_T_INITIALIZE("execve", "path", 0, PATH_HAVE_FEXECVE);
+ PyObject *argv;
+ PyObject *env;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ argv = args[1];
+ env = args[2];
+ return_value = os_execve_impl(module, &path, argv, env);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_EXECV) */
+
+#if defined(HAVE_POSIX_SPAWN)
+
+PyDoc_STRVAR(os_posix_spawn__doc__,
+"posix_spawn($module, path, argv, env, /, *, file_actions=(),\n"
+" setpgroup=<unrepresentable>, resetids=False, setsid=False,\n"
+" setsigmask=(), setsigdef=(), scheduler=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Execute the program specified by path in a new process.\n"
+"\n"
+" path\n"
+" Path of executable file.\n"
+" argv\n"
+" Tuple or list of strings.\n"
+" env\n"
+" Dictionary of strings mapping to strings.\n"
+" file_actions\n"
+" A sequence of file action tuples.\n"
+" setpgroup\n"
+" The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.\n"
+" resetids\n"
+" If the value is `true` the POSIX_SPAWN_RESETIDS will be activated.\n"
+" setsid\n"
+" If the value is `true` the POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP will be activated.\n"
+" setsigmask\n"
+" The sigmask to use with the POSIX_SPAWN_SETSIGMASK flag.\n"
+" setsigdef\n"
+" The sigmask to use with the POSIX_SPAWN_SETSIGDEF flag.\n"
+" scheduler\n"
+" A tuple with the scheduler policy (optional) and parameters.");
+
+#define OS_POSIX_SPAWN_METHODDEF \
+ {"posix_spawn", _PyCFunction_CAST(os_posix_spawn), METH_FASTCALL|METH_KEYWORDS, os_posix_spawn__doc__},
+
+static PyObject *
+os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
+ PyObject *env, PyObject *file_actions,
+ PyObject *setpgroup, int resetids, int setsid,
+ PyObject *setsigmask, PyObject *setsigdef,
+ PyObject *scheduler);
+
+static PyObject *
+os_posix_spawn(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 7
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file_actions), &_Py_ID(setpgroup), &_Py_ID(resetids), &_Py_ID(setsid), &_Py_ID(setsigmask), &_Py_ID(setsigdef), &_Py_ID(scheduler), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "", "", "file_actions", "setpgroup", "resetids", "setsid", "setsigmask", "setsigdef", "scheduler", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "posix_spawn",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[10];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ path_t path = PATH_T_INITIALIZE("posix_spawn", "path", 0, 0);
+ PyObject *argv;
+ PyObject *env;
+ PyObject *file_actions = NULL;
+ PyObject *setpgroup = NULL;
+ int resetids = 0;
+ int setsid = 0;
+ PyObject *setsigmask = NULL;
+ PyObject *setsigdef = NULL;
+ PyObject *scheduler = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ argv = args[1];
+ env = args[2];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[3]) {
+ file_actions = args[3];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[4]) {
+ setpgroup = args[4];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[5]) {
+ resetids = PyObject_IsTrue(args[5]);
+ if (resetids < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[6]) {
+ setsid = PyObject_IsTrue(args[6]);
+ if (setsid < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[7]) {
+ setsigmask = args[7];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[8]) {
+ setsigdef = args[8];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ scheduler = args[9];
+skip_optional_kwonly:
+ return_value = os_posix_spawn_impl(module, &path, argv, env, file_actions, setpgroup, resetids, setsid, setsigmask, setsigdef, scheduler);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_POSIX_SPAWN) */
+
+#if defined(HAVE_POSIX_SPAWNP)
+
+PyDoc_STRVAR(os_posix_spawnp__doc__,
+"posix_spawnp($module, path, argv, env, /, *, file_actions=(),\n"
+" setpgroup=<unrepresentable>, resetids=False, setsid=False,\n"
+" setsigmask=(), setsigdef=(), scheduler=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Execute the program specified by path in a new process.\n"
+"\n"
+" path\n"
+" Path of executable file.\n"
+" argv\n"
+" Tuple or list of strings.\n"
+" env\n"
+" Dictionary of strings mapping to strings.\n"
+" file_actions\n"
+" A sequence of file action tuples.\n"
+" setpgroup\n"
+" The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.\n"
+" resetids\n"
+" If the value is `True` the POSIX_SPAWN_RESETIDS will be activated.\n"
+" setsid\n"
+" If the value is `True` the POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP will be activated.\n"
+" setsigmask\n"
+" The sigmask to use with the POSIX_SPAWN_SETSIGMASK flag.\n"
+" setsigdef\n"
+" The sigmask to use with the POSIX_SPAWN_SETSIGDEF flag.\n"
+" scheduler\n"
+" A tuple with the scheduler policy (optional) and parameters.");
+
+#define OS_POSIX_SPAWNP_METHODDEF \
+ {"posix_spawnp", _PyCFunction_CAST(os_posix_spawnp), METH_FASTCALL|METH_KEYWORDS, os_posix_spawnp__doc__},
+
+static PyObject *
+os_posix_spawnp_impl(PyObject *module, path_t *path, PyObject *argv,
+ PyObject *env, PyObject *file_actions,
+ PyObject *setpgroup, int resetids, int setsid,
+ PyObject *setsigmask, PyObject *setsigdef,
+ PyObject *scheduler);
+
+static PyObject *
+os_posix_spawnp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 7
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(file_actions), &_Py_ID(setpgroup), &_Py_ID(resetids), &_Py_ID(setsid), &_Py_ID(setsigmask), &_Py_ID(setsigdef), &_Py_ID(scheduler), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "", "", "file_actions", "setpgroup", "resetids", "setsid", "setsigmask", "setsigdef", "scheduler", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "posix_spawnp",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[10];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ path_t path = PATH_T_INITIALIZE("posix_spawnp", "path", 0, 0);
+ PyObject *argv;
+ PyObject *env;
+ PyObject *file_actions = NULL;
+ PyObject *setpgroup = NULL;
+ int resetids = 0;
+ int setsid = 0;
+ PyObject *setsigmask = NULL;
+ PyObject *setsigdef = NULL;
+ PyObject *scheduler = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ argv = args[1];
+ env = args[2];
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[3]) {
+ file_actions = args[3];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[4]) {
+ setpgroup = args[4];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[5]) {
+ resetids = PyObject_IsTrue(args[5]);
+ if (resetids < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[6]) {
+ setsid = PyObject_IsTrue(args[6]);
+ if (setsid < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[7]) {
+ setsigmask = args[7];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[8]) {
+ setsigdef = args[8];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ scheduler = args[9];
+skip_optional_kwonly:
+ return_value = os_posix_spawnp_impl(module, &path, argv, env, file_actions, setpgroup, resetids, setsid, setsigmask, setsigdef, scheduler);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_POSIX_SPAWNP) */
+
+#if (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN))
+
+PyDoc_STRVAR(os_spawnv__doc__,
+"spawnv($module, mode, path, argv, /)\n"
+"--\n"
+"\n"
+"Execute the program specified by path in a new process.\n"
+"\n"
+" mode\n"
+" Mode of process creation.\n"
+" path\n"
+" Path of executable file.\n"
+" argv\n"
+" Tuple or list of strings.");
+
+#define OS_SPAWNV_METHODDEF \
+ {"spawnv", _PyCFunction_CAST(os_spawnv), METH_FASTCALL, os_spawnv__doc__},
+
+static PyObject *
+os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv);
+
+static PyObject *
+os_spawnv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int mode;
+ path_t path = PATH_T_INITIALIZE("spawnv", "path", 0, 0);
+ PyObject *argv;
+
+ if (!_PyArg_CheckPositional("spawnv", nargs, 3, 3)) {
+ goto exit;
+ }
+ mode = _PyLong_AsInt(args[0]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &path)) {
+ goto exit;
+ }
+ argv = args[2];
+ return_value = os_spawnv_impl(module, mode, &path, argv);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN)) */
+
+#if (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN))
+
+PyDoc_STRVAR(os_spawnve__doc__,
+"spawnve($module, mode, path, argv, env, /)\n"
+"--\n"
+"\n"
+"Execute the program specified by path in a new process.\n"
+"\n"
+" mode\n"
+" Mode of process creation.\n"
+" path\n"
+" Path of executable file.\n"
+" argv\n"
+" Tuple or list of strings.\n"
+" env\n"
+" Dictionary of strings mapping to strings.");
+
+#define OS_SPAWNVE_METHODDEF \
+ {"spawnve", _PyCFunction_CAST(os_spawnve), METH_FASTCALL, os_spawnve__doc__},
+
+static PyObject *
+os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
+ PyObject *env);
+
+static PyObject *
+os_spawnve(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int mode;
+ path_t path = PATH_T_INITIALIZE("spawnve", "path", 0, 0);
+ PyObject *argv;
+ PyObject *env;
+
+ if (!_PyArg_CheckPositional("spawnve", nargs, 4, 4)) {
+ goto exit;
+ }
+ mode = _PyLong_AsInt(args[0]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &path)) {
+ goto exit;
+ }
+ argv = args[2];
+ env = args[3];
+ return_value = os_spawnve_impl(module, mode, &path, argv, env);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN)) */
+
+#if defined(HAVE_FORK)
+
+PyDoc_STRVAR(os_register_at_fork__doc__,
+"register_at_fork($module, /, *, before=<unrepresentable>,\n"
+" after_in_child=<unrepresentable>,\n"
+" after_in_parent=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Register callables to be called when forking a new process.\n"
+"\n"
+" before\n"
+" A callable to be called in the parent before the fork() syscall.\n"
+" after_in_child\n"
+" A callable to be called in the child after fork().\n"
+" after_in_parent\n"
+" A callable to be called in the parent after fork().\n"
+"\n"
+"\'before\' callbacks are called in reverse order.\n"
+"\'after_in_child\' and \'after_in_parent\' callbacks are called in order.");
+
+#define OS_REGISTER_AT_FORK_METHODDEF \
+ {"register_at_fork", _PyCFunction_CAST(os_register_at_fork), METH_FASTCALL|METH_KEYWORDS, os_register_at_fork__doc__},
+
+static PyObject *
+os_register_at_fork_impl(PyObject *module, PyObject *before,
+ PyObject *after_in_child, PyObject *after_in_parent);
+
+static PyObject *
+os_register_at_fork(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(before), &_Py_ID(after_in_child), &_Py_ID(after_in_parent), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"before", "after_in_child", "after_in_parent", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "register_at_fork",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *before = NULL;
+ PyObject *after_in_child = NULL;
+ PyObject *after_in_parent = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (args[0]) {
+ before = args[0];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ if (args[1]) {
+ after_in_child = args[1];
+ if (!--noptargs) {
+ goto skip_optional_kwonly;
+ }
+ }
+ after_in_parent = args[2];
+skip_optional_kwonly:
+ return_value = os_register_at_fork_impl(module, before, after_in_child, after_in_parent);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FORK) */
+
+#if defined(HAVE_FORK1)
+
+PyDoc_STRVAR(os_fork1__doc__,
+"fork1($module, /)\n"
+"--\n"
+"\n"
+"Fork a child process with a single multiplexed (i.e., not bound) thread.\n"
+"\n"
+"Return 0 to child process and PID of child to parent process.");
+
+#define OS_FORK1_METHODDEF \
+ {"fork1", (PyCFunction)os_fork1, METH_NOARGS, os_fork1__doc__},
+
+static PyObject *
+os_fork1_impl(PyObject *module);
+
+static PyObject *
+os_fork1(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_fork1_impl(module);
+}
+
+#endif /* defined(HAVE_FORK1) */
+
+#if defined(HAVE_FORK)
+
+PyDoc_STRVAR(os_fork__doc__,
+"fork($module, /)\n"
+"--\n"
+"\n"
+"Fork a child process.\n"
+"\n"
+"Return 0 to child process and PID of child to parent process.");
+
+#define OS_FORK_METHODDEF \
+ {"fork", (PyCFunction)os_fork, METH_NOARGS, os_fork__doc__},
+
+static PyObject *
+os_fork_impl(PyObject *module);
+
+static PyObject *
+os_fork(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_fork_impl(module);
+}
+
+#endif /* defined(HAVE_FORK) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_GET_PRIORITY_MAX)
+
+PyDoc_STRVAR(os_sched_get_priority_max__doc__,
+"sched_get_priority_max($module, /, policy)\n"
+"--\n"
+"\n"
+"Get the maximum scheduling priority for policy.");
+
+#define OS_SCHED_GET_PRIORITY_MAX_METHODDEF \
+ {"sched_get_priority_max", _PyCFunction_CAST(os_sched_get_priority_max), METH_FASTCALL|METH_KEYWORDS, os_sched_get_priority_max__doc__},
+
+static PyObject *
+os_sched_get_priority_max_impl(PyObject *module, int policy);
+
+static PyObject *
+os_sched_get_priority_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(policy), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"policy", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sched_get_priority_max",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int policy;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ policy = _PyLong_AsInt(args[0]);
+ if (policy == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_sched_get_priority_max_impl(module, policy);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_GET_PRIORITY_MAX) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_GET_PRIORITY_MAX)
+
+PyDoc_STRVAR(os_sched_get_priority_min__doc__,
+"sched_get_priority_min($module, /, policy)\n"
+"--\n"
+"\n"
+"Get the minimum scheduling priority for policy.");
+
+#define OS_SCHED_GET_PRIORITY_MIN_METHODDEF \
+ {"sched_get_priority_min", _PyCFunction_CAST(os_sched_get_priority_min), METH_FASTCALL|METH_KEYWORDS, os_sched_get_priority_min__doc__},
+
+static PyObject *
+os_sched_get_priority_min_impl(PyObject *module, int policy);
+
+static PyObject *
+os_sched_get_priority_min(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(policy), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"policy", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sched_get_priority_min",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int policy;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ policy = _PyLong_AsInt(args[0]);
+ if (policy == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_sched_get_priority_min_impl(module, policy);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_GET_PRIORITY_MAX) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETSCHEDULER)
+
+PyDoc_STRVAR(os_sched_getscheduler__doc__,
+"sched_getscheduler($module, pid, /)\n"
+"--\n"
+"\n"
+"Get the scheduling policy for the process identified by pid.\n"
+"\n"
+"Passing 0 for pid returns the scheduling policy for the calling process.");
+
+#define OS_SCHED_GETSCHEDULER_METHODDEF \
+ {"sched_getscheduler", (PyCFunction)os_sched_getscheduler, METH_O, os_sched_getscheduler__doc__},
+
+static PyObject *
+os_sched_getscheduler_impl(PyObject *module, pid_t pid);
+
+static PyObject *
+os_sched_getscheduler(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+
+ if (!PyArg_Parse(arg, "" _Py_PARSE_PID ":sched_getscheduler", &pid)) {
+ goto exit;
+ }
+ return_value = os_sched_getscheduler_impl(module, pid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETSCHEDULER) */
+
+#if defined(HAVE_SCHED_H) && (defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM))
+
+PyDoc_STRVAR(os_sched_param__doc__,
+"sched_param(sched_priority)\n"
+"--\n"
+"\n"
+"Currently has only one field: sched_priority\n"
+"\n"
+" sched_priority\n"
+" A scheduling parameter.");
+
+static PyObject *
+os_sched_param_impl(PyTypeObject *type, PyObject *sched_priority);
+
+static PyObject *
+os_sched_param(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(sched_priority), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"sched_priority", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sched_param",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ PyObject *sched_priority;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ sched_priority = fastargs[0];
+ return_value = os_sched_param_impl(type, sched_priority);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && (defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETSCHEDULER)
+
+PyDoc_STRVAR(os_sched_setscheduler__doc__,
+"sched_setscheduler($module, pid, policy, param, /)\n"
+"--\n"
+"\n"
+"Set the scheduling policy for the process identified by pid.\n"
+"\n"
+"If pid is 0, the calling process is changed.\n"
+"param is an instance of sched_param.");
+
+#define OS_SCHED_SETSCHEDULER_METHODDEF \
+ {"sched_setscheduler", _PyCFunction_CAST(os_sched_setscheduler), METH_FASTCALL, os_sched_setscheduler__doc__},
+
+static PyObject *
+os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy,
+ PyObject *param_obj);
+
+static PyObject *
+os_sched_setscheduler(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ int policy;
+ PyObject *param_obj;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "iO:sched_setscheduler",
+ &pid, &policy, &param_obj)) {
+ goto exit;
+ }
+ return_value = os_sched_setscheduler_impl(module, pid, policy, param_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETSCHEDULER) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETPARAM)
+
+PyDoc_STRVAR(os_sched_getparam__doc__,
+"sched_getparam($module, pid, /)\n"
+"--\n"
+"\n"
+"Returns scheduling parameters for the process identified by pid.\n"
+"\n"
+"If pid is 0, returns parameters for the calling process.\n"
+"Return value is an instance of sched_param.");
+
+#define OS_SCHED_GETPARAM_METHODDEF \
+ {"sched_getparam", (PyCFunction)os_sched_getparam, METH_O, os_sched_getparam__doc__},
+
+static PyObject *
+os_sched_getparam_impl(PyObject *module, pid_t pid);
+
+static PyObject *
+os_sched_getparam(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+
+ if (!PyArg_Parse(arg, "" _Py_PARSE_PID ":sched_getparam", &pid)) {
+ goto exit;
+ }
+ return_value = os_sched_getparam_impl(module, pid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETPARAM) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETPARAM)
+
+PyDoc_STRVAR(os_sched_setparam__doc__,
+"sched_setparam($module, pid, param, /)\n"
+"--\n"
+"\n"
+"Set scheduling parameters for the process identified by pid.\n"
+"\n"
+"If pid is 0, sets parameters for the calling process.\n"
+"param should be an instance of sched_param.");
+
+#define OS_SCHED_SETPARAM_METHODDEF \
+ {"sched_setparam", _PyCFunction_CAST(os_sched_setparam), METH_FASTCALL, os_sched_setparam__doc__},
+
+static PyObject *
+os_sched_setparam_impl(PyObject *module, pid_t pid, PyObject *param_obj);
+
+static PyObject *
+os_sched_setparam(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ PyObject *param_obj;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "O:sched_setparam",
+ &pid, &param_obj)) {
+ goto exit;
+ }
+ return_value = os_sched_setparam_impl(module, pid, param_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETPARAM) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_RR_GET_INTERVAL)
+
+PyDoc_STRVAR(os_sched_rr_get_interval__doc__,
+"sched_rr_get_interval($module, pid, /)\n"
+"--\n"
+"\n"
+"Return the round-robin quantum for the process identified by pid, in seconds.\n"
+"\n"
+"Value returned is a float.");
+
+#define OS_SCHED_RR_GET_INTERVAL_METHODDEF \
+ {"sched_rr_get_interval", (PyCFunction)os_sched_rr_get_interval, METH_O, os_sched_rr_get_interval__doc__},
+
+static double
+os_sched_rr_get_interval_impl(PyObject *module, pid_t pid);
+
+static PyObject *
+os_sched_rr_get_interval(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ double _return_value;
+
+ if (!PyArg_Parse(arg, "" _Py_PARSE_PID ":sched_rr_get_interval", &pid)) {
+ goto exit;
+ }
+ _return_value = os_sched_rr_get_interval_impl(module, pid);
+ if ((_return_value == -1.0) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyFloat_FromDouble(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_RR_GET_INTERVAL) */
+
+#if defined(HAVE_SCHED_H)
+
+PyDoc_STRVAR(os_sched_yield__doc__,
+"sched_yield($module, /)\n"
+"--\n"
+"\n"
+"Voluntarily relinquish the CPU.");
+
+#define OS_SCHED_YIELD_METHODDEF \
+ {"sched_yield", (PyCFunction)os_sched_yield, METH_NOARGS, os_sched_yield__doc__},
+
+static PyObject *
+os_sched_yield_impl(PyObject *module);
+
+static PyObject *
+os_sched_yield(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_sched_yield_impl(module);
+}
+
+#endif /* defined(HAVE_SCHED_H) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETAFFINITY)
+
+PyDoc_STRVAR(os_sched_setaffinity__doc__,
+"sched_setaffinity($module, pid, mask, /)\n"
+"--\n"
+"\n"
+"Set the CPU affinity of the process identified by pid to mask.\n"
+"\n"
+"mask should be an iterable of integers identifying CPUs.");
+
+#define OS_SCHED_SETAFFINITY_METHODDEF \
+ {"sched_setaffinity", _PyCFunction_CAST(os_sched_setaffinity), METH_FASTCALL, os_sched_setaffinity__doc__},
+
+static PyObject *
+os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask);
+
+static PyObject *
+os_sched_setaffinity(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ PyObject *mask;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "O:sched_setaffinity",
+ &pid, &mask)) {
+ goto exit;
+ }
+ return_value = os_sched_setaffinity_impl(module, pid, mask);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETAFFINITY) */
+
+#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETAFFINITY)
+
+PyDoc_STRVAR(os_sched_getaffinity__doc__,
+"sched_getaffinity($module, pid, /)\n"
+"--\n"
+"\n"
+"Return the affinity of the process identified by pid (or the current process if zero).\n"
+"\n"
+"The affinity is returned as a set of CPU identifiers.");
+
+#define OS_SCHED_GETAFFINITY_METHODDEF \
+ {"sched_getaffinity", (PyCFunction)os_sched_getaffinity, METH_O, os_sched_getaffinity__doc__},
+
+static PyObject *
+os_sched_getaffinity_impl(PyObject *module, pid_t pid);
+
+static PyObject *
+os_sched_getaffinity(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+
+ if (!PyArg_Parse(arg, "" _Py_PARSE_PID ":sched_getaffinity", &pid)) {
+ goto exit;
+ }
+ return_value = os_sched_getaffinity_impl(module, pid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETAFFINITY) */
+
+#if (defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX))
+
+PyDoc_STRVAR(os_openpty__doc__,
+"openpty($module, /)\n"
+"--\n"
+"\n"
+"Open a pseudo-terminal.\n"
+"\n"
+"Return a tuple of (master_fd, slave_fd) containing open file descriptors\n"
+"for both the master and slave ends.");
+
+#define OS_OPENPTY_METHODDEF \
+ {"openpty", (PyCFunction)os_openpty, METH_NOARGS, os_openpty__doc__},
+
+static PyObject *
+os_openpty_impl(PyObject *module);
+
+static PyObject *
+os_openpty(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_openpty_impl(module);
+}
+
+#endif /* (defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)) */
+
+#if (defined(HAVE_LOGIN_TTY) || defined(HAVE_FALLBACK_LOGIN_TTY))
+
+PyDoc_STRVAR(os_login_tty__doc__,
+"login_tty($module, fd, /)\n"
+"--\n"
+"\n"
+"Prepare the tty of which fd is a file descriptor for a new login session.\n"
+"\n"
+"Make the calling process a session leader; make the tty the\n"
+"controlling tty, the stdin, the stdout, and the stderr of the\n"
+"calling process; close fd.");
+
+#define OS_LOGIN_TTY_METHODDEF \
+ {"login_tty", (PyCFunction)os_login_tty, METH_O, os_login_tty__doc__},
+
+static PyObject *
+os_login_tty_impl(PyObject *module, int fd);
+
+static PyObject *
+os_login_tty(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = os_login_tty_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_LOGIN_TTY) || defined(HAVE_FALLBACK_LOGIN_TTY)) */
+
+#if defined(HAVE_FORKPTY)
+
+PyDoc_STRVAR(os_forkpty__doc__,
+"forkpty($module, /)\n"
+"--\n"
+"\n"
+"Fork a new process with a new pseudo-terminal as controlling tty.\n"
+"\n"
+"Returns a tuple of (pid, master_fd).\n"
+"Like fork(), return pid of 0 to the child process,\n"
+"and pid of child to the parent process.\n"
+"To both, return fd of newly opened pseudo-terminal.");
+
+#define OS_FORKPTY_METHODDEF \
+ {"forkpty", (PyCFunction)os_forkpty, METH_NOARGS, os_forkpty__doc__},
+
+static PyObject *
+os_forkpty_impl(PyObject *module);
+
+static PyObject *
+os_forkpty(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_forkpty_impl(module);
+}
+
+#endif /* defined(HAVE_FORKPTY) */
+
+#if defined(HAVE_GETEGID)
+
+PyDoc_STRVAR(os_getegid__doc__,
+"getegid($module, /)\n"
+"--\n"
+"\n"
+"Return the current process\'s effective group id.");
+
+#define OS_GETEGID_METHODDEF \
+ {"getegid", (PyCFunction)os_getegid, METH_NOARGS, os_getegid__doc__},
+
+static PyObject *
+os_getegid_impl(PyObject *module);
+
+static PyObject *
+os_getegid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getegid_impl(module);
+}
+
+#endif /* defined(HAVE_GETEGID) */
+
+#if defined(HAVE_GETEUID)
+
+PyDoc_STRVAR(os_geteuid__doc__,
+"geteuid($module, /)\n"
+"--\n"
+"\n"
+"Return the current process\'s effective user id.");
+
+#define OS_GETEUID_METHODDEF \
+ {"geteuid", (PyCFunction)os_geteuid, METH_NOARGS, os_geteuid__doc__},
+
+static PyObject *
+os_geteuid_impl(PyObject *module);
+
+static PyObject *
+os_geteuid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_geteuid_impl(module);
+}
+
+#endif /* defined(HAVE_GETEUID) */
+
+#if defined(HAVE_GETGID)
+
+PyDoc_STRVAR(os_getgid__doc__,
+"getgid($module, /)\n"
+"--\n"
+"\n"
+"Return the current process\'s group id.");
+
+#define OS_GETGID_METHODDEF \
+ {"getgid", (PyCFunction)os_getgid, METH_NOARGS, os_getgid__doc__},
+
+static PyObject *
+os_getgid_impl(PyObject *module);
+
+static PyObject *
+os_getgid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getgid_impl(module);
+}
+
+#endif /* defined(HAVE_GETGID) */
+
+#if defined(HAVE_GETPID)
+
+PyDoc_STRVAR(os_getpid__doc__,
+"getpid($module, /)\n"
+"--\n"
+"\n"
+"Return the current process id.");
+
+#define OS_GETPID_METHODDEF \
+ {"getpid", (PyCFunction)os_getpid, METH_NOARGS, os_getpid__doc__},
+
+static PyObject *
+os_getpid_impl(PyObject *module);
+
+static PyObject *
+os_getpid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getpid_impl(module);
+}
+
+#endif /* defined(HAVE_GETPID) */
+
+#if defined(HAVE_GETGROUPLIST) && defined(__APPLE__)
+
+PyDoc_STRVAR(os_getgrouplist__doc__,
+"getgrouplist($module, user, group, /)\n"
+"--\n"
+"\n"
+"Returns a list of groups to which a user belongs.\n"
+"\n"
+" user\n"
+" username to lookup\n"
+" group\n"
+" base group id of the user");
+
+#define OS_GETGROUPLIST_METHODDEF \
+ {"getgrouplist", _PyCFunction_CAST(os_getgrouplist), METH_FASTCALL, os_getgrouplist__doc__},
+
+static PyObject *
+os_getgrouplist_impl(PyObject *module, const char *user, int basegid);
+
+static PyObject *
+os_getgrouplist(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *user;
+ int basegid;
+
+ if (!_PyArg_CheckPositional("getgrouplist", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("getgrouplist", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t user_length;
+ user = PyUnicode_AsUTF8AndSize(args[0], &user_length);
+ if (user == NULL) {
+ goto exit;
+ }
+ if (strlen(user) != (size_t)user_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ basegid = _PyLong_AsInt(args[1]);
+ if (basegid == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_getgrouplist_impl(module, user, basegid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETGROUPLIST) && defined(__APPLE__) */
+
+#if defined(HAVE_GETGROUPLIST) && !defined(__APPLE__)
+
+PyDoc_STRVAR(os_getgrouplist__doc__,
+"getgrouplist($module, user, group, /)\n"
+"--\n"
+"\n"
+"Returns a list of groups to which a user belongs.\n"
+"\n"
+" user\n"
+" username to lookup\n"
+" group\n"
+" base group id of the user");
+
+#define OS_GETGROUPLIST_METHODDEF \
+ {"getgrouplist", _PyCFunction_CAST(os_getgrouplist), METH_FASTCALL, os_getgrouplist__doc__},
+
+static PyObject *
+os_getgrouplist_impl(PyObject *module, const char *user, gid_t basegid);
+
+static PyObject *
+os_getgrouplist(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ const char *user;
+ gid_t basegid;
+
+ if (!_PyArg_CheckPositional("getgrouplist", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("getgrouplist", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ Py_ssize_t user_length;
+ user = PyUnicode_AsUTF8AndSize(args[0], &user_length);
+ if (user == NULL) {
+ goto exit;
+ }
+ if (strlen(user) != (size_t)user_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[1], &basegid)) {
+ goto exit;
+ }
+ return_value = os_getgrouplist_impl(module, user, basegid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETGROUPLIST) && !defined(__APPLE__) */
+
+#if defined(HAVE_GETGROUPS)
+
+PyDoc_STRVAR(os_getgroups__doc__,
+"getgroups($module, /)\n"
+"--\n"
+"\n"
+"Return list of supplemental group IDs for the process.");
+
+#define OS_GETGROUPS_METHODDEF \
+ {"getgroups", (PyCFunction)os_getgroups, METH_NOARGS, os_getgroups__doc__},
+
+static PyObject *
+os_getgroups_impl(PyObject *module);
+
+static PyObject *
+os_getgroups(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getgroups_impl(module);
+}
+
+#endif /* defined(HAVE_GETGROUPS) */
+
+#if defined(HAVE_INITGROUPS) && defined(__APPLE__)
+
+PyDoc_STRVAR(os_initgroups__doc__,
+"initgroups($module, username, gid, /)\n"
+"--\n"
+"\n"
+"Initialize the group access list.\n"
+"\n"
+"Call the system initgroups() to initialize the group access list with all of\n"
+"the groups of which the specified username is a member, plus the specified\n"
+"group id.");
+
+#define OS_INITGROUPS_METHODDEF \
+ {"initgroups", _PyCFunction_CAST(os_initgroups), METH_FASTCALL, os_initgroups__doc__},
+
+static PyObject *
+os_initgroups_impl(PyObject *module, PyObject *oname, int gid);
+
+static PyObject *
+os_initgroups(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *oname = NULL;
+ int gid;
+
+ if (!_PyArg_CheckPositional("initgroups", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_FSConverter(args[0], &oname)) {
+ goto exit;
+ }
+ gid = _PyLong_AsInt(args[1]);
+ if (gid == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_initgroups_impl(module, oname, gid);
+
+exit:
+ /* Cleanup for oname */
+ Py_XDECREF(oname);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_INITGROUPS) && defined(__APPLE__) */
+
+#if defined(HAVE_INITGROUPS) && !defined(__APPLE__)
+
+PyDoc_STRVAR(os_initgroups__doc__,
+"initgroups($module, username, gid, /)\n"
+"--\n"
+"\n"
+"Initialize the group access list.\n"
+"\n"
+"Call the system initgroups() to initialize the group access list with all of\n"
+"the groups of which the specified username is a member, plus the specified\n"
+"group id.");
+
+#define OS_INITGROUPS_METHODDEF \
+ {"initgroups", _PyCFunction_CAST(os_initgroups), METH_FASTCALL, os_initgroups__doc__},
+
+static PyObject *
+os_initgroups_impl(PyObject *module, PyObject *oname, gid_t gid);
+
+static PyObject *
+os_initgroups(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *oname = NULL;
+ gid_t gid;
+
+ if (!_PyArg_CheckPositional("initgroups", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_FSConverter(args[0], &oname)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[1], &gid)) {
+ goto exit;
+ }
+ return_value = os_initgroups_impl(module, oname, gid);
+
+exit:
+ /* Cleanup for oname */
+ Py_XDECREF(oname);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_INITGROUPS) && !defined(__APPLE__) */
+
+#if defined(HAVE_GETPGID)
+
+PyDoc_STRVAR(os_getpgid__doc__,
+"getpgid($module, /, pid)\n"
+"--\n"
+"\n"
+"Call the system call getpgid(), and return the result.");
+
+#define OS_GETPGID_METHODDEF \
+ {"getpgid", _PyCFunction_CAST(os_getpgid), METH_FASTCALL|METH_KEYWORDS, os_getpgid__doc__},
+
+static PyObject *
+os_getpgid_impl(PyObject *module, pid_t pid);
+
+static PyObject *
+os_getpgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(pid), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"pid", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" _Py_PARSE_PID ":getpgid",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ pid_t pid;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &pid)) {
+ goto exit;
+ }
+ return_value = os_getpgid_impl(module, pid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETPGID) */
+
+#if defined(HAVE_GETPGRP)
+
+PyDoc_STRVAR(os_getpgrp__doc__,
+"getpgrp($module, /)\n"
+"--\n"
+"\n"
+"Return the current process group id.");
+
+#define OS_GETPGRP_METHODDEF \
+ {"getpgrp", (PyCFunction)os_getpgrp, METH_NOARGS, os_getpgrp__doc__},
+
+static PyObject *
+os_getpgrp_impl(PyObject *module);
+
+static PyObject *
+os_getpgrp(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getpgrp_impl(module);
+}
+
+#endif /* defined(HAVE_GETPGRP) */
+
+#if defined(HAVE_SETPGRP)
+
+PyDoc_STRVAR(os_setpgrp__doc__,
+"setpgrp($module, /)\n"
+"--\n"
+"\n"
+"Make the current process the leader of its process group.");
+
+#define OS_SETPGRP_METHODDEF \
+ {"setpgrp", (PyCFunction)os_setpgrp, METH_NOARGS, os_setpgrp__doc__},
+
+static PyObject *
+os_setpgrp_impl(PyObject *module);
+
+static PyObject *
+os_setpgrp(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_setpgrp_impl(module);
+}
+
+#endif /* defined(HAVE_SETPGRP) */
+
+#if defined(HAVE_GETPPID)
+
+PyDoc_STRVAR(os_getppid__doc__,
+"getppid($module, /)\n"
+"--\n"
+"\n"
+"Return the parent\'s process id.\n"
+"\n"
+"If the parent process has already exited, Windows machines will still\n"
+"return its id; others systems will return the id of the \'init\' process (1).");
+
+#define OS_GETPPID_METHODDEF \
+ {"getppid", (PyCFunction)os_getppid, METH_NOARGS, os_getppid__doc__},
+
+static PyObject *
+os_getppid_impl(PyObject *module);
+
+static PyObject *
+os_getppid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getppid_impl(module);
+}
+
+#endif /* defined(HAVE_GETPPID) */
+
+#if defined(HAVE_GETLOGIN)
+
+PyDoc_STRVAR(os_getlogin__doc__,
+"getlogin($module, /)\n"
+"--\n"
+"\n"
+"Return the actual login name.");
+
+#define OS_GETLOGIN_METHODDEF \
+ {"getlogin", (PyCFunction)os_getlogin, METH_NOARGS, os_getlogin__doc__},
+
+static PyObject *
+os_getlogin_impl(PyObject *module);
+
+static PyObject *
+os_getlogin(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getlogin_impl(module);
+}
+
+#endif /* defined(HAVE_GETLOGIN) */
+
+#if defined(HAVE_GETUID)
+
+PyDoc_STRVAR(os_getuid__doc__,
+"getuid($module, /)\n"
+"--\n"
+"\n"
+"Return the current process\'s user id.");
+
+#define OS_GETUID_METHODDEF \
+ {"getuid", (PyCFunction)os_getuid, METH_NOARGS, os_getuid__doc__},
+
+static PyObject *
+os_getuid_impl(PyObject *module);
+
+static PyObject *
+os_getuid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getuid_impl(module);
+}
+
+#endif /* defined(HAVE_GETUID) */
+
+#if defined(HAVE_KILL)
+
+PyDoc_STRVAR(os_kill__doc__,
+"kill($module, pid, signal, /)\n"
+"--\n"
+"\n"
+"Kill a process with a signal.");
+
+#define OS_KILL_METHODDEF \
+ {"kill", _PyCFunction_CAST(os_kill), METH_FASTCALL, os_kill__doc__},
+
+static PyObject *
+os_kill_impl(PyObject *module, pid_t pid, Py_ssize_t signal);
+
+static PyObject *
+os_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ Py_ssize_t signal;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "n:kill",
+ &pid, &signal)) {
+ goto exit;
+ }
+ return_value = os_kill_impl(module, pid, signal);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_KILL) */
+
+#if defined(HAVE_KILLPG)
+
+PyDoc_STRVAR(os_killpg__doc__,
+"killpg($module, pgid, signal, /)\n"
+"--\n"
+"\n"
+"Kill a process group with a signal.");
+
+#define OS_KILLPG_METHODDEF \
+ {"killpg", _PyCFunction_CAST(os_killpg), METH_FASTCALL, os_killpg__doc__},
+
+static PyObject *
+os_killpg_impl(PyObject *module, pid_t pgid, int signal);
+
+static PyObject *
+os_killpg(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pgid;
+ int signal;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "i:killpg",
+ &pgid, &signal)) {
+ goto exit;
+ }
+ return_value = os_killpg_impl(module, pgid, signal);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_KILLPG) */
+
+#if defined(HAVE_PLOCK)
+
+PyDoc_STRVAR(os_plock__doc__,
+"plock($module, op, /)\n"
+"--\n"
+"\n"
+"Lock program segments into memory.\");");
+
+#define OS_PLOCK_METHODDEF \
+ {"plock", (PyCFunction)os_plock, METH_O, os_plock__doc__},
+
+static PyObject *
+os_plock_impl(PyObject *module, int op);
+
+static PyObject *
+os_plock(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int op;
+
+ op = _PyLong_AsInt(arg);
+ if (op == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_plock_impl(module, op);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_PLOCK) */
+
+#if defined(HAVE_SETUID)
+
+PyDoc_STRVAR(os_setuid__doc__,
+"setuid($module, uid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s user id.");
+
+#define OS_SETUID_METHODDEF \
+ {"setuid", (PyCFunction)os_setuid, METH_O, os_setuid__doc__},
+
+static PyObject *
+os_setuid_impl(PyObject *module, uid_t uid);
+
+static PyObject *
+os_setuid(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ uid_t uid;
+
+ if (!_Py_Uid_Converter(arg, &uid)) {
+ goto exit;
+ }
+ return_value = os_setuid_impl(module, uid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETUID) */
+
+#if defined(HAVE_SETEUID)
+
+PyDoc_STRVAR(os_seteuid__doc__,
+"seteuid($module, euid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s effective user id.");
+
+#define OS_SETEUID_METHODDEF \
+ {"seteuid", (PyCFunction)os_seteuid, METH_O, os_seteuid__doc__},
+
+static PyObject *
+os_seteuid_impl(PyObject *module, uid_t euid);
+
+static PyObject *
+os_seteuid(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ uid_t euid;
+
+ if (!_Py_Uid_Converter(arg, &euid)) {
+ goto exit;
+ }
+ return_value = os_seteuid_impl(module, euid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETEUID) */
+
+#if defined(HAVE_SETEGID)
+
+PyDoc_STRVAR(os_setegid__doc__,
+"setegid($module, egid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s effective group id.");
+
+#define OS_SETEGID_METHODDEF \
+ {"setegid", (PyCFunction)os_setegid, METH_O, os_setegid__doc__},
+
+static PyObject *
+os_setegid_impl(PyObject *module, gid_t egid);
+
+static PyObject *
+os_setegid(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ gid_t egid;
+
+ if (!_Py_Gid_Converter(arg, &egid)) {
+ goto exit;
+ }
+ return_value = os_setegid_impl(module, egid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETEGID) */
+
+#if defined(HAVE_SETREUID)
+
+PyDoc_STRVAR(os_setreuid__doc__,
+"setreuid($module, ruid, euid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s real and effective user ids.");
+
+#define OS_SETREUID_METHODDEF \
+ {"setreuid", _PyCFunction_CAST(os_setreuid), METH_FASTCALL, os_setreuid__doc__},
+
+static PyObject *
+os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid);
+
+static PyObject *
+os_setreuid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ uid_t ruid;
+ uid_t euid;
+
+ if (!_PyArg_CheckPositional("setreuid", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[0], &ruid)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[1], &euid)) {
+ goto exit;
+ }
+ return_value = os_setreuid_impl(module, ruid, euid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETREUID) */
+
+#if defined(HAVE_SETREGID)
+
+PyDoc_STRVAR(os_setregid__doc__,
+"setregid($module, rgid, egid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s real and effective group ids.");
+
+#define OS_SETREGID_METHODDEF \
+ {"setregid", _PyCFunction_CAST(os_setregid), METH_FASTCALL, os_setregid__doc__},
+
+static PyObject *
+os_setregid_impl(PyObject *module, gid_t rgid, gid_t egid);
+
+static PyObject *
+os_setregid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ gid_t rgid;
+ gid_t egid;
+
+ if (!_PyArg_CheckPositional("setregid", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[0], &rgid)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[1], &egid)) {
+ goto exit;
+ }
+ return_value = os_setregid_impl(module, rgid, egid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETREGID) */
+
+#if defined(HAVE_SETGID)
+
+PyDoc_STRVAR(os_setgid__doc__,
+"setgid($module, gid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s group id.");
+
+#define OS_SETGID_METHODDEF \
+ {"setgid", (PyCFunction)os_setgid, METH_O, os_setgid__doc__},
+
+static PyObject *
+os_setgid_impl(PyObject *module, gid_t gid);
+
+static PyObject *
+os_setgid(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ gid_t gid;
+
+ if (!_Py_Gid_Converter(arg, &gid)) {
+ goto exit;
+ }
+ return_value = os_setgid_impl(module, gid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETGID) */
+
+#if defined(HAVE_SETGROUPS)
+
+PyDoc_STRVAR(os_setgroups__doc__,
+"setgroups($module, groups, /)\n"
+"--\n"
+"\n"
+"Set the groups of the current process to list.");
+
+#define OS_SETGROUPS_METHODDEF \
+ {"setgroups", (PyCFunction)os_setgroups, METH_O, os_setgroups__doc__},
+
+#endif /* defined(HAVE_SETGROUPS) */
+
+#if defined(HAVE_WAIT3)
+
+PyDoc_STRVAR(os_wait3__doc__,
+"wait3($module, /, options)\n"
+"--\n"
+"\n"
+"Wait for completion of a child process.\n"
+"\n"
+"Returns a tuple of information about the child process:\n"
+" (pid, status, rusage)");
+
+#define OS_WAIT3_METHODDEF \
+ {"wait3", _PyCFunction_CAST(os_wait3), METH_FASTCALL|METH_KEYWORDS, os_wait3__doc__},
+
+static PyObject *
+os_wait3_impl(PyObject *module, int options);
+
+static PyObject *
+os_wait3(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(options), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"options", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "wait3",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int options;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ options = _PyLong_AsInt(args[0]);
+ if (options == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_wait3_impl(module, options);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WAIT3) */
+
+#if defined(HAVE_WAIT4)
+
+PyDoc_STRVAR(os_wait4__doc__,
+"wait4($module, /, pid, options)\n"
+"--\n"
+"\n"
+"Wait for completion of a specific child process.\n"
+"\n"
+"Returns a tuple of information about the child process:\n"
+" (pid, status, rusage)");
+
+#define OS_WAIT4_METHODDEF \
+ {"wait4", _PyCFunction_CAST(os_wait4), METH_FASTCALL|METH_KEYWORDS, os_wait4__doc__},
+
+static PyObject *
+os_wait4_impl(PyObject *module, pid_t pid, int options);
+
+static PyObject *
+os_wait4(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(pid), &_Py_ID(options), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"pid", "options", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" _Py_PARSE_PID "i:wait4",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ pid_t pid;
+ int options;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &pid, &options)) {
+ goto exit;
+ }
+ return_value = os_wait4_impl(module, pid, options);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WAIT4) */
+
+#if (defined(HAVE_WAITID) && !defined(__APPLE__))
+
+PyDoc_STRVAR(os_waitid__doc__,
+"waitid($module, idtype, id, options, /)\n"
+"--\n"
+"\n"
+"Returns the result of waiting for a process or processes.\n"
+"\n"
+" idtype\n"
+" Must be one of be P_PID, P_PGID or P_ALL.\n"
+" id\n"
+" The id to wait on.\n"
+" options\n"
+" Constructed from the ORing of one or more of WEXITED, WSTOPPED\n"
+" or WCONTINUED and additionally may be ORed with WNOHANG or WNOWAIT.\n"
+"\n"
+"Returns either waitid_result or None if WNOHANG is specified and there are\n"
+"no children in a waitable state.");
+
+#define OS_WAITID_METHODDEF \
+ {"waitid", _PyCFunction_CAST(os_waitid), METH_FASTCALL, os_waitid__doc__},
+
+static PyObject *
+os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options);
+
+static PyObject *
+os_waitid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ idtype_t idtype;
+ id_t id;
+ int options;
+
+ if (!_PyArg_ParseStack(args, nargs, "i" _Py_PARSE_PID "i:waitid",
+ &idtype, &id, &options)) {
+ goto exit;
+ }
+ return_value = os_waitid_impl(module, idtype, id, options);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_WAITID) && !defined(__APPLE__)) */
+
+#if defined(HAVE_WAITPID)
+
+PyDoc_STRVAR(os_waitpid__doc__,
+"waitpid($module, pid, options, /)\n"
+"--\n"
+"\n"
+"Wait for completion of a given child process.\n"
+"\n"
+"Returns a tuple of information regarding the child process:\n"
+" (pid, status)\n"
+"\n"
+"The options argument is ignored on Windows.");
+
+#define OS_WAITPID_METHODDEF \
+ {"waitpid", _PyCFunction_CAST(os_waitpid), METH_FASTCALL, os_waitpid__doc__},
+
+static PyObject *
+os_waitpid_impl(PyObject *module, pid_t pid, int options);
+
+static PyObject *
+os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ int options;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "i:waitpid",
+ &pid, &options)) {
+ goto exit;
+ }
+ return_value = os_waitpid_impl(module, pid, options);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WAITPID) */
+
+#if !defined(HAVE_WAITPID) && defined(HAVE_CWAIT)
+
+PyDoc_STRVAR(os_waitpid__doc__,
+"waitpid($module, pid, options, /)\n"
+"--\n"
+"\n"
+"Wait for completion of a given process.\n"
+"\n"
+"Returns a tuple of information regarding the process:\n"
+" (pid, status << 8)\n"
+"\n"
+"The options argument is ignored on Windows.");
+
+#define OS_WAITPID_METHODDEF \
+ {"waitpid", _PyCFunction_CAST(os_waitpid), METH_FASTCALL, os_waitpid__doc__},
+
+static PyObject *
+os_waitpid_impl(PyObject *module, intptr_t pid, int options);
+
+static PyObject *
+os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ intptr_t pid;
+ int options;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_INTPTR "i:waitpid",
+ &pid, &options)) {
+ goto exit;
+ }
+ return_value = os_waitpid_impl(module, pid, options);
+
+exit:
+ return return_value;
+}
+
+#endif /* !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) */
+
+#if defined(HAVE_WAIT)
+
+PyDoc_STRVAR(os_wait__doc__,
+"wait($module, /)\n"
+"--\n"
+"\n"
+"Wait for completion of a child process.\n"
+"\n"
+"Returns a tuple of information about the child process:\n"
+" (pid, status)");
+
+#define OS_WAIT_METHODDEF \
+ {"wait", (PyCFunction)os_wait, METH_NOARGS, os_wait__doc__},
+
+static PyObject *
+os_wait_impl(PyObject *module);
+
+static PyObject *
+os_wait(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_wait_impl(module);
+}
+
+#endif /* defined(HAVE_WAIT) */
+
+#if (defined(__linux__) && defined(__NR_pidfd_open))
+
+PyDoc_STRVAR(os_pidfd_open__doc__,
+"pidfd_open($module, /, pid, flags=0)\n"
+"--\n"
+"\n"
+"Return a file descriptor referring to the process *pid*.\n"
+"\n"
+"The descriptor can be used to perform process management without races and\n"
+"signals.");
+
+#define OS_PIDFD_OPEN_METHODDEF \
+ {"pidfd_open", _PyCFunction_CAST(os_pidfd_open), METH_FASTCALL|METH_KEYWORDS, os_pidfd_open__doc__},
+
+static PyObject *
+os_pidfd_open_impl(PyObject *module, pid_t pid, unsigned int flags);
+
+static PyObject *
+os_pidfd_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(pid), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"pid", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .format = "" _Py_PARSE_PID "|O&:pidfd_open",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ pid_t pid;
+ unsigned int flags = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &pid, _PyLong_UnsignedInt_Converter, &flags)) {
+ goto exit;
+ }
+ return_value = os_pidfd_open_impl(module, pid, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(__linux__) && defined(__NR_pidfd_open)) */
+
+#if defined(HAVE_SETNS)
+
+PyDoc_STRVAR(os_setns__doc__,
+"setns($module, /, fd, nstype=0)\n"
+"--\n"
+"\n"
+"Move the calling thread into different namespaces.\n"
+"\n"
+" fd\n"
+" A file descriptor to a namespace.\n"
+" nstype\n"
+" Type of namespace.");
+
+#define OS_SETNS_METHODDEF \
+ {"setns", _PyCFunction_CAST(os_setns), METH_FASTCALL|METH_KEYWORDS, os_setns__doc__},
+
+static PyObject *
+os_setns_impl(PyObject *module, int fd, int nstype);
+
+static PyObject *
+os_setns(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(nstype), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "nstype", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "setns",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ int fd;
+ int nstype = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ nstype = _PyLong_AsInt(args[1]);
+ if (nstype == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_setns_impl(module, fd, nstype);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETNS) */
+
+#if defined(HAVE_UNSHARE)
+
+PyDoc_STRVAR(os_unshare__doc__,
+"unshare($module, /, flags)\n"
+"--\n"
+"\n"
+"Disassociate parts of a process (or thread) execution context.\n"
+"\n"
+" flags\n"
+" Namespaces to be unshared.");
+
+#define OS_UNSHARE_METHODDEF \
+ {"unshare", _PyCFunction_CAST(os_unshare), METH_FASTCALL|METH_KEYWORDS, os_unshare__doc__},
+
+static PyObject *
+os_unshare_impl(PyObject *module, int flags);
+
+static PyObject *
+os_unshare(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "unshare",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int flags;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ flags = _PyLong_AsInt(args[0]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_unshare_impl(module, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_UNSHARE) */
+
+#if (defined(HAVE_READLINK) || defined(MS_WINDOWS))
+
+PyDoc_STRVAR(os_readlink__doc__,
+"readlink($module, /, path, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Return a string representing the path to which the symbolic link points.\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+"and path should be relative; path will then be relative to that directory.\n"
+"\n"
+"dir_fd may not be implemented on your platform. If it is unavailable,\n"
+"using it will raise a NotImplementedError.");
+
+#define OS_READLINK_METHODDEF \
+ {"readlink", _PyCFunction_CAST(os_readlink), METH_FASTCALL|METH_KEYWORDS, os_readlink__doc__},
+
+static PyObject *
+os_readlink_impl(PyObject *module, path_t *path, int dir_fd);
+
+static PyObject *
+os_readlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "readlink",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("readlink", "path", 0, 0);
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!READLINKAT_DIR_FD_CONVERTER(args[1], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_readlink_impl(module, &path, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined(HAVE_READLINK) || defined(MS_WINDOWS)) */
+
+#if defined(HAVE_SYMLINK)
+
+PyDoc_STRVAR(os_symlink__doc__,
+"symlink($module, /, src, dst, target_is_directory=False, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Create a symbolic link pointing to src named dst.\n"
+"\n"
+"target_is_directory is required on Windows if the target is to be\n"
+" interpreted as a directory. (On Windows, symlink requires\n"
+" Windows 6.0 or greater, and raises a NotImplementedError otherwise.)\n"
+" target_is_directory is ignored on non-Windows platforms.\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_SYMLINK_METHODDEF \
+ {"symlink", _PyCFunction_CAST(os_symlink), METH_FASTCALL|METH_KEYWORDS, os_symlink__doc__},
+
+static PyObject *
+os_symlink_impl(PyObject *module, path_t *src, path_t *dst,
+ int target_is_directory, int dir_fd);
+
+static PyObject *
+os_symlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(src), &_Py_ID(dst), &_Py_ID(target_is_directory), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"src", "dst", "target_is_directory", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "symlink",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t src = PATH_T_INITIALIZE("symlink", "src", 0, 0);
+ path_t dst = PATH_T_INITIALIZE("symlink", "dst", 0, 0);
+ int target_is_directory = 0;
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &src)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &dst)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ target_is_directory = PyObject_IsTrue(args[2]);
+ if (target_is_directory < 0) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!SYMLINKAT_DIR_FD_CONVERTER(args[3], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_symlink_impl(module, &src, &dst, target_is_directory, dir_fd);
+
+exit:
+ /* Cleanup for src */
+ path_cleanup(&src);
+ /* Cleanup for dst */
+ path_cleanup(&dst);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYMLINK) */
+
+#if defined(HAVE_TIMES)
+
+PyDoc_STRVAR(os_times__doc__,
+"times($module, /)\n"
+"--\n"
+"\n"
+"Return a collection containing process timing information.\n"
+"\n"
+"The object returned behaves like a named tuple with these fields:\n"
+" (utime, stime, cutime, cstime, elapsed_time)\n"
+"All fields are floating point numbers.");
+
+#define OS_TIMES_METHODDEF \
+ {"times", (PyCFunction)os_times, METH_NOARGS, os_times__doc__},
+
+static PyObject *
+os_times_impl(PyObject *module);
+
+static PyObject *
+os_times(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_times_impl(module);
+}
+
+#endif /* defined(HAVE_TIMES) */
+
+#if defined(HAVE_GETSID)
+
+PyDoc_STRVAR(os_getsid__doc__,
+"getsid($module, pid, /)\n"
+"--\n"
+"\n"
+"Call the system call getsid(pid) and return the result.");
+
+#define OS_GETSID_METHODDEF \
+ {"getsid", (PyCFunction)os_getsid, METH_O, os_getsid__doc__},
+
+static PyObject *
+os_getsid_impl(PyObject *module, pid_t pid);
+
+static PyObject *
+os_getsid(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+
+ if (!PyArg_Parse(arg, "" _Py_PARSE_PID ":getsid", &pid)) {
+ goto exit;
+ }
+ return_value = os_getsid_impl(module, pid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETSID) */
+
+#if defined(HAVE_SETSID)
+
+PyDoc_STRVAR(os_setsid__doc__,
+"setsid($module, /)\n"
+"--\n"
+"\n"
+"Call the system call setsid().");
+
+#define OS_SETSID_METHODDEF \
+ {"setsid", (PyCFunction)os_setsid, METH_NOARGS, os_setsid__doc__},
+
+static PyObject *
+os_setsid_impl(PyObject *module);
+
+static PyObject *
+os_setsid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_setsid_impl(module);
+}
+
+#endif /* defined(HAVE_SETSID) */
+
+#if defined(HAVE_SETPGID)
+
+PyDoc_STRVAR(os_setpgid__doc__,
+"setpgid($module, pid, pgrp, /)\n"
+"--\n"
+"\n"
+"Call the system call setpgid(pid, pgrp).");
+
+#define OS_SETPGID_METHODDEF \
+ {"setpgid", _PyCFunction_CAST(os_setpgid), METH_FASTCALL, os_setpgid__doc__},
+
+static PyObject *
+os_setpgid_impl(PyObject *module, pid_t pid, pid_t pgrp);
+
+static PyObject *
+os_setpgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ pid_t pgrp;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "" _Py_PARSE_PID ":setpgid",
+ &pid, &pgrp)) {
+ goto exit;
+ }
+ return_value = os_setpgid_impl(module, pid, pgrp);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETPGID) */
+
+#if defined(HAVE_TCGETPGRP)
+
+PyDoc_STRVAR(os_tcgetpgrp__doc__,
+"tcgetpgrp($module, fd, /)\n"
+"--\n"
+"\n"
+"Return the process group associated with the terminal specified by fd.");
+
+#define OS_TCGETPGRP_METHODDEF \
+ {"tcgetpgrp", (PyCFunction)os_tcgetpgrp, METH_O, os_tcgetpgrp__doc__},
+
+static PyObject *
+os_tcgetpgrp_impl(PyObject *module, int fd);
+
+static PyObject *
+os_tcgetpgrp(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_tcgetpgrp_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_TCGETPGRP) */
+
+#if defined(HAVE_TCSETPGRP)
+
+PyDoc_STRVAR(os_tcsetpgrp__doc__,
+"tcsetpgrp($module, fd, pgid, /)\n"
+"--\n"
+"\n"
+"Set the process group associated with the terminal specified by fd.");
+
+#define OS_TCSETPGRP_METHODDEF \
+ {"tcsetpgrp", _PyCFunction_CAST(os_tcsetpgrp), METH_FASTCALL, os_tcsetpgrp__doc__},
+
+static PyObject *
+os_tcsetpgrp_impl(PyObject *module, int fd, pid_t pgid);
+
+static PyObject *
+os_tcsetpgrp(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ pid_t pgid;
+
+ if (!_PyArg_ParseStack(args, nargs, "i" _Py_PARSE_PID ":tcsetpgrp",
+ &fd, &pgid)) {
+ goto exit;
+ }
+ return_value = os_tcsetpgrp_impl(module, fd, pgid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_TCSETPGRP) */
+
+PyDoc_STRVAR(os_open__doc__,
+"open($module, /, path, flags, mode=511, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Open a file for low level IO. Returns a file descriptor (integer).\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_OPEN_METHODDEF \
+ {"open", _PyCFunction_CAST(os_open), METH_FASTCALL|METH_KEYWORDS, os_open__doc__},
+
+static int
+os_open_impl(PyObject *module, path_t *path, int flags, int mode, int dir_fd);
+
+static PyObject *
+os_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(flags), &_Py_ID(mode), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "flags", "mode", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "open",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t path = PATH_T_INITIALIZE("open", "path", 0, 0);
+ int flags;
+ int mode = 511;
+ int dir_fd = DEFAULT_DIR_FD;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ flags = _PyLong_AsInt(args[1]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[2]) {
+ mode = _PyLong_AsInt(args[2]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!OPENAT_DIR_FD_CONVERTER(args[3], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ _return_value = os_open_impl(module, &path, flags, mode, dir_fd);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_close__doc__,
+"close($module, /, fd)\n"
+"--\n"
+"\n"
+"Close a file descriptor.");
+
+#define OS_CLOSE_METHODDEF \
+ {"close", _PyCFunction_CAST(os_close), METH_FASTCALL|METH_KEYWORDS, os_close__doc__},
+
+static PyObject *
+os_close_impl(PyObject *module, int fd);
+
+static PyObject *
+os_close(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "close",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_close_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_closerange__doc__,
+"closerange($module, fd_low, fd_high, /)\n"
+"--\n"
+"\n"
+"Closes all file descriptors in [fd_low, fd_high), ignoring errors.");
+
+#define OS_CLOSERANGE_METHODDEF \
+ {"closerange", _PyCFunction_CAST(os_closerange), METH_FASTCALL, os_closerange__doc__},
+
+static PyObject *
+os_closerange_impl(PyObject *module, int fd_low, int fd_high);
+
+static PyObject *
+os_closerange(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd_low;
+ int fd_high;
+
+ if (!_PyArg_CheckPositional("closerange", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd_low = _PyLong_AsInt(args[0]);
+ if (fd_low == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ fd_high = _PyLong_AsInt(args[1]);
+ if (fd_high == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_closerange_impl(module, fd_low, fd_high);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_dup__doc__,
+"dup($module, fd, /)\n"
+"--\n"
+"\n"
+"Return a duplicate of a file descriptor.");
+
+#define OS_DUP_METHODDEF \
+ {"dup", (PyCFunction)os_dup, METH_O, os_dup__doc__},
+
+static int
+os_dup_impl(PyObject *module, int fd);
+
+static PyObject *
+os_dup(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int _return_value;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_dup_impl(module, fd);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#if ((defined(HAVE_DUP3) || defined(F_DUPFD) || defined(MS_WINDOWS)))
+
+PyDoc_STRVAR(os_dup2__doc__,
+"dup2($module, /, fd, fd2, inheritable=True)\n"
+"--\n"
+"\n"
+"Duplicate file descriptor.");
+
+#define OS_DUP2_METHODDEF \
+ {"dup2", _PyCFunction_CAST(os_dup2), METH_FASTCALL|METH_KEYWORDS, os_dup2__doc__},
+
+static int
+os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable);
+
+static PyObject *
+os_dup2(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(fd2), &_Py_ID(inheritable), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "fd2", "inheritable", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "dup2",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ int fd;
+ int fd2;
+ int inheritable = 1;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ fd2 = _PyLong_AsInt(args[1]);
+ if (fd2 == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ inheritable = PyObject_IsTrue(args[2]);
+ if (inheritable < 0) {
+ goto exit;
+ }
+skip_optional_pos:
+ _return_value = os_dup2_impl(module, fd, fd2, inheritable);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* ((defined(HAVE_DUP3) || defined(F_DUPFD) || defined(MS_WINDOWS))) */
+
+#if defined(HAVE_LOCKF)
+
+PyDoc_STRVAR(os_lockf__doc__,
+"lockf($module, fd, command, length, /)\n"
+"--\n"
+"\n"
+"Apply, test or remove a POSIX lock on an open file descriptor.\n"
+"\n"
+" fd\n"
+" An open file descriptor.\n"
+" command\n"
+" One of F_LOCK, F_TLOCK, F_ULOCK or F_TEST.\n"
+" length\n"
+" The number of bytes to lock, starting at the current position.");
+
+#define OS_LOCKF_METHODDEF \
+ {"lockf", _PyCFunction_CAST(os_lockf), METH_FASTCALL, os_lockf__doc__},
+
+static PyObject *
+os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length);
+
+static PyObject *
+os_lockf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int command;
+ Py_off_t length;
+
+ if (!_PyArg_CheckPositional("lockf", nargs, 3, 3)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ command = _PyLong_AsInt(args[1]);
+ if (command == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[2], &length)) {
+ goto exit;
+ }
+ return_value = os_lockf_impl(module, fd, command, length);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_LOCKF) */
+
+PyDoc_STRVAR(os_lseek__doc__,
+"lseek($module, fd, position, whence, /)\n"
+"--\n"
+"\n"
+"Set the position of a file descriptor. Return the new position.\n"
+"\n"
+" fd\n"
+" An open file descriptor, as returned by os.open().\n"
+" position\n"
+" Position, interpreted relative to \'whence\'.\n"
+" whence\n"
+" The relative position to seek from. Valid values are:\n"
+" - SEEK_SET: seek from the start of the file.\n"
+" - SEEK_CUR: seek from the current file position.\n"
+" - SEEK_END: seek from the end of the file.\n"
+"\n"
+"The return value is the number of bytes relative to the beginning of the file.");
+
+#define OS_LSEEK_METHODDEF \
+ {"lseek", _PyCFunction_CAST(os_lseek), METH_FASTCALL, os_lseek__doc__},
+
+static Py_off_t
+os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how);
+
+static PyObject *
+os_lseek(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_off_t position;
+ int how;
+ Py_off_t _return_value;
+
+ if (!_PyArg_CheckPositional("lseek", nargs, 3, 3)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[1], &position)) {
+ goto exit;
+ }
+ how = _PyLong_AsInt(args[2]);
+ if (how == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_lseek_impl(module, fd, position, how);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromPy_off_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_read__doc__,
+"read($module, fd, length, /)\n"
+"--\n"
+"\n"
+"Read from a file descriptor. Returns a bytes object.");
+
+#define OS_READ_METHODDEF \
+ {"read", _PyCFunction_CAST(os_read), METH_FASTCALL, os_read__doc__},
+
+static PyObject *
+os_read_impl(PyObject *module, int fd, Py_ssize_t length);
+
+static PyObject *
+os_read(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_ssize_t length;
+
+ if (!_PyArg_CheckPositional("read", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
+ }
+ return_value = os_read_impl(module, fd, length);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_READV)
+
+PyDoc_STRVAR(os_readv__doc__,
+"readv($module, fd, buffers, /)\n"
+"--\n"
+"\n"
+"Read from a file descriptor fd into an iterable of buffers.\n"
+"\n"
+"The buffers should be mutable buffers accepting bytes.\n"
+"readv will transfer data into each buffer until it is full\n"
+"and then move on to the next buffer in the sequence to hold\n"
+"the rest of the data.\n"
+"\n"
+"readv returns the total number of bytes read,\n"
+"which may be less than the total capacity of all the buffers.");
+
+#define OS_READV_METHODDEF \
+ {"readv", _PyCFunction_CAST(os_readv), METH_FASTCALL, os_readv__doc__},
+
+static Py_ssize_t
+os_readv_impl(PyObject *module, int fd, PyObject *buffers);
+
+static PyObject *
+os_readv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ PyObject *buffers;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("readv", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffers = args[1];
+ _return_value = os_readv_impl(module, fd, buffers);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_READV) */
+
+#if defined(HAVE_PREAD)
+
+PyDoc_STRVAR(os_pread__doc__,
+"pread($module, fd, length, offset, /)\n"
+"--\n"
+"\n"
+"Read a number of bytes from a file descriptor starting at a particular offset.\n"
+"\n"
+"Read length bytes from file descriptor fd, starting at offset bytes from\n"
+"the beginning of the file. The file offset remains unchanged.");
+
+#define OS_PREAD_METHODDEF \
+ {"pread", _PyCFunction_CAST(os_pread), METH_FASTCALL, os_pread__doc__},
+
+static PyObject *
+os_pread_impl(PyObject *module, int fd, Py_ssize_t length, Py_off_t offset);
+
+static PyObject *
+os_pread(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_ssize_t length;
+ Py_off_t offset;
+
+ if (!_PyArg_CheckPositional("pread", nargs, 3, 3)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
+ }
+ if (!Py_off_t_converter(args[2], &offset)) {
+ goto exit;
+ }
+ return_value = os_pread_impl(module, fd, length, offset);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_PREAD) */
+
+#if (defined(HAVE_PREADV) || defined (HAVE_PREADV2))
+
+PyDoc_STRVAR(os_preadv__doc__,
+"preadv($module, fd, buffers, offset, flags=0, /)\n"
+"--\n"
+"\n"
+"Reads from a file descriptor into a number of mutable bytes-like objects.\n"
+"\n"
+"Combines the functionality of readv() and pread(). As readv(), it will\n"
+"transfer data into each buffer until it is full and then move on to the next\n"
+"buffer in the sequence to hold the rest of the data. Its fourth argument,\n"
+"specifies the file offset at which the input operation is to be performed. It\n"
+"will return the total number of bytes read (which can be less than the total\n"
+"capacity of all the objects).\n"
+"\n"
+"The flags argument contains a bitwise OR of zero or more of the following flags:\n"
+"\n"
+"- RWF_HIPRI\n"
+"- RWF_NOWAIT\n"
+"\n"
+"Using non-zero flags requires Linux 4.6 or newer.");
+
+#define OS_PREADV_METHODDEF \
+ {"preadv", _PyCFunction_CAST(os_preadv), METH_FASTCALL, os_preadv__doc__},
+
+static Py_ssize_t
+os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
+ int flags);
+
+static PyObject *
+os_preadv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ PyObject *buffers;
+ Py_off_t offset;
+ int flags = 0;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("preadv", nargs, 3, 4)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffers = args[1];
+ if (!Py_off_t_converter(args[2], &offset)) {
+ goto exit;
+ }
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ flags = _PyLong_AsInt(args[3]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ _return_value = os_preadv_impl(module, fd, buffers, offset, flags);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_PREADV) || defined (HAVE_PREADV2)) */
+
+PyDoc_STRVAR(os_write__doc__,
+"write($module, fd, data, /)\n"
+"--\n"
+"\n"
+"Write a bytes object to a file descriptor.");
+
+#define OS_WRITE_METHODDEF \
+ {"write", _PyCFunction_CAST(os_write), METH_FASTCALL, os_write__doc__},
+
+static Py_ssize_t
+os_write_impl(PyObject *module, int fd, Py_buffer *data);
+
+static PyObject *
+os_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_buffer data = {NULL, NULL};
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("write", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("write", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ _return_value = os_write_impl(module, fd, &data);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#if defined(HAVE_SENDFILE) && defined(__APPLE__)
+
+PyDoc_STRVAR(os_sendfile__doc__,
+"sendfile($module, /, out_fd, in_fd, offset, count, headers=(),\n"
+" trailers=(), flags=0)\n"
+"--\n"
+"\n"
+"Copy count bytes from file descriptor in_fd to file descriptor out_fd.");
+
+#define OS_SENDFILE_METHODDEF \
+ {"sendfile", _PyCFunction_CAST(os_sendfile), METH_FASTCALL|METH_KEYWORDS, os_sendfile__doc__},
+
+static PyObject *
+os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset,
+ Py_off_t sbytes, PyObject *headers, PyObject *trailers,
+ int flags);
+
+static PyObject *
+os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 7
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(out_fd), &_Py_ID(in_fd), &_Py_ID(offset), &_Py_ID(count), &_Py_ID(headers), &_Py_ID(trailers), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sendfile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[7];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 4;
+ int out_fd;
+ int in_fd;
+ Py_off_t offset;
+ Py_off_t sbytes;
+ PyObject *headers = NULL;
+ PyObject *trailers = NULL;
+ int flags = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 7, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ out_fd = _PyLong_AsInt(args[0]);
+ if (out_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ in_fd = _PyLong_AsInt(args[1]);
+ if (in_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[2], &offset)) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[3], &sbytes)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[4]) {
+ headers = args[4];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[5]) {
+ trailers = args[5];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ flags = _PyLong_AsInt(args[6]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_sendfile_impl(module, out_fd, in_fd, offset, sbytes, headers, trailers, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SENDFILE) && defined(__APPLE__) */
+
+#if defined(HAVE_SENDFILE) && !defined(__APPLE__) && (defined(__FreeBSD__) || defined(__DragonFly__))
+
+PyDoc_STRVAR(os_sendfile__doc__,
+"sendfile($module, /, out_fd, in_fd, offset, count, headers=(),\n"
+" trailers=(), flags=0)\n"
+"--\n"
+"\n"
+"Copy count bytes from file descriptor in_fd to file descriptor out_fd.");
+
+#define OS_SENDFILE_METHODDEF \
+ {"sendfile", _PyCFunction_CAST(os_sendfile), METH_FASTCALL|METH_KEYWORDS, os_sendfile__doc__},
+
+static PyObject *
+os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset,
+ Py_ssize_t count, PyObject *headers, PyObject *trailers,
+ int flags);
+
+static PyObject *
+os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 7
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(out_fd), &_Py_ID(in_fd), &_Py_ID(offset), &_Py_ID(count), &_Py_ID(headers), &_Py_ID(trailers), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sendfile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[7];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 4;
+ int out_fd;
+ int in_fd;
+ Py_off_t offset;
+ Py_ssize_t count;
+ PyObject *headers = NULL;
+ PyObject *trailers = NULL;
+ int flags = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 7, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ out_fd = _PyLong_AsInt(args[0]);
+ if (out_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ in_fd = _PyLong_AsInt(args[1]);
+ if (in_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[2], &offset)) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[3]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ count = ival;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[4]) {
+ headers = args[4];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[5]) {
+ trailers = args[5];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ flags = _PyLong_AsInt(args[6]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_sendfile_impl(module, out_fd, in_fd, offset, count, headers, trailers, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && (defined(__FreeBSD__) || defined(__DragonFly__)) */
+
+#if defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__))
+
+PyDoc_STRVAR(os_sendfile__doc__,
+"sendfile($module, /, out_fd, in_fd, offset, count)\n"
+"--\n"
+"\n"
+"Copy count bytes from file descriptor in_fd to file descriptor out_fd.");
+
+#define OS_SENDFILE_METHODDEF \
+ {"sendfile", _PyCFunction_CAST(os_sendfile), METH_FASTCALL|METH_KEYWORDS, os_sendfile__doc__},
+
+static PyObject *
+os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
+ Py_ssize_t count);
+
+static PyObject *
+os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(out_fd), &_Py_ID(in_fd), &_Py_ID(offset), &_Py_ID(count), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sendfile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ int out_fd;
+ int in_fd;
+ PyObject *offobj;
+ Py_ssize_t count;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ out_fd = _PyLong_AsInt(args[0]);
+ if (out_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ in_fd = _PyLong_AsInt(args[1]);
+ if (in_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ offobj = args[2];
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[3]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ count = ival;
+ }
+ return_value = os_sendfile_impl(module, out_fd, in_fd, offobj, count);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */
+
+#if defined(__APPLE__)
+
+PyDoc_STRVAR(os__fcopyfile__doc__,
+"_fcopyfile($module, in_fd, out_fd, flags, /)\n"
+"--\n"
+"\n"
+"Efficiently copy content or metadata of 2 regular file descriptors (macOS).");
+
+#define OS__FCOPYFILE_METHODDEF \
+ {"_fcopyfile", _PyCFunction_CAST(os__fcopyfile), METH_FASTCALL, os__fcopyfile__doc__},
+
+static PyObject *
+os__fcopyfile_impl(PyObject *module, int in_fd, int out_fd, int flags);
+
+static PyObject *
+os__fcopyfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int in_fd;
+ int out_fd;
+ int flags;
+
+ if (!_PyArg_CheckPositional("_fcopyfile", nargs, 3, 3)) {
+ goto exit;
+ }
+ in_fd = _PyLong_AsInt(args[0]);
+ if (in_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ out_fd = _PyLong_AsInt(args[1]);
+ if (out_fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ flags = _PyLong_AsInt(args[2]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os__fcopyfile_impl(module, in_fd, out_fd, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(__APPLE__) */
+
+PyDoc_STRVAR(os_fstat__doc__,
+"fstat($module, /, fd)\n"
+"--\n"
+"\n"
+"Perform a stat system call on the given file descriptor.\n"
+"\n"
+"Like stat(), but for an open file descriptor.\n"
+"Equivalent to os.stat(fd).");
+
+#define OS_FSTAT_METHODDEF \
+ {"fstat", _PyCFunction_CAST(os_fstat), METH_FASTCALL|METH_KEYWORDS, os_fstat__doc__},
+
+static PyObject *
+os_fstat_impl(PyObject *module, int fd);
+
+static PyObject *
+os_fstat(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fstat",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_fstat_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_isatty__doc__,
+"isatty($module, fd, /)\n"
+"--\n"
+"\n"
+"Return True if the fd is connected to a terminal.\n"
+"\n"
+"Return True if the file descriptor is an open file descriptor\n"
+"connected to the slave end of a terminal.");
+
+#define OS_ISATTY_METHODDEF \
+ {"isatty", (PyCFunction)os_isatty, METH_O, os_isatty__doc__},
+
+static int
+os_isatty_impl(PyObject *module, int fd);
+
+static PyObject *
+os_isatty(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int _return_value;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_isatty_impl(module, fd);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_PIPE)
+
+PyDoc_STRVAR(os_pipe__doc__,
+"pipe($module, /)\n"
+"--\n"
+"\n"
+"Create a pipe.\n"
+"\n"
+"Returns a tuple of two file descriptors:\n"
+" (read_fd, write_fd)");
+
+#define OS_PIPE_METHODDEF \
+ {"pipe", (PyCFunction)os_pipe, METH_NOARGS, os_pipe__doc__},
+
+static PyObject *
+os_pipe_impl(PyObject *module);
+
+static PyObject *
+os_pipe(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_pipe_impl(module);
+}
+
+#endif /* defined(HAVE_PIPE) */
+
+#if defined(HAVE_PIPE2)
+
+PyDoc_STRVAR(os_pipe2__doc__,
+"pipe2($module, flags, /)\n"
+"--\n"
+"\n"
+"Create a pipe with flags set atomically.\n"
+"\n"
+"Returns a tuple of two file descriptors:\n"
+" (read_fd, write_fd)\n"
+"\n"
+"flags can be constructed by ORing together one or more of these values:\n"
+"O_NONBLOCK, O_CLOEXEC.");
+
+#define OS_PIPE2_METHODDEF \
+ {"pipe2", (PyCFunction)os_pipe2, METH_O, os_pipe2__doc__},
+
+static PyObject *
+os_pipe2_impl(PyObject *module, int flags);
+
+static PyObject *
+os_pipe2(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int flags;
+
+ flags = _PyLong_AsInt(arg);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_pipe2_impl(module, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_PIPE2) */
+
+#if defined(HAVE_WRITEV)
+
+PyDoc_STRVAR(os_writev__doc__,
+"writev($module, fd, buffers, /)\n"
+"--\n"
+"\n"
+"Iterate over buffers, and write the contents of each to a file descriptor.\n"
+"\n"
+"Returns the total number of bytes written.\n"
+"buffers must be a sequence of bytes-like objects.");
+
+#define OS_WRITEV_METHODDEF \
+ {"writev", _PyCFunction_CAST(os_writev), METH_FASTCALL, os_writev__doc__},
+
+static Py_ssize_t
+os_writev_impl(PyObject *module, int fd, PyObject *buffers);
+
+static PyObject *
+os_writev(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ PyObject *buffers;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("writev", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffers = args[1];
+ _return_value = os_writev_impl(module, fd, buffers);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_WRITEV) */
+
+#if defined(HAVE_PWRITE)
+
+PyDoc_STRVAR(os_pwrite__doc__,
+"pwrite($module, fd, buffer, offset, /)\n"
+"--\n"
+"\n"
+"Write bytes to a file descriptor starting at a particular offset.\n"
+"\n"
+"Write buffer to fd, starting at offset bytes from the beginning of\n"
+"the file. Returns the number of bytes writte. Does not change the\n"
+"current file offset.");
+
+#define OS_PWRITE_METHODDEF \
+ {"pwrite", _PyCFunction_CAST(os_pwrite), METH_FASTCALL, os_pwrite__doc__},
+
+static Py_ssize_t
+os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset);
+
+static PyObject *
+os_pwrite(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_buffer buffer = {NULL, NULL};
+ Py_off_t offset;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("pwrite", nargs, 3, 3)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&buffer, 'C')) {
+ _PyArg_BadArgument("pwrite", "argument 2", "contiguous buffer", args[1]);
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[2], &offset)) {
+ goto exit;
+ }
+ _return_value = os_pwrite_impl(module, fd, &buffer, offset);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_PWRITE) */
+
+#if (defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2))
+
+PyDoc_STRVAR(os_pwritev__doc__,
+"pwritev($module, fd, buffers, offset, flags=0, /)\n"
+"--\n"
+"\n"
+"Writes the contents of bytes-like objects to a file descriptor at a given offset.\n"
+"\n"
+"Combines the functionality of writev() and pwrite(). All buffers must be a sequence\n"
+"of bytes-like objects. Buffers are processed in array order. Entire contents of first\n"
+"buffer is written before proceeding to second, and so on. The operating system may\n"
+"set a limit (sysconf() value SC_IOV_MAX) on the number of buffers that can be used.\n"
+"This function writes the contents of each object to the file descriptor and returns\n"
+"the total number of bytes written.\n"
+"\n"
+"The flags argument contains a bitwise OR of zero or more of the following flags:\n"
+"\n"
+"- RWF_DSYNC\n"
+"- RWF_SYNC\n"
+"- RWF_APPEND\n"
+"\n"
+"Using non-zero flags requires Linux 4.7 or newer.");
+
+#define OS_PWRITEV_METHODDEF \
+ {"pwritev", _PyCFunction_CAST(os_pwritev), METH_FASTCALL, os_pwritev__doc__},
+
+static Py_ssize_t
+os_pwritev_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
+ int flags);
+
+static PyObject *
+os_pwritev(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ PyObject *buffers;
+ Py_off_t offset;
+ int flags = 0;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_CheckPositional("pwritev", nargs, 3, 4)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ buffers = args[1];
+ if (!Py_off_t_converter(args[2], &offset)) {
+ goto exit;
+ }
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ flags = _PyLong_AsInt(args[3]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ _return_value = os_pwritev_impl(module, fd, buffers, offset, flags);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2)) */
+
+#if defined(HAVE_COPY_FILE_RANGE)
+
+PyDoc_STRVAR(os_copy_file_range__doc__,
+"copy_file_range($module, /, src, dst, count, offset_src=None,\n"
+" offset_dst=None)\n"
+"--\n"
+"\n"
+"Copy count bytes from one file descriptor to another.\n"
+"\n"
+" src\n"
+" Source file descriptor.\n"
+" dst\n"
+" Destination file descriptor.\n"
+" count\n"
+" Number of bytes to copy.\n"
+" offset_src\n"
+" Starting offset in src.\n"
+" offset_dst\n"
+" Starting offset in dst.\n"
+"\n"
+"If offset_src is None, then src is read from the current position;\n"
+"respectively for offset_dst.");
+
+#define OS_COPY_FILE_RANGE_METHODDEF \
+ {"copy_file_range", _PyCFunction_CAST(os_copy_file_range), METH_FASTCALL|METH_KEYWORDS, os_copy_file_range__doc__},
+
+static PyObject *
+os_copy_file_range_impl(PyObject *module, int src, int dst, Py_ssize_t count,
+ PyObject *offset_src, PyObject *offset_dst);
+
+static PyObject *
+os_copy_file_range(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(src), &_Py_ID(dst), &_Py_ID(count), &_Py_ID(offset_src), &_Py_ID(offset_dst), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"src", "dst", "count", "offset_src", "offset_dst", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "copy_file_range",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ int src;
+ int dst;
+ Py_ssize_t count;
+ PyObject *offset_src = Py_None;
+ PyObject *offset_dst = Py_None;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 5, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ src = _PyLong_AsInt(args[0]);
+ if (src == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ dst = _PyLong_AsInt(args[1]);
+ if (dst == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ count = ival;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[3]) {
+ offset_src = args[3];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ offset_dst = args[4];
+skip_optional_pos:
+ return_value = os_copy_file_range_impl(module, src, dst, count, offset_src, offset_dst);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_COPY_FILE_RANGE) */
+
+#if ((defined(HAVE_SPLICE) && !defined(_AIX)))
+
+PyDoc_STRVAR(os_splice__doc__,
+"splice($module, /, src, dst, count, offset_src=None, offset_dst=None,\n"
+" flags=0)\n"
+"--\n"
+"\n"
+"Transfer count bytes from one pipe to a descriptor or vice versa.\n"
+"\n"
+" src\n"
+" Source file descriptor.\n"
+" dst\n"
+" Destination file descriptor.\n"
+" count\n"
+" Number of bytes to copy.\n"
+" offset_src\n"
+" Starting offset in src.\n"
+" offset_dst\n"
+" Starting offset in dst.\n"
+" flags\n"
+" Flags to modify the semantics of the call.\n"
+"\n"
+"If offset_src is None, then src is read from the current position;\n"
+"respectively for offset_dst. The offset associated to the file\n"
+"descriptor that refers to a pipe must be None.");
+
+#define OS_SPLICE_METHODDEF \
+ {"splice", _PyCFunction_CAST(os_splice), METH_FASTCALL|METH_KEYWORDS, os_splice__doc__},
+
+static PyObject *
+os_splice_impl(PyObject *module, int src, int dst, Py_ssize_t count,
+ PyObject *offset_src, PyObject *offset_dst,
+ unsigned int flags);
+
+static PyObject *
+os_splice(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 6
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(src), &_Py_ID(dst), &_Py_ID(count), &_Py_ID(offset_src), &_Py_ID(offset_dst), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"src", "dst", "count", "offset_src", "offset_dst", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "splice",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[6];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ int src;
+ int dst;
+ Py_ssize_t count;
+ PyObject *offset_src = Py_None;
+ PyObject *offset_dst = Py_None;
+ unsigned int flags = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 6, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ src = _PyLong_AsInt(args[0]);
+ if (src == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ dst = _PyLong_AsInt(args[1]);
+ if (dst == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ count = ival;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[3]) {
+ offset_src = args[3];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[4]) {
+ offset_dst = args[4];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (!_PyLong_UnsignedInt_Converter(args[5], &flags)) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_splice_impl(module, src, dst, count, offset_src, offset_dst, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* ((defined(HAVE_SPLICE) && !defined(_AIX))) */
+
+#if defined(HAVE_MKFIFO)
+
+PyDoc_STRVAR(os_mkfifo__doc__,
+"mkfifo($module, /, path, mode=438, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Create a \"fifo\" (a POSIX named pipe).\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_MKFIFO_METHODDEF \
+ {"mkfifo", _PyCFunction_CAST(os_mkfifo), METH_FASTCALL|METH_KEYWORDS, os_mkfifo__doc__},
+
+static PyObject *
+os_mkfifo_impl(PyObject *module, path_t *path, int mode, int dir_fd);
+
+static PyObject *
+os_mkfifo(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(mode), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "mode", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "mkfifo",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("mkfifo", "path", 0, 0);
+ int mode = 438;
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!MKFIFOAT_DIR_FD_CONVERTER(args[2], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_mkfifo_impl(module, &path, mode, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_MKFIFO) */
+
+#if (defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV))
+
+PyDoc_STRVAR(os_mknod__doc__,
+"mknod($module, /, path, mode=384, device=0, *, dir_fd=None)\n"
+"--\n"
+"\n"
+"Create a node in the file system.\n"
+"\n"
+"Create a node in the file system (file, device special file or named pipe)\n"
+"at path. mode specifies both the permissions to use and the\n"
+"type of node to be created, being combined (bitwise OR) with one of\n"
+"S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO. If S_IFCHR or S_IFBLK is set on mode,\n"
+"device defines the newly created device special file (probably using\n"
+"os.makedev()). Otherwise device is ignored.\n"
+"\n"
+"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
+" and path should be relative; path will then be relative to that directory.\n"
+"dir_fd may not be implemented on your platform.\n"
+" If it is unavailable, using it will raise a NotImplementedError.");
+
+#define OS_MKNOD_METHODDEF \
+ {"mknod", _PyCFunction_CAST(os_mknod), METH_FASTCALL|METH_KEYWORDS, os_mknod__doc__},
+
+static PyObject *
+os_mknod_impl(PyObject *module, path_t *path, int mode, dev_t device,
+ int dir_fd);
+
+static PyObject *
+os_mknod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(mode), &_Py_ID(device), &_Py_ID(dir_fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "mode", "device", "dir_fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "mknod",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t path = PATH_T_INITIALIZE("mknod", "path", 0, 0);
+ int mode = 384;
+ dev_t device = 0;
+ int dir_fd = DEFAULT_DIR_FD;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ mode = _PyLong_AsInt(args[1]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[2]) {
+ if (!_Py_Dev_Converter(args[2], &device)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!MKNODAT_DIR_FD_CONVERTER(args[3], &dir_fd)) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_mknod_impl(module, &path, mode, device, dir_fd);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)) */
+
+#if defined(HAVE_DEVICE_MACROS)
+
+PyDoc_STRVAR(os_major__doc__,
+"major($module, device, /)\n"
+"--\n"
+"\n"
+"Extracts a device major number from a raw device number.");
+
+#define OS_MAJOR_METHODDEF \
+ {"major", (PyCFunction)os_major, METH_O, os_major__doc__},
+
+static unsigned int
+os_major_impl(PyObject *module, dev_t device);
+
+static PyObject *
+os_major(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ dev_t device;
+ unsigned int _return_value;
+
+ if (!_Py_Dev_Converter(arg, &device)) {
+ goto exit;
+ }
+ _return_value = os_major_impl(module, device);
+ if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_DEVICE_MACROS) */
+
+#if defined(HAVE_DEVICE_MACROS)
+
+PyDoc_STRVAR(os_minor__doc__,
+"minor($module, device, /)\n"
+"--\n"
+"\n"
+"Extracts a device minor number from a raw device number.");
+
+#define OS_MINOR_METHODDEF \
+ {"minor", (PyCFunction)os_minor, METH_O, os_minor__doc__},
+
+static unsigned int
+os_minor_impl(PyObject *module, dev_t device);
+
+static PyObject *
+os_minor(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ dev_t device;
+ unsigned int _return_value;
+
+ if (!_Py_Dev_Converter(arg, &device)) {
+ goto exit;
+ }
+ _return_value = os_minor_impl(module, device);
+ if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_DEVICE_MACROS) */
+
+#if defined(HAVE_DEVICE_MACROS)
+
+PyDoc_STRVAR(os_makedev__doc__,
+"makedev($module, major, minor, /)\n"
+"--\n"
+"\n"
+"Composes a raw device number from the major and minor device numbers.");
+
+#define OS_MAKEDEV_METHODDEF \
+ {"makedev", _PyCFunction_CAST(os_makedev), METH_FASTCALL, os_makedev__doc__},
+
+static dev_t
+os_makedev_impl(PyObject *module, int major, int minor);
+
+static PyObject *
+os_makedev(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int major;
+ int minor;
+ dev_t _return_value;
+
+ if (!_PyArg_CheckPositional("makedev", nargs, 2, 2)) {
+ goto exit;
+ }
+ major = _PyLong_AsInt(args[0]);
+ if (major == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ minor = _PyLong_AsInt(args[1]);
+ if (minor == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_makedev_impl(module, major, minor);
+ if ((_return_value == (dev_t)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = _PyLong_FromDev(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_DEVICE_MACROS) */
+
+#if (defined HAVE_FTRUNCATE || defined MS_WINDOWS)
+
+PyDoc_STRVAR(os_ftruncate__doc__,
+"ftruncate($module, fd, length, /)\n"
+"--\n"
+"\n"
+"Truncate a file, specified by file descriptor, to a specific length.");
+
+#define OS_FTRUNCATE_METHODDEF \
+ {"ftruncate", _PyCFunction_CAST(os_ftruncate), METH_FASTCALL, os_ftruncate__doc__},
+
+static PyObject *
+os_ftruncate_impl(PyObject *module, int fd, Py_off_t length);
+
+static PyObject *
+os_ftruncate(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_off_t length;
+
+ if (!_PyArg_CheckPositional("ftruncate", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[1], &length)) {
+ goto exit;
+ }
+ return_value = os_ftruncate_impl(module, fd, length);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined HAVE_FTRUNCATE || defined MS_WINDOWS) */
+
+#if (defined HAVE_TRUNCATE || defined MS_WINDOWS)
+
+PyDoc_STRVAR(os_truncate__doc__,
+"truncate($module, /, path, length)\n"
+"--\n"
+"\n"
+"Truncate a file, specified by path, to a specific length.\n"
+"\n"
+"On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.");
+
+#define OS_TRUNCATE_METHODDEF \
+ {"truncate", _PyCFunction_CAST(os_truncate), METH_FASTCALL|METH_KEYWORDS, os_truncate__doc__},
+
+static PyObject *
+os_truncate_impl(PyObject *module, path_t *path, Py_off_t length);
+
+static PyObject *
+os_truncate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "truncate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ path_t path = PATH_T_INITIALIZE("truncate", "path", 0, PATH_HAVE_FTRUNCATE);
+ Py_off_t length;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[1], &length)) {
+ goto exit;
+ }
+ return_value = os_truncate_impl(module, &path, length);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined HAVE_TRUNCATE || defined MS_WINDOWS) */
+
+#if (defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && !defined(__wasi__))
+
+PyDoc_STRVAR(os_posix_fallocate__doc__,
+"posix_fallocate($module, fd, offset, length, /)\n"
+"--\n"
+"\n"
+"Ensure a file has allocated at least a particular number of bytes on disk.\n"
+"\n"
+"Ensure that the file specified by fd encompasses a range of bytes\n"
+"starting at offset bytes from the beginning and continuing for length bytes.");
+
+#define OS_POSIX_FALLOCATE_METHODDEF \
+ {"posix_fallocate", _PyCFunction_CAST(os_posix_fallocate), METH_FASTCALL, os_posix_fallocate__doc__},
+
+static PyObject *
+os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
+ Py_off_t length);
+
+static PyObject *
+os_posix_fallocate(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_off_t offset;
+ Py_off_t length;
+
+ if (!_PyArg_CheckPositional("posix_fallocate", nargs, 3, 3)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[1], &offset)) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[2], &length)) {
+ goto exit;
+ }
+ return_value = os_posix_fallocate_impl(module, fd, offset, length);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && !defined(__wasi__)) */
+
+#if (defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG))
+
+PyDoc_STRVAR(os_posix_fadvise__doc__,
+"posix_fadvise($module, fd, offset, length, advice, /)\n"
+"--\n"
+"\n"
+"Announce an intention to access data in a specific pattern.\n"
+"\n"
+"Announce an intention to access data in a specific pattern, thus allowing\n"
+"the kernel to make optimizations.\n"
+"The advice applies to the region of the file specified by fd starting at\n"
+"offset and continuing for length bytes.\n"
+"advice is one of POSIX_FADV_NORMAL, POSIX_FADV_SEQUENTIAL,\n"
+"POSIX_FADV_RANDOM, POSIX_FADV_NOREUSE, POSIX_FADV_WILLNEED, or\n"
+"POSIX_FADV_DONTNEED.");
+
+#define OS_POSIX_FADVISE_METHODDEF \
+ {"posix_fadvise", _PyCFunction_CAST(os_posix_fadvise), METH_FASTCALL, os_posix_fadvise__doc__},
+
+static PyObject *
+os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
+ Py_off_t length, int advice);
+
+static PyObject *
+os_posix_fadvise(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ Py_off_t offset;
+ Py_off_t length;
+ int advice;
+
+ if (!_PyArg_CheckPositional("posix_fadvise", nargs, 4, 4)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[1], &offset)) {
+ goto exit;
+ }
+ if (!Py_off_t_converter(args[2], &length)) {
+ goto exit;
+ }
+ advice = _PyLong_AsInt(args[3]);
+ if (advice == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_posix_fadvise_impl(module, fd, offset, length, advice);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_putenv__doc__,
+"putenv($module, name, value, /)\n"
+"--\n"
+"\n"
+"Change or add an environment variable.");
+
+#define OS_PUTENV_METHODDEF \
+ {"putenv", _PyCFunction_CAST(os_putenv), METH_FASTCALL, os_putenv__doc__},
+
+static PyObject *
+os_putenv_impl(PyObject *module, PyObject *name, PyObject *value);
+
+static PyObject *
+os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *name;
+ PyObject *value;
+
+ if (!_PyArg_CheckPositional("putenv", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("putenv", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ name = args[0];
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("putenv", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[1]) == -1) {
+ goto exit;
+ }
+ value = args[1];
+ return_value = os_putenv_impl(module, name, value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if !defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_putenv__doc__,
+"putenv($module, name, value, /)\n"
+"--\n"
+"\n"
+"Change or add an environment variable.");
+
+#define OS_PUTENV_METHODDEF \
+ {"putenv", _PyCFunction_CAST(os_putenv), METH_FASTCALL, os_putenv__doc__},
+
+static PyObject *
+os_putenv_impl(PyObject *module, PyObject *name, PyObject *value);
+
+static PyObject *
+os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *name = NULL;
+ PyObject *value = NULL;
+
+ if (!_PyArg_CheckPositional("putenv", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_FSConverter(args[0], &name)) {
+ goto exit;
+ }
+ if (!PyUnicode_FSConverter(args[1], &value)) {
+ goto exit;
+ }
+ return_value = os_putenv_impl(module, name, value);
+
+exit:
+ /* Cleanup for name */
+ Py_XDECREF(name);
+ /* Cleanup for value */
+ Py_XDECREF(value);
+
+ return return_value;
+}
+
+#endif /* !defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_unsetenv__doc__,
+"unsetenv($module, name, /)\n"
+"--\n"
+"\n"
+"Delete an environment variable.");
+
+#define OS_UNSETENV_METHODDEF \
+ {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__},
+
+static PyObject *
+os_unsetenv_impl(PyObject *module, PyObject *name);
+
+static PyObject *
+os_unsetenv(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *name;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("unsetenv", "argument", "str", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ name = arg;
+ return_value = os_unsetenv_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if !defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_unsetenv__doc__,
+"unsetenv($module, name, /)\n"
+"--\n"
+"\n"
+"Delete an environment variable.");
+
+#define OS_UNSETENV_METHODDEF \
+ {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__},
+
+static PyObject *
+os_unsetenv_impl(PyObject *module, PyObject *name);
+
+static PyObject *
+os_unsetenv(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *name = NULL;
+
+ if (!PyUnicode_FSConverter(arg, &name)) {
+ goto exit;
+ }
+ return_value = os_unsetenv_impl(module, name);
+
+exit:
+ /* Cleanup for name */
+ Py_XDECREF(name);
+
+ return return_value;
+}
+
+#endif /* !defined(MS_WINDOWS) */
+
+PyDoc_STRVAR(os_strerror__doc__,
+"strerror($module, code, /)\n"
+"--\n"
+"\n"
+"Translate an error code to a message string.");
+
+#define OS_STRERROR_METHODDEF \
+ {"strerror", (PyCFunction)os_strerror, METH_O, os_strerror__doc__},
+
+static PyObject *
+os_strerror_impl(PyObject *module, int code);
+
+static PyObject *
+os_strerror(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int code;
+
+ code = _PyLong_AsInt(arg);
+ if (code == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_strerror_impl(module, code);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WCOREDUMP)
+
+PyDoc_STRVAR(os_WCOREDUMP__doc__,
+"WCOREDUMP($module, status, /)\n"
+"--\n"
+"\n"
+"Return True if the process returning status was dumped to a core file.");
+
+#define OS_WCOREDUMP_METHODDEF \
+ {"WCOREDUMP", (PyCFunction)os_WCOREDUMP, METH_O, os_WCOREDUMP__doc__},
+
+static int
+os_WCOREDUMP_impl(PyObject *module, int status);
+
+static PyObject *
+os_WCOREDUMP(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int status;
+ int _return_value;
+
+ status = _PyLong_AsInt(arg);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WCOREDUMP_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WCOREDUMP) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WIFCONTINUED)
+
+PyDoc_STRVAR(os_WIFCONTINUED__doc__,
+"WIFCONTINUED($module, /, status)\n"
+"--\n"
+"\n"
+"Return True if a particular process was continued from a job control stop.\n"
+"\n"
+"Return True if the process returning status was continued from a\n"
+"job control stop.");
+
+#define OS_WIFCONTINUED_METHODDEF \
+ {"WIFCONTINUED", _PyCFunction_CAST(os_WIFCONTINUED), METH_FASTCALL|METH_KEYWORDS, os_WIFCONTINUED__doc__},
+
+static int
+os_WIFCONTINUED_impl(PyObject *module, int status);
+
+static PyObject *
+os_WIFCONTINUED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WIFCONTINUED",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WIFCONTINUED_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WIFCONTINUED) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WIFSTOPPED)
+
+PyDoc_STRVAR(os_WIFSTOPPED__doc__,
+"WIFSTOPPED($module, /, status)\n"
+"--\n"
+"\n"
+"Return True if the process returning status was stopped.");
+
+#define OS_WIFSTOPPED_METHODDEF \
+ {"WIFSTOPPED", _PyCFunction_CAST(os_WIFSTOPPED), METH_FASTCALL|METH_KEYWORDS, os_WIFSTOPPED__doc__},
+
+static int
+os_WIFSTOPPED_impl(PyObject *module, int status);
+
+static PyObject *
+os_WIFSTOPPED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WIFSTOPPED",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WIFSTOPPED_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WIFSTOPPED) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WIFSIGNALED)
+
+PyDoc_STRVAR(os_WIFSIGNALED__doc__,
+"WIFSIGNALED($module, /, status)\n"
+"--\n"
+"\n"
+"Return True if the process returning status was terminated by a signal.");
+
+#define OS_WIFSIGNALED_METHODDEF \
+ {"WIFSIGNALED", _PyCFunction_CAST(os_WIFSIGNALED), METH_FASTCALL|METH_KEYWORDS, os_WIFSIGNALED__doc__},
+
+static int
+os_WIFSIGNALED_impl(PyObject *module, int status);
+
+static PyObject *
+os_WIFSIGNALED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WIFSIGNALED",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WIFSIGNALED_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WIFSIGNALED) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WIFEXITED)
+
+PyDoc_STRVAR(os_WIFEXITED__doc__,
+"WIFEXITED($module, /, status)\n"
+"--\n"
+"\n"
+"Return True if the process returning status exited via the exit() system call.");
+
+#define OS_WIFEXITED_METHODDEF \
+ {"WIFEXITED", _PyCFunction_CAST(os_WIFEXITED), METH_FASTCALL|METH_KEYWORDS, os_WIFEXITED__doc__},
+
+static int
+os_WIFEXITED_impl(PyObject *module, int status);
+
+static PyObject *
+os_WIFEXITED(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WIFEXITED",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WIFEXITED_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WIFEXITED) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WEXITSTATUS)
+
+PyDoc_STRVAR(os_WEXITSTATUS__doc__,
+"WEXITSTATUS($module, /, status)\n"
+"--\n"
+"\n"
+"Return the process return code from status.");
+
+#define OS_WEXITSTATUS_METHODDEF \
+ {"WEXITSTATUS", _PyCFunction_CAST(os_WEXITSTATUS), METH_FASTCALL|METH_KEYWORDS, os_WEXITSTATUS__doc__},
+
+static int
+os_WEXITSTATUS_impl(PyObject *module, int status);
+
+static PyObject *
+os_WEXITSTATUS(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WEXITSTATUS",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WEXITSTATUS_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WEXITSTATUS) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WTERMSIG)
+
+PyDoc_STRVAR(os_WTERMSIG__doc__,
+"WTERMSIG($module, /, status)\n"
+"--\n"
+"\n"
+"Return the signal that terminated the process that provided the status value.");
+
+#define OS_WTERMSIG_METHODDEF \
+ {"WTERMSIG", _PyCFunction_CAST(os_WTERMSIG), METH_FASTCALL|METH_KEYWORDS, os_WTERMSIG__doc__},
+
+static int
+os_WTERMSIG_impl(PyObject *module, int status);
+
+static PyObject *
+os_WTERMSIG(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WTERMSIG",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WTERMSIG_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WTERMSIG) */
+
+#if defined(HAVE_SYS_WAIT_H) && defined(WSTOPSIG)
+
+PyDoc_STRVAR(os_WSTOPSIG__doc__,
+"WSTOPSIG($module, /, status)\n"
+"--\n"
+"\n"
+"Return the signal that stopped the process that provided the status value.");
+
+#define OS_WSTOPSIG_METHODDEF \
+ {"WSTOPSIG", _PyCFunction_CAST(os_WSTOPSIG), METH_FASTCALL|METH_KEYWORDS, os_WSTOPSIG__doc__},
+
+static int
+os_WSTOPSIG_impl(PyObject *module, int status);
+
+static PyObject *
+os_WSTOPSIG(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "WSTOPSIG",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int status;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status = _PyLong_AsInt(args[0]);
+ if (status == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_WSTOPSIG_impl(module, status);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYS_WAIT_H) && defined(WSTOPSIG) */
+
+#if (defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H))
+
+PyDoc_STRVAR(os_fstatvfs__doc__,
+"fstatvfs($module, fd, /)\n"
+"--\n"
+"\n"
+"Perform an fstatvfs system call on the given fd.\n"
+"\n"
+"Equivalent to statvfs(fd).");
+
+#define OS_FSTATVFS_METHODDEF \
+ {"fstatvfs", (PyCFunction)os_fstatvfs, METH_O, os_fstatvfs__doc__},
+
+static PyObject *
+os_fstatvfs_impl(PyObject *module, int fd);
+
+static PyObject *
+os_fstatvfs(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_fstatvfs_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H)) */
+
+#if (defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H))
+
+PyDoc_STRVAR(os_statvfs__doc__,
+"statvfs($module, /, path)\n"
+"--\n"
+"\n"
+"Perform a statvfs system call on the given path.\n"
+"\n"
+"path may always be specified as a string.\n"
+"On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.");
+
+#define OS_STATVFS_METHODDEF \
+ {"statvfs", _PyCFunction_CAST(os_statvfs), METH_FASTCALL|METH_KEYWORDS, os_statvfs__doc__},
+
+static PyObject *
+os_statvfs_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os_statvfs(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "statvfs",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("statvfs", "path", 0, PATH_HAVE_FSTATVFS);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os_statvfs_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H)) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os__getdiskusage__doc__,
+"_getdiskusage($module, /, path)\n"
+"--\n"
+"\n"
+"Return disk usage statistics about the given path as a (total, free) tuple.");
+
+#define OS__GETDISKUSAGE_METHODDEF \
+ {"_getdiskusage", _PyCFunction_CAST(os__getdiskusage), METH_FASTCALL|METH_KEYWORDS, os__getdiskusage__doc__},
+
+static PyObject *
+os__getdiskusage_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__getdiskusage(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_getdiskusage",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("_getdiskusage", "path", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os__getdiskusage_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(HAVE_FPATHCONF)
+
+PyDoc_STRVAR(os_fpathconf__doc__,
+"fpathconf($module, fd, name, /)\n"
+"--\n"
+"\n"
+"Return the configuration limit name for the file descriptor fd.\n"
+"\n"
+"If there is no limit, return -1.");
+
+#define OS_FPATHCONF_METHODDEF \
+ {"fpathconf", _PyCFunction_CAST(os_fpathconf), METH_FASTCALL, os_fpathconf__doc__},
+
+static long
+os_fpathconf_impl(PyObject *module, int fd, int name);
+
+static PyObject *
+os_fpathconf(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int name;
+ long _return_value;
+
+ if (!_PyArg_CheckPositional("fpathconf", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (!conv_path_confname(args[1], &name)) {
+ goto exit;
+ }
+ _return_value = os_fpathconf_impl(module, fd, name);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_FPATHCONF) */
+
+#if defined(HAVE_PATHCONF)
+
+PyDoc_STRVAR(os_pathconf__doc__,
+"pathconf($module, /, path, name)\n"
+"--\n"
+"\n"
+"Return the configuration limit name for the file or directory path.\n"
+"\n"
+"If there is no limit, return -1.\n"
+"On some platforms, path may also be specified as an open file descriptor.\n"
+" If this functionality is unavailable, using it raises an exception.");
+
+#define OS_PATHCONF_METHODDEF \
+ {"pathconf", _PyCFunction_CAST(os_pathconf), METH_FASTCALL|METH_KEYWORDS, os_pathconf__doc__},
+
+static long
+os_pathconf_impl(PyObject *module, path_t *path, int name);
+
+static PyObject *
+os_pathconf(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(name), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "name", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "pathconf",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ path_t path = PATH_T_INITIALIZE("pathconf", "path", 0, PATH_HAVE_FPATHCONF);
+ int name;
+ long _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!conv_path_confname(args[1], &name)) {
+ goto exit;
+ }
+ _return_value = os_pathconf_impl(module, &path, name);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_PATHCONF) */
+
+#if defined(HAVE_CONFSTR)
+
+PyDoc_STRVAR(os_confstr__doc__,
+"confstr($module, name, /)\n"
+"--\n"
+"\n"
+"Return a string-valued system configuration variable.");
+
+#define OS_CONFSTR_METHODDEF \
+ {"confstr", (PyCFunction)os_confstr, METH_O, os_confstr__doc__},
+
+static PyObject *
+os_confstr_impl(PyObject *module, int name);
+
+static PyObject *
+os_confstr(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int name;
+
+ if (!conv_confstr_confname(arg, &name)) {
+ goto exit;
+ }
+ return_value = os_confstr_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_CONFSTR) */
+
+#if defined(HAVE_SYSCONF)
+
+PyDoc_STRVAR(os_sysconf__doc__,
+"sysconf($module, name, /)\n"
+"--\n"
+"\n"
+"Return an integer-valued system configuration variable.");
+
+#define OS_SYSCONF_METHODDEF \
+ {"sysconf", (PyCFunction)os_sysconf, METH_O, os_sysconf__doc__},
+
+static long
+os_sysconf_impl(PyObject *module, int name);
+
+static PyObject *
+os_sysconf(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int name;
+ long _return_value;
+
+ if (!conv_sysconf_confname(arg, &name)) {
+ goto exit;
+ }
+ _return_value = os_sysconf_impl(module, name);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SYSCONF) */
+
+PyDoc_STRVAR(os_abort__doc__,
+"abort($module, /)\n"
+"--\n"
+"\n"
+"Abort the interpreter immediately.\n"
+"\n"
+"This function \'dumps core\' or otherwise fails in the hardest way possible\n"
+"on the hosting operating system. This function never returns.");
+
+#define OS_ABORT_METHODDEF \
+ {"abort", (PyCFunction)os_abort, METH_NOARGS, os_abort__doc__},
+
+static PyObject *
+os_abort_impl(PyObject *module);
+
+static PyObject *
+os_abort(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_abort_impl(module);
+}
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_startfile__doc__,
+"startfile($module, /, filepath, operation=<unrepresentable>,\n"
+" arguments=<unrepresentable>, cwd=None, show_cmd=1)\n"
+"--\n"
+"\n"
+"Start a file with its associated application.\n"
+"\n"
+"When \"operation\" is not specified or \"open\", this acts like\n"
+"double-clicking the file in Explorer, or giving the file name as an\n"
+"argument to the DOS \"start\" command: the file is opened with whatever\n"
+"application (if any) its extension is associated.\n"
+"When another \"operation\" is given, it specifies what should be done with\n"
+"the file. A typical operation is \"print\".\n"
+"\n"
+"\"arguments\" is passed to the application, but should be omitted if the\n"
+"file is a document.\n"
+"\n"
+"\"cwd\" is the working directory for the operation. If \"filepath\" is\n"
+"relative, it will be resolved against this directory. This argument\n"
+"should usually be an absolute path.\n"
+"\n"
+"\"show_cmd\" can be used to override the recommended visibility option.\n"
+"See the Windows ShellExecute documentation for values.\n"
+"\n"
+"startfile returns as soon as the associated application is launched.\n"
+"There is no option to wait for the application to close, and no way\n"
+"to retrieve the application\'s exit status.\n"
+"\n"
+"The filepath is relative to the current directory. If you want to use\n"
+"an absolute path, make sure the first character is not a slash (\"/\");\n"
+"the underlying Win32 ShellExecute function doesn\'t work if it is.");
+
+#define OS_STARTFILE_METHODDEF \
+ {"startfile", _PyCFunction_CAST(os_startfile), METH_FASTCALL|METH_KEYWORDS, os_startfile__doc__},
+
+static PyObject *
+os_startfile_impl(PyObject *module, path_t *filepath,
+ const Py_UNICODE *operation, const Py_UNICODE *arguments,
+ path_t *cwd, int show_cmd);
+
+static PyObject *
+os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(filepath), &_Py_ID(operation), &_Py_ID(arguments), &_Py_ID(cwd), &_Py_ID(show_cmd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"filepath", "operation", "arguments", "cwd", "show_cmd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "startfile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ path_t filepath = PATH_T_INITIALIZE("startfile", "filepath", 0, 0);
+ const Py_UNICODE *operation = NULL;
+ const Py_UNICODE *arguments = NULL;
+ path_t cwd = PATH_T_INITIALIZE("startfile", "cwd", 1, 0);
+ int show_cmd = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 5, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &filepath)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("startfile", "argument 'operation'", "str", args[1]);
+ goto exit;
+ }
+ operation = PyUnicode_AsWideCharString(args[1], NULL);
+ if (operation == NULL) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[2]) {
+ if (!PyUnicode_Check(args[2])) {
+ _PyArg_BadArgument("startfile", "argument 'arguments'", "str", args[2]);
+ goto exit;
+ }
+ arguments = PyUnicode_AsWideCharString(args[2], NULL);
+ if (arguments == NULL) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ if (!path_converter(args[3], &cwd)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ show_cmd = _PyLong_AsInt(args[4]);
+ if (show_cmd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_startfile_impl(module, &filepath, operation, arguments, &cwd, show_cmd);
+
+exit:
+ /* Cleanup for filepath */
+ path_cleanup(&filepath);
+ /* Cleanup for operation */
+ PyMem_Free((void *)operation);
+ /* Cleanup for arguments */
+ PyMem_Free((void *)arguments);
+ /* Cleanup for cwd */
+ path_cleanup(&cwd);
+
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(HAVE_GETLOADAVG)
+
+PyDoc_STRVAR(os_getloadavg__doc__,
+"getloadavg($module, /)\n"
+"--\n"
+"\n"
+"Return average recent system load information.\n"
+"\n"
+"Return the number of processes in the system run queue averaged over\n"
+"the last 1, 5, and 15 minutes as a tuple of three floats.\n"
+"Raises OSError if the load average was unobtainable.");
+
+#define OS_GETLOADAVG_METHODDEF \
+ {"getloadavg", (PyCFunction)os_getloadavg, METH_NOARGS, os_getloadavg__doc__},
+
+static PyObject *
+os_getloadavg_impl(PyObject *module);
+
+static PyObject *
+os_getloadavg(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getloadavg_impl(module);
+}
+
+#endif /* defined(HAVE_GETLOADAVG) */
+
+PyDoc_STRVAR(os_device_encoding__doc__,
+"device_encoding($module, /, fd)\n"
+"--\n"
+"\n"
+"Return a string describing the encoding of a terminal\'s file descriptor.\n"
+"\n"
+"The file descriptor must be attached to a terminal.\n"
+"If the device is not a terminal, return None.");
+
+#define OS_DEVICE_ENCODING_METHODDEF \
+ {"device_encoding", _PyCFunction_CAST(os_device_encoding), METH_FASTCALL|METH_KEYWORDS, os_device_encoding__doc__},
+
+static PyObject *
+os_device_encoding_impl(PyObject *module, int fd);
+
+static PyObject *
+os_device_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "device_encoding",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_device_encoding_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_SETRESUID)
+
+PyDoc_STRVAR(os_setresuid__doc__,
+"setresuid($module, ruid, euid, suid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s real, effective, and saved user ids.");
+
+#define OS_SETRESUID_METHODDEF \
+ {"setresuid", _PyCFunction_CAST(os_setresuid), METH_FASTCALL, os_setresuid__doc__},
+
+static PyObject *
+os_setresuid_impl(PyObject *module, uid_t ruid, uid_t euid, uid_t suid);
+
+static PyObject *
+os_setresuid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ uid_t ruid;
+ uid_t euid;
+ uid_t suid;
+
+ if (!_PyArg_CheckPositional("setresuid", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[0], &ruid)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[1], &euid)) {
+ goto exit;
+ }
+ if (!_Py_Uid_Converter(args[2], &suid)) {
+ goto exit;
+ }
+ return_value = os_setresuid_impl(module, ruid, euid, suid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETRESUID) */
+
+#if defined(HAVE_SETRESGID)
+
+PyDoc_STRVAR(os_setresgid__doc__,
+"setresgid($module, rgid, egid, sgid, /)\n"
+"--\n"
+"\n"
+"Set the current process\'s real, effective, and saved group ids.");
+
+#define OS_SETRESGID_METHODDEF \
+ {"setresgid", _PyCFunction_CAST(os_setresgid), METH_FASTCALL, os_setresgid__doc__},
+
+static PyObject *
+os_setresgid_impl(PyObject *module, gid_t rgid, gid_t egid, gid_t sgid);
+
+static PyObject *
+os_setresgid(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ gid_t rgid;
+ gid_t egid;
+ gid_t sgid;
+
+ if (!_PyArg_CheckPositional("setresgid", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[0], &rgid)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[1], &egid)) {
+ goto exit;
+ }
+ if (!_Py_Gid_Converter(args[2], &sgid)) {
+ goto exit;
+ }
+ return_value = os_setresgid_impl(module, rgid, egid, sgid);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETRESGID) */
+
+#if defined(HAVE_GETRESUID)
+
+PyDoc_STRVAR(os_getresuid__doc__,
+"getresuid($module, /)\n"
+"--\n"
+"\n"
+"Return a tuple of the current process\'s real, effective, and saved user ids.");
+
+#define OS_GETRESUID_METHODDEF \
+ {"getresuid", (PyCFunction)os_getresuid, METH_NOARGS, os_getresuid__doc__},
+
+static PyObject *
+os_getresuid_impl(PyObject *module);
+
+static PyObject *
+os_getresuid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getresuid_impl(module);
+}
+
+#endif /* defined(HAVE_GETRESUID) */
+
+#if defined(HAVE_GETRESGID)
+
+PyDoc_STRVAR(os_getresgid__doc__,
+"getresgid($module, /)\n"
+"--\n"
+"\n"
+"Return a tuple of the current process\'s real, effective, and saved group ids.");
+
+#define OS_GETRESGID_METHODDEF \
+ {"getresgid", (PyCFunction)os_getresgid, METH_NOARGS, os_getresgid__doc__},
+
+static PyObject *
+os_getresgid_impl(PyObject *module);
+
+static PyObject *
+os_getresgid(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_getresgid_impl(module);
+}
+
+#endif /* defined(HAVE_GETRESGID) */
+
+#if defined(USE_XATTRS)
+
+PyDoc_STRVAR(os_getxattr__doc__,
+"getxattr($module, /, path, attribute, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return the value of extended attribute attribute on path.\n"
+"\n"
+"path may be either a string, a path-like object, or an open file descriptor.\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, getxattr will examine the symbolic link itself instead of the file\n"
+" the link points to.");
+
+#define OS_GETXATTR_METHODDEF \
+ {"getxattr", _PyCFunction_CAST(os_getxattr), METH_FASTCALL|METH_KEYWORDS, os_getxattr__doc__},
+
+static PyObject *
+os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute,
+ int follow_symlinks);
+
+static PyObject *
+os_getxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(attribute), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "attribute", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "getxattr",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t path = PATH_T_INITIALIZE("getxattr", "path", 0, 1);
+ path_t attribute = PATH_T_INITIALIZE("getxattr", "attribute", 0, 0);
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &attribute)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[2]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_getxattr_impl(module, &path, &attribute, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+ /* Cleanup for attribute */
+ path_cleanup(&attribute);
+
+ return return_value;
+}
+
+#endif /* defined(USE_XATTRS) */
+
+#if defined(USE_XATTRS)
+
+PyDoc_STRVAR(os_setxattr__doc__,
+"setxattr($module, /, path, attribute, value, flags=0, *,\n"
+" follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Set extended attribute attribute on path to value.\n"
+"\n"
+"path may be either a string, a path-like object, or an open file descriptor.\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, setxattr will modify the symbolic link itself instead of the file\n"
+" the link points to.");
+
+#define OS_SETXATTR_METHODDEF \
+ {"setxattr", _PyCFunction_CAST(os_setxattr), METH_FASTCALL|METH_KEYWORDS, os_setxattr__doc__},
+
+static PyObject *
+os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute,
+ Py_buffer *value, int flags, int follow_symlinks);
+
+static PyObject *
+os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 5
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(attribute), &_Py_ID(value), &_Py_ID(flags), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "attribute", "value", "flags", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "setxattr",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[5];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
+ path_t path = PATH_T_INITIALIZE("setxattr", "path", 0, 1);
+ path_t attribute = PATH_T_INITIALIZE("setxattr", "attribute", 0, 0);
+ Py_buffer value = {NULL, NULL};
+ int flags = 0;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 4, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &attribute)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[2], &value, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&value, 'C')) {
+ _PyArg_BadArgument("setxattr", "argument 'value'", "contiguous buffer", args[2]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[3]) {
+ flags = _PyLong_AsInt(args[3]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[4]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_setxattr_impl(module, &path, &attribute, &value, flags, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+ /* Cleanup for attribute */
+ path_cleanup(&attribute);
+ /* Cleanup for value */
+ if (value.obj) {
+ PyBuffer_Release(&value);
+ }
+
+ return return_value;
+}
+
+#endif /* defined(USE_XATTRS) */
+
+#if defined(USE_XATTRS)
+
+PyDoc_STRVAR(os_removexattr__doc__,
+"removexattr($module, /, path, attribute, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Remove extended attribute attribute on path.\n"
+"\n"
+"path may be either a string, a path-like object, or an open file descriptor.\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, removexattr will modify the symbolic link itself instead of the file\n"
+" the link points to.");
+
+#define OS_REMOVEXATTR_METHODDEF \
+ {"removexattr", _PyCFunction_CAST(os_removexattr), METH_FASTCALL|METH_KEYWORDS, os_removexattr__doc__},
+
+static PyObject *
+os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute,
+ int follow_symlinks);
+
+static PyObject *
+os_removexattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(attribute), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "attribute", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "removexattr",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
+ path_t path = PATH_T_INITIALIZE("removexattr", "path", 0, 1);
+ path_t attribute = PATH_T_INITIALIZE("removexattr", "attribute", 0, 0);
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!path_converter(args[1], &attribute)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[2]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_removexattr_impl(module, &path, &attribute, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+ /* Cleanup for attribute */
+ path_cleanup(&attribute);
+
+ return return_value;
+}
+
+#endif /* defined(USE_XATTRS) */
+
+#if defined(USE_XATTRS)
+
+PyDoc_STRVAR(os_listxattr__doc__,
+"listxattr($module, /, path=None, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return a list of extended attributes on path.\n"
+"\n"
+"path may be either None, a string, a path-like object, or an open file descriptor.\n"
+"if path is None, listxattr will examine the current directory.\n"
+"If follow_symlinks is False, and the last element of the path is a symbolic\n"
+" link, listxattr will examine the symbolic link itself instead of the file\n"
+" the link points to.");
+
+#define OS_LISTXATTR_METHODDEF \
+ {"listxattr", _PyCFunction_CAST(os_listxattr), METH_FASTCALL|METH_KEYWORDS, os_listxattr__doc__},
+
+static PyObject *
+os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks);
+
+static PyObject *
+os_listxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", "follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "listxattr",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ path_t path = PATH_T_INITIALIZE("listxattr", "path", 1, 1);
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[1]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_listxattr_impl(module, &path, follow_symlinks);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* defined(USE_XATTRS) */
+
+PyDoc_STRVAR(os_urandom__doc__,
+"urandom($module, size, /)\n"
+"--\n"
+"\n"
+"Return a bytes object containing random bytes suitable for cryptographic use.");
+
+#define OS_URANDOM_METHODDEF \
+ {"urandom", (PyCFunction)os_urandom, METH_O, os_urandom__doc__},
+
+static PyObject *
+os_urandom_impl(PyObject *module, Py_ssize_t size);
+
+static PyObject *
+os_urandom(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t size;
+
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(arg);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ size = ival;
+ }
+ return_value = os_urandom_impl(module, size);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_MEMFD_CREATE)
+
+PyDoc_STRVAR(os_memfd_create__doc__,
+"memfd_create($module, /, name, flags=MFD_CLOEXEC)\n"
+"--\n"
+"\n");
+
+#define OS_MEMFD_CREATE_METHODDEF \
+ {"memfd_create", _PyCFunction_CAST(os_memfd_create), METH_FASTCALL|METH_KEYWORDS, os_memfd_create__doc__},
+
+static PyObject *
+os_memfd_create_impl(PyObject *module, PyObject *name, unsigned int flags);
+
+static PyObject *
+os_memfd_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(name), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"name", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "memfd_create",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ PyObject *name = NULL;
+ unsigned int flags = MFD_CLOEXEC;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!PyUnicode_FSConverter(args[0], &name)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ flags = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (flags == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_memfd_create_impl(module, name, flags);
+
+exit:
+ /* Cleanup for name */
+ Py_XDECREF(name);
+
+ return return_value;
+}
+
+#endif /* defined(HAVE_MEMFD_CREATE) */
+
+#if (defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC))
+
+PyDoc_STRVAR(os_eventfd__doc__,
+"eventfd($module, /, initval, flags=EFD_CLOEXEC)\n"
+"--\n"
+"\n"
+"Creates and returns an event notification file descriptor.");
+
+#define OS_EVENTFD_METHODDEF \
+ {"eventfd", _PyCFunction_CAST(os_eventfd), METH_FASTCALL|METH_KEYWORDS, os_eventfd__doc__},
+
+static PyObject *
+os_eventfd_impl(PyObject *module, unsigned int initval, int flags);
+
+static PyObject *
+os_eventfd(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(initval), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"initval", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "eventfd",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ unsigned int initval;
+ int flags = EFD_CLOEXEC;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedInt_Converter(args[0], &initval)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ flags = _PyLong_AsInt(args[1]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_eventfd_impl(module, initval, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)) */
+
+#if (defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC))
+
+PyDoc_STRVAR(os_eventfd_read__doc__,
+"eventfd_read($module, /, fd)\n"
+"--\n"
+"\n"
+"Read eventfd value");
+
+#define OS_EVENTFD_READ_METHODDEF \
+ {"eventfd_read", _PyCFunction_CAST(os_eventfd_read), METH_FASTCALL|METH_KEYWORDS, os_eventfd_read__doc__},
+
+static PyObject *
+os_eventfd_read_impl(PyObject *module, int fd);
+
+static PyObject *
+os_eventfd_read(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "eventfd_read",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ return_value = os_eventfd_read_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)) */
+
+#if (defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC))
+
+PyDoc_STRVAR(os_eventfd_write__doc__,
+"eventfd_write($module, /, fd, value)\n"
+"--\n"
+"\n"
+"Write eventfd value.");
+
+#define OS_EVENTFD_WRITE_METHODDEF \
+ {"eventfd_write", _PyCFunction_CAST(os_eventfd_write), METH_FASTCALL|METH_KEYWORDS, os_eventfd_write__doc__},
+
+static PyObject *
+os_eventfd_write_impl(PyObject *module, int fd, unsigned long long value);
+
+static PyObject *
+os_eventfd_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(value), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "value", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "eventfd_write",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ int fd;
+ unsigned long long value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedLongLong_Converter(args[1], &value)) {
+ goto exit;
+ }
+ return_value = os_eventfd_write_impl(module, fd, value);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)) */
+
+#if (defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL))
+
+PyDoc_STRVAR(os_get_terminal_size__doc__,
+"get_terminal_size($module, fd=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Return the size of the terminal window as (columns, lines).\n"
+"\n"
+"The optional argument fd (default standard output) specifies\n"
+"which file descriptor should be queried.\n"
+"\n"
+"If the file descriptor is not connected to a terminal, an OSError\n"
+"is thrown.\n"
+"\n"
+"This function will only be defined if an implementation is\n"
+"available for this system.\n"
+"\n"
+"shutil.get_terminal_size is the high-level function which should\n"
+"normally be used, os.get_terminal_size is the low-level implementation.");
+
+#define OS_GET_TERMINAL_SIZE_METHODDEF \
+ {"get_terminal_size", _PyCFunction_CAST(os_get_terminal_size), METH_FASTCALL, os_get_terminal_size__doc__},
+
+static PyObject *
+os_get_terminal_size_impl(PyObject *module, int fd);
+
+static PyObject *
+os_get_terminal_size(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd = fileno(stdout);
+
+ if (!_PyArg_CheckPositional("get_terminal_size", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = os_get_terminal_size_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL)) */
+
+PyDoc_STRVAR(os_cpu_count__doc__,
+"cpu_count($module, /)\n"
+"--\n"
+"\n"
+"Return the number of CPUs in the system; return None if indeterminable.\n"
+"\n"
+"This number is not equivalent to the number of CPUs the current process can\n"
+"use. The number of usable CPUs can be obtained with\n"
+"``len(os.sched_getaffinity(0))``");
+
+#define OS_CPU_COUNT_METHODDEF \
+ {"cpu_count", (PyCFunction)os_cpu_count, METH_NOARGS, os_cpu_count__doc__},
+
+static PyObject *
+os_cpu_count_impl(PyObject *module);
+
+static PyObject *
+os_cpu_count(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return os_cpu_count_impl(module);
+}
+
+PyDoc_STRVAR(os_get_inheritable__doc__,
+"get_inheritable($module, fd, /)\n"
+"--\n"
+"\n"
+"Get the close-on-exe flag of the specified file descriptor.");
+
+#define OS_GET_INHERITABLE_METHODDEF \
+ {"get_inheritable", (PyCFunction)os_get_inheritable, METH_O, os_get_inheritable__doc__},
+
+static int
+os_get_inheritable_impl(PyObject *module, int fd);
+
+static PyObject *
+os_get_inheritable(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int _return_value;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_get_inheritable_impl(module, fd);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_set_inheritable__doc__,
+"set_inheritable($module, fd, inheritable, /)\n"
+"--\n"
+"\n"
+"Set the inheritable flag of the specified file descriptor.");
+
+#define OS_SET_INHERITABLE_METHODDEF \
+ {"set_inheritable", _PyCFunction_CAST(os_set_inheritable), METH_FASTCALL, os_set_inheritable__doc__},
+
+static PyObject *
+os_set_inheritable_impl(PyObject *module, int fd, int inheritable);
+
+static PyObject *
+os_set_inheritable(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int inheritable;
+
+ if (!_PyArg_CheckPositional("set_inheritable", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ inheritable = _PyLong_AsInt(args[1]);
+ if (inheritable == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = os_set_inheritable_impl(module, fd, inheritable);
+
+exit:
+ return return_value;
+}
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_get_handle_inheritable__doc__,
+"get_handle_inheritable($module, handle, /)\n"
+"--\n"
+"\n"
+"Get the close-on-exe flag of the specified file descriptor.");
+
+#define OS_GET_HANDLE_INHERITABLE_METHODDEF \
+ {"get_handle_inheritable", (PyCFunction)os_get_handle_inheritable, METH_O, os_get_handle_inheritable__doc__},
+
+static int
+os_get_handle_inheritable_impl(PyObject *module, intptr_t handle);
+
+static PyObject *
+os_get_handle_inheritable(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ intptr_t handle;
+ int _return_value;
+
+ if (!PyArg_Parse(arg, "" _Py_PARSE_INTPTR ":get_handle_inheritable", &handle)) {
+ goto exit;
+ }
+ _return_value = os_get_handle_inheritable_impl(module, handle);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+PyDoc_STRVAR(os_set_handle_inheritable__doc__,
+"set_handle_inheritable($module, handle, inheritable, /)\n"
+"--\n"
+"\n"
+"Set the inheritable flag of the specified handle.");
+
+#define OS_SET_HANDLE_INHERITABLE_METHODDEF \
+ {"set_handle_inheritable", _PyCFunction_CAST(os_set_handle_inheritable), METH_FASTCALL, os_set_handle_inheritable__doc__},
+
+static PyObject *
+os_set_handle_inheritable_impl(PyObject *module, intptr_t handle,
+ int inheritable);
+
+static PyObject *
+os_set_handle_inheritable(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ intptr_t handle;
+ int inheritable;
+
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_INTPTR "p:set_handle_inheritable",
+ &handle, &inheritable)) {
+ goto exit;
+ }
+ return_value = os_set_handle_inheritable_impl(module, handle, inheritable);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(MS_WINDOWS) */
+
+PyDoc_STRVAR(os_get_blocking__doc__,
+"get_blocking($module, fd, /)\n"
+"--\n"
+"\n"
+"Get the blocking mode of the file descriptor.\n"
+"\n"
+"Return False if the O_NONBLOCK flag is set, True if the flag is cleared.");
+
+#define OS_GET_BLOCKING_METHODDEF \
+ {"get_blocking", (PyCFunction)os_get_blocking, METH_O, os_get_blocking__doc__},
+
+static int
+os_get_blocking_impl(PyObject *module, int fd);
+
+static PyObject *
+os_get_blocking(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int _return_value;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = os_get_blocking_impl(module, fd);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_set_blocking__doc__,
+"set_blocking($module, fd, blocking, /)\n"
+"--\n"
+"\n"
+"Set the blocking mode of the specified file descriptor.\n"
+"\n"
+"Set the O_NONBLOCK flag if blocking is False,\n"
+"clear the O_NONBLOCK flag otherwise.");
+
+#define OS_SET_BLOCKING_METHODDEF \
+ {"set_blocking", _PyCFunction_CAST(os_set_blocking), METH_FASTCALL, os_set_blocking__doc__},
+
+static PyObject *
+os_set_blocking_impl(PyObject *module, int fd, int blocking);
+
+static PyObject *
+os_set_blocking(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int blocking;
+
+ if (!_PyArg_CheckPositional("set_blocking", nargs, 2, 2)) {
+ goto exit;
+ }
+ fd = _PyLong_AsInt(args[0]);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ blocking = PyObject_IsTrue(args[1]);
+ if (blocking < 0) {
+ goto exit;
+ }
+ return_value = os_set_blocking_impl(module, fd, blocking);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_is_symlink__doc__,
+"is_symlink($self, /)\n"
+"--\n"
+"\n"
+"Return True if the entry is a symbolic link; cached per entry.");
+
+#define OS_DIRENTRY_IS_SYMLINK_METHODDEF \
+ {"is_symlink", _PyCFunction_CAST(os_DirEntry_is_symlink), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_symlink__doc__},
+
+static int
+os_DirEntry_is_symlink_impl(DirEntry *self, PyTypeObject *defining_class);
+
+static PyObject *
+os_DirEntry_is_symlink(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "is_symlink() takes no arguments");
+ goto exit;
+ }
+ _return_value = os_DirEntry_is_symlink_impl(self, defining_class);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_is_junction__doc__,
+"is_junction($self, /)\n"
+"--\n"
+"\n"
+"Return True if the entry is a junction; cached per entry.");
+
+#define OS_DIRENTRY_IS_JUNCTION_METHODDEF \
+ {"is_junction", _PyCFunction_CAST(os_DirEntry_is_junction), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_junction__doc__},
+
+static int
+os_DirEntry_is_junction_impl(DirEntry *self, PyTypeObject *defining_class);
+
+static PyObject *
+os_DirEntry_is_junction(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "is_junction() takes no arguments");
+ goto exit;
+ }
+ _return_value = os_DirEntry_is_junction_impl(self, defining_class);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_stat__doc__,
+"stat($self, /, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return stat_result object for the entry; cached per entry.");
+
+#define OS_DIRENTRY_STAT_METHODDEF \
+ {"stat", _PyCFunction_CAST(os_DirEntry_stat), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, os_DirEntry_stat__doc__},
+
+static PyObject *
+os_DirEntry_stat_impl(DirEntry *self, PyTypeObject *defining_class,
+ int follow_symlinks);
+
+static PyObject *
+os_DirEntry_stat(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "stat",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int follow_symlinks = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[0]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = os_DirEntry_stat_impl(self, defining_class, follow_symlinks);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_is_dir__doc__,
+"is_dir($self, /, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return True if the entry is a directory; cached per entry.");
+
+#define OS_DIRENTRY_IS_DIR_METHODDEF \
+ {"is_dir", _PyCFunction_CAST(os_DirEntry_is_dir), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_dir__doc__},
+
+static int
+os_DirEntry_is_dir_impl(DirEntry *self, PyTypeObject *defining_class,
+ int follow_symlinks);
+
+static PyObject *
+os_DirEntry_is_dir(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "is_dir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int follow_symlinks = 1;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[0]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ _return_value = os_DirEntry_is_dir_impl(self, defining_class, follow_symlinks);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_is_file__doc__,
+"is_file($self, /, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return True if the entry is a file; cached per entry.");
+
+#define OS_DIRENTRY_IS_FILE_METHODDEF \
+ {"is_file", _PyCFunction_CAST(os_DirEntry_is_file), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, os_DirEntry_is_file__doc__},
+
+static int
+os_DirEntry_is_file_impl(DirEntry *self, PyTypeObject *defining_class,
+ int follow_symlinks);
+
+static PyObject *
+os_DirEntry_is_file(DirEntry *self, PyTypeObject *defining_class, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(follow_symlinks), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "is_file",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int follow_symlinks = 1;
+ int _return_value;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ follow_symlinks = PyObject_IsTrue(args[0]);
+ if (follow_symlinks < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ _return_value = os_DirEntry_is_file_impl(self, defining_class, follow_symlinks);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_inode__doc__,
+"inode($self, /)\n"
+"--\n"
+"\n"
+"Return inode of the entry; cached per entry.");
+
+#define OS_DIRENTRY_INODE_METHODDEF \
+ {"inode", (PyCFunction)os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__},
+
+static PyObject *
+os_DirEntry_inode_impl(DirEntry *self);
+
+static PyObject *
+os_DirEntry_inode(DirEntry *self, PyObject *Py_UNUSED(ignored))
+{
+ return os_DirEntry_inode_impl(self);
+}
+
+PyDoc_STRVAR(os_DirEntry___fspath____doc__,
+"__fspath__($self, /)\n"
+"--\n"
+"\n"
+"Returns the path for the entry.");
+
+#define OS_DIRENTRY___FSPATH___METHODDEF \
+ {"__fspath__", (PyCFunction)os_DirEntry___fspath__, METH_NOARGS, os_DirEntry___fspath____doc__},
+
+static PyObject *
+os_DirEntry___fspath___impl(DirEntry *self);
+
+static PyObject *
+os_DirEntry___fspath__(DirEntry *self, PyObject *Py_UNUSED(ignored))
+{
+ return os_DirEntry___fspath___impl(self);
+}
+
+PyDoc_STRVAR(os_scandir__doc__,
+"scandir($module, /, path=None)\n"
+"--\n"
+"\n"
+"Return an iterator of DirEntry objects for given path.\n"
+"\n"
+"path can be specified as either str, bytes, or a path-like object. If path\n"
+"is bytes, the names of yielded DirEntry objects will also be bytes; in\n"
+"all other circumstances they will be str.\n"
+"\n"
+"If path is None, uses the path=\'.\'.");
+
+#define OS_SCANDIR_METHODDEF \
+ {"scandir", _PyCFunction_CAST(os_scandir), METH_FASTCALL|METH_KEYWORDS, os_scandir__doc__},
+
+static PyObject *
+os_scandir_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os_scandir(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "scandir",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ path_t path = PATH_T_INITIALIZE("scandir", "path", 1, PATH_HAVE_FDOPENDIR);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_scandir_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(os_fspath__doc__,
+"fspath($module, /, path)\n"
+"--\n"
+"\n"
+"Return the file system path representation of the object.\n"
+"\n"
+"If the object is str or bytes, then allow it to pass through as-is. If the\n"
+"object defines __fspath__(), then return the result of that method. All other\n"
+"types raise a TypeError.");
+
+#define OS_FSPATH_METHODDEF \
+ {"fspath", _PyCFunction_CAST(os_fspath), METH_FASTCALL|METH_KEYWORDS, os_fspath__doc__},
+
+static PyObject *
+os_fspath_impl(PyObject *module, PyObject *path);
+
+static PyObject *
+os_fspath(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "fspath",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *path;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ path = args[0];
+ return_value = os_fspath_impl(module, path);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_GETRANDOM_SYSCALL)
+
+PyDoc_STRVAR(os_getrandom__doc__,
+"getrandom($module, /, size, flags=0)\n"
+"--\n"
+"\n"
+"Obtain a series of random bytes.");
+
+#define OS_GETRANDOM_METHODDEF \
+ {"getrandom", _PyCFunction_CAST(os_getrandom), METH_FASTCALL|METH_KEYWORDS, os_getrandom__doc__},
+
+static PyObject *
+os_getrandom_impl(PyObject *module, Py_ssize_t size, int flags);
+
+static PyObject *
+os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(size), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"size", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "getrandom",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_ssize_t size;
+ int flags = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ size = ival;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ flags = _PyLong_AsInt(args[1]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = os_getrandom_impl(module, size, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETRANDOM_SYSCALL) */
+
+#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM))
+
+PyDoc_STRVAR(os__add_dll_directory__doc__,
+"_add_dll_directory($module, /, path)\n"
+"--\n"
+"\n"
+"Add a path to the DLL search path.\n"
+"\n"
+"This search path is used when resolving dependencies for imported\n"
+"extension modules (the module itself is resolved through sys.path),\n"
+"and also by ctypes.\n"
+"\n"
+"Returns an opaque value that may be passed to os.remove_dll_directory\n"
+"to remove this directory from the search path.");
+
+#define OS__ADD_DLL_DIRECTORY_METHODDEF \
+ {"_add_dll_directory", _PyCFunction_CAST(os__add_dll_directory), METH_FASTCALL|METH_KEYWORDS, os__add_dll_directory__doc__},
+
+static PyObject *
+os__add_dll_directory_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os__add_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(path), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_add_dll_directory",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ path_t path = PATH_T_INITIALIZE("_add_dll_directory", "path", 0, 0);
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!path_converter(args[0], &path)) {
+ goto exit;
+ }
+ return_value = os__add_dll_directory_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
+#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) */
+
+#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM))
+
+PyDoc_STRVAR(os__remove_dll_directory__doc__,
+"_remove_dll_directory($module, /, cookie)\n"
+"--\n"
+"\n"
+"Removes a path from the DLL search path.\n"
+"\n"
+"The parameter is an opaque value that was returned from\n"
+"os.add_dll_directory. You can only remove directories that you added\n"
+"yourself.");
+
+#define OS__REMOVE_DLL_DIRECTORY_METHODDEF \
+ {"_remove_dll_directory", _PyCFunction_CAST(os__remove_dll_directory), METH_FASTCALL|METH_KEYWORDS, os__remove_dll_directory__doc__},
+
+static PyObject *
+os__remove_dll_directory_impl(PyObject *module, PyObject *cookie);
+
+static PyObject *
+os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(cookie), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"cookie", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "_remove_dll_directory",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *cookie;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ cookie = args[0];
+ return_value = os__remove_dll_directory_impl(module, cookie);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)) */
+
+#if (defined(WIFEXITED) || defined(MS_WINDOWS))
+
+PyDoc_STRVAR(os_waitstatus_to_exitcode__doc__,
+"waitstatus_to_exitcode($module, /, status)\n"
+"--\n"
+"\n"
+"Convert a wait status to an exit code.\n"
+"\n"
+"On Unix:\n"
+"\n"
+"* If WIFEXITED(status) is true, return WEXITSTATUS(status).\n"
+"* If WIFSIGNALED(status) is true, return -WTERMSIG(status).\n"
+"* Otherwise, raise a ValueError.\n"
+"\n"
+"On Windows, return status shifted right by 8 bits.\n"
+"\n"
+"On Unix, if the process is being traced or if waitpid() was called with\n"
+"WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true.\n"
+"This function must not be called if WIFSTOPPED(status) is true.");
+
+#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF \
+ {"waitstatus_to_exitcode", _PyCFunction_CAST(os_waitstatus_to_exitcode), METH_FASTCALL|METH_KEYWORDS, os_waitstatus_to_exitcode__doc__},
+
+static PyObject *
+os_waitstatus_to_exitcode_impl(PyObject *module, PyObject *status_obj);
+
+static PyObject *
+os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(status), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"status", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "waitstatus_to_exitcode",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *status_obj;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ status_obj = args[0];
+ return_value = os_waitstatus_to_exitcode_impl(module, status_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(WIFEXITED) || defined(MS_WINDOWS)) */
+
+#ifndef OS_TTYNAME_METHODDEF
+ #define OS_TTYNAME_METHODDEF
+#endif /* !defined(OS_TTYNAME_METHODDEF) */
+
+#ifndef OS_CTERMID_METHODDEF
+ #define OS_CTERMID_METHODDEF
+#endif /* !defined(OS_CTERMID_METHODDEF) */
+
+#ifndef OS_FCHDIR_METHODDEF
+ #define OS_FCHDIR_METHODDEF
+#endif /* !defined(OS_FCHDIR_METHODDEF) */
+
+#ifndef OS_FCHMOD_METHODDEF
+ #define OS_FCHMOD_METHODDEF
+#endif /* !defined(OS_FCHMOD_METHODDEF) */
+
+#ifndef OS_LCHMOD_METHODDEF
+ #define OS_LCHMOD_METHODDEF
+#endif /* !defined(OS_LCHMOD_METHODDEF) */
+
+#ifndef OS_CHFLAGS_METHODDEF
+ #define OS_CHFLAGS_METHODDEF
+#endif /* !defined(OS_CHFLAGS_METHODDEF) */
+
+#ifndef OS_LCHFLAGS_METHODDEF
+ #define OS_LCHFLAGS_METHODDEF
+#endif /* !defined(OS_LCHFLAGS_METHODDEF) */
+
+#ifndef OS_CHROOT_METHODDEF
+ #define OS_CHROOT_METHODDEF
+#endif /* !defined(OS_CHROOT_METHODDEF) */
+
+#ifndef OS_FSYNC_METHODDEF
+ #define OS_FSYNC_METHODDEF
+#endif /* !defined(OS_FSYNC_METHODDEF) */
+
+#ifndef OS_SYNC_METHODDEF
+ #define OS_SYNC_METHODDEF
+#endif /* !defined(OS_SYNC_METHODDEF) */
+
+#ifndef OS_FDATASYNC_METHODDEF
+ #define OS_FDATASYNC_METHODDEF
+#endif /* !defined(OS_FDATASYNC_METHODDEF) */
+
+#ifndef OS_CHOWN_METHODDEF
+ #define OS_CHOWN_METHODDEF
+#endif /* !defined(OS_CHOWN_METHODDEF) */
+
+#ifndef OS_FCHOWN_METHODDEF
+ #define OS_FCHOWN_METHODDEF
+#endif /* !defined(OS_FCHOWN_METHODDEF) */
+
+#ifndef OS_LCHOWN_METHODDEF
+ #define OS_LCHOWN_METHODDEF
+#endif /* !defined(OS_LCHOWN_METHODDEF) */
+
+#ifndef OS_LINK_METHODDEF
+ #define OS_LINK_METHODDEF
+#endif /* !defined(OS_LINK_METHODDEF) */
+
+#ifndef OS_LISTDRIVES_METHODDEF
+ #define OS_LISTDRIVES_METHODDEF
+#endif /* !defined(OS_LISTDRIVES_METHODDEF) */
+
+#ifndef OS_LISTVOLUMES_METHODDEF
+ #define OS_LISTVOLUMES_METHODDEF
+#endif /* !defined(OS_LISTVOLUMES_METHODDEF) */
+
+#ifndef OS_LISTMOUNTS_METHODDEF
+ #define OS_LISTMOUNTS_METHODDEF
+#endif /* !defined(OS_LISTMOUNTS_METHODDEF) */
+
+#ifndef OS__PATH_ISDEVDRIVE_METHODDEF
+ #define OS__PATH_ISDEVDRIVE_METHODDEF
+#endif /* !defined(OS__PATH_ISDEVDRIVE_METHODDEF) */
+
+#ifndef OS__GETFULLPATHNAME_METHODDEF
+ #define OS__GETFULLPATHNAME_METHODDEF
+#endif /* !defined(OS__GETFULLPATHNAME_METHODDEF) */
+
+#ifndef OS__GETFINALPATHNAME_METHODDEF
+ #define OS__GETFINALPATHNAME_METHODDEF
+#endif /* !defined(OS__GETFINALPATHNAME_METHODDEF) */
+
+#ifndef OS__GETVOLUMEPATHNAME_METHODDEF
+ #define OS__GETVOLUMEPATHNAME_METHODDEF
+#endif /* !defined(OS__GETVOLUMEPATHNAME_METHODDEF) */
+
+#ifndef OS__PATH_SPLITROOT_METHODDEF
+ #define OS__PATH_SPLITROOT_METHODDEF
+#endif /* !defined(OS__PATH_SPLITROOT_METHODDEF) */
+
+#ifndef OS__PATH_ISDIR_METHODDEF
+ #define OS__PATH_ISDIR_METHODDEF
+#endif /* !defined(OS__PATH_ISDIR_METHODDEF) */
+
+#ifndef OS__PATH_ISFILE_METHODDEF
+ #define OS__PATH_ISFILE_METHODDEF
+#endif /* !defined(OS__PATH_ISFILE_METHODDEF) */
+
+#ifndef OS__PATH_EXISTS_METHODDEF
+ #define OS__PATH_EXISTS_METHODDEF
+#endif /* !defined(OS__PATH_EXISTS_METHODDEF) */
+
+#ifndef OS__PATH_ISLINK_METHODDEF
+ #define OS__PATH_ISLINK_METHODDEF
+#endif /* !defined(OS__PATH_ISLINK_METHODDEF) */
+
+#ifndef OS_NICE_METHODDEF
+ #define OS_NICE_METHODDEF
+#endif /* !defined(OS_NICE_METHODDEF) */
+
+#ifndef OS_GETPRIORITY_METHODDEF
+ #define OS_GETPRIORITY_METHODDEF
+#endif /* !defined(OS_GETPRIORITY_METHODDEF) */
+
+#ifndef OS_SETPRIORITY_METHODDEF
+ #define OS_SETPRIORITY_METHODDEF
+#endif /* !defined(OS_SETPRIORITY_METHODDEF) */
+
+#ifndef OS_SYSTEM_METHODDEF
+ #define OS_SYSTEM_METHODDEF
+#endif /* !defined(OS_SYSTEM_METHODDEF) */
+
+#ifndef OS_UMASK_METHODDEF
+ #define OS_UMASK_METHODDEF
+#endif /* !defined(OS_UMASK_METHODDEF) */
+
+#ifndef OS_UNAME_METHODDEF
+ #define OS_UNAME_METHODDEF
+#endif /* !defined(OS_UNAME_METHODDEF) */
+
+#ifndef OS_EXECV_METHODDEF
+ #define OS_EXECV_METHODDEF
+#endif /* !defined(OS_EXECV_METHODDEF) */
+
+#ifndef OS_EXECVE_METHODDEF
+ #define OS_EXECVE_METHODDEF
+#endif /* !defined(OS_EXECVE_METHODDEF) */
+
+#ifndef OS_POSIX_SPAWN_METHODDEF
+ #define OS_POSIX_SPAWN_METHODDEF
+#endif /* !defined(OS_POSIX_SPAWN_METHODDEF) */
+
+#ifndef OS_POSIX_SPAWNP_METHODDEF
+ #define OS_POSIX_SPAWNP_METHODDEF
+#endif /* !defined(OS_POSIX_SPAWNP_METHODDEF) */
+
+#ifndef OS_SPAWNV_METHODDEF
+ #define OS_SPAWNV_METHODDEF
+#endif /* !defined(OS_SPAWNV_METHODDEF) */
+
+#ifndef OS_SPAWNVE_METHODDEF
+ #define OS_SPAWNVE_METHODDEF
+#endif /* !defined(OS_SPAWNVE_METHODDEF) */
+
+#ifndef OS_REGISTER_AT_FORK_METHODDEF
+ #define OS_REGISTER_AT_FORK_METHODDEF
+#endif /* !defined(OS_REGISTER_AT_FORK_METHODDEF) */
+
+#ifndef OS_FORK1_METHODDEF
+ #define OS_FORK1_METHODDEF
+#endif /* !defined(OS_FORK1_METHODDEF) */
+
+#ifndef OS_FORK_METHODDEF
+ #define OS_FORK_METHODDEF
+#endif /* !defined(OS_FORK_METHODDEF) */
+
+#ifndef OS_SCHED_GET_PRIORITY_MAX_METHODDEF
+ #define OS_SCHED_GET_PRIORITY_MAX_METHODDEF
+#endif /* !defined(OS_SCHED_GET_PRIORITY_MAX_METHODDEF) */
+
+#ifndef OS_SCHED_GET_PRIORITY_MIN_METHODDEF
+ #define OS_SCHED_GET_PRIORITY_MIN_METHODDEF
+#endif /* !defined(OS_SCHED_GET_PRIORITY_MIN_METHODDEF) */
+
+#ifndef OS_SCHED_GETSCHEDULER_METHODDEF
+ #define OS_SCHED_GETSCHEDULER_METHODDEF
+#endif /* !defined(OS_SCHED_GETSCHEDULER_METHODDEF) */
+
+#ifndef OS_SCHED_SETSCHEDULER_METHODDEF
+ #define OS_SCHED_SETSCHEDULER_METHODDEF
+#endif /* !defined(OS_SCHED_SETSCHEDULER_METHODDEF) */
+
+#ifndef OS_SCHED_GETPARAM_METHODDEF
+ #define OS_SCHED_GETPARAM_METHODDEF
+#endif /* !defined(OS_SCHED_GETPARAM_METHODDEF) */
+
+#ifndef OS_SCHED_SETPARAM_METHODDEF
+ #define OS_SCHED_SETPARAM_METHODDEF
+#endif /* !defined(OS_SCHED_SETPARAM_METHODDEF) */
+
+#ifndef OS_SCHED_RR_GET_INTERVAL_METHODDEF
+ #define OS_SCHED_RR_GET_INTERVAL_METHODDEF
+#endif /* !defined(OS_SCHED_RR_GET_INTERVAL_METHODDEF) */
+
+#ifndef OS_SCHED_YIELD_METHODDEF
+ #define OS_SCHED_YIELD_METHODDEF
+#endif /* !defined(OS_SCHED_YIELD_METHODDEF) */
+
+#ifndef OS_SCHED_SETAFFINITY_METHODDEF
+ #define OS_SCHED_SETAFFINITY_METHODDEF
+#endif /* !defined(OS_SCHED_SETAFFINITY_METHODDEF) */
+
+#ifndef OS_SCHED_GETAFFINITY_METHODDEF
+ #define OS_SCHED_GETAFFINITY_METHODDEF
+#endif /* !defined(OS_SCHED_GETAFFINITY_METHODDEF) */
+
+#ifndef OS_OPENPTY_METHODDEF
+ #define OS_OPENPTY_METHODDEF
+#endif /* !defined(OS_OPENPTY_METHODDEF) */
+
+#ifndef OS_LOGIN_TTY_METHODDEF
+ #define OS_LOGIN_TTY_METHODDEF
+#endif /* !defined(OS_LOGIN_TTY_METHODDEF) */
+
+#ifndef OS_FORKPTY_METHODDEF
+ #define OS_FORKPTY_METHODDEF
+#endif /* !defined(OS_FORKPTY_METHODDEF) */
+
+#ifndef OS_GETEGID_METHODDEF
+ #define OS_GETEGID_METHODDEF
+#endif /* !defined(OS_GETEGID_METHODDEF) */
+
+#ifndef OS_GETEUID_METHODDEF
+ #define OS_GETEUID_METHODDEF
+#endif /* !defined(OS_GETEUID_METHODDEF) */
+
+#ifndef OS_GETGID_METHODDEF
+ #define OS_GETGID_METHODDEF
+#endif /* !defined(OS_GETGID_METHODDEF) */
+
+#ifndef OS_GETPID_METHODDEF
+ #define OS_GETPID_METHODDEF
+#endif /* !defined(OS_GETPID_METHODDEF) */
+
+#ifndef OS_GETGROUPLIST_METHODDEF
+ #define OS_GETGROUPLIST_METHODDEF
+#endif /* !defined(OS_GETGROUPLIST_METHODDEF) */
+
+#ifndef OS_GETGROUPS_METHODDEF
+ #define OS_GETGROUPS_METHODDEF
+#endif /* !defined(OS_GETGROUPS_METHODDEF) */
+
+#ifndef OS_INITGROUPS_METHODDEF
+ #define OS_INITGROUPS_METHODDEF
+#endif /* !defined(OS_INITGROUPS_METHODDEF) */
+
+#ifndef OS_GETPGID_METHODDEF
+ #define OS_GETPGID_METHODDEF
+#endif /* !defined(OS_GETPGID_METHODDEF) */
+
+#ifndef OS_GETPGRP_METHODDEF
+ #define OS_GETPGRP_METHODDEF
+#endif /* !defined(OS_GETPGRP_METHODDEF) */
+
+#ifndef OS_SETPGRP_METHODDEF
+ #define OS_SETPGRP_METHODDEF
+#endif /* !defined(OS_SETPGRP_METHODDEF) */
+
+#ifndef OS_GETPPID_METHODDEF
+ #define OS_GETPPID_METHODDEF
+#endif /* !defined(OS_GETPPID_METHODDEF) */
+
+#ifndef OS_GETLOGIN_METHODDEF
+ #define OS_GETLOGIN_METHODDEF
+#endif /* !defined(OS_GETLOGIN_METHODDEF) */
+
+#ifndef OS_GETUID_METHODDEF
+ #define OS_GETUID_METHODDEF
+#endif /* !defined(OS_GETUID_METHODDEF) */
+
+#ifndef OS_KILL_METHODDEF
+ #define OS_KILL_METHODDEF
+#endif /* !defined(OS_KILL_METHODDEF) */
+
+#ifndef OS_KILLPG_METHODDEF
+ #define OS_KILLPG_METHODDEF
+#endif /* !defined(OS_KILLPG_METHODDEF) */
+
+#ifndef OS_PLOCK_METHODDEF
+ #define OS_PLOCK_METHODDEF
+#endif /* !defined(OS_PLOCK_METHODDEF) */
+
+#ifndef OS_SETUID_METHODDEF
+ #define OS_SETUID_METHODDEF
+#endif /* !defined(OS_SETUID_METHODDEF) */
+
+#ifndef OS_SETEUID_METHODDEF
+ #define OS_SETEUID_METHODDEF
+#endif /* !defined(OS_SETEUID_METHODDEF) */
+
+#ifndef OS_SETEGID_METHODDEF
+ #define OS_SETEGID_METHODDEF
+#endif /* !defined(OS_SETEGID_METHODDEF) */
+
+#ifndef OS_SETREUID_METHODDEF
+ #define OS_SETREUID_METHODDEF
+#endif /* !defined(OS_SETREUID_METHODDEF) */
+
+#ifndef OS_SETREGID_METHODDEF
+ #define OS_SETREGID_METHODDEF
+#endif /* !defined(OS_SETREGID_METHODDEF) */
+
+#ifndef OS_SETGID_METHODDEF
+ #define OS_SETGID_METHODDEF
+#endif /* !defined(OS_SETGID_METHODDEF) */
+
+#ifndef OS_SETGROUPS_METHODDEF
+ #define OS_SETGROUPS_METHODDEF
+#endif /* !defined(OS_SETGROUPS_METHODDEF) */
+
+#ifndef OS_WAIT3_METHODDEF
+ #define OS_WAIT3_METHODDEF
+#endif /* !defined(OS_WAIT3_METHODDEF) */
+
+#ifndef OS_WAIT4_METHODDEF
+ #define OS_WAIT4_METHODDEF
+#endif /* !defined(OS_WAIT4_METHODDEF) */
+
+#ifndef OS_WAITID_METHODDEF
+ #define OS_WAITID_METHODDEF
+#endif /* !defined(OS_WAITID_METHODDEF) */
+
+#ifndef OS_WAITPID_METHODDEF
+ #define OS_WAITPID_METHODDEF
+#endif /* !defined(OS_WAITPID_METHODDEF) */
+
+#ifndef OS_WAIT_METHODDEF
+ #define OS_WAIT_METHODDEF
+#endif /* !defined(OS_WAIT_METHODDEF) */
+
+#ifndef OS_PIDFD_OPEN_METHODDEF
+ #define OS_PIDFD_OPEN_METHODDEF
+#endif /* !defined(OS_PIDFD_OPEN_METHODDEF) */
+
+#ifndef OS_SETNS_METHODDEF
+ #define OS_SETNS_METHODDEF
+#endif /* !defined(OS_SETNS_METHODDEF) */
+
+#ifndef OS_UNSHARE_METHODDEF
+ #define OS_UNSHARE_METHODDEF
+#endif /* !defined(OS_UNSHARE_METHODDEF) */
+
+#ifndef OS_READLINK_METHODDEF
+ #define OS_READLINK_METHODDEF
+#endif /* !defined(OS_READLINK_METHODDEF) */
+
+#ifndef OS_SYMLINK_METHODDEF
+ #define OS_SYMLINK_METHODDEF
+#endif /* !defined(OS_SYMLINK_METHODDEF) */
+
+#ifndef OS_TIMES_METHODDEF
+ #define OS_TIMES_METHODDEF
+#endif /* !defined(OS_TIMES_METHODDEF) */
+
+#ifndef OS_GETSID_METHODDEF
+ #define OS_GETSID_METHODDEF
+#endif /* !defined(OS_GETSID_METHODDEF) */
+
+#ifndef OS_SETSID_METHODDEF
+ #define OS_SETSID_METHODDEF
+#endif /* !defined(OS_SETSID_METHODDEF) */
+
+#ifndef OS_SETPGID_METHODDEF
+ #define OS_SETPGID_METHODDEF
+#endif /* !defined(OS_SETPGID_METHODDEF) */
+
+#ifndef OS_TCGETPGRP_METHODDEF
+ #define OS_TCGETPGRP_METHODDEF
+#endif /* !defined(OS_TCGETPGRP_METHODDEF) */
+
+#ifndef OS_TCSETPGRP_METHODDEF
+ #define OS_TCSETPGRP_METHODDEF
+#endif /* !defined(OS_TCSETPGRP_METHODDEF) */
+
+#ifndef OS_DUP2_METHODDEF
+ #define OS_DUP2_METHODDEF
+#endif /* !defined(OS_DUP2_METHODDEF) */
+
+#ifndef OS_LOCKF_METHODDEF
+ #define OS_LOCKF_METHODDEF
+#endif /* !defined(OS_LOCKF_METHODDEF) */
+
+#ifndef OS_READV_METHODDEF
+ #define OS_READV_METHODDEF
+#endif /* !defined(OS_READV_METHODDEF) */
+
+#ifndef OS_PREAD_METHODDEF
+ #define OS_PREAD_METHODDEF
+#endif /* !defined(OS_PREAD_METHODDEF) */
+
+#ifndef OS_PREADV_METHODDEF
+ #define OS_PREADV_METHODDEF
+#endif /* !defined(OS_PREADV_METHODDEF) */
+
+#ifndef OS_SENDFILE_METHODDEF
+ #define OS_SENDFILE_METHODDEF
+#endif /* !defined(OS_SENDFILE_METHODDEF) */
+
+#ifndef OS__FCOPYFILE_METHODDEF
+ #define OS__FCOPYFILE_METHODDEF
+#endif /* !defined(OS__FCOPYFILE_METHODDEF) */
+
+#ifndef OS_PIPE_METHODDEF
+ #define OS_PIPE_METHODDEF
+#endif /* !defined(OS_PIPE_METHODDEF) */
+
+#ifndef OS_PIPE2_METHODDEF
+ #define OS_PIPE2_METHODDEF
+#endif /* !defined(OS_PIPE2_METHODDEF) */
+
+#ifndef OS_WRITEV_METHODDEF
+ #define OS_WRITEV_METHODDEF
+#endif /* !defined(OS_WRITEV_METHODDEF) */
+
+#ifndef OS_PWRITE_METHODDEF
+ #define OS_PWRITE_METHODDEF
+#endif /* !defined(OS_PWRITE_METHODDEF) */
+
+#ifndef OS_PWRITEV_METHODDEF
+ #define OS_PWRITEV_METHODDEF
+#endif /* !defined(OS_PWRITEV_METHODDEF) */
+
+#ifndef OS_COPY_FILE_RANGE_METHODDEF
+ #define OS_COPY_FILE_RANGE_METHODDEF
+#endif /* !defined(OS_COPY_FILE_RANGE_METHODDEF) */
+
+#ifndef OS_SPLICE_METHODDEF
+ #define OS_SPLICE_METHODDEF
+#endif /* !defined(OS_SPLICE_METHODDEF) */
+
+#ifndef OS_MKFIFO_METHODDEF
+ #define OS_MKFIFO_METHODDEF
+#endif /* !defined(OS_MKFIFO_METHODDEF) */
+
+#ifndef OS_MKNOD_METHODDEF
+ #define OS_MKNOD_METHODDEF
+#endif /* !defined(OS_MKNOD_METHODDEF) */
+
+#ifndef OS_MAJOR_METHODDEF
+ #define OS_MAJOR_METHODDEF
+#endif /* !defined(OS_MAJOR_METHODDEF) */
+
+#ifndef OS_MINOR_METHODDEF
+ #define OS_MINOR_METHODDEF
+#endif /* !defined(OS_MINOR_METHODDEF) */
+
+#ifndef OS_MAKEDEV_METHODDEF
+ #define OS_MAKEDEV_METHODDEF
+#endif /* !defined(OS_MAKEDEV_METHODDEF) */
+
+#ifndef OS_FTRUNCATE_METHODDEF
+ #define OS_FTRUNCATE_METHODDEF
+#endif /* !defined(OS_FTRUNCATE_METHODDEF) */
+
+#ifndef OS_TRUNCATE_METHODDEF
+ #define OS_TRUNCATE_METHODDEF
+#endif /* !defined(OS_TRUNCATE_METHODDEF) */
+
+#ifndef OS_POSIX_FALLOCATE_METHODDEF
+ #define OS_POSIX_FALLOCATE_METHODDEF
+#endif /* !defined(OS_POSIX_FALLOCATE_METHODDEF) */
+
+#ifndef OS_POSIX_FADVISE_METHODDEF
+ #define OS_POSIX_FADVISE_METHODDEF
+#endif /* !defined(OS_POSIX_FADVISE_METHODDEF) */
+
+#ifndef OS_PUTENV_METHODDEF
+ #define OS_PUTENV_METHODDEF
+#endif /* !defined(OS_PUTENV_METHODDEF) */
+
+#ifndef OS_UNSETENV_METHODDEF
+ #define OS_UNSETENV_METHODDEF
+#endif /* !defined(OS_UNSETENV_METHODDEF) */
+
+#ifndef OS_WCOREDUMP_METHODDEF
+ #define OS_WCOREDUMP_METHODDEF
+#endif /* !defined(OS_WCOREDUMP_METHODDEF) */
+
+#ifndef OS_WIFCONTINUED_METHODDEF
+ #define OS_WIFCONTINUED_METHODDEF
+#endif /* !defined(OS_WIFCONTINUED_METHODDEF) */
+
+#ifndef OS_WIFSTOPPED_METHODDEF
+ #define OS_WIFSTOPPED_METHODDEF
+#endif /* !defined(OS_WIFSTOPPED_METHODDEF) */
+
+#ifndef OS_WIFSIGNALED_METHODDEF
+ #define OS_WIFSIGNALED_METHODDEF
+#endif /* !defined(OS_WIFSIGNALED_METHODDEF) */
+
+#ifndef OS_WIFEXITED_METHODDEF
+ #define OS_WIFEXITED_METHODDEF
+#endif /* !defined(OS_WIFEXITED_METHODDEF) */
+
+#ifndef OS_WEXITSTATUS_METHODDEF
+ #define OS_WEXITSTATUS_METHODDEF
+#endif /* !defined(OS_WEXITSTATUS_METHODDEF) */
+
+#ifndef OS_WTERMSIG_METHODDEF
+ #define OS_WTERMSIG_METHODDEF
+#endif /* !defined(OS_WTERMSIG_METHODDEF) */
+
+#ifndef OS_WSTOPSIG_METHODDEF
+ #define OS_WSTOPSIG_METHODDEF
+#endif /* !defined(OS_WSTOPSIG_METHODDEF) */
+
+#ifndef OS_FSTATVFS_METHODDEF
+ #define OS_FSTATVFS_METHODDEF
+#endif /* !defined(OS_FSTATVFS_METHODDEF) */
+
+#ifndef OS_STATVFS_METHODDEF
+ #define OS_STATVFS_METHODDEF
+#endif /* !defined(OS_STATVFS_METHODDEF) */
+
+#ifndef OS__GETDISKUSAGE_METHODDEF
+ #define OS__GETDISKUSAGE_METHODDEF
+#endif /* !defined(OS__GETDISKUSAGE_METHODDEF) */
+
+#ifndef OS_FPATHCONF_METHODDEF
+ #define OS_FPATHCONF_METHODDEF
+#endif /* !defined(OS_FPATHCONF_METHODDEF) */
+
+#ifndef OS_PATHCONF_METHODDEF
+ #define OS_PATHCONF_METHODDEF
+#endif /* !defined(OS_PATHCONF_METHODDEF) */
+
+#ifndef OS_CONFSTR_METHODDEF
+ #define OS_CONFSTR_METHODDEF
+#endif /* !defined(OS_CONFSTR_METHODDEF) */
+
+#ifndef OS_SYSCONF_METHODDEF
+ #define OS_SYSCONF_METHODDEF
+#endif /* !defined(OS_SYSCONF_METHODDEF) */
+
+#ifndef OS_STARTFILE_METHODDEF
+ #define OS_STARTFILE_METHODDEF
+#endif /* !defined(OS_STARTFILE_METHODDEF) */
+
+#ifndef OS_GETLOADAVG_METHODDEF
+ #define OS_GETLOADAVG_METHODDEF
+#endif /* !defined(OS_GETLOADAVG_METHODDEF) */
+
+#ifndef OS_SETRESUID_METHODDEF
+ #define OS_SETRESUID_METHODDEF
+#endif /* !defined(OS_SETRESUID_METHODDEF) */
+
+#ifndef OS_SETRESGID_METHODDEF
+ #define OS_SETRESGID_METHODDEF
+#endif /* !defined(OS_SETRESGID_METHODDEF) */
+
+#ifndef OS_GETRESUID_METHODDEF
+ #define OS_GETRESUID_METHODDEF
+#endif /* !defined(OS_GETRESUID_METHODDEF) */
+
+#ifndef OS_GETRESGID_METHODDEF
+ #define OS_GETRESGID_METHODDEF
+#endif /* !defined(OS_GETRESGID_METHODDEF) */
+
+#ifndef OS_GETXATTR_METHODDEF
+ #define OS_GETXATTR_METHODDEF
+#endif /* !defined(OS_GETXATTR_METHODDEF) */
+
+#ifndef OS_SETXATTR_METHODDEF
+ #define OS_SETXATTR_METHODDEF
+#endif /* !defined(OS_SETXATTR_METHODDEF) */
+
+#ifndef OS_REMOVEXATTR_METHODDEF
+ #define OS_REMOVEXATTR_METHODDEF
+#endif /* !defined(OS_REMOVEXATTR_METHODDEF) */
+
+#ifndef OS_LISTXATTR_METHODDEF
+ #define OS_LISTXATTR_METHODDEF
+#endif /* !defined(OS_LISTXATTR_METHODDEF) */
+
+#ifndef OS_MEMFD_CREATE_METHODDEF
+ #define OS_MEMFD_CREATE_METHODDEF
+#endif /* !defined(OS_MEMFD_CREATE_METHODDEF) */
+
+#ifndef OS_EVENTFD_METHODDEF
+ #define OS_EVENTFD_METHODDEF
+#endif /* !defined(OS_EVENTFD_METHODDEF) */
+
+#ifndef OS_EVENTFD_READ_METHODDEF
+ #define OS_EVENTFD_READ_METHODDEF
+#endif /* !defined(OS_EVENTFD_READ_METHODDEF) */
+
+#ifndef OS_EVENTFD_WRITE_METHODDEF
+ #define OS_EVENTFD_WRITE_METHODDEF
+#endif /* !defined(OS_EVENTFD_WRITE_METHODDEF) */
+
+#ifndef OS_GET_TERMINAL_SIZE_METHODDEF
+ #define OS_GET_TERMINAL_SIZE_METHODDEF
+#endif /* !defined(OS_GET_TERMINAL_SIZE_METHODDEF) */
+
+#ifndef OS_GET_HANDLE_INHERITABLE_METHODDEF
+ #define OS_GET_HANDLE_INHERITABLE_METHODDEF
+#endif /* !defined(OS_GET_HANDLE_INHERITABLE_METHODDEF) */
+
+#ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
+ #define OS_SET_HANDLE_INHERITABLE_METHODDEF
+#endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
+
+#ifndef OS_GETRANDOM_METHODDEF
+ #define OS_GETRANDOM_METHODDEF
+#endif /* !defined(OS_GETRANDOM_METHODDEF) */
+
+#ifndef OS__ADD_DLL_DIRECTORY_METHODDEF
+ #define OS__ADD_DLL_DIRECTORY_METHODDEF
+#endif /* !defined(OS__ADD_DLL_DIRECTORY_METHODDEF) */
+
+#ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF
+ #define OS__REMOVE_DLL_DIRECTORY_METHODDEF
+#endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */
+
+#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
+ #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
+#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
+/*[clinic end generated code: output=56e83d6b7cac0d58 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/pwdmodule.c.h b/contrib/tools/python3/Modules/clinic/pwdmodule.c.h
new file mode 100644
index 00000000000..f2603eaf322
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/pwdmodule.c.h
@@ -0,0 +1,83 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(pwd_getpwuid__doc__,
+"getpwuid($module, uidobj, /)\n"
+"--\n"
+"\n"
+"Return the password database entry for the given numeric user ID.\n"
+"\n"
+"See `help(pwd)` for more on password database entries.");
+
+#define PWD_GETPWUID_METHODDEF \
+ {"getpwuid", (PyCFunction)pwd_getpwuid, METH_O, pwd_getpwuid__doc__},
+
+PyDoc_STRVAR(pwd_getpwnam__doc__,
+"getpwnam($module, name, /)\n"
+"--\n"
+"\n"
+"Return the password database entry for the given user name.\n"
+"\n"
+"See `help(pwd)` for more on password database entries.");
+
+#define PWD_GETPWNAM_METHODDEF \
+ {"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__},
+
+static PyObject *
+pwd_getpwnam_impl(PyObject *module, PyObject *name);
+
+static PyObject *
+pwd_getpwnam(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *name;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("getpwnam", "argument", "str", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg) == -1) {
+ goto exit;
+ }
+ name = arg;
+ return_value = pwd_getpwnam_impl(module, name);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_GETPWENT)
+
+PyDoc_STRVAR(pwd_getpwall__doc__,
+"getpwall($module, /)\n"
+"--\n"
+"\n"
+"Return a list of all available password database entries, in arbitrary order.\n"
+"\n"
+"See help(pwd) for more on password database entries.");
+
+#define PWD_GETPWALL_METHODDEF \
+ {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__},
+
+static PyObject *
+pwd_getpwall_impl(PyObject *module);
+
+static PyObject *
+pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return pwd_getpwall_impl(module);
+}
+
+#endif /* defined(HAVE_GETPWENT) */
+
+#ifndef PWD_GETPWALL_METHODDEF
+ #define PWD_GETPWALL_METHODDEF
+#endif /* !defined(PWD_GETPWALL_METHODDEF) */
+/*[clinic end generated code: output=a95bc08653cda56b input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/pyexpat.c.h b/contrib/tools/python3/Modules/clinic/pyexpat.c.h
new file mode 100644
index 00000000000..34937c5d594
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/pyexpat.c.h
@@ -0,0 +1,501 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
+"Parse($self, data, isfinal=False, /)\n"
+"--\n"
+"\n"
+"Parse XML data.\n"
+"\n"
+"`isfinal\' should be true at end of input.");
+
+#define PYEXPAT_XMLPARSER_PARSE_METHODDEF \
+ {"Parse", _PyCFunction_CAST(pyexpat_xmlparser_Parse), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pyexpat_xmlparser_Parse__doc__},
+
+static PyObject *
+pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyTypeObject *cls,
+ PyObject *data, int isfinal);
+
+static PyObject *
+pyexpat_xmlparser_Parse(xmlparseobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "Parse",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject *data;
+ int isfinal = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ data = args[0];
+ if (nargs < 2) {
+ goto skip_optional_posonly;
+ }
+ isfinal = PyObject_IsTrue(args[1]);
+ if (isfinal < 0) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = pyexpat_xmlparser_Parse_impl(self, cls, data, isfinal);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pyexpat_xmlparser_ParseFile__doc__,
+"ParseFile($self, file, /)\n"
+"--\n"
+"\n"
+"Parse XML data from file-like object.");
+
+#define PYEXPAT_XMLPARSER_PARSEFILE_METHODDEF \
+ {"ParseFile", _PyCFunction_CAST(pyexpat_xmlparser_ParseFile), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pyexpat_xmlparser_ParseFile__doc__},
+
+static PyObject *
+pyexpat_xmlparser_ParseFile_impl(xmlparseobject *self, PyTypeObject *cls,
+ PyObject *file);
+
+static PyObject *
+pyexpat_xmlparser_ParseFile(xmlparseobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "ParseFile",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *file;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ file = args[0];
+ return_value = pyexpat_xmlparser_ParseFile_impl(self, cls, file);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pyexpat_xmlparser_SetBase__doc__,
+"SetBase($self, base, /)\n"
+"--\n"
+"\n"
+"Set the base URL for the parser.");
+
+#define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \
+ {"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__},
+
+static PyObject *
+pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base);
+
+static PyObject *
+pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *base;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("SetBase", "argument", "str", arg);
+ goto exit;
+ }
+ Py_ssize_t base_length;
+ base = PyUnicode_AsUTF8AndSize(arg, &base_length);
+ if (base == NULL) {
+ goto exit;
+ }
+ if (strlen(base) != (size_t)base_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = pyexpat_xmlparser_SetBase_impl(self, base);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pyexpat_xmlparser_GetBase__doc__,
+"GetBase($self, /)\n"
+"--\n"
+"\n"
+"Return base URL string for the parser.");
+
+#define PYEXPAT_XMLPARSER_GETBASE_METHODDEF \
+ {"GetBase", (PyCFunction)pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__},
+
+static PyObject *
+pyexpat_xmlparser_GetBase_impl(xmlparseobject *self);
+
+static PyObject *
+pyexpat_xmlparser_GetBase(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return pyexpat_xmlparser_GetBase_impl(self);
+}
+
+PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__,
+"GetInputContext($self, /)\n"
+"--\n"
+"\n"
+"Return the untranslated text of the input that caused the current event.\n"
+"\n"
+"If the event was generated by a large amount of text (such as a start tag\n"
+"for an element with many attributes), not all of the text may be available.");
+
+#define PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF \
+ {"GetInputContext", (PyCFunction)pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__},
+
+static PyObject *
+pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self);
+
+static PyObject *
+pyexpat_xmlparser_GetInputContext(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
+{
+ return pyexpat_xmlparser_GetInputContext_impl(self);
+}
+
+PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__,
+"ExternalEntityParserCreate($self, context, encoding=<unrepresentable>,\n"
+" /)\n"
+"--\n"
+"\n"
+"Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.");
+
+#define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \
+ {"ExternalEntityParserCreate", _PyCFunction_CAST(pyexpat_xmlparser_ExternalEntityParserCreate), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
+
+static PyObject *
+pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
+ PyTypeObject *cls,
+ const char *context,
+ const char *encoding);
+
+static PyObject *
+pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", "", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "ExternalEntityParserCreate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ const char *context;
+ const char *encoding = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (args[0] == Py_None) {
+ context = NULL;
+ }
+ else if (PyUnicode_Check(args[0])) {
+ Py_ssize_t context_length;
+ context = PyUnicode_AsUTF8AndSize(args[0], &context_length);
+ if (context == NULL) {
+ goto exit;
+ }
+ if (strlen(context) != (size_t)context_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("ExternalEntityParserCreate", "argument 1", "str or None", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional_posonly;
+ }
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("ExternalEntityParserCreate", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[1], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, cls, context, encoding);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pyexpat_xmlparser_SetParamEntityParsing__doc__,
+"SetParamEntityParsing($self, flag, /)\n"
+"--\n"
+"\n"
+"Controls parsing of parameter entities (including the external DTD subset).\n"
+"\n"
+"Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER,\n"
+"XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and\n"
+"XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag\n"
+"was successful.");
+
+#define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \
+ {"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__},
+
+static PyObject *
+pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag);
+
+static PyObject *
+pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int flag;
+
+ flag = _PyLong_AsInt(arg);
+ if (flag == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = pyexpat_xmlparser_SetParamEntityParsing_impl(self, flag);
+
+exit:
+ return return_value;
+}
+
+#if (XML_COMBINED_VERSION >= 19505)
+
+PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__,
+"UseForeignDTD($self, flag=True, /)\n"
+"--\n"
+"\n"
+"Allows the application to provide an artificial external subset if one is not specified as part of the document instance.\n"
+"\n"
+"This readily allows the use of a \'default\' document type controlled by the\n"
+"application, while still getting the advantage of providing document type\n"
+"information to the parser. \'flag\' defaults to True if not provided.");
+
+#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \
+ {"UseForeignDTD", _PyCFunction_CAST(pyexpat_xmlparser_UseForeignDTD), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, pyexpat_xmlparser_UseForeignDTD__doc__},
+
+static PyObject *
+pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, PyTypeObject *cls,
+ int flag);
+
+static PyObject *
+pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "UseForeignDTD",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int flag = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ flag = PyObject_IsTrue(args[0]);
+ if (flag < 0) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, cls, flag);
+
+exit:
+ return return_value;
+}
+
+#endif /* (XML_COMBINED_VERSION >= 19505) */
+
+PyDoc_STRVAR(pyexpat_ParserCreate__doc__,
+"ParserCreate($module, /, encoding=None, namespace_separator=None,\n"
+" intern=<unrepresentable>)\n"
+"--\n"
+"\n"
+"Return a new XML parser object.");
+
+#define PYEXPAT_PARSERCREATE_METHODDEF \
+ {"ParserCreate", _PyCFunction_CAST(pyexpat_ParserCreate), METH_FASTCALL|METH_KEYWORDS, pyexpat_ParserCreate__doc__},
+
+static PyObject *
+pyexpat_ParserCreate_impl(PyObject *module, const char *encoding,
+ const char *namespace_separator, PyObject *intern);
+
+static PyObject *
+pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(encoding), &_Py_ID(namespace_separator), &_Py_ID(intern), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"encoding", "namespace_separator", "intern", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "ParserCreate",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ const char *encoding = NULL;
+ const char *namespace_separator = NULL;
+ PyObject *intern = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ if (args[0] == Py_None) {
+ encoding = NULL;
+ }
+ else if (PyUnicode_Check(args[0])) {
+ Py_ssize_t encoding_length;
+ encoding = PyUnicode_AsUTF8AndSize(args[0], &encoding_length);
+ if (encoding == NULL) {
+ goto exit;
+ }
+ if (strlen(encoding) != (size_t)encoding_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("ParserCreate", "argument 'encoding'", "str or None", args[0]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[1]) {
+ if (args[1] == Py_None) {
+ namespace_separator = NULL;
+ }
+ else if (PyUnicode_Check(args[1])) {
+ Py_ssize_t namespace_separator_length;
+ namespace_separator = PyUnicode_AsUTF8AndSize(args[1], &namespace_separator_length);
+ if (namespace_separator == NULL) {
+ goto exit;
+ }
+ if (strlen(namespace_separator) != (size_t)namespace_separator_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ }
+ else {
+ _PyArg_BadArgument("ParserCreate", "argument 'namespace_separator'", "str or None", args[1]);
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ intern = args[2];
+skip_optional_pos:
+ return_value = pyexpat_ParserCreate_impl(module, encoding, namespace_separator, intern);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(pyexpat_ErrorString__doc__,
+"ErrorString($module, code, /)\n"
+"--\n"
+"\n"
+"Returns string error for given number.");
+
+#define PYEXPAT_ERRORSTRING_METHODDEF \
+ {"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__},
+
+static PyObject *
+pyexpat_ErrorString_impl(PyObject *module, long code);
+
+static PyObject *
+pyexpat_ErrorString(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ long code;
+
+ code = PyLong_AsLong(arg);
+ if (code == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = pyexpat_ErrorString_impl(module, code);
+
+exit:
+ return return_value;
+}
+
+#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
+ #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
+#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
+/*[clinic end generated code: output=63efc62e24a7b5a7 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/resource.c.h b/contrib/tools/python3/Modules/clinic/resource.c.h
new file mode 100644
index 00000000000..d0ca8e7150f
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/resource.c.h
@@ -0,0 +1,181 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+#if defined(HAVE_GETRUSAGE)
+
+PyDoc_STRVAR(resource_getrusage__doc__,
+"getrusage($module, who, /)\n"
+"--\n"
+"\n");
+
+#define RESOURCE_GETRUSAGE_METHODDEF \
+ {"getrusage", (PyCFunction)resource_getrusage, METH_O, resource_getrusage__doc__},
+
+static PyObject *
+resource_getrusage_impl(PyObject *module, int who);
+
+static PyObject *
+resource_getrusage(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int who;
+
+ who = _PyLong_AsInt(arg);
+ if (who == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = resource_getrusage_impl(module, who);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETRUSAGE) */
+
+PyDoc_STRVAR(resource_getrlimit__doc__,
+"getrlimit($module, resource, /)\n"
+"--\n"
+"\n");
+
+#define RESOURCE_GETRLIMIT_METHODDEF \
+ {"getrlimit", (PyCFunction)resource_getrlimit, METH_O, resource_getrlimit__doc__},
+
+static PyObject *
+resource_getrlimit_impl(PyObject *module, int resource);
+
+static PyObject *
+resource_getrlimit(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int resource;
+
+ resource = _PyLong_AsInt(arg);
+ if (resource == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = resource_getrlimit_impl(module, resource);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(resource_setrlimit__doc__,
+"setrlimit($module, resource, limits, /)\n"
+"--\n"
+"\n");
+
+#define RESOURCE_SETRLIMIT_METHODDEF \
+ {"setrlimit", _PyCFunction_CAST(resource_setrlimit), METH_FASTCALL, resource_setrlimit__doc__},
+
+static PyObject *
+resource_setrlimit_impl(PyObject *module, int resource, PyObject *limits);
+
+static PyObject *
+resource_setrlimit(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int resource;
+ PyObject *limits;
+
+ if (!_PyArg_CheckPositional("setrlimit", nargs, 2, 2)) {
+ goto exit;
+ }
+ resource = _PyLong_AsInt(args[0]);
+ if (resource == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ limits = args[1];
+ return_value = resource_setrlimit_impl(module, resource, limits);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_PRLIMIT)
+
+PyDoc_STRVAR(resource_prlimit__doc__,
+"prlimit($module, pid, resource, limits=None, /)\n"
+"--\n"
+"\n");
+
+#define RESOURCE_PRLIMIT_METHODDEF \
+ {"prlimit", _PyCFunction_CAST(resource_prlimit), METH_FASTCALL, resource_prlimit__doc__},
+
+static PyObject *
+resource_prlimit_impl(PyObject *module, pid_t pid, int resource,
+ PyObject *limits);
+
+static PyObject *
+resource_prlimit(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ pid_t pid;
+ int resource;
+ PyObject *limits = Py_None;
+
+ if (!_PyArg_CheckPositional("prlimit", nargs, 2, 3)) {
+ goto exit;
+ }
+ pid = PyLong_AsPid(args[0]);
+ if (pid == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ resource = _PyLong_AsInt(args[1]);
+ if (resource == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ limits = args[2];
+skip_optional:
+ return_value = resource_prlimit_impl(module, pid, resource, limits);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_PRLIMIT) */
+
+PyDoc_STRVAR(resource_getpagesize__doc__,
+"getpagesize($module, /)\n"
+"--\n"
+"\n");
+
+#define RESOURCE_GETPAGESIZE_METHODDEF \
+ {"getpagesize", (PyCFunction)resource_getpagesize, METH_NOARGS, resource_getpagesize__doc__},
+
+static int
+resource_getpagesize_impl(PyObject *module);
+
+static PyObject *
+resource_getpagesize(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = resource_getpagesize_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+#ifndef RESOURCE_GETRUSAGE_METHODDEF
+ #define RESOURCE_GETRUSAGE_METHODDEF
+#endif /* !defined(RESOURCE_GETRUSAGE_METHODDEF) */
+
+#ifndef RESOURCE_PRLIMIT_METHODDEF
+ #define RESOURCE_PRLIMIT_METHODDEF
+#endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
+/*[clinic end generated code: output=2fbec74335a57230 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/selectmodule.c.h b/contrib/tools/python3/Modules/clinic/selectmodule.c.h
new file mode 100644
index 00000000000..f44ca1d70a1
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/selectmodule.c.h
@@ -0,0 +1,1312 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(select_select__doc__,
+"select($module, rlist, wlist, xlist, timeout=None, /)\n"
+"--\n"
+"\n"
+"Wait until one or more file descriptors are ready for some kind of I/O.\n"
+"\n"
+"The first three arguments are iterables of file descriptors to be waited for:\n"
+"rlist -- wait until ready for reading\n"
+"wlist -- wait until ready for writing\n"
+"xlist -- wait for an \"exceptional condition\"\n"
+"If only one kind of condition is required, pass [] for the other lists.\n"
+"\n"
+"A file descriptor is either a socket or file object, or a small integer\n"
+"gotten from a fileno() method call on one of those.\n"
+"\n"
+"The optional 4th argument specifies a timeout in seconds; it may be\n"
+"a floating point number to specify fractions of seconds. If it is absent\n"
+"or None, the call will never time out.\n"
+"\n"
+"The return value is a tuple of three lists corresponding to the first three\n"
+"arguments; each contains the subset of the corresponding file descriptors\n"
+"that are ready.\n"
+"\n"
+"*** IMPORTANT NOTICE ***\n"
+"On Windows, only sockets are supported; on Unix, all file\n"
+"descriptors can be used.");
+
+#define SELECT_SELECT_METHODDEF \
+ {"select", _PyCFunction_CAST(select_select), METH_FASTCALL, select_select__doc__},
+
+static PyObject *
+select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
+ PyObject *xlist, PyObject *timeout_obj);
+
+static PyObject *
+select_select(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *rlist;
+ PyObject *wlist;
+ PyObject *xlist;
+ PyObject *timeout_obj = Py_None;
+
+ if (!_PyArg_CheckPositional("select", nargs, 3, 4)) {
+ goto exit;
+ }
+ rlist = args[0];
+ wlist = args[1];
+ xlist = args[2];
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ timeout_obj = args[3];
+skip_optional:
+ return_value = select_select_impl(module, rlist, wlist, xlist, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
+
+PyDoc_STRVAR(select_poll_register__doc__,
+"register($self, fd,\n"
+" eventmask=select.POLLIN | select.POLLPRI | select.POLLOUT, /)\n"
+"--\n"
+"\n"
+"Register a file descriptor with the polling object.\n"
+"\n"
+" fd\n"
+" either an integer, or an object with a fileno() method returning an int\n"
+" eventmask\n"
+" an optional bitmask describing the type of events to check for");
+
+#define SELECT_POLL_REGISTER_METHODDEF \
+ {"register", _PyCFunction_CAST(select_poll_register), METH_FASTCALL, select_poll_register__doc__},
+
+static PyObject *
+select_poll_register_impl(pollObject *self, int fd, unsigned short eventmask);
+
+static PyObject *
+select_poll_register(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ unsigned short eventmask = POLLIN | POLLPRI | POLLOUT;
+
+ if (!_PyArg_CheckPositional("register", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = select_poll_register_impl(self, fd, eventmask);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
+
+PyDoc_STRVAR(select_poll_modify__doc__,
+"modify($self, fd, eventmask, /)\n"
+"--\n"
+"\n"
+"Modify an already registered file descriptor.\n"
+"\n"
+" fd\n"
+" either an integer, or an object with a fileno() method returning\n"
+" an int\n"
+" eventmask\n"
+" a bitmask describing the type of events to check for");
+
+#define SELECT_POLL_MODIFY_METHODDEF \
+ {"modify", _PyCFunction_CAST(select_poll_modify), METH_FASTCALL, select_poll_modify__doc__},
+
+static PyObject *
+select_poll_modify_impl(pollObject *self, int fd, unsigned short eventmask);
+
+static PyObject *
+select_poll_modify(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ unsigned short eventmask;
+
+ if (!_PyArg_CheckPositional("modify", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
+ goto exit;
+ }
+ return_value = select_poll_modify_impl(self, fd, eventmask);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
+
+PyDoc_STRVAR(select_poll_unregister__doc__,
+"unregister($self, fd, /)\n"
+"--\n"
+"\n"
+"Remove a file descriptor being tracked by the polling object.");
+
+#define SELECT_POLL_UNREGISTER_METHODDEF \
+ {"unregister", (PyCFunction)select_poll_unregister, METH_O, select_poll_unregister__doc__},
+
+static PyObject *
+select_poll_unregister_impl(pollObject *self, int fd);
+
+static PyObject *
+select_poll_unregister(pollObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = select_poll_unregister_impl(self, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
+
+PyDoc_STRVAR(select_poll_poll__doc__,
+"poll($self, timeout=None, /)\n"
+"--\n"
+"\n"
+"Polls the set of registered file descriptors.\n"
+"\n"
+" timeout\n"
+" The maximum time to wait in milliseconds, or else None (or a negative\n"
+" value) to wait indefinitely.\n"
+"\n"
+"Returns a list containing any descriptors that have events or errors to\n"
+"report, as a list of (fd, event) 2-tuples.");
+
+#define SELECT_POLL_POLL_METHODDEF \
+ {"poll", _PyCFunction_CAST(select_poll_poll), METH_FASTCALL, select_poll_poll__doc__},
+
+static PyObject *
+select_poll_poll_impl(pollObject *self, PyObject *timeout_obj);
+
+static PyObject *
+select_poll_poll(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *timeout_obj = Py_None;
+
+ if (!_PyArg_CheckPositional("poll", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ timeout_obj = args[0];
+skip_optional:
+ return_value = select_poll_poll_impl(self, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll_register__doc__,
+"register($self, fd,\n"
+" eventmask=select.POLLIN | select.POLLPRI | select.POLLOUT, /)\n"
+"--\n"
+"\n"
+"Register a file descriptor with the polling object.\n"
+"\n"
+" fd\n"
+" either an integer, or an object with a fileno() method returning\n"
+" an int\n"
+" eventmask\n"
+" an optional bitmask describing the type of events to check for");
+
+#define SELECT_DEVPOLL_REGISTER_METHODDEF \
+ {"register", _PyCFunction_CAST(select_devpoll_register), METH_FASTCALL, select_devpoll_register__doc__},
+
+static PyObject *
+select_devpoll_register_impl(devpollObject *self, int fd,
+ unsigned short eventmask);
+
+static PyObject *
+select_devpoll_register(devpollObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ unsigned short eventmask = POLLIN | POLLPRI | POLLOUT;
+
+ if (!_PyArg_CheckPositional("register", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = select_devpoll_register_impl(self, fd, eventmask);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll_modify__doc__,
+"modify($self, fd,\n"
+" eventmask=select.POLLIN | select.POLLPRI | select.POLLOUT, /)\n"
+"--\n"
+"\n"
+"Modify a possible already registered file descriptor.\n"
+"\n"
+" fd\n"
+" either an integer, or an object with a fileno() method returning\n"
+" an int\n"
+" eventmask\n"
+" an optional bitmask describing the type of events to check for");
+
+#define SELECT_DEVPOLL_MODIFY_METHODDEF \
+ {"modify", _PyCFunction_CAST(select_devpoll_modify), METH_FASTCALL, select_devpoll_modify__doc__},
+
+static PyObject *
+select_devpoll_modify_impl(devpollObject *self, int fd,
+ unsigned short eventmask);
+
+static PyObject *
+select_devpoll_modify(devpollObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ unsigned short eventmask = POLLIN | POLLPRI | POLLOUT;
+
+ if (!_PyArg_CheckPositional("modify", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
+ goto exit;
+ }
+skip_optional:
+ return_value = select_devpoll_modify_impl(self, fd, eventmask);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll_unregister__doc__,
+"unregister($self, fd, /)\n"
+"--\n"
+"\n"
+"Remove a file descriptor being tracked by the polling object.");
+
+#define SELECT_DEVPOLL_UNREGISTER_METHODDEF \
+ {"unregister", (PyCFunction)select_devpoll_unregister, METH_O, select_devpoll_unregister__doc__},
+
+static PyObject *
+select_devpoll_unregister_impl(devpollObject *self, int fd);
+
+static PyObject *
+select_devpoll_unregister(devpollObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = select_devpoll_unregister_impl(self, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll_poll__doc__,
+"poll($self, timeout=None, /)\n"
+"--\n"
+"\n"
+"Polls the set of registered file descriptors.\n"
+"\n"
+" timeout\n"
+" The maximum time to wait in milliseconds, or else None (or a negative\n"
+" value) to wait indefinitely.\n"
+"\n"
+"Returns a list containing any descriptors that have events or errors to\n"
+"report, as a list of (fd, event) 2-tuples.");
+
+#define SELECT_DEVPOLL_POLL_METHODDEF \
+ {"poll", _PyCFunction_CAST(select_devpoll_poll), METH_FASTCALL, select_devpoll_poll__doc__},
+
+static PyObject *
+select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj);
+
+static PyObject *
+select_devpoll_poll(devpollObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *timeout_obj = Py_None;
+
+ if (!_PyArg_CheckPositional("poll", nargs, 0, 1)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ timeout_obj = args[0];
+skip_optional:
+ return_value = select_devpoll_poll_impl(self, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the devpoll file descriptor.\n"
+"\n"
+"Further operations on the devpoll object will raise an exception.");
+
+#define SELECT_DEVPOLL_CLOSE_METHODDEF \
+ {"close", (PyCFunction)select_devpoll_close, METH_NOARGS, select_devpoll_close__doc__},
+
+static PyObject *
+select_devpoll_close_impl(devpollObject *self);
+
+static PyObject *
+select_devpoll_close(devpollObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_devpoll_close_impl(self);
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n"
+"Return the file descriptor.");
+
+#define SELECT_DEVPOLL_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)select_devpoll_fileno, METH_NOARGS, select_devpoll_fileno__doc__},
+
+static PyObject *
+select_devpoll_fileno_impl(devpollObject *self);
+
+static PyObject *
+select_devpoll_fileno(devpollObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_devpoll_fileno_impl(self);
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
+
+PyDoc_STRVAR(select_poll__doc__,
+"poll($module, /)\n"
+"--\n"
+"\n"
+"Returns a polling object.\n"
+"\n"
+"This object supports registering and unregistering file descriptors, and then\n"
+"polling them for I/O events.");
+
+#define SELECT_POLL_METHODDEF \
+ {"poll", (PyCFunction)select_poll, METH_NOARGS, select_poll__doc__},
+
+static PyObject *
+select_poll_impl(PyObject *module);
+
+static PyObject *
+select_poll(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return select_poll_impl(module);
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
+
+#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
+
+PyDoc_STRVAR(select_devpoll__doc__,
+"devpoll($module, /)\n"
+"--\n"
+"\n"
+"Returns a polling object.\n"
+"\n"
+"This object supports registering and unregistering file descriptors, and then\n"
+"polling them for I/O events.");
+
+#define SELECT_DEVPOLL_METHODDEF \
+ {"devpoll", (PyCFunction)select_devpoll, METH_NOARGS, select_devpoll__doc__},
+
+static PyObject *
+select_devpoll_impl(PyObject *module);
+
+static PyObject *
+select_devpoll(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return select_devpoll_impl(module);
+}
+
+#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll__doc__,
+"epoll(sizehint=-1, flags=0)\n"
+"--\n"
+"\n"
+"Returns an epolling object.\n"
+"\n"
+" sizehint\n"
+" The expected number of events to be registered. It must be positive,\n"
+" or -1 to use the default. It is only used on older systems where\n"
+" epoll_create1() is not available; otherwise it has no effect (though its\n"
+" value is still checked).\n"
+" flags\n"
+" Deprecated and completely ignored. However, when supplied, its value\n"
+" must be 0 or select.EPOLL_CLOEXEC, otherwise OSError is raised.");
+
+static PyObject *
+select_epoll_impl(PyTypeObject *type, int sizehint, int flags);
+
+static PyObject *
+select_epoll(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(sizehint), &_Py_ID(flags), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"sizehint", "flags", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "epoll",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ int sizehint = -1;
+ int flags = 0;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 2, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[0]) {
+ sizehint = _PyLong_AsInt(fastargs[0]);
+ if (sizehint == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ flags = _PyLong_AsInt(fastargs[1]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = select_epoll_impl(type, sizehint, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the epoll control file descriptor.\n"
+"\n"
+"Further operations on the epoll object will raise an exception.");
+
+#define SELECT_EPOLL_CLOSE_METHODDEF \
+ {"close", (PyCFunction)select_epoll_close, METH_NOARGS, select_epoll_close__doc__},
+
+static PyObject *
+select_epoll_close_impl(pyEpoll_Object *self);
+
+static PyObject *
+select_epoll_close(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_epoll_close_impl(self);
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n"
+"Return the epoll control file descriptor.");
+
+#define SELECT_EPOLL_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)select_epoll_fileno, METH_NOARGS, select_epoll_fileno__doc__},
+
+static PyObject *
+select_epoll_fileno_impl(pyEpoll_Object *self);
+
+static PyObject *
+select_epoll_fileno(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_epoll_fileno_impl(self);
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_fromfd__doc__,
+"fromfd($type, fd, /)\n"
+"--\n"
+"\n"
+"Create an epoll object from a given control fd.");
+
+#define SELECT_EPOLL_FROMFD_METHODDEF \
+ {"fromfd", (PyCFunction)select_epoll_fromfd, METH_O|METH_CLASS, select_epoll_fromfd__doc__},
+
+static PyObject *
+select_epoll_fromfd_impl(PyTypeObject *type, int fd);
+
+static PyObject *
+select_epoll_fromfd(PyTypeObject *type, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = select_epoll_fromfd_impl(type, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_register__doc__,
+"register($self, /, fd,\n"
+" eventmask=select.EPOLLIN | select.EPOLLPRI | select.EPOLLOUT)\n"
+"--\n"
+"\n"
+"Registers a new fd or raises an OSError if the fd is already registered.\n"
+"\n"
+" fd\n"
+" the target file descriptor of the operation\n"
+" eventmask\n"
+" a bit set composed of the various EPOLL constants\n"
+"\n"
+"The epoll interface supports all file descriptors that support poll.");
+
+#define SELECT_EPOLL_REGISTER_METHODDEF \
+ {"register", _PyCFunction_CAST(select_epoll_register), METH_FASTCALL|METH_KEYWORDS, select_epoll_register__doc__},
+
+static PyObject *
+select_epoll_register_impl(pyEpoll_Object *self, int fd,
+ unsigned int eventmask);
+
+static PyObject *
+select_epoll_register(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(eventmask), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "eventmask", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "register",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ int fd;
+ unsigned int eventmask = EPOLLIN | EPOLLPRI | EPOLLOUT;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (eventmask == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = select_epoll_register_impl(self, fd, eventmask);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_modify__doc__,
+"modify($self, /, fd, eventmask)\n"
+"--\n"
+"\n"
+"Modify event mask for a registered file descriptor.\n"
+"\n"
+" fd\n"
+" the target file descriptor of the operation\n"
+" eventmask\n"
+" a bit set composed of the various EPOLL constants");
+
+#define SELECT_EPOLL_MODIFY_METHODDEF \
+ {"modify", _PyCFunction_CAST(select_epoll_modify), METH_FASTCALL|METH_KEYWORDS, select_epoll_modify__doc__},
+
+static PyObject *
+select_epoll_modify_impl(pyEpoll_Object *self, int fd,
+ unsigned int eventmask);
+
+static PyObject *
+select_epoll_modify(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), &_Py_ID(eventmask), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", "eventmask", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "modify",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ int fd;
+ unsigned int eventmask;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (eventmask == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = select_epoll_modify_impl(self, fd, eventmask);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_unregister__doc__,
+"unregister($self, /, fd)\n"
+"--\n"
+"\n"
+"Remove a registered file descriptor from the epoll object.\n"
+"\n"
+" fd\n"
+" the target file descriptor of the operation");
+
+#define SELECT_EPOLL_UNREGISTER_METHODDEF \
+ {"unregister", _PyCFunction_CAST(select_epoll_unregister), METH_FASTCALL|METH_KEYWORDS, select_epoll_unregister__doc__},
+
+static PyObject *
+select_epoll_unregister_impl(pyEpoll_Object *self, int fd);
+
+static PyObject *
+select_epoll_unregister(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(fd), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"fd", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "unregister",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int fd;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ return_value = select_epoll_unregister_impl(self, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll_poll__doc__,
+"poll($self, /, timeout=None, maxevents=-1)\n"
+"--\n"
+"\n"
+"Wait for events on the epoll file descriptor.\n"
+"\n"
+" timeout\n"
+" the maximum time to wait in seconds (as float);\n"
+" a timeout of None or -1 makes poll wait indefinitely\n"
+" maxevents\n"
+" the maximum number of events returned; -1 means no limit\n"
+"\n"
+"Returns a list containing any descriptors that have events to report,\n"
+"as a list of (fd, events) 2-tuples.");
+
+#define SELECT_EPOLL_POLL_METHODDEF \
+ {"poll", _PyCFunction_CAST(select_epoll_poll), METH_FASTCALL|METH_KEYWORDS, select_epoll_poll__doc__},
+
+static PyObject *
+select_epoll_poll_impl(pyEpoll_Object *self, PyObject *timeout_obj,
+ int maxevents);
+
+static PyObject *
+select_epoll_poll(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(timeout), &_Py_ID(maxevents), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"timeout", "maxevents", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "poll",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *timeout_obj = Py_None;
+ int maxevents = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ timeout_obj = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ maxevents = _PyLong_AsInt(args[1]);
+ if (maxevents == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = select_epoll_poll_impl(self, timeout_obj, maxevents);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll___enter____doc__,
+"__enter__($self, /)\n"
+"--\n"
+"\n");
+
+#define SELECT_EPOLL___ENTER___METHODDEF \
+ {"__enter__", (PyCFunction)select_epoll___enter__, METH_NOARGS, select_epoll___enter____doc__},
+
+static PyObject *
+select_epoll___enter___impl(pyEpoll_Object *self);
+
+static PyObject *
+select_epoll___enter__(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_epoll___enter___impl(self);
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_EPOLL)
+
+PyDoc_STRVAR(select_epoll___exit____doc__,
+"__exit__($self, exc_type=None, exc_value=None, exc_tb=None, /)\n"
+"--\n"
+"\n");
+
+#define SELECT_EPOLL___EXIT___METHODDEF \
+ {"__exit__", _PyCFunction_CAST(select_epoll___exit__), METH_FASTCALL, select_epoll___exit____doc__},
+
+static PyObject *
+select_epoll___exit___impl(pyEpoll_Object *self, PyObject *exc_type,
+ PyObject *exc_value, PyObject *exc_tb);
+
+static PyObject *
+select_epoll___exit__(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *exc_type = Py_None;
+ PyObject *exc_value = Py_None;
+ PyObject *exc_tb = Py_None;
+
+ if (!_PyArg_CheckPositional("__exit__", nargs, 0, 3)) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional;
+ }
+ exc_type = args[0];
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ exc_value = args[1];
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ exc_tb = args[2];
+skip_optional:
+ return_value = select_epoll___exit___impl(self, exc_type, exc_value, exc_tb);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_EPOLL) */
+
+#if defined(HAVE_KQUEUE)
+
+PyDoc_STRVAR(select_kqueue__doc__,
+"kqueue()\n"
+"--\n"
+"\n"
+"Kqueue syscall wrapper.\n"
+"\n"
+"For example, to start watching a socket for input:\n"
+">>> kq = kqueue()\n"
+">>> sock = socket()\n"
+">>> sock.connect((host, port))\n"
+">>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_ADD)], 0)\n"
+"\n"
+"To wait one second for it to become writeable:\n"
+">>> kq.control(None, 1, 1000)\n"
+"\n"
+"To stop listening:\n"
+">>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_DELETE)], 0)");
+
+static PyObject *
+select_kqueue_impl(PyTypeObject *type);
+
+static PyObject *
+select_kqueue(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyTypeObject *base_tp = _selectstate_by_type(type)->kqueue_queue_Type;
+
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoPositional("kqueue", args)) {
+ goto exit;
+ }
+ if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
+ !_PyArg_NoKeywords("kqueue", kwargs)) {
+ goto exit;
+ }
+ return_value = select_kqueue_impl(type);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_KQUEUE) */
+
+#if defined(HAVE_KQUEUE)
+
+PyDoc_STRVAR(select_kqueue_close__doc__,
+"close($self, /)\n"
+"--\n"
+"\n"
+"Close the kqueue control file descriptor.\n"
+"\n"
+"Further operations on the kqueue object will raise an exception.");
+
+#define SELECT_KQUEUE_CLOSE_METHODDEF \
+ {"close", (PyCFunction)select_kqueue_close, METH_NOARGS, select_kqueue_close__doc__},
+
+static PyObject *
+select_kqueue_close_impl(kqueue_queue_Object *self);
+
+static PyObject *
+select_kqueue_close(kqueue_queue_Object *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_kqueue_close_impl(self);
+}
+
+#endif /* defined(HAVE_KQUEUE) */
+
+#if defined(HAVE_KQUEUE)
+
+PyDoc_STRVAR(select_kqueue_fileno__doc__,
+"fileno($self, /)\n"
+"--\n"
+"\n"
+"Return the kqueue control file descriptor.");
+
+#define SELECT_KQUEUE_FILENO_METHODDEF \
+ {"fileno", (PyCFunction)select_kqueue_fileno, METH_NOARGS, select_kqueue_fileno__doc__},
+
+static PyObject *
+select_kqueue_fileno_impl(kqueue_queue_Object *self);
+
+static PyObject *
+select_kqueue_fileno(kqueue_queue_Object *self, PyObject *Py_UNUSED(ignored))
+{
+ return select_kqueue_fileno_impl(self);
+}
+
+#endif /* defined(HAVE_KQUEUE) */
+
+#if defined(HAVE_KQUEUE)
+
+PyDoc_STRVAR(select_kqueue_fromfd__doc__,
+"fromfd($type, fd, /)\n"
+"--\n"
+"\n"
+"Create a kqueue object from a given control fd.");
+
+#define SELECT_KQUEUE_FROMFD_METHODDEF \
+ {"fromfd", (PyCFunction)select_kqueue_fromfd, METH_O|METH_CLASS, select_kqueue_fromfd__doc__},
+
+static PyObject *
+select_kqueue_fromfd_impl(PyTypeObject *type, int fd);
+
+static PyObject *
+select_kqueue_fromfd(PyTypeObject *type, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ fd = _PyLong_AsInt(arg);
+ if (fd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = select_kqueue_fromfd_impl(type, fd);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_KQUEUE) */
+
+#if defined(HAVE_KQUEUE)
+
+PyDoc_STRVAR(select_kqueue_control__doc__,
+"control($self, changelist, maxevents, timeout=None, /)\n"
+"--\n"
+"\n"
+"Calls the kernel kevent function.\n"
+"\n"
+" changelist\n"
+" Must be an iterable of kevent objects describing the changes to be made\n"
+" to the kernel\'s watch list or None.\n"
+" maxevents\n"
+" The maximum number of events that the kernel will return.\n"
+" timeout\n"
+" The maximum time to wait in seconds, or else None to wait forever.\n"
+" This accepts floats for smaller timeouts, too.");
+
+#define SELECT_KQUEUE_CONTROL_METHODDEF \
+ {"control", _PyCFunction_CAST(select_kqueue_control), METH_FASTCALL, select_kqueue_control__doc__},
+
+static PyObject *
+select_kqueue_control_impl(kqueue_queue_Object *self, PyObject *changelist,
+ int maxevents, PyObject *otimeout);
+
+static PyObject *
+select_kqueue_control(kqueue_queue_Object *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *changelist;
+ int maxevents;
+ PyObject *otimeout = Py_None;
+
+ if (!_PyArg_CheckPositional("control", nargs, 2, 3)) {
+ goto exit;
+ }
+ changelist = args[0];
+ maxevents = _PyLong_AsInt(args[1]);
+ if (maxevents == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ otimeout = args[2];
+skip_optional:
+ return_value = select_kqueue_control_impl(self, changelist, maxevents, otimeout);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_KQUEUE) */
+
+#ifndef SELECT_POLL_REGISTER_METHODDEF
+ #define SELECT_POLL_REGISTER_METHODDEF
+#endif /* !defined(SELECT_POLL_REGISTER_METHODDEF) */
+
+#ifndef SELECT_POLL_MODIFY_METHODDEF
+ #define SELECT_POLL_MODIFY_METHODDEF
+#endif /* !defined(SELECT_POLL_MODIFY_METHODDEF) */
+
+#ifndef SELECT_POLL_UNREGISTER_METHODDEF
+ #define SELECT_POLL_UNREGISTER_METHODDEF
+#endif /* !defined(SELECT_POLL_UNREGISTER_METHODDEF) */
+
+#ifndef SELECT_POLL_POLL_METHODDEF
+ #define SELECT_POLL_POLL_METHODDEF
+#endif /* !defined(SELECT_POLL_POLL_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_REGISTER_METHODDEF
+ #define SELECT_DEVPOLL_REGISTER_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_REGISTER_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_MODIFY_METHODDEF
+ #define SELECT_DEVPOLL_MODIFY_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_MODIFY_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_UNREGISTER_METHODDEF
+ #define SELECT_DEVPOLL_UNREGISTER_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_UNREGISTER_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_POLL_METHODDEF
+ #define SELECT_DEVPOLL_POLL_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_POLL_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_CLOSE_METHODDEF
+ #define SELECT_DEVPOLL_CLOSE_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_CLOSE_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_FILENO_METHODDEF
+ #define SELECT_DEVPOLL_FILENO_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_FILENO_METHODDEF) */
+
+#ifndef SELECT_POLL_METHODDEF
+ #define SELECT_POLL_METHODDEF
+#endif /* !defined(SELECT_POLL_METHODDEF) */
+
+#ifndef SELECT_DEVPOLL_METHODDEF
+ #define SELECT_DEVPOLL_METHODDEF
+#endif /* !defined(SELECT_DEVPOLL_METHODDEF) */
+
+#ifndef SELECT_EPOLL_CLOSE_METHODDEF
+ #define SELECT_EPOLL_CLOSE_METHODDEF
+#endif /* !defined(SELECT_EPOLL_CLOSE_METHODDEF) */
+
+#ifndef SELECT_EPOLL_FILENO_METHODDEF
+ #define SELECT_EPOLL_FILENO_METHODDEF
+#endif /* !defined(SELECT_EPOLL_FILENO_METHODDEF) */
+
+#ifndef SELECT_EPOLL_FROMFD_METHODDEF
+ #define SELECT_EPOLL_FROMFD_METHODDEF
+#endif /* !defined(SELECT_EPOLL_FROMFD_METHODDEF) */
+
+#ifndef SELECT_EPOLL_REGISTER_METHODDEF
+ #define SELECT_EPOLL_REGISTER_METHODDEF
+#endif /* !defined(SELECT_EPOLL_REGISTER_METHODDEF) */
+
+#ifndef SELECT_EPOLL_MODIFY_METHODDEF
+ #define SELECT_EPOLL_MODIFY_METHODDEF
+#endif /* !defined(SELECT_EPOLL_MODIFY_METHODDEF) */
+
+#ifndef SELECT_EPOLL_UNREGISTER_METHODDEF
+ #define SELECT_EPOLL_UNREGISTER_METHODDEF
+#endif /* !defined(SELECT_EPOLL_UNREGISTER_METHODDEF) */
+
+#ifndef SELECT_EPOLL_POLL_METHODDEF
+ #define SELECT_EPOLL_POLL_METHODDEF
+#endif /* !defined(SELECT_EPOLL_POLL_METHODDEF) */
+
+#ifndef SELECT_EPOLL___ENTER___METHODDEF
+ #define SELECT_EPOLL___ENTER___METHODDEF
+#endif /* !defined(SELECT_EPOLL___ENTER___METHODDEF) */
+
+#ifndef SELECT_EPOLL___EXIT___METHODDEF
+ #define SELECT_EPOLL___EXIT___METHODDEF
+#endif /* !defined(SELECT_EPOLL___EXIT___METHODDEF) */
+
+#ifndef SELECT_KQUEUE_CLOSE_METHODDEF
+ #define SELECT_KQUEUE_CLOSE_METHODDEF
+#endif /* !defined(SELECT_KQUEUE_CLOSE_METHODDEF) */
+
+#ifndef SELECT_KQUEUE_FILENO_METHODDEF
+ #define SELECT_KQUEUE_FILENO_METHODDEF
+#endif /* !defined(SELECT_KQUEUE_FILENO_METHODDEF) */
+
+#ifndef SELECT_KQUEUE_FROMFD_METHODDEF
+ #define SELECT_KQUEUE_FROMFD_METHODDEF
+#endif /* !defined(SELECT_KQUEUE_FROMFD_METHODDEF) */
+
+#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
+ #define SELECT_KQUEUE_CONTROL_METHODDEF
+#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
+/*[clinic end generated code: output=64516114287e894d input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/sha1module.c.h b/contrib/tools/python3/Modules/clinic/sha1module.c.h
new file mode 100644
index 00000000000..e0858e77b5e
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/sha1module.c.h
@@ -0,0 +1,151 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(SHA1Type_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define SHA1TYPE_COPY_METHODDEF \
+ {"copy", _PyCFunction_CAST(SHA1Type_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, SHA1Type_copy__doc__},
+
+static PyObject *
+SHA1Type_copy_impl(SHA1object *self, PyTypeObject *cls);
+
+static PyObject *
+SHA1Type_copy(SHA1object *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
+ return NULL;
+ }
+ return SHA1Type_copy_impl(self, cls);
+}
+
+PyDoc_STRVAR(SHA1Type_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define SHA1TYPE_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)SHA1Type_digest, METH_NOARGS, SHA1Type_digest__doc__},
+
+static PyObject *
+SHA1Type_digest_impl(SHA1object *self);
+
+static PyObject *
+SHA1Type_digest(SHA1object *self, PyObject *Py_UNUSED(ignored))
+{
+ return SHA1Type_digest_impl(self);
+}
+
+PyDoc_STRVAR(SHA1Type_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define SHA1TYPE_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)SHA1Type_hexdigest, METH_NOARGS, SHA1Type_hexdigest__doc__},
+
+static PyObject *
+SHA1Type_hexdigest_impl(SHA1object *self);
+
+static PyObject *
+SHA1Type_hexdigest(SHA1object *self, PyObject *Py_UNUSED(ignored))
+{
+ return SHA1Type_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(SHA1Type_update__doc__,
+"update($self, obj, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided string.");
+
+#define SHA1TYPE_UPDATE_METHODDEF \
+ {"update", (PyCFunction)SHA1Type_update, METH_O, SHA1Type_update__doc__},
+
+PyDoc_STRVAR(_sha1_sha1__doc__,
+"sha1($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new SHA1 hash object; optionally initialized with a string.");
+
+#define _SHA1_SHA1_METHODDEF \
+ {"sha1", _PyCFunction_CAST(_sha1_sha1), METH_FASTCALL|METH_KEYWORDS, _sha1_sha1__doc__},
+
+static PyObject *
+_sha1_sha1_impl(PyObject *module, PyObject *string, int usedforsecurity);
+
+static PyObject *
+_sha1_sha1(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sha1",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *string = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ string = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _sha1_sha1_impl(module, string, usedforsecurity);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=ffe267896009b5ed input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/sha2module.c.h b/contrib/tools/python3/Modules/clinic/sha2module.c.h
new file mode 100644
index 00000000000..557a61791bd
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/sha2module.c.h
@@ -0,0 +1,440 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(SHA256Type_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define SHA256TYPE_COPY_METHODDEF \
+ {"copy", _PyCFunction_CAST(SHA256Type_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, SHA256Type_copy__doc__},
+
+static PyObject *
+SHA256Type_copy_impl(SHA256object *self, PyTypeObject *cls);
+
+static PyObject *
+SHA256Type_copy(SHA256object *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
+ return NULL;
+ }
+ return SHA256Type_copy_impl(self, cls);
+}
+
+PyDoc_STRVAR(SHA512Type_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define SHA512TYPE_COPY_METHODDEF \
+ {"copy", _PyCFunction_CAST(SHA512Type_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, SHA512Type_copy__doc__},
+
+static PyObject *
+SHA512Type_copy_impl(SHA512object *self, PyTypeObject *cls);
+
+static PyObject *
+SHA512Type_copy(SHA512object *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
+ return NULL;
+ }
+ return SHA512Type_copy_impl(self, cls);
+}
+
+PyDoc_STRVAR(SHA256Type_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define SHA256TYPE_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)SHA256Type_digest, METH_NOARGS, SHA256Type_digest__doc__},
+
+static PyObject *
+SHA256Type_digest_impl(SHA256object *self);
+
+static PyObject *
+SHA256Type_digest(SHA256object *self, PyObject *Py_UNUSED(ignored))
+{
+ return SHA256Type_digest_impl(self);
+}
+
+PyDoc_STRVAR(SHA512Type_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define SHA512TYPE_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)SHA512Type_digest, METH_NOARGS, SHA512Type_digest__doc__},
+
+static PyObject *
+SHA512Type_digest_impl(SHA512object *self);
+
+static PyObject *
+SHA512Type_digest(SHA512object *self, PyObject *Py_UNUSED(ignored))
+{
+ return SHA512Type_digest_impl(self);
+}
+
+PyDoc_STRVAR(SHA256Type_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define SHA256TYPE_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)SHA256Type_hexdigest, METH_NOARGS, SHA256Type_hexdigest__doc__},
+
+static PyObject *
+SHA256Type_hexdigest_impl(SHA256object *self);
+
+static PyObject *
+SHA256Type_hexdigest(SHA256object *self, PyObject *Py_UNUSED(ignored))
+{
+ return SHA256Type_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(SHA512Type_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define SHA512TYPE_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)SHA512Type_hexdigest, METH_NOARGS, SHA512Type_hexdigest__doc__},
+
+static PyObject *
+SHA512Type_hexdigest_impl(SHA512object *self);
+
+static PyObject *
+SHA512Type_hexdigest(SHA512object *self, PyObject *Py_UNUSED(ignored))
+{
+ return SHA512Type_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(SHA256Type_update__doc__,
+"update($self, obj, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided string.");
+
+#define SHA256TYPE_UPDATE_METHODDEF \
+ {"update", (PyCFunction)SHA256Type_update, METH_O, SHA256Type_update__doc__},
+
+PyDoc_STRVAR(SHA512Type_update__doc__,
+"update($self, obj, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided string.");
+
+#define SHA512TYPE_UPDATE_METHODDEF \
+ {"update", (PyCFunction)SHA512Type_update, METH_O, SHA512Type_update__doc__},
+
+PyDoc_STRVAR(_sha2_sha256__doc__,
+"sha256($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new SHA-256 hash object; optionally initialized with a string.");
+
+#define _SHA2_SHA256_METHODDEF \
+ {"sha256", _PyCFunction_CAST(_sha2_sha256), METH_FASTCALL|METH_KEYWORDS, _sha2_sha256__doc__},
+
+static PyObject *
+_sha2_sha256_impl(PyObject *module, PyObject *string, int usedforsecurity);
+
+static PyObject *
+_sha2_sha256(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sha256",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *string = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ string = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _sha2_sha256_impl(module, string, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sha2_sha224__doc__,
+"sha224($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new SHA-224 hash object; optionally initialized with a string.");
+
+#define _SHA2_SHA224_METHODDEF \
+ {"sha224", _PyCFunction_CAST(_sha2_sha224), METH_FASTCALL|METH_KEYWORDS, _sha2_sha224__doc__},
+
+static PyObject *
+_sha2_sha224_impl(PyObject *module, PyObject *string, int usedforsecurity);
+
+static PyObject *
+_sha2_sha224(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sha224",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *string = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ string = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _sha2_sha224_impl(module, string, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sha2_sha512__doc__,
+"sha512($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new SHA-512 hash object; optionally initialized with a string.");
+
+#define _SHA2_SHA512_METHODDEF \
+ {"sha512", _PyCFunction_CAST(_sha2_sha512), METH_FASTCALL|METH_KEYWORDS, _sha2_sha512__doc__},
+
+static PyObject *
+_sha2_sha512_impl(PyObject *module, PyObject *string, int usedforsecurity);
+
+static PyObject *
+_sha2_sha512(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sha512",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *string = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ string = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _sha2_sha512_impl(module, string, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sha2_sha384__doc__,
+"sha384($module, /, string=b\'\', *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new SHA-384 hash object; optionally initialized with a string.");
+
+#define _SHA2_SHA384_METHODDEF \
+ {"sha384", _PyCFunction_CAST(_sha2_sha384), METH_FASTCALL|METH_KEYWORDS, _sha2_sha384__doc__},
+
+static PyObject *
+_sha2_sha384_impl(PyObject *module, PyObject *string, int usedforsecurity);
+
+static PyObject *
+_sha2_sha384(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(string), &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"string", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sha384",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *string = NULL;
+ int usedforsecurity = 1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ string = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+skip_optional_pos:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(args[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = _sha2_sha384_impl(module, string, usedforsecurity);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=d83a27cd9522cf22 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/sha3module.c.h b/contrib/tools/python3/Modules/clinic/sha3module.c.h
new file mode 100644
index 00000000000..299803a3420
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/sha3module.c.h
@@ -0,0 +1,196 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(py_sha3_new__doc__,
+"sha3_224(data=b\'\', /, *, usedforsecurity=True)\n"
+"--\n"
+"\n"
+"Return a new SHA3 hash object.");
+
+static PyObject *
+py_sha3_new_impl(PyTypeObject *type, PyObject *data, int usedforsecurity);
+
+static PyObject *
+py_sha3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(usedforsecurity), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "usedforsecurity", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "sha3_224",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ PyObject *data = NULL;
+ int usedforsecurity = 1;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 1, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ noptargs--;
+ data = fastargs[0];
+skip_optional_posonly:
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ usedforsecurity = PyObject_IsTrue(fastargs[1]);
+ if (usedforsecurity < 0) {
+ goto exit;
+ }
+skip_optional_kwonly:
+ return_value = py_sha3_new_impl(type, data, usedforsecurity);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sha3_sha3_224_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the hash object.");
+
+#define _SHA3_SHA3_224_COPY_METHODDEF \
+ {"copy", (PyCFunction)_sha3_sha3_224_copy, METH_NOARGS, _sha3_sha3_224_copy__doc__},
+
+static PyObject *
+_sha3_sha3_224_copy_impl(SHA3object *self);
+
+static PyObject *
+_sha3_sha3_224_copy(SHA3object *self, PyObject *Py_UNUSED(ignored))
+{
+ return _sha3_sha3_224_copy_impl(self);
+}
+
+PyDoc_STRVAR(_sha3_sha3_224_digest__doc__,
+"digest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define _SHA3_SHA3_224_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)_sha3_sha3_224_digest, METH_NOARGS, _sha3_sha3_224_digest__doc__},
+
+static PyObject *
+_sha3_sha3_224_digest_impl(SHA3object *self);
+
+static PyObject *
+_sha3_sha3_224_digest(SHA3object *self, PyObject *Py_UNUSED(ignored))
+{
+ return _sha3_sha3_224_digest_impl(self);
+}
+
+PyDoc_STRVAR(_sha3_sha3_224_hexdigest__doc__,
+"hexdigest($self, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define _SHA3_SHA3_224_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)_sha3_sha3_224_hexdigest, METH_NOARGS, _sha3_sha3_224_hexdigest__doc__},
+
+static PyObject *
+_sha3_sha3_224_hexdigest_impl(SHA3object *self);
+
+static PyObject *
+_sha3_sha3_224_hexdigest(SHA3object *self, PyObject *Py_UNUSED(ignored))
+{
+ return _sha3_sha3_224_hexdigest_impl(self);
+}
+
+PyDoc_STRVAR(_sha3_sha3_224_update__doc__,
+"update($self, data, /)\n"
+"--\n"
+"\n"
+"Update this hash object\'s state with the provided bytes-like object.");
+
+#define _SHA3_SHA3_224_UPDATE_METHODDEF \
+ {"update", (PyCFunction)_sha3_sha3_224_update, METH_O, _sha3_sha3_224_update__doc__},
+
+PyDoc_STRVAR(_sha3_shake_128_digest__doc__,
+"digest($self, length, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a bytes object.");
+
+#define _SHA3_SHAKE_128_DIGEST_METHODDEF \
+ {"digest", (PyCFunction)_sha3_shake_128_digest, METH_O, _sha3_shake_128_digest__doc__},
+
+static PyObject *
+_sha3_shake_128_digest_impl(SHA3object *self, unsigned long length);
+
+static PyObject *
+_sha3_shake_128_digest(SHA3object *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ unsigned long length;
+
+ if (!_PyLong_UnsignedLong_Converter(arg, &length)) {
+ goto exit;
+ }
+ return_value = _sha3_shake_128_digest_impl(self, length);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_sha3_shake_128_hexdigest__doc__,
+"hexdigest($self, length, /)\n"
+"--\n"
+"\n"
+"Return the digest value as a string of hexadecimal digits.");
+
+#define _SHA3_SHAKE_128_HEXDIGEST_METHODDEF \
+ {"hexdigest", (PyCFunction)_sha3_shake_128_hexdigest, METH_O, _sha3_shake_128_hexdigest__doc__},
+
+static PyObject *
+_sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length);
+
+static PyObject *
+_sha3_shake_128_hexdigest(SHA3object *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ unsigned long length;
+
+ if (!_PyLong_UnsignedLong_Converter(arg, &length)) {
+ goto exit;
+ }
+ return_value = _sha3_shake_128_hexdigest_impl(self, length);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=907cb475f3dc9ee0 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/signalmodule.c.h b/contrib/tools/python3/Modules/clinic/signalmodule.c.h
new file mode 100644
index 00000000000..3b3c6ba150a
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/signalmodule.c.h
@@ -0,0 +1,708 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(signal_default_int_handler__doc__,
+"default_int_handler($module, signalnum, frame, /)\n"
+"--\n"
+"\n"
+"The default handler for SIGINT installed by Python.\n"
+"\n"
+"It raises KeyboardInterrupt.");
+
+#define SIGNAL_DEFAULT_INT_HANDLER_METHODDEF \
+ {"default_int_handler", _PyCFunction_CAST(signal_default_int_handler), METH_FASTCALL, signal_default_int_handler__doc__},
+
+static PyObject *
+signal_default_int_handler_impl(PyObject *module, int signalnum,
+ PyObject *frame);
+
+static PyObject *
+signal_default_int_handler(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int signalnum;
+ PyObject *frame;
+
+ if (!_PyArg_CheckPositional("default_int_handler", nargs, 2, 2)) {
+ goto exit;
+ }
+ signalnum = _PyLong_AsInt(args[0]);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ frame = args[1];
+ return_value = signal_default_int_handler_impl(module, signalnum, frame);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_ALARM)
+
+PyDoc_STRVAR(signal_alarm__doc__,
+"alarm($module, seconds, /)\n"
+"--\n"
+"\n"
+"Arrange for SIGALRM to arrive after the given number of seconds.");
+
+#define SIGNAL_ALARM_METHODDEF \
+ {"alarm", (PyCFunction)signal_alarm, METH_O, signal_alarm__doc__},
+
+static long
+signal_alarm_impl(PyObject *module, int seconds);
+
+static PyObject *
+signal_alarm(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int seconds;
+ long _return_value;
+
+ seconds = _PyLong_AsInt(arg);
+ if (seconds == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = signal_alarm_impl(module, seconds);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_ALARM) */
+
+#if defined(HAVE_PAUSE)
+
+PyDoc_STRVAR(signal_pause__doc__,
+"pause($module, /)\n"
+"--\n"
+"\n"
+"Wait until a signal arrives.");
+
+#define SIGNAL_PAUSE_METHODDEF \
+ {"pause", (PyCFunction)signal_pause, METH_NOARGS, signal_pause__doc__},
+
+static PyObject *
+signal_pause_impl(PyObject *module);
+
+static PyObject *
+signal_pause(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return signal_pause_impl(module);
+}
+
+#endif /* defined(HAVE_PAUSE) */
+
+PyDoc_STRVAR(signal_raise_signal__doc__,
+"raise_signal($module, signalnum, /)\n"
+"--\n"
+"\n"
+"Send a signal to the executing process.");
+
+#define SIGNAL_RAISE_SIGNAL_METHODDEF \
+ {"raise_signal", (PyCFunction)signal_raise_signal, METH_O, signal_raise_signal__doc__},
+
+static PyObject *
+signal_raise_signal_impl(PyObject *module, int signalnum);
+
+static PyObject *
+signal_raise_signal(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int signalnum;
+
+ signalnum = _PyLong_AsInt(arg);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = signal_raise_signal_impl(module, signalnum);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(signal_signal__doc__,
+"signal($module, signalnum, handler, /)\n"
+"--\n"
+"\n"
+"Set the action for the given signal.\n"
+"\n"
+"The action can be SIG_DFL, SIG_IGN, or a callable Python object.\n"
+"The previous action is returned. See getsignal() for possible return values.\n"
+"\n"
+"*** IMPORTANT NOTICE ***\n"
+"A signal handler function is called with two arguments:\n"
+"the first is the signal number, the second is the interrupted stack frame.");
+
+#define SIGNAL_SIGNAL_METHODDEF \
+ {"signal", _PyCFunction_CAST(signal_signal), METH_FASTCALL, signal_signal__doc__},
+
+static PyObject *
+signal_signal_impl(PyObject *module, int signalnum, PyObject *handler);
+
+static PyObject *
+signal_signal(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int signalnum;
+ PyObject *handler;
+
+ if (!_PyArg_CheckPositional("signal", nargs, 2, 2)) {
+ goto exit;
+ }
+ signalnum = _PyLong_AsInt(args[0]);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ handler = args[1];
+ return_value = signal_signal_impl(module, signalnum, handler);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(signal_getsignal__doc__,
+"getsignal($module, signalnum, /)\n"
+"--\n"
+"\n"
+"Return the current action for the given signal.\n"
+"\n"
+"The return value can be:\n"
+" SIG_IGN -- if the signal is being ignored\n"
+" SIG_DFL -- if the default action for the signal is in effect\n"
+" None -- if an unknown handler is in effect\n"
+" anything else -- the callable Python object used as a handler");
+
+#define SIGNAL_GETSIGNAL_METHODDEF \
+ {"getsignal", (PyCFunction)signal_getsignal, METH_O, signal_getsignal__doc__},
+
+static PyObject *
+signal_getsignal_impl(PyObject *module, int signalnum);
+
+static PyObject *
+signal_getsignal(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int signalnum;
+
+ signalnum = _PyLong_AsInt(arg);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = signal_getsignal_impl(module, signalnum);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(signal_strsignal__doc__,
+"strsignal($module, signalnum, /)\n"
+"--\n"
+"\n"
+"Return the system description of the given signal.\n"
+"\n"
+"Returns the description of signal *signalnum*, such as \"Interrupt\"\n"
+"for :const:`SIGINT`. Returns :const:`None` if *signalnum* has no\n"
+"description. Raises :exc:`ValueError` if *signalnum* is invalid.");
+
+#define SIGNAL_STRSIGNAL_METHODDEF \
+ {"strsignal", (PyCFunction)signal_strsignal, METH_O, signal_strsignal__doc__},
+
+static PyObject *
+signal_strsignal_impl(PyObject *module, int signalnum);
+
+static PyObject *
+signal_strsignal(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int signalnum;
+
+ signalnum = _PyLong_AsInt(arg);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = signal_strsignal_impl(module, signalnum);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_SIGINTERRUPT)
+
+PyDoc_STRVAR(signal_siginterrupt__doc__,
+"siginterrupt($module, signalnum, flag, /)\n"
+"--\n"
+"\n"
+"Change system call restart behaviour.\n"
+"\n"
+"If flag is False, system calls will be restarted when interrupted by\n"
+"signal sig, else system calls will be interrupted.");
+
+#define SIGNAL_SIGINTERRUPT_METHODDEF \
+ {"siginterrupt", _PyCFunction_CAST(signal_siginterrupt), METH_FASTCALL, signal_siginterrupt__doc__},
+
+static PyObject *
+signal_siginterrupt_impl(PyObject *module, int signalnum, int flag);
+
+static PyObject *
+signal_siginterrupt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int signalnum;
+ int flag;
+
+ if (!_PyArg_CheckPositional("siginterrupt", nargs, 2, 2)) {
+ goto exit;
+ }
+ signalnum = _PyLong_AsInt(args[0]);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ flag = _PyLong_AsInt(args[1]);
+ if (flag == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = signal_siginterrupt_impl(module, signalnum, flag);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SIGINTERRUPT) */
+
+#if defined(HAVE_SETITIMER)
+
+PyDoc_STRVAR(signal_setitimer__doc__,
+"setitimer($module, which, seconds, interval=0.0, /)\n"
+"--\n"
+"\n"
+"Sets given itimer (one of ITIMER_REAL, ITIMER_VIRTUAL or ITIMER_PROF).\n"
+"\n"
+"The timer will fire after value seconds and after that every interval seconds.\n"
+"The itimer can be cleared by setting seconds to zero.\n"
+"\n"
+"Returns old values as a tuple: (delay, interval).");
+
+#define SIGNAL_SETITIMER_METHODDEF \
+ {"setitimer", _PyCFunction_CAST(signal_setitimer), METH_FASTCALL, signal_setitimer__doc__},
+
+static PyObject *
+signal_setitimer_impl(PyObject *module, int which, PyObject *seconds,
+ PyObject *interval);
+
+static PyObject *
+signal_setitimer(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int which;
+ PyObject *seconds;
+ PyObject *interval = NULL;
+
+ if (!_PyArg_CheckPositional("setitimer", nargs, 2, 3)) {
+ goto exit;
+ }
+ which = _PyLong_AsInt(args[0]);
+ if (which == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ seconds = args[1];
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ interval = args[2];
+skip_optional:
+ return_value = signal_setitimer_impl(module, which, seconds, interval);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SETITIMER) */
+
+#if defined(HAVE_GETITIMER)
+
+PyDoc_STRVAR(signal_getitimer__doc__,
+"getitimer($module, which, /)\n"
+"--\n"
+"\n"
+"Returns current value of given itimer.");
+
+#define SIGNAL_GETITIMER_METHODDEF \
+ {"getitimer", (PyCFunction)signal_getitimer, METH_O, signal_getitimer__doc__},
+
+static PyObject *
+signal_getitimer_impl(PyObject *module, int which);
+
+static PyObject *
+signal_getitimer(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int which;
+
+ which = _PyLong_AsInt(arg);
+ if (which == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = signal_getitimer_impl(module, which);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETITIMER) */
+
+#if defined(HAVE_SIGSET_T) && defined(PYPTHREAD_SIGMASK)
+
+PyDoc_STRVAR(signal_pthread_sigmask__doc__,
+"pthread_sigmask($module, how, mask, /)\n"
+"--\n"
+"\n"
+"Fetch and/or change the signal mask of the calling thread.");
+
+#define SIGNAL_PTHREAD_SIGMASK_METHODDEF \
+ {"pthread_sigmask", _PyCFunction_CAST(signal_pthread_sigmask), METH_FASTCALL, signal_pthread_sigmask__doc__},
+
+static PyObject *
+signal_pthread_sigmask_impl(PyObject *module, int how, sigset_t mask);
+
+static PyObject *
+signal_pthread_sigmask(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int how;
+ sigset_t mask;
+
+ if (!_PyArg_CheckPositional("pthread_sigmask", nargs, 2, 2)) {
+ goto exit;
+ }
+ how = _PyLong_AsInt(args[0]);
+ if (how == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!_Py_Sigset_Converter(args[1], &mask)) {
+ goto exit;
+ }
+ return_value = signal_pthread_sigmask_impl(module, how, mask);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SIGSET_T) && defined(PYPTHREAD_SIGMASK) */
+
+#if defined(HAVE_SIGSET_T) && defined(HAVE_SIGPENDING)
+
+PyDoc_STRVAR(signal_sigpending__doc__,
+"sigpending($module, /)\n"
+"--\n"
+"\n"
+"Examine pending signals.\n"
+"\n"
+"Returns a set of signal numbers that are pending for delivery to\n"
+"the calling thread.");
+
+#define SIGNAL_SIGPENDING_METHODDEF \
+ {"sigpending", (PyCFunction)signal_sigpending, METH_NOARGS, signal_sigpending__doc__},
+
+static PyObject *
+signal_sigpending_impl(PyObject *module);
+
+static PyObject *
+signal_sigpending(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return signal_sigpending_impl(module);
+}
+
+#endif /* defined(HAVE_SIGSET_T) && defined(HAVE_SIGPENDING) */
+
+#if defined(HAVE_SIGSET_T) && defined(HAVE_SIGWAIT)
+
+PyDoc_STRVAR(signal_sigwait__doc__,
+"sigwait($module, sigset, /)\n"
+"--\n"
+"\n"
+"Wait for a signal.\n"
+"\n"
+"Suspend execution of the calling thread until the delivery of one of the\n"
+"signals specified in the signal set sigset. The function accepts the signal\n"
+"and returns the signal number.");
+
+#define SIGNAL_SIGWAIT_METHODDEF \
+ {"sigwait", (PyCFunction)signal_sigwait, METH_O, signal_sigwait__doc__},
+
+static PyObject *
+signal_sigwait_impl(PyObject *module, sigset_t sigset);
+
+static PyObject *
+signal_sigwait(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ sigset_t sigset;
+
+ if (!_Py_Sigset_Converter(arg, &sigset)) {
+ goto exit;
+ }
+ return_value = signal_sigwait_impl(module, sigset);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SIGSET_T) && defined(HAVE_SIGWAIT) */
+
+#if ((defined(HAVE_SIGFILLSET) && defined(HAVE_SIGSET_T)) || defined(MS_WINDOWS))
+
+PyDoc_STRVAR(signal_valid_signals__doc__,
+"valid_signals($module, /)\n"
+"--\n"
+"\n"
+"Return a set of valid signal numbers on this platform.\n"
+"\n"
+"The signal numbers returned by this function can be safely passed to\n"
+"functions like `pthread_sigmask`.");
+
+#define SIGNAL_VALID_SIGNALS_METHODDEF \
+ {"valid_signals", (PyCFunction)signal_valid_signals, METH_NOARGS, signal_valid_signals__doc__},
+
+static PyObject *
+signal_valid_signals_impl(PyObject *module);
+
+static PyObject *
+signal_valid_signals(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return signal_valid_signals_impl(module);
+}
+
+#endif /* ((defined(HAVE_SIGFILLSET) && defined(HAVE_SIGSET_T)) || defined(MS_WINDOWS)) */
+
+#if defined(HAVE_SIGSET_T) && defined(HAVE_SIGWAITINFO)
+
+PyDoc_STRVAR(signal_sigwaitinfo__doc__,
+"sigwaitinfo($module, sigset, /)\n"
+"--\n"
+"\n"
+"Wait synchronously until one of the signals in *sigset* is delivered.\n"
+"\n"
+"Returns a struct_siginfo containing information about the signal.");
+
+#define SIGNAL_SIGWAITINFO_METHODDEF \
+ {"sigwaitinfo", (PyCFunction)signal_sigwaitinfo, METH_O, signal_sigwaitinfo__doc__},
+
+static PyObject *
+signal_sigwaitinfo_impl(PyObject *module, sigset_t sigset);
+
+static PyObject *
+signal_sigwaitinfo(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ sigset_t sigset;
+
+ if (!_Py_Sigset_Converter(arg, &sigset)) {
+ goto exit;
+ }
+ return_value = signal_sigwaitinfo_impl(module, sigset);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SIGSET_T) && defined(HAVE_SIGWAITINFO) */
+
+#if defined(HAVE_SIGSET_T) && defined(HAVE_SIGTIMEDWAIT)
+
+PyDoc_STRVAR(signal_sigtimedwait__doc__,
+"sigtimedwait($module, sigset, timeout, /)\n"
+"--\n"
+"\n"
+"Like sigwaitinfo(), but with a timeout.\n"
+"\n"
+"The timeout is specified in seconds, with floating point numbers allowed.");
+
+#define SIGNAL_SIGTIMEDWAIT_METHODDEF \
+ {"sigtimedwait", _PyCFunction_CAST(signal_sigtimedwait), METH_FASTCALL, signal_sigtimedwait__doc__},
+
+static PyObject *
+signal_sigtimedwait_impl(PyObject *module, sigset_t sigset,
+ PyObject *timeout_obj);
+
+static PyObject *
+signal_sigtimedwait(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ sigset_t sigset;
+ PyObject *timeout_obj;
+
+ if (!_PyArg_CheckPositional("sigtimedwait", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_Py_Sigset_Converter(args[0], &sigset)) {
+ goto exit;
+ }
+ timeout_obj = args[1];
+ return_value = signal_sigtimedwait_impl(module, sigset, timeout_obj);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_SIGSET_T) && defined(HAVE_SIGTIMEDWAIT) */
+
+#if defined(HAVE_PTHREAD_KILL)
+
+PyDoc_STRVAR(signal_pthread_kill__doc__,
+"pthread_kill($module, thread_id, signalnum, /)\n"
+"--\n"
+"\n"
+"Send a signal to a thread.");
+
+#define SIGNAL_PTHREAD_KILL_METHODDEF \
+ {"pthread_kill", _PyCFunction_CAST(signal_pthread_kill), METH_FASTCALL, signal_pthread_kill__doc__},
+
+static PyObject *
+signal_pthread_kill_impl(PyObject *module, unsigned long thread_id,
+ int signalnum);
+
+static PyObject *
+signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ unsigned long thread_id;
+ int signalnum;
+
+ if (!_PyArg_CheckPositional("pthread_kill", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyLong_Check(args[0])) {
+ _PyArg_BadArgument("pthread_kill", "argument 1", "int", args[0]);
+ goto exit;
+ }
+ thread_id = PyLong_AsUnsignedLongMask(args[0]);
+ signalnum = _PyLong_AsInt(args[1]);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = signal_pthread_kill_impl(module, thread_id, signalnum);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_PTHREAD_KILL) */
+
+#if (defined(__linux__) && defined(__NR_pidfd_send_signal))
+
+PyDoc_STRVAR(signal_pidfd_send_signal__doc__,
+"pidfd_send_signal($module, pidfd, signalnum, siginfo=None, flags=0, /)\n"
+"--\n"
+"\n"
+"Send a signal to a process referred to by a pid file descriptor.");
+
+#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF \
+ {"pidfd_send_signal", _PyCFunction_CAST(signal_pidfd_send_signal), METH_FASTCALL, signal_pidfd_send_signal__doc__},
+
+static PyObject *
+signal_pidfd_send_signal_impl(PyObject *module, int pidfd, int signalnum,
+ PyObject *siginfo, int flags);
+
+static PyObject *
+signal_pidfd_send_signal(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int pidfd;
+ int signalnum;
+ PyObject *siginfo = Py_None;
+ int flags = 0;
+
+ if (!_PyArg_CheckPositional("pidfd_send_signal", nargs, 2, 4)) {
+ goto exit;
+ }
+ pidfd = _PyLong_AsInt(args[0]);
+ if (pidfd == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ signalnum = _PyLong_AsInt(args[1]);
+ if (signalnum == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (nargs < 3) {
+ goto skip_optional;
+ }
+ siginfo = args[2];
+ if (nargs < 4) {
+ goto skip_optional;
+ }
+ flags = _PyLong_AsInt(args[3]);
+ if (flags == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = signal_pidfd_send_signal_impl(module, pidfd, signalnum, siginfo, flags);
+
+exit:
+ return return_value;
+}
+
+#endif /* (defined(__linux__) && defined(__NR_pidfd_send_signal)) */
+
+#ifndef SIGNAL_ALARM_METHODDEF
+ #define SIGNAL_ALARM_METHODDEF
+#endif /* !defined(SIGNAL_ALARM_METHODDEF) */
+
+#ifndef SIGNAL_PAUSE_METHODDEF
+ #define SIGNAL_PAUSE_METHODDEF
+#endif /* !defined(SIGNAL_PAUSE_METHODDEF) */
+
+#ifndef SIGNAL_SIGINTERRUPT_METHODDEF
+ #define SIGNAL_SIGINTERRUPT_METHODDEF
+#endif /* !defined(SIGNAL_SIGINTERRUPT_METHODDEF) */
+
+#ifndef SIGNAL_SETITIMER_METHODDEF
+ #define SIGNAL_SETITIMER_METHODDEF
+#endif /* !defined(SIGNAL_SETITIMER_METHODDEF) */
+
+#ifndef SIGNAL_GETITIMER_METHODDEF
+ #define SIGNAL_GETITIMER_METHODDEF
+#endif /* !defined(SIGNAL_GETITIMER_METHODDEF) */
+
+#ifndef SIGNAL_PTHREAD_SIGMASK_METHODDEF
+ #define SIGNAL_PTHREAD_SIGMASK_METHODDEF
+#endif /* !defined(SIGNAL_PTHREAD_SIGMASK_METHODDEF) */
+
+#ifndef SIGNAL_SIGPENDING_METHODDEF
+ #define SIGNAL_SIGPENDING_METHODDEF
+#endif /* !defined(SIGNAL_SIGPENDING_METHODDEF) */
+
+#ifndef SIGNAL_SIGWAIT_METHODDEF
+ #define SIGNAL_SIGWAIT_METHODDEF
+#endif /* !defined(SIGNAL_SIGWAIT_METHODDEF) */
+
+#ifndef SIGNAL_VALID_SIGNALS_METHODDEF
+ #define SIGNAL_VALID_SIGNALS_METHODDEF
+#endif /* !defined(SIGNAL_VALID_SIGNALS_METHODDEF) */
+
+#ifndef SIGNAL_SIGWAITINFO_METHODDEF
+ #define SIGNAL_SIGWAITINFO_METHODDEF
+#endif /* !defined(SIGNAL_SIGWAITINFO_METHODDEF) */
+
+#ifndef SIGNAL_SIGTIMEDWAIT_METHODDEF
+ #define SIGNAL_SIGTIMEDWAIT_METHODDEF
+#endif /* !defined(SIGNAL_SIGTIMEDWAIT_METHODDEF) */
+
+#ifndef SIGNAL_PTHREAD_KILL_METHODDEF
+ #define SIGNAL_PTHREAD_KILL_METHODDEF
+#endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */
+
+#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
+ #define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
+#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
+/*[clinic end generated code: output=2b54dc607f6e3146 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/socketmodule.c.h b/contrib/tools/python3/Modules/clinic/socketmodule.c.h
new file mode 100644
index 00000000000..8ff1044d013
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/socketmodule.c.h
@@ -0,0 +1,94 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+static int
+sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
+ PyObject *fdobj);
+
+static int
+sock_initobj(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 4
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(family), &_Py_ID(type), &_Py_ID(proto), &_Py_ID(fileno), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"family", "type", "proto", "fileno", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "socket",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[4];
+ PyObject * const *fastargs;
+ Py_ssize_t nargs = PyTuple_GET_SIZE(args);
+ Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
+ int family = -1;
+ int type = -1;
+ int proto = -1;
+ PyObject *fdobj = NULL;
+
+ fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 4, 0, argsbuf);
+ if (!fastargs) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (fastargs[0]) {
+ family = _PyLong_AsInt(fastargs[0]);
+ if (family == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[1]) {
+ type = _PyLong_AsInt(fastargs[1]);
+ if (type == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (fastargs[2]) {
+ proto = _PyLong_AsInt(fastargs[2]);
+ if (proto == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ fdobj = fastargs[3];
+skip_optional_pos:
+ return_value = sock_initobj_impl((PySocketSockObject *)self, family, type, proto, fdobj);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=987155ac4b48a198 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/spwdmodule.c.h b/contrib/tools/python3/Modules/clinic/spwdmodule.c.h
new file mode 100644
index 00000000000..f47aa9a77f3
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/spwdmodule.c.h
@@ -0,0 +1,80 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+#if defined(HAVE_GETSPNAM)
+
+PyDoc_STRVAR(spwd_getspnam__doc__,
+"getspnam($module, arg, /)\n"
+"--\n"
+"\n"
+"Return the shadow password database entry for the given user name.\n"
+"\n"
+"See `help(spwd)` for more on shadow password database entries.");
+
+#define SPWD_GETSPNAM_METHODDEF \
+ {"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
+
+static PyObject *
+spwd_getspnam_impl(PyObject *module, PyObject *arg);
+
+static PyObject *
+spwd_getspnam(PyObject *module, PyObject *arg_)
+{
+ PyObject *return_value = NULL;
+ PyObject *arg;
+
+ if (!PyUnicode_Check(arg_)) {
+ _PyArg_BadArgument("getspnam", "argument", "str", arg_);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg_) == -1) {
+ goto exit;
+ }
+ arg = arg_;
+ return_value = spwd_getspnam_impl(module, arg);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_GETSPNAM) */
+
+#if defined(HAVE_GETSPENT)
+
+PyDoc_STRVAR(spwd_getspall__doc__,
+"getspall($module, /)\n"
+"--\n"
+"\n"
+"Return a list of all available shadow password database entries, in arbitrary order.\n"
+"\n"
+"See `help(spwd)` for more on shadow password database entries.");
+
+#define SPWD_GETSPALL_METHODDEF \
+ {"getspall", (PyCFunction)spwd_getspall, METH_NOARGS, spwd_getspall__doc__},
+
+static PyObject *
+spwd_getspall_impl(PyObject *module);
+
+static PyObject *
+spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return spwd_getspall_impl(module);
+}
+
+#endif /* defined(HAVE_GETSPENT) */
+
+#ifndef SPWD_GETSPNAM_METHODDEF
+ #define SPWD_GETSPNAM_METHODDEF
+#endif /* !defined(SPWD_GETSPNAM_METHODDEF) */
+
+#ifndef SPWD_GETSPALL_METHODDEF
+ #define SPWD_GETSPALL_METHODDEF
+#endif /* !defined(SPWD_GETSPALL_METHODDEF) */
+/*[clinic end generated code: output=dd61827a7b708e11 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/symtablemodule.c.h b/contrib/tools/python3/Modules/clinic/symtablemodule.c.h
new file mode 100644
index 00000000000..04fdb9f2d9b
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/symtablemodule.c.h
@@ -0,0 +1,57 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(_symtable_symtable__doc__,
+"symtable($module, source, filename, startstr, /)\n"
+"--\n"
+"\n"
+"Return symbol and scope dictionaries used internally by compiler.");
+
+#define _SYMTABLE_SYMTABLE_METHODDEF \
+ {"symtable", _PyCFunction_CAST(_symtable_symtable), METH_FASTCALL, _symtable_symtable__doc__},
+
+static PyObject *
+_symtable_symtable_impl(PyObject *module, PyObject *source,
+ PyObject *filename, const char *startstr);
+
+static PyObject *
+_symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *source;
+ PyObject *filename;
+ const char *startstr;
+
+ if (!_PyArg_CheckPositional("symtable", nargs, 3, 3)) {
+ goto exit;
+ }
+ source = args[0];
+ if (!PyUnicode_FSDecoder(args[1], &filename)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[2])) {
+ _PyArg_BadArgument("symtable", "argument 3", "str", args[2]);
+ goto exit;
+ }
+ Py_ssize_t startstr_length;
+ startstr = PyUnicode_AsUTF8AndSize(args[2], &startstr_length);
+ if (startstr == NULL) {
+ goto exit;
+ }
+ if (strlen(startstr) != (size_t)startstr_length) {
+ PyErr_SetString(PyExc_ValueError, "embedded null character");
+ goto exit;
+ }
+ return_value = _symtable_symtable_impl(module, source, filename, startstr);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=07716ddbd6c7efe1 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/syslogmodule.c.h b/contrib/tools/python3/Modules/clinic/syslogmodule.c.h
new file mode 100644
index 00000000000..0ce66ad4e1a
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/syslogmodule.c.h
@@ -0,0 +1,257 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(syslog_openlog__doc__,
+"openlog($module, /, ident=<unrepresentable>, logoption=0,\n"
+" facility=LOG_USER)\n"
+"--\n"
+"\n"
+"Set logging options of subsequent syslog() calls.");
+
+#define SYSLOG_OPENLOG_METHODDEF \
+ {"openlog", _PyCFunction_CAST(syslog_openlog), METH_FASTCALL|METH_KEYWORDS, syslog_openlog__doc__},
+
+static PyObject *
+syslog_openlog_impl(PyObject *module, PyObject *ident, long logopt,
+ long facility);
+
+static PyObject *
+syslog_openlog(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 3
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(ident), &_Py_ID(logoption), &_Py_ID(facility), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"ident", "logoption", "facility", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "openlog",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyObject *ident = NULL;
+ long logopt = 0;
+ long facility = LOG_USER;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("openlog", "argument 'ident'", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ ident = args[0];
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[1]) {
+ logopt = PyLong_AsLong(args[1]);
+ if (logopt == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ facility = PyLong_AsLong(args[2]);
+ if (facility == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = syslog_openlog_impl(module, ident, logopt, facility);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(syslog_syslog__doc__,
+"syslog([priority=LOG_INFO,] message)\n"
+"Send the string message to the system logger.");
+
+#define SYSLOG_SYSLOG_METHODDEF \
+ {"syslog", (PyCFunction)syslog_syslog, METH_VARARGS, syslog_syslog__doc__},
+
+static PyObject *
+syslog_syslog_impl(PyObject *module, int group_left_1, int priority,
+ const char *message);
+
+static PyObject *
+syslog_syslog(PyObject *module, PyObject *args)
+{
+ PyObject *return_value = NULL;
+ int group_left_1 = 0;
+ int priority = LOG_INFO;
+ const char *message;
+
+ switch (PyTuple_GET_SIZE(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "s:syslog", &message)) {
+ goto exit;
+ }
+ break;
+ case 2:
+ if (!PyArg_ParseTuple(args, "is:syslog", &priority, &message)) {
+ goto exit;
+ }
+ group_left_1 = 1;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "syslog.syslog requires 1 to 2 arguments");
+ goto exit;
+ }
+ return_value = syslog_syslog_impl(module, group_left_1, priority, message);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(syslog_closelog__doc__,
+"closelog($module, /)\n"
+"--\n"
+"\n"
+"Reset the syslog module values and call the system library closelog().");
+
+#define SYSLOG_CLOSELOG_METHODDEF \
+ {"closelog", (PyCFunction)syslog_closelog, METH_NOARGS, syslog_closelog__doc__},
+
+static PyObject *
+syslog_closelog_impl(PyObject *module);
+
+static PyObject *
+syslog_closelog(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return syslog_closelog_impl(module);
+}
+
+PyDoc_STRVAR(syslog_setlogmask__doc__,
+"setlogmask($module, maskpri, /)\n"
+"--\n"
+"\n"
+"Set the priority mask to maskpri and return the previous mask value.");
+
+#define SYSLOG_SETLOGMASK_METHODDEF \
+ {"setlogmask", (PyCFunction)syslog_setlogmask, METH_O, syslog_setlogmask__doc__},
+
+static long
+syslog_setlogmask_impl(PyObject *module, long maskpri);
+
+static PyObject *
+syslog_setlogmask(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ long maskpri;
+ long _return_value;
+
+ maskpri = PyLong_AsLong(arg);
+ if (maskpri == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = syslog_setlogmask_impl(module, maskpri);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(syslog_LOG_MASK__doc__,
+"LOG_MASK($module, pri, /)\n"
+"--\n"
+"\n"
+"Calculates the mask for the individual priority pri.");
+
+#define SYSLOG_LOG_MASK_METHODDEF \
+ {"LOG_MASK", (PyCFunction)syslog_LOG_MASK, METH_O, syslog_LOG_MASK__doc__},
+
+static long
+syslog_LOG_MASK_impl(PyObject *module, long pri);
+
+static PyObject *
+syslog_LOG_MASK(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ long pri;
+ long _return_value;
+
+ pri = PyLong_AsLong(arg);
+ if (pri == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = syslog_LOG_MASK_impl(module, pri);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(syslog_LOG_UPTO__doc__,
+"LOG_UPTO($module, pri, /)\n"
+"--\n"
+"\n"
+"Calculates the mask for all priorities up to and including pri.");
+
+#define SYSLOG_LOG_UPTO_METHODDEF \
+ {"LOG_UPTO", (PyCFunction)syslog_LOG_UPTO, METH_O, syslog_LOG_UPTO__doc__},
+
+static long
+syslog_LOG_UPTO_impl(PyObject *module, long pri);
+
+static PyObject *
+syslog_LOG_UPTO(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ long pri;
+ long _return_value;
+
+ pri = PyLong_AsLong(arg);
+ if (pri == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ _return_value = syslog_LOG_UPTO_impl(module, pri);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong(_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=3b1bdb16565b8fda input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/termios.c.h b/contrib/tools/python3/Modules/clinic/termios.c.h
new file mode 100644
index 00000000000..78863e53c42
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/termios.c.h
@@ -0,0 +1,295 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(termios_tcgetattr__doc__,
+"tcgetattr($module, fd, /)\n"
+"--\n"
+"\n"
+"Get the tty attributes for file descriptor fd.\n"
+"\n"
+"Returns a list [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]\n"
+"where cc is a list of the tty special characters (each a string of\n"
+"length 1, except the items with indices VMIN and VTIME, which are\n"
+"integers when these fields are defined). The interpretation of the\n"
+"flags and the speeds as well as the indexing in the cc array must be\n"
+"done using the symbolic constants defined in this module.");
+
+#define TERMIOS_TCGETATTR_METHODDEF \
+ {"tcgetattr", (PyCFunction)termios_tcgetattr, METH_O, termios_tcgetattr__doc__},
+
+static PyObject *
+termios_tcgetattr_impl(PyObject *module, int fd);
+
+static PyObject *
+termios_tcgetattr(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = termios_tcgetattr_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcsetattr__doc__,
+"tcsetattr($module, fd, when, attributes, /)\n"
+"--\n"
+"\n"
+"Set the tty attributes for file descriptor fd.\n"
+"\n"
+"The attributes to be set are taken from the attributes argument, which\n"
+"is a list like the one returned by tcgetattr(). The when argument\n"
+"determines when the attributes are changed: termios.TCSANOW to\n"
+"change immediately, termios.TCSADRAIN to change after transmitting all\n"
+"queued output, or termios.TCSAFLUSH to change after transmitting all\n"
+"queued output and discarding all queued input.");
+
+#define TERMIOS_TCSETATTR_METHODDEF \
+ {"tcsetattr", _PyCFunction_CAST(termios_tcsetattr), METH_FASTCALL, termios_tcsetattr__doc__},
+
+static PyObject *
+termios_tcsetattr_impl(PyObject *module, int fd, int when, PyObject *term);
+
+static PyObject *
+termios_tcsetattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int when;
+ PyObject *term;
+
+ if (!_PyArg_CheckPositional("tcsetattr", nargs, 3, 3)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ when = _PyLong_AsInt(args[1]);
+ if (when == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ term = args[2];
+ return_value = termios_tcsetattr_impl(module, fd, when, term);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcsendbreak__doc__,
+"tcsendbreak($module, fd, duration, /)\n"
+"--\n"
+"\n"
+"Send a break on file descriptor fd.\n"
+"\n"
+"A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration\n"
+"has a system dependent meaning.");
+
+#define TERMIOS_TCSENDBREAK_METHODDEF \
+ {"tcsendbreak", _PyCFunction_CAST(termios_tcsendbreak), METH_FASTCALL, termios_tcsendbreak__doc__},
+
+static PyObject *
+termios_tcsendbreak_impl(PyObject *module, int fd, int duration);
+
+static PyObject *
+termios_tcsendbreak(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int duration;
+
+ if (!_PyArg_CheckPositional("tcsendbreak", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ duration = _PyLong_AsInt(args[1]);
+ if (duration == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = termios_tcsendbreak_impl(module, fd, duration);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcdrain__doc__,
+"tcdrain($module, fd, /)\n"
+"--\n"
+"\n"
+"Wait until all output written to file descriptor fd has been transmitted.");
+
+#define TERMIOS_TCDRAIN_METHODDEF \
+ {"tcdrain", (PyCFunction)termios_tcdrain, METH_O, termios_tcdrain__doc__},
+
+static PyObject *
+termios_tcdrain_impl(PyObject *module, int fd);
+
+static PyObject *
+termios_tcdrain(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = termios_tcdrain_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcflush__doc__,
+"tcflush($module, fd, queue, /)\n"
+"--\n"
+"\n"
+"Discard queued data on file descriptor fd.\n"
+"\n"
+"The queue selector specifies which queue: termios.TCIFLUSH for the input\n"
+"queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for\n"
+"both queues.");
+
+#define TERMIOS_TCFLUSH_METHODDEF \
+ {"tcflush", _PyCFunction_CAST(termios_tcflush), METH_FASTCALL, termios_tcflush__doc__},
+
+static PyObject *
+termios_tcflush_impl(PyObject *module, int fd, int queue);
+
+static PyObject *
+termios_tcflush(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int queue;
+
+ if (!_PyArg_CheckPositional("tcflush", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ queue = _PyLong_AsInt(args[1]);
+ if (queue == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = termios_tcflush_impl(module, fd, queue);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcflow__doc__,
+"tcflow($module, fd, action, /)\n"
+"--\n"
+"\n"
+"Suspend or resume input or output on file descriptor fd.\n"
+"\n"
+"The action argument can be termios.TCOOFF to suspend output,\n"
+"termios.TCOON to restart output, termios.TCIOFF to suspend input,\n"
+"or termios.TCION to restart input.");
+
+#define TERMIOS_TCFLOW_METHODDEF \
+ {"tcflow", _PyCFunction_CAST(termios_tcflow), METH_FASTCALL, termios_tcflow__doc__},
+
+static PyObject *
+termios_tcflow_impl(PyObject *module, int fd, int action);
+
+static PyObject *
+termios_tcflow(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ int action;
+
+ if (!_PyArg_CheckPositional("tcflow", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ action = _PyLong_AsInt(args[1]);
+ if (action == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = termios_tcflow_impl(module, fd, action);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcgetwinsize__doc__,
+"tcgetwinsize($module, fd, /)\n"
+"--\n"
+"\n"
+"Get the tty winsize for file descriptor fd.\n"
+"\n"
+"Returns a tuple (ws_row, ws_col).");
+
+#define TERMIOS_TCGETWINSIZE_METHODDEF \
+ {"tcgetwinsize", (PyCFunction)termios_tcgetwinsize, METH_O, termios_tcgetwinsize__doc__},
+
+static PyObject *
+termios_tcgetwinsize_impl(PyObject *module, int fd);
+
+static PyObject *
+termios_tcgetwinsize(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int fd;
+
+ if (!_PyLong_FileDescriptor_Converter(arg, &fd)) {
+ goto exit;
+ }
+ return_value = termios_tcgetwinsize_impl(module, fd);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(termios_tcsetwinsize__doc__,
+"tcsetwinsize($module, fd, winsize, /)\n"
+"--\n"
+"\n"
+"Set the tty winsize for file descriptor fd.\n"
+"\n"
+"The winsize to be set is taken from the winsize argument, which\n"
+"is a two-item tuple (ws_row, ws_col) like the one returned by tcgetwinsize().");
+
+#define TERMIOS_TCSETWINSIZE_METHODDEF \
+ {"tcsetwinsize", _PyCFunction_CAST(termios_tcsetwinsize), METH_FASTCALL, termios_tcsetwinsize__doc__},
+
+static PyObject *
+termios_tcsetwinsize_impl(PyObject *module, int fd, PyObject *winsz);
+
+static PyObject *
+termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int fd;
+ PyObject *winsz;
+
+ if (!_PyArg_CheckPositional("tcsetwinsize", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!_PyLong_FileDescriptor_Converter(args[0], &fd)) {
+ goto exit;
+ }
+ winsz = args[1];
+ return_value = termios_tcsetwinsize_impl(module, fd, winsz);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=d286a3906a051869 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/unicodedata.c.h b/contrib/tools/python3/Modules/clinic/unicodedata.c.h
new file mode 100644
index 00000000000..6102027d07a
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/unicodedata.c.h
@@ -0,0 +1,568 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
+"decimal($self, chr, default=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Converts a Unicode character into its equivalent decimal value.\n"
+"\n"
+"Returns the decimal value assigned to the character chr as integer.\n"
+"If no such value is defined, default is returned, or, if not given,\n"
+"ValueError is raised.");
+
+#define UNICODEDATA_UCD_DECIMAL_METHODDEF \
+ {"decimal", _PyCFunction_CAST(unicodedata_UCD_decimal), METH_FASTCALL, unicodedata_UCD_decimal__doc__},
+
+static PyObject *
+unicodedata_UCD_decimal_impl(PyObject *self, int chr,
+ PyObject *default_value);
+
+static PyObject *
+unicodedata_UCD_decimal(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int chr;
+ PyObject *default_value = NULL;
+
+ if (!_PyArg_CheckPositional("decimal", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("decimal", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0])) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(args[0]) != 1) {
+ _PyArg_BadArgument("decimal", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(args[0], 0);
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ default_value = args[1];
+skip_optional:
+ return_value = unicodedata_UCD_decimal_impl(self, chr, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_digit__doc__,
+"digit($self, chr, default=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Converts a Unicode character into its equivalent digit value.\n"
+"\n"
+"Returns the digit value assigned to the character chr as integer.\n"
+"If no such value is defined, default is returned, or, if not given,\n"
+"ValueError is raised.");
+
+#define UNICODEDATA_UCD_DIGIT_METHODDEF \
+ {"digit", _PyCFunction_CAST(unicodedata_UCD_digit), METH_FASTCALL, unicodedata_UCD_digit__doc__},
+
+static PyObject *
+unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value);
+
+static PyObject *
+unicodedata_UCD_digit(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int chr;
+ PyObject *default_value = NULL;
+
+ if (!_PyArg_CheckPositional("digit", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("digit", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0])) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(args[0]) != 1) {
+ _PyArg_BadArgument("digit", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(args[0], 0);
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ default_value = args[1];
+skip_optional:
+ return_value = unicodedata_UCD_digit_impl(self, chr, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_numeric__doc__,
+"numeric($self, chr, default=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Converts a Unicode character into its equivalent numeric value.\n"
+"\n"
+"Returns the numeric value assigned to the character chr as float.\n"
+"If no such value is defined, default is returned, or, if not given,\n"
+"ValueError is raised.");
+
+#define UNICODEDATA_UCD_NUMERIC_METHODDEF \
+ {"numeric", _PyCFunction_CAST(unicodedata_UCD_numeric), METH_FASTCALL, unicodedata_UCD_numeric__doc__},
+
+static PyObject *
+unicodedata_UCD_numeric_impl(PyObject *self, int chr,
+ PyObject *default_value);
+
+static PyObject *
+unicodedata_UCD_numeric(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int chr;
+ PyObject *default_value = NULL;
+
+ if (!_PyArg_CheckPositional("numeric", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("numeric", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0])) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(args[0]) != 1) {
+ _PyArg_BadArgument("numeric", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(args[0], 0);
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ default_value = args[1];
+skip_optional:
+ return_value = unicodedata_UCD_numeric_impl(self, chr, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_category__doc__,
+"category($self, chr, /)\n"
+"--\n"
+"\n"
+"Returns the general category assigned to the character chr as string.");
+
+#define UNICODEDATA_UCD_CATEGORY_METHODDEF \
+ {"category", (PyCFunction)unicodedata_UCD_category, METH_O, unicodedata_UCD_category__doc__},
+
+static PyObject *
+unicodedata_UCD_category_impl(PyObject *self, int chr);
+
+static PyObject *
+unicodedata_UCD_category(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int chr;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("category", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg)) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(arg) != 1) {
+ _PyArg_BadArgument("category", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(arg, 0);
+ return_value = unicodedata_UCD_category_impl(self, chr);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_bidirectional__doc__,
+"bidirectional($self, chr, /)\n"
+"--\n"
+"\n"
+"Returns the bidirectional class assigned to the character chr as string.\n"
+"\n"
+"If no such value is defined, an empty string is returned.");
+
+#define UNICODEDATA_UCD_BIDIRECTIONAL_METHODDEF \
+ {"bidirectional", (PyCFunction)unicodedata_UCD_bidirectional, METH_O, unicodedata_UCD_bidirectional__doc__},
+
+static PyObject *
+unicodedata_UCD_bidirectional_impl(PyObject *self, int chr);
+
+static PyObject *
+unicodedata_UCD_bidirectional(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int chr;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("bidirectional", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg)) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(arg) != 1) {
+ _PyArg_BadArgument("bidirectional", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(arg, 0);
+ return_value = unicodedata_UCD_bidirectional_impl(self, chr);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_combining__doc__,
+"combining($self, chr, /)\n"
+"--\n"
+"\n"
+"Returns the canonical combining class assigned to the character chr as integer.\n"
+"\n"
+"Returns 0 if no combining class is defined.");
+
+#define UNICODEDATA_UCD_COMBINING_METHODDEF \
+ {"combining", (PyCFunction)unicodedata_UCD_combining, METH_O, unicodedata_UCD_combining__doc__},
+
+static int
+unicodedata_UCD_combining_impl(PyObject *self, int chr);
+
+static PyObject *
+unicodedata_UCD_combining(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int chr;
+ int _return_value;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("combining", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg)) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(arg) != 1) {
+ _PyArg_BadArgument("combining", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(arg, 0);
+ _return_value = unicodedata_UCD_combining_impl(self, chr);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_mirrored__doc__,
+"mirrored($self, chr, /)\n"
+"--\n"
+"\n"
+"Returns the mirrored property assigned to the character chr as integer.\n"
+"\n"
+"Returns 1 if the character has been identified as a \"mirrored\"\n"
+"character in bidirectional text, 0 otherwise.");
+
+#define UNICODEDATA_UCD_MIRRORED_METHODDEF \
+ {"mirrored", (PyCFunction)unicodedata_UCD_mirrored, METH_O, unicodedata_UCD_mirrored__doc__},
+
+static int
+unicodedata_UCD_mirrored_impl(PyObject *self, int chr);
+
+static PyObject *
+unicodedata_UCD_mirrored(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int chr;
+ int _return_value;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("mirrored", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg)) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(arg) != 1) {
+ _PyArg_BadArgument("mirrored", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(arg, 0);
+ _return_value = unicodedata_UCD_mirrored_impl(self, chr);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_east_asian_width__doc__,
+"east_asian_width($self, chr, /)\n"
+"--\n"
+"\n"
+"Returns the east asian width assigned to the character chr as string.");
+
+#define UNICODEDATA_UCD_EAST_ASIAN_WIDTH_METHODDEF \
+ {"east_asian_width", (PyCFunction)unicodedata_UCD_east_asian_width, METH_O, unicodedata_UCD_east_asian_width__doc__},
+
+static PyObject *
+unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr);
+
+static PyObject *
+unicodedata_UCD_east_asian_width(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int chr;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("east_asian_width", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg)) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(arg) != 1) {
+ _PyArg_BadArgument("east_asian_width", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(arg, 0);
+ return_value = unicodedata_UCD_east_asian_width_impl(self, chr);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_decomposition__doc__,
+"decomposition($self, chr, /)\n"
+"--\n"
+"\n"
+"Returns the character decomposition mapping assigned to the character chr as string.\n"
+"\n"
+"An empty string is returned in case no such mapping is defined.");
+
+#define UNICODEDATA_UCD_DECOMPOSITION_METHODDEF \
+ {"decomposition", (PyCFunction)unicodedata_UCD_decomposition, METH_O, unicodedata_UCD_decomposition__doc__},
+
+static PyObject *
+unicodedata_UCD_decomposition_impl(PyObject *self, int chr);
+
+static PyObject *
+unicodedata_UCD_decomposition(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int chr;
+
+ if (!PyUnicode_Check(arg)) {
+ _PyArg_BadArgument("decomposition", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ if (PyUnicode_READY(arg)) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(arg) != 1) {
+ _PyArg_BadArgument("decomposition", "argument", "a unicode character", arg);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(arg, 0);
+ return_value = unicodedata_UCD_decomposition_impl(self, chr);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_is_normalized__doc__,
+"is_normalized($self, form, unistr, /)\n"
+"--\n"
+"\n"
+"Return whether the Unicode string unistr is in the normal form \'form\'.\n"
+"\n"
+"Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'.");
+
+#define UNICODEDATA_UCD_IS_NORMALIZED_METHODDEF \
+ {"is_normalized", _PyCFunction_CAST(unicodedata_UCD_is_normalized), METH_FASTCALL, unicodedata_UCD_is_normalized__doc__},
+
+static PyObject *
+unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form,
+ PyObject *input);
+
+static PyObject *
+unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *form;
+ PyObject *input;
+
+ if (!_PyArg_CheckPositional("is_normalized", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("is_normalized", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ form = args[0];
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("is_normalized", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[1]) == -1) {
+ goto exit;
+ }
+ input = args[1];
+ return_value = unicodedata_UCD_is_normalized_impl(self, form, input);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_normalize__doc__,
+"normalize($self, form, unistr, /)\n"
+"--\n"
+"\n"
+"Return the normal form \'form\' for the Unicode string unistr.\n"
+"\n"
+"Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'.");
+
+#define UNICODEDATA_UCD_NORMALIZE_METHODDEF \
+ {"normalize", _PyCFunction_CAST(unicodedata_UCD_normalize), METH_FASTCALL, unicodedata_UCD_normalize__doc__},
+
+static PyObject *
+unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form,
+ PyObject *input);
+
+static PyObject *
+unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *form;
+ PyObject *input;
+
+ if (!_PyArg_CheckPositional("normalize", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("normalize", "argument 1", "str", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0]) == -1) {
+ goto exit;
+ }
+ form = args[0];
+ if (!PyUnicode_Check(args[1])) {
+ _PyArg_BadArgument("normalize", "argument 2", "str", args[1]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[1]) == -1) {
+ goto exit;
+ }
+ input = args[1];
+ return_value = unicodedata_UCD_normalize_impl(self, form, input);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_name__doc__,
+"name($self, chr, default=<unrepresentable>, /)\n"
+"--\n"
+"\n"
+"Returns the name assigned to the character chr as a string.\n"
+"\n"
+"If no name is defined, default is returned, or, if not given,\n"
+"ValueError is raised.");
+
+#define UNICODEDATA_UCD_NAME_METHODDEF \
+ {"name", _PyCFunction_CAST(unicodedata_UCD_name), METH_FASTCALL, unicodedata_UCD_name__doc__},
+
+static PyObject *
+unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value);
+
+static PyObject *
+unicodedata_UCD_name(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ int chr;
+ PyObject *default_value = NULL;
+
+ if (!_PyArg_CheckPositional("name", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (!PyUnicode_Check(args[0])) {
+ _PyArg_BadArgument("name", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ if (PyUnicode_READY(args[0])) {
+ goto exit;
+ }
+ if (PyUnicode_GET_LENGTH(args[0]) != 1) {
+ _PyArg_BadArgument("name", "argument 1", "a unicode character", args[0]);
+ goto exit;
+ }
+ chr = PyUnicode_READ_CHAR(args[0], 0);
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ default_value = args[1];
+skip_optional:
+ return_value = unicodedata_UCD_name_impl(self, chr, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicodedata_UCD_lookup__doc__,
+"lookup($self, name, /)\n"
+"--\n"
+"\n"
+"Look up character by name.\n"
+"\n"
+"If a character with the given name is found, return the\n"
+"corresponding character. If not found, KeyError is raised.");
+
+#define UNICODEDATA_UCD_LOOKUP_METHODDEF \
+ {"lookup", (PyCFunction)unicodedata_UCD_lookup, METH_O, unicodedata_UCD_lookup__doc__},
+
+static PyObject *
+unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
+ Py_ssize_t name_length);
+
+static PyObject *
+unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ const char *name;
+ Py_ssize_t name_length;
+
+ if (!PyArg_Parse(arg, "s#:lookup", &name, &name_length)) {
+ goto exit;
+ }
+ return_value = unicodedata_UCD_lookup_impl(self, name, name_length);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=aaf601d28b352353 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/clinic/zlibmodule.c.h b/contrib/tools/python3/Modules/clinic/zlibmodule.c.h
new file mode 100644
index 00000000000..a8d488ec67c
--- /dev/null
+++ b/contrib/tools/python3/Modules/clinic/zlibmodule.c.h
@@ -0,0 +1,1132 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+# include "pycore_gc.h" // PyGC_Head
+# include "pycore_runtime.h" // _Py_ID()
+#endif
+
+
+PyDoc_STRVAR(zlib_compress__doc__,
+"compress($module, data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)\n"
+"--\n"
+"\n"
+"Returns a bytes object containing compressed data.\n"
+"\n"
+" data\n"
+" Binary data to be compressed.\n"
+" level\n"
+" Compression level, in 0-9 or -1.\n"
+" wbits\n"
+" The window buffer size and container format.");
+
+#define ZLIB_COMPRESS_METHODDEF \
+ {"compress", _PyCFunction_CAST(zlib_compress), METH_FASTCALL|METH_KEYWORDS, zlib_compress__doc__},
+
+static PyObject *
+zlib_compress_impl(PyObject *module, Py_buffer *data, int level, int wbits);
+
+static PyObject *
+zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(level), &_Py_ID(wbits), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "level", "wbits", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "compress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int level = Z_DEFAULT_COMPRESSION;
+ int wbits = MAX_WBITS;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("compress", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ level = _PyLong_AsInt(args[1]);
+ if (level == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ wbits = _PyLong_AsInt(args[2]);
+ if (wbits == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = zlib_compress_impl(module, &data, level, wbits);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_decompress__doc__,
+"decompress($module, data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)\n"
+"--\n"
+"\n"
+"Returns a bytes object containing the uncompressed data.\n"
+"\n"
+" data\n"
+" Compressed data.\n"
+" wbits\n"
+" The window buffer size and container format.\n"
+" bufsize\n"
+" The initial output buffer size.");
+
+#define ZLIB_DECOMPRESS_METHODDEF \
+ {"decompress", _PyCFunction_CAST(zlib_decompress), METH_FASTCALL|METH_KEYWORDS, zlib_decompress__doc__},
+
+static PyObject *
+zlib_decompress_impl(PyObject *module, Py_buffer *data, int wbits,
+ Py_ssize_t bufsize);
+
+static PyObject *
+zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(wbits), &_Py_ID(bufsize), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "wbits", "bufsize", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decompress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[3];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ int wbits = MAX_WBITS;
+ Py_ssize_t bufsize = DEF_BUF_SIZE;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[1]) {
+ wbits = _PyLong_AsInt(args[1]);
+ if (wbits == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[2]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ bufsize = ival;
+ }
+skip_optional_pos:
+ return_value = zlib_decompress_impl(module, &data, wbits, bufsize);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_compressobj__doc__,
+"compressobj($module, /, level=Z_DEFAULT_COMPRESSION, method=DEFLATED,\n"
+" wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL,\n"
+" strategy=Z_DEFAULT_STRATEGY, zdict=None)\n"
+"--\n"
+"\n"
+"Return a compressor object.\n"
+"\n"
+" level\n"
+" The compression level (an integer in the range 0-9 or -1; default is\n"
+" currently equivalent to 6). Higher compression levels are slower,\n"
+" but produce smaller results.\n"
+" method\n"
+" The compression algorithm. If given, this must be DEFLATED.\n"
+" wbits\n"
+" +9 to +15: The base-two logarithm of the window size. Include a zlib\n"
+" container.\n"
+" -9 to -15: Generate a raw stream.\n"
+" +25 to +31: Include a gzip container.\n"
+" memLevel\n"
+" Controls the amount of memory used for internal compression state.\n"
+" Valid values range from 1 to 9. Higher values result in higher memory\n"
+" usage, faster compression, and smaller output.\n"
+" strategy\n"
+" Used to tune the compression algorithm. Possible values are\n"
+" Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.\n"
+" zdict\n"
+" The predefined compression dictionary - a sequence of bytes\n"
+" containing subsequences that are likely to occur in the input data.");
+
+#define ZLIB_COMPRESSOBJ_METHODDEF \
+ {"compressobj", _PyCFunction_CAST(zlib_compressobj), METH_FASTCALL|METH_KEYWORDS, zlib_compressobj__doc__},
+
+static PyObject *
+zlib_compressobj_impl(PyObject *module, int level, int method, int wbits,
+ int memLevel, int strategy, Py_buffer *zdict);
+
+static PyObject *
+zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 6
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(level), &_Py_ID(method), &_Py_ID(wbits), &_Py_ID(memLevel), &_Py_ID(strategy), &_Py_ID(zdict), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"level", "method", "wbits", "memLevel", "strategy", "zdict", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "compressobj",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[6];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int level = Z_DEFAULT_COMPRESSION;
+ int method = DEFLATED;
+ int wbits = MAX_WBITS;
+ int memLevel = DEF_MEM_LEVEL;
+ int strategy = Z_DEFAULT_STRATEGY;
+ Py_buffer zdict = {NULL, NULL};
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 6, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ level = _PyLong_AsInt(args[0]);
+ if (level == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[1]) {
+ method = _PyLong_AsInt(args[1]);
+ if (method == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[2]) {
+ wbits = _PyLong_AsInt(args[2]);
+ if (wbits == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[3]) {
+ memLevel = _PyLong_AsInt(args[3]);
+ if (memLevel == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (args[4]) {
+ strategy = _PyLong_AsInt(args[4]);
+ if (strategy == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ if (PyObject_GetBuffer(args[5], &zdict, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&zdict, 'C')) {
+ _PyArg_BadArgument("compressobj", "argument 'zdict'", "contiguous buffer", args[5]);
+ goto exit;
+ }
+skip_optional_pos:
+ return_value = zlib_compressobj_impl(module, level, method, wbits, memLevel, strategy, &zdict);
+
+exit:
+ /* Cleanup for zdict */
+ if (zdict.obj) {
+ PyBuffer_Release(&zdict);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_decompressobj__doc__,
+"decompressobj($module, /, wbits=MAX_WBITS, zdict=b\'\')\n"
+"--\n"
+"\n"
+"Return a decompressor object.\n"
+"\n"
+" wbits\n"
+" The window buffer size and container format.\n"
+" zdict\n"
+" The predefined compression dictionary. This must be the same\n"
+" dictionary as used by the compressor that produced the input data.");
+
+#define ZLIB_DECOMPRESSOBJ_METHODDEF \
+ {"decompressobj", _PyCFunction_CAST(zlib_decompressobj), METH_FASTCALL|METH_KEYWORDS, zlib_decompressobj__doc__},
+
+static PyObject *
+zlib_decompressobj_impl(PyObject *module, int wbits, PyObject *zdict);
+
+static PyObject *
+zlib_decompressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(wbits), &_Py_ID(zdict), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"wbits", "zdict", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decompressobj",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ int wbits = MAX_WBITS;
+ PyObject *zdict = NULL;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ if (args[0]) {
+ wbits = _PyLong_AsInt(args[0]);
+ if (wbits == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ if (!--noptargs) {
+ goto skip_optional_pos;
+ }
+ }
+ zdict = args[1];
+skip_optional_pos:
+ return_value = zlib_decompressobj_impl(module, wbits, zdict);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_Compress_compress__doc__,
+"compress($self, data, /)\n"
+"--\n"
+"\n"
+"Returns a bytes object containing compressed data.\n"
+"\n"
+" data\n"
+" Binary data to be compressed.\n"
+"\n"
+"After calling this function, some of the input data may still\n"
+"be stored in internal buffers for later processing.\n"
+"Call the flush() method to clear these buffers.");
+
+#define ZLIB_COMPRESS_COMPRESS_METHODDEF \
+ {"compress", _PyCFunction_CAST(zlib_Compress_compress), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Compress_compress__doc__},
+
+static PyObject *
+zlib_Compress_compress_impl(compobject *self, PyTypeObject *cls,
+ Py_buffer *data);
+
+static PyObject *
+zlib_Compress_compress(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "compress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_buffer data = {NULL, NULL};
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("compress", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ return_value = zlib_Compress_compress_impl(self, cls, &data);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_Decompress_decompress__doc__,
+"decompress($self, data, /, max_length=0)\n"
+"--\n"
+"\n"
+"Return a bytes object containing the decompressed version of the data.\n"
+"\n"
+" data\n"
+" The binary data to decompress.\n"
+" max_length\n"
+" The maximum allowable length of the decompressed data.\n"
+" Unconsumed input data will be stored in\n"
+" the unconsumed_tail attribute.\n"
+"\n"
+"After calling this function, some of the input data may still be stored in\n"
+"internal buffers for later processing.\n"
+"Call the flush() method to clear these buffers.");
+
+#define ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF \
+ {"decompress", _PyCFunction_CAST(zlib_Decompress_decompress), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Decompress_decompress__doc__},
+
+static PyObject *
+zlib_Decompress_decompress_impl(compobject *self, PyTypeObject *cls,
+ Py_buffer *data, Py_ssize_t max_length);
+
+static PyObject *
+zlib_Decompress_decompress(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 1
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(max_length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"", "max_length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decompress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ Py_ssize_t max_length = 0;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ max_length = ival;
+ }
+skip_optional_pos:
+ return_value = zlib_Decompress_decompress_impl(self, cls, &data, max_length);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_Compress_flush__doc__,
+"flush($self, mode=zlib.Z_FINISH, /)\n"
+"--\n"
+"\n"
+"Return a bytes object containing any remaining compressed data.\n"
+"\n"
+" mode\n"
+" One of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH.\n"
+" If mode == Z_FINISH, the compressor object can no longer be\n"
+" used after calling the flush() method. Otherwise, more data\n"
+" can still be compressed.");
+
+#define ZLIB_COMPRESS_FLUSH_METHODDEF \
+ {"flush", _PyCFunction_CAST(zlib_Compress_flush), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Compress_flush__doc__},
+
+static PyObject *
+zlib_Compress_flush_impl(compobject *self, PyTypeObject *cls, int mode);
+
+static PyObject *
+zlib_Compress_flush(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "flush",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ int mode = Z_FINISH;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ mode = _PyLong_AsInt(args[0]);
+ if (mode == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional_posonly:
+ return_value = zlib_Compress_flush_impl(self, cls, mode);
+
+exit:
+ return return_value;
+}
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Compress_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the compression object.");
+
+#define ZLIB_COMPRESS_COPY_METHODDEF \
+ {"copy", _PyCFunction_CAST(zlib_Compress_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Compress_copy__doc__},
+
+static PyObject *
+zlib_Compress_copy_impl(compobject *self, PyTypeObject *cls);
+
+static PyObject *
+zlib_Compress_copy(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
+ return NULL;
+ }
+ return zlib_Compress_copy_impl(self, cls);
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Compress___copy____doc__,
+"__copy__($self, /)\n"
+"--\n"
+"\n");
+
+#define ZLIB_COMPRESS___COPY___METHODDEF \
+ {"__copy__", _PyCFunction_CAST(zlib_Compress___copy__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Compress___copy____doc__},
+
+static PyObject *
+zlib_Compress___copy___impl(compobject *self, PyTypeObject *cls);
+
+static PyObject *
+zlib_Compress___copy__(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments");
+ return NULL;
+ }
+ return zlib_Compress___copy___impl(self, cls);
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Compress___deepcopy____doc__,
+"__deepcopy__($self, memo, /)\n"
+"--\n"
+"\n");
+
+#define ZLIB_COMPRESS___DEEPCOPY___METHODDEF \
+ {"__deepcopy__", _PyCFunction_CAST(zlib_Compress___deepcopy__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Compress___deepcopy____doc__},
+
+static PyObject *
+zlib_Compress___deepcopy___impl(compobject *self, PyTypeObject *cls,
+ PyObject *memo);
+
+static PyObject *
+zlib_Compress___deepcopy__(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "__deepcopy__",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *memo;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ memo = args[0];
+ return_value = zlib_Compress___deepcopy___impl(self, cls, memo);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Decompress_copy__doc__,
+"copy($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the decompression object.");
+
+#define ZLIB_DECOMPRESS_COPY_METHODDEF \
+ {"copy", _PyCFunction_CAST(zlib_Decompress_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Decompress_copy__doc__},
+
+static PyObject *
+zlib_Decompress_copy_impl(compobject *self, PyTypeObject *cls);
+
+static PyObject *
+zlib_Decompress_copy(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "copy() takes no arguments");
+ return NULL;
+ }
+ return zlib_Decompress_copy_impl(self, cls);
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Decompress___copy____doc__,
+"__copy__($self, /)\n"
+"--\n"
+"\n");
+
+#define ZLIB_DECOMPRESS___COPY___METHODDEF \
+ {"__copy__", _PyCFunction_CAST(zlib_Decompress___copy__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Decompress___copy____doc__},
+
+static PyObject *
+zlib_Decompress___copy___impl(compobject *self, PyTypeObject *cls);
+
+static PyObject *
+zlib_Decompress___copy__(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
+ PyErr_SetString(PyExc_TypeError, "__copy__() takes no arguments");
+ return NULL;
+ }
+ return zlib_Decompress___copy___impl(self, cls);
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+#if defined(HAVE_ZLIB_COPY)
+
+PyDoc_STRVAR(zlib_Decompress___deepcopy____doc__,
+"__deepcopy__($self, memo, /)\n"
+"--\n"
+"\n");
+
+#define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF \
+ {"__deepcopy__", _PyCFunction_CAST(zlib_Decompress___deepcopy__), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Decompress___deepcopy____doc__},
+
+static PyObject *
+zlib_Decompress___deepcopy___impl(compobject *self, PyTypeObject *cls,
+ PyObject *memo);
+
+static PyObject *
+zlib_Decompress___deepcopy__(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "__deepcopy__",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ PyObject *memo;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ memo = args[0];
+ return_value = zlib_Decompress___deepcopy___impl(self, cls, memo);
+
+exit:
+ return return_value;
+}
+
+#endif /* defined(HAVE_ZLIB_COPY) */
+
+PyDoc_STRVAR(zlib_Decompress_flush__doc__,
+"flush($self, length=zlib.DEF_BUF_SIZE, /)\n"
+"--\n"
+"\n"
+"Return a bytes object containing any remaining decompressed data.\n"
+"\n"
+" length\n"
+" the initial size of the output buffer.");
+
+#define ZLIB_DECOMPRESS_FLUSH_METHODDEF \
+ {"flush", _PyCFunction_CAST(zlib_Decompress_flush), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, zlib_Decompress_flush__doc__},
+
+static PyObject *
+zlib_Decompress_flush_impl(compobject *self, PyTypeObject *cls,
+ Py_ssize_t length);
+
+static PyObject *
+zlib_Decompress_flush(compobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+ # define KWTUPLE (PyObject *)&_Py_SINGLETON(tuple_empty)
+ #else
+ # define KWTUPLE NULL
+ #endif
+
+ static const char * const _keywords[] = {"", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "flush",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[1];
+ Py_ssize_t length = DEF_BUF_SIZE;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 1, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (nargs < 1) {
+ goto skip_optional_posonly;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[0]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ length = ival;
+ }
+skip_optional_posonly:
+ return_value = zlib_Decompress_flush_impl(self, cls, length);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_ZlibDecompressor_decompress__doc__,
+"decompress($self, /, data, max_length=-1)\n"
+"--\n"
+"\n"
+"Decompress *data*, returning uncompressed data as bytes.\n"
+"\n"
+"If *max_length* is nonnegative, returns at most *max_length* bytes of\n"
+"decompressed data. If this limit is reached and further output can be\n"
+"produced, *self.needs_input* will be set to ``False``. In this case, the next\n"
+"call to *decompress()* may provide *data* as b\'\' to obtain more of the output.\n"
+"\n"
+"If all of the input data was decompressed and returned (either because this\n"
+"was less than *max_length* bytes, or because *max_length* was negative),\n"
+"*self.needs_input* will be set to True.\n"
+"\n"
+"Attempting to decompress data after the end of stream is reached raises an\n"
+"EOFError. Any data found after the end of the stream is ignored and saved in\n"
+"the unused_data attribute.");
+
+#define ZLIB_ZLIBDECOMPRESSOR_DECOMPRESS_METHODDEF \
+ {"decompress", _PyCFunction_CAST(zlib_ZlibDecompressor_decompress), METH_FASTCALL|METH_KEYWORDS, zlib_ZlibDecompressor_decompress__doc__},
+
+static PyObject *
+zlib_ZlibDecompressor_decompress_impl(ZlibDecompressor *self,
+ Py_buffer *data, Py_ssize_t max_length);
+
+static PyObject *
+zlib_ZlibDecompressor_decompress(ZlibDecompressor *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
+
+ #define NUM_KEYWORDS 2
+ static struct {
+ PyGC_Head _this_is_not_used;
+ PyObject_VAR_HEAD
+ PyObject *ob_item[NUM_KEYWORDS];
+ } _kwtuple = {
+ .ob_base = PyVarObject_HEAD_INIT(&PyTuple_Type, NUM_KEYWORDS)
+ .ob_item = { &_Py_ID(data), &_Py_ID(max_length), },
+ };
+ #undef NUM_KEYWORDS
+ #define KWTUPLE (&_kwtuple.ob_base.ob_base)
+
+ #else // !Py_BUILD_CORE
+ # define KWTUPLE NULL
+ #endif // !Py_BUILD_CORE
+
+ static const char * const _keywords[] = {"data", "max_length", NULL};
+ static _PyArg_Parser _parser = {
+ .keywords = _keywords,
+ .fname = "decompress",
+ .kwtuple = KWTUPLE,
+ };
+ #undef KWTUPLE
+ PyObject *argsbuf[2];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
+ Py_buffer data = {NULL, NULL};
+ Py_ssize_t max_length = -1;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_pos;
+ }
+ {
+ Py_ssize_t ival = -1;
+ PyObject *iobj = _PyNumber_Index(args[1]);
+ if (iobj != NULL) {
+ ival = PyLong_AsSsize_t(iobj);
+ Py_DECREF(iobj);
+ }
+ if (ival == -1 && PyErr_Occurred()) {
+ goto exit;
+ }
+ max_length = ival;
+ }
+skip_optional_pos:
+ return_value = zlib_ZlibDecompressor_decompress_impl(self, &data, max_length);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_adler32__doc__,
+"adler32($module, data, value=1, /)\n"
+"--\n"
+"\n"
+"Compute an Adler-32 checksum of data.\n"
+"\n"
+" value\n"
+" Starting value of the checksum.\n"
+"\n"
+"The returned checksum is an integer.");
+
+#define ZLIB_ADLER32_METHODDEF \
+ {"adler32", _PyCFunction_CAST(zlib_adler32), METH_FASTCALL, zlib_adler32__doc__},
+
+static PyObject *
+zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value);
+
+static PyObject *
+zlib_adler32(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ unsigned int value = 1;
+
+ if (!_PyArg_CheckPositional("adler32", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("adler32", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ value = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (value == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ return_value = zlib_adler32_impl(module, &data, value);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(zlib_crc32__doc__,
+"crc32($module, data, value=0, /)\n"
+"--\n"
+"\n"
+"Compute a CRC-32 checksum of data.\n"
+"\n"
+" value\n"
+" Starting value of the checksum.\n"
+"\n"
+"The returned checksum is an integer.");
+
+#define ZLIB_CRC32_METHODDEF \
+ {"crc32", _PyCFunction_CAST(zlib_crc32), METH_FASTCALL, zlib_crc32__doc__},
+
+static unsigned int
+zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value);
+
+static PyObject *
+zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+{
+ PyObject *return_value = NULL;
+ Py_buffer data = {NULL, NULL};
+ unsigned int value = 0;
+ unsigned int _return_value;
+
+ if (!_PyArg_CheckPositional("crc32", nargs, 1, 2)) {
+ goto exit;
+ }
+ if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&data, 'C')) {
+ _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]);
+ goto exit;
+ }
+ if (nargs < 2) {
+ goto skip_optional;
+ }
+ value = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
+ if (value == (unsigned int)-1 && PyErr_Occurred()) {
+ goto exit;
+ }
+skip_optional:
+ _return_value = zlib_crc32_impl(module, &data, value);
+ if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromUnsignedLong((unsigned long)_return_value);
+
+exit:
+ /* Cleanup for data */
+ if (data.obj) {
+ PyBuffer_Release(&data);
+ }
+
+ return return_value;
+}
+
+#ifndef ZLIB_COMPRESS_COPY_METHODDEF
+ #define ZLIB_COMPRESS_COPY_METHODDEF
+#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
+
+#ifndef ZLIB_COMPRESS___COPY___METHODDEF
+ #define ZLIB_COMPRESS___COPY___METHODDEF
+#endif /* !defined(ZLIB_COMPRESS___COPY___METHODDEF) */
+
+#ifndef ZLIB_COMPRESS___DEEPCOPY___METHODDEF
+ #define ZLIB_COMPRESS___DEEPCOPY___METHODDEF
+#endif /* !defined(ZLIB_COMPRESS___DEEPCOPY___METHODDEF) */
+
+#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF
+ #define ZLIB_DECOMPRESS_COPY_METHODDEF
+#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */
+
+#ifndef ZLIB_DECOMPRESS___COPY___METHODDEF
+ #define ZLIB_DECOMPRESS___COPY___METHODDEF
+#endif /* !defined(ZLIB_DECOMPRESS___COPY___METHODDEF) */
+
+#ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
+ #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
+#endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
+/*[clinic end generated code: output=244bf5f33deee674 input=a9049054013a1b77]*/
diff --git a/contrib/tools/python3/Modules/cmathmodule.c b/contrib/tools/python3/Modules/cmathmodule.c
new file mode 100644
index 00000000000..25491e65584
--- /dev/null
+++ b/contrib/tools/python3/Modules/cmathmodule.c
@@ -0,0 +1,1381 @@
+/* Complex math module */
+
+/* much code borrowed from mathmodule.c */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
+/* we need DBL_MAX, DBL_MIN, DBL_EPSILON, DBL_MANT_DIG and FLT_RADIX from
+ float.h. We assume that FLT_RADIX is either 2 or 16. */
+#include <float.h>
+
+/* For _Py_log1p with workarounds for buggy handling of zeros. */
+#include "_math.h"
+
+#include "clinic/cmathmodule.c.h"
+/*[clinic input]
+module cmath
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=308d6839f4a46333]*/
+
+/*[python input]
+class Py_complex_protected_converter(Py_complex_converter):
+ def modify(self):
+ return 'errno = 0;'
+
+
+class Py_complex_protected_return_converter(CReturnConverter):
+ type = "Py_complex"
+
+ def render(self, function, data):
+ self.declare(data)
+ data.return_conversion.append("""
+if (errno == EDOM) {
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ goto exit;
+}
+else if (errno == ERANGE) {
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ goto exit;
+}
+else {
+ return_value = PyComplex_FromCComplex(_return_value);
+}
+""".strip())
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=8b27adb674c08321]*/
+
+#if (FLT_RADIX != 2 && FLT_RADIX != 16)
+#error "Modules/cmathmodule.c expects FLT_RADIX to be 2 or 16"
+#endif
+
+#ifndef M_LN2
+#define M_LN2 (0.6931471805599453094) /* natural log of 2 */
+#endif
+
+#ifndef M_LN10
+#define M_LN10 (2.302585092994045684) /* natural log of 10 */
+#endif
+
+/*
+ CM_LARGE_DOUBLE is used to avoid spurious overflow in the sqrt, log,
+ inverse trig and inverse hyperbolic trig functions. Its log is used in the
+ evaluation of exp, cos, cosh, sin, sinh, tan, and tanh to avoid unnecessary
+ overflow.
+ */
+
+#define CM_LARGE_DOUBLE (DBL_MAX/4.)
+#define CM_SQRT_LARGE_DOUBLE (sqrt(CM_LARGE_DOUBLE))
+#define CM_LOG_LARGE_DOUBLE (log(CM_LARGE_DOUBLE))
+#define CM_SQRT_DBL_MIN (sqrt(DBL_MIN))
+
+/*
+ CM_SCALE_UP is an odd integer chosen such that multiplication by
+ 2**CM_SCALE_UP is sufficient to turn a subnormal into a normal.
+ CM_SCALE_DOWN is (-(CM_SCALE_UP+1)/2). These scalings are used to compute
+ square roots accurately when the real and imaginary parts of the argument
+ are subnormal.
+*/
+
+#if FLT_RADIX==2
+#define CM_SCALE_UP (2*(DBL_MANT_DIG/2) + 1)
+#elif FLT_RADIX==16
+#define CM_SCALE_UP (4*DBL_MANT_DIG+1)
+#endif
+#define CM_SCALE_DOWN (-(CM_SCALE_UP+1)/2)
+
+
+/* forward declarations */
+static Py_complex cmath_asinh_impl(PyObject *, Py_complex);
+static Py_complex cmath_atanh_impl(PyObject *, Py_complex);
+static Py_complex cmath_cosh_impl(PyObject *, Py_complex);
+static Py_complex cmath_sinh_impl(PyObject *, Py_complex);
+static Py_complex cmath_sqrt_impl(PyObject *, Py_complex);
+static Py_complex cmath_tanh_impl(PyObject *, Py_complex);
+static PyObject * math_error(void);
+
+/* Code to deal with special values (infinities, NaNs, etc.). */
+
+/* special_type takes a double and returns an integer code indicating
+ the type of the double as follows:
+*/
+
+enum special_types {
+ ST_NINF, /* 0, negative infinity */
+ ST_NEG, /* 1, negative finite number (nonzero) */
+ ST_NZERO, /* 2, -0. */
+ ST_PZERO, /* 3, +0. */
+ ST_POS, /* 4, positive finite number (nonzero) */
+ ST_PINF, /* 5, positive infinity */
+ ST_NAN /* 6, Not a Number */
+};
+
+static enum special_types
+special_type(double d)
+{
+ if (Py_IS_FINITE(d)) {
+ if (d != 0) {
+ if (copysign(1., d) == 1.)
+ return ST_POS;
+ else
+ return ST_NEG;
+ }
+ else {
+ if (copysign(1., d) == 1.)
+ return ST_PZERO;
+ else
+ return ST_NZERO;
+ }
+ }
+ if (Py_IS_NAN(d))
+ return ST_NAN;
+ if (copysign(1., d) == 1.)
+ return ST_PINF;
+ else
+ return ST_NINF;
+}
+
+#define SPECIAL_VALUE(z, table) \
+ if (!Py_IS_FINITE((z).real) || !Py_IS_FINITE((z).imag)) { \
+ errno = 0; \
+ return table[special_type((z).real)] \
+ [special_type((z).imag)]; \
+ }
+
+#define P Py_MATH_PI
+#define P14 0.25*Py_MATH_PI
+#define P12 0.5*Py_MATH_PI
+#define P34 0.75*Py_MATH_PI
+#define INF Py_HUGE_VAL
+#define N Py_NAN
+#define U -9.5426319407711027e33 /* unlikely value, used as placeholder */
+
+/* First, the C functions that do the real work. Each of the c_*
+ functions computes and returns the C99 Annex G recommended result
+ and also sets errno as follows: errno = 0 if no floating-point
+ exception is associated with the result; errno = EDOM if C99 Annex
+ G recommends raising divide-by-zero or invalid for this result; and
+ errno = ERANGE where the overflow floating-point signal should be
+ raised.
+*/
+
+static Py_complex acos_special_values[7][7];
+
+/*[clinic input]
+cmath.acos -> Py_complex_protected
+
+ z: Py_complex_protected
+ /
+
+Return the arc cosine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_acos_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=40bd42853fd460ae input=bd6cbd78ae851927]*/
+{
+ Py_complex s1, s2, r;
+
+ SPECIAL_VALUE(z, acos_special_values);
+
+ if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) {
+ /* avoid unnecessary overflow for large arguments */
+ r.real = atan2(fabs(z.imag), z.real);
+ /* split into cases to make sure that the branch cut has the
+ correct continuity on systems with unsigned zeros */
+ if (z.real < 0.) {
+ r.imag = -copysign(log(hypot(z.real/2., z.imag/2.)) +
+ M_LN2*2., z.imag);
+ } else {
+ r.imag = copysign(log(hypot(z.real/2., z.imag/2.)) +
+ M_LN2*2., -z.imag);
+ }
+ } else {
+ s1.real = 1.-z.real;
+ s1.imag = -z.imag;
+ s1 = cmath_sqrt_impl(module, s1);
+ s2.real = 1.+z.real;
+ s2.imag = z.imag;
+ s2 = cmath_sqrt_impl(module, s2);
+ r.real = 2.*atan2(s1.real, s2.real);
+ r.imag = asinh(s2.real*s1.imag - s2.imag*s1.real);
+ }
+ errno = 0;
+ return r;
+}
+
+
+static Py_complex acosh_special_values[7][7];
+
+/*[clinic input]
+cmath.acosh = cmath.acos
+
+Return the inverse hyperbolic cosine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_acosh_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=3e2454d4fcf404ca input=3f61bee7d703e53c]*/
+{
+ Py_complex s1, s2, r;
+
+ SPECIAL_VALUE(z, acosh_special_values);
+
+ if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) {
+ /* avoid unnecessary overflow for large arguments */
+ r.real = log(hypot(z.real/2., z.imag/2.)) + M_LN2*2.;
+ r.imag = atan2(z.imag, z.real);
+ } else {
+ s1.real = z.real - 1.;
+ s1.imag = z.imag;
+ s1 = cmath_sqrt_impl(module, s1);
+ s2.real = z.real + 1.;
+ s2.imag = z.imag;
+ s2 = cmath_sqrt_impl(module, s2);
+ r.real = asinh(s1.real*s2.real + s1.imag*s2.imag);
+ r.imag = 2.*atan2(s1.imag, s2.real);
+ }
+ errno = 0;
+ return r;
+}
+
+/*[clinic input]
+cmath.asin = cmath.acos
+
+Return the arc sine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_asin_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=3b264cd1b16bf4e1 input=be0bf0cfdd5239c5]*/
+{
+ /* asin(z) = -i asinh(iz) */
+ Py_complex s, r;
+ s.real = -z.imag;
+ s.imag = z.real;
+ s = cmath_asinh_impl(module, s);
+ r.real = s.imag;
+ r.imag = -s.real;
+ return r;
+}
+
+
+static Py_complex asinh_special_values[7][7];
+
+/*[clinic input]
+cmath.asinh = cmath.acos
+
+Return the inverse hyperbolic sine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_asinh_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=733d8107841a7599 input=5c09448fcfc89a79]*/
+{
+ Py_complex s1, s2, r;
+
+ SPECIAL_VALUE(z, asinh_special_values);
+
+ if (fabs(z.real) > CM_LARGE_DOUBLE || fabs(z.imag) > CM_LARGE_DOUBLE) {
+ if (z.imag >= 0.) {
+ r.real = copysign(log(hypot(z.real/2., z.imag/2.)) +
+ M_LN2*2., z.real);
+ } else {
+ r.real = -copysign(log(hypot(z.real/2., z.imag/2.)) +
+ M_LN2*2., -z.real);
+ }
+ r.imag = atan2(z.imag, fabs(z.real));
+ } else {
+ s1.real = 1.+z.imag;
+ s1.imag = -z.real;
+ s1 = cmath_sqrt_impl(module, s1);
+ s2.real = 1.-z.imag;
+ s2.imag = z.real;
+ s2 = cmath_sqrt_impl(module, s2);
+ r.real = asinh(s1.real*s2.imag-s2.real*s1.imag);
+ r.imag = atan2(z.imag, s1.real*s2.real-s1.imag*s2.imag);
+ }
+ errno = 0;
+ return r;
+}
+
+
+/*[clinic input]
+cmath.atan = cmath.acos
+
+Return the arc tangent of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_atan_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=b6bfc497058acba4 input=3b21ff7d5eac632a]*/
+{
+ /* atan(z) = -i atanh(iz) */
+ Py_complex s, r;
+ s.real = -z.imag;
+ s.imag = z.real;
+ s = cmath_atanh_impl(module, s);
+ r.real = s.imag;
+ r.imag = -s.real;
+ return r;
+}
+
+/* Windows screws up atan2 for inf and nan, and alpha Tru64 5.1 doesn't follow
+ C99 for atan2(0., 0.). */
+static double
+c_atan2(Py_complex z)
+{
+ if (Py_IS_NAN(z.real) || Py_IS_NAN(z.imag))
+ return Py_NAN;
+ if (Py_IS_INFINITY(z.imag)) {
+ if (Py_IS_INFINITY(z.real)) {
+ if (copysign(1., z.real) == 1.)
+ /* atan2(+-inf, +inf) == +-pi/4 */
+ return copysign(0.25*Py_MATH_PI, z.imag);
+ else
+ /* atan2(+-inf, -inf) == +-pi*3/4 */
+ return copysign(0.75*Py_MATH_PI, z.imag);
+ }
+ /* atan2(+-inf, x) == +-pi/2 for finite x */
+ return copysign(0.5*Py_MATH_PI, z.imag);
+ }
+ if (Py_IS_INFINITY(z.real) || z.imag == 0.) {
+ if (copysign(1., z.real) == 1.)
+ /* atan2(+-y, +inf) = atan2(+-0, +x) = +-0. */
+ return copysign(0., z.imag);
+ else
+ /* atan2(+-y, -inf) = atan2(+-0., -x) = +-pi. */
+ return copysign(Py_MATH_PI, z.imag);
+ }
+ return atan2(z.imag, z.real);
+}
+
+
+static Py_complex atanh_special_values[7][7];
+
+/*[clinic input]
+cmath.atanh = cmath.acos
+
+Return the inverse hyperbolic tangent of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_atanh_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=e83355f93a989c9e input=2b3fdb82fb34487b]*/
+{
+ Py_complex r;
+ double ay, h;
+
+ SPECIAL_VALUE(z, atanh_special_values);
+
+ /* Reduce to case where z.real >= 0., using atanh(z) = -atanh(-z). */
+ if (z.real < 0.) {
+ return _Py_c_neg(cmath_atanh_impl(module, _Py_c_neg(z)));
+ }
+
+ ay = fabs(z.imag);
+ if (z.real > CM_SQRT_LARGE_DOUBLE || ay > CM_SQRT_LARGE_DOUBLE) {
+ /*
+ if abs(z) is large then we use the approximation
+ atanh(z) ~ 1/z +/- i*pi/2 (+/- depending on the sign
+ of z.imag)
+ */
+ h = hypot(z.real/2., z.imag/2.); /* safe from overflow */
+ r.real = z.real/4./h/h;
+ /* the two negations in the next line cancel each other out
+ except when working with unsigned zeros: they're there to
+ ensure that the branch cut has the correct continuity on
+ systems that don't support signed zeros */
+ r.imag = -copysign(Py_MATH_PI/2., -z.imag);
+ errno = 0;
+ } else if (z.real == 1. && ay < CM_SQRT_DBL_MIN) {
+ /* C99 standard says: atanh(1+/-0.) should be inf +/- 0i */
+ if (ay == 0.) {
+ r.real = INF;
+ r.imag = z.imag;
+ errno = EDOM;
+ } else {
+ r.real = -log(sqrt(ay)/sqrt(hypot(ay, 2.)));
+ r.imag = copysign(atan2(2., -ay)/2, z.imag);
+ errno = 0;
+ }
+ } else {
+ r.real = m_log1p(4.*z.real/((1-z.real)*(1-z.real) + ay*ay))/4.;
+ r.imag = -atan2(-2.*z.imag, (1-z.real)*(1+z.real) - ay*ay)/2.;
+ errno = 0;
+ }
+ return r;
+}
+
+
+/*[clinic input]
+cmath.cos = cmath.acos
+
+Return the cosine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_cos_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=fd64918d5b3186db input=6022e39b77127ac7]*/
+{
+ /* cos(z) = cosh(iz) */
+ Py_complex r;
+ r.real = -z.imag;
+ r.imag = z.real;
+ r = cmath_cosh_impl(module, r);
+ return r;
+}
+
+
+/* cosh(infinity + i*y) needs to be dealt with specially */
+static Py_complex cosh_special_values[7][7];
+
+/*[clinic input]
+cmath.cosh = cmath.acos
+
+Return the hyperbolic cosine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_cosh_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=2e969047da601bdb input=d6b66339e9cc332b]*/
+{
+ Py_complex r;
+ double x_minus_one;
+
+ /* special treatment for cosh(+/-inf + iy) if y is not a NaN */
+ if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
+ if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag) &&
+ (z.imag != 0.)) {
+ if (z.real > 0) {
+ r.real = copysign(INF, cos(z.imag));
+ r.imag = copysign(INF, sin(z.imag));
+ }
+ else {
+ r.real = copysign(INF, cos(z.imag));
+ r.imag = -copysign(INF, sin(z.imag));
+ }
+ }
+ else {
+ r = cosh_special_values[special_type(z.real)]
+ [special_type(z.imag)];
+ }
+ /* need to set errno = EDOM if y is +/- infinity and x is not
+ a NaN */
+ if (Py_IS_INFINITY(z.imag) && !Py_IS_NAN(z.real))
+ errno = EDOM;
+ else
+ errno = 0;
+ return r;
+ }
+
+ if (fabs(z.real) > CM_LOG_LARGE_DOUBLE) {
+ /* deal correctly with cases where cosh(z.real) overflows but
+ cosh(z) does not. */
+ x_minus_one = z.real - copysign(1., z.real);
+ r.real = cos(z.imag) * cosh(x_minus_one) * Py_MATH_E;
+ r.imag = sin(z.imag) * sinh(x_minus_one) * Py_MATH_E;
+ } else {
+ r.real = cos(z.imag) * cosh(z.real);
+ r.imag = sin(z.imag) * sinh(z.real);
+ }
+ /* detect overflow, and set errno accordingly */
+ if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag))
+ errno = ERANGE;
+ else
+ errno = 0;
+ return r;
+}
+
+
+/* exp(infinity + i*y) and exp(-infinity + i*y) need special treatment for
+ finite y */
+static Py_complex exp_special_values[7][7];
+
+/*[clinic input]
+cmath.exp = cmath.acos
+
+Return the exponential value e**z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_exp_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=edcec61fb9dfda6c input=8b9e6cf8a92174c3]*/
+{
+ Py_complex r;
+ double l;
+
+ if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
+ if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag)
+ && (z.imag != 0.)) {
+ if (z.real > 0) {
+ r.real = copysign(INF, cos(z.imag));
+ r.imag = copysign(INF, sin(z.imag));
+ }
+ else {
+ r.real = copysign(0., cos(z.imag));
+ r.imag = copysign(0., sin(z.imag));
+ }
+ }
+ else {
+ r = exp_special_values[special_type(z.real)]
+ [special_type(z.imag)];
+ }
+ /* need to set errno = EDOM if y is +/- infinity and x is not
+ a NaN and not -infinity */
+ if (Py_IS_INFINITY(z.imag) &&
+ (Py_IS_FINITE(z.real) ||
+ (Py_IS_INFINITY(z.real) && z.real > 0)))
+ errno = EDOM;
+ else
+ errno = 0;
+ return r;
+ }
+
+ if (z.real > CM_LOG_LARGE_DOUBLE) {
+ l = exp(z.real-1.);
+ r.real = l*cos(z.imag)*Py_MATH_E;
+ r.imag = l*sin(z.imag)*Py_MATH_E;
+ } else {
+ l = exp(z.real);
+ r.real = l*cos(z.imag);
+ r.imag = l*sin(z.imag);
+ }
+ /* detect overflow, and set errno accordingly */
+ if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag))
+ errno = ERANGE;
+ else
+ errno = 0;
+ return r;
+}
+
+static Py_complex log_special_values[7][7];
+
+static Py_complex
+c_log(Py_complex z)
+{
+ /*
+ The usual formula for the real part is log(hypot(z.real, z.imag)).
+ There are four situations where this formula is potentially
+ problematic:
+
+ (1) the absolute value of z is subnormal. Then hypot is subnormal,
+ so has fewer than the usual number of bits of accuracy, hence may
+ have large relative error. This then gives a large absolute error
+ in the log. This can be solved by rescaling z by a suitable power
+ of 2.
+
+ (2) the absolute value of z is greater than DBL_MAX (e.g. when both
+ z.real and z.imag are within a factor of 1/sqrt(2) of DBL_MAX)
+ Again, rescaling solves this.
+
+ (3) the absolute value of z is close to 1. In this case it's
+ difficult to achieve good accuracy, at least in part because a
+ change of 1ulp in the real or imaginary part of z can result in a
+ change of billions of ulps in the correctly rounded answer.
+
+ (4) z = 0. The simplest thing to do here is to call the
+ floating-point log with an argument of 0, and let its behaviour
+ (returning -infinity, signaling a floating-point exception, setting
+ errno, or whatever) determine that of c_log. So the usual formula
+ is fine here.
+
+ */
+
+ Py_complex r;
+ double ax, ay, am, an, h;
+
+ SPECIAL_VALUE(z, log_special_values);
+
+ ax = fabs(z.real);
+ ay = fabs(z.imag);
+
+ if (ax > CM_LARGE_DOUBLE || ay > CM_LARGE_DOUBLE) {
+ r.real = log(hypot(ax/2., ay/2.)) + M_LN2;
+ } else if (ax < DBL_MIN && ay < DBL_MIN) {
+ if (ax > 0. || ay > 0.) {
+ /* catch cases where hypot(ax, ay) is subnormal */
+ r.real = log(hypot(ldexp(ax, DBL_MANT_DIG),
+ ldexp(ay, DBL_MANT_DIG))) - DBL_MANT_DIG*M_LN2;
+ }
+ else {
+ /* log(+/-0. +/- 0i) */
+ r.real = -INF;
+ r.imag = atan2(z.imag, z.real);
+ errno = EDOM;
+ return r;
+ }
+ } else {
+ h = hypot(ax, ay);
+ if (0.71 <= h && h <= 1.73) {
+ am = ax > ay ? ax : ay; /* max(ax, ay) */
+ an = ax > ay ? ay : ax; /* min(ax, ay) */
+ r.real = m_log1p((am-1)*(am+1)+an*an)/2.;
+ } else {
+ r.real = log(h);
+ }
+ }
+ r.imag = atan2(z.imag, z.real);
+ errno = 0;
+ return r;
+}
+
+
+/*[clinic input]
+cmath.log10 = cmath.acos
+
+Return the base-10 logarithm of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_log10_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=2922779a7c38cbe1 input=cff5644f73c1519c]*/
+{
+ Py_complex r;
+ int errno_save;
+
+ r = c_log(z);
+ errno_save = errno; /* just in case the divisions affect errno */
+ r.real = r.real / M_LN10;
+ r.imag = r.imag / M_LN10;
+ errno = errno_save;
+ return r;
+}
+
+
+/*[clinic input]
+cmath.sin = cmath.acos
+
+Return the sine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_sin_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=980370d2ff0bb5aa input=2d3519842a8b4b85]*/
+{
+ /* sin(z) = -i sin(iz) */
+ Py_complex s, r;
+ s.real = -z.imag;
+ s.imag = z.real;
+ s = cmath_sinh_impl(module, s);
+ r.real = s.imag;
+ r.imag = -s.real;
+ return r;
+}
+
+
+/* sinh(infinity + i*y) needs to be dealt with specially */
+static Py_complex sinh_special_values[7][7];
+
+/*[clinic input]
+cmath.sinh = cmath.acos
+
+Return the hyperbolic sine of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_sinh_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=38b0a6cce26f3536 input=d2d3fc8c1ddfd2dd]*/
+{
+ Py_complex r;
+ double x_minus_one;
+
+ /* special treatment for sinh(+/-inf + iy) if y is finite and
+ nonzero */
+ if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
+ if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag)
+ && (z.imag != 0.)) {
+ if (z.real > 0) {
+ r.real = copysign(INF, cos(z.imag));
+ r.imag = copysign(INF, sin(z.imag));
+ }
+ else {
+ r.real = -copysign(INF, cos(z.imag));
+ r.imag = copysign(INF, sin(z.imag));
+ }
+ }
+ else {
+ r = sinh_special_values[special_type(z.real)]
+ [special_type(z.imag)];
+ }
+ /* need to set errno = EDOM if y is +/- infinity and x is not
+ a NaN */
+ if (Py_IS_INFINITY(z.imag) && !Py_IS_NAN(z.real))
+ errno = EDOM;
+ else
+ errno = 0;
+ return r;
+ }
+
+ if (fabs(z.real) > CM_LOG_LARGE_DOUBLE) {
+ x_minus_one = z.real - copysign(1., z.real);
+ r.real = cos(z.imag) * sinh(x_minus_one) * Py_MATH_E;
+ r.imag = sin(z.imag) * cosh(x_minus_one) * Py_MATH_E;
+ } else {
+ r.real = cos(z.imag) * sinh(z.real);
+ r.imag = sin(z.imag) * cosh(z.real);
+ }
+ /* detect overflow, and set errno accordingly */
+ if (Py_IS_INFINITY(r.real) || Py_IS_INFINITY(r.imag))
+ errno = ERANGE;
+ else
+ errno = 0;
+ return r;
+}
+
+
+static Py_complex sqrt_special_values[7][7];
+
+/*[clinic input]
+cmath.sqrt = cmath.acos
+
+Return the square root of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_sqrt_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=b6507b3029c339fc input=7088b166fc9a58c7]*/
+{
+ /*
+ Method: use symmetries to reduce to the case when x = z.real and y
+ = z.imag are nonnegative. Then the real part of the result is
+ given by
+
+ s = sqrt((x + hypot(x, y))/2)
+
+ and the imaginary part is
+
+ d = (y/2)/s
+
+ If either x or y is very large then there's a risk of overflow in
+ computation of the expression x + hypot(x, y). We can avoid this
+ by rewriting the formula for s as:
+
+ s = 2*sqrt(x/8 + hypot(x/8, y/8))
+
+ This costs us two extra multiplications/divisions, but avoids the
+ overhead of checking for x and y large.
+
+ If both x and y are subnormal then hypot(x, y) may also be
+ subnormal, so will lack full precision. We solve this by rescaling
+ x and y by a sufficiently large power of 2 to ensure that x and y
+ are normal.
+ */
+
+
+ Py_complex r;
+ double s,d;
+ double ax, ay;
+
+ SPECIAL_VALUE(z, sqrt_special_values);
+
+ if (z.real == 0. && z.imag == 0.) {
+ r.real = 0.;
+ r.imag = z.imag;
+ return r;
+ }
+
+ ax = fabs(z.real);
+ ay = fabs(z.imag);
+
+ if (ax < DBL_MIN && ay < DBL_MIN) {
+ /* here we catch cases where hypot(ax, ay) is subnormal */
+ ax = ldexp(ax, CM_SCALE_UP);
+ s = ldexp(sqrt(ax + hypot(ax, ldexp(ay, CM_SCALE_UP))),
+ CM_SCALE_DOWN);
+ } else {
+ ax /= 8.;
+ s = 2.*sqrt(ax + hypot(ax, ay/8.));
+ }
+ d = ay/(2.*s);
+
+ if (z.real >= 0.) {
+ r.real = s;
+ r.imag = copysign(d, z.imag);
+ } else {
+ r.real = d;
+ r.imag = copysign(s, z.imag);
+ }
+ errno = 0;
+ return r;
+}
+
+
+/*[clinic input]
+cmath.tan = cmath.acos
+
+Return the tangent of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_tan_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=7c5f13158a72eb13 input=fc167e528767888e]*/
+{
+ /* tan(z) = -i tanh(iz) */
+ Py_complex s, r;
+ s.real = -z.imag;
+ s.imag = z.real;
+ s = cmath_tanh_impl(module, s);
+ r.real = s.imag;
+ r.imag = -s.real;
+ return r;
+}
+
+
+/* tanh(infinity + i*y) needs to be dealt with specially */
+static Py_complex tanh_special_values[7][7];
+
+/*[clinic input]
+cmath.tanh = cmath.acos
+
+Return the hyperbolic tangent of z.
+[clinic start generated code]*/
+
+static Py_complex
+cmath_tanh_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=36d547ef7aca116c input=22f67f9dc6d29685]*/
+{
+ /* Formula:
+
+ tanh(x+iy) = (tanh(x)(1+tan(y)^2) + i tan(y)(1-tanh(x))^2) /
+ (1+tan(y)^2 tanh(x)^2)
+
+ To avoid excessive roundoff error, 1-tanh(x)^2 is better computed
+ as 1/cosh(x)^2. When abs(x) is large, we approximate 1-tanh(x)^2
+ by 4 exp(-2*x) instead, to avoid possible overflow in the
+ computation of cosh(x).
+
+ */
+
+ Py_complex r;
+ double tx, ty, cx, txty, denom;
+
+ /* special treatment for tanh(+/-inf + iy) if y is finite and
+ nonzero */
+ if (!Py_IS_FINITE(z.real) || !Py_IS_FINITE(z.imag)) {
+ if (Py_IS_INFINITY(z.real) && Py_IS_FINITE(z.imag)
+ && (z.imag != 0.)) {
+ if (z.real > 0) {
+ r.real = 1.0;
+ r.imag = copysign(0.,
+ 2.*sin(z.imag)*cos(z.imag));
+ }
+ else {
+ r.real = -1.0;
+ r.imag = copysign(0.,
+ 2.*sin(z.imag)*cos(z.imag));
+ }
+ }
+ else {
+ r = tanh_special_values[special_type(z.real)]
+ [special_type(z.imag)];
+ }
+ /* need to set errno = EDOM if z.imag is +/-infinity and
+ z.real is finite */
+ if (Py_IS_INFINITY(z.imag) && Py_IS_FINITE(z.real))
+ errno = EDOM;
+ else
+ errno = 0;
+ return r;
+ }
+
+ /* danger of overflow in 2.*z.imag !*/
+ if (fabs(z.real) > CM_LOG_LARGE_DOUBLE) {
+ r.real = copysign(1., z.real);
+ r.imag = 4.*sin(z.imag)*cos(z.imag)*exp(-2.*fabs(z.real));
+ } else {
+ tx = tanh(z.real);
+ ty = tan(z.imag);
+ cx = 1./cosh(z.real);
+ txty = tx*ty;
+ denom = 1. + txty*txty;
+ r.real = tx*(1.+ty*ty)/denom;
+ r.imag = ((ty/denom)*cx)*cx;
+ }
+ errno = 0;
+ return r;
+}
+
+
+/*[clinic input]
+cmath.log
+
+ z as x: Py_complex
+ base as y_obj: object = NULL
+ /
+
+log(z[, base]) -> the logarithm of z to the given base.
+
+If the base is not specified, returns the natural logarithm (base e) of z.
+[clinic start generated code]*/
+
+static PyObject *
+cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj)
+/*[clinic end generated code: output=4effdb7d258e0d94 input=e1f81d4fcfd26497]*/
+{
+ Py_complex y;
+
+ errno = 0;
+ x = c_log(x);
+ if (y_obj != NULL) {
+ y = PyComplex_AsCComplex(y_obj);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ y = c_log(y);
+ x = _Py_c_quot(x, y);
+ }
+ if (errno != 0)
+ return math_error();
+ return PyComplex_FromCComplex(x);
+}
+
+
+/* And now the glue to make them available from Python: */
+
+static PyObject *
+math_error(void)
+{
+ if (errno == EDOM)
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+ else if (errno == ERANGE)
+ PyErr_SetString(PyExc_OverflowError, "math range error");
+ else /* Unexpected math error */
+ PyErr_SetFromErrno(PyExc_ValueError);
+ return NULL;
+}
+
+
+/*[clinic input]
+cmath.phase
+
+ z: Py_complex
+ /
+
+Return argument, also known as the phase angle, of a complex.
+[clinic start generated code]*/
+
+static PyObject *
+cmath_phase_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=50725086a7bfd253 input=5cf75228ba94b69d]*/
+{
+ double phi;
+
+ errno = 0;
+ phi = c_atan2(z); /* should not cause any exception */
+ if (errno != 0)
+ return math_error();
+ else
+ return PyFloat_FromDouble(phi);
+}
+
+/*[clinic input]
+cmath.polar
+
+ z: Py_complex
+ /
+
+Convert a complex from rectangular coordinates to polar coordinates.
+
+r is the distance from 0 and phi the phase angle.
+[clinic start generated code]*/
+
+static PyObject *
+cmath_polar_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=d0a8147c41dbb654 input=26c353574fd1a861]*/
+{
+ double r, phi;
+
+ errno = 0;
+ phi = c_atan2(z); /* should not cause any exception */
+ r = _Py_c_abs(z); /* sets errno to ERANGE on overflow */
+ if (errno != 0)
+ return math_error();
+ else
+ return Py_BuildValue("dd", r, phi);
+}
+
+/*
+ rect() isn't covered by the C99 standard, but it's not too hard to
+ figure out 'spirit of C99' rules for special value handing:
+
+ rect(x, t) should behave like exp(log(x) + it) for positive-signed x
+ rect(x, t) should behave like -exp(log(-x) + it) for negative-signed x
+ rect(nan, t) should behave like exp(nan + it), except that rect(nan, 0)
+ gives nan +- i0 with the sign of the imaginary part unspecified.
+
+*/
+
+static Py_complex rect_special_values[7][7];
+
+/*[clinic input]
+cmath.rect
+
+ r: double
+ phi: double
+ /
+
+Convert from polar coordinates to rectangular coordinates.
+[clinic start generated code]*/
+
+static PyObject *
+cmath_rect_impl(PyObject *module, double r, double phi)
+/*[clinic end generated code: output=385a0690925df2d5 input=24c5646d147efd69]*/
+{
+ Py_complex z;
+ errno = 0;
+
+ /* deal with special values */
+ if (!Py_IS_FINITE(r) || !Py_IS_FINITE(phi)) {
+ /* if r is +/-infinity and phi is finite but nonzero then
+ result is (+-INF +-INF i), but we need to compute cos(phi)
+ and sin(phi) to figure out the signs. */
+ if (Py_IS_INFINITY(r) && (Py_IS_FINITE(phi)
+ && (phi != 0.))) {
+ if (r > 0) {
+ z.real = copysign(INF, cos(phi));
+ z.imag = copysign(INF, sin(phi));
+ }
+ else {
+ z.real = -copysign(INF, cos(phi));
+ z.imag = -copysign(INF, sin(phi));
+ }
+ }
+ else {
+ z = rect_special_values[special_type(r)]
+ [special_type(phi)];
+ }
+ /* need to set errno = EDOM if r is a nonzero number and phi
+ is infinite */
+ if (r != 0. && !Py_IS_NAN(r) && Py_IS_INFINITY(phi))
+ errno = EDOM;
+ else
+ errno = 0;
+ }
+ else if (phi == 0.0) {
+ /* Workaround for buggy results with phi=-0.0 on OS X 10.8. See
+ bugs.python.org/issue18513. */
+ z.real = r;
+ z.imag = r * phi;
+ errno = 0;
+ }
+ else {
+ z.real = r * cos(phi);
+ z.imag = r * sin(phi);
+ errno = 0;
+ }
+
+ if (errno != 0)
+ return math_error();
+ else
+ return PyComplex_FromCComplex(z);
+}
+
+/*[clinic input]
+cmath.isfinite = cmath.polar
+
+Return True if both the real and imaginary parts of z are finite, else False.
+[clinic start generated code]*/
+
+static PyObject *
+cmath_isfinite_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=ac76611e2c774a36 input=848e7ee701895815]*/
+{
+ return PyBool_FromLong(Py_IS_FINITE(z.real) && Py_IS_FINITE(z.imag));
+}
+
+/*[clinic input]
+cmath.isnan = cmath.polar
+
+Checks if the real or imaginary part of z not a number (NaN).
+[clinic start generated code]*/
+
+static PyObject *
+cmath_isnan_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=e7abf6e0b28beab7 input=71799f5d284c9baf]*/
+{
+ return PyBool_FromLong(Py_IS_NAN(z.real) || Py_IS_NAN(z.imag));
+}
+
+/*[clinic input]
+cmath.isinf = cmath.polar
+
+Checks if the real or imaginary part of z is infinite.
+[clinic start generated code]*/
+
+static PyObject *
+cmath_isinf_impl(PyObject *module, Py_complex z)
+/*[clinic end generated code: output=502a75a79c773469 input=363df155c7181329]*/
+{
+ return PyBool_FromLong(Py_IS_INFINITY(z.real) ||
+ Py_IS_INFINITY(z.imag));
+}
+
+/*[clinic input]
+cmath.isclose -> bool
+
+ a: Py_complex
+ b: Py_complex
+ *
+ rel_tol: double = 1e-09
+ maximum difference for being considered "close", relative to the
+ magnitude of the input values
+ abs_tol: double = 0.0
+ maximum difference for being considered "close", regardless of the
+ magnitude of the input values
+
+Determine whether two complex numbers are close in value.
+
+Return True if a is close in value to b, and False otherwise.
+
+For the values to be considered close, the difference between them must be
+smaller than at least one of the tolerances.
+
+-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is
+not close to anything, even itself. inf and -inf are only close to themselves.
+[clinic start generated code]*/
+
+static int
+cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
+ double rel_tol, double abs_tol)
+/*[clinic end generated code: output=8a2486cc6e0014d1 input=df9636d7de1d4ac3]*/
+{
+ double diff;
+
+ /* sanity check on the inputs */
+ if (rel_tol < 0.0 || abs_tol < 0.0 ) {
+ PyErr_SetString(PyExc_ValueError,
+ "tolerances must be non-negative");
+ return -1;
+ }
+
+ if ( (a.real == b.real) && (a.imag == b.imag) ) {
+ /* short circuit exact equality -- needed to catch two infinities of
+ the same sign. And perhaps speeds things up a bit sometimes.
+ */
+ return 1;
+ }
+
+ /* This catches the case of two infinities of opposite sign, or
+ one infinity and one finite number. Two infinities of opposite
+ sign would otherwise have an infinite relative tolerance.
+ Two infinities of the same sign are caught by the equality check
+ above.
+ */
+
+ if (Py_IS_INFINITY(a.real) || Py_IS_INFINITY(a.imag) ||
+ Py_IS_INFINITY(b.real) || Py_IS_INFINITY(b.imag)) {
+ return 0;
+ }
+
+ /* now do the regular computation
+ this is essentially the "weak" test from the Boost library
+ */
+
+ diff = _Py_c_abs(_Py_c_diff(a, b));
+
+ return (((diff <= rel_tol * _Py_c_abs(b)) ||
+ (diff <= rel_tol * _Py_c_abs(a))) ||
+ (diff <= abs_tol));
+}
+
+PyDoc_STRVAR(module_doc,
+"This module provides access to mathematical functions for complex\n"
+"numbers.");
+
+static PyMethodDef cmath_methods[] = {
+ CMATH_ACOS_METHODDEF
+ CMATH_ACOSH_METHODDEF
+ CMATH_ASIN_METHODDEF
+ CMATH_ASINH_METHODDEF
+ CMATH_ATAN_METHODDEF
+ CMATH_ATANH_METHODDEF
+ CMATH_COS_METHODDEF
+ CMATH_COSH_METHODDEF
+ CMATH_EXP_METHODDEF
+ CMATH_ISCLOSE_METHODDEF
+ CMATH_ISFINITE_METHODDEF
+ CMATH_ISINF_METHODDEF
+ CMATH_ISNAN_METHODDEF
+ CMATH_LOG_METHODDEF
+ CMATH_LOG10_METHODDEF
+ CMATH_PHASE_METHODDEF
+ CMATH_POLAR_METHODDEF
+ CMATH_RECT_METHODDEF
+ CMATH_SIN_METHODDEF
+ CMATH_SINH_METHODDEF
+ CMATH_SQRT_METHODDEF
+ CMATH_TAN_METHODDEF
+ CMATH_TANH_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+cmath_exec(PyObject *mod)
+{
+ if (_PyModule_Add(mod, "pi", PyFloat_FromDouble(Py_MATH_PI)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(mod, "e", PyFloat_FromDouble(Py_MATH_E)) < 0) {
+ return -1;
+ }
+ // 2pi
+ if (_PyModule_Add(mod, "tau", PyFloat_FromDouble(Py_MATH_TAU)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(mod, "inf", PyFloat_FromDouble(Py_INFINITY)) < 0) {
+ return -1;
+ }
+
+ Py_complex infj = {0.0, Py_INFINITY};
+ if (_PyModule_Add(mod, "infj", PyComplex_FromCComplex(infj)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(mod, "nan", PyFloat_FromDouble(fabs(Py_NAN))) < 0) {
+ return -1;
+ }
+ Py_complex nanj = {0.0, fabs(Py_NAN)};
+ if (_PyModule_Add(mod, "nanj", PyComplex_FromCComplex(nanj)) < 0) {
+ return -1;
+ }
+
+ /* initialize special value tables */
+
+#define INIT_SPECIAL_VALUES(NAME, BODY) { Py_complex* p = (Py_complex*)NAME; BODY }
+#define C(REAL, IMAG) p->real = REAL; p->imag = IMAG; ++p;
+
+ INIT_SPECIAL_VALUES(acos_special_values, {
+ C(P34,INF) C(P,INF) C(P,INF) C(P,-INF) C(P,-INF) C(P34,-INF) C(N,INF)
+ C(P12,INF) C(U,U) C(U,U) C(U,U) C(U,U) C(P12,-INF) C(N,N)
+ C(P12,INF) C(U,U) C(P12,0.) C(P12,-0.) C(U,U) C(P12,-INF) C(P12,N)
+ C(P12,INF) C(U,U) C(P12,0.) C(P12,-0.) C(U,U) C(P12,-INF) C(P12,N)
+ C(P12,INF) C(U,U) C(U,U) C(U,U) C(U,U) C(P12,-INF) C(N,N)
+ C(P14,INF) C(0.,INF) C(0.,INF) C(0.,-INF) C(0.,-INF) C(P14,-INF) C(N,INF)
+ C(N,INF) C(N,N) C(N,N) C(N,N) C(N,N) C(N,-INF) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(acosh_special_values, {
+ C(INF,-P34) C(INF,-P) C(INF,-P) C(INF,P) C(INF,P) C(INF,P34) C(INF,N)
+ C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(0.,-P12) C(0.,P12) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(0.,-P12) C(0.,P12) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P14) C(INF,-0.) C(INF,-0.) C(INF,0.) C(INF,0.) C(INF,P14) C(INF,N)
+ C(INF,N) C(N,N) C(N,N) C(N,N) C(N,N) C(INF,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(asinh_special_values, {
+ C(-INF,-P14) C(-INF,-0.) C(-INF,-0.) C(-INF,0.) C(-INF,0.) C(-INF,P14) C(-INF,N)
+ C(-INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(-INF,P12) C(N,N)
+ C(-INF,-P12) C(U,U) C(-0.,-0.) C(-0.,0.) C(U,U) C(-INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P14) C(INF,-0.) C(INF,-0.) C(INF,0.) C(INF,0.) C(INF,P14) C(INF,N)
+ C(INF,N) C(N,N) C(N,-0.) C(N,0.) C(N,N) C(INF,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(atanh_special_values, {
+ C(-0.,-P12) C(-0.,-P12) C(-0.,-P12) C(-0.,P12) C(-0.,P12) C(-0.,P12) C(-0.,N)
+ C(-0.,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(-0.,P12) C(N,N)
+ C(-0.,-P12) C(U,U) C(-0.,-0.) C(-0.,0.) C(U,U) C(-0.,P12) C(-0.,N)
+ C(0.,-P12) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(0.,P12) C(0.,N)
+ C(0.,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(0.,P12) C(N,N)
+ C(0.,-P12) C(0.,-P12) C(0.,-P12) C(0.,P12) C(0.,P12) C(0.,P12) C(0.,N)
+ C(0.,-P12) C(N,N) C(N,N) C(N,N) C(N,N) C(0.,P12) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(cosh_special_values, {
+ C(INF,N) C(U,U) C(INF,0.) C(INF,-0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(N,0.) C(U,U) C(1.,0.) C(1.,-0.) C(U,U) C(N,0.) C(N,0.)
+ C(N,0.) C(U,U) C(1.,-0.) C(1.,0.) C(U,U) C(N,0.) C(N,0.)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(INF,N) C(U,U) C(INF,-0.) C(INF,0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(N,N) C(N,0.) C(N,0.) C(N,N) C(N,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(exp_special_values, {
+ C(0.,0.) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(0.,0.) C(0.,0.)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(N,N) C(U,U) C(1.,-0.) C(1.,0.) C(U,U) C(N,N) C(N,N)
+ C(N,N) C(U,U) C(1.,-0.) C(1.,0.) C(U,U) C(N,N) C(N,N)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(INF,N) C(U,U) C(INF,-0.) C(INF,0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(N,N) C(N,-0.) C(N,0.) C(N,N) C(N,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(log_special_values, {
+ C(INF,-P34) C(INF,-P) C(INF,-P) C(INF,P) C(INF,P) C(INF,P34) C(INF,N)
+ C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(-INF,-P) C(-INF,P) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(-INF,-0.) C(-INF,0.) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
+ C(INF,-P14) C(INF,-0.) C(INF,-0.) C(INF,0.) C(INF,0.) C(INF,P14) C(INF,N)
+ C(INF,N) C(N,N) C(N,N) C(N,N) C(N,N) C(INF,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(sinh_special_values, {
+ C(INF,N) C(U,U) C(-INF,-0.) C(-INF,0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(0.,N) C(U,U) C(-0.,-0.) C(-0.,0.) C(U,U) C(0.,N) C(0.,N)
+ C(0.,N) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(0.,N) C(0.,N)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(INF,N) C(U,U) C(INF,-0.) C(INF,0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(N,N) C(N,-0.) C(N,0.) C(N,N) C(N,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(sqrt_special_values, {
+ C(INF,-INF) C(0.,-INF) C(0.,-INF) C(0.,INF) C(0.,INF) C(INF,INF) C(N,INF)
+ C(INF,-INF) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,INF) C(N,N)
+ C(INF,-INF) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(INF,INF) C(N,N)
+ C(INF,-INF) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(INF,INF) C(N,N)
+ C(INF,-INF) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,INF) C(N,N)
+ C(INF,-INF) C(INF,-0.) C(INF,-0.) C(INF,0.) C(INF,0.) C(INF,INF) C(INF,N)
+ C(INF,-INF) C(N,N) C(N,N) C(N,N) C(N,N) C(INF,INF) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(tanh_special_values, {
+ C(-1.,0.) C(U,U) C(-1.,-0.) C(-1.,0.) C(U,U) C(-1.,0.) C(-1.,0.)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(N,N) C(U,U) C(-0.,-0.) C(-0.,0.) C(U,U) C(N,N) C(N,N)
+ C(N,N) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(N,N) C(N,N)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(1.,0.) C(U,U) C(1.,-0.) C(1.,0.) C(U,U) C(1.,0.) C(1.,0.)
+ C(N,N) C(N,N) C(N,-0.) C(N,0.) C(N,N) C(N,N) C(N,N)
+ })
+
+ INIT_SPECIAL_VALUES(rect_special_values, {
+ C(INF,N) C(U,U) C(-INF,0.) C(-INF,-0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(0.,0.) C(U,U) C(-0.,0.) C(-0.,-0.) C(U,U) C(0.,0.) C(0.,0.)
+ C(0.,0.) C(U,U) C(0.,-0.) C(0.,0.) C(U,U) C(0.,0.) C(0.,0.)
+ C(N,N) C(U,U) C(U,U) C(U,U) C(U,U) C(N,N) C(N,N)
+ C(INF,N) C(U,U) C(INF,-0.) C(INF,0.) C(U,U) C(INF,N) C(INF,N)
+ C(N,N) C(N,N) C(N,0.) C(N,0.) C(N,N) C(N,N) C(N,N)
+ })
+ return 0;
+}
+
+static PyModuleDef_Slot cmath_slots[] = {
+ {Py_mod_exec, cmath_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef cmathmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "cmath",
+ .m_doc = module_doc,
+ .m_size = 0,
+ .m_methods = cmath_methods,
+ .m_slots = cmath_slots
+};
+
+PyMODINIT_FUNC
+PyInit_cmath(void)
+{
+ return PyModuleDef_Init(&cmathmodule);
+}
diff --git a/contrib/tools/python3/Modules/config.c b/contrib/tools/python3/Modules/config.c
new file mode 100644
index 00000000000..b2303e511c5
--- /dev/null
+++ b/contrib/tools/python3/Modules/config.c
@@ -0,0 +1,315 @@
+/* -*- C -*- ***********************************************
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+******************************************************************/
+
+/* Module configuration */
+
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
+
+/* This file contains the table of built-in modules.
+ See create_builtin() in import.c. */
+
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern PyObject* PyInit__abc(void); // _abc
+extern PyObject* PyInit__asyncio(void); // _asyncio
+extern PyObject* PyInit__bisect(void); // _bisect
+extern PyObject* PyInit__blake2(void); // _blake2
+extern PyObject* PyInit__bz2(void); // _bz2
+extern PyObject* PyInit__codecs(void); // _codecs
+extern PyObject* PyInit__codecs_cn(void); // _codecs_cn
+extern PyObject* PyInit__codecs_hk(void); // _codecs_hk
+extern PyObject* PyInit__codecs_iso2022(void); // _codecs_iso2022
+extern PyObject* PyInit__codecs_jp(void); // _codecs_jp
+extern PyObject* PyInit__codecs_kr(void); // _codecs_kr
+extern PyObject* PyInit__codecs_tw(void); // _codecs_tw
+extern PyObject* PyInit__collections(void); // _collections
+extern PyObject* PyInit__contextvars(void); // _contextvars
+#if !defined(_MSC_VER)
+extern PyObject* PyInit__crypt(void); // _crypt
+#endif
+extern PyObject* PyInit__csv(void); // _csv
+extern PyObject* PyInit__ctypes(void); // _ctypes
+extern PyObject* PyInit__datetime(void); // _datetime
+extern PyObject* PyInit__decimal(void); // _decimal
+extern PyObject* PyInit__elementtree(void); // _elementtree
+extern PyObject* PyInit__functools(void); // _functools
+extern PyObject* PyInit__hashlib(void); // _hashlib
+extern PyObject* PyInit__heapq(void); // _heapq
+extern PyObject* PyInit__imp(void); // _imp
+extern PyObject* PyInit__io(void); // _io
+extern PyObject* PyInit__json(void); // _json
+extern PyObject* PyInit__locale(void); // _locale
+extern PyObject* PyInit__lsprof(void); // _lsprof
+extern PyObject* PyInit__lzma(void); // _lzma
+extern PyObject* PyInit__md5(void); // _md5
+extern PyObject* PyInit__multibytecodec(void); // _multibytecodec
+extern PyObject* PyInit__multiprocessing(void); // _multiprocessing
+extern PyObject* PyInit__opcode(void); // _opcode
+extern PyObject* PyInit__operator(void); // _operator
+extern PyObject* PyInit__pickle(void); // _pickle
+extern PyObject* PyInit__posixshmem(void); // _posixshmem
+#if !defined(_MSC_VER)
+extern PyObject* PyInit__posixsubprocess(void); // _posixsubprocess
+#endif
+extern PyObject* PyInit__queue(void); // _queue
+extern PyObject* PyInit__random(void); // _random
+extern PyObject* PyInit__sha1(void); // _sha1
+extern PyObject* PyInit__sha2(void); // _sha2
+extern PyObject* PyInit__sha3(void); // _sha3
+extern PyObject* PyInit__signal(void); // _signal
+extern PyObject* PyInit__socket(void); // _socket
+extern PyObject* PyInit__sre(void); // _sre
+extern PyObject* PyInit__ssl(void); // _ssl
+extern PyObject* PyInit__stat(void); // _stat
+extern PyObject* PyInit__statistics(void); // _statistics
+extern PyObject* PyInit__string(void); // _string
+extern PyObject* PyInit__struct(void); // _struct
+extern PyObject* PyInit__symtable(void); // _symtable
+extern PyObject* PyInit__thread(void); // _thread
+extern PyObject* PyInit__tracemalloc(void); // _tracemalloc
+extern PyObject* PyInit__typing(void); // _typing
+extern PyObject* PyInit__weakref(void); // _weakref
+extern PyObject* PyInit__xxinterpchannels(void); // _xxinterpchannels
+extern PyObject* PyInit__xxsubinterpreters(void); // _xxsubinterpreters
+extern PyObject* PyInit__xxtestfuzz(void); // _xxtestfuzz
+extern PyObject* PyInit__zoneinfo(void); // _zoneinfo
+extern PyObject* PyInit_array(void); // array
+extern PyObject* PyInit_atexit(void); // atexit
+extern PyObject* PyInit_audioop(void); // audioop
+extern PyObject* PyInit_binascii(void); // binascii
+extern PyObject* PyInit_cmath(void); // cmath
+extern PyObject* PyInit_errno(void); // errno
+extern PyObject* PyInit_faulthandler(void); // faulthandler
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_fcntl(void); // fcntl
+#endif
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_grp(void); // grp
+#endif
+extern PyObject* PyInit_itertools(void); // itertools
+extern PyObject* PyInit_math(void); // math
+extern PyObject* PyInit_mmap(void); // mmap
+#if defined(_MSC_VER)
+extern PyObject* PyInit_nt(void); // nt
+#endif
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_posix(void); // posix
+#endif
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_pwd(void); // pwd
+#endif
+extern PyObject* PyInit_pyexpat(void); // pyexpat
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_resource(void); // resource
+#endif
+extern PyObject* PyInit_select(void); // select
+#if defined(__linux__)
+extern PyObject* PyInit_spwd(void); // spwd
+#endif
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_syslog(void); // syslog
+#endif
+#if !defined(_MSC_VER)
+extern PyObject* PyInit_termios(void); // termios
+#endif
+extern PyObject* PyInit_time(void); // time
+extern PyObject* PyInit_unicodedata(void); // unicodedata
+extern PyObject* PyInit_zlib(void); // zlib
+#if defined(__APPLE__)
+extern PyObject* PyInit__scproxy(void); // _scproxy
+#endif
+#if defined(_MSC_VER)
+extern PyObject* PyInit__overlapped(void); // _overlapped
+#endif
+#if defined(_MSC_VER)
+extern PyObject* PyInit__winapi(void); // _winapi
+#endif
+#if defined(_MSC_VER)
+extern PyObject* PyInit_msvcrt(void); // msvcrt
+#endif
+#if defined(_MSC_VER)
+extern PyObject* PyInit_winreg(void); // winreg
+#endif
+#if defined(_MSC_VER)
+extern PyObject* PyInit_winsound(void); // winsound
+#endif
+
+extern PyObject* PyMarshal_Init(void);
+extern PyObject* PyInit__imp(void);
+extern PyObject* PyInit_gc(void);
+extern PyObject* PyInit__ast(void);
+extern PyObject* PyInit__tokenize(void);
+extern PyObject* _PyWarnings_Init(void);
+extern PyObject* PyInit__string(void);
+
+struct _inittab _PyImport_Inittab[] = {
+
+ {"_abc", PyInit__abc},
+ {"_asyncio", PyInit__asyncio},
+ {"_bisect", PyInit__bisect},
+ {"_blake2", PyInit__blake2},
+ {"_bz2", PyInit__bz2},
+ {"_codecs", PyInit__codecs},
+ {"_codecs_cn", PyInit__codecs_cn},
+ {"_codecs_hk", PyInit__codecs_hk},
+ {"_codecs_iso2022", PyInit__codecs_iso2022},
+ {"_codecs_jp", PyInit__codecs_jp},
+ {"_codecs_kr", PyInit__codecs_kr},
+ {"_codecs_tw", PyInit__codecs_tw},
+ {"_collections", PyInit__collections},
+ {"_contextvars", PyInit__contextvars},
+#if !defined(_MSC_VER)
+ {"_crypt", PyInit__crypt},
+#endif
+ {"_csv", PyInit__csv},
+ {"_ctypes", PyInit__ctypes},
+ {"_datetime", PyInit__datetime},
+ {"_decimal", PyInit__decimal},
+ {"_elementtree", PyInit__elementtree},
+ {"_functools", PyInit__functools},
+ {"_hashlib", PyInit__hashlib},
+ {"_heapq", PyInit__heapq},
+ {"_imp", PyInit__imp},
+ {"_io", PyInit__io},
+ {"_json", PyInit__json},
+ {"_locale", PyInit__locale},
+ {"_lsprof", PyInit__lsprof},
+ {"_lzma", PyInit__lzma},
+ {"_md5", PyInit__md5},
+ {"_multibytecodec", PyInit__multibytecodec},
+ {"_multiprocessing", PyInit__multiprocessing},
+ {"_opcode", PyInit__opcode},
+ {"_operator", PyInit__operator},
+ {"_pickle", PyInit__pickle},
+ {"_posixshmem", PyInit__posixshmem},
+#if !defined(_MSC_VER)
+ {"_posixsubprocess", PyInit__posixsubprocess},
+#endif
+ {"_queue", PyInit__queue},
+ {"_random", PyInit__random},
+ {"_sha1", PyInit__sha1},
+ {"_sha2", PyInit__sha2},
+ {"_sha3", PyInit__sha3},
+ {"_signal", PyInit__signal},
+ {"_socket", PyInit__socket},
+ {"_sre", PyInit__sre},
+ {"_ssl", PyInit__ssl},
+ {"_stat", PyInit__stat},
+ {"_statistics", PyInit__statistics},
+ {"_string", PyInit__string},
+ {"_struct", PyInit__struct},
+ {"_symtable", PyInit__symtable},
+ {"_thread", PyInit__thread},
+ {"_tracemalloc", PyInit__tracemalloc},
+ {"_typing", PyInit__typing},
+ {"_weakref", PyInit__weakref},
+ {"_xxinterpchannels", PyInit__xxinterpchannels},
+ {"_xxsubinterpreters", PyInit__xxsubinterpreters},
+ {"_xxtestfuzz", PyInit__xxtestfuzz},
+ {"_zoneinfo", PyInit__zoneinfo},
+ {"array", PyInit_array},
+ {"atexit", PyInit_atexit},
+ {"audioop", PyInit_audioop},
+ {"binascii", PyInit_binascii},
+ {"cmath", PyInit_cmath},
+ {"errno", PyInit_errno},
+ {"faulthandler", PyInit_faulthandler},
+#if !defined(_MSC_VER)
+ {"fcntl", PyInit_fcntl},
+#endif
+#if !defined(_MSC_VER)
+ {"grp", PyInit_grp},
+#endif
+ {"itertools", PyInit_itertools},
+ {"math", PyInit_math},
+ {"mmap", PyInit_mmap},
+#if defined(_MSC_VER)
+ {"nt", PyInit_nt},
+#endif
+#if !defined(_MSC_VER)
+ {"posix", PyInit_posix},
+#endif
+#if !defined(_MSC_VER)
+ {"pwd", PyInit_pwd},
+#endif
+ {"pyexpat", PyInit_pyexpat},
+#if !defined(_MSC_VER)
+ {"resource", PyInit_resource},
+#endif
+ {"select", PyInit_select},
+#if defined(__linux__)
+ {"spwd", PyInit_spwd},
+#endif
+#if !defined(_MSC_VER)
+ {"syslog", PyInit_syslog},
+#endif
+#if !defined(_MSC_VER)
+ {"termios", PyInit_termios},
+#endif
+ {"time", PyInit_time},
+ {"unicodedata", PyInit_unicodedata},
+ {"zlib", PyInit_zlib},
+#if defined(__APPLE__)
+ {"_scproxy", PyInit__scproxy},
+#endif
+#if defined(_MSC_VER)
+ {"_overlapped", PyInit__overlapped},
+#endif
+#if defined(_MSC_VER)
+ {"_winapi", PyInit__winapi},
+#endif
+#if defined(_MSC_VER)
+ {"msvcrt", PyInit_msvcrt},
+#endif
+#if defined(_MSC_VER)
+ {"winreg", PyInit_winreg},
+#endif
+#if defined(_MSC_VER)
+ {"winsound", PyInit_winsound},
+#endif
+
+ /* This module lives in marshal.c */
+ {"marshal", PyMarshal_Init},
+
+ /* This lives in import.c */
+ {"_imp", PyInit__imp},
+
+ /* This lives in Python/Python-ast.c */
+ {"_ast", PyInit__ast},
+
+ /* This lives in Python/Python-tokenizer.c */
+ {"_tokenize", PyInit__tokenize},
+
+ /* These entries are here for sys.builtin_module_names */
+ {"builtins", NULL},
+ {"sys", NULL},
+
+ /* This lives in gcmodule.c */
+ {"gc", PyInit_gc},
+
+ /* This lives in _warnings.c */
+ {"_warnings", _PyWarnings_Init},
+
+ /* This lives in Objects/unicodeobject.c */
+ {"_string", PyInit__string},
+
+ /* Sentinel */
+ {0, 0}
+};
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/tools/python3/Modules/errnomodule.c b/contrib/tools/python3/Modules/errnomodule.c
new file mode 100644
index 00000000000..301ad8313bc
--- /dev/null
+++ b/contrib/tools/python3/Modules/errnomodule.c
@@ -0,0 +1,977 @@
+
+/* Errno module */
+
+#include "Python.h"
+
+/* Windows socket errors (WSA*) */
+#ifdef MS_WINDOWS
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+/* The following constants were added to errno.h in VS2010 but have
+ preferred WSA equivalents. */
+#undef EADDRINUSE
+#undef EADDRNOTAVAIL
+#undef EAFNOSUPPORT
+#undef EALREADY
+#undef ECONNABORTED
+#undef ECONNREFUSED
+#undef ECONNRESET
+#undef EDESTADDRREQ
+#undef EHOSTUNREACH
+#undef EINPROGRESS
+#undef EISCONN
+#undef ELOOP
+#undef EMSGSIZE
+#undef ENETDOWN
+#undef ENETRESET
+#undef ENETUNREACH
+#undef ENOBUFS
+#undef ENOPROTOOPT
+#undef ENOTCONN
+#undef ENOTSOCK
+#undef EOPNOTSUPP
+#undef EPROTONOSUPPORT
+#undef EPROTOTYPE
+#undef ETIMEDOUT
+#undef EWOULDBLOCK
+#endif
+
+/*
+ * Pull in the system error definitions
+ */
+
+static PyMethodDef errno_methods[] = {
+ {NULL, NULL}
+};
+
+/* Helper function doing the dictionary inserting */
+
+static int
+_add_errcode(PyObject *module_dict, PyObject *error_dict, const char *name_str, int code_int)
+{
+ PyObject *name = PyUnicode_FromString(name_str);
+ if (!name) {
+ return -1;
+ }
+
+ PyObject *code = PyLong_FromLong(code_int);
+ if (!code) {
+ Py_DECREF(name);
+ return -1;
+ }
+
+ int ret = -1;
+ /* insert in modules dict */
+ if (PyDict_SetItem(module_dict, name, code) < 0) {
+ goto end;
+ }
+ /* insert in errorcode dict */
+ if (PyDict_SetItem(error_dict, code, name) < 0) {
+ goto end;
+ }
+ ret = 0;
+end:
+ Py_DECREF(name);
+ Py_DECREF(code);
+ return ret;
+}
+
+static int
+errno_exec(PyObject *module)
+{
+ PyObject *module_dict = PyModule_GetDict(module); // Borrowed ref.
+ if (module_dict == NULL) {
+ return -1;
+ }
+ PyObject *error_dict = PyDict_New();
+ if (error_dict == NULL) {
+ return -1;
+ }
+ if (PyDict_SetItemString(module_dict, "errorcode", error_dict) < 0) {
+ Py_DECREF(error_dict);
+ return -1;
+ }
+
+/* Macro so I don't have to edit each and every line below... */
+#define add_errcode(name, code, comment) \
+ do { \
+ if (_add_errcode(module_dict, error_dict, name, code) < 0) { \
+ Py_DECREF(error_dict); \
+ return -1; \
+ } \
+ } while (0);
+
+ /*
+ * The names and comments are borrowed from linux/include/errno.h,
+ * which should be pretty all-inclusive. However, the Solaris specific
+ * names and comments are borrowed from sys/errno.h in Solaris.
+ * MacOSX specific names and comments are borrowed from sys/errno.h in
+ * MacOSX.
+ */
+
+#ifdef ENODEV
+ add_errcode("ENODEV", ENODEV, "No such device");
+#endif
+#ifdef ENOCSI
+ add_errcode("ENOCSI", ENOCSI, "No CSI structure available");
+#endif
+#ifdef EHOSTUNREACH
+ add_errcode("EHOSTUNREACH", EHOSTUNREACH, "No route to host");
+#else
+#ifdef WSAEHOSTUNREACH
+ add_errcode("EHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
+#endif
+#endif
+#ifdef ENOMSG
+ add_errcode("ENOMSG", ENOMSG, "No message of desired type");
+#endif
+#ifdef EUCLEAN
+ add_errcode("EUCLEAN", EUCLEAN, "Structure needs cleaning");
+#endif
+#ifdef EL2NSYNC
+ add_errcode("EL2NSYNC", EL2NSYNC, "Level 2 not synchronized");
+#endif
+#ifdef EL2HLT
+ add_errcode("EL2HLT", EL2HLT, "Level 2 halted");
+#endif
+#ifdef ENODATA
+ add_errcode("ENODATA", ENODATA, "No data available");
+#endif
+#ifdef ENOTBLK
+ add_errcode("ENOTBLK", ENOTBLK, "Block device required");
+#endif
+#ifdef ENOSYS
+ add_errcode("ENOSYS", ENOSYS, "Function not implemented");
+#endif
+#ifdef EPIPE
+ add_errcode("EPIPE", EPIPE, "Broken pipe");
+#endif
+#ifdef EINVAL
+ add_errcode("EINVAL", EINVAL, "Invalid argument");
+#else
+#ifdef WSAEINVAL
+ add_errcode("EINVAL", WSAEINVAL, "Invalid argument");
+#endif
+#endif
+#ifdef EOVERFLOW
+ add_errcode("EOVERFLOW", EOVERFLOW, "Value too large for defined data type");
+#endif
+#ifdef EADV
+ add_errcode("EADV", EADV, "Advertise error");
+#endif
+#ifdef EINTR
+ add_errcode("EINTR", EINTR, "Interrupted system call");
+#else
+#ifdef WSAEINTR
+ add_errcode("EINTR", WSAEINTR, "Interrupted system call");
+#endif
+#endif
+#ifdef EUSERS
+ add_errcode("EUSERS", EUSERS, "Too many users");
+#else
+#ifdef WSAEUSERS
+ add_errcode("EUSERS", WSAEUSERS, "Too many users");
+#endif
+#endif
+#ifdef ENOTEMPTY
+ add_errcode("ENOTEMPTY", ENOTEMPTY, "Directory not empty");
+#else
+#ifdef WSAENOTEMPTY
+ add_errcode("ENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
+#endif
+#endif
+#ifdef ENOBUFS
+ add_errcode("ENOBUFS", ENOBUFS, "No buffer space available");
+#else
+#ifdef WSAENOBUFS
+ add_errcode("ENOBUFS", WSAENOBUFS, "No buffer space available");
+#endif
+#endif
+#ifdef EPROTO
+ add_errcode("EPROTO", EPROTO, "Protocol error");
+#endif
+#ifdef EREMOTE
+ add_errcode("EREMOTE", EREMOTE, "Object is remote");
+#else
+#ifdef WSAEREMOTE
+ add_errcode("EREMOTE", WSAEREMOTE, "Object is remote");
+#endif
+#endif
+#ifdef ENAVAIL
+ add_errcode("ENAVAIL", ENAVAIL, "No XENIX semaphores available");
+#endif
+#ifdef ECHILD
+ add_errcode("ECHILD", ECHILD, "No child processes");
+#endif
+#ifdef ELOOP
+ add_errcode("ELOOP", ELOOP, "Too many symbolic links encountered");
+#else
+#ifdef WSAELOOP
+ add_errcode("ELOOP", WSAELOOP, "Too many symbolic links encountered");
+#endif
+#endif
+#ifdef EXDEV
+ add_errcode("EXDEV", EXDEV, "Cross-device link");
+#endif
+#ifdef E2BIG
+ add_errcode("E2BIG", E2BIG, "Arg list too long");
+#endif
+#ifdef ESRCH
+ add_errcode("ESRCH", ESRCH, "No such process");
+#endif
+#ifdef EMSGSIZE
+ add_errcode("EMSGSIZE", EMSGSIZE, "Message too long");
+#else
+#ifdef WSAEMSGSIZE
+ add_errcode("EMSGSIZE", WSAEMSGSIZE, "Message too long");
+#endif
+#endif
+#ifdef EAFNOSUPPORT
+ add_errcode("EAFNOSUPPORT", EAFNOSUPPORT, "Address family not supported by protocol");
+#else
+#ifdef WSAEAFNOSUPPORT
+ add_errcode("EAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
+#endif
+#endif
+#ifdef EBADR
+ add_errcode("EBADR", EBADR, "Invalid request descriptor");
+#endif
+#ifdef EHOSTDOWN
+ add_errcode("EHOSTDOWN", EHOSTDOWN, "Host is down");
+#else
+#ifdef WSAEHOSTDOWN
+ add_errcode("EHOSTDOWN", WSAEHOSTDOWN, "Host is down");
+#endif
+#endif
+#ifdef EPFNOSUPPORT
+ add_errcode("EPFNOSUPPORT", EPFNOSUPPORT, "Protocol family not supported");
+#else
+#ifdef WSAEPFNOSUPPORT
+ add_errcode("EPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
+#endif
+#endif
+#ifdef ENOPROTOOPT
+ add_errcode("ENOPROTOOPT", ENOPROTOOPT, "Protocol not available");
+#else
+#ifdef WSAENOPROTOOPT
+ add_errcode("ENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
+#endif
+#endif
+#ifdef EBUSY
+ add_errcode("EBUSY", EBUSY, "Device or resource busy");
+#endif
+#ifdef EWOULDBLOCK
+ add_errcode("EWOULDBLOCK", EWOULDBLOCK, "Operation would block");
+#else
+#ifdef WSAEWOULDBLOCK
+ add_errcode("EWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
+#endif
+#endif
+#ifdef EBADFD
+ add_errcode("EBADFD", EBADFD, "File descriptor in bad state");
+#endif
+#ifdef EDOTDOT
+ add_errcode("EDOTDOT", EDOTDOT, "RFS specific error");
+#endif
+#ifdef EISCONN
+ add_errcode("EISCONN", EISCONN, "Transport endpoint is already connected");
+#else
+#ifdef WSAEISCONN
+ add_errcode("EISCONN", WSAEISCONN, "Transport endpoint is already connected");
+#endif
+#endif
+#ifdef ENOANO
+ add_errcode("ENOANO", ENOANO, "No anode");
+#endif
+#if defined(__wasi__) && !defined(ESHUTDOWN)
+ // WASI SDK 16 does not have ESHUTDOWN, shutdown results in EPIPE.
+ #define ESHUTDOWN EPIPE
+#endif
+#ifdef ESHUTDOWN
+ add_errcode("ESHUTDOWN", ESHUTDOWN, "Cannot send after transport endpoint shutdown");
+#else
+#ifdef WSAESHUTDOWN
+ add_errcode("ESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
+#endif
+#endif
+#ifdef ECHRNG
+ add_errcode("ECHRNG", ECHRNG, "Channel number out of range");
+#endif
+#ifdef ELIBBAD
+ add_errcode("ELIBBAD", ELIBBAD, "Accessing a corrupted shared library");
+#endif
+#ifdef ENONET
+ add_errcode("ENONET", ENONET, "Machine is not on the network");
+#endif
+#ifdef EBADE
+ add_errcode("EBADE", EBADE, "Invalid exchange");
+#endif
+#ifdef EBADF
+ add_errcode("EBADF", EBADF, "Bad file number");
+#else
+#ifdef WSAEBADF
+ add_errcode("EBADF", WSAEBADF, "Bad file number");
+#endif
+#endif
+#ifdef EMULTIHOP
+ add_errcode("EMULTIHOP", EMULTIHOP, "Multihop attempted");
+#endif
+#ifdef EIO
+ add_errcode("EIO", EIO, "I/O error");
+#endif
+#ifdef EUNATCH
+ add_errcode("EUNATCH", EUNATCH, "Protocol driver not attached");
+#endif
+#ifdef EPROTOTYPE
+ add_errcode("EPROTOTYPE", EPROTOTYPE, "Protocol wrong type for socket");
+#else
+#ifdef WSAEPROTOTYPE
+ add_errcode("EPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
+#endif
+#endif
+#ifdef ENOSPC
+ add_errcode("ENOSPC", ENOSPC, "No space left on device");
+#endif
+#ifdef ENOEXEC
+ add_errcode("ENOEXEC", ENOEXEC, "Exec format error");
+#endif
+#ifdef EALREADY
+ add_errcode("EALREADY", EALREADY, "Operation already in progress");
+#else
+#ifdef WSAEALREADY
+ add_errcode("EALREADY", WSAEALREADY, "Operation already in progress");
+#endif
+#endif
+#ifdef ENETDOWN
+ add_errcode("ENETDOWN", ENETDOWN, "Network is down");
+#else
+#ifdef WSAENETDOWN
+ add_errcode("ENETDOWN", WSAENETDOWN, "Network is down");
+#endif
+#endif
+#ifdef ENOTNAM
+ add_errcode("ENOTNAM", ENOTNAM, "Not a XENIX named type file");
+#endif
+#ifdef EACCES
+ add_errcode("EACCES", EACCES, "Permission denied");
+#else
+#ifdef WSAEACCES
+ add_errcode("EACCES", WSAEACCES, "Permission denied");
+#endif
+#endif
+#ifdef ELNRNG
+ add_errcode("ELNRNG", ELNRNG, "Link number out of range");
+#endif
+#ifdef EILSEQ
+ add_errcode("EILSEQ", EILSEQ, "Illegal byte sequence");
+#endif
+#ifdef ENOTDIR
+ add_errcode("ENOTDIR", ENOTDIR, "Not a directory");
+#endif
+#ifdef ENOTUNIQ
+ add_errcode("ENOTUNIQ", ENOTUNIQ, "Name not unique on network");
+#endif
+#ifdef EPERM
+ add_errcode("EPERM", EPERM, "Operation not permitted");
+#endif
+#ifdef EDOM
+ add_errcode("EDOM", EDOM, "Math argument out of domain of func");
+#endif
+#ifdef EXFULL
+ add_errcode("EXFULL", EXFULL, "Exchange full");
+#endif
+#ifdef ECONNREFUSED
+ add_errcode("ECONNREFUSED", ECONNREFUSED, "Connection refused");
+#else
+#ifdef WSAECONNREFUSED
+ add_errcode("ECONNREFUSED", WSAECONNREFUSED, "Connection refused");
+#endif
+#endif
+#ifdef EISDIR
+ add_errcode("EISDIR", EISDIR, "Is a directory");
+#endif
+#ifdef EPROTONOSUPPORT
+ add_errcode("EPROTONOSUPPORT", EPROTONOSUPPORT, "Protocol not supported");
+#else
+#ifdef WSAEPROTONOSUPPORT
+ add_errcode("EPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
+#endif
+#endif
+#ifdef EROFS
+ add_errcode("EROFS", EROFS, "Read-only file system");
+#endif
+#ifdef EADDRNOTAVAIL
+ add_errcode("EADDRNOTAVAIL", EADDRNOTAVAIL, "Cannot assign requested address");
+#else
+#ifdef WSAEADDRNOTAVAIL
+ add_errcode("EADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
+#endif
+#endif
+#ifdef EIDRM
+ add_errcode("EIDRM", EIDRM, "Identifier removed");
+#endif
+#ifdef ECOMM
+ add_errcode("ECOMM", ECOMM, "Communication error on send");
+#endif
+#ifdef ESRMNT
+ add_errcode("ESRMNT", ESRMNT, "Srmount error");
+#endif
+#ifdef EREMOTEIO
+ add_errcode("EREMOTEIO", EREMOTEIO, "Remote I/O error");
+#endif
+#ifdef EL3RST
+ add_errcode("EL3RST", EL3RST, "Level 3 reset");
+#endif
+#ifdef EBADMSG
+ add_errcode("EBADMSG", EBADMSG, "Not a data message");
+#endif
+#ifdef ENFILE
+ add_errcode("ENFILE", ENFILE, "File table overflow");
+#endif
+#ifdef ELIBMAX
+ add_errcode("ELIBMAX", ELIBMAX, "Attempting to link in too many shared libraries");
+#endif
+#ifdef ESPIPE
+ add_errcode("ESPIPE", ESPIPE, "Illegal seek");
+#endif
+#ifdef ENOLINK
+ add_errcode("ENOLINK", ENOLINK, "Link has been severed");
+#endif
+#ifdef ENETRESET
+ add_errcode("ENETRESET", ENETRESET, "Network dropped connection because of reset");
+#else
+#ifdef WSAENETRESET
+ add_errcode("ENETRESET", WSAENETRESET, "Network dropped connection because of reset");
+#endif
+#endif
+#ifdef ETIMEDOUT
+ add_errcode("ETIMEDOUT", ETIMEDOUT, "Connection timed out");
+#else
+#ifdef WSAETIMEDOUT
+ add_errcode("ETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
+#endif
+#endif
+#ifdef ENOENT
+ add_errcode("ENOENT", ENOENT, "No such file or directory");
+#endif
+#ifdef EEXIST
+ add_errcode("EEXIST", EEXIST, "File exists");
+#endif
+#ifdef EDQUOT
+ add_errcode("EDQUOT", EDQUOT, "Quota exceeded");
+#else
+#ifdef WSAEDQUOT
+ add_errcode("EDQUOT", WSAEDQUOT, "Quota exceeded");
+#endif
+#endif
+#ifdef ENOSTR
+ add_errcode("ENOSTR", ENOSTR, "Device not a stream");
+#endif
+#ifdef EBADSLT
+ add_errcode("EBADSLT", EBADSLT, "Invalid slot");
+#endif
+#ifdef EBADRQC
+ add_errcode("EBADRQC", EBADRQC, "Invalid request code");
+#endif
+#ifdef ELIBACC
+ add_errcode("ELIBACC", ELIBACC, "Can not access a needed shared library");
+#endif
+#ifdef EFAULT
+ add_errcode("EFAULT", EFAULT, "Bad address");
+#else
+#ifdef WSAEFAULT
+ add_errcode("EFAULT", WSAEFAULT, "Bad address");
+#endif
+#endif
+#ifdef EFBIG
+ add_errcode("EFBIG", EFBIG, "File too large");
+#endif
+#ifdef EDEADLK
+ add_errcode("EDEADLK", EDEADLK, "Resource deadlock would occur");
+#endif
+#ifdef ENOTCONN
+ add_errcode("ENOTCONN", ENOTCONN, "Transport endpoint is not connected");
+#else
+#ifdef WSAENOTCONN
+ add_errcode("ENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
+#endif
+#endif
+#ifdef EDESTADDRREQ
+ add_errcode("EDESTADDRREQ", EDESTADDRREQ, "Destination address required");
+#else
+#ifdef WSAEDESTADDRREQ
+ add_errcode("EDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
+#endif
+#endif
+#ifdef ELIBSCN
+ add_errcode("ELIBSCN", ELIBSCN, ".lib section in a.out corrupted");
+#endif
+#ifdef ENOLCK
+ add_errcode("ENOLCK", ENOLCK, "No record locks available");
+#endif
+#ifdef EISNAM
+ add_errcode("EISNAM", EISNAM, "Is a named type file");
+#endif
+#ifdef ECONNABORTED
+ add_errcode("ECONNABORTED", ECONNABORTED, "Software caused connection abort");
+#else
+#ifdef WSAECONNABORTED
+ add_errcode("ECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
+#endif
+#endif
+#ifdef ENETUNREACH
+ add_errcode("ENETUNREACH", ENETUNREACH, "Network is unreachable");
+#else
+#ifdef WSAENETUNREACH
+ add_errcode("ENETUNREACH", WSAENETUNREACH, "Network is unreachable");
+#endif
+#endif
+#ifdef ESTALE
+ add_errcode("ESTALE", ESTALE, "Stale NFS file handle");
+#else
+#ifdef WSAESTALE
+ add_errcode("ESTALE", WSAESTALE, "Stale NFS file handle");
+#endif
+#endif
+#ifdef ENOSR
+ add_errcode("ENOSR", ENOSR, "Out of streams resources");
+#endif
+#ifdef ENOMEM
+ add_errcode("ENOMEM", ENOMEM, "Out of memory");
+#endif
+#ifdef ENOTSOCK
+ add_errcode("ENOTSOCK", ENOTSOCK, "Socket operation on non-socket");
+#else
+#ifdef WSAENOTSOCK
+ add_errcode("ENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
+#endif
+#endif
+#ifdef ESTRPIPE
+ add_errcode("ESTRPIPE", ESTRPIPE, "Streams pipe error");
+#endif
+#ifdef EMLINK
+ add_errcode("EMLINK", EMLINK, "Too many links");
+#endif
+#ifdef ERANGE
+ add_errcode("ERANGE", ERANGE, "Math result not representable");
+#endif
+#ifdef ELIBEXEC
+ add_errcode("ELIBEXEC", ELIBEXEC, "Cannot exec a shared library directly");
+#endif
+#ifdef EL3HLT
+ add_errcode("EL3HLT", EL3HLT, "Level 3 halted");
+#endif
+#ifdef ECONNRESET
+ add_errcode("ECONNRESET", ECONNRESET, "Connection reset by peer");
+#else
+#ifdef WSAECONNRESET
+ add_errcode("ECONNRESET", WSAECONNRESET, "Connection reset by peer");
+#endif
+#endif
+#ifdef EADDRINUSE
+ add_errcode("EADDRINUSE", EADDRINUSE, "Address already in use");
+#else
+#ifdef WSAEADDRINUSE
+ add_errcode("EADDRINUSE", WSAEADDRINUSE, "Address already in use");
+#endif
+#endif
+#ifdef EOPNOTSUPP
+ add_errcode("EOPNOTSUPP", EOPNOTSUPP, "Operation not supported on transport endpoint");
+#else
+#ifdef WSAEOPNOTSUPP
+ add_errcode("EOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
+#endif
+#endif
+#ifdef EREMCHG
+ add_errcode("EREMCHG", EREMCHG, "Remote address changed");
+#endif
+#ifdef EAGAIN
+ add_errcode("EAGAIN", EAGAIN, "Try again");
+#endif
+#ifdef ENAMETOOLONG
+ add_errcode("ENAMETOOLONG", ENAMETOOLONG, "File name too long");
+#else
+#ifdef WSAENAMETOOLONG
+ add_errcode("ENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
+#endif
+#endif
+#ifdef ENOTTY
+ add_errcode("ENOTTY", ENOTTY, "Not a typewriter");
+#endif
+#ifdef ERESTART
+ add_errcode("ERESTART", ERESTART, "Interrupted system call should be restarted");
+#endif
+#ifdef ESOCKTNOSUPPORT
+ add_errcode("ESOCKTNOSUPPORT", ESOCKTNOSUPPORT, "Socket type not supported");
+#else
+#ifdef WSAESOCKTNOSUPPORT
+ add_errcode("ESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
+#endif
+#endif
+#ifdef ETIME
+ add_errcode("ETIME", ETIME, "Timer expired");
+#endif
+#ifdef EBFONT
+ add_errcode("EBFONT", EBFONT, "Bad font file format");
+#endif
+#ifdef EDEADLOCK
+ add_errcode("EDEADLOCK", EDEADLOCK, "Error EDEADLOCK");
+#endif
+#ifdef ETOOMANYREFS
+ add_errcode("ETOOMANYREFS", ETOOMANYREFS, "Too many references: cannot splice");
+#else
+#ifdef WSAETOOMANYREFS
+ add_errcode("ETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
+#endif
+#endif
+#ifdef EMFILE
+ add_errcode("EMFILE", EMFILE, "Too many open files");
+#else
+#ifdef WSAEMFILE
+ add_errcode("EMFILE", WSAEMFILE, "Too many open files");
+#endif
+#endif
+#ifdef ETXTBSY
+ add_errcode("ETXTBSY", ETXTBSY, "Text file busy");
+#endif
+#ifdef EINPROGRESS
+ add_errcode("EINPROGRESS", EINPROGRESS, "Operation now in progress");
+#else
+#ifdef WSAEINPROGRESS
+ add_errcode("EINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
+#endif
+#endif
+#ifdef ENXIO
+ add_errcode("ENXIO", ENXIO, "No such device or address");
+#endif
+#ifdef ENOPKG
+ add_errcode("ENOPKG", ENOPKG, "Package not installed");
+#endif
+#ifdef WSASY
+ add_errcode("WSASY", WSASY, "Error WSASY");
+#endif
+#ifdef WSAEHOSTDOWN
+ add_errcode("WSAEHOSTDOWN", WSAEHOSTDOWN, "Host is down");
+#endif
+#ifdef WSAENETDOWN
+ add_errcode("WSAENETDOWN", WSAENETDOWN, "Network is down");
+#endif
+#ifdef WSAENOTSOCK
+ add_errcode("WSAENOTSOCK", WSAENOTSOCK, "Socket operation on non-socket");
+#endif
+#ifdef WSAEHOSTUNREACH
+ add_errcode("WSAEHOSTUNREACH", WSAEHOSTUNREACH, "No route to host");
+#endif
+#ifdef WSAELOOP
+ add_errcode("WSAELOOP", WSAELOOP, "Too many symbolic links encountered");
+#endif
+#ifdef WSAEMFILE
+ add_errcode("WSAEMFILE", WSAEMFILE, "Too many open files");
+#endif
+#ifdef WSAESTALE
+ add_errcode("WSAESTALE", WSAESTALE, "Stale NFS file handle");
+#endif
+#ifdef WSAVERNOTSUPPORTED
+ add_errcode("WSAVERNOTSUPPORTED", WSAVERNOTSUPPORTED, "Error WSAVERNOTSUPPORTED");
+#endif
+#ifdef WSAENETUNREACH
+ add_errcode("WSAENETUNREACH", WSAENETUNREACH, "Network is unreachable");
+#endif
+#ifdef WSAEPROCLIM
+ add_errcode("WSAEPROCLIM", WSAEPROCLIM, "Error WSAEPROCLIM");
+#endif
+#ifdef WSAEFAULT
+ add_errcode("WSAEFAULT", WSAEFAULT, "Bad address");
+#endif
+#ifdef WSANOTINITIALISED
+ add_errcode("WSANOTINITIALISED", WSANOTINITIALISED, "Error WSANOTINITIALISED");
+#endif
+#ifdef WSAEUSERS
+ add_errcode("WSAEUSERS", WSAEUSERS, "Too many users");
+#endif
+#ifdef WSAMAKEASYNCREPL
+ add_errcode("WSAMAKEASYNCREPL", WSAMAKEASYNCREPL, "Error WSAMAKEASYNCREPL");
+#endif
+#ifdef WSAENOPROTOOPT
+ add_errcode("WSAENOPROTOOPT", WSAENOPROTOOPT, "Protocol not available");
+#endif
+#ifdef WSAECONNABORTED
+ add_errcode("WSAECONNABORTED", WSAECONNABORTED, "Software caused connection abort");
+#endif
+#ifdef WSAENAMETOOLONG
+ add_errcode("WSAENAMETOOLONG", WSAENAMETOOLONG, "File name too long");
+#endif
+#ifdef WSAENOTEMPTY
+ add_errcode("WSAENOTEMPTY", WSAENOTEMPTY, "Directory not empty");
+#endif
+#ifdef WSAESHUTDOWN
+ add_errcode("WSAESHUTDOWN", WSAESHUTDOWN, "Cannot send after transport endpoint shutdown");
+#endif
+#ifdef WSAEAFNOSUPPORT
+ add_errcode("WSAEAFNOSUPPORT", WSAEAFNOSUPPORT, "Address family not supported by protocol");
+#endif
+#ifdef WSAETOOMANYREFS
+ add_errcode("WSAETOOMANYREFS", WSAETOOMANYREFS, "Too many references: cannot splice");
+#endif
+#ifdef WSAEACCES
+ add_errcode("WSAEACCES", WSAEACCES, "Permission denied");
+#endif
+#ifdef WSATR
+ add_errcode("WSATR", WSATR, "Error WSATR");
+#endif
+#ifdef WSABASEERR
+ add_errcode("WSABASEERR", WSABASEERR, "Error WSABASEERR");
+#endif
+#ifdef WSADESCRIPTIO
+ add_errcode("WSADESCRIPTIO", WSADESCRIPTIO, "Error WSADESCRIPTIO");
+#endif
+#ifdef WSAEMSGSIZE
+ add_errcode("WSAEMSGSIZE", WSAEMSGSIZE, "Message too long");
+#endif
+#ifdef WSAEBADF
+ add_errcode("WSAEBADF", WSAEBADF, "Bad file number");
+#endif
+#ifdef WSAECONNRESET
+ add_errcode("WSAECONNRESET", WSAECONNRESET, "Connection reset by peer");
+#endif
+#ifdef WSAGETSELECTERRO
+ add_errcode("WSAGETSELECTERRO", WSAGETSELECTERRO, "Error WSAGETSELECTERRO");
+#endif
+#ifdef WSAETIMEDOUT
+ add_errcode("WSAETIMEDOUT", WSAETIMEDOUT, "Connection timed out");
+#endif
+#ifdef WSAENOBUFS
+ add_errcode("WSAENOBUFS", WSAENOBUFS, "No buffer space available");
+#endif
+#ifdef WSAEDISCON
+ add_errcode("WSAEDISCON", WSAEDISCON, "Error WSAEDISCON");
+#endif
+#ifdef WSAEINTR
+ add_errcode("WSAEINTR", WSAEINTR, "Interrupted system call");
+#endif
+#ifdef WSAEPROTOTYPE
+ add_errcode("WSAEPROTOTYPE", WSAEPROTOTYPE, "Protocol wrong type for socket");
+#endif
+#ifdef WSAHOS
+ add_errcode("WSAHOS", WSAHOS, "Error WSAHOS");
+#endif
+#ifdef WSAEADDRINUSE
+ add_errcode("WSAEADDRINUSE", WSAEADDRINUSE, "Address already in use");
+#endif
+#ifdef WSAEADDRNOTAVAIL
+ add_errcode("WSAEADDRNOTAVAIL", WSAEADDRNOTAVAIL, "Cannot assign requested address");
+#endif
+#ifdef WSAEALREADY
+ add_errcode("WSAEALREADY", WSAEALREADY, "Operation already in progress");
+#endif
+#ifdef WSAEPROTONOSUPPORT
+ add_errcode("WSAEPROTONOSUPPORT", WSAEPROTONOSUPPORT, "Protocol not supported");
+#endif
+#ifdef WSASYSNOTREADY
+ add_errcode("WSASYSNOTREADY", WSASYSNOTREADY, "Error WSASYSNOTREADY");
+#endif
+#ifdef WSAEWOULDBLOCK
+ add_errcode("WSAEWOULDBLOCK", WSAEWOULDBLOCK, "Operation would block");
+#endif
+#ifdef WSAEPFNOSUPPORT
+ add_errcode("WSAEPFNOSUPPORT", WSAEPFNOSUPPORT, "Protocol family not supported");
+#endif
+#ifdef WSAEOPNOTSUPP
+ add_errcode("WSAEOPNOTSUPP", WSAEOPNOTSUPP, "Operation not supported on transport endpoint");
+#endif
+#ifdef WSAEISCONN
+ add_errcode("WSAEISCONN", WSAEISCONN, "Transport endpoint is already connected");
+#endif
+#ifdef WSAEDQUOT
+ add_errcode("WSAEDQUOT", WSAEDQUOT, "Quota exceeded");
+#endif
+#ifdef WSAENOTCONN
+ add_errcode("WSAENOTCONN", WSAENOTCONN, "Transport endpoint is not connected");
+#endif
+#ifdef WSAEREMOTE
+ add_errcode("WSAEREMOTE", WSAEREMOTE, "Object is remote");
+#endif
+#ifdef WSAEINVAL
+ add_errcode("WSAEINVAL", WSAEINVAL, "Invalid argument");
+#endif
+#ifdef WSAEINPROGRESS
+ add_errcode("WSAEINPROGRESS", WSAEINPROGRESS, "Operation now in progress");
+#endif
+#ifdef WSAGETSELECTEVEN
+ add_errcode("WSAGETSELECTEVEN", WSAGETSELECTEVEN, "Error WSAGETSELECTEVEN");
+#endif
+#ifdef WSAESOCKTNOSUPPORT
+ add_errcode("WSAESOCKTNOSUPPORT", WSAESOCKTNOSUPPORT, "Socket type not supported");
+#endif
+#ifdef WSAGETASYNCERRO
+ add_errcode("WSAGETASYNCERRO", WSAGETASYNCERRO, "Error WSAGETASYNCERRO");
+#endif
+#ifdef WSAMAKESELECTREPL
+ add_errcode("WSAMAKESELECTREPL", WSAMAKESELECTREPL, "Error WSAMAKESELECTREPL");
+#endif
+#ifdef WSAGETASYNCBUFLE
+ add_errcode("WSAGETASYNCBUFLE", WSAGETASYNCBUFLE, "Error WSAGETASYNCBUFLE");
+#endif
+#ifdef WSAEDESTADDRREQ
+ add_errcode("WSAEDESTADDRREQ", WSAEDESTADDRREQ, "Destination address required");
+#endif
+#ifdef WSAECONNREFUSED
+ add_errcode("WSAECONNREFUSED", WSAECONNREFUSED, "Connection refused");
+#endif
+#ifdef WSAENETRESET
+ add_errcode("WSAENETRESET", WSAENETRESET, "Network dropped connection because of reset");
+#endif
+#ifdef WSAN
+ add_errcode("WSAN", WSAN, "Error WSAN");
+#endif
+#ifdef ENOMEDIUM
+ add_errcode("ENOMEDIUM", ENOMEDIUM, "No medium found");
+#endif
+#ifdef EMEDIUMTYPE
+ add_errcode("EMEDIUMTYPE", EMEDIUMTYPE, "Wrong medium type");
+#endif
+#ifdef ECANCELED
+ add_errcode("ECANCELED", ECANCELED, "Operation Canceled");
+#endif
+#ifdef ENOKEY
+ add_errcode("ENOKEY", ENOKEY, "Required key not available");
+#endif
+#ifdef EKEYEXPIRED
+ add_errcode("EKEYEXPIRED", EKEYEXPIRED, "Key has expired");
+#endif
+#ifdef EKEYREVOKED
+ add_errcode("EKEYREVOKED", EKEYREVOKED, "Key has been revoked");
+#endif
+#ifdef EKEYREJECTED
+ add_errcode("EKEYREJECTED", EKEYREJECTED, "Key was rejected by service");
+#endif
+#ifdef EOWNERDEAD
+ add_errcode("EOWNERDEAD", EOWNERDEAD, "Owner died");
+#endif
+#ifdef ENOTRECOVERABLE
+ add_errcode("ENOTRECOVERABLE", ENOTRECOVERABLE, "State not recoverable");
+#endif
+#ifdef ERFKILL
+ add_errcode("ERFKILL", ERFKILL, "Operation not possible due to RF-kill");
+#endif
+
+ /* Solaris-specific errnos */
+#ifdef ECANCELED
+ add_errcode("ECANCELED", ECANCELED, "Operation canceled");
+#endif
+#ifdef ENOTSUP
+ add_errcode("ENOTSUP", ENOTSUP, "Operation not supported");
+#endif
+#ifdef EOWNERDEAD
+ add_errcode("EOWNERDEAD", EOWNERDEAD, "Process died with the lock");
+#endif
+#ifdef ENOTRECOVERABLE
+ add_errcode("ENOTRECOVERABLE", ENOTRECOVERABLE, "Lock is not recoverable");
+#endif
+#ifdef ELOCKUNMAPPED
+ add_errcode("ELOCKUNMAPPED", ELOCKUNMAPPED, "Locked lock was unmapped");
+#endif
+#ifdef ENOTACTIVE
+ add_errcode("ENOTACTIVE", ENOTACTIVE, "Facility is not active");
+#endif
+
+ /* MacOSX specific errnos */
+#ifdef EAUTH
+ add_errcode("EAUTH", EAUTH, "Authentication error");
+#endif
+#ifdef EBADARCH
+ add_errcode("EBADARCH", EBADARCH, "Bad CPU type in executable");
+#endif
+#ifdef EBADEXEC
+ add_errcode("EBADEXEC", EBADEXEC, "Bad executable (or shared library)");
+#endif
+#ifdef EBADMACHO
+ add_errcode("EBADMACHO", EBADMACHO, "Malformed Mach-o file");
+#endif
+#ifdef EBADRPC
+ add_errcode("EBADRPC", EBADRPC, "RPC struct is bad");
+#endif
+#ifdef EDEVERR
+ add_errcode("EDEVERR", EDEVERR, "Device error");
+#endif
+#ifdef EFTYPE
+ add_errcode("EFTYPE", EFTYPE, "Inappropriate file type or format");
+#endif
+#ifdef ENEEDAUTH
+ add_errcode("ENEEDAUTH", ENEEDAUTH, "Need authenticator");
+#endif
+#ifdef ENOATTR
+ add_errcode("ENOATTR", ENOATTR, "Attribute not found");
+#endif
+#ifdef ENOPOLICY
+ add_errcode("ENOPOLICY", ENOPOLICY, "Policy not found");
+#endif
+#ifdef EPROCLIM
+ add_errcode("EPROCLIM", EPROCLIM, "Too many processes");
+#endif
+#ifdef EPROCUNAVAIL
+ add_errcode("EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");
+#endif
+#ifdef EPROGMISMATCH
+ add_errcode("EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");
+#endif
+#ifdef EPROGUNAVAIL
+ add_errcode("EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");
+#endif
+#ifdef EPWROFF
+ add_errcode("EPWROFF", EPWROFF, "Device power is off");
+#endif
+#ifdef ERPCMISMATCH
+ add_errcode("ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");
+#endif
+#ifdef ESHLIBVERS
+ add_errcode("ESHLIBVERS", ESHLIBVERS, "Shared library version mismatch");
+#endif
+#ifdef EQFULL
+ add_errcode("EQFULL", EQFULL, "Interface output queue is full");
+#endif
+#ifdef ENOTCAPABLE
+ // WASI extension
+ add_errcode("ENOTCAPABLE", ENOTCAPABLE, "Capabilities insufficient");
+#endif
+
+ Py_DECREF(error_dict);
+ return 0;
+}
+
+static PyModuleDef_Slot errno_slots[] = {
+ {Py_mod_exec, errno_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+PyDoc_STRVAR(errno__doc__,
+"This module makes available standard errno system symbols.\n\
+\n\
+The value of each symbol is the corresponding integer value,\n\
+e.g., on most systems, errno.ENOENT equals the integer 2.\n\
+\n\
+The dictionary errno.errorcode maps numeric codes to symbol names,\n\
+e.g., errno.errorcode[2] could be the string 'ENOENT'.\n\
+\n\
+Symbols that are not relevant to the underlying system are not defined.\n\
+\n\
+To map error codes to error messages, use the function os.strerror(),\n\
+e.g. os.strerror(2) could return 'No such file or directory'.");
+
+static struct PyModuleDef errnomodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "errno",
+ .m_doc = errno__doc__,
+ .m_size = 0,
+ .m_methods = errno_methods,
+ .m_slots = errno_slots,
+};
+
+PyMODINIT_FUNC
+PyInit_errno(void)
+{
+ return PyModuleDef_Init(&errnomodule);
+}
diff --git a/contrib/tools/python3/Modules/faulthandler.c b/contrib/tools/python3/Modules/faulthandler.c
new file mode 100644
index 00000000000..be77bb01f3f
--- /dev/null
+++ b/contrib/tools/python3/Modules/faulthandler.c
@@ -0,0 +1,1394 @@
+#include "Python.h"
+#include "pycore_initconfig.h" // _PyStatus_ERR
+#include "pycore_pyerrors.h" // _Py_DumpExtensionModules
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_signal.h" // Py_NSIG
+#include "pycore_traceback.h" // _Py_DumpTracebackThreads
+
+#include <object.h>
+#include <signal.h>
+#include <stdlib.h> // abort()
+#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) && defined(HAVE_PTHREAD_H)
+# include <pthread.h>
+#endif
+#ifdef MS_WINDOWS
+# include <windows.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
+
+#if defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_LINUX_AUXVEC_H) && defined(HAVE_SYS_AUXV_H)
+# include <linux/auxvec.h> // AT_MINSIGSTKSZ
+# include <sys/auxv.h> // getauxval()
+#endif
+
+/* Allocate at maximum 100 MiB of the stack to raise the stack overflow */
+#define STACK_OVERFLOW_MAX_SIZE (100 * 1024 * 1024)
+
+#define PUTS(fd, str) _Py_write_noraise(fd, str, strlen(str))
+
+
+// clang uses __attribute__((no_sanitize("undefined")))
+// GCC 4.9+ uses __attribute__((no_sanitize_undefined))
+#if defined(__has_feature) // Clang
+# if __has_feature(undefined_behavior_sanitizer)
+# define _Py_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
+# endif
+#endif
+#if defined(__GNUC__) \
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))
+# define _Py_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined))
+#endif
+#ifndef _Py_NO_SANITIZE_UNDEFINED
+# define _Py_NO_SANITIZE_UNDEFINED
+#endif
+
+
+typedef struct {
+ int signum;
+ int enabled;
+ const char* name;
+ _Py_sighandler_t previous;
+ int all_threads;
+} fault_handler_t;
+
+#define fatal_error _PyRuntime.faulthandler.fatal_error
+#define thread _PyRuntime.faulthandler.thread
+
+#ifdef FAULTHANDLER_USER
+#define user_signals _PyRuntime.faulthandler.user_signals
+typedef struct faulthandler_user_signal user_signal_t;
+static void faulthandler_user(int signum);
+#endif /* FAULTHANDLER_USER */
+
+
+static fault_handler_t faulthandler_handlers[] = {
+#ifdef SIGBUS
+ {SIGBUS, 0, "Bus error", },
+#endif
+#ifdef SIGILL
+ {SIGILL, 0, "Illegal instruction", },
+#endif
+ {SIGFPE, 0, "Floating point exception", },
+ {SIGABRT, 0, "Aborted", },
+ /* define SIGSEGV at the end to make it the default choice if searching the
+ handler fails in faulthandler_fatal_error() */
+ {SIGSEGV, 0, "Segmentation fault", }
+};
+static const size_t faulthandler_nsignals = \
+ Py_ARRAY_LENGTH(faulthandler_handlers);
+
+#ifdef FAULTHANDLER_USE_ALT_STACK
+# define stack _PyRuntime.faulthandler.stack
+# define old_stack _PyRuntime.faulthandler.old_stack
+#endif
+
+
+/* Get the file descriptor of a file by calling its fileno() method and then
+ call its flush() method.
+
+ If file is NULL or Py_None, use sys.stderr as the new file.
+ If file is an integer, it will be treated as file descriptor.
+
+ On success, return the file descriptor and write the new file into *file_ptr.
+ On error, return -1. */
+
+static int
+faulthandler_get_fileno(PyObject **file_ptr)
+{
+ PyObject *result;
+ long fd_long;
+ int fd;
+ PyObject *file = *file_ptr;
+
+ if (file == NULL || file == Py_None) {
+ PyThreadState *tstate = _PyThreadState_GET();
+ file = _PySys_GetAttr(tstate, &_Py_ID(stderr));
+ if (file == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "unable to get sys.stderr");
+ return -1;
+ }
+ if (file == Py_None) {
+ PyErr_SetString(PyExc_RuntimeError, "sys.stderr is None");
+ return -1;
+ }
+ }
+ else if (PyLong_Check(file)) {
+ fd = _PyLong_AsInt(file);
+ if (fd == -1 && PyErr_Occurred())
+ return -1;
+ if (fd < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "file is not a valid file descriptor");
+ return -1;
+ }
+ *file_ptr = NULL;
+ return fd;
+ }
+
+ result = PyObject_CallMethodNoArgs(file, &_Py_ID(fileno));
+ if (result == NULL)
+ return -1;
+
+ fd = -1;
+ if (PyLong_Check(result)) {
+ fd_long = PyLong_AsLong(result);
+ if (0 <= fd_long && fd_long < INT_MAX)
+ fd = (int)fd_long;
+ }
+ Py_DECREF(result);
+
+ if (fd == -1) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "file.fileno() is not a valid file descriptor");
+ return -1;
+ }
+
+ result = PyObject_CallMethodNoArgs(file, &_Py_ID(flush));
+ if (result != NULL)
+ Py_DECREF(result);
+ else {
+ /* ignore flush() error */
+ PyErr_Clear();
+ }
+ *file_ptr = file;
+ return fd;
+}
+
+/* Get the state of the current thread: only call this function if the current
+ thread holds the GIL. Raise an exception on error. */
+static PyThreadState*
+get_thread_state(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (tstate == NULL) {
+ /* just in case but very unlikely... */
+ PyErr_SetString(PyExc_RuntimeError,
+ "unable to get the current thread state");
+ return NULL;
+ }
+ return tstate;
+}
+
+static void
+faulthandler_dump_traceback(int fd, int all_threads,
+ PyInterpreterState *interp)
+{
+ static volatile int reentrant = 0;
+
+ if (reentrant)
+ return;
+
+ reentrant = 1;
+
+ /* SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL are synchronous signals and
+ are thus delivered to the thread that caused the fault. Get the Python
+ thread state of the current thread.
+
+ PyThreadState_Get() doesn't give the state of the thread that caused the
+ fault if the thread released the GIL, and so this function cannot be
+ used. Read the thread specific storage (TSS) instead: call
+ PyGILState_GetThisThreadState(). */
+ PyThreadState *tstate = PyGILState_GetThisThreadState();
+
+ if (all_threads) {
+ (void)_Py_DumpTracebackThreads(fd, NULL, tstate);
+ }
+ else {
+ if (tstate != NULL)
+ _Py_DumpTraceback(fd, tstate);
+ }
+
+ reentrant = 0;
+}
+
+static PyObject*
+faulthandler_dump_traceback_py(PyObject *self,
+ PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = {"file", "all_threads", NULL};
+ PyObject *file = NULL;
+ int all_threads = 1;
+ PyThreadState *tstate;
+ const char *errmsg;
+ int fd;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "|Op:dump_traceback", kwlist,
+ &file, &all_threads))
+ return NULL;
+
+ fd = faulthandler_get_fileno(&file);
+ if (fd < 0)
+ return NULL;
+
+ tstate = get_thread_state();
+ if (tstate == NULL)
+ return NULL;
+
+ if (all_threads) {
+ errmsg = _Py_DumpTracebackThreads(fd, NULL, tstate);
+ if (errmsg != NULL) {
+ PyErr_SetString(PyExc_RuntimeError, errmsg);
+ return NULL;
+ }
+ }
+ else {
+ _Py_DumpTraceback(fd, tstate);
+ }
+
+ if (PyErr_CheckSignals())
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+static void
+faulthandler_disable_fatal_handler(fault_handler_t *handler)
+{
+ if (!handler->enabled)
+ return;
+ handler->enabled = 0;
+#ifdef HAVE_SIGACTION
+ (void)sigaction(handler->signum, &handler->previous, NULL);
+#else
+ (void)signal(handler->signum, handler->previous);
+#endif
+}
+
+
+/* Handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals.
+
+ Display the current Python traceback, restore the previous handler and call
+ the previous handler.
+
+ On Windows, don't explicitly call the previous handler, because the Windows
+ signal handler would not be called (for an unknown reason). The execution of
+ the program continues at faulthandler_fatal_error() exit, but the same
+ instruction will raise the same fault (signal), and so the previous handler
+ will be called.
+
+ This function is signal-safe and should only call signal-safe functions. */
+
+static void
+faulthandler_fatal_error(int signum)
+{
+ const int fd = fatal_error.fd;
+ size_t i;
+ fault_handler_t *handler = NULL;
+ int save_errno = errno;
+ int found = 0;
+
+ if (!fatal_error.enabled)
+ return;
+
+ for (i=0; i < faulthandler_nsignals; i++) {
+ handler = &faulthandler_handlers[i];
+ if (handler->signum == signum) {
+ found = 1;
+ break;
+ }
+ }
+ if (handler == NULL) {
+ /* faulthandler_nsignals == 0 (unlikely) */
+ return;
+ }
+
+ /* restore the previous handler */
+ faulthandler_disable_fatal_handler(handler);
+
+ if (found) {
+ PUTS(fd, "Fatal Python error: ");
+ PUTS(fd, handler->name);
+ PUTS(fd, "\n\n");
+ }
+ else {
+ char unknown_signum[23] = {0,};
+ snprintf(unknown_signum, 23, "%d", signum);
+ PUTS(fd, "Fatal Python error from unexpected signum: ");
+ PUTS(fd, unknown_signum);
+ PUTS(fd, "\n\n");
+ }
+
+ faulthandler_dump_traceback(fd, fatal_error.all_threads,
+ fatal_error.interp);
+
+ _Py_DumpExtensionModules(fd, fatal_error.interp);
+
+ errno = save_errno;
+#ifdef MS_WINDOWS
+ if (signum == SIGSEGV) {
+ /* don't explicitly call the previous handler for SIGSEGV in this signal
+ handler, because the Windows signal handler would not be called */
+ return;
+ }
+#endif
+ /* call the previous signal handler: it is called immediately if we use
+ sigaction() thanks to SA_NODEFER flag, otherwise it is deferred */
+ raise(signum);
+}
+
+#ifdef MS_WINDOWS
+static int
+faulthandler_ignore_exception(DWORD code)
+{
+ /* bpo-30557: ignore exceptions which are not errors */
+ if (!(code & 0x80000000)) {
+ return 1;
+ }
+ /* bpo-31701: ignore MSC and COM exceptions
+ E0000000 + code */
+ if (code == 0xE06D7363 /* MSC exception ("Emsc") */
+ || code == 0xE0434352 /* COM Callable Runtime exception ("ECCR") */) {
+ return 1;
+ }
+ /* Interesting exception: log it with the Python traceback */
+ return 0;
+}
+
+static LONG WINAPI
+faulthandler_exc_handler(struct _EXCEPTION_POINTERS *exc_info)
+{
+ const int fd = fatal_error.fd;
+ DWORD code = exc_info->ExceptionRecord->ExceptionCode;
+ DWORD flags = exc_info->ExceptionRecord->ExceptionFlags;
+
+ if (faulthandler_ignore_exception(code)) {
+ /* ignore the exception: call the next exception handler */
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+
+ PUTS(fd, "Windows fatal exception: ");
+ switch (code)
+ {
+ /* only format most common errors */
+ case EXCEPTION_ACCESS_VIOLATION: PUTS(fd, "access violation"); break;
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO: PUTS(fd, "float divide by zero"); break;
+ case EXCEPTION_FLT_OVERFLOW: PUTS(fd, "float overflow"); break;
+ case EXCEPTION_INT_DIVIDE_BY_ZERO: PUTS(fd, "int divide by zero"); break;
+ case EXCEPTION_INT_OVERFLOW: PUTS(fd, "integer overflow"); break;
+ case EXCEPTION_IN_PAGE_ERROR: PUTS(fd, "page error"); break;
+ case EXCEPTION_STACK_OVERFLOW: PUTS(fd, "stack overflow"); break;
+ default:
+ PUTS(fd, "code 0x");
+ _Py_DumpHexadecimal(fd, code, 8);
+ }
+ PUTS(fd, "\n\n");
+
+ if (code == EXCEPTION_ACCESS_VIOLATION) {
+ /* disable signal handler for SIGSEGV */
+ for (size_t i=0; i < faulthandler_nsignals; i++) {
+ fault_handler_t *handler = &faulthandler_handlers[i];
+ if (handler->signum == SIGSEGV) {
+ faulthandler_disable_fatal_handler(handler);
+ break;
+ }
+ }
+ }
+
+ faulthandler_dump_traceback(fd, fatal_error.all_threads,
+ fatal_error.interp);
+
+ /* call the next exception handler */
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+#endif
+
+
+#ifdef FAULTHANDLER_USE_ALT_STACK
+static int
+faulthandler_allocate_stack(void)
+{
+ if (stack.ss_sp != NULL) {
+ return 0;
+ }
+ /* Allocate an alternate stack for faulthandler() signal handler
+ to be able to execute a signal handler on a stack overflow error */
+ stack.ss_sp = PyMem_Malloc(stack.ss_size);
+ if (stack.ss_sp == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ int err = sigaltstack(&stack, &old_stack);
+ if (err) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ /* Release the stack to retry sigaltstack() next time */
+ PyMem_Free(stack.ss_sp);
+ stack.ss_sp = NULL;
+ return -1;
+ }
+ return 0;
+}
+#endif
+
+
+/* Install the handler for fatal signals, faulthandler_fatal_error(). */
+
+static int
+faulthandler_enable(void)
+{
+ if (fatal_error.enabled) {
+ return 0;
+ }
+ fatal_error.enabled = 1;
+
+#ifdef FAULTHANDLER_USE_ALT_STACK
+ if (faulthandler_allocate_stack() < 0) {
+ return -1;
+ }
+#endif
+
+ for (size_t i=0; i < faulthandler_nsignals; i++) {
+ fault_handler_t *handler;
+ int err;
+
+ handler = &faulthandler_handlers[i];
+ assert(!handler->enabled);
+#ifdef HAVE_SIGACTION
+ struct sigaction action;
+ action.sa_handler = faulthandler_fatal_error;
+ sigemptyset(&action.sa_mask);
+ /* Do not prevent the signal from being received from within
+ its own signal handler */
+ action.sa_flags = SA_NODEFER;
+#ifdef FAULTHANDLER_USE_ALT_STACK
+ assert(stack.ss_sp != NULL);
+ /* Call the signal handler on an alternate signal stack
+ provided by sigaltstack() */
+ action.sa_flags |= SA_ONSTACK;
+#endif
+ err = sigaction(handler->signum, &action, &handler->previous);
+#else
+ handler->previous = signal(handler->signum,
+ faulthandler_fatal_error);
+ err = (handler->previous == SIG_ERR);
+#endif
+ if (err) {
+ PyErr_SetFromErrno(PyExc_RuntimeError);
+ return -1;
+ }
+
+ handler->enabled = 1;
+ }
+
+#ifdef MS_WINDOWS
+ assert(fatal_error.exc_handler == NULL);
+ fatal_error.exc_handler = AddVectoredExceptionHandler(1, faulthandler_exc_handler);
+#endif
+ return 0;
+}
+
+static PyObject*
+faulthandler_py_enable(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = {"file", "all_threads", NULL};
+ PyObject *file = NULL;
+ int all_threads = 1;
+ int fd;
+ PyThreadState *tstate;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "|Op:enable", kwlist, &file, &all_threads))
+ return NULL;
+
+ fd = faulthandler_get_fileno(&file);
+ if (fd < 0)
+ return NULL;
+
+ tstate = get_thread_state();
+ if (tstate == NULL)
+ return NULL;
+
+ Py_XINCREF(file);
+ Py_XSETREF(fatal_error.file, file);
+ fatal_error.fd = fd;
+ fatal_error.all_threads = all_threads;
+ fatal_error.interp = PyThreadState_GetInterpreter(tstate);
+
+ if (faulthandler_enable() < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static void
+faulthandler_disable(void)
+{
+ if (fatal_error.enabled) {
+ fatal_error.enabled = 0;
+ for (size_t i=0; i < faulthandler_nsignals; i++) {
+ fault_handler_t *handler;
+ handler = &faulthandler_handlers[i];
+ faulthandler_disable_fatal_handler(handler);
+ }
+ }
+#ifdef MS_WINDOWS
+ if (fatal_error.exc_handler != NULL) {
+ RemoveVectoredExceptionHandler(fatal_error.exc_handler);
+ fatal_error.exc_handler = NULL;
+ }
+#endif
+ Py_CLEAR(fatal_error.file);
+}
+
+static PyObject*
+faulthandler_disable_py(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ if (!fatal_error.enabled) {
+ Py_RETURN_FALSE;
+ }
+ faulthandler_disable();
+ Py_RETURN_TRUE;
+}
+
+static PyObject*
+faulthandler_is_enabled(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return PyBool_FromLong(fatal_error.enabled);
+}
+
+static void
+faulthandler_thread(void *unused)
+{
+ PyLockStatus st;
+ const char* errmsg;
+ int ok;
+#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
+ sigset_t set;
+
+ /* we don't want to receive any signal */
+ sigfillset(&set);
+ pthread_sigmask(SIG_SETMASK, &set, NULL);
+#endif
+
+ do {
+ st = PyThread_acquire_lock_timed(thread.cancel_event,
+ thread.timeout_us, 0);
+ if (st == PY_LOCK_ACQUIRED) {
+ PyThread_release_lock(thread.cancel_event);
+ break;
+ }
+ /* Timeout => dump traceback */
+ assert(st == PY_LOCK_FAILURE);
+
+ _Py_write_noraise(thread.fd, thread.header, (int)thread.header_len);
+
+ errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, NULL);
+ ok = (errmsg == NULL);
+
+ if (thread.exit)
+ _exit(1);
+ } while (ok && thread.repeat);
+
+ /* The only way out */
+ PyThread_release_lock(thread.running);
+}
+
+static void
+cancel_dump_traceback_later(void)
+{
+ /* If not scheduled, nothing to cancel */
+ if (!thread.cancel_event) {
+ return;
+ }
+
+ /* Notify cancellation */
+ PyThread_release_lock(thread.cancel_event);
+
+ /* Wait for thread to join */
+ PyThread_acquire_lock(thread.running, 1);
+ PyThread_release_lock(thread.running);
+
+ /* The main thread should always hold the cancel_event lock */
+ PyThread_acquire_lock(thread.cancel_event, 1);
+
+ Py_CLEAR(thread.file);
+ if (thread.header) {
+ PyMem_Free(thread.header);
+ thread.header = NULL;
+ }
+}
+
+#define SEC_TO_US (1000 * 1000)
+
+static char*
+format_timeout(_PyTime_t us)
+{
+ unsigned long sec, min, hour;
+ char buffer[100];
+
+ /* the downcast is safe: the caller check that 0 < us <= LONG_MAX */
+ sec = (unsigned long)(us / SEC_TO_US);
+ us %= SEC_TO_US;
+
+ min = sec / 60;
+ sec %= 60;
+ hour = min / 60;
+ min %= 60;
+
+ if (us != 0) {
+ PyOS_snprintf(buffer, sizeof(buffer),
+ "Timeout (%lu:%02lu:%02lu.%06u)!\n",
+ hour, min, sec, (unsigned int)us);
+ }
+ else {
+ PyOS_snprintf(buffer, sizeof(buffer),
+ "Timeout (%lu:%02lu:%02lu)!\n",
+ hour, min, sec);
+ }
+ return _PyMem_Strdup(buffer);
+}
+
+static PyObject*
+faulthandler_dump_traceback_later(PyObject *self,
+ PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = {"timeout", "repeat", "file", "exit", NULL};
+ PyObject *timeout_obj;
+ _PyTime_t timeout, timeout_us;
+ int repeat = 0;
+ PyObject *file = NULL;
+ int fd;
+ int exit = 0;
+ PyThreadState *tstate;
+ char *header;
+ size_t header_len;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "O|iOi:dump_traceback_later", kwlist,
+ &timeout_obj, &repeat, &file, &exit))
+ return NULL;
+
+ if (_PyTime_FromSecondsObject(&timeout, timeout_obj,
+ _PyTime_ROUND_TIMEOUT) < 0) {
+ return NULL;
+ }
+ timeout_us = _PyTime_AsMicroseconds(timeout, _PyTime_ROUND_TIMEOUT);
+ if (timeout_us <= 0) {
+ PyErr_SetString(PyExc_ValueError, "timeout must be greater than 0");
+ return NULL;
+ }
+ /* Limit to LONG_MAX seconds for format_timeout() */
+ if (timeout_us > PY_TIMEOUT_MAX || timeout_us / SEC_TO_US > LONG_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout value is too large");
+ return NULL;
+ }
+
+ tstate = get_thread_state();
+ if (tstate == NULL) {
+ return NULL;
+ }
+
+ fd = faulthandler_get_fileno(&file);
+ if (fd < 0) {
+ return NULL;
+ }
+
+ if (!thread.running) {
+ thread.running = PyThread_allocate_lock();
+ if (!thread.running) {
+ return PyErr_NoMemory();
+ }
+ }
+ if (!thread.cancel_event) {
+ thread.cancel_event = PyThread_allocate_lock();
+ if (!thread.cancel_event || !thread.running) {
+ return PyErr_NoMemory();
+ }
+
+ /* cancel_event starts to be acquired: it's only released to cancel
+ the thread. */
+ PyThread_acquire_lock(thread.cancel_event, 1);
+ }
+
+ /* format the timeout */
+ header = format_timeout(timeout_us);
+ if (header == NULL) {
+ return PyErr_NoMemory();
+ }
+ header_len = strlen(header);
+
+ /* Cancel previous thread, if running */
+ cancel_dump_traceback_later();
+
+ Py_XINCREF(file);
+ Py_XSETREF(thread.file, file);
+ thread.fd = fd;
+ /* the downcast is safe: we check that 0 < timeout_us < PY_TIMEOUT_MAX */
+ thread.timeout_us = (PY_TIMEOUT_T)timeout_us;
+ thread.repeat = repeat;
+ thread.interp = PyThreadState_GetInterpreter(tstate);
+ thread.exit = exit;
+ thread.header = header;
+ thread.header_len = header_len;
+
+ /* Arm these locks to serve as events when released */
+ PyThread_acquire_lock(thread.running, 1);
+
+ if (PyThread_start_new_thread(faulthandler_thread, NULL) == PYTHREAD_INVALID_THREAD_ID) {
+ PyThread_release_lock(thread.running);
+ Py_CLEAR(thread.file);
+ PyMem_Free(header);
+ thread.header = NULL;
+ PyErr_SetString(PyExc_RuntimeError,
+ "unable to start watchdog thread");
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject*
+faulthandler_cancel_dump_traceback_later_py(PyObject *self,
+ PyObject *Py_UNUSED(ignored))
+{
+ cancel_dump_traceback_later();
+ Py_RETURN_NONE;
+}
+
+
+#ifdef FAULTHANDLER_USER
+static int
+faulthandler_register(int signum, int chain, _Py_sighandler_t *previous_p)
+{
+#ifdef HAVE_SIGACTION
+ struct sigaction action;
+ action.sa_handler = faulthandler_user;
+ sigemptyset(&action.sa_mask);
+ /* if the signal is received while the kernel is executing a system
+ call, try to restart the system call instead of interrupting it and
+ return EINTR. */
+ action.sa_flags = SA_RESTART;
+ if (chain) {
+ /* do not prevent the signal from being received from within its
+ own signal handler */
+ action.sa_flags = SA_NODEFER;
+ }
+#ifdef FAULTHANDLER_USE_ALT_STACK
+ assert(stack.ss_sp != NULL);
+ /* Call the signal handler on an alternate signal stack
+ provided by sigaltstack() */
+ action.sa_flags |= SA_ONSTACK;
+#endif
+ return sigaction(signum, &action, previous_p);
+#else
+ _Py_sighandler_t previous;
+ previous = signal(signum, faulthandler_user);
+ if (previous_p != NULL) {
+ *previous_p = previous;
+ }
+ return (previous == SIG_ERR);
+#endif
+}
+
+/* Handler of user signals (e.g. SIGUSR1).
+
+ Dump the traceback of the current thread, or of all threads if
+ thread.all_threads is true.
+
+ This function is signal safe and should only call signal safe functions. */
+
+static void
+faulthandler_user(int signum)
+{
+ user_signal_t *user;
+ int save_errno = errno;
+
+ user = &user_signals[signum];
+ if (!user->enabled)
+ return;
+
+ faulthandler_dump_traceback(user->fd, user->all_threads, user->interp);
+
+#ifdef HAVE_SIGACTION
+ if (user->chain) {
+ (void)sigaction(signum, &user->previous, NULL);
+ errno = save_errno;
+
+ /* call the previous signal handler */
+ raise(signum);
+
+ save_errno = errno;
+ (void)faulthandler_register(signum, user->chain, NULL);
+ errno = save_errno;
+ }
+#else
+ if (user->chain && user->previous != NULL) {
+ errno = save_errno;
+ /* call the previous signal handler */
+ user->previous(signum);
+ }
+#endif
+}
+
+static int
+check_signum(int signum)
+{
+ for (size_t i=0; i < faulthandler_nsignals; i++) {
+ if (faulthandler_handlers[i].signum == signum) {
+ PyErr_Format(PyExc_RuntimeError,
+ "signal %i cannot be registered, "
+ "use enable() instead",
+ signum);
+ return 0;
+ }
+ }
+ if (signum < 1 || Py_NSIG <= signum) {
+ PyErr_SetString(PyExc_ValueError, "signal number out of range");
+ return 0;
+ }
+ return 1;
+}
+
+static PyObject*
+faulthandler_register_py(PyObject *self,
+ PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = {"signum", "file", "all_threads", "chain", NULL};
+ int signum;
+ PyObject *file = NULL;
+ int all_threads = 1;
+ int chain = 0;
+ int fd;
+ user_signal_t *user;
+ _Py_sighandler_t previous;
+ PyThreadState *tstate;
+ int err;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "i|Opp:register", kwlist,
+ &signum, &file, &all_threads, &chain))
+ return NULL;
+
+ if (!check_signum(signum))
+ return NULL;
+
+ tstate = get_thread_state();
+ if (tstate == NULL)
+ return NULL;
+
+ fd = faulthandler_get_fileno(&file);
+ if (fd < 0)
+ return NULL;
+
+ if (user_signals == NULL) {
+ user_signals = PyMem_Calloc(Py_NSIG, sizeof(user_signal_t));
+ if (user_signals == NULL)
+ return PyErr_NoMemory();
+ }
+ user = &user_signals[signum];
+
+ if (!user->enabled) {
+#ifdef FAULTHANDLER_USE_ALT_STACK
+ if (faulthandler_allocate_stack() < 0) {
+ return NULL;
+ }
+#endif
+
+ err = faulthandler_register(signum, chain, &previous);
+ if (err) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ user->previous = previous;
+ }
+
+ Py_XINCREF(file);
+ Py_XSETREF(user->file, file);
+ user->fd = fd;
+ user->all_threads = all_threads;
+ user->chain = chain;
+ user->interp = PyThreadState_GetInterpreter(tstate);
+ user->enabled = 1;
+
+ Py_RETURN_NONE;
+}
+
+static int
+faulthandler_unregister(user_signal_t *user, int signum)
+{
+ if (!user->enabled)
+ return 0;
+ user->enabled = 0;
+#ifdef HAVE_SIGACTION
+ (void)sigaction(signum, &user->previous, NULL);
+#else
+ (void)signal(signum, user->previous);
+#endif
+ Py_CLEAR(user->file);
+ user->fd = -1;
+ return 1;
+}
+
+static PyObject*
+faulthandler_unregister_py(PyObject *self, PyObject *args)
+{
+ int signum;
+ user_signal_t *user;
+ int change;
+
+ if (!PyArg_ParseTuple(args, "i:unregister", &signum))
+ return NULL;
+
+ if (!check_signum(signum))
+ return NULL;
+
+ if (user_signals == NULL)
+ Py_RETURN_FALSE;
+
+ user = &user_signals[signum];
+ change = faulthandler_unregister(user, signum);
+ return PyBool_FromLong(change);
+}
+#endif /* FAULTHANDLER_USER */
+
+
+static void
+faulthandler_suppress_crash_report(void)
+{
+#ifdef MS_WINDOWS_DESKTOP
+ UINT mode;
+
+ /* Configure Windows to not display the Windows Error Reporting dialog */
+ mode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
+ SetErrorMode(mode | SEM_NOGPFAULTERRORBOX);
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+ struct rlimit rl;
+
+ /* Disable creation of core dump */
+ if (getrlimit(RLIMIT_CORE, &rl) == 0) {
+ rl.rlim_cur = 0;
+ setrlimit(RLIMIT_CORE, &rl);
+ }
+#endif
+
+#ifdef _MSC_VER
+ /* Visual Studio: configure abort() to not display an error message nor
+ open a popup asking to report the fault. */
+ _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
+#endif
+}
+
+static PyObject* _Py_NO_SANITIZE_UNDEFINED
+faulthandler_read_null(PyObject *self, PyObject *args)
+{
+ volatile int *x;
+ volatile int y;
+
+ faulthandler_suppress_crash_report();
+ x = NULL;
+ y = *x;
+ return PyLong_FromLong(y);
+
+}
+
+static void
+faulthandler_raise_sigsegv(void)
+{
+ faulthandler_suppress_crash_report();
+#if defined(MS_WINDOWS)
+ /* For SIGSEGV, faulthandler_fatal_error() restores the previous signal
+ handler and then gives back the execution flow to the program (without
+ explicitly calling the previous error handler). In a normal case, the
+ SIGSEGV was raised by the kernel because of a fault, and so if the
+ program retries to execute the same instruction, the fault will be
+ raised again.
+
+ Here the fault is simulated by a fake SIGSEGV signal raised by the
+ application. We have to raise SIGSEGV at lease twice: once for
+ faulthandler_fatal_error(), and one more time for the previous signal
+ handler. */
+ while(1)
+ raise(SIGSEGV);
+#else
+ raise(SIGSEGV);
+#endif
+}
+
+static PyObject *
+faulthandler_sigsegv(PyObject *self, PyObject *args)
+{
+ int release_gil = 0;
+ if (!PyArg_ParseTuple(args, "|i:_sigsegv", &release_gil))
+ return NULL;
+
+ if (release_gil) {
+ Py_BEGIN_ALLOW_THREADS
+ faulthandler_raise_sigsegv();
+ Py_END_ALLOW_THREADS
+ } else {
+ faulthandler_raise_sigsegv();
+ }
+ Py_RETURN_NONE;
+}
+
+static void _Py_NO_RETURN
+faulthandler_fatal_error_thread(void *plock)
+{
+ Py_FatalError("in new thread");
+}
+
+static PyObject *
+faulthandler_fatal_error_c_thread(PyObject *self, PyObject *args)
+{
+ long tid;
+ PyThread_type_lock lock;
+
+ faulthandler_suppress_crash_report();
+
+ lock = PyThread_allocate_lock();
+ if (lock == NULL)
+ return PyErr_NoMemory();
+
+ PyThread_acquire_lock(lock, WAIT_LOCK);
+
+ tid = PyThread_start_new_thread(faulthandler_fatal_error_thread, lock);
+ if (tid == -1) {
+ PyThread_free_lock(lock);
+ PyErr_SetString(PyExc_RuntimeError, "unable to start the thread");
+ return NULL;
+ }
+
+ /* wait until the thread completes: it will never occur, since Py_FatalError()
+ exits the process immediately. */
+ PyThread_acquire_lock(lock, WAIT_LOCK);
+ PyThread_release_lock(lock);
+ PyThread_free_lock(lock);
+
+ Py_RETURN_NONE;
+}
+
+static PyObject* _Py_NO_SANITIZE_UNDEFINED
+faulthandler_sigfpe(PyObject *self, PyObject *args)
+{
+ faulthandler_suppress_crash_report();
+
+ /* Do an integer division by zero: raise a SIGFPE on Intel CPU, but not on
+ PowerPC. Use volatile to disable compile-time optimizations. */
+ volatile int x = 1, y = 0, z;
+ z = x / y;
+
+ /* If the division by zero didn't raise a SIGFPE (e.g. on PowerPC),
+ raise it manually. */
+ raise(SIGFPE);
+
+ /* This line is never reached, but we pretend to make something with z
+ to silence a compiler warning. */
+ return PyLong_FromLong(z);
+}
+
+static PyObject *
+faulthandler_sigabrt(PyObject *self, PyObject *args)
+{
+ faulthandler_suppress_crash_report();
+ abort();
+ Py_RETURN_NONE;
+}
+
+#if defined(FAULTHANDLER_USE_ALT_STACK)
+#define FAULTHANDLER_STACK_OVERFLOW
+
+static uintptr_t
+stack_overflow(uintptr_t min_sp, uintptr_t max_sp, size_t *depth)
+{
+ /* Allocate (at least) 4096 bytes on the stack at each call.
+
+ bpo-23654, bpo-38965: use volatile keyword to prevent tail call
+ optimization. */
+ volatile unsigned char buffer[4096];
+ uintptr_t sp = (uintptr_t)&buffer;
+ *depth += 1;
+ if (sp < min_sp || max_sp < sp)
+ return sp;
+ buffer[0] = 1;
+ buffer[4095] = 0;
+ return stack_overflow(min_sp, max_sp, depth);
+}
+
+static PyObject *
+faulthandler_stack_overflow(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ size_t depth, size;
+ uintptr_t sp = (uintptr_t)&depth;
+ uintptr_t stop, lower_limit, upper_limit;
+
+ faulthandler_suppress_crash_report();
+ depth = 0;
+
+ if (STACK_OVERFLOW_MAX_SIZE <= sp) {
+ lower_limit = sp - STACK_OVERFLOW_MAX_SIZE;
+ }
+ else {
+ lower_limit = 0;
+ }
+
+ if (UINTPTR_MAX - STACK_OVERFLOW_MAX_SIZE >= sp) {
+ upper_limit = sp + STACK_OVERFLOW_MAX_SIZE;
+ }
+ else {
+ upper_limit = UINTPTR_MAX;
+ }
+
+ stop = stack_overflow(lower_limit, upper_limit, &depth);
+ if (sp < stop)
+ size = stop - sp;
+ else
+ size = sp - stop;
+ PyErr_Format(PyExc_RuntimeError,
+ "unable to raise a stack overflow (allocated %zu bytes "
+ "on the stack, %zu recursive calls)",
+ size, depth);
+ return NULL;
+}
+#endif /* defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_SIGACTION) */
+
+
+static int
+faulthandler_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ Py_VISIT(thread.file);
+#ifdef FAULTHANDLER_USER
+ if (user_signals != NULL) {
+ for (size_t signum=0; signum < Py_NSIG; signum++)
+ Py_VISIT(user_signals[signum].file);
+ }
+#endif
+ Py_VISIT(fatal_error.file);
+ return 0;
+}
+
+#ifdef MS_WINDOWS
+static PyObject *
+faulthandler_raise_exception(PyObject *self, PyObject *args)
+{
+ unsigned int code, flags = 0;
+ if (!PyArg_ParseTuple(args, "I|I:_raise_exception", &code, &flags))
+ return NULL;
+ faulthandler_suppress_crash_report();
+ RaiseException(code, flags, 0, NULL);
+ Py_RETURN_NONE;
+}
+#endif
+
+PyDoc_STRVAR(module_doc,
+"faulthandler module.");
+
+static PyMethodDef module_methods[] = {
+ {"enable",
+ _PyCFunction_CAST(faulthandler_py_enable), METH_VARARGS|METH_KEYWORDS,
+ PyDoc_STR("enable(file=sys.stderr, all_threads=True): "
+ "enable the fault handler")},
+ {"disable", faulthandler_disable_py, METH_NOARGS,
+ PyDoc_STR("disable(): disable the fault handler")},
+ {"is_enabled", faulthandler_is_enabled, METH_NOARGS,
+ PyDoc_STR("is_enabled()->bool: check if the handler is enabled")},
+ {"dump_traceback",
+ _PyCFunction_CAST(faulthandler_dump_traceback_py), METH_VARARGS|METH_KEYWORDS,
+ PyDoc_STR("dump_traceback(file=sys.stderr, all_threads=True): "
+ "dump the traceback of the current thread, or of all threads "
+ "if all_threads is True, into file")},
+ {"dump_traceback_later",
+ _PyCFunction_CAST(faulthandler_dump_traceback_later), METH_VARARGS|METH_KEYWORDS,
+ PyDoc_STR("dump_traceback_later(timeout, repeat=False, file=sys.stderr, exit=False):\n"
+ "dump the traceback of all threads in timeout seconds,\n"
+ "or each timeout seconds if repeat is True. If exit is True, "
+ "call _exit(1) which is not safe.")},
+ {"cancel_dump_traceback_later",
+ faulthandler_cancel_dump_traceback_later_py, METH_NOARGS,
+ PyDoc_STR("cancel_dump_traceback_later():\ncancel the previous call "
+ "to dump_traceback_later().")},
+#ifdef FAULTHANDLER_USER
+ {"register",
+ _PyCFunction_CAST(faulthandler_register_py), METH_VARARGS|METH_KEYWORDS,
+ PyDoc_STR("register(signum, file=sys.stderr, all_threads=True, chain=False): "
+ "register a handler for the signal 'signum': dump the "
+ "traceback of the current thread, or of all threads if "
+ "all_threads is True, into file")},
+ {"unregister",
+ _PyCFunction_CAST(faulthandler_unregister_py), METH_VARARGS|METH_KEYWORDS,
+ PyDoc_STR("unregister(signum): unregister the handler of the signal "
+ "'signum' registered by register()")},
+#endif
+ {"_read_null", faulthandler_read_null, METH_NOARGS,
+ PyDoc_STR("_read_null(): read from NULL, raise "
+ "a SIGSEGV or SIGBUS signal depending on the platform")},
+ {"_sigsegv", faulthandler_sigsegv, METH_VARARGS,
+ PyDoc_STR("_sigsegv(release_gil=False): raise a SIGSEGV signal")},
+ {"_fatal_error_c_thread", faulthandler_fatal_error_c_thread, METH_NOARGS,
+ PyDoc_STR("fatal_error_c_thread(): "
+ "call Py_FatalError() in a new C thread.")},
+ {"_sigabrt", faulthandler_sigabrt, METH_NOARGS,
+ PyDoc_STR("_sigabrt(): raise a SIGABRT signal")},
+ {"_sigfpe", (PyCFunction)faulthandler_sigfpe, METH_NOARGS,
+ PyDoc_STR("_sigfpe(): raise a SIGFPE signal")},
+#ifdef FAULTHANDLER_STACK_OVERFLOW
+ {"_stack_overflow", faulthandler_stack_overflow, METH_NOARGS,
+ PyDoc_STR("_stack_overflow(): recursive call to raise a stack overflow")},
+#endif
+#ifdef MS_WINDOWS
+ {"_raise_exception", faulthandler_raise_exception, METH_VARARGS,
+ PyDoc_STR("raise_exception(code, flags=0): Call RaiseException(code, flags).")},
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+PyExec_faulthandler(PyObject *module) {
+ /* Add constants for unit tests */
+#ifdef MS_WINDOWS
+ /* RaiseException() codes (prefixed by an underscore) */
+ if (PyModule_AddIntConstant(module, "_EXCEPTION_ACCESS_VIOLATION",
+ EXCEPTION_ACCESS_VIOLATION)) {
+ return -1;
+ }
+ if (PyModule_AddIntConstant(module, "_EXCEPTION_INT_DIVIDE_BY_ZERO",
+ EXCEPTION_INT_DIVIDE_BY_ZERO)) {
+ return -1;
+ }
+ if (PyModule_AddIntConstant(module, "_EXCEPTION_STACK_OVERFLOW",
+ EXCEPTION_STACK_OVERFLOW)) {
+ return -1;
+ }
+
+ /* RaiseException() flags (prefixed by an underscore) */
+ if (PyModule_AddIntConstant(module, "_EXCEPTION_NONCONTINUABLE",
+ EXCEPTION_NONCONTINUABLE)) {
+ return -1;
+ }
+ if (PyModule_AddIntConstant(module, "_EXCEPTION_NONCONTINUABLE_EXCEPTION",
+ EXCEPTION_NONCONTINUABLE_EXCEPTION)) {
+ return -1;
+ }
+#endif
+ return 0;
+}
+
+static PyModuleDef_Slot faulthandler_slots[] = {
+ {Py_mod_exec, PyExec_faulthandler},
+ // XXX gh-103092: fix isolation.
+ //{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef module_def = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "faulthandler",
+ .m_doc = module_doc,
+ .m_methods = module_methods,
+ .m_traverse = faulthandler_traverse,
+ .m_slots = faulthandler_slots
+};
+
+PyMODINIT_FUNC
+PyInit_faulthandler(void)
+{
+ return PyModuleDef_Init(&module_def);
+}
+
+static int
+faulthandler_init_enable(void)
+{
+ PyObject *enable = _PyImport_GetModuleAttrString("faulthandler", "enable");
+ if (enable == NULL) {
+ return -1;
+ }
+
+ PyObject *res = PyObject_CallNoArgs(enable);
+ Py_DECREF(enable);
+ if (res == NULL) {
+ return -1;
+ }
+ Py_DECREF(res);
+
+ return 0;
+}
+
+PyStatus
+_PyFaulthandler_Init(int enable)
+{
+#ifdef FAULTHANDLER_USE_ALT_STACK
+ memset(&stack, 0, sizeof(stack));
+ stack.ss_flags = 0;
+ /* bpo-21131: allocate dedicated stack of SIGSTKSZ*2 bytes, instead of just
+ SIGSTKSZ bytes. Calling the previous signal handler in faulthandler
+ signal handler uses more than SIGSTKSZ bytes of stack memory on some
+ platforms. */
+ stack.ss_size = SIGSTKSZ * 2;
+#ifdef AT_MINSIGSTKSZ
+ /* bpo-46968: Query Linux for minimal stack size to ensure signal delivery
+ for the hardware running CPython. This OS feature is available in
+ Linux kernel version >= 5.14 */
+ unsigned long at_minstack_size = getauxval(AT_MINSIGSTKSZ);
+ if (at_minstack_size != 0) {
+ stack.ss_size = SIGSTKSZ + at_minstack_size;
+ }
+#endif
+#endif
+
+ memset(&thread, 0, sizeof(thread));
+
+ if (enable) {
+ if (faulthandler_init_enable() < 0) {
+ return _PyStatus_ERR("failed to enable faulthandler");
+ }
+ }
+ return _PyStatus_OK();
+}
+
+void _PyFaulthandler_Fini(void)
+{
+ /* later */
+ if (thread.cancel_event) {
+ cancel_dump_traceback_later();
+ PyThread_release_lock(thread.cancel_event);
+ PyThread_free_lock(thread.cancel_event);
+ thread.cancel_event = NULL;
+ }
+ if (thread.running) {
+ PyThread_free_lock(thread.running);
+ thread.running = NULL;
+ }
+
+#ifdef FAULTHANDLER_USER
+ /* user */
+ if (user_signals != NULL) {
+ for (size_t signum=0; signum < Py_NSIG; signum++) {
+ faulthandler_unregister(&user_signals[signum], signum);
+ }
+ PyMem_Free(user_signals);
+ user_signals = NULL;
+ }
+#endif
+
+ /* fatal */
+ faulthandler_disable();
+
+#ifdef FAULTHANDLER_USE_ALT_STACK
+ if (stack.ss_sp != NULL) {
+ /* Fetch the current alt stack */
+ stack_t current_stack;
+ memset(&current_stack, 0, sizeof(current_stack));
+ if (sigaltstack(NULL, &current_stack) == 0) {
+ if (current_stack.ss_sp == stack.ss_sp) {
+ /* The current alt stack is the one that we installed.
+ It is safe to restore the old stack that we found when
+ we installed ours */
+ sigaltstack(&old_stack, NULL);
+ } else {
+ /* Someone switched to a different alt stack and didn't
+ restore ours when they were done (if they're done).
+ There's not much we can do in this unlikely case */
+ }
+ }
+ PyMem_Free(stack.ss_sp);
+ stack.ss_sp = NULL;
+ }
+#endif
+}
diff --git a/contrib/tools/python3/Modules/fcntlmodule.c b/contrib/tools/python3/Modules/fcntlmodule.c
new file mode 100644
index 00000000000..2bca40213c6
--- /dev/null
+++ b/contrib/tools/python3/Modules/fcntlmodule.c
@@ -0,0 +1,707 @@
+
+/* fcntl module */
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h>
+#endif
+
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+
+/*[clinic input]
+module fcntl
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=124b58387c158179]*/
+
+#include "clinic/fcntlmodule.c.h"
+
+/*[clinic input]
+fcntl.fcntl
+
+ fd: fildes
+ cmd as code: int
+ arg: object(c_default='NULL') = 0
+ /
+
+Perform the operation `cmd` on file descriptor fd.
+
+The values used for `cmd` are operating system dependent, and are available
+as constants in the fcntl module, using the same names as used in
+the relevant C header files. The argument arg is optional, and
+defaults to 0; it may be an int or a string. If arg is given as a string,
+the return value of fcntl is a string of that length, containing the
+resulting value put in the arg buffer by the operating system. The length
+of the arg string is not allowed to exceed 1024 bytes. If the arg given
+is an integer or if none is specified, the result value is an integer
+corresponding to the return value of the fcntl call in the C code.
+[clinic start generated code]*/
+
+static PyObject *
+fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
+/*[clinic end generated code: output=888fc93b51c295bd input=7955340198e5f334]*/
+{
+ unsigned int int_arg = 0;
+ int ret;
+ char *str;
+ Py_ssize_t len;
+ char buf[1024];
+ int async_err = 0;
+
+ if (PySys_Audit("fcntl.fcntl", "iiO", fd, code, arg ? arg : Py_None) < 0) {
+ return NULL;
+ }
+
+ if (arg != NULL) {
+ int parse_result;
+
+ if (PyArg_Parse(arg, "s#", &str, &len)) {
+ if ((size_t)len > sizeof buf) {
+ PyErr_SetString(PyExc_ValueError,
+ "fcntl string arg too long");
+ return NULL;
+ }
+ memcpy(buf, str, len);
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = fcntl(fd, code, buf);
+ Py_END_ALLOW_THREADS
+ } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (ret < 0) {
+ return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL;
+ }
+ return PyBytes_FromStringAndSize(buf, len);
+ }
+
+ PyErr_Clear();
+ parse_result = PyArg_Parse(arg,
+ "I;fcntl requires a file or file descriptor,"
+ " an integer and optionally a third integer or a string",
+ &int_arg);
+ if (!parse_result) {
+ return NULL;
+ }
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = fcntl(fd, code, (int)int_arg);
+ Py_END_ALLOW_THREADS
+ } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (ret < 0) {
+ return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL;
+ }
+ return PyLong_FromLong((long)ret);
+}
+
+
+/*[clinic input]
+fcntl.ioctl
+
+ fd: fildes
+ request as code: unsigned_int(bitwise=True)
+ arg as ob_arg: object(c_default='NULL') = 0
+ mutate_flag as mutate_arg: bool = True
+ /
+
+Perform the operation `request` on file descriptor `fd`.
+
+The values used for `request` are operating system dependent, and are available
+as constants in the fcntl or termios library modules, using the same names as
+used in the relevant C header files.
+
+The argument `arg` is optional, and defaults to 0; it may be an int or a
+buffer containing character data (most likely a string or an array).
+
+If the argument is a mutable buffer (such as an array) and if the
+mutate_flag argument (which is only allowed in this case) is true then the
+buffer is (in effect) passed to the operating system and changes made by
+the OS will be reflected in the contents of the buffer after the call has
+returned. The return value is the integer returned by the ioctl system
+call.
+
+If the argument is a mutable buffer and the mutable_flag argument is false,
+the behavior is as if a string had been passed.
+
+If the argument is an immutable buffer (most likely a string) then a copy
+of the buffer is passed to the operating system and the return value is a
+string of the same length containing whatever the operating system put in
+the buffer. The length of the arg buffer in this case is not allowed to
+exceed 1024 bytes.
+
+If the arg given is an integer or if none is specified, the result value is
+an integer corresponding to the return value of the ioctl call in the C
+code.
+[clinic start generated code]*/
+
+static PyObject *
+fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
+ PyObject *ob_arg, int mutate_arg)
+/*[clinic end generated code: output=7f7f5840c65991be input=967b4a4cbeceb0a8]*/
+{
+#define IOCTL_BUFSZ 1024
+ /* We use the unsigned non-checked 'I' format for the 'code' parameter
+ because the system expects it to be a 32bit bit field value
+ regardless of it being passed as an int or unsigned long on
+ various platforms. See the termios.TIOCSWINSZ constant across
+ platforms for an example of this.
+
+ If any of the 64bit platforms ever decide to use more than 32bits
+ in their unsigned long ioctl codes this will break and need
+ special casing based on the platform being built on.
+ */
+ int arg = 0;
+ int ret;
+ Py_buffer pstr;
+ char *str;
+ Py_ssize_t len;
+ char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */
+
+ if (PySys_Audit("fcntl.ioctl", "iIO", fd, code,
+ ob_arg ? ob_arg : Py_None) < 0) {
+ return NULL;
+ }
+
+ if (ob_arg != NULL) {
+ if (PyArg_Parse(ob_arg, "w*:ioctl", &pstr)) {
+ char *arg;
+ str = pstr.buf;
+ len = pstr.len;
+
+ if (mutate_arg) {
+ if (len <= IOCTL_BUFSZ) {
+ memcpy(buf, str, len);
+ buf[len] = '\0';
+ arg = buf;
+ }
+ else {
+ arg = str;
+ }
+ }
+ else {
+ if (len > IOCTL_BUFSZ) {
+ PyBuffer_Release(&pstr);
+ PyErr_SetString(PyExc_ValueError,
+ "ioctl string arg too long");
+ return NULL;
+ }
+ else {
+ memcpy(buf, str, len);
+ buf[len] = '\0';
+ arg = buf;
+ }
+ }
+ if (buf == arg) {
+ Py_BEGIN_ALLOW_THREADS /* think array.resize() */
+ ret = ioctl(fd, code, arg);
+ Py_END_ALLOW_THREADS
+ }
+ else {
+ ret = ioctl(fd, code, arg);
+ }
+ if (mutate_arg && (len <= IOCTL_BUFSZ)) {
+ memcpy(str, buf, len);
+ }
+ if (ret < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ PyBuffer_Release(&pstr);
+ return NULL;
+ }
+ PyBuffer_Release(&pstr);
+ if (mutate_arg) {
+ return PyLong_FromLong(ret);
+ }
+ else {
+ return PyBytes_FromStringAndSize(buf, len);
+ }
+ }
+
+ PyErr_Clear();
+ if (PyArg_Parse(ob_arg, "s*:ioctl", &pstr)) {
+ str = pstr.buf;
+ len = pstr.len;
+ if (len > IOCTL_BUFSZ) {
+ PyBuffer_Release(&pstr);
+ PyErr_SetString(PyExc_ValueError,
+ "ioctl string arg too long");
+ return NULL;
+ }
+ memcpy(buf, str, len);
+ buf[len] = '\0';
+ Py_BEGIN_ALLOW_THREADS
+ ret = ioctl(fd, code, buf);
+ Py_END_ALLOW_THREADS
+ if (ret < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ PyBuffer_Release(&pstr);
+ return NULL;
+ }
+ PyBuffer_Release(&pstr);
+ return PyBytes_FromStringAndSize(buf, len);
+ }
+
+ PyErr_Clear();
+ if (!PyArg_Parse(ob_arg,
+ "i;ioctl requires a file or file descriptor,"
+ " an integer and optionally an integer or buffer argument",
+ &arg)) {
+ return NULL;
+ }
+ // Fall-through to outside the 'if' statement.
+ }
+ Py_BEGIN_ALLOW_THREADS
+ ret = ioctl(fd, code, arg);
+ Py_END_ALLOW_THREADS
+ if (ret < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyLong_FromLong((long)ret);
+#undef IOCTL_BUFSZ
+}
+
+/*[clinic input]
+fcntl.flock
+
+ fd: fildes
+ operation as code: int
+ /
+
+Perform the lock operation `operation` on file descriptor `fd`.
+
+See the Unix manual page for flock(2) for details (On some systems, this
+function is emulated using fcntl()).
+[clinic start generated code]*/
+
+static PyObject *
+fcntl_flock_impl(PyObject *module, int fd, int code)
+/*[clinic end generated code: output=84059e2b37d2fc64 input=0bfc00f795953452]*/
+{
+ int ret;
+ int async_err = 0;
+
+ if (PySys_Audit("fcntl.flock", "ii", fd, code) < 0) {
+ return NULL;
+ }
+
+#ifdef HAVE_FLOCK
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = flock(fd, code);
+ Py_END_ALLOW_THREADS
+ } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+#else
+
+#ifndef LOCK_SH
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* don't block when locking */
+#define LOCK_UN 8 /* unlock */
+#endif
+ {
+ struct flock l;
+ if (code == LOCK_UN)
+ l.l_type = F_UNLCK;
+ else if (code & LOCK_SH)
+ l.l_type = F_RDLCK;
+ else if (code & LOCK_EX)
+ l.l_type = F_WRLCK;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "unrecognized flock argument");
+ return NULL;
+ }
+ l.l_whence = l.l_start = l.l_len = 0;
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l);
+ Py_END_ALLOW_THREADS
+ } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ }
+#endif /* HAVE_FLOCK */
+ if (ret < 0) {
+ return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+fcntl.lockf
+
+ fd: fildes
+ cmd as code: int
+ len as lenobj: object(c_default='NULL') = 0
+ start as startobj: object(c_default='NULL') = 0
+ whence: int = 0
+ /
+
+A wrapper around the fcntl() locking calls.
+
+`fd` is the file descriptor of the file to lock or unlock, and operation is one
+of the following values:
+
+ LOCK_UN - unlock
+ LOCK_SH - acquire a shared lock
+ LOCK_EX - acquire an exclusive lock
+
+When operation is LOCK_SH or LOCK_EX, it can also be bitwise ORed with
+LOCK_NB to avoid blocking on lock acquisition. If LOCK_NB is used and the
+lock cannot be acquired, an OSError will be raised and the exception will
+have an errno attribute set to EACCES or EAGAIN (depending on the operating
+system -- for portability, check for either value).
+
+`len` is the number of bytes to lock, with the default meaning to lock to
+EOF. `start` is the byte offset, relative to `whence`, to that the lock
+starts. `whence` is as with fileobj.seek(), specifically:
+
+ 0 - relative to the start of the file (SEEK_SET)
+ 1 - relative to the current buffer position (SEEK_CUR)
+ 2 - relative to the end of the file (SEEK_END)
+[clinic start generated code]*/
+
+static PyObject *
+fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
+ PyObject *startobj, int whence)
+/*[clinic end generated code: output=4985e7a172e7461a input=5480479fc63a04b8]*/
+{
+ int ret;
+ int async_err = 0;
+
+ if (PySys_Audit("fcntl.lockf", "iiOOi", fd, code, lenobj ? lenobj : Py_None,
+ startobj ? startobj : Py_None, whence) < 0) {
+ return NULL;
+ }
+
+#ifndef LOCK_SH
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* don't block when locking */
+#define LOCK_UN 8 /* unlock */
+#endif /* LOCK_SH */
+ {
+ struct flock l;
+ if (code == LOCK_UN)
+ l.l_type = F_UNLCK;
+ else if (code & LOCK_SH)
+ l.l_type = F_RDLCK;
+ else if (code & LOCK_EX)
+ l.l_type = F_WRLCK;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "unrecognized lockf argument");
+ return NULL;
+ }
+ l.l_start = l.l_len = 0;
+ if (startobj != NULL) {
+#if !defined(HAVE_LARGEFILE_SUPPORT)
+ l.l_start = PyLong_AsLong(startobj);
+#else
+ l.l_start = PyLong_Check(startobj) ?
+ PyLong_AsLongLong(startobj) :
+ PyLong_AsLong(startobj);
+#endif
+ if (PyErr_Occurred())
+ return NULL;
+ }
+ if (lenobj != NULL) {
+#if !defined(HAVE_LARGEFILE_SUPPORT)
+ l.l_len = PyLong_AsLong(lenobj);
+#else
+ l.l_len = PyLong_Check(lenobj) ?
+ PyLong_AsLongLong(lenobj) :
+ PyLong_AsLong(lenobj);
+#endif
+ if (PyErr_Occurred())
+ return NULL;
+ }
+ l.l_whence = whence;
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = fcntl(fd, (code & LOCK_NB) ? F_SETLK : F_SETLKW, &l);
+ Py_END_ALLOW_THREADS
+ } while (ret == -1 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ }
+ if (ret < 0) {
+ return !async_err ? PyErr_SetFromErrno(PyExc_OSError) : NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/* List of functions */
+
+static PyMethodDef fcntl_methods[] = {
+ FCNTL_FCNTL_METHODDEF
+ FCNTL_IOCTL_METHODDEF
+ FCNTL_FLOCK_METHODDEF
+ FCNTL_LOCKF_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+PyDoc_STRVAR(module_doc,
+"This module performs file control and I/O control on file\n\
+descriptors. It is an interface to the fcntl() and ioctl() Unix\n\
+routines. File descriptors can be obtained with the fileno() method of\n\
+a file or socket object.");
+
+/* Module initialisation */
+
+
+static int
+all_ins(PyObject* m)
+{
+ if (PyModule_AddIntMacro(m, LOCK_SH)) return -1;
+ if (PyModule_AddIntMacro(m, LOCK_EX)) return -1;
+ if (PyModule_AddIntMacro(m, LOCK_NB)) return -1;
+ if (PyModule_AddIntMacro(m, LOCK_UN)) return -1;
+/* GNU extensions, as of glibc 2.2.4 */
+#ifdef LOCK_MAND
+ if (PyModule_AddIntMacro(m, LOCK_MAND)) return -1;
+#endif
+#ifdef LOCK_READ
+ if (PyModule_AddIntMacro(m, LOCK_READ)) return -1;
+#endif
+#ifdef LOCK_WRITE
+ if (PyModule_AddIntMacro(m, LOCK_WRITE)) return -1;
+#endif
+#ifdef LOCK_RW
+ if (PyModule_AddIntMacro(m, LOCK_RW)) return -1;
+#endif
+
+#ifdef F_DUPFD
+ if (PyModule_AddIntMacro(m, F_DUPFD)) return -1;
+#endif
+#ifdef F_DUPFD_CLOEXEC
+ if (PyModule_AddIntMacro(m, F_DUPFD_CLOEXEC)) return -1;
+#endif
+#ifdef F_GETFD
+ if (PyModule_AddIntMacro(m, F_GETFD)) return -1;
+#endif
+#ifdef F_SETFD
+ if (PyModule_AddIntMacro(m, F_SETFD)) return -1;
+#endif
+#ifdef F_GETFL
+ if (PyModule_AddIntMacro(m, F_GETFL)) return -1;
+#endif
+#ifdef F_SETFL
+ if (PyModule_AddIntMacro(m, F_SETFL)) return -1;
+#endif
+#ifdef F_GETLK
+ if (PyModule_AddIntMacro(m, F_GETLK)) return -1;
+#endif
+#ifdef F_SETLK
+ if (PyModule_AddIntMacro(m, F_SETLK)) return -1;
+#endif
+#ifdef F_SETLKW
+ if (PyModule_AddIntMacro(m, F_SETLKW)) return -1;
+#endif
+#ifdef F_OFD_GETLK
+ if (PyModule_AddIntMacro(m, F_OFD_GETLK)) return -1;
+#endif
+#ifdef F_OFD_SETLK
+ if (PyModule_AddIntMacro(m, F_OFD_SETLK)) return -1;
+#endif
+#ifdef F_OFD_SETLKW
+ if (PyModule_AddIntMacro(m, F_OFD_SETLKW)) return -1;
+#endif
+#ifdef F_GETOWN
+ if (PyModule_AddIntMacro(m, F_GETOWN)) return -1;
+#endif
+#ifdef F_SETOWN
+ if (PyModule_AddIntMacro(m, F_SETOWN)) return -1;
+#endif
+#ifdef F_GETPATH
+ if (PyModule_AddIntMacro(m, F_GETPATH)) return -1;
+#endif
+#ifdef F_GETSIG
+ if (PyModule_AddIntMacro(m, F_GETSIG)) return -1;
+#endif
+#ifdef F_SETSIG
+ if (PyModule_AddIntMacro(m, F_SETSIG)) return -1;
+#endif
+#ifdef F_RDLCK
+ if (PyModule_AddIntMacro(m, F_RDLCK)) return -1;
+#endif
+#ifdef F_WRLCK
+ if (PyModule_AddIntMacro(m, F_WRLCK)) return -1;
+#endif
+#ifdef F_UNLCK
+ if (PyModule_AddIntMacro(m, F_UNLCK)) return -1;
+#endif
+/* LFS constants */
+#ifdef F_GETLK64
+ if (PyModule_AddIntMacro(m, F_GETLK64)) return -1;
+#endif
+#ifdef F_SETLK64
+ if (PyModule_AddIntMacro(m, F_SETLK64)) return -1;
+#endif
+#ifdef F_SETLKW64
+ if (PyModule_AddIntMacro(m, F_SETLKW64)) return -1;
+#endif
+/* GNU extensions, as of glibc 2.2.4. */
+#ifdef FASYNC
+ if (PyModule_AddIntMacro(m, FASYNC)) return -1;
+#endif
+#ifdef F_SETLEASE
+ if (PyModule_AddIntMacro(m, F_SETLEASE)) return -1;
+#endif
+#ifdef F_GETLEASE
+ if (PyModule_AddIntMacro(m, F_GETLEASE)) return -1;
+#endif
+#ifdef F_NOTIFY
+ if (PyModule_AddIntMacro(m, F_NOTIFY)) return -1;
+#endif
+/* Old BSD flock(). */
+#ifdef F_EXLCK
+ if (PyModule_AddIntMacro(m, F_EXLCK)) return -1;
+#endif
+#ifdef F_SHLCK
+ if (PyModule_AddIntMacro(m, F_SHLCK)) return -1;
+#endif
+
+/* Linux specifics */
+#ifdef F_SETPIPE_SZ
+ if (PyModule_AddIntMacro(m, F_SETPIPE_SZ)) return -1;
+#endif
+#ifdef F_GETPIPE_SZ
+ if (PyModule_AddIntMacro(m, F_GETPIPE_SZ)) return -1;
+#endif
+#ifdef FICLONE
+ if (PyModule_AddIntMacro(m, FICLONE)) return -1;
+#endif
+#ifdef FICLONERANGE
+ if (PyModule_AddIntMacro(m, FICLONERANGE)) return -1;
+#endif
+
+/* OS X specifics */
+#ifdef F_FULLFSYNC
+ if (PyModule_AddIntMacro(m, F_FULLFSYNC)) return -1;
+#endif
+#ifdef F_NOCACHE
+ if (PyModule_AddIntMacro(m, F_NOCACHE)) return -1;
+#endif
+
+/* FreeBSD specifics */
+#ifdef F_DUP2FD
+ if (PyModule_AddIntMacro(m, F_DUP2FD)) return -1;
+#endif
+#ifdef F_DUP2FD_CLOEXEC
+ if (PyModule_AddIntMacro(m, F_DUP2FD_CLOEXEC)) return -1;
+#endif
+
+/* For F_{GET|SET}FL */
+#ifdef FD_CLOEXEC
+ if (PyModule_AddIntMacro(m, FD_CLOEXEC)) return -1;
+#endif
+
+/* For F_NOTIFY */
+#ifdef DN_ACCESS
+ if (PyModule_AddIntMacro(m, DN_ACCESS)) return -1;
+#endif
+#ifdef DN_MODIFY
+ if (PyModule_AddIntMacro(m, DN_MODIFY)) return -1;
+#endif
+#ifdef DN_CREATE
+ if (PyModule_AddIntMacro(m, DN_CREATE)) return -1;
+#endif
+#ifdef DN_DELETE
+ if (PyModule_AddIntMacro(m, DN_DELETE)) return -1;
+#endif
+#ifdef DN_RENAME
+ if (PyModule_AddIntMacro(m, DN_RENAME)) return -1;
+#endif
+#ifdef DN_ATTRIB
+ if (PyModule_AddIntMacro(m, DN_ATTRIB)) return -1;
+#endif
+#ifdef DN_MULTISHOT
+ if (PyModule_AddIntMacro(m, DN_MULTISHOT)) return -1;
+#endif
+
+#ifdef HAVE_STROPTS_H
+ /* Unix 98 guarantees that these are in stropts.h. */
+ if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
+ if (PyModule_AddIntMacro(m, I_POP)) return -1;
+ if (PyModule_AddIntMacro(m, I_LOOK)) return -1;
+ if (PyModule_AddIntMacro(m, I_FLUSH)) return -1;
+ if (PyModule_AddIntMacro(m, I_FLUSHBAND)) return -1;
+ if (PyModule_AddIntMacro(m, I_SETSIG)) return -1;
+ if (PyModule_AddIntMacro(m, I_GETSIG)) return -1;
+ if (PyModule_AddIntMacro(m, I_FIND)) return -1;
+ if (PyModule_AddIntMacro(m, I_PEEK)) return -1;
+ if (PyModule_AddIntMacro(m, I_SRDOPT)) return -1;
+ if (PyModule_AddIntMacro(m, I_GRDOPT)) return -1;
+ if (PyModule_AddIntMacro(m, I_NREAD)) return -1;
+ if (PyModule_AddIntMacro(m, I_FDINSERT)) return -1;
+ if (PyModule_AddIntMacro(m, I_STR)) return -1;
+ if (PyModule_AddIntMacro(m, I_SWROPT)) return -1;
+#ifdef I_GWROPT
+ /* despite the comment above, old-ish glibcs miss a couple... */
+ if (PyModule_AddIntMacro(m, I_GWROPT)) return -1;
+#endif
+ if (PyModule_AddIntMacro(m, I_SENDFD)) return -1;
+ if (PyModule_AddIntMacro(m, I_RECVFD)) return -1;
+ if (PyModule_AddIntMacro(m, I_LIST)) return -1;
+ if (PyModule_AddIntMacro(m, I_ATMARK)) return -1;
+ if (PyModule_AddIntMacro(m, I_CKBAND)) return -1;
+ if (PyModule_AddIntMacro(m, I_GETBAND)) return -1;
+ if (PyModule_AddIntMacro(m, I_CANPUT)) return -1;
+ if (PyModule_AddIntMacro(m, I_SETCLTIME)) return -1;
+#ifdef I_GETCLTIME
+ if (PyModule_AddIntMacro(m, I_GETCLTIME)) return -1;
+#endif
+ if (PyModule_AddIntMacro(m, I_LINK)) return -1;
+ if (PyModule_AddIntMacro(m, I_UNLINK)) return -1;
+ if (PyModule_AddIntMacro(m, I_PLINK)) return -1;
+ if (PyModule_AddIntMacro(m, I_PUNLINK)) return -1;
+#endif
+#ifdef F_ADD_SEALS
+ /* Linux: file sealing for memfd_create() */
+ if (PyModule_AddIntMacro(m, F_ADD_SEALS)) return -1;
+ if (PyModule_AddIntMacro(m, F_GET_SEALS)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_SEAL)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_SHRINK)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_GROW)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_WRITE)) return -1;
+#endif
+ return 0;
+}
+
+static int
+fcntl_exec(PyObject *module)
+{
+ if (all_ins(module) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot fcntl_slots[] = {
+ {Py_mod_exec, fcntl_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef fcntlmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "fcntl",
+ .m_doc = module_doc,
+ .m_size = 0,
+ .m_methods = fcntl_methods,
+ .m_slots = fcntl_slots,
+};
+
+PyMODINIT_FUNC
+PyInit_fcntl(void)
+{
+ return PyModuleDef_Init(&fcntlmodule);
+}
diff --git a/contrib/tools/python3/Modules/gcmodule.c b/contrib/tools/python3/Modules/gcmodule.c
new file mode 100644
index 00000000000..b7cb30ab7ed
--- /dev/null
+++ b/contrib/tools/python3/Modules/gcmodule.c
@@ -0,0 +1,2444 @@
+/*
+
+ Reference Cycle Garbage Collection
+ ==================================
+
+ Neil Schemenauer <[email protected]>
+
+ Based on a post on the python-dev list. Ideas from Guido van Rossum,
+ Eric Tiedemann, and various others.
+
+ http://www.arctrix.com/nas/python/gc/
+
+ The following mailing list threads provide a historical perspective on
+ the design of this module. Note that a fair amount of refinement has
+ occurred since those discussions.
+
+ http://mail.python.org/pipermail/python-dev/2000-March/002385.html
+ http://mail.python.org/pipermail/python-dev/2000-March/002434.html
+ http://mail.python.org/pipermail/python-dev/2000-March/002497.html
+
+ For a highlevel view of the collection process, read the collect
+ function.
+
+*/
+
+#include "Python.h"
+#include "pycore_context.h"
+#include "pycore_initconfig.h"
+#include "pycore_interp.h" // PyInterpreterState.gc
+#include "pycore_object.h"
+#include "pycore_pyerrors.h"
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pydtrace.h"
+
+typedef struct _gc_runtime_state GCState;
+
+/*[clinic input]
+module gc
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b5c9690ecc842d79]*/
+
+
+#ifdef Py_DEBUG
+# ifndef GC_NDEBUG
+# define GC_DEBUG
+# endif
+#endif
+
+#define GC_NEXT _PyGCHead_NEXT
+#define GC_PREV _PyGCHead_PREV
+
+// update_refs() set this bit for all objects in current generation.
+// subtract_refs() and move_unreachable() uses this to distinguish
+// visited object is in GCing or not.
+//
+// move_unreachable() removes this flag from reachable objects.
+// Only unreachable objects have this flag.
+//
+// No objects in interpreter have this flag after GC ends.
+#define PREV_MASK_COLLECTING _PyGC_PREV_MASK_COLLECTING
+
+// Lowest bit of _gc_next is used for UNREACHABLE flag.
+//
+// This flag represents the object is in unreachable list in move_unreachable()
+//
+// Although this flag is used only in move_unreachable(), move_unreachable()
+// doesn't clear this flag to skip unnecessary iteration.
+// move_legacy_finalizers() removes this flag instead.
+// Between them, unreachable list is not normal list and we can not use
+// most gc_list_* functions for it.
+#define NEXT_MASK_UNREACHABLE (1)
+
+/* Get an object's GC head */
+#define AS_GC(o) ((PyGC_Head *)(((char *)(o))-sizeof(PyGC_Head)))
+
+/* Get the object given the GC head */
+#define FROM_GC(g) ((PyObject *)(((char *)(g))+sizeof(PyGC_Head)))
+
+static inline int
+gc_is_collecting(PyGC_Head *g)
+{
+ return (g->_gc_prev & PREV_MASK_COLLECTING) != 0;
+}
+
+static inline void
+gc_clear_collecting(PyGC_Head *g)
+{
+ g->_gc_prev &= ~PREV_MASK_COLLECTING;
+}
+
+static inline Py_ssize_t
+gc_get_refs(PyGC_Head *g)
+{
+ return (Py_ssize_t)(g->_gc_prev >> _PyGC_PREV_SHIFT);
+}
+
+static inline void
+gc_set_refs(PyGC_Head *g, Py_ssize_t refs)
+{
+ g->_gc_prev = (g->_gc_prev & ~_PyGC_PREV_MASK)
+ | ((uintptr_t)(refs) << _PyGC_PREV_SHIFT);
+}
+
+static inline void
+gc_reset_refs(PyGC_Head *g, Py_ssize_t refs)
+{
+ g->_gc_prev = (g->_gc_prev & _PyGC_PREV_MASK_FINALIZED)
+ | PREV_MASK_COLLECTING
+ | ((uintptr_t)(refs) << _PyGC_PREV_SHIFT);
+}
+
+static inline void
+gc_decref(PyGC_Head *g)
+{
+ _PyObject_ASSERT_WITH_MSG(FROM_GC(g),
+ gc_get_refs(g) > 0,
+ "refcount is too small");
+ g->_gc_prev -= 1 << _PyGC_PREV_SHIFT;
+}
+
+/* set for debugging information */
+#define DEBUG_STATS (1<<0) /* print collection statistics */
+#define DEBUG_COLLECTABLE (1<<1) /* print collectable objects */
+#define DEBUG_UNCOLLECTABLE (1<<2) /* print uncollectable objects */
+#define DEBUG_SAVEALL (1<<5) /* save all garbage in gc.garbage */
+#define DEBUG_LEAK DEBUG_COLLECTABLE | \
+ DEBUG_UNCOLLECTABLE | \
+ DEBUG_SAVEALL
+
+#define GEN_HEAD(gcstate, n) (&(gcstate)->generations[n].head)
+
+
+static GCState *
+get_gc_state(void)
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ return &interp->gc;
+}
+
+
+void
+_PyGC_InitState(GCState *gcstate)
+{
+#define INIT_HEAD(GEN) \
+ do { \
+ GEN.head._gc_next = (uintptr_t)&GEN.head; \
+ GEN.head._gc_prev = (uintptr_t)&GEN.head; \
+ } while (0)
+
+ for (int i = 0; i < NUM_GENERATIONS; i++) {
+ assert(gcstate->generations[i].count == 0);
+ INIT_HEAD(gcstate->generations[i]);
+ };
+ gcstate->generation0 = GEN_HEAD(gcstate, 0);
+ INIT_HEAD(gcstate->permanent_generation);
+
+#undef INIT_HEAD
+}
+
+
+PyStatus
+_PyGC_Init(PyInterpreterState *interp)
+{
+ GCState *gcstate = &interp->gc;
+
+ gcstate->garbage = PyList_New(0);
+ if (gcstate->garbage == NULL) {
+ return _PyStatus_NO_MEMORY();
+ }
+
+ gcstate->callbacks = PyList_New(0);
+ if (gcstate->callbacks == NULL) {
+ return _PyStatus_NO_MEMORY();
+ }
+
+ return _PyStatus_OK();
+}
+
+
+/*
+_gc_prev values
+---------------
+
+Between collections, _gc_prev is used for doubly linked list.
+
+Lowest two bits of _gc_prev are used for flags.
+PREV_MASK_COLLECTING is used only while collecting and cleared before GC ends
+or _PyObject_GC_UNTRACK() is called.
+
+During a collection, _gc_prev is temporary used for gc_refs, and the gc list
+is singly linked until _gc_prev is restored.
+
+gc_refs
+ At the start of a collection, update_refs() copies the true refcount
+ to gc_refs, for each object in the generation being collected.
+ subtract_refs() then adjusts gc_refs so that it equals the number of
+ times an object is referenced directly from outside the generation
+ being collected.
+
+PREV_MASK_COLLECTING
+ Objects in generation being collected are marked PREV_MASK_COLLECTING in
+ update_refs().
+
+
+_gc_next values
+---------------
+
+_gc_next takes these values:
+
+0
+ The object is not tracked
+
+!= 0
+ Pointer to the next object in the GC list.
+ Additionally, lowest bit is used temporary for
+ NEXT_MASK_UNREACHABLE flag described below.
+
+NEXT_MASK_UNREACHABLE
+ move_unreachable() then moves objects not reachable (whether directly or
+ indirectly) from outside the generation into an "unreachable" set and
+ set this flag.
+
+ Objects that are found to be reachable have gc_refs set to 1.
+ When this flag is set for the reachable object, the object must be in
+ "unreachable" set.
+ The flag is unset and the object is moved back to "reachable" set.
+
+ move_legacy_finalizers() will remove this flag from "unreachable" set.
+*/
+
+/*** list functions ***/
+
+static inline void
+gc_list_init(PyGC_Head *list)
+{
+ // List header must not have flags.
+ // We can assign pointer by simple cast.
+ list->_gc_prev = (uintptr_t)list;
+ list->_gc_next = (uintptr_t)list;
+}
+
+static inline int
+gc_list_is_empty(PyGC_Head *list)
+{
+ return (list->_gc_next == (uintptr_t)list);
+}
+
+/* Append `node` to `list`. */
+static inline void
+gc_list_append(PyGC_Head *node, PyGC_Head *list)
+{
+ PyGC_Head *last = (PyGC_Head *)list->_gc_prev;
+
+ // last <-> node
+ _PyGCHead_SET_PREV(node, last);
+ _PyGCHead_SET_NEXT(last, node);
+
+ // node <-> list
+ _PyGCHead_SET_NEXT(node, list);
+ list->_gc_prev = (uintptr_t)node;
+}
+
+/* Remove `node` from the gc list it's currently in. */
+static inline void
+gc_list_remove(PyGC_Head *node)
+{
+ PyGC_Head *prev = GC_PREV(node);
+ PyGC_Head *next = GC_NEXT(node);
+
+ _PyGCHead_SET_NEXT(prev, next);
+ _PyGCHead_SET_PREV(next, prev);
+
+ node->_gc_next = 0; /* object is not currently tracked */
+}
+
+/* Move `node` from the gc list it's currently in (which is not explicitly
+ * named here) to the end of `list`. This is semantically the same as
+ * gc_list_remove(node) followed by gc_list_append(node, list).
+ */
+static void
+gc_list_move(PyGC_Head *node, PyGC_Head *list)
+{
+ /* Unlink from current list. */
+ PyGC_Head *from_prev = GC_PREV(node);
+ PyGC_Head *from_next = GC_NEXT(node);
+ _PyGCHead_SET_NEXT(from_prev, from_next);
+ _PyGCHead_SET_PREV(from_next, from_prev);
+
+ /* Relink at end of new list. */
+ // list must not have flags. So we can skip macros.
+ PyGC_Head *to_prev = (PyGC_Head*)list->_gc_prev;
+ _PyGCHead_SET_PREV(node, to_prev);
+ _PyGCHead_SET_NEXT(to_prev, node);
+ list->_gc_prev = (uintptr_t)node;
+ _PyGCHead_SET_NEXT(node, list);
+}
+
+/* append list `from` onto list `to`; `from` becomes an empty list */
+static void
+gc_list_merge(PyGC_Head *from, PyGC_Head *to)
+{
+ assert(from != to);
+ if (!gc_list_is_empty(from)) {
+ PyGC_Head *to_tail = GC_PREV(to);
+ PyGC_Head *from_head = GC_NEXT(from);
+ PyGC_Head *from_tail = GC_PREV(from);
+ assert(from_head != from);
+ assert(from_tail != from);
+
+ _PyGCHead_SET_NEXT(to_tail, from_head);
+ _PyGCHead_SET_PREV(from_head, to_tail);
+
+ _PyGCHead_SET_NEXT(from_tail, to);
+ _PyGCHead_SET_PREV(to, from_tail);
+ }
+ gc_list_init(from);
+}
+
+static Py_ssize_t
+gc_list_size(PyGC_Head *list)
+{
+ PyGC_Head *gc;
+ Py_ssize_t n = 0;
+ for (gc = GC_NEXT(list); gc != list; gc = GC_NEXT(gc)) {
+ n++;
+ }
+ return n;
+}
+
+/* Walk the list and mark all objects as non-collecting */
+static inline void
+gc_list_clear_collecting(PyGC_Head *collectable)
+{
+ PyGC_Head *gc;
+ for (gc = GC_NEXT(collectable); gc != collectable; gc = GC_NEXT(gc)) {
+ gc_clear_collecting(gc);
+ }
+}
+
+/* Append objects in a GC list to a Python list.
+ * Return 0 if all OK, < 0 if error (out of memory for list)
+ */
+static int
+append_objects(PyObject *py_list, PyGC_Head *gc_list)
+{
+ PyGC_Head *gc;
+ for (gc = GC_NEXT(gc_list); gc != gc_list; gc = GC_NEXT(gc)) {
+ PyObject *op = FROM_GC(gc);
+ if (op != py_list) {
+ if (PyList_Append(py_list, op)) {
+ return -1; /* exception */
+ }
+ }
+ }
+ return 0;
+}
+
+// Constants for validate_list's flags argument.
+enum flagstates {collecting_clear_unreachable_clear,
+ collecting_clear_unreachable_set,
+ collecting_set_unreachable_clear,
+ collecting_set_unreachable_set};
+
+#ifdef GC_DEBUG
+// validate_list checks list consistency. And it works as document
+// describing when flags are expected to be set / unset.
+// `head` must be a doubly-linked gc list, although it's fine (expected!) if
+// the prev and next pointers are "polluted" with flags.
+// What's checked:
+// - The `head` pointers are not polluted.
+// - The objects' PREV_MASK_COLLECTING and NEXT_MASK_UNREACHABLE flags are all
+// `set or clear, as specified by the 'flags' argument.
+// - The prev and next pointers are mutually consistent.
+static void
+validate_list(PyGC_Head *head, enum flagstates flags)
+{
+ assert((head->_gc_prev & PREV_MASK_COLLECTING) == 0);
+ assert((head->_gc_next & NEXT_MASK_UNREACHABLE) == 0);
+ uintptr_t prev_value = 0, next_value = 0;
+ switch (flags) {
+ case collecting_clear_unreachable_clear:
+ break;
+ case collecting_set_unreachable_clear:
+ prev_value = PREV_MASK_COLLECTING;
+ break;
+ case collecting_clear_unreachable_set:
+ next_value = NEXT_MASK_UNREACHABLE;
+ break;
+ case collecting_set_unreachable_set:
+ prev_value = PREV_MASK_COLLECTING;
+ next_value = NEXT_MASK_UNREACHABLE;
+ break;
+ default:
+ assert(! "bad internal flags argument");
+ }
+ PyGC_Head *prev = head;
+ PyGC_Head *gc = GC_NEXT(head);
+ while (gc != head) {
+ PyGC_Head *trueprev = GC_PREV(gc);
+ PyGC_Head *truenext = (PyGC_Head *)(gc->_gc_next & ~NEXT_MASK_UNREACHABLE);
+ assert(truenext != NULL);
+ assert(trueprev == prev);
+ assert((gc->_gc_prev & PREV_MASK_COLLECTING) == prev_value);
+ assert((gc->_gc_next & NEXT_MASK_UNREACHABLE) == next_value);
+ prev = gc;
+ gc = truenext;
+ }
+ assert(prev == GC_PREV(head));
+}
+#else
+#define validate_list(x, y) do{}while(0)
+#endif
+
+/*** end of list stuff ***/
+
+
+/* Set all gc_refs = ob_refcnt. After this, gc_refs is > 0 and
+ * PREV_MASK_COLLECTING bit is set for all objects in containers.
+ */
+static void
+update_refs(PyGC_Head *containers)
+{
+ PyGC_Head *next;
+ PyGC_Head *gc = GC_NEXT(containers);
+
+ while (gc != containers) {
+ next = GC_NEXT(gc);
+ /* Move any object that might have become immortal to the
+ * permanent generation as the reference count is not accurately
+ * reflecting the actual number of live references to this object
+ */
+ if (_Py_IsImmortal(FROM_GC(gc))) {
+ gc_list_move(gc, &get_gc_state()->permanent_generation.head);
+ gc = next;
+ continue;
+ }
+ gc_reset_refs(gc, Py_REFCNT(FROM_GC(gc)));
+ /* Python's cyclic gc should never see an incoming refcount
+ * of 0: if something decref'ed to 0, it should have been
+ * deallocated immediately at that time.
+ * Possible cause (if the assert triggers): a tp_dealloc
+ * routine left a gc-aware object tracked during its teardown
+ * phase, and did something-- or allowed something to happen --
+ * that called back into Python. gc can trigger then, and may
+ * see the still-tracked dying object. Before this assert
+ * was added, such mistakes went on to allow gc to try to
+ * delete the object again. In a debug build, that caused
+ * a mysterious segfault, when _Py_ForgetReference tried
+ * to remove the object from the doubly-linked list of all
+ * objects a second time. In a release build, an actual
+ * double deallocation occurred, which leads to corruption
+ * of the allocator's internal bookkeeping pointers. That's
+ * so serious that maybe this should be a release-build
+ * check instead of an assert?
+ */
+ _PyObject_ASSERT(FROM_GC(gc), gc_get_refs(gc) != 0);
+ gc = next;
+ }
+}
+
+/* A traversal callback for subtract_refs. */
+static int
+visit_decref(PyObject *op, void *parent)
+{
+ _PyObject_ASSERT(_PyObject_CAST(parent), !_PyObject_IsFreed(op));
+
+ if (_PyObject_IS_GC(op)) {
+ PyGC_Head *gc = AS_GC(op);
+ /* We're only interested in gc_refs for objects in the
+ * generation being collected, which can be recognized
+ * because only they have positive gc_refs.
+ */
+ if (gc_is_collecting(gc)) {
+ gc_decref(gc);
+ }
+ }
+ return 0;
+}
+
+/* Subtract internal references from gc_refs. After this, gc_refs is >= 0
+ * for all objects in containers, and is GC_REACHABLE for all tracked gc
+ * objects not in containers. The ones with gc_refs > 0 are directly
+ * reachable from outside containers, and so can't be collected.
+ */
+static void
+subtract_refs(PyGC_Head *containers)
+{
+ traverseproc traverse;
+ PyGC_Head *gc = GC_NEXT(containers);
+ for (; gc != containers; gc = GC_NEXT(gc)) {
+ PyObject *op = FROM_GC(gc);
+ traverse = Py_TYPE(op)->tp_traverse;
+ (void) traverse(op,
+ (visitproc)visit_decref,
+ op);
+ }
+}
+
+/* A traversal callback for move_unreachable. */
+static int
+visit_reachable(PyObject *op, PyGC_Head *reachable)
+{
+ if (!_PyObject_IS_GC(op)) {
+ return 0;
+ }
+
+ PyGC_Head *gc = AS_GC(op);
+ const Py_ssize_t gc_refs = gc_get_refs(gc);
+
+ // Ignore objects in other generation.
+ // This also skips objects "to the left" of the current position in
+ // move_unreachable's scan of the 'young' list - they've already been
+ // traversed, and no longer have the PREV_MASK_COLLECTING flag.
+ if (! gc_is_collecting(gc)) {
+ return 0;
+ }
+ // It would be a logic error elsewhere if the collecting flag were set on
+ // an untracked object.
+ assert(gc->_gc_next != 0);
+
+ if (gc->_gc_next & NEXT_MASK_UNREACHABLE) {
+ /* This had gc_refs = 0 when move_unreachable got
+ * to it, but turns out it's reachable after all.
+ * Move it back to move_unreachable's 'young' list,
+ * and move_unreachable will eventually get to it
+ * again.
+ */
+ // Manually unlink gc from unreachable list because the list functions
+ // don't work right in the presence of NEXT_MASK_UNREACHABLE flags.
+ PyGC_Head *prev = GC_PREV(gc);
+ PyGC_Head *next = (PyGC_Head*)(gc->_gc_next & ~NEXT_MASK_UNREACHABLE);
+ _PyObject_ASSERT(FROM_GC(prev),
+ prev->_gc_next & NEXT_MASK_UNREACHABLE);
+ _PyObject_ASSERT(FROM_GC(next),
+ next->_gc_next & NEXT_MASK_UNREACHABLE);
+ prev->_gc_next = gc->_gc_next; // copy NEXT_MASK_UNREACHABLE
+ _PyGCHead_SET_PREV(next, prev);
+
+ gc_list_append(gc, reachable);
+ gc_set_refs(gc, 1);
+ }
+ else if (gc_refs == 0) {
+ /* This is in move_unreachable's 'young' list, but
+ * the traversal hasn't yet gotten to it. All
+ * we need to do is tell move_unreachable that it's
+ * reachable.
+ */
+ gc_set_refs(gc, 1);
+ }
+ /* Else there's nothing to do.
+ * If gc_refs > 0, it must be in move_unreachable's 'young'
+ * list, and move_unreachable will eventually get to it.
+ */
+ else {
+ _PyObject_ASSERT_WITH_MSG(op, gc_refs > 0, "refcount is too small");
+ }
+ return 0;
+}
+
+/* Move the unreachable objects from young to unreachable. After this,
+ * all objects in young don't have PREV_MASK_COLLECTING flag and
+ * unreachable have the flag.
+ * All objects in young after this are directly or indirectly reachable
+ * from outside the original young; and all objects in unreachable are
+ * not.
+ *
+ * This function restores _gc_prev pointer. young and unreachable are
+ * doubly linked list after this function.
+ * But _gc_next in unreachable list has NEXT_MASK_UNREACHABLE flag.
+ * So we can not gc_list_* functions for unreachable until we remove the flag.
+ */
+static void
+move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
+{
+ // previous elem in the young list, used for restore gc_prev.
+ PyGC_Head *prev = young;
+ PyGC_Head *gc = GC_NEXT(young);
+
+ /* Invariants: all objects "to the left" of us in young are reachable
+ * (directly or indirectly) from outside the young list as it was at entry.
+ *
+ * All other objects from the original young "to the left" of us are in
+ * unreachable now, and have NEXT_MASK_UNREACHABLE. All objects to the
+ * left of us in 'young' now have been scanned, and no objects here
+ * or to the right have been scanned yet.
+ */
+
+ while (gc != young) {
+ if (gc_get_refs(gc)) {
+ /* gc is definitely reachable from outside the
+ * original 'young'. Mark it as such, and traverse
+ * its pointers to find any other objects that may
+ * be directly reachable from it. Note that the
+ * call to tp_traverse may append objects to young,
+ * so we have to wait until it returns to determine
+ * the next object to visit.
+ */
+ PyObject *op = FROM_GC(gc);
+ traverseproc traverse = Py_TYPE(op)->tp_traverse;
+ _PyObject_ASSERT_WITH_MSG(op, gc_get_refs(gc) > 0,
+ "refcount is too small");
+ // NOTE: visit_reachable may change gc->_gc_next when
+ // young->_gc_prev == gc. Don't do gc = GC_NEXT(gc) before!
+ (void) traverse(op,
+ (visitproc)visit_reachable,
+ (void *)young);
+ // relink gc_prev to prev element.
+ _PyGCHead_SET_PREV(gc, prev);
+ // gc is not COLLECTING state after here.
+ gc_clear_collecting(gc);
+ prev = gc;
+ }
+ else {
+ /* This *may* be unreachable. To make progress,
+ * assume it is. gc isn't directly reachable from
+ * any object we've already traversed, but may be
+ * reachable from an object we haven't gotten to yet.
+ * visit_reachable will eventually move gc back into
+ * young if that's so, and we'll see it again.
+ */
+ // Move gc to unreachable.
+ // No need to gc->next->prev = prev because it is single linked.
+ prev->_gc_next = gc->_gc_next;
+
+ // We can't use gc_list_append() here because we use
+ // NEXT_MASK_UNREACHABLE here.
+ PyGC_Head *last = GC_PREV(unreachable);
+ // NOTE: Since all objects in unreachable set has
+ // NEXT_MASK_UNREACHABLE flag, we set it unconditionally.
+ // But this may pollute the unreachable list head's 'next' pointer
+ // too. That's semantically senseless but expedient here - the
+ // damage is repaired when this function ends.
+ last->_gc_next = (NEXT_MASK_UNREACHABLE | (uintptr_t)gc);
+ _PyGCHead_SET_PREV(gc, last);
+ gc->_gc_next = (NEXT_MASK_UNREACHABLE | (uintptr_t)unreachable);
+ unreachable->_gc_prev = (uintptr_t)gc;
+ }
+ gc = (PyGC_Head*)prev->_gc_next;
+ }
+ // young->_gc_prev must be last element remained in the list.
+ young->_gc_prev = (uintptr_t)prev;
+ // don't let the pollution of the list head's next pointer leak
+ unreachable->_gc_next &= ~NEXT_MASK_UNREACHABLE;
+}
+
+static void
+untrack_tuples(PyGC_Head *head)
+{
+ PyGC_Head *next, *gc = GC_NEXT(head);
+ while (gc != head) {
+ PyObject *op = FROM_GC(gc);
+ next = GC_NEXT(gc);
+ if (PyTuple_CheckExact(op)) {
+ _PyTuple_MaybeUntrack(op);
+ }
+ gc = next;
+ }
+}
+
+/* Try to untrack all currently tracked dictionaries */
+static void
+untrack_dicts(PyGC_Head *head)
+{
+ PyGC_Head *next, *gc = GC_NEXT(head);
+ while (gc != head) {
+ PyObject *op = FROM_GC(gc);
+ next = GC_NEXT(gc);
+ if (PyDict_CheckExact(op)) {
+ _PyDict_MaybeUntrack(op);
+ }
+ gc = next;
+ }
+}
+
+/* Return true if object has a pre-PEP 442 finalization method. */
+static int
+has_legacy_finalizer(PyObject *op)
+{
+ return Py_TYPE(op)->tp_del != NULL;
+}
+
+/* Move the objects in unreachable with tp_del slots into `finalizers`.
+ *
+ * This function also removes NEXT_MASK_UNREACHABLE flag
+ * from _gc_next in unreachable.
+ */
+static void
+move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
+{
+ PyGC_Head *gc, *next;
+ assert((unreachable->_gc_next & NEXT_MASK_UNREACHABLE) == 0);
+
+ /* March over unreachable. Move objects with finalizers into
+ * `finalizers`.
+ */
+ for (gc = GC_NEXT(unreachable); gc != unreachable; gc = next) {
+ PyObject *op = FROM_GC(gc);
+
+ _PyObject_ASSERT(op, gc->_gc_next & NEXT_MASK_UNREACHABLE);
+ gc->_gc_next &= ~NEXT_MASK_UNREACHABLE;
+ next = (PyGC_Head*)gc->_gc_next;
+
+ if (has_legacy_finalizer(op)) {
+ gc_clear_collecting(gc);
+ gc_list_move(gc, finalizers);
+ }
+ }
+}
+
+static inline void
+clear_unreachable_mask(PyGC_Head *unreachable)
+{
+ /* Check that the list head does not have the unreachable bit set */
+ assert(((uintptr_t)unreachable & NEXT_MASK_UNREACHABLE) == 0);
+
+ PyGC_Head *gc, *next;
+ assert((unreachable->_gc_next & NEXT_MASK_UNREACHABLE) == 0);
+ for (gc = GC_NEXT(unreachable); gc != unreachable; gc = next) {
+ _PyObject_ASSERT((PyObject*)FROM_GC(gc), gc->_gc_next & NEXT_MASK_UNREACHABLE);
+ gc->_gc_next &= ~NEXT_MASK_UNREACHABLE;
+ next = (PyGC_Head*)gc->_gc_next;
+ }
+ validate_list(unreachable, collecting_set_unreachable_clear);
+}
+
+/* A traversal callback for move_legacy_finalizer_reachable. */
+static int
+visit_move(PyObject *op, PyGC_Head *tolist)
+{
+ if (_PyObject_IS_GC(op)) {
+ PyGC_Head *gc = AS_GC(op);
+ if (gc_is_collecting(gc)) {
+ gc_list_move(gc, tolist);
+ gc_clear_collecting(gc);
+ }
+ }
+ return 0;
+}
+
+/* Move objects that are reachable from finalizers, from the unreachable set
+ * into finalizers set.
+ */
+static void
+move_legacy_finalizer_reachable(PyGC_Head *finalizers)
+{
+ traverseproc traverse;
+ PyGC_Head *gc = GC_NEXT(finalizers);
+ for (; gc != finalizers; gc = GC_NEXT(gc)) {
+ /* Note that the finalizers list may grow during this. */
+ traverse = Py_TYPE(FROM_GC(gc))->tp_traverse;
+ (void) traverse(FROM_GC(gc),
+ (visitproc)visit_move,
+ (void *)finalizers);
+ }
+}
+
+/* Clear all weakrefs to unreachable objects, and if such a weakref has a
+ * callback, invoke it if necessary. Note that it's possible for such
+ * weakrefs to be outside the unreachable set -- indeed, those are precisely
+ * the weakrefs whose callbacks must be invoked. See gc_weakref.txt for
+ * overview & some details. Some weakrefs with callbacks may be reclaimed
+ * directly by this routine; the number reclaimed is the return value. Other
+ * weakrefs with callbacks may be moved into the `old` generation. Objects
+ * moved into `old` have gc_refs set to GC_REACHABLE; the objects remaining in
+ * unreachable are left at GC_TENTATIVELY_UNREACHABLE. When this returns,
+ * no object in `unreachable` is weakly referenced anymore.
+ */
+static int
+handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
+{
+ PyGC_Head *gc;
+ PyObject *op; /* generally FROM_GC(gc) */
+ PyWeakReference *wr; /* generally a cast of op */
+ PyGC_Head wrcb_to_call; /* weakrefs with callbacks to call */
+ PyGC_Head *next;
+ int num_freed = 0;
+
+ gc_list_init(&wrcb_to_call);
+
+ /* Clear all weakrefs to the objects in unreachable. If such a weakref
+ * also has a callback, move it into `wrcb_to_call` if the callback
+ * needs to be invoked. Note that we cannot invoke any callbacks until
+ * all weakrefs to unreachable objects are cleared, lest the callback
+ * resurrect an unreachable object via a still-active weakref. We
+ * make another pass over wrcb_to_call, invoking callbacks, after this
+ * pass completes.
+ */
+ for (gc = GC_NEXT(unreachable); gc != unreachable; gc = next) {
+ PyWeakReference **wrlist;
+
+ op = FROM_GC(gc);
+ next = GC_NEXT(gc);
+
+ if (PyWeakref_Check(op)) {
+ /* A weakref inside the unreachable set must be cleared. If we
+ * allow its callback to execute inside delete_garbage(), it
+ * could expose objects that have tp_clear already called on
+ * them. Or, it could resurrect unreachable objects. One way
+ * this can happen is if some container objects do not implement
+ * tp_traverse. Then, wr_object can be outside the unreachable
+ * set but can be deallocated as a result of breaking the
+ * reference cycle. If we don't clear the weakref, the callback
+ * will run and potentially cause a crash. See bpo-38006 for
+ * one example.
+ */
+ _PyWeakref_ClearRef((PyWeakReference *)op);
+ }
+
+ if (! _PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
+ continue;
+
+ /* It supports weakrefs. Does it have any?
+ *
+ * This is never triggered for static types so we can avoid the
+ * (slightly) more costly _PyObject_GET_WEAKREFS_LISTPTR().
+ */
+ wrlist = _PyObject_GET_WEAKREFS_LISTPTR_FROM_OFFSET(op);
+
+ /* `op` may have some weakrefs. March over the list, clear
+ * all the weakrefs, and move the weakrefs with callbacks
+ * that must be called into wrcb_to_call.
+ */
+ for (wr = *wrlist; wr != NULL; wr = *wrlist) {
+ PyGC_Head *wrasgc; /* AS_GC(wr) */
+
+ /* _PyWeakref_ClearRef clears the weakref but leaves
+ * the callback pointer intact. Obscure: it also
+ * changes *wrlist.
+ */
+ _PyObject_ASSERT((PyObject *)wr, wr->wr_object == op);
+ _PyWeakref_ClearRef(wr);
+ _PyObject_ASSERT((PyObject *)wr, wr->wr_object == Py_None);
+ if (wr->wr_callback == NULL) {
+ /* no callback */
+ continue;
+ }
+
+ /* Headache time. `op` is going away, and is weakly referenced by
+ * `wr`, which has a callback. Should the callback be invoked? If wr
+ * is also trash, no:
+ *
+ * 1. There's no need to call it. The object and the weakref are
+ * both going away, so it's legitimate to pretend the weakref is
+ * going away first. The user has to ensure a weakref outlives its
+ * referent if they want a guarantee that the wr callback will get
+ * invoked.
+ *
+ * 2. It may be catastrophic to call it. If the callback is also in
+ * cyclic trash (CT), then although the CT is unreachable from
+ * outside the current generation, CT may be reachable from the
+ * callback. Then the callback could resurrect insane objects.
+ *
+ * Since the callback is never needed and may be unsafe in this case,
+ * wr is simply left in the unreachable set. Note that because we
+ * already called _PyWeakref_ClearRef(wr), its callback will never
+ * trigger.
+ *
+ * OTOH, if wr isn't part of CT, we should invoke the callback: the
+ * weakref outlived the trash. Note that since wr isn't CT in this
+ * case, its callback can't be CT either -- wr acted as an external
+ * root to this generation, and therefore its callback did too. So
+ * nothing in CT is reachable from the callback either, so it's hard
+ * to imagine how calling it later could create a problem for us. wr
+ * is moved to wrcb_to_call in this case.
+ */
+ if (gc_is_collecting(AS_GC(wr))) {
+ /* it should already have been cleared above */
+ assert(wr->wr_object == Py_None);
+ continue;
+ }
+
+ /* Create a new reference so that wr can't go away
+ * before we can process it again.
+ */
+ Py_INCREF(wr);
+
+ /* Move wr to wrcb_to_call, for the next pass. */
+ wrasgc = AS_GC(wr);
+ assert(wrasgc != next); /* wrasgc is reachable, but
+ next isn't, so they can't
+ be the same */
+ gc_list_move(wrasgc, &wrcb_to_call);
+ }
+ }
+
+ /* Invoke the callbacks we decided to honor. It's safe to invoke them
+ * because they can't reference unreachable objects.
+ */
+ while (! gc_list_is_empty(&wrcb_to_call)) {
+ PyObject *temp;
+ PyObject *callback;
+
+ gc = (PyGC_Head*)wrcb_to_call._gc_next;
+ op = FROM_GC(gc);
+ _PyObject_ASSERT(op, PyWeakref_Check(op));
+ wr = (PyWeakReference *)op;
+ callback = wr->wr_callback;
+ _PyObject_ASSERT(op, callback != NULL);
+
+ /* copy-paste of weakrefobject.c's handle_callback() */
+ temp = PyObject_CallOneArg(callback, (PyObject *)wr);
+ if (temp == NULL)
+ PyErr_WriteUnraisable(callback);
+ else
+ Py_DECREF(temp);
+
+ /* Give up the reference we created in the first pass. When
+ * op's refcount hits 0 (which it may or may not do right now),
+ * op's tp_dealloc will decref op->wr_callback too. Note
+ * that the refcount probably will hit 0 now, and because this
+ * weakref was reachable to begin with, gc didn't already
+ * add it to its count of freed objects. Example: a reachable
+ * weak value dict maps some key to this reachable weakref.
+ * The callback removes this key->weakref mapping from the
+ * dict, leaving no other references to the weakref (excepting
+ * ours).
+ */
+ Py_DECREF(op);
+ if (wrcb_to_call._gc_next == (uintptr_t)gc) {
+ /* object is still alive -- move it */
+ gc_list_move(gc, old);
+ }
+ else {
+ ++num_freed;
+ }
+ }
+
+ return num_freed;
+}
+
+static void
+debug_cycle(const char *msg, PyObject *op)
+{
+ PySys_FormatStderr("gc: %s <%s %p>\n",
+ msg, Py_TYPE(op)->tp_name, op);
+}
+
+/* Handle uncollectable garbage (cycles with tp_del slots, and stuff reachable
+ * only from such cycles).
+ * If DEBUG_SAVEALL, all objects in finalizers are appended to the module
+ * garbage list (a Python list), else only the objects in finalizers with
+ * __del__ methods are appended to garbage. All objects in finalizers are
+ * merged into the old list regardless.
+ */
+static void
+handle_legacy_finalizers(PyThreadState *tstate,
+ GCState *gcstate,
+ PyGC_Head *finalizers, PyGC_Head *old)
+{
+ assert(!_PyErr_Occurred(tstate));
+ assert(gcstate->garbage != NULL);
+
+ PyGC_Head *gc = GC_NEXT(finalizers);
+ for (; gc != finalizers; gc = GC_NEXT(gc)) {
+ PyObject *op = FROM_GC(gc);
+
+ if ((gcstate->debug & DEBUG_SAVEALL) || has_legacy_finalizer(op)) {
+ if (PyList_Append(gcstate->garbage, op) < 0) {
+ _PyErr_Clear(tstate);
+ break;
+ }
+ }
+ }
+
+ gc_list_merge(finalizers, old);
+}
+
+/* Run first-time finalizers (if any) on all the objects in collectable.
+ * Note that this may remove some (or even all) of the objects from the
+ * list, due to refcounts falling to 0.
+ */
+static void
+finalize_garbage(PyThreadState *tstate, PyGC_Head *collectable)
+{
+ destructor finalize;
+ PyGC_Head seen;
+
+ /* While we're going through the loop, `finalize(op)` may cause op, or
+ * other objects, to be reclaimed via refcounts falling to zero. So
+ * there's little we can rely on about the structure of the input
+ * `collectable` list across iterations. For safety, we always take the
+ * first object in that list and move it to a temporary `seen` list.
+ * If objects vanish from the `collectable` and `seen` lists we don't
+ * care.
+ */
+ gc_list_init(&seen);
+
+ while (!gc_list_is_empty(collectable)) {
+ PyGC_Head *gc = GC_NEXT(collectable);
+ PyObject *op = FROM_GC(gc);
+ gc_list_move(gc, &seen);
+ if (!_PyGCHead_FINALIZED(gc) &&
+ (finalize = Py_TYPE(op)->tp_finalize) != NULL) {
+ _PyGCHead_SET_FINALIZED(gc);
+ Py_INCREF(op);
+ finalize(op);
+ assert(!_PyErr_Occurred(tstate));
+ Py_DECREF(op);
+ }
+ }
+ gc_list_merge(&seen, collectable);
+}
+
+/* Break reference cycles by clearing the containers involved. This is
+ * tricky business as the lists can be changing and we don't know which
+ * objects may be freed. It is possible I screwed something up here.
+ */
+static void
+delete_garbage(PyThreadState *tstate, GCState *gcstate,
+ PyGC_Head *collectable, PyGC_Head *old)
+{
+ assert(!_PyErr_Occurred(tstate));
+
+ while (!gc_list_is_empty(collectable)) {
+ PyGC_Head *gc = GC_NEXT(collectable);
+ PyObject *op = FROM_GC(gc);
+
+ _PyObject_ASSERT_WITH_MSG(op, Py_REFCNT(op) > 0,
+ "refcount is too small");
+
+ if (gcstate->debug & DEBUG_SAVEALL) {
+ assert(gcstate->garbage != NULL);
+ if (PyList_Append(gcstate->garbage, op) < 0) {
+ _PyErr_Clear(tstate);
+ }
+ }
+ else {
+ inquiry clear;
+ if ((clear = Py_TYPE(op)->tp_clear) != NULL) {
+ Py_INCREF(op);
+ (void) clear(op);
+ if (_PyErr_Occurred(tstate)) {
+ _PyErr_WriteUnraisableMsg("in tp_clear of",
+ (PyObject*)Py_TYPE(op));
+ }
+ Py_DECREF(op);
+ }
+ }
+ if (GC_NEXT(collectable) == gc) {
+ /* object is still alive, move it, it may die later */
+ gc_clear_collecting(gc);
+ gc_list_move(gc, old);
+ }
+ }
+}
+
+/* Clear all free lists
+ * All free lists are cleared during the collection of the highest generation.
+ * Allocated items in the free list may keep a pymalloc arena occupied.
+ * Clearing the free lists may give back memory to the OS earlier.
+ */
+static void
+clear_freelists(PyInterpreterState *interp)
+{
+ _PyTuple_ClearFreeList(interp);
+ _PyFloat_ClearFreeList(interp);
+ _PyList_ClearFreeList(interp);
+ _PyDict_ClearFreeList(interp);
+ _PyAsyncGen_ClearFreeLists(interp);
+ _PyContext_ClearFreeList(interp);
+}
+
+// Show stats for objects in each generations
+static void
+show_stats_each_generations(GCState *gcstate)
+{
+ char buf[100];
+ size_t pos = 0;
+
+ for (int i = 0; i < NUM_GENERATIONS && pos < sizeof(buf); i++) {
+ pos += PyOS_snprintf(buf+pos, sizeof(buf)-pos,
+ " %zd",
+ gc_list_size(GEN_HEAD(gcstate, i)));
+ }
+
+ PySys_FormatStderr(
+ "gc: objects in each generation:%s\n"
+ "gc: objects in permanent generation: %zd\n",
+ buf, gc_list_size(&gcstate->permanent_generation.head));
+}
+
+/* Deduce which objects among "base" are unreachable from outside the list
+ and move them to 'unreachable'. The process consist in the following steps:
+
+1. Copy all reference counts to a different field (gc_prev is used to hold
+ this copy to save memory).
+2. Traverse all objects in "base" and visit all referred objects using
+ "tp_traverse" and for every visited object, subtract 1 to the reference
+ count (the one that we copied in the previous step). After this step, all
+ objects that can be reached directly from outside must have strictly positive
+ reference count, while all unreachable objects must have a count of exactly 0.
+3. Identify all unreachable objects (the ones with 0 reference count) and move
+ them to the "unreachable" list. This step also needs to move back to "base" all
+ objects that were initially marked as unreachable but are referred transitively
+ by the reachable objects (the ones with strictly positive reference count).
+
+Contracts:
+
+ * The "base" has to be a valid list with no mask set.
+
+ * The "unreachable" list must be uninitialized (this function calls
+ gc_list_init over 'unreachable').
+
+IMPORTANT: This function leaves 'unreachable' with the NEXT_MASK_UNREACHABLE
+flag set but it does not clear it to skip unnecessary iteration. Before the
+flag is cleared (for example, by using 'clear_unreachable_mask' function or
+by a call to 'move_legacy_finalizers'), the 'unreachable' list is not a normal
+list and we can not use most gc_list_* functions for it. */
+static inline void
+deduce_unreachable(PyGC_Head *base, PyGC_Head *unreachable) {
+ validate_list(base, collecting_clear_unreachable_clear);
+ /* Using ob_refcnt and gc_refs, calculate which objects in the
+ * container set are reachable from outside the set (i.e., have a
+ * refcount greater than 0 when all the references within the
+ * set are taken into account).
+ */
+ update_refs(base); // gc_prev is used for gc_refs
+ subtract_refs(base);
+
+ /* Leave everything reachable from outside base in base, and move
+ * everything else (in base) to unreachable.
+ *
+ * NOTE: This used to move the reachable objects into a reachable
+ * set instead. But most things usually turn out to be reachable,
+ * so it's more efficient to move the unreachable things. It "sounds slick"
+ * to move the unreachable objects, until you think about it - the reason it
+ * pays isn't actually obvious.
+ *
+ * Suppose we create objects A, B, C in that order. They appear in the young
+ * generation in the same order. If B points to A, and C to B, and C is
+ * reachable from outside, then the adjusted refcounts will be 0, 0, and 1
+ * respectively.
+ *
+ * When move_unreachable finds A, A is moved to the unreachable list. The
+ * same for B when it's first encountered. Then C is traversed, B is moved
+ * _back_ to the reachable list. B is eventually traversed, and then A is
+ * moved back to the reachable list.
+ *
+ * So instead of not moving at all, the reachable objects B and A are moved
+ * twice each. Why is this a win? A straightforward algorithm to move the
+ * reachable objects instead would move A, B, and C once each.
+ *
+ * The key is that this dance leaves the objects in order C, B, A - it's
+ * reversed from the original order. On all _subsequent_ scans, none of
+ * them will move. Since most objects aren't in cycles, this can save an
+ * unbounded number of moves across an unbounded number of later collections.
+ * It can cost more only the first time the chain is scanned.
+ *
+ * Drawback: move_unreachable is also used to find out what's still trash
+ * after finalizers may resurrect objects. In _that_ case most unreachable
+ * objects will remain unreachable, so it would be more efficient to move
+ * the reachable objects instead. But this is a one-time cost, probably not
+ * worth complicating the code to speed just a little.
+ */
+ gc_list_init(unreachable);
+ move_unreachable(base, unreachable); // gc_prev is pointer again
+ validate_list(base, collecting_clear_unreachable_clear);
+ validate_list(unreachable, collecting_set_unreachable_set);
+}
+
+/* Handle objects that may have resurrected after a call to 'finalize_garbage', moving
+ them to 'old_generation' and placing the rest on 'still_unreachable'.
+
+ Contracts:
+ * After this function 'unreachable' must not be used anymore and 'still_unreachable'
+ will contain the objects that did not resurrect.
+
+ * The "still_unreachable" list must be uninitialized (this function calls
+ gc_list_init over 'still_unreachable').
+
+IMPORTANT: After a call to this function, the 'still_unreachable' set will have the
+PREV_MARK_COLLECTING set, but the objects in this set are going to be removed so
+we can skip the expense of clearing the flag to avoid extra iteration. */
+static inline void
+handle_resurrected_objects(PyGC_Head *unreachable, PyGC_Head* still_unreachable,
+ PyGC_Head *old_generation)
+{
+ // Remove the PREV_MASK_COLLECTING from unreachable
+ // to prepare it for a new call to 'deduce_unreachable'
+ gc_list_clear_collecting(unreachable);
+
+ // After the call to deduce_unreachable, the 'still_unreachable' set will
+ // have the PREV_MARK_COLLECTING set, but the objects are going to be
+ // removed so we can skip the expense of clearing the flag.
+ PyGC_Head* resurrected = unreachable;
+ deduce_unreachable(resurrected, still_unreachable);
+ clear_unreachable_mask(still_unreachable);
+
+ // Move the resurrected objects to the old generation for future collection.
+ gc_list_merge(resurrected, old_generation);
+}
+
+/* This is the main function. Read this to understand how the
+ * collection process works. */
+static Py_ssize_t
+gc_collect_main(PyThreadState *tstate, int generation,
+ Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable,
+ int nofail)
+{
+ int i;
+ Py_ssize_t m = 0; /* # objects collected */
+ Py_ssize_t n = 0; /* # unreachable objects that couldn't be collected */
+ PyGC_Head *young; /* the generation we are examining */
+ PyGC_Head *old; /* next older generation */
+ PyGC_Head unreachable; /* non-problematic unreachable trash */
+ PyGC_Head finalizers; /* objects with, & reachable from, __del__ */
+ PyGC_Head *gc;
+ _PyTime_t t1 = 0; /* initialize to prevent a compiler warning */
+ GCState *gcstate = &tstate->interp->gc;
+
+ // gc_collect_main() must not be called before _PyGC_Init
+ // or after _PyGC_Fini()
+ assert(gcstate->garbage != NULL);
+ assert(!_PyErr_Occurred(tstate));
+
+ if (gcstate->debug & DEBUG_STATS) {
+ PySys_WriteStderr("gc: collecting generation %d...\n", generation);
+ show_stats_each_generations(gcstate);
+ t1 = _PyTime_GetPerfCounter();
+ }
+
+ if (PyDTrace_GC_START_ENABLED())
+ PyDTrace_GC_START(generation);
+
+ /* update collection and allocation counters */
+ if (generation+1 < NUM_GENERATIONS)
+ gcstate->generations[generation+1].count += 1;
+ for (i = 0; i <= generation; i++)
+ gcstate->generations[i].count = 0;
+
+ /* merge younger generations with one we are currently collecting */
+ for (i = 0; i < generation; i++) {
+ gc_list_merge(GEN_HEAD(gcstate, i), GEN_HEAD(gcstate, generation));
+ }
+
+ /* handy references */
+ young = GEN_HEAD(gcstate, generation);
+ if (generation < NUM_GENERATIONS-1)
+ old = GEN_HEAD(gcstate, generation+1);
+ else
+ old = young;
+ validate_list(old, collecting_clear_unreachable_clear);
+
+ deduce_unreachable(young, &unreachable);
+
+ untrack_tuples(young);
+ /* Move reachable objects to next generation. */
+ if (young != old) {
+ if (generation == NUM_GENERATIONS - 2) {
+ gcstate->long_lived_pending += gc_list_size(young);
+ }
+ gc_list_merge(young, old);
+ }
+ else {
+ /* We only un-track dicts in full collections, to avoid quadratic
+ dict build-up. See issue #14775. */
+ untrack_dicts(young);
+ gcstate->long_lived_pending = 0;
+ gcstate->long_lived_total = gc_list_size(young);
+ }
+
+ /* All objects in unreachable are trash, but objects reachable from
+ * legacy finalizers (e.g. tp_del) can't safely be deleted.
+ */
+ gc_list_init(&finalizers);
+ // NEXT_MASK_UNREACHABLE is cleared here.
+ // After move_legacy_finalizers(), unreachable is normal list.
+ move_legacy_finalizers(&unreachable, &finalizers);
+ /* finalizers contains the unreachable objects with a legacy finalizer;
+ * unreachable objects reachable *from* those are also uncollectable,
+ * and we move those into the finalizers list too.
+ */
+ move_legacy_finalizer_reachable(&finalizers);
+
+ validate_list(&finalizers, collecting_clear_unreachable_clear);
+ validate_list(&unreachable, collecting_set_unreachable_clear);
+
+ /* Print debugging information. */
+ if (gcstate->debug & DEBUG_COLLECTABLE) {
+ for (gc = GC_NEXT(&unreachable); gc != &unreachable; gc = GC_NEXT(gc)) {
+ debug_cycle("collectable", FROM_GC(gc));
+ }
+ }
+
+ /* Clear weakrefs and invoke callbacks as necessary. */
+ m += handle_weakrefs(&unreachable, old);
+
+ validate_list(old, collecting_clear_unreachable_clear);
+ validate_list(&unreachable, collecting_set_unreachable_clear);
+
+ /* Call tp_finalize on objects which have one. */
+ finalize_garbage(tstate, &unreachable);
+
+ /* Handle any objects that may have resurrected after the call
+ * to 'finalize_garbage' and continue the collection with the
+ * objects that are still unreachable */
+ PyGC_Head final_unreachable;
+ handle_resurrected_objects(&unreachable, &final_unreachable, old);
+
+ /* Call tp_clear on objects in the final_unreachable set. This will cause
+ * the reference cycles to be broken. It may also cause some objects
+ * in finalizers to be freed.
+ */
+ m += gc_list_size(&final_unreachable);
+ delete_garbage(tstate, gcstate, &final_unreachable, old);
+
+ /* Collect statistics on uncollectable objects found and print
+ * debugging information. */
+ for (gc = GC_NEXT(&finalizers); gc != &finalizers; gc = GC_NEXT(gc)) {
+ n++;
+ if (gcstate->debug & DEBUG_UNCOLLECTABLE)
+ debug_cycle("uncollectable", FROM_GC(gc));
+ }
+ if (gcstate->debug & DEBUG_STATS) {
+ double d = _PyTime_AsSecondsDouble(_PyTime_GetPerfCounter() - t1);
+ PySys_WriteStderr(
+ "gc: done, %zd unreachable, %zd uncollectable, %.4fs elapsed\n",
+ n+m, n, d);
+ }
+
+ /* Append instances in the uncollectable set to a Python
+ * reachable list of garbage. The programmer has to deal with
+ * this if they insist on creating this type of structure.
+ */
+ handle_legacy_finalizers(tstate, gcstate, &finalizers, old);
+ validate_list(old, collecting_clear_unreachable_clear);
+
+ /* Clear free list only during the collection of the highest
+ * generation */
+ if (generation == NUM_GENERATIONS-1) {
+ clear_freelists(tstate->interp);
+ }
+
+ if (_PyErr_Occurred(tstate)) {
+ if (nofail) {
+ _PyErr_Clear(tstate);
+ }
+ else {
+ _PyErr_WriteUnraisableMsg("in garbage collection", NULL);
+ }
+ }
+
+ /* Update stats */
+ if (n_collected) {
+ *n_collected = m;
+ }
+ if (n_uncollectable) {
+ *n_uncollectable = n;
+ }
+
+ struct gc_generation_stats *stats = &gcstate->generation_stats[generation];
+ stats->collections++;
+ stats->collected += m;
+ stats->uncollectable += n;
+
+ if (PyDTrace_GC_DONE_ENABLED()) {
+ PyDTrace_GC_DONE(n + m);
+ }
+
+ assert(!_PyErr_Occurred(tstate));
+ return n + m;
+}
+
+/* Invoke progress callbacks to notify clients that garbage collection
+ * is starting or stopping
+ */
+static void
+invoke_gc_callback(PyThreadState *tstate, const char *phase,
+ int generation, Py_ssize_t collected,
+ Py_ssize_t uncollectable)
+{
+ assert(!_PyErr_Occurred(tstate));
+
+ /* we may get called very early */
+ GCState *gcstate = &tstate->interp->gc;
+ if (gcstate->callbacks == NULL) {
+ return;
+ }
+
+ /* The local variable cannot be rebound, check it for sanity */
+ assert(PyList_CheckExact(gcstate->callbacks));
+ PyObject *info = NULL;
+ if (PyList_GET_SIZE(gcstate->callbacks) != 0) {
+ info = Py_BuildValue("{sisnsn}",
+ "generation", generation,
+ "collected", collected,
+ "uncollectable", uncollectable);
+ if (info == NULL) {
+ PyErr_WriteUnraisable(NULL);
+ return;
+ }
+ }
+
+ PyObject *phase_obj = PyUnicode_FromString(phase);
+ if (phase_obj == NULL) {
+ Py_XDECREF(info);
+ PyErr_WriteUnraisable(NULL);
+ return;
+ }
+
+ PyObject *stack[] = {phase_obj, info};
+ for (Py_ssize_t i=0; i<PyList_GET_SIZE(gcstate->callbacks); i++) {
+ PyObject *r, *cb = PyList_GET_ITEM(gcstate->callbacks, i);
+ Py_INCREF(cb); /* make sure cb doesn't go away */
+ r = PyObject_Vectorcall(cb, stack, 2, NULL);
+ if (r == NULL) {
+ PyErr_WriteUnraisable(cb);
+ }
+ else {
+ Py_DECREF(r);
+ }
+ Py_DECREF(cb);
+ }
+ Py_DECREF(phase_obj);
+ Py_XDECREF(info);
+ assert(!_PyErr_Occurred(tstate));
+}
+
+/* Perform garbage collection of a generation and invoke
+ * progress callbacks.
+ */
+static Py_ssize_t
+gc_collect_with_callback(PyThreadState *tstate, int generation)
+{
+ assert(!_PyErr_Occurred(tstate));
+ Py_ssize_t result, collected, uncollectable;
+ invoke_gc_callback(tstate, "start", generation, 0, 0);
+ result = gc_collect_main(tstate, generation, &collected, &uncollectable, 0);
+ invoke_gc_callback(tstate, "stop", generation, collected, uncollectable);
+ assert(!_PyErr_Occurred(tstate));
+ return result;
+}
+
+static Py_ssize_t
+gc_collect_generations(PyThreadState *tstate)
+{
+ GCState *gcstate = &tstate->interp->gc;
+ /* Find the oldest generation (highest numbered) where the count
+ * exceeds the threshold. Objects in the that generation and
+ * generations younger than it will be collected. */
+ Py_ssize_t n = 0;
+ for (int i = NUM_GENERATIONS-1; i >= 0; i--) {
+ if (gcstate->generations[i].count > gcstate->generations[i].threshold) {
+ /* Avoid quadratic performance degradation in number
+ of tracked objects (see also issue #4074):
+
+ To limit the cost of garbage collection, there are two strategies;
+ - make each collection faster, e.g. by scanning fewer objects
+ - do less collections
+ This heuristic is about the latter strategy.
+
+ In addition to the various configurable thresholds, we only trigger a
+ full collection if the ratio
+
+ long_lived_pending / long_lived_total
+
+ is above a given value (hardwired to 25%).
+
+ The reason is that, while "non-full" collections (i.e., collections of
+ the young and middle generations) will always examine roughly the same
+ number of objects -- determined by the aforementioned thresholds --,
+ the cost of a full collection is proportional to the total number of
+ long-lived objects, which is virtually unbounded.
+
+ Indeed, it has been remarked that doing a full collection every
+ <constant number> of object creations entails a dramatic performance
+ degradation in workloads which consist in creating and storing lots of
+ long-lived objects (e.g. building a large list of GC-tracked objects would
+ show quadratic performance, instead of linear as expected: see issue #4074).
+
+ Using the above ratio, instead, yields amortized linear performance in
+ the total number of objects (the effect of which can be summarized
+ thusly: "each full garbage collection is more and more costly as the
+ number of objects grows, but we do fewer and fewer of them").
+
+ This heuristic was suggested by Martin von Löwis on python-dev in
+ June 2008. His original analysis and proposal can be found at:
+ http://mail.python.org/pipermail/python-dev/2008-June/080579.html
+ */
+ if (i == NUM_GENERATIONS - 1
+ && gcstate->long_lived_pending < gcstate->long_lived_total / 4)
+ continue;
+ n = gc_collect_with_callback(tstate, i);
+ break;
+ }
+ }
+ return n;
+}
+
+#include "clinic/gcmodule.c.h"
+
+/*[clinic input]
+gc.enable
+
+Enable automatic garbage collection.
+[clinic start generated code]*/
+
+static PyObject *
+gc_enable_impl(PyObject *module)
+/*[clinic end generated code: output=45a427e9dce9155c input=81ac4940ca579707]*/
+{
+ PyGC_Enable();
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+gc.disable
+
+Disable automatic garbage collection.
+[clinic start generated code]*/
+
+static PyObject *
+gc_disable_impl(PyObject *module)
+/*[clinic end generated code: output=97d1030f7aa9d279 input=8c2e5a14e800d83b]*/
+{
+ PyGC_Disable();
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+gc.isenabled -> bool
+
+Returns true if automatic garbage collection is enabled.
+[clinic start generated code]*/
+
+static int
+gc_isenabled_impl(PyObject *module)
+/*[clinic end generated code: output=1874298331c49130 input=30005e0422373b31]*/
+{
+ return PyGC_IsEnabled();
+}
+
+/*[clinic input]
+gc.collect -> Py_ssize_t
+
+ generation: int(c_default="NUM_GENERATIONS - 1") = 2
+
+Run the garbage collector.
+
+With no arguments, run a full collection. The optional argument
+may be an integer specifying which generation to collect. A ValueError
+is raised if the generation number is invalid.
+
+The number of unreachable objects is returned.
+[clinic start generated code]*/
+
+static Py_ssize_t
+gc_collect_impl(PyObject *module, int generation)
+/*[clinic end generated code: output=b697e633043233c7 input=40720128b682d879]*/
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+
+ if (generation < 0 || generation >= NUM_GENERATIONS) {
+ _PyErr_SetString(tstate, PyExc_ValueError, "invalid generation");
+ return -1;
+ }
+
+ GCState *gcstate = &tstate->interp->gc;
+ Py_ssize_t n;
+ if (gcstate->collecting) {
+ /* already collecting, don't do anything */
+ n = 0;
+ }
+ else {
+ gcstate->collecting = 1;
+ n = gc_collect_with_callback(tstate, generation);
+ gcstate->collecting = 0;
+ }
+ return n;
+}
+
+/*[clinic input]
+gc.set_debug
+
+ flags: int
+ An integer that can have the following bits turned on:
+ DEBUG_STATS - Print statistics during collection.
+ DEBUG_COLLECTABLE - Print collectable objects found.
+ DEBUG_UNCOLLECTABLE - Print unreachable but uncollectable objects
+ found.
+ DEBUG_SAVEALL - Save objects to gc.garbage rather than freeing them.
+ DEBUG_LEAK - Debug leaking programs (everything but STATS).
+ /
+
+Set the garbage collection debugging flags.
+
+Debugging information is written to sys.stderr.
+[clinic start generated code]*/
+
+static PyObject *
+gc_set_debug_impl(PyObject *module, int flags)
+/*[clinic end generated code: output=7c8366575486b228 input=5e5ce15e84fbed15]*/
+{
+ GCState *gcstate = get_gc_state();
+ gcstate->debug = flags;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+gc.get_debug -> int
+
+Get the garbage collection debugging flags.
+[clinic start generated code]*/
+
+static int
+gc_get_debug_impl(PyObject *module)
+/*[clinic end generated code: output=91242f3506cd1e50 input=91a101e1c3b98366]*/
+{
+ GCState *gcstate = get_gc_state();
+ return gcstate->debug;
+}
+
+PyDoc_STRVAR(gc_set_thresh__doc__,
+"set_threshold(threshold0, [threshold1, threshold2]) -> None\n"
+"\n"
+"Sets the collection thresholds. Setting threshold0 to zero disables\n"
+"collection.\n");
+
+static PyObject *
+gc_set_threshold(PyObject *self, PyObject *args)
+{
+ GCState *gcstate = get_gc_state();
+ if (!PyArg_ParseTuple(args, "i|ii:set_threshold",
+ &gcstate->generations[0].threshold,
+ &gcstate->generations[1].threshold,
+ &gcstate->generations[2].threshold))
+ return NULL;
+ for (int i = 3; i < NUM_GENERATIONS; i++) {
+ /* generations higher than 2 get the same threshold */
+ gcstate->generations[i].threshold = gcstate->generations[2].threshold;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+gc.get_threshold
+
+Return the current collection thresholds.
+[clinic start generated code]*/
+
+static PyObject *
+gc_get_threshold_impl(PyObject *module)
+/*[clinic end generated code: output=7902bc9f41ecbbd8 input=286d79918034d6e6]*/
+{
+ GCState *gcstate = get_gc_state();
+ return Py_BuildValue("(iii)",
+ gcstate->generations[0].threshold,
+ gcstate->generations[1].threshold,
+ gcstate->generations[2].threshold);
+}
+
+/*[clinic input]
+gc.get_count
+
+Return a three-tuple of the current collection counts.
+[clinic start generated code]*/
+
+static PyObject *
+gc_get_count_impl(PyObject *module)
+/*[clinic end generated code: output=354012e67b16398f input=a392794a08251751]*/
+{
+ GCState *gcstate = get_gc_state();
+ return Py_BuildValue("(iii)",
+ gcstate->generations[0].count,
+ gcstate->generations[1].count,
+ gcstate->generations[2].count);
+}
+
+static int
+referrersvisit(PyObject* obj, PyObject *objs)
+{
+ Py_ssize_t i;
+ for (i = 0; i < PyTuple_GET_SIZE(objs); i++)
+ if (PyTuple_GET_ITEM(objs, i) == obj)
+ return 1;
+ return 0;
+}
+
+static int
+gc_referrers_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist)
+{
+ PyGC_Head *gc;
+ PyObject *obj;
+ traverseproc traverse;
+ for (gc = GC_NEXT(list); gc != list; gc = GC_NEXT(gc)) {
+ obj = FROM_GC(gc);
+ traverse = Py_TYPE(obj)->tp_traverse;
+ if (obj == objs || obj == resultlist)
+ continue;
+ if (traverse(obj, (visitproc)referrersvisit, objs)) {
+ if (PyList_Append(resultlist, obj) < 0)
+ return 0; /* error */
+ }
+ }
+ return 1; /* no error */
+}
+
+PyDoc_STRVAR(gc_get_referrers__doc__,
+"get_referrers(*objs) -> list\n\
+Return the list of objects that directly refer to any of objs.");
+
+static PyObject *
+gc_get_referrers(PyObject *self, PyObject *args)
+{
+ if (PySys_Audit("gc.get_referrers", "(O)", args) < 0) {
+ return NULL;
+ }
+
+ PyObject *result = PyList_New(0);
+ if (!result) {
+ return NULL;
+ }
+
+ GCState *gcstate = get_gc_state();
+ for (int i = 0; i < NUM_GENERATIONS; i++) {
+ if (!(gc_referrers_for(args, GEN_HEAD(gcstate, i), result))) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ return result;
+}
+
+/* Append obj to list; return true if error (out of memory), false if OK. */
+static int
+referentsvisit(PyObject *obj, PyObject *list)
+{
+ return PyList_Append(list, obj) < 0;
+}
+
+PyDoc_STRVAR(gc_get_referents__doc__,
+"get_referents(*objs) -> list\n\
+Return the list of objects that are directly referred to by objs.");
+
+static PyObject *
+gc_get_referents(PyObject *self, PyObject *args)
+{
+ Py_ssize_t i;
+ if (PySys_Audit("gc.get_referents", "(O)", args) < 0) {
+ return NULL;
+ }
+ PyObject *result = PyList_New(0);
+
+ if (result == NULL)
+ return NULL;
+
+ for (i = 0; i < PyTuple_GET_SIZE(args); i++) {
+ traverseproc traverse;
+ PyObject *obj = PyTuple_GET_ITEM(args, i);
+
+ if (!_PyObject_IS_GC(obj))
+ continue;
+ traverse = Py_TYPE(obj)->tp_traverse;
+ if (! traverse)
+ continue;
+ if (traverse(obj, (visitproc)referentsvisit, result)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ return result;
+}
+
+/*[clinic input]
+gc.get_objects
+ generation: Py_ssize_t(accept={int, NoneType}, c_default="-1") = None
+ Generation to extract the objects from.
+
+Return a list of objects tracked by the collector (excluding the list returned).
+
+If generation is not None, return only the objects tracked by the collector
+that are in that generation.
+[clinic start generated code]*/
+
+static PyObject *
+gc_get_objects_impl(PyObject *module, Py_ssize_t generation)
+/*[clinic end generated code: output=48b35fea4ba6cb0e input=ef7da9df9806754c]*/
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ int i;
+ PyObject* result;
+ GCState *gcstate = &tstate->interp->gc;
+
+ if (PySys_Audit("gc.get_objects", "n", generation) < 0) {
+ return NULL;
+ }
+
+ result = PyList_New(0);
+ if (result == NULL) {
+ return NULL;
+ }
+
+ /* If generation is passed, we extract only that generation */
+ if (generation != -1) {
+ if (generation >= NUM_GENERATIONS) {
+ _PyErr_Format(tstate, PyExc_ValueError,
+ "generation parameter must be less than the number of "
+ "available generations (%i)",
+ NUM_GENERATIONS);
+ goto error;
+ }
+
+ if (generation < 0) {
+ _PyErr_SetString(tstate, PyExc_ValueError,
+ "generation parameter cannot be negative");
+ goto error;
+ }
+
+ if (append_objects(result, GEN_HEAD(gcstate, generation))) {
+ goto error;
+ }
+
+ return result;
+ }
+
+ /* If generation is not passed or None, get all objects from all generations */
+ for (i = 0; i < NUM_GENERATIONS; i++) {
+ if (append_objects(result, GEN_HEAD(gcstate, i))) {
+ goto error;
+ }
+ }
+ return result;
+
+error:
+ Py_DECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+gc.get_stats
+
+Return a list of dictionaries containing per-generation statistics.
+[clinic start generated code]*/
+
+static PyObject *
+gc_get_stats_impl(PyObject *module)
+/*[clinic end generated code: output=a8ab1d8a5d26f3ab input=1ef4ed9d17b1a470]*/
+{
+ int i;
+ struct gc_generation_stats stats[NUM_GENERATIONS], *st;
+
+ /* To get consistent values despite allocations while constructing
+ the result list, we use a snapshot of the running stats. */
+ GCState *gcstate = get_gc_state();
+ for (i = 0; i < NUM_GENERATIONS; i++) {
+ stats[i] = gcstate->generation_stats[i];
+ }
+
+ PyObject *result = PyList_New(0);
+ if (result == NULL)
+ return NULL;
+
+ for (i = 0; i < NUM_GENERATIONS; i++) {
+ PyObject *dict;
+ st = &stats[i];
+ dict = Py_BuildValue("{snsnsn}",
+ "collections", st->collections,
+ "collected", st->collected,
+ "uncollectable", st->uncollectable
+ );
+ if (dict == NULL)
+ goto error;
+ if (PyList_Append(result, dict)) {
+ Py_DECREF(dict);
+ goto error;
+ }
+ Py_DECREF(dict);
+ }
+ return result;
+
+error:
+ Py_XDECREF(result);
+ return NULL;
+}
+
+
+/*[clinic input]
+gc.is_tracked
+
+ obj: object
+ /
+
+Returns true if the object is tracked by the garbage collector.
+
+Simple atomic objects will return false.
+[clinic start generated code]*/
+
+static PyObject *
+gc_is_tracked(PyObject *module, PyObject *obj)
+/*[clinic end generated code: output=14f0103423b28e31 input=d83057f170ea2723]*/
+{
+ PyObject *result;
+
+ if (_PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj))
+ result = Py_True;
+ else
+ result = Py_False;
+ return Py_NewRef(result);
+}
+
+/*[clinic input]
+gc.is_finalized
+
+ obj: object
+ /
+
+Returns true if the object has been already finalized by the GC.
+[clinic start generated code]*/
+
+static PyObject *
+gc_is_finalized(PyObject *module, PyObject *obj)
+/*[clinic end generated code: output=e1516ac119a918ed input=201d0c58f69ae390]*/
+{
+ if (_PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+/*[clinic input]
+gc.freeze
+
+Freeze all current tracked objects and ignore them for future collections.
+
+This can be used before a POSIX fork() call to make the gc copy-on-write friendly.
+Note: collection before a POSIX fork() call may free pages for future allocation
+which can cause copy-on-write.
+[clinic start generated code]*/
+
+static PyObject *
+gc_freeze_impl(PyObject *module)
+/*[clinic end generated code: output=502159d9cdc4c139 input=b602b16ac5febbe5]*/
+{
+ GCState *gcstate = get_gc_state();
+ for (int i = 0; i < NUM_GENERATIONS; ++i) {
+ gc_list_merge(GEN_HEAD(gcstate, i), &gcstate->permanent_generation.head);
+ gcstate->generations[i].count = 0;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+gc.unfreeze
+
+Unfreeze all objects in the permanent generation.
+
+Put all objects in the permanent generation back into oldest generation.
+[clinic start generated code]*/
+
+static PyObject *
+gc_unfreeze_impl(PyObject *module)
+/*[clinic end generated code: output=1c15f2043b25e169 input=2dd52b170f4cef6c]*/
+{
+ GCState *gcstate = get_gc_state();
+ gc_list_merge(&gcstate->permanent_generation.head,
+ GEN_HEAD(gcstate, NUM_GENERATIONS-1));
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+gc.get_freeze_count -> Py_ssize_t
+
+Return the number of objects in the permanent generation.
+[clinic start generated code]*/
+
+static Py_ssize_t
+gc_get_freeze_count_impl(PyObject *module)
+/*[clinic end generated code: output=61cbd9f43aa032e1 input=45ffbc65cfe2a6ed]*/
+{
+ GCState *gcstate = get_gc_state();
+ return gc_list_size(&gcstate->permanent_generation.head);
+}
+
+
+PyDoc_STRVAR(gc__doc__,
+"This module provides access to the garbage collector for reference cycles.\n"
+"\n"
+"enable() -- Enable automatic garbage collection.\n"
+"disable() -- Disable automatic garbage collection.\n"
+"isenabled() -- Returns true if automatic collection is enabled.\n"
+"collect() -- Do a full collection right now.\n"
+"get_count() -- Return the current collection counts.\n"
+"get_stats() -- Return list of dictionaries containing per-generation stats.\n"
+"set_debug() -- Set debugging flags.\n"
+"get_debug() -- Get debugging flags.\n"
+"set_threshold() -- Set the collection thresholds.\n"
+"get_threshold() -- Return the current the collection thresholds.\n"
+"get_objects() -- Return a list of all objects tracked by the collector.\n"
+"is_tracked() -- Returns true if a given object is tracked.\n"
+"is_finalized() -- Returns true if a given object has been already finalized.\n"
+"get_referrers() -- Return the list of objects that refer to an object.\n"
+"get_referents() -- Return the list of objects that an object refers to.\n"
+"freeze() -- Freeze all tracked objects and ignore them for future collections.\n"
+"unfreeze() -- Unfreeze all objects in the permanent generation.\n"
+"get_freeze_count() -- Return the number of objects in the permanent generation.\n");
+
+static PyMethodDef GcMethods[] = {
+ GC_ENABLE_METHODDEF
+ GC_DISABLE_METHODDEF
+ GC_ISENABLED_METHODDEF
+ GC_SET_DEBUG_METHODDEF
+ GC_GET_DEBUG_METHODDEF
+ GC_GET_COUNT_METHODDEF
+ {"set_threshold", gc_set_threshold, METH_VARARGS, gc_set_thresh__doc__},
+ GC_GET_THRESHOLD_METHODDEF
+ GC_COLLECT_METHODDEF
+ GC_GET_OBJECTS_METHODDEF
+ GC_GET_STATS_METHODDEF
+ GC_IS_TRACKED_METHODDEF
+ GC_IS_FINALIZED_METHODDEF
+ {"get_referrers", gc_get_referrers, METH_VARARGS,
+ gc_get_referrers__doc__},
+ {"get_referents", gc_get_referents, METH_VARARGS,
+ gc_get_referents__doc__},
+ GC_FREEZE_METHODDEF
+ GC_UNFREEZE_METHODDEF
+ GC_GET_FREEZE_COUNT_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+static int
+gcmodule_exec(PyObject *module)
+{
+ GCState *gcstate = get_gc_state();
+
+ /* garbage and callbacks are initialized by _PyGC_Init() early in
+ * interpreter lifecycle. */
+ assert(gcstate->garbage != NULL);
+ if (PyModule_AddObjectRef(module, "garbage", gcstate->garbage) < 0) {
+ return -1;
+ }
+ assert(gcstate->callbacks != NULL);
+ if (PyModule_AddObjectRef(module, "callbacks", gcstate->callbacks) < 0) {
+ return -1;
+ }
+
+#define ADD_INT(NAME) if (PyModule_AddIntConstant(module, #NAME, NAME) < 0) { return -1; }
+ ADD_INT(DEBUG_STATS);
+ ADD_INT(DEBUG_COLLECTABLE);
+ ADD_INT(DEBUG_UNCOLLECTABLE);
+ ADD_INT(DEBUG_SAVEALL);
+ ADD_INT(DEBUG_LEAK);
+#undef ADD_INT
+ return 0;
+}
+
+static PyModuleDef_Slot gcmodule_slots[] = {
+ {Py_mod_exec, gcmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef gcmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "gc",
+ .m_doc = gc__doc__,
+ .m_size = 0, // per interpreter state, see: get_gc_state()
+ .m_methods = GcMethods,
+ .m_slots = gcmodule_slots
+};
+
+PyMODINIT_FUNC
+PyInit_gc(void)
+{
+ return PyModuleDef_Init(&gcmodule);
+}
+
+/* C API for controlling the state of the garbage collector */
+int
+PyGC_Enable(void)
+{
+ GCState *gcstate = get_gc_state();
+ int old_state = gcstate->enabled;
+ gcstate->enabled = 1;
+ return old_state;
+}
+
+int
+PyGC_Disable(void)
+{
+ GCState *gcstate = get_gc_state();
+ int old_state = gcstate->enabled;
+ gcstate->enabled = 0;
+ return old_state;
+}
+
+int
+PyGC_IsEnabled(void)
+{
+ GCState *gcstate = get_gc_state();
+ return gcstate->enabled;
+}
+
+/* Public API to invoke gc.collect() from C */
+Py_ssize_t
+PyGC_Collect(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ GCState *gcstate = &tstate->interp->gc;
+
+ if (!gcstate->enabled) {
+ return 0;
+ }
+
+ Py_ssize_t n;
+ if (gcstate->collecting) {
+ /* already collecting, don't do anything */
+ n = 0;
+ }
+ else {
+ gcstate->collecting = 1;
+ PyObject *exc = _PyErr_GetRaisedException(tstate);
+ n = gc_collect_with_callback(tstate, NUM_GENERATIONS - 1);
+ _PyErr_SetRaisedException(tstate, exc);
+ gcstate->collecting = 0;
+ }
+
+ return n;
+}
+
+Py_ssize_t
+_PyGC_CollectNoFail(PyThreadState *tstate)
+{
+ /* Ideally, this function is only called on interpreter shutdown,
+ and therefore not recursively. Unfortunately, when there are daemon
+ threads, a daemon thread can start a cyclic garbage collection
+ during interpreter shutdown (and then never finish it).
+ See http://bugs.python.org/issue8713#msg195178 for an example.
+ */
+ GCState *gcstate = &tstate->interp->gc;
+ if (gcstate->collecting) {
+ return 0;
+ }
+
+ Py_ssize_t n;
+ gcstate->collecting = 1;
+ n = gc_collect_main(tstate, NUM_GENERATIONS - 1, NULL, NULL, 1);
+ gcstate->collecting = 0;
+ return n;
+}
+
+void
+_PyGC_DumpShutdownStats(PyInterpreterState *interp)
+{
+ GCState *gcstate = &interp->gc;
+ if (!(gcstate->debug & DEBUG_SAVEALL)
+ && gcstate->garbage != NULL && PyList_GET_SIZE(gcstate->garbage) > 0) {
+ const char *message;
+ if (gcstate->debug & DEBUG_UNCOLLECTABLE)
+ message = "gc: %zd uncollectable objects at " \
+ "shutdown";
+ else
+ message = "gc: %zd uncollectable objects at " \
+ "shutdown; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them";
+ /* PyErr_WarnFormat does too many things and we are at shutdown,
+ the warnings module's dependencies (e.g. linecache) may be gone
+ already. */
+ if (PyErr_WarnExplicitFormat(PyExc_ResourceWarning, "gc", 0,
+ "gc", NULL, message,
+ PyList_GET_SIZE(gcstate->garbage)))
+ PyErr_WriteUnraisable(NULL);
+ if (gcstate->debug & DEBUG_UNCOLLECTABLE) {
+ PyObject *repr = NULL, *bytes = NULL;
+ repr = PyObject_Repr(gcstate->garbage);
+ if (!repr || !(bytes = PyUnicode_EncodeFSDefault(repr)))
+ PyErr_WriteUnraisable(gcstate->garbage);
+ else {
+ PySys_WriteStderr(
+ " %s\n",
+ PyBytes_AS_STRING(bytes)
+ );
+ }
+ Py_XDECREF(repr);
+ Py_XDECREF(bytes);
+ }
+ }
+}
+
+
+void
+_PyGC_Fini(PyInterpreterState *interp)
+{
+ GCState *gcstate = &interp->gc;
+ Py_CLEAR(gcstate->garbage);
+ Py_CLEAR(gcstate->callbacks);
+
+ /* We expect that none of this interpreters objects are shared
+ with other interpreters.
+ See https://github.com/python/cpython/issues/90228. */
+}
+
+/* for debugging */
+void
+_PyGC_Dump(PyGC_Head *g)
+{
+ _PyObject_Dump(FROM_GC(g));
+}
+
+
+#ifdef Py_DEBUG
+static int
+visit_validate(PyObject *op, void *parent_raw)
+{
+ PyObject *parent = _PyObject_CAST(parent_raw);
+ if (_PyObject_IsFreed(op)) {
+ _PyObject_ASSERT_FAILED_MSG(parent,
+ "PyObject_GC_Track() object is not valid");
+ }
+ return 0;
+}
+#endif
+
+
+/* extension modules might be compiled with GC support so these
+ functions must always be available */
+
+void
+PyObject_GC_Track(void *op_raw)
+{
+ PyObject *op = _PyObject_CAST(op_raw);
+ if (_PyObject_GC_IS_TRACKED(op)) {
+ _PyObject_ASSERT_FAILED_MSG(op,
+ "object already tracked "
+ "by the garbage collector");
+ }
+ _PyObject_GC_TRACK(op);
+
+#ifdef Py_DEBUG
+ /* Check that the object is valid: validate objects traversed
+ by tp_traverse() */
+ traverseproc traverse = Py_TYPE(op)->tp_traverse;
+ (void)traverse(op, visit_validate, op);
+#endif
+}
+
+void
+PyObject_GC_UnTrack(void *op_raw)
+{
+ PyObject *op = _PyObject_CAST(op_raw);
+ /* Obscure: the Py_TRASHCAN mechanism requires that we be able to
+ * call PyObject_GC_UnTrack twice on an object.
+ */
+ if (_PyObject_GC_IS_TRACKED(op)) {
+ _PyObject_GC_UNTRACK(op);
+ }
+}
+
+int
+PyObject_IS_GC(PyObject *obj)
+{
+ return _PyObject_IS_GC(obj);
+}
+
+void
+_Py_ScheduleGC(PyInterpreterState *interp)
+{
+ GCState *gcstate = &interp->gc;
+ if (gcstate->collecting == 1) {
+ return;
+ }
+ struct _ceval_state *ceval = &interp->ceval;
+ if (!_Py_atomic_load_relaxed(&ceval->gc_scheduled)) {
+ _Py_atomic_store_relaxed(&ceval->gc_scheduled, 1);
+ _Py_atomic_store_relaxed(&ceval->eval_breaker, 1);
+ }
+}
+
+void
+_PyObject_GC_Link(PyObject *op)
+{
+ PyGC_Head *g = AS_GC(op);
+ assert(((uintptr_t)g & (sizeof(uintptr_t)-1)) == 0); // g must be correctly aligned
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ GCState *gcstate = &tstate->interp->gc;
+ g->_gc_next = 0;
+ g->_gc_prev = 0;
+ gcstate->generations[0].count++; /* number of allocated GC objects */
+ if (gcstate->generations[0].count > gcstate->generations[0].threshold &&
+ gcstate->enabled &&
+ gcstate->generations[0].threshold &&
+ !gcstate->collecting &&
+ !_PyErr_Occurred(tstate))
+ {
+ _Py_ScheduleGC(tstate->interp);
+ }
+}
+
+void
+_Py_RunGC(PyThreadState *tstate)
+{
+ GCState *gcstate = &tstate->interp->gc;
+ gcstate->collecting = 1;
+ gc_collect_generations(tstate);
+ gcstate->collecting = 0;
+}
+
+static PyObject *
+gc_alloc(size_t basicsize, size_t presize)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (basicsize > PY_SSIZE_T_MAX - presize) {
+ return _PyErr_NoMemory(tstate);
+ }
+ size_t size = presize + basicsize;
+ char *mem = PyObject_Malloc(size);
+ if (mem == NULL) {
+ return _PyErr_NoMemory(tstate);
+ }
+ ((PyObject **)mem)[0] = NULL;
+ ((PyObject **)mem)[1] = NULL;
+ PyObject *op = (PyObject *)(mem + presize);
+ _PyObject_GC_Link(op);
+ return op;
+}
+
+PyObject *
+_PyObject_GC_New(PyTypeObject *tp)
+{
+ size_t presize = _PyType_PreHeaderSize(tp);
+ PyObject *op = gc_alloc(_PyObject_SIZE(tp), presize);
+ if (op == NULL) {
+ return NULL;
+ }
+ _PyObject_Init(op, tp);
+ return op;
+}
+
+PyVarObject *
+_PyObject_GC_NewVar(PyTypeObject *tp, Py_ssize_t nitems)
+{
+ PyVarObject *op;
+
+ if (nitems < 0) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+ size_t presize = _PyType_PreHeaderSize(tp);
+ size_t size = _PyObject_VAR_SIZE(tp, nitems);
+ op = (PyVarObject *)gc_alloc(size, presize);
+ if (op == NULL) {
+ return NULL;
+ }
+ _PyObject_InitVar(op, tp, nitems);
+ return op;
+}
+
+PyObject *
+PyUnstable_Object_GC_NewWithExtraData(PyTypeObject *tp, size_t extra_size)
+{
+ size_t presize = _PyType_PreHeaderSize(tp);
+ PyObject *op = gc_alloc(_PyObject_SIZE(tp) + extra_size, presize);
+ if (op == NULL) {
+ return NULL;
+ }
+ memset(op, 0, _PyObject_SIZE(tp) + extra_size);
+ _PyObject_Init(op, tp);
+ return op;
+}
+
+PyVarObject *
+_PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems)
+{
+ const size_t basicsize = _PyObject_VAR_SIZE(Py_TYPE(op), nitems);
+ const size_t presize = _PyType_PreHeaderSize(((PyObject *)op)->ob_type);
+ _PyObject_ASSERT((PyObject *)op, !_PyObject_GC_IS_TRACKED(op));
+ if (basicsize > (size_t)PY_SSIZE_T_MAX - presize) {
+ return (PyVarObject *)PyErr_NoMemory();
+ }
+ char *mem = (char *)op - presize;
+ mem = (char *)PyObject_Realloc(mem, presize + basicsize);
+ if (mem == NULL) {
+ return (PyVarObject *)PyErr_NoMemory();
+ }
+ op = (PyVarObject *) (mem + presize);
+ Py_SET_SIZE(op, nitems);
+ return op;
+}
+
+void
+PyObject_GC_Del(void *op)
+{
+ size_t presize = _PyType_PreHeaderSize(((PyObject *)op)->ob_type);
+ PyGC_Head *g = AS_GC(op);
+ if (_PyObject_GC_IS_TRACKED(op)) {
+ gc_list_remove(g);
+#ifdef Py_DEBUG
+ PyObject *exc = PyErr_GetRaisedException();
+ if (PyErr_WarnExplicitFormat(PyExc_ResourceWarning, "gc", 0,
+ "gc", NULL, "Object of type %s is not untracked before destruction",
+ ((PyObject*)op)->ob_type->tp_name)) {
+ PyErr_WriteUnraisable(NULL);
+ }
+ PyErr_SetRaisedException(exc);
+#endif
+ }
+ GCState *gcstate = get_gc_state();
+ if (gcstate->generations[0].count > 0) {
+ gcstate->generations[0].count--;
+ }
+ PyObject_Free(((char *)op)-presize);
+}
+
+int
+PyObject_GC_IsTracked(PyObject* obj)
+{
+ if (_PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) {
+ return 1;
+ }
+ return 0;
+}
+
+int
+PyObject_GC_IsFinalized(PyObject *obj)
+{
+ if (_PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) {
+ return 1;
+ }
+ return 0;
+}
+
+void
+PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void *arg)
+{
+ size_t i;
+ GCState *gcstate = get_gc_state();
+ int origenstate = gcstate->enabled;
+ gcstate->enabled = 0;
+ for (i = 0; i < NUM_GENERATIONS; i++) {
+ PyGC_Head *gc_list, *gc;
+ gc_list = GEN_HEAD(gcstate, i);
+ for (gc = GC_NEXT(gc_list); gc != gc_list; gc = GC_NEXT(gc)) {
+ PyObject *op = FROM_GC(gc);
+ Py_INCREF(op);
+ int res = callback(op, arg);
+ Py_DECREF(op);
+ if (!res) {
+ goto done;
+ }
+ }
+ }
+done:
+ gcstate->enabled = origenstate;
+}
diff --git a/contrib/tools/python3/Modules/getaddrinfo.c b/contrib/tools/python3/Modules/getaddrinfo.c
new file mode 100644
index 00000000000..f1c28d7d931
--- /dev/null
+++ b/contrib/tools/python3/Modules/getaddrinfo.c
@@ -0,0 +1,647 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * "#ifdef FAITH" part is local hack for supporting IPv4-v6 translator.
+ *
+ * Issues to be discussed:
+ * - Thread safe-ness must be checked.
+ * - Return values. There are nonstandard return values defined and used
+ * in the source code. This is because RFC2133 is silent about which error
+ * code must be returned for which situation.
+ * - PF_UNSPEC case would be handled in getipnodebyname() with the AI_ALL flag.
+ */
+
+#if 0
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#include "addrinfo.h"
+#endif
+
+#if defined(__KAME__) && defined(ENABLE_IPV6)
+# define FAITH
+#endif
+
+#ifdef HAVE_NETDB_H
+#define HAVE_GETADDRINFO 1
+
+#define SUCCESS 0
+#define GAI_ANY 0
+#define YES 1
+#define NO 0
+
+#ifdef FAITH
+static int translate = NO;
+static struct in6_addr faith_prefix = IN6ADDR_GAI_ANY_INIT;
+#endif
+
+static const char in_addrany[] = { 0, 0, 0, 0 };
+static const char in6_addrany[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+static const char in_loopback[] = { 127, 0, 0, 1 };
+static const char in6_loopback[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
+};
+
+struct sockinet {
+ u_char si_len;
+ u_char si_family;
+ u_short si_port;
+};
+
+static struct gai_afd {
+ int a_af;
+ int a_addrlen;
+ int a_socklen;
+ int a_off;
+ const char *a_addrany;
+ const char *a_loopback;
+} gai_afdl [] = {
+#ifdef ENABLE_IPV6
+#define N_INET6 0
+ {PF_INET6, sizeof(struct in6_addr),
+ sizeof(struct sockaddr_in6),
+ offsetof(struct sockaddr_in6, sin6_addr),
+ in6_addrany, in6_loopback},
+#define N_INET 1
+#else
+#define N_INET 0
+#endif
+ {PF_INET, sizeof(struct in_addr),
+ sizeof(struct sockaddr_in),
+ offsetof(struct sockaddr_in, sin_addr),
+ in_addrany, in_loopback},
+ {0, 0, 0, 0, NULL, NULL},
+};
+
+#ifdef ENABLE_IPV6
+#define PTON_MAX 16
+#else
+#define PTON_MAX 4
+#endif
+
+#ifndef IN_MULTICAST
+#define IN_MULTICAST(i) (((i) & 0xf0000000U) == 0xe0000000U)
+#endif
+
+#ifndef IN_EXPERIMENTAL
+#define IN_EXPERIMENTAL(i) (((i) & 0xe0000000U) == 0xe0000000U)
+#endif
+
+#ifndef IN_LOOPBACKNET
+#define IN_LOOPBACKNET 127
+#endif
+
+static int get_name(const char *, struct gai_afd *,
+ struct addrinfo **, char *, struct addrinfo *,
+ int);
+static int get_addr(const char *, int, struct addrinfo **,
+ struct addrinfo *, int);
+static int str_isnumber(const char *);
+
+static const char * const ai_errlist[] = {
+ "success.",
+ "address family for hostname not supported.", /* EAI_ADDRFAMILY */
+ "temporary failure in name resolution.", /* EAI_AGAIN */
+ "invalid value for ai_flags.", /* EAI_BADFLAGS */
+ "non-recoverable failure in name resolution.", /* EAI_FAIL */
+ "ai_family not supported.", /* EAI_FAMILY */
+ "memory allocation failure.", /* EAI_MEMORY */
+ "no address associated with hostname.", /* EAI_NODATA */
+ "hostname nor servname provided, or not known.",/* EAI_NONAME */
+ "servname not supported for ai_socktype.", /* EAI_SERVICE */
+ "ai_socktype not supported.", /* EAI_SOCKTYPE */
+ "system error returned in errno.", /* EAI_SYSTEM */
+ "invalid value for hints.", /* EAI_BADHINTS */
+ "resolved protocol is unknown.", /* EAI_PROTOCOL */
+ "unknown error.", /* EAI_MAX */
+};
+
+#define GET_CANONNAME(ai, str) \
+if (pai->ai_flags & AI_CANONNAME) {\
+ if (((ai)->ai_canonname = (char *)malloc(strlen(str) + 1)) != NULL) {\
+ strcpy((ai)->ai_canonname, (str));\
+ } else {\
+ error = EAI_MEMORY;\
+ goto free;\
+ }\
+}
+
+#ifdef HAVE_SOCKADDR_SA_LEN
+#define GET_AI(ai, gai_afd, addr, port) {\
+ char *p;\
+ if (((ai) = (struct addrinfo *)malloc(sizeof(struct addrinfo) +\
+ ((gai_afd)->a_socklen)))\
+ == NULL) goto free;\
+ memcpy(ai, pai, sizeof(struct addrinfo));\
+ (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
+ memset((ai)->ai_addr, 0, (gai_afd)->a_socklen);\
+ (ai)->ai_addr->sa_len = (ai)->ai_addrlen = (gai_afd)->a_socklen;\
+ (ai)->ai_addr->sa_family = (ai)->ai_family = (gai_afd)->a_af;\
+ ((struct sockinet *)(ai)->ai_addr)->si_port = port;\
+ p = (char *)((ai)->ai_addr);\
+ memcpy(p + (gai_afd)->a_off, (addr), (gai_afd)->a_addrlen);\
+}
+#else
+#define GET_AI(ai, gai_afd, addr, port) {\
+ char *p;\
+ if (((ai) = (struct addrinfo *)malloc(sizeof(struct addrinfo) +\
+ ((gai_afd)->a_socklen)))\
+ == NULL) goto free;\
+ memcpy(ai, pai, sizeof(struct addrinfo));\
+ (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\
+ memset((ai)->ai_addr, 0, (gai_afd)->a_socklen);\
+ (ai)->ai_addrlen = (gai_afd)->a_socklen;\
+ (ai)->ai_addr->sa_family = (ai)->ai_family = (gai_afd)->a_af;\
+ ((struct sockinet *)(ai)->ai_addr)->si_port = port;\
+ p = (char *)((ai)->ai_addr);\
+ memcpy(p + (gai_afd)->a_off, (addr), (gai_afd)->a_addrlen);\
+}
+#endif
+
+#define ERR(err) { error = (err); goto bad; }
+
+const char *
+gai_strerror(int ecode)
+{
+ if (ecode < 0 || ecode > EAI_MAX)
+ ecode = EAI_MAX;
+ return ai_errlist[ecode];
+}
+
+void
+freeaddrinfo(struct addrinfo *ai)
+{
+ struct addrinfo *next;
+
+ do {
+ next = ai->ai_next;
+ if (ai->ai_canonname)
+ free(ai->ai_canonname);
+ /* no need to free(ai->ai_addr) */
+ free(ai);
+ } while ((ai = next) != NULL);
+}
+
+static int
+str_isnumber(const char *p)
+{
+ unsigned char *q = (unsigned char *)p;
+ while (*q) {
+ if (! isdigit(*q))
+ return NO;
+ q++;
+ }
+ return YES;
+}
+
+int
+getaddrinfo(const char*hostname, const char*servname,
+ const struct addrinfo *hints, struct addrinfo **res)
+{
+ struct addrinfo sentinel;
+ struct addrinfo *top = NULL;
+ struct addrinfo *cur;
+ int i, error = 0;
+ char pton[PTON_MAX];
+ struct addrinfo ai;
+ struct addrinfo *pai;
+ u_short port;
+
+#ifdef FAITH
+ static int firsttime = 1;
+
+ if (firsttime) {
+ /* translator hack */
+ {
+ const char *q = getenv("GAI");
+ if (q && inet_pton(AF_INET6, q, &faith_prefix) == 1)
+ translate = YES;
+ }
+ firsttime = 0;
+ }
+#endif
+
+ /* initialize file static vars */
+ sentinel.ai_next = NULL;
+ cur = &sentinel;
+ pai = &ai;
+ pai->ai_flags = 0;
+ pai->ai_family = PF_UNSPEC;
+ pai->ai_socktype = GAI_ANY;
+ pai->ai_protocol = GAI_ANY;
+ pai->ai_addrlen = 0;
+ pai->ai_canonname = NULL;
+ pai->ai_addr = NULL;
+ pai->ai_next = NULL;
+ port = GAI_ANY;
+
+ if (hostname == NULL && servname == NULL)
+ return EAI_NONAME;
+ if (hints) {
+ /* error check for hints */
+ if (hints->ai_addrlen || hints->ai_canonname ||
+ hints->ai_addr || hints->ai_next)
+ ERR(EAI_BADHINTS); /* xxx */
+ if (hints->ai_flags & ~AI_MASK)
+ ERR(EAI_BADFLAGS);
+ switch (hints->ai_family) {
+ case PF_UNSPEC:
+ case PF_INET:
+#ifdef ENABLE_IPV6
+ case PF_INET6:
+#endif
+ break;
+ default:
+ ERR(EAI_FAMILY);
+ }
+ memcpy(pai, hints, sizeof(*pai));
+ switch (pai->ai_socktype) {
+ case GAI_ANY:
+ switch (pai->ai_protocol) {
+ case GAI_ANY:
+ break;
+ case IPPROTO_UDP:
+ pai->ai_socktype = SOCK_DGRAM;
+ break;
+ case IPPROTO_TCP:
+ pai->ai_socktype = SOCK_STREAM;
+ break;
+ default:
+ pai->ai_socktype = SOCK_RAW;
+ break;
+ }
+ break;
+ case SOCK_RAW:
+ break;
+ case SOCK_DGRAM:
+ if (pai->ai_protocol != IPPROTO_UDP &&
+ pai->ai_protocol != GAI_ANY)
+ ERR(EAI_BADHINTS); /*xxx*/
+ pai->ai_protocol = IPPROTO_UDP;
+ break;
+ case SOCK_STREAM:
+ if (pai->ai_protocol != IPPROTO_TCP &&
+ pai->ai_protocol != GAI_ANY)
+ ERR(EAI_BADHINTS); /*xxx*/
+ pai->ai_protocol = IPPROTO_TCP;
+ break;
+ default:
+ ERR(EAI_SOCKTYPE);
+ /* unreachable */
+ }
+ }
+
+ /*
+ * service port
+ */
+ if (servname) {
+ if (str_isnumber(servname)) {
+ if (pai->ai_socktype == GAI_ANY) {
+ /* caller accept *GAI_ANY* socktype */
+ pai->ai_socktype = SOCK_DGRAM;
+ pai->ai_protocol = IPPROTO_UDP;
+ }
+ long maybe_port = strtol(servname, NULL, 10);
+ if (maybe_port < 0 || maybe_port > 0xffff) {
+ ERR(EAI_SERVICE);
+ }
+ port = htons((u_short)maybe_port);
+ } else {
+ struct servent *sp;
+ const char *proto;
+
+ proto = NULL;
+ switch (pai->ai_socktype) {
+ case GAI_ANY:
+ proto = NULL;
+ break;
+ case SOCK_DGRAM:
+ proto = "udp";
+ break;
+ case SOCK_STREAM:
+ proto = "tcp";
+ break;
+ default:
+ fprintf(stderr, "panic!\n");
+ break;
+ }
+ if ((sp = getservbyname(servname, proto)) == NULL)
+ ERR(EAI_SERVICE);
+ port = sp->s_port;
+ if (pai->ai_socktype == GAI_ANY) {
+ if (strcmp(sp->s_proto, "udp") == 0) {
+ pai->ai_socktype = SOCK_DGRAM;
+ pai->ai_protocol = IPPROTO_UDP;
+ } else if (strcmp(sp->s_proto, "tcp") == 0) {
+ pai->ai_socktype = SOCK_STREAM;
+ pai->ai_protocol = IPPROTO_TCP;
+ } else
+ ERR(EAI_PROTOCOL); /*xxx*/
+ }
+ }
+ }
+
+ /*
+ * hostname == NULL.
+ * passive socket -> anyaddr (0.0.0.0 or ::)
+ * non-passive socket -> localhost (127.0.0.1 or ::1)
+ */
+ if (hostname == NULL) {
+ struct gai_afd *gai_afd;
+
+ for (gai_afd = &gai_afdl[0]; gai_afd->a_af; gai_afd++) {
+ if (!(pai->ai_family == PF_UNSPEC
+ || pai->ai_family == gai_afd->a_af)) {
+ continue;
+ }
+
+ if (pai->ai_flags & AI_PASSIVE) {
+ GET_AI(cur->ai_next, gai_afd, gai_afd->a_addrany, port);
+ /* xxx meaningless?
+ * GET_CANONNAME(cur->ai_next, "anyaddr");
+ */
+ } else {
+ GET_AI(cur->ai_next, gai_afd, gai_afd->a_loopback,
+ port);
+ /* xxx meaningless?
+ * GET_CANONNAME(cur->ai_next, "localhost");
+ */
+ }
+ cur = cur->ai_next;
+ }
+ top = sentinel.ai_next;
+ if (top)
+ goto good;
+ else
+ ERR(EAI_FAMILY);
+ }
+
+ /* hostname as numeric name */
+ for (i = 0; gai_afdl[i].a_af; i++) {
+ if (inet_pton(gai_afdl[i].a_af, hostname, pton)) {
+ u_long v4a;
+#ifdef ENABLE_IPV6
+ u_char pfx;
+#endif
+
+ switch (gai_afdl[i].a_af) {
+ case AF_INET:
+ v4a = ((struct in_addr *)pton)->s_addr;
+ v4a = ntohl(v4a);
+ if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
+ pai->ai_flags &= ~AI_CANONNAME;
+ v4a >>= IN_CLASSA_NSHIFT;
+ if (v4a == 0 || v4a == IN_LOOPBACKNET)
+ pai->ai_flags &= ~AI_CANONNAME;
+ break;
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ pfx = ((struct in6_addr *)pton)->s6_addr[0];
+ if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
+ pai->ai_flags &= ~AI_CANONNAME;
+ break;
+#endif
+ }
+
+ if (pai->ai_family == gai_afdl[i].a_af ||
+ pai->ai_family == PF_UNSPEC) {
+ if (! (pai->ai_flags & AI_CANONNAME)) {
+ GET_AI(top, &gai_afdl[i], pton, port);
+ goto good;
+ }
+ /*
+ * if AI_CANONNAME and if reverse lookup
+ * fail, return ai anyway to pacify
+ * calling application.
+ *
+ * XXX getaddrinfo() is a name->address
+ * translation function, and it looks strange
+ * that we do addr->name translation here.
+ */
+ get_name(pton, &gai_afdl[i], &top, pton, pai, port);
+ goto good;
+ } else
+ ERR(EAI_FAMILY); /*xxx*/
+ }
+ }
+
+ if (pai->ai_flags & AI_NUMERICHOST)
+ ERR(EAI_NONAME);
+
+ /* hostname as alphabetical name */
+ error = get_addr(hostname, pai->ai_family, &top, pai, port);
+ if (error == 0) {
+ if (top) {
+ good:
+ *res = top;
+ return SUCCESS;
+ } else
+ error = EAI_FAIL;
+ }
+ free:
+ if (top)
+ freeaddrinfo(top);
+ bad:
+ *res = NULL;
+ return error;
+}
+
+static int
+get_name(addr, gai_afd, res, numaddr, pai, port0)
+ const char *addr;
+ struct gai_afd *gai_afd;
+ struct addrinfo **res;
+ char *numaddr;
+ struct addrinfo *pai;
+ int port0;
+{
+ u_short port = port0 & 0xffff;
+ struct hostent *hp;
+ struct addrinfo *cur;
+ int error = 0;
+#ifdef ENABLE_IPV6
+ int h_error;
+#endif
+
+#ifdef ENABLE_IPV6
+ hp = getipnodebyaddr(addr, gai_afd->a_addrlen, gai_afd->a_af, &h_error);
+#else
+ hp = gethostbyaddr(addr, gai_afd->a_addrlen, AF_INET);
+#endif
+ if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
+ GET_AI(cur, gai_afd, hp->h_addr_list[0], port);
+ GET_CANONNAME(cur, hp->h_name);
+ } else
+ GET_AI(cur, gai_afd, numaddr, port);
+
+#ifdef ENABLE_IPV6
+ if (hp)
+ freehostent(hp);
+#endif
+ *res = cur;
+ return SUCCESS;
+ free:
+ if (cur)
+ freeaddrinfo(cur);
+#ifdef ENABLE_IPV6
+ if (hp)
+ freehostent(hp);
+#endif
+ /* bad: */
+ *res = NULL;
+ return error;
+}
+
+static int
+get_addr(hostname, af, res, pai, port0)
+ const char *hostname;
+ int af;
+ struct addrinfo **res;
+ struct addrinfo *pai;
+ int port0;
+{
+ u_short port = port0 & 0xffff;
+ struct addrinfo sentinel;
+ struct hostent *hp;
+ struct addrinfo *top, *cur;
+ struct gai_afd *gai_afd;
+ int i, error = 0, h_error;
+ char *ap;
+
+ top = NULL;
+ sentinel.ai_next = NULL;
+ cur = &sentinel;
+#ifdef ENABLE_IPV6
+ if (af == AF_UNSPEC) {
+ hp = getipnodebyname(hostname, AF_INET6,
+ AI_ADDRCONFIG|AI_ALL|AI_V4MAPPED, &h_error);
+ } else
+ hp = getipnodebyname(hostname, af, AI_ADDRCONFIG, &h_error);
+#else
+ hp = gethostbyname(hostname);
+ h_error = h_errno;
+#endif
+ if (hp == NULL) {
+ switch (h_error) {
+ case HOST_NOT_FOUND:
+ case NO_DATA:
+ error = EAI_NODATA;
+ break;
+ case TRY_AGAIN:
+ error = EAI_AGAIN;
+ break;
+ case NO_RECOVERY:
+ default:
+ error = EAI_FAIL;
+ break;
+ }
+ goto free;
+ }
+
+ if ((hp->h_name == NULL) || (hp->h_name[0] == 0) ||
+ (hp->h_addr_list[0] == NULL)) {
+ error = EAI_FAIL;
+ goto free;
+ }
+
+ for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) {
+ switch (af) {
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ gai_afd = &gai_afdl[N_INET6];
+ break;
+#endif
+#ifndef ENABLE_IPV6
+ default: /* AF_UNSPEC */
+#endif
+ case AF_INET:
+ gai_afd = &gai_afdl[N_INET];
+ break;
+#ifdef ENABLE_IPV6
+ default: /* AF_UNSPEC */
+ if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ap)) {
+ ap += sizeof(struct in6_addr) -
+ sizeof(struct in_addr);
+ gai_afd = &gai_afdl[N_INET];
+ } else
+ gai_afd = &gai_afdl[N_INET6];
+ break;
+#endif
+ }
+#ifdef FAITH
+ if (translate && gai_afd->a_af == AF_INET) {
+ struct in6_addr *in6;
+
+ GET_AI(cur->ai_next, &gai_afdl[N_INET6], ap, port);
+ in6 = &((struct sockaddr_in6 *)cur->ai_next->ai_addr)->sin6_addr;
+ memcpy(&in6->s6_addr32[0], &faith_prefix,
+ sizeof(struct in6_addr) - sizeof(struct in_addr));
+ memcpy(&in6->s6_addr32[3], ap, sizeof(struct in_addr));
+ } else
+#endif /* FAITH */
+ GET_AI(cur->ai_next, gai_afd, ap, port);
+ if (cur == &sentinel) {
+ top = cur->ai_next;
+ GET_CANONNAME(top, hp->h_name);
+ }
+ cur = cur->ai_next;
+ }
+#ifdef ENABLE_IPV6
+ freehostent(hp);
+#endif
+ *res = top;
+ return SUCCESS;
+ free:
+ if (top)
+ freeaddrinfo(top);
+#ifdef ENABLE_IPV6
+ if (hp)
+ freehostent(hp);
+#endif
+/* bad: */
+ *res = NULL;
+ return error;
+}
+
+#endif // HAVE_NETDB_H
diff --git a/contrib/tools/python3/Modules/getbuildinfo.c b/contrib/tools/python3/Modules/getbuildinfo.c
new file mode 100644
index 00000000000..a24750b76c0
--- /dev/null
+++ b/contrib/tools/python3/Modules/getbuildinfo.c
@@ -0,0 +1,74 @@
+#include "Python.h"
+
+#ifndef DONT_HAVE_STDIO_H
+#include <stdio.h>
+#endif
+
+#ifndef DATE
+#ifdef __DATE__
+#define DATE __DATE__
+#else
+#define DATE "xx/xx/xx"
+#endif
+#endif
+
+#ifndef TIME
+#ifdef __TIME__
+#define TIME __TIME__
+#else
+#define TIME "xx:xx:xx"
+#endif
+#endif
+
+/* XXX Only unix build process has been tested */
+#ifndef GITVERSION
+#define GITVERSION ""
+#endif
+#ifndef GITTAG
+#define GITTAG ""
+#endif
+#ifndef GITBRANCH
+#define GITBRANCH ""
+#endif
+
+static int initialized = 0;
+static char buildinfo[50 + sizeof(GITVERSION) +
+ ((sizeof(GITTAG) > sizeof(GITBRANCH)) ?
+ sizeof(GITTAG) : sizeof(GITBRANCH))];
+
+const char *
+Py_GetBuildInfo(void)
+{
+ if (initialized) {
+ return buildinfo;
+ }
+ initialized = 1;
+ const char *revision = _Py_gitversion();
+ const char *sep = *revision ? ":" : "";
+ const char *gitid = _Py_gitidentifier();
+ if (!(*gitid)) {
+ gitid = "main";
+ }
+ PyOS_snprintf(buildinfo, sizeof(buildinfo),
+ "%s%s%s, %.20s, %.9s", gitid, sep, revision,
+ DATE, TIME);
+ return buildinfo;
+}
+
+const char *
+_Py_gitversion(void)
+{
+ return GITVERSION;
+}
+
+const char *
+_Py_gitidentifier(void)
+{
+ const char *gittag, *gitid;
+ gittag = GITTAG;
+ if ((*gittag) && strcmp(gittag, "undefined") != 0)
+ gitid = gittag;
+ else
+ gitid = GITBRANCH;
+ return gitid;
+}
diff --git a/contrib/tools/python3/Modules/getnameinfo.c b/contrib/tools/python3/Modules/getnameinfo.c
new file mode 100644
index 00000000000..335021f79ba
--- /dev/null
+++ b/contrib/tools/python3/Modules/getnameinfo.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Issues to be discussed:
+ * - Thread safe-ness must be checked
+ * - Return values. There seems to be no standard for return value (RFC2133)
+ * but INRIA implementation returns EAI_xxx defined for getaddrinfo().
+ */
+
+#if 0
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <string.h>
+#include <stddef.h>
+
+#include "addrinfo.h"
+#endif
+
+#ifdef HAVE_NETDB_H
+#define HAVE_GETNAMEINFO 1
+
+#define SUCCESS 0
+#define YES 1
+#define NO 0
+
+static struct gni_afd {
+ int a_af;
+ int a_addrlen;
+ int a_socklen;
+ int a_off;
+} gni_afdl [] = {
+#ifdef ENABLE_IPV6
+ {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6),
+ offsetof(struct sockaddr_in6, sin6_addr)},
+#endif
+ {PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in),
+ offsetof(struct sockaddr_in, sin_addr)},
+ {0, 0, 0},
+};
+
+struct gni_sockinet {
+ u_char si_len;
+ u_char si_family;
+ u_short si_port;
+};
+
+#define ENI_NOSOCKET 0
+#define ENI_NOSERVNAME 1
+#define ENI_NOHOSTNAME 2
+#define ENI_MEMORY 3
+#define ENI_SYSTEM 4
+#define ENI_FAMILY 5
+#define ENI_SALEN 6
+
+/* forward declaration to make gcc happy */
+int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
+ char *, size_t, int);
+
+int
+getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
+ const struct sockaddr *sa;
+ size_t salen;
+ char *host;
+ size_t hostlen;
+ char *serv;
+ size_t servlen;
+ int flags;
+{
+ struct gni_afd *gni_afd;
+ struct servent *sp;
+ struct hostent *hp;
+ u_short port;
+ int family, len, i;
+ char *addr, *p;
+ u_long v4a;
+#ifdef ENABLE_IPV6
+ u_char pfx;
+ int h_error;
+#endif
+ char numserv[512];
+ char numaddr[512];
+
+ if (sa == NULL)
+ return ENI_NOSOCKET;
+
+#ifdef HAVE_SOCKADDR_SA_LEN
+ len = sa->sa_len;
+ if (len != salen) return ENI_SALEN;
+#else
+ len = salen;
+#endif
+
+ family = sa->sa_family;
+ for (i = 0; gni_afdl[i].a_af; i++)
+ if (gni_afdl[i].a_af == family) {
+ gni_afd = &gni_afdl[i];
+ goto found;
+ }
+ return ENI_FAMILY;
+
+ found:
+ if (len != gni_afd->a_socklen) return ENI_SALEN;
+
+ port = ((struct gni_sockinet *)sa)->si_port; /* network byte order */
+ addr = (char *)sa + gni_afd->a_off;
+
+ if (serv == NULL || servlen == 0) {
+ /* what we should do? */
+ } else if (flags & NI_NUMERICSERV) {
+ sprintf(numserv, "%d", ntohs(port));
+ if (strlen(numserv) > servlen)
+ return ENI_MEMORY;
+ strcpy(serv, numserv);
+ } else {
+ sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
+ if (sp) {
+ if (strlen(sp->s_name) > servlen)
+ return ENI_MEMORY;
+ strcpy(serv, sp->s_name);
+ } else
+ return ENI_NOSERVNAME;
+ }
+
+ switch (sa->sa_family) {
+ case AF_INET:
+ v4a = ((struct sockaddr_in *)sa)->sin_addr.s_addr;
+ if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
+ flags |= NI_NUMERICHOST;
+ v4a >>= IN_CLASSA_NSHIFT;
+ if (v4a == 0 || v4a == IN_LOOPBACKNET)
+ flags |= NI_NUMERICHOST;
+ break;
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ pfx = ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[0];
+ if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
+ flags |= NI_NUMERICHOST;
+ break;
+#endif
+ }
+ if (host == NULL || hostlen == 0) {
+ /* what should we do? */
+ } else if (flags & NI_NUMERICHOST) {
+ if (inet_ntop(gni_afd->a_af, addr, numaddr, sizeof(numaddr))
+ == NULL)
+ return ENI_SYSTEM;
+ if (strlen(numaddr) > hostlen)
+ return ENI_MEMORY;
+ strcpy(host, numaddr);
+ } else {
+#ifdef ENABLE_IPV6
+ hp = getipnodebyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af, &h_error);
+#else
+ hp = gethostbyaddr(addr, gni_afd->a_addrlen, gni_afd->a_af);
+#endif
+
+ if (hp) {
+ if (flags & NI_NOFQDN) {
+ p = strchr(hp->h_name, '.');
+ if (p) *p = '\0';
+ }
+ if (strlen(hp->h_name) > hostlen) {
+#ifdef ENABLE_IPV6
+ freehostent(hp);
+#endif
+ return ENI_MEMORY;
+ }
+ strcpy(host, hp->h_name);
+#ifdef ENABLE_IPV6
+ freehostent(hp);
+#endif
+ } else {
+ if (flags & NI_NAMEREQD)
+ return ENI_NOHOSTNAME;
+ if (inet_ntop(gni_afd->a_af, addr, numaddr, sizeof(numaddr))
+ == NULL)
+ return ENI_NOHOSTNAME;
+ if (strlen(numaddr) > hostlen)
+ return ENI_MEMORY;
+ strcpy(host, numaddr);
+ }
+ }
+ return SUCCESS;
+}
+#endif // HAVE_NETDB_H
diff --git a/contrib/tools/python3/Modules/getpath.c b/contrib/tools/python3/Modules/getpath.c
new file mode 100644
index 00000000000..bd6920cf068
--- /dev/null
+++ b/contrib/tools/python3/Modules/getpath.c
@@ -0,0 +1,953 @@
+#define PYTHONPATH ":"
+/* Return the initial module search path. */
+
+#include "Python.h"
+#include "marshal.h" // PyMarshal_ReadObjectFromString
+#include "osdefs.h" // DELIM
+#include "pycore_initconfig.h"
+#include "pycore_fileutils.h"
+#include "pycore_pathconfig.h"
+#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator()
+#include <wchar.h>
+
+#ifdef MS_WINDOWS
+# include <windows.h> // GetFullPathNameW(), MAX_PATH
+# include <pathcch.h>
+#endif
+
+#ifdef __APPLE__
+# include <mach-o/dyld.h>
+#endif
+
+/* Reference the precompiled getpath.py */
+#include "../Python/frozen_modules/getpath.h"
+
+#if (!defined(PREFIX) || !defined(EXEC_PREFIX) \
+ || !defined(VERSION) || !defined(VPATH) \
+ || !defined(PLATLIBDIR))
+#error "PREFIX, EXEC_PREFIX, VERSION, VPATH and PLATLIBDIR macros must be defined"
+#endif
+
+#if !defined(PYTHONPATH)
+#define PYTHONPATH NULL
+#endif
+
+#if !defined(PYDEBUGEXT)
+#define PYDEBUGEXT NULL
+#endif
+
+#if !defined(PYWINVER)
+#ifdef MS_DLL_ID
+#define PYWINVER MS_DLL_ID
+#else
+#define PYWINVER NULL
+#endif
+#endif
+
+#if !defined(EXE_SUFFIX)
+#if defined(MS_WINDOWS) || defined(__CYGWIN__) || defined(__MINGW32__)
+#define EXE_SUFFIX L".exe"
+#else
+#define EXE_SUFFIX NULL
+#endif
+#endif
+
+
+/* HELPER FUNCTIONS for getpath.py */
+
+static PyObject *
+getpath_abspath(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ wchar_t *path;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+ Py_ssize_t len;
+ path = PyUnicode_AsWideCharString(pathobj, &len);
+ if (path) {
+ wchar_t *abs;
+ if (_Py_abspath((const wchar_t *)_Py_normpath(path, -1), &abs) == 0 && abs) {
+ r = PyUnicode_FromWideChar(abs, -1);
+ PyMem_RawFree((void *)abs);
+ } else {
+ PyErr_SetString(PyExc_OSError, "failed to make path absolute");
+ }
+ PyMem_Free((void *)path);
+ }
+ return r;
+}
+
+
+static PyObject *
+getpath_basename(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *path;
+ if (!PyArg_ParseTuple(args, "U", &path)) {
+ return NULL;
+ }
+ Py_ssize_t end = PyUnicode_GET_LENGTH(path);
+ Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1);
+ if (pos < 0) {
+ return Py_NewRef(path);
+ }
+ return PyUnicode_Substring(path, pos + 1, end);
+}
+
+
+static PyObject *
+getpath_dirname(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *path;
+ if (!PyArg_ParseTuple(args, "U", &path)) {
+ return NULL;
+ }
+ Py_ssize_t end = PyUnicode_GET_LENGTH(path);
+ Py_ssize_t pos = PyUnicode_FindChar(path, SEP, 0, end, -1);
+ if (pos < 0) {
+ return PyUnicode_FromStringAndSize(NULL, 0);
+ }
+ return PyUnicode_Substring(path, 0, pos);
+}
+
+
+static PyObject *
+getpath_isabs(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ const wchar_t *path;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+ path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (path) {
+ r = _Py_isabs(path) ? Py_True : Py_False;
+ PyMem_Free((void *)path);
+ }
+ return Py_XNewRef(r);
+}
+
+
+static PyObject *
+getpath_hassuffix(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ PyObject *suffixobj;
+ const wchar_t *path;
+ const wchar_t *suffix;
+ if (!PyArg_ParseTuple(args, "UU", &pathobj, &suffixobj)) {
+ return NULL;
+ }
+ Py_ssize_t len, suffixLen;
+ path = PyUnicode_AsWideCharString(pathobj, &len);
+ if (path) {
+ suffix = PyUnicode_AsWideCharString(suffixobj, &suffixLen);
+ if (suffix) {
+ if (suffixLen > len ||
+#ifdef MS_WINDOWS
+ wcsicmp(&path[len - suffixLen], suffix) != 0
+#else
+ wcscmp(&path[len - suffixLen], suffix) != 0
+#endif
+ ) {
+ r = Py_NewRef(Py_False);
+ } else {
+ r = Py_NewRef(Py_True);
+ }
+ PyMem_Free((void *)suffix);
+ }
+ PyMem_Free((void *)path);
+ }
+ return r;
+}
+
+
+static PyObject *
+getpath_isdir(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ const wchar_t *path;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+ path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (path) {
+#ifdef MS_WINDOWS
+ DWORD attr = GetFileAttributesW(path);
+ r = (attr != INVALID_FILE_ATTRIBUTES) &&
+ (attr & FILE_ATTRIBUTE_DIRECTORY) ? Py_True : Py_False;
+#else
+ struct stat st;
+ r = (_Py_wstat(path, &st) == 0) && S_ISDIR(st.st_mode) ? Py_True : Py_False;
+#endif
+ PyMem_Free((void *)path);
+ }
+ return Py_XNewRef(r);
+}
+
+
+static PyObject *
+getpath_isfile(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ const wchar_t *path;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+ path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (path) {
+#ifdef MS_WINDOWS
+ DWORD attr = GetFileAttributesW(path);
+ r = (attr != INVALID_FILE_ATTRIBUTES) &&
+ !(attr & FILE_ATTRIBUTE_DIRECTORY) ? Py_True : Py_False;
+#else
+ struct stat st;
+ r = (_Py_wstat(path, &st) == 0) && S_ISREG(st.st_mode) ? Py_True : Py_False;
+#endif
+ PyMem_Free((void *)path);
+ }
+ return Py_XNewRef(r);
+}
+
+
+static PyObject *
+getpath_isxfile(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ const wchar_t *path;
+ Py_ssize_t cchPath;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+ path = PyUnicode_AsWideCharString(pathobj, &cchPath);
+ if (path) {
+#ifdef MS_WINDOWS
+ DWORD attr = GetFileAttributesW(path);
+ r = (attr != INVALID_FILE_ATTRIBUTES) &&
+ !(attr & FILE_ATTRIBUTE_DIRECTORY) &&
+ (cchPath >= 4) &&
+ (CompareStringOrdinal(path + cchPath - 4, -1, L".exe", -1, 1 /* ignore case */) == CSTR_EQUAL)
+ ? Py_True : Py_False;
+#else
+ struct stat st;
+ r = (_Py_wstat(path, &st) == 0) &&
+ S_ISREG(st.st_mode) &&
+ (st.st_mode & 0111)
+ ? Py_True : Py_False;
+#endif
+ PyMem_Free((void *)path);
+ }
+ return Py_XNewRef(r);
+}
+
+
+static PyObject *
+getpath_joinpath(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError, "requires tuple of arguments");
+ return NULL;
+ }
+ Py_ssize_t n = PyTuple_GET_SIZE(args);
+ if (n == 0) {
+ return PyUnicode_FromStringAndSize(NULL, 0);
+ }
+ /* Convert all parts to wchar and accumulate max final length */
+ wchar_t **parts = (wchar_t **)PyMem_Malloc(n * sizeof(wchar_t *));
+ memset(parts, 0, n * sizeof(wchar_t *));
+ Py_ssize_t cchFinal = 0;
+ Py_ssize_t first = 0;
+
+ for (Py_ssize_t i = 0; i < n; ++i) {
+ PyObject *s = PyTuple_GET_ITEM(args, i);
+ Py_ssize_t cch;
+ if (s == Py_None) {
+ cch = 0;
+ } else if (PyUnicode_Check(s)) {
+ parts[i] = PyUnicode_AsWideCharString(s, &cch);
+ if (!parts[i]) {
+ cchFinal = -1;
+ break;
+ }
+ if (_Py_isabs(parts[i])) {
+ first = i;
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError, "all arguments to joinpath() must be str or None");
+ cchFinal = -1;
+ break;
+ }
+ cchFinal += cch + 1;
+ }
+
+ wchar_t *final = cchFinal > 0 ? (wchar_t *)PyMem_Malloc(cchFinal * sizeof(wchar_t)) : NULL;
+ if (!final) {
+ for (Py_ssize_t i = 0; i < n; ++i) {
+ PyMem_Free(parts[i]);
+ }
+ PyMem_Free(parts);
+ if (cchFinal) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ return PyUnicode_FromStringAndSize(NULL, 0);
+ }
+
+ final[0] = '\0';
+ /* Now join all the paths. The final result should be shorter than the buffer */
+ for (Py_ssize_t i = 0; i < n; ++i) {
+ if (!parts[i]) {
+ continue;
+ }
+ if (i >= first && final) {
+ if (!final[0]) {
+ /* final is definitely long enough to fit any individual part */
+ wcscpy(final, parts[i]);
+ } else if (_Py_add_relfile(final, parts[i], cchFinal) < 0) {
+ /* if we fail, keep iterating to free memory, but stop adding parts */
+ PyMem_Free(final);
+ final = NULL;
+ }
+ }
+ PyMem_Free(parts[i]);
+ }
+ PyMem_Free(parts);
+ if (!final) {
+ PyErr_SetString(PyExc_SystemError, "failed to join paths");
+ return NULL;
+ }
+ PyObject *r = PyUnicode_FromWideChar(_Py_normpath(final, -1), -1);
+ PyMem_Free(final);
+ return r;
+}
+
+
+static PyObject *
+getpath_readlines(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *r = NULL;
+ PyObject *pathobj;
+ const wchar_t *path;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+ path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (!path) {
+ return NULL;
+ }
+ FILE *fp = _Py_wfopen(path, L"rb");
+ if (!fp) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ PyMem_Free((void *)path);
+ return NULL;
+ }
+ PyMem_Free((void *)path);
+
+ r = PyList_New(0);
+ if (!r) {
+ fclose(fp);
+ return NULL;
+ }
+ const size_t MAX_FILE = 32 * 1024;
+ char *buffer = (char *)PyMem_Malloc(MAX_FILE);
+ if (!buffer) {
+ Py_DECREF(r);
+ fclose(fp);
+ return NULL;
+ }
+
+ size_t cb = fread(buffer, 1, MAX_FILE, fp);
+ fclose(fp);
+ if (!cb) {
+ return r;
+ }
+ if (cb >= MAX_FILE) {
+ Py_DECREF(r);
+ PyErr_SetString(PyExc_MemoryError,
+ "cannot read file larger than 32KB during initialization");
+ return NULL;
+ }
+ buffer[cb] = '\0';
+
+ size_t len;
+ wchar_t *wbuffer = _Py_DecodeUTF8_surrogateescape(buffer, cb, &len);
+ PyMem_Free((void *)buffer);
+ if (!wbuffer) {
+ Py_DECREF(r);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ wchar_t *p1 = wbuffer;
+ wchar_t *p2 = p1;
+ while ((p2 = wcschr(p1, L'\n')) != NULL) {
+ Py_ssize_t cb = p2 - p1;
+ while (cb >= 0 && (p1[cb] == L'\n' || p1[cb] == L'\r')) {
+ --cb;
+ }
+ PyObject *u = PyUnicode_FromWideChar(p1, cb >= 0 ? cb + 1 : 0);
+ if (!u || PyList_Append(r, u) < 0) {
+ Py_XDECREF(u);
+ Py_CLEAR(r);
+ break;
+ }
+ Py_DECREF(u);
+ p1 = p2 + 1;
+ }
+ if (r && p1 && *p1) {
+ PyObject *u = PyUnicode_FromWideChar(p1, -1);
+ if (!u || PyList_Append(r, u) < 0) {
+ Py_CLEAR(r);
+ }
+ Py_XDECREF(u);
+ }
+ PyMem_RawFree(wbuffer);
+ return r;
+}
+
+
+static PyObject *
+getpath_realpath(PyObject *Py_UNUSED(self) , PyObject *args)
+{
+ PyObject *pathobj;
+ if (!PyArg_ParseTuple(args, "U", &pathobj)) {
+ return NULL;
+ }
+#if defined(HAVE_READLINK)
+ /* This readlink calculation only resolves a symlinked file, and
+ does not resolve any path segments. This is consistent with
+ prior releases, however, the realpath implementation below is
+ potentially correct in more cases. */
+ PyObject *r = NULL;
+ int nlink = 0;
+ wchar_t *path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (!path) {
+ goto done;
+ }
+ wchar_t *path2 = _PyMem_RawWcsdup(path);
+ PyMem_Free((void *)path);
+ path = path2;
+ while (path) {
+ wchar_t resolved[MAXPATHLEN + 1];
+ int linklen = _Py_wreadlink(path, resolved, Py_ARRAY_LENGTH(resolved));
+ if (linklen == -1) {
+ r = PyUnicode_FromWideChar(path, -1);
+ break;
+ }
+ if (_Py_isabs(resolved)) {
+ PyMem_RawFree((void *)path);
+ path = _PyMem_RawWcsdup(resolved);
+ } else {
+ wchar_t *s = wcsrchr(path, SEP);
+ if (s) {
+ *s = L'\0';
+ }
+ path2 = _Py_join_relfile(path, resolved);
+ if (path2) {
+ path2 = _Py_normpath(path2, -1);
+ }
+ PyMem_RawFree((void *)path);
+ path = path2;
+ }
+ nlink++;
+ /* 40 is the Linux kernel 4.2 limit */
+ if (nlink >= 40) {
+ PyErr_SetString(PyExc_OSError, "maximum number of symbolic links reached");
+ break;
+ }
+ }
+ if (!path) {
+ PyErr_NoMemory();
+ }
+done:
+ PyMem_RawFree((void *)path);
+ return r;
+
+#elif defined(HAVE_REALPATH)
+ PyObject *r = NULL;
+ struct stat st;
+ const char *narrow = NULL;
+ wchar_t *path = PyUnicode_AsWideCharString(pathobj, NULL);
+ if (!path) {
+ goto done;
+ }
+ narrow = Py_EncodeLocale(path, NULL);
+ if (!narrow) {
+ PyErr_NoMemory();
+ goto done;
+ }
+ if (lstat(narrow, &st)) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto done;
+ }
+ if (!S_ISLNK(st.st_mode)) {
+ r = Py_NewRef(pathobj);
+ goto done;
+ }
+ wchar_t resolved[MAXPATHLEN+1];
+ if (_Py_wrealpath(path, resolved, MAXPATHLEN) == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ } else {
+ r = PyUnicode_FromWideChar(resolved, -1);
+ }
+done:
+ PyMem_Free((void *)path);
+ PyMem_Free((void *)narrow);
+ return r;
+#endif
+
+ return Py_NewRef(pathobj);
+}
+
+
+static PyMethodDef getpath_methods[] = {
+ {"abspath", getpath_abspath, METH_VARARGS, NULL},
+ {"basename", getpath_basename, METH_VARARGS, NULL},
+ {"dirname", getpath_dirname, METH_VARARGS, NULL},
+ {"hassuffix", getpath_hassuffix, METH_VARARGS, NULL},
+ {"isabs", getpath_isabs, METH_VARARGS, NULL},
+ {"isdir", getpath_isdir, METH_VARARGS, NULL},
+ {"isfile", getpath_isfile, METH_VARARGS, NULL},
+ {"isxfile", getpath_isxfile, METH_VARARGS, NULL},
+ {"joinpath", getpath_joinpath, METH_VARARGS, NULL},
+ {"readlines", getpath_readlines, METH_VARARGS, NULL},
+ {"realpath", getpath_realpath, METH_VARARGS, NULL},
+ {NULL, NULL, 0, NULL}
+};
+
+
+/* Two implementations of warn() to use depending on whether warnings
+ are enabled or not. */
+
+static PyObject *
+getpath_warn(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ PyObject *msgobj;
+ if (!PyArg_ParseTuple(args, "U", &msgobj)) {
+ return NULL;
+ }
+ fprintf(stderr, "%s\n", PyUnicode_AsUTF8(msgobj));
+ Py_RETURN_NONE;
+}
+
+
+static PyObject *
+getpath_nowarn(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef getpath_warn_method = {"warn", getpath_warn, METH_VARARGS, NULL};
+static PyMethodDef getpath_nowarn_method = {"warn", getpath_nowarn, METH_VARARGS, NULL};
+
+/* Add the helper functions to the dict */
+static int
+funcs_to_dict(PyObject *dict, int warnings)
+{
+ for (PyMethodDef *m = getpath_methods; m->ml_name; ++m) {
+ PyObject *f = PyCFunction_NewEx(m, NULL, NULL);
+ if (!f) {
+ return 0;
+ }
+ if (PyDict_SetItemString(dict, m->ml_name, f) < 0) {
+ Py_DECREF(f);
+ return 0;
+ }
+ Py_DECREF(f);
+ }
+ PyMethodDef *m2 = warnings ? &getpath_warn_method : &getpath_nowarn_method;
+ PyObject *f = PyCFunction_NewEx(m2, NULL, NULL);
+ if (!f) {
+ return 0;
+ }
+ if (PyDict_SetItemString(dict, m2->ml_name, f) < 0) {
+ Py_DECREF(f);
+ return 0;
+ }
+ Py_DECREF(f);
+ return 1;
+}
+
+
+/* Add a wide-character string constant to the dict */
+static int
+wchar_to_dict(PyObject *dict, const char *key, const wchar_t *s)
+{
+ PyObject *u;
+ int r;
+ if (s && s[0]) {
+ u = PyUnicode_FromWideChar(s, -1);
+ if (!u) {
+ return 0;
+ }
+ } else {
+ u = Py_NewRef(Py_None);
+ }
+ r = PyDict_SetItemString(dict, key, u) == 0;
+ Py_DECREF(u);
+ return r;
+}
+
+
+/* Add a narrow string constant to the dict, using default locale decoding */
+static int
+decode_to_dict(PyObject *dict, const char *key, const char *s)
+{
+ PyObject *u = NULL;
+ int r;
+ if (s && s[0]) {
+ size_t len;
+ const wchar_t *w = Py_DecodeLocale(s, &len);
+ if (w) {
+ u = PyUnicode_FromWideChar(w, len);
+ PyMem_RawFree((void *)w);
+ }
+ if (!u) {
+ return 0;
+ }
+ } else {
+ u = Py_NewRef(Py_None);
+ }
+ r = PyDict_SetItemString(dict, key, u) == 0;
+ Py_DECREF(u);
+ return r;
+}
+
+/* Add an environment variable to the dict, optionally clearing it afterwards */
+static int
+env_to_dict(PyObject *dict, const char *key, int and_clear)
+{
+ PyObject *u = NULL;
+ int r = 0;
+ assert(strncmp(key, "ENV_", 4) == 0);
+ assert(strlen(key) < 64);
+#ifdef MS_WINDOWS
+ wchar_t wkey[64];
+ // Quick convert to wchar_t, since we know key is ASCII
+ wchar_t *wp = wkey;
+ for (const char *p = &key[4]; *p; ++p) {
+ assert(*p < 128);
+ *wp++ = *p;
+ }
+ *wp = L'\0';
+ const wchar_t *v = _wgetenv(wkey);
+ if (v) {
+ u = PyUnicode_FromWideChar(v, -1);
+ if (!u) {
+ PyErr_Clear();
+ }
+ }
+#else
+ const char *v = getenv(&key[4]);
+ if (v) {
+ size_t len;
+ const wchar_t *w = Py_DecodeLocale(v, &len);
+ if (w) {
+ u = PyUnicode_FromWideChar(w, len);
+ if (!u) {
+ PyErr_Clear();
+ }
+ PyMem_RawFree((void *)w);
+ }
+ }
+#endif
+ if (u) {
+ r = PyDict_SetItemString(dict, key, u) == 0;
+ Py_DECREF(u);
+ } else {
+ r = PyDict_SetItemString(dict, key, Py_None) == 0;
+ }
+ if (r && and_clear) {
+#ifdef MS_WINDOWS
+ _wputenv_s(wkey, L"");
+#else
+ unsetenv(&key[4]);
+#endif
+ }
+ return r;
+}
+
+
+/* Add an integer constant to the dict */
+static int
+int_to_dict(PyObject *dict, const char *key, int v)
+{
+ PyObject *o;
+ int r;
+ o = PyLong_FromLong(v);
+ if (!o) {
+ return 0;
+ }
+ r = PyDict_SetItemString(dict, key, o) == 0;
+ Py_DECREF(o);
+ return r;
+}
+
+
+#ifdef MS_WINDOWS
+static int
+winmodule_to_dict(PyObject *dict, const char *key, HMODULE mod)
+{
+ wchar_t *buffer = NULL;
+ for (DWORD cch = 256; buffer == NULL && cch < (1024 * 1024); cch *= 2) {
+ buffer = (wchar_t*)PyMem_RawMalloc(cch * sizeof(wchar_t));
+ if (buffer) {
+ if (GetModuleFileNameW(mod, buffer, cch) == cch) {
+ PyMem_RawFree(buffer);
+ buffer = NULL;
+ }
+ }
+ }
+ int r = wchar_to_dict(dict, key, buffer);
+ PyMem_RawFree(buffer);
+ return r;
+}
+#endif
+
+
+/* Add the current executable's path to the dict */
+static int
+progname_to_dict(PyObject *dict, const char *key)
+{
+#ifdef MS_WINDOWS
+ return winmodule_to_dict(dict, key, NULL);
+#elif defined(__APPLE__)
+ char *path;
+ uint32_t pathLen = 256;
+ while (pathLen) {
+ path = PyMem_RawMalloc((pathLen + 1) * sizeof(char));
+ if (!path) {
+ return 0;
+ }
+ if (_NSGetExecutablePath(path, &pathLen) != 0) {
+ PyMem_RawFree(path);
+ continue;
+ }
+ // Only keep if the path is absolute
+ if (path[0] == SEP) {
+ int r = decode_to_dict(dict, key, path);
+ PyMem_RawFree(path);
+ return r;
+ }
+ // Fall back and store None
+ PyMem_RawFree(path);
+ break;
+ }
+#endif
+ return PyDict_SetItemString(dict, key, Py_None) == 0;
+}
+
+
+/* Add the runtime library's path to the dict */
+static int
+library_to_dict(PyObject *dict, const char *key)
+{
+#ifdef MS_WINDOWS
+#ifdef Py_ENABLE_SHARED
+ extern HMODULE PyWin_DLLhModule;
+ if (PyWin_DLLhModule) {
+ return winmodule_to_dict(dict, key, PyWin_DLLhModule);
+ }
+#endif
+#elif defined(WITH_NEXT_FRAMEWORK)
+ static char modPath[MAXPATHLEN + 1];
+ static int modPathInitialized = -1;
+ if (modPathInitialized < 0) {
+ modPathInitialized = 0;
+
+ /* On Mac OS X we have a special case if we're running from a framework.
+ This is because the python home should be set relative to the library,
+ which is in the framework, not relative to the executable, which may
+ be outside of the framework. Except when we're in the build
+ directory... */
+ NSSymbol symbol = NSLookupAndBindSymbol("_Py_Initialize");
+ if (symbol != NULL) {
+ NSModule pythonModule = NSModuleForSymbol(symbol);
+ if (pythonModule != NULL) {
+ /* Use dylib functions to find out where the framework was loaded from */
+ const char *path = NSLibraryNameForModule(pythonModule);
+ if (path) {
+ strncpy(modPath, path, MAXPATHLEN);
+ modPathInitialized = 1;
+ }
+ }
+ }
+ }
+ if (modPathInitialized > 0) {
+ return decode_to_dict(dict, key, modPath);
+ }
+#endif
+ return PyDict_SetItemString(dict, key, Py_None) == 0;
+}
+
+
+PyObject *
+_Py_Get_Getpath_CodeObject(void)
+{
+ return PyMarshal_ReadObjectFromString(
+ (const char*)_Py_M__getpath, sizeof(_Py_M__getpath));
+}
+
+
+/* Perform the actual path calculation.
+
+ When compute_path_config is 0, this only reads any initialised path
+ config values into the PyConfig struct. For example, Py_SetHome() or
+ Py_SetPath(). The only error should be due to failed memory allocation.
+
+ When compute_path_config is 1, full path calculation is performed.
+ The GIL must be held, and there may be filesystem access, side
+ effects, and potential unraisable errors that are reported directly
+ to stderr.
+
+ Calling this function multiple times on the same PyConfig is only
+ safe because already-configured values are not recalculated. To
+ actually recalculate paths, you need a clean PyConfig.
+*/
+PyStatus
+_PyConfig_InitPathConfig(PyConfig *config, int compute_path_config)
+{
+ PyStatus status = _PyPathConfig_ReadGlobal(config);
+
+ if (_PyStatus_EXCEPTION(status) || !compute_path_config) {
+ return status;
+ }
+
+ if (!_PyThreadState_UncheckedGet()) {
+ return PyStatus_Error("cannot calculate path configuration without GIL");
+ }
+
+ PyObject *configDict = _PyConfig_AsDict(config);
+ if (!configDict) {
+ PyErr_Clear();
+ return PyStatus_NoMemory();
+ }
+
+ PyObject *dict = PyDict_New();
+ if (!dict) {
+ PyErr_Clear();
+ Py_DECREF(configDict);
+ return PyStatus_NoMemory();
+ }
+
+ if (PyDict_SetItemString(dict, "config", configDict) < 0) {
+ PyErr_Clear();
+ Py_DECREF(configDict);
+ Py_DECREF(dict);
+ return PyStatus_NoMemory();
+ }
+ /* reference now held by dict */
+ Py_DECREF(configDict);
+
+ PyObject *co = _Py_Get_Getpath_CodeObject();
+ if (!co || !PyCode_Check(co)) {
+ PyErr_Clear();
+ Py_XDECREF(co);
+ Py_DECREF(dict);
+ return PyStatus_Error("error reading frozen getpath.py");
+ }
+
+#ifdef MS_WINDOWS
+ PyObject *winreg = PyImport_ImportModule("winreg");
+ if (!winreg || PyDict_SetItemString(dict, "winreg", winreg) < 0) {
+ PyErr_Clear();
+ Py_XDECREF(winreg);
+ if (PyDict_SetItemString(dict, "winreg", Py_None) < 0) {
+ PyErr_Clear();
+ Py_DECREF(co);
+ Py_DECREF(dict);
+ return PyStatus_Error("error importing winreg module");
+ }
+ } else {
+ Py_DECREF(winreg);
+ }
+#endif
+
+ if (
+#ifdef MS_WINDOWS
+ !decode_to_dict(dict, "os_name", "nt") ||
+#elif defined(__APPLE__)
+ !decode_to_dict(dict, "os_name", "darwin") ||
+#else
+ !decode_to_dict(dict, "os_name", "posix") ||
+#endif
+#ifdef WITH_NEXT_FRAMEWORK
+ !int_to_dict(dict, "WITH_NEXT_FRAMEWORK", 1) ||
+#else
+ !int_to_dict(dict, "WITH_NEXT_FRAMEWORK", 0) ||
+#endif
+ !decode_to_dict(dict, "PREFIX", PREFIX) ||
+ !decode_to_dict(dict, "EXEC_PREFIX", EXEC_PREFIX) ||
+ !decode_to_dict(dict, "PYTHONPATH", PYTHONPATH) ||
+ !decode_to_dict(dict, "VPATH", VPATH) ||
+ !decode_to_dict(dict, "PLATLIBDIR", PLATLIBDIR) ||
+ !decode_to_dict(dict, "PYDEBUGEXT", PYDEBUGEXT) ||
+ !int_to_dict(dict, "VERSION_MAJOR", PY_MAJOR_VERSION) ||
+ !int_to_dict(dict, "VERSION_MINOR", PY_MINOR_VERSION) ||
+ !decode_to_dict(dict, "PYWINVER", PYWINVER) ||
+ !wchar_to_dict(dict, "EXE_SUFFIX", EXE_SUFFIX) ||
+ !env_to_dict(dict, "ENV_PATH", 0) ||
+ !env_to_dict(dict, "ENV_PYTHONHOME", 0) ||
+ !env_to_dict(dict, "ENV_PYTHONEXECUTABLE", 0) ||
+ !env_to_dict(dict, "ENV___PYVENV_LAUNCHER__", 1) ||
+ !progname_to_dict(dict, "real_executable") ||
+ !library_to_dict(dict, "library") ||
+ !wchar_to_dict(dict, "executable_dir", NULL) ||
+ !wchar_to_dict(dict, "py_setpath", _PyPathConfig_GetGlobalModuleSearchPath()) ||
+ !funcs_to_dict(dict, config->pathconfig_warnings) ||
+#ifndef MS_WINDOWS
+ PyDict_SetItemString(dict, "winreg", Py_None) < 0 ||
+#endif
+ PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins()) < 0
+ ) {
+ Py_DECREF(co);
+ Py_DECREF(dict);
+ _PyErr_WriteUnraisableMsg("error evaluating initial values", NULL);
+ return PyStatus_Error("error evaluating initial values");
+ }
+
+ PyObject *r = PyEval_EvalCode(co, dict, dict);
+ Py_DECREF(co);
+
+ if (!r) {
+ Py_DECREF(dict);
+ _PyErr_WriteUnraisableMsg("error evaluating path", NULL);
+ return PyStatus_Error("error evaluating path");
+ }
+ Py_DECREF(r);
+
+#if 0
+ PyObject *it = PyObject_GetIter(configDict);
+ for (PyObject *k = PyIter_Next(it); k; k = PyIter_Next(it)) {
+ if (!strcmp("__builtins__", PyUnicode_AsUTF8(k))) {
+ Py_DECREF(k);
+ continue;
+ }
+ fprintf(stderr, "%s = ", PyUnicode_AsUTF8(k));
+ PyObject *o = PyDict_GetItem(configDict, k);
+ o = PyObject_Repr(o);
+ fprintf(stderr, "%s\n", PyUnicode_AsUTF8(o));
+ Py_DECREF(o);
+ Py_DECREF(k);
+ }
+ Py_DECREF(it);
+#endif
+
+ if (_PyConfig_FromDict(config, configDict) < 0) {
+ _PyErr_WriteUnraisableMsg("reading getpath results", NULL);
+ Py_DECREF(dict);
+ return PyStatus_Error("error getting getpath results");
+ }
+
+ Py_DECREF(dict);
+
+ return _PyStatus_OK();
+}
+
diff --git a/contrib/tools/python3/Modules/grpmodule.c b/contrib/tools/python3/Modules/grpmodule.c
new file mode 100644
index 00000000000..f5709296334
--- /dev/null
+++ b/contrib/tools/python3/Modules/grpmodule.c
@@ -0,0 +1,370 @@
+
+/* UNIX group file access module */
+
+#include "Python.h"
+#include "posixmodule.h"
+
+#include <grp.h>
+
+#include "clinic/grpmodule.c.h"
+/*[clinic input]
+module grp
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=cade63f2ed1bd9f8]*/
+
+static PyStructSequence_Field struct_group_type_fields[] = {
+ {"gr_name", "group name"},
+ {"gr_passwd", "password"},
+ {"gr_gid", "group id"},
+ {"gr_mem", "group members"},
+ {0}
+};
+
+PyDoc_STRVAR(struct_group__doc__,
+"grp.struct_group: Results from getgr*() routines.\n\n\
+This object may be accessed either as a tuple of\n\
+ (gr_name,gr_passwd,gr_gid,gr_mem)\n\
+or via the object attributes as named in the above tuple.\n");
+
+static PyStructSequence_Desc struct_group_type_desc = {
+ "grp.struct_group",
+ struct_group__doc__,
+ struct_group_type_fields,
+ 4,
+};
+
+
+typedef struct {
+ PyTypeObject *StructGrpType;
+} grpmodulestate;
+
+static inline grpmodulestate*
+get_grp_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (grpmodulestate *)state;
+}
+
+static struct PyModuleDef grpmodule;
+
+#define DEFAULT_BUFFER_SIZE 1024
+
+static PyObject *
+mkgrent(PyObject *module, struct group *p)
+{
+ int setIndex = 0;
+ PyObject *v, *w;
+ char **member;
+
+ v = PyStructSequence_New(get_grp_state(module)->StructGrpType);
+ if (v == NULL)
+ return NULL;
+
+ if ((w = PyList_New(0)) == NULL) {
+ Py_DECREF(v);
+ return NULL;
+ }
+ for (member = p->gr_mem; ; member++) {
+ char *group_member;
+ // member can be misaligned
+ memcpy(&group_member, member, sizeof(group_member));
+ if (group_member == NULL) {
+ break;
+ }
+ PyObject *x = PyUnicode_DecodeFSDefault(group_member);
+ if (x == NULL || PyList_Append(w, x) != 0) {
+ Py_XDECREF(x);
+ Py_DECREF(w);
+ Py_DECREF(v);
+ return NULL;
+ }
+ Py_DECREF(x);
+ }
+
+#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
+ SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name));
+ if (p->gr_passwd)
+ SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));
+ else {
+ SET(setIndex++, Py_None);
+ Py_INCREF(Py_None);
+ }
+ SET(setIndex++, _PyLong_FromGid(p->gr_gid));
+ SET(setIndex++, w);
+#undef SET
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ return NULL;
+ }
+
+ return v;
+}
+
+/*[clinic input]
+grp.getgrgid
+
+ id: object
+
+Return the group database entry for the given numeric group ID.
+
+If id is not valid, raise KeyError.
+[clinic start generated code]*/
+
+static PyObject *
+grp_getgrgid_impl(PyObject *module, PyObject *id)
+/*[clinic end generated code: output=30797c289504a1ba input=15fa0e2ccf5cda25]*/
+{
+ PyObject *retval = NULL;
+ int nomem = 0;
+ char *buf = NULL, *buf2 = NULL;
+ gid_t gid;
+ struct group *p;
+
+ if (!_Py_Gid_Converter(id, &gid)) {
+ return NULL;
+ }
+#ifdef HAVE_GETGRGID_R
+ int status;
+ Py_ssize_t bufsize;
+ /* Note: 'grp' will be used via pointer 'p' on getgrgid_r success. */
+ struct group grp;
+
+ Py_BEGIN_ALLOW_THREADS
+ bufsize = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (bufsize == -1) {
+ bufsize = DEFAULT_BUFFER_SIZE;
+ }
+
+ while (1) {
+ buf2 = PyMem_RawRealloc(buf, bufsize);
+ if (buf2 == NULL) {
+ p = NULL;
+ nomem = 1;
+ break;
+ }
+ buf = buf2;
+ status = getgrgid_r(gid, &grp, buf, bufsize, &p);
+ if (status != 0) {
+ p = NULL;
+ }
+ if (p != NULL || status != ERANGE) {
+ break;
+ }
+ if (bufsize > (PY_SSIZE_T_MAX >> 1)) {
+ nomem = 1;
+ break;
+ }
+ bufsize <<= 1;
+ }
+
+ Py_END_ALLOW_THREADS
+#else
+ p = getgrgid(gid);
+#endif
+ if (p == NULL) {
+ PyMem_RawFree(buf);
+ if (nomem == 1) {
+ return PyErr_NoMemory();
+ }
+ PyObject *gid_obj = _PyLong_FromGid(gid);
+ if (gid_obj == NULL)
+ return NULL;
+ PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %S", gid_obj);
+ Py_DECREF(gid_obj);
+ return NULL;
+ }
+ retval = mkgrent(module, p);
+#ifdef HAVE_GETGRGID_R
+ PyMem_RawFree(buf);
+#endif
+ return retval;
+}
+
+/*[clinic input]
+grp.getgrnam
+
+ name: unicode
+
+Return the group database entry for the given group name.
+
+If name is not valid, raise KeyError.
+[clinic start generated code]*/
+
+static PyObject *
+grp_getgrnam_impl(PyObject *module, PyObject *name)
+/*[clinic end generated code: output=67905086f403c21c input=08ded29affa3c863]*/
+{
+ char *buf = NULL, *buf2 = NULL, *name_chars;
+ int nomem = 0;
+ struct group *p;
+ PyObject *bytes, *retval = NULL;
+
+ if ((bytes = PyUnicode_EncodeFSDefault(name)) == NULL)
+ return NULL;
+ /* check for embedded null bytes */
+ if (PyBytes_AsStringAndSize(bytes, &name_chars, NULL) == -1)
+ goto out;
+#ifdef HAVE_GETGRNAM_R
+ int status;
+ Py_ssize_t bufsize;
+ /* Note: 'grp' will be used via pointer 'p' on getgrnam_r success. */
+ struct group grp;
+
+ Py_BEGIN_ALLOW_THREADS
+ bufsize = sysconf(_SC_GETGR_R_SIZE_MAX);
+ if (bufsize == -1) {
+ bufsize = DEFAULT_BUFFER_SIZE;
+ }
+
+ while(1) {
+ buf2 = PyMem_RawRealloc(buf, bufsize);
+ if (buf2 == NULL) {
+ p = NULL;
+ nomem = 1;
+ break;
+ }
+ buf = buf2;
+ status = getgrnam_r(name_chars, &grp, buf, bufsize, &p);
+ if (status != 0) {
+ p = NULL;
+ }
+ if (p != NULL || status != ERANGE) {
+ break;
+ }
+ if (bufsize > (PY_SSIZE_T_MAX >> 1)) {
+ nomem = 1;
+ break;
+ }
+ bufsize <<= 1;
+ }
+
+ Py_END_ALLOW_THREADS
+#else
+ p = getgrnam(name_chars);
+#endif
+ if (p == NULL) {
+ if (nomem == 1) {
+ PyErr_NoMemory();
+ }
+ else {
+ PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %R", name);
+ }
+ goto out;
+ }
+ retval = mkgrent(module, p);
+out:
+ PyMem_RawFree(buf);
+ Py_DECREF(bytes);
+ return retval;
+}
+
+/*[clinic input]
+grp.getgrall
+
+Return a list of all available group entries, in arbitrary order.
+
+An entry whose name starts with '+' or '-' represents an instruction
+to use YP/NIS and may not be accessible via getgrnam or getgrgid.
+[clinic start generated code]*/
+
+static PyObject *
+grp_getgrall_impl(PyObject *module)
+/*[clinic end generated code: output=585dad35e2e763d7 input=d7df76c825c367df]*/
+{
+ PyObject *d;
+ struct group *p;
+
+ if ((d = PyList_New(0)) == NULL)
+ return NULL;
+ setgrent();
+ while ((p = getgrent()) != NULL) {
+ PyObject *v = mkgrent(module, p);
+ if (v == NULL || PyList_Append(d, v) != 0) {
+ Py_XDECREF(v);
+ Py_DECREF(d);
+ endgrent();
+ return NULL;
+ }
+ Py_DECREF(v);
+ }
+ endgrent();
+ return d;
+}
+
+static PyMethodDef grp_methods[] = {
+ GRP_GETGRGID_METHODDEF
+ GRP_GETGRNAM_METHODDEF
+ GRP_GETGRALL_METHODDEF
+ {NULL, NULL}
+};
+
+PyDoc_STRVAR(grp__doc__,
+"Access to the Unix group database.\n\
+\n\
+Group entries are reported as 4-tuples containing the following fields\n\
+from the group database, in order:\n\
+\n\
+ gr_name - name of the group\n\
+ gr_passwd - group password (encrypted); often empty\n\
+ gr_gid - numeric ID of the group\n\
+ gr_mem - list of members\n\
+\n\
+The gid is an integer, name and password are strings. (Note that most\n\
+users are not explicitly listed as members of the groups they are in\n\
+according to the password database. Check both databases to get\n\
+complete membership information.)");
+
+static int
+grpmodule_exec(PyObject *module)
+{
+ grpmodulestate *state = get_grp_state(module);
+
+ state->StructGrpType = PyStructSequence_NewType(&struct_group_type_desc);
+ if (state->StructGrpType == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->StructGrpType) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot grpmodule_slots[] = {
+ {Py_mod_exec, grpmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int grpmodule_traverse(PyObject *m, visitproc visit, void *arg) {
+ Py_VISIT(get_grp_state(m)->StructGrpType);
+ return 0;
+}
+
+static int grpmodule_clear(PyObject *m) {
+ Py_CLEAR(get_grp_state(m)->StructGrpType);
+ return 0;
+}
+
+static void grpmodule_free(void *m) {
+ grpmodule_clear((PyObject *)m);
+}
+
+static struct PyModuleDef grpmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "grp",
+ .m_doc = grp__doc__,
+ .m_size = sizeof(grpmodulestate),
+ .m_methods = grp_methods,
+ .m_slots = grpmodule_slots,
+ .m_traverse = grpmodule_traverse,
+ .m_clear = grpmodule_clear,
+ .m_free = grpmodule_free,
+};
+
+PyMODINIT_FUNC
+PyInit_grp(void)
+{
+ return PyModuleDef_Init(&grpmodule);
+}
diff --git a/contrib/tools/python3/Modules/hashlib.h b/contrib/tools/python3/Modules/hashlib.h
new file mode 100644
index 00000000000..a8bad9dd87a
--- /dev/null
+++ b/contrib/tools/python3/Modules/hashlib.h
@@ -0,0 +1,66 @@
+/* Common code for use by all hashlib related modules. */
+
+/*
+ * Given a PyObject* obj, fill in the Py_buffer* viewp with the result
+ * of PyObject_GetBuffer. Sets an exception and issues the erraction
+ * on any errors, e.g. 'return NULL' or 'goto error'.
+ */
+#define GET_BUFFER_VIEW_OR_ERROR(obj, viewp, erraction) do { \
+ if (PyUnicode_Check((obj))) { \
+ PyErr_SetString(PyExc_TypeError, \
+ "Strings must be encoded before hashing");\
+ erraction; \
+ } \
+ if (!PyObject_CheckBuffer((obj))) { \
+ PyErr_SetString(PyExc_TypeError, \
+ "object supporting the buffer API required"); \
+ erraction; \
+ } \
+ if (PyObject_GetBuffer((obj), (viewp), PyBUF_SIMPLE) == -1) { \
+ erraction; \
+ } \
+ if ((viewp)->ndim > 1) { \
+ PyErr_SetString(PyExc_BufferError, \
+ "Buffer must be single dimension"); \
+ PyBuffer_Release((viewp)); \
+ erraction; \
+ } \
+ } while(0)
+
+#define GET_BUFFER_VIEW_OR_ERROUT(obj, viewp) \
+ GET_BUFFER_VIEW_OR_ERROR(obj, viewp, return NULL)
+
+/*
+ * Helper code to synchronize access to the hash object when the GIL is
+ * released around a CPU consuming hashlib operation. All code paths that
+ * access a mutable part of obj must be enclosed in an ENTER_HASHLIB /
+ * LEAVE_HASHLIB block or explicitly acquire and release the lock inside
+ * a PY_BEGIN / END_ALLOW_THREADS block if they wish to release the GIL for
+ * an operation.
+ *
+ * These only drop the GIL if the lock acquisition itself is likely to
+ * block. Thus the non-blocking acquire gating the GIL release for a
+ * blocking lock acquisition. The intent of these macros is to surround
+ * the assumed always "fast" operations that you aren't releasing the
+ * GIL around. Otherwise use code similar to what you see in hash
+ * function update() methods.
+ */
+
+#include "pythread.h"
+#define ENTER_HASHLIB(obj) \
+ if ((obj)->lock) { \
+ if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+ Py_BEGIN_ALLOW_THREADS \
+ PyThread_acquire_lock((obj)->lock, 1); \
+ Py_END_ALLOW_THREADS \
+ } \
+ }
+#define LEAVE_HASHLIB(obj) \
+ if ((obj)->lock) { \
+ PyThread_release_lock((obj)->lock); \
+ }
+
+/* TODO(gpshead): We should make this a module or class attribute
+ * to allow the user to optimize based on the platform they're using. */
+#define HASHLIB_GIL_MINSIZE 2048
+
diff --git a/contrib/tools/python3/Modules/itertoolsmodule.c b/contrib/tools/python3/Modules/itertoolsmodule.c
new file mode 100644
index 00000000000..24e77c485db
--- /dev/null
+++ b/contrib/tools/python3/Modules/itertoolsmodule.c
@@ -0,0 +1,4773 @@
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+#include "pycore_object.h" // _PyObject_GC_TRACK()
+#include "pycore_tuple.h" // _PyTuple_ITEMS()
+#include "structmember.h" // PyMemberDef
+#include <stddef.h> // offsetof()
+
+/* Itertools module written and maintained
+ by Raymond D. Hettinger <[email protected]>
+*/
+
+typedef struct {
+ PyTypeObject *accumulate_type;
+ PyTypeObject *batched_type;
+ PyTypeObject *chain_type;
+ PyTypeObject *combinations_type;
+ PyTypeObject *compress_type;
+ PyTypeObject *count_type;
+ PyTypeObject *cwr_type;
+ PyTypeObject *cycle_type;
+ PyTypeObject *dropwhile_type;
+ PyTypeObject *filterfalse_type;
+ PyTypeObject *groupby_type;
+ PyTypeObject *_grouper_type;
+ PyTypeObject *islice_type;
+ PyTypeObject *pairwise_type;
+ PyTypeObject *permutations_type;
+ PyTypeObject *product_type;
+ PyTypeObject *repeat_type;
+ PyTypeObject *starmap_type;
+ PyTypeObject *takewhile_type;
+ PyTypeObject *tee_type;
+ PyTypeObject *teedataobject_type;
+ PyTypeObject *ziplongest_type;
+} itertools_state;
+
+static inline itertools_state *
+get_module_state(PyObject *mod)
+{
+ void *state = _PyModule_GetState(mod);
+ assert(state != NULL);
+ return (itertools_state *)state;
+}
+
+static inline itertools_state *
+get_module_state_by_cls(PyTypeObject *cls)
+{
+ void *state = _PyType_GetModuleState(cls);
+ assert(state != NULL);
+ return (itertools_state *)state;
+}
+
+static struct PyModuleDef itertoolsmodule;
+
+static inline itertools_state *
+find_state_by_type(PyTypeObject *tp)
+{
+ PyObject *mod = PyType_GetModuleByDef(tp, &itertoolsmodule);
+ assert(mod != NULL);
+ return get_module_state(mod);
+}
+
+/*[clinic input]
+module itertools
+class itertools.groupby "groupbyobject *" "clinic_state()->groupby_type"
+class itertools._grouper "_grouperobject *" "clinic_state()->_grouper_type"
+class itertools.teedataobject "teedataobject *" "clinic_state()->teedataobject_type"
+class itertools._tee "teeobject *" "clinic_state()->tee_type"
+class itertools.batched "batchedobject *" "clinic_state()->batched_type"
+class itertools.cycle "cycleobject *" "clinic_state()->cycle_type"
+class itertools.dropwhile "dropwhileobject *" "clinic_state()->dropwhile_type"
+class itertools.takewhile "takewhileobject *" "clinic_state()->takewhile_type"
+class itertools.starmap "starmapobject *" "clinic_state()->starmap_type"
+class itertools.chain "chainobject *" "clinic_state()->chain_type"
+class itertools.combinations "combinationsobject *" "clinic_state()->combinations_type"
+class itertools.combinations_with_replacement "cwr_object *" "clinic_state()->cwr_type"
+class itertools.permutations "permutationsobject *" "clinic_state()->permutations_type"
+class itertools.accumulate "accumulateobject *" "clinic_state()->accumulate_type"
+class itertools.compress "compressobject *" "clinic_state()->compress_type"
+class itertools.filterfalse "filterfalseobject *" "clinic_state()->filterfalse_type"
+class itertools.count "countobject *" "clinic_state()->count_type"
+class itertools.pairwise "pairwiseobject *" "clinic_state()->pairwise_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=aa48fe4de9d4080f]*/
+
+#define clinic_state() (find_state_by_type(type))
+#define clinic_state_by_cls() (get_module_state_by_cls(base_tp))
+#include "clinic/itertoolsmodule.c.h"
+#undef clinic_state_by_cls
+#undef clinic_state
+
+/* Deprecation of pickle support: GH-101588 *********************************/
+
+#define ITERTOOL_PICKLE_DEPRECATION \
+ if (PyErr_WarnEx( \
+ PyExc_DeprecationWarning, \
+ "Pickle, copy, and deepcopy support will be " \
+ "removed from itertools in Python 3.14.", 1) < 0) { \
+ return NULL; \
+ }
+
+/* batched object ************************************************************/
+
+/* Note: The built-in zip() function includes a "strict" argument
+ that was needed because that function would silently truncate data,
+ and there was no easy way for a user to detect the data loss.
+ The same reasoning does not apply to batched() which never drops data.
+ Instead, batched() produces a shorter tuple which can be handled
+ as the user sees fit. If requested, it would be reasonable to add
+ "fillvalue" support which had demonstrated value in zip_longest().
+ For now, the API is kept simple and clean.
+ */
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *it;
+ Py_ssize_t batch_size;
+} batchedobject;
+
+/*[clinic input]
+@classmethod
+itertools.batched.__new__ as batched_new
+ iterable: object
+ n: Py_ssize_t
+Batch data into tuples of length n. The last batch may be shorter than n.
+
+Loops over the input iterable and accumulates data into tuples
+up to size n. The input is consumed lazily, just enough to
+fill a batch. The result is yielded as soon as a batch is full
+or when the input iterable is exhausted.
+
+ >>> for batch in batched('ABCDEFG', 3):
+ ... print(batch)
+ ...
+ ('A', 'B', 'C')
+ ('D', 'E', 'F')
+ ('G',)
+
+[clinic start generated code]*/
+
+static PyObject *
+batched_new_impl(PyTypeObject *type, PyObject *iterable, Py_ssize_t n)
+/*[clinic end generated code: output=7ebc954d655371b6 input=ffd70726927c5129]*/
+{
+ PyObject *it;
+ batchedobject *bo;
+
+ if (n < 1) {
+ /* We could define the n==0 case to return an empty iterator
+ but that is at odds with the idea that batching should
+ never throw-away input data.
+ */
+ PyErr_SetString(PyExc_ValueError, "n must be at least one");
+ return NULL;
+ }
+ it = PyObject_GetIter(iterable);
+ if (it == NULL) {
+ return NULL;
+ }
+
+ /* create batchedobject structure */
+ bo = (batchedobject *)type->tp_alloc(type, 0);
+ if (bo == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ bo->batch_size = n;
+ bo->it = it;
+ return (PyObject *)bo;
+}
+
+static void
+batched_dealloc(batchedobject *bo)
+{
+ PyTypeObject *tp = Py_TYPE(bo);
+ PyObject_GC_UnTrack(bo);
+ Py_XDECREF(bo->it);
+ tp->tp_free(bo);
+ Py_DECREF(tp);
+}
+
+static int
+batched_traverse(batchedobject *bo, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(bo));
+ Py_VISIT(bo->it);
+ return 0;
+}
+
+static PyObject *
+batched_next(batchedobject *bo)
+{
+ Py_ssize_t i;
+ Py_ssize_t n = bo->batch_size;
+ PyObject *it = bo->it;
+ PyObject *item;
+ PyObject *result;
+
+ if (it == NULL) {
+ return NULL;
+ }
+ result = PyTuple_New(n);
+ if (result == NULL) {
+ return NULL;
+ }
+ iternextfunc iternext = *Py_TYPE(it)->tp_iternext;
+ PyObject **items = _PyTuple_ITEMS(result);
+ for (i=0 ; i < n ; i++) {
+ item = iternext(it);
+ if (item == NULL) {
+ goto null_item;
+ }
+ items[i] = item;
+ }
+ return result;
+
+ null_item:
+ if (PyErr_Occurred()) {
+ if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
+ /* Input raised an exception other than StopIteration */
+ Py_CLEAR(bo->it);
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyErr_Clear();
+ }
+ if (i == 0) {
+ Py_CLEAR(bo->it);
+ Py_DECREF(result);
+ return NULL;
+ }
+ _PyTuple_Resize(&result, i);
+ return result;
+}
+
+static PyType_Slot batched_slots[] = {
+ {Py_tp_dealloc, batched_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)batched_new__doc__},
+ {Py_tp_traverse, batched_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, batched_next},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, batched_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec batched_spec = {
+ .name = "itertools.batched",
+ .basicsize = sizeof(batchedobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = batched_slots,
+};
+
+
+/* pairwise object ***********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *it;
+ PyObject *old;
+} pairwiseobject;
+
+/*[clinic input]
+@classmethod
+itertools.pairwise.__new__ as pairwise_new
+ iterable: object
+ /
+Return an iterator of overlapping pairs taken from the input iterator.
+
+ s -> (s0,s1), (s1,s2), (s2, s3), ...
+
+[clinic start generated code]*/
+
+static PyObject *
+pairwise_new_impl(PyTypeObject *type, PyObject *iterable)
+/*[clinic end generated code: output=9f0267062d384456 input=6e7c3cddb431a8d6]*/
+{
+ PyObject *it;
+ pairwiseobject *po;
+
+ it = PyObject_GetIter(iterable);
+ if (it == NULL) {
+ return NULL;
+ }
+ po = (pairwiseobject *)type->tp_alloc(type, 0);
+ if (po == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ po->it = it;
+ po->old = NULL;
+ return (PyObject *)po;
+}
+
+static void
+pairwise_dealloc(pairwiseobject *po)
+{
+ PyTypeObject *tp = Py_TYPE(po);
+ PyObject_GC_UnTrack(po);
+ Py_XDECREF(po->it);
+ Py_XDECREF(po->old);
+ tp->tp_free(po);
+ Py_DECREF(tp);
+}
+
+static int
+pairwise_traverse(pairwiseobject *po, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(po));
+ Py_VISIT(po->it);
+ Py_VISIT(po->old);
+ return 0;
+}
+
+static PyObject *
+pairwise_next(pairwiseobject *po)
+{
+ PyObject *it = po->it;
+ PyObject *old = po->old;
+ PyObject *new, *result;
+
+ if (it == NULL) {
+ return NULL;
+ }
+ if (old == NULL) {
+ old = (*Py_TYPE(it)->tp_iternext)(it);
+ Py_XSETREF(po->old, old);
+ if (old == NULL) {
+ Py_CLEAR(po->it);
+ return NULL;
+ }
+ it = po->it;
+ if (it == NULL) {
+ Py_CLEAR(po->old);
+ return NULL;
+ }
+ }
+ Py_INCREF(old);
+ new = (*Py_TYPE(it)->tp_iternext)(it);
+ if (new == NULL) {
+ Py_CLEAR(po->it);
+ Py_CLEAR(po->old);
+ Py_DECREF(old);
+ return NULL;
+ }
+ /* Future optimization: Reuse the result tuple as we do in enumerate() */
+ result = PyTuple_Pack(2, old, new);
+ Py_XSETREF(po->old, new);
+ Py_DECREF(old);
+ return result;
+}
+
+static PyType_Slot pairwise_slots[] = {
+ {Py_tp_dealloc, pairwise_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)pairwise_new__doc__},
+ {Py_tp_traverse, pairwise_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, pairwise_next},
+ {Py_tp_alloc, PyType_GenericAlloc},
+ {Py_tp_new, pairwise_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec pairwise_spec = {
+ .name = "itertools.pairwise",
+ .basicsize = sizeof(pairwiseobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = pairwise_slots,
+};
+
+
+/* groupby object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *it;
+ PyObject *keyfunc;
+ PyObject *tgtkey;
+ PyObject *currkey;
+ PyObject *currvalue;
+ const void *currgrouper; /* borrowed reference */
+ itertools_state *state;
+} groupbyobject;
+
+static PyObject *_grouper_create(groupbyobject *, PyObject *);
+
+/*[clinic input]
+@classmethod
+itertools.groupby.__new__
+
+ iterable as it: object
+ Elements to divide into groups according to the key function.
+ key as keyfunc: object = None
+ A function for computing the group category for each element.
+ If the key function is not specified or is None, the element itself
+ is used for grouping.
+
+make an iterator that returns consecutive keys and groups from the iterable
+[clinic start generated code]*/
+
+static PyObject *
+itertools_groupby_impl(PyTypeObject *type, PyObject *it, PyObject *keyfunc)
+/*[clinic end generated code: output=cbb1ae3a90fd4141 input=6b3d123e87ff65a1]*/
+{
+ groupbyobject *gbo;
+
+ gbo = (groupbyobject *)type->tp_alloc(type, 0);
+ if (gbo == NULL)
+ return NULL;
+ gbo->tgtkey = NULL;
+ gbo->currkey = NULL;
+ gbo->currvalue = NULL;
+ gbo->keyfunc = Py_NewRef(keyfunc);
+ gbo->it = PyObject_GetIter(it);
+ if (gbo->it == NULL) {
+ Py_DECREF(gbo);
+ return NULL;
+ }
+ gbo->state = find_state_by_type(type);
+ return (PyObject *)gbo;
+}
+
+static void
+groupby_dealloc(groupbyobject *gbo)
+{
+ PyTypeObject *tp = Py_TYPE(gbo);
+ PyObject_GC_UnTrack(gbo);
+ Py_XDECREF(gbo->it);
+ Py_XDECREF(gbo->keyfunc);
+ Py_XDECREF(gbo->tgtkey);
+ Py_XDECREF(gbo->currkey);
+ Py_XDECREF(gbo->currvalue);
+ tp->tp_free(gbo);
+ Py_DECREF(tp);
+}
+
+static int
+groupby_traverse(groupbyobject *gbo, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(gbo));
+ Py_VISIT(gbo->it);
+ Py_VISIT(gbo->keyfunc);
+ Py_VISIT(gbo->tgtkey);
+ Py_VISIT(gbo->currkey);
+ Py_VISIT(gbo->currvalue);
+ return 0;
+}
+
+Py_LOCAL_INLINE(int)
+groupby_step(groupbyobject *gbo)
+{
+ PyObject *newvalue, *newkey, *oldvalue;
+
+ newvalue = PyIter_Next(gbo->it);
+ if (newvalue == NULL)
+ return -1;
+
+ if (gbo->keyfunc == Py_None) {
+ newkey = Py_NewRef(newvalue);
+ } else {
+ newkey = PyObject_CallOneArg(gbo->keyfunc, newvalue);
+ if (newkey == NULL) {
+ Py_DECREF(newvalue);
+ return -1;
+ }
+ }
+
+ oldvalue = gbo->currvalue;
+ gbo->currvalue = newvalue;
+ Py_XSETREF(gbo->currkey, newkey);
+ Py_XDECREF(oldvalue);
+ return 0;
+}
+
+static PyObject *
+groupby_next(groupbyobject *gbo)
+{
+ PyObject *r, *grouper;
+
+ gbo->currgrouper = NULL;
+ /* skip to next iteration group */
+ for (;;) {
+ if (gbo->currkey == NULL)
+ /* pass */;
+ else if (gbo->tgtkey == NULL)
+ break;
+ else {
+ int rcmp;
+
+ rcmp = PyObject_RichCompareBool(gbo->tgtkey, gbo->currkey, Py_EQ);
+ if (rcmp == -1)
+ return NULL;
+ else if (rcmp == 0)
+ break;
+ }
+
+ if (groupby_step(gbo) < 0)
+ return NULL;
+ }
+ Py_INCREF(gbo->currkey);
+ Py_XSETREF(gbo->tgtkey, gbo->currkey);
+
+ grouper = _grouper_create(gbo, gbo->tgtkey);
+ if (grouper == NULL)
+ return NULL;
+
+ r = PyTuple_Pack(2, gbo->currkey, grouper);
+ Py_DECREF(grouper);
+ return r;
+}
+
+static PyObject *
+groupby_reduce(groupbyobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ /* reduce as a 'new' call with an optional 'setstate' if groupby
+ * has started
+ */
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *value;
+ if (lz->tgtkey && lz->currkey && lz->currvalue)
+ value = Py_BuildValue("O(OO)(OOO)", Py_TYPE(lz),
+ lz->it, lz->keyfunc, lz->currkey, lz->currvalue, lz->tgtkey);
+ else
+ value = Py_BuildValue("O(OO)", Py_TYPE(lz),
+ lz->it, lz->keyfunc);
+
+ return value;
+}
+
+PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
+
+static PyObject *
+groupby_setstate(groupbyobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *currkey, *currvalue, *tgtkey;
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state is not a tuple");
+ return NULL;
+ }
+ if (!PyArg_ParseTuple(state, "OOO", &currkey, &currvalue, &tgtkey)) {
+ return NULL;
+ }
+ Py_INCREF(currkey);
+ Py_XSETREF(lz->currkey, currkey);
+ Py_INCREF(currvalue);
+ Py_XSETREF(lz->currvalue, currvalue);
+ Py_INCREF(tgtkey);
+ Py_XSETREF(lz->tgtkey, tgtkey);
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(setstate_doc, "Set state information for unpickling.");
+
+static PyMethodDef groupby_methods[] = {
+ {"__reduce__", (PyCFunction)groupby_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)groupby_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot groupby_slots[] = {
+ {Py_tp_dealloc, groupby_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_groupby__doc__},
+ {Py_tp_traverse, groupby_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, groupby_next},
+ {Py_tp_methods, groupby_methods},
+ {Py_tp_new, itertools_groupby},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec groupby_spec = {
+ .name = "itertools.groupby",
+ .basicsize= sizeof(groupbyobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = groupby_slots,
+};
+
+/* _grouper object (internal) ************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *parent;
+ PyObject *tgtkey;
+} _grouperobject;
+
+/*[clinic input]
+@classmethod
+itertools._grouper.__new__
+
+ parent: object(subclass_of='clinic_state_by_cls()->groupby_type')
+ tgtkey: object
+ /
+[clinic start generated code]*/
+
+static PyObject *
+itertools__grouper_impl(PyTypeObject *type, PyObject *parent,
+ PyObject *tgtkey)
+/*[clinic end generated code: output=462efb1cdebb5914 input=afe05eb477118f12]*/
+{
+ return _grouper_create((groupbyobject*) parent, tgtkey);
+}
+
+static PyObject *
+_grouper_create(groupbyobject *parent, PyObject *tgtkey)
+{
+ itertools_state *state = parent->state;
+ _grouperobject *igo = PyObject_GC_New(_grouperobject, state->_grouper_type);
+ if (igo == NULL)
+ return NULL;
+ igo->parent = Py_NewRef(parent);
+ igo->tgtkey = Py_NewRef(tgtkey);
+ parent->currgrouper = igo; /* borrowed reference */
+
+ PyObject_GC_Track(igo);
+ return (PyObject *)igo;
+}
+
+static void
+_grouper_dealloc(_grouperobject *igo)
+{
+ PyTypeObject *tp = Py_TYPE(igo);
+ PyObject_GC_UnTrack(igo);
+ Py_DECREF(igo->parent);
+ Py_DECREF(igo->tgtkey);
+ PyObject_GC_Del(igo);
+ Py_DECREF(tp);
+}
+
+static int
+_grouper_traverse(_grouperobject *igo, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(igo));
+ Py_VISIT(igo->parent);
+ Py_VISIT(igo->tgtkey);
+ return 0;
+}
+
+static PyObject *
+_grouper_next(_grouperobject *igo)
+{
+ groupbyobject *gbo = (groupbyobject *)igo->parent;
+ PyObject *r;
+ int rcmp;
+
+ if (gbo->currgrouper != igo)
+ return NULL;
+ if (gbo->currvalue == NULL) {
+ if (groupby_step(gbo) < 0)
+ return NULL;
+ }
+
+ assert(gbo->currkey != NULL);
+ rcmp = PyObject_RichCompareBool(igo->tgtkey, gbo->currkey, Py_EQ);
+ if (rcmp <= 0)
+ /* got any error or current group is end */
+ return NULL;
+
+ r = gbo->currvalue;
+ gbo->currvalue = NULL;
+ Py_CLEAR(gbo->currkey);
+
+ return r;
+}
+
+static PyObject *
+_grouper_reduce(_grouperobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (((groupbyobject *)lz->parent)->currgrouper != lz) {
+ return Py_BuildValue("N(())", _PyEval_GetBuiltin(&_Py_ID(iter)));
+ }
+ return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->parent, lz->tgtkey);
+}
+
+static PyMethodDef _grouper_methods[] = {
+ {"__reduce__", (PyCFunction)_grouper_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot _grouper_slots[] = {
+ {Py_tp_dealloc, _grouper_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, _grouper_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, _grouper_next},
+ {Py_tp_methods, _grouper_methods},
+ {Py_tp_new, itertools__grouper},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec _grouper_spec = {
+ .name = "itertools._grouper",
+ .basicsize = sizeof(_grouperobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = _grouper_slots,
+};
+
+
+/* tee object and with supporting function and objects ***********************/
+
+/* The teedataobject pre-allocates space for LINKCELLS number of objects.
+ To help the object fit neatly inside cache lines (space for 16 to 32
+ pointers), the value should be a multiple of 16 minus space for
+ the other structure members including PyHEAD overhead. The larger the
+ value, the less memory overhead per object and the less time spent
+ allocating/deallocating new links. The smaller the number, the less
+ wasted space and the more rapid freeing of older data.
+*/
+#define LINKCELLS 57
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *it;
+ int numread; /* 0 <= numread <= LINKCELLS */
+ int running;
+ PyObject *nextlink;
+ PyObject *(values[LINKCELLS]);
+} teedataobject;
+
+typedef struct {
+ PyObject_HEAD
+ teedataobject *dataobj;
+ int index; /* 0 <= index <= LINKCELLS */
+ PyObject *weakreflist;
+ itertools_state *state;
+} teeobject;
+
+static PyObject *
+teedataobject_newinternal(itertools_state *state, PyObject *it)
+{
+ teedataobject *tdo;
+
+ tdo = PyObject_GC_New(teedataobject, state->teedataobject_type);
+ if (tdo == NULL)
+ return NULL;
+
+ tdo->running = 0;
+ tdo->numread = 0;
+ tdo->nextlink = NULL;
+ tdo->it = Py_NewRef(it);
+ PyObject_GC_Track(tdo);
+ return (PyObject *)tdo;
+}
+
+static PyObject *
+teedataobject_jumplink(itertools_state *state, teedataobject *tdo)
+{
+ if (tdo->nextlink == NULL)
+ tdo->nextlink = teedataobject_newinternal(state, tdo->it);
+ return Py_XNewRef(tdo->nextlink);
+}
+
+static PyObject *
+teedataobject_getitem(teedataobject *tdo, int i)
+{
+ PyObject *value;
+
+ assert(i < LINKCELLS);
+ if (i < tdo->numread)
+ value = tdo->values[i];
+ else {
+ /* this is the lead iterator, so fetch more data */
+ assert(i == tdo->numread);
+ if (tdo->running) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot re-enter the tee iterator");
+ return NULL;
+ }
+ tdo->running = 1;
+ value = PyIter_Next(tdo->it);
+ tdo->running = 0;
+ if (value == NULL)
+ return NULL;
+ tdo->numread++;
+ tdo->values[i] = value;
+ }
+ return Py_NewRef(value);
+}
+
+static int
+teedataobject_traverse(teedataobject *tdo, visitproc visit, void * arg)
+{
+ int i;
+
+ Py_VISIT(Py_TYPE(tdo));
+ Py_VISIT(tdo->it);
+ for (i = 0; i < tdo->numread; i++)
+ Py_VISIT(tdo->values[i]);
+ Py_VISIT(tdo->nextlink);
+ return 0;
+}
+
+static void
+teedataobject_safe_decref(PyObject *obj, PyTypeObject *tdo_type)
+{
+ while (obj && Py_IS_TYPE(obj, tdo_type) &&
+ Py_REFCNT(obj) == 1) {
+ PyObject *nextlink = ((teedataobject *)obj)->nextlink;
+ ((teedataobject *)obj)->nextlink = NULL;
+ Py_SETREF(obj, nextlink);
+ }
+ Py_XDECREF(obj);
+}
+
+static int
+teedataobject_clear(teedataobject *tdo)
+{
+ int i;
+ PyObject *tmp;
+
+ Py_CLEAR(tdo->it);
+ for (i=0 ; i<tdo->numread ; i++)
+ Py_CLEAR(tdo->values[i]);
+ tmp = tdo->nextlink;
+ tdo->nextlink = NULL;
+ itertools_state *state = get_module_state_by_cls(Py_TYPE(tdo));
+ teedataobject_safe_decref(tmp, state->teedataobject_type);
+ return 0;
+}
+
+static void
+teedataobject_dealloc(teedataobject *tdo)
+{
+ PyTypeObject *tp = Py_TYPE(tdo);
+ PyObject_GC_UnTrack(tdo);
+ teedataobject_clear(tdo);
+ PyObject_GC_Del(tdo);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+teedataobject_reduce(teedataobject *tdo, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ int i;
+ /* create a temporary list of already iterated values */
+ PyObject *values = PyList_New(tdo->numread);
+
+ if (!values)
+ return NULL;
+ for (i=0 ; i<tdo->numread ; i++) {
+ Py_INCREF(tdo->values[i]);
+ PyList_SET_ITEM(values, i, tdo->values[i]);
+ }
+ return Py_BuildValue("O(ONO)", Py_TYPE(tdo), tdo->it,
+ values,
+ tdo->nextlink ? tdo->nextlink : Py_None);
+}
+
+/*[clinic input]
+@classmethod
+itertools.teedataobject.__new__
+ iterable as it: object
+ values: object(subclass_of='&PyList_Type')
+ next: object
+ /
+Data container common to multiple tee objects.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_teedataobject_impl(PyTypeObject *type, PyObject *it,
+ PyObject *values, PyObject *next)
+/*[clinic end generated code: output=3343ceb07e08df5e input=be60f2fabd2b72ba]*/
+{
+ teedataobject *tdo;
+ Py_ssize_t i, len;
+
+ itertools_state *state = get_module_state_by_cls(type);
+ assert(type == state->teedataobject_type);
+
+ tdo = (teedataobject *)teedataobject_newinternal(state, it);
+ if (!tdo)
+ return NULL;
+
+ len = PyList_GET_SIZE(values);
+ if (len > LINKCELLS)
+ goto err;
+ for (i=0; i<len; i++) {
+ tdo->values[i] = PyList_GET_ITEM(values, i);
+ Py_INCREF(tdo->values[i]);
+ }
+ /* len <= LINKCELLS < INT_MAX */
+ tdo->numread = Py_SAFE_DOWNCAST(len, Py_ssize_t, int);
+
+ if (len == LINKCELLS) {
+ if (next != Py_None) {
+ if (!Py_IS_TYPE(next, state->teedataobject_type))
+ goto err;
+ assert(tdo->nextlink == NULL);
+ tdo->nextlink = Py_NewRef(next);
+ }
+ } else {
+ if (next != Py_None)
+ goto err; /* shouldn't have a next if we are not full */
+ }
+ return (PyObject*)tdo;
+
+err:
+ Py_XDECREF(tdo);
+ PyErr_SetString(PyExc_ValueError, "Invalid arguments");
+ return NULL;
+}
+
+static PyMethodDef teedataobject_methods[] = {
+ {"__reduce__", (PyCFunction)teedataobject_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot teedataobject_slots[] = {
+ {Py_tp_dealloc, teedataobject_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_teedataobject__doc__},
+ {Py_tp_traverse, teedataobject_traverse},
+ {Py_tp_clear, teedataobject_clear},
+ {Py_tp_methods, teedataobject_methods},
+ {Py_tp_new, itertools_teedataobject},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec teedataobject_spec = {
+ .name = "itertools._tee_dataobject",
+ .basicsize = sizeof(teedataobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = teedataobject_slots,
+};
+
+
+static PyObject *
+tee_next(teeobject *to)
+{
+ PyObject *value, *link;
+
+ if (to->index >= LINKCELLS) {
+ link = teedataobject_jumplink(to->state, to->dataobj);
+ if (link == NULL)
+ return NULL;
+ Py_SETREF(to->dataobj, (teedataobject *)link);
+ to->index = 0;
+ }
+ value = teedataobject_getitem(to->dataobj, to->index);
+ if (value == NULL)
+ return NULL;
+ to->index++;
+ return value;
+}
+
+static int
+tee_traverse(teeobject *to, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(to));
+ Py_VISIT((PyObject *)to->dataobj);
+ return 0;
+}
+
+static PyObject *
+tee_copy(teeobject *to, PyObject *Py_UNUSED(ignored))
+{
+ teeobject *newto;
+
+ newto = PyObject_GC_New(teeobject, Py_TYPE(to));
+ if (newto == NULL)
+ return NULL;
+ newto->dataobj = (teedataobject*)Py_NewRef(to->dataobj);
+ newto->index = to->index;
+ newto->weakreflist = NULL;
+ newto->state = to->state;
+ PyObject_GC_Track(newto);
+ return (PyObject *)newto;
+}
+
+PyDoc_STRVAR(teecopy_doc, "Returns an independent iterator.");
+
+static PyObject *
+tee_fromiterable(itertools_state *state, PyObject *iterable)
+{
+ teeobject *to;
+ PyObject *it;
+
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+ if (PyObject_TypeCheck(it, state->tee_type)) {
+ to = (teeobject *)tee_copy((teeobject *)it, NULL);
+ goto done;
+ }
+
+ PyObject *dataobj = teedataobject_newinternal(state, it);
+ if (!dataobj) {
+ to = NULL;
+ goto done;
+ }
+ to = PyObject_GC_New(teeobject, state->tee_type);
+ if (to == NULL) {
+ Py_DECREF(dataobj);
+ goto done;
+ }
+ to->dataobj = (teedataobject *)dataobj;
+ to->index = 0;
+ to->weakreflist = NULL;
+ to->state = state;
+ PyObject_GC_Track(to);
+done:
+ Py_DECREF(it);
+ return (PyObject *)to;
+}
+
+/*[clinic input]
+@classmethod
+itertools._tee.__new__
+ iterable: object
+ /
+Iterator wrapped to make it copyable.
+[clinic start generated code]*/
+
+static PyObject *
+itertools__tee_impl(PyTypeObject *type, PyObject *iterable)
+/*[clinic end generated code: output=b02d3fd26c810c3f input=adc0779d2afe37a2]*/
+{
+ itertools_state *state = get_module_state_by_cls(type);
+ return tee_fromiterable(state, iterable);
+}
+
+static int
+tee_clear(teeobject *to)
+{
+ if (to->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) to);
+ Py_CLEAR(to->dataobj);
+ return 0;
+}
+
+static void
+tee_dealloc(teeobject *to)
+{
+ PyTypeObject *tp = Py_TYPE(to);
+ PyObject_GC_UnTrack(to);
+ tee_clear(to);
+ PyObject_GC_Del(to);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+tee_reduce(teeobject *to, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ return Py_BuildValue("O(())(Oi)", Py_TYPE(to), to->dataobj, to->index);
+}
+
+static PyObject *
+tee_setstate(teeobject *to, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ teedataobject *tdo;
+ int index;
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state is not a tuple");
+ return NULL;
+ }
+ PyTypeObject *tdo_type = to->state->teedataobject_type;
+ if (!PyArg_ParseTuple(state, "O!i", tdo_type, &tdo, &index)) {
+ return NULL;
+ }
+ if (index < 0 || index > LINKCELLS) {
+ PyErr_SetString(PyExc_ValueError, "Index out of range");
+ return NULL;
+ }
+ Py_INCREF(tdo);
+ Py_XSETREF(to->dataobj, tdo);
+ to->index = index;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef tee_methods[] = {
+ {"__copy__", (PyCFunction)tee_copy, METH_NOARGS, teecopy_doc},
+ {"__reduce__", (PyCFunction)tee_reduce, METH_NOARGS, reduce_doc},
+ {"__setstate__", (PyCFunction)tee_setstate, METH_O, setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyMemberDef tee_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(teeobject, weakreflist), READONLY},
+ {NULL},
+};
+
+static PyType_Slot tee_slots[] = {
+ {Py_tp_dealloc, tee_dealloc},
+ {Py_tp_doc, (void *)itertools__tee__doc__},
+ {Py_tp_traverse, tee_traverse},
+ {Py_tp_clear, tee_clear},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, tee_next},
+ {Py_tp_methods, tee_methods},
+ {Py_tp_members, tee_members},
+ {Py_tp_new, itertools__tee},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec tee_spec = {
+ .name = "itertools._tee",
+ .basicsize = sizeof(teeobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = tee_slots,
+};
+
+/*[clinic input]
+itertools.tee
+ iterable: object
+ n: Py_ssize_t = 2
+ /
+Returns a tuple of n independent iterators.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_tee_impl(PyObject *module, PyObject *iterable, Py_ssize_t n)
+/*[clinic end generated code: output=1c64519cd859c2f0 input=c99a1472c425d66d]*/
+{
+ Py_ssize_t i;
+ PyObject *it, *copyable, *copyfunc, *result;
+
+ if (n < 0) {
+ PyErr_SetString(PyExc_ValueError, "n must be >= 0");
+ return NULL;
+ }
+ result = PyTuple_New(n);
+ if (result == NULL)
+ return NULL;
+ if (n == 0)
+ return result;
+ it = PyObject_GetIter(iterable);
+ if (it == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ if (_PyObject_LookupAttr(it, &_Py_ID(__copy__), &copyfunc) < 0) {
+ Py_DECREF(it);
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (copyfunc != NULL) {
+ copyable = it;
+ }
+ else {
+ itertools_state *state = get_module_state(module);
+ copyable = tee_fromiterable(state, it);
+ Py_DECREF(it);
+ if (copyable == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ copyfunc = PyObject_GetAttr(copyable, &_Py_ID(__copy__));
+ if (copyfunc == NULL) {
+ Py_DECREF(copyable);
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+
+ PyTuple_SET_ITEM(result, 0, copyable);
+ for (i = 1; i < n; i++) {
+ copyable = _PyObject_CallNoArgs(copyfunc);
+ if (copyable == NULL) {
+ Py_DECREF(copyfunc);
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(result, i, copyable);
+ }
+ Py_DECREF(copyfunc);
+ return result;
+}
+
+
+/* cycle object **************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *it;
+ PyObject *saved;
+ Py_ssize_t index;
+ int firstpass;
+} cycleobject;
+
+/*[clinic input]
+@classmethod
+itertools.cycle.__new__
+ iterable: object
+ /
+Return elements from the iterable until it is exhausted. Then repeat the sequence indefinitely.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_cycle_impl(PyTypeObject *type, PyObject *iterable)
+/*[clinic end generated code: output=f60e5ec17a45b35c input=9d1d84bcf66e908b]*/
+{
+ PyObject *it;
+ PyObject *saved;
+ cycleobject *lz;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ saved = PyList_New(0);
+ if (saved == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+
+ /* create cycleobject structure */
+ lz = (cycleobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ Py_DECREF(saved);
+ return NULL;
+ }
+ lz->it = it;
+ lz->saved = saved;
+ lz->index = 0;
+ lz->firstpass = 0;
+
+ return (PyObject *)lz;
+}
+
+static void
+cycle_dealloc(cycleobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->it);
+ Py_XDECREF(lz->saved);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+cycle_traverse(cycleobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->saved);
+ return 0;
+}
+
+static PyObject *
+cycle_next(cycleobject *lz)
+{
+ PyObject *item;
+
+ if (lz->it != NULL) {
+ item = PyIter_Next(lz->it);
+ if (item != NULL) {
+ if (lz->firstpass)
+ return item;
+ if (PyList_Append(lz->saved, item)) {
+ Py_DECREF(item);
+ return NULL;
+ }
+ return item;
+ }
+ /* Note: StopIteration is already cleared by PyIter_Next() */
+ if (PyErr_Occurred())
+ return NULL;
+ Py_CLEAR(lz->it);
+ }
+ if (PyList_GET_SIZE(lz->saved) == 0)
+ return NULL;
+ item = PyList_GET_ITEM(lz->saved, lz->index);
+ lz->index++;
+ if (lz->index >= PyList_GET_SIZE(lz->saved))
+ lz->index = 0;
+ return Py_NewRef(item);
+}
+
+static PyObject *
+cycle_reduce(cycleobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ /* Create a new cycle with the iterator tuple, then set the saved state */
+ if (lz->it == NULL) {
+ PyObject *it = PyObject_GetIter(lz->saved);
+ if (it == NULL)
+ return NULL;
+ if (lz->index != 0) {
+ PyObject *res = _PyObject_CallMethod(it, &_Py_ID(__setstate__),
+ "n", lz->index);
+ if (res == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ Py_DECREF(res);
+ }
+ return Py_BuildValue("O(N)(OO)", Py_TYPE(lz), it, lz->saved, Py_True);
+ }
+ return Py_BuildValue("O(O)(OO)", Py_TYPE(lz), lz->it, lz->saved,
+ lz->firstpass ? Py_True : Py_False);
+}
+
+static PyObject *
+cycle_setstate(cycleobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *saved=NULL;
+ int firstpass;
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state is not a tuple");
+ return NULL;
+ }
+ // The second item can be 1/0 in old pickles and True/False in new pickles
+ if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass)) {
+ return NULL;
+ }
+ Py_INCREF(saved);
+ Py_XSETREF(lz->saved, saved);
+ lz->firstpass = firstpass != 0;
+ lz->index = 0;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef cycle_methods[] = {
+ {"__reduce__", (PyCFunction)cycle_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)cycle_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot cycle_slots[] = {
+ {Py_tp_dealloc, cycle_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_cycle__doc__},
+ {Py_tp_traverse, cycle_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, cycle_next},
+ {Py_tp_methods, cycle_methods},
+ {Py_tp_new, itertools_cycle},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec cycle_spec = {
+ .name = "itertools.cycle",
+ .basicsize = sizeof(cycleobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = cycle_slots,
+};
+
+
+/* dropwhile object **********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *func;
+ PyObject *it;
+ long start;
+} dropwhileobject;
+
+/*[clinic input]
+@classmethod
+itertools.dropwhile.__new__
+ predicate as func: object
+ iterable as seq: object
+ /
+Drop items from the iterable while predicate(item) is true.
+
+Afterwards, return every element until the iterable is exhausted.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_dropwhile_impl(PyTypeObject *type, PyObject *func, PyObject *seq)
+/*[clinic end generated code: output=92f9d0d89af149e4 input=d39737147c9f0a26]*/
+{
+ PyObject *it;
+ dropwhileobject *lz;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(seq);
+ if (it == NULL)
+ return NULL;
+
+ /* create dropwhileobject structure */
+ lz = (dropwhileobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ lz->func = Py_NewRef(func);
+ lz->it = it;
+ lz->start = 0;
+
+ return (PyObject *)lz;
+}
+
+static void
+dropwhile_dealloc(dropwhileobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->func);
+ Py_XDECREF(lz->it);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+dropwhile_traverse(dropwhileobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->func);
+ return 0;
+}
+
+static PyObject *
+dropwhile_next(dropwhileobject *lz)
+{
+ PyObject *item, *good;
+ PyObject *it = lz->it;
+ long ok;
+ PyObject *(*iternext)(PyObject *);
+
+ iternext = *Py_TYPE(it)->tp_iternext;
+ for (;;) {
+ item = iternext(it);
+ if (item == NULL)
+ return NULL;
+ if (lz->start == 1)
+ return item;
+
+ good = PyObject_CallOneArg(lz->func, item);
+ if (good == NULL) {
+ Py_DECREF(item);
+ return NULL;
+ }
+ ok = PyObject_IsTrue(good);
+ Py_DECREF(good);
+ if (ok == 0) {
+ lz->start = 1;
+ return item;
+ }
+ Py_DECREF(item);
+ if (ok < 0)
+ return NULL;
+ }
+}
+
+static PyObject *
+dropwhile_reduce(dropwhileobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ return Py_BuildValue("O(OO)l", Py_TYPE(lz), lz->func, lz->it, lz->start);
+}
+
+static PyObject *
+dropwhile_setstate(dropwhileobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ int start = PyObject_IsTrue(state);
+ if (start < 0)
+ return NULL;
+ lz->start = start;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef dropwhile_methods[] = {
+ {"__reduce__", (PyCFunction)dropwhile_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)dropwhile_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot dropwhile_slots[] = {
+ {Py_tp_dealloc, dropwhile_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_dropwhile__doc__},
+ {Py_tp_traverse, dropwhile_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, dropwhile_next},
+ {Py_tp_methods, dropwhile_methods},
+ {Py_tp_new, itertools_dropwhile},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec dropwhile_spec = {
+ .name = "itertools.dropwhile",
+ .basicsize = sizeof(dropwhileobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = dropwhile_slots,
+};
+
+
+/* takewhile object **********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *func;
+ PyObject *it;
+ long stop;
+} takewhileobject;
+
+/*[clinic input]
+@classmethod
+itertools.takewhile.__new__
+ predicate as func: object
+ iterable as seq: object
+ /
+Return successive entries from an iterable as long as the predicate evaluates to true for each entry.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_takewhile_impl(PyTypeObject *type, PyObject *func, PyObject *seq)
+/*[clinic end generated code: output=bb179ea7864e2ef6 input=ba5255f7519aa119]*/
+{
+ PyObject *it;
+ takewhileobject *lz;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(seq);
+ if (it == NULL)
+ return NULL;
+
+ /* create takewhileobject structure */
+ lz = (takewhileobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ lz->func = Py_NewRef(func);
+ lz->it = it;
+ lz->stop = 0;
+
+ return (PyObject *)lz;
+}
+
+static void
+takewhile_dealloc(takewhileobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->func);
+ Py_XDECREF(lz->it);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+takewhile_traverse(takewhileobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->func);
+ return 0;
+}
+
+static PyObject *
+takewhile_next(takewhileobject *lz)
+{
+ PyObject *item, *good;
+ PyObject *it = lz->it;
+ long ok;
+
+ if (lz->stop == 1)
+ return NULL;
+
+ item = (*Py_TYPE(it)->tp_iternext)(it);
+ if (item == NULL)
+ return NULL;
+
+ good = PyObject_CallOneArg(lz->func, item);
+ if (good == NULL) {
+ Py_DECREF(item);
+ return NULL;
+ }
+ ok = PyObject_IsTrue(good);
+ Py_DECREF(good);
+ if (ok > 0)
+ return item;
+ Py_DECREF(item);
+ if (ok == 0)
+ lz->stop = 1;
+ return NULL;
+}
+
+static PyObject *
+takewhile_reduce(takewhileobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ return Py_BuildValue("O(OO)l", Py_TYPE(lz), lz->func, lz->it, lz->stop);
+}
+
+static PyObject *
+takewhile_reduce_setstate(takewhileobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ int stop = PyObject_IsTrue(state);
+
+ if (stop < 0)
+ return NULL;
+ lz->stop = stop;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef takewhile_reduce_methods[] = {
+ {"__reduce__", (PyCFunction)takewhile_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)takewhile_reduce_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot takewhile_slots[] = {
+ {Py_tp_dealloc, takewhile_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_takewhile__doc__},
+ {Py_tp_traverse, takewhile_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, takewhile_next},
+ {Py_tp_methods, takewhile_reduce_methods},
+ {Py_tp_new, itertools_takewhile},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec takewhile_spec = {
+ .name = "itertools.takewhile",
+ .basicsize = sizeof(takewhileobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = takewhile_slots,
+};
+
+
+/* islice object *************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *it;
+ Py_ssize_t next;
+ Py_ssize_t stop;
+ Py_ssize_t step;
+ Py_ssize_t cnt;
+} isliceobject;
+
+static PyObject *
+islice_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyObject *seq;
+ Py_ssize_t start=0, stop=-1, step=1;
+ PyObject *it, *a1=NULL, *a2=NULL, *a3=NULL;
+ Py_ssize_t numargs;
+ isliceobject *lz;
+
+ itertools_state *st = find_state_by_type(type);
+ PyTypeObject *islice_type = st->islice_type;
+ if ((type == islice_type || type->tp_init == islice_type->tp_init) &&
+ !_PyArg_NoKeywords("islice", kwds))
+ return NULL;
+
+ if (!PyArg_UnpackTuple(args, "islice", 2, 4, &seq, &a1, &a2, &a3))
+ return NULL;
+
+ numargs = PyTuple_Size(args);
+ if (numargs == 2) {
+ if (a1 != Py_None) {
+ stop = PyNumber_AsSsize_t(a1, PyExc_OverflowError);
+ if (stop == -1) {
+ if (PyErr_Occurred())
+ PyErr_Clear();
+ PyErr_SetString(PyExc_ValueError,
+ "Stop argument for islice() must be None or "
+ "an integer: 0 <= x <= sys.maxsize.");
+ return NULL;
+ }
+ }
+ } else {
+ if (a1 != Py_None)
+ start = PyNumber_AsSsize_t(a1, PyExc_OverflowError);
+ if (start == -1 && PyErr_Occurred())
+ PyErr_Clear();
+ if (a2 != Py_None) {
+ stop = PyNumber_AsSsize_t(a2, PyExc_OverflowError);
+ if (stop == -1) {
+ if (PyErr_Occurred())
+ PyErr_Clear();
+ PyErr_SetString(PyExc_ValueError,
+ "Stop argument for islice() must be None or "
+ "an integer: 0 <= x <= sys.maxsize.");
+ return NULL;
+ }
+ }
+ }
+ if (start<0 || stop<-1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Indices for islice() must be None or "
+ "an integer: 0 <= x <= sys.maxsize.");
+ return NULL;
+ }
+
+ if (a3 != NULL) {
+ if (a3 != Py_None)
+ step = PyNumber_AsSsize_t(a3, PyExc_OverflowError);
+ if (step == -1 && PyErr_Occurred())
+ PyErr_Clear();
+ }
+ if (step<1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Step for islice() must be a positive integer or None.");
+ return NULL;
+ }
+
+ /* Get iterator. */
+ it = PyObject_GetIter(seq);
+ if (it == NULL)
+ return NULL;
+
+ /* create isliceobject structure */
+ lz = (isliceobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ lz->it = it;
+ lz->next = start;
+ lz->stop = stop;
+ lz->step = step;
+ lz->cnt = 0L;
+
+ return (PyObject *)lz;
+}
+
+static void
+islice_dealloc(isliceobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->it);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+islice_traverse(isliceobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->it);
+ return 0;
+}
+
+static PyObject *
+islice_next(isliceobject *lz)
+{
+ PyObject *item;
+ PyObject *it = lz->it;
+ Py_ssize_t stop = lz->stop;
+ Py_ssize_t oldnext;
+ PyObject *(*iternext)(PyObject *);
+
+ if (it == NULL)
+ return NULL;
+
+ iternext = *Py_TYPE(it)->tp_iternext;
+ while (lz->cnt < lz->next) {
+ item = iternext(it);
+ if (item == NULL)
+ goto empty;
+ Py_DECREF(item);
+ lz->cnt++;
+ }
+ if (stop != -1 && lz->cnt >= stop)
+ goto empty;
+ item = iternext(it);
+ if (item == NULL)
+ goto empty;
+ lz->cnt++;
+ oldnext = lz->next;
+ /* The (size_t) cast below avoids the danger of undefined
+ behaviour from signed integer overflow. */
+ lz->next += (size_t)lz->step;
+ if (lz->next < oldnext || (stop != -1 && lz->next > stop))
+ lz->next = stop;
+ return item;
+
+empty:
+ Py_CLEAR(lz->it);
+ return NULL;
+}
+
+static PyObject *
+islice_reduce(isliceobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ /* When unpickled, generate a new object with the same bounds,
+ * then 'setstate' with the next and count
+ */
+ PyObject *stop;
+
+ if (lz->it == NULL) {
+ PyObject *empty_list;
+ PyObject *empty_it;
+ empty_list = PyList_New(0);
+ if (empty_list == NULL)
+ return NULL;
+ empty_it = PyObject_GetIter(empty_list);
+ Py_DECREF(empty_list);
+ if (empty_it == NULL)
+ return NULL;
+ return Py_BuildValue("O(Nn)n", Py_TYPE(lz), empty_it, 0, 0);
+ }
+ if (lz->stop == -1) {
+ stop = Py_NewRef(Py_None);
+ } else {
+ stop = PyLong_FromSsize_t(lz->stop);
+ if (stop == NULL)
+ return NULL;
+ }
+ return Py_BuildValue("O(OnNn)n", Py_TYPE(lz),
+ lz->it, lz->next, stop, lz->step,
+ lz->cnt);
+}
+
+static PyObject *
+islice_setstate(isliceobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ Py_ssize_t cnt = PyLong_AsSsize_t(state);
+
+ if (cnt == -1 && PyErr_Occurred())
+ return NULL;
+ lz->cnt = cnt;
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef islice_methods[] = {
+ {"__reduce__", (PyCFunction)islice_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)islice_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(islice_doc,
+"islice(iterable, stop) --> islice object\n\
+islice(iterable, start, stop[, step]) --> islice object\n\
+\n\
+Return an iterator whose next() method returns selected values from an\n\
+iterable. If start is specified, will skip all preceding elements;\n\
+otherwise, start defaults to zero. Step defaults to one. If\n\
+specified as another value, step determines how many values are\n\
+skipped between successive calls. Works like a slice() on a list\n\
+but returns an iterator.");
+
+static PyType_Slot islice_slots[] = {
+ {Py_tp_dealloc, islice_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)islice_doc},
+ {Py_tp_traverse, islice_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, islice_next},
+ {Py_tp_methods, islice_methods},
+ {Py_tp_new, islice_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec islice_spec = {
+ .name = "itertools.islice",
+ .basicsize = sizeof(isliceobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = islice_slots,
+};
+
+
+/* starmap object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *func;
+ PyObject *it;
+} starmapobject;
+
+/*[clinic input]
+@classmethod
+itertools.starmap.__new__
+ function as func: object
+ iterable as seq: object
+ /
+Return an iterator whose values are returned from the function evaluated with an argument tuple taken from the given sequence.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_starmap_impl(PyTypeObject *type, PyObject *func, PyObject *seq)
+/*[clinic end generated code: output=79eeb81d452c6e8d input=844766df6a0d4dad]*/
+{
+ PyObject *it;
+ starmapobject *lz;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(seq);
+ if (it == NULL)
+ return NULL;
+
+ /* create starmapobject structure */
+ lz = (starmapobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ lz->func = Py_NewRef(func);
+ lz->it = it;
+
+ return (PyObject *)lz;
+}
+
+static void
+starmap_dealloc(starmapobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->func);
+ Py_XDECREF(lz->it);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+starmap_traverse(starmapobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->func);
+ return 0;
+}
+
+static PyObject *
+starmap_next(starmapobject *lz)
+{
+ PyObject *args;
+ PyObject *result;
+ PyObject *it = lz->it;
+
+ args = (*Py_TYPE(it)->tp_iternext)(it);
+ if (args == NULL)
+ return NULL;
+ if (!PyTuple_CheckExact(args)) {
+ PyObject *newargs = PySequence_Tuple(args);
+ Py_DECREF(args);
+ if (newargs == NULL)
+ return NULL;
+ args = newargs;
+ }
+ result = PyObject_Call(lz->func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+
+static PyObject *
+starmap_reduce(starmapobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ /* Just pickle the iterator */
+ return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->func, lz->it);
+}
+
+static PyMethodDef starmap_methods[] = {
+ {"__reduce__", (PyCFunction)starmap_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot starmap_slots[] = {
+ {Py_tp_dealloc, starmap_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_starmap__doc__},
+ {Py_tp_traverse, starmap_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, starmap_next},
+ {Py_tp_methods, starmap_methods},
+ {Py_tp_new, itertools_starmap},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec starmap_spec = {
+ .name = "itertools.starmap",
+ .basicsize = sizeof(starmapobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = starmap_slots,
+};
+
+
+/* chain object **************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *source; /* Iterator over input iterables */
+ PyObject *active; /* Currently running input iterator */
+} chainobject;
+
+static PyObject *
+chain_new_internal(PyTypeObject *type, PyObject *source)
+{
+ chainobject *lz;
+
+ lz = (chainobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(source);
+ return NULL;
+ }
+
+ lz->source = source;
+ lz->active = NULL;
+ return (PyObject *)lz;
+}
+
+static PyObject *
+chain_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyObject *source;
+
+ itertools_state *state = find_state_by_type(type);
+ PyTypeObject *chain_type = state->chain_type;
+ if ((type == chain_type || type->tp_init == chain_type->tp_init) &&
+ !_PyArg_NoKeywords("chain", kwds))
+ return NULL;
+
+ source = PyObject_GetIter(args);
+ if (source == NULL)
+ return NULL;
+
+ return chain_new_internal(type, source);
+}
+
+/*[clinic input]
+@classmethod
+itertools.chain.from_iterable
+ iterable as arg: object
+ /
+Alternative chain() constructor taking a single iterable argument that evaluates lazily.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_chain_from_iterable(PyTypeObject *type, PyObject *arg)
+/*[clinic end generated code: output=667ae7a7f7b68654 input=72c39e3a2ca3be85]*/
+{
+ PyObject *source;
+
+ source = PyObject_GetIter(arg);
+ if (source == NULL)
+ return NULL;
+
+ return chain_new_internal(type, source);
+}
+
+static void
+chain_dealloc(chainobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->active);
+ Py_XDECREF(lz->source);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+chain_traverse(chainobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->source);
+ Py_VISIT(lz->active);
+ return 0;
+}
+
+static PyObject *
+chain_next(chainobject *lz)
+{
+ PyObject *item;
+
+ /* lz->source is the iterator of iterables. If it's NULL, we've already
+ * consumed them all. lz->active is the current iterator. If it's NULL,
+ * we should grab a new one from lz->source. */
+ while (lz->source != NULL) {
+ if (lz->active == NULL) {
+ PyObject *iterable = PyIter_Next(lz->source);
+ if (iterable == NULL) {
+ Py_CLEAR(lz->source);
+ return NULL; /* no more input sources */
+ }
+ lz->active = PyObject_GetIter(iterable);
+ Py_DECREF(iterable);
+ if (lz->active == NULL) {
+ Py_CLEAR(lz->source);
+ return NULL; /* input not iterable */
+ }
+ }
+ item = (*Py_TYPE(lz->active)->tp_iternext)(lz->active);
+ if (item != NULL)
+ return item;
+ if (PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_StopIteration))
+ PyErr_Clear();
+ else
+ return NULL; /* input raised an exception */
+ }
+ /* lz->active is consumed, try with the next iterable. */
+ Py_CLEAR(lz->active);
+ }
+ /* Everything had been consumed already. */
+ return NULL;
+}
+
+static PyObject *
+chain_reduce(chainobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (lz->source) {
+ /* we can't pickle function objects (itertools.from_iterable) so
+ * we must use setstate to replace the iterable. One day we
+ * will fix pickling of functions
+ */
+ if (lz->active) {
+ return Py_BuildValue("O()(OO)", Py_TYPE(lz), lz->source, lz->active);
+ } else {
+ return Py_BuildValue("O()(O)", Py_TYPE(lz), lz->source);
+ }
+ } else {
+ return Py_BuildValue("O()", Py_TYPE(lz)); /* exhausted */
+ }
+ return NULL;
+}
+
+static PyObject *
+chain_setstate(chainobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *source, *active=NULL;
+
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state is not a tuple");
+ return NULL;
+ }
+ if (!PyArg_ParseTuple(state, "O|O", &source, &active)) {
+ return NULL;
+ }
+ if (!PyIter_Check(source) || (active != NULL && !PyIter_Check(active))) {
+ PyErr_SetString(PyExc_TypeError, "Arguments must be iterators.");
+ return NULL;
+ }
+
+ Py_INCREF(source);
+ Py_XSETREF(lz->source, source);
+ Py_XINCREF(active);
+ Py_XSETREF(lz->active, active);
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(chain_doc,
+"chain(*iterables) --> chain object\n\
+\n\
+Return a chain object whose .__next__() method returns elements from the\n\
+first iterable until it is exhausted, then elements from the next\n\
+iterable, until all of the iterables are exhausted.");
+
+static PyMethodDef chain_methods[] = {
+ ITERTOOLS_CHAIN_FROM_ITERABLE_METHODDEF
+ {"__reduce__", (PyCFunction)chain_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)chain_setstate, METH_O,
+ setstate_doc},
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot chain_slots[] = {
+ {Py_tp_dealloc, chain_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)chain_doc},
+ {Py_tp_traverse, chain_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, chain_next},
+ {Py_tp_methods, chain_methods},
+ {Py_tp_new, chain_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec chain_spec = {
+ .name = "itertools.chain",
+ .basicsize = sizeof(chainobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = chain_slots,
+};
+
+
+/* product object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *pools; /* tuple of pool tuples */
+ Py_ssize_t *indices; /* one index per pool */
+ PyObject *result; /* most recently returned result tuple */
+ int stopped; /* set to 1 when the iterator is exhausted */
+} productobject;
+
+static PyObject *
+product_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ productobject *lz;
+ Py_ssize_t nargs, npools, repeat=1;
+ PyObject *pools = NULL;
+ Py_ssize_t *indices = NULL;
+ Py_ssize_t i;
+
+ if (kwds != NULL) {
+ char *kwlist[] = {"repeat", 0};
+ PyObject *tmpargs = PyTuple_New(0);
+ if (tmpargs == NULL)
+ return NULL;
+ if (!PyArg_ParseTupleAndKeywords(tmpargs, kwds, "|n:product",
+ kwlist, &repeat)) {
+ Py_DECREF(tmpargs);
+ return NULL;
+ }
+ Py_DECREF(tmpargs);
+ if (repeat < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "repeat argument cannot be negative");
+ return NULL;
+ }
+ }
+
+ assert(PyTuple_CheckExact(args));
+ if (repeat == 0) {
+ nargs = 0;
+ } else {
+ nargs = PyTuple_GET_SIZE(args);
+ if ((size_t)nargs > PY_SSIZE_T_MAX/sizeof(Py_ssize_t)/repeat) {
+ PyErr_SetString(PyExc_OverflowError, "repeat argument too large");
+ return NULL;
+ }
+ }
+ npools = nargs * repeat;
+
+ indices = PyMem_New(Py_ssize_t, npools);
+ if (indices == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ pools = PyTuple_New(npools);
+ if (pools == NULL)
+ goto error;
+
+ for (i=0; i < nargs ; ++i) {
+ PyObject *item = PyTuple_GET_ITEM(args, i);
+ PyObject *pool = PySequence_Tuple(item);
+ if (pool == NULL)
+ goto error;
+ PyTuple_SET_ITEM(pools, i, pool);
+ indices[i] = 0;
+ }
+ for ( ; i < npools; ++i) {
+ PyObject *pool = PyTuple_GET_ITEM(pools, i - nargs);
+ Py_INCREF(pool);
+ PyTuple_SET_ITEM(pools, i, pool);
+ indices[i] = 0;
+ }
+
+ /* create productobject structure */
+ lz = (productobject *)type->tp_alloc(type, 0);
+ if (lz == NULL)
+ goto error;
+
+ lz->pools = pools;
+ lz->indices = indices;
+ lz->result = NULL;
+ lz->stopped = 0;
+
+ return (PyObject *)lz;
+
+error:
+ if (indices != NULL)
+ PyMem_Free(indices);
+ Py_XDECREF(pools);
+ return NULL;
+}
+
+static void
+product_dealloc(productobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->pools);
+ Py_XDECREF(lz->result);
+ if (lz->indices != NULL)
+ PyMem_Free(lz->indices);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+product_sizeof(productobject *lz, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(lz));
+ res += (size_t)PyTuple_GET_SIZE(lz->pools) * sizeof(Py_ssize_t);
+ return PyLong_FromSize_t(res);
+}
+
+PyDoc_STRVAR(sizeof_doc, "Returns size in memory, in bytes.");
+
+static int
+product_traverse(productobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->pools);
+ Py_VISIT(lz->result);
+ return 0;
+}
+
+static PyObject *
+product_next(productobject *lz)
+{
+ PyObject *pool;
+ PyObject *elem;
+ PyObject *oldelem;
+ PyObject *pools = lz->pools;
+ PyObject *result = lz->result;
+ Py_ssize_t npools = PyTuple_GET_SIZE(pools);
+ Py_ssize_t i;
+
+ if (lz->stopped)
+ return NULL;
+
+ if (result == NULL) {
+ /* On the first pass, return an initial tuple filled with the
+ first element from each pool. */
+ result = PyTuple_New(npools);
+ if (result == NULL)
+ goto empty;
+ lz->result = result;
+ for (i=0; i < npools; i++) {
+ pool = PyTuple_GET_ITEM(pools, i);
+ if (PyTuple_GET_SIZE(pool) == 0)
+ goto empty;
+ elem = PyTuple_GET_ITEM(pool, 0);
+ Py_INCREF(elem);
+ PyTuple_SET_ITEM(result, i, elem);
+ }
+ } else {
+ Py_ssize_t *indices = lz->indices;
+
+ /* Copy the previous result tuple or re-use it if available */
+ if (Py_REFCNT(result) > 1) {
+ PyObject *old_result = result;
+ result = _PyTuple_FromArray(_PyTuple_ITEMS(old_result), npools);
+ if (result == NULL)
+ goto empty;
+ lz->result = result;
+ Py_DECREF(old_result);
+ }
+ // bpo-42536: The GC may have untracked this result tuple. Since we're
+ // recycling it, make sure it's tracked again:
+ else if (!_PyObject_GC_IS_TRACKED(result)) {
+ _PyObject_GC_TRACK(result);
+ }
+ /* Now, we've got the only copy so we can update it in-place */
+ assert (npools==0 || Py_REFCNT(result) == 1);
+
+ /* Update the pool indices right-to-left. Only advance to the
+ next pool when the previous one rolls-over */
+ for (i=npools-1 ; i >= 0 ; i--) {
+ pool = PyTuple_GET_ITEM(pools, i);
+ indices[i]++;
+ if (indices[i] == PyTuple_GET_SIZE(pool)) {
+ /* Roll-over and advance to next pool */
+ indices[i] = 0;
+ elem = PyTuple_GET_ITEM(pool, 0);
+ Py_INCREF(elem);
+ oldelem = PyTuple_GET_ITEM(result, i);
+ PyTuple_SET_ITEM(result, i, elem);
+ Py_DECREF(oldelem);
+ } else {
+ /* No rollover. Just increment and stop here. */
+ elem = PyTuple_GET_ITEM(pool, indices[i]);
+ Py_INCREF(elem);
+ oldelem = PyTuple_GET_ITEM(result, i);
+ PyTuple_SET_ITEM(result, i, elem);
+ Py_DECREF(oldelem);
+ break;
+ }
+ }
+
+ /* If i is negative, then the indices have all rolled-over
+ and we're done. */
+ if (i < 0)
+ goto empty;
+ }
+
+ return Py_NewRef(result);
+
+empty:
+ lz->stopped = 1;
+ return NULL;
+}
+
+static PyObject *
+product_reduce(productobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (lz->stopped) {
+ return Py_BuildValue("O(())", Py_TYPE(lz));
+ } else if (lz->result == NULL) {
+ return Py_BuildValue("OO", Py_TYPE(lz), lz->pools);
+ } else {
+ PyObject *indices;
+ Py_ssize_t n, i;
+
+ /* we must pickle the indices use them for setstate, and
+ * additionally indicate that the iterator has started
+ */
+ n = PyTuple_GET_SIZE(lz->pools);
+ indices = PyTuple_New(n);
+ if (indices == NULL)
+ return NULL;
+ for (i=0; i<n; i++){
+ PyObject* index = PyLong_FromSsize_t(lz->indices[i]);
+ if (!index) {
+ Py_DECREF(indices);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(indices, i, index);
+ }
+ return Py_BuildValue("OON", Py_TYPE(lz), lz->pools, indices);
+ }
+}
+
+static PyObject *
+product_setstate(productobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *result;
+ Py_ssize_t n, i;
+
+ n = PyTuple_GET_SIZE(lz->pools);
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != n) {
+ PyErr_SetString(PyExc_ValueError, "invalid arguments");
+ return NULL;
+ }
+ for (i=0; i<n; i++)
+ {
+ PyObject* indexObject = PyTuple_GET_ITEM(state, i);
+ Py_ssize_t index = PyLong_AsSsize_t(indexObject);
+ PyObject* pool;
+ Py_ssize_t poolsize;
+ if (index < 0 && PyErr_Occurred())
+ return NULL; /* not an integer */
+ pool = PyTuple_GET_ITEM(lz->pools, i);
+ poolsize = PyTuple_GET_SIZE(pool);
+ if (poolsize == 0) {
+ lz->stopped = 1;
+ Py_RETURN_NONE;
+ }
+ /* clamp the index */
+ if (index < 0)
+ index = 0;
+ else if (index > poolsize-1)
+ index = poolsize-1;
+ lz->indices[i] = index;
+ }
+
+ result = PyTuple_New(n);
+ if (!result)
+ return NULL;
+ for (i=0; i<n; i++) {
+ PyObject *pool = PyTuple_GET_ITEM(lz->pools, i);
+ PyObject *element = PyTuple_GET_ITEM(pool, lz->indices[i]);
+ Py_INCREF(element);
+ PyTuple_SET_ITEM(result, i, element);
+ }
+ Py_XSETREF(lz->result, result);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef product_methods[] = {
+ {"__reduce__", (PyCFunction)product_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)product_setstate, METH_O,
+ setstate_doc},
+ {"__sizeof__", (PyCFunction)product_sizeof, METH_NOARGS,
+ sizeof_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(product_doc,
+"product(*iterables, repeat=1) --> product object\n\
+\n\
+Cartesian product of input iterables. Equivalent to nested for-loops.\n\n\
+For example, product(A, B) returns the same as: ((x,y) for x in A for y in B).\n\
+The leftmost iterators are in the outermost for-loop, so the output tuples\n\
+cycle in a manner similar to an odometer (with the rightmost element changing\n\
+on every iteration).\n\n\
+To compute the product of an iterable with itself, specify the number\n\
+of repetitions with the optional repeat keyword argument. For example,\n\
+product(A, repeat=4) means the same as product(A, A, A, A).\n\n\
+product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)\n\
+product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...");
+
+static PyType_Slot product_slots[] = {
+ {Py_tp_dealloc, product_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)product_doc},
+ {Py_tp_traverse, product_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, product_next},
+ {Py_tp_methods, product_methods},
+ {Py_tp_new, product_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec product_spec = {
+ .name = "itertools.product",
+ .basicsize = sizeof(productobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = product_slots,
+};
+
+
+/* combinations object *******************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *pool; /* input converted to a tuple */
+ Py_ssize_t *indices; /* one index per result element */
+ PyObject *result; /* most recently returned result tuple */
+ Py_ssize_t r; /* size of result tuple */
+ int stopped; /* set to 1 when the iterator is exhausted */
+} combinationsobject;
+
+
+/*[clinic input]
+@classmethod
+itertools.combinations.__new__
+ iterable: object
+ r: Py_ssize_t
+Return successive r-length combinations of elements in the iterable.
+
+combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)
+[clinic start generated code]*/
+
+static PyObject *
+itertools_combinations_impl(PyTypeObject *type, PyObject *iterable,
+ Py_ssize_t r)
+/*[clinic end generated code: output=87a689b39c40039c input=06bede09e3da20f8]*/
+{
+ combinationsobject *co;
+ Py_ssize_t n;
+ PyObject *pool = NULL;
+ Py_ssize_t *indices = NULL;
+ Py_ssize_t i;
+
+ pool = PySequence_Tuple(iterable);
+ if (pool == NULL)
+ goto error;
+ n = PyTuple_GET_SIZE(pool);
+ if (r < 0) {
+ PyErr_SetString(PyExc_ValueError, "r must be non-negative");
+ goto error;
+ }
+
+ indices = PyMem_New(Py_ssize_t, r);
+ if (indices == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ for (i=0 ; i<r ; i++)
+ indices[i] = i;
+
+ /* create combinationsobject structure */
+ co = (combinationsobject *)type->tp_alloc(type, 0);
+ if (co == NULL)
+ goto error;
+
+ co->pool = pool;
+ co->indices = indices;
+ co->result = NULL;
+ co->r = r;
+ co->stopped = r > n ? 1 : 0;
+
+ return (PyObject *)co;
+
+error:
+ if (indices != NULL)
+ PyMem_Free(indices);
+ Py_XDECREF(pool);
+ return NULL;
+}
+
+static void
+combinations_dealloc(combinationsobject *co)
+{
+ PyTypeObject *tp = Py_TYPE(co);
+ PyObject_GC_UnTrack(co);
+ Py_XDECREF(co->pool);
+ Py_XDECREF(co->result);
+ if (co->indices != NULL)
+ PyMem_Free(co->indices);
+ tp->tp_free(co);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+combinations_sizeof(combinationsobject *co, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(co));
+ res += (size_t)co->r * sizeof(Py_ssize_t);
+ return PyLong_FromSize_t(res);
+}
+
+static int
+combinations_traverse(combinationsobject *co, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(co));
+ Py_VISIT(co->pool);
+ Py_VISIT(co->result);
+ return 0;
+}
+
+static PyObject *
+combinations_next(combinationsobject *co)
+{
+ PyObject *elem;
+ PyObject *oldelem;
+ PyObject *pool = co->pool;
+ Py_ssize_t *indices = co->indices;
+ PyObject *result = co->result;
+ Py_ssize_t n = PyTuple_GET_SIZE(pool);
+ Py_ssize_t r = co->r;
+ Py_ssize_t i, j, index;
+
+ if (co->stopped)
+ return NULL;
+
+ if (result == NULL) {
+ /* On the first pass, initialize result tuple using the indices */
+ result = PyTuple_New(r);
+ if (result == NULL)
+ goto empty;
+ co->result = result;
+ for (i=0; i<r ; i++) {
+ index = indices[i];
+ elem = PyTuple_GET_ITEM(pool, index);
+ Py_INCREF(elem);
+ PyTuple_SET_ITEM(result, i, elem);
+ }
+ } else {
+ /* Copy the previous result tuple or re-use it if available */
+ if (Py_REFCNT(result) > 1) {
+ PyObject *old_result = result;
+ result = _PyTuple_FromArray(_PyTuple_ITEMS(old_result), r);
+ if (result == NULL)
+ goto empty;
+ co->result = result;
+ Py_DECREF(old_result);
+ }
+ // bpo-42536: The GC may have untracked this result tuple. Since we're
+ // recycling it, make sure it's tracked again:
+ else if (!_PyObject_GC_IS_TRACKED(result)) {
+ _PyObject_GC_TRACK(result);
+ }
+ /* Now, we've got the only copy so we can update it in-place
+ * CPython's empty tuple is a singleton and cached in
+ * PyTuple's freelist.
+ */
+ assert(r == 0 || Py_REFCNT(result) == 1);
+
+ /* Scan indices right-to-left until finding one that is not
+ at its maximum (i + n - r). */
+ for (i=r-1 ; i >= 0 && indices[i] == i+n-r ; i--)
+ ;
+
+ /* If i is negative, then the indices are all at
+ their maximum value and we're done. */
+ if (i < 0)
+ goto empty;
+
+ /* Increment the current index which we know is not at its
+ maximum. Then move back to the right setting each index
+ to its lowest possible value (one higher than the index
+ to its left -- this maintains the sort order invariant). */
+ indices[i]++;
+ for (j=i+1 ; j<r ; j++)
+ indices[j] = indices[j-1] + 1;
+
+ /* Update the result tuple for the new indices
+ starting with i, the leftmost index that changed */
+ for ( ; i<r ; i++) {
+ index = indices[i];
+ elem = PyTuple_GET_ITEM(pool, index);
+ Py_INCREF(elem);
+ oldelem = PyTuple_GET_ITEM(result, i);
+ PyTuple_SET_ITEM(result, i, elem);
+ Py_DECREF(oldelem);
+ }
+ }
+
+ return Py_NewRef(result);
+
+empty:
+ co->stopped = 1;
+ return NULL;
+}
+
+static PyObject *
+combinations_reduce(combinationsobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (lz->result == NULL) {
+ return Py_BuildValue("O(On)", Py_TYPE(lz), lz->pool, lz->r);
+ } else if (lz->stopped) {
+ return Py_BuildValue("O(()n)", Py_TYPE(lz), lz->r);
+ } else {
+ PyObject *indices;
+ Py_ssize_t i;
+
+ /* we must pickle the indices and use them for setstate */
+ indices = PyTuple_New(lz->r);
+ if (!indices)
+ return NULL;
+ for (i=0; i<lz->r; i++)
+ {
+ PyObject* index = PyLong_FromSsize_t(lz->indices[i]);
+ if (!index) {
+ Py_DECREF(indices);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(indices, i, index);
+ }
+
+ return Py_BuildValue("O(On)N", Py_TYPE(lz), lz->pool, lz->r, indices);
+ }
+}
+
+static PyObject *
+combinations_setstate(combinationsobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *result;
+ Py_ssize_t i;
+ Py_ssize_t n = PyTuple_GET_SIZE(lz->pool);
+
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != lz->r) {
+ PyErr_SetString(PyExc_ValueError, "invalid arguments");
+ return NULL;
+ }
+
+ for (i=0; i<lz->r; i++) {
+ Py_ssize_t max;
+ PyObject* indexObject = PyTuple_GET_ITEM(state, i);
+ Py_ssize_t index = PyLong_AsSsize_t(indexObject);
+
+ if (index == -1 && PyErr_Occurred())
+ return NULL; /* not an integer */
+ max = i + n - lz->r;
+ /* clamp the index (beware of negative max) */
+ if (index > max)
+ index = max;
+ if (index < 0)
+ index = 0;
+ lz->indices[i] = index;
+ }
+
+ result = PyTuple_New(lz->r);
+ if (result == NULL)
+ return NULL;
+ for (i=0; i<lz->r; i++) {
+ PyObject *element = PyTuple_GET_ITEM(lz->pool, lz->indices[i]);
+ Py_INCREF(element);
+ PyTuple_SET_ITEM(result, i, element);
+ }
+
+ Py_XSETREF(lz->result, result);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef combinations_methods[] = {
+ {"__reduce__", (PyCFunction)combinations_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)combinations_setstate, METH_O,
+ setstate_doc},
+ {"__sizeof__", (PyCFunction)combinations_sizeof, METH_NOARGS,
+ sizeof_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot combinations_slots[] = {
+ {Py_tp_dealloc, combinations_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_combinations__doc__},
+ {Py_tp_traverse, combinations_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, combinations_next},
+ {Py_tp_methods, combinations_methods},
+ {Py_tp_new, itertools_combinations},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec combinations_spec = {
+ .name = "itertools.combinations",
+ .basicsize = sizeof(combinationsobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = combinations_slots,
+};
+
+
+/* combinations with replacement object **************************************/
+
+/* Equivalent to:
+
+ def combinations_with_replacement(iterable, r):
+ "combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC"
+ # number items returned: (n+r-1)! / r! / (n-1)!
+ pool = tuple(iterable)
+ n = len(pool)
+ indices = [0] * r
+ yield tuple(pool[i] for i in indices)
+ while 1:
+ for i in reversed(range(r)):
+ if indices[i] != n - 1:
+ break
+ else:
+ return
+ indices[i:] = [indices[i] + 1] * (r - i)
+ yield tuple(pool[i] for i in indices)
+
+ def combinations_with_replacement2(iterable, r):
+ 'Alternate version that filters from product()'
+ pool = tuple(iterable)
+ n = len(pool)
+ for indices in product(range(n), repeat=r):
+ if sorted(indices) == list(indices):
+ yield tuple(pool[i] for i in indices)
+*/
+typedef struct {
+ PyObject_HEAD
+ PyObject *pool; /* input converted to a tuple */
+ Py_ssize_t *indices; /* one index per result element */
+ PyObject *result; /* most recently returned result tuple */
+ Py_ssize_t r; /* size of result tuple */
+ int stopped; /* set to 1 when the cwr iterator is exhausted */
+} cwrobject;
+
+/*[clinic input]
+@classmethod
+itertools.combinations_with_replacement.__new__
+ iterable: object
+ r: Py_ssize_t
+Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.
+
+combinations_with_replacement('ABC', 2) --> ('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')
+[clinic start generated code]*/
+
+static PyObject *
+itertools_combinations_with_replacement_impl(PyTypeObject *type,
+ PyObject *iterable,
+ Py_ssize_t r)
+/*[clinic end generated code: output=48b26856d4e659ca input=1dc58e82a0878fdc]*/
+{
+ cwrobject *co;
+ Py_ssize_t n;
+ PyObject *pool = NULL;
+ Py_ssize_t *indices = NULL;
+ Py_ssize_t i;
+
+ pool = PySequence_Tuple(iterable);
+ if (pool == NULL)
+ goto error;
+ n = PyTuple_GET_SIZE(pool);
+ if (r < 0) {
+ PyErr_SetString(PyExc_ValueError, "r must be non-negative");
+ goto error;
+ }
+
+ indices = PyMem_New(Py_ssize_t, r);
+ if (indices == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ for (i=0 ; i<r ; i++)
+ indices[i] = 0;
+
+ /* create cwrobject structure */
+ co = (cwrobject *)type->tp_alloc(type, 0);
+ if (co == NULL)
+ goto error;
+
+ co->pool = pool;
+ co->indices = indices;
+ co->result = NULL;
+ co->r = r;
+ co->stopped = !n && r;
+
+ return (PyObject *)co;
+
+error:
+ if (indices != NULL)
+ PyMem_Free(indices);
+ Py_XDECREF(pool);
+ return NULL;
+}
+
+static void
+cwr_dealloc(cwrobject *co)
+{
+ PyTypeObject *tp = Py_TYPE(co);
+ PyObject_GC_UnTrack(co);
+ Py_XDECREF(co->pool);
+ Py_XDECREF(co->result);
+ if (co->indices != NULL)
+ PyMem_Free(co->indices);
+ tp->tp_free(co);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+cwr_sizeof(cwrobject *co, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(co));
+ res += (size_t)co->r * sizeof(Py_ssize_t);
+ return PyLong_FromSize_t(res);
+}
+
+static int
+cwr_traverse(cwrobject *co, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(co));
+ Py_VISIT(co->pool);
+ Py_VISIT(co->result);
+ return 0;
+}
+
+static PyObject *
+cwr_next(cwrobject *co)
+{
+ PyObject *elem;
+ PyObject *oldelem;
+ PyObject *pool = co->pool;
+ Py_ssize_t *indices = co->indices;
+ PyObject *result = co->result;
+ Py_ssize_t n = PyTuple_GET_SIZE(pool);
+ Py_ssize_t r = co->r;
+ Py_ssize_t i, index;
+
+ if (co->stopped)
+ return NULL;
+
+ if (result == NULL) {
+ /* On the first pass, initialize result tuple with pool[0] */
+ result = PyTuple_New(r);
+ if (result == NULL)
+ goto empty;
+ co->result = result;
+ if (n > 0) {
+ elem = PyTuple_GET_ITEM(pool, 0);
+ for (i=0; i<r ; i++) {
+ assert(indices[i] == 0);
+ Py_INCREF(elem);
+ PyTuple_SET_ITEM(result, i, elem);
+ }
+ }
+ } else {
+ /* Copy the previous result tuple or re-use it if available */
+ if (Py_REFCNT(result) > 1) {
+ PyObject *old_result = result;
+ result = _PyTuple_FromArray(_PyTuple_ITEMS(old_result), r);
+ if (result == NULL)
+ goto empty;
+ co->result = result;
+ Py_DECREF(old_result);
+ }
+ // bpo-42536: The GC may have untracked this result tuple. Since we're
+ // recycling it, make sure it's tracked again:
+ else if (!_PyObject_GC_IS_TRACKED(result)) {
+ _PyObject_GC_TRACK(result);
+ }
+ /* Now, we've got the only copy so we can update it in-place CPython's
+ empty tuple is a singleton and cached in PyTuple's freelist. */
+ assert(r == 0 || Py_REFCNT(result) == 1);
+
+ /* Scan indices right-to-left until finding one that is not
+ * at its maximum (n-1). */
+ for (i=r-1 ; i >= 0 && indices[i] == n-1; i--)
+ ;
+
+ /* If i is negative, then the indices are all at
+ their maximum value and we're done. */
+ if (i < 0)
+ goto empty;
+
+ /* Increment the current index which we know is not at its
+ maximum. Then set all to the right to the same value. */
+ index = indices[i] + 1;
+ assert(index < n);
+ elem = PyTuple_GET_ITEM(pool, index);
+ for ( ; i<r ; i++) {
+ indices[i] = index;
+ Py_INCREF(elem);
+ oldelem = PyTuple_GET_ITEM(result, i);
+ PyTuple_SET_ITEM(result, i, elem);
+ Py_DECREF(oldelem);
+ }
+ }
+
+ return Py_NewRef(result);
+
+empty:
+ co->stopped = 1;
+ return NULL;
+}
+
+static PyObject *
+cwr_reduce(cwrobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (lz->result == NULL) {
+ return Py_BuildValue("O(On)", Py_TYPE(lz), lz->pool, lz->r);
+ } else if (lz->stopped) {
+ return Py_BuildValue("O(()n)", Py_TYPE(lz), lz->r);
+ } else {
+ PyObject *indices;
+ Py_ssize_t i;
+
+ /* we must pickle the indices and use them for setstate */
+ indices = PyTuple_New(lz->r);
+ if (!indices)
+ return NULL;
+ for (i=0; i<lz->r; i++) {
+ PyObject* index = PyLong_FromSsize_t(lz->indices[i]);
+ if (!index) {
+ Py_DECREF(indices);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(indices, i, index);
+ }
+
+ return Py_BuildValue("O(On)N", Py_TYPE(lz), lz->pool, lz->r, indices);
+ }
+}
+
+static PyObject *
+cwr_setstate(cwrobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *result;
+ Py_ssize_t n, i;
+
+ if (!PyTuple_Check(state) || PyTuple_GET_SIZE(state) != lz->r)
+ {
+ PyErr_SetString(PyExc_ValueError, "invalid arguments");
+ return NULL;
+ }
+
+ n = PyTuple_GET_SIZE(lz->pool);
+ for (i=0; i<lz->r; i++) {
+ PyObject* indexObject = PyTuple_GET_ITEM(state, i);
+ Py_ssize_t index = PyLong_AsSsize_t(indexObject);
+
+ if (index < 0 && PyErr_Occurred())
+ return NULL; /* not an integer */
+ /* clamp the index */
+ if (index < 0)
+ index = 0;
+ else if (index > n-1)
+ index = n-1;
+ lz->indices[i] = index;
+ }
+ result = PyTuple_New(lz->r);
+ if (result == NULL)
+ return NULL;
+ for (i=0; i<lz->r; i++) {
+ PyObject *element = PyTuple_GET_ITEM(lz->pool, lz->indices[i]);
+ Py_INCREF(element);
+ PyTuple_SET_ITEM(result, i, element);
+ }
+ Py_XSETREF(lz->result, result);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef cwr_methods[] = {
+ {"__reduce__", (PyCFunction)cwr_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)cwr_setstate, METH_O,
+ setstate_doc},
+ {"__sizeof__", (PyCFunction)cwr_sizeof, METH_NOARGS,
+ sizeof_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot cwr_slots[] = {
+ {Py_tp_dealloc, cwr_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_combinations_with_replacement__doc__},
+ {Py_tp_traverse, cwr_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, cwr_next},
+ {Py_tp_methods, cwr_methods},
+ {Py_tp_new, itertools_combinations_with_replacement},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec cwr_spec = {
+ .name = "itertools.combinations_with_replacement",
+ .basicsize = sizeof(cwrobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = cwr_slots,
+};
+
+
+/* permutations object ********************************************************
+
+def permutations(iterable, r=None):
+ # permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC
+ # permutations(range(3)) --> 012 021 102 120 201 210
+ pool = tuple(iterable)
+ n = len(pool)
+ r = n if r is None else r
+ if r > n:
+ return
+ indices = list(range(n))
+ cycles = list(range(n, n-r, -1))
+ yield tuple(pool[i] for i in indices[:r])
+ while n:
+ for i in reversed(range(r)):
+ cycles[i] -= 1
+ if cycles[i] == 0:
+ indices[i:] = indices[i+1:] + indices[i:i+1]
+ cycles[i] = n - i
+ else:
+ j = cycles[i]
+ indices[i], indices[-j] = indices[-j], indices[i]
+ yield tuple(pool[i] for i in indices[:r])
+ break
+ else:
+ return
+*/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *pool; /* input converted to a tuple */
+ Py_ssize_t *indices; /* one index per element in the pool */
+ Py_ssize_t *cycles; /* one rollover counter per element in the result */
+ PyObject *result; /* most recently returned result tuple */
+ Py_ssize_t r; /* size of result tuple */
+ int stopped; /* set to 1 when the iterator is exhausted */
+} permutationsobject;
+
+/*[clinic input]
+@classmethod
+itertools.permutations.__new__
+ iterable: object
+ r as robj: object = None
+Return successive r-length permutations of elements in the iterable.
+
+permutations(range(3), 2) --> (0,1), (0,2), (1,0), (1,2), (2,0), (2,1)
+[clinic start generated code]*/
+
+static PyObject *
+itertools_permutations_impl(PyTypeObject *type, PyObject *iterable,
+ PyObject *robj)
+/*[clinic end generated code: output=296a72fa76d620ea input=57d0170a4ac0ec7a]*/
+{
+ permutationsobject *po;
+ Py_ssize_t n;
+ Py_ssize_t r;
+ PyObject *pool = NULL;
+ Py_ssize_t *indices = NULL;
+ Py_ssize_t *cycles = NULL;
+ Py_ssize_t i;
+
+ pool = PySequence_Tuple(iterable);
+ if (pool == NULL)
+ goto error;
+ n = PyTuple_GET_SIZE(pool);
+
+ r = n;
+ if (robj != Py_None) {
+ if (!PyLong_Check(robj)) {
+ PyErr_SetString(PyExc_TypeError, "Expected int as r");
+ goto error;
+ }
+ r = PyLong_AsSsize_t(robj);
+ if (r == -1 && PyErr_Occurred())
+ goto error;
+ }
+ if (r < 0) {
+ PyErr_SetString(PyExc_ValueError, "r must be non-negative");
+ goto error;
+ }
+
+ indices = PyMem_New(Py_ssize_t, n);
+ cycles = PyMem_New(Py_ssize_t, r);
+ if (indices == NULL || cycles == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+
+ for (i=0 ; i<n ; i++)
+ indices[i] = i;
+ for (i=0 ; i<r ; i++)
+ cycles[i] = n - i;
+
+ /* create permutationsobject structure */
+ po = (permutationsobject *)type->tp_alloc(type, 0);
+ if (po == NULL)
+ goto error;
+
+ po->pool = pool;
+ po->indices = indices;
+ po->cycles = cycles;
+ po->result = NULL;
+ po->r = r;
+ po->stopped = r > n ? 1 : 0;
+
+ return (PyObject *)po;
+
+error:
+ if (indices != NULL)
+ PyMem_Free(indices);
+ if (cycles != NULL)
+ PyMem_Free(cycles);
+ Py_XDECREF(pool);
+ return NULL;
+}
+
+static void
+permutations_dealloc(permutationsobject *po)
+{
+ PyTypeObject *tp = Py_TYPE(po);
+ PyObject_GC_UnTrack(po);
+ Py_XDECREF(po->pool);
+ Py_XDECREF(po->result);
+ PyMem_Free(po->indices);
+ PyMem_Free(po->cycles);
+ tp->tp_free(po);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+permutations_sizeof(permutationsobject *po, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(po));
+ res += (size_t)PyTuple_GET_SIZE(po->pool) * sizeof(Py_ssize_t);
+ res += (size_t)po->r * sizeof(Py_ssize_t);
+ return PyLong_FromSize_t(res);
+}
+
+static int
+permutations_traverse(permutationsobject *po, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(po));
+ Py_VISIT(po->pool);
+ Py_VISIT(po->result);
+ return 0;
+}
+
+static PyObject *
+permutations_next(permutationsobject *po)
+{
+ PyObject *elem;
+ PyObject *oldelem;
+ PyObject *pool = po->pool;
+ Py_ssize_t *indices = po->indices;
+ Py_ssize_t *cycles = po->cycles;
+ PyObject *result = po->result;
+ Py_ssize_t n = PyTuple_GET_SIZE(pool);
+ Py_ssize_t r = po->r;
+ Py_ssize_t i, j, k, index;
+
+ if (po->stopped)
+ return NULL;
+
+ if (result == NULL) {
+ /* On the first pass, initialize result tuple using the indices */
+ result = PyTuple_New(r);
+ if (result == NULL)
+ goto empty;
+ po->result = result;
+ for (i=0; i<r ; i++) {
+ index = indices[i];
+ elem = PyTuple_GET_ITEM(pool, index);
+ Py_INCREF(elem);
+ PyTuple_SET_ITEM(result, i, elem);
+ }
+ } else {
+ if (n == 0)
+ goto empty;
+
+ /* Copy the previous result tuple or re-use it if available */
+ if (Py_REFCNT(result) > 1) {
+ PyObject *old_result = result;
+ result = _PyTuple_FromArray(_PyTuple_ITEMS(old_result), r);
+ if (result == NULL)
+ goto empty;
+ po->result = result;
+ Py_DECREF(old_result);
+ }
+ // bpo-42536: The GC may have untracked this result tuple. Since we're
+ // recycling it, make sure it's tracked again:
+ else if (!_PyObject_GC_IS_TRACKED(result)) {
+ _PyObject_GC_TRACK(result);
+ }
+ /* Now, we've got the only copy so we can update it in-place */
+ assert(r == 0 || Py_REFCNT(result) == 1);
+
+ /* Decrement rightmost cycle, moving leftward upon zero rollover */
+ for (i=r-1 ; i>=0 ; i--) {
+ cycles[i] -= 1;
+ if (cycles[i] == 0) {
+ /* rotatation: indices[i:] = indices[i+1:] + indices[i:i+1] */
+ index = indices[i];
+ for (j=i ; j<n-1 ; j++)
+ indices[j] = indices[j+1];
+ indices[n-1] = index;
+ cycles[i] = n - i;
+ } else {
+ j = cycles[i];
+ index = indices[i];
+ indices[i] = indices[n-j];
+ indices[n-j] = index;
+
+ for (k=i; k<r ; k++) {
+ /* start with i, the leftmost element that changed */
+ /* yield tuple(pool[k] for k in indices[:r]) */
+ index = indices[k];
+ elem = PyTuple_GET_ITEM(pool, index);
+ Py_INCREF(elem);
+ oldelem = PyTuple_GET_ITEM(result, k);
+ PyTuple_SET_ITEM(result, k, elem);
+ Py_DECREF(oldelem);
+ }
+ break;
+ }
+ }
+ /* If i is negative, then the cycles have all
+ rolled-over and we're done. */
+ if (i < 0)
+ goto empty;
+ }
+ return Py_NewRef(result);
+
+empty:
+ po->stopped = 1;
+ return NULL;
+}
+
+static PyObject *
+permutations_reduce(permutationsobject *po, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (po->result == NULL) {
+ return Py_BuildValue("O(On)", Py_TYPE(po), po->pool, po->r);
+ } else if (po->stopped) {
+ return Py_BuildValue("O(()n)", Py_TYPE(po), po->r);
+ } else {
+ PyObject *indices=NULL, *cycles=NULL;
+ Py_ssize_t n, i;
+
+ /* we must pickle the indices and cycles and use them for setstate */
+ n = PyTuple_GET_SIZE(po->pool);
+ indices = PyTuple_New(n);
+ if (indices == NULL)
+ goto err;
+ for (i=0; i<n; i++) {
+ PyObject* index = PyLong_FromSsize_t(po->indices[i]);
+ if (!index)
+ goto err;
+ PyTuple_SET_ITEM(indices, i, index);
+ }
+
+ cycles = PyTuple_New(po->r);
+ if (cycles == NULL)
+ goto err;
+ for (i=0 ; i<po->r ; i++) {
+ PyObject* index = PyLong_FromSsize_t(po->cycles[i]);
+ if (!index)
+ goto err;
+ PyTuple_SET_ITEM(cycles, i, index);
+ }
+ return Py_BuildValue("O(On)(NN)", Py_TYPE(po),
+ po->pool, po->r,
+ indices, cycles);
+ err:
+ Py_XDECREF(indices);
+ Py_XDECREF(cycles);
+ return NULL;
+ }
+}
+
+static PyObject *
+permutations_setstate(permutationsobject *po, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ PyObject *indices, *cycles, *result;
+ Py_ssize_t n, i;
+
+ if (!PyTuple_Check(state)) {
+ PyErr_SetString(PyExc_TypeError, "state is not a tuple");
+ return NULL;
+ }
+ if (!PyArg_ParseTuple(state, "O!O!",
+ &PyTuple_Type, &indices,
+ &PyTuple_Type, &cycles)) {
+ return NULL;
+ }
+
+ n = PyTuple_GET_SIZE(po->pool);
+ if (PyTuple_GET_SIZE(indices) != n || PyTuple_GET_SIZE(cycles) != po->r) {
+ PyErr_SetString(PyExc_ValueError, "invalid arguments");
+ return NULL;
+ }
+
+ for (i=0; i<n; i++) {
+ PyObject* indexObject = PyTuple_GET_ITEM(indices, i);
+ Py_ssize_t index = PyLong_AsSsize_t(indexObject);
+ if (index < 0 && PyErr_Occurred())
+ return NULL; /* not an integer */
+ /* clamp the index */
+ if (index < 0)
+ index = 0;
+ else if (index > n-1)
+ index = n-1;
+ po->indices[i] = index;
+ }
+
+ for (i=0; i<po->r; i++) {
+ PyObject* indexObject = PyTuple_GET_ITEM(cycles, i);
+ Py_ssize_t index = PyLong_AsSsize_t(indexObject);
+ if (index < 0 && PyErr_Occurred())
+ return NULL; /* not an integer */
+ if (index < 1)
+ index = 1;
+ else if (index > n-i)
+ index = n-i;
+ po->cycles[i] = index;
+ }
+ result = PyTuple_New(po->r);
+ if (result == NULL)
+ return NULL;
+ for (i=0; i<po->r; i++) {
+ PyObject *element = PyTuple_GET_ITEM(po->pool, po->indices[i]);
+ Py_INCREF(element);
+ PyTuple_SET_ITEM(result, i, element);
+ }
+ Py_XSETREF(po->result, result);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef permuations_methods[] = {
+ {"__reduce__", (PyCFunction)permutations_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)permutations_setstate, METH_O,
+ setstate_doc},
+ {"__sizeof__", (PyCFunction)permutations_sizeof, METH_NOARGS,
+ sizeof_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot permutations_slots[] = {
+ {Py_tp_dealloc, permutations_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_permutations__doc__},
+ {Py_tp_traverse, permutations_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, permutations_next},
+ {Py_tp_methods, permuations_methods},
+ {Py_tp_new, itertools_permutations},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec permutations_spec = {
+ .name = "itertools.permutations",
+ .basicsize = sizeof(permutationsobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = permutations_slots,
+};
+
+
+/* accumulate object ********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *total;
+ PyObject *it;
+ PyObject *binop;
+ PyObject *initial;
+ itertools_state *state;
+} accumulateobject;
+
+/*[clinic input]
+@classmethod
+itertools.accumulate.__new__
+ iterable: object
+ func as binop: object = None
+ *
+ initial: object = None
+Return series of accumulated sums (or other binary function results).
+[clinic start generated code]*/
+
+static PyObject *
+itertools_accumulate_impl(PyTypeObject *type, PyObject *iterable,
+ PyObject *binop, PyObject *initial)
+/*[clinic end generated code: output=66da2650627128f8 input=c4ce20ac59bf7ffd]*/
+{
+ PyObject *it;
+ accumulateobject *lz;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(iterable);
+ if (it == NULL)
+ return NULL;
+
+ /* create accumulateobject structure */
+ lz = (accumulateobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+
+ if (binop != Py_None) {
+ lz->binop = Py_XNewRef(binop);
+ }
+ lz->total = NULL;
+ lz->it = it;
+ lz->initial = Py_XNewRef(initial);
+ lz->state = find_state_by_type(type);
+ return (PyObject *)lz;
+}
+
+static void
+accumulate_dealloc(accumulateobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->binop);
+ Py_XDECREF(lz->total);
+ Py_XDECREF(lz->it);
+ Py_XDECREF(lz->initial);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+accumulate_traverse(accumulateobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->binop);
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->total);
+ Py_VISIT(lz->initial);
+ return 0;
+}
+
+static PyObject *
+accumulate_next(accumulateobject *lz)
+{
+ PyObject *val, *newtotal;
+
+ if (lz->initial != Py_None) {
+ lz->total = lz->initial;
+ lz->initial = Py_NewRef(Py_None);
+ return Py_NewRef(lz->total);
+ }
+ val = (*Py_TYPE(lz->it)->tp_iternext)(lz->it);
+ if (val == NULL)
+ return NULL;
+
+ if (lz->total == NULL) {
+ lz->total = Py_NewRef(val);
+ return lz->total;
+ }
+
+ if (lz->binop == NULL)
+ newtotal = PyNumber_Add(lz->total, val);
+ else
+ newtotal = PyObject_CallFunctionObjArgs(lz->binop, lz->total, val, NULL);
+ Py_DECREF(val);
+ if (newtotal == NULL)
+ return NULL;
+
+ Py_INCREF(newtotal);
+ Py_SETREF(lz->total, newtotal);
+ return newtotal;
+}
+
+static PyObject *
+accumulate_reduce(accumulateobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ itertools_state *state = lz->state;
+
+ if (lz->initial != Py_None) {
+ PyObject *it;
+
+ assert(lz->total == NULL);
+ it = PyObject_CallFunction((PyObject *)(state->chain_type), "(O)O",
+ lz->initial, lz->it);
+ if (it == NULL)
+ return NULL;
+ return Py_BuildValue("O(NO)O", Py_TYPE(lz),
+ it, lz->binop?lz->binop:Py_None, Py_None);
+ }
+ if (lz->total == Py_None) {
+ PyObject *it;
+
+ it = PyObject_CallFunction((PyObject *)(state->chain_type), "(O)O",
+ lz->total, lz->it);
+ if (it == NULL)
+ return NULL;
+ it = PyObject_CallFunction((PyObject *)Py_TYPE(lz), "NO",
+ it, lz->binop ? lz->binop : Py_None);
+ if (it == NULL)
+ return NULL;
+
+ return Py_BuildValue("O(NiO)", state->islice_type, it, 1, Py_None);
+ }
+ return Py_BuildValue("O(OO)O", Py_TYPE(lz),
+ lz->it, lz->binop?lz->binop:Py_None,
+ lz->total?lz->total:Py_None);
+}
+
+static PyObject *
+accumulate_setstate(accumulateobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ Py_INCREF(state);
+ Py_XSETREF(lz->total, state);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef accumulate_methods[] = {
+ {"__reduce__", (PyCFunction)accumulate_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)accumulate_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot accumulate_slots[] = {
+ {Py_tp_dealloc, accumulate_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_accumulate__doc__},
+ {Py_tp_traverse, accumulate_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, accumulate_next},
+ {Py_tp_methods, accumulate_methods},
+ {Py_tp_new, itertools_accumulate},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec accumulate_spec = {
+ .name = "itertools.accumulate",
+ .basicsize = sizeof(accumulateobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = accumulate_slots,
+};
+
+
+/* compress object ************************************************************/
+
+/* Equivalent to:
+
+ def compress(data, selectors):
+ "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F"
+ return (d for d, s in zip(data, selectors) if s)
+*/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *data;
+ PyObject *selectors;
+} compressobject;
+
+/*[clinic input]
+@classmethod
+itertools.compress.__new__
+ data as seq1: object
+ selectors as seq2: object
+Return data elements corresponding to true selector elements.
+
+Forms a shorter iterator from selected data elements using the selectors to
+choose the data elements.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_compress_impl(PyTypeObject *type, PyObject *seq1, PyObject *seq2)
+/*[clinic end generated code: output=7e67157212ed09e0 input=79596d7cd20c77e5]*/
+{
+ PyObject *data=NULL, *selectors=NULL;
+ compressobject *lz;
+
+ data = PyObject_GetIter(seq1);
+ if (data == NULL)
+ goto fail;
+ selectors = PyObject_GetIter(seq2);
+ if (selectors == NULL)
+ goto fail;
+
+ /* create compressobject structure */
+ lz = (compressobject *)type->tp_alloc(type, 0);
+ if (lz == NULL)
+ goto fail;
+ lz->data = data;
+ lz->selectors = selectors;
+ return (PyObject *)lz;
+
+fail:
+ Py_XDECREF(data);
+ Py_XDECREF(selectors);
+ return NULL;
+}
+
+static void
+compress_dealloc(compressobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->data);
+ Py_XDECREF(lz->selectors);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+compress_traverse(compressobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->data);
+ Py_VISIT(lz->selectors);
+ return 0;
+}
+
+static PyObject *
+compress_next(compressobject *lz)
+{
+ PyObject *data = lz->data, *selectors = lz->selectors;
+ PyObject *datum, *selector;
+ PyObject *(*datanext)(PyObject *) = *Py_TYPE(data)->tp_iternext;
+ PyObject *(*selectornext)(PyObject *) = *Py_TYPE(selectors)->tp_iternext;
+ int ok;
+
+ while (1) {
+ /* Steps: get datum, get selector, evaluate selector.
+ Order is important (to match the pure python version
+ in terms of which input gets a chance to raise an
+ exception first).
+ */
+
+ datum = datanext(data);
+ if (datum == NULL)
+ return NULL;
+
+ selector = selectornext(selectors);
+ if (selector == NULL) {
+ Py_DECREF(datum);
+ return NULL;
+ }
+
+ ok = PyObject_IsTrue(selector);
+ Py_DECREF(selector);
+ if (ok > 0)
+ return datum;
+ Py_DECREF(datum);
+ if (ok < 0)
+ return NULL;
+ }
+}
+
+static PyObject *
+compress_reduce(compressobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ return Py_BuildValue("O(OO)", Py_TYPE(lz),
+ lz->data, lz->selectors);
+}
+
+static PyMethodDef compress_methods[] = {
+ {"__reduce__", (PyCFunction)compress_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot compress_slots[] = {
+ {Py_tp_dealloc, compress_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_compress__doc__},
+ {Py_tp_traverse, compress_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, compress_next},
+ {Py_tp_methods, compress_methods},
+ {Py_tp_new, itertools_compress},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec compress_spec = {
+ .name = "itertools.compress",
+ .basicsize = sizeof(compressobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = compress_slots,
+};
+
+
+/* filterfalse object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *func;
+ PyObject *it;
+} filterfalseobject;
+
+/*[clinic input]
+@classmethod
+itertools.filterfalse.__new__
+ function as func: object
+ iterable as seq: object
+ /
+Return those items of iterable for which function(item) is false.
+
+If function is None, return the items that are false.
+[clinic start generated code]*/
+
+static PyObject *
+itertools_filterfalse_impl(PyTypeObject *type, PyObject *func, PyObject *seq)
+/*[clinic end generated code: output=55f87eab9fc0484e input=2d684a2c66f99cde]*/
+{
+ PyObject *it;
+ filterfalseobject *lz;
+
+ /* Get iterator. */
+ it = PyObject_GetIter(seq);
+ if (it == NULL)
+ return NULL;
+
+ /* create filterfalseobject structure */
+ lz = (filterfalseobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(it);
+ return NULL;
+ }
+ lz->func = Py_NewRef(func);
+ lz->it = it;
+
+ return (PyObject *)lz;
+}
+
+static void
+filterfalse_dealloc(filterfalseobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->func);
+ Py_XDECREF(lz->it);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+filterfalse_traverse(filterfalseobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->it);
+ Py_VISIT(lz->func);
+ return 0;
+}
+
+static PyObject *
+filterfalse_next(filterfalseobject *lz)
+{
+ PyObject *item;
+ PyObject *it = lz->it;
+ long ok;
+ PyObject *(*iternext)(PyObject *);
+
+ iternext = *Py_TYPE(it)->tp_iternext;
+ for (;;) {
+ item = iternext(it);
+ if (item == NULL)
+ return NULL;
+
+ if (lz->func == Py_None || lz->func == (PyObject *)&PyBool_Type) {
+ ok = PyObject_IsTrue(item);
+ } else {
+ PyObject *good;
+ good = PyObject_CallOneArg(lz->func, item);
+ if (good == NULL) {
+ Py_DECREF(item);
+ return NULL;
+ }
+ ok = PyObject_IsTrue(good);
+ Py_DECREF(good);
+ }
+ if (ok == 0)
+ return item;
+ Py_DECREF(item);
+ if (ok < 0)
+ return NULL;
+ }
+}
+
+static PyObject *
+filterfalse_reduce(filterfalseobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->func, lz->it);
+}
+
+static PyMethodDef filterfalse_methods[] = {
+ {"__reduce__", (PyCFunction)filterfalse_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot filterfalse_slots[] = {
+ {Py_tp_dealloc, filterfalse_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_filterfalse__doc__},
+ {Py_tp_traverse, filterfalse_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, filterfalse_next},
+ {Py_tp_methods, filterfalse_methods},
+ {Py_tp_new, itertools_filterfalse},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec filterfalse_spec = {
+ .name = "itertools.filterfalse",
+ .basicsize = sizeof(filterfalseobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = filterfalse_slots,
+};
+
+
+/* count object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t cnt;
+ PyObject *long_cnt;
+ PyObject *long_step;
+} countobject;
+
+/* Counting logic and invariants:
+
+fast_mode: when cnt an integer < PY_SSIZE_T_MAX and no step is specified.
+
+ assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && long_step==PyLong(1));
+ Advances with: cnt += 1
+ When count hits Y_SSIZE_T_MAX, switch to slow_mode.
+
+slow_mode: when cnt == PY_SSIZE_T_MAX, step is not int(1), or cnt is a float.
+
+ assert(cnt == PY_SSIZE_T_MAX && long_cnt != NULL && long_step != NULL);
+ All counting is done with python objects (no overflows or underflows).
+ Advances with: long_cnt += long_step
+ Step may be zero -- effectively a slow version of repeat(cnt).
+ Either long_cnt or long_step may be a float, Fraction, or Decimal.
+*/
+
+/*[clinic input]
+@classmethod
+itertools.count.__new__
+ start as long_cnt: object(c_default="NULL") = 0
+ step as long_step: object(c_default="NULL") = 1
+Return a count object whose .__next__() method returns consecutive values.
+
+Equivalent to:
+ def count(firstval=0, step=1):
+ x = firstval
+ while 1:
+ yield x
+ x += step
+[clinic start generated code]*/
+
+static PyObject *
+itertools_count_impl(PyTypeObject *type, PyObject *long_cnt,
+ PyObject *long_step)
+/*[clinic end generated code: output=09a9250aebd00b1c input=d7a85eec18bfcd94]*/
+{
+ countobject *lz;
+ int fast_mode;
+ Py_ssize_t cnt = 0;
+ long step;
+
+ if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) ||
+ (long_step != NULL && !PyNumber_Check(long_step))) {
+ PyErr_SetString(PyExc_TypeError, "a number is required");
+ return NULL;
+ }
+
+ fast_mode = (long_cnt == NULL || PyLong_Check(long_cnt)) &&
+ (long_step == NULL || PyLong_Check(long_step));
+
+ /* If not specified, start defaults to 0 */
+ if (long_cnt != NULL) {
+ if (fast_mode) {
+ assert(PyLong_Check(long_cnt));
+ cnt = PyLong_AsSsize_t(long_cnt);
+ if (cnt == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ fast_mode = 0;
+ }
+ }
+ } else {
+ cnt = 0;
+ long_cnt = _PyLong_GetZero();
+ }
+ Py_INCREF(long_cnt);
+
+ /* If not specified, step defaults to 1 */
+ if (long_step == NULL) {
+ long_step = _PyLong_GetOne();
+ }
+ Py_INCREF(long_step);
+
+ assert(long_cnt != NULL && long_step != NULL);
+
+ /* Fast mode only works when the step is 1 */
+ if (fast_mode) {
+ assert(PyLong_Check(long_step));
+ step = PyLong_AsLong(long_step);
+ if (step != 1) {
+ fast_mode = 0;
+ if (step == -1 && PyErr_Occurred())
+ PyErr_Clear();
+ }
+ }
+
+ if (fast_mode)
+ Py_CLEAR(long_cnt);
+ else
+ cnt = PY_SSIZE_T_MAX;
+
+ assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL && fast_mode) ||
+ (cnt == PY_SSIZE_T_MAX && long_cnt != NULL && !fast_mode));
+ assert(!fast_mode ||
+ (PyLong_Check(long_step) && PyLong_AS_LONG(long_step) == 1));
+
+ /* create countobject structure */
+ lz = (countobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_XDECREF(long_cnt);
+ Py_DECREF(long_step);
+ return NULL;
+ }
+ lz->cnt = cnt;
+ lz->long_cnt = long_cnt;
+ lz->long_step = long_step;
+
+ return (PyObject *)lz;
+}
+
+static void
+count_dealloc(countobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->long_cnt);
+ Py_XDECREF(lz->long_step);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+count_traverse(countobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->long_cnt);
+ Py_VISIT(lz->long_step);
+ return 0;
+}
+
+static PyObject *
+count_nextlong(countobject *lz)
+{
+ PyObject *long_cnt;
+ PyObject *stepped_up;
+
+ long_cnt = lz->long_cnt;
+ if (long_cnt == NULL) {
+ /* Switch to slow_mode */
+ long_cnt = PyLong_FromSsize_t(PY_SSIZE_T_MAX);
+ if (long_cnt == NULL)
+ return NULL;
+ }
+ assert(lz->cnt == PY_SSIZE_T_MAX && long_cnt != NULL);
+
+ stepped_up = PyNumber_Add(long_cnt, lz->long_step);
+ if (stepped_up == NULL)
+ return NULL;
+ lz->long_cnt = stepped_up;
+ return long_cnt;
+}
+
+static PyObject *
+count_next(countobject *lz)
+{
+ if (lz->cnt == PY_SSIZE_T_MAX)
+ return count_nextlong(lz);
+ return PyLong_FromSsize_t(lz->cnt++);
+}
+
+static PyObject *
+count_repr(countobject *lz)
+{
+ if (lz->cnt != PY_SSIZE_T_MAX)
+ return PyUnicode_FromFormat("%s(%zd)",
+ _PyType_Name(Py_TYPE(lz)), lz->cnt);
+
+ if (PyLong_Check(lz->long_step)) {
+ long step = PyLong_AsLong(lz->long_step);
+ if (step == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ }
+ if (step == 1) {
+ /* Don't display step when it is an integer equal to 1 */
+ return PyUnicode_FromFormat("%s(%R)",
+ _PyType_Name(Py_TYPE(lz)),
+ lz->long_cnt);
+ }
+ }
+ return PyUnicode_FromFormat("%s(%R, %R)",
+ _PyType_Name(Py_TYPE(lz)),
+ lz->long_cnt, lz->long_step);
+}
+
+static PyObject *
+count_reduce(countobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ if (lz->cnt == PY_SSIZE_T_MAX)
+ return Py_BuildValue("O(OO)", Py_TYPE(lz), lz->long_cnt, lz->long_step);
+ return Py_BuildValue("O(n)", Py_TYPE(lz), lz->cnt);
+}
+
+static PyMethodDef count_methods[] = {
+ {"__reduce__", (PyCFunction)count_reduce, METH_NOARGS,
+ reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+static PyType_Slot count_slots[] = {
+ {Py_tp_dealloc, count_dealloc},
+ {Py_tp_repr, count_repr},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)itertools_count__doc__},
+ {Py_tp_traverse, count_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, count_next},
+ {Py_tp_methods, count_methods},
+ {Py_tp_new, itertools_count},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec count_spec = {
+ .name = "itertools.count",
+ .basicsize = sizeof(countobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = count_slots,
+};
+
+
+/* repeat object ************************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *element;
+ Py_ssize_t cnt;
+} repeatobject;
+
+static PyObject *
+repeat_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ repeatobject *ro;
+ PyObject *element;
+ Py_ssize_t cnt = -1, n_args;
+ static char *kwargs[] = {"object", "times", NULL};
+
+ n_args = PyTuple_GET_SIZE(args);
+ if (kwds != NULL)
+ n_args += PyDict_GET_SIZE(kwds);
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs,
+ &element, &cnt))
+ return NULL;
+ /* Does user supply times argument? */
+ if (n_args == 2 && cnt < 0)
+ cnt = 0;
+
+ ro = (repeatobject *)type->tp_alloc(type, 0);
+ if (ro == NULL)
+ return NULL;
+ ro->element = Py_NewRef(element);
+ ro->cnt = cnt;
+ return (PyObject *)ro;
+}
+
+static void
+repeat_dealloc(repeatobject *ro)
+{
+ PyTypeObject *tp = Py_TYPE(ro);
+ PyObject_GC_UnTrack(ro);
+ Py_XDECREF(ro->element);
+ tp->tp_free(ro);
+ Py_DECREF(tp);
+}
+
+static int
+repeat_traverse(repeatobject *ro, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(ro));
+ Py_VISIT(ro->element);
+ return 0;
+}
+
+static PyObject *
+repeat_next(repeatobject *ro)
+{
+ if (ro->cnt == 0)
+ return NULL;
+ if (ro->cnt > 0)
+ ro->cnt--;
+ return Py_NewRef(ro->element);
+}
+
+static PyObject *
+repeat_repr(repeatobject *ro)
+{
+ if (ro->cnt == -1)
+ return PyUnicode_FromFormat("%s(%R)",
+ _PyType_Name(Py_TYPE(ro)), ro->element);
+ else
+ return PyUnicode_FromFormat("%s(%R, %zd)",
+ _PyType_Name(Py_TYPE(ro)), ro->element,
+ ro->cnt);
+}
+
+static PyObject *
+repeat_len(repeatobject *ro, PyObject *Py_UNUSED(ignored))
+{
+ if (ro->cnt == -1) {
+ PyErr_SetString(PyExc_TypeError, "len() of unsized object");
+ return NULL;
+ }
+ return PyLong_FromSize_t(ro->cnt);
+}
+
+PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
+
+static PyObject *
+repeat_reduce(repeatobject *ro, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ /* unpickle this so that a new repeat iterator is constructed with an
+ * object, then call __setstate__ on it to set cnt
+ */
+ if (ro->cnt >= 0)
+ return Py_BuildValue("O(On)", Py_TYPE(ro), ro->element, ro->cnt);
+ else
+ return Py_BuildValue("O(O)", Py_TYPE(ro), ro->element);
+}
+
+static PyMethodDef repeat_methods[] = {
+ {"__length_hint__", (PyCFunction)repeat_len, METH_NOARGS, length_hint_doc},
+ {"__reduce__", (PyCFunction)repeat_reduce, METH_NOARGS, reduce_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(repeat_doc,
+"repeat(object [,times]) -> create an iterator which returns the object\n\
+for the specified number of times. If not specified, returns the object\n\
+endlessly.");
+
+static PyType_Slot repeat_slots[] = {
+ {Py_tp_dealloc, repeat_dealloc},
+ {Py_tp_repr, repeat_repr},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)repeat_doc},
+ {Py_tp_traverse, repeat_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, repeat_next},
+ {Py_tp_methods, repeat_methods},
+ {Py_tp_new, repeat_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec repeat_spec = {
+ .name = "itertools.repeat",
+ .basicsize = sizeof(repeatobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = repeat_slots,
+};
+
+
+/* ziplongest object *********************************************************/
+
+typedef struct {
+ PyObject_HEAD
+ Py_ssize_t tuplesize;
+ Py_ssize_t numactive;
+ PyObject *ittuple; /* tuple of iterators */
+ PyObject *result;
+ PyObject *fillvalue;
+} ziplongestobject;
+
+static PyObject *
+zip_longest_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ ziplongestobject *lz;
+ Py_ssize_t i;
+ PyObject *ittuple; /* tuple of iterators */
+ PyObject *result;
+ PyObject *fillvalue = Py_None;
+ Py_ssize_t tuplesize;
+
+ if (kwds != NULL && PyDict_CheckExact(kwds) && PyDict_GET_SIZE(kwds) > 0) {
+ fillvalue = NULL;
+ if (PyDict_GET_SIZE(kwds) == 1) {
+ fillvalue = PyDict_GetItemWithError(kwds, &_Py_ID(fillvalue));
+ }
+ if (fillvalue == NULL) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "zip_longest() got an unexpected keyword argument");
+ }
+ return NULL;
+ }
+ }
+
+ /* args must be a tuple */
+ assert(PyTuple_Check(args));
+ tuplesize = PyTuple_GET_SIZE(args);
+
+ /* obtain iterators */
+ ittuple = PyTuple_New(tuplesize);
+ if (ittuple == NULL)
+ return NULL;
+ for (i=0; i < tuplesize; i++) {
+ PyObject *item = PyTuple_GET_ITEM(args, i);
+ PyObject *it = PyObject_GetIter(item);
+ if (it == NULL) {
+ Py_DECREF(ittuple);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(ittuple, i, it);
+ }
+
+ /* create a result holder */
+ result = PyTuple_New(tuplesize);
+ if (result == NULL) {
+ Py_DECREF(ittuple);
+ return NULL;
+ }
+ for (i=0 ; i < tuplesize ; i++) {
+ Py_INCREF(Py_None);
+ PyTuple_SET_ITEM(result, i, Py_None);
+ }
+
+ /* create ziplongestobject structure */
+ lz = (ziplongestobject *)type->tp_alloc(type, 0);
+ if (lz == NULL) {
+ Py_DECREF(ittuple);
+ Py_DECREF(result);
+ return NULL;
+ }
+ lz->ittuple = ittuple;
+ lz->tuplesize = tuplesize;
+ lz->numactive = tuplesize;
+ lz->result = result;
+ lz->fillvalue = Py_NewRef(fillvalue);
+ return (PyObject *)lz;
+}
+
+static void
+zip_longest_dealloc(ziplongestobject *lz)
+{
+ PyTypeObject *tp = Py_TYPE(lz);
+ PyObject_GC_UnTrack(lz);
+ Py_XDECREF(lz->ittuple);
+ Py_XDECREF(lz->result);
+ Py_XDECREF(lz->fillvalue);
+ tp->tp_free(lz);
+ Py_DECREF(tp);
+}
+
+static int
+zip_longest_traverse(ziplongestobject *lz, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(lz));
+ Py_VISIT(lz->ittuple);
+ Py_VISIT(lz->result);
+ Py_VISIT(lz->fillvalue);
+ return 0;
+}
+
+static PyObject *
+zip_longest_next(ziplongestobject *lz)
+{
+ Py_ssize_t i;
+ Py_ssize_t tuplesize = lz->tuplesize;
+ PyObject *result = lz->result;
+ PyObject *it;
+ PyObject *item;
+ PyObject *olditem;
+
+ if (tuplesize == 0)
+ return NULL;
+ if (lz->numactive == 0)
+ return NULL;
+ if (Py_REFCNT(result) == 1) {
+ Py_INCREF(result);
+ for (i=0 ; i < tuplesize ; i++) {
+ it = PyTuple_GET_ITEM(lz->ittuple, i);
+ if (it == NULL) {
+ item = Py_NewRef(lz->fillvalue);
+ } else {
+ item = PyIter_Next(it);
+ if (item == NULL) {
+ lz->numactive -= 1;
+ if (lz->numactive == 0 || PyErr_Occurred()) {
+ lz->numactive = 0;
+ Py_DECREF(result);
+ return NULL;
+ } else {
+ item = Py_NewRef(lz->fillvalue);
+ PyTuple_SET_ITEM(lz->ittuple, i, NULL);
+ Py_DECREF(it);
+ }
+ }
+ }
+ olditem = PyTuple_GET_ITEM(result, i);
+ PyTuple_SET_ITEM(result, i, item);
+ Py_DECREF(olditem);
+ }
+ // bpo-42536: The GC may have untracked this result tuple. Since we're
+ // recycling it, make sure it's tracked again:
+ if (!_PyObject_GC_IS_TRACKED(result)) {
+ _PyObject_GC_TRACK(result);
+ }
+ } else {
+ result = PyTuple_New(tuplesize);
+ if (result == NULL)
+ return NULL;
+ for (i=0 ; i < tuplesize ; i++) {
+ it = PyTuple_GET_ITEM(lz->ittuple, i);
+ if (it == NULL) {
+ item = Py_NewRef(lz->fillvalue);
+ } else {
+ item = PyIter_Next(it);
+ if (item == NULL) {
+ lz->numactive -= 1;
+ if (lz->numactive == 0 || PyErr_Occurred()) {
+ lz->numactive = 0;
+ Py_DECREF(result);
+ return NULL;
+ } else {
+ item = Py_NewRef(lz->fillvalue);
+ PyTuple_SET_ITEM(lz->ittuple, i, NULL);
+ Py_DECREF(it);
+ }
+ }
+ }
+ PyTuple_SET_ITEM(result, i, item);
+ }
+ }
+ return result;
+}
+
+static PyObject *
+zip_longest_reduce(ziplongestobject *lz, PyObject *Py_UNUSED(ignored))
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ /* Create a new tuple with empty sequences where appropriate to pickle.
+ * Then use setstate to set the fillvalue
+ */
+ int i;
+ PyObject *args = PyTuple_New(PyTuple_GET_SIZE(lz->ittuple));
+
+ if (args == NULL)
+ return NULL;
+ for (i=0; i<PyTuple_GET_SIZE(lz->ittuple); i++) {
+ PyObject *elem = PyTuple_GET_ITEM(lz->ittuple, i);
+ if (elem == NULL) {
+ elem = PyTuple_New(0);
+ if (elem == NULL) {
+ Py_DECREF(args);
+ return NULL;
+ }
+ } else
+ Py_INCREF(elem);
+ PyTuple_SET_ITEM(args, i, elem);
+ }
+ return Py_BuildValue("ONO", Py_TYPE(lz), args, lz->fillvalue);
+}
+
+static PyObject *
+zip_longest_setstate(ziplongestobject *lz, PyObject *state)
+{
+ ITERTOOL_PICKLE_DEPRECATION;
+ Py_INCREF(state);
+ Py_XSETREF(lz->fillvalue, state);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef zip_longest_methods[] = {
+ {"__reduce__", (PyCFunction)zip_longest_reduce, METH_NOARGS,
+ reduce_doc},
+ {"__setstate__", (PyCFunction)zip_longest_setstate, METH_O,
+ setstate_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(zip_longest_doc,
+"zip_longest(iter1 [,iter2 [...]], [fillvalue=None]) --> zip_longest object\n\
+\n\
+Return a zip_longest object whose .__next__() method returns a tuple where\n\
+the i-th element comes from the i-th iterable argument. The .__next__()\n\
+method continues until the longest iterable in the argument sequence\n\
+is exhausted and then it raises StopIteration. When the shorter iterables\n\
+are exhausted, the fillvalue is substituted in their place. The fillvalue\n\
+defaults to None or can be specified by a keyword argument.\n\
+");
+
+static PyType_Slot ziplongest_slots[] = {
+ {Py_tp_dealloc, zip_longest_dealloc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_doc, (void *)zip_longest_doc},
+ {Py_tp_traverse, zip_longest_traverse},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, zip_longest_next},
+ {Py_tp_methods, zip_longest_methods},
+ {Py_tp_new, zip_longest_new},
+ {Py_tp_free, PyObject_GC_Del},
+ {0, NULL},
+};
+
+static PyType_Spec ziplongest_spec = {
+ .name = "itertools.zip_longest",
+ .basicsize = sizeof(ziplongestobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = ziplongest_slots,
+};
+
+
+/* module level code ********************************************************/
+
+PyDoc_STRVAR(module_doc,
+"Functional tools for creating and using iterators.\n\
+\n\
+Infinite iterators:\n\
+count(start=0, step=1) --> start, start+step, start+2*step, ...\n\
+cycle(p) --> p0, p1, ... plast, p0, p1, ...\n\
+repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times\n\
+\n\
+Iterators terminating on the shortest input sequence:\n\
+accumulate(p[, func]) --> p0, p0+p1, p0+p1+p2\n\
+batched(p, n) --> [p0, p1, ..., p_n-1], [p_n, p_n+1, ..., p_2n-1], ...\n\
+chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...\n\
+chain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ...\n\
+compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...\n\
+dropwhile(pred, seq) --> seq[n], seq[n+1], starting when pred fails\n\
+groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)\n\
+filterfalse(pred, seq) --> elements of seq where pred(elem) is False\n\
+islice(seq, [start,] stop [, step]) --> elements from\n\
+ seq[start:stop:step]\n\
+pairwise(s) --> (s[0],s[1]), (s[1],s[2]), (s[2], s[3]), ...\n\
+starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\n\
+tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n\n\
+takewhile(pred, seq) --> seq[0], seq[1], until pred fails\n\
+zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...\n\
+\n\
+Combinatoric generators:\n\
+product(p, q, ... [repeat=1]) --> cartesian product\n\
+permutations(p[, r])\n\
+combinations(p, r)\n\
+combinations_with_replacement(p, r)\n\
+");
+
+static int
+itertoolsmodule_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ itertools_state *state = get_module_state(mod);
+ Py_VISIT(state->accumulate_type);
+ Py_VISIT(state->batched_type);
+ Py_VISIT(state->chain_type);
+ Py_VISIT(state->combinations_type);
+ Py_VISIT(state->compress_type);
+ Py_VISIT(state->count_type);
+ Py_VISIT(state->cwr_type);
+ Py_VISIT(state->cycle_type);
+ Py_VISIT(state->dropwhile_type);
+ Py_VISIT(state->filterfalse_type);
+ Py_VISIT(state->groupby_type);
+ Py_VISIT(state->_grouper_type);
+ Py_VISIT(state->islice_type);
+ Py_VISIT(state->pairwise_type);
+ Py_VISIT(state->permutations_type);
+ Py_VISIT(state->product_type);
+ Py_VISIT(state->repeat_type);
+ Py_VISIT(state->starmap_type);
+ Py_VISIT(state->takewhile_type);
+ Py_VISIT(state->tee_type);
+ Py_VISIT(state->teedataobject_type);
+ Py_VISIT(state->ziplongest_type);
+ return 0;
+}
+
+static int
+itertoolsmodule_clear(PyObject *mod)
+{
+ itertools_state *state = get_module_state(mod);
+ Py_CLEAR(state->accumulate_type);
+ Py_CLEAR(state->batched_type);
+ Py_CLEAR(state->chain_type);
+ Py_CLEAR(state->combinations_type);
+ Py_CLEAR(state->compress_type);
+ Py_CLEAR(state->count_type);
+ Py_CLEAR(state->cwr_type);
+ Py_CLEAR(state->cycle_type);
+ Py_CLEAR(state->dropwhile_type);
+ Py_CLEAR(state->filterfalse_type);
+ Py_CLEAR(state->groupby_type);
+ Py_CLEAR(state->_grouper_type);
+ Py_CLEAR(state->islice_type);
+ Py_CLEAR(state->pairwise_type);
+ Py_CLEAR(state->permutations_type);
+ Py_CLEAR(state->product_type);
+ Py_CLEAR(state->repeat_type);
+ Py_CLEAR(state->starmap_type);
+ Py_CLEAR(state->takewhile_type);
+ Py_CLEAR(state->tee_type);
+ Py_CLEAR(state->teedataobject_type);
+ Py_CLEAR(state->ziplongest_type);
+ return 0;
+}
+
+static void
+itertoolsmodule_free(void *mod)
+{
+ (void)itertoolsmodule_clear((PyObject *)mod);
+}
+
+#define ADD_TYPE(module, type, spec) \
+do { \
+ type = (PyTypeObject *)PyType_FromModuleAndSpec(module, spec, NULL); \
+ if (type == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddType(module, type) < 0) { \
+ return -1; \
+ } \
+} while (0)
+
+static int
+itertoolsmodule_exec(PyObject *mod)
+{
+ itertools_state *state = get_module_state(mod);
+ ADD_TYPE(mod, state->accumulate_type, &accumulate_spec);
+ ADD_TYPE(mod, state->batched_type, &batched_spec);
+ ADD_TYPE(mod, state->chain_type, &chain_spec);
+ ADD_TYPE(mod, state->combinations_type, &combinations_spec);
+ ADD_TYPE(mod, state->compress_type, &compress_spec);
+ ADD_TYPE(mod, state->count_type, &count_spec);
+ ADD_TYPE(mod, state->cwr_type, &cwr_spec);
+ ADD_TYPE(mod, state->cycle_type, &cycle_spec);
+ ADD_TYPE(mod, state->dropwhile_type, &dropwhile_spec);
+ ADD_TYPE(mod, state->filterfalse_type, &filterfalse_spec);
+ ADD_TYPE(mod, state->groupby_type, &groupby_spec);
+ ADD_TYPE(mod, state->_grouper_type, &_grouper_spec);
+ ADD_TYPE(mod, state->islice_type, &islice_spec);
+ ADD_TYPE(mod, state->pairwise_type, &pairwise_spec);
+ ADD_TYPE(mod, state->permutations_type, &permutations_spec);
+ ADD_TYPE(mod, state->product_type, &product_spec);
+ ADD_TYPE(mod, state->repeat_type, &repeat_spec);
+ ADD_TYPE(mod, state->starmap_type, &starmap_spec);
+ ADD_TYPE(mod, state->takewhile_type, &takewhile_spec);
+ ADD_TYPE(mod, state->tee_type, &tee_spec);
+ ADD_TYPE(mod, state->teedataobject_type, &teedataobject_spec);
+ ADD_TYPE(mod, state->ziplongest_type, &ziplongest_spec);
+
+ Py_SET_TYPE(state->teedataobject_type, &PyType_Type);
+ return 0;
+}
+
+static struct PyModuleDef_Slot itertoolsmodule_slots[] = {
+ {Py_mod_exec, itertoolsmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static PyMethodDef module_methods[] = {
+ ITERTOOLS_TEE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+static struct PyModuleDef itertoolsmodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "itertools",
+ .m_doc = module_doc,
+ .m_size = sizeof(itertools_state),
+ .m_methods = module_methods,
+ .m_slots = itertoolsmodule_slots,
+ .m_traverse = itertoolsmodule_traverse,
+ .m_clear = itertoolsmodule_clear,
+ .m_free = itertoolsmodule_free,
+};
+
+PyMODINIT_FUNC
+PyInit_itertools(void)
+{
+ return PyModuleDef_Init(&itertoolsmodule);
+}
diff --git a/contrib/tools/python3/Modules/main.c b/contrib/tools/python3/Modules/main.c
new file mode 100644
index 00000000000..40dafa2c7b7
--- /dev/null
+++ b/contrib/tools/python3/Modules/main.c
@@ -0,0 +1,769 @@
+/* Python interpreter main program */
+
+#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_initconfig.h" // _PyArgv
+#include "pycore_interp.h" // _PyInterpreterState.sysdict
+#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0()
+#include "pycore_pylifecycle.h" // _Py_PreInitializeFromPyArgv()
+#include "pycore_pystate.h" // _PyInterpreterState_GET()
+
+/* Includes for exit_sigint() */
+#include <stdio.h> // perror()
+#ifdef HAVE_SIGNAL_H
+# include <signal.h> // SIGINT
+#endif
+#if defined(HAVE_GETPID) && defined(HAVE_UNISTD_H)
+# include <unistd.h> // getpid()
+#endif
+#ifdef MS_WINDOWS
+# include <windows.h> // STATUS_CONTROL_C_EXIT
+#endif
+/* End of includes for exit_sigint() */
+
+#define COPYRIGHT \
+ "Type \"help\", \"copyright\", \"credits\" or \"license\" " \
+ "for more information."
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* --- pymain_init() ---------------------------------------------- */
+
+static PyStatus
+pymain_init(const _PyArgv *args)
+{
+ PyStatus status;
+
+ status = _PyRuntime_Initialize();
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+
+ PyPreConfig preconfig;
+ PyPreConfig_InitPythonConfig(&preconfig);
+
+ status = _Py_PreInitializeFromPyArgv(&preconfig, args);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+
+ PyConfig config;
+ PyConfig_InitPythonConfig(&config);
+ config.pathconfig_warnings = 0; /* Suppress errors from getpath.c */
+
+ /* pass NULL as the config: config is read from command line arguments,
+ environment variables, configuration files */
+ if (args->use_bytes_argv) {
+ status = PyConfig_SetBytesArgv(&config, args->argc, args->bytes_argv);
+ }
+ else {
+ status = PyConfig_SetArgv(&config, args->argc, args->wchar_argv);
+ }
+ if (_PyStatus_EXCEPTION(status)) {
+ goto done;
+ }
+
+ status = Py_InitializeFromConfig(&config);
+ if (_PyStatus_EXCEPTION(status)) {
+ goto done;
+ }
+ status = _PyStatus_OK();
+
+done:
+ PyConfig_Clear(&config);
+ return status;
+}
+
+
+/* --- pymain_run_python() ---------------------------------------- */
+
+/* Non-zero if filename, command (-c) or module (-m) is set
+ on the command line */
+static inline int config_run_code(const PyConfig *config)
+{
+ return (config->run_command != NULL
+ || config->run_filename != NULL
+ || config->run_module != NULL);
+}
+
+
+/* Return non-zero if stdin is a TTY or if -i command line option is used */
+static int
+stdin_is_interactive(const PyConfig *config)
+{
+ return (isatty(fileno(stdin)) || config->interactive);
+}
+
+
+/* Display the current Python exception and return an exitcode */
+static int
+pymain_err_print(int *exitcode_p)
+{
+ int exitcode;
+ if (_Py_HandleSystemExit(&exitcode)) {
+ *exitcode_p = exitcode;
+ return 1;
+ }
+
+ PyErr_Print();
+ return 0;
+}
+
+
+static int
+pymain_exit_err_print(void)
+{
+ int exitcode = 1;
+ pymain_err_print(&exitcode);
+ return exitcode;
+}
+
+
+/* Write an exitcode into *exitcode and return 1 if we have to exit Python.
+ Return 0 otherwise. */
+static int
+pymain_get_importer(const wchar_t *filename, PyObject **importer_p, int *exitcode)
+{
+ PyObject *sys_path0 = NULL, *importer;
+
+ sys_path0 = PyUnicode_FromWideChar(filename, wcslen(filename));
+ if (sys_path0 == NULL) {
+ goto error;
+ }
+
+ importer = PyImport_GetImporter(sys_path0);
+ if (importer == NULL) {
+ goto error;
+ }
+
+ if (importer == Py_None) {
+ Py_DECREF(sys_path0);
+ Py_DECREF(importer);
+ return 0;
+ }
+
+ Py_DECREF(importer);
+ *importer_p = sys_path0;
+ return 0;
+
+error:
+ Py_XDECREF(sys_path0);
+
+ PySys_WriteStderr("Failed checking if argv[0] is an import path entry\n");
+ return pymain_err_print(exitcode);
+}
+
+
+static int
+pymain_sys_path_add_path0(PyInterpreterState *interp, PyObject *path0)
+{
+ PyObject *sys_path;
+ PyObject *sysdict = interp->sysdict;
+ if (sysdict != NULL) {
+ sys_path = PyDict_GetItemWithError(sysdict, &_Py_ID(path));
+ if (sys_path == NULL && PyErr_Occurred()) {
+ return -1;
+ }
+ }
+ else {
+ sys_path = NULL;
+ }
+ if (sys_path == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "unable to get sys.path");
+ return -1;
+ }
+
+ if (PyList_Insert(sys_path, 0, path0)) {
+ return -1;
+ }
+ return 0;
+}
+
+
+static void
+pymain_header(const PyConfig *config)
+{
+ if (config->quiet) {
+ return;
+ }
+
+ if (!config->verbose && (config_run_code(config) || !stdin_is_interactive(config))) {
+ return;
+ }
+
+ fprintf(stderr, "Python %s on %s\n", Py_GetVersion(), Py_GetPlatform());
+ if (config->site_import) {
+ fprintf(stderr, "%s\n", COPYRIGHT);
+ }
+}
+
+
+static void
+pymain_import_readline(const PyConfig *config)
+{
+ if (config->isolated) {
+ return;
+ }
+ if (!config->inspect && config_run_code(config)) {
+ return;
+ }
+ if (!isatty(fileno(stdin))) {
+ return;
+ }
+
+ PyObject *mod = PyImport_ImportModule("readline");
+ if (mod == NULL) {
+ PyErr_Clear();
+ }
+ else {
+ Py_DECREF(mod);
+ }
+ mod = PyImport_ImportModule("rlcompleter");
+ if (mod == NULL) {
+ PyErr_Clear();
+ }
+ else {
+ Py_DECREF(mod);
+ }
+}
+
+
+static int
+pymain_run_command(wchar_t *command)
+{
+ PyObject *unicode, *bytes;
+ int ret;
+
+ unicode = PyUnicode_FromWideChar(command, -1);
+ if (unicode == NULL) {
+ goto error;
+ }
+
+ if (PySys_Audit("cpython.run_command", "O", unicode) < 0) {
+ return pymain_exit_err_print();
+ }
+
+ bytes = PyUnicode_AsUTF8String(unicode);
+ Py_DECREF(unicode);
+ if (bytes == NULL) {
+ goto error;
+ }
+
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ cf.cf_flags |= PyCF_IGNORE_COOKIE;
+ ret = PyRun_SimpleStringFlags(PyBytes_AsString(bytes), &cf);
+ Py_DECREF(bytes);
+ return (ret != 0);
+
+error:
+ PySys_WriteStderr("Unable to decode the command from the command line:\n");
+ return pymain_exit_err_print();
+}
+
+
+static int
+pymain_run_module(const wchar_t *modname, int set_argv0)
+{
+ PyObject *module, *runpy, *runmodule, *runargs, *result;
+ if (PySys_Audit("cpython.run_module", "u", modname) < 0) {
+ return pymain_exit_err_print();
+ }
+ runpy = PyImport_ImportModule("runpy");
+ if (runpy == NULL) {
+ fprintf(stderr, "Could not import runpy module\n");
+ return pymain_exit_err_print();
+ }
+ runmodule = PyObject_GetAttrString(runpy, "_run_module_as_main");
+ if (runmodule == NULL) {
+ fprintf(stderr, "Could not access runpy._run_module_as_main\n");
+ Py_DECREF(runpy);
+ return pymain_exit_err_print();
+ }
+ module = PyUnicode_FromWideChar(modname, wcslen(modname));
+ if (module == NULL) {
+ fprintf(stderr, "Could not convert module name to unicode\n");
+ Py_DECREF(runpy);
+ Py_DECREF(runmodule);
+ return pymain_exit_err_print();
+ }
+ runargs = PyTuple_Pack(2, module, set_argv0 ? Py_True : Py_False);
+ if (runargs == NULL) {
+ fprintf(stderr,
+ "Could not create arguments for runpy._run_module_as_main\n");
+ Py_DECREF(runpy);
+ Py_DECREF(runmodule);
+ Py_DECREF(module);
+ return pymain_exit_err_print();
+ }
+ _PyRuntime.signals.unhandled_keyboard_interrupt = 0;
+ result = PyObject_Call(runmodule, runargs, NULL);
+ if (!result && PyErr_Occurred() == PyExc_KeyboardInterrupt) {
+ _PyRuntime.signals.unhandled_keyboard_interrupt = 1;
+ }
+ Py_DECREF(runpy);
+ Py_DECREF(runmodule);
+ Py_DECREF(module);
+ Py_DECREF(runargs);
+ if (result == NULL) {
+ return pymain_exit_err_print();
+ }
+ Py_DECREF(result);
+ return 0;
+}
+
+
+static int
+pymain_run_file_obj(PyObject *program_name, PyObject *filename,
+ int skip_source_first_line)
+{
+ if (PySys_Audit("cpython.run_file", "O", filename) < 0) {
+ return pymain_exit_err_print();
+ }
+
+ FILE *fp = _Py_fopen_obj(filename, "rb");
+ if (fp == NULL) {
+ // Ignore the OSError
+ PyErr_Clear();
+ PySys_FormatStderr("%S: can't open file %R: [Errno %d] %s\n",
+ program_name, filename, errno, strerror(errno));
+ return 2;
+ }
+
+ if (skip_source_first_line) {
+ int ch;
+ /* Push back first newline so line numbers remain the same */
+ while ((ch = getc(fp)) != EOF) {
+ if (ch == '\n') {
+ (void)ungetc(ch, fp);
+ break;
+ }
+ }
+ }
+
+ struct _Py_stat_struct sb;
+ if (_Py_fstat_noraise(fileno(fp), &sb) == 0 && S_ISDIR(sb.st_mode)) {
+ PySys_FormatStderr("%S: %R is a directory, cannot continue\n",
+ program_name, filename);
+ fclose(fp);
+ return 1;
+ }
+
+ // Call pending calls like signal handlers (SIGINT)
+ if (Py_MakePendingCalls() == -1) {
+ fclose(fp);
+ return pymain_exit_err_print();
+ }
+
+ /* PyRun_AnyFileExFlags(closeit=1) calls fclose(fp) before running code */
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ int run = _PyRun_AnyFileObject(fp, filename, 1, &cf);
+ return (run != 0);
+}
+
+static int
+pymain_run_file(const PyConfig *config)
+{
+ PyObject *filename = PyUnicode_FromWideChar(config->run_filename, -1);
+ if (filename == NULL) {
+ PyErr_Print();
+ return -1;
+ }
+ PyObject *program_name = PyUnicode_FromWideChar(config->program_name, -1);
+ if (program_name == NULL) {
+ Py_DECREF(filename);
+ PyErr_Print();
+ return -1;
+ }
+
+ int res = pymain_run_file_obj(program_name, filename,
+ config->skip_source_first_line);
+ Py_DECREF(filename);
+ Py_DECREF(program_name);
+ return res;
+}
+
+
+static int
+pymain_run_startup(PyConfig *config, int *exitcode)
+{
+ int ret;
+ if (!config->use_environment) {
+ return 0;
+ }
+ PyObject *startup = NULL;
+#ifdef MS_WINDOWS
+ const wchar_t *env = _wgetenv(L"PYTHONSTARTUP");
+ if (env == NULL || env[0] == L'\0') {
+ return 0;
+ }
+ startup = PyUnicode_FromWideChar(env, wcslen(env));
+ if (startup == NULL) {
+ goto error;
+ }
+#else
+ const char *env = _Py_GetEnv(config->use_environment, "PYTHONSTARTUP");
+ if (env == NULL) {
+ return 0;
+ }
+ startup = PyUnicode_DecodeFSDefault(env);
+ if (startup == NULL) {
+ goto error;
+ }
+#endif
+ if (PySys_Audit("cpython.run_startup", "O", startup) < 0) {
+ goto error;
+ }
+
+ FILE *fp = _Py_fopen_obj(startup, "r");
+ if (fp == NULL) {
+ int save_errno = errno;
+ PyErr_Clear();
+ PySys_WriteStderr("Could not open PYTHONSTARTUP\n");
+
+ errno = save_errno;
+ PyErr_SetFromErrnoWithFilenameObjects(PyExc_OSError, startup, NULL);
+ goto error;
+ }
+
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ (void) _PyRun_SimpleFileObject(fp, startup, 0, &cf);
+ PyErr_Clear();
+ fclose(fp);
+ ret = 0;
+
+done:
+ Py_XDECREF(startup);
+ return ret;
+
+error:
+ ret = pymain_err_print(exitcode);
+ goto done;
+}
+
+
+/* Write an exitcode into *exitcode and return 1 if we have to exit Python.
+ Return 0 otherwise. */
+static int
+pymain_run_interactive_hook(int *exitcode)
+{
+ PyObject *sys, *hook, *result;
+ sys = PyImport_ImportModule("sys");
+ if (sys == NULL) {
+ goto error;
+ }
+
+ hook = PyObject_GetAttrString(sys, "__interactivehook__");
+ Py_DECREF(sys);
+ if (hook == NULL) {
+ PyErr_Clear();
+ return 0;
+ }
+
+ if (PySys_Audit("cpython.run_interactivehook", "O", hook) < 0) {
+ goto error;
+ }
+
+ result = _PyObject_CallNoArgs(hook);
+ Py_DECREF(hook);
+ if (result == NULL) {
+ goto error;
+ }
+ Py_DECREF(result);
+
+ return 0;
+
+error:
+ PySys_WriteStderr("Failed calling sys.__interactivehook__\n");
+ return pymain_err_print(exitcode);
+}
+
+
+static void
+pymain_set_inspect(PyConfig *config, int inspect)
+{
+ config->inspect = inspect;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
+ Py_InspectFlag = inspect;
+_Py_COMP_DIAG_POP
+}
+
+
+static int
+pymain_run_stdin(PyConfig *config)
+{
+ if (stdin_is_interactive(config)) {
+ // do exit on SystemExit
+ pymain_set_inspect(config, 0);
+
+ int exitcode;
+ if (pymain_run_startup(config, &exitcode)) {
+ return exitcode;
+ }
+
+ if (pymain_run_interactive_hook(&exitcode)) {
+ return exitcode;
+ }
+ }
+
+ /* call pending calls like signal handlers (SIGINT) */
+ if (Py_MakePendingCalls() == -1) {
+ return pymain_exit_err_print();
+ }
+
+ if (PySys_Audit("cpython.run_stdin", NULL) < 0) {
+ return pymain_exit_err_print();
+ }
+
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ int run = PyRun_AnyFileExFlags(stdin, "<stdin>", 0, &cf);
+ return (run != 0);
+}
+
+
+static void
+pymain_repl(PyConfig *config, int *exitcode)
+{
+ /* Check this environment variable at the end, to give programs the
+ opportunity to set it from Python. */
+ if (!config->inspect && _Py_GetEnv(config->use_environment, "PYTHONINSPECT")) {
+ pymain_set_inspect(config, 1);
+ }
+
+ if (!(config->inspect && stdin_is_interactive(config) && config_run_code(config))) {
+ return;
+ }
+
+ pymain_set_inspect(config, 0);
+ if (pymain_run_interactive_hook(exitcode)) {
+ return;
+ }
+
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ int res = PyRun_AnyFileFlags(stdin, "<stdin>", &cf);
+ *exitcode = (res != 0);
+}
+
+
+static void
+pymain_run_python(int *exitcode)
+{
+ PyObject *main_importer_path = NULL;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ /* pymain_run_stdin() modify the config */
+ PyConfig *config = (PyConfig*)_PyInterpreterState_GetConfig(interp);
+
+ /* ensure path config is written into global variables */
+ if (_PyStatus_EXCEPTION(_PyPathConfig_UpdateGlobal(config))) {
+ goto error;
+ }
+
+ assert(interp->runtime->sys_path_0 == NULL);
+
+ if (config->run_filename != NULL) {
+ /* If filename is a package (ex: directory or ZIP file) which contains
+ __main__.py, main_importer_path is set to filename and will be
+ prepended to sys.path.
+
+ Otherwise, main_importer_path is left unchanged. */
+ if (pymain_get_importer(config->run_filename, &main_importer_path,
+ exitcode)) {
+ return;
+ }
+ }
+
+ // import readline and rlcompleter before script dir is added to sys.path
+ pymain_import_readline(config);
+
+ PyObject *path0 = NULL;
+ if (main_importer_path != NULL) {
+ path0 = Py_NewRef(main_importer_path);
+ }
+ else if (!config->safe_path) {
+ int res = _PyPathConfig_ComputeSysPath0(&config->argv, &path0);
+ if (res < 0) {
+ goto error;
+ }
+ else if (res == 0) {
+ Py_CLEAR(path0);
+ }
+ }
+ if (path0 != NULL) {
+ wchar_t *wstr = PyUnicode_AsWideCharString(path0, NULL);
+ if (wstr == NULL) {
+ Py_DECREF(path0);
+ goto error;
+ }
+ PyMemAllocatorEx old_alloc;
+ _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
+ interp->runtime->sys_path_0 = _PyMem_RawWcsdup(wstr);
+ PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
+ PyMem_Free(wstr);
+ if (interp->runtime->sys_path_0 == NULL) {
+ Py_DECREF(path0);
+ goto error;
+ }
+ int res = pymain_sys_path_add_path0(interp, path0);
+ Py_DECREF(path0);
+ if (res < 0) {
+ goto error;
+ }
+ }
+
+ pymain_header(config);
+
+ _PyInterpreterState_SetRunningMain(interp);
+ assert(!PyErr_Occurred());
+
+ if (config->run_command) {
+ *exitcode = pymain_run_command(config->run_command);
+ }
+ else if (config->run_module) {
+ *exitcode = pymain_run_module(config->run_module, 1);
+ }
+ else if (main_importer_path != NULL) {
+ *exitcode = pymain_run_module(L"__main__", 0);
+ }
+ else if (config->run_filename != NULL) {
+ *exitcode = pymain_run_file(config);
+ }
+ else {
+ *exitcode = pymain_run_stdin(config);
+ }
+
+ pymain_repl(config, exitcode);
+ goto done;
+
+error:
+ *exitcode = pymain_exit_err_print();
+
+done:
+ _PyInterpreterState_SetNotRunningMain(interp);
+ Py_XDECREF(main_importer_path);
+}
+
+
+/* --- pymain_main() ---------------------------------------------- */
+
+static void
+pymain_free(void)
+{
+ _PyImport_Fini2();
+
+ /* Free global variables which cannot be freed in Py_Finalize():
+ configuration options set before Py_Initialize() which should
+ remain valid after Py_Finalize(), since
+ Py_Initialize()-Py_Finalize() can be called multiple times. */
+ _PyPathConfig_ClearGlobal();
+ _Py_ClearStandardStreamEncoding();
+ _Py_ClearArgcArgv();
+ _PyRuntime_Finalize();
+}
+
+
+static int
+exit_sigint(void)
+{
+ /* bpo-1054041: We need to exit via the
+ * SIG_DFL handler for SIGINT if KeyboardInterrupt went unhandled.
+ * If we don't, a calling process such as a shell may not know
+ * about the user's ^C. https://www.cons.org/cracauer/sigint.html */
+#if defined(HAVE_GETPID) && defined(HAVE_KILL) && !defined(MS_WINDOWS)
+ if (PyOS_setsig(SIGINT, SIG_DFL) == SIG_ERR) {
+ perror("signal"); /* Impossible in normal environments. */
+ } else {
+ kill(getpid(), SIGINT);
+ }
+ /* If setting SIG_DFL failed, or kill failed to terminate us,
+ * there isn't much else we can do aside from an error code. */
+#endif /* HAVE_GETPID && !MS_WINDOWS */
+#ifdef MS_WINDOWS
+ /* cmd.exe detects this, prints ^C, and offers to terminate. */
+ /* https://msdn.microsoft.com/en-us/library/cc704588.aspx */
+ return STATUS_CONTROL_C_EXIT;
+#else
+ return SIGINT + 128;
+#endif /* !MS_WINDOWS */
+}
+
+
+static void _Py_NO_RETURN
+pymain_exit_error(PyStatus status)
+{
+ if (_PyStatus_IS_EXIT(status)) {
+ /* If it's an error rather than a regular exit, leave Python runtime
+ alive: Py_ExitStatusException() uses the current exception and use
+ sys.stdout in this case. */
+ pymain_free();
+ }
+ Py_ExitStatusException(status);
+}
+
+
+int
+Py_RunMain(void)
+{
+ int exitcode = 0;
+
+ pymain_run_python(&exitcode);
+
+ if (Py_FinalizeEx() < 0) {
+ /* Value unlikely to be confused with a non-error exit status or
+ other special meaning */
+ exitcode = 120;
+ }
+
+ pymain_free();
+
+ if (_PyRuntime.signals.unhandled_keyboard_interrupt) {
+ exitcode = exit_sigint();
+ }
+
+ return exitcode;
+}
+
+
+static int
+pymain_main(_PyArgv *args)
+{
+ PyStatus status = pymain_init(args);
+ if (_PyStatus_IS_EXIT(status)) {
+ pymain_free();
+ return status.exitcode;
+ }
+ if (_PyStatus_EXCEPTION(status)) {
+ pymain_exit_error(status);
+ }
+
+ return Py_RunMain();
+}
+
+
+int
+Py_Main(int argc, wchar_t **argv)
+{
+ _PyArgv args = {
+ .argc = argc,
+ .use_bytes_argv = 0,
+ .bytes_argv = NULL,
+ .wchar_argv = argv};
+ return pymain_main(&args);
+}
+
+
+int
+Py_BytesMain(int argc, char **argv)
+{
+ _PyArgv args = {
+ .argc = argc,
+ .use_bytes_argv = 1,
+ .bytes_argv = argv,
+ .wchar_argv = NULL};
+ return pymain_main(&args);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/tools/python3/Modules/mathmodule.c b/contrib/tools/python3/Modules/mathmodule.c
new file mode 100644
index 00000000000..23fa2b18164
--- /dev/null
+++ b/contrib/tools/python3/Modules/mathmodule.c
@@ -0,0 +1,4160 @@
+/* Math module -- standard C math library functions, pi and e */
+
+/* Here are some comments from Tim Peters, extracted from the
+ discussion attached to http://bugs.python.org/issue1640. They
+ describe the general aims of the math module with respect to
+ special values, IEEE-754 floating-point exceptions, and Python
+ exceptions.
+
+These are the "spirit of 754" rules:
+
+1. If the mathematical result is a real number, but of magnitude too
+large to approximate by a machine float, overflow is signaled and the
+result is an infinity (with the appropriate sign).
+
+2. If the mathematical result is a real number, but of magnitude too
+small to approximate by a machine float, underflow is signaled and the
+result is a zero (with the appropriate sign).
+
+3. At a singularity (a value x such that the limit of f(y) as y
+approaches x exists and is an infinity), "divide by zero" is signaled
+and the result is an infinity (with the appropriate sign). This is
+complicated a little by that the left-side and right-side limits may
+not be the same; e.g., 1/x approaches +inf or -inf as x approaches 0
+from the positive or negative directions. In that specific case, the
+sign of the zero determines the result of 1/0.
+
+4. At a point where a function has no defined result in the extended
+reals (i.e., the reals plus an infinity or two), invalid operation is
+signaled and a NaN is returned.
+
+And these are what Python has historically /tried/ to do (but not
+always successfully, as platform libm behavior varies a lot):
+
+For #1, raise OverflowError.
+
+For #2, return a zero (with the appropriate sign if that happens by
+accident ;-)).
+
+For #3 and #4, raise ValueError. It may have made sense to raise
+Python's ZeroDivisionError in #3, but historically that's only been
+raised for division by zero and mod by zero.
+
+*/
+
+/*
+ In general, on an IEEE-754 platform the aim is to follow the C99
+ standard, including Annex 'F', whenever possible. Where the
+ standard recommends raising the 'divide-by-zero' or 'invalid'
+ floating-point exceptions, Python should raise a ValueError. Where
+ the standard recommends raising 'overflow', Python should raise an
+ OverflowError. In all other circumstances a value should be
+ returned.
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_bitutils.h" // _Py_bit_length()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_object.h" // _PyObject_LookupSpecial()
+#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
+/* For DBL_EPSILON in _math.h */
+#include <float.h>
+/* For _Py_log1p with workarounds for buggy handling of zeros. */
+#include "_math.h"
+#include <stdbool.h>
+
+#include "clinic/mathmodule.c.h"
+
+/*[clinic input]
+module math
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=76bc7002685dd942]*/
+
+
+typedef struct {
+ PyObject *str___ceil__;
+ PyObject *str___floor__;
+ PyObject *str___trunc__;
+} math_module_state;
+
+static inline math_module_state*
+get_math_module_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (math_module_state *)state;
+}
+
+/*
+Double and triple length extended precision algorithms from:
+
+ Accurate Sum and Dot Product
+ by Takeshi Ogita, Siegfried M. Rump, and Shin’Ichi Oishi
+ https://doi.org/10.1137/030601818
+ https://www.tuhh.de/ti3/paper/rump/OgRuOi05.pdf
+
+*/
+
+typedef struct{ double hi; double lo; } DoubleLength;
+
+static DoubleLength
+dl_fast_sum(double a, double b)
+{
+ /* Algorithm 1.1. Compensated summation of two floating point numbers. */
+ assert(fabs(a) >= fabs(b));
+ double x = a + b;
+ double y = (a - x) + b;
+ return (DoubleLength) {x, y};
+}
+
+static DoubleLength
+dl_sum(double a, double b)
+{
+ /* Algorithm 3.1 Error-free transformation of the sum */
+ double x = a + b;
+ double z = x - a;
+ double y = (a - (x - z)) + (b - z);
+ return (DoubleLength) {x, y};
+}
+
+#ifndef UNRELIABLE_FMA
+
+static DoubleLength
+dl_mul(double x, double y)
+{
+ /* Algorithm 3.5. Error-free transformation of a product */
+ double z = x * y;
+ double zz = fma(x, y, -z);
+ return (DoubleLength) {z, zz};
+}
+
+#else
+
+/*
+ The default implementation of dl_mul() depends on the C math library
+ having an accurate fma() function as required by § 7.12.13.1 of the
+ C99 standard.
+
+ The UNRELIABLE_FMA option is provided as a slower but accurate
+ alternative for builds where the fma() function is found wanting.
+ The speed penalty may be modest (17% slower on an Apple M1 Max),
+ so don't hesitate to enable this build option.
+
+ The algorithms are from the T. J. Dekker paper:
+ A Floating-Point Technique for Extending the Available Precision
+ https://csclub.uwaterloo.ca/~pbarfuss/dekker1971.pdf
+*/
+
+static DoubleLength
+dl_split(double x) {
+ // Dekker (5.5) and (5.6).
+ double t = x * 134217729.0; // Veltkamp constant = 2.0 ** 27 + 1
+ double hi = t - (t - x);
+ double lo = x - hi;
+ return (DoubleLength) {hi, lo};
+}
+
+static DoubleLength
+dl_mul(double x, double y)
+{
+ // Dekker (5.12) and mul12()
+ DoubleLength xx = dl_split(x);
+ DoubleLength yy = dl_split(y);
+ double p = xx.hi * yy.hi;
+ double q = xx.hi * yy.lo + xx.lo * yy.hi;
+ double z = p + q;
+ double zz = p - z + q + xx.lo * yy.lo;
+ return (DoubleLength) {z, zz};
+}
+
+#endif
+
+typedef struct { double hi; double lo; double tiny; } TripleLength;
+
+static const TripleLength tl_zero = {0.0, 0.0, 0.0};
+
+static TripleLength
+tl_fma(double x, double y, TripleLength total)
+{
+ /* Algorithm 5.10 with SumKVert for K=3 */
+ DoubleLength pr = dl_mul(x, y);
+ DoubleLength sm = dl_sum(total.hi, pr.hi);
+ DoubleLength r1 = dl_sum(total.lo, pr.lo);
+ DoubleLength r2 = dl_sum(r1.hi, sm.lo);
+ return (TripleLength) {sm.hi, r2.hi, total.tiny + r1.lo + r2.lo};
+}
+
+static double
+tl_to_d(TripleLength total)
+{
+ DoubleLength last = dl_sum(total.lo, total.hi);
+ return total.tiny + last.lo + last.hi;
+}
+
+
+/*
+ sin(pi*x), giving accurate results for all finite x (especially x
+ integral or close to an integer). This is here for use in the
+ reflection formula for the gamma function. It conforms to IEEE
+ 754-2008 for finite arguments, but not for infinities or nans.
+*/
+
+static const double pi = 3.141592653589793238462643383279502884197;
+static const double logpi = 1.144729885849400174143427351353058711647;
+
+/* Version of PyFloat_AsDouble() with in-line fast paths
+ for exact floats and integers. Gives a substantial
+ speed improvement for extracting float arguments.
+*/
+
+#define ASSIGN_DOUBLE(target_var, obj, error_label) \
+ if (PyFloat_CheckExact(obj)) { \
+ target_var = PyFloat_AS_DOUBLE(obj); \
+ } \
+ else if (PyLong_CheckExact(obj)) { \
+ target_var = PyLong_AsDouble(obj); \
+ if (target_var == -1.0 && PyErr_Occurred()) { \
+ goto error_label; \
+ } \
+ } \
+ else { \
+ target_var = PyFloat_AsDouble(obj); \
+ if (target_var == -1.0 && PyErr_Occurred()) { \
+ goto error_label; \
+ } \
+ }
+
+static double
+m_sinpi(double x)
+{
+ double y, r;
+ int n;
+ /* this function should only ever be called for finite arguments */
+ assert(Py_IS_FINITE(x));
+ y = fmod(fabs(x), 2.0);
+ n = (int)round(2.0*y);
+ assert(0 <= n && n <= 4);
+ switch (n) {
+ case 0:
+ r = sin(pi*y);
+ break;
+ case 1:
+ r = cos(pi*(y-0.5));
+ break;
+ case 2:
+ /* N.B. -sin(pi*(y-1.0)) is *not* equivalent: it would give
+ -0.0 instead of 0.0 when y == 1.0. */
+ r = sin(pi*(1.0-y));
+ break;
+ case 3:
+ r = -cos(pi*(y-1.5));
+ break;
+ case 4:
+ r = sin(pi*(y-2.0));
+ break;
+ default:
+ Py_UNREACHABLE();
+ }
+ return copysign(1.0, x)*r;
+}
+
+/* Implementation of the real gamma function. Kept here to work around
+ issues (see e.g. gh-70309) with quality of libm's tgamma/lgamma implementations
+ on various platforms (Windows, MacOS). In extensive but non-exhaustive
+ random tests, this function proved accurate to within <= 10 ulps across the
+ entire float domain. Note that accuracy may depend on the quality of the
+ system math functions, the pow function in particular. Special cases
+ follow C99 annex F. The parameters and method are tailored to platforms
+ whose double format is the IEEE 754 binary64 format.
+
+ Method: for x > 0.0 we use the Lanczos approximation with parameters N=13
+ and g=6.024680040776729583740234375; these parameters are amongst those
+ used by the Boost library. Following Boost (again), we re-express the
+ Lanczos sum as a rational function, and compute it that way. The
+ coefficients below were computed independently using MPFR, and have been
+ double-checked against the coefficients in the Boost source code.
+
+ For x < 0.0 we use the reflection formula.
+
+ There's one minor tweak that deserves explanation: Lanczos' formula for
+ Gamma(x) involves computing pow(x+g-0.5, x-0.5) / exp(x+g-0.5). For many x
+ values, x+g-0.5 can be represented exactly. However, in cases where it
+ can't be represented exactly the small error in x+g-0.5 can be magnified
+ significantly by the pow and exp calls, especially for large x. A cheap
+ correction is to multiply by (1 + e*g/(x+g-0.5)), where e is the error
+ involved in the computation of x+g-0.5 (that is, e = computed value of
+ x+g-0.5 - exact value of x+g-0.5). Here's the proof:
+
+ Correction factor
+ -----------------
+ Write x+g-0.5 = y-e, where y is exactly representable as an IEEE 754
+ double, and e is tiny. Then:
+
+ pow(x+g-0.5,x-0.5)/exp(x+g-0.5) = pow(y-e, x-0.5)/exp(y-e)
+ = pow(y, x-0.5)/exp(y) * C,
+
+ where the correction_factor C is given by
+
+ C = pow(1-e/y, x-0.5) * exp(e)
+
+ Since e is tiny, pow(1-e/y, x-0.5) ~ 1-(x-0.5)*e/y, and exp(x) ~ 1+e, so:
+
+ C ~ (1-(x-0.5)*e/y) * (1+e) ~ 1 + e*(y-(x-0.5))/y
+
+ But y-(x-0.5) = g+e, and g+e ~ g. So we get C ~ 1 + e*g/y, and
+
+ pow(x+g-0.5,x-0.5)/exp(x+g-0.5) ~ pow(y, x-0.5)/exp(y) * (1 + e*g/y),
+
+ Note that for accuracy, when computing r*C it's better to do
+
+ r + e*g/y*r;
+
+ than
+
+ r * (1 + e*g/y);
+
+ since the addition in the latter throws away most of the bits of
+ information in e*g/y.
+*/
+
+#define LANCZOS_N 13
+static const double lanczos_g = 6.024680040776729583740234375;
+static const double lanczos_g_minus_half = 5.524680040776729583740234375;
+static const double lanczos_num_coeffs[LANCZOS_N] = {
+ 23531376880.410759688572007674451636754734846804940,
+ 42919803642.649098768957899047001988850926355848959,
+ 35711959237.355668049440185451547166705960488635843,
+ 17921034426.037209699919755754458931112671403265390,
+ 6039542586.3520280050642916443072979210699388420708,
+ 1439720407.3117216736632230727949123939715485786772,
+ 248874557.86205415651146038641322942321632125127801,
+ 31426415.585400194380614231628318205362874684987640,
+ 2876370.6289353724412254090516208496135991145378768,
+ 186056.26539522349504029498971604569928220784236328,
+ 8071.6720023658162106380029022722506138218516325024,
+ 210.82427775157934587250973392071336271166969580291,
+ 2.5066282746310002701649081771338373386264310793408
+};
+
+/* denominator is x*(x+1)*...*(x+LANCZOS_N-2) */
+static const double lanczos_den_coeffs[LANCZOS_N] = {
+ 0.0, 39916800.0, 120543840.0, 150917976.0, 105258076.0, 45995730.0,
+ 13339535.0, 2637558.0, 357423.0, 32670.0, 1925.0, 66.0, 1.0};
+
+/* gamma values for small positive integers, 1 though NGAMMA_INTEGRAL */
+#define NGAMMA_INTEGRAL 23
+static const double gamma_integral[NGAMMA_INTEGRAL] = {
+ 1.0, 1.0, 2.0, 6.0, 24.0, 120.0, 720.0, 5040.0, 40320.0, 362880.0,
+ 3628800.0, 39916800.0, 479001600.0, 6227020800.0, 87178291200.0,
+ 1307674368000.0, 20922789888000.0, 355687428096000.0,
+ 6402373705728000.0, 121645100408832000.0, 2432902008176640000.0,
+ 51090942171709440000.0, 1124000727777607680000.0,
+};
+
+/* Lanczos' sum L_g(x), for positive x */
+
+static double
+lanczos_sum(double x)
+{
+ double num = 0.0, den = 0.0;
+ int i;
+ assert(x > 0.0);
+ /* evaluate the rational function lanczos_sum(x). For large
+ x, the obvious algorithm risks overflow, so we instead
+ rescale the denominator and numerator of the rational
+ function by x**(1-LANCZOS_N) and treat this as a
+ rational function in 1/x. This also reduces the error for
+ larger x values. The choice of cutoff point (5.0 below) is
+ somewhat arbitrary; in tests, smaller cutoff values than
+ this resulted in lower accuracy. */
+ if (x < 5.0) {
+ for (i = LANCZOS_N; --i >= 0; ) {
+ num = num * x + lanczos_num_coeffs[i];
+ den = den * x + lanczos_den_coeffs[i];
+ }
+ }
+ else {
+ for (i = 0; i < LANCZOS_N; i++) {
+ num = num / x + lanczos_num_coeffs[i];
+ den = den / x + lanczos_den_coeffs[i];
+ }
+ }
+ return num/den;
+}
+
+
+static double
+m_tgamma(double x)
+{
+ double absx, r, y, z, sqrtpow;
+
+ /* special cases */
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_NAN(x) || x > 0.0)
+ return x; /* tgamma(nan) = nan, tgamma(inf) = inf */
+ else {
+ errno = EDOM;
+ return Py_NAN; /* tgamma(-inf) = nan, invalid */
+ }
+ }
+ if (x == 0.0) {
+ errno = EDOM;
+ /* tgamma(+-0.0) = +-inf, divide-by-zero */
+ return copysign(Py_INFINITY, x);
+ }
+
+ /* integer arguments */
+ if (x == floor(x)) {
+ if (x < 0.0) {
+ errno = EDOM; /* tgamma(n) = nan, invalid for */
+ return Py_NAN; /* negative integers n */
+ }
+ if (x <= NGAMMA_INTEGRAL)
+ return gamma_integral[(int)x - 1];
+ }
+ absx = fabs(x);
+
+ /* tiny arguments: tgamma(x) ~ 1/x for x near 0 */
+ if (absx < 1e-20) {
+ r = 1.0/x;
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ return r;
+ }
+
+ /* large arguments: assuming IEEE 754 doubles, tgamma(x) overflows for
+ x > 200, and underflows to +-0.0 for x < -200, not a negative
+ integer. */
+ if (absx > 200.0) {
+ if (x < 0.0) {
+ return 0.0/m_sinpi(x);
+ }
+ else {
+ errno = ERANGE;
+ return Py_HUGE_VAL;
+ }
+ }
+
+ y = absx + lanczos_g_minus_half;
+ /* compute error in sum */
+ if (absx > lanczos_g_minus_half) {
+ /* note: the correction can be foiled by an optimizing
+ compiler that (incorrectly) thinks that an expression like
+ a + b - a - b can be optimized to 0.0. This shouldn't
+ happen in a standards-conforming compiler. */
+ double q = y - absx;
+ z = q - lanczos_g_minus_half;
+ }
+ else {
+ double q = y - lanczos_g_minus_half;
+ z = q - absx;
+ }
+ z = z * lanczos_g / y;
+ if (x < 0.0) {
+ r = -pi / m_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
+ r -= z * r;
+ if (absx < 140.0) {
+ r /= pow(y, absx - 0.5);
+ }
+ else {
+ sqrtpow = pow(y, absx / 2.0 - 0.25);
+ r /= sqrtpow;
+ r /= sqrtpow;
+ }
+ }
+ else {
+ r = lanczos_sum(absx) / exp(y);
+ r += z * r;
+ if (absx < 140.0) {
+ r *= pow(y, absx - 0.5);
+ }
+ else {
+ sqrtpow = pow(y, absx / 2.0 - 0.25);
+ r *= sqrtpow;
+ r *= sqrtpow;
+ }
+ }
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ return r;
+}
+
+/*
+ lgamma: natural log of the absolute value of the Gamma function.
+ For large arguments, Lanczos' formula works extremely well here.
+*/
+
+static double
+m_lgamma(double x)
+{
+ double r;
+ double absx;
+
+ /* special cases */
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_NAN(x))
+ return x; /* lgamma(nan) = nan */
+ else
+ return Py_HUGE_VAL; /* lgamma(+-inf) = +inf */
+ }
+
+ /* integer arguments */
+ if (x == floor(x) && x <= 2.0) {
+ if (x <= 0.0) {
+ errno = EDOM; /* lgamma(n) = inf, divide-by-zero for */
+ return Py_HUGE_VAL; /* integers n <= 0 */
+ }
+ else {
+ return 0.0; /* lgamma(1) = lgamma(2) = 0.0 */
+ }
+ }
+
+ absx = fabs(x);
+ /* tiny arguments: lgamma(x) ~ -log(fabs(x)) for small x */
+ if (absx < 1e-20)
+ return -log(absx);
+
+ /* Lanczos' formula. We could save a fraction of a ulp in accuracy by
+ having a second set of numerator coefficients for lanczos_sum that
+ absorbed the exp(-lanczos_g) term, and throwing out the lanczos_g
+ subtraction below; it's probably not worth it. */
+ r = log(lanczos_sum(absx)) - lanczos_g;
+ r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
+ if (x < 0.0)
+ /* Use reflection formula to get value for negative x. */
+ r = logpi - log(fabs(m_sinpi(absx))) - log(absx) - r;
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ return r;
+}
+
+/*
+ wrapper for atan2 that deals directly with special cases before
+ delegating to the platform libm for the remaining cases. This
+ is necessary to get consistent behaviour across platforms.
+ Windows, FreeBSD and alpha Tru64 are amongst platforms that don't
+ always follow C99.
+*/
+
+static double
+m_atan2(double y, double x)
+{
+ if (Py_IS_NAN(x) || Py_IS_NAN(y))
+ return Py_NAN;
+ if (Py_IS_INFINITY(y)) {
+ if (Py_IS_INFINITY(x)) {
+ if (copysign(1., x) == 1.)
+ /* atan2(+-inf, +inf) == +-pi/4 */
+ return copysign(0.25*Py_MATH_PI, y);
+ else
+ /* atan2(+-inf, -inf) == +-pi*3/4 */
+ return copysign(0.75*Py_MATH_PI, y);
+ }
+ /* atan2(+-inf, x) == +-pi/2 for finite x */
+ return copysign(0.5*Py_MATH_PI, y);
+ }
+ if (Py_IS_INFINITY(x) || y == 0.) {
+ if (copysign(1., x) == 1.)
+ /* atan2(+-y, +inf) = atan2(+-0, +x) = +-0. */
+ return copysign(0., y);
+ else
+ /* atan2(+-y, -inf) = atan2(+-0., -x) = +-pi. */
+ return copysign(Py_MATH_PI, y);
+ }
+ return atan2(y, x);
+}
+
+
+/* IEEE 754-style remainder operation: x - n*y where n*y is the nearest
+ multiple of y to x, taking n even in the case of a tie. Assuming an IEEE 754
+ binary floating-point format, the result is always exact. */
+
+static double
+m_remainder(double x, double y)
+{
+ /* Deal with most common case first. */
+ if (Py_IS_FINITE(x) && Py_IS_FINITE(y)) {
+ double absx, absy, c, m, r;
+
+ if (y == 0.0) {
+ return Py_NAN;
+ }
+
+ absx = fabs(x);
+ absy = fabs(y);
+ m = fmod(absx, absy);
+
+ /*
+ Warning: some subtlety here. What we *want* to know at this point is
+ whether the remainder m is less than, equal to, or greater than half
+ of absy. However, we can't do that comparison directly because we
+ can't be sure that 0.5*absy is representable (the multiplication
+ might incur precision loss due to underflow). So instead we compare
+ m with the complement c = absy - m: m < 0.5*absy if and only if m <
+ c, and so on. The catch is that absy - m might also not be
+ representable, but it turns out that it doesn't matter:
+
+ - if m > 0.5*absy then absy - m is exactly representable, by
+ Sterbenz's lemma, so m > c
+ - if m == 0.5*absy then again absy - m is exactly representable
+ and m == c
+ - if m < 0.5*absy then either (i) 0.5*absy is exactly representable,
+ in which case 0.5*absy < absy - m, so 0.5*absy <= c and hence m <
+ c, or (ii) absy is tiny, either subnormal or in the lowest normal
+ binade. Then absy - m is exactly representable and again m < c.
+ */
+
+ c = absy - m;
+ if (m < c) {
+ r = m;
+ }
+ else if (m > c) {
+ r = -c;
+ }
+ else {
+ /*
+ Here absx is exactly halfway between two multiples of absy,
+ and we need to choose the even multiple. x now has the form
+
+ absx = n * absy + m
+
+ for some integer n (recalling that m = 0.5*absy at this point).
+ If n is even we want to return m; if n is odd, we need to
+ return -m.
+
+ So
+
+ 0.5 * (absx - m) = (n/2) * absy
+
+ and now reducing modulo absy gives us:
+
+ | m, if n is odd
+ fmod(0.5 * (absx - m), absy) = |
+ | 0, if n is even
+
+ Now m - 2.0 * fmod(...) gives the desired result: m
+ if n is even, -m if m is odd.
+
+ Note that all steps in fmod(0.5 * (absx - m), absy)
+ will be computed exactly, with no rounding error
+ introduced.
+ */
+ assert(m == c);
+ r = m - 2.0 * fmod(0.5 * (absx - m), absy);
+ }
+ return copysign(1.0, x) * r;
+ }
+
+ /* Special values. */
+ if (Py_IS_NAN(x)) {
+ return x;
+ }
+ if (Py_IS_NAN(y)) {
+ return y;
+ }
+ if (Py_IS_INFINITY(x)) {
+ return Py_NAN;
+ }
+ assert(Py_IS_INFINITY(y));
+ return x;
+}
+
+
+/*
+ Various platforms (Solaris, OpenBSD) do nonstandard things for log(0),
+ log(-ve), log(NaN). Here are wrappers for log and log10 that deal with
+ special values directly, passing positive non-special values through to
+ the system log/log10.
+ */
+
+static double
+m_log(double x)
+{
+ if (Py_IS_FINITE(x)) {
+ if (x > 0.0)
+ return log(x);
+ errno = EDOM;
+ if (x == 0.0)
+ return -Py_HUGE_VAL; /* log(0) = -inf */
+ else
+ return Py_NAN; /* log(-ve) = nan */
+ }
+ else if (Py_IS_NAN(x))
+ return x; /* log(nan) = nan */
+ else if (x > 0.0)
+ return x; /* log(inf) = inf */
+ else {
+ errno = EDOM;
+ return Py_NAN; /* log(-inf) = nan */
+ }
+}
+
+/*
+ log2: log to base 2.
+
+ Uses an algorithm that should:
+
+ (a) produce exact results for powers of 2, and
+ (b) give a monotonic log2 (for positive finite floats),
+ assuming that the system log is monotonic.
+*/
+
+static double
+m_log2(double x)
+{
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_NAN(x))
+ return x; /* log2(nan) = nan */
+ else if (x > 0.0)
+ return x; /* log2(+inf) = +inf */
+ else {
+ errno = EDOM;
+ return Py_NAN; /* log2(-inf) = nan, invalid-operation */
+ }
+ }
+
+ if (x > 0.0) {
+ return log2(x);
+ }
+ else if (x == 0.0) {
+ errno = EDOM;
+ return -Py_HUGE_VAL; /* log2(0) = -inf, divide-by-zero */
+ }
+ else {
+ errno = EDOM;
+ return Py_NAN; /* log2(-inf) = nan, invalid-operation */
+ }
+}
+
+static double
+m_log10(double x)
+{
+ if (Py_IS_FINITE(x)) {
+ if (x > 0.0)
+ return log10(x);
+ errno = EDOM;
+ if (x == 0.0)
+ return -Py_HUGE_VAL; /* log10(0) = -inf */
+ else
+ return Py_NAN; /* log10(-ve) = nan */
+ }
+ else if (Py_IS_NAN(x))
+ return x; /* log10(nan) = nan */
+ else if (x > 0.0)
+ return x; /* log10(inf) = inf */
+ else {
+ errno = EDOM;
+ return Py_NAN; /* log10(-inf) = nan */
+ }
+}
+
+
+static PyObject *
+math_gcd(PyObject *module, PyObject * const *args, Py_ssize_t nargs)
+{
+ PyObject *res, *x;
+ Py_ssize_t i;
+
+ if (nargs == 0) {
+ return PyLong_FromLong(0);
+ }
+ res = PyNumber_Index(args[0]);
+ if (res == NULL) {
+ return NULL;
+ }
+ if (nargs == 1) {
+ Py_SETREF(res, PyNumber_Absolute(res));
+ return res;
+ }
+
+ PyObject *one = _PyLong_GetOne(); // borrowed ref
+ for (i = 1; i < nargs; i++) {
+ x = _PyNumber_Index(args[i]);
+ if (x == NULL) {
+ Py_DECREF(res);
+ return NULL;
+ }
+ if (res == one) {
+ /* Fast path: just check arguments.
+ It is okay to use identity comparison here. */
+ Py_DECREF(x);
+ continue;
+ }
+ Py_SETREF(res, _PyLong_GCD(res, x));
+ Py_DECREF(x);
+ if (res == NULL) {
+ return NULL;
+ }
+ }
+ return res;
+}
+
+PyDoc_STRVAR(math_gcd_doc,
+"gcd($module, *integers)\n"
+"--\n"
+"\n"
+"Greatest Common Divisor.");
+
+
+static PyObject *
+long_lcm(PyObject *a, PyObject *b)
+{
+ PyObject *g, *m, *f, *ab;
+
+ if (_PyLong_IsZero((PyLongObject *)a) || _PyLong_IsZero((PyLongObject *)b)) {
+ return PyLong_FromLong(0);
+ }
+ g = _PyLong_GCD(a, b);
+ if (g == NULL) {
+ return NULL;
+ }
+ f = PyNumber_FloorDivide(a, g);
+ Py_DECREF(g);
+ if (f == NULL) {
+ return NULL;
+ }
+ m = PyNumber_Multiply(f, b);
+ Py_DECREF(f);
+ if (m == NULL) {
+ return NULL;
+ }
+ ab = PyNumber_Absolute(m);
+ Py_DECREF(m);
+ return ab;
+}
+
+
+static PyObject *
+math_lcm(PyObject *module, PyObject * const *args, Py_ssize_t nargs)
+{
+ PyObject *res, *x;
+ Py_ssize_t i;
+
+ if (nargs == 0) {
+ return PyLong_FromLong(1);
+ }
+ res = PyNumber_Index(args[0]);
+ if (res == NULL) {
+ return NULL;
+ }
+ if (nargs == 1) {
+ Py_SETREF(res, PyNumber_Absolute(res));
+ return res;
+ }
+
+ PyObject *zero = _PyLong_GetZero(); // borrowed ref
+ for (i = 1; i < nargs; i++) {
+ x = PyNumber_Index(args[i]);
+ if (x == NULL) {
+ Py_DECREF(res);
+ return NULL;
+ }
+ if (res == zero) {
+ /* Fast path: just check arguments.
+ It is okay to use identity comparison here. */
+ Py_DECREF(x);
+ continue;
+ }
+ Py_SETREF(res, long_lcm(res, x));
+ Py_DECREF(x);
+ if (res == NULL) {
+ return NULL;
+ }
+ }
+ return res;
+}
+
+
+PyDoc_STRVAR(math_lcm_doc,
+"lcm($module, *integers)\n"
+"--\n"
+"\n"
+"Least Common Multiple.");
+
+
+/* Call is_error when errno != 0, and where x is the result libm
+ * returned. is_error will usually set up an exception and return
+ * true (1), but may return false (0) without setting up an exception.
+ */
+static int
+is_error(double x)
+{
+ int result = 1; /* presumption of guilt */
+ assert(errno); /* non-zero errno is a precondition for calling */
+ if (errno == EDOM)
+ PyErr_SetString(PyExc_ValueError, "math domain error");
+
+ else if (errno == ERANGE) {
+ /* ANSI C generally requires libm functions to set ERANGE
+ * on overflow, but also generally *allows* them to set
+ * ERANGE on underflow too. There's no consistency about
+ * the latter across platforms.
+ * Alas, C99 never requires that errno be set.
+ * Here we suppress the underflow errors (libm functions
+ * should return a zero on underflow, and +- HUGE_VAL on
+ * overflow, so testing the result for zero suffices to
+ * distinguish the cases).
+ *
+ * On some platforms (Ubuntu/ia64) it seems that errno can be
+ * set to ERANGE for subnormal results that do *not* underflow
+ * to zero. So to be safe, we'll ignore ERANGE whenever the
+ * function result is less than 1.5 in absolute value.
+ *
+ * bpo-46018: Changed to 1.5 to ensure underflows in expm1()
+ * are correctly detected, since the function may underflow
+ * toward -1.0 rather than 0.0.
+ */
+ if (fabs(x) < 1.5)
+ result = 0;
+ else
+ PyErr_SetString(PyExc_OverflowError,
+ "math range error");
+ }
+ else
+ /* Unexpected math error */
+ PyErr_SetFromErrno(PyExc_ValueError);
+ return result;
+}
+
+/*
+ math_1 is used to wrap a libm function f that takes a double
+ argument and returns a double.
+
+ The error reporting follows these rules, which are designed to do
+ the right thing on C89/C99 platforms and IEEE 754/non IEEE 754
+ platforms.
+
+ - a NaN result from non-NaN inputs causes ValueError to be raised
+ - an infinite result from finite inputs causes OverflowError to be
+ raised if can_overflow is 1, or raises ValueError if can_overflow
+ is 0.
+ - if the result is finite and errno == EDOM then ValueError is
+ raised
+ - if the result is finite and nonzero and errno == ERANGE then
+ OverflowError is raised
+
+ The last rule is used to catch overflow on platforms which follow
+ C89 but for which HUGE_VAL is not an infinity.
+
+ For the majority of one-argument functions these rules are enough
+ to ensure that Python's functions behave as specified in 'Annex F'
+ of the C99 standard, with the 'invalid' and 'divide-by-zero'
+ floating-point exceptions mapping to Python's ValueError and the
+ 'overflow' floating-point exception mapping to OverflowError.
+ math_1 only works for functions that don't have singularities *and*
+ the possibility of overflow; fortunately, that covers everything we
+ care about right now.
+*/
+
+static PyObject *
+math_1(PyObject *arg, double (*func) (double), int can_overflow)
+{
+ double x, r;
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ errno = 0;
+ r = (*func)(x);
+ if (Py_IS_NAN(r) && !Py_IS_NAN(x)) {
+ PyErr_SetString(PyExc_ValueError,
+ "math domain error"); /* invalid arg */
+ return NULL;
+ }
+ if (Py_IS_INFINITY(r) && Py_IS_FINITE(x)) {
+ if (can_overflow)
+ PyErr_SetString(PyExc_OverflowError,
+ "math range error"); /* overflow */
+ else
+ PyErr_SetString(PyExc_ValueError,
+ "math domain error"); /* singularity */
+ return NULL;
+ }
+ if (Py_IS_FINITE(r) && errno && is_error(r))
+ /* this branch unnecessary on most platforms */
+ return NULL;
+
+ return PyFloat_FromDouble(r);
+}
+
+/* variant of math_1, to be used when the function being wrapped is known to
+ set errno properly (that is, errno = EDOM for invalid or divide-by-zero,
+ errno = ERANGE for overflow). */
+
+static PyObject *
+math_1a(PyObject *arg, double (*func) (double))
+{
+ double x, r;
+ x = PyFloat_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ errno = 0;
+ r = (*func)(x);
+ if (errno && is_error(r))
+ return NULL;
+ return PyFloat_FromDouble(r);
+}
+
+/*
+ math_2 is used to wrap a libm function f that takes two double
+ arguments and returns a double.
+
+ The error reporting follows these rules, which are designed to do
+ the right thing on C89/C99 platforms and IEEE 754/non IEEE 754
+ platforms.
+
+ - a NaN result from non-NaN inputs causes ValueError to be raised
+ - an infinite result from finite inputs causes OverflowError to be
+ raised.
+ - if the result is finite and errno == EDOM then ValueError is
+ raised
+ - if the result is finite and nonzero and errno == ERANGE then
+ OverflowError is raised
+
+ The last rule is used to catch overflow on platforms which follow
+ C89 but for which HUGE_VAL is not an infinity.
+
+ For most two-argument functions (copysign, fmod, hypot, atan2)
+ these rules are enough to ensure that Python's functions behave as
+ specified in 'Annex F' of the C99 standard, with the 'invalid' and
+ 'divide-by-zero' floating-point exceptions mapping to Python's
+ ValueError and the 'overflow' floating-point exception mapping to
+ OverflowError.
+*/
+
+static PyObject *
+math_2(PyObject *const *args, Py_ssize_t nargs,
+ double (*func) (double, double), const char *funcname)
+{
+ double x, y, r;
+ if (!_PyArg_CheckPositional(funcname, nargs, 2, 2))
+ return NULL;
+ x = PyFloat_AsDouble(args[0]);
+ if (x == -1.0 && PyErr_Occurred()) {
+ return NULL;
+ }
+ y = PyFloat_AsDouble(args[1]);
+ if (y == -1.0 && PyErr_Occurred()) {
+ return NULL;
+ }
+ errno = 0;
+ r = (*func)(x, y);
+ if (Py_IS_NAN(r)) {
+ if (!Py_IS_NAN(x) && !Py_IS_NAN(y))
+ errno = EDOM;
+ else
+ errno = 0;
+ }
+ else if (Py_IS_INFINITY(r)) {
+ if (Py_IS_FINITE(x) && Py_IS_FINITE(y))
+ errno = ERANGE;
+ else
+ errno = 0;
+ }
+ if (errno && is_error(r))
+ return NULL;
+ else
+ return PyFloat_FromDouble(r);
+}
+
+#define FUNC1(funcname, func, can_overflow, docstring) \
+ static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
+ return math_1(args, func, can_overflow); \
+ }\
+ PyDoc_STRVAR(math_##funcname##_doc, docstring);
+
+#define FUNC1A(funcname, func, docstring) \
+ static PyObject * math_##funcname(PyObject *self, PyObject *args) { \
+ return math_1a(args, func); \
+ }\
+ PyDoc_STRVAR(math_##funcname##_doc, docstring);
+
+#define FUNC2(funcname, func, docstring) \
+ static PyObject * math_##funcname(PyObject *self, PyObject *const *args, Py_ssize_t nargs) { \
+ return math_2(args, nargs, func, #funcname); \
+ }\
+ PyDoc_STRVAR(math_##funcname##_doc, docstring);
+
+FUNC1(acos, acos, 0,
+ "acos($module, x, /)\n--\n\n"
+ "Return the arc cosine (measured in radians) of x.\n\n"
+ "The result is between 0 and pi.")
+FUNC1(acosh, acosh, 0,
+ "acosh($module, x, /)\n--\n\n"
+ "Return the inverse hyperbolic cosine of x.")
+FUNC1(asin, asin, 0,
+ "asin($module, x, /)\n--\n\n"
+ "Return the arc sine (measured in radians) of x.\n\n"
+ "The result is between -pi/2 and pi/2.")
+FUNC1(asinh, asinh, 0,
+ "asinh($module, x, /)\n--\n\n"
+ "Return the inverse hyperbolic sine of x.")
+FUNC1(atan, atan, 0,
+ "atan($module, x, /)\n--\n\n"
+ "Return the arc tangent (measured in radians) of x.\n\n"
+ "The result is between -pi/2 and pi/2.")
+FUNC2(atan2, m_atan2,
+ "atan2($module, y, x, /)\n--\n\n"
+ "Return the arc tangent (measured in radians) of y/x.\n\n"
+ "Unlike atan(y/x), the signs of both x and y are considered.")
+FUNC1(atanh, atanh, 0,
+ "atanh($module, x, /)\n--\n\n"
+ "Return the inverse hyperbolic tangent of x.")
+FUNC1(cbrt, cbrt, 0,
+ "cbrt($module, x, /)\n--\n\n"
+ "Return the cube root of x.")
+
+/*[clinic input]
+math.ceil
+
+ x as number: object
+ /
+
+Return the ceiling of x as an Integral.
+
+This is the smallest integer >= x.
+[clinic start generated code]*/
+
+static PyObject *
+math_ceil(PyObject *module, PyObject *number)
+/*[clinic end generated code: output=6c3b8a78bc201c67 input=2725352806399cab]*/
+{
+
+ if (!PyFloat_CheckExact(number)) {
+ math_module_state *state = get_math_module_state(module);
+ PyObject *method = _PyObject_LookupSpecial(number, state->str___ceil__);
+ if (method != NULL) {
+ PyObject *result = _PyObject_CallNoArgs(method);
+ Py_DECREF(method);
+ return result;
+ }
+ if (PyErr_Occurred())
+ return NULL;
+ }
+ double x = PyFloat_AsDouble(number);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+
+ return PyLong_FromDouble(ceil(x));
+}
+
+FUNC2(copysign, copysign,
+ "copysign($module, x, y, /)\n--\n\n"
+ "Return a float with the magnitude (absolute value) of x but the sign of y.\n\n"
+ "On platforms that support signed zeros, copysign(1.0, -0.0)\n"
+ "returns -1.0.\n")
+FUNC1(cos, cos, 0,
+ "cos($module, x, /)\n--\n\n"
+ "Return the cosine of x (measured in radians).")
+FUNC1(cosh, cosh, 1,
+ "cosh($module, x, /)\n--\n\n"
+ "Return the hyperbolic cosine of x.")
+FUNC1A(erf, erf,
+ "erf($module, x, /)\n--\n\n"
+ "Error function at x.")
+FUNC1A(erfc, erfc,
+ "erfc($module, x, /)\n--\n\n"
+ "Complementary error function at x.")
+FUNC1(exp, exp, 1,
+ "exp($module, x, /)\n--\n\n"
+ "Return e raised to the power of x.")
+FUNC1(exp2, exp2, 1,
+ "exp2($module, x, /)\n--\n\n"
+ "Return 2 raised to the power of x.")
+FUNC1(expm1, expm1, 1,
+ "expm1($module, x, /)\n--\n\n"
+ "Return exp(x)-1.\n\n"
+ "This function avoids the loss of precision involved in the direct "
+ "evaluation of exp(x)-1 for small x.")
+FUNC1(fabs, fabs, 0,
+ "fabs($module, x, /)\n--\n\n"
+ "Return the absolute value of the float x.")
+
+/*[clinic input]
+math.floor
+
+ x as number: object
+ /
+
+Return the floor of x as an Integral.
+
+This is the largest integer <= x.
+[clinic start generated code]*/
+
+static PyObject *
+math_floor(PyObject *module, PyObject *number)
+/*[clinic end generated code: output=c6a65c4884884b8a input=63af6b5d7ebcc3d6]*/
+{
+ double x;
+
+ if (PyFloat_CheckExact(number)) {
+ x = PyFloat_AS_DOUBLE(number);
+ }
+ else
+ {
+ math_module_state *state = get_math_module_state(module);
+ PyObject *method = _PyObject_LookupSpecial(number, state->str___floor__);
+ if (method != NULL) {
+ PyObject *result = _PyObject_CallNoArgs(method);
+ Py_DECREF(method);
+ return result;
+ }
+ if (PyErr_Occurred())
+ return NULL;
+ x = PyFloat_AsDouble(number);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ }
+ return PyLong_FromDouble(floor(x));
+}
+
+FUNC1A(gamma, m_tgamma,
+ "gamma($module, x, /)\n--\n\n"
+ "Gamma function at x.")
+FUNC1A(lgamma, m_lgamma,
+ "lgamma($module, x, /)\n--\n\n"
+ "Natural logarithm of absolute value of Gamma function at x.")
+FUNC1(log1p, m_log1p, 0,
+ "log1p($module, x, /)\n--\n\n"
+ "Return the natural logarithm of 1+x (base e).\n\n"
+ "The result is computed in a way which is accurate for x near zero.")
+FUNC2(remainder, m_remainder,
+ "remainder($module, x, y, /)\n--\n\n"
+ "Difference between x and the closest integer multiple of y.\n\n"
+ "Return x - n*y where n*y is the closest integer multiple of y.\n"
+ "In the case where x is exactly halfway between two multiples of\n"
+ "y, the nearest even value of n is used. The result is always exact.")
+FUNC1(sin, sin, 0,
+ "sin($module, x, /)\n--\n\n"
+ "Return the sine of x (measured in radians).")
+FUNC1(sinh, sinh, 1,
+ "sinh($module, x, /)\n--\n\n"
+ "Return the hyperbolic sine of x.")
+FUNC1(sqrt, sqrt, 0,
+ "sqrt($module, x, /)\n--\n\n"
+ "Return the square root of x.")
+FUNC1(tan, tan, 0,
+ "tan($module, x, /)\n--\n\n"
+ "Return the tangent of x (measured in radians).")
+FUNC1(tanh, tanh, 0,
+ "tanh($module, x, /)\n--\n\n"
+ "Return the hyperbolic tangent of x.")
+
+/* Precision summation function as msum() by Raymond Hettinger in
+ <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393090>,
+ enhanced with the exact partials sum and roundoff from Mark
+ Dickinson's post at <http://bugs.python.org/file10357/msum4.py>.
+ See those links for more details, proofs and other references.
+
+ Note 1: IEEE 754 floating-point semantics with a rounding mode of
+ roundTiesToEven are assumed.
+
+ Note 2: No provision is made for intermediate overflow handling;
+ therefore, fsum([1e+308, -1e+308, 1e+308]) returns 1e+308 while
+ fsum([1e+308, 1e+308, -1e+308]) raises an OverflowError due to the
+ overflow of the first partial sum.
+
+ Note 3: The algorithm has two potential sources of fragility. First, C
+ permits arithmetic operations on `double`s to be performed in an
+ intermediate format whose range and precision may be greater than those of
+ `double` (see for example C99 §5.2.4.2.2, paragraph 8). This can happen for
+ example on machines using the now largely historical x87 FPUs. In this case,
+ `fsum` can produce incorrect results. If `FLT_EVAL_METHOD` is `0` or `1`, or
+ `FLT_EVAL_METHOD` is `2` and `long double` is identical to `double`, then we
+ should be safe from this source of errors. Second, an aggressively
+ optimizing compiler can re-associate operations so that (for example) the
+ statement `yr = hi - x;` is treated as `yr = (x + y) - x` and then
+ re-associated as `yr = y + (x - x)`, giving `y = yr` and `lo = 0.0`. That
+ re-association would be in violation of the C standard, and should not occur
+ except possibly in the presence of unsafe optimizations (e.g., -ffast-math,
+ -fassociative-math). Such optimizations should be avoided for this module.
+
+ Note 4: The signature of math.fsum() differs from builtins.sum()
+ because the start argument doesn't make sense in the context of
+ accurate summation. Since the partials table is collapsed before
+ returning a result, sum(seq2, start=sum(seq1)) may not equal the
+ accurate result returned by sum(itertools.chain(seq1, seq2)).
+*/
+
+#define NUM_PARTIALS 32 /* initial partials array size, on stack */
+
+/* Extend the partials array p[] by doubling its size. */
+static int /* non-zero on error */
+_fsum_realloc(double **p_ptr, Py_ssize_t n,
+ double *ps, Py_ssize_t *m_ptr)
+{
+ void *v = NULL;
+ Py_ssize_t m = *m_ptr;
+
+ m += m; /* double */
+ if (n < m && (size_t)m < ((size_t)PY_SSIZE_T_MAX / sizeof(double))) {
+ double *p = *p_ptr;
+ if (p == ps) {
+ v = PyMem_Malloc(sizeof(double) * m);
+ if (v != NULL)
+ memcpy(v, ps, sizeof(double) * n);
+ }
+ else
+ v = PyMem_Realloc(p, sizeof(double) * m);
+ }
+ if (v == NULL) { /* size overflow or no memory */
+ PyErr_SetString(PyExc_MemoryError, "math.fsum partials");
+ return 1;
+ }
+ *p_ptr = (double*) v;
+ *m_ptr = m;
+ return 0;
+}
+
+/* Full precision summation of a sequence of floats.
+
+ def msum(iterable):
+ partials = [] # sorted, non-overlapping partial sums
+ for x in iterable:
+ i = 0
+ for y in partials:
+ if abs(x) < abs(y):
+ x, y = y, x
+ hi = x + y
+ lo = y - (hi - x)
+ if lo:
+ partials[i] = lo
+ i += 1
+ x = hi
+ partials[i:] = [x]
+ return sum_exact(partials)
+
+ Rounded x+y stored in hi with the roundoff stored in lo. Together hi+lo
+ are exactly equal to x+y. The inner loop applies hi/lo summation to each
+ partial so that the list of partial sums remains exact.
+
+ Sum_exact() adds the partial sums exactly and correctly rounds the final
+ result (using the round-half-to-even rule). The items in partials remain
+ non-zero, non-special, non-overlapping and strictly increasing in
+ magnitude, but possibly not all having the same sign.
+
+ Depends on IEEE 754 arithmetic guarantees and half-even rounding.
+*/
+
+/*[clinic input]
+math.fsum
+
+ seq: object
+ /
+
+Return an accurate floating point sum of values in the iterable seq.
+
+Assumes IEEE-754 floating point arithmetic.
+[clinic start generated code]*/
+
+static PyObject *
+math_fsum(PyObject *module, PyObject *seq)
+/*[clinic end generated code: output=ba5c672b87fe34fc input=c51b7d8caf6f6e82]*/
+{
+ PyObject *item, *iter, *sum = NULL;
+ Py_ssize_t i, j, n = 0, m = NUM_PARTIALS;
+ double x, y, t, ps[NUM_PARTIALS], *p = ps;
+ double xsave, special_sum = 0.0, inf_sum = 0.0;
+ double hi, yr, lo = 0.0;
+
+ iter = PyObject_GetIter(seq);
+ if (iter == NULL)
+ return NULL;
+
+ for(;;) { /* for x in iterable */
+ assert(0 <= n && n <= m);
+ assert((m == NUM_PARTIALS && p == ps) ||
+ (m > NUM_PARTIALS && p != NULL));
+
+ item = PyIter_Next(iter);
+ if (item == NULL) {
+ if (PyErr_Occurred())
+ goto _fsum_error;
+ break;
+ }
+ ASSIGN_DOUBLE(x, item, error_with_item);
+ Py_DECREF(item);
+
+ xsave = x;
+ for (i = j = 0; j < n; j++) { /* for y in partials */
+ y = p[j];
+ if (fabs(x) < fabs(y)) {
+ t = x; x = y; y = t;
+ }
+ hi = x + y;
+ yr = hi - x;
+ lo = y - yr;
+ if (lo != 0.0)
+ p[i++] = lo;
+ x = hi;
+ }
+
+ n = i; /* ps[i:] = [x] */
+ if (x != 0.0) {
+ if (! Py_IS_FINITE(x)) {
+ /* a nonfinite x could arise either as
+ a result of intermediate overflow, or
+ as a result of a nan or inf in the
+ summands */
+ if (Py_IS_FINITE(xsave)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "intermediate overflow in fsum");
+ goto _fsum_error;
+ }
+ if (Py_IS_INFINITY(xsave))
+ inf_sum += xsave;
+ special_sum += xsave;
+ /* reset partials */
+ n = 0;
+ }
+ else if (n >= m && _fsum_realloc(&p, n, ps, &m))
+ goto _fsum_error;
+ else
+ p[n++] = x;
+ }
+ }
+
+ if (special_sum != 0.0) {
+ if (Py_IS_NAN(inf_sum))
+ PyErr_SetString(PyExc_ValueError,
+ "-inf + inf in fsum");
+ else
+ sum = PyFloat_FromDouble(special_sum);
+ goto _fsum_error;
+ }
+
+ hi = 0.0;
+ if (n > 0) {
+ hi = p[--n];
+ /* sum_exact(ps, hi) from the top, stop when the sum becomes
+ inexact. */
+ while (n > 0) {
+ x = hi;
+ y = p[--n];
+ assert(fabs(y) < fabs(x));
+ hi = x + y;
+ yr = hi - x;
+ lo = y - yr;
+ if (lo != 0.0)
+ break;
+ }
+ /* Make half-even rounding work across multiple partials.
+ Needed so that sum([1e-16, 1, 1e16]) will round-up the last
+ digit to two instead of down to zero (the 1e-16 makes the 1
+ slightly closer to two). With a potential 1 ULP rounding
+ error fixed-up, math.fsum() can guarantee commutativity. */
+ if (n > 0 && ((lo < 0.0 && p[n-1] < 0.0) ||
+ (lo > 0.0 && p[n-1] > 0.0))) {
+ y = lo * 2.0;
+ x = hi + y;
+ yr = x - hi;
+ if (y == yr)
+ hi = x;
+ }
+ }
+ sum = PyFloat_FromDouble(hi);
+
+ _fsum_error:
+ Py_DECREF(iter);
+ if (p != ps)
+ PyMem_Free(p);
+ return sum;
+
+ error_with_item:
+ Py_DECREF(item);
+ goto _fsum_error;
+}
+
+#undef NUM_PARTIALS
+
+
+static unsigned long
+count_set_bits(unsigned long n)
+{
+ unsigned long count = 0;
+ while (n != 0) {
+ ++count;
+ n &= n - 1; /* clear least significant bit */
+ }
+ return count;
+}
+
+/* Integer square root
+
+Given a nonnegative integer `n`, we want to compute the largest integer
+`a` for which `a * a <= n`, or equivalently the integer part of the exact
+square root of `n`.
+
+We use an adaptive-precision pure-integer version of Newton's iteration. Given
+a positive integer `n`, the algorithm produces at each iteration an integer
+approximation `a` to the square root of `n >> s` for some even integer `s`,
+with `s` decreasing as the iterations progress. On the final iteration, `s` is
+zero and we have an approximation to the square root of `n` itself.
+
+At every step, the approximation `a` is strictly within 1.0 of the true square
+root, so we have
+
+ (a - 1)**2 < (n >> s) < (a + 1)**2
+
+After the final iteration, a check-and-correct step is needed to determine
+whether `a` or `a - 1` gives the desired integer square root of `n`.
+
+The algorithm is remarkable in its simplicity. There's no need for a
+per-iteration check-and-correct step, and termination is straightforward: the
+number of iterations is known in advance (it's exactly `floor(log2(log2(n)))`
+for `n > 1`). The only tricky part of the correctness proof is in establishing
+that the bound `(a - 1)**2 < (n >> s) < (a + 1)**2` is maintained from one
+iteration to the next. A sketch of the proof of this is given below.
+
+In addition to the proof sketch, a formal, computer-verified proof
+of correctness (using Lean) of an equivalent recursive algorithm can be found
+here:
+
+ https://github.com/mdickinson/snippets/blob/master/proofs/isqrt/src/isqrt.lean
+
+
+Here's Python code equivalent to the C implementation below:
+
+ def isqrt(n):
+ """
+ Return the integer part of the square root of the input.
+ """
+ n = operator.index(n)
+
+ if n < 0:
+ raise ValueError("isqrt() argument must be nonnegative")
+ if n == 0:
+ return 0
+
+ c = (n.bit_length() - 1) // 2
+ a = 1
+ d = 0
+ for s in reversed(range(c.bit_length())):
+ # Loop invariant: (a-1)**2 < (n >> 2*(c - d)) < (a+1)**2
+ e = d
+ d = c >> s
+ a = (a << d - e - 1) + (n >> 2*c - e - d + 1) // a
+
+ return a - (a*a > n)
+
+
+Sketch of proof of correctness
+------------------------------
+
+The delicate part of the correctness proof is showing that the loop invariant
+is preserved from one iteration to the next. That is, just before the line
+
+ a = (a << d - e - 1) + (n >> 2*c - e - d + 1) // a
+
+is executed in the above code, we know that
+
+ (1) (a - 1)**2 < (n >> 2*(c - e)) < (a + 1)**2.
+
+(since `e` is always the value of `d` from the previous iteration). We must
+prove that after that line is executed, we have
+
+ (a - 1)**2 < (n >> 2*(c - d)) < (a + 1)**2
+
+To facilitate the proof, we make some changes of notation. Write `m` for
+`n >> 2*(c-d)`, and write `b` for the new value of `a`, so
+
+ b = (a << d - e - 1) + (n >> 2*c - e - d + 1) // a
+
+or equivalently:
+
+ (2) b = (a << d - e - 1) + (m >> d - e + 1) // a
+
+Then we can rewrite (1) as:
+
+ (3) (a - 1)**2 < (m >> 2*(d - e)) < (a + 1)**2
+
+and we must show that (b - 1)**2 < m < (b + 1)**2.
+
+From this point on, we switch to mathematical notation, so `/` means exact
+division rather than integer division and `^` is used for exponentiation. We
+use the `√` symbol for the exact square root. In (3), we can remove the
+implicit floor operation to give:
+
+ (4) (a - 1)^2 < m / 4^(d - e) < (a + 1)^2
+
+Taking square roots throughout (4), scaling by `2^(d-e)`, and rearranging gives
+
+ (5) 0 <= | 2^(d-e)a - √m | < 2^(d-e)
+
+Squaring and dividing through by `2^(d-e+1) a` gives
+
+ (6) 0 <= 2^(d-e-1) a + m / (2^(d-e+1) a) - √m < 2^(d-e-1) / a
+
+We'll show below that `2^(d-e-1) <= a`. Given that, we can replace the
+right-hand side of (6) with `1`, and now replacing the central
+term `m / (2^(d-e+1) a)` with its floor in (6) gives
+
+ (7) -1 < 2^(d-e-1) a + m // 2^(d-e+1) a - √m < 1
+
+Or equivalently, from (2):
+
+ (7) -1 < b - √m < 1
+
+and rearranging gives that `(b-1)^2 < m < (b+1)^2`, which is what we needed
+to prove.
+
+We're not quite done: we still have to prove the inequality `2^(d - e - 1) <=
+a` that was used to get line (7) above. From the definition of `c`, we have
+`4^c <= n`, which implies
+
+ (8) 4^d <= m
+
+also, since `e == d >> 1`, `d` is at most `2e + 1`, from which it follows
+that `2d - 2e - 1 <= d` and hence that
+
+ (9) 4^(2d - 2e - 1) <= m
+
+Dividing both sides by `4^(d - e)` gives
+
+ (10) 4^(d - e - 1) <= m / 4^(d - e)
+
+But we know from (4) that `m / 4^(d-e) < (a + 1)^2`, hence
+
+ (11) 4^(d - e - 1) < (a + 1)^2
+
+Now taking square roots of both sides and observing that both `2^(d-e-1)` and
+`a` are integers gives `2^(d - e - 1) <= a`, which is what we needed. This
+completes the proof sketch.
+
+*/
+
+/*
+ The _approximate_isqrt_tab table provides approximate square roots for
+ 16-bit integers. For any n in the range 2**14 <= n < 2**16, the value
+
+ a = _approximate_isqrt_tab[(n >> 8) - 64]
+
+ is an approximate square root of n, satisfying (a - 1)**2 < n < (a + 1)**2.
+
+ The table was computed in Python using the expression:
+
+ [min(round(sqrt(256*n + 128)), 255) for n in range(64, 256)]
+*/
+
+static const uint8_t _approximate_isqrt_tab[192] = {
+ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
+ 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 150,
+ 151, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160,
+ 160, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168, 169,
+ 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178,
+ 179, 179, 180, 181, 181, 182, 183, 183, 184, 185, 186, 186,
+ 187, 188, 188, 189, 190, 190, 191, 192, 192, 193, 194, 194,
+ 195, 196, 196, 197, 198, 198, 199, 200, 200, 201, 201, 202,
+ 203, 203, 204, 205, 205, 206, 206, 207, 208, 208, 209, 210,
+ 210, 211, 211, 212, 213, 213, 214, 214, 215, 216, 216, 217,
+ 217, 218, 219, 219, 220, 220, 221, 221, 222, 223, 223, 224,
+ 224, 225, 225, 226, 227, 227, 228, 228, 229, 229, 230, 230,
+ 231, 232, 232, 233, 233, 234, 234, 235, 235, 236, 237, 237,
+ 238, 238, 239, 239, 240, 240, 241, 241, 242, 242, 243, 243,
+ 244, 244, 245, 246, 246, 247, 247, 248, 248, 249, 249, 250,
+ 250, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255, 255,
+};
+
+/* Approximate square root of a large 64-bit integer.
+
+ Given `n` satisfying `2**62 <= n < 2**64`, return `a`
+ satisfying `(a - 1)**2 < n < (a + 1)**2`. */
+
+static inline uint32_t
+_approximate_isqrt(uint64_t n)
+{
+ uint32_t u = _approximate_isqrt_tab[(n >> 56) - 64];
+ u = (u << 7) + (uint32_t)(n >> 41) / u;
+ return (u << 15) + (uint32_t)((n >> 17) / u);
+}
+
+/*[clinic input]
+math.isqrt
+
+ n: object
+ /
+
+Return the integer part of the square root of the input.
+[clinic start generated code]*/
+
+static PyObject *
+math_isqrt(PyObject *module, PyObject *n)
+/*[clinic end generated code: output=35a6f7f980beab26 input=5b6e7ae4fa6c43d6]*/
+{
+ int a_too_large, c_bit_length;
+ size_t c, d;
+ uint64_t m;
+ uint32_t u;
+ PyObject *a = NULL, *b;
+
+ n = _PyNumber_Index(n);
+ if (n == NULL) {
+ return NULL;
+ }
+
+ if (_PyLong_IsNegative((PyLongObject *)n)) {
+ PyErr_SetString(
+ PyExc_ValueError,
+ "isqrt() argument must be nonnegative");
+ goto error;
+ }
+ if (_PyLong_IsZero((PyLongObject *)n)) {
+ Py_DECREF(n);
+ return PyLong_FromLong(0);
+ }
+
+ /* c = (n.bit_length() - 1) // 2 */
+ c = _PyLong_NumBits(n);
+ if (c == (size_t)(-1)) {
+ goto error;
+ }
+ c = (c - 1U) / 2U;
+
+ /* Fast path: if c <= 31 then n < 2**64 and we can compute directly with a
+ fast, almost branch-free algorithm. */
+ if (c <= 31U) {
+ int shift = 31 - (int)c;
+ m = (uint64_t)PyLong_AsUnsignedLongLong(n);
+ Py_DECREF(n);
+ if (m == (uint64_t)(-1) && PyErr_Occurred()) {
+ return NULL;
+ }
+ u = _approximate_isqrt(m << 2*shift) >> shift;
+ u -= (uint64_t)u * u > m;
+ return PyLong_FromUnsignedLong(u);
+ }
+
+ /* Slow path: n >= 2**64. We perform the first five iterations in C integer
+ arithmetic, then switch to using Python long integers. */
+
+ /* From n >= 2**64 it follows that c.bit_length() >= 6. */
+ c_bit_length = 6;
+ while ((c >> c_bit_length) > 0U) {
+ ++c_bit_length;
+ }
+
+ /* Initialise d and a. */
+ d = c >> (c_bit_length - 5);
+ b = _PyLong_Rshift(n, 2U*c - 62U);
+ if (b == NULL) {
+ goto error;
+ }
+ m = (uint64_t)PyLong_AsUnsignedLongLong(b);
+ Py_DECREF(b);
+ if (m == (uint64_t)(-1) && PyErr_Occurred()) {
+ goto error;
+ }
+ u = _approximate_isqrt(m) >> (31U - d);
+ a = PyLong_FromUnsignedLong(u);
+ if (a == NULL) {
+ goto error;
+ }
+
+ for (int s = c_bit_length - 6; s >= 0; --s) {
+ PyObject *q;
+ size_t e = d;
+
+ d = c >> s;
+
+ /* q = (n >> 2*c - e - d + 1) // a */
+ q = _PyLong_Rshift(n, 2U*c - d - e + 1U);
+ if (q == NULL) {
+ goto error;
+ }
+ Py_SETREF(q, PyNumber_FloorDivide(q, a));
+ if (q == NULL) {
+ goto error;
+ }
+
+ /* a = (a << d - 1 - e) + q */
+ Py_SETREF(a, _PyLong_Lshift(a, d - 1U - e));
+ if (a == NULL) {
+ Py_DECREF(q);
+ goto error;
+ }
+ Py_SETREF(a, PyNumber_Add(a, q));
+ Py_DECREF(q);
+ if (a == NULL) {
+ goto error;
+ }
+ }
+
+ /* The correct result is either a or a - 1. Figure out which, and
+ decrement a if necessary. */
+
+ /* a_too_large = n < a * a */
+ b = PyNumber_Multiply(a, a);
+ if (b == NULL) {
+ goto error;
+ }
+ a_too_large = PyObject_RichCompareBool(n, b, Py_LT);
+ Py_DECREF(b);
+ if (a_too_large == -1) {
+ goto error;
+ }
+
+ if (a_too_large) {
+ Py_SETREF(a, PyNumber_Subtract(a, _PyLong_GetOne()));
+ }
+ Py_DECREF(n);
+ return a;
+
+ error:
+ Py_XDECREF(a);
+ Py_DECREF(n);
+ return NULL;
+}
+
+/* Divide-and-conquer factorial algorithm
+ *
+ * Based on the formula and pseudo-code provided at:
+ * http://www.luschny.de/math/factorial/binarysplitfact.html
+ *
+ * Faster algorithms exist, but they're more complicated and depend on
+ * a fast prime factorization algorithm.
+ *
+ * Notes on the algorithm
+ * ----------------------
+ *
+ * factorial(n) is written in the form 2**k * m, with m odd. k and m are
+ * computed separately, and then combined using a left shift.
+ *
+ * The function factorial_odd_part computes the odd part m (i.e., the greatest
+ * odd divisor) of factorial(n), using the formula:
+ *
+ * factorial_odd_part(n) =
+ *
+ * product_{i >= 0} product_{0 < j <= n / 2**i, j odd} j
+ *
+ * Example: factorial_odd_part(20) =
+ *
+ * (1) *
+ * (1) *
+ * (1 * 3 * 5) *
+ * (1 * 3 * 5 * 7 * 9) *
+ * (1 * 3 * 5 * 7 * 9 * 11 * 13 * 15 * 17 * 19)
+ *
+ * Here i goes from large to small: the first term corresponds to i=4 (any
+ * larger i gives an empty product), and the last term corresponds to i=0.
+ * Each term can be computed from the last by multiplying by the extra odd
+ * numbers required: e.g., to get from the penultimate term to the last one,
+ * we multiply by (11 * 13 * 15 * 17 * 19).
+ *
+ * To see a hint of why this formula works, here are the same numbers as above
+ * but with the even parts (i.e., the appropriate powers of 2) included. For
+ * each subterm in the product for i, we multiply that subterm by 2**i:
+ *
+ * factorial(20) =
+ *
+ * (16) *
+ * (8) *
+ * (4 * 12 * 20) *
+ * (2 * 6 * 10 * 14 * 18) *
+ * (1 * 3 * 5 * 7 * 9 * 11 * 13 * 15 * 17 * 19)
+ *
+ * The factorial_partial_product function computes the product of all odd j in
+ * range(start, stop) for given start and stop. It's used to compute the
+ * partial products like (11 * 13 * 15 * 17 * 19) in the example above. It
+ * operates recursively, repeatedly splitting the range into two roughly equal
+ * pieces until the subranges are small enough to be computed using only C
+ * integer arithmetic.
+ *
+ * The two-valuation k (i.e., the exponent of the largest power of 2 dividing
+ * the factorial) is computed independently in the main math_factorial
+ * function. By standard results, its value is:
+ *
+ * two_valuation = n//2 + n//4 + n//8 + ....
+ *
+ * It can be shown (e.g., by complete induction on n) that two_valuation is
+ * equal to n - count_set_bits(n), where count_set_bits(n) gives the number of
+ * '1'-bits in the binary expansion of n.
+ */
+
+/* factorial_partial_product: Compute product(range(start, stop, 2)) using
+ * divide and conquer. Assumes start and stop are odd and stop > start.
+ * max_bits must be >= bit_length(stop - 2). */
+
+static PyObject *
+factorial_partial_product(unsigned long start, unsigned long stop,
+ unsigned long max_bits)
+{
+ unsigned long midpoint, num_operands;
+ PyObject *left = NULL, *right = NULL, *result = NULL;
+
+ /* If the return value will fit an unsigned long, then we can
+ * multiply in a tight, fast loop where each multiply is O(1).
+ * Compute an upper bound on the number of bits required to store
+ * the answer.
+ *
+ * Storing some integer z requires floor(lg(z))+1 bits, which is
+ * conveniently the value returned by bit_length(z). The
+ * product x*y will require at most
+ * bit_length(x) + bit_length(y) bits to store, based
+ * on the idea that lg product = lg x + lg y.
+ *
+ * We know that stop - 2 is the largest number to be multiplied. From
+ * there, we have: bit_length(answer) <= num_operands *
+ * bit_length(stop - 2)
+ */
+
+ num_operands = (stop - start) / 2;
+ /* The "num_operands <= 8 * SIZEOF_LONG" check guards against the
+ * unlikely case of an overflow in num_operands * max_bits. */
+ if (num_operands <= 8 * SIZEOF_LONG &&
+ num_operands * max_bits <= 8 * SIZEOF_LONG) {
+ unsigned long j, total;
+ for (total = start, j = start + 2; j < stop; j += 2)
+ total *= j;
+ return PyLong_FromUnsignedLong(total);
+ }
+
+ /* find midpoint of range(start, stop), rounded up to next odd number. */
+ midpoint = (start + num_operands) | 1;
+ left = factorial_partial_product(start, midpoint,
+ _Py_bit_length(midpoint - 2));
+ if (left == NULL)
+ goto error;
+ right = factorial_partial_product(midpoint, stop, max_bits);
+ if (right == NULL)
+ goto error;
+ result = PyNumber_Multiply(left, right);
+
+ error:
+ Py_XDECREF(left);
+ Py_XDECREF(right);
+ return result;
+}
+
+/* factorial_odd_part: compute the odd part of factorial(n). */
+
+static PyObject *
+factorial_odd_part(unsigned long n)
+{
+ long i;
+ unsigned long v, lower, upper;
+ PyObject *partial, *tmp, *inner, *outer;
+
+ inner = PyLong_FromLong(1);
+ if (inner == NULL)
+ return NULL;
+ outer = Py_NewRef(inner);
+
+ upper = 3;
+ for (i = _Py_bit_length(n) - 2; i >= 0; i--) {
+ v = n >> i;
+ if (v <= 2)
+ continue;
+ lower = upper;
+ /* (v + 1) | 1 = least odd integer strictly larger than n / 2**i */
+ upper = (v + 1) | 1;
+ /* Here inner is the product of all odd integers j in the range (0,
+ n/2**(i+1)]. The factorial_partial_product call below gives the
+ product of all odd integers j in the range (n/2**(i+1), n/2**i]. */
+ partial = factorial_partial_product(lower, upper, _Py_bit_length(upper-2));
+ /* inner *= partial */
+ if (partial == NULL)
+ goto error;
+ tmp = PyNumber_Multiply(inner, partial);
+ Py_DECREF(partial);
+ if (tmp == NULL)
+ goto error;
+ Py_SETREF(inner, tmp);
+ /* Now inner is the product of all odd integers j in the range (0,
+ n/2**i], giving the inner product in the formula above. */
+
+ /* outer *= inner; */
+ tmp = PyNumber_Multiply(outer, inner);
+ if (tmp == NULL)
+ goto error;
+ Py_SETREF(outer, tmp);
+ }
+ Py_DECREF(inner);
+ return outer;
+
+ error:
+ Py_DECREF(outer);
+ Py_DECREF(inner);
+ return NULL;
+}
+
+
+/* Lookup table for small factorial values */
+
+static const unsigned long SmallFactorials[] = {
+ 1, 1, 2, 6, 24, 120, 720, 5040, 40320,
+ 362880, 3628800, 39916800, 479001600,
+#if SIZEOF_LONG >= 8
+ 6227020800, 87178291200, 1307674368000,
+ 20922789888000, 355687428096000, 6402373705728000,
+ 121645100408832000, 2432902008176640000
+#endif
+};
+
+/*[clinic input]
+math.factorial
+
+ n as arg: object
+ /
+
+Find n!.
+
+Raise a ValueError if x is negative or non-integral.
+[clinic start generated code]*/
+
+static PyObject *
+math_factorial(PyObject *module, PyObject *arg)
+/*[clinic end generated code: output=6686f26fae00e9ca input=713fb771677e8c31]*/
+{
+ long x, two_valuation;
+ int overflow;
+ PyObject *result, *odd_part;
+
+ x = PyLong_AsLongAndOverflow(arg, &overflow);
+ if (x == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ else if (overflow == 1) {
+ PyErr_Format(PyExc_OverflowError,
+ "factorial() argument should not exceed %ld",
+ LONG_MAX);
+ return NULL;
+ }
+ else if (overflow == -1 || x < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "factorial() not defined for negative values");
+ return NULL;
+ }
+
+ /* use lookup table if x is small */
+ if (x < (long)Py_ARRAY_LENGTH(SmallFactorials))
+ return PyLong_FromUnsignedLong(SmallFactorials[x]);
+
+ /* else express in the form odd_part * 2**two_valuation, and compute as
+ odd_part << two_valuation. */
+ odd_part = factorial_odd_part(x);
+ if (odd_part == NULL)
+ return NULL;
+ two_valuation = x - count_set_bits(x);
+ result = _PyLong_Lshift(odd_part, two_valuation);
+ Py_DECREF(odd_part);
+ return result;
+}
+
+
+/*[clinic input]
+math.trunc
+
+ x: object
+ /
+
+Truncates the Real x to the nearest Integral toward 0.
+
+Uses the __trunc__ magic method.
+[clinic start generated code]*/
+
+static PyObject *
+math_trunc(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=34b9697b707e1031 input=2168b34e0a09134d]*/
+{
+ PyObject *trunc, *result;
+
+ if (PyFloat_CheckExact(x)) {
+ return PyFloat_Type.tp_as_number->nb_int(x);
+ }
+
+ if (!_PyType_IsReady(Py_TYPE(x))) {
+ if (PyType_Ready(Py_TYPE(x)) < 0)
+ return NULL;
+ }
+
+ math_module_state *state = get_math_module_state(module);
+ trunc = _PyObject_LookupSpecial(x, state->str___trunc__);
+ if (trunc == NULL) {
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_TypeError,
+ "type %.100s doesn't define __trunc__ method",
+ Py_TYPE(x)->tp_name);
+ return NULL;
+ }
+ result = _PyObject_CallNoArgs(trunc);
+ Py_DECREF(trunc);
+ return result;
+}
+
+
+/*[clinic input]
+math.frexp
+
+ x: double
+ /
+
+Return the mantissa and exponent of x, as pair (m, e).
+
+m is a float and e is an int, such that x = m * 2.**e.
+If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.
+[clinic start generated code]*/
+
+static PyObject *
+math_frexp_impl(PyObject *module, double x)
+/*[clinic end generated code: output=03e30d252a15ad4a input=96251c9e208bc6e9]*/
+{
+ int i;
+ /* deal with special cases directly, to sidestep platform
+ differences */
+ if (Py_IS_NAN(x) || Py_IS_INFINITY(x) || !x) {
+ i = 0;
+ }
+ else {
+ x = frexp(x, &i);
+ }
+ return Py_BuildValue("(di)", x, i);
+}
+
+
+/*[clinic input]
+math.ldexp
+
+ x: double
+ i: object
+ /
+
+Return x * (2**i).
+
+This is essentially the inverse of frexp().
+[clinic start generated code]*/
+
+static PyObject *
+math_ldexp_impl(PyObject *module, double x, PyObject *i)
+/*[clinic end generated code: output=b6892f3c2df9cc6a input=17d5970c1a40a8c1]*/
+{
+ double r;
+ long exp;
+ int overflow;
+
+ if (PyLong_Check(i)) {
+ /* on overflow, replace exponent with either LONG_MAX
+ or LONG_MIN, depending on the sign. */
+ exp = PyLong_AsLongAndOverflow(i, &overflow);
+ if (exp == -1 && PyErr_Occurred())
+ return NULL;
+ if (overflow)
+ exp = overflow < 0 ? LONG_MIN : LONG_MAX;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "Expected an int as second argument to ldexp.");
+ return NULL;
+ }
+
+ if (x == 0. || !Py_IS_FINITE(x)) {
+ /* NaNs, zeros and infinities are returned unchanged */
+ r = x;
+ errno = 0;
+ } else if (exp > INT_MAX) {
+ /* overflow */
+ r = copysign(Py_HUGE_VAL, x);
+ errno = ERANGE;
+ } else if (exp < INT_MIN) {
+ /* underflow to +-0 */
+ r = copysign(0., x);
+ errno = 0;
+ } else {
+ errno = 0;
+ r = ldexp(x, (int)exp);
+ if (Py_IS_INFINITY(r))
+ errno = ERANGE;
+ }
+
+ if (errno && is_error(r))
+ return NULL;
+ return PyFloat_FromDouble(r);
+}
+
+
+/*[clinic input]
+math.modf
+
+ x: double
+ /
+
+Return the fractional and integer parts of x.
+
+Both results carry the sign of x and are floats.
+[clinic start generated code]*/
+
+static PyObject *
+math_modf_impl(PyObject *module, double x)
+/*[clinic end generated code: output=90cee0260014c3c0 input=b4cfb6786afd9035]*/
+{
+ double y;
+ /* some platforms don't do the right thing for NaNs and
+ infinities, so we take care of special cases directly. */
+ if (!Py_IS_FINITE(x)) {
+ if (Py_IS_INFINITY(x))
+ return Py_BuildValue("(dd)", copysign(0., x), x);
+ else if (Py_IS_NAN(x))
+ return Py_BuildValue("(dd)", x, x);
+ }
+
+ errno = 0;
+ x = modf(x, &y);
+ return Py_BuildValue("(dd)", x, y);
+}
+
+
+/* A decent logarithm is easy to compute even for huge ints, but libm can't
+ do that by itself -- loghelper can. func is log or log10, and name is
+ "log" or "log10". Note that overflow of the result isn't possible: an int
+ can contain no more than INT_MAX * SHIFT bits, so has value certainly less
+ than 2**(2**64 * 2**16) == 2**2**80, and log2 of that is 2**80, which is
+ small enough to fit in an IEEE single. log and log10 are even smaller.
+ However, intermediate overflow is possible for an int if the number of bits
+ in that int is larger than PY_SSIZE_T_MAX. */
+
+static PyObject*
+loghelper(PyObject* arg, double (*func)(double))
+{
+ /* If it is int, do it ourselves. */
+ if (PyLong_Check(arg)) {
+ double x, result;
+ Py_ssize_t e;
+
+ /* Negative or zero inputs give a ValueError. */
+ if (!_PyLong_IsPositive((PyLongObject *)arg)) {
+ PyErr_SetString(PyExc_ValueError,
+ "math domain error");
+ return NULL;
+ }
+
+ x = PyLong_AsDouble(arg);
+ if (x == -1.0 && PyErr_Occurred()) {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ /* Here the conversion to double overflowed, but it's possible
+ to compute the log anyway. Clear the exception and continue. */
+ PyErr_Clear();
+ x = _PyLong_Frexp((PyLongObject *)arg, &e);
+ if (x == -1.0 && PyErr_Occurred())
+ return NULL;
+ /* Value is ~= x * 2**e, so the log ~= log(x) + log(2) * e. */
+ result = func(x) + func(2.0) * e;
+ }
+ else
+ /* Successfully converted x to a double. */
+ result = func(x);
+ return PyFloat_FromDouble(result);
+ }
+
+ /* Else let libm handle it by itself. */
+ return math_1(arg, func, 0);
+}
+
+
+/* AC: cannot convert yet, see gh-102839 and gh-89381, waiting
+ for support of multiple signatures */
+static PyObject *
+math_log(PyObject *module, PyObject * const *args, Py_ssize_t nargs)
+{
+ PyObject *num, *den;
+ PyObject *ans;
+
+ if (!_PyArg_CheckPositional("log", nargs, 1, 2))
+ return NULL;
+
+ num = loghelper(args[0], m_log);
+ if (num == NULL || nargs == 1)
+ return num;
+
+ den = loghelper(args[1], m_log);
+ if (den == NULL) {
+ Py_DECREF(num);
+ return NULL;
+ }
+
+ ans = PyNumber_TrueDivide(num, den);
+ Py_DECREF(num);
+ Py_DECREF(den);
+ return ans;
+}
+
+PyDoc_STRVAR(math_log_doc,
+"log(x, [base=math.e])\n\
+Return the logarithm of x to the given base.\n\n\
+If the base is not specified, returns the natural logarithm (base e) of x.");
+
+/*[clinic input]
+math.log2
+
+ x: object
+ /
+
+Return the base 2 logarithm of x.
+[clinic start generated code]*/
+
+static PyObject *
+math_log2(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=5425899a4d5d6acb input=08321262bae4f39b]*/
+{
+ return loghelper(x, m_log2);
+}
+
+
+/*[clinic input]
+math.log10
+
+ x: object
+ /
+
+Return the base 10 logarithm of x.
+[clinic start generated code]*/
+
+static PyObject *
+math_log10(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=be72a64617df9c6f input=b2469d02c6469e53]*/
+{
+ return loghelper(x, m_log10);
+}
+
+
+/*[clinic input]
+math.fmod
+
+ x: double
+ y: double
+ /
+
+Return fmod(x, y), according to platform C.
+
+x % y may differ.
+[clinic start generated code]*/
+
+static PyObject *
+math_fmod_impl(PyObject *module, double x, double y)
+/*[clinic end generated code: output=7559d794343a27b5 input=4f84caa8cfc26a03]*/
+{
+ double r;
+ /* fmod(x, +/-Inf) returns x for finite x. */
+ if (Py_IS_INFINITY(y) && Py_IS_FINITE(x))
+ return PyFloat_FromDouble(x);
+ errno = 0;
+ r = fmod(x, y);
+ if (Py_IS_NAN(r)) {
+ if (!Py_IS_NAN(x) && !Py_IS_NAN(y))
+ errno = EDOM;
+ else
+ errno = 0;
+ }
+ if (errno && is_error(r))
+ return NULL;
+ else
+ return PyFloat_FromDouble(r);
+}
+
+/*
+Given a *vec* of values, compute the vector norm:
+
+ sqrt(sum(x ** 2 for x in vec))
+
+The *max* variable should be equal to the largest fabs(x).
+The *n* variable is the length of *vec*.
+If n==0, then *max* should be 0.0.
+If an infinity is present in the vec, *max* should be INF.
+The *found_nan* variable indicates whether some member of
+the *vec* is a NaN.
+
+To avoid overflow/underflow and to achieve high accuracy giving results
+that are almost always correctly rounded, four techniques are used:
+
+* lossless scaling using a power-of-two scaling factor
+* accurate squaring using Veltkamp-Dekker splitting [1]
+ or an equivalent with an fma() call
+* compensated summation using a variant of the Neumaier algorithm [2]
+* differential correction of the square root [3]
+
+The usual presentation of the Neumaier summation algorithm has an
+expensive branch depending on which operand has the larger
+magnitude. We avoid this cost by arranging the calculation so that
+fabs(csum) is always as large as fabs(x).
+
+To establish the invariant, *csum* is initialized to 1.0 which is
+always larger than x**2 after scaling or after division by *max*.
+After the loop is finished, the initial 1.0 is subtracted out for a
+net zero effect on the final sum. Since *csum* will be greater than
+1.0, the subtraction of 1.0 will not cause fractional digits to be
+dropped from *csum*.
+
+To get the full benefit from compensated summation, the largest
+addend should be in the range: 0.5 <= |x| <= 1.0. Accordingly,
+scaling or division by *max* should not be skipped even if not
+otherwise needed to prevent overflow or loss of precision.
+
+The assertion that hi*hi <= 1.0 is a bit subtle. Each vector element
+gets scaled to a magnitude below 1.0. The Veltkamp-Dekker splitting
+algorithm gives a *hi* value that is correctly rounded to half
+precision. When a value at or below 1.0 is correctly rounded, it
+never goes above 1.0. And when values at or below 1.0 are squared,
+they remain at or below 1.0, thus preserving the summation invariant.
+
+Another interesting assertion is that csum+lo*lo == csum. In the loop,
+each scaled vector element has a magnitude less than 1.0. After the
+Veltkamp split, *lo* has a maximum value of 2**-27. So the maximum
+value of *lo* squared is 2**-54. The value of ulp(1.0)/2.0 is 2**-53.
+Given that csum >= 1.0, we have:
+ lo**2 <= 2**-54 < 2**-53 == 1/2*ulp(1.0) <= ulp(csum)/2
+Since lo**2 is less than 1/2 ulp(csum), we have csum+lo*lo == csum.
+
+To minimize loss of information during the accumulation of fractional
+values, each term has a separate accumulator. This also breaks up
+sequential dependencies in the inner loop so the CPU can maximize
+floating point throughput. [4] On an Apple M1 Max, hypot(*vec)
+takes only 3.33 µsec when len(vec) == 1000.
+
+The square root differential correction is needed because a
+correctly rounded square root of a correctly rounded sum of
+squares can still be off by as much as one ulp.
+
+The differential correction starts with a value *x* that is
+the difference between the square of *h*, the possibly inaccurately
+rounded square root, and the accurately computed sum of squares.
+The correction is the first order term of the Maclaurin series
+expansion of sqrt(h**2 + x) == h + x/(2*h) + O(x**2). [5]
+
+Essentially, this differential correction is equivalent to one
+refinement step in Newton's divide-and-average square root
+algorithm, effectively doubling the number of accurate bits.
+This technique is used in Dekker's SQRT2 algorithm and again in
+Borges' ALGORITHM 4 and 5.
+
+The hypot() function is faithfully rounded (less than 1 ulp error)
+and usually correctly rounded (within 1/2 ulp). The squaring
+step is exact. The Neumaier summation computes as if in doubled
+precision (106 bits) and has the advantage that its input squares
+are non-negative so that the condition number of the sum is one.
+The square root with a differential correction is likewise computed
+as if in doubled precision.
+
+For n <= 1000, prior to the final addition that rounds the overall
+result, the internal accuracy of "h" together with its correction of
+"x / (2.0 * h)" is at least 100 bits. [6] Also, hypot() was tested
+against a Decimal implementation with prec=300. After 100 million
+trials, no incorrectly rounded examples were found. In addition,
+perfect commutativity (all permutations are exactly equal) was
+verified for 1 billion random inputs with n=5. [7]
+
+References:
+
+1. Veltkamp-Dekker splitting: http://csclub.uwaterloo.ca/~pbarfuss/dekker1971.pdf
+2. Compensated summation: http://www.ti3.tu-harburg.de/paper/rump/Ru08b.pdf
+3. Square root differential correction: https://arxiv.org/pdf/1904.09481.pdf
+4. Data dependency graph: https://bugs.python.org/file49439/hypot.png
+5. https://www.wolframalpha.com/input/?i=Maclaurin+series+sqrt%28h**2+%2B+x%29+at+x%3D0
+6. Analysis of internal accuracy: https://bugs.python.org/file49484/best_frac.py
+7. Commutativity test: https://bugs.python.org/file49448/test_hypot_commutativity.py
+
+*/
+
+static inline double
+vector_norm(Py_ssize_t n, double *vec, double max, int found_nan)
+{
+ double x, h, scale, csum = 1.0, frac1 = 0.0, frac2 = 0.0;
+ DoubleLength pr, sm;
+ int max_e;
+ Py_ssize_t i;
+
+ if (Py_IS_INFINITY(max)) {
+ return max;
+ }
+ if (found_nan) {
+ return Py_NAN;
+ }
+ if (max == 0.0 || n <= 1) {
+ return max;
+ }
+ frexp(max, &max_e);
+ if (max_e < -1023) {
+ /* When max_e < -1023, ldexp(1.0, -max_e) would overflow. */
+ for (i=0 ; i < n ; i++) {
+ vec[i] /= DBL_MIN; // convert subnormals to normals
+ }
+ return DBL_MIN * vector_norm(n, vec, max / DBL_MIN, found_nan);
+ }
+ scale = ldexp(1.0, -max_e);
+ assert(max * scale >= 0.5);
+ assert(max * scale < 1.0);
+ for (i=0 ; i < n ; i++) {
+ x = vec[i];
+ assert(Py_IS_FINITE(x) && fabs(x) <= max);
+ x *= scale; // lossless scaling
+ assert(fabs(x) < 1.0);
+ pr = dl_mul(x, x); // lossless squaring
+ assert(pr.hi <= 1.0);
+ sm = dl_fast_sum(csum, pr.hi); // lossless addition
+ csum = sm.hi;
+ frac1 += pr.lo; // lossy addition
+ frac2 += sm.lo; // lossy addition
+ }
+ h = sqrt(csum - 1.0 + (frac1 + frac2));
+ pr = dl_mul(-h, h);
+ sm = dl_fast_sum(csum, pr.hi);
+ csum = sm.hi;
+ frac1 += pr.lo;
+ frac2 += sm.lo;
+ x = csum - 1.0 + (frac1 + frac2);
+ h += x / (2.0 * h); // differential correction
+ return h / scale;
+}
+
+#define NUM_STACK_ELEMS 16
+
+/*[clinic input]
+math.dist
+
+ p: object
+ q: object
+ /
+
+Return the Euclidean distance between two points p and q.
+
+The points should be specified as sequences (or iterables) of
+coordinates. Both inputs must have the same dimension.
+
+Roughly equivalent to:
+ sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))
+[clinic start generated code]*/
+
+static PyObject *
+math_dist_impl(PyObject *module, PyObject *p, PyObject *q)
+/*[clinic end generated code: output=56bd9538d06bbcfe input=74e85e1b6092e68e]*/
+{
+ PyObject *item;
+ double max = 0.0;
+ double x, px, qx, result;
+ Py_ssize_t i, m, n;
+ int found_nan = 0, p_allocated = 0, q_allocated = 0;
+ double diffs_on_stack[NUM_STACK_ELEMS];
+ double *diffs = diffs_on_stack;
+
+ if (!PyTuple_Check(p)) {
+ p = PySequence_Tuple(p);
+ if (p == NULL) {
+ return NULL;
+ }
+ p_allocated = 1;
+ }
+ if (!PyTuple_Check(q)) {
+ q = PySequence_Tuple(q);
+ if (q == NULL) {
+ if (p_allocated) {
+ Py_DECREF(p);
+ }
+ return NULL;
+ }
+ q_allocated = 1;
+ }
+
+ m = PyTuple_GET_SIZE(p);
+ n = PyTuple_GET_SIZE(q);
+ if (m != n) {
+ PyErr_SetString(PyExc_ValueError,
+ "both points must have the same number of dimensions");
+ goto error_exit;
+ }
+ if (n > NUM_STACK_ELEMS) {
+ diffs = (double *) PyObject_Malloc(n * sizeof(double));
+ if (diffs == NULL) {
+ PyErr_NoMemory();
+ goto error_exit;
+ }
+ }
+ for (i=0 ; i<n ; i++) {
+ item = PyTuple_GET_ITEM(p, i);
+ ASSIGN_DOUBLE(px, item, error_exit);
+ item = PyTuple_GET_ITEM(q, i);
+ ASSIGN_DOUBLE(qx, item, error_exit);
+ x = fabs(px - qx);
+ diffs[i] = x;
+ found_nan |= Py_IS_NAN(x);
+ if (x > max) {
+ max = x;
+ }
+ }
+ result = vector_norm(n, diffs, max, found_nan);
+ if (diffs != diffs_on_stack) {
+ PyObject_Free(diffs);
+ }
+ if (p_allocated) {
+ Py_DECREF(p);
+ }
+ if (q_allocated) {
+ Py_DECREF(q);
+ }
+ return PyFloat_FromDouble(result);
+
+ error_exit:
+ if (diffs != diffs_on_stack) {
+ PyObject_Free(diffs);
+ }
+ if (p_allocated) {
+ Py_DECREF(p);
+ }
+ if (q_allocated) {
+ Py_DECREF(q);
+ }
+ return NULL;
+}
+
+/* AC: cannot convert yet, waiting for *args support */
+static PyObject *
+math_hypot(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
+{
+ Py_ssize_t i;
+ PyObject *item;
+ double max = 0.0;
+ double x, result;
+ int found_nan = 0;
+ double coord_on_stack[NUM_STACK_ELEMS];
+ double *coordinates = coord_on_stack;
+
+ if (nargs > NUM_STACK_ELEMS) {
+ coordinates = (double *) PyObject_Malloc(nargs * sizeof(double));
+ if (coordinates == NULL) {
+ return PyErr_NoMemory();
+ }
+ }
+ for (i = 0; i < nargs; i++) {
+ item = args[i];
+ ASSIGN_DOUBLE(x, item, error_exit);
+ x = fabs(x);
+ coordinates[i] = x;
+ found_nan |= Py_IS_NAN(x);
+ if (x > max) {
+ max = x;
+ }
+ }
+ result = vector_norm(nargs, coordinates, max, found_nan);
+ if (coordinates != coord_on_stack) {
+ PyObject_Free(coordinates);
+ }
+ return PyFloat_FromDouble(result);
+
+ error_exit:
+ if (coordinates != coord_on_stack) {
+ PyObject_Free(coordinates);
+ }
+ return NULL;
+}
+
+#undef NUM_STACK_ELEMS
+
+PyDoc_STRVAR(math_hypot_doc,
+ "hypot(*coordinates) -> value\n\n\
+Multidimensional Euclidean distance from the origin to a point.\n\
+\n\
+Roughly equivalent to:\n\
+ sqrt(sum(x**2 for x in coordinates))\n\
+\n\
+For a two dimensional point (x, y), gives the hypotenuse\n\
+using the Pythagorean theorem: sqrt(x*x + y*y).\n\
+\n\
+For example, the hypotenuse of a 3/4/5 right triangle is:\n\
+\n\
+ >>> hypot(3.0, 4.0)\n\
+ 5.0\n\
+");
+
+/** sumprod() ***************************************************************/
+
+/* Forward declaration */
+static inline int _check_long_mult_overflow(long a, long b);
+
+static inline bool
+long_add_would_overflow(long a, long b)
+{
+ return (a > 0) ? (b > LONG_MAX - a) : (b < LONG_MIN - a);
+}
+
+/*[clinic input]
+math.sumprod
+
+ p: object
+ q: object
+ /
+
+Return the sum of products of values from two iterables p and q.
+
+Roughly equivalent to:
+
+ sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))
+
+For float and mixed int/float inputs, the intermediate products
+and sums are computed with extended precision.
+[clinic start generated code]*/
+
+static PyObject *
+math_sumprod_impl(PyObject *module, PyObject *p, PyObject *q)
+/*[clinic end generated code: output=6722dbfe60664554 input=82be54fe26f87e30]*/
+{
+ PyObject *p_i = NULL, *q_i = NULL, *term_i = NULL, *new_total = NULL;
+ PyObject *p_it, *q_it, *total;
+ iternextfunc p_next, q_next;
+ bool p_stopped = false, q_stopped = false;
+ bool int_path_enabled = true, int_total_in_use = false;
+ bool flt_path_enabled = true, flt_total_in_use = false;
+ long int_total = 0;
+ TripleLength flt_total = tl_zero;
+
+ p_it = PyObject_GetIter(p);
+ if (p_it == NULL) {
+ return NULL;
+ }
+ q_it = PyObject_GetIter(q);
+ if (q_it == NULL) {
+ Py_DECREF(p_it);
+ return NULL;
+ }
+ total = PyLong_FromLong(0);
+ if (total == NULL) {
+ Py_DECREF(p_it);
+ Py_DECREF(q_it);
+ return NULL;
+ }
+ p_next = *Py_TYPE(p_it)->tp_iternext;
+ q_next = *Py_TYPE(q_it)->tp_iternext;
+ while (1) {
+ bool finished;
+
+ assert (p_i == NULL);
+ assert (q_i == NULL);
+ assert (term_i == NULL);
+ assert (new_total == NULL);
+
+ assert (p_it != NULL);
+ assert (q_it != NULL);
+ assert (total != NULL);
+
+ p_i = p_next(p_it);
+ if (p_i == NULL) {
+ if (PyErr_Occurred()) {
+ if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
+ goto err_exit;
+ }
+ PyErr_Clear();
+ }
+ p_stopped = true;
+ }
+ q_i = q_next(q_it);
+ if (q_i == NULL) {
+ if (PyErr_Occurred()) {
+ if (!PyErr_ExceptionMatches(PyExc_StopIteration)) {
+ goto err_exit;
+ }
+ PyErr_Clear();
+ }
+ q_stopped = true;
+ }
+ if (p_stopped != q_stopped) {
+ PyErr_Format(PyExc_ValueError, "Inputs are not the same length");
+ goto err_exit;
+ }
+ finished = p_stopped & q_stopped;
+
+ if (int_path_enabled) {
+
+ if (!finished && PyLong_CheckExact(p_i) & PyLong_CheckExact(q_i)) {
+ int overflow;
+ long int_p, int_q, int_prod;
+
+ int_p = PyLong_AsLongAndOverflow(p_i, &overflow);
+ if (overflow) {
+ goto finalize_int_path;
+ }
+ int_q = PyLong_AsLongAndOverflow(q_i, &overflow);
+ if (overflow) {
+ goto finalize_int_path;
+ }
+ if (_check_long_mult_overflow(int_p, int_q)) {
+ goto finalize_int_path;
+ }
+ int_prod = int_p * int_q;
+ if (long_add_would_overflow(int_total, int_prod)) {
+ goto finalize_int_path;
+ }
+ int_total += int_prod;
+ int_total_in_use = true;
+ Py_CLEAR(p_i);
+ Py_CLEAR(q_i);
+ continue;
+ }
+
+ finalize_int_path:
+ // We're finished, overflowed, or have a non-int
+ int_path_enabled = false;
+ if (int_total_in_use) {
+ term_i = PyLong_FromLong(int_total);
+ if (term_i == NULL) {
+ goto err_exit;
+ }
+ new_total = PyNumber_Add(total, term_i);
+ if (new_total == NULL) {
+ goto err_exit;
+ }
+ Py_SETREF(total, new_total);
+ new_total = NULL;
+ Py_CLEAR(term_i);
+ int_total = 0; // An ounce of prevention, ...
+ int_total_in_use = false;
+ }
+ }
+
+ if (flt_path_enabled) {
+
+ if (!finished) {
+ double flt_p, flt_q;
+ bool p_type_float = PyFloat_CheckExact(p_i);
+ bool q_type_float = PyFloat_CheckExact(q_i);
+ if (p_type_float && q_type_float) {
+ flt_p = PyFloat_AS_DOUBLE(p_i);
+ flt_q = PyFloat_AS_DOUBLE(q_i);
+ } else if (p_type_float && (PyLong_CheckExact(q_i) || PyBool_Check(q_i))) {
+ /* We care about float/int pairs and int/float pairs because
+ they arise naturally in several use cases such as price
+ times quantity, measurements with integer weights, or
+ data selected by a vector of bools. */
+ flt_p = PyFloat_AS_DOUBLE(p_i);
+ flt_q = PyLong_AsDouble(q_i);
+ if (flt_q == -1.0 && PyErr_Occurred()) {
+ PyErr_Clear();
+ goto finalize_flt_path;
+ }
+ } else if (q_type_float && (PyLong_CheckExact(p_i) || PyBool_Check(p_i))) {
+ flt_q = PyFloat_AS_DOUBLE(q_i);
+ flt_p = PyLong_AsDouble(p_i);
+ if (flt_p == -1.0 && PyErr_Occurred()) {
+ PyErr_Clear();
+ goto finalize_flt_path;
+ }
+ } else {
+ goto finalize_flt_path;
+ }
+ TripleLength new_flt_total = tl_fma(flt_p, flt_q, flt_total);
+ if (isfinite(new_flt_total.hi)) {
+ flt_total = new_flt_total;
+ flt_total_in_use = true;
+ Py_CLEAR(p_i);
+ Py_CLEAR(q_i);
+ continue;
+ }
+ }
+
+ finalize_flt_path:
+ // We're finished, overflowed, have a non-float, or got a non-finite value
+ flt_path_enabled = false;
+ if (flt_total_in_use) {
+ term_i = PyFloat_FromDouble(tl_to_d(flt_total));
+ if (term_i == NULL) {
+ goto err_exit;
+ }
+ new_total = PyNumber_Add(total, term_i);
+ if (new_total == NULL) {
+ goto err_exit;
+ }
+ Py_SETREF(total, new_total);
+ new_total = NULL;
+ Py_CLEAR(term_i);
+ flt_total = tl_zero;
+ flt_total_in_use = false;
+ }
+ }
+
+ assert(!int_total_in_use);
+ assert(!flt_total_in_use);
+ if (finished) {
+ goto normal_exit;
+ }
+ term_i = PyNumber_Multiply(p_i, q_i);
+ if (term_i == NULL) {
+ goto err_exit;
+ }
+ new_total = PyNumber_Add(total, term_i);
+ if (new_total == NULL) {
+ goto err_exit;
+ }
+ Py_SETREF(total, new_total);
+ new_total = NULL;
+ Py_CLEAR(p_i);
+ Py_CLEAR(q_i);
+ Py_CLEAR(term_i);
+ }
+
+ normal_exit:
+ Py_DECREF(p_it);
+ Py_DECREF(q_it);
+ return total;
+
+ err_exit:
+ Py_DECREF(p_it);
+ Py_DECREF(q_it);
+ Py_DECREF(total);
+ Py_XDECREF(p_i);
+ Py_XDECREF(q_i);
+ Py_XDECREF(term_i);
+ Py_XDECREF(new_total);
+ return NULL;
+}
+
+
+/* pow can't use math_2, but needs its own wrapper: the problem is
+ that an infinite result can arise either as a result of overflow
+ (in which case OverflowError should be raised) or as a result of
+ e.g. 0.**-5. (for which ValueError needs to be raised.)
+*/
+
+/*[clinic input]
+math.pow
+
+ x: double
+ y: double
+ /
+
+Return x**y (x to the power of y).
+[clinic start generated code]*/
+
+static PyObject *
+math_pow_impl(PyObject *module, double x, double y)
+/*[clinic end generated code: output=fff93e65abccd6b0 input=c26f1f6075088bfd]*/
+{
+ double r;
+ int odd_y;
+
+ /* deal directly with IEEE specials, to cope with problems on various
+ platforms whose semantics don't exactly match C99 */
+ r = 0.; /* silence compiler warning */
+ if (!Py_IS_FINITE(x) || !Py_IS_FINITE(y)) {
+ errno = 0;
+ if (Py_IS_NAN(x))
+ r = y == 0. ? 1. : x; /* NaN**0 = 1 */
+ else if (Py_IS_NAN(y))
+ r = x == 1. ? 1. : y; /* 1**NaN = 1 */
+ else if (Py_IS_INFINITY(x)) {
+ odd_y = Py_IS_FINITE(y) && fmod(fabs(y), 2.0) == 1.0;
+ if (y > 0.)
+ r = odd_y ? x : fabs(x);
+ else if (y == 0.)
+ r = 1.;
+ else /* y < 0. */
+ r = odd_y ? copysign(0., x) : 0.;
+ }
+ else if (Py_IS_INFINITY(y)) {
+ if (fabs(x) == 1.0)
+ r = 1.;
+ else if (y > 0. && fabs(x) > 1.0)
+ r = y;
+ else if (y < 0. && fabs(x) < 1.0) {
+ r = -y; /* result is +inf */
+ }
+ else
+ r = 0.;
+ }
+ }
+ else {
+ /* let libm handle finite**finite */
+ errno = 0;
+ r = pow(x, y);
+ /* a NaN result should arise only from (-ve)**(finite
+ non-integer); in this case we want to raise ValueError. */
+ if (!Py_IS_FINITE(r)) {
+ if (Py_IS_NAN(r)) {
+ errno = EDOM;
+ }
+ /*
+ an infinite result here arises either from:
+ (A) (+/-0.)**negative (-> divide-by-zero)
+ (B) overflow of x**y with x and y finite
+ */
+ else if (Py_IS_INFINITY(r)) {
+ if (x == 0.)
+ errno = EDOM;
+ else
+ errno = ERANGE;
+ }
+ }
+ }
+
+ if (errno && is_error(r))
+ return NULL;
+ else
+ return PyFloat_FromDouble(r);
+}
+
+
+static const double degToRad = Py_MATH_PI / 180.0;
+static const double radToDeg = 180.0 / Py_MATH_PI;
+
+/*[clinic input]
+math.degrees
+
+ x: double
+ /
+
+Convert angle x from radians to degrees.
+[clinic start generated code]*/
+
+static PyObject *
+math_degrees_impl(PyObject *module, double x)
+/*[clinic end generated code: output=7fea78b294acd12f input=81e016555d6e3660]*/
+{
+ return PyFloat_FromDouble(x * radToDeg);
+}
+
+
+/*[clinic input]
+math.radians
+
+ x: double
+ /
+
+Convert angle x from degrees to radians.
+[clinic start generated code]*/
+
+static PyObject *
+math_radians_impl(PyObject *module, double x)
+/*[clinic end generated code: output=34daa47caf9b1590 input=91626fc489fe3d63]*/
+{
+ return PyFloat_FromDouble(x * degToRad);
+}
+
+
+/*[clinic input]
+math.isfinite
+
+ x: double
+ /
+
+Return True if x is neither an infinity nor a NaN, and False otherwise.
+[clinic start generated code]*/
+
+static PyObject *
+math_isfinite_impl(PyObject *module, double x)
+/*[clinic end generated code: output=8ba1f396440c9901 input=46967d254812e54a]*/
+{
+ return PyBool_FromLong((long)Py_IS_FINITE(x));
+}
+
+
+/*[clinic input]
+math.isnan
+
+ x: double
+ /
+
+Return True if x is a NaN (not a number), and False otherwise.
+[clinic start generated code]*/
+
+static PyObject *
+math_isnan_impl(PyObject *module, double x)
+/*[clinic end generated code: output=f537b4d6df878c3e input=935891e66083f46a]*/
+{
+ return PyBool_FromLong((long)Py_IS_NAN(x));
+}
+
+
+/*[clinic input]
+math.isinf
+
+ x: double
+ /
+
+Return True if x is a positive or negative infinity, and False otherwise.
+[clinic start generated code]*/
+
+static PyObject *
+math_isinf_impl(PyObject *module, double x)
+/*[clinic end generated code: output=9f00cbec4de7b06b input=32630e4212cf961f]*/
+{
+ return PyBool_FromLong((long)Py_IS_INFINITY(x));
+}
+
+
+/*[clinic input]
+math.isclose -> bool
+
+ a: double
+ b: double
+ *
+ rel_tol: double = 1e-09
+ maximum difference for being considered "close", relative to the
+ magnitude of the input values
+ abs_tol: double = 0.0
+ maximum difference for being considered "close", regardless of the
+ magnitude of the input values
+
+Determine whether two floating point numbers are close in value.
+
+Return True if a is close in value to b, and False otherwise.
+
+For the values to be considered close, the difference between them
+must be smaller than at least one of the tolerances.
+
+-inf, inf and NaN behave similarly to the IEEE 754 Standard. That
+is, NaN is not close to anything, even itself. inf and -inf are
+only close to themselves.
+[clinic start generated code]*/
+
+static int
+math_isclose_impl(PyObject *module, double a, double b, double rel_tol,
+ double abs_tol)
+/*[clinic end generated code: output=b73070207511952d input=f28671871ea5bfba]*/
+{
+ double diff = 0.0;
+
+ /* sanity check on the inputs */
+ if (rel_tol < 0.0 || abs_tol < 0.0 ) {
+ PyErr_SetString(PyExc_ValueError,
+ "tolerances must be non-negative");
+ return -1;
+ }
+
+ if ( a == b ) {
+ /* short circuit exact equality -- needed to catch two infinities of
+ the same sign. And perhaps speeds things up a bit sometimes.
+ */
+ return 1;
+ }
+
+ /* This catches the case of two infinities of opposite sign, or
+ one infinity and one finite number. Two infinities of opposite
+ sign would otherwise have an infinite relative tolerance.
+ Two infinities of the same sign are caught by the equality check
+ above.
+ */
+
+ if (Py_IS_INFINITY(a) || Py_IS_INFINITY(b)) {
+ return 0;
+ }
+
+ /* now do the regular computation
+ this is essentially the "weak" test from the Boost library
+ */
+
+ diff = fabs(b - a);
+
+ return (((diff <= fabs(rel_tol * b)) ||
+ (diff <= fabs(rel_tol * a))) ||
+ (diff <= abs_tol));
+}
+
+static inline int
+_check_long_mult_overflow(long a, long b) {
+
+ /* From Python2's int_mul code:
+
+ Integer overflow checking for * is painful: Python tried a couple ways, but
+ they didn't work on all platforms, or failed in endcases (a product of
+ -sys.maxint-1 has been a particular pain).
+
+ Here's another way:
+
+ The native long product x*y is either exactly right or *way* off, being
+ just the last n bits of the true product, where n is the number of bits
+ in a long (the delivered product is the true product plus i*2**n for
+ some integer i).
+
+ The native double product (double)x * (double)y is subject to three
+ rounding errors: on a sizeof(long)==8 box, each cast to double can lose
+ info, and even on a sizeof(long)==4 box, the multiplication can lose info.
+ But, unlike the native long product, it's not in *range* trouble: even
+ if sizeof(long)==32 (256-bit longs), the product easily fits in the
+ dynamic range of a double. So the leading 50 (or so) bits of the double
+ product are correct.
+
+ We check these two ways against each other, and declare victory if they're
+ approximately the same. Else, because the native long product is the only
+ one that can lose catastrophic amounts of information, it's the native long
+ product that must have overflowed.
+
+ */
+
+ long longprod = (long)((unsigned long)a * b);
+ double doubleprod = (double)a * (double)b;
+ double doubled_longprod = (double)longprod;
+
+ if (doubled_longprod == doubleprod) {
+ return 0;
+ }
+
+ const double diff = doubled_longprod - doubleprod;
+ const double absdiff = diff >= 0.0 ? diff : -diff;
+ const double absprod = doubleprod >= 0.0 ? doubleprod : -doubleprod;
+
+ if (32.0 * absdiff <= absprod) {
+ return 0;
+ }
+
+ return 1;
+}
+
+/*[clinic input]
+math.prod
+
+ iterable: object
+ /
+ *
+ start: object(c_default="NULL") = 1
+
+Calculate the product of all the elements in the input iterable.
+
+The default start value for the product is 1.
+
+When the iterable is empty, return the start value. This function is
+intended specifically for use with numeric values and may reject
+non-numeric types.
+[clinic start generated code]*/
+
+static PyObject *
+math_prod_impl(PyObject *module, PyObject *iterable, PyObject *start)
+/*[clinic end generated code: output=36153bedac74a198 input=4c5ab0682782ed54]*/
+{
+ PyObject *result = start;
+ PyObject *temp, *item, *iter;
+
+ iter = PyObject_GetIter(iterable);
+ if (iter == NULL) {
+ return NULL;
+ }
+
+ if (result == NULL) {
+ result = _PyLong_GetOne();
+ }
+ Py_INCREF(result);
+#ifndef SLOW_PROD
+ /* Fast paths for integers keeping temporary products in C.
+ * Assumes all inputs are the same type.
+ * If the assumption fails, default to use PyObjects instead.
+ */
+ if (PyLong_CheckExact(result)) {
+ int overflow;
+ long i_result = PyLong_AsLongAndOverflow(result, &overflow);
+ /* If this already overflowed, don't even enter the loop. */
+ if (overflow == 0) {
+ Py_SETREF(result, NULL);
+ }
+ /* Loop over all the items in the iterable until we finish, we overflow
+ * or we found a non integer element */
+ while (result == NULL) {
+ item = PyIter_Next(iter);
+ if (item == NULL) {
+ Py_DECREF(iter);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ return PyLong_FromLong(i_result);
+ }
+ if (PyLong_CheckExact(item)) {
+ long b = PyLong_AsLongAndOverflow(item, &overflow);
+ if (overflow == 0 && !_check_long_mult_overflow(i_result, b)) {
+ long x = i_result * b;
+ i_result = x;
+ Py_DECREF(item);
+ continue;
+ }
+ }
+ /* Either overflowed or is not an int.
+ * Restore real objects and process normally */
+ result = PyLong_FromLong(i_result);
+ if (result == NULL) {
+ Py_DECREF(item);
+ Py_DECREF(iter);
+ return NULL;
+ }
+ temp = PyNumber_Multiply(result, item);
+ Py_DECREF(result);
+ Py_DECREF(item);
+ result = temp;
+ if (result == NULL) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ }
+ }
+
+ /* Fast paths for floats keeping temporary products in C.
+ * Assumes all inputs are the same type.
+ * If the assumption fails, default to use PyObjects instead.
+ */
+ if (PyFloat_CheckExact(result)) {
+ double f_result = PyFloat_AS_DOUBLE(result);
+ Py_SETREF(result, NULL);
+ while(result == NULL) {
+ item = PyIter_Next(iter);
+ if (item == NULL) {
+ Py_DECREF(iter);
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ return PyFloat_FromDouble(f_result);
+ }
+ if (PyFloat_CheckExact(item)) {
+ f_result *= PyFloat_AS_DOUBLE(item);
+ Py_DECREF(item);
+ continue;
+ }
+ if (PyLong_CheckExact(item)) {
+ long value;
+ int overflow;
+ value = PyLong_AsLongAndOverflow(item, &overflow);
+ if (!overflow) {
+ f_result *= (double)value;
+ Py_DECREF(item);
+ continue;
+ }
+ }
+ result = PyFloat_FromDouble(f_result);
+ if (result == NULL) {
+ Py_DECREF(item);
+ Py_DECREF(iter);
+ return NULL;
+ }
+ temp = PyNumber_Multiply(result, item);
+ Py_DECREF(result);
+ Py_DECREF(item);
+ result = temp;
+ if (result == NULL) {
+ Py_DECREF(iter);
+ return NULL;
+ }
+ }
+ }
+#endif
+ /* Consume rest of the iterable (if any) that could not be handled
+ * by specialized functions above.*/
+ for(;;) {
+ item = PyIter_Next(iter);
+ if (item == NULL) {
+ /* error, or end-of-sequence */
+ if (PyErr_Occurred()) {
+ Py_SETREF(result, NULL);
+ }
+ break;
+ }
+ temp = PyNumber_Multiply(result, item);
+ Py_DECREF(result);
+ Py_DECREF(item);
+ result = temp;
+ if (result == NULL)
+ break;
+ }
+ Py_DECREF(iter);
+ return result;
+}
+
+
+/* least significant 64 bits of the odd part of factorial(n), for n in range(128).
+
+Python code to generate the values:
+
+ import math
+
+ for n in range(128):
+ fac = math.factorial(n)
+ fac_odd_part = fac // (fac & -fac)
+ reduced_fac_odd_part = fac_odd_part % (2**64)
+ print(f"{reduced_fac_odd_part:#018x}u")
+*/
+static const uint64_t reduced_factorial_odd_part[] = {
+ 0x0000000000000001u, 0x0000000000000001u, 0x0000000000000001u, 0x0000000000000003u,
+ 0x0000000000000003u, 0x000000000000000fu, 0x000000000000002du, 0x000000000000013bu,
+ 0x000000000000013bu, 0x0000000000000b13u, 0x000000000000375fu, 0x0000000000026115u,
+ 0x000000000007233fu, 0x00000000005cca33u, 0x0000000002898765u, 0x00000000260eeeebu,
+ 0x00000000260eeeebu, 0x0000000286fddd9bu, 0x00000016beecca73u, 0x000001b02b930689u,
+ 0x00000870d9df20adu, 0x0000b141df4dae31u, 0x00079dd498567c1bu, 0x00af2e19afc5266du,
+ 0x020d8a4d0f4f7347u, 0x335281867ec241efu, 0x9b3093d46fdd5923u, 0x5e1f9767cc5866b1u,
+ 0x92dd23d6966aced7u, 0xa30d0f4f0a196e5bu, 0x8dc3e5a1977d7755u, 0x2ab8ce915831734bu,
+ 0x2ab8ce915831734bu, 0x81d2a0bc5e5fdcabu, 0x9efcac82445da75bu, 0xbc8b95cf58cde171u,
+ 0xa0e8444a1f3cecf9u, 0x4191deb683ce3ffdu, 0xddd3878bc84ebfc7u, 0xcb39a64b83ff3751u,
+ 0xf8203f7993fc1495u, 0xbd2a2a78b35f4bddu, 0x84757be6b6d13921u, 0x3fbbcfc0b524988bu,
+ 0xbd11ed47c8928df9u, 0x3c26b59e41c2f4c5u, 0x677a5137e883fdb3u, 0xff74e943b03b93ddu,
+ 0xfe5ebbcb10b2bb97u, 0xb021f1de3235e7e7u, 0x33509eb2e743a58fu, 0x390f9da41279fb7du,
+ 0xe5cb0154f031c559u, 0x93074695ba4ddb6du, 0x81c471caa636247fu, 0xe1347289b5a1d749u,
+ 0x286f21c3f76ce2ffu, 0x00be84a2173e8ac7u, 0x1595065ca215b88bu, 0xf95877595b018809u,
+ 0x9c2efe3c5516f887u, 0x373294604679382bu, 0xaf1ff7a888adcd35u, 0x18ddf279a2c5800bu,
+ 0x18ddf279a2c5800bu, 0x505a90e2542582cbu, 0x5bacad2cd8d5dc2bu, 0xfe3152bcbff89f41u,
+ 0xe1467e88bf829351u, 0xb8001adb9e31b4d5u, 0x2803ac06a0cbb91fu, 0x1904b5d698805799u,
+ 0xe12a648b5c831461u, 0x3516abbd6160cfa9u, 0xac46d25f12fe036du, 0x78bfa1da906b00efu,
+ 0xf6390338b7f111bdu, 0x0f25f80f538255d9u, 0x4ec8ca55b8db140fu, 0x4ff670740b9b30a1u,
+ 0x8fd032443a07f325u, 0x80dfe7965c83eeb5u, 0xa3dc1714d1213afdu, 0x205b7bbfcdc62007u,
+ 0xa78126bbe140a093u, 0x9de1dc61ca7550cfu, 0x84f0046d01b492c5u, 0x2d91810b945de0f3u,
+ 0xf5408b7f6008aa71u, 0x43707f4863034149u, 0xdac65fb9679279d5u, 0xc48406e7d1114eb7u,
+ 0xa7dc9ed3c88e1271u, 0xfb25b2efdb9cb30du, 0x1bebda0951c4df63u, 0x5c85e975580ee5bdu,
+ 0x1591bc60082cb137u, 0x2c38606318ef25d7u, 0x76ca72f7c5c63e27u, 0xf04a75d17baa0915u,
+ 0x77458175139ae30du, 0x0e6c1330bc1b9421u, 0xdf87d2b5797e8293u, 0xefa5c703e1e68925u,
+ 0x2b6b1b3278b4f6e1u, 0xceee27b382394249u, 0xd74e3829f5dab91du, 0xfdb17989c26b5f1fu,
+ 0xc1b7d18781530845u, 0x7b4436b2105a8561u, 0x7ba7c0418372a7d7u, 0x9dbc5c67feb6c639u,
+ 0x502686d7f6ff6b8fu, 0x6101855406be7a1fu, 0x9956afb5806930e7u, 0xe1f0ee88af40f7c5u,
+ 0x984b057bda5c1151u, 0x9a49819acc13ea05u, 0x8ef0dead0896ef27u, 0x71f7826efe292b21u,
+ 0xad80a480e46986efu, 0x01cdc0ebf5e0c6f7u, 0x6e06f839968f68dbu, 0xdd5943ab56e76139u,
+ 0xcdcf31bf8604c5e7u, 0x7e2b4a847054a1cbu, 0x0ca75697a4d3d0f5u, 0x4703f53ac514a98bu,
+};
+
+/* inverses of reduced_factorial_odd_part values modulo 2**64.
+
+Python code to generate the values:
+
+ import math
+
+ for n in range(128):
+ fac = math.factorial(n)
+ fac_odd_part = fac // (fac & -fac)
+ inverted_fac_odd_part = pow(fac_odd_part, -1, 2**64)
+ print(f"{inverted_fac_odd_part:#018x}u")
+*/
+static const uint64_t inverted_factorial_odd_part[] = {
+ 0x0000000000000001u, 0x0000000000000001u, 0x0000000000000001u, 0xaaaaaaaaaaaaaaabu,
+ 0xaaaaaaaaaaaaaaabu, 0xeeeeeeeeeeeeeeefu, 0x4fa4fa4fa4fa4fa5u, 0x2ff2ff2ff2ff2ff3u,
+ 0x2ff2ff2ff2ff2ff3u, 0x938cc70553e3771bu, 0xb71c27cddd93e49fu, 0xb38e3229fcdee63du,
+ 0xe684bb63544a4cbfu, 0xc2f684917ca340fbu, 0xf747c9cba417526du, 0xbb26eb51d7bd49c3u,
+ 0xbb26eb51d7bd49c3u, 0xb0a7efb985294093u, 0xbe4b8c69f259eabbu, 0x6854d17ed6dc4fb9u,
+ 0xe1aa904c915f4325u, 0x3b8206df131cead1u, 0x79c6009fea76fe13u, 0xd8c5d381633cd365u,
+ 0x4841f12b21144677u, 0x4a91ff68200b0d0fu, 0x8f9513a58c4f9e8bu, 0x2b3e690621a42251u,
+ 0x4f520f00e03c04e7u, 0x2edf84ee600211d3u, 0xadcaa2764aaacdfdu, 0x161f4f9033f4fe63u,
+ 0x161f4f9033f4fe63u, 0xbada2932ea4d3e03u, 0xcec189f3efaa30d3u, 0xf7475bb68330bf91u,
+ 0x37eb7bf7d5b01549u, 0x46b35660a4e91555u, 0xa567c12d81f151f7u, 0x4c724007bb2071b1u,
+ 0x0f4a0cce58a016bdu, 0xfa21068e66106475u, 0x244ab72b5a318ae1u, 0x366ce67e080d0f23u,
+ 0xd666fdae5dd2a449u, 0xd740ddd0acc06a0du, 0xb050bbbb28e6f97bu, 0x70b003fe890a5c75u,
+ 0xd03aabff83037427u, 0x13ec4ca72c783bd7u, 0x90282c06afdbd96fu, 0x4414ddb9db4a95d5u,
+ 0xa2c68735ae6832e9u, 0xbf72d71455676665u, 0xa8469fab6b759b7fu, 0xc1e55b56e606caf9u,
+ 0x40455630fc4a1cffu, 0x0120a7b0046d16f7u, 0xa7c3553b08faef23u, 0x9f0bfd1b08d48639u,
+ 0xa433ffce9a304d37u, 0xa22ad1d53915c683u, 0xcb6cbc723ba5dd1du, 0x547fb1b8ab9d0ba3u,
+ 0x547fb1b8ab9d0ba3u, 0x8f15a826498852e3u, 0x32e1a03f38880283u, 0x3de4cce63283f0c1u,
+ 0x5dfe6667e4da95b1u, 0xfda6eeeef479e47du, 0xf14de991cc7882dfu, 0xe68db79247630ca9u,
+ 0xa7d6db8207ee8fa1u, 0x255e1f0fcf034499u, 0xc9a8990e43dd7e65u, 0x3279b6f289702e0fu,
+ 0xe7b5905d9b71b195u, 0x03025ba41ff0da69u, 0xb7df3d6d3be55aefu, 0xf89b212ebff2b361u,
+ 0xfe856d095996f0adu, 0xd6e533e9fdf20f9du, 0xf8c0e84a63da3255u, 0xa677876cd91b4db7u,
+ 0x07ed4f97780d7d9bu, 0x90a8705f258db62fu, 0xa41bbb2be31b1c0du, 0x6ec28690b038383bu,
+ 0xdb860c3bb2edd691u, 0x0838286838a980f9u, 0x558417a74b36f77du, 0x71779afc3646ef07u,
+ 0x743cda377ccb6e91u, 0x7fdf9f3fe89153c5u, 0xdc97d25df49b9a4bu, 0x76321a778eb37d95u,
+ 0x7cbb5e27da3bd487u, 0x9cff4ade1a009de7u, 0x70eb166d05c15197u, 0xdcf0460b71d5fe3du,
+ 0x5ac1ee5260b6a3c5u, 0xc922dedfdd78efe1u, 0xe5d381dc3b8eeb9bu, 0xd57e5347bafc6aadu,
+ 0x86939040983acd21u, 0x395b9d69740a4ff9u, 0x1467299c8e43d135u, 0x5fe440fcad975cdfu,
+ 0xcaa9a39794a6ca8du, 0xf61dbd640868dea1u, 0xac09d98d74843be7u, 0x2b103b9e1a6b4809u,
+ 0x2ab92d16960f536fu, 0x6653323d5e3681dfu, 0xefd48c1c0624e2d7u, 0xa496fefe04816f0du,
+ 0x1754a7b07bbdd7b1u, 0x23353c829a3852cdu, 0xbf831261abd59097u, 0x57a8e656df0618e1u,
+ 0x16e9206c3100680fu, 0xadad4c6ee921dac7u, 0x635f2b3860265353u, 0xdd6d0059f44b3d09u,
+ 0xac4dd6b894447dd7u, 0x42ea183eeaa87be3u, 0x15612d1550ee5b5du, 0x226fa19d656cb623u,
+};
+
+/* exponent of the largest power of 2 dividing factorial(n), for n in range(68)
+
+Python code to generate the values:
+
+import math
+
+for n in range(128):
+ fac = math.factorial(n)
+ fac_trailing_zeros = (fac & -fac).bit_length() - 1
+ print(fac_trailing_zeros)
+*/
+
+static const uint8_t factorial_trailing_zeros[] = {
+ 0, 0, 1, 1, 3, 3, 4, 4, 7, 7, 8, 8, 10, 10, 11, 11, // 0-15
+ 15, 15, 16, 16, 18, 18, 19, 19, 22, 22, 23, 23, 25, 25, 26, 26, // 16-31
+ 31, 31, 32, 32, 34, 34, 35, 35, 38, 38, 39, 39, 41, 41, 42, 42, // 32-47
+ 46, 46, 47, 47, 49, 49, 50, 50, 53, 53, 54, 54, 56, 56, 57, 57, // 48-63
+ 63, 63, 64, 64, 66, 66, 67, 67, 70, 70, 71, 71, 73, 73, 74, 74, // 64-79
+ 78, 78, 79, 79, 81, 81, 82, 82, 85, 85, 86, 86, 88, 88, 89, 89, // 80-95
+ 94, 94, 95, 95, 97, 97, 98, 98, 101, 101, 102, 102, 104, 104, 105, 105, // 96-111
+ 109, 109, 110, 110, 112, 112, 113, 113, 116, 116, 117, 117, 119, 119, 120, 120, // 112-127
+};
+
+/* Number of permutations and combinations.
+ * P(n, k) = n! / (n-k)!
+ * C(n, k) = P(n, k) / k!
+ */
+
+/* Calculate C(n, k) for n in the 63-bit range. */
+static PyObject *
+perm_comb_small(unsigned long long n, unsigned long long k, int iscomb)
+{
+ if (k == 0) {
+ return PyLong_FromLong(1);
+ }
+
+ /* For small enough n and k the result fits in the 64-bit range and can
+ * be calculated without allocating intermediate PyLong objects. */
+ if (iscomb) {
+ /* Maps k to the maximal n so that 2*k-1 <= n <= 127 and C(n, k)
+ * fits into a uint64_t. Exclude k = 1, because the second fast
+ * path is faster for this case.*/
+ static const unsigned char fast_comb_limits1[] = {
+ 0, 0, 127, 127, 127, 127, 127, 127, // 0-7
+ 127, 127, 127, 127, 127, 127, 127, 127, // 8-15
+ 116, 105, 97, 91, 86, 82, 78, 76, // 16-23
+ 74, 72, 71, 70, 69, 68, 68, 67, // 24-31
+ 67, 67, 67, // 32-34
+ };
+ if (k < Py_ARRAY_LENGTH(fast_comb_limits1) && n <= fast_comb_limits1[k]) {
+ /*
+ comb(n, k) fits into a uint64_t. We compute it as
+
+ comb_odd_part << shift
+
+ where 2**shift is the largest power of two dividing comb(n, k)
+ and comb_odd_part is comb(n, k) >> shift. comb_odd_part can be
+ calculated efficiently via arithmetic modulo 2**64, using three
+ lookups and two uint64_t multiplications.
+ */
+ uint64_t comb_odd_part = reduced_factorial_odd_part[n]
+ * inverted_factorial_odd_part[k]
+ * inverted_factorial_odd_part[n - k];
+ int shift = factorial_trailing_zeros[n]
+ - factorial_trailing_zeros[k]
+ - factorial_trailing_zeros[n - k];
+ return PyLong_FromUnsignedLongLong(comb_odd_part << shift);
+ }
+
+ /* Maps k to the maximal n so that 2*k-1 <= n <= 127 and C(n, k)*k
+ * fits into a long long (which is at least 64 bit). Only contains
+ * items larger than in fast_comb_limits1. */
+ static const unsigned long long fast_comb_limits2[] = {
+ 0, ULLONG_MAX, 4294967296ULL, 3329022, 102570, 13467, 3612, 1449, // 0-7
+ 746, 453, 308, 227, 178, 147, // 8-13
+ };
+ if (k < Py_ARRAY_LENGTH(fast_comb_limits2) && n <= fast_comb_limits2[k]) {
+ /* C(n, k) = C(n, k-1) * (n-k+1) / k */
+ unsigned long long result = n;
+ for (unsigned long long i = 1; i < k;) {
+ result *= --n;
+ result /= ++i;
+ }
+ return PyLong_FromUnsignedLongLong(result);
+ }
+ }
+ else {
+ /* Maps k to the maximal n so that k <= n and P(n, k)
+ * fits into a long long (which is at least 64 bit). */
+ static const unsigned long long fast_perm_limits[] = {
+ 0, ULLONG_MAX, 4294967296ULL, 2642246, 65537, 7133, 1627, 568, // 0-7
+ 259, 142, 88, 61, 45, 36, 30, 26, // 8-15
+ 24, 22, 21, 20, 20, // 16-20
+ };
+ if (k < Py_ARRAY_LENGTH(fast_perm_limits) && n <= fast_perm_limits[k]) {
+ if (n <= 127) {
+ /* P(n, k) fits into a uint64_t. */
+ uint64_t perm_odd_part = reduced_factorial_odd_part[n]
+ * inverted_factorial_odd_part[n - k];
+ int shift = factorial_trailing_zeros[n]
+ - factorial_trailing_zeros[n - k];
+ return PyLong_FromUnsignedLongLong(perm_odd_part << shift);
+ }
+
+ /* P(n, k) = P(n, k-1) * (n-k+1) */
+ unsigned long long result = n;
+ for (unsigned long long i = 1; i < k;) {
+ result *= --n;
+ ++i;
+ }
+ return PyLong_FromUnsignedLongLong(result);
+ }
+ }
+
+ /* For larger n use recursive formulas:
+ *
+ * P(n, k) = P(n, j) * P(n-j, k-j)
+ * C(n, k) = C(n, j) * C(n-j, k-j) // C(k, j)
+ */
+ unsigned long long j = k / 2;
+ PyObject *a, *b;
+ a = perm_comb_small(n, j, iscomb);
+ if (a == NULL) {
+ return NULL;
+ }
+ b = perm_comb_small(n - j, k - j, iscomb);
+ if (b == NULL) {
+ goto error;
+ }
+ Py_SETREF(a, PyNumber_Multiply(a, b));
+ Py_DECREF(b);
+ if (iscomb && a != NULL) {
+ b = perm_comb_small(k, j, 1);
+ if (b == NULL) {
+ goto error;
+ }
+ Py_SETREF(a, PyNumber_FloorDivide(a, b));
+ Py_DECREF(b);
+ }
+ return a;
+
+error:
+ Py_DECREF(a);
+ return NULL;
+}
+
+/* Calculate P(n, k) or C(n, k) using recursive formulas.
+ * It is more efficient than sequential multiplication thanks to
+ * Karatsuba multiplication.
+ */
+static PyObject *
+perm_comb(PyObject *n, unsigned long long k, int iscomb)
+{
+ if (k == 0) {
+ return PyLong_FromLong(1);
+ }
+ if (k == 1) {
+ return Py_NewRef(n);
+ }
+
+ /* P(n, k) = P(n, j) * P(n-j, k-j) */
+ /* C(n, k) = C(n, j) * C(n-j, k-j) // C(k, j) */
+ unsigned long long j = k / 2;
+ PyObject *a, *b;
+ a = perm_comb(n, j, iscomb);
+ if (a == NULL) {
+ return NULL;
+ }
+ PyObject *t = PyLong_FromUnsignedLongLong(j);
+ if (t == NULL) {
+ goto error;
+ }
+ n = PyNumber_Subtract(n, t);
+ Py_DECREF(t);
+ if (n == NULL) {
+ goto error;
+ }
+ b = perm_comb(n, k - j, iscomb);
+ Py_DECREF(n);
+ if (b == NULL) {
+ goto error;
+ }
+ Py_SETREF(a, PyNumber_Multiply(a, b));
+ Py_DECREF(b);
+ if (iscomb && a != NULL) {
+ b = perm_comb_small(k, j, 1);
+ if (b == NULL) {
+ goto error;
+ }
+ Py_SETREF(a, PyNumber_FloorDivide(a, b));
+ Py_DECREF(b);
+ }
+ return a;
+
+error:
+ Py_DECREF(a);
+ return NULL;
+}
+
+/*[clinic input]
+math.perm
+
+ n: object
+ k: object = None
+ /
+
+Number of ways to choose k items from n items without repetition and with order.
+
+Evaluates to n! / (n - k)! when k <= n and evaluates
+to zero when k > n.
+
+If k is not specified or is None, then k defaults to n
+and the function returns n!.
+
+Raises TypeError if either of the arguments are not integers.
+Raises ValueError if either of the arguments are negative.
+[clinic start generated code]*/
+
+static PyObject *
+math_perm_impl(PyObject *module, PyObject *n, PyObject *k)
+/*[clinic end generated code: output=e021a25469653e23 input=5311c5a00f359b53]*/
+{
+ PyObject *result = NULL;
+ int overflow, cmp;
+ long long ki, ni;
+
+ if (k == Py_None) {
+ return math_factorial(module, n);
+ }
+ n = PyNumber_Index(n);
+ if (n == NULL) {
+ return NULL;
+ }
+ k = PyNumber_Index(k);
+ if (k == NULL) {
+ Py_DECREF(n);
+ return NULL;
+ }
+ assert(PyLong_CheckExact(n) && PyLong_CheckExact(k));
+
+ if (_PyLong_IsNegative((PyLongObject *)n)) {
+ PyErr_SetString(PyExc_ValueError,
+ "n must be a non-negative integer");
+ goto error;
+ }
+ if (_PyLong_IsNegative((PyLongObject *)k)) {
+ PyErr_SetString(PyExc_ValueError,
+ "k must be a non-negative integer");
+ goto error;
+ }
+
+ cmp = PyObject_RichCompareBool(n, k, Py_LT);
+ if (cmp != 0) {
+ if (cmp > 0) {
+ result = PyLong_FromLong(0);
+ goto done;
+ }
+ goto error;
+ }
+
+ ki = PyLong_AsLongLongAndOverflow(k, &overflow);
+ assert(overflow >= 0 && !PyErr_Occurred());
+ if (overflow > 0) {
+ PyErr_Format(PyExc_OverflowError,
+ "k must not exceed %lld",
+ LLONG_MAX);
+ goto error;
+ }
+ assert(ki >= 0);
+
+ ni = PyLong_AsLongLongAndOverflow(n, &overflow);
+ assert(overflow >= 0 && !PyErr_Occurred());
+ if (!overflow && ki > 1) {
+ assert(ni >= 0);
+ result = perm_comb_small((unsigned long long)ni,
+ (unsigned long long)ki, 0);
+ }
+ else {
+ result = perm_comb(n, (unsigned long long)ki, 0);
+ }
+
+done:
+ Py_DECREF(n);
+ Py_DECREF(k);
+ return result;
+
+error:
+ Py_DECREF(n);
+ Py_DECREF(k);
+ return NULL;
+}
+
+/*[clinic input]
+math.comb
+
+ n: object
+ k: object
+ /
+
+Number of ways to choose k items from n items without repetition and without order.
+
+Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates
+to zero when k > n.
+
+Also called the binomial coefficient because it is equivalent
+to the coefficient of k-th term in polynomial expansion of the
+expression (1 + x)**n.
+
+Raises TypeError if either of the arguments are not integers.
+Raises ValueError if either of the arguments are negative.
+
+[clinic start generated code]*/
+
+static PyObject *
+math_comb_impl(PyObject *module, PyObject *n, PyObject *k)
+/*[clinic end generated code: output=bd2cec8d854f3493 input=9a05315af2518709]*/
+{
+ PyObject *result = NULL, *temp;
+ int overflow, cmp;
+ long long ki, ni;
+
+ n = PyNumber_Index(n);
+ if (n == NULL) {
+ return NULL;
+ }
+ k = PyNumber_Index(k);
+ if (k == NULL) {
+ Py_DECREF(n);
+ return NULL;
+ }
+ assert(PyLong_CheckExact(n) && PyLong_CheckExact(k));
+
+ if (_PyLong_IsNegative((PyLongObject *)n)) {
+ PyErr_SetString(PyExc_ValueError,
+ "n must be a non-negative integer");
+ goto error;
+ }
+ if (_PyLong_IsNegative((PyLongObject *)k)) {
+ PyErr_SetString(PyExc_ValueError,
+ "k must be a non-negative integer");
+ goto error;
+ }
+
+ ni = PyLong_AsLongLongAndOverflow(n, &overflow);
+ assert(overflow >= 0 && !PyErr_Occurred());
+ if (!overflow) {
+ assert(ni >= 0);
+ ki = PyLong_AsLongLongAndOverflow(k, &overflow);
+ assert(overflow >= 0 && !PyErr_Occurred());
+ if (overflow || ki > ni) {
+ result = PyLong_FromLong(0);
+ goto done;
+ }
+ assert(ki >= 0);
+
+ ki = Py_MIN(ki, ni - ki);
+ if (ki > 1) {
+ result = perm_comb_small((unsigned long long)ni,
+ (unsigned long long)ki, 1);
+ goto done;
+ }
+ /* For k == 1 just return the original n in perm_comb(). */
+ }
+ else {
+ /* k = min(k, n - k) */
+ temp = PyNumber_Subtract(n, k);
+ if (temp == NULL) {
+ goto error;
+ }
+ assert(PyLong_Check(temp));
+ if (_PyLong_IsNegative((PyLongObject *)temp)) {
+ Py_DECREF(temp);
+ result = PyLong_FromLong(0);
+ goto done;
+ }
+ cmp = PyObject_RichCompareBool(temp, k, Py_LT);
+ if (cmp > 0) {
+ Py_SETREF(k, temp);
+ }
+ else {
+ Py_DECREF(temp);
+ if (cmp < 0) {
+ goto error;
+ }
+ }
+
+ ki = PyLong_AsLongLongAndOverflow(k, &overflow);
+ assert(overflow >= 0 && !PyErr_Occurred());
+ if (overflow) {
+ PyErr_Format(PyExc_OverflowError,
+ "min(n - k, k) must not exceed %lld",
+ LLONG_MAX);
+ goto error;
+ }
+ assert(ki >= 0);
+ }
+
+ result = perm_comb(n, (unsigned long long)ki, 1);
+
+done:
+ Py_DECREF(n);
+ Py_DECREF(k);
+ return result;
+
+error:
+ Py_DECREF(n);
+ Py_DECREF(k);
+ return NULL;
+}
+
+
+/*[clinic input]
+math.nextafter
+
+ x: double
+ y: double
+ /
+ *
+ steps: object = None
+
+Return the floating-point value the given number of steps after x towards y.
+
+If steps is not specified or is None, it defaults to 1.
+
+Raises a TypeError, if x or y is not a double, or if steps is not an integer.
+Raises ValueError if steps is negative.
+[clinic start generated code]*/
+
+static PyObject *
+math_nextafter_impl(PyObject *module, double x, double y, PyObject *steps)
+/*[clinic end generated code: output=cc6511f02afc099e input=7f2a5842112af2b4]*/
+{
+#if defined(_AIX)
+ if (x == y) {
+ /* On AIX 7.1, libm nextafter(-0.0, +0.0) returns -0.0.
+ Bug fixed in bos.adt.libm 7.2.2.0 by APAR IV95512. */
+ return PyFloat_FromDouble(y);
+ }
+ if (Py_IS_NAN(x)) {
+ return PyFloat_FromDouble(x);
+ }
+ if (Py_IS_NAN(y)) {
+ return PyFloat_FromDouble(y);
+ }
+#endif
+ if (steps == Py_None) {
+ // fast path: we default to one step.
+ return PyFloat_FromDouble(nextafter(x, y));
+ }
+ steps = PyNumber_Index(steps);
+ if (steps == NULL) {
+ return NULL;
+ }
+ assert(PyLong_CheckExact(steps));
+ if (_PyLong_IsNegative((PyLongObject *)steps)) {
+ PyErr_SetString(PyExc_ValueError,
+ "steps must be a non-negative integer");
+ Py_DECREF(steps);
+ return NULL;
+ }
+
+ unsigned long long usteps_ull = PyLong_AsUnsignedLongLong(steps);
+ // Conveniently, uint64_t and double have the same number of bits
+ // on all the platforms we care about.
+ // So if an overflow occurs, we can just use UINT64_MAX.
+ Py_DECREF(steps);
+ if (usteps_ull >= UINT64_MAX) {
+ // This branch includes the case where an error occurred, since
+ // (unsigned long long)(-1) = ULLONG_MAX >= UINT64_MAX. Note that
+ // usteps_ull can be strictly larger than UINT64_MAX on a machine
+ // where unsigned long long has width > 64 bits.
+ if (PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Clear();
+ }
+ else {
+ return NULL;
+ }
+ }
+ usteps_ull = UINT64_MAX;
+ }
+ assert(usteps_ull <= UINT64_MAX);
+ uint64_t usteps = (uint64_t)usteps_ull;
+
+ if (usteps == 0) {
+ return PyFloat_FromDouble(x);
+ }
+ if (Py_IS_NAN(x)) {
+ return PyFloat_FromDouble(x);
+ }
+ if (Py_IS_NAN(y)) {
+ return PyFloat_FromDouble(y);
+ }
+
+ // We assume that double and uint64_t have the same endianness.
+ // This is not guaranteed by the C-standard, but it is true for
+ // all platforms we care about. (The most likely form of violation
+ // would be a "mixed-endian" double.)
+ union pun {double f; uint64_t i;};
+ union pun ux = {x}, uy = {y};
+ if (ux.i == uy.i) {
+ return PyFloat_FromDouble(x);
+ }
+
+ const uint64_t sign_bit = 1ULL<<63;
+
+ uint64_t ax = ux.i & ~sign_bit;
+ uint64_t ay = uy.i & ~sign_bit;
+
+ // opposite signs
+ if (((ux.i ^ uy.i) & sign_bit)) {
+ // NOTE: ax + ay can never overflow, because their most significant bit
+ // ain't set.
+ if (ax + ay <= usteps) {
+ return PyFloat_FromDouble(uy.f);
+ // This comparison has to use <, because <= would get +0.0 vs -0.0
+ // wrong.
+ } else if (ax < usteps) {
+ union pun result = {.i = (uy.i & sign_bit) | (usteps - ax)};
+ return PyFloat_FromDouble(result.f);
+ } else {
+ ux.i -= usteps;
+ return PyFloat_FromDouble(ux.f);
+ }
+ // same sign
+ } else if (ax > ay) {
+ if (ax - ay >= usteps) {
+ ux.i -= usteps;
+ return PyFloat_FromDouble(ux.f);
+ } else {
+ return PyFloat_FromDouble(uy.f);
+ }
+ } else {
+ if (ay - ax >= usteps) {
+ ux.i += usteps;
+ return PyFloat_FromDouble(ux.f);
+ } else {
+ return PyFloat_FromDouble(uy.f);
+ }
+ }
+}
+
+
+/*[clinic input]
+math.ulp -> double
+
+ x: double
+ /
+
+Return the value of the least significant bit of the float x.
+[clinic start generated code]*/
+
+static double
+math_ulp_impl(PyObject *module, double x)
+/*[clinic end generated code: output=f5207867a9384dd4 input=31f9bfbbe373fcaa]*/
+{
+ if (Py_IS_NAN(x)) {
+ return x;
+ }
+ x = fabs(x);
+ if (Py_IS_INFINITY(x)) {
+ return x;
+ }
+ double inf = Py_INFINITY;
+ double x2 = nextafter(x, inf);
+ if (Py_IS_INFINITY(x2)) {
+ /* special case: x is the largest positive representable float */
+ x2 = nextafter(x, -inf);
+ return x - x2;
+ }
+ return x2 - x;
+}
+
+static int
+math_exec(PyObject *module)
+{
+
+ math_module_state *state = get_math_module_state(module);
+ state->str___ceil__ = PyUnicode_InternFromString("__ceil__");
+ if (state->str___ceil__ == NULL) {
+ return -1;
+ }
+ state->str___floor__ = PyUnicode_InternFromString("__floor__");
+ if (state->str___floor__ == NULL) {
+ return -1;
+ }
+ state->str___trunc__ = PyUnicode_InternFromString("__trunc__");
+ if (state->str___trunc__ == NULL) {
+ return -1;
+ }
+ if (_PyModule_Add(module, "pi", PyFloat_FromDouble(Py_MATH_PI)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(module, "e", PyFloat_FromDouble(Py_MATH_E)) < 0) {
+ return -1;
+ }
+ // 2pi
+ if (_PyModule_Add(module, "tau", PyFloat_FromDouble(Py_MATH_TAU)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(module, "inf", PyFloat_FromDouble(Py_INFINITY)) < 0) {
+ return -1;
+ }
+ if (_PyModule_Add(module, "nan", PyFloat_FromDouble(fabs(Py_NAN))) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static int
+math_clear(PyObject *module)
+{
+ math_module_state *state = get_math_module_state(module);
+ Py_CLEAR(state->str___ceil__);
+ Py_CLEAR(state->str___floor__);
+ Py_CLEAR(state->str___trunc__);
+ return 0;
+}
+
+static void
+math_free(void *module)
+{
+ math_clear((PyObject *)module);
+}
+
+static PyMethodDef math_methods[] = {
+ {"acos", math_acos, METH_O, math_acos_doc},
+ {"acosh", math_acosh, METH_O, math_acosh_doc},
+ {"asin", math_asin, METH_O, math_asin_doc},
+ {"asinh", math_asinh, METH_O, math_asinh_doc},
+ {"atan", math_atan, METH_O, math_atan_doc},
+ {"atan2", _PyCFunction_CAST(math_atan2), METH_FASTCALL, math_atan2_doc},
+ {"atanh", math_atanh, METH_O, math_atanh_doc},
+ {"cbrt", math_cbrt, METH_O, math_cbrt_doc},
+ MATH_CEIL_METHODDEF
+ {"copysign", _PyCFunction_CAST(math_copysign), METH_FASTCALL, math_copysign_doc},
+ {"cos", math_cos, METH_O, math_cos_doc},
+ {"cosh", math_cosh, METH_O, math_cosh_doc},
+ MATH_DEGREES_METHODDEF
+ MATH_DIST_METHODDEF
+ {"erf", math_erf, METH_O, math_erf_doc},
+ {"erfc", math_erfc, METH_O, math_erfc_doc},
+ {"exp", math_exp, METH_O, math_exp_doc},
+ {"exp2", math_exp2, METH_O, math_exp2_doc},
+ {"expm1", math_expm1, METH_O, math_expm1_doc},
+ {"fabs", math_fabs, METH_O, math_fabs_doc},
+ MATH_FACTORIAL_METHODDEF
+ MATH_FLOOR_METHODDEF
+ MATH_FMOD_METHODDEF
+ MATH_FREXP_METHODDEF
+ MATH_FSUM_METHODDEF
+ {"gamma", math_gamma, METH_O, math_gamma_doc},
+ {"gcd", _PyCFunction_CAST(math_gcd), METH_FASTCALL, math_gcd_doc},
+ {"hypot", _PyCFunction_CAST(math_hypot), METH_FASTCALL, math_hypot_doc},
+ MATH_ISCLOSE_METHODDEF
+ MATH_ISFINITE_METHODDEF
+ MATH_ISINF_METHODDEF
+ MATH_ISNAN_METHODDEF
+ MATH_ISQRT_METHODDEF
+ {"lcm", _PyCFunction_CAST(math_lcm), METH_FASTCALL, math_lcm_doc},
+ MATH_LDEXP_METHODDEF
+ {"lgamma", math_lgamma, METH_O, math_lgamma_doc},
+ {"log", _PyCFunction_CAST(math_log), METH_FASTCALL, math_log_doc},
+ {"log1p", math_log1p, METH_O, math_log1p_doc},
+ MATH_LOG10_METHODDEF
+ MATH_LOG2_METHODDEF
+ MATH_MODF_METHODDEF
+ MATH_POW_METHODDEF
+ MATH_RADIANS_METHODDEF
+ {"remainder", _PyCFunction_CAST(math_remainder), METH_FASTCALL, math_remainder_doc},
+ {"sin", math_sin, METH_O, math_sin_doc},
+ {"sinh", math_sinh, METH_O, math_sinh_doc},
+ {"sqrt", math_sqrt, METH_O, math_sqrt_doc},
+ {"tan", math_tan, METH_O, math_tan_doc},
+ {"tanh", math_tanh, METH_O, math_tanh_doc},
+ MATH_SUMPROD_METHODDEF
+ MATH_TRUNC_METHODDEF
+ MATH_PROD_METHODDEF
+ MATH_PERM_METHODDEF
+ MATH_COMB_METHODDEF
+ MATH_NEXTAFTER_METHODDEF
+ MATH_ULP_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyModuleDef_Slot math_slots[] = {
+ {Py_mod_exec, math_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+PyDoc_STRVAR(module_doc,
+"This module provides access to the mathematical functions\n"
+"defined by the C standard.");
+
+static struct PyModuleDef mathmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "math",
+ .m_doc = module_doc,
+ .m_size = sizeof(math_module_state),
+ .m_methods = math_methods,
+ .m_slots = math_slots,
+ .m_clear = math_clear,
+ .m_free = math_free,
+};
+
+PyMODINIT_FUNC
+PyInit_math(void)
+{
+ return PyModuleDef_Init(&mathmodule);
+}
diff --git a/contrib/tools/python3/Modules/md5module.c b/contrib/tools/python3/Modules/md5module.c
new file mode 100644
index 00000000000..2122f8b18ba
--- /dev/null
+++ b/contrib/tools/python3/Modules/md5module.c
@@ -0,0 +1,394 @@
+/* MD5 module */
+
+/* This module provides an interface to the MD5 algorithm */
+
+/* See below for information about the original code this module was
+ based upon. Additional work performed by:
+
+ Andrew Kuchling ([email protected])
+ Greg Stein ([email protected])
+ Trevor Perrin ([email protected])
+
+ Copyright (C) 2005-2007 Gregory P. Smith ([email protected])
+ Licensed to PSF under a Contributor Agreement.
+
+*/
+
+/* MD5 objects */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "hashlib.h"
+#include "pycore_strhex.h" // _Py_strhex()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+
+/*[clinic input]
+module _md5
+class MD5Type "MD5object *" "&PyType_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6e5261719957a912]*/
+
+/* Some useful types */
+
+#if SIZEOF_INT == 4
+typedef unsigned int MD5_INT32; /* 32-bit integer */
+typedef long long MD5_INT64; /* 64-bit integer */
+#else
+/* not defined. compilation will die. */
+#endif
+
+/* The MD5 block size and message digest sizes, in bytes */
+
+#define MD5_BLOCKSIZE 64
+#define MD5_DIGESTSIZE 16
+
+#include "_hacl/Hacl_Hash_MD5.h"
+
+
+typedef struct {
+ PyObject_HEAD
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock;
+ Hacl_Streaming_MD5_state *hash_state;
+} MD5object;
+
+#include "clinic/md5module.c.h"
+
+
+typedef struct {
+ PyTypeObject* md5_type;
+} MD5State;
+
+static inline MD5State*
+md5_get_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (MD5State *)state;
+}
+
+static MD5object *
+newMD5object(MD5State * st)
+{
+ MD5object *md5 = (MD5object *)PyObject_GC_New(MD5object, st->md5_type);
+ md5->lock = NULL;
+ PyObject_GC_Track(md5);
+ return md5;
+}
+
+/* Internal methods for a hash object */
+static int
+MD5_traverse(PyObject *ptr, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(ptr));
+ return 0;
+}
+
+static void
+MD5_dealloc(MD5object *ptr)
+{
+ Hacl_Streaming_MD5_legacy_free(ptr->hash_state);
+ if (ptr->lock != NULL) {
+ PyThread_free_lock(ptr->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(ptr);
+ PyObject_GC_UnTrack(ptr);
+ PyObject_GC_Del(ptr);
+ Py_DECREF(tp);
+}
+
+
+/* External methods for a hash object */
+
+/*[clinic input]
+MD5Type.copy
+
+ cls: defining_class
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+MD5Type_copy_impl(MD5object *self, PyTypeObject *cls)
+/*[clinic end generated code: output=bf055e08244bf5ee input=d89087dcfb2a8620]*/
+{
+ MD5State *st = _PyType_GetModuleState(cls);
+
+ MD5object *newobj;
+ if ((newobj = newMD5object(st))==NULL)
+ return NULL;
+
+ ENTER_HASHLIB(self);
+ newobj->hash_state = Hacl_Streaming_MD5_legacy_copy(self->hash_state);
+ LEAVE_HASHLIB(self);
+ return (PyObject *)newobj;
+}
+
+/*[clinic input]
+MD5Type.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+MD5Type_digest_impl(MD5object *self)
+/*[clinic end generated code: output=eb691dc4190a07ec input=bc0c4397c2994be6]*/
+{
+ unsigned char digest[MD5_DIGESTSIZE];
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_MD5_legacy_finish(self->hash_state, digest);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest, MD5_DIGESTSIZE);
+}
+
+/*[clinic input]
+MD5Type.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+MD5Type_hexdigest_impl(MD5object *self)
+/*[clinic end generated code: output=17badced1f3ac932 input=b60b19de644798dd]*/
+{
+ unsigned char digest[MD5_DIGESTSIZE];
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_MD5_legacy_finish(self->hash_state, digest);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char*)digest, MD5_DIGESTSIZE);
+}
+
+static void update(Hacl_Streaming_MD5_state *state, uint8_t *buf, Py_ssize_t len) {
+#if PY_SSIZE_T_MAX > UINT32_MAX
+ while (len > UINT32_MAX) {
+ Hacl_Streaming_MD5_legacy_update(state, buf, UINT32_MAX);
+ len -= UINT32_MAX;
+ buf += UINT32_MAX;
+ }
+#endif
+ Hacl_Streaming_MD5_legacy_update(state, buf, (uint32_t) len);
+}
+
+/*[clinic input]
+MD5Type.update
+
+ obj: object
+ /
+
+Update this hash object's state with the provided string.
+[clinic start generated code]*/
+
+static PyObject *
+MD5Type_update(MD5object *self, PyObject *obj)
+/*[clinic end generated code: output=f6ad168416338423 input=6e1efcd9ecf17032]*/
+{
+ Py_buffer buf;
+
+ GET_BUFFER_VIEW_OR_ERROUT(obj, &buf);
+
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ }
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ update(self->hash_state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ update(self->hash_state, buf.buf, buf.len);
+ }
+
+ PyBuffer_Release(&buf);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef MD5_methods[] = {
+ MD5TYPE_COPY_METHODDEF
+ MD5TYPE_DIGEST_METHODDEF
+ MD5TYPE_HEXDIGEST_METHODDEF
+ MD5TYPE_UPDATE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+MD5_get_block_size(PyObject *self, void *closure)
+{
+ return PyLong_FromLong(MD5_BLOCKSIZE);
+}
+
+static PyObject *
+MD5_get_name(PyObject *self, void *closure)
+{
+ return PyUnicode_FromStringAndSize("md5", 3);
+}
+
+static PyObject *
+md5_get_digest_size(PyObject *self, void *closure)
+{
+ return PyLong_FromLong(MD5_DIGESTSIZE);
+}
+
+static PyGetSetDef MD5_getseters[] = {
+ {"block_size",
+ (getter)MD5_get_block_size, NULL,
+ NULL,
+ NULL},
+ {"name",
+ (getter)MD5_get_name, NULL,
+ NULL,
+ NULL},
+ {"digest_size",
+ (getter)md5_get_digest_size, NULL,
+ NULL,
+ NULL},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot md5_type_slots[] = {
+ {Py_tp_dealloc, MD5_dealloc},
+ {Py_tp_methods, MD5_methods},
+ {Py_tp_getset, MD5_getseters},
+ {Py_tp_traverse, MD5_traverse},
+ {0,0}
+};
+
+static PyType_Spec md5_type_spec = {
+ .name = "_md5.md5",
+ .basicsize = sizeof(MD5object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC),
+ .slots = md5_type_slots
+};
+
+/* The single module-level function: new() */
+
+/*[clinic input]
+_md5.md5
+
+ string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new MD5 hash object; optionally initialized with a string.
+[clinic start generated code]*/
+
+static PyObject *
+_md5_md5_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=587071f76254a4ac input=7a144a1905636985]*/
+{
+ MD5object *new;
+ Py_buffer buf;
+
+ if (string)
+ GET_BUFFER_VIEW_OR_ERROUT(string, &buf);
+
+ MD5State *st = md5_get_state(module);
+ if ((new = newMD5object(st)) == NULL) {
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+
+ new->hash_state = Hacl_Streaming_MD5_legacy_create_in();
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(new);
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+ if (string) {
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ update(new->hash_state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ update(new->hash_state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)new;
+}
+
+
+/* List of functions exported by this module */
+
+static struct PyMethodDef MD5_functions[] = {
+ _MD5_MD5_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+static int
+_md5_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ MD5State *state = md5_get_state(module);
+ Py_VISIT(state->md5_type);
+ return 0;
+}
+
+static int
+_md5_clear(PyObject *module)
+{
+ MD5State *state = md5_get_state(module);
+ Py_CLEAR(state->md5_type);
+ return 0;
+}
+
+static void
+_md5_free(void *module)
+{
+ _md5_clear((PyObject *)module);
+}
+
+/* Initialize this module. */
+static int
+md5_exec(PyObject *m)
+{
+ MD5State *st = md5_get_state(m);
+
+ st->md5_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &md5_type_spec, NULL);
+
+ if (st->md5_type == NULL) {
+ return -1;
+ }
+
+ Py_INCREF((PyObject *)st->md5_type);
+ if (PyModule_AddObject(m, "MD5Type", (PyObject *)st->md5_type) < 0) {
+ Py_DECREF(st->md5_type);
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot _md5_slots[] = {
+ {Py_mod_exec, md5_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+
+static struct PyModuleDef _md5module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_md5",
+ .m_size = sizeof(MD5State),
+ .m_methods = MD5_functions,
+ .m_slots = _md5_slots,
+ .m_traverse = _md5_traverse,
+ .m_clear = _md5_clear,
+ .m_free = _md5_free,
+};
+
+PyMODINIT_FUNC
+PyInit__md5(void)
+{
+ return PyModuleDef_Init(&_md5module);
+}
diff --git a/contrib/tools/python3/Modules/mmapmodule.c b/contrib/tools/python3/Modules/mmapmodule.c
new file mode 100644
index 00000000000..827f619e6eb
--- /dev/null
+++ b/contrib/tools/python3/Modules/mmapmodule.c
@@ -0,0 +1,1763 @@
+/*
+ / Author: Sam Rushing <[email protected]>
+ / Hacked for Unix by AMK
+ / $Id$
+
+ / Modified to support mmap with offset - to map a 'window' of a file
+ / Author: Yotam Medini [email protected]
+ /
+ / mmapmodule.cpp -- map a view of a file into memory
+ /
+ / todo: need permission flags, perhaps a 'chsize' analog
+ / not all functions check range yet!!!
+ /
+ /
+ / This version of mmapmodule.c has been changed significantly
+ / from the original mmapfile.c on which it was based.
+ / The original version of mmapfile is maintained by Sam at
+ / ftp://squirl.nightmare.com/pub/python/python-ext.
+*/
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+#include "pycore_bytesobject.h" // _PyBytes_Find()
+#include "pycore_fileutils.h" // _Py_stat_struct
+#include "structmember.h" // PyMemberDef
+#include <stddef.h> // offsetof()
+
+#ifndef MS_WINDOWS
+#define UNIX
+# ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+# endif /* HAVE_FCNTL_H */
+#endif
+
+#ifdef MS_WINDOWS
+#include <windows.h>
+static int
+my_getpagesize(void)
+{
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ return si.dwPageSize;
+}
+
+static int
+my_getallocationgranularity (void)
+{
+
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ return si.dwAllocationGranularity;
+}
+
+#endif
+
+#ifdef UNIX
+#include <sys/mman.h>
+#include <sys/stat.h>
+
+#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
+static int
+my_getpagesize(void)
+{
+ return sysconf(_SC_PAGESIZE);
+}
+
+#define my_getallocationgranularity my_getpagesize
+#else
+#define my_getpagesize getpagesize
+#endif
+
+#endif /* UNIX */
+
+#include <string.h>
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+/* Prefer MAP_ANONYMOUS since MAP_ANON is deprecated according to man page. */
+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+#endif
+
+typedef enum
+{
+ ACCESS_DEFAULT,
+ ACCESS_READ,
+ ACCESS_WRITE,
+ ACCESS_COPY
+} access_mode;
+
+typedef struct {
+ PyObject_HEAD
+ char * data;
+ Py_ssize_t size;
+ Py_ssize_t pos; /* relative to offset */
+#ifdef MS_WINDOWS
+ long long offset;
+#else
+ off_t offset;
+#endif
+ Py_ssize_t exports;
+
+#ifdef MS_WINDOWS
+ HANDLE map_handle;
+ HANDLE file_handle;
+ wchar_t * tagname;
+#endif
+
+#ifdef UNIX
+ int fd;
+#endif
+
+ PyObject *weakreflist;
+ access_mode access;
+} mmap_object;
+
+static int
+mmap_object_traverse(mmap_object *m_obj, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(m_obj));
+ return 0;
+}
+
+static void
+mmap_object_dealloc(mmap_object *m_obj)
+{
+ PyTypeObject *tp = Py_TYPE(m_obj);
+ PyObject_GC_UnTrack(m_obj);
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ if (m_obj->data != NULL)
+ UnmapViewOfFile (m_obj->data);
+ if (m_obj->map_handle != NULL)
+ CloseHandle (m_obj->map_handle);
+ if (m_obj->file_handle != INVALID_HANDLE_VALUE)
+ CloseHandle (m_obj->file_handle);
+ Py_END_ALLOW_THREADS
+ if (m_obj->tagname)
+ PyMem_Free(m_obj->tagname);
+#endif /* MS_WINDOWS */
+
+#ifdef UNIX
+ Py_BEGIN_ALLOW_THREADS
+ if (m_obj->fd >= 0)
+ (void) close(m_obj->fd);
+ if (m_obj->data!=NULL) {
+ munmap(m_obj->data, m_obj->size);
+ }
+ Py_END_ALLOW_THREADS
+#endif /* UNIX */
+
+ if (m_obj->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) m_obj);
+
+ tp->tp_free(m_obj);
+ Py_DECREF(tp);
+}
+
+static PyObject *
+mmap_close_method(mmap_object *self, PyObject *unused)
+{
+ if (self->exports > 0) {
+ PyErr_SetString(PyExc_BufferError, "cannot close "\
+ "exported pointers exist");
+ return NULL;
+ }
+#ifdef MS_WINDOWS
+ /* For each resource we maintain, we need to check
+ the value is valid, and if so, free the resource
+ and set the member value to an invalid value so
+ the dealloc does not attempt to resource clearing
+ again.
+ TODO - should we check for errors in the close operations???
+ */
+ HANDLE map_handle = self->map_handle;
+ HANDLE file_handle = self->file_handle;
+ char *data = self->data;
+ self->map_handle = NULL;
+ self->file_handle = INVALID_HANDLE_VALUE;
+ self->data = NULL;
+ Py_BEGIN_ALLOW_THREADS
+ if (data != NULL) {
+ UnmapViewOfFile(data);
+ }
+ if (map_handle != NULL) {
+ CloseHandle(map_handle);
+ }
+ if (file_handle != INVALID_HANDLE_VALUE) {
+ CloseHandle(file_handle);
+ }
+ Py_END_ALLOW_THREADS
+#endif /* MS_WINDOWS */
+
+#ifdef UNIX
+ int fd = self->fd;
+ char *data = self->data;
+ self->fd = -1;
+ self->data = NULL;
+ Py_BEGIN_ALLOW_THREADS
+ if (0 <= fd)
+ (void) close(fd);
+ if (data != NULL) {
+ munmap(data, self->size);
+ }
+ Py_END_ALLOW_THREADS
+#endif
+
+ Py_RETURN_NONE;
+}
+
+#ifdef MS_WINDOWS
+#define CHECK_VALID(err) \
+do { \
+ if (self->map_handle == NULL) { \
+ PyErr_SetString(PyExc_ValueError, "mmap closed or invalid"); \
+ return err; \
+ } \
+} while (0)
+#define CHECK_VALID_OR_RELEASE(err, buffer) \
+do { \
+ if (self->map_handle == NULL) { \
+ PyErr_SetString(PyExc_ValueError, "mmap closed or invalid"); \
+ PyBuffer_Release(&(buffer)); \
+ return (err); \
+ } \
+} while (0)
+#endif /* MS_WINDOWS */
+
+#ifdef UNIX
+#define CHECK_VALID(err) \
+do { \
+ if (self->data == NULL) { \
+ PyErr_SetString(PyExc_ValueError, "mmap closed or invalid"); \
+ return err; \
+ } \
+} while (0)
+#define CHECK_VALID_OR_RELEASE(err, buffer) \
+do { \
+ if (self->data == NULL) { \
+ PyErr_SetString(PyExc_ValueError, "mmap closed or invalid"); \
+ PyBuffer_Release(&(buffer)); \
+ return (err); \
+ } \
+} while (0)
+#endif /* UNIX */
+
+static PyObject *
+mmap_read_byte_method(mmap_object *self,
+ PyObject *unused)
+{
+ CHECK_VALID(NULL);
+ if (self->pos >= self->size) {
+ PyErr_SetString(PyExc_ValueError, "read byte out of range");
+ return NULL;
+ }
+ return PyLong_FromLong((unsigned char)self->data[self->pos++]);
+}
+
+static PyObject *
+mmap_read_line_method(mmap_object *self,
+ PyObject *unused)
+{
+ Py_ssize_t remaining;
+ char *start, *eol;
+ PyObject *result;
+
+ CHECK_VALID(NULL);
+
+ remaining = (self->pos < self->size) ? self->size - self->pos : 0;
+ if (!remaining)
+ return PyBytes_FromString("");
+ start = self->data + self->pos;
+ eol = memchr(start, '\n', remaining);
+ if (!eol)
+ eol = self->data + self->size;
+ else
+ ++eol; /* advance past newline */
+ result = PyBytes_FromStringAndSize(start, (eol - start));
+ self->pos += (eol - start);
+ return result;
+}
+
+static PyObject *
+mmap_read_method(mmap_object *self,
+ PyObject *args)
+{
+ Py_ssize_t num_bytes = PY_SSIZE_T_MAX, remaining;
+ PyObject *result;
+
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "|O&:read", _Py_convert_optional_to_ssize_t, &num_bytes))
+ return NULL;
+ CHECK_VALID(NULL);
+
+ /* silently 'adjust' out-of-range requests */
+ remaining = (self->pos < self->size) ? self->size - self->pos : 0;
+ if (num_bytes < 0 || num_bytes > remaining)
+ num_bytes = remaining;
+ result = PyBytes_FromStringAndSize(&self->data[self->pos], num_bytes);
+ self->pos += num_bytes;
+ return result;
+}
+
+static PyObject *
+mmap_gfind(mmap_object *self,
+ PyObject *args,
+ int reverse)
+{
+ Py_ssize_t start = self->pos;
+ Py_ssize_t end = self->size;
+ Py_buffer view;
+
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, reverse ? "y*|nn:rfind" : "y*|nn:find",
+ &view, &start, &end)) {
+ return NULL;
+ }
+ else {
+ if (start < 0)
+ start += self->size;
+ if (start < 0)
+ start = 0;
+ else if (start > self->size)
+ start = self->size;
+
+ if (end < 0)
+ end += self->size;
+ if (end < 0)
+ end = 0;
+ else if (end > self->size)
+ end = self->size;
+
+ Py_ssize_t res;
+ CHECK_VALID_OR_RELEASE(NULL, view);
+ if (end < start) {
+ res = -1;
+ }
+ else if (reverse) {
+ assert(0 <= start && start <= end && end <= self->size);
+ res = _PyBytes_ReverseFind(
+ self->data + start, end - start,
+ view.buf, view.len, start);
+ }
+ else {
+ assert(0 <= start && start <= end && end <= self->size);
+ res = _PyBytes_Find(
+ self->data + start, end - start,
+ view.buf, view.len, start);
+ }
+ PyBuffer_Release(&view);
+ return PyLong_FromSsize_t(res);
+ }
+}
+
+static PyObject *
+mmap_find_method(mmap_object *self,
+ PyObject *args)
+{
+ return mmap_gfind(self, args, 0);
+}
+
+static PyObject *
+mmap_rfind_method(mmap_object *self,
+ PyObject *args)
+{
+ return mmap_gfind(self, args, 1);
+}
+
+static int
+is_writable(mmap_object *self)
+{
+ if (self->access != ACCESS_READ)
+ return 1;
+ PyErr_Format(PyExc_TypeError, "mmap can't modify a readonly memory map.");
+ return 0;
+}
+
+static int
+is_resizeable(mmap_object *self)
+{
+ if (self->exports > 0) {
+ PyErr_SetString(PyExc_BufferError,
+ "mmap can't resize with extant buffers exported.");
+ return 0;
+ }
+ if ((self->access == ACCESS_WRITE) || (self->access == ACCESS_DEFAULT))
+ return 1;
+ PyErr_Format(PyExc_TypeError,
+ "mmap can't resize a readonly or copy-on-write memory map.");
+ return 0;
+
+}
+
+
+static PyObject *
+mmap_write_method(mmap_object *self,
+ PyObject *args)
+{
+ Py_buffer data;
+
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "y*:write", &data))
+ return NULL;
+
+ if (!is_writable(self)) {
+ PyBuffer_Release(&data);
+ return NULL;
+ }
+
+ if (self->pos > self->size || self->size - self->pos < data.len) {
+ PyBuffer_Release(&data);
+ PyErr_SetString(PyExc_ValueError, "data out of range");
+ return NULL;
+ }
+
+ CHECK_VALID_OR_RELEASE(NULL, data);
+ memcpy(&self->data[self->pos], data.buf, data.len);
+ self->pos += data.len;
+ PyBuffer_Release(&data);
+ return PyLong_FromSsize_t(data.len);
+}
+
+static PyObject *
+mmap_write_byte_method(mmap_object *self,
+ PyObject *args)
+{
+ char value;
+
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "b:write_byte", &value))
+ return(NULL);
+
+ if (!is_writable(self))
+ return NULL;
+
+ CHECK_VALID(NULL);
+ if (self->pos < self->size) {
+ self->data[self->pos++] = value;
+ Py_RETURN_NONE;
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError, "write byte out of range");
+ return NULL;
+ }
+}
+
+static PyObject *
+mmap_size_method(mmap_object *self,
+ PyObject *unused)
+{
+ CHECK_VALID(NULL);
+
+#ifdef MS_WINDOWS
+ if (self->file_handle != INVALID_HANDLE_VALUE) {
+ DWORD low,high;
+ long long size;
+ low = GetFileSize(self->file_handle, &high);
+ if (low == INVALID_FILE_SIZE) {
+ /* It might be that the function appears to have failed,
+ when indeed its size equals INVALID_FILE_SIZE */
+ DWORD error = GetLastError();
+ if (error != NO_ERROR)
+ return PyErr_SetFromWindowsErr(error);
+ }
+ if (!high && low < LONG_MAX)
+ return PyLong_FromLong((long)low);
+ size = (((long long)high)<<32) + low;
+ return PyLong_FromLongLong(size);
+ } else {
+ return PyLong_FromSsize_t(self->size);
+ }
+#endif /* MS_WINDOWS */
+
+#ifdef UNIX
+ {
+ struct _Py_stat_struct status;
+ if (_Py_fstat(self->fd, &status) == -1)
+ return NULL;
+#ifdef HAVE_LARGEFILE_SUPPORT
+ return PyLong_FromLongLong(status.st_size);
+#else
+ return PyLong_FromLong(status.st_size);
+#endif
+ }
+#endif /* UNIX */
+}
+
+/* This assumes that you want the entire file mapped,
+ / and when recreating the map will make the new file
+ / have the new size
+ /
+ / Is this really necessary? This could easily be done
+ / from python by just closing and re-opening with the
+ / new size?
+ */
+
+static PyObject *
+mmap_resize_method(mmap_object *self,
+ PyObject *args)
+{
+ Py_ssize_t new_size;
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "n:resize", &new_size) ||
+ !is_resizeable(self)) {
+ return NULL;
+ }
+ if (new_size < 0 || PY_SSIZE_T_MAX - new_size < self->offset) {
+ PyErr_SetString(PyExc_ValueError, "new size out of range");
+ return NULL;
+ }
+
+ {
+#ifdef MS_WINDOWS
+ DWORD error = 0, file_resize_error = 0;
+ char* old_data = self->data;
+ LARGE_INTEGER offset, max_size;
+ offset.QuadPart = self->offset;
+ max_size.QuadPart = self->offset + new_size;
+ /* close the file mapping */
+ CloseHandle(self->map_handle);
+ /* if the file mapping still exists, it cannot be resized. */
+ if (self->tagname) {
+ self->map_handle = OpenFileMappingW(FILE_MAP_WRITE, FALSE,
+ self->tagname);
+ if (self->map_handle) {
+ PyErr_SetFromWindowsErr(ERROR_USER_MAPPED_FILE);
+ return NULL;
+ }
+ } else {
+ self->map_handle = NULL;
+ }
+
+ /* if it's not the paging file, unmap the view and resize the file */
+ if (self->file_handle != INVALID_HANDLE_VALUE) {
+ if (!UnmapViewOfFile(self->data)) {
+ return PyErr_SetFromWindowsErr(GetLastError());
+ };
+ self->data = NULL;
+ /* resize the file */
+ if (!SetFilePointerEx(self->file_handle, max_size, NULL,
+ FILE_BEGIN) ||
+ !SetEndOfFile(self->file_handle)) {
+ /* resizing failed. try to remap the file */
+ file_resize_error = GetLastError();
+ max_size.QuadPart = self->size;
+ new_size = self->size;
+ }
+ }
+
+ /* create a new file mapping and map a new view */
+ /* FIXME: call CreateFileMappingW with wchar_t tagname */
+ self->map_handle = CreateFileMappingW(
+ self->file_handle,
+ NULL,
+ PAGE_READWRITE,
+ max_size.HighPart,
+ max_size.LowPart,
+ self->tagname);
+
+ error = GetLastError();
+ /* ERROR_ALREADY_EXISTS implies that between our closing the handle above and
+ calling CreateFileMapping here, someone's created a different mapping with
+ the same name. There's nothing we can usefully do so we invalidate our
+ mapping and error out.
+ */
+ if (error == ERROR_ALREADY_EXISTS) {
+ CloseHandle(self->map_handle);
+ self->map_handle = NULL;
+ }
+ else if (self->map_handle != NULL) {
+ self->data = MapViewOfFile(self->map_handle,
+ FILE_MAP_WRITE,
+ offset.HighPart,
+ offset.LowPart,
+ new_size);
+ if (self->data != NULL) {
+ /* copy the old view if using the paging file */
+ if (self->file_handle == INVALID_HANDLE_VALUE) {
+ memcpy(self->data, old_data,
+ self->size < new_size ? self->size : new_size);
+ if (!UnmapViewOfFile(old_data)) {
+ error = GetLastError();
+ }
+ }
+ self->size = new_size;
+ }
+ else {
+ error = GetLastError();
+ CloseHandle(self->map_handle);
+ self->map_handle = NULL;
+ }
+ }
+
+ if (error) {
+ return PyErr_SetFromWindowsErr(error);
+ return NULL;
+ }
+ /* It's possible for a resize to fail, typically because another mapping
+ is still held against the same underlying file. Even if nothing has
+ failed -- ie we're still returning a valid file mapping -- raise the
+ error as an exception as the resize won't have happened
+ */
+ if (file_resize_error) {
+ PyErr_SetFromWindowsErr(file_resize_error);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+#endif /* MS_WINDOWS */
+
+#ifdef UNIX
+#ifndef HAVE_MREMAP
+ PyErr_SetString(PyExc_SystemError,
+ "mmap: resizing not available--no mremap()");
+ return NULL;
+#else
+ void *newmap;
+
+ if (self->fd != -1 && ftruncate(self->fd, self->offset + new_size) == -1) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+#ifdef MREMAP_MAYMOVE
+ newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE);
+#else
+#if defined(__NetBSD__)
+ newmap = mremap(self->data, self->size, self->data, new_size, 0);
+#else
+ newmap = mremap(self->data, self->size, new_size, 0);
+#endif /* __NetBSD__ */
+#endif
+ if (newmap == (void *)-1)
+ {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ self->data = newmap;
+ self->size = new_size;
+ Py_RETURN_NONE;
+#endif /* HAVE_MREMAP */
+#endif /* UNIX */
+ }
+}
+
+static PyObject *
+mmap_tell_method(mmap_object *self, PyObject *unused)
+{
+ CHECK_VALID(NULL);
+ return PyLong_FromSize_t(self->pos);
+}
+
+static PyObject *
+mmap_flush_method(mmap_object *self, PyObject *args)
+{
+ Py_ssize_t offset = 0;
+ Py_ssize_t size = self->size;
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "|nn:flush", &offset, &size))
+ return NULL;
+ if (size < 0 || offset < 0 || self->size - offset < size) {
+ PyErr_SetString(PyExc_ValueError, "flush values out of range");
+ return NULL;
+ }
+
+ if (self->access == ACCESS_READ || self->access == ACCESS_COPY)
+ Py_RETURN_NONE;
+
+#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
+ if (!FlushViewOfFile(self->data+offset, size)) {
+ PyErr_SetFromWindowsErr(GetLastError());
+ return NULL;
+ }
+ Py_RETURN_NONE;
+#elif defined(UNIX)
+ /* XXX flags for msync? */
+ if (-1 == msync(self->data + offset, size, MS_SYNC)) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+#else
+ PyErr_SetString(PyExc_ValueError, "flush not supported on this system");
+ return NULL;
+#endif
+}
+
+static PyObject *
+mmap_seek_method(mmap_object *self, PyObject *args)
+{
+ Py_ssize_t dist;
+ int how=0;
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "n|i:seek", &dist, &how))
+ return NULL;
+ else {
+ Py_ssize_t where;
+ switch (how) {
+ case 0: /* relative to start */
+ where = dist;
+ break;
+ case 1: /* relative to current position */
+ if (PY_SSIZE_T_MAX - self->pos < dist)
+ goto onoutofrange;
+ where = self->pos + dist;
+ break;
+ case 2: /* relative to end */
+ if (PY_SSIZE_T_MAX - self->size < dist)
+ goto onoutofrange;
+ where = self->size + dist;
+ break;
+ default:
+ PyErr_SetString(PyExc_ValueError, "unknown seek type");
+ return NULL;
+ }
+ if (where > self->size || where < 0)
+ goto onoutofrange;
+ self->pos = where;
+ Py_RETURN_NONE;
+ }
+
+ onoutofrange:
+ PyErr_SetString(PyExc_ValueError, "seek out of range");
+ return NULL;
+}
+
+static PyObject *
+mmap_move_method(mmap_object *self, PyObject *args)
+{
+ Py_ssize_t dest, src, cnt;
+ CHECK_VALID(NULL);
+ if (!PyArg_ParseTuple(args, "nnn:move", &dest, &src, &cnt) ||
+ !is_writable(self)) {
+ return NULL;
+ } else {
+ /* bounds check the values */
+ if (dest < 0 || src < 0 || cnt < 0)
+ goto bounds;
+ if (self->size - dest < cnt || self->size - src < cnt)
+ goto bounds;
+
+ CHECK_VALID(NULL);
+ memmove(&self->data[dest], &self->data[src], cnt);
+
+ Py_RETURN_NONE;
+
+ bounds:
+ PyErr_SetString(PyExc_ValueError,
+ "source, destination, or count out of range");
+ return NULL;
+ }
+}
+
+static PyObject *
+mmap_closed_get(mmap_object *self, void *Py_UNUSED(ignored))
+{
+#ifdef MS_WINDOWS
+ return PyBool_FromLong(self->map_handle == NULL ? 1 : 0);
+#elif defined(UNIX)
+ return PyBool_FromLong(self->data == NULL ? 1 : 0);
+#endif
+}
+
+static PyObject *
+mmap__enter__method(mmap_object *self, PyObject *args)
+{
+ CHECK_VALID(NULL);
+
+ return Py_NewRef(self);
+}
+
+static PyObject *
+mmap__exit__method(PyObject *self, PyObject *args)
+{
+ return mmap_close_method((mmap_object *)self, NULL);
+}
+
+static PyObject *
+mmap__repr__method(PyObject *self)
+{
+ mmap_object *mobj = (mmap_object *)self;
+
+#ifdef MS_WINDOWS
+#define _Py_FORMAT_OFFSET "lld"
+ if (mobj->map_handle == NULL)
+#elif defined(UNIX)
+# ifdef HAVE_LARGEFILE_SUPPORT
+# define _Py_FORMAT_OFFSET "lld"
+# else
+# define _Py_FORMAT_OFFSET "ld"
+# endif
+ if (mobj->data == NULL)
+#endif
+ {
+ return PyUnicode_FromFormat("<%s closed=True>", Py_TYPE(self)->tp_name);
+ } else {
+ const char *access_str;
+
+ switch (mobj->access) {
+ case ACCESS_DEFAULT:
+ access_str = "ACCESS_DEFAULT";
+ break;
+ case ACCESS_READ:
+ access_str = "ACCESS_READ";
+ break;
+ case ACCESS_WRITE:
+ access_str = "ACCESS_WRITE";
+ break;
+ case ACCESS_COPY:
+ access_str = "ACCESS_COPY";
+ break;
+ default:
+ Py_UNREACHABLE();
+ }
+
+ return PyUnicode_FromFormat("<%s closed=False, access=%s, length=%zd, "
+ "pos=%zd, offset=%" _Py_FORMAT_OFFSET ">",
+ Py_TYPE(self)->tp_name, access_str,
+ mobj->size, mobj->pos, mobj->offset);
+ }
+}
+
+#ifdef MS_WINDOWS
+static PyObject *
+mmap__sizeof__method(mmap_object *self, void *unused)
+{
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ if (self->tagname) {
+ res += (wcslen(self->tagname) + 1) * sizeof(self->tagname[0]);
+ }
+ return PyLong_FromSize_t(res);
+}
+#endif
+
+#ifdef HAVE_MADVISE
+static PyObject *
+mmap_madvise_method(mmap_object *self, PyObject *args)
+{
+ int option;
+ Py_ssize_t start = 0, length;
+
+ CHECK_VALID(NULL);
+ length = self->size;
+
+ if (!PyArg_ParseTuple(args, "i|nn:madvise", &option, &start, &length)) {
+ return NULL;
+ }
+
+ if (start < 0 || start >= self->size) {
+ PyErr_SetString(PyExc_ValueError, "madvise start out of bounds");
+ return NULL;
+ }
+ if (length < 0) {
+ PyErr_SetString(PyExc_ValueError, "madvise length invalid");
+ return NULL;
+ }
+ if (PY_SSIZE_T_MAX - start < length) {
+ PyErr_SetString(PyExc_OverflowError, "madvise length too large");
+ return NULL;
+ }
+
+ if (start + length > self->size) {
+ length = self->size - start;
+ }
+
+ CHECK_VALID(NULL);
+ if (madvise(self->data + start, length, option) != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+#endif // HAVE_MADVISE
+
+static struct PyMemberDef mmap_object_members[] = {
+ {"__weaklistoffset__", T_PYSSIZET, offsetof(mmap_object, weakreflist), READONLY},
+ {NULL},
+};
+
+static struct PyMethodDef mmap_object_methods[] = {
+ {"close", (PyCFunction) mmap_close_method, METH_NOARGS},
+ {"find", (PyCFunction) mmap_find_method, METH_VARARGS},
+ {"rfind", (PyCFunction) mmap_rfind_method, METH_VARARGS},
+ {"flush", (PyCFunction) mmap_flush_method, METH_VARARGS},
+#ifdef HAVE_MADVISE
+ {"madvise", (PyCFunction) mmap_madvise_method, METH_VARARGS},
+#endif
+ {"move", (PyCFunction) mmap_move_method, METH_VARARGS},
+ {"read", (PyCFunction) mmap_read_method, METH_VARARGS},
+ {"read_byte", (PyCFunction) mmap_read_byte_method, METH_NOARGS},
+ {"readline", (PyCFunction) mmap_read_line_method, METH_NOARGS},
+ {"resize", (PyCFunction) mmap_resize_method, METH_VARARGS},
+ {"seek", (PyCFunction) mmap_seek_method, METH_VARARGS},
+ {"size", (PyCFunction) mmap_size_method, METH_NOARGS},
+ {"tell", (PyCFunction) mmap_tell_method, METH_NOARGS},
+ {"write", (PyCFunction) mmap_write_method, METH_VARARGS},
+ {"write_byte", (PyCFunction) mmap_write_byte_method, METH_VARARGS},
+ {"__enter__", (PyCFunction) mmap__enter__method, METH_NOARGS},
+ {"__exit__", (PyCFunction) mmap__exit__method, METH_VARARGS},
+#ifdef MS_WINDOWS
+ {"__sizeof__", (PyCFunction) mmap__sizeof__method, METH_NOARGS},
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+static PyGetSetDef mmap_object_getset[] = {
+ {"closed", (getter) mmap_closed_get, NULL, NULL},
+ {NULL}
+};
+
+
+/* Functions for treating an mmap'ed file as a buffer */
+
+static int
+mmap_buffer_getbuf(mmap_object *self, Py_buffer *view, int flags)
+{
+ CHECK_VALID(-1);
+ if (PyBuffer_FillInfo(view, (PyObject*)self, self->data, self->size,
+ (self->access == ACCESS_READ), flags) < 0)
+ return -1;
+ self->exports++;
+ return 0;
+}
+
+static void
+mmap_buffer_releasebuf(mmap_object *self, Py_buffer *view)
+{
+ self->exports--;
+}
+
+static Py_ssize_t
+mmap_length(mmap_object *self)
+{
+ CHECK_VALID(-1);
+ return self->size;
+}
+
+static PyObject *
+mmap_item(mmap_object *self, Py_ssize_t i)
+{
+ CHECK_VALID(NULL);
+ if (i < 0 || i >= self->size) {
+ PyErr_SetString(PyExc_IndexError, "mmap index out of range");
+ return NULL;
+ }
+ return PyBytes_FromStringAndSize(self->data + i, 1);
+}
+
+static PyObject *
+mmap_subscript(mmap_object *self, PyObject *item)
+{
+ CHECK_VALID(NULL);
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred())
+ return NULL;
+ if (i < 0)
+ i += self->size;
+ if (i < 0 || i >= self->size) {
+ PyErr_SetString(PyExc_IndexError,
+ "mmap index out of range");
+ return NULL;
+ }
+ CHECK_VALID(NULL);
+ return PyLong_FromLong(Py_CHARMASK(self->data[i]));
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return NULL;
+ }
+ slicelen = PySlice_AdjustIndices(self->size, &start, &stop, step);
+
+ CHECK_VALID(NULL);
+ if (slicelen <= 0)
+ return PyBytes_FromStringAndSize("", 0);
+ else if (step == 1)
+ return PyBytes_FromStringAndSize(self->data + start,
+ slicelen);
+ else {
+ char *result_buf = (char *)PyMem_Malloc(slicelen);
+ size_t cur;
+ Py_ssize_t i;
+ PyObject *result;
+
+ if (result_buf == NULL)
+ return PyErr_NoMemory();
+
+ for (cur = start, i = 0; i < slicelen;
+ cur += step, i++) {
+ result_buf[i] = self->data[cur];
+ }
+ result = PyBytes_FromStringAndSize(result_buf,
+ slicelen);
+ PyMem_Free(result_buf);
+ return result;
+ }
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "mmap indices must be integers");
+ return NULL;
+ }
+}
+
+static int
+mmap_ass_item(mmap_object *self, Py_ssize_t i, PyObject *v)
+{
+ const char *buf;
+
+ CHECK_VALID(-1);
+ if (i < 0 || i >= self->size) {
+ PyErr_SetString(PyExc_IndexError, "mmap index out of range");
+ return -1;
+ }
+ if (v == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "mmap object doesn't support item deletion");
+ return -1;
+ }
+ if (! (PyBytes_Check(v) && PyBytes_Size(v)==1) ) {
+ PyErr_SetString(PyExc_IndexError,
+ "mmap assignment must be length-1 bytes()");
+ return -1;
+ }
+ if (!is_writable(self))
+ return -1;
+ buf = PyBytes_AsString(v);
+ self->data[i] = buf[0];
+ return 0;
+}
+
+static int
+mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
+{
+ CHECK_VALID(-1);
+
+ if (!is_writable(self))
+ return -1;
+
+ if (PyIndex_Check(item)) {
+ Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError);
+ Py_ssize_t v;
+
+ if (i == -1 && PyErr_Occurred())
+ return -1;
+ if (i < 0)
+ i += self->size;
+ if (i < 0 || i >= self->size) {
+ PyErr_SetString(PyExc_IndexError,
+ "mmap index out of range");
+ return -1;
+ }
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "mmap doesn't support item deletion");
+ return -1;
+ }
+ if (!PyIndex_Check(value)) {
+ PyErr_SetString(PyExc_TypeError,
+ "mmap item value must be an int");
+ return -1;
+ }
+ v = PyNumber_AsSsize_t(value, PyExc_TypeError);
+ if (v == -1 && PyErr_Occurred())
+ return -1;
+ if (v < 0 || v > 255) {
+ PyErr_SetString(PyExc_ValueError,
+ "mmap item value must be "
+ "in range(0, 256)");
+ return -1;
+ }
+ CHECK_VALID(-1);
+ self->data[i] = (char) v;
+ return 0;
+ }
+ else if (PySlice_Check(item)) {
+ Py_ssize_t start, stop, step, slicelen;
+ Py_buffer vbuf;
+
+ if (PySlice_Unpack(item, &start, &stop, &step) < 0) {
+ return -1;
+ }
+ slicelen = PySlice_AdjustIndices(self->size, &start, &stop, step);
+ if (value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "mmap object doesn't support slice deletion");
+ return -1;
+ }
+ if (PyObject_GetBuffer(value, &vbuf, PyBUF_SIMPLE) < 0)
+ return -1;
+ if (vbuf.len != slicelen) {
+ PyErr_SetString(PyExc_IndexError,
+ "mmap slice assignment is wrong size");
+ PyBuffer_Release(&vbuf);
+ return -1;
+ }
+
+ CHECK_VALID_OR_RELEASE(-1, vbuf);
+ if (slicelen == 0) {
+ }
+ else if (step == 1) {
+ memcpy(self->data + start, vbuf.buf, slicelen);
+ }
+ else {
+ size_t cur;
+ Py_ssize_t i;
+
+ for (cur = start, i = 0;
+ i < slicelen;
+ cur += step, i++)
+ {
+ self->data[cur] = ((char *)vbuf.buf)[i];
+ }
+ }
+ PyBuffer_Release(&vbuf);
+ return 0;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "mmap indices must be integer");
+ return -1;
+ }
+}
+
+static PyObject *
+new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict);
+
+PyDoc_STRVAR(mmap_doc,
+"Windows: mmap(fileno, length[, tagname[, access[, offset]]])\n\
+\n\
+Maps length bytes from the file specified by the file handle fileno,\n\
+and returns a mmap object. If length is larger than the current size\n\
+of the file, the file is extended to contain length bytes. If length\n\
+is 0, the maximum length of the map is the current size of the file,\n\
+except that if the file is empty Windows raises an exception (you cannot\n\
+create an empty mapping on Windows).\n\
+\n\
+Unix: mmap(fileno, length[, flags[, prot[, access[, offset]]]])\n\
+\n\
+Maps length bytes from the file specified by the file descriptor fileno,\n\
+and returns a mmap object. If length is 0, the maximum length of the map\n\
+will be the current size of the file when mmap is called.\n\
+flags specifies the nature of the mapping. MAP_PRIVATE creates a\n\
+private copy-on-write mapping, so changes to the contents of the mmap\n\
+object will be private to this process, and MAP_SHARED creates a mapping\n\
+that's shared with all other processes mapping the same areas of the file.\n\
+The default value is MAP_SHARED.\n\
+\n\
+To map anonymous memory, pass -1 as the fileno (both versions).");
+
+
+static PyType_Slot mmap_object_slots[] = {
+ {Py_tp_new, new_mmap_object},
+ {Py_tp_dealloc, mmap_object_dealloc},
+ {Py_tp_repr, mmap__repr__method},
+ {Py_tp_doc, (void *)mmap_doc},
+ {Py_tp_methods, mmap_object_methods},
+ {Py_tp_members, mmap_object_members},
+ {Py_tp_getset, mmap_object_getset},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_traverse, mmap_object_traverse},
+
+ /* as sequence */
+ {Py_sq_length, mmap_length},
+ {Py_sq_item, mmap_item},
+ {Py_sq_ass_item, mmap_ass_item},
+
+ /* as mapping */
+ {Py_mp_length, mmap_length},
+ {Py_mp_subscript, mmap_subscript},
+ {Py_mp_ass_subscript, mmap_ass_subscript},
+
+ /* as buffer */
+ {Py_bf_getbuffer, mmap_buffer_getbuf},
+ {Py_bf_releasebuffer, mmap_buffer_releasebuf},
+ {0, NULL},
+};
+
+static PyType_Spec mmap_object_spec = {
+ .name = "mmap.mmap",
+ .basicsize = sizeof(mmap_object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = mmap_object_slots,
+};
+
+
+#ifdef UNIX
+#ifdef HAVE_LARGEFILE_SUPPORT
+#define _Py_PARSE_OFF_T "L"
+#else
+#define _Py_PARSE_OFF_T "l"
+#endif
+
+static PyObject *
+new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
+{
+ struct _Py_stat_struct status;
+ int fstat_result = -1;
+ mmap_object *m_obj;
+ Py_ssize_t map_size;
+ off_t offset = 0;
+ int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ;
+ int devzero = -1;
+ int access = (int)ACCESS_DEFAULT;
+ static char *keywords[] = {"fileno", "length",
+ "flags", "prot",
+ "access", "offset", NULL};
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwdict, "in|iii" _Py_PARSE_OFF_T, keywords,
+ &fd, &map_size, &flags, &prot,
+ &access, &offset))
+ return NULL;
+ if (map_size < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "memory mapped length must be positive");
+ return NULL;
+ }
+ if (offset < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "memory mapped offset must be positive");
+ return NULL;
+ }
+
+ if ((access != (int)ACCESS_DEFAULT) &&
+ ((flags != MAP_SHARED) || (prot != (PROT_WRITE | PROT_READ))))
+ return PyErr_Format(PyExc_ValueError,
+ "mmap can't specify both access and flags, prot.");
+ switch ((access_mode)access) {
+ case ACCESS_READ:
+ flags = MAP_SHARED;
+ prot = PROT_READ;
+ break;
+ case ACCESS_WRITE:
+ flags = MAP_SHARED;
+ prot = PROT_READ | PROT_WRITE;
+ break;
+ case ACCESS_COPY:
+ flags = MAP_PRIVATE;
+ prot = PROT_READ | PROT_WRITE;
+ break;
+ case ACCESS_DEFAULT:
+ /* map prot to access type */
+ if ((prot & PROT_READ) && (prot & PROT_WRITE)) {
+ /* ACCESS_DEFAULT */
+ }
+ else if (prot & PROT_WRITE) {
+ access = ACCESS_WRITE;
+ }
+ else {
+ access = ACCESS_READ;
+ }
+ break;
+ default:
+ return PyErr_Format(PyExc_ValueError,
+ "mmap invalid access parameter.");
+ }
+
+ if (PySys_Audit("mmap.__new__", "ini" _Py_PARSE_OFF_T,
+ fd, map_size, access, offset) < 0) {
+ return NULL;
+ }
+
+#ifdef __APPLE__
+ /* Issue #11277: fsync(2) is not enough on OS X - a special, OS X specific
+ fcntl(2) is necessary to force DISKSYNC and get around mmap(2) bug */
+ if (fd != -1)
+ (void)fcntl(fd, F_FULLFSYNC);
+#endif
+
+ if (fd != -1) {
+ Py_BEGIN_ALLOW_THREADS
+ fstat_result = _Py_fstat_noraise(fd, &status);
+ Py_END_ALLOW_THREADS
+ }
+
+ if (fd != -1 && fstat_result == 0 && S_ISREG(status.st_mode)) {
+ if (map_size == 0) {
+ if (status.st_size == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot mmap an empty file");
+ return NULL;
+ }
+ if (offset >= status.st_size) {
+ PyErr_SetString(PyExc_ValueError,
+ "mmap offset is greater than file size");
+ return NULL;
+ }
+ if (status.st_size - offset > PY_SSIZE_T_MAX) {
+ PyErr_SetString(PyExc_ValueError,
+ "mmap length is too large");
+ return NULL;
+ }
+ map_size = (Py_ssize_t) (status.st_size - offset);
+ } else if (offset > status.st_size || status.st_size - offset < map_size) {
+ PyErr_SetString(PyExc_ValueError,
+ "mmap length is greater than file size");
+ return NULL;
+ }
+ }
+ m_obj = (mmap_object *)type->tp_alloc(type, 0);
+ if (m_obj == NULL) {return NULL;}
+ m_obj->data = NULL;
+ m_obj->size = map_size;
+ m_obj->pos = 0;
+ m_obj->weakreflist = NULL;
+ m_obj->exports = 0;
+ m_obj->offset = offset;
+ if (fd == -1) {
+ m_obj->fd = -1;
+ /* Assume the caller wants to map anonymous memory.
+ This is the same behaviour as Windows. mmap.mmap(-1, size)
+ on both Windows and Unix map anonymous memory.
+ */
+#ifdef MAP_ANONYMOUS
+ /* BSD way to map anonymous memory */
+ flags |= MAP_ANONYMOUS;
+
+ /* VxWorks only supports MAP_ANONYMOUS with MAP_PRIVATE flag */
+#ifdef __VXWORKS__
+ flags &= ~MAP_SHARED;
+ flags |= MAP_PRIVATE;
+#endif
+
+#else
+ /* SVR4 method to map anonymous memory is to open /dev/zero */
+ fd = devzero = _Py_open("/dev/zero", O_RDWR);
+ if (devzero == -1) {
+ Py_DECREF(m_obj);
+ return NULL;
+ }
+#endif
+ }
+ else {
+ m_obj->fd = _Py_dup(fd);
+ if (m_obj->fd == -1) {
+ Py_DECREF(m_obj);
+ return NULL;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ m_obj->data = mmap(NULL, map_size, prot, flags, fd, offset);
+ Py_END_ALLOW_THREADS
+
+ int saved_errno = errno;
+ if (devzero != -1) {
+ close(devzero);
+ }
+
+ if (m_obj->data == (char *)-1) {
+ m_obj->data = NULL;
+ Py_DECREF(m_obj);
+ errno = saved_errno;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ m_obj->access = (access_mode)access;
+ return (PyObject *)m_obj;
+}
+#endif /* UNIX */
+
+#ifdef MS_WINDOWS
+
+/* A note on sizes and offsets: while the actual map size must hold in a
+ Py_ssize_t, both the total file size and the start offset can be longer
+ than a Py_ssize_t, so we use long long which is always 64-bit.
+*/
+
+static PyObject *
+new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
+{
+ mmap_object *m_obj;
+ Py_ssize_t map_size;
+ long long offset = 0, size;
+ DWORD off_hi; /* upper 32 bits of offset */
+ DWORD off_lo; /* lower 32 bits of offset */
+ DWORD size_hi; /* upper 32 bits of size */
+ DWORD size_lo; /* lower 32 bits of size */
+ PyObject *tagname = Py_None;
+ DWORD dwErr = 0;
+ int fileno;
+ HANDLE fh = 0;
+ int access = (access_mode)ACCESS_DEFAULT;
+ DWORD flProtect, dwDesiredAccess;
+ static char *keywords[] = { "fileno", "length",
+ "tagname",
+ "access", "offset", NULL };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwdict, "in|OiL", keywords,
+ &fileno, &map_size,
+ &tagname, &access, &offset)) {
+ return NULL;
+ }
+
+ if (PySys_Audit("mmap.__new__", "iniL",
+ fileno, map_size, access, offset) < 0) {
+ return NULL;
+ }
+
+ switch((access_mode)access) {
+ case ACCESS_READ:
+ flProtect = PAGE_READONLY;
+ dwDesiredAccess = FILE_MAP_READ;
+ break;
+ case ACCESS_DEFAULT: case ACCESS_WRITE:
+ flProtect = PAGE_READWRITE;
+ dwDesiredAccess = FILE_MAP_WRITE;
+ break;
+ case ACCESS_COPY:
+ flProtect = PAGE_WRITECOPY;
+ dwDesiredAccess = FILE_MAP_COPY;
+ break;
+ default:
+ return PyErr_Format(PyExc_ValueError,
+ "mmap invalid access parameter.");
+ }
+
+ if (map_size < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "memory mapped length must be positive");
+ return NULL;
+ }
+ if (offset < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "memory mapped offset must be positive");
+ return NULL;
+ }
+
+ /* assume -1 and 0 both mean invalid filedescriptor
+ to 'anonymously' map memory.
+ XXX: fileno == 0 is a valid fd, but was accepted prior to 2.5.
+ XXX: Should this code be added?
+ if (fileno == 0)
+ PyErr_WarnEx(PyExc_DeprecationWarning,
+ "don't use 0 for anonymous memory",
+ 1);
+ */
+ if (fileno != -1 && fileno != 0) {
+ /* Ensure that fileno is within the CRT's valid range */
+ fh = _Py_get_osfhandle(fileno);
+ if (fh == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ /* Win9x appears to need us seeked to zero */
+ lseek(fileno, 0, SEEK_SET);
+ }
+
+ m_obj = (mmap_object *)type->tp_alloc(type, 0);
+ if (m_obj == NULL)
+ return NULL;
+ /* Set every field to an invalid marker, so we can safely
+ destruct the object in the face of failure */
+ m_obj->data = NULL;
+ m_obj->file_handle = INVALID_HANDLE_VALUE;
+ m_obj->map_handle = NULL;
+ m_obj->tagname = NULL;
+ m_obj->offset = offset;
+
+ if (fh) {
+ /* It is necessary to duplicate the handle, so the
+ Python code can close it on us */
+ if (!DuplicateHandle(
+ GetCurrentProcess(), /* source process handle */
+ fh, /* handle to be duplicated */
+ GetCurrentProcess(), /* target proc handle */
+ (LPHANDLE)&m_obj->file_handle, /* result */
+ 0, /* access - ignored due to options value */
+ FALSE, /* inherited by child processes? */
+ DUPLICATE_SAME_ACCESS)) { /* options */
+ dwErr = GetLastError();
+ Py_DECREF(m_obj);
+ PyErr_SetFromWindowsErr(dwErr);
+ return NULL;
+ }
+ if (!map_size) {
+ DWORD low,high;
+ low = GetFileSize(fh, &high);
+ /* low might just happen to have the value INVALID_FILE_SIZE;
+ so we need to check the last error also. */
+ if (low == INVALID_FILE_SIZE &&
+ (dwErr = GetLastError()) != NO_ERROR) {
+ Py_DECREF(m_obj);
+ return PyErr_SetFromWindowsErr(dwErr);
+ }
+
+ size = (((long long) high) << 32) + low;
+ if (size == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot mmap an empty file");
+ Py_DECREF(m_obj);
+ return NULL;
+ }
+ if (offset >= size) {
+ PyErr_SetString(PyExc_ValueError,
+ "mmap offset is greater than file size");
+ Py_DECREF(m_obj);
+ return NULL;
+ }
+ if (size - offset > PY_SSIZE_T_MAX) {
+ PyErr_SetString(PyExc_ValueError,
+ "mmap length is too large");
+ Py_DECREF(m_obj);
+ return NULL;
+ }
+ m_obj->size = (Py_ssize_t) (size - offset);
+ } else {
+ m_obj->size = map_size;
+ size = offset + map_size;
+ }
+ }
+ else {
+ m_obj->size = map_size;
+ size = offset + map_size;
+ }
+
+ /* set the initial position */
+ m_obj->pos = (size_t) 0;
+
+ m_obj->weakreflist = NULL;
+ m_obj->exports = 0;
+ /* set the tag name */
+ if (!Py_IsNone(tagname)) {
+ if (!PyUnicode_Check(tagname)) {
+ Py_DECREF(m_obj);
+ return PyErr_Format(PyExc_TypeError, "expected str or None for "
+ "'tagname', not %.200s",
+ Py_TYPE(tagname)->tp_name);
+ }
+ m_obj->tagname = PyUnicode_AsWideCharString(tagname, NULL);
+ if (m_obj->tagname == NULL) {
+ Py_DECREF(m_obj);
+ return NULL;
+ }
+ }
+
+ m_obj->access = (access_mode)access;
+ size_hi = (DWORD)(size >> 32);
+ size_lo = (DWORD)(size & 0xFFFFFFFF);
+ off_hi = (DWORD)(offset >> 32);
+ off_lo = (DWORD)(offset & 0xFFFFFFFF);
+ /* For files, it would be sufficient to pass 0 as size.
+ For anonymous maps, we have to pass the size explicitly. */
+ m_obj->map_handle = CreateFileMappingW(m_obj->file_handle,
+ NULL,
+ flProtect,
+ size_hi,
+ size_lo,
+ m_obj->tagname);
+ if (m_obj->map_handle != NULL) {
+ m_obj->data = (char *) MapViewOfFile(m_obj->map_handle,
+ dwDesiredAccess,
+ off_hi,
+ off_lo,
+ m_obj->size);
+ if (m_obj->data != NULL)
+ return (PyObject *)m_obj;
+ else {
+ dwErr = GetLastError();
+ CloseHandle(m_obj->map_handle);
+ m_obj->map_handle = NULL;
+ }
+ } else
+ dwErr = GetLastError();
+ Py_DECREF(m_obj);
+ PyErr_SetFromWindowsErr(dwErr);
+ return NULL;
+}
+#endif /* MS_WINDOWS */
+
+static int
+mmap_exec(PyObject *module)
+{
+ Py_INCREF(PyExc_OSError);
+ if (PyModule_AddObject(module, "error", PyExc_OSError) < 0) {
+ Py_DECREF(PyExc_OSError);
+ return -1;
+ }
+
+ PyObject *mmap_object_type = PyType_FromModuleAndSpec(module,
+ &mmap_object_spec, NULL);
+ if (mmap_object_type == NULL) {
+ return -1;
+ }
+ int rc = PyModule_AddType(module, (PyTypeObject *)mmap_object_type);
+ Py_DECREF(mmap_object_type);
+ if (rc < 0) {
+ return -1;
+ }
+
+#define ADD_INT_MACRO(module, constant) \
+ do { \
+ if (PyModule_AddIntConstant(module, #constant, constant) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+#ifdef PROT_EXEC
+ ADD_INT_MACRO(module, PROT_EXEC);
+#endif
+#ifdef PROT_READ
+ ADD_INT_MACRO(module, PROT_READ);
+#endif
+#ifdef PROT_WRITE
+ ADD_INT_MACRO(module, PROT_WRITE);
+#endif
+
+#ifdef MAP_SHARED
+ ADD_INT_MACRO(module, MAP_SHARED);
+#endif
+#ifdef MAP_PRIVATE
+ ADD_INT_MACRO(module, MAP_PRIVATE);
+#endif
+#ifdef MAP_DENYWRITE
+ ADD_INT_MACRO(module, MAP_DENYWRITE);
+#endif
+#ifdef MAP_EXECUTABLE
+ ADD_INT_MACRO(module, MAP_EXECUTABLE);
+#endif
+#ifdef MAP_ANONYMOUS
+ if (PyModule_AddIntConstant(module, "MAP_ANON", MAP_ANONYMOUS) < 0 ) {
+ return -1;
+ }
+ ADD_INT_MACRO(module, MAP_ANONYMOUS);
+#endif
+#ifdef MAP_POPULATE
+ ADD_INT_MACRO(module, MAP_POPULATE);
+#endif
+#ifdef MAP_STACK
+ // Mostly a no-op on Linux and NetBSD, but useful on OpenBSD
+ // for stack usage (even on x86 arch)
+ ADD_INT_MACRO(module, MAP_STACK);
+#endif
+#ifdef MAP_ALIGNED_SUPER
+ ADD_INT_MACRO(module, MAP_ALIGNED_SUPER);
+#endif
+#ifdef MAP_CONCEAL
+ ADD_INT_MACRO(module, MAP_CONCEAL);
+#endif
+ if (PyModule_AddIntConstant(module, "PAGESIZE", (long)my_getpagesize()) < 0 ) {
+ return -1;
+ }
+
+ if (PyModule_AddIntConstant(module, "ALLOCATIONGRANULARITY", (long)my_getallocationgranularity()) < 0 ) {
+ return -1;
+ }
+
+ ADD_INT_MACRO(module, ACCESS_DEFAULT);
+ ADD_INT_MACRO(module, ACCESS_READ);
+ ADD_INT_MACRO(module, ACCESS_WRITE);
+ ADD_INT_MACRO(module, ACCESS_COPY);
+
+#ifdef HAVE_MADVISE
+ // Conventional advice values
+#ifdef MADV_NORMAL
+ ADD_INT_MACRO(module, MADV_NORMAL);
+#endif
+#ifdef MADV_RANDOM
+ ADD_INT_MACRO(module, MADV_RANDOM);
+#endif
+#ifdef MADV_SEQUENTIAL
+ ADD_INT_MACRO(module, MADV_SEQUENTIAL);
+#endif
+#ifdef MADV_WILLNEED
+ ADD_INT_MACRO(module, MADV_WILLNEED);
+#endif
+#ifdef MADV_DONTNEED
+ ADD_INT_MACRO(module, MADV_DONTNEED);
+#endif
+
+ // Linux-specific advice values
+#ifdef MADV_REMOVE
+ ADD_INT_MACRO(module, MADV_REMOVE);
+#endif
+#ifdef MADV_DONTFORK
+ ADD_INT_MACRO(module, MADV_DONTFORK);
+#endif
+#ifdef MADV_DOFORK
+ ADD_INT_MACRO(module, MADV_DOFORK);
+#endif
+#ifdef MADV_HWPOISON
+ ADD_INT_MACRO(module, MADV_HWPOISON);
+#endif
+#ifdef MADV_MERGEABLE
+ ADD_INT_MACRO(module, MADV_MERGEABLE);
+#endif
+#ifdef MADV_UNMERGEABLE
+ ADD_INT_MACRO(module, MADV_UNMERGEABLE);
+#endif
+#ifdef MADV_SOFT_OFFLINE
+ ADD_INT_MACRO(module, MADV_SOFT_OFFLINE);
+#endif
+#ifdef MADV_HUGEPAGE
+ ADD_INT_MACRO(module, MADV_HUGEPAGE);
+#endif
+#ifdef MADV_NOHUGEPAGE
+ ADD_INT_MACRO(module, MADV_NOHUGEPAGE);
+#endif
+#ifdef MADV_DONTDUMP
+ ADD_INT_MACRO(module, MADV_DONTDUMP);
+#endif
+#ifdef MADV_DODUMP
+ ADD_INT_MACRO(module, MADV_DODUMP);
+#endif
+#ifdef MADV_FREE // (Also present on FreeBSD and macOS.)
+ ADD_INT_MACRO(module, MADV_FREE);
+#endif
+
+ // FreeBSD-specific
+#ifdef MADV_NOSYNC
+ ADD_INT_MACRO(module, MADV_NOSYNC);
+#endif
+#ifdef MADV_AUTOSYNC
+ ADD_INT_MACRO(module, MADV_AUTOSYNC);
+#endif
+#ifdef MADV_NOCORE
+ ADD_INT_MACRO(module, MADV_NOCORE);
+#endif
+#ifdef MADV_CORE
+ ADD_INT_MACRO(module, MADV_CORE);
+#endif
+#ifdef MADV_PROTECT
+ ADD_INT_MACRO(module, MADV_PROTECT);
+#endif
+
+ // Darwin-specific
+#ifdef MADV_FREE_REUSABLE // (As MADV_FREE but reclaims more faithful for task_info/Activity Monitor...)
+ ADD_INT_MACRO(module, MADV_FREE_REUSABLE);
+#endif
+#ifdef MADV_FREE_REUSE // (Reuse pages previously tagged as reusable)
+ ADD_INT_MACRO(module, MADV_FREE_REUSE);
+#endif
+#endif // HAVE_MADVISE
+ return 0;
+}
+
+static PyModuleDef_Slot mmap_slots[] = {
+ {Py_mod_exec, mmap_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef mmapmodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "mmap",
+ .m_size = 0,
+ .m_slots = mmap_slots,
+};
+
+PyMODINIT_FUNC
+PyInit_mmap(void)
+{
+ return PyModuleDef_Init(&mmapmodule);
+}
diff --git a/contrib/tools/python3/Modules/overlapped.c b/contrib/tools/python3/Modules/overlapped.c
new file mode 100644
index 00000000000..afdd78d1bc9
--- /dev/null
+++ b/contrib/tools/python3/Modules/overlapped.c
@@ -0,0 +1,2069 @@
+/*
+ * Support for overlapped IO
+ *
+ * Some code borrowed from Modules/_winapi.c of CPython
+ */
+
+/* XXX check overflow and DWORD <-> Py_ssize_t conversions
+ Check itemsize */
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+
+#define WINDOWS_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <mswsock.h>
+
+#if defined(MS_WIN32) && !defined(MS_WIN64)
+# define F_POINTER "k"
+# define T_POINTER T_ULONG
+#else
+# define F_POINTER "K"
+# define T_POINTER T_ULONGLONG
+#endif
+
+#define F_HANDLE F_POINTER
+#define F_ULONG_PTR F_POINTER
+#define F_DWORD "k"
+#define F_BOOL "i"
+#define F_UINT "I"
+
+#define T_HANDLE T_POINTER
+
+/*[python input]
+class pointer_converter(CConverter):
+ format_unit = '"F_POINTER"'
+
+ def parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyLong_AsVoidPtr({argname});
+ if (!{paramname} && PyErr_Occurred()) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.parser_name)
+
+class OVERLAPPED_converter(pointer_converter):
+ type = 'OVERLAPPED *'
+
+class HANDLE_converter(pointer_converter):
+ type = 'HANDLE'
+
+class ULONG_PTR_converter(pointer_converter):
+ type = 'ULONG_PTR'
+
+ def parse_arg(self, argname, displayname):
+ return """
+ {paramname} = (uintptr_t)PyLong_AsVoidPtr({argname});
+ if (!{paramname} && PyErr_Occurred()) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.parser_name)
+
+class DWORD_converter(unsigned_long_converter):
+ type = 'DWORD'
+
+class BOOL_converter(int_converter):
+ type = 'BOOL'
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=8a07ea3018f4cec8]*/
+
+/*[clinic input]
+module _overlapped
+class _overlapped.Overlapped "OverlappedObject *" "&OverlappedType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=92e5a799db35b96c]*/
+
+
+enum {TYPE_NONE, TYPE_NOT_STARTED, TYPE_READ, TYPE_READINTO, TYPE_WRITE,
+ TYPE_ACCEPT, TYPE_CONNECT, TYPE_DISCONNECT, TYPE_CONNECT_NAMED_PIPE,
+ TYPE_WAIT_NAMED_PIPE_AND_CONNECT, TYPE_TRANSMIT_FILE, TYPE_READ_FROM,
+ TYPE_WRITE_TO, TYPE_READ_FROM_INTO};
+
+typedef struct {
+ PyObject_HEAD
+ OVERLAPPED overlapped;
+ /* For convenience, we store the file handle too */
+ HANDLE handle;
+ /* Error returned by last method call */
+ DWORD error;
+ /* Type of operation */
+ DWORD type;
+ union {
+ /* Buffer allocated by us: TYPE_READ and TYPE_ACCEPT */
+ PyObject *allocated_buffer;
+ /* Buffer passed by the user: TYPE_WRITE, TYPE_WRITE_TO, and TYPE_READINTO */
+ Py_buffer user_buffer;
+
+ /* Data used for reading from a connectionless socket:
+ TYPE_READ_FROM */
+ struct {
+ // A (buffer, (host, port)) tuple
+ PyObject *result;
+ // The actual read buffer
+ PyObject *allocated_buffer;
+ struct sockaddr_in6 address;
+ int address_length;
+ } read_from;
+
+ /* Data used for reading from a connectionless socket:
+ TYPE_READ_FROM_INTO */
+ struct {
+ // A (number of bytes read, (host, port)) tuple
+ PyObject* result;
+ /* Buffer passed by the user */
+ Py_buffer user_buffer;
+ struct sockaddr_in6 address;
+ int address_length;
+ } read_from_into;
+ };
+} OverlappedObject;
+
+
+static inline void
+steal_buffer(Py_buffer * dst, Py_buffer * src)
+{
+ memcpy(dst, src, sizeof(Py_buffer));
+ memset(src, 0, sizeof(Py_buffer));
+}
+
+/*
+ * Map Windows error codes to subclasses of OSError
+ */
+
+static PyObject *
+SetFromWindowsErr(DWORD err)
+{
+ PyObject *exception_type;
+
+ if (err == 0)
+ err = GetLastError();
+ switch (err) {
+ case ERROR_CONNECTION_REFUSED:
+ exception_type = PyExc_ConnectionRefusedError;
+ break;
+ case ERROR_CONNECTION_ABORTED:
+ exception_type = PyExc_ConnectionAbortedError;
+ break;
+ default:
+ exception_type = PyExc_OSError;
+ }
+ return PyErr_SetExcFromWindowsErr(exception_type, err);
+}
+
+/*
+ * Some functions should be loaded at runtime
+ */
+
+static LPFN_ACCEPTEX Py_AcceptEx = NULL;
+static LPFN_CONNECTEX Py_ConnectEx = NULL;
+static LPFN_DISCONNECTEX Py_DisconnectEx = NULL;
+static LPFN_TRANSMITFILE Py_TransmitFile = NULL;
+
+#define GET_WSA_POINTER(s, x) \
+ (SOCKET_ERROR != WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, \
+ &Guid##x, sizeof(Guid##x), &Py_##x, \
+ sizeof(Py_##x), &dwBytes, NULL, NULL))
+
+static int
+initialize_function_pointers(void)
+{
+ GUID GuidAcceptEx = WSAID_ACCEPTEX;
+ GUID GuidConnectEx = WSAID_CONNECTEX;
+ GUID GuidDisconnectEx = WSAID_DISCONNECTEX;
+ GUID GuidTransmitFile = WSAID_TRANSMITFILE;
+ SOCKET s;
+ DWORD dwBytes;
+
+ if (Py_AcceptEx != NULL &&
+ Py_ConnectEx != NULL &&
+ Py_DisconnectEx != NULL &&
+ Py_TransmitFile != NULL)
+ {
+ // All function pointers are initialized already
+ // by previous module import
+ return 0;
+ }
+
+ s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (s == INVALID_SOCKET) {
+ SetFromWindowsErr(WSAGetLastError());
+ return -1;
+ }
+
+ if (!GET_WSA_POINTER(s, AcceptEx) ||
+ !GET_WSA_POINTER(s, ConnectEx) ||
+ !GET_WSA_POINTER(s, DisconnectEx) ||
+ !GET_WSA_POINTER(s, TransmitFile))
+ {
+ closesocket(s);
+ SetFromWindowsErr(WSAGetLastError());
+ return -1;
+ }
+
+ closesocket(s);
+ return 0;
+}
+
+/*
+ * Completion port stuff
+ */
+
+/*[clinic input]
+_overlapped.CreateIoCompletionPort
+
+ handle as FileHandle: HANDLE
+ port as ExistingCompletionPort: HANDLE
+ key as CompletionKey: ULONG_PTR
+ concurrency as NumberOfConcurrentThreads: DWORD
+ /
+
+Create a completion port or register a handle with a port.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_CreateIoCompletionPort_impl(PyObject *module, HANDLE FileHandle,
+ HANDLE ExistingCompletionPort,
+ ULONG_PTR CompletionKey,
+ DWORD NumberOfConcurrentThreads)
+/*[clinic end generated code: output=24ede2b0f05e5433 input=847bae4d0efe1976]*/
+{
+ HANDLE ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = CreateIoCompletionPort(FileHandle, ExistingCompletionPort,
+ CompletionKey, NumberOfConcurrentThreads);
+ Py_END_ALLOW_THREADS
+
+ if (ret == NULL)
+ return SetFromWindowsErr(0);
+ return Py_BuildValue(F_HANDLE, ret);
+}
+
+/*[clinic input]
+_overlapped.GetQueuedCompletionStatus
+
+ port as CompletionPort: HANDLE
+ msecs as Milliseconds: DWORD
+ /
+
+Get a message from completion port.
+
+Wait for up to msecs milliseconds.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_GetQueuedCompletionStatus_impl(PyObject *module,
+ HANDLE CompletionPort,
+ DWORD Milliseconds)
+/*[clinic end generated code: output=68314171628dddb7 input=94a042d14c4f6410]*/
+{
+ DWORD NumberOfBytes = 0;
+ ULONG_PTR CompletionKey = 0;
+ OVERLAPPED *Overlapped = NULL;
+ DWORD err;
+ BOOL ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = GetQueuedCompletionStatus(CompletionPort, &NumberOfBytes,
+ &CompletionKey, &Overlapped, Milliseconds);
+ Py_END_ALLOW_THREADS
+
+ err = ret ? ERROR_SUCCESS : GetLastError();
+ if (Overlapped == NULL) {
+ if (err == WAIT_TIMEOUT)
+ Py_RETURN_NONE;
+ else
+ return SetFromWindowsErr(err);
+ }
+ return Py_BuildValue(F_DWORD F_DWORD F_ULONG_PTR F_POINTER,
+ err, NumberOfBytes, CompletionKey, Overlapped);
+}
+
+/*[clinic input]
+_overlapped.PostQueuedCompletionStatus
+
+ port as CompletionPort: HANDLE
+ bytes as NumberOfBytes: DWORD
+ key as CompletionKey: ULONG_PTR
+ address as Overlapped: OVERLAPPED
+ /
+
+Post a message to completion port.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_PostQueuedCompletionStatus_impl(PyObject *module,
+ HANDLE CompletionPort,
+ DWORD NumberOfBytes,
+ ULONG_PTR CompletionKey,
+ OVERLAPPED *Overlapped)
+/*[clinic end generated code: output=93e73f2933a43e9e input=e936202d87937aca]*/
+{
+ BOOL ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = PostQueuedCompletionStatus(CompletionPort, NumberOfBytes,
+ CompletionKey, Overlapped);
+ Py_END_ALLOW_THREADS
+
+ if (!ret)
+ return SetFromWindowsErr(0);
+ Py_RETURN_NONE;
+}
+
+/*
+ * Wait for a handle
+ */
+
+struct PostCallbackData {
+ HANDLE CompletionPort;
+ LPOVERLAPPED Overlapped;
+};
+
+static VOID CALLBACK
+PostToQueueCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired)
+{
+ struct PostCallbackData *p = (struct PostCallbackData*) lpParameter;
+
+ PostQueuedCompletionStatus(p->CompletionPort, TimerOrWaitFired,
+ 0, p->Overlapped);
+ /* ignore possible error! */
+ PyMem_RawFree(p);
+}
+
+/*[clinic input]
+_overlapped.RegisterWaitWithQueue
+
+ Object: HANDLE
+ CompletionPort: HANDLE
+ Overlapped: OVERLAPPED
+ Timeout as Milliseconds: DWORD
+ /
+
+Register wait for Object; when complete CompletionPort is notified.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object,
+ HANDLE CompletionPort,
+ OVERLAPPED *Overlapped,
+ DWORD Milliseconds)
+/*[clinic end generated code: output=c2ace732e447fe45 input=2dd4efee44abe8ee]*/
+{
+ HANDLE NewWaitObject;
+ struct PostCallbackData data = {CompletionPort, Overlapped}, *pdata;
+
+ /* Use PyMem_RawMalloc() rather than PyMem_Malloc(), since
+ PostToQueueCallback() will call PyMem_Free() from a new C thread
+ which doesn't hold the GIL. */
+ pdata = PyMem_RawMalloc(sizeof(struct PostCallbackData));
+ if (pdata == NULL)
+ return SetFromWindowsErr(0);
+
+ *pdata = data;
+
+ if (!RegisterWaitForSingleObject(
+ &NewWaitObject, Object, PostToQueueCallback, pdata, Milliseconds,
+ WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE))
+ {
+ SetFromWindowsErr(0);
+ PyMem_RawFree(pdata);
+ return NULL;
+ }
+
+ return Py_BuildValue(F_HANDLE, NewWaitObject);
+}
+
+/*[clinic input]
+_overlapped.UnregisterWait
+
+ WaitHandle: HANDLE
+ /
+
+Unregister wait handle.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle)
+/*[clinic end generated code: output=ec90cd955a9a617d input=a56709544cb2df0f]*/
+{
+ BOOL ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = UnregisterWait(WaitHandle);
+ Py_END_ALLOW_THREADS
+
+ if (!ret)
+ return SetFromWindowsErr(0);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_overlapped.UnregisterWaitEx
+
+ WaitHandle: HANDLE
+ Event: HANDLE
+ /
+
+Unregister wait handle.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_UnregisterWaitEx_impl(PyObject *module, HANDLE WaitHandle,
+ HANDLE Event)
+/*[clinic end generated code: output=2e3d84c1d5f65b92 input=953cddc1de50fab9]*/
+{
+ BOOL ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = UnregisterWaitEx(WaitHandle, Event);
+ Py_END_ALLOW_THREADS
+
+ if (!ret)
+ return SetFromWindowsErr(0);
+ Py_RETURN_NONE;
+}
+
+/*
+ * Event functions -- currently only used by tests
+ */
+
+/*[clinic input]
+_overlapped.CreateEvent
+
+ EventAttributes: object
+ ManualReset: BOOL
+ InitialState: BOOL
+ Name: Py_UNICODE(accept={str, NoneType})
+ /
+
+Create an event.
+
+EventAttributes must be None.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_CreateEvent_impl(PyObject *module, PyObject *EventAttributes,
+ BOOL ManualReset, BOOL InitialState,
+ const Py_UNICODE *Name)
+/*[clinic end generated code: output=8e04f0916c17b13d input=dbc36ae14375ba24]*/
+{
+ HANDLE Event;
+
+ if (EventAttributes != Py_None) {
+ PyErr_SetString(PyExc_ValueError, "EventAttributes must be None");
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ Event = CreateEventW(NULL, ManualReset, InitialState, Name);
+ Py_END_ALLOW_THREADS
+
+ if (Event == NULL)
+ return SetFromWindowsErr(0);
+ return Py_BuildValue(F_HANDLE, Event);
+}
+
+/*[clinic input]
+_overlapped.SetEvent
+
+ Handle: HANDLE
+ /
+
+Set event.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_SetEvent_impl(PyObject *module, HANDLE Handle)
+/*[clinic end generated code: output=5b8d974216b0e569 input=d8b0d26eb7391e80]*/
+{
+ BOOL ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = SetEvent(Handle);
+ Py_END_ALLOW_THREADS
+
+ if (!ret)
+ return SetFromWindowsErr(0);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_overlapped.ResetEvent
+
+ Handle: HANDLE
+ /
+
+Reset event.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_ResetEvent_impl(PyObject *module, HANDLE Handle)
+/*[clinic end generated code: output=066537a8405cddb2 input=d4e089c9ba84ff2f]*/
+{
+ BOOL ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = ResetEvent(Handle);
+ Py_END_ALLOW_THREADS
+
+ if (!ret)
+ return SetFromWindowsErr(0);
+ Py_RETURN_NONE;
+}
+
+/*
+ * Bind socket handle to local port without doing slow getaddrinfo()
+ */
+
+/*[clinic input]
+_overlapped.BindLocal
+
+ handle as Socket: HANDLE
+ family as Family: int
+ /
+
+Bind a socket handle to an arbitrary local port.
+
+family should be AF_INET or AF_INET6.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_BindLocal_impl(PyObject *module, HANDLE Socket, int Family)
+/*[clinic end generated code: output=edb93862697aed9c input=a0e7b5c2f541170c]*/
+{
+ BOOL ret;
+
+ if (Family == AF_INET) {
+ struct sockaddr_in addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_port = 0;
+ addr.sin_addr.S_un.S_addr = INADDR_ANY;
+ ret = bind((SOCKET)Socket, (SOCKADDR*)&addr, sizeof(addr))
+ != SOCKET_ERROR;
+ } else if (Family == AF_INET6) {
+ struct sockaddr_in6 addr;
+ memset(&addr, 0, sizeof(addr));
+ addr.sin6_family = AF_INET6;
+ addr.sin6_port = 0;
+ addr.sin6_addr = in6addr_any;
+ ret = bind((SOCKET)Socket, (SOCKADDR*)&addr, sizeof(addr))
+ != SOCKET_ERROR;
+ } else {
+ PyErr_SetString(PyExc_ValueError, "expected tuple of length 2 or 4");
+ return NULL;
+ }
+
+ if (!ret)
+ return SetFromWindowsErr(WSAGetLastError());
+ Py_RETURN_NONE;
+}
+
+/*
+ * Windows equivalent of os.strerror() -- compare _ctypes/callproc.c
+ */
+
+/*[clinic input]
+_overlapped.FormatMessage
+
+ error_code as code: DWORD
+ /
+
+Return error message for an error code.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_FormatMessage_impl(PyObject *module, DWORD code)
+/*[clinic end generated code: output=02c964ff22407c6b input=644bb5b80326179e]*/
+{
+ DWORD n;
+ WCHAR *lpMsgBuf;
+ PyObject *res;
+
+ n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ code,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPWSTR) &lpMsgBuf,
+ 0,
+ NULL);
+ if (n) {
+ while (iswspace(lpMsgBuf[n-1]))
+ --n;
+ lpMsgBuf[n] = L'\0';
+ res = Py_BuildValue("u", lpMsgBuf);
+ } else {
+ res = PyUnicode_FromFormat("unknown error code %u", code);
+ }
+ LocalFree(lpMsgBuf);
+ return res;
+}
+
+
+/*
+ * Mark operation as completed - used when reading produces ERROR_BROKEN_PIPE
+ */
+
+static inline void
+mark_as_completed(OVERLAPPED *ov)
+{
+ ov->Internal = 0;
+ if (ov->hEvent != NULL)
+ SetEvent(ov->hEvent);
+}
+
+/*
+ * A Python object wrapping an OVERLAPPED structure and other useful data
+ * for overlapped I/O
+ */
+
+/*[clinic input]
+@classmethod
+_overlapped.Overlapped.__new__
+
+ event: HANDLE(c_default='INVALID_HANDLE_VALUE') = _overlapped.INVALID_HANDLE_VALUE
+
+OVERLAPPED structure wrapper.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_impl(PyTypeObject *type, HANDLE event)
+/*[clinic end generated code: output=6da60504a18eb421 input=26b8a7429e629e95]*/
+{
+ OverlappedObject *self;
+
+ if (event == INVALID_HANDLE_VALUE) {
+ event = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (event == NULL)
+ return SetFromWindowsErr(0);
+ }
+
+ self = PyObject_New(OverlappedObject, type);
+ if (self == NULL) {
+ if (event != NULL)
+ CloseHandle(event);
+ return NULL;
+ }
+
+ self->handle = NULL;
+ self->error = 0;
+ self->type = TYPE_NONE;
+ self->allocated_buffer = NULL;
+ memset(&self->overlapped, 0, sizeof(OVERLAPPED));
+ memset(&self->user_buffer, 0, sizeof(Py_buffer));
+ if (event)
+ self->overlapped.hEvent = event;
+ return (PyObject *)self;
+}
+
+
+/* Note (bpo-32710): OverlappedType.tp_clear is not defined to not release
+ buffers while overlapped are still running, to prevent a crash. */
+static int
+Overlapped_clear(OverlappedObject *self)
+{
+ switch (self->type) {
+ case TYPE_READ:
+ case TYPE_ACCEPT: {
+ Py_CLEAR(self->allocated_buffer);
+ break;
+ }
+ case TYPE_READ_FROM: {
+ // An initial call to WSARecvFrom will only allocate the buffer.
+ // The result tuple of (message, address) is only
+ // allocated _after_ a message has been received.
+ if(self->read_from.result) {
+ // We've received a message, free the result tuple.
+ Py_CLEAR(self->read_from.result);
+ }
+ if(self->read_from.allocated_buffer) {
+ Py_CLEAR(self->read_from.allocated_buffer);
+ }
+ break;
+ }
+ case TYPE_READ_FROM_INTO: {
+ if (self->read_from_into.result) {
+ // We've received a message, free the result tuple.
+ Py_CLEAR(self->read_from_into.result);
+ }
+ if (self->read_from_into.user_buffer.obj) {
+ PyBuffer_Release(&self->read_from_into.user_buffer);
+ }
+ break;
+ }
+ case TYPE_WRITE:
+ case TYPE_WRITE_TO:
+ case TYPE_READINTO: {
+ if (self->user_buffer.obj) {
+ PyBuffer_Release(&self->user_buffer);
+ }
+ break;
+ }
+ }
+ self->type = TYPE_NOT_STARTED;
+ return 0;
+}
+
+static void
+Overlapped_dealloc(OverlappedObject *self)
+{
+ DWORD bytes;
+ DWORD olderr = GetLastError();
+ BOOL wait = FALSE;
+ BOOL ret;
+
+ if (!HasOverlappedIoCompleted(&self->overlapped) &&
+ self->type != TYPE_NOT_STARTED)
+ {
+ Py_BEGIN_ALLOW_THREADS
+ if (CancelIoEx(self->handle, &self->overlapped))
+ wait = TRUE;
+
+ ret = GetOverlappedResult(self->handle, &self->overlapped,
+ &bytes, wait);
+ Py_END_ALLOW_THREADS
+
+ switch (ret ? ERROR_SUCCESS : GetLastError()) {
+ case ERROR_SUCCESS:
+ case ERROR_NOT_FOUND:
+ case ERROR_OPERATION_ABORTED:
+ break;
+ default:
+ PyErr_Format(
+ PyExc_RuntimeError,
+ "%R still has pending operation at "
+ "deallocation, the process may crash", self);
+ PyErr_WriteUnraisable(NULL);
+ }
+ }
+
+ if (self->overlapped.hEvent != NULL) {
+ CloseHandle(self->overlapped.hEvent);
+ }
+
+ Overlapped_clear(self);
+ SetLastError(olderr);
+
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_Free(self);
+ Py_DECREF(tp);
+}
+
+
+/* Convert IPv4 sockaddr to a Python str. */
+
+static PyObject *
+make_ipv4_addr(const struct sockaddr_in *addr)
+{
+ char buf[INET_ADDRSTRLEN];
+ if (inet_ntop(AF_INET, &addr->sin_addr, buf, sizeof(buf)) == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyUnicode_FromString(buf);
+}
+
+/* Convert IPv6 sockaddr to a Python str. */
+
+static PyObject *
+make_ipv6_addr(const struct sockaddr_in6 *addr)
+{
+ char buf[INET6_ADDRSTRLEN];
+ if (inet_ntop(AF_INET6, &addr->sin6_addr, buf, sizeof(buf)) == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyUnicode_FromString(buf);
+}
+
+static PyObject*
+unparse_address(LPSOCKADDR Address, DWORD Length)
+{
+ /* The function is adopted from mocketmodule.c makesockaddr()*/
+
+ switch(Address->sa_family) {
+ case AF_INET: {
+ const struct sockaddr_in *a = (const struct sockaddr_in *)Address;
+ PyObject *addrobj = make_ipv4_addr(a);
+ PyObject *ret = NULL;
+ if (addrobj) {
+ ret = Py_BuildValue("Oi", addrobj, ntohs(a->sin_port));
+ Py_DECREF(addrobj);
+ }
+ return ret;
+ }
+ case AF_INET6: {
+ const struct sockaddr_in6 *a = (const struct sockaddr_in6 *)Address;
+ PyObject *addrobj = make_ipv6_addr(a);
+ PyObject *ret = NULL;
+ if (addrobj) {
+ ret = Py_BuildValue("OiII",
+ addrobj,
+ ntohs(a->sin6_port),
+ ntohl(a->sin6_flowinfo),
+ a->sin6_scope_id);
+ Py_DECREF(addrobj);
+ }
+ return ret;
+ }
+ default: {
+ PyErr_SetString(PyExc_ValueError, "recvfrom returned unsupported address family");
+ return NULL;
+ }
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.cancel
+
+Cancel overlapped operation.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_cancel_impl(OverlappedObject *self)
+/*[clinic end generated code: output=54ad7aeece89901c input=80eb67c7b57dbcf1]*/
+{
+ BOOL ret = TRUE;
+
+ if (self->type == TYPE_NOT_STARTED
+ || self->type == TYPE_WAIT_NAMED_PIPE_AND_CONNECT)
+ Py_RETURN_NONE;
+
+ if (!HasOverlappedIoCompleted(&self->overlapped)) {
+ Py_BEGIN_ALLOW_THREADS
+ ret = CancelIoEx(self->handle, &self->overlapped);
+ Py_END_ALLOW_THREADS
+ }
+
+ /* CancelIoEx returns ERROR_NOT_FOUND if the I/O completed in-between */
+ if (!ret && GetLastError() != ERROR_NOT_FOUND)
+ return SetFromWindowsErr(0);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_overlapped.Overlapped.getresult
+
+ wait: BOOL(c_default='FALSE') = False
+ /
+
+Retrieve result of operation.
+
+If wait is true then it blocks until the operation is finished. If wait
+is false and the operation is still pending then an error is raised.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_getresult_impl(OverlappedObject *self, BOOL wait)
+/*[clinic end generated code: output=8c9bd04d08994f6c input=aa5b03e9897ca074]*/
+{
+ DWORD transferred = 0;
+ BOOL ret;
+ DWORD err;
+ PyObject *addr;
+
+ if (self->type == TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation not yet attempted");
+ return NULL;
+ }
+
+ if (self->type == TYPE_NOT_STARTED) {
+ PyErr_SetString(PyExc_ValueError, "operation failed to start");
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = GetOverlappedResult(self->handle, &self->overlapped, &transferred,
+ wait);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_MORE_DATA:
+ break;
+ case ERROR_BROKEN_PIPE:
+ if (self->type == TYPE_READ || self->type == TYPE_READINTO) {
+ break;
+ }
+ else if (self->type == TYPE_READ_FROM &&
+ (self->read_from.result != NULL ||
+ self->read_from.allocated_buffer != NULL))
+ {
+ break;
+ }
+ else if (self->type == TYPE_READ_FROM_INTO &&
+ self->read_from_into.result != NULL)
+ {
+ break;
+ }
+ /* fall through */
+ default:
+ return SetFromWindowsErr(err);
+ }
+
+ switch (self->type) {
+ case TYPE_READ:
+ assert(PyBytes_CheckExact(self->allocated_buffer));
+ if (transferred != PyBytes_GET_SIZE(self->allocated_buffer) &&
+ _PyBytes_Resize(&self->allocated_buffer, transferred))
+ return NULL;
+
+ return Py_NewRef(self->allocated_buffer);
+ case TYPE_READ_FROM:
+ assert(PyBytes_CheckExact(self->read_from.allocated_buffer));
+
+ if (transferred != PyBytes_GET_SIZE(
+ self->read_from.allocated_buffer) &&
+ _PyBytes_Resize(&self->read_from.allocated_buffer, transferred))
+ {
+ return NULL;
+ }
+
+ // unparse the address
+ addr = unparse_address((SOCKADDR*)&self->read_from.address,
+ self->read_from.address_length);
+
+ if (addr == NULL) {
+ return NULL;
+ }
+
+ // The result is a two item tuple: (message, address)
+ self->read_from.result = PyTuple_New(2);
+ if (self->read_from.result == NULL) {
+ Py_CLEAR(addr);
+ return NULL;
+ }
+
+ // first item: message
+ PyTuple_SET_ITEM(self->read_from.result, 0,
+ Py_NewRef(self->read_from.allocated_buffer));
+ // second item: address
+ PyTuple_SET_ITEM(self->read_from.result, 1, addr);
+
+ return Py_NewRef(self->read_from.result);
+ case TYPE_READ_FROM_INTO:
+ // unparse the address
+ addr = unparse_address((SOCKADDR*)&self->read_from_into.address,
+ self->read_from_into.address_length);
+
+ if (addr == NULL) {
+ return NULL;
+ }
+
+ // The result is a two item tuple: (number of bytes read, address)
+ self->read_from_into.result = PyTuple_New(2);
+ if (self->read_from_into.result == NULL) {
+ Py_CLEAR(addr);
+ return NULL;
+ }
+
+ // first item: number of bytes read
+ PyTuple_SET_ITEM(self->read_from_into.result, 0,
+ PyLong_FromUnsignedLong((unsigned long)transferred));
+ // second item: address
+ PyTuple_SET_ITEM(self->read_from_into.result, 1, addr);
+
+ return Py_NewRef(self->read_from_into.result);
+ default:
+ return PyLong_FromUnsignedLong((unsigned long) transferred);
+ }
+}
+
+static PyObject *
+do_ReadFile(OverlappedObject *self, HANDLE handle,
+ char *bufstart, DWORD buflen)
+{
+ DWORD nread;
+ int ret;
+ DWORD err;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = ReadFile(handle, bufstart, buflen, &nread,
+ &self->overlapped);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+ switch (err) {
+ case ERROR_BROKEN_PIPE:
+ mark_as_completed(&self->overlapped);
+ return SetFromWindowsErr(err);
+ case ERROR_SUCCESS:
+ case ERROR_MORE_DATA:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.ReadFile
+
+ handle: HANDLE
+ size: DWORD
+ /
+
+Start overlapped read.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_ReadFile_impl(OverlappedObject *self, HANDLE handle,
+ DWORD size)
+/*[clinic end generated code: output=4c8557e16941e4ae input=98c495baa0342425]*/
+{
+ PyObject *buf;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
+ size = Py_MIN(size, (DWORD)PY_SSIZE_T_MAX);
+#endif
+ buf = PyBytes_FromStringAndSize(NULL, Py_MAX(size, 1));
+ if (buf == NULL)
+ return NULL;
+
+ self->type = TYPE_READ;
+ self->handle = handle;
+ self->allocated_buffer = buf;
+
+ return do_ReadFile(self, handle, PyBytes_AS_STRING(buf), size);
+}
+
+/*[clinic input]
+_overlapped.Overlapped.ReadFileInto
+
+ handle: HANDLE
+ buf as bufobj: Py_buffer
+ /
+
+Start overlapped receive.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_ReadFileInto_impl(OverlappedObject *self,
+ HANDLE handle, Py_buffer *bufobj)
+/*[clinic end generated code: output=8754744506023071 input=4f037ba09939e32d]*/
+{
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (bufobj->len > (Py_ssize_t)ULONG_MAX) {
+ PyErr_SetString(PyExc_ValueError, "buffer too large");
+ return NULL;
+ }
+#endif
+ steal_buffer(&self->user_buffer, bufobj);
+
+ self->type = TYPE_READINTO;
+ self->handle = handle;
+
+ return do_ReadFile(self, handle, self->user_buffer.buf,
+ (DWORD)self->user_buffer.len);
+}
+
+static PyObject *
+do_WSARecv(OverlappedObject *self, HANDLE handle,
+ char *bufstart, DWORD buflen, DWORD flags)
+{
+ DWORD nread;
+ WSABUF wsabuf;
+ int ret;
+ DWORD err;
+
+ wsabuf.buf = bufstart;
+ wsabuf.len = buflen;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = WSARecv((SOCKET)handle, &wsabuf, 1, &nread, &flags,
+ &self->overlapped, NULL);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = (ret < 0 ? WSAGetLastError() : ERROR_SUCCESS);
+ switch (err) {
+ case ERROR_BROKEN_PIPE:
+ mark_as_completed(&self->overlapped);
+ return SetFromWindowsErr(err);
+ case ERROR_SUCCESS:
+ case ERROR_MORE_DATA:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+
+/*[clinic input]
+_overlapped.Overlapped.WSARecv
+
+ handle: HANDLE
+ size: DWORD
+ flags: DWORD = 0
+ /
+
+Start overlapped receive.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WSARecv_impl(OverlappedObject *self, HANDLE handle,
+ DWORD size, DWORD flags)
+/*[clinic end generated code: output=3a5e9c61ff040906 input=8c04e506cc3d741a]*/
+{
+ PyObject *buf;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
+ size = Py_MIN(size, (DWORD)PY_SSIZE_T_MAX);
+#endif
+ buf = PyBytes_FromStringAndSize(NULL, Py_MAX(size, 1));
+ if (buf == NULL)
+ return NULL;
+
+ self->type = TYPE_READ;
+ self->handle = handle;
+ self->allocated_buffer = buf;
+
+ return do_WSARecv(self, handle, PyBytes_AS_STRING(buf), size, flags);
+}
+
+/*[clinic input]
+_overlapped.Overlapped.WSARecvInto
+
+ handle: HANDLE
+ buf as bufobj: Py_buffer
+ flags: DWORD
+ /
+
+Start overlapped receive.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WSARecvInto_impl(OverlappedObject *self,
+ HANDLE handle, Py_buffer *bufobj,
+ DWORD flags)
+/*[clinic end generated code: output=59ae7688786cf86b input=73e7fa00db633edd]*/
+{
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (bufobj->len > (Py_ssize_t)ULONG_MAX) {
+ PyErr_SetString(PyExc_ValueError, "buffer too large");
+ return NULL;
+ }
+#endif
+ steal_buffer(&self->user_buffer, bufobj);
+
+ self->type = TYPE_READINTO;
+ self->handle = handle;
+
+ return do_WSARecv(self, handle, self->user_buffer.buf,
+ (DWORD)self->user_buffer.len, flags);
+}
+
+/*[clinic input]
+_overlapped.Overlapped.WriteFile
+
+ handle: HANDLE
+ buf as bufobj: Py_buffer
+ /
+
+Start overlapped write.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WriteFile_impl(OverlappedObject *self, HANDLE handle,
+ Py_buffer *bufobj)
+/*[clinic end generated code: output=fa5d5880a1bf04b1 input=ac54424c362abfc1]*/
+{
+ DWORD written;
+ BOOL ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (bufobj->len > (Py_ssize_t)ULONG_MAX) {
+ PyErr_SetString(PyExc_ValueError, "buffer too large");
+ return NULL;
+ }
+#endif
+ steal_buffer(&self->user_buffer, bufobj);
+
+ self->type = TYPE_WRITE;
+ self->handle = handle;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = WriteFile(handle, self->user_buffer.buf,
+ (DWORD)self->user_buffer.len,
+ &written, &self->overlapped);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.WSASend
+
+ handle: HANDLE
+ buf as bufobj: Py_buffer
+ flags: DWORD
+ /
+
+Start overlapped send.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WSASend_impl(OverlappedObject *self, HANDLE handle,
+ Py_buffer *bufobj, DWORD flags)
+/*[clinic end generated code: output=3baaa6e1f7fe229e input=c4167420ba2f93d8]*/
+{
+ DWORD written;
+ WSABUF wsabuf;
+ int ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (bufobj->len > (Py_ssize_t)ULONG_MAX) {
+ PyErr_SetString(PyExc_ValueError, "buffer too large");
+ return NULL;
+ }
+#endif
+ steal_buffer(&self->user_buffer, bufobj);
+
+ self->type = TYPE_WRITE;
+ self->handle = handle;
+ wsabuf.len = (DWORD)self->user_buffer.len;
+ wsabuf.buf = self->user_buffer.buf;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = WSASend((SOCKET)handle, &wsabuf, 1, &written, flags,
+ &self->overlapped, NULL);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = (ret < 0 ? WSAGetLastError() : ERROR_SUCCESS);
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.AcceptEx
+
+ listen_handle as ListenSocket: HANDLE
+ accept_handle as AcceptSocket: HANDLE
+ /
+
+Start overlapped wait for client to connect.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_AcceptEx_impl(OverlappedObject *self,
+ HANDLE ListenSocket,
+ HANDLE AcceptSocket)
+/*[clinic end generated code: output=9a7381d4232af889 input=b83473224fc3a1c5]*/
+{
+ DWORD BytesReceived;
+ DWORD size;
+ PyObject *buf;
+ BOOL ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+ size = sizeof(struct sockaddr_in6) + 16;
+ buf = PyBytes_FromStringAndSize(NULL, size*2);
+ if (!buf)
+ return NULL;
+
+ self->type = TYPE_ACCEPT;
+ self->handle = ListenSocket;
+ self->allocated_buffer = buf;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = Py_AcceptEx((SOCKET)ListenSocket, (SOCKET)AcceptSocket,
+ PyBytes_AS_STRING(buf), 0, size, size, &BytesReceived,
+ &self->overlapped);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+
+static int
+parse_address(PyObject *obj, SOCKADDR *Address, int Length)
+{
+ PyObject *Host_obj;
+ wchar_t *Host;
+ unsigned short Port;
+ unsigned long FlowInfo;
+ unsigned long ScopeId;
+
+ memset(Address, 0, Length);
+
+ switch (PyTuple_GET_SIZE(obj)) {
+ case 2: {
+ if (!PyArg_ParseTuple(obj, "UH", &Host_obj, &Port)) {
+ return -1;
+ }
+ Host = PyUnicode_AsWideCharString(Host_obj, NULL);
+ if (Host == NULL) {
+ return -1;
+ }
+ Address->sa_family = AF_INET;
+ if (WSAStringToAddressW(Host, AF_INET, NULL, Address, &Length) < 0) {
+ SetFromWindowsErr(WSAGetLastError());
+ Length = -1;
+ }
+ else {
+ ((SOCKADDR_IN*)Address)->sin_port = htons(Port);
+ }
+ PyMem_Free(Host);
+ return Length;
+ }
+ case 4: {
+ if (!PyArg_ParseTuple(obj,
+ "UHkk;ConnectEx(): illegal address_as_bytes argument",
+ &Host_obj, &Port, &FlowInfo, &ScopeId))
+ {
+ return -1;
+ }
+ Host = PyUnicode_AsWideCharString(Host_obj, NULL);
+ if (Host == NULL) {
+ return -1;
+ }
+ Address->sa_family = AF_INET6;
+ if (WSAStringToAddressW(Host, AF_INET6, NULL, Address, &Length) < 0) {
+ SetFromWindowsErr(WSAGetLastError());
+ Length = -1;
+ }
+ else {
+ ((SOCKADDR_IN6*)Address)->sin6_port = htons(Port);
+ ((SOCKADDR_IN6*)Address)->sin6_flowinfo = FlowInfo;
+ ((SOCKADDR_IN6*)Address)->sin6_scope_id = ScopeId;
+ }
+ PyMem_Free(Host);
+ return Length;
+ }
+ default:
+ PyErr_SetString(PyExc_ValueError, "illegal address_as_bytes argument");
+ return -1;
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.ConnectEx
+
+ client_handle as ConnectSocket: HANDLE
+ address_as_bytes as AddressObj: object(subclass_of='&PyTuple_Type')
+ /
+
+Start overlapped connect.
+
+client_handle should be unbound.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_ConnectEx_impl(OverlappedObject *self,
+ HANDLE ConnectSocket,
+ PyObject *AddressObj)
+/*[clinic end generated code: output=5aebbbdb4f022833 input=d6bbd2d84b156fc1]*/
+{
+ char AddressBuf[sizeof(struct sockaddr_in6)];
+ SOCKADDR *Address = (SOCKADDR*)AddressBuf;
+ int Length;
+ BOOL ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+ Length = sizeof(AddressBuf);
+ Length = parse_address(AddressObj, Address, Length);
+ if (Length < 0)
+ return NULL;
+
+ self->type = TYPE_CONNECT;
+ self->handle = ConnectSocket;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = Py_ConnectEx((SOCKET)ConnectSocket, Address, Length,
+ NULL, 0, NULL, &self->overlapped);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.DisconnectEx
+
+ handle as Socket: HANDLE
+ flags: DWORD
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_DisconnectEx_impl(OverlappedObject *self,
+ HANDLE Socket, DWORD flags)
+/*[clinic end generated code: output=8d64ddb8c93c2126 input=680845cdcdf820eb]*/
+{
+ BOOL ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+ self->type = TYPE_DISCONNECT;
+ self->handle = Socket;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = Py_DisconnectEx((SOCKET)Socket, &self->overlapped, flags, 0);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.TransmitFile
+
+ socket as Socket: HANDLE
+ file as File: HANDLE
+ offset: DWORD
+ offset_high: DWORD
+ count_to_write: DWORD
+ count_per_send: DWORD
+ flags: DWORD
+ /
+
+Transmit file data over a connected socket.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_TransmitFile_impl(OverlappedObject *self,
+ HANDLE Socket, HANDLE File,
+ DWORD offset, DWORD offset_high,
+ DWORD count_to_write,
+ DWORD count_per_send, DWORD flags)
+/*[clinic end generated code: output=03f3ca5512e678fd input=7e6f97b391f60e8c]*/
+{
+ BOOL ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+ self->type = TYPE_TRANSMIT_FILE;
+ self->handle = Socket;
+ self->overlapped.Offset = offset;
+ self->overlapped.OffsetHigh = offset_high;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = Py_TransmitFile((SOCKET)Socket, File, count_to_write,
+ count_per_send, &self->overlapped, NULL, flags);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError();
+ switch (err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.ConnectNamedPipe
+
+ handle as Pipe: HANDLE
+ /
+
+Start overlapped wait for a client to connect.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_ConnectNamedPipe_impl(OverlappedObject *self,
+ HANDLE Pipe)
+/*[clinic end generated code: output=3e69adfe55818abe input=8b0d4cef8a72f7bc]*/
+{
+ BOOL ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+ self->type = TYPE_CONNECT_NAMED_PIPE;
+ self->handle = Pipe;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = ConnectNamedPipe(Pipe, &self->overlapped);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+ switch (err) {
+ case ERROR_PIPE_CONNECTED:
+ mark_as_completed(&self->overlapped);
+ Py_RETURN_TRUE;
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_FALSE;
+ default:
+ Overlapped_clear(self);
+ return SetFromWindowsErr(err);
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.ConnectPipe
+
+ addr as Address: Py_UNICODE
+ /
+
+Connect to the pipe for asynchronous I/O (overlapped).
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self,
+ const Py_UNICODE *Address)
+/*[clinic end generated code: output=3cc9661667d459d4 input=167c06a274efcefc]*/
+{
+ HANDLE PipeHandle;
+
+ Py_BEGIN_ALLOW_THREADS
+ PipeHandle = CreateFileW(Address,
+ GENERIC_READ | GENERIC_WRITE,
+ 0, NULL, OPEN_EXISTING,
+ FILE_FLAG_OVERLAPPED, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (PipeHandle == INVALID_HANDLE_VALUE)
+ return SetFromWindowsErr(0);
+ return Py_BuildValue(F_HANDLE, PipeHandle);
+}
+
+static PyObject*
+Overlapped_getaddress(OverlappedObject *self)
+{
+ return PyLong_FromVoidPtr(&self->overlapped);
+}
+
+static PyObject*
+Overlapped_getpending(OverlappedObject *self)
+{
+ return PyBool_FromLong(!HasOverlappedIoCompleted(&self->overlapped) &&
+ self->type != TYPE_NOT_STARTED);
+}
+
+static int
+Overlapped_traverse(OverlappedObject *self, visitproc visit, void *arg)
+{
+ switch (self->type) {
+ case TYPE_READ:
+ case TYPE_ACCEPT:
+ Py_VISIT(self->allocated_buffer);
+ break;
+ case TYPE_WRITE:
+ case TYPE_WRITE_TO:
+ case TYPE_READINTO:
+ if (self->user_buffer.obj) {
+ Py_VISIT(&self->user_buffer.obj);
+ }
+ break;
+ case TYPE_READ_FROM:
+ Py_VISIT(self->read_from.result);
+ Py_VISIT(self->read_from.allocated_buffer);
+ break;
+ case TYPE_READ_FROM_INTO:
+ Py_VISIT(self->read_from_into.result);
+ if (self->read_from_into.user_buffer.obj) {
+ Py_VISIT(&self->read_from_into.user_buffer.obj);
+ }
+ break;
+ }
+ return 0;
+}
+
+// UDP functions
+
+/*
+ * Note: WSAConnect does not support Overlapped I/O so this function should
+ * _only_ be used for connectionless sockets (UDP).
+ */
+
+/*[clinic input]
+_overlapped.WSAConnect
+
+ client_handle as ConnectSocket: HANDLE
+ address_as_bytes as AddressObj: object(subclass_of='&PyTuple_Type')
+ /
+
+Bind a remote address to a connectionless (UDP) socket.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_WSAConnect_impl(PyObject *module, HANDLE ConnectSocket,
+ PyObject *AddressObj)
+/*[clinic end generated code: output=ea0b4391e94dad63 input=7cf65313d49c015a]*/
+{
+ char AddressBuf[sizeof(struct sockaddr_in6)];
+ SOCKADDR *Address = (SOCKADDR*)AddressBuf;
+ int Length;
+ int err;
+
+ Length = sizeof(AddressBuf);
+ Length = parse_address(AddressObj, Address, Length);
+ if (Length < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ // WSAConnect does not support overlapped I/O so this call will
+ // successfully complete immediately.
+ err = WSAConnect((SOCKET)ConnectSocket, Address, Length,
+ NULL, NULL, NULL, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (err == 0) {
+ Py_RETURN_NONE;
+ }
+ else {
+ return SetFromWindowsErr(WSAGetLastError());
+ }
+}
+
+/*[clinic input]
+_overlapped.Overlapped.WSASendTo
+
+ handle: HANDLE
+ buf as bufobj: Py_buffer
+ flags: DWORD
+ address_as_bytes as AddressObj: object(subclass_of='&PyTuple_Type')
+ /
+
+Start overlapped sendto over a connectionless (UDP) socket.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WSASendTo_impl(OverlappedObject *self, HANDLE handle,
+ Py_buffer *bufobj, DWORD flags,
+ PyObject *AddressObj)
+/*[clinic end generated code: output=3cdedc4cfaeb70cd input=31f44cd4ab92fc33]*/
+{
+ char AddressBuf[sizeof(struct sockaddr_in6)];
+ SOCKADDR *Address = (SOCKADDR*)AddressBuf;
+ int AddressLength;
+ DWORD written;
+ WSABUF wsabuf;
+ int ret;
+ DWORD err;
+
+ // Parse the "to" address
+ AddressLength = sizeof(AddressBuf);
+ AddressLength = parse_address(AddressObj, Address, AddressLength);
+ if (AddressLength < 0) {
+ return NULL;
+ }
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (bufobj->len > (Py_ssize_t)ULONG_MAX) {
+ PyErr_SetString(PyExc_ValueError, "buffer too large");
+ return NULL;
+ }
+#endif
+ steal_buffer(&self->user_buffer, bufobj);
+
+ self->type = TYPE_WRITE_TO;
+ self->handle = handle;
+ wsabuf.len = (DWORD)self->user_buffer.len;
+ wsabuf.buf = self->user_buffer.buf;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = WSASendTo((SOCKET)handle, &wsabuf, 1, &written, flags,
+ Address, AddressLength, &self->overlapped, NULL);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = (ret == SOCKET_ERROR ? WSAGetLastError() :
+ ERROR_SUCCESS);
+
+ switch(err) {
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ self->type = TYPE_NOT_STARTED;
+ return SetFromWindowsErr(err);
+ }
+}
+
+
+
+PyDoc_STRVAR(
+ Overlapped_WSARecvFrom_doc,
+ "RecvFile(handle, size, flags) -> Overlapped[(message, (host, port))]\n\n"
+ "Start overlapped receive");
+
+/*[clinic input]
+_overlapped.Overlapped.WSARecvFrom
+
+ handle: HANDLE
+ size: DWORD
+ flags: DWORD = 0
+ /
+
+Start overlapped receive.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WSARecvFrom_impl(OverlappedObject *self,
+ HANDLE handle, DWORD size,
+ DWORD flags)
+/*[clinic end generated code: output=13832a2025b86860 input=1b2663fa130e0286]*/
+{
+ PyObject *buf;
+ DWORD nread;
+ WSABUF wsabuf;
+ int ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T <= SIZEOF_LONG
+ size = Py_MIN(size, (DWORD)PY_SSIZE_T_MAX);
+#endif
+ buf = PyBytes_FromStringAndSize(NULL, Py_MAX(size, 1));
+ if (buf == NULL) {
+ return NULL;
+ }
+
+ wsabuf.buf = PyBytes_AS_STRING(buf);
+ wsabuf.len = size;
+
+ self->type = TYPE_READ_FROM;
+ self->handle = handle;
+ self->read_from.allocated_buffer = buf;
+ memset(&self->read_from.address, 0, sizeof(self->read_from.address));
+ self->read_from.address_length = sizeof(self->read_from.address);
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = WSARecvFrom((SOCKET)handle, &wsabuf, 1, &nread, &flags,
+ (SOCKADDR*)&self->read_from.address,
+ &self->read_from.address_length,
+ &self->overlapped, NULL);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = (ret < 0 ? WSAGetLastError() : ERROR_SUCCESS);
+ switch (err) {
+ case ERROR_BROKEN_PIPE:
+ mark_as_completed(&self->overlapped);
+ return SetFromWindowsErr(err);
+ case ERROR_SUCCESS:
+ case ERROR_MORE_DATA:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ self->type = TYPE_NOT_STARTED;
+ return SetFromWindowsErr(err);
+ }
+}
+
+
+/*[clinic input]
+_overlapped.Overlapped.WSARecvFromInto
+
+ handle: HANDLE
+ buf as bufobj: Py_buffer
+ size: DWORD
+ flags: DWORD = 0
+ /
+
+Start overlapped receive.
+[clinic start generated code]*/
+
+static PyObject *
+_overlapped_Overlapped_WSARecvFromInto_impl(OverlappedObject *self,
+ HANDLE handle, Py_buffer *bufobj,
+ DWORD size, DWORD flags)
+/*[clinic end generated code: output=30c7ea171a691757 input=4be4b08d03531e76]*/
+{
+ DWORD nread;
+ WSABUF wsabuf;
+ int ret;
+ DWORD err;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+#if SIZEOF_SIZE_T > SIZEOF_LONG
+ if (bufobj->len > (Py_ssize_t)ULONG_MAX) {
+ PyErr_SetString(PyExc_ValueError, "buffer too large");
+ return NULL;
+ }
+#endif
+
+ wsabuf.buf = bufobj->buf;
+ wsabuf.len = size;
+
+ self->type = TYPE_READ_FROM_INTO;
+ self->handle = handle;
+ steal_buffer(&self->read_from_into.user_buffer, bufobj);
+ memset(&self->read_from_into.address, 0, sizeof(self->read_from_into.address));
+ self->read_from_into.address_length = sizeof(self->read_from_into.address);
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = WSARecvFrom((SOCKET)handle, &wsabuf, 1, &nread, &flags,
+ (SOCKADDR*)&self->read_from_into.address,
+ &self->read_from_into.address_length,
+ &self->overlapped, NULL);
+ Py_END_ALLOW_THREADS
+
+ self->error = err = (ret < 0 ? WSAGetLastError() : ERROR_SUCCESS);
+ switch (err) {
+ case ERROR_BROKEN_PIPE:
+ mark_as_completed(&self->overlapped);
+ return SetFromWindowsErr(err);
+ case ERROR_SUCCESS:
+ case ERROR_MORE_DATA:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ self->type = TYPE_NOT_STARTED;
+ return SetFromWindowsErr(err);
+ }
+}
+
+
+#include "clinic/overlapped.c.h"
+
+static PyMethodDef Overlapped_methods[] = {
+ _OVERLAPPED_OVERLAPPED_GETRESULT_METHODDEF
+ _OVERLAPPED_OVERLAPPED_CANCEL_METHODDEF
+ _OVERLAPPED_OVERLAPPED_READFILE_METHODDEF
+ _OVERLAPPED_OVERLAPPED_READFILEINTO_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSARECV_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSARECVINTO_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSARECVFROM_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSARECVFROMINTO_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WRITEFILE_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSASEND_METHODDEF
+ _OVERLAPPED_OVERLAPPED_ACCEPTEX_METHODDEF
+ _OVERLAPPED_OVERLAPPED_CONNECTEX_METHODDEF
+ _OVERLAPPED_OVERLAPPED_DISCONNECTEX_METHODDEF
+ _OVERLAPPED_OVERLAPPED_TRANSMITFILE_METHODDEF
+ _OVERLAPPED_OVERLAPPED_CONNECTNAMEDPIPE_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSARECVFROM_METHODDEF
+ _OVERLAPPED_OVERLAPPED_WSASENDTO_METHODDEF
+ {NULL}
+};
+
+static PyMemberDef Overlapped_members[] = {
+ {"error", T_ULONG,
+ offsetof(OverlappedObject, error),
+ READONLY, "Error from last operation"},
+ {"event", T_HANDLE,
+ offsetof(OverlappedObject, overlapped) + offsetof(OVERLAPPED, hEvent),
+ READONLY, "Overlapped event handle"},
+ {NULL}
+};
+
+static PyGetSetDef Overlapped_getsets[] = {
+ {"address", (getter)Overlapped_getaddress, NULL,
+ "Address of overlapped structure"},
+ {"pending", (getter)Overlapped_getpending, NULL,
+ "Whether the operation is pending"},
+ {NULL},
+};
+
+static PyType_Slot overlapped_type_slots[] = {
+ {Py_tp_dealloc, Overlapped_dealloc},
+ {Py_tp_doc, (char *)_overlapped_Overlapped__doc__},
+ {Py_tp_traverse, Overlapped_traverse},
+ {Py_tp_methods, Overlapped_methods},
+ {Py_tp_members, Overlapped_members},
+ {Py_tp_getset, Overlapped_getsets},
+ {Py_tp_new, _overlapped_Overlapped},
+ {0,0}
+};
+
+static PyType_Spec overlapped_type_spec = {
+ .name = "_overlapped.Overlapped",
+ .basicsize = sizeof(OverlappedObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = overlapped_type_slots
+};
+
+static PyMethodDef overlapped_functions[] = {
+ _OVERLAPPED_CREATEIOCOMPLETIONPORT_METHODDEF
+ _OVERLAPPED_GETQUEUEDCOMPLETIONSTATUS_METHODDEF
+ _OVERLAPPED_POSTQUEUEDCOMPLETIONSTATUS_METHODDEF
+ _OVERLAPPED_FORMATMESSAGE_METHODDEF
+ _OVERLAPPED_BINDLOCAL_METHODDEF
+ _OVERLAPPED_REGISTERWAITWITHQUEUE_METHODDEF
+ _OVERLAPPED_UNREGISTERWAIT_METHODDEF
+ _OVERLAPPED_UNREGISTERWAITEX_METHODDEF
+ _OVERLAPPED_CREATEEVENT_METHODDEF
+ _OVERLAPPED_SETEVENT_METHODDEF
+ _OVERLAPPED_RESETEVENT_METHODDEF
+ _OVERLAPPED_OVERLAPPED_CONNECTPIPE_METHODDEF
+ _OVERLAPPED_WSACONNECT_METHODDEF
+ {NULL}
+};
+
+#define WINAPI_CONSTANT(fmt, con) \
+ do { \
+ PyObject *value = Py_BuildValue(fmt, con); \
+ if (value == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddObject(module, #con, value) < 0 ) { \
+ Py_DECREF(value); \
+ return -1; \
+ } \
+ } while (0)
+
+static int
+overlapped_exec(PyObject *module)
+{
+ /* Ensure WSAStartup() called before initializing function pointers */
+ PyObject *socket_module = PyImport_ImportModule("_socket");
+ if (!socket_module) {
+ return -1;
+ }
+
+ Py_DECREF(socket_module);
+
+ if (initialize_function_pointers() < 0) {
+ return -1;
+ }
+
+ PyTypeObject *overlapped_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &overlapped_type_spec, NULL);
+ if (overlapped_type == NULL) {
+ return -1;
+ }
+
+ int rc = PyModule_AddType(module, overlapped_type);
+ Py_DECREF(overlapped_type);
+ if (rc < 0) {
+ return -1;
+ }
+
+ WINAPI_CONSTANT(F_DWORD, ERROR_IO_PENDING);
+ WINAPI_CONSTANT(F_DWORD, ERROR_NETNAME_DELETED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_OPERATION_ABORTED);
+ WINAPI_CONSTANT(F_DWORD, ERROR_SEM_TIMEOUT);
+ WINAPI_CONSTANT(F_DWORD, ERROR_PIPE_BUSY);
+ WINAPI_CONSTANT(F_DWORD, INFINITE);
+ WINAPI_CONSTANT(F_HANDLE, INVALID_HANDLE_VALUE);
+ WINAPI_CONSTANT(F_HANDLE, NULL);
+ WINAPI_CONSTANT(F_DWORD, SO_UPDATE_ACCEPT_CONTEXT);
+ WINAPI_CONSTANT(F_DWORD, SO_UPDATE_CONNECT_CONTEXT);
+ WINAPI_CONSTANT(F_DWORD, TF_REUSE_SOCKET);
+
+ return 0;
+}
+
+static PyModuleDef_Slot overlapped_slots[] = {
+ {Py_mod_exec, overlapped_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef overlapped_module = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = "_overlapped",
+ .m_methods = overlapped_functions,
+ .m_slots = overlapped_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__overlapped(void)
+{
+ return PyModuleDef_Init(&overlapped_module);
+}
diff --git a/contrib/tools/python3/Modules/posixmodule.c b/contrib/tools/python3/Modules/posixmodule.c
new file mode 100644
index 00000000000..c99c69d018b
--- /dev/null
+++ b/contrib/tools/python3/Modules/posixmodule.c
@@ -0,0 +1,17017 @@
+/* POSIX module implementation */
+
+/* This file is also used for Windows NT/MS-Win. In that case the
+ module actually calls itself 'nt', not 'posix', and a few
+ functions are either unimplemented or implemented differently. The source
+ assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent
+ of the compiler used. Different compilers define their own feature
+ test macro, e.g. '_MSC_VER'. */
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+
+#ifdef __VXWORKS__
+# include "pycore_bitutils.h" // _Py_popcount32()
+#endif
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_ceval.h" // _PyEval_ReInitThreads()
+#include "pycore_fileutils.h" // _Py_closerange()
+#include "pycore_import.h" // _PyImport_ReInitLock()
+#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_object.h" // _PyObject_LookupSpecial()
+#include "pycore_pystate.h" // _PyInterpreterState_GET()
+#include "pycore_signal.h" // Py_NSIG
+
+#ifdef MS_WINDOWS
+# include <windows.h>
+# if !defined(MS_WINDOWS_GAMES) || defined(MS_WINDOWS_DESKTOP)
+# include <pathcch.h>
+# endif
+# include <winioctl.h>
+# include <lmcons.h> // UNLEN
+# include "osdefs.h" // SEP
+# if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
+# define HAVE_SYMLINK
+# endif /* MS_WINDOWS_DESKTOP | MS_WINDOWS_SYSTEM */
+#endif
+
+#include "structmember.h" // PyMemberDef
+#ifndef MS_WINDOWS
+# include "posixmodule.h"
+#else
+# include "pycore_fileutils_windows.h"
+# include "winreparse.h"
+#endif
+
+#if !defined(EX_OK) && defined(EXIT_SUCCESS)
+# define EX_OK EXIT_SUCCESS
+#endif
+
+/* On android API level 21, 'AT_EACCESS' is not declared although
+ * HAVE_FACCESSAT is defined. */
+#ifdef __ANDROID__
+# undef HAVE_FACCESSAT
+#endif
+
+#include <stdio.h> // ctermid()
+#include <stdlib.h> // system()
+
+/*
+ * A number of APIs are available on macOS from a certain macOS version.
+ * To support building with a new SDK while deploying to older versions
+ * the availability test is split into two:
+ * - HAVE_<FUNCTION>: The configure check for compile time availability
+ * - HAVE_<FUNCTION>_RUNTIME: Runtime check for availability
+ *
+ * The latter is always true when not on macOS, or when using a compiler
+ * that does not support __has_builtin (older versions of Xcode).
+ *
+ * Due to compiler restrictions there is one valid use of HAVE_<FUNCTION>_RUNTIME:
+ * if (HAVE_<FUNCTION>_RUNTIME) { ... }
+ *
+ * In mixing the test with other tests or using negations will result in compile
+ * errors.
+ */
+#if defined(__APPLE__)
+
+#include <mach/mach.h>
+
+#if defined(__has_builtin)
+#if __has_builtin(__builtin_available)
+#define HAVE_BUILTIN_AVAILABLE 1
+#endif
+#endif
+
+#ifdef HAVE_BUILTIN_AVAILABLE
+# define HAVE_FSTATAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_FACCESSAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_FCHMODAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_FCHOWNAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_LINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_FDOPENDIR_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_MKDIRAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_RENAMEAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_UNLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_OPENAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_READLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_SYMLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *)
+# define HAVE_FUTIMENS_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
+# define HAVE_UTIMENSAT_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
+# define HAVE_PWRITEV_RUNTIME __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
+# define HAVE_MKFIFOAT_RUNTIME __builtin_available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)
+# define HAVE_MKNODAT_RUNTIME __builtin_available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)
+
+# define HAVE_POSIX_SPAWN_SETSID_RUNTIME __builtin_available(macOS 10.15, *)
+
+#else /* Xcode 8 or earlier */
+
+ /* __builtin_available is not present in these compilers, but
+ * some of the symbols might be weak linked (10.10 SDK or later
+ * deploying on 10.9.
+ *
+ * Fall back to the older style of availability checking for
+ * symbols introduced in macOS 10.10.
+ */
+
+# ifdef HAVE_FSTATAT
+# define HAVE_FSTATAT_RUNTIME (fstatat != NULL)
+# endif
+
+# ifdef HAVE_FACCESSAT
+# define HAVE_FACCESSAT_RUNTIME (faccessat != NULL)
+# endif
+
+# ifdef HAVE_FCHMODAT
+# define HAVE_FCHMODAT_RUNTIME (fchmodat != NULL)
+# endif
+
+# ifdef HAVE_FCHOWNAT
+# define HAVE_FCHOWNAT_RUNTIME (fchownat != NULL)
+# endif
+
+# ifdef HAVE_LINKAT
+# define HAVE_LINKAT_RUNTIME (linkat != NULL)
+# endif
+
+# ifdef HAVE_FDOPENDIR
+# define HAVE_FDOPENDIR_RUNTIME (fdopendir != NULL)
+# endif
+
+# ifdef HAVE_MKDIRAT
+# define HAVE_MKDIRAT_RUNTIME (mkdirat != NULL)
+# endif
+
+# ifdef HAVE_RENAMEAT
+# define HAVE_RENAMEAT_RUNTIME (renameat != NULL)
+# endif
+
+# ifdef HAVE_UNLINKAT
+# define HAVE_UNLINKAT_RUNTIME (unlinkat != NULL)
+# endif
+
+# ifdef HAVE_OPENAT
+# define HAVE_OPENAT_RUNTIME (openat != NULL)
+# endif
+
+# ifdef HAVE_READLINKAT
+# define HAVE_READLINKAT_RUNTIME (readlinkat != NULL)
+# endif
+
+# ifdef HAVE_SYMLINKAT
+# define HAVE_SYMLINKAT_RUNTIME (symlinkat != NULL)
+# endif
+
+# ifdef HAVE_UTIMENSAT
+# define HAVE_UTIMENSAT_RUNTIME (utimensat != NULL)
+# endif
+
+# ifdef HAVE_FUTIMENS
+# define HAVE_FUTIMENS_RUNTIME (futimens != NULL)
+# endif
+
+# ifdef HAVE_PWRITEV
+# define HAVE_PWRITEV_RUNTIME (pwritev != NULL)
+# endif
+
+# ifdef HAVE_MKFIFOAT
+# define HAVE_MKFIFOAT_RUNTIME (mkfifoat != NULL)
+# endif
+
+# ifdef HAVE_MKNODAT
+# define HAVE_MKNODAT_RUNTIME (mknodat != NULL)
+# endif
+
+#endif
+
+#ifdef HAVE_FUTIMESAT
+/* Some of the logic for weak linking depends on this assertion */
+# error "HAVE_FUTIMESAT unexpectedly defined"
+#endif
+
+#else
+# define HAVE_FSTATAT_RUNTIME 1
+# define HAVE_FACCESSAT_RUNTIME 1
+# define HAVE_FCHMODAT_RUNTIME 1
+# define HAVE_FCHOWNAT_RUNTIME 1
+# define HAVE_LINKAT_RUNTIME 1
+# define HAVE_FDOPENDIR_RUNTIME 1
+# define HAVE_MKDIRAT_RUNTIME 1
+# define HAVE_RENAMEAT_RUNTIME 1
+# define HAVE_UNLINKAT_RUNTIME 1
+# define HAVE_OPENAT_RUNTIME 1
+# define HAVE_READLINKAT_RUNTIME 1
+# define HAVE_SYMLINKAT_RUNTIME 1
+# define HAVE_FUTIMENS_RUNTIME 1
+# define HAVE_UTIMENSAT_RUNTIME 1
+# define HAVE_PWRITEV_RUNTIME 1
+# define HAVE_MKFIFOAT_RUNTIME 1
+# define HAVE_MKNODAT_RUNTIME 1
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PyDoc_STRVAR(posix__doc__,
+"This module provides access to operating system functionality that is\n\
+standardized by the C Standard and the POSIX standard (a thinly\n\
+disguised Unix interface). Refer to the library manual and\n\
+corresponding Unix manual entries for more information on calls.");
+
+
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+/* Should be included before <sys/sysmacros.h> on HP-UX v3 */
+# include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_SYS_SYSMACROS_H
+/* GNU C Library: major(), minor(), makedev() */
+# include <sys/sysmacros.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h> // WNOHANG
+#endif
+#ifdef HAVE_LINUX_WAIT_H
+# include <linux/wait.h> // P_PIDFD
+#endif
+
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef HAVE_GRP_H
+# include <grp.h>
+#endif
+
+#ifdef HAVE_SYSEXITS_H
+# include <sysexits.h>
+#endif
+
+#ifdef HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+
+#ifdef HAVE_SYS_SENDFILE_H
+# include <sys/sendfile.h>
+#endif
+
+#if defined(__APPLE__)
+# include <copyfile.h>
+#endif
+
+#ifdef HAVE_SCHED_H
+# include <sched.h>
+#endif
+
+#ifdef HAVE_COPY_FILE_RANGE
+# include <unistd.h>
+#endif
+
+#if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY)
+# undef HAVE_SCHED_SETAFFINITY
+#endif
+
+#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LINUX_LIMITS_H) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
+# define USE_XATTRS
+# include <linux/limits.h> // Needed for XATTR_SIZE_MAX on musl libc.
+#endif
+
+#ifdef USE_XATTRS
+# include <sys/xattr.h>
+#endif
+
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+# ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+# endif
+#endif
+
+#ifdef HAVE_DLFCN_H
+# include <dlfcn.h>
+#endif
+
+#ifdef __hpux
+# include <sys/mpctl.h>
+#endif
+
+#if defined(__DragonFly__) || \
+ defined(__OpenBSD__) || \
+ defined(__FreeBSD__) || \
+ defined(__NetBSD__) || \
+ defined(__APPLE__)
+# include <sys/sysctl.h>
+#endif
+
+#ifdef HAVE_LINUX_RANDOM_H
+# include <linux/random.h>
+#endif
+#ifdef HAVE_GETRANDOM_SYSCALL
+# include <sys/syscall.h>
+# include <sys/random.h>
+#endif
+
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+# define TERMSIZE_USE_CONIO
+#elif defined(HAVE_SYS_IOCTL_H)
+# include <sys/ioctl.h>
+# if defined(HAVE_TERMIOS_H)
+# include <termios.h>
+# endif
+# if defined(TIOCGWINSZ)
+# define TERMSIZE_USE_IOCTL
+# endif
+#endif /* HAVE_WINDOWS_CONSOLE_IO */
+
+/* Various compilers have only certain posix functions */
+/* XXX Gosh I wish these were all moved into pyconfig.h */
+#if defined(__WATCOMC__) && !defined(__QNX__) /* Watcom compiler */
+# define HAVE_OPENDIR 1
+# define HAVE_SYSTEM 1
+# include <process.h>
+#elif defined( _MSC_VER)
+ /* Microsoft compiler */
+# if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
+# define HAVE_GETPPID 1
+# endif /* MS_WINDOWS_DESKTOP | MS_WINDOWS_APP | MS_WINDOWS_SYSTEM */
+# if defined(MS_WINDOWS_DESKTOP)
+# define HAVE_GETLOGIN 1
+# endif /* MS_WINDOWS_DESKTOP */
+# if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
+# define HAVE_SPAWNV 1
+# define HAVE_EXECV 1
+# define HAVE_WSPAWNV 1
+# define HAVE_WEXECV 1
+# define HAVE_SYSTEM 1
+# define HAVE_CWAIT 1
+# endif /* MS_WINDOWS_DESKTOP | MS_WINDOWS_SYSTEM */
+# define HAVE_PIPE 1
+# define HAVE_FSYNC 1
+# define fsync _commit
+#endif /* ! __WATCOMC__ || __QNX__ */
+
+/*[clinic input]
+# one of the few times we lie about this name!
+module os
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=94a0f0f978acae17]*/
+
+#ifndef _MSC_VER
+
+#if defined(__sgi)&&_COMPILER_VERSION>=700
+/* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode
+ (default) */
+extern char *ctermid_r(char *);
+#endif
+
+#endif /* !_MSC_VER */
+
+#if defined(__VXWORKS__)
+# error #include <vxCpuLib.h>
+# error #include <rtpLib.h>
+# include <wait.h>
+# error #include <taskLib.h>
+# ifndef _P_WAIT
+# define _P_WAIT 0
+# define _P_NOWAIT 1
+# define _P_NOWAITO 1
+# endif
+#endif /* __VXWORKS__ */
+
+#ifdef HAVE_POSIX_SPAWN
+# include <spawn.h>
+#endif
+
+#ifdef HAVE_UTIME_H
+# include <utime.h>
+#endif /* HAVE_UTIME_H */
+
+#ifdef HAVE_SYS_UTIME_H
+# include <sys/utime.h>
+# define HAVE_UTIME_H /* pretend we do for the rest of this file */
+#endif /* HAVE_SYS_UTIME_H */
+
+#ifdef HAVE_SYS_TIMES_H
+# include <sys/times.h>
+#endif /* HAVE_SYS_TIMES_H */
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif /* HAVE_SYS_PARAM_H */
+
+#ifdef HAVE_SYS_UTSNAME_H
+# include <sys/utsname.h>
+#endif /* HAVE_SYS_UTSNAME_H */
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# if defined(__WATCOMC__) && !defined(__QNX__)
+# include <direct.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+# else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# endif
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
+#ifdef _MSC_VER
+# ifdef HAVE_DIRECT_H
+# include <direct.h>
+# endif
+# ifdef HAVE_IO_H
+# include <io.h>
+# endif
+# ifdef HAVE_PROCESS_H
+# include <process.h>
+# endif
+# include <malloc.h>
+#endif /* _MSC_VER */
+
+#ifndef MAXPATHLEN
+# if defined(PATH_MAX) && PATH_MAX > 1024
+# define MAXPATHLEN PATH_MAX
+# else
+# define MAXPATHLEN 1024
+# endif
+#endif /* MAXPATHLEN */
+
+#ifdef UNION_WAIT
+ /* Emulate some macros on systems that have a union instead of macros */
+# ifndef WIFEXITED
+# define WIFEXITED(u_wait) (!(u_wait).w_termsig && !(u_wait).w_coredump)
+# endif
+# ifndef WEXITSTATUS
+# define WEXITSTATUS(u_wait) (WIFEXITED(u_wait)?((u_wait).w_retcode):-1)
+# endif
+# ifndef WTERMSIG
+# define WTERMSIG(u_wait) ((u_wait).w_termsig)
+# endif
+# define WAIT_TYPE union wait
+# define WAIT_STATUS_INT(s) (s.w_status)
+#else
+ /* !UNION_WAIT */
+# define WAIT_TYPE int
+# define WAIT_STATUS_INT(s) (s)
+#endif /* UNION_WAIT */
+
+/* Don't use the "_r" form if we don't need it (also, won't have a
+ prototype for it, at least on Solaris -- maybe others as well?). */
+#if defined(HAVE_CTERMID_R)
+# define USE_CTERMID_R
+#endif
+
+/* choose the appropriate stat and fstat functions and return structs */
+#undef STAT
+#undef FSTAT
+#undef STRUCT_STAT
+#ifdef MS_WINDOWS
+# define STAT win32_stat
+# define LSTAT win32_lstat
+# define FSTAT _Py_fstat_noraise
+# define STRUCT_STAT struct _Py_stat_struct
+#else
+# define STAT stat
+# define LSTAT lstat
+# define FSTAT fstat
+# define STRUCT_STAT struct stat
+#endif
+
+#if defined(MAJOR_IN_MKDEV)
+# include <sys/mkdev.h>
+#else
+# if defined(MAJOR_IN_SYSMACROS)
+# include <sys/sysmacros.h>
+# endif
+# if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H)
+# include <sys/mkdev.h>
+# endif
+#endif
+
+#ifdef MS_WINDOWS
+# define INITFUNC PyInit_nt
+# define MODNAME "nt"
+# define MODNAME_OBJ &_Py_ID(nt)
+#else
+# define INITFUNC PyInit_posix
+# define MODNAME "posix"
+# define MODNAME_OBJ &_Py_ID(posix)
+#endif
+
+#if defined(__sun)
+/* Something to implement in autoconf, not present in autoconf 2.69 */
+# define HAVE_STRUCT_STAT_ST_FSTYPE 1
+#endif
+
+/* memfd_create is either defined in sys/mman.h or sys/memfd.h
+ * linux/memfd.h defines additional flags
+ */
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#endif
+#ifdef HAVE_SYS_MEMFD_H
+# include <sys/memfd.h>
+#endif
+#ifdef HAVE_LINUX_MEMFD_H
+# include <linux/memfd.h>
+#endif
+
+/* eventfd() */
+#ifdef HAVE_SYS_EVENTFD_H
+# include <sys/eventfd.h>
+#endif
+
+#ifdef _Py_MEMORY_SANITIZER
+# include <sanitizer/msan_interface.h>
+#endif
+
+#ifdef HAVE_FORK
+static void
+run_at_forkers(PyObject *lst, int reverse)
+{
+ Py_ssize_t i;
+ PyObject *cpy;
+
+ if (lst != NULL) {
+ assert(PyList_CheckExact(lst));
+
+ /* Use a list copy in case register_at_fork() is called from
+ * one of the callbacks.
+ */
+ cpy = PyList_GetSlice(lst, 0, PyList_GET_SIZE(lst));
+ if (cpy == NULL)
+ PyErr_WriteUnraisable(lst);
+ else {
+ if (reverse)
+ PyList_Reverse(cpy);
+ for (i = 0; i < PyList_GET_SIZE(cpy); i++) {
+ PyObject *func, *res;
+ func = PyList_GET_ITEM(cpy, i);
+ res = _PyObject_CallNoArgs(func);
+ if (res == NULL)
+ PyErr_WriteUnraisable(func);
+ else
+ Py_DECREF(res);
+ }
+ Py_DECREF(cpy);
+ }
+ }
+}
+
+void
+PyOS_BeforeFork(void)
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ run_at_forkers(interp->before_forkers, 1);
+
+ _PyImport_AcquireLock(interp);
+}
+
+void
+PyOS_AfterFork_Parent(void)
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (_PyImport_ReleaseLock(interp) <= 0) {
+ Py_FatalError("failed releasing import lock after fork");
+ }
+
+ run_at_forkers(interp->after_forkers_parent, 0);
+}
+
+void
+PyOS_AfterFork_Child(void)
+{
+ PyStatus status;
+ _PyRuntimeState *runtime = &_PyRuntime;
+
+ status = _PyRuntimeState_ReInitThreads(runtime);
+ if (_PyStatus_EXCEPTION(status)) {
+ goto fatal_error;
+ }
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ _Py_EnsureTstateNotNULL(tstate);
+
+#ifdef PY_HAVE_THREAD_NATIVE_ID
+ tstate->native_thread_id = PyThread_get_thread_native_id();
+#endif
+
+ status = _PyEval_ReInitThreads(tstate);
+ if (_PyStatus_EXCEPTION(status)) {
+ goto fatal_error;
+ }
+
+ status = _PyImport_ReInitLock(tstate->interp);
+ if (_PyStatus_EXCEPTION(status)) {
+ goto fatal_error;
+ }
+
+ _PySignal_AfterFork();
+
+ status = _PyInterpreterState_DeleteExceptMain(runtime);
+ if (_PyStatus_EXCEPTION(status)) {
+ goto fatal_error;
+ }
+ assert(_PyThreadState_GET() == tstate);
+
+ status = _PyPerfTrampoline_AfterFork_Child();
+ if (_PyStatus_EXCEPTION(status)) {
+ goto fatal_error;
+ }
+
+ run_at_forkers(tstate->interp->after_forkers_child, 0);
+ return;
+
+fatal_error:
+ Py_ExitStatusException(status);
+}
+
+static int
+register_at_forker(PyObject **lst, PyObject *func)
+{
+ if (func == NULL) /* nothing to register? do nothing. */
+ return 0;
+ if (*lst == NULL) {
+ *lst = PyList_New(0);
+ if (*lst == NULL)
+ return -1;
+ }
+ return PyList_Append(*lst, func);
+}
+#endif /* HAVE_FORK */
+
+
+/* Legacy wrapper */
+void
+PyOS_AfterFork(void)
+{
+#ifdef HAVE_FORK
+ PyOS_AfterFork_Child();
+#endif
+}
+
+
+#ifdef MS_WINDOWS
+/* defined in fileutils.c */
+void _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
+void _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *, ULONG,
+ FILE_BASIC_INFO *, FILE_ID_INFO *,
+ struct _Py_stat_struct *);
+void _Py_stat_basic_info_to_stat(FILE_STAT_BASIC_INFORMATION *,
+ struct _Py_stat_struct *);
+#endif
+
+
+#ifndef MS_WINDOWS
+PyObject *
+_PyLong_FromUid(uid_t uid)
+{
+ if (uid == (uid_t)-1)
+ return PyLong_FromLong(-1);
+ return PyLong_FromUnsignedLong(uid);
+}
+
+PyObject *
+_PyLong_FromGid(gid_t gid)
+{
+ if (gid == (gid_t)-1)
+ return PyLong_FromLong(-1);
+ return PyLong_FromUnsignedLong(gid);
+}
+
+int
+_Py_Uid_Converter(PyObject *obj, uid_t *p)
+{
+ uid_t uid;
+ PyObject *index;
+ int overflow;
+ long result;
+ unsigned long uresult;
+
+ index = _PyNumber_Index(obj);
+ if (index == NULL) {
+ PyErr_Format(PyExc_TypeError,
+ "uid should be integer, not %.200s",
+ _PyType_Name(Py_TYPE(obj)));
+ return 0;
+ }
+
+ /*
+ * Handling uid_t is complicated for two reasons:
+ * * Although uid_t is (always?) unsigned, it still
+ * accepts -1.
+ * * We don't know its size in advance--it may be
+ * bigger than an int, or it may be smaller than
+ * a long.
+ *
+ * So a bit of defensive programming is in order.
+ * Start with interpreting the value passed
+ * in as a signed long and see if it works.
+ */
+
+ result = PyLong_AsLongAndOverflow(index, &overflow);
+
+ if (!overflow) {
+ uid = (uid_t)result;
+
+ if (result == -1) {
+ if (PyErr_Occurred())
+ goto fail;
+ /* It's a legitimate -1, we're done. */
+ goto success;
+ }
+
+ /* Any other negative number is disallowed. */
+ if (result < 0)
+ goto underflow;
+
+ /* Ensure the value wasn't truncated. */
+ if (sizeof(uid_t) < sizeof(long) &&
+ (long)uid != result)
+ goto underflow;
+ goto success;
+ }
+
+ if (overflow < 0)
+ goto underflow;
+
+ /*
+ * Okay, the value overflowed a signed long. If it
+ * fits in an *unsigned* long, it may still be okay,
+ * as uid_t may be unsigned long on this platform.
+ */
+ uresult = PyLong_AsUnsignedLong(index);
+ if (PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ goto overflow;
+ goto fail;
+ }
+
+ uid = (uid_t)uresult;
+
+ /*
+ * If uid == (uid_t)-1, the user actually passed in ULONG_MAX,
+ * but this value would get interpreted as (uid_t)-1 by chown
+ * and its siblings. That's not what the user meant! So we
+ * throw an overflow exception instead. (We already
+ * handled a real -1 with PyLong_AsLongAndOverflow() above.)
+ */
+ if (uid == (uid_t)-1)
+ goto overflow;
+
+ /* Ensure the value wasn't truncated. */
+ if (sizeof(uid_t) < sizeof(long) &&
+ (unsigned long)uid != uresult)
+ goto overflow;
+ /* fallthrough */
+
+success:
+ Py_DECREF(index);
+ *p = uid;
+ return 1;
+
+underflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "uid is less than minimum");
+ goto fail;
+
+overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "uid is greater than maximum");
+ /* fallthrough */
+
+fail:
+ Py_DECREF(index);
+ return 0;
+}
+
+int
+_Py_Gid_Converter(PyObject *obj, gid_t *p)
+{
+ gid_t gid;
+ PyObject *index;
+ int overflow;
+ long result;
+ unsigned long uresult;
+
+ index = _PyNumber_Index(obj);
+ if (index == NULL) {
+ PyErr_Format(PyExc_TypeError,
+ "gid should be integer, not %.200s",
+ _PyType_Name(Py_TYPE(obj)));
+ return 0;
+ }
+
+ /*
+ * Handling gid_t is complicated for two reasons:
+ * * Although gid_t is (always?) unsigned, it still
+ * accepts -1.
+ * * We don't know its size in advance--it may be
+ * bigger than an int, or it may be smaller than
+ * a long.
+ *
+ * So a bit of defensive programming is in order.
+ * Start with interpreting the value passed
+ * in as a signed long and see if it works.
+ */
+
+ result = PyLong_AsLongAndOverflow(index, &overflow);
+
+ if (!overflow) {
+ gid = (gid_t)result;
+
+ if (result == -1) {
+ if (PyErr_Occurred())
+ goto fail;
+ /* It's a legitimate -1, we're done. */
+ goto success;
+ }
+
+ /* Any other negative number is disallowed. */
+ if (result < 0) {
+ goto underflow;
+ }
+
+ /* Ensure the value wasn't truncated. */
+ if (sizeof(gid_t) < sizeof(long) &&
+ (long)gid != result)
+ goto underflow;
+ goto success;
+ }
+
+ if (overflow < 0)
+ goto underflow;
+
+ /*
+ * Okay, the value overflowed a signed long. If it
+ * fits in an *unsigned* long, it may still be okay,
+ * as gid_t may be unsigned long on this platform.
+ */
+ uresult = PyLong_AsUnsignedLong(index);
+ if (PyErr_Occurred()) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ goto overflow;
+ goto fail;
+ }
+
+ gid = (gid_t)uresult;
+
+ /*
+ * If gid == (gid_t)-1, the user actually passed in ULONG_MAX,
+ * but this value would get interpreted as (gid_t)-1 by chown
+ * and its siblings. That's not what the user meant! So we
+ * throw an overflow exception instead. (We already
+ * handled a real -1 with PyLong_AsLongAndOverflow() above.)
+ */
+ if (gid == (gid_t)-1)
+ goto overflow;
+
+ /* Ensure the value wasn't truncated. */
+ if (sizeof(gid_t) < sizeof(long) &&
+ (unsigned long)gid != uresult)
+ goto overflow;
+ /* fallthrough */
+
+success:
+ Py_DECREF(index);
+ *p = gid;
+ return 1;
+
+underflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "gid is less than minimum");
+ goto fail;
+
+overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "gid is greater than maximum");
+ /* fallthrough */
+
+fail:
+ Py_DECREF(index);
+ return 0;
+}
+#endif /* MS_WINDOWS */
+
+
+#define _PyLong_FromDev PyLong_FromLongLong
+
+
+#if (defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)) || defined(HAVE_DEVICE_MACROS)
+static int
+_Py_Dev_Converter(PyObject *obj, void *p)
+{
+ *((dev_t *)p) = PyLong_AsUnsignedLongLong(obj);
+ if (PyErr_Occurred())
+ return 0;
+ return 1;
+}
+#endif /* (HAVE_MKNOD && HAVE_MAKEDEV) || HAVE_DEVICE_MACROS */
+
+
+#ifdef AT_FDCWD
+/*
+ * Why the (int) cast? Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965);
+ * without the int cast, the value gets interpreted as uint (4291925331),
+ * which doesn't play nicely with all the initializer lines in this file that
+ * look like this:
+ * int dir_fd = DEFAULT_DIR_FD;
+ */
+#define DEFAULT_DIR_FD (int)AT_FDCWD
+#else
+#define DEFAULT_DIR_FD (-100)
+#endif
+
+static int
+_fd_converter(PyObject *o, int *p)
+{
+ int overflow;
+ long long_value;
+
+ PyObject *index = _PyNumber_Index(o);
+ if (index == NULL) {
+ return 0;
+ }
+
+ assert(PyLong_Check(index));
+ long_value = PyLong_AsLongAndOverflow(index, &overflow);
+ Py_DECREF(index);
+ assert(!PyErr_Occurred());
+ if (overflow > 0 || long_value > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "fd is greater than maximum");
+ return 0;
+ }
+ if (overflow < 0 || long_value < INT_MIN) {
+ PyErr_SetString(PyExc_OverflowError,
+ "fd is less than minimum");
+ return 0;
+ }
+
+ *p = (int)long_value;
+ return 1;
+}
+
+static int
+dir_fd_converter(PyObject *o, void *p)
+{
+ if (o == Py_None) {
+ *(int *)p = DEFAULT_DIR_FD;
+ return 1;
+ }
+ else if (PyIndex_Check(o)) {
+ return _fd_converter(o, (int *)p);
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "argument should be integer or None, not %.200s",
+ _PyType_Name(Py_TYPE(o)));
+ return 0;
+ }
+}
+
+typedef struct {
+ PyObject *billion;
+ PyObject *DirEntryType;
+ PyObject *ScandirIteratorType;
+#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
+ PyObject *SchedParamType;
+#endif
+ newfunc statresult_new_orig;
+ PyObject *StatResultType;
+ PyObject *StatVFSResultType;
+ PyObject *TerminalSizeType;
+ PyObject *TimesResultType;
+ PyObject *UnameResultType;
+#if defined(HAVE_WAITID) && !defined(__APPLE__)
+ PyObject *WaitidResultType;
+#endif
+#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
+ PyObject *struct_rusage;
+#endif
+ PyObject *st_mode;
+} _posixstate;
+
+
+static inline _posixstate*
+get_posix_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_posixstate *)state;
+}
+
+/*
+ * A PyArg_ParseTuple "converter" function
+ * that handles filesystem paths in the manner
+ * preferred by the os module.
+ *
+ * path_converter accepts (Unicode) strings and their
+ * subclasses, and bytes and their subclasses. What
+ * it does with the argument depends on the platform:
+ *
+ * * On Windows, if we get a (Unicode) string we
+ * extract the wchar_t * and return it; if we get
+ * bytes we decode to wchar_t * and return that.
+ *
+ * * On all other platforms, strings are encoded
+ * to bytes using PyUnicode_FSConverter, then we
+ * extract the char * from the bytes object and
+ * return that.
+ *
+ * path_converter also optionally accepts signed
+ * integers (representing open file descriptors) instead
+ * of path strings.
+ *
+ * Input fields:
+ * path.nullable
+ * If nonzero, the path is permitted to be None.
+ * path.allow_fd
+ * If nonzero, the path is permitted to be a file handle
+ * (a signed int) instead of a string.
+ * path.function_name
+ * If non-NULL, path_converter will use that as the name
+ * of the function in error messages.
+ * (If path.function_name is NULL it omits the function name.)
+ * path.argument_name
+ * If non-NULL, path_converter will use that as the name
+ * of the parameter in error messages.
+ * (If path.argument_name is NULL it uses "path".)
+ *
+ * Output fields:
+ * path.wide
+ * Points to the path if it was expressed as Unicode
+ * and was not encoded. (Only used on Windows.)
+ * path.narrow
+ * Points to the path if it was expressed as bytes,
+ * or it was Unicode and was encoded to bytes. (On Windows,
+ * is a non-zero integer if the path was expressed as bytes.
+ * The type is deliberately incompatible to prevent misuse.)
+ * path.fd
+ * Contains a file descriptor if path.accept_fd was true
+ * and the caller provided a signed integer instead of any
+ * sort of string.
+ *
+ * WARNING: if your "path" parameter is optional, and is
+ * unspecified, path_converter will never get called.
+ * So if you set allow_fd, you *MUST* initialize path.fd = -1
+ * yourself!
+ * path.length
+ * The length of the path in characters, if specified as
+ * a string.
+ * path.object
+ * The original object passed in (if get a PathLike object,
+ * the result of PyOS_FSPath() is treated as the original object).
+ * Own a reference to the object.
+ * path.cleanup
+ * For internal use only. May point to a temporary object.
+ * (Pay no attention to the man behind the curtain.)
+ *
+ * At most one of path.wide or path.narrow will be non-NULL.
+ * If path was None and path.nullable was set,
+ * or if path was an integer and path.allow_fd was set,
+ * both path.wide and path.narrow will be NULL
+ * and path.length will be 0.
+ *
+ * path_converter takes care to not write to the path_t
+ * unless it's successful. However it must reset the
+ * "cleanup" field each time it's called.
+ *
+ * Use as follows:
+ * path_t path;
+ * memset(&path, 0, sizeof(path));
+ * PyArg_ParseTuple(args, "O&", path_converter, &path);
+ * // ... use values from path ...
+ * path_cleanup(&path);
+ *
+ * (Note that if PyArg_Parse fails you don't need to call
+ * path_cleanup(). However it is safe to do so.)
+ */
+typedef struct {
+ const char *function_name;
+ const char *argument_name;
+ int nullable;
+ int allow_fd;
+ const wchar_t *wide;
+#ifdef MS_WINDOWS
+ BOOL narrow;
+#else
+ const char *narrow;
+#endif
+ int fd;
+ Py_ssize_t length;
+ PyObject *object;
+ PyObject *cleanup;
+} path_t;
+
+#ifdef MS_WINDOWS
+#define PATH_T_INITIALIZE(function_name, argument_name, nullable, allow_fd) \
+ {function_name, argument_name, nullable, allow_fd, NULL, FALSE, -1, 0, NULL, NULL}
+#else
+#define PATH_T_INITIALIZE(function_name, argument_name, nullable, allow_fd) \
+ {function_name, argument_name, nullable, allow_fd, NULL, NULL, -1, 0, NULL, NULL}
+#endif
+
+static void
+path_cleanup(path_t *path)
+{
+ wchar_t *wide = (wchar_t *)path->wide;
+ path->wide = NULL;
+ PyMem_Free(wide);
+ Py_CLEAR(path->object);
+ Py_CLEAR(path->cleanup);
+}
+
+static int
+path_converter(PyObject *o, void *p)
+{
+ path_t *path = (path_t *)p;
+ PyObject *bytes = NULL;
+ Py_ssize_t length = 0;
+ int is_index, is_bytes, is_unicode;
+ const char *narrow;
+#ifdef MS_WINDOWS
+ PyObject *wo = NULL;
+ wchar_t *wide = NULL;
+#endif
+
+#define FORMAT_EXCEPTION(exc, fmt) \
+ PyErr_Format(exc, "%s%s" fmt, \
+ path->function_name ? path->function_name : "", \
+ path->function_name ? ": " : "", \
+ path->argument_name ? path->argument_name : "path")
+
+ /* Py_CLEANUP_SUPPORTED support */
+ if (o == NULL) {
+ path_cleanup(path);
+ return 1;
+ }
+
+ /* Ensure it's always safe to call path_cleanup(). */
+ path->object = path->cleanup = NULL;
+ /* path->object owns a reference to the original object */
+ Py_INCREF(o);
+
+ if ((o == Py_None) && path->nullable) {
+ path->wide = NULL;
+#ifdef MS_WINDOWS
+ path->narrow = FALSE;
+#else
+ path->narrow = NULL;
+#endif
+ path->fd = -1;
+ goto success_exit;
+ }
+
+ /* Only call this here so that we don't treat the return value of
+ os.fspath() as an fd or buffer. */
+ is_index = path->allow_fd && PyIndex_Check(o);
+ is_bytes = PyBytes_Check(o);
+ is_unicode = PyUnicode_Check(o);
+
+ if (!is_index && !is_unicode && !is_bytes) {
+ /* Inline PyOS_FSPath() for better error messages. */
+ PyObject *func, *res;
+
+ func = _PyObject_LookupSpecial(o, &_Py_ID(__fspath__));
+ if (NULL == func) {
+ goto error_format;
+ }
+ res = _PyObject_CallNoArgs(func);
+ Py_DECREF(func);
+ if (NULL == res) {
+ goto error_exit;
+ }
+ else if (PyUnicode_Check(res)) {
+ is_unicode = 1;
+ }
+ else if (PyBytes_Check(res)) {
+ is_bytes = 1;
+ }
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "expected %.200s.__fspath__() to return str or bytes, "
+ "not %.200s", _PyType_Name(Py_TYPE(o)),
+ _PyType_Name(Py_TYPE(res)));
+ Py_DECREF(res);
+ goto error_exit;
+ }
+
+ /* still owns a reference to the original object */
+ Py_SETREF(o, res);
+ }
+
+ if (is_unicode) {
+#ifdef MS_WINDOWS
+ wide = PyUnicode_AsWideCharString(o, &length);
+ if (!wide) {
+ goto error_exit;
+ }
+ if (length > 32767) {
+ FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
+ goto error_exit;
+ }
+ if (wcslen(wide) != length) {
+ FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
+ goto error_exit;
+ }
+
+ path->wide = wide;
+ path->narrow = FALSE;
+ path->fd = -1;
+ wide = NULL;
+ goto success_exit;
+#else
+ if (!PyUnicode_FSConverter(o, &bytes)) {
+ goto error_exit;
+ }
+#endif
+ }
+ else if (is_bytes) {
+ bytes = Py_NewRef(o);
+ }
+ else if (is_index) {
+ if (!_fd_converter(o, &path->fd)) {
+ goto error_exit;
+ }
+ path->wide = NULL;
+#ifdef MS_WINDOWS
+ path->narrow = FALSE;
+#else
+ path->narrow = NULL;
+#endif
+ goto success_exit;
+ }
+ else {
+ error_format:
+ PyErr_Format(PyExc_TypeError, "%s%s%s should be %s, not %.200s",
+ path->function_name ? path->function_name : "",
+ path->function_name ? ": " : "",
+ path->argument_name ? path->argument_name : "path",
+ path->allow_fd && path->nullable ? "string, bytes, os.PathLike, "
+ "integer or None" :
+ path->allow_fd ? "string, bytes, os.PathLike or integer" :
+ path->nullable ? "string, bytes, os.PathLike or None" :
+ "string, bytes or os.PathLike",
+ _PyType_Name(Py_TYPE(o)));
+ goto error_exit;
+ }
+
+ length = PyBytes_GET_SIZE(bytes);
+ narrow = PyBytes_AS_STRING(bytes);
+ if ((size_t)length != strlen(narrow)) {
+ FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
+ goto error_exit;
+ }
+
+#ifdef MS_WINDOWS
+ wo = PyUnicode_DecodeFSDefaultAndSize(
+ narrow,
+ length
+ );
+ if (!wo) {
+ goto error_exit;
+ }
+
+ wide = PyUnicode_AsWideCharString(wo, &length);
+ Py_DECREF(wo);
+ if (!wide) {
+ goto error_exit;
+ }
+ if (length > 32767) {
+ FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows");
+ goto error_exit;
+ }
+ if (wcslen(wide) != length) {
+ FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
+ goto error_exit;
+ }
+ path->wide = wide;
+ path->narrow = TRUE;
+ Py_DECREF(bytes);
+ wide = NULL;
+#else
+ path->wide = NULL;
+ path->narrow = narrow;
+ if (bytes == o) {
+ /* Still a reference owned by path->object, don't have to
+ worry about path->narrow is used after free. */
+ Py_DECREF(bytes);
+ }
+ else {
+ path->cleanup = bytes;
+ }
+#endif
+ path->fd = -1;
+
+ success_exit:
+ path->length = length;
+ path->object = o;
+ return Py_CLEANUP_SUPPORTED;
+
+ error_exit:
+ Py_XDECREF(o);
+ Py_XDECREF(bytes);
+#ifdef MS_WINDOWS
+ PyMem_Free(wide);
+#endif
+ return 0;
+}
+
+static void
+argument_unavailable_error(const char *function_name, const char *argument_name)
+{
+ PyErr_Format(PyExc_NotImplementedError,
+ "%s%s%s unavailable on this platform",
+ (function_name != NULL) ? function_name : "",
+ (function_name != NULL) ? ": ": "",
+ argument_name);
+}
+
+static int
+dir_fd_unavailable(PyObject *o, void *p)
+{
+ int dir_fd;
+ if (!dir_fd_converter(o, &dir_fd))
+ return 0;
+ if (dir_fd != DEFAULT_DIR_FD) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return 0;
+ }
+ *(int *)p = dir_fd;
+ return 1;
+}
+
+static int
+fd_specified(const char *function_name, int fd)
+{
+ if (fd == -1)
+ return 0;
+
+ argument_unavailable_error(function_name, "fd");
+ return 1;
+}
+
+static int
+follow_symlinks_specified(const char *function_name, int follow_symlinks)
+{
+ if (follow_symlinks)
+ return 0;
+
+ argument_unavailable_error(function_name, "follow_symlinks");
+ return 1;
+}
+
+static int
+path_and_dir_fd_invalid(const char *function_name, path_t *path, int dir_fd)
+{
+ if (!path->wide && (dir_fd != DEFAULT_DIR_FD)
+#ifndef MS_WINDOWS
+ && !path->narrow
+#endif
+ ) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: can't specify dir_fd without matching path",
+ function_name);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+dir_fd_and_fd_invalid(const char *function_name, int dir_fd, int fd)
+{
+ if ((dir_fd != DEFAULT_DIR_FD) && (fd != -1)) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: can't specify both dir_fd and fd",
+ function_name);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+fd_and_follow_symlinks_invalid(const char *function_name, int fd,
+ int follow_symlinks)
+{
+ if ((fd > 0) && (!follow_symlinks)) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: cannot use fd and follow_symlinks together",
+ function_name);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+dir_fd_and_follow_symlinks_invalid(const char *function_name, int dir_fd,
+ int follow_symlinks)
+{
+ if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: cannot use dir_fd and follow_symlinks together",
+ function_name);
+ return 1;
+ }
+ return 0;
+}
+
+#ifdef MS_WINDOWS
+ typedef long long Py_off_t;
+#else
+ typedef off_t Py_off_t;
+#endif
+
+static int
+Py_off_t_converter(PyObject *arg, void *addr)
+{
+#ifdef HAVE_LARGEFILE_SUPPORT
+ *((Py_off_t *)addr) = PyLong_AsLongLong(arg);
+#else
+ *((Py_off_t *)addr) = PyLong_AsLong(arg);
+#endif
+ if (PyErr_Occurred())
+ return 0;
+ return 1;
+}
+
+static PyObject *
+PyLong_FromPy_off_t(Py_off_t offset)
+{
+#ifdef HAVE_LARGEFILE_SUPPORT
+ return PyLong_FromLongLong(offset);
+#else
+ return PyLong_FromLong(offset);
+#endif
+}
+
+#ifdef HAVE_SIGSET_T
+/* Convert an iterable of integers to a sigset.
+ Return 1 on success, return 0 and raise an exception on error. */
+int
+_Py_Sigset_Converter(PyObject *obj, void *addr)
+{
+ sigset_t *mask = (sigset_t *)addr;
+ PyObject *iterator, *item;
+ long signum;
+ int overflow;
+
+ // The extra parens suppress the unreachable-code warning with clang on MacOS
+ if (sigemptyset(mask) < (0)) {
+ /* Probably only if mask == NULL. */
+ PyErr_SetFromErrno(PyExc_OSError);
+ return 0;
+ }
+
+ iterator = PyObject_GetIter(obj);
+ if (iterator == NULL) {
+ return 0;
+ }
+
+ while ((item = PyIter_Next(iterator)) != NULL) {
+ signum = PyLong_AsLongAndOverflow(item, &overflow);
+ Py_DECREF(item);
+ if (signum <= 0 || signum >= Py_NSIG) {
+ if (overflow || signum != -1 || !PyErr_Occurred()) {
+ PyErr_Format(PyExc_ValueError,
+ "signal number %ld out of range [1; %i]",
+ signum, Py_NSIG - 1);
+ }
+ goto error;
+ }
+ if (sigaddset(mask, (int)signum)) {
+ if (errno != EINVAL) {
+ /* Probably impossible */
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto error;
+ }
+ /* For backwards compatibility, allow idioms such as
+ * `range(1, NSIG)` but warn about invalid signal numbers
+ */
+ const char msg[] =
+ "invalid signal number %ld, please use valid_signals()";
+ if (PyErr_WarnFormat(PyExc_RuntimeWarning, 1, msg, signum)) {
+ goto error;
+ }
+ }
+ }
+ if (!PyErr_Occurred()) {
+ Py_DECREF(iterator);
+ return 1;
+ }
+
+error:
+ Py_DECREF(iterator);
+ return 0;
+}
+#endif /* HAVE_SIGSET_T */
+
+/* Return a dictionary corresponding to the POSIX environment table */
+#if defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
+/* On Darwin/MacOSX a shared library or framework has no access to
+** environ directly, we must obtain it with _NSGetEnviron(). See also
+** man environ(7).
+*/
+#include <crt_externs.h>
+#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
+extern char **environ;
+#endif /* !_MSC_VER */
+
+static PyObject *
+convertenviron(void)
+{
+ PyObject *d;
+#ifdef MS_WINDOWS
+ wchar_t **e;
+#else
+ char **e;
+#endif
+
+ d = PyDict_New();
+ if (d == NULL)
+ return NULL;
+#ifdef MS_WINDOWS
+ /* _wenviron must be initialized in this way if the program is started
+ through main() instead of wmain(). */
+ (void)_wgetenv(L"");
+ e = _wenviron;
+#elif defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
+ /* environ is not accessible as an extern in a shared object on OSX; use
+ _NSGetEnviron to resolve it. The value changes if you add environment
+ variables between calls to Py_Initialize, so don't cache the value. */
+ e = *_NSGetEnviron();
+#else
+ e = environ;
+#endif
+ if (e == NULL)
+ return d;
+ for (; *e != NULL; e++) {
+ PyObject *k;
+ PyObject *v;
+#ifdef MS_WINDOWS
+ const wchar_t *p = wcschr(*e, L'=');
+#else
+ const char *p = strchr(*e, '=');
+#endif
+ if (p == NULL)
+ continue;
+#ifdef MS_WINDOWS
+ k = PyUnicode_FromWideChar(*e, (Py_ssize_t)(p-*e));
+#else
+ k = PyBytes_FromStringAndSize(*e, (int)(p-*e));
+#endif
+ if (k == NULL) {
+ Py_DECREF(d);
+ return NULL;
+ }
+#ifdef MS_WINDOWS
+ v = PyUnicode_FromWideChar(p+1, wcslen(p+1));
+#else
+ v = PyBytes_FromStringAndSize(p+1, strlen(p+1));
+#endif
+ if (v == NULL) {
+ Py_DECREF(k);
+ Py_DECREF(d);
+ return NULL;
+ }
+ if (PyDict_SetDefault(d, k, v) == NULL) {
+ Py_DECREF(v);
+ Py_DECREF(k);
+ Py_DECREF(d);
+ return NULL;
+ }
+ Py_DECREF(k);
+ Py_DECREF(v);
+ }
+ return d;
+}
+
+/* Set a POSIX-specific error from errno, and return NULL */
+
+static PyObject *
+posix_error(void)
+{
+ return PyErr_SetFromErrno(PyExc_OSError);
+}
+
+#ifdef MS_WINDOWS
+static PyObject *
+win32_error(const char* function, const char* filename)
+{
+ /* XXX We should pass the function name along in the future.
+ (winreg.c also wants to pass the function name.)
+ This would however require an additional param to the
+ Windows error object, which is non-trivial.
+ */
+ errno = GetLastError();
+ if (filename)
+ return PyErr_SetFromWindowsErrWithFilename(errno, filename);
+ else
+ return PyErr_SetFromWindowsErr(errno);
+}
+
+static PyObject *
+win32_error_object_err(const char* function, PyObject* filename, DWORD err)
+{
+ /* XXX - see win32_error for comments on 'function' */
+ if (filename)
+ return PyErr_SetExcFromWindowsErrWithFilenameObject(
+ PyExc_OSError,
+ err,
+ filename);
+ else
+ return PyErr_SetFromWindowsErr(err);
+}
+
+static PyObject *
+win32_error_object(const char* function, PyObject* filename)
+{
+ errno = GetLastError();
+ return win32_error_object_err(function, filename, errno);
+}
+
+#endif /* MS_WINDOWS */
+
+static PyObject *
+posix_path_object_error(PyObject *path)
+{
+ return PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path);
+}
+
+static PyObject *
+path_object_error(PyObject *path)
+{
+#ifdef MS_WINDOWS
+ return PyErr_SetExcFromWindowsErrWithFilenameObject(
+ PyExc_OSError, 0, path);
+#else
+ return posix_path_object_error(path);
+#endif
+}
+
+static PyObject *
+path_object_error2(PyObject *path, PyObject *path2)
+{
+#ifdef MS_WINDOWS
+ return PyErr_SetExcFromWindowsErrWithFilenameObjects(
+ PyExc_OSError, 0, path, path2);
+#else
+ return PyErr_SetFromErrnoWithFilenameObjects(PyExc_OSError, path, path2);
+#endif
+}
+
+static PyObject *
+path_error(path_t *path)
+{
+ return path_object_error(path->object);
+}
+
+static PyObject *
+posix_path_error(path_t *path)
+{
+ return posix_path_object_error(path->object);
+}
+
+static PyObject *
+path_error2(path_t *path, path_t *path2)
+{
+ return path_object_error2(path->object, path2->object);
+}
+
+
+/* POSIX generic methods */
+
+static PyObject *
+posix_fildes_fd(int fd, int (*func)(int))
+{
+ int res;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ res = (*func)(fd);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res != 0)
+ return (!async_err) ? posix_error() : NULL;
+ Py_RETURN_NONE;
+}
+
+
+#ifdef MS_WINDOWS
+/* This is a reimplementation of the C library's chdir function,
+ but one that produces Win32 errors instead of DOS error codes.
+ chdir is essentially a wrapper around SetCurrentDirectory; however,
+ it also needs to set "magic" environment variables indicating
+ the per-drive current directory, which are of the form =<drive>: */
+static BOOL __stdcall
+win32_wchdir(LPCWSTR path)
+{
+ wchar_t path_buf[MAX_PATH], *new_path = path_buf;
+ int result;
+ wchar_t env[4] = L"=x:";
+
+ if(!SetCurrentDirectoryW(path))
+ return FALSE;
+ result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(path_buf), new_path);
+ if (!result)
+ return FALSE;
+ if (result > Py_ARRAY_LENGTH(path_buf)) {
+ new_path = PyMem_RawMalloc(result * sizeof(wchar_t));
+ if (!new_path) {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+ result = GetCurrentDirectoryW(result, new_path);
+ if (!result) {
+ PyMem_RawFree(new_path);
+ return FALSE;
+ }
+ }
+ int is_unc_like_path = (wcsncmp(new_path, L"\\\\", 2) == 0 ||
+ wcsncmp(new_path, L"//", 2) == 0);
+ if (!is_unc_like_path) {
+ env[1] = new_path[0];
+ result = SetEnvironmentVariableW(env, new_path);
+ }
+ if (new_path != path_buf)
+ PyMem_RawFree(new_path);
+ return result ? TRUE : FALSE;
+}
+#endif
+
+#ifdef MS_WINDOWS
+/* The CRT of Windows has a number of flaws wrt. its stat() implementation:
+ - time stamps are restricted to second resolution
+ - file modification times suffer from forth-and-back conversions between
+ UTC and local time
+ Therefore, we implement our own stat, based on the Win32 API directly.
+*/
+#define HAVE_STAT_NSEC 1
+#define HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES 1
+#define HAVE_STRUCT_STAT_ST_REPARSE_TAG 1
+
+static void
+find_data_to_file_info(WIN32_FIND_DATAW *pFileData,
+ BY_HANDLE_FILE_INFORMATION *info,
+ ULONG *reparse_tag)
+{
+ memset(info, 0, sizeof(*info));
+ info->dwFileAttributes = pFileData->dwFileAttributes;
+ info->ftCreationTime = pFileData->ftCreationTime;
+ info->ftLastAccessTime = pFileData->ftLastAccessTime;
+ info->ftLastWriteTime = pFileData->ftLastWriteTime;
+ info->nFileSizeHigh = pFileData->nFileSizeHigh;
+ info->nFileSizeLow = pFileData->nFileSizeLow;
+/* info->nNumberOfLinks = 1; */
+ if (pFileData->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ *reparse_tag = pFileData->dwReserved0;
+ else
+ *reparse_tag = 0;
+}
+
+static BOOL
+attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *reparse_tag)
+{
+ HANDLE hFindFile;
+ WIN32_FIND_DATAW FileData;
+ LPCWSTR filename = pszFile;
+ size_t n = wcslen(pszFile);
+ if (n && (pszFile[n - 1] == L'\\' || pszFile[n - 1] == L'/')) {
+ // cannot use PyMem_Malloc here because we do not hold the GIL
+ filename = (LPCWSTR)malloc((n + 1) * sizeof(filename[0]));
+ if(!filename) {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+ wcsncpy_s((LPWSTR)filename, n + 1, pszFile, n);
+ while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) {
+ ((LPWSTR)filename)[n] = L'\0';
+ }
+ if (!n || (n == 1 && filename[1] == L':')) {
+ // Nothing left to query
+ free((void *)filename);
+ return FALSE;
+ }
+ }
+ hFindFile = FindFirstFileW(filename, &FileData);
+ if (pszFile != filename) {
+ free((void *)filename);
+ }
+ if (hFindFile == INVALID_HANDLE_VALUE) {
+ return FALSE;
+ }
+ FindClose(hFindFile);
+ find_data_to_file_info(&FileData, info, reparse_tag);
+ return TRUE;
+}
+
+
+static void
+update_st_mode_from_path(const wchar_t *path, DWORD attr,
+ struct _Py_stat_struct *result)
+{
+ if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) {
+ /* Fix the file execute permissions. This hack sets S_IEXEC if
+ the filename has an extension that is commonly used by files
+ that CreateProcessW can execute. A real implementation calls
+ GetSecurityInfo, OpenThreadToken/OpenProcessToken, and
+ AccessCheck to check for generic read, write, and execute
+ access. */
+ const wchar_t *fileExtension = wcsrchr(path, '.');
+ if (fileExtension) {
+ if (_wcsicmp(fileExtension, L".exe") == 0 ||
+ _wcsicmp(fileExtension, L".bat") == 0 ||
+ _wcsicmp(fileExtension, L".cmd") == 0 ||
+ _wcsicmp(fileExtension, L".com") == 0) {
+ result->st_mode |= 0111;
+ }
+ }
+ }
+}
+
+
+static int
+win32_xstat_slow_impl(const wchar_t *path, struct _Py_stat_struct *result,
+ BOOL traverse)
+{
+ HANDLE hFile;
+ BY_HANDLE_FILE_INFORMATION fileInfo;
+ FILE_BASIC_INFO basicInfo;
+ FILE_BASIC_INFO *pBasicInfo = NULL;
+ FILE_ID_INFO idInfo;
+ FILE_ID_INFO *pIdInfo = NULL;
+ FILE_ATTRIBUTE_TAG_INFO tagInfo = { 0 };
+ DWORD fileType, error;
+ BOOL isUnhandledTag = FALSE;
+ int retval = 0;
+
+ DWORD access = FILE_READ_ATTRIBUTES;
+ DWORD flags = FILE_FLAG_BACKUP_SEMANTICS; /* Allow opening directories. */
+ if (!traverse) {
+ flags |= FILE_FLAG_OPEN_REPARSE_POINT;
+ }
+
+ hFile = CreateFileW(path, access, 0, NULL, OPEN_EXISTING, flags, NULL);
+ if (hFile == INVALID_HANDLE_VALUE) {
+ /* Either the path doesn't exist, or the caller lacks access. */
+ error = GetLastError();
+ switch (error) {
+ case ERROR_ACCESS_DENIED: /* Cannot sync or read attributes. */
+ case ERROR_SHARING_VIOLATION: /* It's a paging file. */
+ /* Try reading the parent directory. */
+ if (!attributes_from_dir(path, &fileInfo, &tagInfo.ReparseTag)) {
+ /* Cannot read the parent directory. */
+ switch (GetLastError()) {
+ case ERROR_FILE_NOT_FOUND: /* File cannot be found */
+ case ERROR_PATH_NOT_FOUND: /* File parent directory cannot be found */
+ case ERROR_NOT_READY: /* Drive exists but unavailable */
+ case ERROR_BAD_NET_NAME: /* Remote drive unavailable */
+ break;
+ /* Restore the error from CreateFileW(). */
+ default:
+ SetLastError(error);
+ }
+
+ return -1;
+ }
+ if (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (traverse ||
+ !IsReparseTagNameSurrogate(tagInfo.ReparseTag)) {
+ /* The stat call has to traverse but cannot, so fail. */
+ SetLastError(error);
+ return -1;
+ }
+ }
+ break;
+
+ case ERROR_INVALID_PARAMETER:
+ /* \\.\con requires read or write access. */
+ hFile = CreateFileW(path, access | GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+ OPEN_EXISTING, flags, NULL);
+ if (hFile == INVALID_HANDLE_VALUE) {
+ SetLastError(error);
+ return -1;
+ }
+ break;
+
+ case ERROR_CANT_ACCESS_FILE:
+ /* bpo37834: open unhandled reparse points if traverse fails. */
+ if (traverse) {
+ traverse = FALSE;
+ isUnhandledTag = TRUE;
+ hFile = CreateFileW(path, access, 0, NULL, OPEN_EXISTING,
+ flags | FILE_FLAG_OPEN_REPARSE_POINT, NULL);
+ }
+ if (hFile == INVALID_HANDLE_VALUE) {
+ SetLastError(error);
+ return -1;
+ }
+ break;
+
+ default:
+ return -1;
+ }
+ }
+
+ if (hFile != INVALID_HANDLE_VALUE) {
+ /* Handle types other than files on disk. */
+ fileType = GetFileType(hFile);
+ if (fileType != FILE_TYPE_DISK) {
+ if (fileType == FILE_TYPE_UNKNOWN && GetLastError() != 0) {
+ retval = -1;
+ goto cleanup;
+ }
+ DWORD fileAttributes = GetFileAttributesW(path);
+ memset(result, 0, sizeof(*result));
+ if (fileAttributes != INVALID_FILE_ATTRIBUTES &&
+ fileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ /* \\.\pipe\ or \\.\mailslot\ */
+ result->st_mode = _S_IFDIR;
+ } else if (fileType == FILE_TYPE_CHAR) {
+ /* \\.\nul */
+ result->st_mode = _S_IFCHR;
+ } else if (fileType == FILE_TYPE_PIPE) {
+ /* \\.\pipe\spam */
+ result->st_mode = _S_IFIFO;
+ }
+ /* FILE_TYPE_UNKNOWN, e.g. \\.\mailslot\waitfor.exe\spam */
+ goto cleanup;
+ }
+
+ /* Query the reparse tag, and traverse a non-link. */
+ if (!traverse) {
+ if (!GetFileInformationByHandleEx(hFile, FileAttributeTagInfo,
+ &tagInfo, sizeof(tagInfo))) {
+ /* Allow devices that do not support FileAttributeTagInfo. */
+ switch (GetLastError()) {
+ case ERROR_INVALID_PARAMETER:
+ case ERROR_INVALID_FUNCTION:
+ case ERROR_NOT_SUPPORTED:
+ tagInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL;
+ tagInfo.ReparseTag = 0;
+ break;
+ default:
+ retval = -1;
+ goto cleanup;
+ }
+ } else if (tagInfo.FileAttributes &
+ FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (IsReparseTagNameSurrogate(tagInfo.ReparseTag)) {
+ if (isUnhandledTag) {
+ /* Traversing previously failed for either this link
+ or its target. */
+ SetLastError(ERROR_CANT_ACCESS_FILE);
+ retval = -1;
+ goto cleanup;
+ }
+ /* Traverse a non-link, but not if traversing already failed
+ for an unhandled tag. */
+ } else if (!isUnhandledTag) {
+ CloseHandle(hFile);
+ return win32_xstat_slow_impl(path, result, TRUE);
+ }
+ }
+ }
+
+ if (!GetFileInformationByHandle(hFile, &fileInfo) ||
+ !GetFileInformationByHandleEx(hFile, FileBasicInfo,
+ &basicInfo, sizeof(basicInfo))) {
+ switch (GetLastError()) {
+ case ERROR_INVALID_PARAMETER:
+ case ERROR_INVALID_FUNCTION:
+ case ERROR_NOT_SUPPORTED:
+ /* Volumes and physical disks are block devices, e.g.
+ \\.\C: and \\.\PhysicalDrive0. */
+ memset(result, 0, sizeof(*result));
+ result->st_mode = 0x6000; /* S_IFBLK */
+ goto cleanup;
+ }
+ retval = -1;
+ goto cleanup;
+ }
+
+ /* Successfully got FileBasicInfo, so we'll pass it along */
+ pBasicInfo = &basicInfo;
+
+ if (GetFileInformationByHandleEx(hFile, FileIdInfo, &idInfo, sizeof(idInfo))) {
+ /* Successfully got FileIdInfo, so pass it along */
+ pIdInfo = &idInfo;
+ }
+ }
+
+ _Py_attribute_data_to_stat(&fileInfo, tagInfo.ReparseTag, pBasicInfo, pIdInfo, result);
+ update_st_mode_from_path(path, fileInfo.dwFileAttributes, result);
+
+cleanup:
+ if (hFile != INVALID_HANDLE_VALUE) {
+ /* Preserve last error if we are failing */
+ error = retval ? GetLastError() : 0;
+ if (!CloseHandle(hFile)) {
+ retval = -1;
+ } else if (retval) {
+ /* Restore last error */
+ SetLastError(error);
+ }
+ }
+
+ return retval;
+}
+
+static int
+win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result,
+ BOOL traverse)
+{
+ FILE_STAT_BASIC_INFORMATION statInfo;
+ if (_Py_GetFileInformationByName(path, FileStatBasicByNameInfo,
+ &statInfo, sizeof(statInfo))) {
+ if (// Cannot use fast path for reparse points ...
+ !(statInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ // ... unless it's a name surrogate (symlink) and we're not following
+ || (!traverse && IsReparseTagNameSurrogate(statInfo.ReparseTag))
+ ) {
+ _Py_stat_basic_info_to_stat(&statInfo, result);
+ update_st_mode_from_path(path, statInfo.FileAttributes, result);
+ return 0;
+ }
+ } else {
+ switch(GetLastError()) {
+ case ERROR_FILE_NOT_FOUND:
+ case ERROR_PATH_NOT_FOUND:
+ case ERROR_NOT_READY:
+ case ERROR_BAD_NET_NAME:
+ /* These errors aren't worth retrying with the slow path */
+ return -1;
+ case ERROR_NOT_SUPPORTED:
+ /* indicates the API couldn't be loaded */
+ break;
+ }
+ }
+
+ return win32_xstat_slow_impl(path, result, traverse);
+}
+
+static int
+win32_xstat(const wchar_t *path, struct _Py_stat_struct *result, BOOL traverse)
+{
+ /* Protocol violation: we explicitly clear errno, instead of
+ setting it to a POSIX error. Callers should use GetLastError. */
+ int code = win32_xstat_impl(path, result, traverse);
+ errno = 0;
+
+ /* ctime is only deprecated from 3.12, so we copy birthtime across */
+ result->st_ctime = result->st_birthtime;
+ result->st_ctime_nsec = result->st_birthtime_nsec;
+ return code;
+}
+/* About the following functions: win32_lstat_w, win32_stat, win32_stat_w
+
+ In Posix, stat automatically traverses symlinks and returns the stat
+ structure for the target. In Windows, the equivalent GetFileAttributes by
+ default does not traverse symlinks and instead returns attributes for
+ the symlink.
+
+ Instead, we will open the file (which *does* traverse symlinks by default)
+ and GetFileInformationByHandle(). */
+
+static int
+win32_lstat(const wchar_t* path, struct _Py_stat_struct *result)
+{
+ return win32_xstat(path, result, FALSE);
+}
+
+static int
+win32_stat(const wchar_t* path, struct _Py_stat_struct *result)
+{
+ return win32_xstat(path, result, TRUE);
+}
+
+#endif /* MS_WINDOWS */
+
+PyDoc_STRVAR(stat_result__doc__,
+"stat_result: Result from stat, fstat, or lstat.\n\n\
+This object may be accessed either as a tuple of\n\
+ (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)\n\
+or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on.\n\
+\n\
+Posix/windows: If your platform supports st_blksize, st_blocks, st_rdev,\n\
+or st_flags, they are available as attributes only.\n\
+\n\
+See os.stat for more information.");
+
+static PyStructSequence_Field stat_result_fields[] = {
+ {"st_mode", "protection bits"},
+ {"st_ino", "inode"},
+ {"st_dev", "device"},
+ {"st_nlink", "number of hard links"},
+ {"st_uid", "user ID of owner"},
+ {"st_gid", "group ID of owner"},
+ {"st_size", "total size, in bytes"},
+ /* The NULL is replaced with PyStructSequence_UnnamedField later. */
+ {NULL, "integer time of last access"},
+ {NULL, "integer time of last modification"},
+ {NULL, "integer time of last change"},
+ {"st_atime", "time of last access"},
+ {"st_mtime", "time of last modification"},
+ {"st_ctime", "time of last change"},
+ {"st_atime_ns", "time of last access in nanoseconds"},
+ {"st_mtime_ns", "time of last modification in nanoseconds"},
+ {"st_ctime_ns", "time of last change in nanoseconds"},
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ {"st_blksize", "blocksize for filesystem I/O"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+ {"st_blocks", "number of blocks allocated"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+ {"st_rdev", "device type (if inode device)"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_FLAGS
+ {"st_flags", "user defined flags for file"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_GEN
+ {"st_gen", "generation number"},
+#endif
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME) || defined(MS_WINDOWS)
+ {"st_birthtime", "time of creation"},
+#endif
+#ifdef MS_WINDOWS
+ {"st_birthtime_ns", "time of creation in nanoseconds"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES
+ {"st_file_attributes", "Windows file attribute bits"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
+ {"st_fstype", "Type of filesystem"},
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG
+ {"st_reparse_tag", "Windows reparse tag"},
+#endif
+ {0}
+};
+
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+#define ST_BLKSIZE_IDX 16
+#else
+#define ST_BLKSIZE_IDX 15
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+#define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1)
+#else
+#define ST_BLOCKS_IDX ST_BLKSIZE_IDX
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+#define ST_RDEV_IDX (ST_BLOCKS_IDX+1)
+#else
+#define ST_RDEV_IDX ST_BLOCKS_IDX
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_FLAGS
+#define ST_FLAGS_IDX (ST_RDEV_IDX+1)
+#else
+#define ST_FLAGS_IDX ST_RDEV_IDX
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_GEN
+#define ST_GEN_IDX (ST_FLAGS_IDX+1)
+#else
+#define ST_GEN_IDX ST_FLAGS_IDX
+#endif
+
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME) || defined(MS_WINDOWS)
+#define ST_BIRTHTIME_IDX (ST_GEN_IDX+1)
+#else
+#define ST_BIRTHTIME_IDX ST_GEN_IDX
+#endif
+
+#ifdef MS_WINDOWS
+#define ST_BIRTHTIME_NS_IDX (ST_BIRTHTIME_IDX+1)
+#else
+#define ST_BIRTHTIME_NS_IDX ST_BIRTHTIME_IDX
+#endif
+
+#if defined(HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES) || defined(MS_WINDOWS)
+#define ST_FILE_ATTRIBUTES_IDX (ST_BIRTHTIME_NS_IDX+1)
+#else
+#define ST_FILE_ATTRIBUTES_IDX ST_BIRTHTIME_NS_IDX
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
+#define ST_FSTYPE_IDX (ST_FILE_ATTRIBUTES_IDX+1)
+#else
+#define ST_FSTYPE_IDX ST_FILE_ATTRIBUTES_IDX
+#endif
+
+#ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG
+#define ST_REPARSE_TAG_IDX (ST_FSTYPE_IDX+1)
+#else
+#define ST_REPARSE_TAG_IDX ST_FSTYPE_IDX
+#endif
+
+static PyStructSequence_Desc stat_result_desc = {
+ "stat_result", /* name */
+ stat_result__doc__, /* doc */
+ stat_result_fields,
+ 10
+};
+
+PyDoc_STRVAR(statvfs_result__doc__,
+"statvfs_result: Result from statvfs or fstatvfs.\n\n\
+This object may be accessed either as a tuple of\n\
+ (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax),\n\
+or via the attributes f_bsize, f_frsize, f_blocks, f_bfree, and so on.\n\
+\n\
+See os.statvfs for more information.");
+
+static PyStructSequence_Field statvfs_result_fields[] = {
+ {"f_bsize", },
+ {"f_frsize", },
+ {"f_blocks", },
+ {"f_bfree", },
+ {"f_bavail", },
+ {"f_files", },
+ {"f_ffree", },
+ {"f_favail", },
+ {"f_flag", },
+ {"f_namemax",},
+ {"f_fsid", },
+ {0}
+};
+
+static PyStructSequence_Desc statvfs_result_desc = {
+ "statvfs_result", /* name */
+ statvfs_result__doc__, /* doc */
+ statvfs_result_fields,
+ 10
+};
+
+#if defined(HAVE_WAITID) && !defined(__APPLE__)
+PyDoc_STRVAR(waitid_result__doc__,
+"waitid_result: Result from waitid.\n\n\
+This object may be accessed either as a tuple of\n\
+ (si_pid, si_uid, si_signo, si_status, si_code),\n\
+or via the attributes si_pid, si_uid, and so on.\n\
+\n\
+See os.waitid for more information.");
+
+static PyStructSequence_Field waitid_result_fields[] = {
+ {"si_pid", },
+ {"si_uid", },
+ {"si_signo", },
+ {"si_status", },
+ {"si_code", },
+ {0}
+};
+
+static PyStructSequence_Desc waitid_result_desc = {
+ "waitid_result", /* name */
+ waitid_result__doc__, /* doc */
+ waitid_result_fields,
+ 5
+};
+#endif
+
+static PyObject *
+statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyStructSequence *result;
+ int i;
+
+ // ht_module doesn't get set in PyStructSequence_NewType(),
+ // so we can't use PyType_GetModule().
+ PyObject *mod = PyImport_GetModule(MODNAME_OBJ);
+ if (mod == NULL) {
+ return NULL;
+ }
+ _posixstate *state = get_posix_state(mod);
+ Py_DECREF(mod);
+ if (state == NULL) {
+ return NULL;
+ }
+#define structseq_new state->statresult_new_orig
+
+ result = (PyStructSequence*)structseq_new(type, args, kwds);
+ if (!result)
+ return NULL;
+ /* If we have been initialized from a tuple,
+ st_?time might be set to None. Initialize it
+ from the int slots. */
+ for (i = 7; i <= 9; i++) {
+ if (result->ob_item[i+3] == Py_None) {
+ Py_DECREF(Py_None);
+ result->ob_item[i+3] = Py_NewRef(result->ob_item[i]);
+ }
+ }
+ return (PyObject*)result;
+}
+
+static int
+_posix_clear(PyObject *module)
+{
+ _posixstate *state = get_posix_state(module);
+ Py_CLEAR(state->billion);
+ Py_CLEAR(state->DirEntryType);
+ Py_CLEAR(state->ScandirIteratorType);
+#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
+ Py_CLEAR(state->SchedParamType);
+#endif
+ Py_CLEAR(state->StatResultType);
+ Py_CLEAR(state->StatVFSResultType);
+ Py_CLEAR(state->TerminalSizeType);
+ Py_CLEAR(state->TimesResultType);
+ Py_CLEAR(state->UnameResultType);
+#if defined(HAVE_WAITID) && !defined(__APPLE__)
+ Py_CLEAR(state->WaitidResultType);
+#endif
+#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
+ Py_CLEAR(state->struct_rusage);
+#endif
+ Py_CLEAR(state->st_mode);
+ return 0;
+}
+
+static int
+_posix_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _posixstate *state = get_posix_state(module);
+ Py_VISIT(state->billion);
+ Py_VISIT(state->DirEntryType);
+ Py_VISIT(state->ScandirIteratorType);
+#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
+ Py_VISIT(state->SchedParamType);
+#endif
+ Py_VISIT(state->StatResultType);
+ Py_VISIT(state->StatVFSResultType);
+ Py_VISIT(state->TerminalSizeType);
+ Py_VISIT(state->TimesResultType);
+ Py_VISIT(state->UnameResultType);
+#if defined(HAVE_WAITID) && !defined(__APPLE__)
+ Py_VISIT(state->WaitidResultType);
+#endif
+#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
+ Py_VISIT(state->struct_rusage);
+#endif
+ Py_VISIT(state->st_mode);
+ return 0;
+}
+
+static void
+_posix_free(void *module)
+{
+ _posix_clear((PyObject *)module);
+}
+
+static int
+fill_time(PyObject *module, PyObject *v, int s_index, int f_index, int ns_index, time_t sec, unsigned long nsec)
+{
+ assert(!PyErr_Occurred());
+
+ int res = -1;
+ PyObject *s_in_ns = NULL;
+ PyObject *ns_total = NULL;
+ PyObject *float_s = NULL;
+
+ PyObject *s = _PyLong_FromTime_t(sec);
+ PyObject *ns_fractional = PyLong_FromUnsignedLong(nsec);
+ if (!(s && ns_fractional)) {
+ goto exit;
+ }
+
+ s_in_ns = PyNumber_Multiply(s, get_posix_state(module)->billion);
+ if (!s_in_ns) {
+ goto exit;
+ }
+
+ ns_total = PyNumber_Add(s_in_ns, ns_fractional);
+ if (!ns_total)
+ goto exit;
+
+ float_s = PyFloat_FromDouble(sec + 1e-9*nsec);
+ if (!float_s) {
+ goto exit;
+ }
+
+ if (s_index >= 0) {
+ PyStructSequence_SET_ITEM(v, s_index, s);
+ s = NULL;
+ }
+ if (f_index >= 0) {
+ PyStructSequence_SET_ITEM(v, f_index, float_s);
+ float_s = NULL;
+ }
+ if (ns_index >= 0) {
+ PyStructSequence_SET_ITEM(v, ns_index, ns_total);
+ ns_total = NULL;
+ }
+
+ assert(!PyErr_Occurred());
+ res = 0;
+
+exit:
+ Py_XDECREF(s);
+ Py_XDECREF(ns_fractional);
+ Py_XDECREF(s_in_ns);
+ Py_XDECREF(ns_total);
+ Py_XDECREF(float_s);
+ return res;
+}
+
+#ifdef MS_WINDOWS
+static PyObject*
+_pystat_l128_from_l64_l64(uint64_t low, uint64_t high)
+{
+ PyObject *o_low = PyLong_FromUnsignedLongLong(low);
+ if (!o_low || !high) {
+ return o_low;
+ }
+ PyObject *o_high = PyLong_FromUnsignedLongLong(high);
+ PyObject *l64 = o_high ? PyLong_FromLong(64) : NULL;
+ if (!l64) {
+ Py_XDECREF(o_high);
+ Py_DECREF(o_low);
+ return NULL;
+ }
+ Py_SETREF(o_high, PyNumber_Lshift(o_high, l64));
+ Py_DECREF(l64);
+ if (!o_high) {
+ Py_DECREF(o_low);
+ return NULL;
+ }
+ Py_SETREF(o_low, PyNumber_Add(o_low, o_high));
+ Py_DECREF(o_high);
+ return o_low;
+}
+#endif
+
+/* pack a system stat C structure into the Python stat tuple
+ (used by posix_stat() and posix_fstat()) */
+static PyObject*
+_pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
+{
+ assert(!PyErr_Occurred());
+
+ PyObject *StatResultType = get_posix_state(module)->StatResultType;
+ PyObject *v = PyStructSequence_New((PyTypeObject *)StatResultType);
+ if (v == NULL) {
+ return NULL;
+ }
+
+#define SET_ITEM(pos, expr) \
+ do { \
+ PyObject *obj = (expr); \
+ if (obj == NULL) { \
+ goto error; \
+ } \
+ PyStructSequence_SET_ITEM(v, (pos), obj); \
+ } while (0)
+
+ SET_ITEM(0, PyLong_FromLong((long)st->st_mode));
+#ifdef MS_WINDOWS
+ SET_ITEM(1, _pystat_l128_from_l64_l64(st->st_ino, st->st_ino_high));
+ SET_ITEM(2, PyLong_FromUnsignedLongLong(st->st_dev));
+#else
+ static_assert(sizeof(unsigned long long) >= sizeof(st->st_ino),
+ "stat.st_ino is larger than unsigned long long");
+ SET_ITEM(1, PyLong_FromUnsignedLongLong(st->st_ino));
+ SET_ITEM(2, _PyLong_FromDev(st->st_dev));
+#endif
+ SET_ITEM(3, PyLong_FromLong((long)st->st_nlink));
+#if defined(MS_WINDOWS)
+ SET_ITEM(4, PyLong_FromLong(0));
+ SET_ITEM(5, PyLong_FromLong(0));
+#else
+ SET_ITEM(4, _PyLong_FromUid(st->st_uid));
+ SET_ITEM(5, _PyLong_FromGid(st->st_gid));
+#endif
+ static_assert(sizeof(long long) >= sizeof(st->st_size),
+ "stat.st_size is larger than long long");
+ SET_ITEM(6, PyLong_FromLongLong(st->st_size));
+
+ // Set st_atime, st_mtime and st_ctime
+ unsigned long ansec, mnsec, cnsec;
+#if defined(HAVE_STAT_TV_NSEC)
+ ansec = st->st_atim.tv_nsec;
+ mnsec = st->st_mtim.tv_nsec;
+ cnsec = st->st_ctim.tv_nsec;
+#elif defined(HAVE_STAT_TV_NSEC2)
+ ansec = st->st_atimespec.tv_nsec;
+ mnsec = st->st_mtimespec.tv_nsec;
+ cnsec = st->st_ctimespec.tv_nsec;
+#elif defined(HAVE_STAT_NSEC)
+ ansec = st->st_atime_nsec;
+ mnsec = st->st_mtime_nsec;
+ cnsec = st->st_ctime_nsec;
+#else
+ ansec = mnsec = cnsec = 0;
+#endif
+ if (fill_time(module, v, 7, 10, 13, st->st_atime, ansec) < 0) {
+ goto error;
+ }
+ if (fill_time(module, v, 8, 11, 14, st->st_mtime, mnsec) < 0) {
+ goto error;
+ }
+ if (fill_time(module, v, 9, 12, 15, st->st_ctime, cnsec) < 0) {
+ goto error;
+ }
+
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ SET_ITEM(ST_BLKSIZE_IDX, PyLong_FromLong((long)st->st_blksize));
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+ SET_ITEM(ST_BLOCKS_IDX, PyLong_FromLong((long)st->st_blocks));
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+ SET_ITEM(ST_RDEV_IDX, PyLong_FromLong((long)st->st_rdev));
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_GEN
+ SET_ITEM(ST_GEN_IDX, PyLong_FromLong((long)st->st_gen));
+#endif
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIME)
+ {
+ unsigned long bsec, bnsec;
+ bsec = (long)st->st_birthtime;
+#ifdef HAVE_STAT_TV_NSEC2
+ bnsec = st->st_birthtimespec.tv_nsec;
+#else
+ bnsec = 0;
+#endif
+ SET_ITEM(ST_BIRTHTIME_IDX, PyFloat_FromDouble(bsec + bnsec * 1e-9));
+ }
+#elif defined(MS_WINDOWS)
+ if (fill_time(module, v, -1, ST_BIRTHTIME_IDX, ST_BIRTHTIME_NS_IDX,
+ st->st_birthtime, st->st_birthtime_nsec) < 0) {
+ goto error;
+ }
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_FLAGS
+ SET_ITEM(ST_FLAGS_IDX, PyLong_FromLong((long)st->st_flags));
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_FILE_ATTRIBUTES
+ SET_ITEM(ST_FILE_ATTRIBUTES_IDX,
+ PyLong_FromUnsignedLong(st->st_file_attributes));
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_FSTYPE
+ SET_ITEM(ST_FSTYPE_IDX, PyUnicode_FromString(st->st_fstype));
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_REPARSE_TAG
+ SET_ITEM(ST_REPARSE_TAG_IDX, PyLong_FromUnsignedLong(st->st_reparse_tag));
+#endif
+
+ assert(!PyErr_Occurred());
+ return v;
+
+error:
+ Py_DECREF(v);
+ return NULL;
+
+#undef SET_ITEM
+}
+
+/* POSIX methods */
+
+
+static PyObject *
+posix_do_stat(PyObject *module, const char *function_name, path_t *path,
+ int dir_fd, int follow_symlinks)
+{
+ STRUCT_STAT st;
+ int result;
+
+#ifdef HAVE_FSTATAT
+ int fstatat_unavailable = 0;
+#endif
+
+#if !defined(MS_WINDOWS) && !defined(HAVE_FSTATAT) && !defined(HAVE_LSTAT)
+ if (follow_symlinks_specified(function_name, follow_symlinks))
+ return NULL;
+#endif
+
+ if (path_and_dir_fd_invalid("stat", path, dir_fd) ||
+ dir_fd_and_fd_invalid("stat", dir_fd, path->fd) ||
+ fd_and_follow_symlinks_invalid("stat", path->fd, follow_symlinks))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ if (path->fd != -1)
+ result = FSTAT(path->fd, &st);
+#ifdef MS_WINDOWS
+ else if (follow_symlinks)
+ result = win32_stat(path->wide, &st);
+ else
+ result = win32_lstat(path->wide, &st);
+#else
+ else
+#if defined(HAVE_LSTAT)
+ if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
+ result = LSTAT(path->narrow, &st);
+ else
+#endif /* HAVE_LSTAT */
+#ifdef HAVE_FSTATAT
+ if ((dir_fd != DEFAULT_DIR_FD) || !follow_symlinks) {
+ if (HAVE_FSTATAT_RUNTIME) {
+ result = fstatat(dir_fd, path->narrow, &st,
+ follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+
+ } else {
+ fstatat_unavailable = 1;
+ }
+ } else
+#endif /* HAVE_FSTATAT */
+ result = STAT(path->narrow, &st);
+#endif /* MS_WINDOWS */
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_FSTATAT
+ if (fstatat_unavailable) {
+ argument_unavailable_error("stat", "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result != 0) {
+ return path_error(path);
+ }
+
+ return _pystat_fromstructstat(module, &st);
+}
+
+/*[python input]
+
+for s in """
+
+FACCESSAT
+FCHMODAT
+FCHOWNAT
+FSTATAT
+LINKAT
+MKDIRAT
+MKFIFOAT
+MKNODAT
+OPENAT
+READLINKAT
+SYMLINKAT
+UNLINKAT
+
+""".strip().split():
+ s = s.strip()
+ print("""
+#ifdef HAVE_{s}
+ #define {s}_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define {s}_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+""".rstrip().format(s=s))
+
+for s in """
+
+FCHDIR
+FCHMOD
+FCHOWN
+FDOPENDIR
+FEXECVE
+FPATHCONF
+FSTATVFS
+FTRUNCATE
+
+""".strip().split():
+ s = s.strip()
+ print("""
+#ifdef HAVE_{s}
+ #define PATH_HAVE_{s} 1
+#else
+ #define PATH_HAVE_{s} 0
+#endif
+
+""".rstrip().format(s=s))
+[python start generated code]*/
+
+#ifdef HAVE_FACCESSAT
+ #define FACCESSAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define FACCESSAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_FCHMODAT
+ #define FCHMODAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define FCHMODAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_FCHOWNAT
+ #define FCHOWNAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define FCHOWNAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_FSTATAT
+ #define FSTATAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define FSTATAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_LINKAT
+ #define LINKAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define LINKAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_MKDIRAT
+ #define MKDIRAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define MKDIRAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_MKFIFOAT
+ #define MKFIFOAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define MKFIFOAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_MKNODAT
+ #define MKNODAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define MKNODAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_OPENAT
+ #define OPENAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define OPENAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_READLINKAT
+ #define READLINKAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define READLINKAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_SYMLINKAT
+ #define SYMLINKAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define SYMLINKAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_UNLINKAT
+ #define UNLINKAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define UNLINKAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#ifdef HAVE_FCHDIR
+ #define PATH_HAVE_FCHDIR 1
+#else
+ #define PATH_HAVE_FCHDIR 0
+#endif
+
+#ifdef HAVE_FCHMOD
+ #define PATH_HAVE_FCHMOD 1
+#else
+ #define PATH_HAVE_FCHMOD 0
+#endif
+
+#ifdef HAVE_FCHOWN
+ #define PATH_HAVE_FCHOWN 1
+#else
+ #define PATH_HAVE_FCHOWN 0
+#endif
+
+#ifdef HAVE_FDOPENDIR
+ #define PATH_HAVE_FDOPENDIR 1
+#else
+ #define PATH_HAVE_FDOPENDIR 0
+#endif
+
+#ifdef HAVE_FEXECVE
+ #define PATH_HAVE_FEXECVE 1
+#else
+ #define PATH_HAVE_FEXECVE 0
+#endif
+
+#ifdef HAVE_FPATHCONF
+ #define PATH_HAVE_FPATHCONF 1
+#else
+ #define PATH_HAVE_FPATHCONF 0
+#endif
+
+#ifdef HAVE_FSTATVFS
+ #define PATH_HAVE_FSTATVFS 1
+#else
+ #define PATH_HAVE_FSTATVFS 0
+#endif
+
+#ifdef HAVE_FTRUNCATE
+ #define PATH_HAVE_FTRUNCATE 1
+#else
+ #define PATH_HAVE_FTRUNCATE 0
+#endif
+/*[python end generated code: output=4bd4f6f7d41267f1 input=80b4c890b6774ea5]*/
+
+#ifdef MS_WINDOWS
+ #undef PATH_HAVE_FTRUNCATE
+ #define PATH_HAVE_FTRUNCATE 1
+#endif
+
+/*[python input]
+
+class path_t_converter(CConverter):
+
+ type = "path_t"
+ impl_by_reference = True
+ parse_by_reference = True
+
+ converter = 'path_converter'
+
+ def converter_init(self, *, allow_fd=False, nullable=False):
+ # right now path_t doesn't support default values.
+ # to support a default value, you'll need to override initialize().
+ if self.default not in (unspecified, None):
+ fail("Can't specify a default to the path_t converter!")
+
+ if self.c_default not in (None, 'Py_None'):
+ raise RuntimeError("Can't specify a c_default to the path_t converter!")
+
+ self.nullable = nullable
+ self.allow_fd = allow_fd
+
+ def pre_render(self):
+ def strify(value):
+ if isinstance(value, str):
+ return value
+ return str(int(bool(value)))
+
+ # add self.py_name here when merging with posixmodule conversion
+ self.c_default = 'PATH_T_INITIALIZE("{}", "{}", {}, {})'.format(
+ self.function.name,
+ self.name,
+ strify(self.nullable),
+ strify(self.allow_fd),
+ )
+
+ def cleanup(self):
+ return "path_cleanup(&" + self.name + ");\n"
+
+
+class dir_fd_converter(CConverter):
+ type = 'int'
+
+ def converter_init(self, requires=None):
+ if self.default in (unspecified, None):
+ self.c_default = 'DEFAULT_DIR_FD'
+ if isinstance(requires, str):
+ self.converter = requires.upper() + '_DIR_FD_CONVERTER'
+ else:
+ self.converter = 'dir_fd_converter'
+
+class uid_t_converter(CConverter):
+ type = "uid_t"
+ converter = '_Py_Uid_Converter'
+
+class gid_t_converter(CConverter):
+ type = "gid_t"
+ converter = '_Py_Gid_Converter'
+
+class dev_t_converter(CConverter):
+ type = 'dev_t'
+ converter = '_Py_Dev_Converter'
+
+class dev_t_return_converter(unsigned_long_return_converter):
+ type = 'dev_t'
+ conversion_fn = '_PyLong_FromDev'
+ unsigned_cast = '(dev_t)'
+
+class FSConverter_converter(CConverter):
+ type = 'PyObject *'
+ converter = 'PyUnicode_FSConverter'
+ def converter_init(self):
+ if self.default is not unspecified:
+ fail("FSConverter_converter does not support default values")
+ self.c_default = 'NULL'
+
+ def cleanup(self):
+ return "Py_XDECREF(" + self.name + ");\n"
+
+class pid_t_converter(CConverter):
+ type = 'pid_t'
+ format_unit = '" _Py_PARSE_PID "'
+
+class idtype_t_converter(int_converter):
+ type = 'idtype_t'
+
+class id_t_converter(CConverter):
+ type = 'id_t'
+ format_unit = '" _Py_PARSE_PID "'
+
+class intptr_t_converter(CConverter):
+ type = 'intptr_t'
+ format_unit = '" _Py_PARSE_INTPTR "'
+
+class Py_off_t_converter(CConverter):
+ type = 'Py_off_t'
+ converter = 'Py_off_t_converter'
+
+class Py_off_t_return_converter(long_return_converter):
+ type = 'Py_off_t'
+ conversion_fn = 'PyLong_FromPy_off_t'
+
+class path_confname_converter(CConverter):
+ type="int"
+ converter="conv_path_confname"
+
+class confstr_confname_converter(path_confname_converter):
+ converter='conv_confstr_confname'
+
+class sysconf_confname_converter(path_confname_converter):
+ converter="conv_sysconf_confname"
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=3338733161aa7879]*/
+
+/*[clinic input]
+
+os.stat
+
+ path : path_t(allow_fd=True)
+ Path to be examined; can be string, bytes, a path-like object or
+ open-file-descriptor int.
+
+ *
+
+ dir_fd : dir_fd(requires='fstatat') = None
+ If not None, it should be a file descriptor open to a directory,
+ and path should be a relative string; path will then be relative to
+ that directory.
+
+ follow_symlinks: bool = True
+ If False, and the last element of the path is a symbolic link,
+ stat will examine the symbolic link itself instead of the file
+ the link points to.
+
+Perform a stat system call on the given path.
+
+dir_fd and follow_symlinks may not be implemented
+ on your platform. If they are unavailable, using them will raise a
+ NotImplementedError.
+
+It's an error to use dir_fd or follow_symlinks when specifying path as
+ an open file descriptor.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks)
+/*[clinic end generated code: output=7d4976e6f18a59c5 input=01d362ebcc06996b]*/
+{
+ return posix_do_stat(module, "stat", path, dir_fd, follow_symlinks);
+}
+
+
+/*[clinic input]
+os.lstat
+
+ path : path_t
+
+ *
+
+ dir_fd : dir_fd(requires='fstatat') = None
+
+Perform a stat system call on the given path, without following symbolic links.
+
+Like stat(), but do not follow symbolic links.
+Equivalent to stat(path, follow_symlinks=False).
+[clinic start generated code]*/
+
+static PyObject *
+os_lstat_impl(PyObject *module, path_t *path, int dir_fd)
+/*[clinic end generated code: output=ef82a5d35ce8ab37 input=0b7474765927b925]*/
+{
+ int follow_symlinks = 0;
+ return posix_do_stat(module, "lstat", path, dir_fd, follow_symlinks);
+}
+
+
+/*[clinic input]
+os.access -> bool
+
+ path: path_t
+ Path to be tested; can be string, bytes, or a path-like object.
+
+ mode: int
+ Operating-system mode bitfield. Can be F_OK to test existence,
+ or the inclusive-OR of R_OK, W_OK, and X_OK.
+
+ *
+
+ dir_fd : dir_fd(requires='faccessat') = None
+ If not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that
+ directory.
+
+ effective_ids: bool = False
+ If True, access will use the effective uid/gid instead of
+ the real uid/gid.
+
+ follow_symlinks: bool = True
+ If False, and the last element of the path is a symbolic link,
+ access will examine the symbolic link itself instead of the file
+ the link points to.
+
+Use the real uid/gid to test for access to a path.
+
+{parameters}
+dir_fd, effective_ids, and follow_symlinks may not be implemented
+ on your platform. If they are unavailable, using them will raise a
+ NotImplementedError.
+
+Note that most operations will use the effective uid/gid, therefore this
+ routine can be used in a suid/sgid environment to test if the invoking user
+ has the specified access to the path.
+
+[clinic start generated code]*/
+
+static int
+os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd,
+ int effective_ids, int follow_symlinks)
+/*[clinic end generated code: output=cf84158bc90b1a77 input=3ffe4e650ee3bf20]*/
+{
+ int return_value;
+
+#ifdef MS_WINDOWS
+ DWORD attr;
+#else
+ int result;
+#endif
+
+#ifdef HAVE_FACCESSAT
+ int faccessat_unavailable = 0;
+#endif
+
+#ifndef HAVE_FACCESSAT
+ if (follow_symlinks_specified("access", follow_symlinks))
+ return -1;
+
+ if (effective_ids) {
+ argument_unavailable_error("access", "effective_ids");
+ return -1;
+ }
+#endif
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ attr = GetFileAttributesW(path->wide);
+ Py_END_ALLOW_THREADS
+
+ /*
+ * Access is possible if
+ * * we didn't get a -1, and
+ * * write access wasn't requested,
+ * * or the file isn't read-only,
+ * * or it's a directory.
+ * (Directories cannot be read-only on Windows.)
+ */
+ return_value = (attr != INVALID_FILE_ATTRIBUTES) &&
+ (!(mode & 2) ||
+ !(attr & FILE_ATTRIBUTE_READONLY) ||
+ (attr & FILE_ATTRIBUTE_DIRECTORY));
+#else
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_FACCESSAT
+ if ((dir_fd != DEFAULT_DIR_FD) ||
+ effective_ids ||
+ !follow_symlinks) {
+
+ if (HAVE_FACCESSAT_RUNTIME) {
+ int flags = 0;
+ if (!follow_symlinks)
+ flags |= AT_SYMLINK_NOFOLLOW;
+ if (effective_ids)
+ flags |= AT_EACCESS;
+ result = faccessat(dir_fd, path->narrow, mode, flags);
+ } else {
+ faccessat_unavailable = 1;
+ }
+ }
+ else
+#endif
+ result = access(path->narrow, mode);
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_FACCESSAT
+ if (faccessat_unavailable) {
+ if (dir_fd != DEFAULT_DIR_FD) {
+ argument_unavailable_error("access", "dir_fd");
+ return -1;
+ }
+ if (follow_symlinks_specified("access", follow_symlinks))
+ return -1;
+
+ if (effective_ids) {
+ argument_unavailable_error("access", "effective_ids");
+ return -1;
+ }
+ /* should be unreachable */
+ return -1;
+ }
+#endif
+ return_value = !result;
+#endif
+
+ return return_value;
+}
+
+#ifndef F_OK
+#define F_OK 0
+#endif
+#ifndef R_OK
+#define R_OK 4
+#endif
+#ifndef W_OK
+#define W_OK 2
+#endif
+#ifndef X_OK
+#define X_OK 1
+#endif
+
+
+#ifdef HAVE_TTYNAME
+/*[clinic input]
+os.ttyname
+
+ fd: int
+ Integer file descriptor handle.
+
+ /
+
+Return the name of the terminal device connected to 'fd'.
+[clinic start generated code]*/
+
+static PyObject *
+os_ttyname_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/
+{
+
+ long size = sysconf(_SC_TTY_NAME_MAX);
+ if (size == -1) {
+ return posix_error();
+ }
+ char *buffer = (char *)PyMem_RawMalloc(size);
+ if (buffer == NULL) {
+ return PyErr_NoMemory();
+ }
+ int ret = ttyname_r(fd, buffer, size);
+ if (ret != 0) {
+ PyMem_RawFree(buffer);
+ errno = ret;
+ return posix_error();
+ }
+ PyObject *res = PyUnicode_DecodeFSDefault(buffer);
+ PyMem_RawFree(buffer);
+ return res;
+}
+#endif
+
+#ifdef HAVE_CTERMID
+/*[clinic input]
+os.ctermid
+
+Return the name of the controlling terminal for this process.
+[clinic start generated code]*/
+
+static PyObject *
+os_ctermid_impl(PyObject *module)
+/*[clinic end generated code: output=02f017e6c9e620db input=3b87fdd52556382d]*/
+{
+ char *ret;
+ char buffer[L_ctermid];
+
+#ifdef USE_CTERMID_R
+ ret = ctermid_r(buffer);
+#else
+ ret = ctermid(buffer);
+#endif
+ if (ret == NULL)
+ return posix_error();
+ return PyUnicode_DecodeFSDefault(buffer);
+}
+#endif /* HAVE_CTERMID */
+
+
+/*[clinic input]
+os.chdir
+
+ path: path_t(allow_fd='PATH_HAVE_FCHDIR')
+
+Change the current working directory to the specified path.
+
+path may always be specified as a string.
+On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+[clinic start generated code]*/
+
+static PyObject *
+os_chdir_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=3be6400eee26eaae input=1a4a15b4d12cb15d]*/
+{
+ int result;
+
+ if (PySys_Audit("os.chdir", "(O)", path->object) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef MS_WINDOWS
+ /* on unix, success = 0, on windows, success = !0 */
+ result = !win32_wchdir(path->wide);
+#else
+#ifdef HAVE_FCHDIR
+ if (path->fd != -1)
+ result = fchdir(path->fd);
+ else
+#endif
+ result = chdir(path->narrow);
+#endif
+ Py_END_ALLOW_THREADS
+
+ if (result) {
+ return path_error(path);
+ }
+
+ Py_RETURN_NONE;
+}
+
+
+#ifdef HAVE_FCHDIR
+/*[clinic input]
+os.fchdir
+
+ fd: fildes
+
+Change to the directory of the given file descriptor.
+
+fd must be opened on a directory, not a file.
+Equivalent to os.chdir(fd).
+
+[clinic start generated code]*/
+
+static PyObject *
+os_fchdir_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=42e064ec4dc00ab0 input=18e816479a2fa985]*/
+{
+ if (PySys_Audit("os.chdir", "(i)", fd) < 0) {
+ return NULL;
+ }
+ return posix_fildes_fd(fd, fchdir);
+}
+#endif /* HAVE_FCHDIR */
+
+
+/*[clinic input]
+os.chmod
+
+ path: path_t(allow_fd='PATH_HAVE_FCHMOD')
+ Path to be modified. May always be specified as a str, bytes, or a path-like object.
+ On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+
+ mode: int
+ Operating-system mode bitfield.
+ Be careful when using number literals for *mode*. The conventional UNIX notation for
+ numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
+ Python.
+
+ *
+
+ dir_fd : dir_fd(requires='fchmodat') = None
+ If not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that
+ directory.
+
+ follow_symlinks: bool = True
+ If False, and the last element of the path is a symbolic link,
+ chmod will modify the symbolic link itself instead of the file
+ the link points to.
+
+Change the access permissions of a file.
+
+It is an error to use dir_fd or follow_symlinks when specifying path as
+ an open file descriptor.
+dir_fd and follow_symlinks may not be implemented on your platform.
+ If they are unavailable, using them will raise a NotImplementedError.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
+ int follow_symlinks)
+/*[clinic end generated code: output=5cf6a94915cc7bff input=674a14bc998de09d]*/
+{
+ int result;
+
+#ifdef MS_WINDOWS
+ DWORD attr;
+#endif
+
+#ifdef HAVE_FCHMODAT
+ int fchmodat_nofollow_unsupported = 0;
+ int fchmodat_unsupported = 0;
+#endif
+
+#if !(defined(HAVE_FCHMODAT) || defined(HAVE_LCHMOD))
+ if (follow_symlinks_specified("chmod", follow_symlinks))
+ return NULL;
+#endif
+
+ if (PySys_Audit("os.chmod", "Oii", path->object, mode,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ attr = GetFileAttributesW(path->wide);
+ if (attr == INVALID_FILE_ATTRIBUTES)
+ result = 0;
+ else {
+ if (mode & _S_IWRITE)
+ attr &= ~FILE_ATTRIBUTE_READONLY;
+ else
+ attr |= FILE_ATTRIBUTE_READONLY;
+ result = SetFileAttributesW(path->wide, attr);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (!result) {
+ return path_error(path);
+ }
+#else /* MS_WINDOWS */
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_FCHMOD
+ if (path->fd != -1)
+ result = fchmod(path->fd, mode);
+ else
+#endif /* HAVE_CHMOD */
+#ifdef HAVE_LCHMOD
+ if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
+ result = lchmod(path->narrow, mode);
+ else
+#endif /* HAVE_LCHMOD */
+#ifdef HAVE_FCHMODAT
+ if ((dir_fd != DEFAULT_DIR_FD) || !follow_symlinks) {
+ if (HAVE_FCHMODAT_RUNTIME) {
+ /*
+ * fchmodat() doesn't currently support AT_SYMLINK_NOFOLLOW!
+ * The documentation specifically shows how to use it,
+ * and then says it isn't implemented yet.
+ * (true on linux with glibc 2.15, and openindiana 3.x)
+ *
+ * Once it is supported, os.chmod will automatically
+ * support dir_fd and follow_symlinks=False. (Hopefully.)
+ * Until then, we need to be careful what exception we raise.
+ */
+ result = fchmodat(dir_fd, path->narrow, mode,
+ follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ /*
+ * But wait! We can't throw the exception without allowing threads,
+ * and we can't do that in this nested scope. (Macro trickery, sigh.)
+ */
+ fchmodat_nofollow_unsupported =
+ result &&
+ ((errno == ENOTSUP) || (errno == EOPNOTSUPP)) &&
+ !follow_symlinks;
+ } else {
+ fchmodat_unsupported = 1;
+ fchmodat_nofollow_unsupported = 1;
+
+ result = -1;
+ }
+ }
+ else
+#endif /* HAVE_FHCMODAT */
+ {
+#ifdef HAVE_CHMOD
+ result = chmod(path->narrow, mode);
+#elif defined(__wasi__)
+ // WASI SDK 15.0 does not support chmod.
+ // Ignore missing syscall for now.
+ result = 0;
+#else
+ result = -1;
+ errno = ENOSYS;
+#endif
+ }
+ Py_END_ALLOW_THREADS
+
+ if (result) {
+#ifdef HAVE_FCHMODAT
+ if (fchmodat_unsupported) {
+ if (dir_fd != DEFAULT_DIR_FD) {
+ argument_unavailable_error("chmod", "dir_fd");
+ return NULL;
+ }
+ }
+
+ if (fchmodat_nofollow_unsupported) {
+ if (dir_fd != DEFAULT_DIR_FD)
+ dir_fd_and_follow_symlinks_invalid("chmod",
+ dir_fd, follow_symlinks);
+ else
+ follow_symlinks_specified("chmod", follow_symlinks);
+ return NULL;
+ }
+ else
+#endif /* HAVE_FCHMODAT */
+ return path_error(path);
+ }
+#endif /* MS_WINDOWS */
+
+ Py_RETURN_NONE;
+}
+
+
+#ifdef HAVE_FCHMOD
+/*[clinic input]
+os.fchmod
+
+ fd: int
+ The file descriptor of the file to be modified.
+ mode: int
+ Operating-system mode bitfield.
+ Be careful when using number literals for *mode*. The conventional UNIX notation for
+ numeric modes uses an octal base, which needs to be indicated with a ``0o`` prefix in
+ Python.
+
+Change the access permissions of the file given by file descriptor fd.
+
+Equivalent to os.chmod(fd, mode).
+[clinic start generated code]*/
+
+static PyObject *
+os_fchmod_impl(PyObject *module, int fd, int mode)
+/*[clinic end generated code: output=afd9bc05b4e426b3 input=b5594618bbbc22df]*/
+{
+ int res;
+ int async_err = 0;
+
+ if (PySys_Audit("os.chmod", "iii", fd, mode, -1) < 0) {
+ return NULL;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ res = fchmod(fd, mode);
+ Py_END_ALLOW_THREADS
+ } while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res != 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_FCHMOD */
+
+
+#ifdef HAVE_LCHMOD
+/*[clinic input]
+os.lchmod
+
+ path: path_t
+ mode: int
+
+Change the access permissions of a file, without following symbolic links.
+
+If path is a symlink, this affects the link itself rather than the target.
+Equivalent to chmod(path, mode, follow_symlinks=False)."
+[clinic start generated code]*/
+
+static PyObject *
+os_lchmod_impl(PyObject *module, path_t *path, int mode)
+/*[clinic end generated code: output=082344022b51a1d5 input=90c5663c7465d24f]*/
+{
+ int res;
+ if (PySys_Audit("os.chmod", "Oii", path->object, mode, -1) < 0) {
+ return NULL;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ res = lchmod(path->narrow, mode);
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ path_error(path);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_LCHMOD */
+
+
+#ifdef HAVE_CHFLAGS
+/*[clinic input]
+os.chflags
+
+ path: path_t
+ flags: unsigned_long(bitwise=True)
+ follow_symlinks: bool=True
+
+Set file flags.
+
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, chflags will change flags on the symbolic link itself instead of the
+ file the link points to.
+follow_symlinks may not be implemented on your platform. If it is
+unavailable, using it will raise a NotImplementedError.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_chflags_impl(PyObject *module, path_t *path, unsigned long flags,
+ int follow_symlinks)
+/*[clinic end generated code: output=85571c6737661ce9 input=0327e29feb876236]*/
+{
+ int result;
+
+#ifndef HAVE_LCHFLAGS
+ if (follow_symlinks_specified("chflags", follow_symlinks))
+ return NULL;
+#endif
+
+ if (PySys_Audit("os.chflags", "Ok", path->object, flags) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_LCHFLAGS
+ if (!follow_symlinks)
+ result = lchflags(path->narrow, flags);
+ else
+#endif
+ result = chflags(path->narrow, flags);
+ Py_END_ALLOW_THREADS
+
+ if (result)
+ return path_error(path);
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_CHFLAGS */
+
+
+#ifdef HAVE_LCHFLAGS
+/*[clinic input]
+os.lchflags
+
+ path: path_t
+ flags: unsigned_long(bitwise=True)
+
+Set file flags.
+
+This function will not follow symbolic links.
+Equivalent to chflags(path, flags, follow_symlinks=False).
+[clinic start generated code]*/
+
+static PyObject *
+os_lchflags_impl(PyObject *module, path_t *path, unsigned long flags)
+/*[clinic end generated code: output=30ae958695c07316 input=f9f82ea8b585ca9d]*/
+{
+ int res;
+ if (PySys_Audit("os.chflags", "Ok", path->object, flags) < 0) {
+ return NULL;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ res = lchflags(path->narrow, flags);
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ return path_error(path);
+ }
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_LCHFLAGS */
+
+
+#ifdef HAVE_CHROOT
+/*[clinic input]
+os.chroot
+ path: path_t
+
+Change root directory to path.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_chroot_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=de80befc763a4475 input=14822965652c3dc3]*/
+{
+ int res;
+ Py_BEGIN_ALLOW_THREADS
+ res = chroot(path->narrow);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return path_error(path);
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_CHROOT */
+
+
+#ifdef HAVE_FSYNC
+/*[clinic input]
+os.fsync
+
+ fd: fildes
+
+Force write of fd to disk.
+[clinic start generated code]*/
+
+static PyObject *
+os_fsync_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=4a10d773f52b3584 input=21c3645c056967f2]*/
+{
+ return posix_fildes_fd(fd, fsync);
+}
+#endif /* HAVE_FSYNC */
+
+
+#ifdef HAVE_SYNC
+/*[clinic input]
+os.sync
+
+Force write of everything to disk.
+[clinic start generated code]*/
+
+static PyObject *
+os_sync_impl(PyObject *module)
+/*[clinic end generated code: output=2796b1f0818cd71c input=84749fe5e9b404ff]*/
+{
+ Py_BEGIN_ALLOW_THREADS
+ sync();
+ Py_END_ALLOW_THREADS
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SYNC */
+
+
+#ifdef HAVE_FDATASYNC
+#ifdef __hpux
+extern int fdatasync(int); /* On HP-UX, in libc but not in unistd.h */
+#endif
+
+/*[clinic input]
+os.fdatasync
+
+ fd: fildes
+
+Force write of fd to disk without forcing update of metadata.
+[clinic start generated code]*/
+
+static PyObject *
+os_fdatasync_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=b4b9698b5d7e26dd input=bc74791ee54dd291]*/
+{
+ return posix_fildes_fd(fd, fdatasync);
+}
+#endif /* HAVE_FDATASYNC */
+
+
+#ifdef HAVE_CHOWN
+/*[clinic input]
+os.chown
+
+ path : path_t(allow_fd='PATH_HAVE_FCHOWN')
+ Path to be examined; can be string, bytes, a path-like object, or open-file-descriptor int.
+
+ uid: uid_t
+
+ gid: gid_t
+
+ *
+
+ dir_fd : dir_fd(requires='fchownat') = None
+ If not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that
+ directory.
+
+ follow_symlinks: bool = True
+ If False, and the last element of the path is a symbolic link,
+ stat will examine the symbolic link itself instead of the file
+ the link points to.
+
+Change the owner and group id of path to the numeric uid and gid.\
+
+path may always be specified as a string.
+On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, chown will modify the symbolic link itself instead of the file the
+ link points to.
+It is an error to use dir_fd or follow_symlinks when specifying path as
+ an open file descriptor.
+dir_fd and follow_symlinks may not be implemented on your platform.
+ If they are unavailable, using them will raise a NotImplementedError.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_chown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid,
+ int dir_fd, int follow_symlinks)
+/*[clinic end generated code: output=4beadab0db5f70cd input=b08c5ec67996a97d]*/
+{
+ int result;
+
+#if defined(HAVE_FCHOWNAT)
+ int fchownat_unsupported = 0;
+#endif
+
+#if !(defined(HAVE_LCHOWN) || defined(HAVE_FCHOWNAT))
+ if (follow_symlinks_specified("chown", follow_symlinks))
+ return NULL;
+#endif
+ if (dir_fd_and_fd_invalid("chown", dir_fd, path->fd) ||
+ fd_and_follow_symlinks_invalid("chown", path->fd, follow_symlinks))
+ return NULL;
+
+ if (PySys_Audit("os.chown", "OIIi", path->object, uid, gid,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_FCHOWN
+ if (path->fd != -1)
+ result = fchown(path->fd, uid, gid);
+ else
+#endif
+#ifdef HAVE_LCHOWN
+ if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
+ result = lchown(path->narrow, uid, gid);
+ else
+#endif
+#ifdef HAVE_FCHOWNAT
+ if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) {
+ if (HAVE_FCHOWNAT_RUNTIME) {
+ result = fchownat(dir_fd, path->narrow, uid, gid,
+ follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ } else {
+ fchownat_unsupported = 1;
+ }
+ } else
+#endif
+ result = chown(path->narrow, uid, gid);
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_FCHOWNAT
+ if (fchownat_unsupported) {
+ /* This would be incorrect if the current platform
+ * doesn't support lchown.
+ */
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result)
+ return path_error(path);
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_CHOWN */
+
+
+#ifdef HAVE_FCHOWN
+/*[clinic input]
+os.fchown
+
+ fd: int
+ uid: uid_t
+ gid: gid_t
+
+Change the owner and group id of the file specified by file descriptor.
+
+Equivalent to os.chown(fd, uid, gid).
+
+[clinic start generated code]*/
+
+static PyObject *
+os_fchown_impl(PyObject *module, int fd, uid_t uid, gid_t gid)
+/*[clinic end generated code: output=97d21cbd5a4350a6 input=3af544ba1b13a0d7]*/
+{
+ int res;
+ int async_err = 0;
+
+ if (PySys_Audit("os.chown", "iIIi", fd, uid, gid, -1) < 0) {
+ return NULL;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ res = fchown(fd, uid, gid);
+ Py_END_ALLOW_THREADS
+ } while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res != 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_FCHOWN */
+
+
+#ifdef HAVE_LCHOWN
+/*[clinic input]
+os.lchown
+
+ path : path_t
+ uid: uid_t
+ gid: gid_t
+
+Change the owner and group id of path to the numeric uid and gid.
+
+This function will not follow symbolic links.
+Equivalent to os.chown(path, uid, gid, follow_symlinks=False).
+[clinic start generated code]*/
+
+static PyObject *
+os_lchown_impl(PyObject *module, path_t *path, uid_t uid, gid_t gid)
+/*[clinic end generated code: output=25eaf6af412fdf2f input=b1c6014d563a7161]*/
+{
+ int res;
+ if (PySys_Audit("os.chown", "OIIi", path->object, uid, gid, -1) < 0) {
+ return NULL;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ res = lchown(path->narrow, uid, gid);
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ return path_error(path);
+ }
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_LCHOWN */
+
+
+static PyObject *
+posix_getcwd(int use_bytes)
+{
+#ifdef MS_WINDOWS
+ wchar_t wbuf[MAXPATHLEN];
+ wchar_t *wbuf2 = wbuf;
+ DWORD len;
+
+ Py_BEGIN_ALLOW_THREADS
+ len = GetCurrentDirectoryW(Py_ARRAY_LENGTH(wbuf), wbuf);
+ /* If the buffer is large enough, len does not include the
+ terminating \0. If the buffer is too small, len includes
+ the space needed for the terminator. */
+ if (len >= Py_ARRAY_LENGTH(wbuf)) {
+ if (len <= PY_SSIZE_T_MAX / sizeof(wchar_t)) {
+ wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t));
+ }
+ else {
+ wbuf2 = NULL;
+ }
+ if (wbuf2) {
+ len = GetCurrentDirectoryW(len, wbuf2);
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ if (!wbuf2) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ if (!len) {
+ PyErr_SetFromWindowsErr(0);
+ if (wbuf2 != wbuf)
+ PyMem_RawFree(wbuf2);
+ return NULL;
+ }
+
+ PyObject *resobj = PyUnicode_FromWideChar(wbuf2, len);
+ if (wbuf2 != wbuf) {
+ PyMem_RawFree(wbuf2);
+ }
+
+ if (use_bytes) {
+ if (resobj == NULL) {
+ return NULL;
+ }
+ Py_SETREF(resobj, PyUnicode_EncodeFSDefault(resobj));
+ }
+
+ return resobj;
+#else
+ const size_t chunk = 1024;
+
+ char *buf = NULL;
+ char *cwd = NULL;
+ size_t buflen = 0;
+
+ Py_BEGIN_ALLOW_THREADS
+ do {
+ char *newbuf;
+ if (buflen <= PY_SSIZE_T_MAX - chunk) {
+ buflen += chunk;
+ newbuf = PyMem_RawRealloc(buf, buflen);
+ }
+ else {
+ newbuf = NULL;
+ }
+ if (newbuf == NULL) {
+ PyMem_RawFree(buf);
+ buf = NULL;
+ break;
+ }
+ buf = newbuf;
+
+ cwd = getcwd(buf, buflen);
+ } while (cwd == NULL && errno == ERANGE);
+ Py_END_ALLOW_THREADS
+
+ if (buf == NULL) {
+ return PyErr_NoMemory();
+ }
+ if (cwd == NULL) {
+ posix_error();
+ PyMem_RawFree(buf);
+ return NULL;
+ }
+
+ PyObject *obj;
+ if (use_bytes) {
+ obj = PyBytes_FromStringAndSize(buf, strlen(buf));
+ }
+ else {
+ obj = PyUnicode_DecodeFSDefault(buf);
+ }
+ PyMem_RawFree(buf);
+
+ return obj;
+#endif /* !MS_WINDOWS */
+}
+
+
+/*[clinic input]
+os.getcwd
+
+Return a unicode string representing the current working directory.
+[clinic start generated code]*/
+
+static PyObject *
+os_getcwd_impl(PyObject *module)
+/*[clinic end generated code: output=21badfae2ea99ddc input=f069211bb70e3d39]*/
+{
+ return posix_getcwd(0);
+}
+
+
+/*[clinic input]
+os.getcwdb
+
+Return a bytes string representing the current working directory.
+[clinic start generated code]*/
+
+static PyObject *
+os_getcwdb_impl(PyObject *module)
+/*[clinic end generated code: output=3dd47909480e4824 input=f6f6a378dad3d9cb]*/
+{
+ return posix_getcwd(1);
+}
+
+
+#if ((!defined(HAVE_LINK)) && defined(MS_WINDOWS))
+#define HAVE_LINK 1
+#endif
+
+#ifdef HAVE_LINK
+/*[clinic input]
+
+os.link
+
+ src : path_t
+ dst : path_t
+ *
+ src_dir_fd : dir_fd = None
+ dst_dir_fd : dir_fd = None
+ follow_symlinks: bool = True
+
+Create a hard link to a file.
+
+If either src_dir_fd or dst_dir_fd is not None, it should be a file
+ descriptor open to a directory, and the respective path string (src or dst)
+ should be relative; the path will then be relative to that directory.
+If follow_symlinks is False, and the last element of src is a symbolic
+ link, link will create a link to the symbolic link itself instead of the
+ file the link points to.
+src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your
+ platform. If they are unavailable, using them will raise a
+ NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_link_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
+ int dst_dir_fd, int follow_symlinks)
+/*[clinic end generated code: output=7f00f6007fd5269a input=b0095ebbcbaa7e04]*/
+{
+#ifdef MS_WINDOWS
+ BOOL result = FALSE;
+#else
+ int result;
+#endif
+#if defined(HAVE_LINKAT)
+ int linkat_unavailable = 0;
+#endif
+
+#ifndef HAVE_LINKAT
+ if ((src_dir_fd != DEFAULT_DIR_FD) || (dst_dir_fd != DEFAULT_DIR_FD)) {
+ argument_unavailable_error("link", "src_dir_fd and dst_dir_fd");
+ return NULL;
+ }
+#endif
+
+#ifndef MS_WINDOWS
+ if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
+ PyErr_SetString(PyExc_NotImplementedError,
+ "link: src and dst must be the same type");
+ return NULL;
+ }
+#endif
+
+ if (PySys_Audit("os.link", "OOii", src->object, dst->object,
+ src_dir_fd == DEFAULT_DIR_FD ? -1 : src_dir_fd,
+ dst_dir_fd == DEFAULT_DIR_FD ? -1 : dst_dir_fd) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ result = CreateHardLinkW(dst->wide, src->wide, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (!result)
+ return path_error2(src, dst);
+#else
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_LINKAT
+ if ((src_dir_fd != DEFAULT_DIR_FD) ||
+ (dst_dir_fd != DEFAULT_DIR_FD) ||
+ (!follow_symlinks)) {
+
+ if (HAVE_LINKAT_RUNTIME) {
+
+ result = linkat(src_dir_fd, src->narrow,
+ dst_dir_fd, dst->narrow,
+ follow_symlinks ? AT_SYMLINK_FOLLOW : 0);
+
+ }
+#ifdef __APPLE__
+ else {
+ if (src_dir_fd == DEFAULT_DIR_FD && dst_dir_fd == DEFAULT_DIR_FD) {
+ /* See issue 41355: This matches the behaviour of !HAVE_LINKAT */
+ result = link(src->narrow, dst->narrow);
+ } else {
+ linkat_unavailable = 1;
+ }
+ }
+#endif
+ }
+ else
+#endif /* HAVE_LINKAT */
+ result = link(src->narrow, dst->narrow);
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_LINKAT
+ if (linkat_unavailable) {
+ /* Either or both dir_fd arguments were specified */
+ if (src_dir_fd != DEFAULT_DIR_FD) {
+ argument_unavailable_error("link", "src_dir_fd");
+ } else {
+ argument_unavailable_error("link", "dst_dir_fd");
+ }
+ return NULL;
+ }
+#endif
+
+ if (result)
+ return path_error2(src, dst);
+#endif /* MS_WINDOWS */
+
+ Py_RETURN_NONE;
+}
+#endif
+
+
+#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
+static PyObject *
+_listdir_windows_no_opendir(path_t *path, PyObject *list)
+{
+ PyObject *v;
+ HANDLE hFindFile = INVALID_HANDLE_VALUE;
+ BOOL result;
+ wchar_t namebuf[MAX_PATH+4]; /* Overallocate for "\*.*" */
+ /* only claim to have space for MAX_PATH */
+ Py_ssize_t len = Py_ARRAY_LENGTH(namebuf)-4;
+ wchar_t *wnamebuf = NULL;
+
+ WIN32_FIND_DATAW wFileData;
+ const wchar_t *po_wchars;
+
+ if (!path->wide) { /* Default arg: "." */
+ po_wchars = L".";
+ len = 1;
+ } else {
+ po_wchars = path->wide;
+ len = wcslen(path->wide);
+ }
+ /* The +5 is so we can append "\\*.*\0" */
+ wnamebuf = PyMem_New(wchar_t, len + 5);
+ if (!wnamebuf) {
+ PyErr_NoMemory();
+ goto exit;
+ }
+ wcscpy(wnamebuf, po_wchars);
+ if (len > 0) {
+ wchar_t wch = wnamebuf[len-1];
+ if (wch != SEP && wch != ALTSEP && wch != L':')
+ wnamebuf[len++] = SEP;
+ wcscpy(wnamebuf + len, L"*.*");
+ }
+ if ((list = PyList_New(0)) == NULL) {
+ goto exit;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ hFindFile = FindFirstFileW(wnamebuf, &wFileData);
+ Py_END_ALLOW_THREADS
+ if (hFindFile == INVALID_HANDLE_VALUE) {
+ int error = GetLastError();
+ if (error == ERROR_FILE_NOT_FOUND)
+ goto exit;
+ path_error(path);
+ Py_CLEAR(list);
+ goto exit;
+ }
+ do {
+ /* Skip over . and .. */
+ if (wcscmp(wFileData.cFileName, L".") != 0 &&
+ wcscmp(wFileData.cFileName, L"..") != 0) {
+ v = PyUnicode_FromWideChar(wFileData.cFileName,
+ wcslen(wFileData.cFileName));
+ if (path->narrow && v) {
+ Py_SETREF(v, PyUnicode_EncodeFSDefault(v));
+ }
+ if (v == NULL) {
+ Py_CLEAR(list);
+ break;
+ }
+ if (PyList_Append(list, v) != 0) {
+ Py_DECREF(v);
+ Py_CLEAR(list);
+ break;
+ }
+ Py_DECREF(v);
+ }
+ Py_BEGIN_ALLOW_THREADS
+ result = FindNextFileW(hFindFile, &wFileData);
+ Py_END_ALLOW_THREADS
+ /* FindNextFile sets error to ERROR_NO_MORE_FILES if
+ it got to the end of the directory. */
+ if (!result && GetLastError() != ERROR_NO_MORE_FILES) {
+ path_error(path);
+ Py_CLEAR(list);
+ goto exit;
+ }
+ } while (result == TRUE);
+
+exit:
+ if (hFindFile != INVALID_HANDLE_VALUE) {
+ if (FindClose(hFindFile) == FALSE) {
+ if (list != NULL) {
+ path_error(path);
+ Py_CLEAR(list);
+ }
+ }
+ }
+ PyMem_Free(wnamebuf);
+
+ return list;
+} /* end of _listdir_windows_no_opendir */
+
+#else /* thus POSIX, ie: not (MS_WINDOWS and not HAVE_OPENDIR) */
+
+static PyObject *
+_posix_listdir(path_t *path, PyObject *list)
+{
+ PyObject *v;
+ DIR *dirp = NULL;
+ struct dirent *ep;
+ int return_str; /* if false, return bytes */
+#ifdef HAVE_FDOPENDIR
+ int fd = -1;
+#endif
+
+ errno = 0;
+#ifdef HAVE_FDOPENDIR
+ if (path->fd != -1) {
+ if (HAVE_FDOPENDIR_RUNTIME) {
+ /* closedir() closes the FD, so we duplicate it */
+ fd = _Py_dup(path->fd);
+ if (fd == -1)
+ return NULL;
+
+ return_str = 1;
+
+ Py_BEGIN_ALLOW_THREADS
+ dirp = fdopendir(fd);
+ Py_END_ALLOW_THREADS
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "listdir: path should be string, bytes, os.PathLike or None, not int");
+ return NULL;
+ }
+ }
+ else
+#endif
+ {
+ const char *name;
+ if (path->narrow) {
+ name = path->narrow;
+ /* only return bytes if they specified a bytes object */
+ return_str = !PyBytes_Check(path->object);
+ }
+ else {
+ name = ".";
+ return_str = 1;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ dirp = opendir(name);
+ Py_END_ALLOW_THREADS
+ }
+
+ if (dirp == NULL) {
+ path_error(path);
+ list = NULL;
+#ifdef HAVE_FDOPENDIR
+ if (fd != -1) {
+ Py_BEGIN_ALLOW_THREADS
+ close(fd);
+ Py_END_ALLOW_THREADS
+ }
+#endif
+ goto exit;
+ }
+ if ((list = PyList_New(0)) == NULL) {
+ goto exit;
+ }
+ for (;;) {
+ errno = 0;
+ Py_BEGIN_ALLOW_THREADS
+ ep = readdir(dirp);
+ Py_END_ALLOW_THREADS
+ if (ep == NULL) {
+ if (errno == 0) {
+ break;
+ } else {
+ path_error(path);
+ Py_CLEAR(list);
+ goto exit;
+ }
+ }
+ if (ep->d_name[0] == '.' &&
+ (NAMLEN(ep) == 1 ||
+ (ep->d_name[1] == '.' && NAMLEN(ep) == 2)))
+ continue;
+ if (return_str)
+ v = PyUnicode_DecodeFSDefaultAndSize(ep->d_name, NAMLEN(ep));
+ else
+ v = PyBytes_FromStringAndSize(ep->d_name, NAMLEN(ep));
+ if (v == NULL) {
+ Py_CLEAR(list);
+ break;
+ }
+ if (PyList_Append(list, v) != 0) {
+ Py_DECREF(v);
+ Py_CLEAR(list);
+ break;
+ }
+ Py_DECREF(v);
+ }
+
+exit:
+ if (dirp != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_FDOPENDIR
+ if (fd > -1)
+ rewinddir(dirp);
+#endif
+ closedir(dirp);
+ Py_END_ALLOW_THREADS
+ }
+
+ return list;
+} /* end of _posix_listdir */
+#endif /* which OS */
+
+
+/*[clinic input]
+os.listdir
+
+ path : path_t(nullable=True, allow_fd='PATH_HAVE_FDOPENDIR') = None
+
+Return a list containing the names of the files in the directory.
+
+path can be specified as either str, bytes, or a path-like object. If path is bytes,
+ the filenames returned will also be bytes; in all other circumstances
+ the filenames returned will be str.
+If path is None, uses the path='.'.
+On some platforms, path may also be specified as an open file descriptor;\
+ the file descriptor must refer to a directory.
+ If this functionality is unavailable, using it raises NotImplementedError.
+
+The list is in arbitrary order. It does not include the special
+entries '.' and '..' even if they are present in the directory.
+
+
+[clinic start generated code]*/
+
+static PyObject *
+os_listdir_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=293045673fcd1a75 input=e3f58030f538295d]*/
+{
+ if (PySys_Audit("os.listdir", "O",
+ path->object ? path->object : Py_None) < 0) {
+ return NULL;
+ }
+#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
+ return _listdir_windows_no_opendir(path, NULL);
+#else
+ return _posix_listdir(path, NULL);
+#endif
+}
+
+
+#ifdef MS_WINDOWS
+
+/*[clinic input]
+os.listdrives
+
+Return a list containing the names of drives in the system.
+
+A drive name typically looks like 'C:\\'.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_listdrives_impl(PyObject *module)
+/*[clinic end generated code: output=aaece9dacdf682b5 input=1af9ccc9e583798e]*/
+{
+ /* Number of possible drives is limited, so 256 should always be enough.
+ On the day when it is not, listmounts() will have to be used. */
+ wchar_t buffer[256];
+ DWORD buflen = Py_ARRAY_LENGTH(buffer);
+ PyObject *result = NULL;
+ if (PySys_Audit("os.listdrives", NULL) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS;
+ buflen = GetLogicalDriveStringsW(buflen, buffer);
+ Py_END_ALLOW_THREADS;
+
+ if (!buflen) {
+ PyErr_SetFromWindowsErr(0);
+ return NULL;
+ } else if (buflen >= Py_ARRAY_LENGTH(buffer)) {
+ PyErr_SetFromWindowsErr(ERROR_MORE_DATA);
+ return NULL;
+ }
+
+ /* buflen includes a null terminator, so remove it */
+ PyObject *str = PyUnicode_FromWideChar(buffer, buflen - 1);
+ if (str) {
+ PyObject *nullchar = PyUnicode_FromStringAndSize("\0", 1);
+ if (nullchar) {
+ result = PyUnicode_Split(str, nullchar, -1);
+ Py_DECREF(nullchar);
+ }
+ Py_DECREF(str);
+ }
+ return result;
+}
+
+/*[clinic input]
+os.listvolumes
+
+Return a list containing the volumes in the system.
+
+Volumes are typically represented as a GUID path.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_listvolumes_impl(PyObject *module)
+/*[clinic end generated code: output=534e10ea2bf9d386 input=f6e4e70371f11e99]*/
+{
+ PyObject *result = PyList_New(0);
+ HANDLE find = INVALID_HANDLE_VALUE;
+ wchar_t buffer[MAX_PATH + 1];
+ if (!result) {
+ return NULL;
+ }
+ if (PySys_Audit("os.listvolumes", NULL) < 0) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ int err = 0;
+ Py_BEGIN_ALLOW_THREADS;
+ find = FindFirstVolumeW(buffer, Py_ARRAY_LENGTH(buffer));
+ if (find == INVALID_HANDLE_VALUE) {
+ err = GetLastError();
+ }
+ Py_END_ALLOW_THREADS;
+
+ while (!err) {
+ PyObject *s = PyUnicode_FromWideChar(buffer, -1);
+ if (!s || PyList_Append(result, s) < 0) {
+ Py_XDECREF(s);
+ Py_CLEAR(result);
+ break;
+ }
+ Py_DECREF(s);
+
+ Py_BEGIN_ALLOW_THREADS;
+ if (!FindNextVolumeW(find, buffer, Py_ARRAY_LENGTH(buffer))) {
+ err = GetLastError();
+ }
+ Py_END_ALLOW_THREADS;
+ }
+
+ if (find != INVALID_HANDLE_VALUE) {
+ Py_BEGIN_ALLOW_THREADS;
+ FindVolumeClose(find);
+ Py_END_ALLOW_THREADS;
+ }
+ if (err && err != ERROR_NO_MORE_FILES) {
+ PyErr_SetFromWindowsErr(err);
+ Py_XDECREF(result);
+ result = NULL;
+ }
+ return result;
+}
+
+
+/*[clinic input]
+os.listmounts
+
+ volume: path_t
+
+Return a list containing mount points for a particular volume.
+
+'volume' should be a GUID path as returned from os.listvolumes.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_listmounts_impl(PyObject *module, path_t *volume)
+/*[clinic end generated code: output=06da49679de4512e input=a8a27178e3f67845]*/
+{
+ wchar_t default_buffer[MAX_PATH + 1];
+ DWORD buflen = Py_ARRAY_LENGTH(default_buffer);
+ LPWSTR buffer = default_buffer;
+ DWORD attributes;
+ PyObject *str = NULL;
+ PyObject *nullchar = NULL;
+ PyObject *result = NULL;
+
+ /* Ensure we have a valid volume path before continuing */
+ Py_BEGIN_ALLOW_THREADS
+ attributes = GetFileAttributesW(volume->wide);
+ Py_END_ALLOW_THREADS
+ if (attributes == INVALID_FILE_ATTRIBUTES &&
+ GetLastError() == ERROR_UNRECOGNIZED_VOLUME)
+ {
+ return PyErr_SetFromWindowsErr(ERROR_UNRECOGNIZED_VOLUME);
+ }
+
+ if (PySys_Audit("os.listmounts", "O", volume->object) < 0) {
+ return NULL;
+ }
+
+ while (1) {
+ BOOL success;
+ Py_BEGIN_ALLOW_THREADS
+ success = GetVolumePathNamesForVolumeNameW(volume->wide, buffer,
+ buflen, &buflen);
+ Py_END_ALLOW_THREADS
+ if (success) {
+ break;
+ }
+ if (GetLastError() != ERROR_MORE_DATA) {
+ PyErr_SetFromWindowsErr(0);
+ goto exit;
+ }
+ if (buffer != default_buffer) {
+ PyMem_Free((void *)buffer);
+ }
+ buffer = (wchar_t*)PyMem_Malloc(sizeof(wchar_t) * buflen);
+ if (!buffer) {
+ PyErr_NoMemory();
+ goto exit;
+ }
+ }
+ if (buflen < 2) {
+ result = PyList_New(0);
+ goto exit;
+ }
+ // buflen includes two null terminators, one for the last string
+ // and one for the array of strings.
+ str = PyUnicode_FromWideChar(buffer, buflen - 2);
+ nullchar = PyUnicode_FromStringAndSize("\0", 1);
+ if (str && nullchar) {
+ result = PyUnicode_Split(str, nullchar, -1);
+ }
+exit:
+ if (buffer != default_buffer) {
+ PyMem_Free(buffer);
+ }
+ Py_XDECREF(nullchar);
+ Py_XDECREF(str);
+ return result;
+}
+
+
+/*[clinic input]
+os._path_isdevdrive
+
+ path: path_t
+
+Determines whether the specified path is on a Windows Dev Drive.
+
+[clinic start generated code]*/
+
+static PyObject *
+os__path_isdevdrive_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=1f437ea6677433a2 input=ee83e4996a48e23d]*/
+{
+#ifndef PERSISTENT_VOLUME_STATE_DEV_VOLUME
+ /* This flag will be documented at
+ https://learn.microsoft.com/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_fs_persistent_volume_information
+ after release, and will be available in the latest WinSDK.
+ We include the flag to avoid a specific version dependency
+ on the latest WinSDK. */
+ const int PERSISTENT_VOLUME_STATE_DEV_VOLUME = 0x00002000;
+#endif
+ int err = 0;
+ PyObject *r = NULL;
+ wchar_t volume[MAX_PATH];
+
+ Py_BEGIN_ALLOW_THREADS
+ if (!GetVolumePathNameW(path->wide, volume, MAX_PATH)) {
+ /* invalid path of some kind */
+ /* Note that this also includes the case where a volume is mounted
+ in a path longer than 260 characters. This is likely to be rare
+ and problematic for other reasons, so a (soft) failure in this
+ check seems okay. */
+ err = GetLastError();
+ } else if (GetDriveTypeW(volume) != DRIVE_FIXED) {
+ /* only care about local dev drives */
+ r = Py_False;
+ } else {
+ HANDLE hVolume = CreateFileW(
+ volume,
+ FILE_READ_ATTRIBUTES,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS,
+ NULL
+ );
+ if (hVolume == INVALID_HANDLE_VALUE) {
+ err = GetLastError();
+ } else {
+ FILE_FS_PERSISTENT_VOLUME_INFORMATION volumeState = {0};
+ volumeState.Version = 1;
+ volumeState.FlagMask = PERSISTENT_VOLUME_STATE_DEV_VOLUME;
+ if (!DeviceIoControl(
+ hVolume,
+ FSCTL_QUERY_PERSISTENT_VOLUME_STATE,
+ &volumeState,
+ sizeof(volumeState),
+ &volumeState,
+ sizeof(volumeState),
+ NULL,
+ NULL
+ )) {
+ err = GetLastError();
+ }
+ CloseHandle(hVolume);
+ if (err == ERROR_INVALID_PARAMETER) {
+ /* not supported on this platform */
+ r = Py_False;
+ } else if (!err) {
+ r = (volumeState.VolumeFlags & PERSISTENT_VOLUME_STATE_DEV_VOLUME)
+ ? Py_True : Py_False;
+ }
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ if (err) {
+ PyErr_SetFromWindowsErr(err);
+ return NULL;
+ }
+
+ if (r) {
+ return Py_NewRef(r);
+ }
+
+ return NULL;
+}
+
+
+int
+_PyOS_getfullpathname(const wchar_t *path, wchar_t **abspath_p)
+{
+ wchar_t woutbuf[MAX_PATH], *woutbufp = woutbuf;
+ DWORD result;
+
+ result = GetFullPathNameW(path,
+ Py_ARRAY_LENGTH(woutbuf), woutbuf,
+ NULL);
+ if (!result) {
+ return -1;
+ }
+
+ if (result >= Py_ARRAY_LENGTH(woutbuf)) {
+ if ((size_t)result <= (size_t)PY_SSIZE_T_MAX / sizeof(wchar_t)) {
+ woutbufp = PyMem_RawMalloc((size_t)result * sizeof(wchar_t));
+ }
+ else {
+ woutbufp = NULL;
+ }
+ if (!woutbufp) {
+ *abspath_p = NULL;
+ return 0;
+ }
+
+ result = GetFullPathNameW(path, result, woutbufp, NULL);
+ if (!result) {
+ PyMem_RawFree(woutbufp);
+ return -1;
+ }
+ }
+
+ if (woutbufp != woutbuf) {
+ *abspath_p = woutbufp;
+ return 0;
+ }
+
+ *abspath_p = _PyMem_RawWcsdup(woutbufp);
+ return 0;
+}
+
+
+/* A helper function for abspath on win32 */
+/*[clinic input]
+os._getfullpathname
+
+ path: path_t
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+os__getfullpathname_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=bb8679d56845bc9b input=332ed537c29d0a3e]*/
+{
+ wchar_t *abspath;
+
+ if (_PyOS_getfullpathname(path->wide, &abspath) < 0) {
+ return win32_error_object("GetFullPathNameW", path->object);
+ }
+ if (abspath == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ PyObject *str = PyUnicode_FromWideChar(abspath, wcslen(abspath));
+ PyMem_RawFree(abspath);
+ if (str == NULL) {
+ return NULL;
+ }
+ if (path->narrow) {
+ Py_SETREF(str, PyUnicode_EncodeFSDefault(str));
+ }
+ return str;
+}
+
+
+/*[clinic input]
+os._getfinalpathname
+
+ path: path_t
+ /
+
+A helper function for samepath on windows.
+[clinic start generated code]*/
+
+static PyObject *
+os__getfinalpathname_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=621a3c79bc29ebfa input=2b6b6c7cbad5fb84]*/
+{
+ HANDLE hFile;
+ wchar_t buf[MAXPATHLEN], *target_path = buf;
+ int buf_size = Py_ARRAY_LENGTH(buf);
+ int result_length;
+ PyObject *result;
+
+ Py_BEGIN_ALLOW_THREADS
+ hFile = CreateFileW(
+ path->wide,
+ 0, /* desired access */
+ 0, /* share mode */
+ NULL, /* security attributes */
+ OPEN_EXISTING,
+ /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
+ FILE_FLAG_BACKUP_SEMANTICS,
+ NULL);
+ Py_END_ALLOW_THREADS
+
+ if (hFile == INVALID_HANDLE_VALUE) {
+ return win32_error_object("CreateFileW", path->object);
+ }
+
+ /* We have a good handle to the target, use it to determine the
+ target path name. */
+ while (1) {
+ Py_BEGIN_ALLOW_THREADS
+ result_length = GetFinalPathNameByHandleW(hFile, target_path,
+ buf_size, VOLUME_NAME_DOS);
+ Py_END_ALLOW_THREADS
+
+ if (!result_length) {
+ result = win32_error_object("GetFinalPathNameByHandleW",
+ path->object);
+ goto cleanup;
+ }
+
+ if (result_length < buf_size) {
+ break;
+ }
+
+ wchar_t *tmp;
+ tmp = PyMem_Realloc(target_path != buf ? target_path : NULL,
+ result_length * sizeof(*tmp));
+ if (!tmp) {
+ result = PyErr_NoMemory();
+ goto cleanup;
+ }
+
+ buf_size = result_length;
+ target_path = tmp;
+ }
+
+ result = PyUnicode_FromWideChar(target_path, result_length);
+ if (result && path->narrow) {
+ Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
+ }
+
+cleanup:
+ if (target_path != buf) {
+ PyMem_Free(target_path);
+ }
+ CloseHandle(hFile);
+ return result;
+}
+
+
+/*[clinic input]
+os._getvolumepathname
+
+ path: path_t
+
+A helper function for ismount on Win32.
+[clinic start generated code]*/
+
+static PyObject *
+os__getvolumepathname_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=804c63fd13a1330b input=722b40565fa21552]*/
+{
+ PyObject *result;
+ wchar_t *mountpath=NULL;
+ size_t buflen;
+ BOOL ret;
+
+ /* Volume path should be shorter than entire path */
+ buflen = Py_MAX(path->length, MAX_PATH);
+
+ if (buflen > PY_DWORD_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "path too long");
+ return NULL;
+ }
+
+ mountpath = PyMem_New(wchar_t, buflen);
+ if (mountpath == NULL)
+ return PyErr_NoMemory();
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = GetVolumePathNameW(path->wide, mountpath,
+ Py_SAFE_DOWNCAST(buflen, size_t, DWORD));
+ Py_END_ALLOW_THREADS
+
+ if (!ret) {
+ result = win32_error_object("_getvolumepathname", path->object);
+ goto exit;
+ }
+ result = PyUnicode_FromWideChar(mountpath, wcslen(mountpath));
+ if (path->narrow)
+ Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
+
+exit:
+ PyMem_Free(mountpath);
+ return result;
+}
+
+
+/*[clinic input]
+os._path_splitroot
+
+ path: path_t
+
+Removes everything after the root on Win32.
+[clinic start generated code]*/
+
+static PyObject *
+os__path_splitroot_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=ab7f1a88b654581c input=dc93b1d3984cffb6]*/
+{
+ wchar_t *buffer;
+ wchar_t *end;
+ PyObject *result = NULL;
+ HRESULT ret;
+
+ buffer = (wchar_t*)PyMem_Malloc(sizeof(wchar_t) * (wcslen(path->wide) + 1));
+ if (!buffer) {
+ return NULL;
+ }
+ wcscpy(buffer, path->wide);
+ for (wchar_t *p = wcschr(buffer, L'/'); p; p = wcschr(p, L'/')) {
+ *p = L'\\';
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = PathCchSkipRoot(buffer, &end);
+ Py_END_ALLOW_THREADS
+ if (FAILED(ret)) {
+ result = Py_BuildValue("sO", "", path->object);
+ } else if (end != buffer) {
+ size_t rootLen = (size_t)(end - buffer);
+ result = Py_BuildValue("NN",
+ PyUnicode_FromWideChar(path->wide, rootLen),
+ PyUnicode_FromWideChar(path->wide + rootLen, -1)
+ );
+ } else {
+ result = Py_BuildValue("Os", path->object, "");
+ }
+ PyMem_Free(buffer);
+
+ return result;
+}
+
+
+/*[clinic input]
+os._path_isdir
+
+ s: 'O'
+
+Return true if the pathname refers to an existing directory.
+
+[clinic start generated code]*/
+
+static PyObject *
+os__path_isdir_impl(PyObject *module, PyObject *s)
+/*[clinic end generated code: output=9d87ab3c8b8a4e61 input=c17f7ef21d22d64e]*/
+{
+ HANDLE hfile;
+ BOOL close_file = TRUE;
+ FILE_BASIC_INFO info;
+ path_t _path = PATH_T_INITIALIZE("isdir", "s", 0, 1);
+ int result;
+ BOOL slow_path = TRUE;
+ FILE_STAT_BASIC_INFORMATION statInfo;
+
+ if (!path_converter(s, &_path)) {
+ path_cleanup(&_path);
+ if (PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ Py_RETURN_FALSE;
+ }
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ if (_path.wide) {
+ if (_Py_GetFileInformationByName(_path.wide, FileStatBasicByNameInfo,
+ &statInfo, sizeof(statInfo))) {
+ if (!(statInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ slow_path = FALSE;
+ result = statInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ } else if (!(statInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
+ slow_path = FALSE;
+ result = 0;
+ }
+ } else if (_Py_GetFileInformationByName_ErrorIsTrustworthy(GetLastError())) {
+ slow_path = FALSE;
+ result = 0;
+ }
+ }
+ if (slow_path) {
+ if (_path.fd != -1) {
+ hfile = _Py_get_osfhandle_noraise(_path.fd);
+ close_file = FALSE;
+ }
+ else {
+ hfile = CreateFileW(_path.wide, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ }
+ if (hfile != INVALID_HANDLE_VALUE) {
+ if (GetFileInformationByHandleEx(hfile, FileBasicInfo, &info,
+ sizeof(info)))
+ {
+ result = info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ }
+ else {
+ result = 0;
+ }
+ if (close_file) {
+ CloseHandle(hfile);
+ }
+ }
+ else {
+ STRUCT_STAT st;
+ switch (GetLastError()) {
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ case ERROR_CANT_ACCESS_FILE:
+ case ERROR_INVALID_PARAMETER:
+ if (STAT(_path.wide, &st)) {
+ result = 0;
+ }
+ else {
+ result = S_ISDIR(st.st_mode);
+ }
+ break;
+ default:
+ result = 0;
+ }
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ path_cleanup(&_path);
+ if (result) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+
+/*[clinic input]
+os._path_isfile
+
+ path: 'O'
+
+Test whether a path is a regular file
+
+[clinic start generated code]*/
+
+static PyObject *
+os__path_isfile_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=2394ed7c4b5cfd85 input=de22d74960ade365]*/
+{
+ HANDLE hfile;
+ BOOL close_file = TRUE;
+ FILE_BASIC_INFO info;
+ path_t _path = PATH_T_INITIALIZE("isfile", "path", 0, 1);
+ int result;
+ BOOL slow_path = TRUE;
+ FILE_STAT_BASIC_INFORMATION statInfo;
+
+ if (!path_converter(path, &_path)) {
+ path_cleanup(&_path);
+ if (PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ Py_RETURN_FALSE;
+ }
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ if (_path.wide) {
+ if (_Py_GetFileInformationByName(_path.wide, FileStatBasicByNameInfo,
+ &statInfo, sizeof(statInfo))) {
+ if (!(statInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ slow_path = FALSE;
+ result = !(statInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+ } else if (statInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ slow_path = FALSE;
+ result = 0;
+ }
+ } else if (_Py_GetFileInformationByName_ErrorIsTrustworthy(GetLastError())) {
+ slow_path = FALSE;
+ result = 0;
+ }
+ }
+ if (slow_path) {
+ if (_path.fd != -1) {
+ hfile = _Py_get_osfhandle_noraise(_path.fd);
+ close_file = FALSE;
+ }
+ else {
+ hfile = CreateFileW(_path.wide, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ }
+ if (hfile != INVALID_HANDLE_VALUE) {
+ if (GetFileInformationByHandleEx(hfile, FileBasicInfo, &info,
+ sizeof(info)))
+ {
+ result = !(info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY);
+ }
+ else {
+ result = 0;
+ }
+ if (close_file) {
+ CloseHandle(hfile);
+ }
+ }
+ else {
+ STRUCT_STAT st;
+ switch (GetLastError()) {
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ case ERROR_CANT_ACCESS_FILE:
+ case ERROR_INVALID_PARAMETER:
+ if (STAT(_path.wide, &st)) {
+ result = 0;
+ }
+ else {
+ result = S_ISREG(st.st_mode);
+ }
+ break;
+ default:
+ result = 0;
+ }
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ path_cleanup(&_path);
+ if (result) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+
+/*[clinic input]
+os._path_exists
+
+ path: 'O'
+
+Test whether a path exists. Returns False for broken symbolic links
+
+[clinic start generated code]*/
+
+static PyObject *
+os__path_exists_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=f508c3b35e13a249 input=380f77cdfa0f7ae8]*/
+{
+ HANDLE hfile;
+ BOOL close_file = TRUE;
+ path_t _path = PATH_T_INITIALIZE("exists", "path", 0, 1);
+ int result;
+ BOOL slow_path = TRUE;
+ FILE_STAT_BASIC_INFORMATION statInfo;
+
+ if (!path_converter(path, &_path)) {
+ path_cleanup(&_path);
+ if (PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ Py_RETURN_FALSE;
+ }
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ if (_path.wide) {
+ if (_Py_GetFileInformationByName(_path.wide, FileStatBasicByNameInfo,
+ &statInfo, sizeof(statInfo))) {
+ if (!(statInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ slow_path = FALSE;
+ result = 1;
+ }
+ } else if (_Py_GetFileInformationByName_ErrorIsTrustworthy(GetLastError())) {
+ slow_path = FALSE;
+ result = 0;
+ }
+ }
+ if (slow_path) {
+ if (_path.fd != -1) {
+ hfile = _Py_get_osfhandle_noraise(_path.fd);
+ close_file = FALSE;
+ }
+ else {
+ hfile = CreateFileW(_path.wide, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ }
+ if (hfile != INVALID_HANDLE_VALUE) {
+ result = 1;
+ if (close_file) {
+ CloseHandle(hfile);
+ }
+ }
+ else {
+ STRUCT_STAT st;
+ switch (GetLastError()) {
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ case ERROR_CANT_ACCESS_FILE:
+ case ERROR_INVALID_PARAMETER:
+ if (STAT(_path.wide, &st)) {
+ result = 0;
+ }
+ else {
+ result = 1;
+ }
+ break;
+ default:
+ result = 0;
+ }
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ path_cleanup(&_path);
+ if (result) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+
+/*[clinic input]
+os._path_islink
+
+ path: 'O'
+
+Test whether a path is a symbolic link
+
+[clinic start generated code]*/
+
+static PyObject *
+os__path_islink_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=6d8640b1a390c054 input=38a3cb937ccf59bf]*/
+{
+ HANDLE hfile;
+ BOOL close_file = TRUE;
+ FILE_ATTRIBUTE_TAG_INFO info;
+ path_t _path = PATH_T_INITIALIZE("islink", "path", 0, 1);
+ int result;
+ BOOL slow_path = TRUE;
+ FILE_STAT_BASIC_INFORMATION statInfo;
+
+ if (!path_converter(path, &_path)) {
+ path_cleanup(&_path);
+ if (PyErr_ExceptionMatches(PyExc_ValueError)) {
+ PyErr_Clear();
+ Py_RETURN_FALSE;
+ }
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ if (_path.wide) {
+ if (_Py_GetFileInformationByName(_path.wide, FileStatBasicByNameInfo,
+ &statInfo, sizeof(statInfo))) {
+ slow_path = FALSE;
+ if (statInfo.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ result = (statInfo.ReparseTag == IO_REPARSE_TAG_SYMLINK);
+ }
+ else {
+ result = 0;
+ }
+ } else if (_Py_GetFileInformationByName_ErrorIsTrustworthy(GetLastError())) {
+ slow_path = FALSE;
+ result = 0;
+ }
+ }
+ if (slow_path) {
+ if (_path.fd != -1) {
+ hfile = _Py_get_osfhandle_noraise(_path.fd);
+ close_file = FALSE;
+ }
+ else {
+ hfile = CreateFileW(_path.wide, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS,
+ NULL);
+ }
+ if (hfile != INVALID_HANDLE_VALUE) {
+ if (GetFileInformationByHandleEx(hfile, FileAttributeTagInfo, &info,
+ sizeof(info)))
+ {
+ result = (info.ReparseTag == IO_REPARSE_TAG_SYMLINK);
+ }
+ else {
+ result = 0;
+ }
+ if (close_file) {
+ CloseHandle(hfile);
+ }
+ }
+ else {
+ STRUCT_STAT st;
+ switch (GetLastError()) {
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ case ERROR_CANT_ACCESS_FILE:
+ case ERROR_INVALID_PARAMETER:
+ if (LSTAT(_path.wide, &st)) {
+ result = 0;
+ }
+ else {
+ result = S_ISLNK(st.st_mode);
+ }
+ break;
+ default:
+ result = 0;
+ }
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ path_cleanup(&_path);
+ if (result) {
+ Py_RETURN_TRUE;
+ }
+ Py_RETURN_FALSE;
+}
+
+#endif /* MS_WINDOWS */
+
+
+/*[clinic input]
+os._path_normpath
+
+ path: object
+
+Basic path normalization.
+[clinic start generated code]*/
+
+static PyObject *
+os__path_normpath_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=b94d696d828019da input=5e90c39e12549dc0]*/
+{
+ if (!PyUnicode_Check(path)) {
+ PyErr_Format(PyExc_TypeError, "expected 'str', not '%.200s'",
+ Py_TYPE(path)->tp_name);
+ return NULL;
+ }
+ Py_ssize_t len;
+ wchar_t *buffer = PyUnicode_AsWideCharString(path, &len);
+ if (!buffer) {
+ return NULL;
+ }
+ Py_ssize_t norm_len;
+ wchar_t *norm_path = _Py_normpath_and_size(buffer, len, &norm_len);
+ PyObject *result = PyUnicode_FromWideChar(norm_path, norm_len);
+ PyMem_Free(buffer);
+ return result;
+}
+
+/*[clinic input]
+os.mkdir
+
+ path : path_t
+
+ mode: int = 0o777
+
+ *
+
+ dir_fd : dir_fd(requires='mkdirat') = None
+
+# "mkdir(path, mode=0o777, *, dir_fd=None)\n\n\
+
+Create a directory.
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+
+The mode argument is ignored on Windows. Where it is used, the current umask
+value is first masked out.
+[clinic start generated code]*/
+
+static PyObject *
+os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd)
+/*[clinic end generated code: output=a70446903abe821f input=a61722e1576fab03]*/
+{
+ int result;
+#ifdef HAVE_MKDIRAT
+ int mkdirat_unavailable = 0;
+#endif
+
+ if (PySys_Audit("os.mkdir", "Oii", path->object, mode,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ result = CreateDirectoryW(path->wide, NULL);
+ Py_END_ALLOW_THREADS
+
+ if (!result)
+ return path_error(path);
+#else
+ Py_BEGIN_ALLOW_THREADS
+#if HAVE_MKDIRAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_MKDIRAT_RUNTIME) {
+ result = mkdirat(dir_fd, path->narrow, mode);
+
+ } else {
+ mkdirat_unavailable = 1;
+ }
+ } else
+#endif
+#if defined(__WATCOMC__) && !defined(__QNX__)
+ result = mkdir(path->narrow);
+#else
+ result = mkdir(path->narrow, mode);
+#endif
+ Py_END_ALLOW_THREADS
+
+#if HAVE_MKDIRAT
+ if (mkdirat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result < 0)
+ return path_error(path);
+#endif /* MS_WINDOWS */
+ Py_RETURN_NONE;
+}
+
+
+/* sys/resource.h is needed for at least: wait3(), wait4(), broken nice. */
+#if defined(HAVE_SYS_RESOURCE_H)
+#include <sys/resource.h>
+#endif
+
+
+#ifdef HAVE_NICE
+/*[clinic input]
+os.nice
+
+ increment: int
+ /
+
+Add increment to the priority of process and return the new priority.
+[clinic start generated code]*/
+
+static PyObject *
+os_nice_impl(PyObject *module, int increment)
+/*[clinic end generated code: output=9dad8a9da8109943 input=864be2d402a21da2]*/
+{
+ int value;
+
+ /* There are two flavours of 'nice': one that returns the new
+ priority (as required by almost all standards out there) and the
+ Linux/FreeBSD one, which returns '0' on success and advices
+ the use of getpriority() to get the new priority.
+
+ If we are of the nice family that returns the new priority, we
+ need to clear errno before the call, and check if errno is filled
+ before calling posix_error() on a returnvalue of -1, because the
+ -1 may be the actual new priority! */
+
+ errno = 0;
+ value = nice(increment);
+#if defined(HAVE_BROKEN_NICE) && defined(HAVE_GETPRIORITY)
+ if (value == 0)
+ value = getpriority(PRIO_PROCESS, 0);
+#endif
+ if (value == -1 && errno != 0)
+ /* either nice() or getpriority() returned an error */
+ return posix_error();
+ return PyLong_FromLong((long) value);
+}
+#endif /* HAVE_NICE */
+
+
+#ifdef HAVE_GETPRIORITY
+/*[clinic input]
+os.getpriority
+
+ which: int
+ who: int
+
+Return program scheduling priority.
+[clinic start generated code]*/
+
+static PyObject *
+os_getpriority_impl(PyObject *module, int which, int who)
+/*[clinic end generated code: output=c41b7b63c7420228 input=9be615d40e2544ef]*/
+{
+ int retval;
+
+ errno = 0;
+ retval = getpriority(which, who);
+ if (errno != 0)
+ return posix_error();
+ return PyLong_FromLong((long)retval);
+}
+#endif /* HAVE_GETPRIORITY */
+
+
+#ifdef HAVE_SETPRIORITY
+/*[clinic input]
+os.setpriority
+
+ which: int
+ who: int
+ priority: int
+
+Set program scheduling priority.
+[clinic start generated code]*/
+
+static PyObject *
+os_setpriority_impl(PyObject *module, int which, int who, int priority)
+/*[clinic end generated code: output=3d910d95a7771eb2 input=710ccbf65b9dc513]*/
+{
+ int retval;
+
+ retval = setpriority(which, who, priority);
+ if (retval == -1)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETPRIORITY */
+
+
+static PyObject *
+internal_rename(path_t *src, path_t *dst, int src_dir_fd, int dst_dir_fd, int is_replace)
+{
+ const char *function_name = is_replace ? "replace" : "rename";
+ int dir_fd_specified;
+
+#ifdef HAVE_RENAMEAT
+ int renameat_unavailable = 0;
+#endif
+
+#ifdef MS_WINDOWS
+ BOOL result;
+ int flags = is_replace ? MOVEFILE_REPLACE_EXISTING : 0;
+#else
+ int result;
+#endif
+
+ dir_fd_specified = (src_dir_fd != DEFAULT_DIR_FD) ||
+ (dst_dir_fd != DEFAULT_DIR_FD);
+#ifndef HAVE_RENAMEAT
+ if (dir_fd_specified) {
+ argument_unavailable_error(function_name, "src_dir_fd and dst_dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (PySys_Audit("os.rename", "OOii", src->object, dst->object,
+ src_dir_fd == DEFAULT_DIR_FD ? -1 : src_dir_fd,
+ dst_dir_fd == DEFAULT_DIR_FD ? -1 : dst_dir_fd) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ result = MoveFileExW(src->wide, dst->wide, flags);
+ Py_END_ALLOW_THREADS
+
+ if (!result)
+ return path_error2(src, dst);
+
+#else
+ if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: src and dst must be the same type", function_name);
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_RENAMEAT
+ if (dir_fd_specified) {
+ if (HAVE_RENAMEAT_RUNTIME) {
+ result = renameat(src_dir_fd, src->narrow, dst_dir_fd, dst->narrow);
+ } else {
+ renameat_unavailable = 1;
+ }
+ } else
+#endif
+ result = rename(src->narrow, dst->narrow);
+ Py_END_ALLOW_THREADS
+
+
+#ifdef HAVE_RENAMEAT
+ if (renameat_unavailable) {
+ argument_unavailable_error(function_name, "src_dir_fd and dst_dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result)
+ return path_error2(src, dst);
+#endif
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+os.rename
+
+ src : path_t
+ dst : path_t
+ *
+ src_dir_fd : dir_fd = None
+ dst_dir_fd : dir_fd = None
+
+Rename a file or directory.
+
+If either src_dir_fd or dst_dir_fd is not None, it should be a file
+ descriptor open to a directory, and the respective path string (src or dst)
+ should be relative; the path will then be relative to that directory.
+src_dir_fd and dst_dir_fd, may not be implemented on your platform.
+ If they are unavailable, using them will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_rename_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
+ int dst_dir_fd)
+/*[clinic end generated code: output=59e803072cf41230 input=faa61c847912c850]*/
+{
+ return internal_rename(src, dst, src_dir_fd, dst_dir_fd, 0);
+}
+
+
+/*[clinic input]
+os.replace = os.rename
+
+Rename a file or directory, overwriting the destination.
+
+If either src_dir_fd or dst_dir_fd is not None, it should be a file
+ descriptor open to a directory, and the respective path string (src or dst)
+ should be relative; the path will then be relative to that directory.
+src_dir_fd and dst_dir_fd, may not be implemented on your platform.
+ If they are unavailable, using them will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_replace_impl(PyObject *module, path_t *src, path_t *dst, int src_dir_fd,
+ int dst_dir_fd)
+/*[clinic end generated code: output=1968c02e7857422b input=c003f0def43378ef]*/
+{
+ return internal_rename(src, dst, src_dir_fd, dst_dir_fd, 1);
+}
+
+
+/*[clinic input]
+os.rmdir
+
+ path: path_t
+ *
+ dir_fd: dir_fd(requires='unlinkat') = None
+
+Remove a directory.
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_rmdir_impl(PyObject *module, path_t *path, int dir_fd)
+/*[clinic end generated code: output=080eb54f506e8301 input=38c8b375ca34a7e2]*/
+{
+ int result;
+#ifdef HAVE_UNLINKAT
+ int unlinkat_unavailable = 0;
+#endif
+
+ if (PySys_Audit("os.rmdir", "Oi", path->object,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef MS_WINDOWS
+ /* Windows, success=1, UNIX, success=0 */
+ result = !RemoveDirectoryW(path->wide);
+#else
+#ifdef HAVE_UNLINKAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_UNLINKAT_RUNTIME) {
+ result = unlinkat(dir_fd, path->narrow, AT_REMOVEDIR);
+ } else {
+ unlinkat_unavailable = 1;
+ result = -1;
+ }
+ } else
+#endif
+ result = rmdir(path->narrow);
+#endif
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_UNLINKAT
+ if (unlinkat_unavailable) {
+ argument_unavailable_error("rmdir", "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result)
+ return path_error(path);
+
+ Py_RETURN_NONE;
+}
+
+
+#ifdef HAVE_SYSTEM
+#ifdef MS_WINDOWS
+/*[clinic input]
+os.system -> long
+
+ command: Py_UNICODE
+
+Execute the command in a subshell.
+[clinic start generated code]*/
+
+static long
+os_system_impl(PyObject *module, const Py_UNICODE *command)
+/*[clinic end generated code: output=5b7c3599c068ca42 input=303f5ce97df606b0]*/
+{
+ long result;
+
+ if (PySys_Audit("os.system", "(u)", command) < 0) {
+ return -1;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ result = _wsystem(command);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ return result;
+}
+#else /* MS_WINDOWS */
+/*[clinic input]
+os.system -> long
+
+ command: FSConverter
+
+Execute the command in a subshell.
+[clinic start generated code]*/
+
+static long
+os_system_impl(PyObject *module, PyObject *command)
+/*[clinic end generated code: output=290fc437dd4f33a0 input=86a58554ba6094af]*/
+{
+ long result;
+ const char *bytes = PyBytes_AsString(command);
+
+ if (PySys_Audit("os.system", "(O)", command) < 0) {
+ return -1;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ result = system(bytes);
+ Py_END_ALLOW_THREADS
+ return result;
+}
+#endif
+#endif /* HAVE_SYSTEM */
+
+
+#ifdef HAVE_UMASK
+/*[clinic input]
+os.umask
+
+ mask: int
+ /
+
+Set the current numeric umask and return the previous umask.
+[clinic start generated code]*/
+
+static PyObject *
+os_umask_impl(PyObject *module, int mask)
+/*[clinic end generated code: output=a2e33ce3bc1a6e33 input=ab6bfd9b24d8a7e8]*/
+{
+ int i = (int)umask(mask);
+ if (i < 0)
+ return posix_error();
+ return PyLong_FromLong((long)i);
+}
+#endif
+
+#ifdef MS_WINDOWS
+
+/* override the default DeleteFileW behavior so that directory
+symlinks can be removed with this function, the same as with
+Unix symlinks */
+BOOL WINAPI Py_DeleteFileW(LPCWSTR lpFileName)
+{
+ WIN32_FILE_ATTRIBUTE_DATA info;
+ WIN32_FIND_DATAW find_data;
+ HANDLE find_data_handle;
+ int is_directory = 0;
+ int is_link = 0;
+
+ if (GetFileAttributesExW(lpFileName, GetFileExInfoStandard, &info)) {
+ is_directory = info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+
+ /* Get WIN32_FIND_DATA structure for the path to determine if
+ it is a symlink */
+ if(is_directory &&
+ info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ find_data_handle = FindFirstFileW(lpFileName, &find_data);
+
+ if(find_data_handle != INVALID_HANDLE_VALUE) {
+ /* IO_REPARSE_TAG_SYMLINK if it is a symlink and
+ IO_REPARSE_TAG_MOUNT_POINT if it is a junction point. */
+ is_link = find_data.dwReserved0 == IO_REPARSE_TAG_SYMLINK ||
+ find_data.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT;
+ FindClose(find_data_handle);
+ }
+ }
+ }
+
+ if (is_directory && is_link)
+ return RemoveDirectoryW(lpFileName);
+
+ return DeleteFileW(lpFileName);
+}
+#endif /* MS_WINDOWS */
+
+
+/*[clinic input]
+os.unlink
+
+ path: path_t
+ *
+ dir_fd: dir_fd(requires='unlinkat')=None
+
+Remove a file (same as remove()).
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_unlink_impl(PyObject *module, path_t *path, int dir_fd)
+/*[clinic end generated code: output=621797807b9963b1 input=d7bcde2b1b2a2552]*/
+{
+ int result;
+#ifdef HAVE_UNLINKAT
+ int unlinkat_unavailable = 0;
+#endif
+
+ if (PySys_Audit("os.remove", "Oi", path->object,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef MS_WINDOWS
+ /* Windows, success=1, UNIX, success=0 */
+ result = !Py_DeleteFileW(path->wide);
+#else
+#ifdef HAVE_UNLINKAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_UNLINKAT_RUNTIME) {
+
+ result = unlinkat(dir_fd, path->narrow, 0);
+ } else {
+ unlinkat_unavailable = 1;
+ }
+ } else
+#endif /* HAVE_UNLINKAT */
+ result = unlink(path->narrow);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_UNLINKAT
+ if (unlinkat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result)
+ return path_error(path);
+
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+os.remove = os.unlink
+
+Remove a file (same as unlink()).
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_remove_impl(PyObject *module, path_t *path, int dir_fd)
+/*[clinic end generated code: output=a8535b28f0068883 input=e05c5ab55cd30983]*/
+{
+ return os_unlink_impl(module, path, dir_fd);
+}
+
+
+static PyStructSequence_Field uname_result_fields[] = {
+ {"sysname", "operating system name"},
+ {"nodename", "name of machine on network (implementation-defined)"},
+ {"release", "operating system release"},
+ {"version", "operating system version"},
+ {"machine", "hardware identifier"},
+ {NULL}
+};
+
+PyDoc_STRVAR(uname_result__doc__,
+"uname_result: Result from os.uname().\n\n\
+This object may be accessed either as a tuple of\n\
+ (sysname, nodename, release, version, machine),\n\
+or via the attributes sysname, nodename, release, version, and machine.\n\
+\n\
+See os.uname for more information.");
+
+static PyStructSequence_Desc uname_result_desc = {
+ MODNAME ".uname_result", /* name */
+ uname_result__doc__, /* doc */
+ uname_result_fields,
+ 5
+};
+
+#ifdef HAVE_UNAME
+/*[clinic input]
+os.uname
+
+Return an object identifying the current operating system.
+
+The object behaves like a named tuple with the following fields:
+ (sysname, nodename, release, version, machine)
+
+[clinic start generated code]*/
+
+static PyObject *
+os_uname_impl(PyObject *module)
+/*[clinic end generated code: output=e6a49cf1a1508a19 input=e68bd246db3043ed]*/
+{
+ struct utsname u;
+ int res;
+ PyObject *value;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = uname(&u);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return posix_error();
+
+ PyObject *UnameResultType = get_posix_state(module)->UnameResultType;
+ value = PyStructSequence_New((PyTypeObject *)UnameResultType);
+ if (value == NULL)
+ return NULL;
+
+#define SET(i, field) \
+ { \
+ PyObject *o = PyUnicode_DecodeFSDefault(field); \
+ if (!o) { \
+ Py_DECREF(value); \
+ return NULL; \
+ } \
+ PyStructSequence_SET_ITEM(value, i, o); \
+ } \
+
+ SET(0, u.sysname);
+ SET(1, u.nodename);
+ SET(2, u.release);
+ SET(3, u.version);
+ SET(4, u.machine);
+
+#undef SET
+
+ return value;
+}
+#endif /* HAVE_UNAME */
+
+
+
+typedef struct {
+ int now;
+ time_t atime_s;
+ long atime_ns;
+ time_t mtime_s;
+ long mtime_ns;
+} utime_t;
+
+/*
+ * these macros assume that "ut" is a pointer to a utime_t
+ * they also intentionally leak the declaration of a pointer named "time"
+ */
+#define UTIME_TO_TIMESPEC \
+ struct timespec ts[2]; \
+ struct timespec *time; \
+ if (ut->now) \
+ time = NULL; \
+ else { \
+ ts[0].tv_sec = ut->atime_s; \
+ ts[0].tv_nsec = ut->atime_ns; \
+ ts[1].tv_sec = ut->mtime_s; \
+ ts[1].tv_nsec = ut->mtime_ns; \
+ time = ts; \
+ } \
+
+#define UTIME_TO_TIMEVAL \
+ struct timeval tv[2]; \
+ struct timeval *time; \
+ if (ut->now) \
+ time = NULL; \
+ else { \
+ tv[0].tv_sec = ut->atime_s; \
+ tv[0].tv_usec = ut->atime_ns / 1000; \
+ tv[1].tv_sec = ut->mtime_s; \
+ tv[1].tv_usec = ut->mtime_ns / 1000; \
+ time = tv; \
+ } \
+
+#define UTIME_TO_UTIMBUF \
+ struct utimbuf u; \
+ struct utimbuf *time; \
+ if (ut->now) \
+ time = NULL; \
+ else { \
+ u.actime = ut->atime_s; \
+ u.modtime = ut->mtime_s; \
+ time = &u; \
+ }
+
+#define UTIME_TO_TIME_T \
+ time_t timet[2]; \
+ time_t *time; \
+ if (ut->now) \
+ time = NULL; \
+ else { \
+ timet[0] = ut->atime_s; \
+ timet[1] = ut->mtime_s; \
+ time = timet; \
+ } \
+
+
+#if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT)
+
+static int
+utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
+{
+#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
+ if (HAVE_UTIMENSAT_RUNTIME) {
+ int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
+ UTIME_TO_TIMESPEC;
+ return utimensat(dir_fd, path, time, flags);
+ } else {
+ errno = ENOSYS;
+ return -1;
+ }
+#elif defined(HAVE_UTIMENSAT)
+ int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
+ UTIME_TO_TIMESPEC;
+ return utimensat(dir_fd, path, time, flags);
+#elif defined(HAVE_FUTIMESAT)
+ UTIME_TO_TIMEVAL;
+ /*
+ * follow_symlinks will never be false here;
+ * we only allow !follow_symlinks and dir_fd together
+ * if we have utimensat()
+ */
+ assert(follow_symlinks);
+ return futimesat(dir_fd, path, time);
+#endif
+}
+
+ #define FUTIMENSAT_DIR_FD_CONVERTER dir_fd_converter
+#else
+ #define FUTIMENSAT_DIR_FD_CONVERTER dir_fd_unavailable
+#endif
+
+#if defined(HAVE_FUTIMES) || defined(HAVE_FUTIMENS)
+
+static int
+utime_fd(utime_t *ut, int fd)
+{
+#ifdef HAVE_FUTIMENS
+
+ if (HAVE_FUTIMENS_RUNTIME) {
+
+ UTIME_TO_TIMESPEC;
+ return futimens(fd, time);
+
+ } else
+#ifndef HAVE_FUTIMES
+ {
+ /* Not sure if this can happen */
+ PyErr_SetString(
+ PyExc_RuntimeError,
+ "neither futimens nor futimes are supported"
+ " on this system");
+ return -1;
+ }
+#endif
+
+#endif
+#ifdef HAVE_FUTIMES
+ {
+ UTIME_TO_TIMEVAL;
+ return futimes(fd, time);
+ }
+#endif
+}
+
+ #define PATH_UTIME_HAVE_FD 1
+#else
+ #define PATH_UTIME_HAVE_FD 0
+#endif
+
+#if defined(HAVE_UTIMENSAT) || defined(HAVE_LUTIMES)
+# define UTIME_HAVE_NOFOLLOW_SYMLINKS
+#endif
+
+#ifdef UTIME_HAVE_NOFOLLOW_SYMLINKS
+
+static int
+utime_nofollow_symlinks(utime_t *ut, const char *path)
+{
+#ifdef HAVE_UTIMENSAT
+ if (HAVE_UTIMENSAT_RUNTIME) {
+ UTIME_TO_TIMESPEC;
+ return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
+ } else
+#ifndef HAVE_LUTIMES
+ {
+ /* Not sure if this can happen */
+ PyErr_SetString(
+ PyExc_RuntimeError,
+ "neither utimensat nor lutimes are supported"
+ " on this system");
+ return -1;
+ }
+#endif
+#endif
+
+#ifdef HAVE_LUTIMES
+ {
+ UTIME_TO_TIMEVAL;
+ return lutimes(path, time);
+ }
+#endif
+}
+
+#endif
+
+#ifndef MS_WINDOWS
+
+static int
+utime_default(utime_t *ut, const char *path)
+{
+#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
+ if (HAVE_UTIMENSAT_RUNTIME) {
+ UTIME_TO_TIMESPEC;
+ return utimensat(DEFAULT_DIR_FD, path, time, 0);
+ } else {
+ UTIME_TO_TIMEVAL;
+ return utimes(path, time);
+ }
+#elif defined(HAVE_UTIMENSAT)
+ UTIME_TO_TIMESPEC;
+ return utimensat(DEFAULT_DIR_FD, path, time, 0);
+#elif defined(HAVE_UTIMES)
+ UTIME_TO_TIMEVAL;
+ return utimes(path, time);
+#elif defined(HAVE_UTIME_H)
+ UTIME_TO_UTIMBUF;
+ return utime(path, time);
+#else
+ UTIME_TO_TIME_T;
+ return utime(path, time);
+#endif
+}
+
+#endif
+
+static int
+split_py_long_to_s_and_ns(PyObject *module, PyObject *py_long, time_t *s, long *ns)
+{
+ int result = 0;
+ PyObject *divmod;
+ divmod = PyNumber_Divmod(py_long, get_posix_state(module)->billion);
+ if (!divmod)
+ goto exit;
+ if (!PyTuple_Check(divmod) || PyTuple_GET_SIZE(divmod) != 2) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.__divmod__() must return a 2-tuple, not %.200s",
+ _PyType_Name(Py_TYPE(py_long)), _PyType_Name(Py_TYPE(divmod)));
+ goto exit;
+ }
+ *s = _PyLong_AsTime_t(PyTuple_GET_ITEM(divmod, 0));
+ if ((*s == -1) && PyErr_Occurred())
+ goto exit;
+ *ns = PyLong_AsLong(PyTuple_GET_ITEM(divmod, 1));
+ if ((*ns == -1) && PyErr_Occurred())
+ goto exit;
+
+ result = 1;
+exit:
+ Py_XDECREF(divmod);
+ return result;
+}
+
+
+/*[clinic input]
+os.utime
+
+ path: path_t(allow_fd='PATH_UTIME_HAVE_FD')
+ times: object = None
+ *
+ ns: object = NULL
+ dir_fd: dir_fd(requires='futimensat') = None
+ follow_symlinks: bool=True
+
+# "utime(path, times=None, *[, ns], dir_fd=None, follow_symlinks=True)\n\
+
+Set the access and modified time of path.
+
+path may always be specified as a string.
+On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+
+If times is not None, it must be a tuple (atime, mtime);
+ atime and mtime should be expressed as float seconds since the epoch.
+If ns is specified, it must be a tuple (atime_ns, mtime_ns);
+ atime_ns and mtime_ns should be expressed as integer nanoseconds
+ since the epoch.
+If times is None and ns is unspecified, utime uses the current time.
+Specifying tuples for both times and ns is an error.
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, utime will modify the symbolic link itself instead of the file the
+ link points to.
+It is an error to use dir_fd or follow_symlinks when specifying path
+ as an open file descriptor.
+dir_fd and follow_symlinks may not be available on your platform.
+ If they are unavailable, using them will raise a NotImplementedError.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns,
+ int dir_fd, int follow_symlinks)
+/*[clinic end generated code: output=cfcac69d027b82cf input=2fbd62a2f228f8f4]*/
+{
+#ifdef MS_WINDOWS
+ HANDLE hFile;
+ FILETIME atime, mtime;
+#else
+ int result;
+#endif
+
+ utime_t utime;
+
+ memset(&utime, 0, sizeof(utime_t));
+
+ if (times != Py_None && ns) {
+ PyErr_SetString(PyExc_ValueError,
+ "utime: you may specify either 'times'"
+ " or 'ns' but not both");
+ return NULL;
+ }
+
+ if (times != Py_None) {
+ time_t a_sec, m_sec;
+ long a_nsec, m_nsec;
+ if (!PyTuple_CheckExact(times) || (PyTuple_Size(times) != 2)) {
+ PyErr_SetString(PyExc_TypeError,
+ "utime: 'times' must be either"
+ " a tuple of two ints or None");
+ return NULL;
+ }
+ utime.now = 0;
+ if (_PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 0),
+ &a_sec, &a_nsec, _PyTime_ROUND_FLOOR) == -1 ||
+ _PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 1),
+ &m_sec, &m_nsec, _PyTime_ROUND_FLOOR) == -1) {
+ return NULL;
+ }
+ utime.atime_s = a_sec;
+ utime.atime_ns = a_nsec;
+ utime.mtime_s = m_sec;
+ utime.mtime_ns = m_nsec;
+ }
+ else if (ns) {
+ if (!PyTuple_CheckExact(ns) || (PyTuple_Size(ns) != 2)) {
+ PyErr_SetString(PyExc_TypeError,
+ "utime: 'ns' must be a tuple of two ints");
+ return NULL;
+ }
+ utime.now = 0;
+ if (!split_py_long_to_s_and_ns(module, PyTuple_GET_ITEM(ns, 0),
+ &utime.atime_s, &utime.atime_ns) ||
+ !split_py_long_to_s_and_ns(module, PyTuple_GET_ITEM(ns, 1),
+ &utime.mtime_s, &utime.mtime_ns)) {
+ return NULL;
+ }
+ }
+ else {
+ /* times and ns are both None/unspecified. use "now". */
+ utime.now = 1;
+ }
+
+#if !defined(UTIME_HAVE_NOFOLLOW_SYMLINKS)
+ if (follow_symlinks_specified("utime", follow_symlinks))
+ return NULL;
+#endif
+
+ if (path_and_dir_fd_invalid("utime", path, dir_fd) ||
+ dir_fd_and_fd_invalid("utime", dir_fd, path->fd) ||
+ fd_and_follow_symlinks_invalid("utime", path->fd, follow_symlinks))
+ return NULL;
+
+#if !defined(HAVE_UTIMENSAT)
+ if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
+ PyErr_SetString(PyExc_ValueError,
+ "utime: cannot use dir_fd and follow_symlinks "
+ "together on this platform");
+ return NULL;
+ }
+#endif
+
+ if (PySys_Audit("os.utime", "OOOi", path->object, times, ns ? ns : Py_None,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ hFile = CreateFileW(path->wide, FILE_WRITE_ATTRIBUTES, 0,
+ NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ Py_END_ALLOW_THREADS
+ if (hFile == INVALID_HANDLE_VALUE) {
+ path_error(path);
+ return NULL;
+ }
+
+ if (utime.now) {
+ GetSystemTimeAsFileTime(&mtime);
+ atime = mtime;
+ }
+ else {
+ _Py_time_t_to_FILE_TIME(utime.atime_s, utime.atime_ns, &atime);
+ _Py_time_t_to_FILE_TIME(utime.mtime_s, utime.mtime_ns, &mtime);
+ }
+ if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
+ /* Avoid putting the file name into the error here,
+ as that may confuse the user into believing that
+ something is wrong with the file, when it also
+ could be the time stamp that gives a problem. */
+ PyErr_SetFromWindowsErr(0);
+ CloseHandle(hFile);
+ return NULL;
+ }
+ CloseHandle(hFile);
+#else /* MS_WINDOWS */
+ Py_BEGIN_ALLOW_THREADS
+
+#ifdef UTIME_HAVE_NOFOLLOW_SYMLINKS
+ if ((!follow_symlinks) && (dir_fd == DEFAULT_DIR_FD))
+ result = utime_nofollow_symlinks(&utime, path->narrow);
+ else
+#endif
+
+#if defined(HAVE_FUTIMESAT) || defined(HAVE_UTIMENSAT)
+ if ((dir_fd != DEFAULT_DIR_FD) || (!follow_symlinks)) {
+ result = utime_dir_fd(&utime, dir_fd, path->narrow, follow_symlinks);
+
+ } else
+#endif
+
+#if defined(HAVE_FUTIMES) || defined(HAVE_FUTIMENS)
+ if (path->fd != -1)
+ result = utime_fd(&utime, path->fd);
+ else
+#endif
+
+ result = utime_default(&utime, path->narrow);
+
+ Py_END_ALLOW_THREADS
+
+#if defined(__APPLE__) && defined(HAVE_UTIMENSAT)
+ /* See utime_dir_fd implementation */
+ if (result == -1 && errno == ENOSYS) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result < 0) {
+ /* see previous comment about not putting filename in error here */
+ posix_error();
+ return NULL;
+ }
+
+#endif /* MS_WINDOWS */
+
+ Py_RETURN_NONE;
+}
+
+/* Process operations */
+
+
+/*[clinic input]
+os._exit
+
+ status: int
+
+Exit to the system with specified status, without normal exit processing.
+[clinic start generated code]*/
+
+static PyObject *
+os__exit_impl(PyObject *module, int status)
+/*[clinic end generated code: output=116e52d9c2260d54 input=5e6d57556b0c4a62]*/
+{
+ _exit(status);
+ return NULL; /* Make gcc -Wall happy */
+}
+
+#if defined(HAVE_WEXECV) || defined(HAVE_WSPAWNV)
+#define EXECV_CHAR wchar_t
+#else
+#define EXECV_CHAR char
+#endif
+
+#if defined(HAVE_EXECV) || defined(HAVE_SPAWNV) || defined(HAVE_RTPSPAWN)
+static void
+free_string_array(EXECV_CHAR **array, Py_ssize_t count)
+{
+ Py_ssize_t i;
+ for (i = 0; i < count; i++)
+ PyMem_Free(array[i]);
+ PyMem_Free(array);
+}
+
+static int
+fsconvert_strdup(PyObject *o, EXECV_CHAR **out)
+{
+ Py_ssize_t size;
+ PyObject *ub;
+ int result = 0;
+#if defined(HAVE_WEXECV) || defined(HAVE_WSPAWNV)
+ if (!PyUnicode_FSDecoder(o, &ub))
+ return 0;
+ *out = PyUnicode_AsWideCharString(ub, &size);
+ if (*out)
+ result = 1;
+#else
+ if (!PyUnicode_FSConverter(o, &ub))
+ return 0;
+ size = PyBytes_GET_SIZE(ub);
+ *out = PyMem_Malloc(size + 1);
+ if (*out) {
+ memcpy(*out, PyBytes_AS_STRING(ub), size + 1);
+ result = 1;
+ } else
+ PyErr_NoMemory();
+#endif
+ Py_DECREF(ub);
+ return result;
+}
+#endif
+
+#if defined(HAVE_EXECV) || defined (HAVE_FEXECVE) || defined(HAVE_RTPSPAWN)
+static EXECV_CHAR**
+parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
+{
+ Py_ssize_t i, pos, envc;
+ PyObject *keys=NULL, *vals=NULL;
+ PyObject *key2, *val2, *keyval;
+ EXECV_CHAR **envlist;
+
+ i = PyMapping_Size(env);
+ if (i < 0)
+ return NULL;
+ envlist = PyMem_NEW(EXECV_CHAR *, i + 1);
+ if (envlist == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ envc = 0;
+ keys = PyMapping_Keys(env);
+ if (!keys)
+ goto error;
+ vals = PyMapping_Values(env);
+ if (!vals)
+ goto error;
+ if (!PyList_Check(keys) || !PyList_Check(vals)) {
+ PyErr_Format(PyExc_TypeError,
+ "env.keys() or env.values() is not a list");
+ goto error;
+ }
+
+ for (pos = 0; pos < i; pos++) {
+ PyObject *key = PyList_GetItem(keys, pos); // Borrowed ref.
+ if (key == NULL) {
+ goto error;
+ }
+ PyObject *val = PyList_GetItem(vals, pos); // Borrowed ref.
+ if (val == NULL) {
+ goto error;
+ }
+
+#if defined(HAVE_WEXECV) || defined(HAVE_WSPAWNV)
+ if (!PyUnicode_FSDecoder(key, &key2))
+ goto error;
+ if (!PyUnicode_FSDecoder(val, &val2)) {
+ Py_DECREF(key2);
+ goto error;
+ }
+ /* Search from index 1 because on Windows starting '=' is allowed for
+ defining hidden environment variables. */
+ if (PyUnicode_GET_LENGTH(key2) == 0 ||
+ PyUnicode_FindChar(key2, '=', 1, PyUnicode_GET_LENGTH(key2), 1) != -1)
+ {
+ PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
+ Py_DECREF(key2);
+ Py_DECREF(val2);
+ goto error;
+ }
+ keyval = PyUnicode_FromFormat("%U=%U", key2, val2);
+#else
+ if (!PyUnicode_FSConverter(key, &key2))
+ goto error;
+ if (!PyUnicode_FSConverter(val, &val2)) {
+ Py_DECREF(key2);
+ goto error;
+ }
+ if (PyBytes_GET_SIZE(key2) == 0 ||
+ strchr(PyBytes_AS_STRING(key2) + 1, '=') != NULL)
+ {
+ PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
+ Py_DECREF(key2);
+ Py_DECREF(val2);
+ goto error;
+ }
+ keyval = PyBytes_FromFormat("%s=%s", PyBytes_AS_STRING(key2),
+ PyBytes_AS_STRING(val2));
+#endif
+ Py_DECREF(key2);
+ Py_DECREF(val2);
+ if (!keyval)
+ goto error;
+
+ if (!fsconvert_strdup(keyval, &envlist[envc++])) {
+ Py_DECREF(keyval);
+ goto error;
+ }
+
+ Py_DECREF(keyval);
+ }
+ Py_DECREF(vals);
+ Py_DECREF(keys);
+
+ envlist[envc] = 0;
+ *envc_ptr = envc;
+ return envlist;
+
+error:
+ Py_XDECREF(keys);
+ Py_XDECREF(vals);
+ free_string_array(envlist, envc);
+ return NULL;
+}
+
+static EXECV_CHAR**
+parse_arglist(PyObject* argv, Py_ssize_t *argc)
+{
+ int i;
+ EXECV_CHAR **argvlist = PyMem_NEW(EXECV_CHAR *, *argc+1);
+ if (argvlist == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ for (i = 0; i < *argc; i++) {
+ PyObject* item = PySequence_ITEM(argv, i);
+ if (item == NULL)
+ goto fail;
+ if (!fsconvert_strdup(item, &argvlist[i])) {
+ Py_DECREF(item);
+ goto fail;
+ }
+ Py_DECREF(item);
+ }
+ argvlist[*argc] = NULL;
+ return argvlist;
+fail:
+ *argc = i;
+ free_string_array(argvlist, *argc);
+ return NULL;
+}
+
+#endif
+
+
+#ifdef HAVE_EXECV
+/*[clinic input]
+os.execv
+
+ path: path_t
+ Path of executable file.
+ argv: object
+ Tuple or list of strings.
+ /
+
+Execute an executable path with arguments, replacing current process.
+[clinic start generated code]*/
+
+static PyObject *
+os_execv_impl(PyObject *module, path_t *path, PyObject *argv)
+/*[clinic end generated code: output=3b52fec34cd0dafd input=9bac31efae07dac7]*/
+{
+ EXECV_CHAR **argvlist;
+ Py_ssize_t argc;
+
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_EXEC)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "exec not supported for isolated subinterpreters");
+ return NULL;
+ }
+
+ /* execv has two arguments: (path, argv), where
+ argv is a list or tuple of strings. */
+
+ if (!PyList_Check(argv) && !PyTuple_Check(argv)) {
+ PyErr_SetString(PyExc_TypeError,
+ "execv() arg 2 must be a tuple or list");
+ return NULL;
+ }
+ argc = PySequence_Size(argv);
+ if (argc < 1) {
+ PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty");
+ return NULL;
+ }
+
+ argvlist = parse_arglist(argv, &argc);
+ if (argvlist == NULL) {
+ return NULL;
+ }
+ if (!argvlist[0][0]) {
+ PyErr_SetString(PyExc_ValueError,
+ "execv() arg 2 first element cannot be empty");
+ free_string_array(argvlist, argc);
+ return NULL;
+ }
+
+ if (PySys_Audit("os.exec", "OOO", path->object, argv, Py_None) < 0) {
+ free_string_array(argvlist, argc);
+ return NULL;
+ }
+
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef HAVE_WEXECV
+ _wexecv(path->wide, argvlist);
+#else
+ execv(path->narrow, argvlist);
+#endif
+ _Py_END_SUPPRESS_IPH
+
+ /* If we get here it's definitely an error */
+
+ posix_error();
+ free_string_array(argvlist, argc);
+ return NULL;
+}
+
+
+/*[clinic input]
+os.execve
+
+ path: path_t(allow_fd='PATH_HAVE_FEXECVE')
+ Path of executable file.
+ argv: object
+ Tuple or list of strings.
+ env: object
+ Dictionary of strings mapping to strings.
+
+Execute an executable path with arguments, replacing current process.
+[clinic start generated code]*/
+
+static PyObject *
+os_execve_impl(PyObject *module, path_t *path, PyObject *argv, PyObject *env)
+/*[clinic end generated code: output=ff9fa8e4da8bde58 input=626804fa092606d9]*/
+{
+ EXECV_CHAR **argvlist = NULL;
+ EXECV_CHAR **envlist;
+ Py_ssize_t argc, envc;
+
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_EXEC)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "exec not supported for isolated subinterpreters");
+ return NULL;
+ }
+
+ /* execve has three arguments: (path, argv, env), where
+ argv is a list or tuple of strings and env is a dictionary
+ like posix.environ. */
+
+ if (!PyList_Check(argv) && !PyTuple_Check(argv)) {
+ PyErr_SetString(PyExc_TypeError,
+ "execve: argv must be a tuple or list");
+ goto fail_0;
+ }
+ argc = PySequence_Size(argv);
+ if (argc < 1) {
+ PyErr_SetString(PyExc_ValueError, "execve: argv must not be empty");
+ return NULL;
+ }
+
+ if (!PyMapping_Check(env)) {
+ PyErr_SetString(PyExc_TypeError,
+ "execve: environment must be a mapping object");
+ goto fail_0;
+ }
+
+ argvlist = parse_arglist(argv, &argc);
+ if (argvlist == NULL) {
+ goto fail_0;
+ }
+ if (!argvlist[0][0]) {
+ PyErr_SetString(PyExc_ValueError,
+ "execve: argv first element cannot be empty");
+ goto fail_0;
+ }
+
+ envlist = parse_envlist(env, &envc);
+ if (envlist == NULL)
+ goto fail_0;
+
+ if (PySys_Audit("os.exec", "OOO", path->object, argv, env) < 0) {
+ goto fail_1;
+ }
+
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef HAVE_FEXECVE
+ if (path->fd > -1)
+ fexecve(path->fd, argvlist, envlist);
+ else
+#endif
+#ifdef HAVE_WEXECV
+ _wexecve(path->wide, argvlist, envlist);
+#else
+ execve(path->narrow, argvlist, envlist);
+#endif
+ _Py_END_SUPPRESS_IPH
+
+ /* If we get here it's definitely an error */
+
+ posix_path_error(path);
+ fail_1:
+ free_string_array(envlist, envc);
+ fail_0:
+ if (argvlist)
+ free_string_array(argvlist, argc);
+ return NULL;
+}
+
+#endif /* HAVE_EXECV */
+
+#ifdef HAVE_POSIX_SPAWN
+
+enum posix_spawn_file_actions_identifier {
+ POSIX_SPAWN_OPEN,
+ POSIX_SPAWN_CLOSE,
+ POSIX_SPAWN_DUP2
+};
+
+#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
+static int
+convert_sched_param(PyObject *module, PyObject *param, struct sched_param *res);
+#endif
+
+static int
+parse_posix_spawn_flags(PyObject *module, const char *func_name, PyObject *setpgroup,
+ int resetids, int setsid, PyObject *setsigmask,
+ PyObject *setsigdef, PyObject *scheduler,
+ posix_spawnattr_t *attrp)
+{
+ long all_flags = 0;
+
+ errno = posix_spawnattr_init(attrp);
+ if (errno) {
+ posix_error();
+ return -1;
+ }
+
+ if (setpgroup) {
+ pid_t pgid = PyLong_AsPid(setpgroup);
+ if (pgid == (pid_t)-1 && PyErr_Occurred()) {
+ goto fail;
+ }
+ errno = posix_spawnattr_setpgroup(attrp, pgid);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ all_flags |= POSIX_SPAWN_SETPGROUP;
+ }
+
+ if (resetids) {
+ all_flags |= POSIX_SPAWN_RESETIDS;
+ }
+
+ if (setsid) {
+#ifdef HAVE_POSIX_SPAWN_SETSID_RUNTIME
+ if (HAVE_POSIX_SPAWN_SETSID_RUNTIME) {
+#endif
+#ifdef POSIX_SPAWN_SETSID
+ all_flags |= POSIX_SPAWN_SETSID;
+#elif defined(POSIX_SPAWN_SETSID_NP)
+ all_flags |= POSIX_SPAWN_SETSID_NP;
+#else
+ argument_unavailable_error(func_name, "setsid");
+ return -1;
+#endif
+
+#ifdef HAVE_POSIX_SPAWN_SETSID_RUNTIME
+ } else {
+ argument_unavailable_error(func_name, "setsid");
+ return -1;
+ }
+#endif /* HAVE_POSIX_SPAWN_SETSID_RUNTIME */
+
+ }
+
+#ifdef HAVE_SIGSET_T
+ if (setsigmask) {
+ sigset_t set;
+ if (!_Py_Sigset_Converter(setsigmask, &set)) {
+ goto fail;
+ }
+ errno = posix_spawnattr_setsigmask(attrp, &set);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ all_flags |= POSIX_SPAWN_SETSIGMASK;
+ }
+
+ if (setsigdef) {
+ sigset_t set;
+ if (!_Py_Sigset_Converter(setsigdef, &set)) {
+ goto fail;
+ }
+ errno = posix_spawnattr_setsigdefault(attrp, &set);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ all_flags |= POSIX_SPAWN_SETSIGDEF;
+ }
+#else
+ if (setsigmask || setsigdef) {
+ PyErr_SetString(PyExc_NotImplementedError,
+ "sigset is not supported on this platform");
+ goto fail;
+ }
+#endif
+
+ if (scheduler) {
+#ifdef POSIX_SPAWN_SETSCHEDULER
+ PyObject *py_schedpolicy;
+ PyObject *schedparam_obj;
+ struct sched_param schedparam;
+
+ if (!PyArg_ParseTuple(scheduler, "OO"
+ ";A scheduler tuple must have two elements",
+ &py_schedpolicy, &schedparam_obj)) {
+ goto fail;
+ }
+ if (!convert_sched_param(module, schedparam_obj, &schedparam)) {
+ goto fail;
+ }
+ if (py_schedpolicy != Py_None) {
+ int schedpolicy = _PyLong_AsInt(py_schedpolicy);
+
+ if (schedpolicy == -1 && PyErr_Occurred()) {
+ goto fail;
+ }
+ errno = posix_spawnattr_setschedpolicy(attrp, schedpolicy);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ all_flags |= POSIX_SPAWN_SETSCHEDULER;
+ }
+ errno = posix_spawnattr_setschedparam(attrp, &schedparam);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ all_flags |= POSIX_SPAWN_SETSCHEDPARAM;
+#else
+ PyErr_SetString(PyExc_NotImplementedError,
+ "The scheduler option is not supported in this system.");
+ goto fail;
+#endif
+ }
+
+ errno = posix_spawnattr_setflags(attrp, all_flags);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+
+ return 0;
+
+fail:
+ (void)posix_spawnattr_destroy(attrp);
+ return -1;
+}
+
+static int
+parse_file_actions(PyObject *file_actions,
+ posix_spawn_file_actions_t *file_actionsp,
+ PyObject *temp_buffer)
+{
+ PyObject *seq;
+ PyObject *file_action = NULL;
+ PyObject *tag_obj;
+
+ seq = PySequence_Fast(file_actions,
+ "file_actions must be a sequence or None");
+ if (seq == NULL) {
+ return -1;
+ }
+
+ errno = posix_spawn_file_actions_init(file_actionsp);
+ if (errno) {
+ posix_error();
+ Py_DECREF(seq);
+ return -1;
+ }
+
+ for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(seq); ++i) {
+ file_action = PySequence_Fast_GET_ITEM(seq, i);
+ Py_INCREF(file_action);
+ if (!PyTuple_Check(file_action) || !PyTuple_GET_SIZE(file_action)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Each file_actions element must be a non-empty tuple");
+ goto fail;
+ }
+ long tag = PyLong_AsLong(PyTuple_GET_ITEM(file_action, 0));
+ if (tag == -1 && PyErr_Occurred()) {
+ goto fail;
+ }
+
+ /* Populate the file_actions object */
+ switch (tag) {
+ case POSIX_SPAWN_OPEN: {
+ int fd, oflag;
+ PyObject *path;
+ unsigned long mode;
+ if (!PyArg_ParseTuple(file_action, "OiO&ik"
+ ";A open file_action tuple must have 5 elements",
+ &tag_obj, &fd, PyUnicode_FSConverter, &path,
+ &oflag, &mode))
+ {
+ goto fail;
+ }
+ if (PyList_Append(temp_buffer, path)) {
+ Py_DECREF(path);
+ goto fail;
+ }
+ errno = posix_spawn_file_actions_addopen(file_actionsp,
+ fd, PyBytes_AS_STRING(path), oflag, (mode_t)mode);
+ if (errno) {
+ posix_error();
+ Py_DECREF(path);
+ goto fail;
+ }
+ Py_DECREF(path);
+ break;
+ }
+ case POSIX_SPAWN_CLOSE: {
+ int fd;
+ if (!PyArg_ParseTuple(file_action, "Oi"
+ ";A close file_action tuple must have 2 elements",
+ &tag_obj, &fd))
+ {
+ goto fail;
+ }
+ errno = posix_spawn_file_actions_addclose(file_actionsp, fd);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ break;
+ }
+ case POSIX_SPAWN_DUP2: {
+ int fd1, fd2;
+ if (!PyArg_ParseTuple(file_action, "Oii"
+ ";A dup2 file_action tuple must have 3 elements",
+ &tag_obj, &fd1, &fd2))
+ {
+ goto fail;
+ }
+ errno = posix_spawn_file_actions_adddup2(file_actionsp,
+ fd1, fd2);
+ if (errno) {
+ posix_error();
+ goto fail;
+ }
+ break;
+ }
+ default: {
+ PyErr_SetString(PyExc_TypeError,
+ "Unknown file_actions identifier");
+ goto fail;
+ }
+ }
+ Py_DECREF(file_action);
+ }
+
+ Py_DECREF(seq);
+ return 0;
+
+fail:
+ Py_DECREF(seq);
+ Py_DECREF(file_action);
+ (void)posix_spawn_file_actions_destroy(file_actionsp);
+ return -1;
+}
+
+
+static PyObject *
+py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *argv,
+ PyObject *env, PyObject *file_actions,
+ PyObject *setpgroup, int resetids, int setsid, PyObject *setsigmask,
+ PyObject *setsigdef, PyObject *scheduler)
+{
+ const char *func_name = use_posix_spawnp ? "posix_spawnp" : "posix_spawn";
+ EXECV_CHAR **argvlist = NULL;
+ EXECV_CHAR **envlist = NULL;
+ posix_spawn_file_actions_t file_actions_buf;
+ posix_spawn_file_actions_t *file_actionsp = NULL;
+ posix_spawnattr_t attr;
+ posix_spawnattr_t *attrp = NULL;
+ Py_ssize_t argc, envc;
+ PyObject *result = NULL;
+ PyObject *temp_buffer = NULL;
+ pid_t pid;
+ int err_code;
+
+ /* posix_spawn and posix_spawnp have three arguments: (path, argv, env), where
+ argv is a list or tuple of strings and env is a dictionary
+ like posix.environ. */
+
+ if (!PyList_Check(argv) && !PyTuple_Check(argv)) {
+ PyErr_Format(PyExc_TypeError,
+ "%s: argv must be a tuple or list", func_name);
+ goto exit;
+ }
+ argc = PySequence_Size(argv);
+ if (argc < 1) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: argv must not be empty", func_name);
+ return NULL;
+ }
+
+ if (!PyMapping_Check(env)) {
+ PyErr_Format(PyExc_TypeError,
+ "%s: environment must be a mapping object", func_name);
+ goto exit;
+ }
+
+ argvlist = parse_arglist(argv, &argc);
+ if (argvlist == NULL) {
+ goto exit;
+ }
+ if (!argvlist[0][0]) {
+ PyErr_Format(PyExc_ValueError,
+ "%s: argv first element cannot be empty", func_name);
+ goto exit;
+ }
+
+ envlist = parse_envlist(env, &envc);
+ if (envlist == NULL) {
+ goto exit;
+ }
+
+ if (file_actions != NULL && file_actions != Py_None) {
+ /* There is a bug in old versions of glibc that makes some of the
+ * helper functions for manipulating file actions not copy the provided
+ * buffers. The problem is that posix_spawn_file_actions_addopen does not
+ * copy the value of path for some old versions of glibc (<2.20).
+ * The use of temp_buffer here is a workaround that keeps the
+ * python objects that own the buffers alive until posix_spawn gets called.
+ * Check https://bugs.python.org/issue33630 and
+ * https://sourceware.org/bugzilla/show_bug.cgi?id=17048 for more info.*/
+ temp_buffer = PyList_New(0);
+ if (!temp_buffer) {
+ goto exit;
+ }
+ if (parse_file_actions(file_actions, &file_actions_buf, temp_buffer)) {
+ goto exit;
+ }
+ file_actionsp = &file_actions_buf;
+ }
+
+ if (parse_posix_spawn_flags(module, func_name, setpgroup, resetids, setsid,
+ setsigmask, setsigdef, scheduler, &attr)) {
+ goto exit;
+ }
+ attrp = &attr;
+
+ if (PySys_Audit("os.posix_spawn", "OOO", path->object, argv, env) < 0) {
+ goto exit;
+ }
+
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef HAVE_POSIX_SPAWNP
+ if (use_posix_spawnp) {
+ err_code = posix_spawnp(&pid, path->narrow,
+ file_actionsp, attrp, argvlist, envlist);
+ }
+ else
+#endif /* HAVE_POSIX_SPAWNP */
+ {
+ err_code = posix_spawn(&pid, path->narrow,
+ file_actionsp, attrp, argvlist, envlist);
+ }
+ _Py_END_SUPPRESS_IPH
+
+ if (err_code) {
+ errno = err_code;
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
+ goto exit;
+ }
+#ifdef _Py_MEMORY_SANITIZER
+ __msan_unpoison(&pid, sizeof(pid));
+#endif
+ result = PyLong_FromPid(pid);
+
+exit:
+ if (file_actionsp) {
+ (void)posix_spawn_file_actions_destroy(file_actionsp);
+ }
+ if (attrp) {
+ (void)posix_spawnattr_destroy(attrp);
+ }
+ if (envlist) {
+ free_string_array(envlist, envc);
+ }
+ if (argvlist) {
+ free_string_array(argvlist, argc);
+ }
+ Py_XDECREF(temp_buffer);
+ return result;
+}
+
+
+/*[clinic input]
+
+os.posix_spawn
+ path: path_t
+ Path of executable file.
+ argv: object
+ Tuple or list of strings.
+ env: object
+ Dictionary of strings mapping to strings.
+ /
+ *
+ file_actions: object(c_default='NULL') = ()
+ A sequence of file action tuples.
+ setpgroup: object = NULL
+ The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.
+ resetids: bool = False
+ If the value is `true` the POSIX_SPAWN_RESETIDS will be activated.
+ setsid: bool = False
+ If the value is `true` the POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP will be activated.
+ setsigmask: object(c_default='NULL') = ()
+ The sigmask to use with the POSIX_SPAWN_SETSIGMASK flag.
+ setsigdef: object(c_default='NULL') = ()
+ The sigmask to use with the POSIX_SPAWN_SETSIGDEF flag.
+ scheduler: object = NULL
+ A tuple with the scheduler policy (optional) and parameters.
+
+Execute the program specified by path in a new process.
+[clinic start generated code]*/
+
+static PyObject *
+os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
+ PyObject *env, PyObject *file_actions,
+ PyObject *setpgroup, int resetids, int setsid,
+ PyObject *setsigmask, PyObject *setsigdef,
+ PyObject *scheduler)
+/*[clinic end generated code: output=14a1098c566bc675 input=808aed1090d84e33]*/
+{
+ return py_posix_spawn(0, module, path, argv, env, file_actions,
+ setpgroup, resetids, setsid, setsigmask, setsigdef,
+ scheduler);
+}
+ #endif /* HAVE_POSIX_SPAWN */
+
+
+
+#ifdef HAVE_POSIX_SPAWNP
+/*[clinic input]
+
+os.posix_spawnp
+ path: path_t
+ Path of executable file.
+ argv: object
+ Tuple or list of strings.
+ env: object
+ Dictionary of strings mapping to strings.
+ /
+ *
+ file_actions: object(c_default='NULL') = ()
+ A sequence of file action tuples.
+ setpgroup: object = NULL
+ The pgroup to use with the POSIX_SPAWN_SETPGROUP flag.
+ resetids: bool = False
+ If the value is `True` the POSIX_SPAWN_RESETIDS will be activated.
+ setsid: bool = False
+ If the value is `True` the POSIX_SPAWN_SETSID or POSIX_SPAWN_SETSID_NP will be activated.
+ setsigmask: object(c_default='NULL') = ()
+ The sigmask to use with the POSIX_SPAWN_SETSIGMASK flag.
+ setsigdef: object(c_default='NULL') = ()
+ The sigmask to use with the POSIX_SPAWN_SETSIGDEF flag.
+ scheduler: object = NULL
+ A tuple with the scheduler policy (optional) and parameters.
+
+Execute the program specified by path in a new process.
+[clinic start generated code]*/
+
+static PyObject *
+os_posix_spawnp_impl(PyObject *module, path_t *path, PyObject *argv,
+ PyObject *env, PyObject *file_actions,
+ PyObject *setpgroup, int resetids, int setsid,
+ PyObject *setsigmask, PyObject *setsigdef,
+ PyObject *scheduler)
+/*[clinic end generated code: output=7b9aaefe3031238d input=9e89e616116752a1]*/
+{
+ return py_posix_spawn(1, module, path, argv, env, file_actions,
+ setpgroup, resetids, setsid, setsigmask, setsigdef,
+ scheduler);
+}
+#endif /* HAVE_POSIX_SPAWNP */
+
+#ifdef HAVE_RTPSPAWN
+static intptr_t
+_rtp_spawn(int mode, const char *rtpFileName, const char *argv[],
+ const char *envp[])
+{
+ RTP_ID rtpid;
+ int status;
+ pid_t res;
+ int async_err = 0;
+
+ /* Set priority=100 and uStackSize=16 MiB (0x1000000) for new processes.
+ uStackSize=0 cannot be used, the default stack size is too small for
+ Python. */
+ if (envp) {
+ rtpid = rtpSpawn(rtpFileName, argv, envp,
+ 100, 0x1000000, 0, VX_FP_TASK);
+ }
+ else {
+ rtpid = rtpSpawn(rtpFileName, argv, (const char **)environ,
+ 100, 0x1000000, 0, VX_FP_TASK);
+ }
+ if ((rtpid != RTP_ID_ERROR) && (mode == _P_WAIT)) {
+ do {
+ res = waitpid((pid_t)rtpid, &status, 0);
+ } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (res < 0)
+ return RTP_ID_ERROR;
+ return ((intptr_t)status);
+ }
+ return ((intptr_t)rtpid);
+}
+#endif
+
+#if defined(HAVE_SPAWNV) || defined(HAVE_WSPAWNV) || defined(HAVE_RTPSPAWN)
+/*[clinic input]
+os.spawnv
+
+ mode: int
+ Mode of process creation.
+ path: path_t
+ Path of executable file.
+ argv: object
+ Tuple or list of strings.
+ /
+
+Execute the program specified by path in a new process.
+[clinic start generated code]*/
+
+static PyObject *
+os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv)
+/*[clinic end generated code: output=71cd037a9d96b816 input=43224242303291be]*/
+{
+ EXECV_CHAR **argvlist;
+ int i;
+ Py_ssize_t argc;
+ intptr_t spawnval;
+ PyObject *(*getitem)(PyObject *, Py_ssize_t);
+
+ /* spawnv has three arguments: (mode, path, argv), where
+ argv is a list or tuple of strings. */
+
+ if (PyList_Check(argv)) {
+ argc = PyList_Size(argv);
+ getitem = PyList_GetItem;
+ }
+ else if (PyTuple_Check(argv)) {
+ argc = PyTuple_Size(argv);
+ getitem = PyTuple_GetItem;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "spawnv() arg 2 must be a tuple or list");
+ return NULL;
+ }
+ if (argc == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "spawnv() arg 2 cannot be empty");
+ return NULL;
+ }
+
+ argvlist = PyMem_NEW(EXECV_CHAR *, argc+1);
+ if (argvlist == NULL) {
+ return PyErr_NoMemory();
+ }
+ for (i = 0; i < argc; i++) {
+ if (!fsconvert_strdup((*getitem)(argv, i),
+ &argvlist[i])) {
+ free_string_array(argvlist, i);
+ PyErr_SetString(
+ PyExc_TypeError,
+ "spawnv() arg 2 must contain only strings");
+ return NULL;
+ }
+ if (i == 0 && !argvlist[0][0]) {
+ free_string_array(argvlist, i + 1);
+ PyErr_SetString(
+ PyExc_ValueError,
+ "spawnv() arg 2 first element cannot be empty");
+ return NULL;
+ }
+ }
+ argvlist[argc] = NULL;
+
+#if !defined(HAVE_RTPSPAWN)
+ if (mode == _OLD_P_OVERLAY)
+ mode = _P_OVERLAY;
+#endif
+
+ if (PySys_Audit("os.spawn", "iOOO", mode, path->object, argv,
+ Py_None) < 0) {
+ free_string_array(argvlist, argc);
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef HAVE_WSPAWNV
+ spawnval = _wspawnv(mode, path->wide, argvlist);
+#elif defined(HAVE_RTPSPAWN)
+ spawnval = _rtp_spawn(mode, path->narrow, (const char **)argvlist, NULL);
+#else
+ spawnval = _spawnv(mode, path->narrow, argvlist);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ int saved_errno = errno;
+ free_string_array(argvlist, argc);
+
+ if (spawnval == -1) {
+ errno = saved_errno;
+ posix_error();
+ return NULL;
+ }
+ return Py_BuildValue(_Py_PARSE_INTPTR, spawnval);
+}
+
+/*[clinic input]
+os.spawnve
+
+ mode: int
+ Mode of process creation.
+ path: path_t
+ Path of executable file.
+ argv: object
+ Tuple or list of strings.
+ env: object
+ Dictionary of strings mapping to strings.
+ /
+
+Execute the program specified by path in a new process.
+[clinic start generated code]*/
+
+static PyObject *
+os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
+ PyObject *env)
+/*[clinic end generated code: output=30fe85be56fe37ad input=3e40803ee7c4c586]*/
+{
+ EXECV_CHAR **argvlist;
+ EXECV_CHAR **envlist;
+ PyObject *res = NULL;
+ Py_ssize_t argc, i, envc;
+ intptr_t spawnval;
+ PyObject *(*getitem)(PyObject *, Py_ssize_t);
+ Py_ssize_t lastarg = 0;
+
+ /* spawnve has four arguments: (mode, path, argv, env), where
+ argv is a list or tuple of strings and env is a dictionary
+ like posix.environ. */
+
+ if (PyList_Check(argv)) {
+ argc = PyList_Size(argv);
+ getitem = PyList_GetItem;
+ }
+ else if (PyTuple_Check(argv)) {
+ argc = PyTuple_Size(argv);
+ getitem = PyTuple_GetItem;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "spawnve() arg 2 must be a tuple or list");
+ goto fail_0;
+ }
+ if (argc == 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "spawnve() arg 2 cannot be empty");
+ goto fail_0;
+ }
+ if (!PyMapping_Check(env)) {
+ PyErr_SetString(PyExc_TypeError,
+ "spawnve() arg 3 must be a mapping object");
+ goto fail_0;
+ }
+
+ argvlist = PyMem_NEW(EXECV_CHAR *, argc+1);
+ if (argvlist == NULL) {
+ PyErr_NoMemory();
+ goto fail_0;
+ }
+ for (i = 0; i < argc; i++) {
+ if (!fsconvert_strdup((*getitem)(argv, i),
+ &argvlist[i]))
+ {
+ lastarg = i;
+ goto fail_1;
+ }
+ if (i == 0 && !argvlist[0][0]) {
+ lastarg = i + 1;
+ PyErr_SetString(
+ PyExc_ValueError,
+ "spawnv() arg 2 first element cannot be empty");
+ goto fail_1;
+ }
+ }
+ lastarg = argc;
+ argvlist[argc] = NULL;
+
+ envlist = parse_envlist(env, &envc);
+ if (envlist == NULL)
+ goto fail_1;
+
+#if !defined(HAVE_RTPSPAWN)
+ if (mode == _OLD_P_OVERLAY)
+ mode = _P_OVERLAY;
+#endif
+
+ if (PySys_Audit("os.spawn", "iOOO", mode, path->object, argv, env) < 0) {
+ goto fail_2;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef HAVE_WSPAWNV
+ spawnval = _wspawnve(mode, path->wide, argvlist, envlist);
+#elif defined(HAVE_RTPSPAWN)
+ spawnval = _rtp_spawn(mode, path->narrow, (const char **)argvlist,
+ (const char **)envlist);
+#else
+ spawnval = _spawnve(mode, path->narrow, argvlist, envlist);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ if (spawnval == -1)
+ (void) posix_error();
+ else
+ res = Py_BuildValue(_Py_PARSE_INTPTR, spawnval);
+
+ fail_2:
+ while (--envc >= 0) {
+ PyMem_Free(envlist[envc]);
+ }
+ PyMem_Free(envlist);
+ fail_1:
+ free_string_array(argvlist, lastarg);
+ fail_0:
+ return res;
+}
+
+#endif /* HAVE_SPAWNV */
+
+#ifdef HAVE_FORK
+
+/* Helper function to validate arguments.
+ Returns 0 on success. non-zero on failure with a TypeError raised.
+ If obj is non-NULL it must be callable. */
+static int
+check_null_or_callable(PyObject *obj, const char* obj_name)
+{
+ if (obj && !PyCallable_Check(obj)) {
+ PyErr_Format(PyExc_TypeError, "'%s' must be callable, not %s",
+ obj_name, _PyType_Name(Py_TYPE(obj)));
+ return -1;
+ }
+ return 0;
+}
+
+/*[clinic input]
+os.register_at_fork
+
+ *
+ before: object=NULL
+ A callable to be called in the parent before the fork() syscall.
+ after_in_child: object=NULL
+ A callable to be called in the child after fork().
+ after_in_parent: object=NULL
+ A callable to be called in the parent after fork().
+
+Register callables to be called when forking a new process.
+
+'before' callbacks are called in reverse order.
+'after_in_child' and 'after_in_parent' callbacks are called in order.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_register_at_fork_impl(PyObject *module, PyObject *before,
+ PyObject *after_in_child, PyObject *after_in_parent)
+/*[clinic end generated code: output=5398ac75e8e97625 input=cd1187aa85d2312e]*/
+{
+ PyInterpreterState *interp;
+
+ if (!before && !after_in_child && !after_in_parent) {
+ PyErr_SetString(PyExc_TypeError, "At least one argument is required.");
+ return NULL;
+ }
+ if (check_null_or_callable(before, "before") ||
+ check_null_or_callable(after_in_child, "after_in_child") ||
+ check_null_or_callable(after_in_parent, "after_in_parent")) {
+ return NULL;
+ }
+ interp = _PyInterpreterState_GET();
+
+ if (register_at_forker(&interp->before_forkers, before)) {
+ return NULL;
+ }
+ if (register_at_forker(&interp->after_forkers_child, after_in_child)) {
+ return NULL;
+ }
+ if (register_at_forker(&interp->after_forkers_parent, after_in_parent)) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_FORK */
+
+// Common code to raise a warning if we detect there is more than one thread
+// running in the process. Best effort, silent if unable to count threads.
+// Constraint: Quick. Never overcounts. Never leaves an error set.
+//
+// This code might do an import, thus acquiring the import lock, which
+// PyOS_BeforeFork() also does. As this should only be called from
+// the parent process, it is in the same thread so that works.
+static void warn_about_fork_with_threads(const char* name) {
+ // TODO: Consider making an `os` module API to return the current number
+ // of threads in the process. That'd presumably use this platform code but
+ // raise an error rather than using the inaccurate fallback.
+ Py_ssize_t num_python_threads = 0;
+#if defined(__APPLE__) && defined(HAVE_GETPID)
+ mach_port_t macos_self = mach_task_self();
+ mach_port_t macos_task;
+ if (task_for_pid(macos_self, getpid(), &macos_task) == KERN_SUCCESS) {
+ thread_array_t macos_threads;
+ mach_msg_type_number_t macos_n_threads;
+ if (task_threads(macos_task, &macos_threads,
+ &macos_n_threads) == KERN_SUCCESS) {
+ num_python_threads = macos_n_threads;
+ }
+ }
+#elif defined(__linux__)
+ // Linux /proc/self/stat 20th field is the number of threads.
+ FILE* proc_stat = fopen("/proc/self/stat", "r");
+ if (proc_stat) {
+ size_t n;
+ // Size chosen arbitrarily. ~60% more bytes than a 20th column index
+ // observed on the author's workstation.
+ char stat_line[160];
+ n = fread(&stat_line, 1, 159, proc_stat);
+ stat_line[n] = '\0';
+ fclose(proc_stat);
+
+ char *saveptr = NULL;
+ char *field = strtok_r(stat_line, " ", &saveptr);
+ unsigned int idx;
+ for (idx = 19; idx && field; --idx) {
+ field = strtok_r(NULL, " ", &saveptr);
+ }
+ if (idx == 0 && field) { // found the 20th field
+ num_python_threads = atoi(field); // 0 on error
+ }
+ }
+#endif
+ if (num_python_threads <= 0) {
+ // Fall back to just the number our threading module knows about.
+ // An incomplete view of the world, but better than nothing.
+ PyObject *threading = PyImport_GetModule(&_Py_ID(threading));
+ if (!threading) {
+ PyErr_Clear();
+ return;
+ }
+ PyObject *threading_active =
+ PyObject_GetAttr(threading, &_Py_ID(_active));
+ if (!threading_active) {
+ PyErr_Clear();
+ Py_DECREF(threading);
+ return;
+ }
+ PyObject *threading_limbo =
+ PyObject_GetAttr(threading, &_Py_ID(_limbo));
+ if (!threading_limbo) {
+ PyErr_Clear();
+ Py_DECREF(threading);
+ Py_DECREF(threading_active);
+ return;
+ }
+ Py_DECREF(threading);
+ // Duplicating what threading.active_count() does but without holding
+ // threading._active_limbo_lock so our count could be inaccurate if
+ // these dicts are mid-update from another thread. Not a big deal.
+ // Worst case if someone replaced threading._active or threading._limbo
+ // with non-dicts, we get -1 from *Length() below and undercount.
+ // Nobody should, but we're best effort so we clear errors and move on.
+ num_python_threads = (PyMapping_Length(threading_active)
+ + PyMapping_Length(threading_limbo));
+ PyErr_Clear();
+ Py_DECREF(threading_active);
+ Py_DECREF(threading_limbo);
+ }
+ if (num_python_threads > 1) {
+ PyErr_WarnFormat(
+ PyExc_DeprecationWarning, 1,
+#ifdef HAVE_GETPID
+ "This process (pid=%d) is multi-threaded, "
+#else
+ "This process is multi-threaded, "
+#endif
+ "use of %s() may lead to deadlocks in the child.",
+#ifdef HAVE_GETPID
+ getpid(),
+#endif
+ name);
+ PyErr_Clear();
+ }
+}
+
+#ifdef HAVE_FORK1
+/*[clinic input]
+os.fork1
+
+Fork a child process with a single multiplexed (i.e., not bound) thread.
+
+Return 0 to child process and PID of child to parent process.
+[clinic start generated code]*/
+
+static PyObject *
+os_fork1_impl(PyObject *module)
+/*[clinic end generated code: output=0de8e67ce2a310bc input=12db02167893926e]*/
+{
+ pid_t pid;
+
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (interp->finalizing) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "can't fork at interpreter shutdown");
+ return NULL;
+ }
+ if (!_Py_IsMainInterpreter(interp)) {
+ PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters");
+ return NULL;
+ }
+ PyOS_BeforeFork();
+ pid = fork1();
+ int saved_errno = errno;
+ if (pid == 0) {
+ /* child: this clobbers and resets the import lock. */
+ PyOS_AfterFork_Child();
+ } else {
+ warn_about_fork_with_threads("fork1");
+ /* parent: release the import lock. */
+ PyOS_AfterFork_Parent();
+ }
+ if (pid == -1) {
+ errno = saved_errno;
+ return posix_error();
+ }
+ return PyLong_FromPid(pid);
+}
+#endif /* HAVE_FORK1 */
+
+
+#ifdef HAVE_FORK
+/*[clinic input]
+os.fork
+
+Fork a child process.
+
+Return 0 to child process and PID of child to parent process.
+[clinic start generated code]*/
+
+static PyObject *
+os_fork_impl(PyObject *module)
+/*[clinic end generated code: output=3626c81f98985d49 input=13c956413110eeaa]*/
+{
+ pid_t pid;
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (interp->finalizing) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "can't fork at interpreter shutdown");
+ return NULL;
+ }
+ if (!_PyInterpreterState_HasFeature(interp, Py_RTFLAGS_FORK)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "fork not supported for isolated subinterpreters");
+ return NULL;
+ }
+ if (PySys_Audit("os.fork", NULL) < 0) {
+ return NULL;
+ }
+ PyOS_BeforeFork();
+ pid = fork();
+ int saved_errno = errno;
+ if (pid == 0) {
+ /* child: this clobbers and resets the import lock. */
+ PyOS_AfterFork_Child();
+ } else {
+ warn_about_fork_with_threads("fork");
+ /* parent: release the import lock. */
+ PyOS_AfterFork_Parent();
+ }
+ if (pid == -1) {
+ errno = saved_errno;
+ return posix_error();
+ }
+ return PyLong_FromPid(pid);
+}
+#endif /* HAVE_FORK */
+
+
+#ifdef HAVE_SCHED_H
+#ifdef HAVE_SCHED_GET_PRIORITY_MAX
+/*[clinic input]
+os.sched_get_priority_max
+
+ policy: int
+
+Get the maximum scheduling priority for policy.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_get_priority_max_impl(PyObject *module, int policy)
+/*[clinic end generated code: output=9e465c6e43130521 input=2097b7998eca6874]*/
+{
+ int max;
+
+ max = sched_get_priority_max(policy);
+ if (max < 0)
+ return posix_error();
+ return PyLong_FromLong(max);
+}
+
+
+/*[clinic input]
+os.sched_get_priority_min
+
+ policy: int
+
+Get the minimum scheduling priority for policy.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_get_priority_min_impl(PyObject *module, int policy)
+/*[clinic end generated code: output=7595c1138cc47a6d input=21bc8fa0d70983bf]*/
+{
+ int min = sched_get_priority_min(policy);
+ if (min < 0)
+ return posix_error();
+ return PyLong_FromLong(min);
+}
+#endif /* HAVE_SCHED_GET_PRIORITY_MAX */
+
+
+#ifdef HAVE_SCHED_SETSCHEDULER
+/*[clinic input]
+os.sched_getscheduler
+ pid: pid_t
+ /
+
+Get the scheduling policy for the process identified by pid.
+
+Passing 0 for pid returns the scheduling policy for the calling process.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_getscheduler_impl(PyObject *module, pid_t pid)
+/*[clinic end generated code: output=dce4c0bd3f1b34c8 input=8d99dac505485ac8]*/
+{
+ int policy;
+
+ policy = sched_getscheduler(pid);
+ if (policy < 0)
+ return posix_error();
+ return PyLong_FromLong(policy);
+}
+#endif /* HAVE_SCHED_SETSCHEDULER */
+
+
+#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
+/*[clinic input]
+class os.sched_param "PyObject *" "SchedParamType"
+
+@classmethod
+os.sched_param.__new__
+
+ sched_priority: object
+ A scheduling parameter.
+
+Currently has only one field: sched_priority
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_param_impl(PyTypeObject *type, PyObject *sched_priority)
+/*[clinic end generated code: output=48f4067d60f48c13 input=eb42909a2c0e3e6c]*/
+{
+ PyObject *res;
+
+ res = PyStructSequence_New(type);
+ if (!res)
+ return NULL;
+ PyStructSequence_SET_ITEM(res, 0, Py_NewRef(sched_priority));
+ return res;
+}
+
+PyDoc_VAR(os_sched_param__doc__);
+
+static PyStructSequence_Field sched_param_fields[] = {
+ {"sched_priority", "the scheduling priority"},
+ {0}
+};
+
+static PyStructSequence_Desc sched_param_desc = {
+ "sched_param", /* name */
+ os_sched_param__doc__, /* doc */
+ sched_param_fields,
+ 1
+};
+
+static int
+convert_sched_param(PyObject *module, PyObject *param, struct sched_param *res)
+{
+ long priority;
+
+ if (!Py_IS_TYPE(param, (PyTypeObject *)get_posix_state(module)->SchedParamType)) {
+ PyErr_SetString(PyExc_TypeError, "must have a sched_param object");
+ return 0;
+ }
+ priority = PyLong_AsLong(PyStructSequence_GET_ITEM(param, 0));
+ if (priority == -1 && PyErr_Occurred())
+ return 0;
+ if (priority > INT_MAX || priority < INT_MIN) {
+ PyErr_SetString(PyExc_OverflowError, "sched_priority out of range");
+ return 0;
+ }
+ res->sched_priority = Py_SAFE_DOWNCAST(priority, long, int);
+ return 1;
+}
+#endif /* defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) */
+
+
+#ifdef HAVE_SCHED_SETSCHEDULER
+/*[clinic input]
+os.sched_setscheduler
+
+ pid: pid_t
+ policy: int
+ param as param_obj: object
+ /
+
+Set the scheduling policy for the process identified by pid.
+
+If pid is 0, the calling process is changed.
+param is an instance of sched_param.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy,
+ PyObject *param_obj)
+/*[clinic end generated code: output=cde27faa55dc993e input=73013d731bd8fbe9]*/
+{
+ struct sched_param param;
+ if (!convert_sched_param(module, param_obj, &param)) {
+ return NULL;
+ }
+
+ /*
+ ** sched_setscheduler() returns 0 in Linux, but the previous
+ ** scheduling policy under Solaris/Illumos, and others.
+ ** On error, -1 is returned in all Operating Systems.
+ */
+ if (sched_setscheduler(pid, policy, &param) == -1)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SCHED_SETSCHEDULER*/
+
+
+#ifdef HAVE_SCHED_SETPARAM
+/*[clinic input]
+os.sched_getparam
+ pid: pid_t
+ /
+
+Returns scheduling parameters for the process identified by pid.
+
+If pid is 0, returns parameters for the calling process.
+Return value is an instance of sched_param.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_getparam_impl(PyObject *module, pid_t pid)
+/*[clinic end generated code: output=b194e8708dcf2db8 input=18a1ef9c2efae296]*/
+{
+ struct sched_param param;
+ PyObject *result;
+ PyObject *priority;
+
+ if (sched_getparam(pid, &param))
+ return posix_error();
+ PyObject *SchedParamType = get_posix_state(module)->SchedParamType;
+ result = PyStructSequence_New((PyTypeObject *)SchedParamType);
+ if (!result)
+ return NULL;
+ priority = PyLong_FromLong(param.sched_priority);
+ if (!priority) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ PyStructSequence_SET_ITEM(result, 0, priority);
+ return result;
+}
+
+
+/*[clinic input]
+os.sched_setparam
+ pid: pid_t
+ param as param_obj: object
+ /
+
+Set scheduling parameters for the process identified by pid.
+
+If pid is 0, sets parameters for the calling process.
+param should be an instance of sched_param.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_setparam_impl(PyObject *module, pid_t pid, PyObject *param_obj)
+/*[clinic end generated code: output=f19fe020a53741c1 input=27b98337c8b2dcc7]*/
+{
+ struct sched_param param;
+ if (!convert_sched_param(module, param_obj, &param)) {
+ return NULL;
+ }
+
+ if (sched_setparam(pid, &param))
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SCHED_SETPARAM */
+
+
+#ifdef HAVE_SCHED_RR_GET_INTERVAL
+/*[clinic input]
+os.sched_rr_get_interval -> double
+ pid: pid_t
+ /
+
+Return the round-robin quantum for the process identified by pid, in seconds.
+
+Value returned is a float.
+[clinic start generated code]*/
+
+static double
+os_sched_rr_get_interval_impl(PyObject *module, pid_t pid)
+/*[clinic end generated code: output=7e2d935833ab47dc input=2a973da15cca6fae]*/
+{
+ struct timespec interval;
+ if (sched_rr_get_interval(pid, &interval)) {
+ posix_error();
+ return -1.0;
+ }
+#ifdef _Py_MEMORY_SANITIZER
+ __msan_unpoison(&interval, sizeof(interval));
+#endif
+ return (double)interval.tv_sec + 1e-9*interval.tv_nsec;
+}
+#endif /* HAVE_SCHED_RR_GET_INTERVAL */
+
+
+/*[clinic input]
+os.sched_yield
+
+Voluntarily relinquish the CPU.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_yield_impl(PyObject *module)
+/*[clinic end generated code: output=902323500f222cac input=e54d6f98189391d4]*/
+{
+ int result;
+ Py_BEGIN_ALLOW_THREADS
+ result = sched_yield();
+ Py_END_ALLOW_THREADS
+ if (result < 0) {
+ return posix_error();
+ }
+ Py_RETURN_NONE;
+}
+
+#ifdef HAVE_SCHED_SETAFFINITY
+/* The minimum number of CPUs allocated in a cpu_set_t */
+static const int NCPUS_START = sizeof(unsigned long) * CHAR_BIT;
+
+/*[clinic input]
+os.sched_setaffinity
+ pid: pid_t
+ mask : object
+ /
+
+Set the CPU affinity of the process identified by pid to mask.
+
+mask should be an iterable of integers identifying CPUs.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask)
+/*[clinic end generated code: output=882d7dd9a229335b input=a0791a597c7085ba]*/
+{
+ int ncpus;
+ size_t setsize;
+ cpu_set_t *cpu_set = NULL;
+ PyObject *iterator = NULL, *item;
+
+ iterator = PyObject_GetIter(mask);
+ if (iterator == NULL)
+ return NULL;
+
+ ncpus = NCPUS_START;
+ setsize = CPU_ALLOC_SIZE(ncpus);
+ cpu_set = CPU_ALLOC(ncpus);
+ if (cpu_set == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ CPU_ZERO_S(setsize, cpu_set);
+
+ while ((item = PyIter_Next(iterator))) {
+ long cpu;
+ if (!PyLong_Check(item)) {
+ PyErr_Format(PyExc_TypeError,
+ "expected an iterator of ints, "
+ "but iterator yielded %R",
+ Py_TYPE(item));
+ Py_DECREF(item);
+ goto error;
+ }
+ cpu = PyLong_AsLong(item);
+ Py_DECREF(item);
+ if (cpu < 0) {
+ if (!PyErr_Occurred())
+ PyErr_SetString(PyExc_ValueError, "negative CPU number");
+ goto error;
+ }
+ if (cpu > INT_MAX - 1) {
+ PyErr_SetString(PyExc_OverflowError, "CPU number too large");
+ goto error;
+ }
+ if (cpu >= ncpus) {
+ /* Grow CPU mask to fit the CPU number */
+ int newncpus = ncpus;
+ cpu_set_t *newmask;
+ size_t newsetsize;
+ while (newncpus <= cpu) {
+ if (newncpus > INT_MAX / 2)
+ newncpus = cpu + 1;
+ else
+ newncpus = newncpus * 2;
+ }
+ newmask = CPU_ALLOC(newncpus);
+ if (newmask == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ newsetsize = CPU_ALLOC_SIZE(newncpus);
+ CPU_ZERO_S(newsetsize, newmask);
+ memcpy(newmask, cpu_set, setsize);
+ CPU_FREE(cpu_set);
+ setsize = newsetsize;
+ cpu_set = newmask;
+ ncpus = newncpus;
+ }
+ CPU_SET_S(cpu, setsize, cpu_set);
+ }
+ if (PyErr_Occurred()) {
+ goto error;
+ }
+ Py_CLEAR(iterator);
+
+ if (sched_setaffinity(pid, setsize, cpu_set)) {
+ posix_error();
+ goto error;
+ }
+ CPU_FREE(cpu_set);
+ Py_RETURN_NONE;
+
+error:
+ if (cpu_set)
+ CPU_FREE(cpu_set);
+ Py_XDECREF(iterator);
+ return NULL;
+}
+
+
+/*[clinic input]
+os.sched_getaffinity
+ pid: pid_t
+ /
+
+Return the affinity of the process identified by pid (or the current process if zero).
+
+The affinity is returned as a set of CPU identifiers.
+[clinic start generated code]*/
+
+static PyObject *
+os_sched_getaffinity_impl(PyObject *module, pid_t pid)
+/*[clinic end generated code: output=f726f2c193c17a4f input=983ce7cb4a565980]*/
+{
+ int cpu, ncpus, count;
+ size_t setsize;
+ cpu_set_t *mask = NULL;
+ PyObject *res = NULL;
+
+ ncpus = NCPUS_START;
+ while (1) {
+ setsize = CPU_ALLOC_SIZE(ncpus);
+ mask = CPU_ALLOC(ncpus);
+ if (mask == NULL)
+ return PyErr_NoMemory();
+ if (sched_getaffinity(pid, setsize, mask) == 0)
+ break;
+ CPU_FREE(mask);
+ if (errno != EINVAL)
+ return posix_error();
+ if (ncpus > INT_MAX / 2) {
+ PyErr_SetString(PyExc_OverflowError, "could not allocate "
+ "a large enough CPU set");
+ return NULL;
+ }
+ ncpus = ncpus * 2;
+ }
+
+ res = PySet_New(NULL);
+ if (res == NULL)
+ goto error;
+ for (cpu = 0, count = CPU_COUNT_S(setsize, mask); count; cpu++) {
+ if (CPU_ISSET_S(cpu, setsize, mask)) {
+ PyObject *cpu_num = PyLong_FromLong(cpu);
+ --count;
+ if (cpu_num == NULL)
+ goto error;
+ if (PySet_Add(res, cpu_num)) {
+ Py_DECREF(cpu_num);
+ goto error;
+ }
+ Py_DECREF(cpu_num);
+ }
+ }
+ CPU_FREE(mask);
+ return res;
+
+error:
+ if (mask)
+ CPU_FREE(mask);
+ Py_XDECREF(res);
+ return NULL;
+}
+
+#endif /* HAVE_SCHED_SETAFFINITY */
+
+#endif /* HAVE_SCHED_H */
+
+
+/* AIX uses /dev/ptc but is otherwise the same as /dev/ptmx */
+#if defined(HAVE_DEV_PTC) && !defined(HAVE_DEV_PTMX)
+# define DEV_PTY_FILE "/dev/ptc"
+# define HAVE_DEV_PTMX
+#else
+# define DEV_PTY_FILE "/dev/ptmx"
+#endif
+
+#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_LOGIN_TTY) || defined(HAVE_DEV_PTMX)
+#ifdef HAVE_PTY_H
+#include <pty.h>
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif /* HAVE_UTMP_H */
+#elif defined(HAVE_LIBUTIL_H)
+#include <libutil.h>
+#elif defined(HAVE_UTIL_H)
+#include <util.h>
+#endif /* HAVE_PTY_H */
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#else
+ #define __SID ('S' << 8)
+ #define I_PUSH (__SID | 2)
+#endif
+#endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_LOGIN_TTY) || defined(HAVE_DEV_PTMX) */
+
+
+#if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)
+/*[clinic input]
+os.openpty
+
+Open a pseudo-terminal.
+
+Return a tuple of (master_fd, slave_fd) containing open file descriptors
+for both the master and slave ends.
+[clinic start generated code]*/
+
+static PyObject *
+os_openpty_impl(PyObject *module)
+/*[clinic end generated code: output=98841ce5ec9cef3c input=f3d99fd99e762907]*/
+{
+ int master_fd = -1, slave_fd = -1;
+#ifndef HAVE_OPENPTY
+ char * slave_name;
+#endif
+#if defined(HAVE_DEV_PTMX) && !defined(HAVE_OPENPTY) && !defined(HAVE__GETPTY)
+ PyOS_sighandler_t sig_saved;
+#if defined(__sun) && defined(__SVR4)
+ extern char *ptsname(int fildes);
+#endif
+#endif
+
+#ifdef HAVE_OPENPTY
+ if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
+ goto posix_error;
+
+ if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
+ goto error;
+ if (_Py_set_inheritable(slave_fd, 0, NULL) < 0)
+ goto error;
+
+#elif defined(HAVE__GETPTY)
+ slave_name = _getpty(&master_fd, O_RDWR, 0666, 0);
+ if (slave_name == NULL)
+ goto posix_error;
+ if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
+ goto error;
+
+ slave_fd = _Py_open(slave_name, O_RDWR);
+ if (slave_fd < 0)
+ goto error;
+
+#else
+ master_fd = open(DEV_PTY_FILE, O_RDWR | O_NOCTTY); /* open master */
+ if (master_fd < 0)
+ goto posix_error;
+
+ sig_saved = PyOS_setsig(SIGCHLD, SIG_DFL);
+
+ /* change permission of slave */
+ if (grantpt(master_fd) < 0) {
+ int saved_errno = errno;
+ PyOS_setsig(SIGCHLD, sig_saved);
+ errno = saved_errno;
+ goto posix_error;
+ }
+
+ /* unlock slave */
+ if (unlockpt(master_fd) < 0) {
+ int saved_errno = errno;
+ PyOS_setsig(SIGCHLD, sig_saved);
+ errno = saved_errno;
+ goto posix_error;
+ }
+
+ PyOS_setsig(SIGCHLD, sig_saved);
+
+ slave_name = ptsname(master_fd); /* get name of slave */
+ if (slave_name == NULL)
+ goto posix_error;
+
+ slave_fd = _Py_open(slave_name, O_RDWR | O_NOCTTY); /* open slave */
+ if (slave_fd == -1)
+ goto error;
+
+ if (_Py_set_inheritable(master_fd, 0, NULL) < 0)
+ goto posix_error;
+
+#if !defined(__CYGWIN__) && !defined(__ANDROID__) && !defined(HAVE_DEV_PTC)
+ ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */
+ ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */
+#ifndef __hpux
+ ioctl(slave_fd, I_PUSH, "ttcompat"); /* push ttcompat */
+#endif /* __hpux */
+#endif /* HAVE_CYGWIN */
+#endif /* HAVE_OPENPTY */
+
+ return Py_BuildValue("(ii)", master_fd, slave_fd);
+
+posix_error:
+ posix_error();
+error:
+ if (master_fd != -1)
+ close(master_fd);
+ if (slave_fd != -1)
+ close(slave_fd);
+ return NULL;
+}
+#endif /* defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX) */
+
+
+#if defined(HAVE_SETSID) && defined(TIOCSCTTY)
+#define HAVE_FALLBACK_LOGIN_TTY 1
+#endif /* defined(HAVE_SETSID) && defined(TIOCSCTTY) */
+
+#if defined(HAVE_LOGIN_TTY) || defined(HAVE_FALLBACK_LOGIN_TTY)
+/*[clinic input]
+os.login_tty
+
+ fd: fildes
+ /
+
+Prepare the tty of which fd is a file descriptor for a new login session.
+
+Make the calling process a session leader; make the tty the
+controlling tty, the stdin, the stdout, and the stderr of the
+calling process; close fd.
+[clinic start generated code]*/
+
+static PyObject *
+os_login_tty_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=495a79911b4cc1bc input=5f298565099903a2]*/
+{
+#ifdef HAVE_LOGIN_TTY
+ if (login_tty(fd) == -1) {
+ return posix_error();
+ }
+#else /* defined(HAVE_FALLBACK_LOGIN_TTY) */
+ /* Establish a new session. */
+ if (setsid() == -1) {
+ return posix_error();
+ }
+
+ /* The tty becomes the controlling terminal. */
+ if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1) {
+ return posix_error();
+ }
+
+ /* The tty becomes stdin/stdout/stderr */
+ if (dup2(fd, 0) == -1 || dup2(fd, 1) == -1 || dup2(fd, 2) == -1) {
+ return posix_error();
+ }
+ if (fd > 2) {
+ close(fd);
+ }
+#endif /* HAVE_LOGIN_TTY */
+ Py_RETURN_NONE;
+}
+#endif /* defined(HAVE_LOGIN_TTY) || defined(HAVE_FALLBACK_LOGIN_TTY) */
+
+
+#ifdef HAVE_FORKPTY
+/*[clinic input]
+os.forkpty
+
+Fork a new process with a new pseudo-terminal as controlling tty.
+
+Returns a tuple of (pid, master_fd).
+Like fork(), return pid of 0 to the child process,
+and pid of child to the parent process.
+To both, return fd of newly opened pseudo-terminal.
+[clinic start generated code]*/
+
+static PyObject *
+os_forkpty_impl(PyObject *module)
+/*[clinic end generated code: output=60d0a5c7512e4087 input=f1f7f4bae3966010]*/
+{
+ int master_fd = -1;
+ pid_t pid;
+
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ if (interp->finalizing) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "can't fork at interpreter shutdown");
+ return NULL;
+ }
+ if (!_Py_IsMainInterpreter(interp)) {
+ PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters");
+ return NULL;
+ }
+ if (PySys_Audit("os.forkpty", NULL) < 0) {
+ return NULL;
+ }
+ PyOS_BeforeFork();
+ pid = forkpty(&master_fd, NULL, NULL, NULL);
+ if (pid == 0) {
+ /* child: this clobbers and resets the import lock. */
+ PyOS_AfterFork_Child();
+ } else {
+ warn_about_fork_with_threads("forkpty");
+ /* parent: release the import lock. */
+ PyOS_AfterFork_Parent();
+ }
+ if (pid == -1) {
+ return posix_error();
+ }
+ return Py_BuildValue("(Ni)", PyLong_FromPid(pid), master_fd);
+}
+#endif /* HAVE_FORKPTY */
+
+
+#ifdef HAVE_GETEGID
+/*[clinic input]
+os.getegid
+
+Return the current process's effective group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_getegid_impl(PyObject *module)
+/*[clinic end generated code: output=67d9be7ac68898a2 input=1596f79ad1107d5d]*/
+{
+ return _PyLong_FromGid(getegid());
+}
+#endif /* HAVE_GETEGID */
+
+
+#ifdef HAVE_GETEUID
+/*[clinic input]
+os.geteuid
+
+Return the current process's effective user id.
+[clinic start generated code]*/
+
+static PyObject *
+os_geteuid_impl(PyObject *module)
+/*[clinic end generated code: output=ea1b60f0d6abb66e input=4644c662d3bd9f19]*/
+{
+ return _PyLong_FromUid(geteuid());
+}
+#endif /* HAVE_GETEUID */
+
+
+#ifdef HAVE_GETGID
+/*[clinic input]
+os.getgid
+
+Return the current process's group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_getgid_impl(PyObject *module)
+/*[clinic end generated code: output=4f28ebc9d3e5dfcf input=58796344cd87c0f6]*/
+{
+ return _PyLong_FromGid(getgid());
+}
+#endif /* HAVE_GETGID */
+
+
+#if defined(HAVE_GETPID)
+/*[clinic input]
+os.getpid
+
+Return the current process id.
+[clinic start generated code]*/
+
+static PyObject *
+os_getpid_impl(PyObject *module)
+/*[clinic end generated code: output=9ea6fdac01ed2b3c input=5a9a00f0ab68aa00]*/
+{
+#if !defined(MS_WINDOWS) || defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
+ return PyLong_FromPid(getpid());
+#else
+ return PyLong_FromUnsignedLong(GetCurrentProcessId());
+#endif
+}
+#endif /* defined(HAVE_GETPID) */
+
+#ifdef NGROUPS_MAX
+#define MAX_GROUPS NGROUPS_MAX
+#else
+ /* defined to be 16 on Solaris7, so this should be a small number */
+#define MAX_GROUPS 64
+#endif
+
+#ifdef HAVE_GETGROUPLIST
+
+#ifdef __APPLE__
+/*[clinic input]
+os.getgrouplist
+
+ user: str
+ username to lookup
+ group as basegid: int
+ base group id of the user
+ /
+
+Returns a list of groups to which a user belongs.
+[clinic start generated code]*/
+
+static PyObject *
+os_getgrouplist_impl(PyObject *module, const char *user, int basegid)
+/*[clinic end generated code: output=6e734697b8c26de0 input=f8d870374b09a490]*/
+#else
+/*[clinic input]
+os.getgrouplist
+
+ user: str
+ username to lookup
+ group as basegid: gid_t
+ base group id of the user
+ /
+
+Returns a list of groups to which a user belongs.
+[clinic start generated code]*/
+
+static PyObject *
+os_getgrouplist_impl(PyObject *module, const char *user, gid_t basegid)
+/*[clinic end generated code: output=0ebd7fb70115575b input=cc61d5c20b08958d]*/
+#endif
+{
+ int i, ngroups;
+ PyObject *list;
+#ifdef __APPLE__
+ int *groups;
+#else
+ gid_t *groups;
+#endif
+
+ /*
+ * NGROUPS_MAX is defined by POSIX.1 as the maximum
+ * number of supplimental groups a users can belong to.
+ * We have to increment it by one because
+ * getgrouplist() returns both the supplemental groups
+ * and the primary group, i.e. all of the groups the
+ * user belongs to.
+ */
+ ngroups = 1 + MAX_GROUPS;
+
+ while (1) {
+#ifdef __APPLE__
+ groups = PyMem_New(int, ngroups);
+#else
+ groups = PyMem_New(gid_t, ngroups);
+#endif
+ if (groups == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ int old_ngroups = ngroups;
+ if (getgrouplist(user, basegid, groups, &ngroups) != -1) {
+ /* Success */
+ break;
+ }
+
+ /* getgrouplist() fails if the group list is too small */
+ PyMem_Free(groups);
+
+ if (ngroups > old_ngroups) {
+ /* If the group list is too small, the glibc implementation of
+ getgrouplist() sets ngroups to the total number of groups and
+ returns -1. */
+ }
+ else {
+ /* Double the group list size */
+ if (ngroups > INT_MAX / 2) {
+ return PyErr_NoMemory();
+ }
+ ngroups *= 2;
+ }
+
+ /* Retry getgrouplist() with a larger group list */
+ }
+
+#ifdef _Py_MEMORY_SANITIZER
+ /* Clang memory sanitizer libc intercepts don't know getgrouplist. */
+ __msan_unpoison(&ngroups, sizeof(ngroups));
+ __msan_unpoison(groups, ngroups*sizeof(*groups));
+#endif
+
+ list = PyList_New(ngroups);
+ if (list == NULL) {
+ PyMem_Free(groups);
+ return NULL;
+ }
+
+ for (i = 0; i < ngroups; i++) {
+#ifdef __APPLE__
+ PyObject *o = PyLong_FromUnsignedLong((unsigned long)groups[i]);
+#else
+ PyObject *o = _PyLong_FromGid(groups[i]);
+#endif
+ if (o == NULL) {
+ Py_DECREF(list);
+ PyMem_Free(groups);
+ return NULL;
+ }
+ PyList_SET_ITEM(list, i, o);
+ }
+
+ PyMem_Free(groups);
+
+ return list;
+}
+#endif /* HAVE_GETGROUPLIST */
+
+
+#ifdef HAVE_GETGROUPS
+/*[clinic input]
+os.getgroups
+
+Return list of supplemental group IDs for the process.
+[clinic start generated code]*/
+
+static PyObject *
+os_getgroups_impl(PyObject *module)
+/*[clinic end generated code: output=42b0c17758561b56 input=d3f109412e6a155c]*/
+{
+ // Call getgroups with length 0 to get the actual number of groups
+ int n = getgroups(0, NULL);
+ if (n < 0) {
+ return posix_error();
+ }
+
+ if (n == 0) {
+ return PyList_New(0);
+ }
+
+ gid_t *grouplist = PyMem_New(gid_t, n);
+ if (grouplist == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ n = getgroups(n, grouplist);
+ if (n == -1) {
+ posix_error();
+ PyMem_Free(grouplist);
+ return NULL;
+ }
+
+ PyObject *result = PyList_New(n);
+ if (result == NULL) {
+ goto error;
+ }
+
+ for (int i = 0; i < n; ++i) {
+ PyObject *group = _PyLong_FromGid(grouplist[i]);
+ if (group == NULL) {
+ goto error;
+ }
+ PyList_SET_ITEM(result, i, group);
+ }
+ PyMem_Free(grouplist);
+
+ return result;
+
+error:
+ PyMem_Free(grouplist);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif /* HAVE_GETGROUPS */
+
+#ifdef HAVE_INITGROUPS
+#ifdef __APPLE__
+/*[clinic input]
+os.initgroups
+
+ username as oname: FSConverter
+ gid: int
+ /
+
+Initialize the group access list.
+
+Call the system initgroups() to initialize the group access list with all of
+the groups of which the specified username is a member, plus the specified
+group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_initgroups_impl(PyObject *module, PyObject *oname, int gid)
+/*[clinic end generated code: output=7f074d30a425fd3a input=df3d54331b0af204]*/
+#else
+/*[clinic input]
+os.initgroups
+
+ username as oname: FSConverter
+ gid: gid_t
+ /
+
+Initialize the group access list.
+
+Call the system initgroups() to initialize the group access list with all of
+the groups of which the specified username is a member, plus the specified
+group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_initgroups_impl(PyObject *module, PyObject *oname, gid_t gid)
+/*[clinic end generated code: output=59341244521a9e3f input=0cb91bdc59a4c564]*/
+#endif
+{
+ const char *username = PyBytes_AS_STRING(oname);
+
+ if (initgroups(username, gid) == -1)
+ return PyErr_SetFromErrno(PyExc_OSError);
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_INITGROUPS */
+
+
+#ifdef HAVE_GETPGID
+/*[clinic input]
+os.getpgid
+
+ pid: pid_t
+
+Call the system call getpgid(), and return the result.
+[clinic start generated code]*/
+
+static PyObject *
+os_getpgid_impl(PyObject *module, pid_t pid)
+/*[clinic end generated code: output=1db95a97be205d18 input=39d710ae3baaf1c7]*/
+{
+ pid_t pgid = getpgid(pid);
+ if (pgid < 0)
+ return posix_error();
+ return PyLong_FromPid(pgid);
+}
+#endif /* HAVE_GETPGID */
+
+
+#ifdef HAVE_GETPGRP
+/*[clinic input]
+os.getpgrp
+
+Return the current process group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_getpgrp_impl(PyObject *module)
+/*[clinic end generated code: output=c4fc381e51103cf3 input=6846fb2bb9a3705e]*/
+{
+#ifdef GETPGRP_HAVE_ARG
+ return PyLong_FromPid(getpgrp(0));
+#else /* GETPGRP_HAVE_ARG */
+ return PyLong_FromPid(getpgrp());
+#endif /* GETPGRP_HAVE_ARG */
+}
+#endif /* HAVE_GETPGRP */
+
+
+#ifdef HAVE_SETPGRP
+/*[clinic input]
+os.setpgrp
+
+Make the current process the leader of its process group.
+[clinic start generated code]*/
+
+static PyObject *
+os_setpgrp_impl(PyObject *module)
+/*[clinic end generated code: output=2554735b0a60f0a0 input=1f0619fcb5731e7e]*/
+{
+#ifdef SETPGRP_HAVE_ARG
+ if (setpgrp(0, 0) < 0)
+#else /* SETPGRP_HAVE_ARG */
+ if (setpgrp() < 0)
+#endif /* SETPGRP_HAVE_ARG */
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETPGRP */
+
+#ifdef HAVE_GETPPID
+
+#ifdef MS_WINDOWS
+#include <processsnapshot.h>
+
+static PyObject*
+win32_getppid(void)
+{
+ DWORD error;
+ PyObject* result = NULL;
+ HANDLE process = GetCurrentProcess();
+
+ HPSS snapshot = NULL;
+ error = PssCaptureSnapshot(process, PSS_CAPTURE_NONE, 0, &snapshot);
+ if (error != ERROR_SUCCESS) {
+ return PyErr_SetFromWindowsErr(error);
+ }
+
+ PSS_PROCESS_INFORMATION info;
+ error = PssQuerySnapshot(snapshot, PSS_QUERY_PROCESS_INFORMATION, &info,
+ sizeof(info));
+ if (error == ERROR_SUCCESS) {
+ result = PyLong_FromUnsignedLong(info.ParentProcessId);
+ }
+ else {
+ result = PyErr_SetFromWindowsErr(error);
+ }
+
+ PssFreeSnapshot(process, snapshot);
+ return result;
+}
+#endif /*MS_WINDOWS*/
+
+
+/*[clinic input]
+os.getppid
+
+Return the parent's process id.
+
+If the parent process has already exited, Windows machines will still
+return its id; others systems will return the id of the 'init' process (1).
+[clinic start generated code]*/
+
+static PyObject *
+os_getppid_impl(PyObject *module)
+/*[clinic end generated code: output=43b2a946a8c603b4 input=e637cb87539c030e]*/
+{
+#ifdef MS_WINDOWS
+ return win32_getppid();
+#else
+ return PyLong_FromPid(getppid());
+#endif
+}
+#endif /* HAVE_GETPPID */
+
+
+#ifdef HAVE_GETLOGIN
+/*[clinic input]
+os.getlogin
+
+Return the actual login name.
+[clinic start generated code]*/
+
+static PyObject *
+os_getlogin_impl(PyObject *module)
+/*[clinic end generated code: output=a32e66a7e5715dac input=2a21ab1e917163df]*/
+{
+ PyObject *result = NULL;
+#ifdef MS_WINDOWS
+ wchar_t user_name[UNLEN + 1];
+ DWORD num_chars = Py_ARRAY_LENGTH(user_name);
+
+ if (GetUserNameW(user_name, &num_chars)) {
+ /* num_chars is the number of unicode chars plus null terminator */
+ result = PyUnicode_FromWideChar(user_name, num_chars - 1);
+ }
+ else
+ result = PyErr_SetFromWindowsErr(GetLastError());
+#else
+ char *name;
+ int old_errno = errno;
+
+ errno = 0;
+ name = getlogin();
+ if (name == NULL) {
+ if (errno)
+ posix_error();
+ else
+ PyErr_SetString(PyExc_OSError, "unable to determine login name");
+ }
+ else
+ result = PyUnicode_DecodeFSDefault(name);
+ errno = old_errno;
+#endif
+ return result;
+}
+#endif /* HAVE_GETLOGIN */
+
+
+#ifdef HAVE_GETUID
+/*[clinic input]
+os.getuid
+
+Return the current process's user id.
+[clinic start generated code]*/
+
+static PyObject *
+os_getuid_impl(PyObject *module)
+/*[clinic end generated code: output=415c0b401ebed11a input=b53c8b35f110a516]*/
+{
+ return _PyLong_FromUid(getuid());
+}
+#endif /* HAVE_GETUID */
+
+
+#ifdef MS_WINDOWS
+#define HAVE_KILL
+#endif /* MS_WINDOWS */
+
+#ifdef HAVE_KILL
+/*[clinic input]
+os.kill
+
+ pid: pid_t
+ signal: Py_ssize_t
+ /
+
+Kill a process with a signal.
+[clinic start generated code]*/
+
+static PyObject *
+os_kill_impl(PyObject *module, pid_t pid, Py_ssize_t signal)
+/*[clinic end generated code: output=8e346a6701c88568 input=61a36b86ca275ab9]*/
+{
+ if (PySys_Audit("os.kill", "in", pid, signal) < 0) {
+ return NULL;
+ }
+#ifndef MS_WINDOWS
+ if (kill(pid, (int)signal) == -1) {
+ return posix_error();
+ }
+
+ // Check immediately if the signal was sent to the current process.
+ // Don't micro-optimize pid == getpid(), since PyErr_SetString() check
+ // is cheap.
+ if (PyErr_CheckSignals()) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+#else /* !MS_WINDOWS */
+ PyObject *result;
+ DWORD sig = (DWORD)signal;
+ DWORD err;
+ HANDLE handle;
+
+#ifdef HAVE_WINDOWS_CONSOLE_IO
+ /* Console processes which share a common console can be sent CTRL+C or
+ CTRL+BREAK events, provided they handle said events. */
+ if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT) {
+ if (GenerateConsoleCtrlEvent(sig, (DWORD)pid) == 0) {
+ err = GetLastError();
+ PyErr_SetFromWindowsErr(err);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+ }
+#endif /* HAVE_WINDOWS_CONSOLE_IO */
+
+ /* If the signal is outside of what GenerateConsoleCtrlEvent can use,
+ attempt to open and terminate the process. */
+ handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
+ if (handle == NULL) {
+ err = GetLastError();
+ return PyErr_SetFromWindowsErr(err);
+ }
+
+ if (TerminateProcess(handle, sig) == 0) {
+ err = GetLastError();
+ result = PyErr_SetFromWindowsErr(err);
+ } else {
+ result = Py_NewRef(Py_None);
+ }
+
+ CloseHandle(handle);
+ return result;
+#endif /* !MS_WINDOWS */
+}
+#endif /* HAVE_KILL */
+
+
+#ifdef HAVE_KILLPG
+/*[clinic input]
+os.killpg
+
+ pgid: pid_t
+ signal: int
+ /
+
+Kill a process group with a signal.
+[clinic start generated code]*/
+
+static PyObject *
+os_killpg_impl(PyObject *module, pid_t pgid, int signal)
+/*[clinic end generated code: output=6dbcd2f1fdf5fdba input=38b5449eb8faec19]*/
+{
+ if (PySys_Audit("os.killpg", "ii", pgid, signal) < 0) {
+ return NULL;
+ }
+ /* XXX some man pages make the `pgid` parameter an int, others
+ a pid_t. Since getpgrp() returns a pid_t, we assume killpg should
+ take the same type. Moreover, pid_t is always at least as wide as
+ int (else compilation of this module fails), which is safe. */
+ if (killpg(pgid, signal) == -1)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_KILLPG */
+
+
+#ifdef HAVE_PLOCK
+#ifdef HAVE_SYS_LOCK_H
+#include <sys/lock.h>
+#endif
+
+/*[clinic input]
+os.plock
+ op: int
+ /
+
+Lock program segments into memory.");
+[clinic start generated code]*/
+
+static PyObject *
+os_plock_impl(PyObject *module, int op)
+/*[clinic end generated code: output=81424167033b168e input=e6e5e348e1525f60]*/
+{
+ if (plock(op) == -1)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_PLOCK */
+
+
+#ifdef HAVE_SETUID
+/*[clinic input]
+os.setuid
+
+ uid: uid_t
+ /
+
+Set the current process's user id.
+[clinic start generated code]*/
+
+static PyObject *
+os_setuid_impl(PyObject *module, uid_t uid)
+/*[clinic end generated code: output=a0a41fd0d1ec555f input=c921a3285aa22256]*/
+{
+ if (setuid(uid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETUID */
+
+
+#ifdef HAVE_SETEUID
+/*[clinic input]
+os.seteuid
+
+ euid: uid_t
+ /
+
+Set the current process's effective user id.
+[clinic start generated code]*/
+
+static PyObject *
+os_seteuid_impl(PyObject *module, uid_t euid)
+/*[clinic end generated code: output=102e3ad98361519a input=ba93d927e4781aa9]*/
+{
+ if (seteuid(euid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETEUID */
+
+
+#ifdef HAVE_SETEGID
+/*[clinic input]
+os.setegid
+
+ egid: gid_t
+ /
+
+Set the current process's effective group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_setegid_impl(PyObject *module, gid_t egid)
+/*[clinic end generated code: output=4e4b825a6a10258d input=4080526d0ccd6ce3]*/
+{
+ if (setegid(egid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETEGID */
+
+
+#ifdef HAVE_SETREUID
+/*[clinic input]
+os.setreuid
+
+ ruid: uid_t
+ euid: uid_t
+ /
+
+Set the current process's real and effective user ids.
+[clinic start generated code]*/
+
+static PyObject *
+os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid)
+/*[clinic end generated code: output=62d991210006530a input=0ca8978de663880c]*/
+{
+ if (setreuid(ruid, euid) < 0) {
+ return posix_error();
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+#endif /* HAVE_SETREUID */
+
+
+#ifdef HAVE_SETREGID
+/*[clinic input]
+os.setregid
+
+ rgid: gid_t
+ egid: gid_t
+ /
+
+Set the current process's real and effective group ids.
+[clinic start generated code]*/
+
+static PyObject *
+os_setregid_impl(PyObject *module, gid_t rgid, gid_t egid)
+/*[clinic end generated code: output=aa803835cf5342f3 input=c59499f72846db78]*/
+{
+ if (setregid(rgid, egid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETREGID */
+
+
+#ifdef HAVE_SETGID
+/*[clinic input]
+os.setgid
+ gid: gid_t
+ /
+
+Set the current process's group id.
+[clinic start generated code]*/
+
+static PyObject *
+os_setgid_impl(PyObject *module, gid_t gid)
+/*[clinic end generated code: output=bdccd7403f6ad8c3 input=27d30c4059045dc6]*/
+{
+ if (setgid(gid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETGID */
+
+
+#ifdef HAVE_SETGROUPS
+/*[clinic input]
+os.setgroups
+
+ groups: object
+ /
+
+Set the groups of the current process to list.
+[clinic start generated code]*/
+
+static PyObject *
+os_setgroups(PyObject *module, PyObject *groups)
+/*[clinic end generated code: output=3fcb32aad58c5ecd input=fa742ca3daf85a7e]*/
+{
+ if (!PySequence_Check(groups)) {
+ PyErr_SetString(PyExc_TypeError, "setgroups argument must be a sequence");
+ return NULL;
+ }
+ Py_ssize_t len = PySequence_Size(groups);
+ if (len < 0) {
+ return NULL;
+ }
+ if (len > MAX_GROUPS) {
+ PyErr_SetString(PyExc_ValueError, "too many groups");
+ return NULL;
+ }
+
+ gid_t *grouplist = PyMem_New(gid_t, len);
+ for (Py_ssize_t i = 0; i < len; i++) {
+ PyObject *elem;
+ elem = PySequence_GetItem(groups, i);
+ if (!elem) {
+ PyMem_Free(grouplist);
+ return NULL;
+ }
+ if (!PyLong_Check(elem)) {
+ PyErr_SetString(PyExc_TypeError,
+ "groups must be integers");
+ Py_DECREF(elem);
+ PyMem_Free(grouplist);
+ return NULL;
+ } else {
+ if (!_Py_Gid_Converter(elem, &grouplist[i])) {
+ Py_DECREF(elem);
+ PyMem_Free(grouplist);
+ return NULL;
+ }
+ }
+ Py_DECREF(elem);
+ }
+
+ if (setgroups(len, grouplist) < 0) {
+ posix_error();
+ PyMem_Free(grouplist);
+ return NULL;
+ }
+ PyMem_Free(grouplist);
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETGROUPS */
+
+#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
+static PyObject *
+wait_helper(PyObject *module, pid_t pid, int status, struct rusage *ru)
+{
+ PyObject *result;
+ PyObject *struct_rusage;
+
+ if (pid == -1)
+ return posix_error();
+
+ // If wait succeeded but no child was ready to report status, ru will not
+ // have been populated.
+ if (pid == 0) {
+ memset(ru, 0, sizeof(*ru));
+ }
+
+ struct_rusage = _PyImport_GetModuleAttrString("resource", "struct_rusage");
+ if (struct_rusage == NULL)
+ return NULL;
+
+ /* XXX(nnorwitz): Copied (w/mods) from resource.c, there should be only one. */
+ result = PyStructSequence_New((PyTypeObject*) struct_rusage);
+ Py_DECREF(struct_rusage);
+ if (!result)
+ return NULL;
+
+#ifndef doubletime
+#define doubletime(TV) ((double)(TV).tv_sec + (TV).tv_usec * 0.000001)
+#endif
+
+ PyStructSequence_SET_ITEM(result, 0,
+ PyFloat_FromDouble(doubletime(ru->ru_utime)));
+ PyStructSequence_SET_ITEM(result, 1,
+ PyFloat_FromDouble(doubletime(ru->ru_stime)));
+#define SET_INT(result, index, value)\
+ PyStructSequence_SET_ITEM(result, index, PyLong_FromLong(value))
+ SET_INT(result, 2, ru->ru_maxrss);
+ SET_INT(result, 3, ru->ru_ixrss);
+ SET_INT(result, 4, ru->ru_idrss);
+ SET_INT(result, 5, ru->ru_isrss);
+ SET_INT(result, 6, ru->ru_minflt);
+ SET_INT(result, 7, ru->ru_majflt);
+ SET_INT(result, 8, ru->ru_nswap);
+ SET_INT(result, 9, ru->ru_inblock);
+ SET_INT(result, 10, ru->ru_oublock);
+ SET_INT(result, 11, ru->ru_msgsnd);
+ SET_INT(result, 12, ru->ru_msgrcv);
+ SET_INT(result, 13, ru->ru_nsignals);
+ SET_INT(result, 14, ru->ru_nvcsw);
+ SET_INT(result, 15, ru->ru_nivcsw);
+#undef SET_INT
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return Py_BuildValue("NiN", PyLong_FromPid(pid), status, result);
+}
+#endif /* HAVE_WAIT3 || HAVE_WAIT4 */
+
+
+#ifdef HAVE_WAIT3
+/*[clinic input]
+os.wait3
+
+ options: int
+Wait for completion of a child process.
+
+Returns a tuple of information about the child process:
+ (pid, status, rusage)
+[clinic start generated code]*/
+
+static PyObject *
+os_wait3_impl(PyObject *module, int options)
+/*[clinic end generated code: output=92c3224e6f28217a input=8ac4c56956b61710]*/
+{
+ pid_t pid;
+ struct rusage ru;
+ int async_err = 0;
+ WAIT_TYPE status;
+ WAIT_STATUS_INT(status) = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ pid = wait3(&status, options, &ru);
+ Py_END_ALLOW_THREADS
+ } while (pid < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (pid < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ return wait_helper(module, pid, WAIT_STATUS_INT(status), &ru);
+}
+#endif /* HAVE_WAIT3 */
+
+
+#ifdef HAVE_WAIT4
+/*[clinic input]
+
+os.wait4
+
+ pid: pid_t
+ options: int
+
+Wait for completion of a specific child process.
+
+Returns a tuple of information about the child process:
+ (pid, status, rusage)
+[clinic start generated code]*/
+
+static PyObject *
+os_wait4_impl(PyObject *module, pid_t pid, int options)
+/*[clinic end generated code: output=66195aa507b35f70 input=d11deed0750600ba]*/
+{
+ pid_t res;
+ struct rusage ru;
+ int async_err = 0;
+ WAIT_TYPE status;
+ WAIT_STATUS_INT(status) = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ res = wait4(pid, &status, options, &ru);
+ Py_END_ALLOW_THREADS
+ } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ return wait_helper(module, res, WAIT_STATUS_INT(status), &ru);
+}
+#endif /* HAVE_WAIT4 */
+
+
+#if defined(HAVE_WAITID) && !defined(__APPLE__)
+/*[clinic input]
+os.waitid
+
+ idtype: idtype_t
+ Must be one of be P_PID, P_PGID or P_ALL.
+ id: id_t
+ The id to wait on.
+ options: int
+ Constructed from the ORing of one or more of WEXITED, WSTOPPED
+ or WCONTINUED and additionally may be ORed with WNOHANG or WNOWAIT.
+ /
+
+Returns the result of waiting for a process or processes.
+
+Returns either waitid_result or None if WNOHANG is specified and there are
+no children in a waitable state.
+[clinic start generated code]*/
+
+static PyObject *
+os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options)
+/*[clinic end generated code: output=5d2e1c0bde61f4d8 input=d8e7f76e052b7920]*/
+{
+ PyObject *result;
+ int res;
+ int async_err = 0;
+ siginfo_t si;
+ si.si_pid = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ res = waitid(idtype, id, &si, options);
+ Py_END_ALLOW_THREADS
+ } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ if (si.si_pid == 0)
+ Py_RETURN_NONE;
+
+ PyObject *WaitidResultType = get_posix_state(module)->WaitidResultType;
+ result = PyStructSequence_New((PyTypeObject *)WaitidResultType);
+ if (!result)
+ return NULL;
+
+ PyStructSequence_SET_ITEM(result, 0, PyLong_FromPid(si.si_pid));
+ PyStructSequence_SET_ITEM(result, 1, _PyLong_FromUid(si.si_uid));
+ PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si.si_signo)));
+ PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong((long)(si.si_status)));
+ PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong((long)(si.si_code)));
+ if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+#endif /* defined(HAVE_WAITID) && !defined(__APPLE__) */
+
+
+#if defined(HAVE_WAITPID)
+/*[clinic input]
+os.waitpid
+ pid: pid_t
+ options: int
+ /
+
+Wait for completion of a given child process.
+
+Returns a tuple of information regarding the child process:
+ (pid, status)
+
+The options argument is ignored on Windows.
+[clinic start generated code]*/
+
+static PyObject *
+os_waitpid_impl(PyObject *module, pid_t pid, int options)
+/*[clinic end generated code: output=5c37c06887a20270 input=0bf1666b8758fda3]*/
+{
+ pid_t res;
+ int async_err = 0;
+ WAIT_TYPE status;
+ WAIT_STATUS_INT(status) = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ res = waitpid(pid, &status, options);
+ Py_END_ALLOW_THREADS
+ } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ return Py_BuildValue("Ni", PyLong_FromPid(res), WAIT_STATUS_INT(status));
+}
+#elif defined(HAVE_CWAIT)
+/* MS C has a variant of waitpid() that's usable for most purposes. */
+/*[clinic input]
+os.waitpid
+ pid: intptr_t
+ options: int
+ /
+
+Wait for completion of a given process.
+
+Returns a tuple of information regarding the process:
+ (pid, status << 8)
+
+The options argument is ignored on Windows.
+[clinic start generated code]*/
+
+static PyObject *
+os_waitpid_impl(PyObject *module, intptr_t pid, int options)
+/*[clinic end generated code: output=be836b221271d538 input=40f2440c515410f8]*/
+{
+ int status;
+ intptr_t res;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ res = _cwait(&status, pid, options);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ unsigned long long ustatus = (unsigned int)status;
+
+ /* shift the status left a byte so this is more like the POSIX waitpid */
+ return Py_BuildValue(_Py_PARSE_INTPTR "K", res, ustatus << 8);
+}
+#endif
+
+
+#ifdef HAVE_WAIT
+/*[clinic input]
+os.wait
+
+Wait for completion of a child process.
+
+Returns a tuple of information about the child process:
+ (pid, status)
+[clinic start generated code]*/
+
+static PyObject *
+os_wait_impl(PyObject *module)
+/*[clinic end generated code: output=6bc419ac32fb364b input=03b0182d4a4700ce]*/
+{
+ pid_t pid;
+ int async_err = 0;
+ WAIT_TYPE status;
+ WAIT_STATUS_INT(status) = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ pid = wait(&status);
+ Py_END_ALLOW_THREADS
+ } while (pid < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (pid < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status));
+}
+#endif /* HAVE_WAIT */
+
+#if defined(__linux__) && defined(__NR_pidfd_open)
+/*[clinic input]
+os.pidfd_open
+ pid: pid_t
+ flags: unsigned_int = 0
+
+Return a file descriptor referring to the process *pid*.
+
+The descriptor can be used to perform process management without races and
+signals.
+[clinic start generated code]*/
+
+static PyObject *
+os_pidfd_open_impl(PyObject *module, pid_t pid, unsigned int flags)
+/*[clinic end generated code: output=5c7252698947dc41 input=c3fd99ce947ccfef]*/
+{
+ int fd = syscall(__NR_pidfd_open, pid, flags);
+ if (fd < 0) {
+ return posix_error();
+ }
+ return PyLong_FromLong(fd);
+}
+#endif
+
+
+#ifdef HAVE_SETNS
+/*[clinic input]
+os.setns
+ fd: fildes
+ A file descriptor to a namespace.
+ nstype: int = 0
+ Type of namespace.
+
+Move the calling thread into different namespaces.
+[clinic start generated code]*/
+
+static PyObject *
+os_setns_impl(PyObject *module, int fd, int nstype)
+/*[clinic end generated code: output=5dbd055bfb66ecd0 input=42787871226bf3ee]*/
+{
+ int res;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = setns(fd, nstype);
+ Py_END_ALLOW_THREADS
+
+ if (res != 0) {
+ return posix_error();
+ }
+
+ Py_RETURN_NONE;
+}
+#endif
+
+
+#ifdef HAVE_UNSHARE
+/*[clinic input]
+os.unshare
+ flags: int
+ Namespaces to be unshared.
+
+Disassociate parts of a process (or thread) execution context.
+[clinic start generated code]*/
+
+static PyObject *
+os_unshare_impl(PyObject *module, int flags)
+/*[clinic end generated code: output=1b3177906dd237ee input=9e065db3232b8b1b]*/
+{
+ int res;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = unshare(flags);
+ Py_END_ALLOW_THREADS
+
+ if (res != 0) {
+ return posix_error();
+ }
+
+ Py_RETURN_NONE;
+}
+#endif
+
+
+#if defined(HAVE_READLINK) || defined(MS_WINDOWS)
+/*[clinic input]
+os.readlink
+
+ path: path_t
+ *
+ dir_fd: dir_fd(requires='readlinkat') = None
+
+Return a string representing the path to which the symbolic link points.
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+and path should be relative; path will then be relative to that directory.
+
+dir_fd may not be implemented on your platform. If it is unavailable,
+using it will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
+/*[clinic end generated code: output=d21b732a2e814030 input=113c87e0db1ecaf2]*/
+{
+#if defined(HAVE_READLINK)
+ char buffer[MAXPATHLEN+1];
+ ssize_t length;
+#ifdef HAVE_READLINKAT
+ int readlinkat_unavailable = 0;
+#endif
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_READLINKAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_READLINKAT_RUNTIME) {
+ length = readlinkat(dir_fd, path->narrow, buffer, MAXPATHLEN);
+ } else {
+ readlinkat_unavailable = 1;
+ }
+ } else
+#endif
+ length = readlink(path->narrow, buffer, MAXPATHLEN);
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_READLINKAT
+ if (readlinkat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (length < 0) {
+ return path_error(path);
+ }
+ buffer[length] = '\0';
+
+ if (PyUnicode_Check(path->object))
+ return PyUnicode_DecodeFSDefaultAndSize(buffer, length);
+ else
+ return PyBytes_FromStringAndSize(buffer, length);
+#elif defined(MS_WINDOWS)
+ DWORD n_bytes_returned;
+ DWORD io_result = 0;
+ HANDLE reparse_point_handle;
+ char target_buffer[_Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+ _Py_REPARSE_DATA_BUFFER *rdb = (_Py_REPARSE_DATA_BUFFER *)target_buffer;
+ PyObject *result = NULL;
+
+ /* First get a handle to the reparse point */
+ Py_BEGIN_ALLOW_THREADS
+ reparse_point_handle = CreateFileW(
+ path->wide,
+ 0,
+ 0,
+ 0,
+ OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS,
+ 0);
+ if (reparse_point_handle != INVALID_HANDLE_VALUE) {
+ /* New call DeviceIoControl to read the reparse point */
+ io_result = DeviceIoControl(
+ reparse_point_handle,
+ FSCTL_GET_REPARSE_POINT,
+ 0, 0, /* in buffer */
+ target_buffer, sizeof(target_buffer),
+ &n_bytes_returned,
+ 0 /* we're not using OVERLAPPED_IO */
+ );
+ CloseHandle(reparse_point_handle);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (io_result == 0) {
+ return path_error(path);
+ }
+
+ wchar_t *name = NULL;
+ Py_ssize_t nameLen = 0;
+ if (rdb->ReparseTag == IO_REPARSE_TAG_SYMLINK)
+ {
+ name = (wchar_t *)((char*)rdb->SymbolicLinkReparseBuffer.PathBuffer +
+ rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset);
+ nameLen = rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(wchar_t);
+ }
+ else if (rdb->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
+ {
+ name = (wchar_t *)((char*)rdb->MountPointReparseBuffer.PathBuffer +
+ rdb->MountPointReparseBuffer.SubstituteNameOffset);
+ nameLen = rdb->MountPointReparseBuffer.SubstituteNameLength / sizeof(wchar_t);
+ }
+ else
+ {
+ PyErr_SetString(PyExc_ValueError, "not a symbolic link");
+ }
+ if (name) {
+ if (nameLen > 4 && wcsncmp(name, L"\\??\\", 4) == 0) {
+ /* Our buffer is mutable, so this is okay */
+ name[1] = L'\\';
+ }
+ result = PyUnicode_FromWideChar(name, nameLen);
+ if (result && path->narrow) {
+ Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
+ }
+ }
+ return result;
+#endif
+}
+#endif /* defined(HAVE_READLINK) || defined(MS_WINDOWS) */
+
+#if defined(MS_WINDOWS)
+
+/* Remove the last portion of the path - return 0 on success */
+static int
+_dirnameW(WCHAR *path)
+{
+ WCHAR *ptr;
+ size_t length = wcsnlen_s(path, MAX_PATH);
+ if (length == MAX_PATH) {
+ return -1;
+ }
+
+ /* walk the path from the end until a backslash is encountered */
+ for(ptr = path + length; ptr != path; ptr--) {
+ if (*ptr == L'\\' || *ptr == L'/') {
+ break;
+ }
+ }
+ *ptr = 0;
+ return 0;
+}
+
+#endif
+
+#ifdef HAVE_SYMLINK
+
+#if defined(MS_WINDOWS)
+
+/* Is this path absolute? */
+static int
+_is_absW(const WCHAR *path)
+{
+ return path[0] == L'\\' || path[0] == L'/' ||
+ (path[0] && path[1] == L':');
+}
+
+/* join root and rest with a backslash - return 0 on success */
+static int
+_joinW(WCHAR *dest_path, const WCHAR *root, const WCHAR *rest)
+{
+ if (_is_absW(rest)) {
+ return wcscpy_s(dest_path, MAX_PATH, rest);
+ }
+
+ if (wcscpy_s(dest_path, MAX_PATH, root)) {
+ return -1;
+ }
+
+ if (dest_path[0] && wcscat_s(dest_path, MAX_PATH, L"\\")) {
+ return -1;
+ }
+
+ return wcscat_s(dest_path, MAX_PATH, rest);
+}
+
+/* Return True if the path at src relative to dest is a directory */
+static int
+_check_dirW(LPCWSTR src, LPCWSTR dest)
+{
+ WIN32_FILE_ATTRIBUTE_DATA src_info;
+ WCHAR dest_parent[MAX_PATH];
+ WCHAR src_resolved[MAX_PATH] = L"";
+
+ /* dest_parent = os.path.dirname(dest) */
+ if (wcscpy_s(dest_parent, MAX_PATH, dest) ||
+ _dirnameW(dest_parent)) {
+ return 0;
+ }
+ /* src_resolved = os.path.join(dest_parent, src) */
+ if (_joinW(src_resolved, dest_parent, src)) {
+ return 0;
+ }
+ return (
+ GetFileAttributesExW(src_resolved, GetFileExInfoStandard, &src_info)
+ && src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
+ );
+}
+#endif
+
+
+/*[clinic input]
+os.symlink
+ src: path_t
+ dst: path_t
+ target_is_directory: bool = False
+ *
+ dir_fd: dir_fd(requires='symlinkat')=None
+
+# "symlink(src, dst, target_is_directory=False, *, dir_fd=None)\n\n\
+
+Create a symbolic link pointing to src named dst.
+
+target_is_directory is required on Windows if the target is to be
+ interpreted as a directory. (On Windows, symlink requires
+ Windows 6.0 or greater, and raises a NotImplementedError otherwise.)
+ target_is_directory is ignored on non-Windows platforms.
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_symlink_impl(PyObject *module, path_t *src, path_t *dst,
+ int target_is_directory, int dir_fd)
+/*[clinic end generated code: output=08ca9f3f3cf960f6 input=e820ec4472547bc3]*/
+{
+#ifdef MS_WINDOWS
+ DWORD result;
+ DWORD flags = 0;
+
+ /* Assumed true, set to false if detected to not be available. */
+ static int windows_has_symlink_unprivileged_flag = TRUE;
+#else
+ int result;
+#ifdef HAVE_SYMLINKAT
+ int symlinkat_unavailable = 0;
+#endif
+#endif
+
+ if (PySys_Audit("os.symlink", "OOi", src->object, dst->object,
+ dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+
+ if (windows_has_symlink_unprivileged_flag) {
+ /* Allow non-admin symlinks if system allows it. */
+ flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ /* if src is a directory, ensure flags==1 (target_is_directory bit) */
+ if (target_is_directory || _check_dirW(src->wide, dst->wide)) {
+ flags |= SYMBOLIC_LINK_FLAG_DIRECTORY;
+ }
+
+ result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ if (windows_has_symlink_unprivileged_flag && !result &&
+ ERROR_INVALID_PARAMETER == GetLastError()) {
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ /* This error might be caused by
+ SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE not being supported.
+ Try again, and update windows_has_symlink_unprivileged_flag if we
+ are successful this time.
+
+ NOTE: There is a risk of a race condition here if there are other
+ conditions than the flag causing ERROR_INVALID_PARAMETER, and
+ another process (or thread) changes that condition in between our
+ calls to CreateSymbolicLink.
+ */
+ flags &= ~(SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE);
+ result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ if (result || ERROR_INVALID_PARAMETER != GetLastError()) {
+ windows_has_symlink_unprivileged_flag = FALSE;
+ }
+ }
+
+ if (!result)
+ return path_error2(src, dst);
+
+#else
+
+ if ((src->narrow && dst->wide) || (src->wide && dst->narrow)) {
+ PyErr_SetString(PyExc_ValueError,
+ "symlink: src and dst must be the same type");
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_SYMLINKAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_SYMLINKAT_RUNTIME) {
+ result = symlinkat(src->narrow, dir_fd, dst->narrow);
+ } else {
+ symlinkat_unavailable = 1;
+ }
+ } else
+#endif
+ result = symlink(src->narrow, dst->narrow);
+ Py_END_ALLOW_THREADS
+
+#ifdef HAVE_SYMLINKAT
+ if (symlinkat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result)
+ return path_error2(src, dst);
+#endif
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SYMLINK */
+
+
+
+
+static PyStructSequence_Field times_result_fields[] = {
+ {"user", "user time"},
+ {"system", "system time"},
+ {"children_user", "user time of children"},
+ {"children_system", "system time of children"},
+ {"elapsed", "elapsed time since an arbitrary point in the past"},
+ {NULL}
+};
+
+PyDoc_STRVAR(times_result__doc__,
+"times_result: Result from os.times().\n\n\
+This object may be accessed either as a tuple of\n\
+ (user, system, children_user, children_system, elapsed),\n\
+or via the attributes user, system, children_user, children_system,\n\
+and elapsed.\n\
+\n\
+See os.times for more information.");
+
+static PyStructSequence_Desc times_result_desc = {
+ "times_result", /* name */
+ times_result__doc__, /* doc */
+ times_result_fields,
+ 5
+};
+
+#ifdef MS_WINDOWS
+#define HAVE_TIMES /* mandatory, for the method table */
+#endif
+
+#ifdef HAVE_TIMES
+
+static PyObject *
+build_times_result(PyObject *module, double user, double system,
+ double children_user, double children_system,
+ double elapsed)
+{
+ PyObject *TimesResultType = get_posix_state(module)->TimesResultType;
+ PyObject *value = PyStructSequence_New((PyTypeObject *)TimesResultType);
+ if (value == NULL)
+ return NULL;
+
+#define SET(i, field) \
+ { \
+ PyObject *o = PyFloat_FromDouble(field); \
+ if (!o) { \
+ Py_DECREF(value); \
+ return NULL; \
+ } \
+ PyStructSequence_SET_ITEM(value, i, o); \
+ } \
+
+ SET(0, user);
+ SET(1, system);
+ SET(2, children_user);
+ SET(3, children_system);
+ SET(4, elapsed);
+
+#undef SET
+
+ return value;
+}
+
+
+/*[clinic input]
+os.times
+
+Return a collection containing process timing information.
+
+The object returned behaves like a named tuple with these fields:
+ (utime, stime, cutime, cstime, elapsed_time)
+All fields are floating point numbers.
+[clinic start generated code]*/
+
+static PyObject *
+os_times_impl(PyObject *module)
+/*[clinic end generated code: output=35f640503557d32a input=2bf9df3d6ab2e48b]*/
+#ifdef MS_WINDOWS
+{
+ FILETIME create, exit, kernel, user;
+ HANDLE hProc;
+ hProc = GetCurrentProcess();
+ GetProcessTimes(hProc, &create, &exit, &kernel, &user);
+ /* The fields of a FILETIME structure are the hi and lo part
+ of a 64-bit value expressed in 100 nanosecond units.
+ 1e7 is one second in such units; 1e-7 the inverse.
+ 429.4967296 is 2**32 / 1e7 or 2**32 * 1e-7.
+ */
+ return build_times_result(module,
+ (double)(user.dwHighDateTime*429.4967296 +
+ user.dwLowDateTime*1e-7),
+ (double)(kernel.dwHighDateTime*429.4967296 +
+ kernel.dwLowDateTime*1e-7),
+ (double)0,
+ (double)0,
+ (double)0);
+}
+#else /* MS_WINDOWS */
+{
+ struct tms t;
+ clock_t c;
+ errno = 0;
+ c = times(&t);
+ if (c == (clock_t) -1) {
+ return posix_error();
+ }
+ assert(_PyRuntime.time.ticks_per_second_initialized);
+#define ticks_per_second _PyRuntime.time.ticks_per_second
+ return build_times_result(module,
+ (double)t.tms_utime / ticks_per_second,
+ (double)t.tms_stime / ticks_per_second,
+ (double)t.tms_cutime / ticks_per_second,
+ (double)t.tms_cstime / ticks_per_second,
+ (double)c / ticks_per_second);
+#undef ticks_per_second
+}
+#endif /* MS_WINDOWS */
+#endif /* HAVE_TIMES */
+
+
+#ifdef HAVE_GETSID
+/*[clinic input]
+os.getsid
+
+ pid: pid_t
+ /
+
+Call the system call getsid(pid) and return the result.
+[clinic start generated code]*/
+
+static PyObject *
+os_getsid_impl(PyObject *module, pid_t pid)
+/*[clinic end generated code: output=112deae56b306460 input=eeb2b923a30ce04e]*/
+{
+ int sid;
+ sid = getsid(pid);
+ if (sid < 0)
+ return posix_error();
+ return PyLong_FromLong((long)sid);
+}
+#endif /* HAVE_GETSID */
+
+
+#ifdef HAVE_SETSID
+/*[clinic input]
+os.setsid
+
+Call the system call setsid().
+[clinic start generated code]*/
+
+static PyObject *
+os_setsid_impl(PyObject *module)
+/*[clinic end generated code: output=e2ddedd517086d77 input=5fff45858e2f0776]*/
+{
+ if (setsid() < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETSID */
+
+
+#ifdef HAVE_SETPGID
+/*[clinic input]
+os.setpgid
+
+ pid: pid_t
+ pgrp: pid_t
+ /
+
+Call the system call setpgid(pid, pgrp).
+[clinic start generated code]*/
+
+static PyObject *
+os_setpgid_impl(PyObject *module, pid_t pid, pid_t pgrp)
+/*[clinic end generated code: output=6461160319a43d6a input=fceb395eca572e1a]*/
+{
+ if (setpgid(pid, pgrp) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETPGID */
+
+
+#ifdef HAVE_TCGETPGRP
+/*[clinic input]
+os.tcgetpgrp
+
+ fd: int
+ /
+
+Return the process group associated with the terminal specified by fd.
+[clinic start generated code]*/
+
+static PyObject *
+os_tcgetpgrp_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=f865e88be86c272b input=7f6c18eac10ada86]*/
+{
+ pid_t pgid = tcgetpgrp(fd);
+ if (pgid < 0)
+ return posix_error();
+ return PyLong_FromPid(pgid);
+}
+#endif /* HAVE_TCGETPGRP */
+
+
+#ifdef HAVE_TCSETPGRP
+/*[clinic input]
+os.tcsetpgrp
+
+ fd: int
+ pgid: pid_t
+ /
+
+Set the process group associated with the terminal specified by fd.
+[clinic start generated code]*/
+
+static PyObject *
+os_tcsetpgrp_impl(PyObject *module, int fd, pid_t pgid)
+/*[clinic end generated code: output=f1821a381b9daa39 input=5bdc997c6a619020]*/
+{
+ if (tcsetpgrp(fd, pgid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_TCSETPGRP */
+
+/* Functions acting on file descriptors */
+
+#ifdef O_CLOEXEC
+extern int _Py_open_cloexec_works;
+#endif
+
+
+/*[clinic input]
+os.open -> int
+ path: path_t
+ flags: int
+ mode: int = 0o777
+ *
+ dir_fd: dir_fd(requires='openat') = None
+
+# "open(path, flags, mode=0o777, *, dir_fd=None)\n\n\
+
+Open a file for low level IO. Returns a file descriptor (integer).
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static int
+os_open_impl(PyObject *module, path_t *path, int flags, int mode, int dir_fd)
+/*[clinic end generated code: output=abc7227888c8bc73 input=ad8623b29acd2934]*/
+{
+ int fd;
+ int async_err = 0;
+#ifdef HAVE_OPENAT
+ int openat_unavailable = 0;
+#endif
+
+#ifdef O_CLOEXEC
+ int *atomic_flag_works = &_Py_open_cloexec_works;
+#elif !defined(MS_WINDOWS)
+ int *atomic_flag_works = NULL;
+#endif
+
+#ifdef MS_WINDOWS
+ flags |= O_NOINHERIT;
+#elif defined(O_CLOEXEC)
+ flags |= O_CLOEXEC;
+#endif
+
+ if (PySys_Audit("open", "OOi", path->object, Py_None, flags) < 0) {
+ return -1;
+ }
+
+ _Py_BEGIN_SUPPRESS_IPH
+ do {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef MS_WINDOWS
+ fd = _wopen(path->wide, flags, mode);
+#else
+#ifdef HAVE_OPENAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_OPENAT_RUNTIME) {
+ fd = openat(dir_fd, path->narrow, flags, mode);
+
+ } else {
+ openat_unavailable = 1;
+ fd = -1;
+ }
+ } else
+#endif /* HAVE_OPENAT */
+ fd = open(path->narrow, flags, mode);
+#endif /* !MS_WINDOWS */
+ Py_END_ALLOW_THREADS
+ } while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ _Py_END_SUPPRESS_IPH
+
+#ifdef HAVE_OPENAT
+ if (openat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return -1;
+ }
+#endif
+
+ if (fd < 0) {
+ if (!async_err)
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
+ return -1;
+ }
+
+#ifndef MS_WINDOWS
+ if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {
+ close(fd);
+ return -1;
+ }
+#endif
+
+ return fd;
+}
+
+
+/*[clinic input]
+os.close
+
+ fd: int
+
+Close a file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+os_close_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=2fe4e93602822c14 input=2bc42451ca5c3223]*/
+{
+ int res;
+ /* We do not want to retry upon EINTR: see http://lwn.net/Articles/576478/
+ * and http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-09/3000.html
+ * for more details.
+ */
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ res = close(fd);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+os.closerange
+
+ fd_low: int
+ fd_high: int
+ /
+
+Closes all file descriptors in [fd_low, fd_high), ignoring errors.
+[clinic start generated code]*/
+
+static PyObject *
+os_closerange_impl(PyObject *module, int fd_low, int fd_high)
+/*[clinic end generated code: output=0ce5c20fcda681c2 input=5855a3d053ebd4ec]*/
+{
+ Py_BEGIN_ALLOW_THREADS
+ _Py_closerange(fd_low, fd_high - 1);
+ Py_END_ALLOW_THREADS
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+os.dup -> int
+
+ fd: int
+ /
+
+Return a duplicate of a file descriptor.
+[clinic start generated code]*/
+
+static int
+os_dup_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=486f4860636b2a9f input=6f10f7ea97f7852a]*/
+{
+ return _Py_dup(fd);
+}
+
+// dup2() is either provided by libc or dup2.c with AC_REPLACE_FUNCS().
+// dup2.c provides working dup2() if and only if F_DUPFD is available.
+#if (defined(HAVE_DUP3) || defined(F_DUPFD) || defined(MS_WINDOWS))
+/*[clinic input]
+os.dup2 -> int
+ fd: int
+ fd2: int
+ inheritable: bool=True
+
+Duplicate file descriptor.
+[clinic start generated code]*/
+
+static int
+os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable)
+/*[clinic end generated code: output=bc059d34a73404d1 input=c3cddda8922b038d]*/
+{
+ int res = 0;
+#if defined(HAVE_DUP3) && \
+ !(defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC))
+ /* dup3() is available on Linux 2.6.27+ and glibc 2.9 */
+ static int dup3_works = -1;
+#endif
+
+ /* dup2() can fail with EINTR if the target FD is already open, because it
+ * then has to be closed. See os_close_impl() for why we don't handle EINTR
+ * upon close(), and therefore below.
+ */
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ res = dup2(fd, fd2);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ posix_error();
+ return -1;
+ }
+ res = fd2; // msvcrt dup2 returns 0 on success.
+
+ /* Character files like console cannot be make non-inheritable */
+ if (!inheritable && _Py_set_inheritable(fd2, 0, NULL) < 0) {
+ close(fd2);
+ return -1;
+ }
+
+#elif defined(HAVE_FCNTL_H) && defined(F_DUP2FD_CLOEXEC)
+ Py_BEGIN_ALLOW_THREADS
+ if (!inheritable)
+ res = fcntl(fd, F_DUP2FD_CLOEXEC, fd2);
+ else
+ res = dup2(fd, fd2);
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ posix_error();
+ return -1;
+ }
+
+#else
+
+#ifdef HAVE_DUP3
+ if (!inheritable && dup3_works != 0) {
+ Py_BEGIN_ALLOW_THREADS
+ res = dup3(fd, fd2, O_CLOEXEC);
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ if (dup3_works == -1)
+ dup3_works = (errno != ENOSYS);
+ if (dup3_works) {
+ posix_error();
+ return -1;
+ }
+ }
+ }
+
+ if (inheritable || dup3_works == 0)
+ {
+#endif
+ Py_BEGIN_ALLOW_THREADS
+ res = dup2(fd, fd2);
+ Py_END_ALLOW_THREADS
+ if (res < 0) {
+ posix_error();
+ return -1;
+ }
+
+ if (!inheritable && _Py_set_inheritable(fd2, 0, NULL) < 0) {
+ close(fd2);
+ return -1;
+ }
+#ifdef HAVE_DUP3
+ }
+#endif
+
+#endif
+
+ return res;
+}
+#endif
+
+
+#ifdef HAVE_LOCKF
+/*[clinic input]
+os.lockf
+
+ fd: int
+ An open file descriptor.
+ command: int
+ One of F_LOCK, F_TLOCK, F_ULOCK or F_TEST.
+ length: Py_off_t
+ The number of bytes to lock, starting at the current position.
+ /
+
+Apply, test or remove a POSIX lock on an open file descriptor.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length)
+/*[clinic end generated code: output=af7051f3e7c29651 input=65da41d2106e9b79]*/
+{
+ int res;
+
+ if (PySys_Audit("os.lockf", "iiL", fd, command, length) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ res = lockf(fd, command, length);
+ Py_END_ALLOW_THREADS
+
+ if (res < 0)
+ return posix_error();
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_LOCKF */
+
+
+/*[clinic input]
+os.lseek -> Py_off_t
+
+ fd: int
+ An open file descriptor, as returned by os.open().
+ position: Py_off_t
+ Position, interpreted relative to 'whence'.
+ whence as how: int
+ The relative position to seek from. Valid values are:
+ - SEEK_SET: seek from the start of the file.
+ - SEEK_CUR: seek from the current file position.
+ - SEEK_END: seek from the end of the file.
+ /
+
+Set the position of a file descriptor. Return the new position.
+
+The return value is the number of bytes relative to the beginning of the file.
+[clinic start generated code]*/
+
+static Py_off_t
+os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how)
+/*[clinic end generated code: output=971e1efb6b30bd2f input=f096e754c5367504]*/
+{
+ Py_off_t result;
+
+#ifdef SEEK_SET
+ /* Turn 0, 1, 2 into SEEK_{SET,CUR,END} */
+ switch (how) {
+ case 0: how = SEEK_SET; break;
+ case 1: how = SEEK_CUR; break;
+ case 2: how = SEEK_END; break;
+ }
+#endif /* SEEK_END */
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef MS_WINDOWS
+ result = _lseeki64(fd, position, how);
+#else
+ result = lseek(fd, position, how);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ if (result < 0)
+ posix_error();
+
+ return result;
+}
+
+
+/*[clinic input]
+os.read
+ fd: int
+ length: Py_ssize_t
+ /
+
+Read from a file descriptor. Returns a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+os_read_impl(PyObject *module, int fd, Py_ssize_t length)
+/*[clinic end generated code: output=dafbe9a5cddb987b input=1df2eaa27c0bf1d3]*/
+{
+ Py_ssize_t n;
+ PyObject *buffer;
+
+ if (length < 0) {
+ errno = EINVAL;
+ return posix_error();
+ }
+
+ length = Py_MIN(length, _PY_READ_MAX);
+
+ buffer = PyBytes_FromStringAndSize((char *)NULL, length);
+ if (buffer == NULL)
+ return NULL;
+
+ n = _Py_read(fd, PyBytes_AS_STRING(buffer), length);
+ if (n == -1) {
+ Py_DECREF(buffer);
+ return NULL;
+ }
+
+ if (n != length)
+ _PyBytes_Resize(&buffer, n);
+
+ return buffer;
+}
+
+#if (defined(HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__DragonFly__) \
+ || defined(__APPLE__))) \
+ || defined(HAVE_READV) || defined(HAVE_PREADV) || defined (HAVE_PREADV2) \
+ || defined(HAVE_WRITEV) || defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2)
+static int
+iov_setup(struct iovec **iov, Py_buffer **buf, PyObject *seq, Py_ssize_t cnt, int type)
+{
+ Py_ssize_t i, j;
+
+ *iov = PyMem_New(struct iovec, cnt);
+ if (*iov == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ *buf = PyMem_New(Py_buffer, cnt);
+ if (*buf == NULL) {
+ PyMem_Free(*iov);
+ PyErr_NoMemory();
+ return -1;
+ }
+
+ for (i = 0; i < cnt; i++) {
+ PyObject *item = PySequence_GetItem(seq, i);
+ if (item == NULL)
+ goto fail;
+ if (PyObject_GetBuffer(item, &(*buf)[i], type) == -1) {
+ Py_DECREF(item);
+ goto fail;
+ }
+ Py_DECREF(item);
+ (*iov)[i].iov_base = (*buf)[i].buf;
+ (*iov)[i].iov_len = (*buf)[i].len;
+ }
+ return 0;
+
+fail:
+ PyMem_Free(*iov);
+ for (j = 0; j < i; j++) {
+ PyBuffer_Release(&(*buf)[j]);
+ }
+ PyMem_Free(*buf);
+ return -1;
+}
+
+static void
+iov_cleanup(struct iovec *iov, Py_buffer *buf, int cnt)
+{
+ int i;
+ PyMem_Free(iov);
+ for (i = 0; i < cnt; i++) {
+ PyBuffer_Release(&buf[i]);
+ }
+ PyMem_Free(buf);
+}
+#endif
+
+
+#ifdef HAVE_READV
+/*[clinic input]
+os.readv -> Py_ssize_t
+
+ fd: int
+ buffers: object
+ /
+
+Read from a file descriptor fd into an iterable of buffers.
+
+The buffers should be mutable buffers accepting bytes.
+readv will transfer data into each buffer until it is full
+and then move on to the next buffer in the sequence to hold
+the rest of the data.
+
+readv returns the total number of bytes read,
+which may be less than the total capacity of all the buffers.
+[clinic start generated code]*/
+
+static Py_ssize_t
+os_readv_impl(PyObject *module, int fd, PyObject *buffers)
+/*[clinic end generated code: output=792da062d3fcebdb input=e679eb5dbfa0357d]*/
+{
+ Py_ssize_t cnt, n;
+ int async_err = 0;
+ struct iovec *iov;
+ Py_buffer *buf;
+
+ if (!PySequence_Check(buffers)) {
+ PyErr_SetString(PyExc_TypeError,
+ "readv() arg 2 must be a sequence");
+ return -1;
+ }
+
+ cnt = PySequence_Size(buffers);
+ if (cnt < 0)
+ return -1;
+
+ if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_WRITABLE) < 0)
+ return -1;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ n = readv(fd, iov, cnt);
+ Py_END_ALLOW_THREADS
+ } while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ int saved_errno = errno;
+ iov_cleanup(iov, buf, cnt);
+ if (n < 0) {
+ if (!async_err) {
+ errno = saved_errno;
+ posix_error();
+ }
+ return -1;
+ }
+
+ return n;
+}
+#endif /* HAVE_READV */
+
+
+#ifdef HAVE_PREAD
+/*[clinic input]
+os.pread
+
+ fd: int
+ length: Py_ssize_t
+ offset: Py_off_t
+ /
+
+Read a number of bytes from a file descriptor starting at a particular offset.
+
+Read length bytes from file descriptor fd, starting at offset bytes from
+the beginning of the file. The file offset remains unchanged.
+[clinic start generated code]*/
+
+static PyObject *
+os_pread_impl(PyObject *module, int fd, Py_ssize_t length, Py_off_t offset)
+/*[clinic end generated code: output=3f875c1eef82e32f input=85cb4a5589627144]*/
+{
+ Py_ssize_t n;
+ int async_err = 0;
+ PyObject *buffer;
+
+ if (length < 0) {
+ errno = EINVAL;
+ return posix_error();
+ }
+ buffer = PyBytes_FromStringAndSize((char *)NULL, length);
+ if (buffer == NULL)
+ return NULL;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ n = pread(fd, PyBytes_AS_STRING(buffer), length, offset);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (n < 0) {
+ if (!async_err) {
+ posix_error();
+ }
+ Py_DECREF(buffer);
+ return NULL;
+ }
+ if (n != length)
+ _PyBytes_Resize(&buffer, n);
+ return buffer;
+}
+#endif /* HAVE_PREAD */
+
+#if defined(HAVE_PREADV) || defined (HAVE_PREADV2)
+/*[clinic input]
+os.preadv -> Py_ssize_t
+
+ fd: int
+ buffers: object
+ offset: Py_off_t
+ flags: int = 0
+ /
+
+Reads from a file descriptor into a number of mutable bytes-like objects.
+
+Combines the functionality of readv() and pread(). As readv(), it will
+transfer data into each buffer until it is full and then move on to the next
+buffer in the sequence to hold the rest of the data. Its fourth argument,
+specifies the file offset at which the input operation is to be performed. It
+will return the total number of bytes read (which can be less than the total
+capacity of all the objects).
+
+The flags argument contains a bitwise OR of zero or more of the following flags:
+
+- RWF_HIPRI
+- RWF_NOWAIT
+
+Using non-zero flags requires Linux 4.6 or newer.
+[clinic start generated code]*/
+
+static Py_ssize_t
+os_preadv_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
+ int flags)
+/*[clinic end generated code: output=26fc9c6e58e7ada5 input=4173919dc1f7ed99]*/
+{
+ Py_ssize_t cnt, n;
+ int async_err = 0;
+ struct iovec *iov;
+ Py_buffer *buf;
+
+ if (!PySequence_Check(buffers)) {
+ PyErr_SetString(PyExc_TypeError,
+ "preadv2() arg 2 must be a sequence");
+ return -1;
+ }
+
+ cnt = PySequence_Size(buffers);
+ if (cnt < 0) {
+ return -1;
+ }
+
+#ifndef HAVE_PREADV2
+ if(flags != 0) {
+ argument_unavailable_error("preadv2", "flags");
+ return -1;
+ }
+#endif
+
+ if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_WRITABLE) < 0) {
+ return -1;
+ }
+#ifdef HAVE_PREADV2
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ n = preadv2(fd, iov, cnt, offset, flags);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+#else
+ do {
+#if defined(__APPLE__) && defined(__clang__)
+/* This entire function will be removed from the module dict when the API
+ * is not available.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+#pragma clang diagnostic ignored "-Wunguarded-availability-new"
+#endif
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ n = preadv(fd, iov, cnt, offset);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (n < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+#endif
+
+ int saved_errno = errno;
+ iov_cleanup(iov, buf, cnt);
+ if (n < 0) {
+ if (!async_err) {
+ errno = saved_errno;
+ posix_error();
+ }
+ return -1;
+ }
+
+ return n;
+}
+#endif /* HAVE_PREADV */
+
+
+/*[clinic input]
+os.write -> Py_ssize_t
+
+ fd: int
+ data: Py_buffer
+ /
+
+Write a bytes object to a file descriptor.
+[clinic start generated code]*/
+
+static Py_ssize_t
+os_write_impl(PyObject *module, int fd, Py_buffer *data)
+/*[clinic end generated code: output=e4ef5bc904b58ef9 input=3207e28963234f3c]*/
+{
+ return _Py_write(fd, data->buf, data->len);
+}
+
+#ifdef HAVE_SENDFILE
+#ifdef __APPLE__
+/*[clinic input]
+os.sendfile
+
+ out_fd: int
+ in_fd: int
+ offset: Py_off_t
+ count as sbytes: Py_off_t
+ headers: object(c_default="NULL") = ()
+ trailers: object(c_default="NULL") = ()
+ flags: int = 0
+
+Copy count bytes from file descriptor in_fd to file descriptor out_fd.
+[clinic start generated code]*/
+
+static PyObject *
+os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset,
+ Py_off_t sbytes, PyObject *headers, PyObject *trailers,
+ int flags)
+/*[clinic end generated code: output=81c4bcd143f5c82b input=b0d72579d4c69afa]*/
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
+/*[clinic input]
+os.sendfile
+
+ out_fd: int
+ in_fd: int
+ offset: Py_off_t
+ count: Py_ssize_t
+ headers: object(c_default="NULL") = ()
+ trailers: object(c_default="NULL") = ()
+ flags: int = 0
+
+Copy count bytes from file descriptor in_fd to file descriptor out_fd.
+[clinic start generated code]*/
+
+static PyObject *
+os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset,
+ Py_ssize_t count, PyObject *headers, PyObject *trailers,
+ int flags)
+/*[clinic end generated code: output=329ea009bdd55afc input=338adb8ff84ae8cd]*/
+#else
+/*[clinic input]
+os.sendfile
+
+ out_fd: int
+ in_fd: int
+ offset as offobj: object
+ count: Py_ssize_t
+
+Copy count bytes from file descriptor in_fd to file descriptor out_fd.
+[clinic start generated code]*/
+
+static PyObject *
+os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
+ Py_ssize_t count)
+/*[clinic end generated code: output=ae81216e40f167d8 input=76d64058c74477ba]*/
+#endif
+{
+ Py_ssize_t ret;
+ int async_err = 0;
+
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
+#ifndef __APPLE__
+ off_t sbytes;
+#endif
+ Py_buffer *hbuf, *tbuf;
+ struct sf_hdtr sf;
+
+ sf.headers = NULL;
+ sf.trailers = NULL;
+
+ if (headers != NULL) {
+ if (!PySequence_Check(headers)) {
+ PyErr_SetString(PyExc_TypeError,
+ "sendfile() headers must be a sequence");
+ return NULL;
+ } else {
+ Py_ssize_t i = PySequence_Size(headers);
+ if (i < 0)
+ return NULL;
+ if (i > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "sendfile() header is too large");
+ return NULL;
+ }
+ if (i > 0) {
+ sf.hdr_cnt = (int)i;
+ if (iov_setup(&(sf.headers), &hbuf,
+ headers, sf.hdr_cnt, PyBUF_SIMPLE) < 0)
+ return NULL;
+#ifdef __APPLE__
+ for (i = 0; i < sf.hdr_cnt; i++) {
+ Py_ssize_t blen = sf.headers[i].iov_len;
+# define OFF_T_MAX 0x7fffffffffffffff
+ if (sbytes >= OFF_T_MAX - blen) {
+ PyErr_SetString(PyExc_OverflowError,
+ "sendfile() header is too large");
+ return NULL;
+ }
+ sbytes += blen;
+ }
+#endif
+ }
+ }
+ }
+ if (trailers != NULL) {
+ if (!PySequence_Check(trailers)) {
+ PyErr_SetString(PyExc_TypeError,
+ "sendfile() trailers must be a sequence");
+ return NULL;
+ } else {
+ Py_ssize_t i = PySequence_Size(trailers);
+ if (i < 0)
+ return NULL;
+ if (i > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "sendfile() trailer is too large");
+ return NULL;
+ }
+ if (i > 0) {
+ sf.trl_cnt = (int)i;
+ if (iov_setup(&(sf.trailers), &tbuf,
+ trailers, sf.trl_cnt, PyBUF_SIMPLE) < 0)
+ return NULL;
+ }
+ }
+ }
+
+ _Py_BEGIN_SUPPRESS_IPH
+ do {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef __APPLE__
+ ret = sendfile(in_fd, out_fd, offset, &sbytes, &sf, flags);
+#else
+ ret = sendfile(in_fd, out_fd, offset, count, &sf, &sbytes, flags);
+#endif
+ Py_END_ALLOW_THREADS
+ } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ _Py_END_SUPPRESS_IPH
+
+ int saved_errno = errno;
+ if (sf.headers != NULL)
+ iov_cleanup(sf.headers, hbuf, sf.hdr_cnt);
+ if (sf.trailers != NULL)
+ iov_cleanup(sf.trailers, tbuf, sf.trl_cnt);
+
+ if (ret < 0) {
+ if ((saved_errno == EAGAIN) || (saved_errno == EBUSY)) {
+ if (sbytes != 0) {
+ // some data has been sent
+ goto done;
+ }
+ // no data has been sent; upper application is supposed
+ // to retry on EAGAIN or EBUSY
+ }
+ if (!async_err) {
+ errno = saved_errno;
+ posix_error();
+ }
+ return NULL;
+ }
+ goto done;
+
+done:
+ #if !defined(HAVE_LARGEFILE_SUPPORT)
+ return Py_BuildValue("l", sbytes);
+ #else
+ return Py_BuildValue("L", sbytes);
+ #endif
+
+#else
+#ifdef __linux__
+ if (offobj == Py_None) {
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = sendfile(out_fd, in_fd, NULL, count);
+ Py_END_ALLOW_THREADS
+ } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (ret < 0)
+ return (!async_err) ? posix_error() : NULL;
+ return Py_BuildValue("n", ret);
+ }
+#endif
+ off_t offset;
+ if (!Py_off_t_converter(offobj, &offset))
+ return NULL;
+
+#if defined(__sun) && defined(__SVR4)
+ // On Solaris, sendfile raises EINVAL rather than returning 0
+ // when the offset is equal or bigger than the in_fd size.
+ struct stat st;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = fstat(in_fd, &st);
+ Py_END_ALLOW_THREADS
+ } while (ret != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (ret < 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ if (offset >= st.st_size) {
+ return Py_BuildValue("i", 0);
+ }
+
+ // On illumos specifically sendfile() may perform a partial write but
+ // return -1/an error (in one confirmed case the destination socket
+ // had a 5 second timeout set and errno was EAGAIN) and it's on the client
+ // code to check if the offset parameter was modified by sendfile().
+ //
+ // We need this variable to track said change.
+ off_t original_offset = offset;
+#endif
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = sendfile(out_fd, in_fd, &offset, count);
+#if defined(__sun) && defined(__SVR4)
+ // This handles illumos-specific sendfile() partial write behavior,
+ // see a comment above for more details.
+ if (ret < 0 && offset != original_offset) {
+ ret = offset - original_offset;
+ }
+#endif
+ Py_END_ALLOW_THREADS
+ } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (ret < 0)
+ return (!async_err) ? posix_error() : NULL;
+ return Py_BuildValue("n", ret);
+#endif
+}
+#endif /* HAVE_SENDFILE */
+
+
+#if defined(__APPLE__)
+/*[clinic input]
+os._fcopyfile
+
+ in_fd: int
+ out_fd: int
+ flags: int
+ /
+
+Efficiently copy content or metadata of 2 regular file descriptors (macOS).
+[clinic start generated code]*/
+
+static PyObject *
+os__fcopyfile_impl(PyObject *module, int in_fd, int out_fd, int flags)
+/*[clinic end generated code: output=c9d1a35a992e401b input=1e34638a86948795]*/
+{
+ int ret;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = fcopyfile(in_fd, out_fd, NULL, flags);
+ Py_END_ALLOW_THREADS
+ if (ret < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif
+
+
+/*[clinic input]
+os.fstat
+
+ fd : int
+
+Perform a stat system call on the given file descriptor.
+
+Like stat(), but for an open file descriptor.
+Equivalent to os.stat(fd).
+[clinic start generated code]*/
+
+static PyObject *
+os_fstat_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=efc038cb5f654492 input=27e0e0ebbe5600c9]*/
+{
+ STRUCT_STAT st;
+ int res;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ res = FSTAT(fd, &st);
+ Py_END_ALLOW_THREADS
+ } while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (res != 0) {
+#ifdef MS_WINDOWS
+ return PyErr_SetFromWindowsErr(0);
+#else
+ return (!async_err) ? posix_error() : NULL;
+#endif
+ }
+
+ return _pystat_fromstructstat(module, &st);
+}
+
+
+/*[clinic input]
+os.isatty -> bool
+ fd: int
+ /
+
+Return True if the fd is connected to a terminal.
+
+Return True if the file descriptor is an open file descriptor
+connected to the slave end of a terminal.
+[clinic start generated code]*/
+
+static int
+os_isatty_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=6a48c8b4e644ca00 input=08ce94aa1eaf7b5e]*/
+{
+ int return_value;
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ return_value = isatty(fd);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ return return_value;
+}
+
+
+#ifdef HAVE_PIPE
+/*[clinic input]
+os.pipe
+
+Create a pipe.
+
+Returns a tuple of two file descriptors:
+ (read_fd, write_fd)
+[clinic start generated code]*/
+
+static PyObject *
+os_pipe_impl(PyObject *module)
+/*[clinic end generated code: output=ff9b76255793b440 input=02535e8c8fa6c4d4]*/
+{
+ int fds[2];
+#ifdef MS_WINDOWS
+ HANDLE read, write;
+ SECURITY_ATTRIBUTES attr;
+ BOOL ok;
+#else
+ int res;
+#endif
+
+#ifdef MS_WINDOWS
+ attr.nLength = sizeof(attr);
+ attr.lpSecurityDescriptor = NULL;
+ attr.bInheritHandle = FALSE;
+
+ Py_BEGIN_ALLOW_THREADS
+ ok = CreatePipe(&read, &write, &attr, 0);
+ if (ok) {
+ fds[0] = _Py_open_osfhandle_noraise(read, _O_RDONLY);
+ fds[1] = _Py_open_osfhandle_noraise(write, _O_WRONLY);
+ if (fds[0] == -1 || fds[1] == -1) {
+ CloseHandle(read);
+ CloseHandle(write);
+ ok = 0;
+ }
+ }
+ Py_END_ALLOW_THREADS
+
+ if (!ok)
+ return PyErr_SetFromWindowsErr(0);
+#else
+
+#ifdef HAVE_PIPE2
+ Py_BEGIN_ALLOW_THREADS
+ res = pipe2(fds, O_CLOEXEC);
+ Py_END_ALLOW_THREADS
+
+ if (res != 0 && errno == ENOSYS)
+ {
+#endif
+ Py_BEGIN_ALLOW_THREADS
+ res = pipe(fds);
+ Py_END_ALLOW_THREADS
+
+ if (res == 0) {
+ if (_Py_set_inheritable(fds[0], 0, NULL) < 0) {
+ close(fds[0]);
+ close(fds[1]);
+ return NULL;
+ }
+ if (_Py_set_inheritable(fds[1], 0, NULL) < 0) {
+ close(fds[0]);
+ close(fds[1]);
+ return NULL;
+ }
+ }
+#ifdef HAVE_PIPE2
+ }
+#endif
+
+ if (res != 0)
+ return PyErr_SetFromErrno(PyExc_OSError);
+#endif /* !MS_WINDOWS */
+ return Py_BuildValue("(ii)", fds[0], fds[1]);
+}
+#endif /* HAVE_PIPE */
+
+
+#ifdef HAVE_PIPE2
+/*[clinic input]
+os.pipe2
+
+ flags: int
+ /
+
+Create a pipe with flags set atomically.
+
+Returns a tuple of two file descriptors:
+ (read_fd, write_fd)
+
+flags can be constructed by ORing together one or more of these values:
+O_NONBLOCK, O_CLOEXEC.
+[clinic start generated code]*/
+
+static PyObject *
+os_pipe2_impl(PyObject *module, int flags)
+/*[clinic end generated code: output=25751fb43a45540f input=f261b6e7e63c6817]*/
+{
+ int fds[2];
+ int res;
+
+ res = pipe2(fds, flags);
+ if (res != 0)
+ return posix_error();
+ return Py_BuildValue("(ii)", fds[0], fds[1]);
+}
+#endif /* HAVE_PIPE2 */
+
+
+#ifdef HAVE_WRITEV
+/*[clinic input]
+os.writev -> Py_ssize_t
+ fd: int
+ buffers: object
+ /
+
+Iterate over buffers, and write the contents of each to a file descriptor.
+
+Returns the total number of bytes written.
+buffers must be a sequence of bytes-like objects.
+[clinic start generated code]*/
+
+static Py_ssize_t
+os_writev_impl(PyObject *module, int fd, PyObject *buffers)
+/*[clinic end generated code: output=56565cfac3aac15b input=5b8d17fe4189d2fe]*/
+{
+ Py_ssize_t cnt;
+ Py_ssize_t result;
+ int async_err = 0;
+ struct iovec *iov;
+ Py_buffer *buf;
+
+ if (!PySequence_Check(buffers)) {
+ PyErr_SetString(PyExc_TypeError,
+ "writev() arg 2 must be a sequence");
+ return -1;
+ }
+ cnt = PySequence_Size(buffers);
+ if (cnt < 0)
+ return -1;
+
+ if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_SIMPLE) < 0) {
+ return -1;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ result = writev(fd, iov, cnt);
+ Py_END_ALLOW_THREADS
+ } while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (result < 0 && !async_err)
+ posix_error();
+
+ iov_cleanup(iov, buf, cnt);
+ return result;
+}
+#endif /* HAVE_WRITEV */
+
+
+#ifdef HAVE_PWRITE
+/*[clinic input]
+os.pwrite -> Py_ssize_t
+
+ fd: int
+ buffer: Py_buffer
+ offset: Py_off_t
+ /
+
+Write bytes to a file descriptor starting at a particular offset.
+
+Write buffer to fd, starting at offset bytes from the beginning of
+the file. Returns the number of bytes writte. Does not change the
+current file offset.
+[clinic start generated code]*/
+
+static Py_ssize_t
+os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset)
+/*[clinic end generated code: output=c74da630758ee925 input=19903f1b3dd26377]*/
+{
+ Py_ssize_t size;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ size = pwrite(fd, buffer->buf, (size_t)buffer->len, offset);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (size < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (size < 0 && !async_err)
+ posix_error();
+ return size;
+}
+#endif /* HAVE_PWRITE */
+
+#if defined(HAVE_PWRITEV) || defined (HAVE_PWRITEV2)
+/*[clinic input]
+os.pwritev -> Py_ssize_t
+
+ fd: int
+ buffers: object
+ offset: Py_off_t
+ flags: int = 0
+ /
+
+Writes the contents of bytes-like objects to a file descriptor at a given offset.
+
+Combines the functionality of writev() and pwrite(). All buffers must be a sequence
+of bytes-like objects. Buffers are processed in array order. Entire contents of first
+buffer is written before proceeding to second, and so on. The operating system may
+set a limit (sysconf() value SC_IOV_MAX) on the number of buffers that can be used.
+This function writes the contents of each object to the file descriptor and returns
+the total number of bytes written.
+
+The flags argument contains a bitwise OR of zero or more of the following flags:
+
+- RWF_DSYNC
+- RWF_SYNC
+- RWF_APPEND
+
+Using non-zero flags requires Linux 4.7 or newer.
+[clinic start generated code]*/
+
+static Py_ssize_t
+os_pwritev_impl(PyObject *module, int fd, PyObject *buffers, Py_off_t offset,
+ int flags)
+/*[clinic end generated code: output=e3dd3e9d11a6a5c7 input=35358c327e1a2a8e]*/
+{
+ Py_ssize_t cnt;
+ Py_ssize_t result;
+ int async_err = 0;
+ struct iovec *iov;
+ Py_buffer *buf;
+
+ if (!PySequence_Check(buffers)) {
+ PyErr_SetString(PyExc_TypeError,
+ "pwritev() arg 2 must be a sequence");
+ return -1;
+ }
+
+ cnt = PySequence_Size(buffers);
+ if (cnt < 0) {
+ return -1;
+ }
+
+#ifndef HAVE_PWRITEV2
+ if(flags != 0) {
+ argument_unavailable_error("pwritev2", "flags");
+ return -1;
+ }
+#endif
+
+ if (iov_setup(&iov, &buf, buffers, cnt, PyBUF_SIMPLE) < 0) {
+ return -1;
+ }
+#ifdef HAVE_PWRITEV2
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ result = pwritev2(fd, iov, cnt, offset, flags);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+#else
+
+#if defined(__APPLE__) && defined(__clang__)
+/* This entire function will be removed from the module dict when the API
+ * is not available.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+#pragma clang diagnostic ignored "-Wunguarded-availability-new"
+#endif
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ result = pwritev(fd, iov, cnt, offset);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (result < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+#endif
+
+ if (result < 0) {
+ if (!async_err) {
+ posix_error();
+ }
+ result = -1;
+ }
+ iov_cleanup(iov, buf, cnt);
+
+ return result;
+}
+#endif /* HAVE_PWRITEV */
+
+#ifdef HAVE_COPY_FILE_RANGE
+/*[clinic input]
+
+os.copy_file_range
+ src: int
+ Source file descriptor.
+ dst: int
+ Destination file descriptor.
+ count: Py_ssize_t
+ Number of bytes to copy.
+ offset_src: object = None
+ Starting offset in src.
+ offset_dst: object = None
+ Starting offset in dst.
+
+Copy count bytes from one file descriptor to another.
+
+If offset_src is None, then src is read from the current position;
+respectively for offset_dst.
+[clinic start generated code]*/
+
+static PyObject *
+os_copy_file_range_impl(PyObject *module, int src, int dst, Py_ssize_t count,
+ PyObject *offset_src, PyObject *offset_dst)
+/*[clinic end generated code: output=1a91713a1d99fc7a input=42fdce72681b25a9]*/
+{
+ off_t offset_src_val, offset_dst_val;
+ off_t *p_offset_src = NULL;
+ off_t *p_offset_dst = NULL;
+ Py_ssize_t ret;
+ int async_err = 0;
+ /* The flags argument is provided to allow
+ * for future extensions and currently must be to 0. */
+ int flags = 0;
+
+
+ if (count < 0) {
+ PyErr_SetString(PyExc_ValueError, "negative value for 'count' not allowed");
+ return NULL;
+ }
+
+ if (offset_src != Py_None) {
+ if (!Py_off_t_converter(offset_src, &offset_src_val)) {
+ return NULL;
+ }
+ p_offset_src = &offset_src_val;
+ }
+
+ if (offset_dst != Py_None) {
+ if (!Py_off_t_converter(offset_dst, &offset_dst_val)) {
+ return NULL;
+ }
+ p_offset_dst = &offset_dst_val;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = copy_file_range(src, p_offset_src, dst, p_offset_dst, count, flags);
+ Py_END_ALLOW_THREADS
+ } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (ret < 0) {
+ return (!async_err) ? posix_error() : NULL;
+ }
+
+ return PyLong_FromSsize_t(ret);
+}
+#endif /* HAVE_COPY_FILE_RANGE*/
+
+#if (defined(HAVE_SPLICE) && !defined(_AIX))
+/*[clinic input]
+
+os.splice
+ src: int
+ Source file descriptor.
+ dst: int
+ Destination file descriptor.
+ count: Py_ssize_t
+ Number of bytes to copy.
+ offset_src: object = None
+ Starting offset in src.
+ offset_dst: object = None
+ Starting offset in dst.
+ flags: unsigned_int = 0
+ Flags to modify the semantics of the call.
+
+Transfer count bytes from one pipe to a descriptor or vice versa.
+
+If offset_src is None, then src is read from the current position;
+respectively for offset_dst. The offset associated to the file
+descriptor that refers to a pipe must be None.
+[clinic start generated code]*/
+
+static PyObject *
+os_splice_impl(PyObject *module, int src, int dst, Py_ssize_t count,
+ PyObject *offset_src, PyObject *offset_dst,
+ unsigned int flags)
+/*[clinic end generated code: output=d0386f25a8519dc5 input=047527c66c6d2e0a]*/
+{
+ off_t offset_src_val, offset_dst_val;
+ off_t *p_offset_src = NULL;
+ off_t *p_offset_dst = NULL;
+ Py_ssize_t ret;
+ int async_err = 0;
+
+ if (count < 0) {
+ PyErr_SetString(PyExc_ValueError, "negative value for 'count' not allowed");
+ return NULL;
+ }
+
+ if (offset_src != Py_None) {
+ if (!Py_off_t_converter(offset_src, &offset_src_val)) {
+ return NULL;
+ }
+ p_offset_src = &offset_src_val;
+ }
+
+ if (offset_dst != Py_None) {
+ if (!Py_off_t_converter(offset_dst, &offset_dst_val)) {
+ return NULL;
+ }
+ p_offset_dst = &offset_dst_val;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ ret = splice(src, p_offset_src, dst, p_offset_dst, count, flags);
+ Py_END_ALLOW_THREADS
+ } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (ret < 0) {
+ return (!async_err) ? posix_error() : NULL;
+ }
+
+ return PyLong_FromSsize_t(ret);
+}
+#endif /* HAVE_SPLICE*/
+
+#ifdef HAVE_MKFIFO
+/*[clinic input]
+os.mkfifo
+
+ path: path_t
+ mode: int=0o666
+ *
+ dir_fd: dir_fd(requires='mkfifoat')=None
+
+Create a "fifo" (a POSIX named pipe).
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_mkfifo_impl(PyObject *module, path_t *path, int mode, int dir_fd)
+/*[clinic end generated code: output=ce41cfad0e68c940 input=73032e98a36e0e19]*/
+{
+ int result;
+ int async_err = 0;
+#ifdef HAVE_MKFIFOAT
+ int mkfifoat_unavailable = 0;
+#endif
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_MKFIFOAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_MKFIFOAT_RUNTIME) {
+ result = mkfifoat(dir_fd, path->narrow, mode);
+
+ } else {
+ mkfifoat_unavailable = 1;
+ result = 0;
+ }
+ } else
+#endif
+ result = mkfifo(path->narrow, mode);
+ Py_END_ALLOW_THREADS
+ } while (result != 0 && errno == EINTR &&
+ !(async_err = PyErr_CheckSignals()));
+
+#ifdef HAVE_MKFIFOAT
+ if (mkfifoat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+
+ if (result != 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_MKFIFO */
+
+
+#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
+/*[clinic input]
+os.mknod
+
+ path: path_t
+ mode: int=0o600
+ device: dev_t=0
+ *
+ dir_fd: dir_fd(requires='mknodat')=None
+
+Create a node in the file system.
+
+Create a node in the file system (file, device special file or named pipe)
+at path. mode specifies both the permissions to use and the
+type of node to be created, being combined (bitwise OR) with one of
+S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO. If S_IFCHR or S_IFBLK is set on mode,
+device defines the newly created device special file (probably using
+os.makedev()). Otherwise device is ignored.
+
+If dir_fd is not None, it should be a file descriptor open to a directory,
+ and path should be relative; path will then be relative to that directory.
+dir_fd may not be implemented on your platform.
+ If it is unavailable, using it will raise a NotImplementedError.
+[clinic start generated code]*/
+
+static PyObject *
+os_mknod_impl(PyObject *module, path_t *path, int mode, dev_t device,
+ int dir_fd)
+/*[clinic end generated code: output=92e55d3ca8917461 input=ee44531551a4d83b]*/
+{
+ int result;
+ int async_err = 0;
+#ifdef HAVE_MKNODAT
+ int mknodat_unavailable = 0;
+#endif
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_MKNODAT
+ if (dir_fd != DEFAULT_DIR_FD) {
+ if (HAVE_MKNODAT_RUNTIME) {
+ result = mknodat(dir_fd, path->narrow, mode, device);
+
+ } else {
+ mknodat_unavailable = 1;
+ result = 0;
+ }
+ } else
+#endif
+ result = mknod(path->narrow, mode, device);
+ Py_END_ALLOW_THREADS
+ } while (result != 0 && errno == EINTR &&
+ !(async_err = PyErr_CheckSignals()));
+#ifdef HAVE_MKNODAT
+ if (mknodat_unavailable) {
+ argument_unavailable_error(NULL, "dir_fd");
+ return NULL;
+ }
+#endif
+ if (result != 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ Py_RETURN_NONE;
+}
+#endif /* defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV) */
+
+
+#ifdef HAVE_DEVICE_MACROS
+/*[clinic input]
+os.major -> unsigned_int
+
+ device: dev_t
+ /
+
+Extracts a device major number from a raw device number.
+[clinic start generated code]*/
+
+static unsigned int
+os_major_impl(PyObject *module, dev_t device)
+/*[clinic end generated code: output=5b3b2589bafb498e input=1e16a4d30c4d4462]*/
+{
+ return major(device);
+}
+
+
+/*[clinic input]
+os.minor -> unsigned_int
+
+ device: dev_t
+ /
+
+Extracts a device minor number from a raw device number.
+[clinic start generated code]*/
+
+static unsigned int
+os_minor_impl(PyObject *module, dev_t device)
+/*[clinic end generated code: output=5e1a25e630b0157d input=0842c6d23f24c65e]*/
+{
+ return minor(device);
+}
+
+
+/*[clinic input]
+os.makedev -> dev_t
+
+ major: int
+ minor: int
+ /
+
+Composes a raw device number from the major and minor device numbers.
+[clinic start generated code]*/
+
+static dev_t
+os_makedev_impl(PyObject *module, int major, int minor)
+/*[clinic end generated code: output=881aaa4aba6f6a52 input=4b9fd8fc73cbe48f]*/
+{
+ return makedev(major, minor);
+}
+#endif /* HAVE_DEVICE_MACROS */
+
+
+#if defined HAVE_FTRUNCATE || defined MS_WINDOWS
+/*[clinic input]
+os.ftruncate
+
+ fd: int
+ length: Py_off_t
+ /
+
+Truncate a file, specified by file descriptor, to a specific length.
+[clinic start generated code]*/
+
+static PyObject *
+os_ftruncate_impl(PyObject *module, int fd, Py_off_t length)
+/*[clinic end generated code: output=fba15523721be7e4 input=63b43641e52818f2]*/
+{
+ int result;
+ int async_err = 0;
+
+ if (PySys_Audit("os.truncate", "in", fd, length) < 0) {
+ return NULL;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef MS_WINDOWS
+ result = _chsize_s(fd, length);
+#else
+ result = ftruncate(fd, length);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ } while (result != 0 && errno == EINTR &&
+ !(async_err = PyErr_CheckSignals()));
+ if (result != 0)
+ return (!async_err) ? posix_error() : NULL;
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_FTRUNCATE || MS_WINDOWS */
+
+
+#if defined HAVE_TRUNCATE || defined MS_WINDOWS
+/*[clinic input]
+os.truncate
+ path: path_t(allow_fd='PATH_HAVE_FTRUNCATE')
+ length: Py_off_t
+
+Truncate a file, specified by path, to a specific length.
+
+On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+[clinic start generated code]*/
+
+static PyObject *
+os_truncate_impl(PyObject *module, path_t *path, Py_off_t length)
+/*[clinic end generated code: output=43009c8df5c0a12b input=77229cf0b50a9b77]*/
+{
+ int result;
+#ifdef MS_WINDOWS
+ int fd;
+#endif
+
+ if (path->fd != -1)
+ return os_ftruncate_impl(module, path->fd, length);
+
+ if (PySys_Audit("os.truncate", "On", path->object, length) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+#ifdef MS_WINDOWS
+ fd = _wopen(path->wide, _O_WRONLY | _O_BINARY | _O_NOINHERIT);
+ if (fd < 0)
+ result = -1;
+ else {
+ result = _chsize_s(fd, length);
+ close(fd);
+ if (result < 0)
+ errno = result;
+ }
+#else
+ result = truncate(path->narrow, length);
+#endif
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+ if (result < 0)
+ return posix_path_error(path);
+
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_TRUNCATE || MS_WINDOWS */
+
+
+/* Issue #22396: On 32-bit AIX platform, the prototypes of os.posix_fadvise()
+ and os.posix_fallocate() in system headers are wrong if _LARGE_FILES is
+ defined, which is the case in Python on AIX. AIX bug report:
+ http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170 */
+#if defined(_AIX) && defined(_LARGE_FILES) && !defined(__64BIT__)
+# define POSIX_FADVISE_AIX_BUG
+#endif
+
+
+/* GH-111804: Due to posix_fallocate() not having consistent semantics across
+ OSs, support was dropped in WASI preview2. */
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(POSIX_FADVISE_AIX_BUG) && \
+ !defined(__wasi__)
+/*[clinic input]
+os.posix_fallocate
+
+ fd: int
+ offset: Py_off_t
+ length: Py_off_t
+ /
+
+Ensure a file has allocated at least a particular number of bytes on disk.
+
+Ensure that the file specified by fd encompasses a range of bytes
+starting at offset bytes from the beginning and continuing for length bytes.
+[clinic start generated code]*/
+
+static PyObject *
+os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
+ Py_off_t length)
+/*[clinic end generated code: output=73f107139564aa9d input=d7a2ef0ab2ca52fb]*/
+{
+ int result;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ result = posix_fallocate(fd, offset, length);
+ Py_END_ALLOW_THREADS
+ } while (result == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (result == 0)
+ Py_RETURN_NONE;
+
+ if (async_err)
+ return NULL;
+
+ errno = result;
+ return posix_error();
+}
+#endif /* HAVE_POSIX_FALLOCATE) && !POSIX_FADVISE_AIX_BUG && !defined(__wasi__) */
+
+
+#if defined(HAVE_POSIX_FADVISE) && !defined(POSIX_FADVISE_AIX_BUG)
+/*[clinic input]
+os.posix_fadvise
+
+ fd: int
+ offset: Py_off_t
+ length: Py_off_t
+ advice: int
+ /
+
+Announce an intention to access data in a specific pattern.
+
+Announce an intention to access data in a specific pattern, thus allowing
+the kernel to make optimizations.
+The advice applies to the region of the file specified by fd starting at
+offset and continuing for length bytes.
+advice is one of POSIX_FADV_NORMAL, POSIX_FADV_SEQUENTIAL,
+POSIX_FADV_RANDOM, POSIX_FADV_NOREUSE, POSIX_FADV_WILLNEED, or
+POSIX_FADV_DONTNEED.
+[clinic start generated code]*/
+
+static PyObject *
+os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
+ Py_off_t length, int advice)
+/*[clinic end generated code: output=412ef4aa70c98642 input=0fbe554edc2f04b5]*/
+{
+ int result;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ result = posix_fadvise(fd, offset, length, advice);
+ Py_END_ALLOW_THREADS
+ } while (result == EINTR && !(async_err = PyErr_CheckSignals()));
+
+ if (result == 0)
+ Py_RETURN_NONE;
+
+ if (async_err)
+ return NULL;
+
+ errno = result;
+ return posix_error();
+}
+#endif /* HAVE_POSIX_FADVISE && !POSIX_FADVISE_AIX_BUG */
+
+
+#ifdef MS_WINDOWS
+static PyObject*
+win32_putenv(PyObject *name, PyObject *value)
+{
+ /* Search from index 1 because on Windows starting '=' is allowed for
+ defining hidden environment variables. */
+ if (PyUnicode_GET_LENGTH(name) == 0 ||
+ PyUnicode_FindChar(name, '=', 1, PyUnicode_GET_LENGTH(name), 1) != -1)
+ {
+ PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
+ return NULL;
+ }
+ PyObject *unicode;
+ if (value != NULL) {
+ unicode = PyUnicode_FromFormat("%U=%U", name, value);
+ }
+ else {
+ unicode = PyUnicode_FromFormat("%U=", name);
+ }
+ if (unicode == NULL) {
+ return NULL;
+ }
+
+ Py_ssize_t size;
+ wchar_t *env = PyUnicode_AsWideCharString(unicode, &size);
+ Py_DECREF(unicode);
+
+ if (env == NULL) {
+ return NULL;
+ }
+ if (size > _MAX_ENV) {
+ PyErr_Format(PyExc_ValueError,
+ "the environment variable is longer than %u characters",
+ _MAX_ENV);
+ PyMem_Free(env);
+ return NULL;
+ }
+ if (wcslen(env) != (size_t)size) {
+ PyErr_SetString(PyExc_ValueError,
+ "embedded null character");
+ PyMem_Free(env);
+ return NULL;
+ }
+
+ /* _wputenv() and SetEnvironmentVariableW() update the environment in the
+ Process Environment Block (PEB). _wputenv() also updates CRT 'environ'
+ and '_wenviron' variables, whereas SetEnvironmentVariableW() does not.
+
+ Prefer _wputenv() to be compatible with C libraries using CRT
+ variables and CRT functions using these variables (ex: getenv()). */
+ int err = _wputenv(env);
+
+ if (err) {
+ posix_error();
+ PyMem_Free(env);
+ return NULL;
+ }
+ PyMem_Free(env);
+
+ Py_RETURN_NONE;
+}
+#endif
+
+
+#ifdef MS_WINDOWS
+/*[clinic input]
+os.putenv
+
+ name: unicode
+ value: unicode
+ /
+
+Change or add an environment variable.
+[clinic start generated code]*/
+
+static PyObject *
+os_putenv_impl(PyObject *module, PyObject *name, PyObject *value)
+/*[clinic end generated code: output=d29a567d6b2327d2 input=ba586581c2e6105f]*/
+{
+ if (PySys_Audit("os.putenv", "OO", name, value) < 0) {
+ return NULL;
+ }
+ return win32_putenv(name, value);
+}
+#else
+/*[clinic input]
+os.putenv
+
+ name: FSConverter
+ value: FSConverter
+ /
+
+Change or add an environment variable.
+[clinic start generated code]*/
+
+static PyObject *
+os_putenv_impl(PyObject *module, PyObject *name, PyObject *value)
+/*[clinic end generated code: output=d29a567d6b2327d2 input=a97bc6152f688d31]*/
+{
+ const char *name_string = PyBytes_AS_STRING(name);
+ const char *value_string = PyBytes_AS_STRING(value);
+
+ if (strchr(name_string, '=') != NULL) {
+ PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
+ return NULL;
+ }
+
+ if (PySys_Audit("os.putenv", "OO", name, value) < 0) {
+ return NULL;
+ }
+
+ if (setenv(name_string, value_string, 1)) {
+ return posix_error();
+ }
+ Py_RETURN_NONE;
+}
+#endif /* !defined(MS_WINDOWS) */
+
+
+#ifdef MS_WINDOWS
+/*[clinic input]
+os.unsetenv
+ name: unicode
+ /
+
+Delete an environment variable.
+[clinic start generated code]*/
+
+static PyObject *
+os_unsetenv_impl(PyObject *module, PyObject *name)
+/*[clinic end generated code: output=54c4137ab1834f02 input=4d6a1747cc526d2f]*/
+{
+ if (PySys_Audit("os.unsetenv", "(O)", name) < 0) {
+ return NULL;
+ }
+ return win32_putenv(name, NULL);
+}
+#else
+/*[clinic input]
+os.unsetenv
+ name: FSConverter
+ /
+
+Delete an environment variable.
+[clinic start generated code]*/
+
+static PyObject *
+os_unsetenv_impl(PyObject *module, PyObject *name)
+/*[clinic end generated code: output=54c4137ab1834f02 input=2bb5288a599c7107]*/
+{
+ if (PySys_Audit("os.unsetenv", "(O)", name) < 0) {
+ return NULL;
+ }
+#ifdef HAVE_BROKEN_UNSETENV
+ unsetenv(PyBytes_AS_STRING(name));
+#else
+ int err = unsetenv(PyBytes_AS_STRING(name));
+ if (err) {
+ return posix_error();
+ }
+#endif
+
+ Py_RETURN_NONE;
+}
+#endif /* !MS_WINDOWS */
+
+
+/*[clinic input]
+os.strerror
+
+ code: int
+ /
+
+Translate an error code to a message string.
+[clinic start generated code]*/
+
+static PyObject *
+os_strerror_impl(PyObject *module, int code)
+/*[clinic end generated code: output=baebf09fa02a78f2 input=75a8673d97915a91]*/
+{
+ char *message = strerror(code);
+ if (message == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "strerror() argument out of range");
+ return NULL;
+ }
+ return PyUnicode_DecodeLocale(message, "surrogateescape");
+}
+
+
+#ifdef HAVE_SYS_WAIT_H
+#ifdef WCOREDUMP
+/*[clinic input]
+os.WCOREDUMP -> bool
+
+ status: int
+ /
+
+Return True if the process returning status was dumped to a core file.
+[clinic start generated code]*/
+
+static int
+os_WCOREDUMP_impl(PyObject *module, int status)
+/*[clinic end generated code: output=1a584b147b16bd18 input=8b05e7ab38528d04]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WCOREDUMP(wait_status);
+}
+#endif /* WCOREDUMP */
+
+
+#ifdef WIFCONTINUED
+/*[clinic input]
+os.WIFCONTINUED -> bool
+
+ status: int
+
+Return True if a particular process was continued from a job control stop.
+
+Return True if the process returning status was continued from a
+job control stop.
+[clinic start generated code]*/
+
+static int
+os_WIFCONTINUED_impl(PyObject *module, int status)
+/*[clinic end generated code: output=1e35295d844364bd input=e777e7d38eb25bd9]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WIFCONTINUED(wait_status);
+}
+#endif /* WIFCONTINUED */
+
+
+#ifdef WIFSTOPPED
+/*[clinic input]
+os.WIFSTOPPED -> bool
+
+ status: int
+
+Return True if the process returning status was stopped.
+[clinic start generated code]*/
+
+static int
+os_WIFSTOPPED_impl(PyObject *module, int status)
+/*[clinic end generated code: output=fdb57122a5c9b4cb input=043cb7f1289ef904]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WIFSTOPPED(wait_status);
+}
+#endif /* WIFSTOPPED */
+
+
+#ifdef WIFSIGNALED
+/*[clinic input]
+os.WIFSIGNALED -> bool
+
+ status: int
+
+Return True if the process returning status was terminated by a signal.
+[clinic start generated code]*/
+
+static int
+os_WIFSIGNALED_impl(PyObject *module, int status)
+/*[clinic end generated code: output=d1dde4dcc819a5f5 input=d55ba7cc9ce5dc43]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WIFSIGNALED(wait_status);
+}
+#endif /* WIFSIGNALED */
+
+
+#ifdef WIFEXITED
+/*[clinic input]
+os.WIFEXITED -> bool
+
+ status: int
+
+Return True if the process returning status exited via the exit() system call.
+[clinic start generated code]*/
+
+static int
+os_WIFEXITED_impl(PyObject *module, int status)
+/*[clinic end generated code: output=01c09d6ebfeea397 input=d63775a6791586c0]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WIFEXITED(wait_status);
+}
+#endif /* WIFEXITED */
+
+
+#ifdef WEXITSTATUS
+/*[clinic input]
+os.WEXITSTATUS -> int
+
+ status: int
+
+Return the process return code from status.
+[clinic start generated code]*/
+
+static int
+os_WEXITSTATUS_impl(PyObject *module, int status)
+/*[clinic end generated code: output=6e3efbba11f6488d input=e1fb4944e377585b]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WEXITSTATUS(wait_status);
+}
+#endif /* WEXITSTATUS */
+
+
+#ifdef WTERMSIG
+/*[clinic input]
+os.WTERMSIG -> int
+
+ status: int
+
+Return the signal that terminated the process that provided the status value.
+[clinic start generated code]*/
+
+static int
+os_WTERMSIG_impl(PyObject *module, int status)
+/*[clinic end generated code: output=172f7dfc8dcfc3ad input=727fd7f84ec3f243]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WTERMSIG(wait_status);
+}
+#endif /* WTERMSIG */
+
+
+#ifdef WSTOPSIG
+/*[clinic input]
+os.WSTOPSIG -> int
+
+ status: int
+
+Return the signal that stopped the process that provided the status value.
+[clinic start generated code]*/
+
+static int
+os_WSTOPSIG_impl(PyObject *module, int status)
+/*[clinic end generated code: output=0ab7586396f5d82b input=46ebf1d1b293c5c1]*/
+{
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ return WSTOPSIG(wait_status);
+}
+#endif /* WSTOPSIG */
+#endif /* HAVE_SYS_WAIT_H */
+
+
+#if defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H)
+#ifdef _SCO_DS
+/* SCO OpenServer 5.0 and later requires _SVID3 before it reveals the
+ needed definitions in sys/statvfs.h */
+#define _SVID3
+#endif
+#include <sys/statvfs.h>
+
+static PyObject*
+_pystatvfs_fromstructstatvfs(PyObject *module, struct statvfs st) {
+ PyObject *StatVFSResultType = get_posix_state(module)->StatVFSResultType;
+ PyObject *v = PyStructSequence_New((PyTypeObject *)StatVFSResultType);
+ if (v == NULL)
+ return NULL;
+
+#if !defined(HAVE_LARGEFILE_SUPPORT)
+ PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long) st.f_bsize));
+ PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long) st.f_frsize));
+ PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long) st.f_blocks));
+ PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long) st.f_bfree));
+ PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong((long) st.f_bavail));
+ PyStructSequence_SET_ITEM(v, 5, PyLong_FromLong((long) st.f_files));
+ PyStructSequence_SET_ITEM(v, 6, PyLong_FromLong((long) st.f_ffree));
+ PyStructSequence_SET_ITEM(v, 7, PyLong_FromLong((long) st.f_favail));
+ PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
+ PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
+#else
+ PyStructSequence_SET_ITEM(v, 0, PyLong_FromLong((long) st.f_bsize));
+ PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long) st.f_frsize));
+ PyStructSequence_SET_ITEM(v, 2,
+ PyLong_FromLongLong((long long) st.f_blocks));
+ PyStructSequence_SET_ITEM(v, 3,
+ PyLong_FromLongLong((long long) st.f_bfree));
+ PyStructSequence_SET_ITEM(v, 4,
+ PyLong_FromLongLong((long long) st.f_bavail));
+ PyStructSequence_SET_ITEM(v, 5,
+ PyLong_FromLongLong((long long) st.f_files));
+ PyStructSequence_SET_ITEM(v, 6,
+ PyLong_FromLongLong((long long) st.f_ffree));
+ PyStructSequence_SET_ITEM(v, 7,
+ PyLong_FromLongLong((long long) st.f_favail));
+ PyStructSequence_SET_ITEM(v, 8, PyLong_FromLong((long) st.f_flag));
+ PyStructSequence_SET_ITEM(v, 9, PyLong_FromLong((long) st.f_namemax));
+#endif
+/* The _ALL_SOURCE feature test macro defines f_fsid as a structure
+ * (issue #32390). */
+#if defined(_AIX) && defined(_ALL_SOURCE)
+ PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid.val[0]));
+#else
+ PyStructSequence_SET_ITEM(v, 10, PyLong_FromUnsignedLong(st.f_fsid));
+#endif
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ return NULL;
+ }
+
+ return v;
+}
+
+
+/*[clinic input]
+os.fstatvfs
+ fd: int
+ /
+
+Perform an fstatvfs system call on the given fd.
+
+Equivalent to statvfs(fd).
+[clinic start generated code]*/
+
+static PyObject *
+os_fstatvfs_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=53547cf0cc55e6c5 input=d8122243ac50975e]*/
+{
+ int result;
+ int async_err = 0;
+ struct statvfs st;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ result = fstatvfs(fd, &st);
+ Py_END_ALLOW_THREADS
+ } while (result != 0 && errno == EINTR &&
+ !(async_err = PyErr_CheckSignals()));
+ if (result != 0)
+ return (!async_err) ? posix_error() : NULL;
+
+ return _pystatvfs_fromstructstatvfs(module, st);
+}
+#endif /* defined(HAVE_FSTATVFS) && defined(HAVE_SYS_STATVFS_H) */
+
+
+#if defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H)
+#include <sys/statvfs.h>
+/*[clinic input]
+os.statvfs
+
+ path: path_t(allow_fd='PATH_HAVE_FSTATVFS')
+
+Perform a statvfs system call on the given path.
+
+path may always be specified as a string.
+On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+[clinic start generated code]*/
+
+static PyObject *
+os_statvfs_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=87106dd1beb8556e input=3f5c35791c669bd9]*/
+{
+ int result;
+ struct statvfs st;
+
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_FSTATVFS
+ if (path->fd != -1) {
+ result = fstatvfs(path->fd, &st);
+ }
+ else
+#endif
+ result = statvfs(path->narrow, &st);
+ Py_END_ALLOW_THREADS
+
+ if (result) {
+ return path_error(path);
+ }
+
+ return _pystatvfs_fromstructstatvfs(module, st);
+}
+#endif /* defined(HAVE_STATVFS) && defined(HAVE_SYS_STATVFS_H) */
+
+
+#ifdef MS_WINDOWS
+/*[clinic input]
+os._getdiskusage
+
+ path: path_t
+
+Return disk usage statistics about the given path as a (total, free) tuple.
+[clinic start generated code]*/
+
+static PyObject *
+os__getdiskusage_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=3bd3991f5e5c5dfb input=6af8d1b7781cc042]*/
+{
+ BOOL retval;
+ ULARGE_INTEGER _, total, free;
+ DWORD err = 0;
+
+ Py_BEGIN_ALLOW_THREADS
+ retval = GetDiskFreeSpaceExW(path->wide, &_, &total, &free);
+ Py_END_ALLOW_THREADS
+ if (retval == 0) {
+ if (GetLastError() == ERROR_DIRECTORY) {
+ wchar_t *dir_path = NULL;
+
+ dir_path = PyMem_New(wchar_t, path->length + 1);
+ if (dir_path == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ wcscpy_s(dir_path, path->length + 1, path->wide);
+
+ if (_dirnameW(dir_path) != -1) {
+ Py_BEGIN_ALLOW_THREADS
+ retval = GetDiskFreeSpaceExW(dir_path, &_, &total, &free);
+ Py_END_ALLOW_THREADS
+ }
+ /* Record the last error in case it's modified by PyMem_Free. */
+ err = GetLastError();
+ PyMem_Free(dir_path);
+ if (retval) {
+ goto success;
+ }
+ }
+ return PyErr_SetFromWindowsErr(err);
+ }
+
+success:
+ return Py_BuildValue("(LL)", total.QuadPart, free.QuadPart);
+}
+#endif /* MS_WINDOWS */
+
+
+/* This is used for fpathconf(), pathconf(), confstr() and sysconf().
+ * It maps strings representing configuration variable names to
+ * integer values, allowing those functions to be called with the
+ * magic names instead of polluting the module's namespace with tons of
+ * rarely-used constants. There are three separate tables that use
+ * these definitions.
+ *
+ * This code is always included, even if none of the interfaces that
+ * need it are included. The #if hackery needed to avoid it would be
+ * sufficiently pervasive that it's not worth the loss of readability.
+ */
+struct constdef {
+ const char *name;
+ int value;
+};
+
+static int
+conv_confname(PyObject *arg, int *valuep, struct constdef *table,
+ size_t tablesize)
+{
+ if (PyLong_Check(arg)) {
+ int value = _PyLong_AsInt(arg);
+ if (value == -1 && PyErr_Occurred())
+ return 0;
+ *valuep = value;
+ return 1;
+ }
+ else {
+ /* look up the value in the table using a binary search */
+ size_t lo = 0;
+ size_t mid;
+ size_t hi = tablesize;
+ int cmp;
+ const char *confname;
+ if (!PyUnicode_Check(arg)) {
+ PyErr_SetString(PyExc_TypeError,
+ "configuration names must be strings or integers");
+ return 0;
+ }
+ confname = PyUnicode_AsUTF8(arg);
+ if (confname == NULL)
+ return 0;
+ while (lo < hi) {
+ mid = (lo + hi) / 2;
+ cmp = strcmp(confname, table[mid].name);
+ if (cmp < 0)
+ hi = mid;
+ else if (cmp > 0)
+ lo = mid + 1;
+ else {
+ *valuep = table[mid].value;
+ return 1;
+ }
+ }
+ PyErr_SetString(PyExc_ValueError, "unrecognized configuration name");
+ return 0;
+ }
+}
+
+
+#if defined(HAVE_FPATHCONF) || defined(HAVE_PATHCONF)
+static struct constdef posix_constants_pathconf[] = {
+#ifdef _PC_ABI_AIO_XFER_MAX
+ {"PC_ABI_AIO_XFER_MAX", _PC_ABI_AIO_XFER_MAX},
+#endif
+#ifdef _PC_ABI_ASYNC_IO
+ {"PC_ABI_ASYNC_IO", _PC_ABI_ASYNC_IO},
+#endif
+#ifdef _PC_ASYNC_IO
+ {"PC_ASYNC_IO", _PC_ASYNC_IO},
+#endif
+#ifdef _PC_CHOWN_RESTRICTED
+ {"PC_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED},
+#endif
+#ifdef _PC_FILESIZEBITS
+ {"PC_FILESIZEBITS", _PC_FILESIZEBITS},
+#endif
+#ifdef _PC_LAST
+ {"PC_LAST", _PC_LAST},
+#endif
+#ifdef _PC_LINK_MAX
+ {"PC_LINK_MAX", _PC_LINK_MAX},
+#endif
+#ifdef _PC_MAX_CANON
+ {"PC_MAX_CANON", _PC_MAX_CANON},
+#endif
+#ifdef _PC_MAX_INPUT
+ {"PC_MAX_INPUT", _PC_MAX_INPUT},
+#endif
+#ifdef _PC_NAME_MAX
+ {"PC_NAME_MAX", _PC_NAME_MAX},
+#endif
+#ifdef _PC_NO_TRUNC
+ {"PC_NO_TRUNC", _PC_NO_TRUNC},
+#endif
+#ifdef _PC_PATH_MAX
+ {"PC_PATH_MAX", _PC_PATH_MAX},
+#endif
+#ifdef _PC_PIPE_BUF
+ {"PC_PIPE_BUF", _PC_PIPE_BUF},
+#endif
+#ifdef _PC_PRIO_IO
+ {"PC_PRIO_IO", _PC_PRIO_IO},
+#endif
+#ifdef _PC_SOCK_MAXBUF
+ {"PC_SOCK_MAXBUF", _PC_SOCK_MAXBUF},
+#endif
+#ifdef _PC_SYNC_IO
+ {"PC_SYNC_IO", _PC_SYNC_IO},
+#endif
+#ifdef _PC_VDISABLE
+ {"PC_VDISABLE", _PC_VDISABLE},
+#endif
+#ifdef _PC_ACL_ENABLED
+ {"PC_ACL_ENABLED", _PC_ACL_ENABLED},
+#endif
+#ifdef _PC_MIN_HOLE_SIZE
+ {"PC_MIN_HOLE_SIZE", _PC_MIN_HOLE_SIZE},
+#endif
+#ifdef _PC_ALLOC_SIZE_MIN
+ {"PC_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN},
+#endif
+#ifdef _PC_REC_INCR_XFER_SIZE
+ {"PC_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE},
+#endif
+#ifdef _PC_REC_MAX_XFER_SIZE
+ {"PC_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE},
+#endif
+#ifdef _PC_REC_MIN_XFER_SIZE
+ {"PC_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE},
+#endif
+#ifdef _PC_REC_XFER_ALIGN
+ {"PC_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN},
+#endif
+#ifdef _PC_SYMLINK_MAX
+ {"PC_SYMLINK_MAX", _PC_SYMLINK_MAX},
+#endif
+#ifdef _PC_XATTR_ENABLED
+ {"PC_XATTR_ENABLED", _PC_XATTR_ENABLED},
+#endif
+#ifdef _PC_XATTR_EXISTS
+ {"PC_XATTR_EXISTS", _PC_XATTR_EXISTS},
+#endif
+#ifdef _PC_TIMESTAMP_RESOLUTION
+ {"PC_TIMESTAMP_RESOLUTION", _PC_TIMESTAMP_RESOLUTION},
+#endif
+};
+
+static int
+conv_path_confname(PyObject *arg, int *valuep)
+{
+ return conv_confname(arg, valuep, posix_constants_pathconf,
+ sizeof(posix_constants_pathconf)
+ / sizeof(struct constdef));
+}
+#endif
+
+
+#ifdef HAVE_FPATHCONF
+/*[clinic input]
+os.fpathconf -> long
+
+ fd: fildes
+ name: path_confname
+ /
+
+Return the configuration limit name for the file descriptor fd.
+
+If there is no limit, return -1.
+[clinic start generated code]*/
+
+static long
+os_fpathconf_impl(PyObject *module, int fd, int name)
+/*[clinic end generated code: output=d5b7042425fc3e21 input=5b8d2471cfaae186]*/
+{
+ long limit;
+
+ errno = 0;
+ limit = fpathconf(fd, name);
+ if (limit == -1 && errno != 0)
+ posix_error();
+
+ return limit;
+}
+#endif /* HAVE_FPATHCONF */
+
+
+#ifdef HAVE_PATHCONF
+/*[clinic input]
+os.pathconf -> long
+ path: path_t(allow_fd='PATH_HAVE_FPATHCONF')
+ name: path_confname
+
+Return the configuration limit name for the file or directory path.
+
+If there is no limit, return -1.
+On some platforms, path may also be specified as an open file descriptor.
+ If this functionality is unavailable, using it raises an exception.
+[clinic start generated code]*/
+
+static long
+os_pathconf_impl(PyObject *module, path_t *path, int name)
+/*[clinic end generated code: output=5bedee35b293a089 input=bc3e2a985af27e5e]*/
+{
+ long limit;
+
+ errno = 0;
+#ifdef HAVE_FPATHCONF
+ if (path->fd != -1)
+ limit = fpathconf(path->fd, name);
+ else
+#endif
+ limit = pathconf(path->narrow, name);
+ if (limit == -1 && errno != 0) {
+ if (errno == EINVAL)
+ /* could be a path or name problem */
+ posix_error();
+ else
+ path_error(path);
+ }
+
+ return limit;
+}
+#endif /* HAVE_PATHCONF */
+
+#ifdef HAVE_CONFSTR
+static struct constdef posix_constants_confstr[] = {
+#ifdef _CS_ARCHITECTURE
+ {"CS_ARCHITECTURE", _CS_ARCHITECTURE},
+#endif
+#ifdef _CS_GNU_LIBC_VERSION
+ {"CS_GNU_LIBC_VERSION", _CS_GNU_LIBC_VERSION},
+#endif
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+ {"CS_GNU_LIBPTHREAD_VERSION", _CS_GNU_LIBPTHREAD_VERSION},
+#endif
+#ifdef _CS_HOSTNAME
+ {"CS_HOSTNAME", _CS_HOSTNAME},
+#endif
+#ifdef _CS_HW_PROVIDER
+ {"CS_HW_PROVIDER", _CS_HW_PROVIDER},
+#endif
+#ifdef _CS_HW_SERIAL
+ {"CS_HW_SERIAL", _CS_HW_SERIAL},
+#endif
+#ifdef _CS_INITTAB_NAME
+ {"CS_INITTAB_NAME", _CS_INITTAB_NAME},
+#endif
+#ifdef _CS_LFS64_CFLAGS
+ {"CS_LFS64_CFLAGS", _CS_LFS64_CFLAGS},
+#endif
+#ifdef _CS_LFS64_LDFLAGS
+ {"CS_LFS64_LDFLAGS", _CS_LFS64_LDFLAGS},
+#endif
+#ifdef _CS_LFS64_LIBS
+ {"CS_LFS64_LIBS", _CS_LFS64_LIBS},
+#endif
+#ifdef _CS_LFS64_LINTFLAGS
+ {"CS_LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS},
+#endif
+#ifdef _CS_LFS_CFLAGS
+ {"CS_LFS_CFLAGS", _CS_LFS_CFLAGS},
+#endif
+#ifdef _CS_LFS_LDFLAGS
+ {"CS_LFS_LDFLAGS", _CS_LFS_LDFLAGS},
+#endif
+#ifdef _CS_LFS_LIBS
+ {"CS_LFS_LIBS", _CS_LFS_LIBS},
+#endif
+#ifdef _CS_LFS_LINTFLAGS
+ {"CS_LFS_LINTFLAGS", _CS_LFS_LINTFLAGS},
+#endif
+#ifdef _CS_MACHINE
+ {"CS_MACHINE", _CS_MACHINE},
+#endif
+#ifdef _CS_PATH
+ {"CS_PATH", _CS_PATH},
+#endif
+#ifdef _CS_RELEASE
+ {"CS_RELEASE", _CS_RELEASE},
+#endif
+#ifdef _CS_SRPC_DOMAIN
+ {"CS_SRPC_DOMAIN", _CS_SRPC_DOMAIN},
+#endif
+#ifdef _CS_SYSNAME
+ {"CS_SYSNAME", _CS_SYSNAME},
+#endif
+#ifdef _CS_VERSION
+ {"CS_VERSION", _CS_VERSION},
+#endif
+#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
+ {"CS_XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
+ {"CS_XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFF32_LIBS
+ {"CS_XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
+ {"CS_XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ {"CS_XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ {"CS_XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
+ {"CS_XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS},
+#endif
+#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ {"CS_XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS},
+#endif
+#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
+ {"CS_XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS},
+#endif
+#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
+ {"CS_XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS},
+#endif
+#ifdef _CS_XBS5_LP64_OFF64_LIBS
+ {"CS_XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS},
+#endif
+#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
+ {"CS_XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS},
+#endif
+#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ {"CS_XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS},
+#endif
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ {"CS_XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS},
+#endif
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
+ {"CS_XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS},
+#endif
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+ {"CS_XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS},
+#endif
+#ifdef _MIPS_CS_AVAIL_PROCESSORS
+ {"MIPS_CS_AVAIL_PROCESSORS", _MIPS_CS_AVAIL_PROCESSORS},
+#endif
+#ifdef _MIPS_CS_BASE
+ {"MIPS_CS_BASE", _MIPS_CS_BASE},
+#endif
+#ifdef _MIPS_CS_HOSTID
+ {"MIPS_CS_HOSTID", _MIPS_CS_HOSTID},
+#endif
+#ifdef _MIPS_CS_HW_NAME
+ {"MIPS_CS_HW_NAME", _MIPS_CS_HW_NAME},
+#endif
+#ifdef _MIPS_CS_NUM_PROCESSORS
+ {"MIPS_CS_NUM_PROCESSORS", _MIPS_CS_NUM_PROCESSORS},
+#endif
+#ifdef _MIPS_CS_OSREL_MAJ
+ {"MIPS_CS_OSREL_MAJ", _MIPS_CS_OSREL_MAJ},
+#endif
+#ifdef _MIPS_CS_OSREL_MIN
+ {"MIPS_CS_OSREL_MIN", _MIPS_CS_OSREL_MIN},
+#endif
+#ifdef _MIPS_CS_OSREL_PATCH
+ {"MIPS_CS_OSREL_PATCH", _MIPS_CS_OSREL_PATCH},
+#endif
+#ifdef _MIPS_CS_OS_NAME
+ {"MIPS_CS_OS_NAME", _MIPS_CS_OS_NAME},
+#endif
+#ifdef _MIPS_CS_OS_PROVIDER
+ {"MIPS_CS_OS_PROVIDER", _MIPS_CS_OS_PROVIDER},
+#endif
+#ifdef _MIPS_CS_PROCESSORS
+ {"MIPS_CS_PROCESSORS", _MIPS_CS_PROCESSORS},
+#endif
+#ifdef _MIPS_CS_SERIAL
+ {"MIPS_CS_SERIAL", _MIPS_CS_SERIAL},
+#endif
+#ifdef _MIPS_CS_VENDOR
+ {"MIPS_CS_VENDOR", _MIPS_CS_VENDOR},
+#endif
+};
+
+static int
+conv_confstr_confname(PyObject *arg, int *valuep)
+{
+ return conv_confname(arg, valuep, posix_constants_confstr,
+ sizeof(posix_constants_confstr)
+ / sizeof(struct constdef));
+}
+
+
+/*[clinic input]
+os.confstr
+
+ name: confstr_confname
+ /
+
+Return a string-valued system configuration variable.
+[clinic start generated code]*/
+
+static PyObject *
+os_confstr_impl(PyObject *module, int name)
+/*[clinic end generated code: output=bfb0b1b1e49b9383 input=18fb4d0567242e65]*/
+{
+ PyObject *result = NULL;
+ char buffer[255];
+ size_t len;
+
+ errno = 0;
+ len = confstr(name, buffer, sizeof(buffer));
+ if (len == 0) {
+ if (errno) {
+ posix_error();
+ return NULL;
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+ }
+
+ if (len >= sizeof(buffer)) {
+ size_t len2;
+ char *buf = PyMem_Malloc(len);
+ if (buf == NULL)
+ return PyErr_NoMemory();
+ len2 = confstr(name, buf, len);
+ assert(len == len2);
+ result = PyUnicode_DecodeFSDefaultAndSize(buf, len2-1);
+ PyMem_Free(buf);
+ }
+ else
+ result = PyUnicode_DecodeFSDefaultAndSize(buffer, len-1);
+ return result;
+}
+#endif /* HAVE_CONFSTR */
+
+
+#ifdef HAVE_SYSCONF
+static struct constdef posix_constants_sysconf[] = {
+#ifdef _SC_2_CHAR_TERM
+ {"SC_2_CHAR_TERM", _SC_2_CHAR_TERM},
+#endif
+#ifdef _SC_2_C_BIND
+ {"SC_2_C_BIND", _SC_2_C_BIND},
+#endif
+#ifdef _SC_2_C_DEV
+ {"SC_2_C_DEV", _SC_2_C_DEV},
+#endif
+#ifdef _SC_2_C_VERSION
+ {"SC_2_C_VERSION", _SC_2_C_VERSION},
+#endif
+#ifdef _SC_2_FORT_DEV
+ {"SC_2_FORT_DEV", _SC_2_FORT_DEV},
+#endif
+#ifdef _SC_2_FORT_RUN
+ {"SC_2_FORT_RUN", _SC_2_FORT_RUN},
+#endif
+#ifdef _SC_2_LOCALEDEF
+ {"SC_2_LOCALEDEF", _SC_2_LOCALEDEF},
+#endif
+#ifdef _SC_2_SW_DEV
+ {"SC_2_SW_DEV", _SC_2_SW_DEV},
+#endif
+#ifdef _SC_2_UPE
+ {"SC_2_UPE", _SC_2_UPE},
+#endif
+#ifdef _SC_2_VERSION
+ {"SC_2_VERSION", _SC_2_VERSION},
+#endif
+#ifdef _SC_ABI_ASYNCHRONOUS_IO
+ {"SC_ABI_ASYNCHRONOUS_IO", _SC_ABI_ASYNCHRONOUS_IO},
+#endif
+#ifdef _SC_ACL
+ {"SC_ACL", _SC_ACL},
+#endif
+#ifdef _SC_AIO_LISTIO_MAX
+ {"SC_AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX},
+#endif
+#ifdef _SC_AIO_MAX
+ {"SC_AIO_MAX", _SC_AIO_MAX},
+#endif
+#ifdef _SC_AIO_PRIO_DELTA_MAX
+ {"SC_AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX},
+#endif
+#ifdef _SC_ARG_MAX
+ {"SC_ARG_MAX", _SC_ARG_MAX},
+#endif
+#ifdef _SC_ASYNCHRONOUS_IO
+ {"SC_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO},
+#endif
+#ifdef _SC_ATEXIT_MAX
+ {"SC_ATEXIT_MAX", _SC_ATEXIT_MAX},
+#endif
+#ifdef _SC_AUDIT
+ {"SC_AUDIT", _SC_AUDIT},
+#endif
+#ifdef _SC_AVPHYS_PAGES
+ {"SC_AVPHYS_PAGES", _SC_AVPHYS_PAGES},
+#endif
+#ifdef _SC_BC_BASE_MAX
+ {"SC_BC_BASE_MAX", _SC_BC_BASE_MAX},
+#endif
+#ifdef _SC_BC_DIM_MAX
+ {"SC_BC_DIM_MAX", _SC_BC_DIM_MAX},
+#endif
+#ifdef _SC_BC_SCALE_MAX
+ {"SC_BC_SCALE_MAX", _SC_BC_SCALE_MAX},
+#endif
+#ifdef _SC_BC_STRING_MAX
+ {"SC_BC_STRING_MAX", _SC_BC_STRING_MAX},
+#endif
+#ifdef _SC_CAP
+ {"SC_CAP", _SC_CAP},
+#endif
+#ifdef _SC_CHARCLASS_NAME_MAX
+ {"SC_CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX},
+#endif
+#ifdef _SC_CHAR_BIT
+ {"SC_CHAR_BIT", _SC_CHAR_BIT},
+#endif
+#ifdef _SC_CHAR_MAX
+ {"SC_CHAR_MAX", _SC_CHAR_MAX},
+#endif
+#ifdef _SC_CHAR_MIN
+ {"SC_CHAR_MIN", _SC_CHAR_MIN},
+#endif
+#ifdef _SC_CHILD_MAX
+ {"SC_CHILD_MAX", _SC_CHILD_MAX},
+#endif
+#ifdef _SC_CLK_TCK
+ {"SC_CLK_TCK", _SC_CLK_TCK},
+#endif
+#ifdef _SC_COHER_BLKSZ
+ {"SC_COHER_BLKSZ", _SC_COHER_BLKSZ},
+#endif
+#ifdef _SC_COLL_WEIGHTS_MAX
+ {"SC_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX},
+#endif
+#ifdef _SC_DCACHE_ASSOC
+ {"SC_DCACHE_ASSOC", _SC_DCACHE_ASSOC},
+#endif
+#ifdef _SC_DCACHE_BLKSZ
+ {"SC_DCACHE_BLKSZ", _SC_DCACHE_BLKSZ},
+#endif
+#ifdef _SC_DCACHE_LINESZ
+ {"SC_DCACHE_LINESZ", _SC_DCACHE_LINESZ},
+#endif
+#ifdef _SC_DCACHE_SZ
+ {"SC_DCACHE_SZ", _SC_DCACHE_SZ},
+#endif
+#ifdef _SC_DCACHE_TBLKSZ
+ {"SC_DCACHE_TBLKSZ", _SC_DCACHE_TBLKSZ},
+#endif
+#ifdef _SC_DELAYTIMER_MAX
+ {"SC_DELAYTIMER_MAX", _SC_DELAYTIMER_MAX},
+#endif
+#ifdef _SC_EQUIV_CLASS_MAX
+ {"SC_EQUIV_CLASS_MAX", _SC_EQUIV_CLASS_MAX},
+#endif
+#ifdef _SC_EXPR_NEST_MAX
+ {"SC_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX},
+#endif
+#ifdef _SC_FSYNC
+ {"SC_FSYNC", _SC_FSYNC},
+#endif
+#ifdef _SC_GETGR_R_SIZE_MAX
+ {"SC_GETGR_R_SIZE_MAX", _SC_GETGR_R_SIZE_MAX},
+#endif
+#ifdef _SC_GETPW_R_SIZE_MAX
+ {"SC_GETPW_R_SIZE_MAX", _SC_GETPW_R_SIZE_MAX},
+#endif
+#ifdef _SC_ICACHE_ASSOC
+ {"SC_ICACHE_ASSOC", _SC_ICACHE_ASSOC},
+#endif
+#ifdef _SC_ICACHE_BLKSZ
+ {"SC_ICACHE_BLKSZ", _SC_ICACHE_BLKSZ},
+#endif
+#ifdef _SC_ICACHE_LINESZ
+ {"SC_ICACHE_LINESZ", _SC_ICACHE_LINESZ},
+#endif
+#ifdef _SC_ICACHE_SZ
+ {"SC_ICACHE_SZ", _SC_ICACHE_SZ},
+#endif
+#ifdef _SC_INF
+ {"SC_INF", _SC_INF},
+#endif
+#ifdef _SC_INT_MAX
+ {"SC_INT_MAX", _SC_INT_MAX},
+#endif
+#ifdef _SC_INT_MIN
+ {"SC_INT_MIN", _SC_INT_MIN},
+#endif
+#ifdef _SC_IOV_MAX
+ {"SC_IOV_MAX", _SC_IOV_MAX},
+#endif
+#ifdef _SC_IP_SECOPTS
+ {"SC_IP_SECOPTS", _SC_IP_SECOPTS},
+#endif
+#ifdef _SC_JOB_CONTROL
+ {"SC_JOB_CONTROL", _SC_JOB_CONTROL},
+#endif
+#ifdef _SC_KERN_POINTERS
+ {"SC_KERN_POINTERS", _SC_KERN_POINTERS},
+#endif
+#ifdef _SC_KERN_SIM
+ {"SC_KERN_SIM", _SC_KERN_SIM},
+#endif
+#ifdef _SC_LINE_MAX
+ {"SC_LINE_MAX", _SC_LINE_MAX},
+#endif
+#ifdef _SC_LOGIN_NAME_MAX
+ {"SC_LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX},
+#endif
+#ifdef _SC_LOGNAME_MAX
+ {"SC_LOGNAME_MAX", _SC_LOGNAME_MAX},
+#endif
+#ifdef _SC_LONG_BIT
+ {"SC_LONG_BIT", _SC_LONG_BIT},
+#endif
+#ifdef _SC_MAC
+ {"SC_MAC", _SC_MAC},
+#endif
+#ifdef _SC_MAPPED_FILES
+ {"SC_MAPPED_FILES", _SC_MAPPED_FILES},
+#endif
+#ifdef _SC_MAXPID
+ {"SC_MAXPID", _SC_MAXPID},
+#endif
+#ifdef _SC_MB_LEN_MAX
+ {"SC_MB_LEN_MAX", _SC_MB_LEN_MAX},
+#endif
+#ifdef _SC_MEMLOCK
+ {"SC_MEMLOCK", _SC_MEMLOCK},
+#endif
+#ifdef _SC_MEMLOCK_RANGE
+ {"SC_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE},
+#endif
+#ifdef _SC_MEMORY_PROTECTION
+ {"SC_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION},
+#endif
+#ifdef _SC_MESSAGE_PASSING
+ {"SC_MESSAGE_PASSING", _SC_MESSAGE_PASSING},
+#endif
+#ifdef _SC_MMAP_FIXED_ALIGNMENT
+ {"SC_MMAP_FIXED_ALIGNMENT", _SC_MMAP_FIXED_ALIGNMENT},
+#endif
+#ifdef _SC_MQ_OPEN_MAX
+ {"SC_MQ_OPEN_MAX", _SC_MQ_OPEN_MAX},
+#endif
+#ifdef _SC_MQ_PRIO_MAX
+ {"SC_MQ_PRIO_MAX", _SC_MQ_PRIO_MAX},
+#endif
+#ifdef _SC_NACLS_MAX
+ {"SC_NACLS_MAX", _SC_NACLS_MAX},
+#endif
+#ifdef _SC_NGROUPS_MAX
+ {"SC_NGROUPS_MAX", _SC_NGROUPS_MAX},
+#endif
+#ifdef _SC_NL_ARGMAX
+ {"SC_NL_ARGMAX", _SC_NL_ARGMAX},
+#endif
+#ifdef _SC_NL_LANGMAX
+ {"SC_NL_LANGMAX", _SC_NL_LANGMAX},
+#endif
+#ifdef _SC_NL_MSGMAX
+ {"SC_NL_MSGMAX", _SC_NL_MSGMAX},
+#endif
+#ifdef _SC_NL_NMAX
+ {"SC_NL_NMAX", _SC_NL_NMAX},
+#endif
+#ifdef _SC_NL_SETMAX
+ {"SC_NL_SETMAX", _SC_NL_SETMAX},
+#endif
+#ifdef _SC_NL_TEXTMAX
+ {"SC_NL_TEXTMAX", _SC_NL_TEXTMAX},
+#endif
+#ifdef _SC_NPROCESSORS_CONF
+ {"SC_NPROCESSORS_CONF", _SC_NPROCESSORS_CONF},
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+ {"SC_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN},
+#endif
+#ifdef _SC_NPROC_CONF
+ {"SC_NPROC_CONF", _SC_NPROC_CONF},
+#endif
+#ifdef _SC_NPROC_ONLN
+ {"SC_NPROC_ONLN", _SC_NPROC_ONLN},
+#endif
+#ifdef _SC_NZERO
+ {"SC_NZERO", _SC_NZERO},
+#endif
+#ifdef _SC_OPEN_MAX
+ {"SC_OPEN_MAX", _SC_OPEN_MAX},
+#endif
+#ifdef _SC_PAGESIZE
+ {"SC_PAGESIZE", _SC_PAGESIZE},
+#endif
+#ifdef _SC_PAGE_SIZE
+ {"SC_PAGE_SIZE", _SC_PAGE_SIZE},
+#endif
+#ifdef _SC_AIX_REALMEM
+ {"SC_AIX_REALMEM", _SC_AIX_REALMEM},
+#endif
+#ifdef _SC_PASS_MAX
+ {"SC_PASS_MAX", _SC_PASS_MAX},
+#endif
+#ifdef _SC_PHYS_PAGES
+ {"SC_PHYS_PAGES", _SC_PHYS_PAGES},
+#endif
+#ifdef _SC_PII
+ {"SC_PII", _SC_PII},
+#endif
+#ifdef _SC_PII_INTERNET
+ {"SC_PII_INTERNET", _SC_PII_INTERNET},
+#endif
+#ifdef _SC_PII_INTERNET_DGRAM
+ {"SC_PII_INTERNET_DGRAM", _SC_PII_INTERNET_DGRAM},
+#endif
+#ifdef _SC_PII_INTERNET_STREAM
+ {"SC_PII_INTERNET_STREAM", _SC_PII_INTERNET_STREAM},
+#endif
+#ifdef _SC_PII_OSI
+ {"SC_PII_OSI", _SC_PII_OSI},
+#endif
+#ifdef _SC_PII_OSI_CLTS
+ {"SC_PII_OSI_CLTS", _SC_PII_OSI_CLTS},
+#endif
+#ifdef _SC_PII_OSI_COTS
+ {"SC_PII_OSI_COTS", _SC_PII_OSI_COTS},
+#endif
+#ifdef _SC_PII_OSI_M
+ {"SC_PII_OSI_M", _SC_PII_OSI_M},
+#endif
+#ifdef _SC_PII_SOCKET
+ {"SC_PII_SOCKET", _SC_PII_SOCKET},
+#endif
+#ifdef _SC_PII_XTI
+ {"SC_PII_XTI", _SC_PII_XTI},
+#endif
+#ifdef _SC_POLL
+ {"SC_POLL", _SC_POLL},
+#endif
+#ifdef _SC_PRIORITIZED_IO
+ {"SC_PRIORITIZED_IO", _SC_PRIORITIZED_IO},
+#endif
+#ifdef _SC_PRIORITY_SCHEDULING
+ {"SC_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING},
+#endif
+#ifdef _SC_REALTIME_SIGNALS
+ {"SC_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS},
+#endif
+#ifdef _SC_RE_DUP_MAX
+ {"SC_RE_DUP_MAX", _SC_RE_DUP_MAX},
+#endif
+#ifdef _SC_RTSIG_MAX
+ {"SC_RTSIG_MAX", _SC_RTSIG_MAX},
+#endif
+#ifdef _SC_SAVED_IDS
+ {"SC_SAVED_IDS", _SC_SAVED_IDS},
+#endif
+#ifdef _SC_SCHAR_MAX
+ {"SC_SCHAR_MAX", _SC_SCHAR_MAX},
+#endif
+#ifdef _SC_SCHAR_MIN
+ {"SC_SCHAR_MIN", _SC_SCHAR_MIN},
+#endif
+#ifdef _SC_SELECT
+ {"SC_SELECT", _SC_SELECT},
+#endif
+#ifdef _SC_SEMAPHORES
+ {"SC_SEMAPHORES", _SC_SEMAPHORES},
+#endif
+#ifdef _SC_SEM_NSEMS_MAX
+ {"SC_SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX},
+#endif
+#ifdef _SC_SEM_VALUE_MAX
+ {"SC_SEM_VALUE_MAX", _SC_SEM_VALUE_MAX},
+#endif
+#ifdef _SC_SHARED_MEMORY_OBJECTS
+ {"SC_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS},
+#endif
+#ifdef _SC_SHRT_MAX
+ {"SC_SHRT_MAX", _SC_SHRT_MAX},
+#endif
+#ifdef _SC_SHRT_MIN
+ {"SC_SHRT_MIN", _SC_SHRT_MIN},
+#endif
+#ifdef _SC_SIGQUEUE_MAX
+ {"SC_SIGQUEUE_MAX", _SC_SIGQUEUE_MAX},
+#endif
+#ifdef _SC_SIGRT_MAX
+ {"SC_SIGRT_MAX", _SC_SIGRT_MAX},
+#endif
+#ifdef _SC_SIGRT_MIN
+ {"SC_SIGRT_MIN", _SC_SIGRT_MIN},
+#endif
+#ifdef _SC_SOFTPOWER
+ {"SC_SOFTPOWER", _SC_SOFTPOWER},
+#endif
+#ifdef _SC_SPLIT_CACHE
+ {"SC_SPLIT_CACHE", _SC_SPLIT_CACHE},
+#endif
+#ifdef _SC_SSIZE_MAX
+ {"SC_SSIZE_MAX", _SC_SSIZE_MAX},
+#endif
+#ifdef _SC_STACK_PROT
+ {"SC_STACK_PROT", _SC_STACK_PROT},
+#endif
+#ifdef _SC_STREAM_MAX
+ {"SC_STREAM_MAX", _SC_STREAM_MAX},
+#endif
+#ifdef _SC_SYNCHRONIZED_IO
+ {"SC_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO},
+#endif
+#ifdef _SC_THREADS
+ {"SC_THREADS", _SC_THREADS},
+#endif
+#ifdef _SC_THREAD_ATTR_STACKADDR
+ {"SC_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR},
+#endif
+#ifdef _SC_THREAD_ATTR_STACKSIZE
+ {"SC_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE},
+#endif
+#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
+ {"SC_THREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS},
+#endif
+#ifdef _SC_THREAD_KEYS_MAX
+ {"SC_THREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX},
+#endif
+#ifdef _SC_THREAD_PRIORITY_SCHEDULING
+ {"SC_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING},
+#endif
+#ifdef _SC_THREAD_PRIO_INHERIT
+ {"SC_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT},
+#endif
+#ifdef _SC_THREAD_PRIO_PROTECT
+ {"SC_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT},
+#endif
+#ifdef _SC_THREAD_PROCESS_SHARED
+ {"SC_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED},
+#endif
+#ifdef _SC_THREAD_SAFE_FUNCTIONS
+ {"SC_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS},
+#endif
+#ifdef _SC_THREAD_STACK_MIN
+ {"SC_THREAD_STACK_MIN", _SC_THREAD_STACK_MIN},
+#endif
+#ifdef _SC_THREAD_THREADS_MAX
+ {"SC_THREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX},
+#endif
+#ifdef _SC_TIMERS
+ {"SC_TIMERS", _SC_TIMERS},
+#endif
+#ifdef _SC_TIMER_MAX
+ {"SC_TIMER_MAX", _SC_TIMER_MAX},
+#endif
+#ifdef _SC_TTY_NAME_MAX
+ {"SC_TTY_NAME_MAX", _SC_TTY_NAME_MAX},
+#endif
+#ifdef _SC_TZNAME_MAX
+ {"SC_TZNAME_MAX", _SC_TZNAME_MAX},
+#endif
+#ifdef _SC_T_IOV_MAX
+ {"SC_T_IOV_MAX", _SC_T_IOV_MAX},
+#endif
+#ifdef _SC_UCHAR_MAX
+ {"SC_UCHAR_MAX", _SC_UCHAR_MAX},
+#endif
+#ifdef _SC_UINT_MAX
+ {"SC_UINT_MAX", _SC_UINT_MAX},
+#endif
+#ifdef _SC_UIO_MAXIOV
+ {"SC_UIO_MAXIOV", _SC_UIO_MAXIOV},
+#endif
+#ifdef _SC_ULONG_MAX
+ {"SC_ULONG_MAX", _SC_ULONG_MAX},
+#endif
+#ifdef _SC_USHRT_MAX
+ {"SC_USHRT_MAX", _SC_USHRT_MAX},
+#endif
+#ifdef _SC_VERSION
+ {"SC_VERSION", _SC_VERSION},
+#endif
+#ifdef _SC_WORD_BIT
+ {"SC_WORD_BIT", _SC_WORD_BIT},
+#endif
+#ifdef _SC_XBS5_ILP32_OFF32
+ {"SC_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32},
+#endif
+#ifdef _SC_XBS5_ILP32_OFFBIG
+ {"SC_XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG},
+#endif
+#ifdef _SC_XBS5_LP64_OFF64
+ {"SC_XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64},
+#endif
+#ifdef _SC_XBS5_LPBIG_OFFBIG
+ {"SC_XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG},
+#endif
+#ifdef _SC_XOPEN_CRYPT
+ {"SC_XOPEN_CRYPT", _SC_XOPEN_CRYPT},
+#endif
+#ifdef _SC_XOPEN_ENH_I18N
+ {"SC_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N},
+#endif
+#ifdef _SC_XOPEN_LEGACY
+ {"SC_XOPEN_LEGACY", _SC_XOPEN_LEGACY},
+#endif
+#ifdef _SC_XOPEN_REALTIME
+ {"SC_XOPEN_REALTIME", _SC_XOPEN_REALTIME},
+#endif
+#ifdef _SC_XOPEN_REALTIME_THREADS
+ {"SC_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS},
+#endif
+#ifdef _SC_XOPEN_SHM
+ {"SC_XOPEN_SHM", _SC_XOPEN_SHM},
+#endif
+#ifdef _SC_XOPEN_UNIX
+ {"SC_XOPEN_UNIX", _SC_XOPEN_UNIX},
+#endif
+#ifdef _SC_XOPEN_VERSION
+ {"SC_XOPEN_VERSION", _SC_XOPEN_VERSION},
+#endif
+#ifdef _SC_XOPEN_XCU_VERSION
+ {"SC_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION},
+#endif
+#ifdef _SC_XOPEN_XPG2
+ {"SC_XOPEN_XPG2", _SC_XOPEN_XPG2},
+#endif
+#ifdef _SC_XOPEN_XPG3
+ {"SC_XOPEN_XPG3", _SC_XOPEN_XPG3},
+#endif
+#ifdef _SC_XOPEN_XPG4
+ {"SC_XOPEN_XPG4", _SC_XOPEN_XPG4},
+#endif
+#ifdef _SC_MINSIGSTKSZ
+ {"SC_MINSIGSTKSZ", _SC_MINSIGSTKSZ},
+#endif
+};
+
+static int
+conv_sysconf_confname(PyObject *arg, int *valuep)
+{
+ return conv_confname(arg, valuep, posix_constants_sysconf,
+ sizeof(posix_constants_sysconf)
+ / sizeof(struct constdef));
+}
+
+
+/*[clinic input]
+os.sysconf -> long
+ name: sysconf_confname
+ /
+
+Return an integer-valued system configuration variable.
+[clinic start generated code]*/
+
+static long
+os_sysconf_impl(PyObject *module, int name)
+/*[clinic end generated code: output=3662f945fc0cc756 input=279e3430a33f29e4]*/
+{
+ long value;
+
+ errno = 0;
+ value = sysconf(name);
+ if (value == -1 && errno != 0)
+ posix_error();
+ return value;
+}
+#endif /* HAVE_SYSCONF */
+
+
+/* This code is used to ensure that the tables of configuration value names
+ * are in sorted order as required by conv_confname(), and also to build
+ * the exported dictionaries that are used to publish information about the
+ * names available on the host platform.
+ *
+ * Sorting the table at runtime ensures that the table is properly ordered
+ * when used, even for platforms we're not able to test on. It also makes
+ * it easier to add additional entries to the tables.
+ */
+
+static int
+cmp_constdefs(const void *v1, const void *v2)
+{
+ const struct constdef *c1 =
+ (const struct constdef *) v1;
+ const struct constdef *c2 =
+ (const struct constdef *) v2;
+
+ return strcmp(c1->name, c2->name);
+}
+
+static int
+setup_confname_table(struct constdef *table, size_t tablesize,
+ const char *tablename, PyObject *module)
+{
+ PyObject *d = NULL;
+ size_t i;
+
+ qsort(table, tablesize, sizeof(struct constdef), cmp_constdefs);
+ d = PyDict_New();
+ if (d == NULL)
+ return -1;
+
+ for (i=0; i < tablesize; ++i) {
+ PyObject *o = PyLong_FromLong(table[i].value);
+ if (o == NULL || PyDict_SetItemString(d, table[i].name, o) == -1) {
+ Py_XDECREF(o);
+ Py_DECREF(d);
+ return -1;
+ }
+ Py_DECREF(o);
+ }
+ return _PyModule_Add(module, tablename, d);
+}
+
+/* Return -1 on failure, 0 on success. */
+static int
+setup_confname_tables(PyObject *module)
+{
+#if defined(HAVE_FPATHCONF) || defined(HAVE_PATHCONF)
+ if (setup_confname_table(posix_constants_pathconf,
+ sizeof(posix_constants_pathconf)
+ / sizeof(struct constdef),
+ "pathconf_names", module))
+ return -1;
+#endif
+#ifdef HAVE_CONFSTR
+ if (setup_confname_table(posix_constants_confstr,
+ sizeof(posix_constants_confstr)
+ / sizeof(struct constdef),
+ "confstr_names", module))
+ return -1;
+#endif
+#ifdef HAVE_SYSCONF
+ if (setup_confname_table(posix_constants_sysconf,
+ sizeof(posix_constants_sysconf)
+ / sizeof(struct constdef),
+ "sysconf_names", module))
+ return -1;
+#endif
+ return 0;
+}
+
+
+/*[clinic input]
+os.abort
+
+Abort the interpreter immediately.
+
+This function 'dumps core' or otherwise fails in the hardest way possible
+on the hosting operating system. This function never returns.
+[clinic start generated code]*/
+
+static PyObject *
+os_abort_impl(PyObject *module)
+/*[clinic end generated code: output=dcf52586dad2467c input=cf2c7d98bc504047]*/
+{
+ abort();
+ /*NOTREACHED*/
+#ifndef __clang__
+ /* Issue #28152: abort() is declared with __attribute__((__noreturn__)).
+ GCC emits a warning without "return NULL;" (compiler bug?), but Clang
+ is smarter and emits a warning on the return. */
+ Py_FatalError("abort() called from Python code didn't abort!");
+ return NULL;
+#endif
+}
+
+#ifdef MS_WINDOWS
+/* Grab ShellExecute dynamically from shell32 */
+static int has_ShellExecute = -1;
+static HINSTANCE (CALLBACK *Py_ShellExecuteW)(HWND, LPCWSTR, LPCWSTR, LPCWSTR,
+ LPCWSTR, INT);
+static int
+check_ShellExecute(void)
+{
+ HINSTANCE hShell32;
+
+ /* only recheck */
+ if (-1 == has_ShellExecute) {
+ Py_BEGIN_ALLOW_THREADS
+ /* Security note: this call is not vulnerable to "DLL hijacking".
+ SHELL32 is part of "KnownDLLs" and so Windows always load
+ the system SHELL32.DLL, even if there is another SHELL32.DLL
+ in the DLL search path. */
+ hShell32 = LoadLibraryW(L"SHELL32");
+ if (hShell32) {
+ *(FARPROC*)&Py_ShellExecuteW = GetProcAddress(hShell32,
+ "ShellExecuteW");
+ has_ShellExecute = Py_ShellExecuteW != NULL;
+ } else {
+ has_ShellExecute = 0;
+ }
+ Py_END_ALLOW_THREADS
+ }
+ return has_ShellExecute;
+}
+
+
+/*[clinic input]
+os.startfile
+ filepath: path_t
+ operation: Py_UNICODE = NULL
+ arguments: Py_UNICODE = NULL
+ cwd: path_t(nullable=True) = None
+ show_cmd: int = 1
+
+Start a file with its associated application.
+
+When "operation" is not specified or "open", this acts like
+double-clicking the file in Explorer, or giving the file name as an
+argument to the DOS "start" command: the file is opened with whatever
+application (if any) its extension is associated.
+When another "operation" is given, it specifies what should be done with
+the file. A typical operation is "print".
+
+"arguments" is passed to the application, but should be omitted if the
+file is a document.
+
+"cwd" is the working directory for the operation. If "filepath" is
+relative, it will be resolved against this directory. This argument
+should usually be an absolute path.
+
+"show_cmd" can be used to override the recommended visibility option.
+See the Windows ShellExecute documentation for values.
+
+startfile returns as soon as the associated application is launched.
+There is no option to wait for the application to close, and no way
+to retrieve the application's exit status.
+
+The filepath is relative to the current directory. If you want to use
+an absolute path, make sure the first character is not a slash ("/");
+the underlying Win32 ShellExecute function doesn't work if it is.
+[clinic start generated code]*/
+
+static PyObject *
+os_startfile_impl(PyObject *module, path_t *filepath,
+ const Py_UNICODE *operation, const Py_UNICODE *arguments,
+ path_t *cwd, int show_cmd)
+/*[clinic end generated code: output=3baa4f9795841880 input=8248997b80669622]*/
+{
+ HINSTANCE rc;
+
+ if(!check_ShellExecute()) {
+ /* If the OS doesn't have ShellExecute, return a
+ NotImplementedError. */
+ return PyErr_Format(PyExc_NotImplementedError,
+ "startfile not available on this platform");
+ }
+
+ if (PySys_Audit("os.startfile", "Ou", filepath->object, operation) < 0) {
+ return NULL;
+ }
+ if (PySys_Audit("os.startfile/2", "OuuOi", filepath->object, operation,
+ arguments, cwd->object ? cwd->object : Py_None,
+ show_cmd) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = Py_ShellExecuteW((HWND)0, operation, filepath->wide,
+ arguments, cwd->wide, show_cmd);
+ Py_END_ALLOW_THREADS
+
+ if (rc <= (HINSTANCE)32) {
+ win32_error_object("startfile", filepath->object);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif /* MS_WINDOWS */
+
+
+#ifdef HAVE_GETLOADAVG
+/*[clinic input]
+os.getloadavg
+
+Return average recent system load information.
+
+Return the number of processes in the system run queue averaged over
+the last 1, 5, and 15 minutes as a tuple of three floats.
+Raises OSError if the load average was unobtainable.
+[clinic start generated code]*/
+
+static PyObject *
+os_getloadavg_impl(PyObject *module)
+/*[clinic end generated code: output=9ad3a11bfb4f4bd2 input=3d6d826b76d8a34e]*/
+{
+ double loadavg[3];
+ if (getloadavg(loadavg, 3)!=3) {
+ PyErr_SetString(PyExc_OSError, "Load averages are unobtainable");
+ return NULL;
+ } else
+ return Py_BuildValue("ddd", loadavg[0], loadavg[1], loadavg[2]);
+}
+#endif /* HAVE_GETLOADAVG */
+
+
+/*[clinic input]
+os.device_encoding
+ fd: int
+
+Return a string describing the encoding of a terminal's file descriptor.
+
+The file descriptor must be attached to a terminal.
+If the device is not a terminal, return None.
+[clinic start generated code]*/
+
+static PyObject *
+os_device_encoding_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=e0d294bbab7e8c2b input=9e1d4a42b66df312]*/
+{
+ return _Py_device_encoding(fd);
+}
+
+
+#ifdef HAVE_SETRESUID
+/*[clinic input]
+os.setresuid
+
+ ruid: uid_t
+ euid: uid_t
+ suid: uid_t
+ /
+
+Set the current process's real, effective, and saved user ids.
+[clinic start generated code]*/
+
+static PyObject *
+os_setresuid_impl(PyObject *module, uid_t ruid, uid_t euid, uid_t suid)
+/*[clinic end generated code: output=834a641e15373e97 input=9e33cb79a82792f3]*/
+{
+ if (setresuid(ruid, euid, suid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETRESUID */
+
+
+#ifdef HAVE_SETRESGID
+/*[clinic input]
+os.setresgid
+
+ rgid: gid_t
+ egid: gid_t
+ sgid: gid_t
+ /
+
+Set the current process's real, effective, and saved group ids.
+[clinic start generated code]*/
+
+static PyObject *
+os_setresgid_impl(PyObject *module, gid_t rgid, gid_t egid, gid_t sgid)
+/*[clinic end generated code: output=6aa402f3d2e514a9 input=33e9e0785ef426b1]*/
+{
+ if (setresgid(rgid, egid, sgid) < 0)
+ return posix_error();
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_SETRESGID */
+
+
+#ifdef HAVE_GETRESUID
+/*[clinic input]
+os.getresuid
+
+Return a tuple of the current process's real, effective, and saved user ids.
+[clinic start generated code]*/
+
+static PyObject *
+os_getresuid_impl(PyObject *module)
+/*[clinic end generated code: output=8e0becff5dece5bf input=41ccfa8e1f6517ad]*/
+{
+ uid_t ruid, euid, suid;
+ if (getresuid(&ruid, &euid, &suid) < 0)
+ return posix_error();
+ return Py_BuildValue("(NNN)", _PyLong_FromUid(ruid),
+ _PyLong_FromUid(euid),
+ _PyLong_FromUid(suid));
+}
+#endif /* HAVE_GETRESUID */
+
+
+#ifdef HAVE_GETRESGID
+/*[clinic input]
+os.getresgid
+
+Return a tuple of the current process's real, effective, and saved group ids.
+[clinic start generated code]*/
+
+static PyObject *
+os_getresgid_impl(PyObject *module)
+/*[clinic end generated code: output=2719c4bfcf27fb9f input=517e68db9ca32df6]*/
+{
+ gid_t rgid, egid, sgid;
+ if (getresgid(&rgid, &egid, &sgid) < 0)
+ return posix_error();
+ return Py_BuildValue("(NNN)", _PyLong_FromGid(rgid),
+ _PyLong_FromGid(egid),
+ _PyLong_FromGid(sgid));
+}
+#endif /* HAVE_GETRESGID */
+
+
+#ifdef USE_XATTRS
+/*[clinic input]
+os.getxattr
+
+ path: path_t(allow_fd=True)
+ attribute: path_t
+ *
+ follow_symlinks: bool = True
+
+Return the value of extended attribute attribute on path.
+
+path may be either a string, a path-like object, or an open file descriptor.
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, getxattr will examine the symbolic link itself instead of the file
+ the link points to.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_getxattr_impl(PyObject *module, path_t *path, path_t *attribute,
+ int follow_symlinks)
+/*[clinic end generated code: output=5f2f44200a43cff2 input=025789491708f7eb]*/
+{
+ Py_ssize_t i;
+ PyObject *buffer = NULL;
+
+ if (fd_and_follow_symlinks_invalid("getxattr", path->fd, follow_symlinks))
+ return NULL;
+
+ if (PySys_Audit("os.getxattr", "OO", path->object, attribute->object) < 0) {
+ return NULL;
+ }
+
+ for (i = 0; ; i++) {
+ void *ptr;
+ ssize_t result;
+ static const Py_ssize_t buffer_sizes[] = {128, XATTR_SIZE_MAX, 0};
+ Py_ssize_t buffer_size = buffer_sizes[i];
+ if (!buffer_size) {
+ path_error(path);
+ return NULL;
+ }
+ buffer = PyBytes_FromStringAndSize(NULL, buffer_size);
+ if (!buffer)
+ return NULL;
+ ptr = PyBytes_AS_STRING(buffer);
+
+ Py_BEGIN_ALLOW_THREADS;
+ if (path->fd >= 0)
+ result = fgetxattr(path->fd, attribute->narrow, ptr, buffer_size);
+ else if (follow_symlinks)
+ result = getxattr(path->narrow, attribute->narrow, ptr, buffer_size);
+ else
+ result = lgetxattr(path->narrow, attribute->narrow, ptr, buffer_size);
+ Py_END_ALLOW_THREADS;
+
+ if (result < 0) {
+ if (errno == ERANGE) {
+ Py_DECREF(buffer);
+ continue;
+ }
+ path_error(path);
+ Py_DECREF(buffer);
+ return NULL;
+ }
+
+ if (result != buffer_size) {
+ /* Can only shrink. */
+ _PyBytes_Resize(&buffer, result);
+ }
+ break;
+ }
+
+ return buffer;
+}
+
+
+/*[clinic input]
+os.setxattr
+
+ path: path_t(allow_fd=True)
+ attribute: path_t
+ value: Py_buffer
+ flags: int = 0
+ *
+ follow_symlinks: bool = True
+
+Set extended attribute attribute on path to value.
+
+path may be either a string, a path-like object, or an open file descriptor.
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, setxattr will modify the symbolic link itself instead of the file
+ the link points to.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_setxattr_impl(PyObject *module, path_t *path, path_t *attribute,
+ Py_buffer *value, int flags, int follow_symlinks)
+/*[clinic end generated code: output=98b83f63fdde26bb input=c17c0103009042f0]*/
+{
+ ssize_t result;
+
+ if (fd_and_follow_symlinks_invalid("setxattr", path->fd, follow_symlinks))
+ return NULL;
+
+ if (PySys_Audit("os.setxattr", "OOy#i", path->object, attribute->object,
+ value->buf, value->len, flags) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS;
+ if (path->fd > -1)
+ result = fsetxattr(path->fd, attribute->narrow,
+ value->buf, value->len, flags);
+ else if (follow_symlinks)
+ result = setxattr(path->narrow, attribute->narrow,
+ value->buf, value->len, flags);
+ else
+ result = lsetxattr(path->narrow, attribute->narrow,
+ value->buf, value->len, flags);
+ Py_END_ALLOW_THREADS;
+
+ if (result) {
+ path_error(path);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+os.removexattr
+
+ path: path_t(allow_fd=True)
+ attribute: path_t
+ *
+ follow_symlinks: bool = True
+
+Remove extended attribute attribute on path.
+
+path may be either a string, a path-like object, or an open file descriptor.
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, removexattr will modify the symbolic link itself instead of the file
+ the link points to.
+
+[clinic start generated code]*/
+
+static PyObject *
+os_removexattr_impl(PyObject *module, path_t *path, path_t *attribute,
+ int follow_symlinks)
+/*[clinic end generated code: output=521a51817980cda6 input=3d9a7d36fe2f7c4e]*/
+{
+ ssize_t result;
+
+ if (fd_and_follow_symlinks_invalid("removexattr", path->fd, follow_symlinks))
+ return NULL;
+
+ if (PySys_Audit("os.removexattr", "OO", path->object, attribute->object) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS;
+ if (path->fd > -1)
+ result = fremovexattr(path->fd, attribute->narrow);
+ else if (follow_symlinks)
+ result = removexattr(path->narrow, attribute->narrow);
+ else
+ result = lremovexattr(path->narrow, attribute->narrow);
+ Py_END_ALLOW_THREADS;
+
+ if (result) {
+ return path_error(path);
+ }
+
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+os.listxattr
+
+ path: path_t(allow_fd=True, nullable=True) = None
+ *
+ follow_symlinks: bool = True
+
+Return a list of extended attributes on path.
+
+path may be either None, a string, a path-like object, or an open file descriptor.
+if path is None, listxattr will examine the current directory.
+If follow_symlinks is False, and the last element of the path is a symbolic
+ link, listxattr will examine the symbolic link itself instead of the file
+ the link points to.
+[clinic start generated code]*/
+
+static PyObject *
+os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks)
+/*[clinic end generated code: output=bebdb4e2ad0ce435 input=9826edf9fdb90869]*/
+{
+ Py_ssize_t i;
+ PyObject *result = NULL;
+ const char *name;
+ char *buffer = NULL;
+
+ if (fd_and_follow_symlinks_invalid("listxattr", path->fd, follow_symlinks))
+ goto exit;
+
+ if (PySys_Audit("os.listxattr", "(O)",
+ path->object ? path->object : Py_None) < 0) {
+ return NULL;
+ }
+
+ name = path->narrow ? path->narrow : ".";
+
+ for (i = 0; ; i++) {
+ const char *start, *trace, *end;
+ ssize_t length;
+ static const Py_ssize_t buffer_sizes[] = { 256, XATTR_LIST_MAX, 0 };
+ Py_ssize_t buffer_size = buffer_sizes[i];
+ if (!buffer_size) {
+ /* ERANGE */
+ path_error(path);
+ break;
+ }
+ buffer = PyMem_Malloc(buffer_size);
+ if (!buffer) {
+ PyErr_NoMemory();
+ break;
+ }
+
+ Py_BEGIN_ALLOW_THREADS;
+ if (path->fd > -1)
+ length = flistxattr(path->fd, buffer, buffer_size);
+ else if (follow_symlinks)
+ length = listxattr(name, buffer, buffer_size);
+ else
+ length = llistxattr(name, buffer, buffer_size);
+ Py_END_ALLOW_THREADS;
+
+ if (length < 0) {
+ if (errno == ERANGE) {
+ PyMem_Free(buffer);
+ buffer = NULL;
+ continue;
+ }
+ path_error(path);
+ break;
+ }
+
+ result = PyList_New(0);
+ if (!result) {
+ goto exit;
+ }
+
+ end = buffer + length;
+ for (trace = start = buffer; trace != end; trace++) {
+ if (!*trace) {
+ int error;
+ PyObject *attribute = PyUnicode_DecodeFSDefaultAndSize(start,
+ trace - start);
+ if (!attribute) {
+ Py_SETREF(result, NULL);
+ goto exit;
+ }
+ error = PyList_Append(result, attribute);
+ Py_DECREF(attribute);
+ if (error) {
+ Py_SETREF(result, NULL);
+ goto exit;
+ }
+ start = trace + 1;
+ }
+ }
+ break;
+ }
+exit:
+ if (buffer)
+ PyMem_Free(buffer);
+ return result;
+}
+#endif /* USE_XATTRS */
+
+
+/*[clinic input]
+os.urandom
+
+ size: Py_ssize_t
+ /
+
+Return a bytes object containing random bytes suitable for cryptographic use.
+[clinic start generated code]*/
+
+static PyObject *
+os_urandom_impl(PyObject *module, Py_ssize_t size)
+/*[clinic end generated code: output=42c5cca9d18068e9 input=4067cdb1b6776c29]*/
+{
+ PyObject *bytes;
+ int result;
+
+ if (size < 0)
+ return PyErr_Format(PyExc_ValueError,
+ "negative argument not allowed");
+ bytes = PyBytes_FromStringAndSize(NULL, size);
+ if (bytes == NULL)
+ return NULL;
+
+ result = _PyOS_URandom(PyBytes_AS_STRING(bytes), PyBytes_GET_SIZE(bytes));
+ if (result == -1) {
+ Py_DECREF(bytes);
+ return NULL;
+ }
+ return bytes;
+}
+
+#ifdef HAVE_MEMFD_CREATE
+/*[clinic input]
+os.memfd_create
+
+ name: FSConverter
+ flags: unsigned_int(bitwise=True, c_default="MFD_CLOEXEC") = MFD_CLOEXEC
+
+[clinic start generated code]*/
+
+static PyObject *
+os_memfd_create_impl(PyObject *module, PyObject *name, unsigned int flags)
+/*[clinic end generated code: output=6681ede983bdb9a6 input=a42cfc199bcd56e9]*/
+{
+ int fd;
+ const char *bytes = PyBytes_AS_STRING(name);
+ Py_BEGIN_ALLOW_THREADS
+ fd = memfd_create(bytes, flags);
+ Py_END_ALLOW_THREADS
+ if (fd == -1) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ return PyLong_FromLong(fd);
+}
+#endif
+
+#if defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)
+/*[clinic input]
+os.eventfd
+
+ initval: unsigned_int
+ flags: int(c_default="EFD_CLOEXEC") = EFD_CLOEXEC
+
+Creates and returns an event notification file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+os_eventfd_impl(PyObject *module, unsigned int initval, int flags)
+/*[clinic end generated code: output=ce9c9bbd1446f2de input=66203e3c50c4028b]*/
+
+{
+ /* initval is limited to uint32_t, internal counter is uint64_t */
+ int fd;
+ Py_BEGIN_ALLOW_THREADS
+ fd = eventfd(initval, flags);
+ Py_END_ALLOW_THREADS
+ if (fd == -1) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ return PyLong_FromLong(fd);
+}
+
+/*[clinic input]
+os.eventfd_read
+
+ fd: fildes
+
+Read eventfd value
+[clinic start generated code]*/
+
+static PyObject *
+os_eventfd_read_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=8f2c7b59a3521fd1 input=110f8b57fa596afe]*/
+{
+ eventfd_t value;
+ int result;
+ Py_BEGIN_ALLOW_THREADS
+ result = eventfd_read(fd, &value);
+ Py_END_ALLOW_THREADS
+ if (result == -1) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ return PyLong_FromUnsignedLongLong(value);
+}
+
+/*[clinic input]
+os.eventfd_write
+
+ fd: fildes
+ value: unsigned_long_long
+
+Write eventfd value.
+[clinic start generated code]*/
+
+static PyObject *
+os_eventfd_write_impl(PyObject *module, int fd, unsigned long long value)
+/*[clinic end generated code: output=bebd9040bbf987f5 input=156de8555be5a949]*/
+{
+ int result;
+ Py_BEGIN_ALLOW_THREADS
+ result = eventfd_write(fd, value);
+ Py_END_ALLOW_THREADS
+ if (result == -1) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ Py_RETURN_NONE;
+}
+#endif /* HAVE_EVENTFD && EFD_CLOEXEC */
+
+/* Terminal size querying */
+
+PyDoc_STRVAR(TerminalSize_docstring,
+ "A tuple of (columns, lines) for holding terminal window size");
+
+static PyStructSequence_Field TerminalSize_fields[] = {
+ {"columns", "width of the terminal window in characters"},
+ {"lines", "height of the terminal window in characters"},
+ {NULL, NULL}
+};
+
+static PyStructSequence_Desc TerminalSize_desc = {
+ "os.terminal_size",
+ TerminalSize_docstring,
+ TerminalSize_fields,
+ 2,
+};
+
+#if defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL)
+/*[clinic input]
+os.get_terminal_size
+
+ fd: int(c_default="fileno(stdout)", py_default="<unrepresentable>") = -1
+ /
+
+Return the size of the terminal window as (columns, lines).
+
+The optional argument fd (default standard output) specifies
+which file descriptor should be queried.
+
+If the file descriptor is not connected to a terminal, an OSError
+is thrown.
+
+This function will only be defined if an implementation is
+available for this system.
+
+shutil.get_terminal_size is the high-level function which should
+normally be used, os.get_terminal_size is the low-level implementation.
+[clinic start generated code]*/
+
+static PyObject *
+os_get_terminal_size_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=fbab93acef980508 input=ead5679b82ddb920]*/
+{
+ int columns, lines;
+ PyObject *termsize;
+
+ /* Under some conditions stdout may not be connected and
+ * fileno(stdout) may point to an invalid file descriptor. For example
+ * GUI apps don't have valid standard streams by default.
+ *
+ * If this happens, and the optional fd argument is not present,
+ * the ioctl below will fail returning EBADF. This is what we want.
+ */
+
+#ifdef TERMSIZE_USE_IOCTL
+ {
+ struct winsize w;
+ if (ioctl(fd, TIOCGWINSZ, &w))
+ return PyErr_SetFromErrno(PyExc_OSError);
+ columns = w.ws_col;
+ lines = w.ws_row;
+ }
+#endif /* TERMSIZE_USE_IOCTL */
+
+#ifdef TERMSIZE_USE_CONIO
+ {
+ HANDLE handle;
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ handle = _Py_get_osfhandle(fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ if (!GetConsoleScreenBufferInfo(handle, &csbi))
+ return PyErr_SetFromWindowsErr(0);
+
+ columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
+ lines = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
+ }
+#endif /* TERMSIZE_USE_CONIO */
+
+ PyObject *TerminalSizeType = get_posix_state(module)->TerminalSizeType;
+ termsize = PyStructSequence_New((PyTypeObject *)TerminalSizeType);
+ if (termsize == NULL)
+ return NULL;
+ PyStructSequence_SET_ITEM(termsize, 0, PyLong_FromLong(columns));
+ PyStructSequence_SET_ITEM(termsize, 1, PyLong_FromLong(lines));
+ if (PyErr_Occurred()) {
+ Py_DECREF(termsize);
+ return NULL;
+ }
+ return termsize;
+}
+#endif /* defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL) */
+
+
+/*[clinic input]
+os.cpu_count
+
+Return the number of CPUs in the system; return None if indeterminable.
+
+This number is not equivalent to the number of CPUs the current process can
+use. The number of usable CPUs can be obtained with
+``len(os.sched_getaffinity(0))``
+[clinic start generated code]*/
+
+static PyObject *
+os_cpu_count_impl(PyObject *module)
+/*[clinic end generated code: output=5fc29463c3936a9c input=e7c8f4ba6dbbadd3]*/
+{
+ int ncpu = 0;
+#ifdef MS_WINDOWS
+#ifdef MS_WINDOWS_DESKTOP
+ ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
+#endif
+#elif defined(__hpux)
+ ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL);
+#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
+ ncpu = sysconf(_SC_NPROCESSORS_ONLN);
+#elif defined(__VXWORKS__)
+ ncpu = _Py_popcount32(vxCpuEnabledGet());
+#elif defined(__DragonFly__) || \
+ defined(__OpenBSD__) || \
+ defined(__FreeBSD__) || \
+ defined(__NetBSD__) || \
+ defined(__APPLE__)
+ int mib[2];
+ size_t len = sizeof(ncpu);
+ mib[0] = CTL_HW;
+ mib[1] = HW_NCPU;
+ if (sysctl(mib, 2, &ncpu, &len, NULL, 0) != 0)
+ ncpu = 0;
+#endif
+ if (ncpu >= 1)
+ return PyLong_FromLong(ncpu);
+ else
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+os.get_inheritable -> bool
+
+ fd: int
+ /
+
+Get the close-on-exe flag of the specified file descriptor.
+[clinic start generated code]*/
+
+static int
+os_get_inheritable_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=0445e20e149aa5b8 input=89ac008dc9ab6b95]*/
+{
+ int return_value;
+ _Py_BEGIN_SUPPRESS_IPH
+ return_value = _Py_get_inheritable(fd);
+ _Py_END_SUPPRESS_IPH
+ return return_value;
+}
+
+
+/*[clinic input]
+os.set_inheritable
+ fd: int
+ inheritable: int
+ /
+
+Set the inheritable flag of the specified file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+os_set_inheritable_impl(PyObject *module, int fd, int inheritable)
+/*[clinic end generated code: output=f1b1918a2f3c38c2 input=9ceaead87a1e2402]*/
+{
+ int result;
+
+ _Py_BEGIN_SUPPRESS_IPH
+ result = _Py_set_inheritable(fd, inheritable, NULL);
+ _Py_END_SUPPRESS_IPH
+ if (result < 0)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+
+#ifdef MS_WINDOWS
+#ifndef HANDLE_FLAG_INHERIT
+#define HANDLE_FLAG_INHERIT 0x00000001
+#endif
+
+/*[clinic input]
+os.get_handle_inheritable -> bool
+ handle: intptr_t
+ /
+
+Get the close-on-exe flag of the specified file descriptor.
+[clinic start generated code]*/
+
+static int
+os_get_handle_inheritable_impl(PyObject *module, intptr_t handle)
+/*[clinic end generated code: output=36be5afca6ea84d8 input=cfe99f9c05c70ad1]*/
+{
+ DWORD flags;
+
+ if (!GetHandleInformation((HANDLE)handle, &flags)) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+
+ return flags & HANDLE_FLAG_INHERIT;
+}
+
+
+/*[clinic input]
+os.set_handle_inheritable
+ handle: intptr_t
+ inheritable: bool
+ /
+
+Set the inheritable flag of the specified handle.
+[clinic start generated code]*/
+
+static PyObject *
+os_set_handle_inheritable_impl(PyObject *module, intptr_t handle,
+ int inheritable)
+/*[clinic end generated code: output=021d74fe6c96baa3 input=7a7641390d8364fc]*/
+{
+ DWORD flags = inheritable ? HANDLE_FLAG_INHERIT : 0;
+ if (!SetHandleInformation((HANDLE)handle, HANDLE_FLAG_INHERIT, flags)) {
+ PyErr_SetFromWindowsErr(0);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif /* MS_WINDOWS */
+
+/*[clinic input]
+os.get_blocking -> bool
+ fd: int
+ /
+
+Get the blocking mode of the file descriptor.
+
+Return False if the O_NONBLOCK flag is set, True if the flag is cleared.
+[clinic start generated code]*/
+
+static int
+os_get_blocking_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=336a12ad76a61482 input=f4afb59d51560179]*/
+{
+ int blocking;
+
+ _Py_BEGIN_SUPPRESS_IPH
+ blocking = _Py_get_blocking(fd);
+ _Py_END_SUPPRESS_IPH
+ return blocking;
+}
+
+/*[clinic input]
+os.set_blocking
+ fd: int
+ blocking: bool
+ /
+
+Set the blocking mode of the specified file descriptor.
+
+Set the O_NONBLOCK flag if blocking is False,
+clear the O_NONBLOCK flag otherwise.
+[clinic start generated code]*/
+
+static PyObject *
+os_set_blocking_impl(PyObject *module, int fd, int blocking)
+/*[clinic end generated code: output=384eb43aa0762a9d input=7e9dfc9b14804dd4]*/
+{
+ int result;
+
+ _Py_BEGIN_SUPPRESS_IPH
+ result = _Py_set_blocking(fd, blocking);
+ _Py_END_SUPPRESS_IPH
+ if (result < 0)
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+class os.DirEntry "DirEntry *" "DirEntryType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3c18c7a448247980]*/
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *name;
+ PyObject *path;
+ PyObject *stat;
+ PyObject *lstat;
+#ifdef MS_WINDOWS
+ struct _Py_stat_struct win32_lstat;
+ uint64_t win32_file_index;
+ uint64_t win32_file_index_high;
+ int got_file_index;
+#else /* POSIX */
+#ifdef HAVE_DIRENT_D_TYPE
+ unsigned char d_type;
+#endif
+ ino_t d_ino;
+ int dir_fd;
+#endif
+} DirEntry;
+
+static void
+DirEntry_dealloc(DirEntry *entry)
+{
+ PyTypeObject *tp = Py_TYPE(entry);
+ Py_XDECREF(entry->name);
+ Py_XDECREF(entry->path);
+ Py_XDECREF(entry->stat);
+ Py_XDECREF(entry->lstat);
+ freefunc free_func = PyType_GetSlot(tp, Py_tp_free);
+ free_func(entry);
+ Py_DECREF(tp);
+}
+
+/* Forward reference */
+static int
+DirEntry_test_mode(PyTypeObject *defining_class, DirEntry *self,
+ int follow_symlinks, unsigned short mode_bits);
+
+/*[clinic input]
+os.DirEntry.is_symlink -> bool
+ defining_class: defining_class
+ /
+
+Return True if the entry is a symbolic link; cached per entry.
+[clinic start generated code]*/
+
+static int
+os_DirEntry_is_symlink_impl(DirEntry *self, PyTypeObject *defining_class)
+/*[clinic end generated code: output=293096d589b6d47c input=e9acc5ee4d511113]*/
+{
+#ifdef MS_WINDOWS
+ return (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;
+#elif defined(HAVE_DIRENT_D_TYPE)
+ /* POSIX */
+ if (self->d_type != DT_UNKNOWN)
+ return self->d_type == DT_LNK;
+ else
+ return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
+#else
+ /* POSIX without d_type */
+ return DirEntry_test_mode(defining_class, self, 0, S_IFLNK);
+#endif
+}
+
+/*[clinic input]
+os.DirEntry.is_junction -> bool
+ defining_class: defining_class
+ /
+
+Return True if the entry is a junction; cached per entry.
+[clinic start generated code]*/
+
+static int
+os_DirEntry_is_junction_impl(DirEntry *self, PyTypeObject *defining_class)
+/*[clinic end generated code: output=7061a07b0ef2cd1f input=475cd36fb7d4723f]*/
+{
+#ifdef MS_WINDOWS
+ return self->win32_lstat.st_reparse_tag == IO_REPARSE_TAG_MOUNT_POINT;
+#else
+ return 0;
+#endif
+}
+
+static PyObject *
+DirEntry_fetch_stat(PyObject *module, DirEntry *self, int follow_symlinks)
+{
+ int result;
+ STRUCT_STAT st;
+ PyObject *ub;
+
+#ifdef MS_WINDOWS
+ if (!PyUnicode_FSDecoder(self->path, &ub))
+ return NULL;
+ wchar_t *path = PyUnicode_AsWideCharString(ub, NULL);
+ Py_DECREF(ub);
+#else /* POSIX */
+ if (!PyUnicode_FSConverter(self->path, &ub))
+ return NULL;
+ const char *path = PyBytes_AS_STRING(ub);
+ if (self->dir_fd != DEFAULT_DIR_FD) {
+#ifdef HAVE_FSTATAT
+ if (HAVE_FSTATAT_RUNTIME) {
+ Py_BEGIN_ALLOW_THREADS
+ result = fstatat(self->dir_fd, path, &st,
+ follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW);
+ Py_END_ALLOW_THREADS
+ } else
+
+#endif /* HAVE_FSTATAT */
+ {
+ Py_DECREF(ub);
+ PyErr_SetString(PyExc_NotImplementedError, "can't fetch stat");
+ return NULL;
+ }
+ }
+ else
+#endif
+ {
+ Py_BEGIN_ALLOW_THREADS
+ if (follow_symlinks) {
+ result = STAT(path, &st);
+ }
+ else {
+ result = LSTAT(path, &st);
+ }
+ Py_END_ALLOW_THREADS
+ }
+
+ int saved_errno = errno;
+#if defined(MS_WINDOWS)
+ PyMem_Free(path);
+#else
+ Py_DECREF(ub);
+#endif
+
+ if (result != 0) {
+ errno = saved_errno;
+ path_object_error(self->path);
+ return NULL;
+ }
+
+ return _pystat_fromstructstat(module, &st);
+}
+
+static PyObject *
+DirEntry_get_lstat(PyTypeObject *defining_class, DirEntry *self)
+{
+ if (!self->lstat) {
+ PyObject *module = PyType_GetModule(defining_class);
+#ifdef MS_WINDOWS
+ self->lstat = _pystat_fromstructstat(module, &self->win32_lstat);
+#else /* POSIX */
+ self->lstat = DirEntry_fetch_stat(module, self, 0);
+#endif
+ }
+ return Py_XNewRef(self->lstat);
+}
+
+/*[clinic input]
+os.DirEntry.stat
+ defining_class: defining_class
+ /
+ *
+ follow_symlinks: bool = True
+
+Return stat_result object for the entry; cached per entry.
+[clinic start generated code]*/
+
+static PyObject *
+os_DirEntry_stat_impl(DirEntry *self, PyTypeObject *defining_class,
+ int follow_symlinks)
+/*[clinic end generated code: output=23f803e19c3e780e input=e816273c4e67ee98]*/
+{
+ if (!follow_symlinks) {
+ return DirEntry_get_lstat(defining_class, self);
+ }
+
+ if (!self->stat) {
+ int result = os_DirEntry_is_symlink_impl(self, defining_class);
+ if (result == -1) {
+ return NULL;
+ }
+ if (result) {
+ PyObject *module = PyType_GetModule(defining_class);
+ self->stat = DirEntry_fetch_stat(module, self, 1);
+ }
+ else {
+ self->stat = DirEntry_get_lstat(defining_class, self);
+ }
+ }
+
+ return Py_XNewRef(self->stat);
+}
+
+/* Set exception and return -1 on error, 0 for False, 1 for True */
+static int
+DirEntry_test_mode(PyTypeObject *defining_class, DirEntry *self,
+ int follow_symlinks, unsigned short mode_bits)
+{
+ PyObject *stat = NULL;
+ PyObject *st_mode = NULL;
+ long mode;
+ int result;
+#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
+ int is_symlink;
+ int need_stat;
+#endif
+#ifdef MS_WINDOWS
+ unsigned long dir_bits;
+#endif
+
+#ifdef MS_WINDOWS
+ is_symlink = (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;
+ need_stat = follow_symlinks && is_symlink;
+#elif defined(HAVE_DIRENT_D_TYPE)
+ is_symlink = self->d_type == DT_LNK;
+ need_stat = self->d_type == DT_UNKNOWN || (follow_symlinks && is_symlink);
+#endif
+
+#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
+ if (need_stat) {
+#endif
+ stat = os_DirEntry_stat_impl(self, defining_class, follow_symlinks);
+ if (!stat) {
+ if (PyErr_ExceptionMatches(PyExc_FileNotFoundError)) {
+ /* If file doesn't exist (anymore), then return False
+ (i.e., say it's not a file/directory) */
+ PyErr_Clear();
+ return 0;
+ }
+ goto error;
+ }
+ _posixstate* state = get_posix_state(PyType_GetModule(defining_class));
+ st_mode = PyObject_GetAttr(stat, state->st_mode);
+ if (!st_mode)
+ goto error;
+
+ mode = PyLong_AsLong(st_mode);
+ if (mode == -1 && PyErr_Occurred())
+ goto error;
+ Py_CLEAR(st_mode);
+ Py_CLEAR(stat);
+ result = (mode & S_IFMT) == mode_bits;
+#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
+ }
+ else if (is_symlink) {
+ assert(mode_bits != S_IFLNK);
+ result = 0;
+ }
+ else {
+ assert(mode_bits == S_IFDIR || mode_bits == S_IFREG);
+#ifdef MS_WINDOWS
+ dir_bits = self->win32_lstat.st_file_attributes & FILE_ATTRIBUTE_DIRECTORY;
+ if (mode_bits == S_IFDIR)
+ result = dir_bits != 0;
+ else
+ result = dir_bits == 0;
+#else /* POSIX */
+ if (mode_bits == S_IFDIR)
+ result = self->d_type == DT_DIR;
+ else
+ result = self->d_type == DT_REG;
+#endif
+ }
+#endif
+
+ return result;
+
+error:
+ Py_XDECREF(st_mode);
+ Py_XDECREF(stat);
+ return -1;
+}
+
+/*[clinic input]
+os.DirEntry.is_dir -> bool
+ defining_class: defining_class
+ /
+ *
+ follow_symlinks: bool = True
+
+Return True if the entry is a directory; cached per entry.
+[clinic start generated code]*/
+
+static int
+os_DirEntry_is_dir_impl(DirEntry *self, PyTypeObject *defining_class,
+ int follow_symlinks)
+/*[clinic end generated code: output=0cd453b9c0987fdf input=1a4ffd6dec9920cb]*/
+{
+ return DirEntry_test_mode(defining_class, self, follow_symlinks, S_IFDIR);
+}
+
+/*[clinic input]
+os.DirEntry.is_file -> bool
+ defining_class: defining_class
+ /
+ *
+ follow_symlinks: bool = True
+
+Return True if the entry is a file; cached per entry.
+[clinic start generated code]*/
+
+static int
+os_DirEntry_is_file_impl(DirEntry *self, PyTypeObject *defining_class,
+ int follow_symlinks)
+/*[clinic end generated code: output=f7c277ab5ba80908 input=0a64c5a12e802e3b]*/
+{
+ return DirEntry_test_mode(defining_class, self, follow_symlinks, S_IFREG);
+}
+
+/*[clinic input]
+os.DirEntry.inode
+
+Return inode of the entry; cached per entry.
+[clinic start generated code]*/
+
+static PyObject *
+os_DirEntry_inode_impl(DirEntry *self)
+/*[clinic end generated code: output=156bb3a72162440e input=3ee7b872ae8649f0]*/
+{
+#ifdef MS_WINDOWS
+ if (!self->got_file_index) {
+ PyObject *unicode;
+ STRUCT_STAT stat;
+ int result;
+
+ if (!PyUnicode_FSDecoder(self->path, &unicode))
+ return NULL;
+ wchar_t *path = PyUnicode_AsWideCharString(unicode, NULL);
+ Py_DECREF(unicode);
+ result = LSTAT(path, &stat);
+
+ int saved_errno = errno;
+ PyMem_Free(path);
+
+ if (result != 0) {
+ errno = saved_errno;
+ return path_object_error(self->path);
+ }
+
+ self->win32_file_index = stat.st_ino;
+ self->win32_file_index_high = stat.st_ino_high;
+ self->got_file_index = 1;
+ }
+ return _pystat_l128_from_l64_l64(self->win32_file_index, self->win32_file_index_high);
+#else /* POSIX */
+ static_assert(sizeof(unsigned long long) >= sizeof(self->d_ino),
+ "DirEntry.d_ino is larger than unsigned long long");
+ return PyLong_FromUnsignedLongLong(self->d_ino);
+#endif
+}
+
+static PyObject *
+DirEntry_repr(DirEntry *self)
+{
+ return PyUnicode_FromFormat("<DirEntry %R>", self->name);
+}
+
+/*[clinic input]
+os.DirEntry.__fspath__
+
+Returns the path for the entry.
+[clinic start generated code]*/
+
+static PyObject *
+os_DirEntry___fspath___impl(DirEntry *self)
+/*[clinic end generated code: output=6dd7f7ef752e6f4f input=3c49d0cf38df4fac]*/
+{
+ return Py_NewRef(self->path);
+}
+
+static PyMemberDef DirEntry_members[] = {
+ {"name", T_OBJECT_EX, offsetof(DirEntry, name), READONLY,
+ "the entry's base filename, relative to scandir() \"path\" argument"},
+ {"path", T_OBJECT_EX, offsetof(DirEntry, path), READONLY,
+ "the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)"},
+ {NULL}
+};
+
+#include "clinic/posixmodule.c.h"
+
+static PyMethodDef DirEntry_methods[] = {
+ OS_DIRENTRY_IS_DIR_METHODDEF
+ OS_DIRENTRY_IS_FILE_METHODDEF
+ OS_DIRENTRY_IS_SYMLINK_METHODDEF
+ OS_DIRENTRY_IS_JUNCTION_METHODDEF
+ OS_DIRENTRY_STAT_METHODDEF
+ OS_DIRENTRY_INODE_METHODDEF
+ OS_DIRENTRY___FSPATH___METHODDEF
+ {"__class_getitem__", Py_GenericAlias,
+ METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
+ {NULL}
+};
+
+static PyType_Slot DirEntryType_slots[] = {
+ {Py_tp_dealloc, DirEntry_dealloc},
+ {Py_tp_repr, DirEntry_repr},
+ {Py_tp_methods, DirEntry_methods},
+ {Py_tp_members, DirEntry_members},
+ {0, 0},
+};
+
+static PyType_Spec DirEntryType_spec = {
+ MODNAME ".DirEntry",
+ sizeof(DirEntry),
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ DirEntryType_slots
+};
+
+
+#ifdef MS_WINDOWS
+
+static wchar_t *
+join_path_filenameW(const wchar_t *path_wide, const wchar_t *filename)
+{
+ Py_ssize_t path_len;
+ Py_ssize_t size;
+ wchar_t *result;
+ wchar_t ch;
+
+ if (!path_wide) { /* Default arg: "." */
+ path_wide = L".";
+ path_len = 1;
+ }
+ else {
+ path_len = wcslen(path_wide);
+ }
+
+ /* The +1's are for the path separator and the NUL */
+ size = path_len + 1 + wcslen(filename) + 1;
+ result = PyMem_New(wchar_t, size);
+ if (!result) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ wcscpy(result, path_wide);
+ if (path_len > 0) {
+ ch = result[path_len - 1];
+ if (ch != SEP && ch != ALTSEP && ch != L':')
+ result[path_len++] = SEP;
+ wcscpy(result + path_len, filename);
+ }
+ return result;
+}
+
+static PyObject *
+DirEntry_from_find_data(PyObject *module, path_t *path, WIN32_FIND_DATAW *dataW)
+{
+ DirEntry *entry;
+ BY_HANDLE_FILE_INFORMATION file_info;
+ ULONG reparse_tag;
+ wchar_t *joined_path;
+
+ PyObject *DirEntryType = get_posix_state(module)->DirEntryType;
+ entry = PyObject_New(DirEntry, (PyTypeObject *)DirEntryType);
+ if (!entry)
+ return NULL;
+ entry->name = NULL;
+ entry->path = NULL;
+ entry->stat = NULL;
+ entry->lstat = NULL;
+ entry->got_file_index = 0;
+
+ entry->name = PyUnicode_FromWideChar(dataW->cFileName, -1);
+ if (!entry->name)
+ goto error;
+ if (path->narrow) {
+ Py_SETREF(entry->name, PyUnicode_EncodeFSDefault(entry->name));
+ if (!entry->name)
+ goto error;
+ }
+
+ joined_path = join_path_filenameW(path->wide, dataW->cFileName);
+ if (!joined_path)
+ goto error;
+
+ entry->path = PyUnicode_FromWideChar(joined_path, -1);
+ PyMem_Free(joined_path);
+ if (!entry->path)
+ goto error;
+ if (path->narrow) {
+ Py_SETREF(entry->path, PyUnicode_EncodeFSDefault(entry->path));
+ if (!entry->path)
+ goto error;
+ }
+
+ find_data_to_file_info(dataW, &file_info, &reparse_tag);
+ _Py_attribute_data_to_stat(&file_info, reparse_tag, NULL, NULL, &entry->win32_lstat);
+
+ return (PyObject *)entry;
+
+error:
+ Py_DECREF(entry);
+ return NULL;
+}
+
+#else /* POSIX */
+
+static char *
+join_path_filename(const char *path_narrow, const char* filename, Py_ssize_t filename_len)
+{
+ Py_ssize_t path_len;
+ Py_ssize_t size;
+ char *result;
+
+ if (!path_narrow) { /* Default arg: "." */
+ path_narrow = ".";
+ path_len = 1;
+ }
+ else {
+ path_len = strlen(path_narrow);
+ }
+
+ if (filename_len == -1)
+ filename_len = strlen(filename);
+
+ /* The +1's are for the path separator and the NUL */
+ size = path_len + 1 + filename_len + 1;
+ result = PyMem_New(char, size);
+ if (!result) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ strcpy(result, path_narrow);
+ if (path_len > 0 && result[path_len - 1] != '/')
+ result[path_len++] = '/';
+ strcpy(result + path_len, filename);
+ return result;
+}
+
+static PyObject *
+DirEntry_from_posix_info(PyObject *module, path_t *path, const char *name,
+ Py_ssize_t name_len, ino_t d_ino
+#ifdef HAVE_DIRENT_D_TYPE
+ , unsigned char d_type
+#endif
+ )
+{
+ DirEntry *entry;
+ char *joined_path;
+
+ PyObject *DirEntryType = get_posix_state(module)->DirEntryType;
+ entry = PyObject_New(DirEntry, (PyTypeObject *)DirEntryType);
+ if (!entry)
+ return NULL;
+ entry->name = NULL;
+ entry->path = NULL;
+ entry->stat = NULL;
+ entry->lstat = NULL;
+
+ if (path->fd != -1) {
+ entry->dir_fd = path->fd;
+ joined_path = NULL;
+ }
+ else {
+ entry->dir_fd = DEFAULT_DIR_FD;
+ joined_path = join_path_filename(path->narrow, name, name_len);
+ if (!joined_path)
+ goto error;
+ }
+
+ if (!path->narrow || !PyBytes_Check(path->object)) {
+ entry->name = PyUnicode_DecodeFSDefaultAndSize(name, name_len);
+ if (joined_path)
+ entry->path = PyUnicode_DecodeFSDefault(joined_path);
+ }
+ else {
+ entry->name = PyBytes_FromStringAndSize(name, name_len);
+ if (joined_path)
+ entry->path = PyBytes_FromString(joined_path);
+ }
+ PyMem_Free(joined_path);
+ if (!entry->name)
+ goto error;
+
+ if (path->fd != -1) {
+ entry->path = Py_NewRef(entry->name);
+ }
+ else if (!entry->path)
+ goto error;
+
+#ifdef HAVE_DIRENT_D_TYPE
+ entry->d_type = d_type;
+#endif
+ entry->d_ino = d_ino;
+
+ return (PyObject *)entry;
+
+error:
+ Py_XDECREF(entry);
+ return NULL;
+}
+
+#endif
+
+
+typedef struct {
+ PyObject_HEAD
+ path_t path;
+#ifdef MS_WINDOWS
+ HANDLE handle;
+ WIN32_FIND_DATAW file_data;
+ int first_time;
+#else /* POSIX */
+ DIR *dirp;
+#endif
+#ifdef HAVE_FDOPENDIR
+ int fd;
+#endif
+} ScandirIterator;
+
+#ifdef MS_WINDOWS
+
+static int
+ScandirIterator_is_closed(ScandirIterator *iterator)
+{
+ return iterator->handle == INVALID_HANDLE_VALUE;
+}
+
+static void
+ScandirIterator_closedir(ScandirIterator *iterator)
+{
+ HANDLE handle = iterator->handle;
+
+ if (handle == INVALID_HANDLE_VALUE)
+ return;
+
+ iterator->handle = INVALID_HANDLE_VALUE;
+ Py_BEGIN_ALLOW_THREADS
+ FindClose(handle);
+ Py_END_ALLOW_THREADS
+}
+
+static PyObject *
+ScandirIterator_iternext(ScandirIterator *iterator)
+{
+ WIN32_FIND_DATAW *file_data = &iterator->file_data;
+ BOOL success;
+ PyObject *entry;
+
+ /* Happens if the iterator is iterated twice, or closed explicitly */
+ if (iterator->handle == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ while (1) {
+ if (!iterator->first_time) {
+ Py_BEGIN_ALLOW_THREADS
+ success = FindNextFileW(iterator->handle, file_data);
+ Py_END_ALLOW_THREADS
+ if (!success) {
+ /* Error or no more files */
+ if (GetLastError() != ERROR_NO_MORE_FILES)
+ path_error(&iterator->path);
+ break;
+ }
+ }
+ iterator->first_time = 0;
+
+ /* Skip over . and .. */
+ if (wcscmp(file_data->cFileName, L".") != 0 &&
+ wcscmp(file_data->cFileName, L"..") != 0)
+ {
+ PyObject *module = PyType_GetModule(Py_TYPE(iterator));
+ entry = DirEntry_from_find_data(module, &iterator->path, file_data);
+ if (!entry)
+ break;
+ return entry;
+ }
+
+ /* Loop till we get a non-dot directory or finish iterating */
+ }
+
+ /* Error or no more files */
+ ScandirIterator_closedir(iterator);
+ return NULL;
+}
+
+#else /* POSIX */
+
+static int
+ScandirIterator_is_closed(ScandirIterator *iterator)
+{
+ return !iterator->dirp;
+}
+
+static void
+ScandirIterator_closedir(ScandirIterator *iterator)
+{
+ DIR *dirp = iterator->dirp;
+
+ if (!dirp)
+ return;
+
+ iterator->dirp = NULL;
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_FDOPENDIR
+ if (iterator->path.fd != -1)
+ rewinddir(dirp);
+#endif
+ closedir(dirp);
+ Py_END_ALLOW_THREADS
+ return;
+}
+
+static PyObject *
+ScandirIterator_iternext(ScandirIterator *iterator)
+{
+ struct dirent *direntp;
+ Py_ssize_t name_len;
+ int is_dot;
+ PyObject *entry;
+
+ /* Happens if the iterator is iterated twice, or closed explicitly */
+ if (!iterator->dirp)
+ return NULL;
+
+ while (1) {
+ errno = 0;
+ Py_BEGIN_ALLOW_THREADS
+ direntp = readdir(iterator->dirp);
+ Py_END_ALLOW_THREADS
+
+ if (!direntp) {
+ /* Error or no more files */
+ if (errno != 0)
+ path_error(&iterator->path);
+ break;
+ }
+
+ /* Skip over . and .. */
+ name_len = NAMLEN(direntp);
+ is_dot = direntp->d_name[0] == '.' &&
+ (name_len == 1 || (direntp->d_name[1] == '.' && name_len == 2));
+ if (!is_dot) {
+ PyObject *module = PyType_GetModule(Py_TYPE(iterator));
+ entry = DirEntry_from_posix_info(module,
+ &iterator->path, direntp->d_name,
+ name_len, direntp->d_ino
+#ifdef HAVE_DIRENT_D_TYPE
+ , direntp->d_type
+#endif
+ );
+ if (!entry)
+ break;
+ return entry;
+ }
+
+ /* Loop till we get a non-dot directory or finish iterating */
+ }
+
+ /* Error or no more files */
+ ScandirIterator_closedir(iterator);
+ return NULL;
+}
+
+#endif
+
+static PyObject *
+ScandirIterator_close(ScandirIterator *self, PyObject *args)
+{
+ ScandirIterator_closedir(self);
+ Py_RETURN_NONE;
+}
+
+static PyObject *
+ScandirIterator_enter(PyObject *self, PyObject *args)
+{
+ return Py_NewRef(self);
+}
+
+static PyObject *
+ScandirIterator_exit(ScandirIterator *self, PyObject *args)
+{
+ ScandirIterator_closedir(self);
+ Py_RETURN_NONE;
+}
+
+static void
+ScandirIterator_finalize(ScandirIterator *iterator)
+{
+
+ /* Save the current exception, if any. */
+ PyObject *exc = PyErr_GetRaisedException();
+
+ if (!ScandirIterator_is_closed(iterator)) {
+ ScandirIterator_closedir(iterator);
+
+ if (PyErr_ResourceWarning((PyObject *)iterator, 1,
+ "unclosed scandir iterator %R", iterator)) {
+ /* Spurious errors can appear at shutdown */
+ if (PyErr_ExceptionMatches(PyExc_Warning)) {
+ PyErr_WriteUnraisable((PyObject *) iterator);
+ }
+ }
+ }
+
+ path_cleanup(&iterator->path);
+
+ /* Restore the saved exception. */
+ PyErr_SetRaisedException(exc);
+}
+
+static void
+ScandirIterator_dealloc(ScandirIterator *iterator)
+{
+ PyTypeObject *tp = Py_TYPE(iterator);
+ if (PyObject_CallFinalizerFromDealloc((PyObject *)iterator) < 0)
+ return;
+
+ freefunc free_func = PyType_GetSlot(tp, Py_tp_free);
+ free_func(iterator);
+ Py_DECREF(tp);
+}
+
+static PyMethodDef ScandirIterator_methods[] = {
+ {"__enter__", (PyCFunction)ScandirIterator_enter, METH_NOARGS},
+ {"__exit__", (PyCFunction)ScandirIterator_exit, METH_VARARGS},
+ {"close", (PyCFunction)ScandirIterator_close, METH_NOARGS},
+ {NULL}
+};
+
+static PyType_Slot ScandirIteratorType_slots[] = {
+ {Py_tp_dealloc, ScandirIterator_dealloc},
+ {Py_tp_finalize, ScandirIterator_finalize},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, ScandirIterator_iternext},
+ {Py_tp_methods, ScandirIterator_methods},
+ {0, 0},
+};
+
+static PyType_Spec ScandirIteratorType_spec = {
+ MODNAME ".ScandirIterator",
+ sizeof(ScandirIterator),
+ 0,
+ // bpo-40549: Py_TPFLAGS_BASETYPE should not be used, since
+ // PyType_GetModule(Py_TYPE(self)) doesn't work on a subclass instance.
+ (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_FINALIZE
+ | Py_TPFLAGS_DISALLOW_INSTANTIATION),
+ ScandirIteratorType_slots
+};
+
+/*[clinic input]
+os.scandir
+
+ path : path_t(nullable=True, allow_fd='PATH_HAVE_FDOPENDIR') = None
+
+Return an iterator of DirEntry objects for given path.
+
+path can be specified as either str, bytes, or a path-like object. If path
+is bytes, the names of yielded DirEntry objects will also be bytes; in
+all other circumstances they will be str.
+
+If path is None, uses the path='.'.
+[clinic start generated code]*/
+
+static PyObject *
+os_scandir_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=6eb2668b675ca89e input=6bdd312708fc3bb0]*/
+{
+ ScandirIterator *iterator;
+#ifdef MS_WINDOWS
+ wchar_t *path_strW;
+#else
+ const char *path_str;
+#ifdef HAVE_FDOPENDIR
+ int fd = -1;
+#endif
+#endif
+
+ if (PySys_Audit("os.scandir", "O",
+ path->object ? path->object : Py_None) < 0) {
+ return NULL;
+ }
+
+ PyObject *ScandirIteratorType = get_posix_state(module)->ScandirIteratorType;
+ iterator = PyObject_New(ScandirIterator, (PyTypeObject *)ScandirIteratorType);
+ if (!iterator)
+ return NULL;
+
+#ifdef MS_WINDOWS
+ iterator->handle = INVALID_HANDLE_VALUE;
+#else
+ iterator->dirp = NULL;
+#endif
+
+ /* Move the ownership to iterator->path */
+ memcpy(&iterator->path, path, sizeof(path_t));
+ memset(path, 0, sizeof(path_t));
+
+#ifdef MS_WINDOWS
+ iterator->first_time = 1;
+
+ path_strW = join_path_filenameW(iterator->path.wide, L"*.*");
+ if (!path_strW)
+ goto error;
+
+ Py_BEGIN_ALLOW_THREADS
+ iterator->handle = FindFirstFileW(path_strW, &iterator->file_data);
+ Py_END_ALLOW_THREADS
+
+ if (iterator->handle == INVALID_HANDLE_VALUE) {
+ path_error(&iterator->path);
+ PyMem_Free(path_strW);
+ goto error;
+ }
+ PyMem_Free(path_strW);
+#else /* POSIX */
+ errno = 0;
+#ifdef HAVE_FDOPENDIR
+ if (iterator->path.fd != -1) {
+ if (HAVE_FDOPENDIR_RUNTIME) {
+ /* closedir() closes the FD, so we duplicate it */
+ fd = _Py_dup(iterator->path.fd);
+ if (fd == -1)
+ goto error;
+
+ Py_BEGIN_ALLOW_THREADS
+ iterator->dirp = fdopendir(fd);
+ Py_END_ALLOW_THREADS
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "scandir: path should be string, bytes, os.PathLike or None, not int");
+ return NULL;
+ }
+ }
+ else
+#endif
+ {
+ if (iterator->path.narrow)
+ path_str = iterator->path.narrow;
+ else
+ path_str = ".";
+
+ Py_BEGIN_ALLOW_THREADS
+ iterator->dirp = opendir(path_str);
+ Py_END_ALLOW_THREADS
+ }
+
+ if (!iterator->dirp) {
+ path_error(&iterator->path);
+#ifdef HAVE_FDOPENDIR
+ if (fd != -1) {
+ Py_BEGIN_ALLOW_THREADS
+ close(fd);
+ Py_END_ALLOW_THREADS
+ }
+#endif
+ goto error;
+ }
+#endif
+
+ return (PyObject *)iterator;
+
+error:
+ Py_DECREF(iterator);
+ return NULL;
+}
+
+/*
+ Return the file system path representation of the object.
+
+ If the object is str or bytes, then allow it to pass through with
+ an incremented refcount. If the object defines __fspath__(), then
+ return the result of that method. All other types raise a TypeError.
+*/
+PyObject *
+PyOS_FSPath(PyObject *path)
+{
+ /* For error message reasons, this function is manually inlined in
+ path_converter(). */
+ PyObject *func = NULL;
+ PyObject *path_repr = NULL;
+
+ if (PyUnicode_Check(path) || PyBytes_Check(path)) {
+ return Py_NewRef(path);
+ }
+
+ func = _PyObject_LookupSpecial(path, &_Py_ID(__fspath__));
+ if (NULL == func) {
+ return PyErr_Format(PyExc_TypeError,
+ "expected str, bytes or os.PathLike object, "
+ "not %.200s",
+ _PyType_Name(Py_TYPE(path)));
+ }
+
+ path_repr = _PyObject_CallNoArgs(func);
+ Py_DECREF(func);
+ if (NULL == path_repr) {
+ return NULL;
+ }
+
+ if (!(PyUnicode_Check(path_repr) || PyBytes_Check(path_repr))) {
+ PyErr_Format(PyExc_TypeError,
+ "expected %.200s.__fspath__() to return str or bytes, "
+ "not %.200s", _PyType_Name(Py_TYPE(path)),
+ _PyType_Name(Py_TYPE(path_repr)));
+ Py_DECREF(path_repr);
+ return NULL;
+ }
+
+ return path_repr;
+}
+
+/*[clinic input]
+os.fspath
+
+ path: object
+
+Return the file system path representation of the object.
+
+If the object is str or bytes, then allow it to pass through as-is. If the
+object defines __fspath__(), then return the result of that method. All other
+types raise a TypeError.
+[clinic start generated code]*/
+
+static PyObject *
+os_fspath_impl(PyObject *module, PyObject *path)
+/*[clinic end generated code: output=c3c3b78ecff2914f input=e357165f7b22490f]*/
+{
+ return PyOS_FSPath(path);
+}
+
+#ifdef HAVE_GETRANDOM_SYSCALL
+/*[clinic input]
+os.getrandom
+
+ size: Py_ssize_t
+ flags: int=0
+
+Obtain a series of random bytes.
+[clinic start generated code]*/
+
+static PyObject *
+os_getrandom_impl(PyObject *module, Py_ssize_t size, int flags)
+/*[clinic end generated code: output=b3a618196a61409c input=59bafac39c594947]*/
+{
+ PyObject *bytes;
+ Py_ssize_t n;
+
+ if (size < 0) {
+ errno = EINVAL;
+ return posix_error();
+ }
+
+ bytes = PyBytes_FromStringAndSize(NULL, size);
+ if (bytes == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ while (1) {
+ n = syscall(SYS_getrandom,
+ PyBytes_AS_STRING(bytes),
+ PyBytes_GET_SIZE(bytes),
+ flags);
+ if (n < 0 && errno == EINTR) {
+ if (PyErr_CheckSignals() < 0) {
+ goto error;
+ }
+
+ /* getrandom() was interrupted by a signal: retry */
+ continue;
+ }
+ break;
+ }
+
+ if (n < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto error;
+ }
+
+ if (n != size) {
+ _PyBytes_Resize(&bytes, n);
+ }
+
+ return bytes;
+
+error:
+ Py_DECREF(bytes);
+ return NULL;
+}
+#endif /* HAVE_GETRANDOM_SYSCALL */
+
+#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
+
+/* bpo-36085: Helper functions for managing DLL search directories
+ * on win32
+ */
+
+/*[clinic input]
+os._add_dll_directory
+
+ path: path_t
+
+Add a path to the DLL search path.
+
+This search path is used when resolving dependencies for imported
+extension modules (the module itself is resolved through sys.path),
+and also by ctypes.
+
+Returns an opaque value that may be passed to os.remove_dll_directory
+to remove this directory from the search path.
+[clinic start generated code]*/
+
+static PyObject *
+os__add_dll_directory_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=80b025daebb5d683 input=1de3e6c13a5808c8]*/
+{
+ DLL_DIRECTORY_COOKIE cookie = 0;
+ DWORD err = 0;
+
+ if (PySys_Audit("os.add_dll_directory", "(O)", path->object) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ if (!(cookie = AddDllDirectory(path->wide))) {
+ err = GetLastError();
+ }
+ Py_END_ALLOW_THREADS
+
+ if (err) {
+ return win32_error_object_err("add_dll_directory",
+ path->object, err);
+ }
+
+ return PyCapsule_New(cookie, "DLL directory cookie", NULL);
+}
+
+/*[clinic input]
+os._remove_dll_directory
+
+ cookie: object
+
+Removes a path from the DLL search path.
+
+The parameter is an opaque value that was returned from
+os.add_dll_directory. You can only remove directories that you added
+yourself.
+[clinic start generated code]*/
+
+static PyObject *
+os__remove_dll_directory_impl(PyObject *module, PyObject *cookie)
+/*[clinic end generated code: output=594350433ae535bc input=c1d16a7e7d9dc5dc]*/
+{
+ DLL_DIRECTORY_COOKIE cookieValue;
+ DWORD err = 0;
+
+ if (!PyCapsule_IsValid(cookie, "DLL directory cookie")) {
+ PyErr_SetString(PyExc_TypeError,
+ "Provided cookie was not returned from os.add_dll_directory");
+ return NULL;
+ }
+
+ cookieValue = (DLL_DIRECTORY_COOKIE)PyCapsule_GetPointer(
+ cookie, "DLL directory cookie");
+
+ Py_BEGIN_ALLOW_THREADS
+ if (!RemoveDllDirectory(cookieValue)) {
+ err = GetLastError();
+ }
+ Py_END_ALLOW_THREADS
+
+ if (err) {
+ return win32_error_object_err("remove_dll_directory",
+ NULL, err);
+ }
+
+ if (PyCapsule_SetName(cookie, NULL)) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+#endif /* MS_WINDOWS_APP || MS_WINDOWS_SYSTEM */
+
+
+/* Only check if WIFEXITED is available: expect that it comes
+ with WEXITSTATUS, WIFSIGNALED, etc.
+
+ os.waitstatus_to_exitcode() is implemented in C and not in Python, so
+ subprocess can safely call it during late Python finalization without
+ risking that used os attributes were set to None by finalize_modules(). */
+#if defined(WIFEXITED) || defined(MS_WINDOWS)
+/*[clinic input]
+os.waitstatus_to_exitcode
+
+ status as status_obj: object
+
+Convert a wait status to an exit code.
+
+On Unix:
+
+* If WIFEXITED(status) is true, return WEXITSTATUS(status).
+* If WIFSIGNALED(status) is true, return -WTERMSIG(status).
+* Otherwise, raise a ValueError.
+
+On Windows, return status shifted right by 8 bits.
+
+On Unix, if the process is being traced or if waitpid() was called with
+WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true.
+This function must not be called if WIFSTOPPED(status) is true.
+[clinic start generated code]*/
+
+static PyObject *
+os_waitstatus_to_exitcode_impl(PyObject *module, PyObject *status_obj)
+/*[clinic end generated code: output=db50b1b0ba3c7153 input=7fe2d7fdaea3db42]*/
+{
+#ifndef MS_WINDOWS
+ int status = _PyLong_AsInt(status_obj);
+ if (status == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ WAIT_TYPE wait_status;
+ WAIT_STATUS_INT(wait_status) = status;
+ int exitcode;
+ if (WIFEXITED(wait_status)) {
+ exitcode = WEXITSTATUS(wait_status);
+ /* Sanity check to provide warranty on the function behavior.
+ It should not occur in practice */
+ if (exitcode < 0) {
+ PyErr_Format(PyExc_ValueError, "invalid WEXITSTATUS: %i", exitcode);
+ return NULL;
+ }
+ }
+ else if (WIFSIGNALED(wait_status)) {
+ int signum = WTERMSIG(wait_status);
+ /* Sanity check to provide warranty on the function behavior.
+ It should not occurs in practice */
+ if (signum <= 0) {
+ PyErr_Format(PyExc_ValueError, "invalid WTERMSIG: %i", signum);
+ return NULL;
+ }
+ exitcode = -signum;
+ } else if (WIFSTOPPED(wait_status)) {
+ /* Status only received if the process is being traced
+ or if waitpid() was called with WUNTRACED option. */
+ int signum = WSTOPSIG(wait_status);
+ PyErr_Format(PyExc_ValueError,
+ "process stopped by delivery of signal %i",
+ signum);
+ return NULL;
+ }
+ else {
+ PyErr_Format(PyExc_ValueError, "invalid wait status: %i", status);
+ return NULL;
+ }
+ return PyLong_FromLong(exitcode);
+#else
+ /* Windows implementation: see os.waitpid() implementation
+ which uses _cwait(). */
+ unsigned long long status = PyLong_AsUnsignedLongLong(status_obj);
+ if (status == (unsigned long long)-1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+ unsigned long long exitcode = (status >> 8);
+ /* ExitProcess() accepts an UINT type:
+ reject exit code which doesn't fit in an UINT */
+ if (exitcode > UINT_MAX) {
+ PyErr_Format(PyExc_ValueError, "invalid exit code: %llu", exitcode);
+ return NULL;
+ }
+ return PyLong_FromUnsignedLong((unsigned long)exitcode);
+#endif
+}
+#endif
+
+
+static PyMethodDef posix_methods[] = {
+
+ OS_STAT_METHODDEF
+ OS_ACCESS_METHODDEF
+ OS_TTYNAME_METHODDEF
+ OS_CHDIR_METHODDEF
+ OS_CHFLAGS_METHODDEF
+ OS_CHMOD_METHODDEF
+ OS_FCHMOD_METHODDEF
+ OS_LCHMOD_METHODDEF
+ OS_CHOWN_METHODDEF
+ OS_FCHOWN_METHODDEF
+ OS_LCHOWN_METHODDEF
+ OS_LCHFLAGS_METHODDEF
+ OS_CHROOT_METHODDEF
+ OS_CTERMID_METHODDEF
+ OS_GETCWD_METHODDEF
+ OS_GETCWDB_METHODDEF
+ OS_LINK_METHODDEF
+ OS_LISTDIR_METHODDEF
+ OS_LISTDRIVES_METHODDEF
+ OS_LISTMOUNTS_METHODDEF
+ OS_LISTVOLUMES_METHODDEF
+ OS_LSTAT_METHODDEF
+ OS_MKDIR_METHODDEF
+ OS_NICE_METHODDEF
+ OS_GETPRIORITY_METHODDEF
+ OS_SETPRIORITY_METHODDEF
+ OS_POSIX_SPAWN_METHODDEF
+ OS_POSIX_SPAWNP_METHODDEF
+ OS_READLINK_METHODDEF
+ OS_COPY_FILE_RANGE_METHODDEF
+ OS_SPLICE_METHODDEF
+ OS_RENAME_METHODDEF
+ OS_REPLACE_METHODDEF
+ OS_RMDIR_METHODDEF
+ OS_SYMLINK_METHODDEF
+ OS_SYSTEM_METHODDEF
+ OS_UMASK_METHODDEF
+ OS_UNAME_METHODDEF
+ OS_UNLINK_METHODDEF
+ OS_REMOVE_METHODDEF
+ OS_UTIME_METHODDEF
+ OS_TIMES_METHODDEF
+ OS__EXIT_METHODDEF
+ OS__FCOPYFILE_METHODDEF
+ OS_EXECV_METHODDEF
+ OS_EXECVE_METHODDEF
+ OS_SPAWNV_METHODDEF
+ OS_SPAWNVE_METHODDEF
+ OS_FORK1_METHODDEF
+ OS_FORK_METHODDEF
+ OS_REGISTER_AT_FORK_METHODDEF
+ OS_SCHED_GET_PRIORITY_MAX_METHODDEF
+ OS_SCHED_GET_PRIORITY_MIN_METHODDEF
+ OS_SCHED_GETPARAM_METHODDEF
+ OS_SCHED_GETSCHEDULER_METHODDEF
+ OS_SCHED_RR_GET_INTERVAL_METHODDEF
+ OS_SCHED_SETPARAM_METHODDEF
+ OS_SCHED_SETSCHEDULER_METHODDEF
+ OS_SCHED_YIELD_METHODDEF
+ OS_SCHED_SETAFFINITY_METHODDEF
+ OS_SCHED_GETAFFINITY_METHODDEF
+ OS_OPENPTY_METHODDEF
+ OS_LOGIN_TTY_METHODDEF
+ OS_FORKPTY_METHODDEF
+ OS_GETEGID_METHODDEF
+ OS_GETEUID_METHODDEF
+ OS_GETGID_METHODDEF
+ OS_GETGROUPLIST_METHODDEF
+ OS_GETGROUPS_METHODDEF
+ OS_GETPID_METHODDEF
+ OS_GETPGRP_METHODDEF
+ OS_GETPPID_METHODDEF
+ OS_GETUID_METHODDEF
+ OS_GETLOGIN_METHODDEF
+ OS_KILL_METHODDEF
+ OS_KILLPG_METHODDEF
+ OS_PLOCK_METHODDEF
+ OS_STARTFILE_METHODDEF
+ OS_SETUID_METHODDEF
+ OS_SETEUID_METHODDEF
+ OS_SETREUID_METHODDEF
+ OS_SETGID_METHODDEF
+ OS_SETEGID_METHODDEF
+ OS_SETREGID_METHODDEF
+ OS_SETGROUPS_METHODDEF
+ OS_INITGROUPS_METHODDEF
+ OS_GETPGID_METHODDEF
+ OS_SETPGRP_METHODDEF
+ OS_WAIT_METHODDEF
+ OS_WAIT3_METHODDEF
+ OS_WAIT4_METHODDEF
+ OS_WAITID_METHODDEF
+ OS_WAITPID_METHODDEF
+ OS_PIDFD_OPEN_METHODDEF
+ OS_GETSID_METHODDEF
+ OS_SETSID_METHODDEF
+ OS_SETPGID_METHODDEF
+ OS_TCGETPGRP_METHODDEF
+ OS_TCSETPGRP_METHODDEF
+ OS_OPEN_METHODDEF
+ OS_CLOSE_METHODDEF
+ OS_CLOSERANGE_METHODDEF
+ OS_DEVICE_ENCODING_METHODDEF
+ OS_DUP_METHODDEF
+ OS_DUP2_METHODDEF
+ OS_LOCKF_METHODDEF
+ OS_LSEEK_METHODDEF
+ OS_READ_METHODDEF
+ OS_READV_METHODDEF
+ OS_PREAD_METHODDEF
+ OS_PREADV_METHODDEF
+ OS_WRITE_METHODDEF
+ OS_WRITEV_METHODDEF
+ OS_PWRITE_METHODDEF
+ OS_PWRITEV_METHODDEF
+ OS_SENDFILE_METHODDEF
+ OS_FSTAT_METHODDEF
+ OS_ISATTY_METHODDEF
+ OS_PIPE_METHODDEF
+ OS_PIPE2_METHODDEF
+ OS_MKFIFO_METHODDEF
+ OS_MKNOD_METHODDEF
+ OS_MAJOR_METHODDEF
+ OS_MINOR_METHODDEF
+ OS_MAKEDEV_METHODDEF
+ OS_FTRUNCATE_METHODDEF
+ OS_TRUNCATE_METHODDEF
+ OS_POSIX_FALLOCATE_METHODDEF
+ OS_POSIX_FADVISE_METHODDEF
+ OS_PUTENV_METHODDEF
+ OS_UNSETENV_METHODDEF
+ OS_STRERROR_METHODDEF
+ OS_FCHDIR_METHODDEF
+ OS_FSYNC_METHODDEF
+ OS_SYNC_METHODDEF
+ OS_FDATASYNC_METHODDEF
+ OS_WCOREDUMP_METHODDEF
+ OS_WIFCONTINUED_METHODDEF
+ OS_WIFSTOPPED_METHODDEF
+ OS_WIFSIGNALED_METHODDEF
+ OS_WIFEXITED_METHODDEF
+ OS_WEXITSTATUS_METHODDEF
+ OS_WTERMSIG_METHODDEF
+ OS_WSTOPSIG_METHODDEF
+ OS_FSTATVFS_METHODDEF
+ OS_STATVFS_METHODDEF
+ OS_CONFSTR_METHODDEF
+ OS_SYSCONF_METHODDEF
+ OS_FPATHCONF_METHODDEF
+ OS_PATHCONF_METHODDEF
+ OS_ABORT_METHODDEF
+ OS__GETFULLPATHNAME_METHODDEF
+ OS__GETDISKUSAGE_METHODDEF
+ OS__GETFINALPATHNAME_METHODDEF
+ OS__GETVOLUMEPATHNAME_METHODDEF
+ OS__PATH_SPLITROOT_METHODDEF
+ OS__PATH_NORMPATH_METHODDEF
+ OS_GETLOADAVG_METHODDEF
+ OS_URANDOM_METHODDEF
+ OS_SETRESUID_METHODDEF
+ OS_SETRESGID_METHODDEF
+ OS_GETRESUID_METHODDEF
+ OS_GETRESGID_METHODDEF
+
+ OS_GETXATTR_METHODDEF
+ OS_SETXATTR_METHODDEF
+ OS_REMOVEXATTR_METHODDEF
+ OS_LISTXATTR_METHODDEF
+
+ OS_GET_TERMINAL_SIZE_METHODDEF
+ OS_CPU_COUNT_METHODDEF
+ OS_GET_INHERITABLE_METHODDEF
+ OS_SET_INHERITABLE_METHODDEF
+ OS_GET_HANDLE_INHERITABLE_METHODDEF
+ OS_SET_HANDLE_INHERITABLE_METHODDEF
+ OS_GET_BLOCKING_METHODDEF
+ OS_SET_BLOCKING_METHODDEF
+ OS_SCANDIR_METHODDEF
+ OS_FSPATH_METHODDEF
+ OS_GETRANDOM_METHODDEF
+ OS_MEMFD_CREATE_METHODDEF
+ OS_EVENTFD_METHODDEF
+ OS_EVENTFD_READ_METHODDEF
+ OS_EVENTFD_WRITE_METHODDEF
+ OS__ADD_DLL_DIRECTORY_METHODDEF
+ OS__REMOVE_DLL_DIRECTORY_METHODDEF
+ OS_WAITSTATUS_TO_EXITCODE_METHODDEF
+ OS_SETNS_METHODDEF
+ OS_UNSHARE_METHODDEF
+
+ OS__PATH_ISDEVDRIVE_METHODDEF
+ OS__PATH_ISDIR_METHODDEF
+ OS__PATH_ISFILE_METHODDEF
+ OS__PATH_ISLINK_METHODDEF
+ OS__PATH_EXISTS_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+static int
+all_ins(PyObject *m)
+{
+#ifdef F_OK
+ if (PyModule_AddIntMacro(m, F_OK)) return -1;
+#endif
+#ifdef R_OK
+ if (PyModule_AddIntMacro(m, R_OK)) return -1;
+#endif
+#ifdef W_OK
+ if (PyModule_AddIntMacro(m, W_OK)) return -1;
+#endif
+#ifdef X_OK
+ if (PyModule_AddIntMacro(m, X_OK)) return -1;
+#endif
+#ifdef NGROUPS_MAX
+ if (PyModule_AddIntMacro(m, NGROUPS_MAX)) return -1;
+#endif
+#ifdef TMP_MAX
+ if (PyModule_AddIntMacro(m, TMP_MAX)) return -1;
+#endif
+#ifdef WCONTINUED
+ if (PyModule_AddIntMacro(m, WCONTINUED)) return -1;
+#endif
+#ifdef WNOHANG
+ if (PyModule_AddIntMacro(m, WNOHANG)) return -1;
+#endif
+#ifdef WUNTRACED
+ if (PyModule_AddIntMacro(m, WUNTRACED)) return -1;
+#endif
+#ifdef O_RDONLY
+ if (PyModule_AddIntMacro(m, O_RDONLY)) return -1;
+#endif
+#ifdef O_WRONLY
+ if (PyModule_AddIntMacro(m, O_WRONLY)) return -1;
+#endif
+#ifdef O_RDWR
+ if (PyModule_AddIntMacro(m, O_RDWR)) return -1;
+#endif
+#ifdef O_NDELAY
+ if (PyModule_AddIntMacro(m, O_NDELAY)) return -1;
+#endif
+#ifdef O_NONBLOCK
+ if (PyModule_AddIntMacro(m, O_NONBLOCK)) return -1;
+#endif
+#ifdef O_APPEND
+ if (PyModule_AddIntMacro(m, O_APPEND)) return -1;
+#endif
+#ifdef O_DSYNC
+ if (PyModule_AddIntMacro(m, O_DSYNC)) return -1;
+#endif
+#ifdef O_RSYNC
+ if (PyModule_AddIntMacro(m, O_RSYNC)) return -1;
+#endif
+#ifdef O_SYNC
+ if (PyModule_AddIntMacro(m, O_SYNC)) return -1;
+#endif
+#ifdef O_NOCTTY
+ if (PyModule_AddIntMacro(m, O_NOCTTY)) return -1;
+#endif
+#ifdef O_CREAT
+ if (PyModule_AddIntMacro(m, O_CREAT)) return -1;
+#endif
+#ifdef O_EXCL
+ if (PyModule_AddIntMacro(m, O_EXCL)) return -1;
+#endif
+#ifdef O_TRUNC
+ if (PyModule_AddIntMacro(m, O_TRUNC)) return -1;
+#endif
+#ifdef O_BINARY
+ if (PyModule_AddIntMacro(m, O_BINARY)) return -1;
+#endif
+#ifdef O_TEXT
+ if (PyModule_AddIntMacro(m, O_TEXT)) return -1;
+#endif
+#ifdef O_XATTR
+ if (PyModule_AddIntMacro(m, O_XATTR)) return -1;
+#endif
+#ifdef O_LARGEFILE
+ if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1;
+#endif
+#ifndef __GNU__
+#ifdef O_SHLOCK
+ if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1;
+#endif
+#ifdef O_EXLOCK
+ if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1;
+#endif
+#endif
+#ifdef O_EXEC
+ if (PyModule_AddIntMacro(m, O_EXEC)) return -1;
+#endif
+#ifdef O_SEARCH
+ if (PyModule_AddIntMacro(m, O_SEARCH)) return -1;
+#endif
+#ifdef O_PATH
+ if (PyModule_AddIntMacro(m, O_PATH)) return -1;
+#endif
+#ifdef O_TTY_INIT
+ if (PyModule_AddIntMacro(m, O_TTY_INIT)) return -1;
+#endif
+#ifdef O_TMPFILE
+ if (PyModule_AddIntMacro(m, O_TMPFILE)) return -1;
+#endif
+#ifdef PRIO_PROCESS
+ if (PyModule_AddIntMacro(m, PRIO_PROCESS)) return -1;
+#endif
+#ifdef PRIO_PGRP
+ if (PyModule_AddIntMacro(m, PRIO_PGRP)) return -1;
+#endif
+#ifdef PRIO_USER
+ if (PyModule_AddIntMacro(m, PRIO_USER)) return -1;
+#endif
+#ifdef PRIO_DARWIN_THREAD
+ if (PyModule_AddIntMacro(m, PRIO_DARWIN_THREAD)) return -1;
+#endif
+#ifdef PRIO_DARWIN_PROCESS
+ if (PyModule_AddIntMacro(m, PRIO_DARWIN_PROCESS)) return -1;
+#endif
+#ifdef PRIO_DARWIN_BG
+ if (PyModule_AddIntMacro(m, PRIO_DARWIN_BG)) return -1;
+#endif
+#ifdef PRIO_DARWIN_NONUI
+ if (PyModule_AddIntMacro(m, PRIO_DARWIN_NONUI)) return -1;
+#endif
+#ifdef O_CLOEXEC
+ if (PyModule_AddIntMacro(m, O_CLOEXEC)) return -1;
+#endif
+#ifdef O_ACCMODE
+ if (PyModule_AddIntMacro(m, O_ACCMODE)) return -1;
+#endif
+#ifdef O_EVTONLY
+ if (PyModule_AddIntMacro(m, O_EVTONLY)) return -1;
+#endif
+#ifdef O_FSYNC
+ if (PyModule_AddIntMacro(m, O_FSYNC)) return -1;
+#endif
+#ifdef O_SYMLINK
+ if (PyModule_AddIntMacro(m, O_SYMLINK)) return -1;
+#endif
+
+#ifdef SEEK_HOLE
+ if (PyModule_AddIntMacro(m, SEEK_HOLE)) return -1;
+#endif
+#ifdef SEEK_DATA
+ if (PyModule_AddIntMacro(m, SEEK_DATA)) return -1;
+#endif
+
+/* MS Windows */
+#ifdef O_NOINHERIT
+ /* Don't inherit in child processes. */
+ if (PyModule_AddIntMacro(m, O_NOINHERIT)) return -1;
+#endif
+#ifdef _O_SHORT_LIVED
+ /* Optimize for short life (keep in memory). */
+ /* MS forgot to define this one with a non-underscore form too. */
+ if (PyModule_AddIntConstant(m, "O_SHORT_LIVED", _O_SHORT_LIVED)) return -1;
+#endif
+#ifdef O_TEMPORARY
+ /* Automatically delete when last handle is closed. */
+ if (PyModule_AddIntMacro(m, O_TEMPORARY)) return -1;
+#endif
+#ifdef O_RANDOM
+ /* Optimize for random access. */
+ if (PyModule_AddIntMacro(m, O_RANDOM)) return -1;
+#endif
+#ifdef O_SEQUENTIAL
+ /* Optimize for sequential access. */
+ if (PyModule_AddIntMacro(m, O_SEQUENTIAL)) return -1;
+#endif
+
+/* GNU extensions. */
+#ifdef O_ASYNC
+ /* Send a SIGIO signal whenever input or output
+ becomes available on file descriptor */
+ if (PyModule_AddIntMacro(m, O_ASYNC)) return -1;
+#endif
+#ifdef O_DIRECT
+ /* Direct disk access. */
+ if (PyModule_AddIntMacro(m, O_DIRECT)) return -1;
+#endif
+#ifdef O_DIRECTORY
+ /* Must be a directory. */
+ if (PyModule_AddIntMacro(m, O_DIRECTORY)) return -1;
+#endif
+#ifdef O_NOFOLLOW
+ /* Do not follow links. */
+ if (PyModule_AddIntMacro(m, O_NOFOLLOW)) return -1;
+#endif
+#ifdef O_NOFOLLOW_ANY
+ if (PyModule_AddIntMacro(m, O_NOFOLLOW_ANY)) return -1;
+#endif
+#ifdef O_NOLINKS
+ /* Fails if link count of the named file is greater than 1 */
+ if (PyModule_AddIntMacro(m, O_NOLINKS)) return -1;
+#endif
+#ifdef O_NOATIME
+ /* Do not update the access time. */
+ if (PyModule_AddIntMacro(m, O_NOATIME)) return -1;
+#endif
+
+ /* These come from sysexits.h */
+#ifdef EX_OK
+ if (PyModule_AddIntMacro(m, EX_OK)) return -1;
+#endif /* EX_OK */
+#ifdef EX_USAGE
+ if (PyModule_AddIntMacro(m, EX_USAGE)) return -1;
+#endif /* EX_USAGE */
+#ifdef EX_DATAERR
+ if (PyModule_AddIntMacro(m, EX_DATAERR)) return -1;
+#endif /* EX_DATAERR */
+#ifdef EX_NOINPUT
+ if (PyModule_AddIntMacro(m, EX_NOINPUT)) return -1;
+#endif /* EX_NOINPUT */
+#ifdef EX_NOUSER
+ if (PyModule_AddIntMacro(m, EX_NOUSER)) return -1;
+#endif /* EX_NOUSER */
+#ifdef EX_NOHOST
+ if (PyModule_AddIntMacro(m, EX_NOHOST)) return -1;
+#endif /* EX_NOHOST */
+#ifdef EX_UNAVAILABLE
+ if (PyModule_AddIntMacro(m, EX_UNAVAILABLE)) return -1;
+#endif /* EX_UNAVAILABLE */
+#ifdef EX_SOFTWARE
+ if (PyModule_AddIntMacro(m, EX_SOFTWARE)) return -1;
+#endif /* EX_SOFTWARE */
+#ifdef EX_OSERR
+ if (PyModule_AddIntMacro(m, EX_OSERR)) return -1;
+#endif /* EX_OSERR */
+#ifdef EX_OSFILE
+ if (PyModule_AddIntMacro(m, EX_OSFILE)) return -1;
+#endif /* EX_OSFILE */
+#ifdef EX_CANTCREAT
+ if (PyModule_AddIntMacro(m, EX_CANTCREAT)) return -1;
+#endif /* EX_CANTCREAT */
+#ifdef EX_IOERR
+ if (PyModule_AddIntMacro(m, EX_IOERR)) return -1;
+#endif /* EX_IOERR */
+#ifdef EX_TEMPFAIL
+ if (PyModule_AddIntMacro(m, EX_TEMPFAIL)) return -1;
+#endif /* EX_TEMPFAIL */
+#ifdef EX_PROTOCOL
+ if (PyModule_AddIntMacro(m, EX_PROTOCOL)) return -1;
+#endif /* EX_PROTOCOL */
+#ifdef EX_NOPERM
+ if (PyModule_AddIntMacro(m, EX_NOPERM)) return -1;
+#endif /* EX_NOPERM */
+#ifdef EX_CONFIG
+ if (PyModule_AddIntMacro(m, EX_CONFIG)) return -1;
+#endif /* EX_CONFIG */
+#ifdef EX_NOTFOUND
+ if (PyModule_AddIntMacro(m, EX_NOTFOUND)) return -1;
+#endif /* EX_NOTFOUND */
+
+ /* statvfs */
+#ifdef ST_RDONLY
+ if (PyModule_AddIntMacro(m, ST_RDONLY)) return -1;
+#endif /* ST_RDONLY */
+#ifdef ST_NOSUID
+ if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1;
+#endif /* ST_NOSUID */
+
+ /* GNU extensions */
+#ifdef ST_NODEV
+ if (PyModule_AddIntMacro(m, ST_NODEV)) return -1;
+#endif /* ST_NODEV */
+#ifdef ST_NOEXEC
+ if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1;
+#endif /* ST_NOEXEC */
+#ifdef ST_SYNCHRONOUS
+ if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1;
+#endif /* ST_SYNCHRONOUS */
+#ifdef ST_MANDLOCK
+ if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1;
+#endif /* ST_MANDLOCK */
+#ifdef ST_WRITE
+ if (PyModule_AddIntMacro(m, ST_WRITE)) return -1;
+#endif /* ST_WRITE */
+#ifdef ST_APPEND
+ if (PyModule_AddIntMacro(m, ST_APPEND)) return -1;
+#endif /* ST_APPEND */
+#ifdef ST_NOATIME
+ if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1;
+#endif /* ST_NOATIME */
+#ifdef ST_NODIRATIME
+ if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1;
+#endif /* ST_NODIRATIME */
+#ifdef ST_RELATIME
+ if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1;
+#endif /* ST_RELATIME */
+
+ /* FreeBSD sendfile() constants */
+#ifdef SF_NODISKIO
+ if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1;
+#endif
+ /* is obsolete since the 11.x release */
+#ifdef SF_MNOWAIT
+ if (PyModule_AddIntMacro(m, SF_MNOWAIT)) return -1;
+#endif
+#ifdef SF_SYNC
+ if (PyModule_AddIntMacro(m, SF_SYNC)) return -1;
+#endif
+#ifdef SF_NOCACHE
+ if (PyModule_AddIntMacro(m, SF_NOCACHE)) return -1;
+#endif
+
+ /* constants for posix_fadvise */
+#ifdef POSIX_FADV_NORMAL
+ if (PyModule_AddIntMacro(m, POSIX_FADV_NORMAL)) return -1;
+#endif
+#ifdef POSIX_FADV_SEQUENTIAL
+ if (PyModule_AddIntMacro(m, POSIX_FADV_SEQUENTIAL)) return -1;
+#endif
+#ifdef POSIX_FADV_RANDOM
+ if (PyModule_AddIntMacro(m, POSIX_FADV_RANDOM)) return -1;
+#endif
+#ifdef POSIX_FADV_NOREUSE
+ if (PyModule_AddIntMacro(m, POSIX_FADV_NOREUSE)) return -1;
+#endif
+#ifdef POSIX_FADV_WILLNEED
+ if (PyModule_AddIntMacro(m, POSIX_FADV_WILLNEED)) return -1;
+#endif
+#ifdef POSIX_FADV_DONTNEED
+ if (PyModule_AddIntMacro(m, POSIX_FADV_DONTNEED)) return -1;
+#endif
+
+ /* constants for waitid */
+#if defined(HAVE_SYS_WAIT_H) && defined(HAVE_WAITID)
+ if (PyModule_AddIntMacro(m, P_PID)) return -1;
+ if (PyModule_AddIntMacro(m, P_PGID)) return -1;
+ if (PyModule_AddIntMacro(m, P_ALL)) return -1;
+#ifdef P_PIDFD
+ if (PyModule_AddIntMacro(m, P_PIDFD)) return -1;
+#endif
+#ifdef PIDFD_NONBLOCK
+ if (PyModule_AddIntMacro(m, PIDFD_NONBLOCK)) return -1;
+#endif
+#endif
+#ifdef WEXITED
+ if (PyModule_AddIntMacro(m, WEXITED)) return -1;
+#endif
+#ifdef WNOWAIT
+ if (PyModule_AddIntMacro(m, WNOWAIT)) return -1;
+#endif
+#ifdef WSTOPPED
+ if (PyModule_AddIntMacro(m, WSTOPPED)) return -1;
+#endif
+#ifdef CLD_EXITED
+ if (PyModule_AddIntMacro(m, CLD_EXITED)) return -1;
+#endif
+#ifdef CLD_KILLED
+ if (PyModule_AddIntMacro(m, CLD_KILLED)) return -1;
+#endif
+#ifdef CLD_DUMPED
+ if (PyModule_AddIntMacro(m, CLD_DUMPED)) return -1;
+#endif
+#ifdef CLD_TRAPPED
+ if (PyModule_AddIntMacro(m, CLD_TRAPPED)) return -1;
+#endif
+#ifdef CLD_STOPPED
+ if (PyModule_AddIntMacro(m, CLD_STOPPED)) return -1;
+#endif
+#ifdef CLD_CONTINUED
+ if (PyModule_AddIntMacro(m, CLD_CONTINUED)) return -1;
+#endif
+
+ /* constants for lockf */
+#ifdef F_LOCK
+ if (PyModule_AddIntMacro(m, F_LOCK)) return -1;
+#endif
+#ifdef F_TLOCK
+ if (PyModule_AddIntMacro(m, F_TLOCK)) return -1;
+#endif
+#ifdef F_ULOCK
+ if (PyModule_AddIntMacro(m, F_ULOCK)) return -1;
+#endif
+#ifdef F_TEST
+ if (PyModule_AddIntMacro(m, F_TEST)) return -1;
+#endif
+
+#ifdef RWF_DSYNC
+ if (PyModule_AddIntConstant(m, "RWF_DSYNC", RWF_DSYNC)) return -1;
+#endif
+#ifdef RWF_HIPRI
+ if (PyModule_AddIntConstant(m, "RWF_HIPRI", RWF_HIPRI)) return -1;
+#endif
+#ifdef RWF_SYNC
+ if (PyModule_AddIntConstant(m, "RWF_SYNC", RWF_SYNC)) return -1;
+#endif
+#ifdef RWF_NOWAIT
+ if (PyModule_AddIntConstant(m, "RWF_NOWAIT", RWF_NOWAIT)) return -1;
+#endif
+#ifdef RWF_APPEND
+ if (PyModule_AddIntConstant(m, "RWF_APPEND", RWF_APPEND)) return -1;
+#endif
+
+/* constants for splice */
+#if defined(HAVE_SPLICE) && defined(__linux__)
+ if (PyModule_AddIntConstant(m, "SPLICE_F_MOVE", SPLICE_F_MOVE)) return -1;
+ if (PyModule_AddIntConstant(m, "SPLICE_F_NONBLOCK", SPLICE_F_NONBLOCK)) return -1;
+ if (PyModule_AddIntConstant(m, "SPLICE_F_MORE", SPLICE_F_MORE)) return -1;
+#endif
+
+/* constants for posix_spawn */
+#ifdef HAVE_POSIX_SPAWN
+ if (PyModule_AddIntConstant(m, "POSIX_SPAWN_OPEN", POSIX_SPAWN_OPEN)) return -1;
+ if (PyModule_AddIntConstant(m, "POSIX_SPAWN_CLOSE", POSIX_SPAWN_CLOSE)) return -1;
+ if (PyModule_AddIntConstant(m, "POSIX_SPAWN_DUP2", POSIX_SPAWN_DUP2)) return -1;
+#endif
+
+#if defined(HAVE_SPAWNV) || defined (HAVE_RTPSPAWN)
+ if (PyModule_AddIntConstant(m, "P_WAIT", _P_WAIT)) return -1;
+ if (PyModule_AddIntConstant(m, "P_NOWAIT", _P_NOWAIT)) return -1;
+ if (PyModule_AddIntConstant(m, "P_NOWAITO", _P_NOWAITO)) return -1;
+#endif
+#ifdef HAVE_SPAWNV
+ if (PyModule_AddIntConstant(m, "P_OVERLAY", _OLD_P_OVERLAY)) return -1;
+ if (PyModule_AddIntConstant(m, "P_DETACH", _P_DETACH)) return -1;
+#endif
+
+#ifdef HAVE_SCHED_H
+#ifdef SCHED_OTHER
+ if (PyModule_AddIntMacro(m, SCHED_OTHER)) return -1;
+#endif
+#ifdef SCHED_FIFO
+ if (PyModule_AddIntMacro(m, SCHED_FIFO)) return -1;
+#endif
+#ifdef SCHED_RR
+ if (PyModule_AddIntMacro(m, SCHED_RR)) return -1;
+#endif
+#ifdef SCHED_SPORADIC
+ if (PyModule_AddIntMacro(m, SCHED_SPORADIC)) return -1;
+#endif
+#ifdef SCHED_BATCH
+ if (PyModule_AddIntMacro(m, SCHED_BATCH)) return -1;
+#endif
+#ifdef SCHED_IDLE
+ if (PyModule_AddIntMacro(m, SCHED_IDLE)) return -1;
+#endif
+#ifdef SCHED_RESET_ON_FORK
+ if (PyModule_AddIntMacro(m, SCHED_RESET_ON_FORK)) return -1;
+#endif
+#ifdef SCHED_SYS
+ if (PyModule_AddIntMacro(m, SCHED_SYS)) return -1;
+#endif
+#ifdef SCHED_IA
+ if (PyModule_AddIntMacro(m, SCHED_IA)) return -1;
+#endif
+#ifdef SCHED_FSS
+ if (PyModule_AddIntMacro(m, SCHED_FSS)) return -1;
+#endif
+#ifdef SCHED_FX
+ if (PyModule_AddIntConstant(m, "SCHED_FX", SCHED_FSS)) return -1;
+#endif
+
+/* constants for namespaces */
+#if defined(HAVE_SETNS) || defined(HAVE_UNSHARE)
+#ifdef CLONE_FS
+ if (PyModule_AddIntMacro(m, CLONE_FS)) return -1;
+#endif
+#ifdef CLONE_FILES
+ if (PyModule_AddIntMacro(m, CLONE_FILES)) return -1;
+#endif
+#ifdef CLONE_NEWNS
+ if (PyModule_AddIntMacro(m, CLONE_NEWNS)) return -1;
+#endif
+#ifdef CLONE_NEWCGROUP
+ if (PyModule_AddIntMacro(m, CLONE_NEWCGROUP)) return -1;
+#endif
+#ifdef CLONE_NEWUTS
+ if (PyModule_AddIntMacro(m, CLONE_NEWUTS)) return -1;
+#endif
+#ifdef CLONE_NEWIPC
+ if (PyModule_AddIntMacro(m, CLONE_NEWIPC)) return -1;
+#endif
+#ifdef CLONE_NEWUSER
+ if (PyModule_AddIntMacro(m, CLONE_NEWUSER)) return -1;
+#endif
+#ifdef CLONE_NEWPID
+ if (PyModule_AddIntMacro(m, CLONE_NEWPID)) return -1;
+#endif
+#ifdef CLONE_NEWNET
+ if (PyModule_AddIntMacro(m, CLONE_NEWNET)) return -1;
+#endif
+#ifdef CLONE_NEWTIME
+ if (PyModule_AddIntMacro(m, CLONE_NEWTIME)) return -1;
+#endif
+#ifdef CLONE_SYSVSEM
+ if (PyModule_AddIntMacro(m, CLONE_SYSVSEM)) return -1;
+#endif
+#ifdef CLONE_THREAD
+ if (PyModule_AddIntMacro(m, CLONE_THREAD)) return -1;
+#endif
+#ifdef CLONE_SIGHAND
+ if (PyModule_AddIntMacro(m, CLONE_SIGHAND)) return -1;
+#endif
+#ifdef CLONE_VM
+ if (PyModule_AddIntMacro(m, CLONE_VM)) return -1;
+#endif
+#endif
+
+#endif
+
+#ifdef USE_XATTRS
+ if (PyModule_AddIntMacro(m, XATTR_CREATE)) return -1;
+ if (PyModule_AddIntMacro(m, XATTR_REPLACE)) return -1;
+ if (PyModule_AddIntMacro(m, XATTR_SIZE_MAX)) return -1;
+#endif
+
+#if HAVE_DECL_RTLD_LAZY
+ if (PyModule_AddIntMacro(m, RTLD_LAZY)) return -1;
+#endif
+#if HAVE_DECL_RTLD_NOW
+ if (PyModule_AddIntMacro(m, RTLD_NOW)) return -1;
+#endif
+#if HAVE_DECL_RTLD_GLOBAL
+ if (PyModule_AddIntMacro(m, RTLD_GLOBAL)) return -1;
+#endif
+#if HAVE_DECL_RTLD_LOCAL
+ if (PyModule_AddIntMacro(m, RTLD_LOCAL)) return -1;
+#endif
+#if HAVE_DECL_RTLD_NODELETE
+ if (PyModule_AddIntMacro(m, RTLD_NODELETE)) return -1;
+#endif
+#if HAVE_DECL_RTLD_NOLOAD
+ if (PyModule_AddIntMacro(m, RTLD_NOLOAD)) return -1;
+#endif
+#if HAVE_DECL_RTLD_DEEPBIND
+ if (PyModule_AddIntMacro(m, RTLD_DEEPBIND)) return -1;
+#endif
+#if HAVE_DECL_RTLD_MEMBER
+ if (PyModule_AddIntMacro(m, RTLD_MEMBER)) return -1;
+#endif
+
+#ifdef HAVE_GETRANDOM_SYSCALL
+ if (PyModule_AddIntMacro(m, GRND_RANDOM)) return -1;
+ if (PyModule_AddIntMacro(m, GRND_NONBLOCK)) return -1;
+#endif
+#ifdef HAVE_MEMFD_CREATE
+ if (PyModule_AddIntMacro(m, MFD_CLOEXEC)) return -1;
+ if (PyModule_AddIntMacro(m, MFD_ALLOW_SEALING)) return -1;
+#ifdef MFD_HUGETLB
+ if (PyModule_AddIntMacro(m, MFD_HUGETLB)) return -1;
+#endif
+#ifdef MFD_HUGE_SHIFT
+ if (PyModule_AddIntMacro(m, MFD_HUGE_SHIFT)) return -1;
+#endif
+#ifdef MFD_HUGE_MASK
+ if (PyModule_AddIntMacro(m, MFD_HUGE_MASK)) return -1;
+#endif
+#ifdef MFD_HUGE_64KB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_64KB)) return -1;
+#endif
+#ifdef MFD_HUGE_512KB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_512KB)) return -1;
+#endif
+#ifdef MFD_HUGE_1MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_1MB)) return -1;
+#endif
+#ifdef MFD_HUGE_2MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_2MB)) return -1;
+#endif
+#ifdef MFD_HUGE_8MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_8MB)) return -1;
+#endif
+#ifdef MFD_HUGE_16MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_16MB)) return -1;
+#endif
+#ifdef MFD_HUGE_32MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_32MB)) return -1;
+#endif
+#ifdef MFD_HUGE_256MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_256MB)) return -1;
+#endif
+#ifdef MFD_HUGE_512MB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_512MB)) return -1;
+#endif
+#ifdef MFD_HUGE_1GB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_1GB)) return -1;
+#endif
+#ifdef MFD_HUGE_2GB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_2GB)) return -1;
+#endif
+#ifdef MFD_HUGE_16GB
+ if (PyModule_AddIntMacro(m, MFD_HUGE_16GB)) return -1;
+#endif
+#endif /* HAVE_MEMFD_CREATE */
+
+#if defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)
+ if (PyModule_AddIntMacro(m, EFD_CLOEXEC)) return -1;
+#ifdef EFD_NONBLOCK
+ if (PyModule_AddIntMacro(m, EFD_NONBLOCK)) return -1;
+#endif
+#ifdef EFD_SEMAPHORE
+ if (PyModule_AddIntMacro(m, EFD_SEMAPHORE)) return -1;
+#endif
+#endif /* HAVE_EVENTFD && EFD_CLOEXEC */
+
+#if defined(__APPLE__)
+ if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
+ if (PyModule_AddIntConstant(m, "_COPYFILE_STAT", COPYFILE_STAT)) return -1;
+ if (PyModule_AddIntConstant(m, "_COPYFILE_ACL", COPYFILE_ACL)) return -1;
+ if (PyModule_AddIntConstant(m, "_COPYFILE_XATTR", COPYFILE_XATTR)) return -1;
+#endif
+
+#ifdef MS_WINDOWS
+ if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_DEFAULT_DIRS", LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)) return -1;
+ if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_APPLICATION_DIR", LOAD_LIBRARY_SEARCH_APPLICATION_DIR)) return -1;
+ if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_SYSTEM32", LOAD_LIBRARY_SEARCH_SYSTEM32)) return -1;
+ if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_USER_DIRS", LOAD_LIBRARY_SEARCH_USER_DIRS)) return -1;
+ if (PyModule_AddIntConstant(m, "_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR", LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR)) return -1;
+#endif
+
+ return 0;
+}
+
+
+
+#define PROBE(name, test) \
+ static int name(void) \
+ { \
+ if (test) { \
+ return 1; \
+ } else { \
+ return 0; \
+ } \
+ }
+
+#ifdef HAVE_FSTATAT
+PROBE(probe_fstatat, HAVE_FSTATAT_RUNTIME)
+#endif
+
+#ifdef HAVE_FACCESSAT
+PROBE(probe_faccessat, HAVE_FACCESSAT_RUNTIME)
+#endif
+
+#ifdef HAVE_FCHMODAT
+PROBE(probe_fchmodat, HAVE_FCHMODAT_RUNTIME)
+#endif
+
+#ifdef HAVE_FCHOWNAT
+PROBE(probe_fchownat, HAVE_FCHOWNAT_RUNTIME)
+#endif
+
+#ifdef HAVE_LINKAT
+PROBE(probe_linkat, HAVE_LINKAT_RUNTIME)
+#endif
+
+#ifdef HAVE_FDOPENDIR
+PROBE(probe_fdopendir, HAVE_FDOPENDIR_RUNTIME)
+#endif
+
+#ifdef HAVE_MKDIRAT
+PROBE(probe_mkdirat, HAVE_MKDIRAT_RUNTIME)
+#endif
+
+#ifdef HAVE_MKFIFOAT
+PROBE(probe_mkfifoat, HAVE_MKFIFOAT_RUNTIME)
+#endif
+
+#ifdef HAVE_MKNODAT
+PROBE(probe_mknodat, HAVE_MKNODAT_RUNTIME)
+#endif
+
+#ifdef HAVE_RENAMEAT
+PROBE(probe_renameat, HAVE_RENAMEAT_RUNTIME)
+#endif
+
+#ifdef HAVE_UNLINKAT
+PROBE(probe_unlinkat, HAVE_UNLINKAT_RUNTIME)
+#endif
+
+#ifdef HAVE_OPENAT
+PROBE(probe_openat, HAVE_OPENAT_RUNTIME)
+#endif
+
+#ifdef HAVE_READLINKAT
+PROBE(probe_readlinkat, HAVE_READLINKAT_RUNTIME)
+#endif
+
+#ifdef HAVE_SYMLINKAT
+PROBE(probe_symlinkat, HAVE_SYMLINKAT_RUNTIME)
+#endif
+
+#ifdef HAVE_FUTIMENS
+PROBE(probe_futimens, HAVE_FUTIMENS_RUNTIME)
+#endif
+
+#ifdef HAVE_UTIMENSAT
+PROBE(probe_utimensat, HAVE_UTIMENSAT_RUNTIME)
+#endif
+
+
+
+
+static const struct have_function {
+ const char * const label;
+ int (*probe)(void);
+} have_functions[] = {
+
+#ifdef HAVE_EVENTFD
+ {"HAVE_EVENTFD", NULL},
+#endif
+
+#ifdef HAVE_FACCESSAT
+ { "HAVE_FACCESSAT", probe_faccessat },
+#endif
+
+#ifdef HAVE_FCHDIR
+ { "HAVE_FCHDIR", NULL },
+#endif
+
+#ifdef HAVE_FCHMOD
+ { "HAVE_FCHMOD", NULL },
+#endif
+
+#ifdef HAVE_FCHMODAT
+ { "HAVE_FCHMODAT", probe_fchmodat },
+#endif
+
+#ifdef HAVE_FCHOWN
+ { "HAVE_FCHOWN", NULL },
+#endif
+
+#ifdef HAVE_FCHOWNAT
+ { "HAVE_FCHOWNAT", probe_fchownat },
+#endif
+
+#ifdef HAVE_FEXECVE
+ { "HAVE_FEXECVE", NULL },
+#endif
+
+#ifdef HAVE_FDOPENDIR
+ { "HAVE_FDOPENDIR", probe_fdopendir },
+#endif
+
+#ifdef HAVE_FPATHCONF
+ { "HAVE_FPATHCONF", NULL },
+#endif
+
+#ifdef HAVE_FSTATAT
+ { "HAVE_FSTATAT", probe_fstatat },
+#endif
+
+#ifdef HAVE_FSTATVFS
+ { "HAVE_FSTATVFS", NULL },
+#endif
+
+#if defined HAVE_FTRUNCATE || defined MS_WINDOWS
+ { "HAVE_FTRUNCATE", NULL },
+#endif
+
+#ifdef HAVE_FUTIMENS
+ { "HAVE_FUTIMENS", probe_futimens },
+#endif
+
+#ifdef HAVE_FUTIMES
+ { "HAVE_FUTIMES", NULL },
+#endif
+
+#ifdef HAVE_FUTIMESAT
+ { "HAVE_FUTIMESAT", NULL },
+#endif
+
+#ifdef HAVE_LINKAT
+ { "HAVE_LINKAT", probe_linkat },
+#endif
+
+#ifdef HAVE_LCHFLAGS
+ { "HAVE_LCHFLAGS", NULL },
+#endif
+
+#ifdef HAVE_LCHMOD
+ { "HAVE_LCHMOD", NULL },
+#endif
+
+#ifdef HAVE_LCHOWN
+ { "HAVE_LCHOWN", NULL },
+#endif
+
+#ifdef HAVE_LSTAT
+ { "HAVE_LSTAT", NULL },
+#endif
+
+#ifdef HAVE_LUTIMES
+ { "HAVE_LUTIMES", NULL },
+#endif
+
+#ifdef HAVE_MEMFD_CREATE
+ { "HAVE_MEMFD_CREATE", NULL },
+#endif
+
+#ifdef HAVE_MKDIRAT
+ { "HAVE_MKDIRAT", probe_mkdirat },
+#endif
+
+#ifdef HAVE_MKFIFOAT
+ { "HAVE_MKFIFOAT", probe_mkfifoat },
+#endif
+
+#ifdef HAVE_MKNODAT
+ { "HAVE_MKNODAT", probe_mknodat },
+#endif
+
+#ifdef HAVE_OPENAT
+ { "HAVE_OPENAT", probe_openat },
+#endif
+
+#ifdef HAVE_READLINKAT
+ { "HAVE_READLINKAT", probe_readlinkat },
+#endif
+
+#ifdef HAVE_RENAMEAT
+ { "HAVE_RENAMEAT", probe_renameat },
+#endif
+
+#ifdef HAVE_SYMLINKAT
+ { "HAVE_SYMLINKAT", probe_symlinkat },
+#endif
+
+#ifdef HAVE_UNLINKAT
+ { "HAVE_UNLINKAT", probe_unlinkat },
+#endif
+
+#ifdef HAVE_UTIMENSAT
+ { "HAVE_UTIMENSAT", probe_utimensat },
+#endif
+
+#ifdef MS_WINDOWS
+ { "MS_WINDOWS", NULL },
+#endif
+
+ { NULL, NULL }
+};
+
+
+static int
+posixmodule_exec(PyObject *m)
+{
+ _posixstate *state = get_posix_state(m);
+
+#if defined(HAVE_PWRITEV)
+ if (HAVE_PWRITEV_RUNTIME) {} else {
+ PyObject* dct = PyModule_GetDict(m);
+
+ if (dct == NULL) {
+ return -1;
+ }
+
+ if (PyDict_DelItemString(dct, "pwritev") == -1) {
+ PyErr_Clear();
+ }
+ if (PyDict_DelItemString(dct, "preadv") == -1) {
+ PyErr_Clear();
+ }
+ }
+#endif
+
+ /* Initialize environ dictionary */
+ if (_PyModule_Add(m, "environ", convertenviron()) != 0) {
+ return -1;
+ }
+
+ if (all_ins(m))
+ return -1;
+
+ if (setup_confname_tables(m))
+ return -1;
+
+ if (PyModule_AddObjectRef(m, "error", PyExc_OSError) < 0) {
+ return -1;
+ }
+
+#if defined(HAVE_WAITID) && !defined(__APPLE__)
+ waitid_result_desc.name = MODNAME ".waitid_result";
+ state->WaitidResultType = (PyObject *)PyStructSequence_NewType(&waitid_result_desc);
+ if (PyModule_AddObjectRef(m, "waitid_result", state->WaitidResultType) < 0) {
+ return -1;
+ }
+#endif
+
+ stat_result_desc.name = "os.stat_result"; /* see issue #19209 */
+ stat_result_desc.fields[7].name = PyStructSequence_UnnamedField;
+ stat_result_desc.fields[8].name = PyStructSequence_UnnamedField;
+ stat_result_desc.fields[9].name = PyStructSequence_UnnamedField;
+ state->StatResultType = (PyObject *)PyStructSequence_NewType(&stat_result_desc);
+ if (PyModule_AddObjectRef(m, "stat_result", state->StatResultType) < 0) {
+ return -1;
+ }
+ state->statresult_new_orig = ((PyTypeObject *)state->StatResultType)->tp_new;
+ ((PyTypeObject *)state->StatResultType)->tp_new = statresult_new;
+
+ statvfs_result_desc.name = "os.statvfs_result"; /* see issue #19209 */
+ state->StatVFSResultType = (PyObject *)PyStructSequence_NewType(&statvfs_result_desc);
+ if (PyModule_AddObjectRef(m, "statvfs_result", state->StatVFSResultType) < 0) {
+ return -1;
+ }
+
+#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
+ sched_param_desc.name = MODNAME ".sched_param";
+ state->SchedParamType = (PyObject *)PyStructSequence_NewType(&sched_param_desc);
+ if (PyModule_AddObjectRef(m, "sched_param", state->SchedParamType) < 0) {
+ return -1;
+ }
+ ((PyTypeObject *)state->SchedParamType)->tp_new = os_sched_param;
+#endif
+
+ /* initialize TerminalSize_info */
+ state->TerminalSizeType = (PyObject *)PyStructSequence_NewType(&TerminalSize_desc);
+ if (PyModule_AddObjectRef(m, "terminal_size", state->TerminalSizeType) < 0) {
+ return -1;
+ }
+
+ /* initialize scandir types */
+ PyObject *ScandirIteratorType = PyType_FromModuleAndSpec(m, &ScandirIteratorType_spec, NULL);
+ if (ScandirIteratorType == NULL) {
+ return -1;
+ }
+ state->ScandirIteratorType = ScandirIteratorType;
+
+ state->DirEntryType = PyType_FromModuleAndSpec(m, &DirEntryType_spec, NULL);
+ if (PyModule_AddObjectRef(m, "DirEntry", state->DirEntryType) < 0) {
+ return -1;
+ }
+
+ times_result_desc.name = MODNAME ".times_result";
+ state->TimesResultType = (PyObject *)PyStructSequence_NewType(&times_result_desc);
+ if (PyModule_AddObjectRef(m, "times_result", state->TimesResultType) < 0) {
+ return -1;
+ }
+
+ state->UnameResultType = (PyObject *)PyStructSequence_NewType(&uname_result_desc);
+ if (PyModule_AddObjectRef(m, "uname_result", state->UnameResultType) < 0) {
+ return -1;
+ }
+
+ if ((state->billion = PyLong_FromLong(1000000000)) == NULL)
+ return -1;
+#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
+ state->struct_rusage = PyUnicode_InternFromString("struct_rusage");
+ if (state->struct_rusage == NULL)
+ return -1;
+#endif
+ state->st_mode = PyUnicode_InternFromString("st_mode");
+ if (state->st_mode == NULL)
+ return -1;
+
+ /* suppress "function not used" warnings */
+ {
+ int ignored;
+ fd_specified("", -1);
+ follow_symlinks_specified("", 1);
+ dir_fd_and_follow_symlinks_invalid("chmod", DEFAULT_DIR_FD, 1);
+ dir_fd_converter(Py_None, &ignored);
+ dir_fd_unavailable(Py_None, &ignored);
+ }
+
+ /*
+ * provide list of locally available functions
+ * so os.py can populate support_* lists
+ */
+ PyObject *list = PyList_New(0);
+ if (!list) {
+ return -1;
+ }
+ for (const struct have_function *trace = have_functions; trace->label; trace++) {
+ PyObject *unicode;
+ if (trace->probe && !trace->probe()) continue;
+ unicode = PyUnicode_DecodeASCII(trace->label, strlen(trace->label), NULL);
+ if (!unicode)
+ return -1;
+ if (PyList_Append(list, unicode))
+ return -1;
+ Py_DECREF(unicode);
+ }
+
+ return _PyModule_Add(m, "_have_functions", list);
+}
+
+
+static PyModuleDef_Slot posixmodile_slots[] = {
+ {Py_mod_exec, posixmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef posixmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = MODNAME,
+ .m_doc = posix__doc__,
+ .m_size = sizeof(_posixstate),
+ .m_methods = posix_methods,
+ .m_slots = posixmodile_slots,
+ .m_traverse = _posix_traverse,
+ .m_clear = _posix_clear,
+ .m_free = _posix_free,
+};
+
+PyMODINIT_FUNC
+INITFUNC(void)
+{
+ return PyModuleDef_Init(&posixmodule);
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/contrib/tools/python3/Modules/posixmodule.h b/contrib/tools/python3/Modules/posixmodule.h
new file mode 100644
index 00000000000..5452ffbf17a
--- /dev/null
+++ b/contrib/tools/python3/Modules/posixmodule.h
@@ -0,0 +1,32 @@
+/* Declarations shared between the different POSIX-related modules */
+
+#ifndef Py_POSIXMODULE_H
+#define Py_POSIXMODULE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifndef Py_LIMITED_API
+#ifndef MS_WINDOWS
+PyAPI_FUNC(PyObject *) _PyLong_FromUid(uid_t);
+PyAPI_FUNC(PyObject *) _PyLong_FromGid(gid_t);
+PyAPI_FUNC(int) _Py_Uid_Converter(PyObject *, uid_t *);
+PyAPI_FUNC(int) _Py_Gid_Converter(PyObject *, gid_t *);
+#endif /* MS_WINDOWS */
+
+#if defined(PYPTHREAD_SIGMASK) || defined(HAVE_SIGWAIT) || \
+ defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
+# define HAVE_SIGSET_T
+#endif
+
+PyAPI_FUNC(int) _Py_Sigset_Converter(PyObject *, void *);
+#endif /* Py_LIMITED_API */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_POSIXMODULE_H */
diff --git a/contrib/tools/python3/Modules/pwdmodule.c b/contrib/tools/python3/Modules/pwdmodule.c
new file mode 100644
index 00000000000..cc2e2a43893
--- /dev/null
+++ b/contrib/tools/python3/Modules/pwdmodule.c
@@ -0,0 +1,372 @@
+
+/* UNIX password file access module */
+
+#include "Python.h"
+#include "posixmodule.h"
+
+#include <pwd.h>
+
+#include "clinic/pwdmodule.c.h"
+/*[clinic input]
+module pwd
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=60f628ef356b97b6]*/
+
+static PyStructSequence_Field struct_pwd_type_fields[] = {
+ {"pw_name", "user name"},
+ {"pw_passwd", "password"},
+ {"pw_uid", "user id"},
+ {"pw_gid", "group id"},
+ {"pw_gecos", "real name"},
+ {"pw_dir", "home directory"},
+ {"pw_shell", "shell program"},
+ {0}
+};
+
+PyDoc_STRVAR(struct_passwd__doc__,
+"pwd.struct_passwd: Results from getpw*() routines.\n\n\
+This object may be accessed either as a tuple of\n\
+ (pw_name,pw_passwd,pw_uid,pw_gid,pw_gecos,pw_dir,pw_shell)\n\
+or via the object attributes as named in the above tuple.");
+
+static PyStructSequence_Desc struct_pwd_type_desc = {
+ "pwd.struct_passwd",
+ struct_passwd__doc__,
+ struct_pwd_type_fields,
+ 7,
+};
+
+PyDoc_STRVAR(pwd__doc__,
+"This module provides access to the Unix password database.\n\
+It is available on all Unix versions.\n\
+\n\
+Password database entries are reported as 7-tuples containing the following\n\
+items from the password database (see `<pwd.h>'), in order:\n\
+pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir, pw_shell.\n\
+The uid and gid items are integers, all others are strings. An\n\
+exception is raised if the entry asked for cannot be found.");
+
+
+typedef struct {
+ PyTypeObject *StructPwdType;
+} pwdmodulestate;
+
+static inline pwdmodulestate*
+get_pwd_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (pwdmodulestate *)state;
+}
+
+static struct PyModuleDef pwdmodule;
+
+#define DEFAULT_BUFFER_SIZE 1024
+
+static void
+sets(PyObject *v, int i, const char* val)
+{
+ if (val) {
+ PyObject *o = PyUnicode_DecodeFSDefault(val);
+ PyStructSequence_SET_ITEM(v, i, o);
+ }
+ else {
+ PyStructSequence_SET_ITEM(v, i, Py_None);
+ Py_INCREF(Py_None);
+ }
+}
+
+static PyObject *
+mkpwent(PyObject *module, struct passwd *p)
+{
+ int setIndex = 0;
+ PyObject *v = PyStructSequence_New(get_pwd_state(module)->StructPwdType);
+ if (v == NULL)
+ return NULL;
+
+#define SETS(i,val) sets(v, i, val)
+
+ SETS(setIndex++, p->pw_name);
+#if defined(HAVE_STRUCT_PASSWD_PW_PASSWD) && !defined(__ANDROID__)
+ SETS(setIndex++, p->pw_passwd);
+#else
+ SETS(setIndex++, "");
+#endif
+ PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid));
+ PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid));
+#if defined(HAVE_STRUCT_PASSWD_PW_GECOS)
+ SETS(setIndex++, p->pw_gecos);
+#else
+ SETS(setIndex++, "");
+#endif
+ SETS(setIndex++, p->pw_dir);
+ SETS(setIndex++, p->pw_shell);
+
+#undef SETS
+
+ if (PyErr_Occurred()) {
+ Py_XDECREF(v);
+ return NULL;
+ }
+
+ return v;
+}
+
+/*[clinic input]
+pwd.getpwuid
+
+ uidobj: object
+ /
+
+Return the password database entry for the given numeric user ID.
+
+See `help(pwd)` for more on password database entries.
+[clinic start generated code]*/
+
+static PyObject *
+pwd_getpwuid(PyObject *module, PyObject *uidobj)
+/*[clinic end generated code: output=c4ee1d4d429b86c4 input=ae64d507a1c6d3e8]*/
+{
+ PyObject *retval = NULL;
+ uid_t uid;
+ int nomem = 0;
+ struct passwd *p;
+ char *buf = NULL, *buf2 = NULL;
+
+ if (!_Py_Uid_Converter(uidobj, &uid)) {
+ if (PyErr_ExceptionMatches(PyExc_OverflowError))
+ PyErr_Format(PyExc_KeyError,
+ "getpwuid(): uid not found");
+ return NULL;
+ }
+#ifdef HAVE_GETPWUID_R
+ int status;
+ Py_ssize_t bufsize;
+ /* Note: 'pwd' will be used via pointer 'p' on getpwuid_r success. */
+ struct passwd pwd;
+
+ Py_BEGIN_ALLOW_THREADS
+ bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (bufsize == -1) {
+ bufsize = DEFAULT_BUFFER_SIZE;
+ }
+
+ while(1) {
+ buf2 = PyMem_RawRealloc(buf, bufsize);
+ if (buf2 == NULL) {
+ p = NULL;
+ nomem = 1;
+ break;
+ }
+ buf = buf2;
+ status = getpwuid_r(uid, &pwd, buf, bufsize, &p);
+ if (status != 0) {
+ p = NULL;
+ }
+ if (p != NULL || status != ERANGE) {
+ break;
+ }
+ if (bufsize > (PY_SSIZE_T_MAX >> 1)) {
+ nomem = 1;
+ break;
+ }
+ bufsize <<= 1;
+ }
+
+ Py_END_ALLOW_THREADS
+#else
+ p = getpwuid(uid);
+#endif
+ if (p == NULL) {
+ PyMem_RawFree(buf);
+ if (nomem == 1) {
+ return PyErr_NoMemory();
+ }
+ PyObject *uid_obj = _PyLong_FromUid(uid);
+ if (uid_obj == NULL)
+ return NULL;
+ PyErr_Format(PyExc_KeyError,
+ "getpwuid(): uid not found: %S", uid_obj);
+ Py_DECREF(uid_obj);
+ return NULL;
+ }
+ retval = mkpwent(module, p);
+#ifdef HAVE_GETPWUID_R
+ PyMem_RawFree(buf);
+#endif
+ return retval;
+}
+
+/*[clinic input]
+pwd.getpwnam
+
+ name: unicode
+ /
+
+Return the password database entry for the given user name.
+
+See `help(pwd)` for more on password database entries.
+[clinic start generated code]*/
+
+static PyObject *
+pwd_getpwnam_impl(PyObject *module, PyObject *name)
+/*[clinic end generated code: output=359ce1ddeb7a824f input=a6aeb5e3447fb9e0]*/
+{
+ char *buf = NULL, *buf2 = NULL, *name_chars;
+ int nomem = 0;
+ struct passwd *p;
+ PyObject *bytes, *retval = NULL;
+
+ if ((bytes = PyUnicode_EncodeFSDefault(name)) == NULL)
+ return NULL;
+ /* check for embedded null bytes */
+ if (PyBytes_AsStringAndSize(bytes, &name_chars, NULL) == -1)
+ goto out;
+#ifdef HAVE_GETPWNAM_R
+ int status;
+ Py_ssize_t bufsize;
+ /* Note: 'pwd' will be used via pointer 'p' on getpwnam_r success. */
+ struct passwd pwd;
+
+ Py_BEGIN_ALLOW_THREADS
+ bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+ if (bufsize == -1) {
+ bufsize = DEFAULT_BUFFER_SIZE;
+ }
+
+ while(1) {
+ buf2 = PyMem_RawRealloc(buf, bufsize);
+ if (buf2 == NULL) {
+ p = NULL;
+ nomem = 1;
+ break;
+ }
+ buf = buf2;
+ status = getpwnam_r(name_chars, &pwd, buf, bufsize, &p);
+ if (status != 0) {
+ p = NULL;
+ }
+ if (p != NULL || status != ERANGE) {
+ break;
+ }
+ if (bufsize > (PY_SSIZE_T_MAX >> 1)) {
+ nomem = 1;
+ break;
+ }
+ bufsize <<= 1;
+ }
+
+ Py_END_ALLOW_THREADS
+#else
+ p = getpwnam(name_chars);
+#endif
+ if (p == NULL) {
+ if (nomem == 1) {
+ PyErr_NoMemory();
+ }
+ else {
+ PyErr_Format(PyExc_KeyError,
+ "getpwnam(): name not found: %R", name);
+ }
+ goto out;
+ }
+ retval = mkpwent(module, p);
+out:
+ PyMem_RawFree(buf);
+ Py_DECREF(bytes);
+ return retval;
+}
+
+#ifdef HAVE_GETPWENT
+/*[clinic input]
+pwd.getpwall
+
+Return a list of all available password database entries, in arbitrary order.
+
+See help(pwd) for more on password database entries.
+[clinic start generated code]*/
+
+static PyObject *
+pwd_getpwall_impl(PyObject *module)
+/*[clinic end generated code: output=4853d2f5a0afac8a input=d7ecebfd90219b85]*/
+{
+ PyObject *d;
+ struct passwd *p;
+ if ((d = PyList_New(0)) == NULL)
+ return NULL;
+ setpwent();
+ while ((p = getpwent()) != NULL) {
+ PyObject *v = mkpwent(module, p);
+ if (v == NULL || PyList_Append(d, v) != 0) {
+ Py_XDECREF(v);
+ Py_DECREF(d);
+ endpwent();
+ return NULL;
+ }
+ Py_DECREF(v);
+ }
+ endpwent();
+ return d;
+}
+#endif
+
+static PyMethodDef pwd_methods[] = {
+ PWD_GETPWUID_METHODDEF
+ PWD_GETPWNAM_METHODDEF
+#ifdef HAVE_GETPWENT
+ PWD_GETPWALL_METHODDEF
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+pwdmodule_exec(PyObject *module)
+{
+ pwdmodulestate *state = get_pwd_state(module);
+
+ state->StructPwdType = PyStructSequence_NewType(&struct_pwd_type_desc);
+ if (state->StructPwdType == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->StructPwdType) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot pwdmodule_slots[] = {
+ {Py_mod_exec, pwdmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int pwdmodule_traverse(PyObject *m, visitproc visit, void *arg) {
+ Py_VISIT(get_pwd_state(m)->StructPwdType);
+ return 0;
+}
+static int pwdmodule_clear(PyObject *m) {
+ Py_CLEAR(get_pwd_state(m)->StructPwdType);
+ return 0;
+}
+static void pwdmodule_free(void *m) {
+ pwdmodule_clear((PyObject *)m);
+}
+
+static struct PyModuleDef pwdmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "pwd",
+ .m_doc = pwd__doc__,
+ .m_size = sizeof(pwdmodulestate),
+ .m_methods = pwd_methods,
+ .m_slots = pwdmodule_slots,
+ .m_traverse = pwdmodule_traverse,
+ .m_clear = pwdmodule_clear,
+ .m_free = pwdmodule_free,
+};
+
+
+PyMODINIT_FUNC
+PyInit_pwd(void)
+{
+ return PyModuleDef_Init(&pwdmodule);
+}
diff --git a/contrib/tools/python3/Modules/pyexpat.c b/contrib/tools/python3/Modules/pyexpat.c
new file mode 100644
index 00000000000..b21360419d6
--- /dev/null
+++ b/contrib/tools/python3/Modules/pyexpat.c
@@ -0,0 +1,2148 @@
+#include "Python.h"
+#include <ctype.h>
+
+#include "structmember.h" // PyMemberDef
+#include "expat.h"
+
+#include "pyexpat.h"
+
+/* Do not emit Clinic output to a file as that wreaks havoc with conditionally
+ included methods. */
+/*[clinic input]
+module pyexpat
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b168d503a4490c15]*/
+
+#define XML_COMBINED_VERSION (10000*XML_MAJOR_VERSION+100*XML_MINOR_VERSION+XML_MICRO_VERSION)
+
+static XML_Memory_Handling_Suite ExpatMemoryHandler = {
+ PyObject_Malloc, PyObject_Realloc, PyObject_Free};
+
+enum HandlerTypes {
+ StartElement,
+ EndElement,
+ ProcessingInstruction,
+ CharacterData,
+ UnparsedEntityDecl,
+ NotationDecl,
+ StartNamespaceDecl,
+ EndNamespaceDecl,
+ Comment,
+ StartCdataSection,
+ EndCdataSection,
+ Default,
+ DefaultHandlerExpand,
+ NotStandalone,
+ ExternalEntityRef,
+ StartDoctypeDecl,
+ EndDoctypeDecl,
+ EntityDecl,
+ XmlDecl,
+ ElementDecl,
+ AttlistDecl,
+#if XML_COMBINED_VERSION >= 19504
+ SkippedEntity,
+#endif
+ _DummyDecl
+};
+
+typedef struct {
+ PyTypeObject *xml_parse_type;
+ PyObject *error;
+ PyObject *str_read;
+} pyexpat_state;
+
+static inline pyexpat_state*
+pyexpat_get_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (pyexpat_state *)state;
+}
+
+/* ----------------------------------------------------- */
+
+/* Declarations for objects of type xmlparser */
+
+typedef struct {
+ PyObject_HEAD
+
+ XML_Parser itself;
+ int ordered_attributes; /* Return attributes as a list. */
+ int specified_attributes; /* Report only specified attributes. */
+ int in_callback; /* Is a callback active? */
+ int ns_prefixes; /* Namespace-triplets mode? */
+ XML_Char *buffer; /* Buffer used when accumulating characters */
+ /* NULL if not enabled */
+ int buffer_size; /* Size of buffer, in XML_Char units */
+ int buffer_used; /* Buffer units in use */
+ PyObject *intern; /* Dictionary to intern strings */
+ PyObject **handlers;
+} xmlparseobject;
+
+#include "clinic/pyexpat.c.h"
+
+#define CHARACTER_DATA_BUFFER_SIZE 8192
+
+typedef void (*xmlhandlersetter)(XML_Parser self, void *meth);
+typedef void* xmlhandler;
+
+struct HandlerInfo {
+ const char *name;
+ xmlhandlersetter setter;
+ xmlhandler handler;
+ PyGetSetDef getset;
+};
+
+static struct HandlerInfo handler_info[64];
+
+/* Set an integer attribute on the error object; return true on success,
+ * false on an exception.
+ */
+static int
+set_error_attr(PyObject *err, const char *name, int value)
+{
+ PyObject *v = PyLong_FromLong(value);
+
+ if (v == NULL || PyObject_SetAttrString(err, name, v) == -1) {
+ Py_XDECREF(v);
+ return 0;
+ }
+ Py_DECREF(v);
+ return 1;
+}
+
+/* Build and set an Expat exception, including positioning
+ * information. Always returns NULL.
+ */
+static PyObject *
+set_error(pyexpat_state *state, xmlparseobject *self, enum XML_Error code)
+{
+ PyObject *err;
+ PyObject *buffer;
+ XML_Parser parser = self->itself;
+ int lineno = XML_GetErrorLineNumber(parser);
+ int column = XML_GetErrorColumnNumber(parser);
+
+ buffer = PyUnicode_FromFormat("%s: line %i, column %i",
+ XML_ErrorString(code), lineno, column);
+ if (buffer == NULL)
+ return NULL;
+ err = PyObject_CallOneArg(state->error, buffer);
+ Py_DECREF(buffer);
+ if ( err != NULL
+ && set_error_attr(err, "code", code)
+ && set_error_attr(err, "offset", column)
+ && set_error_attr(err, "lineno", lineno)) {
+ PyErr_SetObject(state->error, err);
+ }
+ Py_XDECREF(err);
+ return NULL;
+}
+
+static int
+have_handler(xmlparseobject *self, int type)
+{
+ PyObject *handler = self->handlers[type];
+ return handler != NULL;
+}
+
+/* Convert a string of XML_Chars into a Unicode string.
+ Returns None if str is a null pointer. */
+
+static PyObject *
+conv_string_to_unicode(const XML_Char *str)
+{
+ /* XXX currently this code assumes that XML_Char is 8-bit,
+ and hence in UTF-8. */
+ /* UTF-8 from Expat, Unicode desired */
+ if (str == NULL) {
+ Py_RETURN_NONE;
+ }
+ return PyUnicode_DecodeUTF8(str, strlen(str), "strict");
+}
+
+static PyObject *
+conv_string_len_to_unicode(const XML_Char *str, int len)
+{
+ /* XXX currently this code assumes that XML_Char is 8-bit,
+ and hence in UTF-8. */
+ /* UTF-8 from Expat, Unicode desired */
+ if (str == NULL) {
+ Py_RETURN_NONE;
+ }
+ return PyUnicode_DecodeUTF8((const char *)str, len, "strict");
+}
+
+/* Callback routines */
+
+static void clear_handlers(xmlparseobject *self, int initial);
+
+/* This handler is used when an error has been detected, in the hope
+ that actual parsing can be terminated early. This will only help
+ if an external entity reference is encountered. */
+static int
+error_external_entity_ref_handler(XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId)
+{
+ return 0;
+}
+
+/* Dummy character data handler used when an error (exception) has
+ been detected, and the actual parsing can be terminated early.
+ This is needed since character data handler can't be safely removed
+ from within the character data handler, but can be replaced. It is
+ used only from the character data handler trampoline, and must be
+ used right after `flag_error()` is called. */
+static void
+noop_character_data_handler(void *userData, const XML_Char *data, int len)
+{
+ /* Do nothing. */
+}
+
+static void
+flag_error(xmlparseobject *self)
+{
+ clear_handlers(self, 0);
+ XML_SetExternalEntityRefHandler(self->itself,
+ error_external_entity_ref_handler);
+}
+
+static PyObject*
+call_with_frame(const char *funcname, int lineno, PyObject* func, PyObject* args,
+ xmlparseobject *self)
+{
+ PyObject *res;
+
+ res = PyObject_Call(func, args, NULL);
+ if (res == NULL) {
+ _PyTraceback_Add(funcname, __FILE__, lineno);
+ XML_StopParser(self->itself, XML_FALSE);
+ }
+ return res;
+}
+
+static PyObject*
+string_intern(xmlparseobject *self, const char* str)
+{
+ PyObject *result = conv_string_to_unicode(str);
+ PyObject *value;
+ /* result can be NULL if the unicode conversion failed. */
+ if (!result)
+ return result;
+ if (!self->intern)
+ return result;
+ value = PyDict_GetItemWithError(self->intern, result);
+ if (!value) {
+ if (!PyErr_Occurred() &&
+ PyDict_SetItem(self->intern, result, result) == 0)
+ {
+ return result;
+ }
+ else {
+ Py_DECREF(result);
+ return NULL;
+ }
+ }
+ Py_INCREF(value);
+ Py_DECREF(result);
+ return value;
+}
+
+/* Return 0 on success, -1 on exception.
+ * flag_error() will be called before return if needed.
+ */
+static int
+call_character_handler(xmlparseobject *self, const XML_Char *buffer, int len)
+{
+ PyObject *args;
+ PyObject *temp;
+
+ if (!have_handler(self, CharacterData))
+ return -1;
+
+ args = PyTuple_New(1);
+ if (args == NULL)
+ return -1;
+ temp = (conv_string_len_to_unicode(buffer, len));
+ if (temp == NULL) {
+ Py_DECREF(args);
+ flag_error(self);
+ XML_SetCharacterDataHandler(self->itself,
+ noop_character_data_handler);
+ return -1;
+ }
+ PyTuple_SET_ITEM(args, 0, temp);
+ /* temp is now a borrowed reference; consider it unused. */
+ self->in_callback = 1;
+ temp = call_with_frame("CharacterData", __LINE__,
+ self->handlers[CharacterData], args, self);
+ /* temp is an owned reference again, or NULL */
+ self->in_callback = 0;
+ Py_DECREF(args);
+ if (temp == NULL) {
+ flag_error(self);
+ XML_SetCharacterDataHandler(self->itself,
+ noop_character_data_handler);
+ return -1;
+ }
+ Py_DECREF(temp);
+ return 0;
+}
+
+static int
+flush_character_buffer(xmlparseobject *self)
+{
+ int rc;
+ if (self->buffer == NULL || self->buffer_used == 0)
+ return 0;
+ rc = call_character_handler(self, self->buffer, self->buffer_used);
+ self->buffer_used = 0;
+ return rc;
+}
+
+static void
+my_CharacterDataHandler(void *userData, const XML_Char *data, int len)
+{
+ xmlparseobject *self = (xmlparseobject *) userData;
+
+ if (PyErr_Occurred())
+ return;
+
+ if (self->buffer == NULL)
+ call_character_handler(self, data, len);
+ else {
+ if ((self->buffer_used + len) > self->buffer_size) {
+ if (flush_character_buffer(self) < 0)
+ return;
+ /* handler might have changed; drop the rest on the floor
+ * if there isn't a handler anymore
+ */
+ if (!have_handler(self, CharacterData))
+ return;
+ }
+ if (len > self->buffer_size) {
+ call_character_handler(self, data, len);
+ self->buffer_used = 0;
+ }
+ else {
+ memcpy(self->buffer + self->buffer_used,
+ data, len * sizeof(XML_Char));
+ self->buffer_used += len;
+ }
+ }
+}
+
+static void
+my_StartElementHandler(void *userData,
+ const XML_Char *name, const XML_Char *atts[])
+{
+ xmlparseobject *self = (xmlparseobject *)userData;
+
+ if (have_handler(self, StartElement)) {
+ PyObject *container, *rv, *args;
+ int i, max;
+
+ if (PyErr_Occurred())
+ return;
+
+ if (flush_character_buffer(self) < 0)
+ return;
+ /* Set max to the number of slots filled in atts[]; max/2 is
+ * the number of attributes we need to process.
+ */
+ if (self->specified_attributes) {
+ max = XML_GetSpecifiedAttributeCount(self->itself);
+ }
+ else {
+ max = 0;
+ while (atts[max] != NULL)
+ max += 2;
+ }
+ /* Build the container. */
+ if (self->ordered_attributes)
+ container = PyList_New(max);
+ else
+ container = PyDict_New();
+ if (container == NULL) {
+ flag_error(self);
+ return;
+ }
+ for (i = 0; i < max; i += 2) {
+ PyObject *n = string_intern(self, (XML_Char *) atts[i]);
+ PyObject *v;
+ if (n == NULL) {
+ flag_error(self);
+ Py_DECREF(container);
+ return;
+ }
+ v = conv_string_to_unicode((XML_Char *) atts[i+1]);
+ if (v == NULL) {
+ flag_error(self);
+ Py_DECREF(container);
+ Py_DECREF(n);
+ return;
+ }
+ if (self->ordered_attributes) {
+ PyList_SET_ITEM(container, i, n);
+ PyList_SET_ITEM(container, i+1, v);
+ }
+ else if (PyDict_SetItem(container, n, v)) {
+ flag_error(self);
+ Py_DECREF(n);
+ Py_DECREF(v);
+ Py_DECREF(container);
+ return;
+ }
+ else {
+ Py_DECREF(n);
+ Py_DECREF(v);
+ }
+ }
+ args = string_intern(self, name);
+ if (args == NULL) {
+ Py_DECREF(container);
+ return;
+ }
+ args = Py_BuildValue("(NN)", args, container);
+ if (args == NULL) {
+ return;
+ }
+ /* Container is now a borrowed reference; ignore it. */
+ self->in_callback = 1;
+ rv = call_with_frame("StartElement", __LINE__,
+ self->handlers[StartElement], args, self);
+ self->in_callback = 0;
+ Py_DECREF(args);
+ if (rv == NULL) {
+ flag_error(self);
+ return;
+ }
+ Py_DECREF(rv);
+ }
+}
+
+#define RC_HANDLER(RC, NAME, PARAMS, INIT, PARAM_FORMAT, CONVERSION, \
+ RETURN, GETUSERDATA) \
+static RC \
+my_##NAME##Handler PARAMS {\
+ xmlparseobject *self = GETUSERDATA ; \
+ PyObject *args = NULL; \
+ PyObject *rv = NULL; \
+ INIT \
+\
+ if (have_handler(self, NAME)) { \
+ if (PyErr_Occurred()) \
+ return RETURN; \
+ if (flush_character_buffer(self) < 0) \
+ return RETURN; \
+ args = Py_BuildValue PARAM_FORMAT ;\
+ if (!args) { flag_error(self); return RETURN;} \
+ self->in_callback = 1; \
+ rv = call_with_frame(#NAME,__LINE__, \
+ self->handlers[NAME], args, self); \
+ self->in_callback = 0; \
+ Py_DECREF(args); \
+ if (rv == NULL) { \
+ flag_error(self); \
+ return RETURN; \
+ } \
+ CONVERSION \
+ Py_DECREF(rv); \
+ } \
+ return RETURN; \
+}
+
+#define VOID_HANDLER(NAME, PARAMS, PARAM_FORMAT) \
+ RC_HANDLER(void, NAME, PARAMS, ;, PARAM_FORMAT, ;, ;,\
+ (xmlparseobject *)userData)
+
+#define INT_HANDLER(NAME, PARAMS, PARAM_FORMAT)\
+ RC_HANDLER(int, NAME, PARAMS, int rc=0;, PARAM_FORMAT, \
+ rc = PyLong_AsLong(rv);, rc, \
+ (xmlparseobject *)userData)
+
+VOID_HANDLER(EndElement,
+ (void *userData, const XML_Char *name),
+ ("(N)", string_intern(self, name)))
+
+VOID_HANDLER(ProcessingInstruction,
+ (void *userData,
+ const XML_Char *target,
+ const XML_Char *data),
+ ("(NO&)", string_intern(self, target), conv_string_to_unicode ,data))
+
+VOID_HANDLER(UnparsedEntityDecl,
+ (void *userData,
+ const XML_Char *entityName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName),
+ ("(NNNNN)",
+ string_intern(self, entityName), string_intern(self, base),
+ string_intern(self, systemId), string_intern(self, publicId),
+ string_intern(self, notationName)))
+
+VOID_HANDLER(EntityDecl,
+ (void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity,
+ const XML_Char *value,
+ int value_length,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId,
+ const XML_Char *notationName),
+ ("NiNNNNN",
+ string_intern(self, entityName), is_parameter_entity,
+ (conv_string_len_to_unicode(value, value_length)),
+ string_intern(self, base), string_intern(self, systemId),
+ string_intern(self, publicId),
+ string_intern(self, notationName)))
+
+VOID_HANDLER(XmlDecl,
+ (void *userData,
+ const XML_Char *version,
+ const XML_Char *encoding,
+ int standalone),
+ ("(O&O&i)",
+ conv_string_to_unicode ,version, conv_string_to_unicode ,encoding,
+ standalone))
+
+static PyObject *
+conv_content_model(XML_Content * const model,
+ PyObject *(*conv_string)(const XML_Char *))
+{
+ PyObject *result = NULL;
+ PyObject *children = PyTuple_New(model->numchildren);
+ int i;
+
+ if (children != NULL) {
+ assert(model->numchildren < INT_MAX);
+ for (i = 0; i < (int)model->numchildren; ++i) {
+ PyObject *child = conv_content_model(&model->children[i],
+ conv_string);
+ if (child == NULL) {
+ Py_XDECREF(children);
+ return NULL;
+ }
+ PyTuple_SET_ITEM(children, i, child);
+ }
+ result = Py_BuildValue("(iiO&N)",
+ model->type, model->quant,
+ conv_string,model->name, children);
+ }
+ return result;
+}
+
+static void
+my_ElementDeclHandler(void *userData,
+ const XML_Char *name,
+ XML_Content *model)
+{
+ xmlparseobject *self = (xmlparseobject *)userData;
+ PyObject *args = NULL;
+
+ if (have_handler(self, ElementDecl)) {
+ PyObject *rv = NULL;
+ PyObject *modelobj, *nameobj;
+
+ if (PyErr_Occurred())
+ return;
+
+ if (flush_character_buffer(self) < 0)
+ goto finally;
+ modelobj = conv_content_model(model, (conv_string_to_unicode));
+ if (modelobj == NULL) {
+ flag_error(self);
+ goto finally;
+ }
+ nameobj = string_intern(self, name);
+ if (nameobj == NULL) {
+ Py_DECREF(modelobj);
+ flag_error(self);
+ goto finally;
+ }
+ args = Py_BuildValue("NN", nameobj, modelobj);
+ if (args == NULL) {
+ flag_error(self);
+ goto finally;
+ }
+ self->in_callback = 1;
+ rv = call_with_frame("ElementDecl", __LINE__,
+ self->handlers[ElementDecl], args, self);
+ self->in_callback = 0;
+ if (rv == NULL) {
+ flag_error(self);
+ goto finally;
+ }
+ Py_DECREF(rv);
+ }
+ finally:
+ Py_XDECREF(args);
+ XML_FreeContentModel(self->itself, model);
+ return;
+}
+
+VOID_HANDLER(AttlistDecl,
+ (void *userData,
+ const XML_Char *elname,
+ const XML_Char *attname,
+ const XML_Char *att_type,
+ const XML_Char *dflt,
+ int isrequired),
+ ("(NNO&O&i)",
+ string_intern(self, elname), string_intern(self, attname),
+ conv_string_to_unicode ,att_type, conv_string_to_unicode ,dflt,
+ isrequired))
+
+#if XML_COMBINED_VERSION >= 19504
+VOID_HANDLER(SkippedEntity,
+ (void *userData,
+ const XML_Char *entityName,
+ int is_parameter_entity),
+ ("Ni",
+ string_intern(self, entityName), is_parameter_entity))
+#endif
+
+VOID_HANDLER(NotationDecl,
+ (void *userData,
+ const XML_Char *notationName,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId),
+ ("(NNNN)",
+ string_intern(self, notationName), string_intern(self, base),
+ string_intern(self, systemId), string_intern(self, publicId)))
+
+VOID_HANDLER(StartNamespaceDecl,
+ (void *userData,
+ const XML_Char *prefix,
+ const XML_Char *uri),
+ ("(NN)",
+ string_intern(self, prefix), string_intern(self, uri)))
+
+VOID_HANDLER(EndNamespaceDecl,
+ (void *userData,
+ const XML_Char *prefix),
+ ("(N)", string_intern(self, prefix)))
+
+VOID_HANDLER(Comment,
+ (void *userData, const XML_Char *data),
+ ("(O&)", conv_string_to_unicode ,data))
+
+VOID_HANDLER(StartCdataSection,
+ (void *userData),
+ ("()"))
+
+VOID_HANDLER(EndCdataSection,
+ (void *userData),
+ ("()"))
+
+VOID_HANDLER(Default,
+ (void *userData, const XML_Char *s, int len),
+ ("(N)", (conv_string_len_to_unicode(s,len))))
+
+VOID_HANDLER(DefaultHandlerExpand,
+ (void *userData, const XML_Char *s, int len),
+ ("(N)", (conv_string_len_to_unicode(s,len))))
+#define my_DefaultHandlerExpand my_DefaultHandlerExpandHandler
+
+INT_HANDLER(NotStandalone,
+ (void *userData),
+ ("()"))
+
+RC_HANDLER(int, ExternalEntityRef,
+ (XML_Parser parser,
+ const XML_Char *context,
+ const XML_Char *base,
+ const XML_Char *systemId,
+ const XML_Char *publicId),
+ int rc=0;,
+ ("(O&NNN)",
+ conv_string_to_unicode ,context, string_intern(self, base),
+ string_intern(self, systemId), string_intern(self, publicId)),
+ rc = PyLong_AsLong(rv);, rc,
+ XML_GetUserData(parser))
+
+/* XXX UnknownEncodingHandler */
+
+VOID_HANDLER(StartDoctypeDecl,
+ (void *userData, const XML_Char *doctypeName,
+ const XML_Char *sysid, const XML_Char *pubid,
+ int has_internal_subset),
+ ("(NNNi)", string_intern(self, doctypeName),
+ string_intern(self, sysid), string_intern(self, pubid),
+ has_internal_subset))
+
+VOID_HANDLER(EndDoctypeDecl, (void *userData), ("()"))
+
+/* ---------------------------------------------------------------- */
+/*[clinic input]
+class pyexpat.xmlparser "xmlparseobject *" "&Xmlparsetype"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2393162385232e1c]*/
+
+
+static PyObject *
+get_parse_result(pyexpat_state *state, xmlparseobject *self, int rv)
+{
+ if (PyErr_Occurred()) {
+ return NULL;
+ }
+ if (rv == 0) {
+ return set_error(state, self, XML_GetErrorCode(self->itself));
+ }
+ if (flush_character_buffer(self) < 0) {
+ return NULL;
+ }
+ return PyLong_FromLong(rv);
+}
+
+#define MAX_CHUNK_SIZE (1 << 20)
+
+/*[clinic input]
+pyexpat.xmlparser.Parse
+
+ cls: defining_class
+ data: object
+ isfinal: bool = False
+ /
+
+Parse XML data.
+
+`isfinal' should be true at end of input.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyTypeObject *cls,
+ PyObject *data, int isfinal)
+/*[clinic end generated code: output=8faffe07fe1f862a input=d0eb2a69fab3b9f1]*/
+{
+ const char *s;
+ Py_ssize_t slen;
+ Py_buffer view;
+ int rc;
+ pyexpat_state *state = PyType_GetModuleState(cls);
+
+ if (PyUnicode_Check(data)) {
+ view.buf = NULL;
+ s = PyUnicode_AsUTF8AndSize(data, &slen);
+ if (s == NULL)
+ return NULL;
+ /* Explicitly set UTF-8 encoding. Return code ignored. */
+ (void)XML_SetEncoding(self->itself, "utf-8");
+ }
+ else {
+ if (PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) < 0)
+ return NULL;
+ s = view.buf;
+ slen = view.len;
+ }
+
+ static_assert(MAX_CHUNK_SIZE <= INT_MAX,
+ "MAX_CHUNK_SIZE is larger than INT_MAX");
+ while (slen > MAX_CHUNK_SIZE) {
+ rc = XML_Parse(self->itself, s, MAX_CHUNK_SIZE, 0);
+ if (!rc)
+ goto done;
+ s += MAX_CHUNK_SIZE;
+ slen -= MAX_CHUNK_SIZE;
+ }
+
+ assert(slen <= INT_MAX);
+ rc = XML_Parse(self->itself, s, (int)slen, isfinal);
+
+done:
+ if (view.buf != NULL) {
+ PyBuffer_Release(&view);
+ }
+ return get_parse_result(state, self, rc);
+}
+
+/* File reading copied from cPickle */
+
+#define BUF_SIZE 2048
+
+static int
+readinst(char *buf, int buf_size, PyObject *meth)
+{
+ PyObject *str;
+ Py_ssize_t len;
+ const char *ptr;
+
+ str = PyObject_CallFunction(meth, "i", buf_size);
+ if (str == NULL)
+ goto error;
+
+ if (PyBytes_Check(str))
+ ptr = PyBytes_AS_STRING(str);
+ else if (PyByteArray_Check(str))
+ ptr = PyByteArray_AS_STRING(str);
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "read() did not return a bytes object (type=%.400s)",
+ Py_TYPE(str)->tp_name);
+ goto error;
+ }
+ len = Py_SIZE(str);
+ if (len > buf_size) {
+ PyErr_Format(PyExc_ValueError,
+ "read() returned too much data: "
+ "%i bytes requested, %zd returned",
+ buf_size, len);
+ goto error;
+ }
+ memcpy(buf, ptr, len);
+ Py_DECREF(str);
+ /* len <= buf_size <= INT_MAX */
+ return (int)len;
+
+error:
+ Py_XDECREF(str);
+ return -1;
+}
+
+/*[clinic input]
+pyexpat.xmlparser.ParseFile
+
+ cls: defining_class
+ file: object
+ /
+
+Parse XML data from file-like object.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_ParseFile_impl(xmlparseobject *self, PyTypeObject *cls,
+ PyObject *file)
+/*[clinic end generated code: output=34780a094c8ca3ae input=ba4bc9c541684793]*/
+{
+ int rv = 1;
+ PyObject *readmethod = NULL;
+
+ pyexpat_state *state = PyType_GetModuleState(cls);
+
+ if (_PyObject_LookupAttr(file, state->str_read, &readmethod) < 0) {
+ return NULL;
+ }
+ if (readmethod == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "argument must have 'read' attribute");
+ return NULL;
+ }
+ for (;;) {
+ int bytes_read;
+ void *buf = XML_GetBuffer(self->itself, BUF_SIZE);
+ if (buf == NULL) {
+ Py_XDECREF(readmethod);
+ return get_parse_result(state, self, 0);
+ }
+
+ bytes_read = readinst(buf, BUF_SIZE, readmethod);
+ if (bytes_read < 0) {
+ Py_DECREF(readmethod);
+ return NULL;
+ }
+ rv = XML_ParseBuffer(self->itself, bytes_read, bytes_read == 0);
+ if (PyErr_Occurred()) {
+ Py_XDECREF(readmethod);
+ return NULL;
+ }
+
+ if (!rv || bytes_read == 0)
+ break;
+ }
+ Py_XDECREF(readmethod);
+ return get_parse_result(state, self, rv);
+}
+
+/*[clinic input]
+pyexpat.xmlparser.SetBase
+
+ base: str
+ /
+
+Set the base URL for the parser.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base)
+/*[clinic end generated code: output=c212ddceb607b539 input=c684e5de895ee1a8]*/
+{
+ if (!XML_SetBase(self->itself, base)) {
+ return PyErr_NoMemory();
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+pyexpat.xmlparser.GetBase
+
+Return base URL string for the parser.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_GetBase_impl(xmlparseobject *self)
+/*[clinic end generated code: output=2886cb21f9a8739a input=918d71c38009620e]*/
+{
+ return Py_BuildValue("z", XML_GetBase(self->itself));
+}
+
+/*[clinic input]
+pyexpat.xmlparser.GetInputContext
+
+Return the untranslated text of the input that caused the current event.
+
+If the event was generated by a large amount of text (such as a start tag
+for an element with many attributes), not all of the text may be available.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self)
+/*[clinic end generated code: output=a88026d683fc22cc input=034df8712db68379]*/
+{
+ if (self->in_callback) {
+ int offset, size;
+ const char *buffer
+ = XML_GetInputContext(self->itself, &offset, &size);
+
+ if (buffer != NULL)
+ return PyBytes_FromStringAndSize(buffer + offset,
+ size - offset);
+ else
+ Py_RETURN_NONE;
+ }
+ else
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+pyexpat.xmlparser.ExternalEntityParserCreate
+
+ cls: defining_class
+ context: str(accept={str, NoneType})
+ encoding: str = NULL
+ /
+
+Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
+ PyTypeObject *cls,
+ const char *context,
+ const char *encoding)
+/*[clinic end generated code: output=01d4472b49cb3f92 input=ec70c6b9e6e9619a]*/
+{
+ xmlparseobject *new_parser;
+ int i;
+
+ pyexpat_state *state = PyType_GetModuleState(cls);
+
+ new_parser = PyObject_GC_New(xmlparseobject, state->xml_parse_type);
+ if (new_parser == NULL) {
+ return NULL;
+ }
+
+ new_parser->buffer_size = self->buffer_size;
+ new_parser->buffer_used = 0;
+ new_parser->buffer = NULL;
+ new_parser->ordered_attributes = self->ordered_attributes;
+ new_parser->specified_attributes = self->specified_attributes;
+ new_parser->in_callback = 0;
+ new_parser->ns_prefixes = self->ns_prefixes;
+ new_parser->itself = XML_ExternalEntityParserCreate(self->itself, context,
+ encoding);
+ new_parser->handlers = 0;
+ new_parser->intern = Py_XNewRef(self->intern);
+
+ if (self->buffer != NULL) {
+ new_parser->buffer = PyMem_Malloc(new_parser->buffer_size);
+ if (new_parser->buffer == NULL) {
+ Py_DECREF(new_parser);
+ return PyErr_NoMemory();
+ }
+ }
+ if (!new_parser->itself) {
+ Py_DECREF(new_parser);
+ return PyErr_NoMemory();
+ }
+
+ XML_SetUserData(new_parser->itself, (void *)new_parser);
+
+ /* allocate and clear handlers first */
+ for (i = 0; handler_info[i].name != NULL; i++)
+ /* do nothing */;
+
+ new_parser->handlers = PyMem_New(PyObject *, i);
+ if (!new_parser->handlers) {
+ Py_DECREF(new_parser);
+ return PyErr_NoMemory();
+ }
+ clear_handlers(new_parser, 1);
+
+ /* then copy handlers from self */
+ for (i = 0; handler_info[i].name != NULL; i++) {
+ PyObject *handler = self->handlers[i];
+ if (handler != NULL) {
+ new_parser->handlers[i] = Py_NewRef(handler);
+ handler_info[i].setter(new_parser->itself,
+ handler_info[i].handler);
+ }
+ }
+
+ PyObject_GC_Track(new_parser);
+ return (PyObject *)new_parser;
+}
+
+/*[clinic input]
+pyexpat.xmlparser.SetParamEntityParsing
+
+ flag: int
+ /
+
+Controls parsing of parameter entities (including the external DTD subset).
+
+Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER,
+XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and
+XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag
+was successful.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag)
+/*[clinic end generated code: output=18668ee8e760d64c input=8aea19b4b15e9af1]*/
+{
+ flag = XML_SetParamEntityParsing(self->itself, flag);
+ return PyLong_FromLong(flag);
+}
+
+
+#if XML_COMBINED_VERSION >= 19505
+/*[clinic input]
+pyexpat.xmlparser.UseForeignDTD
+
+ cls: defining_class
+ flag: bool = True
+ /
+
+Allows the application to provide an artificial external subset if one is not specified as part of the document instance.
+
+This readily allows the use of a 'default' document type controlled by the
+application, while still getting the advantage of providing document type
+information to the parser. 'flag' defaults to True if not provided.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, PyTypeObject *cls,
+ int flag)
+/*[clinic end generated code: output=d7d98252bd25a20f input=23440ecb0573fb29]*/
+{
+ pyexpat_state *state = PyType_GetModuleState(cls);
+ enum XML_Error rc;
+
+ rc = XML_UseForeignDTD(self->itself, flag ? XML_TRUE : XML_FALSE);
+ if (rc != XML_ERROR_NONE) {
+ return set_error(state, self, rc);
+ }
+ Py_RETURN_NONE;
+}
+#endif
+
+static struct PyMethodDef xmlparse_methods[] = {
+ PYEXPAT_XMLPARSER_PARSE_METHODDEF
+ PYEXPAT_XMLPARSER_PARSEFILE_METHODDEF
+ PYEXPAT_XMLPARSER_SETBASE_METHODDEF
+ PYEXPAT_XMLPARSER_GETBASE_METHODDEF
+ PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF
+ PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF
+ PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF
+#if XML_COMBINED_VERSION >= 19505
+ PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+/* ---------- */
+
+
+
+/* pyexpat international encoding support.
+ Make it as simple as possible.
+*/
+
+static const unsigned char template_buffer[256] =
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
+ 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
+ 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
+ 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
+ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
+ 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
+ 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
+ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
+
+
+static int
+PyUnknownEncodingHandler(void *encodingHandlerData,
+ const XML_Char *name,
+ XML_Encoding *info)
+{
+ PyObject *u;
+ int i;
+ const void *data;
+ int kind;
+
+ if (PyErr_Occurred())
+ return XML_STATUS_ERROR;
+
+ u = PyUnicode_Decode((const char*) template_buffer, 256, name, "replace");
+ if (u == NULL || PyUnicode_READY(u)) {
+ Py_XDECREF(u);
+ return XML_STATUS_ERROR;
+ }
+
+ if (PyUnicode_GET_LENGTH(u) != 256) {
+ Py_DECREF(u);
+ PyErr_SetString(PyExc_ValueError,
+ "multi-byte encodings are not supported");
+ return XML_STATUS_ERROR;
+ }
+
+ kind = PyUnicode_KIND(u);
+ data = PyUnicode_DATA(u);
+ for (i = 0; i < 256; i++) {
+ Py_UCS4 ch = PyUnicode_READ(kind, data, i);
+ if (ch != Py_UNICODE_REPLACEMENT_CHARACTER)
+ info->map[i] = ch;
+ else
+ info->map[i] = -1;
+ }
+
+ info->data = NULL;
+ info->convert = NULL;
+ info->release = NULL;
+ Py_DECREF(u);
+
+ return XML_STATUS_OK;
+}
+
+
+static PyObject *
+newxmlparseobject(pyexpat_state *state, const char *encoding,
+ const char *namespace_separator, PyObject *intern)
+{
+ int i;
+ xmlparseobject *self;
+
+ self = PyObject_GC_New(xmlparseobject, state->xml_parse_type);
+ if (self == NULL)
+ return NULL;
+
+ self->buffer = NULL;
+ self->buffer_size = CHARACTER_DATA_BUFFER_SIZE;
+ self->buffer_used = 0;
+ self->ordered_attributes = 0;
+ self->specified_attributes = 0;
+ self->in_callback = 0;
+ self->ns_prefixes = 0;
+ self->handlers = NULL;
+ self->intern = Py_XNewRef(intern);
+
+ /* namespace_separator is either NULL or contains one char + \0 */
+ self->itself = XML_ParserCreate_MM(encoding, &ExpatMemoryHandler,
+ namespace_separator);
+ if (self->itself == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "XML_ParserCreate failed");
+ Py_DECREF(self);
+ return NULL;
+ }
+#if XML_COMBINED_VERSION >= 20100
+ /* This feature was added upstream in libexpat 2.1.0. */
+ XML_SetHashSalt(self->itself,
+ (unsigned long)_Py_HashSecret.expat.hashsalt);
+#endif
+ XML_SetUserData(self->itself, (void *)self);
+ XML_SetUnknownEncodingHandler(self->itself,
+ (XML_UnknownEncodingHandler) PyUnknownEncodingHandler, NULL);
+
+ for (i = 0; handler_info[i].name != NULL; i++)
+ /* do nothing */;
+
+ self->handlers = PyMem_New(PyObject *, i);
+ if (!self->handlers) {
+ Py_DECREF(self);
+ return PyErr_NoMemory();
+ }
+ clear_handlers(self, 1);
+
+ PyObject_GC_Track(self);
+ return (PyObject*)self;
+}
+
+static int
+xmlparse_traverse(xmlparseobject *op, visitproc visit, void *arg)
+{
+ for (int i = 0; handler_info[i].name != NULL; i++) {
+ Py_VISIT(op->handlers[i]);
+ }
+ Py_VISIT(Py_TYPE(op));
+ return 0;
+}
+
+static int
+xmlparse_clear(xmlparseobject *op)
+{
+ clear_handlers(op, 0);
+ Py_CLEAR(op->intern);
+ return 0;
+}
+
+static void
+xmlparse_dealloc(xmlparseobject *self)
+{
+ PyObject_GC_UnTrack(self);
+ (void)xmlparse_clear(self);
+ if (self->itself != NULL)
+ XML_ParserFree(self->itself);
+ self->itself = NULL;
+
+ if (self->handlers != NULL) {
+ PyMem_Free(self->handlers);
+ self->handlers = NULL;
+ }
+ if (self->buffer != NULL) {
+ PyMem_Free(self->buffer);
+ self->buffer = NULL;
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+
+static PyObject *
+xmlparse_handler_getter(xmlparseobject *self, struct HandlerInfo *hi)
+{
+ assert((hi - handler_info) < (Py_ssize_t)Py_ARRAY_LENGTH(handler_info));
+ int handlernum = (int)(hi - handler_info);
+ PyObject *result = self->handlers[handlernum];
+ if (result == NULL)
+ result = Py_None;
+ return Py_NewRef(result);
+}
+
+static int
+xmlparse_handler_setter(xmlparseobject *self, PyObject *v, struct HandlerInfo *hi)
+{
+ assert((hi - handler_info) < (Py_ssize_t)Py_ARRAY_LENGTH(handler_info));
+ int handlernum = (int)(hi - handler_info);
+ if (v == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
+ return -1;
+ }
+ if (handlernum == CharacterData) {
+ /* If we're changing the character data handler, flush all
+ * cached data with the old handler. Not sure there's a
+ * "right" thing to do, though, but this probably won't
+ * happen.
+ */
+ if (flush_character_buffer(self) < 0)
+ return -1;
+ }
+
+ xmlhandler c_handler = NULL;
+ if (v == Py_None) {
+ /* If this is the character data handler, and a character
+ data handler is already active, we need to be more
+ careful. What we can safely do is replace the existing
+ character data handler callback function with a no-op
+ function that will refuse to call Python. The downside
+ is that this doesn't completely remove the character
+ data handler from the C layer if there's any callback
+ active, so Expat does a little more work than it
+ otherwise would, but that's really an odd case. A more
+ elaborate system of handlers and state could remove the
+ C handler more effectively. */
+ if (handlernum == CharacterData && self->in_callback)
+ c_handler = noop_character_data_handler;
+ v = NULL;
+ }
+ else if (v != NULL) {
+ Py_INCREF(v);
+ c_handler = handler_info[handlernum].handler;
+ }
+ Py_XSETREF(self->handlers[handlernum], v);
+ handler_info[handlernum].setter(self->itself, c_handler);
+ return 0;
+}
+
+#define INT_GETTER(name) \
+ static PyObject * \
+ xmlparse_##name##_getter(xmlparseobject *self, void *closure) \
+ { \
+ return PyLong_FromLong((long) XML_Get##name(self->itself)); \
+ }
+INT_GETTER(ErrorCode)
+INT_GETTER(ErrorLineNumber)
+INT_GETTER(ErrorColumnNumber)
+INT_GETTER(ErrorByteIndex)
+INT_GETTER(CurrentLineNumber)
+INT_GETTER(CurrentColumnNumber)
+INT_GETTER(CurrentByteIndex)
+
+#undef INT_GETTER
+
+static PyObject *
+xmlparse_buffer_text_getter(xmlparseobject *self, void *closure)
+{
+ return PyBool_FromLong(self->buffer != NULL);
+}
+
+static int
+xmlparse_buffer_text_setter(xmlparseobject *self, PyObject *v, void *closure)
+{
+ if (v == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
+ return -1;
+ }
+ int b = PyObject_IsTrue(v);
+ if (b < 0)
+ return -1;
+ if (b) {
+ if (self->buffer == NULL) {
+ self->buffer = PyMem_Malloc(self->buffer_size);
+ if (self->buffer == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->buffer_used = 0;
+ }
+ }
+ else if (self->buffer != NULL) {
+ if (flush_character_buffer(self) < 0)
+ return -1;
+ PyMem_Free(self->buffer);
+ self->buffer = NULL;
+ }
+ return 0;
+}
+
+static PyObject *
+xmlparse_buffer_size_getter(xmlparseobject *self, void *closure)
+{
+ return PyLong_FromLong((long) self->buffer_size);
+}
+
+static int
+xmlparse_buffer_size_setter(xmlparseobject *self, PyObject *v, void *closure)
+{
+ if (v == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
+ return -1;
+ }
+ long new_buffer_size;
+ if (!PyLong_Check(v)) {
+ PyErr_SetString(PyExc_TypeError, "buffer_size must be an integer");
+ return -1;
+ }
+
+ new_buffer_size = PyLong_AsLong(v);
+ if (new_buffer_size <= 0) {
+ if (!PyErr_Occurred())
+ PyErr_SetString(PyExc_ValueError, "buffer_size must be greater than zero");
+ return -1;
+ }
+
+ /* trivial case -- no change */
+ if (new_buffer_size == self->buffer_size) {
+ return 0;
+ }
+
+ /* check maximum */
+ if (new_buffer_size > INT_MAX) {
+ PyErr_Format(PyExc_ValueError, "buffer_size must not be greater than %i", INT_MAX);
+ return -1;
+ }
+
+ if (self->buffer != NULL) {
+ /* there is already a buffer */
+ if (self->buffer_used != 0) {
+ if (flush_character_buffer(self) < 0) {
+ return -1;
+ }
+ }
+ /* free existing buffer */
+ PyMem_Free(self->buffer);
+ }
+ self->buffer = PyMem_Malloc(new_buffer_size);
+ if (self->buffer == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ self->buffer_size = new_buffer_size;
+ return 0;
+}
+
+static PyObject *
+xmlparse_buffer_used_getter(xmlparseobject *self, void *closure)
+{
+ return PyLong_FromLong((long) self->buffer_used);
+}
+
+static PyObject *
+xmlparse_namespace_prefixes_getter(xmlparseobject *self, void *closure)
+{
+ return PyBool_FromLong(self->ns_prefixes);
+}
+
+static int
+xmlparse_namespace_prefixes_setter(xmlparseobject *self, PyObject *v, void *closure)
+{
+ if (v == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
+ return -1;
+ }
+ int b = PyObject_IsTrue(v);
+ if (b < 0)
+ return -1;
+ self->ns_prefixes = b;
+ XML_SetReturnNSTriplet(self->itself, self->ns_prefixes);
+ return 0;
+}
+
+static PyObject *
+xmlparse_ordered_attributes_getter(xmlparseobject *self, void *closure)
+{
+ return PyBool_FromLong(self->ordered_attributes);
+}
+
+static int
+xmlparse_ordered_attributes_setter(xmlparseobject *self, PyObject *v, void *closure)
+{
+ if (v == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
+ return -1;
+ }
+ int b = PyObject_IsTrue(v);
+ if (b < 0)
+ return -1;
+ self->ordered_attributes = b;
+ return 0;
+}
+
+static PyObject *
+xmlparse_specified_attributes_getter(xmlparseobject *self, void *closure)
+{
+ return PyBool_FromLong((long) self->specified_attributes);
+}
+
+static int
+xmlparse_specified_attributes_setter(xmlparseobject *self, PyObject *v, void *closure)
+{
+ if (v == NULL) {
+ PyErr_SetString(PyExc_RuntimeError, "Cannot delete attribute");
+ return -1;
+ }
+ int b = PyObject_IsTrue(v);
+ if (b < 0)
+ return -1;
+ self->specified_attributes = b;
+ return 0;
+}
+
+static PyMemberDef xmlparse_members[] = {
+ {"intern", T_OBJECT, offsetof(xmlparseobject, intern), READONLY, NULL},
+ {NULL}
+};
+
+#define XMLPARSE_GETTER_DEF(name) \
+ {#name, (getter)xmlparse_##name##_getter, NULL, NULL},
+#define XMLPARSE_GETTER_SETTER_DEF(name) \
+ {#name, (getter)xmlparse_##name##_getter, \
+ (setter)xmlparse_##name##_setter, NULL},
+
+static PyGetSetDef xmlparse_getsetlist[] = {
+ XMLPARSE_GETTER_DEF(ErrorCode)
+ XMLPARSE_GETTER_DEF(ErrorLineNumber)
+ XMLPARSE_GETTER_DEF(ErrorColumnNumber)
+ XMLPARSE_GETTER_DEF(ErrorByteIndex)
+ XMLPARSE_GETTER_DEF(CurrentLineNumber)
+ XMLPARSE_GETTER_DEF(CurrentColumnNumber)
+ XMLPARSE_GETTER_DEF(CurrentByteIndex)
+ XMLPARSE_GETTER_SETTER_DEF(buffer_size)
+ XMLPARSE_GETTER_SETTER_DEF(buffer_text)
+ XMLPARSE_GETTER_DEF(buffer_used)
+ XMLPARSE_GETTER_SETTER_DEF(namespace_prefixes)
+ XMLPARSE_GETTER_SETTER_DEF(ordered_attributes)
+ XMLPARSE_GETTER_SETTER_DEF(specified_attributes)
+ {NULL},
+};
+
+#undef XMLPARSE_GETTER_DEF
+#undef XMLPARSE_GETTER_SETTER_DEF
+
+PyDoc_STRVAR(Xmlparsetype__doc__, "XML parser");
+
+static PyType_Slot _xml_parse_type_spec_slots[] = {
+ {Py_tp_dealloc, xmlparse_dealloc},
+ {Py_tp_doc, (void *)Xmlparsetype__doc__},
+ {Py_tp_traverse, xmlparse_traverse},
+ {Py_tp_clear, xmlparse_clear},
+ {Py_tp_methods, xmlparse_methods},
+ {Py_tp_members, xmlparse_members},
+ {Py_tp_getset, xmlparse_getsetlist},
+ {0, 0}
+};
+
+static PyType_Spec _xml_parse_type_spec = {
+ .name = "pyexpat.xmlparser",
+ .basicsize = sizeof(xmlparseobject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = _xml_parse_type_spec_slots,
+};
+
+/* End of code for xmlparser objects */
+/* -------------------------------------------------------- */
+
+/*[clinic input]
+pyexpat.ParserCreate
+
+ encoding: str(accept={str, NoneType}) = None
+ namespace_separator: str(accept={str, NoneType}) = None
+ intern: object = NULL
+
+Return a new XML parser object.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_ParserCreate_impl(PyObject *module, const char *encoding,
+ const char *namespace_separator, PyObject *intern)
+/*[clinic end generated code: output=295c0cf01ab1146c input=e8da8e8d7122cb5d]*/
+{
+ PyObject *result;
+ int intern_decref = 0;
+
+ if (namespace_separator != NULL
+ && strlen(namespace_separator) > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "namespace_separator must be at most one"
+ " character, omitted, or None");
+ return NULL;
+ }
+ /* Explicitly passing None means no interning is desired.
+ Not passing anything means that a new dictionary is used. */
+ if (intern == Py_None)
+ intern = NULL;
+ else if (intern == NULL) {
+ intern = PyDict_New();
+ if (!intern)
+ return NULL;
+ intern_decref = 1;
+ }
+ else if (!PyDict_Check(intern)) {
+ PyErr_SetString(PyExc_TypeError, "intern must be a dictionary");
+ return NULL;
+ }
+
+ pyexpat_state *state = pyexpat_get_state(module);
+ result = newxmlparseobject(state, encoding, namespace_separator, intern);
+ if (intern_decref) {
+ Py_DECREF(intern);
+ }
+ return result;
+}
+
+/*[clinic input]
+pyexpat.ErrorString
+
+ code: long
+ /
+
+Returns string error for given number.
+[clinic start generated code]*/
+
+static PyObject *
+pyexpat_ErrorString_impl(PyObject *module, long code)
+/*[clinic end generated code: output=2feae50d166f2174 input=cc67de010d9e62b3]*/
+{
+ return Py_BuildValue("z", XML_ErrorString((int)code));
+}
+
+/* List of methods defined in the module */
+
+static struct PyMethodDef pyexpat_methods[] = {
+ PYEXPAT_PARSERCREATE_METHODDEF
+ PYEXPAT_ERRORSTRING_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+/* Module docstring */
+
+PyDoc_STRVAR(pyexpat_module_documentation,
+"Python wrapper for Expat parser.");
+
+/* Initialization function for the module */
+
+#ifndef MODULE_NAME
+#define MODULE_NAME "pyexpat"
+#endif
+
+static int init_handler_descrs(pyexpat_state *state)
+{
+ int i;
+ assert(!PyType_HasFeature(state->xml_parse_type, Py_TPFLAGS_VALID_VERSION_TAG));
+ for (i = 0; handler_info[i].name != NULL; i++) {
+ struct HandlerInfo *hi = &handler_info[i];
+ hi->getset.name = hi->name;
+ hi->getset.get = (getter)xmlparse_handler_getter;
+ hi->getset.set = (setter)xmlparse_handler_setter;
+ hi->getset.closure = &handler_info[i];
+
+ PyObject *descr = PyDescr_NewGetSet(state->xml_parse_type, &hi->getset);
+ if (descr == NULL)
+ return -1;
+
+ if (PyDict_SetDefault(state->xml_parse_type->tp_dict, PyDescr_NAME(descr), descr) == NULL) {
+ Py_DECREF(descr);
+ return -1;
+ }
+ Py_DECREF(descr);
+ }
+ return 0;
+}
+
+static PyObject *
+add_submodule(PyObject *mod, const char *fullname)
+{
+ const char *name = strrchr(fullname, '.') + 1;
+
+ PyObject *submodule = PyModule_New(fullname);
+ if (submodule == NULL) {
+ return NULL;
+ }
+
+ PyObject *mod_name = PyUnicode_FromString(fullname);
+ if (mod_name == NULL) {
+ Py_DECREF(submodule);
+ return NULL;
+ }
+
+ if (_PyImport_SetModule(mod_name, submodule) < 0) {
+ Py_DECREF(submodule);
+ Py_DECREF(mod_name);
+ return NULL;
+ }
+ Py_DECREF(mod_name);
+
+ /* gives away the reference to the submodule */
+ if (PyModule_AddObject(mod, name, submodule) < 0) {
+ Py_DECREF(submodule);
+ return NULL;
+ }
+
+ return submodule;
+}
+
+struct ErrorInfo {
+ const char * name; /* Error constant name, e.g. "XML_ERROR_NO_MEMORY" */
+ const char * description; /* Error description as returned by XML_ErrorString(<int>) */
+};
+
+static
+struct ErrorInfo error_info_of[] = {
+ {NULL, NULL}, /* XML_ERROR_NONE (value 0) is not exposed */
+
+ {"XML_ERROR_NO_MEMORY", "out of memory"},
+ {"XML_ERROR_SYNTAX", "syntax error"},
+ {"XML_ERROR_NO_ELEMENTS", "no element found"},
+ {"XML_ERROR_INVALID_TOKEN", "not well-formed (invalid token)"},
+ {"XML_ERROR_UNCLOSED_TOKEN", "unclosed token"},
+ {"XML_ERROR_PARTIAL_CHAR", "partial character"},
+ {"XML_ERROR_TAG_MISMATCH", "mismatched tag"},
+ {"XML_ERROR_DUPLICATE_ATTRIBUTE", "duplicate attribute"},
+ {"XML_ERROR_JUNK_AFTER_DOC_ELEMENT", "junk after document element"},
+ {"XML_ERROR_PARAM_ENTITY_REF", "illegal parameter entity reference"},
+ {"XML_ERROR_UNDEFINED_ENTITY", "undefined entity"},
+ {"XML_ERROR_RECURSIVE_ENTITY_REF", "recursive entity reference"},
+ {"XML_ERROR_ASYNC_ENTITY", "asynchronous entity"},
+ {"XML_ERROR_BAD_CHAR_REF", "reference to invalid character number"},
+ {"XML_ERROR_BINARY_ENTITY_REF", "reference to binary entity"},
+ {"XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF", "reference to external entity in attribute"},
+ {"XML_ERROR_MISPLACED_XML_PI", "XML or text declaration not at start of entity"},
+ {"XML_ERROR_UNKNOWN_ENCODING", "unknown encoding"},
+ {"XML_ERROR_INCORRECT_ENCODING", "encoding specified in XML declaration is incorrect"},
+ {"XML_ERROR_UNCLOSED_CDATA_SECTION", "unclosed CDATA section"},
+ {"XML_ERROR_EXTERNAL_ENTITY_HANDLING", "error in processing external entity reference"},
+ {"XML_ERROR_NOT_STANDALONE", "document is not standalone"},
+ {"XML_ERROR_UNEXPECTED_STATE", "unexpected parser state - please send a bug report"},
+ {"XML_ERROR_ENTITY_DECLARED_IN_PE", "entity declared in parameter entity"},
+ {"XML_ERROR_FEATURE_REQUIRES_XML_DTD", "requested feature requires XML_DTD support in Expat"},
+ {"XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING", "cannot change setting once parsing has begun"},
+
+ /* Added in Expat 1.95.7. */
+ {"XML_ERROR_UNBOUND_PREFIX", "unbound prefix"},
+
+ /* Added in Expat 1.95.8. */
+ {"XML_ERROR_UNDECLARING_PREFIX", "must not undeclare prefix"},
+ {"XML_ERROR_INCOMPLETE_PE", "incomplete markup in parameter entity"},
+ {"XML_ERROR_XML_DECL", "XML declaration not well-formed"},
+ {"XML_ERROR_TEXT_DECL", "text declaration not well-formed"},
+ {"XML_ERROR_PUBLICID", "illegal character(s) in public id"},
+ {"XML_ERROR_SUSPENDED", "parser suspended"},
+ {"XML_ERROR_NOT_SUSPENDED", "parser not suspended"},
+ {"XML_ERROR_ABORTED", "parsing aborted"},
+ {"XML_ERROR_FINISHED", "parsing finished"},
+ {"XML_ERROR_SUSPEND_PE", "cannot suspend in external parameter entity"},
+
+ /* Added in 2.0.0. */
+ {"XML_ERROR_RESERVED_PREFIX_XML", "reserved prefix (xml) must not be undeclared or bound to another namespace name"},
+ {"XML_ERROR_RESERVED_PREFIX_XMLNS", "reserved prefix (xmlns) must not be declared or undeclared"},
+ {"XML_ERROR_RESERVED_NAMESPACE_URI", "prefix must not be bound to one of the reserved namespace names"},
+
+ /* Added in 2.2.1. */
+ {"XML_ERROR_INVALID_ARGUMENT", "invalid argument"},
+
+ /* Added in 2.3.0. */
+ {"XML_ERROR_NO_BUFFER", "a successful prior call to function XML_GetBuffer is required"},
+
+ /* Added in 2.4.0. */
+ {"XML_ERROR_AMPLIFICATION_LIMIT_BREACH", "limit on input amplification factor (from DTD and entities) breached"}
+};
+
+static int
+add_error(PyObject *errors_module, PyObject *codes_dict,
+ PyObject *rev_codes_dict, size_t error_index)
+{
+ const char * const name = error_info_of[error_index].name;
+ const int error_code = (int)error_index;
+
+ /* NOTE: This keeps the source of truth regarding error
+ * messages with libexpat and (by definition) in bulletproof sync
+ * with the other uses of the XML_ErrorString function
+ * elsewhere within this file. pyexpat's copy of the messages
+ * only acts as a fallback in case of outdated runtime libexpat,
+ * where it returns NULL. */
+ const char *error_string = XML_ErrorString(error_code);
+ if (error_string == NULL) {
+ error_string = error_info_of[error_index].description;
+ }
+
+ if (PyModule_AddStringConstant(errors_module, name, error_string) < 0) {
+ return -1;
+ }
+
+ PyObject *num = PyLong_FromLong(error_code);
+ if (num == NULL) {
+ return -1;
+ }
+
+ if (PyDict_SetItemString(codes_dict, error_string, num) < 0) {
+ Py_DECREF(num);
+ return -1;
+ }
+
+ PyObject *str = PyUnicode_FromString(error_string);
+ if (str == NULL) {
+ Py_DECREF(num);
+ return -1;
+ }
+
+ int res = PyDict_SetItem(rev_codes_dict, num, str);
+ Py_DECREF(str);
+ Py_DECREF(num);
+ if (res < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+add_errors_module(PyObject *mod)
+{
+ // add_submodule() returns a borrowed ref.
+ PyObject *errors_module = add_submodule(mod, MODULE_NAME ".errors");
+ if (errors_module == NULL) {
+ return -1;
+ }
+
+ PyObject *codes_dict = PyDict_New();
+ if (codes_dict == NULL) {
+ return -1;
+ }
+ PyObject *rev_codes_dict = PyDict_New();
+ if (rev_codes_dict == NULL) {
+ goto error;
+ }
+
+ size_t error_index = 0;
+ for (; error_index < sizeof(error_info_of) / sizeof(struct ErrorInfo); error_index++) {
+ if (error_info_of[error_index].name == NULL) {
+ continue;
+ }
+
+ if (add_error(errors_module, codes_dict, rev_codes_dict, error_index) < 0) {
+ goto error;
+ }
+ }
+
+ if (PyModule_AddStringConstant(errors_module, "__doc__",
+ "Constants used to describe "
+ "error conditions.") < 0) {
+ goto error;
+ }
+
+ int rc = PyModule_AddObjectRef(errors_module, "codes", codes_dict);
+ Py_CLEAR(codes_dict);
+ if (rc < 0) {
+ goto error;
+ }
+
+ rc = PyModule_AddObjectRef(errors_module, "messages", rev_codes_dict);
+ Py_CLEAR(rev_codes_dict);
+ if (rc < 0) {
+ goto error;
+ }
+
+ return 0;
+
+error:
+ Py_XDECREF(codes_dict);
+ Py_XDECREF(rev_codes_dict);
+ return -1;
+}
+
+static int
+add_model_module(PyObject *mod)
+{
+ PyObject *model_module = add_submodule(mod, MODULE_NAME ".model");
+ if (model_module == NULL) {
+ return -1;
+ }
+
+#define MYCONST(c) do { \
+ if (PyModule_AddIntConstant(model_module, #c, c) < 0) { \
+ return -1; \
+ } \
+ } while(0)
+
+ if (PyModule_AddStringConstant(
+ model_module, "__doc__",
+ "Constants used to interpret content model information.") < 0) {
+ return -1;
+ }
+
+ MYCONST(XML_CTYPE_EMPTY);
+ MYCONST(XML_CTYPE_ANY);
+ MYCONST(XML_CTYPE_MIXED);
+ MYCONST(XML_CTYPE_NAME);
+ MYCONST(XML_CTYPE_CHOICE);
+ MYCONST(XML_CTYPE_SEQ);
+
+ MYCONST(XML_CQUANT_NONE);
+ MYCONST(XML_CQUANT_OPT);
+ MYCONST(XML_CQUANT_REP);
+ MYCONST(XML_CQUANT_PLUS);
+#undef MYCONST
+ return 0;
+}
+
+#if XML_COMBINED_VERSION > 19505
+static int
+add_features(PyObject *mod)
+{
+ PyObject *list = PyList_New(0);
+ if (list == NULL) {
+ return -1;
+ }
+
+ const XML_Feature *features = XML_GetFeatureList();
+ for (size_t i = 0; features[i].feature != XML_FEATURE_END; ++i) {
+ PyObject *item = Py_BuildValue("si", features[i].name,
+ features[i].value);
+ if (item == NULL) {
+ goto error;
+ }
+ int ok = PyList_Append(list, item);
+ Py_DECREF(item);
+ if (ok < 0) {
+ goto error;
+ }
+ }
+ if (PyModule_AddObject(mod, "features", list) < 0) {
+ goto error;
+ }
+ return 0;
+
+error:
+ Py_DECREF(list);
+ return -1;
+}
+#endif
+
+static void
+pyexpat_capsule_destructor(PyObject *capsule)
+{
+ void *p = PyCapsule_GetPointer(capsule, PyExpat_CAPSULE_NAME);
+ if (p == NULL) {
+ PyErr_WriteUnraisable(capsule);
+ return;
+ }
+ PyMem_Free(p);
+}
+
+
+static int
+pyexpat_exec(PyObject *mod)
+{
+ pyexpat_state *state = pyexpat_get_state(mod);
+ state->str_read = PyUnicode_InternFromString("read");
+ if (state->str_read == NULL) {
+ return -1;
+ }
+ state->xml_parse_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ mod, &_xml_parse_type_spec, NULL);
+
+ if (state->xml_parse_type == NULL) {
+ return -1;
+ }
+
+ if (init_handler_descrs(state) < 0) {
+ return -1;
+ }
+ state->error = PyErr_NewException("xml.parsers.expat.ExpatError",
+ NULL, NULL);
+ if (state->error == NULL) {
+ return -1;
+ }
+
+ /* Add some symbolic constants to the module */
+
+ if (PyModule_AddObjectRef(mod, "error", state->error) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddObjectRef(mod, "ExpatError", state->error) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddObjectRef(mod, "XMLParserType",
+ (PyObject *) state->xml_parse_type) < 0) {
+ return -1;
+ }
+
+ if (PyModule_AddStringConstant(mod, "EXPAT_VERSION",
+ XML_ExpatVersion()) < 0) {
+ return -1;
+ }
+ {
+ XML_Expat_Version info = XML_ExpatVersionInfo();
+ PyObject *versionInfo = Py_BuildValue("(iii)",
+ info.major,
+ info.minor,
+ info.micro);
+ if (PyModule_AddObject(mod, "version_info", versionInfo) < 0) {
+ Py_DECREF(versionInfo);
+ return -1;
+ }
+ }
+ /* XXX When Expat supports some way of figuring out how it was
+ compiled, this should check and set native_encoding
+ appropriately.
+ */
+ if (PyModule_AddStringConstant(mod, "native_encoding", "UTF-8") < 0) {
+ return -1;
+ }
+
+ if (add_errors_module(mod) < 0) {
+ return -1;
+ }
+
+ if (add_model_module(mod) < 0) {
+ return -1;
+ }
+
+#if XML_COMBINED_VERSION > 19505
+ if (add_features(mod) < 0) {
+ return -1;
+ }
+#endif
+
+#define MYCONST(c) do { \
+ if (PyModule_AddIntConstant(mod, #c, c) < 0) { \
+ return -1; \
+ } \
+ } while(0)
+
+ MYCONST(XML_PARAM_ENTITY_PARSING_NEVER);
+ MYCONST(XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE);
+ MYCONST(XML_PARAM_ENTITY_PARSING_ALWAYS);
+#undef MYCONST
+
+ struct PyExpat_CAPI *capi = PyMem_Malloc(sizeof(*capi));
+ if (capi == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ /* initialize pyexpat dispatch table */
+ capi->size = sizeof(*capi);
+ capi->magic = PyExpat_CAPI_MAGIC;
+ capi->MAJOR_VERSION = XML_MAJOR_VERSION;
+ capi->MINOR_VERSION = XML_MINOR_VERSION;
+ capi->MICRO_VERSION = XML_MICRO_VERSION;
+ capi->ErrorString = XML_ErrorString;
+ capi->GetErrorCode = XML_GetErrorCode;
+ capi->GetErrorColumnNumber = XML_GetErrorColumnNumber;
+ capi->GetErrorLineNumber = XML_GetErrorLineNumber;
+ capi->Parse = XML_Parse;
+ capi->ParserCreate_MM = XML_ParserCreate_MM;
+ capi->ParserFree = XML_ParserFree;
+ capi->SetCharacterDataHandler = XML_SetCharacterDataHandler;
+ capi->SetCommentHandler = XML_SetCommentHandler;
+ capi->SetDefaultHandlerExpand = XML_SetDefaultHandlerExpand;
+ capi->SetElementHandler = XML_SetElementHandler;
+ capi->SetNamespaceDeclHandler = XML_SetNamespaceDeclHandler;
+ capi->SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
+ capi->SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
+ capi->SetUserData = XML_SetUserData;
+ capi->SetStartDoctypeDeclHandler = XML_SetStartDoctypeDeclHandler;
+ capi->SetEncoding = XML_SetEncoding;
+ capi->DefaultUnknownEncodingHandler = PyUnknownEncodingHandler;
+#if XML_COMBINED_VERSION >= 20100
+ capi->SetHashSalt = XML_SetHashSalt;
+#else
+ capi->SetHashSalt = NULL;
+#endif
+
+ /* export using capsule */
+ PyObject *capi_object = PyCapsule_New(capi, PyExpat_CAPSULE_NAME,
+ pyexpat_capsule_destructor);
+ if (capi_object == NULL) {
+ PyMem_Free(capi);
+ return -1;
+ }
+
+ if (PyModule_AddObject(mod, "expat_CAPI", capi_object) < 0) {
+ Py_DECREF(capi_object);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+pyexpat_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ pyexpat_state *state = pyexpat_get_state(module);
+ Py_VISIT(state->xml_parse_type);
+ Py_VISIT(state->error);
+ Py_VISIT(state->str_read);
+ return 0;
+}
+
+static int
+pyexpat_clear(PyObject *module)
+{
+ pyexpat_state *state = pyexpat_get_state(module);
+ Py_CLEAR(state->xml_parse_type);
+ Py_CLEAR(state->error);
+ Py_CLEAR(state->str_read);
+ return 0;
+}
+
+static void
+pyexpat_free(void *module)
+{
+ pyexpat_clear((PyObject *)module);
+}
+
+static PyModuleDef_Slot pyexpat_slots[] = {
+ {Py_mod_exec, pyexpat_exec},
+ // XXX gh-103092: fix isolation.
+ {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
+ //{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef pyexpatmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = MODULE_NAME,
+ .m_doc = pyexpat_module_documentation,
+ .m_size = sizeof(pyexpat_state),
+ .m_methods = pyexpat_methods,
+ .m_slots = pyexpat_slots,
+ .m_traverse = pyexpat_traverse,
+ .m_clear = pyexpat_clear,
+ .m_free = pyexpat_free
+};
+
+PyMODINIT_FUNC
+PyInit_pyexpat(void)
+{
+ return PyModuleDef_Init(&pyexpatmodule);
+}
+
+static void
+clear_handlers(xmlparseobject *self, int initial)
+{
+ int i = 0;
+
+ for (; handler_info[i].name != NULL; i++) {
+ if (initial)
+ self->handlers[i] = NULL;
+ else {
+ Py_CLEAR(self->handlers[i]);
+ handler_info[i].setter(self->itself, NULL);
+ }
+ }
+}
+
+static struct HandlerInfo handler_info[] = {
+
+#define HANDLER_INFO(name) \
+ {#name, (xmlhandlersetter)XML_Set##name, (xmlhandler)my_##name},
+
+ HANDLER_INFO(StartElementHandler)
+ HANDLER_INFO(EndElementHandler)
+ HANDLER_INFO(ProcessingInstructionHandler)
+ HANDLER_INFO(CharacterDataHandler)
+ HANDLER_INFO(UnparsedEntityDeclHandler)
+ HANDLER_INFO(NotationDeclHandler)
+ HANDLER_INFO(StartNamespaceDeclHandler)
+ HANDLER_INFO(EndNamespaceDeclHandler)
+ HANDLER_INFO(CommentHandler)
+ HANDLER_INFO(StartCdataSectionHandler)
+ HANDLER_INFO(EndCdataSectionHandler)
+ HANDLER_INFO(DefaultHandler)
+ HANDLER_INFO(DefaultHandlerExpand)
+ HANDLER_INFO(NotStandaloneHandler)
+ HANDLER_INFO(ExternalEntityRefHandler)
+ HANDLER_INFO(StartDoctypeDeclHandler)
+ HANDLER_INFO(EndDoctypeDeclHandler)
+ HANDLER_INFO(EntityDeclHandler)
+ HANDLER_INFO(XmlDeclHandler)
+ HANDLER_INFO(ElementDeclHandler)
+ HANDLER_INFO(AttlistDeclHandler)
+#if XML_COMBINED_VERSION >= 19504
+ HANDLER_INFO(SkippedEntityHandler)
+#endif
+
+#undef HANDLER_INFO
+
+ {NULL, NULL, NULL} /* sentinel */
+};
diff --git a/contrib/tools/python3/Modules/resource.c b/contrib/tools/python3/Modules/resource.c
new file mode 100644
index 00000000000..3c89468c48c
--- /dev/null
+++ b/contrib/tools/python3/Modules/resource.c
@@ -0,0 +1,556 @@
+
+#include "Python.h"
+#include <sys/resource.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* On some systems, these aren't in any header file.
+ On others they are, with inconsistent prototypes.
+ We declare the (default) return type, to shut up gcc -Wall;
+ but we can't declare the prototype, to avoid errors
+ when the header files declare it different.
+ Worse, on some Linuxes, getpagesize() returns a size_t... */
+
+#define doubletime(TV) ((double)(TV).tv_sec + (TV).tv_usec * 0.000001)
+
+/*[clinic input]
+module resource
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e89d38ed52609d7c]*/
+
+/*[python input]
+class pid_t_converter(CConverter):
+ type = 'pid_t'
+ format_unit = '" _Py_PARSE_PID "'
+
+ def parse_arg(self, argname, displayname):
+ return """
+ {paramname} = PyLong_AsPid({argname});
+ if ({paramname} == -1 && PyErr_Occurred()) {{{{
+ goto exit;
+ }}}}
+ """.format(argname=argname, paramname=self.parser_name)
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=5af1c116d56cbb5a]*/
+
+#include "clinic/resource.c.h"
+
+PyDoc_STRVAR(struct_rusage__doc__,
+"struct_rusage: Result from getrusage.\n\n"
+"This object may be accessed either as a tuple of\n"
+" (utime,stime,maxrss,ixrss,idrss,isrss,minflt,majflt,\n"
+" nswap,inblock,oublock,msgsnd,msgrcv,nsignals,nvcsw,nivcsw)\n"
+"or via the attributes ru_utime, ru_stime, ru_maxrss, and so on.");
+
+static PyStructSequence_Field struct_rusage_fields[] = {
+ {"ru_utime", "user time used"},
+ {"ru_stime", "system time used"},
+ {"ru_maxrss", "max. resident set size"},
+ {"ru_ixrss", "shared memory size"},
+ {"ru_idrss", "unshared data size"},
+ {"ru_isrss", "unshared stack size"},
+ {"ru_minflt", "page faults not requiring I/O"},
+ {"ru_majflt", "page faults requiring I/O"},
+ {"ru_nswap", "number of swap outs"},
+ {"ru_inblock", "block input operations"},
+ {"ru_oublock", "block output operations"},
+ {"ru_msgsnd", "IPC messages sent"},
+ {"ru_msgrcv", "IPC messages received"},
+ {"ru_nsignals", "signals received"},
+ {"ru_nvcsw", "voluntary context switches"},
+ {"ru_nivcsw", "involuntary context switches"},
+ {0}
+};
+
+static PyStructSequence_Desc struct_rusage_desc = {
+ "resource.struct_rusage", /* name */
+ struct_rusage__doc__, /* doc */
+ struct_rusage_fields, /* fields */
+ 16 /* n_in_sequence */
+};
+
+typedef struct {
+ PyTypeObject *StructRUsageType;
+} resourcemodulestate;
+
+
+static inline resourcemodulestate*
+get_resource_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (resourcemodulestate *)state;
+}
+
+static struct PyModuleDef resourcemodule;
+
+#ifdef HAVE_GETRUSAGE
+/*[clinic input]
+resource.getrusage
+
+ who: int
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+resource_getrusage_impl(PyObject *module, int who)
+/*[clinic end generated code: output=8fad2880ba6a9843 input=5c857bcc5b9ccb1b]*/
+{
+ struct rusage ru;
+ PyObject *result;
+
+ if (getrusage(who, &ru) == -1) {
+ if (errno == EINVAL) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid who parameter");
+ return NULL;
+ }
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ result = PyStructSequence_New(
+ get_resource_state(module)->StructRUsageType);
+ if (!result)
+ return NULL;
+
+ PyStructSequence_SET_ITEM(result, 0,
+ PyFloat_FromDouble(doubletime(ru.ru_utime)));
+ PyStructSequence_SET_ITEM(result, 1,
+ PyFloat_FromDouble(doubletime(ru.ru_stime)));
+ PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(ru.ru_maxrss));
+ PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(ru.ru_ixrss));
+ PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(ru.ru_idrss));
+ PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(ru.ru_isrss));
+ PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(ru.ru_minflt));
+ PyStructSequence_SET_ITEM(result, 7, PyLong_FromLong(ru.ru_majflt));
+ PyStructSequence_SET_ITEM(result, 8, PyLong_FromLong(ru.ru_nswap));
+ PyStructSequence_SET_ITEM(result, 9, PyLong_FromLong(ru.ru_inblock));
+ PyStructSequence_SET_ITEM(result, 10, PyLong_FromLong(ru.ru_oublock));
+ PyStructSequence_SET_ITEM(result, 11, PyLong_FromLong(ru.ru_msgsnd));
+ PyStructSequence_SET_ITEM(result, 12, PyLong_FromLong(ru.ru_msgrcv));
+ PyStructSequence_SET_ITEM(result, 13, PyLong_FromLong(ru.ru_nsignals));
+ PyStructSequence_SET_ITEM(result, 14, PyLong_FromLong(ru.ru_nvcsw));
+ PyStructSequence_SET_ITEM(result, 15, PyLong_FromLong(ru.ru_nivcsw));
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+#endif
+
+static int
+py2rlimit(PyObject *limits, struct rlimit *rl_out)
+{
+ PyObject *curobj, *maxobj;
+ limits = PySequence_Tuple(limits);
+ if (!limits)
+ /* Here limits is a borrowed reference */
+ return -1;
+
+ if (PyTuple_GET_SIZE(limits) != 2) {
+ PyErr_SetString(PyExc_ValueError,
+ "expected a tuple of 2 integers");
+ goto error;
+ }
+ curobj = PyTuple_GET_ITEM(limits, 0);
+ maxobj = PyTuple_GET_ITEM(limits, 1);
+#if !defined(HAVE_LARGEFILE_SUPPORT)
+ rl_out->rlim_cur = PyLong_AsLong(curobj);
+ if (rl_out->rlim_cur == (rlim_t)-1 && PyErr_Occurred())
+ goto error;
+ rl_out->rlim_max = PyLong_AsLong(maxobj);
+ if (rl_out->rlim_max == (rlim_t)-1 && PyErr_Occurred())
+ goto error;
+#else
+ /* The limits are probably bigger than a long */
+ rl_out->rlim_cur = PyLong_AsLongLong(curobj);
+ if (rl_out->rlim_cur == (rlim_t)-1 && PyErr_Occurred())
+ goto error;
+ rl_out->rlim_max = PyLong_AsLongLong(maxobj);
+ if (rl_out->rlim_max == (rlim_t)-1 && PyErr_Occurred())
+ goto error;
+#endif
+
+ Py_DECREF(limits);
+ rl_out->rlim_cur = rl_out->rlim_cur & RLIM_INFINITY;
+ rl_out->rlim_max = rl_out->rlim_max & RLIM_INFINITY;
+ return 0;
+
+error:
+ Py_DECREF(limits);
+ return -1;
+}
+
+static PyObject*
+rlimit2py(struct rlimit rl)
+{
+ if (sizeof(rl.rlim_cur) > sizeof(long)) {
+ return Py_BuildValue("LL",
+ (long long) rl.rlim_cur,
+ (long long) rl.rlim_max);
+ }
+ return Py_BuildValue("ll", (long) rl.rlim_cur, (long) rl.rlim_max);
+}
+
+/*[clinic input]
+resource.getrlimit
+
+ resource: int
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+resource_getrlimit_impl(PyObject *module, int resource)
+/*[clinic end generated code: output=98327b25061ffe39 input=a697cb0004cb3c36]*/
+{
+ struct rlimit rl;
+
+ if (resource < 0 || resource >= RLIM_NLIMITS) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid resource specified");
+ return NULL;
+ }
+
+ if (getrlimit(resource, &rl) == -1) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return rlimit2py(rl);
+}
+
+/*[clinic input]
+resource.setrlimit
+
+ resource: int
+ limits: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+resource_setrlimit_impl(PyObject *module, int resource, PyObject *limits)
+/*[clinic end generated code: output=4e82ec3f34d013d1 input=6235a6ce23b4ca75]*/
+{
+ struct rlimit rl;
+
+ if (resource < 0 || resource >= RLIM_NLIMITS) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid resource specified");
+ return NULL;
+ }
+
+ if (PySys_Audit("resource.setrlimit", "iO", resource,
+ limits ? limits : Py_None) < 0) {
+ return NULL;
+ }
+
+ if (py2rlimit(limits, &rl) < 0) {
+ return NULL;
+ }
+
+ if (setrlimit(resource, &rl) == -1) {
+ if (errno == EINVAL)
+ PyErr_SetString(PyExc_ValueError,
+ "current limit exceeds maximum limit");
+ else if (errno == EPERM)
+ PyErr_SetString(PyExc_ValueError,
+ "not allowed to raise maximum limit");
+ else
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+#ifdef HAVE_PRLIMIT
+/*[clinic input]
+resource.prlimit
+
+ pid: pid_t
+ resource: int
+ limits: object = None
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+resource_prlimit_impl(PyObject *module, pid_t pid, int resource,
+ PyObject *limits)
+/*[clinic end generated code: output=6ebc49ff8c3a816e input=54bb69c9585e33bf]*/
+{
+ struct rlimit old_limit, new_limit;
+ int retval;
+
+ if (resource < 0 || resource >= RLIM_NLIMITS) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid resource specified");
+ return NULL;
+ }
+
+ if (PySys_Audit("resource.prlimit", "iiO", pid, resource,
+ limits ? limits : Py_None) < 0) {
+ return NULL;
+ }
+
+ if (limits != Py_None) {
+ if (py2rlimit(limits, &new_limit) < 0) {
+ return NULL;
+ }
+ retval = prlimit(pid, resource, &new_limit, &old_limit);
+ }
+ else {
+ retval = prlimit(pid, resource, NULL, &old_limit);
+ }
+
+ if (retval == -1) {
+ if (errno == EINVAL) {
+ PyErr_SetString(PyExc_ValueError,
+ "current limit exceeds maximum limit");
+ } else {
+ PyErr_SetFromErrno(PyExc_OSError);
+ }
+ return NULL;
+ }
+ return rlimit2py(old_limit);
+}
+#endif /* HAVE_PRLIMIT */
+
+/*[clinic input]
+resource.getpagesize -> int
+[clinic start generated code]*/
+
+static int
+resource_getpagesize_impl(PyObject *module)
+/*[clinic end generated code: output=9ba93eb0f3d6c3a9 input=546545e8c1f42085]*/
+{
+ long pagesize = 0;
+#if defined(HAVE_GETPAGESIZE)
+ pagesize = getpagesize();
+#elif defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE)
+ pagesize = sysconf(_SC_PAGE_SIZE);
+#else
+# error "unsupported platform: resource.getpagesize()"
+#endif
+ return pagesize;
+}
+
+/* List of functions */
+
+static struct PyMethodDef
+resource_methods[] = {
+ RESOURCE_GETRUSAGE_METHODDEF
+ RESOURCE_GETRLIMIT_METHODDEF
+ RESOURCE_PRLIMIT_METHODDEF
+ RESOURCE_SETRLIMIT_METHODDEF
+ RESOURCE_GETPAGESIZE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* Module initialization */
+
+static int
+resource_exec(PyObject *module)
+{
+ resourcemodulestate *state = get_resource_state(module);
+#define ADD_INT(module, value) \
+ do { \
+ if (PyModule_AddIntConstant(module, #value, value) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+
+ /* Add some symbolic constants to the module */
+ Py_INCREF(PyExc_OSError);
+ if (PyModule_AddObject(module, "error", PyExc_OSError) < 0) {
+ Py_DECREF(PyExc_OSError);
+ return -1;
+ }
+
+ state->StructRUsageType = PyStructSequence_NewType(&struct_rusage_desc);
+ if (state->StructRUsageType == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->StructRUsageType) < 0) {
+ return -1;
+ }
+
+ /* insert constants */
+#ifdef RLIMIT_CPU
+ ADD_INT(module, RLIMIT_CPU);
+#endif
+
+#ifdef RLIMIT_FSIZE
+ ADD_INT(module, RLIMIT_FSIZE);
+#endif
+
+#ifdef RLIMIT_DATA
+ ADD_INT(module, RLIMIT_DATA);
+#endif
+
+#ifdef RLIMIT_STACK
+ ADD_INT(module, RLIMIT_STACK);
+#endif
+
+#ifdef RLIMIT_CORE
+ ADD_INT(module, RLIMIT_CORE);
+#endif
+
+#ifdef RLIMIT_NOFILE
+ ADD_INT(module, RLIMIT_NOFILE);
+#endif
+
+#ifdef RLIMIT_OFILE
+ ADD_INT(module, RLIMIT_OFILE);
+#endif
+
+#ifdef RLIMIT_VMEM
+ ADD_INT(module, RLIMIT_VMEM);
+#endif
+
+#ifdef RLIMIT_AS
+ ADD_INT(module, RLIMIT_AS);
+#endif
+
+#ifdef RLIMIT_RSS
+ ADD_INT(module, RLIMIT_RSS);
+#endif
+
+#ifdef RLIMIT_NPROC
+ ADD_INT(module, RLIMIT_NPROC);
+#endif
+
+#ifdef RLIMIT_MEMLOCK
+ ADD_INT(module, RLIMIT_MEMLOCK);
+#endif
+
+#ifdef RLIMIT_SBSIZE
+ ADD_INT(module, RLIMIT_SBSIZE);
+#endif
+
+/* Linux specific */
+#ifdef RLIMIT_MSGQUEUE
+ ADD_INT(module, RLIMIT_MSGQUEUE);
+#endif
+
+#ifdef RLIMIT_NICE
+ ADD_INT(module, RLIMIT_NICE);
+#endif
+
+#ifdef RLIMIT_RTPRIO
+ ADD_INT(module, RLIMIT_RTPRIO);
+#endif
+
+#ifdef RLIMIT_RTTIME
+ ADD_INT(module, RLIMIT_RTTIME);
+#endif
+
+#ifdef RLIMIT_SIGPENDING
+ ADD_INT(module, RLIMIT_SIGPENDING);
+#endif
+
+/* target */
+#ifdef RUSAGE_SELF
+ ADD_INT(module, RUSAGE_SELF);
+#endif
+
+#ifdef RUSAGE_CHILDREN
+ ADD_INT(module, RUSAGE_CHILDREN);
+#endif
+
+#ifdef RUSAGE_BOTH
+ ADD_INT(module, RUSAGE_BOTH);
+#endif
+
+#ifdef RUSAGE_THREAD
+ ADD_INT(module, RUSAGE_THREAD);
+#endif
+
+/* FreeBSD specific */
+
+#ifdef RLIMIT_SWAP
+ ADD_INT(module, RLIMIT_SWAP);
+#endif
+
+#ifdef RLIMIT_SBSIZE
+ ADD_INT(module, RLIMIT_SBSIZE);
+#endif
+
+#ifdef RLIMIT_NPTS
+ ADD_INT(module, RLIMIT_NPTS);
+#endif
+
+#ifdef RLIMIT_KQUEUES
+ ADD_INT(module, RLIMIT_KQUEUES);
+#endif
+
+ PyObject *v;
+ if (sizeof(RLIM_INFINITY) > sizeof(long)) {
+ v = PyLong_FromLongLong((long long) RLIM_INFINITY);
+ } else
+ {
+ v = PyLong_FromLong((long) RLIM_INFINITY);
+ }
+ if (!v) {
+ return -1;
+ }
+
+ if (PyModule_AddObject(module, "RLIM_INFINITY", v) < 0) {
+ Py_DECREF(v);
+ return -1;
+ }
+ return 0;
+
+#undef ADD_INT
+}
+
+static struct PyModuleDef_Slot resource_slots[] = {
+ {Py_mod_exec, resource_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int
+resourcemodule_traverse(PyObject *m, visitproc visit, void *arg) {
+ Py_VISIT(get_resource_state(m)->StructRUsageType);
+ return 0;
+}
+
+static int
+resourcemodule_clear(PyObject *m) {
+ Py_CLEAR(get_resource_state(m)->StructRUsageType);
+ return 0;
+}
+
+static void
+resourcemodule_free(void *m) {
+ resourcemodule_clear((PyObject *)m);
+}
+
+static struct PyModuleDef resourcemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "resource",
+ .m_size = sizeof(resourcemodulestate),
+ .m_methods = resource_methods,
+ .m_slots = resource_slots,
+ .m_traverse = resourcemodule_traverse,
+ .m_clear = resourcemodule_clear,
+ .m_free = resourcemodule_free,
+};
+
+PyMODINIT_FUNC
+PyInit_resource(void)
+{
+ return PyModuleDef_Init(&resourcemodule);
+}
diff --git a/contrib/tools/python3/Modules/rotatingtree.c b/contrib/tools/python3/Modules/rotatingtree.c
new file mode 100644
index 00000000000..07e08bc3167
--- /dev/null
+++ b/contrib/tools/python3/Modules/rotatingtree.c
@@ -0,0 +1,121 @@
+#include "rotatingtree.h"
+
+#define KEY_LOWER_THAN(key1, key2) ((char*)(key1) < (char*)(key2))
+
+/* The randombits() function below is a fast-and-dirty generator that
+ * is probably irregular enough for our purposes. Note that it's biased:
+ * I think that ones are slightly more probable than zeroes. It's not
+ * important here, though.
+ */
+
+static unsigned int random_value = 1;
+static unsigned int random_stream = 0;
+
+static int
+randombits(int bits)
+{
+ int result;
+ if (random_stream < (1U << bits)) {
+ random_value *= 1082527;
+ random_stream = random_value;
+ }
+ result = random_stream & ((1<<bits)-1);
+ random_stream >>= bits;
+ return result;
+}
+
+
+/* Insert a new node into the tree.
+ (*root) is modified to point to the new root. */
+void
+RotatingTree_Add(rotating_node_t **root, rotating_node_t *node)
+{
+ while (*root != NULL) {
+ if (KEY_LOWER_THAN(node->key, (*root)->key))
+ root = &((*root)->left);
+ else
+ root = &((*root)->right);
+ }
+ node->left = NULL;
+ node->right = NULL;
+ *root = node;
+}
+
+/* Locate the node with the given key. This is the most complicated
+ function because it occasionally rebalances the tree to move the
+ resulting node closer to the root. */
+rotating_node_t *
+RotatingTree_Get(rotating_node_t **root, void *key)
+{
+ if (randombits(3) != 4) {
+ /* Fast path, no rebalancing */
+ rotating_node_t *node = *root;
+ while (node != NULL) {
+ if (node->key == key)
+ return node;
+ if (KEY_LOWER_THAN(key, node->key))
+ node = node->left;
+ else
+ node = node->right;
+ }
+ return NULL;
+ }
+ else {
+ rotating_node_t **pnode = root;
+ rotating_node_t *node = *pnode;
+ rotating_node_t *next;
+ int rotate;
+ if (node == NULL)
+ return NULL;
+ while (1) {
+ if (node->key == key)
+ return node;
+ rotate = !randombits(1);
+ if (KEY_LOWER_THAN(key, node->key)) {
+ next = node->left;
+ if (next == NULL)
+ return NULL;
+ if (rotate) {
+ node->left = next->right;
+ next->right = node;
+ *pnode = next;
+ }
+ else
+ pnode = &(node->left);
+ }
+ else {
+ next = node->right;
+ if (next == NULL)
+ return NULL;
+ if (rotate) {
+ node->right = next->left;
+ next->left = node;
+ *pnode = next;
+ }
+ else
+ pnode = &(node->right);
+ }
+ node = next;
+ }
+ }
+}
+
+/* Enumerate all nodes in the tree. The callback enumfn() should return
+ zero to continue the enumeration, or non-zero to interrupt it.
+ A non-zero value is directly returned by RotatingTree_Enum(). */
+int
+RotatingTree_Enum(rotating_node_t *root, rotating_tree_enum_fn enumfn,
+ void *arg)
+{
+ int result;
+ rotating_node_t *node;
+ while (root != NULL) {
+ result = RotatingTree_Enum(root->left, enumfn, arg);
+ if (result != 0) return result;
+ node = root->right;
+ result = enumfn(root, arg);
+ if (result != 0) return result;
+ root = node;
+ }
+ return 0;
+}
diff --git a/contrib/tools/python3/Modules/rotatingtree.h b/contrib/tools/python3/Modules/rotatingtree.h
new file mode 100644
index 00000000000..7b3e5fde921
--- /dev/null
+++ b/contrib/tools/python3/Modules/rotatingtree.h
@@ -0,0 +1,27 @@
+/* "Rotating trees" (Armin Rigo)
+ *
+ * Google "splay trees" for the general idea.
+ *
+ * It's a dict-like data structure that works best when accesses are not
+ * random, but follow a strong pattern. The one implemented here is for
+ * access patterns where the same small set of keys is looked up over
+ * and over again, and this set of keys evolves slowly over time.
+ */
+
+#include <stdlib.h>
+
+#define EMPTY_ROTATING_TREE ((rotating_node_t *)NULL)
+
+typedef struct rotating_node_s rotating_node_t;
+typedef int (*rotating_tree_enum_fn) (rotating_node_t *node, void *arg);
+
+struct rotating_node_s {
+ void *key;
+ rotating_node_t *left;
+ rotating_node_t *right;
+};
+
+void RotatingTree_Add(rotating_node_t **root, rotating_node_t *node);
+rotating_node_t* RotatingTree_Get(rotating_node_t **root, void *key);
+int RotatingTree_Enum(rotating_node_t *root, rotating_tree_enum_fn enumfn,
+ void *arg);
diff --git a/contrib/tools/python3/Modules/selectmodule.c b/contrib/tools/python3/Modules/selectmodule.c
new file mode 100644
index 00000000000..b7c6b1b5399
--- /dev/null
+++ b/contrib/tools/python3/Modules/selectmodule.c
@@ -0,0 +1,2807 @@
+/* select - Module containing unix select(2) call.
+ Under Unix, the file descriptors are small integers.
+ Under Win32, select only exists for sockets, and sockets may
+ have any value except INVALID_SOCKET.
+*/
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#if defined(HAVE_POLL_H) && !defined(_GNU_SOURCE)
+# define _GNU_SOURCE
+#endif
+
+#include "Python.h"
+#include "pycore_fileutils.h" // _Py_set_inheritable()
+#include "pycore_import.h" // _PyImport_GetModuleAttrString()
+#include "pycore_time.h" // _PyTime_t
+#include "structmember.h" // PyMemberDef
+
+#include <stdbool.h>
+#include <stddef.h> // offsetof()
+#ifndef MS_WINDOWS
+# include <unistd.h> // close()
+#endif
+
+#ifdef HAVE_SYS_DEVPOLL_H
+#include <sys/resource.h>
+#include <sys/devpoll.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#endif
+
+#ifdef __APPLE__
+ /* Perform runtime testing for a broken poll on OSX to make it easier
+ * to use the same binary on multiple releases of the OS.
+ */
+#undef HAVE_BROKEN_POLL
+#endif
+
+/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined.
+ 64 is too small (too many people have bumped into that limit).
+ Here we boost it.
+ Users who want even more than the boosted limit should #define
+ FD_SETSIZE higher before this; e.g., via compiler /D switch.
+*/
+#if defined(MS_WINDOWS) && !defined(FD_SETSIZE)
+#define FD_SETSIZE 512
+#endif
+
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+
+#ifdef __sgi
+/* This is missing from unistd.h */
+extern void bzero(void *, int);
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef MS_WINDOWS
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <winsock2.h>
+#else
+# define SOCKET int
+#endif
+
+// WASI SDK 16 does not have POLLPRIO, define as no-op
+#if defined(__wasi__) && !defined(POLLPRI)
+# define POLLPRI 0
+#endif
+
+#ifdef HAVE_KQUEUE
+// Linked list to track kqueue objects with an open fd, so
+// that we can invalidate them at fork;
+typedef struct _kqueue_list_item {
+ struct kqueue_queue_Object *obj;
+ struct _kqueue_list_item *next;
+} _kqueue_list_item, *_kqueue_list;
+#endif
+
+typedef struct {
+ PyObject *close;
+ PyTypeObject *poll_Type;
+ PyTypeObject *devpoll_Type;
+ PyTypeObject *pyEpoll_Type;
+#ifdef HAVE_KQUEUE
+ PyTypeObject *kqueue_event_Type;
+ PyTypeObject *kqueue_queue_Type;
+ _kqueue_list kqueue_open_list;
+ bool kqueue_tracking_initialized;
+#endif
+} _selectstate;
+
+static struct PyModuleDef selectmodule;
+
+static inline _selectstate*
+get_select_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (_selectstate *)state;
+}
+
+#define _selectstate_by_type(type) get_select_state(PyType_GetModule(type))
+
+/*[clinic input]
+module select
+class select.poll "pollObject *" "_selectstate_by_type(type)->poll_Type"
+class select.devpoll "devpollObject *" "_selectstate_by_type(type)->devpoll_Type"
+class select.epoll "pyEpoll_Object *" "_selectstate_by_type(type)->pyEpoll_Type"
+class select.kqueue "kqueue_queue_Object *" "_selectstate_by_type(type)->kqueue_queue_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=8072de35824aa327]*/
+
+/* list of Python objects and their file descriptor */
+typedef struct {
+ PyObject *obj; /* owned reference */
+ SOCKET fd;
+ int sentinel; /* -1 == sentinel */
+} pylist;
+
+static void
+reap_obj(pylist fd2obj[FD_SETSIZE + 1])
+{
+ unsigned int i;
+ for (i = 0; i < (unsigned int)FD_SETSIZE + 1 && fd2obj[i].sentinel >= 0; i++) {
+ Py_CLEAR(fd2obj[i].obj);
+ }
+ fd2obj[0].sentinel = -1;
+}
+
+
+/* returns -1 and sets the Python exception if an error occurred, otherwise
+ returns a number >= 0
+*/
+static int
+seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
+{
+ int max = -1;
+ unsigned int index = 0;
+ Py_ssize_t i;
+ PyObject* fast_seq = NULL;
+ PyObject* o = NULL;
+
+ fd2obj[0].obj = (PyObject*)0; /* set list to zero size */
+ FD_ZERO(set);
+
+ fast_seq = PySequence_Fast(seq, "arguments 1-3 must be sequences");
+ if (!fast_seq)
+ return -1;
+
+ for (i = 0; i < PySequence_Fast_GET_SIZE(fast_seq); i++) {
+ SOCKET v;
+
+ /* any intervening fileno() calls could decr this refcnt */
+ if (!(o = PySequence_Fast_GET_ITEM(fast_seq, i)))
+ goto finally;
+
+ Py_INCREF(o);
+ v = PyObject_AsFileDescriptor( o );
+ if (v == -1) goto finally;
+
+#if defined(_MSC_VER)
+ max = 0; /* not used for Win32 */
+#else /* !_MSC_VER */
+ if (!_PyIsSelectable_fd(v)) {
+ PyErr_SetString(PyExc_ValueError,
+ "filedescriptor out of range in select()");
+ goto finally;
+ }
+ if (v > max)
+ max = v;
+#endif /* _MSC_VER */
+ FD_SET(v, set);
+
+ /* add object and its file descriptor to the list */
+ if (index >= (unsigned int)FD_SETSIZE) {
+ PyErr_SetString(PyExc_ValueError,
+ "too many file descriptors in select()");
+ goto finally;
+ }
+ fd2obj[index].obj = o;
+ fd2obj[index].fd = v;
+ fd2obj[index].sentinel = 0;
+ fd2obj[++index].sentinel = -1;
+ }
+ Py_DECREF(fast_seq);
+ return max+1;
+
+ finally:
+ Py_XDECREF(o);
+ Py_DECREF(fast_seq);
+ return -1;
+}
+
+/* returns NULL and sets the Python exception if an error occurred */
+static PyObject *
+set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
+{
+ int i, j, count=0;
+ PyObject *list, *o;
+ SOCKET fd;
+
+ for (j = 0; fd2obj[j].sentinel >= 0; j++) {
+ if (FD_ISSET(fd2obj[j].fd, set))
+ count++;
+ }
+ list = PyList_New(count);
+ if (!list)
+ return NULL;
+
+ i = 0;
+ for (j = 0; fd2obj[j].sentinel >= 0; j++) {
+ fd = fd2obj[j].fd;
+ if (FD_ISSET(fd, set)) {
+ o = fd2obj[j].obj;
+ fd2obj[j].obj = NULL;
+ /* transfer ownership */
+ if (PyList_SetItem(list, i, o) < 0)
+ goto finally;
+
+ i++;
+ }
+ }
+ return list;
+ finally:
+ Py_DECREF(list);
+ return NULL;
+}
+
+#undef SELECT_USES_HEAP
+#if FD_SETSIZE > 1024
+#define SELECT_USES_HEAP
+#endif /* FD_SETSIZE > 1024 */
+
+/*[clinic input]
+select.select
+
+ rlist: object
+ wlist: object
+ xlist: object
+ timeout as timeout_obj: object = None
+ /
+
+Wait until one or more file descriptors are ready for some kind of I/O.
+
+The first three arguments are iterables of file descriptors to be waited for:
+rlist -- wait until ready for reading
+wlist -- wait until ready for writing
+xlist -- wait for an "exceptional condition"
+If only one kind of condition is required, pass [] for the other lists.
+
+A file descriptor is either a socket or file object, or a small integer
+gotten from a fileno() method call on one of those.
+
+The optional 4th argument specifies a timeout in seconds; it may be
+a floating point number to specify fractions of seconds. If it is absent
+or None, the call will never time out.
+
+The return value is a tuple of three lists corresponding to the first three
+arguments; each contains the subset of the corresponding file descriptors
+that are ready.
+
+*** IMPORTANT NOTICE ***
+On Windows, only sockets are supported; on Unix, all file
+descriptors can be used.
+[clinic start generated code]*/
+
+static PyObject *
+select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
+ PyObject *xlist, PyObject *timeout_obj)
+/*[clinic end generated code: output=2b3cfa824f7ae4cf input=e467f5d68033de00]*/
+{
+#ifdef SELECT_USES_HEAP
+ pylist *rfd2obj, *wfd2obj, *efd2obj;
+#else /* !SELECT_USES_HEAP */
+ /* XXX: All this should probably be implemented as follows:
+ * - find the highest descriptor we're interested in
+ * - add one
+ * - that's the size
+ * See: Stevens, APitUE, $12.5.1
+ */
+ pylist rfd2obj[FD_SETSIZE + 1];
+ pylist wfd2obj[FD_SETSIZE + 1];
+ pylist efd2obj[FD_SETSIZE + 1];
+#endif /* SELECT_USES_HEAP */
+ PyObject *ret = NULL;
+ fd_set ifdset, ofdset, efdset;
+ struct timeval tv, *tvp;
+ int imax, omax, emax, max;
+ int n;
+ _PyTime_t timeout, deadline = 0;
+
+ if (timeout_obj == Py_None)
+ tvp = (struct timeval *)NULL;
+ else {
+ if (_PyTime_FromSecondsObject(&timeout, timeout_obj,
+ _PyTime_ROUND_TIMEOUT) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "timeout must be a float or None");
+ }
+ return NULL;
+ }
+
+ if (_PyTime_AsTimeval(timeout, &tv, _PyTime_ROUND_TIMEOUT) == -1)
+ return NULL;
+ if (tv.tv_sec < 0) {
+ PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
+ return NULL;
+ }
+ tvp = &tv;
+ }
+
+#ifdef SELECT_USES_HEAP
+ /* Allocate memory for the lists */
+ rfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 1);
+ wfd2obj = PyMem_NEW(pylist, FD_SETSIZE + 1);
+ efd2obj = PyMem_NEW(pylist, FD_SETSIZE + 1);
+ if (rfd2obj == NULL || wfd2obj == NULL || efd2obj == NULL) {
+ if (rfd2obj) PyMem_Free(rfd2obj);
+ if (wfd2obj) PyMem_Free(wfd2obj);
+ if (efd2obj) PyMem_Free(efd2obj);
+ return PyErr_NoMemory();
+ }
+#endif /* SELECT_USES_HEAP */
+
+ /* Convert iterables to fd_sets, and get maximum fd number
+ * propagates the Python exception set in seq2set()
+ */
+ rfd2obj[0].sentinel = -1;
+ wfd2obj[0].sentinel = -1;
+ efd2obj[0].sentinel = -1;
+ if ((imax = seq2set(rlist, &ifdset, rfd2obj)) < 0)
+ goto finally;
+ if ((omax = seq2set(wlist, &ofdset, wfd2obj)) < 0)
+ goto finally;
+ if ((emax = seq2set(xlist, &efdset, efd2obj)) < 0)
+ goto finally;
+
+ max = imax;
+ if (omax > max) max = omax;
+ if (emax > max) max = emax;
+
+ if (tvp) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ errno = 0;
+ n = select(
+ max,
+ imax ? &ifdset : NULL,
+ omax ? &ofdset : NULL,
+ emax ? &efdset : NULL,
+ tvp);
+ Py_END_ALLOW_THREADS
+
+ if (errno != EINTR)
+ break;
+
+ /* select() was interrupted by a signal */
+ if (PyErr_CheckSignals())
+ goto finally;
+
+ if (tvp) {
+ timeout = _PyDeadline_Get(deadline);
+ if (timeout < 0) {
+ /* bpo-35310: lists were unmodified -- clear them explicitly */
+ FD_ZERO(&ifdset);
+ FD_ZERO(&ofdset);
+ FD_ZERO(&efdset);
+ n = 0;
+ break;
+ }
+ _PyTime_AsTimeval_clamp(timeout, &tv, _PyTime_ROUND_CEILING);
+ /* retry select() with the recomputed timeout */
+ }
+ } while (1);
+
+#ifdef MS_WINDOWS
+ if (n == SOCKET_ERROR) {
+ PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+ }
+#else
+ if (n < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ }
+#endif
+ else {
+ /* any of these three calls can raise an exception. it's more
+ convenient to test for this after all three calls... but
+ is that acceptable?
+ */
+ rlist = set2list(&ifdset, rfd2obj);
+ wlist = set2list(&ofdset, wfd2obj);
+ xlist = set2list(&efdset, efd2obj);
+ if (PyErr_Occurred())
+ ret = NULL;
+ else
+ ret = PyTuple_Pack(3, rlist, wlist, xlist);
+
+ Py_XDECREF(rlist);
+ Py_XDECREF(wlist);
+ Py_XDECREF(xlist);
+ }
+
+ finally:
+ reap_obj(rfd2obj);
+ reap_obj(wfd2obj);
+ reap_obj(efd2obj);
+#ifdef SELECT_USES_HEAP
+ PyMem_Free(rfd2obj);
+ PyMem_Free(wfd2obj);
+ PyMem_Free(efd2obj);
+#endif /* SELECT_USES_HEAP */
+ return ret;
+}
+
+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
+/*
+ * poll() support
+ */
+
+typedef struct {
+ PyObject_HEAD
+ PyObject *dict;
+ int ufd_uptodate;
+ int ufd_len;
+ struct pollfd *ufds;
+ int poll_running;
+} pollObject;
+
+/* Update the malloc'ed array of pollfds to match the dictionary
+ contained within a pollObject. Return 1 on success, 0 on an error.
+*/
+
+static int
+update_ufd_array(pollObject *self)
+{
+ Py_ssize_t i, pos;
+ PyObject *key, *value;
+ struct pollfd *old_ufds = self->ufds;
+
+ self->ufd_len = PyDict_GET_SIZE(self->dict);
+ PyMem_RESIZE(self->ufds, struct pollfd, self->ufd_len);
+ if (self->ufds == NULL) {
+ self->ufds = old_ufds;
+ PyErr_NoMemory();
+ return 0;
+ }
+
+ i = pos = 0;
+ while (PyDict_Next(self->dict, &pos, &key, &value)) {
+ assert(i < self->ufd_len);
+ /* Never overflow */
+ self->ufds[i].fd = (int)PyLong_AsLong(key);
+ self->ufds[i].events = (short)(unsigned short)PyLong_AsLong(value);
+ i++;
+ }
+ assert(i == self->ufd_len);
+ self->ufd_uptodate = 1;
+ return 1;
+}
+
+/*[clinic input]
+select.poll.register
+
+ fd: fildes
+ either an integer, or an object with a fileno() method returning an int
+ eventmask: unsigned_short(c_default="POLLIN | POLLPRI | POLLOUT") = select.POLLIN | select.POLLPRI | select.POLLOUT
+ an optional bitmask describing the type of events to check for
+ /
+
+Register a file descriptor with the polling object.
+[clinic start generated code]*/
+
+static PyObject *
+select_poll_register_impl(pollObject *self, int fd, unsigned short eventmask)
+/*[clinic end generated code: output=0dc7173c800a4a65 input=34e16cfb28d3c900]*/
+{
+ PyObject *key, *value;
+ int err;
+
+ /* Add entry to the internal dictionary: the key is the
+ file descriptor, and the value is the event mask. */
+ key = PyLong_FromLong(fd);
+ if (key == NULL)
+ return NULL;
+ value = PyLong_FromLong(eventmask);
+ if (value == NULL) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ err = PyDict_SetItem(self->dict, key, value);
+ Py_DECREF(key);
+ Py_DECREF(value);
+ if (err < 0)
+ return NULL;
+
+ self->ufd_uptodate = 0;
+
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+select.poll.modify
+
+ fd: fildes
+ either an integer, or an object with a fileno() method returning
+ an int
+ eventmask: unsigned_short
+ a bitmask describing the type of events to check for
+ /
+
+Modify an already registered file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+select_poll_modify_impl(pollObject *self, int fd, unsigned short eventmask)
+/*[clinic end generated code: output=1a7b88bf079eff17 input=a8e383df075c32cf]*/
+{
+ PyObject *key, *value;
+ int err;
+
+ /* Modify registered fd */
+ key = PyLong_FromLong(fd);
+ if (key == NULL)
+ return NULL;
+ err = PyDict_Contains(self->dict, key);
+ if (err < 0) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ if (err == 0) {
+ errno = ENOENT;
+ PyErr_SetFromErrno(PyExc_OSError);
+ Py_DECREF(key);
+ return NULL;
+ }
+ value = PyLong_FromLong(eventmask);
+ if (value == NULL) {
+ Py_DECREF(key);
+ return NULL;
+ }
+ err = PyDict_SetItem(self->dict, key, value);
+ Py_DECREF(key);
+ Py_DECREF(value);
+ if (err < 0)
+ return NULL;
+
+ self->ufd_uptodate = 0;
+
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+select.poll.unregister
+
+ fd: fildes
+ /
+
+Remove a file descriptor being tracked by the polling object.
+[clinic start generated code]*/
+
+static PyObject *
+select_poll_unregister_impl(pollObject *self, int fd)
+/*[clinic end generated code: output=8c9f42e75e7d291b input=4b4fccc1040e79cb]*/
+{
+ PyObject *key;
+
+ /* Check whether the fd is already in the array */
+ key = PyLong_FromLong(fd);
+ if (key == NULL)
+ return NULL;
+
+ if (PyDict_DelItem(self->dict, key) == -1) {
+ Py_DECREF(key);
+ /* This will simply raise the KeyError set by PyDict_DelItem
+ if the file descriptor isn't registered. */
+ return NULL;
+ }
+
+ Py_DECREF(key);
+ self->ufd_uptodate = 0;
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+select.poll.poll
+
+ timeout as timeout_obj: object = None
+ The maximum time to wait in milliseconds, or else None (or a negative
+ value) to wait indefinitely.
+ /
+
+Polls the set of registered file descriptors.
+
+Returns a list containing any descriptors that have events or errors to
+report, as a list of (fd, event) 2-tuples.
+[clinic start generated code]*/
+
+static PyObject *
+select_poll_poll_impl(pollObject *self, PyObject *timeout_obj)
+/*[clinic end generated code: output=876e837d193ed7e4 input=c2f6953ec45e5622]*/
+{
+ PyObject *result_list = NULL;
+ int poll_result, i, j;
+ PyObject *value = NULL, *num = NULL;
+ _PyTime_t timeout = -1, ms = -1, deadline = 0;
+ int async_err = 0;
+
+ if (timeout_obj != Py_None) {
+ if (_PyTime_FromMillisecondsObject(&timeout, timeout_obj,
+ _PyTime_ROUND_TIMEOUT) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "timeout must be an integer or None");
+ }
+ return NULL;
+ }
+
+ ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_TIMEOUT);
+ if (ms < INT_MIN || ms > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "timeout is too large");
+ return NULL;
+ }
+
+ if (timeout >= 0) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+ }
+
+ /* On some OSes, typically BSD-based ones, the timeout parameter of the
+ poll() syscall, when negative, must be exactly INFTIM, where defined,
+ or -1. See issue 31334. */
+ if (ms < 0) {
+#ifdef INFTIM
+ ms = INFTIM;
+#else
+ ms = -1;
+#endif
+ }
+
+ /* Avoid concurrent poll() invocation, issue 8865 */
+ if (self->poll_running) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "concurrent poll() invocation");
+ return NULL;
+ }
+
+ /* Ensure the ufd array is up to date */
+ if (!self->ufd_uptodate)
+ if (update_ufd_array(self) == 0)
+ return NULL;
+
+ self->poll_running = 1;
+
+ /* call poll() */
+ async_err = 0;
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ errno = 0;
+ poll_result = poll(self->ufds, self->ufd_len, (int)ms);
+ Py_END_ALLOW_THREADS
+
+ if (errno != EINTR)
+ break;
+
+ /* poll() was interrupted by a signal */
+ if (PyErr_CheckSignals()) {
+ async_err = 1;
+ break;
+ }
+
+ if (timeout >= 0) {
+ timeout = _PyDeadline_Get(deadline);
+ if (timeout < 0) {
+ poll_result = 0;
+ break;
+ }
+ ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
+ /* retry poll() with the recomputed timeout */
+ }
+ } while (1);
+
+ self->poll_running = 0;
+
+ if (poll_result < 0) {
+ if (!async_err)
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ /* build the result list */
+
+ result_list = PyList_New(poll_result);
+ if (!result_list)
+ return NULL;
+
+ for (i = 0, j = 0; j < poll_result; j++) {
+ /* skip to the next fired descriptor */
+ while (!self->ufds[i].revents) {
+ i++;
+ }
+ /* if we hit a NULL return, set value to NULL
+ and break out of loop; code at end will
+ clean up result_list */
+ value = PyTuple_New(2);
+ if (value == NULL)
+ goto error;
+ num = PyLong_FromLong(self->ufds[i].fd);
+ if (num == NULL) {
+ Py_DECREF(value);
+ goto error;
+ }
+ PyTuple_SET_ITEM(value, 0, num);
+
+ /* The &0xffff is a workaround for AIX. 'revents'
+ is a 16-bit short, and IBM assigned POLLNVAL
+ to be 0x8000, so the conversion to int results
+ in a negative number. See SF bug #923315. */
+ num = PyLong_FromLong(self->ufds[i].revents & 0xffff);
+ if (num == NULL) {
+ Py_DECREF(value);
+ goto error;
+ }
+ PyTuple_SET_ITEM(value, 1, num);
+ PyList_SET_ITEM(result_list, j, value);
+ i++;
+ }
+ return result_list;
+
+ error:
+ Py_DECREF(result_list);
+ return NULL;
+}
+
+static pollObject *
+newPollObject(PyObject *module)
+{
+ pollObject *self;
+ self = PyObject_New(pollObject, get_select_state(module)->poll_Type);
+ if (self == NULL)
+ return NULL;
+ /* ufd_uptodate is a Boolean, denoting whether the
+ array pointed to by ufds matches the contents of the dictionary. */
+ self->ufd_uptodate = 0;
+ self->ufds = NULL;
+ self->poll_running = 0;
+ self->dict = PyDict_New();
+ if (self->dict == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ return self;
+}
+
+static void
+poll_dealloc(pollObject *self)
+{
+ PyObject* type = (PyObject *)Py_TYPE(self);
+ if (self->ufds != NULL)
+ PyMem_Free(self->ufds);
+ Py_XDECREF(self->dict);
+ PyObject_Free(self);
+ Py_DECREF(type);
+}
+
+
+#ifdef HAVE_SYS_DEVPOLL_H
+static PyMethodDef devpoll_methods[];
+
+typedef struct {
+ PyObject_HEAD
+ int fd_devpoll;
+ int max_n_fds;
+ int n_fds;
+ struct pollfd *fds;
+} devpollObject;
+
+static PyObject *
+devpoll_err_closed(void)
+{
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed devpoll object");
+ return NULL;
+}
+
+static int devpoll_flush(devpollObject *self)
+{
+ int size, n;
+
+ if (!self->n_fds) return 0;
+
+ size = sizeof(struct pollfd)*self->n_fds;
+ self->n_fds = 0;
+
+ n = _Py_write(self->fd_devpoll, self->fds, size);
+ if (n == -1)
+ return -1;
+
+ if (n < size) {
+ /*
+ ** Data writed to /dev/poll is a binary data structure. It is not
+ ** clear what to do if a partial write occurred. For now, raise
+ ** an exception and see if we actually found this problem in
+ ** the wild.
+ ** See http://bugs.python.org/issue6397.
+ */
+ PyErr_Format(PyExc_OSError, "failed to write all pollfds. "
+ "Please, report at http://bugs.python.org/. "
+ "Data to report: Size tried: %d, actual size written: %d.",
+ size, n);
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+internal_devpoll_register(devpollObject *self, int fd,
+ unsigned short events, int remove)
+{
+ if (self->fd_devpoll < 0)
+ return devpoll_err_closed();
+
+ if (remove) {
+ self->fds[self->n_fds].fd = fd;
+ self->fds[self->n_fds].events = POLLREMOVE;
+
+ if (++self->n_fds == self->max_n_fds) {
+ if (devpoll_flush(self))
+ return NULL;
+ }
+ }
+
+ self->fds[self->n_fds].fd = fd;
+ self->fds[self->n_fds].events = (signed short)events;
+
+ if (++self->n_fds == self->max_n_fds) {
+ if (devpoll_flush(self))
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+select.devpoll.register
+
+ fd: fildes
+ either an integer, or an object with a fileno() method returning
+ an int
+ eventmask: unsigned_short(c_default="POLLIN | POLLPRI | POLLOUT") = select.POLLIN | select.POLLPRI | select.POLLOUT
+ an optional bitmask describing the type of events to check for
+ /
+
+Register a file descriptor with the polling object.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_register_impl(devpollObject *self, int fd,
+ unsigned short eventmask)
+/*[clinic end generated code: output=6e07fe8b74abba0c input=22006fabe9567522]*/
+{
+ return internal_devpoll_register(self, fd, eventmask, 0);
+}
+
+/*[clinic input]
+select.devpoll.modify
+
+ fd: fildes
+ either an integer, or an object with a fileno() method returning
+ an int
+ eventmask: unsigned_short(c_default="POLLIN | POLLPRI | POLLOUT") = select.POLLIN | select.POLLPRI | select.POLLOUT
+ an optional bitmask describing the type of events to check for
+ /
+
+Modify a possible already registered file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_modify_impl(devpollObject *self, int fd,
+ unsigned short eventmask)
+/*[clinic end generated code: output=bc2e6d23aaff98b4 input=09fa335db7cdc09e]*/
+{
+ return internal_devpoll_register(self, fd, eventmask, 1);
+}
+
+/*[clinic input]
+select.devpoll.unregister
+
+ fd: fildes
+ /
+
+Remove a file descriptor being tracked by the polling object.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_unregister_impl(devpollObject *self, int fd)
+/*[clinic end generated code: output=95519ffa0c7d43fe input=b4ea42a4442fd467]*/
+{
+ if (self->fd_devpoll < 0)
+ return devpoll_err_closed();
+
+ self->fds[self->n_fds].fd = fd;
+ self->fds[self->n_fds].events = POLLREMOVE;
+
+ if (++self->n_fds == self->max_n_fds) {
+ if (devpoll_flush(self))
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+select.devpoll.poll
+ timeout as timeout_obj: object = None
+ The maximum time to wait in milliseconds, or else None (or a negative
+ value) to wait indefinitely.
+ /
+
+Polls the set of registered file descriptors.
+
+Returns a list containing any descriptors that have events or errors to
+report, as a list of (fd, event) 2-tuples.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj)
+/*[clinic end generated code: output=2654e5457cca0b3c input=3c3f0a355ec2bedb]*/
+{
+ struct dvpoll dvp;
+ PyObject *result_list = NULL;
+ int poll_result, i;
+ PyObject *value, *num1, *num2;
+ _PyTime_t timeout, ms, deadline = 0;
+
+ if (self->fd_devpoll < 0)
+ return devpoll_err_closed();
+
+ /* Check values for timeout */
+ if (timeout_obj == Py_None) {
+ timeout = -1;
+ ms = -1;
+ }
+ else {
+ if (_PyTime_FromMillisecondsObject(&timeout, timeout_obj,
+ _PyTime_ROUND_TIMEOUT) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "timeout must be an integer or None");
+ }
+ return NULL;
+ }
+
+ ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_TIMEOUT);
+ if (ms < -1 || ms > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "timeout is too large");
+ return NULL;
+ }
+ }
+
+ if (devpoll_flush(self))
+ return NULL;
+
+ dvp.dp_fds = self->fds;
+ dvp.dp_nfds = self->max_n_fds;
+ dvp.dp_timeout = (int)ms;
+
+ if (timeout >= 0) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ do {
+ /* call devpoll() */
+ Py_BEGIN_ALLOW_THREADS
+ errno = 0;
+ poll_result = ioctl(self->fd_devpoll, DP_POLL, &dvp);
+ Py_END_ALLOW_THREADS
+
+ if (errno != EINTR)
+ break;
+
+ /* devpoll() was interrupted by a signal */
+ if (PyErr_CheckSignals())
+ return NULL;
+
+ if (timeout >= 0) {
+ timeout = _PyDeadline_Get(deadline);
+ if (timeout < 0) {
+ poll_result = 0;
+ break;
+ }
+ ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
+ dvp.dp_timeout = (int)ms;
+ /* retry devpoll() with the recomputed timeout */
+ }
+ } while (1);
+
+ if (poll_result < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ /* build the result list */
+ result_list = PyList_New(poll_result);
+ if (!result_list)
+ return NULL;
+
+ for (i = 0; i < poll_result; i++) {
+ num1 = PyLong_FromLong(self->fds[i].fd);
+ num2 = PyLong_FromLong(self->fds[i].revents);
+ if ((num1 == NULL) || (num2 == NULL)) {
+ Py_XDECREF(num1);
+ Py_XDECREF(num2);
+ goto error;
+ }
+ value = PyTuple_Pack(2, num1, num2);
+ Py_DECREF(num1);
+ Py_DECREF(num2);
+ if (value == NULL)
+ goto error;
+ PyList_SET_ITEM(result_list, i, value);
+ }
+
+ return result_list;
+
+ error:
+ Py_DECREF(result_list);
+ return NULL;
+}
+
+static int
+devpoll_internal_close(devpollObject *self)
+{
+ int save_errno = 0;
+ if (self->fd_devpoll >= 0) {
+ int fd = self->fd_devpoll;
+ self->fd_devpoll = -1;
+ Py_BEGIN_ALLOW_THREADS
+ if (close(fd) < 0)
+ save_errno = errno;
+ Py_END_ALLOW_THREADS
+ }
+ return save_errno;
+}
+
+/*[clinic input]
+select.devpoll.close
+
+Close the devpoll file descriptor.
+
+Further operations on the devpoll object will raise an exception.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_close_impl(devpollObject *self)
+/*[clinic end generated code: output=26b355bd6429f21b input=6273c30f5560a99b]*/
+{
+ errno = devpoll_internal_close(self);
+ if (errno < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject*
+devpoll_get_closed(devpollObject *self, void *Py_UNUSED(ignored))
+{
+ if (self->fd_devpoll < 0)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+/*[clinic input]
+select.devpoll.fileno
+
+Return the file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_fileno_impl(devpollObject *self)
+/*[clinic end generated code: output=26920929f8d292f4 input=ef15331ebde6c368]*/
+{
+ if (self->fd_devpoll < 0)
+ return devpoll_err_closed();
+ return PyLong_FromLong(self->fd_devpoll);
+}
+
+static PyGetSetDef devpoll_getsetlist[] = {
+ {"closed", (getter)devpoll_get_closed, NULL,
+ "True if the devpoll object is closed"},
+ {0},
+};
+
+static devpollObject *
+newDevPollObject(PyObject *module)
+{
+ devpollObject *self;
+ int fd_devpoll, limit_result;
+ struct pollfd *fds;
+ struct rlimit limit;
+
+ /*
+ ** If we try to process more that getrlimit()
+ ** fds, the kernel will give an error, so
+ ** we set the limit here. It is a dynamic
+ ** value, because we can change rlimit() anytime.
+ */
+ limit_result = getrlimit(RLIMIT_NOFILE, &limit);
+ if (limit_result == -1) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ fd_devpoll = _Py_open("/dev/poll", O_RDWR);
+ if (fd_devpoll == -1)
+ return NULL;
+
+ fds = PyMem_NEW(struct pollfd, limit.rlim_cur);
+ if (fds == NULL) {
+ close(fd_devpoll);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ self = PyObject_New(devpollObject, get_select_state(module)->devpoll_Type);
+ if (self == NULL) {
+ close(fd_devpoll);
+ PyMem_Free(fds);
+ return NULL;
+ }
+ self->fd_devpoll = fd_devpoll;
+ self->max_n_fds = limit.rlim_cur;
+ self->n_fds = 0;
+ self->fds = fds;
+
+ return self;
+}
+
+static void
+devpoll_dealloc(devpollObject *self)
+{
+ PyObject *type = (PyObject *)Py_TYPE(self);
+ (void)devpoll_internal_close(self);
+ PyMem_Free(self->fds);
+ PyObject_Free(self);
+ Py_DECREF(type);
+}
+
+static PyType_Slot devpoll_Type_slots[] = {
+ {Py_tp_dealloc, devpoll_dealloc},
+ {Py_tp_getset, devpoll_getsetlist},
+ {Py_tp_methods, devpoll_methods},
+ {0, 0},
+};
+
+static PyType_Spec devpoll_Type_spec = {
+ "select.devpoll",
+ sizeof(devpollObject),
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ devpoll_Type_slots
+};
+
+#endif /* HAVE_SYS_DEVPOLL_H */
+
+
+/*[clinic input]
+select.poll
+
+Returns a polling object.
+
+This object supports registering and unregistering file descriptors, and then
+polling them for I/O events.
+[clinic start generated code]*/
+
+static PyObject *
+select_poll_impl(PyObject *module)
+/*[clinic end generated code: output=16a665a4e1d228c5 input=3f877909d5696bbf]*/
+{
+ return (PyObject *)newPollObject(module);
+}
+
+#ifdef HAVE_SYS_DEVPOLL_H
+
+/*[clinic input]
+select.devpoll
+
+Returns a polling object.
+
+This object supports registering and unregistering file descriptors, and then
+polling them for I/O events.
+[clinic start generated code]*/
+
+static PyObject *
+select_devpoll_impl(PyObject *module)
+/*[clinic end generated code: output=ea9213cc87fd9581 input=53a1af94564f00a3]*/
+{
+ return (PyObject *)newDevPollObject(module);
+}
+#endif
+
+
+#ifdef __APPLE__
+/*
+ * On some systems poll() sets errno on invalid file descriptors. We test
+ * for this at runtime because this bug may be fixed or introduced between
+ * OS releases.
+ */
+static int select_have_broken_poll(void)
+{
+ int poll_test;
+ int filedes[2];
+
+ struct pollfd poll_struct = { 0, POLLIN|POLLPRI|POLLOUT, 0 };
+
+ /* Create a file descriptor to make invalid */
+ if (pipe(filedes) < 0) {
+ return 1;
+ }
+ poll_struct.fd = filedes[0];
+ close(filedes[0]);
+ close(filedes[1]);
+ poll_test = poll(&poll_struct, 1, 0);
+ if (poll_test < 0) {
+ return 1;
+ } else if (poll_test == 0 && poll_struct.revents != POLLNVAL) {
+ return 1;
+ }
+ return 0;
+}
+#endif /* __APPLE__ */
+
+#endif /* HAVE_POLL */
+
+#ifdef HAVE_EPOLL
+/* **************************************************************************
+ * epoll interface for Linux 2.6
+ *
+ * Written by Christian Heimes
+ * Inspired by Twisted's _epoll.pyx and select.poll()
+ */
+
+#ifdef HAVE_SYS_EPOLL_H
+#include <sys/epoll.h>
+#endif
+
+typedef struct {
+ PyObject_HEAD
+ SOCKET epfd; /* epoll control file descriptor */
+} pyEpoll_Object;
+
+static PyObject *
+pyepoll_err_closed(void)
+{
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed epoll object");
+ return NULL;
+}
+
+static int
+pyepoll_internal_close(pyEpoll_Object *self)
+{
+ int save_errno = 0;
+ if (self->epfd >= 0) {
+ int epfd = self->epfd;
+ self->epfd = -1;
+ Py_BEGIN_ALLOW_THREADS
+ if (close(epfd) < 0)
+ save_errno = errno;
+ Py_END_ALLOW_THREADS
+ }
+ return save_errno;
+}
+
+static PyObject *
+newPyEpoll_Object(PyTypeObject *type, int sizehint, SOCKET fd)
+{
+ pyEpoll_Object *self;
+ assert(type != NULL);
+ allocfunc epoll_alloc = PyType_GetSlot(type, Py_tp_alloc);
+ assert(epoll_alloc != NULL);
+ self = (pyEpoll_Object *) epoll_alloc(type, 0);
+ if (self == NULL)
+ return NULL;
+
+ if (fd == -1) {
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_EPOLL_CREATE1
+ self->epfd = epoll_create1(EPOLL_CLOEXEC);
+#else
+ self->epfd = epoll_create(sizehint);
+#endif
+ Py_END_ALLOW_THREADS
+ }
+ else {
+ self->epfd = fd;
+ }
+ if (self->epfd < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ Py_DECREF(self);
+ return NULL;
+ }
+
+#ifndef HAVE_EPOLL_CREATE1
+ if (fd == -1 && _Py_set_inheritable(self->epfd, 0, NULL) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+#endif
+
+ return (PyObject *)self;
+}
+
+
+/*[clinic input]
+@classmethod
+select.epoll.__new__
+
+ sizehint: int = -1
+ The expected number of events to be registered. It must be positive,
+ or -1 to use the default. It is only used on older systems where
+ epoll_create1() is not available; otherwise it has no effect (though its
+ value is still checked).
+ flags: int = 0
+ Deprecated and completely ignored. However, when supplied, its value
+ must be 0 or select.EPOLL_CLOEXEC, otherwise OSError is raised.
+
+Returns an epolling object.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_impl(PyTypeObject *type, int sizehint, int flags)
+/*[clinic end generated code: output=c87404e705013bb5 input=303e3295e7975e43]*/
+{
+ if (sizehint == -1) {
+ sizehint = FD_SETSIZE - 1;
+ }
+ else if (sizehint <= 0) {
+ PyErr_SetString(PyExc_ValueError, "negative sizehint");
+ return NULL;
+ }
+
+#ifdef HAVE_EPOLL_CREATE1
+ if (flags && flags != EPOLL_CLOEXEC) {
+ PyErr_SetString(PyExc_OSError, "invalid flags");
+ return NULL;
+ }
+#endif
+
+ return newPyEpoll_Object(type, sizehint, -1);
+}
+
+
+static void
+pyepoll_dealloc(pyEpoll_Object *self)
+{
+ PyTypeObject* type = Py_TYPE(self);
+ (void)pyepoll_internal_close(self);
+ freefunc epoll_free = PyType_GetSlot(type, Py_tp_free);
+ epoll_free((PyObject *)self);
+ Py_DECREF((PyObject *)type);
+}
+
+/*[clinic input]
+select.epoll.close
+
+Close the epoll control file descriptor.
+
+Further operations on the epoll object will raise an exception.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_close_impl(pyEpoll_Object *self)
+/*[clinic end generated code: output=ee2144c446a1a435 input=ca6c66ba5a736bfd]*/
+{
+ errno = pyepoll_internal_close(self);
+ if (errno < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+
+static PyObject*
+pyepoll_get_closed(pyEpoll_Object *self, void *Py_UNUSED(ignored))
+{
+ if (self->epfd < 0)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+/*[clinic input]
+select.epoll.fileno
+
+Return the epoll control file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_fileno_impl(pyEpoll_Object *self)
+/*[clinic end generated code: output=e171375fdc619ba3 input=c11091a6aee60b5c]*/
+{
+ if (self->epfd < 0)
+ return pyepoll_err_closed();
+ return PyLong_FromLong(self->epfd);
+}
+
+
+/*[clinic input]
+@classmethod
+select.epoll.fromfd
+
+ fd: int
+ /
+
+Create an epoll object from a given control fd.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_fromfd_impl(PyTypeObject *type, int fd)
+/*[clinic end generated code: output=c15de2a083524e8e input=faecefdb55e3046e]*/
+{
+ SOCKET s_fd = (SOCKET)fd;
+ return newPyEpoll_Object(type, FD_SETSIZE - 1, s_fd);
+}
+
+
+static PyObject *
+pyepoll_internal_ctl(int epfd, int op, int fd, unsigned int events)
+{
+ struct epoll_event ev;
+ int result;
+
+ if (epfd < 0)
+ return pyepoll_err_closed();
+
+ switch (op) {
+ case EPOLL_CTL_ADD:
+ case EPOLL_CTL_MOD:
+ ev.events = events;
+ ev.data.fd = fd;
+ Py_BEGIN_ALLOW_THREADS
+ result = epoll_ctl(epfd, op, fd, &ev);
+ Py_END_ALLOW_THREADS
+ break;
+ case EPOLL_CTL_DEL:
+ /* In kernel versions before 2.6.9, the EPOLL_CTL_DEL
+ * operation required a non-NULL pointer in event, even
+ * though this argument is ignored. */
+ Py_BEGIN_ALLOW_THREADS
+ result = epoll_ctl(epfd, op, fd, &ev);
+ Py_END_ALLOW_THREADS
+ break;
+ default:
+ result = -1;
+ errno = EINVAL;
+ }
+
+ if (result < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+select.epoll.register
+
+ fd: fildes
+ the target file descriptor of the operation
+ eventmask: unsigned_int(c_default="EPOLLIN | EPOLLPRI | EPOLLOUT", bitwise=True) = select.EPOLLIN | select.EPOLLPRI | select.EPOLLOUT
+ a bit set composed of the various EPOLL constants
+
+Registers a new fd or raises an OSError if the fd is already registered.
+
+The epoll interface supports all file descriptors that support poll.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_register_impl(pyEpoll_Object *self, int fd,
+ unsigned int eventmask)
+/*[clinic end generated code: output=318e5e6386520599 input=a5071b71edfe3578]*/
+{
+ return pyepoll_internal_ctl(self->epfd, EPOLL_CTL_ADD, fd, eventmask);
+}
+
+/*[clinic input]
+select.epoll.modify
+
+ fd: fildes
+ the target file descriptor of the operation
+ eventmask: unsigned_int(bitwise=True)
+ a bit set composed of the various EPOLL constants
+
+Modify event mask for a registered file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_modify_impl(pyEpoll_Object *self, int fd,
+ unsigned int eventmask)
+/*[clinic end generated code: output=7e3447307cff6f65 input=88a83dac53a8c3da]*/
+{
+ return pyepoll_internal_ctl(self->epfd, EPOLL_CTL_MOD, fd, eventmask);
+}
+
+/*[clinic input]
+select.epoll.unregister
+
+ fd: fildes
+ the target file descriptor of the operation
+
+Remove a registered file descriptor from the epoll object.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_unregister_impl(pyEpoll_Object *self, int fd)
+/*[clinic end generated code: output=07c5dbd612a512d4 input=3093f68d3644743d]*/
+{
+ return pyepoll_internal_ctl(self->epfd, EPOLL_CTL_DEL, fd, 0);
+}
+
+/*[clinic input]
+select.epoll.poll
+
+ timeout as timeout_obj: object = None
+ the maximum time to wait in seconds (as float);
+ a timeout of None or -1 makes poll wait indefinitely
+ maxevents: int = -1
+ the maximum number of events returned; -1 means no limit
+
+Wait for events on the epoll file descriptor.
+
+Returns a list containing any descriptors that have events to report,
+as a list of (fd, events) 2-tuples.
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll_poll_impl(pyEpoll_Object *self, PyObject *timeout_obj,
+ int maxevents)
+/*[clinic end generated code: output=e02d121a20246c6c input=33d34a5ea430fd5b]*/
+{
+ int nfds, i;
+ PyObject *elist = NULL, *etuple = NULL;
+ struct epoll_event *evs = NULL;
+ _PyTime_t timeout = -1, ms = -1, deadline = 0;
+
+ if (self->epfd < 0)
+ return pyepoll_err_closed();
+
+ if (timeout_obj != Py_None) {
+ /* epoll_wait() has a resolution of 1 millisecond, round towards
+ infinity to wait at least timeout seconds. */
+ if (_PyTime_FromSecondsObject(&timeout, timeout_obj,
+ _PyTime_ROUND_TIMEOUT) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "timeout must be an integer or None");
+ }
+ return NULL;
+ }
+
+ ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
+ if (ms < INT_MIN || ms > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError, "timeout is too large");
+ return NULL;
+ }
+ /* epoll_wait(2) treats all arbitrary negative numbers the same
+ for the timeout argument, but -1 is the documented way to block
+ indefinitely in the epoll_wait(2) documentation, so we set ms
+ to -1 if the value of ms is a negative number.
+
+ Note that we didn't use INFTIM here since it's non-standard and
+ isn't available under Linux. */
+ if (ms < 0) {
+ ms = -1;
+ }
+
+ if (timeout >= 0) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+ }
+
+ if (maxevents == -1) {
+ maxevents = FD_SETSIZE-1;
+ }
+ else if (maxevents < 1) {
+ PyErr_Format(PyExc_ValueError,
+ "maxevents must be greater than 0, got %d",
+ maxevents);
+ return NULL;
+ }
+
+ evs = PyMem_New(struct epoll_event, maxevents);
+ if (evs == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ errno = 0;
+ nfds = epoll_wait(self->epfd, evs, maxevents, (int)ms);
+ Py_END_ALLOW_THREADS
+
+ if (errno != EINTR)
+ break;
+
+ /* poll() was interrupted by a signal */
+ if (PyErr_CheckSignals())
+ goto error;
+
+ if (timeout >= 0) {
+ timeout = _PyDeadline_Get(deadline);
+ if (timeout < 0) {
+ nfds = 0;
+ break;
+ }
+ ms = _PyTime_AsMilliseconds(timeout, _PyTime_ROUND_CEILING);
+ /* retry epoll_wait() with the recomputed timeout */
+ }
+ } while(1);
+
+ if (nfds < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto error;
+ }
+
+ elist = PyList_New(nfds);
+ if (elist == NULL) {
+ goto error;
+ }
+
+ for (i = 0; i < nfds; i++) {
+ etuple = Py_BuildValue("iI", evs[i].data.fd, evs[i].events);
+ if (etuple == NULL) {
+ Py_CLEAR(elist);
+ goto error;
+ }
+ PyList_SET_ITEM(elist, i, etuple);
+ }
+
+ error:
+ PyMem_Free(evs);
+ return elist;
+}
+
+
+/*[clinic input]
+select.epoll.__enter__
+
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll___enter___impl(pyEpoll_Object *self)
+/*[clinic end generated code: output=ab45d433504db2a0 input=3c22568587efeadb]*/
+{
+ if (self->epfd < 0)
+ return pyepoll_err_closed();
+
+ return Py_NewRef(self);
+}
+
+/*[clinic input]
+select.epoll.__exit__
+
+ exc_type: object = None
+ exc_value: object = None
+ exc_tb: object = None
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+select_epoll___exit___impl(pyEpoll_Object *self, PyObject *exc_type,
+ PyObject *exc_value, PyObject *exc_tb)
+/*[clinic end generated code: output=c480f38ce361748e input=7ae81a5a4c1a98d8]*/
+{
+ _selectstate *state = _selectstate_by_type(Py_TYPE(self));
+ return PyObject_CallMethodObjArgs((PyObject *)self, state->close, NULL);
+}
+
+static PyGetSetDef pyepoll_getsetlist[] = {
+ {"closed", (getter)pyepoll_get_closed, NULL,
+ "True if the epoll handler is closed"},
+ {0},
+};
+
+PyDoc_STRVAR(pyepoll_doc,
+"select.epoll(sizehint=-1, flags=0)\n\
+\n\
+Returns an epolling object\n\
+\n\
+sizehint must be a positive integer or -1 for the default size. The\n\
+sizehint is used to optimize internal data structures. It doesn't limit\n\
+the maximum number of monitored events.");
+
+#endif /* HAVE_EPOLL */
+
+#ifdef HAVE_KQUEUE
+/* **************************************************************************
+ * kqueue interface for BSD
+ *
+ * Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_SYS_EVENT_H
+#include <sys/event.h>
+#endif
+
+PyDoc_STRVAR(kqueue_event_doc,
+"kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)\n\
+\n\
+This object is the equivalent of the struct kevent for the C API.\n\
+\n\
+See the kqueue manpage for more detailed information about the meaning\n\
+of the arguments.\n\
+\n\
+One minor note: while you might hope that udata could store a\n\
+reference to a python object, it cannot, because it is impossible to\n\
+keep a proper reference count of the object once it's passed into the\n\
+kernel. Therefore, I have restricted it to only storing an integer. I\n\
+recommend ignoring it and simply using the 'ident' field to key off\n\
+of. You could also set up a dictionary on the python side to store a\n\
+udata->object mapping.");
+
+typedef struct {
+ PyObject_HEAD
+ struct kevent e;
+} kqueue_event_Object;
+
+#define kqueue_event_Check(op, state) (PyObject_TypeCheck((op), state->kqueue_event_Type))
+
+typedef struct kqueue_queue_Object {
+ PyObject_HEAD
+ SOCKET kqfd; /* kqueue control fd */
+} kqueue_queue_Object;
+
+#if (SIZEOF_UINTPTR_T != SIZEOF_VOID_P)
+# error uintptr_t does not match void *!
+#elif (SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG)
+# define T_UINTPTRT T_ULONGLONG
+# define T_INTPTRT T_LONGLONG
+# define UINTPTRT_FMT_UNIT "K"
+# define INTPTRT_FMT_UNIT "L"
+#elif (SIZEOF_UINTPTR_T == SIZEOF_LONG)
+# define T_UINTPTRT T_ULONG
+# define T_INTPTRT T_LONG
+# define UINTPTRT_FMT_UNIT "k"
+# define INTPTRT_FMT_UNIT "l"
+#elif (SIZEOF_UINTPTR_T == SIZEOF_INT)
+# define T_UINTPTRT T_UINT
+# define T_INTPTRT T_INT
+# define UINTPTRT_FMT_UNIT "I"
+# define INTPTRT_FMT_UNIT "i"
+#else
+# error uintptr_t does not match int, long, or long long!
+#endif
+
+#if SIZEOF_LONG_LONG == 8
+# define T_INT64 T_LONGLONG
+# define INT64_FMT_UNIT "L"
+#elif SIZEOF_LONG == 8
+# define T_INT64 T_LONG
+# define INT64_FMT_UNIT "l"
+#elif SIZEOF_INT == 8
+# define T_INT64 T_INT
+# define INT64_FMT_UNIT "i"
+#else
+# define INT64_FMT_UNIT "_"
+#endif
+
+#if SIZEOF_LONG_LONG == 4
+# define T_UINT32 T_ULONGLONG
+# define UINT32_FMT_UNIT "K"
+#elif SIZEOF_LONG == 4
+# define T_UINT32 T_ULONG
+# define UINT32_FMT_UNIT "k"
+#elif SIZEOF_INT == 4
+# define T_UINT32 T_UINT
+# define UINT32_FMT_UNIT "I"
+#else
+# define UINT32_FMT_UNIT "_"
+#endif
+
+/*
+ * kevent is not standard and its members vary across BSDs.
+ */
+#ifdef __NetBSD__
+# define FILTER_TYPE T_UINT32
+# define FILTER_FMT_UNIT UINT32_FMT_UNIT
+# define FLAGS_TYPE T_UINT32
+# define FLAGS_FMT_UNIT UINT32_FMT_UNIT
+# define FFLAGS_TYPE T_UINT32
+# define FFLAGS_FMT_UNIT UINT32_FMT_UNIT
+#else
+# define FILTER_TYPE T_SHORT
+# define FILTER_FMT_UNIT "h"
+# define FLAGS_TYPE T_USHORT
+# define FLAGS_FMT_UNIT "H"
+# define FFLAGS_TYPE T_UINT
+# define FFLAGS_FMT_UNIT "I"
+#endif
+
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+# define DATA_TYPE T_INT64
+# define DATA_FMT_UNIT INT64_FMT_UNIT
+#else
+# define DATA_TYPE T_INTPTRT
+# define DATA_FMT_UNIT INTPTRT_FMT_UNIT
+#endif
+
+/* Unfortunately, we can't store python objects in udata, because
+ * kevents in the kernel can be removed without warning, which would
+ * forever lose the refcount on the object stored with it.
+ */
+
+#define KQ_OFF(x) offsetof(kqueue_event_Object, x)
+static struct PyMemberDef kqueue_event_members[] = {
+ {"ident", T_UINTPTRT, KQ_OFF(e.ident)},
+ {"filter", FILTER_TYPE, KQ_OFF(e.filter)},
+ {"flags", FLAGS_TYPE, KQ_OFF(e.flags)},
+ {"fflags", T_UINT, KQ_OFF(e.fflags)},
+ {"data", DATA_TYPE, KQ_OFF(e.data)},
+ {"udata", T_UINTPTRT, KQ_OFF(e.udata)},
+ {NULL} /* Sentinel */
+};
+#undef KQ_OFF
+
+static PyObject *
+
+kqueue_event_repr(kqueue_event_Object *s)
+{
+ return PyUnicode_FromFormat(
+ "<select.kevent ident=%zu filter=%d flags=0x%x fflags=0x%x "
+ "data=0x%llx udata=%p>",
+ (size_t)(s->e.ident), (int)s->e.filter, (unsigned int)s->e.flags,
+ (unsigned int)s->e.fflags, (long long)(s->e.data), (void *)s->e.udata);
+}
+
+static int
+kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *pfd;
+ static char *kwlist[] = {"ident", "filter", "flags", "fflags",
+ "data", "udata", NULL};
+ static const char fmt[] = "O|"
+ FILTER_FMT_UNIT FLAGS_FMT_UNIT FFLAGS_FMT_UNIT DATA_FMT_UNIT
+ UINTPTRT_FMT_UNIT ":kevent";
+
+ EV_SET(&(self->e), 0, EVFILT_READ, EV_ADD, 0, 0, 0); /* defaults */
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, fmt, kwlist,
+ &pfd, &(self->e.filter), &(self->e.flags),
+ &(self->e.fflags), &(self->e.data), &(self->e.udata))) {
+ return -1;
+ }
+
+ if (PyLong_Check(pfd)) {
+ self->e.ident = PyLong_AsSize_t(pfd);
+ }
+ else {
+ self->e.ident = PyObject_AsFileDescriptor(pfd);
+ }
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyObject *
+kqueue_event_richcompare(kqueue_event_Object *s, kqueue_event_Object *o,
+ int op)
+{
+ int result;
+ _selectstate *state = _selectstate_by_type(Py_TYPE(s));
+
+ if (!kqueue_event_Check(o, state)) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+
+#define CMP(a, b) ((a) != (b)) ? ((a) < (b) ? -1 : 1)
+ result = CMP(s->e.ident, o->e.ident)
+ : CMP(s->e.filter, o->e.filter)
+ : CMP(s->e.flags, o->e.flags)
+ : CMP(s->e.fflags, o->e.fflags)
+ : CMP(s->e.data, o->e.data)
+ : CMP((intptr_t)s->e.udata, (intptr_t)o->e.udata)
+ : 0;
+#undef CMP
+
+ Py_RETURN_RICHCOMPARE(result, 0, op);
+}
+
+static PyType_Slot kqueue_event_Type_slots[] = {
+ {Py_tp_doc, (void*)kqueue_event_doc},
+ {Py_tp_init, kqueue_event_init},
+ {Py_tp_members, kqueue_event_members},
+ {Py_tp_new, PyType_GenericNew},
+ {Py_tp_repr, kqueue_event_repr},
+ {Py_tp_richcompare, kqueue_event_richcompare},
+ {0, 0},
+};
+
+static PyType_Spec kqueue_event_Type_spec = {
+ "select.kevent",
+ sizeof(kqueue_event_Object),
+ 0,
+ Py_TPFLAGS_DEFAULT,
+ kqueue_event_Type_slots
+};
+
+static PyObject *
+kqueue_queue_err_closed(void)
+{
+ PyErr_SetString(PyExc_ValueError, "I/O operation on closed kqueue object");
+ return NULL;
+}
+
+static PyObject*
+kqueue_tracking_after_fork(PyObject *module) {
+ _selectstate *state = get_select_state(module);
+ _kqueue_list_item *item = state->kqueue_open_list;
+ state->kqueue_open_list = NULL;
+ while (item) {
+ // Safety: we hold the GIL, and references are removed from this list
+ // before the object is deallocated.
+ kqueue_queue_Object *obj = item->obj;
+ assert(obj->kqfd != -1);
+ obj->kqfd = -1;
+ _kqueue_list_item *next = item->next;
+ PyMem_Free(item);
+ item = next;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef kqueue_tracking_after_fork_def = {
+ "kqueue_tracking_after_fork", (PyCFunction)kqueue_tracking_after_fork,
+ METH_NOARGS, "Invalidate open select.kqueue objects after fork."
+};
+
+static void
+kqueue_tracking_init(PyObject *module) {
+ _selectstate *state = get_select_state(module);
+ assert(state->kqueue_open_list == NULL);
+ // Register a callback to invalidate kqueues with open fds after fork.
+ PyObject *register_at_fork = NULL, *cb = NULL, *args = NULL,
+ *kwargs = NULL, *result = NULL;
+ register_at_fork = _PyImport_GetModuleAttrString("posix",
+ "register_at_fork");
+ if (register_at_fork == NULL) {
+ goto finally;
+ }
+ cb = PyCFunction_New(&kqueue_tracking_after_fork_def, module);
+ if (cb == NULL) {
+ goto finally;
+ }
+ args = PyTuple_New(0);
+ assert(args != NULL);
+ kwargs = Py_BuildValue("{sO}", "after_in_child", cb);
+ if (kwargs == NULL) {
+ goto finally;
+ }
+ result = PyObject_Call(register_at_fork, args, kwargs);
+
+finally:
+ if (PyErr_Occurred()) {
+ // There are a few reasons registration can fail, especially if someone
+ // touched posix.register_at_fork. But everything else still works so
+ // instead of raising we issue a warning and move along.
+ PyObject *exc = PyErr_GetRaisedException();
+ PyObject *exctype = (PyObject*)Py_TYPE(exc);
+ PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
+ "An exception of type %S was raised while registering an "
+ "after-fork handler for select.kqueue objects: %S", exctype, exc);
+ Py_DECREF(exc);
+ }
+ Py_XDECREF(register_at_fork);
+ Py_XDECREF(cb);
+ Py_XDECREF(args);
+ Py_XDECREF(kwargs);
+ Py_XDECREF(result);
+ state->kqueue_tracking_initialized = true;
+}
+
+static int
+kqueue_tracking_add(_selectstate *state, kqueue_queue_Object *self) {
+ if (!state->kqueue_tracking_initialized) {
+ kqueue_tracking_init(PyType_GetModule(Py_TYPE(self)));
+ }
+ assert(self->kqfd >= 0);
+ _kqueue_list_item *item = PyMem_New(_kqueue_list_item, 1);
+ if (item == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ item->obj = self;
+ item->next = state->kqueue_open_list;
+ state->kqueue_open_list = item;
+ return 0;
+}
+
+static void
+kqueue_tracking_remove(_selectstate *state, kqueue_queue_Object *self) {
+ _kqueue_list *listptr = &state->kqueue_open_list;
+ while (*listptr != NULL) {
+ _kqueue_list_item *item = *listptr;
+ if (item->obj == self) {
+ *listptr = item->next;
+ PyMem_Free(item);
+ return;
+ }
+ listptr = &item->next;
+ }
+ // The item should be in the list when we remove it,
+ // and it should only be removed once at close time.
+ assert(0);
+}
+
+static int
+kqueue_queue_internal_close(kqueue_queue_Object *self)
+{
+ int save_errno = 0;
+ if (self->kqfd >= 0) {
+ int kqfd = self->kqfd;
+ self->kqfd = -1;
+ _selectstate *state = _selectstate_by_type(Py_TYPE(self));
+ kqueue_tracking_remove(state, self);
+ Py_BEGIN_ALLOW_THREADS
+ if (close(kqfd) < 0)
+ save_errno = errno;
+ Py_END_ALLOW_THREADS
+ }
+ return save_errno;
+}
+
+static PyObject *
+newKqueue_Object(PyTypeObject *type, SOCKET fd)
+{
+ kqueue_queue_Object *self;
+ assert(type != NULL);
+ allocfunc queue_alloc = PyType_GetSlot(type, Py_tp_alloc);
+ assert(queue_alloc != NULL);
+ self = (kqueue_queue_Object *) queue_alloc(type, 0);
+ if (self == NULL) {
+ return NULL;
+ }
+
+ if (fd == -1) {
+ Py_BEGIN_ALLOW_THREADS
+ self->kqfd = kqueue();
+ Py_END_ALLOW_THREADS
+ }
+ else {
+ self->kqfd = fd;
+ }
+ if (self->kqfd < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ if (fd == -1) {
+ if (_Py_set_inheritable(self->kqfd, 0, NULL) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+
+ _selectstate *state = _selectstate_by_type(type);
+ if (kqueue_tracking_add(state, self) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+
+ return (PyObject *)self;
+}
+
+/*[clinic input]
+@classmethod
+select.kqueue.__new__
+
+Kqueue syscall wrapper.
+
+For example, to start watching a socket for input:
+>>> kq = kqueue()
+>>> sock = socket()
+>>> sock.connect((host, port))
+>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_ADD)], 0)
+
+To wait one second for it to become writeable:
+>>> kq.control(None, 1, 1000)
+
+To stop listening:
+>>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_DELETE)], 0)
+[clinic start generated code]*/
+
+static PyObject *
+select_kqueue_impl(PyTypeObject *type)
+/*[clinic end generated code: output=e0ff89f154d56236 input=cf625e49218366e8]*/
+{
+ return newKqueue_Object(type, -1);
+}
+
+static void
+kqueue_queue_finalize(kqueue_queue_Object *self)
+{
+ PyObject* error = PyErr_GetRaisedException();
+ kqueue_queue_internal_close(self);
+ PyErr_SetRaisedException(error);
+}
+
+/*[clinic input]
+select.kqueue.close
+
+Close the kqueue control file descriptor.
+
+Further operations on the kqueue object will raise an exception.
+[clinic start generated code]*/
+
+static PyObject *
+select_kqueue_close_impl(kqueue_queue_Object *self)
+/*[clinic end generated code: output=d1c7df0b407a4bc1 input=0b12d95430e0634c]*/
+{
+ errno = kqueue_queue_internal_close(self);
+ if (errno < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject*
+kqueue_queue_get_closed(kqueue_queue_Object *self, void *Py_UNUSED(ignored))
+{
+ if (self->kqfd < 0)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+/*[clinic input]
+select.kqueue.fileno
+
+Return the kqueue control file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+select_kqueue_fileno_impl(kqueue_queue_Object *self)
+/*[clinic end generated code: output=716f46112a4f6e5c input=41911c539ca2b0ca]*/
+{
+ if (self->kqfd < 0)
+ return kqueue_queue_err_closed();
+ return PyLong_FromLong(self->kqfd);
+}
+
+/*[clinic input]
+@classmethod
+select.kqueue.fromfd
+
+ fd: int
+ /
+
+Create a kqueue object from a given control fd.
+[clinic start generated code]*/
+
+static PyObject *
+select_kqueue_fromfd_impl(PyTypeObject *type, int fd)
+/*[clinic end generated code: output=d02c3c7dc538a653 input=f6172a48ca4ecdd0]*/
+{
+ SOCKET s_fd = (SOCKET)fd;
+
+ return newKqueue_Object(type, s_fd);
+}
+
+/*[clinic input]
+select.kqueue.control
+
+ changelist: object
+ Must be an iterable of kevent objects describing the changes to be made
+ to the kernel's watch list or None.
+ maxevents: int
+ The maximum number of events that the kernel will return.
+ timeout as otimeout: object = None
+ The maximum time to wait in seconds, or else None to wait forever.
+ This accepts floats for smaller timeouts, too.
+ /
+
+Calls the kernel kevent function.
+[clinic start generated code]*/
+
+static PyObject *
+select_kqueue_control_impl(kqueue_queue_Object *self, PyObject *changelist,
+ int maxevents, PyObject *otimeout)
+/*[clinic end generated code: output=81324ff5130db7ae input=59c4e30811209c47]*/
+{
+ int gotevents = 0;
+ int nchanges = 0;
+ int i = 0;
+ PyObject *seq = NULL, *ei = NULL;
+ PyObject *result = NULL;
+ struct kevent *evl = NULL;
+ struct kevent *chl = NULL;
+ struct timespec timeoutspec;
+ struct timespec *ptimeoutspec;
+ _PyTime_t timeout, deadline = 0;
+ _selectstate *state = _selectstate_by_type(Py_TYPE(self));
+
+ if (self->kqfd < 0)
+ return kqueue_queue_err_closed();
+
+ if (maxevents < 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Length of eventlist must be 0 or positive, got %d",
+ maxevents);
+ return NULL;
+ }
+
+ if (otimeout == Py_None) {
+ ptimeoutspec = NULL;
+ }
+ else {
+ if (_PyTime_FromSecondsObject(&timeout,
+ otimeout, _PyTime_ROUND_TIMEOUT) < 0) {
+ PyErr_Format(PyExc_TypeError,
+ "timeout argument must be a number "
+ "or None, got %.200s",
+ _PyType_Name(Py_TYPE(otimeout)));
+ return NULL;
+ }
+
+ if (_PyTime_AsTimespec(timeout, &timeoutspec) == -1)
+ return NULL;
+
+ if (timeoutspec.tv_sec < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "timeout must be positive or None");
+ return NULL;
+ }
+ ptimeoutspec = &timeoutspec;
+ }
+
+ if (changelist != Py_None) {
+ seq = PySequence_Fast(changelist, "changelist is not iterable");
+ if (seq == NULL) {
+ return NULL;
+ }
+ if (PySequence_Fast_GET_SIZE(seq) > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "changelist is too long");
+ goto error;
+ }
+ nchanges = (int)PySequence_Fast_GET_SIZE(seq);
+
+ chl = PyMem_New(struct kevent, nchanges);
+ if (chl == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ _selectstate *state = _selectstate_by_type(Py_TYPE(self));
+ for (i = 0; i < nchanges; ++i) {
+ ei = PySequence_Fast_GET_ITEM(seq, i);
+ if (!kqueue_event_Check(ei, state)) {
+ PyErr_SetString(PyExc_TypeError,
+ "changelist must be an iterable of "
+ "select.kevent objects");
+ goto error;
+ }
+ chl[i] = ((kqueue_event_Object *)ei)->e;
+ }
+ Py_CLEAR(seq);
+ }
+
+ /* event list */
+ if (maxevents) {
+ evl = PyMem_New(struct kevent, maxevents);
+ if (evl == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+ }
+
+ if (ptimeoutspec) {
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ errno = 0;
+ gotevents = kevent(self->kqfd, chl, nchanges,
+ evl, maxevents, ptimeoutspec);
+ Py_END_ALLOW_THREADS
+
+ if (errno != EINTR)
+ break;
+
+ /* kevent() was interrupted by a signal */
+ if (PyErr_CheckSignals())
+ goto error;
+
+ if (ptimeoutspec) {
+ timeout = _PyDeadline_Get(deadline);
+ if (timeout < 0) {
+ gotevents = 0;
+ break;
+ }
+ if (_PyTime_AsTimespec(timeout, &timeoutspec) == -1)
+ goto error;
+ /* retry kevent() with the recomputed timeout */
+ }
+ } while (1);
+
+ if (gotevents == -1) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ goto error;
+ }
+
+ result = PyList_New(gotevents);
+ if (result == NULL) {
+ goto error;
+ }
+
+ for (i = 0; i < gotevents; i++) {
+ kqueue_event_Object *ch;
+
+ ch = PyObject_New(kqueue_event_Object, state->kqueue_event_Type);
+ if (ch == NULL) {
+ goto error;
+ }
+ ch->e = evl[i];
+ PyList_SET_ITEM(result, i, (PyObject *)ch);
+ }
+ PyMem_Free(chl);
+ PyMem_Free(evl);
+ return result;
+
+ error:
+ PyMem_Free(chl);
+ PyMem_Free(evl);
+ Py_XDECREF(result);
+ Py_XDECREF(seq);
+ return NULL;
+}
+
+static PyGetSetDef kqueue_queue_getsetlist[] = {
+ {"closed", (getter)kqueue_queue_get_closed, NULL,
+ "True if the kqueue handler is closed"},
+ {0},
+};
+
+#endif /* HAVE_KQUEUE */
+
+
+/* ************************************************************************ */
+
+#include "clinic/selectmodule.c.h"
+
+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
+
+static PyMethodDef poll_methods[] = {
+ SELECT_POLL_REGISTER_METHODDEF
+ SELECT_POLL_MODIFY_METHODDEF
+ SELECT_POLL_UNREGISTER_METHODDEF
+ SELECT_POLL_POLL_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+static PyType_Slot poll_Type_slots[] = {
+ {Py_tp_dealloc, poll_dealloc},
+ {Py_tp_methods, poll_methods},
+ {0, 0},
+};
+
+static PyType_Spec poll_Type_spec = {
+ .name = "select.poll",
+ .basicsize = sizeof(pollObject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ .slots = poll_Type_slots,
+};
+
+#ifdef HAVE_SYS_DEVPOLL_H
+
+static PyMethodDef devpoll_methods[] = {
+ SELECT_DEVPOLL_REGISTER_METHODDEF
+ SELECT_DEVPOLL_MODIFY_METHODDEF
+ SELECT_DEVPOLL_UNREGISTER_METHODDEF
+ SELECT_DEVPOLL_POLL_METHODDEF
+ SELECT_DEVPOLL_CLOSE_METHODDEF
+ SELECT_DEVPOLL_FILENO_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+#endif /* HAVE_SYS_DEVPOLL_H */
+
+#endif /* HAVE_POLL */
+
+#ifdef HAVE_EPOLL
+
+static PyMethodDef pyepoll_methods[] = {
+ SELECT_EPOLL_FROMFD_METHODDEF
+ SELECT_EPOLL_CLOSE_METHODDEF
+ SELECT_EPOLL_FILENO_METHODDEF
+ SELECT_EPOLL_MODIFY_METHODDEF
+ SELECT_EPOLL_REGISTER_METHODDEF
+ SELECT_EPOLL_UNREGISTER_METHODDEF
+ SELECT_EPOLL_POLL_METHODDEF
+ SELECT_EPOLL___ENTER___METHODDEF
+ SELECT_EPOLL___EXIT___METHODDEF
+ {NULL, NULL},
+};
+
+static PyType_Slot pyEpoll_Type_slots[] = {
+ {Py_tp_dealloc, pyepoll_dealloc},
+ {Py_tp_doc, (void*)pyepoll_doc},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_getset, pyepoll_getsetlist},
+ {Py_tp_methods, pyepoll_methods},
+ {Py_tp_new, select_epoll},
+ {0, 0},
+};
+
+static PyType_Spec pyEpoll_Type_spec = {
+ "select.epoll",
+ sizeof(pyEpoll_Object),
+ 0,
+ Py_TPFLAGS_DEFAULT,
+ pyEpoll_Type_slots
+};
+
+#endif /* HAVE_EPOLL */
+
+#ifdef HAVE_KQUEUE
+
+static PyMethodDef kqueue_queue_methods[] = {
+ SELECT_KQUEUE_FROMFD_METHODDEF
+ SELECT_KQUEUE_CLOSE_METHODDEF
+ SELECT_KQUEUE_FILENO_METHODDEF
+ SELECT_KQUEUE_CONTROL_METHODDEF
+ {NULL, NULL},
+};
+
+static PyType_Slot kqueue_queue_Type_slots[] = {
+ {Py_tp_doc, (void*)select_kqueue__doc__},
+ {Py_tp_getset, kqueue_queue_getsetlist},
+ {Py_tp_methods, kqueue_queue_methods},
+ {Py_tp_new, select_kqueue},
+ {Py_tp_finalize, kqueue_queue_finalize},
+ {0, 0},
+};
+
+static PyType_Spec kqueue_queue_Type_spec = {
+ "select.kqueue",
+ sizeof(kqueue_queue_Object),
+ 0,
+ Py_TPFLAGS_DEFAULT,
+ kqueue_queue_Type_slots
+};
+
+#endif /* HAVE_KQUEUE */
+
+
+
+
+
+/* ************************************************************************ */
+
+
+static PyMethodDef select_methods[] = {
+ SELECT_SELECT_METHODDEF
+ SELECT_POLL_METHODDEF
+ SELECT_DEVPOLL_METHODDEF
+ {0, 0}, /* sentinel */
+};
+
+PyDoc_STRVAR(module_doc,
+"This module supports asynchronous I/O on multiple file descriptors.\n\
+\n\
+*** IMPORTANT NOTICE ***\n\
+On Windows, only sockets are supported; on Unix, all file descriptors.");
+
+
+
+static int
+_select_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _selectstate *state = get_select_state(module);
+
+ Py_VISIT(state->close);
+ Py_VISIT(state->poll_Type);
+ Py_VISIT(state->devpoll_Type);
+ Py_VISIT(state->pyEpoll_Type);
+#ifdef HAVE_KQUEUE
+ Py_VISIT(state->kqueue_event_Type);
+ Py_VISIT(state->kqueue_queue_Type);
+ // state->kqueue_open_list only holds borrowed refs
+#endif
+ return 0;
+}
+
+static int
+_select_clear(PyObject *module)
+{
+ _selectstate *state = get_select_state(module);
+
+ Py_CLEAR(state->close);
+ Py_CLEAR(state->poll_Type);
+ Py_CLEAR(state->devpoll_Type);
+ Py_CLEAR(state->pyEpoll_Type);
+#ifdef HAVE_KQUEUE
+ Py_CLEAR(state->kqueue_event_Type);
+ Py_CLEAR(state->kqueue_queue_Type);
+#endif
+ return 0;
+}
+
+static void
+_select_free(void *module)
+{
+ _select_clear((PyObject *)module);
+}
+
+int
+_select_exec(PyObject *m)
+{
+ _selectstate *state = get_select_state(m);
+
+ state->close = PyUnicode_InternFromString("close");
+ if (state->close == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObjectRef(m, "error", PyExc_OSError) < 0) {
+ return -1;
+ }
+
+#ifdef PIPE_BUF
+#ifdef HAVE_BROKEN_PIPE_BUF
+#undef PIPE_BUF
+#define PIPE_BUF 512
+#endif
+ PyModule_AddIntMacro(m, PIPE_BUF);
+#endif
+
+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
+#ifdef __APPLE__
+ if (select_have_broken_poll()) {
+ if (PyObject_DelAttrString(m, "poll") == -1) {
+ PyErr_Clear();
+ }
+ } else {
+#else
+ {
+#endif
+ state->poll_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &poll_Type_spec, NULL);
+ if (state->poll_Type == NULL) {
+ return -1;
+ }
+
+ PyModule_AddIntMacro(m, POLLIN);
+ PyModule_AddIntMacro(m, POLLPRI);
+ PyModule_AddIntMacro(m, POLLOUT);
+ PyModule_AddIntMacro(m, POLLERR);
+ PyModule_AddIntMacro(m, POLLHUP);
+ PyModule_AddIntMacro(m, POLLNVAL);
+
+#ifdef POLLRDNORM
+ PyModule_AddIntMacro(m, POLLRDNORM);
+#endif
+#ifdef POLLRDBAND
+ PyModule_AddIntMacro(m, POLLRDBAND);
+#endif
+#ifdef POLLWRNORM
+ PyModule_AddIntMacro(m, POLLWRNORM);
+#endif
+#ifdef POLLWRBAND
+ PyModule_AddIntMacro(m, POLLWRBAND);
+#endif
+#ifdef POLLMSG
+ PyModule_AddIntMacro(m, POLLMSG);
+#endif
+#ifdef POLLRDHUP
+ /* Kernel 2.6.17+ */
+ PyModule_AddIntMacro(m, POLLRDHUP);
+#endif
+ }
+#endif /* HAVE_POLL */
+
+#ifdef HAVE_SYS_DEVPOLL_H
+ state->devpoll_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &devpoll_Type_spec, NULL);
+ if (state->devpoll_Type == NULL) {
+ return -1;
+ }
+#endif
+
+#ifdef HAVE_EPOLL
+ state->pyEpoll_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &pyEpoll_Type_spec, NULL);
+ if (state->pyEpoll_Type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(m, state->pyEpoll_Type) < 0) {
+ return -1;
+ }
+
+ PyModule_AddIntMacro(m, EPOLLIN);
+ PyModule_AddIntMacro(m, EPOLLOUT);
+ PyModule_AddIntMacro(m, EPOLLPRI);
+ PyModule_AddIntMacro(m, EPOLLERR);
+ PyModule_AddIntMacro(m, EPOLLHUP);
+#ifdef EPOLLRDHUP
+ /* Kernel 2.6.17 */
+ PyModule_AddIntMacro(m, EPOLLRDHUP);
+#endif
+ PyModule_AddIntMacro(m, EPOLLET);
+#ifdef EPOLLONESHOT
+ /* Kernel 2.6.2+ */
+ PyModule_AddIntMacro(m, EPOLLONESHOT);
+#endif
+#ifdef EPOLLEXCLUSIVE
+ PyModule_AddIntMacro(m, EPOLLEXCLUSIVE);
+#endif
+
+#ifdef EPOLLRDNORM
+ PyModule_AddIntMacro(m, EPOLLRDNORM);
+#endif
+#ifdef EPOLLRDBAND
+ PyModule_AddIntMacro(m, EPOLLRDBAND);
+#endif
+#ifdef EPOLLWRNORM
+ PyModule_AddIntMacro(m, EPOLLWRNORM);
+#endif
+#ifdef EPOLLWRBAND
+ PyModule_AddIntMacro(m, EPOLLWRBAND);
+#endif
+#ifdef EPOLLMSG
+ PyModule_AddIntMacro(m, EPOLLMSG);
+#endif
+
+#ifdef EPOLL_CLOEXEC
+ PyModule_AddIntMacro(m, EPOLL_CLOEXEC);
+#endif
+#endif /* HAVE_EPOLL */
+
+#ifdef HAVE_KQUEUE
+ state->kqueue_open_list = NULL;
+
+ state->kqueue_event_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &kqueue_event_Type_spec, NULL);
+ if (state->kqueue_event_Type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(m, state->kqueue_event_Type) < 0) {
+ return -1;
+ }
+
+ state->kqueue_queue_Type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ m, &kqueue_queue_Type_spec, NULL);
+ if (state->kqueue_queue_Type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(m, state->kqueue_queue_Type) < 0) {
+ return -1;
+ }
+
+ /* event filters */
+ PyModule_AddIntConstant(m, "KQ_FILTER_READ", EVFILT_READ);
+ PyModule_AddIntConstant(m, "KQ_FILTER_WRITE", EVFILT_WRITE);
+#ifdef EVFILT_AIO
+ PyModule_AddIntConstant(m, "KQ_FILTER_AIO", EVFILT_AIO);
+#endif
+#ifdef EVFILT_VNODE
+ PyModule_AddIntConstant(m, "KQ_FILTER_VNODE", EVFILT_VNODE);
+#endif
+#ifdef EVFILT_PROC
+ PyModule_AddIntConstant(m, "KQ_FILTER_PROC", EVFILT_PROC);
+#endif
+#ifdef EVFILT_NETDEV
+ PyModule_AddIntConstant(m, "KQ_FILTER_NETDEV", EVFILT_NETDEV);
+#endif
+#ifdef EVFILT_SIGNAL
+ PyModule_AddIntConstant(m, "KQ_FILTER_SIGNAL", EVFILT_SIGNAL);
+#endif
+ PyModule_AddIntConstant(m, "KQ_FILTER_TIMER", EVFILT_TIMER);
+
+ /* event flags */
+ PyModule_AddIntConstant(m, "KQ_EV_ADD", EV_ADD);
+ PyModule_AddIntConstant(m, "KQ_EV_DELETE", EV_DELETE);
+ PyModule_AddIntConstant(m, "KQ_EV_ENABLE", EV_ENABLE);
+ PyModule_AddIntConstant(m, "KQ_EV_DISABLE", EV_DISABLE);
+ PyModule_AddIntConstant(m, "KQ_EV_ONESHOT", EV_ONESHOT);
+ PyModule_AddIntConstant(m, "KQ_EV_CLEAR", EV_CLEAR);
+
+#ifdef EV_SYSFLAGS
+ PyModule_AddIntConstant(m, "KQ_EV_SYSFLAGS", EV_SYSFLAGS);
+#endif
+#ifdef EV_FLAG1
+ PyModule_AddIntConstant(m, "KQ_EV_FLAG1", EV_FLAG1);
+#endif
+
+ PyModule_AddIntConstant(m, "KQ_EV_EOF", EV_EOF);
+ PyModule_AddIntConstant(m, "KQ_EV_ERROR", EV_ERROR);
+
+ /* READ WRITE filter flag */
+#ifdef NOTE_LOWAT
+ PyModule_AddIntConstant(m, "KQ_NOTE_LOWAT", NOTE_LOWAT);
+#endif
+
+ /* VNODE filter flags */
+#ifdef EVFILT_VNODE
+ PyModule_AddIntConstant(m, "KQ_NOTE_DELETE", NOTE_DELETE);
+ PyModule_AddIntConstant(m, "KQ_NOTE_WRITE", NOTE_WRITE);
+ PyModule_AddIntConstant(m, "KQ_NOTE_EXTEND", NOTE_EXTEND);
+ PyModule_AddIntConstant(m, "KQ_NOTE_ATTRIB", NOTE_ATTRIB);
+ PyModule_AddIntConstant(m, "KQ_NOTE_LINK", NOTE_LINK);
+ PyModule_AddIntConstant(m, "KQ_NOTE_RENAME", NOTE_RENAME);
+ PyModule_AddIntConstant(m, "KQ_NOTE_REVOKE", NOTE_REVOKE);
+#endif
+
+ /* PROC filter flags */
+#ifdef EVFILT_PROC
+ PyModule_AddIntConstant(m, "KQ_NOTE_EXIT", NOTE_EXIT);
+ PyModule_AddIntConstant(m, "KQ_NOTE_FORK", NOTE_FORK);
+ PyModule_AddIntConstant(m, "KQ_NOTE_EXEC", NOTE_EXEC);
+ PyModule_AddIntConstant(m, "KQ_NOTE_PCTRLMASK", NOTE_PCTRLMASK);
+ PyModule_AddIntConstant(m, "KQ_NOTE_PDATAMASK", NOTE_PDATAMASK);
+
+ PyModule_AddIntConstant(m, "KQ_NOTE_TRACK", NOTE_TRACK);
+ PyModule_AddIntConstant(m, "KQ_NOTE_CHILD", NOTE_CHILD);
+ PyModule_AddIntConstant(m, "KQ_NOTE_TRACKERR", NOTE_TRACKERR);
+#endif
+
+ /* NETDEV filter flags */
+#ifdef EVFILT_NETDEV
+ PyModule_AddIntConstant(m, "KQ_NOTE_LINKUP", NOTE_LINKUP);
+ PyModule_AddIntConstant(m, "KQ_NOTE_LINKDOWN", NOTE_LINKDOWN);
+ PyModule_AddIntConstant(m, "KQ_NOTE_LINKINV", NOTE_LINKINV);
+#endif
+
+#endif /* HAVE_KQUEUE */
+ return 0;
+}
+
+static PyModuleDef_Slot _select_slots[] = {
+ {Py_mod_exec, _select_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef selectmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "select",
+ .m_doc = module_doc,
+ .m_size = sizeof(_selectstate),
+ .m_methods = select_methods,
+ .m_slots = _select_slots,
+ .m_traverse = _select_traverse,
+ .m_clear = _select_clear,
+ .m_free = _select_free,
+};
+
+PyMODINIT_FUNC
+PyInit_select(void)
+{
+ return PyModuleDef_Init(&selectmodule);
+}
diff --git a/contrib/tools/python3/Modules/sha1module.c b/contrib/tools/python3/Modules/sha1module.c
new file mode 100644
index 00000000000..c66269b5f5c
--- /dev/null
+++ b/contrib/tools/python3/Modules/sha1module.c
@@ -0,0 +1,397 @@
+/* SHA1 module */
+
+/* This module provides an interface to the SHA1 algorithm */
+
+/* See below for information about the original code this module was
+ based upon. Additional work performed by:
+
+ Andrew Kuchling ([email protected])
+ Greg Stein ([email protected])
+ Trevor Perrin ([email protected])
+
+ Copyright (C) 2005-2007 Gregory P. Smith ([email protected])
+ Licensed to PSF under a Contributor Agreement.
+
+*/
+
+/* SHA1 objects */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "hashlib.h"
+#include "pycore_strhex.h" // _Py_strhex()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+
+/*[clinic input]
+module _sha1
+class SHA1Type "SHA1object *" "&PyType_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3dc9a20d1becb759]*/
+
+/* Some useful types */
+
+#if SIZEOF_INT == 4
+typedef unsigned int SHA1_INT32; /* 32-bit integer */
+typedef long long SHA1_INT64; /* 64-bit integer */
+#else
+/* not defined. compilation will die. */
+#endif
+
+/* The SHA1 block size and message digest sizes, in bytes */
+
+#define SHA1_BLOCKSIZE 64
+#define SHA1_DIGESTSIZE 20
+
+#include "_hacl/Hacl_Hash_SHA1.h"
+
+typedef struct {
+ PyObject_HEAD
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock;
+ Hacl_Streaming_SHA1_state *hash_state;
+} SHA1object;
+
+#include "clinic/sha1module.c.h"
+
+
+typedef struct {
+ PyTypeObject* sha1_type;
+} SHA1State;
+
+static inline SHA1State*
+sha1_get_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (SHA1State *)state;
+}
+
+static SHA1object *
+newSHA1object(SHA1State *st)
+{
+ SHA1object *sha = (SHA1object *)PyObject_GC_New(SHA1object, st->sha1_type);
+ sha->lock = NULL;
+ PyObject_GC_Track(sha);
+ return sha;
+}
+
+
+/* Internal methods for a hash object */
+static int
+SHA1_traverse(PyObject *ptr, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(ptr));
+ return 0;
+}
+
+static void
+SHA1_dealloc(SHA1object *ptr)
+{
+ Hacl_Streaming_SHA1_legacy_free(ptr->hash_state);
+ if (ptr->lock != NULL) {
+ PyThread_free_lock(ptr->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(ptr);
+ PyObject_GC_UnTrack(ptr);
+ PyObject_GC_Del(ptr);
+ Py_DECREF(tp);
+}
+
+
+/* External methods for a hash object */
+
+/*[clinic input]
+SHA1Type.copy
+
+ cls: defining_class
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+SHA1Type_copy_impl(SHA1object *self, PyTypeObject *cls)
+/*[clinic end generated code: output=b32d4461ce8bc7a7 input=6c22e66fcc34c58e]*/
+{
+ SHA1State *st = _PyType_GetModuleState(cls);
+
+ SHA1object *newobj;
+ if ((newobj = newSHA1object(st)) == NULL)
+ return NULL;
+
+ ENTER_HASHLIB(self);
+ newobj->hash_state = Hacl_Streaming_SHA1_legacy_copy(self->hash_state);
+ LEAVE_HASHLIB(self);
+ return (PyObject *)newobj;
+}
+
+/*[clinic input]
+SHA1Type.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+SHA1Type_digest_impl(SHA1object *self)
+/*[clinic end generated code: output=2f05302a7aa2b5cb input=13824b35407444bd]*/
+{
+ unsigned char digest[SHA1_DIGESTSIZE];
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_SHA1_legacy_finish(self->hash_state, digest);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest, SHA1_DIGESTSIZE);
+}
+
+/*[clinic input]
+SHA1Type.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+SHA1Type_hexdigest_impl(SHA1object *self)
+/*[clinic end generated code: output=4161fd71e68c6659 input=97691055c0c74ab0]*/
+{
+ unsigned char digest[SHA1_DIGESTSIZE];
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_SHA1_legacy_finish(self->hash_state, digest);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char *)digest, SHA1_DIGESTSIZE);
+}
+
+static void update(Hacl_Streaming_SHA1_state *state, uint8_t *buf, Py_ssize_t len) {
+#if PY_SSIZE_T_MAX > UINT32_MAX
+ while (len > UINT32_MAX) {
+ Hacl_Streaming_SHA1_legacy_update(state, buf, UINT32_MAX);
+ len -= UINT32_MAX;
+ buf += UINT32_MAX;
+ }
+#endif
+ Hacl_Streaming_SHA1_legacy_update(state, buf, (uint32_t) len);
+}
+
+/*[clinic input]
+SHA1Type.update
+
+ obj: object
+ /
+
+Update this hash object's state with the provided string.
+[clinic start generated code]*/
+
+static PyObject *
+SHA1Type_update(SHA1object *self, PyObject *obj)
+/*[clinic end generated code: output=d9902f0e5015e9ae input=aad8e07812edbba3]*/
+{
+ Py_buffer buf;
+
+ GET_BUFFER_VIEW_OR_ERROUT(obj, &buf);
+
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ }
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ update(self->hash_state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ update(self->hash_state, buf.buf, buf.len);
+ }
+
+ PyBuffer_Release(&buf);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef SHA1_methods[] = {
+ SHA1TYPE_COPY_METHODDEF
+ SHA1TYPE_DIGEST_METHODDEF
+ SHA1TYPE_HEXDIGEST_METHODDEF
+ SHA1TYPE_UPDATE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+SHA1_get_block_size(PyObject *self, void *closure)
+{
+ return PyLong_FromLong(SHA1_BLOCKSIZE);
+}
+
+static PyObject *
+SHA1_get_name(PyObject *self, void *closure)
+{
+ return PyUnicode_FromStringAndSize("sha1", 4);
+}
+
+static PyObject *
+sha1_get_digest_size(PyObject *self, void *closure)
+{
+ return PyLong_FromLong(SHA1_DIGESTSIZE);
+}
+
+static PyGetSetDef SHA1_getseters[] = {
+ {"block_size",
+ (getter)SHA1_get_block_size, NULL,
+ NULL,
+ NULL},
+ {"name",
+ (getter)SHA1_get_name, NULL,
+ NULL,
+ NULL},
+ {"digest_size",
+ (getter)sha1_get_digest_size, NULL,
+ NULL,
+ NULL},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot sha1_type_slots[] = {
+ {Py_tp_dealloc, SHA1_dealloc},
+ {Py_tp_methods, SHA1_methods},
+ {Py_tp_getset, SHA1_getseters},
+ {Py_tp_traverse, SHA1_traverse},
+ {0,0}
+};
+
+static PyType_Spec sha1_type_spec = {
+ .name = "_sha1.sha1",
+ .basicsize = sizeof(SHA1object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC),
+ .slots = sha1_type_slots
+};
+
+/* The single module-level function: new() */
+
+/*[clinic input]
+_sha1.sha1
+
+ string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new SHA1 hash object; optionally initialized with a string.
+[clinic start generated code]*/
+
+static PyObject *
+_sha1_sha1_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=6f8b3af05126e18e input=bd54b68e2bf36a8a]*/
+{
+ SHA1object *new;
+ Py_buffer buf;
+
+ if (string)
+ GET_BUFFER_VIEW_OR_ERROUT(string, &buf);
+
+ SHA1State *st = sha1_get_state(module);
+ if ((new = newSHA1object(st)) == NULL) {
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+
+ new->hash_state = Hacl_Streaming_SHA1_legacy_create_in();
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(new);
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+ if (string) {
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ update(new->hash_state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ update(new->hash_state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)new;
+}
+
+
+/* List of functions exported by this module */
+
+static struct PyMethodDef SHA1_functions[] = {
+ _SHA1_SHA1_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+static int
+_sha1_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ SHA1State *state = sha1_get_state(module);
+ Py_VISIT(state->sha1_type);
+ return 0;
+}
+
+static int
+_sha1_clear(PyObject *module)
+{
+ SHA1State *state = sha1_get_state(module);
+ Py_CLEAR(state->sha1_type);
+ return 0;
+}
+
+static void
+_sha1_free(void *module)
+{
+ _sha1_clear((PyObject *)module);
+}
+
+static int
+_sha1_exec(PyObject *module)
+{
+ SHA1State* st = sha1_get_state(module);
+
+ st->sha1_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &sha1_type_spec, NULL);
+
+ if (st->sha1_type == NULL) {
+ return -1;
+ }
+
+ Py_INCREF(st->sha1_type);
+ if (PyModule_AddObject(module,
+ "SHA1Type",
+ (PyObject *)st->sha1_type) < 0) {
+ Py_DECREF(st->sha1_type);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/* Initialize this module. */
+
+static PyModuleDef_Slot _sha1_slots[] = {
+ {Py_mod_exec, _sha1_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _sha1module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_sha1",
+ .m_size = sizeof(SHA1State),
+ .m_methods = SHA1_functions,
+ .m_slots = _sha1_slots,
+ .m_traverse = _sha1_traverse,
+ .m_clear = _sha1_clear,
+ .m_free = _sha1_free
+};
+
+PyMODINIT_FUNC
+PyInit__sha1(void)
+{
+ return PyModuleDef_Init(&_sha1module);
+}
diff --git a/contrib/tools/python3/Modules/sha2module.c b/contrib/tools/python3/Modules/sha2module.c
new file mode 100644
index 00000000000..db3774c81e2
--- /dev/null
+++ b/contrib/tools/python3/Modules/sha2module.c
@@ -0,0 +1,889 @@
+/* SHA2 module */
+
+/* This provides an interface to NIST's SHA2 224, 256, 384, & 512 Algorithms */
+
+/* See below for information about the original code this module was
+ based upon. Additional work performed by:
+
+ Andrew Kuchling ([email protected])
+ Greg Stein ([email protected])
+ Trevor Perrin ([email protected])
+ Jonathan Protzenko ([email protected])
+
+ Copyright (C) 2005-2007 Gregory P. Smith ([email protected])
+ Licensed to PSF under a Contributor Agreement.
+
+*/
+
+/* SHA objects */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_bitutils.h" // _Py_bswap32()
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+#include "pycore_strhex.h" // _Py_strhex()
+#include "structmember.h" // PyMemberDef
+#include "hashlib.h"
+
+/*[clinic input]
+module _sha2
+class SHA256Type "SHA256object *" "&PyType_Type"
+class SHA512Type "SHA512object *" "&PyType_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b5315a7b611c9afc]*/
+
+
+/* The SHA block sizes and maximum message digest sizes, in bytes */
+
+#define SHA256_BLOCKSIZE 64
+#define SHA256_DIGESTSIZE 32
+#define SHA512_BLOCKSIZE 128
+#define SHA512_DIGESTSIZE 64
+
+/* Our SHA2 implementations defer to the HACL* verified library. */
+
+#include "_hacl/Hacl_Hash_SHA2.h"
+
+// TODO: Get rid of int digestsize in favor of Hacl state info?
+
+typedef struct {
+ PyObject_HEAD
+ int digestsize;
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock;
+ Hacl_Streaming_SHA2_state_sha2_256 *state;
+} SHA256object;
+
+typedef struct {
+ PyObject_HEAD
+ int digestsize;
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock;
+ Hacl_Streaming_SHA2_state_sha2_512 *state;
+} SHA512object;
+
+#include "clinic/sha2module.c.h"
+
+/* We shall use run-time type information in the remainder of this module to
+ * tell apart SHA2-224 and SHA2-256 */
+typedef struct {
+ PyTypeObject* sha224_type;
+ PyTypeObject* sha256_type;
+ PyTypeObject* sha384_type;
+ PyTypeObject* sha512_type;
+} sha2_state;
+
+static inline sha2_state*
+sha2_get_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (sha2_state *)state;
+}
+
+static void SHA256copy(SHA256object *src, SHA256object *dest)
+{
+ dest->digestsize = src->digestsize;
+ dest->state = Hacl_Streaming_SHA2_copy_256(src->state);
+}
+
+static void SHA512copy(SHA512object *src, SHA512object *dest)
+{
+ dest->digestsize = src->digestsize;
+ dest->state = Hacl_Streaming_SHA2_copy_512(src->state);
+}
+
+static SHA256object *
+newSHA224object(sha2_state *state)
+{
+ SHA256object *sha = (SHA256object *)PyObject_GC_New(
+ SHA256object, state->sha224_type);
+ if (!sha) {
+ return NULL;
+ }
+ sha->lock = NULL;
+ PyObject_GC_Track(sha);
+ return sha;
+}
+
+static SHA256object *
+newSHA256object(sha2_state *state)
+{
+ SHA256object *sha = (SHA256object *)PyObject_GC_New(
+ SHA256object, state->sha256_type);
+ if (!sha) {
+ return NULL;
+ }
+ sha->lock = NULL;
+ PyObject_GC_Track(sha);
+ return sha;
+}
+
+static SHA512object *
+newSHA384object(sha2_state *state)
+{
+ SHA512object *sha = (SHA512object *)PyObject_GC_New(
+ SHA512object, state->sha384_type);
+ if (!sha) {
+ return NULL;
+ }
+ sha->lock = NULL;
+ PyObject_GC_Track(sha);
+ return sha;
+}
+
+static SHA512object *
+newSHA512object(sha2_state *state)
+{
+ SHA512object *sha = (SHA512object *)PyObject_GC_New(
+ SHA512object, state->sha512_type);
+ if (!sha) {
+ return NULL;
+ }
+ sha->lock = NULL;
+ PyObject_GC_Track(sha);
+ return sha;
+}
+
+/* Internal methods for our hash objects. */
+
+static int
+SHA2_traverse(PyObject *ptr, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(ptr));
+ return 0;
+}
+
+static void
+SHA256_dealloc(SHA256object *ptr)
+{
+ Hacl_Streaming_SHA2_free_256(ptr->state);
+ if (ptr->lock != NULL) {
+ PyThread_free_lock(ptr->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(ptr);
+ PyObject_GC_UnTrack(ptr);
+ PyObject_GC_Del(ptr);
+ Py_DECREF(tp);
+}
+
+static void
+SHA512_dealloc(SHA512object *ptr)
+{
+ Hacl_Streaming_SHA2_free_512(ptr->state);
+ if (ptr->lock != NULL) {
+ PyThread_free_lock(ptr->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(ptr);
+ PyObject_GC_UnTrack(ptr);
+ PyObject_GC_Del(ptr);
+ Py_DECREF(tp);
+}
+
+/* HACL* takes a uint32_t for the length of its parameter, but Py_ssize_t can be
+ * 64 bits so we loop in <4gig chunks when needed. */
+
+static void update_256(Hacl_Streaming_SHA2_state_sha2_256 *state, uint8_t *buf, Py_ssize_t len) {
+ /* Note: we explicitly ignore the error code on the basis that it would take >
+ * 1 billion years to overflow the maximum admissible length for SHA2-256
+ * (namely, 2^61-1 bytes). */
+#if PY_SSIZE_T_MAX > UINT32_MAX
+ while (len > UINT32_MAX) {
+ Hacl_Streaming_SHA2_update_256(state, buf, UINT32_MAX);
+ len -= UINT32_MAX;
+ buf += UINT32_MAX;
+ }
+#endif
+ /* Cast to uint32_t is safe: len <= UINT32_MAX at this point. */
+ Hacl_Streaming_SHA2_update_256(state, buf, (uint32_t) len);
+}
+
+static void update_512(Hacl_Streaming_SHA2_state_sha2_512 *state, uint8_t *buf, Py_ssize_t len) {
+ /* Note: we explicitly ignore the error code on the basis that it would take >
+ * 1 billion years to overflow the maximum admissible length for this API
+ * (namely, 2^64-1 bytes). */
+#if PY_SSIZE_T_MAX > UINT32_MAX
+ while (len > UINT32_MAX) {
+ Hacl_Streaming_SHA2_update_512(state, buf, UINT32_MAX);
+ len -= UINT32_MAX;
+ buf += UINT32_MAX;
+ }
+#endif
+ /* Cast to uint32_t is safe: len <= UINT32_MAX at this point. */
+ Hacl_Streaming_SHA2_update_512(state, buf, (uint32_t) len);
+}
+
+
+/* External methods for our hash objects */
+
+/*[clinic input]
+SHA256Type.copy
+
+ cls:defining_class
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+SHA256Type_copy_impl(SHA256object *self, PyTypeObject *cls)
+/*[clinic end generated code: output=fabd515577805cd3 input=3137146fcb88e212]*/
+{
+ SHA256object *newobj;
+ sha2_state *state = _PyType_GetModuleState(cls);
+ if (Py_IS_TYPE(self, state->sha256_type)) {
+ if ((newobj = newSHA256object(state)) == NULL) {
+ return NULL;
+ }
+ } else {
+ if ((newobj = newSHA224object(state)) == NULL) {
+ return NULL;
+ }
+ }
+
+ ENTER_HASHLIB(self);
+ SHA256copy(self, newobj);
+ LEAVE_HASHLIB(self);
+ return (PyObject *)newobj;
+}
+
+/*[clinic input]
+SHA512Type.copy
+
+ cls: defining_class
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+SHA512Type_copy_impl(SHA512object *self, PyTypeObject *cls)
+/*[clinic end generated code: output=66d2a8ef20de8302 input=f673a18f66527c90]*/
+{
+ SHA512object *newobj;
+ sha2_state *state = _PyType_GetModuleState(cls);
+
+ if (Py_IS_TYPE((PyObject*)self, state->sha512_type)) {
+ if ((newobj = newSHA512object(state)) == NULL) {
+ return NULL;
+ }
+ }
+ else {
+ if ((newobj = newSHA384object(state)) == NULL) {
+ return NULL;
+ }
+ }
+
+ ENTER_HASHLIB(self);
+ SHA512copy(self, newobj);
+ LEAVE_HASHLIB(self);
+ return (PyObject *)newobj;
+}
+
+/*[clinic input]
+SHA256Type.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+SHA256Type_digest_impl(SHA256object *self)
+/*[clinic end generated code: output=3a2e3997a98ee792 input=f1f4cfea5cbde35c]*/
+{
+ uint8_t digest[SHA256_DIGESTSIZE];
+ assert(self->digestsize <= SHA256_DIGESTSIZE);
+ ENTER_HASHLIB(self);
+ // HACL* performs copies under the hood so that self->state remains valid
+ // after this call.
+ Hacl_Streaming_SHA2_finish_256(self->state, digest);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest, self->digestsize);
+}
+
+/*[clinic input]
+SHA512Type.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+SHA512Type_digest_impl(SHA512object *self)
+/*[clinic end generated code: output=dd8c6320070458e0 input=f6470dd359071f4b]*/
+{
+ uint8_t digest[SHA512_DIGESTSIZE];
+ assert(self->digestsize <= SHA512_DIGESTSIZE);
+ ENTER_HASHLIB(self);
+ // HACL* performs copies under the hood so that self->state remains valid
+ // after this call.
+ Hacl_Streaming_SHA2_finish_512(self->state, digest);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest, self->digestsize);
+}
+
+/*[clinic input]
+SHA256Type.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+SHA256Type_hexdigest_impl(SHA256object *self)
+/*[clinic end generated code: output=96cb68996a780ab3 input=0cc4c714693010d1]*/
+{
+ uint8_t digest[SHA256_DIGESTSIZE];
+ assert(self->digestsize <= SHA256_DIGESTSIZE);
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_SHA2_finish_256(self->state, digest);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char *)digest, self->digestsize);
+}
+
+/*[clinic input]
+SHA512Type.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+SHA512Type_hexdigest_impl(SHA512object *self)
+/*[clinic end generated code: output=cbd6f844aba1fe7c input=498b877b25cbe0a2]*/
+{
+ uint8_t digest[SHA512_DIGESTSIZE];
+ assert(self->digestsize <= SHA512_DIGESTSIZE);
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_SHA2_finish_512(self->state, digest);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char *)digest, self->digestsize);
+}
+
+/*[clinic input]
+SHA256Type.update
+
+ obj: object
+ /
+
+Update this hash object's state with the provided string.
+[clinic start generated code]*/
+
+static PyObject *
+SHA256Type_update(SHA256object *self, PyObject *obj)
+/*[clinic end generated code: output=1b240f965ddbd8c6 input=b2d449d5b30f0f5a]*/
+{
+ Py_buffer buf;
+
+ GET_BUFFER_VIEW_OR_ERROUT(obj, &buf);
+
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ }
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ update_256(self->state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ update_256(self->state, buf.buf, buf.len);
+ }
+
+ PyBuffer_Release(&buf);
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+SHA512Type.update
+
+ obj: object
+ /
+
+Update this hash object's state with the provided string.
+[clinic start generated code]*/
+
+static PyObject *
+SHA512Type_update(SHA512object *self, PyObject *obj)
+/*[clinic end generated code: output=745f51057a985884 input=ded2b46656566283]*/
+{
+ Py_buffer buf;
+
+ GET_BUFFER_VIEW_OR_ERROUT(obj, &buf);
+
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ }
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ update_512(self->state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ update_512(self->state, buf.buf, buf.len);
+ }
+
+ PyBuffer_Release(&buf);
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef SHA256_methods[] = {
+ SHA256TYPE_COPY_METHODDEF
+ SHA256TYPE_DIGEST_METHODDEF
+ SHA256TYPE_HEXDIGEST_METHODDEF
+ SHA256TYPE_UPDATE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyMethodDef SHA512_methods[] = {
+ SHA512TYPE_COPY_METHODDEF
+ SHA512TYPE_DIGEST_METHODDEF
+ SHA512TYPE_HEXDIGEST_METHODDEF
+ SHA512TYPE_UPDATE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static PyObject *
+SHA256_get_block_size(PyObject *self, void *closure)
+{
+ return PyLong_FromLong(SHA256_BLOCKSIZE);
+}
+
+static PyObject *
+SHA512_get_block_size(PyObject *self, void *closure)
+{
+ return PyLong_FromLong(SHA512_BLOCKSIZE);
+}
+
+static PyObject *
+SHA256_get_digest_size(SHA256object *self, void *closure)
+{
+ return PyLong_FromLong(self->digestsize);
+}
+
+static PyObject *
+SHA512_get_digest_size(SHA512object *self, void *closure)
+{
+ return PyLong_FromLong(self->digestsize);
+}
+
+static PyObject *
+SHA256_get_name(SHA256object *self, void *closure)
+{
+ if (self->digestsize == 28) {
+ return PyUnicode_FromStringAndSize("sha224", 6);
+ }
+ return PyUnicode_FromStringAndSize("sha256", 6);
+}
+
+static PyObject *
+SHA512_get_name(SHA512object *self, void *closure)
+{
+ if (self->digestsize == 64) {
+ return PyUnicode_FromStringAndSize("sha512", 6);
+ }
+ return PyUnicode_FromStringAndSize("sha384", 6);
+}
+
+static PyGetSetDef SHA256_getseters[] = {
+ {"block_size",
+ (getter)SHA256_get_block_size, NULL,
+ NULL,
+ NULL},
+ {"name",
+ (getter)SHA256_get_name, NULL,
+ NULL,
+ NULL},
+ {"digest_size",
+ (getter)SHA256_get_digest_size, NULL,
+ NULL,
+ NULL},
+ {NULL} /* Sentinel */
+};
+
+static PyGetSetDef SHA512_getseters[] = {
+ {"block_size",
+ (getter)SHA512_get_block_size, NULL,
+ NULL,
+ NULL},
+ {"name",
+ (getter)SHA512_get_name, NULL,
+ NULL,
+ NULL},
+ {"digest_size",
+ (getter)SHA512_get_digest_size, NULL,
+ NULL,
+ NULL},
+ {NULL} /* Sentinel */
+};
+
+static PyType_Slot sha256_types_slots[] = {
+ {Py_tp_dealloc, SHA256_dealloc},
+ {Py_tp_methods, SHA256_methods},
+ {Py_tp_getset, SHA256_getseters},
+ {Py_tp_traverse, SHA2_traverse},
+ {0,0}
+};
+
+static PyType_Slot sha512_type_slots[] = {
+ {Py_tp_dealloc, SHA512_dealloc},
+ {Py_tp_methods, SHA512_methods},
+ {Py_tp_getset, SHA512_getseters},
+ {Py_tp_traverse, SHA2_traverse},
+ {0,0}
+};
+
+// Using _PyType_GetModuleState() on these types is safe since they
+// cannot be subclassed: they don't have the Py_TPFLAGS_BASETYPE flag.
+static PyType_Spec sha224_type_spec = {
+ .name = "_sha2.SHA224Type",
+ .basicsize = sizeof(SHA256object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC),
+ .slots = sha256_types_slots
+};
+
+static PyType_Spec sha256_type_spec = {
+ .name = "_sha2.SHA256Type",
+ .basicsize = sizeof(SHA256object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC),
+ .slots = sha256_types_slots
+};
+
+static PyType_Spec sha384_type_spec = {
+ .name = "_sha2.SHA384Type",
+ .basicsize = sizeof(SHA512object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC),
+ .slots = sha512_type_slots
+};
+
+static PyType_Spec sha512_type_spec = {
+ .name = "_sha2.SHA512Type",
+ .basicsize = sizeof(SHA512object),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC),
+ .slots = sha512_type_slots
+};
+
+/* The module-level constructors. */
+
+/*[clinic input]
+_sha2.sha256
+
+ string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new SHA-256 hash object; optionally initialized with a string.
+[clinic start generated code]*/
+
+static PyObject *
+_sha2_sha256_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=243c9dd289931f87 input=6249da1de607280a]*/
+{
+ Py_buffer buf;
+
+ if (string) {
+ GET_BUFFER_VIEW_OR_ERROUT(string, &buf);
+ }
+
+ sha2_state *state = sha2_get_state(module);
+
+ SHA256object *new;
+ if ((new = newSHA256object(state)) == NULL) {
+ if (string) {
+ PyBuffer_Release(&buf);
+ }
+ return NULL;
+ }
+
+ new->state = Hacl_Streaming_SHA2_create_in_256();
+ new->digestsize = 32;
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(new);
+ if (string) {
+ PyBuffer_Release(&buf);
+ }
+ return NULL;
+ }
+ if (string) {
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ update_256(new->state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ update_256(new->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)new;
+}
+
+/*[clinic input]
+_sha2.sha224
+
+ string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new SHA-224 hash object; optionally initialized with a string.
+[clinic start generated code]*/
+
+static PyObject *
+_sha2_sha224_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=68191f232e4a3843 input=c42bcba47fd7d2b7]*/
+{
+ Py_buffer buf;
+ if (string) {
+ GET_BUFFER_VIEW_OR_ERROUT(string, &buf);
+ }
+
+ sha2_state *state = sha2_get_state(module);
+ SHA256object *new;
+ if ((new = newSHA224object(state)) == NULL) {
+ if (string) {
+ PyBuffer_Release(&buf);
+ }
+ return NULL;
+ }
+
+ new->state = Hacl_Streaming_SHA2_create_in_224();
+ new->digestsize = 28;
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(new);
+ if (string) {
+ PyBuffer_Release(&buf);
+ }
+ return NULL;
+ }
+ if (string) {
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ update_256(new->state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ update_256(new->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)new;
+}
+
+/*[clinic input]
+_sha2.sha512
+
+ string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new SHA-512 hash object; optionally initialized with a string.
+[clinic start generated code]*/
+
+static PyObject *
+_sha2_sha512_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=d55c8996eca214d7 input=0576ae2a6ebfad25]*/
+{
+ SHA512object *new;
+ Py_buffer buf;
+
+ sha2_state *state = sha2_get_state(module);
+
+ if (string)
+ GET_BUFFER_VIEW_OR_ERROUT(string, &buf);
+
+ if ((new = newSHA512object(state)) == NULL) {
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+
+ new->state = Hacl_Streaming_SHA2_create_in_512();
+ new->digestsize = 64;
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(new);
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+ if (string) {
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ update_512(new->state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ update_512(new->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)new;
+}
+
+/*[clinic input]
+_sha2.sha384
+
+ string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
+
+Return a new SHA-384 hash object; optionally initialized with a string.
+[clinic start generated code]*/
+
+static PyObject *
+_sha2_sha384_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=b29a0d81d51d1368 input=4e9199d8de0d2f9b]*/
+{
+ SHA512object *new;
+ Py_buffer buf;
+
+ sha2_state *state = sha2_get_state(module);
+
+ if (string)
+ GET_BUFFER_VIEW_OR_ERROUT(string, &buf);
+
+ if ((new = newSHA384object(state)) == NULL) {
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+
+ new->state = Hacl_Streaming_SHA2_create_in_384();
+ new->digestsize = 48;
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(new);
+ if (string)
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+ if (string) {
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ update_512(new->state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ update_512(new->state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ }
+
+ return (PyObject *)new;
+}
+
+/* List of functions exported by this module */
+
+static struct PyMethodDef SHA2_functions[] = {
+ _SHA2_SHA256_METHODDEF
+ _SHA2_SHA224_METHODDEF
+ _SHA2_SHA512_METHODDEF
+ _SHA2_SHA384_METHODDEF
+ {NULL, NULL} /* Sentinel */
+};
+
+static int
+_sha2_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ sha2_state *state = sha2_get_state(module);
+ Py_VISIT(state->sha224_type);
+ Py_VISIT(state->sha256_type);
+ Py_VISIT(state->sha384_type);
+ Py_VISIT(state->sha512_type);
+ return 0;
+}
+
+static int
+_sha2_clear(PyObject *module)
+{
+ sha2_state *state = sha2_get_state(module);
+ Py_CLEAR(state->sha224_type);
+ Py_CLEAR(state->sha256_type);
+ Py_CLEAR(state->sha384_type);
+ Py_CLEAR(state->sha512_type);
+ return 0;
+}
+
+static void
+_sha2_free(void *module)
+{
+ _sha2_clear((PyObject *)module);
+}
+
+/* Initialize this module. */
+static int sha2_exec(PyObject *module)
+{
+ sha2_state *state = sha2_get_state(module);
+
+ state->sha224_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &sha224_type_spec, NULL);
+ if (state->sha224_type == NULL) {
+ return -1;
+ }
+ state->sha256_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &sha256_type_spec, NULL);
+ if (state->sha256_type == NULL) {
+ return -1;
+ }
+ state->sha384_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &sha384_type_spec, NULL);
+ if (state->sha384_type == NULL) {
+ return -1;
+ }
+ state->sha512_type = (PyTypeObject *)PyType_FromModuleAndSpec(
+ module, &sha512_type_spec, NULL);
+ if (state->sha512_type == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(module, state->sha224_type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->sha256_type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->sha384_type) < 0) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->sha512_type) < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot _sha2_slots[] = {
+ {Py_mod_exec, sha2_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef _sha2module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_sha2",
+ .m_size = sizeof(sha2_state),
+ .m_methods = SHA2_functions,
+ .m_slots = _sha2_slots,
+ .m_traverse = _sha2_traverse,
+ .m_clear = _sha2_clear,
+ .m_free = _sha2_free
+};
+
+PyMODINIT_FUNC
+PyInit__sha2(void)
+{
+ return PyModuleDef_Init(&_sha2module);
+}
diff --git a/contrib/tools/python3/Modules/sha3module.c b/contrib/tools/python3/Modules/sha3module.c
new file mode 100644
index 00000000000..558d2005cff
--- /dev/null
+++ b/contrib/tools/python3/Modules/sha3module.c
@@ -0,0 +1,623 @@
+/* SHA3 module
+ *
+ * This module provides an interface to the SHA3 algorithm
+ *
+ * See below for information about the original code this module was
+ * based upon. Additional work performed by:
+ *
+ * Andrew Kuchling ([email protected])
+ * Greg Stein ([email protected])
+ * Trevor Perrin ([email protected])
+ * Gregory P. Smith ([email protected])
+ *
+ * Copyright (C) 2012-2022 Christian Heimes ([email protected])
+ * Licensed to PSF under a Contributor Agreement.
+ *
+ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#include "Python.h"
+#include "pycore_strhex.h" // _Py_strhex()
+#include "pycore_typeobject.h" // _PyType_GetModuleState()
+#include "hashlib.h"
+
+#define SHA3_MAX_DIGESTSIZE 64 /* 64 Bytes (512 Bits) for 224 to 512 */
+
+typedef struct {
+ PyTypeObject *sha3_224_type;
+ PyTypeObject *sha3_256_type;
+ PyTypeObject *sha3_384_type;
+ PyTypeObject *sha3_512_type;
+ PyTypeObject *shake_128_type;
+ PyTypeObject *shake_256_type;
+} SHA3State;
+
+static inline SHA3State*
+sha3_get_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (SHA3State *)state;
+}
+
+/*[clinic input]
+module _sha3
+class _sha3.sha3_224 "SHA3object *" "&SHA3_224typ"
+class _sha3.sha3_256 "SHA3object *" "&SHA3_256typ"
+class _sha3.sha3_384 "SHA3object *" "&SHA3_384typ"
+class _sha3.sha3_512 "SHA3object *" "&SHA3_512typ"
+class _sha3.shake_128 "SHA3object *" "&SHAKE128type"
+class _sha3.shake_256 "SHA3object *" "&SHAKE256type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b8a53680f370285a]*/
+
+/* The structure for storing SHA3 info */
+
+#include "_hacl/Hacl_Hash_SHA3.h"
+
+typedef struct {
+ PyObject_HEAD
+ // Prevents undefined behavior via multiple threads entering the C API.
+ // The lock will be NULL before threaded access has been enabled.
+ PyThread_type_lock lock;
+ Hacl_Streaming_Keccak_state *hash_state;
+} SHA3object;
+
+#include "clinic/sha3module.c.h"
+
+static SHA3object *
+newSHA3object(PyTypeObject *type)
+{
+ SHA3object *newobj;
+ newobj = (SHA3object *)PyObject_New(SHA3object, type);
+ if (newobj == NULL) {
+ return NULL;
+ }
+ newobj->lock = NULL;
+ return newobj;
+}
+
+static void sha3_update(Hacl_Streaming_Keccak_state *state, uint8_t *buf, Py_ssize_t len) {
+ /* Note: we explicitly ignore the error code on the basis that it would take >
+ * 1 billion years to hash more than 2^64 bytes. */
+#if PY_SSIZE_T_MAX > UINT32_MAX
+ while (len > UINT32_MAX) {
+ Hacl_Streaming_Keccak_update(state, buf, UINT32_MAX);
+ len -= UINT32_MAX;
+ buf += UINT32_MAX;
+ }
+#endif
+ /* Cast to uint32_t is safe: len <= UINT32_MAX at this point. */
+ Hacl_Streaming_Keccak_update(state, buf, (uint32_t) len);
+}
+
+/*[clinic input]
+@classmethod
+_sha3.sha3_224.__new__ as py_sha3_new
+ data: object(c_default="NULL") = b''
+ /
+ *
+ usedforsecurity: bool = True
+
+Return a new SHA3 hash object.
+[clinic start generated code]*/
+
+static PyObject *
+py_sha3_new_impl(PyTypeObject *type, PyObject *data, int usedforsecurity)
+/*[clinic end generated code: output=90409addc5d5e8b0 input=637e5f8f6a93982a]*/
+{
+ Py_buffer buf = {NULL, NULL};
+ SHA3State *state = _PyType_GetModuleState(type);
+ SHA3object *self = newSHA3object(type);
+ if (self == NULL) {
+ goto error;
+ }
+
+ assert(state != NULL);
+
+ if (type == state->sha3_224_type) {
+ self->hash_state = Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_SHA3_224);
+ } else if (type == state->sha3_256_type) {
+ self->hash_state = Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_SHA3_256);
+ } else if (type == state->sha3_384_type) {
+ self->hash_state = Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_SHA3_384);
+ } else if (type == state->sha3_512_type) {
+ self->hash_state = Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_SHA3_512);
+ } else if (type == state->shake_128_type) {
+ self->hash_state = Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_Shake128);
+ } else if (type == state->shake_256_type) {
+ self->hash_state = Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_Shake256);
+ } else {
+ PyErr_BadInternalCall();
+ goto error;
+ }
+
+ if (data) {
+ GET_BUFFER_VIEW_OR_ERROR(data, &buf, goto error);
+ if (buf.len >= HASHLIB_GIL_MINSIZE) {
+ /* We do not initialize self->lock here as this is the constructor
+ * where it is not yet possible to have concurrent access. */
+ Py_BEGIN_ALLOW_THREADS
+ sha3_update(self->hash_state, buf.buf, buf.len);
+ Py_END_ALLOW_THREADS
+ } else {
+ sha3_update(self->hash_state, buf.buf, buf.len);
+ }
+ }
+
+ PyBuffer_Release(&buf);
+
+ return (PyObject *)self;
+
+ error:
+ if (self) {
+ Py_DECREF(self);
+ }
+ if (data && buf.obj) {
+ PyBuffer_Release(&buf);
+ }
+ return NULL;
+}
+
+
+/* Internal methods for a hash object */
+
+static void
+SHA3_dealloc(SHA3object *self)
+{
+ Hacl_Streaming_Keccak_free(self->hash_state);
+ if (self->lock != NULL) {
+ PyThread_free_lock(self->lock);
+ }
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_Free(self);
+ Py_DECREF(tp);
+}
+
+
+/* External methods for a hash object */
+
+
+/*[clinic input]
+_sha3.sha3_224.copy
+
+Return a copy of the hash object.
+[clinic start generated code]*/
+
+static PyObject *
+_sha3_sha3_224_copy_impl(SHA3object *self)
+/*[clinic end generated code: output=6c537411ecdcda4c input=93a44aaebea51ba8]*/
+{
+ SHA3object *newobj;
+
+ if ((newobj = newSHA3object(Py_TYPE(self))) == NULL) {
+ return NULL;
+ }
+ ENTER_HASHLIB(self);
+ newobj->hash_state = Hacl_Streaming_Keccak_copy(self->hash_state);
+ LEAVE_HASHLIB(self);
+ return (PyObject *)newobj;
+}
+
+
+/*[clinic input]
+_sha3.sha3_224.digest
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+_sha3_sha3_224_digest_impl(SHA3object *self)
+/*[clinic end generated code: output=fd531842e20b2d5b input=5b2a659536bbd248]*/
+{
+ unsigned char digest[SHA3_MAX_DIGESTSIZE];
+ // This function errors out if the algorithm is Shake. Here, we know this
+ // not to be the case, and therefore do not perform error checking.
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_Keccak_finish(self->hash_state, digest);
+ LEAVE_HASHLIB(self);
+ return PyBytes_FromStringAndSize((const char *)digest,
+ Hacl_Streaming_Keccak_hash_len(self->hash_state));
+}
+
+
+/*[clinic input]
+_sha3.sha3_224.hexdigest
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+_sha3_sha3_224_hexdigest_impl(SHA3object *self)
+/*[clinic end generated code: output=75ad03257906918d input=2d91bb6e0d114ee3]*/
+{
+ unsigned char digest[SHA3_MAX_DIGESTSIZE];
+ ENTER_HASHLIB(self);
+ Hacl_Streaming_Keccak_finish(self->hash_state, digest);
+ LEAVE_HASHLIB(self);
+ return _Py_strhex((const char *)digest,
+ Hacl_Streaming_Keccak_hash_len(self->hash_state));
+}
+
+
+/*[clinic input]
+_sha3.sha3_224.update
+
+ data: object
+ /
+
+Update this hash object's state with the provided bytes-like object.
+[clinic start generated code]*/
+
+static PyObject *
+_sha3_sha3_224_update(SHA3object *self, PyObject *data)
+/*[clinic end generated code: output=d3223352286ed357 input=a887f54dcc4ae227]*/
+{
+ Py_buffer buf;
+ GET_BUFFER_VIEW_OR_ERROUT(data, &buf);
+ if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE) {
+ self->lock = PyThread_allocate_lock();
+ }
+ if (self->lock != NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(self->lock, 1);
+ sha3_update(self->hash_state, buf.buf, buf.len);
+ PyThread_release_lock(self->lock);
+ Py_END_ALLOW_THREADS
+ } else {
+ sha3_update(self->hash_state, buf.buf, buf.len);
+ }
+ PyBuffer_Release(&buf);
+ Py_RETURN_NONE;
+}
+
+
+static PyMethodDef SHA3_methods[] = {
+ _SHA3_SHA3_224_COPY_METHODDEF
+ _SHA3_SHA3_224_DIGEST_METHODDEF
+ _SHA3_SHA3_224_HEXDIGEST_METHODDEF
+ _SHA3_SHA3_224_UPDATE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+
+static PyObject *
+SHA3_get_block_size(SHA3object *self, void *closure)
+{
+ uint32_t rate = Hacl_Streaming_Keccak_block_len(self->hash_state);
+ return PyLong_FromLong(rate);
+}
+
+
+static PyObject *
+SHA3_get_name(SHA3object *self, void *closure)
+{
+ PyTypeObject *type = Py_TYPE(self);
+
+ SHA3State *state = _PyType_GetModuleState(type);
+ assert(state != NULL);
+
+ if (type == state->sha3_224_type) {
+ return PyUnicode_FromString("sha3_224");
+ } else if (type == state->sha3_256_type) {
+ return PyUnicode_FromString("sha3_256");
+ } else if (type == state->sha3_384_type) {
+ return PyUnicode_FromString("sha3_384");
+ } else if (type == state->sha3_512_type) {
+ return PyUnicode_FromString("sha3_512");
+ } else if (type == state->shake_128_type) {
+ return PyUnicode_FromString("shake_128");
+ } else if (type == state->shake_256_type) {
+ return PyUnicode_FromString("shake_256");
+ } else {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+}
+
+
+static PyObject *
+SHA3_get_digest_size(SHA3object *self, void *closure)
+{
+ // Preserving previous behavior: variable-length algorithms return 0
+ if (Hacl_Streaming_Keccak_is_shake(self->hash_state))
+ return PyLong_FromLong(0);
+ else
+ return PyLong_FromLong(Hacl_Streaming_Keccak_hash_len(self->hash_state));
+}
+
+
+static PyObject *
+SHA3_get_capacity_bits(SHA3object *self, void *closure)
+{
+ uint32_t rate = Hacl_Streaming_Keccak_block_len(self->hash_state) * 8;
+ int capacity = 1600 - rate;
+ return PyLong_FromLong(capacity);
+}
+
+
+static PyObject *
+SHA3_get_rate_bits(SHA3object *self, void *closure)
+{
+ uint32_t rate = Hacl_Streaming_Keccak_block_len(self->hash_state) * 8;
+ return PyLong_FromLong(rate);
+}
+
+static PyObject *
+SHA3_get_suffix(SHA3object *self, void *closure)
+{
+ unsigned char suffix[2] = {0x06, 0};
+ return PyBytes_FromStringAndSize((const char *)suffix, 1);
+}
+
+static PyGetSetDef SHA3_getseters[] = {
+ {"block_size", (getter)SHA3_get_block_size, NULL, NULL, NULL},
+ {"name", (getter)SHA3_get_name, NULL, NULL, NULL},
+ {"digest_size", (getter)SHA3_get_digest_size, NULL, NULL, NULL},
+ {"_capacity_bits", (getter)SHA3_get_capacity_bits, NULL, NULL, NULL},
+ {"_rate_bits", (getter)SHA3_get_rate_bits, NULL, NULL, NULL},
+ {"_suffix", (getter)SHA3_get_suffix, NULL, NULL, NULL},
+ {NULL} /* Sentinel */
+};
+
+#define SHA3_TYPE_SLOTS(type_slots_obj, type_doc, type_methods, type_getseters) \
+ static PyType_Slot type_slots_obj[] = { \
+ {Py_tp_dealloc, SHA3_dealloc}, \
+ {Py_tp_doc, (char*)type_doc}, \
+ {Py_tp_methods, type_methods}, \
+ {Py_tp_getset, type_getseters}, \
+ {Py_tp_new, py_sha3_new}, \
+ {0,0} \
+ }
+
+// Using _PyType_GetModuleState() on these types is safe since they
+// cannot be subclassed: it does not have the Py_TPFLAGS_BASETYPE flag.
+#define SHA3_TYPE_SPEC(type_spec_obj, type_name, type_slots) \
+ static PyType_Spec type_spec_obj = { \
+ .name = "_sha3." type_name, \
+ .basicsize = sizeof(SHA3object), \
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE, \
+ .slots = type_slots \
+ }
+
+PyDoc_STRVAR(sha3_224__doc__,
+"sha3_224([data], *, usedforsecurity=True) -> SHA3 object\n\
+\n\
+Return a new SHA3 hash object with a hashbit length of 28 bytes.");
+
+PyDoc_STRVAR(sha3_256__doc__,
+"sha3_256([data], *, usedforsecurity=True) -> SHA3 object\n\
+\n\
+Return a new SHA3 hash object with a hashbit length of 32 bytes.");
+
+PyDoc_STRVAR(sha3_384__doc__,
+"sha3_384([data], *, usedforsecurity=True) -> SHA3 object\n\
+\n\
+Return a new SHA3 hash object with a hashbit length of 48 bytes.");
+
+PyDoc_STRVAR(sha3_512__doc__,
+"sha3_512([data], *, usedforsecurity=True) -> SHA3 object\n\
+\n\
+Return a new SHA3 hash object with a hashbit length of 64 bytes.");
+
+SHA3_TYPE_SLOTS(sha3_224_slots, sha3_224__doc__, SHA3_methods, SHA3_getseters);
+SHA3_TYPE_SPEC(sha3_224_spec, "sha3_224", sha3_224_slots);
+
+SHA3_TYPE_SLOTS(sha3_256_slots, sha3_256__doc__, SHA3_methods, SHA3_getseters);
+SHA3_TYPE_SPEC(sha3_256_spec, "sha3_256", sha3_256_slots);
+
+SHA3_TYPE_SLOTS(sha3_384_slots, sha3_384__doc__, SHA3_methods, SHA3_getseters);
+SHA3_TYPE_SPEC(sha3_384_spec, "sha3_384", sha3_384_slots);
+
+SHA3_TYPE_SLOTS(sha3_512_slots, sha3_512__doc__, SHA3_methods, SHA3_getseters);
+SHA3_TYPE_SPEC(sha3_512_spec, "sha3_512", sha3_512_slots);
+
+static PyObject *
+_SHAKE_digest(SHA3object *self, unsigned long digestlen, int hex)
+{
+ unsigned char *digest = NULL;
+ PyObject *result = NULL;
+
+ if (digestlen >= (1 << 29)) {
+ PyErr_SetString(PyExc_ValueError, "length is too large");
+ return NULL;
+ }
+ digest = (unsigned char*)PyMem_Malloc(digestlen);
+ if (digest == NULL) {
+ return PyErr_NoMemory();
+ }
+
+ /* Get the raw (binary) digest value. The HACL functions errors out if:
+ * - the algorith is not shake -- not the case here
+ * - the output length is zero -- we follow the existing behavior and return
+ * an empty digest, without raising an error */
+ if (digestlen > 0) {
+ Hacl_Streaming_Keccak_squeeze(self->hash_state, digest, digestlen);
+ }
+ if (hex) {
+ result = _Py_strhex((const char *)digest, digestlen);
+ } else {
+ result = PyBytes_FromStringAndSize((const char *)digest,
+ digestlen);
+ }
+ if (digest != NULL) {
+ PyMem_Free(digest);
+ }
+ return result;
+}
+
+
+/*[clinic input]
+_sha3.shake_128.digest
+
+ length: unsigned_long
+ /
+
+Return the digest value as a bytes object.
+[clinic start generated code]*/
+
+static PyObject *
+_sha3_shake_128_digest_impl(SHA3object *self, unsigned long length)
+/*[clinic end generated code: output=2313605e2f87bb8f input=418ef6a36d2e6082]*/
+{
+ return _SHAKE_digest(self, length, 0);
+}
+
+
+/*[clinic input]
+_sha3.shake_128.hexdigest
+
+ length: unsigned_long
+ /
+
+Return the digest value as a string of hexadecimal digits.
+[clinic start generated code]*/
+
+static PyObject *
+_sha3_shake_128_hexdigest_impl(SHA3object *self, unsigned long length)
+/*[clinic end generated code: output=bf8e2f1e490944a8 input=69fb29b0926ae321]*/
+{
+ return _SHAKE_digest(self, length, 1);
+}
+
+static PyObject *
+SHAKE_get_digest_size(SHA3object *self, void *closure)
+{
+ return PyLong_FromLong(0);
+}
+
+static PyObject *
+SHAKE_get_suffix(SHA3object *self, void *closure)
+{
+ unsigned char suffix[2] = {0x1f, 0};
+ return PyBytes_FromStringAndSize((const char *)suffix, 1);
+}
+
+
+static PyGetSetDef SHAKE_getseters[] = {
+ {"block_size", (getter)SHA3_get_block_size, NULL, NULL, NULL},
+ {"name", (getter)SHA3_get_name, NULL, NULL, NULL},
+ {"digest_size", (getter)SHAKE_get_digest_size, NULL, NULL, NULL},
+ {"_capacity_bits", (getter)SHA3_get_capacity_bits, NULL, NULL, NULL},
+ {"_rate_bits", (getter)SHA3_get_rate_bits, NULL, NULL, NULL},
+ {"_suffix", (getter)SHAKE_get_suffix, NULL, NULL, NULL},
+ {NULL} /* Sentinel */
+};
+
+
+static PyMethodDef SHAKE_methods[] = {
+ _SHA3_SHA3_224_COPY_METHODDEF
+ _SHA3_SHAKE_128_DIGEST_METHODDEF
+ _SHA3_SHAKE_128_HEXDIGEST_METHODDEF
+ _SHA3_SHA3_224_UPDATE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+PyDoc_STRVAR(shake_128__doc__,
+"shake_128([data], *, usedforsecurity=True) -> SHAKE object\n\
+\n\
+Return a new SHAKE hash object.");
+
+PyDoc_STRVAR(shake_256__doc__,
+"shake_256([data], *, usedforsecurity=True) -> SHAKE object\n\
+\n\
+Return a new SHAKE hash object.");
+
+SHA3_TYPE_SLOTS(SHAKE128slots, shake_128__doc__, SHAKE_methods, SHAKE_getseters);
+SHA3_TYPE_SPEC(SHAKE128_spec, "shake_128", SHAKE128slots);
+
+SHA3_TYPE_SLOTS(SHAKE256slots, shake_256__doc__, SHAKE_methods, SHAKE_getseters);
+SHA3_TYPE_SPEC(SHAKE256_spec, "shake_256", SHAKE256slots);
+
+
+static int
+_sha3_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ SHA3State *state = sha3_get_state(module);
+ Py_VISIT(state->sha3_224_type);
+ Py_VISIT(state->sha3_256_type);
+ Py_VISIT(state->sha3_384_type);
+ Py_VISIT(state->sha3_512_type);
+ Py_VISIT(state->shake_128_type);
+ Py_VISIT(state->shake_256_type);
+ return 0;
+}
+
+static int
+_sha3_clear(PyObject *module)
+{
+ SHA3State *state = sha3_get_state(module);
+ Py_CLEAR(state->sha3_224_type);
+ Py_CLEAR(state->sha3_256_type);
+ Py_CLEAR(state->sha3_384_type);
+ Py_CLEAR(state->sha3_512_type);
+ Py_CLEAR(state->shake_128_type);
+ Py_CLEAR(state->shake_256_type);
+ return 0;
+}
+
+static void
+_sha3_free(void *module)
+{
+ _sha3_clear((PyObject *)module);
+}
+
+static int
+_sha3_exec(PyObject *m)
+{
+ SHA3State *st = sha3_get_state(m);
+
+#define init_sha3type(type, typespec) \
+ do { \
+ st->type = (PyTypeObject *)PyType_FromModuleAndSpec( \
+ m, &typespec, NULL); \
+ if (st->type == NULL) { \
+ return -1; \
+ } \
+ if (PyModule_AddType(m, st->type) < 0) { \
+ return -1; \
+ } \
+ } while(0)
+
+ init_sha3type(sha3_224_type, sha3_224_spec);
+ init_sha3type(sha3_256_type, sha3_256_spec);
+ init_sha3type(sha3_384_type, sha3_384_spec);
+ init_sha3type(sha3_512_type, sha3_512_spec);
+ init_sha3type(shake_128_type, SHAKE128_spec);
+ init_sha3type(shake_256_type, SHAKE256_spec);
+#undef init_sha3type
+
+ if (PyModule_AddStringConstant(m, "implementation",
+ "HACL") < 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
+static PyModuleDef_Slot _sha3_slots[] = {
+ {Py_mod_exec, _sha3_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+/* Initialize this module. */
+static struct PyModuleDef _sha3module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_sha3",
+ .m_size = sizeof(SHA3State),
+ .m_slots = _sha3_slots,
+ .m_traverse = _sha3_traverse,
+ .m_clear = _sha3_clear,
+ .m_free = _sha3_free,
+};
+
+
+PyMODINIT_FUNC
+PyInit__sha3(void)
+{
+ return PyModuleDef_Init(&_sha3module);
+}
diff --git a/contrib/tools/python3/Modules/signalmodule.c b/contrib/tools/python3/Modules/signalmodule.c
new file mode 100644
index 00000000000..00ea4343735
--- /dev/null
+++ b/contrib/tools/python3/Modules/signalmodule.c
@@ -0,0 +1,2062 @@
+
+/* Signal module -- many thanks to Lance Ellinghaus */
+
+/* XXX Signals should be recorded per thread, now we have thread state. */
+
+#include "Python.h"
+#include "pycore_atomic.h" // _Py_atomic_int
+#include "pycore_call.h" // _PyObject_Call()
+#include "pycore_ceval.h" // _PyEval_SignalReceived()
+#include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS
+#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
+#include "pycore_frame.h" // _PyInterpreterFrame
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_pyerrors.h" // _PyErr_SetString()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_signal.h" // Py_NSIG
+
+#ifndef MS_WINDOWS
+# include "posixmodule.h"
+#endif
+#ifdef MS_WINDOWS
+# include "socketmodule.h" /* needed for SOCKET_T */
+#endif
+
+#ifdef MS_WINDOWS
+# ifdef HAVE_PROCESS_H
+# include <process.h>
+# endif
+#endif
+
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+#ifdef HAVE_SYS_SYSCALL_H
+# include <sys/syscall.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
+# define PYPTHREAD_SIGMASK
+#endif
+
+#if defined(PYPTHREAD_SIGMASK) && defined(HAVE_PTHREAD_H)
+# include <pthread.h>
+#endif
+
+#ifndef SIG_ERR
+# define SIG_ERR ((PyOS_sighandler_t)(-1))
+#endif
+
+#include "clinic/signalmodule.c.h"
+
+/*[clinic input]
+module signal
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b0301a3bde5fe9d3]*/
+
+#ifdef HAVE_SETSIG_T
+
+/*[python input]
+
+class sigset_t_converter(CConverter):
+ type = 'sigset_t'
+ converter = '_Py_Sigset_Converter'
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=b5689d14466b6823]*/
+#endif
+
+/*
+ NOTES ON THE INTERACTION BETWEEN SIGNALS AND THREADS
+
+ We want the following semantics:
+
+ - only the main thread can set a signal handler
+ - only the main thread runs the signal handler
+ - signals can be delivered to any thread
+ - any thread can get a signal handler
+
+ I.e. we don't support "synchronous signals" like SIGFPE (catching
+ this doesn't make much sense in Python anyway) nor do we support
+ signals as a means of inter-thread communication, since not all
+ thread implementations support that (at least our thread library
+ doesn't).
+
+ We still have the problem that in some implementations signals
+ generated by the keyboard (e.g. SIGINT) are delivered to all
+ threads (e.g. SGI), while in others (e.g. Solaris) such signals are
+ delivered to one random thread. On Linux, signals are delivered to
+ the main thread (unless the main thread is blocking the signal, for
+ example because it's already handling the same signal). Since we
+ allow signals to be delivered to any thread, this works fine. The
+ only oddity is that the thread executing the Python signal handler
+ may not be the thread that received the signal.
+*/
+
+#define Handlers _PyRuntime.signals.handlers
+#define wakeup _PyRuntime.signals.wakeup
+#define is_tripped _PyRuntime.signals.is_tripped
+
+// State shared by all Python interpreters
+typedef struct _signals_runtime_state signal_state_t;
+#define signal_global_state _PyRuntime.signals
+
+#if defined(HAVE_GETITIMER) || defined(HAVE_SETITIMER)
+# define PYHAVE_ITIMER_ERROR
+#endif
+
+typedef struct {
+ PyObject *default_handler; // borrowed ref (signal_global_state)
+ PyObject *ignore_handler; // borrowed ref (signal_global_state)
+#ifdef PYHAVE_ITIMER_ERROR
+ PyObject *itimer_error;
+#endif
+ PyTypeObject *siginfo_type;
+} _signal_module_state;
+
+
+Py_LOCAL_INLINE(PyObject *)
+get_handler(int i)
+{
+ return (PyObject *)_Py_atomic_load(&Handlers[i].func);
+}
+
+Py_LOCAL_INLINE(void)
+set_handler(int i, PyObject* func)
+{
+ _Py_atomic_store(&Handlers[i].func, (uintptr_t)func);
+}
+
+
+static inline _signal_module_state*
+get_signal_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (_signal_module_state *)state;
+}
+
+
+static inline int
+compare_handler(PyObject *func, PyObject *dfl_ign_handler)
+{
+ // See https://github.com/python/cpython/pull/102399
+ if (func == NULL || dfl_ign_handler == NULL) {
+ return 0;
+ }
+ assert(PyLong_CheckExact(dfl_ign_handler));
+ if (!PyLong_CheckExact(func)) {
+ return 0;
+ }
+ // Assume that comparison of two PyLong objects will never fail.
+ return PyObject_RichCompareBool(func, dfl_ign_handler, Py_EQ) == 1;
+}
+
+#ifdef HAVE_SETITIMER
+/* auxiliary function for setitimer */
+static int
+timeval_from_double(PyObject *obj, struct timeval *tv)
+{
+ if (obj == NULL) {
+ tv->tv_sec = 0;
+ tv->tv_usec = 0;
+ return 0;
+ }
+
+ _PyTime_t t;
+ if (_PyTime_FromSecondsObject(&t, obj, _PyTime_ROUND_CEILING) < 0) {
+ return -1;
+ }
+ return _PyTime_AsTimeval(t, tv, _PyTime_ROUND_CEILING);
+}
+#endif
+
+#if defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER)
+/* auxiliary functions for get/setitimer */
+Py_LOCAL_INLINE(double)
+double_from_timeval(struct timeval *tv)
+{
+ return tv->tv_sec + (double)(tv->tv_usec / 1000000.0);
+}
+
+static PyObject *
+itimer_retval(struct itimerval *iv)
+{
+ PyObject *r, *v;
+
+ r = PyTuple_New(2);
+ if (r == NULL)
+ return NULL;
+
+ if(!(v = PyFloat_FromDouble(double_from_timeval(&iv->it_value)))) {
+ Py_DECREF(r);
+ return NULL;
+ }
+
+ PyTuple_SET_ITEM(r, 0, v);
+
+ if(!(v = PyFloat_FromDouble(double_from_timeval(&iv->it_interval)))) {
+ Py_DECREF(r);
+ return NULL;
+ }
+
+ PyTuple_SET_ITEM(r, 1, v);
+
+ return r;
+}
+#endif
+
+/*[clinic input]
+signal.default_int_handler
+ signalnum: int
+ frame: object
+ /
+
+The default handler for SIGINT installed by Python.
+
+It raises KeyboardInterrupt.
+[clinic start generated code]*/
+
+static PyObject *
+signal_default_int_handler_impl(PyObject *module, int signalnum,
+ PyObject *frame)
+/*[clinic end generated code: output=bb11c2eb115ace4e input=efcd4a56a207acfd]*/
+{
+ PyErr_SetNone(PyExc_KeyboardInterrupt);
+ return NULL;
+}
+
+
+static int
+report_wakeup_write_error(void *data)
+{
+ int save_errno = errno;
+ errno = (int) (intptr_t) data;
+ PyObject *exc = PyErr_GetRaisedException();
+ PyErr_SetFromErrno(PyExc_OSError);
+ _PyErr_WriteUnraisableMsg("when trying to write to the signal wakeup fd",
+ NULL);
+ PyErr_SetRaisedException(exc);
+ errno = save_errno;
+ return 0;
+}
+
+#ifdef MS_WINDOWS
+static int
+report_wakeup_send_error(void* data)
+{
+ int send_errno = (int) (intptr_t) data;
+
+ PyObject *exc = PyErr_GetRaisedException();
+ /* PyErr_SetExcFromWindowsErr() invokes FormatMessage() which
+ recognizes the error codes used by both GetLastError() and
+ WSAGetLastError */
+ PyErr_SetExcFromWindowsErr(PyExc_OSError, send_errno);
+ _PyErr_WriteUnraisableMsg("when trying to send to the signal wakeup fd", NULL);
+ PyErr_SetRaisedException(exc);
+ return 0;
+}
+#endif /* MS_WINDOWS */
+
+static void
+trip_signal(int sig_num)
+{
+ _Py_atomic_store_relaxed(&Handlers[sig_num].tripped, 1);
+
+ /* Set is_tripped after setting .tripped, as it gets
+ cleared in PyErr_CheckSignals() before .tripped. */
+ _Py_atomic_store(&is_tripped, 1);
+
+ /* Signals are always handled by the main interpreter */
+ PyInterpreterState *interp = _PyInterpreterState_Main();
+
+ /* Notify ceval.c */
+ _PyEval_SignalReceived(interp);
+
+ /* And then write to the wakeup fd *after* setting all the globals and
+ doing the _PyEval_SignalReceived. We used to write to the wakeup fd
+ and then set the flag, but this allowed the following sequence of events
+ (especially on windows, where trip_signal may run in a new thread):
+
+ - main thread blocks on select([wakeup.fd], ...)
+ - signal arrives
+ - trip_signal writes to the wakeup fd
+ - the main thread wakes up
+ - the main thread checks the signal flags, sees that they're unset
+ - the main thread empties the wakeup fd
+ - the main thread goes back to sleep
+ - trip_signal sets the flags to request the Python-level signal handler
+ be run
+ - the main thread doesn't notice, because it's asleep
+
+ See bpo-30038 for more details.
+ */
+
+ int fd = wakeup.fd;
+ if (fd != INVALID_FD) {
+ unsigned char byte = (unsigned char)sig_num;
+#ifdef MS_WINDOWS
+ if (wakeup.use_send) {
+ Py_ssize_t rc = send(fd, &byte, 1, 0);
+
+ if (rc < 0) {
+ int last_error = GetLastError();
+ if (wakeup.warn_on_full_buffer ||
+ last_error != WSAEWOULDBLOCK)
+ {
+ /* _PyEval_AddPendingCall() isn't signal-safe, but we
+ still use it for this exceptional case. */
+ _PyEval_AddPendingCall(interp,
+ report_wakeup_send_error,
+ (void *)(intptr_t) last_error,
+ 1);
+ }
+ }
+ }
+ else
+#endif
+ {
+ /* _Py_write_noraise() retries write() if write() is interrupted by
+ a signal (fails with EINTR). */
+ Py_ssize_t rc = _Py_write_noraise(fd, &byte, 1);
+
+ if (rc < 0) {
+ if (wakeup.warn_on_full_buffer ||
+ (errno != EWOULDBLOCK && errno != EAGAIN))
+ {
+ /* _PyEval_AddPendingCall() isn't signal-safe, but we
+ still use it for this exceptional case. */
+ _PyEval_AddPendingCall(interp,
+ report_wakeup_write_error,
+ (void *)(intptr_t)errno,
+ 1);
+ }
+ }
+ }
+ }
+}
+
+static void
+signal_handler(int sig_num)
+{
+ int save_errno = errno;
+
+ trip_signal(sig_num);
+
+#ifndef HAVE_SIGACTION
+#ifdef SIGCHLD
+ /* To avoid infinite recursion, this signal remains
+ reset until explicit re-instated.
+ Don't clear the 'func' field as it is our pointer
+ to the Python handler... */
+ if (sig_num != SIGCHLD)
+#endif
+ /* If the handler was not set up with sigaction, reinstall it. See
+ * Python/pylifecycle.c for the implementation of PyOS_setsig which
+ * makes this true. See also issue8354. */
+ PyOS_setsig(sig_num, signal_handler);
+#endif
+
+ /* Issue #10311: asynchronously executing signal handlers should not
+ mutate errno under the feet of unsuspecting C code. */
+ errno = save_errno;
+
+#ifdef MS_WINDOWS
+ if (sig_num == SIGINT) {
+ signal_state_t *state = &signal_global_state;
+ SetEvent((HANDLE)state->sigint_event);
+ }
+#endif
+}
+
+
+#ifdef HAVE_ALARM
+
+/*[clinic input]
+signal.alarm -> long
+
+ seconds: int
+ /
+
+Arrange for SIGALRM to arrive after the given number of seconds.
+[clinic start generated code]*/
+
+static long
+signal_alarm_impl(PyObject *module, int seconds)
+/*[clinic end generated code: output=144232290814c298 input=0d5e97e0e6f39e86]*/
+{
+ /* alarm() returns the number of seconds remaining */
+ return (long)alarm(seconds);
+}
+
+#endif
+
+#ifdef HAVE_PAUSE
+
+/*[clinic input]
+signal.pause
+
+Wait until a signal arrives.
+[clinic start generated code]*/
+
+static PyObject *
+signal_pause_impl(PyObject *module)
+/*[clinic end generated code: output=391656788b3c3929 input=f03de0f875752062]*/
+{
+ Py_BEGIN_ALLOW_THREADS
+ (void)pause();
+ Py_END_ALLOW_THREADS
+ /* make sure that any exceptions that got raised are propagated
+ * back into Python
+ */
+ if (PyErr_CheckSignals())
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+#endif
+
+/*[clinic input]
+signal.raise_signal
+
+ signalnum: int
+ /
+
+Send a signal to the executing process.
+[clinic start generated code]*/
+
+static PyObject *
+signal_raise_signal_impl(PyObject *module, int signalnum)
+/*[clinic end generated code: output=e2b014220aa6111d input=e90c0f9a42358de6]*/
+{
+ int err;
+ Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
+ err = raise(signalnum);
+ _Py_END_SUPPRESS_IPH
+ Py_END_ALLOW_THREADS
+
+ if (err) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+
+ // If the current thread can handle signals, handle immediately
+ // the raised signal.
+ if (PyErr_CheckSignals()) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+signal.signal
+
+ signalnum: int
+ handler: object
+ /
+
+Set the action for the given signal.
+
+The action can be SIG_DFL, SIG_IGN, or a callable Python object.
+The previous action is returned. See getsignal() for possible return values.
+
+*** IMPORTANT NOTICE ***
+A signal handler function is called with two arguments:
+the first is the signal number, the second is the interrupted stack frame.
+[clinic start generated code]*/
+
+static PyObject *
+signal_signal_impl(PyObject *module, int signalnum, PyObject *handler)
+/*[clinic end generated code: output=b44cfda43780f3a1 input=deee84af5fa0432c]*/
+{
+ _signal_module_state *modstate = get_signal_state(module);
+ PyObject *old_handler;
+ void (*func)(int);
+#ifdef MS_WINDOWS
+ /* Validate that signalnum is one of the allowable signals */
+ switch (signalnum) {
+ case SIGABRT: break;
+#ifdef SIGBREAK
+ /* Issue #10003: SIGBREAK is not documented as permitted, but works
+ and corresponds to CTRL_BREAK_EVENT. */
+ case SIGBREAK: break;
+#endif
+ case SIGFPE: break;
+ case SIGILL: break;
+ case SIGINT: break;
+ case SIGSEGV: break;
+ case SIGTERM: break;
+ default:
+ PyErr_SetString(PyExc_ValueError, "invalid signal value");
+ return NULL;
+ }
+#endif
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
+ _PyErr_SetString(tstate, PyExc_ValueError,
+ "signal only works in main thread "
+ "of the main interpreter");
+ return NULL;
+ }
+ if (signalnum < 1 || signalnum >= Py_NSIG) {
+ _PyErr_SetString(tstate, PyExc_ValueError,
+ "signal number out of range");
+ return NULL;
+ }
+ if (PyCallable_Check(handler)) {
+ func = signal_handler;
+ } else if (compare_handler(handler, modstate->ignore_handler)) {
+ func = SIG_IGN;
+ } else if (compare_handler(handler, modstate->default_handler)) {
+ func = SIG_DFL;
+ } else {
+ _PyErr_SetString(tstate, PyExc_TypeError,
+ "signal handler must be signal.SIG_IGN, "
+ "signal.SIG_DFL, or a callable object");
+ return NULL;
+ }
+
+ /* Check for pending signals before changing signal handler */
+ if (_PyErr_CheckSignalsTstate(tstate)) {
+ return NULL;
+ }
+ if (PyOS_setsig(signalnum, func) == SIG_ERR) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ old_handler = get_handler(signalnum);
+ set_handler(signalnum, Py_NewRef(handler));
+
+ if (old_handler != NULL) {
+ return old_handler;
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+
+
+/*[clinic input]
+signal.getsignal
+
+ signalnum: int
+ /
+
+Return the current action for the given signal.
+
+The return value can be:
+ SIG_IGN -- if the signal is being ignored
+ SIG_DFL -- if the default action for the signal is in effect
+ None -- if an unknown handler is in effect
+ anything else -- the callable Python object used as a handler
+[clinic start generated code]*/
+
+static PyObject *
+signal_getsignal_impl(PyObject *module, int signalnum)
+/*[clinic end generated code: output=35b3e0e796fd555e input=ac23a00f19dfa509]*/
+{
+ PyObject *old_handler;
+ if (signalnum < 1 || signalnum >= Py_NSIG) {
+ PyErr_SetString(PyExc_ValueError,
+ "signal number out of range");
+ return NULL;
+ }
+ old_handler = get_handler(signalnum);
+ if (old_handler != NULL) {
+ return Py_NewRef(old_handler);
+ }
+ else {
+ Py_RETURN_NONE;
+ }
+}
+
+
+/*[clinic input]
+signal.strsignal
+
+ signalnum: int
+ /
+
+Return the system description of the given signal.
+
+Returns the description of signal *signalnum*, such as "Interrupt"
+for :const:`SIGINT`. Returns :const:`None` if *signalnum* has no
+description. Raises :exc:`ValueError` if *signalnum* is invalid.
+[clinic start generated code]*/
+
+static PyObject *
+signal_strsignal_impl(PyObject *module, int signalnum)
+/*[clinic end generated code: output=44e12e1e3b666261 input=238b335847778bc0]*/
+{
+ const char *res;
+
+ if (signalnum < 1 || signalnum >= Py_NSIG) {
+ PyErr_SetString(PyExc_ValueError,
+ "signal number out of range");
+ return NULL;
+ }
+
+#ifndef HAVE_STRSIGNAL
+ switch (signalnum) {
+ /* Though being a UNIX, HP-UX does not provide strsignal(3). */
+#ifndef MS_WINDOWS
+ case SIGHUP:
+ res = "Hangup";
+ break;
+ case SIGALRM:
+ res = "Alarm clock";
+ break;
+ case SIGPIPE:
+ res = "Broken pipe";
+ break;
+ case SIGQUIT:
+ res = "Quit";
+ break;
+ case SIGCHLD:
+ res = "Child exited";
+ break;
+#endif
+ /* Custom redefinition of POSIX signals allowed on Windows. */
+ case SIGINT:
+ res = "Interrupt";
+ break;
+ case SIGILL:
+ res = "Illegal instruction";
+ break;
+ case SIGABRT:
+ res = "Aborted";
+ break;
+ case SIGFPE:
+ res = "Floating point exception";
+ break;
+ case SIGSEGV:
+ res = "Segmentation fault";
+ break;
+ case SIGTERM:
+ res = "Terminated";
+ break;
+ default:
+ Py_RETURN_NONE;
+ }
+#else
+ errno = 0;
+ res = strsignal(signalnum);
+
+ if (errno || res == NULL || strstr(res, "Unknown signal") != NULL)
+ Py_RETURN_NONE;
+#endif
+
+ return Py_BuildValue("s", res);
+}
+
+#ifdef HAVE_SIGINTERRUPT
+
+/*[clinic input]
+signal.siginterrupt
+
+ signalnum: int
+ flag: int
+ /
+
+Change system call restart behaviour.
+
+If flag is False, system calls will be restarted when interrupted by
+signal sig, else system calls will be interrupted.
+[clinic start generated code]*/
+
+static PyObject *
+signal_siginterrupt_impl(PyObject *module, int signalnum, int flag)
+/*[clinic end generated code: output=063816243d85dd19 input=4160acacca3e2099]*/
+{
+ if (signalnum < 1 || signalnum >= Py_NSIG) {
+ PyErr_SetString(PyExc_ValueError,
+ "signal number out of range");
+ return NULL;
+ }
+#ifdef HAVE_SIGACTION
+ struct sigaction act;
+ (void) sigaction(signalnum, NULL, &act);
+ if (flag) {
+ act.sa_flags &= ~SA_RESTART;
+ }
+ else {
+ act.sa_flags |= SA_RESTART;
+ }
+ if (sigaction(signalnum, &act, NULL) < 0) {
+#else
+ if (siginterrupt(signalnum, flag) < 0) {
+#endif
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+#endif
+
+
+static PyObject*
+signal_set_wakeup_fd(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ struct _Py_stat_struct status;
+ static char *kwlist[] = {
+ "", "warn_on_full_buffer", NULL,
+ };
+ int warn_on_full_buffer = 1;
+#ifdef MS_WINDOWS
+ PyObject *fdobj;
+ SOCKET_T sockfd, old_sockfd;
+ int res;
+ int res_size = sizeof res;
+ PyObject *mod;
+ int is_socket;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|$p:set_wakeup_fd", kwlist,
+ &fdobj, &warn_on_full_buffer))
+ return NULL;
+
+ sockfd = PyLong_AsSocket_t(fdobj);
+ if (sockfd == (SOCKET_T)(-1) && PyErr_Occurred())
+ return NULL;
+#else
+ int fd;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "i|$p:set_wakeup_fd", kwlist,
+ &fd, &warn_on_full_buffer))
+ return NULL;
+#endif
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
+ _PyErr_SetString(tstate, PyExc_ValueError,
+ "set_wakeup_fd only works in main thread "
+ "of the main interpreter");
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ is_socket = 0;
+ if (sockfd != INVALID_FD) {
+ /* Import the _socket module to call WSAStartup() */
+ mod = PyImport_ImportModule("_socket");
+ if (mod == NULL)
+ return NULL;
+ Py_DECREF(mod);
+
+ /* test the socket */
+ if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR,
+ (char *)&res, &res_size) != 0) {
+ int fd, err;
+
+ err = WSAGetLastError();
+ if (err != WSAENOTSOCK) {
+ PyErr_SetExcFromWindowsErr(PyExc_OSError, err);
+ return NULL;
+ }
+
+ fd = (int)sockfd;
+ if ((SOCKET_T)fd != sockfd) {
+ _PyErr_SetString(tstate, PyExc_ValueError, "invalid fd");
+ return NULL;
+ }
+
+ if (_Py_fstat(fd, &status) != 0) {
+ return NULL;
+ }
+
+ /* on Windows, a file cannot be set to non-blocking mode */
+ }
+ else {
+ is_socket = 1;
+
+ /* Windows does not provide a function to test if a socket
+ is in non-blocking mode */
+ }
+ }
+
+ old_sockfd = wakeup.fd;
+ wakeup.fd = Py_SAFE_DOWNCAST(sockfd, SOCKET_T, int);
+ wakeup.warn_on_full_buffer = warn_on_full_buffer;
+ wakeup.use_send = is_socket;
+
+ if (old_sockfd != INVALID_FD)
+ return PyLong_FromSocket_t(old_sockfd);
+ else
+ return PyLong_FromLong(-1);
+#else
+ if (fd != -1) {
+ int blocking;
+
+ if (_Py_fstat(fd, &status) != 0)
+ return NULL;
+
+ blocking = _Py_get_blocking(fd);
+ if (blocking < 0)
+ return NULL;
+ if (blocking) {
+ _PyErr_Format(tstate, PyExc_ValueError,
+ "the fd %i must be in non-blocking mode",
+ fd);
+ return NULL;
+ }
+ }
+
+ int old_fd = wakeup.fd;
+ wakeup.fd = fd;
+ wakeup.warn_on_full_buffer = warn_on_full_buffer;
+
+ return PyLong_FromLong(old_fd);
+#endif
+}
+
+PyDoc_STRVAR(set_wakeup_fd_doc,
+"set_wakeup_fd(fd, *, warn_on_full_buffer=True) -> fd\n\
+\n\
+Sets the fd to be written to (with the signal number) when a signal\n\
+comes in. A library can use this to wakeup select or poll.\n\
+The previous fd or -1 is returned.\n\
+\n\
+The fd must be non-blocking.");
+
+/* C API for the same, without all the error checking */
+int
+PySignal_SetWakeupFd(int fd)
+{
+ if (fd < 0) {
+ fd = -1;
+ }
+
+ int old_fd = wakeup.fd;
+ wakeup.fd = fd;
+ wakeup.warn_on_full_buffer = 1;
+ return old_fd;
+}
+
+
+#ifdef HAVE_SETITIMER
+/*[clinic input]
+signal.setitimer
+
+ which: int
+ seconds: object
+ interval: object(c_default="NULL") = 0.0
+ /
+
+Sets given itimer (one of ITIMER_REAL, ITIMER_VIRTUAL or ITIMER_PROF).
+
+The timer will fire after value seconds and after that every interval seconds.
+The itimer can be cleared by setting seconds to zero.
+
+Returns old values as a tuple: (delay, interval).
+[clinic start generated code]*/
+
+static PyObject *
+signal_setitimer_impl(PyObject *module, int which, PyObject *seconds,
+ PyObject *interval)
+/*[clinic end generated code: output=65f9dcbddc35527b input=de43daf194e6f66f]*/
+{
+ _signal_module_state *modstate = get_signal_state(module);
+
+ struct itimerval new;
+ if (timeval_from_double(seconds, &new.it_value) < 0) {
+ return NULL;
+ }
+ if (timeval_from_double(interval, &new.it_interval) < 0) {
+ return NULL;
+ }
+
+ /* Let OS check "which" value */
+ struct itimerval old;
+ if (setitimer(which, &new, &old) != 0) {
+ PyErr_SetFromErrno(modstate->itimer_error);
+ return NULL;
+ }
+
+ return itimer_retval(&old);
+}
+#endif // HAVE_SETITIMER
+
+
+#ifdef HAVE_GETITIMER
+/*[clinic input]
+signal.getitimer
+
+ which: int
+ /
+
+Returns current value of given itimer.
+[clinic start generated code]*/
+
+static PyObject *
+signal_getitimer_impl(PyObject *module, int which)
+/*[clinic end generated code: output=9e053175d517db40 input=f7d21d38f3490627]*/
+{
+ _signal_module_state *modstate = get_signal_state(module);
+
+ struct itimerval old;
+ if (getitimer(which, &old) != 0) {
+ PyErr_SetFromErrno(modstate->itimer_error);
+ return NULL;
+ }
+
+ return itimer_retval(&old);
+}
+#endif // HAVE_GETITIMER
+
+
+#ifdef HAVE_SIGSET_T
+#if defined(PYPTHREAD_SIGMASK) || defined(HAVE_SIGPENDING)
+static PyObject*
+sigset_to_set(sigset_t mask)
+{
+ PyObject *signum, *result;
+ int sig;
+
+ result = PySet_New(0);
+ if (result == NULL)
+ return NULL;
+
+ for (sig = 1; sig < Py_NSIG; sig++) {
+ if (sigismember(&mask, sig) != 1)
+ continue;
+
+ /* Handle the case where it is a member by adding the signal to
+ the result list. Ignore the other cases because they mean the
+ signal isn't a member of the mask or the signal was invalid,
+ and an invalid signal must have been our fault in constructing
+ the loop boundaries. */
+ signum = PyLong_FromLong(sig);
+ if (signum == NULL) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ if (PySet_Add(result, signum) == -1) {
+ Py_DECREF(signum);
+ Py_DECREF(result);
+ return NULL;
+ }
+ Py_DECREF(signum);
+ }
+ return result;
+}
+#endif
+
+#ifdef PYPTHREAD_SIGMASK
+
+/*[clinic input]
+signal.pthread_sigmask
+
+ how: int
+ mask: sigset_t
+ /
+
+Fetch and/or change the signal mask of the calling thread.
+[clinic start generated code]*/
+
+static PyObject *
+signal_pthread_sigmask_impl(PyObject *module, int how, sigset_t mask)
+/*[clinic end generated code: output=0562c0fb192981a8 input=85bcebda442fa77f]*/
+{
+ sigset_t previous;
+ int err;
+
+ err = pthread_sigmask(how, &mask, &previous);
+ if (err != 0) {
+ errno = err;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ /* if signals was unblocked, signal handlers have been called */
+ if (PyErr_CheckSignals())
+ return NULL;
+
+ return sigset_to_set(previous);
+}
+
+#endif /* #ifdef PYPTHREAD_SIGMASK */
+
+
+#ifdef HAVE_SIGPENDING
+
+/*[clinic input]
+signal.sigpending
+
+Examine pending signals.
+
+Returns a set of signal numbers that are pending for delivery to
+the calling thread.
+[clinic start generated code]*/
+
+static PyObject *
+signal_sigpending_impl(PyObject *module)
+/*[clinic end generated code: output=53375ffe89325022 input=e0036c016f874e29]*/
+{
+ int err;
+ sigset_t mask;
+ err = sigpending(&mask);
+ if (err)
+ return PyErr_SetFromErrno(PyExc_OSError);
+ return sigset_to_set(mask);
+}
+
+#endif /* #ifdef HAVE_SIGPENDING */
+
+
+#ifdef HAVE_SIGWAIT
+
+/*[clinic input]
+signal.sigwait
+
+ sigset: sigset_t
+ /
+
+Wait for a signal.
+
+Suspend execution of the calling thread until the delivery of one of the
+signals specified in the signal set sigset. The function accepts the signal
+and returns the signal number.
+[clinic start generated code]*/
+
+static PyObject *
+signal_sigwait_impl(PyObject *module, sigset_t sigset)
+/*[clinic end generated code: output=f43770699d682f96 input=a6fbd47b1086d119]*/
+{
+ int err, signum;
+
+ Py_BEGIN_ALLOW_THREADS
+ err = sigwait(&sigset, &signum);
+ Py_END_ALLOW_THREADS
+ if (err) {
+ errno = err;
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+
+ return PyLong_FromLong(signum);
+}
+
+#endif /* #ifdef HAVE_SIGWAIT */
+#endif /* #ifdef HAVE_SIGSET_T */
+
+#if (defined(HAVE_SIGFILLSET) && defined(HAVE_SIGSET_T)) || defined(MS_WINDOWS)
+
+/*[clinic input]
+signal.valid_signals
+
+Return a set of valid signal numbers on this platform.
+
+The signal numbers returned by this function can be safely passed to
+functions like `pthread_sigmask`.
+[clinic start generated code]*/
+
+static PyObject *
+signal_valid_signals_impl(PyObject *module)
+/*[clinic end generated code: output=1609cffbcfcf1314 input=86a3717ff25288f2]*/
+{
+#ifdef MS_WINDOWS
+#ifdef SIGBREAK
+ PyObject *tup = Py_BuildValue("(iiiiiii)", SIGABRT, SIGBREAK, SIGFPE,
+ SIGILL, SIGINT, SIGSEGV, SIGTERM);
+#else
+ PyObject *tup = Py_BuildValue("(iiiiii)", SIGABRT, SIGFPE, SIGILL,
+ SIGINT, SIGSEGV, SIGTERM);
+#endif
+ if (tup == NULL) {
+ return NULL;
+ }
+ PyObject *set = PySet_New(tup);
+ Py_DECREF(tup);
+ return set;
+#else
+ sigset_t mask;
+ if (sigemptyset(&mask) || sigfillset(&mask)) {
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+ return sigset_to_set(mask);
+#endif
+}
+
+#endif /* #if (defined(HAVE_SIGFILLSET) && defined(HAVE_SIGSET_T)) || defined(MS_WINDOWS) */
+
+
+
+#if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
+static PyStructSequence_Field struct_siginfo_fields[] = {
+ {"si_signo", "signal number"},
+ {"si_code", "signal code"},
+ {"si_errno", "errno associated with this signal"},
+ {"si_pid", "sending process ID"},
+ {"si_uid", "real user ID of sending process"},
+ {"si_status", "exit value or signal"},
+ {"si_band", "band event for SIGPOLL"},
+ {0}
+};
+
+PyDoc_STRVAR(struct_siginfo__doc__,
+"struct_siginfo: Result from sigwaitinfo or sigtimedwait.\n\n\
+This object may be accessed either as a tuple of\n\
+(si_signo, si_code, si_errno, si_pid, si_uid, si_status, si_band),\n\
+or via the attributes si_signo, si_code, and so on.");
+
+static PyStructSequence_Desc struct_siginfo_desc = {
+ "signal.struct_siginfo", /* name */
+ struct_siginfo__doc__, /* doc */
+ struct_siginfo_fields, /* fields */
+ 7 /* n_in_sequence */
+};
+
+
+static PyObject *
+fill_siginfo(_signal_module_state *state, siginfo_t *si)
+{
+ PyObject *result = PyStructSequence_New(state->siginfo_type);
+ if (!result)
+ return NULL;
+
+ PyStructSequence_SET_ITEM(result, 0, PyLong_FromLong((long)(si->si_signo)));
+ PyStructSequence_SET_ITEM(result, 1, PyLong_FromLong((long)(si->si_code)));
+#ifdef __VXWORKS__
+ PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(0L));
+ PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(0L));
+ PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(0L));
+ PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(0L));
+#else
+ PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si->si_errno)));
+ PyStructSequence_SET_ITEM(result, 3, PyLong_FromPid(si->si_pid));
+ PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
+ PyStructSequence_SET_ITEM(result, 5,
+ PyLong_FromLong((long)(si->si_status)));
+#endif
+#ifdef HAVE_SIGINFO_T_SI_BAND
+ PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
+#else
+ PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(0L));
+#endif
+ if (PyErr_Occurred()) {
+ Py_DECREF(result);
+ return NULL;
+ }
+
+ return result;
+}
+#endif
+
+#ifdef HAVE_SIGSET_T
+#ifdef HAVE_SIGWAITINFO
+
+/*[clinic input]
+signal.sigwaitinfo
+
+ sigset: sigset_t
+ /
+
+Wait synchronously until one of the signals in *sigset* is delivered.
+
+Returns a struct_siginfo containing information about the signal.
+[clinic start generated code]*/
+
+static PyObject *
+signal_sigwaitinfo_impl(PyObject *module, sigset_t sigset)
+/*[clinic end generated code: output=1eb2f1fa236fdbca input=3d1a7e1f27fc664c]*/
+{
+ siginfo_t si;
+ int err;
+ int async_err = 0;
+
+ do {
+ Py_BEGIN_ALLOW_THREADS
+ err = sigwaitinfo(&sigset, &si);
+ Py_END_ALLOW_THREADS
+ } while (err == -1
+ && errno == EINTR && !(async_err = PyErr_CheckSignals()));
+ if (err == -1)
+ return (!async_err) ? PyErr_SetFromErrno(PyExc_OSError) : NULL;
+
+ _signal_module_state *state = get_signal_state(module);
+ return fill_siginfo(state, &si);
+}
+
+#endif /* #ifdef HAVE_SIGWAITINFO */
+
+#ifdef HAVE_SIGTIMEDWAIT
+
+/*[clinic input]
+signal.sigtimedwait
+
+ sigset: sigset_t
+ timeout as timeout_obj: object
+ /
+
+Like sigwaitinfo(), but with a timeout.
+
+The timeout is specified in seconds, with floating point numbers allowed.
+[clinic start generated code]*/
+
+static PyObject *
+signal_sigtimedwait_impl(PyObject *module, sigset_t sigset,
+ PyObject *timeout_obj)
+/*[clinic end generated code: output=59c8971e8ae18a64 input=87fd39237cf0b7ba]*/
+{
+ _PyTime_t timeout;
+ if (_PyTime_FromSecondsObject(&timeout,
+ timeout_obj, _PyTime_ROUND_CEILING) < 0)
+ return NULL;
+
+ if (timeout < 0) {
+ PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
+ return NULL;
+ }
+
+ _PyTime_t deadline = _PyDeadline_Init(timeout);
+ siginfo_t si;
+
+ do {
+ struct timespec ts;
+ if (_PyTime_AsTimespec(timeout, &ts) < 0) {
+ return NULL;
+ }
+
+ int res;
+ Py_BEGIN_ALLOW_THREADS
+ res = sigtimedwait(&sigset, &si, &ts);
+ Py_END_ALLOW_THREADS
+
+ if (res != -1)
+ break;
+
+ if (errno != EINTR) {
+ if (errno == EAGAIN)
+ Py_RETURN_NONE;
+ else
+ return PyErr_SetFromErrno(PyExc_OSError);
+ }
+
+ /* sigtimedwait() was interrupted by a signal (EINTR) */
+ if (PyErr_CheckSignals())
+ return NULL;
+
+ timeout = _PyDeadline_Get(deadline);
+ if (timeout < 0) {
+ break;
+ }
+ } while (1);
+
+ _signal_module_state *state = get_signal_state(module);
+ return fill_siginfo(state, &si);
+}
+
+#endif /* #ifdef HAVE_SIGTIMEDWAIT */
+#endif /* #ifdef HAVE_SIGSET_T */
+
+
+#if defined(HAVE_PTHREAD_KILL)
+
+/*[clinic input]
+signal.pthread_kill
+
+ thread_id: unsigned_long(bitwise=True)
+ signalnum: int
+ /
+
+Send a signal to a thread.
+[clinic start generated code]*/
+
+static PyObject *
+signal_pthread_kill_impl(PyObject *module, unsigned long thread_id,
+ int signalnum)
+/*[clinic end generated code: output=7629919b791bc27f input=1d901f2c7bb544ff]*/
+{
+ int err;
+
+ if (PySys_Audit("signal.pthread_kill", "ki", thread_id, signalnum) < 0) {
+ return NULL;
+ }
+
+ err = pthread_kill((pthread_t)thread_id, signalnum);
+ if (err != 0) {
+ errno = err;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ /* the signal may have been send to the current thread */
+ if (PyErr_CheckSignals())
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+#endif /* #if defined(HAVE_PTHREAD_KILL) */
+
+
+#if defined(__linux__) && defined(__NR_pidfd_send_signal)
+/*[clinic input]
+signal.pidfd_send_signal
+
+ pidfd: int
+ signalnum: int
+ siginfo: object = None
+ flags: int = 0
+ /
+
+Send a signal to a process referred to by a pid file descriptor.
+[clinic start generated code]*/
+
+static PyObject *
+signal_pidfd_send_signal_impl(PyObject *module, int pidfd, int signalnum,
+ PyObject *siginfo, int flags)
+/*[clinic end generated code: output=2d59f04a75d9cbdf input=2a6543a1f4ac2000]*/
+
+{
+ if (siginfo != Py_None) {
+ PyErr_SetString(PyExc_TypeError, "siginfo must be None");
+ return NULL;
+ }
+ if (syscall(__NR_pidfd_send_signal, pidfd, signalnum, NULL, flags) < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+#endif
+
+
+
+/* List of functions defined in the module -- some of the methoddefs are
+ defined to nothing if the corresponding C function is not available. */
+static PyMethodDef signal_methods[] = {
+ SIGNAL_DEFAULT_INT_HANDLER_METHODDEF
+ SIGNAL_ALARM_METHODDEF
+ SIGNAL_SETITIMER_METHODDEF
+ SIGNAL_GETITIMER_METHODDEF
+ SIGNAL_SIGNAL_METHODDEF
+ SIGNAL_RAISE_SIGNAL_METHODDEF
+ SIGNAL_STRSIGNAL_METHODDEF
+ SIGNAL_GETSIGNAL_METHODDEF
+ {"set_wakeup_fd", _PyCFunction_CAST(signal_set_wakeup_fd), METH_VARARGS | METH_KEYWORDS, set_wakeup_fd_doc},
+ SIGNAL_SIGINTERRUPT_METHODDEF
+ SIGNAL_PAUSE_METHODDEF
+ SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
+ SIGNAL_PTHREAD_KILL_METHODDEF
+ SIGNAL_PTHREAD_SIGMASK_METHODDEF
+ SIGNAL_SIGPENDING_METHODDEF
+ SIGNAL_SIGWAIT_METHODDEF
+ SIGNAL_SIGWAITINFO_METHODDEF
+ SIGNAL_SIGTIMEDWAIT_METHODDEF
+#if defined(HAVE_SIGFILLSET) || defined(MS_WINDOWS)
+ SIGNAL_VALID_SIGNALS_METHODDEF
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+
+PyDoc_STRVAR(module_doc,
+"This module provides mechanisms to use signal handlers in Python.\n\
+\n\
+Functions:\n\
+\n\
+alarm() -- cause SIGALRM after a specified time [Unix only]\n\
+setitimer() -- cause a signal (described below) after a specified\n\
+ float time and the timer may restart then [Unix only]\n\
+getitimer() -- get current value of timer [Unix only]\n\
+signal() -- set the action for a given signal\n\
+getsignal() -- get the signal action for a given signal\n\
+pause() -- wait until a signal arrives [Unix only]\n\
+default_int_handler() -- default SIGINT handler\n\
+\n\
+signal constants:\n\
+SIG_DFL -- used to refer to the system default handler\n\
+SIG_IGN -- used to ignore the signal\n\
+NSIG -- number of defined signals\n\
+SIGINT, SIGTERM, etc. -- signal numbers\n\
+\n\
+itimer constants:\n\
+ITIMER_REAL -- decrements in real time, and delivers SIGALRM upon\n\
+ expiration\n\
+ITIMER_VIRTUAL -- decrements only when the process is executing,\n\
+ and delivers SIGVTALRM upon expiration\n\
+ITIMER_PROF -- decrements both when the process is executing and\n\
+ when the system is executing on behalf of the process.\n\
+ Coupled with ITIMER_VIRTUAL, this timer is usually\n\
+ used to profile the time spent by the application\n\
+ in user and kernel space. SIGPROF is delivered upon\n\
+ expiration.\n\
+\n\n\
+*** IMPORTANT NOTICE ***\n\
+A signal handler function is called with two arguments:\n\
+the first is the signal number, the second is the interrupted stack frame.");
+
+
+
+static int
+signal_add_constants(PyObject *module)
+{
+ if (PyModule_AddIntConstant(module, "NSIG", Py_NSIG) < 0) {
+ return -1;
+ }
+
+#define ADD_INT_MACRO(macro) \
+ if (PyModule_AddIntConstant(module, #macro, macro) < 0) { \
+ return -1; \
+ }
+
+ // SIG_xxx pthread_sigmask() constants
+#ifdef SIG_BLOCK
+ ADD_INT_MACRO(SIG_BLOCK);
+#endif
+#ifdef SIG_UNBLOCK
+ ADD_INT_MACRO(SIG_UNBLOCK);
+#endif
+#ifdef SIG_SETMASK
+ ADD_INT_MACRO(SIG_SETMASK);
+#endif
+
+ // SIGxxx signal number constants
+#ifdef SIGHUP
+ ADD_INT_MACRO(SIGHUP);
+#endif
+#ifdef SIGINT
+ ADD_INT_MACRO(SIGINT);
+#endif
+#ifdef SIGBREAK
+ ADD_INT_MACRO(SIGBREAK);
+#endif
+#ifdef SIGQUIT
+ ADD_INT_MACRO(SIGQUIT);
+#endif
+#ifdef SIGILL
+ ADD_INT_MACRO(SIGILL);
+#endif
+#ifdef SIGTRAP
+ ADD_INT_MACRO(SIGTRAP);
+#endif
+#ifdef SIGIOT
+ ADD_INT_MACRO(SIGIOT);
+#endif
+#ifdef SIGABRT
+ ADD_INT_MACRO(SIGABRT);
+#endif
+#ifdef SIGEMT
+ ADD_INT_MACRO(SIGEMT);
+#endif
+#ifdef SIGFPE
+ ADD_INT_MACRO(SIGFPE);
+#endif
+#ifdef SIGKILL
+ ADD_INT_MACRO(SIGKILL);
+#endif
+#ifdef SIGBUS
+ ADD_INT_MACRO(SIGBUS);
+#endif
+#ifdef SIGSEGV
+ ADD_INT_MACRO(SIGSEGV);
+#endif
+#ifdef SIGSYS
+ ADD_INT_MACRO(SIGSYS);
+#endif
+#ifdef SIGPIPE
+ ADD_INT_MACRO(SIGPIPE);
+#endif
+#ifdef SIGALRM
+ ADD_INT_MACRO(SIGALRM);
+#endif
+#ifdef SIGTERM
+ ADD_INT_MACRO(SIGTERM);
+#endif
+#ifdef SIGUSR1
+ ADD_INT_MACRO(SIGUSR1);
+#endif
+#ifdef SIGUSR2
+ ADD_INT_MACRO(SIGUSR2);
+#endif
+#ifdef SIGCLD
+ ADD_INT_MACRO(SIGCLD);
+#endif
+#ifdef SIGCHLD
+ ADD_INT_MACRO(SIGCHLD);
+#endif
+#ifdef SIGPWR
+ ADD_INT_MACRO(SIGPWR);
+#endif
+#ifdef SIGIO
+ ADD_INT_MACRO(SIGIO);
+#endif
+#ifdef SIGURG
+ ADD_INT_MACRO(SIGURG);
+#endif
+#ifdef SIGWINCH
+ ADD_INT_MACRO(SIGWINCH);
+#endif
+#ifdef SIGPOLL
+ ADD_INT_MACRO(SIGPOLL);
+#endif
+#ifdef SIGSTOP
+ ADD_INT_MACRO(SIGSTOP);
+#endif
+#ifdef SIGTSTP
+ ADD_INT_MACRO(SIGTSTP);
+#endif
+#ifdef SIGCONT
+ ADD_INT_MACRO(SIGCONT);
+#endif
+#ifdef SIGTTIN
+ ADD_INT_MACRO(SIGTTIN);
+#endif
+#ifdef SIGTTOU
+ ADD_INT_MACRO(SIGTTOU);
+#endif
+#ifdef SIGVTALRM
+ ADD_INT_MACRO(SIGVTALRM);
+#endif
+#ifdef SIGPROF
+ ADD_INT_MACRO(SIGPROF);
+#endif
+#ifdef SIGXCPU
+ ADD_INT_MACRO(SIGXCPU);
+#endif
+#ifdef SIGXFSZ
+ ADD_INT_MACRO(SIGXFSZ);
+#endif
+#ifdef SIGRTMIN
+ ADD_INT_MACRO(SIGRTMIN);
+#endif
+#ifdef SIGRTMAX
+ ADD_INT_MACRO(SIGRTMAX);
+#endif
+#ifdef SIGINFO
+ ADD_INT_MACRO(SIGINFO);
+#endif
+#ifdef SIGSTKFLT
+ ADD_INT_MACRO(SIGSTKFLT);
+#endif
+
+ // ITIMER_xxx constants
+#ifdef ITIMER_REAL
+ ADD_INT_MACRO(ITIMER_REAL);
+#endif
+#ifdef ITIMER_VIRTUAL
+ ADD_INT_MACRO(ITIMER_VIRTUAL);
+#endif
+#ifdef ITIMER_PROF
+ ADD_INT_MACRO(ITIMER_PROF);
+#endif
+
+ // CTRL_xxx Windows signals
+#ifdef CTRL_C_EVENT
+ ADD_INT_MACRO(CTRL_C_EVENT);
+#endif
+#ifdef CTRL_BREAK_EVENT
+ ADD_INT_MACRO(CTRL_BREAK_EVENT);
+#endif
+
+ return 0;
+
+#undef ADD_INT_MACRO
+}
+
+
+static int
+signal_get_set_handlers(signal_state_t *state, PyObject *mod_dict)
+{
+ // Get signal handlers
+ for (int signum = 1; signum < Py_NSIG; signum++) {
+ void (*c_handler)(int) = PyOS_getsig(signum);
+ PyObject *func;
+ if (c_handler == SIG_DFL) {
+ func = state->default_handler;
+ }
+ else if (c_handler == SIG_IGN) {
+ func = state->ignore_handler;
+ }
+ else {
+ func = Py_None; // None of our business
+ }
+ // If signal_module_exec() is called more than one, we must
+ // clear the strong reference to the previous function.
+ PyObject* old_func = get_handler(signum);
+ set_handler(signum, Py_NewRef(func));
+ Py_XDECREF(old_func);
+ }
+
+ // Install Python SIGINT handler which raises KeyboardInterrupt
+ PyObject* sigint_func = get_handler(SIGINT);
+ if (sigint_func == state->default_handler) {
+ PyObject *int_handler = PyMapping_GetItemString(mod_dict,
+ "default_int_handler");
+ if (!int_handler) {
+ return -1;
+ }
+
+ set_handler(SIGINT, int_handler);
+ Py_DECREF(sigint_func);
+ PyOS_setsig(SIGINT, signal_handler);
+ }
+ return 0;
+}
+
+
+static int
+signal_module_exec(PyObject *m)
+{
+ assert(!PyErr_Occurred());
+
+ signal_state_t *state = &signal_global_state;
+ _signal_module_state *modstate = get_signal_state(m);
+
+ // XXX For proper isolation, these values must be guaranteed
+ // to be effectively const (e.g. immortal).
+ modstate->default_handler = state->default_handler; // borrowed ref
+ modstate->ignore_handler = state->ignore_handler; // borrowed ref
+
+#ifdef PYHAVE_ITIMER_ERROR
+ modstate->itimer_error = PyErr_NewException("signal.itimer_error",
+ PyExc_OSError, NULL);
+ if (modstate->itimer_error == NULL) {
+ return -1;
+ }
+#endif
+
+ if (signal_add_constants(m) < 0) {
+ return -1;
+ }
+
+ /* Add some symbolic constants to the module */
+ PyObject *d = PyModule_GetDict(m);
+ if (PyDict_SetItemString(d, "SIG_DFL", state->default_handler) < 0) {
+ return -1;
+ }
+ if (PyDict_SetItemString(d, "SIG_IGN", state->ignore_handler) < 0) {
+ return -1;
+ }
+#ifdef PYHAVE_ITIMER_ERROR
+ if (PyDict_SetItemString(d, "ItimerError", modstate->itimer_error) < 0) {
+ return -1;
+ }
+#endif
+
+#if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
+ modstate->siginfo_type = PyStructSequence_NewType(&struct_siginfo_desc);
+ if (modstate->siginfo_type == NULL) {
+ return -1;
+ }
+#endif
+#if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
+ if (PyModule_AddType(m, modstate->siginfo_type) < 0) {
+ return -1;
+ }
+#endif
+
+ PyThreadState *tstate = _PyThreadState_GET();
+ if (_Py_IsMainInterpreter(tstate->interp)) {
+ if (signal_get_set_handlers(state, d) < 0) {
+ return -1;
+ }
+ }
+
+ assert(!PyErr_Occurred());
+ return 0;
+}
+
+
+#ifdef PYHAVE_ITIMER_ERROR
+static int
+_signal_module_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ _signal_module_state *state = get_signal_state(module);
+ Py_VISIT(state->itimer_error);
+ Py_VISIT(state->siginfo_type);
+ return 0;
+}
+
+static int
+_signal_module_clear(PyObject *module)
+{
+ _signal_module_state *state = get_signal_state(module);
+ Py_CLEAR(state->itimer_error);
+ Py_CLEAR(state->siginfo_type);
+ return 0;
+}
+
+static void
+_signal_module_free(void *module)
+{
+ _signal_module_clear((PyObject *)module);
+}
+#endif // PYHAVE_ITIMER_ERROR
+
+
+static PyModuleDef_Slot signal_slots[] = {
+ {Py_mod_exec, signal_module_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef signal_module = {
+ PyModuleDef_HEAD_INIT,
+ "_signal",
+ .m_doc = module_doc,
+ .m_size = sizeof(_signal_module_state),
+ .m_methods = signal_methods,
+ .m_slots = signal_slots,
+#ifdef PYHAVE_ITIMER_ERROR
+ .m_traverse = _signal_module_traverse,
+ .m_clear = _signal_module_clear,
+ .m_free = _signal_module_free,
+#endif
+};
+
+
+PyMODINIT_FUNC
+PyInit__signal(void)
+{
+ return PyModuleDef_Init(&signal_module);
+}
+
+
+void
+_PySignal_Fini(void)
+{
+ signal_state_t *state = &signal_global_state;
+
+ // Restore default signals and clear handlers
+ for (int signum = 1; signum < Py_NSIG; signum++) {
+ PyObject *func = get_handler(signum);
+ _Py_atomic_store_relaxed(&Handlers[signum].tripped, 0);
+ set_handler(signum, NULL);
+ if (func != NULL
+ && func != Py_None
+ && !compare_handler(func, state->default_handler)
+ && !compare_handler(func, state->ignore_handler))
+ {
+ PyOS_setsig(signum, SIG_DFL);
+ }
+ Py_XDECREF(func);
+ }
+
+#ifdef MS_WINDOWS
+ if (state->sigint_event != NULL) {
+ CloseHandle((HANDLE)state->sigint_event);
+ state->sigint_event = NULL;
+ }
+#endif
+
+ Py_CLEAR(state->default_handler);
+ Py_CLEAR(state->ignore_handler);
+}
+
+
+/* Declared in pyerrors.h */
+int
+PyErr_CheckSignals(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+
+ /* Opportunistically check if the GC is scheduled to run and run it
+ if we have a request. This is done here because native code needs
+ to call this API if is going to run for some time without executing
+ Python code to ensure signals are handled. Checking for the GC here
+ allows long running native code to clean cycles created using the C-API
+ even if it doesn't run the evaluation loop */
+ struct _ceval_state *interp_ceval_state = &tstate->interp->ceval;
+ if (_Py_atomic_load_relaxed(&interp_ceval_state->gc_scheduled)) {
+ _Py_atomic_store_relaxed(&interp_ceval_state->gc_scheduled, 0);
+ _Py_RunGC(tstate);
+ }
+
+ if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
+ return 0;
+ }
+
+ return _PyErr_CheckSignalsTstate(tstate);
+}
+
+
+/* Declared in cpython/pyerrors.h */
+int
+_PyErr_CheckSignalsTstate(PyThreadState *tstate)
+{
+ _Py_CHECK_EMSCRIPTEN_SIGNALS();
+ if (!_Py_atomic_load(&is_tripped)) {
+ return 0;
+ }
+
+ /*
+ * The is_tripped variable is meant to speed up the calls to
+ * PyErr_CheckSignals (both directly or via pending calls) when no
+ * signal has arrived. This variable is set to 1 when a signal arrives
+ * and it is set to 0 here, when we know some signals arrived. This way
+ * we can run the registered handlers with no signals blocked.
+ *
+ * NOTE: with this approach we can have a situation where is_tripped is
+ * 1 but we have no more signals to handle (Handlers[i].tripped
+ * is 0 for every signal i). This won't do us any harm (except
+ * we're gonna spent some cycles for nothing). This happens when
+ * we receive a signal i after we zero is_tripped and before we
+ * check Handlers[i].tripped.
+ */
+ _Py_atomic_store(&is_tripped, 0);
+
+ _PyInterpreterFrame *frame = _PyThreadState_GetFrame(tstate);
+ signal_state_t *state = &signal_global_state;
+ for (int i = 1; i < Py_NSIG; i++) {
+ if (!_Py_atomic_load_relaxed(&Handlers[i].tripped)) {
+ continue;
+ }
+ _Py_atomic_store_relaxed(&Handlers[i].tripped, 0);
+
+ /* Signal handlers can be modified while a signal is received,
+ * and therefore the fact that trip_signal() or PyErr_SetInterrupt()
+ * was called doesn't guarantee that there is still a Python
+ * signal handler for it by the time PyErr_CheckSignals() is called
+ * (see bpo-43406).
+ */
+ PyObject *func = get_handler(i);
+ if (func == NULL || func == Py_None ||
+ compare_handler(func, state->ignore_handler) ||
+ compare_handler(func, state->default_handler)) {
+ /* No Python signal handler due to aforementioned race condition.
+ * We can't call raise() as it would break the assumption
+ * that PyErr_SetInterrupt() only *simulates* an incoming
+ * signal (i.e. it will never kill the process).
+ * We also don't want to interrupt user code with a cryptic
+ * asynchronous exception, so instead just write out an
+ * unraisable error.
+ */
+ PyErr_Format(PyExc_OSError,
+ "Signal %i ignored due to race condition",
+ i);
+ PyErr_WriteUnraisable(Py_None);
+ continue;
+ }
+ PyObject *arglist = NULL;
+ if (frame == NULL) {
+ arglist = Py_BuildValue("(iO)", i, Py_None);
+ }
+ else {
+ PyFrameObject *f = _PyFrame_GetFrameObject(frame);
+ if (f != NULL) {
+ arglist = Py_BuildValue("(iO)", i, f);
+ }
+ }
+ PyObject *result;
+ if (arglist) {
+ result = _PyObject_Call(tstate, func, arglist, NULL);
+ Py_DECREF(arglist);
+ }
+ else {
+ result = NULL;
+ }
+ if (!result) {
+ /* On error, re-schedule a call to _PyErr_CheckSignalsTstate() */
+ _Py_atomic_store(&is_tripped, 1);
+ return -1;
+ }
+
+ Py_DECREF(result);
+ }
+
+ return 0;
+}
+
+
+
+int
+_PyErr_CheckSignals(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ return _PyErr_CheckSignalsTstate(tstate);
+}
+
+
+/* Simulate the effect of a signal arriving. The next time PyErr_CheckSignals
+ is called, the corresponding Python signal handler will be raised.
+
+ Missing signal handler for the given signal number is silently ignored. */
+int
+PyErr_SetInterruptEx(int signum)
+{
+ if (signum < 1 || signum >= Py_NSIG) {
+ return -1;
+ }
+
+ signal_state_t *state = &signal_global_state;
+ PyObject *func = get_handler(signum);
+ if (!compare_handler(func, state->ignore_handler)
+ && !compare_handler(func, state->default_handler)) {
+ trip_signal(signum);
+ }
+ return 0;
+}
+
+void
+PyErr_SetInterrupt(void)
+{
+ (void) PyErr_SetInterruptEx(SIGINT);
+}
+
+static int
+signal_install_handlers(void)
+{
+#ifdef SIGPIPE
+ PyOS_setsig(SIGPIPE, SIG_IGN);
+#endif
+#ifdef SIGXFZ
+ PyOS_setsig(SIGXFZ, SIG_IGN);
+#endif
+#ifdef SIGXFSZ
+ PyOS_setsig(SIGXFSZ, SIG_IGN);
+#endif
+
+ // Import _signal to install the Python SIGINT handler
+ PyObject *module = PyImport_ImportModule("_signal");
+ if (!module) {
+ return -1;
+ }
+ Py_DECREF(module);
+
+ return 0;
+}
+
+
+/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL.
+ *
+ * All of the code in this function must only use async-signal-safe functions,
+ * listed at `man 7 signal` or
+ * http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html.
+ *
+ * If this function is updated, update also _posix_spawn() of subprocess.py.
+ */
+void
+_Py_RestoreSignals(void)
+{
+#ifdef SIGPIPE
+ PyOS_setsig(SIGPIPE, SIG_DFL);
+#endif
+#ifdef SIGXFZ
+ PyOS_setsig(SIGXFZ, SIG_DFL);
+#endif
+#ifdef SIGXFSZ
+ PyOS_setsig(SIGXFSZ, SIG_DFL);
+#endif
+}
+
+
+int
+_PySignal_Init(int install_signal_handlers)
+{
+ signal_state_t *state = &signal_global_state;
+
+ state->default_handler = PyLong_FromVoidPtr((void *)SIG_DFL);
+ if (state->default_handler == NULL) {
+ return -1;
+ }
+
+ state->ignore_handler = PyLong_FromVoidPtr((void *)SIG_IGN);
+ if (state->ignore_handler == NULL) {
+ return -1;
+ }
+
+#ifdef MS_WINDOWS
+ /* Create manual-reset event, initially unset */
+ state->sigint_event = (void *)CreateEvent(NULL, TRUE, FALSE, FALSE);
+ if (state->sigint_event == NULL) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+#endif
+
+ for (int signum = 1; signum < Py_NSIG; signum++) {
+ _Py_atomic_store_relaxed(&Handlers[signum].tripped, 0);
+ }
+
+ if (install_signal_handlers) {
+ if (signal_install_handlers() < 0) {
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
+// The caller doesn't have to hold the GIL
+int
+_PyOS_InterruptOccurred(PyThreadState *tstate)
+{
+ _Py_EnsureTstateNotNULL(tstate);
+ if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
+ return 0;
+ }
+
+ if (!_Py_atomic_load_relaxed(&Handlers[SIGINT].tripped)) {
+ return 0;
+ }
+
+ _Py_atomic_store_relaxed(&Handlers[SIGINT].tripped, 0);
+ return 1;
+}
+
+
+// The caller must to hold the GIL
+int
+PyOS_InterruptOccurred(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ return _PyOS_InterruptOccurred(tstate);
+}
+
+
+#ifdef HAVE_FORK
+static void
+_clear_pending_signals(void)
+{
+ if (!_Py_atomic_load(&is_tripped)) {
+ return;
+ }
+
+ _Py_atomic_store(&is_tripped, 0);
+ for (int i = 1; i < Py_NSIG; ++i) {
+ _Py_atomic_store_relaxed(&Handlers[i].tripped, 0);
+ }
+}
+
+void
+_PySignal_AfterFork(void)
+{
+ /* Clear the signal flags after forking so that they aren't handled
+ * in both processes if they came in just before the fork() but before
+ * the interpreter had an opportunity to call the handlers. issue9535. */
+ _clear_pending_signals();
+}
+#endif /* HAVE_FORK */
+
+
+int
+_PyOS_IsMainThread(void)
+{
+ PyInterpreterState *interp = _PyInterpreterState_GET();
+ return _Py_ThreadCanHandleSignals(interp);
+}
+
+#ifdef MS_WINDOWS
+/* Returns a manual-reset event which gets tripped whenever
+ SIGINT is received.
+
+ Python.h does not include windows.h so we do cannot use HANDLE
+ as the return type of this function. We use void* instead. */
+void *_PyOS_SigintEvent(void)
+{
+ signal_state_t *state = &signal_global_state;
+ return state->sigint_event;
+}
+#endif
diff --git a/contrib/tools/python3/Modules/socketmodule.c b/contrib/tools/python3/Modules/socketmodule.c
new file mode 100644
index 00000000000..97248792c0f
--- /dev/null
+++ b/contrib/tools/python3/Modules/socketmodule.c
@@ -0,0 +1,8938 @@
+/* Socket module */
+
+/*
+
+This module provides an interface to Berkeley socket IPC.
+
+Limitations:
+
+- Only AF_INET, AF_INET6 and AF_UNIX address families are supported in a
+ portable manner, though AF_PACKET, AF_NETLINK, AF_QIPCRTR and AF_TIPC are
+ supported under Linux.
+- No read/write operations (use sendall/recv or makefile instead).
+- Additional restrictions apply on some non-Unix platforms (compensated
+ for by socket.py).
+
+Module interface:
+
+- socket.error: exception raised for socket specific errors, alias for OSError
+- socket.gaierror: exception raised for getaddrinfo/getnameinfo errors,
+ a subclass of socket.error
+- socket.herror: exception raised for gethostby* errors,
+ a subclass of socket.error
+- socket.gethostbyname(hostname) --> host IP address (string: 'dd.dd.dd.dd')
+- socket.gethostbyaddr(IP address) --> (hostname, [alias, ...], [IP addr, ...])
+- socket.gethostname() --> host name (string: 'spam' or 'spam.domain.com')
+- socket.getprotobyname(protocolname) --> protocol number
+- socket.getservbyname(servicename[, protocolname]) --> port number
+- socket.getservbyport(portnumber[, protocolname]) --> service name
+- socket.socket([family[, type [, proto, fileno]]]) --> new socket object
+ (fileno specifies a pre-existing socket file descriptor)
+- socket.socketpair([family[, type [, proto]]]) --> (socket, socket)
+- socket.ntohs(16 bit value) --> new int object
+- socket.ntohl(32 bit value) --> new int object
+- socket.htons(16 bit value) --> new int object
+- socket.htonl(32 bit value) --> new int object
+- socket.getaddrinfo(host, port [, family, type, proto, flags])
+ --> List of (family, type, proto, canonname, sockaddr)
+- socket.getnameinfo(sockaddr, flags) --> (host, port)
+- socket.AF_INET, socket.SOCK_STREAM, etc.: constants from <socket.h>
+- socket.has_ipv6: boolean value indicating if IPv6 is supported
+- socket.inet_aton(IP address) -> 32-bit packed IP representation
+- socket.inet_ntoa(packed IP) -> IP address string
+- socket.getdefaulttimeout() -> None | float
+- socket.setdefaulttimeout(None | float)
+- socket.if_nameindex() -> list of tuples (if_index, if_name)
+- socket.if_nametoindex(name) -> corresponding interface index
+- socket.if_indextoname(index) -> corresponding interface name
+- an internet socket address is a pair (hostname, port)
+ where hostname can be anything recognized by gethostbyname()
+ (including the dd.dd.dd.dd notation) and port is in host byte order
+- where a hostname is returned, the dd.dd.dd.dd notation is used
+- a UNIX domain socket address is a string specifying the pathname
+- an AF_PACKET socket address is a tuple containing a string
+ specifying the ethernet interface and an integer specifying
+ the Ethernet protocol number to be received. For example:
+ ("eth0",0x1234). Optional 3rd,4th,5th elements in the tuple
+ specify packet-type and ha-type/addr.
+- an AF_QIPCRTR socket address is a (node, port) tuple where the
+ node and port are non-negative integers.
+- an AF_TIPC socket address is expressed as
+ (addr_type, v1, v2, v3 [, scope]); where addr_type can be one of:
+ TIPC_ADDR_NAMESEQ, TIPC_ADDR_NAME, and TIPC_ADDR_ID;
+ and scope can be one of:
+ TIPC_ZONE_SCOPE, TIPC_CLUSTER_SCOPE, and TIPC_NODE_SCOPE.
+ The meaning of v1, v2 and v3 depends on the value of addr_type:
+ if addr_type is TIPC_ADDR_NAME:
+ v1 is the server type
+ v2 is the port identifier
+ v3 is ignored
+ if addr_type is TIPC_ADDR_NAMESEQ:
+ v1 is the server type
+ v2 is the lower port number
+ v3 is the upper port number
+ if addr_type is TIPC_ADDR_ID:
+ v1 is the node
+ v2 is the ref
+ v3 is ignored
+
+
+Local naming conventions:
+
+- names starting with sock_ are socket object methods
+- names starting with socket_ are module-level functions
+- names starting with PySocket are exported through socketmodule.h
+
+*/
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#ifdef __APPLE__
+// Issue #35569: Expose RFC 3542 socket options.
+#define __APPLE_USE_RFC_3542 1
+#include <AvailabilityMacros.h>
+/* for getaddrinfo thread safety test on old versions of OS X */
+#ifndef MAC_OS_X_VERSION_10_5
+#define MAC_OS_X_VERSION_10_5 1050
+#endif
+ /*
+ * inet_aton is not available on OSX 10.3, yet we want to use a binary
+ * that was build on 10.4 or later to work on that release, weak linking
+ * comes to the rescue.
+ */
+# pragma weak inet_aton
+#endif
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "pycore_fileutils.h" // _Py_set_inheritable()
+#include "pycore_moduleobject.h" // _PyModule_GetState
+#include "structmember.h" // PyMemberDef
+
+#ifdef _Py_MEMORY_SANITIZER
+# include <sanitizer/msan_interface.h>
+#endif
+
+/* Socket object documentation */
+PyDoc_STRVAR(sock_doc,
+"socket(family=AF_INET, type=SOCK_STREAM, proto=0) -> socket object\n\
+socket(family=-1, type=-1, proto=-1, fileno=None) -> socket object\n\
+\n\
+Open a socket of the given type. The family argument specifies the\n\
+address family; it defaults to AF_INET. The type argument specifies\n\
+whether this is a stream (SOCK_STREAM, this is the default)\n\
+or datagram (SOCK_DGRAM) socket. The protocol argument defaults to 0,\n\
+specifying the default protocol. Keyword arguments are accepted.\n\
+The socket is created as non-inheritable.\n\
+\n\
+When a fileno is passed in, family, type and proto are auto-detected,\n\
+unless they are explicitly set.\n\
+\n\
+A socket object represents one endpoint of a network connection.\n\
+\n\
+Methods of socket objects (keyword arguments not allowed):\n\
+\n\
+_accept() -- accept connection, returning new socket fd and client address\n\
+bind(addr) -- bind the socket to a local address\n\
+close() -- close the socket\n\
+connect(addr) -- connect the socket to a remote address\n\
+connect_ex(addr) -- connect, return an error code instead of an exception\n\
+dup() -- return a new socket fd duplicated from fileno()\n\
+fileno() -- return underlying file descriptor\n\
+getpeername() -- return remote address [*]\n\
+getsockname() -- return local address\n\
+getsockopt(level, optname[, buflen]) -- get socket options\n\
+gettimeout() -- return timeout or None\n\
+listen([n]) -- start listening for incoming connections\n\
+recv(buflen[, flags]) -- receive data\n\
+recv_into(buffer[, nbytes[, flags]]) -- receive data (into a buffer)\n\
+recvfrom(buflen[, flags]) -- receive data and sender\'s address\n\
+recvfrom_into(buffer[, nbytes, [, flags])\n\
+ -- receive data and sender\'s address (into a buffer)\n\
+sendall(data[, flags]) -- send all data\n\
+send(data[, flags]) -- send data, may not send all of it\n\
+sendto(data[, flags], addr) -- send data to a given address\n\
+setblocking(bool) -- set or clear the blocking I/O flag\n\
+getblocking() -- return True if socket is blocking, False if non-blocking\n\
+setsockopt(level, optname, value[, optlen]) -- set socket options\n\
+settimeout(None | float) -- set or clear the timeout\n\
+shutdown(how) -- shut down traffic in one or both directions\n\
+\n\
+ [*] not available on all platforms!");
+
+/* XXX This is a terrible mess of platform-dependent preprocessor hacks.
+ I hope some day someone can clean this up please... */
+
+/* Hacks for gethostbyname_r(). On some non-Linux platforms, the configure
+ script doesn't get this right, so we hardcode some platform checks below.
+ On the other hand, not all Linux versions agree, so there the settings
+ computed by the configure script are needed! */
+
+#ifndef __linux__
+# undef HAVE_GETHOSTBYNAME_R_3_ARG
+# undef HAVE_GETHOSTBYNAME_R_5_ARG
+# undef HAVE_GETHOSTBYNAME_R_6_ARG
+#endif
+
+#if defined(__OpenBSD__)
+# include <sys/uio.h>
+#endif
+
+#if defined(__ANDROID__) && __ANDROID_API__ < 23
+# undef HAVE_GETHOSTBYNAME_R
+#endif
+
+#ifdef HAVE_GETHOSTBYNAME_R
+# if defined(_AIX) && !defined(_LINUX_SOURCE_COMPAT)
+# define HAVE_GETHOSTBYNAME_R_3_ARG
+# elif defined(__sun) || defined(__sgi)
+# define HAVE_GETHOSTBYNAME_R_5_ARG
+# elif defined(__linux__)
+/* Rely on the configure script */
+# elif defined(_LINUX_SOURCE_COMPAT) /* Linux compatibility on AIX */
+# define HAVE_GETHOSTBYNAME_R_6_ARG
+# else
+# undef HAVE_GETHOSTBYNAME_R
+# endif
+#endif
+
+#if !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS)
+# define USE_GETHOSTBYNAME_LOCK
+#endif
+
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__NetBSD__)
+# include <sys/ioctl.h>
+#endif
+
+
+#if defined(__sgi) && _COMPILER_VERSION>700 && !_SGIAPI
+/* make sure that the reentrant (gethostbyaddr_r etc)
+ functions are declared correctly if compiling with
+ MIPSPro 7.x in ANSI C mode (default) */
+
+/* XXX Using _SGIAPI is the wrong thing,
+ but I don't know what the right thing is. */
+#undef _SGIAPI /* to avoid warning */
+#define _SGIAPI 1
+
+#undef _XOPEN_SOURCE
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef _SS_ALIGNSIZE
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETNAMEINFO 1
+#endif
+
+#define HAVE_INET_PTON
+#include <netdb.h>
+#endif // __sgi
+
+/* Solaris fails to define this variable at all. */
+#if (defined(__sun) && defined(__SVR4)) && !defined(INET_ADDRSTRLEN)
+#define INET_ADDRSTRLEN 16
+#endif
+
+/* Generic includes */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#ifdef HAVE_NET_ETHERNET_H
+#include <net/ethernet.h>
+#endif
+
+/* Generic socket object definitions and includes */
+#define PySocket_BUILDING_SOCKET
+#include "socketmodule.h"
+
+/* Addressing includes */
+
+#ifndef MS_WINDOWS
+
+/* Non-MS WINDOWS includes */
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+# include <unistd.h>
+
+/* Headers needed for inet_ntoa() and inet_addr() */
+# include <arpa/inet.h>
+
+# include <fcntl.h>
+
+#else /* MS_WINDOWS */
+
+/* MS_WINDOWS includes */
+# ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+# endif
+
+/* Helpers needed for AF_HYPERV */
+# include <Rpc.h>
+
+/* Macros based on the IPPROTO enum, see: https://bugs.python.org/issue29515 */
+#define IPPROTO_ICMP IPPROTO_ICMP
+#define IPPROTO_IGMP IPPROTO_IGMP
+#define IPPROTO_GGP IPPROTO_GGP
+#define IPPROTO_TCP IPPROTO_TCP
+#define IPPROTO_PUP IPPROTO_PUP
+#define IPPROTO_UDP IPPROTO_UDP
+#define IPPROTO_IDP IPPROTO_IDP
+#define IPPROTO_ND IPPROTO_ND
+#define IPPROTO_RAW IPPROTO_RAW
+#define IPPROTO_MAX IPPROTO_MAX
+#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
+#define IPPROTO_IPV4 IPPROTO_IPV4
+#define IPPROTO_IPV6 IPPROTO_IPV6
+#define IPPROTO_ROUTING IPPROTO_ROUTING
+#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
+#define IPPROTO_ESP IPPROTO_ESP
+#define IPPROTO_AH IPPROTO_AH
+#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
+#define IPPROTO_NONE IPPROTO_NONE
+#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
+#define IPPROTO_EGP IPPROTO_EGP
+#define IPPROTO_PIM IPPROTO_PIM
+#define IPPROTO_ICLFXBM IPPROTO_ICLFXBM // WinSock2 only
+#define IPPROTO_ST IPPROTO_ST // WinSock2 only
+#define IPPROTO_CBT IPPROTO_CBT // WinSock2 only
+#define IPPROTO_IGP IPPROTO_IGP // WinSock2 only
+#define IPPROTO_RDP IPPROTO_RDP // WinSock2 only
+#define IPPROTO_PGM IPPROTO_PGM // WinSock2 only
+#define IPPROTO_L2TP IPPROTO_L2TP // WinSock2 only
+#define IPPROTO_SCTP IPPROTO_SCTP // WinSock2 only
+
+/* Provides the IsWindows7SP1OrGreater() function */
+#include <versionhelpers.h>
+// For if_nametoindex() and if_indextoname()
+#include <iphlpapi.h>
+
+/* remove some flags on older version Windows during run-time.
+ https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596.aspx */
+typedef struct {
+ DWORD build_number; /* available starting with this Win10 BuildNumber */
+ const char flag_name[20];
+} FlagRuntimeInfo;
+
+/* IMPORTANT: make sure the list ordered by descending build_number */
+static FlagRuntimeInfo win_runtime_flags[] = {
+ /* available starting with Windows 10 1709 */
+ {16299, "TCP_KEEPIDLE"},
+ {16299, "TCP_KEEPINTVL"},
+ /* available starting with Windows 10 1703 */
+ {15063, "TCP_KEEPCNT"},
+ /* available starting with Windows 10 1607 */
+ {14393, "TCP_FASTOPEN"}
+};
+
+/*[clinic input]
+module _socket
+class _socket.socket "PySocketSockObject *" "clinic_state()->sock_type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2db2489bd2219fd8]*/
+
+static int
+remove_unusable_flags(PyObject *m)
+{
+ PyObject *dict;
+ OSVERSIONINFOEX info;
+
+ dict = PyModule_GetDict(m);
+ if (dict == NULL) {
+ return -1;
+ }
+#ifndef MS_WINDOWS_DESKTOP
+ info.dwOSVersionInfoSize = sizeof(info);
+ if (!GetVersionEx((OSVERSIONINFO*) &info)) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+#else
+ /* set to Windows 10, except BuildNumber. */
+ memset(&info, 0, sizeof(info));
+ info.dwOSVersionInfoSize = sizeof(info);
+ info.dwMajorVersion = 10;
+ info.dwMinorVersion = 0;
+
+ /* set Condition Mask */
+ DWORDLONG dwlConditionMask = 0;
+ VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(dwlConditionMask, VER_BUILDNUMBER, VER_GREATER_EQUAL);
+#endif
+
+ for (int i=0; i<sizeof(win_runtime_flags)/sizeof(FlagRuntimeInfo); i++) {
+#ifdef MS_WINDOWS_DESKTOP
+ info.dwBuildNumber = win_runtime_flags[i].build_number;
+ /* greater than or equal to the specified version?
+ Compatibility Mode will not cheat VerifyVersionInfo(...) */
+ BOOL isSupported = VerifyVersionInfo(
+ &info,
+ VER_MAJORVERSION|VER_MINORVERSION|VER_BUILDNUMBER,
+ dwlConditionMask);
+#else
+ /* note in this case 'info' is the actual OS version, whereas above
+ it is the version to compare against. */
+ BOOL isSupported = info.dwMajorVersion > 10 ||
+ (info.dwMajorVersion == 10 && info.dwMinorVersion > 0) ||
+ (info.dwMajorVersion == 10 && info.dwMinorVersion == 0 &&
+ info.dwBuildNumber >= win_runtime_flags[i].build_number);
+#endif
+ if (isSupported) {
+ break;
+ }
+ else {
+ PyObject *flag_name = PyUnicode_FromString(win_runtime_flags[i].flag_name);
+ if (flag_name == NULL) {
+ return -1;
+ }
+ PyObject *v = _PyDict_Pop(dict, flag_name, Py_None);
+ Py_DECREF(flag_name);
+ if (v == NULL) {
+ return -1;
+ }
+ Py_DECREF(v);
+ }
+ }
+ return 0;
+}
+
+#endif
+
+#include <stddef.h>
+
+#ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+/* include Python's addrinfo.h unless it causes trouble */
+#if defined(__sgi) && _COMPILER_VERSION>700 && defined(_SS_ALIGNSIZE)
+ /* Do not include addinfo.h on some newer IRIX versions.
+ * _SS_ALIGNSIZE is defined in sys/socket.h by 6.5.21,
+ * for example, but not by 6.5.10.
+ */
+#elif defined(_MSC_VER) && _MSC_VER>1201
+ /* Do not include addrinfo.h for MSVC7 or greater. 'addrinfo' and
+ * EAI_* constants are defined in (the already included) ws2tcpip.h.
+ */
+#else
+# include "addrinfo.h"
+#endif
+
+#ifdef __APPLE__
+/* On OS X, getaddrinfo returns no error indication of lookup
+ failure, so we must use the emulation instead of the libinfo
+ implementation. Unfortunately, performing an autoconf test
+ for this bug would require DNS access for the machine performing
+ the configuration, which is not acceptable. Therefore, we
+ determine the bug just by checking for __APPLE__. If this bug
+ gets ever fixed, perhaps checking for sys/version.h would be
+ appropriate, which is 10/0 on the system with the bug. */
+#ifndef HAVE_GETNAMEINFO
+/* This bug seems to be fixed in Jaguar. The easiest way I could
+ Find to check for Jaguar is that it has getnameinfo(), which
+ older releases don't have */
+#undef HAVE_GETADDRINFO
+#endif
+
+#ifdef HAVE_INET_ATON
+#define USE_INET_ATON_WEAKLINK
+#endif
+
+#endif
+
+/* I know this is a bad practice, but it is the easiest... */
+#if !defined(HAVE_GETADDRINFO)
+/* avoid clashes with the C library definition of the symbol. */
+#define getaddrinfo fake_getaddrinfo
+#define gai_strerror fake_gai_strerror
+#define freeaddrinfo fake_freeaddrinfo
+#include "getaddrinfo.c"
+#endif
+
+#if !defined(HAVE_GETNAMEINFO)
+#define getnameinfo fake_getnameinfo
+#include "getnameinfo.c"
+#endif // HAVE_GETNAMEINFO
+
+#ifdef MS_WINDOWS
+#define SOCKETCLOSE closesocket
+#endif
+
+#ifdef MS_WIN32
+# undef EAFNOSUPPORT
+# define EAFNOSUPPORT WSAEAFNOSUPPORT
+#endif
+
+#ifndef SOCKETCLOSE
+# define SOCKETCLOSE close
+#endif
+
+#if (defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H)) && !defined(__NetBSD__) && !defined(__DragonFly__)
+#define USE_BLUETOOTH 1
+#if defined(__FreeBSD__)
+#define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP
+#define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
+#define BTPROTO_HCI BLUETOOTH_PROTO_HCI
+#define SOL_HCI SOL_HCI_RAW
+#define HCI_FILTER SO_HCI_RAW_FILTER
+#define sockaddr_l2 sockaddr_l2cap
+#define sockaddr_rc sockaddr_rfcomm
+#define hci_dev hci_node
+#define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb)
+#define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb)
+#define _BT_HCI_MEMB(sa, memb) ((sa)->hci_##memb)
+#elif defined(__NetBSD__) || defined(__DragonFly__)
+#define sockaddr_l2 sockaddr_bt
+#define sockaddr_rc sockaddr_bt
+#define sockaddr_hci sockaddr_bt
+#define sockaddr_sco sockaddr_bt
+#define SOL_HCI BTPROTO_HCI
+#define HCI_DATA_DIR SO_HCI_DIRECTION
+#define _BT_L2_MEMB(sa, memb) ((sa)->bt_##memb)
+#define _BT_RC_MEMB(sa, memb) ((sa)->bt_##memb)
+#define _BT_HCI_MEMB(sa, memb) ((sa)->bt_##memb)
+#define _BT_SCO_MEMB(sa, memb) ((sa)->bt_##memb)
+#else
+#define _BT_L2_MEMB(sa, memb) ((sa)->l2_##memb)
+#define _BT_RC_MEMB(sa, memb) ((sa)->rc_##memb)
+#define _BT_HCI_MEMB(sa, memb) ((sa)->hci_##memb)
+#define _BT_SCO_MEMB(sa, memb) ((sa)->sco_##memb)
+#endif
+#endif
+
+#ifdef MS_WINDOWS_DESKTOP
+#define sockaddr_rc SOCKADDR_BTH_REDEF
+
+#define USE_BLUETOOTH 1
+#define AF_BLUETOOTH AF_BTH
+#define BTPROTO_RFCOMM BTHPROTO_RFCOMM
+#define _BT_RC_MEMB(sa, memb) ((sa)->memb)
+#endif /* MS_WINDOWS_DESKTOP */
+
+/* Convert "sock_addr_t *" to "struct sockaddr *". */
+#define SAS2SA(x) (&((x)->sa))
+
+/*
+ * Constants for getnameinfo()
+ */
+#if !defined(NI_MAXHOST)
+#define NI_MAXHOST 1025
+#endif
+#if !defined(NI_MAXSERV)
+#define NI_MAXSERV 32
+#endif
+
+#ifndef INVALID_SOCKET /* MS defines this */
+#define INVALID_SOCKET (-1)
+#endif
+
+#ifndef INADDR_NONE
+#define INADDR_NONE (-1)
+#endif
+
+typedef struct _socket_state {
+ /* The sock_type variable contains pointers to various functions,
+ some of which call new_sockobject(), which uses sock_type, so
+ there has to be a circular reference. */
+ PyTypeObject *sock_type;
+
+ /* Global variable holding the exception type for errors detected
+ by this module (but not argument type or memory errors, etc.). */
+ PyObject *socket_herror;
+ PyObject *socket_gaierror;
+
+ /* Default timeout for new sockets */
+ _PyTime_t defaulttimeout;
+
+#if defined(HAVE_ACCEPT) || defined(HAVE_ACCEPT4)
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+ /* accept4() is available on Linux 2.6.28+ and glibc 2.10 */
+ int accept4_works;
+#endif
+#endif
+
+#ifdef SOCK_CLOEXEC
+ /* socket() and socketpair() fail with EINVAL on Linux kernel older
+ * than 2.6.27 if SOCK_CLOEXEC flag is set in the socket type. */
+ int sock_cloexec_works;
+#endif
+} socket_state;
+
+static inline socket_state *
+get_module_state(PyObject *mod)
+{
+ void *state = _PyModule_GetState(mod);
+ assert(state != NULL);
+ return (socket_state *)state;
+}
+
+static struct PyModuleDef socketmodule;
+
+static inline socket_state *
+find_module_state_by_def(PyTypeObject *type)
+{
+ PyObject *mod = PyType_GetModuleByDef(type, &socketmodule);
+ assert(mod != NULL);
+ return get_module_state(mod);
+}
+
+#define clinic_state() (find_module_state_by_def(type))
+#include "clinic/socketmodule.c.h"
+#undef clinic_state
+
+/* XXX There's a problem here: *static* functions are not supposed to have
+ a Py prefix (or use CapitalizedWords). Later... */
+
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+
+/* Largest value to try to store in a socklen_t (used when handling
+ ancillary data). POSIX requires socklen_t to hold at least
+ (2**31)-1 and recommends against storing larger values, but
+ socklen_t was originally int in the BSD interface, so to be on the
+ safe side we use the smaller of (2**31)-1 and INT_MAX. */
+#if INT_MAX > 0x7fffffff
+#define SOCKLEN_T_LIMIT 0x7fffffff
+#else
+#define SOCKLEN_T_LIMIT INT_MAX
+#endif
+
+#ifdef HAVE_POLL
+/* Instead of select(), we'll use poll() since poll() works on any fd. */
+#define IS_SELECTABLE(s) 1
+/* Can we call select() with this socket without a buffer overrun? */
+#else
+/* If there's no timeout left, we don't have to call select, so it's a safe,
+ * little white lie. */
+#define IS_SELECTABLE(s) (_PyIsSelectable_fd((s)->sock_fd) || (s)->sock_timeout <= 0)
+#endif
+
+static PyObject*
+select_error(void)
+{
+ PyErr_SetString(PyExc_OSError, "unable to select on socket");
+ return NULL;
+}
+
+#ifdef MS_WINDOWS
+#ifndef WSAEAGAIN
+#define WSAEAGAIN WSAEWOULDBLOCK
+#endif
+#define CHECK_ERRNO(expected) \
+ (WSAGetLastError() == WSA ## expected)
+#else
+#define CHECK_ERRNO(expected) \
+ (errno == expected)
+#endif
+
+#ifdef MS_WINDOWS
+# define GET_SOCK_ERROR WSAGetLastError()
+# define SET_SOCK_ERROR(err) WSASetLastError(err)
+# define SOCK_TIMEOUT_ERR WSAEWOULDBLOCK
+# define SOCK_INPROGRESS_ERR WSAEWOULDBLOCK
+#else
+# define GET_SOCK_ERROR errno
+# define SET_SOCK_ERROR(err) do { errno = err; } while (0)
+# define SOCK_TIMEOUT_ERR EWOULDBLOCK
+# define SOCK_INPROGRESS_ERR EINPROGRESS
+#endif
+
+#ifdef _MSC_VER
+# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
+#else
+# define SUPPRESS_DEPRECATED_CALL
+#endif
+
+/* Convenience function to raise an error according to errno
+ and return a NULL pointer from a function. */
+
+static PyObject *
+set_error(void)
+{
+#ifdef MS_WINDOWS
+ int err_no = WSAGetLastError();
+ /* PyErr_SetExcFromWindowsErr() invokes FormatMessage() which
+ recognizes the error codes used by both GetLastError() and
+ WSAGetLastError */
+ if (err_no)
+ return PyErr_SetExcFromWindowsErr(PyExc_OSError, err_no);
+#endif
+
+ return PyErr_SetFromErrno(PyExc_OSError);
+}
+
+
+#if defined(HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYNAME) || defined (HAVE_GETHOSTBYADDR)
+static PyObject *
+set_herror(socket_state *state, int h_error)
+{
+ PyObject *v;
+
+#ifdef HAVE_HSTRERROR
+ v = Py_BuildValue("(is)", h_error, hstrerror(h_error));
+#else
+ v = Py_BuildValue("(is)", h_error, "host not found");
+#endif
+ if (v != NULL) {
+ PyErr_SetObject(state->socket_herror, v);
+ Py_DECREF(v);
+ }
+
+ return NULL;
+}
+#endif
+
+
+#ifdef HAVE_GETADDRINFO
+static PyObject *
+set_gaierror(socket_state *state, int error)
+{
+ PyObject *v;
+
+#ifdef EAI_SYSTEM
+ /* EAI_SYSTEM is not available on Windows XP. */
+ if (error == EAI_SYSTEM)
+ return set_error();
+#endif
+
+#ifdef HAVE_GAI_STRERROR
+ v = Py_BuildValue("(is)", error, gai_strerror(error));
+#else
+ v = Py_BuildValue("(is)", error, "getaddrinfo failed");
+#endif
+ if (v != NULL) {
+ PyErr_SetObject(state->socket_gaierror, v);
+ Py_DECREF(v);
+ }
+
+ return NULL;
+}
+#endif
+
+/* Function to perform the setting of socket blocking mode
+ internally. block = (1 | 0). */
+static int
+internal_setblocking(PySocketSockObject *s, int block)
+{
+ int result = -1;
+#ifdef MS_WINDOWS
+ u_long arg;
+#endif
+#if !defined(MS_WINDOWS) \
+ && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)))
+ int delay_flag, new_delay_flag;
+#endif
+
+ Py_BEGIN_ALLOW_THREADS
+#ifndef MS_WINDOWS
+#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO))
+ block = !block;
+ if (ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block) == -1)
+ goto done;
+#else
+ delay_flag = fcntl(s->sock_fd, F_GETFL, 0);
+ if (delay_flag == -1)
+ goto done;
+ if (block)
+ new_delay_flag = delay_flag & (~O_NONBLOCK);
+ else
+ new_delay_flag = delay_flag | O_NONBLOCK;
+ if (new_delay_flag != delay_flag)
+ if (fcntl(s->sock_fd, F_SETFL, new_delay_flag) == -1)
+ goto done;
+#endif
+#else /* MS_WINDOWS */
+ arg = !block;
+ if (ioctlsocket(s->sock_fd, FIONBIO, &arg) != 0)
+ goto done;
+#endif /* MS_WINDOWS */
+
+ result = 0;
+
+ done:
+ Py_END_ALLOW_THREADS
+
+ if (result) {
+#ifndef MS_WINDOWS
+ PyErr_SetFromErrno(PyExc_OSError);
+#else
+ PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError());
+#endif
+ }
+
+ return result;
+}
+
+static int
+internal_select(PySocketSockObject *s, int writing, _PyTime_t interval,
+ int connect)
+{
+ int n;
+#ifdef HAVE_POLL
+ struct pollfd pollfd;
+ _PyTime_t ms;
+#else
+ fd_set fds, efds;
+ struct timeval tv, *tvp;
+#endif
+
+ /* must be called with the GIL held */
+ assert(PyGILState_Check());
+
+ /* Error condition is for output only */
+ assert(!(connect && !writing));
+
+ /* Guard against closed socket */
+ if (s->sock_fd == INVALID_SOCKET)
+ return 0;
+
+ /* Prefer poll, if available, since you can poll() any fd
+ * which can't be done with select(). */
+#ifdef HAVE_POLL
+ pollfd.fd = s->sock_fd;
+ pollfd.events = writing ? POLLOUT : POLLIN;
+ if (connect) {
+ /* On Windows, the socket becomes writable on connection success,
+ but a connection failure is notified as an error. On POSIX, the
+ socket becomes writable on connection success or on connection
+ failure. */
+ pollfd.events |= POLLERR;
+ }
+
+ /* s->sock_timeout is in seconds, timeout in ms */
+ ms = _PyTime_AsMilliseconds(interval, _PyTime_ROUND_CEILING);
+ assert(ms <= INT_MAX);
+
+ /* On some OSes, typically BSD-based ones, the timeout parameter of the
+ poll() syscall, when negative, must be exactly INFTIM, where defined,
+ or -1. See issue 37811. */
+ if (ms < 0) {
+#ifdef INFTIM
+ ms = INFTIM;
+#else
+ ms = -1;
+#endif
+ }
+
+ Py_BEGIN_ALLOW_THREADS;
+ n = poll(&pollfd, 1, (int)ms);
+ Py_END_ALLOW_THREADS;
+#else
+ if (interval >= 0) {
+ _PyTime_AsTimeval_clamp(interval, &tv, _PyTime_ROUND_CEILING);
+ tvp = &tv;
+ }
+ else
+ tvp = NULL;
+
+ FD_ZERO(&fds);
+ FD_SET(s->sock_fd, &fds);
+ FD_ZERO(&efds);
+ if (connect) {
+ /* On Windows, the socket becomes writable on connection success,
+ but a connection failure is notified as an error. On POSIX, the
+ socket becomes writable on connection success or on connection
+ failure. */
+ FD_SET(s->sock_fd, &efds);
+ }
+
+ /* See if the socket is ready */
+ Py_BEGIN_ALLOW_THREADS;
+ if (writing)
+ n = select(Py_SAFE_DOWNCAST(s->sock_fd+1, SOCKET_T, int),
+ NULL, &fds, &efds, tvp);
+ else
+ n = select(Py_SAFE_DOWNCAST(s->sock_fd+1, SOCKET_T, int),
+ &fds, NULL, &efds, tvp);
+ Py_END_ALLOW_THREADS;
+#endif
+
+ if (n < 0)
+ return -1;
+ if (n == 0)
+ return 1;
+ return 0;
+}
+
+/* Call a socket function.
+
+ On error, raise an exception and return -1 if err is set, or fill err and
+ return -1 otherwise. If a signal was received and the signal handler raised
+ an exception, return -1, and set err to -1 if err is set.
+
+ On success, return 0, and set err to 0 if err is set.
+
+ If the socket has a timeout, wait until the socket is ready before calling
+ the function: wait until the socket is writable if writing is nonzero, wait
+ until the socket received data otherwise.
+
+ If the socket function is interrupted by a signal (failed with EINTR): retry
+ the function, except if the signal handler raised an exception (PEP 475).
+
+ When the function is retried, recompute the timeout using a monotonic clock.
+
+ sock_call_ex() must be called with the GIL held. The socket function is
+ called with the GIL released. */
+static int
+sock_call_ex(PySocketSockObject *s,
+ int writing,
+ int (*sock_func) (PySocketSockObject *s, void *data),
+ void *data,
+ int connect,
+ int *err,
+ _PyTime_t timeout)
+{
+ int has_timeout = (timeout > 0);
+ _PyTime_t deadline = 0;
+ int deadline_initialized = 0;
+ int res;
+
+ /* sock_call() must be called with the GIL held. */
+ assert(PyGILState_Check());
+
+ /* outer loop to retry select() when select() is interrupted by a signal
+ or to retry select()+sock_func() on false positive (see above) */
+ while (1) {
+ /* For connect(), poll even for blocking socket. The connection
+ runs asynchronously. */
+ if (has_timeout || connect) {
+ if (has_timeout) {
+ _PyTime_t interval;
+
+ if (deadline_initialized) {
+ /* recompute the timeout */
+ interval = _PyDeadline_Get(deadline);
+ }
+ else {
+ deadline_initialized = 1;
+ deadline = _PyDeadline_Init(timeout);
+ interval = timeout;
+ }
+
+ if (interval >= 0) {
+ res = internal_select(s, writing, interval, connect);
+ }
+ else {
+ res = 1;
+ }
+ }
+ else {
+ res = internal_select(s, writing, timeout, connect);
+ }
+
+ if (res == -1) {
+ if (err)
+ *err = GET_SOCK_ERROR;
+
+ if (CHECK_ERRNO(EINTR)) {
+ /* select() was interrupted by a signal */
+ if (PyErr_CheckSignals()) {
+ if (err)
+ *err = -1;
+ return -1;
+ }
+
+ /* retry select() */
+ continue;
+ }
+
+ /* select() failed */
+ s->errorhandler();
+ return -1;
+ }
+
+ if (res == 1) {
+ if (err)
+ *err = SOCK_TIMEOUT_ERR;
+ else
+ PyErr_SetString(PyExc_TimeoutError, "timed out");
+ return -1;
+ }
+
+ /* the socket is ready */
+ }
+
+ /* inner loop to retry sock_func() when sock_func() is interrupted
+ by a signal */
+ while (1) {
+ Py_BEGIN_ALLOW_THREADS
+ res = sock_func(s, data);
+ Py_END_ALLOW_THREADS
+
+ if (res) {
+ /* sock_func() succeeded */
+ if (err)
+ *err = 0;
+ return 0;
+ }
+
+ if (err)
+ *err = GET_SOCK_ERROR;
+
+ if (!CHECK_ERRNO(EINTR))
+ break;
+
+ /* sock_func() was interrupted by a signal */
+ if (PyErr_CheckSignals()) {
+ if (err)
+ *err = -1;
+ return -1;
+ }
+
+ /* retry sock_func() */
+ }
+
+ if (s->sock_timeout > 0
+ && (CHECK_ERRNO(EWOULDBLOCK) || CHECK_ERRNO(EAGAIN))) {
+ /* False positive: sock_func() failed with EWOULDBLOCK or EAGAIN.
+
+ For example, select() could indicate a socket is ready for
+ reading, but the data then discarded by the OS because of a
+ wrong checksum.
+
+ Loop on select() to recheck for socket readiness. */
+ continue;
+ }
+
+ /* sock_func() failed */
+ if (!err)
+ s->errorhandler();
+ /* else: err was already set before */
+ return -1;
+ }
+}
+
+static int
+sock_call(PySocketSockObject *s,
+ int writing,
+ int (*func) (PySocketSockObject *s, void *data),
+ void *data)
+{
+ return sock_call_ex(s, writing, func, data, 0, NULL, s->sock_timeout);
+}
+
+
+/* Initialize a new socket object. */
+
+static int
+init_sockobject(socket_state *state, PySocketSockObject *s,
+ SOCKET_T fd, int family, int type, int proto)
+{
+ s->sock_fd = fd;
+ s->sock_family = family;
+
+ s->sock_type = type;
+
+ /* It's possible to pass SOCK_NONBLOCK and SOCK_CLOEXEC bit flags
+ on some OSes as part of socket.type. We want to reset them here,
+ to make socket.type be set to the same value on all platforms.
+ Otherwise, simple code like 'if sock.type == SOCK_STREAM' is
+ not portable.
+ */
+#ifdef SOCK_NONBLOCK
+ s->sock_type = s->sock_type & ~SOCK_NONBLOCK;
+#endif
+#ifdef SOCK_CLOEXEC
+ s->sock_type = s->sock_type & ~SOCK_CLOEXEC;
+#endif
+
+ s->sock_proto = proto;
+
+ s->errorhandler = &set_error;
+#ifdef SOCK_NONBLOCK
+ if (type & SOCK_NONBLOCK)
+ s->sock_timeout = 0;
+ else
+#endif
+ {
+ s->sock_timeout = state->defaulttimeout;
+ if (state->defaulttimeout >= 0) {
+ if (internal_setblocking(s, 0) == -1) {
+ return -1;
+ }
+ }
+ }
+ s->state = state;
+ return 0;
+}
+
+
+#ifdef HAVE_SOCKETPAIR
+/* Create a new socket object.
+ This just creates the object and initializes it.
+ If the creation fails, return NULL and set an exception (implicit
+ in NEWOBJ()). */
+
+static PySocketSockObject *
+new_sockobject(socket_state *state, SOCKET_T fd, int family, int type,
+ int proto)
+{
+ PyTypeObject *tp = state->sock_type;
+ PySocketSockObject *s = (PySocketSockObject *)tp->tp_alloc(tp, 0);
+ if (s == NULL) {
+ return NULL;
+ }
+ if (init_sockobject(state, s, fd, family, type, proto) == -1) {
+ Py_DECREF(s);
+ return NULL;
+ }
+ return s;
+}
+#endif
+
+
+/* Lock to allow python interpreter to continue, but only allow one
+ thread to be in gethostbyname or getaddrinfo */
+#if defined(USE_GETHOSTBYNAME_LOCK)
+static PyThread_type_lock netdb_lock;
+#endif
+
+
+#ifdef HAVE_GETADDRINFO
+/* Convert a string specifying a host name or one of a few symbolic
+ names to a numeric IP address. This usually calls gethostbyname()
+ to do the work; the names "" and "<broadcast>" are special.
+ Return the length (IPv4 should be 4 bytes), or negative if
+ an error occurred; then an exception is raised. */
+
+static int
+setipaddr(socket_state *state, const char *name, struct sockaddr *addr_ret,
+ size_t addr_ret_size, int af)
+{
+ struct addrinfo hints, *res;
+ int error;
+
+ memset((void *) addr_ret, '\0', sizeof(*addr_ret));
+ if (name[0] == '\0') {
+ int siz;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = af;
+ hints.ai_socktype = SOCK_DGRAM; /*dummy*/
+ hints.ai_flags = AI_PASSIVE;
+ Py_BEGIN_ALLOW_THREADS
+ error = getaddrinfo(NULL, "0", &hints, &res);
+ Py_END_ALLOW_THREADS
+ /* We assume that those thread-unsafe getaddrinfo() versions
+ *are* safe regarding their return value, ie. that a
+ subsequent call to getaddrinfo() does not destroy the
+ outcome of the first call. */
+ if (error) {
+ res = NULL; // no-op, remind us that it is invalid; gh-100795
+ set_gaierror(state, error);
+ return -1;
+ }
+ switch (res->ai_family) {
+ case AF_INET:
+ siz = 4;
+ break;
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ siz = 16;
+ break;
+#endif
+ default:
+ freeaddrinfo(res);
+ PyErr_SetString(PyExc_OSError,
+ "unsupported address family");
+ return -1;
+ }
+ if (res->ai_next) {
+ freeaddrinfo(res);
+ PyErr_SetString(PyExc_OSError,
+ "wildcard resolved to multiple address");
+ return -1;
+ }
+ if (res->ai_addrlen < addr_ret_size)
+ addr_ret_size = res->ai_addrlen;
+ memcpy(addr_ret, res->ai_addr, addr_ret_size);
+ freeaddrinfo(res);
+ return siz;
+ }
+ /* special-case broadcast - inet_addr() below can return INADDR_NONE for
+ * this */
+ if (strcmp(name, "255.255.255.255") == 0 ||
+ strcmp(name, "<broadcast>") == 0) {
+ struct sockaddr_in *sin;
+ if (af != AF_INET && af != AF_UNSPEC) {
+ PyErr_SetString(PyExc_OSError,
+ "address family mismatched");
+ return -1;
+ }
+ sin = (struct sockaddr_in *)addr_ret;
+ memset((void *) sin, '\0', sizeof(*sin));
+ sin->sin_family = AF_INET;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin->sin_len = sizeof(*sin);
+#endif
+ sin->sin_addr.s_addr = INADDR_BROADCAST;
+ return sizeof(sin->sin_addr);
+ }
+
+ /* avoid a name resolution in case of numeric address */
+#ifdef HAVE_INET_PTON
+ /* check for an IPv4 address */
+ if (af == AF_UNSPEC || af == AF_INET) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)addr_ret;
+ memset(sin, 0, sizeof(*sin));
+ if (inet_pton(AF_INET, name, &sin->sin_addr) > 0) {
+ sin->sin_family = AF_INET;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin->sin_len = sizeof(*sin);
+#endif
+ return 4;
+ }
+ }
+#ifdef ENABLE_IPV6
+ /* check for an IPv6 address - if the address contains a scope ID, we
+ * fallback to getaddrinfo(), which can handle translation from interface
+ * name to interface index */
+ if ((af == AF_UNSPEC || af == AF_INET6) && !strchr(name, '%')) {
+ struct sockaddr_in6 *sin = (struct sockaddr_in6 *)addr_ret;
+ memset(sin, 0, sizeof(*sin));
+ if (inet_pton(AF_INET6, name, &sin->sin6_addr) > 0) {
+ sin->sin6_family = AF_INET6;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin->sin6_len = sizeof(*sin);
+#endif
+ return 16;
+ }
+ }
+#endif /* ENABLE_IPV6 */
+#else /* HAVE_INET_PTON */
+ /* check for an IPv4 address */
+ if (af == AF_INET || af == AF_UNSPEC) {
+ struct sockaddr_in *sin = (struct sockaddr_in *)addr_ret;
+ memset(sin, 0, sizeof(*sin));
+ if ((sin->sin_addr.s_addr = inet_addr(name)) != INADDR_NONE) {
+ sin->sin_family = AF_INET;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin->sin_len = sizeof(*sin);
+#endif
+ return 4;
+ }
+ }
+#endif /* HAVE_INET_PTON */
+
+ /* perform a name resolution */
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = af;
+ Py_BEGIN_ALLOW_THREADS
+ error = getaddrinfo(name, NULL, &hints, &res);
+#if defined(__digital__) && defined(__unix__)
+ if (error == EAI_NONAME && af == AF_UNSPEC) {
+ /* On Tru64 V5.1, numeric-to-addr conversion fails
+ if no address family is given. Assume IPv4 for now.*/
+ hints.ai_family = AF_INET;
+ error = getaddrinfo(name, NULL, &hints, &res);
+ }
+#endif
+ Py_END_ALLOW_THREADS
+ if (error) {
+ res = NULL; // no-op, remind us that it is invalid; gh-100795
+ set_gaierror(state, error);
+ return -1;
+ }
+ if (res->ai_addrlen < addr_ret_size)
+ addr_ret_size = res->ai_addrlen;
+ memcpy((char *) addr_ret, res->ai_addr, addr_ret_size);
+ freeaddrinfo(res);
+ switch (addr_ret->sa_family) {
+ case AF_INET:
+ return 4;
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ return 16;
+#endif
+ default:
+ PyErr_SetString(PyExc_OSError, "unknown address family");
+ return -1;
+ }
+}
+#endif // HAVE_GETADDRINFO
+
+/* Convert IPv4 sockaddr to a Python str. */
+
+static PyObject *
+make_ipv4_addr(const struct sockaddr_in *addr)
+{
+ char buf[INET_ADDRSTRLEN];
+ if (inet_ntop(AF_INET, &addr->sin_addr, buf, sizeof(buf)) == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyUnicode_FromString(buf);
+}
+
+#ifdef ENABLE_IPV6
+/* Convert IPv6 sockaddr to a Python str. */
+
+static PyObject *
+make_ipv6_addr(const struct sockaddr_in6 *addr)
+{
+ char buf[INET6_ADDRSTRLEN];
+ if (inet_ntop(AF_INET6, &addr->sin6_addr, buf, sizeof(buf)) == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyUnicode_FromString(buf);
+}
+#endif
+
+#ifdef USE_BLUETOOTH
+/* Convert a string representation of a Bluetooth address into a numeric
+ address. Returns the length (6), or raises an exception and returns -1 if
+ an error occurred. */
+
+static int
+setbdaddr(const char *name, bdaddr_t *bdaddr)
+{
+ unsigned int b0, b1, b2, b3, b4, b5;
+ char ch;
+ int n;
+
+ n = sscanf(name, "%X:%X:%X:%X:%X:%X%c",
+ &b5, &b4, &b3, &b2, &b1, &b0, &ch);
+ if (n == 6 && (b0 | b1 | b2 | b3 | b4 | b5) < 256) {
+
+#ifdef MS_WINDOWS
+ *bdaddr = (ULONGLONG)(b0 & 0xFF);
+ *bdaddr |= ((ULONGLONG)(b1 & 0xFF) << 8);
+ *bdaddr |= ((ULONGLONG)(b2 & 0xFF) << 16);
+ *bdaddr |= ((ULONGLONG)(b3 & 0xFF) << 24);
+ *bdaddr |= ((ULONGLONG)(b4 & 0xFF) << 32);
+ *bdaddr |= ((ULONGLONG)(b5 & 0xFF) << 40);
+#else
+ bdaddr->b[0] = b0;
+ bdaddr->b[1] = b1;
+ bdaddr->b[2] = b2;
+ bdaddr->b[3] = b3;
+ bdaddr->b[4] = b4;
+ bdaddr->b[5] = b5;
+#endif
+
+ return 6;
+ } else {
+ PyErr_SetString(PyExc_OSError, "bad bluetooth address");
+ return -1;
+ }
+}
+
+/* Create a string representation of the Bluetooth address. This is always a
+ string of the form 'XX:XX:XX:XX:XX:XX' where XX is a two digit hexadecimal
+ value (zero padded if necessary). */
+
+static PyObject *
+makebdaddr(bdaddr_t *bdaddr)
+{
+#ifdef MS_WINDOWS
+ int i;
+ unsigned int octets[6];
+
+ for (i = 0; i < 6; ++i) {
+ octets[i] = ((*bdaddr) >> (8 * i)) & 0xFF;
+ }
+
+ return PyUnicode_FromFormat("%02X:%02X:%02X:%02X:%02X:%02X",
+ octets[5], octets[4], octets[3],
+ octets[2], octets[1], octets[0]);
+#else
+ return PyUnicode_FromFormat("%02X:%02X:%02X:%02X:%02X:%02X",
+ bdaddr->b[5], bdaddr->b[4], bdaddr->b[3],
+ bdaddr->b[2], bdaddr->b[1], bdaddr->b[0]);
+#endif
+}
+#endif
+
+
+/* Create an object representing the given socket address,
+ suitable for passing it back to bind(), connect() etc.
+ The family field of the sockaddr structure is inspected
+ to determine what kind of address it really is. */
+
+/*ARGSUSED*/
+static PyObject *
+makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
+{
+ if (addrlen == 0) {
+ /* No address -- may be recvfrom() from known socket */
+ Py_RETURN_NONE;
+ }
+
+ switch (addr->sa_family) {
+
+ case AF_INET:
+ {
+ const struct sockaddr_in *a = (const struct sockaddr_in *)addr;
+ PyObject *addrobj = make_ipv4_addr(a);
+ PyObject *ret = NULL;
+ if (addrobj) {
+ ret = Py_BuildValue("Oi", addrobj, ntohs(a->sin_port));
+ Py_DECREF(addrobj);
+ }
+ return ret;
+ }
+
+#if defined(AF_UNIX)
+ case AF_UNIX:
+ {
+ struct sockaddr_un *a = (struct sockaddr_un *) addr;
+#ifdef __linux__
+ size_t linuxaddrlen = addrlen - offsetof(struct sockaddr_un, sun_path);
+ if (linuxaddrlen > 0 && a->sun_path[0] == 0) { /* Linux abstract namespace */
+ return PyBytes_FromStringAndSize(a->sun_path, linuxaddrlen);
+ }
+ else
+#endif /* linux */
+ {
+ /* regular NULL-terminated string */
+ return PyUnicode_DecodeFSDefault(a->sun_path);
+ }
+ }
+#endif /* AF_UNIX */
+
+#if defined(AF_NETLINK)
+ case AF_NETLINK:
+ {
+ struct sockaddr_nl *a = (struct sockaddr_nl *) addr;
+ return Py_BuildValue("II", a->nl_pid, a->nl_groups);
+ }
+#endif /* AF_NETLINK */
+
+#if defined(AF_QIPCRTR)
+ case AF_QIPCRTR:
+ {
+ struct sockaddr_qrtr *a = (struct sockaddr_qrtr *) addr;
+ return Py_BuildValue("II", a->sq_node, a->sq_port);
+ }
+#endif /* AF_QIPCRTR */
+
+#if defined(AF_VSOCK)
+ case AF_VSOCK:
+ {
+ struct sockaddr_vm *a = (struct sockaddr_vm *) addr;
+ return Py_BuildValue("II", a->svm_cid, a->svm_port);
+ }
+#endif /* AF_VSOCK */
+
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ {
+ const struct sockaddr_in6 *a = (const struct sockaddr_in6 *)addr;
+ PyObject *addrobj = make_ipv6_addr(a);
+ PyObject *ret = NULL;
+ if (addrobj) {
+ ret = Py_BuildValue("OiII",
+ addrobj,
+ ntohs(a->sin6_port),
+ ntohl(a->sin6_flowinfo),
+ a->sin6_scope_id);
+ Py_DECREF(addrobj);
+ }
+ return ret;
+ }
+#endif /* ENABLE_IPV6 */
+
+#ifdef USE_BLUETOOTH
+ case AF_BLUETOOTH:
+ switch (proto) {
+
+#ifdef BTPROTO_L2CAP
+ case BTPROTO_L2CAP:
+ {
+ struct sockaddr_l2 *a = (struct sockaddr_l2 *) addr;
+ PyObject *addrobj = makebdaddr(&_BT_L2_MEMB(a, bdaddr));
+ PyObject *ret = NULL;
+ if (addrobj) {
+ ret = Py_BuildValue("Oi",
+ addrobj,
+ _BT_L2_MEMB(a, psm));
+ Py_DECREF(addrobj);
+ }
+ return ret;
+ }
+
+#endif /* BTPROTO_L2CAP */
+
+ case BTPROTO_RFCOMM:
+ {
+ struct sockaddr_rc *a = (struct sockaddr_rc *) addr;
+ PyObject *addrobj = makebdaddr(&_BT_RC_MEMB(a, bdaddr));
+ PyObject *ret = NULL;
+ if (addrobj) {
+ ret = Py_BuildValue("Oi",
+ addrobj,
+ _BT_RC_MEMB(a, channel));
+ Py_DECREF(addrobj);
+ }
+ return ret;
+ }
+
+#ifdef BTPROTO_HCI
+ case BTPROTO_HCI:
+ {
+ struct sockaddr_hci *a = (struct sockaddr_hci *) addr;
+#if defined(__NetBSD__) || defined(__DragonFly__)
+ return makebdaddr(&_BT_HCI_MEMB(a, bdaddr));
+#else /* __NetBSD__ || __DragonFly__ */
+ PyObject *ret = NULL;
+ ret = Py_BuildValue("i", _BT_HCI_MEMB(a, dev));
+ return ret;
+#endif /* !(__NetBSD__ || __DragonFly__) */
+ }
+
+#if !defined(__FreeBSD__)
+ case BTPROTO_SCO:
+ {
+ struct sockaddr_sco *a = (struct sockaddr_sco *) addr;
+ return makebdaddr(&_BT_SCO_MEMB(a, bdaddr));
+ }
+#endif /* !__FreeBSD__ */
+#endif /* BTPROTO_HCI */
+
+ default:
+ PyErr_SetString(PyExc_ValueError,
+ "Unknown Bluetooth protocol");
+ return NULL;
+ }
+#endif /* USE_BLUETOOTH */
+
+#if defined(HAVE_NETPACKET_PACKET_H) && defined(SIOCGIFNAME)
+ case AF_PACKET:
+ {
+ struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
+ const char *ifname = "";
+ struct ifreq ifr;
+ /* need to look up interface name give index */
+ if (a->sll_ifindex) {
+ ifr.ifr_ifindex = a->sll_ifindex;
+ if (ioctl(sockfd, SIOCGIFNAME, &ifr) == 0)
+ ifname = ifr.ifr_name;
+ }
+ return Py_BuildValue("shbhy#",
+ ifname,
+ ntohs(a->sll_protocol),
+ a->sll_pkttype,
+ a->sll_hatype,
+ a->sll_addr,
+ (Py_ssize_t)a->sll_halen);
+ }
+#endif /* HAVE_NETPACKET_PACKET_H && SIOCGIFNAME */
+
+#ifdef HAVE_LINUX_TIPC_H
+ case AF_TIPC:
+ {
+ struct sockaddr_tipc *a = (struct sockaddr_tipc *) addr;
+ if (a->addrtype == TIPC_ADDR_NAMESEQ) {
+ return Py_BuildValue("IIIII",
+ a->addrtype,
+ a->addr.nameseq.type,
+ a->addr.nameseq.lower,
+ a->addr.nameseq.upper,
+ a->scope);
+ } else if (a->addrtype == TIPC_ADDR_NAME) {
+ return Py_BuildValue("IIIII",
+ a->addrtype,
+ a->addr.name.name.type,
+ a->addr.name.name.instance,
+ a->addr.name.name.instance,
+ a->scope);
+ } else if (a->addrtype == TIPC_ADDR_ID) {
+ return Py_BuildValue("IIIII",
+ a->addrtype,
+ a->addr.id.node,
+ a->addr.id.ref,
+ 0,
+ a->scope);
+ } else {
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid address type");
+ return NULL;
+ }
+ }
+#endif /* HAVE_LINUX_TIPC_H */
+
+#if defined(AF_CAN) && defined(SIOCGIFNAME)
+ case AF_CAN:
+ {
+ struct sockaddr_can *a = (struct sockaddr_can *)addr;
+ const char *ifname = "";
+ struct ifreq ifr;
+ /* need to look up interface name given index */
+ if (a->can_ifindex) {
+ ifr.ifr_ifindex = a->can_ifindex;
+ if (ioctl(sockfd, SIOCGIFNAME, &ifr) == 0)
+ ifname = ifr.ifr_name;
+ }
+
+ switch (proto) {
+#ifdef CAN_ISOTP
+ case CAN_ISOTP:
+ {
+ return Py_BuildValue("O&kk", PyUnicode_DecodeFSDefault,
+ ifname,
+ a->can_addr.tp.rx_id,
+ a->can_addr.tp.tx_id);
+ }
+#endif /* CAN_ISOTP */
+#ifdef CAN_J1939
+ case CAN_J1939:
+ {
+ return Py_BuildValue("O&KIB", PyUnicode_DecodeFSDefault,
+ ifname,
+ (unsigned long long)a->can_addr.j1939.name,
+ (unsigned int)a->can_addr.j1939.pgn,
+ a->can_addr.j1939.addr);
+ }
+#endif /* CAN_J1939 */
+ default:
+ {
+ return Py_BuildValue("(O&)", PyUnicode_DecodeFSDefault,
+ ifname);
+ }
+ }
+ }
+#endif /* AF_CAN && SIOCGIFNAME */
+
+#ifdef PF_SYSTEM
+ case PF_SYSTEM:
+ switch(proto) {
+#ifdef SYSPROTO_CONTROL
+ case SYSPROTO_CONTROL:
+ {
+ struct sockaddr_ctl *a = (struct sockaddr_ctl *)addr;
+ return Py_BuildValue("(II)", a->sc_id, a->sc_unit);
+ }
+#endif /* SYSPROTO_CONTROL */
+ default:
+ PyErr_SetString(PyExc_ValueError,
+ "Invalid address type");
+ return 0;
+ }
+#endif /* PF_SYSTEM */
+
+#ifdef HAVE_SOCKADDR_ALG
+ case AF_ALG:
+ {
+ struct sockaddr_alg *a = (struct sockaddr_alg *)addr;
+ return Py_BuildValue("s#s#HH",
+ a->salg_type,
+ strnlen((const char*)a->salg_type,
+ sizeof(a->salg_type)),
+ a->salg_name,
+ strnlen((const char*)a->salg_name,
+ sizeof(a->salg_name)),
+ a->salg_feat,
+ a->salg_mask);
+ }
+#endif /* HAVE_SOCKADDR_ALG */
+
+#ifdef HAVE_AF_HYPERV
+ case AF_HYPERV:
+ {
+ SOCKADDR_HV *a = (SOCKADDR_HV *) addr;
+
+ wchar_t *guidStr;
+ RPC_STATUS res = UuidToStringW(&a->VmId, &guidStr);
+ if (res != RPC_S_OK) {
+ PyErr_SetFromWindowsErr(res);
+ return 0;
+ }
+ PyObject *vmId = PyUnicode_FromWideChar(guidStr, -1);
+ res = RpcStringFreeW(&guidStr);
+ assert(res == RPC_S_OK);
+
+ res = UuidToStringW(&a->ServiceId, &guidStr);
+ if (res != RPC_S_OK) {
+ Py_DECREF(vmId);
+ PyErr_SetFromWindowsErr(res);
+ return 0;
+ }
+ PyObject *serviceId = PyUnicode_FromWideChar(guidStr, -1);
+ res = RpcStringFreeW(&guidStr);
+ assert(res == RPC_S_OK);
+
+ return Py_BuildValue("NN", vmId, serviceId);
+ }
+#endif /* AF_HYPERV */
+
+ /* More cases here... */
+
+ default:
+ /* If we don't know the address family, don't raise an
+ exception -- return it as an (int, bytes) tuple. */
+ return Py_BuildValue("iy#",
+ addr->sa_family,
+ addr->sa_data,
+ sizeof(addr->sa_data));
+
+ }
+}
+
+#if defined(HAVE_BIND) || defined(HAVE_CONNECTTO) || defined(CMSG_LEN)
+/* Helper for getsockaddrarg: bypass IDNA for ASCII-only host names
+ (in particular, numeric IP addresses). */
+struct maybe_idna {
+ PyObject *obj;
+ char *buf;
+};
+
+static void
+idna_cleanup(struct maybe_idna *data)
+{
+ Py_CLEAR(data->obj);
+}
+
+static int
+idna_converter(PyObject *obj, struct maybe_idna *data)
+{
+ size_t len;
+ PyObject *obj2;
+ if (obj == NULL) {
+ idna_cleanup(data);
+ return 1;
+ }
+ data->obj = NULL;
+ len = -1;
+ if (PyBytes_Check(obj)) {
+ data->buf = PyBytes_AsString(obj);
+ len = PyBytes_Size(obj);
+ }
+ else if (PyByteArray_Check(obj)) {
+ data->buf = PyByteArray_AsString(obj);
+ len = PyByteArray_Size(obj);
+ }
+ else if (PyUnicode_Check(obj)) {
+ if (PyUnicode_READY(obj) == -1) {
+ return 0;
+ }
+ if (PyUnicode_IS_COMPACT_ASCII(obj)) {
+ data->buf = PyUnicode_DATA(obj);
+ len = PyUnicode_GET_LENGTH(obj);
+ }
+ else {
+ obj2 = PyUnicode_AsEncodedString(obj, "idna", NULL);
+ if (!obj2) {
+ PyErr_SetString(PyExc_TypeError, "encoding of hostname failed");
+ return 0;
+ }
+ assert(PyBytes_Check(obj2));
+ data->obj = obj2;
+ data->buf = PyBytes_AS_STRING(obj2);
+ len = PyBytes_GET_SIZE(obj2);
+ }
+ }
+ else {
+ PyErr_Format(PyExc_TypeError, "str, bytes or bytearray expected, not %s",
+ Py_TYPE(obj)->tp_name);
+ return 0;
+ }
+ if (strlen(data->buf) != len) {
+ Py_CLEAR(data->obj);
+ PyErr_SetString(PyExc_TypeError, "host name must not contain null character");
+ return 0;
+ }
+ return Py_CLEANUP_SUPPORTED;
+}
+
+/* Parse a socket address argument according to the socket object's
+ address family. Return 1 if the address was in the proper format,
+ 0 of not. The address is returned through addr_ret, its length
+ through len_ret. */
+
+static int
+getsockaddrarg(PySocketSockObject *s, PyObject *args,
+ sock_addr_t *addrbuf, int *len_ret, const char *caller)
+{
+ switch (s->sock_family) {
+
+#if defined(AF_UNIX)
+ case AF_UNIX:
+ {
+ Py_buffer path;
+ int retval = 0;
+
+ /* PEP 383. Not using PyUnicode_FSConverter since we need to
+ allow embedded nulls on Linux. */
+ if (PyUnicode_Check(args)) {
+ if ((args = PyUnicode_EncodeFSDefault(args)) == NULL)
+ return 0;
+ }
+ else
+ Py_INCREF(args);
+ if (!PyArg_Parse(args, "y*", &path)) {
+ Py_DECREF(args);
+ return retval;
+ }
+ assert(path.len >= 0);
+
+ struct sockaddr_un* addr = &addrbuf->un;
+#ifdef __linux__
+ if (path.len == 0 || *(const char *)path.buf == 0) {
+ /* Linux abstract namespace extension:
+ - Empty address auto-binding to an abstract address
+ - Address that starts with null byte */
+ if ((size_t)path.len > sizeof addr->sun_path) {
+ PyErr_SetString(PyExc_OSError,
+ "AF_UNIX path too long");
+ goto unix_out;
+ }
+
+ *len_ret = path.len + offsetof(struct sockaddr_un, sun_path);
+ }
+ else
+#endif /* linux */
+ {
+ /* regular NULL-terminated string */
+ if ((size_t)path.len >= sizeof addr->sun_path) {
+ PyErr_SetString(PyExc_OSError,
+ "AF_UNIX path too long");
+ goto unix_out;
+ }
+ addr->sun_path[path.len] = 0;
+
+ /* including the tailing NUL */
+ *len_ret = path.len + offsetof(struct sockaddr_un, sun_path) + 1;
+ }
+ addr->sun_family = s->sock_family;
+ memcpy(addr->sun_path, path.buf, path.len);
+
+ retval = 1;
+ unix_out:
+ PyBuffer_Release(&path);
+ Py_DECREF(args);
+ return retval;
+ }
+#endif /* AF_UNIX */
+
+#if defined(AF_NETLINK)
+ case AF_NETLINK:
+ {
+ int pid, groups;
+ struct sockaddr_nl* addr = &addrbuf->nl;
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s(): AF_NETLINK address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args,
+ "II;AF_NETLINK address must be a pair "
+ "(pid, groups)",
+ &pid, &groups))
+ {
+ return 0;
+ }
+ addr->nl_family = AF_NETLINK;
+ addr->nl_pid = pid;
+ addr->nl_groups = groups;
+ *len_ret = sizeof(*addr);
+ return 1;
+ }
+#endif /* AF_NETLINK */
+
+#if defined(AF_QIPCRTR)
+ case AF_QIPCRTR:
+ {
+ unsigned int node, port;
+ struct sockaddr_qrtr* addr = &addrbuf->sq;
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "getsockaddrarg: "
+ "AF_QIPCRTR address must be tuple, not %.500s",
+ Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args, "II:getsockaddrarg", &node, &port))
+ return 0;
+ addr->sq_family = AF_QIPCRTR;
+ addr->sq_node = node;
+ addr->sq_port = port;
+ *len_ret = sizeof(*addr);
+ return 1;
+ }
+#endif /* AF_QIPCRTR */
+
+#if defined(AF_VSOCK)
+ case AF_VSOCK:
+ {
+ struct sockaddr_vm* addr = &addrbuf->vm;
+ int port, cid;
+ memset(addr, 0, sizeof(struct sockaddr_vm));
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "getsockaddrarg: "
+ "AF_VSOCK address must be tuple, not %.500s",
+ Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args, "II:getsockaddrarg", &cid, &port))
+ return 0;
+ addr->svm_family = s->sock_family;
+ addr->svm_port = port;
+ addr->svm_cid = cid;
+ *len_ret = sizeof(*addr);
+ return 1;
+ }
+#endif /* AF_VSOCK */
+
+
+#ifdef AF_RDS
+ case AF_RDS:
+ /* RDS sockets use sockaddr_in: fall-through */
+#endif /* AF_RDS */
+
+#ifdef AF_DIVERT
+ case AF_DIVERT:
+ /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
+#endif /* AF_DIVERT */
+
+ case AF_INET:
+ {
+ struct maybe_idna host = {NULL, NULL};
+ int port, result;
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s(): AF_INET address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args,
+ "O&i;AF_INET address must be a pair "
+ "(host, port)",
+ idna_converter, &host, &port))
+ {
+ assert(PyErr_Occurred());
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Format(PyExc_OverflowError,
+ "%s(): port must be 0-65535.", caller);
+ }
+ return 0;
+ }
+ struct sockaddr_in* addr = &addrbuf->in;
+ result = setipaddr(s->state, host.buf, (struct sockaddr *)addr,
+ sizeof(*addr), AF_INET);
+ idna_cleanup(&host);
+ if (result < 0)
+ return 0;
+ if (port < 0 || port > 0xffff) {
+ PyErr_Format(
+ PyExc_OverflowError,
+ "%s(): port must be 0-65535.", caller);
+ return 0;
+ }
+ addr->sin_family = AF_INET;
+ addr->sin_port = htons((short)port);
+ *len_ret = sizeof *addr;
+ return 1;
+ }
+
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ {
+ struct maybe_idna host = {NULL, NULL};
+ int port, result;
+ unsigned int flowinfo, scope_id;
+ flowinfo = scope_id = 0;
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s(): AF_INET6 address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args,
+ "O&i|II;AF_INET6 address must be a tuple "
+ "(host, port[, flowinfo[, scopeid]])",
+ idna_converter, &host, &port, &flowinfo,
+ &scope_id))
+ {
+ assert(PyErr_Occurred());
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Format(PyExc_OverflowError,
+ "%s(): port must be 0-65535.", caller);
+ }
+ return 0;
+ }
+ struct sockaddr_in6* addr = &addrbuf->in6;
+ result = setipaddr(s->state, host.buf, (struct sockaddr *)addr,
+ sizeof(*addr), AF_INET6);
+ idna_cleanup(&host);
+ if (result < 0)
+ return 0;
+ if (port < 0 || port > 0xffff) {
+ PyErr_Format(
+ PyExc_OverflowError,
+ "%s(): port must be 0-65535.", caller);
+ return 0;
+ }
+ if (flowinfo > 0xfffff) {
+ PyErr_Format(
+ PyExc_OverflowError,
+ "%s(): flowinfo must be 0-1048575.", caller);
+ return 0;
+ }
+ addr->sin6_family = s->sock_family;
+ addr->sin6_port = htons((short)port);
+ addr->sin6_flowinfo = htonl(flowinfo);
+ addr->sin6_scope_id = scope_id;
+ *len_ret = sizeof *addr;
+ return 1;
+ }
+#endif /* ENABLE_IPV6 */
+
+#ifdef USE_BLUETOOTH
+ case AF_BLUETOOTH:
+ {
+ switch (s->sock_proto) {
+#ifdef BTPROTO_L2CAP
+ case BTPROTO_L2CAP:
+ {
+ const char *straddr;
+
+ struct sockaddr_l2 *addr = &addrbuf->bt_l2;
+ memset(addr, 0, sizeof(struct sockaddr_l2));
+ _BT_L2_MEMB(addr, family) = AF_BLUETOOTH;
+ if (!PyArg_ParseTuple(args, "si", &straddr,
+ &_BT_L2_MEMB(addr, psm))) {
+ PyErr_Format(PyExc_OSError,
+ "%s(): wrong format", caller);
+ return 0;
+ }
+ if (setbdaddr(straddr, &_BT_L2_MEMB(addr, bdaddr)) < 0)
+ return 0;
+
+ *len_ret = sizeof *addr;
+ return 1;
+ }
+#endif /* BTPROTO_L2CAP */
+ case BTPROTO_RFCOMM:
+ {
+ const char *straddr;
+ struct sockaddr_rc *addr = &addrbuf->bt_rc;
+ _BT_RC_MEMB(addr, family) = AF_BLUETOOTH;
+ if (!PyArg_ParseTuple(args, "si", &straddr,
+ &_BT_RC_MEMB(addr, channel))) {
+ PyErr_Format(PyExc_OSError,
+ "%s(): wrong format", caller);
+ return 0;
+ }
+ if (setbdaddr(straddr, &_BT_RC_MEMB(addr, bdaddr)) < 0)
+ return 0;
+
+ *len_ret = sizeof *addr;
+ return 1;
+ }
+#ifdef BTPROTO_HCI
+ case BTPROTO_HCI:
+ {
+ struct sockaddr_hci *addr = &addrbuf->bt_hci;
+#if defined(__NetBSD__) || defined(__DragonFly__)
+ const char *straddr;
+ _BT_HCI_MEMB(addr, family) = AF_BLUETOOTH;
+ if (!PyBytes_Check(args)) {
+ PyErr_Format(PyExc_OSError, "%s: "
+ "wrong format", caller);
+ return 0;
+ }
+ straddr = PyBytes_AS_STRING(args);
+ if (setbdaddr(straddr, &_BT_HCI_MEMB(addr, bdaddr)) < 0)
+ return 0;
+#else /* __NetBSD__ || __DragonFly__ */
+ _BT_HCI_MEMB(addr, family) = AF_BLUETOOTH;
+ if (!PyArg_ParseTuple(args, "i", &_BT_HCI_MEMB(addr, dev))) {
+ PyErr_Format(PyExc_OSError,
+ "%s(): wrong format", caller);
+ return 0;
+ }
+#endif /* !(__NetBSD__ || __DragonFly__) */
+ *len_ret = sizeof *addr;
+ return 1;
+ }
+#if !defined(__FreeBSD__)
+ case BTPROTO_SCO:
+ {
+ const char *straddr;
+
+ struct sockaddr_sco *addr = &addrbuf->bt_sco;
+ _BT_SCO_MEMB(addr, family) = AF_BLUETOOTH;
+ if (!PyBytes_Check(args)) {
+ PyErr_Format(PyExc_OSError,
+ "%s(): wrong format", caller);
+ return 0;
+ }
+ straddr = PyBytes_AS_STRING(args);
+ if (setbdaddr(straddr, &_BT_SCO_MEMB(addr, bdaddr)) < 0)
+ return 0;
+
+ *len_ret = sizeof *addr;
+ return 1;
+ }
+#endif /* !__FreeBSD__ */
+#endif /* BTPROTO_HCI */
+ default:
+ PyErr_Format(PyExc_OSError,
+ "%s(): unknown Bluetooth protocol", caller);
+ return 0;
+ }
+ }
+#endif /* USE_BLUETOOTH */
+
+#if defined(HAVE_NETPACKET_PACKET_H) && defined(SIOCGIFINDEX)
+ case AF_PACKET:
+ {
+ struct ifreq ifr;
+ const char *interfaceName;
+ int protoNumber;
+ int hatype = 0;
+ int pkttype = PACKET_HOST;
+ Py_buffer haddr = {NULL, NULL};
+
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s(): AF_PACKET address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ /* XXX: improve the default error message according to the
+ documentation of AF_PACKET, which would be added as part
+ of bpo-25041. */
+ if (!PyArg_ParseTuple(args,
+ "si|iiy*;AF_PACKET address must be a tuple of "
+ "two to five elements",
+ &interfaceName, &protoNumber, &pkttype, &hatype,
+ &haddr))
+ {
+ assert(PyErr_Occurred());
+ if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
+ PyErr_Format(PyExc_OverflowError,
+ "%s(): address argument out of range", caller);
+ }
+ return 0;
+ }
+ strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name));
+ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
+ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
+ s->errorhandler();
+ PyBuffer_Release(&haddr);
+ return 0;
+ }
+ if (haddr.buf && haddr.len > 8) {
+ PyErr_SetString(PyExc_ValueError,
+ "Hardware address must be 8 bytes or less");
+ PyBuffer_Release(&haddr);
+ return 0;
+ }
+ if (protoNumber < 0 || protoNumber > 0xffff) {
+ PyErr_Format(
+ PyExc_OverflowError,
+ "%s(): proto must be 0-65535.", caller);
+ PyBuffer_Release(&haddr);
+ return 0;
+ }
+ struct sockaddr_ll* addr = &addrbuf->ll;
+ addr->sll_family = AF_PACKET;
+ addr->sll_protocol = htons((short)protoNumber);
+ addr->sll_ifindex = ifr.ifr_ifindex;
+ addr->sll_pkttype = pkttype;
+ addr->sll_hatype = hatype;
+ if (haddr.buf) {
+ memcpy(&addr->sll_addr, haddr.buf, haddr.len);
+ addr->sll_halen = haddr.len;
+ }
+ else
+ addr->sll_halen = 0;
+ *len_ret = sizeof *addr;
+ PyBuffer_Release(&haddr);
+ return 1;
+ }
+#endif /* HAVE_NETPACKET_PACKET_H && SIOCGIFINDEX */
+
+#ifdef HAVE_LINUX_TIPC_H
+ case AF_TIPC:
+ {
+ unsigned int atype, v1, v2, v3;
+ unsigned int scope = TIPC_CLUSTER_SCOPE;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "%s(): AF_TIPC address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+
+ if (!PyArg_ParseTuple(args,
+ "IIII|I;AF_TIPC address must be a tuple "
+ "(addr_type, v1, v2, v3[, scope])",
+ &atype, &v1, &v2, &v3, &scope))
+ {
+ return 0;
+ }
+
+ struct sockaddr_tipc *addr = &addrbuf->tipc;
+ memset(addr, 0, sizeof(struct sockaddr_tipc));
+
+ addr->family = AF_TIPC;
+ addr->scope = scope;
+ addr->addrtype = atype;
+
+ if (atype == TIPC_ADDR_NAMESEQ) {
+ addr->addr.nameseq.type = v1;
+ addr->addr.nameseq.lower = v2;
+ addr->addr.nameseq.upper = v3;
+ } else if (atype == TIPC_ADDR_NAME) {
+ addr->addr.name.name.type = v1;
+ addr->addr.name.name.instance = v2;
+ } else if (atype == TIPC_ADDR_ID) {
+ addr->addr.id.node = v1;
+ addr->addr.id.ref = v2;
+ } else {
+ /* Shouldn't happen */
+ PyErr_SetString(PyExc_TypeError, "Invalid address type");
+ return 0;
+ }
+
+ *len_ret = sizeof(*addr);
+
+ return 1;
+ }
+#endif /* HAVE_LINUX_TIPC_H */
+
+#if defined(AF_CAN) && defined(SIOCGIFINDEX)
+ case AF_CAN:
+ switch (s->sock_proto) {
+#ifdef CAN_RAW
+ case CAN_RAW:
+ /* fall-through */
+#endif
+#ifdef CAN_BCM
+ case CAN_BCM:
+#endif
+#if defined(CAN_RAW) || defined(CAN_BCM)
+ {
+ PyObject *interfaceName;
+ struct ifreq ifr;
+ Py_ssize_t len;
+ struct sockaddr_can *addr = &addrbuf->can;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(PyExc_TypeError,
+ "%s(): AF_CAN address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args,
+ "O&;AF_CAN address must be a tuple "
+ "(interface, )",
+ PyUnicode_FSConverter, &interfaceName))
+ {
+ return 0;
+ }
+
+ len = PyBytes_GET_SIZE(interfaceName);
+
+ if (len == 0) {
+ ifr.ifr_ifindex = 0;
+ } else if ((size_t)len < sizeof(ifr.ifr_name)) {
+ strncpy(ifr.ifr_name, PyBytes_AS_STRING(interfaceName), sizeof(ifr.ifr_name));
+ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
+ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
+ s->errorhandler();
+ Py_DECREF(interfaceName);
+ return 0;
+ }
+ } else {
+ PyErr_SetString(PyExc_OSError,
+ "AF_CAN interface name too long");
+ Py_DECREF(interfaceName);
+ return 0;
+ }
+
+ addr->can_family = AF_CAN;
+ addr->can_ifindex = ifr.ifr_ifindex;
+
+ *len_ret = sizeof(*addr);
+ Py_DECREF(interfaceName);
+ return 1;
+ }
+#endif /* CAN_RAW || CAN_BCM */
+
+#ifdef CAN_ISOTP
+ case CAN_ISOTP:
+ {
+ PyObject *interfaceName;
+ struct ifreq ifr;
+ Py_ssize_t len;
+ unsigned long int rx_id, tx_id;
+
+ struct sockaddr_can *addr = &addrbuf->can;
+
+ if (!PyArg_ParseTuple(args, "O&kk", PyUnicode_FSConverter,
+ &interfaceName,
+ &rx_id,
+ &tx_id))
+ return 0;
+
+ len = PyBytes_GET_SIZE(interfaceName);
+
+ if (len == 0) {
+ ifr.ifr_ifindex = 0;
+ } else if ((size_t)len < sizeof(ifr.ifr_name)) {
+ strncpy(ifr.ifr_name, PyBytes_AS_STRING(interfaceName), sizeof(ifr.ifr_name));
+ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
+ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
+ s->errorhandler();
+ Py_DECREF(interfaceName);
+ return 0;
+ }
+ } else {
+ PyErr_SetString(PyExc_OSError,
+ "AF_CAN interface name too long");
+ Py_DECREF(interfaceName);
+ return 0;
+ }
+
+ addr->can_family = AF_CAN;
+ addr->can_ifindex = ifr.ifr_ifindex;
+ addr->can_addr.tp.rx_id = rx_id;
+ addr->can_addr.tp.tx_id = tx_id;
+
+ *len_ret = sizeof(*addr);
+ Py_DECREF(interfaceName);
+ return 1;
+ }
+#endif /* CAN_ISOTP */
+#ifdef CAN_J1939
+ case CAN_J1939:
+ {
+ PyObject *interfaceName;
+ struct ifreq ifr;
+ Py_ssize_t len;
+ unsigned long long j1939_name; /* at least 64 bits */
+ unsigned int j1939_pgn; /* at least 32 bits */
+ uint8_t j1939_addr;
+
+ struct sockaddr_can *addr = &addrbuf->can;
+
+ if (!PyArg_ParseTuple(args, "O&KIB", PyUnicode_FSConverter,
+ &interfaceName,
+ &j1939_name,
+ &j1939_pgn,
+ &j1939_addr))
+ return 0;
+
+ len = PyBytes_GET_SIZE(interfaceName);
+
+ if (len == 0) {
+ ifr.ifr_ifindex = 0;
+ } else if ((size_t)len < sizeof(ifr.ifr_name)) {
+ strncpy(ifr.ifr_name, PyBytes_AS_STRING(interfaceName), sizeof(ifr.ifr_name));
+ ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
+ if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
+ s->errorhandler();
+ Py_DECREF(interfaceName);
+ return 0;
+ }
+ } else {
+ PyErr_SetString(PyExc_OSError,
+ "AF_CAN interface name too long");
+ Py_DECREF(interfaceName);
+ return 0;
+ }
+
+ addr->can_family = AF_CAN;
+ addr->can_ifindex = ifr.ifr_ifindex;
+ addr->can_addr.j1939.name = (uint64_t)j1939_name;
+ addr->can_addr.j1939.pgn = (uint32_t)j1939_pgn;
+ addr->can_addr.j1939.addr = j1939_addr;
+
+ *len_ret = sizeof(*addr);
+ Py_DECREF(interfaceName);
+ return 1;
+ }
+#endif /* CAN_J1939 */
+ default:
+ PyErr_Format(PyExc_OSError,
+ "%s(): unsupported CAN protocol", caller);
+ return 0;
+ }
+#endif /* AF_CAN && SIOCGIFINDEX */
+
+#ifdef PF_SYSTEM
+ case PF_SYSTEM:
+ switch (s->sock_proto) {
+#ifdef SYSPROTO_CONTROL
+ case SYSPROTO_CONTROL:
+ {
+ struct sockaddr_ctl *addr = &addrbuf->ctl;
+ addr->sc_family = AF_SYSTEM;
+ addr->ss_sysaddr = AF_SYS_CONTROL;
+
+ if (PyUnicode_Check(args)) {
+ struct ctl_info info;
+ PyObject *ctl_name;
+
+ if (!PyArg_Parse(args, "O&",
+ PyUnicode_FSConverter, &ctl_name)) {
+ return 0;
+ }
+
+ if (PyBytes_GET_SIZE(ctl_name) > (Py_ssize_t)sizeof(info.ctl_name)) {
+ PyErr_SetString(PyExc_ValueError,
+ "provided string is too long");
+ Py_DECREF(ctl_name);
+ return 0;
+ }
+ strncpy(info.ctl_name, PyBytes_AS_STRING(ctl_name),
+ sizeof(info.ctl_name));
+ Py_DECREF(ctl_name);
+
+ if (ioctl(s->sock_fd, CTLIOCGINFO, &info)) {
+ PyErr_SetString(PyExc_OSError,
+ "cannot find kernel control with provided name");
+ return 0;
+ }
+
+ addr->sc_id = info.ctl_id;
+ addr->sc_unit = 0;
+ } else if (!PyArg_ParseTuple(args, "II",
+ &(addr->sc_id), &(addr->sc_unit))) {
+ PyErr_Format(PyExc_TypeError,
+ "%s(): PF_SYSTEM address must be a str or "
+ "a pair (id, unit)", caller);
+ return 0;
+ }
+
+ *len_ret = sizeof(*addr);
+ return 1;
+ }
+#endif /* SYSPROTO_CONTROL */
+ default:
+ PyErr_Format(PyExc_OSError,
+ "%s(): unsupported PF_SYSTEM protocol", caller);
+ return 0;
+ }
+#endif /* PF_SYSTEM */
+#ifdef HAVE_SOCKADDR_ALG
+ case AF_ALG:
+ {
+ const char *type;
+ const char *name;
+ struct sockaddr_alg *sa = &addrbuf->alg;
+
+ memset(sa, 0, sizeof(*sa));
+ sa->salg_family = AF_ALG;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(PyExc_TypeError,
+ "%s(): AF_ALG address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args,
+ "ss|HH;AF_ALG address must be a tuple "
+ "(type, name[, feat[, mask]])",
+ &type, &name, &sa->salg_feat, &sa->salg_mask))
+ {
+ return 0;
+ }
+ /* sockaddr_alg has fixed-sized char arrays for type, and name
+ * both must be NULL terminated.
+ */
+ if (strlen(type) >= sizeof(sa->salg_type)) {
+ PyErr_SetString(PyExc_ValueError, "AF_ALG type too long.");
+ return 0;
+ }
+ strncpy((char *)sa->salg_type, type, sizeof(sa->salg_type));
+ if (strlen(name) >= sizeof(sa->salg_name)) {
+ PyErr_SetString(PyExc_ValueError, "AF_ALG name too long.");
+ return 0;
+ }
+ strncpy((char *)sa->salg_name, name, sizeof(sa->salg_name));
+
+ *len_ret = sizeof(*sa);
+ return 1;
+ }
+#endif /* HAVE_SOCKADDR_ALG */
+#ifdef HAVE_AF_HYPERV
+ case AF_HYPERV:
+ {
+ switch (s->sock_proto) {
+ case HV_PROTOCOL_RAW:
+ {
+ PyObject *vm_id_obj = NULL;
+ PyObject *service_id_obj = NULL;
+
+ SOCKADDR_HV *addr = &addrbuf->hv;
+
+ memset(addr, 0, sizeof(*addr));
+ addr->Family = AF_HYPERV;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_Format(PyExc_TypeError,
+ "%s(): AF_HYPERV address must be tuple, not %.500s",
+ caller, Py_TYPE(args)->tp_name);
+ return 0;
+ }
+ if (!PyArg_ParseTuple(args,
+ "UU;AF_HYPERV address must be a str tuple (vm_id, service_id)",
+ &vm_id_obj, &service_id_obj))
+ {
+ return 0;
+ }
+
+ wchar_t *guid_str = PyUnicode_AsWideCharString(vm_id_obj, NULL);
+ if (guid_str == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "%s(): AF_HYPERV address vm_id is not a valid UUID string",
+ caller);
+ return 0;
+ }
+ RPC_STATUS rc = UuidFromStringW(guid_str, &addr->VmId);
+ PyMem_Free(guid_str);
+ if (rc != RPC_S_OK) {
+ PyErr_Format(PyExc_ValueError,
+ "%s(): AF_HYPERV address vm_id is not a valid UUID string",
+ caller);
+ return 0;
+ }
+
+ guid_str = PyUnicode_AsWideCharString(service_id_obj, NULL);
+ if (guid_str == NULL) {
+ PyErr_Format(PyExc_ValueError,
+ "%s(): AF_HYPERV address service_id is not a valid UUID string",
+ caller);
+ return 0;
+ }
+ rc = UuidFromStringW(guid_str, &addr->ServiceId);
+ PyMem_Free(guid_str);
+ if (rc != RPC_S_OK) {
+ PyErr_Format(PyExc_ValueError,
+ "%s(): AF_HYPERV address service_id is not a valid UUID string",
+ caller);
+ return 0;
+ }
+
+ *len_ret = sizeof(*addr);
+ return 1;
+ }
+ default:
+ PyErr_Format(PyExc_OSError,
+ "%s(): unsupported AF_HYPERV protocol: %d",
+ caller, s->sock_proto);
+ return 0;
+ }
+ }
+#endif /* HAVE_AF_HYPERV */
+
+ /* More cases here... */
+
+ default:
+ PyErr_Format(PyExc_OSError, "%s(): bad family", caller);
+ return 0;
+
+ }
+}
+#endif // defined(HAVE_BIND) || defined(HAVE_CONNECTTO) || defined(CMSG_LEN)
+
+
+/* Get the address length according to the socket object's address family.
+ Return 1 if the family is known, 0 otherwise. The length is returned
+ through len_ret. */
+
+static int
+getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
+{
+ switch (s->sock_family) {
+
+#if defined(AF_UNIX)
+ case AF_UNIX:
+ {
+ *len_ret = sizeof (struct sockaddr_un);
+ return 1;
+ }
+#endif /* AF_UNIX */
+
+#if defined(AF_NETLINK)
+ case AF_NETLINK:
+ {
+ *len_ret = sizeof (struct sockaddr_nl);
+ return 1;
+ }
+#endif /* AF_NETLINK */
+
+#if defined(AF_QIPCRTR)
+ case AF_QIPCRTR:
+ {
+ *len_ret = sizeof (struct sockaddr_qrtr);
+ return 1;
+ }
+#endif /* AF_QIPCRTR */
+
+#if defined(AF_VSOCK)
+ case AF_VSOCK:
+ {
+ *len_ret = sizeof (struct sockaddr_vm);
+ return 1;
+ }
+#endif /* AF_VSOCK */
+
+#ifdef AF_RDS
+ case AF_RDS:
+ /* RDS sockets use sockaddr_in: fall-through */
+#endif /* AF_RDS */
+
+ case AF_INET:
+ {
+ *len_ret = sizeof (struct sockaddr_in);
+ return 1;
+ }
+
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ {
+ *len_ret = sizeof (struct sockaddr_in6);
+ return 1;
+ }
+#endif /* ENABLE_IPV6 */
+
+#ifdef USE_BLUETOOTH
+ case AF_BLUETOOTH:
+ {
+ switch(s->sock_proto)
+ {
+
+#ifdef BTPROTO_L2CAP
+ case BTPROTO_L2CAP:
+ *len_ret = sizeof (struct sockaddr_l2);
+ return 1;
+#endif /* BTPROTO_L2CAP */
+ case BTPROTO_RFCOMM:
+ *len_ret = sizeof (struct sockaddr_rc);
+ return 1;
+#ifdef BTPROTO_HCI
+ case BTPROTO_HCI:
+ *len_ret = sizeof (struct sockaddr_hci);
+ return 1;
+#if !defined(__FreeBSD__)
+ case BTPROTO_SCO:
+ *len_ret = sizeof (struct sockaddr_sco);
+ return 1;
+#endif /* !__FreeBSD__ */
+#endif /* BTPROTO_HCI */
+ default:
+ PyErr_SetString(PyExc_OSError, "getsockaddrlen: "
+ "unknown BT protocol");
+ return 0;
+
+ }
+ }
+#endif /* USE_BLUETOOTH */
+
+#ifdef HAVE_NETPACKET_PACKET_H
+ case AF_PACKET:
+ {
+ *len_ret = sizeof (struct sockaddr_ll);
+ return 1;
+ }
+#endif /* HAVE_NETPACKET_PACKET_H */
+
+#ifdef HAVE_LINUX_TIPC_H
+ case AF_TIPC:
+ {
+ *len_ret = sizeof (struct sockaddr_tipc);
+ return 1;
+ }
+#endif /* HAVE_LINUX_TIPC_H */
+
+#ifdef AF_CAN
+ case AF_CAN:
+ {
+ *len_ret = sizeof (struct sockaddr_can);
+ return 1;
+ }
+#endif /* AF_CAN */
+
+#ifdef PF_SYSTEM
+ case PF_SYSTEM:
+ switch(s->sock_proto) {
+#ifdef SYSPROTO_CONTROL
+ case SYSPROTO_CONTROL:
+ *len_ret = sizeof (struct sockaddr_ctl);
+ return 1;
+#endif /* SYSPROTO_CONTROL */
+ default:
+ PyErr_SetString(PyExc_OSError, "getsockaddrlen: "
+ "unknown PF_SYSTEM protocol");
+ return 0;
+ }
+#endif /* PF_SYSTEM */
+#ifdef HAVE_SOCKADDR_ALG
+ case AF_ALG:
+ {
+ *len_ret = sizeof (struct sockaddr_alg);
+ return 1;
+ }
+#endif /* HAVE_SOCKADDR_ALG */
+#ifdef HAVE_AF_HYPERV
+ case AF_HYPERV:
+ {
+ *len_ret = sizeof (SOCKADDR_HV);
+ return 1;
+ }
+#endif /* HAVE_AF_HYPERV */
+
+ /* More cases here... */
+
+ default:
+ PyErr_SetString(PyExc_OSError, "getsockaddrlen: bad family");
+ return 0;
+
+ }
+}
+
+
+/* Support functions for the sendmsg() and recvmsg[_into]() methods.
+ Currently, these methods are only compiled if the RFC 2292/3542
+ CMSG_LEN() macro is available. Older systems seem to have used
+ sizeof(struct cmsghdr) + (length) where CMSG_LEN() is used now, so
+ it may be possible to define CMSG_LEN() that way if it's not
+ provided. Some architectures might need extra padding after the
+ cmsghdr, however, and CMSG_LEN() would have to take account of
+ this. */
+#ifdef CMSG_LEN
+/* If length is in range, set *result to CMSG_LEN(length) and return
+ true; otherwise, return false. */
+static int
+get_CMSG_LEN(size_t length, size_t *result)
+{
+ size_t tmp;
+
+ if (length > (SOCKLEN_T_LIMIT - CMSG_LEN(0)))
+ return 0;
+ tmp = CMSG_LEN(length);
+ if (tmp > SOCKLEN_T_LIMIT || tmp < length)
+ return 0;
+ *result = tmp;
+ return 1;
+}
+
+#ifdef CMSG_SPACE
+/* If length is in range, set *result to CMSG_SPACE(length) and return
+ true; otherwise, return false. */
+static int
+get_CMSG_SPACE(size_t length, size_t *result)
+{
+ size_t tmp;
+
+ /* Use CMSG_SPACE(1) here in order to take account of the padding
+ necessary before *and* after the data. */
+ if (length > (SOCKLEN_T_LIMIT - CMSG_SPACE(1)))
+ return 0;
+ tmp = CMSG_SPACE(length);
+ if (tmp > SOCKLEN_T_LIMIT || tmp < length)
+ return 0;
+ *result = tmp;
+ return 1;
+}
+#endif
+
+/* Return true iff msg->msg_controllen is valid, cmsgh is a valid
+ pointer in msg->msg_control with at least "space" bytes after it,
+ and its cmsg_len member inside the buffer. */
+static int
+cmsg_min_space(struct msghdr *msg, struct cmsghdr *cmsgh, size_t space)
+{
+ size_t cmsg_offset;
+ static const size_t cmsg_len_end = (offsetof(struct cmsghdr, cmsg_len) +
+ sizeof(cmsgh->cmsg_len));
+
+ /* Note that POSIX allows msg_controllen to be of signed type. */
+ if (cmsgh == NULL || msg->msg_control == NULL)
+ return 0;
+ /* Note that POSIX allows msg_controllen to be of a signed type. This is
+ annoying under OS X as it's unsigned there and so it triggers a
+ tautological comparison warning under Clang when compared against 0.
+ Since the check is valid on other platforms, silence the warning under
+ Clang. */
+ #ifdef __clang__
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wtautological-compare"
+ #endif
+ #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wtype-limits"
+ #endif
+ if (msg->msg_controllen < 0)
+ return 0;
+ #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
+ #pragma GCC diagnostic pop
+ #endif
+ #ifdef __clang__
+ #pragma clang diagnostic pop
+ #endif
+ if (space < cmsg_len_end)
+ space = cmsg_len_end;
+ cmsg_offset = (char *)cmsgh - (char *)msg->msg_control;
+ return (cmsg_offset <= (size_t)-1 - space &&
+ cmsg_offset + space <= msg->msg_controllen);
+}
+
+/* If pointer CMSG_DATA(cmsgh) is in buffer msg->msg_control, set
+ *space to number of bytes following it in the buffer and return
+ true; otherwise, return false. Assumes cmsgh, msg->msg_control and
+ msg->msg_controllen are valid. */
+static int
+get_cmsg_data_space(struct msghdr *msg, struct cmsghdr *cmsgh, size_t *space)
+{
+ size_t data_offset;
+ char *data_ptr;
+
+ if ((data_ptr = (char *)CMSG_DATA(cmsgh)) == NULL)
+ return 0;
+ data_offset = data_ptr - (char *)msg->msg_control;
+ if (data_offset > msg->msg_controllen)
+ return 0;
+ *space = msg->msg_controllen - data_offset;
+ return 1;
+}
+
+/* If cmsgh is invalid or not contained in the buffer pointed to by
+ msg->msg_control, return -1. If cmsgh is valid and its associated
+ data is entirely contained in the buffer, set *data_len to the
+ length of the associated data and return 0. If only part of the
+ associated data is contained in the buffer but cmsgh is otherwise
+ valid, set *data_len to the length contained in the buffer and
+ return 1. */
+static int
+get_cmsg_data_len(struct msghdr *msg, struct cmsghdr *cmsgh, size_t *data_len)
+{
+ size_t space, cmsg_data_len;
+
+ if (!cmsg_min_space(msg, cmsgh, CMSG_LEN(0)) ||
+ cmsgh->cmsg_len < CMSG_LEN(0))
+ return -1;
+ cmsg_data_len = cmsgh->cmsg_len - CMSG_LEN(0);
+ if (!get_cmsg_data_space(msg, cmsgh, &space))
+ return -1;
+ if (space >= cmsg_data_len) {
+ *data_len = cmsg_data_len;
+ return 0;
+ }
+ *data_len = space;
+ return 1;
+}
+#endif /* CMSG_LEN */
+
+
+struct sock_accept {
+ socklen_t *addrlen;
+ sock_addr_t *addrbuf;
+ SOCKET_T result;
+};
+
+#if defined(HAVE_ACCEPT) || defined(HAVE_ACCEPT4)
+
+static int
+sock_accept_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_accept *ctx = data;
+ struct sockaddr *addr = SAS2SA(ctx->addrbuf);
+ socklen_t *paddrlen = ctx->addrlen;
+#ifdef HAVE_SOCKADDR_ALG
+ /* AF_ALG does not support accept() with addr and raises
+ * ECONNABORTED instead. */
+ if (s->sock_family == AF_ALG) {
+ addr = NULL;
+ paddrlen = NULL;
+ *ctx->addrlen = 0;
+ }
+#endif
+
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+ socket_state *state = s->state;
+ if (state->accept4_works != 0) {
+ ctx->result = accept4(s->sock_fd, addr, paddrlen,
+ SOCK_CLOEXEC);
+ if (ctx->result == INVALID_SOCKET && state->accept4_works == -1) {
+ /* On Linux older than 2.6.28, accept4() fails with ENOSYS */
+ state->accept4_works = (errno != ENOSYS);
+ }
+ }
+ if (state->accept4_works == 0)
+ ctx->result = accept(s->sock_fd, addr, paddrlen);
+#else
+ ctx->result = accept(s->sock_fd, addr, paddrlen);
+#endif
+
+#ifdef MS_WINDOWS
+ return (ctx->result != INVALID_SOCKET);
+#else
+ return (ctx->result >= 0);
+#endif
+}
+
+/* s._accept() -> (fd, address) */
+
+static PyObject *
+sock_accept(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ sock_addr_t addrbuf;
+ SOCKET_T newfd;
+ socklen_t addrlen;
+ PyObject *sock = NULL;
+ PyObject *addr = NULL;
+ PyObject *res = NULL;
+ struct sock_accept ctx;
+
+ if (!getsockaddrlen(s, &addrlen))
+ return NULL;
+ memset(&addrbuf, 0, addrlen);
+
+ if (!IS_SELECTABLE(s))
+ return select_error();
+
+ ctx.addrlen = &addrlen;
+ ctx.addrbuf = &addrbuf;
+ if (sock_call(s, 0, sock_accept_impl, &ctx) < 0)
+ return NULL;
+ newfd = ctx.result;
+
+#ifdef MS_WINDOWS
+#if defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
+#ifndef HANDLE_FLAG_INHERIT
+#define HANDLE_FLAG_INHERIT 0x00000001
+#endif
+ if (!SetHandleInformation((HANDLE)newfd, HANDLE_FLAG_INHERIT, 0)) {
+ PyErr_SetFromWindowsErr(0);
+ SOCKETCLOSE(newfd);
+ goto finally;
+ }
+#endif
+#else
+
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+ socket_state *state = s->state;
+ if (!state->accept4_works)
+#endif
+ {
+ if (_Py_set_inheritable(newfd, 0, NULL) < 0) {
+ SOCKETCLOSE(newfd);
+ goto finally;
+ }
+ }
+#endif
+
+ sock = PyLong_FromSocket_t(newfd);
+ if (sock == NULL) {
+ SOCKETCLOSE(newfd);
+ goto finally;
+ }
+
+ addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
+ addrlen, s->sock_proto);
+ if (addr == NULL)
+ goto finally;
+
+ res = PyTuple_Pack(2, sock, addr);
+
+finally:
+ Py_XDECREF(sock);
+ Py_XDECREF(addr);
+ return res;
+}
+
+PyDoc_STRVAR(accept_doc,
+"_accept() -> (integer, address info)\n\
+\n\
+Wait for an incoming connection. Return a new socket file descriptor\n\
+representing the connection, and the address of the client.\n\
+For IP sockets, the address info is a pair (hostaddr, port).");
+#endif // defined(HAVE_ACCEPT) || defined(HAVE_ACCEPT4)
+
+
+/* s.setblocking(flag) method. Argument:
+ False -- non-blocking mode; same as settimeout(0)
+ True -- blocking mode; same as settimeout(None)
+*/
+
+static PyObject *
+sock_setblocking(PySocketSockObject *s, PyObject *arg)
+{
+ long block;
+
+ block = PyObject_IsTrue(arg);
+ if (block < 0)
+ return NULL;
+
+ s->sock_timeout = _PyTime_FromSeconds(block ? -1 : 0);
+ if (internal_setblocking(s, block) == -1) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(setblocking_doc,
+"setblocking(flag)\n\
+\n\
+Set the socket to blocking (flag is true) or non-blocking (false).\n\
+setblocking(True) is equivalent to settimeout(None);\n\
+setblocking(False) is equivalent to settimeout(0.0).");
+
+/* s.getblocking() method.
+ Returns True if socket is in blocking mode,
+ False if it is in non-blocking mode.
+*/
+static PyObject *
+sock_getblocking(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ if (s->sock_timeout) {
+ Py_RETURN_TRUE;
+ }
+ else {
+ Py_RETURN_FALSE;
+ }
+}
+
+PyDoc_STRVAR(getblocking_doc,
+"getblocking()\n\
+\n\
+Returns True if socket is in blocking mode, or False if it\n\
+is in non-blocking mode.");
+
+static int
+socket_parse_timeout(_PyTime_t *timeout, PyObject *timeout_obj)
+{
+#ifdef MS_WINDOWS
+ struct timeval tv;
+#endif
+#ifndef HAVE_POLL
+ _PyTime_t ms;
+#endif
+ int overflow = 0;
+
+ if (timeout_obj == Py_None) {
+ *timeout = _PyTime_FromSeconds(-1);
+ return 0;
+ }
+
+ if (_PyTime_FromSecondsObject(timeout,
+ timeout_obj, _PyTime_ROUND_TIMEOUT) < 0)
+ return -1;
+
+ if (*timeout < 0) {
+ PyErr_SetString(PyExc_ValueError, "Timeout value out of range");
+ return -1;
+ }
+
+#ifdef MS_WINDOWS
+ overflow |= (_PyTime_AsTimeval(*timeout, &tv, _PyTime_ROUND_TIMEOUT) < 0);
+#endif
+#ifndef HAVE_POLL
+ ms = _PyTime_AsMilliseconds(*timeout, _PyTime_ROUND_TIMEOUT);
+ overflow |= (ms > INT_MAX);
+#endif
+ if (overflow) {
+ PyErr_SetString(PyExc_OverflowError,
+ "timeout doesn't fit into C timeval");
+ return -1;
+ }
+
+ return 0;
+}
+
+/* s.settimeout(timeout) method. Argument:
+ None -- no timeout, blocking mode; same as setblocking(True)
+ 0.0 -- non-blocking mode; same as setblocking(False)
+ > 0 -- timeout mode; operations time out after timeout seconds
+ < 0 -- illegal; raises an exception
+*/
+static PyObject *
+sock_settimeout(PySocketSockObject *s, PyObject *arg)
+{
+ _PyTime_t timeout;
+
+ if (socket_parse_timeout(&timeout, arg) < 0)
+ return NULL;
+
+ s->sock_timeout = timeout;
+
+ int block = timeout < 0;
+ /* Blocking mode for a Python socket object means that operations
+ like :meth:`recv` or :meth:`sendall` will block the execution of
+ the current thread until they are complete or aborted with a
+ `TimeoutError` or `socket.error` errors. When timeout is `None`,
+ the underlying FD is in a blocking mode. When timeout is a positive
+ number, the FD is in a non-blocking mode, and socket ops are
+ implemented with a `select()` call.
+
+ When timeout is 0.0, the FD is in a non-blocking mode.
+
+ This table summarizes all states in which the socket object and
+ its underlying FD can be:
+
+ ==================== ===================== ==============
+ `gettimeout()` `getblocking()` FD
+ ==================== ===================== ==============
+ ``None`` ``True`` blocking
+ ``0.0`` ``False`` non-blocking
+ ``> 0`` ``True`` non-blocking
+ */
+
+ if (internal_setblocking(s, block) == -1) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(settimeout_doc,
+"settimeout(timeout)\n\
+\n\
+Set a timeout on socket operations. 'timeout' can be a float,\n\
+giving in seconds, or None. Setting a timeout of None disables\n\
+the timeout feature and is equivalent to setblocking(1).\n\
+Setting a timeout of zero is the same as setblocking(0).");
+
+/* s.gettimeout() method.
+ Returns the timeout associated with a socket. */
+static PyObject *
+sock_gettimeout(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ if (s->sock_timeout < 0) {
+ Py_RETURN_NONE;
+ }
+ else {
+ double seconds = _PyTime_AsSecondsDouble(s->sock_timeout);
+ return PyFloat_FromDouble(seconds);
+ }
+}
+
+PyDoc_STRVAR(gettimeout_doc,
+"gettimeout() -> timeout\n\
+\n\
+Returns the timeout in seconds (float) associated with socket\n\
+operations. A timeout of None indicates that timeouts on socket\n\
+operations are disabled.");
+
+#ifdef HAVE_SETSOCKOPT
+/* s.setsockopt() method.
+ With an integer third argument, sets an integer optval with optlen=4.
+ With None as third argument and an integer fourth argument, set
+ optval=NULL with unsigned int as optlen.
+ With a string third argument, sets an option from a buffer;
+ use optional built-in module 'struct' to encode the string.
+*/
+
+static PyObject *
+sock_setsockopt(PySocketSockObject *s, PyObject *args)
+{
+ int level;
+ int optname;
+ int res;
+ Py_buffer optval;
+ int flag;
+ unsigned int optlen;
+ PyObject *none;
+
+#ifdef AF_VSOCK
+ if (s->sock_family == AF_VSOCK) {
+ uint64_t vflag; // Must be set width of 64 bits
+ /* setsockopt(level, opt, flag) */
+ if (PyArg_ParseTuple(args, "iiK:setsockopt",
+ &level, &optname, &vflag)) {
+ // level should always be set to AF_VSOCK
+ res = setsockopt(s->sock_fd, level, optname,
+ (void*)&vflag, sizeof vflag);
+ goto done;
+ }
+ return NULL;
+ }
+#endif
+
+ /* setsockopt(level, opt, flag) */
+ if (PyArg_ParseTuple(args, "iii:setsockopt",
+ &level, &optname, &flag)) {
+ res = setsockopt(s->sock_fd, level, optname,
+ (char*)&flag, sizeof flag);
+ goto done;
+ }
+
+ PyErr_Clear();
+ /* setsockopt(level, opt, None, flag) */
+ if (PyArg_ParseTuple(args, "iiO!I:setsockopt",
+ &level, &optname, Py_TYPE(Py_None), &none, &optlen)) {
+ assert(sizeof(socklen_t) >= sizeof(unsigned int));
+ res = setsockopt(s->sock_fd, level, optname,
+ NULL, (socklen_t)optlen);
+ goto done;
+ }
+
+ PyErr_Clear();
+ /* setsockopt(level, opt, buffer) */
+ if (!PyArg_ParseTuple(args, "iiy*:setsockopt",
+ &level, &optname, &optval))
+ return NULL;
+
+#ifdef MS_WINDOWS
+ if (optval.len > INT_MAX) {
+ PyBuffer_Release(&optval);
+ PyErr_Format(PyExc_OverflowError,
+ "socket option is larger than %i bytes",
+ INT_MAX);
+ return NULL;
+ }
+ res = setsockopt(s->sock_fd, level, optname,
+ optval.buf, (int)optval.len);
+#else
+ res = setsockopt(s->sock_fd, level, optname, optval.buf, optval.len);
+#endif
+ PyBuffer_Release(&optval);
+
+done:
+ if (res < 0) {
+ return s->errorhandler();
+ }
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(setsockopt_doc,
+"setsockopt(level, option, value: int)\n\
+setsockopt(level, option, value: buffer)\n\
+setsockopt(level, option, None, optlen: int)\n\
+\n\
+Set a socket option. See the Unix manual for level and option.\n\
+The value argument can either be an integer, a string buffer, or\n\
+None, optlen.");
+#endif
+
+/* s.getsockopt() method.
+ With two arguments, retrieves an integer option.
+ With a third integer argument, retrieves a string buffer of that size;
+ use optional built-in module 'struct' to decode the string. */
+
+static PyObject *
+sock_getsockopt(PySocketSockObject *s, PyObject *args)
+{
+ int level;
+ int optname;
+ int res;
+ PyObject *buf;
+ socklen_t buflen = 0;
+ int flag = 0;
+ socklen_t flagsize;
+
+ if (!PyArg_ParseTuple(args, "ii|i:getsockopt",
+ &level, &optname, &buflen))
+ return NULL;
+
+ if (buflen == 0) {
+#ifdef AF_VSOCK
+ if (s->sock_family == AF_VSOCK) {
+ uint64_t vflag = 0; // Must be set width of 64 bits
+ flagsize = sizeof vflag;
+ res = getsockopt(s->sock_fd, level, optname,
+ (void *)&vflag, &flagsize);
+ if (res < 0)
+ return s->errorhandler();
+ return PyLong_FromUnsignedLong(vflag);
+ }
+#endif
+ flagsize = sizeof flag;
+ res = getsockopt(s->sock_fd, level, optname,
+ (void *)&flag, &flagsize);
+ if (res < 0)
+ return s->errorhandler();
+ return PyLong_FromLong(flag);
+ }
+#ifdef AF_VSOCK
+ if (s->sock_family == AF_VSOCK) {
+ PyErr_SetString(PyExc_OSError,
+ "getsockopt string buffer not allowed");
+ return NULL;
+ }
+#endif
+ if (buflen <= 0 || buflen > 1024) {
+ PyErr_SetString(PyExc_OSError,
+ "getsockopt buflen out of range");
+ return NULL;
+ }
+ buf = PyBytes_FromStringAndSize((char *)NULL, buflen);
+ if (buf == NULL)
+ return NULL;
+ res = getsockopt(s->sock_fd, level, optname,
+ (void *)PyBytes_AS_STRING(buf), &buflen);
+ if (res < 0) {
+ Py_DECREF(buf);
+ return s->errorhandler();
+ }
+ _PyBytes_Resize(&buf, buflen);
+ return buf;
+}
+
+PyDoc_STRVAR(getsockopt_doc,
+"getsockopt(level, option[, buffersize]) -> value\n\
+\n\
+Get a socket option. See the Unix manual for level and option.\n\
+If a nonzero buffersize argument is given, the return value is a\n\
+string of that length; otherwise it is an integer.");
+
+
+#ifdef HAVE_BIND
+/* s.bind(sockaddr) method */
+
+static PyObject *
+sock_bind(PySocketSockObject *s, PyObject *addro)
+{
+ sock_addr_t addrbuf;
+ int addrlen;
+ int res;
+
+ if (!getsockaddrarg(s, addro, &addrbuf, &addrlen, "bind")) {
+ return NULL;
+ }
+
+ if (PySys_Audit("socket.bind", "OO", s, addro) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return s->errorhandler();
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(bind_doc,
+"bind(address)\n\
+\n\
+Bind the socket to a local address. For IP sockets, the address is a\n\
+pair (host, port); the host must refer to the local host. For raw packet\n\
+sockets the address is a tuple (ifname, proto [,pkttype [,hatype [,addr]]])");
+#endif
+
+
+/* s.close() method.
+ Set the file descriptor to -1 so operations tried subsequently
+ will surely fail. */
+
+static PyObject *
+sock_close(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ SOCKET_T fd;
+ int res;
+
+ fd = s->sock_fd;
+ if (fd != INVALID_SOCKET) {
+ s->sock_fd = INVALID_SOCKET;
+
+ /* We do not want to retry upon EINTR: see
+ http://lwn.net/Articles/576478/ and
+ http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-09/3000.html
+ for more details. */
+ Py_BEGIN_ALLOW_THREADS
+ res = SOCKETCLOSE(fd);
+ Py_END_ALLOW_THREADS
+ /* bpo-30319: The peer can already have closed the connection.
+ Python ignores ECONNRESET on close(). */
+ if (res < 0 && errno != ECONNRESET) {
+ return s->errorhandler();
+ }
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(sock_close_doc,
+"close()\n\
+\n\
+Close the socket. It cannot be used after this call.");
+
+static PyObject *
+sock_detach(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ SOCKET_T fd = s->sock_fd;
+ s->sock_fd = INVALID_SOCKET;
+ return PyLong_FromSocket_t(fd);
+}
+
+PyDoc_STRVAR(detach_doc,
+"detach()\n\
+\n\
+Close the socket object without closing the underlying file descriptor.\n\
+The object cannot be used after this call, but the file descriptor\n\
+can be reused for other purposes. The file descriptor is returned.");
+
+#ifdef HAVE_CONNECT
+static int
+sock_connect_impl(PySocketSockObject *s, void* Py_UNUSED(data))
+{
+ int err;
+ socklen_t size = sizeof err;
+
+ if (getsockopt(s->sock_fd, SOL_SOCKET, SO_ERROR, (void *)&err, &size)) {
+ /* getsockopt() failed */
+ return 0;
+ }
+
+ if (err == EISCONN)
+ return 1;
+ if (err != 0) {
+ /* sock_call_ex() uses GET_SOCK_ERROR() to get the error code */
+ SET_SOCK_ERROR(err);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen,
+ int raise)
+{
+ int res, err, wait_connect;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = connect(s->sock_fd, addr, addrlen);
+ Py_END_ALLOW_THREADS
+
+ if (!res) {
+ /* connect() succeeded, the socket is connected */
+ return 0;
+ }
+
+ /* connect() failed */
+
+ /* save error, PyErr_CheckSignals() can replace it */
+ err = GET_SOCK_ERROR;
+ if (CHECK_ERRNO(EINTR)) {
+ if (PyErr_CheckSignals())
+ return -1;
+
+ /* Issue #23618: when connect() fails with EINTR, the connection is
+ running asynchronously.
+
+ If the socket is blocking or has a timeout, wait until the
+ connection completes, fails or timed out using select(), and then
+ get the connection status using getsockopt(SO_ERROR).
+
+ If the socket is non-blocking, raise InterruptedError. The caller is
+ responsible to wait until the connection completes, fails or timed
+ out (it's the case in asyncio for example). */
+ wait_connect = (s->sock_timeout != 0 && IS_SELECTABLE(s));
+ }
+ else {
+ wait_connect = (s->sock_timeout > 0 && err == SOCK_INPROGRESS_ERR
+ && IS_SELECTABLE(s));
+ }
+
+ if (!wait_connect) {
+ if (raise) {
+ /* restore error, maybe replaced by PyErr_CheckSignals() */
+ SET_SOCK_ERROR(err);
+ s->errorhandler();
+ return -1;
+ }
+ else
+ return err;
+ }
+
+ if (raise) {
+ /* socket.connect() raises an exception on error */
+ if (sock_call_ex(s, 1, sock_connect_impl, NULL,
+ 1, NULL, s->sock_timeout) < 0)
+ return -1;
+ }
+ else {
+ /* socket.connect_ex() returns the error code on error */
+ if (sock_call_ex(s, 1, sock_connect_impl, NULL,
+ 1, &err, s->sock_timeout) < 0)
+ return err;
+ }
+ return 0;
+}
+
+/* s.connect(sockaddr) method */
+
+static PyObject *
+sock_connect(PySocketSockObject *s, PyObject *addro)
+{
+ sock_addr_t addrbuf;
+ int addrlen;
+ int res;
+
+ if (!getsockaddrarg(s, addro, &addrbuf, &addrlen, "connect")) {
+ return NULL;
+ }
+
+ if (PySys_Audit("socket.connect", "OO", s, addro) < 0) {
+ return NULL;
+ }
+
+ res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 1);
+ if (res < 0)
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(connect_doc,
+"connect(address)\n\
+\n\
+Connect the socket to a remote address. For IP sockets, the address\n\
+is a pair (host, port).");
+
+
+/* s.connect_ex(sockaddr) method */
+
+static PyObject *
+sock_connect_ex(PySocketSockObject *s, PyObject *addro)
+{
+ sock_addr_t addrbuf;
+ int addrlen;
+ int res;
+
+ if (!getsockaddrarg(s, addro, &addrbuf, &addrlen, "connect_ex")) {
+ return NULL;
+ }
+
+ if (PySys_Audit("socket.connect", "OO", s, addro) < 0) {
+ return NULL;
+ }
+
+ res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 0);
+ if (res < 0)
+ return NULL;
+
+ return PyLong_FromLong((long) res);
+}
+
+PyDoc_STRVAR(connect_ex_doc,
+"connect_ex(address) -> errno\n\
+\n\
+This is like connect(address), but returns an error code (the errno value)\n\
+instead of raising an exception when an error occurs.");
+#endif // HAVE_CONNECT
+
+
+/* s.fileno() method */
+
+static PyObject *
+sock_fileno(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ return PyLong_FromSocket_t(s->sock_fd);
+}
+
+PyDoc_STRVAR(fileno_doc,
+"fileno() -> integer\n\
+\n\
+Return the integer file descriptor of the socket.");
+
+
+#ifdef HAVE_GETSOCKNAME
+/* s.getsockname() method */
+
+static PyObject *
+sock_getsockname(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ sock_addr_t addrbuf;
+ int res;
+ socklen_t addrlen;
+
+ if (!getsockaddrlen(s, &addrlen))
+ return NULL;
+ memset(&addrbuf, 0, addrlen);
+ Py_BEGIN_ALLOW_THREADS
+ res = getsockname(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return s->errorhandler();
+ return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
+ s->sock_proto);
+}
+
+PyDoc_STRVAR(getsockname_doc,
+"getsockname() -> address info\n\
+\n\
+Return the address of the local endpoint. The format depends on the\n\
+address family. For IPv4 sockets, the address info is a pair\n\
+(hostaddr, port). For IPv6 sockets, the address info is a 4-tuple\n\
+(hostaddr, port, flowinfo, scope_id).");
+#endif
+
+
+#ifdef HAVE_GETPEERNAME /* Cray APP doesn't have this :-( */
+/* s.getpeername() method */
+
+static PyObject *
+sock_getpeername(PySocketSockObject *s, PyObject *Py_UNUSED(ignored))
+{
+ sock_addr_t addrbuf;
+ int res;
+ socklen_t addrlen;
+
+ if (!getsockaddrlen(s, &addrlen))
+ return NULL;
+ memset(&addrbuf, 0, addrlen);
+ Py_BEGIN_ALLOW_THREADS
+ res = getpeername(s->sock_fd, SAS2SA(&addrbuf), &addrlen);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return s->errorhandler();
+ return makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
+ s->sock_proto);
+}
+
+PyDoc_STRVAR(getpeername_doc,
+"getpeername() -> address info\n\
+\n\
+Return the address of the remote endpoint. For IP sockets, the address\n\
+info is a pair (hostaddr, port).");
+
+#endif /* HAVE_GETPEERNAME */
+
+
+#ifdef HAVE_LISTEN
+/* s.listen(n) method */
+
+static PyObject *
+sock_listen(PySocketSockObject *s, PyObject *args)
+{
+ /* We try to choose a default backlog high enough to avoid connection drops
+ * for common workloads, yet not too high to limit resource usage. */
+ int backlog = Py_MIN(SOMAXCONN, 128);
+ int res;
+
+ if (!PyArg_ParseTuple(args, "|i:listen", &backlog))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* To avoid problems on systems that don't allow a negative backlog
+ * (which doesn't make sense anyway) we force a minimum value of 0. */
+ if (backlog < 0)
+ backlog = 0;
+ res = listen(s->sock_fd, backlog);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return s->errorhandler();
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(listen_doc,
+"listen([backlog])\n\
+\n\
+Enable a server to accept connections. If backlog is specified, it must be\n\
+at least 0 (if it is lower, it is set to 0); it specifies the number of\n\
+unaccepted connections that the system will allow before refusing new\n\
+connections. If not specified, a default reasonable value is chosen.");
+#endif
+
+struct sock_recv {
+ char *cbuf;
+ Py_ssize_t len;
+ int flags;
+ Py_ssize_t result;
+};
+
+static int
+sock_recv_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_recv *ctx = data;
+
+#ifdef MS_WINDOWS
+ if (ctx->len > INT_MAX)
+ ctx->len = INT_MAX;
+ ctx->result = recv(s->sock_fd, ctx->cbuf, (int)ctx->len, ctx->flags);
+#else
+ ctx->result = recv(s->sock_fd, ctx->cbuf, ctx->len, ctx->flags);
+#endif
+ return (ctx->result >= 0);
+}
+
+
+/*
+ * This is the guts of the recv() and recv_into() methods, which reads into a
+ * char buffer. If you have any inc/dec ref to do to the objects that contain
+ * the buffer, do it in the caller. This function returns the number of bytes
+ * successfully read. If there was an error, it returns -1. Note that it is
+ * also possible that we return a number of bytes smaller than the request
+ * bytes.
+ */
+
+static Py_ssize_t
+sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
+{
+ struct sock_recv ctx;
+
+ if (!IS_SELECTABLE(s)) {
+ select_error();
+ return -1;
+ }
+ if (len == 0) {
+ /* If 0 bytes were requested, do nothing. */
+ return 0;
+ }
+
+ ctx.cbuf = cbuf;
+ ctx.len = len;
+ ctx.flags = flags;
+ if (sock_call(s, 0, sock_recv_impl, &ctx) < 0)
+ return -1;
+
+ return ctx.result;
+}
+
+
+/* s.recv(nbytes [,flags]) method */
+
+static PyObject *
+sock_recv(PySocketSockObject *s, PyObject *args)
+{
+ Py_ssize_t recvlen, outlen;
+ int flags = 0;
+ PyObject *buf;
+
+ if (!PyArg_ParseTuple(args, "n|i:recv", &recvlen, &flags))
+ return NULL;
+
+ if (recvlen < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "negative buffersize in recv");
+ return NULL;
+ }
+
+ /* Allocate a new string. */
+ buf = PyBytes_FromStringAndSize((char *) 0, recvlen);
+ if (buf == NULL)
+ return NULL;
+
+ /* Call the guts */
+ outlen = sock_recv_guts(s, PyBytes_AS_STRING(buf), recvlen, flags);
+ if (outlen < 0) {
+ /* An error occurred, release the string and return an
+ error. */
+ Py_DECREF(buf);
+ return NULL;
+ }
+ if (outlen != recvlen) {
+ /* We did not read as many bytes as we anticipated, resize the
+ string if possible and be successful. */
+ _PyBytes_Resize(&buf, outlen);
+ }
+
+ return buf;
+}
+
+PyDoc_STRVAR(recv_doc,
+"recv(buffersize[, flags]) -> data\n\
+\n\
+Receive up to buffersize bytes from the socket. For the optional flags\n\
+argument, see the Unix manual. When no data is available, block until\n\
+at least one byte is available or until the remote end is closed. When\n\
+the remote end is closed and all data is read, return the empty string.");
+
+
+/* s.recv_into(buffer, [nbytes [,flags]]) method */
+
+static PyObject*
+sock_recv_into(PySocketSockObject *s, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"buffer", "nbytes", "flags", 0};
+
+ int flags = 0;
+ Py_buffer pbuf;
+ char *buf;
+ Py_ssize_t buflen, readlen, recvlen = 0;
+
+ /* Get the buffer's memory */
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "w*|ni:recv_into", kwlist,
+ &pbuf, &recvlen, &flags))
+ return NULL;
+ buf = pbuf.buf;
+ buflen = pbuf.len;
+
+ if (recvlen < 0) {
+ PyBuffer_Release(&pbuf);
+ PyErr_SetString(PyExc_ValueError,
+ "negative buffersize in recv_into");
+ return NULL;
+ }
+ if (recvlen == 0) {
+ /* If nbytes was not specified, use the buffer's length */
+ recvlen = buflen;
+ }
+
+ /* Check if the buffer is large enough */
+ if (buflen < recvlen) {
+ PyBuffer_Release(&pbuf);
+ PyErr_SetString(PyExc_ValueError,
+ "buffer too small for requested bytes");
+ return NULL;
+ }
+
+ /* Call the guts */
+ readlen = sock_recv_guts(s, buf, recvlen, flags);
+ if (readlen < 0) {
+ /* Return an error. */
+ PyBuffer_Release(&pbuf);
+ return NULL;
+ }
+
+ PyBuffer_Release(&pbuf);
+ /* Return the number of bytes read. Note that we do not do anything
+ special here in the case that readlen < recvlen. */
+ return PyLong_FromSsize_t(readlen);
+}
+
+PyDoc_STRVAR(recv_into_doc,
+"recv_into(buffer, [nbytes[, flags]]) -> nbytes_read\n\
+\n\
+A version of recv() that stores its data into a buffer rather than creating\n\
+a new string. Receive up to buffersize bytes from the socket. If buffersize\n\
+is not specified (or 0), receive up to the size available in the given buffer.\n\
+\n\
+See recv() for documentation about the flags.");
+
+struct sock_recvfrom {
+ char* cbuf;
+ Py_ssize_t len;
+ int flags;
+ socklen_t *addrlen;
+ sock_addr_t *addrbuf;
+ Py_ssize_t result;
+};
+
+#ifdef HAVE_RECVFROM
+static int
+sock_recvfrom_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_recvfrom *ctx = data;
+
+ memset(ctx->addrbuf, 0, *ctx->addrlen);
+
+#ifdef MS_WINDOWS
+ if (ctx->len > INT_MAX)
+ ctx->len = INT_MAX;
+ ctx->result = recvfrom(s->sock_fd, ctx->cbuf, (int)ctx->len, ctx->flags,
+ SAS2SA(ctx->addrbuf), ctx->addrlen);
+#else
+ ctx->result = recvfrom(s->sock_fd, ctx->cbuf, ctx->len, ctx->flags,
+ SAS2SA(ctx->addrbuf), ctx->addrlen);
+#endif
+ return (ctx->result >= 0);
+}
+
+
+/*
+ * This is the guts of the recvfrom() and recvfrom_into() methods, which reads
+ * into a char buffer. If you have any inc/def ref to do to the objects that
+ * contain the buffer, do it in the caller. This function returns the number
+ * of bytes successfully read. If there was an error, it returns -1. Note
+ * that it is also possible that we return a number of bytes smaller than the
+ * request bytes.
+ *
+ * 'addr' is a return value for the address object. Note that you must decref
+ * it yourself.
+ */
+static Py_ssize_t
+sock_recvfrom_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags,
+ PyObject** addr)
+{
+ sock_addr_t addrbuf;
+ socklen_t addrlen;
+ struct sock_recvfrom ctx;
+
+ *addr = NULL;
+
+ if (!getsockaddrlen(s, &addrlen))
+ return -1;
+
+ if (!IS_SELECTABLE(s)) {
+ select_error();
+ return -1;
+ }
+
+ ctx.cbuf = cbuf;
+ ctx.len = len;
+ ctx.flags = flags;
+ ctx.addrbuf = &addrbuf;
+ ctx.addrlen = &addrlen;
+ if (sock_call(s, 0, sock_recvfrom_impl, &ctx) < 0)
+ return -1;
+
+ *addr = makesockaddr(s->sock_fd, SAS2SA(&addrbuf), addrlen,
+ s->sock_proto);
+ if (*addr == NULL)
+ return -1;
+
+ return ctx.result;
+}
+
+/* s.recvfrom(nbytes [,flags]) method */
+
+static PyObject *
+sock_recvfrom(PySocketSockObject *s, PyObject *args)
+{
+ PyObject *buf = NULL;
+ PyObject *addr = NULL;
+ PyObject *ret = NULL;
+ int flags = 0;
+ Py_ssize_t recvlen, outlen;
+
+ if (!PyArg_ParseTuple(args, "n|i:recvfrom", &recvlen, &flags))
+ return NULL;
+
+ if (recvlen < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "negative buffersize in recvfrom");
+ return NULL;
+ }
+
+ buf = PyBytes_FromStringAndSize((char *) 0, recvlen);
+ if (buf == NULL)
+ return NULL;
+
+ outlen = sock_recvfrom_guts(s, PyBytes_AS_STRING(buf),
+ recvlen, flags, &addr);
+ if (outlen < 0) {
+ goto finally;
+ }
+
+ if (outlen != recvlen) {
+ /* We did not read as many bytes as we anticipated, resize the
+ string if possible and be successful. */
+ if (_PyBytes_Resize(&buf, outlen) < 0)
+ /* Oopsy, not so successful after all. */
+ goto finally;
+ }
+
+ ret = PyTuple_Pack(2, buf, addr);
+
+finally:
+ Py_XDECREF(buf);
+ Py_XDECREF(addr);
+ return ret;
+}
+
+PyDoc_STRVAR(recvfrom_doc,
+"recvfrom(buffersize[, flags]) -> (data, address info)\n\
+\n\
+Like recv(buffersize, flags) but also return the sender's address info.");
+
+
+/* s.recvfrom_into(buffer[, nbytes [,flags]]) method */
+
+static PyObject *
+sock_recvfrom_into(PySocketSockObject *s, PyObject *args, PyObject* kwds)
+{
+ static char *kwlist[] = {"buffer", "nbytes", "flags", 0};
+
+ int flags = 0;
+ Py_buffer pbuf;
+ char *buf;
+ Py_ssize_t readlen, buflen, recvlen = 0;
+
+ PyObject *addr = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "w*|ni:recvfrom_into",
+ kwlist, &pbuf,
+ &recvlen, &flags))
+ return NULL;
+ buf = pbuf.buf;
+ buflen = pbuf.len;
+
+ if (recvlen < 0) {
+ PyBuffer_Release(&pbuf);
+ PyErr_SetString(PyExc_ValueError,
+ "negative buffersize in recvfrom_into");
+ return NULL;
+ }
+ if (recvlen == 0) {
+ /* If nbytes was not specified, use the buffer's length */
+ recvlen = buflen;
+ } else if (recvlen > buflen) {
+ PyBuffer_Release(&pbuf);
+ PyErr_SetString(PyExc_ValueError,
+ "nbytes is greater than the length of the buffer");
+ return NULL;
+ }
+
+ readlen = sock_recvfrom_guts(s, buf, recvlen, flags, &addr);
+ if (readlen < 0) {
+ PyBuffer_Release(&pbuf);
+ /* Return an error */
+ Py_XDECREF(addr);
+ return NULL;
+ }
+
+ PyBuffer_Release(&pbuf);
+ /* Return the number of bytes read and the address. Note that we do
+ not do anything special here in the case that readlen < recvlen. */
+ return Py_BuildValue("nN", readlen, addr);
+}
+
+PyDoc_STRVAR(recvfrom_into_doc,
+"recvfrom_into(buffer[, nbytes[, flags]]) -> (nbytes, address info)\n\
+\n\
+Like recv_into(buffer[, nbytes[, flags]]) but also return the sender's address info.");
+#endif
+
+/* The sendmsg() and recvmsg[_into]() methods require a working
+ CMSG_LEN(). See the comment near get_CMSG_LEN(). */
+#ifdef CMSG_LEN
+struct sock_recvmsg {
+ struct msghdr *msg;
+ int flags;
+ ssize_t result;
+};
+
+static int
+sock_recvmsg_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_recvmsg *ctx = data;
+
+ ctx->result = recvmsg(s->sock_fd, ctx->msg, ctx->flags);
+ return (ctx->result >= 0);
+}
+
+/*
+ * Call recvmsg() with the supplied iovec structures, flags, and
+ * ancillary data buffer size (controllen). Returns the tuple return
+ * value for recvmsg() or recvmsg_into(), with the first item provided
+ * by the supplied makeval() function. makeval() will be called with
+ * the length read and makeval_data as arguments, and must return a
+ * new reference (which will be decrefed if there is a subsequent
+ * error). On error, closes any file descriptors received via
+ * SCM_RIGHTS.
+ */
+static PyObject *
+sock_recvmsg_guts(PySocketSockObject *s, struct iovec *iov, int iovlen,
+ int flags, Py_ssize_t controllen,
+ PyObject *(*makeval)(ssize_t, void *), void *makeval_data)
+{
+ sock_addr_t addrbuf;
+ socklen_t addrbuflen;
+ struct msghdr msg = {0};
+ PyObject *cmsg_list = NULL, *retval = NULL;
+ void *controlbuf = NULL;
+ struct cmsghdr *cmsgh;
+ size_t cmsgdatalen = 0;
+ int cmsg_status;
+ struct sock_recvmsg ctx;
+
+ /* XXX: POSIX says that msg_name and msg_namelen "shall be
+ ignored" when the socket is connected (Linux fills them in
+ anyway for AF_UNIX sockets at least). Normally msg_namelen
+ seems to be set to 0 if there's no address, but try to
+ initialize msg_name to something that won't be mistaken for a
+ real address if that doesn't happen. */
+ if (!getsockaddrlen(s, &addrbuflen))
+ return NULL;
+ memset(&addrbuf, 0, addrbuflen);
+ SAS2SA(&addrbuf)->sa_family = AF_UNSPEC;
+
+ if (controllen < 0 || controllen > SOCKLEN_T_LIMIT) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid ancillary data buffer length");
+ return NULL;
+ }
+ if (controllen > 0 && (controlbuf = PyMem_Malloc(controllen)) == NULL)
+ return PyErr_NoMemory();
+
+ /* Make the system call. */
+ if (!IS_SELECTABLE(s)) {
+ select_error();
+ goto finally;
+ }
+
+ msg.msg_name = SAS2SA(&addrbuf);
+ msg.msg_namelen = addrbuflen;
+ msg.msg_iov = iov;
+ msg.msg_iovlen = iovlen;
+ msg.msg_control = controlbuf;
+ msg.msg_controllen = controllen;
+
+ ctx.msg = &msg;
+ ctx.flags = flags;
+ if (sock_call(s, 0, sock_recvmsg_impl, &ctx) < 0)
+ goto finally;
+
+ /* Make list of (level, type, data) tuples from control messages. */
+ if ((cmsg_list = PyList_New(0)) == NULL)
+ goto err_closefds;
+ /* Check for empty ancillary data as old CMSG_FIRSTHDR()
+ implementations didn't do so. */
+ for (cmsgh = ((msg.msg_controllen > 0) ? CMSG_FIRSTHDR(&msg) : NULL);
+ cmsgh != NULL; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
+ PyObject *bytes, *tuple;
+ int tmp;
+
+ cmsg_status = get_cmsg_data_len(&msg, cmsgh, &cmsgdatalen);
+ if (cmsg_status != 0) {
+ if (PyErr_WarnEx(PyExc_RuntimeWarning,
+ "received malformed or improperly-truncated "
+ "ancillary data", 1) == -1)
+ goto err_closefds;
+ }
+ if (cmsg_status < 0)
+ break;
+ if (cmsgdatalen > PY_SSIZE_T_MAX) {
+ PyErr_SetString(PyExc_OSError, "control message too long");
+ goto err_closefds;
+ }
+
+ bytes = PyBytes_FromStringAndSize((char *)CMSG_DATA(cmsgh),
+ cmsgdatalen);
+ tuple = Py_BuildValue("iiN", (int)cmsgh->cmsg_level,
+ (int)cmsgh->cmsg_type, bytes);
+ if (tuple == NULL)
+ goto err_closefds;
+ tmp = PyList_Append(cmsg_list, tuple);
+ Py_DECREF(tuple);
+ if (tmp != 0)
+ goto err_closefds;
+
+ if (cmsg_status != 0)
+ break;
+ }
+
+ retval = Py_BuildValue("NOiN",
+ (*makeval)(ctx.result, makeval_data),
+ cmsg_list,
+ (int)msg.msg_flags,
+ makesockaddr(s->sock_fd, SAS2SA(&addrbuf),
+ ((msg.msg_namelen > addrbuflen) ?
+ addrbuflen : msg.msg_namelen),
+ s->sock_proto));
+ if (retval == NULL)
+ goto err_closefds;
+
+finally:
+ Py_XDECREF(cmsg_list);
+ PyMem_Free(controlbuf);
+ return retval;
+
+err_closefds:
+#ifdef SCM_RIGHTS
+ /* Close all descriptors coming from SCM_RIGHTS, so they don't leak. */
+ for (cmsgh = ((msg.msg_controllen > 0) ? CMSG_FIRSTHDR(&msg) : NULL);
+ cmsgh != NULL; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
+ cmsg_status = get_cmsg_data_len(&msg, cmsgh, &cmsgdatalen);
+ if (cmsg_status < 0)
+ break;
+ if (cmsgh->cmsg_level == SOL_SOCKET &&
+ cmsgh->cmsg_type == SCM_RIGHTS) {
+ size_t numfds;
+ int *fdp;
+
+ numfds = cmsgdatalen / sizeof(int);
+ fdp = (int *)CMSG_DATA(cmsgh);
+ while (numfds-- > 0)
+ close(*fdp++);
+ }
+ if (cmsg_status != 0)
+ break;
+ }
+#endif /* SCM_RIGHTS */
+ goto finally;
+}
+
+
+static PyObject *
+makeval_recvmsg(ssize_t received, void *data)
+{
+ PyObject **buf = data;
+
+ if (received < PyBytes_GET_SIZE(*buf))
+ _PyBytes_Resize(buf, received);
+ return Py_XNewRef(*buf);
+}
+
+/* s.recvmsg(bufsize[, ancbufsize[, flags]]) method */
+
+static PyObject *
+sock_recvmsg(PySocketSockObject *s, PyObject *args)
+{
+ Py_ssize_t bufsize, ancbufsize = 0;
+ int flags = 0;
+ struct iovec iov;
+ PyObject *buf = NULL, *retval = NULL;
+
+ if (!PyArg_ParseTuple(args, "n|ni:recvmsg", &bufsize, &ancbufsize, &flags))
+ return NULL;
+
+ if (bufsize < 0) {
+ PyErr_SetString(PyExc_ValueError, "negative buffer size in recvmsg()");
+ return NULL;
+ }
+ if ((buf = PyBytes_FromStringAndSize(NULL, bufsize)) == NULL)
+ return NULL;
+ iov.iov_base = PyBytes_AS_STRING(buf);
+ iov.iov_len = bufsize;
+
+ /* Note that we're passing a pointer to *our pointer* to the bytes
+ object here (&buf); makeval_recvmsg() may incref the object, or
+ deallocate it and set our pointer to NULL. */
+ retval = sock_recvmsg_guts(s, &iov, 1, flags, ancbufsize,
+ &makeval_recvmsg, &buf);
+ Py_XDECREF(buf);
+ return retval;
+}
+
+PyDoc_STRVAR(recvmsg_doc,
+"recvmsg(bufsize[, ancbufsize[, flags]]) -> (data, ancdata, msg_flags, address)\n\
+\n\
+Receive normal data (up to bufsize bytes) and ancillary data from the\n\
+socket. The ancbufsize argument sets the size in bytes of the\n\
+internal buffer used to receive the ancillary data; it defaults to 0,\n\
+meaning that no ancillary data will be received. Appropriate buffer\n\
+sizes for ancillary data can be calculated using CMSG_SPACE() or\n\
+CMSG_LEN(), and items which do not fit into the buffer might be\n\
+truncated or discarded. The flags argument defaults to 0 and has the\n\
+same meaning as for recv().\n\
+\n\
+The return value is a 4-tuple: (data, ancdata, msg_flags, address).\n\
+The data item is a bytes object holding the non-ancillary data\n\
+received. The ancdata item is a list of zero or more tuples\n\
+(cmsg_level, cmsg_type, cmsg_data) representing the ancillary data\n\
+(control messages) received: cmsg_level and cmsg_type are integers\n\
+specifying the protocol level and protocol-specific type respectively,\n\
+and cmsg_data is a bytes object holding the associated data. The\n\
+msg_flags item is the bitwise OR of various flags indicating\n\
+conditions on the received message; see your system documentation for\n\
+details. If the receiving socket is unconnected, address is the\n\
+address of the sending socket, if available; otherwise, its value is\n\
+unspecified.\n\
+\n\
+If recvmsg() raises an exception after the system call returns, it\n\
+will first attempt to close any file descriptors received via the\n\
+SCM_RIGHTS mechanism.");
+
+
+static PyObject *
+makeval_recvmsg_into(ssize_t received, void *data)
+{
+ return PyLong_FromSsize_t(received);
+}
+
+/* s.recvmsg_into(buffers[, ancbufsize[, flags]]) method */
+
+static PyObject *
+sock_recvmsg_into(PySocketSockObject *s, PyObject *args)
+{
+ Py_ssize_t ancbufsize = 0;
+ int flags = 0;
+ struct iovec *iovs = NULL;
+ Py_ssize_t i, nitems, nbufs = 0;
+ Py_buffer *bufs = NULL;
+ PyObject *buffers_arg, *fast, *retval = NULL;
+
+ if (!PyArg_ParseTuple(args, "O|ni:recvmsg_into",
+ &buffers_arg, &ancbufsize, &flags))
+ return NULL;
+
+ if ((fast = PySequence_Fast(buffers_arg,
+ "recvmsg_into() argument 1 must be an "
+ "iterable")) == NULL)
+ return NULL;
+ nitems = PySequence_Fast_GET_SIZE(fast);
+ if (nitems > INT_MAX) {
+ PyErr_SetString(PyExc_OSError, "recvmsg_into() argument 1 is too long");
+ goto finally;
+ }
+
+ /* Fill in an iovec for each item, and save the Py_buffer
+ structs to release afterwards. */
+ if (nitems > 0 && ((iovs = PyMem_New(struct iovec, nitems)) == NULL ||
+ (bufs = PyMem_New(Py_buffer, nitems)) == NULL)) {
+ PyErr_NoMemory();
+ goto finally;
+ }
+ for (; nbufs < nitems; nbufs++) {
+ if (!PyArg_Parse(PySequence_Fast_GET_ITEM(fast, nbufs),
+ "w*;recvmsg_into() argument 1 must be an iterable "
+ "of single-segment read-write buffers",
+ &bufs[nbufs]))
+ goto finally;
+ iovs[nbufs].iov_base = bufs[nbufs].buf;
+ iovs[nbufs].iov_len = bufs[nbufs].len;
+ }
+
+ retval = sock_recvmsg_guts(s, iovs, nitems, flags, ancbufsize,
+ &makeval_recvmsg_into, NULL);
+finally:
+ for (i = 0; i < nbufs; i++)
+ PyBuffer_Release(&bufs[i]);
+ PyMem_Free(bufs);
+ PyMem_Free(iovs);
+ Py_DECREF(fast);
+ return retval;
+}
+
+PyDoc_STRVAR(recvmsg_into_doc,
+"recvmsg_into(buffers[, ancbufsize[, flags]]) -> (nbytes, ancdata, msg_flags, address)\n\
+\n\
+Receive normal data and ancillary data from the socket, scattering the\n\
+non-ancillary data into a series of buffers. The buffers argument\n\
+must be an iterable of objects that export writable buffers\n\
+(e.g. bytearray objects); these will be filled with successive chunks\n\
+of the non-ancillary data until it has all been written or there are\n\
+no more buffers. The ancbufsize argument sets the size in bytes of\n\
+the internal buffer used to receive the ancillary data; it defaults to\n\
+0, meaning that no ancillary data will be received. Appropriate\n\
+buffer sizes for ancillary data can be calculated using CMSG_SPACE()\n\
+or CMSG_LEN(), and items which do not fit into the buffer might be\n\
+truncated or discarded. The flags argument defaults to 0 and has the\n\
+same meaning as for recv().\n\
+\n\
+The return value is a 4-tuple: (nbytes, ancdata, msg_flags, address).\n\
+The nbytes item is the total number of bytes of non-ancillary data\n\
+written into the buffers. The ancdata item is a list of zero or more\n\
+tuples (cmsg_level, cmsg_type, cmsg_data) representing the ancillary\n\
+data (control messages) received: cmsg_level and cmsg_type are\n\
+integers specifying the protocol level and protocol-specific type\n\
+respectively, and cmsg_data is a bytes object holding the associated\n\
+data. The msg_flags item is the bitwise OR of various flags\n\
+indicating conditions on the received message; see your system\n\
+documentation for details. If the receiving socket is unconnected,\n\
+address is the address of the sending socket, if available; otherwise,\n\
+its value is unspecified.\n\
+\n\
+If recvmsg_into() raises an exception after the system call returns,\n\
+it will first attempt to close any file descriptors received via the\n\
+SCM_RIGHTS mechanism.");
+#endif /* CMSG_LEN */
+
+
+struct sock_send {
+ char *buf;
+ Py_ssize_t len;
+ int flags;
+ Py_ssize_t result;
+};
+
+static int
+sock_send_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_send *ctx = data;
+
+#ifdef MS_WINDOWS
+ if (ctx->len > INT_MAX)
+ ctx->len = INT_MAX;
+ ctx->result = send(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags);
+#else
+ ctx->result = send(s->sock_fd, ctx->buf, ctx->len, ctx->flags);
+#endif
+ return (ctx->result >= 0);
+}
+
+/* s.send(data [,flags]) method */
+
+static PyObject *
+sock_send(PySocketSockObject *s, PyObject *args)
+{
+ int flags = 0;
+ Py_buffer pbuf;
+ struct sock_send ctx;
+
+ if (!PyArg_ParseTuple(args, "y*|i:send", &pbuf, &flags))
+ return NULL;
+
+ if (!IS_SELECTABLE(s)) {
+ PyBuffer_Release(&pbuf);
+ return select_error();
+ }
+ ctx.buf = pbuf.buf;
+ ctx.len = pbuf.len;
+ ctx.flags = flags;
+ if (sock_call(s, 1, sock_send_impl, &ctx) < 0) {
+ PyBuffer_Release(&pbuf);
+ return NULL;
+ }
+ PyBuffer_Release(&pbuf);
+
+ return PyLong_FromSsize_t(ctx.result);
+}
+
+PyDoc_STRVAR(send_doc,
+"send(data[, flags]) -> count\n\
+\n\
+Send a data string to the socket. For the optional flags\n\
+argument, see the Unix manual. Return the number of bytes\n\
+sent; this may be less than len(data) if the network is busy.");
+
+
+/* s.sendall(data [,flags]) method */
+
+static PyObject *
+sock_sendall(PySocketSockObject *s, PyObject *args)
+{
+ char *buf;
+ Py_ssize_t len, n;
+ int flags = 0;
+ Py_buffer pbuf;
+ struct sock_send ctx;
+ int has_timeout = (s->sock_timeout > 0);
+ _PyTime_t timeout = s->sock_timeout;
+ _PyTime_t deadline = 0;
+ int deadline_initialized = 0;
+ PyObject *res = NULL;
+
+ if (!PyArg_ParseTuple(args, "y*|i:sendall", &pbuf, &flags))
+ return NULL;
+ buf = pbuf.buf;
+ len = pbuf.len;
+
+ if (!IS_SELECTABLE(s)) {
+ PyBuffer_Release(&pbuf);
+ return select_error();
+ }
+
+ do {
+ if (has_timeout) {
+ if (deadline_initialized) {
+ /* recompute the timeout */
+ timeout = _PyDeadline_Get(deadline);
+ }
+ else {
+ deadline_initialized = 1;
+ deadline = _PyDeadline_Init(timeout);
+ }
+
+ if (timeout <= 0) {
+ PyErr_SetString(PyExc_TimeoutError, "timed out");
+ goto done;
+ }
+ }
+
+ ctx.buf = buf;
+ ctx.len = len;
+ ctx.flags = flags;
+ if (sock_call_ex(s, 1, sock_send_impl, &ctx, 0, NULL, timeout) < 0)
+ goto done;
+ n = ctx.result;
+ assert(n >= 0);
+
+ buf += n;
+ len -= n;
+
+ /* We must run our signal handlers before looping again.
+ send() can return a successful partial write when it is
+ interrupted, so we can't restrict ourselves to EINTR. */
+ if (PyErr_CheckSignals())
+ goto done;
+ } while (len > 0);
+ PyBuffer_Release(&pbuf);
+
+ res = Py_NewRef(Py_None);
+
+done:
+ PyBuffer_Release(&pbuf);
+ return res;
+}
+
+PyDoc_STRVAR(sendall_doc,
+"sendall(data[, flags])\n\
+\n\
+Send a data string to the socket. For the optional flags\n\
+argument, see the Unix manual. This calls send() repeatedly\n\
+until all data is sent. If an error occurs, it's impossible\n\
+to tell how much data has been sent.");
+
+
+#ifdef HAVE_SENDTO
+struct sock_sendto {
+ char *buf;
+ Py_ssize_t len;
+ int flags;
+ int addrlen;
+ sock_addr_t *addrbuf;
+ Py_ssize_t result;
+};
+
+static int
+sock_sendto_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_sendto *ctx = data;
+
+#ifdef MS_WINDOWS
+ if (ctx->len > INT_MAX)
+ ctx->len = INT_MAX;
+ ctx->result = sendto(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags,
+ SAS2SA(ctx->addrbuf), ctx->addrlen);
+#else
+ ctx->result = sendto(s->sock_fd, ctx->buf, ctx->len, ctx->flags,
+ SAS2SA(ctx->addrbuf), ctx->addrlen);
+#endif
+ return (ctx->result >= 0);
+}
+
+/* s.sendto(data, [flags,] sockaddr) method */
+
+static PyObject *
+sock_sendto(PySocketSockObject *s, PyObject *args)
+{
+ Py_buffer pbuf;
+ PyObject *addro;
+ Py_ssize_t arglen;
+ sock_addr_t addrbuf;
+ int addrlen, flags;
+ struct sock_sendto ctx;
+
+ flags = 0;
+ arglen = PyTuple_Size(args);
+ switch (arglen) {
+ case 2:
+ if (!PyArg_ParseTuple(args, "y*O:sendto", &pbuf, &addro)) {
+ return NULL;
+ }
+ break;
+ case 3:
+ if (!PyArg_ParseTuple(args, "y*iO:sendto",
+ &pbuf, &flags, &addro)) {
+ return NULL;
+ }
+ break;
+ default:
+ PyErr_Format(PyExc_TypeError,
+ "sendto() takes 2 or 3 arguments (%zd given)",
+ arglen);
+ return NULL;
+ }
+
+ if (!IS_SELECTABLE(s)) {
+ PyBuffer_Release(&pbuf);
+ return select_error();
+ }
+
+ if (!getsockaddrarg(s, addro, &addrbuf, &addrlen, "sendto")) {
+ PyBuffer_Release(&pbuf);
+ return NULL;
+ }
+
+ if (PySys_Audit("socket.sendto", "OO", s, addro) < 0) {
+ return NULL;
+ }
+
+ ctx.buf = pbuf.buf;
+ ctx.len = pbuf.len;
+ ctx.flags = flags;
+ ctx.addrlen = addrlen;
+ ctx.addrbuf = &addrbuf;
+ if (sock_call(s, 1, sock_sendto_impl, &ctx) < 0) {
+ PyBuffer_Release(&pbuf);
+ return NULL;
+ }
+ PyBuffer_Release(&pbuf);
+
+ return PyLong_FromSsize_t(ctx.result);
+}
+
+PyDoc_STRVAR(sendto_doc,
+"sendto(data[, flags], address) -> count\n\
+\n\
+Like send(data, flags) but allows specifying the destination address.\n\
+For IP sockets, the address is a pair (hostaddr, port).");
+#endif
+
+
+/* The sendmsg() and recvmsg[_into]() methods require a working
+ CMSG_LEN(). See the comment near get_CMSG_LEN(). */
+#ifdef CMSG_LEN
+struct sock_sendmsg {
+ struct msghdr *msg;
+ int flags;
+ ssize_t result;
+};
+
+static int
+sock_sendmsg_iovec(PySocketSockObject *s, PyObject *data_arg,
+ struct msghdr *msg,
+ Py_buffer **databufsout, Py_ssize_t *ndatabufsout) {
+ Py_ssize_t ndataparts, ndatabufs = 0;
+ int result = -1;
+ struct iovec *iovs = NULL;
+ PyObject *data_fast = NULL;
+ Py_buffer *databufs = NULL;
+
+ /* Fill in an iovec for each message part, and save the Py_buffer
+ structs to release afterwards. */
+ data_fast = PySequence_Fast(data_arg,
+ "sendmsg() argument 1 must be an "
+ "iterable");
+ if (data_fast == NULL) {
+ goto finally;
+ }
+
+ ndataparts = PySequence_Fast_GET_SIZE(data_fast);
+ if (ndataparts > INT_MAX) {
+ PyErr_SetString(PyExc_OSError, "sendmsg() argument 1 is too long");
+ goto finally;
+ }
+
+ msg->msg_iovlen = ndataparts;
+ if (ndataparts > 0) {
+ iovs = PyMem_New(struct iovec, ndataparts);
+ if (iovs == NULL) {
+ PyErr_NoMemory();
+ goto finally;
+ }
+ msg->msg_iov = iovs;
+
+ databufs = PyMem_New(Py_buffer, ndataparts);
+ if (databufs == NULL) {
+ PyErr_NoMemory();
+ goto finally;
+ }
+ }
+ for (; ndatabufs < ndataparts; ndatabufs++) {
+ if (!PyArg_Parse(PySequence_Fast_GET_ITEM(data_fast, ndatabufs),
+ "y*;sendmsg() argument 1 must be an iterable of "
+ "bytes-like objects",
+ &databufs[ndatabufs]))
+ goto finally;
+ iovs[ndatabufs].iov_base = databufs[ndatabufs].buf;
+ iovs[ndatabufs].iov_len = databufs[ndatabufs].len;
+ }
+ result = 0;
+ finally:
+ *databufsout = databufs;
+ *ndatabufsout = ndatabufs;
+ Py_XDECREF(data_fast);
+ return result;
+}
+
+static int
+sock_sendmsg_impl(PySocketSockObject *s, void *data)
+{
+ struct sock_sendmsg *ctx = data;
+
+ ctx->result = sendmsg(s->sock_fd, ctx->msg, ctx->flags);
+ return (ctx->result >= 0);
+}
+
+/* s.sendmsg(buffers[, ancdata[, flags[, address]]]) method */
+
+static PyObject *
+sock_sendmsg(PySocketSockObject *s, PyObject *args)
+{
+ Py_ssize_t i, ndatabufs = 0, ncmsgs, ncmsgbufs = 0;
+ Py_buffer *databufs = NULL;
+ sock_addr_t addrbuf;
+ struct msghdr msg;
+ struct cmsginfo {
+ int level;
+ int type;
+ Py_buffer data;
+ } *cmsgs = NULL;
+ void *controlbuf = NULL;
+ size_t controllen, controllen_last;
+ int addrlen, flags = 0;
+ PyObject *data_arg, *cmsg_arg = NULL, *addr_arg = NULL,
+ *cmsg_fast = NULL, *retval = NULL;
+ struct sock_sendmsg ctx;
+
+ if (!PyArg_ParseTuple(args, "O|OiO:sendmsg",
+ &data_arg, &cmsg_arg, &flags, &addr_arg)) {
+ return NULL;
+ }
+
+ memset(&msg, 0, sizeof(msg));
+
+ /* Parse destination address. */
+ if (addr_arg != NULL && addr_arg != Py_None) {
+ if (!getsockaddrarg(s, addr_arg, &addrbuf, &addrlen,
+ "sendmsg"))
+ {
+ goto finally;
+ }
+ if (PySys_Audit("socket.sendmsg", "OO", s, addr_arg) < 0) {
+ return NULL;
+ }
+ msg.msg_name = &addrbuf;
+ msg.msg_namelen = addrlen;
+ } else {
+ if (PySys_Audit("socket.sendmsg", "OO", s, Py_None) < 0) {
+ return NULL;
+ }
+ }
+
+ /* Fill in an iovec for each message part, and save the Py_buffer
+ structs to release afterwards. */
+ if (sock_sendmsg_iovec(s, data_arg, &msg, &databufs, &ndatabufs) == -1) {
+ goto finally;
+ }
+
+ if (cmsg_arg == NULL)
+ ncmsgs = 0;
+ else {
+ if ((cmsg_fast = PySequence_Fast(cmsg_arg,
+ "sendmsg() argument 2 must be an "
+ "iterable")) == NULL)
+ goto finally;
+ ncmsgs = PySequence_Fast_GET_SIZE(cmsg_fast);
+ }
+
+#ifndef CMSG_SPACE
+ if (ncmsgs > 1) {
+ PyErr_SetString(PyExc_OSError,
+ "sending multiple control messages is not supported "
+ "on this system");
+ goto finally;
+ }
+#endif
+ /* Save level, type and Py_buffer for each control message,
+ and calculate total size. */
+ if (ncmsgs > 0 && (cmsgs = PyMem_New(struct cmsginfo, ncmsgs)) == NULL) {
+ PyErr_NoMemory();
+ goto finally;
+ }
+ controllen = controllen_last = 0;
+ while (ncmsgbufs < ncmsgs) {
+ size_t bufsize, space;
+
+ if (!PyArg_Parse(PySequence_Fast_GET_ITEM(cmsg_fast, ncmsgbufs),
+ "(iiy*):[sendmsg() ancillary data items]",
+ &cmsgs[ncmsgbufs].level,
+ &cmsgs[ncmsgbufs].type,
+ &cmsgs[ncmsgbufs].data))
+ goto finally;
+ bufsize = cmsgs[ncmsgbufs++].data.len;
+
+#ifdef CMSG_SPACE
+ if (!get_CMSG_SPACE(bufsize, &space)) {
+#else
+ if (!get_CMSG_LEN(bufsize, &space)) {
+#endif
+ PyErr_SetString(PyExc_OSError, "ancillary data item too large");
+ goto finally;
+ }
+ controllen += space;
+ if (controllen > SOCKLEN_T_LIMIT || controllen < controllen_last) {
+ PyErr_SetString(PyExc_OSError, "too much ancillary data");
+ goto finally;
+ }
+ controllen_last = controllen;
+ }
+
+ /* Construct ancillary data block from control message info. */
+ if (ncmsgbufs > 0) {
+ struct cmsghdr *cmsgh = NULL;
+
+ controlbuf = PyMem_Malloc(controllen);
+ if (controlbuf == NULL) {
+ PyErr_NoMemory();
+ goto finally;
+ }
+ msg.msg_control = controlbuf;
+
+ msg.msg_controllen = controllen;
+
+ /* Need to zero out the buffer as a workaround for glibc's
+ CMSG_NXTHDR() implementation. After getting the pointer to
+ the next header, it checks its (uninitialized) cmsg_len
+ member to see if the "message" fits in the buffer, and
+ returns NULL if it doesn't. Zero-filling the buffer
+ ensures that this doesn't happen. */
+ memset(controlbuf, 0, controllen);
+
+ for (i = 0; i < ncmsgbufs; i++) {
+ size_t msg_len, data_len = cmsgs[i].data.len;
+ int enough_space = 0;
+
+ cmsgh = (i == 0) ? CMSG_FIRSTHDR(&msg) : CMSG_NXTHDR(&msg, cmsgh);
+ if (cmsgh == NULL) {
+ PyErr_Format(PyExc_RuntimeError,
+ "unexpected NULL result from %s()",
+ (i == 0) ? "CMSG_FIRSTHDR" : "CMSG_NXTHDR");
+ goto finally;
+ }
+ if (!get_CMSG_LEN(data_len, &msg_len)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "item size out of range for CMSG_LEN()");
+ goto finally;
+ }
+ if (cmsg_min_space(&msg, cmsgh, msg_len)) {
+ size_t space;
+
+ cmsgh->cmsg_len = msg_len;
+ if (get_cmsg_data_space(&msg, cmsgh, &space))
+ enough_space = (space >= data_len);
+ }
+ if (!enough_space) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ancillary data does not fit in calculated "
+ "space");
+ goto finally;
+ }
+ cmsgh->cmsg_level = cmsgs[i].level;
+ cmsgh->cmsg_type = cmsgs[i].type;
+ memcpy(CMSG_DATA(cmsgh), cmsgs[i].data.buf, data_len);
+ }
+ }
+
+ /* Make the system call. */
+ if (!IS_SELECTABLE(s)) {
+ select_error();
+ goto finally;
+ }
+
+ ctx.msg = &msg;
+ ctx.flags = flags;
+ if (sock_call(s, 1, sock_sendmsg_impl, &ctx) < 0)
+ goto finally;
+
+ retval = PyLong_FromSsize_t(ctx.result);
+
+finally:
+ PyMem_Free(controlbuf);
+ for (i = 0; i < ncmsgbufs; i++)
+ PyBuffer_Release(&cmsgs[i].data);
+ PyMem_Free(cmsgs);
+ Py_XDECREF(cmsg_fast);
+ PyMem_Free(msg.msg_iov);
+ for (i = 0; i < ndatabufs; i++) {
+ PyBuffer_Release(&databufs[i]);
+ }
+ PyMem_Free(databufs);
+ return retval;
+}
+
+PyDoc_STRVAR(sendmsg_doc,
+"sendmsg(buffers[, ancdata[, flags[, address]]]) -> count\n\
+\n\
+Send normal and ancillary data to the socket, gathering the\n\
+non-ancillary data from a series of buffers and concatenating it into\n\
+a single message. The buffers argument specifies the non-ancillary\n\
+data as an iterable of bytes-like objects (e.g. bytes objects).\n\
+The ancdata argument specifies the ancillary data (control messages)\n\
+as an iterable of zero or more tuples (cmsg_level, cmsg_type,\n\
+cmsg_data), where cmsg_level and cmsg_type are integers specifying the\n\
+protocol level and protocol-specific type respectively, and cmsg_data\n\
+is a bytes-like object holding the associated data. The flags\n\
+argument defaults to 0 and has the same meaning as for send(). If\n\
+address is supplied and not None, it sets a destination address for\n\
+the message. The return value is the number of bytes of non-ancillary\n\
+data sent.");
+#endif /* CMSG_LEN */
+
+#ifdef HAVE_SOCKADDR_ALG
+static PyObject*
+sock_sendmsg_afalg(PySocketSockObject *self, PyObject *args, PyObject *kwds)
+{
+ PyObject *retval = NULL;
+
+ Py_ssize_t i, ndatabufs = 0;
+ Py_buffer *databufs = NULL;
+ PyObject *data_arg = NULL;
+
+ Py_buffer iv = {NULL, NULL};
+
+ PyObject *opobj = NULL;
+ int op = -1;
+
+ PyObject *assoclenobj = NULL;
+ int assoclen = -1;
+
+ unsigned int *uiptr;
+ int flags = 0;
+
+ struct msghdr msg;
+ struct cmsghdr *header = NULL;
+ struct af_alg_iv *alg_iv = NULL;
+ struct sock_sendmsg ctx;
+ Py_ssize_t controllen;
+ void *controlbuf = NULL;
+ static char *keywords[] = {"msg", "op", "iv", "assoclen", "flags", 0};
+
+ if (self->sock_family != AF_ALG) {
+ PyErr_SetString(PyExc_OSError,
+ "algset is only supported for AF_ALG");
+ return NULL;
+ }
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "|O$O!y*O!i:sendmsg_afalg", keywords,
+ &data_arg,
+ &PyLong_Type, &opobj, &iv,
+ &PyLong_Type, &assoclenobj, &flags)) {
+ return NULL;
+ }
+
+ memset(&msg, 0, sizeof(msg));
+
+ /* op is a required, keyword-only argument >= 0 */
+ if (opobj != NULL) {
+ op = _PyLong_AsInt(opobj);
+ }
+ if (op < 0) {
+ /* override exception from _PyLong_AsInt() */
+ PyErr_SetString(PyExc_TypeError,
+ "Invalid or missing argument 'op'");
+ goto finally;
+ }
+ /* assoclen is optional but must be >= 0 */
+ if (assoclenobj != NULL) {
+ assoclen = _PyLong_AsInt(assoclenobj);
+ if (assoclen == -1 && PyErr_Occurred()) {
+ goto finally;
+ }
+ if (assoclen < 0) {
+ PyErr_SetString(PyExc_TypeError,
+ "assoclen must be positive");
+ goto finally;
+ }
+ }
+
+ controllen = CMSG_SPACE(4);
+ if (iv.buf != NULL) {
+ controllen += CMSG_SPACE(sizeof(*alg_iv) + iv.len);
+ }
+ if (assoclen >= 0) {
+ controllen += CMSG_SPACE(4);
+ }
+
+ controlbuf = PyMem_Malloc(controllen);
+ if (controlbuf == NULL) {
+ PyErr_NoMemory();
+ goto finally;
+ }
+ memset(controlbuf, 0, controllen);
+
+ msg.msg_controllen = controllen;
+ msg.msg_control = controlbuf;
+
+ /* Fill in an iovec for each message part, and save the Py_buffer
+ structs to release afterwards. */
+ if (data_arg != NULL) {
+ if (sock_sendmsg_iovec(self, data_arg, &msg, &databufs, &ndatabufs) == -1) {
+ goto finally;
+ }
+ }
+
+ /* set operation to encrypt or decrypt */
+ header = CMSG_FIRSTHDR(&msg);
+ if (header == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "unexpected NULL result from CMSG_FIRSTHDR");
+ goto finally;
+ }
+ header->cmsg_level = SOL_ALG;
+ header->cmsg_type = ALG_SET_OP;
+ header->cmsg_len = CMSG_LEN(4);
+ uiptr = (void*)CMSG_DATA(header);
+ *uiptr = (unsigned int)op;
+
+ /* set initialization vector */
+ if (iv.buf != NULL) {
+ header = CMSG_NXTHDR(&msg, header);
+ if (header == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "unexpected NULL result from CMSG_NXTHDR(iv)");
+ goto finally;
+ }
+ header->cmsg_level = SOL_ALG;
+ header->cmsg_type = ALG_SET_IV;
+ header->cmsg_len = CMSG_SPACE(sizeof(*alg_iv) + iv.len);
+ alg_iv = (void*)CMSG_DATA(header);
+ alg_iv->ivlen = iv.len;
+ memcpy(alg_iv->iv, iv.buf, iv.len);
+ }
+
+ /* set length of associated data for AEAD */
+ if (assoclen >= 0) {
+ header = CMSG_NXTHDR(&msg, header);
+ if (header == NULL) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "unexpected NULL result from CMSG_NXTHDR(assoc)");
+ goto finally;
+ }
+ header->cmsg_level = SOL_ALG;
+ header->cmsg_type = ALG_SET_AEAD_ASSOCLEN;
+ header->cmsg_len = CMSG_LEN(4);
+ uiptr = (void*)CMSG_DATA(header);
+ *uiptr = (unsigned int)assoclen;
+ }
+
+ ctx.msg = &msg;
+ ctx.flags = flags;
+ if (sock_call(self, 1, sock_sendmsg_impl, &ctx) < 0) {
+ goto finally;
+ }
+
+ retval = PyLong_FromSsize_t(ctx.result);
+
+ finally:
+ PyMem_Free(controlbuf);
+ if (iv.buf != NULL) {
+ PyBuffer_Release(&iv);
+ }
+ PyMem_Free(msg.msg_iov);
+ for (i = 0; i < ndatabufs; i++) {
+ PyBuffer_Release(&databufs[i]);
+ }
+ PyMem_Free(databufs);
+ return retval;
+}
+
+PyDoc_STRVAR(sendmsg_afalg_doc,
+"sendmsg_afalg([msg], *, op[, iv[, assoclen[, flags=MSG_MORE]]])\n\
+\n\
+Set operation mode, IV and length of associated data for an AF_ALG\n\
+operation socket.");
+#endif
+
+#ifdef HAVE_SHUTDOWN
+/* s.shutdown(how) method */
+
+static PyObject *
+sock_shutdown(PySocketSockObject *s, PyObject *arg)
+{
+ int how;
+ int res;
+
+ how = _PyLong_AsInt(arg);
+ if (how == -1 && PyErr_Occurred())
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+ res = shutdown(s->sock_fd, how);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return s->errorhandler();
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(shutdown_doc,
+"shutdown(flag)\n\
+\n\
+Shut down the reading side of the socket (flag == SHUT_RD), the writing side\n\
+of the socket (flag == SHUT_WR), or both ends (flag == SHUT_RDWR).");
+#endif
+
+#if defined(MS_WINDOWS) && defined(SIO_RCVALL)
+static PyObject*
+sock_ioctl(PySocketSockObject *s, PyObject *arg)
+{
+ unsigned long cmd = SIO_RCVALL;
+ PyObject *argO;
+ DWORD recv;
+
+ if (!PyArg_ParseTuple(arg, "kO:ioctl", &cmd, &argO))
+ return NULL;
+
+ switch (cmd) {
+ case SIO_RCVALL: {
+ unsigned int option = RCVALL_ON;
+ if (!PyArg_ParseTuple(arg, "kI:ioctl", &cmd, &option))
+ return NULL;
+ if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
+ NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) {
+ return set_error();
+ }
+ return PyLong_FromUnsignedLong(recv); }
+ case SIO_KEEPALIVE_VALS: {
+ struct tcp_keepalive ka;
+ if (!PyArg_ParseTuple(arg, "k(kkk):ioctl", &cmd,
+ &ka.onoff, &ka.keepalivetime, &ka.keepaliveinterval))
+ return NULL;
+ if (WSAIoctl(s->sock_fd, cmd, &ka, sizeof(ka),
+ NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) {
+ return set_error();
+ }
+ return PyLong_FromUnsignedLong(recv); }
+#if defined(SIO_LOOPBACK_FAST_PATH)
+ case SIO_LOOPBACK_FAST_PATH: {
+ unsigned int option;
+ if (!PyArg_ParseTuple(arg, "kI:ioctl", &cmd, &option))
+ return NULL;
+ if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option),
+ NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) {
+ return set_error();
+ }
+ return PyLong_FromUnsignedLong(recv); }
+#endif
+ default:
+ PyErr_Format(PyExc_ValueError, "invalid ioctl command %lu", cmd);
+ return NULL;
+ }
+}
+PyDoc_STRVAR(sock_ioctl_doc,
+"ioctl(cmd, option) -> long\n\
+\n\
+Control the socket with WSAIoctl syscall. Currently supported 'cmd' values are\n\
+SIO_RCVALL: 'option' must be one of the socket.RCVALL_* constants.\n\
+SIO_KEEPALIVE_VALS: 'option' is a tuple of (onoff, timeout, interval).\n\
+SIO_LOOPBACK_FAST_PATH: 'option' is a boolean value, and is disabled by default");
+#endif
+
+#if defined(MS_WINDOWS)
+static PyObject*
+sock_share(PySocketSockObject *s, PyObject *arg)
+{
+ WSAPROTOCOL_INFOW info;
+ DWORD processId;
+ int result;
+
+ if (!PyArg_ParseTuple(arg, "I", &processId))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = WSADuplicateSocketW(s->sock_fd, processId, &info);
+ Py_END_ALLOW_THREADS
+ if (result == SOCKET_ERROR)
+ return set_error();
+ return PyBytes_FromStringAndSize((const char*)&info, sizeof(info));
+}
+PyDoc_STRVAR(sock_share_doc,
+"share(process_id) -> bytes\n\
+\n\
+Share the socket with another process. The target process id\n\
+must be provided and the resulting bytes object passed to the target\n\
+process. There the shared socket can be instantiated by calling\n\
+socket.fromshare().");
+
+
+#endif
+
+/* List of methods for socket objects */
+
+static PyMethodDef sock_methods[] = {
+#if defined(HAVE_ACCEPT) || defined(HAVE_ACCEPT4)
+ {"_accept", (PyCFunction)sock_accept, METH_NOARGS,
+ accept_doc},
+#endif
+#ifdef HAVE_BIND
+ {"bind", (PyCFunction)sock_bind, METH_O,
+ bind_doc},
+#endif
+ {"close", (PyCFunction)sock_close, METH_NOARGS,
+ sock_close_doc},
+#ifdef HAVE_CONNECT
+ {"connect", (PyCFunction)sock_connect, METH_O,
+ connect_doc},
+ {"connect_ex", (PyCFunction)sock_connect_ex, METH_O,
+ connect_ex_doc},
+#endif
+ {"detach", (PyCFunction)sock_detach, METH_NOARGS,
+ detach_doc},
+ {"fileno", (PyCFunction)sock_fileno, METH_NOARGS,
+ fileno_doc},
+#ifdef HAVE_GETPEERNAME
+ {"getpeername", (PyCFunction)sock_getpeername,
+ METH_NOARGS, getpeername_doc},
+#endif
+#ifdef HAVE_GETSOCKNAME
+ {"getsockname", (PyCFunction)sock_getsockname,
+ METH_NOARGS, getsockname_doc},
+#endif
+ {"getsockopt", (PyCFunction)sock_getsockopt, METH_VARARGS,
+ getsockopt_doc},
+#if defined(MS_WINDOWS) && defined(SIO_RCVALL)
+ {"ioctl", (PyCFunction)sock_ioctl, METH_VARARGS,
+ sock_ioctl_doc},
+#endif
+#if defined(MS_WINDOWS)
+ {"share", (PyCFunction)sock_share, METH_VARARGS,
+ sock_share_doc},
+#endif
+#ifdef HAVE_LISTEN
+ {"listen", (PyCFunction)sock_listen, METH_VARARGS,
+ listen_doc},
+#endif
+ {"recv", (PyCFunction)sock_recv, METH_VARARGS,
+ recv_doc},
+ {"recv_into", _PyCFunction_CAST(sock_recv_into), METH_VARARGS | METH_KEYWORDS,
+ recv_into_doc},
+#ifdef HAVE_RECVFROM
+ {"recvfrom", (PyCFunction)sock_recvfrom, METH_VARARGS,
+ recvfrom_doc},
+ {"recvfrom_into", _PyCFunction_CAST(sock_recvfrom_into), METH_VARARGS | METH_KEYWORDS,
+ recvfrom_into_doc},
+#endif
+ {"send", (PyCFunction)sock_send, METH_VARARGS,
+ send_doc},
+ {"sendall", (PyCFunction)sock_sendall, METH_VARARGS,
+ sendall_doc},
+#ifdef HAVE_SENDTO
+ {"sendto", (PyCFunction)sock_sendto, METH_VARARGS,
+ sendto_doc},
+#endif
+ {"setblocking", (PyCFunction)sock_setblocking, METH_O,
+ setblocking_doc},
+ {"getblocking", (PyCFunction)sock_getblocking, METH_NOARGS,
+ getblocking_doc},
+ {"settimeout", (PyCFunction)sock_settimeout, METH_O,
+ settimeout_doc},
+ {"gettimeout", (PyCFunction)sock_gettimeout, METH_NOARGS,
+ gettimeout_doc},
+#ifdef HAVE_SETSOCKOPT
+ {"setsockopt", (PyCFunction)sock_setsockopt, METH_VARARGS,
+ setsockopt_doc},
+#endif
+#ifdef HAVE_SHUTDOWN
+ {"shutdown", (PyCFunction)sock_shutdown, METH_O,
+ shutdown_doc},
+#endif
+#ifdef CMSG_LEN
+ {"recvmsg", (PyCFunction)sock_recvmsg, METH_VARARGS,
+ recvmsg_doc},
+ {"recvmsg_into", (PyCFunction)sock_recvmsg_into, METH_VARARGS,
+ recvmsg_into_doc,},
+ {"sendmsg", (PyCFunction)sock_sendmsg, METH_VARARGS,
+ sendmsg_doc},
+#endif
+#ifdef HAVE_SOCKADDR_ALG
+ {"sendmsg_afalg", _PyCFunction_CAST(sock_sendmsg_afalg), METH_VARARGS | METH_KEYWORDS,
+ sendmsg_afalg_doc},
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+/* SockObject members */
+static PyMemberDef sock_memberlist[] = {
+ {"family", T_INT, offsetof(PySocketSockObject, sock_family), READONLY, "the socket family"},
+ {"type", T_INT, offsetof(PySocketSockObject, sock_type), READONLY, "the socket type"},
+ {"proto", T_INT, offsetof(PySocketSockObject, sock_proto), READONLY, "the socket protocol"},
+ {0},
+};
+
+static PyGetSetDef sock_getsetlist[] = {
+ {"timeout", (getter)sock_gettimeout, NULL, PyDoc_STR("the socket timeout")},
+ {NULL} /* sentinel */
+};
+
+/* Deallocate a socket object in response to the last Py_DECREF().
+ First close the file description. */
+
+static void
+sock_finalize(PySocketSockObject *s)
+{
+ SOCKET_T fd;
+
+ /* Save the current exception, if any. */
+ PyObject *exc = PyErr_GetRaisedException();
+
+ if (s->sock_fd != INVALID_SOCKET) {
+ if (PyErr_ResourceWarning((PyObject *)s, 1, "unclosed %R", s)) {
+ /* Spurious errors can appear at shutdown */
+ if (PyErr_ExceptionMatches(PyExc_Warning)) {
+ PyErr_WriteUnraisable((PyObject *)s);
+ }
+ }
+
+ /* Only close the socket *after* logging the ResourceWarning warning
+ to allow the logger to call socket methods like
+ socket.getsockname(). If the socket is closed before, socket
+ methods fails with the EBADF error. */
+ fd = s->sock_fd;
+ s->sock_fd = INVALID_SOCKET;
+
+ /* We do not want to retry upon EINTR: see sock_close() */
+ Py_BEGIN_ALLOW_THREADS
+ (void) SOCKETCLOSE(fd);
+ Py_END_ALLOW_THREADS
+ }
+
+ /* Restore the saved exception. */
+ PyErr_SetRaisedException(exc);
+}
+
+static int
+sock_traverse(PySocketSockObject *s, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(s));
+ return 0;
+}
+
+static void
+sock_dealloc(PySocketSockObject *s)
+{
+ if (PyObject_CallFinalizerFromDealloc((PyObject *)s) < 0) {
+ return;
+ }
+ PyTypeObject *tp = Py_TYPE(s);
+ PyObject_GC_UnTrack(s);
+ tp->tp_free((PyObject *)s);
+ Py_DECREF(tp);
+}
+
+
+static PyObject *
+sock_repr(PySocketSockObject *s)
+{
+ long sock_fd;
+ /* On Windows, this test is needed because SOCKET_T is unsigned */
+ if (s->sock_fd == INVALID_SOCKET) {
+ sock_fd = -1;
+ }
+#if SIZEOF_SOCKET_T > SIZEOF_LONG
+ else if (s->sock_fd > LONG_MAX) {
+ /* this can occur on Win64, and actually there is a special
+ ugly printf formatter for decimal pointer length integer
+ printing, only bother if necessary*/
+ PyErr_SetString(PyExc_OverflowError,
+ "no printf formatter to display "
+ "the socket descriptor in decimal");
+ return NULL;
+ }
+#endif
+ else
+ sock_fd = (long)s->sock_fd;
+ return PyUnicode_FromFormat(
+ "<socket object, fd=%ld, family=%d, type=%d, proto=%d>",
+ sock_fd, s->sock_family,
+ s->sock_type,
+ s->sock_proto);
+}
+
+
+/* Create a new, uninitialized socket object. */
+
+static PyObject *
+sock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+{
+ PyObject *new;
+
+ new = type->tp_alloc(type, 0);
+ if (new != NULL) {
+ ((PySocketSockObject *)new)->sock_fd = INVALID_SOCKET;
+ ((PySocketSockObject *)new)->sock_timeout = _PyTime_FromSeconds(-1);
+ ((PySocketSockObject *)new)->errorhandler = &set_error;
+ }
+ return new;
+}
+
+
+/* Initialize a new socket object. */
+
+/*ARGSUSED*/
+
+#ifndef HAVE_SOCKET
+#define socket stub_socket
+static int
+socket(int domain, int type, int protocol)
+{
+ errno = ENOTSUP;
+ return INVALID_SOCKET;
+}
+#endif
+
+/*[clinic input]
+_socket.socket.__init__ as sock_initobj
+ family: int = -1
+ type: int = -1
+ proto: int = -1
+ fileno as fdobj: object = NULL
+[clinic start generated code]*/
+
+static int
+sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
+ PyObject *fdobj)
+/*[clinic end generated code: output=d114d026b9a9a810 input=04cfc32953f5cc25]*/
+{
+
+ SOCKET_T fd = INVALID_SOCKET;
+ socket_state *state = find_module_state_by_def(Py_TYPE(self));
+
+#ifndef MS_WINDOWS
+#ifdef SOCK_CLOEXEC
+ int *atomic_flag_works = &state->sock_cloexec_works;
+#else
+ int *atomic_flag_works = NULL;
+#endif
+#endif
+
+#ifdef MS_WINDOWS
+ /* In this case, we don't use the family, type and proto args */
+ if (fdobj == NULL || fdobj == Py_None)
+#endif
+ {
+ if (PySys_Audit("socket.__new__", "Oiii",
+ self, family, type, proto) < 0) {
+ return -1;
+ }
+ }
+
+ if (fdobj != NULL && fdobj != Py_None) {
+#ifdef MS_WINDOWS
+ /* recreate a socket that was duplicated */
+ if (PyBytes_Check(fdobj)) {
+ WSAPROTOCOL_INFOW info;
+ if (PyBytes_GET_SIZE(fdobj) != sizeof(info)) {
+ PyErr_Format(PyExc_ValueError,
+ "socket descriptor string has wrong size, "
+ "should be %zu bytes.", sizeof(info));
+ return -1;
+ }
+ memcpy(&info, PyBytes_AS_STRING(fdobj), sizeof(info));
+
+ if (PySys_Audit("socket.__new__", "Oiii", self,
+ info.iAddressFamily, info.iSocketType,
+ info.iProtocol) < 0) {
+ return -1;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ fd = WSASocketW(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
+ FROM_PROTOCOL_INFO, &info, 0, WSA_FLAG_OVERLAPPED);
+ Py_END_ALLOW_THREADS
+ if (fd == INVALID_SOCKET) {
+ set_error();
+ return -1;
+ }
+
+ if (!SetHandleInformation((HANDLE)fd, HANDLE_FLAG_INHERIT, 0)) {
+ PyErr_SetFromWindowsErr(0);
+ closesocket(fd);
+ return -1;
+ }
+
+ family = info.iAddressFamily;
+ type = info.iSocketType;
+ proto = info.iProtocol;
+ }
+ else
+#endif
+ {
+ fd = PyLong_AsSocket_t(fdobj);
+ if (fd == (SOCKET_T)(-1) && PyErr_Occurred())
+ return -1;
+#ifdef MS_WINDOWS
+ if (fd == INVALID_SOCKET) {
+#else
+ if (fd < 0) {
+#endif
+ PyErr_SetString(PyExc_ValueError, "negative file descriptor");
+ return -1;
+ }
+
+ /* validate that passed file descriptor is valid and a socket. */
+ sock_addr_t addrbuf;
+ socklen_t addrlen = sizeof(sock_addr_t);
+
+ memset(&addrbuf, 0, addrlen);
+#ifdef HAVE_GETSOCKNAME
+ if (getsockname(fd, SAS2SA(&addrbuf), &addrlen) == 0) {
+ if (family == -1) {
+ family = SAS2SA(&addrbuf)->sa_family;
+ }
+ } else {
+#ifdef MS_WINDOWS
+ /* getsockname() on an unbound socket is an error on Windows.
+ Invalid descriptor and not a socket is same error code.
+ Error out if family must be resolved, or bad descriptor. */
+ if (family == -1 || CHECK_ERRNO(ENOTSOCK)) {
+#else
+ /* getsockname() is not supported for SOL_ALG on Linux. */
+ if (family == -1 || CHECK_ERRNO(EBADF) || CHECK_ERRNO(ENOTSOCK)) {
+#endif
+ set_error();
+ return -1;
+ }
+ }
+#endif // HAVE_GETSOCKNAME
+#ifdef SO_TYPE
+ if (type == -1) {
+ int tmp;
+ socklen_t slen = sizeof(tmp);
+ if (getsockopt(fd, SOL_SOCKET, SO_TYPE,
+ (void *)&tmp, &slen) == 0)
+ {
+ type = tmp;
+ } else {
+ set_error();
+ return -1;
+ }
+ }
+#else
+ type = SOCK_STREAM;
+#endif
+#ifdef SO_PROTOCOL
+ if (proto == -1) {
+ int tmp;
+ socklen_t slen = sizeof(tmp);
+ if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL,
+ (void *)&tmp, &slen) == 0)
+ {
+ proto = tmp;
+ } else {
+ set_error();
+ return -1;
+ }
+ }
+#else
+ proto = 0;
+#endif
+ }
+ }
+ else {
+ /* No fd, default to AF_INET and SOCK_STREAM */
+ if (family == -1) {
+ family = AF_INET;
+ }
+ if (type == -1) {
+ type = SOCK_STREAM;
+ }
+ if (proto == -1) {
+ proto = 0;
+ }
+#ifdef MS_WINDOWS
+ Py_BEGIN_ALLOW_THREADS
+ fd = WSASocketW(family, type, proto,
+ NULL, 0,
+ WSA_FLAG_OVERLAPPED | WSA_FLAG_NO_HANDLE_INHERIT);
+ Py_END_ALLOW_THREADS
+
+ if (fd == INVALID_SOCKET) {
+ set_error();
+ return -1;
+ }
+#else
+ /* UNIX */
+ Py_BEGIN_ALLOW_THREADS
+#ifdef SOCK_CLOEXEC
+ if (state->sock_cloexec_works != 0) {
+ fd = socket(family, type | SOCK_CLOEXEC, proto);
+ if (state->sock_cloexec_works == -1) {
+ if (fd >= 0) {
+ state->sock_cloexec_works = 1;
+ }
+ else if (errno == EINVAL) {
+ /* Linux older than 2.6.27 does not support SOCK_CLOEXEC */
+ state->sock_cloexec_works = 0;
+ fd = socket(family, type, proto);
+ }
+ }
+ }
+ else
+#endif
+ {
+ fd = socket(family, type, proto);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (fd == INVALID_SOCKET) {
+ set_error();
+ return -1;
+ }
+
+ if (_Py_set_inheritable(fd, 0, atomic_flag_works) < 0) {
+ SOCKETCLOSE(fd);
+ return -1;
+ }
+#endif
+ }
+ if (init_sockobject(state, self, fd, family, type, proto) == -1) {
+ SOCKETCLOSE(fd);
+ return -1;
+ }
+
+ return 0;
+
+}
+
+
+/* Type object for socket objects. */
+
+static PyType_Slot sock_slots[] = {
+ {Py_tp_dealloc, sock_dealloc},
+ {Py_tp_traverse, sock_traverse},
+ {Py_tp_repr, sock_repr},
+ {Py_tp_doc, (void *)sock_doc},
+ {Py_tp_methods, sock_methods},
+ {Py_tp_members, sock_memberlist},
+ {Py_tp_getset, sock_getsetlist},
+ {Py_tp_init, sock_initobj},
+ {Py_tp_new, sock_new},
+ {Py_tp_finalize, sock_finalize},
+ {0, NULL},
+};
+
+static PyType_Spec sock_spec = {
+ .name = "_socket.socket",
+ .basicsize = sizeof(PySocketSockObject),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = sock_slots,
+};
+
+
+#ifdef HAVE_GETHOSTNAME
+/* Python interface to gethostname(). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_gethostname(PyObject *self, PyObject *unused)
+{
+ if (PySys_Audit("socket.gethostname", NULL) < 0) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ /* Don't use winsock's gethostname, as this returns the ANSI
+ version of the hostname, whereas we need a Unicode string.
+ Otherwise, gethostname apparently also returns the DNS name. */
+ wchar_t buf[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD size = Py_ARRAY_LENGTH(buf);
+ wchar_t *name;
+ PyObject *result;
+
+ if (GetComputerNameExW(ComputerNamePhysicalDnsHostname, buf, &size))
+ return PyUnicode_FromWideChar(buf, size);
+
+ if (GetLastError() != ERROR_MORE_DATA)
+ return PyErr_SetFromWindowsErr(0);
+
+ if (size == 0)
+ return PyUnicode_New(0, 0);
+
+ /* MSDN says ERROR_MORE_DATA may occur because DNS allows longer
+ names */
+ name = PyMem_New(wchar_t, size);
+ if (!name) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ if (!GetComputerNameExW(ComputerNamePhysicalDnsHostname,
+ name,
+ &size))
+ {
+ PyErr_SetFromWindowsErr(0);
+ PyMem_Free(name);
+ return NULL;
+ }
+
+ result = PyUnicode_FromWideChar(name, size);
+ PyMem_Free(name);
+ return result;
+#else
+ char buf[1024];
+ int res;
+ Py_BEGIN_ALLOW_THREADS
+ res = gethostname(buf, (int) sizeof buf - 1);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return set_error();
+ buf[sizeof buf - 1] = '\0';
+ return PyUnicode_DecodeFSDefault(buf);
+#endif
+}
+
+PyDoc_STRVAR(gethostname_doc,
+"gethostname() -> string\n\
+\n\
+Return the current host name.");
+#endif
+
+#ifdef HAVE_SETHOSTNAME
+PyDoc_STRVAR(sethostname_doc,
+"sethostname(name)\n\n\
+Sets the hostname to name.");
+
+static PyObject *
+socket_sethostname(PyObject *self, PyObject *args)
+{
+ PyObject *hnobj;
+ Py_buffer buf;
+ int res, flag = 0;
+
+#if defined(_AIX) || (defined(__sun) && defined(__SVR4) && Py_SUNOS_VERSION <= 510)
+/* issue #18259, sethostname is not declared in any useful header file on AIX
+ * the same is true for Solaris 10 */
+extern int sethostname(const char *, size_t);
+#endif
+
+ if (!PyArg_ParseTuple(args, "S:sethostname", &hnobj)) {
+ PyErr_Clear();
+ if (!PyArg_ParseTuple(args, "O&:sethostname",
+ PyUnicode_FSConverter, &hnobj))
+ return NULL;
+ flag = 1;
+ }
+
+ if (PySys_Audit("socket.sethostname", "(O)", hnobj) < 0) {
+ return NULL;
+ }
+
+ res = PyObject_GetBuffer(hnobj, &buf, PyBUF_SIMPLE);
+ if (!res) {
+ res = sethostname(buf.buf, buf.len);
+ PyBuffer_Release(&buf);
+ }
+ if (flag)
+ Py_DECREF(hnobj);
+ if (res)
+ return set_error();
+ Py_RETURN_NONE;
+}
+#endif
+
+#ifdef HAVE_GETADDRINFO
+/* Python interface to gethostbyname(name). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_gethostbyname(PyObject *self, PyObject *args)
+{
+ char *name;
+ struct sockaddr_in addrbuf;
+ PyObject *ret = NULL;
+
+ if (!PyArg_ParseTuple(args, "et:gethostbyname", "idna", &name))
+ return NULL;
+ if (PySys_Audit("socket.gethostbyname", "O", args) < 0) {
+ goto finally;
+ }
+ socket_state *state = get_module_state(self);
+ int rc = setipaddr(state, name, (struct sockaddr *)&addrbuf,
+ sizeof(addrbuf), AF_INET);
+ if (rc < 0) {
+ goto finally;
+ }
+ ret = make_ipv4_addr(&addrbuf);
+finally:
+ PyMem_Free(name);
+ return ret;
+}
+
+PyDoc_STRVAR(gethostbyname_doc,
+"gethostbyname(host) -> address\n\
+\n\
+Return the IP address (a string of the form '255.255.255.255') for a host.");
+#endif
+
+
+#if defined(HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYNAME) || defined (HAVE_GETHOSTBYADDR)
+static PyObject*
+sock_decode_hostname(const char *name)
+{
+#ifdef MS_WINDOWS
+ /* Issue #26227: gethostbyaddr() returns a string encoded
+ * to the ANSI code page */
+ return PyUnicode_DecodeMBCS(name, strlen(name), "surrogatepass");
+#else
+ /* Decode from UTF-8 */
+ return PyUnicode_FromString(name);
+#endif
+}
+
+/* Convenience function common to gethostbyname_ex and gethostbyaddr */
+
+static PyObject *
+gethost_common(socket_state *state, struct hostent *h, struct sockaddr *addr,
+ size_t alen, int af)
+{
+ char **pch;
+ PyObject *rtn_tuple = (PyObject *)NULL;
+ PyObject *name_list = (PyObject *)NULL;
+ PyObject *addr_list = (PyObject *)NULL;
+ PyObject *tmp;
+ PyObject *name;
+
+ if (h == NULL) {
+ /* Let's get real error message to return */
+ set_herror(state, h_errno);
+ return NULL;
+ }
+
+ if (h->h_addrtype != af) {
+ /* Let's get real error message to return */
+ errno = EAFNOSUPPORT;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ switch (af) {
+
+ case AF_INET:
+ if (alen < sizeof(struct sockaddr_in))
+ return NULL;
+ break;
+
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ if (alen < sizeof(struct sockaddr_in6))
+ return NULL;
+ break;
+#endif
+
+ }
+
+ if ((name_list = PyList_New(0)) == NULL)
+ goto err;
+
+ if ((addr_list = PyList_New(0)) == NULL)
+ goto err;
+
+ /* SF #1511317: h_aliases can be NULL */
+ if (h->h_aliases) {
+ for (pch = h->h_aliases; ; pch++) {
+ int status;
+ char *host_alias;
+ // pch can be misaligned
+ memcpy(&host_alias, pch, sizeof(host_alias));
+ if (host_alias == NULL) {
+ break;
+ }
+ tmp = PyUnicode_FromString(host_alias);
+ if (tmp == NULL)
+ goto err;
+
+ status = PyList_Append(name_list, tmp);
+ Py_DECREF(tmp);
+
+ if (status)
+ goto err;
+ }
+ }
+
+ for (pch = h->h_addr_list; ; pch++) {
+ int status;
+ char *host_address;
+ // pch can be misaligned
+ memcpy(&host_address, pch, sizeof(host_address));
+ if (host_address == NULL) {
+ break;
+ }
+
+ switch (af) {
+
+ case AF_INET:
+ {
+ struct sockaddr_in sin;
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = af;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin.sin_len = sizeof(sin);
+#endif
+ memcpy(&sin.sin_addr, host_address, sizeof(sin.sin_addr));
+ tmp = make_ipv4_addr(&sin);
+
+ if (pch == h->h_addr_list && alen >= sizeof(sin))
+ memcpy((char *) addr, &sin, sizeof(sin));
+ break;
+ }
+
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = af;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin6.sin6_len = sizeof(sin6);
+#endif
+ memcpy(&sin6.sin6_addr, host_address, sizeof(sin6.sin6_addr));
+ tmp = make_ipv6_addr(&sin6);
+
+ if (pch == h->h_addr_list && alen >= sizeof(sin6))
+ memcpy((char *) addr, &sin6, sizeof(sin6));
+ break;
+ }
+#endif
+
+ default: /* can't happen */
+ PyErr_SetString(PyExc_OSError,
+ "unsupported address family");
+ return NULL;
+ }
+
+ if (tmp == NULL)
+ goto err;
+
+ status = PyList_Append(addr_list, tmp);
+ Py_DECREF(tmp);
+
+ if (status)
+ goto err;
+ }
+
+ name = sock_decode_hostname(h->h_name);
+ if (name == NULL)
+ goto err;
+ rtn_tuple = Py_BuildValue("NOO", name, name_list, addr_list);
+
+ err:
+ Py_XDECREF(name_list);
+ Py_XDECREF(addr_list);
+ return rtn_tuple;
+}
+#endif
+
+#if defined(HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYNAME)
+/* Python interface to gethostbyname_ex(name). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_gethostbyname_ex(PyObject *self, PyObject *args)
+{
+ char *name;
+ struct hostent *h;
+ sock_addr_t addr;
+ struct sockaddr *sa;
+ PyObject *ret = NULL;
+#ifdef HAVE_GETHOSTBYNAME_R
+ struct hostent hp_allocated;
+#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
+ struct hostent_data data;
+#else
+ char buf[16384];
+ int buf_len = (sizeof buf) - 1;
+ int errnop;
+#endif
+#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
+ int result;
+#endif
+#endif /* HAVE_GETHOSTBYNAME_R */
+
+ if (!PyArg_ParseTuple(args, "et:gethostbyname_ex", "idna", &name))
+ return NULL;
+ if (PySys_Audit("socket.gethostbyname", "O", args) < 0) {
+ goto finally;
+ }
+ socket_state *state = get_module_state(self);
+ if (setipaddr(state, name, SAS2SA(&addr), sizeof(addr), AF_INET) < 0) {
+ goto finally;
+ }
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_GETHOSTBYNAME_R
+#if defined(HAVE_GETHOSTBYNAME_R_6_ARG)
+ gethostbyname_r(name, &hp_allocated, buf, buf_len,
+ &h, &errnop);
+#elif defined(HAVE_GETHOSTBYNAME_R_5_ARG)
+ h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
+#else /* HAVE_GETHOSTBYNAME_R_3_ARG */
+ memset((void *) &data, '\0', sizeof(data));
+ result = gethostbyname_r(name, &hp_allocated, &data);
+ h = (result != 0) ? NULL : &hp_allocated;
+#endif
+#else /* not HAVE_GETHOSTBYNAME_R */
+#ifdef USE_GETHOSTBYNAME_LOCK
+ PyThread_acquire_lock(netdb_lock, 1);
+#endif
+ SUPPRESS_DEPRECATED_CALL
+ h = gethostbyname(name);
+#endif /* HAVE_GETHOSTBYNAME_R */
+ Py_END_ALLOW_THREADS
+ /* Some C libraries would require addr.__ss_family instead of
+ addr.ss_family.
+ Therefore, we cast the sockaddr_storage into sockaddr to
+ access sa_family. */
+ sa = SAS2SA(&addr);
+ ret = gethost_common(state, h, SAS2SA(&addr), sizeof(addr),
+ sa->sa_family);
+#ifdef USE_GETHOSTBYNAME_LOCK
+ PyThread_release_lock(netdb_lock);
+#endif
+finally:
+ PyMem_Free(name);
+ return ret;
+}
+
+PyDoc_STRVAR(ghbn_ex_doc,
+"gethostbyname_ex(host) -> (name, aliaslist, addresslist)\n\
+\n\
+Return the true host name, a list of aliases, and a list of IP addresses,\n\
+for a host. The host argument is a string giving a host name or IP number.");
+#endif
+
+#if defined(HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYADDR)
+/* Python interface to gethostbyaddr(IP). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_gethostbyaddr(PyObject *self, PyObject *args)
+{
+ sock_addr_t addr;
+ struct sockaddr *sa = SAS2SA(&addr);
+ char *ip_num;
+ struct hostent *h;
+ PyObject *ret = NULL;
+#ifdef HAVE_GETHOSTBYNAME_R
+ struct hostent hp_allocated;
+#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
+ struct hostent_data data;
+#else
+ /* glibcs up to 2.10 assume that the buf argument to
+ gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc
+ does not ensure. The attribute below instructs the compiler
+ to maintain this alignment. */
+ char buf[16384] Py_ALIGNED(8);
+ int buf_len = (sizeof buf) - 1;
+ int errnop;
+#endif
+#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
+ int result;
+#endif
+#endif /* HAVE_GETHOSTBYNAME_R */
+ const char *ap;
+ int al;
+ int af;
+
+ if (!PyArg_ParseTuple(args, "et:gethostbyaddr", "idna", &ip_num))
+ return NULL;
+ if (PySys_Audit("socket.gethostbyaddr", "O", args) < 0) {
+ goto finally;
+ }
+ af = AF_UNSPEC;
+ socket_state *state = get_module_state(self);
+ if (setipaddr(state, ip_num, sa, sizeof(addr), af) < 0) {
+ goto finally;
+ }
+ af = sa->sa_family;
+ ap = NULL;
+ /* al = 0; */
+ switch (af) {
+ case AF_INET:
+ ap = (char *)&((struct sockaddr_in *)sa)->sin_addr;
+ al = sizeof(((struct sockaddr_in *)sa)->sin_addr);
+ break;
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ ap = (char *)&((struct sockaddr_in6 *)sa)->sin6_addr;
+ al = sizeof(((struct sockaddr_in6 *)sa)->sin6_addr);
+ break;
+#endif
+ default:
+ PyErr_SetString(PyExc_OSError, "unsupported address family");
+ goto finally;
+ }
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_GETHOSTBYNAME_R
+#if defined(HAVE_GETHOSTBYNAME_R_6_ARG)
+ gethostbyaddr_r(ap, al, af,
+ &hp_allocated, buf, buf_len,
+ &h, &errnop);
+#elif defined(HAVE_GETHOSTBYNAME_R_5_ARG)
+ h = gethostbyaddr_r(ap, al, af,
+ &hp_allocated, buf, buf_len, &errnop);
+#else /* HAVE_GETHOSTBYNAME_R_3_ARG */
+ memset((void *) &data, '\0', sizeof(data));
+ result = gethostbyaddr_r(ap, al, af, &hp_allocated, &data);
+ h = (result != 0) ? NULL : &hp_allocated;
+#endif
+#else /* not HAVE_GETHOSTBYNAME_R */
+#ifdef USE_GETHOSTBYNAME_LOCK
+ PyThread_acquire_lock(netdb_lock, 1);
+#endif
+ SUPPRESS_DEPRECATED_CALL
+ h = gethostbyaddr(ap, al, af);
+#endif /* HAVE_GETHOSTBYNAME_R */
+ Py_END_ALLOW_THREADS
+ ret = gethost_common(state, h, SAS2SA(&addr), sizeof(addr), af);
+#ifdef USE_GETHOSTBYNAME_LOCK
+ PyThread_release_lock(netdb_lock);
+#endif
+finally:
+ PyMem_Free(ip_num);
+ return ret;
+}
+
+PyDoc_STRVAR(gethostbyaddr_doc,
+"gethostbyaddr(host) -> (name, aliaslist, addresslist)\n\
+\n\
+Return the true host name, a list of aliases, and a list of IP addresses,\n\
+for a host. The host argument is a string giving a host name or IP number.");
+#endif
+
+#ifdef HAVE_GETSERVBYNAME
+/* Python interface to getservbyname(name).
+ This only returns the port number, since the other info is already
+ known or not useful (like the list of aliases). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_getservbyname(PyObject *self, PyObject *args)
+{
+ const char *name, *proto=NULL;
+ struct servent *sp;
+ if (!PyArg_ParseTuple(args, "s|s:getservbyname", &name, &proto))
+ return NULL;
+
+ if (PySys_Audit("socket.getservbyname", "ss", name, proto) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ sp = getservbyname(name, proto);
+ Py_END_ALLOW_THREADS
+ if (sp == NULL) {
+ PyErr_SetString(PyExc_OSError, "service/proto not found");
+ return NULL;
+ }
+ return PyLong_FromLong((long) ntohs(sp->s_port));
+}
+
+PyDoc_STRVAR(getservbyname_doc,
+"getservbyname(servicename[, protocolname]) -> integer\n\
+\n\
+Return a port number from a service name and protocol name.\n\
+The optional protocol name, if given, should be 'tcp' or 'udp',\n\
+otherwise any protocol will match.");
+#endif
+
+#ifdef HAVE_GETSERVBYPORT
+/* Python interface to getservbyport(port).
+ This only returns the service name, since the other info is already
+ known or not useful (like the list of aliases). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_getservbyport(PyObject *self, PyObject *args)
+{
+ int port;
+ const char *proto=NULL;
+ struct servent *sp;
+ if (!PyArg_ParseTuple(args, "i|s:getservbyport", &port, &proto))
+ return NULL;
+ if (port < 0 || port > 0xffff) {
+ PyErr_SetString(
+ PyExc_OverflowError,
+ "getservbyport: port must be 0-65535.");
+ return NULL;
+ }
+
+ if (PySys_Audit("socket.getservbyport", "is", port, proto) < 0) {
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ sp = getservbyport(htons((short)port), proto);
+ Py_END_ALLOW_THREADS
+ if (sp == NULL) {
+ PyErr_SetString(PyExc_OSError, "port/proto not found");
+ return NULL;
+ }
+ return PyUnicode_FromString(sp->s_name);
+}
+
+PyDoc_STRVAR(getservbyport_doc,
+"getservbyport(port[, protocolname]) -> string\n\
+\n\
+Return the service name from a port number and protocol name.\n\
+The optional protocol name, if given, should be 'tcp' or 'udp',\n\
+otherwise any protocol will match.");
+#endif
+
+#ifdef HAVE_GETPROTOBYNAME
+/* Python interface to getprotobyname(name).
+ This only returns the protocol number, since the other info is
+ already known or not useful (like the list of aliases). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_getprotobyname(PyObject *self, PyObject *args)
+{
+ const char *name;
+ struct protoent *sp;
+ if (!PyArg_ParseTuple(args, "s:getprotobyname", &name))
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+ sp = getprotobyname(name);
+ Py_END_ALLOW_THREADS
+ if (sp == NULL) {
+ PyErr_SetString(PyExc_OSError, "protocol not found");
+ return NULL;
+ }
+ return PyLong_FromLong((long) sp->p_proto);
+}
+
+PyDoc_STRVAR(getprotobyname_doc,
+"getprotobyname(name) -> integer\n\
+\n\
+Return the protocol number for the named protocol. (Rarely used.)");
+#endif
+
+static PyObject *
+socket_close(PyObject *self, PyObject *fdobj)
+{
+ SOCKET_T fd;
+ int res;
+
+ fd = PyLong_AsSocket_t(fdobj);
+ if (fd == (SOCKET_T)(-1) && PyErr_Occurred())
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+ res = SOCKETCLOSE(fd);
+ Py_END_ALLOW_THREADS
+ /* bpo-30319: The peer can already have closed the connection.
+ Python ignores ECONNRESET on close(). */
+ if (res < 0 && !CHECK_ERRNO(ECONNRESET)) {
+ return set_error();
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(close_doc,
+"close(integer) -> None\n\
+\n\
+Close an integer socket file descriptor. This is like os.close(), but for\n\
+sockets; on some platforms os.close() won't work for socket file descriptors.");
+
+#ifndef NO_DUP
+/* dup() function for socket fds */
+
+static PyObject *
+socket_dup(PyObject *self, PyObject *fdobj)
+{
+ SOCKET_T fd, newfd;
+ PyObject *newfdobj;
+#ifdef MS_WINDOWS
+ WSAPROTOCOL_INFOW info;
+#endif
+
+ fd = PyLong_AsSocket_t(fdobj);
+ if (fd == (SOCKET_T)(-1) && PyErr_Occurred()) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ if (WSADuplicateSocketW(fd, GetCurrentProcessId(), &info))
+ return set_error();
+
+ newfd = WSASocketW(FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
+ FROM_PROTOCOL_INFO,
+ &info, 0, WSA_FLAG_OVERLAPPED);
+ if (newfd == INVALID_SOCKET) {
+ return set_error();
+ }
+
+ if (!SetHandleInformation((HANDLE)newfd, HANDLE_FLAG_INHERIT, 0)) {
+ PyErr_SetFromWindowsErr(0);
+ closesocket(newfd);
+ return NULL;
+ }
+#else
+ /* On UNIX, dup can be used to duplicate the file descriptor of a socket */
+ newfd = _Py_dup(fd);
+ if (newfd == INVALID_SOCKET) {
+ return NULL;
+ }
+#endif
+
+ newfdobj = PyLong_FromSocket_t(newfd);
+ if (newfdobj == NULL) {
+ SOCKETCLOSE(newfd);
+ }
+ return newfdobj;
+}
+
+PyDoc_STRVAR(dup_doc,
+"dup(integer) -> integer\n\
+\n\
+Duplicate an integer socket file descriptor. This is like os.dup(), but for\n\
+sockets; on some platforms os.dup() won't work for socket file descriptors.");
+#endif
+
+
+#ifdef HAVE_SOCKETPAIR
+/* Create a pair of sockets using the socketpair() function.
+ Arguments as for socket() except the default family is AF_UNIX if
+ defined on the platform; otherwise, the default is AF_INET. */
+
+/*ARGSUSED*/
+static PyObject *
+socket_socketpair(PyObject *self, PyObject *args)
+{
+ PySocketSockObject *s0 = NULL, *s1 = NULL;
+ SOCKET_T sv[2];
+ int family, type = SOCK_STREAM, proto = 0;
+ PyObject *res = NULL;
+ socket_state *state = get_module_state(self);
+#ifdef SOCK_CLOEXEC
+ int *atomic_flag_works = &state->sock_cloexec_works;
+#else
+ int *atomic_flag_works = NULL;
+#endif
+ int ret;
+
+#if defined(AF_UNIX)
+ family = AF_UNIX;
+#else
+ family = AF_INET;
+#endif
+ if (!PyArg_ParseTuple(args, "|iii:socketpair",
+ &family, &type, &proto))
+ return NULL;
+
+ /* Create a pair of socket fds */
+ Py_BEGIN_ALLOW_THREADS
+#ifdef SOCK_CLOEXEC
+ if (state->sock_cloexec_works != 0) {
+ ret = socketpair(family, type | SOCK_CLOEXEC, proto, sv);
+ if (state->sock_cloexec_works == -1) {
+ if (ret >= 0) {
+ state->sock_cloexec_works = 1;
+ }
+ else if (errno == EINVAL) {
+ /* Linux older than 2.6.27 does not support SOCK_CLOEXEC */
+ state->sock_cloexec_works = 0;
+ ret = socketpair(family, type, proto, sv);
+ }
+ }
+ }
+ else
+#endif
+ {
+ ret = socketpair(family, type, proto, sv);
+ }
+ Py_END_ALLOW_THREADS
+
+ if (ret < 0)
+ return set_error();
+
+ if (_Py_set_inheritable(sv[0], 0, atomic_flag_works) < 0)
+ goto finally;
+ if (_Py_set_inheritable(sv[1], 0, atomic_flag_works) < 0)
+ goto finally;
+
+ s0 = new_sockobject(state, sv[0], family, type, proto);
+ if (s0 == NULL)
+ goto finally;
+ s1 = new_sockobject(state, sv[1], family, type, proto);
+ if (s1 == NULL)
+ goto finally;
+ res = PyTuple_Pack(2, s0, s1);
+
+finally:
+ if (res == NULL) {
+ if (s0 == NULL)
+ SOCKETCLOSE(sv[0]);
+ if (s1 == NULL)
+ SOCKETCLOSE(sv[1]);
+ }
+ Py_XDECREF(s0);
+ Py_XDECREF(s1);
+ return res;
+}
+
+PyDoc_STRVAR(socketpair_doc,
+"socketpair([family[, type [, proto]]]) -> (socket object, socket object)\n\
+\n\
+Create a pair of socket objects from the sockets returned by the platform\n\
+socketpair() function.\n\
+The arguments are the same as for socket() except the default family is\n\
+AF_UNIX if defined on the platform; otherwise, the default is AF_INET.");
+
+#endif /* HAVE_SOCKETPAIR */
+
+
+static PyObject *
+socket_ntohs(PyObject *self, PyObject *args)
+{
+ int x;
+
+ if (!PyArg_ParseTuple(args, "i:ntohs", &x)) {
+ return NULL;
+ }
+ if (x < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "ntohs: can't convert negative Python int to C "
+ "16-bit unsigned integer");
+ return NULL;
+ }
+ if (x > 0xffff) {
+ PyErr_SetString(PyExc_OverflowError,
+ "ntohs: Python int too large to convert to C "
+ "16-bit unsigned integer");
+ return NULL;
+ }
+ return PyLong_FromUnsignedLong(ntohs((unsigned short)x));
+}
+
+PyDoc_STRVAR(ntohs_doc,
+"ntohs(integer) -> integer\n\
+\n\
+Convert a 16-bit unsigned integer from network to host byte order.");
+
+
+static PyObject *
+socket_ntohl(PyObject *self, PyObject *arg)
+{
+ unsigned long x;
+
+ if (PyLong_Check(arg)) {
+ x = PyLong_AsUnsignedLong(arg);
+ if (x == (unsigned long) -1 && PyErr_Occurred())
+ return NULL;
+#if SIZEOF_LONG > 4
+ {
+ unsigned long y;
+ /* only want the trailing 32 bits */
+ y = x & 0xFFFFFFFFUL;
+ if (y ^ x)
+ return PyErr_Format(PyExc_OverflowError,
+ "int larger than 32 bits");
+ x = y;
+ }
+#endif
+ }
+ else
+ return PyErr_Format(PyExc_TypeError,
+ "expected int, %s found",
+ Py_TYPE(arg)->tp_name);
+ return PyLong_FromUnsignedLong(ntohl(x));
+}
+
+PyDoc_STRVAR(ntohl_doc,
+"ntohl(integer) -> integer\n\
+\n\
+Convert a 32-bit integer from network to host byte order.");
+
+
+static PyObject *
+socket_htons(PyObject *self, PyObject *args)
+{
+ int x;
+
+ if (!PyArg_ParseTuple(args, "i:htons", &x)) {
+ return NULL;
+ }
+ if (x < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "htons: can't convert negative Python int to C "
+ "16-bit unsigned integer");
+ return NULL;
+ }
+ if (x > 0xffff) {
+ PyErr_SetString(PyExc_OverflowError,
+ "htons: Python int too large to convert to C "
+ "16-bit unsigned integer");
+ return NULL;
+ }
+ return PyLong_FromUnsignedLong(htons((unsigned short)x));
+}
+
+PyDoc_STRVAR(htons_doc,
+"htons(integer) -> integer\n\
+\n\
+Convert a 16-bit unsigned integer from host to network byte order.");
+
+
+static PyObject *
+socket_htonl(PyObject *self, PyObject *arg)
+{
+ unsigned long x;
+
+ if (PyLong_Check(arg)) {
+ x = PyLong_AsUnsignedLong(arg);
+ if (x == (unsigned long) -1 && PyErr_Occurred())
+ return NULL;
+#if SIZEOF_LONG > 4
+ {
+ unsigned long y;
+ /* only want the trailing 32 bits */
+ y = x & 0xFFFFFFFFUL;
+ if (y ^ x)
+ return PyErr_Format(PyExc_OverflowError,
+ "int larger than 32 bits");
+ x = y;
+ }
+#endif
+ }
+ else
+ return PyErr_Format(PyExc_TypeError,
+ "expected int, %s found",
+ Py_TYPE(arg)->tp_name);
+ return PyLong_FromUnsignedLong(htonl((unsigned long)x));
+}
+
+PyDoc_STRVAR(htonl_doc,
+"htonl(integer) -> integer\n\
+\n\
+Convert a 32-bit integer from host to network byte order.");
+
+/* socket.inet_aton() and socket.inet_ntoa() functions. */
+
+PyDoc_STRVAR(inet_aton_doc,
+"inet_aton(string) -> bytes giving packed 32-bit IP representation\n\
+\n\
+Convert an IP address in string format (123.45.67.89) to the 32-bit packed\n\
+binary format used in low-level network functions.");
+
+static PyObject*
+socket_inet_aton(PyObject *self, PyObject *args)
+{
+#ifdef HAVE_INET_ATON
+ struct in_addr buf;
+#endif
+
+#if !defined(HAVE_INET_ATON) || defined(USE_INET_ATON_WEAKLINK)
+#if (SIZEOF_INT != 4)
+#error "Not sure if in_addr_t exists and int is not 32-bits."
+#endif
+ /* Have to use inet_addr() instead */
+ unsigned int packed_addr;
+#endif
+ const char *ip_addr;
+
+ if (!PyArg_ParseTuple(args, "s:inet_aton", &ip_addr))
+ return NULL;
+
+
+#ifdef HAVE_INET_ATON
+
+#ifdef USE_INET_ATON_WEAKLINK
+ if (inet_aton != NULL) {
+#endif
+ if (inet_aton(ip_addr, &buf))
+ return PyBytes_FromStringAndSize((char *)(&buf),
+ sizeof(buf));
+
+ PyErr_SetString(PyExc_OSError,
+ "illegal IP address string passed to inet_aton");
+ return NULL;
+
+#ifdef USE_INET_ATON_WEAKLINK
+ } else {
+#endif
+
+#endif
+
+#if !defined(HAVE_INET_ATON) || defined(USE_INET_ATON_WEAKLINK)
+
+ /* special-case this address as inet_addr might return INADDR_NONE
+ * for this */
+ if (strcmp(ip_addr, "255.255.255.255") == 0) {
+ packed_addr = INADDR_BROADCAST;
+ } else {
+
+ SUPPRESS_DEPRECATED_CALL
+ packed_addr = inet_addr(ip_addr);
+
+ if (packed_addr == INADDR_NONE) { /* invalid address */
+ PyErr_SetString(PyExc_OSError,
+ "illegal IP address string passed to inet_aton");
+ return NULL;
+ }
+ }
+ return PyBytes_FromStringAndSize((char *) &packed_addr,
+ sizeof(packed_addr));
+
+#ifdef USE_INET_ATON_WEAKLINK
+ }
+#endif
+
+#endif
+}
+
+#ifdef HAVE_INET_NTOA
+PyDoc_STRVAR(inet_ntoa_doc,
+"inet_ntoa(packed_ip) -> ip_address_string\n\
+\n\
+Convert an IP address from 32-bit packed binary format to string format");
+
+static PyObject*
+socket_inet_ntoa(PyObject *self, PyObject *args)
+{
+ Py_buffer packed_ip;
+ struct in_addr packed_addr;
+
+ if (!PyArg_ParseTuple(args, "y*:inet_ntoa", &packed_ip)) {
+ return NULL;
+ }
+
+ if (packed_ip.len != sizeof(packed_addr)) {
+ PyErr_SetString(PyExc_OSError,
+ "packed IP wrong length for inet_ntoa");
+ PyBuffer_Release(&packed_ip);
+ return NULL;
+ }
+
+ memcpy(&packed_addr, packed_ip.buf, packed_ip.len);
+ PyBuffer_Release(&packed_ip);
+
+ SUPPRESS_DEPRECATED_CALL
+ return PyUnicode_FromString(inet_ntoa(packed_addr));
+}
+#endif // HAVE_INET_NTOA
+
+#ifdef HAVE_INET_PTON
+
+PyDoc_STRVAR(inet_pton_doc,
+"inet_pton(af, ip) -> packed IP address string\n\
+\n\
+Convert an IP address from string format to a packed string suitable\n\
+for use with low-level network functions.");
+
+static PyObject *
+socket_inet_pton(PyObject *self, PyObject *args)
+{
+ int af;
+ const char* ip;
+ int retval;
+#ifdef ENABLE_IPV6
+ char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
+#else
+ char packed[sizeof(struct in_addr)];
+#endif
+ if (!PyArg_ParseTuple(args, "is:inet_pton", &af, &ip)) {
+ return NULL;
+ }
+
+#if !defined(ENABLE_IPV6) && defined(AF_INET6)
+ if(af == AF_INET6) {
+ PyErr_SetString(PyExc_OSError,
+ "can't use AF_INET6, IPv6 is disabled");
+ return NULL;
+ }
+#endif
+
+ retval = inet_pton(af, ip, packed);
+ if (retval < 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ } else if (retval == 0) {
+ PyErr_SetString(PyExc_OSError,
+ "illegal IP address string passed to inet_pton");
+ return NULL;
+ } else if (af == AF_INET) {
+ return PyBytes_FromStringAndSize(packed,
+ sizeof(struct in_addr));
+#ifdef ENABLE_IPV6
+ } else if (af == AF_INET6) {
+ return PyBytes_FromStringAndSize(packed,
+ sizeof(struct in6_addr));
+#endif
+ } else {
+ PyErr_SetString(PyExc_OSError, "unknown address family");
+ return NULL;
+ }
+}
+
+PyDoc_STRVAR(inet_ntop_doc,
+"inet_ntop(af, packed_ip) -> string formatted IP address\n\
+\n\
+Convert a packed IP address of the given family to string format.");
+
+static PyObject *
+socket_inet_ntop(PyObject *self, PyObject *args)
+{
+ int af;
+ Py_buffer packed_ip;
+ const char* retval;
+#ifdef ENABLE_IPV6
+ char ip[Py_MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN)];
+#else
+ char ip[INET_ADDRSTRLEN];
+#endif
+
+ if (!PyArg_ParseTuple(args, "iy*:inet_ntop", &af, &packed_ip)) {
+ return NULL;
+ }
+
+ if (af == AF_INET) {
+ if (packed_ip.len != sizeof(struct in_addr)) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid length of packed IP address string");
+ PyBuffer_Release(&packed_ip);
+ return NULL;
+ }
+#ifdef ENABLE_IPV6
+ } else if (af == AF_INET6) {
+ if (packed_ip.len != sizeof(struct in6_addr)) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid length of packed IP address string");
+ PyBuffer_Release(&packed_ip);
+ return NULL;
+ }
+#endif
+ } else {
+ PyErr_Format(PyExc_ValueError,
+ "unknown address family %d", af);
+ PyBuffer_Release(&packed_ip);
+ return NULL;
+ }
+
+ /* inet_ntop guarantee NUL-termination of resulting string. */
+ retval = inet_ntop(af, packed_ip.buf, ip, sizeof(ip));
+ if (!retval) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ PyBuffer_Release(&packed_ip);
+ return NULL;
+ } else {
+ PyBuffer_Release(&packed_ip);
+ return PyUnicode_FromString(retval);
+ }
+}
+
+#endif /* HAVE_INET_PTON */
+
+#ifdef HAVE_GETADDRINFO
+/* Python interface to getaddrinfo(host, port). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
+{
+ static char* kwnames[] = {"host", "port", "family", "type", "proto",
+ "flags", 0};
+ struct addrinfo hints, *res;
+ struct addrinfo *res0 = NULL;
+ PyObject *hobj = NULL;
+ PyObject *pobj = (PyObject *)NULL;
+ PyObject *pstr = NULL;
+ const char *hptr, *pptr;
+ int family, socktype, protocol, flags;
+ int error;
+ PyObject *all = (PyObject *)NULL;
+ PyObject *idna = NULL;
+
+ socktype = protocol = flags = 0;
+ family = AF_UNSPEC;
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iiii:getaddrinfo",
+ kwnames, &hobj, &pobj, &family, &socktype,
+ &protocol, &flags)) {
+ return NULL;
+ }
+ if (hobj == Py_None) {
+ hptr = NULL;
+ } else if (PyUnicode_Check(hobj)) {
+ idna = PyUnicode_AsEncodedString(hobj, "idna", NULL);
+ if (!idna)
+ return NULL;
+ assert(PyBytes_Check(idna));
+ hptr = PyBytes_AS_STRING(idna);
+ } else if (PyBytes_Check(hobj)) {
+ hptr = PyBytes_AsString(hobj);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "getaddrinfo() argument 1 must be string or None");
+ return NULL;
+ }
+ if (PyLong_CheckExact(pobj)) {
+ pstr = PyObject_Str(pobj);
+ if (pstr == NULL)
+ goto err;
+ assert(PyUnicode_Check(pstr));
+ pptr = PyUnicode_AsUTF8(pstr);
+ if (pptr == NULL)
+ goto err;
+ } else if (PyUnicode_Check(pobj)) {
+ pptr = PyUnicode_AsUTF8(pobj);
+ if (pptr == NULL)
+ goto err;
+ } else if (PyBytes_Check(pobj)) {
+ pptr = PyBytes_AS_STRING(pobj);
+ } else if (pobj == Py_None) {
+ pptr = (char *)NULL;
+ } else {
+ PyErr_SetString(PyExc_OSError, "Int or String expected");
+ goto err;
+ }
+#if defined(__APPLE__) && defined(AI_NUMERICSERV)
+ if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) {
+ /* On OSX up to at least OSX 10.8 getaddrinfo crashes
+ * if AI_NUMERICSERV is set and the servname is NULL or "0".
+ * This workaround avoids a segfault in libsystem.
+ */
+ pptr = "00";
+ }
+#endif
+
+ if (PySys_Audit("socket.getaddrinfo", "OOiii",
+ hobj, pobj, family, socktype, protocol) < 0) {
+ return NULL;
+ }
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = family;
+ hints.ai_socktype = socktype;
+ hints.ai_protocol = protocol;
+ hints.ai_flags = flags;
+ Py_BEGIN_ALLOW_THREADS
+ error = getaddrinfo(hptr, pptr, &hints, &res0);
+ Py_END_ALLOW_THREADS
+ if (error) {
+ res0 = NULL; // gh-100795
+ socket_state *state = get_module_state(self);
+ set_gaierror(state, error);
+ goto err;
+ }
+
+ all = PyList_New(0);
+ if (all == NULL)
+ goto err;
+ for (res = res0; res; res = res->ai_next) {
+ PyObject *single;
+ PyObject *addr =
+ makesockaddr(-1, res->ai_addr, res->ai_addrlen, protocol);
+ if (addr == NULL)
+ goto err;
+ single = Py_BuildValue("iiisO", res->ai_family,
+ res->ai_socktype, res->ai_protocol,
+ res->ai_canonname ? res->ai_canonname : "",
+ addr);
+ Py_DECREF(addr);
+ if (single == NULL)
+ goto err;
+
+ if (PyList_Append(all, single)) {
+ Py_DECREF(single);
+ goto err;
+ }
+ Py_DECREF(single);
+ }
+ Py_XDECREF(idna);
+ Py_XDECREF(pstr);
+ if (res0)
+ freeaddrinfo(res0);
+ return all;
+ err:
+ Py_XDECREF(all);
+ Py_XDECREF(idna);
+ Py_XDECREF(pstr);
+ if (res0)
+ freeaddrinfo(res0);
+ return (PyObject *)NULL;
+}
+
+PyDoc_STRVAR(getaddrinfo_doc,
+"getaddrinfo(host, port [, family, type, proto, flags])\n\
+ -> list of (family, type, proto, canonname, sockaddr)\n\
+\n\
+Resolve host and port into addrinfo struct.");
+#endif // HAVE_GETADDRINFO
+
+#ifdef HAVE_GETNAMEINFO
+/* Python interface to getnameinfo(sa, flags). */
+
+/*ARGSUSED*/
+static PyObject *
+socket_getnameinfo(PyObject *self, PyObject *args)
+{
+ PyObject *sa = (PyObject *)NULL;
+ int flags;
+ const char *hostp;
+ int port;
+ unsigned int flowinfo, scope_id;
+ char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
+ struct addrinfo hints, *res = NULL;
+ int error;
+ PyObject *ret = (PyObject *)NULL;
+ PyObject *name;
+
+ flags = flowinfo = scope_id = 0;
+ if (!PyArg_ParseTuple(args, "Oi:getnameinfo", &sa, &flags))
+ return NULL;
+ if (!PyTuple_Check(sa)) {
+ PyErr_SetString(PyExc_TypeError,
+ "getnameinfo() argument 1 must be a tuple");
+ return NULL;
+ }
+ if (!PyArg_ParseTuple(sa, "si|II;getnameinfo(): illegal sockaddr argument",
+ &hostp, &port, &flowinfo, &scope_id))
+ {
+ return NULL;
+ }
+ if (flowinfo > 0xfffff) {
+ PyErr_SetString(PyExc_OverflowError,
+ "getnameinfo(): flowinfo must be 0-1048575.");
+ return NULL;
+ }
+
+ if (PySys_Audit("socket.getnameinfo", "(O)", sa) < 0) {
+ return NULL;
+ }
+
+ PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port);
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_DGRAM; /* make numeric port happy */
+ hints.ai_flags = AI_NUMERICHOST; /* don't do any name resolution */
+ Py_BEGIN_ALLOW_THREADS
+ error = getaddrinfo(hostp, pbuf, &hints, &res);
+ Py_END_ALLOW_THREADS
+ if (error) {
+ res = NULL; // gh-100795
+ socket_state *state = get_module_state(self);
+ set_gaierror(state, error);
+ goto fail;
+ }
+ if (res->ai_next) {
+ PyErr_SetString(PyExc_OSError,
+ "sockaddr resolved to multiple addresses");
+ goto fail;
+ }
+ switch (res->ai_family) {
+ case AF_INET:
+ {
+ if (PyTuple_GET_SIZE(sa) != 2) {
+ PyErr_SetString(PyExc_OSError,
+ "IPv4 sockaddr must be 2 tuple");
+ goto fail;
+ }
+ break;
+ }
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ {
+ struct sockaddr_in6 *sin6;
+ sin6 = (struct sockaddr_in6 *)res->ai_addr;
+ sin6->sin6_flowinfo = htonl(flowinfo);
+ sin6->sin6_scope_id = scope_id;
+ break;
+ }
+#endif
+ }
+ Py_BEGIN_ALLOW_THREADS
+ error = getnameinfo(res->ai_addr, (socklen_t) res->ai_addrlen,
+ hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), flags);
+ Py_END_ALLOW_THREADS
+ if (error) {
+ socket_state *state = get_module_state(self);
+ set_gaierror(state, error);
+ goto fail;
+ }
+
+ name = sock_decode_hostname(hbuf);
+ if (name == NULL)
+ goto fail;
+ ret = Py_BuildValue("Ns", name, pbuf);
+
+fail:
+ if (res)
+ freeaddrinfo(res);
+ return ret;
+}
+
+PyDoc_STRVAR(getnameinfo_doc,
+"getnameinfo(sockaddr, flags) --> (host, port)\n\
+\n\
+Get host and port for a sockaddr.");
+#endif // HAVE_GETNAMEINFO
+
+/* Python API to getting and setting the default timeout value. */
+
+static PyObject *
+socket_getdefaulttimeout(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ socket_state *state = get_module_state(self);
+ if (state->defaulttimeout < 0) {
+ Py_RETURN_NONE;
+ }
+ else {
+ double seconds = _PyTime_AsSecondsDouble(state->defaulttimeout);
+ return PyFloat_FromDouble(seconds);
+ }
+}
+
+PyDoc_STRVAR(getdefaulttimeout_doc,
+"getdefaulttimeout() -> timeout\n\
+\n\
+Returns the default timeout in seconds (float) for new socket objects.\n\
+A value of None indicates that new socket objects have no timeout.\n\
+When the socket module is first imported, the default is None.");
+
+static PyObject *
+socket_setdefaulttimeout(PyObject *self, PyObject *arg)
+{
+ _PyTime_t timeout;
+
+ if (socket_parse_timeout(&timeout, arg) < 0)
+ return NULL;
+
+ socket_state *state = get_module_state(self);
+ state->defaulttimeout = timeout;
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(setdefaulttimeout_doc,
+"setdefaulttimeout(timeout)\n\
+\n\
+Set the default timeout in seconds (float) for new socket objects.\n\
+A value of None indicates that new socket objects have no timeout.\n\
+When the socket module is first imported, the default is None.");
+
+#if defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS)
+/* Python API for getting interface indices and names */
+
+static PyObject *
+socket_if_nameindex(PyObject *self, PyObject *arg)
+{
+ PyObject *list = PyList_New(0);
+ if (list == NULL) {
+ return NULL;
+ }
+#ifdef MS_WINDOWS
+ PMIB_IF_TABLE2 tbl;
+ int ret;
+ if ((ret = GetIfTable2Ex(MibIfTableRaw, &tbl)) != NO_ERROR) {
+ Py_DECREF(list);
+ // ret is used instead of GetLastError()
+ return PyErr_SetFromWindowsErr(ret);
+ }
+ for (ULONG i = 0; i < tbl->NumEntries; ++i) {
+ MIB_IF_ROW2 r = tbl->Table[i];
+ WCHAR buf[NDIS_IF_MAX_STRING_SIZE + 1];
+ if ((ret = ConvertInterfaceLuidToNameW(&r.InterfaceLuid, buf,
+ Py_ARRAY_LENGTH(buf)))) {
+ Py_DECREF(list);
+ FreeMibTable(tbl);
+ // ret is used instead of GetLastError()
+ return PyErr_SetFromWindowsErr(ret);
+ }
+ PyObject *tuple = Py_BuildValue("Iu", r.InterfaceIndex, buf);
+ if (tuple == NULL || PyList_Append(list, tuple) == -1) {
+ Py_XDECREF(tuple);
+ Py_DECREF(list);
+ FreeMibTable(tbl);
+ return NULL;
+ }
+ Py_DECREF(tuple);
+ }
+ FreeMibTable(tbl);
+ return list;
+#else
+ int i;
+ struct if_nameindex *ni;
+
+ ni = if_nameindex();
+ if (ni == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ Py_DECREF(list);
+ return NULL;
+ }
+
+#ifdef _Py_MEMORY_SANITIZER
+ __msan_unpoison(ni, sizeof(ni));
+ __msan_unpoison(&ni[0], sizeof(ni[0]));
+#endif
+ for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
+#ifdef _Py_MEMORY_SANITIZER
+ /* This one isn't the end sentinel, the next one must exist. */
+ __msan_unpoison(&ni[i+1], sizeof(ni[0]));
+ /* Otherwise Py_BuildValue internals are flagged by MSan when
+ they access the not-msan-tracked if_name string data. */
+ {
+ char *to_sanitize = ni[i].if_name;
+ do {
+ __msan_unpoison(to_sanitize, 1);
+ } while (*to_sanitize++ != '\0');
+ }
+#endif
+ PyObject *ni_tuple = Py_BuildValue("IO&",
+ ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
+
+ if (ni_tuple == NULL || PyList_Append(list, ni_tuple) == -1) {
+ Py_XDECREF(ni_tuple);
+ Py_DECREF(list);
+ if_freenameindex(ni);
+ return NULL;
+ }
+ Py_DECREF(ni_tuple);
+ }
+
+ if_freenameindex(ni);
+ return list;
+#endif
+}
+
+PyDoc_STRVAR(if_nameindex_doc,
+"if_nameindex()\n\
+\n\
+Returns a list of network interface information (index, name) tuples.");
+
+static PyObject *
+socket_if_nametoindex(PyObject *self, PyObject *args)
+{
+ PyObject *oname;
+#ifdef MS_WINDOWS
+ NET_IFINDEX index;
+#else
+ unsigned long index;
+#endif
+ if (!PyArg_ParseTuple(args, "O&:if_nametoindex",
+ PyUnicode_FSConverter, &oname))
+ return NULL;
+
+ index = if_nametoindex(PyBytes_AS_STRING(oname));
+ Py_DECREF(oname);
+ if (index == 0) {
+ /* if_nametoindex() doesn't set errno */
+ PyErr_SetString(PyExc_OSError, "no interface with this name");
+ return NULL;
+ }
+
+ return PyLong_FromUnsignedLong(index);
+}
+
+PyDoc_STRVAR(if_nametoindex_doc,
+"if_nametoindex(if_name)\n\
+\n\
+Returns the interface index corresponding to the interface name if_name.");
+
+static PyObject *
+socket_if_indextoname(PyObject *self, PyObject *arg)
+{
+ unsigned long index_long = PyLong_AsUnsignedLong(arg);
+ if (index_long == (unsigned long) -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+
+#ifdef MS_WINDOWS
+ NET_IFINDEX index = (NET_IFINDEX)index_long;
+#else
+ unsigned int index = (unsigned int)index_long;
+#endif
+
+ if ((unsigned long)index != index_long) {
+ PyErr_SetString(PyExc_OverflowError, "index is too large");
+ return NULL;
+ }
+
+ char name[IF_NAMESIZE + 1];
+ if (if_indextoname(index, name) == NULL) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ return PyUnicode_DecodeFSDefault(name);
+}
+
+PyDoc_STRVAR(if_indextoname_doc,
+"if_indextoname(if_index)\n\
+\n\
+Returns the interface name corresponding to the interface index if_index.");
+
+#endif // defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS)
+
+
+#ifdef CMSG_LEN
+/* Python interface to CMSG_LEN(length). */
+
+static PyObject *
+socket_CMSG_LEN(PyObject *self, PyObject *args)
+{
+ Py_ssize_t length;
+ size_t result;
+
+ if (!PyArg_ParseTuple(args, "n:CMSG_LEN", &length))
+ return NULL;
+ if (length < 0 || !get_CMSG_LEN(length, &result)) {
+ PyErr_Format(PyExc_OverflowError, "CMSG_LEN() argument out of range");
+ return NULL;
+ }
+ return PyLong_FromSize_t(result);
+}
+
+PyDoc_STRVAR(CMSG_LEN_doc,
+"CMSG_LEN(length) -> control message length\n\
+\n\
+Return the total length, without trailing padding, of an ancillary\n\
+data item with associated data of the given length. This value can\n\
+often be used as the buffer size for recvmsg() to receive a single\n\
+item of ancillary data, but RFC 3542 requires portable applications to\n\
+use CMSG_SPACE() and thus include space for padding, even when the\n\
+item will be the last in the buffer. Raises OverflowError if length\n\
+is outside the permissible range of values.");
+
+
+#ifdef CMSG_SPACE
+/* Python interface to CMSG_SPACE(length). */
+
+static PyObject *
+socket_CMSG_SPACE(PyObject *self, PyObject *args)
+{
+ Py_ssize_t length;
+ size_t result;
+
+ if (!PyArg_ParseTuple(args, "n:CMSG_SPACE", &length))
+ return NULL;
+ if (length < 0 || !get_CMSG_SPACE(length, &result)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "CMSG_SPACE() argument out of range");
+ return NULL;
+ }
+ return PyLong_FromSize_t(result);
+}
+
+PyDoc_STRVAR(CMSG_SPACE_doc,
+"CMSG_SPACE(length) -> buffer size\n\
+\n\
+Return the buffer size needed for recvmsg() to receive an ancillary\n\
+data item with associated data of the given length, along with any\n\
+trailing padding. The buffer space needed to receive multiple items\n\
+is the sum of the CMSG_SPACE() values for their associated data\n\
+lengths. Raises OverflowError if length is outside the permissible\n\
+range of values.");
+#endif /* CMSG_SPACE */
+#endif /* CMSG_LEN */
+
+
+/* List of functions exported by this module. */
+
+static PyMethodDef socket_methods[] = {
+#ifdef HAVE_GETADDRINFO
+ {"gethostbyname", socket_gethostbyname,
+ METH_VARARGS, gethostbyname_doc},
+#endif
+#if defined(HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYNAME)
+ {"gethostbyname_ex", socket_gethostbyname_ex,
+ METH_VARARGS, ghbn_ex_doc},
+#endif
+#if defined(HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYADDR)
+ {"gethostbyaddr", socket_gethostbyaddr,
+ METH_VARARGS, gethostbyaddr_doc},
+#endif
+#ifdef HAVE_GETHOSTNAME
+ {"gethostname", socket_gethostname,
+ METH_NOARGS, gethostname_doc},
+#endif
+#ifdef HAVE_SETHOSTNAME
+ {"sethostname", socket_sethostname,
+ METH_VARARGS, sethostname_doc},
+#endif
+#ifdef HAVE_GETSERVBYNAME
+ {"getservbyname", socket_getservbyname,
+ METH_VARARGS, getservbyname_doc},
+#endif
+#ifdef HAVE_GETSERVBYPORT
+ {"getservbyport", socket_getservbyport,
+ METH_VARARGS, getservbyport_doc},
+#endif
+#ifdef HAVE_GETPROTOBYNAME
+ {"getprotobyname", socket_getprotobyname,
+ METH_VARARGS, getprotobyname_doc},
+#endif
+ {"close", socket_close,
+ METH_O, close_doc},
+#ifndef NO_DUP
+ {"dup", socket_dup,
+ METH_O, dup_doc},
+#endif
+#ifdef HAVE_SOCKETPAIR
+ {"socketpair", socket_socketpair,
+ METH_VARARGS, socketpair_doc},
+#endif
+ {"ntohs", socket_ntohs,
+ METH_VARARGS, ntohs_doc},
+ {"ntohl", socket_ntohl,
+ METH_O, ntohl_doc},
+ {"htons", socket_htons,
+ METH_VARARGS, htons_doc},
+ {"htonl", socket_htonl,
+ METH_O, htonl_doc},
+ {"inet_aton", socket_inet_aton,
+ METH_VARARGS, inet_aton_doc},
+#ifdef HAVE_INET_NTOA
+ {"inet_ntoa", socket_inet_ntoa,
+ METH_VARARGS, inet_ntoa_doc},
+#endif
+#ifdef HAVE_INET_PTON
+ {"inet_pton", socket_inet_pton,
+ METH_VARARGS, inet_pton_doc},
+ {"inet_ntop", socket_inet_ntop,
+ METH_VARARGS, inet_ntop_doc},
+#endif
+#ifdef HAVE_GETADDRINFO
+ {"getaddrinfo", _PyCFunction_CAST(socket_getaddrinfo),
+ METH_VARARGS | METH_KEYWORDS, getaddrinfo_doc},
+#endif
+#ifdef HAVE_GETNAMEINFO
+ {"getnameinfo", socket_getnameinfo,
+ METH_VARARGS, getnameinfo_doc},
+#endif
+ {"getdefaulttimeout", socket_getdefaulttimeout,
+ METH_NOARGS, getdefaulttimeout_doc},
+ {"setdefaulttimeout", socket_setdefaulttimeout,
+ METH_O, setdefaulttimeout_doc},
+#if defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS)
+ {"if_nameindex", socket_if_nameindex,
+ METH_NOARGS, if_nameindex_doc},
+ {"if_nametoindex", socket_if_nametoindex,
+ METH_VARARGS, if_nametoindex_doc},
+ {"if_indextoname", socket_if_indextoname,
+ METH_O, if_indextoname_doc},
+#endif
+#ifdef CMSG_LEN
+ {"CMSG_LEN", socket_CMSG_LEN,
+ METH_VARARGS, CMSG_LEN_doc},
+#ifdef CMSG_SPACE
+ {"CMSG_SPACE", socket_CMSG_SPACE,
+ METH_VARARGS, CMSG_SPACE_doc},
+#endif
+#endif
+ {NULL, NULL} /* Sentinel */
+};
+
+
+#ifdef MS_WINDOWS
+#define OS_INIT_DEFINED
+
+/* Additional initialization and cleanup for Windows */
+
+static void
+os_cleanup(void)
+{
+ WSACleanup();
+}
+
+static int
+os_init(void)
+{
+ WSADATA WSAData;
+ int ret;
+ ret = WSAStartup(0x0101, &WSAData);
+ switch (ret) {
+ case 0: /* No error */
+ Py_AtExit(os_cleanup);
+ return 1; /* Success */
+ case WSASYSNOTREADY:
+ PyErr_SetString(PyExc_ImportError,
+ "WSAStartup failed: network not ready");
+ break;
+ case WSAVERNOTSUPPORTED:
+ case WSAEINVAL:
+ PyErr_SetString(
+ PyExc_ImportError,
+ "WSAStartup failed: requested version not supported");
+ break;
+ default:
+ PyErr_Format(PyExc_ImportError, "WSAStartup failed: error code %d", ret);
+ break;
+ }
+ return 0; /* Failure */
+}
+
+#endif /* MS_WINDOWS */
+
+
+
+#ifndef OS_INIT_DEFINED
+static int
+os_init(void)
+{
+ return 1; /* Success */
+}
+#endif
+
+static void
+sock_free_api(PySocketModule_APIObject *capi)
+{
+ Py_DECREF(capi->Sock_Type);
+ Py_DECREF(capi->error);
+ Py_DECREF(capi->timeout_error);
+ PyMem_Free(capi);
+}
+
+static void
+sock_destroy_api(PyObject *capsule)
+{
+ void *capi = PyCapsule_GetPointer(capsule, PySocket_CAPSULE_NAME);
+ sock_free_api(capi);
+}
+
+static PySocketModule_APIObject *
+sock_get_api(socket_state *state)
+{
+ PySocketModule_APIObject *capi = PyMem_Malloc(sizeof(PySocketModule_APIObject));
+ if (capi == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ capi->Sock_Type = (PyTypeObject *)Py_NewRef(state->sock_type);
+ capi->error = Py_NewRef(PyExc_OSError);
+ capi->timeout_error = Py_NewRef(PyExc_TimeoutError);
+ return capi;
+}
+
+
+/* Initialize the _socket module.
+
+ This module is actually called "_socket", and there's a wrapper
+ "socket.py" which implements some additional functionality.
+ The import of "_socket" may fail with an ImportError exception if
+ os-specific initialization fails. On Windows, this does WINSOCK
+ initialization. When WINSOCK is initialized successfully, a call to
+ WSACleanup() is scheduled to be made at exit time.
+*/
+
+PyDoc_STRVAR(socket_doc,
+"Implementation module for socket operations.\n\
+\n\
+See the socket module for documentation.");
+
+static int
+socket_exec(PyObject *m)
+{
+ if (!os_init()) {
+ goto error;
+ }
+
+ socket_state *state = get_module_state(m);
+ state->defaulttimeout = _PYTIME_FROMSECONDS(-1);
+
+#if defined(HAVE_ACCEPT) || defined(HAVE_ACCEPT4)
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
+ state->accept4_works = -1;
+#endif
+#endif
+
+#ifdef SOCK_CLOEXEC
+ state->sock_cloexec_works = -1;
+#endif
+
+#define ADD_EXC(MOD, NAME, VAR, BASE) do { \
+ VAR = PyErr_NewException("socket." NAME, BASE, NULL); \
+ if (VAR == NULL) { \
+ goto error; \
+ } \
+ if (PyModule_AddObjectRef(MOD, NAME, VAR) < 0) { \
+ goto error; \
+ } \
+} while (0)
+
+ ADD_EXC(m, "herror", state->socket_herror, PyExc_OSError);
+ ADD_EXC(m, "gaierror", state->socket_gaierror, PyExc_OSError);
+
+#undef ADD_EXC
+
+ if (PyModule_AddObjectRef(m, "error", PyExc_OSError) < 0) {
+ goto error;
+ }
+ if (PyModule_AddObjectRef(m, "timeout", PyExc_TimeoutError) < 0) {
+ goto error;
+ }
+
+ PyObject *sock_type = PyType_FromMetaclass(NULL, m, &sock_spec, NULL);
+ if (sock_type == NULL) {
+ goto error;
+ }
+ state->sock_type = (PyTypeObject *)sock_type;
+ if (PyModule_AddObjectRef(m, "SocketType", sock_type) < 0) {
+ goto error;
+ }
+ if (PyModule_AddType(m, state->sock_type) < 0) {
+ goto error;
+ }
+
+ PyObject *has_ipv6;
+#ifdef ENABLE_IPV6
+ has_ipv6 = Py_True;
+#else
+ has_ipv6 = Py_False;
+#endif
+ if (PyModule_AddObjectRef(m, "has_ipv6", has_ipv6) < 0) {
+ goto error;
+ }
+
+ /* Export C API */
+ PySocketModule_APIObject *capi = sock_get_api(state);
+ if (capi == NULL) {
+ goto error;
+ }
+ PyObject *capsule = PyCapsule_New(capi,
+ PySocket_CAPSULE_NAME,
+ sock_destroy_api);
+ if (capsule == NULL) {
+ sock_free_api(capi);
+ goto error;
+ }
+ int rc = PyModule_AddObjectRef(m, PySocket_CAPI_NAME, capsule);
+ Py_DECREF(capsule);
+ if (rc < 0) {
+ goto error;
+ }
+
+#define ADD_INT_MACRO(MOD, INT) do { \
+ if (PyModule_AddIntConstant(MOD, #INT, INT) < 0) { \
+ goto error; \
+ } \
+} while (0)
+
+#define ADD_INT_CONST(MOD, NAME, INT) do { \
+ if (PyModule_AddIntConstant(MOD, NAME, INT) < 0) { \
+ goto error; \
+ } \
+} while (0)
+
+#define ADD_STR_CONST(MOD, NAME, STR) do { \
+ if (PyModule_AddStringConstant(MOD, NAME, STR) < 0) { \
+ goto error; \
+ } \
+} while (0)
+
+ /* Address families (we only support AF_INET and AF_UNIX) */
+#ifdef AF_UNSPEC
+ ADD_INT_MACRO(m, AF_UNSPEC);
+#endif
+ ADD_INT_MACRO(m, AF_INET);
+#if defined(AF_UNIX)
+ ADD_INT_MACRO(m, AF_UNIX);
+#endif /* AF_UNIX */
+#ifdef AF_AX25
+ /* Amateur Radio AX.25 */
+ ADD_INT_MACRO(m, AF_AX25);
+#endif
+#ifdef AF_IPX
+ ADD_INT_MACRO(m, AF_IPX); /* Novell IPX */
+#endif
+#ifdef AF_APPLETALK
+ /* Appletalk DDP */
+ ADD_INT_MACRO(m, AF_APPLETALK);
+#endif
+#ifdef AF_NETROM
+ /* Amateur radio NetROM */
+ ADD_INT_MACRO(m, AF_NETROM);
+#endif
+#ifdef AF_BRIDGE
+ /* Multiprotocol bridge */
+ ADD_INT_MACRO(m, AF_BRIDGE);
+#endif
+#ifdef AF_ATMPVC
+ /* ATM PVCs */
+ ADD_INT_MACRO(m, AF_ATMPVC);
+#endif
+#ifdef AF_AAL5
+ /* Reserved for Werner's ATM */
+ ADD_INT_MACRO(m, AF_AAL5);
+#endif
+#ifdef HAVE_SOCKADDR_ALG
+ ADD_INT_MACRO(m, AF_ALG); /* Linux crypto */
+#endif
+#ifdef AF_X25
+ /* Reserved for X.25 project */
+ ADD_INT_MACRO(m, AF_X25);
+#endif
+#ifdef AF_INET6
+ ADD_INT_MACRO(m, AF_INET6); /* IP version 6 */
+#endif
+#ifdef AF_ROSE
+ /* Amateur Radio X.25 PLP */
+ ADD_INT_MACRO(m, AF_ROSE);
+#endif
+#ifdef AF_DECnet
+ /* Reserved for DECnet project */
+ ADD_INT_MACRO(m, AF_DECnet);
+#endif
+#ifdef AF_NETBEUI
+ /* Reserved for 802.2LLC project */
+ ADD_INT_MACRO(m, AF_NETBEUI);
+#endif
+#ifdef AF_SECURITY
+ /* Security callback pseudo AF */
+ ADD_INT_MACRO(m, AF_SECURITY);
+#endif
+#ifdef AF_KEY
+ /* PF_KEY key management API */
+ ADD_INT_MACRO(m, AF_KEY);
+#endif
+#ifdef AF_NETLINK
+ /* */
+ ADD_INT_MACRO(m, AF_NETLINK);
+ ADD_INT_MACRO(m, NETLINK_ROUTE);
+#ifdef NETLINK_SKIP
+ ADD_INT_MACRO(m, NETLINK_SKIP);
+#endif
+#ifdef NETLINK_W1
+ ADD_INT_MACRO(m, NETLINK_W1);
+#endif
+ ADD_INT_MACRO(m, NETLINK_USERSOCK);
+ ADD_INT_MACRO(m, NETLINK_FIREWALL);
+#ifdef NETLINK_TCPDIAG
+ ADD_INT_MACRO(m, NETLINK_TCPDIAG);
+#endif
+#ifdef NETLINK_NFLOG
+ ADD_INT_MACRO(m, NETLINK_NFLOG);
+#endif
+#ifdef NETLINK_XFRM
+ ADD_INT_MACRO(m, NETLINK_XFRM);
+#endif
+#ifdef NETLINK_ARPD
+ ADD_INT_MACRO(m, NETLINK_ARPD);
+#endif
+#ifdef NETLINK_ROUTE6
+ ADD_INT_MACRO(m, NETLINK_ROUTE6);
+#endif
+ ADD_INT_MACRO(m, NETLINK_IP6_FW);
+#ifdef NETLINK_DNRTMSG
+ ADD_INT_MACRO(m, NETLINK_DNRTMSG);
+#endif
+#ifdef NETLINK_TAPBASE
+ ADD_INT_MACRO(m, NETLINK_TAPBASE);
+#endif
+#ifdef NETLINK_CRYPTO
+ ADD_INT_MACRO(m, NETLINK_CRYPTO);
+#endif
+#endif /* AF_NETLINK */
+
+#ifdef AF_QIPCRTR
+ /* Qualcomm IPCROUTER */
+ ADD_INT_MACRO(m, AF_QIPCRTR);
+#endif
+
+#ifdef AF_VSOCK
+ ADD_INT_CONST(m, "AF_VSOCK", AF_VSOCK);
+ ADD_INT_CONST(m, "SO_VM_SOCKETS_BUFFER_SIZE", 0);
+ ADD_INT_CONST(m, "SO_VM_SOCKETS_BUFFER_MIN_SIZE", 1);
+ ADD_INT_CONST(m, "SO_VM_SOCKETS_BUFFER_MAX_SIZE", 2);
+ ADD_INT_CONST(m, "VMADDR_CID_ANY", 0xffffffff);
+ ADD_INT_CONST(m, "VMADDR_PORT_ANY", 0xffffffff);
+ ADD_INT_CONST(m, "VMADDR_CID_HOST", 2);
+ ADD_INT_CONST(m, "VM_SOCKETS_INVALID_VERSION", 0xffffffff);
+ ADD_INT_CONST(m, "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IO(7, 0xb9));
+#endif
+
+#ifdef AF_ROUTE
+ /* Alias to emulate 4.4BSD */
+ ADD_INT_MACRO(m, AF_ROUTE);
+#endif
+#ifdef AF_LINK
+ ADD_INT_MACRO(m, AF_LINK);
+#endif
+#ifdef AF_ASH
+ /* Ash */
+ ADD_INT_MACRO(m, AF_ASH);
+#endif
+#ifdef AF_ECONET
+ /* Acorn Econet */
+ ADD_INT_MACRO(m, AF_ECONET);
+#endif
+#ifdef AF_ATMSVC
+ /* ATM SVCs */
+ ADD_INT_MACRO(m, AF_ATMSVC);
+#endif
+#ifdef AF_SNA
+ /* Linux SNA Project (nutters!) */
+ ADD_INT_MACRO(m, AF_SNA);
+#endif
+#ifdef AF_IRDA
+ /* IRDA sockets */
+ ADD_INT_MACRO(m, AF_IRDA);
+#endif
+#ifdef AF_PPPOX
+ /* PPPoX sockets */
+ ADD_INT_MACRO(m, AF_PPPOX);
+#endif
+#ifdef AF_WANPIPE
+ /* Wanpipe API Sockets */
+ ADD_INT_MACRO(m, AF_WANPIPE);
+#endif
+#ifdef AF_LLC
+ /* Linux LLC */
+ ADD_INT_MACRO(m, AF_LLC);
+#endif
+#ifdef HAVE_AF_HYPERV
+ /* Hyper-V sockets */
+ ADD_INT_MACRO(m, AF_HYPERV);
+
+ /* for proto */
+ ADD_INT_MACRO(m, HV_PROTOCOL_RAW);
+
+ /* for setsockopt() */
+ ADD_INT_MACRO(m, HVSOCKET_CONNECT_TIMEOUT);
+ ADD_INT_MACRO(m, HVSOCKET_CONNECT_TIMEOUT_MAX);
+ ADD_INT_MACRO(m, HVSOCKET_CONNECTED_SUSPEND);
+ ADD_INT_MACRO(m, HVSOCKET_ADDRESS_FLAG_PASSTHRU);
+
+ /* for bind() or connect() */
+ ADD_STR_CONST(m, "HV_GUID_ZERO", "00000000-0000-0000-0000-000000000000");
+ ADD_STR_CONST(m, "HV_GUID_WILDCARD", "00000000-0000-0000-0000-000000000000");
+ ADD_STR_CONST(m, "HV_GUID_BROADCAST", "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF");
+ ADD_STR_CONST(m, "HV_GUID_CHILDREN", "90DB8B89-0D35-4F79-8CE9-49EA0AC8B7CD");
+ ADD_STR_CONST(m, "HV_GUID_LOOPBACK", "E0E16197-DD56-4A10-9195-5EE7A155A838");
+ ADD_STR_CONST(m, "HV_GUID_PARENT", "A42E7CDA-D03F-480C-9CC2-A4DE20ABB878");
+#endif /* HAVE_AF_HYPERV */
+
+#ifdef USE_BLUETOOTH
+ ADD_INT_MACRO(m, AF_BLUETOOTH);
+#ifdef BTPROTO_L2CAP
+ ADD_INT_MACRO(m, BTPROTO_L2CAP);
+#endif /* BTPROTO_L2CAP */
+#ifdef BTPROTO_HCI
+ ADD_INT_MACRO(m, BTPROTO_HCI);
+ ADD_INT_MACRO(m, SOL_HCI);
+#if !defined(__NetBSD__) && !defined(__DragonFly__)
+ ADD_INT_MACRO(m, HCI_FILTER);
+#if !defined(__FreeBSD__)
+ ADD_INT_MACRO(m, HCI_TIME_STAMP);
+ ADD_INT_MACRO(m, HCI_DATA_DIR);
+#endif /* !__FreeBSD__ */
+#endif /* !__NetBSD__ && !__DragonFly__ */
+#endif /* BTPROTO_HCI */
+#ifdef BTPROTO_RFCOMM
+ ADD_INT_MACRO(m, BTPROTO_RFCOMM);
+#endif /* BTPROTO_RFCOMM */
+ ADD_STR_CONST(m, "BDADDR_ANY", "00:00:00:00:00:00");
+ ADD_STR_CONST(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
+#ifdef BTPROTO_SCO
+ ADD_INT_MACRO(m, BTPROTO_SCO);
+#endif /* BTPROTO_SCO */
+#endif /* USE_BLUETOOTH */
+
+#ifdef AF_CAN
+ /* Controller Area Network */
+ ADD_INT_MACRO(m, AF_CAN);
+#endif
+#ifdef PF_CAN
+ /* Controller Area Network */
+ ADD_INT_MACRO(m, PF_CAN);
+#endif
+
+/* Reliable Datagram Sockets */
+#ifdef AF_RDS
+ ADD_INT_MACRO(m, AF_RDS);
+#endif
+#ifdef PF_RDS
+ ADD_INT_MACRO(m, PF_RDS);
+#endif
+
+/* Kernel event messages */
+#ifdef PF_SYSTEM
+ ADD_INT_MACRO(m, PF_SYSTEM);
+#endif
+#ifdef AF_SYSTEM
+ ADD_INT_MACRO(m, AF_SYSTEM);
+#endif
+
+/* FreeBSD divert(4) */
+#ifdef PF_DIVERT
+ ADD_INT_MACRO(m, PF_DIVERT);
+#endif
+#ifdef AF_DIVERT
+ ADD_INT_MACRO(m, AF_DIVERT);
+#endif
+
+#ifdef AF_PACKET
+ ADD_INT_MACRO(m, AF_PACKET);
+#endif
+#ifdef PF_PACKET
+ ADD_INT_MACRO(m, PF_PACKET);
+#endif
+#ifdef PACKET_HOST
+ ADD_INT_MACRO(m, PACKET_HOST);
+#endif
+#ifdef PACKET_BROADCAST
+ ADD_INT_MACRO(m, PACKET_BROADCAST);
+#endif
+#ifdef PACKET_MULTICAST
+ ADD_INT_MACRO(m, PACKET_MULTICAST);
+#endif
+#ifdef PACKET_OTHERHOST
+ ADD_INT_MACRO(m, PACKET_OTHERHOST);
+#endif
+#ifdef PACKET_OUTGOING
+ ADD_INT_MACRO(m, PACKET_OUTGOING);
+#endif
+#ifdef PACKET_LOOPBACK
+ ADD_INT_MACRO(m, PACKET_LOOPBACK);
+#endif
+#ifdef PACKET_FASTROUTE
+ ADD_INT_MACRO(m, PACKET_FASTROUTE);
+#endif
+
+#ifdef HAVE_LINUX_TIPC_H
+ ADD_INT_MACRO(m, AF_TIPC);
+
+ /* for addresses */
+ ADD_INT_MACRO(m, TIPC_ADDR_NAMESEQ);
+ ADD_INT_MACRO(m, TIPC_ADDR_NAME);
+ ADD_INT_MACRO(m, TIPC_ADDR_ID);
+
+ ADD_INT_MACRO(m, TIPC_ZONE_SCOPE);
+ ADD_INT_MACRO(m, TIPC_CLUSTER_SCOPE);
+ ADD_INT_MACRO(m, TIPC_NODE_SCOPE);
+
+ /* for setsockopt() */
+ ADD_INT_MACRO(m, SOL_TIPC);
+ ADD_INT_MACRO(m, TIPC_IMPORTANCE);
+ ADD_INT_MACRO(m, TIPC_SRC_DROPPABLE);
+ ADD_INT_MACRO(m, TIPC_DEST_DROPPABLE);
+ ADD_INT_MACRO(m, TIPC_CONN_TIMEOUT);
+
+ ADD_INT_MACRO(m, TIPC_LOW_IMPORTANCE);
+ ADD_INT_MACRO(m, TIPC_MEDIUM_IMPORTANCE);
+ ADD_INT_MACRO(m, TIPC_HIGH_IMPORTANCE);
+ ADD_INT_MACRO(m, TIPC_CRITICAL_IMPORTANCE);
+
+ /* for subscriptions */
+ ADD_INT_MACRO(m, TIPC_SUB_PORTS);
+ ADD_INT_MACRO(m, TIPC_SUB_SERVICE);
+#ifdef TIPC_SUB_CANCEL
+ /* doesn't seem to be available everywhere */
+ ADD_INT_MACRO(m, TIPC_SUB_CANCEL);
+#endif
+ ADD_INT_MACRO(m, TIPC_WAIT_FOREVER);
+ ADD_INT_MACRO(m, TIPC_PUBLISHED);
+ ADD_INT_MACRO(m, TIPC_WITHDRAWN);
+ ADD_INT_MACRO(m, TIPC_SUBSCR_TIMEOUT);
+ ADD_INT_MACRO(m, TIPC_CFG_SRV);
+ ADD_INT_MACRO(m, TIPC_TOP_SRV);
+#endif
+
+#ifdef HAVE_SOCKADDR_ALG
+ /* Socket options */
+ ADD_INT_MACRO(m, ALG_SET_KEY);
+ ADD_INT_MACRO(m, ALG_SET_IV);
+ ADD_INT_MACRO(m, ALG_SET_OP);
+ ADD_INT_MACRO(m, ALG_SET_AEAD_ASSOCLEN);
+ ADD_INT_MACRO(m, ALG_SET_AEAD_AUTHSIZE);
+ ADD_INT_MACRO(m, ALG_SET_PUBKEY);
+
+ /* Operations */
+ ADD_INT_MACRO(m, ALG_OP_DECRYPT);
+ ADD_INT_MACRO(m, ALG_OP_ENCRYPT);
+ ADD_INT_MACRO(m, ALG_OP_SIGN);
+ ADD_INT_MACRO(m, ALG_OP_VERIFY);
+#endif
+
+/* IEEE 802.3 protocol numbers required for a standard TCP/IP network stack */
+#ifdef ETHERTYPE_ARP
+ ADD_INT_MACRO(m, ETHERTYPE_ARP);
+#endif
+#ifdef ETHERTYPE_IP
+ ADD_INT_MACRO(m, ETHERTYPE_IP);
+#endif
+#ifdef ETHERTYPE_IPV6
+ ADD_INT_MACRO(m, ETHERTYPE_IPV6);
+#endif
+#ifdef ETHERTYPE_VLAN
+ ADD_INT_MACRO(m, ETHERTYPE_VLAN);
+#endif
+
+/* Linux pseudo-protocol for sniffing every packet */
+#ifdef ETH_P_ALL
+ ADD_INT_MACRO(m, ETH_P_ALL);
+#endif
+
+ /* Socket types */
+ ADD_INT_MACRO(m, SOCK_STREAM);
+ ADD_INT_MACRO(m, SOCK_DGRAM);
+/* We have incomplete socket support. */
+#ifdef SOCK_RAW
+ /* SOCK_RAW is marked as optional in the POSIX specification */
+ ADD_INT_MACRO(m, SOCK_RAW);
+#endif
+#ifdef SOCK_SEQPACKET
+ ADD_INT_MACRO(m, SOCK_SEQPACKET);
+#endif
+#if defined(SOCK_RDM)
+ ADD_INT_MACRO(m, SOCK_RDM);
+#endif
+#ifdef SOCK_CLOEXEC
+ ADD_INT_MACRO(m, SOCK_CLOEXEC);
+#endif
+#ifdef SOCK_NONBLOCK
+ ADD_INT_MACRO(m, SOCK_NONBLOCK);
+#endif
+
+#ifdef SO_DEBUG
+ ADD_INT_MACRO(m, SO_DEBUG);
+#endif
+#ifdef SO_ACCEPTCONN
+ ADD_INT_MACRO(m, SO_ACCEPTCONN);
+#endif
+#ifdef SO_REUSEADDR
+ ADD_INT_MACRO(m, SO_REUSEADDR);
+#endif
+#ifdef SO_EXCLUSIVEADDRUSE
+ ADD_INT_MACRO(m, SO_EXCLUSIVEADDRUSE);
+#endif
+#ifdef SO_INCOMING_CPU
+ ADD_INT_MACRO(m, SO_INCOMING_CPU);
+#endif
+
+#ifdef SO_KEEPALIVE
+ ADD_INT_MACRO(m, SO_KEEPALIVE);
+#endif
+#ifdef SO_DONTROUTE
+ ADD_INT_MACRO(m, SO_DONTROUTE);
+#endif
+#ifdef SO_BROADCAST
+ ADD_INT_MACRO(m, SO_BROADCAST);
+#endif
+#ifdef SO_USELOOPBACK
+ ADD_INT_MACRO(m, SO_USELOOPBACK);
+#endif
+#ifdef SO_LINGER
+ ADD_INT_MACRO(m, SO_LINGER);
+#endif
+#ifdef SO_OOBINLINE
+ ADD_INT_MACRO(m, SO_OOBINLINE);
+#endif
+#ifndef __GNU__
+#ifdef SO_REUSEPORT
+ ADD_INT_MACRO(m, SO_REUSEPORT);
+#endif
+#endif
+#ifdef SO_SNDBUF
+ ADD_INT_MACRO(m, SO_SNDBUF);
+#endif
+#ifdef SO_RCVBUF
+ ADD_INT_MACRO(m, SO_RCVBUF);
+#endif
+#ifdef SO_SNDLOWAT
+ ADD_INT_MACRO(m, SO_SNDLOWAT);
+#endif
+#ifdef SO_RCVLOWAT
+ ADD_INT_MACRO(m, SO_RCVLOWAT);
+#endif
+#ifdef SO_SNDTIMEO
+ ADD_INT_MACRO(m, SO_SNDTIMEO);
+#endif
+#ifdef SO_RCVTIMEO
+ ADD_INT_MACRO(m, SO_RCVTIMEO);
+#endif
+#ifdef SO_ERROR
+ ADD_INT_MACRO(m, SO_ERROR);
+#endif
+#ifdef SO_TYPE
+ ADD_INT_MACRO(m, SO_TYPE);
+#endif
+#ifdef SO_SETFIB
+ ADD_INT_MACRO(m, SO_SETFIB);
+#endif
+#ifdef SO_PASSCRED
+ ADD_INT_MACRO(m, SO_PASSCRED);
+#endif
+#ifdef SO_PEERCRED
+ ADD_INT_MACRO(m, SO_PEERCRED);
+#endif
+#ifdef LOCAL_PEERCRED
+ ADD_INT_MACRO(m, LOCAL_PEERCRED);
+#endif
+#ifdef SO_PASSSEC
+ ADD_INT_MACRO(m, SO_PASSSEC);
+#endif
+#ifdef SO_PEERSEC
+ ADD_INT_MACRO(m, SO_PEERSEC);
+#endif
+#ifdef SO_BINDTODEVICE
+ ADD_INT_MACRO(m, SO_BINDTODEVICE);
+#endif
+#ifdef SO_PRIORITY
+ ADD_INT_MACRO(m, SO_PRIORITY);
+#endif
+#ifdef SO_MARK
+ ADD_INT_MACRO(m, SO_MARK);
+#endif
+#ifdef SO_USER_COOKIE
+ ADD_INT_MACRO(m, SO_USER_COOKIE);
+#endif
+#ifdef SO_RTABLE
+ ADD_INT_MACRO(m, SO_RTABLE);
+#endif
+#ifdef SO_DOMAIN
+ ADD_INT_MACRO(m, SO_DOMAIN);
+#endif
+#ifdef SO_PROTOCOL
+ ADD_INT_MACRO(m, SO_PROTOCOL);
+#endif
+#ifdef LOCAL_CREDS
+ ADD_INT_MACRO(m, LOCAL_CREDS);
+#endif
+#ifdef LOCAL_CREDS_PERSISTENT
+ ADD_INT_MACRO(m, LOCAL_CREDS_PERSISTENT);
+#endif
+
+ /* Maximum number of connections for "listen" */
+#ifdef SOMAXCONN
+ ADD_INT_MACRO(m, SOMAXCONN);
+#else
+ ADD_INT_CONST(m, "SOMAXCONN", 5); /* Common value */
+#endif
+
+ /* Ancillary message types */
+#ifdef SCM_RIGHTS
+ ADD_INT_MACRO(m, SCM_RIGHTS);
+#endif
+#ifdef SCM_CREDENTIALS
+ ADD_INT_MACRO(m, SCM_CREDENTIALS);
+#endif
+#ifdef SCM_CREDS
+ ADD_INT_MACRO(m, SCM_CREDS);
+#endif
+#ifdef SCM_CREDS2
+ ADD_INT_MACRO(m, SCM_CREDS2);
+#endif
+
+ /* Flags for send, recv */
+#ifdef MSG_OOB
+ ADD_INT_MACRO(m, MSG_OOB);
+#endif
+#ifdef MSG_PEEK
+ ADD_INT_MACRO(m, MSG_PEEK);
+#endif
+#ifdef MSG_DONTROUTE
+ ADD_INT_MACRO(m, MSG_DONTROUTE);
+#endif
+#ifdef MSG_DONTWAIT
+ ADD_INT_MACRO(m, MSG_DONTWAIT);
+#endif
+#ifdef MSG_EOR
+ ADD_INT_MACRO(m, MSG_EOR);
+#endif
+#ifdef MSG_TRUNC
+ // workaround for https://github.com/WebAssembly/wasi-libc/issues/305
+ #if defined(__wasi__) && !defined(__WASI_RIFLAGS_RECV_DATA_TRUNCATED)
+ # define __WASI_RIFLAGS_RECV_DATA_TRUNCATED 2
+ #endif
+ ADD_INT_MACRO(m, MSG_TRUNC);
+#endif
+#ifdef MSG_CTRUNC
+ ADD_INT_MACRO(m, MSG_CTRUNC);
+#endif
+#ifdef MSG_WAITALL
+ ADD_INT_MACRO(m, MSG_WAITALL);
+#endif
+#ifdef MSG_BTAG
+ ADD_INT_MACRO(m, MSG_BTAG);
+#endif
+#ifdef MSG_ETAG
+ ADD_INT_MACRO(m, MSG_ETAG);
+#endif
+#ifdef MSG_NOSIGNAL
+ ADD_INT_MACRO(m, MSG_NOSIGNAL);
+#endif
+#ifdef MSG_NOTIFICATION
+ ADD_INT_MACRO(m, MSG_NOTIFICATION);
+#endif
+#ifdef MSG_CMSG_CLOEXEC
+ ADD_INT_MACRO(m, MSG_CMSG_CLOEXEC);
+#endif
+#ifdef MSG_ERRQUEUE
+ ADD_INT_MACRO(m, MSG_ERRQUEUE);
+#endif
+#ifdef MSG_CONFIRM
+ ADD_INT_MACRO(m, MSG_CONFIRM);
+#endif
+#ifdef MSG_MORE
+ ADD_INT_MACRO(m, MSG_MORE);
+#endif
+#ifdef MSG_EOF
+ ADD_INT_MACRO(m, MSG_EOF);
+#endif
+#ifdef MSG_BCAST
+ ADD_INT_MACRO(m, MSG_BCAST);
+#endif
+#ifdef MSG_MCAST
+ ADD_INT_MACRO(m, MSG_MCAST);
+#endif
+#ifdef MSG_FASTOPEN
+ ADD_INT_MACRO(m, MSG_FASTOPEN);
+#endif
+
+ /* Protocol level and numbers, usable for [gs]etsockopt */
+#ifdef SOL_SOCKET
+ ADD_INT_MACRO(m, SOL_SOCKET);
+#endif
+#ifdef SOL_IP
+ ADD_INT_MACRO(m, SOL_IP);
+#else
+ ADD_INT_CONST(m, "SOL_IP", 0);
+#endif
+#ifdef SOL_IPX
+ ADD_INT_MACRO(m, SOL_IPX);
+#endif
+#ifdef SOL_AX25
+ ADD_INT_MACRO(m, SOL_AX25);
+#endif
+#ifdef SOL_ATALK
+ ADD_INT_MACRO(m, SOL_ATALK);
+#endif
+#ifdef SOL_NETROM
+ ADD_INT_MACRO(m, SOL_NETROM);
+#endif
+#ifdef SOL_ROSE
+ ADD_INT_MACRO(m, SOL_ROSE);
+#endif
+#ifdef SOL_TCP
+ ADD_INT_MACRO(m, SOL_TCP);
+#else
+ ADD_INT_CONST(m, "SOL_TCP", 6);
+#endif
+#ifdef SOL_UDP
+ ADD_INT_MACRO(m, SOL_UDP);
+#else
+ ADD_INT_CONST(m, "SOL_UDP", 17);
+#endif
+#ifdef SOL_CAN_BASE
+ ADD_INT_MACRO(m, SOL_CAN_BASE);
+#endif
+#ifdef SOL_CAN_RAW
+ ADD_INT_MACRO(m, SOL_CAN_RAW);
+ ADD_INT_MACRO(m, CAN_RAW);
+#endif
+#if defined(HAVE_LINUX_CAN_H) || defined(HAVE_NETCAN_CAN_H)
+ ADD_INT_MACRO(m, CAN_EFF_FLAG);
+ ADD_INT_MACRO(m, CAN_RTR_FLAG);
+ ADD_INT_MACRO(m, CAN_ERR_FLAG);
+
+ ADD_INT_MACRO(m, CAN_SFF_MASK);
+ ADD_INT_MACRO(m, CAN_EFF_MASK);
+ ADD_INT_MACRO(m, CAN_ERR_MASK);
+#ifdef CAN_ISOTP
+ ADD_INT_MACRO(m, CAN_ISOTP);
+#endif
+#ifdef CAN_J1939
+ ADD_INT_MACRO(m, CAN_J1939);
+#endif
+#endif
+#if defined(HAVE_LINUX_CAN_RAW_H) || defined(HAVE_NETCAN_CAN_H)
+ ADD_INT_MACRO(m, CAN_RAW_FILTER);
+#ifdef CAN_RAW_ERR_FILTER
+ ADD_INT_MACRO(m, CAN_RAW_ERR_FILTER);
+#endif
+ ADD_INT_MACRO(m, CAN_RAW_LOOPBACK);
+ ADD_INT_MACRO(m, CAN_RAW_RECV_OWN_MSGS);
+#endif
+#ifdef HAVE_LINUX_CAN_RAW_FD_FRAMES
+ ADD_INT_MACRO(m, CAN_RAW_FD_FRAMES);
+#endif
+#ifdef HAVE_LINUX_CAN_RAW_JOIN_FILTERS
+ ADD_INT_MACRO(m, CAN_RAW_JOIN_FILTERS);
+#endif
+#ifdef HAVE_LINUX_CAN_BCM_H
+ ADD_INT_MACRO(m, CAN_BCM);
+
+ /* BCM opcodes */
+ ADD_INT_CONST(m, "CAN_BCM_TX_SETUP", TX_SETUP);
+ ADD_INT_CONST(m, "CAN_BCM_TX_DELETE", TX_DELETE);
+ ADD_INT_CONST(m, "CAN_BCM_TX_READ", TX_READ);
+ ADD_INT_CONST(m, "CAN_BCM_TX_SEND", TX_SEND);
+ ADD_INT_CONST(m, "CAN_BCM_RX_SETUP", RX_SETUP);
+ ADD_INT_CONST(m, "CAN_BCM_RX_DELETE", RX_DELETE);
+ ADD_INT_CONST(m, "CAN_BCM_RX_READ", RX_READ);
+ ADD_INT_CONST(m, "CAN_BCM_TX_STATUS", TX_STATUS);
+ ADD_INT_CONST(m, "CAN_BCM_TX_EXPIRED", TX_EXPIRED);
+ ADD_INT_CONST(m, "CAN_BCM_RX_STATUS", RX_STATUS);
+ ADD_INT_CONST(m, "CAN_BCM_RX_TIMEOUT", RX_TIMEOUT);
+ ADD_INT_CONST(m, "CAN_BCM_RX_CHANGED", RX_CHANGED);
+
+ /* BCM flags */
+ ADD_INT_CONST(m, "CAN_BCM_SETTIMER", SETTIMER);
+ ADD_INT_CONST(m, "CAN_BCM_STARTTIMER", STARTTIMER);
+ ADD_INT_CONST(m, "CAN_BCM_TX_COUNTEVT", TX_COUNTEVT);
+ ADD_INT_CONST(m, "CAN_BCM_TX_ANNOUNCE", TX_ANNOUNCE);
+ ADD_INT_CONST(m, "CAN_BCM_TX_CP_CAN_ID", TX_CP_CAN_ID);
+ ADD_INT_CONST(m, "CAN_BCM_RX_FILTER_ID", RX_FILTER_ID);
+ ADD_INT_CONST(m, "CAN_BCM_RX_CHECK_DLC", RX_CHECK_DLC);
+ ADD_INT_CONST(m, "CAN_BCM_RX_NO_AUTOTIMER", RX_NO_AUTOTIMER);
+ ADD_INT_CONST(m, "CAN_BCM_RX_ANNOUNCE_RESUME", RX_ANNOUNCE_RESUME);
+ ADD_INT_CONST(m, "CAN_BCM_TX_RESET_MULTI_IDX", TX_RESET_MULTI_IDX);
+ ADD_INT_CONST(m, "CAN_BCM_RX_RTR_FRAME", RX_RTR_FRAME);
+#ifdef CAN_FD_FRAME
+ /* CAN_FD_FRAME was only introduced in the 4.8.x kernel series */
+ ADD_INT_CONST(m, "CAN_BCM_CAN_FD_FRAME", CAN_FD_FRAME);
+#endif
+#endif
+#ifdef HAVE_LINUX_CAN_J1939_H
+ ADD_INT_MACRO(m, J1939_MAX_UNICAST_ADDR);
+ ADD_INT_MACRO(m, J1939_IDLE_ADDR);
+ ADD_INT_MACRO(m, J1939_NO_ADDR);
+ ADD_INT_MACRO(m, J1939_NO_NAME);
+ ADD_INT_MACRO(m, J1939_PGN_REQUEST);
+ ADD_INT_MACRO(m, J1939_PGN_ADDRESS_CLAIMED);
+ ADD_INT_MACRO(m, J1939_PGN_ADDRESS_COMMANDED);
+ ADD_INT_MACRO(m, J1939_PGN_PDU1_MAX);
+ ADD_INT_MACRO(m, J1939_PGN_MAX);
+ ADD_INT_MACRO(m, J1939_NO_PGN);
+
+ /* J1939 socket options */
+ ADD_INT_MACRO(m, SO_J1939_FILTER);
+ ADD_INT_MACRO(m, SO_J1939_PROMISC);
+ ADD_INT_MACRO(m, SO_J1939_SEND_PRIO);
+ ADD_INT_MACRO(m, SO_J1939_ERRQUEUE);
+
+ ADD_INT_MACRO(m, SCM_J1939_DEST_ADDR);
+ ADD_INT_MACRO(m, SCM_J1939_DEST_NAME);
+ ADD_INT_MACRO(m, SCM_J1939_PRIO);
+ ADD_INT_MACRO(m, SCM_J1939_ERRQUEUE);
+
+ ADD_INT_MACRO(m, J1939_NLA_PAD);
+ ADD_INT_MACRO(m, J1939_NLA_BYTES_ACKED);
+
+ ADD_INT_MACRO(m, J1939_EE_INFO_NONE);
+ ADD_INT_MACRO(m, J1939_EE_INFO_TX_ABORT);
+
+ ADD_INT_MACRO(m, J1939_FILTER_MAX);
+#endif
+#ifdef SOL_RDS
+ ADD_INT_MACRO(m, SOL_RDS);
+#endif
+#ifdef HAVE_SOCKADDR_ALG
+ ADD_INT_MACRO(m, SOL_ALG);
+#endif
+#ifdef RDS_CANCEL_SENT_TO
+ ADD_INT_MACRO(m, RDS_CANCEL_SENT_TO);
+#endif
+#ifdef RDS_GET_MR
+ ADD_INT_MACRO(m, RDS_GET_MR);
+#endif
+#ifdef RDS_FREE_MR
+ ADD_INT_MACRO(m, RDS_FREE_MR);
+#endif
+#ifdef RDS_RECVERR
+ ADD_INT_MACRO(m, RDS_RECVERR);
+#endif
+#ifdef RDS_CONG_MONITOR
+ ADD_INT_MACRO(m, RDS_CONG_MONITOR);
+#endif
+#ifdef RDS_GET_MR_FOR_DEST
+ ADD_INT_MACRO(m, RDS_GET_MR_FOR_DEST);
+#endif
+#ifdef IPPROTO_IP
+ ADD_INT_MACRO(m, IPPROTO_IP);
+#else
+ ADD_INT_CONST(m, "IPPROTO_IP", 0);
+#endif
+#ifdef IPPROTO_HOPOPTS
+ ADD_INT_MACRO(m, IPPROTO_HOPOPTS);
+#endif
+#ifdef IPPROTO_ICMP
+ ADD_INT_MACRO(m, IPPROTO_ICMP);
+#else
+ ADD_INT_CONST(m, "IPPROTO_ICMP", 1);
+#endif
+#ifdef IPPROTO_IGMP
+ ADD_INT_MACRO(m, IPPROTO_IGMP);
+#endif
+#ifdef IPPROTO_GGP
+ ADD_INT_MACRO(m, IPPROTO_GGP);
+#endif
+#ifdef IPPROTO_IPV4
+ ADD_INT_MACRO(m, IPPROTO_IPV4);
+#endif
+#ifdef IPPROTO_IPV6
+ ADD_INT_MACRO(m, IPPROTO_IPV6);
+#endif
+#ifdef IPPROTO_IPIP
+ ADD_INT_MACRO(m, IPPROTO_IPIP);
+#endif
+#ifdef IPPROTO_TCP
+ ADD_INT_MACRO(m, IPPROTO_TCP);
+#else
+ ADD_INT_CONST(m, "IPPROTO_TCP", 6);
+#endif
+#ifdef IPPROTO_EGP
+ ADD_INT_MACRO(m, IPPROTO_EGP);
+#endif
+#ifdef IPPROTO_PUP
+ ADD_INT_MACRO(m, IPPROTO_PUP);
+#endif
+#ifdef IPPROTO_UDP
+ ADD_INT_MACRO(m, IPPROTO_UDP);
+#else
+ ADD_INT_CONST(m, "IPPROTO_UDP", 17);
+#endif
+#ifdef IPPROTO_UDPLITE
+ ADD_INT_MACRO(m, IPPROTO_UDPLITE);
+ #ifndef UDPLITE_SEND_CSCOV
+ #define UDPLITE_SEND_CSCOV 10
+ #endif
+ ADD_INT_MACRO(m, UDPLITE_SEND_CSCOV);
+ #ifndef UDPLITE_RECV_CSCOV
+ #define UDPLITE_RECV_CSCOV 11
+ #endif
+ ADD_INT_MACRO(m, UDPLITE_RECV_CSCOV);
+#endif
+#ifdef IPPROTO_IDP
+ ADD_INT_MACRO(m, IPPROTO_IDP);
+#endif
+#ifdef IPPROTO_HELLO
+ ADD_INT_MACRO(m, IPPROTO_HELLO);
+#endif
+#ifdef IPPROTO_ND
+ ADD_INT_MACRO(m, IPPROTO_ND);
+#endif
+#ifdef IPPROTO_TP
+ ADD_INT_MACRO(m, IPPROTO_TP);
+#endif
+#ifdef IPPROTO_ROUTING
+ ADD_INT_MACRO(m, IPPROTO_ROUTING);
+#endif
+#ifdef IPPROTO_FRAGMENT
+ ADD_INT_MACRO(m, IPPROTO_FRAGMENT);
+#endif
+#ifdef IPPROTO_RSVP
+ ADD_INT_MACRO(m, IPPROTO_RSVP);
+#endif
+#ifdef IPPROTO_GRE
+ ADD_INT_MACRO(m, IPPROTO_GRE);
+#endif
+#ifdef IPPROTO_ESP
+ ADD_INT_MACRO(m, IPPROTO_ESP);
+#endif
+#ifdef IPPROTO_AH
+ ADD_INT_MACRO(m, IPPROTO_AH);
+#endif
+#ifdef IPPROTO_MOBILE
+ ADD_INT_MACRO(m, IPPROTO_MOBILE);
+#endif
+#ifdef IPPROTO_ICMPV6
+ ADD_INT_MACRO(m, IPPROTO_ICMPV6);
+#endif
+#ifdef IPPROTO_NONE
+ ADD_INT_MACRO(m, IPPROTO_NONE);
+#endif
+#ifdef IPPROTO_DSTOPTS
+ ADD_INT_MACRO(m, IPPROTO_DSTOPTS);
+#endif
+#ifdef IPPROTO_XTP
+ ADD_INT_MACRO(m, IPPROTO_XTP);
+#endif
+#ifdef IPPROTO_EON
+ ADD_INT_MACRO(m, IPPROTO_EON);
+#endif
+#ifdef IPPROTO_PIM
+ ADD_INT_MACRO(m, IPPROTO_PIM);
+#endif
+#ifdef IPPROTO_IPCOMP
+ ADD_INT_MACRO(m, IPPROTO_IPCOMP);
+#endif
+#ifdef IPPROTO_VRRP
+ ADD_INT_MACRO(m, IPPROTO_VRRP);
+#endif
+#ifdef IPPROTO_SCTP
+ ADD_INT_MACRO(m, IPPROTO_SCTP);
+#endif
+#ifdef IPPROTO_BIP
+ ADD_INT_MACRO(m, IPPROTO_BIP);
+#endif
+#ifdef IPPROTO_MPTCP
+ ADD_INT_MACRO(m, IPPROTO_MPTCP);
+#endif
+/**/
+#ifdef IPPROTO_RAW
+ ADD_INT_MACRO(m, IPPROTO_RAW);
+#else
+ ADD_INT_CONST(m, "IPPROTO_RAW", 255);
+#endif
+#ifdef IPPROTO_MAX
+ ADD_INT_MACRO(m, IPPROTO_MAX);
+#endif
+
+#ifdef MS_WINDOWS
+ ADD_INT_MACRO(m, IPPROTO_ICLFXBM);
+ ADD_INT_MACRO(m, IPPROTO_ST);
+ ADD_INT_MACRO(m, IPPROTO_CBT);
+ ADD_INT_MACRO(m, IPPROTO_IGP);
+ ADD_INT_MACRO(m, IPPROTO_RDP);
+ ADD_INT_MACRO(m, IPPROTO_PGM);
+ ADD_INT_MACRO(m, IPPROTO_L2TP);
+ ADD_INT_MACRO(m, IPPROTO_SCTP);
+#endif
+
+#ifdef SYSPROTO_CONTROL
+ ADD_INT_MACRO(m, SYSPROTO_CONTROL);
+#endif
+
+ /* Some port configuration */
+#ifdef IPPORT_RESERVED
+ ADD_INT_MACRO(m, IPPORT_RESERVED);
+#else
+ ADD_INT_CONST(m, "IPPORT_RESERVED", 1024);
+#endif
+#ifdef IPPORT_USERRESERVED
+ ADD_INT_MACRO(m, IPPORT_USERRESERVED);
+#else
+ ADD_INT_CONST(m, "IPPORT_USERRESERVED", 5000);
+#endif
+
+ /* Some reserved IP v.4 addresses */
+#ifdef INADDR_ANY
+ ADD_INT_MACRO(m, INADDR_ANY);
+#else
+ ADD_INT_CONST(m, "INADDR_ANY", 0x00000000);
+#endif
+#ifdef INADDR_BROADCAST
+ ADD_INT_MACRO(m, INADDR_BROADCAST);
+#else
+ ADD_INT_CONST(m, "INADDR_BROADCAST", 0xffffffff);
+#endif
+#ifdef INADDR_LOOPBACK
+ ADD_INT_MACRO(m, INADDR_LOOPBACK);
+#else
+ ADD_INT_CONST(m, "INADDR_LOOPBACK", 0x7F000001);
+#endif
+#ifdef INADDR_UNSPEC_GROUP
+ ADD_INT_MACRO(m, INADDR_UNSPEC_GROUP);
+#else
+ ADD_INT_CONST(m, "INADDR_UNSPEC_GROUP", 0xe0000000);
+#endif
+#ifdef INADDR_ALLHOSTS_GROUP
+ ADD_INT_CONST(m, "INADDR_ALLHOSTS_GROUP",
+ INADDR_ALLHOSTS_GROUP);
+#else
+ ADD_INT_CONST(m, "INADDR_ALLHOSTS_GROUP", 0xe0000001);
+#endif
+#ifdef INADDR_MAX_LOCAL_GROUP
+ ADD_INT_MACRO(m, INADDR_MAX_LOCAL_GROUP);
+#else
+ ADD_INT_CONST(m, "INADDR_MAX_LOCAL_GROUP", 0xe00000ff);
+#endif
+#ifdef INADDR_NONE
+ ADD_INT_MACRO(m, INADDR_NONE);
+#else
+ ADD_INT_CONST(m, "INADDR_NONE", 0xffffffff);
+#endif
+
+ /* IPv4 [gs]etsockopt options */
+#ifdef IP_OPTIONS
+ ADD_INT_MACRO(m, IP_OPTIONS);
+#endif
+#ifdef IP_HDRINCL
+ ADD_INT_MACRO(m, IP_HDRINCL);
+#endif
+#ifdef IP_TOS
+ ADD_INT_MACRO(m, IP_TOS);
+#endif
+#ifdef IP_TTL
+ ADD_INT_MACRO(m, IP_TTL);
+#endif
+#ifdef IP_RECVOPTS
+ ADD_INT_MACRO(m, IP_RECVOPTS);
+#endif
+#ifdef IP_RECVRETOPTS
+ ADD_INT_MACRO(m, IP_RECVRETOPTS);
+#endif
+#ifdef IP_RECVTOS
+ ADD_INT_MACRO(m, IP_RECVTOS);
+#endif
+#ifdef IP_RECVDSTADDR
+ ADD_INT_MACRO(m, IP_RECVDSTADDR);
+#endif
+#ifdef IP_RETOPTS
+ ADD_INT_MACRO(m, IP_RETOPTS);
+#endif
+#ifdef IP_MULTICAST_IF
+ ADD_INT_MACRO(m, IP_MULTICAST_IF);
+#endif
+#ifdef IP_MULTICAST_TTL
+ ADD_INT_MACRO(m, IP_MULTICAST_TTL);
+#endif
+#ifdef IP_MULTICAST_LOOP
+ ADD_INT_MACRO(m, IP_MULTICAST_LOOP);
+#endif
+#ifdef IP_ADD_MEMBERSHIP
+ ADD_INT_MACRO(m, IP_ADD_MEMBERSHIP);
+#endif
+#ifdef IP_DROP_MEMBERSHIP
+ ADD_INT_MACRO(m, IP_DROP_MEMBERSHIP);
+#endif
+#ifdef IP_DEFAULT_MULTICAST_TTL
+ ADD_INT_MACRO(m, IP_DEFAULT_MULTICAST_TTL);
+#endif
+#ifdef IP_DEFAULT_MULTICAST_LOOP
+ ADD_INT_MACRO(m, IP_DEFAULT_MULTICAST_LOOP);
+#endif
+#ifdef IP_MAX_MEMBERSHIPS
+ ADD_INT_MACRO(m, IP_MAX_MEMBERSHIPS);
+#endif
+#ifdef IP_TRANSPARENT
+ ADD_INT_MACRO(m, IP_TRANSPARENT);
+#endif
+#ifdef IP_PKTINFO
+ ADD_INT_MACRO(m, IP_PKTINFO);
+#endif
+#ifdef IP_BIND_ADDRESS_NO_PORT
+ ADD_INT_MACRO(m, IP_BIND_ADDRESS_NO_PORT);
+#endif
+#ifdef IP_UNBLOCK_SOURCE
+ ADD_INT_MACRO(m, IP_UNBLOCK_SOURCE);
+#endif
+#ifdef IP_BLOCK_SOURCE
+ ADD_INT_MACRO(m, IP_BLOCK_SOURCE);
+#endif
+#ifdef IP_ADD_SOURCE_MEMBERSHIP
+ ADD_INT_MACRO(m, IP_ADD_SOURCE_MEMBERSHIP);
+#endif
+#ifdef IP_DROP_SOURCE_MEMBERSHIP
+ ADD_INT_MACRO(m, IP_DROP_SOURCE_MEMBERSHIP);
+#endif
+
+ /* IPv6 [gs]etsockopt options, defined in RFC2553 */
+#ifdef IPV6_JOIN_GROUP
+ ADD_INT_MACRO(m, IPV6_JOIN_GROUP);
+#endif
+#ifdef IPV6_LEAVE_GROUP
+ ADD_INT_MACRO(m, IPV6_LEAVE_GROUP);
+#endif
+#ifdef IPV6_MULTICAST_HOPS
+ ADD_INT_MACRO(m, IPV6_MULTICAST_HOPS);
+#endif
+#ifdef IPV6_MULTICAST_IF
+ ADD_INT_MACRO(m, IPV6_MULTICAST_IF);
+#endif
+#ifdef IPV6_MULTICAST_LOOP
+ ADD_INT_MACRO(m, IPV6_MULTICAST_LOOP);
+#endif
+#ifdef IPV6_UNICAST_HOPS
+ ADD_INT_MACRO(m, IPV6_UNICAST_HOPS);
+#endif
+ /* Additional IPV6 socket options, defined in RFC 3493 */
+#ifdef IPV6_V6ONLY
+ ADD_INT_MACRO(m, IPV6_V6ONLY);
+#endif
+ /* Advanced IPV6 socket options, from RFC 3542 */
+#ifdef IPV6_CHECKSUM
+ ADD_INT_MACRO(m, IPV6_CHECKSUM);
+#endif
+#ifdef IPV6_DONTFRAG
+ ADD_INT_MACRO(m, IPV6_DONTFRAG);
+#endif
+#ifdef IPV6_DSTOPTS
+ ADD_INT_MACRO(m, IPV6_DSTOPTS);
+#endif
+#ifdef IPV6_HOPLIMIT
+ ADD_INT_MACRO(m, IPV6_HOPLIMIT);
+#endif
+#ifdef IPV6_HOPOPTS
+ ADD_INT_MACRO(m, IPV6_HOPOPTS);
+#endif
+#ifdef IPV6_NEXTHOP
+ ADD_INT_MACRO(m, IPV6_NEXTHOP);
+#endif
+#ifdef IPV6_PATHMTU
+ ADD_INT_MACRO(m, IPV6_PATHMTU);
+#endif
+#ifdef IPV6_PKTINFO
+ ADD_INT_MACRO(m, IPV6_PKTINFO);
+#endif
+#ifdef IPV6_RECVDSTOPTS
+ ADD_INT_MACRO(m, IPV6_RECVDSTOPTS);
+#endif
+#ifdef IPV6_RECVHOPLIMIT
+ ADD_INT_MACRO(m, IPV6_RECVHOPLIMIT);
+#endif
+#ifdef IPV6_RECVHOPOPTS
+ ADD_INT_MACRO(m, IPV6_RECVHOPOPTS);
+#endif
+#ifdef IPV6_RECVPKTINFO
+ ADD_INT_MACRO(m, IPV6_RECVPKTINFO);
+#endif
+#ifdef IPV6_RECVRTHDR
+ ADD_INT_MACRO(m, IPV6_RECVRTHDR);
+#endif
+#ifdef IPV6_RECVTCLASS
+ ADD_INT_MACRO(m, IPV6_RECVTCLASS);
+#endif
+#ifdef IPV6_RTHDR
+ ADD_INT_MACRO(m, IPV6_RTHDR);
+#endif
+#ifdef IPV6_RTHDRDSTOPTS
+ ADD_INT_MACRO(m, IPV6_RTHDRDSTOPTS);
+#endif
+#ifdef IPV6_RTHDR_TYPE_0
+ ADD_INT_MACRO(m, IPV6_RTHDR_TYPE_0);
+#endif
+#ifdef IPV6_RECVPATHMTU
+ ADD_INT_MACRO(m, IPV6_RECVPATHMTU);
+#endif
+#ifdef IPV6_TCLASS
+ ADD_INT_MACRO(m, IPV6_TCLASS);
+#endif
+#ifdef IPV6_USE_MIN_MTU
+ ADD_INT_MACRO(m, IPV6_USE_MIN_MTU);
+#endif
+
+ /* TCP options */
+#ifdef TCP_NODELAY
+ ADD_INT_MACRO(m, TCP_NODELAY);
+#endif
+#ifdef TCP_MAXSEG
+ ADD_INT_MACRO(m, TCP_MAXSEG);
+#endif
+#ifdef TCP_CORK
+ ADD_INT_MACRO(m, TCP_CORK);
+#endif
+#ifdef TCP_KEEPIDLE
+ ADD_INT_MACRO(m, TCP_KEEPIDLE);
+#endif
+ /* TCP_KEEPALIVE is OSX's TCP_KEEPIDLE equivalent */
+#if defined(__APPLE__) && defined(TCP_KEEPALIVE)
+ ADD_INT_MACRO(m, TCP_KEEPALIVE);
+#endif
+#ifdef TCP_KEEPINTVL
+ ADD_INT_MACRO(m, TCP_KEEPINTVL);
+#endif
+#ifdef TCP_KEEPCNT
+ ADD_INT_MACRO(m, TCP_KEEPCNT);
+#endif
+#ifdef TCP_SYNCNT
+ ADD_INT_MACRO(m, TCP_SYNCNT);
+#endif
+#ifdef TCP_LINGER2
+ ADD_INT_MACRO(m, TCP_LINGER2);
+#endif
+#ifdef TCP_DEFER_ACCEPT
+ ADD_INT_MACRO(m, TCP_DEFER_ACCEPT);
+#endif
+#ifdef TCP_WINDOW_CLAMP
+ ADD_INT_MACRO(m, TCP_WINDOW_CLAMP);
+#endif
+#ifdef TCP_INFO
+ ADD_INT_MACRO(m, TCP_INFO);
+#endif
+#ifdef TCP_CONNECTION_INFO
+ ADD_INT_MACRO(m, TCP_CONNECTION_INFO);
+#endif
+#ifdef TCP_QUICKACK
+ ADD_INT_MACRO(m, TCP_QUICKACK);
+#endif
+#ifdef TCP_CONGESTION
+ ADD_INT_MACRO(m, TCP_CONGESTION);
+#endif
+#ifdef TCP_MD5SIG
+ ADD_INT_MACRO(m, TCP_MD5SIG);
+#endif
+#ifdef TCP_THIN_LINEAR_TIMEOUTS
+ ADD_INT_MACRO(m, TCP_THIN_LINEAR_TIMEOUTS);
+#endif
+#ifdef TCP_THIN_DUPACK
+ ADD_INT_MACRO(m, TCP_THIN_DUPACK);
+#endif
+#ifdef TCP_USER_TIMEOUT
+ ADD_INT_MACRO(m, TCP_USER_TIMEOUT);
+#endif
+#ifdef TCP_REPAIR
+ ADD_INT_MACRO(m, TCP_REPAIR);
+#endif
+#ifdef TCP_REPAIR_QUEUE
+ ADD_INT_MACRO(m, TCP_REPAIR_QUEUE);
+#endif
+#ifdef TCP_QUEUE_SEQ
+ ADD_INT_MACRO(m, TCP_QUEUE_SEQ);
+#endif
+#ifdef TCP_REPAIR_OPTIONS
+ ADD_INT_MACRO(m, TCP_REPAIR_OPTIONS);
+#endif
+#ifdef TCP_FASTOPEN
+ ADD_INT_MACRO(m, TCP_FASTOPEN);
+#endif
+#ifdef TCP_TIMESTAMP
+ ADD_INT_MACRO(m, TCP_TIMESTAMP);
+#endif
+#ifdef TCP_NOTSENT_LOWAT
+ ADD_INT_MACRO(m, TCP_NOTSENT_LOWAT);
+#endif
+#ifdef TCP_CC_INFO
+ ADD_INT_MACRO(m, TCP_CC_INFO);
+#endif
+#ifdef TCP_SAVE_SYN
+ ADD_INT_MACRO(m, TCP_SAVE_SYN);
+#endif
+#ifdef TCP_SAVED_SYN
+ ADD_INT_MACRO(m, TCP_SAVED_SYN);
+#endif
+#ifdef TCP_REPAIR_WINDOW
+ ADD_INT_MACRO(m, TCP_REPAIR_WINDOW);
+#endif
+#ifdef TCP_FASTOPEN_CONNECT
+ ADD_INT_MACRO(m, TCP_FASTOPEN_CONNECT);
+#endif
+#ifdef TCP_ULP
+ ADD_INT_MACRO(m, TCP_ULP);
+#endif
+#ifdef TCP_MD5SIG_EXT
+ ADD_INT_MACRO(m, TCP_MD5SIG_EXT);
+#endif
+#ifdef TCP_FASTOPEN_KEY
+ ADD_INT_MACRO(m, TCP_FASTOPEN_KEY);
+#endif
+#ifdef TCP_FASTOPEN_NO_COOKIE
+ ADD_INT_MACRO(m, TCP_FASTOPEN_NO_COOKIE);
+#endif
+#ifdef TCP_ZEROCOPY_RECEIVE
+ ADD_INT_MACRO(m, TCP_ZEROCOPY_RECEIVE);
+#endif
+#ifdef TCP_INQ
+ ADD_INT_MACRO(m, TCP_INQ);
+#endif
+#ifdef TCP_TX_DELAY
+ ADD_INT_MACRO(m, TCP_TX_DELAY);
+#endif
+
+ /* IPX options */
+#ifdef IPX_TYPE
+ ADD_INT_MACRO(m, IPX_TYPE);
+#endif
+
+/* Reliable Datagram Sockets */
+#ifdef RDS_CMSG_RDMA_ARGS
+ ADD_INT_MACRO(m, RDS_CMSG_RDMA_ARGS);
+#endif
+#ifdef RDS_CMSG_RDMA_DEST
+ ADD_INT_MACRO(m, RDS_CMSG_RDMA_DEST);
+#endif
+#ifdef RDS_CMSG_RDMA_MAP
+ ADD_INT_MACRO(m, RDS_CMSG_RDMA_MAP);
+#endif
+#ifdef RDS_CMSG_RDMA_STATUS
+ ADD_INT_MACRO(m, RDS_CMSG_RDMA_STATUS);
+#endif
+#ifdef RDS_CMSG_RDMA_UPDATE
+ ADD_INT_MACRO(m, RDS_CMSG_RDMA_UPDATE);
+#endif
+#ifdef RDS_RDMA_READWRITE
+ ADD_INT_MACRO(m, RDS_RDMA_READWRITE);
+#endif
+#ifdef RDS_RDMA_FENCE
+ ADD_INT_MACRO(m, RDS_RDMA_FENCE);
+#endif
+#ifdef RDS_RDMA_INVALIDATE
+ ADD_INT_MACRO(m, RDS_RDMA_INVALIDATE);
+#endif
+#ifdef RDS_RDMA_USE_ONCE
+ ADD_INT_MACRO(m, RDS_RDMA_USE_ONCE);
+#endif
+#ifdef RDS_RDMA_DONTWAIT
+ ADD_INT_MACRO(m, RDS_RDMA_DONTWAIT);
+#endif
+#ifdef RDS_RDMA_NOTIFY_ME
+ ADD_INT_MACRO(m, RDS_RDMA_NOTIFY_ME);
+#endif
+#ifdef RDS_RDMA_SILENT
+ ADD_INT_MACRO(m, RDS_RDMA_SILENT);
+#endif
+
+ /* get{addr,name}info parameters */
+#ifdef EAI_ADDRFAMILY
+ ADD_INT_MACRO(m, EAI_ADDRFAMILY);
+#endif
+#ifdef EAI_AGAIN
+ ADD_INT_MACRO(m, EAI_AGAIN);
+#endif
+#ifdef EAI_BADFLAGS
+ ADD_INT_MACRO(m, EAI_BADFLAGS);
+#endif
+#ifdef EAI_FAIL
+ ADD_INT_MACRO(m, EAI_FAIL);
+#endif
+#ifdef EAI_FAMILY
+ ADD_INT_MACRO(m, EAI_FAMILY);
+#endif
+#ifdef EAI_MEMORY
+ ADD_INT_MACRO(m, EAI_MEMORY);
+#endif
+#ifdef EAI_NODATA
+ ADD_INT_MACRO(m, EAI_NODATA);
+#endif
+#ifdef EAI_NONAME
+ ADD_INT_MACRO(m, EAI_NONAME);
+#endif
+#ifdef EAI_OVERFLOW
+ ADD_INT_MACRO(m, EAI_OVERFLOW);
+#endif
+#ifdef EAI_SERVICE
+ ADD_INT_MACRO(m, EAI_SERVICE);
+#endif
+#ifdef EAI_SOCKTYPE
+ ADD_INT_MACRO(m, EAI_SOCKTYPE);
+#endif
+#ifdef EAI_SYSTEM
+ ADD_INT_MACRO(m, EAI_SYSTEM);
+#endif
+#ifdef EAI_BADHINTS
+ ADD_INT_MACRO(m, EAI_BADHINTS);
+#endif
+#ifdef EAI_PROTOCOL
+ ADD_INT_MACRO(m, EAI_PROTOCOL);
+#endif
+#ifdef EAI_MAX
+ ADD_INT_MACRO(m, EAI_MAX);
+#endif
+#ifdef AI_PASSIVE
+ ADD_INT_MACRO(m, AI_PASSIVE);
+#endif
+#ifdef AI_CANONNAME
+ ADD_INT_MACRO(m, AI_CANONNAME);
+#endif
+#ifdef AI_NUMERICHOST
+ ADD_INT_MACRO(m, AI_NUMERICHOST);
+#endif
+#ifdef AI_NUMERICSERV
+ ADD_INT_MACRO(m, AI_NUMERICSERV);
+#endif
+#ifdef AI_MASK
+ ADD_INT_MACRO(m, AI_MASK);
+#endif
+#ifdef AI_ALL
+ ADD_INT_MACRO(m, AI_ALL);
+#endif
+#ifdef AI_V4MAPPED_CFG
+ ADD_INT_MACRO(m, AI_V4MAPPED_CFG);
+#endif
+#ifdef AI_ADDRCONFIG
+ ADD_INT_MACRO(m, AI_ADDRCONFIG);
+#endif
+#ifdef AI_V4MAPPED
+ ADD_INT_MACRO(m, AI_V4MAPPED);
+#endif
+#ifdef AI_DEFAULT
+ ADD_INT_MACRO(m, AI_DEFAULT);
+#endif
+#ifdef NI_MAXHOST
+ ADD_INT_MACRO(m, NI_MAXHOST);
+#endif
+#ifdef NI_MAXSERV
+ ADD_INT_MACRO(m, NI_MAXSERV);
+#endif
+#ifdef NI_NOFQDN
+ ADD_INT_MACRO(m, NI_NOFQDN);
+#endif
+#ifdef NI_NUMERICHOST
+ ADD_INT_MACRO(m, NI_NUMERICHOST);
+#endif
+#ifdef NI_NAMEREQD
+ ADD_INT_MACRO(m, NI_NAMEREQD);
+#endif
+#ifdef NI_NUMERICSERV
+ ADD_INT_MACRO(m, NI_NUMERICSERV);
+#endif
+#ifdef NI_DGRAM
+ ADD_INT_MACRO(m, NI_DGRAM);
+#endif
+
+ /* shutdown() parameters */
+#ifdef SHUT_RD
+ ADD_INT_MACRO(m, SHUT_RD);
+#elif defined(SD_RECEIVE)
+ ADD_INT_CONST(m, "SHUT_RD", SD_RECEIVE);
+#else
+ ADD_INT_CONST(m, "SHUT_RD", 0);
+#endif
+#ifdef SHUT_WR
+ ADD_INT_MACRO(m, SHUT_WR);
+#elif defined(SD_SEND)
+ ADD_INT_CONST(m, "SHUT_WR", SD_SEND);
+#else
+ ADD_INT_CONST(m, "SHUT_WR", 1);
+#endif
+#ifdef SHUT_RDWR
+ ADD_INT_MACRO(m, SHUT_RDWR);
+#elif defined(SD_BOTH)
+ ADD_INT_CONST(m, "SHUT_RDWR", SD_BOTH);
+#else
+ ADD_INT_CONST(m, "SHUT_RDWR", 2);
+#endif
+
+#ifdef SIO_RCVALL
+ {
+ DWORD codes[] = {SIO_RCVALL, SIO_KEEPALIVE_VALS,
+#if defined(SIO_LOOPBACK_FAST_PATH)
+ SIO_LOOPBACK_FAST_PATH
+#endif
+ };
+ const char *names[] = {"SIO_RCVALL", "SIO_KEEPALIVE_VALS",
+#if defined(SIO_LOOPBACK_FAST_PATH)
+ "SIO_LOOPBACK_FAST_PATH"
+#endif
+ };
+ int i;
+ for (i = 0; i < Py_ARRAY_LENGTH(codes); ++i) {
+ PyObject *tmp = PyLong_FromUnsignedLong(codes[i]);
+ if (tmp == NULL) {
+ goto error;
+ }
+ int rc = PyModule_AddObjectRef(m, names[i], tmp);
+ Py_DECREF(tmp);
+ if (rc < 0) {
+ goto error;
+ }
+ }
+ }
+ ADD_INT_MACRO(m, RCVALL_OFF);
+ ADD_INT_MACRO(m, RCVALL_ON);
+ ADD_INT_MACRO(m, RCVALL_SOCKETLEVELONLY);
+#ifdef RCVALL_IPLEVEL
+ ADD_INT_MACRO(m, RCVALL_IPLEVEL);
+#endif
+#ifdef RCVALL_MAX
+ ADD_INT_MACRO(m, RCVALL_MAX);
+#endif
+#endif /* _MSTCPIP_ */
+
+ /* Initialize gethostbyname lock */
+#if defined(USE_GETHOSTBYNAME_LOCK)
+ netdb_lock = PyThread_allocate_lock();
+#endif
+
+#ifdef MS_WINDOWS
+ /* remove some flags on older version Windows during run-time */
+ if (remove_unusable_flags(m) < 0) {
+ goto error;
+ }
+#endif
+
+#undef ADD_INT_MACRO
+#undef ADD_INT_CONST
+#undef ADD_STR_CONST
+
+ return 0;
+
+error:
+ return -1;
+}
+
+static struct PyModuleDef_Slot socket_slots[] = {
+ {Py_mod_exec, socket_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL},
+};
+
+static int
+socket_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ socket_state *state = get_module_state(mod);
+ Py_VISIT(state->sock_type);
+ Py_VISIT(state->socket_herror);
+ Py_VISIT(state->socket_gaierror);
+ return 0;
+}
+
+static int
+socket_clear(PyObject *mod)
+{
+ socket_state *state = get_module_state(mod);
+ Py_CLEAR(state->sock_type);
+ Py_CLEAR(state->socket_herror);
+ Py_CLEAR(state->socket_gaierror);
+ return 0;
+}
+
+static void
+socket_free(void *mod)
+{
+ (void)socket_clear((PyObject *)mod);
+}
+
+static struct PyModuleDef socketmodule = {
+ .m_base = PyModuleDef_HEAD_INIT,
+ .m_name = PySocket_MODULE_NAME,
+ .m_doc = socket_doc,
+ .m_size = sizeof(socket_state),
+ .m_methods = socket_methods,
+ .m_slots = socket_slots,
+ .m_traverse = socket_traverse,
+ .m_clear = socket_clear,
+ .m_free = socket_free,
+};
+
+PyMODINIT_FUNC
+PyInit__socket(void)
+{
+ return PyModuleDef_Init(&socketmodule);
+}
diff --git a/contrib/tools/python3/Modules/socketmodule.h b/contrib/tools/python3/Modules/socketmodule.h
new file mode 100644
index 00000000000..d55c02fd156
--- /dev/null
+++ b/contrib/tools/python3/Modules/socketmodule.h
@@ -0,0 +1,391 @@
+/* Socket module header file */
+
+/* Includes needed for the sockaddr_* symbols below */
+#ifndef MS_WINDOWS
+#ifdef __VMS
+# include <socket.h>
+# else
+# include <sys/socket.h>
+# endif
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+
+#else /* MS_WINDOWS */
+# include <winsock2.h>
+
+/*
+ * If Windows has bluetooth support, include bluetooth constants.
+ */
+#ifdef AF_BTH
+# include <ws2bth.h>
+# include <pshpack1.h>
+
+/*
+ * The current implementation assumes the bdaddr in the sockaddr structs
+ * will be a bdaddr_t. We treat this as an opaque type: on *nix systems, it
+ * will be a struct with a single member (an array of six bytes). On windows,
+ * we typedef this to ULONGLONG to match the Windows definition.
+ */
+typedef ULONGLONG bdaddr_t;
+
+/*
+ * Redefine SOCKADDR_BTH to provide names compatible with _BT_RC_MEMB() macros.
+ */
+struct SOCKADDR_BTH_REDEF {
+ union {
+ USHORT addressFamily;
+ USHORT family;
+ };
+
+ union {
+ ULONGLONG btAddr;
+ bdaddr_t bdaddr;
+ };
+
+ GUID serviceClassId;
+
+ union {
+ ULONG port;
+ ULONG channel;
+ };
+
+};
+# include <poppack.h>
+#endif
+
+/* Windows 'supports' CMSG_LEN, but does not follow the POSIX standard
+ * interface at all, so there is no point including the code that
+ * attempts to use it.
+ */
+# ifdef PySocket_BUILDING_SOCKET
+# undef CMSG_LEN
+# endif
+# include <ws2tcpip.h>
+/* VC6 is shipped with old platform headers, and does not have MSTcpIP.h
+ * Separate SDKs have all the functions we want, but older ones don't have
+ * any version information.
+ * I use SIO_GET_MULTICAST_FILTER to detect a decent SDK.
+ */
+# ifdef SIO_GET_MULTICAST_FILTER
+# include <mstcpip.h> /* for SIO_RCVALL */
+# define HAVE_ADDRINFO
+# define HAVE_SOCKADDR_STORAGE
+# define HAVE_GETADDRINFO
+# define HAVE_GETNAMEINFO
+# define ENABLE_IPV6
+# else
+typedef int socklen_t;
+# endif /* IPPROTO_IPV6 */
+
+/* Remove ifdef once Py_WINVER >= 0x0604
+ * socket.h only defines AF_HYPERV if _WIN32_WINNT is at that level or higher
+ * so for now it's just manually defined.
+ */
+# ifndef AF_HYPERV
+# define AF_HYPERV 34
+# endif
+# include <hvsocket.h>
+#endif /* MS_WINDOWS */
+
+#ifdef HAVE_SYS_UN_H
+# include <sys/un.h>
+#else
+# undef AF_UNIX
+#endif
+
+#ifdef HAVE_LINUX_NETLINK_H
+# ifdef HAVE_ASM_TYPES_H
+# include <asm/types.h>
+# endif
+# include <linux/netlink.h>
+#else
+# undef AF_NETLINK
+#endif
+
+#ifdef HAVE_LINUX_QRTR_H
+# ifdef HAVE_ASM_TYPES_H
+# include <asm/types.h>
+# endif
+# include <linux/qrtr.h>
+#else
+# undef AF_QIPCRTR
+#endif
+
+#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
+#error #include <bluetooth/bluetooth.h>
+#error #include <bluetooth/rfcomm.h>
+#error #include <bluetooth/l2cap.h>
+#error #include <bluetooth/sco.h>
+#error #include <bluetooth/hci.h>
+#endif
+
+#ifdef HAVE_BLUETOOTH_H
+#error #include <bluetooth.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+
+#ifdef HAVE_NETPACKET_PACKET_H
+# include <sys/ioctl.h>
+# include <netpacket/packet.h>
+#endif
+
+#ifdef HAVE_LINUX_TIPC_H
+# include <linux/tipc.h>
+#endif
+
+#ifdef HAVE_LINUX_CAN_H
+# include <linux/can.h>
+#elif defined(HAVE_NETCAN_CAN_H)
+# error #include <netcan/can.h>
+#else
+# undef AF_CAN
+# undef PF_CAN
+#endif
+
+#ifdef HAVE_LINUX_CAN_RAW_H
+#include <linux/can/raw.h>
+#endif
+
+#ifdef HAVE_LINUX_CAN_BCM_H
+#include <linux/can/bcm.h>
+#endif
+
+#ifdef HAVE_LINUX_CAN_J1939_H
+#include <linux/can/j1939.h>
+#endif
+
+#ifdef HAVE_SYS_SYS_DOMAIN_H
+#include <sys/sys_domain.h>
+#endif
+#ifdef HAVE_SYS_KERN_CONTROL_H
+#include <sys/kern_control.h>
+#endif
+
+#ifdef HAVE_LINUX_VM_SOCKETS_H
+# include <linux/vm_sockets.h>
+#else
+# undef AF_VSOCK
+#endif
+
+#ifdef HAVE_SOCKADDR_ALG
+
+# include <linux/if_alg.h>
+# ifndef AF_ALG
+# define AF_ALG 38
+# endif
+# ifndef SOL_ALG
+# define SOL_ALG 279
+# endif
+
+/* Linux 3.19 */
+# ifndef ALG_SET_AEAD_ASSOCLEN
+# define ALG_SET_AEAD_ASSOCLEN 4
+# endif
+# ifndef ALG_SET_AEAD_AUTHSIZE
+# define ALG_SET_AEAD_AUTHSIZE 5
+# endif
+/* Linux 4.8 */
+# ifndef ALG_SET_PUBKEY
+# define ALG_SET_PUBKEY 6
+# endif
+
+# ifndef ALG_OP_SIGN
+# define ALG_OP_SIGN 2
+# endif
+# ifndef ALG_OP_VERIFY
+# define ALG_OP_VERIFY 3
+# endif
+
+#endif /* HAVE_SOCKADDR_ALG */
+
+#ifdef __EMSCRIPTEN__
+// wasm32-emscripten sockets only support subset of IPv4 and IPv6.
+// SCTP protocol crashes runtime.
+#ifdef IPPROTO_SCTP
+# undef IPPROTO_SCTP
+#endif
+// setsockopt() fails with ENOPROTOOPT, getsockopt only supports SO_ERROR.
+// undef SO_REUSEADDR and SO_REUSEPORT so they cannot be used.
+#ifdef SO_REUSEADDR
+# undef SO_REUSEADDR
+#endif
+#ifdef SO_REUSEPORT
+# undef SO_REUSEPORT
+#endif
+#endif // __EMSCRIPTEN__
+
+#ifndef Py__SOCKET_H
+#define Py__SOCKET_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Python module and C API name */
+#define PySocket_MODULE_NAME "_socket"
+#define PySocket_CAPI_NAME "CAPI"
+#define PySocket_CAPSULE_NAME PySocket_MODULE_NAME "." PySocket_CAPI_NAME
+
+/* Abstract the socket file descriptor type */
+#ifdef MS_WINDOWS
+typedef SOCKET SOCKET_T;
+# ifdef MS_WIN64
+# define SIZEOF_SOCKET_T 8
+# else
+# define SIZEOF_SOCKET_T 4
+# endif
+#else
+typedef int SOCKET_T;
+# define SIZEOF_SOCKET_T SIZEOF_INT
+#endif
+
+#if SIZEOF_SOCKET_T <= SIZEOF_LONG
+#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
+#else
+#define PyLong_FromSocket_t(fd) PyLong_FromLongLong((SOCKET_T)(fd))
+#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
+#endif
+
+// AF_HYPERV is only supported on Windows
+#if defined(AF_HYPERV) && defined(MS_WINDOWS)
+# define HAVE_AF_HYPERV
+#endif
+
+/* Socket address */
+typedef union sock_addr {
+ struct sockaddr_in in;
+ struct sockaddr sa;
+#ifdef AF_UNIX
+ struct sockaddr_un un;
+#endif
+#ifdef AF_NETLINK
+ struct sockaddr_nl nl;
+#endif
+#ifdef ENABLE_IPV6
+ struct sockaddr_in6 in6;
+ struct sockaddr_storage storage;
+#endif
+#if defined(HAVE_BLUETOOTH_H) && defined(__FreeBSD__)
+ struct sockaddr_l2cap bt_l2;
+ struct sockaddr_rfcomm bt_rc;
+ struct sockaddr_sco bt_sco;
+ struct sockaddr_hci bt_hci;
+#elif defined(HAVE_BLUETOOTH_BLUETOOTH_H)
+ struct sockaddr_l2 bt_l2;
+ struct sockaddr_rc bt_rc;
+ struct sockaddr_sco bt_sco;
+ struct sockaddr_hci bt_hci;
+#elif defined(MS_WINDOWS)
+ struct SOCKADDR_BTH_REDEF bt_rc;
+#endif
+#ifdef HAVE_NETPACKET_PACKET_H
+ struct sockaddr_ll ll;
+#endif
+#if defined(HAVE_LINUX_CAN_H) || defined(HAVE_NETCAN_CAN_H)
+ struct sockaddr_can can;
+#endif
+#ifdef HAVE_SYS_KERN_CONTROL_H
+ struct sockaddr_ctl ctl;
+#endif
+#ifdef HAVE_SOCKADDR_ALG
+ struct sockaddr_alg alg;
+#endif
+#ifdef AF_QIPCRTR
+ struct sockaddr_qrtr sq;
+#endif
+#ifdef AF_VSOCK
+ struct sockaddr_vm vm;
+#endif
+#ifdef HAVE_LINUX_TIPC_H
+ struct sockaddr_tipc tipc;
+#endif
+#ifdef HAVE_AF_HYPERV
+ SOCKADDR_HV hv;
+#endif
+} sock_addr_t;
+
+/* The object holding a socket. It holds some extra information,
+ like the address family, which is used to decode socket address
+ arguments properly. */
+
+typedef struct {
+ PyObject_HEAD
+ SOCKET_T sock_fd; /* Socket file descriptor */
+ int sock_family; /* Address family, e.g., AF_INET */
+ int sock_type; /* Socket type, e.g., SOCK_STREAM */
+ int sock_proto; /* Protocol type, usually 0 */
+ PyObject *(*errorhandler)(void); /* Error handler; checks
+ errno, returns NULL and
+ sets a Python exception */
+ _PyTime_t sock_timeout; /* Operation timeout in seconds;
+ 0.0 means non-blocking */
+ struct _socket_state *state;
+} PySocketSockObject;
+
+/* --- C API ----------------------------------------------------*/
+
+/* Short explanation of what this C API export mechanism does
+ and how it works:
+
+ The _ssl module needs access to the type object defined in
+ the _socket module. Since cross-DLL linking introduces a lot of
+ problems on many platforms, the "trick" is to wrap the
+ C API of a module in a struct which then gets exported to
+ other modules via a PyCapsule.
+
+ The code in socketmodule.c defines this struct (which currently
+ only contains the type object reference, but could very
+ well also include other C APIs needed by other modules)
+ and exports it as PyCapsule via the module dictionary
+ under the name "CAPI".
+
+ Other modules can now include the socketmodule.h file
+ which defines the needed C APIs to import and set up
+ a static copy of this struct in the importing module.
+
+ After initialization, the importing module can then
+ access the C APIs from the _socket module by simply
+ referring to the static struct, e.g.
+
+ Load _socket module and its C API; this sets up the global
+ PySocketModule:
+
+ if (PySocketModule_ImportModuleAndAPI())
+ return;
+
+
+ Now use the C API as if it were defined in the using
+ module:
+
+ if (!PyArg_ParseTuple(args, "O!|zz:ssl",
+
+ PySocketModule.Sock_Type,
+
+ (PyObject*)&Sock,
+ &key_file, &cert_file))
+ return NULL;
+
+ Support could easily be extended to export more C APIs/symbols
+ this way. Currently, only the type object is exported,
+ other candidates would be socket constructors and socket
+ access functions.
+
+*/
+
+/* C API for usage by other Python modules.
+ * Always add new things to the end for binary compatibility. */
+typedef struct {
+ PyTypeObject *Sock_Type;
+ PyObject *error;
+ PyObject *timeout_error;
+} PySocketModule_APIObject;
+
+#define PySocketModule_ImportModuleAndAPI() PyCapsule_Import(PySocket_CAPSULE_NAME, 1)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py__SOCKET_H */
diff --git a/contrib/tools/python3/Modules/spwdmodule.c b/contrib/tools/python3/Modules/spwdmodule.c
new file mode 100644
index 00000000000..13f1115feef
--- /dev/null
+++ b/contrib/tools/python3/Modules/spwdmodule.c
@@ -0,0 +1,268 @@
+
+/* UNIX shadow password file access module */
+/* A lot of code has been taken from pwdmodule.c */
+/* For info also see http://www.unixpapa.com/incnote/passwd.html */
+
+#include "Python.h"
+
+#include <sys/types.h>
+#ifdef HAVE_SHADOW_H
+#include <shadow.h>
+#endif
+
+#include "clinic/spwdmodule.c.h"
+
+/*[clinic input]
+module spwd
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c0b841b90a6a07ce]*/
+
+PyDoc_STRVAR(spwd__doc__,
+"This module provides access to the Unix shadow password database.\n\
+It is available on various Unix versions.\n\
+\n\
+Shadow password database entries are reported as 9-tuples of type struct_spwd,\n\
+containing the following items from the password database (see `<shadow.h>'):\n\
+sp_namp, sp_pwdp, sp_lstchg, sp_min, sp_max, sp_warn, sp_inact, sp_expire, sp_flag.\n\
+The sp_namp and sp_pwdp are strings, the rest are integers.\n\
+An exception is raised if the entry asked for cannot be found.\n\
+You have to be root to be able to use this module.");
+
+
+#if defined(HAVE_GETSPNAM) || defined(HAVE_GETSPENT)
+
+static PyStructSequence_Field struct_spwd_type_fields[] = {
+ {"sp_namp", "login name"},
+ {"sp_pwdp", "encrypted password"},
+ {"sp_lstchg", "date of last change"},
+ {"sp_min", "min #days between changes"},
+ {"sp_max", "max #days between changes"},
+ {"sp_warn", "#days before pw expires to warn user about it"},
+ {"sp_inact", "#days after pw expires until account is disabled"},
+ {"sp_expire", "#days since 1970-01-01 when account expires"},
+ {"sp_flag", "reserved"},
+ {"sp_nam", "login name; deprecated"}, /* Backward compatibility */
+ {"sp_pwd", "encrypted password; deprecated"}, /* Backward compatibility */
+ {0}
+};
+
+PyDoc_STRVAR(struct_spwd__doc__,
+"spwd.struct_spwd: Results from getsp*() routines.\n\n\
+This object may be accessed either as a 9-tuple of\n\
+ (sp_namp,sp_pwdp,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire,sp_flag)\n\
+or via the object attributes as named in the above tuple.");
+
+static PyStructSequence_Desc struct_spwd_type_desc = {
+ "spwd.struct_spwd",
+ struct_spwd__doc__,
+ struct_spwd_type_fields,
+ 9,
+};
+
+typedef struct {
+ PyTypeObject *StructSpwdType;
+} spwdmodulestate;
+
+static inline spwdmodulestate*
+get_spwd_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (spwdmodulestate *)state;
+}
+
+static struct PyModuleDef spwdmodule;
+
+static void
+sets(PyObject *v, int i, const char* val)
+{
+ if (val) {
+ PyObject *o = PyUnicode_DecodeFSDefault(val);
+ PyStructSequence_SET_ITEM(v, i, o);
+ } else {
+ PyStructSequence_SET_ITEM(v, i, Py_None);
+ Py_INCREF(Py_None);
+ }
+}
+
+static PyObject *mkspent(PyObject *module, struct spwd *p)
+{
+ int setIndex = 0;
+ PyObject *v = PyStructSequence_New(get_spwd_state(module)->StructSpwdType);
+ if (v == NULL)
+ return NULL;
+
+#define SETI(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val))
+#define SETS(i,val) sets(v, i, val)
+
+ SETS(setIndex++, p->sp_namp);
+ SETS(setIndex++, p->sp_pwdp);
+ SETI(setIndex++, p->sp_lstchg);
+ SETI(setIndex++, p->sp_min);
+ SETI(setIndex++, p->sp_max);
+ SETI(setIndex++, p->sp_warn);
+ SETI(setIndex++, p->sp_inact);
+ SETI(setIndex++, p->sp_expire);
+ SETI(setIndex++, p->sp_flag);
+ SETS(setIndex++, p->sp_namp); /* Backward compatibility for sp_nam */
+ SETS(setIndex++, p->sp_pwdp); /* Backward compatibility for sp_pwd */
+
+#undef SETS
+#undef SETI
+
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ return NULL;
+ }
+
+ return v;
+}
+
+#endif /* HAVE_GETSPNAM || HAVE_GETSPENT */
+
+
+#ifdef HAVE_GETSPNAM
+
+/*[clinic input]
+spwd.getspnam
+
+ arg: unicode
+ /
+
+Return the shadow password database entry for the given user name.
+
+See `help(spwd)` for more on shadow password database entries.
+[clinic start generated code]*/
+
+static PyObject *
+spwd_getspnam_impl(PyObject *module, PyObject *arg)
+/*[clinic end generated code: output=701250cf57dc6ebe input=dd89429e6167a00f]*/
+{
+ char *name;
+ struct spwd *p;
+ PyObject *bytes, *retval = NULL;
+
+ if ((bytes = PyUnicode_EncodeFSDefault(arg)) == NULL)
+ return NULL;
+ /* check for embedded null bytes */
+ if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1)
+ goto out;
+ if ((p = getspnam(name)) == NULL) {
+ if (errno != 0)
+ PyErr_SetFromErrno(PyExc_OSError);
+ else
+ PyErr_SetString(PyExc_KeyError, "getspnam(): name not found");
+ goto out;
+ }
+ retval = mkspent(module, p);
+out:
+ Py_DECREF(bytes);
+ return retval;
+}
+
+#endif /* HAVE_GETSPNAM */
+
+#ifdef HAVE_GETSPENT
+
+/*[clinic input]
+spwd.getspall
+
+Return a list of all available shadow password database entries, in arbitrary order.
+
+See `help(spwd)` for more on shadow password database entries.
+[clinic start generated code]*/
+
+static PyObject *
+spwd_getspall_impl(PyObject *module)
+/*[clinic end generated code: output=4fda298d6bf6d057 input=b2c84b7857d622bd]*/
+{
+ PyObject *d;
+ struct spwd *p;
+ if ((d = PyList_New(0)) == NULL)
+ return NULL;
+ setspent();
+ while ((p = getspent()) != NULL) {
+ PyObject *v = mkspent(module, p);
+ if (v == NULL || PyList_Append(d, v) != 0) {
+ Py_XDECREF(v);
+ Py_DECREF(d);
+ endspent();
+ return NULL;
+ }
+ Py_DECREF(v);
+ }
+ endspent();
+ return d;
+}
+
+#endif /* HAVE_GETSPENT */
+
+static PyMethodDef spwd_methods[] = {
+#ifdef HAVE_GETSPNAM
+ SPWD_GETSPNAM_METHODDEF
+#endif
+#ifdef HAVE_GETSPENT
+ SPWD_GETSPALL_METHODDEF
+#endif
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+spwdmodule_exec(PyObject *module)
+{
+ spwdmodulestate *state = get_spwd_state(module);
+
+ state->StructSpwdType = PyStructSequence_NewType(&struct_spwd_type_desc);
+ if (state->StructSpwdType == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->StructSpwdType) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot spwdmodule_slots[] = {
+ {Py_mod_exec, spwdmodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static int spwdmodule_traverse(PyObject *m, visitproc visit, void *arg) {
+ Py_VISIT(get_spwd_state(m)->StructSpwdType);
+ return 0;
+}
+
+static int spwdmodule_clear(PyObject *m) {
+ Py_CLEAR(get_spwd_state(m)->StructSpwdType);
+ return 0;
+}
+
+static void spwdmodule_free(void *m) {
+ spwdmodule_clear((PyObject *)m);
+}
+
+static struct PyModuleDef spwdmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "spwd",
+ .m_doc = spwd__doc__,
+ .m_size = sizeof(spwdmodulestate),
+ .m_methods = spwd_methods,
+ .m_slots = spwdmodule_slots,
+ .m_traverse = spwdmodule_traverse,
+ .m_clear = spwdmodule_clear,
+ .m_free = spwdmodule_free,
+};
+
+PyMODINIT_FUNC
+PyInit_spwd(void)
+{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "'spwd' is deprecated and slated for removal in "
+ "Python 3.13",
+ 7)) {
+ return NULL;
+ }
+
+ return PyModuleDef_Init(&spwdmodule);
+}
diff --git a/contrib/tools/python3/Modules/symtablemodule.c b/contrib/tools/python3/Modules/symtablemodule.c
new file mode 100644
index 00000000000..1f09c23bb85
--- /dev/null
+++ b/contrib/tools/python3/Modules/symtablemodule.c
@@ -0,0 +1,127 @@
+#include "Python.h"
+#include "pycore_symtable.h" // struct symtable
+
+#include "clinic/symtablemodule.c.h"
+/*[clinic input]
+module _symtable
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f4685845a7100605]*/
+
+
+/*[clinic input]
+_symtable.symtable
+
+ source: object
+ filename: object(converter='PyUnicode_FSDecoder')
+ startstr: str
+ /
+
+Return symbol and scope dictionaries used internally by compiler.
+[clinic start generated code]*/
+
+static PyObject *
+_symtable_symtable_impl(PyObject *module, PyObject *source,
+ PyObject *filename, const char *startstr)
+/*[clinic end generated code: output=59eb0d5fc7285ac4 input=9dd8a50c0c36a4d7]*/
+{
+ struct symtable *st;
+ PyObject *t;
+ int start;
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
+ PyObject *source_copy = NULL;
+
+ cf.cf_flags = PyCF_SOURCE_IS_UTF8;
+
+ const char *str = _Py_SourceAsString(source, "symtable", "string or bytes", &cf, &source_copy);
+ if (str == NULL) {
+ return NULL;
+ }
+
+ if (strcmp(startstr, "exec") == 0)
+ start = Py_file_input;
+ else if (strcmp(startstr, "eval") == 0)
+ start = Py_eval_input;
+ else if (strcmp(startstr, "single") == 0)
+ start = Py_single_input;
+ else {
+ PyErr_SetString(PyExc_ValueError,
+ "symtable() arg 3 must be 'exec' or 'eval' or 'single'");
+ Py_DECREF(filename);
+ Py_XDECREF(source_copy);
+ return NULL;
+ }
+ st = _Py_SymtableStringObjectFlags(str, filename, start, &cf);
+ Py_DECREF(filename);
+ Py_XDECREF(source_copy);
+ if (st == NULL) {
+ return NULL;
+ }
+ t = Py_NewRef(st->st_top);
+ _PySymtable_Free(st);
+ return t;
+}
+
+static PyMethodDef symtable_methods[] = {
+ _SYMTABLE_SYMTABLE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+symtable_init_constants(PyObject *m)
+{
+ if (PyModule_AddIntMacro(m, USE) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_GLOBAL) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_NONLOCAL) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_LOCAL) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_PARAM) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_FREE) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_FREE_CLASS) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_IMPORT) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_BOUND) < 0) return -1;
+ if (PyModule_AddIntMacro(m, DEF_ANNOT) < 0) return -1;
+
+ if (PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock) < 0)
+ return -1;
+ if (PyModule_AddIntConstant(m, "TYPE_CLASS", ClassBlock) < 0) return -1;
+ if (PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock) < 0)
+ return -1;
+ if (PyModule_AddIntConstant(m, "TYPE_ANNOTATION", AnnotationBlock) < 0)
+ return -1;
+ if (PyModule_AddIntConstant(m, "TYPE_TYPE_VAR_BOUND", TypeVarBoundBlock) < 0)
+ return -1;
+ if (PyModule_AddIntConstant(m, "TYPE_TYPE_ALIAS", TypeAliasBlock) < 0)
+ return -1;
+ if (PyModule_AddIntConstant(m, "TYPE_TYPE_PARAM", TypeParamBlock) < 0)
+ return -1;
+
+ if (PyModule_AddIntMacro(m, LOCAL) < 0) return -1;
+ if (PyModule_AddIntMacro(m, GLOBAL_EXPLICIT) < 0) return -1;
+ if (PyModule_AddIntMacro(m, GLOBAL_IMPLICIT) < 0) return -1;
+ if (PyModule_AddIntMacro(m, FREE) < 0) return -1;
+ if (PyModule_AddIntMacro(m, CELL) < 0) return -1;
+
+ if (PyModule_AddIntConstant(m, "SCOPE_OFF", SCOPE_OFFSET) < 0) return -1;
+ if (PyModule_AddIntMacro(m, SCOPE_MASK) < 0) return -1;
+
+ return 0;
+}
+
+static PyModuleDef_Slot symtable_slots[] = {
+ {Py_mod_exec, symtable_init_constants},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef symtablemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_symtable",
+ .m_size = 0,
+ .m_methods = symtable_methods,
+ .m_slots = symtable_slots,
+};
+
+PyMODINIT_FUNC
+PyInit__symtable(void)
+{
+ return PyModuleDef_Init(&symtablemodule);
+}
diff --git a/contrib/tools/python3/Modules/syslogmodule.c b/contrib/tools/python3/Modules/syslogmodule.c
new file mode 100644
index 00000000000..6db8de9c491
--- /dev/null
+++ b/contrib/tools/python3/Modules/syslogmodule.c
@@ -0,0 +1,427 @@
+/***********************************************************
+Copyright 1994 by Lance Ellinghouse,
+Cathedral City, California Republic, United States of America.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Lance Ellinghouse
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+
+LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL,
+INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+/******************************************************************
+
+Revision history:
+
+2010/04/20 (Sean Reifschneider)
+ - Use basename(sys.argv[0]) for the default "ident".
+ - Arguments to openlog() are now keyword args and are all optional.
+ - syslog() calls openlog() if it hasn't already been called.
+
+1998/04/28 (Sean Reifschneider)
+ - When facility not specified to syslog() method, use default from openlog()
+ (This is how it was claimed to work in the documentation)
+ - Potential resource leak of o_ident, now cleaned up in closelog()
+ - Minor comment accuracy fix.
+
+95/06/29 (Steve Clift)
+ - Changed arg parsing to use PyArg_ParseTuple.
+ - Added PyErr_Clear() call(s) where needed.
+ - Fix core dumps if user message contains format specifiers.
+ - Change openlog arg defaults to match normal syslog behavior.
+ - Plug memory leak in openlog().
+ - Fix setlogmask() to return previous mask value.
+
+******************************************************************/
+
+/* syslog module */
+
+#include "Python.h"
+#include "osdefs.h" // SEP
+
+#include <syslog.h>
+
+/*[clinic input]
+module syslog
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=478f4ac94a1d4cae]*/
+
+#include "clinic/syslogmodule.c.h"
+
+/* only one instance, only one syslog, so globals should be ok,
+ * these fields are writable from the main interpreter only. */
+static PyObject *S_ident_o = NULL; // identifier, held by openlog()
+static char S_log_open = 0;
+
+static inline int
+is_main_interpreter(void)
+{
+ return (PyInterpreterState_Get() == PyInterpreterState_Main());
+}
+
+static PyObject *
+syslog_get_argv(void)
+{
+ /* Figure out what to use for as the program "ident" for openlog().
+ * This swallows exceptions and continues rather than failing out,
+ * because the syslog module can still be used because openlog(3)
+ * is optional.
+ */
+
+ Py_ssize_t argv_len, scriptlen;
+ PyObject *scriptobj;
+ Py_ssize_t slash;
+ PyObject *argv = PySys_GetObject("argv");
+
+ if (argv == NULL) {
+ return(NULL);
+ }
+
+ argv_len = PyList_Size(argv);
+ if (argv_len == -1) {
+ PyErr_Clear();
+ return(NULL);
+ }
+ if (argv_len == 0) {
+ return(NULL);
+ }
+
+ scriptobj = PyList_GetItem(argv, 0);
+ if (scriptobj == NULL) {
+ PyErr_Clear();
+ return NULL;
+ }
+ if (!PyUnicode_Check(scriptobj)) {
+ return(NULL);
+ }
+ scriptlen = PyUnicode_GET_LENGTH(scriptobj);
+ if (scriptlen == 0) {
+ return(NULL);
+ }
+
+ slash = PyUnicode_FindChar(scriptobj, SEP, 0, scriptlen, -1);
+ if (slash == -2) {
+ PyErr_Clear();
+ return NULL;
+ }
+ if (slash != -1) {
+ return PyUnicode_Substring(scriptobj, slash + 1, scriptlen);
+ } else {
+ Py_INCREF(scriptobj);
+ return(scriptobj);
+ }
+}
+
+
+/*[clinic input]
+syslog.openlog
+
+ ident: unicode = NULL
+ logoption as logopt: long = 0
+ facility: long(c_default="LOG_USER") = LOG_USER
+
+Set logging options of subsequent syslog() calls.
+[clinic start generated code]*/
+
+static PyObject *
+syslog_openlog_impl(PyObject *module, PyObject *ident, long logopt,
+ long facility)
+/*[clinic end generated code: output=5476c12829b6eb75 input=8a987a96a586eee7]*/
+{
+ // Since the sys.openlog changes the process level state of syslog library,
+ // this operation is only allowed for the main interpreter.
+ if (!is_main_interpreter()) {
+ PyErr_SetString(PyExc_RuntimeError, "subinterpreter can't use syslog.openlog()");
+ return NULL;
+ }
+
+ const char *ident_str = NULL;
+
+ if (ident) {
+ Py_INCREF(ident);
+ }
+ else {
+ /* get sys.argv[0] or NULL if we can't for some reason */
+ ident = syslog_get_argv();
+ }
+
+ /* At this point, ident should be INCREF()ed. openlog(3) does not
+ * make a copy, and syslog(3) later uses it. We can't garbagecollect it.
+ * If NULL, just let openlog figure it out (probably using C argv[0]).
+ */
+ if (ident) {
+ ident_str = PyUnicode_AsUTF8(ident);
+ if (ident_str == NULL) {
+ Py_DECREF(ident);
+ return NULL;
+ }
+ }
+ if (PySys_Audit("syslog.openlog", "Oll", ident ? ident : Py_None, logopt, facility) < 0) {
+ Py_DECREF(ident);
+ return NULL;
+ }
+
+ openlog(ident_str, logopt, facility);
+ S_log_open = 1;
+ Py_XSETREF(S_ident_o, ident);
+
+ Py_RETURN_NONE;
+}
+
+
+
+/*[clinic input]
+syslog.syslog
+
+ [
+ priority: int(c_default="LOG_INFO") = LOG_INFO
+ ]
+
+ message: str
+
+ /
+
+Send the string message to the system logger.
+[clinic start generated code]*/
+
+static PyObject *
+syslog_syslog_impl(PyObject *module, int group_left_1, int priority,
+ const char *message)
+/*[clinic end generated code: output=c3dbc73445a0e078 input=ac83d92b12ea3d4e]*/
+{
+ if (PySys_Audit("syslog.syslog", "is", priority, message) < 0) {
+ return NULL;
+ }
+
+ /* if log is not opened, open it now */
+ if (!S_log_open) {
+ if (!is_main_interpreter()) {
+ PyErr_SetString(PyExc_RuntimeError, "subinterpreter can't use syslog.syslog() "
+ "until the syslog is opened by the main interpreter");
+ return NULL;
+ }
+ PyObject *openlog_ret = syslog_openlog_impl(module, NULL, 0, LOG_USER);
+ if (openlog_ret == NULL) {
+ return NULL;
+ }
+ Py_DECREF(openlog_ret);
+ }
+
+ /* Incref ident, because it can be decrefed if syslog.openlog() is
+ * called when the GIL is released.
+ */
+ PyObject *ident = Py_XNewRef(S_ident_o);
+#ifdef __APPLE__
+ // gh-98178: On macOS, libc syslog() is not thread-safe
+ syslog(priority, "%s", message);
+#else
+ Py_BEGIN_ALLOW_THREADS;
+ syslog(priority, "%s", message);
+ Py_END_ALLOW_THREADS;
+#endif
+ Py_XDECREF(ident);
+ Py_RETURN_NONE;
+}
+
+
+/*[clinic input]
+syslog.closelog
+
+Reset the syslog module values and call the system library closelog().
+[clinic start generated code]*/
+
+static PyObject *
+syslog_closelog_impl(PyObject *module)
+/*[clinic end generated code: output=97890a80a24b1b84 input=fb77a54d447acf07]*/
+{
+ // Since the sys.closelog changes the process level state of syslog library,
+ // this operation is only allowed for the main interpreter.
+ if (!is_main_interpreter()) {
+ PyErr_SetString(PyExc_RuntimeError, "sunbinterpreter can't use syslog.closelog()");
+ return NULL;
+ }
+
+ if (PySys_Audit("syslog.closelog", NULL) < 0) {
+ return NULL;
+ }
+ if (S_log_open) {
+ closelog();
+ Py_CLEAR(S_ident_o);
+ S_log_open = 0;
+ }
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+syslog.setlogmask -> long
+
+ maskpri: long
+ /
+
+Set the priority mask to maskpri and return the previous mask value.
+[clinic start generated code]*/
+
+static long
+syslog_setlogmask_impl(PyObject *module, long maskpri)
+/*[clinic end generated code: output=d6ed163917b434bf input=adff2c2b76c7629c]*/
+{
+ if (PySys_Audit("syslog.setlogmask", "l", maskpri) < 0) {
+ return -1;
+ }
+
+ return setlogmask(maskpri);
+}
+
+/*[clinic input]
+syslog.LOG_MASK -> long
+
+ pri: long
+ /
+
+Calculates the mask for the individual priority pri.
+[clinic start generated code]*/
+
+static long
+syslog_LOG_MASK_impl(PyObject *module, long pri)
+/*[clinic end generated code: output=c4a5bbfcc74c7c94 input=534829cb7fb5f7d2]*/
+{
+ return LOG_MASK(pri);
+}
+
+/*[clinic input]
+syslog.LOG_UPTO -> long
+
+ pri: long
+ /
+
+Calculates the mask for all priorities up to and including pri.
+[clinic start generated code]*/
+
+static long
+syslog_LOG_UPTO_impl(PyObject *module, long pri)
+/*[clinic end generated code: output=9eab083c90601d7e input=5e906d6c406b7458]*/
+{
+ return LOG_UPTO(pri);
+}
+
+/* List of functions defined in the module */
+
+static PyMethodDef syslog_methods[] = {
+ SYSLOG_OPENLOG_METHODDEF
+ SYSLOG_CLOSELOG_METHODDEF
+ SYSLOG_SYSLOG_METHODDEF
+ SYSLOG_SETLOGMASK_METHODDEF
+ SYSLOG_LOG_MASK_METHODDEF
+ SYSLOG_LOG_UPTO_METHODDEF
+ {NULL, NULL, 0}
+};
+
+
+static int
+syslog_exec(PyObject *module)
+{
+#define ADD_INT_MACRO(module, macro) \
+ do { \
+ if (PyModule_AddIntConstant(module, #macro, macro) < 0) { \
+ return -1; \
+ } \
+ } while (0)
+ /* Priorities */
+ ADD_INT_MACRO(module, LOG_EMERG);
+ ADD_INT_MACRO(module, LOG_ALERT);
+ ADD_INT_MACRO(module, LOG_CRIT);
+ ADD_INT_MACRO(module, LOG_ERR);
+ ADD_INT_MACRO(module, LOG_WARNING);
+ ADD_INT_MACRO(module, LOG_NOTICE);
+ ADD_INT_MACRO(module, LOG_INFO);
+ ADD_INT_MACRO(module, LOG_DEBUG);
+
+ /* openlog() option flags */
+ ADD_INT_MACRO(module, LOG_PID);
+ ADD_INT_MACRO(module, LOG_CONS);
+ ADD_INT_MACRO(module, LOG_NDELAY);
+#ifdef LOG_ODELAY
+ ADD_INT_MACRO(module, LOG_ODELAY);
+#endif
+#ifdef LOG_NOWAIT
+ ADD_INT_MACRO(module, LOG_NOWAIT);
+#endif
+#ifdef LOG_PERROR
+ ADD_INT_MACRO(module, LOG_PERROR);
+#endif
+
+ /* Facilities */
+ ADD_INT_MACRO(module, LOG_KERN);
+ ADD_INT_MACRO(module, LOG_USER);
+ ADD_INT_MACRO(module, LOG_MAIL);
+ ADD_INT_MACRO(module, LOG_DAEMON);
+ ADD_INT_MACRO(module, LOG_AUTH);
+ ADD_INT_MACRO(module, LOG_LPR);
+ ADD_INT_MACRO(module, LOG_LOCAL0);
+ ADD_INT_MACRO(module, LOG_LOCAL1);
+ ADD_INT_MACRO(module, LOG_LOCAL2);
+ ADD_INT_MACRO(module, LOG_LOCAL3);
+ ADD_INT_MACRO(module, LOG_LOCAL4);
+ ADD_INT_MACRO(module, LOG_LOCAL5);
+ ADD_INT_MACRO(module, LOG_LOCAL6);
+ ADD_INT_MACRO(module, LOG_LOCAL7);
+
+#ifndef LOG_SYSLOG
+#define LOG_SYSLOG LOG_DAEMON
+#endif
+#ifndef LOG_NEWS
+#define LOG_NEWS LOG_MAIL
+#endif
+#ifndef LOG_UUCP
+#define LOG_UUCP LOG_MAIL
+#endif
+#ifndef LOG_CRON
+#define LOG_CRON LOG_DAEMON
+#endif
+
+ ADD_INT_MACRO(module, LOG_SYSLOG);
+ ADD_INT_MACRO(module, LOG_CRON);
+ ADD_INT_MACRO(module, LOG_UUCP);
+ ADD_INT_MACRO(module, LOG_NEWS);
+
+#ifdef LOG_AUTHPRIV
+ ADD_INT_MACRO(module, LOG_AUTHPRIV);
+#endif
+
+ return 0;
+}
+
+static PyModuleDef_Slot syslog_slots[] = {
+ {Py_mod_exec, syslog_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+/* Initialization function for the module */
+
+static struct PyModuleDef syslogmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "syslog",
+ .m_size = 0,
+ .m_methods = syslog_methods,
+ .m_slots = syslog_slots,
+};
+
+PyMODINIT_FUNC
+PyInit_syslog(void)
+{
+ return PyModuleDef_Init(&syslogmodule);
+}
diff --git a/contrib/tools/python3/Modules/termios.c b/contrib/tools/python3/Modules/termios.c
new file mode 100644
index 00000000000..402e6ac908a
--- /dev/null
+++ b/contrib/tools/python3/Modules/termios.c
@@ -0,0 +1,1290 @@
+/* termios.c -- POSIX terminal I/O module implementation. */
+
+#include "Python.h"
+
+/* Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE
+ is defined, so we define it here. */
+#if defined(__sgi)
+#define CTRL(c) ((c)&037)
+#endif
+
+#if defined(__sun)
+/* We could do better. Check issue-32660 */
+#include <sys/filio.h>
+#include <sys/sockio.h>
+#endif
+
+#include <termios.h>
+#include <sys/ioctl.h>
+
+/* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR,
+ * MDTR, MRI, and MRTS (apparently used internally by some things
+ * defined as macros; these are not used here directly).
+ */
+#ifdef HAVE_SYS_MODEM_H
+#include <sys/modem.h>
+#endif
+/* HP-UX requires that this be included to pick up TIOCGPGRP and friends */
+#ifdef HAVE_SYS_BSDTTY_H
+#include <sys/bsdtty.h>
+#endif
+
+/*[clinic input]
+module termios
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=01105c85d0ca7252]*/
+
+#include "clinic/termios.c.h"
+
+PyDoc_STRVAR(termios__doc__,
+"This module provides an interface to the Posix calls for tty I/O control.\n\
+For a complete description of these calls, see the Posix or Unix manual\n\
+pages. It is only available for those Unix versions that support Posix\n\
+termios style tty I/O control.\n\
+\n\
+All functions in this module take a file descriptor fd as their first\n\
+argument. This can be an integer file descriptor, such as returned by\n\
+sys.stdin.fileno(), or a file object, such as sys.stdin itself.");
+
+typedef struct {
+ PyObject *TermiosError;
+} termiosmodulestate;
+
+static inline termiosmodulestate*
+get_termios_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (termiosmodulestate *)state;
+}
+
+static struct PyModuleDef termiosmodule;
+
+/*[clinic input]
+termios.tcgetattr
+
+ fd: fildes
+ /
+
+Get the tty attributes for file descriptor fd.
+
+Returns a list [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]
+where cc is a list of the tty special characters (each a string of
+length 1, except the items with indices VMIN and VTIME, which are
+integers when these fields are defined). The interpretation of the
+flags and the speeds as well as the indexing in the cc array must be
+done using the symbolic constants defined in this module.
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcgetattr_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=2b3da39db870e629 input=54dad9779ebe74b1]*/
+{
+ termiosmodulestate *state = PyModule_GetState(module);
+ struct termios mode;
+ int r;
+
+ /* Alpine Linux can leave some fields uninitialized. */
+ memset(&mode, 0, sizeof(mode));
+ Py_BEGIN_ALLOW_THREADS
+ r = tcgetattr(fd, &mode);
+ Py_END_ALLOW_THREADS
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ speed_t ispeed = cfgetispeed(&mode);
+ speed_t ospeed = cfgetospeed(&mode);
+
+ PyObject *cc = PyList_New(NCCS);
+ if (cc == NULL) {
+ return NULL;
+ }
+
+ PyObject *v;
+ int i;
+ for (i = 0; i < NCCS; i++) {
+ char ch = (char)mode.c_cc[i];
+ v = PyBytes_FromStringAndSize(&ch, 1);
+ if (v == NULL)
+ goto err;
+ PyList_SetItem(cc, i, v);
+ }
+
+ /* Convert the MIN and TIME slots to integer. On some systems, the
+ MIN and TIME slots are the same as the EOF and EOL slots. So we
+ only do this in noncanonical input mode. */
+ if ((mode.c_lflag & ICANON) == 0) {
+ v = PyLong_FromLong((long)mode.c_cc[VMIN]);
+ if (v == NULL)
+ goto err;
+ PyList_SetItem(cc, VMIN, v);
+ v = PyLong_FromLong((long)mode.c_cc[VTIME]);
+ if (v == NULL)
+ goto err;
+ PyList_SetItem(cc, VTIME, v);
+ }
+
+ if (!(v = PyList_New(7)))
+ goto err;
+
+ PyList_SetItem(v, 0, PyLong_FromLong((long)mode.c_iflag));
+ PyList_SetItem(v, 1, PyLong_FromLong((long)mode.c_oflag));
+ PyList_SetItem(v, 2, PyLong_FromLong((long)mode.c_cflag));
+ PyList_SetItem(v, 3, PyLong_FromLong((long)mode.c_lflag));
+ PyList_SetItem(v, 4, PyLong_FromLong((long)ispeed));
+ PyList_SetItem(v, 5, PyLong_FromLong((long)ospeed));
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ goto err;
+ }
+ PyList_SetItem(v, 6, cc);
+ return v;
+ err:
+ Py_DECREF(cc);
+ return NULL;
+}
+
+/*[clinic input]
+termios.tcsetattr
+
+ fd: fildes
+ when: int
+ attributes as term: object
+ /
+
+Set the tty attributes for file descriptor fd.
+
+The attributes to be set are taken from the attributes argument, which
+is a list like the one returned by tcgetattr(). The when argument
+determines when the attributes are changed: termios.TCSANOW to
+change immediately, termios.TCSADRAIN to change after transmitting all
+queued output, or termios.TCSAFLUSH to change after transmitting all
+queued output and discarding all queued input.
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcsetattr_impl(PyObject *module, int fd, int when, PyObject *term)
+/*[clinic end generated code: output=bcd2b0a7b98a4bf5 input=5dafabdd5a08f018]*/
+{
+ if (!PyList_Check(term) || PyList_Size(term) != 7) {
+ PyErr_SetString(PyExc_TypeError,
+ "tcsetattr, arg 3: must be 7 element list");
+ return NULL;
+ }
+
+ /* Get the old mode, in case there are any hidden fields... */
+ termiosmodulestate *state = PyModule_GetState(module);
+ struct termios mode;
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = tcgetattr(fd, &mode);
+ Py_END_ALLOW_THREADS
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ speed_t ispeed, ospeed;
+#define SET_FROM_LIST(TYPE, VAR, LIST, N) do { \
+ PyObject *item = PyList_GET_ITEM(LIST, N); \
+ long num = PyLong_AsLong(item); \
+ if (num == -1 && PyErr_Occurred()) { \
+ return NULL; \
+ } \
+ VAR = (TYPE)num; \
+} while (0)
+
+ SET_FROM_LIST(tcflag_t, mode.c_iflag, term, 0);
+ SET_FROM_LIST(tcflag_t, mode.c_oflag, term, 1);
+ SET_FROM_LIST(tcflag_t, mode.c_cflag, term, 2);
+ SET_FROM_LIST(tcflag_t, mode.c_lflag, term, 3);
+ SET_FROM_LIST(speed_t, ispeed, term, 4);
+ SET_FROM_LIST(speed_t, ospeed, term, 5);
+#undef SET_FROM_LIST
+
+ PyObject *cc = PyList_GET_ITEM(term, 6);
+ if (!PyList_Check(cc) || PyList_Size(cc) != NCCS) {
+ PyErr_Format(PyExc_TypeError,
+ "tcsetattr: attributes[6] must be %d element list",
+ NCCS);
+ return NULL;
+ }
+
+ int i;
+ PyObject *v;
+ for (i = 0; i < NCCS; i++) {
+ v = PyList_GetItem(cc, i);
+
+ if (PyBytes_Check(v) && PyBytes_Size(v) == 1)
+ mode.c_cc[i] = (cc_t) * PyBytes_AsString(v);
+ else if (PyLong_Check(v)) {
+ long num = PyLong_AsLong(v);
+ if (num == -1 && PyErr_Occurred()) {
+ return NULL;
+ }
+ mode.c_cc[i] = (cc_t)num;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "tcsetattr: elements of attributes must be characters or integers");
+ return NULL;
+ }
+ }
+
+ if (cfsetispeed(&mode, (speed_t) ispeed) == -1)
+ return PyErr_SetFromErrno(state->TermiosError);
+ if (cfsetospeed(&mode, (speed_t) ospeed) == -1)
+ return PyErr_SetFromErrno(state->TermiosError);
+
+ Py_BEGIN_ALLOW_THREADS
+ r = tcsetattr(fd, when, &mode);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1)
+ return PyErr_SetFromErrno(state->TermiosError);
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+termios.tcsendbreak
+
+ fd: fildes
+ duration: int
+ /
+
+Send a break on file descriptor fd.
+
+A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration
+has a system dependent meaning.
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcsendbreak_impl(PyObject *module, int fd, int duration)
+/*[clinic end generated code: output=5945f589b5d3ac66 input=dc2f32417691f8ed]*/
+{
+ termiosmodulestate *state = PyModule_GetState(module);
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = tcsendbreak(fd, duration);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+termios.tcdrain
+
+ fd: fildes
+ /
+
+Wait until all output written to file descriptor fd has been transmitted.
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcdrain_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=5fd86944c6255955 input=c99241b140b32447]*/
+{
+ termiosmodulestate *state = PyModule_GetState(module);
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = tcdrain(fd);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+termios.tcflush
+
+ fd: fildes
+ queue: int
+ /
+
+Discard queued data on file descriptor fd.
+
+The queue selector specifies which queue: termios.TCIFLUSH for the input
+queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for
+both queues.
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcflush_impl(PyObject *module, int fd, int queue)
+/*[clinic end generated code: output=2424f80312ec2f21 input=0f7d08122ddc07b5]*/
+{
+ termiosmodulestate *state = PyModule_GetState(module);
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = tcflush(fd, queue);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+termios.tcflow
+
+ fd: fildes
+ action: int
+ /
+
+Suspend or resume input or output on file descriptor fd.
+
+The action argument can be termios.TCOOFF to suspend output,
+termios.TCOON to restart output, termios.TCIOFF to suspend input,
+or termios.TCION to restart input.
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcflow_impl(PyObject *module, int fd, int action)
+/*[clinic end generated code: output=afd10928e6ea66eb input=c6aff0640b6efd9c]*/
+{
+ termiosmodulestate *state = PyModule_GetState(module);
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = tcflow(fd, action);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+termios.tcgetwinsize
+
+ fd: fildes
+ /
+
+Get the tty winsize for file descriptor fd.
+
+Returns a tuple (ws_row, ws_col).
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcgetwinsize_impl(PyObject *module, int fd)
+/*[clinic end generated code: output=31825977d5325fb6 input=5706c379d7fd984d]*/
+{
+#if defined(TIOCGWINSZ)
+ termiosmodulestate *state = PyModule_GetState(module);
+ struct winsize w;
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = ioctl(fd, TIOCGWINSZ, &w);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ PyObject *v;
+ if (!(v = PyTuple_New(2))) {
+ return NULL;
+ }
+
+ PyTuple_SetItem(v, 0, PyLong_FromLong((long)w.ws_row));
+ PyTuple_SetItem(v, 1, PyLong_FromLong((long)w.ws_col));
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ return NULL;
+ }
+ return v;
+#elif defined(TIOCGSIZE)
+ termiosmodulestate *state = PyModule_GetState(module);
+ struct ttysize s;
+ int r;
+
+ Py_BEGIN_ALLOW_THREADS
+ r = ioctl(fd, TIOCGSIZE, &s);
+ Py_END_ALLOW_THREADS
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ PyObject *v;
+ if (!(v = PyTuple_New(2))) {
+ return NULL;
+ }
+
+ PyTuple_SetItem(v, 0, PyLong_FromLong((long)s.ts_lines));
+ PyTuple_SetItem(v, 1, PyLong_FromLong((long)s.ts_cols));
+ if (PyErr_Occurred()) {
+ Py_DECREF(v);
+ return NULL;
+ }
+ return v;
+#else
+ PyErr_SetString(PyExc_NotImplementedError,
+ "requires termios.TIOCGWINSZ and/or termios.TIOCGSIZE");
+ return NULL;
+#endif /* defined(TIOCGWINSZ) */
+}
+
+/*[clinic input]
+termios.tcsetwinsize
+
+ fd: fildes
+ winsize as winsz: object
+ /
+
+Set the tty winsize for file descriptor fd.
+
+The winsize to be set is taken from the winsize argument, which
+is a two-item tuple (ws_row, ws_col) like the one returned by tcgetwinsize().
+[clinic start generated code]*/
+
+static PyObject *
+termios_tcsetwinsize_impl(PyObject *module, int fd, PyObject *winsz)
+/*[clinic end generated code: output=2ac3c9bb6eda83e1 input=4a06424465b24aee]*/
+{
+ if (!PySequence_Check(winsz) || PySequence_Size(winsz) != 2) {
+ PyErr_SetString(PyExc_TypeError,
+ "tcsetwinsize, arg 2: must be a two-item sequence");
+ return NULL;
+ }
+
+ PyObject *tmp_item;
+ long winsz_0, winsz_1;
+ tmp_item = PySequence_GetItem(winsz, 0);
+ winsz_0 = PyLong_AsLong(tmp_item);
+ if (winsz_0 == -1 && PyErr_Occurred()) {
+ Py_XDECREF(tmp_item);
+ return NULL;
+ }
+ Py_XDECREF(tmp_item);
+ tmp_item = PySequence_GetItem(winsz, 1);
+ winsz_1 = PyLong_AsLong(tmp_item);
+ if (winsz_1 == -1 && PyErr_Occurred()) {
+ Py_XDECREF(tmp_item);
+ return NULL;
+ }
+ Py_XDECREF(tmp_item);
+
+ termiosmodulestate *state = PyModule_GetState(module);
+
+#if defined(TIOCGWINSZ) && defined(TIOCSWINSZ)
+ struct winsize w;
+ /* Get the old winsize because it might have
+ more fields such as xpixel, ypixel. */
+ if (ioctl(fd, TIOCGWINSZ, &w) == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ w.ws_row = (unsigned short) winsz_0;
+ w.ws_col = (unsigned short) winsz_1;
+ if ((((long)w.ws_row) != winsz_0) || (((long)w.ws_col) != winsz_1)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "winsize value(s) out of range.");
+ return NULL;
+ }
+
+ int r;
+ Py_BEGIN_ALLOW_THREADS
+ r = ioctl(fd, TIOCSWINSZ, &w);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ Py_RETURN_NONE;
+#elif defined(TIOCGSIZE) && defined(TIOCSSIZE)
+ struct ttysize s;
+ int r;
+ /* Get the old ttysize because it might have more fields. */
+ Py_BEGIN_ALLOW_THREADS
+ r = ioctl(fd, TIOCGSIZE, &s);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ s.ts_lines = (int) winsz_0;
+ s.ts_cols = (int) winsz_1;
+ if ((((long)s.ts_lines) != winsz_0) || (((long)s.ts_cols) != winsz_1)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "winsize value(s) out of range.");
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ r = ioctl(fd, TIOCSSIZE, &s);
+ Py_END_ALLOW_THREADS
+
+ if (r == -1) {
+ return PyErr_SetFromErrno(state->TermiosError);
+ }
+
+ Py_RETURN_NONE;
+#else
+ PyErr_SetString(PyExc_NotImplementedError,
+ "requires termios.TIOCGWINSZ, termios.TIOCSWINSZ and/or termios.TIOCGSIZE, termios.TIOCSSIZE");
+ return NULL;
+#endif /* defined(TIOCGWINSZ) && defined(TIOCSWINSZ) */
+}
+
+static PyMethodDef termios_methods[] =
+{
+ TERMIOS_TCGETATTR_METHODDEF
+ TERMIOS_TCSETATTR_METHODDEF
+ TERMIOS_TCSENDBREAK_METHODDEF
+ TERMIOS_TCDRAIN_METHODDEF
+ TERMIOS_TCFLUSH_METHODDEF
+ TERMIOS_TCFLOW_METHODDEF
+ TERMIOS_TCGETWINSIZE_METHODDEF
+ TERMIOS_TCSETWINSIZE_METHODDEF
+ {NULL, NULL}
+};
+
+
+#if defined(VSWTCH) && !defined(VSWTC)
+#define VSWTC VSWTCH
+#endif
+
+#if defined(VSWTC) && !defined(VSWTCH)
+#define VSWTCH VSWTC
+#endif
+
+static struct constant {
+ char *name;
+ long value;
+} termios_constants[] = {
+ /* cfgetospeed(), cfsetospeed() constants */
+ {"B0", B0},
+ {"B50", B50},
+ {"B75", B75},
+ {"B110", B110},
+ {"B134", B134},
+ {"B150", B150},
+ {"B200", B200},
+ {"B300", B300},
+ {"B600", B600},
+ {"B1200", B1200},
+ {"B1800", B1800},
+ {"B2400", B2400},
+ {"B4800", B4800},
+ {"B9600", B9600},
+ {"B19200", B19200},
+ {"B38400", B38400},
+#ifdef B57600
+ {"B57600", B57600},
+#endif
+#ifdef B115200
+ {"B115200", B115200},
+#endif
+#ifdef B230400
+ {"B230400", B230400},
+#endif
+#ifdef B460800
+ {"B460800", B460800},
+#endif
+#ifdef B500000
+ {"B500000", B500000},
+#endif
+#ifdef B576000
+ {"B576000", B576000},
+#endif
+#ifdef B921600
+ {"B921600", B921600},
+#endif
+#ifdef B1000000
+ {"B1000000", B1000000},
+#endif
+#ifdef B1152000
+ {"B1152000", B1152000},
+#endif
+#ifdef B1500000
+ {"B1500000", B1500000},
+#endif
+#ifdef B2000000
+ {"B2000000", B2000000},
+#endif
+#ifdef B2500000
+ {"B2500000", B2500000},
+#endif
+#ifdef B3000000
+ {"B3000000", B3000000},
+#endif
+#ifdef B3500000
+ {"B3500000", B3500000},
+#endif
+#ifdef B4000000
+ {"B4000000", B4000000},
+#endif
+
+#ifdef CBAUDEX
+ {"CBAUDEX", CBAUDEX},
+#endif
+
+ /* tcsetattr() constants */
+ {"TCSANOW", TCSANOW},
+ {"TCSADRAIN", TCSADRAIN},
+ {"TCSAFLUSH", TCSAFLUSH},
+#ifdef TCSASOFT
+ {"TCSASOFT", TCSASOFT},
+#endif
+
+ /* tcflush() constants */
+ {"TCIFLUSH", TCIFLUSH},
+ {"TCOFLUSH", TCOFLUSH},
+ {"TCIOFLUSH", TCIOFLUSH},
+
+ /* tcflow() constants */
+ {"TCOOFF", TCOOFF},
+ {"TCOON", TCOON},
+ {"TCIOFF", TCIOFF},
+ {"TCION", TCION},
+
+ /* struct termios.c_iflag constants */
+ {"IGNBRK", IGNBRK},
+ {"BRKINT", BRKINT},
+ {"IGNPAR", IGNPAR},
+ {"PARMRK", PARMRK},
+ {"INPCK", INPCK},
+ {"ISTRIP", ISTRIP},
+ {"INLCR", INLCR},
+ {"IGNCR", IGNCR},
+ {"ICRNL", ICRNL},
+#ifdef IUCLC
+ {"IUCLC", IUCLC},
+#endif
+ {"IXON", IXON},
+ {"IXANY", IXANY},
+ {"IXOFF", IXOFF},
+#ifdef IMAXBEL
+ {"IMAXBEL", IMAXBEL},
+#endif
+
+ /* struct termios.c_oflag constants */
+ {"OPOST", OPOST},
+#ifdef OLCUC
+ {"OLCUC", OLCUC},
+#endif
+#ifdef ONLCR
+ {"ONLCR", ONLCR},
+#endif
+#ifdef OCRNL
+ {"OCRNL", OCRNL},
+#endif
+#ifdef ONOCR
+ {"ONOCR", ONOCR},
+#endif
+#ifdef ONLRET
+ {"ONLRET", ONLRET},
+#endif
+#ifdef OFILL
+ {"OFILL", OFILL},
+#endif
+#ifdef OFDEL
+ {"OFDEL", OFDEL},
+#endif
+#ifdef NLDLY
+ {"NLDLY", NLDLY},
+#endif
+#ifdef CRDLY
+ {"CRDLY", CRDLY},
+#endif
+#ifdef TABDLY
+ {"TABDLY", TABDLY},
+#endif
+#ifdef BSDLY
+ {"BSDLY", BSDLY},
+#endif
+#ifdef VTDLY
+ {"VTDLY", VTDLY},
+#endif
+#ifdef FFDLY
+ {"FFDLY", FFDLY},
+#endif
+
+ /* struct termios.c_oflag-related values (delay mask) */
+#ifdef NL0
+ {"NL0", NL0},
+#endif
+#ifdef NL1
+ {"NL1", NL1},
+#endif
+#ifdef CR0
+ {"CR0", CR0},
+#endif
+#ifdef CR1
+ {"CR1", CR1},
+#endif
+#ifdef CR2
+ {"CR2", CR2},
+#endif
+#ifdef CR3
+ {"CR3", CR3},
+#endif
+#ifdef TAB0
+ {"TAB0", TAB0},
+#endif
+#ifdef TAB1
+ {"TAB1", TAB1},
+#endif
+#ifdef TAB2
+ {"TAB2", TAB2},
+#endif
+#ifdef TAB3
+ {"TAB3", TAB3},
+#endif
+#ifdef XTABS
+ {"XTABS", XTABS},
+#endif
+#ifdef BS0
+ {"BS0", BS0},
+#endif
+#ifdef BS1
+ {"BS1", BS1},
+#endif
+#ifdef VT0
+ {"VT0", VT0},
+#endif
+#ifdef VT1
+ {"VT1", VT1},
+#endif
+#ifdef FF0
+ {"FF0", FF0},
+#endif
+#ifdef FF1
+ {"FF1", FF1},
+#endif
+
+ /* struct termios.c_cflag constants */
+ {"CSIZE", CSIZE},
+ {"CSTOPB", CSTOPB},
+ {"CREAD", CREAD},
+ {"PARENB", PARENB},
+ {"PARODD", PARODD},
+ {"HUPCL", HUPCL},
+ {"CLOCAL", CLOCAL},
+#ifdef CIBAUD
+ {"CIBAUD", CIBAUD},
+#endif
+#ifdef CRTSCTS
+ {"CRTSCTS", (long)CRTSCTS},
+#endif
+
+ /* struct termios.c_cflag-related values (character size) */
+ {"CS5", CS5},
+ {"CS6", CS6},
+ {"CS7", CS7},
+ {"CS8", CS8},
+
+ /* struct termios.c_lflag constants */
+ {"ISIG", ISIG},
+ {"ICANON", ICANON},
+#ifdef XCASE
+ {"XCASE", XCASE},
+#endif
+ {"ECHO", ECHO},
+ {"ECHOE", ECHOE},
+ {"ECHOK", ECHOK},
+ {"ECHONL", ECHONL},
+#ifdef ECHOCTL
+ {"ECHOCTL", ECHOCTL},
+#endif
+#ifdef ECHOPRT
+ {"ECHOPRT", ECHOPRT},
+#endif
+#ifdef ECHOKE
+ {"ECHOKE", ECHOKE},
+#endif
+#ifdef FLUSHO
+ {"FLUSHO", FLUSHO},
+#endif
+ {"NOFLSH", NOFLSH},
+ {"TOSTOP", TOSTOP},
+#ifdef PENDIN
+ {"PENDIN", PENDIN},
+#endif
+ {"IEXTEN", IEXTEN},
+
+ /* indexes into the control chars array returned by tcgetattr() */
+ {"VINTR", VINTR},
+ {"VQUIT", VQUIT},
+ {"VERASE", VERASE},
+ {"VKILL", VKILL},
+ {"VEOF", VEOF},
+ {"VTIME", VTIME},
+ {"VMIN", VMIN},
+#ifdef VSWTC
+ /* The #defines above ensure that if either is defined, both are,
+ * but both may be omitted by the system headers. ;-( */
+ {"VSWTC", VSWTC},
+ {"VSWTCH", VSWTCH},
+#endif
+ {"VSTART", VSTART},
+ {"VSTOP", VSTOP},
+ {"VSUSP", VSUSP},
+ {"VEOL", VEOL},
+#ifdef VREPRINT
+ {"VREPRINT", VREPRINT},
+#endif
+#ifdef VDISCARD
+ {"VDISCARD", VDISCARD},
+#endif
+#ifdef VWERASE
+ {"VWERASE", VWERASE},
+#endif
+#ifdef VLNEXT
+ {"VLNEXT", VLNEXT},
+#endif
+#ifdef VEOL2
+ {"VEOL2", VEOL2},
+#endif
+
+
+#ifdef B460800
+ {"B460800", B460800},
+#endif
+#ifdef B500000
+ {"B500000", B500000},
+#endif
+#ifdef B576000
+ { "B576000", B576000},
+#endif
+#ifdef B921600
+ { "B921600", B921600},
+#endif
+#ifdef B1000000
+ { "B1000000", B1000000},
+#endif
+#ifdef B1152000
+ { "B1152000", B1152000},
+#endif
+#ifdef B1500000
+ { "B1500000", B1500000},
+#endif
+#ifdef B2000000
+ { "B2000000", B2000000},
+#endif
+#ifdef B2500000
+ { "B2500000", B2500000},
+#endif
+#ifdef B3000000
+ { "B3000000", B3000000},
+#endif
+#ifdef B3500000
+ { "B3500000", B3500000},
+#endif
+#ifdef B4000000
+ { "B4000000", B4000000},
+#endif
+#ifdef CBAUD
+ {"CBAUD", CBAUD},
+#endif
+#ifdef CDEL
+ {"CDEL", CDEL},
+#endif
+#ifdef CDSUSP
+ {"CDSUSP", CDSUSP},
+#endif
+#ifdef CEOF
+ {"CEOF", CEOF},
+#endif
+#ifdef CEOL
+ {"CEOL", CEOL},
+#endif
+#ifdef CEOL2
+ {"CEOL2", CEOL2},
+#endif
+#ifdef CEOT
+ {"CEOT", CEOT},
+#endif
+#ifdef CERASE
+ {"CERASE", CERASE},
+#endif
+#ifdef CESC
+ {"CESC", CESC},
+#endif
+#ifdef CFLUSH
+ {"CFLUSH", CFLUSH},
+#endif
+#ifdef CINTR
+ {"CINTR", CINTR},
+#endif
+#ifdef CKILL
+ {"CKILL", CKILL},
+#endif
+#ifdef CLNEXT
+ {"CLNEXT", CLNEXT},
+#endif
+#ifdef CNUL
+ {"CNUL", CNUL},
+#endif
+#ifdef COMMON
+ {"COMMON", COMMON},
+#endif
+#ifdef CQUIT
+ {"CQUIT", CQUIT},
+#endif
+#ifdef CRPRNT
+ {"CRPRNT", CRPRNT},
+#endif
+#ifdef CSTART
+ {"CSTART", CSTART},
+#endif
+#ifdef CSTOP
+ {"CSTOP", CSTOP},
+#endif
+#ifdef CSUSP
+ {"CSUSP", CSUSP},
+#endif
+#ifdef CSWTCH
+ {"CSWTCH", CSWTCH},
+#endif
+#ifdef CWERASE
+ {"CWERASE", CWERASE},
+#endif
+#ifdef EXTA
+ {"EXTA", EXTA},
+#endif
+#ifdef EXTB
+ {"EXTB", EXTB},
+#endif
+#ifdef FIOASYNC
+ {"FIOASYNC", FIOASYNC},
+#endif
+#ifdef FIOCLEX
+ {"FIOCLEX", FIOCLEX},
+#endif
+#ifdef FIONBIO
+ {"FIONBIO", FIONBIO},
+#endif
+#ifdef FIONCLEX
+ {"FIONCLEX", FIONCLEX},
+#endif
+#ifdef FIONREAD
+ {"FIONREAD", FIONREAD},
+#endif
+#ifdef IBSHIFT
+ {"IBSHIFT", IBSHIFT},
+#endif
+#ifdef INIT_C_CC
+ {"INIT_C_CC", INIT_C_CC},
+#endif
+#ifdef IOCSIZE_MASK
+ {"IOCSIZE_MASK", IOCSIZE_MASK},
+#endif
+#ifdef IOCSIZE_SHIFT
+ {"IOCSIZE_SHIFT", IOCSIZE_SHIFT},
+#endif
+#ifdef NCC
+ {"NCC", NCC},
+#endif
+#ifdef NCCS
+ {"NCCS", NCCS},
+#endif
+#ifdef NSWTCH
+ {"NSWTCH", NSWTCH},
+#endif
+#ifdef N_MOUSE
+ {"N_MOUSE", N_MOUSE},
+#endif
+#ifdef N_PPP
+ {"N_PPP", N_PPP},
+#endif
+#ifdef N_SLIP
+ {"N_SLIP", N_SLIP},
+#endif
+#ifdef N_STRIP
+ {"N_STRIP", N_STRIP},
+#endif
+#ifdef N_TTY
+ {"N_TTY", N_TTY},
+#endif
+#ifdef TCFLSH
+ {"TCFLSH", TCFLSH},
+#endif
+#ifdef TCGETA
+ {"TCGETA", TCGETA},
+#endif
+#ifdef TCGETS
+ {"TCGETS", TCGETS},
+#endif
+#ifdef TCSBRK
+ {"TCSBRK", TCSBRK},
+#endif
+#ifdef TCSBRKP
+ {"TCSBRKP", TCSBRKP},
+#endif
+#ifdef TCSETA
+ {"TCSETA", TCSETA},
+#endif
+#ifdef TCSETAF
+ {"TCSETAF", TCSETAF},
+#endif
+#ifdef TCSETAW
+ {"TCSETAW", TCSETAW},
+#endif
+#ifdef TCSETS
+ {"TCSETS", TCSETS},
+#endif
+#ifdef TCSETSF
+ {"TCSETSF", TCSETSF},
+#endif
+#ifdef TCSETSW
+ {"TCSETSW", TCSETSW},
+#endif
+#ifdef TCXONC
+ {"TCXONC", TCXONC},
+#endif
+#ifdef TIOCCONS
+ {"TIOCCONS", TIOCCONS},
+#endif
+#ifdef TIOCEXCL
+ {"TIOCEXCL", TIOCEXCL},
+#endif
+#ifdef TIOCGETD
+ {"TIOCGETD", TIOCGETD},
+#endif
+#ifdef TIOCGICOUNT
+ {"TIOCGICOUNT", TIOCGICOUNT},
+#endif
+#ifdef TIOCGLCKTRMIOS
+ {"TIOCGLCKTRMIOS", TIOCGLCKTRMIOS},
+#endif
+#ifdef TIOCGPGRP
+ {"TIOCGPGRP", TIOCGPGRP},
+#endif
+#ifdef TIOCGSERIAL
+ {"TIOCGSERIAL", TIOCGSERIAL},
+#endif
+#ifdef TIOCGSIZE
+ {"TIOCGSIZE", TIOCGSIZE},
+#endif
+#ifdef TIOCGSOFTCAR
+ {"TIOCGSOFTCAR", TIOCGSOFTCAR},
+#endif
+#ifdef TIOCGWINSZ
+ {"TIOCGWINSZ", TIOCGWINSZ},
+#endif
+#ifdef TIOCINQ
+ {"TIOCINQ", TIOCINQ},
+#endif
+#ifdef TIOCLINUX
+ {"TIOCLINUX", TIOCLINUX},
+#endif
+#ifdef TIOCMBIC
+ {"TIOCMBIC", TIOCMBIC},
+#endif
+#ifdef TIOCMBIS
+ {"TIOCMBIS", TIOCMBIS},
+#endif
+#ifdef TIOCMGET
+ {"TIOCMGET", TIOCMGET},
+#endif
+#ifdef TIOCMIWAIT
+ {"TIOCMIWAIT", TIOCMIWAIT},
+#endif
+#ifdef TIOCMSET
+ {"TIOCMSET", TIOCMSET},
+#endif
+#ifdef TIOCM_CAR
+ {"TIOCM_CAR", TIOCM_CAR},
+#endif
+#ifdef TIOCM_CD
+ {"TIOCM_CD", TIOCM_CD},
+#endif
+#ifdef TIOCM_CTS
+ {"TIOCM_CTS", TIOCM_CTS},
+#endif
+#ifdef TIOCM_DSR
+ {"TIOCM_DSR", TIOCM_DSR},
+#endif
+#ifdef TIOCM_DTR
+ {"TIOCM_DTR", TIOCM_DTR},
+#endif
+#ifdef TIOCM_LE
+ {"TIOCM_LE", TIOCM_LE},
+#endif
+#ifdef TIOCM_RI
+ {"TIOCM_RI", TIOCM_RI},
+#endif
+#ifdef TIOCM_RNG
+ {"TIOCM_RNG", TIOCM_RNG},
+#endif
+#ifdef TIOCM_RTS
+ {"TIOCM_RTS", TIOCM_RTS},
+#endif
+#ifdef TIOCM_SR
+ {"TIOCM_SR", TIOCM_SR},
+#endif
+#ifdef TIOCM_ST
+ {"TIOCM_ST", TIOCM_ST},
+#endif
+#ifdef TIOCNOTTY
+ {"TIOCNOTTY", TIOCNOTTY},
+#endif
+#ifdef TIOCNXCL
+ {"TIOCNXCL", TIOCNXCL},
+#endif
+#ifdef TIOCOUTQ
+ {"TIOCOUTQ", TIOCOUTQ},
+#endif
+#ifdef TIOCPKT
+ {"TIOCPKT", TIOCPKT},
+#endif
+#ifdef TIOCPKT_DATA
+ {"TIOCPKT_DATA", TIOCPKT_DATA},
+#endif
+#ifdef TIOCPKT_DOSTOP
+ {"TIOCPKT_DOSTOP", TIOCPKT_DOSTOP},
+#endif
+#ifdef TIOCPKT_FLUSHREAD
+ {"TIOCPKT_FLUSHREAD", TIOCPKT_FLUSHREAD},
+#endif
+#ifdef TIOCPKT_FLUSHWRITE
+ {"TIOCPKT_FLUSHWRITE", TIOCPKT_FLUSHWRITE},
+#endif
+#ifdef TIOCPKT_NOSTOP
+ {"TIOCPKT_NOSTOP", TIOCPKT_NOSTOP},
+#endif
+#ifdef TIOCPKT_START
+ {"TIOCPKT_START", TIOCPKT_START},
+#endif
+#ifdef TIOCPKT_STOP
+ {"TIOCPKT_STOP", TIOCPKT_STOP},
+#endif
+#ifdef TIOCSCTTY
+ {"TIOCSCTTY", TIOCSCTTY},
+#endif
+#ifdef TIOCSERCONFIG
+ {"TIOCSERCONFIG", TIOCSERCONFIG},
+#endif
+#ifdef TIOCSERGETLSR
+ {"TIOCSERGETLSR", TIOCSERGETLSR},
+#endif
+#ifdef TIOCSERGETMULTI
+ {"TIOCSERGETMULTI", TIOCSERGETMULTI},
+#endif
+#ifdef TIOCSERGSTRUCT
+ {"TIOCSERGSTRUCT", TIOCSERGSTRUCT},
+#endif
+#ifdef TIOCSERGWILD
+ {"TIOCSERGWILD", TIOCSERGWILD},
+#endif
+#ifdef TIOCSERSETMULTI
+ {"TIOCSERSETMULTI", TIOCSERSETMULTI},
+#endif
+#ifdef TIOCSERSWILD
+ {"TIOCSERSWILD", TIOCSERSWILD},
+#endif
+#ifdef TIOCSER_TEMT
+ {"TIOCSER_TEMT", TIOCSER_TEMT},
+#endif
+#ifdef TIOCSETD
+ {"TIOCSETD", TIOCSETD},
+#endif
+#ifdef TIOCSLCKTRMIOS
+ {"TIOCSLCKTRMIOS", TIOCSLCKTRMIOS},
+#endif
+#ifdef TIOCSPGRP
+ {"TIOCSPGRP", TIOCSPGRP},
+#endif
+#ifdef TIOCSSERIAL
+ {"TIOCSSERIAL", TIOCSSERIAL},
+#endif
+#ifdef TIOCSSIZE
+ {"TIOCSSIZE", TIOCSSIZE},
+#endif
+#ifdef TIOCSSOFTCAR
+ {"TIOCSSOFTCAR", TIOCSSOFTCAR},
+#endif
+#ifdef TIOCSTI
+ {"TIOCSTI", TIOCSTI},
+#endif
+#ifdef TIOCSWINSZ
+ {"TIOCSWINSZ", TIOCSWINSZ},
+#endif
+#ifdef TIOCTTYGSTRUCT
+ {"TIOCTTYGSTRUCT", TIOCTTYGSTRUCT},
+#endif
+
+ /* sentinel */
+ {NULL, 0}
+};
+
+static int termiosmodule_traverse(PyObject *m, visitproc visit, void *arg) {
+ Py_VISIT(get_termios_state(m)->TermiosError);
+ return 0;
+}
+
+static int termiosmodule_clear(PyObject *m) {
+ Py_CLEAR(get_termios_state(m)->TermiosError);
+ return 0;
+}
+
+static void termiosmodule_free(void *m) {
+ termiosmodule_clear((PyObject *)m);
+}
+
+static int
+termios_exec(PyObject *mod)
+{
+ struct constant *constant = termios_constants;
+ termiosmodulestate *state = get_termios_state(mod);
+ state->TermiosError = PyErr_NewException("termios.error", NULL, NULL);
+ if (state->TermiosError == NULL) {
+ return -1;
+ }
+ Py_INCREF(state->TermiosError);
+ if (PyModule_AddObject(mod, "error", state->TermiosError) < 0) {
+ Py_DECREF(state->TermiosError);
+ return -1;
+ }
+
+ while (constant->name != NULL) {
+ if (PyModule_AddIntConstant(
+ mod, constant->name, constant->value) < 0) {
+ return -1;
+ }
+ ++constant;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot termios_slots[] = {
+ {Py_mod_exec, termios_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef termiosmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "termios",
+ .m_doc = termios__doc__,
+ .m_size = sizeof(termiosmodulestate),
+ .m_methods = termios_methods,
+ .m_slots = termios_slots,
+ .m_traverse = termiosmodule_traverse,
+ .m_clear = termiosmodule_clear,
+ .m_free = termiosmodule_free,
+};
+
+PyMODINIT_FUNC PyInit_termios(void)
+{
+ return PyModuleDef_Init(&termiosmodule);
+}
diff --git a/contrib/tools/python3/Modules/timemodule.c b/contrib/tools/python3/Modules/timemodule.c
new file mode 100644
index 00000000000..3b46deacdf2
--- /dev/null
+++ b/contrib/tools/python3/Modules/timemodule.c
@@ -0,0 +1,2320 @@
+/* Time module */
+
+#include "Python.h"
+#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
+#include "pycore_moduleobject.h" // _PyModule_GetState()
+#include "pycore_namespace.h" // _PyNamespace_New()
+#include "pycore_runtime.h" // _Py_ID()
+
+#include <ctype.h>
+
+#ifdef HAVE_SYS_TIMES_H
+# include <sys/times.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if defined(HAVE_SYS_RESOURCE_H)
+# include <sys/resource.h>
+#endif
+#ifdef QUICKWIN
+# include <io.h>
+#endif
+#if defined(HAVE_PTHREAD_H)
+# include <pthread.h>
+#endif
+#if defined(_AIX)
+# include <sys/thread.h>
+#endif
+#if defined(__WATCOMC__) && !defined(__QNX__)
+# include <i86.h>
+#else
+# ifdef MS_WINDOWS
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# endif /* MS_WINDOWS */
+#endif /* !__WATCOMC__ || __QNX__ */
+
+#ifdef _Py_MEMORY_SANITIZER
+# include <sanitizer/msan_interface.h>
+#endif
+
+#ifdef _MSC_VER
+# define _Py_timezone _timezone
+# define _Py_daylight _daylight
+# define _Py_tzname _tzname
+#else
+# define _Py_timezone timezone
+# define _Py_daylight daylight
+# define _Py_tzname tzname
+#endif
+
+#if defined(__APPLE__ ) && defined(__has_builtin)
+# if __has_builtin(__builtin_available)
+# define HAVE_CLOCK_GETTIME_RUNTIME __builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
+# endif
+#endif
+#ifndef HAVE_CLOCK_GETTIME_RUNTIME
+# define HAVE_CLOCK_GETTIME_RUNTIME 1
+#endif
+
+
+#define SEC_TO_NS (1000 * 1000 * 1000)
+
+
+#if defined(HAVE_TIMES) || defined(HAVE_CLOCK)
+static int
+check_ticks_per_second(long tps, const char *context)
+{
+ /* Effectively, check that _PyTime_MulDiv(t, SEC_TO_NS, ticks_per_second)
+ cannot overflow. */
+ if (tps >= 0 && (_PyTime_t)tps > _PyTime_MAX / SEC_TO_NS) {
+ PyErr_Format(PyExc_OverflowError, "%s is too large", context);
+ return -1;
+ }
+ return 0;
+}
+#endif /* HAVE_TIMES || HAVE_CLOCK */
+
+#ifdef HAVE_TIMES
+
+# define ticks_per_second _PyRuntime.time.ticks_per_second
+
+static void
+ensure_ticks_per_second(void)
+{
+ if (_PyRuntime.time.ticks_per_second_initialized) {
+ return;
+ }
+ _PyRuntime.time.ticks_per_second_initialized = 1;
+# if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK)
+ ticks_per_second = sysconf(_SC_CLK_TCK);
+ if (ticks_per_second < 1) {
+ ticks_per_second = -1;
+ }
+# elif defined(HZ)
+ ticks_per_second = HZ;
+# else
+ ticks_per_second = 60; /* magic fallback value; may be bogus */
+# endif
+}
+
+#endif /* HAVE_TIMES */
+
+
+PyStatus
+_PyTime_Init(void)
+{
+#ifdef HAVE_TIMES
+ ensure_ticks_per_second();
+#endif
+ return PyStatus_Ok();
+}
+
+
+/* Forward declarations */
+static int pysleep(_PyTime_t timeout);
+
+
+typedef struct {
+ PyTypeObject *struct_time_type;
+} time_module_state;
+
+static inline time_module_state*
+get_time_state(PyObject *module)
+{
+ void *state = _PyModule_GetState(module);
+ assert(state != NULL);
+ return (time_module_state *)state;
+}
+
+
+static PyObject*
+_PyFloat_FromPyTime(_PyTime_t t)
+{
+ double d = _PyTime_AsSecondsDouble(t);
+ return PyFloat_FromDouble(d);
+}
+
+
+static int
+get_system_time(_PyTime_t *t)
+{
+ // Avoid _PyTime_GetSystemClock() which silently ignores errors.
+ return _PyTime_GetSystemClockWithInfo(t, NULL);
+}
+
+
+static PyObject *
+time_time(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (get_system_time(&t) < 0) {
+ return NULL;
+ }
+ return _PyFloat_FromPyTime(t);
+}
+
+
+PyDoc_STRVAR(time_doc,
+"time() -> floating point number\n\
+\n\
+Return the current time in seconds since the Epoch.\n\
+Fractions of a second may be present if the system clock provides them.");
+
+static PyObject *
+time_time_ns(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (get_system_time(&t) < 0) {
+ return NULL;
+ }
+ return _PyTime_AsNanosecondsObject(t);
+}
+
+PyDoc_STRVAR(time_ns_doc,
+"time_ns() -> int\n\
+\n\
+Return the current time in nanoseconds since the Epoch.");
+
+#if defined(HAVE_CLOCK)
+
+#ifndef CLOCKS_PER_SEC
+# ifdef CLK_TCK
+# define CLOCKS_PER_SEC CLK_TCK
+# else
+# define CLOCKS_PER_SEC 1000000
+# endif
+#endif
+
+static int
+_PyTime_GetClockWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+{
+ if (check_ticks_per_second(CLOCKS_PER_SEC, "CLOCKS_PER_SEC") < 0) {
+ return -1;
+ }
+
+ if (info) {
+ info->implementation = "clock()";
+ info->resolution = 1.0 / (double)CLOCKS_PER_SEC;
+ info->monotonic = 1;
+ info->adjustable = 0;
+ }
+
+ clock_t ticks = clock();
+ if (ticks == (clock_t)-1) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "the processor time used is not available "
+ "or its value cannot be represented");
+ return -1;
+ }
+ _PyTime_t ns = _PyTime_MulDiv(ticks, SEC_TO_NS, (_PyTime_t)CLOCKS_PER_SEC);
+ *tp = _PyTime_FromNanoseconds(ns);
+ return 0;
+}
+#endif /* HAVE_CLOCK */
+
+
+#ifdef HAVE_CLOCK_GETTIME
+
+#ifdef __APPLE__
+/*
+ * The clock_* functions will be removed from the module
+ * dict entirely when the C API is not available.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+#endif
+
+static PyObject *
+time_clock_gettime(PyObject *self, PyObject *args)
+{
+ int ret;
+ struct timespec tp;
+
+#if defined(_AIX) && (SIZEOF_LONG == 8)
+ long clk_id;
+ if (!PyArg_ParseTuple(args, "l:clock_gettime", &clk_id)) {
+#else
+ int clk_id;
+ if (!PyArg_ParseTuple(args, "i:clock_gettime", &clk_id)) {
+#endif
+ return NULL;
+ }
+
+ ret = clock_gettime((clockid_t)clk_id, &tp);
+ if (ret != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ return PyFloat_FromDouble(tp.tv_sec + tp.tv_nsec * 1e-9);
+}
+
+PyDoc_STRVAR(clock_gettime_doc,
+"clock_gettime(clk_id) -> float\n\
+\n\
+Return the time of the specified clock clk_id.");
+
+static PyObject *
+time_clock_gettime_ns(PyObject *self, PyObject *args)
+{
+ int ret;
+ int clk_id;
+ struct timespec ts;
+ _PyTime_t t;
+
+ if (!PyArg_ParseTuple(args, "i:clock_gettime", &clk_id)) {
+ return NULL;
+ }
+
+ ret = clock_gettime((clockid_t)clk_id, &ts);
+ if (ret != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ if (_PyTime_FromTimespec(&t, &ts) < 0) {
+ return NULL;
+ }
+ return _PyTime_AsNanosecondsObject(t);
+}
+
+PyDoc_STRVAR(clock_gettime_ns_doc,
+"clock_gettime_ns(clk_id) -> int\n\
+\n\
+Return the time of the specified clock clk_id as nanoseconds.");
+#endif /* HAVE_CLOCK_GETTIME */
+
+#ifdef HAVE_CLOCK_SETTIME
+static PyObject *
+time_clock_settime(PyObject *self, PyObject *args)
+{
+ int clk_id;
+ PyObject *obj;
+ _PyTime_t t;
+ struct timespec tp;
+ int ret;
+
+ if (!PyArg_ParseTuple(args, "iO:clock_settime", &clk_id, &obj))
+ return NULL;
+
+ if (_PyTime_FromSecondsObject(&t, obj, _PyTime_ROUND_FLOOR) < 0)
+ return NULL;
+
+ if (_PyTime_AsTimespec(t, &tp) == -1)
+ return NULL;
+
+ ret = clock_settime((clockid_t)clk_id, &tp);
+ if (ret != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(clock_settime_doc,
+"clock_settime(clk_id, time)\n\
+\n\
+Set the time of the specified clock clk_id.");
+
+static PyObject *
+time_clock_settime_ns(PyObject *self, PyObject *args)
+{
+ int clk_id;
+ PyObject *obj;
+ _PyTime_t t;
+ struct timespec ts;
+ int ret;
+
+ if (!PyArg_ParseTuple(args, "iO:clock_settime", &clk_id, &obj)) {
+ return NULL;
+ }
+
+ if (_PyTime_FromNanosecondsObject(&t, obj) < 0) {
+ return NULL;
+ }
+ if (_PyTime_AsTimespec(t, &ts) == -1) {
+ return NULL;
+ }
+
+ ret = clock_settime((clockid_t)clk_id, &ts);
+ if (ret != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(clock_settime_ns_doc,
+"clock_settime_ns(clk_id, time)\n\
+\n\
+Set the time of the specified clock clk_id with nanoseconds.");
+#endif /* HAVE_CLOCK_SETTIME */
+
+#ifdef HAVE_CLOCK_GETRES
+static PyObject *
+time_clock_getres(PyObject *self, PyObject *args)
+{
+ int ret;
+ int clk_id;
+ struct timespec tp;
+
+ if (!PyArg_ParseTuple(args, "i:clock_getres", &clk_id))
+ return NULL;
+
+ ret = clock_getres((clockid_t)clk_id, &tp);
+ if (ret != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+
+ return PyFloat_FromDouble(tp.tv_sec + tp.tv_nsec * 1e-9);
+}
+
+PyDoc_STRVAR(clock_getres_doc,
+"clock_getres(clk_id) -> floating point number\n\
+\n\
+Return the resolution (precision) of the specified clock clk_id.");
+
+#ifdef __APPLE__
+#pragma clang diagnostic pop
+#endif
+
+#endif /* HAVE_CLOCK_GETRES */
+
+#ifdef HAVE_PTHREAD_GETCPUCLOCKID
+static PyObject *
+time_pthread_getcpuclockid(PyObject *self, PyObject *args)
+{
+ unsigned long thread_id;
+ int err;
+ clockid_t clk_id;
+ if (!PyArg_ParseTuple(args, "k:pthread_getcpuclockid", &thread_id)) {
+ return NULL;
+ }
+ err = pthread_getcpuclockid((pthread_t)thread_id, &clk_id);
+ if (err) {
+ errno = err;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+#ifdef _Py_MEMORY_SANITIZER
+ __msan_unpoison(&clk_id, sizeof(clk_id));
+#endif
+ return PyLong_FromLong(clk_id);
+}
+
+PyDoc_STRVAR(pthread_getcpuclockid_doc,
+"pthread_getcpuclockid(thread_id) -> int\n\
+\n\
+Return the clk_id of a thread's CPU time clock.");
+#endif /* HAVE_PTHREAD_GETCPUCLOCKID */
+
+static PyObject *
+time_sleep(PyObject *self, PyObject *timeout_obj)
+{
+ _PyTime_t timeout;
+ if (_PyTime_FromSecondsObject(&timeout, timeout_obj, _PyTime_ROUND_TIMEOUT))
+ return NULL;
+ if (timeout < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "sleep length must be non-negative");
+ return NULL;
+ }
+ if (pysleep(timeout) != 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(sleep_doc,
+"sleep(seconds)\n\
+\n\
+Delay execution for a given number of seconds. The argument may be\n\
+a floating point number for subsecond precision.");
+
+static PyStructSequence_Field struct_time_type_fields[] = {
+ {"tm_year", "year, for example, 1993"},
+ {"tm_mon", "month of year, range [1, 12]"},
+ {"tm_mday", "day of month, range [1, 31]"},
+ {"tm_hour", "hours, range [0, 23]"},
+ {"tm_min", "minutes, range [0, 59]"},
+ {"tm_sec", "seconds, range [0, 61])"},
+ {"tm_wday", "day of week, range [0, 6], Monday is 0"},
+ {"tm_yday", "day of year, range [1, 366]"},
+ {"tm_isdst", "1 if summer time is in effect, 0 if not, and -1 if unknown"},
+ {"tm_zone", "abbreviation of timezone name"},
+ {"tm_gmtoff", "offset from UTC in seconds"},
+ {0}
+};
+
+static PyStructSequence_Desc struct_time_type_desc = {
+ "time.struct_time",
+ "The time value as returned by gmtime(), localtime(), and strptime(), and\n"
+ " accepted by asctime(), mktime() and strftime(). May be considered as a\n"
+ " sequence of 9 integers.\n\n"
+ " Note that several fields' values are not the same as those defined by\n"
+ " the C language standard for struct tm. For example, the value of the\n"
+ " field tm_year is the actual year, not year - 1900. See individual\n"
+ " fields' descriptions for details.",
+ struct_time_type_fields,
+ 9,
+};
+
+#if defined(MS_WINDOWS)
+#ifndef CREATE_WAITABLE_TIMER_HIGH_RESOLUTION
+ #define CREATE_WAITABLE_TIMER_HIGH_RESOLUTION 0x00000002
+#endif
+
+static DWORD timer_flags = (DWORD)-1;
+#endif
+
+static PyObject *
+tmtotuple(time_module_state *state, struct tm *p
+#ifndef HAVE_STRUCT_TM_TM_ZONE
+ , const char *zone, time_t gmtoff
+#endif
+)
+{
+ PyObject *v = PyStructSequence_New(state->struct_time_type);
+ if (v == NULL)
+ return NULL;
+
+#define SET(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val))
+
+ SET(0, p->tm_year + 1900);
+ SET(1, p->tm_mon + 1); /* Want January == 1 */
+ SET(2, p->tm_mday);
+ SET(3, p->tm_hour);
+ SET(4, p->tm_min);
+ SET(5, p->tm_sec);
+ SET(6, (p->tm_wday + 6) % 7); /* Want Monday == 0 */
+ SET(7, p->tm_yday + 1); /* Want January, 1 == 1 */
+ SET(8, p->tm_isdst);
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ PyStructSequence_SET_ITEM(v, 9,
+ PyUnicode_DecodeLocale(p->tm_zone, "surrogateescape"));
+ SET(10, p->tm_gmtoff);
+#else
+ PyStructSequence_SET_ITEM(v, 9,
+ PyUnicode_DecodeLocale(zone, "surrogateescape"));
+ PyStructSequence_SET_ITEM(v, 10, _PyLong_FromTime_t(gmtoff));
+#endif /* HAVE_STRUCT_TM_TM_ZONE */
+#undef SET
+ if (PyErr_Occurred()) {
+ Py_XDECREF(v);
+ return NULL;
+ }
+
+ return v;
+}
+
+/* Parse arg tuple that can contain an optional float-or-None value;
+ format needs to be "|O:name".
+ Returns non-zero on success (parallels PyArg_ParseTuple).
+*/
+static int
+parse_time_t_args(PyObject *args, const char *format, time_t *pwhen)
+{
+ PyObject *ot = NULL;
+ time_t whent;
+
+ if (!PyArg_ParseTuple(args, format, &ot))
+ return 0;
+ if (ot == NULL || ot == Py_None) {
+ whent = time(NULL);
+ }
+ else {
+ if (_PyTime_ObjectToTime_t(ot, &whent, _PyTime_ROUND_FLOOR) == -1)
+ return 0;
+ }
+ *pwhen = whent;
+ return 1;
+}
+
+static PyObject *
+time_gmtime(PyObject *module, PyObject *args)
+{
+ time_t when;
+ struct tm buf;
+
+ if (!parse_time_t_args(args, "|O:gmtime", &when))
+ return NULL;
+
+ errno = 0;
+ if (_PyTime_gmtime(when, &buf) != 0)
+ return NULL;
+
+ time_module_state *state = get_time_state(module);
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ return tmtotuple(state, &buf);
+#else
+ return tmtotuple(state, &buf, "UTC", 0);
+#endif
+}
+
+#ifndef HAVE_TIMEGM
+static time_t
+timegm(struct tm *p)
+{
+ /* XXX: the following implementation will not work for tm_year < 1970.
+ but it is likely that platforms that don't have timegm do not support
+ negative timestamps anyways. */
+ return p->tm_sec + p->tm_min*60 + p->tm_hour*3600 + p->tm_yday*86400 +
+ (p->tm_year-70)*31536000 + ((p->tm_year-69)/4)*86400 -
+ ((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400;
+}
+#endif
+
+PyDoc_STRVAR(gmtime_doc,
+"gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n\
+ tm_sec, tm_wday, tm_yday, tm_isdst)\n\
+\n\
+Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.\n\
+GMT). When 'seconds' is not passed in, convert the current time instead.\n\
+\n\
+If the platform supports the tm_gmtoff and tm_zone, they are available as\n\
+attributes only.");
+
+static PyObject *
+time_localtime(PyObject *module, PyObject *args)
+{
+ time_t when;
+ struct tm buf;
+
+ if (!parse_time_t_args(args, "|O:localtime", &when))
+ return NULL;
+ if (_PyTime_localtime(when, &buf) != 0)
+ return NULL;
+
+ time_module_state *state = get_time_state(module);
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ return tmtotuple(state, &buf);
+#else
+ {
+ struct tm local = buf;
+ char zone[100];
+ time_t gmtoff;
+ strftime(zone, sizeof(zone), "%Z", &buf);
+ gmtoff = timegm(&buf) - when;
+ return tmtotuple(state, &local, zone, gmtoff);
+ }
+#endif
+}
+
+#if defined(__linux__) && !defined(__GLIBC__)
+static const char *utc_string = NULL;
+#endif
+
+PyDoc_STRVAR(localtime_doc,
+"localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n\
+ tm_sec,tm_wday,tm_yday,tm_isdst)\n\
+\n\
+Convert seconds since the Epoch to a time tuple expressing local time.\n\
+When 'seconds' is not passed in, convert the current time instead.");
+
+/* Convert 9-item tuple to tm structure. Return 1 on success, set
+ * an exception and return 0 on error.
+ */
+static int
+gettmarg(time_module_state *state, PyObject *args,
+ struct tm *p, const char *format)
+{
+ int y;
+
+ memset((void *) p, '\0', sizeof(struct tm));
+
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Tuple or struct_time argument required");
+ return 0;
+ }
+
+ if (!PyArg_ParseTuple(args, format,
+ &y, &p->tm_mon, &p->tm_mday,
+ &p->tm_hour, &p->tm_min, &p->tm_sec,
+ &p->tm_wday, &p->tm_yday, &p->tm_isdst))
+ return 0;
+
+ if (y < INT_MIN + 1900) {
+ PyErr_SetString(PyExc_OverflowError, "year out of range");
+ return 0;
+ }
+
+ p->tm_year = y - 1900;
+ p->tm_mon--;
+ p->tm_wday = (p->tm_wday + 1) % 7;
+ p->tm_yday--;
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ if (Py_IS_TYPE(args, state->struct_time_type)) {
+ PyObject *item;
+ item = PyStructSequence_GET_ITEM(args, 9);
+ if (item != Py_None) {
+ p->tm_zone = (char *)PyUnicode_AsUTF8(item);
+ if (p->tm_zone == NULL) {
+ return 0;
+ }
+#if defined(__linux__) && !defined(__GLIBC__)
+ // Make an attempt to return the C library's own timezone strings to
+ // it. musl refuses to process a tm_zone field unless it produced
+ // it. See issue #34672.
+ if (utc_string && strcmp(p->tm_zone, utc_string) == 0) {
+ p->tm_zone = utc_string;
+ }
+ else if (tzname[0] && strcmp(p->tm_zone, tzname[0]) == 0) {
+ p->tm_zone = tzname[0];
+ }
+ else if (tzname[1] && strcmp(p->tm_zone, tzname[1]) == 0) {
+ p->tm_zone = tzname[1];
+ }
+#endif
+ }
+ item = PyStructSequence_GET_ITEM(args, 10);
+ if (item != Py_None) {
+ p->tm_gmtoff = PyLong_AsLong(item);
+ if (PyErr_Occurred())
+ return 0;
+ }
+ }
+#endif /* HAVE_STRUCT_TM_TM_ZONE */
+ return 1;
+}
+
+/* Check values of the struct tm fields before it is passed to strftime() and
+ * asctime(). Return 1 if all values are valid, otherwise set an exception
+ * and returns 0.
+ */
+static int
+checktm(struct tm* buf)
+{
+ /* Checks added to make sure strftime() and asctime() does not crash Python by
+ indexing blindly into some array for a textual representation
+ by some bad index (fixes bug #897625 and #6608).
+
+ Also support values of zero from Python code for arguments in which
+ that is out of range by forcing that value to the lowest value that
+ is valid (fixed bug #1520914).
+
+ Valid ranges based on what is allowed in struct tm:
+
+ - tm_year: [0, max(int)] (1)
+ - tm_mon: [0, 11] (2)
+ - tm_mday: [1, 31]
+ - tm_hour: [0, 23]
+ - tm_min: [0, 59]
+ - tm_sec: [0, 60]
+ - tm_wday: [0, 6] (1)
+ - tm_yday: [0, 365] (2)
+ - tm_isdst: [-max(int), max(int)]
+
+ (1) gettmarg() handles bounds-checking.
+ (2) Python's acceptable range is one greater than the range in C,
+ thus need to check against automatic decrement by gettmarg().
+ */
+ if (buf->tm_mon == -1)
+ buf->tm_mon = 0;
+ else if (buf->tm_mon < 0 || buf->tm_mon > 11) {
+ PyErr_SetString(PyExc_ValueError, "month out of range");
+ return 0;
+ }
+ if (buf->tm_mday == 0)
+ buf->tm_mday = 1;
+ else if (buf->tm_mday < 0 || buf->tm_mday > 31) {
+ PyErr_SetString(PyExc_ValueError, "day of month out of range");
+ return 0;
+ }
+ if (buf->tm_hour < 0 || buf->tm_hour > 23) {
+ PyErr_SetString(PyExc_ValueError, "hour out of range");
+ return 0;
+ }
+ if (buf->tm_min < 0 || buf->tm_min > 59) {
+ PyErr_SetString(PyExc_ValueError, "minute out of range");
+ return 0;
+ }
+ if (buf->tm_sec < 0 || buf->tm_sec > 61) {
+ PyErr_SetString(PyExc_ValueError, "seconds out of range");
+ return 0;
+ }
+ /* tm_wday does not need checking of its upper-bound since taking
+ ``% 7`` in gettmarg() automatically restricts the range. */
+ if (buf->tm_wday < 0) {
+ PyErr_SetString(PyExc_ValueError, "day of week out of range");
+ return 0;
+ }
+ if (buf->tm_yday == -1)
+ buf->tm_yday = 0;
+ else if (buf->tm_yday < 0 || buf->tm_yday > 365) {
+ PyErr_SetString(PyExc_ValueError, "day of year out of range");
+ return 0;
+ }
+ return 1;
+}
+
+#ifdef MS_WINDOWS
+ /* wcsftime() doesn't format correctly time zones, see issue #10653 */
+# undef HAVE_WCSFTIME
+#endif
+#define STRFTIME_FORMAT_CODES \
+"Commonly used format codes:\n\
+\n\
+%Y Year with century as a decimal number.\n\
+%m Month as a decimal number [01,12].\n\
+%d Day of the month as a decimal number [01,31].\n\
+%H Hour (24-hour clock) as a decimal number [00,23].\n\
+%M Minute as a decimal number [00,59].\n\
+%S Second as a decimal number [00,61].\n\
+%z Time zone offset from UTC.\n\
+%a Locale's abbreviated weekday name.\n\
+%A Locale's full weekday name.\n\
+%b Locale's abbreviated month name.\n\
+%B Locale's full month name.\n\
+%c Locale's appropriate date and time representation.\n\
+%I Hour (12-hour clock) as a decimal number [01,12].\n\
+%p Locale's equivalent of either AM or PM.\n\
+\n\
+Other codes may be available on your platform. See documentation for\n\
+the C library strftime function.\n"
+
+#ifdef HAVE_STRFTIME
+#ifdef HAVE_WCSFTIME
+#define time_char wchar_t
+#define format_time wcsftime
+#define time_strlen wcslen
+#else
+#define time_char char
+#define format_time strftime
+#define time_strlen strlen
+#endif
+
+static PyObject *
+time_strftime(PyObject *module, PyObject *args)
+{
+ PyObject *tup = NULL;
+ struct tm buf;
+ const time_char *fmt;
+#ifdef HAVE_WCSFTIME
+ wchar_t *format;
+#else
+ PyObject *format;
+#endif
+ PyObject *format_arg;
+ size_t fmtlen, buflen;
+ time_char *outbuf = NULL;
+ size_t i;
+ PyObject *ret = NULL;
+
+ memset((void *) &buf, '\0', sizeof(buf));
+
+ /* Will always expect a unicode string to be passed as format.
+ Given that there's no str type anymore in py3k this seems safe.
+ */
+ if (!PyArg_ParseTuple(args, "U|O:strftime", &format_arg, &tup))
+ return NULL;
+
+ time_module_state *state = get_time_state(module);
+ if (tup == NULL) {
+ time_t tt = time(NULL);
+ if (_PyTime_localtime(tt, &buf) != 0)
+ return NULL;
+ }
+ else if (!gettmarg(state, tup, &buf,
+ "iiiiiiiii;strftime(): illegal time tuple argument") ||
+ !checktm(&buf))
+ {
+ return NULL;
+ }
+
+#if defined(_MSC_VER) || (defined(__sun) && defined(__SVR4)) || defined(_AIX) || defined(__VXWORKS__)
+ if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) {
+ PyErr_SetString(PyExc_ValueError,
+ "strftime() requires year in [1; 9999]");
+ return NULL;
+ }
+#endif
+
+ /* Normalize tm_isdst just in case someone foolishly implements %Z
+ based on the assumption that tm_isdst falls within the range of
+ [-1, 1] */
+ if (buf.tm_isdst < -1)
+ buf.tm_isdst = -1;
+ else if (buf.tm_isdst > 1)
+ buf.tm_isdst = 1;
+
+#ifdef HAVE_WCSFTIME
+ format = PyUnicode_AsWideCharString(format_arg, NULL);
+ if (format == NULL)
+ return NULL;
+ fmt = format;
+#else
+ /* Convert the unicode string to an ascii one */
+ format = PyUnicode_EncodeLocale(format_arg, "surrogateescape");
+ if (format == NULL)
+ return NULL;
+ fmt = PyBytes_AS_STRING(format);
+#endif
+
+#if defined(MS_WINDOWS) && !defined(HAVE_WCSFTIME)
+ /* check that the format string contains only valid directives */
+ for (outbuf = strchr(fmt, '%');
+ outbuf != NULL;
+ outbuf = strchr(outbuf+2, '%'))
+ {
+ if (outbuf[1] == '#')
+ ++outbuf; /* not documented by python, */
+ if (outbuf[1] == '\0')
+ break;
+ if ((outbuf[1] == 'y') && buf.tm_year < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "format %y requires year >= 1900 on Windows");
+ Py_DECREF(format);
+ return NULL;
+ }
+ }
+#elif (defined(_AIX) || (defined(__sun) && defined(__SVR4))) && defined(HAVE_WCSFTIME)
+ for (outbuf = wcschr(fmt, '%');
+ outbuf != NULL;
+ outbuf = wcschr(outbuf+2, '%'))
+ {
+ if (outbuf[1] == L'\0')
+ break;
+ /* Issue #19634: On AIX, wcsftime("y", (1899, 1, 1, 0, 0, 0, 0, 0, 0))
+ returns "0/" instead of "99" */
+ if (outbuf[1] == L'y' && buf.tm_year < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "format %y requires year >= 1900 on AIX");
+ PyMem_Free(format);
+ return NULL;
+ }
+ }
+#endif
+
+ fmtlen = time_strlen(fmt);
+
+ /* I hate these functions that presume you know how big the output
+ * will be ahead of time...
+ */
+ for (i = 1024; ; i += i) {
+ outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char));
+ if (outbuf == NULL) {
+ PyErr_NoMemory();
+ break;
+ }
+#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
+ errno = 0;
+#endif
+ _Py_BEGIN_SUPPRESS_IPH
+ buflen = format_time(outbuf, i, fmt, &buf);
+ _Py_END_SUPPRESS_IPH
+#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
+ /* VisualStudio .NET 2005 does this properly */
+ if (buflen == 0 && errno == EINVAL) {
+ PyErr_SetString(PyExc_ValueError, "Invalid format string");
+ PyMem_Free(outbuf);
+ break;
+ }
+#endif
+ if (buflen > 0 || i >= 256 * fmtlen) {
+ /* If the buffer is 256 times as long as the format,
+ it's probably not failing for lack of room!
+ More likely, the format yields an empty result,
+ e.g. an empty format, or %Z when the timezone
+ is unknown. */
+#ifdef HAVE_WCSFTIME
+ ret = PyUnicode_FromWideChar(outbuf, buflen);
+#else
+ ret = PyUnicode_DecodeLocaleAndSize(outbuf, buflen, "surrogateescape");
+#endif
+ PyMem_Free(outbuf);
+ break;
+ }
+ PyMem_Free(outbuf);
+ }
+#ifdef HAVE_WCSFTIME
+ PyMem_Free(format);
+#else
+ Py_DECREF(format);
+#endif
+ return ret;
+}
+
+#undef time_char
+#undef format_time
+PyDoc_STRVAR(strftime_doc,
+"strftime(format[, tuple]) -> string\n\
+\n\
+Convert a time tuple to a string according to a format specification.\n\
+See the library reference manual for formatting codes. When the time tuple\n\
+is not present, current time as returned by localtime() is used.\n\
+\n" STRFTIME_FORMAT_CODES);
+#endif /* HAVE_STRFTIME */
+
+static PyObject *
+time_strptime(PyObject *self, PyObject *args)
+{
+ PyObject *func, *result;
+
+ func = _PyImport_GetModuleAttrString("_strptime", "_strptime_time");
+ if (!func) {
+ return NULL;
+ }
+
+ result = PyObject_Call(func, args, NULL);
+ Py_DECREF(func);
+ return result;
+}
+
+
+PyDoc_STRVAR(strptime_doc,
+"strptime(string, format) -> struct_time\n\
+\n\
+Parse a string to a time tuple according to a format specification.\n\
+See the library reference manual for formatting codes (same as\n\
+strftime()).\n\
+\n" STRFTIME_FORMAT_CODES);
+
+static PyObject *
+_asctime(struct tm *timeptr)
+{
+ /* Inspired by Open Group reference implementation available at
+ * http://pubs.opengroup.org/onlinepubs/009695399/functions/asctime.html */
+ static const char wday_name[7][4] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+ static const char mon_name[12][4] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+ return PyUnicode_FromFormat(
+ "%s %s%3d %.2d:%.2d:%.2d %d",
+ wday_name[timeptr->tm_wday],
+ mon_name[timeptr->tm_mon],
+ timeptr->tm_mday, timeptr->tm_hour,
+ timeptr->tm_min, timeptr->tm_sec,
+ 1900 + timeptr->tm_year);
+}
+
+static PyObject *
+time_asctime(PyObject *module, PyObject *args)
+{
+ PyObject *tup = NULL;
+ struct tm buf;
+
+ if (!PyArg_UnpackTuple(args, "asctime", 0, 1, &tup))
+ return NULL;
+
+ time_module_state *state = get_time_state(module);
+ if (tup == NULL) {
+ time_t tt = time(NULL);
+ if (_PyTime_localtime(tt, &buf) != 0)
+ return NULL;
+ }
+ else if (!gettmarg(state, tup, &buf,
+ "iiiiiiiii;asctime(): illegal time tuple argument") ||
+ !checktm(&buf))
+ {
+ return NULL;
+ }
+ return _asctime(&buf);
+}
+
+PyDoc_STRVAR(asctime_doc,
+"asctime([tuple]) -> string\n\
+\n\
+Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.\n\
+When the time tuple is not present, current time as returned by localtime()\n\
+is used.");
+
+static PyObject *
+time_ctime(PyObject *self, PyObject *args)
+{
+ time_t tt;
+ struct tm buf;
+ if (!parse_time_t_args(args, "|O:ctime", &tt))
+ return NULL;
+ if (_PyTime_localtime(tt, &buf) != 0)
+ return NULL;
+ return _asctime(&buf);
+}
+
+PyDoc_STRVAR(ctime_doc,
+"ctime(seconds) -> string\n\
+\n\
+Convert a time in seconds since the Epoch to a string in local time.\n\
+This is equivalent to asctime(localtime(seconds)). When the time tuple is\n\
+not present, current time as returned by localtime() is used.");
+
+#ifdef HAVE_MKTIME
+static PyObject *
+time_mktime(PyObject *module, PyObject *tm_tuple)
+{
+ struct tm tm;
+ time_t tt;
+
+ time_module_state *state = get_time_state(module);
+ if (!gettmarg(state, tm_tuple, &tm,
+ "iiiiiiiii;mktime(): illegal time tuple argument"))
+ {
+ return NULL;
+ }
+
+#if defined(_AIX) || (defined(__VXWORKS__) && !defined(_WRS_CONFIG_LP64))
+ /* bpo-19748: AIX mktime() valid range is 00:00:00 UTC, January 1, 1970
+ to 03:14:07 UTC, January 19, 2038. Thanks to the workaround below,
+ it is possible to support years in range [1902; 2037] */
+ if (tm.tm_year < 2 || tm.tm_year > 137) {
+ /* bpo-19748: On AIX, mktime() does not report overflow error
+ for timestamp < -2^31 or timestamp > 2**31-1. VxWorks has the
+ same issue when working in 32 bit mode. */
+ PyErr_SetString(PyExc_OverflowError,
+ "mktime argument out of range");
+ return NULL;
+ }
+#endif
+
+#ifdef _AIX
+ /* bpo-34373: AIX mktime() has an integer overflow for years in range
+ [1902; 1969]. Workaround the issue by using a year greater or equal than
+ 1970 (tm_year >= 70): mktime() behaves correctly in that case
+ (ex: properly report errors). tm_year and tm_wday are adjusted after
+ mktime() call. */
+ int orig_tm_year = tm.tm_year;
+ int delta_days = 0;
+ while (tm.tm_year < 70) {
+ /* Use 4 years to account properly leap years */
+ tm.tm_year += 4;
+ delta_days -= (366 + (365 * 3));
+ }
+#endif
+
+ tm.tm_wday = -1; /* sentinel; original value ignored */
+ tt = mktime(&tm);
+
+ /* Return value of -1 does not necessarily mean an error, but tm_wday
+ * cannot remain set to -1 if mktime succeeded. */
+ if (tt == (time_t)(-1)
+ /* Return value of -1 does not necessarily mean an error, but
+ * tm_wday cannot remain set to -1 if mktime succeeded. */
+ && tm.tm_wday == -1)
+ {
+ PyErr_SetString(PyExc_OverflowError,
+ "mktime argument out of range");
+ return NULL;
+ }
+
+#ifdef _AIX
+ if (delta_days != 0) {
+ tm.tm_year = orig_tm_year;
+ if (tm.tm_wday != -1) {
+ tm.tm_wday = (tm.tm_wday + delta_days) % 7;
+ }
+ tt += delta_days * (24 * 3600);
+ }
+#endif
+
+ return PyFloat_FromDouble((double)tt);
+}
+
+PyDoc_STRVAR(mktime_doc,
+"mktime(tuple) -> floating point number\n\
+\n\
+Convert a time tuple in local time to seconds since the Epoch.\n\
+Note that mktime(gmtime(0)) will not generally return zero for most\n\
+time zones; instead the returned value will either be equal to that\n\
+of the timezone or altzone attributes on the time module.");
+#endif /* HAVE_MKTIME */
+
+#ifdef HAVE_WORKING_TZSET
+static int init_timezone(PyObject *module);
+
+static PyObject *
+time_tzset(PyObject *self, PyObject *unused)
+{
+ PyObject* m;
+
+ m = PyImport_ImportModule("time");
+ if (m == NULL) {
+ return NULL;
+ }
+
+#if !defined(MS_WINDOWS) || defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
+ tzset();
+#endif
+
+ /* Reset timezone, altzone, daylight and tzname */
+ if (init_timezone(m) < 0) {
+ return NULL;
+ }
+ Py_DECREF(m);
+ if (PyErr_Occurred())
+ return NULL;
+
+ Py_RETURN_NONE;
+}
+
+PyDoc_STRVAR(tzset_doc,
+"tzset()\n\
+\n\
+Initialize, or reinitialize, the local timezone to the value stored in\n\
+os.environ['TZ']. The TZ environment variable should be specified in\n\
+standard Unix timezone format as documented in the tzset man page\n\
+(eg. 'US/Eastern', 'Europe/Amsterdam'). Unknown timezones will silently\n\
+fall back to UTC. If the TZ environment variable is not set, the local\n\
+timezone is set to the systems best guess of wallclock time.\n\
+Changing the TZ environment variable without calling tzset *may* change\n\
+the local timezone used by methods such as localtime, but this behaviour\n\
+should not be relied on.");
+#endif /* HAVE_WORKING_TZSET */
+
+
+static int
+get_monotonic(_PyTime_t *t)
+{
+ // Avoid _PyTime_GetMonotonicClock() which silently ignores errors.
+ return _PyTime_GetMonotonicClockWithInfo(t, NULL);
+}
+
+
+static PyObject *
+time_monotonic(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (get_monotonic(&t) < 0) {
+ return NULL;
+ }
+ return _PyFloat_FromPyTime(t);
+}
+
+PyDoc_STRVAR(monotonic_doc,
+"monotonic() -> float\n\
+\n\
+Monotonic clock, cannot go backward.");
+
+static PyObject *
+time_monotonic_ns(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (get_monotonic(&t) < 0) {
+ return NULL;
+ }
+ return _PyTime_AsNanosecondsObject(t);
+}
+
+PyDoc_STRVAR(monotonic_ns_doc,
+"monotonic_ns() -> int\n\
+\n\
+Monotonic clock, cannot go backward, as nanoseconds.");
+
+
+static int
+get_perf_counter(_PyTime_t *t)
+{
+ // Avoid _PyTime_GetPerfCounter() which silently ignores errors.
+ return _PyTime_GetPerfCounterWithInfo(t, NULL);
+}
+
+
+static PyObject *
+time_perf_counter(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (get_perf_counter(&t) < 0) {
+ return NULL;
+ }
+ return _PyFloat_FromPyTime(t);
+}
+
+PyDoc_STRVAR(perf_counter_doc,
+"perf_counter() -> float\n\
+\n\
+Performance counter for benchmarking.");
+
+
+static PyObject *
+time_perf_counter_ns(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (get_perf_counter(&t) < 0) {
+ return NULL;
+ }
+ return _PyTime_AsNanosecondsObject(t);
+}
+
+PyDoc_STRVAR(perf_counter_ns_doc,
+"perf_counter_ns() -> int\n\
+\n\
+Performance counter for benchmarking as nanoseconds.");
+
+static int
+_PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+{
+#if defined(MS_WINDOWS)
+ HANDLE process;
+ FILETIME creation_time, exit_time, kernel_time, user_time;
+ ULARGE_INTEGER large;
+ _PyTime_t ktime, utime, t;
+ BOOL ok;
+
+ process = GetCurrentProcess();
+ ok = GetProcessTimes(process, &creation_time, &exit_time,
+ &kernel_time, &user_time);
+ if (!ok) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+
+ if (info) {
+ info->implementation = "GetProcessTimes()";
+ info->resolution = 1e-7;
+ info->monotonic = 1;
+ info->adjustable = 0;
+ }
+
+ large.u.LowPart = kernel_time.dwLowDateTime;
+ large.u.HighPart = kernel_time.dwHighDateTime;
+ ktime = large.QuadPart;
+
+ large.u.LowPart = user_time.dwLowDateTime;
+ large.u.HighPart = user_time.dwHighDateTime;
+ utime = large.QuadPart;
+
+ /* ktime and utime have a resolution of 100 nanoseconds */
+ t = _PyTime_FromNanoseconds((ktime + utime) * 100);
+ *tp = t;
+ return 0;
+#else
+
+ /* clock_gettime */
+#if defined(HAVE_CLOCK_GETTIME) \
+ && (defined(CLOCK_PROCESS_CPUTIME_ID) || defined(CLOCK_PROF))
+ struct timespec ts;
+
+ if (HAVE_CLOCK_GETTIME_RUNTIME) {
+
+#ifdef CLOCK_PROF
+ const clockid_t clk_id = CLOCK_PROF;
+ const char *function = "clock_gettime(CLOCK_PROF)";
+#else
+ const clockid_t clk_id = CLOCK_PROCESS_CPUTIME_ID;
+ const char *function = "clock_gettime(CLOCK_PROCESS_CPUTIME_ID)";
+#endif
+
+ if (clock_gettime(clk_id, &ts) == 0) {
+ if (info) {
+ struct timespec res;
+ info->implementation = function;
+ info->monotonic = 1;
+ info->adjustable = 0;
+ if (clock_getres(clk_id, &res)) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+ info->resolution = res.tv_sec + res.tv_nsec * 1e-9;
+ }
+
+ if (_PyTime_FromTimespec(tp, &ts) < 0) {
+ return -1;
+ }
+ return 0;
+ }
+ }
+#endif
+
+ /* getrusage(RUSAGE_SELF) */
+#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRUSAGE)
+ struct rusage ru;
+
+ if (getrusage(RUSAGE_SELF, &ru) == 0) {
+ _PyTime_t utime, stime;
+
+ if (info) {
+ info->implementation = "getrusage(RUSAGE_SELF)";
+ info->monotonic = 1;
+ info->adjustable = 0;
+ info->resolution = 1e-6;
+ }
+
+ if (_PyTime_FromTimeval(&utime, &ru.ru_utime) < 0) {
+ return -1;
+ }
+ if (_PyTime_FromTimeval(&stime, &ru.ru_stime) < 0) {
+ return -1;
+ }
+
+ _PyTime_t total = utime + stime;
+ *tp = total;
+ return 0;
+ }
+#endif
+
+ /* times() */
+#ifdef HAVE_TIMES
+ struct tms t;
+
+ if (times(&t) != (clock_t)-1) {
+ assert(_PyRuntime.time.ticks_per_second_initialized);
+ if (check_ticks_per_second(ticks_per_second, "_SC_CLK_TCK") < 0) {
+ return -1;
+ }
+ if (ticks_per_second != -1) {
+ if (info) {
+ info->implementation = "times()";
+ info->monotonic = 1;
+ info->adjustable = 0;
+ info->resolution = 1.0 / (double)ticks_per_second;
+ }
+
+ _PyTime_t ns;
+ ns = _PyTime_MulDiv(t.tms_utime, SEC_TO_NS, ticks_per_second);
+ ns += _PyTime_MulDiv(t.tms_stime, SEC_TO_NS, ticks_per_second);
+ *tp = _PyTime_FromNanoseconds(ns);
+ return 0;
+ }
+ }
+#endif
+
+ /* clock */
+ /* Currently, Python 3 requires clock() to build: see issue #22624 */
+ return _PyTime_GetClockWithInfo(tp, info);
+#endif
+}
+
+static PyObject *
+time_process_time(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (_PyTime_GetProcessTimeWithInfo(&t, NULL) < 0) {
+ return NULL;
+ }
+ return _PyFloat_FromPyTime(t);
+}
+
+PyDoc_STRVAR(process_time_doc,
+"process_time() -> float\n\
+\n\
+Process time for profiling: sum of the kernel and user-space CPU time.");
+
+static PyObject *
+time_process_time_ns(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (_PyTime_GetProcessTimeWithInfo(&t, NULL) < 0) {
+ return NULL;
+ }
+ return _PyTime_AsNanosecondsObject(t);
+}
+
+PyDoc_STRVAR(process_time_ns_doc,
+"process_time() -> int\n\
+\n\
+Process time for profiling as nanoseconds:\n\
+sum of the kernel and user-space CPU time.");
+
+
+#if defined(MS_WINDOWS)
+#define HAVE_THREAD_TIME
+static int
+_PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+{
+ HANDLE thread;
+ FILETIME creation_time, exit_time, kernel_time, user_time;
+ ULARGE_INTEGER large;
+ _PyTime_t ktime, utime, t;
+ BOOL ok;
+
+ thread = GetCurrentThread();
+ ok = GetThreadTimes(thread, &creation_time, &exit_time,
+ &kernel_time, &user_time);
+ if (!ok) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+
+ if (info) {
+ info->implementation = "GetThreadTimes()";
+ info->resolution = 1e-7;
+ info->monotonic = 1;
+ info->adjustable = 0;
+ }
+
+ large.u.LowPart = kernel_time.dwLowDateTime;
+ large.u.HighPart = kernel_time.dwHighDateTime;
+ ktime = large.QuadPart;
+
+ large.u.LowPart = user_time.dwLowDateTime;
+ large.u.HighPart = user_time.dwHighDateTime;
+ utime = large.QuadPart;
+
+ /* ktime and utime have a resolution of 100 nanoseconds */
+ t = _PyTime_FromNanoseconds((ktime + utime) * 100);
+ *tp = t;
+ return 0;
+}
+
+#elif defined(_AIX)
+#define HAVE_THREAD_TIME
+static int
+_PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+{
+ /* bpo-40192: On AIX, thread_cputime() is preferred: it has nanosecond
+ resolution, whereas clock_gettime(CLOCK_THREAD_CPUTIME_ID)
+ has a resolution of 10 ms. */
+ thread_cputime_t tc;
+ if (thread_cputime(-1, &tc) != 0) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+
+ if (info) {
+ info->implementation = "thread_cputime()";
+ info->monotonic = 1;
+ info->adjustable = 0;
+ info->resolution = 1e-9;
+ }
+ *tp = _PyTime_FromNanoseconds(tc.stime + tc.utime);
+ return 0;
+}
+
+#elif defined(__sun) && defined(__SVR4)
+#define HAVE_THREAD_TIME
+static int
+_PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+{
+ /* bpo-35455: On Solaris, CLOCK_THREAD_CPUTIME_ID clock is not always
+ available; use gethrvtime() to substitute this functionality. */
+ if (info) {
+ info->implementation = "gethrvtime()";
+ info->resolution = 1e-9;
+ info->monotonic = 1;
+ info->adjustable = 0;
+ }
+ *tp = _PyTime_FromNanoseconds(gethrvtime());
+ return 0;
+}
+
+#elif defined(HAVE_CLOCK_GETTIME) && \
+ defined(CLOCK_PROCESS_CPUTIME_ID) && \
+ !defined(__EMSCRIPTEN__) && !defined(__wasi__)
+#define HAVE_THREAD_TIME
+
+#if defined(__APPLE__) && defined(__has_attribute) && __has_attribute(availability)
+static int
+_PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+ __attribute__((availability(macos, introduced=10.12)))
+ __attribute__((availability(ios, introduced=10.0)))
+ __attribute__((availability(tvos, introduced=10.0)))
+ __attribute__((availability(watchos, introduced=3.0)));
+#endif
+
+static int
+_PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
+{
+ struct timespec ts;
+ const clockid_t clk_id = CLOCK_THREAD_CPUTIME_ID;
+ const char *function = "clock_gettime(CLOCK_THREAD_CPUTIME_ID)";
+
+ if (clock_gettime(clk_id, &ts)) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+ if (info) {
+ struct timespec res;
+ info->implementation = function;
+ info->monotonic = 1;
+ info->adjustable = 0;
+ if (clock_getres(clk_id, &res)) {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+ info->resolution = res.tv_sec + res.tv_nsec * 1e-9;
+ }
+
+ if (_PyTime_FromTimespec(tp, &ts) < 0) {
+ return -1;
+ }
+ return 0;
+}
+#endif
+
+#ifdef HAVE_THREAD_TIME
+#ifdef __APPLE__
+/*
+ * The clock_* functions will be removed from the module
+ * dict entirely when the C API is not available.
+ */
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+#endif
+
+static PyObject *
+time_thread_time(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (_PyTime_GetThreadTimeWithInfo(&t, NULL) < 0) {
+ return NULL;
+ }
+ return _PyFloat_FromPyTime(t);
+}
+
+PyDoc_STRVAR(thread_time_doc,
+"thread_time() -> float\n\
+\n\
+Thread time for profiling: sum of the kernel and user-space CPU time.");
+
+static PyObject *
+time_thread_time_ns(PyObject *self, PyObject *unused)
+{
+ _PyTime_t t;
+ if (_PyTime_GetThreadTimeWithInfo(&t, NULL) < 0) {
+ return NULL;
+ }
+ return _PyTime_AsNanosecondsObject(t);
+}
+
+PyDoc_STRVAR(thread_time_ns_doc,
+"thread_time() -> int\n\
+\n\
+Thread time for profiling as nanoseconds:\n\
+sum of the kernel and user-space CPU time.");
+
+#ifdef __APPLE__
+#pragma clang diagnostic pop
+#endif
+
+#endif
+
+
+static PyObject *
+time_get_clock_info(PyObject *self, PyObject *args)
+{
+ char *name;
+ _Py_clock_info_t info;
+ PyObject *obj = NULL, *dict, *ns;
+ _PyTime_t t;
+
+ if (!PyArg_ParseTuple(args, "s:get_clock_info", &name)) {
+ return NULL;
+ }
+
+#ifdef Py_DEBUG
+ info.implementation = NULL;
+ info.monotonic = -1;
+ info.adjustable = -1;
+ info.resolution = -1.0;
+#else
+ info.implementation = "";
+ info.monotonic = 0;
+ info.adjustable = 0;
+ info.resolution = 1.0;
+#endif
+
+ if (strcmp(name, "time") == 0) {
+ if (_PyTime_GetSystemClockWithInfo(&t, &info) < 0) {
+ return NULL;
+ }
+ }
+ else if (strcmp(name, "monotonic") == 0) {
+ if (_PyTime_GetMonotonicClockWithInfo(&t, &info) < 0) {
+ return NULL;
+ }
+ }
+ else if (strcmp(name, "perf_counter") == 0) {
+ if (_PyTime_GetPerfCounterWithInfo(&t, &info) < 0) {
+ return NULL;
+ }
+ }
+ else if (strcmp(name, "process_time") == 0) {
+ if (_PyTime_GetProcessTimeWithInfo(&t, &info) < 0) {
+ return NULL;
+ }
+ }
+#ifdef HAVE_THREAD_TIME
+ else if (strcmp(name, "thread_time") == 0) {
+
+#ifdef __APPLE__
+ if (HAVE_CLOCK_GETTIME_RUNTIME) {
+#endif
+ if (_PyTime_GetThreadTimeWithInfo(&t, &info) < 0) {
+ return NULL;
+ }
+#ifdef __APPLE__
+ } else {
+ PyErr_SetString(PyExc_ValueError, "unknown clock");
+ return NULL;
+ }
+#endif
+ }
+#endif
+ else {
+ PyErr_SetString(PyExc_ValueError, "unknown clock");
+ return NULL;
+ }
+
+ dict = PyDict_New();
+ if (dict == NULL) {
+ return NULL;
+ }
+
+ assert(info.implementation != NULL);
+ obj = PyUnicode_FromString(info.implementation);
+ if (obj == NULL) {
+ goto error;
+ }
+ if (PyDict_SetItemString(dict, "implementation", obj) == -1) {
+ goto error;
+ }
+ Py_CLEAR(obj);
+
+ assert(info.monotonic != -1);
+ obj = PyBool_FromLong(info.monotonic);
+ if (obj == NULL) {
+ goto error;
+ }
+ if (PyDict_SetItemString(dict, "monotonic", obj) == -1) {
+ goto error;
+ }
+ Py_CLEAR(obj);
+
+ assert(info.adjustable != -1);
+ obj = PyBool_FromLong(info.adjustable);
+ if (obj == NULL) {
+ goto error;
+ }
+ if (PyDict_SetItemString(dict, "adjustable", obj) == -1) {
+ goto error;
+ }
+ Py_CLEAR(obj);
+
+ assert(info.resolution > 0.0);
+ assert(info.resolution <= 1.0);
+ obj = PyFloat_FromDouble(info.resolution);
+ if (obj == NULL) {
+ goto error;
+ }
+ if (PyDict_SetItemString(dict, "resolution", obj) == -1) {
+ goto error;
+ }
+ Py_CLEAR(obj);
+
+ ns = _PyNamespace_New(dict);
+ Py_DECREF(dict);
+ return ns;
+
+error:
+ Py_DECREF(dict);
+ Py_XDECREF(obj);
+ return NULL;
+}
+
+PyDoc_STRVAR(get_clock_info_doc,
+"get_clock_info(name: str) -> dict\n\
+\n\
+Get information of the specified clock.");
+
+#ifndef HAVE_DECL_TZNAME
+static void
+get_zone(char *zone, int n, struct tm *p)
+{
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ strncpy(zone, p->tm_zone ? p->tm_zone : " ", n);
+#else
+ tzset();
+ strftime(zone, n, "%Z", p);
+#endif
+}
+
+static time_t
+get_gmtoff(time_t t, struct tm *p)
+{
+#ifdef HAVE_STRUCT_TM_TM_ZONE
+ return p->tm_gmtoff;
+#else
+ return timegm(p) - t;
+#endif
+}
+#endif // !HAVE_DECL_TZNAME
+
+static int
+init_timezone(PyObject *m)
+{
+#define ADD_INT(NAME, VALUE) do { \
+ if (PyModule_AddIntConstant(m, NAME, VALUE) < 0) { \
+ return -1; \
+ } \
+} while (0)
+
+ assert(!PyErr_Occurred());
+
+ /* This code moved from PyInit_time wholesale to allow calling it from
+ time_tzset. In the future, some parts of it can be moved back
+ (for platforms that don't HAVE_WORKING_TZSET, when we know what they
+ are), and the extraneous calls to tzset(3) should be removed.
+ I haven't done this yet, as I don't want to change this code as
+ little as possible when introducing the time.tzset and time.tzsetwall
+ methods. This should simply be a method of doing the following once,
+ at the top of this function and removing the call to tzset() from
+ time_tzset():
+
+ #ifdef HAVE_TZSET
+ tzset()
+ #endif
+
+ And I'm lazy and hate C so nyer.
+ */
+#ifdef HAVE_DECL_TZNAME
+ PyObject *otz0, *otz1;
+#if !defined(MS_WINDOWS) || defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM)
+ tzset();
+#endif
+ ADD_INT("timezone", _Py_timezone);
+#ifdef HAVE_ALTZONE
+ ADD_INT("altzone", altzone);
+#else
+ ADD_INT("altzone", _Py_timezone-3600);
+#endif
+ ADD_INT("daylight", _Py_daylight);
+#ifdef MS_WINDOWS
+ TIME_ZONE_INFORMATION tzinfo = {0};
+ GetTimeZoneInformation(&tzinfo);
+ otz0 = PyUnicode_FromWideChar(tzinfo.StandardName, -1);
+ if (otz0 == NULL) {
+ return -1;
+ }
+ otz1 = PyUnicode_FromWideChar(tzinfo.DaylightName, -1);
+ if (otz1 == NULL) {
+ Py_DECREF(otz0);
+ return -1;
+ }
+#else
+ otz0 = PyUnicode_DecodeLocale(_Py_tzname[0], "surrogateescape");
+ if (otz0 == NULL) {
+ return -1;
+ }
+ otz1 = PyUnicode_DecodeLocale(_Py_tzname[1], "surrogateescape");
+ if (otz1 == NULL) {
+ Py_DECREF(otz0);
+ return -1;
+ }
+#endif // MS_WINDOWS
+ if (_PyModule_Add(m, "tzname", Py_BuildValue("(NN)", otz0, otz1)) < 0) {
+ return -1;
+ }
+#else // !HAVE_DECL_TZNAME
+ static const time_t YEAR = (365 * 24 + 6) * 3600;
+ time_t t;
+ struct tm p;
+ time_t janzone_t, julyzone_t;
+ char janname[10], julyname[10];
+ t = (time((time_t *)0) / YEAR) * YEAR;
+ _PyTime_localtime(t, &p);
+ get_zone(janname, 9, &p);
+ janzone_t = -get_gmtoff(t, &p);
+ janname[9] = '\0';
+ t += YEAR/2;
+ _PyTime_localtime(t, &p);
+ get_zone(julyname, 9, &p);
+ julyzone_t = -get_gmtoff(t, &p);
+ julyname[9] = '\0';
+
+ /* Sanity check, don't check for the validity of timezones.
+ In practice, it should be more in range -12 hours .. +14 hours. */
+#define MAX_TIMEZONE (48 * 3600)
+ if (janzone_t < -MAX_TIMEZONE || janzone_t > MAX_TIMEZONE
+ || julyzone_t < -MAX_TIMEZONE || julyzone_t > MAX_TIMEZONE)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "invalid GMT offset");
+ return -1;
+ }
+ int janzone = (int)janzone_t;
+ int julyzone = (int)julyzone_t;
+
+ PyObject *tzname_obj;
+ if (janzone < julyzone) {
+ /* DST is reversed in the southern hemisphere */
+ ADD_INT("timezone", julyzone);
+ ADD_INT("altzone", janzone);
+ ADD_INT("daylight", janzone != julyzone);
+ tzname_obj = Py_BuildValue("(zz)", julyname, janname);
+ } else {
+ ADD_INT("timezone", janzone);
+ ADD_INT("altzone", julyzone);
+ ADD_INT("daylight", janzone != julyzone);
+ tzname_obj = Py_BuildValue("(zz)", janname, julyname);
+ }
+ if (_PyModule_Add(m, "tzname", tzname_obj) < 0) {
+ return -1;
+ }
+#endif // !HAVE_DECL_TZNAME
+#undef ADD_INT
+
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ return 0;
+}
+
+
+static PyMethodDef time_methods[] = {
+ {"time", time_time, METH_NOARGS, time_doc},
+ {"time_ns", time_time_ns, METH_NOARGS, time_ns_doc},
+#ifdef HAVE_CLOCK_GETTIME
+ {"clock_gettime", time_clock_gettime, METH_VARARGS, clock_gettime_doc},
+ {"clock_gettime_ns",time_clock_gettime_ns, METH_VARARGS, clock_gettime_ns_doc},
+#endif
+#ifdef HAVE_CLOCK_SETTIME
+ {"clock_settime", time_clock_settime, METH_VARARGS, clock_settime_doc},
+ {"clock_settime_ns",time_clock_settime_ns, METH_VARARGS, clock_settime_ns_doc},
+#endif
+#ifdef HAVE_CLOCK_GETRES
+ {"clock_getres", time_clock_getres, METH_VARARGS, clock_getres_doc},
+#endif
+#ifdef HAVE_PTHREAD_GETCPUCLOCKID
+ {"pthread_getcpuclockid", time_pthread_getcpuclockid, METH_VARARGS, pthread_getcpuclockid_doc},
+#endif
+ {"sleep", time_sleep, METH_O, sleep_doc},
+ {"gmtime", time_gmtime, METH_VARARGS, gmtime_doc},
+ {"localtime", time_localtime, METH_VARARGS, localtime_doc},
+ {"asctime", time_asctime, METH_VARARGS, asctime_doc},
+ {"ctime", time_ctime, METH_VARARGS, ctime_doc},
+#ifdef HAVE_MKTIME
+ {"mktime", time_mktime, METH_O, mktime_doc},
+#endif
+#ifdef HAVE_STRFTIME
+ {"strftime", time_strftime, METH_VARARGS, strftime_doc},
+#endif
+ {"strptime", time_strptime, METH_VARARGS, strptime_doc},
+#ifdef HAVE_WORKING_TZSET
+ {"tzset", time_tzset, METH_NOARGS, tzset_doc},
+#endif
+ {"monotonic", time_monotonic, METH_NOARGS, monotonic_doc},
+ {"monotonic_ns", time_monotonic_ns, METH_NOARGS, monotonic_ns_doc},
+ {"process_time", time_process_time, METH_NOARGS, process_time_doc},
+ {"process_time_ns", time_process_time_ns, METH_NOARGS, process_time_ns_doc},
+#ifdef HAVE_THREAD_TIME
+ {"thread_time", time_thread_time, METH_NOARGS, thread_time_doc},
+ {"thread_time_ns", time_thread_time_ns, METH_NOARGS, thread_time_ns_doc},
+#endif
+ {"perf_counter", time_perf_counter, METH_NOARGS, perf_counter_doc},
+ {"perf_counter_ns", time_perf_counter_ns, METH_NOARGS, perf_counter_ns_doc},
+ {"get_clock_info", time_get_clock_info, METH_VARARGS, get_clock_info_doc},
+ {NULL, NULL} /* sentinel */
+};
+
+
+PyDoc_STRVAR(module_doc,
+"This module provides various functions to manipulate time values.\n\
+\n\
+There are two standard representations of time. One is the number\n\
+of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an integer\n\
+or a floating point number (to represent fractions of seconds).\n\
+The Epoch is system-defined; on Unix, it is generally January 1st, 1970.\n\
+The actual value can be retrieved by calling gmtime(0).\n\
+\n\
+The other representation is a tuple of 9 integers giving local time.\n\
+The tuple items are:\n\
+ year (including century, e.g. 1998)\n\
+ month (1-12)\n\
+ day (1-31)\n\
+ hours (0-23)\n\
+ minutes (0-59)\n\
+ seconds (0-59)\n\
+ weekday (0-6, Monday is 0)\n\
+ Julian day (day in the year, 1-366)\n\
+ DST (Daylight Savings Time) flag (-1, 0 or 1)\n\
+If the DST flag is 0, the time is given in the regular time zone;\n\
+if it is 1, the time is given in the DST time zone;\n\
+if it is -1, mktime() should guess based on the date and time.\n");
+
+
+static int
+time_exec(PyObject *module)
+{
+ time_module_state *state = get_time_state(module);
+#if defined(__APPLE__) && defined(HAVE_CLOCK_GETTIME)
+ if (HAVE_CLOCK_GETTIME_RUNTIME) {
+ /* pass: ^^^ cannot use '!' here */
+ } else {
+ PyObject* dct = PyModule_GetDict(module);
+ if (dct == NULL) {
+ return -1;
+ }
+
+ if (PyDict_DelItemString(dct, "clock_gettime") == -1) {
+ PyErr_Clear();
+ }
+ if (PyDict_DelItemString(dct, "clock_gettime_ns") == -1) {
+ PyErr_Clear();
+ }
+ if (PyDict_DelItemString(dct, "clock_settime") == -1) {
+ PyErr_Clear();
+ }
+ if (PyDict_DelItemString(dct, "clock_settime_ns") == -1) {
+ PyErr_Clear();
+ }
+ if (PyDict_DelItemString(dct, "clock_getres") == -1) {
+ PyErr_Clear();
+ }
+ }
+#endif
+#if defined(__APPLE__) && defined(HAVE_THREAD_TIME)
+ if (HAVE_CLOCK_GETTIME_RUNTIME) {
+ /* pass: ^^^ cannot use '!' here */
+ } else {
+ PyObject* dct = PyModule_GetDict(module);
+
+ if (PyDict_DelItemString(dct, "thread_time") == -1) {
+ PyErr_Clear();
+ }
+ if (PyDict_DelItemString(dct, "thread_time_ns") == -1) {
+ PyErr_Clear();
+ }
+ }
+#endif
+ /* Set, or reset, module variables like time.timezone */
+ if (init_timezone(module) < 0) {
+ return -1;
+ }
+
+#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES)
+ if (HAVE_CLOCK_GETTIME_RUNTIME) {
+
+#ifdef CLOCK_REALTIME
+ if (PyModule_AddIntMacro(module, CLOCK_REALTIME) < 0) {
+ return -1;
+ }
+#endif
+
+#ifdef CLOCK_MONOTONIC
+
+ if (PyModule_AddIntMacro(module, CLOCK_MONOTONIC) < 0) {
+ return -1;
+ }
+
+#endif
+#ifdef CLOCK_MONOTONIC_RAW
+ if (PyModule_AddIntMacro(module, CLOCK_MONOTONIC_RAW) < 0) {
+ return -1;
+ }
+#endif
+
+#ifdef CLOCK_HIGHRES
+ if (PyModule_AddIntMacro(module, CLOCK_HIGHRES) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_PROCESS_CPUTIME_ID
+ if (PyModule_AddIntMacro(module, CLOCK_PROCESS_CPUTIME_ID) < 0) {
+ return -1;
+ }
+#endif
+
+#ifdef CLOCK_THREAD_CPUTIME_ID
+ if (PyModule_AddIntMacro(module, CLOCK_THREAD_CPUTIME_ID) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_PROF
+ if (PyModule_AddIntMacro(module, CLOCK_PROF) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_BOOTTIME
+ if (PyModule_AddIntMacro(module, CLOCK_BOOTTIME) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_TAI
+ if (PyModule_AddIntMacro(module, CLOCK_TAI) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_UPTIME
+ if (PyModule_AddIntMacro(module, CLOCK_UPTIME) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_UPTIME_RAW
+
+ if (PyModule_AddIntMacro(module, CLOCK_UPTIME_RAW) < 0) {
+ return -1;
+ }
+#endif
+ }
+
+#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */
+
+ if (PyModule_AddIntConstant(module, "_STRUCT_TM_ITEMS", 11)) {
+ return -1;
+ }
+
+ // struct_time type
+ state->struct_time_type = PyStructSequence_NewType(&struct_time_type_desc);
+ if (state->struct_time_type == NULL) {
+ return -1;
+ }
+ if (PyModule_AddType(module, state->struct_time_type)) {
+ return -1;
+ }
+
+#if defined(__linux__) && !defined(__GLIBC__)
+ struct tm tm;
+ const time_t zero = 0;
+ if (gmtime_r(&zero, &tm) != NULL)
+ utc_string = tm.tm_zone;
+#endif
+
+#if defined(MS_WINDOWS)
+ if (timer_flags == (DWORD)-1) {
+ DWORD test_flags = CREATE_WAITABLE_TIMER_HIGH_RESOLUTION;
+ HANDLE timer = CreateWaitableTimerExW(NULL, NULL, test_flags,
+ TIMER_ALL_ACCESS);
+ if (timer == NULL) {
+ // CREATE_WAITABLE_TIMER_HIGH_RESOLUTION is not supported.
+ timer_flags = 0;
+ }
+ else {
+ // CREATE_WAITABLE_TIMER_HIGH_RESOLUTION is supported.
+ timer_flags = CREATE_WAITABLE_TIMER_HIGH_RESOLUTION;
+ CloseHandle(timer);
+ }
+ }
+#endif
+
+ return 0;
+}
+
+
+static int
+time_module_traverse(PyObject *module, visitproc visit, void *arg)
+{
+ time_module_state *state = get_time_state(module);
+ Py_VISIT(state->struct_time_type);
+ return 0;
+}
+
+
+static int
+time_module_clear(PyObject *module)
+{
+ time_module_state *state = get_time_state(module);
+ Py_CLEAR(state->struct_time_type);
+ return 0;
+}
+
+
+static void
+time_module_free(void *module)
+{
+ time_module_clear((PyObject *)module);
+}
+
+
+static struct PyModuleDef_Slot time_slots[] = {
+ {Py_mod_exec, time_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef timemodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "time",
+ .m_doc = module_doc,
+ .m_size = sizeof(time_module_state),
+ .m_methods = time_methods,
+ .m_slots = time_slots,
+ .m_traverse = time_module_traverse,
+ .m_clear = time_module_clear,
+ .m_free = time_module_free,
+};
+
+PyMODINIT_FUNC
+PyInit_time(void)
+{
+ return PyModuleDef_Init(&timemodule);
+}
+
+
+// time.sleep() implementation.
+// On error, raise an exception and return -1.
+// On success, return 0.
+static int
+pysleep(_PyTime_t timeout)
+{
+ assert(timeout >= 0);
+
+#ifndef MS_WINDOWS
+#ifdef HAVE_CLOCK_NANOSLEEP
+ struct timespec timeout_abs;
+#elif defined(HAVE_NANOSLEEP)
+ struct timespec timeout_ts;
+#else
+ struct timeval timeout_tv;
+#endif
+ _PyTime_t deadline, monotonic;
+ int err = 0;
+
+ if (get_monotonic(&monotonic) < 0) {
+ return -1;
+ }
+ deadline = monotonic + timeout;
+#ifdef HAVE_CLOCK_NANOSLEEP
+ if (_PyTime_AsTimespec(deadline, &timeout_abs) < 0) {
+ return -1;
+ }
+#endif
+
+ do {
+#ifdef HAVE_CLOCK_NANOSLEEP
+ // use timeout_abs
+#elif defined(HAVE_NANOSLEEP)
+ if (_PyTime_AsTimespec(timeout, &timeout_ts) < 0) {
+ return -1;
+ }
+#else
+ if (_PyTime_AsTimeval(timeout, &timeout_tv, _PyTime_ROUND_CEILING) < 0) {
+ return -1;
+ }
+#endif
+
+ int ret;
+ Py_BEGIN_ALLOW_THREADS
+#ifdef HAVE_CLOCK_NANOSLEEP
+ ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &timeout_abs, NULL);
+ err = ret;
+#elif defined(HAVE_NANOSLEEP)
+ ret = nanosleep(&timeout_ts, NULL);
+ err = errno;
+#else
+ ret = select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout_tv);
+ err = errno;
+#endif
+ Py_END_ALLOW_THREADS
+
+ if (ret == 0) {
+ break;
+ }
+
+ if (err != EINTR) {
+ errno = err;
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+
+ /* sleep was interrupted by SIGINT */
+ if (PyErr_CheckSignals()) {
+ return -1;
+ }
+
+#ifndef HAVE_CLOCK_NANOSLEEP
+ if (get_monotonic(&monotonic) < 0) {
+ return -1;
+ }
+ timeout = deadline - monotonic;
+ if (timeout < 0) {
+ break;
+ }
+ /* retry with the recomputed delay */
+#endif
+ } while (1);
+
+ return 0;
+#else // MS_WINDOWS
+ _PyTime_t timeout_100ns = _PyTime_As100Nanoseconds(timeout,
+ _PyTime_ROUND_CEILING);
+
+ // Maintain Windows Sleep() semantics for time.sleep(0)
+ if (timeout_100ns == 0) {
+ Py_BEGIN_ALLOW_THREADS
+ // A value of zero causes the thread to relinquish the remainder of its
+ // time slice to any other thread that is ready to run. If there are no
+ // other threads ready to run, the function returns immediately, and
+ // the thread continues execution.
+ Sleep(0);
+ Py_END_ALLOW_THREADS
+ return 0;
+ }
+
+ LARGE_INTEGER relative_timeout;
+ // No need to check for integer overflow, both types are signed
+ assert(sizeof(relative_timeout) == sizeof(timeout_100ns));
+ // SetWaitableTimer(): a negative due time indicates relative time
+ relative_timeout.QuadPart = -timeout_100ns;
+
+ HANDLE timer = CreateWaitableTimerExW(NULL, NULL, timer_flags,
+ TIMER_ALL_ACCESS);
+ if (timer == NULL) {
+ PyErr_SetFromWindowsErr(0);
+ return -1;
+ }
+
+ if (!SetWaitableTimerEx(timer, &relative_timeout,
+ 0, // no period; the timer is signaled once
+ NULL, NULL, // no completion routine
+ NULL, // no wake context; do not resume from suspend
+ 0)) // no tolerable delay for timer coalescing
+ {
+ PyErr_SetFromWindowsErr(0);
+ goto error;
+ }
+
+ // Only the main thread can be interrupted by SIGINT.
+ // Signal handlers are only executed in the main thread.
+ if (_PyOS_IsMainThread()) {
+ HANDLE sigint_event = _PyOS_SigintEvent();
+
+ while (1) {
+ // Check for pending SIGINT signal before resetting the event
+ if (PyErr_CheckSignals()) {
+ goto error;
+ }
+ ResetEvent(sigint_event);
+
+ HANDLE events[] = {timer, sigint_event};
+ DWORD rc;
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = WaitForMultipleObjects(Py_ARRAY_LENGTH(events), events,
+ // bWaitAll
+ FALSE,
+ // No wait timeout
+ INFINITE);
+ Py_END_ALLOW_THREADS
+
+ if (rc == WAIT_FAILED) {
+ PyErr_SetFromWindowsErr(0);
+ goto error;
+ }
+
+ if (rc == WAIT_OBJECT_0) {
+ // Timer signaled: we are done
+ break;
+ }
+
+ assert(rc == (WAIT_OBJECT_0 + 1));
+ // The sleep was interrupted by SIGINT: restart sleeping
+ }
+ }
+ else {
+ DWORD rc;
+
+ Py_BEGIN_ALLOW_THREADS
+ rc = WaitForSingleObject(timer, INFINITE);
+ Py_END_ALLOW_THREADS
+
+ if (rc == WAIT_FAILED) {
+ PyErr_SetFromWindowsErr(0);
+ goto error;
+ }
+
+ assert(rc == WAIT_OBJECT_0);
+ // Timer signaled: we are done
+ }
+
+ CloseHandle(timer);
+ return 0;
+
+error:
+ CloseHandle(timer);
+ return -1;
+#endif
+}
diff --git a/contrib/tools/python3/Modules/unicodedata.c b/contrib/tools/python3/Modules/unicodedata.c
new file mode 100644
index 00000000000..41dcd5f8f88
--- /dev/null
+++ b/contrib/tools/python3/Modules/unicodedata.c
@@ -0,0 +1,1544 @@
+/* ------------------------------------------------------------------------
+
+ unicodedata -- Provides access to the Unicode database.
+
+ The current version number is reported in the unidata_version constant.
+
+ Written by Marc-Andre Lemburg ([email protected]).
+ Modified for Python 2.0 by Fredrik Lundh ([email protected])
+ Modified by Martin v. Löwis ([email protected])
+
+ Copyright (c) Corporation for National Research Initiatives.
+
+ ------------------------------------------------------------------------ */
+
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
+#include "structmember.h" // PyMemberDef
+
+#include <stdbool.h>
+
+/*[clinic input]
+module unicodedata
+class unicodedata.UCD 'PreviousDBVersion *' '<not used>'
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=e47113e05924be43]*/
+
+/* character properties */
+
+typedef struct {
+ const unsigned char category; /* index into
+ _PyUnicode_CategoryNames */
+ const unsigned char combining; /* combining class value 0 - 255 */
+ const unsigned char bidirectional; /* index into
+ _PyUnicode_BidirectionalNames */
+ const unsigned char mirrored; /* true if mirrored in bidir mode */
+ const unsigned char east_asian_width; /* index into
+ _PyUnicode_EastAsianWidth */
+ const unsigned char normalization_quick_check; /* see is_normalized() */
+} _PyUnicode_DatabaseRecord;
+
+typedef struct change_record {
+ /* sequence of fields should be the same as in merge_old_version */
+ const unsigned char bidir_changed;
+ const unsigned char category_changed;
+ const unsigned char decimal_changed;
+ const unsigned char mirrored_changed;
+ const unsigned char east_asian_width_changed;
+ const double numeric_changed;
+} change_record;
+
+/* data file generated by Tools/unicode/makeunicodedata.py */
+#include "unicodedata_db.h"
+
+static const _PyUnicode_DatabaseRecord*
+_getrecord_ex(Py_UCS4 code)
+{
+ int index;
+ if (code >= 0x110000)
+ index = 0;
+ else {
+ index = index1[(code>>SHIFT)];
+ index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
+ }
+
+ return &_PyUnicode_Database_Records[index];
+}
+
+/* ------------- Previous-version API ------------------------------------- */
+typedef struct previous_version {
+ PyObject_HEAD
+ const char *name;
+ const change_record* (*getrecord)(Py_UCS4);
+ Py_UCS4 (*normalization)(Py_UCS4);
+} PreviousDBVersion;
+
+#include "clinic/unicodedata.c.h"
+
+#define get_old_record(self, v) ((((PreviousDBVersion*)self)->getrecord)(v))
+
+static PyMemberDef DB_members[] = {
+ {"unidata_version", T_STRING, offsetof(PreviousDBVersion, name), READONLY},
+ {NULL}
+};
+
+// Check if self is an unicodedata.UCD instance.
+// If self is NULL (when the PyCapsule C API is used), return 0.
+// PyModule_Check() is used to avoid having to retrieve the ucd_type.
+// See unicodedata_functions comment to the rationale of this macro.
+#define UCD_Check(self) (self != NULL && !PyModule_Check(self))
+
+static PyObject*
+new_previous_version(PyTypeObject *ucd_type,
+ const char*name, const change_record* (*getrecord)(Py_UCS4),
+ Py_UCS4 (*normalization)(Py_UCS4))
+{
+ PreviousDBVersion *self;
+ self = PyObject_GC_New(PreviousDBVersion, ucd_type);
+ if (self == NULL)
+ return NULL;
+ self->name = name;
+ self->getrecord = getrecord;
+ self->normalization = normalization;
+ PyObject_GC_Track(self);
+ return (PyObject*)self;
+}
+
+
+/* --- Module API --------------------------------------------------------- */
+
+/*[clinic input]
+unicodedata.UCD.decimal
+
+ self: self
+ chr: int(accept={str})
+ default: object=NULL
+ /
+
+Converts a Unicode character into its equivalent decimal value.
+
+Returns the decimal value assigned to the character chr as integer.
+If no such value is defined, default is returned, or, if not given,
+ValueError is raised.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_decimal_impl(PyObject *self, int chr,
+ PyObject *default_value)
+/*[clinic end generated code: output=be23376e1a185231 input=933f8107993f23d0]*/
+{
+ int have_old = 0;
+ long rc;
+ Py_UCS4 c = (Py_UCS4)chr;
+
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0) {
+ /* unassigned */
+ have_old = 1;
+ rc = -1;
+ }
+ else if (old->decimal_changed != 0xFF) {
+ have_old = 1;
+ rc = old->decimal_changed;
+ }
+ }
+
+ if (!have_old)
+ rc = Py_UNICODE_TODECIMAL(c);
+ if (rc < 0) {
+ if (default_value == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "not a decimal");
+ return NULL;
+ }
+ else {
+ return Py_NewRef(default_value);
+ }
+ }
+ return PyLong_FromLong(rc);
+}
+
+/*[clinic input]
+unicodedata.UCD.digit
+
+ self: self
+ chr: int(accept={str})
+ default: object=NULL
+ /
+
+Converts a Unicode character into its equivalent digit value.
+
+Returns the digit value assigned to the character chr as integer.
+If no such value is defined, default is returned, or, if not given,
+ValueError is raised.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value)
+/*[clinic end generated code: output=96e18c950171fd2f input=e27d6e4565cd29f2]*/
+{
+ long rc;
+ Py_UCS4 c = (Py_UCS4)chr;
+ rc = Py_UNICODE_TODIGIT(c);
+ if (rc < 0) {
+ if (default_value == NULL) {
+ PyErr_SetString(PyExc_ValueError, "not a digit");
+ return NULL;
+ }
+ else {
+ return Py_NewRef(default_value);
+ }
+ }
+ return PyLong_FromLong(rc);
+}
+
+/*[clinic input]
+unicodedata.UCD.numeric
+
+ self: self
+ chr: int(accept={str})
+ default: object=NULL
+ /
+
+Converts a Unicode character into its equivalent numeric value.
+
+Returns the numeric value assigned to the character chr as float.
+If no such value is defined, default is returned, or, if not given,
+ValueError is raised.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_numeric_impl(PyObject *self, int chr,
+ PyObject *default_value)
+/*[clinic end generated code: output=53ce281fe85b10c4 input=fdf5871a5542893c]*/
+{
+ int have_old = 0;
+ double rc;
+ Py_UCS4 c = (Py_UCS4)chr;
+
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0) {
+ /* unassigned */
+ have_old = 1;
+ rc = -1.0;
+ }
+ else if (old->decimal_changed != 0xFF) {
+ have_old = 1;
+ rc = old->decimal_changed;
+ }
+ }
+
+ if (!have_old)
+ rc = Py_UNICODE_TONUMERIC(c);
+ if (rc == -1.0) {
+ if (default_value == NULL) {
+ PyErr_SetString(PyExc_ValueError, "not a numeric character");
+ return NULL;
+ }
+ else {
+ return Py_NewRef(default_value);
+ }
+ }
+ return PyFloat_FromDouble(rc);
+}
+
+/*[clinic input]
+unicodedata.UCD.category
+
+ self: self
+ chr: int(accept={str})
+ /
+
+Returns the general category assigned to the character chr as string.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_category_impl(PyObject *self, int chr)
+/*[clinic end generated code: output=8571539ee2e6783a input=27d6f3d85050bc06]*/
+{
+ int index;
+ Py_UCS4 c = (Py_UCS4)chr;
+ index = (int) _getrecord_ex(c)->category;
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed != 0xFF)
+ index = old->category_changed;
+ }
+ return PyUnicode_FromString(_PyUnicode_CategoryNames[index]);
+}
+
+/*[clinic input]
+unicodedata.UCD.bidirectional
+
+ self: self
+ chr: int(accept={str})
+ /
+
+Returns the bidirectional class assigned to the character chr as string.
+
+If no such value is defined, an empty string is returned.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_bidirectional_impl(PyObject *self, int chr)
+/*[clinic end generated code: output=d36310ce2039bb92 input=b3d8f42cebfcf475]*/
+{
+ int index;
+ Py_UCS4 c = (Py_UCS4)chr;
+ index = (int) _getrecord_ex(c)->bidirectional;
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0)
+ index = 0; /* unassigned */
+ else if (old->bidir_changed != 0xFF)
+ index = old->bidir_changed;
+ }
+ return PyUnicode_FromString(_PyUnicode_BidirectionalNames[index]);
+}
+
+/*[clinic input]
+unicodedata.UCD.combining -> int
+
+ self: self
+ chr: int(accept={str})
+ /
+
+Returns the canonical combining class assigned to the character chr as integer.
+
+Returns 0 if no combining class is defined.
+[clinic start generated code]*/
+
+static int
+unicodedata_UCD_combining_impl(PyObject *self, int chr)
+/*[clinic end generated code: output=cad056d0cb6a5920 input=9f2d6b2a95d0a22a]*/
+{
+ int index;
+ Py_UCS4 c = (Py_UCS4)chr;
+ index = (int) _getrecord_ex(c)->combining;
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0)
+ index = 0; /* unassigned */
+ }
+ return index;
+}
+
+/*[clinic input]
+unicodedata.UCD.mirrored -> int
+
+ self: self
+ chr: int(accept={str})
+ /
+
+Returns the mirrored property assigned to the character chr as integer.
+
+Returns 1 if the character has been identified as a "mirrored"
+character in bidirectional text, 0 otherwise.
+[clinic start generated code]*/
+
+static int
+unicodedata_UCD_mirrored_impl(PyObject *self, int chr)
+/*[clinic end generated code: output=2532dbf8121b50e6 input=5dd400d351ae6f3b]*/
+{
+ int index;
+ Py_UCS4 c = (Py_UCS4)chr;
+ index = (int) _getrecord_ex(c)->mirrored;
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0)
+ index = 0; /* unassigned */
+ else if (old->mirrored_changed != 0xFF)
+ index = old->mirrored_changed;
+ }
+ return index;
+}
+
+/*[clinic input]
+unicodedata.UCD.east_asian_width
+
+ self: self
+ chr: int(accept={str})
+ /
+
+Returns the east asian width assigned to the character chr as string.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_east_asian_width_impl(PyObject *self, int chr)
+/*[clinic end generated code: output=484e8537d9ee8197 input=c4854798aab026e0]*/
+{
+ int index;
+ Py_UCS4 c = (Py_UCS4)chr;
+ index = (int) _getrecord_ex(c)->east_asian_width;
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0)
+ index = 0; /* unassigned */
+ else if (old->east_asian_width_changed != 0xFF)
+ index = old->east_asian_width_changed;
+ }
+ return PyUnicode_FromString(_PyUnicode_EastAsianWidthNames[index]);
+}
+
+/*[clinic input]
+unicodedata.UCD.decomposition
+
+ self: self
+ chr: int(accept={str})
+ /
+
+Returns the character decomposition mapping assigned to the character chr as string.
+
+An empty string is returned in case no such mapping is defined.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
+/*[clinic end generated code: output=7d699f3ec7565d27 input=e4c12459ad68507b]*/
+{
+ char decomp[256];
+ int code, index, count;
+ size_t i;
+ unsigned int prefix_index;
+ Py_UCS4 c = (Py_UCS4)chr;
+
+ code = (int)c;
+
+ if (UCD_Check(self)) {
+ const change_record *old = get_old_record(self, c);
+ if (old->category_changed == 0)
+ return PyUnicode_FromString(""); /* unassigned */
+ }
+
+ if (code < 0 || code >= 0x110000)
+ index = 0;
+ else {
+ index = decomp_index1[(code>>DECOMP_SHIFT)];
+ index = decomp_index2[(index<<DECOMP_SHIFT)+
+ (code&((1<<DECOMP_SHIFT)-1))];
+ }
+
+ /* high byte is number of hex bytes (usually one or two), low byte
+ is prefix code (from*/
+ count = decomp_data[index] >> 8;
+
+ /* XXX: could allocate the PyString up front instead
+ (strlen(prefix) + 5 * count + 1 bytes) */
+
+ /* Based on how index is calculated above and decomp_data is generated
+ from Tools/unicode/makeunicodedata.py, it should not be possible
+ to overflow decomp_prefix. */
+ prefix_index = decomp_data[index] & 255;
+ assert(prefix_index < Py_ARRAY_LENGTH(decomp_prefix));
+
+ /* copy prefix */
+ i = strlen(decomp_prefix[prefix_index]);
+ memcpy(decomp, decomp_prefix[prefix_index], i);
+
+ while (count-- > 0) {
+ if (i)
+ decomp[i++] = ' ';
+ assert(i < sizeof(decomp));
+ PyOS_snprintf(decomp + i, sizeof(decomp) - i, "%04X",
+ decomp_data[++index]);
+ i += strlen(decomp + i);
+ }
+ return PyUnicode_FromStringAndSize(decomp, i);
+}
+
+static void
+get_decomp_record(PyObject *self, Py_UCS4 code,
+ int *index, int *prefix, int *count)
+{
+ if (code >= 0x110000) {
+ *index = 0;
+ }
+ else if (UCD_Check(self)
+ && get_old_record(self, code)->category_changed==0) {
+ /* unassigned in old version */
+ *index = 0;
+ }
+ else {
+ *index = decomp_index1[(code>>DECOMP_SHIFT)];
+ *index = decomp_index2[(*index<<DECOMP_SHIFT)+
+ (code&((1<<DECOMP_SHIFT)-1))];
+ }
+
+ /* high byte is number of hex bytes (usually one or two), low byte
+ is prefix code (from*/
+ *count = decomp_data[*index] >> 8;
+ *prefix = decomp_data[*index] & 255;
+
+ (*index)++;
+}
+
+#define SBase 0xAC00
+#define LBase 0x1100
+#define VBase 0x1161
+#define TBase 0x11A7
+#define LCount 19
+#define VCount 21
+#define TCount 28
+#define NCount (VCount*TCount)
+#define SCount (LCount*NCount)
+
+static PyObject*
+nfd_nfkd(PyObject *self, PyObject *input, int k)
+{
+ PyObject *result;
+ Py_UCS4 *output;
+ Py_ssize_t i, o, osize;
+ int kind;
+ const void *data;
+ /* Longest decomposition in Unicode 3.2: U+FDFA */
+ Py_UCS4 stack[20];
+ Py_ssize_t space, isize;
+ int index, prefix, count, stackptr;
+ unsigned char prev, cur;
+
+ stackptr = 0;
+ isize = PyUnicode_GET_LENGTH(input);
+ space = isize;
+ /* Overallocate at most 10 characters. */
+ if (space > 10) {
+ if (space <= PY_SSIZE_T_MAX - 10)
+ space += 10;
+ }
+ else {
+ space *= 2;
+ }
+ osize = space;
+ output = PyMem_NEW(Py_UCS4, space);
+ if (!output) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ i = o = 0;
+ kind = PyUnicode_KIND(input);
+ data = PyUnicode_DATA(input);
+
+ while (i < isize) {
+ stack[stackptr++] = PyUnicode_READ(kind, data, i++);
+ while(stackptr) {
+ Py_UCS4 code = stack[--stackptr];
+ /* Hangul Decomposition adds three characters in
+ a single step, so we need at least that much room. */
+ if (space < 3) {
+ Py_UCS4 *new_output;
+ osize += 10;
+ space += 10;
+ new_output = PyMem_Realloc(output, osize*sizeof(Py_UCS4));
+ if (new_output == NULL) {
+ PyMem_Free(output);
+ PyErr_NoMemory();
+ return NULL;
+ }
+ output = new_output;
+ }
+ /* Hangul Decomposition. */
+ if (SBase <= code && code < (SBase+SCount)) {
+ int SIndex = code - SBase;
+ int L = LBase + SIndex / NCount;
+ int V = VBase + (SIndex % NCount) / TCount;
+ int T = TBase + SIndex % TCount;
+ output[o++] = L;
+ output[o++] = V;
+ space -= 2;
+ if (T != TBase) {
+ output[o++] = T;
+ space --;
+ }
+ continue;
+ }
+ /* normalization changes */
+ if (UCD_Check(self)) {
+ Py_UCS4 value = ((PreviousDBVersion*)self)->normalization(code);
+ if (value != 0) {
+ stack[stackptr++] = value;
+ continue;
+ }
+ }
+
+ /* Other decompositions. */
+ get_decomp_record(self, code, &index, &prefix, &count);
+
+ /* Copy character if it is not decomposable, or has a
+ compatibility decomposition, but we do NFD. */
+ if (!count || (prefix && !k)) {
+ output[o++] = code;
+ space--;
+ continue;
+ }
+ /* Copy decomposition onto the stack, in reverse
+ order. */
+ while(count) {
+ code = decomp_data[index + (--count)];
+ stack[stackptr++] = code;
+ }
+ }
+ }
+
+ result = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND,
+ output, o);
+ PyMem_Free(output);
+ if (!result)
+ return NULL;
+ /* result is guaranteed to be ready, as it is compact. */
+ kind = PyUnicode_KIND(result);
+ data = PyUnicode_DATA(result);
+
+ /* Sort canonically. */
+ i = 0;
+ prev = _getrecord_ex(PyUnicode_READ(kind, data, i))->combining;
+ for (i++; i < PyUnicode_GET_LENGTH(result); i++) {
+ cur = _getrecord_ex(PyUnicode_READ(kind, data, i))->combining;
+ if (prev == 0 || cur == 0 || prev <= cur) {
+ prev = cur;
+ continue;
+ }
+ /* Non-canonical order. Need to switch *i with previous. */
+ o = i - 1;
+ while (1) {
+ Py_UCS4 tmp = PyUnicode_READ(kind, data, o+1);
+ PyUnicode_WRITE(kind, data, o+1,
+ PyUnicode_READ(kind, data, o));
+ PyUnicode_WRITE(kind, data, o, tmp);
+ o--;
+ if (o < 0)
+ break;
+ prev = _getrecord_ex(PyUnicode_READ(kind, data, o))->combining;
+ if (prev == 0 || prev <= cur)
+ break;
+ }
+ prev = _getrecord_ex(PyUnicode_READ(kind, data, i))->combining;
+ }
+ return result;
+}
+
+static int
+find_nfc_index(const struct reindex* nfc, Py_UCS4 code)
+{
+ unsigned int index;
+ for (index = 0; nfc[index].start; index++) {
+ unsigned int start = nfc[index].start;
+ if (code < start)
+ return -1;
+ if (code <= start + nfc[index].count) {
+ unsigned int delta = code - start;
+ return nfc[index].index + delta;
+ }
+ }
+ return -1;
+}
+
+static PyObject*
+nfc_nfkc(PyObject *self, PyObject *input, int k)
+{
+ PyObject *result;
+ int kind;
+ const void *data;
+ Py_UCS4 *output;
+ Py_ssize_t i, i1, o, len;
+ int f,l,index,index1,comb;
+ Py_UCS4 code;
+ Py_ssize_t skipped[20];
+ int cskipped = 0;
+
+ result = nfd_nfkd(self, input, k);
+ if (!result)
+ return NULL;
+ /* result will be "ready". */
+ kind = PyUnicode_KIND(result);
+ data = PyUnicode_DATA(result);
+ len = PyUnicode_GET_LENGTH(result);
+
+ /* We allocate a buffer for the output.
+ If we find that we made no changes, we still return
+ the NFD result. */
+ output = PyMem_NEW(Py_UCS4, len);
+ if (!output) {
+ PyErr_NoMemory();
+ Py_DECREF(result);
+ return 0;
+ }
+ i = o = 0;
+
+ again:
+ while (i < len) {
+ for (index = 0; index < cskipped; index++) {
+ if (skipped[index] == i) {
+ /* *i character is skipped.
+ Remove from list. */
+ skipped[index] = skipped[cskipped-1];
+ cskipped--;
+ i++;
+ goto again; /* continue while */
+ }
+ }
+ /* Hangul Composition. We don't need to check for <LV,T>
+ pairs, since we always have decomposed data. */
+ code = PyUnicode_READ(kind, data, i);
+ if (LBase <= code && code < (LBase+LCount) &&
+ i + 1 < len &&
+ VBase <= PyUnicode_READ(kind, data, i+1) &&
+ PyUnicode_READ(kind, data, i+1) < (VBase+VCount)) {
+ /* check L character is a modern leading consonant (0x1100 ~ 0x1112)
+ and V character is a modern vowel (0x1161 ~ 0x1175). */
+ int LIndex, VIndex;
+ LIndex = code - LBase;
+ VIndex = PyUnicode_READ(kind, data, i+1) - VBase;
+ code = SBase + (LIndex*VCount+VIndex)*TCount;
+ i+=2;
+ if (i < len &&
+ TBase < PyUnicode_READ(kind, data, i) &&
+ PyUnicode_READ(kind, data, i) < (TBase+TCount)) {
+ /* check T character is a modern trailing consonant
+ (0x11A8 ~ 0x11C2). */
+ code += PyUnicode_READ(kind, data, i)-TBase;
+ i++;
+ }
+ output[o++] = code;
+ continue;
+ }
+
+ /* code is still input[i] here */
+ f = find_nfc_index(nfc_first, code);
+ if (f == -1) {
+ output[o++] = code;
+ i++;
+ continue;
+ }
+ /* Find next unblocked character. */
+ i1 = i+1;
+ comb = 0;
+ /* output base character for now; might be updated later. */
+ output[o] = PyUnicode_READ(kind, data, i);
+ while (i1 < len) {
+ Py_UCS4 code1 = PyUnicode_READ(kind, data, i1);
+ int comb1 = _getrecord_ex(code1)->combining;
+ if (comb) {
+ if (comb1 == 0)
+ break;
+ if (comb >= comb1) {
+ /* Character is blocked. */
+ i1++;
+ continue;
+ }
+ }
+ l = find_nfc_index(nfc_last, code1);
+ /* i1 cannot be combined with i. If i1
+ is a starter, we don't need to look further.
+ Otherwise, record the combining class. */
+ if (l == -1) {
+ not_combinable:
+ if (comb1 == 0)
+ break;
+ comb = comb1;
+ i1++;
+ continue;
+ }
+ index = f*TOTAL_LAST + l;
+ index1 = comp_index[index >> COMP_SHIFT];
+ code = comp_data[(index1<<COMP_SHIFT)+
+ (index&((1<<COMP_SHIFT)-1))];
+ if (code == 0)
+ goto not_combinable;
+
+ /* Replace the original character. */
+ output[o] = code;
+ /* Mark the second character unused. */
+ assert(cskipped < 20);
+ skipped[cskipped++] = i1;
+ i1++;
+ f = find_nfc_index(nfc_first, output[o]);
+ if (f == -1)
+ break;
+ }
+ /* Output character was already written.
+ Just advance the indices. */
+ o++; i++;
+ }
+ if (o == len) {
+ /* No changes. Return original string. */
+ PyMem_Free(output);
+ return result;
+ }
+ Py_DECREF(result);
+ result = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND,
+ output, o);
+ PyMem_Free(output);
+ return result;
+}
+
+// This needs to match the logic in makeunicodedata.py
+// which constructs the quickcheck data.
+typedef enum {YES = 0, MAYBE = 1, NO = 2} QuickcheckResult;
+
+/* Run the Unicode normalization "quickcheck" algorithm.
+ *
+ * Return YES or NO if quickcheck determines the input is certainly
+ * normalized or certainly not, and MAYBE if quickcheck is unable to
+ * tell.
+ *
+ * If `yes_only` is true, then return MAYBE as soon as we determine
+ * the answer is not YES.
+ *
+ * For background and details on the algorithm, see UAX #15:
+ * https://www.unicode.org/reports/tr15/#Detecting_Normalization_Forms
+ */
+static QuickcheckResult
+is_normalized_quickcheck(PyObject *self, PyObject *input, bool nfc, bool k,
+ bool yes_only)
+{
+ /* UCD 3.2.0 is requested, quickchecks must be disabled. */
+ if (UCD_Check(self)) {
+ return MAYBE;
+ }
+
+ if (PyUnicode_IS_ASCII(input)) {
+ return YES;
+ }
+
+ Py_ssize_t i, len;
+ int kind;
+ const void *data;
+ unsigned char prev_combining = 0;
+
+ /* The two quickcheck bits at this shift have type QuickcheckResult. */
+ int quickcheck_shift = (nfc ? 4 : 0) + (k ? 2 : 0);
+
+ QuickcheckResult result = YES; /* certainly normalized, unless we find something */
+
+ i = 0;
+ kind = PyUnicode_KIND(input);
+ data = PyUnicode_DATA(input);
+ len = PyUnicode_GET_LENGTH(input);
+ while (i < len) {
+ Py_UCS4 ch = PyUnicode_READ(kind, data, i++);
+ const _PyUnicode_DatabaseRecord *record = _getrecord_ex(ch);
+
+ unsigned char combining = record->combining;
+ if (combining && prev_combining > combining)
+ return NO; /* non-canonical sort order, not normalized */
+ prev_combining = combining;
+
+ unsigned char quickcheck_whole = record->normalization_quick_check;
+ if (yes_only) {
+ if (quickcheck_whole & (3 << quickcheck_shift))
+ return MAYBE;
+ } else {
+ switch ((quickcheck_whole >> quickcheck_shift) & 3) {
+ case NO:
+ return NO;
+ case MAYBE:
+ result = MAYBE; /* this string might need normalization */
+ }
+ }
+ }
+ return result;
+}
+
+/*[clinic input]
+unicodedata.UCD.is_normalized
+
+ self: self
+ form: unicode
+ unistr as input: unicode
+ /
+
+Return whether the Unicode string unistr is in the normal form 'form'.
+
+Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_is_normalized_impl(PyObject *self, PyObject *form,
+ PyObject *input)
+/*[clinic end generated code: output=11e5a3694e723ca5 input=a544f14cea79e508]*/
+{
+ if (PyUnicode_READY(input) == -1) {
+ return NULL;
+ }
+
+ if (PyUnicode_GET_LENGTH(input) == 0) {
+ /* special case empty input strings. */
+ Py_RETURN_TRUE;
+ }
+
+ PyObject *result;
+ bool nfc = false;
+ bool k = false;
+ QuickcheckResult m;
+
+ PyObject *cmp;
+ int match = 0;
+
+ if (PyUnicode_CompareWithASCIIString(form, "NFC") == 0) {
+ nfc = true;
+ }
+ else if (PyUnicode_CompareWithASCIIString(form, "NFKC") == 0) {
+ nfc = true;
+ k = true;
+ }
+ else if (PyUnicode_CompareWithASCIIString(form, "NFD") == 0) {
+ /* matches default values for `nfc` and `k` */
+ }
+ else if (PyUnicode_CompareWithASCIIString(form, "NFKD") == 0) {
+ k = true;
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError, "invalid normalization form");
+ return NULL;
+ }
+
+ m = is_normalized_quickcheck(self, input, nfc, k, false);
+
+ if (m == MAYBE) {
+ cmp = (nfc ? nfc_nfkc : nfd_nfkd)(self, input, k);
+ if (cmp == NULL) {
+ return NULL;
+ }
+ match = PyUnicode_Compare(input, cmp);
+ Py_DECREF(cmp);
+ result = (match == 0) ? Py_True : Py_False;
+ }
+ else {
+ result = (m == YES) ? Py_True : Py_False;
+ }
+
+ return Py_NewRef(result);
+}
+
+
+/*[clinic input]
+unicodedata.UCD.normalize
+
+ self: self
+ form: unicode
+ unistr as input: unicode
+ /
+
+Return the normal form 'form' for the Unicode string unistr.
+
+Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_normalize_impl(PyObject *self, PyObject *form,
+ PyObject *input)
+/*[clinic end generated code: output=05ca4385a2ad6983 input=3a5206c0ad2833fb]*/
+{
+ if (PyUnicode_GET_LENGTH(input) == 0) {
+ /* Special case empty input strings, since resizing
+ them later would cause internal errors. */
+ return Py_NewRef(input);
+ }
+
+ if (PyUnicode_CompareWithASCIIString(form, "NFC") == 0) {
+ if (is_normalized_quickcheck(self, input,
+ true, false, true) == YES) {
+ return Py_NewRef(input);
+ }
+ return nfc_nfkc(self, input, 0);
+ }
+ if (PyUnicode_CompareWithASCIIString(form, "NFKC") == 0) {
+ if (is_normalized_quickcheck(self, input,
+ true, true, true) == YES) {
+ return Py_NewRef(input);
+ }
+ return nfc_nfkc(self, input, 1);
+ }
+ if (PyUnicode_CompareWithASCIIString(form, "NFD") == 0) {
+ if (is_normalized_quickcheck(self, input,
+ false, false, true) == YES) {
+ return Py_NewRef(input);
+ }
+ return nfd_nfkd(self, input, 0);
+ }
+ if (PyUnicode_CompareWithASCIIString(form, "NFKD") == 0) {
+ if (is_normalized_quickcheck(self, input,
+ false, true, true) == YES) {
+ return Py_NewRef(input);
+ }
+ return nfd_nfkd(self, input, 1);
+ }
+ PyErr_SetString(PyExc_ValueError, "invalid normalization form");
+ return NULL;
+}
+
+/* -------------------------------------------------------------------- */
+/* unicode character name tables */
+
+/* data file generated by Tools/unicode/makeunicodedata.py */
+#include "unicodename_db.h"
+
+/* -------------------------------------------------------------------- */
+/* database code (cut and pasted from the unidb package) */
+
+static unsigned long
+_gethash(const char *s, int len, int scale)
+{
+ int i;
+ unsigned long h = 0;
+ unsigned long ix;
+ for (i = 0; i < len; i++) {
+ h = (h * scale) + (unsigned char) Py_TOUPPER(s[i]);
+ ix = h & 0xff000000;
+ if (ix)
+ h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff;
+ }
+ return h;
+}
+
+static const char * const hangul_syllables[][3] = {
+ { "G", "A", "" },
+ { "GG", "AE", "G" },
+ { "N", "YA", "GG" },
+ { "D", "YAE", "GS" },
+ { "DD", "EO", "N", },
+ { "R", "E", "NJ" },
+ { "M", "YEO", "NH" },
+ { "B", "YE", "D" },
+ { "BB", "O", "L" },
+ { "S", "WA", "LG" },
+ { "SS", "WAE", "LM" },
+ { "", "OE", "LB" },
+ { "J", "YO", "LS" },
+ { "JJ", "U", "LT" },
+ { "C", "WEO", "LP" },
+ { "K", "WE", "LH" },
+ { "T", "WI", "M" },
+ { "P", "YU", "B" },
+ { "H", "EU", "BS" },
+ { 0, "YI", "S" },
+ { 0, "I", "SS" },
+ { 0, 0, "NG" },
+ { 0, 0, "J" },
+ { 0, 0, "C" },
+ { 0, 0, "K" },
+ { 0, 0, "T" },
+ { 0, 0, "P" },
+ { 0, 0, "H" }
+};
+
+/* These ranges need to match makeunicodedata.py:cjk_ranges. */
+static int
+is_unified_ideograph(Py_UCS4 code)
+{
+ return
+ (0x3400 <= code && code <= 0x4DBF) || /* CJK Ideograph Extension A */
+ (0x4E00 <= code && code <= 0x9FFF) || /* CJK Ideograph */
+ (0x20000 <= code && code <= 0x2A6DF) || /* CJK Ideograph Extension B */
+ (0x2A700 <= code && code <= 0x2B739) || /* CJK Ideograph Extension C */
+ (0x2B740 <= code && code <= 0x2B81D) || /* CJK Ideograph Extension D */
+ (0x2B820 <= code && code <= 0x2CEA1) || /* CJK Ideograph Extension E */
+ (0x2CEB0 <= code && code <= 0x2EBE0) || /* CJK Ideograph Extension F */
+ (0x30000 <= code && code <= 0x3134A) || /* CJK Ideograph Extension G */
+ (0x31350 <= code && code <= 0x323AF); /* CJK Ideograph Extension H */
+}
+
+/* macros used to determine if the given code point is in the PUA range that
+ * we are using to store aliases and named sequences */
+#define IS_ALIAS(cp) ((cp >= aliases_start) && (cp < aliases_end))
+#define IS_NAMED_SEQ(cp) ((cp >= named_sequences_start) && \
+ (cp < named_sequences_end))
+
+static int
+_getucname(PyObject *self,
+ Py_UCS4 code, char* buffer, int buflen, int with_alias_and_seq)
+{
+ /* Find the name associated with the given code point.
+ * If with_alias_and_seq is 1, check for names in the Private Use Area 15
+ * that we are using for aliases and named sequences. */
+ int offset;
+ int i;
+ int word;
+ const unsigned char* w;
+
+ if (code >= 0x110000)
+ return 0;
+
+ /* XXX should we just skip all the code points in the PUAs here? */
+ if (!with_alias_and_seq && (IS_ALIAS(code) || IS_NAMED_SEQ(code)))
+ return 0;
+
+ if (UCD_Check(self)) {
+ /* in 3.2.0 there are no aliases and named sequences */
+ const change_record *old;
+ if (IS_ALIAS(code) || IS_NAMED_SEQ(code))
+ return 0;
+ old = get_old_record(self, code);
+ if (old->category_changed == 0) {
+ /* unassigned */
+ return 0;
+ }
+ }
+
+ if (SBase <= code && code < SBase+SCount) {
+ /* Hangul syllable. */
+ int SIndex = code - SBase;
+ int L = SIndex / NCount;
+ int V = (SIndex % NCount) / TCount;
+ int T = SIndex % TCount;
+
+ if (buflen < 27)
+ /* Worst case: HANGUL SYLLABLE <10chars>. */
+ return 0;
+ strcpy(buffer, "HANGUL SYLLABLE ");
+ buffer += 16;
+ strcpy(buffer, hangul_syllables[L][0]);
+ buffer += strlen(hangul_syllables[L][0]);
+ strcpy(buffer, hangul_syllables[V][1]);
+ buffer += strlen(hangul_syllables[V][1]);
+ strcpy(buffer, hangul_syllables[T][2]);
+ buffer += strlen(hangul_syllables[T][2]);
+ *buffer = '\0';
+ return 1;
+ }
+
+ if (is_unified_ideograph(code)) {
+ if (buflen < 28)
+ /* Worst case: CJK UNIFIED IDEOGRAPH-20000 */
+ return 0;
+ sprintf(buffer, "CJK UNIFIED IDEOGRAPH-%X", code);
+ return 1;
+ }
+
+ /* get offset into phrasebook */
+ offset = phrasebook_offset1[(code>>phrasebook_shift)];
+ offset = phrasebook_offset2[(offset<<phrasebook_shift) +
+ (code&((1<<phrasebook_shift)-1))];
+ if (!offset)
+ return 0;
+
+ i = 0;
+
+ for (;;) {
+ /* get word index */
+ word = phrasebook[offset] - phrasebook_short;
+ if (word >= 0) {
+ word = (word << 8) + phrasebook[offset+1];
+ offset += 2;
+ } else
+ word = phrasebook[offset++];
+ if (i) {
+ if (i > buflen)
+ return 0; /* buffer overflow */
+ buffer[i++] = ' ';
+ }
+ /* copy word string from lexicon. the last character in the
+ word has bit 7 set. the last word in a string ends with
+ 0x80 */
+ w = lexicon + lexicon_offset[word];
+ while (*w < 128) {
+ if (i >= buflen)
+ return 0; /* buffer overflow */
+ buffer[i++] = *w++;
+ }
+ if (i >= buflen)
+ return 0; /* buffer overflow */
+ buffer[i++] = *w & 127;
+ if (*w == 128)
+ break; /* end of word */
+ }
+
+ return 1;
+}
+
+static int
+capi_getucname(Py_UCS4 code,
+ char* buffer, int buflen,
+ int with_alias_and_seq)
+{
+ return _getucname(NULL, code, buffer, buflen, with_alias_and_seq);
+
+}
+
+static int
+_cmpname(PyObject *self, int code, const char* name, int namelen)
+{
+ /* check if code corresponds to the given name */
+ int i;
+ char buffer[NAME_MAXLEN+1];
+ if (!_getucname(self, code, buffer, NAME_MAXLEN, 1))
+ return 0;
+ for (i = 0; i < namelen; i++) {
+ if (Py_TOUPPER(name[i]) != buffer[i])
+ return 0;
+ }
+ return buffer[namelen] == '\0';
+}
+
+static void
+find_syllable(const char *str, int *len, int *pos, int count, int column)
+{
+ int i, len1;
+ *len = -1;
+ for (i = 0; i < count; i++) {
+ const char *s = hangul_syllables[i][column];
+ len1 = Py_SAFE_DOWNCAST(strlen(s), size_t, int);
+ if (len1 <= *len)
+ continue;
+ if (strncmp(str, s, len1) == 0) {
+ *len = len1;
+ *pos = i;
+ }
+ }
+ if (*len == -1) {
+ *len = 0;
+ }
+}
+
+static int
+_check_alias_and_seq(unsigned int cp, Py_UCS4* code, int with_named_seq)
+{
+ /* check if named sequences are allowed */
+ if (!with_named_seq && IS_NAMED_SEQ(cp))
+ return 0;
+ /* if the code point is in the PUA range that we use for aliases,
+ * convert it to obtain the right code point */
+ if (IS_ALIAS(cp))
+ *code = name_aliases[cp-aliases_start];
+ else
+ *code = cp;
+ return 1;
+}
+
+static int
+_getcode(PyObject* self,
+ const char* name, int namelen, Py_UCS4* code, int with_named_seq)
+{
+ /* Return the code point associated with the given name.
+ * Named aliases are resolved too (unless self != NULL (i.e. we are using
+ * 3.2.0)). If with_named_seq is 1, returns the PUA code point that we are
+ * using for the named sequence, and the caller must then convert it. */
+ unsigned int h, v;
+ unsigned int mask = code_size-1;
+ unsigned int i, incr;
+
+ /* Check for hangul syllables. */
+ if (strncmp(name, "HANGUL SYLLABLE ", 16) == 0) {
+ int len, L = -1, V = -1, T = -1;
+ const char *pos = name + 16;
+ find_syllable(pos, &len, &L, LCount, 0);
+ pos += len;
+ find_syllable(pos, &len, &V, VCount, 1);
+ pos += len;
+ find_syllable(pos, &len, &T, TCount, 2);
+ pos += len;
+ if (L != -1 && V != -1 && T != -1 && pos-name == namelen) {
+ *code = SBase + (L*VCount+V)*TCount + T;
+ return 1;
+ }
+ /* Otherwise, it's an illegal syllable name. */
+ return 0;
+ }
+
+ /* Check for unified ideographs. */
+ if (strncmp(name, "CJK UNIFIED IDEOGRAPH-", 22) == 0) {
+ /* Four or five hexdigits must follow. */
+ v = 0;
+ name += 22;
+ namelen -= 22;
+ if (namelen != 4 && namelen != 5)
+ return 0;
+ while (namelen--) {
+ v *= 16;
+ if (*name >= '0' && *name <= '9')
+ v += *name - '0';
+ else if (*name >= 'A' && *name <= 'F')
+ v += *name - 'A' + 10;
+ else
+ return 0;
+ name++;
+ }
+ if (!is_unified_ideograph(v))
+ return 0;
+ *code = v;
+ return 1;
+ }
+
+ /* the following is the same as python's dictionary lookup, with
+ only minor changes. see the makeunicodedata script for more
+ details */
+
+ h = (unsigned int) _gethash(name, namelen, code_magic);
+ i = (~h) & mask;
+ v = code_hash[i];
+ if (!v)
+ return 0;
+ if (_cmpname(self, v, name, namelen)) {
+ return _check_alias_and_seq(v, code, with_named_seq);
+ }
+ incr = (h ^ (h >> 3)) & mask;
+ if (!incr)
+ incr = mask;
+ for (;;) {
+ i = (i + incr) & mask;
+ v = code_hash[i];
+ if (!v)
+ return 0;
+ if (_cmpname(self, v, name, namelen)) {
+ return _check_alias_and_seq(v, code, with_named_seq);
+ }
+ incr = incr << 1;
+ if (incr > mask)
+ incr = incr ^ code_poly;
+ }
+}
+
+static int
+capi_getcode(const char* name, int namelen, Py_UCS4* code,
+ int with_named_seq)
+{
+ return _getcode(NULL, name, namelen, code, with_named_seq);
+
+}
+
+static void
+unicodedata_destroy_capi(PyObject *capsule)
+{
+ void *capi = PyCapsule_GetPointer(capsule, PyUnicodeData_CAPSULE_NAME);
+ PyMem_Free(capi);
+}
+
+static PyObject *
+unicodedata_create_capi(void)
+{
+ _PyUnicode_Name_CAPI *capi = PyMem_Malloc(sizeof(_PyUnicode_Name_CAPI));
+ if (capi == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ capi->getname = capi_getucname;
+ capi->getcode = capi_getcode;
+
+ PyObject *capsule = PyCapsule_New(capi,
+ PyUnicodeData_CAPSULE_NAME,
+ unicodedata_destroy_capi);
+ if (capsule == NULL) {
+ PyMem_Free(capi);
+ }
+ return capsule;
+};
+
+
+/* -------------------------------------------------------------------- */
+/* Python bindings */
+
+/*[clinic input]
+unicodedata.UCD.name
+
+ self: self
+ chr: int(accept={str})
+ default: object=NULL
+ /
+
+Returns the name assigned to the character chr as a string.
+
+If no name is defined, default is returned, or, if not given,
+ValueError is raised.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value)
+/*[clinic end generated code: output=6bbb37a326407707 input=3e0367f534de56d9]*/
+{
+ char name[NAME_MAXLEN+1];
+ Py_UCS4 c = (Py_UCS4)chr;
+
+ if (!_getucname(self, c, name, NAME_MAXLEN, 0)) {
+ if (default_value == NULL) {
+ PyErr_SetString(PyExc_ValueError, "no such name");
+ return NULL;
+ }
+ else {
+ return Py_NewRef(default_value);
+ }
+ }
+
+ return PyUnicode_FromString(name);
+}
+
+/*[clinic input]
+unicodedata.UCD.lookup
+
+ self: self
+ name: str(accept={str, robuffer}, zeroes=True)
+ /
+
+Look up character by name.
+
+If a character with the given name is found, return the
+corresponding character. If not found, KeyError is raised.
+[clinic start generated code]*/
+
+static PyObject *
+unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
+ Py_ssize_t name_length)
+/*[clinic end generated code: output=7f03fc4959b242f6 input=a557be0f8607a0d6]*/
+{
+ Py_UCS4 code;
+ unsigned int index;
+ if (name_length > NAME_MAXLEN) {
+ PyErr_SetString(PyExc_KeyError, "name too long");
+ return NULL;
+ }
+
+ if (!_getcode(self, name, (int)name_length, &code, 1)) {
+ PyErr_Format(PyExc_KeyError, "undefined character name '%s'", name);
+ return NULL;
+ }
+ /* check if code is in the PUA range that we use for named sequences
+ and convert it */
+ if (IS_NAMED_SEQ(code)) {
+ index = code-named_sequences_start;
+ return PyUnicode_FromKindAndData(PyUnicode_2BYTE_KIND,
+ named_sequences[index].seq,
+ named_sequences[index].seqlen);
+ }
+ return PyUnicode_FromOrdinal(code);
+}
+
+// List of functions used to define module functions *AND* unicodedata.UCD
+// methods. For module functions, self is the module. For UCD methods, self
+// is an UCD instance. The UCD_Check() macro is used to check if self is
+// an UCD instance.
+static PyMethodDef unicodedata_functions[] = {
+ UNICODEDATA_UCD_DECIMAL_METHODDEF
+ UNICODEDATA_UCD_DIGIT_METHODDEF
+ UNICODEDATA_UCD_NUMERIC_METHODDEF
+ UNICODEDATA_UCD_CATEGORY_METHODDEF
+ UNICODEDATA_UCD_BIDIRECTIONAL_METHODDEF
+ UNICODEDATA_UCD_COMBINING_METHODDEF
+ UNICODEDATA_UCD_MIRRORED_METHODDEF
+ UNICODEDATA_UCD_EAST_ASIAN_WIDTH_METHODDEF
+ UNICODEDATA_UCD_DECOMPOSITION_METHODDEF
+ UNICODEDATA_UCD_NAME_METHODDEF
+ UNICODEDATA_UCD_LOOKUP_METHODDEF
+ UNICODEDATA_UCD_IS_NORMALIZED_METHODDEF
+ UNICODEDATA_UCD_NORMALIZE_METHODDEF
+ {NULL, NULL} /* sentinel */
+};
+
+static int
+ucd_traverse(PreviousDBVersion *self, visitproc visit, void *arg)
+{
+ Py_VISIT(Py_TYPE(self));
+ return 0;
+}
+
+static void
+ucd_dealloc(PreviousDBVersion *self)
+{
+ PyTypeObject *tp = Py_TYPE(self);
+ PyObject_GC_UnTrack(self);
+ PyObject_GC_Del(self);
+ Py_DECREF(tp);
+}
+
+static PyType_Slot ucd_type_slots[] = {
+ {Py_tp_dealloc, ucd_dealloc},
+ {Py_tp_traverse, ucd_traverse},
+ {Py_tp_getattro, PyObject_GenericGetAttr},
+ {Py_tp_methods, unicodedata_functions},
+ {Py_tp_members, DB_members},
+ {0, 0}
+};
+
+static PyType_Spec ucd_type_spec = {
+ .name = "unicodedata.UCD",
+ .basicsize = sizeof(PreviousDBVersion),
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION |
+ Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = ucd_type_slots
+};
+
+PyDoc_STRVAR(unicodedata_docstring,
+"This module provides access to the Unicode Character Database which\n\
+defines character properties for all Unicode characters. The data in\n\
+this database is based on the UnicodeData.txt file version\n\
+" UNIDATA_VERSION " which is publicly available from ftp://ftp.unicode.org/.\n\
+\n\
+The module uses the same names and symbols as defined by the\n\
+UnicodeData File Format " UNIDATA_VERSION ".");
+
+static int
+unicodedata_exec(PyObject *module)
+{
+ if (PyModule_AddStringConstant(module, "unidata_version", UNIDATA_VERSION) < 0) {
+ return -1;
+ }
+
+ PyTypeObject *ucd_type = (PyTypeObject *)PyType_FromSpec(&ucd_type_spec);
+ if (ucd_type == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddType(module, ucd_type) < 0) {
+ Py_DECREF(ucd_type);
+ return -1;
+ }
+
+ // Unicode database version 3.2.0 used by the IDNA encoding
+ PyObject *v;
+ v = new_previous_version(ucd_type, "3.2.0",
+ get_change_3_2_0, normalization_3_2_0);
+ Py_DECREF(ucd_type);
+ if (v == NULL) {
+ return -1;
+ }
+ if (PyModule_AddObject(module, "ucd_3_2_0", v) < 0) {
+ Py_DECREF(v);
+ return -1;
+ }
+
+ /* Export C API */
+ PyObject *capsule = unicodedata_create_capi();
+ if (capsule == NULL) {
+ return -1;
+ }
+ int rc = PyModule_AddObjectRef(module, "_ucnhash_CAPI", capsule);
+ Py_DECREF(capsule);
+ if (rc < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot unicodedata_slots[] = {
+ {Py_mod_exec, unicodedata_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef unicodedata_module = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "unicodedata",
+ .m_doc = unicodedata_docstring,
+ .m_size = 0,
+ .m_methods = unicodedata_functions,
+ .m_slots = unicodedata_slots,
+};
+
+PyMODINIT_FUNC
+PyInit_unicodedata(void)
+{
+ return PyModuleDef_Init(&unicodedata_module);
+}
+
+
+/*
+Local variables:
+c-basic-offset: 4
+indent-tabs-mode: nil
+End:
+*/
diff --git a/contrib/tools/python3/Modules/unicodedata_db.h b/contrib/tools/python3/Modules/unicodedata_db.h
new file mode 100644
index 00000000000..4c4b2f589c5
--- /dev/null
+++ b/contrib/tools/python3/Modules/unicodedata_db.h
@@ -0,0 +1,7791 @@
+/* this file was generated by Tools/unicode/makeunicodedata.py 3.3 */
+
+#define UNIDATA_VERSION "15.0.0"
+/* a list of unique database records */
+const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
+ {0, 0, 0, 0, 0, 0},
+ {13, 0, 15, 0, 0, 0},
+ {13, 0, 17, 0, 0, 0},
+ {13, 0, 16, 0, 0, 0},
+ {13, 0, 18, 0, 0, 0},
+ {10, 0, 18, 0, 3, 0},
+ {26, 0, 19, 0, 3, 0},
+ {26, 0, 11, 0, 3, 0},
+ {28, 0, 11, 0, 3, 0},
+ {22, 0, 19, 1, 3, 0},
+ {23, 0, 19, 1, 3, 0},
+ {27, 0, 10, 0, 3, 0},
+ {26, 0, 13, 0, 3, 0},
+ {21, 0, 10, 0, 3, 0},
+ {7, 0, 9, 0, 3, 0},
+ {27, 0, 19, 1, 3, 0},
+ {27, 0, 19, 0, 3, 0},
+ {1, 0, 1, 0, 3, 0},
+ {29, 0, 19, 0, 3, 0},
+ {20, 0, 19, 0, 3, 0},
+ {2, 0, 1, 0, 3, 0},
+ {10, 0, 13, 0, 0, 136},
+ {26, 0, 19, 0, 4, 0},
+ {28, 0, 11, 0, 4, 0},
+ {30, 0, 19, 0, 3, 0},
+ {29, 0, 19, 0, 4, 136},
+ {30, 0, 19, 0, 0, 0},
+ {19, 0, 1, 0, 4, 136},
+ {24, 0, 19, 1, 0, 0},
+ {14, 0, 15, 0, 4, 0},
+ {30, 0, 19, 0, 4, 0},
+ {29, 0, 19, 0, 3, 136},
+ {30, 0, 11, 0, 4, 0},
+ {27, 0, 11, 0, 4, 0},
+ {9, 0, 9, 0, 4, 136},
+ {2, 0, 1, 0, 0, 136},
+ {25, 0, 19, 1, 0, 0},
+ {9, 0, 19, 0, 4, 136},
+ {1, 0, 1, 0, 0, 10},
+ {1, 0, 1, 0, 4, 0},
+ {27, 0, 19, 0, 4, 0},
+ {2, 0, 1, 0, 4, 0},
+ {2, 0, 1, 0, 4, 10},
+ {2, 0, 1, 0, 0, 10},
+ {1, 0, 1, 0, 0, 0},
+ {1, 0, 1, 0, 4, 136},
+ {2, 0, 1, 0, 4, 136},
+ {2, 0, 1, 0, 0, 0},
+ {19, 0, 1, 0, 0, 0},
+ {1, 0, 1, 0, 0, 136},
+ {3, 0, 1, 0, 0, 136},
+ {18, 0, 1, 0, 0, 136},
+ {18, 0, 19, 0, 0, 0},
+ {18, 0, 1, 0, 0, 0},
+ {29, 0, 19, 0, 0, 0},
+ {29, 0, 19, 0, 4, 0},
+ {18, 0, 19, 0, 4, 0},
+ {18, 0, 1, 0, 4, 0},
+ {29, 0, 19, 0, 0, 136},
+ {4, 230, 14, 0, 4, 80},
+ {4, 230, 14, 0, 4, 0},
+ {4, 232, 14, 0, 4, 0},
+ {4, 220, 14, 0, 4, 0},
+ {4, 216, 14, 0, 4, 80},
+ {4, 202, 14, 0, 4, 0},
+ {4, 220, 14, 0, 4, 80},
+ {4, 202, 14, 0, 4, 80},
+ {4, 1, 14, 0, 4, 0},
+ {4, 1, 14, 0, 4, 80},
+ {4, 230, 14, 0, 4, 170},
+ {4, 240, 14, 0, 4, 80},
+ {4, 0, 14, 0, 4, 0},
+ {4, 233, 14, 0, 4, 0},
+ {4, 234, 14, 0, 4, 0},
+ {18, 0, 19, 0, 0, 170},
+ {26, 0, 19, 0, 0, 170},
+ {29, 0, 19, 0, 0, 138},
+ {1, 0, 1, 0, 0, 138},
+ {27, 0, 19, 0, 0, 0},
+ {1, 0, 1, 0, 4, 10},
+ {30, 0, 1, 0, 0, 0},
+ {4, 230, 14, 0, 0, 0},
+ {6, 0, 14, 0, 0, 0},
+ {26, 0, 1, 0, 0, 0},
+ {21, 0, 19, 0, 0, 0},
+ {28, 0, 11, 0, 0, 0},
+ {4, 220, 14, 0, 0, 0},
+ {4, 222, 14, 0, 0, 0},
+ {4, 228, 14, 0, 0, 0},
+ {4, 10, 14, 0, 0, 0},
+ {4, 11, 14, 0, 0, 0},
+ {4, 12, 14, 0, 0, 0},
+ {4, 13, 14, 0, 0, 0},
+ {4, 14, 14, 0, 0, 0},
+ {4, 15, 14, 0, 0, 0},
+ {4, 16, 14, 0, 0, 0},
+ {4, 17, 14, 0, 0, 0},
+ {4, 18, 14, 0, 0, 0},
+ {4, 19, 14, 0, 0, 0},
+ {4, 20, 14, 0, 0, 0},
+ {4, 21, 14, 0, 0, 0},
+ {4, 22, 14, 0, 0, 0},
+ {21, 0, 4, 0, 0, 0},
+ {4, 23, 14, 0, 0, 0},
+ {26, 0, 4, 0, 0, 0},
+ {4, 24, 14, 0, 0, 0},
+ {4, 25, 14, 0, 0, 0},
+ {19, 0, 4, 0, 0, 0},
+ {14, 0, 12, 0, 0, 0},
+ {27, 0, 5, 0, 0, 0},
+ {26, 0, 11, 0, 0, 0},
+ {28, 0, 5, 0, 0, 0},
+ {26, 0, 13, 0, 0, 0},
+ {26, 0, 5, 0, 0, 0},
+ {4, 30, 14, 0, 0, 0},
+ {4, 31, 14, 0, 0, 0},
+ {4, 32, 14, 0, 0, 0},
+ {14, 0, 5, 0, 0, 0},
+ {19, 0, 5, 0, 0, 0},
+ {19, 0, 5, 0, 0, 10},
+ {18, 0, 5, 0, 0, 0},
+ {4, 27, 14, 0, 0, 0},
+ {4, 28, 14, 0, 0, 0},
+ {4, 29, 14, 0, 0, 0},
+ {4, 33, 14, 0, 0, 0},
+ {4, 34, 14, 0, 0, 0},
+ {4, 230, 14, 0, 0, 80},
+ {4, 220, 14, 0, 0, 80},
+ {7, 0, 12, 0, 0, 0},
+ {26, 0, 12, 0, 0, 0},
+ {4, 35, 14, 0, 0, 0},
+ {19, 0, 5, 0, 0, 136},
+ {7, 0, 9, 0, 0, 0},
+ {30, 0, 5, 0, 0, 0},
+ {4, 36, 14, 0, 0, 0},
+ {4, 0, 14, 0, 0, 0},
+ {7, 0, 4, 0, 0, 0},
+ {18, 0, 4, 0, 0, 0},
+ {26, 0, 19, 0, 0, 0},
+ {28, 0, 4, 0, 0, 0},
+ {29, 0, 5, 0, 0, 0},
+ {5, 0, 1, 0, 0, 0},
+ {19, 0, 1, 0, 0, 10},
+ {4, 7, 14, 0, 0, 80},
+ {4, 9, 14, 0, 0, 0},
+ {19, 0, 1, 0, 0, 170},
+ {7, 0, 1, 0, 0, 0},
+ {4, 7, 14, 0, 0, 0},
+ {5, 0, 1, 0, 0, 80},
+ {5, 0, 1, 0, 0, 10},
+ {9, 0, 1, 0, 0, 0},
+ {4, 0, 14, 0, 0, 80},
+ {4, 0, 14, 0, 0, 10},
+ {4, 84, 14, 0, 0, 0},
+ {4, 91, 14, 0, 0, 80},
+ {9, 0, 19, 0, 0, 0},
+ {4, 0, 1, 0, 0, 0},
+ {4, 9, 14, 0, 0, 80},
+ {19, 0, 1, 0, 0, 136},
+ {4, 103, 14, 0, 0, 0},
+ {4, 107, 14, 0, 0, 0},
+ {4, 118, 14, 0, 0, 0},
+ {4, 122, 14, 0, 0, 0},
+ {26, 0, 1, 0, 0, 136},
+ {4, 216, 14, 0, 0, 0},
+ {22, 0, 19, 1, 0, 0},
+ {23, 0, 19, 1, 0, 0},
+ {4, 129, 14, 0, 0, 0},
+ {4, 130, 14, 0, 0, 0},
+ {4, 0, 14, 0, 0, 170},
+ {4, 132, 14, 0, 0, 0},
+ {4, 0, 14, 0, 0, 136},
+ {19, 0, 1, 0, 2, 0},
+ {19, 0, 1, 0, 0, 80},
+ {10, 0, 18, 0, 0, 0},
+ {8, 0, 1, 0, 0, 0},
+ {5, 9, 1, 0, 0, 0},
+ {14, 0, 15, 0, 0, 0},
+ {4, 1, 14, 0, 0, 0},
+ {4, 234, 14, 0, 0, 0},
+ {4, 214, 14, 0, 0, 0},
+ {4, 202, 14, 0, 0, 0},
+ {4, 232, 14, 0, 0, 0},
+ {4, 218, 14, 0, 0, 0},
+ {4, 233, 14, 0, 0, 0},
+ {2, 0, 1, 0, 0, 138},
+ {2, 0, 1, 0, 0, 170},
+ {3, 0, 1, 0, 0, 10},
+ {1, 0, 1, 0, 0, 170},
+ {29, 0, 19, 0, 0, 170},
+ {10, 0, 18, 0, 0, 170},
+ {10, 0, 18, 0, 0, 136},
+ {14, 0, 1, 0, 0, 0},
+ {14, 0, 4, 0, 0, 0},
+ {21, 0, 19, 0, 4, 0},
+ {21, 0, 19, 0, 0, 136},
+ {26, 0, 19, 0, 0, 136},
+ {24, 0, 19, 0, 4, 0},
+ {25, 0, 19, 0, 4, 0},
+ {22, 0, 19, 0, 0, 0},
+ {24, 0, 19, 0, 0, 0},
+ {26, 0, 19, 0, 4, 136},
+ {11, 0, 18, 0, 0, 0},
+ {12, 0, 16, 0, 0, 0},
+ {14, 0, 2, 0, 0, 0},
+ {14, 0, 6, 0, 0, 0},
+ {14, 0, 8, 0, 0, 0},
+ {14, 0, 3, 0, 0, 0},
+ {14, 0, 7, 0, 0, 0},
+ {26, 0, 11, 0, 4, 0},
+ {26, 0, 11, 0, 4, 136},
+ {26, 0, 11, 0, 0, 136},
+ {20, 0, 19, 0, 0, 0},
+ {27, 0, 13, 0, 0, 0},
+ {14, 0, 20, 0, 0, 0},
+ {14, 0, 21, 0, 0, 0},
+ {14, 0, 22, 0, 0, 0},
+ {14, 0, 23, 0, 0, 0},
+ {9, 0, 9, 0, 0, 136},
+ {27, 0, 10, 0, 0, 136},
+ {27, 0, 19, 0, 0, 136},
+ {22, 0, 19, 1, 0, 136},
+ {23, 0, 19, 1, 0, 136},
+ {18, 0, 1, 0, 4, 136},
+ {28, 0, 11, 0, 0, 136},
+ {28, 0, 11, 0, 1, 0},
+ {30, 0, 19, 0, 0, 136},
+ {30, 0, 19, 0, 4, 136},
+ {1, 0, 1, 0, 4, 170},
+ {30, 0, 11, 0, 0, 0},
+ {27, 0, 19, 1, 0, 136},
+ {9, 0, 19, 0, 0, 136},
+ {8, 0, 1, 0, 4, 136},
+ {8, 0, 1, 0, 0, 136},
+ {27, 0, 19, 0, 0, 10},
+ {30, 0, 19, 0, 0, 10},
+ {27, 0, 19, 1, 0, 0},
+ {27, 0, 19, 1, 4, 0},
+ {27, 0, 19, 1, 0, 10},
+ {27, 0, 10, 0, 0, 0},
+ {27, 0, 11, 0, 0, 0},
+ {27, 0, 19, 1, 4, 136},
+ {27, 0, 19, 1, 4, 10},
+ {30, 0, 19, 0, 2, 0},
+ {22, 0, 19, 1, 2, 170},
+ {23, 0, 19, 1, 2, 170},
+ {30, 0, 1, 0, 4, 136},
+ {9, 0, 19, 0, 4, 0},
+ {27, 0, 19, 0, 2, 0},
+ {27, 0, 19, 1, 0, 170},
+ {30, 0, 19, 1, 0, 0},
+ {30, 0, 19, 0, 2, 136},
+ {10, 0, 18, 0, 5, 136},
+ {26, 0, 19, 0, 2, 0},
+ {18, 0, 1, 0, 2, 0},
+ {8, 0, 1, 0, 2, 0},
+ {22, 0, 19, 1, 2, 0},
+ {23, 0, 19, 1, 2, 0},
+ {21, 0, 19, 0, 2, 0},
+ {22, 0, 19, 0, 2, 0},
+ {23, 0, 19, 0, 2, 0},
+ {4, 218, 14, 0, 2, 0},
+ {4, 228, 14, 0, 2, 0},
+ {4, 232, 14, 0, 2, 0},
+ {4, 222, 14, 0, 2, 0},
+ {5, 224, 1, 0, 2, 0},
+ {8, 0, 1, 0, 2, 136},
+ {19, 0, 1, 0, 2, 10},
+ {4, 8, 14, 0, 2, 80},
+ {29, 0, 19, 0, 2, 136},
+ {18, 0, 1, 0, 2, 10},
+ {19, 0, 1, 0, 2, 136},
+ {30, 0, 1, 0, 2, 0},
+ {9, 0, 1, 0, 2, 136},
+ {30, 0, 1, 0, 2, 136},
+ {9, 0, 1, 0, 4, 0},
+ {9, 0, 19, 0, 2, 136},
+ {29, 0, 1, 0, 0, 0},
+ {15, 0, 1, 0, 0, 0},
+ {16, 0, 1, 0, 4, 0},
+ {19, 0, 1, 0, 2, 170},
+ {0, 0, 0, 0, 2, 0},
+ {19, 0, 4, 0, 0, 170},
+ {4, 26, 14, 0, 0, 0},
+ {19, 0, 4, 0, 0, 136},
+ {23, 0, 19, 0, 0, 0},
+ {28, 0, 5, 0, 0, 136},
+ {26, 0, 19, 0, 2, 136},
+ {22, 0, 19, 0, 2, 136},
+ {23, 0, 19, 0, 2, 136},
+ {21, 0, 19, 0, 2, 136},
+ {20, 0, 19, 0, 2, 136},
+ {26, 0, 13, 0, 2, 136},
+ {22, 0, 19, 1, 2, 136},
+ {23, 0, 19, 1, 2, 136},
+ {26, 0, 11, 0, 2, 136},
+ {27, 0, 10, 0, 2, 136},
+ {21, 0, 10, 0, 2, 136},
+ {27, 0, 19, 1, 2, 136},
+ {27, 0, 19, 0, 2, 136},
+ {28, 0, 11, 0, 2, 136},
+ {26, 0, 19, 0, 5, 136},
+ {26, 0, 11, 0, 5, 136},
+ {28, 0, 11, 0, 5, 136},
+ {22, 0, 19, 1, 5, 136},
+ {23, 0, 19, 1, 5, 136},
+ {27, 0, 10, 0, 5, 136},
+ {26, 0, 13, 0, 5, 136},
+ {21, 0, 10, 0, 5, 136},
+ {7, 0, 9, 0, 5, 136},
+ {27, 0, 19, 1, 5, 136},
+ {27, 0, 19, 0, 5, 136},
+ {1, 0, 1, 0, 5, 136},
+ {29, 0, 19, 0, 5, 136},
+ {20, 0, 19, 0, 5, 136},
+ {2, 0, 1, 0, 5, 136},
+ {26, 0, 19, 0, 1, 136},
+ {22, 0, 19, 1, 1, 136},
+ {23, 0, 19, 1, 1, 136},
+ {19, 0, 1, 0, 1, 136},
+ {18, 0, 1, 0, 1, 136},
+ {30, 0, 19, 0, 5, 136},
+ {30, 0, 19, 0, 1, 136},
+ {27, 0, 19, 0, 1, 136},
+ {14, 0, 19, 0, 0, 0},
+ {8, 0, 19, 0, 0, 0},
+ {9, 0, 9, 0, 0, 0},
+ {9, 0, 4, 0, 0, 0},
+ {30, 0, 4, 0, 0, 0},
+ {1, 0, 4, 0, 0, 0},
+ {2, 0, 4, 0, 0, 0},
+ {9, 0, 12, 0, 0, 0},
+ {9, 0, 5, 0, 0, 0},
+ {4, 9, 1, 0, 0, 0},
+ {4, 0, 14, 0, 2, 0},
+ {5, 6, 1, 0, 2, 0},
+ {30, 0, 1, 0, 0, 170},
+ {5, 216, 1, 0, 0, 0},
+ {5, 226, 1, 0, 0, 0},
+ {27, 0, 1, 0, 0, 136},
+ {7, 0, 9, 0, 0, 136},
+ {30, 0, 1, 0, 0, 136},
+ {30, 0, 1, 0, 4, 0},
+ {29, 0, 19, 0, 2, 0},
+};
+
+/* Reindexing of NFC first characters. */
+#define TOTAL_FIRST 377
+#define TOTAL_LAST 63
+struct reindex{int start;short count,index;};
+static struct reindex nfc_first[] = {
+ { 60, 2, 0},
+ { 65, 15, 3},
+ { 82, 8, 19},
+ { 97, 15, 28},
+ { 114, 8, 44},
+ { 168, 0, 53},
+ { 194, 0, 54},
+ { 196, 3, 55},
+ { 202, 0, 59},
+ { 207, 0, 60},
+ { 212, 2, 61},
+ { 216, 0, 64},
+ { 220, 0, 65},
+ { 226, 0, 66},
+ { 228, 3, 67},
+ { 234, 0, 71},
+ { 239, 0, 72},
+ { 244, 2, 73},
+ { 248, 0, 76},
+ { 252, 0, 77},
+ { 258, 1, 78},
+ { 274, 1, 80},
+ { 332, 1, 82},
+ { 346, 1, 84},
+ { 352, 1, 86},
+ { 360, 3, 88},
+ { 383, 0, 92},
+ { 416, 1, 93},
+ { 431, 1, 95},
+ { 439, 0, 97},
+ { 490, 1, 98},
+ { 550, 3, 100},
+ { 558, 1, 104},
+ { 658, 0, 106},
+ { 913, 0, 107},
+ { 917, 0, 108},
+ { 919, 0, 109},
+ { 921, 0, 110},
+ { 927, 0, 111},
+ { 929, 0, 112},
+ { 933, 0, 113},
+ { 937, 0, 114},
+ { 940, 0, 115},
+ { 942, 0, 116},
+ { 945, 0, 117},
+ { 949, 0, 118},
+ { 951, 0, 119},
+ { 953, 0, 120},
+ { 959, 0, 121},
+ { 961, 0, 122},
+ { 965, 0, 123},
+ { 969, 2, 124},
+ { 974, 0, 127},
+ { 978, 0, 128},
+ { 1030, 0, 129},
+ { 1040, 0, 130},
+ { 1043, 0, 131},
+ { 1045, 3, 132},
+ { 1050, 0, 136},
+ { 1054, 0, 137},
+ { 1059, 0, 138},
+ { 1063, 0, 139},
+ { 1067, 0, 140},
+ { 1069, 0, 141},
+ { 1072, 0, 142},
+ { 1075, 0, 143},
+ { 1077, 3, 144},
+ { 1082, 0, 148},
+ { 1086, 0, 149},
+ { 1091, 0, 150},
+ { 1095, 0, 151},
+ { 1099, 0, 152},
+ { 1101, 0, 153},
+ { 1110, 0, 154},
+ { 1140, 1, 155},
+ { 1240, 1, 157},
+ { 1256, 1, 159},
+ { 1575, 0, 161},
+ { 1608, 0, 162},
+ { 1610, 0, 163},
+ { 1729, 0, 164},
+ { 1746, 0, 165},
+ { 1749, 0, 166},
+ { 2344, 0, 167},
+ { 2352, 0, 168},
+ { 2355, 0, 169},
+ { 2503, 0, 170},
+ { 2887, 0, 171},
+ { 2962, 0, 172},
+ { 3014, 1, 173},
+ { 3142, 0, 175},
+ { 3263, 0, 176},
+ { 3270, 0, 177},
+ { 3274, 0, 178},
+ { 3398, 1, 179},
+ { 3545, 0, 181},
+ { 3548, 0, 182},
+ { 4133, 0, 183},
+ { 6917, 0, 184},
+ { 6919, 0, 185},
+ { 6921, 0, 186},
+ { 6923, 0, 187},
+ { 6925, 0, 188},
+ { 6929, 0, 189},
+ { 6970, 0, 190},
+ { 6972, 0, 191},
+ { 6974, 1, 192},
+ { 6978, 0, 194},
+ { 7734, 1, 195},
+ { 7770, 1, 197},
+ { 7778, 1, 199},
+ { 7840, 1, 201},
+ { 7864, 1, 203},
+ { 7884, 1, 205},
+ { 7936, 17, 207},
+ { 7960, 1, 225},
+ { 7968, 17, 227},
+ { 7992, 1, 245},
+ { 8000, 1, 247},
+ { 8008, 1, 249},
+ { 8016, 1, 251},
+ { 8025, 0, 253},
+ { 8032, 16, 254},
+ { 8052, 0, 271},
+ { 8060, 0, 272},
+ { 8118, 0, 273},
+ { 8127, 0, 274},
+ { 8134, 0, 275},
+ { 8182, 0, 276},
+ { 8190, 0, 277},
+ { 8592, 0, 278},
+ { 8594, 0, 279},
+ { 8596, 0, 280},
+ { 8656, 0, 281},
+ { 8658, 0, 282},
+ { 8660, 0, 283},
+ { 8707, 0, 284},
+ { 8712, 0, 285},
+ { 8715, 0, 286},
+ { 8739, 0, 287},
+ { 8741, 0, 288},
+ { 8764, 0, 289},
+ { 8771, 0, 290},
+ { 8773, 0, 291},
+ { 8776, 0, 292},
+ { 8781, 0, 293},
+ { 8801, 0, 294},
+ { 8804, 1, 295},
+ { 8818, 1, 297},
+ { 8822, 1, 299},
+ { 8826, 3, 301},
+ { 8834, 1, 305},
+ { 8838, 1, 307},
+ { 8849, 1, 309},
+ { 8866, 0, 311},
+ { 8872, 1, 312},
+ { 8875, 0, 314},
+ { 8882, 3, 315},
+ { 12358, 0, 319},
+ { 12363, 0, 320},
+ { 12365, 0, 321},
+ { 12367, 0, 322},
+ { 12369, 0, 323},
+ { 12371, 0, 324},
+ { 12373, 0, 325},
+ { 12375, 0, 326},
+ { 12377, 0, 327},
+ { 12379, 0, 328},
+ { 12381, 0, 329},
+ { 12383, 0, 330},
+ { 12385, 0, 331},
+ { 12388, 0, 332},
+ { 12390, 0, 333},
+ { 12392, 0, 334},
+ { 12399, 0, 335},
+ { 12402, 0, 336},
+ { 12405, 0, 337},
+ { 12408, 0, 338},
+ { 12411, 0, 339},
+ { 12445, 0, 340},
+ { 12454, 0, 341},
+ { 12459, 0, 342},
+ { 12461, 0, 343},
+ { 12463, 0, 344},
+ { 12465, 0, 345},
+ { 12467, 0, 346},
+ { 12469, 0, 347},
+ { 12471, 0, 348},
+ { 12473, 0, 349},
+ { 12475, 0, 350},
+ { 12477, 0, 351},
+ { 12479, 0, 352},
+ { 12481, 0, 353},
+ { 12484, 0, 354},
+ { 12486, 0, 355},
+ { 12488, 0, 356},
+ { 12495, 0, 357},
+ { 12498, 0, 358},
+ { 12501, 0, 359},
+ { 12504, 0, 360},
+ { 12507, 0, 361},
+ { 12527, 3, 362},
+ { 12541, 0, 366},
+ { 69785, 0, 367},
+ { 69787, 0, 368},
+ { 69797, 0, 369},
+ { 69937, 1, 370},
+ { 70471, 0, 372},
+ { 70841, 0, 373},
+ { 71096, 1, 374},
+ { 71989, 0, 376},
+ {0,0,0}
+};
+
+static struct reindex nfc_last[] = {
+ { 768, 4, 0},
+ { 774, 6, 5},
+ { 783, 0, 12},
+ { 785, 0, 13},
+ { 787, 1, 14},
+ { 795, 0, 16},
+ { 803, 5, 17},
+ { 813, 1, 23},
+ { 816, 1, 25},
+ { 824, 0, 27},
+ { 834, 0, 28},
+ { 837, 0, 29},
+ { 1619, 2, 30},
+ { 2364, 0, 33},
+ { 2494, 0, 34},
+ { 2519, 0, 35},
+ { 2878, 0, 36},
+ { 2902, 1, 37},
+ { 3006, 0, 39},
+ { 3031, 0, 40},
+ { 3158, 0, 41},
+ { 3266, 0, 42},
+ { 3285, 1, 43},
+ { 3390, 0, 45},
+ { 3415, 0, 46},
+ { 3530, 0, 47},
+ { 3535, 0, 48},
+ { 3551, 0, 49},
+ { 4142, 0, 50},
+ { 6965, 0, 51},
+ { 12441, 1, 52},
+ { 69818, 0, 54},
+ { 69927, 0, 55},
+ { 70462, 0, 56},
+ { 70487, 0, 57},
+ { 70832, 0, 58},
+ { 70842, 0, 59},
+ { 70845, 0, 60},
+ { 71087, 0, 61},
+ { 71984, 0, 62},
+ {0,0,0}
+};
+
+/* string literals */
+const char *_PyUnicode_CategoryNames[] = {
+ "Cn",
+ "Lu",
+ "Ll",
+ "Lt",
+ "Mn",
+ "Mc",
+ "Me",
+ "Nd",
+ "Nl",
+ "No",
+ "Zs",
+ "Zl",
+ "Zp",
+ "Cc",
+ "Cf",
+ "Cs",
+ "Co",
+ "Cn",
+ "Lm",
+ "Lo",
+ "Pc",
+ "Pd",
+ "Ps",
+ "Pe",
+ "Pi",
+ "Pf",
+ "Po",
+ "Sm",
+ "Sc",
+ "Sk",
+ "So",
+ NULL
+};
+const char *_PyUnicode_BidirectionalNames[] = {
+ "",
+ "L",
+ "LRE",
+ "LRO",
+ "R",
+ "AL",
+ "RLE",
+ "RLO",
+ "PDF",
+ "EN",
+ "ES",
+ "ET",
+ "AN",
+ "CS",
+ "NSM",
+ "BN",
+ "B",
+ "S",
+ "WS",
+ "ON",
+ "LRI",
+ "RLI",
+ "FSI",
+ "PDI",
+ NULL
+};
+const char *_PyUnicode_EastAsianWidthNames[] = {
+ "N",
+ "H",
+ "W",
+ "Na",
+ "A",
+ "F",
+ NULL
+};
+static const char *decomp_prefix[] = {
+ "",
+ "<noBreak>",
+ "<compat>",
+ "<super>",
+ "<fraction>",
+ "<sub>",
+ "<font>",
+ "<circle>",
+ "<wide>",
+ "<vertical>",
+ "<square>",
+ "<isolated>",
+ "<final>",
+ "<initial>",
+ "<medial>",
+ "<small>",
+ "<narrow>",
+ NULL
+};
+/* index tables for the database records */
+#define SHIFT 7
+static const unsigned short index1[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 102, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 103, 101, 101, 101, 101, 101, 101, 101, 101, 104, 41, 41, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
+ 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 118,
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+ 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 122, 123,
+ 124, 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 41, 41, 145, 146, 147, 148, 149,
+ 150, 151, 152, 153, 154, 155, 156, 157, 137, 158, 159, 160, 161, 162,
+ 163, 164, 165, 166, 167, 168, 137, 169, 170, 137, 171, 172, 173, 174,
+ 137, 175, 176, 177, 178, 179, 180, 181, 137, 182, 183, 184, 185, 137,
+ 186, 187, 188, 41, 41, 41, 41, 41, 41, 41, 189, 190, 41, 191, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 192, 41, 41, 41, 41, 41, 41, 41, 41, 193, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 41, 41, 41, 41, 194, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 41, 41, 41, 41, 195, 196, 197, 198, 137, 137, 137, 137, 199,
+ 200, 201, 202, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 203, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 204, 205, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 206, 101, 101, 207, 101, 101, 208, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 209, 210, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 211, 212, 78, 213,
+ 214, 215, 216, 217, 218, 137, 219, 220, 221, 222, 223, 224, 225, 226, 78,
+ 78, 78, 78, 227, 228, 137, 137, 137, 137, 137, 137, 137, 137, 229, 137,
+ 230, 231, 232, 137, 137, 233, 137, 137, 137, 234, 137, 137, 137, 137,
+ 137, 235, 236, 237, 238, 137, 137, 137, 137, 137, 239, 240, 241, 137,
+ 242, 243, 137, 137, 244, 245, 246, 247, 248, 137, 249, 250, 251, 252,
+ 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266,
+ 137, 137, 137, 137, 137, 137, 137, 137, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 267, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 268, 101, 269, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 270, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 271, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 121, 121, 121, 121, 273, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 274, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 275, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 276, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 274, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 277, 137, 278, 279, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 280, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 280,
+};
+
+static const unsigned short index2[] = {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 3, 2, 5, 6, 6, 7, 8, 7, 6, 6, 9, 10, 6, 11, 12, 13, 12,
+ 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 6, 15, 16, 15, 6, 6, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 9, 6, 10, 18, 19, 18, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 9, 16, 10, 16, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21, 22, 8, 8, 23, 8, 24,
+ 22, 25, 26, 27, 28, 16, 29, 30, 31, 32, 33, 34, 34, 25, 35, 22, 22, 25,
+ 34, 27, 36, 37, 37, 37, 22, 38, 38, 38, 38, 38, 38, 39, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 39, 38, 38, 38, 38, 38, 38, 40, 39, 38, 38, 38, 38,
+ 38, 39, 41, 42, 42, 43, 43, 43, 43, 41, 43, 42, 42, 42, 43, 42, 42, 43,
+ 43, 41, 43, 42, 42, 43, 43, 43, 40, 41, 42, 42, 43, 42, 43, 41, 43, 38,
+ 42, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 44, 41, 38,
+ 42, 38, 43, 38, 43, 38, 43, 38, 42, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 39, 41, 38, 43, 38, 42, 38, 43, 38, 43, 38, 41, 45, 46, 38, 43, 38,
+ 43, 41, 38, 43, 38, 43, 38, 43, 45, 46, 39, 41, 38, 42, 38, 43, 38, 42,
+ 46, 39, 41, 38, 42, 38, 43, 38, 43, 39, 41, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 39, 41, 38, 43, 38, 42, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 38, 43, 38, 43, 38, 43,
+ 35, 47, 44, 44, 47, 44, 47, 44, 44, 47, 44, 44, 44, 47, 47, 44, 44, 44,
+ 44, 47, 44, 44, 47, 44, 44, 44, 47, 47, 47, 44, 44, 47, 44, 38, 43, 44,
+ 47, 44, 47, 44, 44, 47, 44, 47, 47, 44, 47, 44, 38, 43, 44, 44, 44, 47,
+ 44, 47, 44, 44, 47, 47, 48, 44, 47, 47, 47, 48, 48, 48, 48, 49, 50, 35,
+ 49, 50, 35, 49, 50, 35, 38, 42, 38, 42, 38, 42, 38, 42, 38, 42, 38, 42,
+ 38, 42, 38, 42, 47, 38, 43, 38, 43, 38, 43, 44, 47, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 43, 49, 50, 35, 38, 43, 44, 44, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 44, 47, 38, 43, 44,
+ 47, 44, 47, 44, 47, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 47, 47, 47, 47, 47, 47, 44, 44, 47, 44, 44, 47, 47, 44, 47, 44, 44,
+ 44, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 47, 41, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 41, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 48, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 52, 52, 53, 53, 53, 53, 53, 53, 53, 54,
+ 54, 55, 54, 52, 56, 52, 56, 56, 56, 52, 56, 52, 52, 57, 53, 54, 54, 54,
+ 54, 54, 54, 25, 25, 25, 25, 58, 25, 54, 55, 51, 51, 51, 51, 51, 54, 54,
+ 54, 54, 54, 54, 54, 52, 54, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 54, 59, 59, 59, 59, 59, 60, 59, 59, 59, 59, 59,
+ 59, 59, 60, 60, 59, 60, 59, 60, 59, 59, 61, 62, 62, 62, 62, 61, 63, 62,
+ 62, 62, 62, 62, 64, 64, 65, 65, 65, 65, 66, 66, 62, 62, 62, 62, 65, 65,
+ 62, 65, 65, 62, 62, 67, 67, 67, 67, 68, 62, 62, 62, 62, 60, 60, 60, 69,
+ 69, 59, 69, 69, 70, 60, 62, 62, 62, 60, 60, 60, 62, 62, 71, 60, 60, 60,
+ 62, 62, 62, 62, 60, 61, 62, 62, 60, 72, 73, 73, 72, 73, 73, 72, 60, 60,
+ 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 44, 47, 44, 47, 74, 54, 44,
+ 47, 0, 0, 51, 47, 47, 47, 75, 44, 0, 0, 0, 0, 58, 76, 38, 75, 38, 38, 38,
+ 0, 38, 0, 38, 38, 43, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 0, 39, 39, 39, 39, 39, 39, 39, 38, 38, 43, 43, 43, 43,
+ 43, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
+ 47, 41, 41, 41, 41, 41, 41, 41, 43, 43, 43, 43, 43, 44, 35, 35, 49, 77,
+ 77, 35, 35, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 35, 35, 35, 47, 49, 35, 78, 44,
+ 47, 49, 44, 47, 47, 44, 44, 44, 38, 79, 44, 38, 44, 44, 44, 38, 44, 44,
+ 44, 44, 38, 38, 38, 44, 39, 39, 39, 39, 39, 39, 39, 39, 39, 79, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 41, 41, 41, 41, 41, 41,
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 43, 42,
+ 47, 43, 47, 47, 47, 43, 47, 47, 47, 47, 43, 43, 43, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 38, 43, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 80, 81, 81, 81, 81, 81,
+ 82, 82, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 38, 43, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 47,
+ 38, 43, 38, 43, 44, 47, 38, 43, 44, 47, 38, 43, 38, 43, 38, 43, 44, 47,
+ 38, 43, 38, 43, 38, 43, 44, 47, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43,
+ 38, 43, 44, 47, 38, 43, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 0, 0, 53, 83, 83, 83, 83, 83, 83, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 35, 47, 83, 84, 0, 0, 26, 26, 85, 0, 86, 81, 81, 81, 81, 86, 81,
+ 81, 81, 87, 86, 81, 81, 81, 81, 81, 81, 86, 86, 86, 86, 86, 86, 81, 81,
+ 86, 81, 81, 87, 88, 81, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, 104, 81, 86, 104, 97, 0, 0, 0, 0, 0,
+ 0, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0,
+ 0, 0, 0, 107, 107, 107, 107, 104, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 108, 108, 108, 108, 108, 108, 78, 78, 109, 110, 110, 111, 112, 113, 26,
+ 26, 81, 81, 81, 81, 81, 81, 81, 81, 114, 115, 116, 113, 117, 113, 113,
+ 113, 118, 118, 119, 119, 119, 119, 119, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 120, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 121, 122, 123, 114, 115, 116, 124, 125, 126, 126, 127, 86, 81,
+ 81, 81, 81, 81, 86, 81, 81, 86, 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 110, 129, 129, 113, 118, 118, 130, 118, 118, 118, 118, 131,
+ 131, 131, 131, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 119, 118, 119, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, 113, 118, 81, 81, 81,
+ 81, 81, 81, 81, 108, 26, 81, 81, 81, 81, 86, 81, 120, 120, 81, 81, 26,
+ 86, 81, 81, 86, 118, 118, 132, 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 118, 118, 118, 133, 133, 118, 113, 113, 113, 113, 113, 113, 113,
+ 113, 113, 113, 113, 113, 113, 113, 0, 117, 118, 134, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 81, 86, 81,
+ 81, 86, 81, 81, 86, 86, 86, 81, 86, 86, 81, 86, 81, 81, 81, 86, 81, 86,
+ 81, 86, 81, 86, 81, 81, 0, 0, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 81, 81, 81, 81, 81, 81, 81, 86, 81, 137, 137, 26,
+ 138, 138, 138, 137, 0, 0, 86, 139, 139, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 81, 81, 81, 81, 137, 81, 81, 81, 81, 81, 81, 81, 81, 81, 137,
+ 81, 81, 81, 137, 81, 81, 81, 81, 81, 0, 0, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 0, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 86, 86, 86, 0, 0, 104, 0, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 0, 0, 0, 0, 0, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 140, 118, 118, 118, 118, 118, 118, 0,
+ 108, 108, 0, 0, 0, 0, 0, 0, 81, 86, 86, 86, 81, 81, 81, 81, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 120, 81, 81, 81,
+ 81, 81, 86, 86, 86, 86, 86, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 108, 86, 81, 81, 86, 81, 81, 86, 81, 81, 81, 86, 86, 86, 121,
+ 122, 123, 81, 81, 81, 86, 81, 81, 86, 86, 81, 81, 81, 81, 81, 135, 135,
+ 135, 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 142, 48, 48, 48, 48, 48, 48, 48, 142, 48, 48, 142, 48, 48,
+ 48, 48, 48, 135, 141, 143, 48, 141, 141, 141, 135, 135, 135, 135, 135,
+ 135, 135, 135, 141, 141, 141, 141, 144, 141, 141, 48, 81, 86, 81, 81,
+ 135, 135, 135, 145, 145, 145, 145, 145, 145, 145, 145, 48, 48, 135, 135,
+ 83, 83, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 83, 53, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 141, 141, 0, 48,
+ 48, 48, 48, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48,
+ 48, 48, 48, 48, 48, 48, 0, 48, 0, 0, 0, 48, 48, 48, 48, 0, 0, 147, 48,
+ 148, 141, 141, 135, 135, 135, 135, 0, 0, 141, 141, 0, 0, 149, 149, 144,
+ 48, 0, 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, 0, 145, 145, 0, 145, 48, 48,
+ 135, 135, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 48, 48,
+ 85, 85, 150, 150, 150, 150, 150, 150, 80, 85, 48, 83, 81, 0, 0, 135, 135,
+ 141, 0, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 48, 48, 0, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 145, 0, 48, 145, 0, 48, 48, 0, 0,
+ 147, 0, 141, 141, 141, 135, 135, 0, 0, 0, 0, 135, 135, 0, 0, 135, 135,
+ 144, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 145, 145, 145, 48, 0, 145, 0, 0,
+ 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 135,
+ 135, 48, 48, 48, 135, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 135, 141, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0,
+ 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 0, 48, 48, 48, 48, 48, 0, 0, 147,
+ 48, 141, 141, 141, 135, 135, 135, 135, 135, 0, 135, 135, 141, 0, 141,
+ 141, 144, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48,
+ 135, 135, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 83, 85,
+ 0, 0, 0, 0, 0, 0, 0, 48, 135, 135, 135, 135, 135, 135, 0, 135, 141, 141,
+ 0, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 0, 48, 48, 48, 48, 48, 0, 0,
+ 147, 48, 148, 135, 141, 135, 135, 135, 135, 0, 0, 141, 149, 0, 0, 149,
+ 149, 144, 0, 0, 0, 0, 0, 0, 0, 135, 151, 148, 0, 0, 0, 0, 145, 145, 0,
+ 48, 48, 48, 135, 135, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 80, 48, 150, 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 135, 48, 0, 48, 48, 48, 48, 48, 48, 0, 0, 0, 48, 48, 48, 0, 48, 48, 142,
+ 48, 0, 0, 0, 48, 48, 0, 48, 0, 48, 48, 0, 0, 0, 48, 48, 0, 0, 0, 48, 48,
+ 48, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0,
+ 148, 141, 135, 141, 141, 0, 0, 0, 141, 141, 141, 0, 149, 149, 149, 144,
+ 0, 0, 48, 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 150, 150, 150, 26,
+ 26, 26, 26, 26, 26, 85, 26, 0, 0, 0, 0, 0, 135, 141, 141, 141, 135, 48,
+ 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 147,
+ 48, 135, 135, 135, 141, 141, 141, 141, 0, 135, 135, 152, 0, 135, 135,
+ 135, 144, 0, 0, 0, 0, 0, 0, 0, 153, 154, 0, 48, 48, 48, 0, 0, 48, 0, 0,
+ 48, 48, 135, 135, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 0, 0, 0, 0, 0, 0, 0, 83, 155, 155, 155, 155, 155, 155, 155, 80, 48, 135,
+ 141, 141, 83, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48,
+ 48, 0, 0, 147, 48, 141, 156, 149, 141, 148, 141, 141, 0, 156, 149, 149,
+ 0, 149, 149, 135, 144, 0, 0, 0, 0, 0, 0, 0, 148, 148, 0, 0, 0, 0, 0, 0,
+ 48, 48, 0, 48, 48, 135, 135, 0, 0, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 0, 48, 48, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135,
+ 135, 141, 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 0, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 144, 144, 48, 148, 141, 141, 135, 135, 135, 135, 0, 141,
+ 141, 141, 0, 149, 149, 149, 144, 48, 80, 0, 0, 0, 0, 48, 48, 48, 148,
+ 150, 150, 150, 150, 150, 150, 150, 48, 48, 48, 135, 135, 0, 0, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 80, 48, 48, 48, 48, 48, 48, 0, 135, 141, 141, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 0,
+ 0, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 157, 0, 0, 0, 0, 148, 141, 141,
+ 135, 135, 135, 0, 135, 0, 141, 141, 149, 141, 149, 149, 149, 148, 0, 0,
+ 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 141,
+ 141, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 135, 48, 158, 135, 135, 135, 135, 159, 159, 144, 0,
+ 0, 0, 0, 85, 48, 48, 48, 48, 48, 48, 53, 135, 160, 160, 160, 160, 135,
+ 135, 135, 83, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 83, 83,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 0, 48, 0, 48, 48, 48, 48,
+ 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 135, 48, 158, 135, 135, 135, 135, 161, 161, 144, 135, 135, 48, 0,
+ 0, 48, 48, 48, 48, 48, 0, 53, 0, 162, 162, 162, 162, 135, 135, 135, 0,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 158, 158, 48, 48,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 48, 80, 80, 80, 83, 83, 83, 83, 83, 83, 83, 83,
+ 163, 83, 83, 83, 83, 83, 83, 80, 83, 80, 80, 80, 86, 86, 80, 80, 80, 80,
+ 80, 80, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 80, 86, 80, 86, 80, 164, 165, 166,
+ 165, 166, 141, 141, 48, 48, 48, 145, 48, 48, 48, 48, 0, 48, 48, 48, 48,
+ 145, 48, 48, 48, 48, 145, 48, 48, 48, 48, 145, 48, 48, 48, 48, 145, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 145, 48, 48, 48, 0, 0, 0, 0,
+ 167, 168, 169, 170, 169, 169, 171, 169, 171, 168, 168, 168, 168, 135,
+ 141, 168, 169, 81, 81, 144, 83, 81, 81, 48, 48, 48, 48, 48, 135, 135,
+ 135, 135, 135, 135, 169, 135, 135, 135, 135, 0, 135, 135, 135, 135, 169,
+ 135, 135, 135, 135, 169, 135, 135, 135, 135, 169, 135, 135, 135, 135,
+ 169, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 169,
+ 135, 135, 135, 0, 80, 80, 80, 80, 80, 80, 80, 80, 86, 80, 80, 80, 80, 80,
+ 80, 0, 80, 80, 83, 83, 83, 83, 83, 80, 80, 80, 80, 83, 83, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 142, 48, 48, 48, 48, 141, 141, 135, 151,
+ 135, 135, 141, 135, 135, 135, 135, 135, 147, 141, 144, 144, 141, 141,
+ 135, 135, 48, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 83, 83,
+ 83, 83, 83, 83, 48, 48, 48, 48, 48, 48, 141, 141, 135, 135, 48, 48, 48,
+ 48, 135, 135, 135, 48, 141, 141, 141, 48, 48, 141, 141, 141, 141, 141,
+ 141, 141, 48, 48, 48, 135, 135, 135, 135, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 135, 141, 141, 135, 135, 141, 141, 141, 141, 141,
+ 141, 86, 48, 141, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 141,
+ 141, 141, 135, 80, 80, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 0, 44, 0, 0, 0, 0, 0, 44, 0, 0, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 83, 51, 47, 47, 47, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 48, 173, 173, 173, 173, 173, 173, 173, 173,
+ 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 173, 173, 173, 173, 173,
+ 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
+ 173, 173, 173, 173, 173, 173, 173, 173, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 48,
+ 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48,
+ 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48,
+ 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 81,
+ 81, 81, 83, 83, 83, 83, 83, 83, 83, 83, 83, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0,
+ 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 0, 0, 47, 47, 47, 47, 47, 47, 0, 0,
+ 84, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 80, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 174, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 165, 166, 0,
+ 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 83, 83, 83, 175, 175, 175, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 135, 135, 144, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 135, 135, 176, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 48, 48, 48, 0, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135,
+ 141, 135, 135, 135, 135, 135, 135, 135, 141, 141, 141, 141, 141, 141,
+ 141, 141, 135, 141, 141, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 144, 135, 83, 83, 83, 53, 83, 83, 83, 85, 48, 81, 0, 0, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 155, 155, 155, 155,
+ 155, 155, 155, 155, 155, 155, 0, 0, 0, 0, 0, 0, 138, 138, 138, 138, 138,
+ 138, 84, 138, 138, 138, 138, 135, 135, 135, 177, 135, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 135, 135, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 88, 48, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 135, 135, 135, 141, 141, 141, 141,
+ 135, 135, 141, 141, 141, 0, 0, 0, 0, 141, 141, 135, 141, 141, 141, 141,
+ 141, 141, 87, 81, 86, 0, 0, 0, 0, 26, 0, 0, 0, 138, 138, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 150, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 81, 86, 141, 141, 135, 0, 0, 83, 83, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 135, 141,
+ 135, 135, 135, 135, 135, 135, 135, 0, 144, 141, 135, 141, 141, 135, 135,
+ 135, 135, 135, 135, 135, 135, 141, 141, 141, 141, 141, 141, 135, 135, 81,
+ 81, 81, 81, 81, 81, 81, 81, 0, 0, 86, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 0, 0, 0, 0, 0, 0, 83, 83, 83, 83, 83, 83, 83, 53, 83, 83, 83,
+ 83, 83, 83, 0, 0, 81, 81, 81, 81, 81, 86, 86, 86, 86, 86, 86, 81, 81, 86,
+ 82, 86, 86, 81, 81, 86, 86, 81, 81, 81, 81, 81, 86, 81, 81, 81, 81, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135,
+ 135, 135, 135, 141, 48, 142, 48, 142, 48, 142, 48, 142, 48, 142, 48, 48,
+ 48, 142, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 147,
+ 148, 135, 135, 135, 135, 135, 149, 135, 149, 141, 141, 149, 149, 135,
+ 149, 176, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 83, 83, 83, 83, 83, 83, 83, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 81, 86, 81, 81, 81, 81, 81, 81, 81, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 83, 83, 0, 135, 135, 141, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 141, 135, 135, 135, 135, 141, 141, 135, 135, 176,
+ 144, 135, 135, 48, 48, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 147, 141, 135, 135, 141, 141, 141, 135,
+ 141, 135, 135, 135, 176, 176, 0, 0, 0, 0, 0, 0, 0, 0, 83, 83, 83, 83, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141,
+ 141, 141, 141, 141, 141, 141, 141, 135, 135, 135, 135, 135, 135, 135,
+ 135, 141, 141, 135, 147, 0, 0, 0, 83, 83, 83, 83, 83, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 0, 0, 0, 48, 48, 48, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 53, 53, 53, 53, 53, 53, 83, 83, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 0, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 0, 0, 44, 44, 44, 83, 83,
+ 83, 83, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 81, 83, 178, 86,
+ 86, 86, 86, 86, 81, 81, 86, 86, 86, 86, 81, 141, 178, 178, 178, 178, 178,
+ 178, 178, 48, 48, 48, 48, 86, 48, 48, 48, 48, 48, 48, 81, 48, 48, 141,
+ 81, 81, 48, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 51, 51, 51,
+ 53, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 53, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 53, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 51, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 81, 81, 86, 81, 81, 81, 81, 81, 81, 81, 86, 81, 81, 179, 180, 86,
+ 181, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 182, 88, 88, 86, 183, 81, 184, 86, 81, 86, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 43, 43, 43, 43, 35, 185, 47, 47, 44, 47, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 38,
+ 43, 38, 43, 38, 43, 38, 43, 38, 43, 38, 43, 44, 47, 44, 47, 44, 47, 43,
+ 43, 43, 43, 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43, 43, 43,
+ 43, 43, 43, 0, 0, 38, 38, 38, 38, 38, 38, 0, 0, 43, 43, 43, 43, 43, 43,
+ 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43, 43, 43,
+ 38, 38, 38, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 43, 0, 0, 38, 38, 38,
+ 38, 38, 38, 0, 0, 43, 43, 43, 43, 43, 43, 43, 43, 0, 38, 0, 38, 0, 38, 0,
+ 38, 43, 43, 43, 43, 43, 43, 43, 43, 38, 38, 38, 38, 38, 38, 38, 38, 43,
+ 186, 43, 186, 43, 186, 43, 186, 43, 186, 43, 186, 43, 186, 0, 0, 43, 43,
+ 43, 43, 43, 43, 43, 43, 187, 187, 187, 187, 187, 187, 187, 187, 43, 43,
+ 43, 43, 43, 43, 43, 43, 187, 187, 187, 187, 187, 187, 187, 187, 43, 43,
+ 43, 43, 43, 43, 43, 43, 187, 187, 187, 187, 187, 187, 187, 187, 43, 43,
+ 43, 43, 43, 0, 43, 43, 38, 38, 38, 188, 187, 58, 186, 58, 58, 76, 43, 43,
+ 43, 0, 43, 43, 38, 188, 38, 188, 187, 76, 76, 76, 43, 43, 43, 186, 0, 0,
+ 43, 43, 38, 38, 38, 188, 0, 76, 76, 76, 43, 43, 43, 186, 43, 43, 43, 43,
+ 38, 38, 38, 188, 38, 76, 189, 189, 0, 0, 43, 43, 43, 0, 43, 43, 38, 188,
+ 38, 188, 187, 189, 58, 0, 190, 190, 191, 191, 191, 191, 191, 191, 191,
+ 191, 191, 177, 177, 177, 192, 193, 194, 195, 84, 194, 194, 194, 22, 196,
+ 197, 198, 199, 200, 197, 198, 199, 200, 22, 22, 22, 138, 201, 201, 201,
+ 22, 202, 203, 204, 205, 206, 207, 208, 21, 209, 110, 209, 210, 211, 22,
+ 196, 196, 138, 28, 36, 22, 196, 138, 201, 212, 212, 138, 138, 138, 213,
+ 165, 166, 196, 196, 196, 138, 138, 138, 138, 138, 138, 138, 138, 78, 138,
+ 212, 138, 138, 196, 138, 138, 138, 138, 138, 138, 138, 191, 177, 177,
+ 177, 177, 177, 0, 214, 215, 216, 217, 177, 177, 177, 177, 177, 177, 218,
+ 51, 0, 0, 34, 218, 218, 218, 218, 218, 219, 219, 220, 221, 222, 223, 218,
+ 34, 34, 34, 34, 218, 218, 218, 218, 218, 219, 219, 220, 221, 222, 0, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, 0, 0, 85, 85, 85, 85,
+ 85, 85, 85, 85, 224, 225, 85, 85, 23, 85, 85, 85, 85, 85, 85, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 81, 81, 178, 178, 81, 81, 81, 81, 178, 178, 178, 81, 81,
+ 82, 82, 82, 82, 81, 82, 82, 82, 178, 178, 81, 86, 81, 178, 178, 86, 86,
+ 86, 86, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 226, 49,
+ 227, 26, 227, 226, 49, 26, 227, 35, 49, 49, 49, 35, 35, 49, 49, 49, 46,
+ 26, 49, 227, 26, 78, 49, 49, 49, 49, 49, 26, 26, 226, 227, 227, 26, 49,
+ 26, 228, 26, 49, 26, 188, 228, 49, 49, 229, 35, 49, 49, 44, 49, 35, 158,
+ 158, 158, 158, 35, 26, 226, 35, 35, 49, 49, 230, 78, 78, 78, 78, 49, 35,
+ 35, 35, 35, 26, 78, 26, 26, 47, 80, 231, 231, 231, 37, 37, 231, 231, 231,
+ 231, 231, 231, 37, 37, 37, 37, 231, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 233, 233, 233, 233, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 232, 233, 233, 233, 233, 233, 233, 175, 175, 175, 44,
+ 47, 175, 175, 175, 175, 37, 26, 26, 0, 0, 0, 0, 40, 40, 40, 40, 40, 30,
+ 30, 30, 30, 30, 234, 234, 26, 26, 26, 26, 78, 26, 26, 78, 26, 26, 78, 26,
+ 26, 26, 26, 26, 26, 26, 234, 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 30,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 235, 234, 234, 26, 26, 40, 26, 40, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 40,
+ 236, 237, 237, 238, 78, 78, 40, 237, 238, 236, 237, 238, 236, 78, 40, 78,
+ 237, 239, 240, 78, 237, 236, 78, 78, 78, 237, 236, 236, 237, 40, 237,
+ 237, 236, 236, 40, 238, 40, 238, 40, 40, 40, 40, 237, 241, 230, 237, 230,
+ 230, 236, 236, 236, 40, 40, 40, 40, 78, 236, 78, 236, 237, 237, 236, 236,
+ 236, 238, 236, 236, 238, 236, 236, 238, 237, 238, 236, 236, 237, 78, 78,
+ 78, 78, 78, 237, 236, 236, 236, 78, 78, 78, 78, 78, 78, 78, 78, 78, 236,
+ 242, 40, 238, 78, 237, 237, 237, 237, 236, 236, 237, 237, 78, 234, 242,
+ 242, 238, 238, 236, 236, 238, 238, 236, 236, 238, 238, 236, 236, 236,
+ 236, 236, 236, 238, 238, 237, 237, 238, 238, 237, 237, 238, 238, 236,
+ 236, 236, 78, 78, 236, 236, 236, 236, 78, 78, 40, 78, 78, 236, 40, 78,
+ 78, 78, 78, 78, 78, 78, 78, 236, 236, 78, 40, 236, 236, 236, 236, 236,
+ 236, 238, 238, 238, 238, 236, 236, 236, 236, 236, 236, 236, 236, 236, 78,
+ 78, 78, 78, 78, 236, 237, 78, 78, 78, 78, 78, 78, 78, 78, 78, 236, 236,
+ 236, 236, 236, 78, 78, 236, 236, 78, 78, 78, 78, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 238, 238, 238, 238, 236, 236, 236, 236, 236,
+ 236, 238, 238, 238, 238, 78, 78, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 26, 26, 26, 26, 26, 26, 26, 26,
+ 165, 166, 165, 166, 26, 26, 26, 26, 26, 26, 30, 26, 26, 26, 26, 26, 26,
+ 26, 243, 243, 26, 26, 26, 26, 236, 236, 26, 26, 26, 26, 26, 26, 26, 244,
+ 245, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 26, 78, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 80,
+ 26, 26, 26, 26, 26, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 78, 78,
+ 78, 78, 78, 78, 26, 26, 26, 26, 26, 26, 26, 243, 243, 243, 243, 26, 26,
+ 26, 243, 26, 26, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 231, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 26, 26, 26, 26, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 26,
+ 26, 30, 30, 30, 30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 30, 26,
+ 30, 30, 30, 30, 30, 30, 30, 26, 26, 26, 26, 26, 26, 26, 26, 30, 30, 26,
+ 26, 30, 40, 26, 26, 26, 26, 30, 30, 26, 26, 30, 40, 26, 26, 26, 26, 30,
+ 30, 30, 26, 26, 30, 26, 26, 30, 30, 30, 30, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 30, 30, 30, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 30, 26, 26, 26, 26, 26, 26, 26, 26, 78, 78, 78, 78, 78,
+ 248, 248, 78, 26, 26, 26, 26, 26, 30, 30, 26, 26, 30, 26, 26, 26, 26, 30,
+ 30, 26, 26, 26, 26, 243, 243, 26, 26, 26, 26, 26, 26, 30, 26, 30, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 26, 30, 26, 26,
+ 26, 26, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 30, 26, 30, 30, 30,
+ 26, 30, 30, 30, 30, 26, 30, 30, 26, 40, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 30, 30, 26, 243, 26, 26, 26, 26, 26, 26, 26, 26, 243, 243, 80,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 243,
+ 30, 26, 26, 26, 26, 243, 243, 30, 30, 30, 30, 30, 30, 30, 30, 243, 30,
+ 30, 30, 30, 30, 243, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 26, 30, 26, 26, 26, 26, 30, 30, 243, 30, 30, 30, 30, 30, 30, 30, 243,
+ 243, 30, 243, 30, 30, 30, 30, 243, 30, 30, 243, 30, 30, 26, 26, 26, 26,
+ 26, 243, 26, 26, 26, 26, 243, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 30, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 243, 26, 243, 26, 26, 26, 26, 243, 243, 243, 26, 243, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 165, 166, 165, 166, 165,
+ 166, 165, 166, 165, 166, 165, 166, 165, 166, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 155, 155, 155, 155, 155, 155, 155, 155, 155,
+ 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 26, 243, 243, 243,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 243, 236, 78, 78, 236, 236, 165, 166, 78, 236, 236, 78, 236,
+ 236, 236, 78, 78, 78, 78, 78, 236, 236, 236, 236, 78, 78, 78, 78, 78,
+ 236, 236, 236, 78, 78, 78, 236, 236, 236, 236, 9, 10, 9, 10, 9, 10, 9,
+ 10, 165, 166, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 165, 166, 9, 10, 165, 166, 165, 166, 165,
+ 166, 165, 166, 165, 166, 165, 166, 165, 166, 165, 166, 165, 166, 78, 78,
+ 236, 236, 236, 236, 236, 236, 78, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 78, 78, 78, 78, 78, 78, 78, 78, 236, 78,
+ 78, 78, 78, 78, 78, 78, 236, 236, 236, 236, 236, 236, 78, 78, 78, 236,
+ 78, 78, 78, 78, 236, 236, 236, 236, 236, 78, 236, 236, 78, 78, 165, 166,
+ 165, 166, 236, 78, 78, 78, 78, 236, 78, 236, 236, 236, 78, 78, 236, 236,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 236, 236, 236, 236, 236, 236, 78,
+ 78, 165, 166, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 236, 236,
+ 230, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 78, 236, 236, 236, 236, 78, 78, 236, 78, 236, 78, 78, 236,
+ 78, 236, 236, 236, 236, 78, 78, 78, 78, 78, 236, 236, 78, 78, 78, 78, 78,
+ 78, 236, 236, 236, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 236, 236, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 236, 236, 78, 78, 78, 78, 236, 236, 236, 236, 78,
+ 236, 236, 78, 78, 236, 230, 220, 220, 78, 78, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 78, 78, 236, 236, 236,
+ 236, 236, 236, 236, 236, 78, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
+ 236, 236, 236, 78, 78, 78, 78, 78, 249, 78, 236, 78, 78, 78, 236, 236,
+ 236, 236, 236, 78, 78, 78, 78, 78, 236, 236, 236, 78, 78, 78, 78, 236,
+ 78, 78, 78, 236, 236, 236, 236, 236, 78, 236, 78, 78, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 243, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
+ 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 26, 26, 78, 78, 78, 78, 78, 78,
+ 26, 26, 26, 243, 26, 26, 26, 26, 243, 30, 30, 30, 30, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 250, 26, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 44, 47, 44, 44, 44, 47, 47, 44, 47, 44, 47, 44, 47, 44,
+ 44, 44, 44, 47, 44, 47, 47, 44, 47, 47, 47, 47, 47, 47, 51, 51, 44, 44,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 47, 26, 26, 26, 26, 26, 26, 44,
+ 47, 44, 47, 81, 81, 81, 44, 47, 0, 0, 0, 0, 0, 138, 138, 138, 138, 155,
+ 138, 138, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 0, 47, 0, 0, 0, 0, 0, 47, 0, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0,
+ 0, 51, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48,
+ 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48,
+ 48, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48,
+ 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 0, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 138, 138, 28, 36, 28, 36, 138,
+ 138, 138, 28, 36, 138, 28, 36, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 84, 138, 138, 84, 138, 28, 36, 138, 138, 28, 36, 165, 166, 165, 166,
+ 165, 166, 165, 166, 138, 138, 138, 138, 138, 52, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 138, 84, 84, 138, 138, 138, 138, 84, 138, 199, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 26, 26, 138,
+ 138, 138, 165, 166, 165, 166, 165, 166, 165, 166, 84, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 0,
+ 243, 243, 243, 243, 251, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
+ 251, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 0, 0, 0, 0, 252, 253, 253, 253, 243, 254, 172, 255, 256, 257, 256,
+ 257, 256, 257, 256, 257, 256, 257, 243, 243, 256, 257, 256, 257, 256,
+ 257, 256, 257, 258, 259, 260, 260, 243, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 261, 262, 263, 264, 265, 265, 258, 254, 254, 254, 254,
+ 254, 251, 243, 266, 266, 266, 254, 172, 253, 243, 26, 0, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 267, 172, 267, 172, 267, 172,
+ 267, 172, 267, 172, 267, 172, 267, 172, 267, 172, 267, 172, 267, 172,
+ 267, 172, 267, 172, 172, 267, 172, 267, 172, 267, 172, 172, 172, 172,
+ 172, 172, 267, 267, 172, 267, 267, 172, 267, 267, 172, 267, 267, 172,
+ 267, 267, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 267, 172, 172, 0, 0,
+ 268, 268, 269, 269, 254, 270, 271, 258, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 267, 172, 267, 172, 267, 172, 267, 172, 267,
+ 172, 267, 172, 267, 172, 267, 172, 267, 172, 267, 172, 267, 172, 267,
+ 172, 172, 267, 172, 267, 172, 267, 172, 172, 172, 172, 172, 172, 267,
+ 267, 172, 267, 267, 172, 267, 267, 172, 267, 267, 172, 267, 267, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 267, 172, 172, 267, 267, 267, 267,
+ 253, 254, 254, 270, 271, 0, 0, 0, 0, 0, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 0, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
+ 271, 271, 271, 271, 271, 0, 272, 272, 273, 273, 273, 273, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 251, 251, 0, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 275, 275, 275, 275, 275, 275, 275, 275, 251, 276, 276, 276, 276,
+ 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 251, 251, 251,
+ 272, 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 276, 276, 276, 276, 276, 276,
+ 276, 276, 276, 276, 276, 276, 276, 276, 276, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 251, 251, 251, 251, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 251, 251, 251, 251,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 251, 251, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 251, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 254, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 0, 0, 0, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 53, 53, 53, 53, 53, 53, 83, 83, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 138, 138, 138, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 48, 81,
+ 82, 82, 82, 138, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 138, 52, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47,
+ 44, 47, 44, 47, 44, 47, 44, 47, 51, 51, 81, 81, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 81, 81, 83, 83, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 54, 54, 54, 54, 52, 52, 52, 52, 52, 52, 52, 52, 52, 54, 54, 44,
+ 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 47, 47, 44, 47, 44,
+ 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44,
+ 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44,
+ 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44,
+ 47, 44, 47, 44, 47, 51, 47, 47, 47, 47, 47, 47, 47, 47, 44, 47, 44, 47,
+ 44, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 52, 277, 277, 44, 47, 44, 47,
+ 48, 44, 47, 44, 47, 47, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44,
+ 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 44, 44, 44, 44, 47, 44, 44, 44,
+ 44, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44, 47, 44,
+ 44, 44, 44, 47, 44, 47, 0, 0, 0, 0, 0, 44, 47, 0, 47, 0, 47, 44, 47, 44,
+ 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 51, 51, 51, 44, 47, 48, 51, 51, 47, 48, 48, 48, 48, 48, 48, 48, 135,
+ 48, 48, 48, 144, 48, 48, 48, 48, 135, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141, 135,
+ 135, 141, 26, 26, 26, 26, 144, 0, 0, 0, 150, 150, 150, 150, 150, 150, 80,
+ 80, 85, 229, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 138, 138, 138, 138, 0, 0, 0, 0, 0, 0, 0, 0, 141,
+ 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 144, 135, 0, 0, 0, 0, 0, 0, 0, 0, 83, 83, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 48, 48, 48, 48, 48, 48, 83, 83, 83,
+ 48, 83, 48, 48, 135, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 135, 135, 135, 86, 86,
+ 86, 83, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 141, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 0, 0, 0,
+ 135, 135, 135, 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 147, 141,
+ 141, 135, 135, 135, 135, 141, 141, 135, 135, 141, 141, 176, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 0, 53, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 0, 0, 0, 0, 83, 83, 48, 48, 48, 48, 48, 135, 53,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 135,
+ 135, 135, 135, 141, 141, 135, 135, 141, 141, 135, 135, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 48, 48, 48, 135, 48, 48, 48, 48, 48, 48, 48, 48, 135, 141, 0, 0,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 83, 83, 83, 83,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 48,
+ 48, 48, 48, 48, 48, 80, 80, 80, 48, 141, 135, 141, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 81, 48, 81, 81, 86, 48, 48, 81, 81,
+ 48, 48, 48, 48, 48, 81, 81, 48, 81, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 53, 83, 83, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 141, 135, 135, 141, 141, 83, 83, 48, 53,
+ 53, 141, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 0, 0,
+ 48, 48, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 277, 51, 51, 51, 51, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 51, 54, 54, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141,
+ 135, 141, 141, 135, 141, 141, 83, 141, 144, 0, 0, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, 267,
+ 267, 267, 267, 267, 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 0, 0, 0, 0, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ 278, 278, 278, 278, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 172, 172, 280, 172, 280, 172,
+ 172, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 172, 280, 172,
+ 280, 172, 172, 280, 280, 172, 172, 172, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 281, 281, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 35, 35, 35,
+ 35, 35, 35, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 35,
+ 0, 0, 0, 0, 0, 282, 283, 282, 284, 284, 284, 284, 284, 284, 284, 284,
+ 284, 219, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
+ 282, 0, 282, 282, 282, 282, 282, 0, 282, 0, 282, 282, 0, 282, 282, 0,
+ 282, 282, 282, 282, 282, 282, 282, 282, 282, 284, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 140, 140, 140, 140,
+ 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 285, 199, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 0, 0, 0, 0,
+ 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 286, 26, 26, 26, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 287, 287, 287, 287, 287, 287, 287, 288, 289,
+ 287, 0, 0, 0, 0, 0, 0, 81, 81, 81, 81, 81, 81, 81, 86, 86, 86, 86, 86,
+ 86, 86, 81, 81, 287, 290, 290, 291, 291, 288, 289, 288, 289, 288, 289,
+ 288, 289, 288, 289, 288, 289, 288, 289, 288, 289, 253, 253, 288, 289,
+ 287, 287, 287, 287, 291, 291, 291, 292, 287, 292, 0, 287, 292, 287, 287,
+ 290, 293, 294, 293, 294, 293, 294, 295, 287, 287, 296, 297, 298, 298,
+ 299, 0, 287, 300, 295, 287, 0, 0, 0, 0, 131, 131, 131, 118, 131, 0, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 177, 0, 301, 301, 302, 303,
+ 302, 301, 301, 304, 305, 301, 306, 307, 308, 307, 307, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 307, 301, 310, 311, 310, 301, 301,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312,
+ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 304, 301,
+ 305, 313, 314, 313, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, 315,
+ 315, 315, 304, 311, 305, 311, 304, 305, 316, 317, 318, 316, 316, 319,
+ 319, 319, 319, 319, 319, 319, 319, 319, 319, 320, 319, 319, 319, 319,
+ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
+ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
+ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 320,
+ 320, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
+ 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
+ 319, 319, 319, 319, 0, 0, 0, 319, 319, 319, 319, 319, 319, 0, 0, 319,
+ 319, 319, 319, 319, 319, 0, 0, 319, 319, 319, 319, 319, 319, 0, 0, 319,
+ 319, 319, 0, 0, 0, 303, 303, 311, 313, 321, 303, 303, 0, 322, 323, 323,
+ 323, 323, 322, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 324, 324, 324, 26, 30,
+ 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 0, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 83, 138, 83, 0, 0, 0, 0, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 0, 0, 0, 80, 80, 80, 80, 80, 80, 80, 80, 80, 325, 325, 325,
+ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325,
+ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325,
+ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, 325,
+ 325, 325, 325, 325, 325, 325, 325, 325, 155, 155, 155, 155, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 155, 155, 26, 80,
+ 80, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 26,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,
+ 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326,
+ 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, 0, 0, 0,
+ 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 150, 150,
+ 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 175, 48, 48, 48, 48, 48, 48,
+ 48, 48, 175, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 81, 81, 81, 81, 81, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 83, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 48,
+ 48, 48, 48, 48, 48, 48, 48, 83, 175, 175, 175, 175, 175, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0,
+ 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 0, 44, 44, 44, 44, 44, 44, 44, 0, 44, 44, 0, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 0, 47, 47, 47, 47, 47, 47, 47, 0, 47, 47, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 53, 51, 51, 51, 51, 51, 0, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 107, 107, 107, 107, 107, 107, 0, 0, 107, 0, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 107, 107,
+ 0, 0, 0, 107, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 104,
+ 327, 327, 327, 327, 327, 327, 327, 327, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 328, 328, 327, 327, 327, 327, 327, 327, 327, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 0, 0, 0, 0, 0, 0, 0, 0, 327, 327, 327, 327, 327, 327, 327, 327, 327,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 0, 107, 107, 0, 0, 0, 0, 0, 327, 327, 327, 327,
+ 327, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 327, 327, 327, 327, 327,
+ 327, 0, 0, 0, 138, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0,
+ 0, 0, 0, 327, 327, 107, 107, 327, 327, 327, 327, 327, 327, 327, 327, 327,
+ 327, 327, 327, 327, 327, 327, 327, 0, 0, 327, 327, 327, 327, 327, 327,
+ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
+ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
+ 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, 107, 135,
+ 135, 135, 0, 135, 135, 0, 0, 0, 0, 0, 135, 86, 135, 81, 107, 107, 107,
+ 107, 0, 107, 107, 107, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 0, 0, 81, 178, 86, 0, 0, 0, 0, 144, 327,
+ 327, 327, 327, 327, 327, 327, 327, 327, 0, 0, 0, 0, 0, 0, 0, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 327, 327,
+ 104, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 327, 327, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 107,
+ 107, 107, 107, 328, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 81, 86, 0, 0, 0, 0, 327, 327, 327, 327, 327, 104,
+ 104, 104, 104, 104, 104, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 138, 138, 138, 138,
+ 138, 138, 138, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 327, 327,
+ 327, 327, 327, 327, 327, 327, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 0, 0,
+ 327, 327, 327, 327, 327, 327, 327, 327, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 0,
+ 0, 0, 0, 104, 104, 104, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 327,
+ 327, 327, 327, 327, 327, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329,
+ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329,
+ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329,
+ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 0, 0, 0,
+ 0, 0, 0, 0, 327, 327, 327, 327, 327, 327, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 81, 81, 81, 81, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
+ 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
+ 331, 331, 331, 331, 331, 331, 331, 0, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 0, 81, 81, 102, 0, 0, 107, 107, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 86, 86, 86, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 327, 327, 327, 327, 327, 327, 327, 327, 327, 327,
+ 107, 0, 0, 0, 0, 0, 0, 0, 0, 118, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 86, 86,
+ 81, 81, 81, 86, 81, 86, 86, 86, 86, 332, 332, 332, 332, 113, 113, 113,
+ 113, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 81, 86, 81, 86, 104, 104, 104, 104, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 327, 327, 327,
+ 327, 327, 327, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 141, 135, 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 144, 83, 83, 83, 83, 83, 83, 83, 0, 0, 0, 0, 155, 155, 155,
+ 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
+ 155, 155, 155, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 144, 48,
+ 48, 135, 135, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 135, 135, 141, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 142, 48, 142, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 142, 48, 48, 48, 48, 141, 141, 141, 135, 135, 135, 135, 141, 141,
+ 144, 143, 83, 83, 192, 83, 83, 83, 83, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 192, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 81, 81, 81, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 151,
+ 135, 135, 135, 135, 141, 135, 152, 152, 135, 135, 135, 144, 144, 0, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 83, 83, 83, 83, 48, 141,
+ 141, 48, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 147, 83, 83, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 135, 135, 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141,
+ 141, 135, 135, 135, 135, 135, 135, 135, 135, 135, 141, 176, 48, 48, 48,
+ 48, 83, 83, 83, 83, 135, 147, 135, 135, 83, 141, 135, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 48, 83, 48, 83, 83, 83, 0, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 141, 141, 141, 135, 135, 135, 141, 141, 135, 176, 147, 135, 83,
+ 83, 83, 83, 83, 83, 135, 48, 48, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 0, 48, 48, 48, 48, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 83, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 135, 141, 141, 141, 135, 135, 135, 135, 135, 135, 147,
+ 144, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0,
+ 0, 0, 0, 0, 0, 135, 135, 141, 141, 0, 48, 48, 48, 48, 48, 48, 48, 48, 0,
+ 0, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48,
+ 0, 48, 48, 48, 48, 48, 0, 147, 147, 48, 148, 141, 135, 141, 141, 141,
+ 141, 0, 0, 141, 141, 0, 0, 149, 149, 176, 0, 0, 48, 0, 0, 0, 0, 0, 0,
+ 148, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 141, 141, 0, 0, 81, 81, 81, 81,
+ 81, 81, 81, 0, 0, 0, 81, 81, 81, 81, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141,
+ 141, 141, 135, 135, 135, 135, 135, 135, 135, 135, 141, 141, 144, 135,
+ 135, 141, 147, 48, 48, 48, 48, 83, 83, 83, 83, 83, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 83, 83, 0, 83, 81, 48, 48, 48, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 148, 141, 141, 135,
+ 135, 135, 135, 135, 135, 141, 151, 149, 149, 148, 149, 135, 135, 141,
+ 144, 147, 48, 48, 83, 48, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 148, 141, 141, 135, 135, 135,
+ 135, 0, 0, 141, 141, 149, 149, 135, 135, 141, 144, 147, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 48, 48, 48, 48, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141, 141, 135, 135, 135, 135,
+ 135, 135, 135, 135, 141, 141, 135, 141, 144, 135, 83, 83, 83, 48, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 0, 0, 0, 0, 0, 0, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 135, 141, 135, 141, 141, 135, 135, 135, 135,
+ 135, 135, 176, 147, 48, 83, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 135, 135, 135, 141, 141, 135, 135, 135, 135, 141, 135, 135,
+ 135, 135, 144, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 150, 150, 83, 83, 83, 80, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141, 141, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 141, 144, 147, 83, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 48, 0, 0, 48, 48, 48,
+ 48, 48, 48, 48, 48, 0, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 148, 141, 141,
+ 141, 141, 141, 0, 141, 149, 0, 0, 135, 135, 176, 144, 48, 141, 48, 141,
+ 147, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 141,
+ 141, 135, 135, 135, 135, 0, 0, 135, 135, 141, 141, 141, 141, 144, 48, 83,
+ 48, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 48, 135, 135, 135, 135, 135, 135, 156, 156, 135, 135,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 135, 144, 135, 135, 135, 135, 141, 48, 135, 135, 135,
+ 135, 83, 83, 83, 83, 83, 83, 83, 83, 144, 0, 0, 0, 0, 0, 0, 0, 0, 48,
+ 135, 135, 135, 135, 135, 135, 141, 141, 135, 135, 135, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 141, 135, 144, 83, 83, 83, 48, 83, 83, 83, 83, 83, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 141, 135,
+ 135, 135, 135, 135, 135, 135, 0, 135, 135, 135, 135, 135, 135, 141, 333,
+ 48, 83, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0, 83, 83,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 0, 141, 135, 135, 135, 135, 135, 135, 135, 141, 135,
+ 135, 141, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 0, 48, 48, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 135, 135, 135, 135, 135, 135, 0, 0, 0, 135, 0, 135, 135, 0, 135, 135,
+ 135, 147, 135, 144, 144, 48, 135, 0, 0, 0, 0, 0, 0, 0, 0, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 0, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 141, 141, 141, 141, 141, 0, 135, 135, 0, 141, 141, 135, 141, 144, 48, 0,
+ 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 135, 135, 141, 141, 83, 83, 0, 0,
+ 0, 0, 0, 0, 0, 135, 135, 48, 141, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 141, 141, 135, 135, 135, 135, 135, 0, 0, 0, 141, 141, 135, 176,
+ 144, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 26, 26, 26, 26, 26, 26, 26, 26, 85, 85, 85, 85, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 0,
+ 83, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 192, 192, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 135, 48, 48, 48, 48, 48, 48, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 83,
+ 83, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 0, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 0, 0, 178, 178, 178, 178, 178, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 81, 81, 81, 81, 81, 81,
+ 81, 83, 83, 83, 83, 83, 80, 80, 80, 80, 53, 53, 53, 53, 83, 80, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0,
+ 150, 150, 150, 150, 150, 150, 150, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 0, 0, 0, 0, 135, 48, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 0, 0, 0, 0, 0, 0, 0, 135, 135, 135, 135, 53, 53, 53, 53,
+ 53, 53, 53, 53, 53, 53, 53, 53, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 254, 254, 253, 254, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 335, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 254, 254, 254, 0,
+ 254, 254, 254, 254, 254, 254, 254, 0, 254, 254, 0, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 172, 172, 172, 0, 0, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 172, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 0, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 0, 0, 80, 135, 178, 83, 177, 177, 177, 177, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 0, 0, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 0, 0, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 336, 336,
+ 336, 336, 336, 336, 336, 337, 337, 178, 178, 178, 80, 80, 80, 338, 337,
+ 337, 337, 337, 337, 177, 177, 177, 177, 177, 177, 177, 177, 86, 86, 86,
+ 86, 86, 86, 86, 86, 80, 80, 81, 81, 81, 81, 81, 86, 86, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 336, 336, 336, 336, 336, 336, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 81, 81, 81, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 0, 0, 0, 0,
+ 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 0, 49, 49, 0, 0,
+ 49, 0, 0, 49, 49, 0, 0, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49,
+ 49, 35, 35, 35, 35, 0, 35, 0, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 49, 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 49, 49,
+ 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 49, 49, 0, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 49, 49, 0, 49, 49, 49, 49, 0, 49, 49, 49, 49, 49, 0, 49, 0, 0, 0,
+ 49, 49, 49, 49, 49, 49, 49, 0, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 339, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 230, 35, 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 339, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 230, 35, 35, 35, 35, 35, 35, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 339, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 230, 35, 35, 35, 35, 35,
+ 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 339, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 230, 35,
+ 35, 35, 35, 35, 35, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 339, 35, 35, 35, 35, 35,
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
+ 35, 35, 230, 35, 35, 35, 35, 35, 35, 49, 35, 0, 0, 340, 340, 340, 340,
+ 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
+ 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
+ 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340,
+ 340, 340, 340, 340, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 80, 80, 80, 80, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 80,
+ 80, 80, 80, 80, 80, 80, 80, 135, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 135, 80, 80, 83, 83, 83, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 135, 135, 135, 135, 135, 0, 135, 135, 135, 135, 135,
+ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48, 47, 47, 47, 47, 47, 47, 47,
+ 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 47,
+ 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 81, 81, 81,
+ 81, 81, 81, 0, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 0, 0, 81, 81, 81, 81, 81, 81, 81, 0, 81, 81, 0, 81, 81, 81,
+ 81, 81, 0, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 0, 0, 0, 81, 81, 81, 81, 81, 81, 81, 53, 53, 53,
+ 53, 53, 53, 53, 0, 0, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 0, 0, 0, 0, 48, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 81, 81, 81, 81, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 85, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 53, 182, 182, 86, 81,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 48,
+ 48, 48, 48, 48, 48, 0, 48, 48, 48, 48, 0, 48, 48, 0, 48, 48, 48, 48, 48,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 107, 107, 107, 107, 107, 107, 0, 0, 327, 327, 327, 327,
+ 327, 327, 327, 327, 327, 86, 86, 86, 86, 86, 86, 86, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 329, 329, 329, 329, 329, 329, 329, 329,
+ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329,
+ 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330, 330,
+ 330, 330, 330, 330, 81, 81, 81, 81, 81, 81, 147, 137, 0, 0, 0, 0, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 0, 0, 0, 0, 104, 104, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 133, 332, 332, 332, 111, 332, 332, 332, 332, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 133, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,
+ 332, 332, 332, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 131, 131, 131, 131, 0, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 0, 131, 131, 0, 131, 0, 0, 131, 0, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 0, 131, 131, 131, 131, 0, 131, 0, 131, 0,
+ 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 131, 0, 131, 0, 131, 0, 131, 131, 131, 0,
+ 131, 131, 0, 131, 0, 0, 131, 0, 131, 0, 131, 0, 131, 0, 131, 0, 131, 131,
+ 0, 131, 0, 0, 131, 131, 131, 131, 0, 131, 131, 131, 131, 131, 131, 131,
+ 0, 131, 131, 131, 131, 0, 131, 131, 131, 131, 0, 131, 0, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 0, 131, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 0, 0, 0, 131,
+ 131, 131, 0, 131, 131, 131, 131, 131, 0, 131, 131, 131, 131, 131, 131,
+ 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 243, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 0, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 155,
+ 155, 26, 26, 26, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 341, 26, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 342, 342, 342, 342,
+ 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
+ 342, 342, 342, 342, 342, 342, 342, 342, 226, 226, 226, 26, 26, 26, 342,
+ 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
+ 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
+ 342, 272, 342, 246, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
+ 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
+ 342, 342, 342, 342, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
+ 80, 80, 274, 274, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
+ 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, 0,
+ 0, 0, 0, 274, 274, 274, 274, 274, 274, 274, 274, 274, 0, 0, 0, 0, 0, 0,
+ 0, 274, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 243, 243,
+ 243, 243, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 26, 26, 26, 26, 243, 243, 243, 243, 243, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 26, 26, 243, 26, 26, 26,
+ 243, 243, 243, 343, 343, 343, 343, 343, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 26, 243, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 26, 26, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 243,
+ 243, 243, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 243, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 26, 26, 26, 26, 26,
+ 243, 26, 26, 26, 243, 243, 243, 26, 26, 243, 243, 243, 0, 0, 0, 0, 243,
+ 243, 243, 243, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 243, 243, 0,
+ 0, 0, 26, 26, 26, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243, 0, 0,
+ 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 0, 0, 0, 0, 0, 0, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0,
+ 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 0, 0, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 26, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 0, 0, 0, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 0, 0, 0, 0, 0, 0, 0, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 0, 243, 243,
+ 243, 243, 243, 243, 243, 0, 0, 0, 0, 0, 0, 0, 0, 243, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 243, 243, 243, 0, 0, 0, 0, 243, 243, 243,
+ 243, 243, 243, 243, 243, 243, 0, 0, 0, 0, 0, 0, 0, 243, 243, 243, 243,
+ 243, 243, 243, 243, 243, 0, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 340, 340, 340, 340, 340, 340, 340,
+ 340, 340, 0, 0, 0, 0, 0, 0, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 281, 281, 281, 281, 281,
+ 281, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 281, 281, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
+ 280, 280, 280, 280, 280, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 0, 0, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 281, 281, 281,
+ 281, 281, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 0, 177, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
+ 71, 71, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279,
+ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 0, 0,
+};
+
+/* decomposition data */
+static const unsigned int decomp_data[] = {
+ 0, 257, 32, 514, 32, 776, 259, 97, 514, 32, 772, 259, 50, 259, 51, 514,
+ 32, 769, 258, 956, 514, 32, 807, 259, 49, 259, 111, 772, 49, 8260, 52,
+ 772, 49, 8260, 50, 772, 51, 8260, 52, 512, 65, 768, 512, 65, 769, 512,
+ 65, 770, 512, 65, 771, 512, 65, 776, 512, 65, 778, 512, 67, 807, 512, 69,
+ 768, 512, 69, 769, 512, 69, 770, 512, 69, 776, 512, 73, 768, 512, 73,
+ 769, 512, 73, 770, 512, 73, 776, 512, 78, 771, 512, 79, 768, 512, 79,
+ 769, 512, 79, 770, 512, 79, 771, 512, 79, 776, 512, 85, 768, 512, 85,
+ 769, 512, 85, 770, 512, 85, 776, 512, 89, 769, 512, 97, 768, 512, 97,
+ 769, 512, 97, 770, 512, 97, 771, 512, 97, 776, 512, 97, 778, 512, 99,
+ 807, 512, 101, 768, 512, 101, 769, 512, 101, 770, 512, 101, 776, 512,
+ 105, 768, 512, 105, 769, 512, 105, 770, 512, 105, 776, 512, 110, 771,
+ 512, 111, 768, 512, 111, 769, 512, 111, 770, 512, 111, 771, 512, 111,
+ 776, 512, 117, 768, 512, 117, 769, 512, 117, 770, 512, 117, 776, 512,
+ 121, 769, 512, 121, 776, 512, 65, 772, 512, 97, 772, 512, 65, 774, 512,
+ 97, 774, 512, 65, 808, 512, 97, 808, 512, 67, 769, 512, 99, 769, 512, 67,
+ 770, 512, 99, 770, 512, 67, 775, 512, 99, 775, 512, 67, 780, 512, 99,
+ 780, 512, 68, 780, 512, 100, 780, 512, 69, 772, 512, 101, 772, 512, 69,
+ 774, 512, 101, 774, 512, 69, 775, 512, 101, 775, 512, 69, 808, 512, 101,
+ 808, 512, 69, 780, 512, 101, 780, 512, 71, 770, 512, 103, 770, 512, 71,
+ 774, 512, 103, 774, 512, 71, 775, 512, 103, 775, 512, 71, 807, 512, 103,
+ 807, 512, 72, 770, 512, 104, 770, 512, 73, 771, 512, 105, 771, 512, 73,
+ 772, 512, 105, 772, 512, 73, 774, 512, 105, 774, 512, 73, 808, 512, 105,
+ 808, 512, 73, 775, 514, 73, 74, 514, 105, 106, 512, 74, 770, 512, 106,
+ 770, 512, 75, 807, 512, 107, 807, 512, 76, 769, 512, 108, 769, 512, 76,
+ 807, 512, 108, 807, 512, 76, 780, 512, 108, 780, 514, 76, 183, 514, 108,
+ 183, 512, 78, 769, 512, 110, 769, 512, 78, 807, 512, 110, 807, 512, 78,
+ 780, 512, 110, 780, 514, 700, 110, 512, 79, 772, 512, 111, 772, 512, 79,
+ 774, 512, 111, 774, 512, 79, 779, 512, 111, 779, 512, 82, 769, 512, 114,
+ 769, 512, 82, 807, 512, 114, 807, 512, 82, 780, 512, 114, 780, 512, 83,
+ 769, 512, 115, 769, 512, 83, 770, 512, 115, 770, 512, 83, 807, 512, 115,
+ 807, 512, 83, 780, 512, 115, 780, 512, 84, 807, 512, 116, 807, 512, 84,
+ 780, 512, 116, 780, 512, 85, 771, 512, 117, 771, 512, 85, 772, 512, 117,
+ 772, 512, 85, 774, 512, 117, 774, 512, 85, 778, 512, 117, 778, 512, 85,
+ 779, 512, 117, 779, 512, 85, 808, 512, 117, 808, 512, 87, 770, 512, 119,
+ 770, 512, 89, 770, 512, 121, 770, 512, 89, 776, 512, 90, 769, 512, 122,
+ 769, 512, 90, 775, 512, 122, 775, 512, 90, 780, 512, 122, 780, 258, 115,
+ 512, 79, 795, 512, 111, 795, 512, 85, 795, 512, 117, 795, 514, 68, 381,
+ 514, 68, 382, 514, 100, 382, 514, 76, 74, 514, 76, 106, 514, 108, 106,
+ 514, 78, 74, 514, 78, 106, 514, 110, 106, 512, 65, 780, 512, 97, 780,
+ 512, 73, 780, 512, 105, 780, 512, 79, 780, 512, 111, 780, 512, 85, 780,
+ 512, 117, 780, 512, 220, 772, 512, 252, 772, 512, 220, 769, 512, 252,
+ 769, 512, 220, 780, 512, 252, 780, 512, 220, 768, 512, 252, 768, 512,
+ 196, 772, 512, 228, 772, 512, 550, 772, 512, 551, 772, 512, 198, 772,
+ 512, 230, 772, 512, 71, 780, 512, 103, 780, 512, 75, 780, 512, 107, 780,
+ 512, 79, 808, 512, 111, 808, 512, 490, 772, 512, 491, 772, 512, 439, 780,
+ 512, 658, 780, 512, 106, 780, 514, 68, 90, 514, 68, 122, 514, 100, 122,
+ 512, 71, 769, 512, 103, 769, 512, 78, 768, 512, 110, 768, 512, 197, 769,
+ 512, 229, 769, 512, 198, 769, 512, 230, 769, 512, 216, 769, 512, 248,
+ 769, 512, 65, 783, 512, 97, 783, 512, 65, 785, 512, 97, 785, 512, 69,
+ 783, 512, 101, 783, 512, 69, 785, 512, 101, 785, 512, 73, 783, 512, 105,
+ 783, 512, 73, 785, 512, 105, 785, 512, 79, 783, 512, 111, 783, 512, 79,
+ 785, 512, 111, 785, 512, 82, 783, 512, 114, 783, 512, 82, 785, 512, 114,
+ 785, 512, 85, 783, 512, 117, 783, 512, 85, 785, 512, 117, 785, 512, 83,
+ 806, 512, 115, 806, 512, 84, 806, 512, 116, 806, 512, 72, 780, 512, 104,
+ 780, 512, 65, 775, 512, 97, 775, 512, 69, 807, 512, 101, 807, 512, 214,
+ 772, 512, 246, 772, 512, 213, 772, 512, 245, 772, 512, 79, 775, 512, 111,
+ 775, 512, 558, 772, 512, 559, 772, 512, 89, 772, 512, 121, 772, 259, 104,
+ 259, 614, 259, 106, 259, 114, 259, 633, 259, 635, 259, 641, 259, 119,
+ 259, 121, 514, 32, 774, 514, 32, 775, 514, 32, 778, 514, 32, 808, 514,
+ 32, 771, 514, 32, 779, 259, 611, 259, 108, 259, 115, 259, 120, 259, 661,
+ 256, 768, 256, 769, 256, 787, 512, 776, 769, 256, 697, 514, 32, 837, 256,
+ 59, 512, 168, 769, 512, 913, 769, 256, 183, 512, 917, 769, 512, 919, 769,
+ 512, 921, 769, 512, 927, 769, 512, 933, 769, 512, 937, 769, 512, 970,
+ 769, 512, 921, 776, 512, 933, 776, 512, 945, 769, 512, 949, 769, 512,
+ 951, 769, 512, 953, 769, 512, 971, 769, 512, 953, 776, 512, 965, 776,
+ 512, 959, 769, 512, 965, 769, 512, 969, 769, 258, 946, 258, 952, 258,
+ 933, 512, 978, 769, 512, 978, 776, 258, 966, 258, 960, 258, 954, 258,
+ 961, 258, 962, 258, 920, 258, 949, 258, 931, 512, 1045, 768, 512, 1045,
+ 776, 512, 1043, 769, 512, 1030, 776, 512, 1050, 769, 512, 1048, 768, 512,
+ 1059, 774, 512, 1048, 774, 512, 1080, 774, 512, 1077, 768, 512, 1077,
+ 776, 512, 1075, 769, 512, 1110, 776, 512, 1082, 769, 512, 1080, 768, 512,
+ 1091, 774, 512, 1140, 783, 512, 1141, 783, 512, 1046, 774, 512, 1078,
+ 774, 512, 1040, 774, 512, 1072, 774, 512, 1040, 776, 512, 1072, 776, 512,
+ 1045, 774, 512, 1077, 774, 512, 1240, 776, 512, 1241, 776, 512, 1046,
+ 776, 512, 1078, 776, 512, 1047, 776, 512, 1079, 776, 512, 1048, 772, 512,
+ 1080, 772, 512, 1048, 776, 512, 1080, 776, 512, 1054, 776, 512, 1086,
+ 776, 512, 1256, 776, 512, 1257, 776, 512, 1069, 776, 512, 1101, 776, 512,
+ 1059, 772, 512, 1091, 772, 512, 1059, 776, 512, 1091, 776, 512, 1059,
+ 779, 512, 1091, 779, 512, 1063, 776, 512, 1095, 776, 512, 1067, 776, 512,
+ 1099, 776, 514, 1381, 1410, 512, 1575, 1619, 512, 1575, 1620, 512, 1608,
+ 1620, 512, 1575, 1621, 512, 1610, 1620, 514, 1575, 1652, 514, 1608, 1652,
+ 514, 1735, 1652, 514, 1610, 1652, 512, 1749, 1620, 512, 1729, 1620, 512,
+ 1746, 1620, 512, 2344, 2364, 512, 2352, 2364, 512, 2355, 2364, 512, 2325,
+ 2364, 512, 2326, 2364, 512, 2327, 2364, 512, 2332, 2364, 512, 2337, 2364,
+ 512, 2338, 2364, 512, 2347, 2364, 512, 2351, 2364, 512, 2503, 2494, 512,
+ 2503, 2519, 512, 2465, 2492, 512, 2466, 2492, 512, 2479, 2492, 512, 2610,
+ 2620, 512, 2616, 2620, 512, 2582, 2620, 512, 2583, 2620, 512, 2588, 2620,
+ 512, 2603, 2620, 512, 2887, 2902, 512, 2887, 2878, 512, 2887, 2903, 512,
+ 2849, 2876, 512, 2850, 2876, 512, 2962, 3031, 512, 3014, 3006, 512, 3015,
+ 3006, 512, 3014, 3031, 512, 3142, 3158, 512, 3263, 3285, 512, 3270, 3285,
+ 512, 3270, 3286, 512, 3270, 3266, 512, 3274, 3285, 512, 3398, 3390, 512,
+ 3399, 3390, 512, 3398, 3415, 512, 3545, 3530, 512, 3545, 3535, 512, 3548,
+ 3530, 512, 3545, 3551, 514, 3661, 3634, 514, 3789, 3762, 514, 3755, 3737,
+ 514, 3755, 3745, 257, 3851, 512, 3906, 4023, 512, 3916, 4023, 512, 3921,
+ 4023, 512, 3926, 4023, 512, 3931, 4023, 512, 3904, 4021, 512, 3953, 3954,
+ 512, 3953, 3956, 512, 4018, 3968, 514, 4018, 3969, 512, 4019, 3968, 514,
+ 4019, 3969, 512, 3953, 3968, 512, 3986, 4023, 512, 3996, 4023, 512, 4001,
+ 4023, 512, 4006, 4023, 512, 4011, 4023, 512, 3984, 4021, 512, 4133, 4142,
+ 259, 4316, 512, 6917, 6965, 512, 6919, 6965, 512, 6921, 6965, 512, 6923,
+ 6965, 512, 6925, 6965, 512, 6929, 6965, 512, 6970, 6965, 512, 6972, 6965,
+ 512, 6974, 6965, 512, 6975, 6965, 512, 6978, 6965, 259, 65, 259, 198,
+ 259, 66, 259, 68, 259, 69, 259, 398, 259, 71, 259, 72, 259, 73, 259, 74,
+ 259, 75, 259, 76, 259, 77, 259, 78, 259, 79, 259, 546, 259, 80, 259, 82,
+ 259, 84, 259, 85, 259, 87, 259, 592, 259, 593, 259, 7426, 259, 98, 259,
+ 100, 259, 101, 259, 601, 259, 603, 259, 604, 259, 103, 259, 107, 259,
+ 109, 259, 331, 259, 596, 259, 7446, 259, 7447, 259, 112, 259, 116, 259,
+ 117, 259, 7453, 259, 623, 259, 118, 259, 7461, 259, 946, 259, 947, 259,
+ 948, 259, 966, 259, 967, 261, 105, 261, 114, 261, 117, 261, 118, 261,
+ 946, 261, 947, 261, 961, 261, 966, 261, 967, 259, 1085, 259, 594, 259,
+ 99, 259, 597, 259, 240, 259, 102, 259, 607, 259, 609, 259, 613, 259, 616,
+ 259, 617, 259, 618, 259, 7547, 259, 669, 259, 621, 259, 7557, 259, 671,
+ 259, 625, 259, 624, 259, 626, 259, 627, 259, 628, 259, 629, 259, 632,
+ 259, 642, 259, 643, 259, 427, 259, 649, 259, 650, 259, 7452, 259, 651,
+ 259, 652, 259, 122, 259, 656, 259, 657, 259, 658, 259, 952, 512, 65, 805,
+ 512, 97, 805, 512, 66, 775, 512, 98, 775, 512, 66, 803, 512, 98, 803,
+ 512, 66, 817, 512, 98, 817, 512, 199, 769, 512, 231, 769, 512, 68, 775,
+ 512, 100, 775, 512, 68, 803, 512, 100, 803, 512, 68, 817, 512, 100, 817,
+ 512, 68, 807, 512, 100, 807, 512, 68, 813, 512, 100, 813, 512, 274, 768,
+ 512, 275, 768, 512, 274, 769, 512, 275, 769, 512, 69, 813, 512, 101, 813,
+ 512, 69, 816, 512, 101, 816, 512, 552, 774, 512, 553, 774, 512, 70, 775,
+ 512, 102, 775, 512, 71, 772, 512, 103, 772, 512, 72, 775, 512, 104, 775,
+ 512, 72, 803, 512, 104, 803, 512, 72, 776, 512, 104, 776, 512, 72, 807,
+ 512, 104, 807, 512, 72, 814, 512, 104, 814, 512, 73, 816, 512, 105, 816,
+ 512, 207, 769, 512, 239, 769, 512, 75, 769, 512, 107, 769, 512, 75, 803,
+ 512, 107, 803, 512, 75, 817, 512, 107, 817, 512, 76, 803, 512, 108, 803,
+ 512, 7734, 772, 512, 7735, 772, 512, 76, 817, 512, 108, 817, 512, 76,
+ 813, 512, 108, 813, 512, 77, 769, 512, 109, 769, 512, 77, 775, 512, 109,
+ 775, 512, 77, 803, 512, 109, 803, 512, 78, 775, 512, 110, 775, 512, 78,
+ 803, 512, 110, 803, 512, 78, 817, 512, 110, 817, 512, 78, 813, 512, 110,
+ 813, 512, 213, 769, 512, 245, 769, 512, 213, 776, 512, 245, 776, 512,
+ 332, 768, 512, 333, 768, 512, 332, 769, 512, 333, 769, 512, 80, 769, 512,
+ 112, 769, 512, 80, 775, 512, 112, 775, 512, 82, 775, 512, 114, 775, 512,
+ 82, 803, 512, 114, 803, 512, 7770, 772, 512, 7771, 772, 512, 82, 817,
+ 512, 114, 817, 512, 83, 775, 512, 115, 775, 512, 83, 803, 512, 115, 803,
+ 512, 346, 775, 512, 347, 775, 512, 352, 775, 512, 353, 775, 512, 7778,
+ 775, 512, 7779, 775, 512, 84, 775, 512, 116, 775, 512, 84, 803, 512, 116,
+ 803, 512, 84, 817, 512, 116, 817, 512, 84, 813, 512, 116, 813, 512, 85,
+ 804, 512, 117, 804, 512, 85, 816, 512, 117, 816, 512, 85, 813, 512, 117,
+ 813, 512, 360, 769, 512, 361, 769, 512, 362, 776, 512, 363, 776, 512, 86,
+ 771, 512, 118, 771, 512, 86, 803, 512, 118, 803, 512, 87, 768, 512, 119,
+ 768, 512, 87, 769, 512, 119, 769, 512, 87, 776, 512, 119, 776, 512, 87,
+ 775, 512, 119, 775, 512, 87, 803, 512, 119, 803, 512, 88, 775, 512, 120,
+ 775, 512, 88, 776, 512, 120, 776, 512, 89, 775, 512, 121, 775, 512, 90,
+ 770, 512, 122, 770, 512, 90, 803, 512, 122, 803, 512, 90, 817, 512, 122,
+ 817, 512, 104, 817, 512, 116, 776, 512, 119, 778, 512, 121, 778, 514, 97,
+ 702, 512, 383, 775, 512, 65, 803, 512, 97, 803, 512, 65, 777, 512, 97,
+ 777, 512, 194, 769, 512, 226, 769, 512, 194, 768, 512, 226, 768, 512,
+ 194, 777, 512, 226, 777, 512, 194, 771, 512, 226, 771, 512, 7840, 770,
+ 512, 7841, 770, 512, 258, 769, 512, 259, 769, 512, 258, 768, 512, 259,
+ 768, 512, 258, 777, 512, 259, 777, 512, 258, 771, 512, 259, 771, 512,
+ 7840, 774, 512, 7841, 774, 512, 69, 803, 512, 101, 803, 512, 69, 777,
+ 512, 101, 777, 512, 69, 771, 512, 101, 771, 512, 202, 769, 512, 234, 769,
+ 512, 202, 768, 512, 234, 768, 512, 202, 777, 512, 234, 777, 512, 202,
+ 771, 512, 234, 771, 512, 7864, 770, 512, 7865, 770, 512, 73, 777, 512,
+ 105, 777, 512, 73, 803, 512, 105, 803, 512, 79, 803, 512, 111, 803, 512,
+ 79, 777, 512, 111, 777, 512, 212, 769, 512, 244, 769, 512, 212, 768, 512,
+ 244, 768, 512, 212, 777, 512, 244, 777, 512, 212, 771, 512, 244, 771,
+ 512, 7884, 770, 512, 7885, 770, 512, 416, 769, 512, 417, 769, 512, 416,
+ 768, 512, 417, 768, 512, 416, 777, 512, 417, 777, 512, 416, 771, 512,
+ 417, 771, 512, 416, 803, 512, 417, 803, 512, 85, 803, 512, 117, 803, 512,
+ 85, 777, 512, 117, 777, 512, 431, 769, 512, 432, 769, 512, 431, 768, 512,
+ 432, 768, 512, 431, 777, 512, 432, 777, 512, 431, 771, 512, 432, 771,
+ 512, 431, 803, 512, 432, 803, 512, 89, 768, 512, 121, 768, 512, 89, 803,
+ 512, 121, 803, 512, 89, 777, 512, 121, 777, 512, 89, 771, 512, 121, 771,
+ 512, 945, 787, 512, 945, 788, 512, 7936, 768, 512, 7937, 768, 512, 7936,
+ 769, 512, 7937, 769, 512, 7936, 834, 512, 7937, 834, 512, 913, 787, 512,
+ 913, 788, 512, 7944, 768, 512, 7945, 768, 512, 7944, 769, 512, 7945, 769,
+ 512, 7944, 834, 512, 7945, 834, 512, 949, 787, 512, 949, 788, 512, 7952,
+ 768, 512, 7953, 768, 512, 7952, 769, 512, 7953, 769, 512, 917, 787, 512,
+ 917, 788, 512, 7960, 768, 512, 7961, 768, 512, 7960, 769, 512, 7961, 769,
+ 512, 951, 787, 512, 951, 788, 512, 7968, 768, 512, 7969, 768, 512, 7968,
+ 769, 512, 7969, 769, 512, 7968, 834, 512, 7969, 834, 512, 919, 787, 512,
+ 919, 788, 512, 7976, 768, 512, 7977, 768, 512, 7976, 769, 512, 7977, 769,
+ 512, 7976, 834, 512, 7977, 834, 512, 953, 787, 512, 953, 788, 512, 7984,
+ 768, 512, 7985, 768, 512, 7984, 769, 512, 7985, 769, 512, 7984, 834, 512,
+ 7985, 834, 512, 921, 787, 512, 921, 788, 512, 7992, 768, 512, 7993, 768,
+ 512, 7992, 769, 512, 7993, 769, 512, 7992, 834, 512, 7993, 834, 512, 959,
+ 787, 512, 959, 788, 512, 8000, 768, 512, 8001, 768, 512, 8000, 769, 512,
+ 8001, 769, 512, 927, 787, 512, 927, 788, 512, 8008, 768, 512, 8009, 768,
+ 512, 8008, 769, 512, 8009, 769, 512, 965, 787, 512, 965, 788, 512, 8016,
+ 768, 512, 8017, 768, 512, 8016, 769, 512, 8017, 769, 512, 8016, 834, 512,
+ 8017, 834, 512, 933, 788, 512, 8025, 768, 512, 8025, 769, 512, 8025, 834,
+ 512, 969, 787, 512, 969, 788, 512, 8032, 768, 512, 8033, 768, 512, 8032,
+ 769, 512, 8033, 769, 512, 8032, 834, 512, 8033, 834, 512, 937, 787, 512,
+ 937, 788, 512, 8040, 768, 512, 8041, 768, 512, 8040, 769, 512, 8041, 769,
+ 512, 8040, 834, 512, 8041, 834, 512, 945, 768, 256, 940, 512, 949, 768,
+ 256, 941, 512, 951, 768, 256, 942, 512, 953, 768, 256, 943, 512, 959,
+ 768, 256, 972, 512, 965, 768, 256, 973, 512, 969, 768, 256, 974, 512,
+ 7936, 837, 512, 7937, 837, 512, 7938, 837, 512, 7939, 837, 512, 7940,
+ 837, 512, 7941, 837, 512, 7942, 837, 512, 7943, 837, 512, 7944, 837, 512,
+ 7945, 837, 512, 7946, 837, 512, 7947, 837, 512, 7948, 837, 512, 7949,
+ 837, 512, 7950, 837, 512, 7951, 837, 512, 7968, 837, 512, 7969, 837, 512,
+ 7970, 837, 512, 7971, 837, 512, 7972, 837, 512, 7973, 837, 512, 7974,
+ 837, 512, 7975, 837, 512, 7976, 837, 512, 7977, 837, 512, 7978, 837, 512,
+ 7979, 837, 512, 7980, 837, 512, 7981, 837, 512, 7982, 837, 512, 7983,
+ 837, 512, 8032, 837, 512, 8033, 837, 512, 8034, 837, 512, 8035, 837, 512,
+ 8036, 837, 512, 8037, 837, 512, 8038, 837, 512, 8039, 837, 512, 8040,
+ 837, 512, 8041, 837, 512, 8042, 837, 512, 8043, 837, 512, 8044, 837, 512,
+ 8045, 837, 512, 8046, 837, 512, 8047, 837, 512, 945, 774, 512, 945, 772,
+ 512, 8048, 837, 512, 945, 837, 512, 940, 837, 512, 945, 834, 512, 8118,
+ 837, 512, 913, 774, 512, 913, 772, 512, 913, 768, 256, 902, 512, 913,
+ 837, 514, 32, 787, 256, 953, 514, 32, 834, 512, 168, 834, 512, 8052, 837,
+ 512, 951, 837, 512, 942, 837, 512, 951, 834, 512, 8134, 837, 512, 917,
+ 768, 256, 904, 512, 919, 768, 256, 905, 512, 919, 837, 512, 8127, 768,
+ 512, 8127, 769, 512, 8127, 834, 512, 953, 774, 512, 953, 772, 512, 970,
+ 768, 256, 912, 512, 953, 834, 512, 970, 834, 512, 921, 774, 512, 921,
+ 772, 512, 921, 768, 256, 906, 512, 8190, 768, 512, 8190, 769, 512, 8190,
+ 834, 512, 965, 774, 512, 965, 772, 512, 971, 768, 256, 944, 512, 961,
+ 787, 512, 961, 788, 512, 965, 834, 512, 971, 834, 512, 933, 774, 512,
+ 933, 772, 512, 933, 768, 256, 910, 512, 929, 788, 512, 168, 768, 256,
+ 901, 256, 96, 512, 8060, 837, 512, 969, 837, 512, 974, 837, 512, 969,
+ 834, 512, 8182, 837, 512, 927, 768, 256, 908, 512, 937, 768, 256, 911,
+ 512, 937, 837, 256, 180, 514, 32, 788, 256, 8194, 256, 8195, 258, 32,
+ 257, 8208, 514, 32, 819, 258, 46, 514, 46, 46, 770, 46, 46, 46, 514,
+ 8242, 8242, 770, 8242, 8242, 8242, 514, 8245, 8245, 770, 8245, 8245,
+ 8245, 514, 33, 33, 514, 32, 773, 514, 63, 63, 514, 63, 33, 514, 33, 63,
+ 1026, 8242, 8242, 8242, 8242, 259, 48, 259, 105, 259, 52, 259, 53, 259,
+ 54, 259, 55, 259, 56, 259, 57, 259, 43, 259, 8722, 259, 61, 259, 40, 259,
+ 41, 259, 110, 261, 48, 261, 49, 261, 50, 261, 51, 261, 52, 261, 53, 261,
+ 54, 261, 55, 261, 56, 261, 57, 261, 43, 261, 8722, 261, 61, 261, 40, 261,
+ 41, 261, 97, 261, 101, 261, 111, 261, 120, 261, 601, 261, 104, 261, 107,
+ 261, 108, 261, 109, 261, 110, 261, 112, 261, 115, 261, 116, 514, 82, 115,
+ 770, 97, 47, 99, 770, 97, 47, 115, 262, 67, 514, 176, 67, 770, 99, 47,
+ 111, 770, 99, 47, 117, 258, 400, 514, 176, 70, 262, 103, 262, 72, 262,
+ 104, 262, 295, 262, 73, 262, 76, 262, 108, 262, 78, 514, 78, 111, 262,
+ 80, 262, 81, 262, 82, 515, 83, 77, 770, 84, 69, 76, 515, 84, 77, 262, 90,
+ 256, 937, 256, 75, 256, 197, 262, 66, 262, 101, 262, 69, 262, 70, 262,
+ 77, 262, 111, 258, 1488, 258, 1489, 258, 1490, 258, 1491, 262, 105, 770,
+ 70, 65, 88, 262, 960, 262, 947, 262, 915, 262, 928, 262, 8721, 262, 68,
+ 262, 100, 262, 106, 772, 49, 8260, 55, 772, 49, 8260, 57, 1028, 49, 8260,
+ 49, 48, 772, 49, 8260, 51, 772, 50, 8260, 51, 772, 49, 8260, 53, 772, 50,
+ 8260, 53, 772, 51, 8260, 53, 772, 52, 8260, 53, 772, 49, 8260, 54, 772,
+ 53, 8260, 54, 772, 49, 8260, 56, 772, 51, 8260, 56, 772, 53, 8260, 56,
+ 772, 55, 8260, 56, 516, 49, 8260, 258, 73, 514, 73, 73, 770, 73, 73, 73,
+ 514, 73, 86, 258, 86, 514, 86, 73, 770, 86, 73, 73, 1026, 86, 73, 73, 73,
+ 514, 73, 88, 258, 88, 514, 88, 73, 770, 88, 73, 73, 258, 76, 258, 67,
+ 258, 68, 258, 77, 258, 105, 514, 105, 105, 770, 105, 105, 105, 514, 105,
+ 118, 258, 118, 514, 118, 105, 770, 118, 105, 105, 1026, 118, 105, 105,
+ 105, 514, 105, 120, 258, 120, 514, 120, 105, 770, 120, 105, 105, 258,
+ 108, 258, 99, 258, 100, 258, 109, 772, 48, 8260, 51, 512, 8592, 824, 512,
+ 8594, 824, 512, 8596, 824, 512, 8656, 824, 512, 8660, 824, 512, 8658,
+ 824, 512, 8707, 824, 512, 8712, 824, 512, 8715, 824, 512, 8739, 824, 512,
+ 8741, 824, 514, 8747, 8747, 770, 8747, 8747, 8747, 514, 8750, 8750, 770,
+ 8750, 8750, 8750, 512, 8764, 824, 512, 8771, 824, 512, 8773, 824, 512,
+ 8776, 824, 512, 61, 824, 512, 8801, 824, 512, 8781, 824, 512, 60, 824,
+ 512, 62, 824, 512, 8804, 824, 512, 8805, 824, 512, 8818, 824, 512, 8819,
+ 824, 512, 8822, 824, 512, 8823, 824, 512, 8826, 824, 512, 8827, 824, 512,
+ 8834, 824, 512, 8835, 824, 512, 8838, 824, 512, 8839, 824, 512, 8866,
+ 824, 512, 8872, 824, 512, 8873, 824, 512, 8875, 824, 512, 8828, 824, 512,
+ 8829, 824, 512, 8849, 824, 512, 8850, 824, 512, 8882, 824, 512, 8883,
+ 824, 512, 8884, 824, 512, 8885, 824, 256, 12296, 256, 12297, 263, 49,
+ 263, 50, 263, 51, 263, 52, 263, 53, 263, 54, 263, 55, 263, 56, 263, 57,
+ 519, 49, 48, 519, 49, 49, 519, 49, 50, 519, 49, 51, 519, 49, 52, 519, 49,
+ 53, 519, 49, 54, 519, 49, 55, 519, 49, 56, 519, 49, 57, 519, 50, 48, 770,
+ 40, 49, 41, 770, 40, 50, 41, 770, 40, 51, 41, 770, 40, 52, 41, 770, 40,
+ 53, 41, 770, 40, 54, 41, 770, 40, 55, 41, 770, 40, 56, 41, 770, 40, 57,
+ 41, 1026, 40, 49, 48, 41, 1026, 40, 49, 49, 41, 1026, 40, 49, 50, 41,
+ 1026, 40, 49, 51, 41, 1026, 40, 49, 52, 41, 1026, 40, 49, 53, 41, 1026,
+ 40, 49, 54, 41, 1026, 40, 49, 55, 41, 1026, 40, 49, 56, 41, 1026, 40, 49,
+ 57, 41, 1026, 40, 50, 48, 41, 514, 49, 46, 514, 50, 46, 514, 51, 46, 514,
+ 52, 46, 514, 53, 46, 514, 54, 46, 514, 55, 46, 514, 56, 46, 514, 57, 46,
+ 770, 49, 48, 46, 770, 49, 49, 46, 770, 49, 50, 46, 770, 49, 51, 46, 770,
+ 49, 52, 46, 770, 49, 53, 46, 770, 49, 54, 46, 770, 49, 55, 46, 770, 49,
+ 56, 46, 770, 49, 57, 46, 770, 50, 48, 46, 770, 40, 97, 41, 770, 40, 98,
+ 41, 770, 40, 99, 41, 770, 40, 100, 41, 770, 40, 101, 41, 770, 40, 102,
+ 41, 770, 40, 103, 41, 770, 40, 104, 41, 770, 40, 105, 41, 770, 40, 106,
+ 41, 770, 40, 107, 41, 770, 40, 108, 41, 770, 40, 109, 41, 770, 40, 110,
+ 41, 770, 40, 111, 41, 770, 40, 112, 41, 770, 40, 113, 41, 770, 40, 114,
+ 41, 770, 40, 115, 41, 770, 40, 116, 41, 770, 40, 117, 41, 770, 40, 118,
+ 41, 770, 40, 119, 41, 770, 40, 120, 41, 770, 40, 121, 41, 770, 40, 122,
+ 41, 263, 65, 263, 66, 263, 67, 263, 68, 263, 69, 263, 70, 263, 71, 263,
+ 72, 263, 73, 263, 74, 263, 75, 263, 76, 263, 77, 263, 78, 263, 79, 263,
+ 80, 263, 81, 263, 82, 263, 83, 263, 84, 263, 85, 263, 86, 263, 87, 263,
+ 88, 263, 89, 263, 90, 263, 97, 263, 98, 263, 99, 263, 100, 263, 101, 263,
+ 102, 263, 103, 263, 104, 263, 105, 263, 106, 263, 107, 263, 108, 263,
+ 109, 263, 110, 263, 111, 263, 112, 263, 113, 263, 114, 263, 115, 263,
+ 116, 263, 117, 263, 118, 263, 119, 263, 120, 263, 121, 263, 122, 263, 48,
+ 1026, 8747, 8747, 8747, 8747, 770, 58, 58, 61, 514, 61, 61, 770, 61, 61,
+ 61, 512, 10973, 824, 261, 106, 259, 86, 259, 11617, 258, 27597, 258,
+ 40863, 258, 19968, 258, 20008, 258, 20022, 258, 20031, 258, 20057, 258,
+ 20101, 258, 20108, 258, 20128, 258, 20154, 258, 20799, 258, 20837, 258,
+ 20843, 258, 20866, 258, 20886, 258, 20907, 258, 20960, 258, 20981, 258,
+ 20992, 258, 21147, 258, 21241, 258, 21269, 258, 21274, 258, 21304, 258,
+ 21313, 258, 21340, 258, 21353, 258, 21378, 258, 21430, 258, 21448, 258,
+ 21475, 258, 22231, 258, 22303, 258, 22763, 258, 22786, 258, 22794, 258,
+ 22805, 258, 22823, 258, 22899, 258, 23376, 258, 23424, 258, 23544, 258,
+ 23567, 258, 23586, 258, 23608, 258, 23662, 258, 23665, 258, 24027, 258,
+ 24037, 258, 24049, 258, 24062, 258, 24178, 258, 24186, 258, 24191, 258,
+ 24308, 258, 24318, 258, 24331, 258, 24339, 258, 24400, 258, 24417, 258,
+ 24435, 258, 24515, 258, 25096, 258, 25142, 258, 25163, 258, 25903, 258,
+ 25908, 258, 25991, 258, 26007, 258, 26020, 258, 26041, 258, 26080, 258,
+ 26085, 258, 26352, 258, 26376, 258, 26408, 258, 27424, 258, 27490, 258,
+ 27513, 258, 27571, 258, 27595, 258, 27604, 258, 27611, 258, 27663, 258,
+ 27668, 258, 27700, 258, 28779, 258, 29226, 258, 29238, 258, 29243, 258,
+ 29247, 258, 29255, 258, 29273, 258, 29275, 258, 29356, 258, 29572, 258,
+ 29577, 258, 29916, 258, 29926, 258, 29976, 258, 29983, 258, 29992, 258,
+ 30000, 258, 30091, 258, 30098, 258, 30326, 258, 30333, 258, 30382, 258,
+ 30399, 258, 30446, 258, 30683, 258, 30690, 258, 30707, 258, 31034, 258,
+ 31160, 258, 31166, 258, 31348, 258, 31435, 258, 31481, 258, 31859, 258,
+ 31992, 258, 32566, 258, 32593, 258, 32650, 258, 32701, 258, 32769, 258,
+ 32780, 258, 32786, 258, 32819, 258, 32895, 258, 32905, 258, 33251, 258,
+ 33258, 258, 33267, 258, 33276, 258, 33292, 258, 33307, 258, 33311, 258,
+ 33390, 258, 33394, 258, 33400, 258, 34381, 258, 34411, 258, 34880, 258,
+ 34892, 258, 34915, 258, 35198, 258, 35211, 258, 35282, 258, 35328, 258,
+ 35895, 258, 35910, 258, 35925, 258, 35960, 258, 35997, 258, 36196, 258,
+ 36208, 258, 36275, 258, 36523, 258, 36554, 258, 36763, 258, 36784, 258,
+ 36789, 258, 37009, 258, 37193, 258, 37318, 258, 37324, 258, 37329, 258,
+ 38263, 258, 38272, 258, 38428, 258, 38582, 258, 38585, 258, 38632, 258,
+ 38737, 258, 38750, 258, 38754, 258, 38761, 258, 38859, 258, 38893, 258,
+ 38899, 258, 38913, 258, 39080, 258, 39131, 258, 39135, 258, 39318, 258,
+ 39321, 258, 39340, 258, 39592, 258, 39640, 258, 39647, 258, 39717, 258,
+ 39727, 258, 39730, 258, 39740, 258, 39770, 258, 40165, 258, 40565, 258,
+ 40575, 258, 40613, 258, 40635, 258, 40643, 258, 40653, 258, 40657, 258,
+ 40697, 258, 40701, 258, 40718, 258, 40723, 258, 40736, 258, 40763, 258,
+ 40778, 258, 40786, 258, 40845, 258, 40860, 258, 40864, 264, 32, 258,
+ 12306, 258, 21316, 258, 21317, 512, 12363, 12441, 512, 12365, 12441, 512,
+ 12367, 12441, 512, 12369, 12441, 512, 12371, 12441, 512, 12373, 12441,
+ 512, 12375, 12441, 512, 12377, 12441, 512, 12379, 12441, 512, 12381,
+ 12441, 512, 12383, 12441, 512, 12385, 12441, 512, 12388, 12441, 512,
+ 12390, 12441, 512, 12392, 12441, 512, 12399, 12441, 512, 12399, 12442,
+ 512, 12402, 12441, 512, 12402, 12442, 512, 12405, 12441, 512, 12405,
+ 12442, 512, 12408, 12441, 512, 12408, 12442, 512, 12411, 12441, 512,
+ 12411, 12442, 512, 12358, 12441, 514, 32, 12441, 514, 32, 12442, 512,
+ 12445, 12441, 521, 12424, 12426, 512, 12459, 12441, 512, 12461, 12441,
+ 512, 12463, 12441, 512, 12465, 12441, 512, 12467, 12441, 512, 12469,
+ 12441, 512, 12471, 12441, 512, 12473, 12441, 512, 12475, 12441, 512,
+ 12477, 12441, 512, 12479, 12441, 512, 12481, 12441, 512, 12484, 12441,
+ 512, 12486, 12441, 512, 12488, 12441, 512, 12495, 12441, 512, 12495,
+ 12442, 512, 12498, 12441, 512, 12498, 12442, 512, 12501, 12441, 512,
+ 12501, 12442, 512, 12504, 12441, 512, 12504, 12442, 512, 12507, 12441,
+ 512, 12507, 12442, 512, 12454, 12441, 512, 12527, 12441, 512, 12528,
+ 12441, 512, 12529, 12441, 512, 12530, 12441, 512, 12541, 12441, 521,
+ 12467, 12488, 258, 4352, 258, 4353, 258, 4522, 258, 4354, 258, 4524, 258,
+ 4525, 258, 4355, 258, 4356, 258, 4357, 258, 4528, 258, 4529, 258, 4530,
+ 258, 4531, 258, 4532, 258, 4533, 258, 4378, 258, 4358, 258, 4359, 258,
+ 4360, 258, 4385, 258, 4361, 258, 4362, 258, 4363, 258, 4364, 258, 4365,
+ 258, 4366, 258, 4367, 258, 4368, 258, 4369, 258, 4370, 258, 4449, 258,
+ 4450, 258, 4451, 258, 4452, 258, 4453, 258, 4454, 258, 4455, 258, 4456,
+ 258, 4457, 258, 4458, 258, 4459, 258, 4460, 258, 4461, 258, 4462, 258,
+ 4463, 258, 4464, 258, 4465, 258, 4466, 258, 4467, 258, 4468, 258, 4469,
+ 258, 4448, 258, 4372, 258, 4373, 258, 4551, 258, 4552, 258, 4556, 258,
+ 4558, 258, 4563, 258, 4567, 258, 4569, 258, 4380, 258, 4573, 258, 4575,
+ 258, 4381, 258, 4382, 258, 4384, 258, 4386, 258, 4387, 258, 4391, 258,
+ 4393, 258, 4395, 258, 4396, 258, 4397, 258, 4398, 258, 4399, 258, 4402,
+ 258, 4406, 258, 4416, 258, 4423, 258, 4428, 258, 4593, 258, 4594, 258,
+ 4439, 258, 4440, 258, 4441, 258, 4484, 258, 4485, 258, 4488, 258, 4497,
+ 258, 4498, 258, 4500, 258, 4510, 258, 4513, 259, 19968, 259, 20108, 259,
+ 19977, 259, 22235, 259, 19978, 259, 20013, 259, 19979, 259, 30002, 259,
+ 20057, 259, 19993, 259, 19969, 259, 22825, 259, 22320, 259, 20154, 770,
+ 40, 4352, 41, 770, 40, 4354, 41, 770, 40, 4355, 41, 770, 40, 4357, 41,
+ 770, 40, 4358, 41, 770, 40, 4359, 41, 770, 40, 4361, 41, 770, 40, 4363,
+ 41, 770, 40, 4364, 41, 770, 40, 4366, 41, 770, 40, 4367, 41, 770, 40,
+ 4368, 41, 770, 40, 4369, 41, 770, 40, 4370, 41, 1026, 40, 4352, 4449, 41,
+ 1026, 40, 4354, 4449, 41, 1026, 40, 4355, 4449, 41, 1026, 40, 4357, 4449,
+ 41, 1026, 40, 4358, 4449, 41, 1026, 40, 4359, 4449, 41, 1026, 40, 4361,
+ 4449, 41, 1026, 40, 4363, 4449, 41, 1026, 40, 4364, 4449, 41, 1026, 40,
+ 4366, 4449, 41, 1026, 40, 4367, 4449, 41, 1026, 40, 4368, 4449, 41, 1026,
+ 40, 4369, 4449, 41, 1026, 40, 4370, 4449, 41, 1026, 40, 4364, 4462, 41,
+ 1794, 40, 4363, 4457, 4364, 4453, 4523, 41, 1538, 40, 4363, 4457, 4370,
+ 4462, 41, 770, 40, 19968, 41, 770, 40, 20108, 41, 770, 40, 19977, 41,
+ 770, 40, 22235, 41, 770, 40, 20116, 41, 770, 40, 20845, 41, 770, 40,
+ 19971, 41, 770, 40, 20843, 41, 770, 40, 20061, 41, 770, 40, 21313, 41,
+ 770, 40, 26376, 41, 770, 40, 28779, 41, 770, 40, 27700, 41, 770, 40,
+ 26408, 41, 770, 40, 37329, 41, 770, 40, 22303, 41, 770, 40, 26085, 41,
+ 770, 40, 26666, 41, 770, 40, 26377, 41, 770, 40, 31038, 41, 770, 40,
+ 21517, 41, 770, 40, 29305, 41, 770, 40, 36001, 41, 770, 40, 31069, 41,
+ 770, 40, 21172, 41, 770, 40, 20195, 41, 770, 40, 21628, 41, 770, 40,
+ 23398, 41, 770, 40, 30435, 41, 770, 40, 20225, 41, 770, 40, 36039, 41,
+ 770, 40, 21332, 41, 770, 40, 31085, 41, 770, 40, 20241, 41, 770, 40,
+ 33258, 41, 770, 40, 33267, 41, 263, 21839, 263, 24188, 263, 25991, 263,
+ 31631, 778, 80, 84, 69, 519, 50, 49, 519, 50, 50, 519, 50, 51, 519, 50,
+ 52, 519, 50, 53, 519, 50, 54, 519, 50, 55, 519, 50, 56, 519, 50, 57, 519,
+ 51, 48, 519, 51, 49, 519, 51, 50, 519, 51, 51, 519, 51, 52, 519, 51, 53,
+ 263, 4352, 263, 4354, 263, 4355, 263, 4357, 263, 4358, 263, 4359, 263,
+ 4361, 263, 4363, 263, 4364, 263, 4366, 263, 4367, 263, 4368, 263, 4369,
+ 263, 4370, 519, 4352, 4449, 519, 4354, 4449, 519, 4355, 4449, 519, 4357,
+ 4449, 519, 4358, 4449, 519, 4359, 4449, 519, 4361, 4449, 519, 4363, 4449,
+ 519, 4364, 4449, 519, 4366, 4449, 519, 4367, 4449, 519, 4368, 4449, 519,
+ 4369, 4449, 519, 4370, 4449, 1287, 4366, 4449, 4535, 4352, 4457, 1031,
+ 4364, 4462, 4363, 4468, 519, 4363, 4462, 263, 19968, 263, 20108, 263,
+ 19977, 263, 22235, 263, 20116, 263, 20845, 263, 19971, 263, 20843, 263,
+ 20061, 263, 21313, 263, 26376, 263, 28779, 263, 27700, 263, 26408, 263,
+ 37329, 263, 22303, 263, 26085, 263, 26666, 263, 26377, 263, 31038, 263,
+ 21517, 263, 29305, 263, 36001, 263, 31069, 263, 21172, 263, 31192, 263,
+ 30007, 263, 22899, 263, 36969, 263, 20778, 263, 21360, 263, 27880, 263,
+ 38917, 263, 20241, 263, 20889, 263, 27491, 263, 19978, 263, 20013, 263,
+ 19979, 263, 24038, 263, 21491, 263, 21307, 263, 23447, 263, 23398, 263,
+ 30435, 263, 20225, 263, 36039, 263, 21332, 263, 22812, 519, 51, 54, 519,
+ 51, 55, 519, 51, 56, 519, 51, 57, 519, 52, 48, 519, 52, 49, 519, 52, 50,
+ 519, 52, 51, 519, 52, 52, 519, 52, 53, 519, 52, 54, 519, 52, 55, 519, 52,
+ 56, 519, 52, 57, 519, 53, 48, 514, 49, 26376, 514, 50, 26376, 514, 51,
+ 26376, 514, 52, 26376, 514, 53, 26376, 514, 54, 26376, 514, 55, 26376,
+ 514, 56, 26376, 514, 57, 26376, 770, 49, 48, 26376, 770, 49, 49, 26376,
+ 770, 49, 50, 26376, 522, 72, 103, 778, 101, 114, 103, 522, 101, 86, 778,
+ 76, 84, 68, 263, 12450, 263, 12452, 263, 12454, 263, 12456, 263, 12458,
+ 263, 12459, 263, 12461, 263, 12463, 263, 12465, 263, 12467, 263, 12469,
+ 263, 12471, 263, 12473, 263, 12475, 263, 12477, 263, 12479, 263, 12481,
+ 263, 12484, 263, 12486, 263, 12488, 263, 12490, 263, 12491, 263, 12492,
+ 263, 12493, 263, 12494, 263, 12495, 263, 12498, 263, 12501, 263, 12504,
+ 263, 12507, 263, 12510, 263, 12511, 263, 12512, 263, 12513, 263, 12514,
+ 263, 12516, 263, 12518, 263, 12520, 263, 12521, 263, 12522, 263, 12523,
+ 263, 12524, 263, 12525, 263, 12527, 263, 12528, 263, 12529, 263, 12530,
+ 522, 20196, 21644, 1034, 12450, 12497, 12540, 12488, 1034, 12450, 12523,
+ 12501, 12449, 1034, 12450, 12531, 12506, 12450, 778, 12450, 12540, 12523,
+ 1034, 12452, 12491, 12531, 12464, 778, 12452, 12531, 12481, 778, 12454,
+ 12457, 12531, 1290, 12456, 12473, 12463, 12540, 12489, 1034, 12456,
+ 12540, 12459, 12540, 778, 12458, 12531, 12473, 778, 12458, 12540, 12512,
+ 778, 12459, 12452, 12522, 1034, 12459, 12521, 12483, 12488, 1034, 12459,
+ 12525, 12522, 12540, 778, 12460, 12525, 12531, 778, 12460, 12531, 12510,
+ 522, 12462, 12460, 778, 12462, 12491, 12540, 1034, 12461, 12517, 12522,
+ 12540, 1034, 12462, 12523, 12480, 12540, 522, 12461, 12525, 1290, 12461,
+ 12525, 12464, 12521, 12512, 1546, 12461, 12525, 12513, 12540, 12488,
+ 12523, 1290, 12461, 12525, 12527, 12483, 12488, 778, 12464, 12521, 12512,
+ 1290, 12464, 12521, 12512, 12488, 12531, 1290, 12463, 12523, 12476,
+ 12452, 12525, 1034, 12463, 12525, 12540, 12493, 778, 12465, 12540, 12473,
+ 778, 12467, 12523, 12490, 778, 12467, 12540, 12509, 1034, 12469, 12452,
+ 12463, 12523, 1290, 12469, 12531, 12481, 12540, 12512, 1034, 12471,
+ 12522, 12531, 12464, 778, 12475, 12531, 12481, 778, 12475, 12531, 12488,
+ 778, 12480, 12540, 12473, 522, 12487, 12471, 522, 12489, 12523, 522,
+ 12488, 12531, 522, 12490, 12494, 778, 12494, 12483, 12488, 778, 12495,
+ 12452, 12484, 1290, 12497, 12540, 12475, 12531, 12488, 778, 12497, 12540,
+ 12484, 1034, 12496, 12540, 12524, 12523, 1290, 12500, 12450, 12473,
+ 12488, 12523, 778, 12500, 12463, 12523, 522, 12500, 12467, 522, 12499,
+ 12523, 1290, 12501, 12449, 12521, 12483, 12489, 1034, 12501, 12451,
+ 12540, 12488, 1290, 12502, 12483, 12471, 12455, 12523, 778, 12501, 12521,
+ 12531, 1290, 12504, 12463, 12479, 12540, 12523, 522, 12506, 12477, 778,
+ 12506, 12491, 12498, 778, 12504, 12523, 12484, 778, 12506, 12531, 12473,
+ 778, 12506, 12540, 12472, 778, 12505, 12540, 12479, 1034, 12509, 12452,
+ 12531, 12488, 778, 12508, 12523, 12488, 522, 12507, 12531, 778, 12509,
+ 12531, 12489, 778, 12507, 12540, 12523, 778, 12507, 12540, 12531, 1034,
+ 12510, 12452, 12463, 12525, 778, 12510, 12452, 12523, 778, 12510, 12483,
+ 12495, 778, 12510, 12523, 12463, 1290, 12510, 12531, 12471, 12519, 12531,
+ 1034, 12511, 12463, 12525, 12531, 522, 12511, 12522, 1290, 12511, 12522,
+ 12496, 12540, 12523, 522, 12513, 12460, 1034, 12513, 12460, 12488, 12531,
+ 1034, 12513, 12540, 12488, 12523, 778, 12516, 12540, 12489, 778, 12516,
+ 12540, 12523, 778, 12518, 12450, 12531, 1034, 12522, 12483, 12488, 12523,
+ 522, 12522, 12521, 778, 12523, 12500, 12540, 1034, 12523, 12540, 12502,
+ 12523, 522, 12524, 12512, 1290, 12524, 12531, 12488, 12466, 12531, 778,
+ 12527, 12483, 12488, 514, 48, 28857, 514, 49, 28857, 514, 50, 28857, 514,
+ 51, 28857, 514, 52, 28857, 514, 53, 28857, 514, 54, 28857, 514, 55,
+ 28857, 514, 56, 28857, 514, 57, 28857, 770, 49, 48, 28857, 770, 49, 49,
+ 28857, 770, 49, 50, 28857, 770, 49, 51, 28857, 770, 49, 52, 28857, 770,
+ 49, 53, 28857, 770, 49, 54, 28857, 770, 49, 55, 28857, 770, 49, 56,
+ 28857, 770, 49, 57, 28857, 770, 50, 48, 28857, 770, 50, 49, 28857, 770,
+ 50, 50, 28857, 770, 50, 51, 28857, 770, 50, 52, 28857, 778, 104, 80, 97,
+ 522, 100, 97, 522, 65, 85, 778, 98, 97, 114, 522, 111, 86, 522, 112, 99,
+ 522, 100, 109, 778, 100, 109, 178, 778, 100, 109, 179, 522, 73, 85, 522,
+ 24179, 25104, 522, 26157, 21644, 522, 22823, 27491, 522, 26126, 27835,
+ 1034, 26666, 24335, 20250, 31038, 522, 112, 65, 522, 110, 65, 522, 956,
+ 65, 522, 109, 65, 522, 107, 65, 522, 75, 66, 522, 77, 66, 522, 71, 66,
+ 778, 99, 97, 108, 1034, 107, 99, 97, 108, 522, 112, 70, 522, 110, 70,
+ 522, 956, 70, 522, 956, 103, 522, 109, 103, 522, 107, 103, 522, 72, 122,
+ 778, 107, 72, 122, 778, 77, 72, 122, 778, 71, 72, 122, 778, 84, 72, 122,
+ 522, 956, 8467, 522, 109, 8467, 522, 100, 8467, 522, 107, 8467, 522, 102,
+ 109, 522, 110, 109, 522, 956, 109, 522, 109, 109, 522, 99, 109, 522, 107,
+ 109, 778, 109, 109, 178, 778, 99, 109, 178, 522, 109, 178, 778, 107, 109,
+ 178, 778, 109, 109, 179, 778, 99, 109, 179, 522, 109, 179, 778, 107, 109,
+ 179, 778, 109, 8725, 115, 1034, 109, 8725, 115, 178, 522, 80, 97, 778,
+ 107, 80, 97, 778, 77, 80, 97, 778, 71, 80, 97, 778, 114, 97, 100, 1290,
+ 114, 97, 100, 8725, 115, 1546, 114, 97, 100, 8725, 115, 178, 522, 112,
+ 115, 522, 110, 115, 522, 956, 115, 522, 109, 115, 522, 112, 86, 522, 110,
+ 86, 522, 956, 86, 522, 109, 86, 522, 107, 86, 522, 77, 86, 522, 112, 87,
+ 522, 110, 87, 522, 956, 87, 522, 109, 87, 522, 107, 87, 522, 77, 87, 522,
+ 107, 937, 522, 77, 937, 1034, 97, 46, 109, 46, 522, 66, 113, 522, 99, 99,
+ 522, 99, 100, 1034, 67, 8725, 107, 103, 778, 67, 111, 46, 522, 100, 66,
+ 522, 71, 121, 522, 104, 97, 522, 72, 80, 522, 105, 110, 522, 75, 75, 522,
+ 75, 77, 522, 107, 116, 522, 108, 109, 522, 108, 110, 778, 108, 111, 103,
+ 522, 108, 120, 522, 109, 98, 778, 109, 105, 108, 778, 109, 111, 108, 522,
+ 80, 72, 1034, 112, 46, 109, 46, 778, 80, 80, 77, 522, 80, 82, 522, 115,
+ 114, 522, 83, 118, 522, 87, 98, 778, 86, 8725, 109, 778, 65, 8725, 109,
+ 514, 49, 26085, 514, 50, 26085, 514, 51, 26085, 514, 52, 26085, 514, 53,
+ 26085, 514, 54, 26085, 514, 55, 26085, 514, 56, 26085, 514, 57, 26085,
+ 770, 49, 48, 26085, 770, 49, 49, 26085, 770, 49, 50, 26085, 770, 49, 51,
+ 26085, 770, 49, 52, 26085, 770, 49, 53, 26085, 770, 49, 54, 26085, 770,
+ 49, 55, 26085, 770, 49, 56, 26085, 770, 49, 57, 26085, 770, 50, 48,
+ 26085, 770, 50, 49, 26085, 770, 50, 50, 26085, 770, 50, 51, 26085, 770,
+ 50, 52, 26085, 770, 50, 53, 26085, 770, 50, 54, 26085, 770, 50, 55,
+ 26085, 770, 50, 56, 26085, 770, 50, 57, 26085, 770, 51, 48, 26085, 770,
+ 51, 49, 26085, 778, 103, 97, 108, 259, 1098, 259, 1100, 259, 42863, 259,
+ 67, 259, 70, 259, 81, 259, 294, 259, 339, 259, 42791, 259, 43831, 259,
+ 619, 259, 43858, 259, 653, 256, 35912, 256, 26356, 256, 36554, 256,
+ 36040, 256, 28369, 256, 20018, 256, 21477, 256, 40860, 256, 22865, 256,
+ 37329, 256, 21895, 256, 22856, 256, 25078, 256, 30313, 256, 32645, 256,
+ 34367, 256, 34746, 256, 35064, 256, 37007, 256, 27138, 256, 27931, 256,
+ 28889, 256, 29662, 256, 33853, 256, 37226, 256, 39409, 256, 20098, 256,
+ 21365, 256, 27396, 256, 29211, 256, 34349, 256, 40478, 256, 23888, 256,
+ 28651, 256, 34253, 256, 35172, 256, 25289, 256, 33240, 256, 34847, 256,
+ 24266, 256, 26391, 256, 28010, 256, 29436, 256, 37070, 256, 20358, 256,
+ 20919, 256, 21214, 256, 25796, 256, 27347, 256, 29200, 256, 30439, 256,
+ 32769, 256, 34310, 256, 34396, 256, 36335, 256, 38706, 256, 39791, 256,
+ 40442, 256, 30860, 256, 31103, 256, 32160, 256, 33737, 256, 37636, 256,
+ 40575, 256, 35542, 256, 22751, 256, 24324, 256, 31840, 256, 32894, 256,
+ 29282, 256, 30922, 256, 36034, 256, 38647, 256, 22744, 256, 23650, 256,
+ 27155, 256, 28122, 256, 28431, 256, 32047, 256, 32311, 256, 38475, 256,
+ 21202, 256, 32907, 256, 20956, 256, 20940, 256, 31260, 256, 32190, 256,
+ 33777, 256, 38517, 256, 35712, 256, 25295, 256, 35582, 256, 20025, 256,
+ 23527, 256, 24594, 256, 29575, 256, 30064, 256, 21271, 256, 30971, 256,
+ 20415, 256, 24489, 256, 19981, 256, 27852, 256, 25976, 256, 32034, 256,
+ 21443, 256, 22622, 256, 30465, 256, 33865, 256, 35498, 256, 27578, 256,
+ 36784, 256, 27784, 256, 25342, 256, 33509, 256, 25504, 256, 30053, 256,
+ 20142, 256, 20841, 256, 20937, 256, 26753, 256, 31975, 256, 33391, 256,
+ 35538, 256, 37327, 256, 21237, 256, 21570, 256, 22899, 256, 24300, 256,
+ 26053, 256, 28670, 256, 31018, 256, 38317, 256, 39530, 256, 40599, 256,
+ 40654, 256, 21147, 256, 26310, 256, 27511, 256, 36706, 256, 24180, 256,
+ 24976, 256, 25088, 256, 25754, 256, 28451, 256, 29001, 256, 29833, 256,
+ 31178, 256, 32244, 256, 32879, 256, 36646, 256, 34030, 256, 36899, 256,
+ 37706, 256, 21015, 256, 21155, 256, 21693, 256, 28872, 256, 35010, 256,
+ 24265, 256, 24565, 256, 25467, 256, 27566, 256, 31806, 256, 29557, 256,
+ 20196, 256, 22265, 256, 23994, 256, 24604, 256, 29618, 256, 29801, 256,
+ 32666, 256, 32838, 256, 37428, 256, 38646, 256, 38728, 256, 38936, 256,
+ 20363, 256, 31150, 256, 37300, 256, 38584, 256, 24801, 256, 20102, 256,
+ 20698, 256, 23534, 256, 23615, 256, 26009, 256, 29134, 256, 30274, 256,
+ 34044, 256, 36988, 256, 40845, 256, 26248, 256, 38446, 256, 21129, 256,
+ 26491, 256, 26611, 256, 27969, 256, 28316, 256, 29705, 256, 30041, 256,
+ 30827, 256, 32016, 256, 39006, 256, 20845, 256, 25134, 256, 38520, 256,
+ 20523, 256, 23833, 256, 28138, 256, 36650, 256, 24459, 256, 24900, 256,
+ 26647, 256, 38534, 256, 21033, 256, 21519, 256, 23653, 256, 26131, 256,
+ 26446, 256, 26792, 256, 27877, 256, 29702, 256, 30178, 256, 32633, 256,
+ 35023, 256, 35041, 256, 37324, 256, 38626, 256, 21311, 256, 28346, 256,
+ 21533, 256, 29136, 256, 29848, 256, 34298, 256, 38563, 256, 40023, 256,
+ 40607, 256, 26519, 256, 28107, 256, 33256, 256, 31435, 256, 31520, 256,
+ 31890, 256, 29376, 256, 28825, 256, 35672, 256, 20160, 256, 33590, 256,
+ 21050, 256, 20999, 256, 24230, 256, 25299, 256, 31958, 256, 23429, 256,
+ 27934, 256, 26292, 256, 36667, 256, 34892, 256, 38477, 256, 35211, 256,
+ 24275, 256, 20800, 256, 21952, 256, 22618, 256, 26228, 256, 20958, 256,
+ 29482, 256, 30410, 256, 31036, 256, 31070, 256, 31077, 256, 31119, 256,
+ 38742, 256, 31934, 256, 32701, 256, 34322, 256, 35576, 256, 36920, 256,
+ 37117, 256, 39151, 256, 39164, 256, 39208, 256, 40372, 256, 37086, 256,
+ 38583, 256, 20398, 256, 20711, 256, 20813, 256, 21193, 256, 21220, 256,
+ 21329, 256, 21917, 256, 22022, 256, 22120, 256, 22592, 256, 22696, 256,
+ 23652, 256, 23662, 256, 24724, 256, 24936, 256, 24974, 256, 25074, 256,
+ 25935, 256, 26082, 256, 26257, 256, 26757, 256, 28023, 256, 28186, 256,
+ 28450, 256, 29038, 256, 29227, 256, 29730, 256, 30865, 256, 31038, 256,
+ 31049, 256, 31048, 256, 31056, 256, 31062, 256, 31069, 256, 31117, 256,
+ 31118, 256, 31296, 256, 31361, 256, 31680, 256, 32265, 256, 32321, 256,
+ 32626, 256, 32773, 256, 33261, 256, 33401, 256, 33879, 256, 35088, 256,
+ 35222, 256, 35585, 256, 35641, 256, 36051, 256, 36104, 256, 36790, 256,
+ 38627, 256, 38911, 256, 38971, 256, 24693, 256, 148206, 256, 33304, 256,
+ 20006, 256, 20917, 256, 20840, 256, 20352, 256, 20805, 256, 20864, 256,
+ 21191, 256, 21242, 256, 21845, 256, 21913, 256, 21986, 256, 22707, 256,
+ 22852, 256, 22868, 256, 23138, 256, 23336, 256, 24274, 256, 24281, 256,
+ 24425, 256, 24493, 256, 24792, 256, 24910, 256, 24840, 256, 24928, 256,
+ 25140, 256, 25540, 256, 25628, 256, 25682, 256, 25942, 256, 26395, 256,
+ 26454, 256, 27513, 256, 28379, 256, 28363, 256, 28702, 256, 30631, 256,
+ 29237, 256, 29359, 256, 29809, 256, 29958, 256, 30011, 256, 30237, 256,
+ 30239, 256, 30427, 256, 30452, 256, 30538, 256, 30528, 256, 30924, 256,
+ 31409, 256, 31867, 256, 32091, 256, 32574, 256, 33618, 256, 33775, 256,
+ 34681, 256, 35137, 256, 35206, 256, 35519, 256, 35531, 256, 35565, 256,
+ 35722, 256, 36664, 256, 36978, 256, 37273, 256, 37494, 256, 38524, 256,
+ 38875, 256, 38923, 256, 39698, 256, 141386, 256, 141380, 256, 144341,
+ 256, 15261, 256, 16408, 256, 16441, 256, 152137, 256, 154832, 256,
+ 163539, 256, 40771, 256, 40846, 514, 102, 102, 514, 102, 105, 514, 102,
+ 108, 770, 102, 102, 105, 770, 102, 102, 108, 514, 383, 116, 514, 115,
+ 116, 514, 1396, 1398, 514, 1396, 1381, 514, 1396, 1387, 514, 1406, 1398,
+ 514, 1396, 1389, 512, 1497, 1460, 512, 1522, 1463, 262, 1506, 262, 1488,
+ 262, 1491, 262, 1492, 262, 1499, 262, 1500, 262, 1501, 262, 1512, 262,
+ 1514, 262, 43, 512, 1513, 1473, 512, 1513, 1474, 512, 64329, 1473, 512,
+ 64329, 1474, 512, 1488, 1463, 512, 1488, 1464, 512, 1488, 1468, 512,
+ 1489, 1468, 512, 1490, 1468, 512, 1491, 1468, 512, 1492, 1468, 512, 1493,
+ 1468, 512, 1494, 1468, 512, 1496, 1468, 512, 1497, 1468, 512, 1498, 1468,
+ 512, 1499, 1468, 512, 1500, 1468, 512, 1502, 1468, 512, 1504, 1468, 512,
+ 1505, 1468, 512, 1507, 1468, 512, 1508, 1468, 512, 1510, 1468, 512, 1511,
+ 1468, 512, 1512, 1468, 512, 1513, 1468, 512, 1514, 1468, 512, 1493, 1465,
+ 512, 1489, 1471, 512, 1499, 1471, 512, 1508, 1471, 514, 1488, 1500, 267,
+ 1649, 268, 1649, 267, 1659, 268, 1659, 269, 1659, 270, 1659, 267, 1662,
+ 268, 1662, 269, 1662, 270, 1662, 267, 1664, 268, 1664, 269, 1664, 270,
+ 1664, 267, 1658, 268, 1658, 269, 1658, 270, 1658, 267, 1663, 268, 1663,
+ 269, 1663, 270, 1663, 267, 1657, 268, 1657, 269, 1657, 270, 1657, 267,
+ 1700, 268, 1700, 269, 1700, 270, 1700, 267, 1702, 268, 1702, 269, 1702,
+ 270, 1702, 267, 1668, 268, 1668, 269, 1668, 270, 1668, 267, 1667, 268,
+ 1667, 269, 1667, 270, 1667, 267, 1670, 268, 1670, 269, 1670, 270, 1670,
+ 267, 1671, 268, 1671, 269, 1671, 270, 1671, 267, 1677, 268, 1677, 267,
+ 1676, 268, 1676, 267, 1678, 268, 1678, 267, 1672, 268, 1672, 267, 1688,
+ 268, 1688, 267, 1681, 268, 1681, 267, 1705, 268, 1705, 269, 1705, 270,
+ 1705, 267, 1711, 268, 1711, 269, 1711, 270, 1711, 267, 1715, 268, 1715,
+ 269, 1715, 270, 1715, 267, 1713, 268, 1713, 269, 1713, 270, 1713, 267,
+ 1722, 268, 1722, 267, 1723, 268, 1723, 269, 1723, 270, 1723, 267, 1728,
+ 268, 1728, 267, 1729, 268, 1729, 269, 1729, 270, 1729, 267, 1726, 268,
+ 1726, 269, 1726, 270, 1726, 267, 1746, 268, 1746, 267, 1747, 268, 1747,
+ 267, 1709, 268, 1709, 269, 1709, 270, 1709, 267, 1735, 268, 1735, 267,
+ 1734, 268, 1734, 267, 1736, 268, 1736, 267, 1655, 267, 1739, 268, 1739,
+ 267, 1733, 268, 1733, 267, 1737, 268, 1737, 267, 1744, 268, 1744, 269,
+ 1744, 270, 1744, 269, 1609, 270, 1609, 523, 1574, 1575, 524, 1574, 1575,
+ 523, 1574, 1749, 524, 1574, 1749, 523, 1574, 1608, 524, 1574, 1608, 523,
+ 1574, 1735, 524, 1574, 1735, 523, 1574, 1734, 524, 1574, 1734, 523, 1574,
+ 1736, 524, 1574, 1736, 523, 1574, 1744, 524, 1574, 1744, 525, 1574, 1744,
+ 523, 1574, 1609, 524, 1574, 1609, 525, 1574, 1609, 267, 1740, 268, 1740,
+ 269, 1740, 270, 1740, 523, 1574, 1580, 523, 1574, 1581, 523, 1574, 1605,
+ 523, 1574, 1610, 523, 1576, 1580, 523, 1576, 1581, 523, 1576, 1582, 523,
+ 1576, 1605, 523, 1576, 1609, 523, 1576, 1610, 523, 1578, 1580, 523, 1578,
+ 1581, 523, 1578, 1582, 523, 1578, 1605, 523, 1578, 1609, 523, 1578, 1610,
+ 523, 1579, 1580, 523, 1579, 1605, 523, 1579, 1609, 523, 1579, 1610, 523,
+ 1580, 1581, 523, 1580, 1605, 523, 1581, 1580, 523, 1581, 1605, 523, 1582,
+ 1580, 523, 1582, 1581, 523, 1582, 1605, 523, 1587, 1580, 523, 1587, 1581,
+ 523, 1587, 1582, 523, 1587, 1605, 523, 1589, 1581, 523, 1589, 1605, 523,
+ 1590, 1580, 523, 1590, 1581, 523, 1590, 1582, 523, 1590, 1605, 523, 1591,
+ 1581, 523, 1591, 1605, 523, 1592, 1605, 523, 1593, 1580, 523, 1593, 1605,
+ 523, 1594, 1580, 523, 1594, 1605, 523, 1601, 1580, 523, 1601, 1581, 523,
+ 1601, 1582, 523, 1601, 1605, 523, 1601, 1609, 523, 1601, 1610, 523, 1602,
+ 1581, 523, 1602, 1605, 523, 1602, 1609, 523, 1602, 1610, 523, 1603, 1575,
+ 523, 1603, 1580, 523, 1603, 1581, 523, 1603, 1582, 523, 1603, 1604, 523,
+ 1603, 1605, 523, 1603, 1609, 523, 1603, 1610, 523, 1604, 1580, 523, 1604,
+ 1581, 523, 1604, 1582, 523, 1604, 1605, 523, 1604, 1609, 523, 1604, 1610,
+ 523, 1605, 1580, 523, 1605, 1581, 523, 1605, 1582, 523, 1605, 1605, 523,
+ 1605, 1609, 523, 1605, 1610, 523, 1606, 1580, 523, 1606, 1581, 523, 1606,
+ 1582, 523, 1606, 1605, 523, 1606, 1609, 523, 1606, 1610, 523, 1607, 1580,
+ 523, 1607, 1605, 523, 1607, 1609, 523, 1607, 1610, 523, 1610, 1580, 523,
+ 1610, 1581, 523, 1610, 1582, 523, 1610, 1605, 523, 1610, 1609, 523, 1610,
+ 1610, 523, 1584, 1648, 523, 1585, 1648, 523, 1609, 1648, 779, 32, 1612,
+ 1617, 779, 32, 1613, 1617, 779, 32, 1614, 1617, 779, 32, 1615, 1617, 779,
+ 32, 1616, 1617, 779, 32, 1617, 1648, 524, 1574, 1585, 524, 1574, 1586,
+ 524, 1574, 1605, 524, 1574, 1606, 524, 1574, 1610, 524, 1576, 1585, 524,
+ 1576, 1586, 524, 1576, 1605, 524, 1576, 1606, 524, 1576, 1609, 524, 1576,
+ 1610, 524, 1578, 1585, 524, 1578, 1586, 524, 1578, 1605, 524, 1578, 1606,
+ 524, 1578, 1609, 524, 1578, 1610, 524, 1579, 1585, 524, 1579, 1586, 524,
+ 1579, 1605, 524, 1579, 1606, 524, 1579, 1609, 524, 1579, 1610, 524, 1601,
+ 1609, 524, 1601, 1610, 524, 1602, 1609, 524, 1602, 1610, 524, 1603, 1575,
+ 524, 1603, 1604, 524, 1603, 1605, 524, 1603, 1609, 524, 1603, 1610, 524,
+ 1604, 1605, 524, 1604, 1609, 524, 1604, 1610, 524, 1605, 1575, 524, 1605,
+ 1605, 524, 1606, 1585, 524, 1606, 1586, 524, 1606, 1605, 524, 1606, 1606,
+ 524, 1606, 1609, 524, 1606, 1610, 524, 1609, 1648, 524, 1610, 1585, 524,
+ 1610, 1586, 524, 1610, 1605, 524, 1610, 1606, 524, 1610, 1609, 524, 1610,
+ 1610, 525, 1574, 1580, 525, 1574, 1581, 525, 1574, 1582, 525, 1574, 1605,
+ 525, 1574, 1607, 525, 1576, 1580, 525, 1576, 1581, 525, 1576, 1582, 525,
+ 1576, 1605, 525, 1576, 1607, 525, 1578, 1580, 525, 1578, 1581, 525, 1578,
+ 1582, 525, 1578, 1605, 525, 1578, 1607, 525, 1579, 1605, 525, 1580, 1581,
+ 525, 1580, 1605, 525, 1581, 1580, 525, 1581, 1605, 525, 1582, 1580, 525,
+ 1582, 1605, 525, 1587, 1580, 525, 1587, 1581, 525, 1587, 1582, 525, 1587,
+ 1605, 525, 1589, 1581, 525, 1589, 1582, 525, 1589, 1605, 525, 1590, 1580,
+ 525, 1590, 1581, 525, 1590, 1582, 525, 1590, 1605, 525, 1591, 1581, 525,
+ 1592, 1605, 525, 1593, 1580, 525, 1593, 1605, 525, 1594, 1580, 525, 1594,
+ 1605, 525, 1601, 1580, 525, 1601, 1581, 525, 1601, 1582, 525, 1601, 1605,
+ 525, 1602, 1581, 525, 1602, 1605, 525, 1603, 1580, 525, 1603, 1581, 525,
+ 1603, 1582, 525, 1603, 1604, 525, 1603, 1605, 525, 1604, 1580, 525, 1604,
+ 1581, 525, 1604, 1582, 525, 1604, 1605, 525, 1604, 1607, 525, 1605, 1580,
+ 525, 1605, 1581, 525, 1605, 1582, 525, 1605, 1605, 525, 1606, 1580, 525,
+ 1606, 1581, 525, 1606, 1582, 525, 1606, 1605, 525, 1606, 1607, 525, 1607,
+ 1580, 525, 1607, 1605, 525, 1607, 1648, 525, 1610, 1580, 525, 1610, 1581,
+ 525, 1610, 1582, 525, 1610, 1605, 525, 1610, 1607, 526, 1574, 1605, 526,
+ 1574, 1607, 526, 1576, 1605, 526, 1576, 1607, 526, 1578, 1605, 526, 1578,
+ 1607, 526, 1579, 1605, 526, 1579, 1607, 526, 1587, 1605, 526, 1587, 1607,
+ 526, 1588, 1605, 526, 1588, 1607, 526, 1603, 1604, 526, 1603, 1605, 526,
+ 1604, 1605, 526, 1606, 1605, 526, 1606, 1607, 526, 1610, 1605, 526, 1610,
+ 1607, 782, 1600, 1614, 1617, 782, 1600, 1615, 1617, 782, 1600, 1616,
+ 1617, 523, 1591, 1609, 523, 1591, 1610, 523, 1593, 1609, 523, 1593, 1610,
+ 523, 1594, 1609, 523, 1594, 1610, 523, 1587, 1609, 523, 1587, 1610, 523,
+ 1588, 1609, 523, 1588, 1610, 523, 1581, 1609, 523, 1581, 1610, 523, 1580,
+ 1609, 523, 1580, 1610, 523, 1582, 1609, 523, 1582, 1610, 523, 1589, 1609,
+ 523, 1589, 1610, 523, 1590, 1609, 523, 1590, 1610, 523, 1588, 1580, 523,
+ 1588, 1581, 523, 1588, 1582, 523, 1588, 1605, 523, 1588, 1585, 523, 1587,
+ 1585, 523, 1589, 1585, 523, 1590, 1585, 524, 1591, 1609, 524, 1591, 1610,
+ 524, 1593, 1609, 524, 1593, 1610, 524, 1594, 1609, 524, 1594, 1610, 524,
+ 1587, 1609, 524, 1587, 1610, 524, 1588, 1609, 524, 1588, 1610, 524, 1581,
+ 1609, 524, 1581, 1610, 524, 1580, 1609, 524, 1580, 1610, 524, 1582, 1609,
+ 524, 1582, 1610, 524, 1589, 1609, 524, 1589, 1610, 524, 1590, 1609, 524,
+ 1590, 1610, 524, 1588, 1580, 524, 1588, 1581, 524, 1588, 1582, 524, 1588,
+ 1605, 524, 1588, 1585, 524, 1587, 1585, 524, 1589, 1585, 524, 1590, 1585,
+ 525, 1588, 1580, 525, 1588, 1581, 525, 1588, 1582, 525, 1588, 1605, 525,
+ 1587, 1607, 525, 1588, 1607, 525, 1591, 1605, 526, 1587, 1580, 526, 1587,
+ 1581, 526, 1587, 1582, 526, 1588, 1580, 526, 1588, 1581, 526, 1588, 1582,
+ 526, 1591, 1605, 526, 1592, 1605, 524, 1575, 1611, 523, 1575, 1611, 781,
+ 1578, 1580, 1605, 780, 1578, 1581, 1580, 781, 1578, 1581, 1580, 781,
+ 1578, 1581, 1605, 781, 1578, 1582, 1605, 781, 1578, 1605, 1580, 781,
+ 1578, 1605, 1581, 781, 1578, 1605, 1582, 780, 1580, 1605, 1581, 781,
+ 1580, 1605, 1581, 780, 1581, 1605, 1610, 780, 1581, 1605, 1609, 781,
+ 1587, 1581, 1580, 781, 1587, 1580, 1581, 780, 1587, 1580, 1609, 780,
+ 1587, 1605, 1581, 781, 1587, 1605, 1581, 781, 1587, 1605, 1580, 780,
+ 1587, 1605, 1605, 781, 1587, 1605, 1605, 780, 1589, 1581, 1581, 781,
+ 1589, 1581, 1581, 780, 1589, 1605, 1605, 780, 1588, 1581, 1605, 781,
+ 1588, 1581, 1605, 780, 1588, 1580, 1610, 780, 1588, 1605, 1582, 781,
+ 1588, 1605, 1582, 780, 1588, 1605, 1605, 781, 1588, 1605, 1605, 780,
+ 1590, 1581, 1609, 780, 1590, 1582, 1605, 781, 1590, 1582, 1605, 780,
+ 1591, 1605, 1581, 781, 1591, 1605, 1581, 781, 1591, 1605, 1605, 780,
+ 1591, 1605, 1610, 780, 1593, 1580, 1605, 780, 1593, 1605, 1605, 781,
+ 1593, 1605, 1605, 780, 1593, 1605, 1609, 780, 1594, 1605, 1605, 780,
+ 1594, 1605, 1610, 780, 1594, 1605, 1609, 780, 1601, 1582, 1605, 781,
+ 1601, 1582, 1605, 780, 1602, 1605, 1581, 780, 1602, 1605, 1605, 780,
+ 1604, 1581, 1605, 780, 1604, 1581, 1610, 780, 1604, 1581, 1609, 781,
+ 1604, 1580, 1580, 780, 1604, 1580, 1580, 780, 1604, 1582, 1605, 781,
+ 1604, 1582, 1605, 780, 1604, 1605, 1581, 781, 1604, 1605, 1581, 781,
+ 1605, 1581, 1580, 781, 1605, 1581, 1605, 780, 1605, 1581, 1610, 781,
+ 1605, 1580, 1581, 781, 1605, 1580, 1605, 781, 1605, 1582, 1580, 781,
+ 1605, 1582, 1605, 781, 1605, 1580, 1582, 781, 1607, 1605, 1580, 781,
+ 1607, 1605, 1605, 781, 1606, 1581, 1605, 780, 1606, 1581, 1609, 780,
+ 1606, 1580, 1605, 781, 1606, 1580, 1605, 780, 1606, 1580, 1609, 780,
+ 1606, 1605, 1610, 780, 1606, 1605, 1609, 780, 1610, 1605, 1605, 781,
+ 1610, 1605, 1605, 780, 1576, 1582, 1610, 780, 1578, 1580, 1610, 780,
+ 1578, 1580, 1609, 780, 1578, 1582, 1610, 780, 1578, 1582, 1609, 780,
+ 1578, 1605, 1610, 780, 1578, 1605, 1609, 780, 1580, 1605, 1610, 780,
+ 1580, 1581, 1609, 780, 1580, 1605, 1609, 780, 1587, 1582, 1609, 780,
+ 1589, 1581, 1610, 780, 1588, 1581, 1610, 780, 1590, 1581, 1610, 780,
+ 1604, 1580, 1610, 780, 1604, 1605, 1610, 780, 1610, 1581, 1610, 780,
+ 1610, 1580, 1610, 780, 1610, 1605, 1610, 780, 1605, 1605, 1610, 780,
+ 1602, 1605, 1610, 780, 1606, 1581, 1610, 781, 1602, 1605, 1581, 781,
+ 1604, 1581, 1605, 780, 1593, 1605, 1610, 780, 1603, 1605, 1610, 781,
+ 1606, 1580, 1581, 780, 1605, 1582, 1610, 781, 1604, 1580, 1605, 780,
+ 1603, 1605, 1605, 780, 1604, 1580, 1605, 780, 1606, 1580, 1581, 780,
+ 1580, 1581, 1610, 780, 1581, 1580, 1610, 780, 1605, 1580, 1610, 780,
+ 1601, 1605, 1610, 780, 1576, 1581, 1610, 781, 1603, 1605, 1605, 781,
+ 1593, 1580, 1605, 781, 1589, 1605, 1605, 780, 1587, 1582, 1610, 780,
+ 1606, 1580, 1610, 779, 1589, 1604, 1746, 779, 1602, 1604, 1746, 1035,
+ 1575, 1604, 1604, 1607, 1035, 1575, 1603, 1576, 1585, 1035, 1605, 1581,
+ 1605, 1583, 1035, 1589, 1604, 1593, 1605, 1035, 1585, 1587, 1608, 1604,
+ 1035, 1593, 1604, 1610, 1607, 1035, 1608, 1587, 1604, 1605, 779, 1589,
+ 1604, 1609, 4619, 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593,
+ 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605, 2059, 1580, 1604, 32, 1580,
+ 1604, 1575, 1604, 1607, 1035, 1585, 1740, 1575, 1604, 265, 44, 265,
+ 12289, 265, 12290, 265, 58, 265, 59, 265, 33, 265, 63, 265, 12310, 265,
+ 12311, 265, 8230, 265, 8229, 265, 8212, 265, 8211, 265, 95, 265, 40, 265,
+ 41, 265, 123, 265, 125, 265, 12308, 265, 12309, 265, 12304, 265, 12305,
+ 265, 12298, 265, 12299, 265, 12296, 265, 12297, 265, 12300, 265, 12301,
+ 265, 12302, 265, 12303, 265, 91, 265, 93, 258, 8254, 258, 95, 271, 44,
+ 271, 12289, 271, 46, 271, 59, 271, 58, 271, 63, 271, 33, 271, 8212, 271,
+ 40, 271, 41, 271, 123, 271, 125, 271, 12308, 271, 12309, 271, 35, 271,
+ 38, 271, 42, 271, 43, 271, 45, 271, 60, 271, 62, 271, 61, 271, 92, 271,
+ 36, 271, 37, 271, 64, 523, 32, 1611, 526, 1600, 1611, 523, 32, 1612, 523,
+ 32, 1613, 523, 32, 1614, 526, 1600, 1614, 523, 32, 1615, 526, 1600, 1615,
+ 523, 32, 1616, 526, 1600, 1616, 523, 32, 1617, 526, 1600, 1617, 523, 32,
+ 1618, 526, 1600, 1618, 267, 1569, 267, 1570, 268, 1570, 267, 1571, 268,
+ 1571, 267, 1572, 268, 1572, 267, 1573, 268, 1573, 267, 1574, 268, 1574,
+ 269, 1574, 270, 1574, 267, 1575, 268, 1575, 267, 1576, 268, 1576, 269,
+ 1576, 270, 1576, 267, 1577, 268, 1577, 267, 1578, 268, 1578, 269, 1578,
+ 270, 1578, 267, 1579, 268, 1579, 269, 1579, 270, 1579, 267, 1580, 268,
+ 1580, 269, 1580, 270, 1580, 267, 1581, 268, 1581, 269, 1581, 270, 1581,
+ 267, 1582, 268, 1582, 269, 1582, 270, 1582, 267, 1583, 268, 1583, 267,
+ 1584, 268, 1584, 267, 1585, 268, 1585, 267, 1586, 268, 1586, 267, 1587,
+ 268, 1587, 269, 1587, 270, 1587, 267, 1588, 268, 1588, 269, 1588, 270,
+ 1588, 267, 1589, 268, 1589, 269, 1589, 270, 1589, 267, 1590, 268, 1590,
+ 269, 1590, 270, 1590, 267, 1591, 268, 1591, 269, 1591, 270, 1591, 267,
+ 1592, 268, 1592, 269, 1592, 270, 1592, 267, 1593, 268, 1593, 269, 1593,
+ 270, 1593, 267, 1594, 268, 1594, 269, 1594, 270, 1594, 267, 1601, 268,
+ 1601, 269, 1601, 270, 1601, 267, 1602, 268, 1602, 269, 1602, 270, 1602,
+ 267, 1603, 268, 1603, 269, 1603, 270, 1603, 267, 1604, 268, 1604, 269,
+ 1604, 270, 1604, 267, 1605, 268, 1605, 269, 1605, 270, 1605, 267, 1606,
+ 268, 1606, 269, 1606, 270, 1606, 267, 1607, 268, 1607, 269, 1607, 270,
+ 1607, 267, 1608, 268, 1608, 267, 1609, 268, 1609, 267, 1610, 268, 1610,
+ 269, 1610, 270, 1610, 523, 1604, 1570, 524, 1604, 1570, 523, 1604, 1571,
+ 524, 1604, 1571, 523, 1604, 1573, 524, 1604, 1573, 523, 1604, 1575, 524,
+ 1604, 1575, 264, 33, 264, 34, 264, 35, 264, 36, 264, 37, 264, 38, 264,
+ 39, 264, 40, 264, 41, 264, 42, 264, 43, 264, 44, 264, 45, 264, 46, 264,
+ 47, 264, 48, 264, 49, 264, 50, 264, 51, 264, 52, 264, 53, 264, 54, 264,
+ 55, 264, 56, 264, 57, 264, 58, 264, 59, 264, 60, 264, 61, 264, 62, 264,
+ 63, 264, 64, 264, 65, 264, 66, 264, 67, 264, 68, 264, 69, 264, 70, 264,
+ 71, 264, 72, 264, 73, 264, 74, 264, 75, 264, 76, 264, 77, 264, 78, 264,
+ 79, 264, 80, 264, 81, 264, 82, 264, 83, 264, 84, 264, 85, 264, 86, 264,
+ 87, 264, 88, 264, 89, 264, 90, 264, 91, 264, 92, 264, 93, 264, 94, 264,
+ 95, 264, 96, 264, 97, 264, 98, 264, 99, 264, 100, 264, 101, 264, 102,
+ 264, 103, 264, 104, 264, 105, 264, 106, 264, 107, 264, 108, 264, 109,
+ 264, 110, 264, 111, 264, 112, 264, 113, 264, 114, 264, 115, 264, 116,
+ 264, 117, 264, 118, 264, 119, 264, 120, 264, 121, 264, 122, 264, 123,
+ 264, 124, 264, 125, 264, 126, 264, 10629, 264, 10630, 272, 12290, 272,
+ 12300, 272, 12301, 272, 12289, 272, 12539, 272, 12530, 272, 12449, 272,
+ 12451, 272, 12453, 272, 12455, 272, 12457, 272, 12515, 272, 12517, 272,
+ 12519, 272, 12483, 272, 12540, 272, 12450, 272, 12452, 272, 12454, 272,
+ 12456, 272, 12458, 272, 12459, 272, 12461, 272, 12463, 272, 12465, 272,
+ 12467, 272, 12469, 272, 12471, 272, 12473, 272, 12475, 272, 12477, 272,
+ 12479, 272, 12481, 272, 12484, 272, 12486, 272, 12488, 272, 12490, 272,
+ 12491, 272, 12492, 272, 12493, 272, 12494, 272, 12495, 272, 12498, 272,
+ 12501, 272, 12504, 272, 12507, 272, 12510, 272, 12511, 272, 12512, 272,
+ 12513, 272, 12514, 272, 12516, 272, 12518, 272, 12520, 272, 12521, 272,
+ 12522, 272, 12523, 272, 12524, 272, 12525, 272, 12527, 272, 12531, 272,
+ 12441, 272, 12442, 272, 12644, 272, 12593, 272, 12594, 272, 12595, 272,
+ 12596, 272, 12597, 272, 12598, 272, 12599, 272, 12600, 272, 12601, 272,
+ 12602, 272, 12603, 272, 12604, 272, 12605, 272, 12606, 272, 12607, 272,
+ 12608, 272, 12609, 272, 12610, 272, 12611, 272, 12612, 272, 12613, 272,
+ 12614, 272, 12615, 272, 12616, 272, 12617, 272, 12618, 272, 12619, 272,
+ 12620, 272, 12621, 272, 12622, 272, 12623, 272, 12624, 272, 12625, 272,
+ 12626, 272, 12627, 272, 12628, 272, 12629, 272, 12630, 272, 12631, 272,
+ 12632, 272, 12633, 272, 12634, 272, 12635, 272, 12636, 272, 12637, 272,
+ 12638, 272, 12639, 272, 12640, 272, 12641, 272, 12642, 272, 12643, 264,
+ 162, 264, 163, 264, 172, 264, 175, 264, 166, 264, 165, 264, 8361, 272,
+ 9474, 272, 8592, 272, 8593, 272, 8594, 272, 8595, 272, 9632, 272, 9675,
+ 259, 720, 259, 721, 259, 230, 259, 665, 259, 595, 259, 675, 259, 43878,
+ 259, 677, 259, 676, 259, 598, 259, 599, 259, 7569, 259, 600, 259, 606,
+ 259, 681, 259, 612, 259, 610, 259, 608, 259, 667, 259, 295, 259, 668,
+ 259, 615, 259, 644, 259, 682, 259, 683, 259, 620, 259, 122628, 259,
+ 42894, 259, 622, 259, 122629, 259, 654, 259, 122630, 259, 248, 259, 630,
+ 259, 631, 259, 113, 259, 634, 259, 122632, 259, 637, 259, 638, 259, 640,
+ 259, 680, 259, 678, 259, 43879, 259, 679, 259, 648, 259, 11377, 259, 655,
+ 259, 673, 259, 674, 259, 664, 259, 448, 259, 449, 259, 450, 259, 122634,
+ 259, 122654, 512, 69785, 69818, 512, 69787, 69818, 512, 69797, 69818,
+ 512, 69937, 69927, 512, 69938, 69927, 512, 70471, 70462, 512, 70471,
+ 70487, 512, 70841, 70842, 512, 70841, 70832, 512, 70841, 70845, 512,
+ 71096, 71087, 512, 71097, 71087, 512, 71989, 71984, 512, 119127, 119141,
+ 512, 119128, 119141, 512, 119135, 119150, 512, 119135, 119151, 512,
+ 119135, 119152, 512, 119135, 119153, 512, 119135, 119154, 512, 119225,
+ 119141, 512, 119226, 119141, 512, 119227, 119150, 512, 119228, 119150,
+ 512, 119227, 119151, 512, 119228, 119151, 262, 65, 262, 71, 262, 74, 262,
+ 75, 262, 79, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262,
+ 89, 262, 97, 262, 98, 262, 99, 262, 102, 262, 107, 262, 109, 262, 110,
+ 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118,
+ 262, 119, 262, 120, 262, 121, 262, 122, 262, 305, 262, 567, 262, 913,
+ 262, 914, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921,
+ 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 929,
+ 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262, 936,
+ 262, 937, 262, 8711, 262, 945, 262, 946, 262, 948, 262, 949, 262, 950,
+ 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262, 956, 262, 957,
+ 262, 958, 262, 959, 262, 961, 262, 962, 262, 963, 262, 964, 262, 965,
+ 262, 966, 262, 967, 262, 968, 262, 969, 262, 8706, 262, 1013, 262, 977,
+ 262, 1008, 262, 981, 262, 1009, 262, 982, 262, 988, 262, 989, 262, 48,
+ 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56,
+ 262, 57, 259, 1072, 259, 1073, 259, 1074, 259, 1075, 259, 1076, 259,
+ 1077, 259, 1078, 259, 1079, 259, 1080, 259, 1082, 259, 1083, 259, 1084,
+ 259, 1086, 259, 1087, 259, 1088, 259, 1089, 259, 1090, 259, 1091, 259,
+ 1092, 259, 1093, 259, 1094, 259, 1095, 259, 1096, 259, 1099, 259, 1101,
+ 259, 1102, 259, 42633, 259, 1241, 259, 1110, 259, 1112, 259, 1257, 259,
+ 1199, 259, 1231, 261, 1072, 261, 1073, 261, 1074, 261, 1075, 261, 1076,
+ 261, 1077, 261, 1078, 261, 1079, 261, 1080, 261, 1082, 261, 1083, 261,
+ 1086, 261, 1087, 261, 1089, 261, 1091, 261, 1092, 261, 1093, 261, 1094,
+ 261, 1095, 261, 1096, 261, 1098, 261, 1099, 261, 1169, 261, 1110, 261,
+ 1109, 261, 1119, 259, 1195, 259, 42577, 259, 1201, 262, 1575, 262, 1576,
+ 262, 1580, 262, 1583, 262, 1608, 262, 1586, 262, 1581, 262, 1591, 262,
+ 1610, 262, 1603, 262, 1604, 262, 1605, 262, 1606, 262, 1587, 262, 1593,
+ 262, 1601, 262, 1589, 262, 1602, 262, 1585, 262, 1588, 262, 1578, 262,
+ 1579, 262, 1582, 262, 1584, 262, 1590, 262, 1592, 262, 1594, 262, 1646,
+ 262, 1722, 262, 1697, 262, 1647, 262, 1607, 514, 48, 46, 514, 48, 44,
+ 514, 49, 44, 514, 50, 44, 514, 51, 44, 514, 52, 44, 514, 53, 44, 514, 54,
+ 44, 514, 55, 44, 514, 56, 44, 514, 57, 44, 770, 40, 65, 41, 770, 40, 66,
+ 41, 770, 40, 67, 41, 770, 40, 68, 41, 770, 40, 69, 41, 770, 40, 70, 41,
+ 770, 40, 71, 41, 770, 40, 72, 41, 770, 40, 73, 41, 770, 40, 74, 41, 770,
+ 40, 75, 41, 770, 40, 76, 41, 770, 40, 77, 41, 770, 40, 78, 41, 770, 40,
+ 79, 41, 770, 40, 80, 41, 770, 40, 81, 41, 770, 40, 82, 41, 770, 40, 83,
+ 41, 770, 40, 84, 41, 770, 40, 85, 41, 770, 40, 86, 41, 770, 40, 87, 41,
+ 770, 40, 88, 41, 770, 40, 89, 41, 770, 40, 90, 41, 770, 12308, 83, 12309,
+ 519, 67, 68, 519, 87, 90, 266, 65, 266, 66, 266, 67, 266, 68, 266, 69,
+ 266, 70, 266, 71, 266, 72, 266, 73, 266, 74, 266, 75, 266, 76, 266, 77,
+ 266, 78, 266, 79, 266, 80, 266, 81, 266, 82, 266, 83, 266, 84, 266, 85,
+ 266, 86, 266, 87, 266, 88, 266, 89, 266, 90, 522, 72, 86, 522, 83, 68,
+ 522, 83, 83, 778, 80, 80, 86, 522, 87, 67, 515, 77, 67, 515, 77, 68, 515,
+ 77, 82, 522, 68, 74, 522, 12411, 12363, 522, 12467, 12467, 266, 12469,
+ 266, 25163, 266, 23383, 266, 21452, 266, 12487, 266, 20108, 266, 22810,
+ 266, 35299, 266, 22825, 266, 20132, 266, 26144, 266, 28961, 266, 26009,
+ 266, 21069, 266, 24460, 266, 20877, 266, 26032, 266, 21021, 266, 32066,
+ 266, 29983, 266, 36009, 266, 22768, 266, 21561, 266, 28436, 266, 25237,
+ 266, 25429, 266, 19968, 266, 19977, 266, 36938, 266, 24038, 266, 20013,
+ 266, 21491, 266, 25351, 266, 36208, 266, 25171, 266, 31105, 266, 31354,
+ 266, 21512, 266, 28288, 266, 26377, 266, 26376, 266, 30003, 266, 21106,
+ 266, 21942, 266, 37197, 770, 12308, 26412, 12309, 770, 12308, 19977,
+ 12309, 770, 12308, 20108, 12309, 770, 12308, 23433, 12309, 770, 12308,
+ 28857, 12309, 770, 12308, 25171, 12309, 770, 12308, 30423, 12309, 770,
+ 12308, 21213, 12309, 770, 12308, 25943, 12309, 263, 24471, 263, 21487,
+ 256, 20029, 256, 20024, 256, 20033, 256, 131362, 256, 20320, 256, 20411,
+ 256, 20482, 256, 20602, 256, 20633, 256, 20687, 256, 13470, 256, 132666,
+ 256, 20820, 256, 20836, 256, 20855, 256, 132380, 256, 13497, 256, 20839,
+ 256, 20877, 256, 132427, 256, 20887, 256, 20900, 256, 20172, 256, 20908,
+ 256, 168415, 256, 20981, 256, 20995, 256, 13535, 256, 21051, 256, 21062,
+ 256, 21106, 256, 21111, 256, 13589, 256, 21253, 256, 21254, 256, 21321,
+ 256, 21338, 256, 21363, 256, 21373, 256, 21375, 256, 133676, 256, 28784,
+ 256, 21450, 256, 21471, 256, 133987, 256, 21483, 256, 21489, 256, 21510,
+ 256, 21662, 256, 21560, 256, 21576, 256, 21608, 256, 21666, 256, 21750,
+ 256, 21776, 256, 21843, 256, 21859, 256, 21892, 256, 21931, 256, 21939,
+ 256, 21954, 256, 22294, 256, 22295, 256, 22097, 256, 22132, 256, 22766,
+ 256, 22478, 256, 22516, 256, 22541, 256, 22411, 256, 22578, 256, 22577,
+ 256, 22700, 256, 136420, 256, 22770, 256, 22775, 256, 22790, 256, 22810,
+ 256, 22818, 256, 22882, 256, 136872, 256, 136938, 256, 23020, 256, 23067,
+ 256, 23079, 256, 23000, 256, 23142, 256, 14062, 256, 14076, 256, 23304,
+ 256, 23358, 256, 137672, 256, 23491, 256, 23512, 256, 23539, 256, 138008,
+ 256, 23551, 256, 23558, 256, 24403, 256, 23586, 256, 14209, 256, 23648,
+ 256, 23744, 256, 23693, 256, 138724, 256, 23875, 256, 138726, 256, 23918,
+ 256, 23915, 256, 23932, 256, 24033, 256, 24034, 256, 14383, 256, 24061,
+ 256, 24104, 256, 24125, 256, 24169, 256, 14434, 256, 139651, 256, 14460,
+ 256, 24240, 256, 24243, 256, 24246, 256, 172946, 256, 24318, 256, 140081,
+ 256, 33281, 256, 24354, 256, 14535, 256, 144056, 256, 156122, 256, 24418,
+ 256, 24427, 256, 14563, 256, 24474, 256, 24525, 256, 24535, 256, 24569,
+ 256, 24705, 256, 14650, 256, 14620, 256, 141012, 256, 24775, 256, 24904,
+ 256, 24908, 256, 24954, 256, 25010, 256, 24996, 256, 25007, 256, 25054,
+ 256, 25104, 256, 25115, 256, 25181, 256, 25265, 256, 25300, 256, 25424,
+ 256, 142092, 256, 25405, 256, 25340, 256, 25448, 256, 25475, 256, 25572,
+ 256, 142321, 256, 25634, 256, 25541, 256, 25513, 256, 14894, 256, 25705,
+ 256, 25726, 256, 25757, 256, 25719, 256, 14956, 256, 25964, 256, 143370,
+ 256, 26083, 256, 26360, 256, 26185, 256, 15129, 256, 15112, 256, 15076,
+ 256, 20882, 256, 20885, 256, 26368, 256, 26268, 256, 32941, 256, 17369,
+ 256, 26401, 256, 26462, 256, 26451, 256, 144323, 256, 15177, 256, 26618,
+ 256, 26501, 256, 26706, 256, 144493, 256, 26766, 256, 26655, 256, 26900,
+ 256, 26946, 256, 27043, 256, 27114, 256, 27304, 256, 145059, 256, 27355,
+ 256, 15384, 256, 27425, 256, 145575, 256, 27476, 256, 15438, 256, 27506,
+ 256, 27551, 256, 27579, 256, 146061, 256, 138507, 256, 146170, 256,
+ 27726, 256, 146620, 256, 27839, 256, 27853, 256, 27751, 256, 27926, 256,
+ 27966, 256, 28009, 256, 28024, 256, 28037, 256, 146718, 256, 27956, 256,
+ 28207, 256, 28270, 256, 15667, 256, 28359, 256, 147153, 256, 28153, 256,
+ 28526, 256, 147294, 256, 147342, 256, 28614, 256, 28729, 256, 28699, 256,
+ 15766, 256, 28746, 256, 28797, 256, 28791, 256, 28845, 256, 132389, 256,
+ 28997, 256, 148067, 256, 29084, 256, 148395, 256, 29224, 256, 29264, 256,
+ 149000, 256, 29312, 256, 29333, 256, 149301, 256, 149524, 256, 29562,
+ 256, 29579, 256, 16044, 256, 29605, 256, 16056, 256, 29767, 256, 29788,
+ 256, 29829, 256, 29898, 256, 16155, 256, 29988, 256, 150582, 256, 30014,
+ 256, 150674, 256, 139679, 256, 30224, 256, 151457, 256, 151480, 256,
+ 151620, 256, 16380, 256, 16392, 256, 151795, 256, 151794, 256, 151833,
+ 256, 151859, 256, 30494, 256, 30495, 256, 30603, 256, 16454, 256, 16534,
+ 256, 152605, 256, 30798, 256, 16611, 256, 153126, 256, 153242, 256,
+ 153285, 256, 31211, 256, 16687, 256, 31306, 256, 31311, 256, 153980, 256,
+ 154279, 256, 31470, 256, 16898, 256, 154539, 256, 31686, 256, 31689, 256,
+ 16935, 256, 154752, 256, 31954, 256, 17056, 256, 31976, 256, 31971, 256,
+ 32000, 256, 155526, 256, 32099, 256, 17153, 256, 32199, 256, 32258, 256,
+ 32325, 256, 17204, 256, 156200, 256, 156231, 256, 17241, 256, 156377,
+ 256, 32634, 256, 156478, 256, 32661, 256, 32762, 256, 156890, 256,
+ 156963, 256, 32864, 256, 157096, 256, 32880, 256, 144223, 256, 17365,
+ 256, 32946, 256, 33027, 256, 17419, 256, 33086, 256, 23221, 256, 157607,
+ 256, 157621, 256, 144275, 256, 144284, 256, 33284, 256, 36766, 256,
+ 17515, 256, 33425, 256, 33419, 256, 33437, 256, 21171, 256, 33457, 256,
+ 33459, 256, 33469, 256, 33510, 256, 158524, 256, 33565, 256, 33635, 256,
+ 33709, 256, 33571, 256, 33725, 256, 33767, 256, 33619, 256, 33738, 256,
+ 33740, 256, 33756, 256, 158774, 256, 159083, 256, 158933, 256, 17707,
+ 256, 34033, 256, 34035, 256, 34070, 256, 160714, 256, 34148, 256, 159532,
+ 256, 17757, 256, 17761, 256, 159665, 256, 159954, 256, 17771, 256, 34384,
+ 256, 34407, 256, 34409, 256, 34473, 256, 34440, 256, 34574, 256, 34530,
+ 256, 34600, 256, 34667, 256, 34694, 256, 17879, 256, 34785, 256, 34817,
+ 256, 17913, 256, 34912, 256, 34915, 256, 161383, 256, 35031, 256, 35038,
+ 256, 17973, 256, 35066, 256, 13499, 256, 161966, 256, 162150, 256, 18110,
+ 256, 18119, 256, 35488, 256, 35925, 256, 162984, 256, 36011, 256, 36033,
+ 256, 36123, 256, 36215, 256, 163631, 256, 133124, 256, 36299, 256, 36284,
+ 256, 36336, 256, 133342, 256, 36564, 256, 165330, 256, 165357, 256,
+ 37012, 256, 37105, 256, 37137, 256, 165678, 256, 37147, 256, 37432, 256,
+ 37591, 256, 37592, 256, 37500, 256, 37881, 256, 37909, 256, 166906, 256,
+ 38283, 256, 18837, 256, 38327, 256, 167287, 256, 18918, 256, 38595, 256,
+ 23986, 256, 38691, 256, 168261, 256, 168474, 256, 19054, 256, 19062, 256,
+ 38880, 256, 168970, 256, 19122, 256, 169110, 256, 38953, 256, 169398,
+ 256, 39138, 256, 19251, 256, 39209, 256, 39335, 256, 39362, 256, 39422,
+ 256, 19406, 256, 170800, 256, 40000, 256, 40189, 256, 19662, 256, 19693,
+ 256, 40295, 256, 172238, 256, 19704, 256, 172293, 256, 172558, 256,
+ 172689, 256, 40635, 256, 19798, 256, 40697, 256, 40702, 256, 40709, 256,
+ 40719, 256, 40726, 256, 40763, 256, 173568,
+};
+
+/* index tables for the decomposition data */
+#define DECOMP_SHIFT 7
+static const unsigned char decomp_index1[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 10, 11, 12, 0, 0, 0, 0, 13, 14, 15, 0,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 0, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44,
+ 45, 0, 0, 46, 0, 47, 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 60, 61, 0, 0, 0, 0, 0, 0, 62, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 79, 0, 0, 0, 80, 0, 0, 81, 0,
+ 82, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 85, 0, 0, 0, 0, 86, 87,
+ 88, 89, 90, 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 95, 96, 0, 0, 0, 0, 97, 98, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 102, 103, 104, 105, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+static const unsigned short decomp_index2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 6, 0, 0, 0, 0, 8, 0, 0, 11, 13, 15, 18, 0, 0, 20, 23, 25, 0, 27,
+ 31, 35, 0, 39, 42, 45, 48, 51, 54, 0, 57, 60, 63, 66, 69, 72, 75, 78, 81,
+ 0, 84, 87, 90, 93, 96, 99, 0, 0, 102, 105, 108, 111, 114, 0, 0, 117, 120,
+ 123, 126, 129, 132, 0, 135, 138, 141, 144, 147, 150, 153, 156, 159, 0,
+ 162, 165, 168, 171, 174, 177, 0, 0, 180, 183, 186, 189, 192, 0, 195, 198,
+ 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240,
+ 243, 0, 0, 246, 249, 252, 255, 258, 261, 264, 267, 270, 273, 276, 279,
+ 282, 285, 288, 291, 294, 297, 300, 303, 0, 0, 306, 309, 312, 315, 318,
+ 321, 324, 327, 330, 0, 333, 336, 339, 342, 345, 348, 0, 351, 354, 357,
+ 360, 363, 366, 369, 372, 0, 0, 375, 378, 381, 384, 387, 390, 393, 0, 0,
+ 396, 399, 402, 405, 408, 411, 0, 0, 414, 417, 420, 423, 426, 429, 432,
+ 435, 438, 441, 444, 447, 450, 453, 456, 459, 462, 465, 0, 0, 468, 471,
+ 474, 477, 480, 483, 486, 489, 492, 495, 498, 501, 504, 507, 510, 513,
+ 516, 519, 522, 525, 528, 531, 534, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 539, 542,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 545, 548, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 551, 554, 557, 560, 563, 566, 569, 572,
+ 575, 578, 581, 584, 587, 590, 593, 596, 599, 602, 605, 608, 611, 614,
+ 617, 620, 623, 0, 626, 629, 632, 635, 638, 641, 0, 0, 644, 647, 650, 653,
+ 656, 659, 662, 665, 668, 671, 674, 677, 680, 683, 686, 689, 0, 0, 692,
+ 695, 698, 701, 704, 707, 710, 713, 716, 719, 722, 725, 728, 731, 734,
+ 737, 740, 743, 746, 749, 752, 755, 758, 761, 764, 767, 770, 773, 776,
+ 779, 782, 785, 788, 791, 794, 797, 0, 0, 800, 803, 0, 0, 0, 0, 0, 0, 806,
+ 809, 812, 815, 818, 821, 824, 827, 830, 833, 836, 839, 842, 845, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 848, 850, 852, 854, 856, 858, 860, 862, 864, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 866,
+ 869, 872, 875, 878, 881, 0, 0, 884, 886, 888, 890, 892, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 894, 896, 0, 898, 900, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 903, 0, 0, 0, 0,
+ 0, 905, 0, 0, 0, 908, 0, 0, 0, 0, 0, 15, 910, 913, 916, 918, 921, 924, 0,
+ 927, 0, 930, 933, 936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 939, 942, 945, 948, 951, 954, 957, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 960, 963,
+ 966, 969, 972, 0, 975, 977, 979, 981, 984, 987, 989, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 991, 993, 995, 0,
+ 997, 999, 0, 0, 0, 1001, 0, 0, 0, 0, 0, 0, 1003, 1006, 0, 1009, 0, 0, 0,
+ 1012, 0, 0, 0, 0, 1015, 1018, 1021, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1030, 1033, 0, 1036, 0, 0, 0, 1039, 0, 0, 0, 0,
+ 1042, 1045, 1048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1051, 1054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1057, 1060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1063, 1066, 1069, 1072, 0, 0, 1075, 1078, 0, 0, 1081, 1084,
+ 1087, 1090, 1093, 1096, 0, 0, 1099, 1102, 1105, 1108, 1111, 1114, 0, 0,
+ 1117, 1120, 1123, 1126, 1129, 1132, 1135, 1138, 1141, 1144, 1147, 1150,
+ 0, 0, 1153, 1156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1159, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1162, 1165, 1168, 1171, 1174, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1177, 1180, 1183, 1186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1189, 0, 1192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1198, 0, 0, 0,
+ 0, 0, 0, 0, 1201, 0, 0, 1204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1207,
+ 1210, 1213, 1216, 1219, 1222, 1225, 1228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1231, 1234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1237, 1240,
+ 0, 1243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1246, 0, 0, 1249, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1252, 1255, 1258, 0, 0, 1261, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1264, 0, 0, 1267, 1270, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1273, 1276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1282, 1285, 1288, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1294, 0, 0, 0, 0, 0, 0, 1297, 1300, 0, 1303, 1306, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1309, 1312, 1315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1318, 0, 1321, 1324, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1336, 1339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1344, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1347, 0, 0, 0, 0, 1350, 0, 0, 0, 0, 1353, 0, 0, 0, 0, 1356, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1362, 0,
+ 1365, 1368, 1371, 1374, 1377, 0, 0, 0, 0, 0, 0, 0, 1380, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1383, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1386, 0, 0, 0, 0, 1389, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 1395, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1401,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1404, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1406, 0, 1409, 0, 1412, 0, 1415, 0, 1418, 0, 0,
+ 0, 1421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1424, 0, 1427,
+ 0, 0, 1430, 1433, 0, 1436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1439, 1441, 1443, 0,
+ 1445, 1447, 1449, 1451, 1453, 1455, 1457, 1459, 1461, 1463, 1465, 0,
+ 1467, 1469, 1471, 1473, 1475, 1477, 1479, 6, 1481, 1483, 1485, 1487,
+ 1489, 1491, 1493, 1495, 1497, 1499, 0, 1501, 1503, 1505, 25, 1507, 1509,
+ 1511, 1513, 1515, 1517, 1519, 1521, 1523, 1525, 1527, 1529, 1531, 1533,
+ 1535, 1537, 1539, 1541, 1543, 1545, 1547, 1549, 1551, 1553, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1557,
+ 1559, 1561, 1563, 1497, 1565, 1567, 1569, 1571, 1573, 1575, 1577, 1579,
+ 1581, 1583, 1585, 1587, 1589, 1591, 1593, 1595, 1597, 1599, 1601, 1603,
+ 1605, 1607, 1609, 1611, 1613, 1615, 1617, 1619, 1621, 1623, 1625, 1627,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1629, 1632, 1635, 1638,
+ 1641, 1644, 1647, 1650, 1653, 1656, 1659, 1662, 1665, 1668, 1671, 1674,
+ 1677, 1680, 1683, 1686, 1689, 1692, 1695, 1698, 1701, 1704, 1707, 1710,
+ 1713, 1716, 1719, 1722, 1725, 1728, 1731, 1734, 1737, 1740, 1743, 1746,
+ 1749, 1752, 1755, 1758, 1761, 1764, 1767, 1770, 1773, 1776, 1779, 1782,
+ 1785, 1788, 1791, 1794, 1797, 1800, 1803, 1806, 1809, 1812, 1815, 1818,
+ 1821, 1824, 1827, 1830, 1833, 1836, 1839, 1842, 1845, 1848, 1851, 1854,
+ 1857, 1860, 1863, 1866, 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890,
+ 1893, 1896, 1899, 1902, 1905, 1908, 1911, 1914, 1917, 1920, 1923, 1926,
+ 1929, 1932, 1935, 1938, 1941, 1944, 1947, 1950, 1953, 1956, 1959, 1962,
+ 1965, 1968, 1971, 1974, 1977, 1980, 1983, 1986, 1989, 1992, 1995, 1998,
+ 2001, 2004, 2007, 2010, 2013, 2016, 2019, 2022, 2025, 2028, 2031, 2034,
+ 2037, 2040, 2043, 2046, 2049, 2052, 2055, 2058, 2061, 2064, 2067, 2070,
+ 2073, 2076, 2079, 2082, 2085, 2088, 2091, 2094, 0, 0, 0, 0, 2097, 2100,
+ 2103, 2106, 2109, 2112, 2115, 2118, 2121, 2124, 2127, 2130, 2133, 2136,
+ 2139, 2142, 2145, 2148, 2151, 2154, 2157, 2160, 2163, 2166, 2169, 2172,
+ 2175, 2178, 2181, 2184, 2187, 2190, 2193, 2196, 2199, 2202, 2205, 2208,
+ 2211, 2214, 2217, 2220, 2223, 2226, 2229, 2232, 2235, 2238, 2241, 2244,
+ 2247, 2250, 2253, 2256, 2259, 2262, 2265, 2268, 2271, 2274, 2277, 2280,
+ 2283, 2286, 2289, 2292, 2295, 2298, 2301, 2304, 2307, 2310, 2313, 2316,
+ 2319, 2322, 2325, 2328, 2331, 2334, 2337, 2340, 2343, 2346, 2349, 2352,
+ 2355, 2358, 2361, 2364, 0, 0, 0, 0, 0, 0, 2367, 2370, 2373, 2376, 2379,
+ 2382, 2385, 2388, 2391, 2394, 2397, 2400, 2403, 2406, 2409, 2412, 2415,
+ 2418, 2421, 2424, 2427, 2430, 0, 0, 2433, 2436, 2439, 2442, 2445, 2448,
+ 0, 0, 2451, 2454, 2457, 2460, 2463, 2466, 2469, 2472, 2475, 2478, 2481,
+ 2484, 2487, 2490, 2493, 2496, 2499, 2502, 2505, 2508, 2511, 2514, 2517,
+ 2520, 2523, 2526, 2529, 2532, 2535, 2538, 2541, 2544, 2547, 2550, 2553,
+ 2556, 2559, 2562, 0, 0, 2565, 2568, 2571, 2574, 2577, 2580, 0, 0, 2583,
+ 2586, 2589, 2592, 2595, 2598, 2601, 2604, 0, 2607, 0, 2610, 0, 2613, 0,
+ 2616, 2619, 2622, 2625, 2628, 2631, 2634, 2637, 2640, 2643, 2646, 2649,
+ 2652, 2655, 2658, 2661, 2664, 2667, 2670, 2672, 2675, 2677, 2680, 2682,
+ 2685, 2687, 2690, 2692, 2695, 2697, 2700, 0, 0, 2702, 2705, 2708, 2711,
+ 2714, 2717, 2720, 2723, 2726, 2729, 2732, 2735, 2738, 2741, 2744, 2747,
+ 2750, 2753, 2756, 2759, 2762, 2765, 2768, 2771, 2774, 2777, 2780, 2783,
+ 2786, 2789, 2792, 2795, 2798, 2801, 2804, 2807, 2810, 2813, 2816, 2819,
+ 2822, 2825, 2828, 2831, 2834, 2837, 2840, 2843, 2846, 2849, 2852, 2855,
+ 2858, 0, 2861, 2864, 2867, 2870, 2873, 2876, 2878, 2881, 2884, 2881,
+ 2886, 2889, 2892, 2895, 2898, 0, 2901, 2904, 2907, 2910, 2912, 2915,
+ 2917, 2920, 2923, 2926, 2929, 2932, 2935, 2938, 0, 0, 2940, 2943, 2946,
+ 2949, 2952, 2955, 0, 2957, 2960, 2963, 2966, 2969, 2972, 2975, 2977,
+ 2980, 2983, 2986, 2989, 2992, 2995, 2998, 3000, 3003, 3006, 3008, 0, 0,
+ 3010, 3013, 3016, 0, 3019, 3022, 3025, 3028, 3030, 3033, 3035, 3038,
+ 3040, 0, 3043, 3045, 3047, 3047, 3047, 3047, 3047, 1, 3047, 3047, 3047,
+ 0, 0, 0, 0, 0, 0, 3049, 0, 0, 0, 0, 0, 3051, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 3054, 3056, 3059, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3063,
+ 3066, 0, 3070, 3073, 0, 0, 0, 0, 3077, 0, 3080, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3083, 3086, 3089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3092, 0, 0, 0,
+ 0, 0, 0, 0, 3047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3097,
+ 3099, 0, 0, 3101, 3103, 3105, 3107, 3109, 3111, 3113, 3115, 3117, 3119,
+ 3121, 3123, 3125, 3127, 3129, 3131, 3133, 3135, 3137, 3139, 3141, 3143,
+ 3145, 3147, 3149, 3151, 3153, 0, 3155, 3157, 3159, 3161, 3163, 3165,
+ 3167, 3169, 3171, 3173, 3175, 3177, 3179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3184, 3188, 3192,
+ 3194, 0, 3197, 3201, 3205, 0, 3207, 3210, 3212, 3212, 3212, 3214, 3216,
+ 3218, 3218, 3220, 3222, 0, 3224, 3226, 0, 0, 3229, 3231, 3233, 3233,
+ 3233, 0, 0, 3235, 3238, 3242, 0, 3245, 0, 3247, 0, 3245, 0, 3249, 3251,
+ 3253, 3192, 0, 3255, 3257, 3259, 0, 3261, 3263, 3265, 3267, 3269, 3271,
+ 3273, 0, 3275, 3279, 3281, 3283, 3285, 3287, 0, 0, 0, 0, 3289, 3291,
+ 3255, 3273, 3293, 0, 0, 0, 0, 0, 0, 3295, 3299, 3303, 3308, 3312, 3316,
+ 3320, 3324, 3328, 3332, 3336, 3340, 3344, 3348, 3352, 3356, 3359, 3361,
+ 3364, 3368, 3371, 3373, 3376, 3380, 3385, 3388, 3390, 3393, 3397, 3399,
+ 3401, 3403, 3405, 3407, 3410, 3414, 3417, 3419, 3422, 3426, 3431, 3434,
+ 3436, 3439, 3443, 3445, 3447, 3449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3451, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3455, 3458, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3461, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3464,
+ 3467, 3470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 3473, 0, 0, 0, 0, 3476, 0, 0, 3479, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3482, 0, 3485,
+ 0, 0, 0, 0, 0, 3488, 3491, 0, 3495, 3498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3502, 0, 0, 3505, 0, 0, 3508, 0, 3511, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3514, 0, 3517, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 3520, 3523, 3526, 3529, 3532, 0, 0, 3535, 3538,
+ 0, 0, 3541, 3544, 0, 0, 0, 0, 0, 0, 3547, 3550, 0, 0, 3553, 3556, 0, 0,
+ 3559, 3562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3565, 3568, 3571, 3574, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3577,
+ 3580, 3583, 3586, 0, 0, 0, 0, 0, 0, 3589, 3592, 3595, 3598, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 3601, 3603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3605, 3607, 3609, 3611, 3613, 3615, 3617, 3619, 3621, 3623, 3626, 3629,
+ 3632, 3635, 3638, 3641, 3644, 3647, 3650, 3653, 3656, 3660, 3664, 3668,
+ 3672, 3676, 3680, 3684, 3688, 3692, 3697, 3702, 3707, 3712, 3717, 3722,
+ 3727, 3732, 3737, 3742, 3747, 3750, 3753, 3756, 3759, 3762, 3765, 3768,
+ 3771, 3774, 3778, 3782, 3786, 3790, 3794, 3798, 3802, 3806, 3810, 3814,
+ 3818, 3822, 3826, 3830, 3834, 3838, 3842, 3846, 3850, 3854, 3858, 3862,
+ 3866, 3870, 3874, 3878, 3882, 3886, 3890, 3894, 3898, 3902, 3906, 3910,
+ 3914, 3918, 3922, 3924, 3926, 3928, 3930, 3932, 3934, 3936, 3938, 3940,
+ 3942, 3944, 3946, 3948, 3950, 3952, 3954, 3956, 3958, 3960, 3962, 3964,
+ 3966, 3968, 3970, 3972, 3974, 3976, 3978, 3980, 3982, 3984, 3986, 3988,
+ 3990, 3992, 3994, 3996, 3998, 4000, 4002, 4004, 4006, 4008, 4010, 4012,
+ 4014, 4016, 4018, 4020, 4022, 4024, 4026, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4028, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4033, 4037, 4040, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4044, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4047, 4049, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4053, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4057, 4059, 4061, 4063, 4065,
+ 4067, 4069, 4071, 4073, 4075, 4077, 4079, 4081, 4083, 4085, 4087, 4089,
+ 4091, 4093, 4095, 4097, 4099, 4101, 4103, 4105, 4107, 4109, 4111, 4113,
+ 4115, 4117, 4119, 4121, 4123, 4125, 4127, 4129, 4131, 4133, 4135, 4137,
+ 4139, 4141, 4143, 4145, 4147, 4149, 4151, 4153, 4155, 4157, 4159, 4161,
+ 4163, 4165, 4167, 4169, 4171, 4173, 4175, 4177, 4179, 4181, 4183, 4185,
+ 4187, 4189, 4191, 4193, 4195, 4197, 4199, 4201, 4203, 4205, 4207, 4209,
+ 4211, 4213, 4215, 4217, 4219, 4221, 4223, 4225, 4227, 4229, 4231, 4233,
+ 4235, 4237, 4239, 4241, 4243, 4245, 4247, 4249, 4251, 4253, 4255, 4257,
+ 4259, 4261, 4263, 4265, 4267, 4269, 4271, 4273, 4275, 4277, 4279, 4281,
+ 4283, 4285, 4287, 4289, 4291, 4293, 4295, 4297, 4299, 4301, 4303, 4305,
+ 4307, 4309, 4311, 4313, 4315, 4317, 4319, 4321, 4323, 4325, 4327, 4329,
+ 4331, 4333, 4335, 4337, 4339, 4341, 4343, 4345, 4347, 4349, 4351, 4353,
+ 4355, 4357, 4359, 4361, 4363, 4365, 4367, 4369, 4371, 4373, 4375, 4377,
+ 4379, 4381, 4383, 4385, 4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401,
+ 4403, 4405, 4407, 4409, 4411, 4413, 4415, 4417, 4419, 4421, 4423, 4425,
+ 4427, 4429, 4431, 4433, 4435, 4437, 4439, 4441, 4443, 4445, 4447, 4449,
+ 4451, 4453, 4455, 4457, 4459, 4461, 4463, 4465, 4467, 4469, 4471, 4473,
+ 4475, 4477, 4479, 4481, 4483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4487, 0, 4103, 4489, 4491, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4493, 0, 4496, 0, 4499, 0, 4502,
+ 0, 4505, 0, 4508, 0, 4511, 0, 4514, 0, 4517, 0, 4520, 0, 4523, 0, 4526,
+ 0, 0, 4529, 0, 4532, 0, 4535, 0, 0, 0, 0, 0, 0, 4538, 4541, 0, 4544,
+ 4547, 0, 4550, 4553, 0, 4556, 4559, 0, 4562, 4565, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4568, 0, 0, 0, 0, 0, 0,
+ 4571, 4574, 0, 4577, 4580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4583, 0,
+ 4586, 0, 4589, 0, 4592, 0, 4595, 0, 4598, 0, 4601, 0, 4604, 0, 4607, 0,
+ 4610, 0, 4613, 0, 4616, 0, 0, 4619, 0, 4622, 0, 4625, 0, 0, 0, 0, 0, 0,
+ 4628, 4631, 0, 4634, 4637, 0, 4640, 4643, 0, 4646, 4649, 0, 4652, 4655,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4658,
+ 0, 0, 4661, 4664, 4667, 4670, 0, 0, 0, 4673, 4676, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4679, 4681, 4683,
+ 4685, 4687, 4689, 4691, 4693, 4695, 4697, 4699, 4701, 4703, 4705, 4707,
+ 4709, 4711, 4713, 4715, 4717, 4719, 4721, 4723, 4725, 4727, 4729, 4731,
+ 4733, 4735, 4737, 4739, 4741, 4743, 4745, 4747, 4749, 4751, 4753, 4755,
+ 4757, 4759, 4761, 4763, 4765, 4767, 4769, 4771, 4773, 4775, 4777, 4779,
+ 4781, 4783, 4785, 4787, 4789, 4791, 4793, 4795, 4797, 4799, 4801, 4803,
+ 4805, 4807, 4809, 4811, 4813, 4815, 4817, 4819, 4821, 4823, 4825, 4827,
+ 4829, 4831, 4833, 4835, 4837, 4839, 4841, 4843, 4845, 4847, 4849, 4851,
+ 4853, 4855, 4857, 4859, 4861, 4863, 4865, 0, 0, 0, 4867, 4869, 4871,
+ 4873, 4875, 4877, 4879, 4881, 4883, 4885, 4887, 4889, 4891, 4893, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4895,
+ 4899, 4903, 4907, 4911, 4915, 4919, 4923, 4927, 4931, 4935, 4939, 4943,
+ 4947, 4951, 4956, 4961, 4966, 4971, 4976, 4981, 4986, 4991, 4996, 5001,
+ 5006, 5011, 5016, 5021, 5026, 5034, 0, 5041, 5045, 5049, 5053, 5057,
+ 5061, 5065, 5069, 5073, 5077, 5081, 5085, 5089, 5093, 5097, 5101, 5105,
+ 5109, 5113, 5117, 5121, 5125, 5129, 5133, 5137, 5141, 5145, 5149, 5153,
+ 5157, 5161, 5165, 5169, 5173, 5177, 5181, 5185, 5187, 5189, 5191, 0, 0,
+ 0, 0, 0, 0, 0, 0, 5193, 5197, 5200, 5203, 5206, 5209, 5212, 5215, 5218,
+ 5221, 5224, 5227, 5230, 5233, 5236, 5239, 5242, 5244, 5246, 5248, 5250,
+ 5252, 5254, 5256, 5258, 5260, 5262, 5264, 5266, 5268, 5270, 5273, 5276,
+ 5279, 5282, 5285, 5288, 5291, 5294, 5297, 5300, 5303, 5306, 5309, 5312,
+ 5318, 5323, 0, 5326, 5328, 5330, 5332, 5334, 5336, 5338, 5340, 5342,
+ 5344, 5346, 5348, 5350, 5352, 5354, 5356, 5358, 5360, 5362, 5364, 5366,
+ 5368, 5370, 5372, 5374, 5376, 5378, 5380, 5382, 5384, 5386, 5388, 5390,
+ 5392, 5394, 5396, 5398, 5400, 5402, 5404, 5406, 5408, 5410, 5412, 5414,
+ 5416, 5418, 5420, 5422, 5424, 5427, 5430, 5433, 5436, 5439, 5442, 5445,
+ 5448, 5451, 5454, 5457, 5460, 5463, 5466, 5469, 5472, 5475, 5478, 5481,
+ 5484, 5487, 5490, 5493, 5496, 5500, 5504, 5508, 5511, 5515, 5518, 5522,
+ 5524, 5526, 5528, 5530, 5532, 5534, 5536, 5538, 5540, 5542, 5544, 5546,
+ 5548, 5550, 5552, 5554, 5556, 5558, 5560, 5562, 5564, 5566, 5568, 5570,
+ 5572, 5574, 5576, 5578, 5580, 5582, 5584, 5586, 5588, 5590, 5592, 5594,
+ 5596, 5598, 5600, 5602, 5604, 5606, 5608, 5610, 5612, 5614, 5616, 5619,
+ 5624, 5629, 5634, 5638, 5643, 5647, 5651, 5657, 5662, 5666, 5670, 5674,
+ 5679, 5684, 5688, 5692, 5695, 5699, 5704, 5709, 5712, 5718, 5725, 5731,
+ 5735, 5741, 5747, 5752, 5756, 5760, 5764, 5769, 5775, 5780, 5784, 5788,
+ 5792, 5795, 5798, 5801, 5804, 5808, 5812, 5818, 5822, 5827, 5833, 5837,
+ 5840, 5843, 5849, 5854, 5860, 5864, 5870, 5873, 5877, 5881, 5885, 5889,
+ 5893, 5898, 5902, 5905, 5909, 5913, 5917, 5922, 5926, 5930, 5934, 5940,
+ 5945, 5948, 5954, 5957, 5962, 5967, 5971, 5975, 5979, 5984, 5987, 5991,
+ 5996, 5999, 6005, 6009, 6012, 6015, 6018, 6021, 6024, 6027, 6030, 6033,
+ 6036, 6039, 6043, 6047, 6051, 6055, 6059, 6063, 6067, 6071, 6075, 6079,
+ 6083, 6087, 6091, 6095, 6099, 6103, 6106, 6109, 6113, 6116, 6119, 6122,
+ 6126, 6130, 6133, 6136, 6139, 6142, 6145, 6150, 6153, 6156, 6159, 6162,
+ 6165, 6168, 6171, 6174, 6178, 6183, 6186, 6189, 6192, 6195, 6198, 6201,
+ 6204, 6208, 6212, 6216, 6220, 6223, 6226, 6229, 6232, 6235, 6238, 6241,
+ 6244, 6247, 6250, 6254, 6258, 6261, 6265, 6269, 6273, 6276, 6280, 6284,
+ 6289, 6292, 6296, 6300, 6304, 6308, 6314, 6321, 6324, 6327, 6330, 6333,
+ 6336, 6339, 6342, 6345, 6348, 6351, 6354, 6357, 6360, 6363, 6366, 6369,
+ 6372, 6375, 6380, 6383, 6386, 6389, 6394, 6398, 6401, 6404, 6407, 6410,
+ 6413, 6416, 6419, 6422, 6425, 6428, 6432, 6435, 6438, 6442, 6446, 6449,
+ 6454, 6458, 6461, 6464, 6467, 6470, 6474, 6478, 6481, 6484, 6487, 6490,
+ 6493, 6496, 6499, 6502, 6505, 6509, 6513, 6517, 6521, 6525, 6529, 6533,
+ 6537, 6541, 6545, 6549, 6553, 6557, 6561, 6565, 6569, 6573, 6577, 6581,
+ 6585, 6589, 6593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6597, 6599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 6601, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6603, 6605,
+ 6607, 0, 0, 0, 6609, 6611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6613, 6615, 6617, 6619, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 6623, 6625, 6627, 6629, 6631, 6633, 6635, 6637, 6637, 6639,
+ 6641, 6643, 6645, 6647, 6649, 6651, 6653, 6655, 6657, 6659, 6661, 6663,
+ 6665, 6667, 6669, 6671, 6673, 6675, 6677, 6679, 6681, 6683, 6685, 6687,
+ 6689, 6691, 6693, 6695, 6697, 6699, 6701, 6703, 6705, 6707, 6709, 6711,
+ 6713, 6715, 6717, 6719, 6721, 6723, 6725, 6727, 6729, 6731, 6733, 6735,
+ 6737, 6739, 6741, 6743, 6745, 6747, 6749, 6751, 6753, 6755, 6757, 6759,
+ 6761, 6763, 6765, 6767, 6769, 6771, 6773, 6775, 6777, 6779, 6781, 6783,
+ 6785, 6787, 6789, 6791, 6793, 6795, 6797, 6799, 6801, 6803, 6661, 6805,
+ 6807, 6809, 6811, 6813, 6815, 6817, 6819, 6821, 6823, 6825, 6827, 6829,
+ 6831, 6833, 6835, 6837, 6839, 6841, 6843, 6845, 6847, 6849, 6851, 6853,
+ 6855, 6857, 6859, 6861, 6863, 6865, 6867, 6869, 6871, 6873, 6875, 6877,
+ 6879, 6881, 6883, 6885, 6887, 6889, 6891, 6893, 6895, 6897, 6899, 6901,
+ 6903, 6905, 6907, 6909, 6911, 6913, 6915, 6917, 6919, 6921, 6923, 6925,
+ 6927, 6929, 6931, 6933, 6935, 6937, 6939, 6841, 6941, 6943, 6945, 6947,
+ 6949, 6951, 6953, 6955, 6809, 6957, 6959, 6961, 6963, 6965, 6967, 6969,
+ 6971, 6973, 6975, 6977, 6979, 6981, 6983, 6985, 6987, 6989, 6991, 6993,
+ 6995, 6661, 6997, 6999, 7001, 7003, 7005, 7007, 7009, 7011, 7013, 7015,
+ 7017, 7019, 7021, 7023, 7025, 7027, 7029, 7031, 7033, 7035, 7037, 7039,
+ 7041, 7043, 7045, 7047, 7049, 6813, 7051, 7053, 7055, 7057, 7059, 7061,
+ 7063, 7065, 7067, 7069, 7071, 7073, 7075, 7077, 7079, 7081, 7083, 7085,
+ 7087, 7089, 7091, 7093, 7095, 7097, 7099, 7101, 7103, 7105, 7107, 7109,
+ 7111, 7113, 7115, 7117, 7119, 7121, 7123, 7125, 7127, 7129, 7131, 7133,
+ 7135, 7137, 7139, 7141, 7143, 7145, 7147, 7149, 0, 0, 7151, 0, 7153, 0,
+ 0, 7155, 7157, 7159, 7161, 7163, 7165, 7167, 7169, 7171, 7173, 0, 7175,
+ 0, 7177, 0, 0, 7179, 7181, 0, 0, 0, 7183, 7185, 7187, 7189, 7191, 7193,
+ 7195, 7197, 7199, 7201, 7203, 7205, 7207, 7209, 7211, 7213, 7215, 7217,
+ 7219, 7221, 7223, 7225, 7227, 7229, 7231, 7233, 7235, 7237, 7239, 7241,
+ 7243, 7245, 7247, 7249, 7251, 7253, 7255, 7257, 7259, 7261, 7263, 7265,
+ 7267, 7269, 7271, 6919, 7273, 7275, 7277, 7279, 7281, 7283, 7283, 7285,
+ 7287, 7289, 7291, 7293, 7295, 7297, 7299, 7179, 7301, 7303, 7305, 7307,
+ 7309, 7311, 0, 0, 7313, 7315, 7317, 7319, 7321, 7323, 7325, 7327, 7207,
+ 7329, 7331, 7333, 7151, 7335, 7337, 7339, 7341, 7343, 7345, 7347, 7349,
+ 7351, 7353, 7355, 7357, 7225, 7359, 7227, 7361, 7363, 7365, 7367, 7369,
+ 7153, 6703, 7371, 7373, 7375, 6843, 7017, 7377, 7379, 7241, 7381, 7243,
+ 7383, 7385, 7387, 7157, 7389, 7391, 7393, 7395, 7397, 7159, 7399, 7401,
+ 7403, 7405, 7407, 7409, 7271, 7411, 7413, 6919, 7415, 7279, 7417, 7419,
+ 7421, 7423, 7425, 7289, 7427, 7177, 7429, 7291, 6805, 7431, 7293, 7433,
+ 7297, 7435, 7437, 7439, 7441, 7443, 7301, 7169, 7445, 7303, 7447, 7305,
+ 7449, 6637, 7451, 7453, 7455, 7457, 7459, 7461, 7463, 7465, 7467, 7469,
+ 7471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7473, 7476, 7479, 7482,
+ 7486, 7490, 7493, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7496, 7499, 7502,
+ 7505, 7508, 0, 0, 0, 0, 0, 7511, 0, 7514, 7517, 7519, 7521, 7523, 7525,
+ 7527, 7529, 7531, 7533, 7535, 7537, 7540, 7543, 7546, 7549, 7552, 7555,
+ 7558, 7561, 7564, 7567, 7570, 7573, 0, 7576, 7579, 7582, 7585, 7588, 0,
+ 7591, 0, 7594, 7597, 0, 7600, 7603, 0, 7606, 7609, 7612, 7615, 7618,
+ 7621, 7624, 7627, 7630, 7633, 7636, 7638, 7640, 7642, 7644, 7646, 7648,
+ 7650, 7652, 7654, 7656, 7658, 7660, 7662, 7664, 7666, 7668, 7670, 7672,
+ 7674, 7676, 7678, 7680, 7682, 7684, 7686, 7688, 7690, 7692, 7694, 7696,
+ 7698, 7700, 7702, 7704, 7706, 7708, 7710, 7712, 7714, 7716, 7718, 7720,
+ 7722, 7724, 7726, 7728, 7730, 7732, 7734, 7736, 7738, 7740, 7742, 7744,
+ 7746, 7748, 7750, 7752, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768,
+ 7770, 7772, 7774, 7776, 7778, 7780, 7782, 7784, 7786, 7788, 7790, 7792,
+ 7794, 7796, 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816,
+ 7818, 7820, 7822, 7824, 7826, 7828, 7830, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7832, 7834, 7836, 7838, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854,
+ 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872, 7874, 7876, 7878,
+ 7881, 7884, 7887, 7890, 7893, 7896, 7899, 7902, 7905, 7908, 7911, 7914,
+ 7917, 7920, 7923, 7926, 7929, 7932, 7934, 7936, 7938, 7940, 7943, 7946,
+ 7923, 7949, 7952, 7955, 7958, 7961, 7964, 7967, 7970, 7973, 7976, 7979,
+ 7982, 7985, 7988, 7991, 7994, 7997, 8000, 8003, 8006, 8009, 8012, 8015,
+ 8018, 8021, 8024, 8027, 8030, 8033, 8036, 8039, 8042, 8045, 8048, 8051,
+ 8054, 8057, 8060, 8063, 8066, 8069, 8072, 8075, 8078, 8081, 8084, 8087,
+ 8090, 8093, 8096, 8099, 8102, 8105, 8108, 8111, 8114, 8117, 8120, 8123,
+ 8126, 8129, 8132, 8135, 8138, 8141, 8144, 8147, 8150, 8153, 8156, 8159,
+ 8162, 8165, 8168, 8171, 8174, 8177, 8180, 8183, 8186, 8189, 8192, 8195,
+ 8198, 8201, 8204, 8207, 8210, 8213, 8216, 8219, 8223, 8227, 8231, 8235,
+ 8239, 8243, 8246, 8249, 8252, 7926, 8255, 8258, 8261, 8264, 8267, 8270,
+ 8273, 8276, 8279, 8282, 8285, 8288, 8291, 8294, 8297, 8300, 8303, 8306,
+ 8309, 8312, 8315, 8318, 8321, 8324, 8327, 8330, 8333, 8336, 8339, 8342,
+ 8345, 8348, 8351, 8354, 8357, 8360, 8363, 8366, 8369, 8372, 8375, 8378,
+ 8381, 8384, 8387, 8390, 8393, 8396, 8399, 8402, 8405, 8408, 8411, 8414,
+ 8417, 8420, 8423, 8426, 8429, 8432, 8435, 8438, 8441, 8444, 8447, 8450,
+ 8453, 8456, 8459, 8462, 8465, 8468, 8471, 8474, 8477, 8480, 8483, 8486,
+ 8489, 8492, 8495, 8498, 8501, 8504, 8507, 8510, 8513, 8516, 8519, 8522,
+ 8525, 8528, 8531, 8534, 8537, 8540, 8543, 8546, 8549, 8552, 8555, 8558,
+ 8561, 8564, 8567, 8570, 8573, 8576, 8579, 8582, 8585, 8588, 8591, 8594,
+ 8597, 8600, 8603, 8606, 8609, 8612, 8615, 8618, 8621, 8624, 8627, 8630,
+ 8633, 8636, 8639, 8642, 8645, 8648, 8651, 8654, 8657, 8660, 8663, 8666,
+ 8670, 8674, 8678, 8681, 8684, 8687, 8690, 8693, 8696, 8699, 8702, 8705,
+ 8708, 8711, 8714, 8717, 8720, 8723, 8726, 8729, 8732, 8735, 8738, 8741,
+ 8744, 8747, 8750, 8753, 8756, 8759, 8762, 8765, 8768, 8771, 8774, 8777,
+ 8780, 8783, 8786, 8789, 8792, 8795, 8798, 8801, 8804, 8807, 8810, 8813,
+ 8816, 8819, 8822, 8825, 8828, 8831, 8834, 8837, 8840, 8843, 8846, 8849,
+ 8852, 8855, 8858, 8861, 8864, 8867, 8870, 8873, 8876, 8879, 8882, 8885,
+ 8888, 8891, 8894, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8897, 8901, 8905, 8909, 8913, 8917, 8921, 8925, 8929, 8933, 8937, 8941,
+ 8945, 8949, 8953, 8957, 8961, 8965, 8969, 8973, 8977, 8981, 8985, 8989,
+ 8993, 8997, 9001, 9005, 9009, 9013, 9017, 9021, 9025, 9029, 9033, 9037,
+ 9041, 9045, 9049, 9053, 9057, 9061, 9065, 9069, 9073, 9077, 9081, 9085,
+ 9089, 9093, 9097, 9101, 9105, 9109, 9113, 9117, 9121, 9125, 9129, 9133,
+ 9137, 9141, 9145, 9149, 0, 0, 9153, 9157, 9161, 9165, 9169, 9173, 9177,
+ 9181, 9185, 9189, 9193, 9197, 9201, 9205, 9209, 9213, 9217, 9221, 9225,
+ 9229, 9233, 9237, 9241, 9245, 9249, 9253, 9257, 9261, 9265, 9269, 9273,
+ 9277, 9281, 9285, 9289, 9293, 9297, 9301, 9305, 9309, 9313, 9317, 9321,
+ 9325, 9329, 9333, 9337, 9341, 9345, 9349, 9353, 9357, 9361, 9365, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9369, 9373, 9377, 9382, 9387,
+ 9392, 9397, 9402, 9407, 9412, 9416, 9435, 9444, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9449, 9451, 9453, 9455, 9457, 9459,
+ 9461, 9463, 9465, 9467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9469, 9471, 9473, 9475, 9475, 9477, 9479, 9481, 9483,
+ 9485, 9487, 9489, 9491, 9493, 9495, 9497, 9499, 9501, 9503, 9505, 9507,
+ 0, 0, 9509, 9511, 9513, 9513, 9513, 9513, 9515, 9515, 9515, 9517, 9519,
+ 9521, 0, 9523, 9525, 9527, 9529, 9531, 9533, 9535, 9537, 9539, 9541,
+ 9543, 9545, 9547, 9549, 9551, 9553, 9555, 9557, 9559, 0, 9561, 9563,
+ 9565, 9567, 0, 0, 0, 0, 9569, 9572, 9575, 0, 9578, 0, 9581, 9584, 9587,
+ 9590, 9593, 9596, 9599, 9602, 9605, 9608, 9611, 9613, 9615, 9617, 9619,
+ 9621, 9623, 9625, 9627, 9629, 9631, 9633, 9635, 9637, 9639, 9641, 9643,
+ 9645, 9647, 9649, 9651, 9653, 9655, 9657, 9659, 9661, 9663, 9665, 9667,
+ 9669, 9671, 9673, 9675, 9677, 9679, 9681, 9683, 9685, 9687, 9689, 9691,
+ 9693, 9695, 9697, 9699, 9701, 9703, 9705, 9707, 9709, 9711, 9713, 9715,
+ 9717, 9719, 9721, 9723, 9725, 9727, 9729, 9731, 9733, 9735, 9737, 9739,
+ 9741, 9743, 9745, 9747, 9749, 9751, 9753, 9755, 9757, 9759, 9761, 9763,
+ 9765, 9767, 9769, 9771, 9773, 9775, 9777, 9779, 9781, 9783, 9785, 9787,
+ 9789, 9791, 9793, 9795, 9797, 9799, 9801, 9803, 9805, 9807, 9809, 9811,
+ 9813, 9815, 9817, 9819, 9821, 9823, 9825, 9827, 9829, 9831, 9833, 9835,
+ 9837, 9839, 9841, 9843, 9845, 9848, 9851, 9854, 9857, 9860, 9863, 9866,
+ 0, 0, 0, 0, 9869, 9871, 9873, 9875, 9877, 9879, 9881, 9883, 9885, 9887,
+ 9889, 9891, 9893, 9895, 9897, 9899, 9901, 9903, 9905, 9907, 9909, 9911,
+ 9913, 9915, 9917, 9919, 9921, 9923, 9925, 9927, 9929, 9931, 9933, 9935,
+ 9937, 9939, 9941, 9943, 9945, 9947, 9949, 9951, 9953, 9955, 9957, 9959,
+ 9961, 9963, 9965, 9967, 9969, 9971, 9973, 9975, 9977, 9979, 9981, 9983,
+ 9985, 9987, 9989, 9991, 9993, 9995, 9997, 9999, 10001, 10003, 10005,
+ 10007, 10009, 10011, 10013, 10015, 10017, 10019, 10021, 10023, 10025,
+ 10027, 10029, 10031, 10033, 10035, 10037, 10039, 10041, 10043, 10045,
+ 10047, 10049, 10051, 10053, 10055, 10057, 10059, 10061, 10063, 10065,
+ 10067, 10069, 10071, 10073, 10075, 10077, 10079, 10081, 10083, 10085,
+ 10087, 10089, 10091, 10093, 10095, 10097, 10099, 10101, 10103, 10105,
+ 10107, 10109, 10111, 10113, 10115, 10117, 10119, 10121, 10123, 10125,
+ 10127, 10129, 10131, 10133, 10135, 10137, 10139, 10141, 10143, 10145,
+ 10147, 10149, 10151, 10153, 10155, 10157, 10159, 10161, 10163, 10165,
+ 10167, 10169, 10171, 10173, 10175, 10177, 10179, 10181, 10183, 10185,
+ 10187, 10189, 10191, 10193, 10195, 10197, 10199, 10201, 10203, 10205,
+ 10207, 10209, 10211, 10213, 10215, 10217, 10219, 10221, 10223, 10225,
+ 10227, 10229, 10231, 10233, 10235, 10237, 10239, 10241, 10243, 10245,
+ 10247, 0, 0, 0, 10249, 10251, 10253, 10255, 10257, 10259, 0, 0, 10261,
+ 10263, 10265, 10267, 10269, 10271, 0, 0, 10273, 10275, 10277, 10279,
+ 10281, 10283, 0, 0, 10285, 10287, 10289, 0, 0, 0, 10291, 10293, 10295,
+ 10297, 10299, 10301, 10303, 0, 10305, 10307, 10309, 10311, 10313, 10315,
+ 10317, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10319,
+ 10321, 10323, 10325, 10327, 0, 10329, 10331, 10333, 10335, 10337, 10339,
+ 10341, 10343, 10345, 10347, 10349, 10351, 10353, 10355, 10357, 10359,
+ 10361, 10363, 10365, 10367, 10369, 10371, 10373, 10375, 10377, 10379,
+ 10381, 10383, 10385, 10387, 10389, 10391, 10393, 10395, 10397, 10399,
+ 10401, 10403, 10405, 10407, 10409, 10411, 0, 10413, 10415, 10417, 10419,
+ 10421, 10423, 10425, 10427, 10429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10431, 0, 10434, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 10437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10440, 10443, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 10446, 10449, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 10452, 10455, 0, 10458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10461, 10464, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10467, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10470, 10473,
+ 10476, 10479, 10482, 10485, 10488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 10491, 10494, 10497, 10500, 10503, 10506, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 10509, 3253, 3192, 3289, 3257, 3259, 10511, 3212, 3218,
+ 10513, 10515, 3220, 3261, 3224, 10517, 3229, 3231, 3233, 10519, 10521,
+ 10523, 10525, 10527, 10529, 10531, 3245, 10533, 10535, 10537, 3291, 3255,
+ 10539, 3210, 3214, 3273, 3293, 10541, 3222, 10543, 10545, 3263, 10547,
+ 10549, 10551, 10553, 10555, 10557, 10559, 10561, 10563, 10565, 10567,
+ 10509, 3253, 3192, 3289, 3257, 3259, 10511, 3212, 3218, 10513, 10515,
+ 3220, 3261, 3224, 10517, 3229, 3231, 3233, 10519, 10521, 10523, 10525,
+ 10527, 10529, 10531, 3245, 10533, 10535, 10537, 3291, 3255, 10539, 3210,
+ 0, 3273, 3293, 10541, 3222, 10543, 10545, 3263, 10547, 10549, 10551,
+ 10553, 10555, 10557, 10559, 10561, 10563, 10565, 10567, 10509, 3253,
+ 3192, 3289, 3257, 3259, 10511, 3212, 3218, 10513, 10515, 3220, 3261,
+ 3224, 10517, 3229, 3231, 3233, 10519, 10521, 10523, 10525, 10527, 10529,
+ 10531, 3245, 10533, 10535, 10537, 3291, 3255, 10539, 3210, 3214, 3273,
+ 3293, 10541, 3222, 10543, 10545, 3263, 10547, 10549, 10551, 10553, 10555,
+ 10557, 10559, 10561, 10563, 10565, 10567, 10509, 0, 3192, 3289, 0, 0,
+ 10511, 0, 0, 10513, 10515, 0, 0, 3224, 10517, 3229, 3231, 0, 10519,
+ 10521, 10523, 10525, 10527, 10529, 10531, 3245, 10533, 10535, 10537,
+ 3291, 0, 10539, 0, 3214, 3273, 3293, 10541, 3222, 10543, 10545, 0, 10547,
+ 10549, 10551, 10553, 10555, 10557, 10559, 10561, 10563, 10565, 10567,
+ 10509, 3253, 3192, 3289, 3257, 3259, 10511, 3212, 3218, 10513, 10515,
+ 3220, 3261, 3224, 10517, 3229, 3231, 3233, 10519, 10521, 10523, 10525,
+ 10527, 10529, 10531, 3245, 10533, 10535, 10537, 3291, 3255, 10539, 3210,
+ 3214, 3273, 3293, 10541, 3222, 10543, 10545, 3263, 10547, 10549, 10551,
+ 10553, 10555, 10557, 10559, 10561, 10563, 10565, 10567, 10509, 3253, 0,
+ 3289, 3257, 3259, 10511, 0, 0, 10513, 10515, 3220, 3261, 3224, 10517,
+ 3229, 3231, 0, 10519, 10521, 10523, 10525, 10527, 10529, 10531, 0, 10533,
+ 10535, 10537, 3291, 3255, 10539, 3210, 3214, 3273, 3293, 10541, 3222,
+ 10543, 10545, 3263, 10547, 10549, 10551, 10553, 10555, 10557, 10559,
+ 10561, 10563, 10565, 10567, 10509, 3253, 0, 3289, 3257, 3259, 10511, 0,
+ 3218, 10513, 10515, 3220, 3261, 0, 10517, 0, 0, 0, 10519, 10521, 10523,
+ 10525, 10527, 10529, 10531, 0, 10533, 10535, 10537, 3291, 3255, 10539,
+ 3210, 3214, 3273, 3293, 10541, 3222, 10543, 10545, 3263, 10547, 10549,
+ 10551, 10553, 10555, 10557, 10559, 10561, 10563, 10565, 10567, 10509,
+ 3253, 3192, 3289, 3257, 3259, 10511, 3212, 3218, 10513, 10515, 3220,
+ 3261, 3224, 10517, 3229, 3231, 3233, 10519, 10521, 10523, 10525, 10527,
+ 10529, 10531, 3245, 10533, 10535, 10537, 3291, 3255, 10539, 3210, 3214,
+ 3273, 3293, 10541, 3222, 10543, 10545, 3263, 10547, 10549, 10551, 10553,
+ 10555, 10557, 10559, 10561, 10563, 10565, 10567, 10509, 3253, 3192, 3289,
+ 3257, 3259, 10511, 3212, 3218, 10513, 10515, 3220, 3261, 3224, 10517,
+ 3229, 3231, 3233, 10519, 10521, 10523, 10525, 10527, 10529, 10531, 3245,
+ 10533, 10535, 10537, 3291, 3255, 10539, 3210, 3214, 3273, 3293, 10541,
+ 3222, 10543, 10545, 3263, 10547, 10549, 10551, 10553, 10555, 10557,
+ 10559, 10561, 10563, 10565, 10567, 10509, 3253, 3192, 3289, 3257, 3259,
+ 10511, 3212, 3218, 10513, 10515, 3220, 3261, 3224, 10517, 3229, 3231,
+ 3233, 10519, 10521, 10523, 10525, 10527, 10529, 10531, 3245, 10533,
+ 10535, 10537, 3291, 3255, 10539, 3210, 3214, 3273, 3293, 10541, 3222,
+ 10543, 10545, 3263, 10547, 10549, 10551, 10553, 10555, 10557, 10559,
+ 10561, 10563, 10565, 10567, 10509, 3253, 3192, 3289, 3257, 3259, 10511,
+ 3212, 3218, 10513, 10515, 3220, 3261, 3224, 10517, 3229, 3231, 3233,
+ 10519, 10521, 10523, 10525, 10527, 10529, 10531, 3245, 10533, 10535,
+ 10537, 3291, 3255, 10539, 3210, 3214, 3273, 3293, 10541, 3222, 10543,
+ 10545, 3263, 10547, 10549, 10551, 10553, 10555, 10557, 10559, 10561,
+ 10563, 10565, 10567, 10509, 3253, 3192, 3289, 3257, 3259, 10511, 3212,
+ 3218, 10513, 10515, 3220, 3261, 3224, 10517, 3229, 3231, 3233, 10519,
+ 10521, 10523, 10525, 10527, 10529, 10531, 3245, 10533, 10535, 10537,
+ 3291, 3255, 10539, 3210, 3214, 3273, 3293, 10541, 3222, 10543, 10545,
+ 3263, 10547, 10549, 10551, 10553, 10555, 10557, 10559, 10561, 10563,
+ 10565, 10567, 10509, 3253, 3192, 3289, 3257, 3259, 10511, 3212, 3218,
+ 10513, 10515, 3220, 3261, 3224, 10517, 3229, 3231, 3233, 10519, 10521,
+ 10523, 10525, 10527, 10529, 10531, 3245, 10533, 10535, 10537, 3291, 3255,
+ 10539, 3210, 3214, 3273, 3293, 10541, 3222, 10543, 10545, 3263, 10547,
+ 10549, 10551, 10553, 10555, 10557, 10559, 10561, 10563, 10565, 10567,
+ 10569, 10571, 0, 0, 10573, 10575, 3283, 10577, 10579, 10581, 10583,
+ 10585, 10587, 10589, 10591, 10593, 10595, 10597, 10599, 3285, 10601,
+ 10603, 10605, 10607, 10609, 10611, 10613, 10615, 10617, 10619, 10621,
+ 10623, 3281, 10625, 10627, 10629, 10631, 10633, 10635, 10637, 10639,
+ 10641, 10643, 10645, 10647, 3279, 10649, 10651, 10653, 10655, 10657,
+ 10659, 10661, 10663, 10665, 10667, 10669, 10671, 10673, 10675, 10677,
+ 10679, 10573, 10575, 3283, 10577, 10579, 10581, 10583, 10585, 10587,
+ 10589, 10591, 10593, 10595, 10597, 10599, 3285, 10601, 10603, 10605,
+ 10607, 10609, 10611, 10613, 10615, 10617, 10619, 10621, 10623, 3281,
+ 10625, 10627, 10629, 10631, 10633, 10635, 10637, 10639, 10641, 10643,
+ 10645, 10647, 3279, 10649, 10651, 10653, 10655, 10657, 10659, 10661,
+ 10663, 10665, 10667, 10669, 10671, 10673, 10675, 10677, 10679, 10573,
+ 10575, 3283, 10577, 10579, 10581, 10583, 10585, 10587, 10589, 10591,
+ 10593, 10595, 10597, 10599, 3285, 10601, 10603, 10605, 10607, 10609,
+ 10611, 10613, 10615, 10617, 10619, 10621, 10623, 3281, 10625, 10627,
+ 10629, 10631, 10633, 10635, 10637, 10639, 10641, 10643, 10645, 10647,
+ 3279, 10649, 10651, 10653, 10655, 10657, 10659, 10661, 10663, 10665,
+ 10667, 10669, 10671, 10673, 10675, 10677, 10679, 10573, 10575, 3283,
+ 10577, 10579, 10581, 10583, 10585, 10587, 10589, 10591, 10593, 10595,
+ 10597, 10599, 3285, 10601, 10603, 10605, 10607, 10609, 10611, 10613,
+ 10615, 10617, 10619, 10621, 10623, 3281, 10625, 10627, 10629, 10631,
+ 10633, 10635, 10637, 10639, 10641, 10643, 10645, 10647, 3279, 10649,
+ 10651, 10653, 10655, 10657, 10659, 10661, 10663, 10665, 10667, 10669,
+ 10671, 10673, 10675, 10677, 10679, 10573, 10575, 3283, 10577, 10579,
+ 10581, 10583, 10585, 10587, 10589, 10591, 10593, 10595, 10597, 10599,
+ 3285, 10601, 10603, 10605, 10607, 10609, 10611, 10613, 10615, 10617,
+ 10619, 10621, 10623, 3281, 10625, 10627, 10629, 10631, 10633, 10635,
+ 10637, 10639, 10641, 10643, 10645, 10647, 3279, 10649, 10651, 10653,
+ 10655, 10657, 10659, 10661, 10663, 10665, 10667, 10669, 10671, 10673,
+ 10675, 10677, 10679, 10681, 10683, 0, 0, 10685, 10687, 10689, 10691,
+ 10693, 10695, 10697, 10699, 10701, 10703, 10685, 10687, 10689, 10691,
+ 10693, 10695, 10697, 10699, 10701, 10703, 10685, 10687, 10689, 10691,
+ 10693, 10695, 10697, 10699, 10701, 10703, 10685, 10687, 10689, 10691,
+ 10693, 10695, 10697, 10699, 10701, 10703, 10685, 10687, 10689, 10691,
+ 10693, 10695, 10697, 10699, 10701, 10703, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10705, 10707, 10709, 10711,
+ 10713, 10715, 10717, 10719, 10721, 10723, 10725, 10727, 10729, 10731,
+ 10733, 10735, 10737, 10739, 10741, 10743, 10745, 10747, 10749, 10751,
+ 10753, 10755, 10757, 10759, 10761, 10763, 10765, 10767, 10769, 10771,
+ 10773, 10775, 10777, 10779, 10781, 10783, 10785, 10787, 10789, 10791,
+ 10793, 10795, 10797, 10799, 10801, 10803, 10805, 10807, 10809, 10811,
+ 10813, 10815, 10817, 10819, 10821, 10823, 10825, 10827, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10829, 10831, 10833, 10835, 0, 10837,
+ 10839, 10841, 10843, 10845, 10847, 10849, 10851, 10853, 10855, 10857,
+ 10859, 10861, 10863, 10865, 10867, 10869, 10871, 10873, 10875, 10877,
+ 10879, 10881, 10883, 10885, 10887, 10889, 0, 10831, 10833, 0, 10891, 0,
+ 0, 10841, 0, 10845, 10847, 10849, 10851, 10853, 10855, 10857, 10859,
+ 10861, 10863, 0, 10867, 10869, 10871, 10873, 0, 10877, 0, 10881, 0, 0, 0,
+ 0, 0, 0, 10833, 0, 0, 0, 0, 10841, 0, 10845, 0, 10849, 0, 10853, 10855,
+ 10857, 0, 10861, 10863, 0, 10867, 0, 0, 10873, 0, 10877, 0, 10881, 0,
+ 10885, 0, 10889, 0, 10831, 10833, 0, 10891, 0, 0, 10841, 10843, 10845,
+ 10847, 0, 10851, 10853, 10855, 10857, 10859, 10861, 10863, 0, 10867,
+ 10869, 10871, 10873, 0, 10877, 10879, 10881, 10883, 0, 10887, 0, 10829,
+ 10831, 10833, 10835, 10891, 10837, 10839, 10841, 10843, 10845, 0, 10849,
+ 10851, 10853, 10855, 10857, 10859, 10861, 10863, 10865, 10867, 10869,
+ 10871, 10873, 10875, 10877, 10879, 10881, 0, 0, 0, 0, 0, 10831, 10833,
+ 10835, 0, 10837, 10839, 10841, 10843, 10845, 0, 10849, 10851, 10853,
+ 10855, 10857, 10859, 10861, 10863, 10865, 10867, 10869, 10871, 10873,
+ 10875, 10877, 10879, 10881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 10893, 10896, 10899, 10902, 10905, 10908, 10911, 10914,
+ 10917, 10920, 10923, 0, 0, 0, 0, 0, 10926, 10930, 10934, 10938, 10942,
+ 10946, 10950, 10954, 10958, 10962, 10966, 10970, 10974, 10978, 10982,
+ 10986, 10990, 10994, 10998, 11002, 11006, 11010, 11014, 11018, 11022,
+ 11026, 11030, 3926, 3956, 11034, 11037, 0, 11040, 11042, 11044, 11046,
+ 11048, 11050, 11052, 11054, 11056, 11058, 11060, 11062, 11064, 11066,
+ 11068, 11070, 11072, 11074, 11076, 11078, 11080, 11082, 11084, 11086,
+ 11088, 11090, 11092, 6348, 11095, 11098, 11101, 11105, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11108, 11111,
+ 11114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11117, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 11120, 11123, 11126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 11128, 11130, 11132, 11134, 11136, 11138, 11140, 11142, 11144,
+ 11146, 11148, 11150, 11152, 11154, 11156, 11158, 11160, 11162, 11164,
+ 11166, 11168, 11170, 11172, 11174, 11176, 11178, 11180, 11182, 11184,
+ 11186, 11188, 11190, 11192, 11194, 11196, 11198, 11200, 11202, 11204,
+ 11206, 11208, 11210, 11212, 11214, 0, 0, 0, 0, 11216, 11220, 11224,
+ 11228, 11232, 11236, 11240, 11244, 11248, 0, 0, 0, 0, 0, 0, 0, 11252,
+ 11254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10685, 10687, 10689,
+ 10691, 10693, 10695, 10697, 10699, 10701, 10703, 0, 0, 0, 0, 0, 0, 11256,
+ 11258, 11260, 11262, 11264, 7195, 11266, 11268, 11270, 11272, 7197,
+ 11274, 11276, 11278, 7199, 11280, 11282, 11284, 11286, 11288, 11290,
+ 11292, 11294, 11296, 11298, 11300, 11302, 7315, 11304, 11306, 11308,
+ 11310, 11312, 11314, 11316, 11318, 11320, 7325, 7201, 7203, 7327, 11322,
+ 11324, 6817, 11326, 7205, 11328, 11330, 11332, 11334, 11334, 11334,
+ 11336, 11338, 11340, 11342, 11344, 11346, 11348, 11350, 11352, 11354,
+ 11356, 11358, 11360, 11362, 11364, 11366, 11368, 11370, 11370, 7331,
+ 11372, 11374, 11376, 11378, 7209, 11380, 11382, 11384, 7123, 11386,
+ 11388, 11390, 11392, 11394, 11396, 11398, 11400, 11402, 11404, 11406,
+ 11408, 11410, 11412, 11414, 11416, 11418, 11420, 11422, 11424, 11426,
+ 11428, 11430, 11432, 11434, 11436, 11436, 11438, 11440, 11442, 6809,
+ 11444, 11446, 11448, 11450, 11452, 11454, 11456, 11458, 7219, 11460,
+ 11462, 11464, 11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480,
+ 11482, 11484, 11486, 11488, 11490, 11492, 11494, 11496, 11498, 11500,
+ 6701, 11502, 11504, 11506, 11506, 11508, 11510, 11510, 11512, 11514,
+ 11516, 11518, 11520, 11522, 11524, 11526, 11528, 11530, 11532, 11534,
+ 11536, 7221, 11538, 11540, 11542, 11544, 7355, 11544, 11546, 7225, 11548,
+ 11550, 11552, 11554, 7227, 6647, 11556, 11558, 11560, 11562, 11564,
+ 11566, 11568, 11570, 11572, 11574, 11576, 11578, 11580, 11582, 11584,
+ 11586, 11588, 11590, 11592, 11594, 11596, 11598, 7229, 11600, 11602,
+ 11604, 11606, 11608, 11610, 7233, 11612, 11614, 11616, 11618, 11620,
+ 11622, 11624, 11626, 6703, 7371, 11628, 11630, 11632, 11634, 11636,
+ 11638, 11640, 11642, 7235, 11644, 11646, 11648, 11650, 7457, 11652,
+ 11654, 11656, 11658, 11660, 11662, 11664, 11666, 11668, 11670, 11672,
+ 11674, 11676, 6843, 11678, 11680, 11682, 11684, 11686, 11688, 11690,
+ 11692, 11694, 11696, 11698, 7237, 7017, 11700, 11702, 11704, 11706,
+ 11708, 11710, 11712, 11714, 7379, 11716, 11718, 11720, 11722, 11724,
+ 11726, 11728, 11730, 7381, 11732, 11734, 11736, 11738, 11740, 11742,
+ 11744, 11746, 11748, 11750, 11752, 11754, 7385, 11756, 11758, 11760,
+ 11762, 11764, 11766, 11768, 11770, 11772, 11774, 11776, 11776, 11778,
+ 11780, 7389, 11782, 11784, 11786, 11788, 11790, 11792, 11794, 6815,
+ 11796, 11798, 11800, 11802, 11804, 11806, 11808, 7401, 11810, 11812,
+ 11814, 11816, 11818, 11820, 11820, 7403, 7461, 11822, 11824, 11826,
+ 11828, 11830, 6739, 7407, 11832, 11834, 7259, 11836, 11838, 7167, 11840,
+ 11842, 7267, 11844, 11846, 11848, 11850, 11850, 11852, 11854, 11856,
+ 11858, 11860, 11862, 11864, 11866, 11868, 11870, 11872, 11874, 11876,
+ 11878, 11880, 11882, 11884, 11886, 11888, 11890, 11892, 11894, 11896,
+ 11898, 11900, 11902, 11904, 7279, 11906, 11908, 11910, 11912, 11914,
+ 11916, 11918, 11920, 11922, 11924, 11926, 11928, 11930, 11932, 11934,
+ 11936, 11508, 11938, 11940, 11942, 11944, 11946, 11948, 11950, 11952,
+ 11954, 11956, 11958, 11960, 6851, 11962, 11964, 11966, 11968, 11970,
+ 11972, 7285, 11974, 11976, 11978, 11980, 11982, 11984, 11986, 11988,
+ 11990, 11992, 11994, 11996, 11998, 12000, 12002, 12004, 12006, 12008,
+ 12010, 12012, 6729, 12014, 12016, 12018, 12020, 12022, 12024, 7421,
+ 12026, 12028, 12030, 12032, 12034, 12036, 12038, 12040, 12042, 12044,
+ 12046, 12048, 12050, 12052, 12054, 12056, 12058, 12060, 12062, 12064,
+ 7431, 7433, 12066, 12068, 12070, 12072, 12074, 12076, 12078, 12080,
+ 12082, 12084, 12086, 12088, 12090, 7435, 12092, 12094, 12096, 12098,
+ 12100, 12102, 12104, 12106, 12108, 12110, 12112, 12114, 12116, 12118,
+ 12120, 12122, 12124, 12126, 12128, 12130, 12132, 12134, 12136, 12138,
+ 12140, 12142, 12144, 12146, 12148, 12150, 7447, 7447, 12152, 12154,
+ 12156, 12158, 12160, 12162, 12164, 12166, 12168, 12170, 7449, 12172,
+ 12174, 12176, 12178, 12180, 12182, 12184, 12186, 12188, 12190, 12192,
+ 12194, 12196, 12198, 12200, 12202, 12204, 12206, 12208, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+/* NFC pairs */
+#define COMP_SHIFT 2
+static const unsigned short comp_index[] = {
+ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4,
+ 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 11, 0, 12, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 17, 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, 25, 26, 27,
+ 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 31, 32, 33, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 36,
+ 37, 38, 39, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 44, 45, 46, 47, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 49, 0, 50, 0, 51, 52, 53, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 55, 56, 57,
+ 58, 59, 0, 0, 0, 0, 0, 0, 0, 0, 60, 61, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 63, 64, 65, 0, 66, 67, 68, 0, 0, 0, 0, 0, 0, 0, 0, 69, 70, 71,
+ 72, 73, 74, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 77, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 78, 79, 0, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 84, 85, 86, 0, 87, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, 0, 91,
+ 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, 94, 95, 96, 97, 98, 99, 100, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 101, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103,
+ 104, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, 109, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 111, 112, 0, 113, 114, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 117,
+ 118, 119, 120, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 123, 0,
+ 124, 0, 0, 0, 0, 0, 0, 0, 0, 125, 126, 127, 128, 0, 129, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 130, 0, 131, 132, 133, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 135, 136, 137, 138, 139, 140, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 144, 145, 146, 0, 147, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, 154, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 162, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 165, 166,
+ 167, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, 170, 171, 172, 173, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 174, 175, 0, 0, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 177, 178, 179, 180, 0, 181, 182, 183, 0, 0, 0, 0, 0, 0, 0, 0, 184, 185,
+ 186, 187, 188, 0, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 191, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 193, 194, 195, 196, 197, 198, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 199, 200, 201, 0, 202, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 204, 205, 206, 207, 208, 209, 0, 0, 0, 0, 0, 0, 0, 0, 210, 211,
+ 212, 213, 214, 215, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0, 218, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, 221, 222, 0, 223, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 226,
+ 227, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 229, 230, 231, 0, 232, 0,
+ 233, 0, 0, 0, 0, 0, 0, 0, 0, 234, 235, 0, 0, 0, 0, 0, 236, 0, 0, 0, 0, 0,
+ 0, 0, 0, 237, 238, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 245, 246, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248,
+ 249, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251, 252, 253, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256, 257, 0, 258, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259, 260, 261, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 264, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 266,
+ 267, 268, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 270, 271, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 273, 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 278, 279, 0, 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 282,
+ 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 284, 285, 286, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 288, 289, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 290, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 295, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 299, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 301, 302, 303, 0, 0, 304, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 306,
+ 307, 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 310, 311, 0, 312, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, 0, 314, 0, 315, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 317, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 318, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 327,
+ 0, 328, 329, 0, 0, 330, 0, 0, 0, 0, 0, 0, 0, 0, 331, 0, 0, 332, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 333, 334, 0, 0, 335, 0, 0, 0, 336, 0, 0, 0, 0, 0,
+ 0, 0, 337, 338, 339, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, 0,
+ 342, 343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 344, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 345, 346, 347, 0, 348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 349, 0, 0, 0, 350, 0, 0, 351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0,
+ 0, 0, 354, 355, 356, 0, 357, 0, 0, 358, 359, 0, 0, 0, 0, 0, 0, 0, 360, 0,
+ 0, 0, 361, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, 0, 0, 363, 364, 0, 0,
+ 365, 0, 0, 0, 0, 0, 0, 0, 0, 366, 367, 0, 368, 0, 0, 0, 369, 0, 0, 0, 0,
+ 0, 0, 0, 370, 371, 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 373, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 374, 375, 376, 377, 378, 0, 0,
+ 379, 0, 0, 0, 0, 0, 0, 0, 0, 380, 0, 0, 381, 0, 0, 0, 382, 0, 0, 0, 0, 0,
+ 0, 0, 383, 384, 0, 0, 0, 0, 0, 385, 0, 0, 0, 0, 0, 0, 0, 0, 386, 0, 0, 0,
+ 0, 0, 0, 387, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 388, 0, 0, 0,
+ 0, 0, 0, 0, 0, 389, 390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 391, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 392, 393, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 395, 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 399, 400, 401, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 402, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 404, 405, 406, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 407, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 410, 411,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 413, 414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 416, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 417, 418, 419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 421, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 422, 423, 424, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 426, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 429,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 430, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 432, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 433, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 435, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 439, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 440, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 442, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 445, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 446, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 448,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 449, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 452, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 455, 456, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 462, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 465, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 468, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 469, 0, 0, 0, 470, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 472, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 473, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 474, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 475, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 476, 477, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 483, 0, 0, 0, 0,
+ 0, 0, 484, 0, 0, 0, 0, 0, 0, 0, 0, 485, 0, 0, 0, 0, 0, 0, 486, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 489, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 492, 0, 0, 0,
+ 0, 0, 0, 0, 0, 493, 0, 0, 0, 0, 0, 0, 494, 0, 0, 0, 0, 0, 0, 0, 0, 495,
+ 0, 0, 0, 0, 0, 0, 496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 497,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 502, 0, 0, 0, 0, 0, 0, 0, 0, 503, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 508, 0, 0, 0, 0, 0, 0, 509, 0, 0, 0, 0, 0,
+ 0, 0, 0, 510, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 513, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 516, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 517, 0, 0, 0, 0, 0, 0, 0, 0, 518, 0, 0,
+ 0, 0, 0, 0, 519, 0, 0, 0, 0, 0, 0, 0, 0, 520, 0, 0, 0, 0, 0, 0, 521, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 522, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 526, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 527, 0,
+ 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 529, 0, 0, 0, 0, 0, 0, 0, 0,
+ 530, 0, 0, 0, 0, 0, 0, 531, 0, 0, 0, 0, 0, 0, 0, 532, 533, 0, 0, 0, 0, 0,
+ 534, 0, 0, 0, 0, 0, 0, 0, 0, 535, 0, 0, 0, 0, 0, 0, 536, 0, 0, 0, 0, 0,
+ 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 538, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 542, 0, 0,
+ 0, 0, 0, 0, 543, 0, 0, 0, 0, 0, 0, 0, 0, 544, 0, 0, 0, 0, 0, 0, 545, 0,
+ 0, 0, 0, 0, 0, 0, 546, 547, 0, 0, 0, 0, 0, 548, 0, 0, 0, 0, 0, 0, 0, 0,
+ 549, 0, 0, 0, 0, 0, 0, 550, 0, 0, 0, 0, 0, 0, 0, 0, 551, 0, 0, 0, 0, 0,
+ 0, 552, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 553, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 554, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 555, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 558, 0, 0, 0, 0, 0, 0, 0, 559, 0, 0, 0, 0, 0, 0, 560, 0, 0, 0, 0,
+ 0, 0, 0, 0, 561, 0, 0, 0, 0, 0, 0, 562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 564, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 566, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 567, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 568, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 569, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 570, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 572, 0, 0, 0, 0, 0, 0, 0, 573, 0, 0, 0, 0, 0, 0, 574, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 575, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 576, 0, 0, 0, 0, 0, 0, 0, 577, 578, 0, 0, 0, 0, 0, 579,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 580, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 581, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 582,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 583, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 585, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 586, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 587, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 589, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 590, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 592, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 594, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 595, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 596, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 598, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 601, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 604, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 607, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 608, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 610, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 616, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 617, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 618, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 623, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 626, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 629, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 632, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 635, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 638, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 639, 640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 641, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 642, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 644, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 645, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 648, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 650, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 651, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 654, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 656, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 657, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 660, 661,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 662, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 664,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 665, 666, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 669, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 671, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 674, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 675, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 681,
+};
+
+static const unsigned int comp_data[] = {
+ 0, 0, 0, 0, 0, 0, 0, 8814, 0, 0, 8800, 0, 0, 8815, 0, 0, 0, 192, 193,
+ 194, 195, 256, 258, 550, 196, 7842, 197, 0, 461, 512, 514, 0, 0, 0, 7840,
+ 0, 7680, 0, 0, 260, 0, 0, 7682, 0, 0, 7684, 0, 0, 0, 0, 7686, 0, 262,
+ 264, 0, 0, 0, 266, 0, 0, 0, 0, 268, 0, 199, 0, 0, 0, 7690, 0, 0, 0, 0,
+ 270, 0, 0, 0, 0, 0, 7692, 0, 0, 0, 7696, 0, 7698, 0, 0, 7694, 0, 0, 0, 0,
+ 200, 201, 202, 7868, 274, 276, 278, 203, 7866, 0, 0, 282, 516, 518, 0, 0,
+ 0, 7864, 0, 0, 0, 552, 280, 7704, 0, 7706, 0, 0, 0, 7710, 0, 500, 284, 0,
+ 7712, 286, 288, 0, 0, 0, 0, 486, 0, 290, 0, 0, 0, 292, 0, 0, 0, 7714,
+ 7718, 0, 0, 0, 542, 0, 0, 0, 0, 0, 7716, 0, 0, 0, 7720, 0, 0, 7722, 0, 0,
+ 204, 205, 206, 296, 298, 300, 304, 207, 7880, 0, 0, 463, 520, 522, 0, 0,
+ 0, 7882, 0, 0, 0, 0, 302, 0, 0, 7724, 0, 0, 0, 308, 0, 7728, 0, 0, 0, 0,
+ 0, 488, 0, 7730, 0, 0, 0, 310, 0, 0, 0, 0, 7732, 0, 0, 0, 0, 0, 313, 0,
+ 317, 0, 0, 0, 0, 0, 7734, 0, 0, 0, 315, 0, 7740, 0, 0, 7738, 0, 0, 0, 0,
+ 0, 7742, 0, 0, 0, 0, 7744, 0, 0, 7746, 0, 504, 323, 0, 209, 0, 0, 7748,
+ 0, 0, 0, 0, 327, 0, 7750, 0, 0, 0, 325, 0, 7754, 0, 0, 7752, 0, 0, 0, 0,
+ 210, 211, 212, 213, 332, 334, 558, 214, 7886, 0, 336, 465, 524, 526, 0,
+ 0, 416, 7884, 0, 0, 0, 0, 490, 0, 0, 0, 0, 0, 7764, 7766, 0, 0, 0, 0, 0,
+ 340, 0, 0, 0, 0, 7768, 344, 528, 530, 0, 0, 0, 7770, 0, 0, 0, 342, 0, 0,
+ 0, 0, 7774, 0, 346, 348, 0, 0, 0, 7776, 0, 0, 0, 0, 352, 0, 7778, 0, 0,
+ 536, 350, 0, 0, 0, 7786, 0, 0, 0, 0, 356, 0, 7788, 0, 0, 538, 354, 0,
+ 7792, 0, 0, 7790, 0, 0, 0, 0, 217, 218, 219, 360, 362, 364, 0, 220, 7910,
+ 366, 368, 467, 532, 534, 0, 0, 431, 7908, 7794, 0, 0, 0, 370, 7798, 0,
+ 7796, 7804, 0, 0, 0, 0, 0, 7806, 0, 7808, 7810, 372, 0, 0, 0, 7814, 7812,
+ 0, 7816, 0, 0, 0, 7818, 7820, 0, 0, 0, 7922, 221, 374, 7928, 562, 0,
+ 7822, 376, 7926, 0, 0, 0, 0, 7924, 0, 0, 377, 7824, 0, 0, 0, 379, 381, 0,
+ 0, 0, 0, 0, 7826, 0, 0, 0, 0, 7828, 224, 225, 226, 227, 257, 259, 551,
+ 228, 7843, 229, 0, 462, 513, 515, 0, 0, 0, 7841, 0, 7681, 0, 0, 261, 0,
+ 0, 7683, 0, 0, 7685, 0, 0, 0, 0, 7687, 0, 0, 0, 0, 0, 263, 265, 0, 0, 0,
+ 267, 0, 0, 0, 0, 269, 0, 0, 0, 0, 0, 231, 0, 0, 0, 7691, 271, 0, 0, 0, 0,
+ 0, 7693, 0, 0, 0, 7697, 0, 7699, 0, 0, 7695, 232, 233, 234, 7869, 275,
+ 277, 279, 235, 7867, 0, 0, 283, 517, 519, 0, 0, 0, 7865, 0, 0, 0, 553,
+ 281, 7705, 0, 7707, 0, 0, 0, 7711, 0, 0, 0, 0, 0, 501, 285, 0, 7713, 287,
+ 289, 0, 0, 0, 0, 487, 0, 0, 0, 0, 0, 291, 0, 0, 0, 293, 0, 0, 0, 7715,
+ 7719, 0, 0, 0, 543, 0, 0, 0, 0, 0, 7717, 0, 0, 0, 7721, 0, 0, 7723, 0,
+ 7830, 236, 237, 238, 297, 299, 301, 0, 239, 7881, 0, 0, 464, 521, 523, 0,
+ 0, 0, 7883, 0, 0, 0, 0, 303, 0, 0, 7725, 0, 0, 0, 309, 0, 0, 0, 0, 496,
+ 0, 0, 0, 0, 7729, 0, 489, 0, 0, 0, 0, 0, 7731, 0, 0, 0, 311, 7733, 0, 0,
+ 0, 0, 0, 314, 0, 318, 0, 0, 0, 0, 0, 7735, 0, 0, 0, 316, 0, 7741, 0, 0,
+ 7739, 0, 7743, 0, 0, 0, 0, 7745, 0, 0, 7747, 0, 0, 0, 0, 0, 505, 324, 0,
+ 241, 0, 0, 7749, 0, 0, 0, 0, 328, 0, 7751, 0, 0, 0, 326, 0, 7755, 0, 0,
+ 7753, 0, 0, 0, 0, 242, 243, 244, 245, 333, 335, 559, 246, 7887, 0, 337,
+ 466, 525, 527, 0, 0, 417, 7885, 491, 0, 0, 0, 0, 0, 7765, 0, 0, 0, 0,
+ 7767, 0, 341, 0, 0, 0, 0, 7769, 0, 0, 0, 0, 345, 529, 531, 0, 0, 0, 7771,
+ 0, 0, 0, 343, 0, 0, 0, 0, 7775, 0, 347, 349, 0, 0, 0, 7777, 0, 0, 0, 0,
+ 353, 0, 7779, 0, 0, 537, 351, 0, 0, 0, 7787, 7831, 0, 0, 0, 357, 0, 0, 0,
+ 0, 0, 7789, 0, 0, 539, 355, 0, 7793, 0, 0, 7791, 0, 0, 0, 0, 249, 250,
+ 251, 361, 363, 365, 0, 252, 7911, 367, 369, 468, 533, 535, 0, 0, 432,
+ 7909, 7795, 0, 0, 0, 371, 7799, 0, 7797, 0, 0, 0, 0, 7805, 0, 7807, 0, 0,
+ 0, 0, 0, 7809, 7811, 373, 0, 0, 0, 7815, 7813, 0, 7832, 0, 0, 0, 7817, 0,
+ 0, 0, 7819, 7821, 0, 0, 0, 7923, 253, 375, 7929, 563, 0, 7823, 255, 7927,
+ 7833, 0, 0, 0, 7925, 0, 0, 378, 7825, 0, 0, 0, 380, 0, 0, 0, 0, 382, 0,
+ 7827, 0, 0, 0, 0, 7829, 0, 0, 0, 0, 8173, 901, 0, 0, 0, 0, 0, 0, 8129, 0,
+ 0, 7846, 7844, 0, 7850, 0, 0, 0, 0, 7848, 0, 0, 478, 0, 0, 0, 506, 0, 0,
+ 508, 0, 0, 482, 0, 0, 0, 7688, 0, 7872, 7870, 0, 7876, 0, 0, 0, 0, 7874,
+ 0, 0, 0, 7726, 0, 0, 0, 0, 0, 7890, 7888, 0, 7894, 0, 0, 0, 0, 7892, 0,
+ 0, 0, 7756, 0, 0, 556, 0, 0, 7758, 0, 0, 0, 554, 0, 0, 0, 510, 0, 0, 0,
+ 0, 0, 475, 471, 0, 0, 469, 0, 0, 473, 0, 0, 0, 7847, 7845, 0, 7851, 0, 0,
+ 0, 0, 7849, 0, 0, 479, 0, 0, 0, 507, 0, 0, 509, 0, 0, 483, 0, 0, 0, 7689,
+ 0, 7873, 7871, 0, 7877, 0, 0, 0, 0, 7875, 0, 0, 0, 7727, 0, 0, 0, 0, 0,
+ 7891, 7889, 0, 7895, 0, 0, 0, 0, 7893, 0, 0, 0, 7757, 0, 0, 557, 0, 0,
+ 7759, 0, 0, 0, 555, 0, 0, 0, 511, 0, 0, 0, 0, 0, 476, 472, 0, 0, 470, 0,
+ 0, 474, 0, 0, 0, 7856, 7854, 0, 7860, 0, 0, 0, 0, 7858, 0, 0, 7857, 7855,
+ 0, 7861, 0, 0, 0, 0, 7859, 0, 0, 7700, 7702, 0, 0, 0, 0, 0, 7701, 7703,
+ 0, 0, 0, 0, 0, 7760, 7762, 0, 7761, 7763, 0, 0, 0, 7780, 0, 0, 7781, 0,
+ 0, 7782, 0, 0, 0, 0, 0, 0, 7783, 0, 7800, 0, 0, 7801, 0, 0, 0, 0, 7802,
+ 0, 0, 7803, 0, 0, 0, 0, 0, 7835, 0, 0, 0, 0, 7900, 7898, 0, 7904, 0, 0,
+ 0, 0, 7902, 7906, 0, 0, 0, 0, 0, 7901, 7899, 0, 7905, 0, 0, 0, 0, 7903,
+ 0, 0, 0, 0, 7907, 0, 7914, 7912, 0, 7918, 0, 0, 0, 0, 7916, 0, 0, 0, 0,
+ 7920, 0, 7915, 7913, 0, 7919, 7917, 0, 0, 0, 0, 7921, 0, 0, 0, 0, 494, 0,
+ 0, 0, 492, 0, 0, 493, 0, 0, 480, 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, 7708, 0,
+ 0, 7709, 0, 560, 0, 0, 0, 0, 0, 0, 561, 0, 495, 0, 0, 0, 8122, 902, 0, 0,
+ 8121, 8120, 0, 0, 0, 0, 7944, 7945, 0, 0, 0, 0, 0, 8124, 0, 8136, 904, 0,
+ 0, 0, 0, 7960, 7961, 0, 0, 0, 8138, 905, 0, 0, 0, 0, 7976, 7977, 0, 8140,
+ 0, 0, 0, 0, 0, 8154, 906, 0, 0, 8153, 8152, 0, 938, 0, 0, 7992, 7993, 0,
+ 0, 0, 8184, 908, 0, 0, 0, 0, 8008, 8009, 0, 0, 0, 0, 0, 0, 8172, 0, 0, 0,
+ 8170, 910, 0, 0, 8169, 8168, 0, 939, 0, 0, 0, 8025, 0, 0, 0, 8186, 911,
+ 8040, 8041, 0, 0, 0, 0, 0, 8188, 0, 0, 8116, 0, 0, 8132, 0, 0, 0, 0, 0,
+ 8048, 940, 0, 0, 8113, 8112, 0, 0, 0, 0, 7936, 7937, 0, 0, 0, 0, 8118,
+ 8115, 0, 0, 0, 0, 0, 8050, 941, 7952, 7953, 0, 0, 0, 8052, 942, 0, 0, 0,
+ 0, 7968, 7969, 0, 0, 0, 0, 8134, 8131, 0, 8054, 943, 0, 0, 8145, 8144, 0,
+ 970, 0, 0, 7984, 7985, 8150, 0, 0, 0, 0, 0, 0, 8056, 972, 0, 0, 0, 0,
+ 8000, 8001, 0, 8164, 8165, 0, 0, 0, 8058, 973, 0, 0, 8161, 8160, 0, 971,
+ 0, 0, 0, 0, 0, 0, 8016, 8017, 0, 0, 0, 0, 8166, 0, 0, 8060, 974, 0, 0, 0,
+ 0, 8032, 8033, 8182, 8179, 0, 0, 0, 0, 0, 8146, 912, 0, 0, 0, 0, 0, 0,
+ 8151, 0, 0, 8162, 944, 0, 0, 8167, 0, 0, 0, 8180, 0, 0, 979, 0, 0, 0, 0,
+ 0, 980, 0, 0, 1031, 0, 0, 0, 0, 1232, 0, 1234, 0, 0, 0, 0, 1027, 0, 1024,
+ 0, 0, 0, 0, 1238, 0, 1025, 1217, 0, 1244, 0, 0, 1246, 0, 0, 0, 1037, 0,
+ 0, 0, 1250, 1049, 0, 1252, 0, 0, 0, 0, 1036, 0, 0, 0, 0, 1254, 0, 0, 0,
+ 1262, 1038, 0, 1264, 0, 0, 1266, 0, 0, 0, 1268, 0, 0, 0, 0, 0, 0, 1272,
+ 0, 0, 1260, 0, 0, 0, 0, 1233, 0, 1235, 0, 0, 0, 0, 1107, 0, 1104, 0, 0,
+ 0, 0, 1239, 0, 1105, 1218, 0, 1245, 0, 0, 1247, 0, 0, 0, 1117, 0, 0, 0,
+ 1251, 1081, 0, 1253, 0, 0, 0, 0, 1116, 0, 0, 0, 0, 1255, 0, 0, 0, 1263,
+ 1118, 0, 1265, 0, 0, 1267, 0, 0, 0, 1269, 0, 0, 0, 0, 0, 0, 1273, 0, 0,
+ 1261, 0, 0, 1111, 0, 0, 0, 1142, 0, 0, 1143, 0, 0, 0, 0, 0, 1242, 0, 0,
+ 1243, 0, 0, 1258, 0, 0, 0, 0, 0, 0, 1259, 0, 1570, 1571, 1573, 0, 1572,
+ 0, 0, 1574, 0, 0, 0, 0, 0, 0, 1730, 0, 0, 1747, 0, 0, 1728, 0, 0, 0, 0,
+ 2345, 0, 0, 2353, 0, 0, 2356, 0, 0, 0, 2507, 2508, 0, 0, 0, 2891, 2888,
+ 2892, 2964, 0, 0, 0, 0, 0, 3018, 3020, 0, 3019, 0, 0, 0, 0, 3144, 0, 0,
+ 0, 0, 3264, 0, 3274, 3271, 3272, 0, 3275, 0, 0, 0, 0, 3402, 3404, 0,
+ 3403, 0, 0, 0, 0, 3546, 3548, 3550, 0, 0, 0, 0, 3549, 0, 0, 0, 0, 0,
+ 4134, 0, 0, 0, 6918, 0, 0, 6920, 0, 0, 6922, 0, 0, 6924, 0, 0, 0, 0, 0,
+ 0, 6926, 0, 0, 6930, 0, 0, 6971, 0, 0, 6973, 0, 0, 0, 0, 0, 0, 6976, 0,
+ 0, 6977, 0, 0, 6979, 0, 0, 0, 7736, 0, 0, 7737, 0, 0, 0, 0, 0, 0, 7772,
+ 0, 0, 7773, 0, 0, 0, 0, 7784, 0, 0, 7785, 0, 0, 7852, 0, 0, 7862, 0, 0,
+ 0, 7853, 0, 0, 7863, 0, 0, 0, 7878, 0, 0, 7879, 0, 0, 7896, 0, 0, 7897,
+ 0, 0, 0, 0, 7938, 7940, 0, 0, 7942, 8064, 0, 7939, 7941, 0, 0, 7943,
+ 8065, 0, 0, 8066, 0, 0, 0, 0, 0, 0, 8067, 0, 0, 8068, 0, 0, 8069, 0, 0,
+ 8070, 0, 0, 0, 0, 0, 0, 8071, 0, 7946, 7948, 0, 0, 7950, 8072, 0, 7947,
+ 7949, 0, 0, 7951, 8073, 0, 0, 8074, 0, 0, 0, 0, 0, 0, 8075, 0, 0, 8076,
+ 0, 0, 8077, 0, 0, 8078, 0, 0, 0, 0, 0, 0, 8079, 0, 7954, 7956, 0, 7955,
+ 7957, 0, 0, 0, 0, 0, 7962, 7964, 0, 0, 0, 0, 0, 7963, 7965, 0, 7970,
+ 7972, 0, 0, 7974, 8080, 0, 7971, 7973, 0, 0, 7975, 8081, 0, 0, 8082, 0,
+ 0, 0, 0, 0, 0, 8083, 0, 0, 8084, 0, 0, 8085, 0, 0, 8086, 0, 0, 0, 0, 0,
+ 0, 8087, 0, 7978, 7980, 0, 0, 7982, 8088, 0, 7979, 7981, 0, 0, 7983,
+ 8089, 0, 0, 8090, 0, 0, 0, 0, 0, 0, 8091, 0, 0, 8092, 0, 0, 8093, 0, 0,
+ 8094, 0, 0, 0, 0, 0, 0, 8095, 0, 7986, 7988, 0, 0, 7990, 0, 0, 7987,
+ 7989, 0, 0, 7991, 0, 0, 0, 0, 0, 0, 7994, 7996, 0, 0, 0, 0, 0, 0, 7998,
+ 0, 0, 7995, 7997, 0, 0, 7999, 0, 0, 8002, 8004, 0, 8003, 8005, 0, 0, 0,
+ 0, 0, 8010, 8012, 0, 0, 0, 0, 0, 8011, 8013, 0, 8018, 8020, 0, 0, 8022,
+ 0, 0, 8019, 8021, 0, 0, 8023, 0, 0, 0, 0, 0, 0, 8027, 8029, 0, 0, 0, 0,
+ 0, 0, 8031, 0, 0, 8034, 8036, 0, 0, 8038, 8096, 0, 8035, 8037, 0, 0,
+ 8039, 8097, 0, 0, 8098, 0, 0, 8099, 0, 0, 0, 0, 0, 0, 8100, 0, 0, 8101,
+ 0, 0, 8102, 0, 0, 8103, 0, 0, 0, 0, 0, 8042, 8044, 0, 0, 8046, 8104, 0,
+ 8043, 8045, 0, 0, 8047, 8105, 0, 0, 8106, 0, 0, 8107, 0, 0, 0, 0, 0, 0,
+ 8108, 0, 0, 8109, 0, 0, 8110, 0, 0, 8111, 0, 0, 0, 0, 0, 0, 8114, 0, 0,
+ 8130, 0, 0, 8178, 0, 0, 8119, 0, 0, 0, 0, 0, 8141, 8142, 0, 0, 8143, 0,
+ 0, 0, 8135, 0, 0, 8183, 0, 0, 0, 0, 0, 8157, 8158, 0, 0, 0, 0, 0, 0,
+ 8159, 0, 8602, 0, 0, 8603, 0, 0, 0, 0, 0, 0, 8622, 0, 0, 8653, 0, 0,
+ 8655, 0, 0, 8654, 0, 0, 0, 0, 0, 0, 8708, 0, 0, 8713, 0, 0, 8716, 0, 0,
+ 8740, 0, 0, 0, 0, 0, 0, 8742, 0, 0, 8769, 0, 0, 8772, 0, 0, 8775, 0, 0,
+ 0, 0, 0, 0, 8777, 0, 0, 8813, 0, 0, 8802, 0, 0, 8816, 0, 0, 0, 0, 0, 0,
+ 8817, 0, 0, 8820, 0, 0, 8821, 0, 0, 8824, 0, 0, 0, 0, 0, 0, 8825, 0, 0,
+ 8832, 0, 0, 8833, 0, 0, 8928, 0, 0, 0, 0, 0, 0, 8929, 0, 0, 8836, 0, 0,
+ 8837, 0, 0, 8840, 0, 0, 0, 0, 0, 0, 8841, 0, 0, 8930, 0, 0, 8931, 0, 0,
+ 8876, 0, 0, 0, 0, 0, 0, 8877, 0, 0, 8878, 0, 0, 8879, 0, 0, 8938, 0, 0,
+ 0, 0, 0, 0, 8939, 0, 0, 8940, 0, 0, 8941, 0, 0, 0, 12436, 0, 0, 12364, 0,
+ 0, 0, 0, 0, 0, 12366, 0, 0, 12368, 0, 0, 12370, 0, 0, 12372, 0, 0, 0, 0,
+ 0, 0, 12374, 0, 0, 12376, 0, 0, 12378, 0, 0, 12380, 0, 0, 0, 0, 0, 0,
+ 12382, 0, 0, 12384, 0, 0, 12386, 0, 0, 12389, 0, 0, 0, 0, 0, 0, 12391, 0,
+ 0, 12393, 0, 0, 12400, 12401, 0, 12403, 12404, 0, 0, 0, 0, 0, 12406,
+ 12407, 0, 0, 0, 0, 0, 12409, 12410, 0, 12412, 12413, 0, 12446, 0, 0, 0,
+ 0, 0, 0, 12532, 0, 0, 12460, 0, 0, 12462, 0, 0, 12464, 0, 0, 0, 0, 0, 0,
+ 12466, 0, 0, 12468, 0, 0, 12470, 0, 0, 12472, 0, 0, 0, 0, 0, 0, 12474, 0,
+ 0, 12476, 0, 0, 12478, 0, 0, 12480, 0, 0, 0, 0, 0, 0, 12482, 0, 0, 12485,
+ 0, 0, 12487, 0, 0, 12489, 0, 0, 0, 0, 0, 0, 12496, 12497, 0, 0, 0, 0, 0,
+ 12499, 12500, 0, 12502, 12503, 0, 12505, 12506, 0, 0, 0, 0, 0, 12508,
+ 12509, 0, 0, 0, 0, 0, 12535, 0, 0, 12536, 0, 0, 12537, 0, 0, 0, 0, 0, 0,
+ 12538, 0, 0, 12542, 0, 0, 0, 0, 69786, 0, 0, 69788, 0, 0, 69803, 0, 0, 0,
+ 69934, 0, 0, 69935, 0, 0, 0, 70475, 70476, 0, 0, 0, 70844, 70843, 70846,
+ 0, 0, 0, 71098, 0, 0, 71099, 0, 0, 0, 71992,
+};
+
+static const change_record change_records_3_2_0[] = {
+ { 255, 255, 255, 255, 255, 0 },
+ { 11, 255, 255, 255, 255, 0 },
+ { 10, 255, 255, 255, 255, 0 },
+ { 255, 30, 255, 255, 255, 0 },
+ { 255, 2, 255, 255, 255, 0 },
+ { 19, 21, 255, 255, 255, 0 },
+ { 255, 255, 2, 255, 255, 0 },
+ { 255, 255, 3, 255, 255, 0 },
+ { 255, 255, 1, 255, 255, 0 },
+ { 255, 0, 255, 255, 255, 0 },
+ { 255, 29, 255, 255, 255, 0 },
+ { 255, 26, 255, 255, 255, 0 },
+ { 5, 255, 255, 255, 255, 0 },
+ { 14, 6, 255, 255, 255, 0 },
+ { 15, 255, 255, 255, 255, 0 },
+ { 255, 255, 255, 255, 255, 1.0 },
+ { 255, 255, 255, 255, 255, 2.0 },
+ { 255, 255, 255, 255, 255, 3.0 },
+ { 255, 255, 255, 255, 255, 4.0 },
+ { 255, 255, 255, 255, 255, -1 },
+ { 14, 255, 255, 255, 255, 0 },
+ { 255, 255, 255, 0, 255, 0 },
+ { 255, 19, 255, 255, 255, 0 },
+ { 255, 7, 1, 255, 255, 0 },
+ { 255, 7, 2, 255, 255, 0 },
+ { 255, 7, 3, 255, 255, 0 },
+ { 255, 7, 4, 255, 255, 0 },
+ { 255, 7, 5, 255, 255, 0 },
+ { 255, 7, 6, 255, 255, 0 },
+ { 255, 7, 7, 255, 255, 0 },
+ { 255, 7, 8, 255, 255, 0 },
+ { 255, 7, 9, 255, 255, 0 },
+ { 14, 4, 255, 255, 255, 0 },
+ { 1, 5, 255, 255, 255, 0 },
+ { 1, 19, 255, 255, 255, 0 },
+ { 255, 10, 255, 255, 255, 0 },
+ { 18, 255, 255, 255, 255, 0 },
+ { 19, 255, 255, 255, 255, 0 },
+ { 255, 255, 0, 255, 255, 0 },
+ { 255, 255, 4, 255, 255, 0 },
+ { 255, 255, 5, 255, 255, 0 },
+ { 255, 255, 6, 255, 255, 0 },
+ { 255, 255, 7, 255, 255, 0 },
+ { 255, 255, 8, 255, 255, 0 },
+ { 255, 255, 9, 255, 255, 0 },
+ { 19, 30, 255, 255, 255, 0 },
+ { 255, 8, 255, 255, 255, 0 },
+ { 255, 27, 255, 255, 255, 0 },
+ { 255, 255, 255, 255, 0, 0 },
+ { 255, 22, 255, 255, 255, 0 },
+ { 255, 23, 255, 255, 255, 0 },
+ { 9, 255, 255, 255, 255, 0 },
+ { 255, 255, 255, 1, 255, 0 },
+ { 255, 20, 255, 255, 255, 0 },
+ { 255, 255, 255, 255, 255, 1e+16 },
+ { 255, 255, 255, 255, 255, 1e+20 },
+ { 255, 19, 255, 255, 255, -1 },
+ { 1, 255, 255, 0, 255, 0 },
+};
+static const unsigned char changes_3_2_0_index[] = {
+ 0, 1, 2, 2, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 2, 2, 2, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 52, 2, 53, 2, 2, 54, 55, 56, 57, 58, 2, 59, 60, 61, 62, 2, 63, 64,
+ 65, 66, 67, 68, 68, 2, 69, 2, 2, 70, 71, 52, 72, 73, 74, 75, 2, 2, 2, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 2, 2, 2, 2, 2, 2, 86, 2, 2, 2, 2, 2,
+ 87, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 88, 2, 89, 2, 2, 2, 2, 2, 2, 2, 2,
+ 90, 91, 2, 2, 2, 2, 2, 2, 2, 92, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 93,
+ 94, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 96, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 97, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 98, 99, 2, 2, 2, 2, 2, 2, 2, 2, 100, 52,
+ 52, 101, 102, 52, 103, 104, 105, 106, 107, 108, 109, 110, 111, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 113, 114, 115, 116, 117, 118, 2, 2, 119, 120, 121,
+ 2, 122, 123, 124, 125, 126, 127, 2, 128, 129, 130, 131, 132, 133, 134,
+ 52, 52, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
+ 2, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 2, 159, 160, 2,
+ 161, 162, 163, 164, 2, 165, 166, 167, 168, 169, 170, 171, 2, 172, 173,
+ 174, 175, 2, 176, 177, 178, 52, 52, 52, 52, 52, 52, 52, 179, 180, 52,
+ 181, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 182, 52,
+ 52, 52, 52, 52, 52, 52, 52, 183, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, 52, 52, 52,
+ 184, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, 52, 52,
+ 52, 185, 186, 187, 188, 2, 2, 2, 2, 189, 190, 191, 192, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 102, 52, 52, 52, 52, 52, 52, 52, 52, 52, 183,
+ 193, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 194, 52,
+ 52, 195, 52, 52, 196, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 197, 198, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 199, 181, 2, 2, 200, 201,
+ 202, 203, 204, 2, 2, 205, 2, 2, 2, 206, 207, 208, 52, 52, 52, 52, 52,
+ 209, 2, 2, 2, 2, 2, 2, 2, 2, 210, 2, 211, 212, 213, 2, 2, 214, 2, 2, 2,
+ 215, 2, 2, 2, 2, 2, 216, 52, 217, 218, 2, 2, 2, 2, 2, 219, 220, 221, 2,
+ 222, 223, 2, 2, 224, 225, 52, 226, 227, 2, 52, 52, 52, 52, 52, 52, 52,
+ 228, 229, 230, 231, 232, 52, 52, 233, 234, 52, 235, 2, 2, 2, 2, 2, 2, 2,
+ 2, 236, 237, 97, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 86, 238, 2,
+ 239, 240, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 241, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 242, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 243, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 244, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 245, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 246,
+ 52, 247, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 248, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 249, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 241, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 250, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 251, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 52, 252, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2,
+};
+
+static const unsigned char changes_3_2_0_data[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
+ 0, 0, 4, 0, 0, 5, 0, 0, 0, 0, 6, 7, 0, 0, 3, 0, 0, 8, 4, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 10, 0, 9, 9, 0, 0, 0, 9, 9,
+ 9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 0, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 0, 0,
+ 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 16, 17, 18, 19, 0, 0, 9,
+ 9, 9, 9, 0, 0, 9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 9, 0, 0, 9, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 20, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 9, 9, 9, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 9, 0, 0, 9, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21, 21, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 9, 9, 0, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 9, 0,
+ 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,
+ 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 33, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 34, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 9, 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 38, 4, 0, 0, 39, 40,
+ 41, 42, 43, 44, 1, 1, 0, 0, 0, 4, 38, 8, 6, 7, 39, 40, 41, 42, 43, 44, 1,
+ 1, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 46, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 50, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 9, 0, 0, 0, 0, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 0, 0, 0, 0, 9,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9,
+ 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9,
+ 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 19,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 0, 9, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9,
+ 9, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0,
+ 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 19, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 49, 50, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 21, 21, 21,
+ 21, 21, 0, 0, 0, 1, 1, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14,
+ 14, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9,
+ 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 19,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 9, 0, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 0,
+ 0, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 0, 0, 0, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 0, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 0, 0, 9, 9, 9, 0, 0, 9, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 57, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 0, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 9, 9, 0, 9, 0, 0, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 9, 9, 9, 9, 0, 9, 0, 9, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 9, 0, 9, 0,
+ 9, 0, 9, 9, 9, 0, 9, 9, 0, 9, 0, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 9,
+ 0, 9, 0, 0, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 0, 9, 9,
+ 9, 9, 0, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 0, 9, 9, 9, 9, 9, 0,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
+ 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+};
+
+static const change_record* get_change_3_2_0(Py_UCS4 n)
+{
+ int index;
+ if (n >= 0x110000) index = 0;
+ else {
+ index = changes_3_2_0_index[n>>7];
+ index = changes_3_2_0_data[(index<<7)+(n & 127)];
+ }
+ return change_records_3_2_0+index;
+}
+
+static Py_UCS4 normalization_3_2_0(Py_UCS4 n)
+{
+ switch(n) {
+ case 0x2f868: return 0x2136A;
+ case 0x2f874: return 0x5F33;
+ case 0x2f91f: return 0x43AB;
+ case 0x2f95f: return 0x7AAE;
+ case 0x2f9bf: return 0x4D57;
+ default: return 0;
+ }
+}
+
diff --git a/contrib/tools/python3/Modules/unicodename_db.h b/contrib/tools/python3/Modules/unicodename_db.h
new file mode 100644
index 00000000000..f6320c43e53
--- /dev/null
+++ b/contrib/tools/python3/Modules/unicodename_db.h
@@ -0,0 +1,31070 @@
+/* this file was generated by Tools/unicode/makeunicodedata.py 3.3 */
+
+#define NAME_MAXLEN 256
+
+/* lexicon */
+static const unsigned char lexicon[] = {
+ 76, 69, 84, 84, 69, 210, 83, 77, 65, 76, 204, 83, 73, 71, 206, 87, 73,
+ 84, 200, 83, 89, 76, 76, 65, 66, 76, 197, 67, 65, 80, 73, 84, 65, 204,
+ 72, 73, 69, 82, 79, 71, 76, 89, 80, 200, 76, 65, 84, 73, 206, 65, 82, 65,
+ 66, 73, 195, 67, 85, 78, 69, 73, 70, 79, 82, 205, 89, 201, 67, 74, 203,
+ 77, 65, 84, 72, 69, 77, 65, 84, 73, 67, 65, 204, 69, 71, 89, 80, 84, 73,
+ 65, 206, 67, 79, 77, 80, 65, 84, 73, 66, 73, 76, 73, 84, 217, 83, 89, 77,
+ 66, 79, 204, 68, 73, 71, 73, 212, 86, 79, 87, 69, 204, 84, 65, 78, 71,
+ 85, 212, 70, 79, 82, 77, 128, 67, 65, 78, 65, 68, 73, 65, 206, 83, 89,
+ 76, 76, 65, 66, 73, 67, 211, 65, 78, 196, 83, 73, 71, 78, 87, 82, 73, 84,
+ 73, 78, 199, 84, 73, 77, 69, 211, 66, 65, 77, 85, 205, 83, 67, 82, 73,
+ 80, 212, 66, 79, 76, 196, 65, 78, 65, 84, 79, 76, 73, 65, 206, 72, 65,
+ 78, 71, 85, 204, 78, 85, 77, 66, 69, 210, 76, 73, 78, 69, 65, 210, 67,
+ 79, 77, 66, 73, 78, 73, 78, 199, 76, 73, 71, 65, 84, 85, 82, 197, 71, 82,
+ 69, 69, 203, 69, 84, 72, 73, 79, 80, 73, 195, 77, 85, 83, 73, 67, 65,
+ 204, 67, 89, 82, 73, 76, 76, 73, 195, 70, 79, 210, 75, 72, 73, 84, 65,
+ 206, 193, 73, 84, 65, 76, 73, 195, 84, 65, 77, 73, 204, 76, 69, 70, 212,
+ 78, 85, 83, 72, 213, 67, 73, 82, 67, 76, 69, 196, 82, 65, 68, 73, 67, 65,
+ 204, 83, 65, 78, 83, 45, 83, 69, 82, 73, 198, 82, 73, 71, 72, 212, 83,
+ 81, 85, 65, 82, 197, 77, 79, 68, 73, 70, 73, 69, 210, 70, 73, 78, 65,
+ 204, 84, 65, 201, 68, 79, 85, 66, 76, 197, 83, 73, 71, 78, 128, 65, 82,
+ 82, 79, 87, 128, 65, 66, 79, 86, 69, 128, 86, 65, 201, 66, 69, 76, 79,
+ 87, 128, 72, 69, 78, 84, 65, 73, 71, 65, 78, 193, 66, 76, 65, 67, 203,
+ 87, 72, 73, 84, 197, 65, 82, 82, 79, 215, 65, 128, 85, 128, 86, 65, 82,
+ 73, 65, 84, 73, 79, 206, 73, 128, 66, 82, 65, 73, 76, 76, 197, 80, 65,
+ 84, 84, 69, 82, 206, 75, 65, 84, 65, 75, 65, 78, 193, 66, 89, 90, 65, 78,
+ 84, 73, 78, 197, 79, 128, 68, 79, 212, 73, 83, 79, 76, 65, 84, 69, 196,
+ 77, 65, 82, 75, 128, 194, 79, 198, 77, 89, 65, 78, 77, 65, 210, 86, 69,
+ 82, 84, 73, 67, 65, 204, 77, 73, 68, 68, 76, 197, 75, 65, 78, 71, 88,
+ 201, 75, 73, 75, 65, 75, 85, 201, 77, 69, 78, 68, 197, 84, 73, 66, 69,
+ 84, 65, 206, 77, 65, 82, 203, 72, 69, 65, 86, 217, 73, 78, 73, 84, 73,
+ 65, 204, 72, 77, 79, 78, 199, 79, 78, 197, 77, 69, 69, 205, 65, 66, 79,
+ 86, 197, 67, 79, 80, 84, 73, 195, 75, 72, 77, 69, 210, 82, 73, 71, 72,
+ 84, 87, 65, 82, 68, 211, 90, 78, 65, 77, 69, 78, 78, 217, 67, 65, 82, 82,
+ 73, 69, 210, 89, 69, 200, 68, 69, 86, 65, 78, 65, 71, 65, 82, 201, 71,
+ 69, 79, 82, 71, 73, 65, 206, 72, 79, 79, 75, 128, 67, 72, 69, 82, 79, 75,
+ 69, 197, 77, 79, 78, 71, 79, 76, 73, 65, 206, 84, 87, 207, 83, 84, 82,
+ 79, 75, 69, 128, 79, 78, 69, 128, 80, 76, 85, 211, 84, 87, 79, 128, 76,
+ 79, 87, 69, 210, 66, 79, 216, 83, 81, 85, 65, 82, 69, 196, 83, 89, 77,
+ 66, 79, 76, 128, 80, 72, 65, 83, 69, 45, 197, 84, 72, 82, 69, 197, 85,
+ 80, 80, 69, 210, 86, 79, 67, 65, 76, 73, 195, 76, 69, 70, 84, 87, 65, 82,
+ 68, 211, 84, 207, 67, 79, 78, 83, 79, 78, 65, 78, 212, 77, 73, 65, 207,
+ 68, 82, 65, 87, 73, 78, 71, 211, 84, 73, 76, 197, 68, 85, 80, 76, 79, 89,
+ 65, 206, 74, 79, 78, 71, 83, 69, 79, 78, 199, 80, 65, 82, 69, 78, 84, 72,
+ 69, 83, 73, 90, 69, 196, 84, 72, 65, 205, 71, 79, 78, 68, 201, 76, 79,
+ 215, 65, 76, 69, 198, 72, 65, 76, 198, 85, 208, 70, 79, 85, 82, 128, 71,
+ 76, 65, 71, 79, 76, 73, 84, 73, 195, 72, 69, 66, 82, 69, 215, 72, 73, 71,
+ 200, 84, 72, 82, 69, 69, 128, 79, 86, 69, 210, 72, 65, 128, 73, 78, 68,
+ 69, 216, 77, 65, 76, 65, 89, 65, 76, 65, 205, 83, 73, 89, 65, 209, 68,
+ 79, 87, 206, 80, 65, 72, 65, 87, 200, 67, 72, 79, 83, 69, 79, 78, 199,
+ 66, 65, 76, 73, 78, 69, 83, 197, 70, 73, 86, 69, 128, 72, 65, 76, 70, 87,
+ 73, 68, 84, 200, 72, 65, 78, 68, 45, 70, 73, 83, 212, 77, 69, 82, 79, 73,
+ 84, 73, 195, 84, 85, 82, 78, 69, 196, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 73, 195, 75, 65, 128, 76, 73, 71, 72, 212, 73, 68, 69, 79, 71, 82, 65,
+ 205, 80, 72, 65, 83, 69, 45, 196, 84, 79, 128, 65, 76, 67, 72, 69, 77,
+ 73, 67, 65, 204, 78, 69, 85, 77, 197, 66, 82, 65, 72, 77, 201, 84, 79,
+ 78, 197, 66, 65, 82, 128, 82, 65, 128, 83, 73, 78, 72, 65, 76, 193, 78,
+ 85, 77, 69, 82, 73, 195, 80, 65, 128, 83, 73, 88, 128, 89, 65, 128, 69,
+ 73, 71, 72, 84, 128, 76, 65, 128, 77, 65, 128, 83, 69, 86, 69, 78, 128,
+ 84, 72, 85, 77, 194, 72, 85, 78, 71, 65, 82, 73, 65, 206, 78, 73, 78, 69,
+ 128, 76, 79, 78, 199, 78, 65, 128, 66, 65, 82, 194, 72, 65, 200, 82, 73,
+ 71, 72, 84, 128, 66, 76, 79, 67, 203, 68, 79, 84, 211, 78, 79, 82, 84,
+ 200, 83, 65, 128, 84, 72, 79, 85, 83, 65, 78, 68, 128, 84, 65, 128, 90,
+ 90, 89, 88, 128, 90, 90, 89, 84, 128, 90, 90, 89, 82, 88, 128, 90, 90,
+ 89, 82, 128, 90, 90, 89, 80, 128, 90, 90, 89, 65, 128, 90, 90, 89, 128,
+ 90, 90, 85, 88, 128, 90, 90, 85, 82, 88, 128, 90, 90, 85, 82, 128, 90,
+ 90, 85, 80, 128, 90, 90, 85, 128, 90, 90, 83, 89, 65, 128, 90, 90, 83,
+ 65, 128, 90, 90, 79, 88, 128, 90, 90, 79, 80, 128, 90, 90, 79, 128, 90,
+ 90, 73, 88, 128, 90, 90, 73, 84, 128, 90, 90, 73, 80, 128, 90, 90, 73,
+ 69, 88, 128, 90, 90, 73, 69, 84, 128, 90, 90, 73, 69, 80, 128, 90, 90,
+ 73, 69, 128, 90, 90, 73, 128, 90, 90, 69, 88, 128, 90, 90, 69, 80, 128,
+ 90, 90, 69, 69, 128, 90, 90, 69, 128, 90, 90, 65, 88, 128, 90, 90, 65,
+ 84, 128, 90, 90, 65, 80, 128, 90, 90, 65, 65, 128, 90, 90, 65, 128, 90,
+ 89, 71, 79, 83, 128, 90, 87, 83, 80, 128, 90, 87, 78, 74, 128, 90, 87,
+ 78, 66, 83, 80, 128, 90, 87, 74, 128, 90, 87, 202, 90, 87, 65, 82, 65,
+ 75, 65, 89, 128, 90, 87, 65, 128, 90, 85, 84, 128, 90, 85, 79, 88, 128,
+ 90, 85, 79, 80, 128, 90, 85, 79, 128, 90, 85, 77, 128, 90, 85, 66, 85,
+ 82, 128, 90, 85, 53, 128, 90, 85, 181, 90, 213, 90, 83, 72, 65, 128, 90,
+ 82, 65, 128, 90, 81, 65, 80, 72, 193, 90, 79, 84, 128, 90, 79, 79, 128,
+ 90, 79, 77, 66, 73, 69, 128, 90, 79, 65, 128, 90, 77, 69, 89, 84, 83, 65,
+ 128, 90, 76, 65, 77, 193, 90, 76, 65, 128, 90, 76, 193, 90, 74, 69, 128,
+ 90, 73, 90, 50, 128, 90, 73, 81, 65, 65, 128, 90, 73, 80, 80, 69, 82, 45,
+ 77, 79, 85, 84, 200, 90, 73, 78, 79, 82, 128, 90, 73, 76, 68, 69, 128,
+ 90, 73, 71, 90, 65, 199, 90, 73, 71, 128, 90, 73, 68, 193, 90, 73, 66,
+ 128, 90, 73, 194, 90, 73, 51, 128, 90, 201, 90, 72, 89, 88, 128, 90, 72,
+ 89, 84, 128, 90, 72, 89, 82, 88, 128, 90, 72, 89, 82, 128, 90, 72, 89,
+ 80, 128, 90, 72, 89, 128, 90, 72, 87, 69, 128, 90, 72, 87, 65, 128, 90,
+ 72, 85, 88, 128, 90, 72, 85, 84, 128, 90, 72, 85, 82, 88, 128, 90, 72,
+ 85, 82, 128, 90, 72, 85, 80, 128, 90, 72, 85, 79, 88, 128, 90, 72, 85,
+ 79, 80, 128, 90, 72, 85, 79, 128, 90, 72, 85, 128, 90, 72, 79, 88, 128,
+ 90, 72, 79, 84, 128, 90, 72, 79, 80, 128, 90, 72, 79, 79, 128, 90, 72,
+ 79, 73, 128, 90, 72, 79, 128, 90, 72, 73, 86, 69, 84, 69, 128, 90, 72,
+ 73, 76, 128, 90, 72, 73, 128, 90, 72, 69, 88, 128, 90, 72, 69, 84, 128,
+ 90, 72, 69, 80, 128, 90, 72, 69, 69, 128, 90, 72, 69, 128, 90, 72, 197,
+ 90, 72, 65, 89, 73, 78, 128, 90, 72, 65, 88, 128, 90, 72, 65, 84, 128,
+ 90, 72, 65, 82, 128, 90, 72, 65, 80, 128, 90, 72, 65, 73, 78, 128, 90,
+ 72, 65, 65, 128, 90, 72, 65, 128, 90, 72, 128, 90, 69, 86, 79, 75, 128,
+ 90, 69, 85, 83, 128, 90, 69, 84, 65, 128, 90, 69, 82, 79, 128, 90, 69,
+ 82, 207, 90, 69, 78, 128, 90, 69, 77, 76, 89, 65, 128, 90, 69, 77, 76,
+ 74, 65, 128, 90, 69, 76, 79, 128, 90, 69, 66, 82, 193, 90, 69, 50, 128,
+ 90, 197, 90, 65, 89, 78, 128, 90, 65, 89, 73, 78, 45, 89, 79, 68, 72,
+ 128, 90, 65, 89, 73, 78, 128, 90, 65, 89, 73, 206, 90, 65, 86, 73, 89,
+ 65, 78, 73, 128, 90, 65, 84, 65, 128, 90, 65, 82, 81, 65, 128, 90, 65,
+ 82, 76, 128, 90, 65, 81, 69, 198, 90, 65, 80, 89, 65, 84, 89, 77, 73,
+ 128, 90, 65, 80, 89, 65, 84, 79, 89, 128, 90, 65, 80, 89, 65, 84, 79,
+ 217, 90, 65, 80, 89, 65, 84, 65, 89, 65, 128, 90, 65, 78, 79, 90, 72, 69,
+ 75, 128, 90, 65, 78, 65, 66, 65, 90, 65, 210, 90, 65, 77, 88, 128, 90,
+ 65, 76, 128, 90, 65, 204, 90, 65, 75, 82, 89, 84, 79, 69, 128, 90, 65,
+ 75, 82, 89, 84, 65, 89, 65, 128, 90, 65, 75, 82, 89, 84, 65, 89, 193, 90,
+ 65, 73, 78, 128, 90, 65, 73, 206, 90, 65, 73, 128, 90, 65, 72, 128, 90,
+ 65, 200, 90, 65, 71, 128, 90, 65, 69, 70, 128, 90, 65, 68, 69, 82, 90,
+ 72, 75, 65, 128, 90, 65, 55, 128, 90, 193, 90, 48, 49, 54, 72, 128, 90,
+ 48, 49, 54, 71, 128, 90, 48, 49, 54, 70, 128, 90, 48, 49, 54, 69, 128,
+ 90, 48, 49, 54, 68, 128, 90, 48, 49, 54, 67, 128, 90, 48, 49, 54, 66,
+ 128, 90, 48, 49, 54, 65, 128, 90, 48, 49, 54, 128, 90, 48, 49, 53, 73,
+ 128, 90, 48, 49, 53, 72, 128, 90, 48, 49, 53, 71, 128, 90, 48, 49, 53,
+ 70, 128, 90, 48, 49, 53, 69, 128, 90, 48, 49, 53, 68, 128, 90, 48, 49,
+ 53, 67, 128, 90, 48, 49, 53, 66, 128, 90, 48, 49, 53, 65, 128, 90, 48,
+ 49, 53, 128, 90, 48, 49, 52, 128, 90, 48, 49, 51, 128, 90, 48, 49, 50,
+ 128, 90, 48, 49, 49, 128, 90, 48, 49, 48, 128, 90, 48, 48, 57, 128, 90,
+ 48, 48, 56, 128, 90, 48, 48, 55, 128, 90, 48, 48, 54, 128, 90, 48, 48,
+ 53, 65, 128, 90, 48, 48, 53, 128, 90, 48, 48, 52, 65, 128, 90, 48, 48,
+ 52, 128, 90, 48, 48, 51, 66, 128, 90, 48, 48, 51, 65, 128, 90, 48, 48,
+ 51, 128, 90, 48, 48, 50, 68, 128, 90, 48, 48, 50, 67, 128, 90, 48, 48,
+ 50, 66, 128, 90, 48, 48, 50, 65, 128, 90, 48, 48, 50, 128, 90, 48, 48,
+ 49, 128, 90, 128, 218, 89, 89, 88, 128, 89, 89, 84, 128, 89, 89, 82, 88,
+ 128, 89, 89, 82, 128, 89, 89, 80, 128, 89, 89, 69, 128, 89, 89, 65, 65,
+ 128, 89, 89, 65, 128, 89, 89, 128, 89, 87, 79, 79, 128, 89, 87, 79, 128,
+ 89, 87, 73, 73, 128, 89, 87, 73, 128, 89, 87, 69, 128, 89, 87, 65, 65,
+ 128, 89, 87, 65, 128, 89, 86, 128, 89, 85, 88, 128, 89, 85, 87, 79, 81,
+ 128, 89, 85, 85, 75, 65, 76, 69, 65, 80, 73, 78, 84, 85, 128, 89, 85, 85,
+ 128, 89, 85, 84, 128, 89, 85, 83, 128, 89, 85, 211, 89, 85, 82, 88, 128,
+ 89, 85, 82, 128, 89, 85, 81, 128, 89, 85, 209, 89, 85, 80, 128, 89, 85,
+ 79, 88, 128, 89, 85, 79, 84, 128, 89, 85, 79, 80, 128, 89, 85, 79, 77,
+ 128, 89, 85, 79, 128, 89, 85, 78, 128, 89, 85, 77, 128, 89, 85, 74, 128,
+ 89, 85, 73, 128, 89, 85, 69, 81, 128, 89, 85, 69, 128, 89, 85, 68, 72,
+ 128, 89, 85, 68, 200, 89, 85, 65, 78, 128, 89, 85, 65, 69, 78, 128, 89,
+ 85, 45, 89, 69, 79, 128, 89, 85, 45, 89, 69, 128, 89, 85, 45, 85, 128,
+ 89, 85, 45, 79, 128, 89, 85, 45, 73, 128, 89, 85, 45, 69, 79, 128, 89,
+ 85, 45, 69, 128, 89, 85, 45, 65, 69, 128, 89, 85, 45, 65, 128, 89, 85,
+ 45, 52, 128, 89, 85, 45, 51, 128, 89, 85, 45, 50, 128, 89, 85, 45, 49,
+ 128, 89, 85, 128, 89, 213, 89, 82, 89, 128, 89, 80, 83, 73, 76, 73, 128,
+ 89, 80, 79, 82, 82, 79, 73, 128, 89, 80, 79, 75, 82, 73, 83, 73, 83, 128,
+ 89, 80, 79, 75, 82, 73, 83, 73, 211, 89, 80, 79, 71, 69, 71, 82, 65, 77,
+ 77, 69, 78, 73, 128, 89, 79, 89, 128, 89, 79, 88, 128, 89, 79, 87, 68,
+ 128, 89, 79, 85, 84, 72, 70, 85, 76, 78, 69, 83, 83, 128, 89, 79, 85, 84,
+ 72, 70, 85, 204, 89, 79, 213, 89, 79, 84, 128, 89, 79, 212, 89, 79, 82,
+ 73, 128, 89, 79, 81, 128, 89, 79, 209, 89, 79, 80, 128, 89, 79, 79, 128,
+ 89, 79, 77, 79, 128, 89, 79, 71, 72, 128, 89, 79, 68, 128, 89, 79, 196,
+ 89, 79, 65, 128, 89, 79, 45, 89, 79, 128, 89, 79, 45, 89, 69, 79, 128,
+ 89, 79, 45, 89, 65, 69, 128, 89, 79, 45, 89, 65, 128, 89, 79, 45, 79,
+ 128, 89, 79, 45, 73, 128, 89, 79, 45, 69, 79, 128, 89, 79, 45, 65, 69,
+ 128, 89, 79, 45, 65, 128, 89, 79, 45, 54, 128, 89, 79, 45, 53, 128, 89,
+ 79, 45, 52, 128, 89, 79, 45, 51, 128, 89, 79, 45, 50, 128, 89, 79, 45,
+ 49, 128, 89, 207, 89, 73, 90, 69, 84, 128, 89, 73, 88, 128, 89, 73, 87,
+ 78, 128, 89, 73, 84, 128, 89, 73, 80, 128, 89, 73, 78, 71, 128, 89, 73,
+ 73, 128, 89, 73, 72, 128, 89, 73, 199, 89, 73, 69, 88, 128, 89, 73, 69,
+ 84, 128, 89, 73, 69, 80, 128, 89, 73, 69, 69, 128, 89, 73, 69, 128, 89,
+ 73, 68, 68, 73, 83, 200, 89, 73, 45, 85, 128, 89, 73, 128, 89, 72, 69,
+ 128, 89, 72, 65, 128, 89, 70, 69, 83, 73, 83, 128, 89, 70, 69, 83, 73,
+ 211, 89, 70, 69, 206, 89, 69, 90, 73, 68, 201, 89, 69, 89, 128, 89, 69,
+ 87, 128, 89, 69, 85, 88, 128, 89, 69, 85, 82, 65, 69, 128, 89, 69, 85,
+ 81, 128, 89, 69, 85, 77, 128, 89, 69, 85, 65, 69, 84, 128, 89, 69, 85,
+ 65, 69, 128, 89, 69, 84, 73, 86, 128, 89, 69, 83, 84, 85, 128, 89, 69,
+ 83, 73, 69, 85, 78, 71, 45, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79, 75,
+ 128, 89, 69, 83, 73, 69, 85, 78, 71, 45, 83, 73, 79, 83, 128, 89, 69, 83,
+ 73, 69, 85, 78, 71, 45, 80, 65, 78, 83, 73, 79, 83, 128, 89, 69, 83, 73,
+ 69, 85, 78, 71, 45, 77, 73, 69, 85, 77, 128, 89, 69, 83, 73, 69, 85, 78,
+ 71, 45, 75, 73, 89, 69, 79, 75, 128, 89, 69, 83, 73, 69, 85, 78, 71, 45,
+ 75, 72, 73, 69, 85, 75, 72, 128, 89, 69, 83, 73, 69, 85, 78, 71, 45, 72,
+ 73, 69, 85, 72, 128, 89, 69, 83, 73, 69, 85, 78, 71, 128, 89, 69, 82, 85,
+ 128, 89, 69, 82, 213, 89, 69, 82, 73, 128, 89, 69, 82, 65, 200, 89, 69,
+ 82, 128, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 89, 69, 79, 45,
+ 89, 65, 128, 89, 69, 79, 45, 85, 128, 89, 69, 79, 45, 79, 128, 89, 69,
+ 78, 73, 83, 69, 201, 89, 69, 78, 65, 80, 128, 89, 69, 78, 128, 89, 69,
+ 206, 89, 69, 76, 76, 79, 87, 128, 89, 69, 76, 76, 79, 215, 89, 69, 73,
+ 78, 128, 89, 69, 72, 128, 89, 69, 69, 71, 128, 89, 69, 69, 128, 89, 69,
+ 65, 210, 89, 69, 65, 128, 89, 65, 90, 90, 128, 89, 65, 90, 72, 128, 89,
+ 65, 90, 128, 89, 65, 89, 68, 128, 89, 65, 89, 65, 78, 78, 65, 128, 89,
+ 65, 89, 128, 89, 65, 87, 78, 73, 78, 199, 89, 65, 87, 78, 128, 89, 65,
+ 87, 128, 89, 65, 86, 128, 89, 65, 85, 128, 89, 65, 84, 84, 128, 89, 65,
+ 84, 73, 128, 89, 65, 84, 72, 128, 89, 65, 84, 128, 89, 65, 83, 83, 128,
+ 89, 65, 83, 72, 128, 89, 65, 83, 128, 89, 65, 82, 82, 128, 89, 65, 82,
+ 78, 128, 89, 65, 82, 128, 89, 65, 210, 89, 65, 81, 128, 89, 65, 80, 128,
+ 89, 65, 78, 83, 65, 89, 65, 128, 89, 65, 78, 71, 128, 89, 65, 78, 199,
+ 89, 65, 78, 128, 89, 65, 77, 79, 75, 128, 89, 65, 77, 65, 75, 75, 65, 78,
+ 128, 89, 65, 77, 128, 89, 65, 76, 128, 89, 65, 75, 72, 72, 128, 89, 65,
+ 75, 72, 128, 89, 65, 75, 65, 83, 72, 128, 89, 65, 75, 128, 89, 65, 74,
+ 85, 82, 86, 69, 68, 73, 195, 89, 65, 74, 128, 89, 65, 73, 128, 89, 65,
+ 72, 72, 128, 89, 65, 72, 128, 89, 65, 71, 78, 128, 89, 65, 71, 72, 72,
+ 128, 89, 65, 71, 72, 128, 89, 65, 71, 128, 89, 65, 70, 213, 89, 65, 70,
+ 128, 89, 65, 69, 77, 77, 65, 69, 128, 89, 65, 68, 72, 128, 89, 65, 68,
+ 68, 72, 128, 89, 65, 68, 68, 128, 89, 65, 68, 128, 89, 65, 67, 72, 128,
+ 89, 65, 66, 72, 128, 89, 65, 66, 128, 89, 65, 65, 82, 85, 128, 89, 65,
+ 65, 73, 128, 89, 65, 65, 68, 79, 128, 89, 65, 45, 89, 79, 128, 89, 65,
+ 45, 85, 128, 89, 65, 45, 79, 128, 89, 65, 45, 53, 128, 89, 65, 45, 52,
+ 128, 89, 65, 45, 51, 128, 89, 65, 45, 50, 128, 89, 65, 45, 49, 128, 89,
+ 48, 48, 56, 128, 89, 48, 48, 55, 128, 89, 48, 48, 54, 128, 89, 48, 48,
+ 53, 128, 89, 48, 48, 52, 128, 89, 48, 48, 51, 128, 89, 48, 48, 50, 128,
+ 89, 48, 48, 49, 65, 128, 89, 48, 48, 49, 128, 89, 45, 67, 82, 69, 197,
+ 88, 89, 88, 128, 88, 89, 85, 128, 88, 89, 84, 128, 88, 89, 82, 88, 128,
+ 88, 89, 82, 128, 88, 89, 80, 128, 88, 89, 79, 79, 74, 128, 88, 89, 79,
+ 79, 128, 88, 89, 79, 128, 88, 89, 73, 128, 88, 89, 69, 69, 205, 88, 89,
+ 69, 69, 128, 88, 89, 69, 128, 88, 89, 65, 65, 128, 88, 89, 65, 128, 88,
+ 89, 128, 88, 87, 73, 128, 88, 87, 69, 69, 128, 88, 87, 69, 128, 88, 87,
+ 65, 65, 128, 88, 87, 65, 128, 88, 87, 128, 88, 215, 88, 86, 69, 128, 88,
+ 86, 65, 128, 88, 85, 79, 88, 128, 88, 85, 79, 128, 88, 85, 128, 88, 83,
+ 72, 65, 65, 89, 65, 84, 72, 73, 89, 65, 128, 88, 79, 88, 128, 88, 79, 84,
+ 128, 88, 79, 82, 128, 88, 79, 80, 72, 128, 88, 79, 80, 128, 88, 79, 65,
+ 128, 88, 79, 128, 88, 73, 88, 128, 88, 73, 84, 128, 88, 73, 82, 79, 206,
+ 88, 73, 80, 128, 88, 73, 69, 88, 128, 88, 73, 69, 84, 128, 88, 73, 69,
+ 80, 128, 88, 73, 69, 128, 88, 73, 65, 78, 71, 81, 201, 88, 73, 65, 66,
+ 128, 88, 73, 128, 88, 72, 69, 89, 78, 128, 88, 71, 128, 88, 69, 89, 78,
+ 128, 88, 69, 83, 84, 69, 211, 88, 69, 72, 128, 88, 69, 69, 128, 88, 69,
+ 128, 88, 65, 85, 83, 128, 88, 65, 85, 128, 88, 65, 80, 72, 128, 88, 65,
+ 78, 128, 88, 65, 65, 128, 88, 65, 128, 88, 48, 48, 56, 65, 128, 88, 48,
+ 48, 56, 128, 88, 48, 48, 55, 128, 88, 48, 48, 54, 65, 128, 88, 48, 48,
+ 54, 128, 88, 48, 48, 53, 128, 88, 48, 48, 52, 66, 128, 88, 48, 48, 52,
+ 65, 128, 88, 48, 48, 52, 128, 88, 48, 48, 51, 128, 88, 48, 48, 50, 128,
+ 88, 48, 48, 49, 128, 88, 45, 216, 88, 45, 82, 65, 89, 128, 87, 90, 128,
+ 87, 89, 78, 78, 128, 87, 89, 78, 206, 87, 86, 73, 128, 87, 86, 69, 128,
+ 87, 86, 65, 128, 87, 86, 128, 87, 85, 80, 128, 87, 85, 79, 88, 128, 87,
+ 85, 79, 80, 128, 87, 85, 79, 128, 87, 85, 78, 74, 207, 87, 85, 78, 128,
+ 87, 85, 76, 85, 128, 87, 85, 76, 213, 87, 85, 73, 128, 87, 85, 69, 128,
+ 87, 85, 65, 69, 84, 128, 87, 85, 65, 69, 78, 128, 87, 85, 128, 87, 82,
+ 217, 87, 82, 79, 78, 71, 128, 87, 82, 73, 83, 212, 87, 82, 73, 78, 75,
+ 76, 69, 83, 128, 87, 82, 73, 78, 75, 76, 69, 211, 87, 82, 73, 78, 75, 76,
+ 69, 68, 128, 87, 82, 69, 83, 84, 76, 69, 82, 83, 128, 87, 82, 69, 78, 67,
+ 72, 128, 87, 82, 69, 65, 84, 200, 87, 82, 65, 80, 80, 69, 196, 87, 82,
+ 65, 80, 128, 87, 79, 88, 128, 87, 79, 87, 128, 87, 79, 82, 83, 72, 73,
+ 80, 128, 87, 79, 82, 82, 73, 69, 196, 87, 79, 82, 77, 128, 87, 79, 82,
+ 76, 196, 87, 79, 82, 75, 69, 82, 128, 87, 79, 82, 75, 128, 87, 79, 82,
+ 203, 87, 79, 82, 68, 83, 80, 65, 67, 69, 128, 87, 79, 82, 196, 87, 79,
+ 80, 128, 87, 79, 79, 78, 128, 87, 79, 79, 76, 128, 87, 79, 79, 68, 83,
+ 45, 67, 82, 69, 197, 87, 79, 79, 68, 128, 87, 79, 78, 128, 87, 79, 206,
+ 87, 79, 77, 69, 78, 211, 87, 79, 77, 69, 206, 87, 79, 77, 65, 78, 211,
+ 87, 79, 77, 65, 78, 128, 87, 79, 77, 65, 206, 87, 79, 76, 79, 83, 79,
+ 128, 87, 79, 76, 198, 87, 79, 69, 128, 87, 79, 65, 128, 87, 79, 45, 55,
+ 128, 87, 79, 45, 54, 128, 87, 79, 45, 53, 128, 87, 79, 45, 52, 128, 87,
+ 79, 45, 51, 128, 87, 79, 45, 50, 128, 87, 79, 45, 49, 128, 87, 73, 84,
+ 72, 79, 85, 212, 87, 73, 84, 72, 73, 78, 128, 87, 73, 84, 72, 73, 206,
+ 87, 73, 82, 69, 76, 69, 83, 83, 128, 87, 73, 82, 69, 196, 87, 73, 78, 84,
+ 69, 82, 128, 87, 73, 78, 75, 73, 78, 199, 87, 73, 78, 75, 128, 87, 73,
+ 78, 74, 65, 128, 87, 73, 78, 71, 83, 128, 87, 73, 78, 71, 128, 87, 73,
+ 78, 69, 128, 87, 73, 78, 197, 87, 73, 78, 68, 85, 128, 87, 73, 78, 68,
+ 79, 87, 128, 87, 73, 78, 68, 128, 87, 73, 78, 196, 87, 73, 78, 128, 87,
+ 73, 76, 84, 69, 196, 87, 73, 71, 78, 89, 65, 78, 128, 87, 73, 71, 71, 76,
+ 217, 87, 73, 71, 71, 76, 69, 83, 128, 87, 73, 68, 84, 72, 128, 87, 73,
+ 68, 69, 78, 73, 78, 199, 87, 73, 68, 69, 45, 72, 69, 65, 68, 69, 196, 87,
+ 73, 68, 197, 87, 73, 65, 78, 71, 87, 65, 65, 75, 128, 87, 73, 65, 78, 71,
+ 128, 87, 73, 45, 53, 128, 87, 73, 45, 52, 128, 87, 73, 45, 51, 128, 87,
+ 73, 45, 50, 128, 87, 73, 45, 49, 128, 87, 72, 79, 76, 197, 87, 72, 73,
+ 84, 69, 45, 70, 69, 65, 84, 72, 69, 82, 69, 196, 87, 72, 73, 84, 69, 128,
+ 87, 72, 69, 69, 76, 69, 196, 87, 72, 69, 69, 76, 67, 72, 65, 73, 82, 128,
+ 87, 72, 69, 69, 76, 67, 72, 65, 73, 210, 87, 72, 69, 69, 76, 128, 87, 72,
+ 69, 69, 204, 87, 72, 69, 65, 84, 128, 87, 72, 65, 76, 69, 128, 87, 72,
+ 128, 87, 71, 128, 87, 69, 88, 128, 87, 69, 85, 88, 128, 87, 69, 212, 87,
+ 69, 83, 84, 69, 82, 206, 87, 69, 83, 84, 45, 67, 82, 69, 197, 87, 69, 83,
+ 84, 128, 87, 69, 83, 212, 87, 69, 80, 128, 87, 69, 79, 128, 87, 69, 78,
+ 128, 87, 69, 76, 76, 128, 87, 69, 73, 71, 72, 212, 87, 69, 73, 69, 82,
+ 83, 84, 82, 65, 83, 211, 87, 69, 73, 128, 87, 69, 69, 78, 128, 87, 69,
+ 68, 71, 69, 45, 84, 65, 73, 76, 69, 196, 87, 69, 68, 71, 69, 128, 87, 69,
+ 68, 68, 73, 78, 71, 128, 87, 69, 66, 128, 87, 69, 65, 82, 217, 87, 69,
+ 65, 80, 79, 78, 128, 87, 69, 45, 52, 128, 87, 69, 45, 51, 128, 87, 69,
+ 45, 50, 128, 87, 69, 45, 49, 128, 87, 67, 128, 87, 66, 128, 87, 65, 89,
+ 128, 87, 65, 217, 87, 65, 88, 73, 78, 199, 87, 65, 88, 128, 87, 65, 87,
+ 45, 65, 89, 73, 78, 45, 82, 69, 83, 72, 128, 87, 65, 87, 128, 87, 65,
+ 215, 87, 65, 86, 217, 87, 65, 86, 73, 78, 199, 87, 65, 86, 69, 83, 128,
+ 87, 65, 86, 69, 128, 87, 65, 86, 197, 87, 65, 85, 128, 87, 65, 84, 84,
+ 79, 128, 87, 65, 84, 69, 82, 77, 69, 76, 79, 78, 128, 87, 65, 84, 69, 82,
+ 128, 87, 65, 84, 69, 210, 87, 65, 84, 67, 72, 128, 87, 65, 84, 128, 87,
+ 65, 83, 84, 73, 78, 71, 128, 87, 65, 83, 84, 69, 66, 65, 83, 75, 69, 84,
+ 128, 87, 65, 83, 83, 65, 76, 76, 65, 77, 128, 87, 65, 83, 76, 65, 128,
+ 87, 65, 83, 76, 193, 87, 65, 83, 65, 76, 76, 65, 77, 128, 87, 65, 83, 65,
+ 76, 76, 65, 205, 87, 65, 83, 45, 83, 65, 76, 65, 65, 77, 128, 87, 65, 82,
+ 78, 73, 78, 199, 87, 65, 82, 65, 78, 199, 87, 65, 81, 70, 65, 128, 87,
+ 65, 80, 128, 87, 65, 78, 73, 78, 199, 87, 65, 78, 71, 75, 85, 79, 81,
+ 128, 87, 65, 78, 68, 69, 82, 69, 82, 128, 87, 65, 78, 68, 128, 87, 65,
+ 78, 67, 72, 207, 87, 65, 78, 128, 87, 65, 76, 76, 80, 76, 65, 78, 197,
+ 87, 65, 76, 76, 69, 196, 87, 65, 76, 76, 128, 87, 65, 76, 204, 87, 65,
+ 76, 75, 128, 87, 65, 76, 203, 87, 65, 73, 84, 73, 78, 71, 128, 87, 65,
+ 73, 83, 84, 128, 87, 65, 73, 128, 87, 65, 70, 70, 76, 69, 128, 87, 65,
+ 69, 78, 128, 87, 65, 69, 128, 87, 65, 68, 68, 65, 128, 87, 65, 65, 86,
+ 85, 128, 87, 65, 65, 74, 73, 66, 128, 87, 65, 65, 65, 76, 73, 72, 69,
+ 197, 87, 65, 45, 84, 65, 65, 65, 76, 65, 65, 128, 87, 65, 45, 83, 65, 76,
+ 76, 65, 77, 128, 87, 65, 45, 65, 65, 76, 73, 72, 128, 87, 65, 45, 53,
+ 128, 87, 65, 45, 52, 128, 87, 65, 45, 51, 128, 87, 65, 45, 50, 128, 87,
+ 65, 45, 49, 128, 87, 193, 87, 48, 50, 53, 128, 87, 48, 50, 52, 65, 128,
+ 87, 48, 50, 52, 128, 87, 48, 50, 51, 128, 87, 48, 50, 50, 128, 87, 48,
+ 50, 49, 128, 87, 48, 50, 48, 128, 87, 48, 49, 57, 128, 87, 48, 49, 56,
+ 65, 128, 87, 48, 49, 56, 128, 87, 48, 49, 55, 65, 128, 87, 48, 49, 55,
+ 128, 87, 48, 49, 54, 128, 87, 48, 49, 53, 128, 87, 48, 49, 52, 65, 128,
+ 87, 48, 49, 52, 128, 87, 48, 49, 51, 128, 87, 48, 49, 50, 128, 87, 48,
+ 49, 49, 128, 87, 48, 49, 48, 65, 128, 87, 48, 49, 48, 128, 87, 48, 48,
+ 57, 65, 128, 87, 48, 48, 57, 128, 87, 48, 48, 56, 128, 87, 48, 48, 55,
+ 128, 87, 48, 48, 54, 128, 87, 48, 48, 53, 128, 87, 48, 48, 52, 128, 87,
+ 48, 48, 51, 65, 128, 87, 48, 48, 51, 128, 87, 48, 48, 50, 128, 87, 48,
+ 48, 49, 128, 86, 90, 77, 69, 84, 128, 86, 90, 128, 86, 89, 88, 128, 86,
+ 89, 84, 128, 86, 89, 83, 79, 75, 79, 128, 86, 89, 83, 79, 75, 207, 86,
+ 89, 82, 88, 128, 86, 89, 82, 128, 86, 89, 80, 128, 86, 89, 128, 86, 88,
+ 128, 86, 87, 74, 128, 86, 87, 65, 128, 86, 87, 128, 86, 85, 88, 128, 86,
+ 85, 85, 128, 86, 85, 84, 128, 86, 85, 82, 88, 128, 86, 85, 82, 128, 86,
+ 85, 80, 128, 86, 85, 76, 71, 65, 210, 86, 85, 76, 67, 65, 78, 85, 83,
+ 128, 86, 85, 69, 81, 128, 86, 84, 83, 128, 86, 84, 128, 86, 83, 57, 57,
+ 128, 86, 83, 57, 56, 128, 86, 83, 57, 55, 128, 86, 83, 57, 54, 128, 86,
+ 83, 57, 53, 128, 86, 83, 57, 52, 128, 86, 83, 57, 51, 128, 86, 83, 57,
+ 50, 128, 86, 83, 57, 49, 128, 86, 83, 57, 48, 128, 86, 83, 57, 128, 86,
+ 83, 56, 57, 128, 86, 83, 56, 56, 128, 86, 83, 56, 55, 128, 86, 83, 56,
+ 54, 128, 86, 83, 56, 53, 128, 86, 83, 56, 52, 128, 86, 83, 56, 51, 128,
+ 86, 83, 56, 50, 128, 86, 83, 56, 49, 128, 86, 83, 56, 48, 128, 86, 83,
+ 56, 128, 86, 83, 55, 57, 128, 86, 83, 55, 56, 128, 86, 83, 55, 55, 128,
+ 86, 83, 55, 54, 128, 86, 83, 55, 53, 128, 86, 83, 55, 52, 128, 86, 83,
+ 55, 51, 128, 86, 83, 55, 50, 128, 86, 83, 55, 49, 128, 86, 83, 55, 48,
+ 128, 86, 83, 55, 128, 86, 83, 54, 57, 128, 86, 83, 54, 56, 128, 86, 83,
+ 54, 55, 128, 86, 83, 54, 54, 128, 86, 83, 54, 53, 128, 86, 83, 54, 52,
+ 128, 86, 83, 54, 51, 128, 86, 83, 54, 50, 128, 86, 83, 54, 49, 128, 86,
+ 83, 54, 48, 128, 86, 83, 54, 128, 86, 83, 53, 57, 128, 86, 83, 53, 56,
+ 128, 86, 83, 53, 55, 128, 86, 83, 53, 54, 128, 86, 83, 53, 53, 128, 86,
+ 83, 53, 52, 128, 86, 83, 53, 51, 128, 86, 83, 53, 50, 128, 86, 83, 53,
+ 49, 128, 86, 83, 53, 48, 128, 86, 83, 53, 128, 86, 83, 52, 57, 128, 86,
+ 83, 52, 56, 128, 86, 83, 52, 55, 128, 86, 83, 52, 54, 128, 86, 83, 52,
+ 53, 128, 86, 83, 52, 52, 128, 86, 83, 52, 51, 128, 86, 83, 52, 50, 128,
+ 86, 83, 52, 49, 128, 86, 83, 52, 48, 128, 86, 83, 52, 128, 86, 83, 51,
+ 57, 128, 86, 83, 51, 56, 128, 86, 83, 51, 55, 128, 86, 83, 51, 54, 128,
+ 86, 83, 51, 53, 128, 86, 83, 51, 52, 128, 86, 83, 51, 51, 128, 86, 83,
+ 51, 50, 128, 86, 83, 51, 49, 128, 86, 83, 51, 48, 128, 86, 83, 51, 128,
+ 86, 83, 50, 57, 128, 86, 83, 50, 56, 128, 86, 83, 50, 55, 128, 86, 83,
+ 50, 54, 128, 86, 83, 50, 53, 54, 128, 86, 83, 50, 53, 53, 128, 86, 83,
+ 50, 53, 52, 128, 86, 83, 50, 53, 51, 128, 86, 83, 50, 53, 50, 128, 86,
+ 83, 50, 53, 49, 128, 86, 83, 50, 53, 48, 128, 86, 83, 50, 53, 128, 86,
+ 83, 50, 52, 57, 128, 86, 83, 50, 52, 56, 128, 86, 83, 50, 52, 55, 128,
+ 86, 83, 50, 52, 54, 128, 86, 83, 50, 52, 53, 128, 86, 83, 50, 52, 52,
+ 128, 86, 83, 50, 52, 51, 128, 86, 83, 50, 52, 50, 128, 86, 83, 50, 52,
+ 49, 128, 86, 83, 50, 52, 48, 128, 86, 83, 50, 52, 128, 86, 83, 50, 51,
+ 57, 128, 86, 83, 50, 51, 56, 128, 86, 83, 50, 51, 55, 128, 86, 83, 50,
+ 51, 54, 128, 86, 83, 50, 51, 53, 128, 86, 83, 50, 51, 52, 128, 86, 83,
+ 50, 51, 51, 128, 86, 83, 50, 51, 50, 128, 86, 83, 50, 51, 49, 128, 86,
+ 83, 50, 51, 48, 128, 86, 83, 50, 51, 128, 86, 83, 50, 50, 57, 128, 86,
+ 83, 50, 50, 56, 128, 86, 83, 50, 50, 55, 128, 86, 83, 50, 50, 54, 128,
+ 86, 83, 50, 50, 53, 128, 86, 83, 50, 50, 52, 128, 86, 83, 50, 50, 51,
+ 128, 86, 83, 50, 50, 50, 128, 86, 83, 50, 50, 49, 128, 86, 83, 50, 50,
+ 48, 128, 86, 83, 50, 50, 128, 86, 83, 50, 49, 57, 128, 86, 83, 50, 49,
+ 56, 128, 86, 83, 50, 49, 55, 128, 86, 83, 50, 49, 54, 128, 86, 83, 50,
+ 49, 53, 128, 86, 83, 50, 49, 52, 128, 86, 83, 50, 49, 51, 128, 86, 83,
+ 50, 49, 50, 128, 86, 83, 50, 49, 49, 128, 86, 83, 50, 49, 48, 128, 86,
+ 83, 50, 49, 128, 86, 83, 50, 48, 57, 128, 86, 83, 50, 48, 56, 128, 86,
+ 83, 50, 48, 55, 128, 86, 83, 50, 48, 54, 128, 86, 83, 50, 48, 53, 128,
+ 86, 83, 50, 48, 52, 128, 86, 83, 50, 48, 51, 128, 86, 83, 50, 48, 50,
+ 128, 86, 83, 50, 48, 49, 128, 86, 83, 50, 48, 48, 128, 86, 83, 50, 48,
+ 128, 86, 83, 50, 128, 86, 83, 49, 57, 57, 128, 86, 83, 49, 57, 56, 128,
+ 86, 83, 49, 57, 55, 128, 86, 83, 49, 57, 54, 128, 86, 83, 49, 57, 53,
+ 128, 86, 83, 49, 57, 52, 128, 86, 83, 49, 57, 51, 128, 86, 83, 49, 57,
+ 50, 128, 86, 83, 49, 57, 49, 128, 86, 83, 49, 57, 48, 128, 86, 83, 49,
+ 57, 128, 86, 83, 49, 56, 57, 128, 86, 83, 49, 56, 56, 128, 86, 83, 49,
+ 56, 55, 128, 86, 83, 49, 56, 54, 128, 86, 83, 49, 56, 53, 128, 86, 83,
+ 49, 56, 52, 128, 86, 83, 49, 56, 51, 128, 86, 83, 49, 56, 50, 128, 86,
+ 83, 49, 56, 49, 128, 86, 83, 49, 56, 48, 128, 86, 83, 49, 56, 128, 86,
+ 83, 49, 55, 57, 128, 86, 83, 49, 55, 56, 128, 86, 83, 49, 55, 55, 128,
+ 86, 83, 49, 55, 54, 128, 86, 83, 49, 55, 53, 128, 86, 83, 49, 55, 52,
+ 128, 86, 83, 49, 55, 51, 128, 86, 83, 49, 55, 50, 128, 86, 83, 49, 55,
+ 49, 128, 86, 83, 49, 55, 48, 128, 86, 83, 49, 55, 128, 86, 83, 49, 54,
+ 57, 128, 86, 83, 49, 54, 56, 128, 86, 83, 49, 54, 55, 128, 86, 83, 49,
+ 54, 54, 128, 86, 83, 49, 54, 53, 128, 86, 83, 49, 54, 52, 128, 86, 83,
+ 49, 54, 51, 128, 86, 83, 49, 54, 50, 128, 86, 83, 49, 54, 49, 128, 86,
+ 83, 49, 54, 48, 128, 86, 83, 49, 54, 128, 86, 83, 49, 53, 57, 128, 86,
+ 83, 49, 53, 56, 128, 86, 83, 49, 53, 55, 128, 86, 83, 49, 53, 54, 128,
+ 86, 83, 49, 53, 53, 128, 86, 83, 49, 53, 52, 128, 86, 83, 49, 53, 51,
+ 128, 86, 83, 49, 53, 50, 128, 86, 83, 49, 53, 49, 128, 86, 83, 49, 53,
+ 48, 128, 86, 83, 49, 53, 128, 86, 83, 49, 52, 57, 128, 86, 83, 49, 52,
+ 56, 128, 86, 83, 49, 52, 55, 128, 86, 83, 49, 52, 54, 128, 86, 83, 49,
+ 52, 53, 128, 86, 83, 49, 52, 52, 128, 86, 83, 49, 52, 51, 128, 86, 83,
+ 49, 52, 50, 128, 86, 83, 49, 52, 49, 128, 86, 83, 49, 52, 48, 128, 86,
+ 83, 49, 52, 128, 86, 83, 49, 51, 57, 128, 86, 83, 49, 51, 56, 128, 86,
+ 83, 49, 51, 55, 128, 86, 83, 49, 51, 54, 128, 86, 83, 49, 51, 53, 128,
+ 86, 83, 49, 51, 52, 128, 86, 83, 49, 51, 51, 128, 86, 83, 49, 51, 50,
+ 128, 86, 83, 49, 51, 49, 128, 86, 83, 49, 51, 48, 128, 86, 83, 49, 51,
+ 128, 86, 83, 49, 50, 57, 128, 86, 83, 49, 50, 56, 128, 86, 83, 49, 50,
+ 55, 128, 86, 83, 49, 50, 54, 128, 86, 83, 49, 50, 53, 128, 86, 83, 49,
+ 50, 52, 128, 86, 83, 49, 50, 51, 128, 86, 83, 49, 50, 50, 128, 86, 83,
+ 49, 50, 49, 128, 86, 83, 49, 50, 48, 128, 86, 83, 49, 50, 128, 86, 83,
+ 49, 49, 57, 128, 86, 83, 49, 49, 56, 128, 86, 83, 49, 49, 55, 128, 86,
+ 83, 49, 49, 54, 128, 86, 83, 49, 49, 53, 128, 86, 83, 49, 49, 52, 128,
+ 86, 83, 49, 49, 51, 128, 86, 83, 49, 49, 50, 128, 86, 83, 49, 49, 49,
+ 128, 86, 83, 49, 49, 48, 128, 86, 83, 49, 49, 128, 86, 83, 49, 48, 57,
+ 128, 86, 83, 49, 48, 56, 128, 86, 83, 49, 48, 55, 128, 86, 83, 49, 48,
+ 54, 128, 86, 83, 49, 48, 53, 128, 86, 83, 49, 48, 52, 128, 86, 83, 49,
+ 48, 51, 128, 86, 83, 49, 48, 50, 128, 86, 83, 49, 48, 49, 128, 86, 83,
+ 49, 48, 48, 128, 86, 83, 49, 48, 128, 86, 83, 49, 128, 86, 83, 128, 86,
+ 82, 65, 75, 72, 73, 89, 193, 86, 82, 65, 67, 72, 89, 128, 86, 81, 128,
+ 86, 79, 88, 128, 86, 79, 87, 69, 76, 45, 67, 65, 82, 82, 73, 69, 210, 86,
+ 79, 87, 128, 86, 79, 85, 128, 86, 79, 84, 128, 86, 79, 211, 86, 79, 80,
+ 128, 86, 79, 79, 73, 128, 86, 79, 79, 128, 86, 79, 77, 73, 84, 73, 78,
+ 71, 128, 86, 79, 77, 128, 86, 79, 76, 85, 77, 197, 86, 79, 76, 84, 65,
+ 71, 197, 86, 79, 76, 76, 69, 89, 66, 65, 76, 76, 128, 86, 79, 76, 67, 65,
+ 78, 79, 128, 86, 79, 76, 65, 80, 85, 203, 86, 79, 73, 68, 69, 196, 86,
+ 79, 73, 196, 86, 79, 73, 67, 73, 78, 71, 128, 86, 79, 73, 67, 69, 76, 69,
+ 83, 211, 86, 79, 73, 67, 69, 196, 86, 79, 68, 128, 86, 79, 67, 65, 76,
+ 73, 90, 65, 84, 73, 79, 206, 86, 79, 67, 65, 204, 86, 79, 128, 86, 73,
+ 89, 79, 128, 86, 73, 88, 128, 86, 73, 84, 82, 73, 79, 76, 45, 50, 128,
+ 86, 73, 84, 82, 73, 79, 76, 128, 86, 73, 84, 72, 75, 85, 81, 201, 86, 73,
+ 84, 65, 69, 45, 50, 128, 86, 73, 84, 65, 69, 128, 86, 73, 84, 128, 86,
+ 73, 83, 73, 71, 79, 84, 72, 73, 195, 86, 73, 83, 65, 82, 71, 65, 89, 65,
+ 128, 86, 73, 83, 65, 82, 71, 65, 128, 86, 73, 83, 65, 82, 71, 193, 86,
+ 73, 82, 73, 65, 77, 128, 86, 73, 82, 71, 79, 128, 86, 73, 82, 71, 65,
+ 128, 86, 73, 82, 65, 77, 65, 128, 86, 73, 80, 128, 86, 73, 79, 76, 73,
+ 78, 128, 86, 73, 78, 69, 71, 65, 82, 45, 51, 128, 86, 73, 78, 69, 71, 65,
+ 82, 45, 50, 128, 86, 73, 78, 69, 71, 65, 82, 128, 86, 73, 78, 69, 71, 65,
+ 210, 86, 73, 78, 69, 128, 86, 73, 78, 197, 86, 73, 78, 128, 86, 73, 76,
+ 76, 65, 71, 69, 128, 86, 73, 73, 128, 86, 73, 71, 73, 78, 84, 73, 76, 69,
+ 128, 86, 73, 69, 88, 128, 86, 73, 69, 87, 73, 78, 199, 86, 73, 69, 87,
+ 69, 82, 128, 86, 73, 69, 87, 68, 65, 84, 193, 86, 73, 69, 84, 78, 65, 77,
+ 69, 83, 197, 86, 73, 69, 84, 128, 86, 73, 69, 212, 86, 73, 69, 80, 128,
+ 86, 73, 69, 128, 86, 73, 68, 74, 45, 50, 128, 86, 73, 68, 74, 128, 86,
+ 73, 68, 69, 79, 67, 65, 83, 83, 69, 84, 84, 69, 128, 86, 73, 68, 69, 207,
+ 86, 73, 68, 65, 128, 86, 73, 67, 84, 79, 82, 217, 86, 73, 66, 82, 65, 84,
+ 73, 79, 206, 86, 72, 65, 128, 86, 70, 65, 128, 86, 69, 89, 90, 128, 86,
+ 69, 88, 128, 86, 69, 87, 128, 86, 69, 215, 86, 69, 85, 88, 128, 86, 69,
+ 85, 77, 128, 86, 69, 85, 65, 69, 80, 69, 78, 128, 86, 69, 85, 65, 69,
+ 128, 86, 69, 83, 84, 65, 128, 86, 69, 83, 84, 128, 86, 69, 83, 83, 69,
+ 204, 86, 69, 82, 217, 86, 69, 82, 84, 73, 67, 65, 76, 76, 89, 128, 86,
+ 69, 82, 84, 73, 67, 65, 76, 76, 217, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 54, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45,
+ 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 52, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 51, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 54, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 54, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 54, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45,
+ 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 53, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 52, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 53, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 53, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 53, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 53, 45,
+ 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 54, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 53, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 52, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 52, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45,
+ 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 52, 45, 48, 48, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 54, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 51, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 51, 45, 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45,
+ 48, 50, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 49, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 51, 45, 48, 48, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 50, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 50, 45, 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45,
+ 48, 51, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 50, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 49, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 50, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 49, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 49, 45, 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45,
+ 48, 52, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 51, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 50, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 49, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 49, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 48, 45, 48, 54, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45,
+ 48, 53, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 52, 128,
+ 86, 69, 82, 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 51, 128, 86, 69, 82,
+ 84, 73, 67, 65, 76, 45, 48, 48, 45, 48, 50, 128, 86, 69, 82, 84, 73, 67,
+ 65, 76, 45, 48, 48, 45, 48, 49, 128, 86, 69, 82, 84, 73, 67, 65, 76, 45,
+ 48, 48, 45, 48, 48, 128, 86, 69, 82, 84, 73, 67, 65, 76, 128, 86, 69, 82,
+ 83, 73, 67, 76, 69, 128, 86, 69, 82, 83, 197, 86, 69, 82, 71, 69, 128,
+ 86, 69, 82, 68, 73, 71, 82, 73, 83, 128, 86, 69, 82, 128, 86, 69, 80,
+ 128, 86, 69, 78, 68, 128, 86, 69, 76, 73, 128, 86, 69, 73, 76, 128, 86,
+ 69, 72, 73, 67, 76, 69, 128, 86, 69, 72, 128, 86, 69, 200, 86, 69, 69,
+ 128, 86, 69, 197, 86, 69, 68, 69, 128, 86, 69, 67, 84, 79, 210, 86, 67,
+ 128, 86, 65, 89, 65, 78, 78, 65, 128, 86, 65, 88, 128, 86, 65, 86, 128,
+ 86, 65, 214, 86, 65, 85, 128, 86, 65, 84, 72, 89, 128, 86, 65, 84, 128,
+ 86, 65, 83, 84, 78, 69, 83, 211, 86, 65, 83, 73, 83, 128, 86, 65, 82, 89,
+ 211, 86, 65, 82, 73, 75, 65, 128, 86, 65, 82, 73, 65, 78, 84, 128, 86,
+ 65, 82, 73, 65, 78, 212, 86, 65, 82, 73, 65, 128, 86, 65, 82, 73, 193,
+ 86, 65, 82, 69, 73, 65, 201, 86, 65, 82, 69, 73, 193, 86, 65, 82, 65, 65,
+ 75, 65, 78, 128, 86, 65, 80, 79, 85, 82, 83, 128, 86, 65, 80, 128, 86,
+ 65, 78, 69, 128, 86, 65, 77, 80, 73, 82, 69, 128, 86, 65, 77, 65, 71, 79,
+ 77, 85, 75, 72, 65, 128, 86, 65, 77, 65, 71, 79, 77, 85, 75, 72, 193, 86,
+ 65, 76, 76, 69, 89, 128, 86, 65, 75, 65, 73, 89, 65, 82, 65, 65, 128, 86,
+ 65, 74, 128, 86, 65, 73, 128, 86, 65, 72, 128, 86, 65, 200, 86, 65, 65,
+ 86, 85, 128, 86, 65, 65, 128, 86, 193, 86, 48, 52, 48, 65, 128, 86, 48,
+ 52, 48, 128, 86, 48, 51, 57, 128, 86, 48, 51, 56, 128, 86, 48, 51, 55,
+ 65, 128, 86, 48, 51, 55, 128, 86, 48, 51, 54, 128, 86, 48, 51, 53, 128,
+ 86, 48, 51, 52, 128, 86, 48, 51, 51, 65, 128, 86, 48, 51, 51, 128, 86,
+ 48, 51, 50, 128, 86, 48, 51, 49, 65, 128, 86, 48, 51, 49, 128, 86, 48,
+ 51, 48, 65, 128, 86, 48, 51, 48, 128, 86, 48, 50, 57, 65, 128, 86, 48,
+ 50, 57, 128, 86, 48, 50, 56, 65, 128, 86, 48, 50, 56, 128, 86, 48, 50,
+ 55, 128, 86, 48, 50, 54, 128, 86, 48, 50, 53, 128, 86, 48, 50, 52, 128,
+ 86, 48, 50, 51, 65, 128, 86, 48, 50, 51, 128, 86, 48, 50, 50, 128, 86,
+ 48, 50, 49, 128, 86, 48, 50, 48, 76, 128, 86, 48, 50, 48, 75, 128, 86,
+ 48, 50, 48, 74, 128, 86, 48, 50, 48, 73, 128, 86, 48, 50, 48, 72, 128,
+ 86, 48, 50, 48, 71, 128, 86, 48, 50, 48, 70, 128, 86, 48, 50, 48, 69,
+ 128, 86, 48, 50, 48, 68, 128, 86, 48, 50, 48, 67, 128, 86, 48, 50, 48,
+ 66, 128, 86, 48, 50, 48, 65, 128, 86, 48, 50, 48, 128, 86, 48, 49, 57,
+ 128, 86, 48, 49, 56, 128, 86, 48, 49, 55, 128, 86, 48, 49, 54, 128, 86,
+ 48, 49, 53, 128, 86, 48, 49, 52, 128, 86, 48, 49, 51, 128, 86, 48, 49,
+ 50, 66, 128, 86, 48, 49, 50, 65, 128, 86, 48, 49, 50, 128, 86, 48, 49,
+ 49, 68, 128, 86, 48, 49, 49, 67, 128, 86, 48, 49, 49, 66, 128, 86, 48,
+ 49, 49, 65, 128, 86, 48, 49, 49, 128, 86, 48, 49, 48, 128, 86, 48, 48,
+ 57, 128, 86, 48, 48, 56, 128, 86, 48, 48, 55, 66, 128, 86, 48, 48, 55,
+ 65, 128, 86, 48, 48, 55, 128, 86, 48, 48, 54, 128, 86, 48, 48, 53, 128,
+ 86, 48, 48, 52, 128, 86, 48, 48, 51, 128, 86, 48, 48, 50, 65, 128, 86,
+ 48, 48, 50, 128, 86, 48, 48, 49, 73, 128, 86, 48, 48, 49, 72, 128, 86,
+ 48, 48, 49, 71, 128, 86, 48, 48, 49, 70, 128, 86, 48, 48, 49, 69, 128,
+ 86, 48, 48, 49, 68, 128, 86, 48, 48, 49, 67, 128, 86, 48, 48, 49, 66,
+ 128, 86, 48, 48, 49, 65, 128, 86, 48, 48, 49, 128, 85, 90, 85, 128, 85,
+ 90, 72, 65, 75, 75, 85, 128, 85, 90, 51, 128, 85, 90, 179, 85, 90, 128,
+ 85, 89, 71, 72, 85, 210, 85, 89, 65, 78, 78, 65, 128, 85, 89, 128, 85,
+ 87, 85, 128, 85, 85, 89, 65, 78, 78, 65, 128, 85, 85, 85, 85, 128, 85,
+ 85, 85, 51, 128, 85, 85, 85, 50, 128, 85, 85, 69, 128, 85, 84, 85, 75,
+ 73, 128, 85, 83, 83, 85, 51, 128, 85, 83, 83, 85, 128, 85, 83, 72, 88,
+ 128, 85, 83, 72, 85, 77, 88, 128, 85, 83, 72, 69, 78, 78, 65, 128, 85,
+ 83, 72, 50, 128, 85, 83, 72, 128, 85, 83, 200, 85, 83, 69, 196, 85, 83,
+ 69, 45, 50, 128, 85, 83, 69, 45, 49, 128, 85, 83, 69, 128, 85, 83, 197,
+ 85, 82, 85, 218, 85, 82, 85, 83, 128, 85, 82, 85, 68, 65, 128, 85, 82,
+ 85, 68, 193, 85, 82, 85, 128, 85, 82, 213, 85, 82, 78, 128, 85, 82, 73,
+ 78, 69, 128, 85, 82, 73, 51, 128, 85, 82, 73, 128, 85, 82, 65, 78, 85,
+ 83, 128, 85, 82, 65, 128, 85, 82, 52, 128, 85, 82, 50, 128, 85, 82, 178,
+ 85, 80, 87, 65, 82, 68, 83, 128, 85, 80, 87, 65, 82, 68, 211, 85, 80, 87,
+ 65, 82, 68, 128, 85, 80, 87, 65, 82, 196, 85, 80, 84, 85, 82, 78, 128,
+ 85, 80, 83, 73, 76, 79, 78, 128, 85, 80, 83, 73, 76, 79, 206, 85, 80, 83,
+ 73, 68, 69, 45, 68, 79, 87, 206, 85, 80, 82, 73, 71, 72, 212, 85, 80, 80,
+ 69, 82, 128, 85, 80, 65, 68, 72, 77, 65, 78, 73, 89, 65, 128, 85, 80, 45,
+ 80, 79, 73, 78, 84, 73, 78, 199, 85, 79, 78, 128, 85, 79, 71, 128, 85,
+ 78, 78, 128, 85, 78, 77, 65, 82, 82, 73, 69, 196, 85, 78, 75, 78, 79, 87,
+ 78, 128, 85, 78, 75, 128, 85, 78, 73, 86, 69, 82, 83, 65, 204, 85, 78,
+ 73, 84, 89, 128, 85, 78, 73, 84, 69, 196, 85, 78, 73, 84, 128, 85, 78,
+ 73, 212, 85, 78, 73, 79, 78, 128, 85, 78, 73, 79, 206, 85, 78, 73, 70,
+ 79, 82, 77, 128, 85, 78, 73, 70, 73, 69, 196, 85, 78, 73, 67, 79, 82,
+ 206, 85, 78, 69, 86, 69, 206, 85, 78, 68, 207, 85, 78, 68, 69, 82, 84,
+ 73, 69, 128, 85, 78, 68, 69, 82, 76, 73, 78, 197, 85, 78, 68, 69, 82, 68,
+ 79, 84, 128, 85, 78, 68, 69, 82, 66, 65, 82, 128, 85, 78, 68, 69, 82,
+ 128, 85, 78, 68, 69, 210, 85, 78, 67, 73, 193, 85, 78, 67, 69, 82, 84,
+ 65, 73, 78, 84, 217, 85, 78, 66, 76, 69, 78, 68, 69, 196, 85, 78, 65, 83,
+ 80, 73, 82, 65, 84, 69, 68, 128, 85, 78, 65, 80, 128, 85, 78, 65, 77, 85,
+ 83, 69, 196, 85, 78, 65, 128, 85, 206, 85, 77, 85, 77, 128, 85, 77, 85,
+ 205, 85, 77, 66, 82, 69, 76, 76, 65, 128, 85, 77, 66, 82, 69, 76, 76,
+ 193, 85, 77, 66, 73, 78, 128, 85, 75, 85, 128, 85, 75, 82, 65, 73, 78,
+ 73, 65, 206, 85, 75, 65, 82, 65, 128, 85, 75, 65, 82, 193, 85, 75, 128,
+ 85, 73, 90, 128, 85, 73, 88, 128, 85, 73, 85, 90, 128, 85, 73, 85, 88,
+ 128, 85, 73, 85, 81, 128, 85, 73, 85, 67, 128, 85, 73, 81, 128, 85, 73,
+ 76, 76, 69, 65, 78, 78, 128, 85, 73, 71, 72, 85, 210, 85, 73, 67, 128,
+ 85, 72, 68, 128, 85, 71, 65, 82, 73, 84, 73, 195, 85, 69, 90, 128, 85,
+ 69, 89, 128, 85, 69, 88, 128, 85, 69, 78, 128, 85, 69, 73, 128, 85, 69,
+ 69, 128, 85, 69, 67, 128, 85, 69, 65, 128, 85, 68, 85, 71, 128, 85, 68,
+ 65, 84, 84, 65, 128, 85, 68, 65, 84, 84, 193, 85, 68, 65, 82, 75, 65,
+ 128, 85, 68, 65, 65, 84, 128, 85, 68, 128, 85, 196, 85, 66, 85, 70, 73,
+ 76, 73, 128, 85, 66, 72, 65, 89, 65, 84, 207, 85, 66, 65, 68, 65, 77, 65,
+ 128, 85, 66, 128, 85, 65, 84, 72, 128, 85, 65, 78, 71, 128, 85, 65, 128,
+ 85, 178, 85, 48, 52, 50, 128, 85, 48, 52, 49, 128, 85, 48, 52, 48, 128,
+ 85, 48, 51, 57, 128, 85, 48, 51, 56, 128, 85, 48, 51, 55, 128, 85, 48,
+ 51, 54, 128, 85, 48, 51, 53, 128, 85, 48, 51, 52, 128, 85, 48, 51, 51,
+ 128, 85, 48, 51, 50, 65, 128, 85, 48, 51, 50, 128, 85, 48, 51, 49, 128,
+ 85, 48, 51, 48, 128, 85, 48, 50, 57, 65, 128, 85, 48, 50, 57, 128, 85,
+ 48, 50, 56, 128, 85, 48, 50, 55, 128, 85, 48, 50, 54, 128, 85, 48, 50,
+ 53, 128, 85, 48, 50, 52, 128, 85, 48, 50, 51, 65, 128, 85, 48, 50, 51,
+ 128, 85, 48, 50, 50, 128, 85, 48, 50, 49, 128, 85, 48, 50, 48, 128, 85,
+ 48, 49, 57, 128, 85, 48, 49, 56, 128, 85, 48, 49, 55, 128, 85, 48, 49,
+ 54, 128, 85, 48, 49, 53, 128, 85, 48, 49, 52, 128, 85, 48, 49, 51, 128,
+ 85, 48, 49, 50, 128, 85, 48, 49, 49, 128, 85, 48, 49, 48, 128, 85, 48,
+ 48, 57, 128, 85, 48, 48, 56, 128, 85, 48, 48, 55, 128, 85, 48, 48, 54,
+ 66, 128, 85, 48, 48, 54, 65, 128, 85, 48, 48, 54, 128, 85, 48, 48, 53,
+ 128, 85, 48, 48, 52, 128, 85, 48, 48, 51, 128, 85, 48, 48, 50, 128, 85,
+ 48, 48, 49, 128, 85, 45, 83, 72, 65, 80, 69, 196, 85, 45, 73, 45, 73,
+ 128, 85, 45, 69, 79, 45, 69, 85, 128, 85, 45, 66, 82, 74, 71, 85, 128,
+ 85, 45, 53, 128, 84, 90, 85, 128, 84, 90, 79, 65, 128, 84, 90, 79, 128,
+ 84, 90, 73, 210, 84, 90, 73, 128, 84, 90, 69, 69, 128, 84, 90, 69, 128,
+ 84, 90, 65, 65, 128, 84, 90, 65, 128, 84, 90, 128, 84, 89, 210, 84, 89,
+ 80, 69, 45, 183, 84, 89, 80, 69, 45, 54, 128, 84, 89, 80, 69, 45, 182,
+ 84, 89, 80, 69, 45, 53, 128, 84, 89, 80, 69, 45, 181, 84, 89, 80, 69, 45,
+ 52, 128, 84, 89, 80, 69, 45, 180, 84, 89, 80, 69, 45, 51, 128, 84, 89,
+ 80, 69, 45, 179, 84, 89, 80, 69, 45, 178, 84, 89, 80, 69, 45, 49, 45, 50,
+ 128, 84, 89, 80, 69, 45, 177, 84, 89, 80, 197, 84, 89, 79, 128, 84, 89,
+ 73, 128, 84, 89, 69, 128, 84, 89, 65, 89, 128, 84, 89, 65, 128, 84, 88,
+ 87, 86, 128, 84, 88, 87, 214, 84, 88, 72, 69, 69, 202, 84, 88, 65, 128,
+ 84, 87, 79, 79, 128, 84, 87, 79, 45, 87, 65, 217, 84, 87, 79, 45, 84, 72,
+ 73, 82, 84, 89, 128, 84, 87, 79, 45, 76, 73, 78, 197, 84, 87, 79, 45, 72,
+ 69, 65, 68, 69, 196, 84, 87, 79, 45, 69, 205, 84, 87, 79, 45, 67, 73, 82,
+ 67, 76, 197, 84, 87, 73, 83, 84, 73, 78, 71, 128, 84, 87, 73, 83, 84, 69,
+ 196, 84, 87, 73, 73, 128, 84, 87, 73, 128, 84, 87, 69, 78, 84, 89, 45,
+ 84, 87, 79, 128, 84, 87, 69, 78, 84, 89, 45, 84, 87, 207, 84, 87, 69, 78,
+ 84, 89, 45, 84, 72, 82, 69, 69, 128, 84, 87, 69, 78, 84, 89, 45, 83, 73,
+ 88, 128, 84, 87, 69, 78, 84, 89, 45, 83, 69, 86, 69, 78, 128, 84, 87, 69,
+ 78, 84, 89, 45, 79, 78, 69, 128, 84, 87, 69, 78, 84, 89, 45, 78, 73, 78,
+ 69, 128, 84, 87, 69, 78, 84, 89, 45, 70, 79, 85, 82, 128, 84, 87, 69, 78,
+ 84, 89, 45, 70, 73, 86, 69, 128, 84, 87, 69, 78, 84, 89, 45, 70, 73, 86,
+ 197, 84, 87, 69, 78, 84, 89, 45, 69, 73, 71, 72, 84, 200, 84, 87, 69, 78,
+ 84, 89, 45, 69, 73, 71, 72, 84, 128, 84, 87, 69, 78, 84, 89, 128, 84, 87,
+ 69, 78, 84, 217, 84, 87, 69, 78, 84, 73, 69, 84, 72, 83, 128, 84, 87, 69,
+ 78, 84, 73, 69, 84, 72, 128, 84, 87, 69, 76, 86, 69, 45, 84, 72, 73, 82,
+ 84, 89, 128, 84, 87, 69, 76, 86, 69, 128, 84, 87, 69, 76, 86, 197, 84,
+ 87, 69, 76, 70, 84, 72, 83, 128, 84, 87, 69, 76, 70, 84, 72, 128, 84, 87,
+ 69, 128, 84, 87, 65, 65, 128, 84, 87, 65, 128, 84, 86, 82, 73, 68, 79,
+ 128, 84, 86, 73, 77, 65, 68, 85, 210, 84, 85, 88, 69, 68, 79, 128, 84,
+ 85, 88, 128, 84, 85, 85, 77, 85, 128, 84, 85, 85, 128, 84, 85, 84, 84,
+ 89, 128, 84, 85, 84, 69, 89, 65, 83, 65, 84, 128, 84, 85, 84, 128, 84,
+ 85, 82, 88, 128, 84, 85, 82, 85, 128, 84, 85, 82, 84, 76, 69, 128, 84,
+ 85, 82, 79, 50, 128, 84, 85, 82, 78, 83, 84, 73, 76, 69, 128, 84, 85, 82,
+ 206, 84, 85, 82, 75, 73, 83, 200, 84, 85, 82, 75, 73, 195, 84, 85, 82,
+ 75, 69, 89, 128, 84, 85, 82, 66, 65, 78, 128, 84, 85, 82, 128, 84, 85,
+ 210, 84, 85, 80, 78, 73, 128, 84, 85, 80, 128, 84, 85, 79, 88, 128, 84,
+ 85, 79, 84, 128, 84, 85, 79, 80, 128, 84, 85, 79, 128, 84, 85, 78, 78,
+ 89, 128, 84, 85, 77, 69, 84, 69, 83, 128, 84, 85, 77, 66, 76, 69, 210,
+ 84, 85, 77, 65, 69, 128, 84, 85, 77, 128, 84, 85, 205, 84, 85, 76, 73,
+ 80, 128, 84, 85, 75, 87, 69, 78, 84, 73, 83, 128, 84, 85, 75, 128, 84,
+ 85, 71, 82, 73, 203, 84, 85, 71, 50, 128, 84, 85, 71, 178, 84, 85, 66,
+ 69, 128, 84, 85, 66, 128, 84, 85, 65, 82, 69, 199, 84, 85, 65, 69, 80,
+ 128, 84, 85, 65, 69, 128, 84, 85, 45, 84, 79, 128, 84, 85, 45, 52, 128,
+ 84, 85, 45, 51, 128, 84, 85, 45, 50, 128, 84, 85, 45, 49, 128, 84, 213,
+ 84, 84, 85, 85, 128, 84, 84, 85, 68, 68, 65, 71, 128, 84, 84, 85, 68, 68,
+ 65, 65, 71, 128, 84, 84, 85, 128, 84, 84, 84, 72, 65, 128, 84, 84, 84,
+ 65, 128, 84, 84, 83, 85, 128, 84, 84, 83, 79, 128, 84, 84, 83, 73, 128,
+ 84, 84, 83, 69, 69, 128, 84, 84, 83, 69, 128, 84, 84, 83, 65, 128, 84,
+ 84, 79, 79, 128, 84, 84, 73, 73, 128, 84, 84, 73, 128, 84, 84, 72, 87,
+ 69, 128, 84, 84, 72, 85, 128, 84, 84, 72, 79, 79, 128, 84, 84, 72, 79,
+ 128, 84, 84, 72, 73, 128, 84, 84, 72, 69, 69, 128, 84, 84, 72, 69, 128,
+ 84, 84, 72, 65, 65, 128, 84, 84, 72, 128, 84, 84, 69, 72, 69, 72, 128,
+ 84, 84, 69, 72, 69, 200, 84, 84, 69, 72, 128, 84, 84, 69, 200, 84, 84,
+ 69, 69, 128, 84, 84, 65, 89, 65, 78, 78, 65, 128, 84, 84, 65, 85, 128,
+ 84, 84, 65, 73, 128, 84, 84, 65, 65, 128, 84, 84, 50, 128, 84, 83, 87,
+ 69, 128, 84, 83, 87, 66, 128, 84, 83, 87, 65, 128, 84, 83, 86, 128, 84,
+ 83, 83, 69, 128, 84, 83, 83, 65, 128, 84, 83, 79, 214, 84, 83, 73, 85,
+ 128, 84, 83, 72, 85, 71, 83, 128, 84, 83, 72, 79, 79, 75, 128, 84, 83,
+ 72, 79, 79, 203, 84, 83, 72, 79, 79, 74, 128, 84, 83, 72, 69, 83, 128,
+ 84, 83, 72, 69, 71, 128, 84, 83, 72, 69, 199, 84, 83, 72, 69, 69, 74,
+ 128, 84, 83, 72, 69, 128, 84, 83, 72, 65, 194, 84, 83, 72, 65, 128, 84,
+ 83, 69, 82, 69, 128, 84, 83, 69, 69, 66, 128, 84, 83, 65, 84, 193, 84,
+ 83, 65, 68, 73, 128, 84, 83, 65, 68, 201, 84, 83, 65, 66, 128, 84, 83,
+ 65, 65, 68, 73, 89, 128, 84, 83, 65, 65, 128, 84, 83, 193, 84, 82, 89,
+ 66, 76, 73, 79, 206, 84, 82, 89, 65, 83, 79, 83, 84, 82, 69, 76, 78, 65,
+ 89, 65, 128, 84, 82, 89, 65, 83, 79, 80, 79, 86, 79, 68, 78, 65, 89, 65,
+ 128, 84, 82, 89, 65, 83, 79, 71, 76, 65, 83, 78, 65, 89, 65, 128, 84, 82,
+ 89, 65, 83, 75, 65, 128, 84, 82, 85, 84, 72, 128, 84, 82, 85, 78, 75,
+ 128, 84, 82, 85, 78, 67, 65, 84, 69, 196, 84, 82, 85, 77, 80, 69, 84,
+ 128, 84, 82, 85, 77, 80, 45, 57, 128, 84, 82, 85, 77, 80, 45, 56, 128,
+ 84, 82, 85, 77, 80, 45, 55, 128, 84, 82, 85, 77, 80, 45, 54, 128, 84, 82,
+ 85, 77, 80, 45, 53, 128, 84, 82, 85, 77, 80, 45, 52, 128, 84, 82, 85, 77,
+ 80, 45, 51, 128, 84, 82, 85, 77, 80, 45, 50, 49, 128, 84, 82, 85, 77, 80,
+ 45, 50, 48, 128, 84, 82, 85, 77, 80, 45, 50, 128, 84, 82, 85, 77, 80, 45,
+ 49, 57, 128, 84, 82, 85, 77, 80, 45, 49, 56, 128, 84, 82, 85, 77, 80, 45,
+ 49, 55, 128, 84, 82, 85, 77, 80, 45, 49, 54, 128, 84, 82, 85, 77, 80, 45,
+ 49, 53, 128, 84, 82, 85, 77, 80, 45, 49, 52, 128, 84, 82, 85, 77, 80, 45,
+ 49, 51, 128, 84, 82, 85, 77, 80, 45, 49, 50, 128, 84, 82, 85, 77, 80, 45,
+ 49, 49, 128, 84, 82, 85, 77, 80, 45, 49, 48, 128, 84, 82, 85, 77, 80, 45,
+ 49, 128, 84, 82, 85, 69, 128, 84, 82, 85, 197, 84, 82, 85, 67, 75, 128,
+ 84, 82, 79, 80, 73, 67, 65, 204, 84, 82, 79, 80, 72, 89, 128, 84, 82, 79,
+ 77, 73, 75, 79, 83, 89, 78, 65, 71, 77, 65, 128, 84, 82, 79, 77, 73, 75,
+ 79, 80, 83, 73, 70, 73, 83, 84, 79, 78, 128, 84, 82, 79, 77, 73, 75, 79,
+ 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 65, 128, 84, 82, 79, 77, 73, 75,
+ 79, 78, 128, 84, 82, 79, 77, 73, 75, 79, 206, 84, 82, 79, 77, 73, 75, 79,
+ 76, 89, 71, 73, 83, 77, 65, 128, 84, 82, 79, 76, 76, 69, 89, 66, 85, 83,
+ 128, 84, 82, 79, 76, 76, 69, 89, 128, 84, 82, 79, 76, 76, 128, 84, 82,
+ 79, 75, 85, 84, 65, 83, 84, 201, 84, 82, 79, 69, 90, 69, 78, 73, 65, 206,
+ 84, 82, 73, 85, 77, 80, 72, 128, 84, 82, 73, 84, 79, 211, 84, 82, 73, 84,
+ 73, 77, 79, 82, 73, 79, 78, 128, 84, 82, 73, 83, 73, 77, 79, 85, 128, 84,
+ 82, 73, 83, 69, 77, 69, 128, 84, 82, 73, 80, 79, 68, 128, 84, 82, 73, 80,
+ 76, 73, 128, 84, 82, 73, 80, 76, 69, 128, 84, 82, 73, 80, 76, 197, 84,
+ 82, 73, 79, 206, 84, 82, 73, 76, 76, 73, 79, 78, 83, 128, 84, 82, 73, 76,
+ 76, 128, 84, 82, 73, 73, 83, 65, 80, 128, 84, 82, 73, 71, 82, 65, 77, 77,
+ 79, 211, 84, 82, 73, 71, 82, 65, 205, 84, 82, 73, 71, 79, 82, 71, 79, 78,
+ 128, 84, 82, 73, 70, 79, 78, 73, 65, 83, 128, 84, 82, 73, 70, 79, 76, 73,
+ 65, 84, 197, 84, 82, 73, 68, 69, 78, 84, 128, 84, 82, 73, 68, 69, 78,
+ 212, 84, 82, 73, 67, 79, 76, 79, 78, 128, 84, 82, 73, 65, 78, 71, 85, 76,
+ 65, 210, 84, 82, 73, 65, 78, 71, 76, 69, 45, 82, 79, 85, 78, 196, 84, 82,
+ 73, 65, 78, 71, 76, 69, 45, 72, 69, 65, 68, 69, 196, 84, 82, 73, 65, 78,
+ 71, 76, 69, 128, 84, 82, 73, 65, 78, 71, 76, 197, 84, 82, 73, 65, 128,
+ 84, 82, 73, 128, 84, 82, 69, 83, 86, 69, 84, 76, 89, 128, 84, 82, 69, 83,
+ 86, 69, 84, 76, 79, 128, 84, 82, 69, 83, 86, 69, 84, 76, 65, 89, 65, 128,
+ 84, 82, 69, 83, 73, 76, 76, 79, 128, 84, 82, 69, 78, 68, 128, 84, 82, 69,
+ 78, 196, 84, 82, 69, 77, 79, 76, 79, 45, 51, 128, 84, 82, 69, 77, 79, 76,
+ 79, 45, 50, 128, 84, 82, 69, 77, 79, 76, 79, 45, 49, 128, 84, 82, 69, 69,
+ 128, 84, 82, 69, 197, 84, 82, 69, 68, 69, 67, 73, 76, 69, 128, 84, 82,
+ 69, 65, 68, 73, 78, 71, 128, 84, 82, 65, 89, 128, 84, 82, 65, 86, 69, 76,
+ 45, 87, 65, 76, 76, 80, 76, 65, 78, 197, 84, 82, 65, 86, 69, 76, 45, 70,
+ 76, 79, 79, 82, 80, 76, 65, 78, 197, 84, 82, 65, 80, 69, 90, 73, 85, 77,
+ 128, 84, 82, 65, 80, 128, 84, 82, 65, 78, 83, 86, 69, 82, 83, 65, 204,
+ 84, 82, 65, 78, 83, 80, 79, 83, 73, 84, 73, 79, 206, 84, 82, 65, 78, 83,
+ 80, 76, 85, 84, 79, 128, 84, 82, 65, 78, 83, 77, 73, 212, 84, 82, 65, 78,
+ 83, 77, 73, 83, 83, 73, 79, 78, 128, 84, 82, 65, 78, 83, 77, 73, 83, 83,
+ 73, 79, 206, 84, 82, 65, 77, 87, 65, 89, 128, 84, 82, 65, 77, 128, 84,
+ 82, 65, 205, 84, 82, 65, 73, 78, 128, 84, 82, 65, 73, 206, 84, 82, 65,
+ 73, 76, 73, 78, 199, 84, 82, 65, 70, 70, 73, 67, 128, 84, 82, 65, 70, 70,
+ 73, 195, 84, 82, 65, 68, 73, 84, 73, 79, 78, 65, 204, 84, 82, 65, 68,
+ 197, 84, 82, 65, 67, 84, 79, 82, 128, 84, 82, 65, 67, 75, 66, 65, 76, 76,
+ 128, 84, 82, 65, 67, 75, 128, 84, 82, 65, 128, 84, 82, 128, 84, 79, 89,
+ 79, 82, 128, 84, 79, 88, 128, 84, 79, 87, 69, 82, 128, 84, 79, 87, 65,
+ 82, 68, 211, 84, 79, 86, 128, 84, 79, 85, 82, 78, 79, 73, 211, 84, 79,
+ 85, 67, 72, 84, 79, 78, 197, 84, 79, 85, 67, 72, 73, 78, 199, 84, 79, 85,
+ 67, 72, 69, 211, 84, 79, 85, 67, 200, 84, 79, 84, 207, 84, 79, 84, 65,
+ 204, 84, 79, 84, 128, 84, 79, 83, 128, 84, 79, 82, 84, 79, 73, 83, 197,
+ 84, 79, 82, 83, 79, 45, 87, 65, 76, 76, 80, 76, 65, 78, 197, 84, 79, 82,
+ 83, 79, 45, 70, 76, 79, 79, 82, 80, 76, 65, 78, 197, 84, 79, 82, 83, 79,
+ 128, 84, 79, 82, 78, 65, 68, 79, 128, 84, 79, 82, 67, 85, 76, 85, 83,
+ 128, 84, 79, 82, 67, 85, 76, 85, 211, 84, 79, 82, 67, 72, 128, 84, 79,
+ 81, 128, 84, 79, 80, 66, 65, 82, 128, 84, 79, 80, 45, 76, 73, 71, 72, 84,
+ 69, 196, 84, 79, 80, 128, 84, 79, 208, 84, 79, 79, 84, 72, 66, 82, 85,
+ 83, 72, 128, 84, 79, 79, 84, 72, 128, 84, 79, 79, 78, 128, 84, 79, 79,
+ 76, 66, 79, 88, 128, 84, 79, 78, 79, 83, 128, 84, 79, 78, 71, 85, 69,
+ 128, 84, 79, 78, 71, 85, 197, 84, 79, 78, 71, 128, 84, 79, 78, 69, 45,
+ 86, 128, 84, 79, 78, 69, 45, 83, 128, 84, 79, 78, 69, 45, 77, 128, 84,
+ 79, 78, 69, 45, 74, 128, 84, 79, 78, 69, 45, 71, 128, 84, 79, 78, 69, 45,
+ 68, 128, 84, 79, 78, 69, 45, 66, 128, 84, 79, 78, 69, 45, 56, 128, 84,
+ 79, 78, 69, 45, 55, 128, 84, 79, 78, 69, 45, 54, 128, 84, 79, 78, 69, 45,
+ 53, 128, 84, 79, 78, 69, 45, 52, 128, 84, 79, 78, 69, 45, 51, 128, 84,
+ 79, 78, 69, 45, 50, 128, 84, 79, 78, 69, 45, 49, 128, 84, 79, 78, 69,
+ 128, 84, 79, 78, 65, 204, 84, 79, 77, 80, 73, 128, 84, 79, 77, 65, 84,
+ 79, 128, 84, 79, 76, 79, 78, 71, 128, 84, 79, 75, 89, 207, 84, 79, 73,
+ 76, 69, 84, 128, 84, 79, 71, 69, 84, 72, 69, 82, 128, 84, 79, 68, 207,
+ 84, 79, 67, 72, 75, 65, 128, 84, 79, 65, 78, 68, 65, 75, 72, 73, 65, 84,
+ 128, 84, 79, 65, 128, 84, 79, 45, 82, 65, 128, 84, 79, 45, 54, 128, 84,
+ 79, 45, 53, 128, 84, 79, 45, 52, 128, 84, 79, 45, 51, 128, 84, 79, 45,
+ 50, 128, 84, 79, 45, 49, 128, 84, 78, 128, 84, 76, 86, 128, 84, 76, 85,
+ 128, 84, 76, 73, 128, 84, 76, 72, 89, 65, 128, 84, 76, 72, 87, 69, 128,
+ 84, 76, 72, 85, 128, 84, 76, 72, 79, 79, 128, 84, 76, 72, 79, 128, 84,
+ 76, 72, 73, 128, 84, 76, 72, 69, 69, 128, 84, 76, 72, 69, 128, 84, 76,
+ 72, 65, 128, 84, 76, 69, 69, 128, 84, 76, 65, 128, 84, 74, 69, 128, 84,
+ 73, 88, 128, 84, 73, 87, 82, 128, 84, 73, 87, 78, 128, 84, 73, 87, 65,
+ 218, 84, 73, 84, 85, 65, 69, 80, 128, 84, 73, 84, 76, 79, 128, 84, 73,
+ 84, 76, 207, 84, 73, 84, 193, 84, 73, 84, 128, 84, 73, 82, 89, 65, 75,
+ 128, 84, 73, 82, 84, 193, 84, 73, 82, 79, 78, 73, 65, 206, 84, 73, 82,
+ 72, 85, 84, 193, 84, 73, 82, 69, 196, 84, 73, 82, 128, 84, 73, 210, 84,
+ 73, 80, 80, 73, 128, 84, 73, 80, 69, 72, 65, 128, 84, 73, 80, 128, 84,
+ 73, 208, 84, 73, 78, 89, 128, 84, 73, 78, 217, 84, 73, 78, 78, 69, 128,
+ 84, 73, 78, 67, 84, 85, 82, 69, 128, 84, 73, 78, 65, 71, 77, 65, 128, 84,
+ 73, 77, 69, 83, 128, 84, 73, 77, 69, 210, 84, 73, 77, 69, 128, 84, 73,
+ 76, 84, 73, 78, 71, 128, 84, 73, 76, 84, 73, 78, 199, 84, 73, 76, 84,
+ 128, 84, 73, 76, 69, 83, 128, 84, 73, 76, 68, 69, 128, 84, 73, 76, 68,
+ 197, 84, 73, 76, 128, 84, 73, 204, 84, 73, 75, 72, 89, 128, 84, 73, 75,
+ 72, 65, 89, 65, 128, 84, 73, 75, 72, 65, 89, 193, 84, 73, 75, 69, 85, 84,
+ 45, 84, 72, 73, 69, 85, 84, 72, 128, 84, 73, 75, 69, 85, 84, 45, 83, 73,
+ 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 84, 73, 75, 69, 85, 84, 45, 83,
+ 73, 79, 83, 128, 84, 73, 75, 69, 85, 84, 45, 82, 73, 69, 85, 76, 128, 84,
+ 73, 75, 69, 85, 84, 45, 80, 73, 69, 85, 80, 128, 84, 73, 75, 69, 85, 84,
+ 45, 77, 73, 69, 85, 77, 128, 84, 73, 75, 69, 85, 84, 45, 75, 73, 89, 69,
+ 79, 75, 128, 84, 73, 75, 69, 85, 84, 45, 67, 73, 69, 85, 67, 128, 84, 73,
+ 75, 69, 85, 84, 45, 67, 72, 73, 69, 85, 67, 72, 128, 84, 73, 75, 69, 85,
+ 84, 128, 84, 73, 75, 69, 85, 212, 84, 73, 71, 72, 84, 76, 89, 45, 67, 76,
+ 79, 83, 69, 196, 84, 73, 71, 72, 212, 84, 73, 71, 69, 82, 128, 84, 73,
+ 71, 69, 210, 84, 73, 70, 73, 78, 65, 71, 200, 84, 73, 69, 88, 128, 84,
+ 73, 69, 80, 128, 84, 73, 197, 84, 73, 67, 75, 69, 84, 83, 128, 84, 73,
+ 67, 75, 69, 84, 128, 84, 73, 67, 75, 128, 84, 73, 67, 203, 84, 73, 65,
+ 82, 65, 128, 84, 73, 50, 128, 84, 73, 45, 55, 128, 84, 73, 45, 54, 128,
+ 84, 73, 45, 53, 128, 84, 73, 45, 52, 128, 84, 73, 45, 51, 128, 84, 73,
+ 45, 50, 128, 84, 73, 45, 49, 128, 84, 72, 90, 128, 84, 72, 89, 79, 79,
+ 205, 84, 72, 87, 79, 79, 128, 84, 72, 87, 79, 128, 84, 72, 87, 73, 73,
+ 128, 84, 72, 87, 73, 128, 84, 72, 87, 69, 69, 128, 84, 72, 87, 65, 65,
+ 128, 84, 72, 87, 65, 128, 84, 72, 85, 82, 211, 84, 72, 85, 82, 73, 83,
+ 65, 218, 84, 72, 85, 78, 71, 128, 84, 72, 85, 78, 68, 69, 82, 83, 84, 79,
+ 82, 77, 128, 84, 72, 85, 78, 68, 69, 82, 128, 84, 72, 85, 78, 68, 69,
+ 210, 84, 72, 85, 77, 66, 211, 84, 72, 85, 77, 66, 128, 84, 72, 82, 79,
+ 87, 73, 78, 199, 84, 72, 82, 79, 85, 71, 72, 128, 84, 72, 82, 79, 85, 71,
+ 200, 84, 72, 82, 69, 69, 45, 84, 72, 73, 82, 84, 89, 128, 84, 72, 82, 69,
+ 69, 45, 81, 85, 65, 82, 84, 69, 210, 84, 72, 82, 69, 69, 45, 80, 69, 82,
+ 45, 69, 205, 84, 72, 82, 69, 69, 45, 76, 73, 78, 197, 84, 72, 82, 69, 69,
+ 45, 76, 69, 71, 71, 69, 196, 84, 72, 82, 69, 69, 45, 72, 85, 78, 68, 82,
+ 69, 68, 45, 65, 78, 68, 45, 84, 87, 69, 78, 84, 73, 69, 84, 72, 128, 84,
+ 72, 82, 69, 69, 45, 69, 205, 84, 72, 82, 69, 69, 45, 68, 79, 212, 84, 72,
+ 82, 69, 69, 45, 196, 84, 72, 82, 69, 69, 45, 67, 73, 82, 67, 76, 197, 84,
+ 72, 82, 69, 65, 68, 128, 84, 72, 79, 85, 83, 65, 78, 68, 83, 128, 84, 72,
+ 79, 85, 83, 65, 78, 68, 211, 84, 72, 79, 85, 83, 65, 78, 196, 84, 72, 79,
+ 85, 71, 72, 212, 84, 72, 79, 85, 128, 84, 72, 79, 82, 78, 128, 84, 72,
+ 79, 82, 206, 84, 72, 79, 78, 71, 128, 84, 72, 79, 78, 199, 84, 72, 79,
+ 77, 128, 84, 72, 79, 74, 128, 84, 72, 79, 65, 128, 84, 72, 207, 84, 72,
+ 73, 85, 84, 72, 128, 84, 72, 73, 84, 65, 128, 84, 72, 73, 82, 84, 89, 45,
+ 83, 69, 67, 79, 78, 68, 128, 84, 72, 73, 82, 84, 89, 45, 83, 69, 67, 79,
+ 78, 196, 84, 72, 73, 82, 84, 89, 45, 79, 78, 69, 128, 84, 72, 73, 82, 84,
+ 89, 45, 70, 73, 86, 197, 84, 72, 73, 82, 84, 217, 84, 72, 73, 82, 84, 69,
+ 69, 78, 128, 84, 72, 73, 82, 84, 69, 69, 206, 84, 72, 73, 82, 68, 83,
+ 128, 84, 72, 73, 82, 68, 211, 84, 72, 73, 82, 68, 45, 83, 84, 65, 71,
+ 197, 84, 72, 73, 82, 68, 128, 84, 72, 73, 82, 196, 84, 72, 73, 78, 75,
+ 73, 78, 199, 84, 72, 73, 78, 71, 128, 84, 72, 73, 73, 128, 84, 72, 73,
+ 71, 72, 128, 84, 72, 73, 69, 85, 84, 200, 84, 72, 73, 67, 203, 84, 72,
+ 73, 65, 66, 128, 84, 72, 69, 89, 128, 84, 72, 69, 84, 72, 69, 128, 84,
+ 72, 69, 84, 72, 128, 84, 72, 69, 84, 65, 128, 84, 72, 69, 84, 193, 84,
+ 72, 69, 83, 80, 73, 65, 206, 84, 72, 69, 83, 69, 79, 83, 128, 84, 72, 69,
+ 83, 69, 79, 211, 84, 72, 69, 211, 84, 72, 69, 82, 77, 79, 77, 69, 84, 69,
+ 82, 128, 84, 72, 69, 82, 77, 79, 68, 89, 78, 65, 77, 73, 67, 128, 84, 72,
+ 69, 82, 69, 70, 79, 82, 69, 128, 84, 72, 69, 82, 197, 84, 72, 69, 206,
+ 84, 72, 69, 77, 65, 84, 73, 83, 77, 79, 211, 84, 72, 69, 77, 65, 128, 84,
+ 72, 69, 77, 193, 84, 72, 69, 72, 128, 84, 72, 69, 200, 84, 72, 69, 65,
+ 128, 84, 72, 197, 84, 72, 65, 87, 128, 84, 72, 65, 78, 84, 72, 65, 75,
+ 72, 65, 84, 128, 84, 72, 65, 78, 78, 65, 128, 84, 72, 65, 78, 128, 84,
+ 72, 65, 206, 84, 72, 65, 77, 69, 68, 72, 128, 84, 72, 65, 76, 128, 84,
+ 72, 65, 204, 84, 72, 65, 74, 128, 84, 72, 65, 201, 84, 72, 65, 72, 65,
+ 78, 128, 84, 72, 65, 65, 78, 193, 84, 72, 65, 65, 76, 85, 128, 84, 72,
+ 45, 67, 82, 69, 197, 84, 69, 88, 84, 128, 84, 69, 88, 212, 84, 69, 88,
+ 128, 84, 69, 86, 73, 82, 128, 84, 69, 85, 84, 69, 85, 88, 128, 84, 69,
+ 85, 84, 69, 85, 87, 69, 78, 128, 84, 69, 85, 84, 128, 84, 69, 85, 78,
+ 128, 84, 69, 85, 65, 69, 81, 128, 84, 69, 85, 65, 69, 78, 128, 84, 69,
+ 85, 128, 84, 69, 84, 82, 65, 83, 73, 77, 79, 85, 128, 84, 69, 84, 82, 65,
+ 83, 69, 77, 69, 128, 84, 69, 84, 82, 65, 80, 76, 73, 128, 84, 69, 84, 82,
+ 65, 71, 82, 65, 205, 84, 69, 84, 82, 65, 70, 79, 78, 73, 65, 83, 128, 84,
+ 69, 84, 72, 128, 84, 69, 84, 200, 84, 69, 84, 65, 82, 84, 79, 211, 84,
+ 69, 84, 65, 82, 84, 73, 77, 79, 82, 73, 79, 78, 128, 84, 69, 84, 128, 84,
+ 69, 212, 84, 69, 83, 212, 84, 69, 83, 83, 69, 82, 65, 128, 84, 69, 83,
+ 83, 69, 82, 193, 84, 69, 83, 83, 65, 82, 79, 206, 84, 69, 83, 200, 84,
+ 69, 82, 77, 73, 78, 65, 84, 79, 82, 128, 84, 69, 82, 77, 73, 78, 65, 204,
+ 84, 69, 80, 128, 84, 69, 78, 85, 84, 79, 128, 84, 69, 78, 85, 128, 84,
+ 69, 78, 213, 84, 69, 78, 84, 72, 128, 84, 69, 78, 84, 128, 84, 69, 78,
+ 83, 69, 128, 84, 69, 78, 83, 197, 84, 69, 78, 83, 128, 84, 69, 78, 211,
+ 84, 69, 78, 78, 73, 211, 84, 69, 78, 71, 197, 84, 69, 78, 45, 84, 72, 73,
+ 82, 84, 89, 128, 84, 69, 78, 128, 84, 69, 206, 84, 69, 77, 80, 85, 211,
+ 84, 69, 77, 80, 76, 69, 128, 84, 69, 76, 85, 71, 213, 84, 69, 76, 85,
+ 128, 84, 69, 76, 79, 85, 211, 84, 69, 76, 76, 69, 210, 84, 69, 76, 73,
+ 83, 72, 193, 84, 69, 76, 69, 86, 73, 83, 73, 79, 78, 128, 84, 69, 76, 69,
+ 83, 67, 79, 80, 69, 128, 84, 69, 76, 69, 80, 72, 79, 78, 69, 128, 84, 69,
+ 76, 69, 80, 72, 79, 78, 197, 84, 69, 76, 69, 73, 65, 128, 84, 69, 76, 69,
+ 71, 82, 65, 80, 200, 84, 69, 75, 128, 84, 69, 73, 87, 83, 128, 84, 69,
+ 71, 69, 72, 128, 84, 69, 69, 84, 72, 128, 84, 69, 69, 84, 200, 84, 69,
+ 69, 78, 83, 128, 84, 69, 69, 69, 69, 128, 84, 69, 197, 84, 69, 68, 85,
+ 78, 71, 128, 84, 69, 68, 68, 217, 84, 69, 65, 82, 83, 128, 84, 69, 65,
+ 82, 211, 84, 69, 65, 82, 68, 82, 79, 80, 45, 83, 80, 79, 75, 69, 196, 84,
+ 69, 65, 82, 68, 82, 79, 80, 45, 83, 72, 65, 78, 75, 69, 196, 84, 69, 65,
+ 82, 68, 82, 79, 80, 45, 66, 65, 82, 66, 69, 196, 84, 69, 65, 82, 45, 79,
+ 70, 198, 84, 69, 65, 82, 128, 84, 69, 65, 80, 79, 84, 128, 84, 69, 65,
+ 67, 85, 208, 84, 69, 65, 128, 84, 69, 45, 85, 128, 84, 69, 45, 57, 128,
+ 84, 69, 45, 56, 128, 84, 69, 45, 55, 128, 84, 69, 45, 54, 128, 84, 69,
+ 45, 53, 128, 84, 69, 45, 52, 128, 84, 69, 45, 51, 128, 84, 69, 45, 50,
+ 128, 84, 69, 45, 49, 128, 84, 67, 72, 69, 72, 69, 72, 128, 84, 67, 72,
+ 69, 72, 69, 200, 84, 67, 72, 69, 72, 128, 84, 67, 72, 69, 200, 84, 67,
+ 72, 69, 128, 84, 195, 84, 65, 89, 128, 84, 65, 88, 73, 128, 84, 65, 88,
+ 128, 84, 65, 87, 69, 76, 76, 69, 77, 69, 212, 84, 65, 87, 65, 128, 84,
+ 65, 87, 128, 84, 65, 215, 84, 65, 86, 73, 89, 65, 78, 73, 128, 84, 65,
+ 86, 128, 84, 65, 214, 84, 65, 85, 82, 85, 83, 128, 84, 65, 85, 77, 128,
+ 84, 65, 213, 84, 65, 84, 87, 69, 69, 76, 128, 84, 65, 84, 87, 69, 69,
+ 204, 84, 65, 84, 84, 79, 79, 69, 196, 84, 65, 84, 128, 84, 65, 83, 83,
+ 73, 128, 84, 65, 83, 72, 69, 69, 76, 128, 84, 65, 83, 128, 84, 65, 82,
+ 85, 78, 71, 128, 84, 65, 82, 84, 65, 82, 45, 50, 128, 84, 65, 82, 84, 65,
+ 82, 128, 84, 65, 82, 71, 69, 84, 128, 84, 65, 81, 128, 84, 65, 80, 69,
+ 82, 128, 84, 65, 80, 197, 84, 65, 80, 128, 84, 65, 79, 128, 84, 65, 78,
+ 78, 69, 196, 84, 65, 78, 71, 83, 193, 84, 65, 78, 71, 69, 82, 73, 78, 69,
+ 128, 84, 65, 78, 71, 69, 78, 84, 128, 84, 65, 78, 71, 69, 78, 212, 84,
+ 65, 78, 199, 84, 65, 78, 65, 66, 65, 84, 193, 84, 65, 78, 65, 128, 84,
+ 65, 78, 128, 84, 65, 77, 73, 78, 71, 128, 84, 65, 77, 65, 206, 84, 65,
+ 77, 65, 76, 69, 128, 84, 65, 77, 128, 84, 65, 76, 76, 217, 84, 65, 76,
+ 76, 128, 84, 65, 76, 204, 84, 65, 76, 73, 78, 71, 128, 84, 65, 76, 73,
+ 78, 199, 84, 65, 76, 69, 78, 84, 83, 128, 84, 65, 76, 69, 78, 212, 84,
+ 65, 75, 82, 201, 84, 65, 75, 72, 65, 76, 76, 85, 83, 128, 84, 65, 75, 69,
+ 79, 85, 212, 84, 65, 75, 69, 128, 84, 65, 75, 52, 128, 84, 65, 75, 180,
+ 84, 65, 75, 128, 84, 65, 73, 83, 89, 79, 85, 128, 84, 65, 73, 76, 76, 69,
+ 83, 211, 84, 65, 73, 76, 128, 84, 65, 73, 204, 84, 65, 72, 65, 76, 65,
+ 128, 84, 65, 72, 128, 84, 65, 200, 84, 65, 71, 66, 65, 78, 87, 193, 84,
+ 65, 71, 65, 76, 79, 199, 84, 65, 71, 128, 84, 65, 199, 84, 65, 69, 206,
+ 84, 65, 67, 79, 128, 84, 65, 67, 75, 128, 84, 65, 67, 203, 84, 65, 66,
+ 85, 76, 65, 84, 73, 79, 78, 128, 84, 65, 66, 85, 76, 65, 84, 73, 79, 206,
+ 84, 65, 66, 83, 128, 84, 65, 66, 76, 69, 128, 84, 65, 66, 76, 197, 84,
+ 65, 66, 65, 65, 82, 65, 75, 193, 84, 65, 66, 128, 84, 65, 194, 84, 65,
+ 65, 83, 72, 65, 69, 128, 84, 65, 65, 81, 128, 84, 65, 65, 77, 128, 84,
+ 65, 65, 76, 85, 74, 193, 84, 65, 65, 73, 128, 84, 65, 65, 70, 128, 84,
+ 65, 50, 128, 84, 65, 45, 82, 79, 76, 128, 84, 65, 45, 52, 128, 84, 65,
+ 45, 51, 128, 84, 65, 45, 50, 128, 84, 65, 45, 49, 128, 84, 48, 51, 54,
+ 128, 84, 48, 51, 53, 128, 84, 48, 51, 52, 128, 84, 48, 51, 51, 65, 128,
+ 84, 48, 51, 51, 128, 84, 48, 51, 50, 65, 128, 84, 48, 51, 50, 128, 84,
+ 48, 51, 49, 128, 84, 48, 51, 48, 128, 84, 48, 50, 57, 128, 84, 48, 50,
+ 56, 128, 84, 48, 50, 55, 128, 84, 48, 50, 54, 128, 84, 48, 50, 53, 128,
+ 84, 48, 50, 52, 128, 84, 48, 50, 51, 128, 84, 48, 50, 50, 128, 84, 48,
+ 50, 49, 128, 84, 48, 50, 48, 128, 84, 48, 49, 57, 128, 84, 48, 49, 56,
+ 128, 84, 48, 49, 55, 128, 84, 48, 49, 54, 65, 128, 84, 48, 49, 54, 128,
+ 84, 48, 49, 53, 128, 84, 48, 49, 52, 128, 84, 48, 49, 51, 128, 84, 48,
+ 49, 50, 128, 84, 48, 49, 49, 65, 128, 84, 48, 49, 49, 128, 84, 48, 49,
+ 48, 128, 84, 48, 48, 57, 65, 128, 84, 48, 48, 57, 128, 84, 48, 48, 56,
+ 65, 128, 84, 48, 48, 56, 128, 84, 48, 48, 55, 65, 128, 84, 48, 48, 55,
+ 128, 84, 48, 48, 54, 128, 84, 48, 48, 53, 128, 84, 48, 48, 52, 128, 84,
+ 48, 48, 51, 65, 128, 84, 48, 48, 51, 128, 84, 48, 48, 50, 128, 84, 48,
+ 48, 49, 128, 84, 45, 83, 72, 73, 82, 84, 128, 84, 45, 82, 69, 88, 128,
+ 83, 90, 90, 128, 83, 90, 87, 71, 128, 83, 90, 87, 65, 128, 83, 90, 85,
+ 128, 83, 90, 79, 128, 83, 90, 73, 128, 83, 90, 69, 69, 128, 83, 90, 69,
+ 128, 83, 90, 65, 65, 128, 83, 90, 65, 128, 83, 90, 128, 83, 89, 88, 128,
+ 83, 89, 84, 128, 83, 89, 83, 84, 69, 205, 83, 89, 82, 88, 128, 83, 89,
+ 82, 77, 65, 84, 73, 75, 73, 128, 83, 89, 82, 77, 65, 128, 83, 89, 82, 73,
+ 78, 71, 69, 128, 83, 89, 82, 73, 65, 195, 83, 89, 82, 128, 83, 89, 80,
+ 128, 83, 89, 79, 85, 87, 65, 128, 83, 89, 78, 69, 86, 77, 65, 128, 83,
+ 89, 78, 68, 69, 83, 77, 79, 211, 83, 89, 78, 67, 72, 82, 79, 78, 79, 85,
+ 211, 83, 89, 78, 65, 71, 79, 71, 85, 69, 128, 83, 89, 78, 65, 71, 77,
+ 193, 83, 89, 78, 65, 70, 73, 128, 83, 89, 78, 128, 83, 89, 77, 77, 69,
+ 84, 82, 89, 128, 83, 89, 77, 77, 69, 84, 82, 73, 195, 83, 89, 77, 66, 79,
+ 76, 83, 128, 83, 89, 77, 66, 79, 76, 211, 83, 89, 77, 66, 79, 76, 45, 57,
+ 128, 83, 89, 77, 66, 79, 76, 45, 56, 128, 83, 89, 77, 66, 79, 76, 45, 55,
+ 128, 83, 89, 77, 66, 79, 76, 45, 54, 128, 83, 89, 77, 66, 79, 76, 45, 53,
+ 52, 128, 83, 89, 77, 66, 79, 76, 45, 53, 51, 128, 83, 89, 77, 66, 79, 76,
+ 45, 53, 50, 128, 83, 89, 77, 66, 79, 76, 45, 53, 49, 128, 83, 89, 77, 66,
+ 79, 76, 45, 53, 48, 128, 83, 89, 77, 66, 79, 76, 45, 53, 128, 83, 89, 77,
+ 66, 79, 76, 45, 52, 57, 128, 83, 89, 77, 66, 79, 76, 45, 52, 56, 128, 83,
+ 89, 77, 66, 79, 76, 45, 52, 55, 128, 83, 89, 77, 66, 79, 76, 45, 52, 53,
+ 128, 83, 89, 77, 66, 79, 76, 45, 52, 51, 128, 83, 89, 77, 66, 79, 76, 45,
+ 52, 50, 128, 83, 89, 77, 66, 79, 76, 45, 52, 48, 128, 83, 89, 77, 66, 79,
+ 76, 45, 52, 128, 83, 89, 77, 66, 79, 76, 45, 51, 57, 128, 83, 89, 77, 66,
+ 79, 76, 45, 51, 56, 128, 83, 89, 77, 66, 79, 76, 45, 51, 55, 128, 83, 89,
+ 77, 66, 79, 76, 45, 51, 54, 128, 83, 89, 77, 66, 79, 76, 45, 51, 50, 128,
+ 83, 89, 77, 66, 79, 76, 45, 51, 48, 128, 83, 89, 77, 66, 79, 76, 45, 51,
+ 128, 83, 89, 77, 66, 79, 76, 45, 50, 57, 128, 83, 89, 77, 66, 79, 76, 45,
+ 50, 55, 128, 83, 89, 77, 66, 79, 76, 45, 50, 54, 128, 83, 89, 77, 66, 79,
+ 76, 45, 50, 53, 128, 83, 89, 77, 66, 79, 76, 45, 50, 52, 128, 83, 89, 77,
+ 66, 79, 76, 45, 50, 51, 128, 83, 89, 77, 66, 79, 76, 45, 50, 50, 128, 83,
+ 89, 77, 66, 79, 76, 45, 50, 49, 128, 83, 89, 77, 66, 79, 76, 45, 50, 48,
+ 128, 83, 89, 77, 66, 79, 76, 45, 50, 128, 83, 89, 77, 66, 79, 76, 45, 49,
+ 57, 128, 83, 89, 77, 66, 79, 76, 45, 49, 56, 128, 83, 89, 77, 66, 79, 76,
+ 45, 49, 55, 128, 83, 89, 77, 66, 79, 76, 45, 49, 54, 128, 83, 89, 77, 66,
+ 79, 76, 45, 49, 53, 128, 83, 89, 77, 66, 79, 76, 45, 49, 52, 128, 83, 89,
+ 77, 66, 79, 76, 45, 49, 51, 128, 83, 89, 77, 66, 79, 76, 45, 49, 50, 128,
+ 83, 89, 77, 66, 79, 76, 45, 49, 49, 128, 83, 89, 77, 66, 79, 76, 45, 49,
+ 48, 128, 83, 89, 77, 66, 79, 76, 45, 49, 128, 83, 89, 76, 79, 84, 201,
+ 83, 89, 73, 128, 83, 89, 128, 83, 87, 90, 128, 83, 87, 85, 78, 199, 83,
+ 87, 79, 82, 68, 83, 128, 83, 87, 79, 82, 68, 128, 83, 87, 79, 79, 128,
+ 83, 87, 79, 128, 83, 87, 73, 82, 204, 83, 87, 73, 77, 83, 85, 73, 84,
+ 128, 83, 87, 73, 77, 77, 73, 78, 71, 128, 83, 87, 73, 77, 77, 69, 82,
+ 128, 83, 87, 73, 73, 128, 83, 87, 73, 128, 83, 87, 71, 128, 83, 87, 69,
+ 69, 84, 128, 83, 87, 69, 69, 212, 83, 87, 69, 65, 84, 128, 83, 87, 69,
+ 65, 212, 83, 87, 65, 83, 200, 83, 87, 65, 80, 80, 73, 78, 71, 128, 83,
+ 87, 65, 78, 128, 83, 87, 65, 65, 128, 83, 87, 128, 83, 86, 65, 83, 84,
+ 201, 83, 86, 65, 82, 73, 84, 65, 128, 83, 86, 65, 82, 73, 84, 193, 83,
+ 85, 88, 128, 83, 85, 85, 128, 83, 85, 84, 85, 72, 128, 83, 85, 84, 82,
+ 193, 83, 85, 84, 128, 83, 85, 83, 80, 69, 78, 83, 73, 79, 206, 83, 85,
+ 83, 72, 73, 128, 83, 85, 82, 89, 65, 128, 83, 85, 82, 88, 128, 83, 85,
+ 82, 82, 79, 85, 78, 68, 128, 83, 85, 82, 82, 79, 85, 78, 196, 83, 85, 82,
+ 70, 69, 82, 128, 83, 85, 82, 70, 65, 67, 197, 83, 85, 82, 69, 128, 83,
+ 85, 82, 65, 78, 71, 128, 83, 85, 82, 57, 128, 83, 85, 82, 128, 83, 85,
+ 210, 83, 85, 80, 82, 65, 76, 73, 78, 69, 65, 210, 83, 85, 80, 69, 82, 86,
+ 73, 83, 69, 128, 83, 85, 80, 69, 82, 86, 73, 76, 76, 65, 73, 78, 128, 83,
+ 85, 80, 69, 82, 83, 69, 84, 128, 83, 85, 80, 69, 82, 83, 69, 212, 83, 85,
+ 80, 69, 82, 83, 67, 82, 73, 80, 212, 83, 85, 80, 69, 82, 73, 77, 80, 79,
+ 83, 69, 196, 83, 85, 80, 69, 82, 72, 69, 82, 79, 128, 83, 85, 80, 69, 82,
+ 70, 73, 88, 69, 196, 83, 85, 80, 69, 210, 83, 85, 80, 128, 83, 85, 79,
+ 88, 128, 83, 85, 79, 80, 128, 83, 85, 79, 128, 83, 85, 78, 83, 69, 212,
+ 83, 85, 78, 82, 73, 83, 69, 128, 83, 85, 78, 82, 73, 83, 197, 83, 85, 78,
+ 71, 76, 65, 83, 83, 69, 83, 128, 83, 85, 78, 71, 128, 83, 85, 78, 70, 76,
+ 79, 87, 69, 82, 128, 83, 85, 78, 68, 65, 78, 69, 83, 197, 83, 85, 78,
+ 128, 83, 85, 206, 83, 85, 77, 77, 69, 82, 128, 83, 85, 77, 77, 65, 84,
+ 73, 79, 78, 128, 83, 85, 77, 77, 65, 84, 73, 79, 206, 83, 85, 77, 65, 83,
+ 72, 128, 83, 85, 77, 128, 83, 85, 76, 70, 85, 82, 128, 83, 85, 75, 85,
+ 78, 128, 83, 85, 75, 85, 206, 83, 85, 75, 85, 128, 83, 85, 75, 213, 83,
+ 85, 73, 84, 65, 66, 76, 69, 128, 83, 85, 73, 212, 83, 85, 72, 85, 82,
+ 128, 83, 85, 69, 128, 83, 85, 68, 50, 128, 83, 85, 68, 128, 83, 85, 67,
+ 75, 73, 78, 199, 83, 85, 67, 75, 69, 68, 128, 83, 85, 67, 203, 83, 85,
+ 67, 67, 69, 69, 68, 83, 128, 83, 85, 67, 67, 69, 69, 68, 211, 83, 85, 67,
+ 67, 69, 69, 68, 128, 83, 85, 67, 67, 69, 69, 196, 83, 85, 66, 85, 78, 73,
+ 84, 128, 83, 85, 66, 83, 84, 73, 84, 85, 84, 73, 79, 206, 83, 85, 66, 83,
+ 84, 73, 84, 85, 84, 69, 128, 83, 85, 66, 83, 84, 73, 84, 85, 84, 197, 83,
+ 85, 66, 83, 69, 84, 128, 83, 85, 66, 83, 69, 212, 83, 85, 66, 83, 67, 82,
+ 73, 80, 212, 83, 85, 66, 80, 85, 78, 67, 84, 73, 83, 128, 83, 85, 66, 76,
+ 73, 78, 69, 65, 210, 83, 85, 66, 76, 73, 77, 65, 84, 73, 79, 78, 128, 83,
+ 85, 66, 76, 73, 77, 65, 84, 69, 45, 51, 128, 83, 85, 66, 76, 73, 77, 65,
+ 84, 69, 45, 50, 128, 83, 85, 66, 76, 73, 77, 65, 84, 69, 128, 83, 85, 66,
+ 76, 73, 77, 65, 84, 197, 83, 85, 66, 74, 79, 73, 78, 69, 82, 128, 83, 85,
+ 66, 74, 79, 73, 78, 69, 196, 83, 85, 66, 74, 69, 67, 84, 128, 83, 85, 66,
+ 73, 84, 79, 128, 83, 85, 66, 72, 65, 65, 78, 65, 72, 213, 83, 85, 66, 71,
+ 82, 79, 85, 80, 128, 83, 85, 66, 71, 82, 79, 85, 208, 83, 85, 66, 128,
+ 83, 85, 65, 77, 128, 83, 85, 65, 69, 84, 128, 83, 85, 65, 69, 78, 128,
+ 83, 85, 65, 69, 128, 83, 85, 65, 66, 128, 83, 85, 65, 128, 83, 85, 45,
+ 56, 128, 83, 85, 45, 55, 128, 83, 85, 45, 54, 128, 83, 85, 45, 53, 128,
+ 83, 85, 45, 52, 128, 83, 85, 45, 51, 128, 83, 85, 45, 50, 128, 83, 85,
+ 45, 49, 128, 83, 213, 83, 84, 88, 128, 83, 84, 87, 65, 128, 83, 84, 85,
+ 80, 65, 128, 83, 84, 85, 70, 70, 69, 196, 83, 84, 85, 68, 89, 128, 83,
+ 84, 85, 68, 73, 207, 83, 84, 85, 67, 75, 45, 79, 85, 212, 83, 84, 83,
+ 128, 83, 84, 82, 79, 78, 199, 83, 84, 82, 79, 75, 69, 83, 128, 83, 84,
+ 82, 79, 75, 69, 211, 83, 84, 82, 79, 75, 69, 45, 57, 128, 83, 84, 82, 79,
+ 75, 69, 45, 56, 128, 83, 84, 82, 79, 75, 69, 45, 55, 128, 83, 84, 82, 79,
+ 75, 69, 45, 54, 128, 83, 84, 82, 79, 75, 69, 45, 53, 128, 83, 84, 82, 79,
+ 75, 69, 45, 52, 128, 83, 84, 82, 79, 75, 69, 45, 51, 128, 83, 84, 82, 79,
+ 75, 69, 45, 50, 128, 83, 84, 82, 79, 75, 69, 45, 49, 49, 128, 83, 84, 82,
+ 79, 75, 69, 45, 49, 48, 128, 83, 84, 82, 79, 75, 69, 45, 49, 128, 83, 84,
+ 82, 79, 75, 197, 83, 84, 82, 73, 80, 69, 128, 83, 84, 82, 73, 78, 71,
+ 128, 83, 84, 82, 73, 78, 199, 83, 84, 82, 73, 75, 69, 84, 72, 82, 79, 85,
+ 71, 72, 128, 83, 84, 82, 73, 75, 197, 83, 84, 82, 73, 68, 69, 128, 83,
+ 84, 82, 73, 67, 84, 76, 217, 83, 84, 82, 69, 84, 67, 72, 69, 196, 83, 84,
+ 82, 69, 84, 67, 72, 128, 83, 84, 82, 69, 83, 211, 83, 84, 82, 69, 78, 71,
+ 84, 72, 128, 83, 84, 82, 69, 76, 193, 83, 84, 82, 69, 65, 77, 69, 82,
+ 128, 83, 84, 82, 65, 87, 66, 69, 82, 82, 89, 128, 83, 84, 82, 65, 87,
+ 128, 83, 84, 82, 65, 84, 85, 77, 45, 50, 128, 83, 84, 82, 65, 84, 85, 77,
+ 128, 83, 84, 82, 65, 84, 85, 205, 83, 84, 82, 65, 84, 73, 65, 206, 83,
+ 84, 82, 65, 78, 78, 79, 128, 83, 84, 82, 65, 78, 78, 207, 83, 84, 82, 65,
+ 73, 78, 69, 82, 128, 83, 84, 82, 65, 73, 71, 72, 84, 78, 69, 83, 83, 128,
+ 83, 84, 82, 65, 73, 71, 72, 84, 128, 83, 84, 82, 65, 73, 71, 72, 212, 83,
+ 84, 82, 65, 73, 70, 128, 83, 84, 82, 65, 71, 71, 73, 83, 77, 65, 84, 65,
+ 128, 83, 84, 79, 86, 69, 128, 83, 84, 79, 82, 69, 128, 83, 84, 79, 80,
+ 87, 65, 84, 67, 72, 128, 83, 84, 79, 80, 80, 73, 78, 71, 128, 83, 84, 79,
+ 80, 80, 65, 71, 69, 128, 83, 84, 79, 80, 73, 84, 83, 65, 128, 83, 84, 79,
+ 80, 73, 84, 83, 193, 83, 84, 79, 80, 128, 83, 84, 79, 208, 83, 84, 79,
+ 78, 69, 128, 83, 84, 79, 67, 75, 128, 83, 84, 79, 67, 203, 83, 84, 73,
+ 82, 82, 85, 208, 83, 84, 73, 77, 77, 69, 128, 83, 84, 73, 76, 204, 83,
+ 84, 73, 76, 197, 83, 84, 73, 71, 77, 65, 128, 83, 84, 73, 67, 75, 73, 78,
+ 199, 83, 84, 73, 67, 203, 83, 84, 69, 84, 72, 79, 83, 67, 79, 80, 69,
+ 128, 83, 84, 69, 82, 69, 79, 128, 83, 84, 69, 80, 128, 83, 84, 69, 78,
+ 79, 71, 82, 65, 80, 72, 73, 195, 83, 84, 69, 77, 128, 83, 84, 69, 65, 77,
+ 217, 83, 84, 69, 65, 77, 73, 78, 199, 83, 84, 69, 65, 77, 128, 83, 84,
+ 69, 65, 205, 83, 84, 65, 86, 82, 79, 85, 128, 83, 84, 65, 86, 82, 79, 83,
+ 128, 83, 84, 65, 86, 82, 79, 211, 83, 84, 65, 85, 82, 79, 83, 128, 83,
+ 84, 65, 84, 89, 65, 128, 83, 84, 65, 84, 89, 193, 83, 84, 65, 84, 85,
+ 197, 83, 84, 65, 84, 73, 79, 78, 128, 83, 84, 65, 84, 69, 82, 83, 128,
+ 83, 84, 65, 84, 69, 128, 83, 84, 65, 82, 84, 73, 78, 199, 83, 84, 65, 82,
+ 84, 128, 83, 84, 65, 82, 212, 83, 84, 65, 82, 83, 128, 83, 84, 65, 82,
+ 82, 69, 196, 83, 84, 65, 82, 75, 128, 83, 84, 65, 82, 128, 83, 84, 65,
+ 210, 83, 84, 65, 78, 68, 83, 84, 73, 76, 76, 128, 83, 84, 65, 78, 68, 73,
+ 78, 199, 83, 84, 65, 78, 68, 65, 82, 196, 83, 84, 65, 78, 68, 128, 83,
+ 84, 65, 78, 128, 83, 84, 65, 77, 80, 69, 196, 83, 84, 65, 76, 76, 73, 79,
+ 78, 128, 83, 84, 65, 70, 70, 128, 83, 84, 65, 70, 198, 83, 84, 65, 68,
+ 73, 85, 77, 128, 83, 84, 65, 67, 75, 69, 196, 83, 84, 65, 67, 67, 65, 84,
+ 79, 128, 83, 84, 65, 67, 67, 65, 84, 73, 83, 83, 73, 77, 79, 128, 83, 84,
+ 50, 128, 83, 83, 89, 88, 128, 83, 83, 89, 84, 128, 83, 83, 89, 82, 88,
+ 128, 83, 83, 89, 82, 128, 83, 83, 89, 80, 128, 83, 83, 89, 128, 83, 83,
+ 85, 88, 128, 83, 83, 85, 85, 128, 83, 83, 85, 84, 128, 83, 83, 85, 80,
+ 128, 83, 83, 79, 88, 128, 83, 83, 79, 84, 128, 83, 83, 79, 80, 128, 83,
+ 83, 79, 79, 128, 83, 83, 79, 128, 83, 83, 73, 88, 128, 83, 83, 73, 84,
+ 128, 83, 83, 73, 80, 128, 83, 83, 73, 73, 128, 83, 83, 73, 69, 88, 128,
+ 83, 83, 73, 69, 80, 128, 83, 83, 73, 69, 128, 83, 83, 72, 73, 78, 128,
+ 83, 83, 72, 69, 128, 83, 83, 69, 88, 128, 83, 83, 69, 80, 128, 83, 83,
+ 69, 69, 128, 83, 83, 65, 88, 128, 83, 83, 65, 85, 128, 83, 83, 65, 84,
+ 128, 83, 83, 65, 80, 128, 83, 83, 65, 78, 71, 89, 69, 83, 73, 69, 85, 78,
+ 71, 128, 83, 83, 65, 78, 71, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72,
+ 128, 83, 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 45, 80, 73, 69, 85, 80,
+ 128, 83, 83, 65, 78, 71, 84, 73, 75, 69, 85, 84, 128, 83, 83, 65, 78, 71,
+ 84, 72, 73, 69, 85, 84, 72, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45,
+ 84, 73, 75, 69, 85, 84, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 80,
+ 73, 69, 85, 80, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 45, 75, 73, 89,
+ 69, 79, 75, 128, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 83, 83, 65, 78,
+ 71, 82, 73, 69, 85, 76, 45, 75, 72, 73, 69, 85, 75, 72, 128, 83, 83, 65,
+ 78, 71, 82, 73, 69, 85, 76, 128, 83, 83, 65, 78, 71, 80, 73, 69, 85, 80,
+ 128, 83, 83, 65, 78, 71, 78, 73, 69, 85, 78, 128, 83, 83, 65, 78, 71, 77,
+ 73, 69, 85, 77, 128, 83, 83, 65, 78, 71, 73, 69, 85, 78, 71, 128, 83, 83,
+ 65, 78, 71, 72, 73, 69, 85, 72, 128, 83, 83, 65, 78, 71, 67, 73, 69, 85,
+ 67, 45, 72, 73, 69, 85, 72, 128, 83, 83, 65, 78, 71, 67, 73, 69, 85, 67,
+ 128, 83, 83, 65, 78, 71, 65, 82, 65, 69, 65, 128, 83, 83, 65, 73, 128,
+ 83, 83, 65, 65, 128, 83, 83, 51, 128, 83, 83, 50, 128, 83, 82, 69, 68,
+ 78, 197, 83, 82, 128, 83, 81, 85, 73, 83, 200, 83, 81, 85, 73, 82, 82,
+ 69, 204, 83, 81, 85, 73, 71, 71, 76, 197, 83, 81, 85, 73, 68, 128, 83,
+ 81, 85, 69, 69, 90, 69, 68, 128, 83, 81, 85, 69, 69, 90, 197, 83, 81, 85,
+ 65, 212, 83, 81, 85, 65, 82, 69, 83, 128, 83, 81, 85, 65, 82, 69, 68,
+ 128, 83, 81, 85, 65, 82, 69, 128, 83, 80, 89, 128, 83, 80, 87, 65, 128,
+ 83, 80, 85, 78, 71, 211, 83, 80, 82, 79, 85, 84, 128, 83, 80, 82, 73, 78,
+ 71, 83, 128, 83, 80, 82, 73, 78, 71, 128, 83, 80, 82, 69, 67, 72, 71, 69,
+ 83, 65, 78, 199, 83, 80, 82, 69, 65, 68, 128, 83, 80, 82, 69, 65, 196,
+ 83, 80, 79, 85, 84, 73, 78, 199, 83, 80, 79, 84, 128, 83, 80, 79, 82, 84,
+ 211, 83, 80, 79, 79, 78, 128, 83, 80, 79, 79, 204, 83, 80, 79, 78, 71,
+ 69, 128, 83, 80, 79, 128, 83, 80, 76, 73, 84, 84, 73, 78, 199, 83, 80,
+ 76, 73, 84, 128, 83, 80, 76, 73, 212, 83, 80, 76, 65, 89, 69, 68, 128,
+ 83, 80, 76, 65, 83, 72, 73, 78, 199, 83, 80, 73, 82, 73, 84, 85, 211, 83,
+ 80, 73, 82, 73, 84, 128, 83, 80, 73, 82, 73, 212, 83, 80, 73, 82, 65, 78,
+ 84, 128, 83, 80, 73, 82, 65, 76, 128, 83, 80, 73, 82, 65, 204, 83, 80,
+ 73, 78, 69, 128, 83, 80, 73, 68, 69, 82, 217, 83, 80, 73, 68, 69, 82,
+ 128, 83, 80, 73, 68, 69, 210, 83, 80, 73, 67, 69, 128, 83, 80, 73, 128,
+ 83, 80, 72, 69, 82, 73, 67, 65, 204, 83, 80, 69, 83, 77, 73, 76, 207, 83,
+ 80, 69, 78, 212, 83, 80, 69, 69, 68, 66, 79, 65, 84, 128, 83, 80, 69, 69,
+ 67, 72, 128, 83, 80, 69, 69, 67, 200, 83, 80, 69, 67, 73, 65, 76, 128,
+ 83, 80, 69, 65, 82, 128, 83, 80, 69, 65, 75, 73, 78, 199, 83, 80, 69, 65,
+ 75, 69, 82, 128, 83, 80, 69, 65, 75, 69, 210, 83, 80, 69, 65, 75, 45, 78,
+ 79, 45, 69, 86, 73, 204, 83, 80, 69, 128, 83, 80, 65, 84, 72, 73, 128,
+ 83, 80, 65, 82, 75, 76, 73, 78, 199, 83, 80, 65, 82, 75, 76, 69, 83, 128,
+ 83, 80, 65, 82, 75, 76, 69, 82, 128, 83, 80, 65, 82, 75, 76, 69, 128, 83,
+ 80, 65, 71, 72, 69, 84, 84, 73, 128, 83, 80, 65, 68, 69, 83, 128, 83, 80,
+ 65, 68, 197, 83, 80, 65, 67, 73, 78, 199, 83, 80, 65, 67, 197, 83, 80,
+ 65, 128, 83, 79, 89, 79, 77, 66, 207, 83, 79, 89, 128, 83, 79, 87, 73,
+ 76, 207, 83, 79, 87, 128, 83, 79, 85, 84, 72, 69, 82, 206, 83, 79, 85,
+ 84, 72, 45, 83, 76, 65, 86, 69, 217, 83, 79, 85, 84, 200, 83, 79, 85, 82,
+ 67, 69, 128, 83, 79, 85, 78, 68, 128, 83, 79, 85, 78, 196, 83, 79, 85,
+ 78, 65, 80, 128, 83, 79, 85, 128, 83, 79, 83, 128, 83, 79, 82, 79, 67,
+ 72, 89, 193, 83, 79, 82, 73, 128, 83, 79, 82, 193, 83, 79, 81, 128, 83,
+ 79, 79, 206, 83, 79, 78, 74, 65, 77, 128, 83, 79, 78, 71, 128, 83, 79,
+ 78, 128, 83, 79, 77, 80, 69, 78, 199, 83, 79, 77, 128, 83, 79, 205, 83,
+ 79, 76, 73, 68, 85, 83, 128, 83, 79, 76, 73, 68, 85, 211, 83, 79, 76, 73,
+ 196, 83, 79, 76, 68, 73, 69, 82, 128, 83, 79, 72, 128, 83, 79, 71, 68,
+ 73, 65, 206, 83, 79, 70, 84, 87, 65, 82, 69, 45, 70, 85, 78, 67, 84, 73,
+ 79, 206, 83, 79, 70, 84, 78, 69, 83, 83, 128, 83, 79, 70, 84, 66, 65, 76,
+ 76, 128, 83, 79, 70, 212, 83, 79, 198, 83, 79, 67, 75, 83, 128, 83, 79,
+ 67, 73, 69, 84, 89, 128, 83, 79, 67, 67, 69, 210, 83, 79, 65, 80, 128,
+ 83, 79, 65, 128, 83, 79, 45, 55, 128, 83, 79, 45, 54, 128, 83, 79, 45,
+ 53, 128, 83, 79, 45, 52, 128, 83, 79, 45, 51, 128, 83, 79, 45, 50, 128,
+ 83, 79, 45, 49, 128, 83, 207, 83, 78, 79, 87, 77, 65, 78, 128, 83, 78,
+ 79, 87, 77, 65, 206, 83, 78, 79, 87, 70, 76, 65, 75, 69, 128, 83, 78, 79,
+ 87, 66, 79, 65, 82, 68, 69, 82, 128, 83, 78, 79, 87, 128, 83, 78, 79,
+ 215, 83, 78, 79, 85, 84, 128, 83, 78, 79, 85, 212, 83, 78, 69, 69, 90,
+ 73, 78, 199, 83, 78, 65, 208, 83, 78, 65, 75, 69, 128, 83, 78, 65, 75,
+ 197, 83, 78, 65, 73, 76, 128, 83, 78, 193, 83, 77, 79, 75, 73, 78, 199,
+ 83, 77, 73, 82, 75, 73, 78, 199, 83, 77, 73, 76, 73, 78, 199, 83, 77, 73,
+ 76, 69, 128, 83, 77, 73, 76, 197, 83, 77, 69, 65, 82, 128, 83, 77, 65,
+ 83, 200, 83, 77, 65, 76, 76, 69, 210, 83, 77, 65, 76, 76, 128, 83, 76,
+ 85, 82, 128, 83, 76, 79, 90, 72, 73, 84, 73, 69, 128, 83, 76, 79, 90, 72,
+ 73, 84, 73, 197, 83, 76, 79, 87, 76, 89, 128, 83, 76, 79, 87, 128, 83,
+ 76, 79, 215, 83, 76, 79, 86, 79, 128, 83, 76, 79, 84, 72, 128, 83, 76,
+ 79, 212, 83, 76, 79, 80, 73, 78, 199, 83, 76, 79, 80, 69, 128, 83, 76,
+ 79, 65, 206, 83, 76, 73, 78, 71, 128, 83, 76, 73, 71, 72, 84, 76, 217,
+ 83, 76, 73, 68, 73, 78, 71, 128, 83, 76, 73, 68, 69, 82, 128, 83, 76, 73,
+ 68, 69, 128, 83, 76, 73, 67, 69, 128, 83, 76, 73, 67, 197, 83, 76, 69,
+ 85, 84, 200, 83, 76, 69, 69, 80, 217, 83, 76, 69, 69, 80, 73, 78, 199,
+ 83, 76, 69, 69, 208, 83, 76, 69, 68, 128, 83, 76, 65, 86, 79, 78, 73,
+ 195, 83, 76, 65, 86, 69, 128, 83, 76, 65, 83, 72, 128, 83, 76, 65, 83,
+ 200, 83, 76, 65, 78, 84, 69, 196, 83, 75, 87, 65, 128, 83, 75, 87, 128,
+ 83, 75, 85, 78, 75, 128, 83, 75, 85, 76, 76, 128, 83, 75, 85, 76, 204,
+ 83, 75, 79, 66, 65, 128, 83, 75, 76, 73, 82, 79, 206, 83, 75, 73, 78,
+ 128, 83, 75, 73, 69, 82, 128, 83, 75, 201, 83, 75, 69, 87, 69, 196, 83,
+ 75, 65, 84, 69, 66, 79, 65, 82, 68, 128, 83, 75, 65, 84, 69, 128, 83, 75,
+ 65, 77, 69, 89, 84, 83, 193, 83, 75, 128, 83, 74, 69, 128, 83, 73, 90,
+ 197, 83, 73, 88, 84, 89, 45, 70, 79, 85, 82, 84, 72, 83, 128, 83, 73, 88,
+ 84, 89, 45, 70, 79, 85, 82, 84, 72, 128, 83, 73, 88, 84, 89, 45, 70, 79,
+ 85, 82, 84, 200, 83, 73, 88, 84, 89, 128, 83, 73, 88, 84, 217, 83, 73,
+ 88, 84, 72, 83, 128, 83, 73, 88, 84, 72, 211, 83, 73, 88, 84, 72, 128,
+ 83, 73, 88, 84, 69, 69, 78, 84, 72, 83, 128, 83, 73, 88, 84, 69, 69, 78,
+ 84, 72, 45, 50, 128, 83, 73, 88, 84, 69, 69, 78, 84, 72, 45, 49, 128, 83,
+ 73, 88, 84, 69, 69, 78, 84, 72, 128, 83, 73, 88, 84, 69, 69, 78, 84, 200,
+ 83, 73, 88, 84, 69, 69, 78, 128, 83, 73, 88, 84, 69, 69, 206, 83, 73, 88,
+ 45, 84, 72, 73, 82, 84, 89, 128, 83, 73, 88, 45, 83, 84, 82, 73, 78, 199,
+ 83, 73, 88, 45, 80, 69, 82, 45, 69, 205, 83, 73, 88, 45, 76, 73, 78, 197,
+ 83, 73, 216, 83, 73, 84, 69, 128, 83, 73, 83, 65, 128, 83, 73, 82, 82,
+ 65, 72, 128, 83, 73, 82, 73, 78, 71, 85, 128, 83, 73, 79, 83, 45, 84, 72,
+ 73, 69, 85, 84, 72, 128, 83, 73, 79, 83, 45, 83, 83, 65, 78, 71, 83, 73,
+ 79, 83, 128, 83, 73, 79, 83, 45, 82, 73, 69, 85, 76, 128, 83, 73, 79, 83,
+ 45, 80, 73, 69, 85, 80, 45, 75, 73, 89, 69, 79, 75, 128, 83, 73, 79, 83,
+ 45, 80, 72, 73, 69, 85, 80, 72, 128, 83, 73, 79, 83, 45, 80, 65, 78, 83,
+ 73, 79, 83, 128, 83, 73, 79, 83, 45, 78, 73, 69, 85, 78, 128, 83, 73, 79,
+ 83, 45, 77, 73, 69, 85, 77, 128, 83, 73, 79, 83, 45, 75, 72, 73, 69, 85,
+ 75, 72, 128, 83, 73, 79, 83, 45, 75, 65, 80, 89, 69, 79, 85, 78, 80, 73,
+ 69, 85, 80, 128, 83, 73, 79, 83, 45, 73, 69, 85, 78, 71, 128, 83, 73, 79,
+ 83, 45, 72, 73, 69, 85, 72, 128, 83, 73, 79, 83, 45, 67, 73, 69, 85, 67,
+ 128, 83, 73, 79, 83, 45, 67, 72, 73, 69, 85, 67, 72, 128, 83, 73, 79,
+ 211, 83, 73, 78, 85, 83, 79, 73, 196, 83, 73, 78, 79, 76, 79, 71, 73, 67,
+ 65, 204, 83, 73, 78, 78, 89, 73, 73, 89, 72, 69, 128, 83, 73, 78, 75, 73,
+ 78, 71, 128, 83, 73, 78, 71, 76, 69, 45, 83, 72, 73, 70, 84, 45, 51, 128,
+ 83, 73, 78, 71, 76, 69, 45, 83, 72, 73, 70, 84, 45, 50, 128, 83, 73, 78,
+ 71, 76, 69, 45, 76, 73, 78, 197, 83, 73, 78, 71, 76, 69, 128, 83, 73, 78,
+ 71, 76, 197, 83, 73, 78, 71, 65, 65, 84, 128, 83, 73, 78, 197, 83, 73,
+ 78, 68, 72, 201, 83, 73, 78, 128, 83, 73, 206, 83, 73, 77, 85, 76, 84,
+ 65, 78, 69, 79, 85, 83, 128, 83, 73, 77, 85, 76, 84, 65, 78, 69, 79, 85,
+ 211, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 83, 73, 77, 73, 76, 65, 82,
+ 128, 83, 73, 77, 73, 76, 65, 210, 83, 73, 77, 65, 78, 83, 73, 211, 83,
+ 73, 77, 65, 76, 85, 78, 71, 85, 206, 83, 73, 77, 65, 128, 83, 73, 76, 86,
+ 69, 82, 128, 83, 73, 76, 75, 128, 83, 73, 76, 73, 81, 85, 193, 83, 73,
+ 76, 72, 79, 85, 69, 84, 84, 69, 128, 83, 73, 76, 72, 79, 85, 69, 84, 84,
+ 197, 83, 73, 76, 65, 51, 128, 83, 73, 75, 73, 128, 83, 73, 75, 50, 128,
+ 83, 73, 75, 178, 83, 73, 71, 78, 83, 128, 83, 73, 71, 77, 79, 73, 196,
+ 83, 73, 71, 77, 65, 128, 83, 73, 71, 77, 193, 83, 73, 71, 69, 204, 83,
+ 73, 71, 52, 128, 83, 73, 71, 180, 83, 73, 71, 128, 83, 73, 69, 69, 128,
+ 83, 73, 68, 69, 87, 65, 89, 211, 83, 73, 68, 69, 128, 83, 73, 68, 197,
+ 83, 73, 68, 68, 72, 73, 128, 83, 73, 68, 68, 72, 65, 77, 128, 83, 73, 68,
+ 68, 72, 65, 205, 83, 73, 67, 75, 78, 69, 83, 83, 128, 83, 73, 67, 75, 76,
+ 69, 128, 83, 73, 66, 197, 83, 73, 65, 128, 83, 73, 45, 54, 128, 83, 73,
+ 45, 53, 128, 83, 73, 45, 52, 128, 83, 73, 45, 51, 128, 83, 73, 45, 50,
+ 128, 83, 73, 45, 49, 128, 83, 201, 83, 72, 89, 88, 128, 83, 72, 89, 84,
+ 128, 83, 72, 89, 82, 88, 128, 83, 72, 89, 82, 128, 83, 72, 89, 80, 128,
+ 83, 72, 89, 69, 128, 83, 72, 89, 65, 128, 83, 72, 89, 128, 83, 72, 87,
+ 79, 89, 128, 83, 72, 87, 79, 79, 128, 83, 72, 87, 79, 128, 83, 72, 87,
+ 73, 73, 128, 83, 72, 87, 73, 128, 83, 72, 87, 69, 128, 83, 72, 87, 197,
+ 83, 72, 87, 65, 65, 128, 83, 72, 87, 65, 128, 83, 72, 86, 128, 83, 72,
+ 85, 88, 128, 83, 72, 85, 85, 128, 83, 72, 85, 84, 84, 76, 69, 67, 79, 67,
+ 75, 128, 83, 72, 85, 84, 128, 83, 72, 85, 82, 88, 128, 83, 72, 85, 82,
+ 128, 83, 72, 85, 80, 128, 83, 72, 85, 79, 88, 128, 83, 72, 85, 79, 80,
+ 128, 83, 72, 85, 79, 128, 83, 72, 85, 77, 128, 83, 72, 85, 76, 128, 83,
+ 72, 85, 70, 70, 76, 197, 83, 72, 85, 69, 81, 128, 83, 72, 85, 69, 78, 83,
+ 72, 85, 69, 84, 128, 83, 72, 85, 66, 85, 82, 128, 83, 72, 85, 65, 78, 71,
+ 88, 73, 128, 83, 72, 85, 50, 128, 83, 72, 85, 178, 83, 72, 85, 128, 83,
+ 72, 84, 65, 80, 73, 67, 128, 83, 72, 84, 65, 128, 83, 72, 82, 85, 71,
+ 128, 83, 72, 82, 79, 79, 128, 83, 72, 82, 79, 128, 83, 72, 82, 73, 78,
+ 69, 128, 83, 72, 82, 73, 77, 80, 128, 83, 72, 82, 73, 73, 128, 83, 72,
+ 82, 73, 128, 83, 72, 82, 65, 65, 128, 83, 72, 82, 65, 128, 83, 72, 79,
+ 89, 128, 83, 72, 79, 88, 128, 83, 72, 79, 87, 69, 82, 128, 83, 72, 79,
+ 85, 76, 68, 69, 82, 69, 196, 83, 72, 79, 85, 76, 68, 69, 210, 83, 72, 79,
+ 85, 128, 83, 72, 79, 84, 128, 83, 72, 79, 82, 84, 83, 128, 83, 72, 79,
+ 82, 84, 211, 83, 72, 79, 82, 84, 72, 65, 78, 196, 83, 72, 79, 82, 84, 69,
+ 78, 69, 82, 128, 83, 72, 79, 82, 84, 67, 65, 75, 69, 128, 83, 72, 79, 82,
+ 84, 45, 84, 87, 73, 71, 45, 89, 82, 128, 83, 72, 79, 82, 84, 45, 84, 87,
+ 73, 71, 45, 84, 89, 210, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 83,
+ 79, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73, 71, 45, 79, 83, 211, 83, 72,
+ 79, 82, 84, 45, 84, 87, 73, 71, 45, 78, 65, 85, 196, 83, 72, 79, 82, 84,
+ 45, 84, 87, 73, 71, 45, 77, 65, 68, 210, 83, 72, 79, 82, 84, 45, 84, 87,
+ 73, 71, 45, 72, 65, 71, 65, 76, 204, 83, 72, 79, 82, 84, 45, 84, 87, 73,
+ 71, 45, 66, 74, 65, 82, 75, 65, 206, 83, 72, 79, 82, 84, 45, 84, 87, 73,
+ 71, 45, 65, 210, 83, 72, 79, 82, 84, 128, 83, 72, 79, 82, 212, 83, 72,
+ 79, 81, 128, 83, 72, 79, 209, 83, 72, 79, 80, 80, 73, 78, 199, 83, 72,
+ 79, 80, 128, 83, 72, 79, 79, 84, 73, 78, 199, 83, 72, 79, 79, 84, 128,
+ 83, 72, 79, 79, 73, 128, 83, 72, 79, 79, 128, 83, 72, 79, 71, 201, 83,
+ 72, 79, 199, 83, 72, 79, 69, 83, 128, 83, 72, 79, 69, 128, 83, 72, 79,
+ 197, 83, 72, 79, 67, 75, 69, 196, 83, 72, 79, 65, 128, 83, 72, 79, 128,
+ 83, 72, 73, 89, 89, 65, 65, 76, 65, 65, 128, 83, 72, 73, 84, 65, 128, 83,
+ 72, 73, 84, 193, 83, 72, 73, 82, 212, 83, 72, 73, 82, 65, 69, 128, 83,
+ 72, 73, 82, 128, 83, 72, 73, 210, 83, 72, 73, 81, 128, 83, 72, 73, 78,
+ 84, 207, 83, 72, 73, 78, 73, 71, 128, 83, 72, 73, 78, 68, 193, 83, 72,
+ 73, 206, 83, 72, 73, 77, 65, 128, 83, 72, 73, 77, 193, 83, 72, 73, 77,
+ 128, 83, 72, 73, 205, 83, 72, 73, 73, 78, 128, 83, 72, 73, 73, 128, 83,
+ 72, 73, 70, 212, 83, 72, 73, 69, 76, 68, 128, 83, 72, 73, 68, 128, 83,
+ 72, 73, 196, 83, 72, 72, 65, 128, 83, 72, 72, 193, 83, 72, 69, 88, 128,
+ 83, 72, 69, 86, 65, 128, 83, 72, 69, 85, 88, 128, 83, 72, 69, 85, 79, 81,
+ 128, 83, 72, 69, 85, 65, 69, 81, 84, 85, 128, 83, 72, 69, 85, 65, 69, 81,
+ 128, 83, 72, 69, 85, 65, 69, 128, 83, 72, 69, 84, 128, 83, 72, 69, 212,
+ 83, 72, 69, 83, 72, 76, 65, 77, 128, 83, 72, 69, 83, 72, 73, 71, 128, 83,
+ 72, 69, 83, 72, 73, 199, 83, 72, 69, 83, 72, 50, 128, 83, 72, 69, 83, 72,
+ 128, 83, 72, 69, 83, 200, 83, 72, 69, 81, 69, 204, 83, 72, 69, 80, 128,
+ 83, 72, 69, 78, 128, 83, 72, 69, 76, 76, 128, 83, 72, 69, 76, 204, 83,
+ 72, 69, 76, 70, 128, 83, 72, 69, 73, 128, 83, 72, 69, 71, 57, 128, 83,
+ 72, 69, 69, 80, 128, 83, 72, 69, 69, 78, 85, 128, 83, 72, 69, 69, 78,
+ 128, 83, 72, 69, 69, 206, 83, 72, 69, 69, 128, 83, 72, 69, 45, 71, 79,
+ 65, 84, 128, 83, 72, 197, 83, 72, 67, 72, 79, 79, 73, 128, 83, 72, 67,
+ 72, 65, 128, 83, 72, 65, 89, 128, 83, 72, 65, 88, 128, 83, 72, 65, 86,
+ 73, 89, 65, 78, 73, 128, 83, 72, 65, 86, 73, 65, 206, 83, 72, 65, 86, 69,
+ 196, 83, 72, 65, 85, 128, 83, 72, 65, 84, 128, 83, 72, 65, 82, 85, 128,
+ 83, 72, 65, 82, 213, 83, 72, 65, 82, 80, 128, 83, 72, 65, 82, 208, 83,
+ 72, 65, 82, 75, 128, 83, 72, 65, 82, 65, 68, 193, 83, 72, 65, 82, 65,
+ 128, 83, 72, 65, 82, 50, 128, 83, 72, 65, 82, 178, 83, 72, 65, 80, 73,
+ 78, 71, 128, 83, 72, 65, 80, 69, 83, 128, 83, 72, 65, 80, 197, 83, 72,
+ 65, 80, 128, 83, 72, 65, 78, 71, 128, 83, 72, 65, 78, 128, 83, 72, 65,
+ 206, 83, 72, 65, 77, 82, 79, 67, 75, 128, 83, 72, 65, 76, 83, 72, 69, 76,
+ 69, 84, 128, 83, 72, 65, 76, 76, 79, 215, 83, 72, 65, 75, 84, 73, 128,
+ 83, 72, 65, 75, 73, 78, 71, 128, 83, 72, 65, 75, 73, 78, 199, 83, 72, 65,
+ 75, 69, 82, 128, 83, 72, 65, 75, 128, 83, 72, 65, 73, 128, 83, 72, 65,
+ 70, 84, 128, 83, 72, 65, 70, 212, 83, 72, 65, 68, 79, 87, 69, 196, 83,
+ 72, 65, 68, 69, 196, 83, 72, 65, 68, 69, 128, 83, 72, 65, 68, 197, 83,
+ 72, 65, 68, 68, 65, 128, 83, 72, 65, 68, 68, 193, 83, 72, 65, 68, 128,
+ 83, 72, 65, 196, 83, 72, 65, 66, 54, 128, 83, 72, 65, 65, 128, 83, 72,
+ 65, 54, 128, 83, 72, 65, 182, 83, 72, 65, 51, 128, 83, 72, 65, 179, 83,
+ 71, 82, 193, 83, 71, 79, 210, 83, 71, 67, 128, 83, 71, 65, 215, 83, 71,
+ 65, 194, 83, 71, 128, 83, 69, 89, 75, 128, 83, 69, 88, 84, 85, 76, 193,
+ 83, 69, 88, 84, 73, 76, 69, 128, 83, 69, 88, 84, 65, 78, 84, 45, 54, 128,
+ 83, 69, 88, 84, 65, 78, 84, 45, 53, 54, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 53, 128, 83, 69, 88, 84, 65, 78, 84, 45, 52, 54, 128, 83, 69, 88, 84,
+ 65, 78, 84, 45, 52, 53, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 52, 53,
+ 128, 83, 69, 88, 84, 65, 78, 84, 45, 52, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 51, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 51, 53, 54, 128, 83, 69,
+ 88, 84, 65, 78, 84, 45, 51, 53, 128, 83, 69, 88, 84, 65, 78, 84, 45, 51,
+ 52, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 51, 52, 53, 54, 128, 83, 69,
+ 88, 84, 65, 78, 84, 45, 51, 52, 53, 128, 83, 69, 88, 84, 65, 78, 84, 45,
+ 51, 52, 128, 83, 69, 88, 84, 65, 78, 84, 45, 51, 128, 83, 69, 88, 84, 65,
+ 78, 84, 45, 50, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 50, 53, 54, 128,
+ 83, 69, 88, 84, 65, 78, 84, 45, 50, 53, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 50, 52, 53, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 50, 52, 53, 128,
+ 83, 69, 88, 84, 65, 78, 84, 45, 50, 52, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 50, 51, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 50, 51, 53, 54, 128,
+ 83, 69, 88, 84, 65, 78, 84, 45, 50, 51, 53, 128, 83, 69, 88, 84, 65, 78,
+ 84, 45, 50, 51, 52, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 50, 51, 52,
+ 53, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 50, 51, 52, 53, 128, 83, 69,
+ 88, 84, 65, 78, 84, 45, 50, 51, 52, 128, 83, 69, 88, 84, 65, 78, 84, 45,
+ 50, 51, 128, 83, 69, 88, 84, 65, 78, 84, 45, 50, 128, 83, 69, 88, 84, 65,
+ 78, 84, 45, 49, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 53, 54, 128,
+ 83, 69, 88, 84, 65, 78, 84, 45, 49, 53, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 49, 52, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 52, 53, 54, 128,
+ 83, 69, 88, 84, 65, 78, 84, 45, 49, 52, 53, 128, 83, 69, 88, 84, 65, 78,
+ 84, 45, 49, 52, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 51, 54, 128, 83,
+ 69, 88, 84, 65, 78, 84, 45, 49, 51, 53, 54, 128, 83, 69, 88, 84, 65, 78,
+ 84, 45, 49, 51, 52, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 51, 52,
+ 53, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 51, 52, 53, 128, 83, 69,
+ 88, 84, 65, 78, 84, 45, 49, 51, 52, 128, 83, 69, 88, 84, 65, 78, 84, 45,
+ 49, 51, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50, 54, 128, 83, 69, 88,
+ 84, 65, 78, 84, 45, 49, 50, 53, 54, 128, 83, 69, 88, 84, 65, 78, 84, 45,
+ 49, 50, 53, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50, 52, 54, 128, 83,
+ 69, 88, 84, 65, 78, 84, 45, 49, 50, 52, 53, 54, 128, 83, 69, 88, 84, 65,
+ 78, 84, 45, 49, 50, 52, 53, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50,
+ 52, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50, 51, 54, 128, 83, 69, 88,
+ 84, 65, 78, 84, 45, 49, 50, 51, 53, 54, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 49, 50, 51, 53, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50, 51, 52,
+ 54, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50, 51, 52, 53, 128, 83, 69,
+ 88, 84, 65, 78, 84, 45, 49, 50, 51, 52, 128, 83, 69, 88, 84, 65, 78, 84,
+ 45, 49, 50, 51, 128, 83, 69, 88, 84, 65, 78, 84, 45, 49, 50, 128, 83, 69,
+ 88, 84, 65, 78, 84, 45, 49, 128, 83, 69, 88, 84, 65, 78, 211, 83, 69, 87,
+ 73, 78, 199, 83, 69, 86, 69, 82, 65, 78, 67, 69, 128, 83, 69, 86, 69, 78,
+ 84, 89, 128, 83, 69, 86, 69, 78, 84, 217, 83, 69, 86, 69, 78, 84, 72,
+ 128, 83, 69, 86, 69, 78, 84, 69, 69, 78, 128, 83, 69, 86, 69, 78, 84, 69,
+ 69, 206, 83, 69, 86, 69, 78, 45, 84, 72, 73, 82, 84, 89, 128, 83, 69, 86,
+ 69, 206, 83, 69, 85, 88, 128, 83, 69, 85, 78, 89, 65, 77, 128, 83, 69,
+ 85, 65, 69, 81, 128, 83, 69, 84, 70, 79, 78, 128, 83, 69, 83, 84, 69, 82,
+ 84, 73, 85, 211, 83, 69, 83, 81, 85, 73, 81, 85, 65, 68, 82, 65, 84, 69,
+ 128, 83, 69, 83, 65, 77, 197, 83, 69, 82, 86, 73, 67, 197, 83, 69, 82,
+ 73, 79, 85, 211, 83, 69, 82, 73, 70, 83, 128, 83, 69, 82, 73, 70, 211,
+ 83, 69, 82, 73, 70, 128, 83, 69, 81, 85, 69, 78, 84, 73, 65, 76, 128, 83,
+ 69, 81, 85, 69, 78, 67, 197, 83, 69, 80, 84, 85, 80, 76, 197, 83, 69, 80,
+ 84, 69, 77, 66, 69, 82, 128, 83, 69, 80, 65, 82, 65, 84, 79, 82, 128, 83,
+ 69, 80, 65, 82, 65, 84, 79, 210, 83, 69, 80, 65, 82, 65, 84, 69, 196, 83,
+ 69, 78, 84, 79, 128, 83, 69, 78, 84, 73, 128, 83, 69, 78, 84, 65, 71, 79,
+ 78, 128, 83, 69, 77, 85, 78, 67, 73, 193, 83, 69, 77, 75, 65, 84, 72,
+ 128, 83, 69, 77, 75, 128, 83, 69, 77, 73, 86, 79, 87, 69, 204, 83, 69,
+ 77, 73, 83, 79, 70, 212, 83, 69, 77, 73, 83, 69, 88, 84, 73, 76, 69, 128,
+ 83, 69, 77, 73, 77, 73, 78, 73, 77, 193, 83, 69, 77, 73, 68, 73, 82, 69,
+ 67, 212, 83, 69, 77, 73, 67, 79, 76, 79, 78, 128, 83, 69, 77, 73, 67, 79,
+ 76, 79, 206, 83, 69, 77, 73, 67, 73, 82, 67, 85, 76, 65, 210, 83, 69, 77,
+ 73, 67, 73, 82, 67, 76, 197, 83, 69, 77, 73, 66, 82, 69, 86, 73, 211, 83,
+ 69, 77, 73, 45, 86, 79, 73, 67, 69, 196, 83, 69, 76, 70, 73, 69, 128, 83,
+ 69, 76, 70, 128, 83, 69, 76, 69, 78, 65, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 57, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 56, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 57, 55, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 57, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 53, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 57, 52, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 57, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 50, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 57, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 57, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 56, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 55, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 56, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 56, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 52, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 56, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 56, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 56, 49, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 56, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 57, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 55, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 55, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 54, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 55, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 51, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 55, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 55, 48, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54,
+ 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 56, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 54, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54,
+ 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 53, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 54, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54,
+ 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 50, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 54, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54,
+ 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 54, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 53, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 56,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 55, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 53,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 52, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 50,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 49, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 53, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 57, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 55, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 54, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 52, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 51, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 49, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 52, 48, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 57, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 54, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 51, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 51, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 51, 48, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 56, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 54, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 53, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 53, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53,
+ 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 50, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 53, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 53, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 53, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 57, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 52, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52,
+ 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 54, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 52, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 52, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 51, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 50, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 52, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
+ 52, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 52, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 51, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 51, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 55, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 54, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 51, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
+ 51, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 51, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 50, 51, 50, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 50, 51, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 48,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 51, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 50, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50,
+ 50, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 55, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 50, 50, 54, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 50, 50, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 52,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 51, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 48, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 50, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 50, 49, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 56,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 55, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 50, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 52, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 51, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 49, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49,
+ 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 49, 48, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 50, 48, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 56, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 55, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 50, 48, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48,
+ 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 52, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 50, 48, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 50, 48, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 49, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 48, 48, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 50, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 57, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 57, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 57, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 54, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 57, 53, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 57, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 51,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 50, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 57, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 57, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 57, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 56, 57, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 56, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 55,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 54, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 56, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 56, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 51, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 50, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 56, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56,
+ 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 56, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 55, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 55, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 55, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 54, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 55, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55,
+ 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 51, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 55, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 55, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 48, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 55, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 54, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54,
+ 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 55, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 54, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 54, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 52, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 51, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 54, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 54, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 54, 48, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 53, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 56, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 55, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 53, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 53, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 52, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 53, 51, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 53, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 49,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 53, 48, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 53, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 52, 57, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 56, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 52, 55, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 52, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 53,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 52, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 52, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 52, 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 49, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 52, 48, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 57,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 56, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 51, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 51, 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 53, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 52, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 51, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51,
+ 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 51, 49, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 51, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 57, 128, 83,
+ 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 56, 128, 83, 69, 76, 69, 67, 84,
+ 79, 82, 45, 49, 50, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50,
+ 54, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 53, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 50, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 50, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 50, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 50, 49, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 50, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 50, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 57, 128, 83, 69, 76,
+ 69, 67, 84, 79, 82, 45, 49, 49, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82,
+ 45, 49, 49, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 54, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 53, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 49, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 49, 51, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 50, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 49, 49, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 49, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 49, 128,
+ 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 57, 128, 83, 69, 76, 69, 67,
+ 84, 79, 82, 45, 49, 48, 56, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49,
+ 48, 55, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 54, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 48, 53, 128, 83, 69, 76, 69, 67, 84, 79,
+ 82, 45, 49, 48, 52, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 51,
+ 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 50, 128, 83, 69, 76, 69,
+ 67, 84, 79, 82, 45, 49, 48, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45,
+ 49, 48, 48, 128, 83, 69, 76, 69, 67, 84, 79, 82, 45, 49, 48, 128, 83, 69,
+ 76, 69, 67, 84, 79, 82, 45, 49, 128, 83, 69, 76, 69, 67, 84, 79, 82, 128,
+ 83, 69, 76, 69, 67, 84, 79, 210, 83, 69, 76, 69, 67, 84, 69, 196, 83, 69,
+ 73, 83, 77, 65, 128, 83, 69, 73, 83, 77, 193, 83, 69, 72, 128, 83, 69,
+ 71, 79, 76, 128, 83, 69, 71, 78, 79, 128, 83, 69, 71, 77, 69, 78, 84, 69,
+ 196, 83, 69, 71, 77, 69, 78, 84, 128, 83, 69, 69, 86, 128, 83, 69, 69,
+ 78, 85, 128, 83, 69, 69, 78, 128, 83, 69, 69, 206, 83, 69, 69, 68, 76,
+ 73, 78, 71, 128, 83, 69, 69, 45, 78, 79, 45, 69, 86, 73, 204, 83, 69, 68,
+ 78, 65, 128, 83, 69, 67, 84, 79, 82, 128, 83, 69, 67, 84, 73, 79, 78,
+ 128, 83, 69, 67, 84, 73, 79, 206, 83, 69, 67, 82, 69, 84, 128, 83, 69,
+ 67, 65, 78, 84, 128, 83, 69, 66, 65, 84, 66, 69, 73, 212, 83, 69, 65, 84,
+ 128, 83, 69, 65, 76, 128, 83, 69, 65, 71, 85, 76, 204, 83, 69, 45, 53,
+ 128, 83, 69, 45, 52, 128, 83, 69, 45, 51, 128, 83, 68, 79, 78, 199, 83,
+ 68, 128, 83, 67, 87, 65, 128, 83, 67, 82, 85, 80, 76, 69, 128, 83, 67,
+ 82, 79, 76, 76, 128, 83, 67, 82, 73, 80, 84, 128, 83, 67, 82, 69, 87, 68,
+ 82, 73, 86, 69, 82, 128, 83, 67, 82, 69, 69, 78, 128, 83, 67, 82, 69, 69,
+ 206, 83, 67, 82, 69, 65, 77, 73, 78, 199, 83, 67, 79, 84, 211, 83, 67,
+ 79, 82, 80, 73, 85, 83, 128, 83, 67, 79, 82, 80, 73, 79, 78, 128, 83, 67,
+ 79, 82, 69, 128, 83, 67, 79, 79, 84, 69, 82, 128, 83, 67, 73, 83, 83, 79,
+ 82, 83, 128, 83, 67, 73, 128, 83, 67, 72, 87, 65, 128, 83, 67, 72, 87,
+ 193, 83, 67, 72, 82, 79, 69, 68, 69, 82, 128, 83, 67, 72, 79, 79, 76,
+ 128, 83, 67, 72, 79, 79, 204, 83, 67, 72, 79, 76, 65, 82, 128, 83, 67,
+ 72, 69, 77, 193, 83, 67, 69, 80, 84, 69, 210, 83, 67, 65, 82, 70, 128,
+ 83, 67, 65, 78, 68, 73, 67, 85, 83, 128, 83, 67, 65, 78, 68, 73, 67, 85,
+ 211, 83, 67, 65, 206, 83, 67, 65, 76, 69, 83, 128, 83, 66, 85, 194, 83,
+ 66, 82, 85, 204, 83, 65, 89, 73, 83, 201, 83, 65, 89, 65, 78, 78, 65,
+ 128, 83, 65, 89, 128, 83, 65, 88, 79, 80, 72, 79, 78, 69, 128, 83, 65,
+ 88, 73, 77, 65, 84, 65, 128, 83, 65, 87, 65, 78, 128, 83, 65, 87, 128,
+ 83, 65, 86, 79, 85, 82, 73, 78, 199, 83, 65, 85, 82, 79, 80, 79, 68, 128,
+ 83, 65, 85, 82, 65, 83, 72, 84, 82, 193, 83, 65, 85, 73, 76, 128, 83, 65,
+ 85, 67, 69, 82, 128, 83, 65, 84, 85, 82, 78, 128, 83, 65, 84, 75, 65, 65,
+ 78, 75, 85, 85, 128, 83, 65, 84, 75, 65, 65, 78, 128, 83, 65, 84, 69, 76,
+ 76, 73, 84, 69, 128, 83, 65, 84, 69, 76, 76, 73, 84, 197, 83, 65, 84, 67,
+ 72, 69, 76, 128, 83, 65, 84, 65, 78, 71, 65, 128, 83, 65, 83, 72, 128,
+ 83, 65, 83, 65, 75, 128, 83, 65, 82, 73, 128, 83, 65, 82, 193, 83, 65,
+ 82, 128, 83, 65, 81, 128, 83, 65, 80, 65, 128, 83, 65, 78, 89, 79, 79,
+ 71, 193, 83, 65, 78, 89, 65, 75, 193, 83, 65, 78, 84, 73, 73, 77, 85,
+ 128, 83, 65, 78, 83, 75, 82, 73, 212, 83, 65, 78, 78, 89, 65, 128, 83,
+ 65, 78, 71, 65, 50, 128, 83, 65, 78, 68, 87, 73, 67, 72, 128, 83, 65, 78,
+ 68, 72, 201, 83, 65, 78, 68, 65, 76, 128, 83, 65, 78, 65, 72, 128, 83,
+ 65, 78, 128, 83, 65, 77, 89, 79, 203, 83, 65, 77, 86, 65, 84, 128, 83,
+ 65, 77, 80, 73, 128, 83, 65, 77, 80, 72, 65, 79, 128, 83, 65, 77, 75, 65,
+ 128, 83, 65, 77, 69, 75, 72, 128, 83, 65, 77, 69, 75, 200, 83, 65, 77,
+ 66, 65, 128, 83, 65, 77, 65, 82, 73, 84, 65, 206, 83, 65, 77, 128, 83,
+ 65, 76, 85, 84, 73, 78, 199, 83, 65, 76, 84, 73, 82, 69, 128, 83, 65, 76,
+ 84, 73, 82, 197, 83, 65, 76, 84, 73, 76, 76, 79, 128, 83, 65, 76, 84, 45,
+ 50, 128, 83, 65, 76, 84, 128, 83, 65, 76, 212, 83, 65, 76, 76, 65, 76,
+ 76, 65, 72, 213, 83, 65, 76, 76, 65, 76, 76, 65, 72, 79, 213, 83, 65, 76,
+ 76, 65, 76, 76, 65, 65, 72, 213, 83, 65, 76, 76, 193, 83, 65, 76, 65,
+ 205, 83, 65, 76, 65, 68, 128, 83, 65, 76, 65, 65, 77, 85, 72, 213, 83,
+ 65, 76, 65, 128, 83, 65, 76, 45, 65, 77, 77, 79, 78, 73, 65, 67, 128, 83,
+ 65, 76, 128, 83, 65, 75, 84, 65, 128, 83, 65, 75, 79, 84, 128, 83, 65,
+ 75, 73, 78, 128, 83, 65, 75, 72, 193, 83, 65, 75, 69, 85, 65, 69, 128,
+ 83, 65, 75, 197, 83, 65, 74, 68, 65, 72, 128, 83, 65, 73, 76, 66, 79, 65,
+ 84, 128, 83, 65, 73, 76, 128, 83, 65, 73, 75, 85, 82, 85, 128, 83, 65,
+ 72, 128, 83, 65, 71, 73, 84, 84, 65, 82, 73, 85, 83, 128, 83, 65, 71, 65,
+ 128, 83, 65, 71, 128, 83, 65, 199, 83, 65, 70, 72, 65, 128, 83, 65, 70,
+ 69, 84, 217, 83, 65, 68, 72, 69, 128, 83, 65, 68, 72, 197, 83, 65, 68,
+ 69, 128, 83, 65, 68, 128, 83, 65, 196, 83, 65, 67, 82, 73, 70, 73, 67,
+ 73, 65, 204, 83, 65, 65, 73, 128, 83, 65, 65, 68, 72, 85, 128, 83, 65,
+ 45, 73, 128, 83, 65, 45, 56, 128, 83, 65, 45, 55, 128, 83, 65, 45, 54,
+ 128, 83, 65, 45, 53, 128, 83, 65, 45, 52, 128, 83, 65, 45, 51, 128, 83,
+ 65, 45, 50, 128, 83, 65, 45, 49, 128, 83, 48, 52, 54, 128, 83, 48, 52,
+ 53, 128, 83, 48, 52, 52, 128, 83, 48, 52, 51, 128, 83, 48, 52, 50, 128,
+ 83, 48, 52, 49, 128, 83, 48, 52, 48, 128, 83, 48, 51, 57, 128, 83, 48,
+ 51, 56, 128, 83, 48, 51, 55, 128, 83, 48, 51, 54, 128, 83, 48, 51, 53,
+ 65, 128, 83, 48, 51, 53, 128, 83, 48, 51, 52, 128, 83, 48, 51, 51, 128,
+ 83, 48, 51, 50, 128, 83, 48, 51, 49, 128, 83, 48, 51, 48, 128, 83, 48,
+ 50, 57, 128, 83, 48, 50, 56, 128, 83, 48, 50, 55, 128, 83, 48, 50, 54,
+ 66, 128, 83, 48, 50, 54, 65, 128, 83, 48, 50, 54, 128, 83, 48, 50, 53,
+ 128, 83, 48, 50, 52, 128, 83, 48, 50, 51, 128, 83, 48, 50, 50, 128, 83,
+ 48, 50, 49, 128, 83, 48, 50, 48, 128, 83, 48, 49, 57, 128, 83, 48, 49,
+ 56, 128, 83, 48, 49, 55, 65, 128, 83, 48, 49, 55, 128, 83, 48, 49, 54,
+ 128, 83, 48, 49, 53, 128, 83, 48, 49, 52, 66, 128, 83, 48, 49, 52, 65,
+ 128, 83, 48, 49, 52, 128, 83, 48, 49, 51, 128, 83, 48, 49, 50, 128, 83,
+ 48, 49, 49, 128, 83, 48, 49, 48, 128, 83, 48, 48, 57, 128, 83, 48, 48,
+ 56, 128, 83, 48, 48, 55, 128, 83, 48, 48, 54, 65, 128, 83, 48, 48, 54,
+ 128, 83, 48, 48, 53, 128, 83, 48, 48, 52, 128, 83, 48, 48, 51, 128, 83,
+ 48, 48, 50, 65, 128, 83, 48, 48, 50, 128, 83, 48, 48, 49, 128, 83, 45,
+ 87, 128, 83, 45, 83, 72, 65, 80, 69, 196, 82, 89, 89, 128, 82, 89, 88,
+ 128, 82, 89, 84, 128, 82, 89, 82, 88, 128, 82, 89, 82, 128, 82, 89, 80,
+ 128, 82, 87, 79, 79, 128, 82, 87, 79, 128, 82, 87, 73, 73, 128, 82, 87,
+ 73, 128, 82, 87, 69, 69, 128, 82, 87, 69, 128, 82, 87, 65, 72, 65, 128,
+ 82, 87, 65, 65, 128, 82, 87, 65, 128, 82, 85, 88, 128, 82, 85, 85, 66,
+ 85, 82, 85, 128, 82, 85, 85, 128, 82, 85, 84, 128, 82, 85, 83, 83, 73,
+ 65, 206, 82, 85, 83, 73, 128, 82, 85, 82, 88, 128, 82, 85, 82, 128, 82,
+ 85, 80, 73, 73, 128, 82, 85, 80, 69, 197, 82, 85, 80, 128, 82, 85, 79,
+ 88, 128, 82, 85, 79, 80, 128, 82, 85, 79, 128, 82, 85, 78, 79, 85, 84,
+ 128, 82, 85, 78, 78, 73, 78, 199, 82, 85, 78, 78, 69, 82, 128, 82, 85,
+ 78, 73, 195, 82, 85, 78, 128, 82, 85, 77, 201, 82, 85, 77, 65, 201, 82,
+ 85, 77, 128, 82, 85, 205, 82, 85, 76, 69, 82, 128, 82, 85, 76, 69, 45,
+ 68, 69, 76, 65, 89, 69, 68, 128, 82, 85, 76, 69, 128, 82, 85, 76, 65, 73,
+ 128, 82, 85, 75, 75, 65, 75, 72, 65, 128, 82, 85, 73, 83, 128, 82, 85,
+ 71, 66, 217, 82, 85, 68, 73, 77, 69, 78, 84, 193, 82, 85, 66, 76, 197,
+ 82, 85, 194, 82, 85, 65, 128, 82, 85, 45, 54, 128, 82, 85, 45, 53, 128,
+ 82, 85, 45, 52, 128, 82, 85, 45, 51, 128, 82, 85, 45, 50, 128, 82, 85,
+ 45, 49, 128, 82, 84, 72, 65, 78, 199, 82, 84, 69, 128, 82, 84, 65, 71,
+ 83, 128, 82, 84, 65, 71, 211, 82, 82, 89, 88, 128, 82, 82, 89, 84, 128,
+ 82, 82, 89, 82, 88, 128, 82, 82, 89, 82, 128, 82, 82, 89, 80, 128, 82,
+ 82, 85, 88, 128, 82, 82, 85, 85, 128, 82, 82, 85, 84, 128, 82, 82, 85,
+ 82, 88, 128, 82, 82, 85, 82, 128, 82, 82, 85, 80, 128, 82, 82, 85, 79,
+ 88, 128, 82, 82, 85, 79, 128, 82, 82, 85, 128, 82, 82, 82, 65, 128, 82,
+ 82, 79, 88, 128, 82, 82, 79, 84, 128, 82, 82, 79, 80, 128, 82, 82, 79,
+ 79, 128, 82, 82, 79, 128, 82, 82, 73, 73, 128, 82, 82, 73, 128, 82, 82,
+ 69, 88, 128, 82, 82, 69, 84, 128, 82, 82, 69, 80, 128, 82, 82, 69, 72,
+ 128, 82, 82, 69, 200, 82, 82, 69, 69, 128, 82, 82, 69, 128, 82, 82, 65,
+ 88, 128, 82, 82, 65, 85, 128, 82, 82, 65, 73, 128, 82, 82, 65, 65, 128,
+ 82, 79, 87, 66, 79, 65, 84, 128, 82, 79, 85, 78, 68, 69, 196, 82, 79, 85,
+ 78, 68, 45, 84, 73, 80, 80, 69, 196, 82, 79, 84, 85, 78, 68, 65, 128, 82,
+ 79, 84, 65, 84, 73, 79, 78, 83, 128, 82, 79, 84, 65, 84, 73, 79, 78, 45,
+ 87, 65, 76, 76, 80, 76, 65, 78, 197, 82, 79, 84, 65, 84, 73, 79, 78, 45,
+ 70, 76, 79, 79, 82, 80, 76, 65, 78, 197, 82, 79, 84, 65, 84, 73, 79, 78,
+ 128, 82, 79, 84, 65, 84, 73, 79, 206, 82, 79, 84, 65, 84, 69, 196, 82,
+ 79, 83, 72, 128, 82, 79, 83, 69, 84, 84, 69, 128, 82, 79, 83, 69, 128,
+ 82, 79, 79, 84, 128, 82, 79, 79, 83, 84, 69, 82, 128, 82, 79, 79, 77,
+ 128, 82, 79, 79, 75, 128, 82, 79, 79, 203, 82, 79, 79, 70, 128, 82, 79,
+ 77, 65, 78, 73, 65, 206, 82, 79, 77, 65, 206, 82, 79, 77, 128, 82, 79,
+ 76, 76, 73, 78, 199, 82, 79, 76, 76, 69, 210, 82, 79, 76, 76, 69, 68, 45,
+ 85, 208, 82, 79, 76, 204, 82, 79, 72, 73, 78, 71, 89, 193, 82, 79, 71,
+ 79, 77, 128, 82, 79, 71, 128, 82, 79, 196, 82, 79, 67, 75, 69, 84, 128,
+ 82, 79, 67, 203, 82, 79, 67, 128, 82, 79, 66, 79, 212, 82, 79, 66, 65,
+ 84, 128, 82, 79, 65, 83, 84, 69, 196, 82, 79, 65, 82, 128, 82, 79, 65,
+ 128, 82, 79, 45, 54, 128, 82, 79, 45, 53, 128, 82, 79, 45, 52, 128, 82,
+ 79, 45, 51, 128, 82, 79, 45, 50, 128, 82, 79, 45, 49, 128, 82, 78, 89,
+ 73, 78, 199, 82, 78, 79, 79, 78, 128, 82, 78, 79, 79, 206, 82, 78, 65,
+ 205, 82, 77, 84, 128, 82, 76, 79, 128, 82, 76, 77, 128, 82, 76, 73, 128,
+ 82, 76, 69, 128, 82, 74, 69, 211, 82, 74, 69, 128, 82, 74, 197, 82, 73,
+ 84, 85, 65, 76, 128, 82, 73, 84, 84, 79, 82, 85, 128, 82, 73, 84, 83, 73,
+ 128, 82, 73, 83, 73, 78, 199, 82, 73, 83, 72, 128, 82, 73, 82, 65, 128,
+ 82, 73, 80, 80, 76, 197, 82, 73, 80, 128, 82, 73, 78, 71, 211, 82, 73,
+ 78, 71, 73, 78, 199, 82, 73, 78, 71, 69, 196, 82, 73, 78, 70, 79, 82, 90,
+ 65, 78, 68, 79, 128, 82, 73, 206, 82, 73, 77, 71, 66, 65, 128, 82, 73,
+ 77, 128, 82, 73, 75, 82, 73, 75, 128, 82, 73, 71, 86, 69, 68, 73, 195,
+ 82, 73, 71, 72, 84, 87, 65, 82, 68, 83, 128, 82, 73, 71, 72, 84, 72, 65,
+ 78, 196, 82, 73, 71, 72, 84, 45, 84, 79, 45, 76, 69, 70, 212, 82, 73, 71,
+ 72, 84, 45, 83, 73, 68, 197, 82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 79,
+ 87, 69, 196, 82, 73, 71, 72, 84, 45, 83, 72, 65, 68, 69, 196, 82, 73, 71,
+ 72, 84, 45, 80, 79, 73, 78, 84, 73, 78, 199, 82, 73, 71, 72, 84, 45, 76,
+ 73, 71, 72, 84, 69, 196, 82, 73, 71, 72, 84, 45, 72, 65, 78, 68, 69, 196,
+ 82, 73, 71, 72, 84, 45, 72, 65, 78, 196, 82, 73, 71, 72, 84, 45, 70, 65,
+ 67, 73, 78, 199, 82, 73, 70, 76, 69, 128, 82, 73, 69, 85, 76, 45, 89, 69,
+ 83, 73, 69, 85, 78, 71, 128, 82, 73, 69, 85, 76, 45, 89, 69, 79, 82, 73,
+ 78, 72, 73, 69, 85, 72, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76,
+ 45, 89, 69, 79, 82, 73, 78, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76,
+ 45, 84, 73, 75, 69, 85, 84, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85,
+ 76, 45, 84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 45, 84, 72, 73,
+ 69, 85, 84, 72, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 84, 73,
+ 75, 69, 85, 84, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 83, 73,
+ 79, 83, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 80, 73, 69, 85,
+ 80, 128, 82, 73, 69, 85, 76, 45, 83, 83, 65, 78, 71, 75, 73, 89, 69, 79,
+ 75, 128, 82, 73, 69, 85, 76, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76,
+ 45, 80, 73, 69, 85, 80, 45, 84, 73, 75, 69, 85, 84, 128, 82, 73, 69, 85,
+ 76, 45, 80, 73, 69, 85, 80, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76,
+ 45, 80, 73, 69, 85, 80, 45, 80, 72, 73, 69, 85, 80, 72, 128, 82, 73, 69,
+ 85, 76, 45, 80, 73, 69, 85, 80, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69,
+ 85, 76, 45, 80, 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 80, 72, 73,
+ 69, 85, 80, 72, 128, 82, 73, 69, 85, 76, 45, 80, 65, 78, 83, 73, 79, 83,
+ 128, 82, 73, 69, 85, 76, 45, 78, 73, 69, 85, 78, 128, 82, 73, 69, 85, 76,
+ 45, 77, 73, 69, 85, 77, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45,
+ 77, 73, 69, 85, 77, 45, 75, 73, 89, 69, 79, 75, 128, 82, 73, 69, 85, 76,
+ 45, 77, 73, 69, 85, 77, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76,
+ 45, 77, 73, 69, 85, 77, 128, 82, 73, 69, 85, 76, 45, 75, 73, 89, 69, 79,
+ 75, 45, 83, 73, 79, 83, 128, 82, 73, 69, 85, 76, 45, 75, 73, 89, 69, 79,
+ 75, 45, 72, 73, 69, 85, 72, 128, 82, 73, 69, 85, 76, 45, 75, 73, 89, 69,
+ 79, 75, 128, 82, 73, 69, 85, 76, 45, 75, 65, 80, 89, 69, 79, 85, 78, 80,
+ 73, 69, 85, 80, 128, 82, 73, 69, 85, 76, 45, 72, 73, 69, 85, 72, 128, 82,
+ 73, 69, 85, 76, 45, 67, 73, 69, 85, 67, 128, 82, 73, 69, 85, 204, 82, 73,
+ 69, 76, 128, 82, 73, 69, 69, 128, 82, 73, 67, 75, 83, 72, 65, 87, 128,
+ 82, 73, 67, 69, 77, 128, 82, 73, 67, 69, 128, 82, 73, 67, 197, 82, 73,
+ 66, 66, 79, 78, 128, 82, 73, 66, 66, 79, 206, 82, 73, 65, 204, 82, 73,
+ 45, 55, 128, 82, 73, 45, 54, 128, 82, 73, 45, 53, 128, 82, 73, 45, 52,
+ 128, 82, 73, 45, 51, 128, 82, 73, 45, 50, 128, 82, 73, 45, 49, 128, 82,
+ 72, 79, 84, 73, 195, 82, 72, 79, 128, 82, 72, 207, 82, 72, 73, 78, 79,
+ 67, 69, 82, 79, 83, 128, 82, 72, 65, 128, 82, 72, 128, 82, 71, 89, 73,
+ 78, 71, 83, 128, 82, 71, 89, 65, 78, 128, 82, 71, 89, 193, 82, 69, 86,
+ 79, 76, 86, 73, 78, 199, 82, 69, 86, 79, 76, 85, 84, 73, 79, 78, 128, 82,
+ 69, 86, 77, 65, 128, 82, 69, 86, 73, 65, 128, 82, 69, 86, 69, 82, 83, 69,
+ 68, 45, 83, 67, 72, 87, 65, 128, 82, 69, 86, 69, 82, 83, 69, 68, 128, 82,
+ 69, 86, 69, 82, 83, 69, 196, 82, 69, 86, 69, 82, 83, 197, 82, 69, 85, 88,
+ 128, 82, 69, 85, 128, 82, 69, 84, 85, 82, 78, 128, 82, 69, 84, 85, 82,
+ 206, 82, 69, 84, 82, 79, 70, 76, 69, 216, 82, 69, 84, 82, 69, 65, 84,
+ 128, 82, 69, 84, 79, 82, 84, 128, 82, 69, 83, 85, 80, 73, 78, 85, 83,
+ 128, 82, 69, 83, 84, 82, 79, 79, 77, 128, 82, 69, 83, 84, 82, 73, 67, 84,
+ 69, 196, 82, 69, 83, 84, 128, 82, 69, 83, 80, 79, 78, 83, 69, 128, 82,
+ 69, 83, 79, 85, 82, 67, 69, 128, 82, 69, 83, 79, 76, 85, 84, 73, 79, 78,
+ 128, 82, 69, 83, 73, 83, 84, 65, 78, 67, 69, 128, 82, 69, 83, 73, 68, 69,
+ 78, 67, 69, 128, 82, 69, 83, 72, 45, 65, 89, 73, 78, 45, 68, 65, 76, 69,
+ 84, 72, 128, 82, 69, 83, 72, 45, 65, 89, 73, 78, 128, 82, 69, 83, 200,
+ 82, 69, 82, 69, 78, 71, 71, 65, 78, 128, 82, 69, 82, 69, 75, 65, 78, 128,
+ 82, 69, 80, 82, 69, 83, 69, 78, 84, 128, 82, 69, 80, 76, 65, 67, 69, 77,
+ 69, 78, 212, 82, 69, 80, 72, 65, 128, 82, 69, 80, 72, 128, 82, 69, 80,
+ 69, 84, 73, 84, 73, 79, 206, 82, 69, 80, 69, 65, 84, 69, 196, 82, 69, 80,
+ 69, 65, 84, 128, 82, 69, 80, 69, 65, 212, 82, 69, 80, 65, 89, 65, 128,
+ 82, 69, 80, 65, 128, 82, 69, 80, 193, 82, 69, 78, 84, 79, 71, 69, 78,
+ 128, 82, 69, 78, 128, 82, 69, 206, 82, 69, 77, 85, 128, 82, 69, 77, 73,
+ 78, 68, 69, 210, 82, 69, 77, 69, 68, 89, 128, 82, 69, 76, 73, 71, 73, 79,
+ 78, 128, 82, 69, 76, 73, 69, 86, 69, 196, 82, 69, 76, 69, 65, 83, 69,
+ 128, 82, 69, 76, 65, 88, 69, 68, 128, 82, 69, 76, 65, 84, 73, 79, 78, 65,
+ 204, 82, 69, 76, 65, 84, 73, 79, 78, 128, 82, 69, 76, 65, 65, 128, 82,
+ 69, 74, 65, 78, 199, 82, 69, 73, 87, 65, 128, 82, 69, 73, 196, 82, 69,
+ 73, 128, 82, 69, 71, 85, 76, 85, 83, 45, 52, 128, 82, 69, 71, 85, 76, 85,
+ 83, 45, 51, 128, 82, 69, 71, 85, 76, 85, 83, 45, 50, 128, 82, 69, 71, 85,
+ 76, 85, 83, 128, 82, 69, 71, 85, 76, 85, 211, 82, 69, 71, 73, 83, 84, 69,
+ 82, 69, 196, 82, 69, 71, 73, 79, 78, 65, 204, 82, 69, 71, 73, 65, 45, 50,
+ 128, 82, 69, 71, 73, 65, 128, 82, 69, 70, 79, 82, 77, 69, 196, 82, 69,
+ 70, 69, 82, 69, 78, 67, 197, 82, 69, 68, 85, 80, 76, 73, 67, 65, 84, 73,
+ 79, 78, 128, 82, 69, 67, 89, 67, 76, 73, 78, 199, 82, 69, 67, 89, 67, 76,
+ 69, 196, 82, 69, 67, 84, 73, 76, 73, 78, 69, 65, 210, 82, 69, 67, 84, 65,
+ 78, 71, 85, 76, 65, 210, 82, 69, 67, 84, 65, 78, 71, 76, 69, 128, 82, 69,
+ 67, 84, 65, 78, 71, 76, 197, 82, 69, 67, 82, 69, 65, 84, 73, 79, 78, 65,
+ 204, 82, 69, 67, 79, 82, 68, 73, 78, 199, 82, 69, 67, 79, 82, 68, 69, 82,
+ 128, 82, 69, 67, 79, 82, 68, 128, 82, 69, 67, 79, 82, 196, 82, 69, 67,
+ 73, 84, 65, 84, 73, 86, 197, 82, 69, 67, 69, 80, 84, 73, 86, 197, 82, 69,
+ 67, 69, 73, 86, 69, 82, 128, 82, 69, 67, 69, 73, 86, 69, 210, 82, 69, 67,
+ 69, 73, 80, 84, 128, 82, 69, 65, 76, 71, 65, 82, 45, 50, 128, 82, 69, 65,
+ 76, 71, 65, 82, 128, 82, 69, 65, 72, 77, 85, 75, 128, 82, 69, 65, 68, 73,
+ 78, 199, 82, 69, 65, 67, 72, 128, 82, 69, 45, 52, 128, 82, 69, 45, 51,
+ 128, 82, 69, 45, 50, 128, 82, 69, 45, 49, 128, 82, 68, 207, 82, 68, 69,
+ 204, 82, 66, 65, 83, 193, 82, 65, 90, 83, 69, 75, 65, 128, 82, 65, 90,
+ 79, 82, 128, 82, 65, 89, 83, 128, 82, 65, 89, 211, 82, 65, 89, 65, 78,
+ 78, 65, 128, 82, 65, 86, 78, 79, 128, 82, 65, 84, 73, 79, 128, 82, 65,
+ 84, 72, 65, 128, 82, 65, 84, 72, 193, 82, 65, 84, 65, 128, 82, 65, 84,
+ 128, 82, 65, 83, 87, 65, 68, 73, 128, 82, 65, 83, 79, 85, 204, 82, 65,
+ 83, 72, 65, 128, 82, 65, 81, 128, 82, 65, 80, 73, 83, 77, 65, 128, 82,
+ 65, 78, 71, 197, 82, 65, 78, 65, 128, 82, 65, 78, 128, 82, 65, 77, 211,
+ 82, 65, 77, 66, 65, 84, 128, 82, 65, 75, 72, 65, 78, 71, 128, 82, 65, 75,
+ 65, 65, 82, 65, 65, 78, 83, 65, 89, 65, 128, 82, 65, 73, 83, 73, 78, 199,
+ 82, 65, 73, 83, 69, 68, 128, 82, 65, 73, 83, 69, 196, 82, 65, 73, 78, 66,
+ 79, 87, 128, 82, 65, 73, 76, 87, 65, 89, 128, 82, 65, 73, 76, 87, 65,
+ 217, 82, 65, 73, 76, 128, 82, 65, 73, 68, 207, 82, 65, 73, 68, 65, 128,
+ 82, 65, 72, 77, 65, 84, 85, 76, 76, 65, 200, 82, 65, 72, 73, 77, 65, 72,
+ 85, 205, 82, 65, 72, 73, 77, 65, 72, 213, 82, 65, 70, 69, 128, 82, 65,
+ 69, 77, 128, 82, 65, 68, 73, 79, 65, 67, 84, 73, 86, 197, 82, 65, 68, 73,
+ 79, 128, 82, 65, 68, 73, 207, 82, 65, 68, 201, 82, 65, 68, 128, 82, 65,
+ 196, 82, 65, 67, 81, 85, 69, 212, 82, 65, 67, 73, 78, 71, 128, 82, 65,
+ 67, 73, 78, 199, 82, 65, 67, 67, 79, 79, 78, 128, 82, 65, 66, 66, 73, 84,
+ 128, 82, 65, 66, 66, 73, 212, 82, 65, 66, 128, 82, 65, 65, 73, 128, 82,
+ 65, 51, 128, 82, 65, 50, 128, 82, 65, 45, 75, 65, 82, 65, 128, 82, 65,
+ 45, 52, 128, 82, 65, 45, 51, 128, 82, 65, 45, 50, 128, 82, 65, 45, 49,
+ 128, 82, 48, 50, 57, 128, 82, 48, 50, 56, 128, 82, 48, 50, 55, 128, 82,
+ 48, 50, 54, 128, 82, 48, 50, 53, 128, 82, 48, 50, 52, 128, 82, 48, 50,
+ 51, 128, 82, 48, 50, 50, 128, 82, 48, 50, 49, 128, 82, 48, 50, 48, 128,
+ 82, 48, 49, 57, 128, 82, 48, 49, 56, 128, 82, 48, 49, 55, 128, 82, 48,
+ 49, 54, 65, 128, 82, 48, 49, 54, 128, 82, 48, 49, 53, 128, 82, 48, 49,
+ 52, 128, 82, 48, 49, 51, 128, 82, 48, 49, 50, 128, 82, 48, 49, 49, 128,
+ 82, 48, 49, 48, 65, 128, 82, 48, 49, 48, 128, 82, 48, 48, 57, 128, 82,
+ 48, 48, 56, 128, 82, 48, 48, 55, 128, 82, 48, 48, 54, 128, 82, 48, 48,
+ 53, 128, 82, 48, 48, 52, 128, 82, 48, 48, 51, 66, 128, 82, 48, 48, 51,
+ 65, 128, 82, 48, 48, 51, 128, 82, 48, 48, 50, 65, 128, 82, 48, 48, 50,
+ 128, 82, 48, 48, 49, 128, 82, 45, 67, 82, 69, 197, 81, 89, 88, 128, 81,
+ 89, 85, 128, 81, 89, 84, 128, 81, 89, 82, 88, 128, 81, 89, 82, 128, 81,
+ 89, 80, 128, 81, 89, 79, 128, 81, 89, 73, 128, 81, 89, 69, 69, 128, 81,
+ 89, 69, 128, 81, 89, 65, 65, 128, 81, 89, 65, 128, 81, 89, 128, 81, 87,
+ 73, 128, 81, 87, 69, 69, 128, 81, 87, 69, 128, 81, 87, 65, 65, 128, 81,
+ 87, 65, 128, 81, 85, 88, 128, 81, 85, 86, 128, 81, 85, 85, 86, 128, 81,
+ 85, 85, 128, 81, 85, 84, 128, 81, 85, 83, 72, 83, 72, 65, 89, 65, 128,
+ 81, 85, 82, 88, 128, 81, 85, 82, 128, 81, 85, 80, 128, 81, 85, 79, 88,
+ 128, 81, 85, 79, 84, 197, 81, 85, 79, 84, 65, 84, 73, 79, 206, 81, 85,
+ 79, 84, 128, 81, 85, 79, 80, 128, 81, 85, 79, 128, 81, 85, 75, 128, 81,
+ 85, 73, 78, 84, 73, 76, 69, 128, 81, 85, 73, 78, 84, 69, 83, 83, 69, 78,
+ 67, 69, 128, 81, 85, 73, 78, 68, 73, 67, 69, 83, 73, 77, 193, 81, 85, 73,
+ 78, 67, 85, 78, 88, 128, 81, 85, 73, 78, 65, 82, 73, 85, 211, 81, 85, 73,
+ 76, 212, 81, 85, 73, 76, 76, 128, 81, 85, 73, 67, 203, 81, 85, 73, 128,
+ 81, 85, 70, 128, 81, 85, 69, 83, 84, 73, 79, 78, 69, 196, 81, 85, 69, 83,
+ 84, 73, 79, 78, 128, 81, 85, 69, 83, 84, 73, 79, 206, 81, 85, 69, 69, 78,
+ 128, 81, 85, 69, 69, 206, 81, 85, 69, 128, 81, 85, 68, 68, 73, 83, 193,
+ 81, 85, 66, 85, 84, 83, 128, 81, 85, 65, 84, 69, 82, 78, 73, 79, 206, 81,
+ 85, 65, 82, 84, 69, 82, 83, 128, 81, 85, 65, 82, 84, 69, 82, 211, 81, 85,
+ 65, 82, 84, 69, 82, 128, 81, 85, 65, 79, 65, 82, 128, 81, 85, 65, 78, 84,
+ 73, 84, 217, 81, 85, 65, 68, 82, 85, 80, 76, 197, 81, 85, 65, 68, 82, 65,
+ 78, 84, 128, 81, 85, 65, 68, 82, 65, 78, 212, 81, 85, 65, 68, 67, 79, 76,
+ 79, 78, 128, 81, 85, 65, 68, 128, 81, 85, 65, 196, 81, 85, 65, 128, 81,
+ 85, 128, 81, 208, 81, 79, 88, 128, 81, 79, 84, 128, 81, 79, 80, 72, 128,
+ 81, 79, 80, 65, 128, 81, 79, 80, 128, 81, 79, 79, 128, 81, 79, 207, 81,
+ 79, 70, 128, 81, 79, 198, 81, 79, 65, 128, 81, 79, 128, 81, 78, 128, 81,
+ 73, 88, 128, 81, 73, 84, 83, 65, 128, 81, 73, 84, 128, 81, 73, 80, 128,
+ 81, 73, 73, 128, 81, 73, 70, 128, 81, 73, 69, 88, 128, 81, 73, 69, 84,
+ 128, 81, 73, 69, 80, 128, 81, 73, 69, 128, 81, 73, 128, 81, 72, 87, 73,
+ 128, 81, 72, 87, 69, 69, 128, 81, 72, 87, 69, 128, 81, 72, 87, 65, 65,
+ 128, 81, 72, 87, 65, 128, 81, 72, 85, 128, 81, 72, 79, 80, 72, 128, 81,
+ 72, 79, 128, 81, 72, 73, 128, 81, 72, 69, 69, 128, 81, 72, 69, 128, 81,
+ 72, 65, 85, 128, 81, 72, 65, 65, 128, 81, 72, 65, 128, 81, 71, 65, 128,
+ 81, 69, 84, 65, 78, 65, 128, 81, 69, 69, 128, 81, 69, 128, 81, 65, 89,
+ 128, 81, 65, 85, 128, 81, 65, 84, 65, 78, 128, 81, 65, 83, 82, 128, 81,
+ 65, 82, 78, 69, 217, 81, 65, 82, 128, 81, 65, 81, 128, 81, 65, 80, 72,
+ 128, 81, 65, 77, 65, 84, 83, 128, 81, 65, 77, 65, 84, 211, 81, 65, 76,
+ 193, 81, 65, 73, 82, 84, 72, 82, 65, 128, 81, 65, 73, 128, 81, 65, 70,
+ 128, 81, 65, 198, 81, 65, 68, 77, 65, 128, 81, 65, 65, 73, 128, 81, 65,
+ 65, 70, 85, 128, 81, 65, 65, 70, 128, 81, 48, 48, 55, 128, 81, 48, 48,
+ 54, 128, 81, 48, 48, 53, 128, 81, 48, 48, 52, 128, 81, 48, 48, 51, 128,
+ 81, 48, 48, 50, 128, 81, 48, 48, 49, 128, 80, 90, 128, 80, 89, 88, 128,
+ 80, 89, 84, 128, 80, 89, 82, 88, 128, 80, 89, 82, 128, 80, 89, 80, 128,
+ 80, 87, 79, 89, 128, 80, 87, 79, 79, 128, 80, 87, 79, 128, 80, 87, 207,
+ 80, 87, 73, 73, 128, 80, 87, 73, 128, 80, 87, 69, 69, 128, 80, 87, 69,
+ 128, 80, 87, 65, 65, 128, 80, 87, 128, 80, 86, 128, 80, 85, 90, 90, 76,
+ 197, 80, 85, 88, 128, 80, 85, 85, 84, 128, 80, 85, 85, 128, 80, 85, 84,
+ 82, 69, 70, 65, 67, 84, 73, 79, 78, 128, 80, 85, 84, 78, 65, 89, 65, 128,
+ 80, 85, 84, 128, 80, 85, 212, 80, 85, 83, 72, 80, 73, 78, 128, 80, 85,
+ 83, 72, 80, 73, 75, 65, 128, 80, 85, 83, 72, 73, 78, 199, 80, 85, 82, 88,
+ 128, 80, 85, 82, 83, 69, 128, 80, 85, 82, 80, 76, 197, 80, 85, 82, 78,
+ 65, 77, 65, 128, 80, 85, 82, 73, 84, 89, 128, 80, 85, 82, 73, 70, 89,
+ 128, 80, 85, 82, 128, 80, 85, 81, 128, 80, 85, 80, 128, 80, 85, 79, 88,
+ 128, 80, 85, 79, 80, 128, 80, 85, 79, 128, 80, 85, 78, 71, 65, 65, 77,
+ 128, 80, 85, 78, 71, 128, 80, 85, 78, 67, 84, 85, 211, 80, 85, 78, 67,
+ 84, 85, 65, 84, 73, 79, 78, 128, 80, 85, 78, 67, 84, 85, 65, 84, 73, 79,
+ 206, 80, 85, 77, 80, 128, 80, 85, 77, 128, 80, 85, 70, 70, 69, 68, 128,
+ 80, 85, 69, 128, 80, 85, 67, 75, 128, 80, 85, 66, 76, 73, 195, 80, 85,
+ 194, 80, 85, 65, 81, 128, 80, 85, 65, 69, 128, 80, 85, 65, 67, 72, 85,
+ 197, 80, 85, 50, 128, 80, 85, 49, 128, 80, 85, 128, 80, 84, 72, 65, 72,
+ 193, 80, 84, 69, 128, 80, 83, 73, 76, 201, 80, 83, 73, 70, 73, 83, 84,
+ 79, 83, 89, 78, 65, 71, 77, 65, 128, 80, 83, 73, 70, 73, 83, 84, 79, 80,
+ 65, 82, 65, 75, 65, 76, 69, 83, 77, 65, 128, 80, 83, 73, 70, 73, 83, 84,
+ 79, 206, 80, 83, 73, 70, 73, 83, 84, 79, 76, 89, 71, 73, 83, 77, 65, 128,
+ 80, 83, 73, 128, 80, 83, 65, 76, 84, 69, 210, 80, 83, 128, 80, 82, 79,
+ 86, 69, 128, 80, 82, 79, 84, 79, 86, 65, 82, 89, 211, 80, 82, 79, 84, 79,
+ 211, 80, 82, 79, 84, 69, 67, 84, 69, 196, 80, 82, 79, 83, 84, 65, 89, 65,
+ 128, 80, 82, 79, 83, 71, 69, 71, 82, 65, 77, 77, 69, 78, 73, 128, 80, 82,
+ 79, 83, 69, 82, 80, 73, 78, 65, 128, 80, 82, 79, 80, 79, 82, 84, 73, 79,
+ 78, 65, 204, 80, 82, 79, 80, 79, 82, 84, 73, 79, 78, 128, 80, 82, 79, 80,
+ 69, 82, 84, 217, 80, 82, 79, 80, 69, 76, 76, 69, 210, 80, 82, 79, 79, 70,
+ 128, 80, 82, 79, 76, 79, 78, 71, 69, 196, 80, 82, 79, 76, 65, 84, 73, 79,
+ 78, 197, 80, 82, 79, 74, 69, 67, 84, 79, 82, 128, 80, 82, 79, 74, 69, 67,
+ 84, 73, 86, 69, 128, 80, 82, 79, 74, 69, 67, 84, 73, 79, 78, 128, 80, 82,
+ 79, 72, 73, 66, 73, 84, 69, 196, 80, 82, 79, 71, 82, 69, 83, 83, 128, 80,
+ 82, 79, 71, 82, 65, 205, 80, 82, 79, 70, 79, 85, 78, 68, 128, 80, 82, 79,
+ 68, 85, 67, 84, 128, 80, 82, 79, 68, 85, 67, 212, 80, 82, 79, 66, 73, 78,
+ 199, 80, 82, 73, 90, 78, 65, 203, 80, 82, 73, 86, 65, 84, 69, 128, 80,
+ 82, 73, 86, 65, 84, 197, 80, 82, 73, 86, 65, 67, 217, 80, 82, 73, 83, 72,
+ 84, 72, 65, 77, 65, 84, 82, 193, 80, 82, 73, 78, 84, 83, 128, 80, 82, 73,
+ 78, 84, 69, 82, 128, 80, 82, 73, 78, 84, 69, 210, 80, 82, 73, 78, 84,
+ 128, 80, 82, 73, 78, 212, 80, 82, 73, 78, 67, 69, 83, 83, 128, 80, 82,
+ 73, 78, 67, 69, 128, 80, 82, 73, 77, 69, 128, 80, 82, 73, 77, 197, 80,
+ 82, 69, 86, 73, 79, 85, 211, 80, 82, 69, 84, 90, 69, 76, 128, 80, 82, 69,
+ 83, 83, 69, 196, 80, 82, 69, 83, 69, 84, 128, 80, 82, 69, 83, 69, 78, 84,
+ 65, 84, 73, 79, 206, 80, 82, 69, 83, 67, 82, 73, 80, 84, 73, 79, 206, 80,
+ 82, 69, 80, 79, 78, 68, 69, 82, 65, 78, 67, 69, 128, 80, 82, 69, 78, 75,
+ 72, 65, 128, 80, 82, 69, 71, 78, 65, 78, 212, 80, 82, 69, 70, 73, 88, 69,
+ 196, 80, 82, 69, 70, 65, 67, 197, 80, 82, 69, 67, 73, 80, 73, 84, 65, 84,
+ 69, 128, 80, 82, 69, 67, 69, 68, 73, 78, 199, 80, 82, 69, 67, 69, 68, 69,
+ 83, 128, 80, 82, 69, 67, 69, 68, 69, 211, 80, 82, 69, 67, 69, 68, 69,
+ 196, 80, 82, 69, 67, 69, 68, 69, 128, 80, 82, 69, 67, 69, 68, 197, 80,
+ 82, 65, 89, 69, 210, 80, 82, 65, 77, 45, 80, 73, 73, 128, 80, 82, 65, 77,
+ 45, 80, 73, 201, 80, 82, 65, 77, 45, 77, 85, 79, 89, 128, 80, 82, 65, 77,
+ 45, 77, 85, 79, 217, 80, 82, 65, 77, 45, 66, 85, 79, 78, 128, 80, 82, 65,
+ 77, 45, 66, 85, 79, 206, 80, 82, 65, 77, 45, 66, 69, 73, 128, 80, 82, 65,
+ 77, 45, 66, 69, 201, 80, 82, 65, 77, 128, 80, 82, 65, 205, 80, 82, 128,
+ 80, 80, 86, 128, 80, 80, 77, 128, 80, 80, 65, 128, 80, 79, 89, 128, 80,
+ 79, 88, 128, 80, 79, 87, 69, 82, 211, 80, 79, 87, 69, 82, 128, 80, 79,
+ 87, 69, 210, 80, 79, 87, 68, 69, 82, 69, 196, 80, 79, 87, 68, 69, 82,
+ 128, 80, 79, 86, 89, 83, 72, 69, 128, 80, 79, 86, 89, 83, 72, 197, 80,
+ 79, 86, 79, 68, 78, 89, 128, 80, 79, 85, 82, 73, 78, 199, 80, 79, 85, 78,
+ 196, 80, 79, 85, 76, 84, 82, 217, 80, 79, 85, 67, 72, 128, 80, 79, 84,
+ 84, 69, 196, 80, 79, 84, 65, 84, 79, 128, 80, 79, 84, 65, 66, 76, 197,
+ 80, 79, 212, 80, 79, 83, 84, 80, 79, 83, 73, 84, 73, 79, 206, 80, 79, 83,
+ 84, 66, 79, 88, 128, 80, 79, 83, 84, 65, 204, 80, 79, 83, 84, 128, 80,
+ 79, 83, 212, 80, 79, 83, 83, 69, 83, 83, 73, 79, 78, 128, 80, 79, 83, 83,
+ 69, 83, 83, 73, 79, 206, 80, 79, 83, 73, 84, 73, 79, 78, 83, 128, 80, 79,
+ 83, 73, 84, 73, 79, 78, 128, 80, 79, 83, 69, 73, 68, 79, 78, 128, 80, 79,
+ 82, 84, 65, 66, 76, 197, 80, 79, 82, 82, 69, 67, 84, 85, 83, 128, 80, 79,
+ 82, 82, 69, 67, 84, 85, 211, 80, 79, 80, 80, 73, 78, 199, 80, 79, 80, 80,
+ 69, 82, 128, 80, 79, 80, 67, 79, 82, 78, 128, 80, 79, 80, 128, 80, 79,
+ 208, 80, 79, 79, 68, 76, 69, 128, 80, 79, 79, 128, 80, 79, 78, 68, 79,
+ 128, 80, 79, 206, 80, 79, 77, 77, 69, 69, 128, 80, 79, 77, 77, 69, 197,
+ 80, 79, 76, 85, 80, 79, 86, 79, 68, 78, 65, 89, 65, 128, 80, 79, 76, 79,
+ 128, 80, 79, 76, 78, 65, 89, 65, 128, 80, 79, 76, 76, 85, 128, 80, 79,
+ 76, 75, 85, 76, 73, 90, 77, 89, 128, 80, 79, 76, 73, 83, 72, 128, 80, 79,
+ 76, 73, 83, 200, 80, 79, 76, 73, 67, 197, 80, 79, 76, 201, 80, 79, 76,
+ 69, 128, 80, 79, 76, 197, 80, 79, 75, 82, 89, 84, 73, 69, 128, 80, 79,
+ 75, 79, 74, 73, 128, 80, 79, 73, 78, 84, 211, 80, 79, 73, 78, 84, 79,
+ 128, 80, 79, 73, 78, 84, 69, 82, 128, 80, 79, 73, 78, 84, 69, 196, 80,
+ 79, 73, 78, 84, 128, 80, 79, 73, 78, 212, 80, 79, 69, 84, 82, 217, 80,
+ 79, 69, 84, 73, 195, 80, 79, 68, 86, 69, 82, 84, 75, 65, 128, 80, 79, 68,
+ 67, 72, 65, 83, 72, 73, 69, 77, 128, 80, 79, 68, 67, 72, 65, 83, 72, 73,
+ 69, 128, 80, 79, 68, 67, 72, 65, 83, 72, 73, 197, 80, 79, 68, 65, 84, 85,
+ 83, 128, 80, 79, 67, 75, 69, 212, 80, 79, 65, 128, 80, 207, 80, 78, 69,
+ 85, 77, 65, 84, 65, 128, 80, 76, 85, 84, 207, 80, 76, 85, 84, 65, 128,
+ 80, 76, 85, 83, 45, 77, 73, 78, 85, 211, 80, 76, 85, 83, 128, 80, 76, 85,
+ 82, 65, 76, 128, 80, 76, 85, 78, 71, 69, 82, 128, 80, 76, 85, 77, 69,
+ 196, 80, 76, 85, 77, 128, 80, 76, 85, 75, 128, 80, 76, 85, 71, 128, 80,
+ 76, 85, 128, 80, 76, 79, 87, 128, 80, 76, 79, 80, 72, 85, 128, 80, 76,
+ 72, 65, 85, 128, 80, 76, 69, 84, 72, 82, 79, 78, 128, 80, 76, 69, 65, 68,
+ 73, 78, 199, 80, 76, 68, 128, 80, 76, 65, 89, 73, 78, 199, 80, 76, 65,
+ 89, 71, 82, 79, 85, 78, 196, 80, 76, 65, 84, 69, 128, 80, 76, 65, 83, 84,
+ 73, 67, 83, 128, 80, 76, 65, 78, 84, 128, 80, 76, 65, 78, 69, 84, 128,
+ 80, 76, 65, 78, 69, 128, 80, 76, 65, 78, 67, 203, 80, 76, 65, 75, 128,
+ 80, 76, 65, 71, 73, 79, 211, 80, 76, 65, 67, 69, 72, 79, 76, 68, 69, 82,
+ 128, 80, 76, 65, 67, 69, 72, 79, 76, 68, 69, 210, 80, 76, 65, 67, 197,
+ 80, 76, 65, 67, 65, 82, 68, 128, 80, 76, 65, 128, 80, 73, 90, 90, 73, 67,
+ 65, 84, 79, 128, 80, 73, 90, 90, 65, 128, 80, 73, 88, 128, 80, 73, 87,
+ 82, 128, 80, 73, 84, 67, 72, 70, 79, 82, 75, 128, 80, 73, 84, 67, 72, 70,
+ 79, 82, 203, 80, 73, 84, 128, 80, 73, 83, 84, 79, 76, 128, 80, 73, 83,
+ 69, 76, 69, 72, 128, 80, 73, 83, 67, 69, 83, 128, 80, 73, 82, 73, 71,
+ 128, 80, 73, 82, 73, 199, 80, 73, 82, 73, 69, 69, 78, 128, 80, 73, 82,
+ 65, 67, 89, 128, 80, 73, 82, 50, 128, 80, 73, 80, 73, 78, 71, 128, 80,
+ 73, 80, 65, 69, 77, 71, 66, 73, 69, 69, 128, 80, 73, 80, 65, 69, 77, 66,
+ 65, 128, 80, 73, 80, 128, 80, 73, 78, 87, 72, 69, 69, 204, 80, 73, 78,
+ 203, 80, 73, 78, 69, 65, 80, 80, 76, 69, 128, 80, 73, 78, 197, 80, 73,
+ 78, 67, 72, 73, 78, 199, 80, 73, 78, 67, 72, 69, 196, 80, 73, 78, 65, 84,
+ 65, 128, 80, 73, 78, 65, 82, 66, 79, 82, 65, 83, 128, 80, 73, 76, 76,
+ 128, 80, 73, 76, 197, 80, 73, 76, 67, 82, 79, 215, 80, 73, 75, 85, 82,
+ 85, 128, 80, 73, 75, 79, 128, 80, 73, 71, 128, 80, 73, 199, 80, 73, 69,
+ 88, 128, 80, 73, 69, 85, 80, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 73,
+ 69, 85, 80, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 80, 73, 69, 85,
+ 80, 45, 83, 73, 79, 83, 45, 84, 73, 75, 69, 85, 84, 128, 80, 73, 69, 85,
+ 80, 45, 83, 73, 79, 83, 45, 84, 72, 73, 69, 85, 84, 72, 128, 80, 73, 69,
+ 85, 80, 45, 83, 73, 79, 83, 45, 80, 73, 69, 85, 80, 128, 80, 73, 69, 85,
+ 80, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 80, 73, 69, 85,
+ 80, 45, 83, 73, 79, 83, 45, 67, 73, 69, 85, 67, 128, 80, 73, 69, 85, 80,
+ 45, 82, 73, 69, 85, 76, 45, 80, 72, 73, 69, 85, 80, 72, 128, 80, 73, 69,
+ 85, 80, 45, 82, 73, 69, 85, 76, 128, 80, 73, 69, 85, 80, 45, 78, 73, 69,
+ 85, 78, 128, 80, 73, 69, 85, 80, 45, 77, 73, 69, 85, 77, 128, 80, 73, 69,
+ 85, 80, 45, 75, 72, 73, 69, 85, 75, 72, 128, 80, 73, 69, 85, 80, 45, 67,
+ 73, 69, 85, 67, 128, 80, 73, 69, 85, 80, 45, 67, 72, 73, 69, 85, 67, 72,
+ 128, 80, 73, 69, 85, 208, 80, 73, 69, 84, 128, 80, 73, 69, 80, 128, 80,
+ 73, 69, 69, 84, 128, 80, 73, 69, 69, 81, 128, 80, 73, 69, 67, 69, 128,
+ 80, 73, 69, 128, 80, 73, 67, 84, 85, 82, 69, 128, 80, 73, 67, 75, 85,
+ 208, 80, 73, 67, 75, 69, 84, 128, 80, 73, 67, 75, 128, 80, 73, 65, 83,
+ 85, 84, 79, 82, 85, 128, 80, 73, 65, 83, 84, 82, 197, 80, 73, 65, 83, 77,
+ 193, 80, 73, 65, 78, 79, 128, 80, 201, 80, 72, 87, 65, 128, 80, 72, 85,
+ 84, 72, 65, 79, 128, 80, 72, 85, 210, 80, 72, 85, 78, 71, 128, 80, 72,
+ 82, 65, 83, 69, 128, 80, 72, 79, 78, 69, 83, 128, 80, 72, 79, 76, 85, 83,
+ 128, 80, 72, 79, 69, 78, 73, 67, 73, 65, 206, 80, 72, 79, 65, 128, 80,
+ 72, 79, 128, 80, 72, 207, 80, 72, 78, 65, 69, 203, 80, 72, 73, 78, 84,
+ 72, 85, 128, 80, 72, 73, 76, 79, 83, 79, 80, 72, 69, 82, 211, 80, 72, 73,
+ 76, 73, 80, 80, 73, 78, 197, 80, 72, 73, 69, 85, 80, 72, 45, 84, 72, 73,
+ 69, 85, 84, 72, 128, 80, 72, 73, 69, 85, 80, 72, 45, 83, 73, 79, 83, 128,
+ 80, 72, 73, 69, 85, 80, 72, 45, 80, 73, 69, 85, 80, 128, 80, 72, 73, 69,
+ 85, 80, 72, 45, 72, 73, 69, 85, 72, 128, 80, 72, 73, 69, 85, 80, 200, 80,
+ 72, 73, 128, 80, 72, 201, 80, 72, 69, 69, 128, 80, 72, 69, 128, 80, 72,
+ 65, 83, 69, 45, 198, 80, 72, 65, 83, 69, 45, 195, 80, 72, 65, 83, 69, 45,
+ 194, 80, 72, 65, 83, 69, 45, 193, 80, 72, 65, 82, 89, 78, 71, 69, 65,
+ 204, 80, 72, 65, 82, 128, 80, 72, 65, 78, 128, 80, 72, 65, 77, 128, 80,
+ 72, 65, 73, 83, 84, 79, 211, 80, 72, 65, 71, 83, 45, 80, 193, 80, 72, 65,
+ 66, 128, 80, 72, 65, 65, 82, 75, 65, 65, 128, 80, 72, 65, 65, 128, 80,
+ 71, 128, 80, 70, 128, 80, 69, 85, 88, 128, 80, 69, 85, 84, 65, 69, 128,
+ 80, 69, 85, 84, 128, 80, 69, 84, 82, 201, 80, 69, 84, 65, 83, 84, 79, 75,
+ 79, 85, 70, 73, 83, 77, 65, 128, 80, 69, 84, 65, 83, 84, 73, 128, 80, 69,
+ 84, 65, 83, 77, 65, 128, 80, 69, 84, 65, 76, 76, 69, 196, 80, 69, 83, 79,
+ 128, 80, 69, 83, 207, 80, 69, 83, 72, 50, 128, 80, 69, 83, 72, 178, 80,
+ 69, 83, 69, 84, 193, 80, 69, 211, 80, 69, 82, 84, 72, 207, 80, 69, 82,
+ 83, 80, 69, 67, 84, 73, 86, 69, 128, 80, 69, 82, 83, 79, 78, 65, 204, 80,
+ 69, 82, 83, 79, 78, 128, 80, 69, 82, 83, 79, 206, 80, 69, 82, 83, 73, 65,
+ 206, 80, 69, 82, 83, 69, 86, 69, 82, 73, 78, 199, 80, 69, 82, 80, 69, 78,
+ 68, 73, 67, 85, 76, 65, 82, 128, 80, 69, 82, 80, 69, 78, 68, 73, 67, 85,
+ 76, 65, 210, 80, 69, 82, 78, 73, 206, 80, 69, 82, 77, 73, 84, 84, 69,
+ 196, 80, 69, 82, 77, 73, 195, 80, 69, 82, 77, 65, 78, 69, 78, 212, 80,
+ 69, 82, 73, 83, 80, 79, 77, 69, 78, 73, 128, 80, 69, 82, 73, 83, 80, 79,
+ 77, 69, 78, 201, 80, 69, 82, 70, 79, 82, 77, 73, 78, 199, 80, 69, 82, 70,
+ 69, 67, 84, 85, 205, 80, 69, 82, 70, 69, 67, 84, 65, 128, 80, 69, 82, 70,
+ 69, 67, 84, 193, 80, 69, 82, 69, 86, 79, 68, 75, 65, 128, 80, 69, 82, 69,
+ 86, 79, 68, 75, 193, 80, 69, 82, 67, 85, 83, 83, 73, 86, 69, 128, 80, 69,
+ 82, 67, 69, 78, 212, 80, 69, 80, 80, 69, 82, 128, 80, 69, 80, 69, 84,
+ 128, 80, 69, 80, 69, 212, 80, 69, 79, 82, 84, 200, 80, 69, 79, 80, 76,
+ 69, 128, 80, 69, 79, 80, 76, 197, 80, 69, 78, 84, 65, 84, 72, 76, 79, 78,
+ 128, 80, 69, 78, 84, 65, 83, 69, 77, 69, 128, 80, 69, 78, 84, 65, 71, 82,
+ 65, 77, 128, 80, 69, 78, 84, 65, 71, 79, 78, 128, 80, 69, 78, 83, 85,
+ 128, 80, 69, 78, 83, 73, 86, 197, 80, 69, 78, 78, 217, 80, 69, 78, 78,
+ 65, 78, 84, 128, 80, 69, 78, 73, 72, 73, 128, 80, 69, 78, 71, 85, 73, 78,
+ 128, 80, 69, 78, 71, 75, 65, 76, 128, 80, 69, 78, 69, 84, 82, 65, 84, 73,
+ 79, 78, 128, 80, 69, 78, 67, 73, 76, 128, 80, 69, 206, 80, 69, 76, 65,
+ 83, 84, 79, 78, 128, 80, 69, 76, 65, 83, 84, 79, 206, 80, 69, 73, 84, 72,
+ 128, 80, 69, 72, 69, 72, 128, 80, 69, 72, 69, 200, 80, 69, 72, 128, 80,
+ 69, 200, 80, 69, 69, 90, 73, 128, 80, 69, 69, 83, 72, 73, 128, 80, 69,
+ 69, 80, 128, 80, 69, 69, 77, 128, 80, 69, 69, 75, 73, 78, 199, 80, 69,
+ 69, 73, 128, 80, 69, 69, 128, 80, 69, 68, 69, 83, 84, 82, 73, 65, 78, 83,
+ 128, 80, 69, 68, 69, 83, 84, 82, 73, 65, 78, 128, 80, 69, 68, 69, 83, 84,
+ 65, 76, 128, 80, 69, 68, 69, 83, 84, 65, 204, 80, 69, 68, 65, 204, 80,
+ 69, 65, 78, 85, 84, 83, 128, 80, 69, 65, 75, 211, 80, 69, 65, 67, 79, 67,
+ 75, 128, 80, 69, 65, 67, 72, 128, 80, 69, 65, 67, 69, 128, 80, 69, 65,
+ 67, 197, 80, 69, 193, 80, 68, 73, 128, 80, 68, 70, 128, 80, 68, 128, 80,
+ 67, 128, 80, 65, 90, 69, 82, 128, 80, 65, 89, 69, 82, 79, 75, 128, 80,
+ 65, 89, 65, 78, 78, 65, 128, 80, 65, 89, 128, 80, 65, 88, 128, 80, 65,
+ 87, 78, 128, 80, 65, 87, 206, 80, 65, 215, 80, 65, 86, 73, 89, 65, 78,
+ 73, 128, 80, 65, 85, 83, 197, 80, 65, 85, 75, 128, 80, 65, 85, 128, 80,
+ 65, 213, 80, 65, 84, 84, 217, 80, 65, 84, 84, 69, 82, 78, 128, 80, 65,
+ 84, 72, 65, 77, 65, 83, 65, 84, 128, 80, 65, 84, 72, 65, 75, 75, 85, 128,
+ 80, 65, 84, 200, 80, 65, 84, 65, 75, 128, 80, 65, 84, 65, 72, 128, 80,
+ 65, 84, 128, 80, 65, 83, 85, 81, 128, 80, 65, 83, 83, 80, 79, 82, 212,
+ 80, 65, 83, 83, 73, 86, 69, 45, 80, 85, 76, 76, 45, 85, 80, 45, 79, 85,
+ 84, 80, 85, 212, 80, 65, 83, 83, 73, 86, 69, 45, 80, 85, 76, 76, 45, 68,
+ 79, 87, 78, 45, 79, 85, 84, 80, 85, 212, 80, 65, 83, 83, 73, 77, 66, 65,
+ 78, 71, 128, 80, 65, 83, 83, 69, 78, 71, 69, 210, 80, 65, 83, 83, 69,
+ 196, 80, 65, 83, 72, 84, 65, 128, 80, 65, 83, 72, 65, 69, 128, 80, 65,
+ 83, 69, 81, 128, 80, 65, 83, 65, 78, 71, 65, 206, 80, 65, 82, 85, 77,
+ 128, 80, 65, 82, 84, 217, 80, 65, 82, 84, 78, 69, 82, 83, 72, 73, 208,
+ 80, 65, 82, 84, 73, 65, 76, 76, 89, 45, 82, 69, 67, 89, 67, 76, 69, 196,
+ 80, 65, 82, 84, 73, 65, 204, 80, 65, 82, 84, 72, 73, 65, 206, 80, 65, 82,
+ 212, 80, 65, 82, 82, 79, 84, 128, 80, 65, 82, 75, 128, 80, 65, 82, 73,
+ 67, 72, 79, 78, 128, 80, 65, 82, 69, 83, 84, 73, 71, 77, 69, 78, 79, 206,
+ 80, 65, 82, 69, 82, 69, 78, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73,
+ 83, 128, 80, 65, 82, 69, 78, 84, 72, 69, 83, 73, 211, 80, 65, 82, 69, 78,
+ 84, 72, 69, 83, 69, 211, 80, 65, 82, 65, 80, 72, 82, 65, 83, 197, 80, 65,
+ 82, 65, 76, 76, 69, 76, 79, 71, 82, 65, 77, 128, 80, 65, 82, 65, 76, 76,
+ 69, 76, 128, 80, 65, 82, 65, 76, 76, 69, 204, 80, 65, 82, 65, 75, 76, 73,
+ 84, 73, 75, 73, 128, 80, 65, 82, 65, 75, 76, 73, 84, 73, 75, 201, 80, 65,
+ 82, 65, 75, 76, 73, 84, 128, 80, 65, 82, 65, 75, 65, 76, 69, 83, 77, 193,
+ 80, 65, 82, 65, 71, 82, 65, 80, 72, 85, 211, 80, 65, 82, 65, 71, 82, 65,
+ 80, 72, 79, 83, 128, 80, 65, 82, 65, 71, 82, 65, 80, 72, 128, 80, 65, 82,
+ 65, 71, 82, 65, 80, 200, 80, 65, 82, 65, 67, 72, 85, 84, 69, 128, 80, 65,
+ 82, 65, 128, 80, 65, 82, 128, 80, 65, 80, 89, 82, 85, 83, 128, 80, 65,
+ 80, 69, 82, 67, 76, 73, 80, 83, 128, 80, 65, 80, 69, 82, 67, 76, 73, 80,
+ 128, 80, 65, 80, 69, 82, 128, 80, 65, 80, 69, 210, 80, 65, 80, 128, 80,
+ 65, 208, 80, 65, 207, 80, 65, 78, 89, 85, 75, 85, 128, 80, 65, 78, 89,
+ 73, 75, 85, 128, 80, 65, 78, 89, 69, 67, 69, 75, 128, 80, 65, 78, 89, 65,
+ 78, 71, 71, 65, 128, 80, 65, 78, 89, 65, 75, 82, 65, 128, 80, 65, 78, 84,
+ 73, 128, 80, 65, 78, 84, 201, 80, 65, 78, 83, 73, 79, 83, 45, 80, 73, 69,
+ 85, 80, 128, 80, 65, 78, 83, 73, 79, 83, 45, 75, 65, 80, 89, 69, 79, 85,
+ 78, 80, 73, 69, 85, 80, 128, 80, 65, 78, 79, 78, 71, 79, 78, 65, 78, 128,
+ 80, 65, 78, 79, 76, 79, 78, 71, 128, 80, 65, 78, 71, 87, 73, 83, 65, 68,
+ 128, 80, 65, 78, 71, 82, 65, 78, 71, 75, 69, 80, 128, 80, 65, 78, 71, 79,
+ 76, 65, 84, 128, 80, 65, 78, 71, 76, 79, 78, 71, 128, 80, 65, 78, 71, 76,
+ 65, 89, 65, 82, 128, 80, 65, 78, 71, 75, 79, 78, 128, 80, 65, 78, 71, 75,
+ 65, 84, 128, 80, 65, 78, 71, 72, 85, 76, 85, 128, 80, 65, 78, 71, 128,
+ 80, 65, 78, 69, 85, 76, 69, 85, 78, 71, 128, 80, 65, 78, 68, 193, 80, 65,
+ 78, 67, 65, 75, 69, 83, 128, 80, 65, 78, 65, 77, 128, 80, 65, 78, 65, 69,
+ 76, 65, 69, 78, 71, 128, 80, 65, 78, 128, 80, 65, 206, 80, 65, 77, 85,
+ 78, 71, 75, 65, 72, 128, 80, 65, 77, 85, 68, 80, 79, 68, 128, 80, 65, 77,
+ 83, 72, 65, 69, 128, 80, 65, 77, 80, 72, 89, 76, 73, 65, 206, 80, 65, 77,
+ 73, 78, 71, 75, 65, 76, 128, 80, 65, 77, 69, 80, 69, 84, 128, 80, 65, 77,
+ 69, 78, 69, 78, 71, 128, 80, 65, 77, 65, 68, 65, 128, 80, 65, 77, 65, 68,
+ 193, 80, 65, 77, 65, 65, 69, 72, 128, 80, 65, 76, 85, 84, 65, 128, 80,
+ 65, 76, 79, 67, 72, 75, 65, 128, 80, 65, 76, 77, 89, 82, 69, 78, 197, 80,
+ 65, 76, 77, 211, 80, 65, 76, 77, 128, 80, 65, 76, 205, 80, 65, 76, 76,
+ 65, 87, 65, 128, 80, 65, 76, 76, 65, 83, 128, 80, 65, 76, 75, 65, 128,
+ 80, 65, 76, 201, 80, 65, 76, 69, 84, 84, 69, 128, 80, 65, 76, 65, 85, 78,
+ 199, 80, 65, 76, 65, 84, 65, 76, 73, 90, 69, 196, 80, 65, 76, 65, 84, 65,
+ 76, 73, 90, 65, 84, 73, 79, 78, 128, 80, 65, 76, 65, 84, 65, 204, 80, 65,
+ 75, 80, 65, 203, 80, 65, 73, 89, 65, 78, 78, 79, 73, 128, 80, 65, 73, 82,
+ 84, 72, 82, 65, 128, 80, 65, 73, 82, 69, 196, 80, 65, 73, 78, 84, 66, 82,
+ 85, 83, 72, 128, 80, 65, 73, 128, 80, 65, 72, 76, 65, 86, 201, 80, 65,
+ 72, 128, 80, 65, 71, 79, 68, 65, 128, 80, 65, 71, 69, 83, 128, 80, 65,
+ 71, 69, 82, 128, 80, 65, 71, 197, 80, 65, 68, 77, 193, 80, 65, 68, 68,
+ 76, 197, 80, 65, 68, 68, 73, 78, 199, 80, 65, 68, 193, 80, 65, 68, 128,
+ 80, 65, 67, 75, 73, 78, 71, 128, 80, 65, 67, 75, 65, 71, 69, 128, 80, 65,
+ 65, 84, 85, 128, 80, 65, 65, 83, 69, 78, 84, 79, 128, 80, 65, 65, 82, 65,
+ 77, 128, 80, 65, 65, 82, 65, 69, 128, 80, 65, 65, 77, 128, 80, 65, 65,
+ 73, 128, 80, 65, 65, 45, 80, 73, 76, 76, 65, 128, 80, 65, 65, 128, 80,
+ 50, 128, 80, 48, 49, 49, 128, 80, 48, 49, 48, 128, 80, 48, 48, 57, 128,
+ 80, 48, 48, 56, 128, 80, 48, 48, 55, 128, 80, 48, 48, 54, 128, 80, 48,
+ 48, 53, 128, 80, 48, 48, 52, 128, 80, 48, 48, 51, 65, 128, 80, 48, 48,
+ 51, 128, 80, 48, 48, 50, 128, 80, 48, 48, 49, 65, 128, 80, 48, 48, 49,
+ 128, 79, 90, 128, 79, 89, 83, 84, 69, 82, 128, 79, 89, 82, 65, 78, 73,
+ 83, 77, 193, 79, 89, 65, 78, 78, 65, 128, 79, 88, 73, 65, 128, 79, 88,
+ 73, 193, 79, 88, 69, 73, 65, 201, 79, 88, 69, 73, 193, 79, 87, 76, 128,
+ 79, 86, 69, 82, 83, 84, 82, 85, 67, 203, 79, 86, 69, 82, 82, 73, 68, 69,
+ 128, 79, 86, 69, 82, 76, 79, 78, 199, 79, 86, 69, 82, 76, 73, 78, 69,
+ 128, 79, 86, 69, 82, 76, 65, 89, 128, 79, 86, 69, 82, 76, 65, 217, 79,
+ 86, 69, 82, 76, 65, 80, 80, 73, 78, 199, 79, 86, 69, 82, 76, 65, 80, 128,
+ 79, 86, 69, 82, 76, 65, 73, 68, 128, 79, 86, 69, 82, 76, 65, 73, 196, 79,
+ 86, 69, 82, 72, 69, 65, 84, 69, 196, 79, 86, 69, 82, 66, 65, 82, 128, 79,
+ 86, 65, 76, 128, 79, 86, 65, 204, 79, 85, 84, 76, 73, 78, 69, 196, 79,
+ 85, 84, 76, 73, 78, 69, 128, 79, 85, 84, 69, 210, 79, 85, 84, 66, 79,
+ 216, 79, 85, 78, 75, 73, 193, 79, 85, 78, 67, 69, 128, 79, 85, 78, 67,
+ 197, 79, 84, 85, 128, 79, 84, 84, 79, 77, 65, 206, 79, 84, 84, 69, 82,
+ 128, 79, 84, 84, 65, 86, 193, 79, 84, 84, 128, 79, 84, 83, 69, 67, 72,
+ 75, 65, 128, 79, 84, 72, 69, 82, 211, 79, 84, 72, 69, 210, 79, 84, 72,
+ 65, 76, 65, 206, 79, 84, 72, 65, 76, 128, 79, 83, 79, 75, 65, 128, 79,
+ 83, 79, 75, 193, 79, 83, 77, 65, 78, 89, 193, 79, 83, 67, 128, 79, 83,
+ 65, 71, 197, 79, 82, 84, 72, 79, 71, 79, 78, 65, 204, 79, 82, 84, 72, 79,
+ 68, 79, 216, 79, 82, 78, 65, 84, 197, 79, 82, 78, 65, 77, 69, 78, 84, 83,
+ 128, 79, 82, 78, 65, 77, 69, 78, 84, 128, 79, 82, 78, 65, 77, 69, 78,
+ 212, 79, 82, 75, 72, 79, 206, 79, 82, 73, 89, 193, 79, 82, 73, 71, 73,
+ 78, 65, 204, 79, 82, 73, 71, 73, 78, 128, 79, 82, 69, 45, 50, 128, 79,
+ 82, 68, 73, 78, 65, 204, 79, 82, 68, 69, 210, 79, 82, 67, 85, 83, 128,
+ 79, 82, 67, 72, 73, 68, 128, 79, 82, 65, 78, 71, 85, 84, 65, 78, 128, 79,
+ 82, 65, 78, 71, 197, 79, 80, 84, 73, 79, 206, 79, 80, 84, 73, 67, 65,
+ 204, 79, 80, 80, 82, 69, 83, 83, 73, 79, 78, 128, 79, 80, 80, 79, 83, 73,
+ 84, 73, 79, 78, 128, 79, 80, 80, 79, 83, 73, 78, 199, 79, 80, 80, 79, 83,
+ 69, 128, 79, 80, 72, 73, 85, 67, 72, 85, 83, 128, 79, 80, 69, 82, 65, 84,
+ 79, 82, 128, 79, 80, 69, 82, 65, 84, 79, 210, 79, 80, 69, 82, 65, 84, 73,
+ 78, 199, 79, 80, 69, 78, 73, 78, 199, 79, 80, 69, 78, 45, 80, 128, 79,
+ 80, 69, 78, 45, 79, 85, 84, 76, 73, 78, 69, 196, 79, 80, 69, 78, 45, 79,
+ 128, 79, 80, 69, 78, 45, 207, 79, 80, 69, 78, 45, 72, 69, 65, 68, 69,
+ 196, 79, 80, 69, 78, 45, 67, 73, 82, 67, 85, 73, 84, 45, 79, 85, 84, 80,
+ 85, 212, 79, 80, 69, 78, 128, 79, 80, 69, 206, 79, 79, 90, 69, 128, 79,
+ 79, 89, 65, 78, 78, 65, 128, 79, 79, 85, 128, 79, 79, 77, 85, 128, 79,
+ 79, 72, 128, 79, 79, 69, 128, 79, 79, 66, 79, 79, 70, 73, 76, 73, 128,
+ 79, 78, 85, 128, 79, 78, 83, 85, 128, 79, 78, 78, 128, 79, 78, 75, 65,
+ 82, 128, 79, 78, 73, 79, 78, 128, 79, 78, 69, 83, 69, 76, 70, 128, 79,
+ 78, 69, 45, 87, 65, 217, 79, 78, 69, 45, 84, 72, 73, 82, 84, 89, 128, 79,
+ 78, 69, 45, 80, 73, 69, 67, 197, 79, 78, 69, 45, 76, 73, 78, 197, 79, 78,
+ 69, 45, 72, 85, 78, 68, 82, 69, 68, 45, 65, 78, 68, 45, 83, 73, 88, 84,
+ 73, 69, 84, 72, 128, 79, 78, 67, 79, 77, 73, 78, 199, 79, 78, 65, 80,
+ 128, 79, 78, 45, 79, 70, 198, 79, 77, 73, 83, 83, 73, 79, 206, 79, 77,
+ 73, 67, 82, 79, 78, 128, 79, 77, 73, 67, 82, 79, 206, 79, 77, 69, 84,
+ 128, 79, 77, 69, 71, 65, 128, 79, 77, 69, 71, 193, 79, 77, 65, 76, 79,
+ 78, 128, 79, 76, 73, 86, 69, 128, 79, 76, 73, 71, 79, 206, 79, 76, 68,
+ 128, 79, 75, 84, 207, 79, 75, 65, 82, 65, 128, 79, 75, 65, 82, 193, 79,
+ 74, 79, 68, 128, 79, 74, 73, 66, 87, 65, 217, 79, 74, 69, 79, 78, 128,
+ 79, 73, 78, 128, 79, 73, 76, 128, 79, 73, 204, 79, 72, 77, 128, 79, 72,
+ 205, 79, 71, 82, 69, 128, 79, 71, 79, 78, 69, 75, 128, 79, 71, 79, 78,
+ 69, 203, 79, 71, 72, 65, 205, 79, 70, 70, 73, 67, 69, 82, 128, 79, 70,
+ 70, 73, 67, 69, 128, 79, 70, 70, 73, 67, 197, 79, 70, 70, 128, 79, 69,
+ 89, 128, 79, 69, 82, 128, 79, 69, 75, 128, 79, 69, 69, 128, 79, 68, 69,
+ 78, 128, 79, 68, 68, 128, 79, 68, 196, 79, 67, 84, 79, 80, 85, 83, 128,
+ 79, 67, 84, 79, 66, 69, 82, 128, 79, 67, 84, 69, 212, 79, 67, 84, 65, 71,
+ 79, 78, 65, 204, 79, 67, 84, 65, 71, 79, 78, 128, 79, 67, 210, 79, 67,
+ 76, 79, 67, 75, 128, 79, 67, 72, 75, 79, 77, 128, 79, 67, 67, 85, 76, 84,
+ 65, 84, 73, 79, 78, 128, 79, 67, 67, 76, 85, 83, 73, 79, 78, 128, 79, 66,
+ 83, 84, 82, 85, 67, 84, 73, 79, 78, 128, 79, 66, 83, 69, 82, 86, 69, 210,
+ 79, 66, 79, 76, 211, 79, 66, 79, 204, 79, 66, 79, 70, 73, 76, 73, 128,
+ 79, 66, 76, 73, 81, 85, 197, 79, 66, 76, 65, 75, 79, 128, 79, 66, 76, 65,
+ 67, 72, 75, 79, 128, 79, 66, 74, 69, 67, 212, 79, 66, 69, 76, 85, 83,
+ 128, 79, 66, 69, 76, 79, 83, 128, 79, 66, 128, 79, 65, 89, 128, 79, 65,
+ 75, 128, 79, 65, 66, 79, 65, 70, 73, 76, 73, 128, 79, 193, 79, 48, 53,
+ 49, 128, 79, 48, 53, 48, 66, 128, 79, 48, 53, 48, 65, 128, 79, 48, 53,
+ 48, 128, 79, 48, 52, 57, 128, 79, 48, 52, 56, 128, 79, 48, 52, 55, 128,
+ 79, 48, 52, 54, 128, 79, 48, 52, 53, 128, 79, 48, 52, 52, 128, 79, 48,
+ 52, 51, 128, 79, 48, 52, 50, 128, 79, 48, 52, 49, 128, 79, 48, 52, 48,
+ 128, 79, 48, 51, 57, 128, 79, 48, 51, 56, 128, 79, 48, 51, 55, 128, 79,
+ 48, 51, 54, 68, 128, 79, 48, 51, 54, 67, 128, 79, 48, 51, 54, 66, 128,
+ 79, 48, 51, 54, 65, 128, 79, 48, 51, 54, 128, 79, 48, 51, 53, 128, 79,
+ 48, 51, 52, 128, 79, 48, 51, 51, 65, 128, 79, 48, 51, 51, 128, 79, 48,
+ 51, 50, 128, 79, 48, 51, 49, 128, 79, 48, 51, 48, 65, 128, 79, 48, 51,
+ 48, 128, 79, 48, 50, 57, 65, 128, 79, 48, 50, 57, 128, 79, 48, 50, 56,
+ 128, 79, 48, 50, 55, 128, 79, 48, 50, 54, 128, 79, 48, 50, 53, 65, 128,
+ 79, 48, 50, 53, 128, 79, 48, 50, 52, 65, 128, 79, 48, 50, 52, 128, 79,
+ 48, 50, 51, 128, 79, 48, 50, 50, 128, 79, 48, 50, 49, 128, 79, 48, 50,
+ 48, 65, 128, 79, 48, 50, 48, 128, 79, 48, 49, 57, 65, 128, 79, 48, 49,
+ 57, 128, 79, 48, 49, 56, 128, 79, 48, 49, 55, 128, 79, 48, 49, 54, 128,
+ 79, 48, 49, 53, 128, 79, 48, 49, 52, 128, 79, 48, 49, 51, 128, 79, 48,
+ 49, 50, 128, 79, 48, 49, 49, 128, 79, 48, 49, 48, 67, 128, 79, 48, 49,
+ 48, 66, 128, 79, 48, 49, 48, 65, 128, 79, 48, 49, 48, 128, 79, 48, 48,
+ 57, 128, 79, 48, 48, 56, 128, 79, 48, 48, 55, 128, 79, 48, 48, 54, 70,
+ 128, 79, 48, 48, 54, 69, 128, 79, 48, 48, 54, 68, 128, 79, 48, 48, 54,
+ 67, 128, 79, 48, 48, 54, 66, 128, 79, 48, 48, 54, 65, 128, 79, 48, 48,
+ 54, 128, 79, 48, 48, 53, 65, 128, 79, 48, 48, 53, 128, 79, 48, 48, 52,
+ 128, 79, 48, 48, 51, 128, 79, 48, 48, 50, 128, 79, 48, 48, 49, 65, 128,
+ 79, 48, 48, 49, 128, 79, 45, 89, 69, 128, 79, 45, 79, 45, 73, 128, 79,
+ 45, 69, 128, 78, 90, 89, 88, 128, 78, 90, 89, 84, 128, 78, 90, 89, 82,
+ 88, 128, 78, 90, 89, 82, 128, 78, 90, 89, 80, 128, 78, 90, 89, 128, 78,
+ 90, 85, 88, 128, 78, 90, 85, 82, 88, 128, 78, 90, 85, 82, 128, 78, 90,
+ 85, 81, 128, 78, 90, 85, 80, 128, 78, 90, 85, 79, 88, 128, 78, 90, 85,
+ 79, 128, 78, 90, 85, 206, 78, 90, 85, 128, 78, 90, 79, 88, 128, 78, 90,
+ 79, 80, 128, 78, 90, 73, 88, 128, 78, 90, 73, 84, 128, 78, 90, 73, 80,
+ 128, 78, 90, 73, 69, 88, 128, 78, 90, 73, 69, 80, 128, 78, 90, 73, 69,
+ 128, 78, 90, 73, 128, 78, 90, 69, 88, 128, 78, 90, 69, 85, 77, 128, 78,
+ 90, 69, 128, 78, 90, 65, 88, 128, 78, 90, 65, 84, 128, 78, 90, 65, 81,
+ 128, 78, 90, 65, 80, 128, 78, 90, 65, 128, 78, 90, 193, 78, 89, 87, 65,
+ 128, 78, 89, 85, 88, 128, 78, 89, 85, 85, 128, 78, 89, 85, 84, 128, 78,
+ 89, 85, 80, 128, 78, 89, 85, 79, 88, 128, 78, 89, 85, 79, 80, 128, 78,
+ 89, 85, 79, 128, 78, 89, 85, 78, 128, 78, 89, 85, 69, 128, 78, 89, 85,
+ 128, 78, 89, 79, 88, 128, 78, 89, 79, 84, 128, 78, 89, 79, 80, 128, 78,
+ 89, 79, 79, 128, 78, 89, 79, 78, 128, 78, 89, 79, 65, 128, 78, 89, 79,
+ 128, 78, 89, 74, 65, 128, 78, 89, 73, 88, 128, 78, 89, 73, 84, 128, 78,
+ 89, 73, 212, 78, 89, 73, 211, 78, 89, 73, 210, 78, 89, 73, 80, 128, 78,
+ 89, 73, 78, 45, 68, 79, 128, 78, 89, 73, 78, 128, 78, 89, 73, 73, 128,
+ 78, 89, 73, 69, 88, 128, 78, 89, 73, 69, 84, 128, 78, 89, 73, 69, 80,
+ 128, 78, 89, 73, 69, 128, 78, 89, 73, 65, 75, 69, 78, 199, 78, 89, 73,
+ 128, 78, 89, 201, 78, 89, 72, 65, 128, 78, 89, 69, 84, 128, 78, 89, 69,
+ 212, 78, 89, 69, 78, 128, 78, 89, 69, 72, 128, 78, 89, 69, 200, 78, 89,
+ 69, 69, 128, 78, 89, 69, 128, 78, 89, 196, 78, 89, 67, 65, 128, 78, 89,
+ 65, 85, 128, 78, 89, 65, 74, 128, 78, 89, 65, 73, 128, 78, 89, 65, 72,
+ 128, 78, 89, 65, 69, 77, 65, 69, 128, 78, 89, 65, 65, 128, 78, 87, 79,
+ 79, 128, 78, 87, 79, 128, 78, 87, 73, 73, 128, 78, 87, 73, 128, 78, 87,
+ 69, 128, 78, 87, 65, 65, 128, 78, 87, 65, 128, 78, 87, 128, 78, 86, 128,
+ 78, 85, 88, 128, 78, 85, 85, 78, 128, 78, 85, 85, 128, 78, 85, 84, 73,
+ 76, 76, 85, 128, 78, 85, 84, 128, 78, 85, 212, 78, 85, 82, 88, 128, 78,
+ 85, 82, 128, 78, 85, 80, 128, 78, 85, 79, 88, 128, 78, 85, 79, 80, 128,
+ 78, 85, 79, 128, 78, 85, 78, 85, 90, 128, 78, 85, 78, 85, 218, 78, 85,
+ 78, 71, 128, 78, 85, 78, 65, 86, 85, 212, 78, 85, 78, 65, 86, 73, 203,
+ 78, 85, 78, 128, 78, 85, 206, 78, 85, 77, 69, 82, 207, 78, 85, 77, 69,
+ 82, 65, 84, 79, 210, 78, 85, 77, 69, 82, 65, 204, 78, 85, 77, 66, 69, 82,
+ 83, 128, 78, 85, 77, 66, 69, 82, 128, 78, 85, 77, 128, 78, 85, 76, 76,
+ 128, 78, 85, 76, 204, 78, 85, 76, 128, 78, 85, 75, 84, 65, 128, 78, 85,
+ 75, 84, 193, 78, 85, 69, 78, 71, 128, 78, 85, 69, 128, 78, 85, 66, 73,
+ 65, 206, 78, 85, 65, 69, 128, 78, 85, 49, 49, 128, 78, 85, 49, 177, 78,
+ 85, 48, 50, 50, 65, 128, 78, 85, 48, 50, 50, 128, 78, 85, 48, 50, 49,
+ 128, 78, 85, 48, 50, 48, 128, 78, 85, 48, 49, 57, 128, 78, 85, 48, 49,
+ 56, 65, 128, 78, 85, 48, 49, 56, 128, 78, 85, 48, 49, 55, 128, 78, 85,
+ 48, 49, 54, 128, 78, 85, 48, 49, 53, 128, 78, 85, 48, 49, 52, 128, 78,
+ 85, 48, 49, 51, 128, 78, 85, 48, 49, 50, 128, 78, 85, 48, 49, 49, 65,
+ 128, 78, 85, 48, 49, 49, 128, 78, 85, 48, 49, 48, 65, 128, 78, 85, 48,
+ 49, 48, 128, 78, 85, 48, 48, 57, 128, 78, 85, 48, 48, 56, 128, 78, 85,
+ 48, 48, 55, 128, 78, 85, 48, 48, 54, 128, 78, 85, 48, 48, 53, 128, 78,
+ 85, 48, 48, 52, 128, 78, 85, 48, 48, 51, 128, 78, 85, 48, 48, 50, 128,
+ 78, 85, 48, 48, 49, 128, 78, 85, 45, 51, 128, 78, 85, 45, 50, 128, 78,
+ 85, 45, 49, 128, 78, 84, 88, 73, 86, 128, 78, 84, 88, 65, 128, 78, 84,
+ 85, 85, 128, 78, 84, 85, 77, 128, 78, 84, 85, 74, 128, 78, 84, 213, 78,
+ 84, 83, 65, 85, 128, 78, 84, 83, 65, 128, 78, 84, 79, 81, 80, 69, 78,
+ 128, 78, 84, 79, 71, 128, 78, 84, 79, 199, 78, 84, 73, 69, 197, 78, 84,
+ 72, 65, 85, 128, 78, 84, 69, 85, 78, 71, 66, 65, 128, 78, 84, 69, 85, 77,
+ 128, 78, 84, 69, 78, 128, 78, 84, 69, 69, 128, 78, 84, 65, 80, 128, 78,
+ 84, 65, 208, 78, 84, 65, 65, 128, 78, 84, 65, 128, 78, 83, 85, 79, 212,
+ 78, 83, 85, 78, 128, 78, 83, 85, 77, 128, 78, 83, 79, 77, 128, 78, 83,
+ 73, 69, 69, 84, 128, 78, 83, 73, 69, 69, 80, 128, 78, 83, 73, 69, 69,
+ 128, 78, 83, 72, 85, 84, 128, 78, 83, 72, 85, 212, 78, 83, 72, 85, 79,
+ 80, 128, 78, 83, 72, 85, 69, 128, 78, 83, 72, 73, 69, 69, 128, 78, 83,
+ 72, 69, 69, 128, 78, 83, 72, 65, 81, 128, 78, 83, 72, 65, 128, 78, 83,
+ 69, 85, 65, 69, 78, 128, 78, 83, 69, 78, 128, 78, 83, 65, 128, 78, 82,
+ 89, 88, 128, 78, 82, 89, 84, 128, 78, 82, 89, 82, 88, 128, 78, 82, 89,
+ 82, 128, 78, 82, 89, 80, 128, 78, 82, 89, 128, 78, 82, 85, 88, 128, 78,
+ 82, 85, 84, 128, 78, 82, 85, 82, 88, 128, 78, 82, 85, 82, 128, 78, 82,
+ 85, 80, 128, 78, 82, 85, 65, 128, 78, 82, 85, 128, 78, 82, 79, 88, 128,
+ 78, 82, 79, 80, 128, 78, 82, 79, 128, 78, 82, 69, 88, 128, 78, 82, 69,
+ 84, 128, 78, 82, 69, 211, 78, 82, 69, 80, 128, 78, 82, 69, 128, 78, 82,
+ 65, 88, 128, 78, 82, 65, 84, 128, 78, 82, 65, 80, 128, 78, 82, 65, 128,
+ 78, 81, 73, 71, 128, 78, 81, 65, 128, 78, 80, 76, 65, 128, 78, 80, 65,
+ 128, 78, 79, 90, 72, 75, 65, 128, 78, 79, 89, 128, 78, 79, 88, 128, 78,
+ 79, 87, 67, 128, 78, 79, 86, 73, 76, 69, 128, 78, 79, 86, 69, 77, 66, 69,
+ 82, 128, 78, 79, 84, 84, 79, 128, 78, 79, 84, 69, 83, 128, 78, 79, 84,
+ 69, 72, 69, 65, 68, 128, 78, 79, 84, 69, 72, 69, 65, 196, 78, 79, 84, 69,
+ 66, 79, 79, 75, 128, 78, 79, 84, 69, 66, 79, 79, 203, 78, 79, 84, 69,
+ 128, 78, 79, 84, 197, 78, 79, 84, 67, 72, 69, 196, 78, 79, 84, 67, 72,
+ 128, 78, 79, 84, 65, 84, 73, 79, 206, 78, 79, 84, 128, 78, 79, 212, 78,
+ 79, 83, 69, 128, 78, 79, 83, 197, 78, 79, 82, 84, 72, 87, 69, 83, 212,
+ 78, 79, 82, 84, 72, 69, 82, 206, 78, 79, 82, 84, 72, 69, 65, 83, 84, 45,
+ 80, 79, 73, 78, 84, 73, 78, 199, 78, 79, 82, 77, 65, 204, 78, 79, 82, 68,
+ 73, 195, 78, 79, 210, 78, 79, 80, 128, 78, 79, 79, 78, 85, 128, 78, 79,
+ 79, 128, 78, 79, 78, 70, 79, 82, 75, 73, 78, 71, 128, 78, 79, 78, 45, 80,
+ 79, 84, 65, 66, 76, 197, 78, 79, 78, 45, 74, 79, 73, 78, 69, 82, 128, 78,
+ 79, 78, 45, 66, 82, 69, 65, 75, 73, 78, 199, 78, 79, 78, 128, 78, 79, 77,
+ 73, 83, 77, 193, 78, 79, 77, 73, 78, 65, 204, 78, 79, 75, 72, 85, 75,
+ 128, 78, 79, 68, 69, 128, 78, 79, 65, 128, 78, 79, 45, 66, 82, 69, 65,
+ 203, 78, 79, 45, 53, 128, 78, 79, 45, 52, 128, 78, 79, 45, 51, 128, 78,
+ 79, 45, 50, 128, 78, 79, 45, 49, 128, 78, 78, 85, 85, 128, 78, 78, 85,
+ 128, 78, 78, 79, 79, 128, 78, 78, 78, 85, 85, 128, 78, 78, 78, 85, 128,
+ 78, 78, 78, 79, 79, 128, 78, 78, 78, 79, 128, 78, 78, 78, 73, 73, 128,
+ 78, 78, 78, 73, 128, 78, 78, 78, 69, 69, 128, 78, 78, 78, 69, 128, 78,
+ 78, 78, 65, 85, 128, 78, 78, 78, 65, 73, 128, 78, 78, 78, 65, 65, 128,
+ 78, 78, 78, 65, 128, 78, 78, 78, 128, 78, 78, 72, 65, 128, 78, 78, 71,
+ 79, 79, 128, 78, 78, 71, 79, 128, 78, 78, 71, 73, 73, 128, 78, 78, 71,
+ 73, 128, 78, 78, 71, 65, 65, 128, 78, 78, 71, 65, 128, 78, 78, 71, 128,
+ 78, 78, 66, 83, 80, 128, 78, 77, 128, 78, 76, 65, 85, 128, 78, 76, 48,
+ 50, 48, 128, 78, 76, 48, 49, 57, 128, 78, 76, 48, 49, 56, 128, 78, 76,
+ 48, 49, 55, 65, 128, 78, 76, 48, 49, 55, 128, 78, 76, 48, 49, 54, 128,
+ 78, 76, 48, 49, 53, 128, 78, 76, 48, 49, 52, 128, 78, 76, 48, 49, 51,
+ 128, 78, 76, 48, 49, 50, 128, 78, 76, 48, 49, 49, 128, 78, 76, 48, 49,
+ 48, 128, 78, 76, 48, 48, 57, 128, 78, 76, 48, 48, 56, 128, 78, 76, 48,
+ 48, 55, 128, 78, 76, 48, 48, 54, 128, 78, 76, 48, 48, 53, 65, 128, 78,
+ 76, 48, 48, 53, 128, 78, 76, 48, 48, 52, 128, 78, 76, 48, 48, 51, 128,
+ 78, 76, 48, 48, 50, 128, 78, 76, 48, 48, 49, 128, 78, 76, 128, 78, 75,
+ 79, 77, 128, 78, 75, 207, 78, 75, 73, 78, 68, 73, 128, 78, 75, 65, 85,
+ 128, 78, 75, 65, 65, 82, 65, 69, 128, 78, 75, 65, 128, 78, 74, 89, 88,
+ 128, 78, 74, 89, 84, 128, 78, 74, 89, 82, 88, 128, 78, 74, 89, 82, 128,
+ 78, 74, 89, 80, 128, 78, 74, 89, 128, 78, 74, 85, 88, 128, 78, 74, 85,
+ 82, 88, 128, 78, 74, 85, 82, 128, 78, 74, 85, 81, 65, 128, 78, 74, 85,
+ 80, 128, 78, 74, 85, 79, 88, 128, 78, 74, 85, 79, 128, 78, 74, 85, 69,
+ 81, 128, 78, 74, 85, 65, 69, 128, 78, 74, 85, 128, 78, 74, 79, 88, 128,
+ 78, 74, 79, 84, 128, 78, 74, 79, 80, 128, 78, 74, 79, 79, 128, 78, 74,
+ 79, 128, 78, 74, 73, 88, 128, 78, 74, 73, 84, 128, 78, 74, 73, 80, 128,
+ 78, 74, 73, 69, 88, 128, 78, 74, 73, 69, 84, 128, 78, 74, 73, 69, 80,
+ 128, 78, 74, 73, 69, 69, 128, 78, 74, 73, 69, 128, 78, 74, 73, 128, 78,
+ 74, 201, 78, 74, 69, 85, 88, 128, 78, 74, 69, 85, 84, 128, 78, 74, 69,
+ 85, 65, 69, 78, 65, 128, 78, 74, 69, 85, 65, 69, 77, 128, 78, 74, 69, 69,
+ 69, 69, 128, 78, 74, 69, 69, 128, 78, 74, 69, 197, 78, 74, 69, 128, 78,
+ 74, 65, 81, 128, 78, 74, 65, 80, 128, 78, 74, 65, 69, 77, 76, 73, 128,
+ 78, 74, 65, 69, 77, 128, 78, 74, 65, 65, 128, 78, 73, 90, 75, 207, 78,
+ 73, 88, 128, 78, 73, 84, 82, 69, 128, 78, 73, 83, 65, 71, 128, 78, 73,
+ 82, 85, 71, 85, 128, 78, 73, 80, 128, 78, 73, 78, 84, 72, 128, 78, 73,
+ 78, 74, 65, 128, 78, 73, 78, 69, 84, 89, 128, 78, 73, 78, 69, 84, 217,
+ 78, 73, 78, 69, 84, 69, 69, 78, 128, 78, 73, 78, 69, 84, 69, 69, 206, 78,
+ 73, 78, 69, 45, 84, 72, 73, 82, 84, 89, 128, 78, 73, 78, 69, 45, 76, 73,
+ 75, 197, 78, 73, 78, 197, 78, 73, 78, 68, 65, 50, 128, 78, 73, 78, 68,
+ 65, 178, 78, 73, 78, 57, 128, 78, 73, 78, 128, 78, 73, 77, 128, 78, 73,
+ 205, 78, 73, 75, 79, 76, 83, 66, 85, 82, 199, 78, 73, 75, 72, 65, 72, 73,
+ 84, 128, 78, 73, 75, 65, 72, 73, 84, 128, 78, 73, 75, 65, 128, 78, 73,
+ 72, 83, 72, 86, 65, 83, 65, 128, 78, 73, 71, 73, 68, 65, 77, 73, 78, 128,
+ 78, 73, 71, 73, 68, 65, 69, 83, 72, 128, 78, 73, 71, 72, 84, 128, 78, 73,
+ 71, 72, 212, 78, 73, 71, 71, 65, 72, 73, 84, 65, 128, 78, 73, 69, 88,
+ 128, 78, 73, 69, 85, 78, 45, 84, 73, 75, 69, 85, 84, 128, 78, 73, 69, 85,
+ 78, 45, 84, 72, 73, 69, 85, 84, 72, 128, 78, 73, 69, 85, 78, 45, 83, 73,
+ 79, 83, 128, 78, 73, 69, 85, 78, 45, 82, 73, 69, 85, 76, 128, 78, 73, 69,
+ 85, 78, 45, 80, 73, 69, 85, 80, 128, 78, 73, 69, 85, 78, 45, 80, 65, 78,
+ 83, 73, 79, 83, 128, 78, 73, 69, 85, 78, 45, 75, 73, 89, 69, 79, 75, 128,
+ 78, 73, 69, 85, 78, 45, 72, 73, 69, 85, 72, 128, 78, 73, 69, 85, 78, 45,
+ 67, 73, 69, 85, 67, 128, 78, 73, 69, 85, 78, 45, 67, 72, 73, 69, 85, 67,
+ 72, 128, 78, 73, 69, 85, 206, 78, 73, 69, 80, 128, 78, 73, 69, 128, 78,
+ 73, 66, 128, 78, 73, 65, 128, 78, 73, 50, 128, 78, 73, 45, 84, 69, 128,
+ 78, 73, 45, 55, 128, 78, 73, 45, 54, 128, 78, 73, 45, 53, 128, 78, 73,
+ 45, 52, 128, 78, 73, 45, 51, 128, 78, 73, 45, 50, 128, 78, 73, 45, 49,
+ 128, 78, 72, 85, 69, 128, 78, 72, 74, 65, 128, 78, 72, 65, 89, 128, 78,
+ 72, 128, 78, 71, 89, 69, 128, 78, 71, 86, 69, 128, 78, 71, 85, 85, 128,
+ 78, 71, 85, 79, 88, 128, 78, 71, 85, 79, 84, 128, 78, 71, 85, 79, 128,
+ 78, 71, 85, 65, 78, 128, 78, 71, 85, 65, 69, 84, 128, 78, 71, 85, 65, 69,
+ 128, 78, 71, 79, 88, 128, 78, 71, 79, 85, 128, 78, 71, 79, 213, 78, 71,
+ 79, 84, 128, 78, 71, 79, 81, 128, 78, 71, 79, 80, 128, 78, 71, 79, 78,
+ 128, 78, 71, 79, 77, 128, 78, 71, 79, 69, 72, 128, 78, 71, 79, 69, 200,
+ 78, 71, 207, 78, 71, 75, 89, 69, 69, 128, 78, 71, 75, 87, 65, 69, 78,
+ 128, 78, 71, 75, 85, 80, 128, 78, 71, 75, 85, 78, 128, 78, 71, 75, 85,
+ 77, 128, 78, 71, 75, 85, 69, 78, 90, 69, 85, 77, 128, 78, 71, 75, 85,
+ 197, 78, 71, 75, 73, 78, 68, 201, 78, 71, 75, 73, 69, 69, 128, 78, 71,
+ 75, 69, 85, 88, 128, 78, 71, 75, 69, 85, 82, 73, 128, 78, 71, 75, 69, 85,
+ 65, 69, 81, 128, 78, 71, 75, 69, 85, 65, 69, 77, 128, 78, 71, 75, 65, 81,
+ 128, 78, 71, 75, 65, 80, 128, 78, 71, 75, 65, 65, 77, 73, 128, 78, 71,
+ 75, 65, 128, 78, 71, 73, 69, 88, 128, 78, 71, 73, 69, 80, 128, 78, 71,
+ 73, 69, 128, 78, 71, 72, 65, 128, 78, 71, 71, 87, 65, 69, 78, 128, 78,
+ 71, 71, 85, 82, 65, 69, 128, 78, 71, 71, 85, 80, 128, 78, 71, 71, 85, 79,
+ 81, 128, 78, 71, 71, 85, 79, 209, 78, 71, 71, 85, 79, 78, 128, 78, 71,
+ 71, 85, 79, 77, 128, 78, 71, 71, 85, 77, 128, 78, 71, 71, 85, 69, 69, 84,
+ 128, 78, 71, 71, 85, 65, 69, 83, 72, 65, 197, 78, 71, 71, 85, 65, 69,
+ 206, 78, 71, 71, 85, 65, 128, 78, 71, 71, 85, 128, 78, 71, 71, 79, 79,
+ 128, 78, 71, 71, 79, 128, 78, 71, 71, 73, 128, 78, 71, 71, 69, 85, 88,
+ 128, 78, 71, 71, 69, 85, 65, 69, 84, 128, 78, 71, 71, 69, 85, 65, 69,
+ 128, 78, 71, 71, 69, 213, 78, 71, 71, 69, 78, 128, 78, 71, 71, 69, 69,
+ 84, 128, 78, 71, 71, 69, 69, 69, 69, 128, 78, 71, 71, 69, 69, 128, 78,
+ 71, 71, 69, 128, 78, 71, 71, 65, 80, 128, 78, 71, 71, 65, 65, 77, 65, 69,
+ 128, 78, 71, 71, 65, 65, 77, 128, 78, 71, 71, 65, 65, 128, 78, 71, 71,
+ 128, 78, 71, 69, 88, 128, 78, 71, 69, 85, 82, 69, 85, 84, 128, 78, 71,
+ 69, 80, 128, 78, 71, 69, 78, 128, 78, 71, 69, 69, 128, 78, 71, 69, 65,
+ 68, 65, 76, 128, 78, 71, 65, 88, 128, 78, 71, 65, 85, 128, 78, 71, 65,
+ 84, 128, 78, 71, 65, 211, 78, 71, 65, 81, 128, 78, 71, 65, 80, 128, 78,
+ 71, 65, 78, 71, 85, 128, 78, 71, 65, 78, 128, 78, 71, 65, 73, 128, 78,
+ 71, 65, 72, 128, 78, 71, 65, 65, 73, 128, 78, 71, 193, 78, 70, 128, 78,
+ 69, 88, 212, 78, 69, 88, 128, 78, 69, 87, 83, 80, 65, 80, 69, 82, 128,
+ 78, 69, 87, 76, 73, 78, 69, 128, 78, 69, 87, 76, 73, 78, 197, 78, 69, 87,
+ 193, 78, 69, 87, 128, 78, 69, 215, 78, 69, 85, 84, 82, 65, 76, 128, 78,
+ 69, 85, 84, 82, 65, 204, 78, 69, 85, 84, 69, 82, 128, 78, 69, 84, 87, 79,
+ 82, 75, 69, 196, 78, 69, 212, 78, 69, 83, 84, 73, 78, 199, 78, 69, 83,
+ 84, 69, 196, 78, 69, 83, 84, 128, 78, 69, 83, 212, 78, 69, 83, 83, 85,
+ 83, 128, 78, 69, 82, 196, 78, 69, 81, 85, 68, 65, 65, 128, 78, 69, 80,
+ 84, 85, 78, 69, 128, 78, 69, 80, 84, 85, 78, 197, 78, 69, 80, 79, 83, 84,
+ 79, 89, 65, 78, 78, 65, 89, 65, 128, 78, 69, 80, 128, 78, 69, 79, 128,
+ 78, 69, 207, 78, 69, 78, 79, 69, 128, 78, 69, 78, 65, 78, 79, 128, 78,
+ 69, 78, 128, 78, 69, 77, 75, 65, 128, 78, 69, 76, 128, 78, 69, 73, 84,
+ 72, 69, 210, 78, 69, 71, 65, 84, 73, 86, 197, 78, 69, 71, 65, 84, 73, 79,
+ 206, 78, 69, 71, 65, 84, 69, 196, 78, 69, 69, 68, 76, 69, 128, 78, 69,
+ 67, 75, 84, 73, 69, 128, 78, 69, 67, 75, 128, 78, 69, 66, 69, 78, 83, 84,
+ 73, 77, 77, 69, 128, 78, 69, 45, 75, 79, 128, 78, 68, 85, 88, 128, 78,
+ 68, 85, 84, 128, 78, 68, 85, 82, 88, 128, 78, 68, 85, 82, 128, 78, 68,
+ 85, 80, 128, 78, 68, 85, 78, 128, 78, 68, 213, 78, 68, 79, 88, 128, 78,
+ 68, 79, 84, 128, 78, 68, 79, 80, 128, 78, 68, 79, 79, 128, 78, 68, 79,
+ 78, 128, 78, 68, 79, 77, 66, 85, 128, 78, 68, 79, 76, 197, 78, 68, 73,
+ 88, 128, 78, 68, 73, 84, 128, 78, 68, 73, 81, 128, 78, 68, 73, 80, 128,
+ 78, 68, 73, 69, 88, 128, 78, 68, 73, 69, 128, 78, 68, 73, 68, 65, 128,
+ 78, 68, 73, 65, 81, 128, 78, 68, 69, 88, 128, 78, 68, 69, 85, 88, 128,
+ 78, 68, 69, 85, 84, 128, 78, 68, 69, 85, 65, 69, 82, 69, 69, 128, 78, 68,
+ 69, 80, 128, 78, 68, 69, 69, 128, 78, 68, 69, 128, 78, 68, 65, 88, 128,
+ 78, 68, 65, 84, 128, 78, 68, 65, 80, 128, 78, 68, 65, 77, 128, 78, 68,
+ 65, 65, 78, 71, 71, 69, 85, 65, 69, 84, 128, 78, 68, 65, 65, 128, 78, 68,
+ 65, 193, 78, 67, 72, 65, 85, 128, 78, 67, 65, 128, 78, 66, 89, 88, 128,
+ 78, 66, 89, 84, 128, 78, 66, 89, 82, 88, 128, 78, 66, 89, 82, 128, 78,
+ 66, 89, 80, 128, 78, 66, 89, 128, 78, 66, 85, 88, 128, 78, 66, 85, 84,
+ 128, 78, 66, 85, 82, 88, 128, 78, 66, 85, 82, 128, 78, 66, 85, 80, 128,
+ 78, 66, 85, 128, 78, 66, 79, 88, 128, 78, 66, 79, 84, 128, 78, 66, 79,
+ 80, 128, 78, 66, 79, 128, 78, 66, 73, 88, 128, 78, 66, 73, 84, 128, 78,
+ 66, 73, 80, 128, 78, 66, 73, 69, 88, 128, 78, 66, 73, 69, 80, 128, 78,
+ 66, 73, 69, 128, 78, 66, 73, 128, 78, 66, 72, 128, 78, 66, 65, 88, 128,
+ 78, 66, 65, 84, 128, 78, 66, 65, 80, 128, 78, 66, 65, 128, 78, 65, 90,
+ 65, 210, 78, 65, 89, 65, 78, 78, 65, 128, 78, 65, 89, 128, 78, 65, 88,
+ 73, 65, 206, 78, 65, 88, 128, 78, 65, 85, 84, 72, 83, 128, 78, 65, 85,
+ 83, 69, 65, 84, 69, 196, 78, 65, 85, 68, 73, 218, 78, 65, 84, 85, 82, 65,
+ 204, 78, 65, 84, 84, 73, 76, 73, 203, 78, 65, 84, 73, 79, 78, 65, 204,
+ 78, 65, 83, 75, 65, 80, 201, 78, 65, 83, 72, 73, 128, 78, 65, 83, 65, 76,
+ 73, 90, 69, 196, 78, 65, 83, 65, 76, 73, 90, 65, 84, 73, 79, 78, 128, 78,
+ 65, 83, 65, 76, 73, 90, 65, 84, 73, 79, 206, 78, 65, 83, 65, 204, 78, 65,
+ 82, 82, 79, 215, 78, 65, 82, 128, 78, 65, 81, 128, 78, 65, 79, 211, 78,
+ 65, 78, 83, 65, 78, 65, 81, 128, 78, 65, 78, 71, 77, 79, 78, 84, 72, 79,
+ 128, 78, 65, 78, 68, 73, 78, 65, 71, 65, 82, 201, 78, 65, 78, 68, 128,
+ 78, 65, 78, 65, 128, 78, 65, 77, 69, 128, 78, 65, 77, 197, 78, 65, 77,
+ 50, 128, 78, 65, 75, 65, 65, 82, 193, 78, 65, 75, 128, 78, 65, 73, 82,
+ 193, 78, 65, 73, 204, 78, 65, 71, 82, 201, 78, 65, 71, 65, 82, 128, 78,
+ 65, 71, 65, 128, 78, 65, 71, 193, 78, 65, 71, 128, 78, 65, 199, 78, 65,
+ 69, 128, 78, 65, 66, 76, 65, 128, 78, 65, 66, 65, 84, 65, 69, 65, 206,
+ 78, 65, 65, 83, 73, 75, 89, 65, 89, 65, 128, 78, 65, 65, 75, 83, 73, 75,
+ 89, 65, 89, 65, 128, 78, 65, 65, 73, 128, 78, 65, 193, 78, 65, 52, 128,
+ 78, 65, 50, 128, 78, 65, 45, 57, 128, 78, 65, 45, 56, 128, 78, 65, 45,
+ 55, 128, 78, 65, 45, 54, 128, 78, 65, 45, 53, 128, 78, 65, 45, 52, 128,
+ 78, 65, 45, 51, 128, 78, 65, 45, 50, 128, 78, 65, 45, 49, 128, 78, 48,
+ 52, 50, 128, 78, 48, 52, 49, 128, 78, 48, 52, 48, 128, 78, 48, 51, 57,
+ 128, 78, 48, 51, 56, 128, 78, 48, 51, 55, 65, 128, 78, 48, 51, 55, 128,
+ 78, 48, 51, 54, 128, 78, 48, 51, 53, 65, 128, 78, 48, 51, 53, 128, 78,
+ 48, 51, 52, 65, 128, 78, 48, 51, 52, 128, 78, 48, 51, 51, 65, 128, 78,
+ 48, 51, 51, 128, 78, 48, 51, 50, 128, 78, 48, 51, 49, 128, 78, 48, 51,
+ 48, 128, 78, 48, 50, 57, 128, 78, 48, 50, 56, 128, 78, 48, 50, 55, 128,
+ 78, 48, 50, 54, 128, 78, 48, 50, 53, 65, 128, 78, 48, 50, 53, 128, 78,
+ 48, 50, 52, 128, 78, 48, 50, 51, 128, 78, 48, 50, 50, 128, 78, 48, 50,
+ 49, 128, 78, 48, 50, 48, 128, 78, 48, 49, 57, 128, 78, 48, 49, 56, 66,
+ 128, 78, 48, 49, 56, 65, 128, 78, 48, 49, 56, 128, 78, 48, 49, 55, 128,
+ 78, 48, 49, 54, 128, 78, 48, 49, 53, 128, 78, 48, 49, 52, 128, 78, 48,
+ 49, 51, 128, 78, 48, 49, 50, 128, 78, 48, 49, 49, 128, 78, 48, 49, 48,
+ 128, 78, 48, 48, 57, 128, 78, 48, 48, 56, 128, 78, 48, 48, 55, 128, 78,
+ 48, 48, 54, 128, 78, 48, 48, 53, 128, 78, 48, 48, 52, 128, 78, 48, 48,
+ 51, 128, 78, 48, 48, 50, 128, 78, 48, 48, 49, 128, 78, 45, 77, 85, 45,
+ 77, 79, 45, 50, 128, 78, 45, 77, 85, 45, 77, 79, 45, 49, 128, 78, 45, 67,
+ 82, 69, 197, 78, 45, 65, 82, 217, 77, 90, 128, 77, 89, 88, 128, 77, 89,
+ 84, 128, 77, 89, 83, 76, 73, 84, 69, 128, 77, 89, 80, 128, 77, 89, 65,
+ 128, 77, 89, 193, 77, 87, 79, 79, 128, 77, 87, 79, 128, 77, 87, 73, 73,
+ 128, 77, 87, 73, 128, 77, 87, 69, 69, 128, 77, 87, 69, 128, 77, 87, 65,
+ 65, 128, 77, 87, 65, 128, 77, 87, 128, 77, 215, 77, 86, 83, 128, 77, 86,
+ 79, 80, 128, 77, 86, 73, 128, 77, 86, 69, 85, 65, 69, 78, 71, 65, 77,
+ 128, 77, 86, 128, 77, 214, 77, 85, 88, 128, 77, 85, 85, 86, 85, 90, 72,
+ 65, 75, 75, 85, 128, 77, 85, 85, 83, 73, 75, 65, 84, 79, 65, 78, 128, 77,
+ 85, 85, 82, 68, 72, 65, 74, 193, 77, 85, 85, 128, 77, 85, 84, 72, 65, 76,
+ 73, 89, 65, 128, 77, 85, 84, 128, 77, 85, 83, 73, 67, 128, 77, 85, 83,
+ 73, 195, 77, 85, 83, 72, 82, 79, 79, 77, 128, 77, 85, 83, 72, 51, 128,
+ 77, 85, 83, 72, 179, 77, 85, 83, 72, 128, 77, 85, 83, 200, 77, 85, 83,
+ 128, 77, 85, 82, 88, 128, 77, 85, 82, 71, 85, 50, 128, 77, 85, 82, 69,
+ 128, 77, 85, 82, 68, 65, 128, 77, 85, 82, 68, 193, 77, 85, 82, 128, 77,
+ 85, 81, 68, 65, 77, 128, 77, 85, 80, 128, 77, 85, 79, 88, 128, 77, 85,
+ 79, 84, 128, 77, 85, 79, 80, 128, 77, 85, 79, 77, 65, 69, 128, 77, 85,
+ 79, 128, 77, 85, 78, 83, 85, 66, 128, 77, 85, 78, 68, 65, 82, 201, 77,
+ 85, 78, 65, 72, 128, 77, 85, 78, 128, 77, 85, 76, 84, 73, 83, 69, 84,
+ 128, 77, 85, 76, 84, 73, 83, 69, 212, 77, 85, 76, 84, 73, 80, 76, 73, 67,
+ 65, 84, 73, 79, 78, 128, 77, 85, 76, 84, 73, 80, 76, 73, 67, 65, 84, 73,
+ 79, 206, 77, 85, 76, 84, 73, 80, 76, 69, 128, 77, 85, 76, 84, 73, 80, 76,
+ 197, 77, 85, 76, 84, 73, 79, 67, 85, 76, 65, 210, 77, 85, 76, 84, 73, 77,
+ 65, 80, 128, 77, 85, 76, 84, 201, 77, 85, 76, 84, 65, 78, 201, 77, 85,
+ 75, 80, 72, 82, 69, 78, 71, 128, 77, 85, 75, 75, 85, 82, 85, 78, 73, 128,
+ 77, 85, 73, 78, 128, 77, 85, 72, 79, 82, 128, 77, 85, 71, 83, 128, 77,
+ 85, 71, 128, 77, 85, 199, 77, 85, 69, 78, 128, 77, 85, 69, 128, 77, 85,
+ 67, 72, 128, 77, 85, 67, 200, 77, 85, 67, 65, 65, 68, 128, 77, 85, 65,
+ 83, 128, 77, 85, 65, 78, 128, 77, 85, 65, 69, 128, 77, 85, 45, 71, 65,
+ 65, 72, 76, 65, 193, 77, 85, 45, 52, 128, 77, 85, 45, 51, 128, 77, 85,
+ 45, 50, 128, 77, 85, 45, 49, 128, 77, 213, 77, 84, 65, 86, 82, 85, 76,
+ 201, 77, 83, 128, 77, 82, 207, 77, 82, 65, 67, 72, 78, 89, 128, 77, 82,
+ 65, 67, 72, 78, 79, 84, 73, 75, 72, 65, 89, 65, 128, 77, 82, 65, 67, 72,
+ 78, 79, 128, 77, 82, 65, 67, 72, 78, 65, 89, 65, 128, 77, 210, 77, 81,
+ 128, 77, 80, 65, 128, 77, 79, 89, 65, 73, 128, 77, 79, 88, 128, 77, 79,
+ 86, 73, 197, 77, 79, 86, 69, 211, 77, 79, 86, 69, 77, 69, 78, 84, 45, 87,
+ 65, 76, 76, 80, 76, 65, 78, 197, 77, 79, 86, 69, 77, 69, 78, 84, 45, 72,
+ 73, 78, 71, 197, 77, 79, 86, 69, 77, 69, 78, 84, 45, 70, 76, 79, 79, 82,
+ 80, 76, 65, 78, 197, 77, 79, 86, 69, 77, 69, 78, 84, 45, 68, 73, 65, 71,
+ 79, 78, 65, 204, 77, 79, 86, 69, 77, 69, 78, 84, 128, 77, 79, 86, 69, 77,
+ 69, 78, 212, 77, 79, 86, 69, 196, 77, 79, 86, 69, 128, 77, 79, 85, 84,
+ 72, 128, 77, 79, 85, 83, 69, 128, 77, 79, 85, 83, 197, 77, 79, 85, 78,
+ 84, 65, 73, 78, 83, 128, 77, 79, 85, 78, 84, 65, 73, 78, 128, 77, 79, 85,
+ 78, 84, 65, 73, 206, 77, 79, 85, 78, 212, 77, 79, 85, 78, 68, 128, 77,
+ 79, 85, 78, 196, 77, 79, 84, 79, 82, 87, 65, 89, 128, 77, 79, 84, 79, 82,
+ 73, 90, 69, 196, 77, 79, 84, 79, 82, 67, 89, 67, 76, 69, 128, 77, 79, 84,
+ 79, 210, 77, 79, 84, 72, 69, 82, 128, 77, 79, 84, 72, 69, 210, 77, 79,
+ 84, 128, 77, 79, 83, 81, 85, 73, 84, 79, 128, 77, 79, 83, 81, 85, 69,
+ 128, 77, 79, 82, 84, 85, 85, 77, 128, 77, 79, 82, 84, 65, 82, 128, 77,
+ 79, 82, 80, 72, 79, 76, 79, 71, 73, 67, 65, 204, 77, 79, 82, 78, 73, 78,
+ 71, 128, 77, 79, 80, 128, 77, 79, 79, 83, 69, 45, 67, 82, 69, 197, 77,
+ 79, 79, 83, 69, 128, 77, 79, 79, 78, 128, 77, 79, 79, 206, 77, 79, 79,
+ 77, 80, 85, 81, 128, 77, 79, 79, 77, 69, 85, 84, 128, 77, 79, 79, 68,
+ 128, 77, 79, 79, 196, 77, 79, 79, 128, 77, 79, 78, 84, 73, 69, 69, 78,
+ 128, 77, 79, 78, 84, 72, 128, 77, 79, 78, 84, 200, 77, 79, 78, 83, 84,
+ 69, 82, 128, 77, 79, 78, 79, 83, 84, 65, 66, 76, 197, 77, 79, 78, 79, 83,
+ 80, 65, 67, 197, 77, 79, 78, 79, 82, 65, 73, 76, 128, 77, 79, 78, 79, 71,
+ 82, 65, 80, 200, 77, 79, 78, 79, 71, 82, 65, 77, 77, 79, 211, 77, 79, 78,
+ 79, 71, 82, 65, 205, 77, 79, 78, 79, 70, 79, 78, 73, 65, 83, 128, 77, 79,
+ 78, 79, 67, 85, 76, 65, 210, 77, 79, 78, 79, 67, 76, 69, 128, 77, 79, 78,
+ 75, 69, 89, 128, 77, 79, 78, 75, 69, 217, 77, 79, 78, 73, 128, 77, 79,
+ 78, 71, 75, 69, 85, 65, 69, 81, 128, 77, 79, 78, 69, 89, 45, 77, 79, 85,
+ 84, 200, 77, 79, 78, 69, 217, 77, 79, 78, 128, 77, 79, 206, 77, 79, 76,
+ 128, 77, 79, 75, 72, 65, 83, 83, 65, 83, 128, 77, 79, 72, 65, 77, 77, 65,
+ 196, 77, 79, 68, 85, 76, 207, 77, 79, 68, 73, 70, 73, 69, 82, 45, 57,
+ 128, 77, 79, 68, 73, 70, 73, 69, 82, 45, 56, 128, 77, 79, 68, 73, 70, 73,
+ 69, 82, 45, 55, 128, 77, 79, 68, 73, 70, 73, 69, 82, 45, 54, 128, 77, 79,
+ 68, 73, 70, 73, 69, 82, 45, 53, 128, 77, 79, 68, 73, 70, 73, 69, 82, 45,
+ 52, 128, 77, 79, 68, 73, 70, 73, 69, 82, 45, 51, 128, 77, 79, 68, 73, 70,
+ 73, 69, 82, 45, 50, 128, 77, 79, 68, 73, 70, 73, 69, 82, 45, 49, 54, 128,
+ 77, 79, 68, 73, 70, 73, 69, 82, 45, 49, 53, 128, 77, 79, 68, 73, 70, 73,
+ 69, 82, 45, 49, 52, 128, 77, 79, 68, 73, 70, 73, 69, 82, 45, 49, 51, 128,
+ 77, 79, 68, 73, 70, 73, 69, 82, 45, 49, 50, 128, 77, 79, 68, 73, 70, 73,
+ 69, 82, 45, 49, 49, 128, 77, 79, 68, 73, 70, 73, 69, 82, 45, 49, 48, 128,
+ 77, 79, 68, 73, 70, 73, 69, 82, 128, 77, 79, 68, 201, 77, 79, 68, 69, 83,
+ 84, 89, 128, 77, 79, 68, 69, 82, 206, 77, 79, 68, 69, 77, 128, 77, 79,
+ 68, 69, 76, 83, 128, 77, 79, 68, 69, 76, 128, 77, 79, 68, 69, 128, 77,
+ 79, 66, 73, 76, 197, 77, 79, 65, 128, 77, 79, 45, 54, 128, 77, 79, 45,
+ 53, 128, 77, 79, 45, 52, 128, 77, 79, 45, 51, 128, 77, 207, 77, 78, 89,
+ 65, 205, 77, 78, 65, 83, 128, 77, 77, 83, 80, 128, 77, 77, 128, 77, 205,
+ 77, 76, 65, 128, 77, 76, 128, 77, 75, 80, 65, 82, 65, 209, 77, 73, 88,
+ 128, 77, 73, 84, 128, 77, 73, 83, 82, 65, 128, 77, 73, 82, 82, 79, 82,
+ 128, 77, 73, 82, 82, 79, 210, 77, 73, 82, 73, 66, 65, 65, 82, 85, 128,
+ 77, 73, 82, 73, 128, 77, 73, 82, 69, 68, 128, 77, 73, 80, 128, 77, 73,
+ 78, 89, 128, 77, 73, 78, 85, 83, 45, 79, 82, 45, 80, 76, 85, 211, 77, 73,
+ 78, 85, 83, 128, 77, 73, 78, 78, 65, 206, 77, 73, 78, 73, 83, 84, 69, 82,
+ 128, 77, 73, 78, 73, 77, 73, 90, 69, 128, 77, 73, 78, 73, 77, 65, 128,
+ 77, 73, 78, 73, 68, 73, 83, 67, 128, 77, 73, 78, 73, 66, 85, 83, 128, 77,
+ 73, 78, 68, 85, 128, 77, 73, 77, 69, 128, 77, 73, 77, 128, 77, 73, 76,
+ 76, 73, 79, 78, 83, 128, 77, 73, 76, 76, 73, 79, 78, 211, 77, 73, 76, 76,
+ 69, 84, 128, 77, 73, 76, 76, 197, 77, 73, 76, 204, 77, 73, 76, 75, 217,
+ 77, 73, 76, 75, 128, 77, 73, 76, 73, 84, 65, 82, 217, 77, 73, 76, 128,
+ 77, 73, 75, 85, 82, 79, 78, 128, 77, 73, 75, 82, 79, 206, 77, 73, 75, 82,
+ 73, 128, 77, 73, 73, 78, 128, 77, 73, 73, 77, 128, 77, 73, 73, 128, 77,
+ 73, 199, 77, 73, 69, 88, 128, 77, 73, 69, 85, 77, 45, 84, 73, 75, 69, 85,
+ 84, 128, 77, 73, 69, 85, 77, 45, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128,
+ 77, 73, 69, 85, 77, 45, 83, 83, 65, 78, 71, 78, 73, 69, 85, 78, 128, 77,
+ 73, 69, 85, 77, 45, 82, 73, 69, 85, 76, 128, 77, 73, 69, 85, 77, 45, 80,
+ 73, 69, 85, 80, 45, 83, 73, 79, 83, 128, 77, 73, 69, 85, 77, 45, 80, 73,
+ 69, 85, 80, 128, 77, 73, 69, 85, 77, 45, 80, 65, 78, 83, 73, 79, 83, 128,
+ 77, 73, 69, 85, 77, 45, 78, 73, 69, 85, 78, 128, 77, 73, 69, 85, 77, 45,
+ 67, 73, 69, 85, 67, 128, 77, 73, 69, 85, 77, 45, 67, 72, 73, 69, 85, 67,
+ 72, 128, 77, 73, 69, 85, 205, 77, 73, 69, 80, 128, 77, 73, 69, 69, 128,
+ 77, 73, 69, 128, 77, 73, 68, 76, 73, 78, 197, 77, 73, 68, 68, 76, 69, 45,
+ 87, 69, 76, 83, 200, 77, 73, 68, 68, 76, 69, 128, 77, 73, 68, 45, 76, 69,
+ 86, 69, 204, 77, 73, 68, 45, 72, 69, 73, 71, 72, 212, 77, 73, 196, 77,
+ 73, 67, 82, 79, 83, 67, 79, 80, 69, 128, 77, 73, 67, 82, 79, 80, 72, 79,
+ 78, 69, 128, 77, 73, 67, 82, 79, 66, 69, 128, 77, 73, 67, 82, 207, 77,
+ 73, 67, 210, 77, 73, 45, 55, 128, 77, 73, 45, 54, 128, 77, 73, 45, 53,
+ 128, 77, 73, 45, 52, 128, 77, 73, 45, 51, 128, 77, 73, 45, 50, 128, 77,
+ 73, 45, 49, 128, 77, 72, 90, 128, 77, 72, 65, 128, 77, 72, 128, 77, 71,
+ 85, 88, 128, 77, 71, 85, 84, 128, 77, 71, 85, 82, 88, 128, 77, 71, 85,
+ 82, 128, 77, 71, 85, 80, 128, 77, 71, 85, 79, 88, 128, 77, 71, 85, 79,
+ 80, 128, 77, 71, 85, 79, 128, 77, 71, 85, 128, 77, 71, 79, 88, 128, 77,
+ 71, 79, 84, 128, 77, 71, 79, 80, 128, 77, 71, 79, 128, 77, 71, 207, 77,
+ 71, 73, 69, 88, 128, 77, 71, 73, 69, 128, 77, 71, 69, 88, 128, 77, 71,
+ 69, 80, 128, 77, 71, 69, 128, 77, 71, 66, 85, 128, 77, 71, 66, 79, 79,
+ 128, 77, 71, 66, 79, 70, 85, 77, 128, 77, 71, 66, 79, 128, 77, 71, 66,
+ 73, 128, 77, 71, 66, 69, 85, 78, 128, 77, 71, 66, 69, 78, 128, 77, 71,
+ 66, 69, 69, 128, 77, 71, 66, 69, 128, 77, 71, 66, 65, 83, 65, 81, 128,
+ 77, 71, 66, 65, 83, 65, 128, 77, 71, 65, 88, 128, 77, 71, 65, 84, 128,
+ 77, 71, 65, 80, 128, 77, 71, 65, 128, 77, 71, 128, 77, 70, 79, 78, 128,
+ 77, 70, 79, 206, 77, 70, 79, 128, 77, 70, 73, 89, 65, 81, 128, 77, 70,
+ 73, 69, 69, 128, 77, 70, 69, 85, 84, 128, 77, 70, 69, 85, 81, 128, 77,
+ 70, 69, 85, 65, 69, 128, 77, 70, 65, 65, 128, 77, 69, 90, 90, 79, 128,
+ 77, 69, 88, 128, 77, 69, 85, 212, 77, 69, 85, 81, 128, 77, 69, 85, 78,
+ 74, 79, 77, 78, 68, 69, 85, 81, 128, 77, 69, 85, 78, 128, 77, 69, 84, 82,
+ 79, 128, 77, 69, 84, 82, 73, 67, 65, 204, 77, 69, 84, 82, 73, 65, 128,
+ 77, 69, 84, 82, 69, 84, 69, 211, 77, 69, 84, 79, 66, 69, 76, 85, 83, 128,
+ 77, 69, 84, 69, 75, 128, 77, 69, 84, 69, 71, 128, 77, 69, 84, 65, 76,
+ 128, 77, 69, 84, 193, 77, 69, 83, 83, 69, 78, 73, 65, 206, 77, 69, 83,
+ 83, 65, 71, 69, 128, 77, 69, 83, 83, 65, 71, 197, 77, 69, 83, 79, 128,
+ 77, 69, 83, 73, 128, 77, 69, 83, 72, 128, 77, 69, 82, 80, 69, 82, 83, 79,
+ 78, 128, 77, 69, 82, 75, 72, 65, 128, 77, 69, 82, 75, 72, 193, 77, 69,
+ 82, 73, 68, 73, 65, 78, 83, 128, 77, 69, 82, 73, 128, 77, 69, 82, 71, 69,
+ 128, 77, 69, 82, 67, 85, 82, 89, 128, 77, 69, 82, 67, 85, 82, 217, 77,
+ 69, 78, 79, 82, 65, 200, 77, 69, 78, 79, 69, 128, 77, 69, 78, 68, 85, 84,
+ 128, 77, 69, 78, 128, 77, 69, 77, 79, 128, 77, 69, 77, 66, 69, 82, 83,
+ 72, 73, 80, 128, 77, 69, 77, 66, 69, 82, 128, 77, 69, 77, 66, 69, 210,
+ 77, 69, 77, 45, 81, 79, 80, 72, 128, 77, 69, 77, 128, 77, 69, 205, 77,
+ 69, 76, 84, 73, 78, 199, 77, 69, 76, 79, 68, 73, 195, 77, 69, 76, 73, 75,
+ 128, 77, 69, 73, 90, 73, 128, 77, 69, 71, 65, 84, 79, 78, 128, 77, 69,
+ 71, 65, 80, 72, 79, 78, 69, 128, 77, 69, 71, 65, 76, 73, 128, 77, 69, 69,
+ 84, 79, 82, 85, 128, 77, 69, 69, 84, 69, 201, 77, 69, 69, 84, 128, 77,
+ 69, 69, 77, 85, 128, 77, 69, 69, 77, 128, 77, 69, 69, 202, 77, 69, 69,
+ 69, 69, 128, 77, 69, 68, 73, 85, 77, 128, 77, 69, 68, 73, 85, 205, 77,
+ 69, 68, 73, 69, 86, 65, 204, 77, 69, 68, 73, 67, 73, 78, 69, 128, 77, 69,
+ 68, 73, 67, 65, 204, 77, 69, 68, 73, 65, 204, 77, 69, 68, 69, 70, 65, 73,
+ 68, 82, 73, 206, 77, 69, 68, 65, 76, 128, 77, 69, 67, 72, 73, 75, 128,
+ 77, 69, 67, 72, 73, 203, 77, 69, 67, 72, 65, 78, 73, 67, 65, 204, 77, 69,
+ 65, 84, 128, 77, 69, 65, 212, 77, 69, 65, 83, 85, 82, 69, 196, 77, 69,
+ 65, 83, 85, 82, 69, 128, 77, 69, 65, 83, 85, 82, 197, 77, 69, 45, 77, 65,
+ 128, 77, 69, 45, 50, 128, 77, 69, 45, 49, 128, 77, 68, 85, 206, 77, 196,
+ 77, 67, 72, 213, 77, 67, 72, 65, 206, 77, 67, 128, 77, 195, 77, 66, 85,
+ 85, 128, 77, 66, 85, 79, 81, 128, 77, 66, 85, 79, 128, 77, 66, 85, 69,
+ 128, 77, 66, 85, 65, 69, 77, 128, 77, 66, 85, 65, 69, 128, 77, 66, 79,
+ 79, 128, 77, 66, 79, 128, 77, 66, 73, 84, 128, 77, 66, 73, 212, 77, 66,
+ 73, 82, 73, 69, 69, 78, 128, 77, 66, 73, 128, 77, 66, 69, 85, 88, 128,
+ 77, 66, 69, 85, 82, 73, 128, 77, 66, 69, 85, 77, 128, 77, 66, 69, 82, 65,
+ 69, 128, 77, 66, 69, 78, 128, 77, 66, 69, 69, 75, 69, 69, 84, 128, 77,
+ 66, 69, 69, 128, 77, 66, 69, 128, 77, 66, 65, 81, 128, 77, 66, 65, 78,
+ 89, 73, 128, 77, 66, 65, 65, 82, 65, 69, 128, 77, 66, 65, 65, 75, 69, 84,
+ 128, 77, 66, 65, 65, 128, 77, 66, 65, 193, 77, 66, 193, 77, 66, 52, 128,
+ 77, 66, 51, 128, 77, 66, 50, 128, 77, 65, 89, 69, 203, 77, 65, 89, 65,
+ 78, 78, 65, 128, 77, 65, 89, 65, 206, 77, 65, 89, 128, 77, 65, 88, 73,
+ 77, 73, 90, 69, 128, 77, 65, 88, 73, 77, 65, 128, 77, 65, 88, 128, 77,
+ 65, 85, 128, 77, 65, 84, 84, 79, 67, 75, 128, 77, 65, 84, 82, 73, 88,
+ 128, 77, 65, 84, 69, 82, 73, 65, 76, 83, 128, 77, 65, 84, 128, 77, 65,
+ 83, 213, 77, 65, 83, 83, 73, 78, 71, 128, 77, 65, 83, 83, 65, 71, 69,
+ 128, 77, 65, 83, 79, 82, 193, 77, 65, 83, 75, 128, 77, 65, 83, 203, 77,
+ 65, 83, 72, 70, 65, 65, 84, 128, 77, 65, 83, 72, 50, 128, 77, 65, 83, 67,
+ 85, 76, 73, 78, 197, 77, 65, 83, 65, 82, 65, 205, 77, 65, 82, 89, 128,
+ 77, 65, 82, 87, 65, 82, 201, 77, 65, 82, 85, 75, 85, 128, 77, 65, 82, 84,
+ 89, 82, 73, 193, 77, 65, 82, 84, 73, 65, 204, 77, 65, 82, 82, 89, 73, 78,
+ 199, 77, 65, 82, 82, 73, 65, 71, 197, 77, 65, 82, 82, 65, 84, 65, 78,
+ 128, 77, 65, 82, 75, 211, 77, 65, 82, 75, 69, 82, 128, 77, 65, 82, 75,
+ 45, 52, 128, 77, 65, 82, 75, 45, 51, 128, 77, 65, 82, 75, 45, 50, 128,
+ 77, 65, 82, 75, 45, 49, 128, 77, 65, 82, 69, 128, 77, 65, 82, 67, 72, 69,
+ 206, 77, 65, 82, 67, 72, 128, 77, 65, 82, 67, 65, 84, 79, 45, 83, 84, 65,
+ 67, 67, 65, 84, 79, 128, 77, 65, 82, 67, 65, 84, 79, 128, 77, 65, 82, 67,
+ 65, 83, 73, 84, 69, 128, 77, 65, 82, 66, 85, 84, 65, 128, 77, 65, 82, 66,
+ 85, 84, 193, 77, 65, 82, 65, 67, 65, 83, 128, 77, 65, 82, 128, 77, 65,
+ 81, 65, 70, 128, 77, 65, 81, 128, 77, 65, 80, 76, 197, 77, 65, 80, 73,
+ 81, 128, 77, 65, 208, 77, 65, 79, 128, 77, 65, 78, 85, 65, 204, 77, 65,
+ 78, 84, 69, 76, 80, 73, 69, 67, 197, 77, 65, 78, 83, 89, 79, 78, 128, 77,
+ 65, 78, 83, 85, 65, 69, 128, 77, 65, 78, 78, 65, 218, 77, 65, 78, 78, 65,
+ 128, 77, 65, 78, 73, 67, 72, 65, 69, 65, 206, 77, 65, 78, 71, 79, 128,
+ 77, 65, 78, 71, 65, 76, 65, 77, 128, 77, 65, 78, 68, 65, 82, 73, 78, 128,
+ 77, 65, 78, 68, 65, 73, 76, 73, 78, 199, 77, 65, 78, 68, 65, 73, 195, 77,
+ 65, 78, 67, 72, 213, 77, 65, 78, 65, 212, 77, 65, 78, 65, 67, 76, 69, 83,
+ 128, 77, 65, 77, 77, 79, 84, 72, 128, 77, 65, 76, 84, 69, 83, 197, 77,
+ 65, 76, 207, 77, 65, 76, 69, 69, 82, 73, 128, 77, 65, 76, 197, 77, 65,
+ 76, 65, 75, 79, 206, 77, 65, 75, 83, 85, 82, 65, 128, 77, 65, 75, 83, 85,
+ 82, 193, 77, 65, 75, 69, 77, 65, 75, 69, 128, 77, 65, 75, 65, 83, 65,
+ 210, 77, 65, 73, 90, 69, 128, 77, 65, 73, 89, 65, 77, 79, 75, 128, 77,
+ 65, 73, 84, 65, 73, 75, 72, 85, 128, 77, 65, 73, 82, 85, 128, 77, 65, 73,
+ 77, 85, 65, 78, 128, 77, 65, 73, 77, 65, 76, 65, 73, 128, 77, 65, 73, 76,
+ 66, 79, 216, 77, 65, 73, 75, 85, 82, 79, 128, 77, 65, 73, 68, 69, 78,
+ 128, 77, 65, 73, 128, 77, 65, 72, 74, 79, 78, 199, 77, 65, 72, 72, 65,
+ 128, 77, 65, 72, 65, 80, 82, 65, 78, 65, 128, 77, 65, 72, 65, 80, 65, 75,
+ 72, 128, 77, 65, 72, 65, 74, 65, 78, 201, 77, 65, 72, 65, 65, 80, 82, 65,
+ 65, 78, 193, 77, 65, 72, 128, 77, 65, 71, 78, 73, 70, 89, 73, 78, 199,
+ 77, 65, 71, 78, 69, 84, 128, 77, 65, 71, 73, 195, 77, 65, 71, 69, 128,
+ 77, 65, 69, 83, 73, 128, 77, 65, 69, 78, 89, 73, 128, 77, 65, 69, 78, 74,
+ 69, 84, 128, 77, 65, 69, 77, 86, 69, 85, 88, 128, 77, 65, 69, 77, 75, 80,
+ 69, 78, 128, 77, 65, 69, 77, 71, 66, 73, 69, 69, 128, 77, 65, 69, 77, 66,
+ 71, 66, 73, 69, 69, 128, 77, 65, 69, 77, 66, 65, 128, 77, 65, 69, 77,
+ 128, 77, 65, 69, 76, 69, 69, 128, 77, 65, 69, 75, 69, 85, 80, 128, 77,
+ 65, 68, 89, 65, 128, 77, 65, 68, 85, 128, 77, 65, 68, 68, 65, 72, 128,
+ 77, 65, 68, 68, 65, 200, 77, 65, 68, 68, 65, 128, 77, 65, 68, 68, 193,
+ 77, 65, 67, 82, 79, 78, 45, 71, 82, 65, 86, 69, 128, 77, 65, 67, 82, 79,
+ 78, 45, 66, 82, 69, 86, 69, 128, 77, 65, 67, 82, 79, 78, 45, 65, 67, 85,
+ 84, 69, 128, 77, 65, 67, 82, 79, 78, 128, 77, 65, 67, 82, 79, 206, 77,
+ 65, 67, 72, 73, 78, 69, 128, 77, 65, 65, 89, 89, 65, 65, 128, 77, 65, 65,
+ 73, 128, 77, 65, 65, 128, 77, 65, 50, 128, 77, 65, 45, 55, 128, 77, 65,
+ 45, 54, 128, 77, 65, 45, 53, 128, 77, 65, 45, 52, 128, 77, 65, 45, 51,
+ 128, 77, 65, 45, 50, 128, 77, 65, 45, 49, 128, 77, 49, 57, 183, 77, 49,
+ 57, 182, 77, 49, 57, 181, 77, 49, 57, 180, 77, 49, 57, 179, 77, 49, 57,
+ 178, 77, 49, 57, 177, 77, 49, 57, 176, 77, 49, 56, 185, 77, 49, 56, 184,
+ 77, 49, 56, 183, 77, 49, 56, 182, 77, 49, 56, 181, 77, 49, 56, 180, 77,
+ 49, 56, 179, 77, 49, 56, 178, 77, 49, 56, 177, 77, 49, 56, 176, 77, 49,
+ 55, 185, 77, 49, 55, 184, 77, 49, 55, 183, 77, 49, 55, 182, 77, 49, 55,
+ 181, 77, 49, 55, 180, 77, 49, 55, 179, 77, 49, 55, 178, 77, 49, 55, 177,
+ 77, 49, 55, 176, 77, 49, 54, 185, 77, 49, 54, 184, 77, 49, 54, 183, 77,
+ 49, 54, 182, 77, 49, 54, 181, 77, 49, 54, 180, 77, 49, 54, 179, 77, 49,
+ 54, 178, 77, 49, 54, 177, 77, 49, 54, 176, 77, 49, 53, 185, 77, 49, 53,
+ 184, 77, 49, 53, 183, 77, 49, 53, 182, 77, 49, 53, 181, 77, 49, 53, 180,
+ 77, 49, 53, 179, 77, 49, 53, 178, 77, 49, 53, 177, 77, 49, 53, 176, 77,
+ 49, 52, 185, 77, 49, 52, 184, 77, 49, 52, 183, 77, 49, 52, 182, 77, 49,
+ 52, 181, 77, 49, 52, 180, 77, 49, 52, 179, 77, 49, 52, 178, 77, 49, 52,
+ 177, 77, 49, 52, 176, 77, 49, 51, 185, 77, 49, 51, 184, 77, 49, 51, 183,
+ 77, 49, 51, 182, 77, 49, 51, 181, 77, 49, 51, 180, 77, 49, 51, 179, 77,
+ 49, 51, 178, 77, 49, 51, 177, 77, 49, 51, 176, 77, 49, 50, 185, 77, 49,
+ 50, 184, 77, 49, 50, 183, 77, 49, 50, 182, 77, 49, 50, 181, 77, 49, 50,
+ 180, 77, 49, 50, 179, 77, 49, 50, 178, 77, 49, 50, 177, 77, 49, 50, 176,
+ 77, 49, 49, 185, 77, 49, 49, 184, 77, 49, 49, 183, 77, 49, 49, 182, 77,
+ 49, 49, 181, 77, 49, 49, 180, 77, 49, 49, 179, 77, 49, 49, 178, 77, 49,
+ 49, 177, 77, 49, 49, 176, 77, 49, 48, 185, 77, 49, 48, 184, 77, 49, 48,
+ 183, 77, 49, 48, 182, 77, 49, 48, 181, 77, 49, 48, 180, 77, 49, 48, 179,
+ 77, 49, 48, 178, 77, 49, 48, 177, 77, 49, 48, 176, 77, 48, 57, 185, 77,
+ 48, 57, 184, 77, 48, 57, 183, 77, 48, 57, 182, 77, 48, 57, 181, 77, 48,
+ 57, 180, 77, 48, 57, 179, 77, 48, 57, 178, 77, 48, 57, 177, 77, 48, 57,
+ 176, 77, 48, 56, 185, 77, 48, 56, 184, 77, 48, 56, 183, 77, 48, 56, 182,
+ 77, 48, 56, 181, 77, 48, 56, 180, 77, 48, 56, 179, 77, 48, 56, 178, 77,
+ 48, 56, 177, 77, 48, 56, 176, 77, 48, 55, 185, 77, 48, 55, 184, 77, 48,
+ 55, 183, 77, 48, 55, 182, 77, 48, 55, 181, 77, 48, 55, 180, 77, 48, 55,
+ 179, 77, 48, 55, 178, 77, 48, 55, 177, 77, 48, 55, 176, 77, 48, 54, 185,
+ 77, 48, 54, 184, 77, 48, 54, 183, 77, 48, 54, 182, 77, 48, 54, 181, 77,
+ 48, 54, 180, 77, 48, 54, 179, 77, 48, 54, 178, 77, 48, 54, 177, 77, 48,
+ 54, 176, 77, 48, 53, 185, 77, 48, 53, 184, 77, 48, 53, 183, 77, 48, 53,
+ 182, 77, 48, 53, 181, 77, 48, 53, 180, 77, 48, 53, 179, 77, 48, 53, 178,
+ 77, 48, 53, 177, 77, 48, 53, 176, 77, 48, 52, 185, 77, 48, 52, 184, 77,
+ 48, 52, 183, 77, 48, 52, 182, 77, 48, 52, 181, 77, 48, 52, 52, 128, 77,
+ 48, 52, 180, 77, 48, 52, 51, 128, 77, 48, 52, 179, 77, 48, 52, 50, 128,
+ 77, 48, 52, 178, 77, 48, 52, 49, 128, 77, 48, 52, 177, 77, 48, 52, 48,
+ 65, 128, 77, 48, 52, 48, 128, 77, 48, 52, 176, 77, 48, 51, 57, 128, 77,
+ 48, 51, 185, 77, 48, 51, 56, 128, 77, 48, 51, 184, 77, 48, 51, 55, 128,
+ 77, 48, 51, 183, 77, 48, 51, 54, 128, 77, 48, 51, 182, 77, 48, 51, 53,
+ 128, 77, 48, 51, 181, 77, 48, 51, 52, 128, 77, 48, 51, 180, 77, 48, 51,
+ 51, 66, 128, 77, 48, 51, 51, 65, 128, 77, 48, 51, 51, 128, 77, 48, 51,
+ 179, 77, 48, 51, 50, 128, 77, 48, 51, 178, 77, 48, 51, 49, 65, 128, 77,
+ 48, 51, 49, 128, 77, 48, 51, 177, 77, 48, 51, 48, 128, 77, 48, 51, 176,
+ 77, 48, 50, 57, 128, 77, 48, 50, 185, 77, 48, 50, 56, 65, 128, 77, 48,
+ 50, 56, 128, 77, 48, 50, 184, 77, 48, 50, 55, 128, 77, 48, 50, 183, 77,
+ 48, 50, 54, 128, 77, 48, 50, 182, 77, 48, 50, 53, 128, 77, 48, 50, 181,
+ 77, 48, 50, 52, 65, 128, 77, 48, 50, 52, 128, 77, 48, 50, 180, 77, 48,
+ 50, 51, 128, 77, 48, 50, 179, 77, 48, 50, 50, 65, 128, 77, 48, 50, 50,
+ 128, 77, 48, 50, 178, 77, 48, 50, 49, 128, 77, 48, 50, 177, 77, 48, 50,
+ 48, 128, 77, 48, 50, 176, 77, 48, 49, 57, 128, 77, 48, 49, 185, 77, 48,
+ 49, 56, 128, 77, 48, 49, 184, 77, 48, 49, 55, 65, 128, 77, 48, 49, 55,
+ 128, 77, 48, 49, 183, 77, 48, 49, 54, 65, 128, 77, 48, 49, 54, 128, 77,
+ 48, 49, 182, 77, 48, 49, 53, 65, 128, 77, 48, 49, 53, 128, 77, 48, 49,
+ 181, 77, 48, 49, 52, 128, 77, 48, 49, 180, 77, 48, 49, 51, 128, 77, 48,
+ 49, 179, 77, 48, 49, 50, 72, 128, 77, 48, 49, 50, 71, 128, 77, 48, 49,
+ 50, 70, 128, 77, 48, 49, 50, 69, 128, 77, 48, 49, 50, 68, 128, 77, 48,
+ 49, 50, 67, 128, 77, 48, 49, 50, 66, 128, 77, 48, 49, 50, 65, 128, 77,
+ 48, 49, 50, 128, 77, 48, 49, 178, 77, 48, 49, 49, 128, 77, 48, 49, 177,
+ 77, 48, 49, 48, 65, 128, 77, 48, 49, 48, 128, 77, 48, 49, 176, 77, 48,
+ 48, 57, 128, 77, 48, 48, 185, 77, 48, 48, 56, 128, 77, 48, 48, 184, 77,
+ 48, 48, 55, 128, 77, 48, 48, 183, 77, 48, 48, 54, 128, 77, 48, 48, 182,
+ 77, 48, 48, 53, 128, 77, 48, 48, 181, 77, 48, 48, 52, 128, 77, 48, 48,
+ 180, 77, 48, 48, 51, 65, 128, 77, 48, 48, 51, 128, 77, 48, 48, 179, 77,
+ 48, 48, 50, 128, 77, 48, 48, 178, 77, 48, 48, 49, 66, 128, 77, 48, 48,
+ 49, 65, 128, 77, 48, 48, 49, 128, 77, 48, 48, 177, 76, 218, 76, 89, 89,
+ 128, 76, 89, 88, 128, 76, 89, 84, 128, 76, 89, 82, 88, 128, 76, 89, 82,
+ 128, 76, 89, 80, 128, 76, 89, 73, 84, 128, 76, 89, 73, 78, 199, 76, 89,
+ 68, 73, 65, 206, 76, 89, 67, 73, 65, 206, 76, 88, 128, 76, 87, 79, 79,
+ 128, 76, 87, 79, 128, 76, 87, 73, 73, 128, 76, 87, 73, 128, 76, 87, 69,
+ 128, 76, 87, 65, 65, 128, 76, 87, 65, 128, 76, 85, 88, 128, 76, 85, 85,
+ 128, 76, 85, 84, 128, 76, 85, 82, 88, 128, 76, 85, 80, 128, 76, 85, 79,
+ 88, 128, 76, 85, 79, 84, 128, 76, 85, 79, 80, 128, 76, 85, 79, 128, 76,
+ 85, 78, 71, 83, 73, 128, 76, 85, 78, 71, 83, 128, 76, 85, 78, 65, 84,
+ 197, 76, 85, 78, 65, 210, 76, 85, 205, 76, 85, 76, 128, 76, 85, 73, 83,
+ 128, 76, 85, 72, 85, 82, 128, 76, 85, 72, 128, 76, 85, 200, 76, 85, 71,
+ 71, 65, 71, 69, 128, 76, 85, 71, 65, 76, 128, 76, 85, 71, 65, 204, 76,
+ 85, 69, 128, 76, 85, 197, 76, 85, 66, 128, 76, 85, 65, 69, 80, 128, 76,
+ 85, 51, 128, 76, 85, 50, 128, 76, 85, 178, 76, 82, 79, 128, 76, 82, 77,
+ 128, 76, 82, 73, 128, 76, 82, 69, 128, 76, 79, 90, 69, 78, 71, 69, 128,
+ 76, 79, 90, 69, 78, 71, 197, 76, 79, 88, 128, 76, 79, 87, 69, 82, 69,
+ 196, 76, 79, 87, 45, 82, 69, 86, 69, 82, 83, 69, 68, 45, 185, 76, 79, 87,
+ 45, 77, 73, 196, 76, 79, 87, 45, 70, 65, 76, 76, 73, 78, 199, 76, 79, 87,
+ 45, 185, 76, 79, 86, 197, 76, 79, 85, 82, 69, 128, 76, 79, 85, 68, 83,
+ 80, 69, 65, 75, 69, 82, 128, 76, 79, 85, 68, 76, 217, 76, 79, 84, 85, 83,
+ 128, 76, 79, 84, 85, 211, 76, 79, 84, 73, 79, 206, 76, 79, 84, 128, 76,
+ 79, 83, 212, 76, 79, 83, 83, 76, 69, 83, 83, 128, 76, 79, 82, 82, 89,
+ 128, 76, 79, 82, 82, 65, 73, 78, 69, 128, 76, 79, 81, 128, 76, 79, 80,
+ 128, 76, 79, 79, 84, 128, 76, 79, 79, 80, 69, 196, 76, 79, 79, 80, 128,
+ 76, 79, 79, 208, 76, 79, 79, 78, 128, 76, 79, 79, 203, 76, 79, 79, 128,
+ 76, 79, 78, 83, 85, 77, 128, 76, 79, 78, 71, 65, 128, 76, 79, 78, 71,
+ 193, 76, 79, 78, 71, 45, 76, 69, 71, 71, 69, 196, 76, 79, 78, 71, 45, 66,
+ 82, 65, 78, 67, 72, 45, 89, 82, 128, 76, 79, 78, 71, 45, 66, 82, 65, 78,
+ 67, 72, 45, 83, 79, 204, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45,
+ 79, 83, 211, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 77, 65, 68,
+ 210, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 72, 65, 71, 65, 76,
+ 204, 76, 79, 78, 71, 45, 66, 82, 65, 78, 67, 72, 45, 65, 210, 76, 79, 77,
+ 77, 65, 69, 128, 76, 79, 77, 75, 65, 128, 76, 79, 77, 128, 76, 79, 205,
+ 76, 79, 76, 76, 73, 80, 79, 80, 128, 76, 79, 76, 76, 128, 76, 79, 71,
+ 210, 76, 79, 71, 79, 84, 89, 80, 197, 76, 79, 71, 79, 71, 82, 65, 205,
+ 76, 79, 71, 128, 76, 79, 68, 69, 83, 84, 79, 78, 69, 128, 76, 79, 67, 79,
+ 77, 79, 84, 73, 86, 69, 128, 76, 79, 67, 75, 73, 78, 71, 45, 83, 72, 73,
+ 70, 212, 76, 79, 67, 65, 84, 73, 86, 69, 128, 76, 79, 67, 65, 84, 73, 79,
+ 78, 45, 87, 65, 76, 76, 80, 76, 65, 78, 197, 76, 79, 67, 65, 84, 73, 79,
+ 78, 45, 70, 76, 79, 79, 82, 80, 76, 65, 78, 197, 76, 79, 67, 65, 84, 73,
+ 79, 78, 128, 76, 79, 67, 65, 84, 73, 79, 206, 76, 79, 66, 83, 84, 69, 82,
+ 128, 76, 79, 65, 128, 76, 78, 128, 76, 76, 85, 85, 128, 76, 76, 79, 79,
+ 128, 76, 76, 76, 85, 85, 128, 76, 76, 76, 85, 128, 76, 76, 76, 79, 79,
+ 128, 76, 76, 76, 79, 128, 76, 76, 76, 73, 73, 128, 76, 76, 76, 73, 128,
+ 76, 76, 76, 69, 69, 128, 76, 76, 76, 69, 128, 76, 76, 76, 65, 85, 128,
+ 76, 76, 76, 65, 73, 128, 76, 76, 76, 65, 65, 128, 76, 76, 76, 65, 128,
+ 76, 76, 76, 128, 76, 76, 72, 65, 128, 76, 76, 65, 77, 65, 128, 76, 74,
+ 85, 68, 73, 74, 69, 128, 76, 74, 69, 128, 76, 74, 128, 76, 73, 90, 65,
+ 82, 68, 128, 76, 73, 88, 128, 76, 73, 87, 78, 128, 76, 73, 86, 82, 197,
+ 76, 73, 84, 84, 76, 69, 128, 76, 73, 84, 84, 76, 197, 76, 73, 84, 84, 69,
+ 210, 76, 73, 84, 82, 193, 76, 73, 84, 200, 76, 73, 83, 213, 76, 73, 83,
+ 128, 76, 73, 82, 193, 76, 73, 81, 85, 73, 68, 128, 76, 73, 81, 85, 73,
+ 196, 76, 73, 81, 128, 76, 73, 80, 83, 84, 73, 67, 75, 128, 76, 73, 80,
+ 211, 76, 73, 208, 76, 73, 78, 75, 73, 78, 199, 76, 73, 78, 75, 69, 196,
+ 76, 73, 78, 203, 76, 73, 78, 71, 83, 65, 128, 76, 73, 78, 69, 83, 128,
+ 76, 73, 78, 69, 211, 76, 73, 78, 69, 45, 57, 128, 76, 73, 78, 69, 45, 55,
+ 128, 76, 73, 78, 69, 45, 51, 128, 76, 73, 78, 69, 45, 49, 128, 76, 73,
+ 77, 77, 85, 52, 128, 76, 73, 77, 77, 85, 50, 128, 76, 73, 77, 77, 85,
+ 128, 76, 73, 77, 77, 213, 76, 73, 77, 73, 84, 69, 196, 76, 73, 77, 73,
+ 84, 65, 84, 73, 79, 78, 128, 76, 73, 77, 73, 84, 128, 76, 73, 77, 69,
+ 128, 76, 73, 77, 66, 213, 76, 73, 77, 66, 211, 76, 73, 77, 194, 76, 73,
+ 76, 89, 128, 76, 73, 76, 73, 84, 72, 128, 76, 73, 76, 128, 76, 73, 71,
+ 72, 84, 78, 73, 78, 71, 128, 76, 73, 71, 72, 84, 78, 73, 78, 199, 76, 73,
+ 71, 72, 84, 72, 79, 85, 83, 69, 128, 76, 73, 71, 72, 84, 128, 76, 73, 71,
+ 65, 84, 73, 78, 199, 76, 73, 70, 84, 69, 82, 128, 76, 73, 70, 69, 128,
+ 76, 73, 69, 88, 128, 76, 73, 69, 84, 128, 76, 73, 69, 80, 128, 76, 73,
+ 69, 69, 128, 76, 73, 69, 128, 76, 73, 68, 128, 76, 73, 67, 75, 73, 78,
+ 199, 76, 73, 66, 82, 65, 128, 76, 73, 66, 69, 82, 84, 89, 128, 76, 73,
+ 65, 66, 73, 76, 73, 84, 217, 76, 72, 73, 73, 128, 76, 72, 65, 86, 73, 89,
+ 65, 78, 73, 128, 76, 72, 65, 199, 76, 72, 65, 65, 128, 76, 72, 128, 76,
+ 69, 90, 72, 128, 76, 69, 90, 200, 76, 69, 88, 128, 76, 69, 86, 73, 84,
+ 65, 84, 73, 78, 71, 128, 76, 69, 86, 69, 76, 45, 51, 128, 76, 69, 86, 69,
+ 76, 45, 50, 128, 76, 69, 85, 77, 128, 76, 69, 85, 65, 69, 80, 128, 76,
+ 69, 85, 65, 69, 77, 128, 76, 69, 85, 128, 76, 69, 213, 76, 69, 84, 84,
+ 69, 82, 83, 128, 76, 69, 84, 84, 69, 82, 128, 76, 69, 212, 76, 69, 83,
+ 83, 69, 210, 76, 69, 83, 83, 45, 84, 72, 65, 78, 128, 76, 69, 83, 83, 45,
+ 84, 72, 65, 206, 76, 69, 83, 72, 128, 76, 69, 80, 67, 72, 193, 76, 69,
+ 80, 128, 76, 69, 79, 80, 65, 82, 68, 128, 76, 69, 79, 128, 76, 69, 78,
+ 84, 73, 67, 85, 76, 65, 210, 76, 69, 78, 73, 83, 128, 76, 69, 78, 73,
+ 211, 76, 69, 78, 71, 84, 72, 69, 78, 69, 82, 128, 76, 69, 78, 71, 84, 72,
+ 45, 55, 128, 76, 69, 78, 71, 84, 72, 45, 54, 128, 76, 69, 78, 71, 84, 72,
+ 45, 53, 128, 76, 69, 78, 71, 84, 72, 45, 52, 128, 76, 69, 78, 71, 84, 72,
+ 45, 51, 128, 76, 69, 78, 71, 84, 72, 45, 50, 128, 76, 69, 78, 71, 84, 72,
+ 45, 49, 128, 76, 69, 78, 71, 84, 200, 76, 69, 78, 71, 65, 128, 76, 69,
+ 78, 71, 193, 76, 69, 77, 79, 78, 128, 76, 69, 77, 79, 73, 128, 76, 69,
+ 76, 69, 84, 128, 76, 69, 76, 69, 212, 76, 69, 203, 76, 69, 73, 77, 77,
+ 65, 128, 76, 69, 73, 77, 77, 193, 76, 69, 73, 128, 76, 69, 71, 83, 128,
+ 76, 69, 71, 73, 79, 78, 128, 76, 69, 71, 69, 84, 79, 211, 76, 69, 71,
+ 128, 76, 69, 199, 76, 69, 70, 84, 87, 65, 82, 68, 83, 128, 76, 69, 70,
+ 84, 45, 84, 79, 45, 82, 73, 71, 72, 212, 76, 69, 70, 84, 45, 83, 84, 69,
+ 205, 76, 69, 70, 84, 45, 83, 73, 68, 197, 76, 69, 70, 84, 45, 83, 72, 65,
+ 68, 69, 196, 76, 69, 70, 84, 45, 80, 79, 73, 78, 84, 73, 78, 199, 76, 69,
+ 70, 84, 45, 76, 73, 71, 72, 84, 69, 196, 76, 69, 70, 84, 45, 72, 65, 78,
+ 68, 69, 196, 76, 69, 70, 84, 45, 72, 65, 78, 196, 76, 69, 70, 84, 45, 70,
+ 65, 67, 73, 78, 199, 76, 69, 70, 84, 128, 76, 69, 69, 82, 65, 69, 87, 65,
+ 128, 76, 69, 69, 75, 128, 76, 69, 69, 69, 69, 128, 76, 69, 68, 71, 69,
+ 82, 128, 76, 69, 65, 84, 72, 69, 82, 128, 76, 69, 65, 78, 73, 78, 199,
+ 76, 69, 65, 70, 217, 76, 69, 65, 70, 128, 76, 69, 65, 198, 76, 69, 65,
+ 68, 69, 82, 128, 76, 69, 65, 196, 76, 68, 65, 78, 128, 76, 68, 50, 128,
+ 76, 67, 201, 76, 67, 197, 76, 65, 90, 217, 76, 65, 89, 65, 78, 78, 65,
+ 128, 76, 65, 88, 128, 76, 65, 87, 128, 76, 65, 215, 76, 65, 85, 76, 65,
+ 128, 76, 65, 85, 75, 65, 218, 76, 65, 85, 74, 128, 76, 65, 85, 71, 72,
+ 73, 78, 71, 128, 76, 65, 84, 73, 78, 65, 84, 197, 76, 65, 84, 73, 75,
+ 128, 76, 65, 84, 69, 82, 65, 204, 76, 65, 84, 197, 76, 65, 83, 212, 76,
+ 65, 82, 89, 78, 71, 69, 65, 204, 76, 65, 82, 201, 76, 65, 82, 71, 69, 83,
+ 84, 128, 76, 65, 82, 71, 69, 210, 76, 65, 82, 71, 69, 128, 76, 65, 82,
+ 71, 197, 76, 65, 81, 128, 76, 65, 80, 65, 81, 128, 76, 65, 207, 76, 65,
+ 78, 84, 69, 82, 78, 128, 76, 65, 78, 84, 65, 78, 71, 128, 76, 65, 78, 71,
+ 85, 65, 71, 197, 76, 65, 78, 69, 83, 128, 76, 65, 78, 196, 76, 65, 78,
+ 128, 76, 65, 77, 80, 128, 76, 65, 77, 69, 68, 72, 128, 76, 65, 77, 69,
+ 68, 128, 76, 65, 77, 69, 196, 76, 65, 77, 69, 128, 76, 65, 77, 197, 76,
+ 65, 77, 68, 65, 128, 76, 65, 77, 68, 128, 76, 65, 77, 66, 68, 193, 76,
+ 65, 77, 65, 68, 72, 128, 76, 65, 76, 128, 76, 65, 204, 76, 65, 75, 75,
+ 72, 65, 78, 71, 89, 65, 79, 128, 76, 65, 75, 72, 65, 78, 128, 76, 65, 75,
+ 72, 128, 76, 65, 75, 200, 76, 65, 75, 45, 55, 52, 57, 128, 76, 65, 75,
+ 45, 55, 50, 52, 128, 76, 65, 75, 45, 54, 54, 56, 128, 76, 65, 75, 45, 54,
+ 52, 56, 128, 76, 65, 75, 45, 54, 52, 184, 76, 65, 75, 45, 54, 51, 54,
+ 128, 76, 65, 75, 45, 54, 49, 55, 128, 76, 65, 75, 45, 54, 49, 183, 76,
+ 65, 75, 45, 54, 48, 56, 128, 76, 65, 75, 45, 53, 53, 48, 128, 76, 65, 75,
+ 45, 52, 57, 53, 128, 76, 65, 75, 45, 52, 57, 51, 128, 76, 65, 75, 45, 52,
+ 57, 50, 128, 76, 65, 75, 45, 52, 57, 48, 128, 76, 65, 75, 45, 52, 56, 51,
+ 128, 76, 65, 75, 45, 52, 55, 48, 128, 76, 65, 75, 45, 52, 53, 55, 128,
+ 76, 65, 75, 45, 52, 53, 48, 128, 76, 65, 75, 45, 52, 52, 57, 128, 76, 65,
+ 75, 45, 52, 52, 185, 76, 65, 75, 45, 52, 52, 49, 128, 76, 65, 75, 45, 51,
+ 57, 48, 128, 76, 65, 75, 45, 51, 56, 52, 128, 76, 65, 75, 45, 51, 56, 51,
+ 128, 76, 65, 75, 45, 51, 52, 56, 128, 76, 65, 75, 45, 51, 52, 55, 128,
+ 76, 65, 75, 45, 51, 52, 51, 128, 76, 65, 75, 45, 50, 54, 54, 128, 76, 65,
+ 75, 45, 50, 54, 53, 128, 76, 65, 75, 45, 50, 51, 56, 128, 76, 65, 75, 45,
+ 50, 50, 56, 128, 76, 65, 75, 45, 50, 50, 53, 128, 76, 65, 75, 45, 50, 50,
+ 48, 128, 76, 65, 75, 45, 50, 49, 57, 128, 76, 65, 75, 45, 50, 49, 48,
+ 128, 76, 65, 75, 45, 49, 52, 50, 128, 76, 65, 75, 45, 49, 51, 48, 128,
+ 76, 65, 75, 45, 48, 57, 50, 128, 76, 65, 75, 45, 48, 56, 49, 128, 76, 65,
+ 75, 45, 48, 56, 177, 76, 65, 75, 45, 48, 56, 48, 128, 76, 65, 75, 45, 48,
+ 55, 185, 76, 65, 75, 45, 48, 54, 50, 128, 76, 65, 75, 45, 48, 53, 49,
+ 128, 76, 65, 75, 45, 48, 53, 48, 128, 76, 65, 75, 45, 48, 51, 48, 128,
+ 76, 65, 75, 45, 48, 50, 53, 128, 76, 65, 75, 45, 48, 50, 49, 128, 76, 65,
+ 75, 45, 48, 50, 48, 128, 76, 65, 75, 45, 48, 48, 51, 128, 76, 65, 74, 65,
+ 78, 89, 65, 76, 65, 78, 128, 76, 65, 73, 78, 199, 76, 65, 201, 76, 65,
+ 72, 83, 72, 85, 128, 76, 65, 72, 128, 76, 65, 71, 85, 83, 128, 76, 65,
+ 71, 213, 76, 65, 71, 65, 82, 128, 76, 65, 71, 65, 210, 76, 65, 71, 65,
+ 66, 128, 76, 65, 71, 65, 194, 76, 65, 69, 86, 128, 76, 65, 69, 128, 76,
+ 65, 68, 217, 76, 65, 68, 68, 69, 82, 128, 76, 65, 67, 82, 79, 83, 83,
+ 197, 76, 65, 67, 75, 128, 76, 65, 67, 65, 128, 76, 65, 66, 79, 85, 82,
+ 73, 78, 71, 128, 76, 65, 66, 79, 82, 128, 76, 65, 66, 73, 65, 76, 73, 90,
+ 65, 84, 73, 79, 206, 76, 65, 66, 73, 65, 204, 76, 65, 66, 69, 76, 128,
+ 76, 65, 66, 65, 84, 128, 76, 65, 194, 76, 65, 65, 78, 65, 69, 128, 76,
+ 65, 65, 78, 128, 76, 65, 65, 77, 85, 128, 76, 65, 65, 73, 128, 76, 54,
+ 128, 76, 52, 128, 76, 51, 128, 76, 50, 128, 76, 48, 48, 54, 65, 128, 76,
+ 48, 48, 50, 65, 128, 76, 45, 84, 89, 80, 197, 76, 45, 83, 72, 65, 80, 69,
+ 196, 75, 89, 85, 82, 73, 73, 128, 75, 89, 85, 128, 75, 89, 79, 128, 75,
+ 89, 76, 73, 83, 77, 65, 128, 75, 89, 73, 128, 75, 89, 69, 128, 75, 89,
+ 65, 84, 72, 79, 211, 75, 89, 65, 65, 128, 75, 89, 65, 128, 75, 88, 87,
+ 73, 128, 75, 88, 87, 69, 69, 128, 75, 88, 87, 69, 128, 75, 88, 87, 65,
+ 65, 128, 75, 88, 87, 65, 128, 75, 88, 85, 128, 75, 88, 79, 128, 75, 88,
+ 73, 128, 75, 88, 69, 69, 128, 75, 88, 69, 128, 75, 88, 65, 65, 128, 75,
+ 88, 65, 128, 75, 87, 86, 128, 75, 87, 85, 51, 49, 56, 128, 75, 87, 79,
+ 79, 128, 75, 87, 79, 128, 75, 87, 77, 128, 75, 87, 73, 73, 128, 75, 87,
+ 73, 128, 75, 87, 69, 69, 128, 75, 87, 69, 128, 75, 87, 66, 128, 75, 87,
+ 65, 89, 128, 75, 87, 65, 69, 84, 128, 75, 87, 65, 65, 128, 75, 86, 65,
+ 128, 75, 86, 128, 75, 85, 90, 72, 73, 128, 75, 85, 88, 128, 75, 85, 86,
+ 128, 75, 85, 85, 72, 128, 75, 85, 84, 128, 75, 85, 83, 77, 65, 128, 75,
+ 85, 83, 72, 85, 50, 128, 75, 85, 83, 72, 85, 178, 75, 85, 82, 88, 128,
+ 75, 85, 82, 85, 90, 69, 73, 82, 79, 128, 75, 85, 82, 84, 128, 75, 85, 82,
+ 79, 79, 78, 69, 128, 75, 85, 82, 128, 75, 85, 210, 75, 85, 81, 128, 75,
+ 85, 80, 78, 65, 89, 65, 128, 75, 85, 79, 88, 128, 75, 85, 79, 80, 128,
+ 75, 85, 79, 208, 75, 85, 79, 77, 128, 75, 85, 79, 128, 75, 85, 78, 71,
+ 128, 75, 85, 78, 68, 68, 65, 76, 73, 89, 65, 128, 75, 85, 76, 128, 75,
+ 85, 204, 75, 85, 71, 128, 75, 85, 70, 73, 83, 77, 65, 128, 75, 85, 69,
+ 84, 128, 75, 85, 66, 128, 75, 85, 65, 86, 128, 75, 85, 65, 66, 128, 75,
+ 85, 65, 128, 75, 85, 55, 128, 75, 85, 52, 128, 75, 85, 180, 75, 85, 51,
+ 128, 75, 85, 179, 75, 85, 45, 55, 128, 75, 85, 45, 54, 128, 75, 85, 45,
+ 53, 128, 75, 85, 45, 52, 128, 75, 85, 45, 51, 128, 75, 85, 45, 50, 128,
+ 75, 85, 45, 49, 128, 75, 84, 128, 75, 83, 83, 85, 85, 128, 75, 83, 83,
+ 85, 128, 75, 83, 83, 79, 79, 128, 75, 83, 83, 79, 128, 75, 83, 83, 73,
+ 73, 128, 75, 83, 83, 73, 128, 75, 83, 83, 69, 69, 128, 75, 83, 83, 69,
+ 128, 75, 83, 83, 65, 85, 128, 75, 83, 83, 65, 73, 128, 75, 83, 83, 65,
+ 65, 128, 75, 83, 83, 65, 128, 75, 83, 83, 128, 75, 83, 73, 128, 75, 82,
+ 89, 90, 72, 69, 86, 65, 89, 65, 128, 75, 82, 89, 90, 72, 69, 77, 128, 75,
+ 82, 89, 90, 72, 69, 205, 75, 82, 89, 90, 72, 128, 75, 82, 89, 90, 200,
+ 75, 82, 89, 85, 75, 79, 86, 65, 89, 65, 128, 75, 82, 89, 85, 75, 79, 86,
+ 65, 89, 193, 75, 82, 89, 85, 75, 128, 75, 82, 89, 85, 203, 75, 82, 79,
+ 78, 79, 83, 128, 75, 82, 69, 77, 65, 83, 84, 73, 128, 75, 82, 65, 84, 73,
+ 77, 79, 89, 80, 79, 82, 82, 79, 79, 78, 128, 75, 82, 65, 84, 73, 77, 79,
+ 75, 79, 85, 70, 73, 83, 77, 65, 128, 75, 82, 65, 84, 73, 77, 65, 84, 65,
+ 128, 75, 82, 65, 84, 73, 77, 193, 75, 80, 85, 128, 75, 80, 79, 81, 128,
+ 75, 80, 79, 79, 128, 75, 80, 79, 128, 75, 80, 73, 128, 75, 80, 69, 85,
+ 88, 128, 75, 80, 69, 69, 128, 75, 80, 69, 128, 75, 80, 65, 82, 65, 81,
+ 128, 75, 80, 65, 78, 128, 75, 80, 65, 72, 128, 75, 80, 65, 128, 75, 80,
+ 128, 75, 79, 88, 128, 75, 79, 86, 85, 85, 128, 75, 79, 86, 128, 75, 79,
+ 84, 79, 128, 75, 79, 82, 85, 78, 65, 128, 75, 79, 82, 79, 78, 73, 83,
+ 128, 75, 79, 82, 79, 78, 128, 75, 79, 82, 69, 65, 206, 75, 79, 82, 65,
+ 78, 73, 195, 75, 79, 81, 78, 68, 79, 78, 128, 75, 79, 80, 80, 65, 128,
+ 75, 79, 80, 128, 75, 79, 79, 86, 128, 75, 79, 79, 80, 79, 128, 75, 79,
+ 79, 77, 85, 85, 84, 128, 75, 79, 79, 66, 128, 75, 79, 79, 128, 75, 79,
+ 78, 84, 69, 86, 77, 65, 128, 75, 79, 78, 84, 69, 86, 77, 193, 75, 79, 77,
+ 201, 75, 79, 77, 66, 85, 86, 65, 128, 75, 79, 77, 66, 85, 86, 193, 75,
+ 79, 77, 66, 213, 75, 79, 75, 79, 128, 75, 79, 75, 69, 128, 75, 79, 75,
+ 128, 75, 79, 203, 75, 79, 73, 78, 73, 128, 75, 79, 73, 128, 75, 79, 201,
+ 75, 79, 72, 128, 75, 79, 71, 72, 79, 77, 128, 75, 79, 69, 84, 128, 75,
+ 79, 66, 89, 76, 65, 128, 75, 79, 66, 128, 75, 79, 65, 76, 65, 128, 75,
+ 79, 65, 128, 75, 79, 45, 75, 73, 128, 75, 79, 45, 51, 128, 75, 79, 45,
+ 50, 128, 75, 79, 45, 49, 128, 75, 78, 85, 67, 75, 76, 69, 83, 128, 75,
+ 78, 85, 67, 75, 76, 69, 128, 75, 78, 79, 84, 128, 75, 78, 79, 66, 83,
+ 128, 75, 78, 73, 71, 72, 84, 45, 82, 79, 79, 75, 128, 75, 78, 73, 71, 72,
+ 84, 45, 81, 85, 69, 69, 78, 128, 75, 78, 73, 71, 72, 84, 45, 66, 73, 83,
+ 72, 79, 80, 128, 75, 78, 73, 71, 72, 84, 128, 75, 78, 73, 71, 72, 212,
+ 75, 78, 73, 70, 69, 128, 75, 78, 73, 70, 197, 75, 78, 69, 69, 76, 73, 78,
+ 199, 75, 77, 128, 75, 205, 75, 76, 89, 85, 67, 72, 69, 86, 79, 89, 128,
+ 75, 76, 89, 85, 67, 72, 69, 86, 65, 89, 65, 128, 75, 76, 89, 85, 67, 72,
+ 69, 86, 65, 89, 193, 75, 76, 89, 85, 67, 72, 69, 80, 79, 86, 79, 68, 78,
+ 89, 128, 75, 76, 89, 85, 67, 72, 69, 80, 79, 86, 79, 68, 78, 65, 89, 65,
+ 128, 75, 76, 89, 85, 67, 72, 69, 78, 69, 80, 79, 83, 84, 79, 89, 65, 78,
+ 78, 89, 128, 75, 76, 89, 85, 67, 72, 69, 78, 69, 80, 79, 83, 84, 79, 89,
+ 65, 78, 78, 65, 89, 65, 128, 75, 76, 89, 85, 67, 72, 128, 75, 76, 73, 84,
+ 79, 78, 128, 75, 76, 65, 83, 77, 65, 128, 75, 76, 65, 83, 77, 193, 75,
+ 76, 65, 128, 75, 76, 128, 75, 75, 79, 128, 75, 75, 73, 128, 75, 75, 69,
+ 69, 128, 75, 75, 69, 128, 75, 75, 65, 128, 75, 75, 128, 75, 74, 69, 128,
+ 75, 73, 89, 69, 79, 75, 45, 84, 73, 75, 69, 85, 84, 128, 75, 73, 89, 69,
+ 79, 75, 45, 83, 73, 79, 83, 45, 75, 73, 89, 69, 79, 75, 128, 75, 73, 89,
+ 69, 79, 75, 45, 82, 73, 69, 85, 76, 128, 75, 73, 89, 69, 79, 75, 45, 80,
+ 73, 69, 85, 80, 128, 75, 73, 89, 69, 79, 75, 45, 78, 73, 69, 85, 78, 128,
+ 75, 73, 89, 69, 79, 75, 45, 75, 72, 73, 69, 85, 75, 72, 128, 75, 73, 89,
+ 69, 79, 75, 45, 67, 72, 73, 69, 85, 67, 72, 128, 75, 73, 89, 69, 79, 203,
+ 75, 73, 88, 128, 75, 73, 87, 73, 70, 82, 85, 73, 84, 128, 75, 73, 87,
+ 128, 75, 73, 86, 128, 75, 73, 84, 69, 128, 75, 73, 84, 128, 75, 73, 83,
+ 83, 73, 78, 199, 75, 73, 83, 83, 128, 75, 73, 83, 211, 75, 73, 83, 73,
+ 77, 53, 128, 75, 73, 83, 73, 77, 181, 75, 73, 83, 72, 128, 75, 73, 83,
+ 65, 76, 128, 75, 73, 82, 79, 87, 65, 84, 84, 79, 128, 75, 73, 82, 79, 77,
+ 69, 69, 84, 79, 82, 85, 128, 75, 73, 82, 79, 71, 85, 82, 65, 77, 85, 128,
+ 75, 73, 82, 79, 128, 75, 73, 82, 71, 72, 73, 218, 75, 73, 81, 128, 75,
+ 73, 80, 128, 75, 73, 208, 75, 73, 78, 83, 72, 73, 80, 128, 75, 73, 78,
+ 78, 193, 75, 73, 78, 68, 69, 82, 71, 65, 82, 84, 69, 78, 128, 75, 73, 77,
+ 79, 78, 79, 128, 75, 73, 76, 76, 69, 82, 128, 75, 73, 73, 90, 72, 128,
+ 75, 73, 73, 128, 75, 73, 72, 128, 75, 73, 69, 88, 128, 75, 73, 69, 86,
+ 65, 206, 75, 73, 69, 80, 128, 75, 73, 69, 69, 77, 128, 75, 73, 69, 128,
+ 75, 73, 68, 128, 75, 73, 196, 75, 73, 67, 75, 128, 75, 73, 66, 128, 75,
+ 73, 65, 86, 128, 75, 73, 65, 66, 128, 75, 73, 45, 56, 128, 75, 73, 45,
+ 55, 128, 75, 73, 45, 54, 128, 75, 73, 45, 53, 128, 75, 73, 45, 52, 128,
+ 75, 73, 45, 51, 128, 75, 73, 45, 50, 128, 75, 73, 45, 49, 128, 75, 72,
+ 90, 128, 75, 72, 87, 65, 73, 128, 75, 72, 85, 69, 78, 45, 76, 85, 197,
+ 75, 72, 85, 69, 206, 75, 72, 85, 68, 65, 87, 65, 68, 201, 75, 72, 85, 68,
+ 65, 77, 128, 75, 72, 85, 65, 84, 128, 75, 72, 79, 85, 128, 75, 72, 79,
+ 212, 75, 72, 79, 78, 78, 65, 128, 75, 72, 79, 78, 128, 75, 72, 79, 77,
+ 85, 84, 128, 75, 72, 79, 75, 72, 76, 79, 205, 75, 72, 79, 74, 75, 201,
+ 75, 72, 79, 128, 75, 72, 207, 75, 72, 77, 213, 75, 72, 73, 84, 128, 75,
+ 72, 73, 78, 89, 65, 128, 75, 72, 73, 69, 85, 75, 200, 75, 72, 73, 128,
+ 75, 72, 201, 75, 72, 72, 79, 128, 75, 72, 72, 65, 128, 75, 72, 69, 84,
+ 72, 128, 75, 72, 69, 73, 128, 75, 72, 69, 69, 128, 75, 72, 69, 128, 75,
+ 72, 65, 86, 128, 75, 72, 65, 82, 79, 83, 72, 84, 72, 201, 75, 72, 65, 82,
+ 128, 75, 72, 65, 80, 72, 128, 75, 72, 65, 78, 199, 75, 72, 65, 78, 68,
+ 65, 128, 75, 72, 65, 78, 68, 193, 75, 72, 65, 77, 84, 201, 75, 72, 65,
+ 77, 73, 76, 79, 128, 75, 72, 65, 75, 65, 83, 83, 73, 65, 206, 75, 72, 65,
+ 73, 128, 75, 72, 65, 72, 128, 75, 72, 65, 200, 75, 72, 65, 70, 128, 75,
+ 72, 65, 66, 128, 75, 72, 65, 65, 128, 75, 71, 128, 75, 69, 89, 67, 65,
+ 80, 128, 75, 69, 89, 67, 65, 208, 75, 69, 89, 66, 79, 65, 82, 68, 128,
+ 75, 69, 89, 66, 79, 65, 82, 196, 75, 69, 88, 128, 75, 69, 86, 128, 75,
+ 69, 85, 89, 69, 85, 88, 128, 75, 69, 85, 83, 72, 69, 85, 65, 69, 80, 128,
+ 75, 69, 85, 83, 69, 85, 88, 128, 75, 69, 85, 80, 85, 81, 128, 75, 69, 85,
+ 79, 212, 75, 69, 85, 77, 128, 75, 69, 85, 75, 69, 85, 84, 78, 68, 65,
+ 128, 75, 69, 85, 75, 65, 81, 128, 75, 69, 85, 65, 69, 84, 77, 69, 85, 78,
+ 128, 75, 69, 85, 65, 69, 82, 73, 128, 75, 69, 84, 84, 201, 75, 69, 83,
+ 72, 50, 128, 75, 69, 82, 69, 84, 128, 75, 69, 79, 87, 128, 75, 69, 78,
+ 84, 73, 77, 65, 84, 65, 128, 75, 69, 78, 84, 73, 77, 65, 84, 193, 75, 69,
+ 78, 84, 73, 77, 193, 75, 69, 78, 65, 84, 128, 75, 69, 78, 128, 75, 69,
+ 206, 75, 69, 77, 80, 85, 76, 128, 75, 69, 77, 80, 85, 204, 75, 69, 77,
+ 80, 76, 73, 128, 75, 69, 77, 80, 76, 201, 75, 69, 77, 80, 72, 82, 69, 78,
+ 71, 128, 75, 69, 77, 66, 65, 78, 71, 128, 75, 69, 76, 86, 73, 206, 75,
+ 69, 72, 69, 72, 128, 75, 69, 72, 69, 200, 75, 69, 72, 128, 75, 69, 70,
+ 85, 76, 65, 128, 75, 69, 69, 86, 128, 75, 69, 69, 83, 85, 128, 75, 69,
+ 69, 80, 73, 78, 199, 75, 69, 69, 78, 71, 128, 75, 69, 69, 66, 128, 75,
+ 69, 66, 128, 75, 69, 65, 65, 69, 128, 75, 67, 65, 76, 128, 75, 66, 128,
+ 75, 65, 90, 65, 75, 200, 75, 65, 89, 65, 78, 78, 65, 128, 75, 65, 89, 65,
+ 200, 75, 65, 88, 128, 75, 65, 87, 86, 128, 75, 65, 87, 73, 128, 75, 65,
+ 87, 201, 75, 65, 87, 66, 128, 75, 65, 86, 89, 75, 65, 128, 75, 65, 86,
+ 89, 75, 193, 75, 65, 86, 128, 75, 65, 85, 86, 128, 75, 65, 85, 78, 65,
+ 128, 75, 65, 85, 206, 75, 65, 85, 66, 128, 75, 65, 84, 79, 128, 75, 65,
+ 84, 72, 73, 83, 84, 73, 128, 75, 65, 84, 72, 65, 75, 193, 75, 65, 84, 65,
+ 86, 65, 83, 77, 65, 128, 75, 65, 84, 65, 86, 193, 75, 65, 84, 65, 75, 65,
+ 78, 65, 45, 72, 73, 82, 65, 71, 65, 78, 193, 75, 65, 83, 82, 65, 84, 65,
+ 78, 128, 75, 65, 83, 82, 65, 84, 65, 206, 75, 65, 83, 82, 65, 128, 75,
+ 65, 83, 82, 193, 75, 65, 83, 75, 65, 76, 128, 75, 65, 83, 75, 65, 204,
+ 75, 65, 83, 72, 77, 73, 82, 201, 75, 65, 82, 83, 72, 65, 78, 65, 128, 75,
+ 65, 82, 79, 82, 73, 73, 128, 75, 65, 82, 79, 82, 65, 78, 128, 75, 65, 82,
+ 79, 82, 128, 75, 65, 82, 207, 75, 65, 82, 69, 206, 75, 65, 82, 65, 84,
+ 84, 79, 128, 75, 65, 82, 65, 78, 128, 75, 65, 80, 89, 69, 79, 85, 78, 83,
+ 83, 65, 78, 71, 80, 73, 69, 85, 80, 128, 75, 65, 80, 89, 69, 79, 85, 78,
+ 82, 73, 69, 85, 76, 128, 75, 65, 80, 89, 69, 79, 85, 78, 80, 72, 73, 69,
+ 85, 80, 72, 128, 75, 65, 80, 89, 69, 79, 85, 78, 77, 73, 69, 85, 77, 128,
+ 75, 65, 80, 80, 65, 128, 75, 65, 80, 80, 193, 75, 65, 80, 79, 128, 75,
+ 65, 80, 72, 128, 75, 65, 80, 65, 76, 128, 75, 65, 80, 65, 128, 75, 65,
+ 208, 75, 65, 78, 84, 65, 74, 193, 75, 65, 78, 78, 65, 68, 193, 75, 65,
+ 78, 71, 65, 82, 79, 79, 128, 75, 65, 78, 71, 128, 75, 65, 78, 199, 75,
+ 65, 78, 65, 75, 79, 128, 75, 65, 77, 52, 128, 75, 65, 77, 50, 128, 75,
+ 65, 77, 128, 75, 65, 75, 84, 79, 86, 73, 203, 75, 65, 75, 79, 128, 75,
+ 65, 75, 65, 66, 65, 84, 128, 75, 65, 75, 128, 75, 65, 203, 75, 65, 73,
+ 86, 128, 75, 65, 73, 84, 72, 201, 75, 65, 73, 82, 73, 128, 75, 65, 73,
+ 66, 128, 75, 65, 73, 128, 75, 65, 201, 75, 65, 70, 65, 128, 75, 65, 70,
+ 128, 75, 65, 198, 75, 65, 68, 53, 128, 75, 65, 68, 181, 75, 65, 68, 52,
+ 128, 75, 65, 68, 51, 128, 75, 65, 68, 179, 75, 65, 68, 50, 128, 75, 65,
+ 68, 128, 75, 65, 67, 72, 75, 65, 128, 75, 65, 66, 193, 75, 65, 66, 128,
+ 75, 65, 65, 86, 128, 75, 65, 65, 73, 128, 75, 65, 65, 70, 85, 128, 75,
+ 65, 65, 70, 128, 75, 65, 65, 67, 85, 128, 75, 65, 65, 66, 65, 128, 75,
+ 65, 65, 66, 128, 75, 65, 50, 128, 75, 65, 178, 75, 65, 45, 75, 69, 128,
+ 75, 65, 45, 57, 128, 75, 65, 45, 56, 128, 75, 65, 45, 55, 128, 75, 65,
+ 45, 54, 128, 75, 65, 45, 53, 128, 75, 65, 45, 52, 128, 75, 65, 45, 51,
+ 128, 75, 65, 45, 50, 128, 75, 65, 45, 49, 49, 128, 75, 65, 45, 49, 48,
+ 128, 75, 65, 45, 49, 128, 75, 48, 48, 56, 128, 75, 48, 48, 55, 128, 75,
+ 48, 48, 54, 128, 75, 48, 48, 53, 128, 75, 48, 48, 52, 128, 75, 48, 48,
+ 51, 128, 75, 48, 48, 50, 128, 75, 48, 48, 49, 128, 74, 87, 65, 128, 74,
+ 85, 85, 128, 74, 85, 84, 128, 74, 85, 83, 84, 73, 70, 73, 67, 65, 84, 73,
+ 79, 78, 128, 74, 85, 80, 73, 84, 69, 82, 128, 74, 85, 79, 84, 128, 74,
+ 85, 79, 80, 128, 74, 85, 78, 79, 128, 74, 85, 78, 71, 83, 69, 79, 78,
+ 199, 74, 85, 78, 69, 128, 74, 85, 76, 89, 128, 74, 85, 71, 71, 76, 73,
+ 78, 71, 128, 74, 85, 69, 85, 73, 128, 74, 85, 68, 85, 76, 128, 74, 85,
+ 68, 71, 69, 128, 74, 85, 68, 69, 79, 45, 83, 80, 65, 78, 73, 83, 200, 74,
+ 79, 89, 83, 84, 73, 67, 75, 128, 74, 79, 89, 79, 85, 211, 74, 79, 89,
+ 128, 74, 79, 86, 69, 128, 74, 79, 212, 74, 79, 78, 71, 128, 74, 79, 78,
+ 193, 74, 79, 75, 69, 82, 128, 74, 79, 73, 78, 84, 83, 128, 74, 79, 73,
+ 78, 69, 68, 128, 74, 79, 73, 78, 128, 74, 79, 65, 128, 74, 78, 89, 65,
+ 128, 74, 74, 89, 88, 128, 74, 74, 89, 84, 128, 74, 74, 89, 80, 128, 74,
+ 74, 89, 128, 74, 74, 85, 88, 128, 74, 74, 85, 84, 128, 74, 74, 85, 82,
+ 88, 128, 74, 74, 85, 82, 128, 74, 74, 85, 80, 128, 74, 74, 85, 79, 88,
+ 128, 74, 74, 85, 79, 80, 128, 74, 74, 85, 79, 128, 74, 74, 85, 128, 74,
+ 74, 79, 88, 128, 74, 74, 79, 84, 128, 74, 74, 79, 80, 128, 74, 74, 79,
+ 128, 74, 74, 73, 88, 128, 74, 74, 73, 84, 128, 74, 74, 73, 80, 128, 74,
+ 74, 73, 69, 88, 128, 74, 74, 73, 69, 84, 128, 74, 74, 73, 69, 80, 128,
+ 74, 74, 73, 69, 128, 74, 74, 73, 128, 74, 74, 69, 69, 128, 74, 74, 69,
+ 128, 74, 74, 65, 128, 74, 73, 76, 128, 74, 73, 73, 77, 128, 74, 73, 73,
+ 128, 74, 73, 72, 86, 65, 77, 85, 76, 73, 89, 65, 128, 74, 73, 71, 83, 65,
+ 215, 74, 73, 65, 128, 74, 72, 79, 88, 128, 74, 72, 79, 128, 74, 72, 69,
+ 72, 128, 74, 72, 65, 89, 73, 78, 128, 74, 72, 65, 78, 128, 74, 72, 65,
+ 77, 128, 74, 72, 65, 65, 128, 74, 72, 65, 128, 74, 69, 85, 128, 74, 69,
+ 82, 85, 83, 65, 76, 69, 77, 128, 74, 69, 82, 65, 206, 74, 69, 82, 65,
+ 128, 74, 69, 82, 128, 74, 69, 76, 76, 89, 70, 73, 83, 72, 128, 74, 69,
+ 72, 128, 74, 69, 200, 74, 69, 71, 79, 71, 65, 78, 128, 74, 69, 69, 77,
+ 128, 74, 69, 69, 205, 74, 69, 65, 78, 83, 128, 74, 65, 89, 78, 128, 74,
+ 65, 89, 73, 78, 128, 74, 65, 89, 65, 78, 78, 65, 128, 74, 65, 87, 128,
+ 74, 65, 86, 73, 89, 65, 78, 73, 128, 74, 65, 86, 65, 78, 69, 83, 197, 74,
+ 65, 85, 128, 74, 65, 82, 128, 74, 65, 80, 65, 78, 69, 83, 197, 74, 65,
+ 80, 65, 78, 128, 74, 65, 78, 85, 65, 82, 89, 128, 74, 65, 76, 76, 65, 74,
+ 65, 76, 65, 76, 79, 85, 72, 79, 85, 128, 74, 65, 76, 76, 128, 74, 65, 73,
+ 206, 74, 65, 73, 128, 74, 65, 72, 128, 74, 65, 68, 69, 128, 74, 65, 67,
+ 75, 83, 128, 74, 65, 67, 75, 45, 79, 45, 76, 65, 78, 84, 69, 82, 78, 128,
+ 74, 65, 67, 203, 74, 45, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 73, 90,
+ 72, 73, 84, 83, 65, 128, 73, 90, 72, 73, 84, 83, 193, 73, 90, 72, 69,
+ 128, 73, 90, 65, 75, 65, 89, 193, 73, 89, 69, 75, 128, 73, 89, 65, 78,
+ 78, 65, 128, 73, 85, 74, 65, 128, 73, 84, 211, 73, 84, 69, 82, 65, 84,
+ 73, 79, 206, 73, 84, 69, 77, 128, 73, 83, 83, 72, 65, 82, 128, 73, 83,
+ 79, 83, 67, 69, 76, 69, 211, 73, 83, 79, 78, 128, 73, 83, 79, 206, 73,
+ 83, 79, 76, 65, 84, 69, 128, 73, 83, 76, 65, 78, 68, 128, 73, 83, 72, 77,
+ 65, 65, 77, 128, 73, 83, 69, 78, 45, 73, 83, 69, 78, 128, 73, 83, 65, 75,
+ 73, 193, 73, 83, 45, 80, 73, 76, 76, 65, 128, 73, 82, 85, 89, 65, 78, 78,
+ 65, 128, 73, 82, 85, 85, 89, 65, 78, 78, 65, 128, 73, 82, 79, 78, 45, 67,
+ 79, 80, 80, 69, 210, 73, 82, 79, 78, 128, 73, 82, 66, 128, 73, 79, 84,
+ 73, 70, 73, 69, 196, 73, 79, 84, 65, 84, 69, 196, 73, 79, 84, 65, 128,
+ 73, 79, 84, 193, 73, 79, 82, 128, 73, 79, 78, 71, 128, 73, 79, 68, 72,
+ 65, 68, 72, 128, 73, 78, 86, 73, 83, 73, 66, 76, 197, 73, 78, 86, 69, 82,
+ 84, 69, 68, 128, 73, 78, 86, 69, 82, 84, 69, 196, 73, 78, 86, 69, 82, 84,
+ 69, 66, 82, 65, 84, 69, 128, 73, 78, 86, 69, 82, 83, 197, 73, 78, 84, 82,
+ 79, 68, 85, 67, 69, 82, 128, 73, 78, 84, 73, 128, 73, 78, 84, 69, 82, 83,
+ 89, 76, 76, 65, 66, 73, 195, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 79,
+ 78, 128, 73, 78, 84, 69, 82, 83, 69, 67, 84, 73, 79, 206, 73, 78, 84, 69,
+ 82, 83, 69, 67, 84, 73, 78, 199, 73, 78, 84, 69, 82, 82, 79, 66, 65, 78,
+ 71, 128, 73, 78, 84, 69, 82, 82, 79, 66, 65, 78, 199, 73, 78, 84, 69, 82,
+ 80, 79, 76, 65, 84, 73, 79, 206, 73, 78, 84, 69, 82, 76, 79, 67, 75, 69,
+ 196, 73, 78, 84, 69, 82, 76, 73, 78, 69, 65, 210, 73, 78, 84, 69, 82, 76,
+ 65, 67, 69, 196, 73, 78, 84, 69, 82, 73, 79, 210, 73, 78, 84, 69, 82, 69,
+ 83, 212, 73, 78, 84, 69, 82, 67, 65, 76, 65, 84, 69, 128, 73, 78, 84, 69,
+ 71, 82, 65, 84, 73, 79, 78, 128, 73, 78, 84, 69, 71, 82, 65, 84, 73, 79,
+ 206, 73, 78, 84, 69, 71, 82, 65, 76, 128, 73, 78, 84, 69, 71, 82, 65,
+ 204, 73, 78, 83, 85, 76, 65, 210, 73, 78, 83, 84, 82, 85, 77, 69, 78, 84,
+ 65, 204, 73, 78, 83, 73, 68, 69, 128, 73, 78, 83, 73, 68, 197, 73, 78,
+ 83, 69, 82, 84, 73, 79, 206, 73, 78, 83, 69, 82, 212, 73, 78, 83, 69, 67,
+ 84, 128, 73, 78, 83, 67, 82, 73, 80, 84, 73, 79, 78, 65, 204, 73, 78, 80,
+ 85, 212, 73, 78, 78, 79, 67, 69, 78, 67, 69, 128, 73, 78, 78, 78, 128,
+ 73, 78, 78, 69, 82, 128, 73, 78, 78, 69, 210, 73, 78, 78, 128, 73, 78,
+ 73, 78, 71, 85, 128, 73, 78, 72, 73, 66, 73, 212, 73, 78, 72, 69, 82, 69,
+ 78, 212, 73, 78, 72, 65, 76, 69, 128, 73, 78, 71, 87, 65, 90, 128, 73,
+ 78, 70, 79, 82, 77, 65, 84, 73, 79, 206, 73, 78, 70, 76, 85, 69, 78, 67,
+ 69, 128, 73, 78, 70, 73, 78, 73, 84, 89, 128, 73, 78, 70, 73, 78, 73, 84,
+ 217, 73, 78, 68, 85, 83, 84, 82, 73, 65, 204, 73, 78, 68, 73, 82, 69, 67,
+ 212, 73, 78, 68, 73, 67, 84, 73, 79, 206, 73, 78, 68, 73, 67, 65, 84, 79,
+ 82, 128, 73, 78, 68, 73, 67, 65, 84, 79, 210, 73, 78, 68, 73, 195, 73,
+ 78, 68, 73, 65, 206, 73, 78, 68, 69, 88, 128, 73, 78, 68, 69, 80, 69, 78,
+ 68, 69, 78, 212, 73, 78, 67, 82, 69, 77, 69, 78, 84, 128, 73, 78, 67, 82,
+ 69, 65, 83, 69, 211, 73, 78, 67, 82, 69, 65, 83, 69, 128, 73, 78, 67, 82,
+ 69, 65, 83, 197, 73, 78, 67, 79, 77, 80, 76, 69, 84, 197, 73, 78, 67, 79,
+ 77, 73, 78, 199, 73, 78, 67, 76, 85, 68, 73, 78, 199, 73, 78, 67, 72,
+ 128, 73, 78, 66, 79, 216, 73, 78, 65, 80, 128, 73, 78, 45, 65, 76, 65,
+ 70, 128, 73, 77, 80, 69, 82, 73, 65, 204, 73, 77, 80, 69, 82, 70, 69, 67,
+ 84, 85, 205, 73, 77, 80, 69, 82, 70, 69, 67, 84, 65, 128, 73, 77, 80, 69,
+ 82, 70, 69, 67, 84, 193, 73, 77, 78, 128, 73, 77, 73, 83, 69, 79, 211,
+ 73, 77, 73, 78, 51, 128, 73, 77, 73, 78, 128, 73, 77, 73, 206, 73, 77,
+ 73, 70, 84, 72, 79, 82, 79, 78, 128, 73, 77, 73, 70, 84, 72, 79, 82, 65,
+ 128, 73, 77, 73, 70, 79, 78, 79, 78, 128, 73, 77, 73, 68, 73, 65, 82, 71,
+ 79, 78, 128, 73, 77, 65, 71, 197, 73, 77, 65, 65, 76, 65, 128, 73, 76,
+ 85, 89, 65, 78, 78, 65, 128, 73, 76, 85, 89, 128, 73, 76, 85, 85, 89, 65,
+ 78, 78, 65, 128, 73, 76, 85, 84, 128, 73, 76, 73, 77, 77, 85, 52, 128,
+ 73, 76, 73, 77, 77, 85, 51, 128, 73, 76, 73, 77, 77, 85, 128, 73, 76, 73,
+ 77, 77, 213, 73, 76, 50, 128, 73, 75, 73, 82, 128, 73, 75, 65, 82, 65,
+ 128, 73, 75, 65, 82, 193, 73, 74, 128, 73, 73, 89, 65, 78, 78, 65, 128,
+ 73, 71, 73, 128, 73, 71, 201, 73, 71, 71, 87, 83, 128, 73, 70, 73, 78,
+ 128, 73, 69, 85, 78, 71, 45, 84, 73, 75, 69, 85, 84, 128, 73, 69, 85, 78,
+ 71, 45, 84, 72, 73, 69, 85, 84, 72, 128, 73, 69, 85, 78, 71, 45, 82, 73,
+ 69, 85, 76, 128, 73, 69, 85, 78, 71, 45, 80, 73, 69, 85, 80, 128, 73, 69,
+ 85, 78, 71, 45, 80, 72, 73, 69, 85, 80, 72, 128, 73, 69, 85, 78, 71, 45,
+ 67, 73, 69, 85, 67, 128, 73, 69, 85, 78, 71, 45, 67, 72, 73, 69, 85, 67,
+ 72, 128, 73, 69, 85, 78, 199, 73, 68, 76, 69, 128, 73, 68, 73, 77, 128,
+ 73, 68, 73, 205, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 68, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 67, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 66, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 65, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 57, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 56, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 55, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 54, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 53, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 52, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 51, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 50, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 49, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 65, 48, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 65, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 65, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 70, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 69, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 68, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 67, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 66, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 65, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 57, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 56, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 55, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 54, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 53, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 52, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 51, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 54, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 50, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 65, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 52, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 49, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 69, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 56, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 70, 57, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70,
+ 57, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 50, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 70, 57, 48, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 70, 57, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 57, 49, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 57,
+ 48, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 68, 55, 48,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 56, 67, 65, 57, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 56, 57, 69, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 55, 68, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 55, 65, 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55,
+ 57, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 54, 68, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 51, 51, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 55, 53, 49, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 55, 49, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 55, 48, 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54,
+ 70, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 69, 56, 48,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 50, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 54, 55, 48, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 54, 55, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 54, 54, 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54,
+ 53, 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 53, 57, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 53, 53, 55, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 54, 51, 53, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 54, 51, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 54, 50, 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54,
+ 50, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 54, 50, 52, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 70, 56, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 53, 68, 69, 54, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 53, 66, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 53, 66, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53,
+ 57, 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 57, 49, 65,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 56, 70, 48, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 53, 53, 66, 54, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 53, 52, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 53, 52, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53,
+ 51, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 51, 67, 67,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 68, 68, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 53, 50, 55, 50, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 53, 50, 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 53, 50, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 53,
+ 49, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 65, 52,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 56, 67, 128, 73, 68,
+ 69, 79, 71, 82, 65, 80, 72, 45, 52, 69, 50, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 52, 69, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80,
+ 72, 45, 52, 69, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 65, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65,
+ 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 65, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 56, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 65, 49, 55, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 65, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 65, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 65, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65,
+ 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 50,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 49, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 49, 48, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 65, 48, 69, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 65, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 65, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 65, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65,
+ 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 56, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 54, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 65, 48, 53, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 65, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 65, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 65, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65,
+ 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 65, 48, 48,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 70, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 69, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 70, 67, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 70, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 70, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 70, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 70, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 54, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 70, 52, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 70, 51, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 70, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 70, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 70, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 69, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 69,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 68, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 67, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 69, 65, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 69, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 69, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 69, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 69, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 52, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 69, 50, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 69, 49, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 69, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 68, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 68, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 68, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 67,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 66, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 65, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 68, 56, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 68, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 68, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 68, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 68, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 50, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 68, 48, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 67, 70, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 67, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 67, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 67, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 67, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 65,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 57, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 56, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 67, 54, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 67, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 67, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 67, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 67, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 67, 48, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 69, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 66, 68, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 66, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 66, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 66, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 66, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 56,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 55, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 54, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 66, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 66, 52, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 66, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 66, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 66, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 66, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 69, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 67, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 65, 66, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 65, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 65, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 65, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 65, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 54,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 53, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 52, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 65, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 65, 50, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 65, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 65, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 57, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 57, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 67, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 65, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 57, 57, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 57, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 57, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 57, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 57, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 52,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 51, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 50, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 57, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 57, 48, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 56, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 56, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 56, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 56, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 65, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 56, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 56, 55, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 56, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 56, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 56, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 56, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 50,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 49, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 56, 48, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 55, 69, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 55, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 55, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 55, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 55, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 56, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 54, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 55, 53, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 55, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 55, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 55, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 55, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 55, 48,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 70, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 69, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 54, 67, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 54, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 54, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 54, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 54, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 54, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 54, 52, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 54, 51, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 54, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 54, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 54, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 53, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 69,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 68, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 67, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 53, 65, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 53, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 53, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 53, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 53, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 52, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 53, 50, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 53, 49, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 53, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 52, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 52, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 52, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 67,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 66, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 65, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 52, 56, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 52, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 52, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 52, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 52, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 50, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 52, 48, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 51, 70, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 51, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 51, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 51, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 51, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 65,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 57, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 56, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 51, 54, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 51, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 51, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 51, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 51, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 51, 48, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 69, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 50, 68, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 50, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 50, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 50, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 50, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 56,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 55, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 54, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 50, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 50, 52, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 50, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 50, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 50, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 50, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 69, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 67, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 49, 66, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 49, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 49, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 49, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 49, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 54,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 53, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 52, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 49, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 49, 50, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 49, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 49, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 48, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 48, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 67, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 65, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 48, 57, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 57, 48, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 57, 48, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 57, 48, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57,
+ 48, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 52,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 51, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 50, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 57, 48, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 57, 48, 48, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 70, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 70, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 70, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 70, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 65, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 56, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 70, 55, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 70, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 70, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 70, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 70, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 50,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 49, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 70, 48, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 69, 69, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 69, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 69, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 69, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 69, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 56, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 54, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 69, 53, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 69, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 69, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 69, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 69, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 69, 48,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 70, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 69, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 68, 67, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 68, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 68, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 68, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 68, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 54, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 68, 52, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 68, 51, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 68, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 68, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 68, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 67, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 69,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 68, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 67, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 67, 65, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 67, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 67, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 67, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 67, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 52, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 67, 50, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 67, 49, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 67, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 66, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 66, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 66, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 67,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 66, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 65, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 66, 56, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 66, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 66, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 66, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 66, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 50, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 66, 48, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 65, 70, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 65, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 65, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 65, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 65, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 65,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 57, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 56, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 65, 54, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 65, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 65, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 65, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 65, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 65, 48, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 69, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 57, 68, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 57, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 57, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 57, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 57, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 56,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 55, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 54, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 57, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 57, 52, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 57, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 57, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 57, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 57, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 70,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 69, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 68, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 67, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 56, 66, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 56, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 56, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 56, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 56, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 54,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 53, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 52, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 56, 51, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 56, 50, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 56, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 56, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 55, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 55, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 68,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 67, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 66, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 65, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 55, 57, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 55, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 55, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 55, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 55, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 52,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 51, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 50, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 55, 49, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 55, 48, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 54, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 54, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 54, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 54, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 66,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 65, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 57, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 56, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 54, 55, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 54, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 54, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 54, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 54, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 50,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 49, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 54, 48, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 70, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 53, 69, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 53, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 53, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 53, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 53, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 57,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 56, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 55, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 54, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 53, 53, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 53, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 53, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 53, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 53, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 53, 48,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 70, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 69, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 68, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 52, 67, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 52, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 52, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 52, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 52, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 55,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 54, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 53, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 52, 52, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 52, 51, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 52, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 52, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 52, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 51, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 69,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 68, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 67, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 66, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 51, 65, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 51, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 51, 56, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 51, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 51, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 53,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 52, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 51, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 51, 50, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 51, 49, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 51, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 50, 70, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 50, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 50, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 67,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 66, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 65, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 57, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 50, 56, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 50, 55, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 50, 54, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 50, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 50, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 51,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 50, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 49, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 50, 48, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 49, 70, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 49, 69, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 49, 68, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 49, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 49, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 65,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 57, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 56, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 55, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 49, 54, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 49, 53, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 49, 52, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 49, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 49, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 49,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 49, 48, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 70, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 69, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 48, 68, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 48, 67, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 48, 66, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 48, 65, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 48, 57, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 56,
+ 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 55, 128, 73,
+ 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 54, 128, 73, 68, 69,
+ 79, 71, 82, 65, 80, 72, 45, 50, 70, 56, 48, 53, 128, 73, 68, 69, 79, 71,
+ 82, 65, 80, 72, 45, 50, 70, 56, 48, 52, 128, 73, 68, 69, 79, 71, 82, 65,
+ 80, 72, 45, 50, 70, 56, 48, 51, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72,
+ 45, 50, 70, 56, 48, 50, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50,
+ 70, 56, 48, 49, 128, 73, 68, 69, 79, 71, 82, 65, 80, 72, 45, 50, 70, 56,
+ 48, 48, 128, 73, 68, 69, 79, 71, 82, 65, 80, 200, 73, 68, 69, 78, 84, 73,
+ 70, 73, 67, 65, 84, 73, 79, 78, 128, 73, 68, 69, 78, 84, 73, 70, 73, 67,
+ 65, 84, 73, 79, 206, 73, 68, 69, 78, 84, 73, 67, 65, 204, 73, 68, 68,
+ 128, 73, 67, 79, 78, 128, 73, 67, 72, 79, 85, 128, 73, 67, 72, 79, 83,
+ 128, 73, 67, 72, 73, 77, 65, 84, 79, 83, 128, 73, 67, 72, 65, 68, 73, 78,
+ 128, 73, 67, 69, 76, 65, 78, 68, 73, 67, 45, 89, 82, 128, 73, 66, 73, 70,
+ 73, 76, 73, 128, 73, 65, 85, 68, 65, 128, 73, 48, 49, 53, 128, 73, 48,
+ 49, 52, 128, 73, 48, 49, 51, 128, 73, 48, 49, 50, 128, 73, 48, 49, 49,
+ 65, 128, 73, 48, 49, 49, 128, 73, 48, 49, 48, 65, 128, 73, 48, 49, 48,
+ 128, 73, 48, 48, 57, 65, 128, 73, 48, 48, 57, 128, 73, 48, 48, 56, 128,
+ 73, 48, 48, 55, 128, 73, 48, 48, 54, 128, 73, 48, 48, 53, 65, 128, 73,
+ 48, 48, 53, 128, 73, 48, 48, 52, 128, 73, 48, 48, 51, 128, 73, 48, 48,
+ 50, 128, 73, 48, 48, 49, 128, 73, 45, 89, 85, 128, 73, 45, 89, 79, 128,
+ 73, 45, 89, 69, 79, 128, 73, 45, 89, 69, 128, 73, 45, 89, 65, 69, 128,
+ 73, 45, 89, 65, 45, 79, 128, 73, 45, 89, 65, 128, 73, 45, 79, 45, 73,
+ 128, 73, 45, 79, 128, 73, 45, 69, 85, 128, 73, 45, 66, 69, 65, 77, 128,
+ 73, 45, 65, 82, 65, 69, 65, 128, 73, 45, 65, 128, 72, 90, 90, 90, 71,
+ 128, 72, 90, 90, 90, 128, 72, 90, 90, 80, 128, 72, 90, 90, 128, 72, 90,
+ 87, 71, 128, 72, 90, 87, 128, 72, 90, 84, 128, 72, 90, 71, 128, 72, 89,
+ 83, 84, 69, 82, 69, 83, 73, 211, 72, 89, 80, 79, 68, 73, 65, 83, 84, 79,
+ 76, 69, 128, 72, 89, 80, 72, 69, 78, 65, 84, 73, 79, 206, 72, 89, 80, 72,
+ 69, 78, 45, 77, 73, 78, 85, 83, 128, 72, 89, 80, 72, 69, 78, 128, 72, 89,
+ 80, 72, 69, 206, 72, 89, 71, 73, 69, 73, 65, 128, 72, 89, 71, 73, 69, 65,
+ 128, 72, 89, 65, 67, 73, 78, 84, 72, 128, 72, 88, 87, 71, 128, 72, 88,
+ 85, 79, 88, 128, 72, 88, 85, 79, 84, 128, 72, 88, 85, 79, 80, 128, 72,
+ 88, 85, 79, 128, 72, 88, 79, 88, 128, 72, 88, 79, 84, 128, 72, 88, 79,
+ 80, 128, 72, 88, 79, 128, 72, 88, 73, 88, 128, 72, 88, 73, 84, 128, 72,
+ 88, 73, 80, 128, 72, 88, 73, 69, 88, 128, 72, 88, 73, 69, 84, 128, 72,
+ 88, 73, 69, 80, 128, 72, 88, 73, 69, 128, 72, 88, 73, 128, 72, 88, 69,
+ 88, 128, 72, 88, 69, 80, 128, 72, 88, 69, 128, 72, 88, 65, 88, 128, 72,
+ 88, 65, 84, 128, 72, 88, 65, 80, 128, 72, 88, 65, 128, 72, 87, 85, 128,
+ 72, 87, 65, 73, 82, 128, 72, 87, 65, 72, 128, 72, 85, 86, 65, 128, 72,
+ 85, 83, 72, 69, 196, 72, 85, 83, 72, 128, 72, 85, 82, 65, 78, 128, 72,
+ 85, 79, 84, 128, 72, 85, 78, 68, 82, 69, 68, 83, 128, 72, 85, 78, 68, 82,
+ 69, 68, 211, 72, 85, 78, 68, 82, 69, 68, 128, 72, 85, 78, 68, 82, 69,
+ 196, 72, 85, 78, 128, 72, 85, 77, 208, 72, 85, 77, 65, 78, 128, 72, 85,
+ 77, 65, 206, 72, 85, 76, 50, 128, 72, 85, 73, 73, 84, 79, 128, 72, 85,
+ 71, 71, 73, 78, 71, 128, 72, 85, 71, 71, 73, 78, 199, 72, 85, 66, 50,
+ 128, 72, 85, 66, 178, 72, 85, 66, 128, 72, 85, 65, 82, 65, 68, 68, 79,
+ 128, 72, 85, 65, 78, 128, 72, 85, 45, 51, 128, 72, 85, 45, 50, 128, 72,
+ 85, 45, 49, 128, 72, 84, 84, 65, 128, 72, 84, 83, 128, 72, 84, 74, 128,
+ 72, 82, 89, 86, 78, 73, 193, 72, 80, 87, 71, 128, 72, 80, 65, 128, 72,
+ 80, 128, 72, 79, 85, 83, 197, 72, 79, 85, 82, 71, 76, 65, 83, 83, 128,
+ 72, 79, 85, 82, 71, 76, 65, 83, 211, 72, 79, 85, 82, 128, 72, 79, 85,
+ 210, 72, 79, 84, 69, 76, 128, 72, 79, 84, 65, 128, 72, 79, 83, 80, 73,
+ 84, 65, 76, 128, 72, 79, 82, 83, 69, 128, 72, 79, 82, 83, 197, 72, 79,
+ 82, 82, 128, 72, 79, 82, 78, 83, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 76, 89, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 76, 217, 72, 79,
+ 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 54, 128, 72, 79, 82,
+ 73, 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 53, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 52, 128, 72, 79, 82, 73, 90,
+ 79, 78, 84, 65, 76, 45, 48, 54, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79,
+ 78, 84, 65, 76, 45, 48, 54, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78,
+ 84, 65, 76, 45, 48, 54, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 76, 45, 48, 54, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 45, 48, 53, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
+ 45, 48, 53, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
+ 48, 53, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
+ 53, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53,
+ 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45,
+ 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 53, 45, 48,
+ 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 54,
+ 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 53, 128,
+ 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 52, 128, 72,
+ 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 51, 128, 72, 79,
+ 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 50, 128, 72, 79, 82,
+ 73, 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 49, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 76, 45, 48, 52, 45, 48, 48, 128, 72, 79, 82, 73, 90,
+ 79, 78, 84, 65, 76, 45, 48, 51, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79,
+ 78, 84, 65, 76, 45, 48, 51, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78,
+ 84, 65, 76, 45, 48, 51, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 76, 45, 48, 51, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 45, 48, 51, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
+ 45, 48, 51, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
+ 48, 51, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
+ 50, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50,
+ 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45,
+ 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48,
+ 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 50,
+ 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 49, 128,
+ 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 50, 45, 48, 48, 128, 72,
+ 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 54, 128, 72, 79,
+ 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 53, 128, 72, 79, 82,
+ 73, 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 52, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 51, 128, 72, 79, 82, 73, 90,
+ 79, 78, 84, 65, 76, 45, 48, 49, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79,
+ 78, 84, 65, 76, 45, 48, 49, 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78,
+ 84, 65, 76, 45, 48, 49, 45, 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84,
+ 65, 76, 45, 48, 48, 45, 48, 54, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65,
+ 76, 45, 48, 48, 45, 48, 53, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76,
+ 45, 48, 48, 45, 48, 52, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45,
+ 48, 48, 45, 48, 51, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48,
+ 48, 45, 48, 50, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48,
+ 45, 48, 49, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 45, 48, 48, 45,
+ 48, 48, 128, 72, 79, 82, 73, 90, 79, 78, 84, 65, 76, 128, 72, 79, 82, 73,
+ 90, 79, 78, 84, 65, 204, 72, 79, 82, 73, 128, 72, 79, 82, 193, 72, 79,
+ 79, 85, 128, 72, 79, 79, 82, 85, 128, 72, 79, 79, 80, 128, 72, 79, 79,
+ 78, 128, 72, 79, 79, 75, 69, 68, 128, 72, 79, 79, 75, 69, 196, 72, 79,
+ 78, 69, 89, 66, 69, 69, 128, 72, 79, 78, 69, 217, 72, 79, 77, 79, 84, 72,
+ 69, 84, 73, 67, 128, 72, 79, 77, 79, 84, 72, 69, 84, 73, 195, 72, 79, 76,
+ 79, 128, 72, 79, 76, 76, 79, 215, 72, 79, 76, 69, 128, 72, 79, 76, 68,
+ 73, 78, 199, 72, 79, 76, 65, 77, 128, 72, 79, 76, 65, 205, 72, 79, 75,
+ 65, 128, 72, 79, 67, 75, 69, 217, 72, 79, 67, 72, 79, 128, 72, 79, 45,
+ 56, 128, 72, 79, 45, 55, 128, 72, 79, 45, 54, 128, 72, 79, 45, 53, 128,
+ 72, 79, 45, 52, 128, 72, 79, 45, 51, 128, 72, 79, 45, 50, 128, 72, 79,
+ 45, 49, 128, 72, 78, 85, 84, 128, 72, 78, 85, 79, 88, 128, 72, 78, 85,
+ 79, 128, 72, 78, 85, 66, 128, 72, 78, 79, 88, 128, 72, 78, 79, 84, 128,
+ 72, 78, 79, 80, 128, 72, 78, 73, 88, 128, 72, 78, 73, 84, 128, 72, 78,
+ 73, 80, 128, 72, 78, 73, 69, 88, 128, 72, 78, 73, 69, 84, 128, 72, 78,
+ 73, 69, 80, 128, 72, 78, 73, 69, 128, 72, 78, 73, 128, 72, 78, 69, 88,
+ 128, 72, 78, 69, 80, 128, 72, 78, 69, 128, 72, 78, 65, 88, 128, 72, 78,
+ 65, 85, 128, 72, 78, 65, 84, 128, 72, 78, 65, 80, 128, 72, 78, 65, 128,
+ 72, 77, 89, 88, 128, 72, 77, 89, 82, 88, 128, 72, 77, 89, 82, 128, 72,
+ 77, 89, 80, 128, 72, 77, 89, 128, 72, 77, 85, 88, 128, 72, 77, 85, 84,
+ 128, 72, 77, 85, 82, 88, 128, 72, 77, 85, 82, 128, 72, 77, 85, 80, 128,
+ 72, 77, 85, 79, 88, 128, 72, 77, 85, 79, 80, 128, 72, 77, 85, 79, 128,
+ 72, 77, 85, 128, 72, 77, 79, 88, 128, 72, 77, 79, 84, 128, 72, 77, 79,
+ 80, 128, 72, 77, 79, 128, 72, 77, 73, 88, 128, 72, 77, 73, 84, 128, 72,
+ 77, 73, 80, 128, 72, 77, 73, 69, 88, 128, 72, 77, 73, 69, 80, 128, 72,
+ 77, 73, 69, 128, 72, 77, 73, 128, 72, 77, 69, 128, 72, 77, 65, 88, 128,
+ 72, 77, 65, 84, 128, 72, 77, 65, 80, 128, 72, 77, 65, 128, 72, 76, 89,
+ 88, 128, 72, 76, 89, 84, 128, 72, 76, 89, 82, 88, 128, 72, 76, 89, 82,
+ 128, 72, 76, 89, 80, 128, 72, 76, 89, 128, 72, 76, 85, 88, 128, 72, 76,
+ 85, 84, 128, 72, 76, 85, 82, 88, 128, 72, 76, 85, 82, 128, 72, 76, 85,
+ 80, 128, 72, 76, 85, 79, 88, 128, 72, 76, 85, 79, 80, 128, 72, 76, 85,
+ 79, 128, 72, 76, 85, 128, 72, 76, 79, 88, 128, 72, 76, 79, 80, 128, 72,
+ 76, 79, 128, 72, 76, 73, 88, 128, 72, 76, 73, 84, 128, 72, 76, 73, 80,
+ 128, 72, 76, 73, 69, 88, 128, 72, 76, 73, 69, 80, 128, 72, 76, 73, 69,
+ 128, 72, 76, 73, 128, 72, 76, 69, 88, 128, 72, 76, 69, 80, 128, 72, 76,
+ 69, 128, 72, 76, 65, 88, 128, 72, 76, 65, 85, 128, 72, 76, 65, 84, 128,
+ 72, 76, 65, 80, 128, 72, 76, 65, 128, 72, 76, 128, 72, 75, 128, 72, 73,
+ 90, 66, 128, 72, 73, 89, 79, 128, 72, 73, 84, 84, 73, 78, 199, 72, 73,
+ 83, 84, 79, 82, 73, 195, 72, 73, 82, 73, 81, 128, 72, 73, 80, 80, 79, 80,
+ 79, 84, 65, 77, 85, 83, 128, 72, 73, 78, 71, 69, 68, 128, 72, 73, 78, 71,
+ 69, 196, 72, 73, 78, 71, 69, 128, 72, 73, 78, 68, 213, 72, 73, 75, 73,
+ 78, 199, 72, 73, 71, 72, 45, 83, 80, 69, 69, 196, 72, 73, 71, 72, 45, 82,
+ 69, 86, 69, 82, 83, 69, 68, 45, 185, 72, 73, 71, 72, 45, 76, 79, 215, 72,
+ 73, 71, 72, 45, 72, 69, 69, 76, 69, 196, 72, 73, 69, 88, 128, 72, 73, 69,
+ 85, 72, 45, 83, 73, 79, 83, 128, 72, 73, 69, 85, 72, 45, 82, 73, 69, 85,
+ 76, 128, 72, 73, 69, 85, 72, 45, 80, 73, 69, 85, 80, 128, 72, 73, 69, 85,
+ 72, 45, 78, 73, 69, 85, 78, 128, 72, 73, 69, 85, 72, 45, 77, 73, 69, 85,
+ 77, 128, 72, 73, 69, 85, 200, 72, 73, 69, 82, 79, 71, 76, 89, 80, 72, 73,
+ 195, 72, 73, 68, 73, 78, 199, 72, 73, 68, 69, 84, 128, 72, 73, 68, 69,
+ 128, 72, 73, 66, 73, 83, 67, 85, 83, 128, 72, 73, 45, 82, 69, 83, 128,
+ 72, 73, 45, 55, 128, 72, 73, 45, 54, 128, 72, 73, 45, 53, 128, 72, 73,
+ 45, 52, 128, 72, 73, 45, 51, 128, 72, 73, 45, 50, 128, 72, 73, 45, 49,
+ 128, 72, 72, 89, 85, 128, 72, 72, 89, 79, 128, 72, 72, 89, 73, 128, 72,
+ 72, 89, 69, 69, 128, 72, 72, 89, 69, 128, 72, 72, 89, 65, 65, 128, 72,
+ 72, 89, 65, 128, 72, 72, 87, 73, 128, 72, 72, 87, 69, 69, 128, 72, 72,
+ 87, 69, 128, 72, 72, 87, 65, 128, 72, 72, 85, 128, 72, 72, 73, 128, 72,
+ 72, 69, 69, 128, 72, 72, 69, 128, 72, 72, 65, 65, 128, 72, 71, 128, 72,
+ 69, 89, 84, 128, 72, 69, 88, 73, 70, 79, 82, 205, 72, 69, 88, 65, 71, 82,
+ 65, 205, 72, 69, 88, 65, 71, 79, 78, 128, 72, 69, 82, 85, 84, 85, 128,
+ 72, 69, 82, 85, 128, 72, 69, 82, 77, 73, 84, 73, 65, 206, 72, 69, 82, 77,
+ 73, 79, 78, 73, 65, 206, 72, 69, 82, 77, 69, 83, 128, 72, 69, 82, 69,
+ 128, 72, 69, 82, 66, 128, 72, 69, 82, 65, 69, 85, 205, 72, 69, 78, 71,
+ 128, 72, 69, 78, 199, 72, 69, 77, 80, 128, 72, 69, 76, 77, 69, 84, 128,
+ 72, 69, 76, 77, 69, 212, 72, 69, 76, 205, 72, 69, 76, 76, 83, 67, 72, 82,
+ 69, 73, 66, 69, 210, 72, 69, 76, 73, 88, 128, 72, 69, 76, 73, 67, 79, 80,
+ 84, 69, 82, 128, 72, 69, 75, 85, 84, 65, 65, 82, 85, 128, 72, 69, 73, 83,
+ 69, 73, 128, 72, 69, 73, 71, 72, 84, 128, 72, 69, 69, 73, 128, 72, 69,
+ 68, 71, 69, 72, 79, 71, 128, 72, 69, 65, 86, 89, 128, 72, 69, 65, 86, 69,
+ 78, 76, 217, 72, 69, 65, 86, 69, 78, 128, 72, 69, 65, 86, 69, 206, 72,
+ 69, 65, 82, 84, 83, 128, 72, 69, 65, 82, 84, 45, 83, 72, 65, 80, 69, 196,
+ 72, 69, 65, 82, 84, 128, 72, 69, 65, 82, 212, 72, 69, 65, 82, 73, 78,
+ 199, 72, 69, 65, 82, 45, 78, 79, 45, 69, 86, 73, 204, 72, 69, 65, 68, 83,
+ 84, 82, 79, 75, 69, 128, 72, 69, 65, 68, 83, 84, 79, 78, 69, 128, 72, 69,
+ 65, 68, 83, 84, 79, 78, 197, 72, 69, 65, 68, 83, 67, 65, 82, 70, 128, 72,
+ 69, 65, 68, 80, 72, 79, 78, 69, 128, 72, 69, 65, 68, 73, 78, 71, 128, 72,
+ 69, 65, 68, 45, 66, 65, 78, 68, 65, 71, 69, 128, 72, 69, 45, 55, 128, 72,
+ 69, 45, 54, 128, 72, 69, 45, 53, 128, 72, 69, 45, 52, 128, 72, 69, 45,
+ 51, 128, 72, 69, 45, 50, 128, 72, 69, 45, 49, 128, 72, 68, 82, 128, 72,
+ 67, 128, 72, 66, 65, 83, 65, 45, 69, 83, 65, 83, 193, 72, 66, 65, 83,
+ 193, 72, 65, 89, 65, 78, 78, 65, 128, 72, 65, 87, 74, 128, 72, 65, 86,
+ 69, 128, 72, 65, 85, 80, 84, 83, 84, 73, 77, 77, 69, 128, 72, 65, 85, 77,
+ 69, 65, 128, 72, 65, 213, 72, 65, 84, 82, 65, 206, 72, 65, 84, 72, 73,
+ 128, 72, 65, 84, 69, 128, 72, 65, 84, 67, 72, 73, 78, 199, 72, 65, 84,
+ 65, 198, 72, 65, 83, 69, 210, 72, 65, 83, 65, 78, 84, 65, 128, 72, 65,
+ 82, 80, 79, 79, 78, 128, 72, 65, 82, 80, 79, 79, 206, 72, 65, 82, 77, 79,
+ 78, 73, 67, 128, 72, 65, 82, 75, 76, 69, 65, 206, 72, 65, 82, 68, 78, 69,
+ 83, 83, 128, 72, 65, 82, 196, 72, 65, 82, 66, 65, 72, 65, 89, 128, 72,
+ 65, 80, 80, 217, 72, 65, 78, 85, 78, 79, 207, 72, 65, 78, 73, 70, 201,
+ 72, 65, 78, 71, 90, 72, 79, 213, 72, 65, 78, 68, 83, 72, 65, 75, 69, 128,
+ 72, 65, 78, 68, 83, 128, 72, 65, 78, 68, 211, 72, 65, 78, 68, 76, 69, 83,
+ 128, 72, 65, 78, 68, 76, 69, 128, 72, 65, 78, 68, 66, 65, 76, 76, 128,
+ 72, 65, 78, 68, 66, 65, 71, 128, 72, 65, 78, 68, 45, 79, 86, 65, 76, 128,
+ 72, 65, 78, 68, 45, 79, 86, 65, 204, 72, 65, 78, 68, 45, 72, 79, 79, 75,
+ 128, 72, 65, 78, 68, 45, 72, 79, 79, 203, 72, 65, 78, 68, 45, 72, 73, 78,
+ 71, 69, 128, 72, 65, 78, 68, 45, 72, 73, 78, 71, 197, 72, 65, 78, 68, 45,
+ 70, 76, 65, 84, 128, 72, 65, 78, 68, 45, 70, 76, 65, 212, 72, 65, 78, 68,
+ 45, 70, 73, 83, 84, 128, 72, 65, 78, 68, 45, 67, 85, 82, 76, 73, 67, 85,
+ 69, 128, 72, 65, 78, 68, 45, 67, 85, 82, 76, 73, 67, 85, 197, 72, 65, 78,
+ 68, 45, 67, 85, 80, 128, 72, 65, 78, 68, 45, 67, 85, 208, 72, 65, 78, 68,
+ 45, 67, 76, 65, 87, 128, 72, 65, 78, 68, 45, 67, 76, 65, 215, 72, 65, 78,
+ 68, 45, 67, 73, 82, 67, 76, 69, 128, 72, 65, 78, 68, 45, 67, 73, 82, 67,
+ 76, 197, 72, 65, 78, 68, 45, 65, 78, 71, 76, 69, 128, 72, 65, 78, 68, 45,
+ 65, 78, 71, 76, 197, 72, 65, 78, 68, 128, 72, 65, 78, 45, 65, 75, 65, 84,
+ 128, 72, 65, 77, 90, 65, 128, 72, 65, 77, 90, 193, 72, 65, 77, 83, 84,
+ 69, 210, 72, 65, 77, 83, 65, 128, 72, 65, 77, 77, 69, 82, 128, 72, 65,
+ 77, 77, 69, 210, 72, 65, 77, 66, 85, 82, 71, 69, 82, 128, 72, 65, 76, 81,
+ 65, 128, 72, 65, 76, 79, 128, 72, 65, 76, 70, 45, 67, 73, 82, 67, 76,
+ 197, 72, 65, 76, 70, 45, 50, 128, 72, 65, 76, 70, 45, 49, 128, 72, 65,
+ 76, 70, 128, 72, 65, 76, 66, 69, 82, 68, 128, 72, 65, 76, 65, 78, 84, 65,
+ 128, 72, 65, 73, 84, 85, 128, 72, 65, 73, 211, 72, 65, 73, 82, 67, 85,
+ 84, 128, 72, 65, 71, 76, 65, 218, 72, 65, 71, 76, 128, 72, 65, 70, 85,
+ 75, 72, 65, 128, 72, 65, 70, 85, 75, 72, 128, 72, 65, 69, 71, 204, 72,
+ 65, 68, 69, 83, 128, 72, 65, 65, 82, 85, 128, 72, 65, 65, 77, 128, 72,
+ 65, 193, 72, 65, 45, 72, 65, 128, 72, 65, 45, 57, 128, 72, 65, 45, 56,
+ 128, 72, 65, 45, 55, 128, 72, 65, 45, 54, 128, 72, 65, 45, 53, 128, 72,
+ 65, 45, 52, 128, 72, 65, 45, 51, 128, 72, 65, 45, 50, 128, 72, 65, 45,
+ 49, 49, 128, 72, 65, 45, 49, 48, 128, 72, 65, 45, 49, 128, 72, 48, 48,
+ 56, 128, 72, 48, 48, 55, 128, 72, 48, 48, 54, 65, 128, 72, 48, 48, 54,
+ 128, 72, 48, 48, 53, 128, 72, 48, 48, 52, 128, 72, 48, 48, 51, 128, 72,
+ 48, 48, 50, 128, 72, 48, 48, 49, 128, 72, 45, 84, 89, 80, 197, 71, 89,
+ 85, 128, 71, 89, 79, 78, 128, 71, 89, 79, 128, 71, 89, 73, 128, 71, 89,
+ 70, 213, 71, 89, 69, 69, 128, 71, 89, 65, 83, 128, 71, 89, 65, 65, 128,
+ 71, 89, 65, 128, 71, 89, 128, 71, 87, 85, 128, 71, 87, 73, 128, 71, 87,
+ 69, 69, 128, 71, 87, 69, 128, 71, 87, 65, 65, 128, 71, 87, 65, 128, 71,
+ 87, 128, 71, 86, 65, 78, 71, 128, 71, 86, 128, 71, 85, 82, 85, 83, 72,
+ 128, 71, 85, 82, 85, 78, 128, 71, 85, 82, 77, 85, 75, 72, 201, 71, 85,
+ 82, 65, 77, 85, 84, 79, 78, 128, 71, 85, 82, 65, 71, 197, 71, 85, 82, 55,
+ 128, 71, 85, 78, 85, 128, 71, 85, 78, 213, 71, 85, 78, 74, 65, 76, 193,
+ 71, 85, 205, 71, 85, 76, 128, 71, 85, 74, 65, 82, 65, 84, 201, 71, 85,
+ 73, 84, 65, 82, 128, 71, 85, 73, 68, 197, 71, 85, 199, 71, 85, 69, 73,
+ 128, 71, 85, 69, 72, 128, 71, 85, 69, 200, 71, 85, 68, 128, 71, 85, 196,
+ 71, 85, 65, 82, 68, 83, 77, 65, 78, 128, 71, 85, 65, 82, 68, 69, 68, 78,
+ 69, 83, 83, 128, 71, 85, 65, 82, 68, 69, 196, 71, 85, 65, 82, 68, 128,
+ 71, 85, 65, 82, 65, 78, 201, 71, 85, 193, 71, 85, 178, 71, 84, 69, 210,
+ 71, 83, 85, 77, 128, 71, 83, 85, 205, 71, 82, 213, 71, 82, 79, 87, 73,
+ 78, 199, 71, 82, 79, 85, 78, 68, 128, 71, 82, 79, 78, 84, 72, 73, 83, 77,
+ 65, 84, 65, 128, 71, 82, 79, 77, 79, 80, 79, 86, 79, 68, 78, 65, 89, 65,
+ 128, 71, 82, 79, 77, 79, 80, 79, 86, 79, 68, 78, 65, 89, 193, 71, 82, 79,
+ 77, 79, 75, 82, 89, 90, 72, 69, 86, 65, 89, 65, 128, 71, 82, 79, 77, 79,
+ 75, 82, 89, 90, 72, 69, 86, 65, 89, 193, 71, 82, 79, 77, 78, 65, 89, 65,
+ 128, 71, 82, 79, 77, 78, 65, 89, 193, 71, 82, 73, 78, 78, 73, 78, 199,
+ 71, 82, 73, 77, 65, 67, 73, 78, 199, 71, 82, 69, 217, 71, 82, 69, 71, 79,
+ 82, 73, 65, 206, 71, 82, 69, 69, 78, 128, 71, 82, 69, 69, 206, 71, 82,
+ 69, 65, 84, 78, 69, 83, 83, 128, 71, 82, 69, 65, 84, 69, 82, 45, 84, 72,
+ 65, 78, 128, 71, 82, 69, 65, 84, 69, 82, 45, 84, 72, 65, 206, 71, 82, 69,
+ 65, 84, 69, 210, 71, 82, 69, 65, 212, 71, 82, 65, 86, 69, 89, 65, 82,
+ 196, 71, 82, 65, 86, 69, 45, 77, 65, 67, 82, 79, 78, 128, 71, 82, 65, 86,
+ 69, 45, 65, 67, 85, 84, 69, 45, 71, 82, 65, 86, 69, 128, 71, 82, 65, 86,
+ 197, 71, 82, 65, 84, 69, 82, 128, 71, 82, 65, 83, 83, 128, 71, 82, 65,
+ 83, 211, 71, 82, 65, 83, 208, 71, 82, 65, 80, 72, 69, 77, 197, 71, 82,
+ 65, 80, 69, 83, 128, 71, 82, 65, 78, 84, 72, 193, 71, 82, 65, 77, 77,
+ 193, 71, 82, 65, 73, 78, 128, 71, 82, 65, 70, 128, 71, 82, 65, 68, 85,
+ 65, 84, 73, 79, 206, 71, 82, 65, 68, 85, 65, 76, 128, 71, 82, 65, 67, 69,
+ 128, 71, 82, 65, 67, 197, 71, 80, 65, 128, 71, 79, 82, 84, 72, 77, 73,
+ 75, 79, 206, 71, 79, 82, 84, 128, 71, 79, 82, 73, 76, 76, 65, 128, 71,
+ 79, 82, 71, 79, 84, 69, 82, 73, 128, 71, 79, 82, 71, 79, 83, 89, 78, 84,
+ 72, 69, 84, 79, 78, 128, 71, 79, 82, 71, 79, 206, 71, 79, 82, 71, 73,
+ 128, 71, 79, 82, 65, 90, 68, 207, 71, 79, 82, 65, 128, 71, 79, 79, 83,
+ 69, 128, 71, 79, 79, 196, 71, 79, 78, 71, 71, 79, 78, 71, 128, 71, 79,
+ 76, 85, 66, 67, 72, 73, 203, 71, 79, 76, 70, 69, 82, 128, 71, 79, 76, 68,
+ 128, 71, 79, 75, 128, 71, 79, 73, 78, 199, 71, 79, 71, 71, 76, 69, 83,
+ 128, 71, 79, 66, 76, 73, 78, 128, 71, 79, 65, 76, 128, 71, 79, 65, 204,
+ 71, 79, 65, 128, 71, 78, 89, 73, 83, 128, 71, 78, 65, 86, 73, 89, 65, 78,
+ 73, 128, 71, 76, 79, 87, 73, 78, 199, 71, 76, 79, 86, 69, 83, 128, 71,
+ 76, 79, 86, 69, 128, 71, 76, 79, 84, 84, 65, 204, 71, 76, 79, 66, 197,
+ 71, 76, 73, 83, 83, 65, 78, 68, 207, 71, 76, 69, 73, 67, 200, 71, 76, 65,
+ 71, 79, 76, 73, 128, 71, 76, 65, 128, 71, 74, 69, 128, 71, 73, 88, 128,
+ 71, 73, 84, 128, 71, 73, 83, 72, 128, 71, 73, 83, 200, 71, 73, 83, 65,
+ 76, 128, 71, 73, 82, 85, 68, 65, 65, 128, 71, 73, 82, 76, 211, 71, 73,
+ 82, 76, 128, 71, 73, 82, 65, 70, 70, 197, 71, 73, 82, 51, 128, 71, 73,
+ 82, 179, 71, 73, 82, 50, 128, 71, 73, 82, 178, 71, 73, 80, 128, 71, 73,
+ 78, 73, 73, 128, 71, 73, 78, 71, 69, 210, 71, 73, 77, 69, 76, 45, 72, 69,
+ 84, 72, 128, 71, 73, 77, 69, 76, 128, 71, 73, 77, 69, 204, 71, 73, 77,
+ 128, 71, 73, 71, 65, 128, 71, 73, 71, 128, 71, 73, 70, 212, 71, 73, 69,
+ 84, 128, 71, 73, 68, 73, 77, 128, 71, 73, 66, 66, 79, 85, 211, 71, 73,
+ 66, 65, 128, 71, 73, 52, 128, 71, 73, 180, 71, 72, 90, 128, 71, 72, 87,
+ 65, 128, 71, 72, 85, 78, 78, 65, 128, 71, 72, 85, 78, 78, 193, 71, 72,
+ 85, 128, 71, 72, 79, 85, 128, 71, 72, 79, 83, 84, 128, 71, 72, 79, 128,
+ 71, 72, 73, 77, 69, 76, 128, 71, 72, 73, 128, 71, 72, 72, 65, 128, 71,
+ 72, 69, 89, 83, 128, 71, 72, 69, 85, 88, 128, 71, 72, 69, 85, 78, 128,
+ 71, 72, 69, 85, 71, 72, 69, 85, 65, 69, 77, 128, 71, 72, 69, 85, 71, 72,
+ 69, 78, 128, 71, 72, 69, 85, 65, 69, 82, 65, 69, 128, 71, 72, 69, 85, 65,
+ 69, 71, 72, 69, 85, 65, 69, 128, 71, 72, 69, 84, 128, 71, 72, 69, 69,
+ 128, 71, 72, 69, 128, 71, 72, 197, 71, 72, 65, 89, 78, 128, 71, 72, 65,
+ 82, 65, 69, 128, 71, 72, 65, 80, 128, 71, 72, 65, 78, 128, 71, 72, 65,
+ 77, 77, 65, 128, 71, 72, 65, 77, 65, 76, 128, 71, 72, 65, 73, 78, 85,
+ 128, 71, 72, 65, 73, 78, 128, 71, 72, 65, 73, 206, 71, 72, 65, 68, 128,
+ 71, 72, 65, 65, 77, 65, 69, 128, 71, 72, 65, 65, 128, 71, 71, 87, 73,
+ 128, 71, 71, 87, 69, 69, 128, 71, 71, 87, 69, 128, 71, 71, 87, 65, 65,
+ 128, 71, 71, 87, 65, 128, 71, 71, 85, 88, 128, 71, 71, 85, 84, 128, 71,
+ 71, 85, 82, 88, 128, 71, 71, 85, 82, 128, 71, 71, 85, 79, 88, 128, 71,
+ 71, 85, 79, 84, 128, 71, 71, 85, 79, 80, 128, 71, 71, 85, 79, 128, 71,
+ 71, 79, 88, 128, 71, 71, 79, 84, 128, 71, 71, 79, 80, 128, 71, 71, 73,
+ 88, 128, 71, 71, 73, 84, 128, 71, 71, 73, 69, 88, 128, 71, 71, 73, 69,
+ 80, 128, 71, 71, 73, 69, 128, 71, 71, 69, 88, 128, 71, 71, 69, 84, 128,
+ 71, 71, 69, 80, 128, 71, 71, 65, 88, 128, 71, 71, 65, 84, 128, 71, 69,
+ 84, 193, 71, 69, 83, 84, 85, 82, 69, 128, 71, 69, 83, 72, 85, 128, 71,
+ 69, 83, 72, 84, 73, 78, 128, 71, 69, 83, 72, 84, 73, 206, 71, 69, 83, 72,
+ 50, 128, 71, 69, 82, 83, 72, 65, 89, 73, 77, 128, 71, 69, 82, 77, 65,
+ 206, 71, 69, 82, 69, 83, 72, 128, 71, 69, 82, 69, 83, 200, 71, 69, 79,
+ 77, 69, 84, 82, 73, 67, 65, 76, 76, 217, 71, 69, 79, 77, 69, 84, 82, 73,
+ 195, 71, 69, 78, 84, 76, 197, 71, 69, 78, 73, 84, 73, 86, 69, 128, 71,
+ 69, 78, 73, 75, 201, 71, 69, 78, 73, 69, 128, 71, 69, 78, 69, 82, 73,
+ 195, 71, 69, 78, 69, 82, 65, 76, 128, 71, 69, 77, 73, 78, 73, 128, 71,
+ 69, 77, 73, 78, 65, 84, 73, 79, 206, 71, 69, 77, 73, 78, 65, 84, 197, 71,
+ 69, 205, 71, 69, 69, 77, 128, 71, 69, 68, 79, 76, 65, 128, 71, 69, 68,
+ 69, 128, 71, 69, 66, 207, 71, 69, 66, 193, 71, 69, 65, 82, 128, 71, 69,
+ 65, 210, 71, 69, 50, 50, 128, 71, 68, 65, 78, 128, 71, 67, 73, 71, 128,
+ 71, 67, 65, 206, 71, 66, 79, 78, 128, 71, 66, 73, 69, 197, 71, 66, 69,
+ 85, 88, 128, 71, 66, 69, 84, 128, 71, 66, 65, 89, 73, 128, 71, 66, 65,
+ 75, 85, 82, 85, 78, 69, 78, 128, 71, 66, 128, 71, 65, 89, 65, 78, 85, 75,
+ 73, 84, 84, 65, 128, 71, 65, 89, 65, 78, 78, 65, 128, 71, 65, 89, 128,
+ 71, 65, 85, 78, 84, 76, 69, 84, 128, 71, 65, 84, 72, 69, 82, 73, 78, 71,
+ 128, 71, 65, 84, 72, 69, 82, 73, 78, 199, 71, 65, 84, 69, 128, 71, 65,
+ 83, 72, 65, 78, 128, 71, 65, 82, 83, 72, 85, 78, 73, 128, 71, 65, 82, 79,
+ 78, 128, 71, 65, 82, 77, 69, 78, 84, 128, 71, 65, 82, 76, 73, 67, 128,
+ 71, 65, 82, 68, 69, 78, 128, 71, 65, 82, 51, 128, 71, 65, 80, 80, 69,
+ 196, 71, 65, 208, 71, 65, 78, 77, 65, 128, 71, 65, 78, 71, 73, 65, 128,
+ 71, 65, 78, 68, 193, 71, 65, 78, 50, 128, 71, 65, 78, 178, 71, 65, 77,
+ 77, 65, 128, 71, 65, 77, 76, 65, 128, 71, 65, 77, 76, 128, 71, 65, 77,
+ 69, 128, 71, 65, 77, 197, 71, 65, 77, 65, 78, 128, 71, 65, 77, 65, 76,
+ 128, 71, 65, 77, 65, 204, 71, 65, 76, 201, 71, 65, 71, 128, 71, 65, 70,
+ 128, 71, 65, 198, 71, 65, 69, 84, 84, 65, 45, 80, 73, 76, 76, 65, 128,
+ 71, 65, 68, 79, 76, 128, 71, 65, 68, 128, 71, 65, 196, 71, 65, 66, 65,
+ 128, 71, 65, 66, 193, 71, 65, 65, 70, 85, 128, 71, 65, 178, 71, 48, 53,
+ 52, 128, 71, 48, 53, 51, 128, 71, 48, 53, 50, 128, 71, 48, 53, 49, 128,
+ 71, 48, 53, 48, 128, 71, 48, 52, 57, 128, 71, 48, 52, 56, 128, 71, 48,
+ 52, 55, 128, 71, 48, 52, 54, 128, 71, 48, 52, 53, 65, 128, 71, 48, 52,
+ 53, 128, 71, 48, 52, 52, 128, 71, 48, 52, 51, 65, 128, 71, 48, 52, 51,
+ 128, 71, 48, 52, 50, 128, 71, 48, 52, 49, 128, 71, 48, 52, 48, 128, 71,
+ 48, 51, 57, 128, 71, 48, 51, 56, 128, 71, 48, 51, 55, 65, 128, 71, 48,
+ 51, 55, 128, 71, 48, 51, 54, 65, 128, 71, 48, 51, 54, 128, 71, 48, 51,
+ 53, 128, 71, 48, 51, 52, 128, 71, 48, 51, 51, 128, 71, 48, 51, 50, 128,
+ 71, 48, 51, 49, 128, 71, 48, 51, 48, 128, 71, 48, 50, 57, 128, 71, 48,
+ 50, 56, 128, 71, 48, 50, 55, 128, 71, 48, 50, 54, 65, 128, 71, 48, 50,
+ 54, 128, 71, 48, 50, 53, 128, 71, 48, 50, 52, 128, 71, 48, 50, 51, 128,
+ 71, 48, 50, 50, 128, 71, 48, 50, 49, 128, 71, 48, 50, 48, 65, 128, 71,
+ 48, 50, 48, 128, 71, 48, 49, 57, 128, 71, 48, 49, 56, 128, 71, 48, 49,
+ 55, 128, 71, 48, 49, 54, 128, 71, 48, 49, 53, 128, 71, 48, 49, 52, 128,
+ 71, 48, 49, 51, 128, 71, 48, 49, 50, 128, 71, 48, 49, 49, 65, 128, 71,
+ 48, 49, 49, 128, 71, 48, 49, 48, 128, 71, 48, 48, 57, 128, 71, 48, 48,
+ 56, 128, 71, 48, 48, 55, 66, 128, 71, 48, 48, 55, 65, 128, 71, 48, 48,
+ 55, 128, 71, 48, 48, 54, 65, 128, 71, 48, 48, 54, 128, 71, 48, 48, 53,
+ 128, 71, 48, 48, 52, 128, 71, 48, 48, 51, 128, 71, 48, 48, 50, 128, 71,
+ 48, 48, 49, 128, 70, 89, 88, 128, 70, 89, 84, 128, 70, 89, 80, 128, 70,
+ 89, 65, 128, 70, 87, 73, 128, 70, 87, 69, 69, 128, 70, 87, 69, 128, 70,
+ 87, 65, 65, 128, 70, 87, 65, 128, 70, 86, 83, 52, 128, 70, 86, 83, 51,
+ 128, 70, 86, 83, 50, 128, 70, 86, 83, 49, 128, 70, 85, 88, 128, 70, 85,
+ 84, 128, 70, 85, 83, 69, 128, 70, 85, 83, 193, 70, 85, 82, 88, 128, 70,
+ 85, 80, 128, 70, 85, 78, 69, 82, 65, 204, 70, 85, 78, 67, 84, 73, 79, 78,
+ 65, 204, 70, 85, 78, 67, 84, 73, 79, 78, 128, 70, 85, 76, 76, 87, 73, 68,
+ 84, 200, 70, 85, 76, 76, 78, 69, 83, 83, 128, 70, 85, 76, 204, 70, 85,
+ 74, 73, 128, 70, 85, 69, 84, 128, 70, 85, 69, 204, 70, 85, 69, 128, 70,
+ 85, 65, 128, 70, 84, 72, 79, 82, 193, 70, 83, 73, 128, 70, 82, 79, 87,
+ 78, 73, 78, 71, 128, 70, 82, 79, 87, 78, 73, 78, 199, 70, 82, 79, 87, 78,
+ 128, 70, 82, 79, 87, 206, 70, 82, 79, 78, 84, 45, 84, 73, 76, 84, 69,
+ 196, 70, 82, 79, 78, 84, 45, 70, 65, 67, 73, 78, 199, 70, 82, 79, 78,
+ 212, 70, 82, 79, 205, 70, 82, 79, 71, 128, 70, 82, 79, 199, 70, 82, 73,
+ 84, 85, 128, 70, 82, 73, 69, 83, 128, 70, 82, 73, 69, 196, 70, 82, 73,
+ 67, 65, 84, 73, 86, 69, 128, 70, 82, 69, 84, 66, 79, 65, 82, 68, 128, 70,
+ 82, 69, 78, 67, 200, 70, 82, 69, 69, 90, 73, 78, 199, 70, 82, 69, 69,
+ 128, 70, 82, 69, 197, 70, 82, 65, 78, 75, 211, 70, 82, 65, 78, 195, 70,
+ 82, 65, 77, 69, 83, 128, 70, 82, 65, 77, 69, 128, 70, 82, 65, 77, 197,
+ 70, 82, 65, 75, 84, 85, 210, 70, 82, 65, 71, 82, 65, 78, 84, 128, 70, 82,
+ 65, 71, 77, 69, 78, 84, 128, 70, 82, 65, 67, 84, 73, 79, 206, 70, 79, 88,
+ 128, 70, 79, 216, 70, 79, 85, 82, 84, 69, 69, 78, 128, 70, 79, 85, 82,
+ 84, 69, 69, 206, 70, 79, 85, 82, 45, 84, 72, 73, 82, 84, 89, 128, 70, 79,
+ 85, 82, 45, 83, 84, 82, 73, 78, 199, 70, 79, 85, 82, 45, 80, 69, 82, 45,
+ 69, 205, 70, 79, 85, 82, 45, 76, 73, 78, 197, 70, 79, 85, 210, 70, 79,
+ 85, 78, 84, 65, 73, 78, 128, 70, 79, 85, 78, 84, 65, 73, 206, 70, 79, 83,
+ 84, 69, 82, 73, 78, 71, 128, 70, 79, 82, 87, 65, 82, 68, 128, 70, 79, 82,
+ 87, 65, 82, 196, 70, 79, 82, 84, 89, 45, 70, 73, 86, 197, 70, 79, 82, 84,
+ 89, 128, 70, 79, 82, 84, 217, 70, 79, 82, 84, 85, 78, 69, 128, 70, 79,
+ 82, 84, 85, 78, 197, 70, 79, 82, 84, 73, 69, 84, 72, 128, 70, 79, 82, 84,
+ 69, 128, 70, 79, 82, 77, 211, 70, 79, 82, 77, 69, 69, 128, 70, 79, 82,
+ 77, 69, 197, 70, 79, 82, 77, 65, 84, 84, 73, 78, 71, 128, 70, 79, 82, 77,
+ 65, 212, 70, 79, 82, 75, 69, 196, 70, 79, 82, 69, 72, 69, 65, 196, 70,
+ 79, 82, 67, 69, 83, 128, 70, 79, 82, 67, 69, 128, 70, 79, 80, 128, 70,
+ 79, 79, 84, 83, 84, 79, 79, 76, 128, 70, 79, 79, 84, 80, 82, 73, 78, 84,
+ 83, 128, 70, 79, 79, 84, 78, 79, 84, 197, 70, 79, 79, 84, 66, 65, 76, 76,
+ 128, 70, 79, 79, 84, 128, 70, 79, 79, 76, 128, 70, 79, 79, 68, 128, 70,
+ 79, 79, 128, 70, 79, 78, 212, 70, 79, 78, 71, 77, 65, 78, 128, 70, 79,
+ 78, 68, 85, 69, 128, 70, 79, 77, 128, 70, 79, 76, 76, 89, 128, 70, 79,
+ 76, 76, 79, 87, 73, 78, 71, 128, 70, 79, 76, 68, 73, 78, 199, 70, 79, 76,
+ 68, 69, 82, 128, 70, 79, 76, 68, 69, 196, 70, 79, 71, 71, 89, 128, 70,
+ 79, 71, 128, 70, 207, 70, 77, 128, 70, 76, 89, 73, 78, 199, 70, 76, 89,
+ 128, 70, 76, 85, 84, 84, 69, 82, 73, 78, 71, 128, 70, 76, 85, 84, 84, 69,
+ 82, 73, 78, 199, 70, 76, 85, 84, 69, 128, 70, 76, 85, 83, 72, 69, 196,
+ 70, 76, 79, 87, 73, 78, 199, 70, 76, 79, 87, 69, 82, 83, 128, 70, 76, 79,
+ 87, 69, 210, 70, 76, 79, 85, 82, 73, 83, 72, 128, 70, 76, 79, 82, 69, 84,
+ 84, 69, 128, 70, 76, 79, 82, 65, 204, 70, 76, 79, 80, 80, 217, 70, 76,
+ 79, 79, 82, 128, 70, 76, 79, 79, 210, 70, 76, 73, 80, 128, 70, 76, 73,
+ 71, 72, 84, 128, 70, 76, 73, 67, 203, 70, 76, 69, 88, 85, 83, 128, 70,
+ 76, 69, 88, 69, 196, 70, 76, 69, 88, 128, 70, 76, 69, 85, 82, 79, 78,
+ 128, 70, 76, 69, 85, 82, 45, 68, 69, 45, 76, 73, 83, 128, 70, 76, 65, 84,
+ 84, 69, 78, 69, 196, 70, 76, 65, 84, 78, 69, 83, 83, 128, 70, 76, 65, 84,
+ 66, 82, 69, 65, 68, 128, 70, 76, 65, 83, 72, 128, 70, 76, 65, 77, 73, 78,
+ 71, 79, 128, 70, 76, 65, 77, 69, 128, 70, 76, 65, 71, 83, 128, 70, 76,
+ 65, 71, 45, 53, 128, 70, 76, 65, 71, 45, 52, 128, 70, 76, 65, 71, 45, 51,
+ 128, 70, 76, 65, 71, 45, 50, 128, 70, 76, 65, 71, 45, 49, 128, 70, 76,
+ 65, 71, 128, 70, 76, 65, 199, 70, 76, 65, 128, 70, 76, 128, 70, 73, 88,
+ 69, 68, 45, 70, 79, 82, 205, 70, 73, 88, 128, 70, 73, 86, 69, 45, 84, 72,
+ 73, 82, 84, 89, 128, 70, 73, 86, 69, 45, 76, 73, 78, 197, 70, 73, 86, 69,
+ 45, 76, 73, 75, 197, 70, 73, 84, 90, 80, 65, 84, 82, 73, 67, 203, 70, 73,
+ 84, 65, 128, 70, 73, 84, 128, 70, 73, 83, 84, 69, 196, 70, 73, 83, 72,
+ 73, 78, 199, 70, 73, 83, 72, 72, 79, 79, 75, 128, 70, 73, 83, 72, 72, 79,
+ 79, 203, 70, 73, 83, 72, 69, 89, 69, 128, 70, 73, 83, 200, 70, 73, 82,
+ 83, 212, 70, 73, 82, 73, 128, 70, 73, 82, 69, 87, 79, 82, 75, 83, 128,
+ 70, 73, 82, 69, 87, 79, 82, 203, 70, 73, 82, 69, 67, 82, 65, 67, 75, 69,
+ 82, 128, 70, 73, 82, 69, 128, 70, 73, 82, 197, 70, 73, 80, 128, 70, 73,
+ 78, 73, 84, 197, 70, 73, 78, 71, 69, 82, 83, 128, 70, 73, 78, 71, 69, 82,
+ 211, 70, 73, 78, 71, 69, 82, 78, 65, 73, 76, 83, 128, 70, 73, 78, 71, 69,
+ 82, 69, 196, 70, 73, 78, 71, 69, 82, 45, 80, 79, 83, 212, 70, 73, 78, 71,
+ 69, 82, 128, 70, 73, 78, 71, 69, 210, 70, 73, 78, 65, 78, 67, 73, 65, 76,
+ 128, 70, 73, 78, 65, 76, 128, 70, 73, 76, 205, 70, 73, 76, 76, 69, 82,
+ 45, 50, 128, 70, 73, 76, 76, 69, 82, 45, 49, 128, 70, 73, 76, 76, 69, 82,
+ 128, 70, 73, 76, 76, 69, 196, 70, 73, 76, 76, 128, 70, 73, 76, 204, 70,
+ 73, 76, 197, 70, 73, 73, 128, 70, 73, 71, 85, 82, 69, 45, 51, 128, 70,
+ 73, 71, 85, 82, 69, 45, 50, 128, 70, 73, 71, 85, 82, 69, 45, 49, 128, 70,
+ 73, 71, 85, 82, 69, 128, 70, 73, 71, 85, 82, 197, 70, 73, 71, 72, 84,
+ 128, 70, 73, 70, 84, 89, 128, 70, 73, 70, 84, 217, 70, 73, 70, 84, 72,
+ 83, 128, 70, 73, 70, 84, 72, 128, 70, 73, 70, 84, 69, 69, 78, 128, 70,
+ 73, 70, 84, 69, 69, 206, 70, 73, 69, 76, 68, 128, 70, 73, 69, 76, 196,
+ 70, 72, 84, 79, 82, 193, 70, 70, 76, 128, 70, 70, 73, 128, 70, 69, 85,
+ 88, 128, 70, 69, 85, 70, 69, 85, 65, 69, 84, 128, 70, 69, 84, 72, 128,
+ 70, 69, 83, 84, 73, 86, 65, 76, 128, 70, 69, 82, 82, 89, 128, 70, 69, 82,
+ 82, 73, 211, 70, 69, 82, 77, 65, 84, 65, 128, 70, 69, 82, 77, 65, 84,
+ 193, 70, 69, 79, 200, 70, 69, 78, 199, 70, 69, 78, 67, 69, 82, 128, 70,
+ 69, 78, 67, 69, 128, 70, 69, 77, 73, 78, 73, 78, 197, 70, 69, 77, 65, 76,
+ 69, 128, 70, 69, 77, 65, 76, 197, 70, 69, 76, 76, 79, 87, 83, 72, 73, 80,
+ 128, 70, 69, 73, 128, 70, 69, 72, 213, 70, 69, 72, 128, 70, 69, 200, 70,
+ 69, 69, 78, 71, 128, 70, 69, 69, 77, 128, 70, 69, 69, 68, 128, 70, 69,
+ 69, 196, 70, 69, 69, 128, 70, 69, 66, 82, 85, 65, 82, 89, 128, 70, 69,
+ 65, 84, 72, 69, 82, 128, 70, 69, 65, 84, 72, 69, 210, 70, 69, 65, 82, 78,
+ 128, 70, 69, 65, 82, 70, 85, 204, 70, 69, 65, 82, 128, 70, 65, 89, 65,
+ 78, 78, 65, 128, 70, 65, 89, 128, 70, 65, 88, 128, 70, 65, 216, 70, 65,
+ 84, 73, 71, 85, 69, 128, 70, 65, 84, 72, 69, 82, 128, 70, 65, 84, 72, 69,
+ 210, 70, 65, 84, 72, 65, 84, 65, 78, 128, 70, 65, 84, 72, 65, 84, 65,
+ 206, 70, 65, 84, 72, 65, 128, 70, 65, 84, 72, 193, 70, 65, 84, 128, 70,
+ 65, 83, 84, 128, 70, 65, 82, 83, 201, 70, 65, 82, 128, 70, 65, 81, 128,
+ 70, 65, 80, 128, 70, 65, 78, 71, 128, 70, 65, 78, 69, 82, 79, 83, 73,
+ 211, 70, 65, 78, 128, 70, 65, 77, 73, 76, 89, 128, 70, 65, 77, 128, 70,
+ 65, 76, 76, 69, 206, 70, 65, 76, 65, 70, 69, 76, 128, 70, 65, 74, 128,
+ 70, 65, 73, 82, 89, 128, 70, 65, 73, 76, 85, 82, 69, 128, 70, 65, 73, 72,
+ 85, 128, 70, 65, 73, 66, 128, 70, 65, 72, 82, 69, 78, 72, 69, 73, 84,
+ 128, 70, 65, 67, 84, 79, 82, 89, 128, 70, 65, 67, 84, 79, 210, 70, 65,
+ 67, 83, 73, 77, 73, 76, 197, 70, 65, 67, 73, 78, 71, 83, 128, 70, 65, 67,
+ 69, 45, 54, 128, 70, 65, 67, 69, 45, 53, 128, 70, 65, 67, 69, 45, 52,
+ 128, 70, 65, 67, 69, 45, 51, 128, 70, 65, 67, 69, 45, 50, 128, 70, 65,
+ 67, 69, 45, 49, 128, 70, 65, 65, 77, 65, 69, 128, 70, 65, 65, 73, 128,
+ 70, 65, 65, 70, 85, 128, 70, 48, 53, 51, 128, 70, 48, 53, 50, 128, 70,
+ 48, 53, 49, 67, 128, 70, 48, 53, 49, 66, 128, 70, 48, 53, 49, 65, 128,
+ 70, 48, 53, 49, 128, 70, 48, 53, 48, 128, 70, 48, 52, 57, 128, 70, 48,
+ 52, 56, 128, 70, 48, 52, 55, 65, 128, 70, 48, 52, 55, 128, 70, 48, 52,
+ 54, 65, 128, 70, 48, 52, 54, 128, 70, 48, 52, 53, 65, 128, 70, 48, 52,
+ 53, 128, 70, 48, 52, 52, 128, 70, 48, 52, 51, 128, 70, 48, 52, 50, 128,
+ 70, 48, 52, 49, 128, 70, 48, 52, 48, 128, 70, 48, 51, 57, 128, 70, 48,
+ 51, 56, 65, 128, 70, 48, 51, 56, 128, 70, 48, 51, 55, 65, 128, 70, 48,
+ 51, 55, 128, 70, 48, 51, 54, 128, 70, 48, 51, 53, 128, 70, 48, 51, 52,
+ 128, 70, 48, 51, 51, 128, 70, 48, 51, 50, 128, 70, 48, 51, 49, 65, 128,
+ 70, 48, 51, 49, 128, 70, 48, 51, 48, 128, 70, 48, 50, 57, 128, 70, 48,
+ 50, 56, 128, 70, 48, 50, 55, 128, 70, 48, 50, 54, 128, 70, 48, 50, 53,
+ 128, 70, 48, 50, 52, 128, 70, 48, 50, 51, 128, 70, 48, 50, 50, 128, 70,
+ 48, 50, 49, 65, 128, 70, 48, 50, 49, 128, 70, 48, 50, 48, 128, 70, 48,
+ 49, 57, 128, 70, 48, 49, 56, 128, 70, 48, 49, 55, 128, 70, 48, 49, 54,
+ 128, 70, 48, 49, 53, 128, 70, 48, 49, 52, 128, 70, 48, 49, 51, 65, 128,
+ 70, 48, 49, 51, 128, 70, 48, 49, 50, 128, 70, 48, 49, 49, 128, 70, 48,
+ 49, 48, 128, 70, 48, 48, 57, 128, 70, 48, 48, 56, 128, 70, 48, 48, 55,
+ 128, 70, 48, 48, 54, 128, 70, 48, 48, 53, 128, 70, 48, 48, 52, 128, 70,
+ 48, 48, 51, 128, 70, 48, 48, 50, 128, 70, 48, 48, 49, 65, 128, 70, 48,
+ 48, 49, 128, 69, 90, 83, 128, 69, 90, 69, 78, 128, 69, 90, 69, 206, 69,
+ 89, 89, 89, 128, 69, 89, 69, 83, 128, 69, 89, 69, 211, 69, 89, 69, 76,
+ 65, 83, 72, 69, 211, 69, 89, 69, 71, 76, 65, 83, 83, 69, 83, 128, 69, 89,
+ 69, 71, 65, 90, 69, 45, 87, 65, 76, 76, 80, 76, 65, 78, 197, 69, 89, 69,
+ 71, 65, 90, 69, 45, 70, 76, 79, 79, 82, 80, 76, 65, 78, 197, 69, 89, 69,
+ 66, 82, 79, 87, 211, 69, 89, 69, 66, 82, 79, 215, 69, 89, 197, 69, 89,
+ 66, 69, 89, 70, 73, 76, 73, 128, 69, 89, 65, 78, 78, 65, 128, 69, 88, 84,
+ 82, 69, 77, 69, 76, 217, 69, 88, 84, 82, 65, 84, 69, 82, 82, 69, 83, 84,
+ 82, 73, 65, 204, 69, 88, 84, 82, 65, 45, 76, 79, 215, 69, 88, 84, 82, 65,
+ 45, 72, 73, 71, 200, 69, 88, 84, 82, 193, 69, 88, 84, 73, 78, 71, 85, 73,
+ 83, 72, 69, 82, 128, 69, 88, 84, 69, 78, 83, 73, 79, 78, 128, 69, 88, 84,
+ 69, 78, 68, 69, 68, 128, 69, 88, 84, 69, 78, 68, 69, 196, 69, 88, 80, 82,
+ 69, 83, 83, 73, 79, 78, 76, 69, 83, 211, 69, 88, 80, 79, 78, 69, 78, 212,
+ 69, 88, 80, 76, 79, 68, 73, 78, 199, 69, 88, 79, 128, 69, 88, 207, 69,
+ 88, 73, 83, 84, 83, 128, 69, 88, 73, 83, 84, 128, 69, 88, 72, 65, 85, 83,
+ 84, 73, 79, 78, 128, 69, 88, 72, 65, 76, 69, 128, 69, 88, 67, 76, 65, 77,
+ 65, 84, 73, 79, 78, 128, 69, 88, 67, 76, 65, 77, 65, 84, 73, 79, 206, 69,
+ 88, 67, 73, 84, 69, 77, 69, 78, 84, 128, 69, 88, 67, 72, 65, 78, 71, 69,
+ 128, 69, 88, 67, 69, 83, 83, 128, 69, 88, 67, 69, 76, 76, 69, 78, 84,
+ 128, 69, 87, 69, 128, 69, 86, 69, 82, 217, 69, 86, 69, 82, 71, 82, 69,
+ 69, 206, 69, 86, 69, 78, 73, 78, 71, 128, 69, 85, 82, 79, 80, 69, 65,
+ 206, 69, 85, 82, 79, 80, 69, 45, 65, 70, 82, 73, 67, 65, 128, 69, 85, 82,
+ 79, 45, 67, 85, 82, 82, 69, 78, 67, 217, 69, 85, 82, 207, 69, 85, 76, 69,
+ 210, 69, 85, 45, 85, 128, 69, 85, 45, 79, 128, 69, 85, 45, 69, 85, 128,
+ 69, 85, 45, 69, 79, 128, 69, 85, 45, 69, 128, 69, 85, 45, 65, 128, 69,
+ 84, 88, 128, 69, 84, 84, 128, 69, 84, 78, 65, 72, 84, 65, 128, 69, 84,
+ 72, 69, 204, 69, 84, 69, 82, 79, 206, 69, 84, 69, 82, 78, 73, 84, 89,
+ 128, 69, 84, 69, 82, 78, 73, 84, 217, 69, 84, 66, 128, 69, 83, 90, 128,
+ 69, 83, 85, 75, 85, 85, 68, 79, 128, 69, 83, 84, 73, 77, 65, 84, 69, 83,
+ 128, 69, 83, 84, 73, 77, 65, 84, 69, 196, 69, 83, 72, 69, 51, 128, 69,
+ 83, 72, 50, 49, 128, 69, 83, 72, 49, 54, 128, 69, 83, 67, 65, 80, 69,
+ 128, 69, 83, 67, 128, 69, 83, 65, 128, 69, 83, 45, 84, 69, 128, 69, 83,
+ 45, 51, 128, 69, 83, 45, 50, 128, 69, 83, 45, 49, 128, 69, 82, 82, 79,
+ 82, 45, 66, 65, 82, 82, 69, 196, 69, 82, 82, 128, 69, 82, 73, 211, 69,
+ 82, 73, 78, 50, 128, 69, 82, 73, 78, 178, 69, 82, 71, 128, 69, 82, 65,
+ 83, 197, 69, 81, 85, 73, 86, 65, 76, 69, 78, 212, 69, 81, 85, 73, 76, 65,
+ 84, 69, 82, 65, 204, 69, 81, 85, 73, 72, 79, 80, 80, 69, 82, 128, 69, 81,
+ 85, 73, 72, 79, 80, 80, 69, 210, 69, 81, 85, 73, 68, 128, 69, 81, 85, 73,
+ 65, 78, 71, 85, 76, 65, 210, 69, 81, 85, 65, 76, 83, 128, 69, 81, 85, 65,
+ 76, 211, 69, 81, 85, 65, 76, 128, 69, 81, 85, 65, 204, 69, 80, 83, 73,
+ 76, 79, 78, 128, 69, 80, 83, 73, 76, 79, 206, 69, 80, 79, 67, 72, 128,
+ 69, 80, 73, 71, 82, 65, 80, 72, 73, 195, 69, 80, 73, 68, 65, 85, 82, 69,
+ 65, 206, 69, 80, 69, 78, 84, 72, 69, 84, 73, 195, 69, 80, 69, 71, 69, 82,
+ 77, 65, 128, 69, 80, 65, 67, 212, 69, 79, 84, 128, 69, 79, 77, 128, 69,
+ 79, 76, 72, 88, 128, 69, 79, 76, 128, 69, 79, 72, 128, 69, 78, 89, 128,
+ 69, 78, 86, 69, 76, 79, 80, 69, 128, 69, 78, 86, 69, 76, 79, 80, 197, 69,
+ 78, 85, 77, 69, 82, 65, 84, 73, 79, 206, 69, 78, 84, 82, 89, 45, 50, 128,
+ 69, 78, 84, 82, 89, 45, 49, 128, 69, 78, 84, 82, 89, 128, 69, 78, 84, 82,
+ 217, 69, 78, 84, 72, 85, 83, 73, 65, 83, 77, 128, 69, 78, 84, 69, 82, 80,
+ 82, 73, 83, 69, 128, 69, 78, 84, 69, 82, 73, 78, 199, 69, 78, 84, 69, 82,
+ 128, 69, 78, 84, 69, 210, 69, 78, 84, 45, 83, 72, 65, 80, 69, 196, 69,
+ 78, 81, 85, 73, 82, 89, 128, 69, 78, 81, 128, 69, 78, 79, 211, 69, 78,
+ 78, 73, 128, 69, 78, 78, 128, 69, 78, 76, 65, 82, 71, 69, 77, 69, 78, 84,
+ 128, 69, 78, 71, 73, 78, 69, 128, 69, 78, 68, 79, 70, 79, 78, 79, 78,
+ 128, 69, 78, 68, 73, 78, 199, 69, 78, 68, 69, 80, 128, 69, 78, 68, 69,
+ 65, 86, 79, 85, 82, 128, 69, 78, 67, 79, 85, 78, 84, 69, 82, 83, 128, 69,
+ 78, 67, 76, 79, 83, 85, 82, 69, 83, 128, 69, 78, 67, 76, 79, 83, 85, 82,
+ 69, 128, 69, 78, 67, 76, 79, 83, 73, 78, 199, 69, 78, 67, 128, 69, 78,
+ 65, 82, 88, 73, 211, 69, 78, 65, 82, 77, 79, 78, 73, 79, 211, 69, 77, 80,
+ 84, 217, 69, 77, 80, 72, 65, 84, 73, 195, 69, 77, 80, 72, 65, 83, 73,
+ 211, 69, 77, 79, 74, 201, 69, 77, 66, 82, 79, 73, 68, 69, 82, 89, 128,
+ 69, 77, 66, 76, 69, 77, 128, 69, 77, 66, 69, 76, 76, 73, 83, 72, 77, 69,
+ 78, 84, 128, 69, 77, 66, 69, 68, 68, 73, 78, 71, 128, 69, 76, 89, 77, 65,
+ 73, 195, 69, 76, 89, 128, 69, 76, 84, 128, 69, 76, 76, 73, 80, 84, 73,
+ 195, 69, 76, 76, 73, 80, 83, 73, 83, 128, 69, 76, 76, 73, 80, 83, 69,
+ 128, 69, 76, 73, 70, 73, 128, 69, 76, 73, 70, 128, 69, 76, 69, 86, 69,
+ 78, 45, 84, 72, 73, 82, 84, 89, 128, 69, 76, 69, 86, 69, 78, 128, 69, 76,
+ 69, 86, 69, 206, 69, 76, 69, 86, 65, 84, 85, 211, 69, 76, 69, 86, 65, 84,
+ 79, 82, 128, 69, 76, 69, 80, 72, 65, 78, 84, 128, 69, 76, 69, 77, 69, 78,
+ 212, 69, 76, 69, 67, 84, 82, 79, 78, 73, 67, 83, 128, 69, 76, 69, 67, 84,
+ 82, 73, 67, 65, 204, 69, 76, 69, 67, 84, 82, 73, 195, 69, 76, 66, 65, 83,
+ 65, 206, 69, 76, 65, 77, 73, 84, 69, 128, 69, 76, 65, 77, 73, 84, 197,
+ 69, 76, 65, 70, 82, 79, 78, 128, 69, 75, 83, 84, 82, 69, 80, 84, 79, 78,
+ 128, 69, 75, 83, 128, 69, 75, 70, 79, 78, 73, 84, 73, 75, 79, 78, 128,
+ 69, 75, 65, 82, 65, 128, 69, 75, 65, 77, 128, 69, 74, 69, 67, 212, 69,
+ 73, 83, 128, 69, 73, 71, 72, 84, 89, 128, 69, 73, 71, 72, 84, 217, 69,
+ 73, 71, 72, 84, 73, 69, 84, 72, 83, 128, 69, 73, 71, 72, 84, 73, 69, 84,
+ 72, 128, 69, 73, 71, 72, 84, 72, 83, 128, 69, 73, 71, 72, 84, 72, 211,
+ 69, 73, 71, 72, 84, 72, 128, 69, 73, 71, 72, 84, 69, 69, 78, 128, 69, 73,
+ 71, 72, 84, 69, 69, 206, 69, 73, 71, 72, 84, 45, 84, 72, 73, 82, 84, 89,
+ 128, 69, 73, 69, 128, 69, 72, 87, 65, 218, 69, 72, 84, 83, 65, 128, 69,
+ 72, 84, 65, 128, 69, 72, 80, 65, 128, 69, 72, 75, 65, 128, 69, 72, 67,
+ 72, 65, 128, 69, 71, 89, 80, 84, 79, 76, 79, 71, 73, 67, 65, 204, 69, 71,
+ 89, 128, 69, 71, 73, 82, 128, 69, 71, 71, 83, 128, 69, 71, 71, 128, 69,
+ 69, 89, 65, 78, 78, 65, 128, 69, 69, 75, 65, 65, 128, 69, 69, 72, 128,
+ 69, 69, 66, 69, 69, 70, 73, 76, 73, 128, 69, 68, 73, 84, 79, 82, 73, 65,
+ 204, 69, 68, 73, 78, 128, 69, 68, 68, 128, 69, 67, 83, 128, 69, 67, 76,
+ 73, 80, 83, 69, 128, 69, 66, 69, 70, 73, 76, 73, 128, 69, 65, 83, 84, 69,
+ 82, 206, 69, 65, 83, 84, 128, 69, 65, 83, 212, 69, 65, 82, 84, 72, 76,
+ 217, 69, 65, 82, 84, 72, 128, 69, 65, 82, 84, 200, 69, 65, 82, 76, 217,
+ 69, 65, 77, 72, 65, 78, 67, 72, 79, 76, 76, 128, 69, 65, 71, 76, 69, 128,
+ 69, 65, 68, 72, 65, 68, 72, 128, 69, 65, 66, 72, 65, 68, 72, 128, 69,
+ 178, 69, 48, 51, 56, 128, 69, 48, 51, 55, 128, 69, 48, 51, 54, 128, 69,
+ 48, 51, 52, 65, 128, 69, 48, 51, 52, 128, 69, 48, 51, 51, 128, 69, 48,
+ 51, 50, 128, 69, 48, 51, 49, 128, 69, 48, 51, 48, 128, 69, 48, 50, 57,
+ 128, 69, 48, 50, 56, 65, 128, 69, 48, 50, 56, 128, 69, 48, 50, 55, 128,
+ 69, 48, 50, 54, 128, 69, 48, 50, 53, 128, 69, 48, 50, 52, 128, 69, 48,
+ 50, 51, 128, 69, 48, 50, 50, 128, 69, 48, 50, 49, 128, 69, 48, 50, 48,
+ 65, 128, 69, 48, 50, 48, 128, 69, 48, 49, 57, 128, 69, 48, 49, 56, 128,
+ 69, 48, 49, 55, 65, 128, 69, 48, 49, 55, 128, 69, 48, 49, 54, 65, 128,
+ 69, 48, 49, 54, 128, 69, 48, 49, 53, 128, 69, 48, 49, 52, 128, 69, 48,
+ 49, 51, 128, 69, 48, 49, 50, 128, 69, 48, 49, 49, 128, 69, 48, 49, 48,
+ 128, 69, 48, 48, 57, 65, 128, 69, 48, 48, 57, 128, 69, 48, 48, 56, 65,
+ 128, 69, 48, 48, 56, 128, 69, 48, 48, 55, 128, 69, 48, 48, 54, 128, 69,
+ 48, 48, 53, 128, 69, 48, 48, 52, 128, 69, 48, 48, 51, 128, 69, 48, 48,
+ 50, 128, 69, 48, 48, 49, 128, 69, 45, 77, 65, 73, 204, 68, 90, 90, 72,
+ 69, 128, 68, 90, 90, 69, 128, 68, 90, 90, 65, 128, 68, 90, 89, 73, 128,
+ 68, 90, 89, 65, 89, 128, 68, 90, 87, 69, 128, 68, 90, 85, 128, 68, 90,
+ 79, 128, 68, 90, 74, 69, 128, 68, 90, 73, 84, 65, 128, 68, 90, 73, 128,
+ 68, 90, 72, 79, 73, 128, 68, 90, 72, 69, 128, 68, 90, 72, 65, 128, 68,
+ 90, 69, 76, 79, 128, 68, 90, 69, 69, 128, 68, 90, 69, 128, 68, 90, 65,
+ 89, 128, 68, 90, 65, 65, 128, 68, 90, 65, 128, 68, 90, 128, 68, 218, 68,
+ 89, 79, 128, 68, 89, 207, 68, 89, 78, 65, 77, 73, 195, 68, 89, 69, 72,
+ 128, 68, 89, 69, 200, 68, 89, 65, 78, 128, 68, 87, 79, 128, 68, 87, 69,
+ 128, 68, 87, 65, 128, 68, 86, 85, 77, 89, 193, 68, 86, 79, 69, 84, 79,
+ 67, 72, 73, 69, 128, 68, 86, 79, 69, 67, 72, 69, 76, 78, 79, 80, 79, 86,
+ 79, 68, 78, 65, 89, 65, 128, 68, 86, 79, 69, 67, 72, 69, 76, 78, 79, 80,
+ 79, 86, 79, 68, 78, 65, 89, 193, 68, 86, 79, 69, 67, 72, 69, 76, 78, 79,
+ 75, 82, 89, 90, 72, 69, 86, 65, 89, 65, 128, 68, 86, 79, 69, 67, 72, 69,
+ 76, 78, 65, 89, 65, 128, 68, 86, 79, 69, 67, 72, 69, 76, 78, 65, 89, 193,
+ 68, 86, 73, 83, 86, 65, 82, 65, 128, 68, 86, 68, 128, 68, 86, 193, 68,
+ 86, 128, 68, 85, 84, 73, 69, 83, 128, 68, 85, 83, 75, 128, 68, 85, 83,
+ 72, 69, 78, 78, 65, 128, 68, 85, 82, 65, 84, 73, 79, 78, 128, 68, 85, 82,
+ 50, 128, 68, 85, 80, 79, 78, 68, 73, 85, 211, 68, 85, 79, 88, 128, 68,
+ 85, 79, 128, 68, 85, 78, 52, 128, 68, 85, 78, 51, 128, 68, 85, 78, 179,
+ 68, 85, 77, 80, 76, 73, 78, 71, 128, 68, 85, 77, 128, 68, 85, 204, 68,
+ 85, 72, 128, 68, 85, 71, 85, 68, 128, 68, 85, 199, 68, 85, 68, 65, 128,
+ 68, 85, 67, 75, 128, 68, 85, 66, 50, 128, 68, 85, 66, 128, 68, 85, 194,
+ 68, 82, 89, 128, 68, 82, 217, 68, 82, 85, 77, 83, 84, 73, 67, 75, 83,
+ 128, 68, 82, 85, 77, 128, 68, 82, 85, 205, 68, 82, 79, 80, 83, 128, 68,
+ 82, 79, 80, 76, 69, 84, 128, 68, 82, 79, 80, 45, 83, 72, 65, 68, 79, 87,
+ 69, 196, 68, 82, 79, 208, 68, 82, 79, 79, 76, 73, 78, 199, 68, 82, 79,
+ 77, 69, 68, 65, 82, 217, 68, 82, 73, 86, 69, 128, 68, 82, 73, 86, 197,
+ 68, 82, 73, 78, 75, 128, 68, 82, 73, 204, 68, 82, 69, 83, 83, 128, 68,
+ 82, 69, 65, 77, 217, 68, 82, 65, 85, 71, 72, 84, 211, 68, 82, 65, 77,
+ 128, 68, 82, 65, 205, 68, 82, 65, 71, 79, 78, 128, 68, 82, 65, 71, 79,
+ 206, 68, 82, 65, 70, 84, 73, 78, 199, 68, 82, 65, 67, 72, 77, 65, 83,
+ 128, 68, 82, 65, 67, 72, 77, 65, 128, 68, 82, 65, 67, 72, 77, 193, 68,
+ 79, 87, 78, 87, 65, 82, 68, 83, 128, 68, 79, 87, 78, 87, 65, 82, 68, 211,
+ 68, 79, 87, 78, 87, 65, 82, 196, 68, 79, 87, 78, 83, 67, 65, 76, 73, 78,
+ 199, 68, 79, 87, 78, 45, 80, 79, 73, 78, 84, 73, 78, 199, 68, 79, 87, 78,
+ 128, 68, 79, 86, 69, 128, 68, 79, 86, 197, 68, 79, 85, 71, 72, 78, 85,
+ 84, 128, 68, 79, 85, 66, 84, 128, 68, 79, 85, 66, 76, 69, 196, 68, 79,
+ 85, 66, 76, 69, 45, 83, 84, 82, 85, 67, 203, 68, 79, 85, 66, 76, 69, 45,
+ 76, 73, 78, 69, 196, 68, 79, 85, 66, 76, 69, 45, 76, 73, 78, 197, 68, 79,
+ 85, 66, 76, 69, 45, 69, 78, 68, 69, 196, 68, 79, 85, 66, 76, 69, 128, 68,
+ 79, 84, 84, 69, 68, 45, 80, 128, 68, 79, 84, 84, 69, 68, 45, 78, 128, 68,
+ 79, 84, 84, 69, 68, 45, 76, 128, 68, 79, 84, 84, 69, 68, 128, 68, 79, 84,
+ 84, 69, 196, 68, 79, 84, 83, 45, 56, 128, 68, 79, 84, 83, 45, 55, 56,
+ 128, 68, 79, 84, 83, 45, 55, 128, 68, 79, 84, 83, 45, 54, 56, 128, 68,
+ 79, 84, 83, 45, 54, 55, 56, 128, 68, 79, 84, 83, 45, 54, 55, 128, 68, 79,
+ 84, 83, 45, 54, 128, 68, 79, 84, 83, 45, 53, 56, 128, 68, 79, 84, 83, 45,
+ 53, 55, 56, 128, 68, 79, 84, 83, 45, 53, 55, 128, 68, 79, 84, 83, 45, 53,
+ 54, 56, 128, 68, 79, 84, 83, 45, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 53, 54, 128, 68, 79, 84, 83, 45, 53,
+ 128, 68, 79, 84, 83, 45, 52, 56, 128, 68, 79, 84, 83, 45, 52, 55, 56,
+ 128, 68, 79, 84, 83, 45, 52, 55, 128, 68, 79, 84, 83, 45, 52, 54, 56,
+ 128, 68, 79, 84, 83, 45, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 52, 54,
+ 55, 128, 68, 79, 84, 83, 45, 52, 54, 128, 68, 79, 84, 83, 45, 52, 53, 56,
+ 128, 68, 79, 84, 83, 45, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 52, 53,
+ 55, 128, 68, 79, 84, 83, 45, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 52,
+ 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 52, 53, 54, 55, 128, 68, 79, 84,
+ 83, 45, 52, 53, 54, 128, 68, 79, 84, 83, 45, 52, 53, 128, 68, 79, 84, 83,
+ 45, 52, 128, 68, 79, 84, 83, 45, 51, 56, 128, 68, 79, 84, 83, 45, 51, 55,
+ 56, 128, 68, 79, 84, 83, 45, 51, 55, 128, 68, 79, 84, 83, 45, 51, 54, 56,
+ 128, 68, 79, 84, 83, 45, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 54,
+ 55, 128, 68, 79, 84, 83, 45, 51, 54, 128, 68, 79, 84, 83, 45, 51, 53, 56,
+ 128, 68, 79, 84, 83, 45, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 51, 53,
+ 55, 128, 68, 79, 84, 83, 45, 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 51,
+ 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 53, 54, 55, 128, 68, 79, 84,
+ 83, 45, 51, 53, 54, 128, 68, 79, 84, 83, 45, 51, 53, 128, 68, 79, 84, 83,
+ 45, 51, 52, 56, 128, 68, 79, 84, 83, 45, 51, 52, 55, 56, 128, 68, 79, 84,
+ 83, 45, 51, 52, 55, 128, 68, 79, 84, 83, 45, 51, 52, 54, 56, 128, 68, 79,
+ 84, 83, 45, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 54, 55,
+ 128, 68, 79, 84, 83, 45, 51, 52, 54, 128, 68, 79, 84, 83, 45, 51, 52, 53,
+ 56, 128, 68, 79, 84, 83, 45, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45,
+ 51, 52, 53, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 56, 128, 68, 79,
+ 84, 83, 45, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 51, 52, 53,
+ 54, 55, 128, 68, 79, 84, 83, 45, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45,
+ 51, 52, 53, 128, 68, 79, 84, 83, 45, 51, 52, 128, 68, 79, 84, 83, 45, 51,
+ 128, 68, 79, 84, 83, 45, 50, 56, 128, 68, 79, 84, 83, 45, 50, 55, 56,
+ 128, 68, 79, 84, 83, 45, 50, 55, 128, 68, 79, 84, 83, 45, 50, 54, 56,
+ 128, 68, 79, 84, 83, 45, 50, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 54,
+ 55, 128, 68, 79, 84, 83, 45, 50, 54, 128, 68, 79, 84, 83, 45, 50, 53, 56,
+ 128, 68, 79, 84, 83, 45, 50, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53,
+ 55, 128, 68, 79, 84, 83, 45, 50, 53, 54, 56, 128, 68, 79, 84, 83, 45, 50,
+ 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 53, 54, 55, 128, 68, 79, 84,
+ 83, 45, 50, 53, 54, 128, 68, 79, 84, 83, 45, 50, 53, 128, 68, 79, 84, 83,
+ 45, 50, 52, 56, 128, 68, 79, 84, 83, 45, 50, 52, 55, 56, 128, 68, 79, 84,
+ 83, 45, 50, 52, 55, 128, 68, 79, 84, 83, 45, 50, 52, 54, 56, 128, 68, 79,
+ 84, 83, 45, 50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 54, 55,
+ 128, 68, 79, 84, 83, 45, 50, 52, 54, 128, 68, 79, 84, 83, 45, 50, 52, 53,
+ 56, 128, 68, 79, 84, 83, 45, 50, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45,
+ 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 56, 128, 68, 79,
+ 84, 83, 45, 50, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 52, 53,
+ 54, 55, 128, 68, 79, 84, 83, 45, 50, 52, 53, 54, 128, 68, 79, 84, 83, 45,
+ 50, 52, 53, 128, 68, 79, 84, 83, 45, 50, 52, 128, 68, 79, 84, 83, 45, 50,
+ 51, 56, 128, 68, 79, 84, 83, 45, 50, 51, 55, 56, 128, 68, 79, 84, 83, 45,
+ 50, 51, 55, 128, 68, 79, 84, 83, 45, 50, 51, 54, 56, 128, 68, 79, 84, 83,
+ 45, 50, 51, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 54, 55, 128, 68,
+ 79, 84, 83, 45, 50, 51, 54, 128, 68, 79, 84, 83, 45, 50, 51, 53, 56, 128,
+ 68, 79, 84, 83, 45, 50, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51,
+ 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 56, 128, 68, 79, 84, 83,
+ 45, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 55,
+ 128, 68, 79, 84, 83, 45, 50, 51, 53, 54, 128, 68, 79, 84, 83, 45, 50, 51,
+ 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 56, 128, 68, 79, 84, 83, 45, 50,
+ 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 55, 128, 68, 79, 84,
+ 83, 45, 50, 51, 52, 54, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45,
+ 50, 51, 52, 54, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 56, 128, 68, 79,
+ 84, 83, 45, 50, 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52,
+ 53, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 56, 128, 68, 79, 84,
+ 83, 45, 50, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 50, 51, 52,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 50, 51, 52, 53, 54, 128, 68, 79, 84,
+ 83, 45, 50, 51, 52, 53, 128, 68, 79, 84, 83, 45, 50, 51, 52, 128, 68, 79,
+ 84, 83, 45, 50, 51, 128, 68, 79, 84, 83, 45, 50, 128, 68, 79, 84, 83, 45,
+ 49, 56, 128, 68, 79, 84, 83, 45, 49, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 55, 128, 68, 79, 84, 83, 45, 49, 54, 56, 128, 68, 79, 84, 83, 45, 49, 54,
+ 55, 56, 128, 68, 79, 84, 83, 45, 49, 54, 55, 128, 68, 79, 84, 83, 45, 49,
+ 54, 128, 68, 79, 84, 83, 45, 49, 53, 56, 128, 68, 79, 84, 83, 45, 49, 53,
+ 55, 56, 128, 68, 79, 84, 83, 45, 49, 53, 55, 128, 68, 79, 84, 83, 45, 49,
+ 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 53, 54, 55, 56, 128, 68, 79, 84,
+ 83, 45, 49, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 53, 54, 128, 68, 79,
+ 84, 83, 45, 49, 53, 128, 68, 79, 84, 83, 45, 49, 52, 56, 128, 68, 79, 84,
+ 83, 45, 49, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 55, 128, 68, 79,
+ 84, 83, 45, 49, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 56,
+ 128, 68, 79, 84, 83, 45, 49, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 52,
+ 54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49,
+ 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 55, 128, 68, 79, 84,
+ 83, 45, 49, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45,
+ 49, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 52, 53, 128, 68, 79, 84, 83,
+ 45, 49, 52, 128, 68, 79, 84, 83, 45, 49, 51, 56, 128, 68, 79, 84, 83, 45,
+ 49, 51, 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 55, 128, 68, 79, 84, 83,
+ 45, 49, 51, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 54, 55, 56, 128, 68,
+ 79, 84, 83, 45, 49, 51, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 54, 128,
+ 68, 79, 84, 83, 45, 49, 51, 53, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53,
+ 55, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 55, 128, 68, 79, 84, 83, 45,
+ 49, 51, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 56, 128,
+ 68, 79, 84, 83, 45, 49, 51, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51,
+ 53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 53, 128, 68, 79, 84, 83, 45, 49,
+ 51, 52, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 55, 56, 128, 68, 79, 84,
+ 83, 45, 49, 51, 52, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 56, 128,
+ 68, 79, 84, 83, 45, 49, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 51, 52, 54, 128, 68, 79, 84,
+ 83, 45, 49, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 55, 128, 68, 79, 84, 83, 45,
+ 49, 51, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 54, 55, 128, 68, 79, 84, 83,
+ 45, 49, 51, 52, 53, 54, 128, 68, 79, 84, 83, 45, 49, 51, 52, 53, 128, 68,
+ 79, 84, 83, 45, 49, 51, 52, 128, 68, 79, 84, 83, 45, 49, 51, 128, 68, 79,
+ 84, 83, 45, 49, 50, 56, 128, 68, 79, 84, 83, 45, 49, 50, 55, 56, 128, 68,
+ 79, 84, 83, 45, 49, 50, 55, 128, 68, 79, 84, 83, 45, 49, 50, 54, 56, 128,
+ 68, 79, 84, 83, 45, 49, 50, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50,
+ 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 54, 128, 68, 79, 84, 83, 45, 49,
+ 50, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50, 53, 55, 56, 128, 68, 79, 84,
+ 83, 45, 49, 50, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 56, 128,
+ 68, 79, 84, 83, 45, 49, 50, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 53, 54, 128, 68, 79, 84,
+ 83, 45, 49, 50, 53, 128, 68, 79, 84, 83, 45, 49, 50, 52, 56, 128, 68, 79,
+ 84, 83, 45, 49, 50, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 55,
+ 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 54, 55, 128, 68,
+ 79, 84, 83, 45, 49, 50, 52, 54, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53,
+ 56, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 55, 56, 128, 68, 79, 84, 83,
+ 45, 49, 50, 52, 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 56,
+ 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83,
+ 45, 49, 50, 52, 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 54,
+ 128, 68, 79, 84, 83, 45, 49, 50, 52, 53, 128, 68, 79, 84, 83, 45, 49, 50,
+ 52, 128, 68, 79, 84, 83, 45, 49, 50, 51, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 51, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 55, 128, 68, 79, 84,
+ 83, 45, 49, 50, 51, 54, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 55,
+ 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 54, 55, 128, 68, 79, 84, 83, 45,
+ 49, 50, 51, 54, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 56, 128, 68, 79,
+ 84, 83, 45, 49, 50, 51, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51,
+ 53, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 56, 128, 68, 79, 84,
+ 83, 45, 49, 50, 51, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 53, 54, 128, 68, 79, 84,
+ 83, 45, 49, 50, 51, 53, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 56, 128,
+ 68, 79, 84, 83, 45, 49, 50, 51, 52, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 51, 52, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 56, 128, 68,
+ 79, 84, 83, 45, 49, 50, 51, 52, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49,
+ 50, 51, 52, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 54, 128, 68,
+ 79, 84, 83, 45, 49, 50, 51, 52, 53, 56, 128, 68, 79, 84, 83, 45, 49, 50,
+ 51, 52, 53, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 55, 128,
+ 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 56, 128, 68, 79, 84, 83, 45,
+ 49, 50, 51, 52, 53, 54, 55, 56, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52,
+ 53, 54, 55, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52, 53, 54, 128, 68, 79,
+ 84, 83, 45, 49, 50, 51, 52, 53, 128, 68, 79, 84, 83, 45, 49, 50, 51, 52,
+ 128, 68, 79, 84, 83, 45, 49, 50, 51, 128, 68, 79, 84, 83, 45, 49, 50,
+ 128, 68, 79, 84, 83, 45, 49, 128, 68, 79, 84, 83, 128, 68, 79, 84, 76,
+ 69, 83, 211, 68, 79, 82, 85, 128, 68, 79, 82, 79, 77, 197, 68, 79, 79,
+ 82, 128, 68, 79, 79, 78, 71, 128, 68, 79, 78, 75, 69, 89, 128, 68, 79,
+ 78, 71, 128, 68, 79, 77, 73, 78, 207, 68, 79, 77, 65, 73, 206, 68, 79,
+ 76, 80, 72, 73, 78, 128, 68, 79, 76, 76, 83, 128, 68, 79, 76, 76, 65,
+ 210, 68, 79, 76, 73, 85, 77, 128, 68, 79, 75, 77, 65, 73, 128, 68, 79,
+ 73, 84, 128, 68, 79, 73, 78, 199, 68, 79, 73, 128, 68, 79, 71, 82, 193,
+ 68, 79, 71, 128, 68, 79, 199, 68, 79, 69, 211, 68, 79, 68, 79, 128, 68,
+ 79, 68, 69, 75, 65, 84, 65, 128, 68, 79, 67, 85, 77, 69, 78, 84, 128, 68,
+ 79, 67, 85, 77, 69, 78, 212, 68, 79, 66, 82, 79, 128, 68, 79, 65, 67, 72,
+ 65, 83, 72, 77, 69, 69, 128, 68, 79, 65, 67, 72, 65, 83, 72, 77, 69, 197,
+ 68, 79, 65, 128, 68, 79, 45, 79, 128, 68, 78, 193, 68, 77, 128, 68, 205,
+ 68, 76, 85, 128, 68, 76, 79, 128, 68, 76, 73, 128, 68, 76, 72, 89, 65,
+ 128, 68, 76, 72, 65, 128, 68, 76, 69, 69, 128, 68, 76, 65, 128, 68, 76,
+ 128, 68, 75, 65, 82, 128, 68, 75, 65, 210, 68, 74, 69, 82, 86, 73, 128,
+ 68, 74, 69, 82, 86, 128, 68, 74, 69, 128, 68, 74, 65, 128, 68, 73, 90,
+ 90, 217, 68, 73, 89, 193, 68, 73, 86, 79, 82, 67, 197, 68, 73, 86, 73,
+ 83, 73, 79, 78, 128, 68, 73, 86, 73, 83, 73, 79, 206, 68, 73, 86, 73, 78,
+ 199, 68, 73, 86, 73, 78, 65, 84, 73, 79, 78, 128, 68, 73, 86, 73, 68, 69,
+ 83, 128, 68, 73, 86, 73, 68, 69, 82, 83, 128, 68, 73, 86, 73, 68, 69, 82,
+ 128, 68, 73, 86, 73, 68, 69, 196, 68, 73, 86, 73, 68, 69, 128, 68, 73,
+ 86, 73, 68, 197, 68, 73, 86, 69, 211, 68, 73, 86, 69, 82, 71, 69, 78, 67,
+ 69, 128, 68, 73, 84, 84, 207, 68, 73, 83, 84, 79, 82, 84, 73, 79, 78,
+ 128, 68, 73, 83, 84, 73, 78, 71, 85, 73, 83, 72, 128, 68, 73, 83, 84, 73,
+ 76, 76, 128, 68, 73, 83, 83, 79, 76, 86, 69, 45, 50, 128, 68, 73, 83, 83,
+ 79, 76, 86, 69, 128, 68, 73, 83, 80, 85, 84, 69, 196, 68, 73, 83, 80, 69,
+ 82, 83, 73, 79, 78, 128, 68, 73, 83, 75, 128, 68, 73, 83, 73, 77, 79, 85,
+ 128, 68, 73, 83, 72, 128, 68, 73, 83, 71, 85, 73, 83, 69, 196, 68, 73,
+ 83, 67, 79, 78, 84, 73, 78, 85, 79, 85, 211, 68, 73, 83, 195, 68, 73, 83,
+ 65, 80, 80, 79, 73, 78, 84, 69, 196, 68, 73, 83, 65, 66, 76, 69, 196, 68,
+ 73, 82, 71, 193, 68, 73, 82, 69, 67, 84, 76, 217, 68, 73, 82, 69, 67, 84,
+ 73, 79, 78, 65, 204, 68, 73, 82, 69, 67, 84, 73, 79, 206, 68, 73, 80, 84,
+ 69, 128, 68, 73, 80, 80, 69, 82, 128, 68, 73, 80, 76, 79, 85, 78, 128,
+ 68, 73, 80, 76, 73, 128, 68, 73, 80, 76, 201, 68, 73, 78, 71, 66, 65,
+ 212, 68, 73, 206, 68, 73, 77, 77, 73, 78, 71, 128, 68, 73, 77, 73, 78,
+ 85, 84, 73, 79, 78, 45, 51, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78,
+ 45, 50, 128, 68, 73, 77, 73, 78, 85, 84, 73, 79, 78, 45, 49, 128, 68, 73,
+ 77, 73, 78, 73, 83, 72, 77, 69, 78, 84, 128, 68, 73, 77, 73, 68, 73, 193,
+ 68, 73, 77, 69, 78, 83, 73, 79, 78, 65, 204, 68, 73, 77, 69, 78, 83, 73,
+ 79, 206, 68, 73, 77, 50, 128, 68, 73, 77, 178, 68, 73, 76, 128, 68, 73,
+ 71, 82, 65, 80, 72, 128, 68, 73, 71, 82, 65, 80, 200, 68, 73, 71, 82, 65,
+ 77, 77, 79, 211, 68, 73, 71, 82, 65, 77, 77, 193, 68, 73, 71, 82, 65,
+ 205, 68, 73, 71, 79, 82, 71, 79, 78, 128, 68, 73, 71, 79, 82, 71, 79,
+ 206, 68, 73, 71, 73, 84, 83, 128, 68, 73, 71, 65, 77, 77, 65, 128, 68,
+ 73, 71, 193, 68, 73, 70, 84, 79, 71, 71, 79, 211, 68, 73, 70, 79, 78, 73,
+ 65, 83, 128, 68, 73, 70, 70, 73, 67, 85, 76, 84, 217, 68, 73, 70, 70, 73,
+ 67, 85, 76, 84, 73, 69, 83, 128, 68, 73, 70, 70, 69, 82, 69, 78, 84, 73,
+ 65, 76, 128, 68, 73, 70, 70, 69, 82, 69, 78, 67, 197, 68, 73, 70, 65, 84,
+ 128, 68, 73, 69, 83, 73, 83, 128, 68, 73, 69, 83, 73, 211, 68, 73, 69,
+ 83, 69, 204, 68, 73, 69, 80, 128, 68, 73, 197, 68, 73, 66, 128, 68, 73,
+ 65, 84, 79, 78, 79, 206, 68, 73, 65, 84, 79, 78, 73, 75, 201, 68, 73, 65,
+ 83, 84, 79, 76, 201, 68, 73, 65, 77, 79, 78, 68, 83, 128, 68, 73, 65, 77,
+ 79, 78, 68, 128, 68, 73, 65, 77, 79, 78, 196, 68, 73, 65, 77, 69, 84, 69,
+ 210, 68, 73, 65, 76, 89, 84, 73, 75, 65, 128, 68, 73, 65, 76, 89, 84, 73,
+ 75, 193, 68, 73, 65, 76, 69, 67, 84, 45, 208, 68, 73, 65, 71, 79, 78, 65,
+ 76, 128, 68, 73, 65, 69, 82, 69, 83, 73, 90, 69, 196, 68, 73, 65, 69, 82,
+ 69, 83, 73, 83, 45, 82, 73, 78, 71, 128, 68, 73, 65, 69, 82, 69, 83, 73,
+ 83, 128, 68, 73, 65, 69, 82, 69, 83, 73, 211, 68, 72, 79, 85, 128, 68,
+ 72, 79, 79, 128, 68, 72, 79, 128, 68, 72, 73, 73, 128, 68, 72, 72, 85,
+ 128, 68, 72, 72, 79, 79, 128, 68, 72, 72, 79, 128, 68, 72, 72, 73, 128,
+ 68, 72, 72, 69, 69, 128, 68, 72, 72, 69, 128, 68, 72, 72, 65, 128, 68,
+ 72, 69, 69, 128, 68, 72, 65, 82, 77, 65, 128, 68, 72, 65, 77, 69, 68, 72,
+ 128, 68, 72, 65, 76, 69, 84, 72, 128, 68, 72, 65, 76, 65, 84, 72, 128,
+ 68, 72, 65, 76, 128, 68, 72, 65, 68, 72, 69, 128, 68, 72, 65, 65, 76, 85,
+ 128, 68, 72, 65, 65, 128, 68, 72, 65, 128, 68, 69, 90, 200, 68, 69, 89,
+ 84, 69, 82, 79, 213, 68, 69, 89, 84, 69, 82, 79, 211, 68, 69, 88, 73, 65,
+ 128, 68, 69, 86, 73, 67, 197, 68, 69, 86, 69, 76, 79, 80, 77, 69, 78, 84,
+ 128, 68, 69, 85, 78, 71, 128, 68, 69, 83, 75, 84, 79, 208, 68, 69, 83,
+ 203, 68, 69, 83, 73, 71, 78, 128, 68, 69, 83, 73, 128, 68, 69, 83, 69,
+ 82, 84, 128, 68, 69, 83, 69, 82, 212, 68, 69, 83, 69, 82, 69, 212, 68,
+ 69, 83, 67, 82, 73, 80, 84, 73, 79, 206, 68, 69, 83, 67, 69, 78, 68, 73,
+ 78, 199, 68, 69, 83, 67, 69, 78, 68, 69, 82, 128, 68, 69, 82, 69, 84, 45,
+ 72, 73, 68, 69, 84, 128, 68, 69, 82, 69, 84, 128, 68, 69, 82, 69, 76, 73,
+ 67, 212, 68, 69, 82, 66, 73, 84, 83, 65, 128, 68, 69, 80, 84, 72, 128,
+ 68, 69, 80, 65, 82, 84, 85, 82, 69, 128, 68, 69, 80, 65, 82, 84, 77, 69,
+ 78, 212, 68, 69, 80, 65, 82, 84, 73, 78, 199, 68, 69, 78, 84, 73, 83, 84,
+ 82, 217, 68, 69, 78, 84, 65, 204, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79,
+ 82, 128, 68, 69, 78, 79, 77, 73, 78, 65, 84, 79, 210, 68, 69, 78, 78, 69,
+ 78, 128, 68, 69, 78, 71, 128, 68, 69, 78, 197, 68, 69, 78, 65, 82, 73,
+ 85, 211, 68, 69, 77, 69, 83, 84, 86, 69, 78, 78, 217, 68, 69, 76, 84, 65,
+ 128, 68, 69, 76, 84, 193, 68, 69, 76, 84, 128, 68, 69, 76, 80, 72, 73,
+ 195, 68, 69, 76, 73, 86, 69, 82, 217, 68, 69, 76, 73, 86, 69, 82, 65, 78,
+ 67, 69, 128, 68, 69, 76, 73, 77, 73, 84, 69, 82, 128, 68, 69, 76, 73, 77,
+ 73, 84, 69, 210, 68, 69, 76, 73, 67, 73, 79, 85, 211, 68, 69, 76, 69, 84,
+ 73, 79, 206, 68, 69, 76, 69, 84, 69, 128, 68, 69, 76, 69, 84, 197, 68,
+ 69, 75, 65, 128, 68, 69, 75, 128, 68, 69, 73, 128, 68, 69, 72, 73, 128,
+ 68, 69, 71, 82, 69, 69, 83, 128, 68, 69, 71, 82, 69, 197, 68, 69, 70, 73,
+ 78, 73, 84, 73, 79, 78, 128, 68, 69, 70, 69, 67, 84, 73, 86, 69, 78, 69,
+ 83, 211, 68, 69, 69, 82, 128, 68, 69, 69, 80, 76, 89, 128, 68, 69, 69,
+ 76, 128, 68, 69, 67, 82, 69, 83, 67, 69, 78, 68, 79, 128, 68, 69, 67, 82,
+ 69, 65, 83, 69, 128, 68, 69, 67, 82, 69, 65, 83, 197, 68, 69, 67, 79, 82,
+ 65, 84, 73, 86, 197, 68, 69, 67, 79, 82, 65, 84, 73, 79, 78, 128, 68, 69,
+ 67, 73, 83, 73, 86, 69, 78, 69, 83, 83, 128, 68, 69, 67, 73, 77, 65, 204,
+ 68, 69, 67, 73, 68, 85, 79, 85, 211, 68, 69, 67, 69, 77, 66, 69, 82, 128,
+ 68, 69, 67, 65, 89, 69, 68, 128, 68, 69, 66, 73, 212, 68, 69, 65, 84, 72,
+ 128, 68, 69, 65, 198, 68, 69, 65, 68, 128, 68, 68, 87, 65, 128, 68, 68,
+ 85, 88, 128, 68, 68, 85, 84, 128, 68, 68, 85, 82, 88, 128, 68, 68, 85,
+ 82, 128, 68, 68, 85, 80, 128, 68, 68, 85, 79, 88, 128, 68, 68, 85, 79,
+ 80, 128, 68, 68, 85, 79, 128, 68, 68, 85, 128, 68, 68, 79, 88, 128, 68,
+ 68, 79, 84, 128, 68, 68, 79, 80, 128, 68, 68, 79, 65, 128, 68, 68, 73,
+ 88, 128, 68, 68, 73, 84, 128, 68, 68, 73, 80, 128, 68, 68, 73, 69, 88,
+ 128, 68, 68, 73, 69, 80, 128, 68, 68, 73, 69, 128, 68, 68, 73, 128, 68,
+ 68, 72, 85, 128, 68, 68, 72, 79, 128, 68, 68, 72, 69, 69, 128, 68, 68,
+ 72, 69, 128, 68, 68, 72, 65, 65, 128, 68, 68, 72, 65, 128, 68, 68, 69,
+ 88, 128, 68, 68, 69, 80, 128, 68, 68, 69, 69, 128, 68, 68, 69, 128, 68,
+ 68, 68, 72, 65, 128, 68, 68, 68, 65, 128, 68, 68, 65, 89, 65, 78, 78, 65,
+ 128, 68, 68, 65, 88, 128, 68, 68, 65, 84, 128, 68, 68, 65, 80, 128, 68,
+ 68, 65, 76, 128, 68, 68, 65, 204, 68, 68, 65, 72, 65, 76, 128, 68, 68,
+ 65, 72, 65, 204, 68, 68, 65, 65, 128, 68, 67, 83, 128, 68, 67, 72, 69,
+ 128, 68, 67, 52, 128, 68, 67, 51, 128, 68, 67, 50, 128, 68, 67, 49, 128,
+ 68, 194, 68, 65, 89, 45, 78, 73, 71, 72, 84, 128, 68, 65, 217, 68, 65,
+ 87, 66, 128, 68, 65, 86, 73, 89, 65, 78, 73, 128, 68, 65, 86, 73, 68,
+ 128, 68, 65, 84, 197, 68, 65, 83, 73, 65, 128, 68, 65, 83, 73, 193, 68,
+ 65, 83, 72, 69, 196, 68, 65, 83, 72, 128, 68, 65, 83, 200, 68, 65, 83,
+ 69, 73, 65, 128, 68, 65, 82, 84, 128, 68, 65, 82, 75, 69, 78, 73, 78, 71,
+ 128, 68, 65, 82, 75, 69, 78, 73, 78, 199, 68, 65, 82, 203, 68, 65, 82,
+ 71, 65, 128, 68, 65, 82, 65, 52, 128, 68, 65, 82, 65, 51, 128, 68, 65,
+ 82, 128, 68, 65, 80, 45, 80, 82, 65, 205, 68, 65, 80, 45, 80, 73, 201,
+ 68, 65, 80, 45, 77, 85, 79, 217, 68, 65, 80, 45, 66, 85, 79, 206, 68, 65,
+ 80, 45, 66, 69, 201, 68, 65, 208, 68, 65, 78, 84, 65, 89, 65, 76, 65, 78,
+ 128, 68, 65, 78, 84, 65, 74, 193, 68, 65, 78, 71, 79, 128, 68, 65, 78,
+ 71, 128, 68, 65, 78, 199, 68, 65, 78, 68, 65, 128, 68, 65, 78, 67, 73,
+ 78, 71, 128, 68, 65, 78, 67, 69, 82, 128, 68, 65, 77, 80, 128, 68, 65,
+ 77, 208, 68, 65, 77, 77, 65, 84, 65, 78, 128, 68, 65, 77, 77, 65, 84, 65,
+ 206, 68, 65, 77, 77, 65, 128, 68, 65, 77, 77, 193, 68, 65, 77, 65, 82,
+ 85, 128, 68, 65, 77, 65, 71, 69, 68, 128, 68, 65, 77, 65, 71, 69, 196,
+ 68, 65, 76, 69, 84, 72, 45, 82, 69, 83, 72, 128, 68, 65, 76, 69, 84, 128,
+ 68, 65, 76, 69, 212, 68, 65, 76, 68, 65, 128, 68, 65, 76, 65, 84, 72,
+ 128, 68, 65, 76, 65, 84, 200, 68, 65, 76, 65, 84, 128, 68, 65, 73, 82,
+ 128, 68, 65, 73, 78, 71, 128, 68, 65, 73, 128, 68, 65, 72, 89, 65, 65,
+ 85, 83, 72, 45, 50, 128, 68, 65, 72, 89, 65, 65, 85, 83, 72, 128, 68, 65,
+ 71, 83, 128, 68, 65, 71, 71, 69, 82, 128, 68, 65, 71, 71, 69, 210, 68,
+ 65, 71, 69, 83, 72, 128, 68, 65, 71, 69, 83, 200, 68, 65, 71, 66, 65, 83,
+ 73, 78, 78, 65, 128, 68, 65, 71, 65, 218, 68, 65, 71, 65, 76, 71, 65,
+ 128, 68, 65, 71, 51, 128, 68, 65, 199, 68, 65, 69, 78, 71, 128, 68, 65,
+ 69, 199, 68, 65, 68, 128, 68, 65, 196, 68, 65, 65, 83, 85, 128, 68, 65,
+ 65, 76, 73, 128, 68, 65, 65, 68, 72, 85, 128, 68, 48, 54, 55, 72, 128,
+ 68, 48, 54, 55, 71, 128, 68, 48, 54, 55, 70, 128, 68, 48, 54, 55, 69,
+ 128, 68, 48, 54, 55, 68, 128, 68, 48, 54, 55, 67, 128, 68, 48, 54, 55,
+ 66, 128, 68, 48, 54, 55, 65, 128, 68, 48, 54, 55, 128, 68, 48, 54, 54,
+ 128, 68, 48, 54, 53, 128, 68, 48, 54, 52, 128, 68, 48, 54, 51, 128, 68,
+ 48, 54, 50, 128, 68, 48, 54, 49, 128, 68, 48, 54, 48, 128, 68, 48, 53,
+ 57, 128, 68, 48, 53, 56, 128, 68, 48, 53, 55, 128, 68, 48, 53, 54, 128,
+ 68, 48, 53, 53, 128, 68, 48, 53, 52, 65, 128, 68, 48, 53, 52, 128, 68,
+ 48, 53, 51, 128, 68, 48, 53, 50, 65, 128, 68, 48, 53, 50, 128, 68, 48,
+ 53, 49, 128, 68, 48, 53, 48, 73, 128, 68, 48, 53, 48, 72, 128, 68, 48,
+ 53, 48, 71, 128, 68, 48, 53, 48, 70, 128, 68, 48, 53, 48, 69, 128, 68,
+ 48, 53, 48, 68, 128, 68, 48, 53, 48, 67, 128, 68, 48, 53, 48, 66, 128,
+ 68, 48, 53, 48, 65, 128, 68, 48, 53, 48, 128, 68, 48, 52, 57, 128, 68,
+ 48, 52, 56, 65, 128, 68, 48, 52, 56, 128, 68, 48, 52, 55, 128, 68, 48,
+ 52, 54, 65, 128, 68, 48, 52, 54, 128, 68, 48, 52, 53, 128, 68, 48, 52,
+ 52, 128, 68, 48, 52, 51, 128, 68, 48, 52, 50, 128, 68, 48, 52, 49, 128,
+ 68, 48, 52, 48, 128, 68, 48, 51, 57, 128, 68, 48, 51, 56, 128, 68, 48,
+ 51, 55, 128, 68, 48, 51, 54, 128, 68, 48, 51, 53, 128, 68, 48, 51, 52,
+ 65, 128, 68, 48, 51, 52, 128, 68, 48, 51, 51, 128, 68, 48, 51, 50, 128,
+ 68, 48, 51, 49, 65, 128, 68, 48, 51, 49, 128, 68, 48, 51, 48, 128, 68,
+ 48, 50, 57, 128, 68, 48, 50, 56, 128, 68, 48, 50, 55, 65, 128, 68, 48,
+ 50, 55, 128, 68, 48, 50, 54, 128, 68, 48, 50, 53, 128, 68, 48, 50, 52,
+ 128, 68, 48, 50, 51, 128, 68, 48, 50, 50, 128, 68, 48, 50, 49, 128, 68,
+ 48, 50, 48, 128, 68, 48, 49, 57, 128, 68, 48, 49, 56, 128, 68, 48, 49,
+ 55, 128, 68, 48, 49, 54, 128, 68, 48, 49, 53, 128, 68, 48, 49, 52, 128,
+ 68, 48, 49, 51, 128, 68, 48, 49, 50, 128, 68, 48, 49, 49, 128, 68, 48,
+ 49, 48, 128, 68, 48, 48, 57, 128, 68, 48, 48, 56, 65, 128, 68, 48, 48,
+ 56, 128, 68, 48, 48, 55, 128, 68, 48, 48, 54, 128, 68, 48, 48, 53, 128,
+ 68, 48, 48, 52, 128, 68, 48, 48, 51, 128, 68, 48, 48, 50, 128, 68, 48,
+ 48, 49, 128, 67, 89, 88, 128, 67, 89, 84, 128, 67, 89, 82, 88, 128, 67,
+ 89, 82, 69, 78, 65, 73, 195, 67, 89, 82, 128, 67, 89, 80, 82, 79, 45, 77,
+ 73, 78, 79, 65, 206, 67, 89, 80, 82, 73, 79, 212, 67, 89, 80, 69, 82, 85,
+ 83, 128, 67, 89, 80, 128, 67, 89, 76, 73, 78, 68, 82, 73, 67, 73, 84, 89,
+ 128, 67, 89, 67, 76, 79, 78, 69, 128, 67, 89, 65, 89, 128, 67, 89, 65,
+ 87, 128, 67, 89, 65, 128, 67, 87, 79, 79, 128, 67, 87, 79, 128, 67, 87,
+ 73, 73, 128, 67, 87, 73, 128, 67, 87, 69, 79, 82, 84, 72, 128, 67, 87,
+ 69, 128, 67, 87, 65, 65, 128, 67, 85, 88, 128, 67, 85, 85, 128, 67, 85,
+ 212, 67, 85, 83, 84, 79, 77, 83, 128, 67, 85, 83, 84, 79, 77, 69, 210,
+ 67, 85, 83, 84, 65, 82, 68, 128, 67, 85, 83, 80, 128, 67, 85, 82, 88,
+ 128, 67, 85, 82, 86, 73, 78, 199, 67, 85, 82, 86, 69, 68, 128, 67, 85,
+ 82, 86, 69, 196, 67, 85, 82, 86, 69, 128, 67, 85, 82, 86, 197, 67, 85,
+ 82, 83, 73, 86, 197, 67, 85, 82, 82, 217, 67, 85, 82, 82, 69, 78, 84,
+ 128, 67, 85, 82, 82, 69, 78, 212, 67, 85, 82, 76, 217, 67, 85, 82, 76,
+ 73, 78, 199, 67, 85, 82, 76, 69, 196, 67, 85, 82, 76, 128, 67, 85, 82,
+ 128, 67, 85, 80, 80, 69, 68, 128, 67, 85, 80, 80, 69, 196, 67, 85, 80,
+ 73, 68, 79, 128, 67, 85, 80, 67, 65, 75, 69, 128, 67, 85, 79, 88, 128,
+ 67, 85, 79, 80, 128, 67, 85, 79, 128, 67, 85, 205, 67, 85, 76, 84, 73,
+ 86, 65, 84, 73, 79, 206, 67, 85, 67, 85, 77, 66, 69, 82, 128, 67, 85, 66,
+ 69, 68, 128, 67, 85, 66, 69, 128, 67, 85, 66, 197, 67, 85, 65, 84, 82,
+ 73, 76, 76, 79, 128, 67, 85, 65, 84, 82, 73, 76, 76, 207, 67, 85, 65,
+ 205, 67, 83, 73, 128, 67, 82, 89, 83, 84, 65, 204, 67, 82, 89, 80, 84,
+ 79, 71, 82, 65, 77, 77, 73, 195, 67, 82, 89, 73, 78, 199, 67, 82, 85, 90,
+ 69, 73, 82, 207, 67, 82, 85, 84, 67, 72, 128, 67, 82, 85, 67, 73, 70, 79,
+ 82, 205, 67, 82, 85, 67, 73, 66, 76, 69, 45, 53, 128, 67, 82, 85, 67, 73,
+ 66, 76, 69, 45, 52, 128, 67, 82, 85, 67, 73, 66, 76, 69, 45, 51, 128, 67,
+ 82, 85, 67, 73, 66, 76, 69, 45, 50, 128, 67, 82, 85, 67, 73, 66, 76, 69,
+ 128, 67, 82, 79, 87, 78, 128, 67, 82, 79, 83, 83, 73, 78, 71, 128, 67,
+ 82, 79, 83, 83, 73, 78, 199, 67, 82, 79, 83, 83, 72, 65, 84, 67, 200, 67,
+ 82, 79, 83, 83, 69, 68, 45, 84, 65, 73, 76, 128, 67, 82, 79, 83, 83, 69,
+ 68, 128, 67, 82, 79, 83, 83, 69, 196, 67, 82, 79, 83, 83, 66, 79, 78, 69,
+ 83, 128, 67, 82, 79, 83, 83, 66, 65, 82, 128, 67, 82, 79, 83, 83, 128,
+ 67, 82, 79, 83, 211, 67, 82, 79, 80, 128, 67, 82, 79, 73, 88, 128, 67,
+ 82, 79, 73, 83, 83, 65, 78, 84, 128, 67, 82, 79, 67, 85, 211, 67, 82, 79,
+ 67, 79, 68, 73, 76, 69, 128, 67, 82, 73, 67, 75, 69, 84, 128, 67, 82, 73,
+ 67, 75, 69, 212, 67, 82, 69, 83, 67, 69, 78, 84, 83, 128, 67, 82, 69, 83,
+ 67, 69, 78, 84, 128, 67, 82, 69, 83, 67, 69, 78, 212, 67, 82, 69, 68, 73,
+ 212, 67, 82, 69, 65, 84, 73, 86, 197, 67, 82, 69, 65, 77, 128, 67, 82,
+ 65, 89, 79, 78, 128, 67, 82, 65, 66, 128, 67, 82, 128, 67, 79, 88, 128,
+ 67, 79, 87, 66, 79, 217, 67, 79, 87, 128, 67, 79, 215, 67, 79, 86, 69,
+ 82, 73, 78, 199, 67, 79, 86, 69, 82, 128, 67, 79, 85, 80, 76, 197, 67,
+ 79, 85, 78, 84, 73, 78, 199, 67, 79, 85, 78, 84, 69, 82, 83, 73, 78, 75,
+ 128, 67, 79, 85, 78, 84, 69, 82, 66, 79, 82, 69, 128, 67, 79, 85, 78, 67,
+ 73, 204, 67, 79, 85, 67, 200, 67, 79, 84, 128, 67, 79, 82, 82, 69, 83,
+ 80, 79, 78, 68, 211, 67, 79, 82, 82, 69, 67, 84, 128, 67, 79, 82, 80, 83,
+ 69, 128, 67, 79, 82, 80, 79, 82, 65, 84, 73, 79, 78, 128, 67, 79, 82, 79,
+ 78, 73, 83, 128, 67, 79, 82, 78, 73, 83, 200, 67, 79, 82, 78, 69, 82, 83,
+ 128, 67, 79, 82, 78, 69, 82, 128, 67, 79, 82, 78, 69, 210, 67, 79, 82,
+ 75, 128, 67, 79, 82, 65, 76, 128, 67, 79, 80, 89, 82, 73, 71, 72, 84,
+ 128, 67, 79, 80, 89, 82, 73, 71, 72, 212, 67, 79, 80, 89, 76, 69, 70,
+ 212, 67, 79, 80, 89, 128, 67, 79, 80, 82, 79, 68, 85, 67, 84, 128, 67,
+ 79, 80, 80, 69, 82, 45, 50, 128, 67, 79, 80, 80, 69, 82, 128, 67, 79, 80,
+ 128, 67, 79, 79, 76, 128, 67, 79, 79, 75, 73, 78, 71, 128, 67, 79, 79,
+ 75, 73, 69, 128, 67, 79, 79, 75, 69, 196, 67, 79, 79, 128, 67, 79, 78,
+ 86, 69, 82, 71, 73, 78, 199, 67, 79, 78, 86, 69, 78, 73, 69, 78, 67, 197,
+ 67, 79, 78, 84, 82, 79, 76, 128, 67, 79, 78, 84, 82, 79, 204, 67, 79, 78,
+ 84, 82, 65, 82, 73, 69, 84, 89, 128, 67, 79, 78, 84, 82, 65, 67, 84, 73,
+ 79, 78, 128, 67, 79, 78, 84, 79, 85, 82, 69, 196, 67, 79, 78, 84, 79, 85,
+ 210, 67, 79, 78, 84, 73, 78, 85, 73, 78, 199, 67, 79, 78, 84, 73, 78, 85,
+ 65, 84, 73, 79, 206, 67, 79, 78, 84, 69, 78, 84, 73, 79, 78, 128, 67, 79,
+ 78, 84, 69, 77, 80, 76, 65, 84, 73, 79, 78, 128, 67, 79, 78, 84, 65, 73,
+ 78, 211, 67, 79, 78, 84, 65, 73, 78, 73, 78, 199, 67, 79, 78, 84, 65, 73,
+ 206, 67, 79, 78, 84, 65, 67, 84, 128, 67, 79, 78, 83, 84, 82, 85, 67, 84,
+ 73, 79, 78, 128, 67, 79, 78, 83, 84, 82, 85, 67, 84, 73, 79, 206, 67, 79,
+ 78, 83, 84, 65, 78, 84, 128, 67, 79, 78, 83, 84, 65, 78, 212, 67, 79, 78,
+ 83, 84, 65, 78, 67, 89, 128, 67, 79, 78, 83, 69, 67, 85, 84, 73, 86, 197,
+ 67, 79, 78, 74, 85, 78, 67, 84, 73, 79, 78, 128, 67, 79, 78, 74, 85, 71,
+ 65, 84, 197, 67, 79, 78, 74, 79, 73, 78, 73, 78, 199, 67, 79, 78, 74, 79,
+ 73, 78, 69, 82, 128, 67, 79, 78, 74, 79, 73, 78, 69, 68, 128, 67, 79, 78,
+ 74, 79, 73, 78, 69, 196, 67, 79, 78, 73, 67, 65, 204, 67, 79, 78, 71, 82,
+ 85, 69, 78, 212, 67, 79, 78, 71, 82, 65, 84, 85, 76, 65, 84, 73, 79, 78,
+ 128, 67, 79, 78, 70, 85, 83, 69, 196, 67, 79, 78, 70, 79, 85, 78, 68, 69,
+ 196, 67, 79, 78, 70, 76, 73, 67, 84, 128, 67, 79, 78, 70, 69, 84, 84,
+ 201, 67, 79, 78, 67, 65, 86, 69, 45, 83, 73, 68, 69, 196, 67, 79, 78, 67,
+ 65, 86, 69, 45, 80, 79, 73, 78, 84, 69, 196, 67, 79, 77, 80, 85, 84, 69,
+ 82, 83, 128, 67, 79, 77, 80, 85, 84, 69, 82, 128, 67, 79, 77, 80, 82, 69,
+ 83, 83, 73, 79, 78, 128, 67, 79, 77, 80, 82, 69, 83, 83, 69, 196, 67, 79,
+ 77, 80, 79, 83, 73, 84, 73, 79, 78, 128, 67, 79, 77, 80, 79, 83, 73, 84,
+ 73, 79, 206, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 54, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 54, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 54, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 54, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 54, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 54, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 54, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 54, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 54, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 53, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 53, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 53, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 53, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 53, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 53, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 53, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 53, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 53, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 53, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 52, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 52, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 52, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 52, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 52, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 52, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 52, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 52, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 52, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 52, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 51, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 51, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 51, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 51, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 51, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 51, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 51, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 51, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 51, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 51, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 50, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 50, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 50, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 50, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 50, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 50, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 50, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 50, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 50, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 50, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 49, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 49, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 49, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 49, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 49, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 49, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 49, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 49, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 49, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 49, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 48, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 55, 48, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 55, 48, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55,
+ 48, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 48, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 48, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 55, 48, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 55, 48, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 48, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 55, 48, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 57, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 57, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 57, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 57, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 57, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 57, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 57, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 57, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 57, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 57, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 56, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 56, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 56, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 56, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 56, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 56, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 56, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 56, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 56, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 56, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 55, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 55, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 55, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 55, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 55, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 55, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 55, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 55, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 55, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 55, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 54, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 54, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 54, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 54, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 54, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 54, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 54, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 54, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 54, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 54, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 53, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 53, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 53, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 53, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 53, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 53, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 53, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 53, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 53, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 53, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 52, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 52, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 52, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 52, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 52, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 52, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 52, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 52, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 52, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 52, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 51, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 51, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 51, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 51, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 51, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 51, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 51, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 51, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 51, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 51, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 50, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 50, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 50, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 50, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 50, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 50, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 50, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 50, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 50, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 50, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 49, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 49, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 49, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 49, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 49, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 49, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 49, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 49, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 49, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 49, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 48, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 54, 48, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54,
+ 48, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 48, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 48, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 54, 48, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 54, 48, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 48, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 54, 48, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 54, 48, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 57, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 57, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 57, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 57, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 57, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 57, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 57, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 57, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 57, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 57, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 56, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 56, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 56, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 56, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 56, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 56, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 56, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 56, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 56, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 56, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 55, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 55, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 55, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 55, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 55, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 55, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 55, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 55, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 55, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 55, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 54, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 54, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 54, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 54, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 54, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 54, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 54, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 54, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 54, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 54, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 53, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 53, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 53, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 53, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 53, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 53, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 53, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 53, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 53, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 53, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 52, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 52, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 52, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 52, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 52, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 52, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 52, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 52, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 52, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 52, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 51, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 51, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 51, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 51, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 51, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 51, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 51, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 51, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 51, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 51, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 50, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 50, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 50, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 50, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 50, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 50, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 50, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 50, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 50, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 50, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 49, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 49, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 49, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 49, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 49, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 49, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 49, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 49, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 49, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 49, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 48, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53,
+ 48, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 48, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 48, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 53, 48, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 53, 48, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 48, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 53, 48, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 53, 48, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 53, 48, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 57, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 57, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 57, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 57, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 57, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 57, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 57, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 57, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 57, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 57, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 56, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 56, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 56, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 56, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 56, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 56, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 56, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 56, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 56, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 56, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 55, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 55, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 55, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 55, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 55, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 55, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 55, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 55, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 55, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 55, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 54, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 54, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 54, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 54, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 54, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 54, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 54, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 54, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 54, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 54, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 53, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 53, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 53, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 53, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 53, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 53, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 53, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 53, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 53, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 53, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 52, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 52, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 52, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 52, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 52, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 52, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 52, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 52, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 52, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 52, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 51, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 51, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 51, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 51, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 51, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 51, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 51, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 51, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 51, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 51, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 50, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 50, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 50, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 50, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 50, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 50, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 50, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 50, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 50, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 50, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 49, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 49, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 49, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 49, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 49, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 49, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 49, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 49, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 49, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 49, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 48, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 48, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 48, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 52, 48, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 52, 48, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 48, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52, 48, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 52, 48, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 52, 48, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 52,
+ 48, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 57, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 57, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 57, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 57, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 57, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 57, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 57, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 57, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 57, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 57, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 56, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 56, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 56, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 56, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 56, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 56, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 56, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 56, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 56, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 56, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 55, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 55, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 55, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 55, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 55, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 55, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 55, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 55, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 55, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 55, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 54, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 54, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 54, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 54, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 54, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 54, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 54, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 54, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 54, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 54, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 53, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 53, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 53, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 53, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 53, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 53, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 53, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 53, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 53, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 53, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 52, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 52, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 52, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 52, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 52, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 52, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 52, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 52, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 52, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 52, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 51, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 51, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 51, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 51, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 51, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 51, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 51, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 51, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 51, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 51, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 50, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 50, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 50, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 50, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 50, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 50, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 50, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 50, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 50, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 50, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 49, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 49, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 49, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 49, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 49, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 49, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 49, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 49, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 49, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 49, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 48, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 48, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 51, 48, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 51, 48, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 48, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 48, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 51, 48, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 51, 48, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51,
+ 48, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 51, 48, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 57, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 57, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 57, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 57, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 57, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 57, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 57, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 57, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 57, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 57, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 56, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 56, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 56, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 56, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 56, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 56, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 56, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 56, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 56, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 56, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 55, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 55, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 55, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 55, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 55, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 55, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 55, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 55, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 55, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 55, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 54, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 54, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 54, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 54, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 54, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 54, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 54, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 54, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 54, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 54, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 53, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 53, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 53, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 53, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 53, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 53, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 53, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 53, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 53, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 53, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 52, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 52, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 52, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 52, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 52, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 52, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 52, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 52, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 52, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 52, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 51, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 51, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 51, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 51, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 51, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 51, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 51, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 51, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 51, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 51, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 50, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 50, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 50, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 50, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 50, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 50, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 50, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 50, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 50, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 50, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 49, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 49, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 49, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 49, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 49, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 49, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 49, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 49, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 49, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 49, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 48, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 50, 48, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 50, 48, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 48, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 48, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 50, 48, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 50, 48, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50,
+ 48, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 48, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 50, 48, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 57, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 57, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 57, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 57, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 57, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 57, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 57, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 57, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 57, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 57, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 56, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 56, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 56, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 56, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 56, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 56, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 56, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 56, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 56, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 56, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 55, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 55, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 55, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 55, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 55, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 55, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 55, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 55, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 55, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 55, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 54, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 54, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 54, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 54, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 54, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 54, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 54, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 54, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 54, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 54, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 53, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 53, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 53, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 53, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 53, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 53, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 53, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 53, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 53, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 53, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 52, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 52, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 52, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 52, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 52, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 52, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 52, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 52, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 52, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 52, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 51, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 51, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 51, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 51, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 51, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 51, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 51, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 51, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 51, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 51, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 50, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 50, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 50, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 50, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 50, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 50, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 50, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 50, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 50, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 50, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 49, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 49, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 49, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 49, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 49, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 49, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 49, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 49, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 49, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 49, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 48, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 49, 48, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 48, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 48, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 49, 48, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 49, 48, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49,
+ 48, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 48, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 49, 48, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 49, 48, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 57, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 57, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 57, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 57, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 57, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 57, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 57, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 57, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 57, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 57, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 56, 57,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 56, 56, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 56, 55, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 56, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 56, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 56, 52, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 56, 51, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 56, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 56, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 56, 48,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 55, 57, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 55, 56, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 55, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 55, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 55, 53, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 55, 52, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 55, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 55, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 55, 49,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 55, 48, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 54, 57, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 54, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 54, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 54, 54, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 54, 53, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 54, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 54, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 54, 50,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 54, 49, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 54, 48, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 53, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 53, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 53, 55, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 53, 54, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 53, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 53, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 53, 51,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 53, 50, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 53, 49, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 53, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 52, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 52, 56, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 52, 55, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 52, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 52, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 52, 52,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 52, 51, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 52, 50, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 52, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 52, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 51, 57, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 51, 56, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 51, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 51, 54, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 51, 53,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 51, 52, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 51, 51, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 51, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 51, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 51, 48, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 50, 57, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 50, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 50, 55, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 50, 54,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 50, 53, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 50, 52, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 50, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 50, 50, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 50, 49, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 50, 48, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 49, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 49, 56, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 49, 55,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 49, 54, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 49, 53, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 49, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 49, 51, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 49, 50, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 49, 49, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 49, 48, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84,
+ 45, 48, 48, 57, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 48, 56,
+ 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 48, 55, 128, 67, 79, 77,
+ 80, 79, 78, 69, 78, 84, 45, 48, 48, 54, 128, 67, 79, 77, 80, 79, 78, 69,
+ 78, 84, 45, 48, 48, 53, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48,
+ 48, 52, 128, 67, 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 48, 51, 128, 67,
+ 79, 77, 80, 79, 78, 69, 78, 84, 45, 48, 48, 50, 128, 67, 79, 77, 80, 79,
+ 78, 69, 78, 84, 45, 48, 48, 49, 128, 67, 79, 77, 80, 79, 78, 69, 78, 212,
+ 67, 79, 77, 80, 76, 73, 65, 78, 67, 69, 128, 67, 79, 77, 80, 76, 69, 84,
+ 73, 79, 78, 128, 67, 79, 77, 80, 76, 69, 84, 69, 68, 128, 67, 79, 77, 80,
+ 76, 69, 77, 69, 78, 84, 128, 67, 79, 77, 80, 65, 83, 83, 128, 67, 79, 77,
+ 80, 65, 82, 69, 128, 67, 79, 77, 77, 79, 206, 67, 79, 77, 77, 69, 82, 67,
+ 73, 65, 204, 67, 79, 77, 77, 65, 78, 68, 128, 67, 79, 77, 77, 65, 128,
+ 67, 79, 77, 77, 193, 67, 79, 77, 69, 84, 128, 67, 79, 77, 66, 73, 78, 69,
+ 68, 128, 67, 79, 77, 66, 73, 78, 65, 84, 73, 79, 78, 128, 67, 79, 77, 66,
+ 128, 67, 79, 76, 85, 77, 78, 128, 67, 79, 76, 79, 82, 128, 67, 79, 76,
+ 76, 73, 83, 73, 79, 206, 67, 79, 76, 76, 128, 67, 79, 76, 196, 67, 79,
+ 73, 78, 128, 67, 79, 70, 70, 73, 78, 128, 67, 79, 69, 78, 71, 128, 67,
+ 79, 69, 78, 199, 67, 79, 68, 65, 128, 67, 79, 67, 79, 78, 85, 84, 128,
+ 67, 79, 67, 75, 84, 65, 73, 204, 67, 79, 67, 75, 82, 79, 65, 67, 72, 128,
+ 67, 79, 65, 84, 128, 67, 79, 65, 83, 84, 69, 82, 128, 67, 79, 65, 128,
+ 67, 77, 51, 48, 50, 128, 67, 77, 51, 48, 49, 128, 67, 77, 49, 49, 52,
+ 128, 67, 77, 49, 49, 50, 128, 67, 77, 49, 49, 48, 128, 67, 77, 49, 48,
+ 57, 128, 67, 77, 49, 48, 56, 128, 67, 77, 49, 48, 55, 128, 67, 77, 49,
+ 48, 53, 128, 67, 77, 49, 48, 52, 128, 67, 77, 49, 48, 51, 128, 67, 77,
+ 49, 48, 50, 128, 67, 77, 49, 48, 49, 128, 67, 77, 49, 48, 48, 128, 67,
+ 77, 48, 57, 57, 128, 67, 77, 48, 57, 56, 128, 67, 77, 48, 57, 55, 128,
+ 67, 77, 48, 57, 54, 128, 67, 77, 48, 57, 53, 128, 67, 77, 48, 57, 52,
+ 128, 67, 77, 48, 57, 50, 128, 67, 77, 48, 57, 49, 128, 67, 77, 48, 57,
+ 48, 128, 67, 77, 48, 56, 57, 128, 67, 77, 48, 56, 56, 128, 67, 77, 48,
+ 56, 55, 128, 67, 77, 48, 56, 54, 128, 67, 77, 48, 56, 53, 128, 67, 77,
+ 48, 56, 52, 128, 67, 77, 48, 56, 51, 128, 67, 77, 48, 56, 50, 128, 67,
+ 77, 48, 56, 49, 128, 67, 77, 48, 56, 48, 128, 67, 77, 48, 55, 57, 128,
+ 67, 77, 48, 55, 56, 128, 67, 77, 48, 55, 54, 128, 67, 77, 48, 55, 53, 66,
+ 128, 67, 77, 48, 55, 53, 128, 67, 77, 48, 55, 52, 128, 67, 77, 48, 55,
+ 51, 128, 67, 77, 48, 55, 50, 128, 67, 77, 48, 55, 49, 128, 67, 77, 48,
+ 55, 48, 128, 67, 77, 48, 54, 57, 128, 67, 77, 48, 54, 56, 128, 67, 77,
+ 48, 54, 55, 128, 67, 77, 48, 54, 54, 128, 67, 77, 48, 54, 52, 128, 67,
+ 77, 48, 54, 51, 128, 67, 77, 48, 54, 50, 128, 67, 77, 48, 54, 49, 128,
+ 67, 77, 48, 54, 48, 128, 67, 77, 48, 53, 57, 128, 67, 77, 48, 53, 56,
+ 128, 67, 77, 48, 53, 54, 128, 67, 77, 48, 53, 53, 128, 67, 77, 48, 53,
+ 52, 128, 67, 77, 48, 53, 51, 128, 67, 77, 48, 53, 50, 128, 67, 77, 48,
+ 53, 49, 128, 67, 77, 48, 53, 48, 128, 67, 77, 48, 52, 57, 128, 67, 77,
+ 48, 52, 55, 128, 67, 77, 48, 52, 54, 128, 67, 77, 48, 52, 52, 128, 67,
+ 77, 48, 52, 49, 128, 67, 77, 48, 52, 48, 128, 67, 77, 48, 51, 57, 128,
+ 67, 77, 48, 51, 56, 128, 67, 77, 48, 51, 55, 128, 67, 77, 48, 51, 54,
+ 128, 67, 77, 48, 51, 53, 128, 67, 77, 48, 51, 52, 128, 67, 77, 48, 51,
+ 51, 128, 67, 77, 48, 51, 48, 128, 67, 77, 48, 50, 57, 128, 67, 77, 48,
+ 50, 56, 128, 67, 77, 48, 50, 55, 128, 67, 77, 48, 50, 54, 128, 67, 77,
+ 48, 50, 53, 128, 67, 77, 48, 50, 52, 128, 67, 77, 48, 50, 51, 128, 67,
+ 77, 48, 50, 49, 128, 67, 77, 48, 49, 57, 128, 67, 77, 48, 49, 55, 128,
+ 67, 77, 48, 49, 53, 128, 67, 77, 48, 49, 51, 128, 67, 77, 48, 49, 50, 66,
+ 128, 67, 77, 48, 49, 50, 128, 67, 77, 48, 49, 49, 128, 67, 77, 48, 49,
+ 48, 128, 67, 77, 48, 48, 57, 128, 67, 77, 48, 48, 56, 128, 67, 77, 48,
+ 48, 55, 128, 67, 77, 48, 48, 54, 128, 67, 77, 48, 48, 53, 128, 67, 77,
+ 48, 48, 52, 128, 67, 77, 48, 48, 50, 128, 67, 77, 48, 48, 49, 128, 67,
+ 77, 128, 67, 205, 67, 76, 85, 83, 84, 69, 82, 45, 73, 78, 73, 84, 73, 65,
+ 204, 67, 76, 85, 83, 84, 69, 82, 45, 70, 73, 78, 65, 204, 67, 76, 85, 83,
+ 84, 69, 210, 67, 76, 85, 66, 83, 128, 67, 76, 85, 66, 45, 83, 80, 79, 75,
+ 69, 196, 67, 76, 85, 66, 128, 67, 76, 85, 194, 67, 76, 79, 87, 206, 67,
+ 76, 79, 86, 69, 82, 128, 67, 76, 79, 85, 68, 128, 67, 76, 79, 85, 196,
+ 67, 76, 79, 84, 72, 69, 83, 128, 67, 76, 79, 84, 72, 128, 67, 76, 79, 83,
+ 69, 84, 128, 67, 76, 79, 83, 69, 78, 69, 83, 83, 128, 67, 76, 79, 83, 69,
+ 68, 128, 67, 76, 79, 83, 197, 67, 76, 79, 67, 75, 87, 73, 83, 197, 67,
+ 76, 79, 67, 203, 67, 76, 73, 86, 73, 83, 128, 67, 76, 73, 80, 66, 79, 65,
+ 82, 68, 128, 67, 76, 73, 78, 75, 73, 78, 199, 67, 76, 73, 78, 71, 73, 78,
+ 199, 67, 76, 73, 77, 66, 73, 78, 71, 128, 67, 76, 73, 77, 65, 67, 85, 83,
+ 128, 67, 76, 73, 70, 70, 128, 67, 76, 73, 67, 75, 128, 67, 76, 73, 67,
+ 203, 67, 76, 69, 70, 45, 50, 128, 67, 76, 69, 70, 45, 49, 128, 67, 76,
+ 69, 70, 128, 67, 76, 69, 198, 67, 76, 69, 65, 86, 69, 82, 128, 67, 76,
+ 69, 65, 210, 67, 76, 65, 83, 83, 73, 67, 65, 204, 67, 76, 65, 80, 80, 73,
+ 78, 199, 67, 76, 65, 80, 80, 69, 210, 67, 76, 65, 78, 128, 67, 76, 65,
+ 206, 67, 76, 65, 77, 83, 72, 69, 76, 204, 67, 76, 65, 73, 77, 128, 67,
+ 76, 128, 67, 73, 88, 128, 67, 73, 86, 73, 76, 73, 65, 78, 128, 67, 73,
+ 84, 89, 83, 67, 65, 80, 69, 128, 67, 73, 84, 89, 83, 67, 65, 80, 197, 67,
+ 73, 84, 201, 67, 73, 84, 65, 84, 73, 79, 206, 67, 73, 84, 128, 67, 73,
+ 82, 67, 85, 211, 67, 73, 82, 67, 85, 77, 70, 76, 69, 88, 128, 67, 73, 82,
+ 67, 85, 77, 70, 76, 69, 216, 67, 73, 82, 67, 85, 76, 65, 84, 73, 79, 206,
+ 67, 73, 82, 67, 76, 73, 78, 71, 128, 67, 73, 82, 67, 76, 73, 78, 199, 67,
+ 73, 82, 67, 76, 69, 83, 128, 67, 73, 82, 67, 76, 69, 211, 67, 73, 82, 67,
+ 76, 69, 68, 128, 67, 73, 80, 128, 67, 73, 78, 78, 65, 66, 65, 82, 128,
+ 67, 73, 78, 69, 77, 65, 128, 67, 73, 206, 67, 73, 77, 128, 67, 73, 205,
+ 67, 73, 73, 128, 67, 73, 69, 88, 128, 67, 73, 69, 85, 67, 45, 83, 83, 65,
+ 78, 71, 80, 73, 69, 85, 80, 128, 67, 73, 69, 85, 67, 45, 80, 73, 69, 85,
+ 80, 128, 67, 73, 69, 85, 67, 45, 73, 69, 85, 78, 71, 128, 67, 73, 69, 85,
+ 195, 67, 73, 69, 84, 128, 67, 73, 69, 80, 128, 67, 73, 69, 128, 67, 72,
+ 89, 88, 128, 67, 72, 89, 84, 128, 67, 72, 89, 82, 88, 128, 67, 72, 89,
+ 82, 128, 67, 72, 89, 80, 128, 67, 72, 87, 86, 128, 67, 72, 85, 88, 128,
+ 67, 72, 85, 82, 88, 128, 67, 72, 85, 82, 67, 72, 128, 67, 72, 85, 82,
+ 128, 67, 72, 85, 80, 128, 67, 72, 85, 79, 88, 128, 67, 72, 85, 79, 84,
+ 128, 67, 72, 85, 79, 80, 128, 67, 72, 85, 79, 128, 67, 72, 85, 76, 65,
+ 128, 67, 72, 85, 128, 67, 72, 82, 89, 83, 65, 78, 84, 72, 69, 77, 85, 77,
+ 128, 67, 72, 82, 79, 78, 79, 85, 128, 67, 72, 82, 79, 78, 79, 78, 128,
+ 67, 72, 82, 79, 77, 193, 67, 72, 82, 79, 193, 67, 72, 82, 73, 86, 73,
+ 128, 67, 72, 82, 73, 83, 84, 77, 65, 83, 128, 67, 72, 82, 73, 83, 84, 77,
+ 65, 211, 67, 72, 79, 89, 128, 67, 72, 79, 88, 128, 67, 72, 79, 84, 128,
+ 67, 72, 79, 82, 69, 86, 77, 193, 67, 72, 79, 82, 65, 83, 77, 73, 65, 206,
+ 67, 72, 79, 80, 83, 84, 73, 67, 75, 83, 128, 67, 72, 79, 80, 128, 67, 72,
+ 79, 75, 69, 128, 67, 72, 79, 69, 128, 67, 72, 79, 67, 79, 76, 65, 84,
+ 197, 67, 72, 79, 65, 128, 67, 72, 73, 84, 85, 69, 85, 77, 83, 83, 65, 78,
+ 71, 83, 73, 79, 83, 128, 67, 72, 73, 84, 85, 69, 85, 77, 83, 83, 65, 78,
+ 71, 67, 73, 69, 85, 67, 128, 67, 72, 73, 84, 85, 69, 85, 77, 83, 73, 79,
+ 83, 128, 67, 72, 73, 84, 85, 69, 85, 77, 67, 73, 69, 85, 67, 128, 67, 72,
+ 73, 84, 85, 69, 85, 77, 67, 72, 73, 69, 85, 67, 72, 128, 67, 72, 73, 82,
+ 79, 78, 128, 67, 72, 73, 82, 69, 84, 128, 67, 72, 73, 80, 77, 85, 78, 75,
+ 128, 67, 72, 73, 78, 79, 79, 203, 67, 72, 73, 78, 71, 128, 67, 72, 73,
+ 78, 69, 83, 197, 67, 72, 73, 78, 128, 67, 72, 73, 77, 69, 128, 67, 72,
+ 73, 77, 128, 67, 72, 73, 76, 76, 213, 67, 72, 73, 76, 68, 82, 69, 206,
+ 67, 72, 73, 76, 68, 128, 67, 72, 73, 76, 128, 67, 72, 73, 75, 201, 67,
+ 72, 73, 69, 85, 67, 72, 45, 75, 72, 73, 69, 85, 75, 72, 128, 67, 72, 73,
+ 69, 85, 67, 72, 45, 72, 73, 69, 85, 72, 128, 67, 72, 73, 69, 85, 67, 200,
+ 67, 72, 73, 67, 75, 69, 78, 128, 67, 72, 73, 67, 75, 128, 67, 72, 73,
+ 128, 67, 72, 201, 67, 72, 72, 73, 77, 128, 67, 72, 72, 65, 128, 67, 72,
+ 69, 88, 128, 67, 72, 69, 86, 82, 79, 78, 128, 67, 72, 69, 86, 82, 79,
+ 206, 67, 72, 69, 84, 128, 67, 72, 69, 83, 84, 78, 85, 84, 128, 67, 72,
+ 69, 83, 84, 128, 67, 72, 69, 83, 211, 67, 72, 69, 82, 89, 128, 67, 72,
+ 69, 82, 82, 217, 67, 72, 69, 82, 82, 73, 69, 83, 128, 67, 72, 69, 81, 85,
+ 69, 82, 69, 196, 67, 72, 69, 80, 128, 67, 72, 69, 76, 89, 85, 83, 84, 75,
+ 65, 128, 67, 72, 69, 76, 78, 85, 128, 67, 72, 69, 73, 78, 65, 80, 128,
+ 67, 72, 69, 73, 75, 72, 69, 73, 128, 67, 72, 69, 73, 75, 72, 65, 78, 128,
+ 67, 72, 69, 69, 83, 197, 67, 72, 69, 69, 82, 73, 78, 199, 67, 72, 69, 69,
+ 77, 128, 67, 72, 69, 69, 75, 211, 67, 72, 69, 69, 75, 128, 67, 72, 69,
+ 69, 128, 67, 72, 69, 67, 75, 69, 210, 67, 72, 69, 67, 75, 128, 67, 72,
+ 69, 67, 203, 67, 72, 197, 67, 72, 65, 88, 128, 67, 72, 65, 86, 73, 89,
+ 65, 78, 73, 128, 67, 72, 65, 84, 84, 65, 87, 65, 128, 67, 72, 65, 84,
+ 128, 67, 72, 65, 83, 72, 75, 65, 128, 67, 72, 65, 83, 72, 75, 193, 67,
+ 72, 65, 82, 84, 128, 67, 72, 65, 82, 212, 67, 72, 65, 82, 73, 79, 84,
+ 128, 67, 72, 65, 82, 73, 79, 212, 67, 72, 65, 82, 65, 67, 84, 69, 82, 83,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 66, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 65, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 57, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 70, 56, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 70, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 70, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 70, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 70, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 51,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 50, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 49, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 70, 48, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 69, 70, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 69, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 69, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 69, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 69, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 69, 65,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 69, 57, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 69, 56, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 69, 55, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 69, 54, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 69, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 69, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 69, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 69, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 69, 49,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 69, 48, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 68, 70, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 68, 69, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 68, 68, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 68, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 68, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 68, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 68, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 68, 56,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 68, 55, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 68, 54, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 68, 53, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 68, 52, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 68, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 68, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 68, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 68, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 70,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 69, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 68, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 67, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 67, 66, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 67, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 67, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 67, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 67, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 54,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 67, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 67, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 67, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 67, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 66, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 66, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 66, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 66, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 66, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 66, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 66, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 66, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 66, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 65, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 65, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 65, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 65, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 65, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 65, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 65, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 65, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 65, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 65, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 57, 70, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 57, 69, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 57, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 57, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 57, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 57, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 57, 57,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 57, 56, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 57, 55, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 57, 54, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 57, 53, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 57, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 57, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 57, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 57, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 57, 48,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 70, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 69, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 68, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 56, 67, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 56, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 56, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 56, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 56, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 55,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 54, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 53, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 56, 52, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 56, 51, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 56, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 56, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 56, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 55, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 69,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 68, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 67, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 66, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 55, 65, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 55, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 55, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 55, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 55, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 53,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 52, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 51, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 55, 50, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 55, 49, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 55, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 54, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 54, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 54, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 67,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 66, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 65, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 57, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 54, 56, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 54, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 54, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 54, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 54, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 51,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 50, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 49, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 54, 48, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 53, 70, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 53, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 53, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 53, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 53, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 53, 65,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 53, 57, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 53, 56, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 53, 55, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 53, 54, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 53, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 53, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 53, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 53, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 53, 49,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 53, 48, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 52, 70, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 52, 69, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 52, 68, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 52, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 52, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 52, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 52, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 52, 56,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 52, 55, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 52, 54, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 52, 53, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 52, 52, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 52, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 52, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 52, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 52, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 70,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 69, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 68, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 67, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 51, 66, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 51, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 51, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 51, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 51, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 54,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 51, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 51, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 51, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 51, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 50, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 50, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 50, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 50, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 50, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 50, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 50, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 50, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 50, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 49, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 49, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 49, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 49, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 49, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 49, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 49, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 49, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 49, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 49, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 48, 70, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 48, 69, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 48, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 48, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 48, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 48, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 48, 57,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 48, 56, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 48, 55, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 48, 54, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 50, 48, 53, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 50, 48, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 50, 48, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 50, 48, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50,
+ 48, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 50, 48, 48,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 70, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 69, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 68, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 70, 67, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 70, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 70, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 70, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 70, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 55,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 54, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 53, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 70, 52, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 70, 51, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 70, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 70, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 70, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 69, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 69,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 68, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 67, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 66, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 69, 65, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 69, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 69, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 69, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 69, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 53,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 52, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 51, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 69, 50, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 69, 49, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 69, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 68, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 68, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 68, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 67,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 66, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 65, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 57, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 68, 56, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 68, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 68, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 68, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 68, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 51,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 50, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 49, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 68, 48, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 67, 70, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 67, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 67, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 67, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 67, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 67, 65,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 67, 57, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 67, 56, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 67, 55, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 67, 54, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 67, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 67, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 67, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 67, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 67, 49,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 67, 48, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 66, 70, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 66, 69, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 66, 68, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 66, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 66, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 66, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 66, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 66, 56,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 66, 55, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 66, 54, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 66, 53, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 66, 52, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 66, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 66, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 66, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 66, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 70,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 69, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 68, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 67, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 65, 66, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 65, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 65, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 65, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 65, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 54,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 65, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 65, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 65, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 65, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 57, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 57, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 57, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 57, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 57, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 57, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 57, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 57, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 57, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 56, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 56, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 56, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 56, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 56, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 56, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 56, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 56, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 56, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 56, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 55, 70, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 55, 69, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 55, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 55, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 55, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 55, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 55, 57,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 55, 56, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 55, 55, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 55, 54, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 66, 49, 55, 53, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 66, 49, 55, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 66, 49, 55, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 66, 49, 55, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49,
+ 55, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 66, 49, 55, 48,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 68, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 68, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 68, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 68, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 68, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 68, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 67, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 67, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 67, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 67, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 67, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 67, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 67, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 67, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 67, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 66, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 66, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 66, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 66, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 66, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 66, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 66, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 66, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 66, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 66, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 65, 70, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 65, 69, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 65, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 65, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 65, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 65, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 65, 57,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 65, 56, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 65, 55, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 65, 54, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 65, 53, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 65, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 65, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 65, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 65, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 65, 48,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 70, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 69, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 68, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 57, 67, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 57, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 57, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 57, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 57, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 55,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 54, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 53, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 57, 52, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 57, 51, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 57, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 57, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 57, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 56, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 69,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 68, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 67, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 66, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 56, 65, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 56, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 56, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 56, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 56, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 53,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 52, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 51, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 56, 50, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 56, 49, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 56, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 55, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 55, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 55, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 67,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 66, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 65, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 57, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 55, 56, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 55, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 55, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 55, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 55, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 51,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 50, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 49, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 55, 48, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 54, 70, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 54, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 54, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 54, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 54, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 54, 65,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 54, 57, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 54, 56, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 54, 55, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 54, 54, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 54, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 54, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 54, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 54, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 54, 49,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 54, 48, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 53, 70, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 53, 69, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 53, 68, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 53, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 53, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 53, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 53, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 53, 56,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 53, 55, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 53, 54, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 53, 53, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 53, 52, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 53, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 53, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 53, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 53, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 70,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 69, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 68, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 67, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 52, 66, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 52, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 52, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 52, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 52, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 54,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 52, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 52, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 52, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 52, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 51, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 51, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 51, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 51, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 51, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 51, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 51, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 51, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 51, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 50, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 50, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 50, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 50, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 50, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 50, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 50, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 50, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 50, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 50, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 49, 70, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 49, 69, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 49, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 49, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 49, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 49, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 49, 57,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 49, 56, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 49, 55, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 49, 54, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 49, 53, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 49, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 49, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 49, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 49, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 49, 48,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 70, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 69, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 68, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 48, 67, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 48, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 48, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 48, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67,
+ 48, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 55,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 54, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 53, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 67, 48, 52, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 67, 48, 51, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 67, 48, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 67, 48, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 67, 48, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 70, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 69,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 68, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 67, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 66, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 70, 65, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 70, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 70, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 70, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 70, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 53,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 52, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 51, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 70, 50, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 70, 49, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 70, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 69, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 69, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 69, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 67,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 66, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 65, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 57, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 69, 56, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 69, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 69, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 69, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 69, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 51,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 50, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 49, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 69, 48, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 68, 70, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 68, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 68, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 68, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 68, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 68, 65,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 68, 57, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 68, 56, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 68, 55, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 68, 54, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 68, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 68, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 68, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 68, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 68, 49,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 68, 48, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 67, 70, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 67, 69, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 67, 68, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 67, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 67, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 67, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 67, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 67, 56,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 67, 55, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 67, 54, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 67, 53, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 67, 52, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 67, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 67, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 67, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 67, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 70,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 69, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 68, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 67, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 66, 66, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 66, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 66, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 66, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 66, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 54,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 66, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 66, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 66, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 66, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 65, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 65, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 65, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 65, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 65, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 65, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 65, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 65, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 65, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 57, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 57, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 57, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 57, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 57, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 57, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 57, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 57, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 57, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 57, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 56, 70, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 56, 69, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 56, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 56, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 56, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 56, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 56, 57,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 56, 56, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 56, 55, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 56, 54, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 56, 53, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 56, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 56, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 56, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 56, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 56, 48,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 70, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 69, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 68, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 55, 67, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 55, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 55, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 55, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 55, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 55,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 54, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 53, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 55, 52, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 55, 51, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 55, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 55, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 55, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 54, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 69,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 68, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 67, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 66, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 54, 65, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 54, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 54, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 54, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 54, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 53,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 52, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 51, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 54, 50, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 54, 49, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 54, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 53, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 53, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 53, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 67,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 66, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 65, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 57, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 53, 56, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 53, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 53, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 53, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 53, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 51,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 50, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 49, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 53, 48, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 52, 70, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 52, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 52, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 52, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 52, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 52, 65,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 52, 57, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 52, 56, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 52, 55, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 52, 54, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 52, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 52, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 52, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 52, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 52, 49,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 52, 48, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 51, 70, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 51, 69, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 51, 68, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 51, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 51, 66, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 51, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 51, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 51, 56,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 51, 55, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 51, 54, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 51, 53, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 51, 52, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 51, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 51, 50, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 51, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 51, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 70,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 69, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 68, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 67, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 50, 66, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 50, 65, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 50, 57, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 50, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 50, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 54,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 53, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 52, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 50, 51, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 50, 50, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 50, 49, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 50, 48, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 49, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 49, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 68,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 67, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 66, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 65, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 49, 57, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 49, 56, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 49, 55, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 49, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 49, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 52,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 51, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 50, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 49, 49, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 49, 48, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 48, 70, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 48, 69, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 48, 68, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 48, 67, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 66,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 65, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 57, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 56, 128, 67, 72, 65, 82, 65,
+ 67, 84, 69, 82, 45, 49, 56, 66, 48, 55, 128, 67, 72, 65, 82, 65, 67, 84,
+ 69, 82, 45, 49, 56, 66, 48, 54, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82,
+ 45, 49, 56, 66, 48, 53, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49,
+ 56, 66, 48, 52, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66,
+ 48, 51, 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 50,
+ 128, 67, 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 49, 128, 67,
+ 72, 65, 82, 65, 67, 84, 69, 82, 45, 49, 56, 66, 48, 48, 128, 67, 72, 65,
+ 82, 65, 67, 84, 69, 82, 128, 67, 72, 65, 82, 65, 67, 84, 69, 210, 67, 72,
+ 65, 82, 128, 67, 72, 65, 80, 84, 69, 82, 128, 67, 72, 65, 80, 128, 67,
+ 72, 65, 78, 71, 128, 67, 72, 65, 78, 128, 67, 72, 65, 77, 75, 79, 128,
+ 67, 72, 65, 77, 73, 76, 79, 78, 128, 67, 72, 65, 77, 73, 76, 73, 128, 67,
+ 72, 65, 205, 67, 72, 65, 75, 77, 193, 67, 72, 65, 73, 78, 83, 128, 67,
+ 72, 65, 68, 65, 128, 67, 72, 65, 196, 67, 72, 65, 65, 128, 67, 71, 74,
+ 128, 67, 69, 88, 128, 67, 69, 86, 73, 84, 85, 128, 67, 69, 82, 69, 83,
+ 128, 67, 69, 82, 69, 77, 79, 78, 89, 128, 67, 69, 82, 69, 75, 128, 67,
+ 69, 82, 45, 87, 65, 128, 67, 69, 80, 128, 67, 69, 79, 78, 71, 67, 72, 73,
+ 69, 85, 77, 83, 83, 65, 78, 71, 83, 73, 79, 83, 128, 67, 69, 79, 78, 71,
+ 67, 72, 73, 69, 85, 77, 83, 83, 65, 78, 71, 67, 73, 69, 85, 67, 128, 67,
+ 69, 79, 78, 71, 67, 72, 73, 69, 85, 77, 83, 73, 79, 83, 128, 67, 69, 79,
+ 78, 71, 67, 72, 73, 69, 85, 77, 67, 73, 69, 85, 67, 128, 67, 69, 79, 78,
+ 71, 67, 72, 73, 69, 85, 77, 67, 72, 73, 69, 85, 67, 72, 128, 67, 69, 78,
+ 84, 85, 82, 73, 65, 204, 67, 69, 78, 84, 82, 69, 76, 73, 78, 197, 67, 69,
+ 78, 84, 82, 69, 68, 128, 67, 69, 78, 84, 82, 69, 196, 67, 69, 78, 84, 82,
+ 69, 128, 67, 69, 78, 84, 82, 197, 67, 69, 78, 84, 82, 65, 76, 73, 90, 65,
+ 84, 73, 79, 206, 67, 69, 78, 128, 67, 69, 76, 84, 73, 195, 67, 69, 76,
+ 83, 73, 85, 83, 128, 67, 69, 76, 69, 66, 82, 65, 84, 73, 79, 78, 128, 67,
+ 69, 73, 82, 84, 128, 67, 69, 73, 76, 73, 78, 71, 128, 67, 69, 73, 76, 73,
+ 78, 199, 67, 69, 69, 86, 128, 67, 69, 69, 66, 128, 67, 69, 69, 128, 67,
+ 69, 68, 73, 76, 76, 65, 128, 67, 69, 68, 73, 76, 76, 193, 67, 69, 68,
+ 201, 67, 69, 67, 69, 75, 128, 67, 69, 67, 65, 75, 128, 67, 69, 67, 65,
+ 203, 67, 69, 65, 76, 67, 128, 67, 67, 85, 128, 67, 67, 79, 128, 67, 67,
+ 73, 128, 67, 67, 72, 85, 128, 67, 67, 72, 79, 128, 67, 67, 72, 73, 128,
+ 67, 67, 72, 72, 85, 128, 67, 67, 72, 72, 79, 128, 67, 67, 72, 72, 73,
+ 128, 67, 67, 72, 72, 69, 69, 128, 67, 67, 72, 72, 69, 128, 67, 67, 72,
+ 72, 65, 65, 128, 67, 67, 72, 72, 65, 128, 67, 67, 72, 69, 69, 128, 67,
+ 67, 72, 69, 128, 67, 67, 72, 65, 65, 128, 67, 67, 72, 65, 128, 67, 67,
+ 72, 128, 67, 67, 69, 69, 128, 67, 67, 65, 65, 128, 67, 65, 89, 78, 128,
+ 67, 65, 89, 65, 78, 78, 65, 128, 67, 65, 88, 128, 67, 65, 86, 69, 128,
+ 67, 65, 85, 84, 73, 79, 206, 67, 65, 85, 76, 68, 82, 79, 78, 128, 67, 65,
+ 85, 68, 65, 84, 197, 67, 65, 85, 68, 65, 128, 67, 65, 85, 67, 65, 83, 73,
+ 65, 206, 67, 65, 85, 128, 67, 65, 84, 65, 87, 65, 128, 67, 65, 84, 128,
+ 67, 65, 212, 67, 65, 83, 84, 76, 69, 128, 67, 65, 83, 75, 69, 212, 67,
+ 65, 82, 89, 83, 84, 73, 65, 206, 67, 65, 82, 84, 87, 72, 69, 69, 76, 128,
+ 67, 65, 82, 84, 82, 73, 68, 71, 69, 128, 67, 65, 82, 84, 128, 67, 65, 82,
+ 211, 67, 65, 82, 82, 79, 84, 128, 67, 65, 82, 82, 73, 65, 71, 197, 67,
+ 65, 82, 80, 69, 78, 84, 82, 217, 67, 65, 82, 208, 67, 65, 82, 79, 85, 83,
+ 69, 204, 67, 65, 82, 79, 78, 128, 67, 65, 82, 79, 206, 67, 65, 82, 73,
+ 203, 67, 65, 82, 73, 65, 206, 67, 65, 82, 69, 84, 128, 67, 65, 82, 69,
+ 212, 67, 65, 82, 197, 67, 65, 82, 68, 83, 128, 67, 65, 82, 196, 67, 65,
+ 82, 128, 67, 65, 210, 67, 65, 80, 85, 212, 67, 65, 80, 84, 73, 86, 69,
+ 128, 67, 65, 80, 82, 73, 67, 79, 82, 78, 128, 67, 65, 80, 80, 69, 196,
+ 67, 65, 80, 79, 128, 67, 65, 80, 73, 84, 85, 76, 85, 77, 128, 67, 65, 80,
+ 73, 84, 65, 76, 128, 67, 65, 78, 84, 73, 76, 76, 65, 84, 73, 79, 206, 67,
+ 65, 78, 79, 69, 128, 67, 65, 78, 78, 79, 78, 128, 67, 65, 78, 78, 69,
+ 196, 67, 65, 78, 199, 67, 65, 78, 69, 128, 67, 65, 78, 68, 89, 128, 67,
+ 65, 78, 68, 82, 65, 66, 73, 78, 68, 85, 128, 67, 65, 78, 68, 82, 65, 66,
+ 73, 78, 68, 213, 67, 65, 78, 68, 82, 65, 128, 67, 65, 78, 68, 82, 193,
+ 67, 65, 78, 68, 76, 69, 128, 67, 65, 78, 67, 69, 82, 128, 67, 65, 78, 67,
+ 69, 76, 76, 65, 84, 73, 79, 206, 67, 65, 78, 67, 69, 76, 128, 67, 65, 78,
+ 67, 69, 204, 67, 65, 78, 128, 67, 65, 77, 80, 73, 78, 71, 128, 67, 65,
+ 77, 78, 85, 195, 67, 65, 77, 69, 82, 65, 128, 67, 65, 77, 69, 82, 193,
+ 67, 65, 77, 69, 76, 128, 67, 65, 76, 89, 65, 128, 67, 65, 76, 89, 193,
+ 67, 65, 76, 88, 128, 67, 65, 76, 76, 128, 67, 65, 76, 204, 67, 65, 76,
+ 69, 78, 68, 65, 82, 128, 67, 65, 76, 69, 78, 68, 65, 210, 67, 65, 76, 67,
+ 85, 76, 65, 84, 79, 82, 128, 67, 65, 76, 67, 128, 67, 65, 75, 82, 65,
+ 128, 67, 65, 75, 197, 67, 65, 73, 128, 67, 65, 72, 128, 67, 65, 69, 83,
+ 85, 82, 65, 128, 67, 65, 68, 85, 67, 69, 85, 83, 128, 67, 65, 68, 193,
+ 67, 65, 67, 84, 85, 83, 128, 67, 65, 66, 76, 69, 87, 65, 89, 128, 67, 65,
+ 66, 73, 78, 69, 84, 128, 67, 65, 66, 66, 65, 71, 69, 45, 84, 82, 69, 69,
+ 128, 67, 65, 65, 78, 71, 128, 67, 65, 65, 73, 128, 67, 193, 67, 48, 50,
+ 52, 128, 67, 48, 50, 51, 128, 67, 48, 50, 50, 128, 67, 48, 50, 49, 128,
+ 67, 48, 50, 48, 128, 67, 48, 49, 57, 128, 67, 48, 49, 56, 128, 67, 48,
+ 49, 55, 128, 67, 48, 49, 54, 128, 67, 48, 49, 53, 128, 67, 48, 49, 52,
+ 128, 67, 48, 49, 51, 128, 67, 48, 49, 50, 128, 67, 48, 49, 49, 128, 67,
+ 48, 49, 48, 65, 128, 67, 48, 49, 48, 128, 67, 48, 48, 57, 128, 67, 48,
+ 48, 56, 128, 67, 48, 48, 55, 128, 67, 48, 48, 54, 128, 67, 48, 48, 53,
+ 128, 67, 48, 48, 52, 128, 67, 48, 48, 51, 128, 67, 48, 48, 50, 67, 128,
+ 67, 48, 48, 50, 66, 128, 67, 48, 48, 50, 65, 128, 67, 48, 48, 50, 128,
+ 67, 48, 48, 49, 128, 67, 45, 83, 73, 77, 80, 76, 73, 70, 73, 69, 196, 67,
+ 45, 51, 57, 128, 67, 45, 49, 56, 128, 66, 90, 85, 78, 199, 66, 90, 72,
+ 201, 66, 89, 84, 197, 66, 89, 69, 76, 79, 82, 85, 83, 83, 73, 65, 78, 45,
+ 85, 75, 82, 65, 73, 78, 73, 65, 206, 66, 88, 71, 128, 66, 87, 73, 128,
+ 66, 87, 69, 69, 128, 66, 87, 69, 128, 66, 87, 65, 128, 66, 85, 85, 77,
+ 73, 83, 72, 128, 66, 85, 84, 84, 79, 78, 128, 66, 85, 84, 84, 79, 206,
+ 66, 85, 84, 84, 69, 82, 70, 76, 89, 128, 66, 85, 84, 84, 69, 82, 128, 66,
+ 85, 212, 66, 85, 83, 84, 211, 66, 85, 83, 212, 66, 85, 83, 83, 89, 69,
+ 82, 85, 128, 66, 85, 83, 73, 78, 69, 83, 211, 66, 85, 211, 66, 85, 82,
+ 213, 66, 85, 82, 82, 73, 84, 79, 128, 66, 85, 82, 50, 128, 66, 85, 210,
+ 66, 85, 79, 89, 128, 66, 85, 79, 88, 128, 66, 85, 79, 80, 128, 66, 85,
+ 78, 78, 217, 66, 85, 78, 71, 128, 66, 85, 77, 80, 217, 66, 85, 76, 85,
+ 71, 128, 66, 85, 76, 85, 199, 66, 85, 76, 76, 83, 69, 89, 69, 128, 66,
+ 85, 76, 76, 211, 66, 85, 76, 76, 72, 79, 82, 78, 128, 66, 85, 76, 76, 72,
+ 79, 82, 206, 66, 85, 76, 76, 69, 84, 128, 66, 85, 76, 76, 69, 212, 66,
+ 85, 76, 76, 128, 66, 85, 76, 66, 128, 66, 85, 75, 89, 128, 66, 85, 73,
+ 76, 68, 73, 78, 71, 83, 128, 66, 85, 73, 76, 68, 73, 78, 71, 128, 66, 85,
+ 73, 76, 68, 73, 78, 199, 66, 85, 72, 73, 196, 66, 85, 71, 73, 78, 69, 83,
+ 197, 66, 85, 71, 128, 66, 85, 70, 70, 65, 76, 79, 128, 66, 85, 68, 128,
+ 66, 85, 67, 75, 76, 69, 128, 66, 85, 67, 75, 69, 84, 128, 66, 85, 66, 66,
+ 76, 69, 83, 128, 66, 85, 66, 66, 76, 69, 128, 66, 85, 66, 66, 76, 197,
+ 66, 83, 84, 65, 82, 128, 66, 83, 75, 85, 210, 66, 83, 75, 65, 173, 66,
+ 83, 68, 85, 211, 66, 82, 85, 83, 200, 66, 82, 79, 87, 206, 66, 82, 79,
+ 79, 77, 128, 66, 82, 79, 78, 90, 69, 128, 66, 82, 79, 75, 69, 206, 66,
+ 82, 79, 67, 67, 79, 76, 73, 128, 66, 82, 79, 65, 196, 66, 82, 73, 83, 84,
+ 76, 69, 128, 66, 82, 73, 71, 72, 84, 78, 69, 83, 211, 66, 82, 73, 69, 70,
+ 83, 128, 66, 82, 73, 69, 70, 67, 65, 83, 69, 128, 66, 82, 73, 68, 71,
+ 197, 66, 82, 73, 68, 197, 66, 82, 73, 67, 75, 128, 66, 82, 73, 128, 66,
+ 82, 69, 86, 73, 83, 128, 66, 82, 69, 86, 69, 45, 77, 65, 67, 82, 79, 78,
+ 128, 66, 82, 69, 86, 197, 66, 82, 69, 65, 84, 72, 217, 66, 82, 69, 65,
+ 84, 200, 66, 82, 69, 65, 83, 84, 45, 70, 69, 69, 68, 73, 78, 71, 128, 66,
+ 82, 69, 65, 75, 84, 72, 82, 79, 85, 71, 72, 128, 66, 82, 68, 193, 66, 82,
+ 65, 78, 67, 72, 73, 78, 199, 66, 82, 65, 78, 67, 72, 69, 83, 128, 66, 82,
+ 65, 78, 67, 72, 128, 66, 82, 65, 78, 67, 200, 66, 82, 65, 75, 67, 69, 84,
+ 128, 66, 82, 65, 73, 78, 128, 66, 82, 65, 67, 75, 69, 84, 211, 66, 82,
+ 65, 67, 75, 69, 84, 69, 196, 66, 82, 65, 67, 75, 69, 84, 128, 66, 82, 65,
+ 67, 75, 69, 212, 66, 82, 65, 67, 69, 128, 66, 81, 128, 66, 80, 72, 128,
+ 66, 79, 89, 211, 66, 79, 89, 128, 66, 79, 88, 73, 78, 199, 66, 79, 87,
+ 84, 73, 69, 128, 66, 79, 87, 84, 73, 197, 66, 79, 87, 76, 73, 78, 71,
+ 128, 66, 79, 87, 76, 128, 66, 79, 87, 204, 66, 79, 87, 73, 78, 199, 66,
+ 79, 215, 66, 79, 85, 81, 85, 69, 84, 128, 66, 79, 85, 81, 85, 69, 212,
+ 66, 79, 85, 78, 68, 65, 82, 217, 66, 79, 84, 84, 79, 77, 45, 83, 72, 65,
+ 68, 69, 196, 66, 79, 84, 84, 79, 77, 45, 76, 73, 71, 72, 84, 69, 196, 66,
+ 79, 84, 84, 79, 77, 128, 66, 79, 84, 84, 79, 205, 66, 79, 84, 84, 76, 69,
+ 128, 66, 79, 84, 84, 76, 197, 66, 79, 84, 200, 66, 79, 82, 90, 89, 128,
+ 66, 79, 82, 90, 65, 89, 65, 128, 66, 79, 82, 85, 84, 79, 128, 66, 79, 82,
+ 65, 88, 45, 51, 128, 66, 79, 82, 65, 88, 45, 50, 128, 66, 79, 82, 65, 88,
+ 128, 66, 79, 80, 79, 77, 79, 70, 207, 66, 79, 79, 84, 83, 128, 66, 79,
+ 79, 84, 128, 66, 79, 79, 77, 69, 82, 65, 78, 71, 128, 66, 79, 79, 75, 83,
+ 128, 66, 79, 79, 75, 77, 65, 82, 75, 128, 66, 79, 79, 75, 77, 65, 82,
+ 203, 66, 79, 78, 69, 128, 66, 79, 77, 66, 128, 66, 79, 77, 128, 66, 79,
+ 76, 84, 128, 66, 79, 76, 212, 66, 79, 72, 65, 73, 82, 73, 195, 66, 79,
+ 68, 89, 128, 66, 79, 68, 217, 66, 79, 65, 82, 128, 66, 79, 65, 128, 66,
+ 76, 85, 69, 66, 69, 82, 82, 73, 69, 83, 128, 66, 76, 85, 69, 128, 66, 76,
+ 85, 197, 66, 76, 79, 87, 73, 78, 199, 66, 76, 79, 87, 70, 73, 83, 72,
+ 128, 66, 76, 79, 215, 66, 76, 79, 83, 83, 79, 77, 128, 66, 76, 79, 79,
+ 68, 128, 66, 76, 79, 78, 196, 66, 76, 79, 67, 75, 45, 55, 128, 66, 76,
+ 79, 67, 75, 45, 54, 128, 66, 76, 79, 67, 75, 45, 53, 128, 66, 76, 79, 67,
+ 75, 45, 52, 128, 66, 76, 79, 67, 75, 45, 51, 128, 66, 76, 79, 67, 75, 45,
+ 50, 128, 66, 76, 79, 67, 75, 45, 49, 51, 53, 56, 128, 66, 76, 79, 67, 75,
+ 128, 66, 76, 73, 78, 203, 66, 76, 65, 78, 75, 128, 66, 76, 65, 78, 203,
+ 66, 76, 65, 68, 197, 66, 76, 65, 67, 75, 76, 69, 84, 84, 69, 210, 66, 76,
+ 65, 67, 75, 70, 79, 79, 212, 66, 76, 65, 67, 75, 45, 76, 69, 84, 84, 69,
+ 210, 66, 76, 65, 67, 75, 45, 70, 69, 65, 84, 72, 69, 82, 69, 196, 66, 76,
+ 65, 67, 75, 128, 66, 75, 65, 173, 66, 73, 84, 84, 69, 82, 128, 66, 73,
+ 84, 73, 78, 199, 66, 73, 84, 197, 66, 73, 84, 67, 79, 73, 206, 66, 73,
+ 83, 79, 78, 128, 66, 73, 83, 77, 85, 84, 200, 66, 73, 83, 77, 73, 76, 76,
+ 65, 200, 66, 73, 83, 72, 79, 208, 66, 73, 83, 69, 67, 84, 73, 78, 199,
+ 66, 73, 83, 65, 72, 128, 66, 73, 82, 85, 128, 66, 73, 82, 84, 72, 68, 65,
+ 217, 66, 73, 82, 71, 65, 128, 66, 73, 82, 71, 193, 66, 73, 82, 68, 128,
+ 66, 73, 79, 72, 65, 90, 65, 82, 196, 66, 73, 78, 79, 86, 73, 76, 69, 128,
+ 66, 73, 78, 79, 67, 85, 76, 65, 210, 66, 73, 78, 68, 73, 78, 199, 66, 73,
+ 78, 68, 73, 128, 66, 73, 78, 65, 82, 217, 66, 73, 76, 76, 73, 79, 78, 83,
+ 128, 66, 73, 76, 76, 73, 65, 82, 68, 83, 128, 66, 73, 76, 76, 69, 196,
+ 66, 73, 76, 65, 66, 73, 65, 204, 66, 73, 75, 73, 78, 73, 128, 66, 73, 71,
+ 128, 66, 73, 199, 66, 73, 69, 84, 128, 66, 73, 68, 69, 78, 84, 65, 204,
+ 66, 73, 68, 65, 75, 85, 79, 206, 66, 73, 67, 89, 67, 76, 73, 83, 84, 128,
+ 66, 73, 67, 89, 67, 76, 69, 83, 128, 66, 73, 67, 89, 67, 76, 69, 128, 66,
+ 73, 67, 69, 80, 83, 128, 66, 73, 66, 76, 69, 45, 67, 82, 69, 197, 66, 73,
+ 66, 128, 66, 201, 66, 72, 85, 128, 66, 72, 79, 79, 128, 66, 72, 79, 128,
+ 66, 72, 73, 128, 66, 72, 69, 84, 72, 128, 66, 72, 69, 69, 128, 66, 72,
+ 69, 128, 66, 72, 65, 84, 84, 73, 80, 82, 79, 76, 213, 66, 72, 65, 77,
+ 128, 66, 72, 65, 76, 69, 128, 66, 72, 65, 76, 197, 66, 72, 65, 73, 75,
+ 83, 85, 75, 201, 66, 72, 65, 65, 128, 66, 72, 65, 128, 66, 69, 89, 89,
+ 65, 76, 128, 66, 69, 88, 128, 66, 69, 86, 69, 82, 65, 71, 69, 128, 66,
+ 69, 86, 69, 82, 65, 71, 197, 66, 69, 84, 87, 69, 69, 78, 128, 66, 69, 84,
+ 87, 69, 69, 206, 66, 69, 84, 72, 128, 66, 69, 84, 65, 128, 66, 69, 84,
+ 193, 66, 69, 212, 66, 69, 83, 73, 68, 197, 66, 69, 82, 75, 65, 78, 65,
+ 206, 66, 69, 82, 66, 69, 210, 66, 69, 80, 128, 66, 69, 79, 82, 195, 66,
+ 69, 78, 90, 69, 78, 197, 66, 69, 78, 84, 207, 66, 69, 78, 84, 128, 66,
+ 69, 78, 212, 66, 69, 78, 71, 65, 76, 201, 66, 69, 78, 68, 69, 128, 66,
+ 69, 78, 68, 128, 66, 69, 78, 196, 66, 69, 206, 66, 69, 76, 84, 128, 66,
+ 69, 76, 212, 66, 69, 76, 79, 215, 66, 69, 76, 76, 72, 79, 208, 66, 69,
+ 76, 76, 128, 66, 69, 76, 204, 66, 69, 76, 71, 84, 72, 79, 210, 66, 69,
+ 73, 84, 72, 128, 66, 69, 72, 73, 78, 196, 66, 69, 72, 69, 72, 128, 66,
+ 69, 72, 69, 200, 66, 69, 72, 128, 66, 69, 200, 66, 69, 71, 73, 78, 78,
+ 73, 78, 71, 128, 66, 69, 71, 73, 78, 78, 69, 82, 128, 66, 69, 71, 73,
+ 206, 66, 69, 70, 79, 82, 197, 66, 69, 69, 84, 76, 69, 128, 66, 69, 69,
+ 84, 65, 128, 66, 69, 69, 210, 66, 69, 69, 72, 73, 86, 69, 128, 66, 69,
+ 69, 72, 128, 66, 69, 69, 200, 66, 69, 67, 65, 85, 83, 69, 128, 66, 69,
+ 65, 86, 69, 82, 128, 66, 69, 65, 86, 69, 210, 66, 69, 65, 84, 73, 78,
+ 199, 66, 69, 65, 84, 128, 66, 69, 65, 82, 68, 69, 196, 66, 69, 65, 82,
+ 128, 66, 69, 65, 210, 66, 69, 65, 78, 83, 128, 66, 69, 65, 78, 128, 66,
+ 69, 65, 77, 69, 196, 66, 69, 65, 68, 83, 128, 66, 69, 65, 67, 200, 66,
+ 67, 65, 68, 128, 66, 67, 65, 196, 66, 66, 89, 88, 128, 66, 66, 89, 84,
+ 128, 66, 66, 89, 80, 128, 66, 66, 89, 128, 66, 66, 85, 88, 128, 66, 66,
+ 85, 84, 128, 66, 66, 85, 82, 88, 128, 66, 66, 85, 82, 128, 66, 66, 85,
+ 80, 128, 66, 66, 85, 79, 88, 128, 66, 66, 85, 79, 80, 128, 66, 66, 85,
+ 79, 128, 66, 66, 85, 128, 66, 66, 79, 88, 128, 66, 66, 79, 84, 128, 66,
+ 66, 79, 80, 128, 66, 66, 79, 128, 66, 66, 73, 88, 128, 66, 66, 73, 80,
+ 128, 66, 66, 73, 69, 88, 128, 66, 66, 73, 69, 84, 128, 66, 66, 73, 69,
+ 80, 128, 66, 66, 73, 69, 128, 66, 66, 73, 128, 66, 66, 69, 88, 128, 66,
+ 66, 69, 80, 128, 66, 66, 69, 69, 128, 66, 66, 65, 88, 128, 66, 66, 65,
+ 84, 128, 66, 66, 65, 80, 128, 66, 66, 65, 65, 128, 66, 65, 89, 65, 78,
+ 78, 65, 128, 66, 65, 85, 128, 66, 65, 84, 84, 69, 82, 89, 128, 66, 65,
+ 84, 72, 84, 85, 66, 128, 66, 65, 84, 72, 65, 77, 65, 83, 65, 84, 128, 66,
+ 65, 84, 72, 128, 66, 65, 84, 200, 66, 65, 84, 65, 203, 66, 65, 83, 83,
+ 65, 128, 66, 65, 83, 83, 193, 66, 65, 83, 75, 69, 84, 66, 65, 76, 204,
+ 66, 65, 83, 72, 75, 73, 210, 66, 65, 83, 72, 128, 66, 65, 83, 69, 76, 73,
+ 78, 197, 66, 65, 83, 69, 66, 65, 76, 76, 128, 66, 65, 83, 69, 128, 66,
+ 65, 83, 197, 66, 65, 82, 83, 128, 66, 65, 82, 211, 66, 65, 82, 82, 73,
+ 69, 82, 128, 66, 65, 82, 82, 69, 75, 72, 128, 66, 65, 82, 82, 69, 69,
+ 128, 66, 65, 82, 82, 69, 197, 66, 65, 82, 76, 73, 78, 69, 128, 66, 65,
+ 82, 76, 69, 89, 128, 66, 65, 82, 73, 89, 79, 79, 83, 65, 78, 128, 66, 65,
+ 82, 66, 69, 210, 66, 65, 82, 65, 50, 128, 66, 65, 210, 66, 65, 78, 84,
+ 79, 67, 128, 66, 65, 78, 75, 78, 79, 84, 197, 66, 65, 78, 75, 128, 66,
+ 65, 78, 203, 66, 65, 78, 74, 79, 128, 66, 65, 78, 68, 128, 66, 65, 78,
+ 65, 78, 65, 128, 66, 65, 78, 50, 128, 66, 65, 78, 178, 66, 65, 77, 66,
+ 79, 79, 83, 128, 66, 65, 77, 66, 79, 79, 128, 66, 65, 76, 85, 68, 65,
+ 128, 66, 65, 76, 76, 80, 79, 73, 78, 212, 66, 65, 76, 76, 79, 84, 128,
+ 66, 65, 76, 76, 79, 212, 66, 65, 76, 76, 79, 79, 78, 45, 83, 80, 79, 75,
+ 69, 196, 66, 65, 76, 76, 79, 79, 78, 128, 66, 65, 76, 76, 69, 212, 66,
+ 65, 76, 68, 128, 66, 65, 76, 65, 71, 128, 66, 65, 76, 128, 66, 65, 204,
+ 66, 65, 73, 82, 75, 65, 78, 128, 66, 65, 73, 77, 65, 73, 128, 66, 65, 72,
+ 84, 128, 66, 65, 72, 73, 82, 71, 79, 77, 85, 75, 72, 65, 128, 66, 65, 72,
+ 65, 82, 50, 128, 66, 65, 72, 65, 82, 178, 66, 65, 72, 128, 66, 65, 71,
+ 85, 69, 84, 84, 197, 66, 65, 71, 83, 128, 66, 65, 71, 71, 65, 71, 197,
+ 66, 65, 71, 69, 76, 128, 66, 65, 71, 65, 128, 66, 65, 71, 51, 128, 66,
+ 65, 199, 66, 65, 68, 77, 73, 78, 84, 79, 206, 66, 65, 68, 71, 69, 82,
+ 128, 66, 65, 68, 71, 69, 128, 66, 65, 196, 66, 65, 67, 84, 82, 73, 65,
+ 206, 66, 65, 67, 79, 78, 128, 66, 65, 67, 75, 87, 65, 82, 68, 128, 66,
+ 65, 67, 75, 83, 80, 65, 67, 69, 128, 66, 65, 67, 75, 83, 76, 65, 83, 72,
+ 128, 66, 65, 67, 75, 83, 76, 65, 83, 200, 66, 65, 67, 75, 83, 76, 65, 78,
+ 84, 69, 196, 66, 65, 67, 75, 72, 65, 78, 196, 66, 65, 67, 75, 45, 84, 73,
+ 76, 84, 69, 196, 66, 65, 67, 75, 128, 66, 65, 67, 203, 66, 65, 66, 89,
+ 128, 66, 65, 66, 217, 66, 65, 65, 82, 69, 82, 85, 128, 66, 65, 45, 50,
+ 128, 66, 51, 48, 53, 128, 66, 50, 53, 180, 66, 50, 52, 183, 66, 50, 52,
+ 179, 66, 50, 52, 178, 66, 50, 52, 177, 66, 50, 52, 176, 66, 50, 51, 179,
+ 66, 50, 51, 177, 66, 50, 51, 176, 66, 50, 50, 181, 66, 50, 50, 176, 66,
+ 49, 57, 177, 66, 49, 55, 182, 66, 49, 55, 179, 66, 49, 54, 57, 128, 66,
+ 49, 54, 56, 128, 66, 49, 54, 55, 128, 66, 49, 54, 54, 128, 66, 49, 54,
+ 53, 128, 66, 49, 54, 52, 128, 66, 49, 54, 179, 66, 49, 54, 178, 66, 49,
+ 54, 49, 128, 66, 49, 54, 48, 128, 66, 49, 53, 185, 66, 49, 53, 56, 128,
+ 66, 49, 53, 55, 128, 66, 49, 53, 182, 66, 49, 53, 53, 128, 66, 49, 53,
+ 52, 128, 66, 49, 53, 51, 128, 66, 49, 53, 50, 128, 66, 49, 53, 177, 66,
+ 49, 53, 48, 128, 66, 49, 52, 54, 128, 66, 49, 52, 181, 66, 49, 52, 50,
+ 128, 66, 49, 52, 177, 66, 49, 52, 176, 66, 49, 51, 181, 66, 49, 51, 179,
+ 66, 49, 51, 50, 128, 66, 49, 51, 177, 66, 49, 51, 176, 66, 49, 50, 184,
+ 66, 49, 50, 183, 66, 49, 50, 181, 66, 49, 50, 179, 66, 49, 50, 178, 66,
+ 49, 50, 177, 66, 49, 50, 176, 66, 49, 48, 57, 205, 66, 49, 48, 57, 198,
+ 66, 49, 48, 56, 205, 66, 49, 48, 56, 198, 66, 49, 48, 55, 205, 66, 49,
+ 48, 55, 198, 66, 49, 48, 54, 205, 66, 49, 48, 54, 198, 66, 49, 48, 53,
+ 205, 66, 49, 48, 53, 198, 66, 49, 48, 181, 66, 49, 48, 180, 66, 49, 48,
+ 178, 66, 49, 48, 176, 66, 48, 57, 177, 66, 48, 57, 176, 66, 48, 56, 57,
+ 128, 66, 48, 56, 183, 66, 48, 56, 54, 128, 66, 48, 56, 181, 66, 48, 56,
+ 51, 128, 66, 48, 56, 50, 128, 66, 48, 56, 177, 66, 48, 56, 176, 66, 48,
+ 55, 57, 128, 66, 48, 55, 184, 66, 48, 55, 183, 66, 48, 55, 182, 66, 48,
+ 55, 181, 66, 48, 55, 180, 66, 48, 55, 179, 66, 48, 55, 178, 66, 48, 55,
+ 177, 66, 48, 55, 176, 66, 48, 54, 185, 66, 48, 54, 184, 66, 48, 54, 183,
+ 66, 48, 54, 182, 66, 48, 54, 181, 66, 48, 54, 52, 128, 66, 48, 54, 51,
+ 128, 66, 48, 54, 178, 66, 48, 54, 177, 66, 48, 54, 176, 66, 48, 53, 185,
+ 66, 48, 53, 184, 66, 48, 53, 183, 66, 48, 53, 54, 128, 66, 48, 53, 181,
+ 66, 48, 53, 180, 66, 48, 53, 179, 66, 48, 53, 178, 66, 48, 53, 177, 66,
+ 48, 53, 176, 66, 48, 52, 57, 128, 66, 48, 52, 184, 66, 48, 52, 55, 128,
+ 66, 48, 52, 182, 66, 48, 52, 181, 66, 48, 52, 180, 66, 48, 52, 179, 66,
+ 48, 52, 178, 66, 48, 52, 177, 66, 48, 52, 176, 66, 48, 51, 185, 66, 48,
+ 51, 184, 66, 48, 51, 183, 66, 48, 51, 182, 66, 48, 51, 52, 128, 66, 48,
+ 51, 179, 66, 48, 51, 178, 66, 48, 51, 177, 66, 48, 51, 176, 66, 48, 50,
+ 185, 66, 48, 50, 184, 66, 48, 50, 183, 66, 48, 50, 182, 66, 48, 50, 181,
+ 66, 48, 50, 180, 66, 48, 50, 179, 66, 48, 50, 50, 128, 66, 48, 50, 177,
+ 66, 48, 50, 176, 66, 48, 49, 57, 128, 66, 48, 49, 56, 128, 66, 48, 49,
+ 183, 66, 48, 49, 182, 66, 48, 49, 181, 66, 48, 49, 180, 66, 48, 49, 179,
+ 66, 48, 49, 178, 66, 48, 49, 177, 66, 48, 49, 176, 66, 48, 48, 57, 128,
+ 66, 48, 48, 185, 66, 48, 48, 56, 128, 66, 48, 48, 184, 66, 48, 48, 55,
+ 128, 66, 48, 48, 183, 66, 48, 48, 54, 128, 66, 48, 48, 182, 66, 48, 48,
+ 53, 65, 128, 66, 48, 48, 53, 128, 66, 48, 48, 181, 66, 48, 48, 52, 128,
+ 66, 48, 48, 180, 66, 48, 48, 51, 128, 66, 48, 48, 179, 66, 48, 48, 50,
+ 128, 66, 48, 48, 178, 66, 48, 48, 49, 128, 66, 48, 48, 177, 65, 90, 90,
+ 193, 65, 90, 85, 128, 65, 89, 66, 128, 65, 89, 65, 72, 128, 65, 88, 69,
+ 128, 65, 87, 90, 128, 65, 87, 88, 128, 65, 87, 81, 128, 65, 87, 69, 128,
+ 65, 87, 67, 128, 65, 87, 65, 217, 65, 86, 79, 67, 65, 68, 79, 128, 65,
+ 86, 69, 83, 84, 65, 206, 65, 86, 69, 82, 65, 71, 197, 65, 86, 65, 75, 82,
+ 65, 72, 65, 83, 65, 78, 89, 65, 128, 65, 86, 65, 71, 82, 65, 72, 65, 128,
+ 65, 85, 89, 65, 78, 78, 65, 128, 65, 85, 84, 85, 77, 78, 128, 65, 85, 84,
+ 79, 77, 79, 66, 73, 76, 69, 128, 65, 85, 84, 79, 77, 65, 84, 69, 196, 65,
+ 85, 84, 207, 65, 85, 83, 84, 82, 65, 204, 65, 85, 82, 73, 80, 73, 71, 77,
+ 69, 78, 84, 128, 65, 85, 82, 65, 77, 65, 90, 68, 65, 65, 72, 65, 128, 65,
+ 85, 82, 65, 77, 65, 90, 68, 65, 65, 45, 50, 128, 65, 85, 82, 65, 77, 65,
+ 90, 68, 65, 65, 128, 65, 85, 78, 78, 128, 65, 85, 71, 85, 83, 84, 128,
+ 65, 85, 71, 77, 69, 78, 84, 65, 84, 73, 79, 206, 65, 85, 69, 128, 65, 85,
+ 66, 69, 82, 71, 73, 78, 69, 128, 65, 84, 84, 73, 195, 65, 84, 84, 72, 65,
+ 67, 65, 78, 128, 65, 84, 84, 69, 78, 84, 73, 79, 78, 128, 65, 84, 84, 65,
+ 203, 65, 84, 84, 65, 67, 72, 73, 78, 199, 65, 84, 84, 65, 67, 72, 69,
+ 196, 65, 84, 79, 205, 65, 84, 78, 65, 200, 65, 84, 77, 65, 65, 85, 128,
+ 65, 84, 73, 89, 65, 128, 65, 84, 73, 85, 128, 65, 84, 73, 75, 82, 65, 77,
+ 65, 128, 65, 84, 72, 76, 69, 84, 73, 195, 65, 84, 72, 65, 82, 86, 65, 86,
+ 69, 68, 73, 195, 65, 84, 72, 65, 80, 65, 83, 67, 65, 206, 65, 84, 72, 45,
+ 84, 72, 65, 76, 65, 84, 72, 65, 128, 65, 83, 90, 128, 65, 83, 89, 85, 82,
+ 193, 65, 83, 89, 77, 80, 84, 79, 84, 73, 67, 65, 76, 76, 217, 65, 83, 84,
+ 82, 79, 78, 79, 77, 73, 67, 65, 204, 65, 83, 84, 82, 79, 76, 79, 71, 73,
+ 67, 65, 204, 65, 83, 84, 82, 65, 69, 65, 128, 65, 83, 84, 79, 78, 73, 83,
+ 72, 69, 196, 65, 83, 84, 69, 82, 73, 83, 77, 128, 65, 83, 84, 69, 82, 73,
+ 83, 75, 211, 65, 83, 84, 69, 82, 73, 83, 75, 128, 65, 83, 84, 69, 82, 73,
+ 83, 203, 65, 83, 84, 69, 82, 73, 83, 67, 85, 83, 128, 65, 83, 83, 89, 82,
+ 73, 65, 206, 65, 83, 83, 69, 82, 84, 73, 79, 78, 128, 65, 83, 80, 73, 82,
+ 65, 84, 73, 79, 78, 128, 65, 83, 80, 73, 82, 65, 84, 69, 196, 65, 83, 80,
+ 69, 82, 128, 65, 83, 73, 65, 45, 65, 85, 83, 84, 82, 65, 76, 73, 65, 128,
+ 65, 83, 72, 71, 65, 66, 128, 65, 83, 72, 69, 83, 128, 65, 83, 72, 57,
+ 128, 65, 83, 72, 51, 128, 65, 83, 72, 178, 65, 83, 67, 73, 193, 65, 83,
+ 67, 69, 78, 84, 128, 65, 83, 67, 69, 78, 68, 73, 78, 199, 65, 83, 65, 76,
+ 50, 128, 65, 83, 45, 83, 65, 76, 65, 65, 84, 213, 65, 83, 45, 83, 65, 74,
+ 68, 65, 128, 65, 82, 85, 72, 85, 65, 128, 65, 82, 84, 211, 65, 82, 84,
+ 73, 83, 212, 65, 82, 84, 73, 67, 85, 76, 65, 84, 69, 196, 65, 82, 84, 65,
+ 66, 197, 65, 82, 84, 65, 128, 65, 82, 83, 69, 79, 83, 128, 65, 82, 83,
+ 69, 79, 211, 65, 82, 83, 69, 78, 73, 67, 128, 65, 82, 82, 79, 87, 83,
+ 128, 65, 82, 82, 79, 87, 211, 65, 82, 82, 79, 87, 72, 69, 65, 68, 83,
+ 128, 65, 82, 82, 79, 87, 72, 69, 65, 68, 45, 83, 72, 65, 80, 69, 196, 65,
+ 82, 82, 79, 87, 72, 69, 65, 68, 128, 65, 82, 82, 79, 87, 72, 69, 65, 196,
+ 65, 82, 82, 79, 87, 45, 84, 65, 73, 76, 128, 65, 82, 82, 73, 86, 73, 78,
+ 71, 128, 65, 82, 82, 73, 86, 69, 128, 65, 82, 82, 65, 89, 128, 65, 82,
+ 80, 69, 71, 71, 73, 65, 84, 207, 65, 82, 79, 85, 83, 73, 78, 199, 65, 82,
+ 79, 85, 82, 193, 65, 82, 79, 85, 78, 68, 45, 80, 82, 79, 70, 73, 76, 69,
+ 128, 65, 82, 79, 85, 78, 196, 65, 82, 77, 89, 128, 65, 82, 77, 211, 65,
+ 82, 77, 79, 85, 82, 128, 65, 82, 77, 69, 78, 73, 65, 206, 65, 82, 77,
+ 128, 65, 82, 205, 65, 82, 76, 65, 85, 199, 65, 82, 75, 84, 73, 75, 207,
+ 65, 82, 75, 65, 66, 128, 65, 82, 75, 65, 65, 78, 85, 128, 65, 82, 73, 83,
+ 84, 69, 82, 65, 128, 65, 82, 73, 83, 84, 69, 82, 193, 65, 82, 73, 69, 83,
+ 128, 65, 82, 71, 79, 84, 69, 82, 73, 128, 65, 82, 71, 79, 83, 89, 78, 84,
+ 72, 69, 84, 79, 78, 128, 65, 82, 71, 73, 128, 65, 82, 69, 80, 65, 128,
+ 65, 82, 69, 65, 128, 65, 82, 68, 72, 65, 86, 73, 83, 65, 82, 71, 65, 128,
+ 65, 82, 68, 72, 65, 67, 65, 78, 68, 82, 65, 128, 65, 82, 67, 72, 65, 73,
+ 79, 78, 128, 65, 82, 67, 72, 65, 73, 79, 206, 65, 82, 67, 72, 65, 73,
+ 195, 65, 82, 67, 200, 65, 82, 67, 128, 65, 82, 195, 65, 82, 65, 77, 65,
+ 73, 195, 65, 82, 65, 69, 65, 69, 128, 65, 82, 65, 69, 65, 45, 85, 128,
+ 65, 82, 65, 69, 65, 45, 73, 128, 65, 82, 65, 69, 65, 45, 69, 79, 128, 65,
+ 82, 65, 69, 65, 45, 69, 128, 65, 82, 65, 69, 65, 45, 65, 128, 65, 82, 65,
+ 68, 128, 65, 82, 65, 196, 65, 82, 65, 66, 73, 67, 45, 73, 78, 68, 73,
+ 195, 65, 82, 65, 66, 73, 65, 206, 65, 82, 45, 82, 85, 66, 128, 65, 82,
+ 45, 82, 65, 72, 77, 65, 206, 65, 82, 45, 82, 65, 72, 69, 69, 77, 128, 65,
+ 81, 85, 65, 82, 73, 85, 83, 128, 65, 81, 85, 65, 70, 79, 82, 84, 73, 83,
+ 128, 65, 81, 85, 193, 65, 80, 85, 206, 65, 80, 82, 73, 76, 128, 65, 80,
+ 80, 82, 79, 88, 73, 77, 65, 84, 69, 76, 217, 65, 80, 80, 82, 79, 88, 73,
+ 77, 65, 84, 69, 128, 65, 80, 80, 82, 79, 65, 67, 72, 69, 211, 65, 80, 80,
+ 82, 79, 65, 67, 72, 128, 65, 80, 80, 76, 73, 67, 65, 84, 73, 79, 78, 128,
+ 65, 80, 80, 76, 73, 67, 65, 84, 73, 79, 206, 65, 80, 79, 84, 72, 69, 83,
+ 128, 65, 80, 79, 84, 72, 69, 77, 65, 128, 65, 80, 79, 83, 84, 82, 79, 80,
+ 72, 69, 128, 65, 80, 79, 83, 84, 82, 79, 70, 79, 83, 128, 65, 80, 79, 83,
+ 84, 82, 79, 70, 79, 211, 65, 80, 79, 83, 84, 82, 79, 70, 79, 201, 65, 80,
+ 79, 76, 76, 79, 78, 128, 65, 80, 79, 68, 69, 88, 73, 65, 128, 65, 80, 79,
+ 68, 69, 82, 77, 193, 65, 80, 76, 79, 85, 78, 128, 65, 80, 76, 201, 65,
+ 80, 204, 65, 80, 73, 78, 128, 65, 80, 69, 83, 207, 65, 80, 67, 128, 65,
+ 80, 65, 82, 84, 128, 65, 80, 65, 65, 84, 79, 128, 65, 79, 85, 128, 65,
+ 79, 82, 128, 65, 78, 89, 128, 65, 78, 85, 83, 86, 65, 82, 65, 89, 65,
+ 128, 65, 78, 85, 83, 86, 65, 82, 65, 128, 65, 78, 85, 83, 86, 65, 82,
+ 193, 65, 78, 85, 68, 65, 84, 84, 65, 128, 65, 78, 85, 68, 65, 84, 84,
+ 193, 65, 78, 84, 73, 82, 69, 83, 84, 82, 73, 67, 84, 73, 79, 78, 128, 65,
+ 78, 84, 73, 77, 79, 78, 89, 45, 50, 128, 65, 78, 84, 73, 77, 79, 78, 89,
+ 128, 65, 78, 84, 73, 77, 79, 78, 217, 65, 78, 84, 73, 77, 79, 78, 73, 65,
+ 84, 69, 128, 65, 78, 84, 73, 75, 69, 78, 79, 77, 65, 128, 65, 78, 84, 73,
+ 75, 69, 78, 79, 75, 89, 76, 73, 83, 77, 65, 128, 65, 78, 84, 73, 70, 79,
+ 78, 73, 65, 128, 65, 78, 84, 73, 67, 76, 79, 67, 75, 87, 73, 83, 69, 45,
+ 82, 79, 84, 65, 84, 69, 196, 65, 78, 84, 73, 67, 76, 79, 67, 75, 87, 73,
+ 83, 69, 128, 65, 78, 84, 73, 67, 76, 79, 67, 75, 87, 73, 83, 197, 65, 78,
+ 84, 69, 78, 78, 65, 128, 65, 78, 84, 69, 78, 78, 193, 65, 78, 84, 65, 82,
+ 71, 79, 77, 85, 75, 72, 65, 128, 65, 78, 83, 85, 218, 65, 78, 83, 72, 69,
+ 128, 65, 78, 80, 69, 65, 128, 65, 78, 207, 65, 78, 78, 85, 73, 84, 217,
+ 65, 78, 78, 79, 84, 65, 84, 73, 79, 206, 65, 78, 78, 65, 65, 85, 128, 65,
+ 78, 75, 72, 128, 65, 78, 74, 73, 128, 65, 78, 73, 77, 65, 76, 128, 65,
+ 78, 72, 85, 78, 78, 65, 128, 65, 78, 72, 85, 77, 65, 65, 128, 65, 78, 72,
+ 85, 77, 128, 65, 78, 72, 85, 128, 65, 78, 72, 65, 65, 128, 65, 78, 72,
+ 128, 65, 78, 71, 85, 76, 65, 82, 128, 65, 78, 71, 85, 73, 83, 72, 69,
+ 196, 65, 78, 71, 83, 84, 82, 79, 205, 65, 78, 71, 82, 217, 65, 78, 71,
+ 76, 73, 67, 65, 78, 193, 65, 78, 71, 76, 69, 68, 128, 65, 78, 71, 76, 69,
+ 196, 65, 78, 71, 75, 72, 65, 78, 75, 72, 85, 128, 65, 78, 71, 75, 65,
+ 128, 65, 78, 71, 69, 210, 65, 78, 71, 69, 76, 128, 65, 78, 71, 69, 68,
+ 128, 65, 78, 68, 65, 80, 128, 65, 78, 67, 79, 82, 65, 128, 65, 78, 67,
+ 72, 79, 82, 128, 65, 78, 65, 84, 82, 73, 67, 72, 73, 83, 77, 65, 128, 65,
+ 78, 65, 84, 79, 77, 73, 67, 65, 204, 65, 78, 65, 80, 128, 65, 78, 45, 78,
+ 73, 83, 70, 128, 65, 77, 85, 76, 69, 84, 128, 65, 77, 80, 83, 128, 65,
+ 77, 80, 72, 79, 82, 65, 128, 65, 77, 80, 69, 82, 83, 65, 78, 68, 128, 65,
+ 77, 80, 69, 82, 83, 65, 78, 196, 65, 77, 79, 85, 78, 212, 65, 77, 69, 82,
+ 73, 67, 65, 83, 128, 65, 77, 69, 82, 73, 67, 65, 206, 65, 77, 66, 85, 76,
+ 65, 78, 67, 69, 128, 65, 77, 66, 193, 65, 77, 66, 128, 65, 77, 65, 82,
+ 128, 65, 77, 65, 210, 65, 77, 65, 76, 71, 65, 77, 65, 84, 73, 79, 206,
+ 65, 77, 65, 76, 71, 65, 77, 128, 65, 76, 86, 69, 79, 76, 65, 210, 65, 76,
+ 85, 77, 128, 65, 76, 84, 69, 82, 78, 65, 84, 73, 86, 197, 65, 76, 84, 69,
+ 82, 78, 65, 84, 73, 79, 206, 65, 76, 84, 69, 82, 78, 65, 84, 73, 78, 71,
+ 128, 65, 76, 84, 69, 82, 78, 65, 84, 73, 78, 199, 65, 76, 84, 69, 82, 78,
+ 65, 84, 69, 128, 65, 76, 84, 69, 82, 78, 65, 84, 197, 65, 76, 84, 65,
+ 128, 65, 76, 80, 72, 65, 128, 65, 76, 80, 72, 193, 65, 76, 80, 65, 80,
+ 82, 65, 78, 65, 128, 65, 76, 80, 65, 80, 82, 65, 65, 78, 193, 65, 76, 80,
+ 65, 128, 65, 76, 77, 79, 83, 212, 65, 76, 76, 79, 128, 65, 76, 76, 73,
+ 65, 78, 67, 69, 128, 65, 76, 76, 201, 65, 76, 76, 65, 200, 65, 76, 76,
+ 65, 65, 72, 128, 65, 76, 75, 65, 76, 73, 45, 50, 128, 65, 76, 75, 65, 76,
+ 73, 128, 65, 76, 73, 71, 78, 69, 196, 65, 76, 73, 70, 85, 128, 65, 76,
+ 73, 70, 128, 65, 76, 73, 198, 65, 76, 73, 69, 78, 128, 65, 76, 73, 69,
+ 206, 65, 76, 71, 73, 218, 65, 76, 70, 65, 128, 65, 76, 69, 85, 212, 65,
+ 76, 69, 82, 84, 128, 65, 76, 69, 80, 72, 128, 65, 76, 69, 77, 66, 73, 67,
+ 128, 65, 76, 69, 70, 128, 65, 76, 66, 65, 78, 73, 65, 206, 65, 76, 65,
+ 89, 78, 65, 65, 128, 65, 76, 65, 89, 72, 73, 77, 65, 193, 65, 76, 65, 89,
+ 72, 73, 205, 65, 76, 65, 89, 72, 201, 65, 76, 65, 89, 72, 69, 128, 65,
+ 76, 65, 89, 72, 197, 65, 76, 65, 89, 72, 65, 193, 65, 76, 65, 82, 205,
+ 65, 76, 65, 80, 72, 128, 65, 76, 45, 76, 65, 75, 85, 78, 65, 128, 65, 76,
+ 45, 74, 85, 90, 128, 65, 75, 85, 82, 213, 65, 75, 84, 73, 69, 83, 69, 76,
+ 83, 75, 65, 66, 128, 65, 75, 83, 65, 128, 65, 75, 72, 77, 73, 77, 73,
+ 195, 65, 75, 66, 65, 210, 65, 75, 65, 82, 65, 128, 65, 75, 65, 82, 193,
+ 65, 73, 89, 65, 78, 78, 65, 128, 65, 73, 86, 73, 76, 73, 203, 65, 73, 86,
+ 65, 128, 65, 73, 84, 79, 206, 65, 73, 82, 80, 76, 65, 78, 69, 128, 65,
+ 73, 82, 80, 76, 65, 78, 197, 65, 73, 78, 213, 65, 73, 78, 78, 128, 65,
+ 73, 76, 77, 128, 65, 73, 75, 65, 82, 65, 128, 65, 73, 72, 86, 85, 83,
+ 128, 65, 72, 83, 68, 65, 128, 65, 72, 83, 65, 128, 65, 72, 79, 205, 65,
+ 72, 65, 78, 199, 65, 72, 65, 71, 71, 65, 210, 65, 72, 65, 68, 128, 65,
+ 71, 85, 78, 71, 128, 65, 71, 79, 71, 201, 65, 71, 71, 82, 65, 86, 65, 84,
+ 73, 79, 78, 128, 65, 71, 71, 82, 65, 86, 65, 84, 69, 196, 65, 71, 65, 73,
+ 78, 83, 212, 65, 71, 65, 73, 78, 128, 65, 70, 84, 69, 210, 65, 70, 83,
+ 65, 65, 81, 128, 65, 70, 82, 73, 67, 65, 206, 65, 70, 79, 82, 69, 77, 69,
+ 78, 84, 73, 79, 78, 69, 68, 128, 65, 70, 71, 72, 65, 78, 201, 65, 70, 70,
+ 82, 73, 67, 65, 84, 73, 79, 206, 65, 70, 70, 73, 216, 65, 69, 89, 65, 78,
+ 78, 65, 128, 65, 69, 89, 128, 65, 69, 83, 67, 85, 76, 65, 80, 73, 85, 83,
+ 128, 65, 69, 83, 67, 128, 65, 69, 83, 128, 65, 69, 82, 73, 65, 204, 65,
+ 69, 82, 128, 65, 69, 76, 65, 45, 80, 73, 76, 76, 65, 128, 65, 69, 76,
+ 128, 65, 69, 75, 128, 65, 69, 71, 69, 65, 206, 65, 69, 71, 128, 65, 69,
+ 69, 89, 65, 78, 78, 65, 128, 65, 69, 69, 128, 65, 69, 68, 65, 45, 80, 73,
+ 76, 76, 65, 128, 65, 69, 68, 128, 65, 69, 66, 128, 65, 68, 86, 65, 78,
+ 84, 65, 71, 69, 128, 65, 68, 86, 65, 78, 67, 69, 128, 65, 68, 85, 76, 84,
+ 128, 65, 68, 77, 73, 83, 83, 73, 79, 206, 65, 68, 77, 69, 84, 79, 83,
+ 128, 65, 68, 76, 65, 205, 65, 68, 72, 69, 83, 73, 86, 197, 65, 68, 69,
+ 71, 128, 65, 68, 69, 199, 65, 68, 68, 82, 69, 83, 83, 69, 196, 65, 68,
+ 68, 82, 69, 83, 211, 65, 68, 68, 65, 75, 128, 65, 68, 65, 203, 65, 67,
+ 85, 84, 69, 45, 77, 65, 67, 82, 79, 78, 128, 65, 67, 85, 84, 69, 45, 71,
+ 82, 65, 86, 69, 45, 65, 67, 85, 84, 69, 128, 65, 67, 85, 84, 197, 65, 67,
+ 84, 85, 65, 76, 76, 217, 65, 67, 84, 73, 86, 65, 84, 197, 65, 67, 82, 79,
+ 80, 72, 79, 78, 73, 195, 65, 67, 75, 78, 79, 87, 76, 69, 68, 71, 69, 128,
+ 65, 67, 67, 85, 77, 85, 76, 65, 84, 73, 79, 78, 128, 65, 67, 67, 79, 85,
+ 78, 212, 65, 67, 67, 79, 82, 68, 73, 79, 78, 128, 65, 67, 67, 79, 77, 77,
+ 79, 68, 65, 84, 73, 79, 78, 128, 65, 67, 67, 69, 80, 84, 128, 65, 67, 67,
+ 69, 78, 84, 45, 83, 84, 65, 67, 67, 65, 84, 79, 128, 65, 67, 67, 69, 78,
+ 84, 128, 65, 67, 67, 69, 78, 212, 65, 67, 65, 68, 69, 77, 217, 65, 66,
+ 89, 83, 77, 65, 204, 65, 66, 85, 78, 68, 65, 78, 67, 69, 128, 65, 66, 75,
+ 72, 65, 83, 73, 65, 206, 65, 66, 66, 82, 69, 86, 73, 65, 84, 73, 79, 206,
+ 65, 66, 65, 70, 73, 76, 73, 128, 65, 66, 65, 67, 85, 83, 128, 65, 66,
+ 178, 65, 66, 49, 57, 49, 128, 65, 66, 49, 56, 56, 128, 65, 66, 49, 56,
+ 48, 128, 65, 66, 49, 55, 49, 128, 65, 66, 49, 54, 52, 128, 65, 66, 49,
+ 51, 49, 66, 128, 65, 66, 49, 51, 49, 65, 128, 65, 66, 49, 50, 51, 128,
+ 65, 66, 49, 50, 50, 128, 65, 66, 49, 50, 48, 128, 65, 66, 49, 49, 56,
+ 128, 65, 66, 48, 56, 55, 128, 65, 66, 48, 56, 54, 128, 65, 66, 48, 56,
+ 53, 128, 65, 66, 48, 56, 50, 128, 65, 66, 48, 56, 49, 128, 65, 66, 48,
+ 56, 48, 128, 65, 66, 48, 55, 57, 128, 65, 66, 48, 55, 56, 128, 65, 66,
+ 48, 55, 55, 128, 65, 66, 48, 55, 54, 128, 65, 66, 48, 55, 52, 128, 65,
+ 66, 48, 55, 51, 128, 65, 66, 48, 55, 48, 128, 65, 66, 48, 54, 57, 128,
+ 65, 66, 48, 54, 55, 128, 65, 66, 48, 54, 54, 128, 65, 66, 48, 54, 53,
+ 128, 65, 66, 48, 54, 49, 128, 65, 66, 48, 54, 48, 128, 65, 66, 48, 53,
+ 57, 128, 65, 66, 48, 53, 56, 128, 65, 66, 48, 53, 55, 128, 65, 66, 48,
+ 53, 54, 128, 65, 66, 48, 53, 53, 128, 65, 66, 48, 53, 52, 128, 65, 66,
+ 48, 53, 51, 128, 65, 66, 48, 53, 49, 128, 65, 66, 48, 53, 48, 128, 65,
+ 66, 48, 52, 57, 128, 65, 66, 48, 52, 56, 128, 65, 66, 48, 52, 55, 128,
+ 65, 66, 48, 52, 54, 128, 65, 66, 48, 52, 53, 128, 65, 66, 48, 52, 52,
+ 128, 65, 66, 48, 52, 49, 128, 65, 66, 48, 52, 48, 128, 65, 66, 48, 51,
+ 57, 128, 65, 66, 48, 51, 56, 128, 65, 66, 48, 51, 55, 128, 65, 66, 48,
+ 51, 52, 128, 65, 66, 48, 51, 49, 128, 65, 66, 48, 51, 48, 128, 65, 66,
+ 48, 50, 57, 128, 65, 66, 48, 50, 56, 128, 65, 66, 48, 50, 55, 128, 65,
+ 66, 48, 50, 54, 128, 65, 66, 48, 50, 52, 128, 65, 66, 48, 50, 51, 77,
+ 128, 65, 66, 48, 50, 51, 128, 65, 66, 48, 50, 50, 77, 128, 65, 66, 48,
+ 50, 50, 70, 128, 65, 66, 48, 50, 50, 128, 65, 66, 48, 50, 49, 77, 128,
+ 65, 66, 48, 50, 49, 70, 128, 65, 66, 48, 50, 49, 128, 65, 66, 48, 50, 48,
+ 128, 65, 66, 48, 49, 55, 128, 65, 66, 48, 49, 54, 128, 65, 66, 48, 49,
+ 51, 128, 65, 66, 48, 49, 49, 128, 65, 66, 48, 49, 48, 128, 65, 66, 48,
+ 48, 57, 128, 65, 66, 48, 48, 56, 128, 65, 66, 48, 48, 55, 128, 65, 66,
+ 48, 48, 54, 128, 65, 66, 48, 48, 53, 128, 65, 66, 48, 48, 52, 128, 65,
+ 66, 48, 48, 51, 128, 65, 66, 48, 48, 50, 128, 65, 66, 48, 48, 49, 128,
+ 65, 65, 90, 72, 65, 65, 75, 75, 85, 128, 65, 65, 89, 73, 78, 128, 65, 65,
+ 89, 65, 78, 78, 65, 128, 65, 65, 89, 128, 65, 65, 87, 128, 65, 65, 79,
+ 128, 65, 65, 74, 128, 65, 65, 66, 65, 65, 70, 73, 76, 73, 128, 65, 65,
+ 48, 51, 50, 128, 65, 65, 48, 51, 49, 128, 65, 65, 48, 51, 48, 128, 65,
+ 65, 48, 50, 57, 128, 65, 65, 48, 50, 56, 128, 65, 65, 48, 50, 55, 128,
+ 65, 65, 48, 50, 54, 128, 65, 65, 48, 50, 53, 128, 65, 65, 48, 50, 52,
+ 128, 65, 65, 48, 50, 51, 128, 65, 65, 48, 50, 50, 128, 65, 65, 48, 50,
+ 49, 128, 65, 65, 48, 50, 48, 128, 65, 65, 48, 49, 57, 128, 65, 65, 48,
+ 49, 56, 128, 65, 65, 48, 49, 55, 128, 65, 65, 48, 49, 54, 128, 65, 65,
+ 48, 49, 53, 128, 65, 65, 48, 49, 52, 128, 65, 65, 48, 49, 51, 128, 65,
+ 65, 48, 49, 50, 128, 65, 65, 48, 49, 49, 128, 65, 65, 48, 49, 48, 128,
+ 65, 65, 48, 48, 57, 128, 65, 65, 48, 48, 56, 128, 65, 65, 48, 48, 55, 66,
+ 128, 65, 65, 48, 48, 55, 65, 128, 65, 65, 48, 48, 55, 128, 65, 65, 48,
+ 48, 54, 128, 65, 65, 48, 48, 53, 128, 65, 65, 48, 48, 52, 128, 65, 65,
+ 48, 48, 51, 128, 65, 65, 48, 48, 50, 128, 65, 65, 48, 48, 49, 128, 65,
+ 56, 48, 55, 128, 65, 56, 48, 54, 128, 65, 56, 48, 53, 128, 65, 56, 48,
+ 52, 128, 65, 56, 48, 51, 128, 65, 56, 48, 50, 128, 65, 56, 48, 49, 128,
+ 65, 56, 48, 48, 128, 65, 55, 51, 178, 65, 55, 50, 182, 65, 55, 49, 183,
+ 65, 55, 49, 181, 65, 55, 49, 180, 65, 55, 49, 179, 65, 55, 49, 178, 65,
+ 55, 49, 177, 65, 55, 49, 176, 65, 55, 48, 57, 45, 182, 65, 55, 48, 57,
+ 45, 180, 65, 55, 48, 57, 45, 179, 65, 55, 48, 57, 45, 178, 65, 55, 48,
+ 185, 65, 55, 48, 184, 65, 55, 48, 183, 65, 55, 48, 182, 65, 55, 48, 181,
+ 65, 55, 48, 180, 65, 55, 48, 179, 65, 55, 48, 178, 65, 55, 48, 177, 65,
+ 54, 54, 52, 128, 65, 54, 54, 51, 128, 65, 54, 54, 50, 128, 65, 54, 54,
+ 49, 128, 65, 54, 54, 48, 128, 65, 54, 53, 57, 128, 65, 54, 53, 56, 128,
+ 65, 54, 53, 55, 128, 65, 54, 53, 54, 128, 65, 54, 53, 53, 128, 65, 54,
+ 53, 52, 128, 65, 54, 53, 51, 128, 65, 54, 53, 50, 128, 65, 54, 53, 49,
+ 128, 65, 54, 52, 57, 128, 65, 54, 52, 56, 128, 65, 54, 52, 54, 128, 65,
+ 54, 52, 53, 128, 65, 54, 52, 52, 128, 65, 54, 52, 51, 128, 65, 54, 52,
+ 50, 128, 65, 54, 52, 48, 128, 65, 54, 51, 56, 128, 65, 54, 51, 55, 128,
+ 65, 54, 51, 52, 128, 65, 54, 50, 57, 128, 65, 54, 50, 56, 128, 65, 54,
+ 50, 55, 128, 65, 54, 50, 54, 128, 65, 54, 50, 52, 128, 65, 54, 50, 51,
+ 128, 65, 54, 50, 50, 128, 65, 54, 50, 49, 128, 65, 54, 50, 48, 128, 65,
+ 54, 49, 57, 128, 65, 54, 49, 56, 128, 65, 54, 49, 55, 128, 65, 54, 49,
+ 54, 128, 65, 54, 49, 53, 128, 65, 54, 49, 52, 128, 65, 54, 49, 51, 128,
+ 65, 54, 49, 50, 128, 65, 54, 49, 49, 128, 65, 54, 49, 48, 128, 65, 54,
+ 48, 57, 128, 65, 54, 48, 56, 128, 65, 54, 48, 54, 128, 65, 54, 48, 52,
+ 128, 65, 54, 48, 51, 128, 65, 54, 48, 50, 128, 65, 54, 48, 49, 128, 65,
+ 54, 48, 48, 128, 65, 53, 57, 56, 128, 65, 53, 57, 54, 128, 65, 53, 57,
+ 53, 128, 65, 53, 57, 52, 128, 65, 53, 57, 50, 128, 65, 53, 57, 49, 128,
+ 65, 53, 56, 57, 128, 65, 53, 56, 56, 128, 65, 53, 56, 55, 128, 65, 53,
+ 56, 54, 128, 65, 53, 56, 53, 128, 65, 53, 56, 52, 128, 65, 53, 56, 51,
+ 128, 65, 53, 56, 50, 128, 65, 53, 56, 49, 128, 65, 53, 56, 48, 128, 65,
+ 53, 55, 57, 128, 65, 53, 55, 56, 128, 65, 53, 55, 55, 128, 65, 53, 55,
+ 54, 128, 65, 53, 55, 53, 128, 65, 53, 55, 52, 128, 65, 53, 55, 51, 128,
+ 65, 53, 55, 50, 128, 65, 53, 55, 49, 128, 65, 53, 55, 48, 128, 65, 53,
+ 54, 57, 128, 65, 53, 54, 56, 128, 65, 53, 54, 54, 128, 65, 53, 54, 53,
+ 128, 65, 53, 54, 52, 128, 65, 53, 54, 51, 128, 65, 53, 53, 57, 128, 65,
+ 53, 53, 55, 128, 65, 53, 53, 54, 128, 65, 53, 53, 53, 128, 65, 53, 53,
+ 52, 128, 65, 53, 53, 51, 128, 65, 53, 53, 50, 128, 65, 53, 53, 49, 128,
+ 65, 53, 53, 48, 128, 65, 53, 52, 57, 128, 65, 53, 52, 56, 128, 65, 53,
+ 52, 55, 128, 65, 53, 52, 53, 128, 65, 53, 52, 50, 128, 65, 53, 52, 49,
+ 128, 65, 53, 52, 48, 128, 65, 53, 51, 57, 128, 65, 53, 51, 56, 128, 65,
+ 53, 51, 55, 128, 65, 53, 51, 54, 128, 65, 53, 51, 53, 128, 65, 53, 51,
+ 52, 128, 65, 53, 51, 50, 128, 65, 53, 51, 49, 128, 65, 53, 51, 48, 128,
+ 65, 53, 50, 57, 128, 65, 53, 50, 56, 128, 65, 53, 50, 55, 128, 65, 53,
+ 50, 54, 128, 65, 53, 50, 53, 128, 65, 53, 50, 52, 128, 65, 53, 50, 51,
+ 128, 65, 53, 50, 50, 128, 65, 53, 50, 49, 128, 65, 53, 50, 48, 128, 65,
+ 53, 49, 57, 128, 65, 53, 49, 56, 128, 65, 53, 49, 55, 128, 65, 53, 49,
+ 54, 128, 65, 53, 49, 53, 128, 65, 53, 49, 52, 128, 65, 53, 49, 51, 128,
+ 65, 53, 49, 50, 128, 65, 53, 49, 49, 128, 65, 53, 49, 48, 128, 65, 53,
+ 48, 57, 128, 65, 53, 48, 56, 128, 65, 53, 48, 55, 128, 65, 53, 48, 54,
+ 128, 65, 53, 48, 53, 128, 65, 53, 48, 52, 128, 65, 53, 48, 51, 128, 65,
+ 53, 48, 50, 128, 65, 53, 48, 49, 128, 65, 52, 57, 55, 128, 65, 52, 57,
+ 54, 128, 65, 52, 57, 53, 128, 65, 52, 57, 52, 128, 65, 52, 57, 51, 128,
+ 65, 52, 57, 50, 128, 65, 52, 57, 49, 128, 65, 52, 57, 48, 128, 65, 52,
+ 56, 57, 128, 65, 52, 56, 56, 128, 65, 52, 56, 55, 128, 65, 52, 56, 54,
+ 128, 65, 52, 56, 53, 128, 65, 52, 56, 52, 128, 65, 52, 56, 51, 128, 65,
+ 52, 56, 50, 128, 65, 52, 56, 49, 128, 65, 52, 56, 48, 128, 65, 52, 55,
+ 57, 128, 65, 52, 55, 56, 128, 65, 52, 55, 55, 128, 65, 52, 55, 54, 128,
+ 65, 52, 55, 53, 128, 65, 52, 55, 52, 128, 65, 52, 55, 51, 128, 65, 52,
+ 55, 50, 128, 65, 52, 55, 49, 128, 65, 52, 55, 48, 128, 65, 52, 54, 57,
+ 128, 65, 52, 54, 56, 128, 65, 52, 54, 55, 128, 65, 52, 54, 54, 128, 65,
+ 52, 54, 53, 128, 65, 52, 54, 52, 128, 65, 52, 54, 51, 128, 65, 52, 54,
+ 50, 128, 65, 52, 54, 49, 128, 65, 52, 54, 48, 128, 65, 52, 53, 57, 128,
+ 65, 52, 53, 56, 128, 65, 52, 53, 55, 65, 128, 65, 52, 53, 55, 128, 65,
+ 52, 53, 54, 128, 65, 52, 53, 53, 128, 65, 52, 53, 52, 128, 65, 52, 53,
+ 51, 128, 65, 52, 53, 50, 128, 65, 52, 53, 49, 128, 65, 52, 53, 48, 65,
+ 128, 65, 52, 53, 48, 128, 65, 52, 52, 57, 128, 65, 52, 52, 56, 128, 65,
+ 52, 52, 55, 128, 65, 52, 52, 54, 128, 65, 52, 52, 53, 128, 65, 52, 52,
+ 52, 128, 65, 52, 52, 51, 128, 65, 52, 52, 50, 128, 65, 52, 52, 49, 128,
+ 65, 52, 52, 48, 128, 65, 52, 51, 57, 128, 65, 52, 51, 56, 128, 65, 52,
+ 51, 55, 128, 65, 52, 51, 54, 128, 65, 52, 51, 53, 128, 65, 52, 51, 52,
+ 128, 65, 52, 51, 51, 128, 65, 52, 51, 50, 128, 65, 52, 51, 49, 128, 65,
+ 52, 51, 48, 128, 65, 52, 50, 57, 128, 65, 52, 50, 56, 128, 65, 52, 50,
+ 55, 128, 65, 52, 50, 54, 128, 65, 52, 50, 53, 128, 65, 52, 50, 52, 128,
+ 65, 52, 50, 51, 128, 65, 52, 50, 50, 128, 65, 52, 50, 49, 128, 65, 52,
+ 50, 48, 128, 65, 52, 49, 57, 128, 65, 52, 49, 56, 45, 86, 65, 83, 128,
+ 65, 52, 49, 56, 128, 65, 52, 49, 55, 45, 86, 65, 83, 128, 65, 52, 49, 55,
+ 128, 65, 52, 49, 54, 45, 86, 65, 83, 128, 65, 52, 49, 54, 128, 65, 52,
+ 49, 53, 45, 86, 65, 83, 128, 65, 52, 49, 53, 128, 65, 52, 49, 52, 45, 86,
+ 65, 83, 128, 65, 52, 49, 52, 128, 65, 52, 49, 51, 45, 86, 65, 83, 128,
+ 65, 52, 49, 51, 128, 65, 52, 49, 50, 45, 86, 65, 83, 128, 65, 52, 49, 50,
+ 128, 65, 52, 49, 49, 45, 86, 65, 83, 128, 65, 52, 49, 49, 128, 65, 52,
+ 49, 48, 193, 65, 52, 49, 48, 45, 86, 65, 83, 128, 65, 52, 49, 176, 65,
+ 52, 48, 57, 45, 86, 65, 83, 128, 65, 52, 48, 57, 128, 65, 52, 48, 56, 45,
+ 86, 65, 83, 128, 65, 52, 48, 56, 128, 65, 52, 48, 55, 45, 86, 65, 83,
+ 128, 65, 52, 48, 55, 128, 65, 52, 48, 54, 45, 86, 65, 83, 128, 65, 52,
+ 48, 54, 128, 65, 52, 48, 53, 45, 86, 65, 83, 128, 65, 52, 48, 53, 128,
+ 65, 52, 48, 52, 45, 86, 65, 83, 128, 65, 52, 48, 52, 128, 65, 52, 48, 51,
+ 45, 86, 65, 83, 128, 65, 52, 48, 51, 128, 65, 52, 48, 50, 45, 86, 65, 83,
+ 128, 65, 52, 48, 50, 128, 65, 52, 48, 49, 45, 86, 65, 83, 128, 65, 52,
+ 48, 49, 128, 65, 52, 48, 48, 45, 86, 65, 83, 128, 65, 52, 48, 48, 128,
+ 65, 51, 57, 57, 128, 65, 51, 57, 56, 128, 65, 51, 57, 55, 128, 65, 51,
+ 57, 54, 128, 65, 51, 57, 53, 128, 65, 51, 57, 52, 128, 65, 51, 57, 179,
+ 65, 51, 57, 50, 128, 65, 51, 57, 49, 128, 65, 51, 57, 48, 128, 65, 51,
+ 56, 57, 128, 65, 51, 56, 56, 128, 65, 51, 56, 55, 128, 65, 51, 56, 54,
+ 65, 128, 65, 51, 56, 54, 128, 65, 51, 56, 53, 128, 65, 51, 56, 52, 128,
+ 65, 51, 56, 51, 65, 128, 65, 51, 56, 179, 65, 51, 56, 50, 128, 65, 51,
+ 56, 49, 65, 128, 65, 51, 56, 49, 128, 65, 51, 56, 48, 128, 65, 51, 55,
+ 57, 128, 65, 51, 55, 56, 128, 65, 51, 55, 55, 128, 65, 51, 55, 54, 128,
+ 65, 51, 55, 53, 128, 65, 51, 55, 52, 128, 65, 51, 55, 51, 128, 65, 51,
+ 55, 50, 128, 65, 51, 55, 49, 65, 128, 65, 51, 55, 49, 128, 65, 51, 55,
+ 48, 128, 65, 51, 54, 57, 128, 65, 51, 54, 56, 65, 128, 65, 51, 54, 56,
+ 128, 65, 51, 54, 55, 128, 65, 51, 54, 54, 128, 65, 51, 54, 53, 128, 65,
+ 51, 54, 52, 65, 128, 65, 51, 54, 52, 128, 65, 51, 54, 51, 128, 65, 51,
+ 54, 50, 128, 65, 51, 54, 49, 128, 65, 51, 54, 48, 128, 65, 51, 53, 57,
+ 65, 128, 65, 51, 53, 57, 128, 65, 51, 53, 56, 128, 65, 51, 53, 55, 128,
+ 65, 51, 53, 54, 128, 65, 51, 53, 53, 128, 65, 51, 53, 52, 128, 65, 51,
+ 53, 51, 128, 65, 51, 53, 50, 128, 65, 51, 53, 49, 128, 65, 51, 53, 48,
+ 128, 65, 51, 52, 57, 128, 65, 51, 52, 56, 128, 65, 51, 52, 55, 128, 65,
+ 51, 52, 54, 128, 65, 51, 52, 53, 128, 65, 51, 52, 52, 128, 65, 51, 52,
+ 51, 128, 65, 51, 52, 50, 128, 65, 51, 52, 49, 128, 65, 51, 52, 48, 128,
+ 65, 51, 51, 57, 128, 65, 51, 51, 56, 128, 65, 51, 51, 55, 128, 65, 51,
+ 51, 54, 67, 128, 65, 51, 51, 54, 66, 128, 65, 51, 51, 54, 65, 128, 65,
+ 51, 51, 54, 128, 65, 51, 51, 53, 128, 65, 51, 51, 52, 128, 65, 51, 51,
+ 51, 128, 65, 51, 51, 50, 67, 128, 65, 51, 51, 50, 66, 128, 65, 51, 51,
+ 50, 65, 128, 65, 51, 51, 50, 128, 65, 51, 51, 49, 128, 65, 51, 51, 48,
+ 128, 65, 51, 50, 57, 65, 128, 65, 51, 50, 57, 128, 65, 51, 50, 56, 128,
+ 65, 51, 50, 55, 128, 65, 51, 50, 54, 128, 65, 51, 50, 53, 128, 65, 51,
+ 50, 52, 128, 65, 51, 50, 51, 128, 65, 51, 50, 50, 128, 65, 51, 50, 49,
+ 128, 65, 51, 50, 48, 128, 65, 51, 49, 57, 128, 65, 51, 49, 56, 128, 65,
+ 51, 49, 55, 128, 65, 51, 49, 54, 128, 65, 51, 49, 53, 128, 65, 51, 49,
+ 52, 128, 65, 51, 49, 51, 67, 128, 65, 51, 49, 51, 66, 128, 65, 51, 49,
+ 51, 65, 128, 65, 51, 49, 51, 128, 65, 51, 49, 50, 128, 65, 51, 49, 49,
+ 128, 65, 51, 49, 48, 128, 65, 51, 48, 57, 67, 128, 65, 51, 48, 57, 66,
+ 128, 65, 51, 48, 57, 65, 128, 65, 51, 48, 57, 128, 65, 51, 48, 56, 128,
+ 65, 51, 48, 55, 128, 65, 51, 48, 54, 128, 65, 51, 48, 53, 128, 65, 51,
+ 48, 52, 128, 65, 51, 48, 51, 128, 65, 51, 48, 50, 128, 65, 51, 48, 49,
+ 128, 65, 51, 48, 48, 128, 65, 50, 57, 57, 65, 128, 65, 50, 57, 57, 128,
+ 65, 50, 57, 56, 128, 65, 50, 57, 55, 128, 65, 50, 57, 54, 128, 65, 50,
+ 57, 53, 128, 65, 50, 57, 52, 65, 128, 65, 50, 57, 52, 128, 65, 50, 57,
+ 51, 128, 65, 50, 57, 50, 128, 65, 50, 57, 49, 128, 65, 50, 57, 48, 128,
+ 65, 50, 56, 57, 65, 128, 65, 50, 56, 57, 128, 65, 50, 56, 56, 128, 65,
+ 50, 56, 55, 128, 65, 50, 56, 54, 128, 65, 50, 56, 53, 128, 65, 50, 56,
+ 52, 128, 65, 50, 56, 51, 128, 65, 50, 56, 50, 128, 65, 50, 56, 49, 128,
+ 65, 50, 56, 48, 128, 65, 50, 55, 57, 128, 65, 50, 55, 56, 128, 65, 50,
+ 55, 55, 128, 65, 50, 55, 54, 128, 65, 50, 55, 53, 128, 65, 50, 55, 52,
+ 128, 65, 50, 55, 51, 128, 65, 50, 55, 50, 128, 65, 50, 55, 49, 128, 65,
+ 50, 55, 48, 128, 65, 50, 54, 57, 128, 65, 50, 54, 56, 128, 65, 50, 54,
+ 55, 65, 128, 65, 50, 54, 55, 128, 65, 50, 54, 54, 128, 65, 50, 54, 53,
+ 128, 65, 50, 54, 52, 128, 65, 50, 54, 51, 128, 65, 50, 54, 50, 128, 65,
+ 50, 54, 49, 128, 65, 50, 54, 48, 128, 65, 50, 53, 57, 128, 65, 50, 53,
+ 56, 128, 65, 50, 53, 55, 128, 65, 50, 53, 54, 128, 65, 50, 53, 53, 128,
+ 65, 50, 53, 52, 128, 65, 50, 53, 51, 128, 65, 50, 53, 50, 128, 65, 50,
+ 53, 49, 128, 65, 50, 53, 48, 128, 65, 50, 52, 57, 128, 65, 50, 52, 56,
+ 128, 65, 50, 52, 55, 128, 65, 50, 52, 54, 128, 65, 50, 52, 53, 128, 65,
+ 50, 52, 52, 128, 65, 50, 52, 51, 128, 65, 50, 52, 50, 128, 65, 50, 52,
+ 49, 128, 65, 50, 52, 48, 128, 65, 50, 51, 57, 128, 65, 50, 51, 56, 128,
+ 65, 50, 51, 55, 128, 65, 50, 51, 54, 128, 65, 50, 51, 53, 128, 65, 50,
+ 51, 52, 128, 65, 50, 51, 51, 128, 65, 50, 51, 50, 128, 65, 50, 51, 49,
+ 128, 65, 50, 51, 48, 128, 65, 50, 50, 57, 128, 65, 50, 50, 56, 128, 65,
+ 50, 50, 55, 65, 128, 65, 50, 50, 55, 128, 65, 50, 50, 54, 128, 65, 50,
+ 50, 53, 128, 65, 50, 50, 52, 128, 65, 50, 50, 51, 128, 65, 50, 50, 50,
+ 128, 65, 50, 50, 49, 128, 65, 50, 50, 48, 128, 65, 50, 49, 57, 128, 65,
+ 50, 49, 56, 128, 65, 50, 49, 55, 128, 65, 50, 49, 54, 65, 128, 65, 50,
+ 49, 54, 128, 65, 50, 49, 53, 65, 128, 65, 50, 49, 53, 128, 65, 50, 49,
+ 52, 128, 65, 50, 49, 51, 128, 65, 50, 49, 50, 128, 65, 50, 49, 49, 128,
+ 65, 50, 49, 48, 128, 65, 50, 48, 57, 65, 128, 65, 50, 48, 57, 128, 65,
+ 50, 48, 56, 128, 65, 50, 48, 55, 65, 128, 65, 50, 48, 55, 128, 65, 50,
+ 48, 54, 128, 65, 50, 48, 53, 128, 65, 50, 48, 52, 128, 65, 50, 48, 51,
+ 128, 65, 50, 48, 50, 66, 128, 65, 50, 48, 50, 65, 128, 65, 50, 48, 50,
+ 128, 65, 50, 48, 49, 128, 65, 50, 48, 48, 128, 65, 49, 57, 57, 128, 65,
+ 49, 57, 56, 128, 65, 49, 57, 55, 128, 65, 49, 57, 54, 128, 65, 49, 57,
+ 53, 128, 65, 49, 57, 52, 128, 65, 49, 57, 51, 128, 65, 49, 57, 50, 128,
+ 65, 49, 57, 49, 128, 65, 49, 57, 48, 128, 65, 49, 56, 57, 128, 65, 49,
+ 56, 56, 128, 65, 49, 56, 55, 128, 65, 49, 56, 54, 128, 65, 49, 56, 53,
+ 128, 65, 49, 56, 52, 128, 65, 49, 56, 51, 128, 65, 49, 56, 50, 128, 65,
+ 49, 56, 49, 128, 65, 49, 56, 48, 128, 65, 49, 55, 57, 128, 65, 49, 55,
+ 56, 128, 65, 49, 55, 55, 128, 65, 49, 55, 54, 128, 65, 49, 55, 53, 128,
+ 65, 49, 55, 52, 128, 65, 49, 55, 51, 128, 65, 49, 55, 50, 128, 65, 49,
+ 55, 49, 128, 65, 49, 55, 48, 128, 65, 49, 54, 57, 128, 65, 49, 54, 56,
+ 128, 65, 49, 54, 55, 128, 65, 49, 54, 54, 128, 65, 49, 54, 53, 128, 65,
+ 49, 54, 52, 128, 65, 49, 54, 51, 128, 65, 49, 54, 50, 128, 65, 49, 54,
+ 49, 128, 65, 49, 54, 48, 128, 65, 49, 53, 57, 128, 65, 49, 53, 56, 128,
+ 65, 49, 53, 55, 128, 65, 49, 53, 54, 128, 65, 49, 53, 53, 128, 65, 49,
+ 53, 52, 128, 65, 49, 53, 51, 128, 65, 49, 53, 50, 128, 65, 49, 53, 49,
+ 128, 65, 49, 53, 48, 128, 65, 49, 52, 57, 128, 65, 49, 52, 56, 128, 65,
+ 49, 52, 55, 128, 65, 49, 52, 54, 128, 65, 49, 52, 53, 128, 65, 49, 52,
+ 52, 128, 65, 49, 52, 51, 128, 65, 49, 52, 50, 128, 65, 49, 52, 49, 128,
+ 65, 49, 52, 48, 128, 65, 49, 51, 57, 128, 65, 49, 51, 56, 128, 65, 49,
+ 51, 55, 128, 65, 49, 51, 54, 128, 65, 49, 51, 53, 65, 128, 65, 49, 51,
+ 53, 128, 65, 49, 51, 52, 128, 65, 49, 51, 51, 128, 65, 49, 51, 50, 128,
+ 65, 49, 51, 49, 67, 128, 65, 49, 51, 49, 128, 65, 49, 51, 48, 128, 65,
+ 49, 50, 57, 128, 65, 49, 50, 56, 128, 65, 49, 50, 55, 128, 65, 49, 50,
+ 54, 128, 65, 49, 50, 53, 65, 128, 65, 49, 50, 53, 128, 65, 49, 50, 52,
+ 128, 65, 49, 50, 51, 128, 65, 49, 50, 50, 128, 65, 49, 50, 49, 128, 65,
+ 49, 50, 48, 66, 128, 65, 49, 50, 48, 128, 65, 49, 49, 57, 128, 65, 49,
+ 49, 56, 128, 65, 49, 49, 55, 128, 65, 49, 49, 54, 128, 65, 49, 49, 53,
+ 65, 128, 65, 49, 49, 53, 128, 65, 49, 49, 52, 128, 65, 49, 49, 51, 128,
+ 65, 49, 49, 50, 128, 65, 49, 49, 49, 128, 65, 49, 49, 48, 66, 128, 65,
+ 49, 49, 48, 65, 128, 65, 49, 49, 48, 128, 65, 49, 48, 57, 128, 65, 49,
+ 48, 56, 128, 65, 49, 48, 55, 67, 128, 65, 49, 48, 55, 66, 128, 65, 49,
+ 48, 55, 65, 128, 65, 49, 48, 55, 128, 65, 49, 48, 54, 128, 65, 49, 48,
+ 53, 66, 128, 65, 49, 48, 53, 65, 128, 65, 49, 48, 53, 128, 65, 49, 48,
+ 52, 67, 128, 65, 49, 48, 52, 66, 128, 65, 49, 48, 52, 65, 128, 65, 49,
+ 48, 52, 128, 65, 49, 48, 51, 128, 65, 49, 48, 50, 65, 128, 65, 49, 48,
+ 50, 128, 65, 49, 48, 49, 65, 128, 65, 49, 48, 49, 128, 65, 49, 48, 48,
+ 65, 128, 65, 49, 48, 48, 45, 49, 48, 50, 128, 65, 49, 48, 48, 128, 65,
+ 48, 57, 57, 128, 65, 48, 57, 56, 65, 128, 65, 48, 57, 56, 128, 65, 48,
+ 57, 55, 65, 128, 65, 48, 57, 55, 128, 65, 48, 57, 54, 128, 65, 48, 57,
+ 53, 128, 65, 48, 57, 52, 128, 65, 48, 57, 51, 128, 65, 48, 57, 50, 128,
+ 65, 48, 57, 49, 128, 65, 48, 57, 48, 128, 65, 48, 56, 57, 128, 65, 48,
+ 56, 56, 128, 65, 48, 56, 55, 128, 65, 48, 56, 54, 128, 65, 48, 56, 53,
+ 128, 65, 48, 56, 52, 128, 65, 48, 56, 51, 128, 65, 48, 56, 50, 128, 65,
+ 48, 56, 49, 128, 65, 48, 56, 48, 128, 65, 48, 55, 57, 128, 65, 48, 55,
+ 56, 128, 65, 48, 55, 55, 128, 65, 48, 55, 54, 128, 65, 48, 55, 53, 128,
+ 65, 48, 55, 52, 128, 65, 48, 55, 51, 128, 65, 48, 55, 50, 128, 65, 48,
+ 55, 49, 128, 65, 48, 55, 48, 128, 65, 48, 54, 57, 128, 65, 48, 54, 56,
+ 128, 65, 48, 54, 55, 128, 65, 48, 54, 54, 67, 128, 65, 48, 54, 54, 66,
+ 128, 65, 48, 54, 54, 65, 128, 65, 48, 54, 54, 128, 65, 48, 54, 53, 128,
+ 65, 48, 54, 52, 128, 65, 48, 54, 51, 128, 65, 48, 54, 50, 128, 65, 48,
+ 54, 49, 128, 65, 48, 54, 48, 128, 65, 48, 53, 57, 128, 65, 48, 53, 56,
+ 128, 65, 48, 53, 55, 128, 65, 48, 53, 54, 128, 65, 48, 53, 53, 128, 65,
+ 48, 53, 52, 128, 65, 48, 53, 51, 128, 65, 48, 53, 50, 128, 65, 48, 53,
+ 49, 128, 65, 48, 53, 48, 128, 65, 48, 52, 57, 128, 65, 48, 52, 56, 128,
+ 65, 48, 52, 55, 128, 65, 48, 52, 54, 66, 128, 65, 48, 52, 54, 65, 128,
+ 65, 48, 52, 54, 128, 65, 48, 52, 53, 65, 128, 65, 48, 52, 53, 128, 65,
+ 48, 52, 52, 128, 65, 48, 52, 51, 65, 128, 65, 48, 52, 51, 128, 65, 48,
+ 52, 50, 65, 128, 65, 48, 52, 50, 128, 65, 48, 52, 49, 65, 128, 65, 48,
+ 52, 49, 128, 65, 48, 52, 48, 65, 128, 65, 48, 52, 48, 128, 65, 48, 51,
+ 57, 65, 128, 65, 48, 51, 57, 128, 65, 48, 51, 56, 128, 65, 48, 51, 55,
+ 128, 65, 48, 51, 54, 128, 65, 48, 51, 53, 128, 65, 48, 51, 52, 128, 65,
+ 48, 51, 51, 128, 65, 48, 51, 50, 65, 128, 65, 48, 50, 56, 66, 128, 65,
+ 48, 50, 54, 65, 128, 65, 48, 49, 55, 65, 128, 65, 48, 49, 52, 65, 128,
+ 65, 48, 49, 48, 65, 128, 65, 48, 48, 54, 66, 128, 65, 48, 48, 54, 65,
+ 128, 65, 48, 48, 53, 65, 128, 65, 45, 87, 79, 128, 65, 45, 69, 85, 128,
+ 45, 85, 205, 45, 80, 72, 82, 85, 128, 45, 75, 72, 89, 85, 196, 45, 75,
+ 72, 89, 73, 76, 128, 45, 68, 90, 85, 196, 45, 67, 72, 65, 210, 45, 67,
+ 72, 65, 76, 128,
+};
+
+static const unsigned int lexicon_offset[] = {
+ 0, 0, 6, 11, 15, 19, 27, 34, 44, 49, 55, 64, 66, 69, 81, 89, 102, 108,
+ 113, 118, 124, 129, 137, 146, 149, 160, 165, 170, 176, 180, 189, 195,
+ 201, 207, 216, 224, 229, 237, 244, 177, 252, 255, 261, 262, 268, 273,
+ 277, 282, 289, 296, 306, 311, 317, 325, 330, 333, 339, 344, 350, 356,
+ 359, 365, 375, 380, 385, 390, 392, 394, 403, 405, 412, 354, 419, 427,
+ 436, 438, 441, 449, 454, 455, 457, 464, 472, 478, 484, 491, 496, 503,
+ 507, 512, 519, 524, 527, 531, 536, 542, 547, 557, 565, 572, 575, 585,
+ 593, 598, 606, 615, 618, 625, 629, 633, 637, 642, 645, 652, 659, 666,
+ 671, 676, 683, 692, 694, 703, 707, 715, 719, 727, 281, 736, 749, 753,
+ 758, 761, 765, 769, 771, 776, 786, 792, 796, 802, 806, 809, 814, 823,
+ 828, 832, 774, 838, 846, 854, 859, 868, 877, 885, 891, 902, 905, 910,
+ 918, 925, 928, 938, 943, 949, 953, 957, 960, 967, 974, 977, 981, 984,
+ 657, 990, 993, 996, 1002, 1007, 1016, 1021, 1025, 1028, 1032, 1035, 1041,
+ 1046, 1050, 617, 1055, 1058, 1067, 1070, 1075, 1080, 1086, 1091, 1096,
+ 1101, 1105, 1110, 1116, 1121, 1126, 1130, 1136, 1141, 1146, 1151, 1155,
+ 1160, 1165, 1170, 1176, 1182, 1188, 1193, 1197, 1202, 1207, 1212, 1216,
+ 1221, 1226, 1231, 1236, 1071, 1076, 1081, 1087, 1092, 1240, 1102, 1246,
+ 1251, 1256, 1263, 1267, 1270, 1279, 1106, 1283, 1111, 1117, 1122, 1287,
+ 1292, 1297, 1301, 1305, 1311, 1315, 1127, 1318, 1320, 1137, 1325, 1329,
+ 1142, 1335, 1147, 1339, 1343, 1350, 1152, 1354, 1362, 1367, 1371, 1374,
+ 1378, 1156, 1161, 1383, 1389, 1166, 1401, 1407, 1413, 1419, 1171, 1183,
+ 1189, 1423, 1427, 1431, 1434, 1194, 1438, 1440, 1445, 1450, 1456, 1461,
+ 1466, 1470, 1475, 1480, 1485, 1490, 1496, 1501, 1506, 1512, 1518, 1523,
+ 1527, 1532, 1537, 1542, 1547, 1552, 1556, 1564, 1569, 1573, 1578, 1583,
+ 1588, 1593, 1597, 1600, 1607, 1612, 1617, 1622, 1627, 1633, 1638, 1642,
+ 1198, 1645, 1651, 1656, 1661, 1666, 1203, 1670, 1674, 1681, 1688, 1208,
+ 1693, 1698, 1213, 1702, 1704, 1709, 1720, 1726, 1217, 1731, 1740, 1222,
+ 1745, 1751, 1756, 1761, 1771, 1780, 1788, 1227, 1798, 1807, 1816, 1821,
+ 1825, 1828, 1837, 1847, 1856, 1861, 1865, 1869, 1873, 1876, 1880, 1885,
+ 1232, 1895, 1237, 1899, 1901, 1907, 1913, 1919, 1925, 1931, 1937, 1943,
+ 1949, 1954, 1960, 1966, 1972, 1978, 1984, 1990, 1996, 2002, 2008, 2013,
+ 2018, 2023, 2028, 2033, 2038, 2043, 2048, 2053, 2058, 2064, 2069, 2075,
+ 2080, 2086, 2092, 2097, 2103, 2109, 2115, 2121, 2126, 2131, 2133, 2134,
+ 2138, 2142, 2147, 2151, 2155, 2159, 2164, 2168, 2171, 2176, 2180, 2185,
+ 2189, 2193, 2198, 2202, 2205, 2209, 2215, 2229, 2233, 2237, 2241, 2244,
+ 2249, 2253, 2257, 2260, 2264, 2269, 2274, 2279, 2284, 2288, 2292, 2296,
+ 2300, 2304, 2309, 2313, 2318, 2322, 2327, 2333, 2340, 2346, 2351, 2356,
+ 2361, 2367, 2372, 2378, 2383, 2388, 2393, 2398, 2403, 2406, 2408, 1088,
+ 2412, 2419, 2427, 2437, 2446, 2460, 2464, 2468, 2473, 2486, 2494, 2497,
+ 2501, 2504, 2509, 2513, 2516, 2520, 2524, 2529, 1715, 2534, 2538, 2541,
+ 2545, 2551, 2558, 2565, 2571, 2576, 2581, 2587, 2593, 2598, 2603, 2608,
+ 2613, 2618, 2623, 2548, 2628, 1706, 2630, 2636, 2640, 2645, 2649, 2653,
+ 1603, 1728, 2658, 2662, 2666, 2669, 2674, 2679, 2684, 2689, 2693, 2700,
+ 2705, 2708, 2712, 2716, 2723, 2729, 2733, 2739, 2743, 2747, 2752, 2759,
+ 2764, 2769, 2776, 2782, 2788, 2794, 2815, 2829, 2846, 2861, 2877, 2894,
+ 2909, 2918, 2923, 2927, 2932, 2937, 2941, 2953, 2960, 2966, 2336, 2972,
+ 2979, 2985, 2989, 2992, 2999, 3005, 3010, 3014, 3019, 3023, 3027, 2156,
+ 3031, 3036, 3041, 3045, 3050, 3058, 3062, 3069, 3074, 3078, 3082, 3086,
+ 3091, 3096, 3101, 3105, 3110, 3115, 3119, 3124, 3129, 3133, 3136, 3140,
+ 3144, 3152, 3157, 3161, 3165, 3171, 3180, 3184, 3188, 3194, 3199, 3206,
+ 3210, 3220, 3224, 3228, 3233, 3237, 3242, 3248, 3253, 3257, 3261, 3265,
+ 2561, 3273, 3278, 3284, 3289, 3293, 3298, 3303, 3307, 3313, 3318, 2160,
+ 3324, 3330, 3335, 3340, 3345, 3350, 3355, 3360, 3365, 3370, 3375, 3380,
+ 3385, 3390, 3395, 3400, 3406, 3411, 1103, 101, 3417, 3421, 3425, 3429,
+ 3434, 3438, 3442, 3448, 3453, 3457, 3461, 3466, 3471, 3475, 3480, 3484,
+ 3487, 3491, 3496, 3500, 3505, 3509, 3512, 3514, 3518, 3522, 3527, 3531,
+ 3534, 3547, 3551, 3555, 3559, 3564, 3568, 3572, 3575, 3579, 3583, 3588,
+ 3592, 3597, 3602, 3607, 3611, 3618, 3623, 3626, 3632, 3635, 3640, 3646,
+ 3650, 3654, 3657, 3662, 3666, 3671, 3675, 3679, 3682, 3688, 3693, 3698,
+ 3704, 3709, 3714, 3720, 3726, 3731, 3736, 3741, 3746, 3749, 979, 644,
+ 3755, 3758, 3763, 3767, 3771, 3775, 3779, 3782, 3786, 3791, 3796, 3800,
+ 3805, 3809, 3814, 3818, 3822, 3826, 3832, 3838, 3841, 3844, 153, 3850,
+ 3855, 3864, 3872, 3881, 3891, 3898, 3904, 3911, 3916, 3920, 3924, 3932,
+ 3939, 3944, 3949, 3956, 3961, 3965, 3975, 3979, 3983, 3988, 3993, 4003,
+ 2172, 4008, 4012, 4015, 4021, 4026, 4032, 4038, 4043, 4050, 4054, 4058,
+ 4062, 4067, 4072, 4077, 4082, 4087, 4092, 634, 616, 1264, 4097, 4104,
+ 4111, 4117, 4126, 4131, 4138, 4145, 4150, 4156, 4162, 4167, 4172, 4176,
+ 4182, 4189, 4194, 4198, 4202, 2181, 4208, 4216, 4222, 4230, 863, 4236,
+ 4244, 4255, 4259, 4269, 4275, 4280, 4285, 4290, 4295, 2186, 4300, 4305,
+ 4320, 4326, 4333, 4344, 4354, 4360, 4365, 4371, 4377, 4380, 4383, 4387,
+ 4392, 4395, 4402, 4411, 4416, 4420, 4424, 4428, 4432, 4437, 4443, 4454,
+ 4458, 3492, 4463, 4475, 4481, 4489, 4493, 4498, 4505, 4510, 4515, 4520,
+ 1472, 4525, 4528, 4531, 4535, 4538, 4544, 4548, 4562, 4566, 4569, 4573,
+ 4579, 4585, 4590, 4594, 4598, 4604, 4615, 4621, 4626, 4632, 4636, 4644,
+ 4656, 4666, 4672, 4677, 4686, 4694, 4705, 4712, 4718, 4724, 4728, 4734,
+ 4743, 4752, 4757, 4763, 4767, 4776, 4782, 4787, 4791, 4796, 4800, 4808,
+ 4814, 4818, 4825, 4830, 4834, 4840, 4846, 4853, 2194, 4862, 4873, 4883,
+ 4892, 4897, 4902, 4907, 4912, 1280, 4917, 4919, 4924, 4930, 4935, 4940,
+ 4945, 4950, 4955, 4960, 4966, 4971, 4977, 4982, 4987, 4992, 4998, 5003,
+ 5008, 5013, 5018, 5024, 5029, 5035, 5040, 5045, 5050, 5055, 5060, 5065,
+ 5071, 5076, 5081, 348, 389, 5086, 5092, 5095, 5099, 5103, 5110, 5116,
+ 5121, 5125, 5129, 5132, 5135, 5139, 5143, 5146, 5150, 5154, 5158, 5163,
+ 5167, 5171, 5177, 5186, 4843, 5191, 5195, 5198, 5203, 5208, 5213, 5218,
+ 5223, 5228, 5233, 5238, 5243, 5248, 5252, 5257, 5262, 5267, 5272, 5277,
+ 5282, 5287, 5292, 5297, 5302, 5306, 5311, 5316, 5321, 5326, 5331, 5336,
+ 5341, 5346, 5351, 5356, 5360, 5365, 5370, 5375, 5380, 5385, 5390, 5395,
+ 5400, 5405, 5410, 5414, 5419, 5424, 5429, 5434, 5439, 5444, 5449, 5454,
+ 5459, 5464, 5468, 5473, 5478, 5483, 5488, 5493, 5498, 5503, 5508, 5513,
+ 5518, 5522, 5527, 5532, 5537, 5542, 5547, 5552, 5557, 5562, 5567, 5572,
+ 5576, 5581, 5586, 5591, 5596, 5602, 5608, 5614, 5620, 5626, 5632, 5638,
+ 5643, 5649, 5655, 5661, 5667, 5673, 5679, 5685, 5691, 5697, 5703, 5708,
+ 5714, 5720, 5726, 5732, 5738, 5744, 5750, 5756, 5762, 5768, 5773, 5779,
+ 5785, 5791, 5797, 5803, 5809, 5815, 5821, 5827, 5833, 5838, 5844, 5850,
+ 5856, 5862, 5868, 5874, 5880, 5886, 5892, 5898, 5903, 5909, 5915, 5921,
+ 5927, 5933, 5939, 5945, 5951, 5957, 5963, 5968, 5972, 5978, 5984, 5990,
+ 5996, 6002, 6008, 6014, 6020, 6026, 6032, 6037, 6043, 6049, 6055, 6061,
+ 6067, 6073, 6079, 6085, 6091, 6097, 6102, 6108, 6114, 6120, 6126, 6132,
+ 6138, 6144, 6150, 6156, 6162, 6167, 6173, 6179, 6185, 6191, 6197, 6203,
+ 6209, 6215, 6221, 6227, 6232, 6238, 6244, 6250, 6256, 6262, 6268, 6274,
+ 6280, 6286, 6292, 6297, 6303, 6309, 6315, 6321, 6327, 6333, 6339, 6345,
+ 6351, 6357, 6362, 6368, 6374, 6380, 6386, 6392, 6398, 6404, 6410, 6416,
+ 6422, 6427, 6433, 6439, 6445, 6451, 6457, 6463, 6469, 6475, 6481, 6487,
+ 6492, 6498, 6504, 6510, 6516, 6522, 6528, 6534, 6540, 6546, 6552, 6557,
+ 6563, 6569, 6575, 6581, 6587, 6593, 6599, 6605, 6611, 6617, 6622, 6626,
+ 6629, 6637, 6644, 6647, 6651, 6664, 6668, 6672, 6676, 6679, 6683, 6688,
+ 6692, 6701, 6705, 6711, 6718, 6729, 6737, 6744, 6750, 6754, 6762, 6771,
+ 6777, 6781, 6793, 6798, 6801, 6806, 6810, 6820, 6828, 6836, 6844, 6850,
+ 6854, 6864, 6874, 6882, 6889, 6896, 6902, 6908, 6915, 6919, 6926, 6936,
+ 6946, 6954, 6961, 6966, 6970, 6974, 6982, 6986, 6996, 7001, 7008, 7015,
+ 7023, 7033, 7038, 7042, 7047, 7051, 7058, 7063, 7077, 7082, 7087, 7094,
+ 3768, 7103, 7107, 7111, 7116, 7120, 7124, 7127, 7132, 7137, 7146, 7152,
+ 7158, 7163, 7169, 7173, 7184, 7194, 7209, 7224, 7239, 7254, 7269, 7284,
+ 7299, 7314, 7329, 7344, 7359, 7374, 7389, 7404, 7419, 7434, 7449, 7464,
+ 7479, 7494, 7509, 7524, 7539, 7554, 7569, 7584, 7599, 7614, 7629, 7644,
+ 7659, 7674, 7689, 7704, 7719, 7734, 7749, 7764, 7779, 7794, 7809, 7824,
+ 7839, 7854, 7869, 7884, 7899, 7914, 7929, 7938, 7947, 7952, 7958, 7968,
+ 7972, 7976, 7981, 7986, 7991, 7999, 8003, 8006, 8010, 3215, 8013, 8018,
+ 353, 534, 8024, 8027, 8035, 8039, 8043, 8046, 8050, 8056, 8060, 8068,
+ 8074, 8079, 8086, 8094, 8101, 8107, 8112, 8119, 8125, 8134, 8142, 8146,
+ 8151, 8159, 8171, 8182, 8189, 8200, 8204, 8208, 8212, 8215, 8221, 3519,
+ 8225, 8227, 8233, 8238, 8243, 8248, 8254, 8259, 8264, 8269, 8274, 8280,
+ 8285, 8290, 8296, 8301, 8307, 8312, 8318, 8323, 8329, 8334, 8339, 8344,
+ 8349, 8354, 8360, 8365, 8370, 8375, 8381, 8387, 8393, 8399, 8405, 8411,
+ 8417, 8423, 8429, 8435, 8441, 8447, 8452, 8457, 8462, 8467, 8472, 8477,
+ 8482, 8487, 8493, 8499, 8504, 8510, 8516, 8522, 8528, 8533, 8538, 8543,
+ 8548, 8554, 8560, 8565, 8570, 8575, 8580, 8585, 8591, 8596, 8602, 8608,
+ 8614, 8620, 8626, 8632, 8638, 8644, 8650, 2203, 8045, 8655, 8659, 8667,
+ 8671, 8674, 8677, 8683, 8690, 1107, 8693, 8697, 8705, 8710, 8715, 8706,
+ 8720, 2230, 8724, 8730, 8736, 8741, 8746, 8753, 8761, 8766, 8770, 8773,
+ 8777, 8783, 8789, 8793, 1653, 631, 8796, 8800, 8805, 8811, 8816, 8820,
+ 8823, 8827, 8833, 8838, 8842, 8849, 8853, 8857, 8861, 773, 8681, 2254,
+ 8864, 8872, 8879, 8886, 8892, 8899, 8907, 8914, 8925, 8932, 8938, 8950,
+ 1123, 1288, 1293, 8961, 8965, 1298, 8969, 8973, 8982, 8990, 8994, 9003,
+ 9009, 9015, 9020, 9024, 9030, 9035, 9043, 9050, 2914, 9057, 9063, 9067,
+ 9076, 9085, 9094, 9103, 9109, 9114, 9119, 9130, 9139, 9151, 9156, 9164,
+ 2289, 9168, 9170, 9175, 9179, 9188, 9196, 1302, 168, 3810, 3815, 9202,
+ 9206, 9215, 9221, 9226, 9229, 9233, 9237, 9242, 9247, 9252, 9257, 9261,
+ 9270, 9276, 2301, 9280, 2906, 9284, 9292, 9296, 9300, 2305, 9304, 9308,
+ 9312, 9316, 9320, 2310, 9324, 9329, 9336, 9342, 9349, 9355, 9358, 9254,
+ 9360, 9368, 9376, 9384, 9387, 9392, 2323, 9397, 8717, 9400, 9402, 9407,
+ 9412, 9417, 9422, 9427, 9432, 9437, 9442, 9447, 9452, 9458, 9463, 9468,
+ 9473, 9479, 9484, 9489, 9494, 9499, 9504, 9509, 9515, 9520, 9525, 9530,
+ 9535, 9540, 9545, 9550, 9555, 9560, 9565, 9570, 9575, 9580, 9585, 9590,
+ 9595, 9600, 9606, 9612, 9617, 9622, 9627, 9632, 9637, 2334, 2341, 2347,
+ 9642, 9650, 9656, 9664, 2373, 2379, 9672, 2384, 2389, 2394, 2399, 9676,
+ 9680, 9685, 9689, 9693, 9697, 9702, 9706, 9711, 9715, 9718, 9721, 9727,
+ 9734, 9740, 9747, 9753, 9760, 9766, 9773, 9779, 9785, 9794, 9800, 9804,
+ 9808, 9812, 9816, 9821, 9825, 9830, 9834, 9840, 9844, 9849, 9856, 9867,
+ 9875, 9885, 9891, 9901, 9910, 9917, 9922, 9926, 9937, 9947, 9960, 9971,
+ 9984, 9995, 10007, 10019, 10031, 10042, 10055, 10068, 10075, 10081,
+ 10092, 10102, 10116, 10123, 10129, 10138, 10146, 10150, 10155, 10159,
+ 10166, 10174, 10181, 10185, 10191, 10195, 10201, 10211, 10215, 10220,
+ 10225, 10232, 10238, 8894, 10248, 10252, 10259, 10265, 10272, 10279,
+ 10283, 10286, 10292, 10296, 10301, 10306, 10311, 10315, 10321, 10329,
+ 10336, 10342, 10346, 10349, 10355, 10365, 10369, 10375, 10380, 10384,
+ 10389, 10393, 10399, 10405, 10410, 10416, 10421, 10426, 10431, 2226,
+ 10436, 10438, 10443, 10451, 10460, 10464, 10470, 10475, 10480, 10485,
+ 10490, 10496, 10501, 10506, 4600, 10511, 10516, 10520, 10526, 10531,
+ 10537, 10542, 10547, 10553, 10558, 10465, 10564, 10568, 10575, 10581,
+ 10586, 10590, 7073, 10595, 10604, 10609, 10614, 9332, 9339, 10619, 3088,
+ 10623, 10628, 10633, 10638, 10476, 10642, 10647, 10652, 10481, 10656,
+ 10486, 10661, 10668, 10675, 10681, 10688, 10694, 10700, 10705, 10712,
+ 10717, 10722, 10727, 10733, 10491, 10497, 10739, 10744, 10750, 10755,
+ 10760, 10768, 1358, 10773, 1048, 10776, 10784, 10800, 10816, 10831,
+ 10839, 10845, 10851, 10860, 10868, 10876, 10884, 10892, 10900, 10908,
+ 10916, 10924, 10933, 10942, 10950, 10959, 10968, 10977, 10986, 10995,
+ 11004, 11013, 11022, 11031, 11040, 11048, 11053, 11057, 11063, 11071,
+ 11078, 11093, 11110, 11129, 11138, 11146, 11161, 11172, 11180, 11186,
+ 11196, 11206, 11214, 11220, 11232, 11241, 11249, 11256, 11263, 11270,
+ 11276, 11281, 11291, 11297, 11305, 11315, 11322, 11332, 11342, 11352,
+ 11360, 11367, 11376, 11386, 11400, 11415, 11424, 11432, 11437, 11441,
+ 11451, 11461, 11473, 11482, 11488, 11493, 11503, 11513, 11523, 11528,
+ 11532, 11542, 11551, 11556, 11572, 11589, 11599, 11604, 11615, 11628,
+ 11639, 11647, 11660, 11672, 11680, 11685, 11689, 11695, 11700, 11708,
+ 11716, 11723, 11734, 11739, 11747, 11757, 11763, 11767, 11770, 11776,
+ 11780, 11786, 11793, 11797, 11805, 11814, 11822, 11829, 11834, 11838,
+ 11843, 11847, 11851, 11859, 11874, 11890, 11896, 11904, 11913, 11921,
+ 11927, 11931, 11938, 11949, 11953, 11956, 11967, 11973, 11978, 10507,
+ 11986, 11992, 11999, 12005, 12010, 12017, 12024, 12031, 12038, 12045,
+ 12052, 12059, 12066, 12073, 12080, 12087, 12094, 12101, 12108, 12115,
+ 12120, 11106, 12125, 12131, 12138, 12145, 12150, 12157, 12166, 12170,
+ 12177, 12189, 12193, 12199, 12204, 12209, 12214, 12219, 12224, 12229,
+ 12232, 12236, 11457, 12240, 12244, 12250, 12256, 12261, 12267, 12272,
+ 12277, 12283, 12288, 12293, 10228, 12298, 12302, 12306, 12310, 12315,
+ 12320, 12325, 12333, 12339, 12344, 12348, 12352, 12359, 12364, 12372,
+ 12379, 12384, 12388, 12391, 12397, 12404, 12408, 12411, 12416, 12420,
+ 4639, 12426, 12435, 46, 12443, 12449, 12454, 12459, 12467, 12474, 12479,
+ 6991, 12485, 12491, 12496, 12500, 12503, 12509, 12517, 12524, 12539,
+ 12558, 12570, 12583, 12596, 12609, 12623, 12636, 12651, 12658, 10512,
+ 12664, 12678, 12683, 12689, 12694, 12702, 12707, 9072, 12712, 12715,
+ 12723, 12730, 12735, 12739, 12745, 12749, 12754, 12759, 12764, 12769,
+ 12774, 12779, 3093, 11194, 12784, 12788, 12794, 12800, 12805, 12811,
+ 12816, 10521, 12822, 12828, 12833, 12838, 12846, 12852, 12865, 12873,
+ 12880, 12886, 10527, 12892, 12900, 12908, 12915, 12928, 12941, 12953,
+ 12963, 12975, 13003, 13011, 13020, 13027, 13039, 13046, 13056, 13065,
+ 13073, 13080, 13085, 13091, 10532, 13096, 13102, 13107, 13112, 13117,
+ 10538, 13122, 13125, 13132, 13138, 13152, 13165, 13176, 9860, 13187,
+ 13193, 13202, 13210, 13217, 13223, 13234, 13240, 13245, 13253, 4113,
+ 13259, 13264, 12531, 13270, 13277, 13282, 10543, 13288, 13293, 13300,
+ 13306, 13312, 13317, 13325, 13333, 13340, 13344, 13356, 13370, 13380,
+ 13385, 13389, 13400, 13406, 13411, 13416, 10548, 13420, 10554, 13425,
+ 13428, 13433, 13445, 13452, 13457, 13461, 13469, 13474, 13478, 13483,
+ 13487, 13494, 13500, 10559, 10466, 13507, 3098, 17, 13514, 13519, 13523,
+ 13527, 13533, 13541, 13551, 13556, 13561, 13568, 13575, 13579, 13590,
+ 13600, 13609, 13618, 13630, 13635, 13639, 13647, 13661, 13665, 13668,
+ 13672, 13680, 13687, 13695, 13699, 13710, 13718, 13722, 13729, 13734,
+ 13738, 13744, 13749, 13755, 13760, 13765, 13769, 13775, 13780, 13791,
+ 13795, 13798, 13804, 13811, 13817, 13822, 13828, 13834, 13841, 13852,
+ 13862, 13872, 13881, 13888, 13897, 13901, 10569, 10576, 10582, 10587,
+ 13907, 13913, 13919, 13924, 13930, 10591, 13936, 13939, 13946, 13951,
+ 13957, 13962, 13977, 13993, 14008, 14016, 14021, 14028, 14034, 14038,
+ 14043, 14048, 14053, 14058, 14063, 14068, 14073, 14078, 14083, 1561, 383,
+ 14088, 14096, 14103, 14109, 14114, 14119, 10596, 14121, 14125, 14130,
+ 14134, 14144, 14149, 14153, 14156, 14165, 14169, 14172, 14179, 10605,
+ 14184, 14187, 14195, 14202, 14210, 14214, 14220, 14228, 14232, 14239,
+ 14248, 14255, 14251, 14262, 14266, 14272, 14276, 14280, 14284, 14290,
+ 14296, 14306, 14314, 14321, 14325, 14333, 14338, 14342, 14349, 14354,
+ 14361, 14365, 14370, 14375, 14379, 14386, 14392, 14400, 14406, 14411,
+ 14421, 14428, 14433, 14438, 14442, 14446, 14454, 4469, 14462, 14467,
+ 10610, 14471, 14478, 14482, 14485, 14493, 14500, 14504, 14507, 6846,
+ 14511, 14516, 14521, 14525, 14536, 14546, 14551, 14557, 14562, 14571,
+ 14575, 14578, 14586, 14591, 14596, 14603, 14608, 4865, 10615, 14613,
+ 14617, 14624, 14629, 14634, 14639, 7021, 14644, 14649, 14654, 14659,
+ 14665, 14670, 14676, 14681, 14686, 14691, 14696, 14701, 14706, 14711,
+ 14716, 14721, 14726, 14731, 14736, 14741, 14746, 14751, 14756, 14762,
+ 14767, 14772, 14777, 14782, 14787, 14793, 14798, 14803, 14809, 14814,
+ 14820, 14825, 14831, 14836, 14841, 14846, 14851, 14857, 14862, 14867,
+ 14872, 14880, 988, 112, 14886, 14890, 14895, 14900, 14904, 14908, 14912,
+ 14917, 14921, 14926, 14930, 14933, 14937, 14941, 14947, 14952, 14962,
+ 14968, 14976, 14982, 14986, 14990, 14997, 15005, 15014, 15025, 15035,
+ 15042, 15049, 15053, 15062, 15071, 15079, 15086, 15095, 15104, 15113,
+ 15122, 15132, 15142, 15152, 15162, 15172, 15181, 15191, 15201, 15211,
+ 15221, 15231, 15241, 15251, 15260, 15270, 15280, 15290, 15300, 15310,
+ 15320, 15329, 15339, 15349, 15359, 15369, 15379, 15389, 15399, 15409,
+ 15419, 15428, 15438, 15448, 15458, 15468, 15478, 15488, 15498, 15508,
+ 15518, 15528, 15537, 15543, 1132, 15547, 15550, 15554, 15559, 15566,
+ 15572, 15577, 15581, 15586, 15595, 15604, 15612, 15617, 15621, 15625,
+ 15631, 15636, 15642, 10624, 15647, 15652, 15661, 15666, 10634, 15671,
+ 11444, 11454, 11464, 15674, 15680, 15688, 10639, 15695, 15699, 15703,
+ 15709, 15714, 15718, 15728, 15734, 15740, 15745, 15754, 15762, 15769,
+ 15776, 15781, 15788, 15793, 15797, 15800, 15811, 15821, 15834, 15843,
+ 15851, 15862, 15874, 15884, 15894, 15899, 15903, 15908, 15913, 15917,
+ 15923, 15931, 15938, 15949, 15954, 15964, 15973, 15977, 15980, 15987,
+ 15997, 16006, 16013, 16017, 16024, 16030, 16035, 16040, 16044, 15590,
+ 16053, 16057, 16063, 16067, 16072, 16076, 16083, 16090, 16094, 16103,
+ 16111, 16119, 16126, 16134, 16146, 16157, 16167, 16174, 16180, 16189,
+ 16200, 16209, 16221, 16233, 16245, 16255, 16264, 16274, 16283, 16291,
+ 16298, 16308, 16317, 16325, 16329, 16334, 16340, 16346, 16351, 16356,
+ 16360, 16365, 16370, 16375, 16380, 16385, 16390, 16395, 8738, 16400,
+ 16402, 16406, 16411, 16417, 16424, 16430, 16436, 16445, 16449, 16455,
+ 16463, 16470, 16479, 16488, 16497, 16506, 16515, 16524, 16533, 16542,
+ 16552, 16562, 16571, 16577, 16584, 16591, 16597, 16611, 16617, 16624,
+ 16632, 16641, 16649, 16655, 16664, 16670, 16679, 16690, 16696, 16706,
+ 16714, 16721, 16729, 16737, 16744, 16753, 16766, 16775, 16783, 16790,
+ 16803, 16809, 16815, 16825, 16834, 16843, 16852, 16860, 16865, 16869,
+ 16875, 16881, 16886, 16893, 16900, 10242, 16905, 16910, 16917, 16925,
+ 16930, 16942, 16949, 16954, 16966, 14943, 16971, 16977, 16985, 16991,
+ 16996, 17004, 17012, 17019, 17027, 17034, 17040, 17046, 17054, 17062,
+ 17068, 17076, 17082, 17087, 17093, 17100, 17106, 17111, 17115, 17126,
+ 17134, 17142, 17148, 17153, 17160, 17169, 17175, 17180, 17188, 17195,
+ 17204, 17218, 4413, 17222, 17227, 17232, 17238, 17243, 17248, 17252,
+ 17257, 17262, 17267, 8737, 17272, 17277, 17282, 17287, 17292, 17296,
+ 17301, 17306, 17311, 17316, 17322, 17328, 14216, 17333, 17339, 17344,
+ 17349, 17354, 10643, 17359, 17364, 17369, 17374, 17379, 17393, 17410,
+ 17428, 17440, 17453, 17470, 17486, 17503, 17513, 17532, 17543, 17554,
+ 17565, 2803, 17576, 17587, 17598, 17615, 17626, 17637, 17642, 10648,
+ 17647, 17651, 2483, 17655, 17661, 17664, 17670, 17678, 17686, 17692,
+ 17701, 17708, 17713, 17721, 17729, 17736, 17740, 17745, 17751, 17758,
+ 17766, 17773, 17785, 17792, 17798, 17806, 17811, 17817, 17823, 17828,
+ 13971, 17835, 17839, 17848, 17854, 17859, 17867, 17876, 17884, 17891,
+ 17897, 17905, 17912, 17918, 17924, 17931, 17938, 17944, 17950, 17954,
+ 17963, 17971, 17976, 17986, 17993, 17999, 18007, 18013, 18021, 18029,
+ 18036, 18049, 18053, 18060, 18069, 18078, 18087, 18095, 18105, 18112,
+ 18117, 3969, 18124, 18129, 1248, 18133, 18140, 17273, 18144, 18150,
+ 18154, 18162, 18174, 18179, 18186, 18192, 18197, 18204, 17278, 18208,
+ 18212, 18220, 18225, 18229, 17283, 18233, 17288, 18237, 18244, 18249,
+ 18253, 18260, 18264, 18267, 18275, 18282, 18287, 18295, 18299, 18306,
+ 18323, 18332, 18341, 18345, 18348, 18354, 18362, 18368, 18373, 18377,
+ 18382, 18387, 18392, 18397, 18402, 18407, 4047, 18412, 18414, 18422,
+ 18429, 18439, 18451, 18456, 18460, 18466, 18471, 18479, 18483, 18489,
+ 18494, 18500, 18503, 18510, 18518, 18525, 18531, 18536, 18542, 18547,
+ 18554, 18560, 18565, 18575, 18584, 18591, 18596, 18600, 18606, 18612,
+ 18616, 18623, 18629, 18634, 18640, 18648, 18656, 18663, 18669, 18675,
+ 18680, 18686, 18692, 18700, 18705, 18710, 18718, 18724, 18730, 18735,
+ 18742, 18747, 18751, 18757, 18763, 18768, 18774, 18781, 18786, 18792,
+ 18795, 18801, 18812, 18818, 18827, 18830, 18834, 18838, 18852, 18865,
+ 18877, 18883, 18888, 18895, 18901, 18907, 18918, 18930, 18942, 18952,
+ 18961, 18969, 18976, 18987, 18997, 19007, 19015, 19018, 17302, 19023,
+ 19028, 19035, 17307, 17458, 19043, 19056, 19071, 19082, 17475, 19100,
+ 19113, 19126, 19137, 12546, 19148, 19161, 19180, 19191, 19202, 19213,
+ 2824, 19226, 19230, 19238, 19249, 19260, 19268, 19283, 19298, 19309,
+ 19316, 19322, 19330, 19334, 19340, 19344, 19347, 19360, 19372, 19382,
+ 19390, 19397, 19405, 19415, 19420, 19427, 19432, 19439, 19450, 19460,
+ 19466, 19471, 19476, 17312, 19480, 19486, 19493, 19499, 19504, 19509,
+ 19514, 19518, 17317, 17323, 19522, 17329, 19527, 19535, 19540, 19544,
+ 19551, 19559, 19566, 19575, 19582, 19586, 19590, 19595, 19600, 19605,
+ 19610, 19615, 10487, 19620, 19622, 19627, 19632, 19638, 19643, 19648,
+ 19653, 19658, 19662, 19668, 19674, 19679, 19685, 19690, 19695, 19699,
+ 19705, 19710, 19714, 19719, 19724, 19736, 19741, 19747, 19752, 19757,
+ 19763, 19769, 19774, 19779, 19784, 19791, 19797, 19808, 19815, 19824,
+ 19829, 19833, 279, 19837, 19845, 19850, 19856, 19862, 19867, 19874,
+ 19881, 19887, 19892, 19898, 19903, 19908, 19913, 19920, 19930, 19938,
+ 19943, 19948, 19955, 19961, 19970, 19980, 19990, 20004, 20018, 20032,
+ 20046, 20061, 20076, 20093, 20111, 20124, 20130, 20135, 20140, 20144,
+ 20152, 20157, 20165, 20171, 20177, 20182, 20187, 20191, 20197, 20202,
+ 20206, 20213, 20218, 20222, 20233, 20239, 20244, 20249, 20256, 20261,
+ 20265, 3927, 20270, 20276, 20283, 17334, 20289, 20293, 20299, 20304,
+ 20309, 20313, 20319, 20324, 20329, 20336, 20341, 15730, 20345, 20350,
+ 20354, 20359, 20365, 20371, 20378, 20388, 20396, 20403, 20408, 20412,
+ 20421, 20429, 20436, 20443, 20449, 20454, 20460, 20465, 20470, 20476,
+ 20481, 20487, 20492, 20498, 20504, 20511, 20517, 20522, 20527, 10713,
+ 20536, 20539, 20547, 20553, 20558, 20563, 20573, 20580, 20586, 20591,
+ 20596, 20602, 20607, 20613, 20618, 20624, 20631, 20637, 20643, 20648,
+ 20656, 20663, 20668, 20673, 20679, 20684, 20688, 20697, 20708, 20715,
+ 20722, 20730, 20737, 20744, 20749, 20754, 20760, 20765, 20773, 20779,
+ 20785, 20790, 20797, 20803, 20808, 20812, 20818, 20823, 20828, 20832,
+ 20837, 1321, 8762, 3112, 20841, 20845, 20849, 20853, 20857, 20861, 20864,
+ 20869, 20876, 20884, 20894, 20905, 20915, 20926, 20938, 20949, 20959,
+ 20970, 20982, 20993, 21005, 21018, 21030, 21041, 21051, 21062, 21074,
+ 21085, 21098, 21110, 21121, 21133, 21146, 21158, 21171, 21185, 21198,
+ 21210, 21221, 21231, 21242, 21254, 21265, 21277, 21290, 21302, 21313,
+ 21325, 21338, 21351, 21365, 21378, 21390, 21401, 21413, 21426, 21438,
+ 21451, 21465, 21478, 21490, 21503, 21517, 21530, 21544, 21558, 21571,
+ 21583, 21594, 21604, 17345, 21611, 21617, 21627, 21635, 21642, 21650,
+ 21660, 21669, 21682, 21687, 21692, 21700, 21707, 15839, 15848, 21714,
+ 21724, 21739, 21745, 21752, 21759, 21766, 21772, 21778, 21789, 21797,
+ 21805, 21815, 21825, 21834, 17350, 21843, 21849, 21855, 21864, 21872,
+ 21880, 21885, 21894, 21902, 21914, 21924, 21934, 21944, 21953, 21965,
+ 21975, 21985, 21996, 22003, 22008, 22015, 22027, 22039, 22051, 22063,
+ 22075, 22087, 22099, 22111, 22123, 22135, 22146, 22158, 22170, 22182,
+ 22194, 22206, 22218, 22230, 22242, 22254, 22266, 22277, 22289, 22301,
+ 22313, 22325, 22337, 22349, 22361, 22373, 22385, 22397, 22408, 22420,
+ 22432, 22444, 22456, 22468, 22480, 22492, 22504, 22516, 22528, 22539,
+ 22551, 22563, 22575, 22587, 22599, 22611, 22623, 22635, 22647, 22659,
+ 22670, 22682, 22694, 22706, 22718, 22730, 22742, 22754, 22766, 22778,
+ 22790, 22801, 22813, 22825, 22837, 22849, 22861, 22873, 22885, 22897,
+ 22909, 22921, 22932, 22944, 22956, 22968, 22980, 22993, 23006, 23019,
+ 23032, 23045, 23058, 23071, 23083, 23096, 23109, 23122, 23135, 23148,
+ 23161, 23174, 23187, 23200, 23213, 23225, 23238, 23251, 23264, 23277,
+ 23290, 23303, 23316, 23329, 23342, 23355, 23367, 23380, 23393, 23406,
+ 23419, 23432, 23445, 23458, 23471, 23484, 23497, 23509, 23522, 23535,
+ 23548, 23561, 23574, 23587, 23600, 23613, 23626, 23639, 23651, 23664,
+ 23677, 23690, 23703, 23716, 23729, 23742, 23755, 23768, 23781, 23793,
+ 23804, 23817, 23830, 23843, 23856, 23869, 23882, 23895, 23908, 23921,
+ 23934, 23946, 23959, 23972, 23985, 23998, 24011, 24024, 24037, 24050,
+ 24063, 24076, 24088, 24101, 24114, 24127, 24140, 24153, 24166, 24179,
+ 24192, 24205, 24218, 24230, 24243, 24256, 24269, 24282, 24295, 24308,
+ 24321, 24334, 24347, 24360, 24372, 24385, 24398, 24411, 24424, 24437,
+ 24450, 24463, 24476, 24489, 24502, 24514, 24527, 24540, 24553, 24566,
+ 24579, 24592, 24605, 24618, 24631, 24644, 24656, 24669, 24682, 24695,
+ 24708, 24721, 24734, 24747, 24760, 24773, 24786, 24798, 24811, 24824,
+ 24837, 24850, 24863, 24876, 24889, 24902, 24915, 24928, 24940, 24953,
+ 24966, 24979, 24992, 25005, 25018, 25031, 25044, 25057, 25070, 25082,
+ 25095, 25108, 25121, 25134, 25147, 25160, 25173, 25186, 25199, 25212,
+ 25224, 25235, 25244, 25252, 25260, 25267, 25273, 25277, 25283, 25289,
+ 25298, 25306, 25311, 25317, 25322, 25326, 25335, 10492, 25346, 25352,
+ 25359, 25367, 25374, 13145, 13159, 25381, 25388, 25397, 25402, 25407,
+ 25414, 25419, 25424, 8778, 8784, 8790, 25429, 25434, 25437, 25442, 25450,
+ 25457, 25464, 25476, 25483, 25489, 25498, 25503, 25512, 25521, 25527,
+ 25535, 25544, 25548, 25554, 25559, 25569, 25576, 25582, 25590, 25596,
+ 25603, 25609, 25619, 25628, 25632, 25639, 25643, 25648, 25654, 25662,
+ 25666, 25676, 17360, 25685, 25691, 25695, 25704, 25713, 25723, 25729,
+ 17365, 25736, 25743, 25754, 25762, 25772, 25781, 25789, 10207, 25797,
+ 25802, 25808, 25813, 25817, 25821, 25825, 11301, 25830, 25838, 25845,
+ 25854, 25862, 25869, 25876, 25885, 25891, 1062, 25898, 25904, 25908,
+ 25914, 25921, 25927, 25935, 25941, 25948, 25954, 25960, 25969, 25973,
+ 25981, 25989, 25996, 26005, 26012, 26017, 26021, 26031, 26042, 26053,
+ 26058, 26063, 26069, 26078, 26083, 26096, 9000, 26100, 26106, 26112,
+ 26118, 26123, 26131, 26135, 26142, 26151, 26156, 17638, 26164, 26168,
+ 26180, 26185, 26189, 26192, 26198, 26204, 26210, 26215, 26220, 26224,
+ 26227, 26238, 26243, 10769, 26250, 26255, 26260, 26265, 26270, 26275,
+ 26280, 26285, 26290, 10774, 26295, 26300, 26305, 26310, 26315, 26320,
+ 26325, 26330, 26335, 26340, 26345, 26350, 26356, 26361, 26366, 26371,
+ 26376, 26381, 26386, 26391, 26396, 26401, 26407, 26413, 26418, 26423,
+ 26428, 26433, 26438, 26443, 26448, 26453, 26458, 26464, 26469, 26474,
+ 26479, 26485, 26491, 26496, 26501, 26506, 26511, 26516, 26521, 26526,
+ 26531, 26537, 26542, 26547, 26552, 26557, 26563, 26568, 26573, 26577,
+ 1244, 145, 26585, 26589, 26593, 26597, 26602, 26606, 15736, 2409, 26610,
+ 26615, 26619, 26624, 26628, 26633, 26637, 26643, 26648, 26652, 26656,
+ 26664, 26668, 26672, 26679, 26684, 26689, 26693, 26699, 26704, 26708,
+ 26713, 26718, 26722, 26729, 26736, 26743, 26748, 26752, 26756, 26761,
+ 26765, 26768, 26774, 26787, 26792, 26798, 26807, 26812, 11049, 26817,
+ 26826, 26831, 26834, 26838, 26843, 26848, 26853, 26858, 26863, 2920,
+ 2925, 26868, 26874, 26878, 26884, 3888, 26889, 26894, 26899, 26905,
+ 26910, 16686, 26915, 26920, 26925, 26930, 26936, 26941, 26946, 26952,
+ 26957, 26961, 26966, 26971, 26976, 26981, 26986, 26990, 26995, 26999,
+ 27004, 27009, 27014, 27019, 27023, 27028, 27032, 27037, 27042, 27047,
+ 26962, 3121, 26967, 27052, 27060, 27067, 11395, 27079, 27087, 27097,
+ 27115, 27134, 27143, 27151, 26972, 27158, 27163, 27171, 26977, 27176,
+ 27181, 27189, 27194, 27199, 27203, 19858, 27208, 27216, 27221, 27225,
+ 27232, 27238, 27247, 27251, 27259, 27265, 27269, 27272, 20692, 27279,
+ 27283, 27287, 27292, 27298, 27305, 27310, 10234, 27314, 27319, 27324,
+ 27329, 27334, 27339, 1663, 1668, 27344, 27350, 27356, 27361, 27365,
+ 27369, 27373, 27377, 27381, 27385, 27389, 27393, 25470, 27396, 27403,
+ 27411, 27417, 27423, 27428, 27433, 27439, 27443, 27448, 27455, 16586,
+ 16593, 27461, 27473, 27476, 27483, 27487, 19883, 27494, 27502, 27513,
+ 27522, 27535, 27545, 27559, 27571, 27585, 27598, 27610, 27620, 27632,
+ 27638, 27653, 27677, 27695, 27714, 27727, 27741, 27759, 27775, 27792,
+ 27810, 27821, 27840, 27857, 27877, 27895, 27907, 27921, 27935, 27947,
+ 27964, 27983, 28001, 28013, 28031, 28050, 17518, 28063, 28083, 28095,
+ 12577, 28107, 28112, 28117, 28122, 28131, 28137, 28142, 28146, 28153,
+ 28159, 28163, 28168, 28173, 28178, 28183, 28188, 28193, 2506, 28198,
+ 28204, 28208, 28211, 28222, 28226, 28229, 28237, 28243, 14882, 28247,
+ 28256, 28267, 28273, 28279, 28294, 28303, 28311, 28318, 28323, 28327,
+ 28334, 28340, 28349, 28357, 28364, 28374, 28383, 28393, 28398, 28407,
+ 28416, 28427, 28438, 28448, 28465, 4557, 28475, 28479, 28489, 28497,
+ 28507, 28518, 28524, 28529, 28539, 28547, 28554, 28560, 28567, 28572,
+ 27010, 28576, 28585, 28589, 28592, 28597, 28605, 28612, 28621, 28629,
+ 28637, 28645, 28655, 28664, 28670, 28676, 28682, 28686, 27015, 27020,
+ 28690, 28700, 28710, 28720, 28728, 28735, 28745, 28753, 28761, 28767,
+ 28775, 798, 28784, 17725, 649, 28798, 28807, 28815, 28826, 28837, 28847,
+ 28856, 28868, 28877, 28886, 28893, 28899, 28909, 28918, 28927, 28935,
+ 28943, 28953, 28961, 28969, 28976, 28982, 28987, 28992, 28997, 8156,
+ 29002, 29005, 29009, 29014, 29022, 29028, 29033, 29037, 3751, 27033,
+ 29045, 27038, 29051, 29057, 29063, 29068, 29073, 29077, 29085, 29091,
+ 29097, 29101, 3912, 29109, 29114, 29119, 29123, 29127, 11681, 29134,
+ 29142, 29156, 29163, 29170, 29176, 11690, 11696, 29184, 29192, 29199,
+ 29204, 29209, 27043, 29215, 29226, 29235, 19031, 29243, 29248, 2755,
+ 29253, 29264, 29270, 29275, 29279, 29283, 29286, 29293, 29300, 29306,
+ 29314, 29321, 29327, 29331, 8196, 29336, 29340, 29344, 29352, 29357,
+ 29362, 29367, 1696, 29372, 29377, 29382, 29387, 29392, 29397, 29402,
+ 29407, 29412, 29417, 29422, 29427, 29432, 29437, 29443, 29448, 29453,
+ 29458, 29463, 29468, 29473, 29479, 29484, 29489, 29494, 29499, 29504,
+ 29509, 29514, 29520, 29526, 29531, 29537, 29542, 29547, 5, 29553, 29557,
+ 29561, 29565, 29570, 29574, 29578, 29582, 29586, 29591, 29595, 29600,
+ 29604, 29607, 29611, 29616, 29620, 29625, 29629, 29633, 29637, 29642,
+ 29646, 29650, 29660, 29665, 29669, 29673, 29678, 29683, 29692, 29697,
+ 29702, 29706, 29710, 29719, 29732, 29744, 29753, 29762, 29767, 29773,
+ 29778, 29782, 29786, 29796, 29805, 29813, 29819, 29824, 29828, 29835,
+ 29842, 29852, 29861, 29869, 12934, 29877, 29884, 29892, 29901, 29910,
+ 29918, 29928, 29933, 29937, 29941, 29944, 29946, 29950, 29954, 29959,
+ 29964, 29968, 29972, 29975, 29979, 29982, 29986, 29989, 29992, 29996,
+ 30002, 30006, 30010, 30014, 30018, 30023, 30028, 30033, 30037, 30040,
+ 30045, 30051, 30056, 30062, 30067, 30071, 30077, 30081, 30085, 30090,
+ 30094, 30099, 30104, 30108, 30112, 30119, 30123, 30126, 30130, 30134,
+ 30140, 30145, 30151, 30155, 30159, 30164, 30171, 30177, 30181, 30190,
+ 30194, 30198, 30201, 30207, 30212, 30218, 1385, 1748, 30223, 30228,
+ 30233, 30238, 30243, 30248, 30253, 2213, 827, 30258, 30261, 30265, 30269,
+ 30274, 30278, 17737, 30282, 30287, 30292, 30296, 30299, 30304, 30308,
+ 30313, 30317, 17741, 30322, 30325, 30328, 30334, 30338, 30343, 30347,
+ 30360, 30368, 30372, 30375, 30383, 30392, 30399, 30404, 30410, 30416,
+ 30424, 30431, 30438, 30442, 30446, 30450, 30455, 30460, 30464, 30472,
+ 30477, 30484, 30496, 30507, 30512, 30516, 30523, 30527, 30532, 30538,
+ 30541, 30546, 30551, 30558, 30562, 30566, 30569, 30575, 8900, 2413,
+ 30579, 30584, 30600, 11100, 30620, 30629, 30645, 30649, 30656, 30659,
+ 30665, 30675, 30681, 30690, 30699, 30714, 30725, 30737, 30748, 30756,
+ 30765, 30771, 30780, 30790, 30800, 30811, 30822, 30832, 30841, 30848,
+ 30857, 30865, 30872, 30879, 30886, 30894, 30901, 30908, 30921, 30928,
+ 30936, 30943, 30949, 30954, 30963, 30970, 30976, 30981, 30989, 30997,
+ 31004, 31011, 28499, 31023, 31035, 31049, 31057, 31065, 31073, 31080,
+ 31092, 31101, 31110, 31118, 31126, 31134, 31141, 31147, 31156, 31164,
+ 31174, 31183, 31193, 31202, 31211, 31219, 31224, 31228, 31231, 31235,
+ 31239, 31243, 31247, 31251, 31257, 31263, 31268, 31276, 31283, 31291,
+ 31298, 10806, 17799, 31306, 31313, 31318, 31325, 31331, 31337, 31344,
+ 14024, 31351, 31354, 31366, 31374, 31380, 31385, 31389, 31400, 31410,
+ 31420, 11620, 31429, 31438, 31446, 31456, 31465, 31472, 31479, 31487,
+ 31491, 17818, 31494, 31501, 31505, 4501, 31511, 31514, 31521, 31527,
+ 31541, 31546, 31554, 31560, 31571, 31578, 31584, 31590, 31594, 31599,
+ 31603, 31612, 31619, 31625, 8953, 31632, 31640, 31647, 31653, 31658,
+ 31664, 31670, 31680, 31692, 31703, 31713, 11252, 31721, 31727, 17836,
+ 31731, 31733, 31236, 11633, 31742, 31747, 31753, 31763, 31768, 31775,
+ 31783, 31789, 31794, 31799, 31804, 31808, 31813, 31820, 31826, 31835,
+ 31843, 31847, 31854, 31864, 31870, 31879, 31885, 31892, 4771, 31898,
+ 31904, 31909, 31916, 31928, 31939, 31944, 31952, 31956, 31966, 31972,
+ 31976, 31981, 31991, 32000, 32004, 32011, 32019, 32026, 32032, 32037,
+ 32045, 32052, 32057, 32064, 32076, 32085, 32089, 32097, 15656, 32101,
+ 32111, 32115, 32123, 32130, 32137, 30379, 32148, 32153, 32157, 32164,
+ 32171, 26695, 31161, 32176, 32180, 32183, 27827, 32188, 32202, 32218,
+ 32236, 32255, 32272, 32290, 27846, 32307, 32327, 27863, 32339, 32351,
+ 19087, 32363, 27883, 32377, 32389, 12590, 32403, 32408, 32413, 32418,
+ 32424, 32430, 32436, 32440, 32448, 32454, 32461, 32466, 32476, 32483,
+ 32489, 12128, 32495, 32497, 32502, 32510, 32514, 31816, 32520, 32527,
+ 13866, 13876, 32534, 32541, 32551, 32556, 32560, 32563, 32569, 32577,
+ 32589, 32599, 32615, 32628, 32642, 19105, 32656, 32663, 32667, 32670,
+ 32675, 32679, 32686, 32693, 32700, 32707, 32717, 32722, 32727, 32732,
+ 32740, 32748, 32753, 32762, 28520, 3561, 32767, 32770, 32773, 32778,
+ 32785, 32790, 32795, 32811, 32819, 32827, 10864, 32835, 32840, 32844,
+ 32850, 32855, 32861, 32864, 32870, 32882, 32890, 32897, 32903, 32910,
+ 32921, 32935, 32948, 32954, 32963, 32969, 32978, 32990, 33001, 33011,
+ 33020, 33029, 33037, 33047, 33056, 33067, 673, 33074, 33081, 33087,
+ 33092, 33098, 33105, 33111, 33122, 33132, 33142, 33151, 33157, 33164,
+ 33169, 33177, 33184, 33192, 33200, 33212, 7142, 33219, 33222, 33231,
+ 33239, 33245, 33251, 33256, 33260, 33263, 33269, 33276, 33281, 33286,
+ 33293, 33298, 33302, 33314, 33325, 33334, 33342, 18008, 33347, 33355,
+ 33360, 33368, 33374, 33380, 33385, 13859, 9802, 33388, 33392, 33396,
+ 33399, 33402, 33408, 33416, 33424, 33428, 33432, 33437, 33441, 33444,
+ 33453, 33458, 33463, 33467, 33470, 33475, 33483, 33494, 33503, 33507,
+ 33513, 33519, 33523, 33529, 33537, 33559, 33583, 33594, 33603, 33609,
+ 33616, 33623, 33629, 33637, 33643, 33648, 33659, 33677, 33684, 33692,
+ 33696, 33703, 33708, 33717, 33730, 33738, 33750, 33761, 33772, 33782,
+ 33796, 33805, 33813, 33825, 33836, 11117, 33845, 33856, 33867, 33879,
+ 33889, 33898, 33908, 33913, 33917, 33925, 33936, 33946, 33952, 33957,
+ 33961, 33964, 33967, 33975, 33983, 33992, 34002, 34011, 34017, 34022,
+ 34036, 2838, 34058, 34069, 34078, 34088, 34100, 34109, 34118, 34128,
+ 34136, 34144, 34153, 34158, 34169, 34174, 34183, 34189, 34200, 34204,
+ 34207, 34217, 34226, 34234, 34244, 34254, 34262, 34271, 34278, 34284,
+ 34292, 34299, 34308, 34317, 34322, 34327, 34331, 34339, 34346, 34352,
+ 34356, 34364, 34371, 34382, 34397, 34404, 34410, 34420, 34429, 34435,
+ 34446, 34450, 34457, 34461, 34468, 34474, 16838, 34480, 34484, 34489,
+ 34495, 34502, 34506, 34510, 34518, 34526, 34532, 34541, 34548, 34555,
+ 34560, 34565, 34575, 28574, 34579, 34582, 34587, 34592, 34597, 34602,
+ 34607, 34612, 34617, 34622, 34628, 34633, 34638, 34644, 1094, 770, 34649,
+ 34652, 34659, 34668, 1777, 34675, 34680, 34684, 34690, 1143, 643, 34695,
+ 347, 34699, 34709, 34718, 34726, 34735, 34743, 34750, 34761, 34769,
+ 34778, 34786, 34796, 34804, 34809, 11794, 34813, 34821, 34829, 34834,
+ 17754, 4101, 34840, 34846, 34852, 6669, 34857, 34861, 34868, 34874,
+ 34880, 34884, 34893, 34899, 34904, 34911, 1336, 34917, 34923, 34928,
+ 34935, 34939, 1243, 6677, 34944, 34954, 34962, 34968, 34978, 34987,
+ 34995, 35001, 35006, 35014, 35021, 13376, 35027, 35034, 35039, 35045,
+ 35052, 35062, 1404, 253, 2212, 35068, 35074, 35081, 35092, 35103, 35111,
+ 35118, 35128, 35137, 35145, 35154, 35161, 35168, 35181, 35188, 35194,
+ 35205, 35224, 35229, 1148, 35233, 35238, 35246, 3984, 35250, 35255,
+ 35259, 35263, 1340, 29973, 35273, 35277, 35282, 35286, 35292, 3846,
+ 35298, 35306, 35313, 35324, 35333, 35341, 35366, 35374, 35379, 3985, 401,
+ 35385, 35393, 35401, 35408, 35413, 35419, 35424, 2281, 12792, 35431,
+ 35437, 31595, 31934, 35443, 656, 106, 35447, 35451, 35457, 595, 10679,
+ 35462, 35467, 35474, 35480, 35484, 35488, 1549, 35491, 35495, 18296,
+ 35498, 35503, 35510, 35516, 8966, 35521, 35529, 35536, 35542, 27205,
+ 35546, 35550, 35554, 35558, 1834, 20204, 35562, 35567, 35571, 35574,
+ 35582, 35590, 35595, 35604, 35612, 35615, 35622, 35629, 35641, 27284,
+ 35651, 35663, 35671, 35676, 35680, 35688, 35695, 35702, 35711, 35717,
+ 35724, 35731, 35734, 35738, 35742, 1351, 35752, 35754, 35759, 35765,
+ 35771, 35776, 35781, 35786, 35791, 35796, 35801, 35806, 35811, 35816,
+ 35821, 35826, 35831, 35836, 35841, 35847, 35853, 35859, 35865, 35870,
+ 35875, 35880, 35886, 35891, 35896, 35901, 35907, 35912, 35918, 35923,
+ 35928, 35933, 35938, 35944, 35949, 35955, 35960, 35965, 35970, 35975,
+ 35981, 35986, 35992, 35997, 36002, 36007, 36012, 36017, 36022, 36027,
+ 36032, 36037, 36043, 36049, 36055, 36060, 36065, 36070, 36075, 36081,
+ 36087, 36093, 36099, 36105, 36111, 36116, 36122, 36127, 36132, 36137,
+ 36142, 36148, 2552, 36153, 2559, 2566, 2962, 36158, 2572, 2582, 36164,
+ 2614, 2619, 2624, 36168, 36173, 36178, 36184, 36189, 36194, 36198, 36203,
+ 36209, 36214, 36219, 36224, 36230, 36235, 36239, 36243, 36248, 36253,
+ 36258, 36263, 36268, 36274, 36280, 36285, 36289, 36294, 36300, 36304,
+ 36309, 36314, 36319, 36324, 36328, 36331, 36336, 36341, 36346, 36351,
+ 36356, 36362, 36368, 36373, 36378, 36383, 36387, 36392, 36397, 36402,
+ 36407, 36412, 36417, 36421, 36426, 36431, 36436, 36440, 36444, 36448,
+ 36453, 36461, 36466, 36471, 36477, 36483, 36489, 36494, 36502, 36506,
+ 36509, 36514, 36519, 36523, 36528, 36533, 36537, 36542, 36546, 36549,
+ 36554, 4211, 21695, 36559, 36564, 36569, 36574, 36582, 25865, 34932,
+ 10318, 36587, 36592, 36596, 36601, 36605, 36609, 36614, 36618, 36621,
+ 36624, 36628, 36633, 36637, 36645, 36649, 36652, 36657, 36661, 36665,
+ 36670, 36675, 36679, 36685, 36690, 36695, 36702, 36709, 36713, 36716,
+ 36722, 36731, 36738, 36746, 36753, 36757, 36762, 36766, 36770, 36776,
+ 36781, 36787, 36791, 36797, 36802, 36807, 36811, 36818, 36824, 36830,
+ 36836, 36842, 36849, 36855, 36861, 36867, 36873, 36879, 36885, 36891,
+ 36898, 36904, 36911, 36917, 36923, 36929, 36935, 36941, 36947, 36953,
+ 36959, 36965, 36971, 36976, 36981, 13731, 36986, 36992, 36997, 37002,
+ 37007, 37012, 37015, 37021, 37026, 37034, 37039, 37043, 37048, 37054,
+ 37063, 37069, 37074, 37079, 37084, 37088, 37093, 37097, 37102, 37107,
+ 37112, 37117, 37124, 37131, 37137, 37143, 37148, 19801, 37155, 37161,
+ 37168, 37174, 37180, 37185, 37193, 37198, 11288, 37202, 37207, 37212,
+ 37218, 37223, 37228, 37232, 37237, 37242, 37248, 37253, 37258, 37263,
+ 37267, 37272, 37277, 37281, 37286, 37291, 37295, 37300, 37304, 37309,
+ 37314, 37319, 37323, 37328, 37332, 37337, 37341, 37348, 37352, 37356,
+ 18452, 37361, 37368, 37377, 37383, 37389, 37398, 37406, 37415, 37423,
+ 37428, 37432, 37439, 37445, 37453, 37457, 37460, 37465, 37469, 37478,
+ 37486, 37504, 37510, 1403, 37516, 37519, 37523, 27351, 27357, 37529,
+ 37533, 37544, 37555, 37566, 37578, 37582, 37589, 37596, 37603, 37608,
+ 37612, 37620, 37625, 37630, 37635, 37640, 6734, 16742, 25864, 37645,
+ 37650, 37654, 16733, 37659, 37665, 37670, 37676, 37681, 37687, 37692,
+ 37698, 37703, 37709, 37715, 37721, 37726, 37682, 37688, 37730, 37735,
+ 37741, 37746, 37752, 37757, 37763, 37768, 37693, 12422, 37772, 37704,
+ 37710, 37716, 3054, 3760, 37778, 37781, 37786, 37792, 37798, 37804,
+ 37811, 37817, 37823, 37829, 37835, 37841, 37847, 37853, 37859, 37865,
+ 37871, 37877, 37883, 37890, 37896, 37902, 37908, 37914, 37920, 37923,
+ 37928, 37931, 37938, 37943, 37951, 37955, 37960, 37965, 37971, 37976,
+ 37981, 37985, 37990, 37996, 38001, 38007, 38012, 38018, 38023, 38029,
+ 38035, 38039, 38044, 38049, 38054, 38059, 38063, 38068, 38073, 38078,
+ 38084, 38090, 38096, 38102, 38107, 38111, 38114, 38120, 38126, 38135,
+ 38143, 38150, 38155, 38159, 38163, 38168, 18239, 38173, 38181, 38187,
+ 4152, 1253, 38192, 38197, 38201, 9016, 38207, 38213, 38220, 9025, 38224,
+ 38230, 38236, 38243, 38249, 38258, 38266, 38278, 38287, 38291, 38298,
+ 38304, 38309, 38313, 38317, 38320, 38330, 38339, 38347, 37683, 38352,
+ 38362, 38372, 38382, 38388, 38393, 38403, 38408, 38421, 38435, 38446,
+ 38458, 38470, 38484, 38497, 38509, 38521, 17559, 38535, 38540, 38545,
+ 38549, 38553, 38557, 38561, 38567, 38572, 38577, 38582, 38587, 38592,
+ 38597, 1737, 32999, 38602, 38607, 38612, 37731, 38617, 38620, 38625,
+ 38630, 38635, 38641, 38647, 19411, 11994, 38652, 38658, 38665, 19039,
+ 38671, 38676, 38681, 38685, 38690, 38695, 37736, 38700, 38705, 38710,
+ 38716, 37742, 38721, 38724, 38731, 38739, 38745, 38751, 38757, 38768,
+ 38773, 38780, 38787, 38794, 38802, 38811, 38820, 38826, 38832, 38840,
+ 37747, 38845, 38851, 38857, 37753, 38862, 38867, 38875, 38883, 38889,
+ 38896, 38902, 38909, 38916, 38922, 38930, 38940, 38947, 38953, 38958,
+ 38964, 38969, 38974, 38981, 38990, 38998, 39003, 39009, 39016, 39024,
+ 39030, 39035, 39041, 39050, 39057, 33997, 39063, 39067, 39072, 39081,
+ 39086, 39091, 39096, 14972, 39104, 39109, 39114, 39119, 39123, 39128,
+ 39133, 39140, 39145, 39150, 39155, 37758, 25793, 39161, 2655, 158, 39164,
+ 39167, 39171, 39175, 39185, 39193, 39200, 39204, 39208, 39211, 39219,
+ 39226, 39233, 31888, 39242, 39245, 39252, 39258, 39263, 39267, 39274,
+ 39278, 39286, 39294, 39301, 39316, 39320, 39324, 39327, 39333, 39340,
+ 39344, 39350, 39354, 39361, 39369, 39377, 39384, 37694, 39391, 39399,
+ 39404, 39416, 12075, 12082, 12089, 12096, 12103, 12110, 626, 434, 39422,
+ 39427, 39432, 39438, 39443, 39448, 4178, 39453, 39456, 39461, 39466,
+ 39471, 39476, 39481, 39488, 27469, 39493, 39498, 39503, 39508, 39513,
+ 39519, 39524, 39530, 37934, 39536, 39541, 39547, 39553, 39563, 39568,
+ 39573, 39577, 39582, 39587, 39592, 39597, 39610, 39615, 27083, 20286,
+ 1064, 39619, 39625, 39629, 39634, 39639, 39645, 39650, 39655, 39659,
+ 39664, 39669, 39675, 39680, 39685, 1258, 39689, 39694, 39699, 39704,
+ 39708, 39713, 39718, 39723, 39729, 39735, 39740, 39744, 39748, 39753,
+ 39758, 39763, 39767, 39772, 39780, 39784, 39790, 39794, 39801, 39810,
+ 20057, 37705, 39816, 39823, 39831, 39839, 39846, 39852, 39861, 39874,
+ 39886, 39891, 39897, 39901, 2981, 39905, 39909, 39335, 39918, 39929,
+ 39940, 39945, 34065, 39950, 39955, 39959, 34185, 27362, 39964, 39971,
+ 39975, 39980, 37711, 25900, 39984, 39989, 39995, 40000, 40004, 40008,
+ 40011, 40015, 40021, 40030, 40041, 40053, 37717, 40058, 40061, 40065,
+ 40069, 40074, 40079, 40084, 40089, 40094, 40099, 40104, 40109, 373,
+ 40114, 40119, 40124, 40129, 40134, 40139, 40145, 40150, 40155, 40161,
+ 40166, 40172, 40177, 40183, 40188, 40193, 40198, 40203, 40208, 40213,
+ 40218, 40223, 40229, 40234, 40239, 40244, 40249, 40254, 40259, 40264,
+ 40270, 40276, 40281, 40286, 40291, 40296, 40301, 40306, 40311, 40316,
+ 40321, 40326, 40331, 40336, 40341, 40346, 40351, 40356, 40361, 40366,
+ 40376, 40386, 40392, 342, 14, 40397, 40400, 40404, 40408, 40416, 40420,
+ 40424, 31568, 16975, 1818, 40427, 40432, 40436, 40441, 40445, 40450,
+ 40454, 40459, 40463, 40466, 40468, 40472, 40477, 40481, 40492, 40495,
+ 40497, 40501, 40513, 40525, 40534, 40538, 40548, 40552, 40558, 40563,
+ 40572, 40578, 40583, 40588, 40592, 40596, 40601, 40608, 40613, 40619,
+ 40624, 40628, 40635, 31169, 31179, 40639, 40644, 40649, 40654, 40661,
+ 40665, 40672, 40679, 40685, 9171, 40689, 40698, 40706, 40721, 40735,
+ 40744, 40752, 40763, 40772, 40777, 40784, 40794, 8165, 40804, 40809,
+ 40815, 40820, 40824, 40827, 40832, 40836, 40841, 40845, 40852, 40857,
+ 40862, 40867, 40877, 40882, 40887, 40892, 10188, 40897, 40899, 40907,
+ 40910, 40913, 40921, 40936, 40944, 40954, 40956, 40959, 40963, 40969,
+ 40973, 40978, 40983, 41001, 41015, 41034, 41051, 41060, 41068, 41073,
+ 41078, 1396, 41084, 41090, 41095, 41105, 41114, 41122, 41127, 41133,
+ 41138, 41147, 41156, 41167, 41172, 41179, 41185, 41189, 41198, 41205,
+ 41213, 41220, 41233, 41241, 41245, 41255, 41261, 41266, 41270, 41278,
+ 41286, 41291, 41295, 41299, 41308, 41314, 41319, 41327, 41337, 41346,
+ 41355, 41364, 41375, 41383, 41394, 41403, 41411, 41418, 41424, 41429,
+ 41440, 41451, 41456, 41460, 41463, 41467, 41477, 41485, 41491, 41502,
+ 41513, 41524, 41535, 41546, 41557, 41568, 41579, 41591, 41603, 41615,
+ 41627, 41639, 41651, 41663, 41672, 41676, 41684, 41690, 41696, 41703,
+ 41709, 41714, 41720, 41724, 41729, 41734, 41739, 40371, 40381, 2526,
+ 41744, 41746, 41751, 41756, 41761, 41764, 41766, 41770, 41773, 41780,
+ 41784, 11644, 41788, 41794, 41801, 41807, 41817, 41822, 41828, 41832,
+ 41837, 41850, 31758, 41856, 41862, 41871, 41880, 21918, 41887, 41896,
+ 41904, 38368, 41910, 41915, 41919, 41928, 41936, 41943, 41948, 41952,
+ 41957, 41962, 41970, 41974, 41982, 41988, 41994, 41999, 42004, 42008,
+ 42011, 42016, 42029, 42045, 27953, 42062, 42074, 42091, 42103, 42117,
+ 27970, 27989, 42129, 42141, 2855, 42155, 42160, 42165, 42170, 42174,
+ 42181, 42193, 42200, 42209, 42219, 42222, 42233, 42244, 42252, 42257,
+ 42261, 42266, 42271, 42276, 42281, 42286, 42291, 1768, 947, 42296, 42300,
+ 42304, 42307, 42312, 42317, 42323, 42328, 42333, 42339, 42345, 42350,
+ 42354, 42359, 42364, 42369, 42373, 42376, 42382, 42387, 42392, 42397,
+ 42401, 42406, 42412, 42420, 32069, 42425, 42430, 42437, 42443, 42449,
+ 42454, 42462, 27478, 42469, 42474, 42479, 42484, 42488, 42491, 42496,
+ 42500, 42504, 42511, 42517, 42523, 42529, 42536, 42541, 42547, 41281,
+ 42551, 42555, 42560, 42573, 42578, 42584, 42592, 42599, 42607, 42617,
+ 42623, 42629, 42635, 42639, 42648, 42656, 42663, 42668, 42673, 12445,
+ 42678, 42688, 42695, 42701, 42711, 42716, 42722, 42730, 4017, 42737,
+ 42744, 42750, 42757, 4023, 42761, 42766, 42777, 42784, 42790, 42799,
+ 42803, 42806, 4609, 42813, 42820, 42826, 42832, 42840, 42850, 35414,
+ 42857, 42865, 42871, 42876, 42882, 42887, 42891, 31517, 42897, 42904,
+ 42910, 42918, 42927, 42934, 42940, 42951, 28772, 42957, 42964, 42970,
+ 42980, 42985, 42989, 42997, 43005, 43012, 43018, 43023, 11246, 941,
+ 43028, 43032, 43034, 43038, 43043, 43046, 43048, 43053, 43059, 43064,
+ 43069, 43076, 39484, 43082, 43087, 43091, 43096, 43100, 43109, 43113,
+ 43119, 43126, 43132, 43139, 43144, 43153, 43158, 43162, 43167, 43174,
+ 43182, 43190, 43195, 25956, 43199, 43202, 43206, 43210, 12889, 1005,
+ 43214, 43219, 43227, 43232, 43236, 43245, 43252, 43256, 43260, 43268,
+ 43275, 16260, 43285, 43289, 43293, 43301, 43309, 43315, 43320, 43324,
+ 43333, 16008, 43339, 43348, 43355, 43360, 43367, 43374, 43382, 43389,
+ 43397, 43405, 43414, 43419, 43426, 43433, 43440, 43447, 43454, 43459,
+ 43466, 43472, 43489, 43497, 43507, 43515, 43522, 43530, 461, 43534,
+ 43540, 43544, 43549, 40768, 43555, 43558, 43562, 43568, 43579, 43587,
+ 4028, 43595, 43601, 43607, 43617, 43623, 43632, 43641, 43651, 43658,
+ 43664, 43669, 4034, 4040, 43678, 43686, 43693, 43697, 14356, 43705,
+ 43709, 43716, 43724, 43731, 43740, 43747, 43753, 43762, 43772, 43778,
+ 43786, 43795, 43802, 43810, 43817, 26758, 43821, 43828, 43834, 43844,
+ 43853, 43861, 43872, 43876, 43886, 43893, 43898, 43903, 43909, 43916,
+ 43924, 43933, 43942, 43952, 43963, 43970, 43975, 43982, 3269, 43990,
+ 43996, 44001, 44008, 44014, 44020, 44025, 44038, 44051, 44064, 44071,
+ 44077, 44085, 44093, 44098, 44102, 44106, 44111, 44116, 44121, 44126,
+ 44131, 44136, 1365, 44141, 44145, 44149, 44153, 44157, 44161, 44165,
+ 44169, 44173, 44177, 44181, 44185, 44189, 44193, 44197, 44201, 44205,
+ 44209, 44213, 44217, 44221, 44225, 44229, 44233, 44237, 44241, 44245,
+ 44249, 44253, 44257, 44261, 44265, 44269, 44273, 44277, 44281, 44285,
+ 44289, 44293, 44297, 44301, 44305, 44309, 44313, 44317, 44321, 44325,
+ 44329, 44333, 44337, 44341, 44345, 44349, 44353, 44357, 44361, 44365,
+ 44369, 44373, 44377, 44381, 44385, 44389, 44393, 44397, 44401, 44405,
+ 44409, 44413, 44417, 44421, 44425, 44429, 44433, 44437, 44441, 44445,
+ 44449, 44453, 44457, 44461, 44465, 44469, 44473, 44477, 44481, 44485,
+ 44489, 44493, 44497, 44501, 44505, 44509, 44513, 44517, 44521, 44525,
+ 44529, 44533, 44537, 44541, 44545, 44549, 44553, 44557, 44561, 44565,
+ 44569, 44573, 44577, 44581, 44585, 44589, 44593, 44597, 44601, 44605,
+ 44609, 44613, 44617, 44621, 44625, 44629, 44633, 44637, 44641, 44645,
+ 44649, 44653, 44657, 44661, 44665, 44669, 44673, 44677, 44681, 44685,
+ 44689, 44693, 44697, 44701, 44705, 44709, 44713, 44717, 44721, 44725,
+ 44729, 44733, 44737, 44741, 44745, 44749, 44753, 44758, 44762, 44767,
+ 44771, 44776, 44780, 44785, 44789, 44795, 44800, 44804, 44809, 44813,
+ 44818, 44822, 44827, 44831, 44836, 44840, 44845, 44849, 44854, 44858,
+ 44864, 44870, 44875, 44879, 44884, 44888, 44894, 44899, 44903, 44908,
+ 44912, 44917, 44921, 44927, 44932, 44936, 44941, 44945, 44950, 44954,
+ 44959, 44963, 44969, 44974, 44978, 44983, 44987, 44993, 44998, 45002,
+ 45007, 45011, 45016, 45020, 45025, 45029, 45034, 45038, 45044, 45049,
+ 45053, 45059, 45064, 45068, 45074, 45079, 45083, 45088, 45092, 45097,
+ 45101, 45107, 45113, 45119, 45125, 45131, 45137, 45143, 45149, 45154,
+ 45158, 45163, 45167, 45173, 45178, 45182, 45187, 45191, 45196, 45200,
+ 45205, 45209, 45214, 45218, 45223, 45227, 45232, 45236, 45242, 45247,
+ 45251, 45256, 45260, 45266, 45272, 45277, 127, 63, 45281, 45283, 45287,
+ 45291, 45295, 45300, 45304, 45308, 45313, 11153, 45318, 45324, 1677,
+ 7181, 45330, 45333, 45338, 45342, 45347, 45351, 45355, 45360, 12233,
+ 45364, 45368, 45372, 630, 45376, 18561, 45381, 45385, 45390, 45395,
+ 45400, 45404, 45411, 45417, 45423, 31790, 45428, 45431, 45435, 45440,
+ 45446, 45450, 45453, 45461, 45467, 45472, 45476, 45479, 45483, 45489,
+ 45493, 45497, 3811, 3816, 15084, 45500, 45504, 45508, 45512, 45516,
+ 45524, 45531, 45535, 15958, 45542, 45556, 45563, 45574, 361, 45579,
+ 45583, 45589, 45601, 45607, 45613, 45618, 45624, 18613, 45628, 45632,
+ 35727, 45641, 45647, 45656, 45660, 45664, 45669, 45675, 45680, 45684,
+ 45689, 45693, 45697, 45704, 45710, 45715, 45726, 45741, 45756, 45771,
+ 45787, 45805, 12140, 45819, 45826, 45832, 45836, 45839, 45848, 45853,
+ 45857, 45865, 19242, 45873, 45877, 45887, 45898, 35617, 1042, 45911,
+ 45920, 45938, 45957, 45966, 45974, 45982, 1690, 12342, 45986, 27374,
+ 45989, 31556, 45994, 11478, 45999, 46005, 46010, 46016, 46021, 46027,
+ 46032, 46038, 46043, 46049, 46055, 46061, 46066, 46022, 46028, 46070,
+ 46033, 46039, 46044, 46075, 46050, 46056, 9184, 4434, 46081, 46089,
+ 46093, 46096, 46103, 46107, 46112, 46117, 46124, 46130, 46136, 46141,
+ 17850, 46145, 31573, 46149, 46153, 46157, 46164, 46170, 46174, 33931,
+ 46183, 10351, 46187, 10780, 46190, 46197, 46203, 46207, 14381, 46214,
+ 46220, 46225, 46232, 46239, 46246, 34730, 9081, 46253, 46260, 46267,
+ 46273, 46278, 46285, 46296, 46302, 46307, 46312, 46317, 46321, 46326,
+ 46333, 46023, 46337, 46347, 46356, 46367, 46373, 46381, 46388, 46393,
+ 46398, 46403, 46408, 46413, 46417, 46421, 46428, 46434, 46442, 2416,
+ 30582, 12245, 12257, 12262, 12268, 46451, 12273, 12278, 12284, 46456,
+ 46466, 46470, 12289, 46475, 20484, 46478, 46483, 46487, 46491, 46502,
+ 46510, 42204, 46518, 46523, 46530, 46537, 46541, 46544, 46552, 12153,
+ 46559, 46562, 46568, 46578, 6767, 46587, 46592, 46598, 46602, 46610,
+ 46614, 46624, 46630, 46635, 46646, 46655, 46664, 46673, 46682, 46691,
+ 46700, 46709, 46715, 46721, 46726, 46732, 46738, 46744, 46749, 46752,
+ 46759, 46765, 46769, 46774, 46781, 46788, 46792, 46795, 46805, 46818,
+ 46827, 46836, 46847, 46860, 46872, 46883, 46892, 46903, 46908, 46917,
+ 46922, 12294, 46928, 46935, 46943, 46950, 46955, 46960, 31836, 46964,
+ 46971, 4374, 25, 46975, 46980, 20333, 46984, 46987, 46990, 34122, 46994,
+ 34739, 47002, 47006, 47010, 47013, 47019, 47025, 47030, 37782, 47039,
+ 47047, 47053, 47060, 34105, 47064, 34342, 47068, 47077, 47081, 47089,
+ 47095, 47101, 47106, 47110, 34765, 47116, 47119, 47127, 47135, 47143,
+ 4772, 47149, 47153, 47157, 47162, 47169, 47175, 47180, 47185, 47189,
+ 47195, 47200, 47206, 4662, 820, 47213, 47217, 47220, 47232, 47239, 47244,
+ 18434, 47248, 47256, 47264, 47272, 47280, 47287, 47295, 47303, 47310,
+ 47318, 47326, 47334, 47342, 47350, 47358, 47366, 47374, 47382, 47390,
+ 47398, 47405, 47413, 47421, 47429, 47437, 47445, 47453, 47461, 47469,
+ 47477, 47485, 47493, 47501, 47509, 47517, 47525, 47533, 47541, 47549,
+ 47557, 47564, 47572, 47579, 47587, 47595, 47603, 47611, 47619, 47627,
+ 47635, 47643, 47654, 26794, 47659, 47662, 47669, 47673, 47679, 47683,
+ 47689, 47694, 47700, 47705, 47710, 47714, 47718, 47725, 47733, 47738,
+ 47743, 47753, 47759, 47772, 47778, 47784, 47790, 47793, 47800, 47805,
+ 4700, 47811, 4869, 965, 47816, 47819, 47822, 47825, 37866, 37872, 47828,
+ 37878, 37891, 37897, 37903, 47834, 37909, 37915, 47840, 47846, 10, 47854,
+ 47861, 47865, 47869, 47877, 38726, 47881, 47885, 47892, 47897, 47901,
+ 47906, 47912, 47917, 47923, 47928, 47932, 47936, 47940, 47945, 47949,
+ 47954, 47958, 47962, 47969, 47974, 47978, 47982, 47987, 47991, 47996,
+ 48000, 48004, 48009, 48015, 18743, 18748, 48020, 48024, 48027, 48033,
+ 48037, 48041, 25750, 48046, 48050, 48056, 48063, 48069, 48074, 40797,
+ 48084, 48089, 48097, 48101, 48104, 48108, 38741, 48116, 4738, 48121,
+ 48126, 48130, 48135, 48139, 48144, 16026, 48155, 48159, 48162, 48166,
+ 48174, 48179, 48183, 48188, 48193, 48197, 48201, 48205, 48208, 48212,
+ 48215, 48220, 48225, 48230, 48235, 48240, 48245, 8664, 16042, 48250,
+ 48253, 48259, 48264, 48270, 48275, 48281, 48286, 48292, 48297, 48303,
+ 48309, 48315, 48320, 48324, 48328, 48339, 48347, 48354, 48360, 48365,
+ 48376, 48386, 48392, 48397, 48404, 48413, 48429, 48445, 48455, 34007,
+ 48462, 48466, 48471, 48476, 48480, 48484, 43937, 48490, 48495, 48499,
+ 48506, 48511, 48516, 48520, 48523, 48527, 48533, 32802, 48537, 26108,
+ 48542, 48549, 48557, 48563, 48569, 48576, 48584, 48590, 48594, 48599,
+ 48605, 48613, 48618, 48622, 48631, 11134, 48639, 48643, 48651, 48658,
+ 48663, 48668, 48673, 48677, 48680, 48686, 48690, 48693, 48697, 48704,
+ 48709, 48716, 48720, 48726, 48730, 48736, 48741, 48746, 5107, 5114,
+ 48751, 48760, 48768, 48773, 48779, 48791, 48804, 48818, 48825, 48831,
+ 48837, 48842, 48850, 48853, 48855, 48866, 48878, 48889, 48904, 48921,
+ 48941, 48963, 48970, 48977, 48984, 48990, 48994, 8663, 48997, 49001,
+ 49005, 49010, 49014, 49018, 49021, 49025, 49039, 28019, 49058, 49071,
+ 49084, 49097, 28037, 49112, 2808, 49127, 49133, 49137, 49147, 49151,
+ 49155, 49160, 49164, 49171, 49176, 49180, 49187, 49193, 49198, 49204,
+ 49214, 49226, 49237, 49242, 49249, 49253, 49257, 49260, 49268, 19263,
+ 4141, 49273, 18782, 49286, 49293, 49300, 49306, 49310, 49314, 49319,
+ 49325, 49330, 49336, 49340, 49344, 49347, 49352, 49356, 49361, 49366,
+ 49371, 49376, 49381, 49386, 49391, 49396, 49401, 8727, 18793, 49406,
+ 49410, 49416, 49425, 49430, 49439, 49446, 43768, 49452, 49457, 49461,
+ 49468, 49473, 49480, 49488, 49494, 49498, 49501, 49505, 49510, 2886,
+ 49517, 49524, 49528, 49531, 49536, 49541, 49547, 49552, 49557, 49561,
+ 49566, 49576, 49581, 49587, 49592, 49599, 47234, 49605, 49611, 49619,
+ 49629, 49634, 49639, 49643, 49648, 49653, 8167, 8179, 49658, 49661,
+ 49668, 49674, 49683, 10268, 41421, 49691, 49695, 49699, 38789, 49707,
+ 49718, 49726, 43985, 49733, 49738, 49743, 49754, 49761, 49772, 38813,
+ 26125, 49780, 4652, 49785, 16459, 49791, 34096, 49797, 49802, 49812,
+ 49821, 49828, 49834, 49838, 49841, 49848, 49854, 49861, 49867, 49877,
+ 49885, 49891, 49897, 49902, 49906, 49913, 49918, 49924, 49931, 49937,
+ 49006, 49942, 49946, 16501, 16510, 16519, 16528, 16537, 16566, 622,
+ 16575, 49952, 49957, 49960, 49966, 49974, 1275, 49979, 49983, 49988,
+ 49993, 49997, 50002, 50009, 50015, 50019, 50024, 50030, 50034, 37939,
+ 50039, 50044, 50053, 50060, 50070, 50076, 34140, 50093, 50102, 50110,
+ 50116, 50121, 50128, 50134, 50142, 50151, 50159, 50167, 50173, 50177,
+ 50182, 50190, 35288, 38822, 50196, 50215, 19166, 50229, 50245, 50259,
+ 50265, 50270, 50275, 50280, 50286, 38828, 50291, 50294, 50301, 50308,
+ 50317, 50322, 50326, 423, 3176, 50333, 50338, 50343, 33196, 50131, 50347,
+ 50355, 50360, 50368, 50372, 50375, 50380, 50386, 50392, 50397, 50401,
+ 34213, 50404, 50409, 50413, 50416, 50421, 50425, 50430, 50435, 50439,
+ 50444, 50448, 50455, 50459, 50463, 25746, 25757, 50468, 50473, 50479,
+ 50484, 50490, 50496, 32758, 50501, 50505, 50508, 50514, 50519, 50524,
+ 50529, 50534, 50539, 50544, 50549, 50554, 50560, 50566, 14569, 19473,
+ 50571, 50576, 50581, 50586, 50591, 50596, 50601, 50606, 452, 68, 37956,
+ 37961, 37966, 37972, 37977, 37982, 50611, 37986, 50615, 50619, 50623,
+ 37991, 37997, 50637, 38008, 38013, 50645, 50650, 38019, 50655, 50660,
+ 50669, 50674, 50679, 50688, 50694, 50700, 50706, 38036, 50719, 50728,
+ 50734, 38040, 50738, 38045, 50743, 38050, 38055, 50746, 50751, 50755,
+ 50761, 16267, 50768, 16277, 50775, 50780, 38060, 50784, 50789, 50794,
+ 50799, 50804, 50808, 50813, 50818, 50824, 50829, 50834, 50840, 50846,
+ 50851, 50855, 50860, 50865, 50870, 50874, 50879, 50884, 50889, 50895,
+ 50901, 50907, 50912, 50916, 50921, 50925, 38064, 38069, 38074, 50929,
+ 50933, 50938, 50942, 50954, 38079, 38085, 38091, 38103, 50960, 31616,
+ 50964, 50969, 50973, 50978, 50985, 50990, 50995, 51000, 51004, 51008,
+ 51018, 51023, 51028, 51032, 51042, 51046, 51049, 51057, 51062, 38151,
+ 51066, 1375, 51072, 51077, 51083, 51091, 51095, 51104, 51112, 51116,
+ 51120, 51128, 51134, 51142, 51158, 51163, 51167, 51171, 51175, 51180,
+ 51186, 51201, 38188, 1685, 14601, 51205, 1254, 1269, 51217, 51225, 51232,
+ 51237, 9230, 51244, 51249, 10765, 978, 2641, 12321, 51256, 10658, 51261,
+ 51264, 51273, 1162, 51278, 49177, 51285, 51294, 51299, 51303, 51311,
+ 51318, 27424, 2697, 51326, 12842, 51336, 51342, 2434, 2444, 51351, 51360,
+ 51370, 51381, 3584, 41818, 51386, 4341, 4352, 9258, 1167, 51390, 51398,
+ 51405, 51410, 51414, 51418, 51423, 29054, 49512, 12412, 51431, 51440,
+ 51449, 51457, 51470, 51477, 51488, 51493, 51506, 51519, 51531, 51543,
+ 51555, 51566, 51579, 51590, 51601, 51611, 51619, 51627, 51639, 51651,
+ 51662, 51671, 51679, 51686, 51698, 51705, 51711, 51720, 51726, 51733,
+ 51746, 51751, 51761, 51766, 51772, 51777, 32098, 51781, 48682, 51788,
+ 51795, 51803, 51810, 2654, 51817, 51828, 51838, 51847, 51855, 51865,
+ 51873, 51882, 51892, 51901, 51906, 51912, 51918, 4190, 51929, 51939,
+ 51948, 51957, 51965, 51975, 51983, 51992, 51997, 52002, 52007, 1604, 47,
+ 52015, 52023, 52034, 52045, 19877, 52055, 52059, 52066, 52072, 52077,
+ 52081, 52092, 52102, 52111, 52122, 52127, 20306, 20311, 52134, 52143,
+ 52148, 52158, 52163, 52171, 52179, 52186, 52192, 1566, 271, 52196, 52201,
+ 52207, 46085, 52212, 52215, 2182, 2663, 52223, 52227, 52230, 1420, 52236,
+ 16787, 1172, 52241, 52254, 2797, 2818, 52268, 52280, 52292, 2832, 2849,
+ 2864, 2880, 2897, 52306, 52318, 2912, 52332, 1178, 1184, 1190, 12713,
+ 52337, 52342, 52347, 52351, 52366, 52381, 52396, 52411, 52426, 52441,
+ 52456, 52471, 52486, 52501, 52516, 52531, 52546, 52561, 52576, 52591,
+ 52606, 52621, 52636, 52651, 52666, 52681, 52696, 52711, 52726, 52741,
+ 52756, 52771, 52786, 52801, 52816, 52831, 52846, 52861, 52876, 52891,
+ 52906, 52921, 52936, 52951, 52966, 52981, 52996, 53011, 53026, 53041,
+ 53056, 53071, 53086, 53101, 53116, 53131, 53146, 53161, 53176, 53191,
+ 53206, 53221, 53236, 53251, 53266, 53281, 53296, 53311, 53326, 53341,
+ 53356, 53371, 53386, 53401, 53416, 53431, 53446, 53461, 53476, 53491,
+ 53506, 53521, 53536, 53551, 53566, 53581, 53596, 53611, 53626, 53641,
+ 53656, 53671, 53686, 53701, 53716, 53731, 53746, 53761, 53776, 53791,
+ 53806, 53821, 53836, 53851, 53866, 53881, 53896, 53911, 53926, 53941,
+ 53956, 53971, 53986, 54001, 54016, 54031, 54046, 54061, 54076, 54091,
+ 54106, 54121, 54136, 54151, 54166, 54181, 54196, 54211, 54226, 54241,
+ 54256, 54271, 54286, 54301, 54316, 54331, 54346, 54361, 54376, 54391,
+ 54406, 54421, 54436, 54451, 54466, 54481, 54496, 54511, 54526, 54541,
+ 54556, 54571, 54586, 54601, 54616, 54631, 54646, 54661, 54676, 54691,
+ 54706, 54721, 54736, 54751, 54766, 54781, 54796, 54811, 54826, 54841,
+ 54856, 54871, 54886, 54901, 54916, 54931, 54946, 54961, 54976, 54991,
+ 55006, 55021, 55036, 55051, 55066, 55081, 55096, 55111, 55126, 55141,
+ 55156, 55171, 55186, 55201, 55216, 55231, 55246, 55261, 55276, 55291,
+ 55306, 55321, 55336, 55351, 55366, 55381, 55396, 55411, 55426, 55441,
+ 55456, 55471, 55486, 55501, 55516, 55531, 55546, 55561, 55576, 55591,
+ 55606, 55621, 55636, 55651, 55666, 55681, 55696, 55711, 55726, 55741,
+ 55756, 55771, 55786, 55801, 55816, 55831, 55846, 55861, 55876, 55891,
+ 55906, 55921, 55936, 55951, 55966, 55981, 55996, 56011, 56026, 56041,
+ 56056, 56071, 56086, 56101, 56116, 56131, 56146, 56161, 56176, 56191,
+ 56206, 56221, 56236, 56251, 56266, 56281, 56296, 56311, 56326, 56341,
+ 56356, 56371, 56386, 56401, 56416, 56431, 56446, 56461, 56476, 56491,
+ 56506, 56521, 56536, 56551, 56566, 56581, 56596, 56611, 56626, 56641,
+ 56656, 56671, 56686, 56701, 56716, 56731, 56746, 56761, 56776, 56791,
+ 56806, 56821, 56836, 56851, 56866, 56881, 56896, 56911, 56926, 56941,
+ 56956, 56971, 56986, 57001, 57016, 57031, 57046, 57061, 57076, 57091,
+ 57106, 57121, 57136, 57151, 57166, 57181, 57196, 57211, 57226, 57241,
+ 57256, 57271, 57286, 57301, 57316, 57331, 57346, 57361, 57376, 57391,
+ 57406, 57421, 57436, 57451, 57466, 57481, 57496, 57511, 57526, 57541,
+ 57556, 57571, 57586, 57601, 57616, 57631, 57646, 57661, 57676, 57691,
+ 57706, 57721, 57736, 57751, 57766, 57781, 57796, 57811, 57826, 57841,
+ 57856, 57871, 57886, 57901, 57916, 57931, 57946, 57961, 57976, 57991,
+ 58006, 58021, 58036, 58051, 58066, 58081, 58096, 58111, 58126, 58141,
+ 58156, 58171, 58186, 58201, 58216, 58231, 58246, 58261, 58276, 58291,
+ 58306, 58321, 58336, 58351, 58366, 58381, 58396, 58411, 58426, 58441,
+ 58456, 58471, 58486, 58501, 58516, 58531, 58546, 58561, 58576, 58591,
+ 58606, 58621, 58636, 58651, 58666, 58681, 58696, 58711, 58726, 58741,
+ 58756, 58771, 58786, 58801, 58816, 58831, 58846, 58861, 58876, 58891,
+ 58906, 58921, 58936, 58951, 58966, 58981, 58996, 59011, 59026, 59041,
+ 59056, 59071, 59086, 59101, 59116, 59131, 59146, 59161, 59176, 59191,
+ 59206, 59221, 59236, 59251, 59266, 59281, 59296, 59311, 59326, 59341,
+ 59356, 59371, 59386, 59401, 59416, 59431, 59446, 59461, 59476, 59491,
+ 59506, 59521, 59536, 59551, 59566, 59581, 59596, 59611, 59626, 59641,
+ 59656, 59671, 59686, 59701, 59716, 59731, 59746, 59761, 59776, 59791,
+ 59806, 59821, 59836, 59851, 59866, 59881, 59896, 59911, 59926, 59941,
+ 59956, 59971, 59986, 60001, 60016, 60031, 60046, 60061, 60076, 60091,
+ 60106, 60121, 60136, 60151, 60166, 60182, 60198, 60214, 60230, 60246,
+ 60262, 60278, 60294, 60310, 60326, 60342, 60358, 60374, 60390, 60406,
+ 60422, 60438, 60454, 60470, 60486, 60502, 60518, 60534, 60550, 60566,
+ 60582, 60598, 60614, 60630, 60646, 60662, 60678, 60694, 60710, 60726,
+ 60742, 60758, 60774, 60790, 60806, 60822, 60838, 60854, 60870, 60886,
+ 60902, 60918, 60934, 60950, 60966, 60982, 60998, 61014, 61030, 61046,
+ 61062, 61078, 61094, 61110, 61126, 61142, 61158, 61174, 61190, 61206,
+ 61222, 61238, 61254, 61270, 61286, 61302, 61318, 61334, 61350, 61366,
+ 61382, 61398, 61414, 61430, 61446, 61462, 61478, 61494, 61510, 61526,
+ 61542, 61558, 61574, 61590, 61606, 61622, 61638, 61654, 61670, 61686,
+ 61702, 61718, 61734, 61750, 61766, 61782, 61798, 61814, 61830, 61846,
+ 61862, 61878, 61894, 61910, 61926, 61942, 61958, 61974, 61990, 62006,
+ 62022, 62038, 62054, 62070, 62086, 62102, 62118, 62134, 62150, 62166,
+ 62182, 62198, 62214, 62230, 62246, 62262, 62278, 62294, 62310, 62326,
+ 62342, 62358, 62374, 62390, 62406, 62422, 62438, 62454, 62470, 62486,
+ 62502, 62518, 62534, 62550, 62566, 62582, 62598, 62614, 62630, 62646,
+ 62662, 62678, 62694, 62710, 62726, 62742, 62758, 62774, 62790, 62806,
+ 62822, 62838, 62854, 62870, 62886, 62902, 62918, 62934, 62950, 62966,
+ 62982, 62998, 63014, 63030, 63046, 63062, 63078, 63094, 63110, 63126,
+ 63142, 63158, 63174, 63190, 63206, 63222, 63238, 63254, 63270, 63286,
+ 63302, 63318, 63334, 63350, 63366, 63382, 63398, 63414, 63430, 63446,
+ 63462, 63478, 63494, 63510, 63526, 63542, 63558, 63574, 63590, 63606,
+ 63622, 63638, 63654, 63670, 63686, 63702, 63718, 63734, 63750, 63766,
+ 63782, 63798, 63814, 63830, 63846, 63862, 63878, 63894, 63910, 63926,
+ 63942, 63958, 63974, 63990, 64006, 64022, 64038, 64054, 64070, 64086,
+ 64102, 64118, 64134, 64150, 64166, 64182, 64198, 64214, 64230, 64246,
+ 64262, 64278, 64294, 64310, 64326, 64342, 64358, 64374, 64390, 64406,
+ 64422, 64438, 64454, 64470, 64486, 64502, 64518, 64534, 64550, 64566,
+ 64582, 64598, 64614, 64630, 64646, 64662, 64678, 64694, 64710, 64726,
+ 64742, 64758, 64774, 64790, 64806, 64822, 64838, 64854, 64870, 64886,
+ 64902, 64918, 64934, 64950, 64966, 64982, 64998, 65014, 65030, 65046,
+ 65062, 65078, 65094, 65110, 65126, 65142, 65158, 65174, 65190, 65206,
+ 65222, 65238, 65254, 65270, 65286, 65302, 65318, 65334, 65350, 65366,
+ 65382, 65398, 65414, 65430, 65446, 65462, 65478, 65494, 65510, 65526,
+ 65542, 65558, 65574, 65590, 65606, 65622, 65638, 65654, 65670, 65686,
+ 65702, 65718, 65734, 65750, 65766, 65782, 65798, 65814, 65830, 65846,
+ 65862, 65878, 65894, 65910, 65926, 65942, 65958, 65974, 65990, 66006,
+ 66022, 66038, 66054, 66070, 66086, 66102, 66118, 66134, 66150, 66166,
+ 66182, 66198, 66214, 66230, 66246, 66262, 66278, 66294, 66310, 66326,
+ 66342, 66358, 66374, 66390, 66406, 66422, 66438, 66454, 66470, 66486,
+ 66502, 66518, 66534, 66550, 66566, 66582, 66598, 66614, 66630, 66646,
+ 66662, 66678, 66694, 66710, 66726, 66742, 66758, 66774, 66790, 66806,
+ 66822, 66838, 66854, 66870, 66886, 66902, 66918, 66934, 66950, 66966,
+ 66982, 66998, 67014, 67030, 67046, 67062, 67078, 67094, 67110, 67126,
+ 67142, 67158, 67174, 67190, 67206, 67222, 67238, 67254, 67270, 67286,
+ 67302, 67318, 67334, 67350, 67366, 67382, 67398, 67414, 67430, 67446,
+ 67462, 67478, 67494, 67510, 67526, 67542, 67558, 67574, 67590, 67606,
+ 67622, 67638, 67654, 67670, 67686, 67702, 67718, 67734, 67750, 67766,
+ 67782, 67798, 67814, 67830, 67846, 67862, 67878, 67894, 67910, 67926,
+ 67942, 67958, 67974, 67990, 68006, 68022, 68038, 68054, 68070, 68086,
+ 68102, 68118, 68134, 68150, 68166, 68182, 68198, 68214, 68230, 68246,
+ 68262, 68278, 68294, 68310, 68326, 68342, 68358, 68374, 68390, 68406,
+ 68422, 68438, 68454, 68470, 68486, 68502, 68518, 68534, 68550, 68566,
+ 68582, 68598, 68614, 68630, 68646, 68662, 68678, 68694, 68710, 68726,
+ 68742, 68758, 68774, 68790, 68806, 68822, 68838, 68847, 68862, 68876,
+ 68885, 17689, 68889, 68894, 68900, 68906, 68916, 68924, 17946, 18677,
+ 9277, 68937, 1428, 1432, 68945, 4270, 33321, 8104, 68951, 68956, 68961,
+ 68966, 68971, 68977, 68982, 68988, 68993, 68999, 69004, 69009, 69014,
+ 69019, 69025, 69030, 69035, 69040, 69045, 69050, 69055, 69060, 69066,
+ 69071, 69077, 69084, 2701, 69089, 69095, 9652, 69099, 69104, 69111,
+ 69119, 4281, 4286, 4291, 4296, 65, 69123, 69129, 69134, 69139, 69143,
+ 69148, 69152, 69156, 12785, 69160, 69170, 69183, 69194, 69207, 69214,
+ 69220, 69228, 69235, 12246, 69244, 69249, 69255, 69261, 69267, 69272,
+ 69277, 69282, 69287, 69291, 69296, 69301, 69306, 69312, 69318, 69324,
+ 69329, 69333, 69338, 69343, 69347, 69352, 69357, 69362, 69366, 12801,
+ 12812, 12817, 1471, 69370, 69376, 1476, 19711, 69381, 19720, 1486, 69386,
+ 69392, 69397, 1507, 69403, 1513, 1519, 12847, 69408, 69417, 69425, 69433,
+ 69440, 69444, 69448, 69454, 69459, 37599, 69464, 69471, 69479, 69486,
+ 69491, 69495, 69499, 69508, 69513, 69518, 69523, 1524, 280, 69528, 69533,
+ 69537, 19846, 987, 69541, 69548, 69553, 69557, 19904, 1528, 46361, 69560,
+ 69565, 69575, 69584, 69589, 69593, 69599, 1533, 49458, 69604, 69613,
+ 69619, 69624, 69629, 13086, 13092, 69635, 69648, 69660, 69677, 69694,
+ 69711, 69728, 69745, 69762, 69779, 69796, 69813, 69830, 69847, 69864,
+ 69881, 69898, 69915, 69932, 69949, 69966, 69983, 70000, 70017, 70034,
+ 70051, 70068, 70085, 70102, 70119, 70136, 70153, 70170, 70187, 70204,
+ 70221, 70238, 70255, 70272, 70289, 70306, 70323, 70340, 70357, 70374,
+ 70391, 70408, 70425, 70442, 70459, 70476, 70493, 70504, 70514, 70519,
+ 1538, 70523, 70528, 70534, 70539, 70544, 70551, 10677, 1543, 70557,
+ 70566, 33713, 70571, 70582, 13108, 70592, 70597, 70603, 70608, 70615,
+ 70621, 70626, 1548, 20198, 70631, 70637, 13118, 70643, 70648, 70653,
+ 70658, 70663, 70668, 70673, 70678, 1553, 4761, 70683, 70688, 70694,
+ 70699, 70704, 70709, 70714, 70719, 70724, 70729, 70734, 70740, 70746,
+ 70752, 70757, 70761, 70766, 70771, 70775, 70780, 70785, 70790, 70795,
+ 70799, 70804, 70810, 70815, 70820, 70824, 70829, 70834, 70840, 70845,
+ 70850, 70856, 70862, 70867, 70871, 70876, 70881, 70886, 70890, 70895,
+ 70900, 70905, 70911, 70917, 70922, 70926, 70930, 70935, 70940, 70945,
+ 35492, 70949, 70954, 70959, 70965, 70970, 70975, 70979, 70984, 70989,
+ 70995, 71000, 71005, 71011, 71017, 71022, 71026, 71031, 71036, 71040,
+ 71045, 71050, 71055, 71061, 71067, 71072, 71076, 71081, 71086, 71090,
+ 71095, 71100, 71105, 71110, 71114, 71117, 71120, 71125, 71130, 38335,
+ 71137, 71145, 50085, 71151, 3928, 33656, 71164, 71171, 71177, 71183,
+ 4107, 71188, 13260, 71194, 71204, 71219, 71227, 13265, 71238, 71243,
+ 71254, 71266, 71278, 71290, 2903, 71302, 71307, 31699, 71319, 71325,
+ 71331, 71336, 71345, 71352, 71357, 71362, 71367, 71372, 71377, 71382,
+ 1570, 19338, 71387, 71392, 71397, 71402, 71408, 71413, 71419, 71424,
+ 71429, 71435, 71440, 71445, 49532, 71449, 71453, 71458, 71462, 20346,
+ 71467, 71470, 71475, 71483, 71491, 1574, 13301, 13307, 1579, 71499,
+ 71506, 71511, 71520, 71530, 71537, 71542, 71547, 1584, 71554, 71559,
+ 20466, 71563, 71568, 71575, 71581, 71585, 71598, 71604, 71615, 71625,
+ 71632, 20488, 10571, 10578, 4355, 4361, 71639, 1589, 71644, 71653, 71659,
+ 71667, 71674, 71680, 71687, 71699, 71705, 71710, 71717, 71729, 71740,
+ 71750, 71759, 71769, 71779, 4249, 71787, 37393, 37402, 20528, 71800,
+ 71805, 71810, 71815, 71820, 71825, 71830, 1594, 1598, 71835, 71839,
+ 71842, 71853, 71858, 20554, 1608, 71866, 71871, 71876, 71888, 20587,
+ 71895, 71898, 71904, 71910, 71915, 71923, 1613, 71928, 71933, 71941,
+ 71949, 71956, 71965, 71973, 71982, 71986, 1618, 71995, 1623, 25931,
+ 72000, 72007, 72013, 20674, 72021, 72031, 72037, 72042, 72050, 72057,
+ 72066, 72074, 72084, 72093, 72103, 72112, 72123, 72133, 72143, 72152,
+ 72162, 72176, 72189, 72198, 72206, 72216, 72225, 72237, 72248, 72259,
+ 72269, 19966, 72274, 13453, 72283, 72289, 72294, 72301, 72307, 72314,
+ 72320, 19555, 72330, 72336, 72341, 72352, 72359, 72366, 72371, 72379,
+ 13470, 13475, 72387, 72393, 72397, 4339, 4350, 20750, 49635, 72405,
+ 72411, 72416, 72424, 72431, 14582, 72436, 72442, 72448, 1634, 72453,
+ 72456, 72462, 72467, 72472, 72477, 72482, 72487, 72492, 72497, 72502,
+ 72508, 72514, 1333, 72519, 72524, 72529, 72535, 72540, 72545, 72550,
+ 72555, 72560, 72565, 1643, 18, 72571, 72575, 72580, 72584, 72588, 72592,
+ 38621, 72597, 28238, 72602, 72607, 72611, 72614, 72618, 72622, 72627,
+ 72631, 72636, 72640, 72643, 72649, 42308, 42313, 42318, 72652, 72659,
+ 72665, 72673, 49230, 72683, 72689, 42324, 38885, 38636, 38642, 42340,
+ 38648, 72694, 72699, 72703, 38918, 72710, 72713, 72717, 72725, 72732,
+ 72737, 72740, 72745, 72750, 72754, 72758, 72761, 72771, 72783, 72790,
+ 72796, 38653, 72803, 40604, 72806, 9669, 13815, 72809, 72813, 72818,
+ 4159, 72822, 72825, 16320, 72832, 72839, 72852, 72867, 72881, 72897,
+ 72912, 72921, 72929, 72937, 72946, 72950, 72959, 72965, 72970, 72980,
+ 72993, 73005, 73012, 73017, 73026, 73039, 44032, 73057, 73062, 73069,
+ 73075, 73080, 895, 73085, 73093, 73100, 73107, 33137, 914, 73113, 73119,
+ 73124, 73134, 73142, 73148, 73153, 38672, 6858, 38686, 73157, 73167,
+ 73172, 73180, 73190, 73205, 73211, 73217, 73224, 38696, 73229, 73235,
+ 37737, 73239, 73243, 73248, 73257, 73264, 73269, 73273, 73278, 73286,
+ 20531, 73293, 73298, 73302, 6899, 38722, 73306, 73312, 341, 73322, 73329,
+ 73336, 73342, 73349, 73354, 73363, 15941, 69569, 69579, 73369, 73377,
+ 73381, 73385, 73389, 73393, 73398, 73402, 73408, 73416, 73421, 73426,
+ 73433, 73438, 73442, 73447, 73451, 73455, 73461, 73467, 73478, 73484,
+ 73489, 73493, 73498, 73502, 38846, 73506, 38852, 38858, 73511, 73517,
+ 73524, 73529, 73533, 37754, 20185, 73536, 73540, 73545, 73552, 73558,
+ 73562, 73567, 48699, 73573, 73577, 73584, 73588, 73593, 73599, 73605,
+ 73611, 73623, 73632, 73642, 73648, 73655, 73660, 73665, 73669, 73672,
+ 73678, 73685, 73690, 73695, 73702, 73709, 73716, 73722, 73727, 73732,
+ 73740, 38863, 2531, 73745, 73750, 73756, 73761, 73767, 73772, 73777,
+ 73782, 73788, 38884, 73793, 73799, 73805, 73811, 38954, 73816, 73821,
+ 73826, 38965, 73831, 73836, 73841, 73847, 73853, 38970, 73858, 73863,
+ 73868, 39025, 39031, 73873, 73878, 39036, 39058, 33998, 39064, 39068,
+ 73883, 14258, 73887, 73895, 73901, 73909, 73916, 73922, 73932, 73938,
+ 73945, 12685, 39082, 73951, 73964, 73973, 73979, 73988, 73994, 74000,
+ 74007, 28581, 74015, 74022, 74032, 74040, 74043, 39026, 74048, 74055,
+ 74060, 74064, 74068, 74073, 74077, 4478, 74082, 74087, 74092, 42402,
+ 42407, 74096, 42421, 74101, 42426, 74106, 74112, 42438, 42444, 42450,
+ 74117, 74123, 27479, 74134, 74137, 74149, 74157, 39105, 74161, 74170,
+ 74180, 74189, 39115, 74194, 74201, 74210, 74216, 74224, 74231, 74238,
+ 6950, 5174, 74243, 39037, 74249, 74252, 74258, 74265, 74270, 74275,
+ 28485, 74279, 74285, 74291, 74296, 74301, 74305, 74311, 74317, 40488,
+ 74322, 43626, 45463, 45469, 39146, 39151, 74326, 74330, 74334, 74337,
+ 74350, 74356, 74360, 74363, 74368, 40870, 74372, 37759, 25872, 74378,
+ 6879, 6887, 10377, 74381, 74386, 74391, 74396, 74401, 74406, 74411,
+ 74416, 74421, 74426, 74432, 74437, 74442, 74448, 74453, 74458, 74463,
+ 74468, 74473, 74478, 74484, 74489, 74495, 74500, 74505, 74510, 74515,
+ 74520, 74525, 74530, 74535, 74540, 74545, 74551, 74556, 74561, 74566,
+ 74571, 74576, 74581, 74587, 74592, 74597, 74602, 74607, 74612, 74617,
+ 74622, 74627, 74632, 74638, 74643, 74648, 74653, 74658, 74664, 74670,
+ 74675, 74681, 74686, 74691, 74696, 74701, 74706, 1421, 159, 74711, 74715,
+ 74719, 74723, 30435, 74727, 74731, 74736, 74740, 74745, 74749, 74754,
+ 74759, 74764, 74769, 74773, 74777, 74782, 74786, 16020, 74791, 74795,
+ 74802, 74812, 18315, 74821, 74830, 74839, 74843, 74848, 74853, 74857,
+ 74861, 30215, 3259, 74865, 74871, 21763, 74875, 74884, 74892, 74898,
+ 74903, 74915, 74927, 74932, 74936, 74941, 74945, 74951, 74957, 74962,
+ 74972, 74982, 74988, 74996, 75001, 75005, 75011, 75016, 75023, 75029,
+ 75034, 75041, 75050, 75059, 75067, 75071, 18871, 75074, 75083, 75091,
+ 75103, 75114, 75125, 75134, 75138, 75147, 75155, 75165, 75173, 75180,
+ 75190, 75196, 75201, 75209, 75216, 75225, 75231, 75236, 75243, 75249,
+ 75260, 60, 37536, 75266, 31986, 31996, 75272, 75280, 75287, 75293, 75297,
+ 75307, 75318, 75326, 75335, 75340, 75345, 75350, 75354, 75358, 75366,
+ 21710, 75373, 75377, 75383, 75393, 75400, 75407, 75413, 75419, 42501,
+ 75423, 75425, 75428, 75434, 75438, 75449, 75459, 75465, 75472, 75479,
+ 15957, 75487, 75493, 75502, 75511, 75517, 11579, 75523, 75529, 75534,
+ 75539, 75546, 75551, 75558, 75564, 75569, 75577, 75590, 75599, 75608,
+ 72138, 72148, 75618, 75624, 75633, 75639, 75645, 75652, 75659, 75666,
+ 75673, 75680, 75685, 75689, 75693, 75696, 75706, 75710, 75722, 75731,
+ 10038, 75740, 75751, 75756, 75760, 72157, 75766, 75773, 75782, 75790,
+ 51037, 75798, 75802, 75807, 75812, 75822, 75830, 75842, 75847, 75851,
+ 75855, 75861, 75869, 75876, 75888, 75896, 75907, 75914, 75920, 75930,
+ 75936, 75940, 75949, 75958, 75965, 75971, 75976, 75980, 75984, 75988,
+ 75997, 76006, 76015, 76022, 76028, 76034, 76040, 76045, 76052, 76058,
+ 76066, 76073, 76079, 15046, 76084, 76090, 76094, 17172, 76098, 76103,
+ 76113, 76118, 76127, 76133, 76139, 76147, 76154, 76158, 76162, 76169,
+ 76175, 76183, 76190, 76196, 76207, 76211, 76215, 76219, 76222, 76228,
+ 76233, 76238, 76242, 76246, 76255, 76263, 76270, 76276, 76283, 29245,
+ 48840, 76288, 76296, 76300, 76304, 76307, 76315, 76322, 76328, 76337,
+ 76345, 76351, 76356, 76360, 76365, 76370, 76374, 76378, 76382, 76387,
+ 76396, 76400, 76407, 45567, 76411, 76417, 76425, 76429, 76435, 76443,
+ 76449, 76454, 76465, 76473, 76479, 76488, 27626, 76496, 76503, 76510,
+ 76517, 76524, 76531, 52526, 15772, 76538, 76545, 76550, 42537, 4721,
+ 76556, 76561, 76566, 76572, 76578, 76584, 76589, 76594, 76599, 76604,
+ 76610, 76615, 76621, 76626, 76632, 76637, 76642, 76647, 76652, 76657,
+ 76662, 76667, 76673, 76678, 76684, 76689, 76694, 76699, 76704, 76709,
+ 76714, 76720, 76725, 76730, 76735, 76740, 76745, 76750, 76755, 76760,
+ 76765, 76770, 76776, 76781, 76786, 76791, 76796, 76801, 76806, 76811,
+ 76816, 76822, 76827, 76832, 76837, 76842, 76847, 76852, 76857, 76862,
+ 76867, 76872, 76877, 76882, 76888, 1883, 305, 76893, 46479, 46484, 76897,
+ 76902, 9293, 76906, 3628, 76911, 76916, 76920, 76929, 76940, 76957,
+ 76975, 76983, 75794, 76990, 76993, 77003, 77010, 77019, 77035, 77044,
+ 77054, 77059, 77072, 77082, 77091, 77099, 77113, 77121, 77130, 77134,
+ 77137, 77144, 77150, 77161, 77168, 77180, 77191, 77202, 77211, 77218,
+ 1173, 812, 77228, 2744, 77232, 77237, 77246, 997, 9059, 25308, 77254,
+ 77262, 77276, 77289, 77293, 77298, 77303, 77308, 77314, 77320, 77325,
+ 9661, 18358, 77330, 77334, 77338, 77346, 10098, 77351, 77357, 77366,
+ 77374, 1657, 13314, 1179, 4393, 77378, 77382, 77391, 77401, 2482, 32836,
+ 77410, 77416, 20438, 32851, 77422, 4558, 13696, 77428, 77435, 71848,
+ 77439, 77443, 77449, 77454, 77459, 3861, 163, 3887, 77464, 77476, 77480,
+ 77484, 77490, 77495, 33733, 77499, 13684, 2938, 4, 77504, 77514, 77525,
+ 77536, 77546, 77552, 77563, 77570, 77576, 77582, 2306, 77587, 77595,
+ 77602, 77608, 77618, 77628, 77638, 77647, 28568, 1185, 77652, 77656,
+ 77660, 77666, 77670, 2961, 2967, 9658, 2337, 77674, 77678, 77687, 77695,
+ 77706, 77714, 77722, 77728, 77733, 77744, 77755, 77763, 77769, 77774,
+ 11356, 77784, 77792, 77796, 77800, 77805, 77809, 77821, 34196, 18257,
+ 77828, 77838, 77844, 77850, 7977, 11490, 77860, 77871, 77882, 77892,
+ 77901, 77905, 77912, 999, 2731, 77922, 77927, 77935, 71564, 77943, 77948,
+ 77959, 77966, 77980, 16968, 529, 77990, 77997, 78001, 78005, 78013,
+ 78022, 4433, 78030, 78036, 20483, 78041, 78055, 78062, 78068, 78076,
+ 78085, 78094, 78101, 78113, 78123, 78131, 78138, 78146, 78153, 4357, 116,
+ 78161, 78172, 78176, 78188, 78194, 1804, 227, 78199, 10709, 78204, 3006,
+ 78208, 78215, 78221, 78232, 78242, 78250, 78257, 10049, 78264, 78273,
+ 78281, 4438, 78294, 4455, 78298, 78303, 78309, 78314, 78319, 78324, 3011,
+ 573, 78330, 78343, 78347, 78352, 78357, 3016, 1882, 763, 78361, 4459,
+ 78369, 78375, 78379, 799, 78389, 78398, 78403, 3878, 78407, 78411, 17989,
+ 17996, 9317, 78419, 4490, 4367, 15644, 78427, 78434, 78439, 28632, 78443,
+ 78450, 78456, 13952, 78461, 14017, 204, 78466, 78478, 78484, 78492, 3028,
+ 1699, 78500, 78502, 78507, 78512, 78517, 78523, 78528, 78533, 78538,
+ 78543, 78548, 78553, 78559, 78564, 78569, 78574, 78579, 78584, 78589,
+ 78594, 78599, 78605, 78610, 78615, 78620, 78626, 78631, 78637, 78642,
+ 78647, 78652, 78657, 78662, 78667, 78672, 78678, 78683, 78689, 78694,
+ 78699, 78704, 78709, 78714, 78719, 78724, 78729, 9730, 9743, 4506, 4511,
+ 4516, 4521, 26, 78735, 78741, 78746, 78751, 78756, 78762, 78767, 78771,
+ 78775, 78780, 78786, 78790, 78796, 78801, 78806, 78812, 78817, 78821,
+ 78826, 78831, 78835, 78838, 78840, 78844, 78847, 78854, 78859, 78863,
+ 78868, 78872, 78876, 78880, 78886, 78897, 78917, 78936, 78957, 78970,
+ 78982, 78991, 78995, 78998, 39423, 79001, 39428, 79008, 79013, 39433,
+ 79022, 79031, 39439, 79036, 39444, 79045, 79050, 13941, 79054, 79059,
+ 79064, 39449, 79068, 79077, 50696, 79081, 79084, 79088, 9325, 79094,
+ 79097, 79102, 79107, 79112, 79116, 4179, 39454, 79119, 79123, 79126,
+ 79137, 79142, 79146, 79152, 79160, 79173, 79177, 79185, 79194, 79200,
+ 79205, 79211, 79215, 79221, 79227, 79235, 79240, 79244, 79251, 79257,
+ 79265, 79274, 79282, 39457, 79289, 79299, 79308, 79316, 79327, 79340,
+ 79345, 79350, 79354, 79363, 79369, 79376, 79389, 79401, 79412, 79424,
+ 79431, 79440, 79449, 79458, 79465, 79471, 79478, 79486, 79493, 79501,
+ 79510, 79518, 79525, 79533, 79542, 79550, 79559, 79569, 79578, 79586,
+ 79593, 79601, 79610, 79618, 79627, 79637, 79646, 79654, 79663, 79673,
+ 79682, 79692, 79703, 79713, 79722, 79730, 79737, 79745, 79754, 79762,
+ 79771, 79781, 79790, 79798, 79807, 79817, 79826, 79836, 79847, 79857,
+ 79866, 79874, 79883, 79893, 79902, 79912, 79923, 79933, 79942, 79952,
+ 79963, 79973, 79984, 79996, 80007, 80017, 80026, 80034, 80041, 80049,
+ 80058, 80066, 80075, 80085, 80094, 80102, 80111, 80121, 80130, 80140,
+ 80151, 80161, 80170, 80178, 80187, 80197, 80206, 80216, 80227, 80237,
+ 80246, 80256, 80267, 80277, 80288, 80300, 80311, 80321, 80330, 80338,
+ 80347, 80357, 80366, 80376, 80387, 80397, 80406, 80416, 80427, 80437,
+ 80448, 80460, 80471, 80481, 80490, 80500, 80511, 80521, 80532, 80544,
+ 80555, 80565, 80576, 80588, 80599, 80611, 80624, 80636, 80647, 80657,
+ 80666, 80674, 80681, 80689, 80698, 80706, 80715, 80725, 80734, 80742,
+ 80751, 80761, 80770, 80780, 80791, 80801, 80810, 80818, 80827, 80837,
+ 80846, 80856, 80867, 80877, 80886, 80896, 80907, 80917, 80928, 80940,
+ 80951, 80961, 80970, 80978, 80987, 80997, 81006, 81016, 81027, 81037,
+ 81046, 81056, 81067, 81077, 81088, 81100, 81111, 81121, 81130, 81140,
+ 81151, 81161, 81172, 81184, 81195, 81205, 81216, 81228, 81239, 81251,
+ 81264, 81276, 81287, 81297, 81306, 81314, 81323, 81333, 81342, 81352,
+ 81363, 81373, 81382, 81392, 81403, 81413, 81424, 81436, 81447, 81457,
+ 81466, 81476, 81487, 81497, 81508, 81520, 81531, 81541, 81552, 81564,
+ 81575, 81587, 81600, 81612, 81623, 81633, 81642, 81652, 81663, 81673,
+ 81684, 81696, 81707, 81717, 81728, 81740, 81751, 81763, 81776, 81788,
+ 81799, 81809, 81820, 81832, 81843, 81855, 81868, 81880, 81891, 81903,
+ 81916, 81928, 81941, 81955, 81968, 81980, 81991, 82001, 82010, 82018,
+ 82025, 82030, 9090, 82037, 82042, 39467, 82048, 82053, 39472, 82059,
+ 82066, 25430, 31434, 82071, 82077, 82083, 82091, 82097, 82103, 82110,
+ 82117, 82122, 82127, 82131, 82136, 82140, 82143, 82147, 82152, 82161,
+ 82170, 82178, 82184, 82196, 82207, 82211, 3321, 9065, 82216, 82219,
+ 82222, 82224, 82228, 82232, 82236, 82242, 82247, 31497, 82252, 82256,
+ 82259, 82264, 82268, 82275, 82281, 82285, 7060, 82289, 82294, 39494,
+ 82298, 82305, 82314, 82322, 82328, 82339, 82347, 82356, 82364, 82371,
+ 82378, 82384, 82389, 82400, 39499, 82405, 82416, 82428, 82436, 82447,
+ 82456, 82464, 82475, 82480, 82488, 2696, 82493, 82502, 41891, 82515,
+ 82519, 82531, 82539, 82544, 82552, 82563, 21928, 82572, 82578, 82585,
+ 82593, 82599, 39509, 82604, 4484, 68920, 82611, 82614, 82622, 82635,
+ 82648, 82661, 82674, 82681, 82692, 82701, 82706, 52343, 52348, 82710,
+ 82714, 82722, 82729, 82738, 82746, 82752, 82761, 82769, 82776, 82784,
+ 82788, 82797, 82806, 82816, 82829, 82842, 82852, 39514, 82858, 82865,
+ 82871, 82877, 39520, 82882, 82885, 82889, 82897, 82906, 52114, 82914,
+ 82923, 82931, 82938, 82946, 82956, 82965, 82974, 41043, 82983, 82994,
+ 83009, 83019, 10747, 26246, 83028, 83033, 83038, 83042, 19547, 83047,
+ 83052, 83058, 83063, 83068, 83074, 83079, 83084, 26206, 83089, 83096,
+ 83104, 83112, 83120, 83125, 83132, 83139, 83144, 1717, 83148, 83152,
+ 83160, 83168, 39537, 83174, 83180, 83192, 83198, 83205, 83209, 83216,
+ 83221, 83228, 83234, 83241, 83252, 83262, 83272, 83284, 83290, 83298,
+ 83307, 83313, 83323, 83333, 39564, 83342, 83351, 83357, 83369, 83380,
+ 83387, 83392, 83396, 83404, 83415, 83421, 83426, 83431, 83438, 83446,
+ 83458, 83468, 83477, 83486, 83494, 83501, 41705, 29006, 83507, 83512,
+ 83516, 83520, 83525, 83533, 83539, 83550, 83563, 83568, 83575, 39569,
+ 83580, 83592, 83601, 83609, 83619, 83630, 83643, 83650, 83659, 83668,
+ 83676, 83681, 83687, 83691, 1410, 83696, 83701, 83706, 83711, 83717,
+ 83722, 83727, 83733, 83739, 83744, 83748, 83753, 83758, 83763, 69504,
+ 83768, 83773, 83778, 83783, 83789, 83795, 83800, 83804, 83809, 19546,
+ 83814, 83820, 83825, 83831, 83836, 83841, 83846, 83851, 83855, 83861,
+ 83866, 83875, 83880, 83885, 83890, 83895, 83899, 83906, 83912, 4836,
+ 20800, 3286, 83917, 83921, 83926, 83930, 83934, 83938, 56143, 83942,
+ 83867, 83944, 83954, 39578, 83957, 83962, 83971, 83977, 7019, 39583,
+ 83981, 83987, 83992, 83998, 84003, 84007, 84014, 84019, 84029, 84038,
+ 84042, 84048, 84054, 84060, 84064, 84072, 84079, 84087, 84095, 39588,
+ 84102, 84105, 84116, 84123, 84129, 84134, 84138, 84144, 84152, 84159,
+ 84164, 84168, 84177, 84185, 84191, 84196, 84203, 84211, 39593, 84218,
+ 28458, 84230, 84236, 84241, 84247, 84254, 84260, 25894, 33344, 84266,
+ 84271, 84277, 84281, 84293, 83900, 83907, 26138, 84303, 84308, 84315,
+ 84321, 84328, 84334, 84345, 84350, 84358, 10447, 84363, 84366, 84372,
+ 84376, 84380, 84383, 84389, 84395, 39282, 4837, 1425, 16069, 84402,
+ 84408, 84414, 84420, 84426, 84432, 84438, 84444, 84450, 84455, 84460,
+ 84465, 84470, 84475, 84480, 84485, 84490, 84495, 84500, 84505, 84510,
+ 84515, 84521, 84526, 84531, 84537, 84542, 84547, 84553, 84559, 84565,
+ 84571, 84577, 84583, 84589, 84595, 84601, 84606, 84611, 84617, 84622,
+ 84627, 84633, 84638, 84643, 84648, 84653, 84658, 84663, 84668, 84673,
+ 84678, 84683, 84688, 84693, 84699, 84704, 84709, 84714, 84720, 84725,
+ 84730, 84735, 84740, 84746, 84751, 84756, 84761, 84766, 84771, 84776,
+ 84781, 84786, 84791, 84796, 84801, 84806, 84811, 84816, 84821, 84826,
+ 84831, 84836, 84841, 84847, 84852, 84857, 84862, 84867, 84872, 84877,
+ 84882, 1065, 148, 84887, 84891, 84895, 84900, 84908, 84912, 84924, 84931,
+ 84939, 84943, 84956, 84964, 84969, 84974, 32049, 84978, 84983, 84987,
+ 84992, 84996, 85004, 85008, 25438, 85013, 85017, 72401, 85021, 85024,
+ 85032, 85040, 85048, 85053, 85058, 85065, 85072, 85078, 85084, 85089,
+ 85096, 85101, 85109, 77281, 85116, 85121, 72167, 85128, 85134, 85139,
+ 85143, 85150, 85156, 85163, 72194, 14031, 85171, 85176, 85181, 85185,
+ 85188, 85199, 85208, 85214, 85219, 85223, 85233, 85242, 50487, 85246,
+ 85250, 85257, 85270, 85276, 85284, 85291, 85300, 85311, 85322, 85333,
+ 85344, 85353, 85359, 85368, 85376, 85386, 85399, 85407, 85414, 85425,
+ 85434, 85440, 85445, 85450, 85456, 85466, 85472, 85482, 85490, 85497,
+ 85507, 85516, 83582, 85524, 85530, 85538, 85544, 75834, 85551, 85556,
+ 85559, 85563, 85569, 85573, 85576, 85584, 85590, 85596, 85604, 85616,
+ 85628, 85635, 85640, 85644, 85655, 85663, 85670, 85682, 85690, 85697,
+ 85705, 85712, 85718, 85723, 85729, 85739, 85748, 85756, 85761, 85771,
+ 85780, 51375, 85787, 85791, 85796, 85804, 85811, 85817, 85821, 85831,
+ 85842, 85850, 85857, 85869, 85881, 85890, 82505, 85897, 85907, 85919,
+ 85930, 85944, 85952, 85962, 85969, 85977, 85990, 86002, 86011, 86019,
+ 86029, 86040, 86052, 86061, 86071, 86081, 86091, 86100, 86107, 86116,
+ 86131, 86139, 86149, 86158, 86166, 86179, 68890, 86194, 86204, 86213,
+ 86225, 86235, 86247, 86258, 86272, 86286, 86300, 86314, 86328, 86342,
+ 86356, 86370, 86384, 86398, 86412, 86426, 86440, 86454, 86468, 86482,
+ 86496, 86510, 86524, 86538, 86552, 86566, 86580, 86594, 86608, 86622,
+ 86636, 86650, 86664, 86678, 86692, 86706, 86720, 86734, 86748, 86762,
+ 86776, 86790, 86804, 86818, 86832, 86846, 86860, 86874, 86888, 86902,
+ 86916, 86930, 86944, 86958, 86972, 86986, 87000, 87014, 87028, 87042,
+ 87056, 87070, 87084, 87098, 87112, 87126, 87140, 87154, 87168, 87182,
+ 87196, 87210, 87224, 87238, 87252, 87266, 87280, 87294, 87308, 87322,
+ 87336, 87350, 87364, 87378, 87392, 87406, 87420, 87434, 87448, 87462,
+ 87476, 87490, 87504, 87518, 87532, 87546, 87560, 87574, 87588, 87602,
+ 87616, 87630, 87644, 87658, 87672, 87686, 87700, 87714, 87728, 87742,
+ 87756, 87770, 87784, 87798, 87812, 87826, 87840, 87854, 87868, 87882,
+ 87896, 87910, 87924, 87938, 87952, 87966, 87980, 87994, 88008, 88022,
+ 88036, 88050, 88064, 88078, 88092, 88106, 88120, 88134, 88148, 88162,
+ 88176, 88190, 88204, 88218, 88232, 88246, 88260, 88274, 88288, 88302,
+ 88316, 88330, 88344, 88358, 88372, 88386, 88400, 88414, 88428, 88442,
+ 88456, 88470, 88484, 88498, 88512, 88526, 88540, 88554, 88568, 88582,
+ 88596, 88610, 88624, 88638, 88652, 88666, 88680, 88694, 88708, 88722,
+ 88736, 88750, 88764, 88778, 88792, 88806, 88820, 88834, 88848, 88862,
+ 88876, 88890, 88904, 88918, 88932, 88946, 88960, 88974, 88988, 89002,
+ 89016, 89030, 89044, 89058, 89072, 89086, 89100, 89114, 89128, 89142,
+ 89156, 89170, 89184, 89198, 89212, 89226, 89240, 89254, 89268, 89282,
+ 89296, 89310, 89324, 89338, 89352, 89366, 89380, 89394, 89408, 89422,
+ 89436, 89450, 89464, 89478, 89492, 89506, 89520, 89534, 89548, 89562,
+ 89576, 89590, 89604, 89618, 89632, 89646, 89660, 89674, 89688, 89702,
+ 89716, 89730, 89744, 89758, 89772, 89786, 89800, 89814, 89828, 89842,
+ 89856, 89870, 89884, 89898, 89912, 89926, 89940, 89954, 89968, 89982,
+ 89996, 90010, 90024, 90038, 90052, 90066, 90080, 90094, 90108, 90122,
+ 90136, 90150, 90164, 90178, 90192, 90206, 90220, 90234, 90248, 90262,
+ 90276, 90290, 90304, 90318, 90332, 90346, 90360, 90374, 90388, 90402,
+ 90416, 90430, 90444, 90458, 90472, 90486, 90500, 90514, 90528, 90542,
+ 90556, 90570, 90584, 90598, 90612, 90626, 90640, 90654, 90668, 90682,
+ 90696, 90710, 90724, 90738, 90752, 90766, 90780, 90794, 90808, 90822,
+ 90836, 90850, 90864, 90878, 90892, 90906, 90920, 90934, 90948, 90962,
+ 90976, 90990, 91004, 91018, 91032, 91046, 91060, 91074, 91088, 91102,
+ 91116, 91130, 91144, 91158, 91172, 91186, 91200, 91214, 91228, 91242,
+ 91256, 91270, 91284, 91298, 91312, 91326, 91340, 91354, 91368, 91382,
+ 91396, 91410, 91424, 91438, 91452, 91466, 91480, 91494, 91508, 91522,
+ 91536, 91550, 91564, 91578, 91592, 91606, 91620, 91634, 91648, 91662,
+ 91676, 91690, 91704, 91718, 91732, 91746, 91760, 91774, 91788, 91802,
+ 91816, 91830, 91844, 91858, 91872, 91886, 91900, 91914, 91928, 91942,
+ 91956, 91970, 91984, 91998, 92012, 92026, 92040, 92054, 92068, 92082,
+ 92096, 92110, 92124, 92138, 92152, 92166, 92180, 92194, 92208, 92222,
+ 92236, 92250, 92264, 92278, 92292, 92306, 92320, 92334, 92348, 92362,
+ 92376, 92390, 92404, 92418, 92432, 92446, 92460, 92474, 92488, 92502,
+ 92516, 92530, 92544, 92558, 92572, 92586, 92600, 92614, 92628, 92642,
+ 92656, 92670, 92684, 92698, 92712, 92726, 92740, 92754, 92768, 92782,
+ 92796, 92810, 92824, 92838, 92852, 92866, 92880, 92894, 92908, 92922,
+ 92936, 92950, 92964, 92978, 92992, 93006, 93020, 93034, 93048, 93062,
+ 93076, 93090, 93104, 93118, 93132, 93146, 93160, 93174, 93188, 93202,
+ 93216, 93230, 93244, 93258, 93272, 93286, 93300, 93314, 93328, 93342,
+ 93356, 93370, 93384, 93398, 93412, 93426, 93440, 93454, 93468, 93482,
+ 93496, 93510, 93524, 93538, 93552, 93566, 93580, 93594, 93608, 93622,
+ 93636, 93650, 93664, 93678, 93692, 93706, 93720, 93734, 93748, 93762,
+ 93776, 93790, 93804, 93818, 93832, 93846, 93860, 93874, 93888, 93902,
+ 93916, 93930, 93944, 93958, 93972, 93986, 94000, 94014, 94028, 94042,
+ 94056, 94070, 94084, 94098, 94112, 94126, 94140, 94154, 94168, 94182,
+ 94196, 94210, 94224, 94238, 94252, 94266, 94280, 94294, 94308, 94322,
+ 94336, 94350, 94364, 94378, 94392, 94406, 94420, 94434, 94448, 94462,
+ 94476, 94490, 94504, 94518, 94532, 94546, 94560, 94574, 94588, 94602,
+ 94616, 94630, 94644, 94658, 94672, 94686, 94700, 94714, 94728, 94742,
+ 94756, 94770, 94784, 94798, 94812, 94826, 94840, 94854, 94868, 94882,
+ 94896, 94910, 94924, 94938, 94952, 94966, 94980, 94994, 95008, 95022,
+ 95036, 95050, 95064, 95078, 95092, 95106, 95120, 95134, 95148, 95162,
+ 95176, 95190, 95204, 95218, 95232, 95246, 95260, 95274, 95288, 95302,
+ 95316, 95330, 95344, 95358, 95372, 95386, 95400, 95414, 95428, 95442,
+ 95456, 95470, 95484, 95498, 95512, 95526, 95540, 95554, 95568, 95582,
+ 95596, 95610, 95624, 95638, 95652, 95666, 95680, 95694, 95708, 95722,
+ 95736, 95750, 95764, 95778, 95792, 95806, 95820, 95834, 95848, 95862,
+ 95876, 95890, 95904, 95918, 95932, 95946, 95960, 95974, 95988, 96002,
+ 96016, 96030, 96044, 96058, 96072, 96086, 96100, 96114, 96128, 96142,
+ 96156, 96170, 96184, 96198, 96212, 96226, 96240, 96254, 96268, 96282,
+ 96296, 96310, 96324, 96338, 96352, 96366, 96380, 96394, 96408, 96422,
+ 96436, 96450, 96464, 96478, 96492, 96506, 96520, 96534, 96548, 96562,
+ 96576, 96590, 96604, 96618, 96632, 96646, 96660, 96674, 96688, 96702,
+ 96716, 96730, 96744, 96758, 96772, 96786, 96800, 96814, 96828, 96842,
+ 96856, 96870, 96884, 96898, 96912, 96926, 96940, 96954, 96968, 96982,
+ 96996, 97010, 97019, 97030, 97041, 97051, 97062, 97070, 97078, 97084,
+ 97094, 97102, 97108, 35368, 97113, 97119, 97128, 97140, 97145, 97152,
+ 11370, 21948, 97158, 97167, 97172, 97176, 97181, 97188, 97194, 97199,
+ 97204, 97212, 97220, 97230, 97235, 97243, 14513, 97247, 97253, 97259,
+ 97265, 97271, 97277, 97283, 97289, 97295, 97301, 97307, 97313, 97319,
+ 97325, 97331, 97337, 97343, 97349, 97355, 97361, 97367, 97373, 97379,
+ 97385, 97391, 97397, 97403, 97409, 97415, 97421, 97427, 97433, 97439,
+ 97445, 97451, 97457, 97463, 97470, 97476, 97482, 97488, 97494, 97500,
+ 97506, 97512, 97518, 97524, 97530, 97536, 97542, 97548, 97554, 97560,
+ 97566, 97572, 97578, 97584, 97590, 97596, 97602, 97608, 97614, 97620,
+ 97626, 97632, 97638, 97644, 97650, 97656, 97662, 97668, 97674, 97680,
+ 97686, 97692, 97698, 97704, 97710, 97716, 97722, 97728, 97734, 97740,
+ 97746, 97752, 97758, 97764, 97770, 97777, 97783, 97789, 97795, 97801,
+ 97807, 97813, 97819, 97825, 97831, 97837, 97843, 97846, 97848, 97863,
+ 97876, 97883, 97889, 97900, 97905, 97909, 97914, 97921, 97927, 97932,
+ 97940, 77884, 77894, 97946, 97953, 97963, 12672, 97970, 97975, 35616,
+ 97984, 97989, 97996, 98006, 98014, 98022, 98031, 98040, 98046, 98052,
+ 98057, 98064, 98071, 98076, 98080, 98088, 72211, 98093, 98102, 98110,
+ 98117, 98122, 98126, 98135, 98141, 98144, 98148, 98157, 98167, 84951,
+ 98176, 98180, 98188, 98192, 98198, 98209, 98219, 21957, 98230, 98239,
+ 98247, 98255, 98262, 72230, 9895, 98270, 98274, 98283, 98290, 98293,
+ 98297, 33215, 98300, 98304, 98309, 98326, 98338, 12630, 98350, 98355,
+ 98360, 98365, 25545, 98369, 98374, 98379, 98385, 98390, 6640, 98395,
+ 25549, 98400, 98405, 98411, 98418, 98423, 98428, 98434, 98440, 98446,
+ 98451, 98457, 98461, 98475, 98483, 98491, 98497, 98502, 98509, 98519,
+ 98528, 98533, 98538, 98543, 98551, 98561, 98572, 98577, 98583, 98588,
+ 98597, 70639, 4760, 98602, 98620, 98639, 98652, 98666, 98682, 98689,
+ 98696, 98705, 98712, 98718, 98725, 98730, 98736, 98741, 98747, 98755,
+ 98761, 98766, 98771, 98787, 12643, 98801, 98808, 98816, 98822, 98826,
+ 98829, 98835, 98840, 98845, 98853, 98860, 98865, 98874, 98880, 98885,
+ 98891, 98897, 98906, 98915, 43462, 98920, 98931, 98938, 98946, 98955,
+ 14104, 98964, 98970, 98978, 98984, 98990, 98996, 99001, 99008, 99014,
+ 14115, 99019, 99022, 99027, 39620, 99037, 99046, 99051, 99059, 99066,
+ 99072, 99077, 99085, 99092, 99103, 99119, 99135, 99151, 99167, 99183,
+ 99199, 99215, 99231, 99247, 99263, 99279, 99295, 99311, 99327, 99343,
+ 99359, 99375, 99391, 99407, 99423, 99439, 99455, 99471, 99487, 99503,
+ 99519, 99535, 99551, 99567, 99583, 99599, 99615, 99631, 99647, 99663,
+ 99679, 99695, 99711, 99727, 99743, 99759, 99775, 99791, 99807, 99823,
+ 99839, 99855, 99871, 99887, 99903, 99919, 99935, 99951, 99967, 99983,
+ 99999, 100015, 100031, 100047, 100063, 100079, 100095, 100111, 100127,
+ 100143, 100159, 100175, 100191, 100207, 100223, 100239, 100255, 100271,
+ 100287, 100303, 100319, 100335, 100351, 100367, 100383, 100399, 100415,
+ 100431, 100447, 100463, 100479, 100495, 100511, 100527, 100543, 100559,
+ 100575, 100591, 100607, 100623, 100639, 100655, 100671, 100687, 100703,
+ 100719, 100735, 100751, 100767, 100783, 100799, 100815, 100831, 100847,
+ 100863, 100879, 100895, 100911, 100927, 100943, 100959, 100975, 100991,
+ 101007, 101023, 101039, 101055, 101071, 101087, 101103, 101119, 101135,
+ 101151, 101167, 101183, 101199, 101215, 101231, 101247, 101263, 101279,
+ 101295, 101311, 101327, 101343, 101359, 101375, 101391, 101407, 101423,
+ 101439, 101455, 101471, 101487, 101503, 101519, 101535, 101551, 101567,
+ 101583, 101599, 101615, 101631, 101647, 101663, 101679, 101695, 101711,
+ 101727, 101743, 101759, 101775, 101791, 101807, 101823, 101839, 101855,
+ 101871, 101887, 101903, 101919, 101935, 101951, 101967, 101983, 101999,
+ 102015, 102031, 102047, 102063, 102079, 102095, 102111, 102127, 102143,
+ 102159, 102175, 102191, 102207, 102223, 102239, 102255, 102271, 102287,
+ 102303, 102319, 102335, 102351, 102367, 102383, 102399, 102415, 102431,
+ 102447, 102463, 102479, 102495, 102511, 102527, 102543, 102559, 102575,
+ 102591, 102607, 102623, 102639, 102655, 102671, 102687, 102703, 102719,
+ 102735, 102751, 102767, 102783, 102799, 102815, 102831, 102847, 102863,
+ 102879, 102895, 102911, 102927, 102943, 102959, 102975, 102991, 103007,
+ 103023, 103039, 103055, 103071, 103087, 103103, 103119, 103135, 103151,
+ 103167, 103183, 103199, 103215, 103231, 103247, 103263, 103279, 103295,
+ 103311, 103327, 103343, 103359, 103375, 103391, 103407, 103423, 103439,
+ 103455, 103471, 103487, 103503, 103519, 103535, 103551, 103567, 103583,
+ 103599, 103615, 103631, 103647, 103663, 103679, 103695, 103711, 103727,
+ 103743, 103759, 103775, 103791, 103807, 103823, 103839, 103855, 103871,
+ 103887, 103903, 103919, 103935, 103951, 103967, 103983, 103999, 104015,
+ 104031, 104047, 104063, 104079, 104095, 104111, 104127, 104143, 104159,
+ 104175, 104191, 104207, 104223, 104239, 104255, 104271, 104287, 104303,
+ 104319, 104335, 104351, 104367, 104383, 104399, 104415, 104431, 104447,
+ 104463, 104479, 104495, 104511, 104527, 104543, 104559, 104575, 104591,
+ 104607, 104623, 104639, 104655, 104671, 104687, 104703, 104719, 104735,
+ 104751, 104767, 104783, 104799, 104815, 104831, 104847, 104863, 104879,
+ 104895, 104911, 104927, 104943, 104959, 104975, 104991, 105007, 105023,
+ 105039, 105055, 105071, 105087, 105103, 105119, 105135, 105151, 105167,
+ 105183, 105199, 105215, 105231, 105247, 105263, 105279, 105295, 105311,
+ 105327, 105343, 105359, 105375, 105391, 105407, 105423, 105439, 105455,
+ 105471, 105487, 105503, 105519, 105535, 105551, 105567, 105583, 105599,
+ 105615, 105631, 105647, 105663, 105679, 105695, 105711, 105727, 105743,
+ 105759, 105775, 105791, 105807, 105823, 105839, 105855, 105871, 105887,
+ 105903, 105919, 105935, 105951, 105967, 105983, 105999, 106015, 106031,
+ 106047, 106063, 106079, 106095, 106111, 106127, 106143, 106159, 106175,
+ 106191, 106207, 106223, 106239, 106255, 106271, 106287, 106303, 106319,
+ 106335, 106351, 106367, 106383, 106399, 106415, 106431, 106447, 106463,
+ 106479, 106495, 106511, 106527, 106543, 106559, 106575, 106591, 106607,
+ 106623, 106639, 106655, 106671, 106687, 106703, 106719, 106735, 106751,
+ 106767, 106783, 106799, 106815, 106831, 106847, 106863, 106879, 106895,
+ 106911, 106927, 106943, 106959, 106975, 106991, 107007, 107023, 107039,
+ 107055, 107071, 107087, 107103, 107119, 107135, 107151, 107167, 107183,
+ 107199, 107215, 107231, 107247, 107263, 107279, 107295, 107311, 107327,
+ 107343, 107359, 107375, 107391, 107407, 107423, 107439, 107455, 107471,
+ 107487, 107503, 107519, 107535, 107551, 107567, 107583, 107599, 107615,
+ 107631, 107647, 107663, 107679, 107695, 107711, 107727, 107743, 107759,
+ 107775, 107791, 107807, 107823, 107839, 107855, 107871, 107887, 107903,
+ 107919, 107935, 107951, 107967, 107983, 107999, 108015, 108031, 108047,
+ 108063, 108079, 108095, 108111, 108127, 108143, 108159, 108175, 108191,
+ 108207, 108223, 108239, 108255, 108271, 108287, 108303, 108319, 108335,
+ 108351, 108367, 108383, 108399, 108415, 108431, 108447, 108463, 108479,
+ 108495, 108511, 108527, 108543, 108559, 108575, 108591, 108607, 108623,
+ 108639, 108655, 108671, 108687, 108703, 108719, 108735, 108751, 108767,
+ 108783, 108799, 108815, 108831, 108847, 108863, 108879, 108895, 108911,
+ 108927, 108943, 108959, 108975, 108991, 109007, 109023, 109039, 109055,
+ 109071, 109087, 109103, 109119, 109135, 109151, 109167, 109183, 109199,
+ 109215, 109231, 109247, 109263, 109279, 109295, 109311, 109327, 109343,
+ 109359, 109375, 109391, 109407, 109423, 109439, 109455, 109471, 109487,
+ 109503, 109519, 109535, 109551, 109567, 109583, 109599, 109615, 109631,
+ 109647, 109663, 109679, 109695, 109711, 109727, 109743, 109759, 109775,
+ 109791, 109807, 109823, 109839, 109855, 109871, 109887, 109903, 109919,
+ 109935, 109951, 109967, 109983, 109999, 110015, 110031, 110047, 110063,
+ 110079, 110095, 110111, 110127, 110143, 110159, 110175, 110191, 110207,
+ 110223, 110239, 110255, 110271, 110287, 110303, 110319, 110335, 110351,
+ 110367, 110383, 110399, 110415, 110431, 110447, 110463, 110479, 110495,
+ 110511, 110527, 110543, 110559, 110575, 110591, 110607, 110623, 110639,
+ 110655, 110671, 110687, 110703, 110719, 110735, 110751, 110767, 110783,
+ 110799, 110815, 110831, 110847, 110863, 110879, 110895, 110911, 110927,
+ 110943, 110959, 110975, 110991, 111007, 111023, 111039, 111055, 111071,
+ 111087, 111103, 111119, 111135, 111151, 111167, 111183, 111199, 111215,
+ 111231, 111247, 111263, 111279, 111295, 111311, 111327, 111343, 111359,
+ 111375, 111391, 111407, 111423, 111439, 111455, 111471, 111487, 111503,
+ 111519, 111535, 111551, 111567, 111583, 111599, 111615, 111631, 111647,
+ 111663, 111679, 111695, 111711, 111727, 111743, 111759, 111775, 111791,
+ 111807, 111823, 111839, 111855, 111871, 111887, 111903, 111919, 111935,
+ 111951, 111967, 111983, 111999, 112015, 112031, 112047, 112063, 112079,
+ 112095, 112111, 112127, 112143, 112159, 112175, 112191, 112207, 112223,
+ 112239, 112255, 112271, 112287, 112303, 112319, 112335, 112351, 112367,
+ 112383, 112399, 112415, 112431, 112447, 112463, 112479, 112495, 112511,
+ 112527, 112543, 112559, 112575, 112591, 112607, 112623, 112639, 112655,
+ 112671, 112687, 112703, 112719, 112735, 112751, 112767, 112783, 112799,
+ 112815, 112831, 112847, 112863, 112879, 112895, 112911, 112927, 112943,
+ 112959, 112969, 112978, 112983, 112991, 77204, 112996, 113002, 113007,
+ 113014, 113023, 113031, 113035, 4338, 113041, 113048, 113054, 113058,
+ 20549, 46595, 3295, 113063, 113067, 113071, 113078, 113084, 113093,
+ 113099, 113106, 113110, 113131, 113153, 113169, 113186, 113205, 113214,
+ 113224, 113232, 113239, 113246, 113252, 33070, 113266, 113270, 113276,
+ 113284, 113296, 113302, 113310, 113317, 113322, 113327, 113331, 113339,
+ 113346, 113350, 113356, 113362, 113367, 3972, 52543, 113373, 113377,
+ 113381, 113385, 113390, 113395, 113400, 113406, 113412, 113418, 113425,
+ 113431, 113438, 113444, 113450, 113455, 113461, 113466, 113470, 105563,
+ 113475, 105627, 52558, 113480, 113485, 113493, 113497, 113502, 113509,
+ 113518, 113525, 113531, 113540, 113544, 113551, 113555, 113558, 113565,
+ 113571, 113580, 113590, 113600, 113605, 113609, 113616, 113624, 113633,
+ 113637, 113645, 113651, 113656, 113661, 113667, 113673, 113678, 113682,
+ 31947, 113688, 113692, 113696, 113699, 113704, 113712, 113722, 113728,
+ 113733, 113743, 49664, 113751, 113763, 113769, 113776, 113782, 113786,
+ 113791, 113797, 113809, 113820, 113827, 113833, 113840, 113847, 113859,
+ 113866, 113872, 25629, 113876, 113884, 113890, 113897, 113903, 113909,
+ 113915, 113920, 113925, 113930, 113934, 113943, 113951, 113962, 7934,
+ 113967, 19985, 113973, 113977, 113981, 113985, 113993, 114002, 114006,
+ 114013, 114022, 114030, 114043, 114049, 106139, 36551, 114054, 114056,
+ 114061, 114066, 114071, 114076, 114081, 114086, 114091, 114096, 114101,
+ 114106, 114111, 114116, 114121, 114126, 114132, 114137, 114142, 114147,
+ 114152, 114157, 114162, 114167, 114172, 114178, 114184, 114190, 114195,
+ 114200, 114212, 114217, 1935, 54, 114222, 114227, 39630, 114231, 39635,
+ 39640, 39646, 39651, 114235, 39656, 26815, 114257, 114261, 114265,
+ 114270, 114274, 39660, 114278, 114286, 114293, 114299, 114309, 39665,
+ 114316, 114319, 114324, 114328, 114337, 11168, 114345, 39670, 26659,
+ 114348, 114352, 114360, 1307, 114365, 39681, 114368, 114373, 114378,
+ 31188, 31198, 43060, 114383, 114388, 114393, 114398, 114404, 114409,
+ 114418, 114423, 114432, 114440, 114447, 114453, 114458, 114463, 114468,
+ 114478, 114487, 114495, 114500, 114508, 114512, 114520, 114524, 114531,
+ 114538, 114546, 114553, 39485, 46310, 114559, 114565, 114570, 114575,
+ 14548, 11961, 114580, 114585, 114590, 114596, 114603, 114609, 114618,
+ 114623, 114631, 114641, 114648, 114658, 114664, 114669, 114675, 114679,
+ 21979, 114686, 44045, 114699, 114704, 114711, 114717, 114732, 37615,
+ 75612, 114745, 114749, 114758, 114767, 114774, 114780, 114788, 114794,
+ 114802, 114811, 114819, 114826, 46430, 114832, 114835, 114839, 114843,
+ 114847, 11982, 114853, 114860, 114866, 114874, 114879, 114883, 29180,
+ 114889, 114892, 114900, 114907, 114915, 114928, 114942, 114949, 114955,
+ 114962, 114968, 39695, 114972, 114978, 114986, 114993, 115001, 115009,
+ 115015, 39700, 115023, 115029, 115034, 115044, 115050, 115059, 37410,
+ 42408, 115067, 115072, 115077, 115081, 115086, 115090, 115098, 115103,
+ 17981, 18806, 49686, 115107, 115112, 39705, 18138, 115116, 115128,
+ 115133, 115137, 115144, 115153, 115157, 115165, 115171, 115176, 115184,
+ 115192, 115200, 115208, 115216, 115224, 115235, 115241, 9132, 115246,
+ 115252, 115257, 115262, 115273, 115282, 115294, 115309, 40017, 115315,
+ 20104, 39709, 115319, 115326, 115332, 115336, 29317, 115343, 115349,
+ 115356, 48811, 115365, 115371, 115380, 115386, 115391, 115399, 115405,
+ 115410, 39719, 115415, 115424, 115433, 113815, 115442, 115449, 115455,
+ 115461, 115470, 115480, 115486, 115494, 115501, 115505, 39724, 115508,
+ 39730, 1346, 115513, 115521, 115529, 115539, 115548, 115556, 115563,
+ 115573, 39741, 115577, 115579, 115583, 115588, 115592, 115596, 115602,
+ 115607, 115611, 115622, 115627, 115633, 115638, 115647, 115652, 3300,
+ 115656, 115663, 115667, 115676, 115684, 115692, 115699, 115704, 115709,
+ 74113, 115713, 115716, 115722, 115730, 115736, 115740, 115745, 115752,
+ 115757, 115762, 115766, 115773, 115779, 115784, 42439, 115788, 115791,
+ 115796, 115800, 115805, 115812, 115817, 115821, 47780, 115829, 31207,
+ 31216, 115835, 115841, 115847, 115852, 115856, 115859, 115869, 115878,
+ 115883, 115889, 115896, 115902, 115906, 115914, 115919, 42445, 85210,
+ 115923, 115931, 115938, 115944, 115951, 115956, 115963, 115968, 115972,
+ 115978, 115983, 69106, 115989, 115995, 10386, 116000, 116005, 116009,
+ 116014, 116019, 116024, 116028, 116033, 116038, 116044, 116049, 116054,
+ 116060, 116066, 116071, 116075, 116080, 116085, 116090, 116094, 29316,
+ 116099, 116104, 116110, 116116, 116122, 116127, 116131, 116136, 116141,
+ 109915, 116146, 116151, 116156, 116161, 109979, 52813, 116166, 39749,
+ 116174, 116178, 116186, 116194, 116205, 116210, 116214, 27294, 82608,
+ 116219, 116225, 116230, 4649, 116240, 116247, 116252, 116260, 116269,
+ 116274, 116278, 116283, 116287, 116295, 116303, 116310, 77470, 116316,
+ 116324, 116331, 116342, 116348, 116354, 39759, 116357, 116364, 116372,
+ 116377, 116381, 33589, 71792, 116387, 116392, 116399, 116404, 10275,
+ 116408, 116416, 116423, 116430, 116439, 116446, 116452, 116466, 116474,
+ 6724, 116236, 116480, 116485, 116491, 116495, 116498, 116506, 116513,
+ 116518, 116531, 116538, 116544, 116548, 116556, 116561, 116568, 116574,
+ 116579, 72070, 116584, 116587, 116596, 116603, 110187, 116609, 116612,
+ 116620, 116626, 116635, 116645, 116655, 116664, 116675, 116683, 116694,
+ 116699, 116703, 116708, 116712, 43191, 116720, 18771, 43200, 116725,
+ 101706, 101722, 101738, 101754, 101770, 116730, 101802, 101818, 101834,
+ 101850, 101962, 101978, 116734, 102010, 102026, 116738, 116742, 116746,
+ 116750, 102266, 102298, 116754, 102330, 116758, 116762, 102474, 102490,
+ 102506, 102522, 116766, 102586, 102602, 116770, 102730, 102746, 102762,
+ 102778, 102794, 102810, 102826, 102842, 102858, 102874, 102986, 103002,
+ 103018, 103034, 103050, 103066, 103082, 103098, 103114, 103130, 116774,
+ 104922, 105034, 105098, 105114, 105130, 105146, 105162, 105178, 105290,
+ 105306, 105322, 116778, 105370, 116782, 105402, 105418, 105434, 116786,
+ 116791, 116796, 116801, 116806, 116811, 116816, 116820, 116824, 116829,
+ 116834, 116838, 116843, 116848, 116852, 116857, 116862, 116867, 116872,
+ 116876, 116881, 116886, 116890, 116895, 116899, 116903, 116907, 116911,
+ 116916, 116920, 116924, 116928, 116932, 116936, 116940, 116944, 116948,
+ 116952, 116957, 116962, 116967, 116972, 116977, 116982, 116987, 116992,
+ 116997, 117002, 117006, 117010, 117014, 117018, 117022, 117026, 117031,
+ 117035, 117040, 117044, 117049, 117054, 117058, 117062, 117067, 117071,
+ 117075, 117079, 117083, 117087, 117091, 117095, 117099, 117103, 117107,
+ 117111, 117115, 117119, 117123, 117128, 117133, 117137, 117141, 117145,
+ 117149, 117153, 117157, 117162, 117166, 117170, 117174, 117178, 117182,
+ 117186, 117191, 117195, 117200, 117204, 117208, 117212, 117216, 117220,
+ 117224, 117228, 117232, 117236, 117240, 117244, 117249, 117253, 117257,
+ 117261, 117265, 117269, 117273, 117277, 117281, 117285, 117289, 117293,
+ 117298, 117302, 117306, 117311, 117316, 117320, 117324, 117328, 117332,
+ 117336, 117340, 117344, 117348, 117353, 117357, 117362, 117366, 117371,
+ 117375, 117380, 117384, 117390, 117395, 117399, 117404, 117408, 117413,
+ 117417, 117422, 117426, 117431, 1429, 117435, 117439, 3042, 1705, 28453,
+ 1602, 31143, 117443, 3051, 117447, 1276, 117452, 1218, 117456, 117460,
+ 117464, 117468, 117472, 117476, 3075, 117480, 117488, 117495, 117502,
+ 117516, 3079, 8044, 117525, 117533, 117540, 117551, 117560, 117564,
+ 117571, 117583, 117596, 117609, 117620, 117625, 117632, 117644, 117648,
+ 3083, 14185, 117658, 117663, 117672, 117682, 117687, 117696, 3087,
+ 117704, 117708, 117713, 117720, 117726, 117731, 117740, 117748, 117760,
+ 117770, 1223, 15645, 117783, 117787, 117793, 117807, 117819, 117831,
+ 117839, 117849, 117858, 117867, 117876, 117884, 117895, 117903, 4657,
+ 117913, 117924, 117933, 117939, 117954, 117961, 117967, 117972, 43334,
+ 117977, 3111, 15649, 117981, 117986, 117993, 10206, 118002, 118008, 4695,
+ 118018, 3116, 39121, 118027, 71682, 118034, 118038, 118044, 118055,
+ 118061, 118066, 118073, 118079, 118087, 118094, 118100, 118111, 118127,
+ 118137, 118146, 118157, 118166, 118173, 118179, 118189, 118197, 118203,
+ 118218, 118224, 118229, 118233, 118240, 118248, 118252, 118255, 118261,
+ 118268, 118274, 118282, 118291, 118299, 118305, 118314, 52116, 118328,
+ 118333, 118339, 17732, 118344, 118357, 118369, 118378, 118386, 118393,
+ 118397, 118401, 118404, 118411, 118418, 118426, 118434, 118443, 118451,
+ 17631, 118459, 118464, 118468, 118480, 118487, 118494, 118503, 954,
+ 118513, 118522, 118533, 3137, 118537, 118541, 118547, 118560, 118572,
+ 118582, 118591, 118603, 32105, 118614, 118622, 118631, 118642, 118653,
+ 118663, 118673, 118681, 118690, 118698, 13604, 118705, 118709, 118712,
+ 118717, 118722, 118726, 118732, 1228, 118739, 118743, 14281, 118747,
+ 118751, 118762, 118771, 118779, 118788, 118796, 118812, 118823, 118832,
+ 118840, 118852, 118863, 118879, 118889, 118910, 118924, 118937, 118945,
+ 118952, 8090, 118965, 118970, 118976, 6733, 118982, 118985, 118992,
+ 119002, 9266, 119009, 119014, 119019, 119026, 119034, 119042, 119048,
+ 119053, 119059, 119063, 119071, 119080, 119088, 119093, 119102, 119109,
+ 11418, 11427, 119115, 119126, 119132, 119137, 119143, 3153, 3158, 119149,
+ 1063, 119155, 119162, 119169, 119182, 119192, 119197, 2324, 87, 119205,
+ 119212, 119217, 119225, 119235, 119244, 119250, 119259, 119267, 119277,
+ 119281, 119285, 119290, 119294, 119306, 3181, 119314, 119322, 119327,
+ 119338, 119349, 119361, 119372, 119382, 119391, 26013, 119396, 119402,
+ 119407, 119417, 119427, 119432, 34323, 119438, 119443, 119452, 26035,
+ 119456, 26046, 119461, 4783, 8, 119468, 119477, 119484, 119491, 119497,
+ 119502, 119506, 119512, 34353, 119517, 119522, 72367, 119527, 119532,
+ 119538, 119544, 119552, 119557, 119565, 119573, 119582, 119589, 119595,
+ 119602, 119608, 119615, 119620, 47649, 52010, 119626, 119636, 1822, 32,
+ 119643, 119648, 119661, 119666, 119674, 119679, 119685, 3207, 30884,
+ 3221, 119690, 119698, 119705, 119710, 119715, 119724, 4340, 4351, 73711,
+ 119732, 119736, 1629, 1862, 119741, 119746, 119753, 34774, 1866, 331,
+ 119760, 119766, 119771, 3229, 119775, 119780, 119787, 1870, 119792,
+ 119798, 119803, 119815, 6978, 119825, 119832, 1877, 119838, 119843,
+ 119850, 119857, 119872, 119879, 119890, 119895, 119903, 2772, 119907,
+ 119919, 119924, 119928, 119934, 34195, 2329, 119938, 119949, 119953,
+ 119957, 119963, 119967, 119976, 119980, 119991, 119995, 2375, 38938,
+ 119999, 120009, 120017, 3320, 120023, 120032, 120040, 10752, 120045,
+ 120053, 120058, 120062, 120071, 120078, 120084, 3290, 17796, 120088,
+ 120101, 44058, 120119, 120124, 120132, 120140, 120150, 11759, 15773,
+ 120162, 120175, 120182, 120192, 120206, 120213, 120229, 120236, 120242,
+ 26093, 14980, 120249, 120256, 120266, 120275, 52812, 120287, 120295,
+ 52947, 120302, 120305, 120311, 120317, 120323, 120329, 120335, 120342,
+ 120349, 120355, 120361, 120367, 120373, 120379, 120385, 120391, 120397,
+ 120403, 120409, 120415, 120421, 120427, 120433, 120439, 120445, 120451,
+ 120457, 120463, 120469, 120475, 120481, 120487, 120493, 120499, 120505,
+ 120511, 120517, 120523, 120529, 120535, 120541, 120547, 120553, 120559,
+ 120565, 120571, 120577, 120583, 120589, 120595, 120601, 120607, 120613,
+ 120619, 120625, 120631, 120637, 120643, 120649, 120655, 120662, 120668,
+ 120675, 120682, 120688, 120695, 120702, 120708, 120714, 120720, 120726,
+ 120732, 120738, 120744, 120750, 120756, 120762, 120768, 120774, 120780,
+ 120786, 120792, 3304, 10720, 120798, 120808, 120814, 120822, 120826,
+ 117716, 3308, 120830, 114044, 25758, 4701, 4265, 120834, 3314, 120838,
+ 120848, 120854, 120860, 120866, 120872, 120878, 120884, 120890, 120896,
+ 120902, 120908, 120914, 120920, 120926, 120932, 120938, 120944, 120950,
+ 120956, 120962, 120968, 120974, 120980, 120986, 120992, 120998, 121005,
+ 121012, 121018, 121024, 121030, 121036, 121042, 121048, 1233, 121054,
+ 121059, 121064, 121069, 121074, 121079, 121084, 121089, 121094, 121098,
+ 121102, 121106, 121110, 121114, 121118, 121122, 121126, 121130, 121136,
+ 121142, 121148, 121154, 121158, 121162, 121166, 121170, 121174, 121178,
+ 121182, 121186, 121190, 121195, 121200, 121205, 121210, 121215, 121220,
+ 121225, 121230, 121235, 121240, 121245, 121250, 121255, 121260, 121265,
+ 121270, 121275, 121280, 121285, 121290, 121295, 121300, 121305, 121310,
+ 121315, 121320, 121325, 121330, 121335, 121340, 121345, 121350, 121355,
+ 121360, 121365, 121370, 121375, 121380, 121385, 121390, 121395, 121400,
+ 121405, 121410, 121415, 121420, 121425, 121430, 121435, 121440, 121445,
+ 121450, 121455, 121460, 121465, 121470, 121475, 121480, 121485, 121490,
+ 121495, 121500, 121505, 121510, 121515, 121520, 121525, 121530, 121535,
+ 121540, 121545, 121550, 121555, 121560, 121565, 121570, 121575, 121580,
+ 121585, 121590, 121595, 121600, 121605, 121610, 121615, 121620, 121625,
+ 121630, 121635, 121640, 121645, 121650, 121655, 121660, 121665, 121670,
+ 121675, 121680, 121685, 121690, 121695, 121700, 121705, 121710, 121715,
+ 121720, 121725, 121730, 121735, 121740, 121745, 121750, 121755, 121760,
+ 121765, 121770, 121775, 121780, 121785, 121790, 121795, 121800, 121805,
+ 121810, 121815, 121820, 121825, 121830, 121835, 121840, 121845, 121850,
+ 121855, 121860, 121865, 121870, 121875, 121880, 121885, 121890, 121895,
+ 121900, 121905, 121910, 121915, 121920, 121925, 121930, 121935, 121940,
+ 121945, 121950, 121955, 121960, 121965, 121970, 121975, 121980, 121985,
+ 121990, 121995, 122000, 122005, 122010, 122015, 122020, 122025, 122030,
+ 122035, 122040, 122045, 122050, 122055, 122060, 122065, 122070, 122075,
+ 122080, 122086, 122091, 122096, 122101, 122106, 122111, 122116, 122121,
+ 122127, 122132, 122137, 122142, 122147, 122152, 122157, 122162, 122167,
+ 122172, 122177, 122182, 122187, 122192, 122197, 122202, 122207, 122212,
+ 122217, 122222, 122227, 122232, 122237, 122242, 122247, 122252, 122257,
+ 122262, 122267, 122272, 122277, 122282, 122287, 122296, 122301, 122310,
+ 122315, 122324, 122329, 122338, 122343, 122352, 122357, 122366, 122371,
+ 122380, 122385, 122394, 122399, 122404, 122413, 122417, 122426, 122431,
+ 122440, 122445, 122454, 122459, 122468, 122473, 122482, 122487, 122496,
+ 122501, 122510, 122515, 122524, 122529, 122538, 122543, 122552, 122557,
+ 122562, 122567, 122572, 122577, 122582, 122587, 122591, 122596, 122601,
+ 122606, 122611, 122616, 122621, 122627, 122632, 122637, 122642, 122648,
+ 122652, 122657, 122663, 122668, 122673, 122678, 122683, 122688, 122693,
+ 122698, 122703, 122708, 122713, 122719, 122724, 122729, 122734, 122740,
+ 122745, 122750, 122755, 122760, 122766, 122771, 122776, 122781, 122786,
+ 122791, 122797, 122802, 122807, 122812, 122817, 122822, 122827, 122832,
+ 122837, 122842, 122847, 122852, 122857, 122862, 122867, 122872, 122877,
+ 122882, 122887, 122892, 122897, 122902, 122907, 122912, 122918, 122924,
+ 122930, 122935, 122940, 122945, 122950, 122956, 122962, 122968, 122973,
+ 122978, 122983, 122989, 122994, 122999, 123004, 123009, 123014, 123019,
+ 123024, 123029, 123034, 123039, 123044, 123049, 123054, 123059, 123064,
+ 123069, 123075, 123081, 123087, 123092, 123097, 123102, 123107, 123113,
+ 123119, 123125, 123130, 123135, 123140, 123145, 123150, 123155, 123160,
+ 123165, 123170, 19463, 123175, 123181, 123186, 123191, 123196, 123201,
+ 123206, 123212, 123217, 123222, 123227, 123232, 123237, 123243, 123248,
+ 123253, 123258, 123263, 123268, 123273, 123278, 123283, 123288, 123293,
+ 123298, 123303, 123308, 123313, 123318, 123323, 123328, 123333, 123338,
+ 123343, 123348, 123353, 123359, 123364, 123369, 123374, 123379, 123384,
+ 123389, 123394, 123399, 123404, 123409, 123414, 123419, 123424, 123429,
+ 123434, 123439, 123444, 123449, 123454, 123459, 123464, 123469, 123474,
+ 123479, 123484, 123489, 123494, 123499, 123504, 123509, 123514, 123519,
+ 123524, 123529, 123534, 123539, 123544, 123549, 123554, 123559, 123565,
+ 123570, 123575, 123580, 123585, 123590, 123595, 123600, 123605, 123610,
+ 123615, 123620, 123626, 123631, 123637, 123642, 123647, 123652, 123657,
+ 123662, 123667, 123673, 123678, 123683, 123689, 123694, 123699, 123704,
+ 123709, 123714, 123720, 123726, 123731, 123736, 14614, 123741, 123746,
+ 123751, 123756, 123761, 123766, 123771, 123776, 123781, 123786, 123791,
+ 123796, 123801, 123806, 123811, 123816, 123821, 123826, 123831, 123836,
+ 123841, 123846, 123851, 123856, 123861, 123866, 123871, 123876, 123881,
+ 123886, 123891, 123896, 123901, 123906, 123911, 123916, 123921, 123926,
+ 123931, 123936, 123941, 123946, 123951, 123956, 123961, 123966, 123971,
+ 123976, 123981, 123986, 123991, 123996, 124001, 124006, 124011, 124016,
+ 124021, 124026, 124031, 124036, 124041, 124046, 124051, 124056, 124061,
+ 124067, 124072, 124077, 124082, 124087, 124093, 124098, 124103, 124108,
+ 124113, 124118, 124123, 124129, 124134, 124139, 124144, 124149, 124154,
+ 124160, 124165, 124170, 124175, 124180, 124185, 124191, 124196, 124201,
+ 124206, 124211, 124216, 124222, 124228, 124233, 124238, 124243, 124249,
+ 124255, 124261, 124266, 124271, 124277, 124283, 124288, 124294, 124300,
+ 124306, 124311, 124316, 124322, 124327, 124333, 124338, 124344, 124353,
+ 124358, 124363, 124369, 124374, 124380, 124385, 124390, 124395, 124400,
+ 124405, 124410, 124415, 124420, 124425, 124430, 124435, 124440, 124445,
+ 124450, 124455, 124460, 124465, 124470, 124475, 124480, 124485, 124490,
+ 124495, 124500, 124505, 124510, 124515, 124520, 124525, 124530, 124535,
+ 124541, 124547, 124553, 124558, 124563, 124568, 124573, 124578, 124583,
+ 124588, 124593, 124598, 124603, 124608, 124613, 124618, 124623, 124628,
+ 124633, 124638, 124643, 124648, 124653, 124659, 124665, 124670, 124676,
+ 124681, 124686, 124692, 124697, 124703, 124708, 124714, 124719, 124725,
+ 124730, 124736, 124741, 124746, 124751, 124756, 124761, 124766, 124771,
+ 120849, 120855, 120861, 120867, 124777, 120873, 120879, 124783, 120885,
+ 120891, 120897, 120903, 120909, 120915, 120921, 120927, 120933, 124789,
+ 120939, 120945, 120951, 124795, 120957, 120963, 120969, 120975, 124801,
+ 120981, 120987, 120993, 121013, 124807, 124813, 121019, 124819, 121025,
+ 121031, 121037, 121043, 121049, 124825, 3331, 3336, 124830, 3351, 3356,
+ 3361, 124835, 124838, 124844, 124850, 124857, 124862, 124867, 2380,
+};
+
+/* code->name phrasebook */
+#define phrasebook_shift 7
+#define phrasebook_short 190
+static const unsigned char phrasebook[] = {
+ 0, 201, 247, 233, 216, 77, 207, 252, 77, 31, 56, 236, 155, 56, 210, 13,
+ 56, 251, 137, 251, 49, 45, 210, 113, 50, 210, 113, 250, 193, 108, 56,
+ 242, 74, 228, 87, 232, 80, 201, 63, 202, 23, 17, 191, 77, 17, 107, 17,
+ 109, 17, 138, 17, 134, 17, 149, 17, 169, 17, 175, 17, 171, 17, 178, 242,
+ 83, 204, 25, 219, 180, 56, 234, 43, 56, 230, 204, 56, 208, 13, 77, 242,
+ 72, 250, 182, 8, 6, 1, 65, 8, 6, 1, 250, 120, 8, 6, 1, 247, 193, 8, 6, 1,
+ 238, 127, 8, 6, 1, 71, 8, 6, 1, 233, 175, 8, 6, 1, 232, 51, 8, 6, 1, 230,
+ 116, 8, 6, 1, 68, 8, 6, 1, 223, 35, 8, 6, 1, 222, 152, 8, 6, 1, 172, 8,
+ 6, 1, 218, 168, 8, 6, 1, 215, 61, 8, 6, 1, 74, 8, 6, 1, 210, 236, 8, 6,
+ 1, 208, 104, 8, 6, 1, 146, 8, 6, 1, 206, 8, 8, 6, 1, 200, 43, 8, 6, 1,
+ 66, 8, 6, 1, 196, 12, 8, 6, 1, 193, 224, 8, 6, 1, 192, 235, 8, 6, 1, 192,
+ 159, 8, 6, 1, 191, 166, 45, 51, 248, 53, 207, 19, 202, 23, 50, 51, 248,
+ 53, 243, 2, 252, 60, 130, 219, 112, 230, 211, 252, 60, 8, 2, 1, 65, 8, 2,
+ 1, 250, 120, 8, 2, 1, 247, 193, 8, 2, 1, 238, 127, 8, 2, 1, 71, 8, 2, 1,
+ 233, 175, 8, 2, 1, 232, 51, 8, 2, 1, 230, 116, 8, 2, 1, 68, 8, 2, 1, 223,
+ 35, 8, 2, 1, 222, 152, 8, 2, 1, 172, 8, 2, 1, 218, 168, 8, 2, 1, 215, 61,
+ 8, 2, 1, 74, 8, 2, 1, 210, 236, 8, 2, 1, 208, 104, 8, 2, 1, 146, 8, 2, 1,
+ 206, 8, 8, 2, 1, 200, 43, 8, 2, 1, 66, 8, 2, 1, 196, 12, 8, 2, 1, 193,
+ 224, 8, 2, 1, 192, 235, 8, 2, 1, 192, 159, 8, 2, 1, 191, 166, 45, 238,
+ 171, 248, 53, 81, 219, 112, 50, 238, 171, 248, 53, 198, 152, 213, 37,
+ 201, 247, 223, 93, 233, 216, 77, 247, 24, 56, 209, 8, 56, 238, 170, 56,
+ 192, 71, 56, 248, 22, 164, 205, 54, 56, 237, 42, 239, 6, 56, 233, 40,
+ 211, 50, 223, 144, 219, 219, 55, 251, 116, 207, 252, 77, 213, 12, 56,
+ 202, 32, 228, 88, 207, 78, 56, 217, 146, 237, 125, 56, 209, 80, 56, 200,
+ 182, 109, 200, 182, 138, 252, 47, 252, 60, 216, 91, 56, 209, 142, 56, 82,
+ 236, 140, 247, 35, 200, 182, 107, 217, 40, 211, 50, 223, 144, 206, 203,
+ 55, 251, 116, 207, 252, 77, 193, 246, 232, 118, 91, 208, 22, 193, 246,
+ 232, 118, 91, 230, 70, 193, 246, 232, 118, 115, 208, 20, 223, 93, 208,
+ 13, 77, 8, 6, 1, 42, 4, 230, 210, 8, 6, 1, 42, 4, 252, 46, 8, 6, 1, 42,
+ 4, 243, 1, 8, 6, 1, 42, 4, 198, 152, 8, 6, 1, 42, 4, 237, 42, 8, 6, 1,
+ 42, 4, 206, 189, 58, 8, 6, 1, 252, 25, 8, 6, 1, 247, 194, 4, 247, 35, 8,
+ 6, 1, 235, 15, 4, 230, 210, 8, 6, 1, 235, 15, 4, 252, 46, 8, 6, 1, 235,
+ 15, 4, 243, 1, 8, 6, 1, 235, 15, 4, 237, 42, 8, 6, 1, 228, 74, 4, 230,
+ 210, 8, 6, 1, 228, 74, 4, 252, 46, 8, 6, 1, 228, 74, 4, 243, 1, 8, 6, 1,
+ 228, 74, 4, 237, 42, 8, 6, 1, 233, 248, 8, 6, 1, 215, 62, 4, 198, 152, 8,
+ 6, 1, 187, 4, 230, 210, 8, 6, 1, 187, 4, 252, 46, 8, 6, 1, 187, 4, 243,
+ 1, 8, 6, 1, 187, 4, 198, 152, 8, 6, 1, 187, 4, 237, 42, 215, 127, 56, 8,
+ 6, 1, 187, 4, 106, 8, 6, 1, 126, 4, 230, 210, 8, 6, 1, 126, 4, 252, 46,
+ 8, 6, 1, 126, 4, 243, 1, 8, 6, 1, 126, 4, 237, 42, 8, 6, 1, 192, 160, 4,
+ 252, 46, 8, 6, 1, 198, 233, 8, 2, 1, 203, 127, 206, 8, 8, 2, 1, 42, 4,
+ 230, 210, 8, 2, 1, 42, 4, 252, 46, 8, 2, 1, 42, 4, 243, 1, 8, 2, 1, 42,
+ 4, 198, 152, 8, 2, 1, 42, 4, 237, 42, 8, 2, 1, 42, 4, 206, 189, 58, 8, 2,
+ 1, 252, 25, 8, 2, 1, 247, 194, 4, 247, 35, 8, 2, 1, 235, 15, 4, 230, 210,
+ 8, 2, 1, 235, 15, 4, 252, 46, 8, 2, 1, 235, 15, 4, 243, 1, 8, 2, 1, 235,
+ 15, 4, 237, 42, 8, 2, 1, 228, 74, 4, 230, 210, 8, 2, 1, 228, 74, 4, 252,
+ 46, 8, 2, 1, 228, 74, 4, 243, 1, 8, 2, 1, 228, 74, 4, 237, 42, 8, 2, 1,
+ 233, 248, 8, 2, 1, 215, 62, 4, 198, 152, 8, 2, 1, 187, 4, 230, 210, 8, 2,
+ 1, 187, 4, 252, 46, 8, 2, 1, 187, 4, 243, 1, 8, 2, 1, 187, 4, 198, 152,
+ 8, 2, 1, 187, 4, 237, 42, 236, 200, 56, 8, 2, 1, 187, 4, 106, 8, 2, 1,
+ 126, 4, 230, 210, 8, 2, 1, 126, 4, 252, 46, 8, 2, 1, 126, 4, 243, 1, 8,
+ 2, 1, 126, 4, 237, 42, 8, 2, 1, 192, 160, 4, 252, 46, 8, 2, 1, 198, 233,
+ 8, 2, 1, 192, 160, 4, 237, 42, 8, 6, 1, 42, 4, 217, 146, 8, 2, 1, 42, 4,
+ 217, 146, 8, 6, 1, 42, 4, 248, 36, 8, 2, 1, 42, 4, 248, 36, 8, 6, 1, 42,
+ 4, 211, 138, 8, 2, 1, 42, 4, 211, 138, 8, 6, 1, 247, 194, 4, 252, 46, 8,
+ 2, 1, 247, 194, 4, 252, 46, 8, 6, 1, 247, 194, 4, 243, 1, 8, 2, 1, 247,
+ 194, 4, 243, 1, 8, 6, 1, 247, 194, 4, 75, 58, 8, 2, 1, 247, 194, 4, 75,
+ 58, 8, 6, 1, 247, 194, 4, 247, 92, 8, 2, 1, 247, 194, 4, 247, 92, 8, 6,
+ 1, 238, 128, 4, 247, 92, 8, 2, 1, 238, 128, 4, 247, 92, 8, 6, 1, 238,
+ 128, 4, 106, 8, 2, 1, 238, 128, 4, 106, 8, 6, 1, 235, 15, 4, 217, 146, 8,
+ 2, 1, 235, 15, 4, 217, 146, 8, 6, 1, 235, 15, 4, 248, 36, 8, 2, 1, 235,
+ 15, 4, 248, 36, 8, 6, 1, 235, 15, 4, 75, 58, 8, 2, 1, 235, 15, 4, 75, 58,
+ 8, 6, 1, 235, 15, 4, 211, 138, 8, 2, 1, 235, 15, 4, 211, 138, 8, 6, 1,
+ 235, 15, 4, 247, 92, 8, 2, 1, 235, 15, 4, 247, 92, 8, 6, 1, 232, 52, 4,
+ 243, 1, 8, 2, 1, 232, 52, 4, 243, 1, 8, 6, 1, 232, 52, 4, 248, 36, 8, 2,
+ 1, 232, 52, 4, 248, 36, 8, 6, 1, 232, 52, 4, 75, 58, 8, 2, 1, 232, 52, 4,
+ 75, 58, 8, 6, 1, 232, 52, 4, 247, 35, 8, 2, 1, 232, 52, 4, 247, 35, 8, 6,
+ 1, 230, 117, 4, 243, 1, 8, 2, 1, 230, 117, 4, 243, 1, 8, 6, 1, 230, 117,
+ 4, 106, 8, 2, 1, 230, 117, 4, 106, 8, 6, 1, 228, 74, 4, 198, 152, 8, 2,
+ 1, 228, 74, 4, 198, 152, 8, 6, 1, 228, 74, 4, 217, 146, 8, 2, 1, 228, 74,
+ 4, 217, 146, 8, 6, 1, 228, 74, 4, 248, 36, 8, 2, 1, 228, 74, 4, 248, 36,
+ 8, 6, 1, 228, 74, 4, 211, 138, 8, 2, 1, 228, 74, 4, 211, 138, 8, 6, 1,
+ 228, 74, 4, 75, 58, 8, 2, 1, 236, 139, 68, 8, 6, 34, 223, 197, 8, 2, 34,
+ 223, 197, 8, 6, 1, 223, 36, 4, 243, 1, 8, 2, 1, 223, 36, 4, 243, 1, 8, 6,
+ 1, 222, 153, 4, 247, 35, 8, 2, 1, 222, 153, 4, 247, 35, 8, 2, 1, 221, 8,
+ 8, 6, 1, 220, 143, 4, 252, 46, 8, 2, 1, 220, 143, 4, 252, 46, 8, 6, 1,
+ 220, 143, 4, 247, 35, 8, 2, 1, 220, 143, 4, 247, 35, 8, 6, 1, 220, 143,
+ 4, 247, 92, 8, 2, 1, 220, 143, 4, 247, 92, 8, 6, 1, 220, 143, 4, 82, 236,
+ 140, 8, 2, 1, 220, 143, 4, 82, 236, 140, 8, 6, 1, 220, 143, 4, 106, 8, 2,
+ 1, 220, 143, 4, 106, 8, 6, 1, 215, 62, 4, 252, 46, 8, 2, 1, 215, 62, 4,
+ 252, 46, 8, 6, 1, 215, 62, 4, 247, 35, 8, 2, 1, 215, 62, 4, 247, 35, 8,
+ 6, 1, 215, 62, 4, 247, 92, 8, 2, 1, 215, 62, 4, 247, 92, 8, 2, 1, 215,
+ 62, 208, 233, 247, 205, 251, 49, 8, 6, 1, 234, 88, 8, 2, 1, 234, 88, 8,
+ 6, 1, 187, 4, 217, 146, 8, 2, 1, 187, 4, 217, 146, 8, 6, 1, 187, 4, 248,
+ 36, 8, 2, 1, 187, 4, 248, 36, 8, 6, 1, 187, 4, 55, 252, 46, 8, 2, 1, 187,
+ 4, 55, 252, 46, 8, 6, 34, 211, 151, 8, 2, 34, 211, 151, 8, 6, 1, 207,
+ 222, 4, 252, 46, 8, 2, 1, 207, 222, 4, 252, 46, 8, 6, 1, 207, 222, 4,
+ 247, 35, 8, 2, 1, 207, 222, 4, 247, 35, 8, 6, 1, 207, 222, 4, 247, 92, 8,
+ 2, 1, 207, 222, 4, 247, 92, 8, 6, 1, 206, 9, 4, 252, 46, 8, 2, 1, 206, 9,
+ 4, 252, 46, 8, 6, 1, 206, 9, 4, 243, 1, 8, 2, 1, 206, 9, 4, 243, 1, 8, 6,
+ 1, 206, 9, 4, 247, 35, 8, 2, 1, 206, 9, 4, 247, 35, 8, 6, 1, 206, 9, 4,
+ 247, 92, 8, 2, 1, 206, 9, 4, 247, 92, 8, 6, 1, 200, 44, 4, 247, 35, 8, 2,
+ 1, 200, 44, 4, 247, 35, 8, 6, 1, 200, 44, 4, 247, 92, 8, 2, 1, 200, 44,
+ 4, 247, 92, 8, 6, 1, 200, 44, 4, 106, 8, 2, 1, 200, 44, 4, 106, 8, 6, 1,
+ 126, 4, 198, 152, 8, 2, 1, 126, 4, 198, 152, 8, 6, 1, 126, 4, 217, 146,
+ 8, 2, 1, 126, 4, 217, 146, 8, 6, 1, 126, 4, 248, 36, 8, 2, 1, 126, 4,
+ 248, 36, 8, 6, 1, 126, 4, 206, 189, 58, 8, 2, 1, 126, 4, 206, 189, 58, 8,
+ 6, 1, 126, 4, 55, 252, 46, 8, 2, 1, 126, 4, 55, 252, 46, 8, 6, 1, 126, 4,
+ 211, 138, 8, 2, 1, 126, 4, 211, 138, 8, 6, 1, 193, 225, 4, 243, 1, 8, 2,
+ 1, 193, 225, 4, 243, 1, 8, 6, 1, 192, 160, 4, 243, 1, 8, 2, 1, 192, 160,
+ 4, 243, 1, 8, 6, 1, 192, 160, 4, 237, 42, 8, 6, 1, 191, 167, 4, 252, 46,
+ 8, 2, 1, 191, 167, 4, 252, 46, 8, 6, 1, 191, 167, 4, 75, 58, 8, 2, 1,
+ 191, 167, 4, 75, 58, 8, 6, 1, 191, 167, 4, 247, 92, 8, 2, 1, 191, 167, 4,
+ 247, 92, 8, 2, 1, 179, 206, 8, 8, 2, 1, 78, 4, 106, 8, 6, 1, 78, 4, 102,
+ 8, 6, 1, 78, 4, 198, 51, 8, 2, 1, 78, 4, 198, 51, 8, 6, 1, 163, 169, 8,
+ 2, 1, 163, 169, 8, 6, 1, 211, 77, 74, 8, 6, 1, 247, 194, 4, 102, 8, 2, 1,
+ 247, 194, 4, 102, 8, 6, 1, 252, 0, 238, 127, 8, 6, 1, 238, 128, 4, 102,
+ 8, 6, 1, 238, 128, 4, 198, 51, 8, 2, 1, 238, 128, 4, 198, 51, 8, 2, 1,
+ 153, 237, 106, 8, 6, 1, 207, 18, 71, 8, 6, 1, 205, 86, 8, 6, 1, 211, 77,
+ 71, 8, 6, 1, 233, 176, 4, 102, 8, 2, 1, 233, 176, 4, 102, 8, 6, 1, 232,
+ 52, 4, 102, 8, 6, 1, 231, 211, 8, 2, 1, 228, 126, 8, 6, 1, 223, 83, 8, 6,
+ 1, 228, 74, 4, 106, 8, 6, 1, 222, 153, 4, 102, 8, 2, 1, 222, 153, 4, 102,
+ 8, 2, 1, 220, 143, 4, 164, 8, 2, 1, 220, 33, 4, 106, 8, 6, 1, 153, 218,
+ 168, 8, 6, 1, 215, 62, 4, 45, 102, 8, 2, 1, 215, 62, 4, 179, 50, 219,
+ 212, 8, 6, 1, 187, 4, 82, 198, 152, 8, 6, 1, 187, 4, 228, 187, 8, 2, 1,
+ 187, 4, 228, 187, 8, 6, 1, 211, 133, 8, 2, 1, 211, 133, 8, 6, 1, 210,
+ 237, 4, 102, 8, 2, 1, 210, 237, 4, 102, 8, 1, 191, 228, 8, 6, 1, 163,
+ 109, 8, 2, 1, 163, 109, 8, 6, 1, 234, 12, 8, 1, 207, 18, 234, 13, 219, 4,
+ 8, 2, 1, 200, 44, 4, 210, 192, 102, 8, 6, 1, 200, 44, 4, 102, 8, 2, 1,
+ 200, 44, 4, 102, 8, 6, 1, 200, 44, 4, 207, 24, 102, 8, 6, 1, 126, 4, 228,
+ 187, 8, 2, 1, 126, 4, 228, 187, 8, 6, 1, 196, 70, 8, 6, 1, 196, 13, 4,
+ 102, 8, 6, 1, 192, 160, 4, 102, 8, 2, 1, 192, 160, 4, 102, 8, 6, 1, 191,
+ 167, 4, 106, 8, 2, 1, 191, 167, 4, 106, 8, 6, 1, 233, 178, 8, 6, 1, 233,
+ 179, 207, 17, 8, 2, 1, 233, 179, 207, 17, 8, 2, 1, 233, 179, 4, 199, 215,
+ 8, 1, 105, 4, 106, 8, 6, 1, 163, 149, 8, 2, 1, 163, 149, 8, 1, 223, 93,
+ 231, 11, 201, 64, 4, 106, 8, 1, 192, 238, 8, 1, 237, 98, 242, 231, 8, 1,
+ 220, 3, 242, 231, 8, 1, 251, 150, 242, 231, 8, 1, 207, 24, 242, 231, 8,
+ 6, 1, 235, 37, 4, 247, 92, 8, 6, 1, 238, 128, 4, 2, 1, 191, 167, 4, 247,
+ 92, 8, 2, 1, 235, 37, 4, 247, 92, 8, 6, 1, 219, 77, 8, 6, 1, 220, 143, 4,
+ 2, 1, 223, 35, 8, 2, 1, 219, 77, 8, 6, 1, 213, 158, 8, 6, 1, 215, 62, 4,
+ 2, 1, 223, 35, 8, 2, 1, 213, 158, 8, 6, 1, 42, 4, 247, 92, 8, 2, 1, 42,
+ 4, 247, 92, 8, 6, 1, 228, 74, 4, 247, 92, 8, 2, 1, 228, 74, 4, 247, 92,
+ 8, 6, 1, 187, 4, 247, 92, 8, 2, 1, 187, 4, 247, 92, 8, 6, 1, 126, 4, 247,
+ 92, 8, 2, 1, 126, 4, 247, 92, 8, 6, 1, 126, 4, 237, 43, 23, 217, 146, 8,
+ 2, 1, 126, 4, 237, 43, 23, 217, 146, 8, 6, 1, 126, 4, 237, 43, 23, 252,
+ 46, 8, 2, 1, 126, 4, 237, 43, 23, 252, 46, 8, 6, 1, 126, 4, 237, 43, 23,
+ 247, 92, 8, 2, 1, 126, 4, 237, 43, 23, 247, 92, 8, 6, 1, 126, 4, 237, 43,
+ 23, 230, 210, 8, 2, 1, 126, 4, 237, 43, 23, 230, 210, 8, 2, 1, 153, 71,
+ 8, 6, 1, 42, 4, 237, 43, 23, 217, 146, 8, 2, 1, 42, 4, 237, 43, 23, 217,
+ 146, 8, 6, 1, 42, 4, 75, 93, 23, 217, 146, 8, 2, 1, 42, 4, 75, 93, 23,
+ 217, 146, 8, 6, 1, 252, 26, 4, 217, 146, 8, 2, 1, 252, 26, 4, 217, 146,
+ 8, 6, 1, 232, 52, 4, 106, 8, 2, 1, 232, 52, 4, 106, 8, 6, 1, 232, 52, 4,
+ 247, 92, 8, 2, 1, 232, 52, 4, 247, 92, 8, 6, 1, 222, 153, 4, 247, 92, 8,
+ 2, 1, 222, 153, 4, 247, 92, 8, 6, 1, 187, 4, 211, 138, 8, 2, 1, 187, 4,
+ 211, 138, 8, 6, 1, 187, 4, 211, 139, 23, 217, 146, 8, 2, 1, 187, 4, 211,
+ 139, 23, 217, 146, 8, 6, 1, 233, 179, 4, 247, 92, 8, 2, 1, 233, 179, 4,
+ 247, 92, 8, 2, 1, 223, 36, 4, 247, 92, 8, 6, 1, 235, 36, 8, 6, 1, 238,
+ 128, 4, 2, 1, 191, 166, 8, 2, 1, 235, 36, 8, 6, 1, 232, 52, 4, 252, 46,
+ 8, 2, 1, 232, 52, 4, 252, 46, 8, 6, 1, 228, 123, 8, 6, 1, 192, 238, 8, 6,
+ 1, 215, 62, 4, 230, 210, 8, 2, 1, 215, 62, 4, 230, 210, 8, 6, 1, 42, 4,
+ 206, 189, 93, 23, 252, 46, 8, 2, 1, 42, 4, 206, 189, 93, 23, 252, 46, 8,
+ 6, 1, 252, 26, 4, 252, 46, 8, 2, 1, 252, 26, 4, 252, 46, 8, 6, 1, 187, 4,
+ 201, 28, 23, 252, 46, 8, 2, 1, 187, 4, 201, 28, 23, 252, 46, 8, 6, 1, 42,
+ 4, 55, 230, 210, 8, 2, 1, 42, 4, 55, 230, 210, 8, 6, 1, 42, 4, 223, 93,
+ 248, 36, 8, 2, 1, 42, 4, 223, 93, 248, 36, 8, 6, 1, 235, 15, 4, 55, 230,
+ 210, 8, 2, 1, 235, 15, 4, 55, 230, 210, 8, 6, 1, 235, 15, 4, 223, 93,
+ 248, 36, 8, 2, 1, 235, 15, 4, 223, 93, 248, 36, 8, 6, 1, 228, 74, 4, 55,
+ 230, 210, 8, 2, 1, 228, 74, 4, 55, 230, 210, 8, 6, 1, 228, 74, 4, 223,
+ 93, 248, 36, 8, 2, 1, 228, 74, 4, 223, 93, 248, 36, 8, 6, 1, 187, 4, 55,
+ 230, 210, 8, 2, 1, 187, 4, 55, 230, 210, 8, 6, 1, 187, 4, 223, 93, 248,
+ 36, 8, 2, 1, 187, 4, 223, 93, 248, 36, 8, 6, 1, 207, 222, 4, 55, 230,
+ 210, 8, 2, 1, 207, 222, 4, 55, 230, 210, 8, 6, 1, 207, 222, 4, 223, 93,
+ 248, 36, 8, 2, 1, 207, 222, 4, 223, 93, 248, 36, 8, 6, 1, 126, 4, 55,
+ 230, 210, 8, 2, 1, 126, 4, 55, 230, 210, 8, 6, 1, 126, 4, 223, 93, 248,
+ 36, 8, 2, 1, 126, 4, 223, 93, 248, 36, 8, 6, 1, 206, 9, 4, 242, 75, 60,
+ 8, 2, 1, 206, 9, 4, 242, 75, 60, 8, 6, 1, 200, 44, 4, 242, 75, 60, 8, 2,
+ 1, 200, 44, 4, 242, 75, 60, 8, 6, 1, 191, 248, 8, 2, 1, 191, 248, 8, 6,
+ 1, 230, 117, 4, 247, 92, 8, 2, 1, 230, 117, 4, 247, 92, 8, 6, 1, 215, 62,
+ 4, 179, 50, 219, 212, 8, 2, 1, 238, 128, 4, 238, 175, 8, 6, 1, 211, 19,
+ 8, 2, 1, 211, 19, 8, 6, 1, 191, 167, 4, 102, 8, 2, 1, 191, 167, 4, 102,
+ 8, 6, 1, 42, 4, 75, 58, 8, 2, 1, 42, 4, 75, 58, 8, 6, 1, 235, 15, 4, 247,
+ 35, 8, 2, 1, 235, 15, 4, 247, 35, 8, 6, 1, 187, 4, 237, 43, 23, 217, 146,
+ 8, 2, 1, 187, 4, 237, 43, 23, 217, 146, 8, 6, 1, 187, 4, 198, 153, 23,
+ 217, 146, 8, 2, 1, 187, 4, 198, 153, 23, 217, 146, 8, 6, 1, 187, 4, 75,
+ 58, 8, 2, 1, 187, 4, 75, 58, 8, 6, 1, 187, 4, 75, 93, 23, 217, 146, 8, 2,
+ 1, 187, 4, 75, 93, 23, 217, 146, 8, 6, 1, 192, 160, 4, 217, 146, 8, 2, 1,
+ 192, 160, 4, 217, 146, 8, 2, 1, 220, 143, 4, 238, 175, 8, 2, 1, 215, 62,
+ 4, 238, 175, 8, 2, 1, 200, 44, 4, 238, 175, 8, 2, 1, 236, 139, 223, 35,
+ 8, 2, 1, 237, 201, 237, 2, 8, 2, 1, 208, 34, 237, 2, 8, 6, 1, 42, 4, 106,
+ 8, 6, 1, 247, 194, 4, 106, 8, 2, 1, 247, 194, 4, 106, 8, 6, 1, 220, 143,
+ 4, 164, 8, 6, 1, 200, 44, 4, 237, 39, 106, 8, 2, 1, 206, 9, 4, 200, 146,
+ 199, 215, 8, 2, 1, 191, 167, 4, 200, 146, 199, 215, 8, 6, 1, 231, 11,
+ 201, 63, 8, 2, 1, 231, 11, 201, 63, 8, 6, 1, 78, 4, 106, 8, 6, 1, 126,
+ 164, 8, 6, 1, 153, 196, 12, 8, 6, 1, 235, 15, 4, 106, 8, 2, 1, 235, 15,
+ 4, 106, 8, 6, 1, 223, 36, 4, 106, 8, 2, 1, 223, 36, 4, 106, 8, 6, 1, 2,
+ 208, 105, 4, 228, 251, 199, 215, 8, 2, 1, 208, 105, 4, 228, 251, 199,
+ 215, 8, 6, 1, 207, 222, 4, 106, 8, 2, 1, 207, 222, 4, 106, 8, 6, 1, 192,
+ 160, 4, 106, 8, 2, 1, 192, 160, 4, 106, 8, 2, 1, 153, 65, 8, 2, 1, 251,
+ 160, 8, 2, 1, 153, 251, 160, 8, 2, 1, 78, 4, 102, 8, 2, 1, 211, 77, 74,
+ 8, 2, 1, 247, 194, 4, 238, 175, 8, 2, 1, 238, 128, 4, 199, 215, 8, 2, 1,
+ 238, 128, 4, 102, 8, 2, 1, 207, 18, 71, 8, 2, 1, 205, 86, 8, 2, 1, 205,
+ 87, 4, 102, 8, 2, 1, 211, 77, 71, 8, 2, 1, 207, 18, 211, 77, 71, 8, 2, 1,
+ 207, 18, 211, 77, 235, 15, 4, 102, 8, 2, 1, 242, 219, 207, 18, 211, 77,
+ 71, 8, 2, 1, 236, 139, 223, 36, 4, 106, 8, 2, 1, 232, 52, 4, 102, 8, 2,
+ 1, 27, 232, 51, 8, 1, 2, 6, 232, 51, 8, 2, 1, 231, 211, 8, 2, 1, 207,
+ 140, 228, 187, 8, 2, 1, 153, 230, 116, 8, 2, 1, 230, 117, 4, 102, 8, 2,
+ 1, 229, 197, 4, 102, 8, 2, 1, 228, 74, 4, 106, 8, 2, 1, 223, 83, 8, 1, 2,
+ 6, 68, 8, 2, 1, 220, 143, 4, 82, 198, 152, 8, 2, 1, 220, 143, 4, 248,
+ 231, 8, 2, 1, 220, 143, 4, 207, 24, 102, 8, 2, 1, 219, 162, 8, 2, 1, 153,
+ 218, 168, 8, 2, 1, 153, 218, 169, 4, 179, 219, 212, 8, 2, 1, 218, 169, 4,
+ 102, 8, 2, 1, 215, 62, 4, 45, 102, 8, 2, 1, 215, 62, 4, 207, 24, 102, 8,
+ 1, 2, 6, 215, 61, 8, 2, 1, 249, 82, 74, 8, 1, 2, 6, 211, 151, 8, 2, 1,
+ 242, 219, 211, 110, 8, 2, 1, 209, 211, 8, 2, 1, 153, 146, 8, 2, 1, 153,
+ 207, 222, 4, 179, 219, 212, 8, 2, 1, 153, 207, 222, 4, 102, 8, 2, 1, 207,
+ 222, 4, 179, 219, 212, 8, 2, 1, 207, 222, 4, 199, 215, 8, 2, 1, 207, 222,
+ 4, 232, 233, 8, 2, 1, 207, 18, 207, 222, 4, 232, 233, 8, 1, 2, 6, 146, 8,
+ 1, 2, 6, 223, 93, 146, 8, 2, 1, 206, 9, 4, 102, 8, 2, 1, 234, 12, 8, 2,
+ 1, 236, 139, 223, 36, 4, 201, 28, 23, 102, 8, 2, 1, 201, 187, 207, 18,
+ 234, 12, 8, 2, 1, 234, 13, 4, 238, 175, 8, 2, 1, 153, 200, 43, 8, 2, 1,
+ 200, 44, 4, 207, 24, 102, 8, 2, 1, 126, 164, 8, 2, 1, 196, 70, 8, 2, 1,
+ 196, 13, 4, 102, 8, 2, 1, 153, 196, 12, 8, 2, 1, 153, 193, 224, 8, 2, 1,
+ 153, 192, 159, 8, 1, 2, 6, 192, 159, 8, 2, 1, 191, 167, 4, 207, 24, 102,
+ 8, 2, 1, 191, 167, 4, 238, 175, 8, 2, 1, 233, 178, 8, 2, 1, 233, 179, 4,
+ 238, 175, 8, 1, 231, 11, 201, 63, 8, 1, 209, 219, 195, 20, 232, 104, 8,
+ 1, 223, 93, 231, 11, 201, 63, 8, 1, 201, 36, 247, 193, 8, 1, 248, 172,
+ 242, 231, 8, 1, 2, 6, 250, 120, 8, 2, 1, 242, 219, 211, 77, 71, 8, 1, 2,
+ 6, 232, 52, 4, 102, 8, 1, 2, 6, 230, 116, 8, 2, 1, 223, 36, 4, 238, 212,
+ 8, 2, 1, 153, 222, 152, 8, 1, 2, 6, 172, 8, 2, 1, 208, 105, 4, 102, 8, 1,
+ 231, 11, 201, 64, 4, 106, 8, 1, 207, 18, 231, 11, 201, 64, 4, 106, 8, 2,
+ 1, 235, 37, 237, 2, 8, 2, 1, 237, 70, 237, 2, 8, 2, 1, 235, 37, 237, 3,
+ 4, 238, 175, 8, 2, 1, 197, 170, 237, 2, 8, 2, 1, 199, 79, 237, 2, 8, 2,
+ 1, 199, 152, 237, 3, 4, 238, 175, 8, 2, 1, 233, 37, 237, 2, 8, 2, 1, 218,
+ 227, 237, 2, 8, 2, 1, 218, 170, 237, 2, 8, 1, 248, 172, 210, 12, 8, 1,
+ 248, 180, 210, 12, 8, 2, 1, 153, 230, 117, 4, 232, 233, 8, 2, 1, 153,
+ 230, 117, 4, 232, 234, 23, 199, 215, 52, 1, 2, 230, 116, 52, 1, 2, 230,
+ 117, 4, 102, 52, 1, 2, 223, 35, 52, 1, 2, 146, 52, 1, 2, 153, 146, 52, 1,
+ 2, 153, 207, 222, 4, 102, 52, 1, 2, 6, 223, 93, 146, 52, 1, 2, 193, 224,
+ 52, 1, 2, 192, 159, 52, 1, 208, 215, 52, 1, 55, 208, 215, 52, 1, 153,
+ 242, 74, 52, 1, 251, 49, 52, 1, 207, 18, 242, 74, 52, 1, 50, 132, 206,
+ 188, 52, 1, 45, 132, 206, 188, 52, 1, 231, 11, 201, 63, 52, 1, 207, 18,
+ 231, 11, 201, 63, 52, 1, 45, 250, 235, 52, 1, 50, 250, 235, 52, 1, 133,
+ 250, 235, 52, 1, 144, 250, 235, 52, 1, 243, 2, 252, 60, 247, 92, 52, 1,
+ 81, 219, 112, 52, 1, 217, 146, 52, 1, 252, 47, 252, 60, 52, 1, 230, 211,
+ 252, 60, 52, 1, 130, 81, 219, 112, 52, 1, 130, 217, 146, 52, 1, 130, 230,
+ 211, 252, 60, 52, 1, 130, 252, 47, 252, 60, 52, 1, 197, 238, 242, 83, 52,
+ 1, 132, 197, 238, 242, 83, 52, 1, 247, 20, 50, 132, 206, 188, 52, 1, 247,
+ 20, 45, 132, 206, 188, 52, 1, 133, 199, 228, 52, 1, 144, 199, 228, 52, 1,
+ 108, 56, 52, 1, 216, 35, 56, 248, 36, 75, 58, 206, 189, 58, 211, 138, 2,
+ 198, 152, 55, 252, 47, 252, 60, 52, 1, 207, 2, 102, 52, 1, 238, 218, 252,
+ 60, 52, 1, 2, 231, 211, 52, 1, 2, 172, 52, 1, 2, 206, 8, 52, 1, 2, 192,
+ 235, 52, 1, 2, 207, 18, 231, 11, 201, 63, 52, 1, 233, 200, 163, 164, 52,
+ 1, 137, 163, 164, 52, 1, 216, 87, 163, 164, 52, 1, 130, 163, 164, 52, 1,
+ 233, 199, 163, 164, 52, 1, 192, 22, 237, 95, 163, 77, 52, 1, 192, 107,
+ 237, 95, 163, 77, 52, 1, 195, 18, 52, 1, 196, 109, 52, 1, 55, 251, 49,
+ 52, 1, 130, 144, 250, 235, 52, 1, 130, 133, 250, 235, 52, 1, 130, 45,
+ 250, 235, 52, 1, 130, 50, 250, 235, 52, 1, 130, 206, 188, 52, 1, 82, 230,
+ 211, 252, 60, 52, 1, 82, 55, 230, 211, 252, 60, 52, 1, 82, 55, 252, 47,
+ 252, 60, 52, 1, 130, 198, 152, 52, 1, 207, 147, 242, 83, 52, 1, 248, 249,
+ 137, 198, 79, 52, 1, 234, 95, 137, 198, 79, 52, 1, 248, 249, 130, 198,
+ 79, 52, 1, 234, 95, 130, 198, 79, 52, 1, 203, 104, 52, 1, 211, 77, 203,
+ 104, 52, 1, 130, 45, 57, 33, 230, 211, 252, 60, 33, 252, 47, 252, 60, 33,
+ 243, 2, 252, 60, 33, 198, 152, 33, 217, 146, 33, 210, 254, 33, 248, 36,
+ 33, 75, 58, 33, 237, 42, 33, 228, 251, 58, 33, 206, 189, 58, 33, 55, 252,
+ 47, 252, 60, 33, 247, 92, 33, 81, 219, 113, 58, 33, 55, 81, 219, 113, 58,
+ 33, 55, 230, 211, 252, 60, 33, 247, 119, 33, 223, 93, 248, 36, 33, 153,
+ 242, 75, 58, 33, 242, 75, 58, 33, 207, 18, 242, 75, 58, 33, 242, 75, 93,
+ 183, 33, 230, 211, 252, 61, 60, 33, 252, 47, 252, 61, 60, 33, 45, 199,
+ 229, 60, 33, 50, 199, 229, 60, 33, 45, 251, 116, 58, 33, 228, 187, 33,
+ 45, 132, 206, 189, 60, 33, 133, 199, 229, 60, 33, 144, 199, 229, 60, 33,
+ 108, 3, 60, 33, 216, 35, 3, 60, 33, 210, 190, 228, 251, 60, 33, 207, 24,
+ 228, 251, 60, 33, 75, 60, 33, 237, 43, 60, 33, 206, 189, 60, 33, 242, 75,
+ 60, 33, 247, 35, 33, 211, 138, 33, 81, 219, 113, 60, 33, 248, 29, 60, 33,
+ 223, 93, 55, 251, 15, 60, 33, 247, 93, 60, 33, 243, 2, 252, 61, 60, 33,
+ 248, 37, 60, 33, 223, 93, 248, 37, 60, 33, 198, 153, 60, 33, 217, 147,
+ 60, 33, 130, 219, 112, 33, 55, 130, 219, 112, 33, 198, 153, 210, 255, 33,
+ 203, 40, 201, 28, 210, 255, 33, 179, 201, 28, 210, 255, 33, 203, 40, 202,
+ 24, 210, 255, 33, 179, 202, 24, 210, 255, 33, 50, 132, 206, 189, 60, 33,
+ 223, 93, 248, 29, 60, 33, 51, 60, 33, 205, 62, 60, 33, 192, 236, 58, 33,
+ 81, 198, 152, 33, 55, 210, 254, 33, 230, 211, 163, 77, 33, 252, 47, 163,
+ 77, 33, 35, 210, 4, 33, 35, 221, 30, 33, 35, 237, 36, 198, 60, 33, 35,
+ 191, 233, 33, 248, 29, 58, 33, 234, 43, 3, 60, 33, 55, 81, 219, 113, 60,
+ 33, 45, 251, 116, 60, 33, 213, 12, 198, 153, 58, 33, 229, 1, 58, 33, 251,
+ 165, 234, 45, 119, 58, 33, 45, 50, 64, 60, 33, 196, 66, 64, 60, 33, 230,
+ 217, 222, 196, 33, 50, 250, 236, 58, 33, 45, 132, 206, 189, 58, 33, 233,
+ 34, 33, 192, 236, 60, 33, 45, 250, 236, 60, 33, 50, 250, 236, 60, 33, 50,
+ 250, 236, 23, 133, 250, 236, 60, 33, 50, 132, 206, 189, 58, 33, 75, 93,
+ 183, 33, 250, 194, 60, 33, 55, 206, 189, 60, 33, 191, 21, 58, 33, 55,
+ 248, 37, 60, 33, 55, 248, 36, 33, 55, 217, 146, 33, 55, 217, 147, 60, 33,
+ 55, 198, 152, 33, 55, 223, 93, 248, 36, 33, 55, 96, 64, 60, 33, 8, 2, 1,
+ 65, 33, 8, 2, 1, 71, 33, 8, 2, 1, 68, 33, 8, 2, 1, 74, 33, 8, 2, 1, 66,
+ 33, 8, 2, 1, 247, 193, 33, 8, 2, 1, 238, 127, 33, 8, 2, 1, 230, 116, 33,
+ 8, 2, 1, 218, 168, 33, 8, 2, 1, 146, 33, 8, 2, 1, 200, 43, 33, 8, 2, 1,
+ 196, 12, 33, 8, 2, 1, 192, 235, 35, 6, 1, 229, 185, 35, 2, 1, 229, 185,
+ 35, 6, 1, 251, 14, 205, 145, 35, 2, 1, 251, 14, 205, 145, 35, 212, 134,
+ 56, 35, 110, 212, 134, 56, 35, 6, 1, 210, 171, 237, 10, 35, 2, 1, 210,
+ 171, 237, 10, 35, 191, 233, 35, 2, 207, 18, 218, 206, 202, 197, 113, 35,
+ 2, 235, 138, 218, 206, 202, 197, 113, 35, 2, 207, 18, 235, 138, 218, 206,
+ 202, 197, 113, 35, 208, 13, 77, 35, 6, 1, 191, 240, 35, 198, 60, 35, 237,
+ 36, 198, 60, 35, 6, 1, 251, 161, 4, 198, 60, 35, 251, 94, 199, 108, 35,
+ 6, 1, 234, 48, 4, 198, 60, 35, 6, 1, 233, 254, 4, 198, 60, 35, 6, 1, 223,
+ 84, 4, 198, 60, 35, 6, 1, 211, 108, 4, 198, 60, 35, 6, 1, 196, 71, 4,
+ 198, 60, 35, 6, 1, 211, 111, 4, 198, 60, 35, 2, 1, 223, 84, 4, 237, 36,
+ 23, 198, 60, 35, 6, 1, 251, 160, 35, 6, 1, 248, 212, 35, 6, 1, 231, 211,
+ 35, 6, 1, 237, 106, 35, 6, 1, 234, 47, 35, 6, 1, 191, 76, 35, 6, 1, 233,
+ 253, 35, 6, 1, 199, 15, 35, 6, 1, 223, 83, 35, 6, 1, 222, 72, 35, 6, 1,
+ 220, 31, 35, 6, 1, 215, 155, 35, 6, 1, 212, 178, 35, 6, 1, 192, 207, 35,
+ 6, 1, 211, 107, 35, 6, 1, 209, 185, 35, 6, 1, 207, 3, 35, 6, 1, 202, 196,
+ 35, 6, 1, 199, 166, 35, 6, 1, 196, 70, 35, 6, 1, 209, 211, 35, 6, 1, 243,
+ 95, 35, 6, 1, 208, 176, 35, 6, 1, 211, 110, 35, 6, 1, 223, 84, 4, 237,
+ 35, 35, 6, 1, 196, 71, 4, 237, 35, 35, 2, 1, 251, 161, 4, 198, 60, 35, 2,
+ 1, 234, 48, 4, 198, 60, 35, 2, 1, 233, 254, 4, 198, 60, 35, 2, 1, 223,
+ 84, 4, 198, 60, 35, 2, 1, 196, 71, 4, 237, 36, 23, 198, 60, 35, 2, 1,
+ 251, 160, 35, 2, 1, 248, 212, 35, 2, 1, 231, 211, 35, 2, 1, 237, 106, 35,
+ 2, 1, 234, 47, 35, 2, 1, 191, 76, 35, 2, 1, 233, 253, 35, 2, 1, 199, 15,
+ 35, 2, 1, 223, 83, 35, 2, 1, 222, 72, 35, 2, 1, 220, 31, 35, 2, 1, 215,
+ 155, 35, 2, 1, 212, 178, 35, 2, 1, 192, 207, 35, 2, 1, 211, 107, 35, 2,
+ 1, 209, 185, 35, 2, 1, 207, 3, 35, 2, 1, 53, 202, 196, 35, 2, 1, 202,
+ 196, 35, 2, 1, 199, 166, 35, 2, 1, 196, 70, 35, 2, 1, 209, 211, 35, 2, 1,
+ 243, 95, 35, 2, 1, 208, 176, 35, 2, 1, 211, 110, 35, 2, 1, 223, 84, 4,
+ 237, 35, 35, 2, 1, 196, 71, 4, 237, 35, 35, 2, 1, 211, 108, 4, 198, 60,
+ 35, 2, 1, 196, 71, 4, 198, 60, 35, 2, 1, 211, 111, 4, 198, 60, 35, 6,
+ 222, 103, 113, 35, 248, 213, 113, 35, 199, 16, 113, 35, 196, 71, 4, 228,
+ 251, 113, 35, 196, 71, 4, 252, 47, 23, 228, 251, 113, 35, 196, 71, 4,
+ 237, 43, 23, 228, 251, 113, 35, 209, 212, 113, 35, 209, 186, 113, 35,
+ 222, 103, 113, 35, 1, 251, 14, 221, 35, 35, 2, 1, 251, 14, 221, 35, 35,
+ 1, 201, 73, 35, 2, 1, 201, 73, 35, 1, 237, 10, 35, 2, 1, 237, 10, 35, 1,
+ 221, 35, 35, 2, 1, 221, 35, 35, 1, 205, 145, 35, 2, 1, 205, 145, 94, 6,
+ 1, 203, 105, 94, 2, 1, 203, 105, 94, 6, 1, 233, 44, 94, 2, 1, 233, 44,
+ 94, 6, 1, 221, 195, 94, 2, 1, 221, 195, 94, 6, 1, 228, 242, 94, 2, 1,
+ 228, 242, 94, 6, 1, 231, 206, 94, 2, 1, 231, 206, 94, 6, 1, 203, 71, 94,
+ 2, 1, 203, 71, 94, 6, 1, 237, 122, 94, 2, 1, 237, 122, 35, 222, 73, 113,
+ 35, 207, 4, 113, 35, 218, 206, 202, 197, 113, 35, 1, 191, 240, 35, 6,
+ 199, 16, 113, 35, 218, 206, 234, 48, 113, 35, 207, 18, 218, 206, 234, 48,
+ 113, 35, 6, 1, 203, 56, 35, 2, 1, 203, 56, 35, 6, 218, 206, 202, 197,
+ 113, 35, 6, 1, 205, 142, 35, 2, 1, 205, 142, 35, 207, 4, 4, 201, 28, 113,
+ 35, 6, 207, 18, 218, 206, 202, 197, 113, 35, 6, 235, 138, 218, 206, 202,
+ 197, 113, 35, 6, 207, 18, 235, 138, 218, 206, 202, 197, 113, 38, 6, 1,
+ 223, 227, 4, 230, 210, 38, 6, 1, 223, 88, 38, 6, 1, 236, 192, 38, 6, 1,
+ 231, 20, 38, 6, 1, 196, 125, 223, 226, 38, 6, 1, 235, 32, 38, 6, 1, 247,
+ 203, 68, 38, 6, 1, 192, 33, 38, 6, 1, 223, 10, 38, 6, 1, 219, 76, 38, 6,
+ 1, 213, 150, 38, 6, 1, 197, 155, 38, 6, 1, 221, 103, 38, 6, 1, 228, 74,
+ 4, 230, 210, 38, 6, 1, 203, 40, 66, 38, 6, 1, 235, 28, 38, 6, 1, 65, 38,
+ 6, 1, 249, 17, 38, 6, 1, 195, 153, 38, 6, 1, 231, 77, 38, 6, 1, 237, 146,
+ 38, 6, 1, 223, 226, 38, 6, 1, 191, 62, 38, 6, 1, 191, 87, 38, 6, 1, 68,
+ 38, 6, 1, 203, 40, 68, 38, 6, 1, 155, 38, 6, 1, 234, 140, 38, 6, 1, 234,
+ 114, 38, 6, 1, 234, 103, 38, 6, 1, 74, 38, 6, 1, 210, 63, 38, 6, 1, 234,
+ 34, 38, 6, 1, 234, 22, 38, 6, 1, 199, 145, 38, 6, 1, 66, 38, 6, 1, 234,
+ 181, 38, 6, 1, 140, 38, 6, 1, 197, 161, 38, 6, 1, 243, 127, 38, 6, 1,
+ 203, 165, 38, 6, 1, 203, 116, 38, 6, 1, 230, 17, 56, 38, 6, 1, 192, 58,
+ 38, 6, 1, 202, 32, 56, 38, 6, 1, 71, 38, 6, 1, 191, 225, 38, 6, 1, 170,
+ 38, 2, 1, 65, 38, 2, 1, 249, 17, 38, 2, 1, 195, 153, 38, 2, 1, 231, 77,
+ 38, 2, 1, 237, 146, 38, 2, 1, 223, 226, 38, 2, 1, 191, 62, 38, 2, 1, 191,
+ 87, 38, 2, 1, 68, 38, 2, 1, 203, 40, 68, 38, 2, 1, 155, 38, 2, 1, 234,
+ 140, 38, 2, 1, 234, 114, 38, 2, 1, 234, 103, 38, 2, 1, 74, 38, 2, 1, 210,
+ 63, 38, 2, 1, 234, 34, 38, 2, 1, 234, 22, 38, 2, 1, 199, 145, 38, 2, 1,
+ 66, 38, 2, 1, 234, 181, 38, 2, 1, 140, 38, 2, 1, 197, 161, 38, 2, 1, 243,
+ 127, 38, 2, 1, 203, 165, 38, 2, 1, 203, 116, 38, 2, 1, 230, 17, 56, 38,
+ 2, 1, 192, 58, 38, 2, 1, 202, 32, 56, 38, 2, 1, 71, 38, 2, 1, 191, 225,
+ 38, 2, 1, 170, 38, 2, 1, 223, 227, 4, 230, 210, 38, 2, 1, 223, 88, 38, 2,
+ 1, 236, 192, 38, 2, 1, 231, 20, 38, 2, 1, 196, 125, 223, 226, 38, 2, 1,
+ 235, 32, 38, 2, 1, 247, 203, 68, 38, 2, 1, 192, 33, 38, 2, 1, 223, 10,
+ 38, 2, 1, 219, 76, 38, 2, 1, 213, 150, 38, 2, 1, 197, 155, 38, 2, 1, 221,
+ 103, 38, 2, 1, 228, 74, 4, 230, 210, 38, 2, 1, 203, 40, 66, 38, 2, 1,
+ 235, 28, 38, 6, 1, 211, 110, 38, 2, 1, 211, 110, 38, 6, 1, 192, 95, 38,
+ 2, 1, 192, 95, 38, 6, 1, 223, 81, 71, 38, 2, 1, 223, 81, 71, 38, 6, 1,
+ 219, 83, 191, 190, 38, 2, 1, 219, 83, 191, 190, 38, 6, 1, 223, 81, 219,
+ 83, 191, 190, 38, 2, 1, 223, 81, 219, 83, 191, 190, 38, 6, 1, 248, 175,
+ 191, 190, 38, 2, 1, 248, 175, 191, 190, 38, 6, 1, 223, 81, 248, 175, 191,
+ 190, 38, 2, 1, 223, 81, 248, 175, 191, 190, 38, 6, 1, 220, 248, 38, 2, 1,
+ 220, 248, 38, 6, 1, 208, 176, 38, 2, 1, 208, 176, 38, 6, 1, 232, 228, 38,
+ 2, 1, 232, 228, 38, 6, 1, 223, 37, 38, 2, 1, 223, 37, 38, 6, 1, 223, 38,
+ 4, 55, 230, 211, 252, 60, 38, 2, 1, 223, 38, 4, 55, 230, 211, 252, 60,
+ 38, 6, 1, 196, 128, 38, 2, 1, 196, 128, 38, 6, 1, 206, 115, 211, 110, 38,
+ 2, 1, 206, 115, 211, 110, 38, 6, 1, 211, 111, 4, 198, 122, 38, 2, 1, 211,
+ 111, 4, 198, 122, 38, 6, 1, 211, 30, 38, 2, 1, 211, 30, 38, 6, 1, 221,
+ 35, 38, 2, 1, 221, 35, 38, 198, 229, 56, 33, 38, 198, 122, 33, 38, 210,
+ 191, 33, 38, 237, 213, 209, 75, 33, 38, 208, 170, 209, 75, 33, 38, 209,
+ 54, 33, 38, 228, 141, 198, 229, 56, 33, 38, 216, 48, 56, 38, 6, 1, 203,
+ 40, 228, 74, 4, 199, 215, 38, 2, 1, 203, 40, 228, 74, 4, 199, 215, 38, 6,
+ 1, 204, 21, 56, 38, 2, 1, 204, 21, 56, 38, 6, 1, 234, 35, 4, 198, 182,
+ 38, 2, 1, 234, 35, 4, 198, 182, 38, 6, 1, 231, 78, 4, 196, 69, 38, 2, 1,
+ 231, 78, 4, 196, 69, 38, 6, 1, 231, 78, 4, 106, 38, 2, 1, 231, 78, 4,
+ 106, 38, 6, 1, 231, 78, 4, 82, 102, 38, 2, 1, 231, 78, 4, 82, 102, 38, 6,
+ 1, 191, 63, 4, 237, 87, 38, 2, 1, 191, 63, 4, 237, 87, 38, 6, 1, 191, 88,
+ 4, 237, 87, 38, 2, 1, 191, 88, 4, 237, 87, 38, 6, 1, 222, 142, 4, 237,
+ 87, 38, 2, 1, 222, 142, 4, 237, 87, 38, 6, 1, 222, 142, 4, 81, 106, 38,
+ 2, 1, 222, 142, 4, 81, 106, 38, 6, 1, 222, 142, 4, 106, 38, 2, 1, 222,
+ 142, 4, 106, 38, 6, 1, 249, 70, 155, 38, 2, 1, 249, 70, 155, 38, 6, 1,
+ 234, 104, 4, 237, 87, 38, 2, 1, 234, 104, 4, 237, 87, 38, 6, 34, 234,
+ 104, 231, 77, 38, 2, 34, 234, 104, 231, 77, 38, 6, 1, 210, 64, 4, 82,
+ 102, 38, 2, 1, 210, 64, 4, 82, 102, 38, 6, 1, 252, 67, 140, 38, 2, 1,
+ 252, 67, 140, 38, 6, 1, 234, 23, 4, 237, 87, 38, 2, 1, 234, 23, 4, 237,
+ 87, 38, 6, 1, 199, 146, 4, 237, 87, 38, 2, 1, 199, 146, 4, 237, 87, 38,
+ 6, 1, 201, 53, 66, 38, 2, 1, 201, 53, 66, 38, 6, 1, 201, 53, 126, 4, 106,
+ 38, 2, 1, 201, 53, 126, 4, 106, 38, 6, 1, 230, 105, 4, 237, 87, 38, 2, 1,
+ 230, 105, 4, 237, 87, 38, 6, 34, 199, 146, 197, 161, 38, 2, 34, 199, 146,
+ 197, 161, 38, 6, 1, 243, 128, 4, 237, 87, 38, 2, 1, 243, 128, 4, 237, 87,
+ 38, 6, 1, 243, 128, 4, 81, 106, 38, 2, 1, 243, 128, 4, 81, 106, 38, 6, 1,
+ 203, 82, 38, 2, 1, 203, 82, 38, 6, 1, 252, 67, 243, 127, 38, 2, 1, 252,
+ 67, 243, 127, 38, 6, 1, 252, 67, 243, 128, 4, 237, 87, 38, 2, 1, 252, 67,
+ 243, 128, 4, 237, 87, 38, 1, 210, 179, 38, 6, 1, 191, 63, 4, 248, 36, 38,
+ 2, 1, 191, 63, 4, 248, 36, 38, 6, 1, 222, 142, 4, 102, 38, 2, 1, 222,
+ 142, 4, 102, 38, 6, 1, 234, 141, 4, 199, 215, 38, 2, 1, 234, 141, 4, 199,
+ 215, 38, 6, 1, 234, 104, 4, 102, 38, 2, 1, 234, 104, 4, 102, 38, 6, 1,
+ 234, 104, 4, 199, 215, 38, 2, 1, 234, 104, 4, 199, 215, 38, 6, 1, 221,
+ 208, 243, 127, 38, 2, 1, 221, 208, 243, 127, 38, 6, 1, 234, 115, 4, 199,
+ 215, 38, 2, 1, 234, 115, 4, 199, 215, 38, 2, 1, 210, 179, 38, 6, 1, 42,
+ 4, 248, 36, 38, 2, 1, 42, 4, 248, 36, 38, 6, 1, 42, 4, 237, 42, 38, 2, 1,
+ 42, 4, 237, 42, 38, 6, 34, 42, 223, 226, 38, 2, 34, 42, 223, 226, 38, 6,
+ 1, 223, 227, 4, 248, 36, 38, 2, 1, 223, 227, 4, 248, 36, 38, 6, 1, 205,
+ 86, 38, 2, 1, 205, 86, 38, 6, 1, 205, 87, 4, 237, 42, 38, 2, 1, 205, 87,
+ 4, 237, 42, 38, 6, 1, 191, 63, 4, 237, 42, 38, 2, 1, 191, 63, 4, 237, 42,
+ 38, 6, 1, 191, 88, 4, 237, 42, 38, 2, 1, 191, 88, 4, 237, 42, 38, 6, 1,
+ 252, 67, 235, 32, 38, 2, 1, 252, 67, 235, 32, 38, 6, 1, 228, 74, 4, 217,
+ 146, 38, 2, 1, 228, 74, 4, 217, 146, 38, 6, 1, 228, 74, 4, 237, 42, 38,
+ 2, 1, 228, 74, 4, 237, 42, 38, 6, 1, 187, 4, 237, 42, 38, 2, 1, 187, 4,
+ 237, 42, 38, 6, 1, 249, 82, 74, 38, 2, 1, 249, 82, 74, 38, 6, 1, 249, 82,
+ 187, 4, 237, 42, 38, 2, 1, 249, 82, 187, 4, 237, 42, 38, 6, 1, 235, 15,
+ 4, 237, 42, 38, 2, 1, 235, 15, 4, 237, 42, 38, 6, 1, 126, 4, 217, 146,
+ 38, 2, 1, 126, 4, 217, 146, 38, 6, 1, 126, 4, 237, 42, 38, 2, 1, 126, 4,
+ 237, 42, 38, 6, 1, 126, 4, 55, 252, 46, 38, 2, 1, 126, 4, 55, 252, 46,
+ 38, 6, 1, 243, 128, 4, 237, 42, 38, 2, 1, 243, 128, 4, 237, 42, 38, 6, 1,
+ 231, 78, 4, 237, 87, 38, 2, 1, 231, 78, 4, 237, 87, 38, 6, 1, 192, 59, 4,
+ 237, 42, 38, 2, 1, 192, 59, 4, 237, 42, 38, 6, 1, 231, 78, 4, 201, 28,
+ 23, 102, 38, 2, 1, 231, 78, 4, 201, 28, 23, 102, 38, 6, 1, 230, 105, 4,
+ 102, 38, 2, 1, 230, 105, 4, 102, 38, 6, 1, 230, 105, 4, 106, 38, 2, 1,
+ 230, 105, 4, 106, 38, 6, 1, 221, 45, 237, 146, 38, 2, 1, 221, 45, 237,
+ 146, 38, 6, 1, 221, 45, 236, 192, 38, 2, 1, 221, 45, 236, 192, 38, 6, 1,
+ 221, 45, 191, 12, 38, 2, 1, 221, 45, 191, 12, 38, 6, 1, 221, 45, 235, 24,
+ 38, 2, 1, 221, 45, 235, 24, 38, 6, 1, 221, 45, 219, 76, 38, 2, 1, 221,
+ 45, 219, 76, 38, 6, 1, 221, 45, 213, 150, 38, 2, 1, 221, 45, 213, 150,
+ 38, 6, 1, 221, 45, 202, 115, 38, 2, 1, 221, 45, 202, 115, 38, 6, 1, 221,
+ 45, 198, 116, 38, 2, 1, 221, 45, 198, 116, 38, 6, 1, 207, 18, 191, 87,
+ 38, 2, 1, 207, 18, 191, 87, 38, 6, 1, 234, 141, 4, 102, 38, 2, 1, 234,
+ 141, 4, 102, 38, 6, 1, 219, 159, 38, 2, 1, 219, 159, 38, 6, 1, 207, 6,
+ 38, 2, 1, 207, 6, 38, 6, 1, 192, 129, 38, 2, 1, 192, 129, 38, 6, 1, 208,
+ 96, 38, 2, 1, 208, 96, 38, 6, 1, 193, 125, 38, 2, 1, 193, 125, 38, 6, 1,
+ 251, 188, 155, 38, 2, 1, 251, 188, 155, 38, 6, 1, 234, 141, 4, 82, 102,
+ 38, 2, 1, 234, 141, 4, 82, 102, 38, 6, 1, 234, 104, 4, 82, 102, 38, 2, 1,
+ 234, 104, 4, 82, 102, 38, 6, 1, 210, 64, 4, 237, 87, 38, 2, 1, 210, 64,
+ 4, 237, 87, 38, 6, 1, 203, 83, 4, 237, 87, 38, 2, 1, 203, 83, 4, 237, 87,
+ 38, 6, 1, 234, 104, 4, 45, 102, 38, 2, 1, 234, 104, 4, 45, 102, 38, 6, 1,
+ 235, 16, 38, 2, 1, 235, 16, 38, 6, 1, 237, 195, 38, 2, 1, 237, 195, 38,
+ 6, 1, 234, 141, 4, 237, 87, 38, 2, 1, 234, 141, 4, 237, 87, 250, 249, 6,
+ 1, 250, 128, 250, 249, 6, 1, 248, 229, 250, 249, 6, 1, 231, 40, 250, 249,
+ 6, 1, 238, 32, 250, 249, 6, 1, 234, 195, 250, 249, 6, 1, 191, 123, 250,
+ 249, 6, 1, 234, 173, 250, 249, 6, 1, 233, 255, 250, 249, 6, 1, 159, 250,
+ 249, 6, 1, 191, 62, 250, 249, 6, 1, 223, 131, 250, 249, 6, 1, 219, 80,
+ 250, 249, 6, 1, 192, 212, 250, 249, 6, 1, 247, 160, 250, 249, 6, 1, 221,
+ 251, 250, 249, 6, 1, 229, 23, 250, 249, 6, 1, 223, 32, 250, 249, 6, 1,
+ 231, 88, 250, 249, 6, 1, 243, 117, 250, 249, 6, 1, 216, 186, 250, 249, 6,
+ 1, 192, 33, 250, 249, 6, 1, 212, 253, 250, 249, 6, 1, 203, 165, 250, 249,
+ 6, 1, 195, 24, 250, 249, 6, 1, 247, 1, 250, 249, 6, 1, 210, 41, 250, 249,
+ 6, 1, 222, 247, 250, 249, 6, 1, 165, 250, 249, 6, 1, 205, 39, 250, 249,
+ 6, 1, 195, 74, 250, 249, 6, 1, 198, 119, 250, 249, 6, 1, 207, 71, 250,
+ 249, 6, 1, 242, 99, 250, 249, 6, 1, 192, 17, 250, 249, 6, 1, 209, 114,
+ 250, 249, 6, 1, 222, 6, 250, 249, 6, 1, 211, 136, 250, 249, 6, 1, 233,
+ 46, 250, 249, 52, 1, 45, 132, 206, 188, 250, 249, 251, 49, 250, 249, 234,
+ 107, 77, 250, 249, 233, 216, 77, 250, 249, 242, 74, 250, 249, 208, 13,
+ 77, 250, 249, 252, 68, 77, 250, 249, 2, 1, 153, 250, 128, 250, 249, 2, 1,
+ 250, 128, 250, 249, 2, 1, 248, 229, 250, 249, 2, 1, 231, 40, 250, 249, 2,
+ 1, 238, 32, 250, 249, 2, 1, 234, 195, 250, 249, 2, 1, 191, 123, 250, 249,
+ 2, 1, 234, 173, 250, 249, 2, 1, 233, 255, 250, 249, 2, 1, 159, 250, 249,
+ 2, 1, 191, 62, 250, 249, 2, 1, 223, 131, 250, 249, 2, 1, 219, 80, 250,
+ 249, 2, 1, 192, 212, 250, 249, 2, 1, 247, 160, 250, 249, 2, 1, 221, 251,
+ 250, 249, 2, 1, 229, 23, 250, 249, 2, 1, 223, 32, 250, 249, 2, 1, 231,
+ 88, 250, 249, 2, 1, 243, 117, 250, 249, 2, 1, 216, 186, 250, 249, 2, 1,
+ 192, 33, 250, 249, 2, 1, 212, 253, 250, 249, 2, 1, 203, 165, 250, 249, 2,
+ 1, 195, 24, 250, 249, 2, 1, 247, 1, 250, 249, 2, 1, 210, 41, 250, 249, 2,
+ 1, 222, 247, 250, 249, 2, 1, 165, 250, 249, 2, 1, 205, 39, 250, 249, 2,
+ 1, 195, 74, 250, 249, 2, 1, 198, 119, 250, 249, 2, 1, 207, 71, 250, 249,
+ 2, 1, 242, 99, 250, 249, 2, 1, 192, 17, 250, 249, 2, 1, 209, 114, 250,
+ 249, 2, 1, 222, 6, 250, 249, 2, 1, 211, 136, 250, 249, 2, 1, 233, 46,
+ 250, 249, 2, 34, 234, 196, 192, 17, 250, 249, 2, 1, 11, 4, 106, 250, 249,
+ 232, 80, 201, 63, 250, 249, 228, 88, 206, 207, 250, 249, 233, 251, 56,
+ 219, 223, 250, 249, 233, 251, 56, 250, 249, 235, 110, 56, 136, 252, 61,
+ 233, 246, 136, 252, 61, 205, 40, 136, 252, 61, 203, 141, 136, 252, 61,
+ 191, 99, 208, 78, 136, 252, 61, 191, 99, 231, 230, 136, 252, 61, 198,
+ 134, 136, 252, 61, 207, 15, 136, 252, 61, 191, 97, 136, 252, 61, 210, 97,
+ 136, 252, 61, 192, 48, 136, 252, 61, 199, 56, 136, 252, 61, 231, 139,
+ 136, 252, 61, 231, 140, 215, 110, 136, 252, 61, 231, 137, 136, 252, 61,
+ 208, 80, 210, 130, 136, 252, 61, 199, 103, 231, 158, 136, 252, 61, 210,
+ 69, 136, 252, 61, 250, 173, 230, 85, 136, 252, 61, 215, 121, 136, 252,
+ 61, 217, 117, 136, 252, 61, 216, 175, 136, 252, 61, 216, 176, 222, 7,
+ 136, 252, 61, 237, 222, 136, 252, 61, 208, 91, 136, 252, 61, 199, 103,
+ 208, 73, 136, 252, 61, 192, 61, 248, 230, 191, 247, 136, 252, 61, 211,
+ 117, 136, 252, 61, 223, 183, 136, 252, 61, 237, 123, 136, 252, 61, 191,
+ 19, 136, 87, 217, 34, 243, 10, 136, 209, 62, 203, 85, 136, 209, 62, 230,
+ 8, 205, 40, 136, 209, 62, 230, 8, 210, 88, 136, 209, 62, 230, 8, 208, 84,
+ 136, 209, 62, 229, 119, 136, 209, 62, 197, 158, 136, 209, 62, 205, 40,
+ 136, 209, 62, 210, 88, 136, 209, 62, 208, 84, 136, 209, 62, 229, 7, 136,
+ 209, 62, 229, 8, 230, 10, 40, 195, 158, 136, 209, 62, 208, 18, 136, 209,
+ 62, 238, 17, 211, 57, 217, 70, 136, 209, 62, 216, 164, 136, 208, 152,
+ 217, 67, 136, 209, 62, 207, 161, 136, 208, 152, 210, 99, 136, 209, 62,
+ 203, 70, 236, 140, 136, 209, 62, 202, 175, 236, 140, 136, 208, 152, 202,
+ 33, 210, 90, 136, 87, 116, 236, 140, 136, 87, 110, 236, 140, 136, 208,
+ 152, 212, 131, 230, 84, 136, 209, 62, 208, 85, 208, 78, 136, 1, 251, 192,
+ 136, 1, 248, 214, 136, 1, 231, 38, 136, 1, 237, 253, 136, 1, 229, 245,
+ 136, 1, 195, 158, 136, 1, 191, 91, 136, 1, 229, 186, 136, 1, 199, 73,
+ 136, 1, 191, 250, 136, 1, 53, 222, 106, 136, 1, 222, 106, 136, 1, 220,
+ 27, 136, 1, 53, 216, 193, 136, 1, 216, 193, 136, 1, 53, 212, 130, 136, 1,
+ 212, 130, 136, 1, 205, 148, 136, 1, 250, 126, 136, 1, 53, 210, 63, 136,
+ 1, 210, 63, 136, 1, 53, 197, 163, 136, 1, 197, 163, 136, 1, 208, 42, 136,
+ 1, 207, 38, 136, 1, 203, 69, 136, 1, 199, 162, 136, 191, 251, 197, 241,
+ 136, 34, 192, 31, 55, 195, 158, 136, 34, 192, 31, 195, 159, 191, 250,
+ 136, 34, 192, 31, 55, 191, 250, 136, 208, 152, 231, 139, 136, 208, 152,
+ 231, 137, 9, 31, 56, 9, 3, 205, 141, 9, 232, 157, 217, 51, 9, 3, 205,
+ 187, 9, 3, 205, 144, 9, 31, 87, 58, 251, 28, 238, 191, 206, 128, 251, 28,
+ 232, 121, 206, 128, 9, 207, 122, 251, 28, 210, 14, 216, 50, 56, 251, 28,
+ 210, 14, 199, 96, 198, 230, 56, 252, 2, 56, 9, 242, 74, 9, 237, 209, 204,
+ 10, 9, 209, 64, 195, 137, 56, 9, 3, 216, 25, 9, 3, 205, 161, 251, 199,
+ 193, 149, 9, 3, 251, 199, 250, 198, 9, 3, 207, 157, 251, 198, 9, 3, 207,
+ 167, 251, 170, 251, 105, 9, 3, 199, 206, 9, 2, 137, 199, 219, 9, 2, 137,
+ 34, 131, 4, 220, 36, 4, 192, 75, 9, 2, 137, 191, 113, 9, 2, 233, 70, 9,
+ 2, 237, 245, 9, 2, 222, 52, 9, 204, 25, 9, 1, 77, 9, 234, 95, 79, 199,
+ 54, 77, 9, 197, 225, 75, 208, 152, 77, 9, 208, 13, 77, 9, 1, 222, 56,
+ 192, 75, 9, 1, 230, 57, 9, 1, 131, 4, 217, 142, 58, 9, 1, 131, 4, 230,
+ 58, 58, 9, 1, 193, 134, 4, 230, 58, 58, 9, 1, 131, 4, 230, 58, 60, 9, 1,
+ 99, 4, 230, 58, 58, 9, 1, 251, 192, 9, 1, 248, 245, 9, 1, 199, 115, 217,
+ 62, 9, 1, 199, 114, 9, 1, 199, 29, 9, 1, 223, 6, 9, 1, 230, 81, 9, 1,
+ 221, 210, 9, 1, 238, 3, 9, 1, 199, 41, 9, 1, 207, 71, 9, 1, 191, 113, 9,
+ 1, 205, 46, 9, 1, 203, 109, 9, 1, 205, 192, 9, 1, 238, 26, 9, 1, 199,
+ 219, 9, 1, 191, 116, 9, 1, 251, 230, 9, 1, 231, 86, 9, 1, 222, 5, 4, 105,
+ 185, 58, 9, 1, 222, 5, 4, 115, 185, 60, 9, 1, 233, 74, 99, 4, 223, 93,
+ 196, 12, 9, 1, 233, 74, 99, 4, 105, 185, 58, 9, 1, 233, 74, 99, 4, 115,
+ 185, 58, 9, 199, 168, 9, 1, 233, 46, 9, 1, 208, 89, 9, 1, 222, 106, 9, 1,
+ 220, 35, 9, 1, 216, 208, 9, 1, 213, 24, 9, 1, 229, 210, 9, 1, 193, 133,
+ 9, 1, 131, 217, 99, 9, 1, 192, 75, 9, 233, 68, 9, 237, 243, 9, 222, 50,
+ 9, 233, 70, 9, 237, 245, 9, 222, 52, 9, 203, 155, 9, 200, 206, 9, 217,
+ 140, 58, 9, 230, 58, 58, 9, 230, 58, 60, 9, 200, 230, 251, 192, 9, 223,
+ 93, 237, 245, 9, 87, 213, 25, 231, 57, 9, 190, 237, 9, 18, 3, 2, 196, 13,
+ 58, 9, 18, 3, 223, 93, 2, 196, 13, 58, 9, 18, 3, 75, 60, 9, 207, 18, 237,
+ 245, 9, 233, 71, 4, 105, 236, 138, 9, 193, 135, 230, 58, 60, 251, 28, 17,
+ 191, 77, 251, 28, 17, 107, 251, 28, 17, 109, 251, 28, 17, 138, 251, 28,
+ 17, 134, 251, 28, 17, 149, 251, 28, 17, 169, 251, 28, 17, 175, 251, 28,
+ 17, 171, 251, 28, 17, 178, 9, 210, 13, 56, 9, 237, 138, 204, 10, 9, 198,
+ 229, 204, 10, 9, 232, 226, 209, 60, 201, 102, 9, 1, 236, 139, 248, 245,
+ 9, 1, 236, 139, 208, 89, 9, 1, 200, 182, 251, 192, 9, 1, 131, 193, 150,
+ 9, 1, 131, 4, 193, 135, 230, 58, 58, 9, 1, 131, 4, 193, 135, 230, 58, 60,
+ 9, 1, 137, 230, 57, 9, 1, 137, 230, 58, 251, 192, 9, 1, 137, 230, 58,
+ 193, 133, 9, 1, 126, 4, 230, 58, 58, 9, 1, 137, 230, 58, 192, 75, 9, 1,
+ 197, 124, 9, 1, 197, 122, 9, 1, 248, 255, 9, 1, 199, 115, 4, 206, 188, 9,
+ 1, 199, 115, 4, 115, 185, 93, 235, 118, 9, 1, 210, 41, 9, 1, 199, 112, 9,
+ 1, 248, 243, 9, 1, 182, 4, 230, 58, 58, 9, 1, 182, 4, 105, 185, 81, 58,
+ 9, 1, 212, 87, 9, 1, 235, 41, 9, 1, 182, 4, 115, 185, 58, 9, 1, 199, 149,
+ 9, 1, 199, 147, 9, 1, 237, 186, 9, 1, 238, 4, 4, 206, 188, 9, 1, 238, 4,
+ 4, 75, 60, 9, 1, 238, 4, 4, 75, 248, 233, 23, 2, 199, 219, 9, 1, 238, 10,
+ 9, 1, 237, 188, 9, 1, 235, 78, 9, 1, 238, 4, 4, 115, 185, 93, 235, 118,
+ 9, 1, 238, 4, 4, 232, 128, 185, 58, 9, 1, 206, 101, 9, 1, 207, 72, 4, 2,
+ 196, 12, 9, 1, 207, 72, 4, 206, 188, 9, 1, 207, 72, 4, 75, 60, 9, 1, 207,
+ 72, 4, 2, 196, 13, 60, 9, 1, 207, 72, 4, 75, 248, 233, 23, 75, 58, 9, 1,
+ 207, 72, 4, 105, 185, 58, 9, 1, 223, 3, 9, 1, 207, 72, 4, 232, 128, 185,
+ 58, 9, 1, 205, 47, 4, 75, 248, 233, 23, 75, 58, 9, 1, 205, 47, 4, 115,
+ 185, 60, 9, 1, 205, 47, 4, 115, 185, 248, 233, 23, 115, 185, 58, 9, 1,
+ 205, 193, 4, 105, 185, 60, 9, 1, 205, 193, 4, 115, 185, 58, 9, 1, 199,
+ 220, 4, 115, 185, 58, 9, 1, 251, 231, 4, 115, 185, 58, 9, 1, 236, 139,
+ 233, 46, 9, 1, 233, 47, 4, 75, 215, 177, 60, 9, 1, 233, 47, 4, 75, 60, 9,
+ 1, 195, 146, 9, 1, 233, 47, 4, 115, 185, 60, 9, 1, 210, 39, 9, 1, 208,
+ 90, 4, 75, 58, 9, 1, 208, 90, 4, 115, 185, 58, 9, 1, 222, 4, 9, 1, 200,
+ 146, 222, 106, 9, 1, 222, 107, 4, 206, 188, 9, 1, 222, 107, 4, 75, 58, 9,
+ 1, 214, 70, 9, 1, 222, 107, 4, 115, 185, 60, 9, 1, 231, 227, 9, 1, 231,
+ 228, 4, 206, 188, 9, 1, 213, 247, 9, 1, 231, 228, 4, 105, 185, 60, 9, 1,
+ 230, 166, 9, 1, 231, 228, 4, 115, 185, 58, 9, 1, 220, 36, 4, 2, 196, 12,
+ 9, 1, 220, 36, 4, 75, 58, 9, 1, 220, 36, 4, 115, 185, 58, 9, 1, 220, 36,
+ 4, 115, 185, 60, 9, 1, 213, 25, 4, 75, 60, 9, 1, 213, 25, 231, 57, 9, 1,
+ 206, 165, 9, 1, 213, 25, 4, 206, 188, 9, 1, 213, 25, 4, 115, 185, 58, 9,
+ 1, 229, 211, 236, 170, 9, 1, 199, 150, 4, 75, 58, 9, 1, 229, 211, 4, 99,
+ 58, 9, 1, 229, 211, 231, 0, 9, 1, 229, 211, 231, 1, 4, 230, 58, 58, 9, 1,
+ 199, 115, 217, 63, 231, 0, 9, 1, 193, 134, 4, 206, 188, 9, 1, 221, 132,
+ 211, 151, 9, 1, 211, 151, 9, 1, 66, 9, 1, 191, 225, 9, 1, 221, 132, 191,
+ 225, 9, 1, 193, 134, 4, 105, 185, 58, 9, 1, 195, 153, 9, 1, 233, 74, 192,
+ 75, 9, 1, 99, 4, 199, 215, 9, 1, 99, 4, 2, 196, 12, 9, 1, 193, 134, 4,
+ 75, 58, 9, 1, 71, 9, 1, 99, 4, 115, 185, 60, 9, 1, 99, 249, 80, 9, 1, 99,
+ 249, 81, 4, 230, 58, 58, 9, 232, 80, 201, 63, 9, 1, 252, 25, 9, 2, 137,
+ 34, 205, 193, 4, 220, 36, 4, 131, 217, 99, 9, 2, 137, 34, 208, 90, 4,
+ 220, 36, 4, 131, 217, 99, 9, 2, 137, 92, 89, 20, 9, 2, 137, 220, 36, 251,
+ 192, 9, 2, 137, 223, 6, 9, 2, 137, 115, 236, 138, 9, 2, 137, 205, 46, 9,
+ 234, 95, 79, 250, 130, 9, 201, 98, 79, 206, 60, 234, 141, 229, 114, 9, 2,
+ 137, 206, 113, 191, 77, 9, 2, 137, 196, 73, 207, 91, 191, 77, 9, 2, 137,
+ 236, 139, 229, 236, 79, 221, 210, 9, 2, 137, 92, 76, 20, 9, 2, 130, 205,
+ 46, 9, 2, 137, 217, 141, 9, 2, 193, 133, 9, 2, 192, 75, 9, 2, 137, 192,
+ 75, 9, 2, 137, 213, 24, 9, 209, 108, 79, 205, 177, 9, 234, 105, 247, 22,
+ 130, 201, 63, 9, 234, 105, 247, 22, 137, 201, 63, 9, 206, 113, 137, 201,
+ 64, 4, 233, 4, 247, 21, 9, 2, 130, 216, 208, 9, 1, 238, 4, 4, 223, 93,
+ 196, 12, 9, 1, 207, 72, 4, 223, 93, 196, 12, 233, 205, 251, 28, 17, 191,
+ 77, 233, 205, 251, 28, 17, 107, 233, 205, 251, 28, 17, 109, 233, 205,
+ 251, 28, 17, 138, 233, 205, 251, 28, 17, 134, 233, 205, 251, 28, 17, 149,
+ 233, 205, 251, 28, 17, 169, 233, 205, 251, 28, 17, 175, 233, 205, 251,
+ 28, 17, 171, 233, 205, 251, 28, 17, 178, 9, 1, 203, 110, 4, 75, 60, 9, 1,
+ 238, 27, 4, 75, 60, 9, 1, 231, 87, 4, 75, 60, 9, 3, 202, 173, 251, 137,
+ 9, 3, 202, 173, 209, 16, 216, 186, 9, 1, 229, 211, 4, 223, 93, 196, 12,
+ 200, 63, 234, 95, 79, 210, 127, 200, 63, 200, 177, 232, 80, 201, 63, 200,
+ 63, 200, 232, 232, 80, 201, 63, 200, 63, 200, 177, 242, 83, 200, 63, 200,
+ 232, 242, 83, 200, 63, 228, 241, 242, 83, 200, 63, 242, 84, 202, 110,
+ 219, 224, 200, 63, 242, 84, 202, 110, 183, 200, 63, 200, 177, 242, 84,
+ 202, 110, 219, 224, 200, 63, 200, 232, 242, 84, 202, 110, 183, 200, 63,
+ 239, 24, 200, 63, 230, 15, 211, 176, 200, 63, 230, 15, 216, 162, 200, 63,
+ 230, 15, 250, 195, 200, 63, 252, 68, 77, 200, 63, 1, 251, 202, 200, 63,
+ 1, 200, 182, 251, 202, 200, 63, 1, 248, 211, 200, 63, 1, 231, 217, 200,
+ 63, 1, 231, 218, 231, 194, 200, 63, 1, 238, 0, 200, 63, 1, 236, 139, 238,
+ 1, 206, 181, 200, 63, 1, 229, 245, 200, 63, 1, 193, 133, 200, 63, 1, 191,
+ 113, 200, 63, 1, 229, 184, 200, 63, 1, 199, 69, 200, 63, 1, 199, 70, 231,
+ 194, 200, 63, 1, 191, 208, 200, 63, 1, 191, 209, 229, 245, 200, 63, 1,
+ 222, 75, 200, 63, 1, 220, 34, 200, 63, 1, 216, 46, 200, 63, 1, 212, 130,
+ 200, 63, 1, 204, 18, 200, 63, 1, 53, 204, 18, 200, 63, 1, 71, 200, 63, 1,
+ 210, 63, 200, 63, 1, 207, 18, 210, 63, 200, 63, 1, 205, 189, 200, 63, 1,
+ 208, 83, 200, 63, 1, 206, 181, 200, 63, 1, 203, 69, 200, 63, 1, 199, 159,
+ 200, 63, 1, 209, 252, 248, 194, 200, 63, 1, 209, 252, 231, 84, 200, 63,
+ 1, 209, 252, 237, 63, 200, 63, 208, 166, 58, 200, 63, 208, 166, 60, 200,
+ 63, 208, 166, 235, 137, 200, 63, 191, 0, 58, 200, 63, 191, 0, 60, 200,
+ 63, 191, 0, 235, 137, 200, 63, 207, 116, 58, 200, 63, 207, 116, 60, 200,
+ 63, 235, 138, 191, 9, 228, 240, 200, 63, 235, 138, 191, 9, 251, 108, 200,
+ 63, 229, 250, 58, 200, 63, 229, 250, 60, 200, 63, 229, 249, 235, 137,
+ 200, 63, 234, 16, 58, 200, 63, 234, 16, 60, 200, 63, 206, 24, 200, 63,
+ 233, 40, 236, 140, 200, 63, 207, 246, 200, 63, 206, 54, 200, 63, 105, 81,
+ 185, 58, 200, 63, 105, 81, 185, 60, 200, 63, 115, 185, 58, 200, 63, 115,
+ 185, 60, 200, 63, 211, 172, 219, 113, 58, 200, 63, 211, 172, 219, 113,
+ 60, 200, 63, 215, 96, 200, 63, 249, 79, 200, 63, 1, 202, 28, 191, 69,
+ 200, 63, 1, 202, 28, 221, 201, 200, 63, 1, 202, 28, 233, 59, 9, 1, 248,
+ 246, 4, 115, 185, 228, 190, 60, 9, 1, 248, 246, 4, 75, 248, 233, 23, 115,
+ 185, 58, 9, 1, 248, 246, 4, 115, 185, 209, 58, 196, 66, 60, 9, 1, 248,
+ 246, 4, 115, 185, 209, 58, 196, 66, 248, 233, 23, 105, 185, 58, 9, 1,
+ 248, 246, 4, 105, 185, 248, 233, 23, 75, 58, 9, 1, 248, 246, 4, 223, 93,
+ 2, 196, 13, 60, 9, 1, 248, 246, 4, 2, 196, 12, 9, 1, 182, 4, 105, 185,
+ 58, 9, 1, 182, 4, 115, 185, 209, 58, 196, 66, 60, 9, 1, 238, 4, 4, 105,
+ 185, 195, 85, 248, 233, 23, 2, 199, 219, 9, 1, 238, 4, 4, 223, 93, 2,
+ 196, 13, 60, 9, 1, 207, 72, 4, 106, 9, 1, 205, 47, 4, 232, 128, 185, 58,
+ 9, 1, 251, 231, 4, 105, 185, 58, 9, 1, 251, 231, 4, 115, 185, 209, 58,
+ 235, 119, 58, 9, 1, 251, 231, 4, 105, 185, 195, 85, 58, 9, 1, 233, 47, 4,
+ 105, 185, 60, 9, 1, 233, 47, 4, 115, 185, 209, 58, 196, 66, 60, 9, 1,
+ 222, 5, 4, 75, 58, 9, 1, 222, 5, 4, 115, 185, 58, 9, 1, 222, 5, 4, 115,
+ 185, 209, 58, 196, 66, 60, 9, 1, 92, 4, 75, 58, 9, 1, 92, 4, 75, 60, 9,
+ 1, 213, 25, 4, 105, 185, 60, 9, 1, 213, 25, 4, 2, 199, 219, 9, 1, 213,
+ 25, 4, 2, 196, 12, 9, 1, 220, 36, 4, 164, 9, 1, 207, 72, 4, 105, 185,
+ 195, 85, 58, 9, 1, 207, 72, 4, 230, 58, 58, 9, 1, 205, 47, 4, 105, 185,
+ 195, 85, 58, 9, 1, 182, 4, 2, 9, 1, 199, 220, 60, 9, 1, 182, 4, 2, 9, 1,
+ 199, 220, 23, 105, 236, 138, 9, 1, 205, 47, 4, 2, 9, 1, 199, 220, 23,
+ 105, 236, 138, 9, 1, 207, 72, 4, 2, 9, 1, 199, 220, 23, 105, 236, 138, 9,
+ 1, 182, 4, 2, 9, 1, 199, 220, 58, 9, 1, 131, 4, 233, 205, 251, 28, 17,
+ 105, 58, 9, 1, 131, 4, 233, 205, 251, 28, 17, 115, 58, 9, 1, 233, 74, 99,
+ 4, 233, 205, 251, 28, 17, 105, 58, 9, 1, 233, 74, 99, 4, 233, 205, 251,
+ 28, 17, 115, 58, 9, 1, 233, 74, 99, 4, 233, 205, 251, 28, 17, 232, 128,
+ 60, 9, 1, 193, 134, 4, 233, 205, 251, 28, 17, 105, 58, 9, 1, 193, 134, 4,
+ 233, 205, 251, 28, 17, 115, 58, 9, 1, 99, 249, 81, 4, 233, 205, 251, 28,
+ 17, 105, 58, 9, 1, 99, 249, 81, 4, 233, 205, 251, 28, 17, 115, 58, 9, 1,
+ 182, 4, 233, 205, 251, 28, 17, 232, 128, 60, 9, 1, 205, 47, 4, 233, 205,
+ 251, 28, 17, 232, 128, 58, 9, 1, 205, 47, 4, 223, 93, 196, 12, 9, 1, 222,
+ 107, 4, 105, 185, 58, 199, 46, 1, 230, 91, 199, 46, 1, 203, 119, 199, 46,
+ 1, 213, 23, 199, 46, 1, 207, 178, 199, 46, 1, 249, 151, 199, 46, 1, 219,
+ 156, 199, 46, 1, 222, 122, 199, 46, 1, 251, 179, 199, 46, 1, 195, 186,
+ 199, 46, 1, 216, 207, 199, 46, 1, 233, 107, 199, 46, 1, 237, 66, 199, 46,
+ 1, 199, 48, 199, 46, 1, 220, 122, 199, 46, 1, 231, 236, 199, 46, 1, 231,
+ 6, 199, 46, 1, 205, 45, 199, 46, 1, 237, 207, 199, 46, 1, 191, 94, 199,
+ 46, 1, 199, 161, 199, 46, 1, 192, 140, 199, 46, 1, 210, 77, 199, 46, 1,
+ 223, 15, 199, 46, 1, 243, 130, 199, 46, 1, 197, 131, 199, 46, 1, 229,
+ 176, 199, 46, 1, 221, 214, 199, 46, 1, 199, 47, 199, 46, 1, 191, 121,
+ 199, 46, 1, 203, 108, 199, 46, 1, 205, 196, 199, 46, 1, 238, 30, 199, 46,
+ 1, 159, 199, 46, 1, 191, 7, 199, 46, 1, 251, 227, 199, 46, 1, 231, 85,
+ 199, 46, 1, 208, 93, 199, 46, 1, 193, 178, 199, 46, 252, 70, 199, 46,
+ 252, 171, 199, 46, 228, 29, 199, 46, 234, 187, 199, 46, 196, 161, 199,
+ 46, 211, 86, 199, 46, 234, 198, 199, 46, 233, 195, 199, 46, 211, 171,
+ 199, 46, 211, 181, 199, 46, 200, 206, 199, 46, 1, 214, 250, 213, 107, 17,
+ 191, 77, 213, 107, 17, 107, 213, 107, 17, 109, 213, 107, 17, 138, 213,
+ 107, 17, 134, 213, 107, 17, 149, 213, 107, 17, 169, 213, 107, 17, 175,
+ 213, 107, 17, 171, 213, 107, 17, 178, 213, 107, 1, 65, 213, 107, 1, 234,
+ 188, 213, 107, 1, 68, 213, 107, 1, 71, 213, 107, 1, 66, 213, 107, 1, 211,
+ 87, 213, 107, 1, 74, 213, 107, 1, 238, 18, 213, 107, 1, 215, 61, 213,
+ 107, 1, 249, 153, 213, 107, 1, 168, 213, 107, 1, 190, 190, 213, 107, 1,
+ 223, 32, 213, 107, 1, 247, 1, 213, 107, 1, 238, 32, 213, 107, 1, 165,
+ 213, 107, 1, 206, 109, 213, 107, 1, 188, 213, 107, 1, 231, 182, 213, 107,
+ 1, 233, 109, 213, 107, 1, 155, 213, 107, 1, 173, 213, 107, 1, 215, 7,
+ 193, 37, 213, 107, 1, 174, 213, 107, 1, 212, 101, 213, 107, 1, 180, 213,
+ 107, 1, 140, 213, 107, 1, 193, 190, 213, 107, 1, 170, 213, 107, 1, 212,
+ 102, 193, 37, 213, 107, 1, 222, 193, 223, 32, 213, 107, 1, 222, 193, 247,
+ 1, 213, 107, 1, 222, 193, 165, 213, 107, 33, 203, 40, 137, 198, 79, 213,
+ 107, 33, 203, 40, 130, 198, 79, 213, 107, 33, 203, 40, 206, 180, 198, 79,
+ 213, 107, 33, 179, 237, 86, 198, 79, 213, 107, 33, 179, 137, 198, 79,
+ 213, 107, 33, 179, 130, 198, 79, 213, 107, 33, 179, 206, 180, 198, 79,
+ 213, 107, 33, 214, 213, 77, 213, 107, 33, 55, 75, 58, 213, 107, 137, 163,
+ 251, 49, 213, 107, 130, 163, 251, 49, 213, 107, 16, 211, 88, 237, 101,
+ 213, 107, 16, 231, 181, 213, 107, 242, 74, 213, 107, 233, 216, 77, 213,
+ 107, 220, 94, 213, 107, 237, 233, 213, 107, 236, 142, 56, 213, 107, 199,
+ 195, 56, 205, 151, 1, 251, 204, 205, 151, 1, 248, 148, 205, 151, 1, 231,
+ 216, 205, 151, 1, 238, 2, 205, 151, 1, 223, 44, 205, 151, 1, 249, 151,
+ 205, 151, 1, 191, 80, 205, 151, 1, 223, 53, 205, 151, 1, 198, 125, 205,
+ 151, 1, 191, 189, 205, 151, 1, 222, 123, 205, 151, 1, 220, 118, 205, 151,
+ 1, 216, 46, 205, 151, 1, 212, 130, 205, 151, 1, 202, 171, 205, 151, 1,
+ 223, 162, 205, 151, 1, 233, 23, 205, 151, 1, 197, 166, 205, 151, 1, 208,
+ 10, 205, 151, 1, 206, 181, 205, 151, 1, 203, 138, 205, 151, 1, 199, 243,
+ 205, 151, 87, 223, 162, 205, 151, 87, 223, 161, 205, 151, 87, 211, 165,
+ 205, 151, 87, 238, 16, 205, 151, 52, 1, 234, 52, 191, 189, 205, 151, 87,
+ 234, 52, 191, 189, 205, 151, 18, 3, 179, 71, 205, 151, 18, 3, 71, 205,
+ 151, 18, 3, 210, 253, 252, 206, 205, 151, 18, 3, 179, 252, 206, 205, 151,
+ 18, 3, 252, 206, 205, 151, 18, 3, 210, 253, 65, 205, 151, 18, 3, 179, 65,
+ 205, 151, 18, 3, 65, 205, 151, 52, 1, 203, 40, 65, 205, 151, 18, 3, 203,
+ 40, 65, 205, 151, 18, 3, 179, 66, 205, 151, 18, 3, 66, 205, 151, 52, 1,
+ 68, 205, 151, 18, 3, 179, 68, 205, 151, 18, 3, 68, 205, 151, 18, 3, 74,
+ 205, 151, 18, 3, 200, 206, 205, 151, 87, 214, 93, 205, 151, 208, 152,
+ 214, 93, 205, 151, 208, 152, 251, 255, 205, 151, 208, 152, 251, 121, 205,
+ 151, 208, 152, 249, 57, 205, 151, 208, 152, 250, 174, 205, 151, 208, 152,
+ 203, 57, 205, 151, 252, 68, 77, 205, 151, 208, 152, 216, 197, 208, 48,
+ 205, 151, 208, 152, 191, 16, 205, 151, 208, 152, 208, 48, 205, 151, 208,
+ 152, 191, 119, 205, 151, 208, 152, 197, 54, 205, 151, 208, 152, 250, 255,
+ 205, 151, 208, 152, 202, 33, 217, 37, 205, 151, 208, 152, 251, 97, 217,
+ 86, 1, 230, 65, 217, 86, 1, 252, 155, 217, 86, 1, 251, 253, 217, 86, 1,
+ 252, 42, 217, 86, 1, 251, 245, 217, 86, 1, 196, 36, 217, 86, 1, 250, 123,
+ 217, 86, 1, 223, 53, 217, 86, 1, 250, 171, 217, 86, 1, 251, 211, 217, 86,
+ 1, 251, 216, 217, 86, 1, 251, 207, 217, 86, 1, 251, 149, 217, 86, 1, 251,
+ 132, 217, 86, 1, 250, 219, 217, 86, 1, 223, 162, 217, 86, 1, 251, 65,
+ 217, 86, 1, 250, 184, 217, 86, 1, 251, 37, 217, 86, 1, 251, 33, 217, 86,
+ 1, 250, 209, 217, 86, 1, 250, 182, 217, 86, 1, 235, 62, 217, 86, 1, 222,
+ 114, 217, 86, 1, 251, 230, 217, 86, 252, 3, 77, 217, 86, 195, 22, 77,
+ 217, 86, 231, 153, 77, 217, 86, 208, 151, 200, 63, 1, 142, 214, 68, 200,
+ 63, 1, 142, 223, 32, 200, 63, 1, 142, 212, 101, 200, 63, 1, 142, 197,
+ 132, 200, 63, 1, 142, 213, 79, 200, 63, 1, 142, 213, 61, 200, 63, 1, 142,
+ 248, 203, 200, 63, 1, 142, 165, 200, 63, 1, 142, 219, 73, 200, 63, 1,
+ 142, 219, 62, 200, 63, 1, 142, 201, 175, 9, 1, 131, 4, 250, 170, 233, 70,
+ 9, 1, 131, 4, 250, 170, 198, 54, 50, 233, 70, 9, 1, 131, 4, 50, 82, 106,
+ 9, 1, 131, 4, 45, 82, 106, 9, 1, 131, 4, 250, 170, 222, 52, 9, 1, 131, 4,
+ 250, 170, 248, 77, 50, 222, 52, 9, 1, 131, 4, 250, 170, 206, 115, 75, 58,
+ 9, 1, 131, 4, 250, 170, 50, 206, 115, 236, 140, 9, 1, 131, 4, 250, 170,
+ 45, 206, 115, 236, 140, 9, 1, 131, 4, 250, 170, 206, 115, 75, 60, 9, 1,
+ 131, 4, 75, 58, 9, 1, 131, 4, 250, 170, 198, 54, 50, 233, 71, 23, 75, 58,
+ 9, 1, 131, 4, 50, 82, 201, 28, 23, 75, 58, 9, 1, 131, 4, 250, 170, 248,
+ 77, 50, 222, 53, 23, 75, 58, 9, 1, 131, 4, 250, 170, 198, 54, 50, 233,
+ 71, 23, 45, 206, 188, 9, 1, 131, 4, 50, 82, 201, 28, 23, 45, 206, 188, 9,
+ 1, 131, 4, 250, 170, 248, 77, 50, 222, 53, 23, 45, 206, 188, 9, 1, 131,
+ 4, 250, 170, 50, 230, 57, 9, 1, 131, 4, 250, 170, 45, 230, 57, 9, 199,
+ 169, 4, 210, 251, 230, 57, 9, 199, 169, 4, 210, 251, 193, 133, 9, 199,
+ 169, 4, 105, 185, 60, 9, 1, 199, 4, 192, 75, 9, 249, 72, 206, 115, 236,
+ 140, 9, 207, 147, 206, 115, 236, 140, 9, 1, 213, 25, 4, 223, 93, 2, 196,
+ 12, 9, 1, 182, 4, 223, 93, 2, 196, 13, 60, 9, 1, 199, 220, 4, 75, 60, 9,
+ 1, 199, 220, 4, 115, 185, 60, 9, 1, 222, 5, 4, 105, 185, 195, 85, 60, 9,
+ 81, 199, 215, 9, 209, 8, 87, 58, 9, 209, 182, 87, 58, 9, 2, 137, 193, 23,
+ 251, 206, 9, 2, 130, 193, 23, 223, 61, 9, 2, 130, 193, 23, 223, 179, 9,
+ 2, 130, 193, 23, 199, 173, 9, 217, 142, 193, 179, 9, 200, 182, 131, 215,
+ 234, 9, 235, 128, 217, 141, 9, 132, 217, 142, 139, 217, 141, 9, 1, 248,
+ 246, 4, 2, 196, 13, 60, 9, 1, 248, 246, 4, 230, 58, 58, 9, 1, 223, 7, 4,
+ 105, 185, 58, 9, 1, 199, 220, 4, 105, 185, 58, 9, 1, 233, 47, 4, 75, 248,
+ 233, 23, 115, 185, 58, 9, 1, 208, 90, 4, 75, 60, 9, 1, 220, 36, 4, 55,
+ 164, 9, 1, 92, 4, 115, 185, 58, 9, 1, 99, 4, 105, 185, 248, 233, 23, 230,
+ 58, 58, 9, 1, 99, 4, 105, 185, 248, 233, 23, 75, 58, 9, 1, 207, 72, 4,
+ 219, 4, 9, 1, 193, 134, 4, 75, 193, 52, 9, 1, 206, 142, 192, 75, 9, 1,
+ 130, 251, 192, 9, 1, 238, 4, 4, 115, 185, 60, 9, 1, 205, 193, 4, 115,
+ 185, 60, 9, 1, 231, 228, 4, 223, 93, 106, 9, 1, 201, 53, 193, 133, 9, 1,
+ 191, 114, 4, 223, 93, 196, 13, 58, 9, 1, 251, 231, 4, 115, 185, 60, 9, 1,
+ 222, 107, 4, 75, 60, 9, 1, 208, 90, 4, 75, 248, 233, 23, 213, 44, 185,
+ 58, 9, 1, 248, 246, 4, 2, 92, 58, 9, 1, 210, 42, 4, 2, 92, 58, 9, 1, 199,
+ 115, 4, 2, 199, 115, 58, 9, 1, 207, 72, 4, 2, 213, 25, 58, 9, 1, 99, 4,
+ 105, 185, 248, 233, 23, 2, 213, 25, 58, 9, 1, 252, 0, 233, 46, 9, 1, 252,
+ 0, 208, 89, 9, 1, 252, 0, 213, 24, 9, 1, 210, 42, 4, 2, 196, 12, 9, 1,
+ 199, 115, 4, 2, 196, 12, 9, 1, 197, 125, 4, 2, 196, 12, 9, 1, 199, 150,
+ 4, 2, 196, 12, 9, 1, 222, 5, 4, 2, 196, 12, 9, 1, 231, 87, 4, 115, 185,
+ 58, 9, 1, 252, 0, 208, 90, 4, 115, 185, 58, 9, 1, 223, 7, 4, 115, 185,
+ 58, 9, 1, 223, 7, 4, 115, 185, 60, 9, 1, 220, 36, 4, 2, 9, 1, 199, 220,
+ 58, 9, 1, 230, 224, 9, 2, 233, 74, 192, 75, 9, 2, 137, 233, 74, 192, 75,
+ 9, 2, 137, 99, 249, 81, 4, 105, 185, 60, 9, 2, 137, 193, 23, 205, 182, 9,
+ 2, 137, 191, 116, 9, 220, 13, 206, 115, 75, 58, 9, 220, 13, 206, 115, 75,
+ 60, 9, 200, 207, 60, 9, 220, 13, 243, 11, 60, 9, 220, 13, 206, 115, 75,
+ 223, 118, 243, 11, 60, 9, 2, 130, 193, 133, 9, 2, 137, 193, 23, 251, 30,
+ 9, 2, 137, 205, 192, 9, 2, 137, 251, 230, 9, 2, 137, 208, 89, 9, 2, 137,
+ 213, 25, 4, 222, 52, 9, 2, 130, 213, 25, 4, 222, 52, 9, 2, 137, 193, 23,
+ 250, 181, 9, 2, 137, 193, 23, 250, 218, 9, 2, 137, 193, 23, 251, 131, 9,
+ 2, 137, 193, 23, 205, 171, 9, 2, 137, 193, 23, 208, 52, 9, 2, 137, 193,
+ 23, 193, 157, 9, 2, 137, 232, 157, 217, 51, 9, 2, 137, 3, 205, 187, 9,
+ 236, 218, 234, 95, 79, 250, 130, 9, 153, 237, 246, 60, 9, 238, 171, 233,
+ 70, 9, 238, 171, 237, 245, 9, 238, 171, 222, 52, 9, 238, 171, 233, 68, 9,
+ 238, 171, 237, 243, 9, 238, 171, 222, 50, 9, 163, 91, 75, 58, 9, 163,
+ 105, 185, 58, 9, 163, 219, 5, 58, 9, 163, 91, 75, 60, 9, 163, 105, 185,
+ 60, 9, 163, 219, 5, 60, 9, 211, 77, 233, 68, 9, 211, 77, 237, 243, 9,
+ 211, 77, 222, 50, 9, 2, 137, 193, 133, 9, 233, 71, 4, 206, 188, 9, 233,
+ 71, 4, 75, 58, 9, 222, 53, 4, 75, 60, 9, 45, 250, 236, 58, 9, 50, 250,
+ 236, 58, 9, 45, 250, 236, 60, 9, 50, 250, 236, 60, 9, 55, 50, 250, 236,
+ 58, 9, 55, 50, 250, 236, 93, 4, 236, 140, 9, 50, 250, 236, 93, 4, 236,
+ 140, 9, 237, 246, 4, 236, 140, 9, 87, 202, 206, 213, 25, 231, 57, 100, 3,
+ 223, 93, 247, 119, 100, 3, 247, 119, 100, 3, 251, 71, 100, 3, 195, 35,
+ 100, 1, 203, 40, 65, 100, 1, 65, 100, 1, 252, 206, 100, 1, 68, 100, 1,
+ 223, 199, 100, 1, 66, 100, 1, 196, 30, 100, 1, 117, 146, 100, 1, 117,
+ 172, 100, 1, 247, 122, 71, 100, 1, 203, 40, 71, 100, 1, 71, 100, 1, 251,
+ 236, 100, 1, 247, 122, 74, 100, 1, 203, 40, 74, 100, 1, 74, 100, 1, 250,
+ 163, 100, 1, 155, 100, 1, 221, 215, 100, 1, 231, 240, 100, 1, 231, 91,
+ 100, 1, 214, 68, 100, 1, 247, 160, 100, 1, 247, 1, 100, 1, 223, 32, 100,
+ 1, 222, 252, 100, 1, 212, 101, 100, 1, 197, 132, 100, 1, 197, 120, 100,
+ 1, 237, 191, 100, 1, 237, 175, 100, 1, 213, 79, 100, 1, 190, 190, 100, 1,
+ 199, 49, 100, 1, 238, 32, 100, 1, 237, 68, 100, 1, 180, 100, 1, 213, 61,
+ 100, 1, 168, 100, 1, 209, 228, 100, 1, 249, 153, 100, 1, 248, 203, 100,
+ 1, 174, 100, 1, 170, 100, 1, 165, 100, 1, 206, 109, 100, 1, 173, 100, 1,
+ 219, 73, 100, 1, 219, 62, 100, 1, 195, 188, 100, 1, 203, 165, 100, 1,
+ 201, 175, 100, 1, 188, 100, 1, 140, 100, 18, 3, 211, 151, 100, 18, 3,
+ 211, 85, 100, 3, 212, 141, 100, 3, 250, 145, 100, 18, 3, 252, 206, 100,
+ 18, 3, 68, 100, 18, 3, 223, 199, 100, 18, 3, 66, 100, 18, 3, 196, 30,
+ 100, 18, 3, 117, 146, 100, 18, 3, 117, 206, 110, 100, 18, 3, 247, 122,
+ 71, 100, 18, 3, 203, 40, 71, 100, 18, 3, 71, 100, 18, 3, 251, 236, 100,
+ 18, 3, 247, 122, 74, 100, 18, 3, 203, 40, 74, 100, 18, 3, 74, 100, 18, 3,
+ 250, 163, 100, 3, 195, 40, 100, 18, 3, 208, 207, 71, 100, 18, 3, 250,
+ 140, 100, 211, 113, 100, 201, 38, 3, 196, 154, 100, 201, 38, 3, 251, 73,
+ 100, 230, 211, 252, 60, 100, 252, 47, 252, 60, 100, 18, 3, 247, 122, 179,
+ 71, 100, 18, 3, 196, 152, 100, 18, 3, 196, 29, 100, 1, 208, 96, 100, 1,
+ 221, 193, 100, 1, 231, 66, 100, 1, 191, 123, 100, 1, 237, 180, 100, 1,
+ 207, 6, 100, 1, 233, 109, 100, 1, 191, 175, 100, 1, 117, 206, 110, 100,
+ 1, 117, 219, 74, 100, 18, 3, 117, 172, 100, 18, 3, 117, 219, 74, 100,
+ 237, 238, 100, 55, 237, 238, 100, 17, 191, 77, 100, 17, 107, 100, 17,
+ 109, 100, 17, 138, 100, 17, 134, 100, 17, 149, 100, 17, 169, 100, 17,
+ 175, 100, 17, 171, 100, 17, 178, 100, 252, 68, 56, 100, 3, 137, 201, 246,
+ 236, 140, 100, 1, 247, 122, 65, 100, 1, 211, 151, 100, 1, 211, 85, 100,
+ 1, 250, 140, 100, 1, 196, 152, 100, 1, 196, 29, 100, 1, 217, 43, 237,
+ 191, 100, 1, 191, 71, 100, 1, 88, 170, 100, 1, 231, 127, 100, 1, 222,
+ 230, 100, 1, 231, 11, 201, 63, 100, 1, 237, 181, 100, 1, 249, 53, 248,
+ 225, 251, 100, 248, 225, 3, 247, 119, 248, 225, 3, 251, 71, 248, 225, 3,
+ 195, 35, 248, 225, 1, 65, 248, 225, 1, 252, 206, 248, 225, 1, 68, 248,
+ 225, 1, 223, 199, 248, 225, 1, 66, 248, 225, 1, 196, 30, 248, 225, 1,
+ 117, 146, 248, 225, 1, 117, 172, 248, 225, 1, 71, 248, 225, 1, 251, 236,
+ 248, 225, 1, 74, 248, 225, 1, 250, 163, 248, 225, 1, 155, 248, 225, 1,
+ 221, 215, 248, 225, 1, 231, 240, 248, 225, 1, 231, 91, 248, 225, 1, 214,
+ 68, 248, 225, 1, 247, 160, 248, 225, 1, 247, 1, 248, 225, 1, 223, 32,
+ 248, 225, 1, 222, 252, 248, 225, 1, 212, 101, 248, 225, 1, 197, 132, 248,
+ 225, 1, 197, 120, 248, 225, 1, 237, 191, 248, 225, 1, 237, 175, 248, 225,
+ 1, 213, 79, 248, 225, 1, 190, 190, 248, 225, 1, 199, 49, 248, 225, 1,
+ 238, 32, 248, 225, 1, 237, 68, 248, 225, 1, 180, 248, 225, 1, 168, 248,
+ 225, 1, 209, 228, 248, 225, 1, 249, 153, 248, 225, 1, 248, 203, 248, 225,
+ 1, 174, 248, 225, 1, 170, 248, 225, 1, 165, 248, 225, 1, 173, 248, 225,
+ 1, 203, 165, 248, 225, 1, 201, 175, 248, 225, 1, 188, 248, 225, 1, 140,
+ 248, 225, 3, 212, 141, 248, 225, 3, 250, 145, 248, 225, 18, 3, 252, 206,
+ 248, 225, 18, 3, 68, 248, 225, 18, 3, 223, 199, 248, 225, 18, 3, 66, 248,
+ 225, 18, 3, 196, 30, 248, 225, 18, 3, 117, 146, 248, 225, 18, 3, 117,
+ 206, 110, 248, 225, 18, 3, 71, 248, 225, 18, 3, 251, 236, 248, 225, 18,
+ 3, 74, 248, 225, 18, 3, 250, 163, 248, 225, 3, 195, 40, 248, 225, 1, 221,
+ 204, 190, 190, 248, 225, 250, 164, 219, 198, 77, 248, 225, 1, 206, 109,
+ 248, 225, 1, 207, 6, 248, 225, 1, 191, 175, 248, 225, 1, 117, 206, 110,
+ 248, 225, 1, 117, 219, 74, 248, 225, 18, 3, 117, 172, 248, 225, 18, 3,
+ 117, 219, 74, 248, 225, 17, 191, 77, 248, 225, 17, 107, 248, 225, 17,
+ 109, 248, 225, 17, 138, 248, 225, 17, 134, 248, 225, 17, 149, 248, 225,
+ 17, 169, 248, 225, 17, 175, 248, 225, 17, 171, 248, 225, 17, 178, 248,
+ 225, 1, 207, 186, 4, 82, 237, 38, 248, 225, 1, 207, 186, 4, 110, 237, 38,
+ 248, 225, 206, 36, 77, 248, 225, 206, 36, 56, 248, 225, 238, 170, 212,
+ 133, 107, 248, 225, 238, 170, 212, 133, 109, 248, 225, 238, 170, 212,
+ 133, 138, 248, 225, 238, 170, 212, 133, 134, 248, 225, 238, 170, 212,
+ 133, 91, 219, 181, 199, 39, 199, 34, 237, 99, 248, 225, 238, 170, 237,
+ 100, 202, 130, 248, 225, 223, 54, 248, 225, 231, 207, 77, 248, 225, 1,
+ 195, 150, 251, 71, 248, 225, 252, 68, 56, 248, 225, 205, 138, 77, 230,
+ 144, 3, 252, 41, 248, 167, 230, 144, 3, 248, 167, 230, 144, 3, 195, 35,
+ 230, 144, 1, 65, 230, 144, 1, 252, 206, 230, 144, 1, 68, 230, 144, 1,
+ 223, 199, 230, 144, 1, 66, 230, 144, 1, 196, 30, 230, 144, 1, 234, 188,
+ 230, 144, 1, 251, 236, 230, 144, 1, 211, 87, 230, 144, 1, 250, 163, 230,
+ 144, 1, 155, 230, 144, 1, 221, 215, 230, 144, 1, 231, 240, 230, 144, 1,
+ 231, 91, 230, 144, 1, 214, 68, 230, 144, 1, 247, 160, 230, 144, 1, 247,
+ 1, 230, 144, 1, 223, 32, 230, 144, 1, 222, 252, 230, 144, 1, 212, 101,
+ 230, 144, 1, 197, 132, 230, 144, 1, 197, 120, 230, 144, 1, 237, 191, 230,
+ 144, 1, 237, 175, 230, 144, 1, 213, 79, 230, 144, 1, 190, 190, 230, 144,
+ 1, 199, 49, 230, 144, 1, 238, 32, 230, 144, 1, 237, 68, 230, 144, 1, 180,
+ 230, 144, 1, 168, 230, 144, 1, 209, 228, 230, 144, 1, 249, 153, 230, 144,
+ 1, 248, 203, 230, 144, 1, 174, 230, 144, 1, 170, 230, 144, 1, 165, 230,
+ 144, 1, 173, 230, 144, 1, 219, 73, 230, 144, 1, 195, 188, 230, 144, 1,
+ 203, 165, 230, 144, 1, 188, 230, 144, 1, 140, 230, 144, 3, 212, 141, 230,
+ 144, 18, 3, 252, 206, 230, 144, 18, 3, 68, 230, 144, 18, 3, 223, 199,
+ 230, 144, 18, 3, 66, 230, 144, 18, 3, 196, 30, 230, 144, 18, 3, 234, 188,
+ 230, 144, 18, 3, 251, 236, 230, 144, 18, 3, 211, 87, 230, 144, 18, 3,
+ 250, 163, 230, 144, 3, 195, 40, 230, 144, 3, 196, 157, 230, 144, 1, 221,
+ 193, 230, 144, 1, 231, 66, 230, 144, 1, 191, 123, 230, 144, 1, 206, 109,
+ 230, 144, 1, 233, 109, 230, 144, 17, 191, 77, 230, 144, 17, 107, 230,
+ 144, 17, 109, 230, 144, 17, 138, 230, 144, 17, 134, 230, 144, 17, 149,
+ 230, 144, 17, 169, 230, 144, 17, 175, 230, 144, 17, 171, 230, 144, 17,
+ 178, 230, 144, 198, 133, 230, 144, 252, 40, 230, 144, 223, 75, 230, 144,
+ 196, 58, 230, 144, 234, 148, 211, 92, 230, 144, 3, 192, 115, 230, 144,
+ 252, 68, 56, 230, 161, 3, 247, 119, 230, 161, 3, 251, 71, 230, 161, 3,
+ 195, 35, 230, 161, 1, 65, 230, 161, 1, 252, 206, 230, 161, 1, 68, 230,
+ 161, 1, 223, 199, 230, 161, 1, 66, 230, 161, 1, 196, 30, 230, 161, 1,
+ 117, 146, 230, 161, 1, 117, 172, 230, 161, 18, 247, 122, 71, 230, 161, 1,
+ 71, 230, 161, 1, 251, 236, 230, 161, 18, 247, 122, 74, 230, 161, 1, 74,
+ 230, 161, 1, 250, 163, 230, 161, 1, 155, 230, 161, 1, 221, 215, 230, 161,
+ 1, 231, 240, 230, 161, 1, 231, 91, 230, 161, 1, 214, 68, 230, 161, 1,
+ 247, 160, 230, 161, 1, 247, 1, 230, 161, 1, 223, 32, 230, 161, 1, 222,
+ 252, 230, 161, 1, 212, 101, 230, 161, 1, 197, 132, 230, 161, 1, 197, 120,
+ 230, 161, 1, 237, 191, 230, 161, 1, 237, 175, 230, 161, 1, 213, 79, 230,
+ 161, 1, 190, 190, 230, 161, 1, 199, 49, 230, 161, 1, 238, 32, 230, 161,
+ 1, 237, 68, 230, 161, 1, 180, 230, 161, 1, 168, 230, 161, 1, 209, 228,
+ 230, 161, 1, 249, 153, 230, 161, 1, 248, 203, 230, 161, 1, 174, 230, 161,
+ 1, 170, 230, 161, 1, 165, 230, 161, 1, 173, 230, 161, 1, 219, 73, 230,
+ 161, 1, 195, 188, 230, 161, 1, 203, 165, 230, 161, 1, 201, 175, 230, 161,
+ 1, 188, 230, 161, 1, 140, 230, 161, 3, 212, 141, 230, 161, 3, 250, 145,
+ 230, 161, 18, 3, 252, 206, 230, 161, 18, 3, 68, 230, 161, 18, 3, 223,
+ 199, 230, 161, 18, 3, 66, 230, 161, 18, 3, 196, 30, 230, 161, 18, 3, 117,
+ 146, 230, 161, 18, 3, 117, 206, 110, 230, 161, 18, 3, 247, 122, 71, 230,
+ 161, 18, 3, 71, 230, 161, 18, 3, 251, 236, 230, 161, 18, 3, 247, 122, 74,
+ 230, 161, 18, 3, 74, 230, 161, 18, 3, 250, 163, 230, 161, 3, 195, 40,
+ 230, 161, 211, 113, 230, 161, 1, 117, 206, 110, 230, 161, 1, 117, 219,
+ 74, 230, 161, 18, 3, 117, 172, 230, 161, 18, 3, 117, 219, 74, 230, 161,
+ 17, 191, 77, 230, 161, 17, 107, 230, 161, 17, 109, 230, 161, 17, 138,
+ 230, 161, 17, 134, 230, 161, 17, 149, 230, 161, 17, 169, 230, 161, 17,
+ 175, 230, 161, 17, 171, 230, 161, 17, 178, 230, 161, 252, 68, 56, 230,
+ 161, 206, 36, 56, 230, 161, 1, 191, 71, 230, 161, 3, 200, 206, 230, 161,
+ 3, 203, 155, 230, 161, 3, 217, 139, 230, 161, 3, 198, 224, 212, 142, 58,
+ 230, 161, 3, 243, 11, 212, 142, 58, 230, 161, 3, 197, 15, 212, 142, 58,
+ 211, 45, 3, 247, 119, 211, 45, 3, 251, 71, 211, 45, 3, 195, 35, 211, 45,
+ 1, 65, 211, 45, 1, 252, 206, 211, 45, 1, 68, 211, 45, 1, 223, 199, 211,
+ 45, 1, 66, 211, 45, 1, 196, 30, 211, 45, 1, 117, 146, 211, 45, 1, 117,
+ 172, 211, 45, 1, 71, 211, 45, 1, 251, 236, 211, 45, 1, 74, 211, 45, 1,
+ 250, 163, 211, 45, 1, 155, 211, 45, 1, 221, 215, 211, 45, 1, 231, 240,
+ 211, 45, 1, 231, 91, 211, 45, 1, 214, 68, 211, 45, 1, 247, 160, 211, 45,
+ 1, 247, 1, 211, 45, 1, 223, 32, 211, 45, 1, 222, 252, 211, 45, 1, 212,
+ 101, 211, 45, 1, 197, 132, 211, 45, 1, 197, 120, 211, 45, 1, 237, 191,
+ 211, 45, 1, 237, 175, 211, 45, 1, 213, 79, 211, 45, 1, 190, 190, 211, 45,
+ 1, 199, 49, 211, 45, 1, 238, 32, 211, 45, 1, 237, 68, 211, 45, 1, 180,
+ 211, 45, 1, 168, 211, 45, 1, 209, 228, 211, 45, 1, 249, 153, 211, 45, 1,
+ 248, 203, 211, 45, 1, 174, 211, 45, 1, 170, 211, 45, 1, 165, 211, 45, 1,
+ 173, 211, 45, 1, 219, 73, 211, 45, 1, 195, 188, 211, 45, 1, 203, 165,
+ 211, 45, 1, 201, 175, 211, 45, 1, 188, 211, 45, 1, 140, 211, 45, 3, 212,
+ 141, 211, 45, 3, 250, 145, 211, 45, 18, 3, 252, 206, 211, 45, 18, 3, 68,
+ 211, 45, 18, 3, 223, 199, 211, 45, 18, 3, 66, 211, 45, 18, 3, 196, 30,
+ 211, 45, 18, 3, 117, 146, 211, 45, 18, 3, 117, 206, 110, 211, 45, 18, 3,
+ 71, 211, 45, 18, 3, 251, 236, 211, 45, 18, 3, 74, 211, 45, 18, 3, 250,
+ 163, 211, 45, 3, 195, 40, 211, 45, 3, 210, 254, 211, 45, 251, 237, 219,
+ 198, 77, 211, 45, 250, 164, 219, 198, 77, 211, 45, 1, 206, 109, 211, 45,
+ 1, 207, 6, 211, 45, 1, 191, 175, 211, 45, 1, 117, 206, 110, 211, 45, 1,
+ 117, 219, 74, 211, 45, 18, 3, 117, 172, 211, 45, 18, 3, 117, 219, 74,
+ 211, 45, 17, 191, 77, 211, 45, 17, 107, 211, 45, 17, 109, 211, 45, 17,
+ 138, 211, 45, 17, 134, 211, 45, 17, 149, 211, 45, 17, 169, 211, 45, 17,
+ 175, 211, 45, 17, 171, 211, 45, 17, 178, 211, 45, 223, 54, 211, 45, 1,
+ 193, 190, 211, 45, 232, 118, 91, 208, 22, 211, 45, 232, 118, 91, 230, 70,
+ 211, 45, 232, 118, 115, 208, 20, 211, 45, 232, 118, 91, 202, 128, 211,
+ 45, 232, 118, 91, 234, 159, 211, 45, 232, 118, 115, 202, 125, 44, 3, 251,
+ 71, 44, 3, 195, 35, 44, 1, 65, 44, 1, 252, 206, 44, 1, 68, 44, 1, 223,
+ 199, 44, 1, 66, 44, 1, 196, 30, 44, 1, 71, 44, 1, 234, 188, 44, 1, 251,
+ 236, 44, 1, 74, 44, 1, 211, 87, 44, 1, 250, 163, 44, 1, 155, 44, 1, 214,
+ 68, 44, 1, 247, 160, 44, 1, 223, 32, 44, 1, 212, 101, 44, 1, 197, 132,
+ 44, 1, 213, 79, 44, 1, 190, 190, 44, 1, 180, 44, 1, 213, 61, 44, 1, 168,
+ 44, 1, 174, 44, 1, 170, 44, 1, 165, 44, 1, 206, 109, 44, 1, 173, 44, 1,
+ 219, 73, 44, 1, 219, 62, 44, 1, 195, 188, 44, 1, 203, 165, 44, 1, 201,
+ 175, 44, 1, 188, 44, 1, 140, 44, 18, 3, 252, 206, 44, 18, 3, 68, 44, 18,
+ 3, 223, 199, 44, 18, 3, 66, 44, 18, 3, 196, 30, 44, 18, 3, 71, 44, 18, 3,
+ 234, 188, 44, 18, 3, 251, 236, 44, 18, 3, 74, 44, 18, 3, 211, 87, 44, 18,
+ 3, 250, 163, 44, 3, 195, 40, 44, 211, 113, 44, 250, 164, 219, 198, 77,
+ 44, 17, 191, 77, 44, 17, 107, 44, 17, 109, 44, 17, 138, 44, 17, 134, 44,
+ 17, 149, 44, 17, 169, 44, 17, 175, 44, 17, 171, 44, 17, 178, 44, 31, 199,
+ 95, 44, 31, 91, 228, 140, 44, 31, 91, 189, 44, 237, 204, 56, 44, 215,
+ 214, 56, 44, 192, 78, 56, 44, 237, 142, 56, 44, 238, 230, 56, 44, 250,
+ 220, 93, 56, 44, 206, 36, 56, 44, 31, 56, 199, 99, 3, 33, 247, 120, 58,
+ 199, 99, 3, 247, 119, 199, 99, 3, 251, 71, 199, 99, 3, 195, 35, 199, 99,
+ 3, 33, 251, 72, 58, 199, 99, 1, 65, 199, 99, 1, 252, 206, 199, 99, 1, 68,
+ 199, 99, 1, 223, 199, 199, 99, 1, 66, 199, 99, 1, 196, 30, 199, 99, 1,
+ 117, 146, 199, 99, 1, 117, 172, 199, 99, 1, 71, 199, 99, 1, 234, 188,
+ 199, 99, 1, 251, 236, 199, 99, 1, 74, 199, 99, 1, 211, 87, 199, 99, 1,
+ 250, 163, 199, 99, 1, 155, 199, 99, 1, 221, 215, 199, 99, 1, 231, 240,
+ 199, 99, 1, 231, 91, 199, 99, 1, 214, 68, 199, 99, 1, 247, 160, 199, 99,
+ 1, 247, 1, 199, 99, 1, 223, 32, 199, 99, 1, 222, 252, 199, 99, 1, 212,
+ 101, 199, 99, 1, 197, 132, 199, 99, 1, 197, 120, 199, 99, 1, 237, 191,
+ 199, 99, 1, 237, 175, 199, 99, 1, 213, 79, 199, 99, 1, 190, 190, 199, 99,
+ 1, 199, 49, 199, 99, 1, 238, 32, 199, 99, 1, 237, 68, 199, 99, 1, 180,
+ 199, 99, 1, 168, 199, 99, 1, 209, 228, 199, 99, 1, 249, 153, 199, 99, 1,
+ 248, 203, 199, 99, 1, 174, 199, 99, 1, 170, 199, 99, 1, 165, 199, 99, 1,
+ 206, 109, 199, 99, 1, 173, 199, 99, 1, 219, 73, 199, 99, 1, 219, 62, 199,
+ 99, 1, 195, 188, 199, 99, 1, 203, 165, 199, 99, 1, 201, 175, 199, 99, 1,
+ 188, 199, 99, 1, 140, 199, 99, 3, 212, 141, 199, 99, 3, 250, 145, 199,
+ 99, 18, 3, 252, 206, 199, 99, 18, 3, 68, 199, 99, 18, 3, 223, 199, 199,
+ 99, 18, 3, 66, 199, 99, 18, 3, 196, 30, 199, 99, 18, 3, 117, 146, 199,
+ 99, 18, 3, 117, 206, 110, 199, 99, 18, 3, 71, 199, 99, 18, 3, 234, 188,
+ 199, 99, 18, 3, 251, 236, 199, 99, 18, 3, 74, 199, 99, 18, 3, 211, 87,
+ 199, 99, 18, 3, 250, 163, 199, 99, 3, 195, 40, 199, 99, 219, 198, 77,
+ 199, 99, 251, 237, 219, 198, 77, 199, 99, 1, 197, 168, 199, 99, 1, 235,
+ 35, 199, 99, 1, 206, 90, 199, 99, 1, 214, 232, 209, 46, 199, 99, 1, 117,
+ 206, 110, 199, 99, 1, 117, 219, 74, 199, 99, 18, 3, 117, 172, 199, 99,
+ 18, 3, 117, 219, 74, 199, 99, 17, 191, 77, 199, 99, 17, 107, 199, 99, 17,
+ 109, 199, 99, 17, 138, 199, 99, 17, 134, 199, 99, 17, 149, 199, 99, 17,
+ 169, 199, 99, 17, 175, 199, 99, 17, 171, 199, 99, 17, 178, 199, 99, 3,
+ 202, 210, 199, 99, 232, 118, 17, 191, 78, 40, 211, 155, 208, 253, 79,
+ 134, 199, 99, 232, 118, 17, 91, 40, 211, 155, 208, 253, 79, 134, 199, 99,
+ 232, 118, 17, 105, 40, 211, 155, 208, 253, 79, 134, 199, 99, 232, 118,
+ 17, 115, 40, 211, 155, 208, 253, 79, 134, 199, 99, 232, 118, 17, 91, 40,
+ 233, 229, 208, 253, 79, 134, 199, 99, 232, 118, 17, 105, 40, 233, 229,
+ 208, 253, 79, 134, 199, 99, 232, 118, 17, 115, 40, 233, 229, 208, 253,
+ 79, 134, 199, 99, 3, 197, 48, 222, 81, 3, 201, 246, 247, 119, 222, 81, 3,
+ 247, 119, 222, 81, 3, 251, 71, 222, 81, 3, 195, 35, 222, 81, 3, 202, 210,
+ 222, 81, 1, 65, 222, 81, 1, 252, 206, 222, 81, 1, 68, 222, 81, 1, 223,
+ 199, 222, 81, 1, 66, 222, 81, 1, 196, 30, 222, 81, 1, 117, 146, 222, 81,
+ 1, 117, 172, 222, 81, 1, 71, 222, 81, 1, 234, 188, 222, 81, 1, 251, 236,
+ 222, 81, 1, 74, 222, 81, 1, 211, 87, 222, 81, 1, 250, 163, 222, 81, 1,
+ 155, 222, 81, 1, 221, 215, 222, 81, 1, 231, 240, 222, 81, 1, 231, 91,
+ 222, 81, 1, 214, 68, 222, 81, 1, 247, 160, 222, 81, 1, 247, 1, 222, 81,
+ 1, 223, 32, 222, 81, 1, 222, 252, 222, 81, 1, 212, 101, 222, 81, 1, 197,
+ 132, 222, 81, 1, 197, 120, 222, 81, 1, 237, 191, 222, 81, 1, 237, 175,
+ 222, 81, 1, 213, 79, 222, 81, 1, 190, 190, 222, 81, 1, 199, 49, 222, 81,
+ 1, 238, 32, 222, 81, 1, 237, 68, 222, 81, 1, 180, 222, 81, 1, 168, 222,
+ 81, 1, 209, 228, 222, 81, 1, 249, 153, 222, 81, 1, 248, 203, 222, 81, 1,
+ 174, 222, 81, 1, 170, 222, 81, 1, 165, 222, 81, 1, 206, 109, 222, 81, 1,
+ 173, 222, 81, 1, 219, 73, 222, 81, 1, 195, 188, 222, 81, 1, 203, 165,
+ 222, 81, 1, 201, 175, 222, 81, 1, 188, 222, 81, 1, 140, 222, 81, 3, 212,
+ 141, 222, 81, 3, 250, 145, 222, 81, 18, 3, 252, 206, 222, 81, 18, 3, 68,
+ 222, 81, 18, 3, 223, 199, 222, 81, 18, 3, 66, 222, 81, 18, 3, 196, 30,
+ 222, 81, 18, 3, 117, 146, 222, 81, 18, 3, 117, 206, 110, 222, 81, 18, 3,
+ 71, 222, 81, 18, 3, 234, 188, 222, 81, 18, 3, 251, 236, 222, 81, 18, 3,
+ 74, 222, 81, 18, 3, 211, 87, 222, 81, 18, 3, 250, 163, 222, 81, 3, 195,
+ 40, 222, 81, 219, 198, 77, 222, 81, 251, 237, 219, 198, 77, 222, 81, 1,
+ 214, 232, 209, 46, 222, 81, 1, 233, 109, 222, 81, 1, 117, 206, 110, 222,
+ 81, 1, 117, 219, 74, 222, 81, 18, 3, 117, 172, 222, 81, 18, 3, 117, 219,
+ 74, 222, 81, 17, 191, 77, 222, 81, 17, 107, 222, 81, 17, 109, 222, 81,
+ 17, 138, 222, 81, 17, 134, 222, 81, 17, 149, 222, 81, 17, 169, 222, 81,
+ 17, 175, 222, 81, 17, 171, 222, 81, 17, 178, 222, 81, 3, 222, 237, 222,
+ 81, 3, 196, 75, 222, 81, 3, 33, 251, 72, 93, 183, 142, 3, 33, 251, 72,
+ 58, 142, 3, 247, 119, 142, 3, 251, 71, 142, 3, 195, 35, 142, 1, 195, 150,
+ 251, 71, 142, 1, 65, 142, 1, 252, 206, 142, 1, 68, 142, 1, 223, 199, 142,
+ 1, 66, 142, 1, 196, 30, 142, 1, 117, 146, 142, 1, 117, 172, 142, 1, 71,
+ 142, 1, 234, 188, 142, 1, 251, 236, 142, 1, 74, 142, 1, 211, 87, 142, 1,
+ 250, 163, 142, 1, 155, 142, 1, 221, 215, 142, 1, 231, 240, 142, 1, 231,
+ 91, 142, 1, 214, 68, 142, 1, 247, 160, 142, 1, 247, 1, 142, 1, 223, 32,
+ 142, 1, 222, 252, 142, 1, 212, 101, 142, 1, 197, 132, 142, 1, 197, 120,
+ 142, 1, 237, 191, 142, 1, 237, 175, 142, 1, 213, 79, 142, 1, 190, 190,
+ 142, 1, 199, 49, 142, 1, 238, 32, 142, 1, 237, 68, 142, 1, 180, 142, 1,
+ 213, 61, 142, 1, 168, 142, 1, 209, 228, 142, 1, 249, 153, 142, 1, 248,
+ 203, 142, 1, 174, 142, 1, 170, 142, 1, 165, 142, 1, 206, 109, 142, 1,
+ 173, 142, 1, 219, 73, 142, 1, 219, 62, 142, 1, 195, 188, 142, 1, 203,
+ 165, 142, 1, 201, 175, 142, 1, 188, 142, 1, 140, 142, 1, 197, 101, 142,
+ 3, 81, 249, 88, 195, 40, 142, 3, 243, 4, 195, 40, 142, 3, 250, 145, 142,
+ 18, 3, 252, 206, 142, 18, 3, 68, 142, 18, 3, 223, 199, 142, 18, 3, 66,
+ 142, 18, 3, 196, 30, 142, 18, 3, 117, 146, 142, 18, 3, 117, 206, 110,
+ 142, 18, 3, 71, 142, 18, 3, 234, 188, 142, 18, 3, 251, 236, 142, 18, 3,
+ 74, 142, 18, 3, 211, 87, 142, 18, 3, 250, 163, 142, 3, 195, 40, 142, 1,
+ 75, 207, 45, 142, 3, 210, 130, 142, 1, 243, 84, 218, 168, 142, 1, 243,
+ 84, 192, 159, 142, 1, 243, 84, 219, 63, 142, 250, 164, 219, 198, 77, 142,
+ 232, 118, 91, 211, 100, 142, 232, 118, 91, 232, 139, 142, 232, 118, 115,
+ 234, 155, 142, 232, 118, 91, 197, 35, 142, 232, 118, 91, 199, 86, 142,
+ 232, 118, 115, 197, 34, 142, 232, 118, 91, 233, 18, 142, 1, 251, 14, 223,
+ 199, 142, 1, 117, 206, 110, 142, 1, 117, 219, 74, 142, 18, 3, 117, 172,
+ 142, 18, 3, 117, 219, 74, 142, 17, 191, 77, 142, 17, 107, 142, 17, 109,
+ 142, 17, 138, 142, 17, 134, 142, 17, 149, 142, 17, 169, 142, 17, 175,
+ 142, 17, 171, 142, 17, 178, 142, 31, 199, 95, 142, 31, 91, 228, 140, 142,
+ 31, 91, 189, 142, 232, 118, 91, 208, 22, 142, 232, 118, 91, 230, 70, 142,
+ 232, 118, 115, 208, 20, 142, 232, 118, 91, 202, 128, 142, 232, 118, 91,
+ 234, 159, 142, 232, 118, 115, 202, 125, 142, 237, 209, 77, 142, 1, 243,
+ 84, 213, 80, 142, 1, 243, 84, 215, 61, 142, 1, 243, 84, 206, 110, 142, 1,
+ 243, 84, 172, 142, 1, 243, 84, 219, 74, 142, 1, 243, 84, 222, 152, 166,
+ 3, 247, 119, 166, 3, 251, 70, 166, 3, 195, 34, 166, 1, 250, 129, 166, 1,
+ 252, 159, 166, 1, 252, 5, 166, 1, 252, 20, 166, 1, 223, 43, 166, 1, 223,
+ 198, 166, 1, 196, 20, 166, 1, 196, 24, 166, 1, 223, 70, 166, 1, 223, 71,
+ 166, 1, 223, 182, 166, 1, 223, 184, 166, 1, 233, 196, 166, 1, 234, 183,
+ 166, 1, 251, 219, 166, 1, 210, 241, 166, 1, 211, 80, 166, 1, 250, 148,
+ 166, 1, 251, 163, 222, 27, 166, 1, 217, 119, 222, 27, 166, 1, 251, 163,
+ 231, 185, 166, 1, 217, 119, 231, 185, 166, 1, 222, 80, 214, 247, 166, 1,
+ 205, 132, 231, 185, 166, 1, 251, 163, 247, 68, 166, 1, 217, 119, 247, 68,
+ 166, 1, 251, 163, 223, 13, 166, 1, 217, 119, 223, 13, 166, 1, 199, 241,
+ 214, 247, 166, 1, 199, 241, 205, 131, 214, 248, 166, 1, 205, 132, 223,
+ 13, 166, 1, 251, 163, 197, 128, 166, 1, 217, 119, 197, 128, 166, 1, 251,
+ 163, 237, 182, 166, 1, 217, 119, 237, 182, 166, 1, 215, 92, 214, 197,
+ 166, 1, 205, 132, 237, 182, 166, 1, 251, 163, 199, 153, 166, 1, 217, 119,
+ 199, 153, 166, 1, 251, 163, 237, 202, 166, 1, 217, 119, 237, 202, 166, 1,
+ 237, 234, 214, 197, 166, 1, 205, 132, 237, 202, 166, 1, 251, 163, 210,
+ 71, 166, 1, 217, 119, 210, 71, 166, 1, 251, 163, 249, 55, 166, 1, 217,
+ 119, 249, 55, 166, 1, 217, 19, 166, 1, 251, 143, 249, 55, 166, 1, 192,
+ 85, 166, 1, 207, 121, 166, 1, 237, 234, 219, 247, 166, 1, 195, 156, 166,
+ 1, 199, 241, 205, 102, 166, 1, 215, 92, 205, 102, 166, 1, 237, 234, 205,
+ 102, 166, 1, 229, 251, 166, 1, 215, 92, 219, 247, 166, 1, 233, 61, 166,
+ 3, 251, 205, 166, 18, 3, 252, 15, 166, 18, 3, 221, 240, 252, 22, 166, 18,
+ 3, 237, 11, 252, 22, 166, 18, 3, 221, 240, 223, 67, 166, 18, 3, 237, 11,
+ 223, 67, 166, 18, 3, 221, 240, 210, 219, 166, 18, 3, 237, 11, 210, 219,
+ 166, 18, 3, 231, 229, 166, 18, 3, 221, 46, 166, 18, 3, 237, 11, 221, 46,
+ 166, 18, 3, 221, 48, 237, 120, 166, 18, 3, 221, 47, 230, 92, 252, 15,
+ 166, 18, 3, 221, 47, 230, 92, 237, 11, 252, 15, 166, 18, 3, 221, 47, 230,
+ 92, 231, 184, 166, 18, 3, 231, 184, 166, 219, 86, 17, 191, 77, 166, 219,
+ 86, 17, 107, 166, 219, 86, 17, 109, 166, 219, 86, 17, 138, 166, 219, 86,
+ 17, 134, 166, 219, 86, 17, 149, 166, 219, 86, 17, 169, 166, 219, 86, 17,
+ 175, 166, 219, 86, 17, 171, 166, 219, 86, 17, 178, 166, 18, 3, 237, 11,
+ 231, 229, 166, 18, 3, 237, 11, 231, 184, 166, 208, 152, 220, 209, 199,
+ 44, 246, 240, 221, 68, 222, 102, 199, 44, 246, 240, 221, 184, 221, 209,
+ 199, 44, 246, 240, 221, 184, 221, 174, 199, 44, 246, 240, 221, 184, 221,
+ 169, 199, 44, 246, 240, 221, 184, 221, 179, 199, 44, 246, 240, 221, 184,
+ 207, 143, 199, 44, 246, 240, 213, 250, 213, 237, 199, 44, 246, 240, 243,
+ 69, 246, 246, 199, 44, 246, 240, 243, 69, 243, 79, 199, 44, 246, 240,
+ 243, 69, 246, 245, 199, 44, 246, 240, 202, 47, 202, 46, 199, 44, 246,
+ 240, 243, 69, 243, 65, 199, 44, 246, 240, 192, 13, 192, 20, 199, 44, 246,
+ 240, 236, 175, 246, 254, 199, 44, 246, 240, 119, 210, 87, 199, 44, 246,
+ 240, 198, 242, 199, 38, 199, 44, 246, 240, 198, 242, 214, 222, 199, 44,
+ 246, 240, 198, 242, 209, 188, 199, 44, 246, 240, 213, 44, 214, 102, 199,
+ 44, 246, 240, 236, 175, 237, 121, 199, 44, 246, 240, 119, 199, 184, 199,
+ 44, 246, 240, 198, 242, 198, 207, 199, 44, 246, 240, 198, 242, 199, 45,
+ 199, 44, 246, 240, 198, 242, 198, 236, 199, 44, 246, 240, 213, 44, 212,
+ 178, 199, 44, 246, 240, 248, 112, 249, 118, 199, 44, 246, 240, 209, 74,
+ 209, 110, 199, 44, 246, 240, 209, 200, 209, 190, 199, 44, 246, 240, 232,
+ 176, 233, 109, 199, 44, 246, 240, 209, 200, 209, 221, 199, 44, 246, 240,
+ 232, 176, 233, 80, 199, 44, 246, 240, 209, 200, 205, 146, 199, 44, 246,
+ 240, 216, 13, 174, 199, 44, 246, 240, 192, 13, 192, 116, 199, 44, 246,
+ 240, 206, 163, 206, 61, 199, 44, 246, 240, 206, 68, 199, 44, 246, 240,
+ 219, 44, 219, 105, 199, 44, 246, 240, 218, 225, 199, 44, 246, 240, 193,
+ 49, 193, 175, 199, 44, 246, 240, 202, 47, 205, 167, 199, 44, 246, 240,
+ 202, 47, 206, 32, 199, 44, 246, 240, 202, 47, 200, 251, 199, 44, 246,
+ 240, 229, 24, 229, 122, 199, 44, 246, 240, 219, 44, 243, 47, 199, 44,
+ 246, 240, 187, 251, 122, 199, 44, 246, 240, 229, 24, 213, 34, 199, 44,
+ 246, 240, 210, 194, 199, 44, 246, 240, 205, 126, 65, 199, 44, 246, 240,
+ 217, 113, 230, 55, 199, 44, 246, 240, 205, 126, 252, 206, 199, 44, 246,
+ 240, 205, 126, 251, 149, 199, 44, 246, 240, 205, 126, 68, 199, 44, 246,
+ 240, 205, 126, 223, 199, 199, 44, 246, 240, 205, 126, 196, 152, 199, 44,
+ 246, 240, 205, 126, 196, 149, 199, 44, 246, 240, 205, 126, 66, 199, 44,
+ 246, 240, 205, 126, 196, 30, 199, 44, 246, 240, 209, 202, 199, 44, 238,
+ 170, 16, 249, 119, 199, 44, 246, 240, 205, 126, 71, 199, 44, 246, 240,
+ 205, 126, 252, 25, 199, 44, 246, 240, 205, 126, 74, 199, 44, 246, 240,
+ 205, 126, 251, 237, 217, 107, 199, 44, 246, 240, 205, 126, 251, 237, 217,
+ 108, 199, 44, 246, 240, 220, 39, 199, 44, 246, 240, 217, 104, 199, 44,
+ 246, 240, 217, 105, 199, 44, 246, 240, 217, 113, 234, 147, 199, 44, 246,
+ 240, 217, 113, 198, 241, 199, 44, 246, 240, 217, 113, 197, 244, 199, 44,
+ 246, 240, 217, 113, 243, 132, 199, 44, 246, 240, 199, 36, 199, 44, 246,
+ 240, 213, 183, 199, 44, 246, 240, 192, 110, 199, 44, 246, 240, 232, 164,
+ 199, 44, 17, 191, 77, 199, 44, 17, 107, 199, 44, 17, 109, 199, 44, 17,
+ 138, 199, 44, 17, 134, 199, 44, 17, 149, 199, 44, 17, 169, 199, 44, 17,
+ 175, 199, 44, 17, 171, 199, 44, 17, 178, 199, 44, 246, 240, 251, 117,
+ 199, 44, 246, 240, 221, 180, 220, 17, 1, 221, 67, 220, 17, 1, 221, 184,
+ 200, 195, 220, 17, 1, 221, 184, 199, 197, 220, 17, 1, 210, 187, 231, 91,
+ 220, 17, 1, 213, 249, 220, 17, 1, 242, 99, 220, 17, 1, 210, 187, 247, 1,
+ 220, 17, 1, 202, 47, 199, 197, 220, 17, 1, 210, 187, 222, 252, 220, 17,
+ 1, 212, 65, 220, 17, 1, 210, 187, 212, 101, 220, 17, 1, 210, 187, 197,
+ 132, 220, 17, 1, 210, 187, 197, 120, 220, 17, 1, 210, 187, 237, 191, 220,
+ 17, 1, 210, 187, 237, 175, 220, 17, 1, 210, 187, 213, 79, 220, 17, 1,
+ 236, 174, 220, 17, 1, 159, 220, 17, 1, 198, 242, 200, 195, 220, 17, 1,
+ 198, 242, 199, 197, 220, 17, 1, 210, 187, 237, 68, 220, 17, 1, 213, 43,
+ 220, 17, 1, 248, 111, 220, 17, 1, 209, 73, 220, 17, 1, 209, 200, 200,
+ 195, 220, 17, 1, 232, 176, 199, 197, 220, 17, 1, 209, 200, 199, 197, 220,
+ 17, 1, 232, 176, 200, 195, 220, 17, 1, 210, 187, 248, 203, 220, 17, 1,
+ 216, 12, 220, 17, 1, 192, 12, 220, 17, 1, 219, 44, 219, 105, 220, 17, 1,
+ 219, 44, 219, 2, 220, 17, 1, 193, 48, 220, 17, 1, 205, 134, 203, 165,
+ 220, 17, 1, 205, 134, 201, 175, 220, 17, 1, 202, 47, 200, 195, 220, 17,
+ 1, 229, 24, 200, 195, 220, 17, 1, 210, 187, 219, 73, 220, 17, 1, 74, 220,
+ 17, 1, 229, 24, 199, 197, 220, 17, 234, 120, 220, 17, 18, 3, 65, 220, 17,
+ 18, 3, 217, 113, 222, 87, 220, 17, 18, 3, 252, 206, 220, 17, 18, 3, 251,
+ 149, 220, 17, 18, 3, 68, 220, 17, 18, 3, 223, 199, 220, 17, 18, 3, 192,
+ 159, 220, 17, 18, 3, 191, 176, 220, 17, 18, 3, 66, 220, 17, 18, 3, 196,
+ 30, 220, 17, 3, 210, 187, 195, 40, 220, 17, 18, 3, 217, 113, 221, 44,
+ 220, 17, 204, 20, 3, 219, 43, 220, 17, 204, 20, 3, 212, 65, 220, 17, 18,
+ 3, 71, 220, 17, 18, 3, 234, 166, 220, 17, 18, 3, 74, 220, 17, 18, 3, 250,
+ 131, 220, 17, 18, 3, 251, 236, 220, 17, 221, 68, 173, 220, 17, 163, 217,
+ 113, 234, 147, 220, 17, 163, 217, 113, 198, 241, 220, 17, 163, 217, 113,
+ 198, 193, 220, 17, 163, 217, 113, 247, 77, 220, 17, 247, 125, 77, 220,
+ 17, 213, 192, 220, 17, 192, 110, 220, 17, 17, 191, 77, 220, 17, 17, 107,
+ 220, 17, 17, 109, 220, 17, 17, 138, 220, 17, 17, 134, 220, 17, 17, 149,
+ 220, 17, 17, 169, 220, 17, 17, 175, 220, 17, 17, 171, 220, 17, 17, 178,
+ 220, 17, 229, 24, 213, 43, 220, 17, 229, 24, 216, 12, 220, 17, 1, 221,
+ 185, 231, 3, 220, 17, 1, 221, 185, 212, 65, 86, 5, 211, 113, 86, 87, 230,
+ 181, 192, 25, 216, 118, 197, 178, 65, 86, 87, 230, 181, 192, 25, 216,
+ 118, 255, 207, 206, 167, 249, 19, 174, 86, 87, 230, 181, 192, 25, 216,
+ 118, 255, 207, 230, 181, 197, 153, 174, 86, 87, 89, 192, 25, 216, 118,
+ 216, 234, 174, 86, 87, 242, 215, 192, 25, 216, 118, 203, 172, 174, 86,
+ 87, 247, 97, 192, 25, 216, 118, 209, 189, 203, 158, 174, 86, 87, 192, 25,
+ 216, 118, 197, 153, 203, 158, 174, 86, 87, 205, 100, 203, 157, 86, 87,
+ 248, 13, 192, 25, 216, 117, 86, 87, 248, 141, 203, 50, 192, 25, 216, 117,
+ 86, 87, 223, 98, 197, 152, 86, 87, 237, 113, 197, 153, 248, 12, 86, 87,
+ 203, 157, 86, 87, 212, 70, 203, 157, 86, 87, 197, 153, 203, 157, 86, 87,
+ 212, 70, 197, 153, 203, 157, 86, 87, 206, 191, 243, 111, 201, 193, 203,
+ 157, 86, 87, 207, 10, 230, 222, 203, 157, 86, 87, 247, 97, 255, 211, 206,
+ 73, 216, 233, 179, 247, 128, 86, 87, 230, 181, 197, 152, 86, 219, 27, 3,
+ 246, 255, 206, 72, 86, 219, 27, 3, 219, 157, 206, 72, 86, 250, 188, 3,
+ 203, 168, 231, 168, 255, 212, 206, 72, 86, 250, 188, 3, 255, 209, 168,
+ 86, 250, 188, 3, 205, 69, 197, 147, 86, 3, 207, 115, 236, 189, 231, 167,
+ 86, 3, 207, 115, 236, 189, 231, 5, 86, 3, 207, 115, 236, 189, 230, 182,
+ 86, 3, 207, 115, 214, 243, 231, 167, 86, 3, 207, 115, 214, 243, 231, 5,
+ 86, 3, 207, 115, 236, 189, 207, 115, 214, 242, 86, 17, 191, 77, 86, 17,
+ 107, 86, 17, 109, 86, 17, 138, 86, 17, 134, 86, 17, 149, 86, 17, 169, 86,
+ 17, 175, 86, 17, 171, 86, 17, 178, 86, 17, 132, 107, 86, 17, 132, 109,
+ 86, 17, 132, 138, 86, 17, 132, 134, 86, 17, 132, 149, 86, 17, 132, 169,
+ 86, 17, 132, 175, 86, 17, 132, 171, 86, 17, 132, 178, 86, 17, 132, 191,
+ 77, 86, 87, 248, 15, 206, 72, 86, 87, 214, 59, 247, 195, 212, 82, 191,
+ 10, 86, 87, 247, 97, 255, 211, 206, 73, 247, 196, 216, 62, 247, 128, 86,
+ 87, 214, 59, 247, 195, 203, 169, 206, 72, 86, 87, 243, 128, 216, 117, 86,
+ 87, 197, 169, 255, 208, 86, 87, 230, 164, 206, 73, 230, 119, 86, 87, 230,
+ 164, 206, 73, 230, 125, 86, 87, 251, 123, 221, 202, 230, 119, 86, 87,
+ 251, 123, 221, 202, 230, 125, 86, 3, 192, 102, 197, 151, 86, 3, 217, 66,
+ 197, 151, 86, 1, 155, 86, 1, 221, 215, 86, 1, 231, 240, 86, 1, 231, 91,
+ 86, 1, 214, 68, 86, 1, 247, 160, 86, 1, 247, 1, 86, 1, 223, 32, 86, 1,
+ 212, 101, 86, 1, 197, 132, 86, 1, 197, 120, 86, 1, 237, 191, 86, 1, 237,
+ 175, 86, 1, 213, 79, 86, 1, 190, 190, 86, 1, 199, 49, 86, 1, 238, 32, 86,
+ 1, 237, 68, 86, 1, 180, 86, 1, 168, 86, 1, 209, 228, 86, 1, 249, 153, 86,
+ 1, 248, 203, 86, 1, 174, 86, 1, 197, 168, 86, 1, 197, 157, 86, 1, 235,
+ 35, 86, 1, 235, 29, 86, 1, 193, 190, 86, 1, 191, 71, 86, 1, 191, 123, 86,
+ 1, 255, 214, 86, 1, 170, 86, 1, 165, 86, 1, 173, 86, 1, 203, 165, 86, 1,
+ 201, 175, 86, 1, 188, 86, 1, 140, 86, 1, 65, 86, 1, 220, 246, 86, 1, 232,
+ 221, 165, 86, 1, 221, 101, 86, 1, 206, 109, 86, 18, 3, 252, 206, 86, 18,
+ 3, 68, 86, 18, 3, 223, 199, 86, 18, 3, 66, 86, 18, 3, 196, 30, 86, 18, 3,
+ 117, 146, 86, 18, 3, 117, 206, 110, 86, 18, 3, 117, 172, 86, 18, 3, 117,
+ 219, 74, 86, 18, 3, 71, 86, 18, 3, 234, 188, 86, 18, 3, 74, 86, 18, 3,
+ 211, 87, 86, 3, 206, 173, 201, 5, 214, 69, 206, 162, 86, 3, 206, 167,
+ 249, 18, 86, 18, 3, 207, 18, 68, 86, 18, 3, 207, 18, 223, 199, 86, 3,
+ 212, 82, 191, 11, 214, 251, 238, 32, 86, 3, 202, 61, 219, 240, 86, 87,
+ 230, 72, 86, 87, 210, 178, 86, 3, 219, 243, 206, 72, 86, 3, 192, 107,
+ 206, 72, 86, 3, 219, 244, 197, 169, 247, 128, 86, 3, 216, 236, 247, 128,
+ 86, 3, 230, 185, 247, 129, 207, 8, 86, 3, 230, 185, 216, 220, 207, 8, 86,
+ 3, 223, 93, 216, 236, 247, 128, 86, 200, 239, 3, 219, 244, 197, 169, 247,
+ 128, 86, 200, 239, 3, 216, 236, 247, 128, 86, 200, 239, 3, 223, 93, 216,
+ 236, 247, 128, 86, 200, 239, 1, 155, 86, 200, 239, 1, 221, 215, 86, 200,
+ 239, 1, 231, 240, 86, 200, 239, 1, 231, 91, 86, 200, 239, 1, 214, 68, 86,
+ 200, 239, 1, 247, 160, 86, 200, 239, 1, 247, 1, 86, 200, 239, 1, 223, 32,
+ 86, 200, 239, 1, 212, 101, 86, 200, 239, 1, 197, 132, 86, 200, 239, 1,
+ 197, 120, 86, 200, 239, 1, 237, 191, 86, 200, 239, 1, 237, 175, 86, 200,
+ 239, 1, 213, 79, 86, 200, 239, 1, 190, 190, 86, 200, 239, 1, 199, 49, 86,
+ 200, 239, 1, 238, 32, 86, 200, 239, 1, 237, 68, 86, 200, 239, 1, 180, 86,
+ 200, 239, 1, 168, 86, 200, 239, 1, 209, 228, 86, 200, 239, 1, 249, 153,
+ 86, 200, 239, 1, 248, 203, 86, 200, 239, 1, 174, 86, 200, 239, 1, 197,
+ 168, 86, 200, 239, 1, 197, 157, 86, 200, 239, 1, 235, 35, 86, 200, 239,
+ 1, 235, 29, 86, 200, 239, 1, 193, 190, 86, 200, 239, 1, 191, 71, 86, 200,
+ 239, 1, 191, 123, 86, 200, 239, 1, 255, 214, 86, 200, 239, 1, 170, 86,
+ 200, 239, 1, 165, 86, 200, 239, 1, 173, 86, 200, 239, 1, 203, 165, 86,
+ 200, 239, 1, 201, 175, 86, 200, 239, 1, 188, 86, 200, 239, 1, 140, 86,
+ 200, 239, 1, 65, 86, 200, 239, 1, 220, 246, 86, 200, 239, 1, 232, 221,
+ 193, 190, 86, 200, 239, 1, 232, 221, 170, 86, 200, 239, 1, 232, 221, 165,
+ 86, 220, 233, 206, 69, 221, 215, 86, 220, 233, 206, 69, 221, 216, 247,
+ 196, 216, 62, 247, 128, 86, 247, 112, 3, 88, 249, 7, 86, 247, 112, 3,
+ 156, 249, 7, 86, 247, 112, 3, 247, 116, 199, 135, 86, 247, 112, 3, 205,
+ 99, 255, 213, 86, 16, 235, 105, 248, 10, 86, 16, 207, 114, 206, 174, 86,
+ 16, 210, 206, 231, 166, 86, 16, 207, 114, 206, 175, 207, 10, 230, 221,
+ 86, 16, 209, 189, 168, 86, 16, 213, 21, 248, 10, 86, 16, 213, 21, 248,
+ 11, 212, 70, 255, 210, 86, 16, 213, 21, 248, 11, 230, 183, 255, 210, 86,
+ 16, 213, 21, 248, 11, 247, 196, 255, 210, 86, 3, 207, 115, 214, 243, 207,
+ 115, 236, 188, 86, 3, 207, 115, 214, 243, 230, 182, 86, 87, 248, 14, 203,
+ 50, 231, 54, 216, 118, 207, 9, 86, 87, 216, 14, 192, 25, 231, 54, 216,
+ 118, 207, 9, 86, 87, 212, 70, 197, 152, 86, 87, 89, 248, 44, 206, 164,
+ 192, 25, 216, 118, 216, 234, 174, 86, 87, 242, 215, 248, 44, 206, 164,
+ 192, 25, 216, 118, 203, 172, 174, 206, 207, 200, 155, 56, 219, 223, 200,
+ 155, 56, 206, 207, 200, 155, 3, 4, 236, 138, 219, 223, 200, 155, 3, 4,
+ 236, 138, 86, 87, 219, 235, 216, 237, 206, 72, 86, 87, 198, 18, 216, 237,
+ 206, 72, 80, 1, 155, 80, 1, 221, 215, 80, 1, 231, 240, 80, 1, 231, 91,
+ 80, 1, 214, 68, 80, 1, 247, 160, 80, 1, 247, 1, 80, 1, 223, 32, 80, 1,
+ 222, 252, 80, 1, 212, 101, 80, 1, 213, 45, 80, 1, 197, 132, 80, 1, 197,
+ 120, 80, 1, 237, 191, 80, 1, 237, 175, 80, 1, 213, 79, 80, 1, 190, 190,
+ 80, 1, 199, 49, 80, 1, 238, 32, 80, 1, 237, 68, 80, 1, 180, 80, 1, 168,
+ 80, 1, 209, 228, 80, 1, 249, 153, 80, 1, 248, 203, 80, 1, 174, 80, 1,
+ 170, 80, 1, 165, 80, 1, 173, 80, 1, 193, 190, 80, 1, 188, 80, 1, 140, 80,
+ 1, 219, 73, 80, 1, 65, 80, 1, 203, 139, 65, 80, 1, 68, 80, 1, 223, 199,
+ 80, 1, 66, 80, 1, 196, 30, 80, 1, 71, 80, 1, 215, 232, 71, 80, 1, 74, 80,
+ 1, 250, 163, 80, 18, 3, 199, 200, 252, 206, 80, 18, 3, 252, 206, 80, 18,
+ 3, 68, 80, 18, 3, 223, 199, 80, 18, 3, 66, 80, 18, 3, 196, 30, 80, 18, 3,
+ 71, 80, 18, 3, 251, 236, 80, 18, 3, 215, 232, 223, 199, 80, 18, 3, 215,
+ 232, 74, 80, 18, 3, 235, 15, 58, 80, 3, 251, 71, 80, 3, 75, 60, 80, 3,
+ 195, 35, 80, 3, 195, 40, 80, 3, 250, 214, 80, 120, 3, 216, 217, 170, 80,
+ 120, 3, 216, 217, 165, 80, 120, 3, 216, 217, 193, 190, 80, 120, 3, 216,
+ 217, 140, 80, 1, 230, 206, 188, 80, 17, 191, 77, 80, 17, 107, 80, 17,
+ 109, 80, 17, 138, 80, 17, 134, 80, 17, 149, 80, 17, 169, 80, 17, 175, 80,
+ 17, 171, 80, 17, 178, 80, 3, 219, 83, 205, 53, 80, 3, 205, 53, 80, 16,
+ 219, 36, 80, 16, 242, 67, 80, 16, 252, 1, 80, 16, 231, 146, 80, 1, 203,
+ 165, 80, 1, 201, 175, 80, 1, 117, 146, 80, 1, 117, 206, 110, 80, 1, 117,
+ 172, 80, 1, 117, 219, 74, 80, 18, 3, 117, 146, 80, 18, 3, 117, 206, 110,
+ 80, 18, 3, 117, 172, 80, 18, 3, 117, 219, 74, 80, 1, 215, 232, 214, 68,
+ 80, 1, 215, 232, 222, 252, 80, 1, 215, 232, 249, 53, 80, 1, 215, 232,
+ 249, 48, 80, 120, 3, 215, 232, 216, 217, 180, 80, 120, 3, 215, 232, 216,
+ 217, 174, 80, 120, 3, 215, 232, 216, 217, 173, 80, 1, 203, 171, 222, 62,
+ 203, 165, 80, 18, 3, 203, 171, 222, 62, 233, 242, 80, 163, 87, 203, 171,
+ 222, 62, 230, 5, 80, 163, 87, 203, 171, 222, 62, 222, 23, 209, 199, 80,
+ 1, 193, 102, 208, 116, 222, 62, 199, 49, 80, 1, 193, 102, 208, 116, 222,
+ 62, 208, 122, 80, 18, 3, 193, 102, 208, 116, 222, 62, 233, 242, 80, 18,
+ 3, 193, 102, 208, 116, 222, 62, 196, 152, 80, 3, 193, 102, 208, 116, 222,
+ 62, 198, 78, 80, 3, 193, 102, 208, 116, 222, 62, 198, 77, 80, 3, 193,
+ 102, 208, 116, 222, 62, 198, 76, 80, 3, 193, 102, 208, 116, 222, 62, 198,
+ 75, 80, 3, 193, 102, 208, 116, 222, 62, 198, 74, 80, 1, 234, 202, 208,
+ 116, 222, 62, 213, 79, 80, 1, 234, 202, 208, 116, 222, 62, 191, 183, 80,
+ 1, 234, 202, 208, 116, 222, 62, 231, 56, 80, 18, 3, 231, 161, 222, 62,
+ 68, 80, 18, 3, 222, 28, 211, 151, 80, 18, 3, 222, 28, 66, 80, 18, 3, 222,
+ 28, 234, 188, 80, 1, 203, 139, 155, 80, 1, 203, 139, 221, 215, 80, 1,
+ 203, 139, 231, 240, 80, 1, 203, 139, 247, 160, 80, 1, 203, 139, 191, 123,
+ 80, 1, 203, 139, 212, 101, 80, 1, 203, 139, 238, 32, 80, 1, 203, 139,
+ 180, 80, 1, 203, 139, 209, 228, 80, 1, 203, 139, 233, 109, 80, 1, 203,
+ 139, 249, 153, 80, 1, 203, 139, 199, 49, 80, 1, 203, 139, 140, 80, 120,
+ 3, 203, 139, 216, 217, 193, 190, 80, 18, 3, 203, 139, 252, 206, 80, 18,
+ 3, 203, 139, 71, 80, 18, 3, 203, 139, 235, 15, 58, 80, 18, 3, 203, 139,
+ 53, 192, 159, 80, 3, 203, 139, 198, 77, 80, 3, 203, 139, 198, 76, 80, 3,
+ 203, 139, 198, 74, 80, 3, 203, 139, 198, 73, 80, 3, 203, 139, 238, 247,
+ 198, 77, 80, 3, 203, 139, 238, 247, 198, 76, 80, 3, 203, 139, 238, 247,
+ 234, 106, 198, 79, 80, 1, 206, 47, 210, 189, 233, 109, 80, 3, 206, 47,
+ 210, 189, 198, 74, 80, 203, 139, 17, 191, 77, 80, 203, 139, 17, 107, 80,
+ 203, 139, 17, 109, 80, 203, 139, 17, 138, 80, 203, 139, 17, 134, 80, 203,
+ 139, 17, 149, 80, 203, 139, 17, 169, 80, 203, 139, 17, 175, 80, 203, 139,
+ 17, 171, 80, 203, 139, 17, 178, 80, 3, 221, 206, 198, 78, 80, 3, 221,
+ 206, 198, 76, 80, 18, 3, 251, 222, 65, 80, 18, 3, 251, 222, 251, 236, 80,
+ 16, 203, 139, 107, 80, 16, 203, 139, 233, 215, 101, 6, 1, 251, 132, 101,
+ 6, 1, 249, 101, 101, 6, 1, 231, 210, 101, 6, 1, 236, 150, 101, 6, 1, 234,
+ 103, 101, 6, 1, 195, 49, 101, 6, 1, 191, 80, 101, 6, 1, 199, 193, 101, 6,
+ 1, 223, 162, 101, 6, 1, 222, 87, 101, 6, 1, 220, 7, 101, 6, 1, 217, 90,
+ 101, 6, 1, 214, 216, 101, 6, 1, 211, 104, 101, 6, 1, 210, 131, 101, 6, 1,
+ 191, 67, 101, 6, 1, 207, 163, 101, 6, 1, 205, 142, 101, 6, 1, 199, 179,
+ 101, 6, 1, 196, 113, 101, 6, 1, 209, 220, 101, 6, 1, 221, 200, 101, 6, 1,
+ 231, 82, 101, 6, 1, 208, 81, 101, 6, 1, 203, 69, 101, 6, 1, 243, 81, 101,
+ 6, 1, 247, 128, 101, 6, 1, 222, 234, 101, 6, 1, 243, 18, 101, 6, 1, 246,
+ 241, 101, 6, 1, 192, 218, 101, 6, 1, 222, 249, 101, 6, 1, 230, 87, 101,
+ 6, 1, 229, 245, 101, 6, 1, 229, 145, 101, 6, 1, 193, 125, 101, 6, 1, 230,
+ 19, 101, 6, 1, 229, 11, 101, 6, 1, 192, 14, 101, 6, 1, 252, 14, 101, 1,
+ 251, 132, 101, 1, 249, 101, 101, 1, 231, 210, 101, 1, 236, 150, 101, 1,
+ 234, 103, 101, 1, 195, 49, 101, 1, 191, 80, 101, 1, 199, 193, 101, 1,
+ 223, 162, 101, 1, 222, 87, 101, 1, 220, 7, 101, 1, 217, 90, 101, 1, 214,
+ 216, 101, 1, 211, 104, 101, 1, 210, 131, 101, 1, 191, 67, 101, 1, 207,
+ 163, 101, 1, 205, 142, 101, 1, 199, 179, 101, 1, 196, 113, 101, 1, 209,
+ 220, 101, 1, 221, 200, 101, 1, 231, 82, 101, 1, 208, 81, 101, 1, 203, 69,
+ 101, 1, 243, 81, 101, 1, 247, 128, 101, 1, 222, 234, 101, 1, 243, 18,
+ 101, 1, 246, 241, 101, 1, 192, 218, 101, 1, 222, 249, 101, 1, 230, 87,
+ 101, 1, 229, 245, 101, 1, 229, 145, 101, 1, 193, 125, 101, 1, 230, 19,
+ 101, 1, 229, 11, 101, 1, 233, 23, 101, 1, 192, 14, 101, 1, 234, 123, 101,
+ 1, 153, 231, 210, 101, 1, 251, 230, 101, 210, 128, 204, 10, 52, 1, 101,
+ 214, 216, 101, 1, 252, 14, 101, 1, 230, 17, 56, 101, 1, 220, 116, 56, 30,
+ 147, 221, 113, 30, 147, 201, 167, 30, 147, 213, 204, 30, 147, 198, 168,
+ 30, 147, 201, 156, 30, 147, 206, 239, 30, 147, 216, 77, 30, 147, 209,
+ 169, 30, 147, 201, 164, 30, 147, 202, 160, 30, 147, 201, 161, 30, 147,
+ 223, 222, 30, 147, 243, 24, 30, 147, 201, 171, 30, 147, 243, 91, 30, 147,
+ 221, 188, 30, 147, 199, 7, 30, 147, 209, 209, 30, 147, 229, 142, 30, 147,
+ 213, 200, 30, 147, 201, 165, 30, 147, 213, 194, 30, 147, 213, 198, 30,
+ 147, 198, 165, 30, 147, 206, 227, 30, 147, 201, 163, 30, 147, 206, 237,
+ 30, 147, 222, 68, 30, 147, 216, 70, 30, 147, 222, 71, 30, 147, 209, 164,
+ 30, 147, 209, 162, 30, 147, 209, 150, 30, 147, 209, 158, 30, 147, 209,
+ 156, 30, 147, 209, 153, 30, 147, 209, 155, 30, 147, 209, 152, 30, 147,
+ 209, 157, 30, 147, 209, 167, 30, 147, 209, 168, 30, 147, 209, 151, 30,
+ 147, 209, 161, 30, 147, 222, 69, 30, 147, 222, 67, 30, 147, 202, 153, 30,
+ 147, 202, 151, 30, 147, 202, 143, 30, 147, 202, 146, 30, 147, 202, 152,
+ 30, 147, 202, 148, 30, 147, 202, 147, 30, 147, 202, 145, 30, 147, 202,
+ 156, 30, 147, 202, 158, 30, 147, 202, 159, 30, 147, 202, 154, 30, 147,
+ 202, 144, 30, 147, 202, 149, 30, 147, 202, 157, 30, 147, 243, 72, 30,
+ 147, 243, 70, 30, 147, 247, 14, 30, 147, 247, 12, 30, 147, 210, 149, 30,
+ 147, 223, 217, 30, 147, 223, 208, 30, 147, 223, 216, 30, 147, 223, 213,
+ 30, 147, 223, 211, 30, 147, 223, 215, 30, 147, 201, 168, 30, 147, 223,
+ 220, 30, 147, 223, 221, 30, 147, 223, 209, 30, 147, 223, 214, 30, 147,
+ 192, 57, 30, 147, 243, 23, 30, 147, 243, 73, 30, 147, 243, 71, 30, 147,
+ 247, 15, 30, 147, 247, 13, 30, 147, 243, 89, 30, 147, 243, 90, 30, 147,
+ 243, 74, 30, 147, 247, 16, 30, 147, 209, 207, 30, 147, 222, 70, 30, 147,
+ 201, 169, 30, 147, 192, 63, 30, 147, 221, 104, 30, 147, 213, 196, 30,
+ 147, 213, 202, 30, 147, 213, 201, 30, 147, 198, 162, 30, 147, 233, 3, 30,
+ 222, 174, 233, 3, 30, 222, 174, 65, 30, 222, 174, 252, 25, 30, 222, 174,
+ 170, 30, 222, 174, 192, 129, 30, 222, 174, 234, 65, 30, 222, 174, 71, 30,
+ 222, 174, 192, 67, 30, 222, 174, 192, 80, 30, 222, 174, 74, 30, 222, 174,
+ 193, 190, 30, 222, 174, 193, 176, 30, 222, 174, 211, 151, 30, 222, 174,
+ 192, 12, 30, 222, 174, 66, 30, 222, 174, 193, 107, 30, 222, 174, 193,
+ 125, 30, 222, 174, 193, 86, 30, 222, 174, 191, 225, 30, 222, 174, 233,
+ 242, 30, 222, 174, 192, 33, 30, 222, 174, 68, 30, 222, 174, 255, 202, 30,
+ 222, 174, 255, 201, 30, 222, 174, 192, 143, 30, 222, 174, 192, 141, 30,
+ 222, 174, 234, 63, 30, 222, 174, 234, 62, 30, 222, 174, 234, 64, 30, 222,
+ 174, 192, 66, 30, 222, 174, 192, 65, 30, 222, 174, 212, 10, 30, 222, 174,
+ 212, 11, 30, 222, 174, 212, 4, 30, 222, 174, 212, 9, 30, 222, 174, 212,
+ 7, 30, 222, 174, 192, 0, 30, 222, 174, 191, 255, 30, 222, 174, 191, 254,
+ 30, 222, 174, 192, 1, 30, 222, 174, 192, 2, 30, 222, 174, 196, 226, 30,
+ 222, 174, 196, 225, 30, 222, 174, 196, 223, 30, 222, 174, 196, 219, 30,
+ 222, 174, 196, 220, 30, 222, 174, 191, 220, 30, 222, 174, 191, 217, 30,
+ 222, 174, 191, 218, 30, 222, 174, 191, 212, 30, 222, 174, 191, 213, 30,
+ 222, 174, 191, 214, 30, 222, 174, 191, 216, 30, 222, 174, 233, 236, 30,
+ 222, 174, 233, 238, 30, 222, 174, 192, 32, 30, 222, 174, 228, 69, 30,
+ 222, 174, 228, 61, 30, 222, 174, 228, 64, 30, 222, 174, 228, 62, 30, 222,
+ 174, 228, 66, 30, 222, 174, 228, 68, 30, 222, 174, 251, 25, 30, 222, 174,
+ 251, 22, 30, 222, 174, 251, 20, 30, 222, 174, 251, 21, 30, 222, 174, 201,
+ 172, 30, 222, 174, 255, 203, 30, 222, 174, 192, 142, 30, 222, 174, 192,
+ 64, 30, 222, 174, 212, 6, 30, 222, 174, 212, 5, 30, 125, 221, 113, 30,
+ 125, 201, 167, 30, 125, 221, 106, 30, 125, 213, 204, 30, 125, 213, 202,
+ 30, 125, 213, 201, 30, 125, 198, 168, 30, 125, 206, 239, 30, 125, 206,
+ 234, 30, 125, 206, 231, 30, 125, 206, 224, 30, 125, 206, 219, 30, 125,
+ 206, 214, 30, 125, 206, 225, 30, 125, 206, 237, 30, 125, 216, 77, 30,
+ 125, 209, 169, 30, 125, 209, 158, 30, 125, 202, 160, 30, 125, 201, 161,
+ 30, 125, 223, 222, 30, 125, 243, 24, 30, 125, 243, 91, 30, 125, 221, 188,
+ 30, 125, 199, 7, 30, 125, 209, 209, 30, 125, 229, 142, 30, 125, 221, 107,
+ 30, 125, 221, 105, 30, 125, 213, 200, 30, 125, 213, 194, 30, 125, 213,
+ 196, 30, 125, 213, 199, 30, 125, 213, 195, 30, 125, 198, 165, 30, 125,
+ 198, 162, 30, 125, 206, 232, 30, 125, 206, 227, 30, 125, 206, 213, 30,
+ 125, 206, 212, 30, 125, 201, 163, 30, 125, 206, 229, 30, 125, 206, 228,
+ 30, 125, 206, 221, 30, 125, 206, 223, 30, 125, 206, 236, 30, 125, 206,
+ 216, 30, 125, 206, 226, 30, 125, 206, 235, 30, 125, 206, 211, 30, 125,
+ 216, 73, 30, 125, 216, 68, 30, 125, 216, 70, 30, 125, 216, 67, 30, 125,
+ 216, 65, 30, 125, 216, 71, 30, 125, 216, 76, 30, 125, 216, 74, 30, 125,
+ 222, 71, 30, 125, 209, 160, 30, 125, 209, 161, 30, 125, 209, 166, 30,
+ 125, 222, 69, 30, 125, 202, 153, 30, 125, 202, 143, 30, 125, 202, 146,
+ 30, 125, 202, 148, 30, 125, 210, 149, 30, 125, 223, 217, 30, 125, 223,
+ 210, 30, 125, 201, 168, 30, 125, 223, 218, 30, 125, 192, 57, 30, 125,
+ 192, 51, 30, 125, 192, 52, 30, 125, 209, 207, 30, 125, 222, 70, 30, 125,
+ 229, 140, 30, 125, 229, 138, 30, 125, 229, 141, 30, 125, 229, 139, 30,
+ 125, 192, 63, 30, 125, 221, 109, 30, 125, 221, 108, 30, 125, 221, 112,
+ 30, 125, 221, 110, 30, 125, 221, 111, 30, 125, 201, 165, 36, 5, 140, 36,
+ 5, 228, 159, 36, 5, 229, 158, 36, 5, 230, 91, 36, 5, 229, 215, 36, 5,
+ 229, 245, 36, 5, 229, 23, 36, 5, 229, 14, 36, 5, 173, 36, 5, 218, 225,
+ 36, 5, 219, 146, 36, 5, 220, 125, 36, 5, 219, 228, 36, 5, 219, 238, 36,
+ 5, 219, 43, 36, 5, 218, 191, 36, 5, 229, 177, 36, 5, 229, 171, 36, 5,
+ 229, 173, 36, 5, 229, 176, 36, 5, 229, 174, 36, 5, 229, 175, 36, 5, 229,
+ 172, 36, 5, 229, 170, 36, 5, 174, 36, 5, 215, 155, 36, 5, 216, 100, 36,
+ 5, 217, 151, 36, 5, 216, 211, 36, 5, 216, 232, 36, 5, 216, 12, 36, 5,
+ 215, 80, 36, 5, 200, 54, 36, 5, 200, 48, 36, 5, 200, 50, 36, 5, 200, 53,
+ 36, 5, 200, 51, 36, 5, 200, 52, 36, 5, 200, 49, 36, 5, 200, 47, 36, 5,
+ 165, 36, 5, 206, 68, 36, 5, 207, 1, 36, 5, 207, 178, 36, 5, 207, 84, 36,
+ 5, 207, 113, 36, 5, 206, 162, 36, 5, 206, 26, 36, 5, 188, 36, 5, 201, 4,
+ 36, 5, 202, 222, 36, 5, 205, 197, 36, 5, 205, 50, 36, 5, 205, 68, 36, 5,
+ 202, 46, 36, 5, 200, 150, 36, 5, 203, 165, 36, 5, 203, 5, 36, 5, 203, 81,
+ 36, 5, 203, 160, 36, 5, 203, 111, 36, 5, 203, 113, 36, 5, 203, 56, 36, 5,
+ 202, 240, 36, 5, 208, 96, 36, 5, 208, 33, 36, 5, 208, 57, 36, 5, 208, 95,
+ 36, 5, 208, 74, 36, 5, 208, 75, 36, 5, 208, 45, 36, 5, 208, 44, 36, 5,
+ 207, 240, 36, 5, 207, 236, 36, 5, 207, 239, 36, 5, 207, 237, 36, 5, 207,
+ 238, 36, 5, 208, 71, 36, 5, 208, 63, 36, 5, 208, 66, 36, 5, 208, 70, 36,
+ 5, 208, 67, 36, 5, 208, 68, 36, 5, 208, 65, 36, 5, 208, 62, 36, 5, 208,
+ 58, 36, 5, 208, 61, 36, 5, 208, 59, 36, 5, 208, 60, 36, 5, 249, 153, 36,
+ 5, 248, 10, 36, 5, 248, 188, 36, 5, 249, 151, 36, 5, 249, 1, 36, 5, 249,
+ 17, 36, 5, 248, 111, 36, 5, 247, 210, 36, 5, 195, 188, 36, 5, 193, 249,
+ 36, 5, 195, 69, 36, 5, 195, 187, 36, 5, 195, 148, 36, 5, 195, 153, 36, 5,
+ 195, 24, 36, 5, 193, 238, 36, 5, 190, 190, 36, 5, 197, 94, 36, 5, 198,
+ 193, 36, 5, 199, 245, 36, 5, 199, 121, 36, 5, 199, 145, 36, 5, 159, 36,
+ 5, 197, 43, 36, 5, 247, 160, 36, 5, 238, 195, 36, 5, 243, 29, 36, 5, 247,
+ 159, 36, 5, 247, 34, 36, 5, 247, 42, 36, 5, 242, 99, 36, 5, 238, 151, 36,
+ 5, 192, 220, 36, 5, 192, 188, 36, 5, 192, 207, 36, 5, 192, 219, 36, 5,
+ 192, 213, 36, 5, 192, 214, 36, 5, 192, 196, 36, 5, 192, 195, 36, 5, 192,
+ 181, 36, 5, 192, 177, 36, 5, 192, 180, 36, 5, 192, 178, 36, 5, 192, 179,
+ 36, 5, 180, 36, 5, 212, 178, 36, 5, 213, 219, 36, 5, 214, 250, 36, 5,
+ 214, 110, 36, 5, 214, 121, 36, 5, 213, 43, 36, 5, 212, 110, 36, 5, 212,
+ 101, 36, 5, 212, 58, 36, 5, 212, 81, 36, 5, 212, 100, 36, 5, 212, 89, 36,
+ 5, 212, 90, 36, 5, 212, 65, 36, 5, 212, 48, 36, 5, 231, 11, 65, 36, 5,
+ 231, 11, 66, 36, 5, 231, 11, 68, 36, 5, 231, 11, 252, 206, 36, 5, 231,
+ 11, 234, 188, 36, 5, 231, 11, 71, 36, 5, 231, 11, 74, 36, 5, 231, 11,
+ 193, 190, 36, 5, 155, 36, 5, 220, 232, 36, 5, 221, 166, 36, 5, 222, 127,
+ 36, 5, 222, 13, 36, 5, 222, 22, 36, 5, 221, 67, 36, 5, 221, 62, 36, 5,
+ 220, 179, 36, 5, 220, 172, 36, 5, 220, 178, 36, 5, 220, 173, 36, 5, 220,
+ 174, 36, 5, 220, 165, 36, 5, 220, 159, 36, 5, 220, 161, 36, 5, 220, 164,
+ 36, 5, 220, 162, 36, 5, 220, 163, 36, 5, 220, 160, 36, 5, 220, 158, 36,
+ 5, 220, 154, 36, 5, 220, 157, 36, 5, 220, 155, 36, 5, 220, 156, 36, 5,
+ 193, 190, 36, 5, 193, 0, 36, 5, 193, 86, 36, 5, 193, 181, 36, 5, 193,
+ 114, 36, 5, 193, 125, 36, 5, 193, 48, 36, 5, 193, 40, 36, 5, 209, 219,
+ 65, 36, 5, 209, 219, 66, 36, 5, 209, 219, 68, 36, 5, 209, 219, 252, 206,
+ 36, 5, 209, 219, 234, 188, 36, 5, 209, 219, 71, 36, 5, 209, 219, 74, 36,
+ 5, 191, 123, 36, 5, 190, 251, 36, 5, 191, 30, 36, 5, 191, 121, 36, 5,
+ 191, 84, 36, 5, 191, 87, 36, 5, 191, 7, 36, 5, 190, 238, 36, 5, 191, 71,
+ 36, 5, 191, 48, 36, 5, 191, 57, 36, 5, 191, 70, 36, 5, 191, 61, 36, 5,
+ 191, 62, 36, 5, 191, 54, 36, 5, 191, 39, 36, 5, 170, 36, 5, 191, 225, 36,
+ 5, 192, 33, 36, 5, 192, 140, 36, 5, 192, 77, 36, 5, 192, 80, 36, 5, 192,
+ 12, 36, 5, 191, 252, 36, 5, 238, 32, 36, 5, 235, 89, 36, 5, 237, 44, 36,
+ 5, 238, 31, 36, 5, 237, 131, 36, 5, 237, 146, 36, 5, 236, 174, 36, 5,
+ 235, 46, 36, 5, 237, 191, 36, 5, 237, 156, 36, 5, 237, 168, 36, 5, 237,
+ 190, 36, 5, 237, 178, 36, 5, 237, 179, 36, 5, 237, 161, 36, 5, 237, 147,
+ 36, 5, 223, 32, 36, 5, 222, 182, 36, 5, 222, 244, 36, 5, 223, 31, 36, 5,
+ 223, 8, 36, 5, 223, 10, 36, 5, 222, 201, 36, 5, 222, 160, 36, 5, 231,
+ 240, 36, 5, 230, 179, 36, 5, 231, 53, 36, 5, 231, 237, 36, 5, 231, 157,
+ 36, 5, 231, 165, 36, 5, 231, 3, 36, 5, 231, 2, 36, 5, 230, 135, 36, 5,
+ 230, 131, 36, 5, 230, 134, 36, 5, 230, 132, 36, 5, 230, 133, 36, 5, 231,
+ 127, 36, 5, 231, 107, 36, 5, 231, 117, 36, 5, 231, 126, 36, 5, 231, 121,
+ 36, 5, 231, 122, 36, 5, 231, 111, 36, 5, 231, 96, 36, 5, 199, 49, 36, 5,
+ 198, 213, 36, 5, 199, 11, 36, 5, 199, 48, 36, 5, 199, 31, 36, 5, 199, 33,
+ 36, 5, 198, 241, 36, 5, 198, 204, 36, 5, 247, 1, 36, 5, 243, 48, 36, 5,
+ 243, 95, 36, 5, 247, 0, 36, 5, 243, 123, 36, 5, 243, 127, 36, 5, 243, 68,
+ 36, 5, 243, 37, 36, 5, 209, 228, 36, 5, 209, 191, 36, 5, 209, 211, 36, 5,
+ 209, 227, 36, 5, 209, 213, 36, 5, 209, 214, 36, 5, 209, 199, 36, 5, 209,
+ 187, 36, 5, 197, 168, 36, 5, 197, 140, 36, 5, 197, 146, 36, 5, 197, 167,
+ 36, 5, 197, 160, 36, 5, 197, 161, 36, 5, 197, 144, 36, 5, 197, 138, 36,
+ 5, 196, 240, 36, 5, 196, 232, 36, 5, 196, 236, 36, 5, 196, 239, 36, 5,
+ 196, 237, 36, 5, 196, 238, 36, 5, 196, 234, 36, 5, 196, 233, 36, 5, 233,
+ 109, 36, 5, 232, 86, 36, 5, 233, 23, 36, 5, 233, 108, 36, 5, 233, 52, 36,
+ 5, 233, 59, 36, 5, 232, 175, 36, 5, 232, 62, 36, 5, 168, 36, 5, 208, 165,
+ 36, 5, 209, 185, 36, 5, 210, 220, 36, 5, 210, 49, 36, 5, 210, 63, 36, 5,
+ 209, 73, 36, 5, 208, 122, 36, 5, 206, 16, 36, 5, 215, 68, 36, 5, 232, 56,
+ 36, 33, 231, 153, 23, 18, 219, 198, 77, 36, 33, 18, 219, 198, 77, 36, 33,
+ 231, 153, 77, 36, 205, 54, 77, 36, 193, 22, 36, 232, 80, 201, 63, 36,
+ 242, 74, 36, 204, 25, 36, 242, 83, 36, 208, 228, 242, 83, 36, 208, 13,
+ 77, 36, 210, 128, 204, 10, 36, 17, 107, 36, 17, 109, 36, 17, 138, 36, 17,
+ 134, 36, 17, 149, 36, 17, 169, 36, 17, 175, 36, 17, 171, 36, 17, 178, 36,
+ 31, 199, 95, 36, 31, 197, 32, 36, 31, 198, 249, 36, 31, 232, 135, 36, 31,
+ 233, 15, 36, 31, 202, 120, 36, 31, 203, 241, 36, 31, 234, 153, 36, 31,
+ 213, 169, 36, 31, 228, 140, 36, 31, 199, 96, 189, 36, 5, 205, 59, 215,
+ 80, 36, 5, 215, 76, 36, 5, 215, 77, 36, 5, 215, 78, 36, 5, 205, 59, 247,
+ 210, 36, 5, 247, 207, 36, 5, 247, 208, 36, 5, 247, 209, 36, 5, 205, 59,
+ 232, 62, 36, 5, 232, 58, 36, 5, 232, 59, 36, 5, 232, 60, 36, 5, 205, 59,
+ 208, 122, 36, 5, 208, 118, 36, 5, 208, 119, 36, 5, 208, 120, 36, 198, 80,
+ 87, 192, 15, 36, 198, 80, 87, 237, 89, 36, 198, 80, 87, 206, 194, 36,
+ 198, 80, 87, 203, 40, 206, 194, 36, 198, 80, 87, 237, 18, 36, 198, 80,
+ 87, 221, 250, 36, 198, 80, 87, 243, 76, 36, 198, 80, 87, 229, 147, 36,
+ 198, 80, 87, 237, 88, 36, 198, 80, 87, 220, 195, 103, 1, 65, 103, 1, 71,
+ 103, 1, 68, 103, 1, 74, 103, 1, 66, 103, 1, 196, 12, 103, 1, 231, 240,
+ 103, 1, 155, 103, 1, 231, 165, 103, 1, 231, 53, 103, 1, 231, 3, 103, 1,
+ 230, 179, 103, 1, 230, 138, 103, 1, 140, 103, 1, 229, 245, 103, 1, 229,
+ 158, 103, 1, 229, 23, 103, 1, 228, 159, 103, 1, 228, 126, 103, 1, 173,
+ 103, 1, 219, 238, 103, 1, 219, 146, 103, 1, 219, 43, 103, 1, 218, 225,
+ 103, 1, 218, 192, 103, 1, 174, 103, 1, 216, 232, 103, 1, 216, 100, 103,
+ 1, 216, 12, 103, 1, 215, 155, 103, 1, 180, 103, 1, 229, 47, 103, 1, 214,
+ 237, 103, 1, 214, 121, 103, 1, 213, 219, 103, 1, 213, 43, 103, 1, 212,
+ 178, 103, 1, 212, 112, 103, 1, 208, 32, 103, 1, 208, 16, 103, 1, 208, 9,
+ 103, 1, 207, 255, 103, 1, 207, 244, 103, 1, 207, 242, 103, 1, 188, 103,
+ 1, 206, 8, 103, 1, 205, 68, 103, 1, 202, 222, 103, 1, 202, 46, 103, 1,
+ 201, 4, 103, 1, 200, 158, 103, 1, 238, 32, 103, 1, 190, 190, 103, 1, 237,
+ 146, 103, 1, 199, 145, 103, 1, 237, 44, 103, 1, 198, 193, 103, 1, 236,
+ 174, 103, 1, 235, 89, 103, 1, 235, 57, 103, 1, 236, 186, 103, 1, 198,
+ 115, 103, 1, 198, 114, 103, 1, 198, 103, 103, 1, 198, 102, 103, 1, 198,
+ 101, 103, 1, 198, 100, 103, 1, 197, 168, 103, 1, 197, 161, 103, 1, 197,
+ 146, 103, 1, 197, 144, 103, 1, 197, 140, 103, 1, 197, 139, 103, 1, 193,
+ 190, 103, 1, 193, 125, 103, 1, 193, 86, 103, 1, 193, 48, 103, 1, 193, 0,
+ 103, 1, 192, 243, 103, 1, 170, 103, 1, 192, 80, 103, 1, 192, 33, 103, 1,
+ 192, 12, 103, 1, 191, 225, 103, 1, 191, 184, 103, 1, 215, 87, 103, 2, 1,
+ 192, 80, 103, 2, 1, 192, 33, 103, 2, 1, 192, 12, 103, 2, 1, 191, 225,
+ 103, 2, 1, 191, 184, 103, 2, 1, 215, 87, 21, 22, 228, 88, 21, 22, 71, 21,
+ 22, 252, 170, 21, 22, 68, 21, 22, 223, 199, 21, 22, 74, 21, 22, 211, 87,
+ 21, 22, 192, 158, 211, 87, 21, 22, 98, 234, 188, 21, 22, 98, 68, 21, 22,
+ 65, 21, 22, 252, 206, 21, 22, 193, 125, 21, 22, 193, 103, 193, 125, 21,
+ 22, 193, 86, 21, 22, 193, 103, 193, 86, 21, 22, 193, 70, 21, 22, 193,
+ 103, 193, 70, 21, 22, 193, 48, 21, 22, 193, 103, 193, 48, 21, 22, 193,
+ 29, 21, 22, 193, 103, 193, 29, 21, 22, 214, 209, 193, 29, 21, 22, 193,
+ 190, 21, 22, 193, 103, 193, 190, 21, 22, 193, 181, 21, 22, 193, 103, 193,
+ 181, 21, 22, 214, 209, 193, 181, 21, 22, 251, 236, 21, 22, 192, 158, 193,
+ 224, 21, 22, 231, 11, 201, 63, 21, 22, 53, 252, 46, 21, 22, 53, 230, 210,
+ 21, 22, 53, 248, 77, 132, 206, 188, 21, 22, 53, 198, 54, 132, 206, 188,
+ 21, 22, 53, 50, 132, 206, 188, 21, 22, 53, 206, 188, 21, 22, 53, 55, 252,
+ 46, 21, 22, 53, 55, 203, 40, 81, 201, 15, 21, 22, 53, 82, 236, 140, 21,
+ 22, 53, 203, 40, 228, 241, 106, 21, 22, 53, 209, 81, 21, 22, 53, 144,
+ 199, 228, 21, 22, 234, 103, 21, 22, 223, 162, 21, 22, 211, 104, 21, 22,
+ 251, 132, 21, 22, 210, 63, 21, 22, 210, 218, 21, 22, 209, 185, 21, 22,
+ 209, 145, 21, 22, 209, 73, 21, 22, 209, 37, 21, 22, 192, 158, 209, 37,
+ 21, 22, 98, 229, 215, 21, 22, 98, 229, 158, 21, 22, 168, 21, 22, 210,
+ 220, 21, 22, 208, 120, 21, 22, 193, 103, 208, 120, 21, 22, 208, 118, 21,
+ 22, 193, 103, 208, 118, 21, 22, 208, 117, 21, 22, 193, 103, 208, 117, 21,
+ 22, 208, 115, 21, 22, 193, 103, 208, 115, 21, 22, 208, 114, 21, 22, 193,
+ 103, 208, 114, 21, 22, 208, 122, 21, 22, 193, 103, 208, 122, 21, 22, 208,
+ 121, 21, 22, 193, 103, 208, 121, 21, 22, 192, 158, 208, 121, 21, 22, 210,
+ 236, 21, 22, 193, 103, 210, 236, 21, 22, 98, 230, 116, 21, 22, 199, 145,
+ 21, 22, 199, 242, 21, 22, 198, 193, 21, 22, 198, 170, 21, 22, 159, 21,
+ 22, 198, 59, 21, 22, 192, 158, 198, 59, 21, 22, 98, 237, 131, 21, 22, 98,
+ 237, 44, 21, 22, 190, 190, 21, 22, 199, 245, 21, 22, 197, 41, 21, 22,
+ 193, 103, 197, 41, 21, 22, 197, 19, 21, 22, 193, 103, 197, 19, 21, 22,
+ 197, 18, 21, 22, 193, 103, 197, 18, 21, 22, 109, 21, 22, 193, 103, 109,
+ 21, 22, 197, 9, 21, 22, 193, 103, 197, 9, 21, 22, 197, 43, 21, 22, 193,
+ 103, 197, 43, 21, 22, 197, 42, 21, 22, 193, 103, 197, 42, 21, 22, 214,
+ 209, 197, 42, 21, 22, 200, 43, 21, 22, 197, 127, 21, 22, 197, 111, 21,
+ 22, 197, 109, 21, 22, 197, 132, 21, 22, 222, 22, 21, 22, 222, 121, 21,
+ 22, 221, 166, 21, 22, 221, 145, 21, 22, 221, 67, 21, 22, 221, 41, 21, 22,
+ 192, 158, 221, 41, 21, 22, 155, 21, 22, 222, 127, 21, 22, 220, 174, 21,
+ 22, 193, 103, 220, 174, 21, 22, 220, 172, 21, 22, 193, 103, 220, 172, 21,
+ 22, 220, 171, 21, 22, 193, 103, 220, 171, 21, 22, 220, 169, 21, 22, 193,
+ 103, 220, 169, 21, 22, 220, 168, 21, 22, 193, 103, 220, 168, 21, 22, 220,
+ 179, 21, 22, 193, 103, 220, 179, 21, 22, 220, 178, 21, 22, 193, 103, 220,
+ 178, 21, 22, 214, 209, 220, 178, 21, 22, 222, 152, 21, 22, 220, 180, 21,
+ 22, 202, 1, 222, 6, 21, 22, 202, 1, 221, 146, 21, 22, 202, 1, 221, 56,
+ 21, 22, 202, 1, 222, 104, 21, 22, 247, 42, 21, 22, 247, 158, 21, 22, 243,
+ 29, 21, 22, 243, 19, 21, 22, 242, 99, 21, 22, 239, 18, 21, 22, 192, 158,
+ 239, 18, 21, 22, 247, 160, 21, 22, 247, 159, 21, 22, 238, 149, 21, 22,
+ 193, 103, 238, 149, 21, 22, 238, 147, 21, 22, 193, 103, 238, 147, 21, 22,
+ 238, 146, 21, 22, 193, 103, 238, 146, 21, 22, 238, 145, 21, 22, 193, 103,
+ 238, 145, 21, 22, 238, 144, 21, 22, 193, 103, 238, 144, 21, 22, 238, 151,
+ 21, 22, 193, 103, 238, 151, 21, 22, 238, 150, 21, 22, 193, 103, 238, 150,
+ 21, 22, 214, 209, 238, 150, 21, 22, 247, 193, 21, 22, 205, 101, 199, 51,
+ 21, 22, 216, 232, 21, 22, 217, 150, 21, 22, 216, 100, 21, 22, 216, 61,
+ 21, 22, 216, 12, 21, 22, 215, 211, 21, 22, 192, 158, 215, 211, 21, 22,
+ 174, 21, 22, 217, 151, 21, 22, 215, 78, 21, 22, 193, 103, 215, 78, 21,
+ 22, 215, 76, 21, 22, 193, 103, 215, 76, 21, 22, 215, 75, 21, 22, 193,
+ 103, 215, 75, 21, 22, 215, 74, 21, 22, 193, 103, 215, 74, 21, 22, 215,
+ 73, 21, 22, 193, 103, 215, 73, 21, 22, 215, 80, 21, 22, 193, 103, 215,
+ 80, 21, 22, 215, 79, 21, 22, 193, 103, 215, 79, 21, 22, 214, 209, 215,
+ 79, 21, 22, 218, 168, 21, 22, 193, 103, 218, 168, 21, 22, 216, 104, 21,
+ 22, 250, 180, 218, 168, 21, 22, 205, 101, 218, 168, 21, 22, 214, 121, 21,
+ 22, 214, 249, 21, 22, 213, 219, 21, 22, 213, 186, 21, 22, 213, 43, 21,
+ 22, 213, 26, 21, 22, 192, 158, 213, 26, 21, 22, 180, 21, 22, 214, 250,
+ 21, 22, 212, 108, 21, 22, 193, 103, 212, 108, 21, 22, 212, 110, 21, 22,
+ 193, 103, 212, 110, 21, 22, 212, 109, 21, 22, 193, 103, 212, 109, 21, 22,
+ 214, 209, 212, 109, 21, 22, 215, 61, 21, 22, 98, 214, 70, 21, 22, 213,
+ 225, 21, 22, 219, 238, 21, 22, 220, 124, 21, 22, 219, 146, 21, 22, 219,
+ 128, 21, 22, 219, 43, 21, 22, 219, 8, 21, 22, 192, 158, 219, 8, 21, 22,
+ 173, 21, 22, 220, 125, 21, 22, 218, 189, 21, 22, 193, 103, 218, 189, 21,
+ 22, 218, 188, 21, 22, 193, 103, 218, 188, 21, 22, 218, 187, 21, 22, 193,
+ 103, 218, 187, 21, 22, 218, 186, 21, 22, 193, 103, 218, 186, 21, 22, 218,
+ 185, 21, 22, 193, 103, 218, 185, 21, 22, 218, 191, 21, 22, 193, 103, 218,
+ 191, 21, 22, 218, 190, 21, 22, 193, 103, 218, 190, 21, 22, 172, 21, 22,
+ 193, 103, 172, 21, 22, 216, 217, 172, 21, 22, 205, 68, 21, 22, 205, 195,
+ 21, 22, 202, 222, 21, 22, 202, 193, 21, 22, 202, 46, 21, 22, 202, 16, 21,
+ 22, 192, 158, 202, 16, 21, 22, 188, 21, 22, 205, 197, 21, 22, 200, 145,
+ 21, 22, 193, 103, 200, 145, 21, 22, 200, 139, 21, 22, 193, 103, 200, 139,
+ 21, 22, 200, 138, 21, 22, 193, 103, 200, 138, 21, 22, 200, 133, 21, 22,
+ 193, 103, 200, 133, 21, 22, 200, 132, 21, 22, 193, 103, 200, 132, 21, 22,
+ 200, 150, 21, 22, 193, 103, 200, 150, 21, 22, 200, 149, 21, 22, 193, 103,
+ 200, 149, 21, 22, 214, 209, 200, 149, 21, 22, 206, 8, 21, 22, 250, 180,
+ 206, 8, 21, 22, 200, 151, 21, 22, 248, 136, 206, 8, 21, 22, 215, 203,
+ 202, 114, 21, 22, 214, 209, 202, 101, 21, 22, 214, 209, 206, 6, 21, 22,
+ 214, 209, 201, 192, 21, 22, 214, 209, 201, 7, 21, 22, 214, 209, 202, 100,
+ 21, 22, 214, 209, 205, 71, 21, 22, 203, 113, 21, 22, 203, 81, 21, 22,
+ 203, 76, 21, 22, 203, 56, 21, 22, 203, 48, 21, 22, 203, 165, 21, 22, 203,
+ 160, 21, 22, 202, 237, 21, 22, 193, 103, 202, 237, 21, 22, 202, 236, 21,
+ 22, 193, 103, 202, 236, 21, 22, 202, 235, 21, 22, 193, 103, 202, 235, 21,
+ 22, 202, 234, 21, 22, 193, 103, 202, 234, 21, 22, 202, 233, 21, 22, 193,
+ 103, 202, 233, 21, 22, 202, 240, 21, 22, 193, 103, 202, 240, 21, 22, 202,
+ 239, 21, 22, 193, 103, 202, 239, 21, 22, 203, 167, 21, 22, 192, 80, 21,
+ 22, 192, 138, 21, 22, 192, 33, 21, 22, 192, 23, 21, 22, 192, 12, 21, 22,
+ 191, 246, 21, 22, 192, 158, 191, 246, 21, 22, 170, 21, 22, 192, 140, 21,
+ 22, 191, 181, 21, 22, 193, 103, 191, 181, 21, 22, 191, 180, 21, 22, 193,
+ 103, 191, 180, 21, 22, 191, 179, 21, 22, 193, 103, 191, 179, 21, 22, 191,
+ 178, 21, 22, 193, 103, 191, 178, 21, 22, 191, 177, 21, 22, 193, 103, 191,
+ 177, 21, 22, 191, 183, 21, 22, 193, 103, 191, 183, 21, 22, 191, 182, 21,
+ 22, 193, 103, 191, 182, 21, 22, 214, 209, 191, 182, 21, 22, 192, 159, 21,
+ 22, 248, 186, 192, 159, 21, 22, 193, 103, 192, 159, 21, 22, 205, 101,
+ 192, 33, 21, 22, 207, 113, 21, 22, 207, 221, 207, 113, 21, 22, 193, 103,
+ 219, 238, 21, 22, 207, 177, 21, 22, 207, 1, 21, 22, 206, 195, 21, 22,
+ 206, 162, 21, 22, 206, 134, 21, 22, 193, 103, 219, 43, 21, 22, 165, 21,
+ 22, 207, 178, 21, 22, 193, 103, 173, 21, 22, 206, 25, 21, 22, 193, 103,
+ 206, 25, 21, 22, 146, 21, 22, 193, 103, 146, 21, 22, 216, 217, 146, 21,
+ 22, 233, 59, 21, 22, 233, 106, 21, 22, 233, 23, 21, 22, 233, 8, 21, 22,
+ 232, 175, 21, 22, 232, 162, 21, 22, 233, 109, 21, 22, 233, 108, 21, 22,
+ 232, 61, 21, 22, 193, 103, 232, 61, 21, 22, 233, 175, 21, 22, 199, 33,
+ 21, 22, 215, 59, 199, 33, 21, 22, 199, 11, 21, 22, 215, 59, 199, 11, 21,
+ 22, 199, 5, 21, 22, 215, 59, 199, 5, 21, 22, 198, 241, 21, 22, 198, 235,
+ 21, 22, 199, 49, 21, 22, 199, 48, 21, 22, 198, 203, 21, 22, 193, 103,
+ 198, 203, 21, 22, 199, 51, 21, 22, 197, 118, 21, 22, 197, 116, 21, 22,
+ 197, 115, 21, 22, 197, 120, 21, 22, 197, 121, 21, 22, 197, 2, 21, 22,
+ 197, 1, 21, 22, 197, 0, 21, 22, 197, 4, 21, 22, 212, 129, 229, 245, 21,
+ 22, 212, 129, 229, 158, 21, 22, 212, 129, 229, 130, 21, 22, 212, 129,
+ 229, 23, 21, 22, 212, 129, 228, 252, 21, 22, 212, 129, 140, 21, 22, 212,
+ 129, 230, 91, 21, 22, 212, 129, 230, 116, 21, 22, 212, 128, 230, 116, 21,
+ 22, 229, 113, 21, 22, 208, 92, 21, 22, 208, 57, 21, 22, 208, 51, 21, 22,
+ 208, 45, 21, 22, 208, 40, 21, 22, 208, 96, 21, 22, 208, 95, 21, 22, 208,
+ 104, 21, 22, 198, 111, 21, 22, 198, 109, 21, 22, 198, 108, 21, 22, 198,
+ 112, 21, 22, 193, 103, 207, 113, 21, 22, 193, 103, 207, 1, 21, 22, 193,
+ 103, 206, 162, 21, 22, 193, 103, 165, 21, 22, 214, 66, 21, 22, 214, 16,
+ 21, 22, 214, 12, 21, 22, 213, 249, 21, 22, 213, 244, 21, 22, 214, 68, 21,
+ 22, 214, 67, 21, 22, 214, 70, 21, 22, 213, 72, 21, 22, 205, 101, 203,
+ 113, 21, 22, 205, 101, 203, 81, 21, 22, 205, 101, 203, 56, 21, 22, 205,
+ 101, 203, 165, 21, 22, 193, 27, 199, 33, 21, 22, 193, 27, 199, 11, 21,
+ 22, 193, 27, 198, 241, 21, 22, 193, 27, 199, 49, 21, 22, 193, 27, 199,
+ 51, 21, 22, 219, 153, 21, 22, 219, 152, 21, 22, 219, 151, 21, 22, 219,
+ 150, 21, 22, 219, 159, 21, 22, 219, 158, 21, 22, 219, 160, 21, 22, 199,
+ 50, 199, 33, 21, 22, 199, 50, 199, 11, 21, 22, 199, 50, 199, 5, 21, 22,
+ 199, 50, 198, 241, 21, 22, 199, 50, 198, 235, 21, 22, 199, 50, 199, 49,
+ 21, 22, 199, 50, 199, 48, 21, 22, 199, 50, 199, 51, 21, 22, 251, 220,
+ 250, 120, 21, 22, 248, 136, 71, 21, 22, 248, 136, 68, 21, 22, 248, 136,
+ 74, 21, 22, 248, 136, 65, 21, 22, 248, 136, 193, 125, 21, 22, 248, 136,
+ 193, 86, 21, 22, 248, 136, 193, 48, 21, 22, 248, 136, 193, 190, 21, 22,
+ 248, 136, 214, 121, 21, 22, 248, 136, 213, 219, 21, 22, 248, 136, 213,
+ 43, 21, 22, 248, 136, 180, 21, 22, 248, 136, 222, 22, 21, 22, 248, 136,
+ 221, 166, 21, 22, 248, 136, 221, 67, 21, 22, 248, 136, 155, 21, 22, 205,
+ 101, 229, 245, 21, 22, 205, 101, 229, 158, 21, 22, 205, 101, 229, 23, 21,
+ 22, 205, 101, 140, 21, 22, 98, 231, 59, 21, 22, 98, 231, 63, 21, 22, 98,
+ 231, 77, 21, 22, 98, 231, 76, 21, 22, 98, 231, 65, 21, 22, 98, 231, 91,
+ 21, 22, 98, 206, 68, 21, 22, 98, 206, 162, 21, 22, 98, 207, 113, 21, 22,
+ 98, 207, 84, 21, 22, 98, 207, 1, 21, 22, 98, 165, 21, 22, 98, 193, 0, 21,
+ 22, 98, 193, 48, 21, 22, 98, 193, 125, 21, 22, 98, 193, 114, 21, 22, 98,
+ 193, 86, 21, 22, 98, 193, 190, 21, 22, 98, 228, 118, 21, 22, 98, 228,
+ 119, 21, 22, 98, 228, 122, 21, 22, 98, 228, 121, 21, 22, 98, 228, 120,
+ 21, 22, 98, 228, 125, 21, 22, 98, 198, 213, 21, 22, 98, 198, 241, 21, 22,
+ 98, 199, 33, 21, 22, 98, 199, 31, 21, 22, 98, 199, 11, 21, 22, 98, 199,
+ 49, 21, 22, 98, 197, 99, 21, 22, 98, 197, 109, 21, 22, 98, 197, 127, 21,
+ 22, 98, 197, 126, 21, 22, 98, 197, 111, 21, 22, 98, 197, 132, 21, 22, 98,
+ 208, 165, 21, 22, 98, 209, 73, 21, 22, 98, 210, 63, 21, 22, 98, 210, 49,
+ 21, 22, 98, 209, 185, 21, 22, 98, 168, 21, 22, 98, 210, 236, 21, 22, 98,
+ 230, 179, 21, 22, 98, 231, 3, 21, 22, 98, 231, 165, 21, 22, 98, 231, 157,
+ 21, 22, 98, 231, 53, 21, 22, 98, 231, 240, 21, 22, 98, 221, 175, 21, 22,
+ 98, 221, 183, 21, 22, 98, 221, 197, 21, 22, 98, 221, 196, 21, 22, 98,
+ 221, 190, 21, 22, 98, 221, 215, 21, 22, 98, 221, 96, 21, 22, 98, 221, 97,
+ 21, 22, 98, 221, 100, 21, 22, 98, 221, 99, 21, 22, 98, 221, 98, 21, 22,
+ 98, 221, 101, 21, 22, 98, 221, 102, 21, 22, 98, 212, 178, 21, 22, 98,
+ 213, 43, 21, 22, 98, 214, 121, 21, 22, 98, 214, 110, 21, 22, 98, 213,
+ 219, 21, 22, 98, 180, 21, 22, 98, 215, 155, 21, 22, 98, 216, 12, 21, 22,
+ 98, 216, 232, 21, 22, 98, 216, 211, 21, 22, 98, 216, 100, 21, 22, 98,
+ 174, 21, 22, 98, 191, 225, 21, 22, 98, 192, 12, 21, 22, 98, 192, 80, 21,
+ 22, 98, 192, 77, 21, 22, 98, 192, 33, 21, 22, 98, 170, 21, 22, 98, 222,
+ 182, 21, 22, 205, 101, 222, 182, 21, 22, 98, 222, 201, 21, 22, 98, 223,
+ 10, 21, 22, 98, 223, 8, 21, 22, 98, 222, 244, 21, 22, 205, 101, 222, 244,
+ 21, 22, 98, 223, 32, 21, 22, 98, 222, 215, 21, 22, 98, 222, 219, 21, 22,
+ 98, 222, 229, 21, 22, 98, 222, 228, 21, 22, 98, 222, 227, 21, 22, 98,
+ 222, 230, 21, 22, 98, 218, 225, 21, 22, 98, 219, 43, 21, 22, 98, 219,
+ 238, 21, 22, 98, 219, 228, 21, 22, 98, 219, 146, 21, 22, 98, 173, 21, 22,
+ 98, 236, 179, 21, 22, 98, 236, 180, 21, 22, 98, 236, 185, 21, 22, 98,
+ 236, 184, 21, 22, 98, 236, 181, 21, 22, 98, 236, 186, 21, 22, 98, 219,
+ 149, 21, 22, 98, 219, 151, 21, 22, 98, 219, 155, 21, 22, 98, 219, 154,
+ 21, 22, 98, 219, 153, 21, 22, 98, 219, 159, 21, 22, 98, 198, 106, 21, 22,
+ 98, 198, 108, 21, 22, 98, 198, 111, 21, 22, 98, 198, 110, 21, 22, 98,
+ 198, 109, 21, 22, 98, 198, 112, 21, 22, 98, 198, 101, 21, 22, 98, 198,
+ 102, 21, 22, 98, 198, 114, 21, 22, 98, 198, 113, 21, 22, 98, 198, 103,
+ 21, 22, 98, 198, 115, 21, 22, 98, 190, 251, 21, 22, 98, 191, 7, 21, 22,
+ 98, 191, 87, 21, 22, 98, 191, 84, 21, 22, 98, 191, 30, 21, 22, 98, 191,
+ 123, 21, 22, 98, 191, 166, 21, 22, 98, 89, 191, 166, 21, 22, 98, 235, 22,
+ 21, 22, 98, 235, 23, 21, 22, 98, 235, 32, 21, 22, 98, 235, 31, 21, 22,
+ 98, 235, 26, 21, 22, 98, 235, 35, 21, 22, 98, 201, 4, 21, 22, 98, 202,
+ 46, 21, 22, 98, 205, 68, 21, 22, 98, 205, 50, 21, 22, 98, 202, 222, 21,
+ 22, 98, 188, 21, 22, 98, 203, 5, 21, 22, 98, 203, 56, 21, 22, 98, 203,
+ 113, 21, 22, 98, 203, 111, 21, 22, 98, 203, 81, 21, 22, 98, 203, 165, 21,
+ 22, 98, 203, 167, 21, 22, 98, 197, 140, 21, 22, 98, 197, 144, 21, 22, 98,
+ 197, 161, 21, 22, 98, 197, 160, 21, 22, 98, 197, 146, 21, 22, 98, 197,
+ 168, 21, 22, 98, 243, 48, 21, 22, 98, 243, 68, 21, 22, 98, 243, 127, 21,
+ 22, 98, 243, 123, 21, 22, 98, 243, 95, 21, 22, 98, 247, 1, 21, 22, 98,
+ 197, 102, 21, 22, 98, 197, 103, 21, 22, 98, 197, 106, 21, 22, 98, 197,
+ 105, 21, 22, 98, 197, 104, 21, 22, 98, 197, 107, 21, 22, 243, 96, 56, 21,
+ 22, 232, 80, 201, 63, 21, 22, 208, 88, 21, 22, 214, 64, 21, 22, 213, 69,
+ 21, 22, 213, 68, 21, 22, 213, 67, 21, 22, 213, 66, 21, 22, 213, 71, 21,
+ 22, 213, 70, 21, 22, 193, 27, 198, 201, 21, 22, 193, 27, 198, 200, 21,
+ 22, 193, 27, 198, 199, 21, 22, 193, 27, 198, 198, 21, 22, 193, 27, 198,
+ 197, 21, 22, 193, 27, 198, 204, 21, 22, 193, 27, 198, 203, 21, 22, 193,
+ 27, 53, 199, 51, 21, 22, 248, 136, 193, 224, 211, 140, 201, 248, 77, 211,
+ 140, 1, 248, 239, 211, 140, 1, 218, 211, 211, 140, 1, 233, 56, 211, 140,
+ 1, 205, 179, 211, 140, 1, 213, 166, 211, 140, 1, 196, 165, 211, 140, 1,
+ 238, 5, 211, 140, 1, 198, 139, 211, 140, 1, 242, 86, 211, 140, 1, 247,
+ 29, 211, 140, 1, 215, 137, 211, 140, 1, 230, 234, 211, 140, 1, 214, 54,
+ 211, 140, 1, 201, 54, 211, 140, 1, 206, 55, 211, 140, 1, 251, 232, 211,
+ 140, 1, 211, 91, 211, 140, 1, 196, 62, 211, 140, 1, 234, 215, 211, 140,
+ 1, 223, 87, 211, 140, 1, 234, 216, 211, 140, 1, 211, 56, 211, 140, 1,
+ 196, 136, 211, 140, 1, 223, 205, 211, 140, 1, 234, 213, 211, 140, 1, 210,
+ 38, 211, 140, 233, 55, 77, 211, 140, 207, 18, 233, 55, 77, 206, 44, 1,
+ 233, 45, 233, 36, 233, 60, 233, 175, 206, 44, 1, 196, 12, 206, 44, 1,
+ 196, 47, 196, 63, 66, 206, 44, 1, 191, 228, 206, 44, 1, 192, 159, 206,
+ 44, 1, 193, 224, 206, 44, 1, 198, 206, 198, 205, 198, 233, 206, 44, 1,
+ 233, 248, 206, 44, 1, 251, 90, 65, 206, 44, 1, 211, 37, 74, 206, 44, 1,
+ 252, 64, 65, 206, 44, 1, 252, 9, 206, 44, 1, 219, 15, 74, 206, 44, 1,
+ 203, 33, 74, 206, 44, 1, 74, 206, 44, 1, 211, 151, 206, 44, 1, 211, 104,
+ 206, 44, 1, 207, 154, 207, 169, 207, 69, 146, 206, 44, 1, 222, 39, 206,
+ 44, 1, 247, 25, 206, 44, 1, 222, 40, 222, 152, 206, 44, 1, 232, 51, 206,
+ 44, 1, 234, 88, 206, 44, 1, 231, 160, 230, 122, 232, 51, 206, 44, 1, 231,
+ 200, 206, 44, 1, 192, 248, 192, 239, 193, 224, 206, 44, 1, 230, 82, 230,
+ 116, 206, 44, 1, 230, 86, 230, 116, 206, 44, 1, 219, 17, 230, 116, 206,
+ 44, 1, 203, 36, 230, 116, 206, 44, 1, 214, 203, 212, 91, 214, 204, 215,
+ 61, 206, 44, 1, 203, 34, 215, 61, 206, 44, 1, 235, 135, 206, 44, 1, 223,
+ 65, 223, 69, 223, 55, 68, 206, 44, 1, 71, 206, 44, 1, 222, 255, 223, 35,
+ 206, 44, 1, 231, 141, 206, 44, 1, 219, 18, 252, 25, 206, 44, 1, 203, 38,
+ 65, 206, 44, 1, 223, 47, 234, 61, 206, 44, 1, 209, 247, 210, 18, 210,
+ 236, 206, 44, 1, 251, 185, 234, 59, 206, 44, 1, 201, 254, 206, 8, 206,
+ 44, 1, 202, 198, 219, 14, 206, 8, 206, 44, 1, 203, 32, 206, 8, 206, 44,
+ 1, 247, 193, 206, 44, 1, 191, 166, 206, 44, 1, 198, 120, 198, 132, 196,
+ 242, 200, 43, 206, 44, 1, 203, 31, 200, 43, 206, 44, 1, 238, 127, 206,
+ 44, 1, 248, 217, 248, 220, 248, 142, 250, 120, 206, 44, 1, 203, 37, 250,
+ 120, 206, 44, 1, 235, 134, 206, 44, 1, 211, 70, 206, 44, 1, 234, 167,
+ 234, 174, 71, 206, 44, 1, 217, 79, 217, 91, 218, 168, 206, 44, 1, 219,
+ 16, 218, 168, 206, 44, 1, 203, 35, 218, 168, 206, 44, 1, 219, 253, 220,
+ 101, 219, 26, 172, 206, 44, 1, 235, 136, 206, 44, 1, 223, 135, 206, 44,
+ 1, 223, 136, 206, 44, 1, 238, 19, 238, 25, 238, 127, 206, 44, 1, 211, 28,
+ 233, 247, 74, 206, 44, 1, 234, 211, 206, 44, 1, 223, 85, 206, 44, 1, 238,
+ 148, 206, 44, 1, 247, 143, 206, 44, 1, 247, 41, 206, 44, 1, 201, 108,
+ 206, 44, 1, 219, 13, 206, 44, 1, 203, 30, 206, 44, 1, 228, 25, 206, 44,
+ 1, 208, 104, 206, 44, 1, 192, 235, 206, 44, 202, 170, 208, 151, 206, 44,
+ 215, 129, 208, 151, 206, 44, 238, 218, 208, 151, 206, 44, 250, 252, 113,
+ 206, 44, 197, 45, 113, 206, 44, 248, 237, 113, 206, 44, 1, 222, 152, 206,
+ 44, 1, 203, 167, 206, 44, 1, 211, 87, 206, 44, 1, 232, 110, 247, 81, 211,
+ 36, 206, 44, 1, 232, 110, 247, 81, 223, 68, 206, 44, 1, 232, 110, 247,
+ 81, 234, 173, 206, 44, 1, 232, 110, 247, 81, 252, 63, 206, 44, 1, 232,
+ 110, 247, 81, 252, 9, 199, 222, 1, 65, 199, 222, 1, 68, 199, 222, 1, 66,
+ 199, 222, 1, 155, 199, 222, 1, 231, 240, 199, 222, 1, 214, 68, 199, 222,
+ 1, 190, 190, 199, 222, 1, 238, 32, 199, 222, 1, 180, 199, 222, 1, 168,
+ 199, 222, 1, 249, 153, 199, 222, 1, 174, 199, 222, 1, 170, 199, 222, 1,
+ 165, 199, 222, 1, 173, 199, 222, 1, 193, 190, 199, 222, 1, 188, 199, 222,
+ 1, 140, 199, 222, 18, 3, 68, 199, 222, 18, 3, 66, 199, 222, 3, 195, 40,
+ 199, 222, 3, 210, 169, 199, 222, 1, 251, 14, 165, 230, 23, 1, 65, 230,
+ 23, 1, 68, 230, 23, 1, 66, 230, 23, 1, 155, 230, 23, 1, 231, 240, 230,
+ 23, 1, 214, 68, 230, 23, 1, 190, 190, 230, 23, 1, 238, 32, 230, 23, 1,
+ 180, 230, 23, 1, 168, 230, 23, 1, 249, 153, 230, 23, 1, 174, 230, 23, 1,
+ 170, 230, 23, 1, 165, 230, 23, 1, 173, 230, 23, 1, 193, 190, 230, 23, 1,
+ 188, 230, 23, 1, 140, 230, 23, 18, 3, 68, 230, 23, 18, 3, 66, 230, 23, 3,
+ 210, 169, 209, 204, 202, 170, 208, 151, 209, 204, 55, 208, 151, 248, 0,
+ 1, 65, 248, 0, 1, 68, 248, 0, 1, 66, 248, 0, 1, 155, 248, 0, 1, 231, 240,
+ 248, 0, 1, 214, 68, 248, 0, 1, 190, 190, 248, 0, 1, 238, 32, 248, 0, 1,
+ 180, 248, 0, 1, 168, 248, 0, 1, 249, 153, 248, 0, 1, 174, 248, 0, 1, 170,
+ 248, 0, 1, 165, 248, 0, 1, 173, 248, 0, 1, 193, 190, 248, 0, 1, 188, 248,
+ 0, 1, 140, 248, 0, 18, 3, 68, 248, 0, 18, 3, 66, 199, 221, 1, 65, 199,
+ 221, 1, 68, 199, 221, 1, 66, 199, 221, 1, 155, 199, 221, 1, 231, 240,
+ 199, 221, 1, 214, 68, 199, 221, 1, 190, 190, 199, 221, 1, 238, 32, 199,
+ 221, 1, 180, 199, 221, 1, 168, 199, 221, 1, 249, 153, 199, 221, 1, 174,
+ 199, 221, 1, 170, 199, 221, 1, 173, 199, 221, 1, 193, 190, 199, 221, 1,
+ 188, 199, 221, 18, 3, 68, 199, 221, 18, 3, 66, 95, 1, 155, 95, 1, 221,
+ 215, 95, 1, 221, 67, 95, 1, 221, 183, 95, 1, 213, 249, 95, 1, 247, 160,
+ 95, 1, 247, 1, 95, 1, 242, 99, 95, 1, 243, 68, 95, 1, 212, 65, 95, 1,
+ 238, 32, 95, 1, 197, 120, 95, 1, 236, 174, 95, 1, 197, 115, 95, 1, 213,
+ 49, 95, 1, 190, 190, 95, 1, 199, 49, 95, 1, 159, 95, 1, 198, 241, 95, 1,
+ 213, 43, 95, 1, 249, 153, 95, 1, 209, 228, 95, 1, 209, 73, 95, 1, 209,
+ 199, 95, 1, 216, 12, 95, 1, 192, 12, 95, 1, 206, 162, 95, 1, 219, 43, 95,
+ 1, 195, 24, 95, 1, 203, 165, 95, 1, 201, 134, 95, 1, 188, 95, 1, 140, 95,
+ 1, 173, 95, 1, 208, 96, 95, 223, 149, 18, 208, 82, 95, 223, 149, 18, 208,
+ 95, 95, 223, 149, 18, 208, 57, 95, 223, 149, 18, 208, 51, 95, 223, 149,
+ 18, 208, 33, 95, 223, 149, 18, 208, 0, 95, 223, 149, 18, 207, 244, 95,
+ 223, 149, 18, 207, 243, 95, 223, 149, 18, 206, 17, 95, 223, 149, 18, 206,
+ 10, 95, 223, 149, 18, 218, 183, 95, 223, 149, 18, 218, 171, 95, 223, 149,
+ 18, 208, 75, 95, 223, 149, 18, 208, 88, 95, 223, 149, 18, 208, 41, 196,
+ 255, 107, 95, 223, 149, 18, 208, 41, 196, 255, 109, 95, 223, 149, 18,
+ 208, 77, 95, 18, 223, 133, 251, 37, 95, 18, 223, 133, 252, 206, 95, 18,
+ 3, 252, 206, 95, 18, 3, 68, 95, 18, 3, 223, 199, 95, 18, 3, 192, 159, 95,
+ 18, 3, 191, 176, 95, 18, 3, 66, 95, 18, 3, 196, 30, 95, 18, 3, 196, 168,
+ 95, 18, 3, 211, 151, 95, 18, 3, 170, 95, 18, 3, 223, 226, 95, 18, 3, 71,
+ 95, 18, 3, 252, 25, 95, 18, 3, 251, 236, 95, 18, 3, 211, 87, 95, 18, 3,
+ 250, 163, 95, 3, 213, 184, 95, 3, 207, 106, 95, 3, 191, 187, 95, 3, 215,
+ 91, 95, 3, 197, 229, 95, 3, 249, 90, 95, 3, 206, 151, 95, 3, 198, 90, 95,
+ 3, 222, 95, 95, 3, 251, 238, 95, 3, 205, 143, 205, 135, 95, 3, 195, 37,
+ 95, 3, 242, 90, 95, 3, 249, 60, 95, 3, 221, 205, 95, 3, 249, 85, 95, 3,
+ 247, 131, 209, 146, 220, 186, 95, 3, 219, 205, 198, 59, 95, 3, 248, 205,
+ 95, 3, 209, 201, 215, 148, 95, 3, 221, 39, 95, 238, 170, 16, 206, 241,
+ 95, 3, 250, 144, 95, 3, 250, 166, 95, 17, 191, 77, 95, 17, 107, 95, 17,
+ 109, 95, 17, 138, 95, 17, 134, 95, 17, 149, 95, 17, 169, 95, 17, 175, 95,
+ 17, 171, 95, 17, 178, 95, 16, 219, 205, 250, 168, 202, 19, 95, 16, 219,
+ 205, 250, 168, 215, 112, 95, 16, 219, 205, 250, 168, 209, 145, 95, 16,
+ 219, 205, 250, 168, 248, 240, 95, 16, 219, 205, 250, 168, 247, 236, 95,
+ 16, 219, 205, 250, 168, 208, 245, 95, 16, 219, 205, 250, 168, 208, 239,
+ 95, 16, 219, 205, 250, 168, 208, 237, 95, 16, 219, 205, 250, 168, 208,
+ 243, 95, 16, 219, 205, 250, 168, 208, 241, 104, 248, 158, 104, 234, 120,
+ 104, 242, 74, 104, 232, 80, 201, 63, 104, 242, 83, 104, 232, 128, 236,
+ 138, 104, 198, 88, 202, 32, 228, 88, 104, 202, 214, 5, 248, 73, 217, 51,
+ 104, 217, 87, 242, 74, 104, 217, 87, 232, 80, 201, 63, 104, 213, 164,
+ 104, 232, 109, 67, 205, 35, 107, 104, 232, 109, 67, 205, 35, 109, 104,
+ 232, 109, 67, 205, 35, 138, 104, 18, 204, 10, 104, 232, 109, 67, 205, 35,
+ 134, 104, 17, 191, 77, 104, 17, 107, 104, 17, 109, 104, 17, 138, 104, 17,
+ 134, 104, 17, 149, 104, 17, 169, 104, 17, 175, 104, 17, 171, 104, 17,
+ 178, 104, 1, 65, 104, 1, 71, 104, 1, 68, 104, 1, 74, 104, 1, 66, 104, 1,
+ 211, 151, 104, 1, 196, 152, 104, 1, 234, 188, 104, 1, 180, 104, 1, 251,
+ 122, 104, 1, 249, 153, 104, 1, 168, 104, 1, 208, 96, 104, 1, 231, 240,
+ 104, 1, 174, 104, 1, 173, 104, 1, 188, 104, 1, 203, 165, 104, 1, 190,
+ 190, 104, 1, 238, 32, 104, 1, 247, 1, 104, 1, 223, 32, 104, 1, 170, 104,
+ 1, 165, 104, 1, 193, 190, 104, 1, 233, 109, 104, 1, 155, 104, 1, 221,
+ 215, 104, 1, 197, 168, 104, 1, 191, 123, 104, 1, 230, 91, 104, 1, 190,
+ 255, 104, 1, 219, 159, 104, 1, 191, 57, 104, 1, 243, 95, 104, 1, 198, 88,
+ 179, 18, 56, 104, 1, 198, 88, 71, 104, 1, 198, 88, 68, 104, 1, 198, 88,
+ 74, 104, 1, 198, 88, 66, 104, 1, 198, 88, 211, 151, 104, 1, 198, 88, 196,
+ 152, 104, 1, 198, 88, 251, 122, 104, 1, 198, 88, 249, 153, 104, 1, 198,
+ 88, 168, 104, 1, 198, 88, 208, 96, 104, 1, 198, 88, 231, 240, 104, 1,
+ 198, 88, 174, 104, 1, 198, 88, 190, 190, 104, 1, 198, 88, 238, 32, 104,
+ 1, 198, 88, 247, 1, 104, 1, 198, 88, 223, 32, 104, 1, 198, 88, 197, 168,
+ 104, 1, 198, 88, 170, 104, 1, 198, 88, 193, 190, 104, 1, 198, 88, 155,
+ 104, 1, 198, 88, 231, 237, 104, 1, 198, 88, 230, 91, 104, 1, 198, 88,
+ 222, 243, 104, 1, 198, 88, 213, 209, 104, 1, 198, 88, 235, 35, 104, 1,
+ 202, 214, 71, 104, 1, 202, 214, 68, 104, 1, 202, 214, 223, 44, 104, 1,
+ 202, 214, 196, 152, 104, 1, 202, 214, 66, 104, 1, 202, 214, 251, 122,
+ 104, 1, 202, 214, 155, 104, 1, 202, 214, 231, 240, 104, 1, 202, 214, 140,
+ 104, 1, 202, 214, 168, 104, 1, 202, 214, 203, 165, 104, 1, 202, 214, 190,
+ 190, 104, 1, 202, 214, 238, 32, 104, 1, 202, 214, 223, 32, 104, 1, 202,
+ 214, 233, 109, 104, 1, 202, 214, 231, 237, 104, 1, 202, 214, 230, 91,
+ 104, 1, 202, 214, 197, 168, 104, 1, 202, 214, 191, 123, 104, 1, 202, 214,
+ 207, 178, 104, 1, 202, 214, 247, 1, 104, 1, 202, 214, 191, 71, 104, 1,
+ 217, 87, 68, 104, 1, 217, 87, 155, 104, 1, 217, 87, 165, 104, 1, 217, 87,
+ 233, 109, 104, 1, 217, 87, 191, 71, 104, 1, 247, 2, 4, 105, 236, 138,
+ 104, 1, 251, 184, 231, 220, 251, 72, 107, 104, 1, 251, 184, 231, 220,
+ 195, 36, 107, 104, 1, 251, 184, 231, 220, 237, 247, 104, 1, 251, 184,
+ 231, 220, 196, 163, 104, 1, 251, 184, 231, 220, 223, 93, 196, 163, 104,
+ 1, 251, 184, 231, 220, 249, 104, 104, 1, 251, 184, 231, 220, 115, 249,
+ 104, 104, 1, 251, 184, 231, 220, 65, 104, 1, 251, 184, 231, 220, 68, 104,
+ 1, 251, 184, 231, 220, 155, 104, 1, 251, 184, 231, 220, 214, 68, 104, 1,
+ 251, 184, 231, 220, 247, 160, 104, 1, 251, 184, 231, 220, 197, 132, 104,
+ 1, 251, 184, 231, 220, 197, 120, 104, 1, 251, 184, 231, 220, 237, 191,
+ 104, 1, 251, 184, 231, 220, 213, 79, 104, 1, 251, 184, 231, 220, 190,
+ 190, 104, 1, 251, 184, 231, 220, 238, 32, 104, 1, 251, 184, 231, 220,
+ 168, 104, 1, 251, 184, 231, 220, 209, 228, 104, 1, 251, 184, 231, 220,
+ 201, 175, 104, 1, 251, 184, 231, 220, 191, 71, 104, 1, 251, 184, 231,
+ 220, 191, 123, 104, 1, 251, 184, 231, 220, 251, 245, 104, 1, 198, 88,
+ 251, 184, 231, 220, 190, 190, 104, 1, 198, 88, 251, 184, 231, 220, 191,
+ 71, 104, 1, 217, 87, 251, 184, 231, 220, 231, 91, 104, 1, 217, 87, 251,
+ 184, 231, 220, 214, 68, 104, 1, 217, 87, 251, 184, 231, 220, 247, 160,
+ 104, 1, 217, 87, 251, 184, 231, 220, 222, 252, 104, 1, 217, 87, 251, 184,
+ 231, 220, 197, 132, 104, 1, 217, 87, 251, 184, 231, 220, 237, 175, 104,
+ 1, 217, 87, 251, 184, 231, 220, 190, 190, 104, 1, 217, 87, 251, 184, 231,
+ 220, 237, 68, 104, 1, 217, 87, 251, 184, 231, 220, 201, 175, 104, 1, 217,
+ 87, 251, 184, 231, 220, 238, 142, 104, 1, 217, 87, 251, 184, 231, 220,
+ 191, 71, 104, 1, 217, 87, 251, 184, 231, 220, 191, 123, 104, 1, 251, 184,
+ 231, 220, 132, 66, 104, 1, 251, 184, 231, 220, 132, 170, 104, 1, 217, 87,
+ 251, 184, 231, 220, 248, 203, 104, 1, 251, 184, 231, 220, 238, 20, 104,
+ 1, 217, 87, 251, 184, 231, 220, 219, 159, 21, 22, 210, 242, 21, 22, 250,
+ 131, 21, 22, 252, 160, 21, 22, 193, 128, 21, 22, 208, 251, 21, 22, 210,
+ 72, 21, 22, 208, 113, 21, 22, 199, 154, 21, 22, 222, 29, 21, 22, 220,
+ 176, 21, 22, 217, 21, 21, 22, 212, 250, 21, 22, 214, 198, 21, 22, 219,
+ 248, 21, 22, 201, 252, 21, 22, 205, 103, 21, 22, 203, 18, 21, 22, 203,
+ 117, 21, 22, 202, 232, 21, 22, 191, 234, 21, 22, 192, 86, 21, 22, 207,
+ 122, 21, 22, 212, 107, 21, 22, 211, 128, 212, 107, 21, 22, 212, 106, 21,
+ 22, 211, 128, 212, 106, 21, 22, 212, 105, 21, 22, 211, 128, 212, 105, 21,
+ 22, 212, 104, 21, 22, 211, 128, 212, 104, 21, 22, 206, 22, 21, 22, 206,
+ 21, 21, 22, 206, 20, 21, 22, 206, 19, 21, 22, 206, 18, 21, 22, 206, 26,
+ 21, 22, 211, 128, 210, 236, 21, 22, 211, 128, 200, 43, 21, 22, 211, 128,
+ 222, 152, 21, 22, 211, 128, 247, 193, 21, 22, 211, 128, 218, 168, 21, 22,
+ 211, 128, 215, 61, 21, 22, 211, 128, 206, 8, 21, 22, 211, 128, 203, 167,
+ 21, 22, 234, 202, 193, 224, 21, 22, 193, 102, 193, 224, 21, 22, 53, 2,
+ 206, 188, 21, 22, 53, 207, 147, 236, 140, 21, 22, 207, 221, 206, 23, 21,
+ 22, 193, 103, 219, 8, 21, 22, 193, 103, 220, 125, 21, 22, 198, 202, 21,
+ 22, 198, 204, 21, 22, 197, 112, 21, 22, 197, 114, 21, 22, 197, 119, 21,
+ 22, 198, 105, 21, 22, 198, 107, 21, 22, 205, 101, 202, 237, 21, 22, 205,
+ 101, 203, 48, 21, 22, 205, 101, 228, 252, 21, 22, 98, 230, 130, 21, 22,
+ 98, 237, 103, 231, 157, 21, 22, 98, 231, 237, 21, 22, 98, 230, 135, 21,
+ 22, 205, 101, 222, 162, 21, 22, 98, 222, 160, 21, 22, 249, 5, 237, 103,
+ 172, 21, 22, 249, 5, 237, 103, 146, 21, 22, 98, 237, 98, 206, 8, 219,
+ 122, 195, 1, 219, 175, 219, 122, 1, 155, 219, 122, 1, 221, 215, 219, 122,
+ 1, 231, 240, 219, 122, 1, 231, 91, 219, 122, 1, 214, 68, 219, 122, 1,
+ 247, 160, 219, 122, 1, 247, 1, 219, 122, 1, 223, 32, 219, 122, 1, 222,
+ 252, 219, 122, 1, 192, 108, 219, 122, 1, 190, 190, 219, 122, 1, 199, 49,
+ 219, 122, 1, 238, 32, 219, 122, 1, 237, 68, 219, 122, 1, 180, 219, 122,
+ 1, 168, 219, 122, 1, 209, 228, 219, 122, 1, 249, 153, 219, 122, 1, 248,
+ 203, 219, 122, 1, 174, 219, 122, 1, 170, 219, 122, 1, 165, 219, 122, 1,
+ 173, 219, 122, 1, 193, 190, 219, 122, 1, 203, 165, 219, 122, 1, 201, 175,
+ 219, 122, 1, 188, 219, 122, 1, 140, 219, 122, 1, 230, 126, 219, 122, 1,
+ 198, 26, 219, 122, 18, 3, 65, 219, 122, 18, 3, 68, 219, 122, 18, 3, 66,
+ 219, 122, 18, 3, 234, 188, 219, 122, 18, 3, 251, 236, 219, 122, 18, 3,
+ 211, 87, 219, 122, 18, 3, 250, 163, 219, 122, 18, 3, 71, 219, 122, 18, 3,
+ 74, 219, 122, 200, 239, 1, 170, 219, 122, 200, 239, 1, 165, 219, 122,
+ 200, 239, 1, 193, 190, 219, 122, 2, 1, 155, 219, 122, 2, 1, 214, 68, 219,
+ 122, 2, 1, 251, 71, 219, 122, 2, 1, 190, 190, 219, 122, 2, 1, 180, 219,
+ 122, 2, 1, 168, 219, 122, 2, 1, 174, 219, 122, 2, 1, 165, 219, 122, 2, 1,
+ 173, 219, 122, 3, 215, 134, 219, 122, 3, 222, 1, 219, 122, 3, 205, 198,
+ 219, 122, 3, 219, 8, 219, 122, 233, 216, 77, 219, 122, 208, 13, 77, 219,
+ 122, 17, 191, 77, 219, 122, 17, 107, 219, 122, 17, 109, 219, 122, 17,
+ 138, 219, 122, 17, 134, 219, 122, 17, 149, 219, 122, 17, 169, 219, 122,
+ 17, 175, 219, 122, 17, 171, 219, 122, 17, 178, 54, 219, 239, 1, 155, 54,
+ 219, 239, 1, 192, 220, 54, 219, 239, 1, 214, 68, 54, 219, 239, 1, 197,
+ 168, 54, 219, 239, 1, 188, 54, 219, 239, 1, 170, 54, 219, 239, 1, 190,
+ 190, 54, 219, 239, 1, 199, 49, 54, 219, 239, 1, 173, 54, 219, 239, 1,
+ 168, 54, 219, 239, 1, 209, 228, 54, 219, 239, 1, 174, 54, 219, 239, 1,
+ 233, 109, 54, 219, 239, 1, 195, 188, 54, 219, 239, 1, 140, 54, 219, 239,
+ 1, 208, 96, 54, 219, 239, 1, 221, 215, 54, 219, 239, 1, 197, 157, 54,
+ 219, 239, 1, 180, 54, 219, 239, 1, 65, 54, 219, 239, 1, 68, 54, 219, 239,
+ 1, 234, 188, 54, 219, 239, 1, 234, 173, 54, 219, 239, 1, 66, 54, 219,
+ 239, 1, 211, 87, 54, 219, 239, 1, 74, 54, 219, 239, 1, 196, 152, 54, 219,
+ 239, 1, 71, 54, 219, 239, 1, 250, 161, 54, 219, 239, 1, 251, 236, 54,
+ 219, 239, 1, 198, 77, 54, 219, 239, 1, 198, 76, 54, 219, 239, 1, 198, 75,
+ 54, 219, 239, 1, 198, 74, 54, 219, 239, 1, 198, 73, 214, 80, 54, 218,
+ 219, 1, 137, 208, 96, 214, 80, 54, 218, 219, 1, 130, 208, 96, 214, 80,
+ 54, 218, 219, 1, 137, 155, 214, 80, 54, 218, 219, 1, 137, 192, 220, 214,
+ 80, 54, 218, 219, 1, 137, 214, 68, 214, 80, 54, 218, 219, 1, 130, 155,
+ 214, 80, 54, 218, 219, 1, 130, 192, 220, 214, 80, 54, 218, 219, 1, 130,
+ 214, 68, 214, 80, 54, 218, 219, 1, 137, 197, 168, 214, 80, 54, 218, 219,
+ 1, 137, 188, 214, 80, 54, 218, 219, 1, 137, 170, 214, 80, 54, 218, 219,
+ 1, 130, 197, 168, 214, 80, 54, 218, 219, 1, 130, 188, 214, 80, 54, 218,
+ 219, 1, 130, 170, 214, 80, 54, 218, 219, 1, 137, 190, 190, 214, 80, 54,
+ 218, 219, 1, 137, 199, 49, 214, 80, 54, 218, 219, 1, 137, 180, 214, 80,
+ 54, 218, 219, 1, 130, 190, 190, 214, 80, 54, 218, 219, 1, 130, 199, 49,
+ 214, 80, 54, 218, 219, 1, 130, 180, 214, 80, 54, 218, 219, 1, 137, 168,
+ 214, 80, 54, 218, 219, 1, 137, 209, 228, 214, 80, 54, 218, 219, 1, 137,
+ 174, 214, 80, 54, 218, 219, 1, 130, 168, 214, 80, 54, 218, 219, 1, 130,
+ 209, 228, 214, 80, 54, 218, 219, 1, 130, 174, 214, 80, 54, 218, 219, 1,
+ 137, 233, 109, 214, 80, 54, 218, 219, 1, 137, 195, 188, 214, 80, 54, 218,
+ 219, 1, 137, 173, 214, 80, 54, 218, 219, 1, 130, 233, 109, 214, 80, 54,
+ 218, 219, 1, 130, 195, 188, 214, 80, 54, 218, 219, 1, 130, 173, 214, 80,
+ 54, 218, 219, 1, 137, 140, 214, 80, 54, 218, 219, 1, 137, 238, 32, 214,
+ 80, 54, 218, 219, 1, 137, 249, 153, 214, 80, 54, 218, 219, 1, 130, 140,
+ 214, 80, 54, 218, 219, 1, 130, 238, 32, 214, 80, 54, 218, 219, 1, 130,
+ 249, 153, 214, 80, 54, 218, 219, 1, 137, 220, 181, 214, 80, 54, 218, 219,
+ 1, 137, 192, 185, 214, 80, 54, 218, 219, 1, 130, 220, 181, 214, 80, 54,
+ 218, 219, 1, 130, 192, 185, 214, 80, 54, 218, 219, 1, 137, 200, 251, 214,
+ 80, 54, 218, 219, 1, 130, 200, 251, 214, 80, 54, 218, 219, 18, 3, 18,
+ 203, 28, 214, 80, 54, 218, 219, 18, 3, 252, 206, 214, 80, 54, 218, 219,
+ 18, 3, 223, 199, 214, 80, 54, 218, 219, 18, 3, 66, 214, 80, 54, 218, 219,
+ 18, 3, 196, 30, 214, 80, 54, 218, 219, 18, 3, 71, 214, 80, 54, 218, 219,
+ 18, 3, 252, 25, 214, 80, 54, 218, 219, 18, 3, 74, 214, 80, 54, 218, 219,
+ 18, 3, 211, 182, 214, 80, 54, 218, 219, 18, 3, 196, 152, 214, 80, 54,
+ 218, 219, 18, 3, 250, 131, 214, 80, 54, 218, 219, 18, 3, 252, 160, 214,
+ 80, 54, 218, 219, 18, 3, 196, 21, 214, 80, 54, 218, 219, 18, 3, 210, 242,
+ 214, 80, 54, 218, 219, 18, 3, 211, 179, 214, 80, 54, 218, 219, 18, 3,
+ 196, 144, 214, 80, 54, 218, 219, 18, 3, 223, 44, 214, 80, 54, 218, 219,
+ 1, 53, 196, 12, 214, 80, 54, 218, 219, 1, 53, 214, 70, 214, 80, 54, 218,
+ 219, 1, 53, 215, 61, 214, 80, 54, 218, 219, 1, 53, 218, 168, 214, 80, 54,
+ 218, 219, 1, 53, 222, 152, 214, 80, 54, 218, 219, 1, 53, 238, 127, 214,
+ 80, 54, 218, 219, 1, 53, 250, 120, 214, 80, 54, 218, 219, 163, 217, 55,
+ 214, 80, 54, 218, 219, 163, 217, 54, 214, 80, 54, 218, 219, 17, 191, 77,
+ 214, 80, 54, 218, 219, 17, 107, 214, 80, 54, 218, 219, 17, 109, 214, 80,
+ 54, 218, 219, 17, 138, 214, 80, 54, 218, 219, 17, 134, 214, 80, 54, 218,
+ 219, 17, 149, 214, 80, 54, 218, 219, 17, 169, 214, 80, 54, 218, 219, 17,
+ 175, 214, 80, 54, 218, 219, 17, 171, 214, 80, 54, 218, 219, 17, 178, 214,
+ 80, 54, 218, 219, 128, 17, 107, 214, 80, 54, 218, 219, 3, 220, 107, 214,
+ 80, 54, 218, 219, 3, 220, 106, 95, 16, 210, 84, 95, 16, 215, 113, 221,
+ 58, 95, 16, 209, 146, 221, 58, 95, 16, 248, 241, 221, 58, 95, 16, 247,
+ 237, 221, 58, 95, 16, 208, 246, 221, 58, 95, 16, 208, 240, 221, 58, 95,
+ 16, 208, 238, 221, 58, 95, 16, 208, 244, 221, 58, 95, 16, 208, 242, 221,
+ 58, 95, 16, 237, 232, 221, 58, 95, 16, 237, 228, 221, 58, 95, 16, 237,
+ 227, 221, 58, 95, 16, 237, 230, 221, 58, 95, 16, 237, 229, 221, 58, 95,
+ 16, 237, 226, 221, 58, 95, 16, 197, 51, 95, 16, 215, 113, 206, 149, 95,
+ 16, 209, 146, 206, 149, 95, 16, 248, 241, 206, 149, 95, 16, 247, 237,
+ 206, 149, 95, 16, 208, 246, 206, 149, 95, 16, 208, 240, 206, 149, 95, 16,
+ 208, 238, 206, 149, 95, 16, 208, 244, 206, 149, 95, 16, 208, 242, 206,
+ 149, 95, 16, 237, 232, 206, 149, 95, 16, 237, 228, 206, 149, 95, 16, 237,
+ 227, 206, 149, 95, 16, 237, 230, 206, 149, 95, 16, 237, 229, 206, 149,
+ 95, 16, 237, 226, 206, 149, 248, 1, 1, 155, 248, 1, 1, 231, 240, 248, 1,
+ 1, 214, 68, 248, 1, 1, 214, 11, 248, 1, 1, 168, 248, 1, 1, 249, 153, 248,
+ 1, 1, 174, 248, 1, 1, 215, 166, 248, 1, 1, 190, 190, 248, 1, 1, 238, 32,
+ 248, 1, 1, 180, 248, 1, 1, 212, 244, 248, 1, 1, 247, 160, 248, 1, 1, 223,
+ 32, 248, 1, 1, 212, 101, 248, 1, 1, 212, 92, 248, 1, 1, 170, 248, 1, 1,
+ 165, 248, 1, 1, 173, 248, 1, 1, 195, 188, 248, 1, 1, 188, 248, 1, 1, 65,
+ 248, 1, 1, 140, 248, 1, 18, 3, 68, 248, 1, 18, 3, 66, 248, 1, 18, 3, 71,
+ 248, 1, 18, 3, 74, 248, 1, 18, 3, 252, 25, 248, 1, 210, 184, 248, 1, 234,
+ 95, 79, 205, 53, 54, 128, 1, 137, 155, 54, 128, 1, 137, 221, 215, 54,
+ 128, 1, 137, 220, 165, 54, 128, 1, 130, 155, 54, 128, 1, 130, 220, 165,
+ 54, 128, 1, 130, 221, 215, 54, 128, 1, 214, 68, 54, 128, 1, 137, 247,
+ 160, 54, 128, 1, 137, 247, 1, 54, 128, 1, 130, 247, 160, 54, 128, 1, 130,
+ 188, 54, 128, 1, 130, 247, 1, 54, 128, 1, 212, 101, 54, 128, 1, 207, 129,
+ 54, 128, 1, 137, 207, 127, 54, 128, 1, 238, 32, 54, 128, 1, 130, 207,
+ 127, 54, 128, 1, 207, 138, 54, 128, 1, 137, 190, 190, 54, 128, 1, 137,
+ 199, 49, 54, 128, 1, 130, 190, 190, 54, 128, 1, 130, 199, 49, 54, 128, 1,
+ 180, 54, 128, 1, 249, 153, 54, 128, 1, 137, 168, 54, 128, 1, 137, 209,
+ 228, 54, 128, 1, 137, 233, 109, 54, 128, 1, 130, 168, 54, 128, 1, 130,
+ 233, 109, 54, 128, 1, 130, 209, 228, 54, 128, 1, 174, 54, 128, 1, 130,
+ 170, 54, 128, 1, 137, 170, 54, 128, 1, 165, 54, 128, 1, 206, 57, 54, 128,
+ 1, 173, 54, 128, 1, 218, 218, 54, 128, 1, 193, 190, 54, 128, 1, 137, 203,
+ 165, 54, 128, 1, 137, 201, 175, 54, 128, 1, 137, 188, 54, 128, 1, 137,
+ 140, 54, 128, 1, 219, 73, 54, 128, 1, 65, 54, 128, 1, 130, 140, 54, 128,
+ 1, 68, 54, 128, 1, 223, 199, 54, 128, 1, 66, 54, 128, 1, 196, 30, 54,
+ 128, 1, 234, 188, 54, 128, 1, 211, 87, 54, 128, 1, 220, 107, 54, 128, 1,
+ 230, 206, 188, 54, 128, 120, 3, 216, 217, 165, 54, 128, 120, 3, 216, 217,
+ 173, 54, 128, 120, 3, 220, 126, 199, 190, 220, 96, 54, 128, 3, 217, 113,
+ 222, 84, 220, 96, 54, 128, 120, 3, 53, 214, 68, 54, 128, 120, 3, 130,
+ 168, 54, 128, 120, 3, 137, 207, 128, 211, 57, 130, 168, 54, 128, 120, 3,
+ 174, 54, 128, 120, 3, 249, 153, 54, 128, 120, 3, 188, 54, 128, 3, 205,
+ 172, 54, 128, 18, 3, 65, 54, 128, 18, 3, 217, 113, 205, 122, 54, 128, 18,
+ 3, 252, 206, 54, 128, 18, 3, 199, 200, 252, 206, 54, 128, 18, 3, 68, 54,
+ 128, 18, 3, 223, 199, 54, 128, 18, 3, 196, 152, 54, 128, 18, 3, 196, 29,
+ 54, 128, 18, 3, 66, 54, 128, 18, 3, 196, 30, 54, 128, 18, 3, 74, 54, 128,
+ 18, 3, 211, 183, 60, 54, 128, 18, 3, 210, 242, 54, 128, 18, 3, 71, 54,
+ 128, 18, 3, 252, 25, 54, 128, 18, 3, 211, 87, 54, 128, 18, 3, 251, 236,
+ 54, 128, 18, 3, 128, 251, 236, 54, 128, 18, 3, 211, 183, 58, 54, 128, 3,
+ 217, 113, 222, 83, 54, 128, 3, 198, 78, 54, 128, 3, 198, 77, 54, 128, 3,
+ 221, 171, 198, 76, 54, 128, 3, 221, 171, 198, 75, 54, 128, 3, 221, 171,
+ 198, 74, 54, 128, 3, 207, 186, 230, 90, 54, 128, 3, 217, 113, 205, 152,
+ 54, 128, 3, 221, 170, 222, 64, 54, 128, 33, 238, 198, 236, 140, 54, 128,
+ 228, 243, 17, 191, 77, 54, 128, 228, 243, 17, 107, 54, 128, 228, 243, 17,
+ 109, 54, 128, 228, 243, 17, 138, 54, 128, 228, 243, 17, 134, 54, 128,
+ 228, 243, 17, 149, 54, 128, 228, 243, 17, 169, 54, 128, 228, 243, 17,
+ 175, 54, 128, 228, 243, 17, 171, 54, 128, 228, 243, 17, 178, 54, 128,
+ 128, 17, 191, 77, 54, 128, 128, 17, 107, 54, 128, 128, 17, 109, 54, 128,
+ 128, 17, 138, 54, 128, 128, 17, 134, 54, 128, 128, 17, 149, 54, 128, 128,
+ 17, 169, 54, 128, 128, 17, 175, 54, 128, 128, 17, 171, 54, 128, 128, 17,
+ 178, 54, 128, 3, 193, 80, 54, 128, 3, 193, 79, 54, 128, 3, 205, 107, 54,
+ 128, 3, 221, 246, 54, 128, 3, 228, 170, 54, 128, 3, 236, 157, 54, 128, 3,
+ 207, 18, 206, 122, 207, 138, 54, 128, 3, 217, 113, 192, 109, 54, 128, 3,
+ 222, 120, 54, 128, 3, 222, 119, 54, 128, 3, 205, 117, 54, 128, 3, 205,
+ 116, 54, 128, 3, 230, 26, 54, 128, 3, 247, 157, 33, 235, 128, 243, 2,
+ 252, 60, 33, 237, 41, 33, 223, 139, 33, 235, 119, 57, 33, 197, 225, 236,
+ 140, 33, 192, 233, 60, 33, 193, 72, 219, 113, 60, 33, 211, 77, 87, 60,
+ 33, 55, 211, 77, 87, 60, 33, 156, 247, 23, 201, 28, 60, 33, 201, 14, 247,
+ 23, 201, 28, 60, 33, 210, 115, 58, 33, 55, 210, 115, 58, 33, 210, 115,
+ 60, 33, 210, 115, 210, 255, 33, 8, 2, 1, 193, 225, 60, 33, 8, 2, 1, 153,
+ 193, 225, 60, 33, 45, 210, 114, 93, 219, 224, 33, 50, 210, 114, 93, 183,
+ 33, 45, 210, 114, 248, 233, 219, 224, 33, 50, 210, 114, 248, 233, 183,
+ 33, 51, 248, 51, 58, 33, 31, 3, 58, 33, 223, 93, 55, 251, 15, 58, 33,
+ 108, 3, 58, 33, 55, 108, 3, 58, 33, 55, 108, 3, 60, 33, 197, 225, 252,
+ 47, 252, 60, 33, 8, 2, 1, 223, 115, 232, 51, 33, 8, 2, 1, 223, 115, 146,
+ 33, 8, 2, 1, 223, 115, 200, 43, 148, 3, 196, 123, 206, 244, 148, 3, 196,
+ 123, 247, 121, 148, 3, 247, 38, 148, 3, 200, 173, 148, 3, 248, 155, 148,
+ 1, 251, 214, 148, 1, 251, 215, 199, 123, 148, 1, 223, 194, 148, 1, 223,
+ 195, 199, 123, 148, 1, 196, 126, 148, 1, 196, 127, 199, 123, 148, 1, 207,
+ 186, 207, 51, 148, 1, 207, 186, 207, 52, 199, 123, 148, 1, 220, 126, 219,
+ 199, 148, 1, 220, 126, 219, 200, 199, 123, 148, 1, 234, 145, 148, 1, 251,
+ 233, 148, 1, 211, 123, 148, 1, 211, 124, 199, 123, 148, 1, 155, 148, 1,
+ 222, 142, 217, 116, 148, 1, 231, 240, 148, 1, 231, 241, 230, 241, 148, 1,
+ 214, 68, 148, 1, 247, 160, 148, 1, 247, 161, 220, 112, 148, 1, 223, 32,
+ 148, 1, 223, 33, 223, 0, 148, 1, 212, 101, 148, 1, 199, 252, 220, 2, 148,
+ 1, 199, 252, 215, 108, 217, 116, 148, 1, 238, 33, 215, 108, 251, 162,
+ 148, 1, 238, 33, 215, 108, 217, 116, 148, 1, 215, 7, 207, 141, 148, 1,
+ 190, 190, 148, 1, 199, 252, 199, 158, 148, 1, 238, 32, 148, 1, 238, 33,
+ 217, 138, 148, 1, 180, 148, 1, 168, 148, 1, 210, 221, 222, 76, 148, 1,
+ 249, 153, 148, 1, 249, 154, 222, 2, 148, 1, 174, 148, 1, 170, 148, 1,
+ 165, 148, 1, 173, 148, 1, 193, 190, 148, 1, 205, 207, 205, 184, 148, 1,
+ 205, 207, 205, 129, 148, 1, 188, 148, 1, 140, 148, 3, 207, 41, 148, 18,
+ 3, 199, 123, 148, 18, 3, 196, 122, 148, 18, 3, 196, 123, 205, 125, 148,
+ 18, 3, 200, 208, 148, 18, 3, 200, 209, 223, 185, 148, 18, 3, 207, 186,
+ 207, 51, 148, 18, 3, 207, 186, 207, 52, 199, 123, 148, 18, 3, 220, 126,
+ 219, 199, 148, 18, 3, 220, 126, 219, 200, 199, 123, 148, 18, 3, 199, 201,
+ 148, 18, 3, 199, 202, 207, 51, 148, 18, 3, 199, 202, 199, 123, 148, 18,
+ 3, 199, 202, 207, 52, 199, 123, 148, 18, 3, 210, 16, 148, 18, 3, 210, 17,
+ 199, 123, 148, 252, 37, 252, 36, 148, 1, 222, 107, 205, 124, 148, 1, 221,
+ 177, 205, 124, 148, 1, 196, 235, 205, 124, 148, 1, 234, 182, 205, 124,
+ 148, 1, 195, 154, 205, 124, 148, 1, 191, 109, 205, 124, 148, 1, 250, 185,
+ 205, 124, 148, 1, 251, 14, 222, 202, 148, 17, 191, 77, 148, 17, 107, 148,
+ 17, 109, 148, 17, 138, 148, 17, 134, 148, 17, 149, 148, 17, 169, 148, 17,
+ 175, 148, 17, 171, 148, 17, 178, 148, 210, 145, 148, 210, 175, 148, 193,
+ 64, 148, 247, 94, 210, 168, 148, 247, 94, 202, 190, 148, 247, 94, 210,
+ 112, 148, 210, 174, 148, 37, 16, 236, 148, 148, 37, 16, 237, 102, 148,
+ 37, 16, 235, 71, 148, 37, 16, 237, 236, 148, 37, 16, 237, 237, 200, 173,
+ 148, 37, 16, 236, 242, 148, 37, 16, 238, 24, 148, 37, 16, 237, 77, 148,
+ 37, 16, 238, 6, 148, 37, 16, 237, 237, 231, 159, 148, 37, 16, 33, 199,
+ 116, 148, 37, 16, 33, 234, 92, 148, 37, 16, 33, 221, 253, 148, 37, 16,
+ 33, 221, 255, 148, 37, 16, 33, 223, 5, 148, 37, 16, 33, 221, 254, 4, 223,
+ 5, 148, 37, 16, 33, 222, 0, 4, 223, 5, 148, 37, 16, 33, 248, 226, 148,
+ 37, 16, 33, 230, 247, 148, 37, 16, 206, 206, 211, 77, 235, 82, 148, 37,
+ 16, 206, 206, 211, 77, 238, 22, 148, 37, 16, 206, 206, 242, 219, 197, 80,
+ 148, 37, 16, 206, 206, 242, 219, 199, 211, 148, 37, 16, 219, 222, 211,
+ 77, 210, 160, 148, 37, 16, 219, 222, 211, 77, 208, 149, 148, 37, 16, 219,
+ 222, 242, 219, 209, 104, 148, 37, 16, 219, 222, 242, 219, 209, 86, 148,
+ 37, 16, 219, 222, 211, 77, 209, 132, 148, 210, 146, 220, 19, 148, 210,
+ 176, 220, 19, 200, 197, 3, 210, 142, 200, 197, 3, 210, 156, 200, 197, 3,
+ 210, 152, 200, 197, 1, 65, 200, 197, 1, 68, 200, 197, 1, 66, 200, 197, 1,
+ 252, 25, 200, 197, 1, 74, 200, 197, 1, 71, 200, 197, 1, 233, 242, 200,
+ 197, 1, 155, 200, 197, 1, 208, 96, 200, 197, 1, 231, 240, 200, 197, 1,
+ 214, 68, 200, 197, 1, 247, 160, 200, 197, 1, 223, 32, 200, 197, 1, 191,
+ 123, 200, 197, 1, 212, 101, 200, 197, 1, 190, 190, 200, 197, 1, 238, 32,
+ 200, 197, 1, 180, 200, 197, 1, 168, 200, 197, 1, 233, 109, 200, 197, 1,
+ 195, 188, 200, 197, 1, 249, 153, 200, 197, 1, 174, 200, 197, 1, 170, 200,
+ 197, 1, 165, 200, 197, 1, 173, 200, 197, 1, 193, 190, 200, 197, 1, 188,
+ 200, 197, 1, 192, 220, 200, 197, 1, 140, 200, 197, 120, 3, 210, 172, 200,
+ 197, 120, 3, 210, 144, 200, 197, 120, 3, 210, 141, 200, 197, 18, 3, 210,
+ 159, 200, 197, 18, 3, 210, 140, 200, 197, 18, 3, 210, 165, 200, 197, 18,
+ 3, 210, 151, 200, 197, 18, 3, 210, 173, 200, 197, 18, 3, 210, 161, 200,
+ 197, 3, 210, 177, 200, 197, 3, 195, 40, 200, 197, 120, 3, 210, 100, 174,
+ 200, 197, 120, 3, 210, 100, 193, 190, 200, 197, 1, 221, 215, 200, 197, 1,
+ 200, 126, 200, 197, 17, 191, 77, 200, 197, 17, 107, 200, 197, 17, 109,
+ 200, 197, 17, 138, 200, 197, 17, 134, 200, 197, 17, 149, 200, 197, 17,
+ 169, 200, 197, 17, 175, 200, 197, 17, 171, 200, 197, 17, 178, 200, 197,
+ 250, 145, 200, 197, 1, 207, 21, 200, 197, 1, 219, 172, 200, 197, 1, 248,
+ 203, 200, 197, 1, 53, 222, 152, 200, 197, 1, 53, 218, 168, 249, 63, 1,
+ 65, 249, 63, 1, 202, 182, 65, 249, 63, 1, 140, 249, 63, 1, 202, 182, 140,
+ 249, 63, 1, 217, 85, 140, 249, 63, 1, 249, 153, 249, 63, 1, 222, 61, 249,
+ 153, 249, 63, 1, 168, 249, 63, 1, 202, 182, 168, 249, 63, 1, 180, 249,
+ 63, 1, 217, 85, 180, 249, 63, 1, 193, 190, 249, 63, 1, 202, 182, 193,
+ 190, 249, 63, 1, 210, 193, 193, 190, 249, 63, 1, 231, 240, 249, 63, 1,
+ 202, 182, 231, 240, 249, 63, 1, 223, 32, 249, 63, 1, 238, 32, 249, 63, 1,
+ 165, 249, 63, 1, 202, 182, 165, 249, 63, 1, 174, 249, 63, 1, 202, 182,
+ 174, 249, 63, 1, 202, 0, 190, 190, 249, 63, 1, 213, 16, 190, 190, 249,
+ 63, 1, 188, 249, 63, 1, 202, 182, 188, 249, 63, 1, 217, 85, 188, 249, 63,
+ 1, 170, 249, 63, 1, 202, 182, 170, 249, 63, 1, 214, 68, 249, 63, 1, 173,
+ 249, 63, 1, 202, 182, 173, 249, 63, 1, 212, 101, 249, 63, 1, 247, 160,
+ 249, 63, 1, 214, 162, 249, 63, 1, 217, 11, 249, 63, 1, 68, 249, 63, 1,
+ 66, 249, 63, 3, 198, 82, 249, 63, 18, 3, 71, 249, 63, 18, 3, 210, 193,
+ 71, 249, 63, 18, 3, 234, 188, 249, 63, 18, 3, 68, 249, 63, 18, 3, 222,
+ 61, 68, 249, 63, 18, 3, 74, 249, 63, 18, 3, 222, 61, 74, 249, 63, 18, 3,
+ 66, 249, 63, 18, 3, 126, 40, 202, 182, 188, 249, 63, 120, 3, 214, 70,
+ 249, 63, 120, 3, 230, 116, 249, 63, 210, 154, 249, 63, 210, 150, 249, 63,
+ 16, 248, 165, 215, 7, 216, 163, 249, 63, 16, 248, 165, 209, 138, 249, 63,
+ 16, 248, 165, 222, 179, 249, 63, 16, 248, 165, 210, 154, 219, 183, 1,
+ 155, 219, 183, 1, 221, 94, 219, 183, 1, 221, 215, 219, 183, 1, 231, 240,
+ 219, 183, 1, 231, 19, 219, 183, 1, 214, 68, 219, 183, 1, 247, 160, 219,
+ 183, 1, 247, 1, 219, 183, 1, 223, 32, 219, 183, 1, 212, 101, 219, 183, 1,
+ 190, 190, 219, 183, 1, 199, 49, 219, 183, 1, 238, 32, 219, 183, 1, 180,
+ 219, 183, 1, 168, 219, 183, 1, 209, 110, 219, 183, 1, 209, 228, 219, 183,
+ 1, 233, 109, 219, 183, 1, 232, 219, 219, 183, 1, 249, 153, 219, 183, 1,
+ 248, 140, 219, 183, 1, 174, 219, 183, 1, 216, 19, 219, 183, 1, 197, 168,
+ 219, 183, 1, 197, 157, 219, 183, 1, 235, 35, 219, 183, 1, 170, 219, 183,
+ 1, 165, 219, 183, 1, 173, 219, 183, 1, 140, 219, 183, 1, 229, 111, 219,
+ 183, 1, 195, 188, 219, 183, 1, 188, 219, 183, 1, 203, 165, 219, 183, 1,
+ 193, 190, 219, 183, 1, 65, 219, 183, 200, 239, 1, 170, 219, 183, 200,
+ 239, 1, 165, 219, 183, 18, 3, 252, 206, 219, 183, 18, 3, 68, 219, 183,
+ 18, 3, 74, 219, 183, 18, 3, 211, 87, 219, 183, 18, 3, 66, 219, 183, 18,
+ 3, 196, 30, 219, 183, 18, 3, 71, 219, 183, 120, 3, 222, 152, 219, 183,
+ 120, 3, 218, 168, 219, 183, 120, 3, 172, 219, 183, 120, 3, 215, 61, 219,
+ 183, 120, 3, 210, 236, 219, 183, 120, 3, 146, 219, 183, 120, 3, 200, 43,
+ 219, 183, 120, 3, 212, 73, 219, 183, 120, 3, 222, 83, 219, 183, 3, 207,
+ 139, 219, 183, 3, 212, 141, 219, 183, 208, 152, 199, 247, 219, 183, 208,
+ 152, 212, 85, 198, 196, 199, 247, 219, 183, 208, 152, 247, 10, 219, 183,
+ 208, 152, 197, 149, 247, 10, 219, 183, 208, 152, 197, 148, 219, 183, 17,
+ 191, 77, 219, 183, 17, 107, 219, 183, 17, 109, 219, 183, 17, 138, 219,
+ 183, 17, 134, 219, 183, 17, 149, 219, 183, 17, 169, 219, 183, 17, 175,
+ 219, 183, 17, 171, 219, 183, 17, 178, 219, 183, 1, 197, 132, 219, 183, 1,
+ 197, 120, 219, 183, 1, 237, 191, 211, 121, 243, 88, 17, 191, 77, 211,
+ 121, 243, 88, 17, 107, 211, 121, 243, 88, 17, 109, 211, 121, 243, 88, 17,
+ 138, 211, 121, 243, 88, 17, 134, 211, 121, 243, 88, 17, 149, 211, 121,
+ 243, 88, 17, 169, 211, 121, 243, 88, 17, 175, 211, 121, 243, 88, 17, 171,
+ 211, 121, 243, 88, 17, 178, 211, 121, 243, 88, 1, 173, 211, 121, 243, 88,
+ 1, 250, 182, 211, 121, 243, 88, 1, 251, 253, 211, 121, 243, 88, 1, 251,
+ 122, 211, 121, 243, 88, 1, 251, 207, 211, 121, 243, 88, 1, 220, 125, 211,
+ 121, 243, 88, 1, 252, 168, 211, 121, 243, 88, 1, 252, 169, 211, 121, 243,
+ 88, 1, 252, 167, 211, 121, 243, 88, 1, 252, 161, 211, 121, 243, 88, 1,
+ 219, 146, 211, 121, 243, 88, 1, 223, 68, 211, 121, 243, 88, 1, 223, 200,
+ 211, 121, 243, 88, 1, 223, 90, 211, 121, 243, 88, 1, 223, 77, 211, 121,
+ 243, 88, 1, 218, 225, 211, 121, 243, 88, 1, 196, 160, 211, 121, 243, 88,
+ 1, 196, 158, 211, 121, 243, 88, 1, 196, 83, 211, 121, 243, 88, 1, 196,
+ 21, 211, 121, 243, 88, 1, 219, 238, 211, 121, 243, 88, 1, 234, 56, 211,
+ 121, 243, 88, 1, 234, 191, 211, 121, 243, 88, 1, 234, 103, 211, 121, 243,
+ 88, 1, 234, 26, 211, 121, 243, 88, 1, 219, 43, 211, 121, 243, 88, 1, 211,
+ 24, 211, 121, 243, 88, 1, 211, 178, 211, 121, 243, 88, 1, 211, 9, 211,
+ 121, 243, 88, 1, 211, 136, 211, 121, 243, 88, 215, 156, 197, 97, 211,
+ 121, 243, 88, 231, 235, 197, 98, 211, 121, 243, 88, 215, 150, 197, 98,
+ 211, 121, 243, 88, 207, 66, 211, 121, 243, 88, 209, 226, 211, 121, 243,
+ 88, 251, 244, 211, 121, 243, 88, 208, 152, 215, 146, 211, 121, 243, 88,
+ 208, 152, 55, 215, 146, 38, 2, 1, 206, 113, 195, 153, 38, 2, 1, 219, 12,
+ 237, 146, 38, 2, 1, 214, 215, 74, 38, 2, 1, 193, 78, 234, 22, 38, 2, 1,
+ 199, 200, 199, 145, 38, 2, 1, 198, 221, 199, 145, 38, 2, 1, 199, 200,
+ 230, 17, 56, 38, 2, 1, 199, 200, 192, 95, 38, 2, 1, 196, 108, 196, 128,
+ 101, 215, 157, 6, 1, 251, 132, 101, 215, 157, 6, 1, 249, 101, 101, 215,
+ 157, 6, 1, 231, 210, 101, 215, 157, 6, 1, 236, 150, 101, 215, 157, 6, 1,
+ 234, 103, 101, 215, 157, 6, 1, 195, 49, 101, 215, 157, 6, 1, 191, 80,
+ 101, 215, 157, 6, 1, 199, 193, 101, 215, 157, 6, 1, 223, 162, 101, 215,
+ 157, 6, 1, 222, 87, 101, 215, 157, 6, 1, 220, 7, 101, 215, 157, 6, 1,
+ 217, 90, 101, 215, 157, 6, 1, 214, 216, 101, 215, 157, 6, 1, 211, 104,
+ 101, 215, 157, 6, 1, 210, 131, 101, 215, 157, 6, 1, 191, 67, 101, 215,
+ 157, 6, 1, 207, 163, 101, 215, 157, 6, 1, 205, 142, 101, 215, 157, 6, 1,
+ 199, 179, 101, 215, 157, 6, 1, 196, 113, 101, 215, 157, 6, 1, 209, 220,
+ 101, 215, 157, 6, 1, 221, 200, 101, 215, 157, 6, 1, 231, 82, 101, 215,
+ 157, 6, 1, 208, 81, 101, 215, 157, 6, 1, 203, 69, 101, 215, 157, 6, 1,
+ 243, 81, 101, 215, 157, 6, 1, 247, 128, 101, 215, 157, 6, 1, 222, 234,
+ 101, 215, 157, 6, 1, 243, 18, 101, 215, 157, 6, 1, 246, 241, 101, 215,
+ 157, 6, 1, 192, 218, 101, 215, 157, 6, 1, 222, 249, 101, 215, 157, 6, 1,
+ 230, 87, 101, 215, 157, 6, 1, 229, 245, 101, 215, 157, 6, 1, 229, 145,
+ 101, 215, 157, 6, 1, 193, 125, 101, 215, 157, 6, 1, 230, 19, 101, 215,
+ 157, 6, 1, 229, 11, 101, 215, 157, 6, 1, 233, 23, 101, 215, 157, 6, 1,
+ 192, 14, 101, 215, 157, 6, 1, 234, 123, 101, 215, 157, 6, 1, 153, 231,
+ 210, 101, 215, 157, 6, 1, 251, 230, 101, 215, 157, 6, 1, 252, 14, 101,
+ 215, 157, 6, 1, 230, 17, 56, 101, 215, 157, 6, 1, 220, 116, 56, 200, 197,
+ 208, 152, 248, 165, 200, 166, 200, 197, 208, 152, 248, 165, 210, 155,
+ 200, 197, 208, 152, 248, 165, 208, 139, 200, 197, 208, 152, 248, 165,
+ 247, 145, 200, 197, 208, 152, 248, 165, 219, 173, 205, 121, 200, 197,
+ 208, 152, 248, 165, 222, 142, 205, 121, 200, 197, 208, 152, 248, 165,
+ 238, 33, 205, 121, 200, 197, 208, 152, 248, 165, 249, 154, 205, 121, 195,
+ 150, 163, 222, 57, 195, 150, 163, 203, 130, 195, 150, 163, 208, 225, 195,
+ 150, 3, 213, 187, 195, 150, 3, 192, 117, 216, 82, 200, 156, 195, 150,
+ 163, 192, 117, 251, 249, 223, 149, 200, 156, 195, 150, 163, 192, 117,
+ 223, 149, 200, 156, 195, 150, 163, 192, 117, 222, 45, 223, 149, 200, 156,
+ 195, 150, 163, 247, 122, 60, 195, 150, 163, 192, 117, 222, 45, 223, 149,
+ 200, 157, 205, 88, 195, 150, 163, 55, 200, 156, 195, 150, 163, 197, 225,
+ 200, 156, 195, 150, 163, 222, 45, 251, 73, 195, 150, 163, 75, 60, 195,
+ 150, 163, 105, 185, 60, 195, 150, 163, 115, 185, 60, 195, 150, 163, 206,
+ 196, 222, 56, 223, 149, 200, 156, 195, 150, 163, 250, 179, 223, 149, 200,
+ 156, 195, 150, 3, 195, 36, 200, 156, 195, 150, 3, 195, 36, 196, 154, 195,
+ 150, 3, 207, 18, 195, 36, 196, 154, 195, 150, 3, 195, 36, 251, 73, 195,
+ 150, 3, 207, 18, 195, 36, 251, 73, 195, 150, 3, 195, 36, 196, 155, 4,
+ 199, 215, 195, 150, 3, 195, 36, 251, 74, 4, 199, 215, 195, 150, 3, 251,
+ 72, 251, 88, 195, 150, 3, 251, 72, 249, 120, 195, 150, 3, 251, 72, 195,
+ 178, 195, 150, 3, 251, 72, 195, 179, 4, 199, 215, 195, 150, 3, 198, 126,
+ 195, 150, 3, 229, 180, 179, 251, 71, 195, 150, 3, 179, 251, 71, 195, 150,
+ 3, 206, 70, 179, 251, 71, 195, 150, 3, 251, 72, 196, 162, 215, 136, 195,
+ 150, 3, 251, 10, 195, 150, 3, 206, 122, 251, 10, 195, 150, 163, 247, 122,
+ 58, 195, 150, 3, 222, 237, 195, 150, 3, 196, 75, 195, 150, 3, 250, 177,
+ 195, 150, 163, 206, 189, 58, 195, 150, 163, 55, 206, 189, 58, 195, 150,
+ 3, 55, 251, 72, 251, 88, 8, 1, 2, 6, 65, 8, 1, 2, 6, 252, 25, 8, 2, 1,
+ 153, 252, 25, 8, 1, 2, 6, 249, 82, 250, 120, 8, 1, 2, 6, 247, 193, 8, 1,
+ 2, 6, 238, 127, 8, 1, 2, 6, 233, 248, 8, 1, 2, 6, 71, 8, 2, 1, 153, 211,
+ 77, 71, 8, 2, 1, 153, 68, 8, 1, 2, 6, 223, 35, 8, 1, 2, 6, 222, 152, 8,
+ 1, 2, 6, 220, 143, 4, 106, 8, 1, 2, 6, 218, 168, 8, 1, 2, 6, 207, 18,
+ 215, 61, 8, 1, 2, 6, 74, 8, 1, 2, 6, 211, 77, 74, 8, 2, 1, 202, 206, 74,
+ 8, 2, 1, 202, 206, 211, 77, 74, 8, 2, 1, 202, 206, 187, 4, 106, 8, 2, 1,
+ 153, 211, 151, 8, 1, 2, 6, 211, 19, 8, 2, 1, 198, 54, 132, 74, 8, 2, 1,
+ 248, 77, 132, 74, 8, 1, 2, 6, 210, 236, 8, 1, 2, 6, 207, 18, 146, 8, 1,
+ 2, 6, 153, 146, 8, 1, 2, 6, 200, 43, 8, 1, 2, 6, 66, 8, 2, 1, 202, 206,
+ 66, 8, 2, 1, 202, 206, 237, 40, 66, 8, 2, 1, 202, 206, 153, 218, 168, 8,
+ 1, 2, 6, 196, 12, 8, 1, 2, 6, 193, 224, 8, 1, 2, 6, 191, 166, 8, 1, 2, 6,
+ 233, 178, 8, 1, 195, 20, 220, 8, 201, 216, 8, 1, 251, 230, 35, 1, 2, 6,
+ 231, 211, 35, 1, 2, 6, 220, 31, 35, 1, 2, 6, 209, 185, 35, 1, 2, 6, 207,
+ 3, 35, 1, 2, 6, 208, 176, 38, 1, 2, 6, 234, 140, 52, 1, 6, 65, 52, 1, 6,
+ 252, 25, 52, 1, 6, 250, 120, 52, 1, 6, 249, 82, 250, 120, 52, 1, 6, 238,
+ 127, 52, 1, 6, 71, 52, 1, 6, 207, 18, 71, 52, 1, 6, 232, 51, 52, 1, 6,
+ 230, 116, 52, 1, 6, 68, 52, 1, 6, 223, 35, 52, 1, 6, 222, 152, 52, 1, 6,
+ 172, 52, 1, 6, 218, 168, 52, 1, 6, 215, 61, 52, 1, 6, 207, 18, 215, 61,
+ 52, 1, 6, 74, 52, 1, 6, 211, 19, 52, 1, 6, 210, 236, 52, 1, 6, 146, 52,
+ 1, 6, 200, 43, 52, 1, 6, 66, 52, 1, 6, 193, 224, 52, 1, 2, 65, 52, 1, 2,
+ 153, 65, 52, 1, 2, 251, 160, 52, 1, 2, 153, 252, 25, 52, 1, 2, 250, 120,
+ 52, 1, 2, 238, 127, 52, 1, 2, 71, 52, 1, 2, 205, 86, 52, 1, 2, 211, 77,
+ 71, 52, 1, 2, 153, 211, 77, 71, 52, 1, 2, 232, 51, 52, 1, 2, 153, 68, 52,
+ 1, 2, 222, 152, 52, 1, 2, 218, 168, 52, 1, 2, 234, 88, 52, 1, 2, 74, 52,
+ 1, 2, 211, 77, 74, 52, 1, 2, 198, 54, 132, 74, 52, 1, 2, 248, 77, 132,
+ 74, 52, 1, 2, 210, 236, 52, 1, 2, 200, 43, 52, 1, 2, 66, 52, 1, 2, 202,
+ 206, 66, 52, 1, 2, 153, 218, 168, 52, 1, 2, 196, 12, 52, 1, 2, 251, 230,
+ 52, 1, 2, 248, 212, 52, 1, 2, 35, 231, 211, 52, 1, 2, 237, 106, 52, 1, 2,
+ 35, 209, 211, 52, 1, 2, 243, 95, 8, 200, 230, 2, 1, 68, 8, 200, 230, 2,
+ 1, 146, 8, 200, 230, 2, 1, 66, 8, 200, 230, 2, 1, 196, 12, 35, 200, 230,
+ 2, 1, 248, 212, 35, 200, 230, 2, 1, 231, 211, 35, 200, 230, 2, 1, 207, 3,
+ 35, 200, 230, 2, 1, 209, 211, 35, 200, 230, 2, 1, 243, 95, 8, 2, 1, 196,
+ 152, 8, 2, 1, 78, 4, 82, 198, 152, 8, 2, 1, 238, 128, 4, 82, 198, 152, 8,
+ 2, 1, 233, 176, 4, 82, 198, 152, 8, 2, 1, 218, 169, 4, 82, 198, 152, 8,
+ 2, 1, 215, 62, 4, 82, 198, 152, 8, 2, 1, 210, 237, 4, 82, 198, 152, 8, 2,
+ 1, 207, 222, 4, 82, 198, 152, 8, 2, 1, 207, 222, 4, 232, 234, 23, 82,
+ 198, 152, 8, 2, 1, 206, 9, 4, 82, 198, 152, 8, 2, 1, 200, 44, 4, 82, 198,
+ 152, 8, 2, 1, 191, 167, 4, 82, 198, 152, 8, 2, 1, 153, 232, 51, 52, 1,
+ 38, 234, 103, 8, 2, 1, 223, 115, 232, 51, 8, 2, 1, 199, 52, 4, 201, 32,
+ 8, 2, 6, 1, 228, 74, 4, 106, 8, 2, 1, 223, 84, 4, 106, 8, 2, 1, 210, 237,
+ 4, 106, 8, 2, 6, 1, 126, 4, 106, 8, 2, 1, 196, 71, 4, 106, 8, 2, 1, 78,
+ 4, 210, 192, 102, 8, 2, 1, 238, 128, 4, 210, 192, 102, 8, 2, 1, 233, 176,
+ 4, 210, 192, 102, 8, 2, 1, 232, 52, 4, 210, 192, 102, 8, 2, 1, 222, 153,
+ 4, 210, 192, 102, 8, 2, 1, 220, 143, 4, 210, 192, 102, 8, 2, 1, 218, 169,
+ 4, 210, 192, 102, 8, 2, 1, 215, 62, 4, 210, 192, 102, 8, 2, 1, 210, 237,
+ 4, 210, 192, 102, 8, 2, 1, 207, 222, 4, 210, 192, 102, 8, 2, 1, 206, 9,
+ 4, 210, 192, 102, 8, 2, 1, 234, 13, 4, 210, 192, 102, 8, 2, 1, 196, 13,
+ 4, 210, 192, 102, 8, 2, 1, 192, 236, 4, 210, 192, 102, 8, 2, 1, 191, 167,
+ 4, 210, 192, 102, 8, 2, 1, 42, 4, 207, 24, 102, 8, 2, 1, 251, 161, 4,
+ 207, 24, 102, 8, 2, 1, 238, 128, 4, 228, 251, 23, 199, 215, 8, 2, 1, 235,
+ 15, 4, 207, 24, 102, 8, 2, 1, 211, 77, 235, 15, 4, 207, 24, 102, 8, 2, 1,
+ 207, 18, 211, 77, 235, 15, 4, 207, 24, 102, 8, 2, 1, 205, 87, 4, 207, 24,
+ 102, 8, 2, 1, 228, 74, 4, 207, 24, 102, 8, 2, 1, 211, 77, 187, 4, 207,
+ 24, 102, 8, 2, 1, 234, 13, 4, 207, 24, 102, 8, 2, 1, 126, 4, 207, 24,
+ 102, 8, 2, 1, 233, 179, 4, 207, 24, 102, 52, 1, 2, 153, 251, 160, 52, 1,
+ 2, 247, 193, 52, 1, 2, 247, 194, 4, 238, 175, 52, 1, 2, 233, 248, 52, 1,
+ 2, 207, 18, 211, 77, 71, 52, 1, 2, 233, 175, 52, 1, 2, 236, 139, 223, 36,
+ 4, 106, 52, 1, 2, 27, 232, 51, 52, 1, 2, 153, 230, 116, 52, 1, 2, 228,
+ 74, 4, 106, 52, 1, 2, 223, 83, 52, 1, 2, 6, 68, 52, 1, 2, 6, 228, 74, 4,
+ 106, 52, 1, 2, 223, 36, 4, 238, 212, 52, 1, 2, 220, 143, 4, 207, 24, 102,
+ 52, 1, 2, 220, 143, 4, 210, 192, 102, 52, 1, 2, 6, 172, 52, 1, 2, 218,
+ 169, 4, 102, 52, 1, 2, 153, 218, 169, 4, 179, 219, 212, 52, 1, 2, 215,
+ 62, 4, 45, 102, 52, 1, 2, 215, 62, 4, 207, 24, 102, 52, 1, 2, 6, 215, 61,
+ 52, 1, 2, 249, 82, 74, 52, 1, 2, 209, 211, 52, 1, 2, 206, 9, 4, 102, 52,
+ 1, 2, 234, 12, 52, 1, 2, 200, 44, 4, 210, 192, 102, 52, 1, 2, 126, 164,
+ 52, 1, 2, 196, 70, 52, 1, 2, 6, 66, 52, 1, 2, 196, 13, 4, 102, 52, 1, 2,
+ 153, 196, 12, 52, 1, 2, 191, 166, 52, 1, 2, 191, 167, 4, 207, 24, 102,
+ 52, 1, 2, 191, 167, 4, 238, 175, 52, 1, 2, 233, 178, 52, 1, 2, 199, 15,
+ 33, 235, 138, 230, 211, 252, 60, 33, 235, 138, 252, 47, 252, 60, 33, 202,
+ 59, 60, 33, 200, 164, 77, 33, 217, 145, 33, 230, 208, 33, 217, 143, 33,
+ 252, 44, 33, 230, 209, 33, 252, 45, 33, 8, 2, 1, 207, 222, 60, 33, 248,
+ 35, 33, 217, 144, 33, 55, 243, 2, 58, 33, 211, 139, 58, 33, 191, 21, 60,
+ 33, 223, 69, 60, 33, 196, 63, 58, 33, 196, 46, 58, 33, 8, 2, 1, 232, 203,
+ 211, 77, 42, 58, 33, 8, 2, 1, 252, 25, 33, 8, 2, 1, 251, 68, 33, 8, 2, 1,
+ 250, 146, 33, 8, 2, 1, 247, 194, 247, 35, 33, 8, 2, 1, 223, 115, 238,
+ 127, 33, 8, 2, 1, 233, 248, 33, 8, 2, 1, 232, 51, 33, 8, 1, 2, 6, 232,
+ 51, 33, 8, 2, 1, 222, 152, 33, 8, 2, 1, 172, 33, 8, 1, 2, 6, 172, 33, 8,
+ 1, 2, 6, 218, 168, 33, 8, 2, 1, 215, 61, 33, 8, 1, 2, 6, 215, 61, 33, 8,
+ 1, 2, 6, 146, 33, 8, 2, 1, 207, 222, 206, 116, 33, 8, 2, 1, 206, 8, 33,
+ 8, 2, 1, 179, 206, 8, 33, 8, 2, 1, 191, 166, 33, 8, 2, 1, 251, 160, 33,
+ 8, 2, 1, 250, 120, 33, 8, 2, 1, 248, 212, 33, 8, 2, 1, 205, 86, 33, 8, 2,
+ 1, 233, 175, 33, 8, 2, 1, 220, 143, 4, 55, 82, 198, 152, 33, 8, 2, 1,
+ 187, 4, 156, 247, 23, 106, 33, 8, 2, 1, 210, 236, 33, 8, 2, 1, 234, 12,
+ 33, 8, 2, 1, 126, 4, 156, 247, 23, 106, 33, 8, 2, 1, 193, 224, 33, 8, 2,
+ 1, 42, 4, 237, 42, 33, 8, 2, 1, 187, 4, 237, 42, 33, 8, 2, 1, 126, 4,
+ 237, 42, 33, 133, 199, 229, 58, 33, 222, 36, 93, 183, 33, 222, 36, 93,
+ 219, 224, 33, 75, 93, 219, 224, 33, 193, 78, 223, 93, 248, 29, 60, 33,
+ 75, 248, 233, 219, 224, 33, 237, 115, 77, 33, 55, 223, 93, 248, 37, 60,
+ 33, 251, 165, 234, 45, 119, 60, 33, 45, 250, 236, 58, 33, 50, 250, 236,
+ 23, 144, 250, 236, 60, 8, 6, 1, 42, 4, 206, 189, 60, 8, 2, 1, 42, 4, 206,
+ 189, 60, 8, 6, 1, 78, 4, 75, 58, 8, 2, 1, 78, 4, 75, 58, 8, 6, 1, 78, 4,
+ 75, 60, 8, 2, 1, 78, 4, 75, 60, 8, 6, 1, 78, 4, 219, 113, 60, 8, 2, 1,
+ 78, 4, 219, 113, 60, 8, 6, 1, 247, 194, 4, 247, 36, 23, 252, 46, 8, 2, 1,
+ 247, 194, 4, 247, 36, 23, 252, 46, 8, 6, 1, 238, 128, 4, 75, 58, 8, 2, 1,
+ 238, 128, 4, 75, 58, 8, 6, 1, 238, 128, 4, 75, 60, 8, 2, 1, 238, 128, 4,
+ 75, 60, 8, 6, 1, 238, 128, 4, 219, 113, 60, 8, 2, 1, 238, 128, 4, 219,
+ 113, 60, 8, 6, 1, 238, 128, 4, 247, 35, 8, 2, 1, 238, 128, 4, 247, 35, 8,
+ 6, 1, 238, 128, 4, 243, 2, 60, 8, 2, 1, 238, 128, 4, 243, 2, 60, 8, 6, 1,
+ 235, 15, 4, 217, 147, 23, 230, 210, 8, 2, 1, 235, 15, 4, 217, 147, 23,
+ 230, 210, 8, 6, 1, 235, 15, 4, 217, 147, 23, 252, 46, 8, 2, 1, 235, 15,
+ 4, 217, 147, 23, 252, 46, 8, 6, 1, 235, 15, 4, 243, 2, 60, 8, 2, 1, 235,
+ 15, 4, 243, 2, 60, 8, 6, 1, 235, 15, 4, 198, 153, 60, 8, 2, 1, 235, 15,
+ 4, 198, 153, 60, 8, 6, 1, 235, 15, 4, 247, 36, 23, 248, 36, 8, 2, 1, 235,
+ 15, 4, 247, 36, 23, 248, 36, 8, 6, 1, 233, 176, 4, 75, 58, 8, 2, 1, 233,
+ 176, 4, 75, 58, 8, 6, 1, 232, 52, 4, 217, 146, 8, 2, 1, 232, 52, 4, 217,
+ 146, 8, 6, 1, 230, 117, 4, 75, 58, 8, 2, 1, 230, 117, 4, 75, 58, 8, 6, 1,
+ 230, 117, 4, 75, 60, 8, 2, 1, 230, 117, 4, 75, 60, 8, 6, 1, 230, 117, 4,
+ 237, 42, 8, 2, 1, 230, 117, 4, 237, 42, 8, 6, 1, 230, 117, 4, 247, 35, 8,
+ 2, 1, 230, 117, 4, 247, 35, 8, 6, 1, 230, 117, 4, 248, 37, 60, 8, 2, 1,
+ 230, 117, 4, 248, 37, 60, 8, 6, 1, 228, 74, 4, 198, 153, 60, 8, 2, 1,
+ 228, 74, 4, 198, 153, 60, 8, 6, 1, 228, 74, 4, 237, 43, 23, 252, 46, 8,
+ 2, 1, 228, 74, 4, 237, 43, 23, 252, 46, 8, 6, 1, 222, 153, 4, 252, 46, 8,
+ 2, 1, 222, 153, 4, 252, 46, 8, 6, 1, 222, 153, 4, 75, 60, 8, 2, 1, 222,
+ 153, 4, 75, 60, 8, 6, 1, 222, 153, 4, 219, 113, 60, 8, 2, 1, 222, 153, 4,
+ 219, 113, 60, 8, 6, 1, 220, 143, 4, 75, 60, 8, 2, 1, 220, 143, 4, 75, 60,
+ 8, 6, 1, 220, 143, 4, 75, 248, 233, 23, 217, 146, 8, 2, 1, 220, 143, 4,
+ 75, 248, 233, 23, 217, 146, 8, 6, 1, 220, 143, 4, 219, 113, 60, 8, 2, 1,
+ 220, 143, 4, 219, 113, 60, 8, 6, 1, 220, 143, 4, 243, 2, 60, 8, 2, 1,
+ 220, 143, 4, 243, 2, 60, 8, 6, 1, 218, 169, 4, 252, 46, 8, 2, 1, 218,
+ 169, 4, 252, 46, 8, 6, 1, 218, 169, 4, 75, 58, 8, 2, 1, 218, 169, 4, 75,
+ 58, 8, 6, 1, 218, 169, 4, 75, 60, 8, 2, 1, 218, 169, 4, 75, 60, 8, 6, 1,
+ 215, 62, 4, 75, 58, 8, 2, 1, 215, 62, 4, 75, 58, 8, 6, 1, 215, 62, 4, 75,
+ 60, 8, 2, 1, 215, 62, 4, 75, 60, 8, 6, 1, 215, 62, 4, 219, 113, 60, 8, 2,
+ 1, 215, 62, 4, 219, 113, 60, 8, 6, 1, 215, 62, 4, 243, 2, 60, 8, 2, 1,
+ 215, 62, 4, 243, 2, 60, 8, 6, 1, 187, 4, 198, 153, 23, 252, 46, 8, 2, 1,
+ 187, 4, 198, 153, 23, 252, 46, 8, 6, 1, 187, 4, 198, 153, 23, 237, 42, 8,
+ 2, 1, 187, 4, 198, 153, 23, 237, 42, 8, 6, 1, 187, 4, 217, 147, 23, 230,
+ 210, 8, 2, 1, 187, 4, 217, 147, 23, 230, 210, 8, 6, 1, 187, 4, 217, 147,
+ 23, 252, 46, 8, 2, 1, 187, 4, 217, 147, 23, 252, 46, 8, 6, 1, 210, 237,
+ 4, 252, 46, 8, 2, 1, 210, 237, 4, 252, 46, 8, 6, 1, 210, 237, 4, 75, 58,
+ 8, 2, 1, 210, 237, 4, 75, 58, 8, 6, 1, 207, 222, 4, 75, 58, 8, 2, 1, 207,
+ 222, 4, 75, 58, 8, 6, 1, 207, 222, 4, 75, 60, 8, 2, 1, 207, 222, 4, 75,
+ 60, 8, 6, 1, 207, 222, 4, 75, 248, 233, 23, 217, 146, 8, 2, 1, 207, 222,
+ 4, 75, 248, 233, 23, 217, 146, 8, 6, 1, 207, 222, 4, 219, 113, 60, 8, 2,
+ 1, 207, 222, 4, 219, 113, 60, 8, 6, 1, 206, 9, 4, 75, 58, 8, 2, 1, 206,
+ 9, 4, 75, 58, 8, 6, 1, 206, 9, 4, 75, 60, 8, 2, 1, 206, 9, 4, 75, 60, 8,
+ 6, 1, 206, 9, 4, 252, 47, 23, 75, 58, 8, 2, 1, 206, 9, 4, 252, 47, 23,
+ 75, 58, 8, 6, 1, 206, 9, 4, 247, 93, 23, 75, 58, 8, 2, 1, 206, 9, 4, 247,
+ 93, 23, 75, 58, 8, 6, 1, 206, 9, 4, 75, 248, 233, 23, 75, 58, 8, 2, 1,
+ 206, 9, 4, 75, 248, 233, 23, 75, 58, 8, 6, 1, 200, 44, 4, 75, 58, 8, 2,
+ 1, 200, 44, 4, 75, 58, 8, 6, 1, 200, 44, 4, 75, 60, 8, 2, 1, 200, 44, 4,
+ 75, 60, 8, 6, 1, 200, 44, 4, 219, 113, 60, 8, 2, 1, 200, 44, 4, 219, 113,
+ 60, 8, 6, 1, 200, 44, 4, 243, 2, 60, 8, 2, 1, 200, 44, 4, 243, 2, 60, 8,
+ 6, 1, 126, 4, 237, 43, 60, 8, 2, 1, 126, 4, 237, 43, 60, 8, 6, 1, 126, 4,
+ 198, 153, 60, 8, 2, 1, 126, 4, 198, 153, 60, 8, 6, 1, 126, 4, 243, 2, 60,
+ 8, 2, 1, 126, 4, 243, 2, 60, 8, 6, 1, 126, 4, 198, 153, 23, 252, 46, 8,
+ 2, 1, 126, 4, 198, 153, 23, 252, 46, 8, 6, 1, 126, 4, 217, 147, 23, 237,
+ 42, 8, 2, 1, 126, 4, 217, 147, 23, 237, 42, 8, 6, 1, 196, 13, 4, 198,
+ 152, 8, 2, 1, 196, 13, 4, 198, 152, 8, 6, 1, 196, 13, 4, 75, 60, 8, 2, 1,
+ 196, 13, 4, 75, 60, 8, 6, 1, 193, 225, 4, 230, 210, 8, 2, 1, 193, 225, 4,
+ 230, 210, 8, 6, 1, 193, 225, 4, 252, 46, 8, 2, 1, 193, 225, 4, 252, 46,
+ 8, 6, 1, 193, 225, 4, 237, 42, 8, 2, 1, 193, 225, 4, 237, 42, 8, 6, 1,
+ 193, 225, 4, 75, 58, 8, 2, 1, 193, 225, 4, 75, 58, 8, 6, 1, 193, 225, 4,
+ 75, 60, 8, 2, 1, 193, 225, 4, 75, 60, 8, 6, 1, 192, 236, 4, 75, 58, 8, 2,
+ 1, 192, 236, 4, 75, 58, 8, 6, 1, 192, 236, 4, 237, 42, 8, 2, 1, 192, 236,
+ 4, 237, 42, 8, 6, 1, 192, 160, 4, 75, 58, 8, 2, 1, 192, 160, 4, 75, 58,
+ 8, 6, 1, 191, 167, 4, 243, 1, 8, 2, 1, 191, 167, 4, 243, 1, 8, 6, 1, 191,
+ 167, 4, 75, 60, 8, 2, 1, 191, 167, 4, 75, 60, 8, 6, 1, 191, 167, 4, 219,
+ 113, 60, 8, 2, 1, 191, 167, 4, 219, 113, 60, 8, 2, 1, 230, 117, 4, 219,
+ 113, 60, 8, 2, 1, 200, 44, 4, 237, 42, 8, 2, 1, 193, 225, 4, 206, 189,
+ 58, 8, 2, 1, 192, 160, 4, 206, 189, 58, 8, 2, 1, 42, 4, 50, 132, 206,
+ 188, 8, 2, 1, 179, 206, 9, 4, 75, 58, 8, 2, 1, 179, 206, 9, 4, 237, 39,
+ 106, 8, 2, 1, 179, 206, 9, 4, 137, 106, 8, 6, 1, 203, 127, 206, 8, 8, 2,
+ 1, 237, 106, 8, 6, 1, 42, 4, 75, 60, 8, 2, 1, 42, 4, 75, 60, 8, 6, 1, 42,
+ 4, 228, 251, 58, 8, 2, 1, 42, 4, 228, 251, 58, 8, 6, 1, 42, 4, 243, 2,
+ 23, 252, 46, 8, 2, 1, 42, 4, 243, 2, 23, 252, 46, 8, 6, 1, 42, 4, 243, 2,
+ 23, 230, 210, 8, 2, 1, 42, 4, 243, 2, 23, 230, 210, 8, 6, 1, 42, 4, 243,
+ 2, 23, 228, 251, 58, 8, 2, 1, 42, 4, 243, 2, 23, 228, 251, 58, 8, 6, 1,
+ 42, 4, 243, 2, 23, 198, 152, 8, 2, 1, 42, 4, 243, 2, 23, 198, 152, 8, 6,
+ 1, 42, 4, 243, 2, 23, 75, 60, 8, 2, 1, 42, 4, 243, 2, 23, 75, 60, 8, 6,
+ 1, 42, 4, 248, 37, 23, 252, 46, 8, 2, 1, 42, 4, 248, 37, 23, 252, 46, 8,
+ 6, 1, 42, 4, 248, 37, 23, 230, 210, 8, 2, 1, 42, 4, 248, 37, 23, 230,
+ 210, 8, 6, 1, 42, 4, 248, 37, 23, 228, 251, 58, 8, 2, 1, 42, 4, 248, 37,
+ 23, 228, 251, 58, 8, 6, 1, 42, 4, 248, 37, 23, 198, 152, 8, 2, 1, 42, 4,
+ 248, 37, 23, 198, 152, 8, 6, 1, 42, 4, 248, 37, 23, 75, 60, 8, 2, 1, 42,
+ 4, 248, 37, 23, 75, 60, 8, 6, 1, 235, 15, 4, 75, 60, 8, 2, 1, 235, 15, 4,
+ 75, 60, 8, 6, 1, 235, 15, 4, 228, 251, 58, 8, 2, 1, 235, 15, 4, 228, 251,
+ 58, 8, 6, 1, 235, 15, 4, 198, 152, 8, 2, 1, 235, 15, 4, 198, 152, 8, 6,
+ 1, 235, 15, 4, 243, 2, 23, 252, 46, 8, 2, 1, 235, 15, 4, 243, 2, 23, 252,
+ 46, 8, 6, 1, 235, 15, 4, 243, 2, 23, 230, 210, 8, 2, 1, 235, 15, 4, 243,
+ 2, 23, 230, 210, 8, 6, 1, 235, 15, 4, 243, 2, 23, 228, 251, 58, 8, 2, 1,
+ 235, 15, 4, 243, 2, 23, 228, 251, 58, 8, 6, 1, 235, 15, 4, 243, 2, 23,
+ 198, 152, 8, 2, 1, 235, 15, 4, 243, 2, 23, 198, 152, 8, 6, 1, 235, 15, 4,
+ 243, 2, 23, 75, 60, 8, 2, 1, 235, 15, 4, 243, 2, 23, 75, 60, 8, 6, 1,
+ 228, 74, 4, 228, 251, 58, 8, 2, 1, 228, 74, 4, 228, 251, 58, 8, 6, 1,
+ 228, 74, 4, 75, 60, 8, 2, 1, 228, 74, 4, 75, 60, 8, 6, 1, 187, 4, 75, 60,
+ 8, 2, 1, 187, 4, 75, 60, 8, 6, 1, 187, 4, 228, 251, 58, 8, 2, 1, 187, 4,
+ 228, 251, 58, 8, 6, 1, 187, 4, 243, 2, 23, 252, 46, 8, 2, 1, 187, 4, 243,
+ 2, 23, 252, 46, 8, 6, 1, 187, 4, 243, 2, 23, 230, 210, 8, 2, 1, 187, 4,
+ 243, 2, 23, 230, 210, 8, 6, 1, 187, 4, 243, 2, 23, 228, 251, 58, 8, 2, 1,
+ 187, 4, 243, 2, 23, 228, 251, 58, 8, 6, 1, 187, 4, 243, 2, 23, 198, 152,
+ 8, 2, 1, 187, 4, 243, 2, 23, 198, 152, 8, 6, 1, 187, 4, 243, 2, 23, 75,
+ 60, 8, 2, 1, 187, 4, 243, 2, 23, 75, 60, 8, 6, 1, 187, 4, 228, 188, 23,
+ 252, 46, 8, 2, 1, 187, 4, 228, 188, 23, 252, 46, 8, 6, 1, 187, 4, 228,
+ 188, 23, 230, 210, 8, 2, 1, 187, 4, 228, 188, 23, 230, 210, 8, 6, 1, 187,
+ 4, 228, 188, 23, 228, 251, 58, 8, 2, 1, 187, 4, 228, 188, 23, 228, 251,
+ 58, 8, 6, 1, 187, 4, 228, 188, 23, 198, 152, 8, 2, 1, 187, 4, 228, 188,
+ 23, 198, 152, 8, 6, 1, 187, 4, 228, 188, 23, 75, 60, 8, 2, 1, 187, 4,
+ 228, 188, 23, 75, 60, 8, 6, 1, 126, 4, 75, 60, 8, 2, 1, 126, 4, 75, 60,
+ 8, 6, 1, 126, 4, 228, 251, 58, 8, 2, 1, 126, 4, 228, 251, 58, 8, 6, 1,
+ 126, 4, 228, 188, 23, 252, 46, 8, 2, 1, 126, 4, 228, 188, 23, 252, 46, 8,
+ 6, 1, 126, 4, 228, 188, 23, 230, 210, 8, 2, 1, 126, 4, 228, 188, 23, 230,
+ 210, 8, 6, 1, 126, 4, 228, 188, 23, 228, 251, 58, 8, 2, 1, 126, 4, 228,
+ 188, 23, 228, 251, 58, 8, 6, 1, 126, 4, 228, 188, 23, 198, 152, 8, 2, 1,
+ 126, 4, 228, 188, 23, 198, 152, 8, 6, 1, 126, 4, 228, 188, 23, 75, 60, 8,
+ 2, 1, 126, 4, 228, 188, 23, 75, 60, 8, 6, 1, 192, 160, 4, 230, 210, 8, 2,
+ 1, 192, 160, 4, 230, 210, 8, 6, 1, 192, 160, 4, 75, 60, 8, 2, 1, 192,
+ 160, 4, 75, 60, 8, 6, 1, 192, 160, 4, 228, 251, 58, 8, 2, 1, 192, 160, 4,
+ 228, 251, 58, 8, 6, 1, 192, 160, 4, 198, 152, 8, 2, 1, 192, 160, 4, 198,
+ 152, 8, 6, 1, 216, 83, 219, 74, 8, 2, 1, 216, 83, 219, 74, 8, 6, 1, 216,
+ 83, 196, 12, 8, 2, 1, 216, 83, 196, 12, 8, 6, 1, 192, 160, 4, 219, 4, 8,
+ 2, 1, 192, 160, 4, 219, 4, 35, 2, 1, 251, 161, 4, 208, 169, 35, 2, 1,
+ 251, 161, 4, 237, 212, 35, 2, 1, 251, 161, 4, 208, 170, 23, 195, 169, 35,
+ 2, 1, 251, 161, 4, 237, 213, 23, 195, 169, 35, 2, 1, 251, 161, 4, 208,
+ 170, 23, 210, 243, 35, 2, 1, 251, 161, 4, 237, 213, 23, 210, 243, 35, 2,
+ 1, 251, 161, 4, 208, 170, 23, 210, 4, 35, 2, 1, 251, 161, 4, 237, 213,
+ 23, 210, 4, 35, 6, 1, 251, 161, 4, 208, 169, 35, 6, 1, 251, 161, 4, 237,
+ 212, 35, 6, 1, 251, 161, 4, 208, 170, 23, 195, 169, 35, 6, 1, 251, 161,
+ 4, 237, 213, 23, 195, 169, 35, 6, 1, 251, 161, 4, 208, 170, 23, 210, 243,
+ 35, 6, 1, 251, 161, 4, 237, 213, 23, 210, 243, 35, 6, 1, 251, 161, 4,
+ 208, 170, 23, 210, 4, 35, 6, 1, 251, 161, 4, 237, 213, 23, 210, 4, 35, 2,
+ 1, 234, 48, 4, 208, 169, 35, 2, 1, 234, 48, 4, 237, 212, 35, 2, 1, 234,
+ 48, 4, 208, 170, 23, 195, 169, 35, 2, 1, 234, 48, 4, 237, 213, 23, 195,
+ 169, 35, 2, 1, 234, 48, 4, 208, 170, 23, 210, 243, 35, 2, 1, 234, 48, 4,
+ 237, 213, 23, 210, 243, 35, 6, 1, 234, 48, 4, 208, 169, 35, 6, 1, 234,
+ 48, 4, 237, 212, 35, 6, 1, 234, 48, 4, 208, 170, 23, 195, 169, 35, 6, 1,
+ 234, 48, 4, 237, 213, 23, 195, 169, 35, 6, 1, 234, 48, 4, 208, 170, 23,
+ 210, 243, 35, 6, 1, 234, 48, 4, 237, 213, 23, 210, 243, 35, 2, 1, 233,
+ 254, 4, 208, 169, 35, 2, 1, 233, 254, 4, 237, 212, 35, 2, 1, 233, 254, 4,
+ 208, 170, 23, 195, 169, 35, 2, 1, 233, 254, 4, 237, 213, 23, 195, 169,
+ 35, 2, 1, 233, 254, 4, 208, 170, 23, 210, 243, 35, 2, 1, 233, 254, 4,
+ 237, 213, 23, 210, 243, 35, 2, 1, 233, 254, 4, 208, 170, 23, 210, 4, 35,
+ 2, 1, 233, 254, 4, 237, 213, 23, 210, 4, 35, 6, 1, 233, 254, 4, 208, 169,
+ 35, 6, 1, 233, 254, 4, 237, 212, 35, 6, 1, 233, 254, 4, 208, 170, 23,
+ 195, 169, 35, 6, 1, 233, 254, 4, 237, 213, 23, 195, 169, 35, 6, 1, 233,
+ 254, 4, 208, 170, 23, 210, 243, 35, 6, 1, 233, 254, 4, 237, 213, 23, 210,
+ 243, 35, 6, 1, 233, 254, 4, 208, 170, 23, 210, 4, 35, 6, 1, 233, 254, 4,
+ 237, 213, 23, 210, 4, 35, 2, 1, 223, 84, 4, 208, 169, 35, 2, 1, 223, 84,
+ 4, 237, 212, 35, 2, 1, 223, 84, 4, 208, 170, 23, 195, 169, 35, 2, 1, 223,
+ 84, 4, 237, 213, 23, 195, 169, 35, 2, 1, 223, 84, 4, 208, 170, 23, 210,
+ 243, 35, 2, 1, 223, 84, 4, 237, 213, 23, 210, 243, 35, 2, 1, 223, 84, 4,
+ 208, 170, 23, 210, 4, 35, 2, 1, 223, 84, 4, 237, 213, 23, 210, 4, 35, 6,
+ 1, 223, 84, 4, 208, 169, 35, 6, 1, 223, 84, 4, 237, 212, 35, 6, 1, 223,
+ 84, 4, 208, 170, 23, 195, 169, 35, 6, 1, 223, 84, 4, 237, 213, 23, 195,
+ 169, 35, 6, 1, 223, 84, 4, 208, 170, 23, 210, 243, 35, 6, 1, 223, 84, 4,
+ 237, 213, 23, 210, 243, 35, 6, 1, 223, 84, 4, 208, 170, 23, 210, 4, 35,
+ 6, 1, 223, 84, 4, 237, 213, 23, 210, 4, 35, 2, 1, 211, 108, 4, 208, 169,
+ 35, 2, 1, 211, 108, 4, 237, 212, 35, 2, 1, 211, 108, 4, 208, 170, 23,
+ 195, 169, 35, 2, 1, 211, 108, 4, 237, 213, 23, 195, 169, 35, 2, 1, 211,
+ 108, 4, 208, 170, 23, 210, 243, 35, 2, 1, 211, 108, 4, 237, 213, 23, 210,
+ 243, 35, 6, 1, 211, 108, 4, 208, 169, 35, 6, 1, 211, 108, 4, 237, 212,
+ 35, 6, 1, 211, 108, 4, 208, 170, 23, 195, 169, 35, 6, 1, 211, 108, 4,
+ 237, 213, 23, 195, 169, 35, 6, 1, 211, 108, 4, 208, 170, 23, 210, 243,
+ 35, 6, 1, 211, 108, 4, 237, 213, 23, 210, 243, 35, 2, 1, 196, 71, 4, 208,
+ 169, 35, 2, 1, 196, 71, 4, 237, 212, 35, 2, 1, 196, 71, 4, 208, 170, 23,
+ 195, 169, 35, 2, 1, 196, 71, 4, 237, 213, 23, 195, 169, 35, 2, 1, 196,
+ 71, 4, 208, 170, 23, 210, 243, 35, 2, 1, 196, 71, 4, 237, 213, 23, 210,
+ 243, 35, 2, 1, 196, 71, 4, 208, 170, 23, 210, 4, 35, 2, 1, 196, 71, 4,
+ 237, 213, 23, 210, 4, 35, 6, 1, 196, 71, 4, 237, 212, 35, 6, 1, 196, 71,
+ 4, 237, 213, 23, 195, 169, 35, 6, 1, 196, 71, 4, 237, 213, 23, 210, 243,
+ 35, 6, 1, 196, 71, 4, 237, 213, 23, 210, 4, 35, 2, 1, 211, 111, 4, 208,
+ 169, 35, 2, 1, 211, 111, 4, 237, 212, 35, 2, 1, 211, 111, 4, 208, 170,
+ 23, 195, 169, 35, 2, 1, 211, 111, 4, 237, 213, 23, 195, 169, 35, 2, 1,
+ 211, 111, 4, 208, 170, 23, 210, 243, 35, 2, 1, 211, 111, 4, 237, 213, 23,
+ 210, 243, 35, 2, 1, 211, 111, 4, 208, 170, 23, 210, 4, 35, 2, 1, 211,
+ 111, 4, 237, 213, 23, 210, 4, 35, 6, 1, 211, 111, 4, 208, 169, 35, 6, 1,
+ 211, 111, 4, 237, 212, 35, 6, 1, 211, 111, 4, 208, 170, 23, 195, 169, 35,
+ 6, 1, 211, 111, 4, 237, 213, 23, 195, 169, 35, 6, 1, 211, 111, 4, 208,
+ 170, 23, 210, 243, 35, 6, 1, 211, 111, 4, 237, 213, 23, 210, 243, 35, 6,
+ 1, 211, 111, 4, 208, 170, 23, 210, 4, 35, 6, 1, 211, 111, 4, 237, 213,
+ 23, 210, 4, 35, 2, 1, 251, 161, 4, 195, 169, 35, 2, 1, 251, 161, 4, 210,
+ 243, 35, 2, 1, 234, 48, 4, 195, 169, 35, 2, 1, 234, 48, 4, 210, 243, 35,
+ 2, 1, 233, 254, 4, 195, 169, 35, 2, 1, 233, 254, 4, 210, 243, 35, 2, 1,
+ 223, 84, 4, 195, 169, 35, 2, 1, 223, 84, 4, 210, 243, 35, 2, 1, 211, 108,
+ 4, 195, 169, 35, 2, 1, 211, 108, 4, 210, 243, 35, 2, 1, 196, 71, 4, 195,
+ 169, 35, 2, 1, 196, 71, 4, 210, 243, 35, 2, 1, 211, 111, 4, 195, 169, 35,
+ 2, 1, 211, 111, 4, 210, 243, 35, 2, 1, 251, 161, 4, 208, 170, 23, 191,
+ 233, 35, 2, 1, 251, 161, 4, 237, 213, 23, 191, 233, 35, 2, 1, 251, 161,
+ 4, 208, 170, 23, 195, 170, 23, 191, 233, 35, 2, 1, 251, 161, 4, 237, 213,
+ 23, 195, 170, 23, 191, 233, 35, 2, 1, 251, 161, 4, 208, 170, 23, 210,
+ 244, 23, 191, 233, 35, 2, 1, 251, 161, 4, 237, 213, 23, 210, 244, 23,
+ 191, 233, 35, 2, 1, 251, 161, 4, 208, 170, 23, 210, 5, 23, 191, 233, 35,
+ 2, 1, 251, 161, 4, 237, 213, 23, 210, 5, 23, 191, 233, 35, 6, 1, 251,
+ 161, 4, 208, 170, 23, 208, 184, 35, 6, 1, 251, 161, 4, 237, 213, 23, 208,
+ 184, 35, 6, 1, 251, 161, 4, 208, 170, 23, 195, 170, 23, 208, 184, 35, 6,
+ 1, 251, 161, 4, 237, 213, 23, 195, 170, 23, 208, 184, 35, 6, 1, 251, 161,
+ 4, 208, 170, 23, 210, 244, 23, 208, 184, 35, 6, 1, 251, 161, 4, 237, 213,
+ 23, 210, 244, 23, 208, 184, 35, 6, 1, 251, 161, 4, 208, 170, 23, 210, 5,
+ 23, 208, 184, 35, 6, 1, 251, 161, 4, 237, 213, 23, 210, 5, 23, 208, 184,
+ 35, 2, 1, 233, 254, 4, 208, 170, 23, 191, 233, 35, 2, 1, 233, 254, 4,
+ 237, 213, 23, 191, 233, 35, 2, 1, 233, 254, 4, 208, 170, 23, 195, 170,
+ 23, 191, 233, 35, 2, 1, 233, 254, 4, 237, 213, 23, 195, 170, 23, 191,
+ 233, 35, 2, 1, 233, 254, 4, 208, 170, 23, 210, 244, 23, 191, 233, 35, 2,
+ 1, 233, 254, 4, 237, 213, 23, 210, 244, 23, 191, 233, 35, 2, 1, 233, 254,
+ 4, 208, 170, 23, 210, 5, 23, 191, 233, 35, 2, 1, 233, 254, 4, 237, 213,
+ 23, 210, 5, 23, 191, 233, 35, 6, 1, 233, 254, 4, 208, 170, 23, 208, 184,
+ 35, 6, 1, 233, 254, 4, 237, 213, 23, 208, 184, 35, 6, 1, 233, 254, 4,
+ 208, 170, 23, 195, 170, 23, 208, 184, 35, 6, 1, 233, 254, 4, 237, 213,
+ 23, 195, 170, 23, 208, 184, 35, 6, 1, 233, 254, 4, 208, 170, 23, 210,
+ 244, 23, 208, 184, 35, 6, 1, 233, 254, 4, 237, 213, 23, 210, 244, 23,
+ 208, 184, 35, 6, 1, 233, 254, 4, 208, 170, 23, 210, 5, 23, 208, 184, 35,
+ 6, 1, 233, 254, 4, 237, 213, 23, 210, 5, 23, 208, 184, 35, 2, 1, 211,
+ 111, 4, 208, 170, 23, 191, 233, 35, 2, 1, 211, 111, 4, 237, 213, 23, 191,
+ 233, 35, 2, 1, 211, 111, 4, 208, 170, 23, 195, 170, 23, 191, 233, 35, 2,
+ 1, 211, 111, 4, 237, 213, 23, 195, 170, 23, 191, 233, 35, 2, 1, 211, 111,
+ 4, 208, 170, 23, 210, 244, 23, 191, 233, 35, 2, 1, 211, 111, 4, 237, 213,
+ 23, 210, 244, 23, 191, 233, 35, 2, 1, 211, 111, 4, 208, 170, 23, 210, 5,
+ 23, 191, 233, 35, 2, 1, 211, 111, 4, 237, 213, 23, 210, 5, 23, 191, 233,
+ 35, 6, 1, 211, 111, 4, 208, 170, 23, 208, 184, 35, 6, 1, 211, 111, 4,
+ 237, 213, 23, 208, 184, 35, 6, 1, 211, 111, 4, 208, 170, 23, 195, 170,
+ 23, 208, 184, 35, 6, 1, 211, 111, 4, 237, 213, 23, 195, 170, 23, 208,
+ 184, 35, 6, 1, 211, 111, 4, 208, 170, 23, 210, 244, 23, 208, 184, 35, 6,
+ 1, 211, 111, 4, 237, 213, 23, 210, 244, 23, 208, 184, 35, 6, 1, 211, 111,
+ 4, 208, 170, 23, 210, 5, 23, 208, 184, 35, 6, 1, 211, 111, 4, 237, 213,
+ 23, 210, 5, 23, 208, 184, 35, 2, 1, 251, 161, 4, 194, 254, 35, 2, 1, 251,
+ 161, 4, 217, 146, 35, 2, 1, 251, 161, 4, 195, 170, 23, 191, 233, 35, 2,
+ 1, 251, 161, 4, 191, 233, 35, 2, 1, 251, 161, 4, 210, 244, 23, 191, 233,
+ 35, 2, 1, 251, 161, 4, 210, 4, 35, 2, 1, 251, 161, 4, 210, 5, 23, 191,
+ 233, 35, 6, 1, 251, 161, 4, 194, 254, 35, 6, 1, 251, 161, 4, 217, 146,
+ 35, 6, 1, 251, 161, 4, 195, 169, 35, 6, 1, 251, 161, 4, 210, 243, 35, 6,
+ 1, 251, 161, 4, 208, 184, 35, 221, 30, 35, 208, 184, 35, 208, 169, 35,
+ 210, 4, 35, 237, 36, 23, 210, 4, 35, 2, 1, 233, 254, 4, 195, 170, 23,
+ 191, 233, 35, 2, 1, 233, 254, 4, 191, 233, 35, 2, 1, 233, 254, 4, 210,
+ 244, 23, 191, 233, 35, 2, 1, 233, 254, 4, 210, 4, 35, 2, 1, 233, 254, 4,
+ 210, 5, 23, 191, 233, 35, 6, 1, 234, 48, 4, 195, 169, 35, 6, 1, 234, 48,
+ 4, 210, 243, 35, 6, 1, 233, 254, 4, 195, 169, 35, 6, 1, 233, 254, 4, 210,
+ 243, 35, 6, 1, 233, 254, 4, 208, 184, 35, 208, 170, 23, 195, 169, 35,
+ 208, 170, 23, 210, 243, 35, 208, 170, 23, 210, 4, 35, 2, 1, 223, 84, 4,
+ 194, 254, 35, 2, 1, 223, 84, 4, 217, 146, 35, 2, 1, 223, 84, 4, 237, 36,
+ 23, 195, 169, 35, 2, 1, 223, 84, 4, 237, 36, 23, 210, 243, 35, 2, 1, 223,
+ 84, 4, 210, 4, 35, 2, 1, 223, 84, 4, 237, 36, 23, 210, 4, 35, 6, 1, 223,
+ 84, 4, 194, 254, 35, 6, 1, 223, 84, 4, 217, 146, 35, 6, 1, 223, 84, 4,
+ 195, 169, 35, 6, 1, 223, 84, 4, 210, 243, 35, 237, 213, 23, 195, 169, 35,
+ 237, 213, 23, 210, 243, 35, 237, 213, 23, 210, 4, 35, 2, 1, 196, 71, 4,
+ 194, 254, 35, 2, 1, 196, 71, 4, 217, 146, 35, 2, 1, 196, 71, 4, 237, 36,
+ 23, 195, 169, 35, 2, 1, 196, 71, 4, 237, 36, 23, 210, 243, 35, 2, 1, 207,
+ 4, 4, 208, 169, 35, 2, 1, 207, 4, 4, 237, 212, 35, 2, 1, 196, 71, 4, 210,
+ 4, 35, 2, 1, 196, 71, 4, 237, 36, 23, 210, 4, 35, 6, 1, 196, 71, 4, 194,
+ 254, 35, 6, 1, 196, 71, 4, 217, 146, 35, 6, 1, 196, 71, 4, 195, 169, 35,
+ 6, 1, 196, 71, 4, 210, 243, 35, 6, 1, 207, 4, 4, 237, 212, 35, 237, 36,
+ 23, 195, 169, 35, 237, 36, 23, 210, 243, 35, 195, 169, 35, 2, 1, 211,
+ 111, 4, 195, 170, 23, 191, 233, 35, 2, 1, 211, 111, 4, 191, 233, 35, 2,
+ 1, 211, 111, 4, 210, 244, 23, 191, 233, 35, 2, 1, 211, 111, 4, 210, 4,
+ 35, 2, 1, 211, 111, 4, 210, 5, 23, 191, 233, 35, 6, 1, 211, 108, 4, 195,
+ 169, 35, 6, 1, 211, 108, 4, 210, 243, 35, 6, 1, 211, 111, 4, 195, 169,
+ 35, 6, 1, 211, 111, 4, 210, 243, 35, 6, 1, 211, 111, 4, 208, 184, 35,
+ 210, 243, 35, 237, 212, 234, 104, 208, 30, 234, 115, 208, 30, 234, 104,
+ 201, 247, 234, 115, 201, 247, 198, 219, 201, 247, 232, 126, 201, 247,
+ 202, 134, 201, 247, 233, 13, 201, 247, 208, 152, 201, 247, 199, 4, 201,
+ 247, 230, 79, 201, 247, 191, 78, 193, 75, 201, 247, 191, 78, 193, 75,
+ 213, 29, 191, 78, 193, 75, 222, 196, 219, 215, 77, 206, 199, 77, 228, 88,
+ 213, 30, 228, 88, 233, 13, 237, 215, 234, 104, 237, 215, 234, 115, 237,
+ 215, 228, 241, 164, 55, 81, 219, 112, 55, 130, 219, 112, 45, 202, 170,
+ 207, 252, 77, 50, 202, 170, 207, 252, 77, 202, 170, 218, 240, 207, 252,
+ 77, 202, 170, 229, 132, 207, 252, 77, 45, 55, 207, 252, 77, 50, 55, 207,
+ 252, 77, 55, 218, 240, 207, 252, 77, 55, 229, 132, 207, 252, 77, 238, 14,
+ 55, 238, 14, 247, 248, 197, 238, 247, 248, 91, 75, 219, 236, 105, 75,
+ 219, 236, 228, 241, 234, 120, 228, 86, 209, 61, 219, 113, 204, 10, 210,
+ 128, 204, 10, 219, 215, 234, 113, 206, 199, 234, 113, 209, 34, 236, 232,
+ 232, 144, 219, 215, 210, 252, 206, 199, 210, 252, 214, 215, 213, 37, 201,
+ 247, 210, 14, 216, 50, 56, 210, 14, 199, 96, 198, 230, 56, 208, 215, 55,
+ 208, 215, 197, 225, 208, 215, 207, 18, 208, 215, 207, 18, 55, 208, 215,
+ 207, 18, 197, 225, 208, 215, 247, 96, 202, 170, 219, 219, 251, 116, 207,
+ 252, 77, 202, 170, 206, 203, 251, 116, 207, 252, 77, 207, 83, 77, 55,
+ 233, 216, 77, 223, 102, 210, 254, 196, 100, 246, 240, 198, 178, 247, 97,
+ 223, 119, 209, 61, 250, 191, 228, 89, 247, 248, 232, 118, 202, 97, 45,
+ 51, 248, 54, 4, 208, 7, 50, 51, 248, 54, 4, 208, 7, 55, 208, 13, 77, 208,
+ 13, 233, 216, 77, 233, 216, 208, 13, 77, 198, 128, 3, 233, 255, 207, 18,
+ 209, 142, 56, 62, 118, 247, 248, 62, 96, 247, 248, 130, 250, 193, 207,
+ 18, 204, 25, 242, 220, 196, 77, 105, 250, 192, 251, 178, 195, 84, 242,
+ 72, 216, 35, 56, 200, 129, 237, 215, 223, 93, 196, 100, 232, 187, 208,
+ 152, 77, 115, 75, 208, 151, 208, 26, 208, 215, 232, 128, 75, 208, 151,
+ 232, 226, 75, 208, 151, 105, 75, 208, 151, 232, 128, 75, 77, 235, 138,
+ 238, 217, 197, 237, 81, 232, 128, 236, 138, 216, 213, 13, 201, 247, 193,
+ 23, 222, 196, 232, 77, 251, 44, 223, 91, 198, 144, 223, 91, 204, 10, 223,
+ 91, 209, 81, 219, 215, 223, 59, 206, 199, 223, 59, 232, 238, 201, 14,
+ 223, 59, 209, 34, 236, 232, 223, 59, 223, 132, 200, 75, 200, 147, 252,
+ 49, 200, 75, 200, 147, 223, 132, 9, 232, 146, 203, 133, 252, 49, 9, 232,
+ 146, 203, 133, 214, 208, 17, 203, 134, 213, 33, 17, 203, 134, 200, 182,
+ 191, 77, 200, 182, 8, 2, 1, 68, 200, 182, 134, 200, 182, 149, 200, 182,
+ 169, 200, 182, 175, 200, 182, 171, 200, 182, 178, 200, 182, 108, 56, 200,
+ 182, 216, 34, 200, 182, 234, 43, 56, 200, 182, 45, 210, 113, 200, 182,
+ 50, 210, 113, 200, 182, 8, 2, 1, 215, 61, 200, 230, 191, 77, 200, 230,
+ 107, 200, 230, 109, 200, 230, 138, 200, 230, 134, 200, 230, 149, 200,
+ 230, 169, 200, 230, 175, 200, 230, 171, 200, 230, 178, 200, 230, 108, 56,
+ 200, 230, 216, 34, 200, 230, 234, 43, 56, 200, 230, 45, 210, 113, 200,
+ 230, 50, 210, 113, 8, 200, 230, 2, 1, 65, 8, 200, 230, 2, 1, 71, 8, 200,
+ 230, 2, 1, 74, 8, 200, 230, 2, 1, 192, 235, 8, 200, 230, 2, 1, 205, 86,
+ 8, 200, 230, 2, 1, 230, 116, 8, 200, 230, 2, 1, 222, 152, 8, 200, 230, 2,
+ 1, 172, 8, 200, 230, 2, 1, 218, 168, 8, 200, 230, 2, 1, 215, 61, 8, 200,
+ 230, 2, 1, 210, 236, 8, 200, 230, 2, 1, 206, 8, 8, 200, 230, 2, 1, 200,
+ 43, 233, 233, 56, 242, 84, 56, 238, 200, 56, 232, 106, 232, 111, 56, 219,
+ 91, 56, 216, 51, 56, 214, 234, 56, 209, 245, 56, 206, 36, 56, 193, 31,
+ 56, 214, 80, 203, 99, 56, 236, 149, 56, 233, 234, 56, 221, 135, 56, 197,
+ 81, 56, 235, 116, 56, 231, 138, 210, 27, 56, 209, 242, 56, 230, 174, 56,
+ 250, 153, 56, 228, 166, 56, 247, 37, 56, 219, 81, 198, 33, 56, 201, 226,
+ 56, 199, 93, 56, 223, 147, 206, 36, 56, 197, 60, 219, 91, 56, 213, 19,
+ 87, 56, 217, 88, 56, 206, 59, 56, 220, 9, 56, 248, 147, 56, 202, 22, 56,
+ 33, 45, 230, 13, 58, 33, 50, 230, 13, 58, 33, 179, 81, 219, 113, 210,
+ 255, 33, 203, 40, 81, 219, 113, 210, 255, 33, 251, 85, 64, 58, 33, 242,
+ 221, 64, 58, 33, 45, 64, 58, 33, 50, 64, 58, 33, 206, 189, 210, 255, 33,
+ 242, 221, 206, 189, 210, 255, 33, 251, 85, 206, 189, 210, 255, 33, 115,
+ 185, 58, 33, 232, 128, 185, 58, 33, 234, 99, 243, 10, 33, 234, 99, 201,
+ 190, 33, 234, 99, 237, 32, 33, 234, 99, 243, 11, 249, 141, 33, 45, 50,
+ 64, 58, 33, 234, 99, 205, 76, 33, 234, 99, 221, 218, 33, 234, 99, 196,
+ 68, 209, 58, 197, 241, 33, 207, 19, 202, 24, 210, 255, 33, 55, 81, 201,
+ 28, 210, 255, 33, 251, 95, 113, 33, 197, 225, 196, 102, 33, 193, 78, 248,
+ 29, 58, 33, 118, 64, 210, 255, 33, 179, 55, 202, 24, 210, 255, 33, 96,
+ 230, 13, 4, 181, 235, 118, 33, 118, 230, 13, 4, 181, 235, 118, 33, 45,
+ 64, 60, 33, 50, 64, 60, 33, 250, 194, 58, 252, 55, 211, 146, 252, 38,
+ 119, 199, 34, 200, 240, 235, 129, 6, 247, 193, 237, 125, 247, 27, 247,
+ 22, 219, 113, 113, 247, 98, 211, 146, 247, 152, 196, 112, 233, 235, 239,
+ 38, 205, 72, 237, 125, 233, 91, 27, 2, 232, 51, 27, 6, 230, 116, 248,
+ 137, 6, 230, 116, 235, 129, 6, 230, 116, 209, 103, 239, 38, 209, 103,
+ 239, 39, 139, 105, 209, 185, 27, 6, 68, 248, 137, 6, 68, 27, 6, 172, 27,
+ 2, 172, 220, 143, 78, 249, 88, 113, 235, 129, 6, 215, 61, 212, 132, 56,
+ 202, 5, 207, 95, 239, 5, 27, 6, 210, 236, 235, 129, 6, 210, 236, 235,
+ 129, 6, 208, 104, 27, 6, 146, 248, 137, 6, 146, 235, 129, 6, 146, 208,
+ 223, 199, 208, 207, 31, 204, 1, 77, 199, 107, 56, 198, 22, 87, 56, 195,
+ 136, 235, 129, 6, 191, 166, 211, 18, 56, 211, 135, 56, 223, 93, 211, 135,
+ 56, 248, 137, 6, 191, 166, 153, 35, 2, 1, 223, 83, 222, 3, 56, 251, 110,
+ 56, 27, 6, 250, 120, 248, 137, 6, 247, 193, 234, 4, 113, 27, 2, 71, 27,
+ 6, 71, 27, 6, 233, 175, 153, 6, 233, 175, 27, 6, 218, 168, 27, 2, 74,
+ 131, 113, 248, 215, 113, 231, 39, 113, 237, 254, 113, 223, 137, 202, 3,
+ 206, 122, 6, 208, 104, 233, 94, 56, 235, 129, 2, 209, 185, 235, 129, 2,
+ 231, 211, 235, 129, 6, 231, 211, 235, 129, 6, 209, 185, 235, 129, 215,
+ 60, 200, 201, 153, 49, 6, 232, 51, 153, 49, 6, 172, 207, 18, 49, 6, 172,
+ 153, 49, 6, 192, 159, 235, 129, 43, 6, 238, 127, 235, 129, 43, 2, 238,
+ 127, 235, 129, 43, 2, 71, 235, 129, 43, 2, 68, 235, 129, 43, 2, 223, 35,
+ 208, 188, 219, 112, 153, 251, 137, 210, 14, 56, 251, 210, 153, 2, 233,
+ 175, 16, 40, 205, 151, 202, 3, 193, 246, 232, 118, 91, 203, 243, 193,
+ 246, 232, 118, 91, 213, 167, 193, 246, 232, 118, 91, 199, 86, 193, 246,
+ 232, 118, 91, 199, 0, 193, 246, 232, 118, 105, 198, 253, 193, 246, 232,
+ 118, 91, 233, 18, 193, 246, 232, 118, 105, 233, 17, 193, 246, 232, 118,
+ 115, 233, 17, 193, 246, 232, 118, 232, 128, 233, 17, 193, 246, 232, 118,
+ 91, 202, 124, 193, 246, 232, 118, 232, 226, 202, 122, 193, 246, 232, 118,
+ 91, 234, 159, 193, 246, 232, 118, 115, 234, 157, 193, 246, 232, 118, 232,
+ 226, 234, 157, 193, 246, 232, 118, 203, 247, 234, 157, 232, 118, 212,
+ 133, 107, 206, 136, 212, 134, 107, 206, 136, 212, 134, 109, 206, 136,
+ 212, 134, 138, 206, 136, 212, 134, 134, 206, 136, 212, 134, 149, 206,
+ 136, 212, 134, 169, 206, 136, 212, 134, 175, 206, 136, 212, 134, 171,
+ 206, 136, 212, 134, 178, 206, 136, 212, 134, 199, 95, 206, 136, 212, 134,
+ 234, 127, 206, 136, 212, 134, 197, 37, 206, 136, 212, 134, 233, 15, 206,
+ 136, 212, 134, 91, 228, 140, 206, 136, 212, 134, 232, 226, 228, 140, 206,
+ 136, 212, 134, 91, 189, 2, 206, 136, 212, 134, 107, 2, 206, 136, 212,
+ 134, 109, 2, 206, 136, 212, 134, 138, 2, 206, 136, 212, 134, 134, 2, 206,
+ 136, 212, 134, 149, 2, 206, 136, 212, 134, 169, 2, 206, 136, 212, 134,
+ 175, 2, 206, 136, 212, 134, 171, 2, 206, 136, 212, 134, 178, 2, 206, 136,
+ 212, 134, 199, 95, 2, 206, 136, 212, 134, 234, 127, 2, 206, 136, 212,
+ 134, 197, 37, 2, 206, 136, 212, 134, 233, 15, 2, 206, 136, 212, 134, 91,
+ 228, 140, 2, 206, 136, 212, 134, 232, 226, 228, 140, 2, 206, 136, 212,
+ 134, 91, 189, 206, 136, 212, 134, 91, 198, 230, 247, 194, 238, 127, 206,
+ 136, 212, 134, 232, 226, 189, 206, 136, 212, 134, 199, 96, 189, 206, 136,
+ 212, 134, 207, 18, 91, 228, 140, 8, 2, 1, 207, 18, 247, 193, 206, 136,
+ 212, 134, 202, 136, 220, 4, 20, 206, 136, 212, 134, 233, 16, 234, 210,
+ 20, 206, 136, 212, 134, 233, 16, 189, 206, 136, 212, 134, 91, 228, 141,
+ 189, 193, 246, 232, 118, 191, 78, 198, 253, 153, 17, 109, 153, 17, 138,
+ 118, 57, 196, 66, 57, 96, 57, 235, 119, 57, 45, 50, 57, 133, 144, 57,
+ 186, 193, 105, 57, 186, 234, 204, 57, 202, 2, 234, 204, 57, 202, 2, 193,
+ 105, 57, 118, 64, 4, 106, 96, 64, 4, 106, 118, 193, 139, 57, 96, 193,
+ 139, 57, 118, 105, 229, 233, 57, 196, 66, 105, 229, 233, 57, 96, 105,
+ 229, 233, 57, 235, 119, 105, 229, 233, 57, 118, 64, 4, 199, 215, 96, 64,
+ 4, 199, 215, 118, 64, 232, 98, 164, 196, 66, 64, 232, 98, 164, 96, 64,
+ 232, 98, 164, 235, 119, 64, 232, 98, 164, 133, 144, 64, 4, 249, 74, 118,
+ 64, 4, 102, 96, 64, 4, 102, 118, 64, 4, 219, 4, 96, 64, 4, 219, 4, 45,
+ 50, 193, 139, 57, 45, 50, 64, 4, 106, 235, 119, 191, 21, 57, 196, 66, 64,
+ 4, 198, 136, 219, 214, 196, 66, 64, 4, 198, 136, 206, 197, 235, 119, 64,
+ 4, 198, 136, 219, 214, 235, 119, 64, 4, 198, 136, 206, 197, 96, 64, 4,
+ 239, 2, 235, 118, 235, 119, 64, 4, 239, 2, 219, 214, 251, 85, 198, 54,
+ 204, 28, 57, 242, 221, 198, 54, 204, 28, 57, 186, 193, 105, 64, 119, 179,
+ 164, 118, 64, 119, 249, 88, 139, 96, 64, 119, 164, 251, 85, 211, 77, 243,
+ 11, 57, 242, 221, 211, 77, 243, 11, 57, 118, 230, 13, 4, 181, 196, 65,
+ 118, 230, 13, 4, 181, 235, 118, 196, 66, 230, 13, 4, 181, 206, 197, 196,
+ 66, 230, 13, 4, 181, 219, 214, 96, 230, 13, 4, 181, 196, 65, 96, 230, 13,
+ 4, 181, 235, 118, 235, 119, 230, 13, 4, 181, 206, 197, 235, 119, 230, 13,
+ 4, 181, 219, 214, 96, 64, 139, 118, 57, 196, 66, 64, 118, 79, 235, 119,
+ 57, 118, 64, 139, 96, 57, 118, 210, 196, 250, 231, 196, 66, 210, 196,
+ 250, 231, 96, 210, 196, 250, 231, 235, 119, 210, 196, 250, 231, 118, 230,
+ 13, 139, 96, 230, 12, 96, 230, 13, 139, 118, 230, 12, 118, 55, 64, 4,
+ 106, 45, 50, 55, 64, 4, 106, 96, 55, 64, 4, 106, 118, 55, 57, 196, 66,
+ 55, 57, 96, 55, 57, 235, 119, 55, 57, 45, 50, 55, 57, 133, 144, 55, 57,
+ 186, 193, 105, 55, 57, 186, 234, 204, 55, 57, 202, 2, 234, 204, 55, 57,
+ 202, 2, 193, 105, 55, 57, 118, 197, 225, 57, 96, 197, 225, 57, 118, 201,
+ 183, 57, 96, 201, 183, 57, 196, 66, 64, 4, 55, 106, 235, 119, 64, 4, 55,
+ 106, 118, 237, 214, 57, 196, 66, 237, 214, 57, 96, 237, 214, 57, 235,
+ 119, 237, 214, 57, 118, 64, 119, 164, 96, 64, 119, 164, 118, 63, 57, 196,
+ 66, 63, 57, 96, 63, 57, 235, 119, 63, 57, 196, 66, 63, 64, 232, 98, 164,
+ 196, 66, 63, 64, 211, 105, 210, 52, 196, 66, 63, 64, 211, 105, 210, 53,
+ 4, 228, 241, 164, 196, 66, 63, 64, 211, 105, 210, 53, 4, 81, 164, 196,
+ 66, 63, 55, 57, 196, 66, 63, 55, 64, 211, 105, 210, 52, 96, 63, 64, 232,
+ 98, 193, 167, 186, 193, 105, 64, 119, 239, 1, 202, 2, 234, 204, 64, 119,
+ 239, 1, 133, 144, 63, 57, 50, 64, 4, 2, 243, 10, 235, 119, 64, 118, 79,
+ 196, 66, 57, 115, 96, 250, 231, 118, 64, 4, 81, 106, 96, 64, 4, 81, 106,
+ 45, 50, 64, 4, 81, 106, 118, 64, 4, 55, 81, 106, 96, 64, 4, 55, 81, 106,
+ 45, 50, 64, 4, 55, 81, 106, 118, 211, 74, 57, 96, 211, 74, 57, 45, 50,
+ 211, 74, 57, 40, 251, 174, 242, 68, 210, 105, 237, 16, 199, 24, 233, 211,
+ 199, 24, 236, 164, 213, 12, 233, 212, 234, 105, 203, 252, 223, 151, 214,
+ 245, 234, 132, 211, 146, 213, 12, 251, 133, 234, 132, 211, 146, 2, 234,
+ 132, 211, 146, 239, 32, 250, 220, 216, 190, 236, 164, 213, 12, 239, 34,
+ 250, 220, 216, 190, 2, 239, 32, 250, 220, 216, 190, 234, 95, 79, 208,
+ 190, 215, 60, 208, 200, 215, 60, 239, 9, 215, 60, 200, 201, 216, 35, 56,
+ 216, 33, 56, 75, 209, 81, 236, 200, 202, 97, 203, 253, 216, 34, 250, 194,
+ 211, 66, 206, 189, 211, 66, 247, 249, 211, 66, 51, 206, 128, 238, 191,
+ 206, 128, 232, 121, 206, 128, 208, 186, 159, 223, 139, 50, 251, 115, 251,
+ 115, 216, 226, 251, 115, 201, 225, 251, 115, 236, 203, 236, 164, 213, 12,
+ 236, 207, 210, 119, 159, 213, 12, 210, 119, 159, 219, 29, 251, 125, 219,
+ 29, 211, 56, 223, 99, 196, 92, 223, 113, 55, 223, 113, 197, 225, 223,
+ 113, 239, 26, 223, 113, 200, 171, 223, 113, 195, 11, 223, 113, 242, 221,
+ 223, 113, 242, 221, 239, 26, 223, 113, 251, 85, 239, 26, 223, 113, 199,
+ 23, 249, 3, 207, 126, 208, 187, 75, 216, 34, 233, 219, 231, 144, 208,
+ 187, 229, 0, 198, 153, 211, 66, 207, 18, 198, 152, 223, 93, 219, 245,
+ 206, 8, 202, 172, 193, 138, 193, 10, 208, 200, 213, 12, 198, 152, 216,
+ 35, 198, 152, 250, 186, 234, 45, 159, 213, 12, 250, 186, 234, 45, 159,
+ 251, 40, 234, 45, 159, 251, 40, 247, 218, 213, 12, 252, 48, 234, 45, 159,
+ 214, 105, 251, 40, 213, 21, 252, 48, 234, 45, 159, 251, 165, 234, 45,
+ 159, 213, 12, 251, 165, 234, 45, 159, 251, 165, 234, 45, 211, 57, 234,
+ 45, 159, 197, 225, 198, 152, 251, 175, 234, 45, 159, 234, 36, 159, 231,
+ 143, 234, 36, 159, 237, 17, 248, 209, 251, 42, 199, 34, 219, 120, 231,
+ 143, 234, 45, 159, 251, 40, 234, 45, 119, 211, 57, 199, 34, 223, 178,
+ 211, 146, 223, 178, 79, 211, 57, 251, 40, 234, 45, 159, 242, 84, 234, 42,
+ 234, 43, 242, 83, 206, 189, 223, 163, 234, 45, 159, 206, 189, 234, 45,
+ 159, 238, 250, 159, 234, 3, 234, 41, 159, 201, 103, 234, 42, 237, 107,
+ 234, 45, 159, 234, 45, 119, 247, 205, 237, 126, 216, 226, 247, 204, 208,
+ 11, 234, 45, 159, 213, 12, 234, 45, 159, 228, 17, 159, 213, 12, 228, 17,
+ 159, 201, 35, 234, 36, 159, 219, 180, 211, 57, 234, 45, 159, 230, 204,
+ 211, 57, 234, 45, 159, 219, 180, 139, 234, 45, 159, 230, 204, 139, 234,
+ 45, 159, 219, 180, 247, 218, 213, 12, 234, 45, 159, 230, 204, 247, 218,
+ 213, 12, 234, 45, 159, 215, 145, 219, 179, 215, 145, 230, 203, 248, 209,
+ 213, 12, 234, 36, 159, 213, 12, 219, 179, 213, 12, 230, 203, 214, 105,
+ 219, 180, 213, 21, 234, 45, 159, 214, 105, 230, 204, 213, 21, 234, 45,
+ 159, 219, 180, 211, 57, 234, 36, 159, 230, 204, 211, 57, 234, 36, 159,
+ 214, 105, 219, 180, 213, 21, 234, 36, 159, 214, 105, 230, 204, 213, 21,
+ 234, 36, 159, 219, 180, 211, 57, 230, 203, 230, 204, 211, 57, 219, 179,
+ 214, 105, 219, 180, 213, 21, 230, 203, 214, 105, 230, 204, 213, 21, 219,
+ 179, 208, 231, 200, 220, 208, 232, 211, 57, 234, 45, 159, 200, 221, 211,
+ 57, 234, 45, 159, 208, 232, 211, 57, 234, 36, 159, 200, 221, 211, 57,
+ 234, 36, 159, 236, 164, 213, 12, 208, 234, 236, 164, 213, 12, 200, 222,
+ 200, 229, 211, 146, 200, 181, 211, 146, 213, 12, 42, 200, 229, 211, 146,
+ 213, 12, 42, 200, 181, 211, 146, 200, 229, 79, 211, 57, 234, 45, 159,
+ 200, 181, 79, 211, 57, 234, 45, 159, 214, 105, 42, 200, 229, 79, 213, 21,
+ 234, 45, 159, 214, 105, 42, 200, 181, 79, 213, 21, 234, 45, 159, 200,
+ 229, 79, 4, 213, 12, 234, 45, 159, 200, 181, 79, 4, 213, 12, 234, 45,
+ 159, 215, 124, 215, 125, 215, 126, 215, 125, 196, 92, 51, 223, 178, 211,
+ 146, 51, 211, 46, 211, 146, 51, 223, 178, 79, 211, 57, 234, 45, 159, 51,
+ 211, 46, 79, 211, 57, 234, 45, 159, 51, 247, 111, 51, 238, 181, 47, 209,
+ 81, 47, 216, 34, 47, 198, 144, 47, 236, 200, 202, 97, 47, 75, 211, 66,
+ 47, 206, 189, 211, 66, 47, 250, 194, 211, 66, 47, 234, 42, 47, 237, 215,
+ 112, 209, 81, 112, 216, 34, 112, 198, 144, 112, 75, 211, 66, 50, 199,
+ 228, 45, 199, 228, 144, 199, 228, 133, 199, 228, 250, 197, 216, 1, 197,
+ 201, 232, 152, 197, 225, 81, 249, 88, 50, 197, 57, 55, 81, 249, 88, 55,
+ 50, 197, 57, 236, 164, 213, 12, 208, 179, 213, 12, 197, 201, 236, 164,
+ 213, 12, 232, 153, 214, 108, 55, 81, 249, 88, 55, 50, 197, 57, 208, 232,
+ 196, 105, 207, 65, 200, 221, 196, 105, 207, 65, 213, 18, 200, 244, 211,
+ 146, 239, 32, 250, 220, 213, 18, 200, 243, 213, 18, 200, 244, 79, 211,
+ 57, 234, 45, 159, 239, 32, 250, 220, 213, 18, 200, 244, 211, 57, 234, 45,
+ 159, 211, 46, 211, 146, 223, 178, 211, 146, 215, 131, 229, 189, 239, 43,
+ 217, 27, 223, 110, 192, 192, 214, 224, 213, 20, 50, 251, 116, 4, 251, 16,
+ 50, 197, 241, 215, 60, 219, 29, 251, 125, 215, 60, 219, 29, 211, 56, 215,
+ 60, 223, 99, 215, 60, 196, 92, 237, 33, 211, 66, 75, 211, 66, 201, 103,
+ 211, 66, 236, 200, 198, 144, 248, 63, 45, 213, 18, 233, 93, 204, 24, 208,
+ 200, 50, 213, 18, 233, 93, 204, 24, 208, 200, 45, 204, 24, 208, 200, 50,
+ 204, 24, 208, 200, 207, 18, 198, 153, 234, 42, 238, 171, 219, 29, 211,
+ 56, 238, 171, 219, 29, 251, 125, 55, 200, 228, 55, 200, 180, 55, 223, 99,
+ 55, 196, 92, 209, 115, 234, 45, 23, 210, 119, 159, 219, 180, 4, 236, 140,
+ 230, 204, 4, 236, 140, 195, 83, 215, 145, 219, 179, 195, 83, 215, 145,
+ 230, 203, 219, 180, 234, 45, 119, 211, 57, 230, 203, 230, 204, 234, 45,
+ 119, 211, 57, 219, 179, 234, 45, 119, 211, 57, 219, 179, 234, 45, 119,
+ 211, 57, 230, 203, 234, 45, 119, 211, 57, 208, 231, 234, 45, 119, 211,
+ 57, 200, 220, 236, 164, 213, 12, 208, 235, 211, 57, 234, 44, 236, 164,
+ 213, 12, 200, 223, 211, 57, 234, 44, 213, 12, 51, 223, 178, 79, 211, 57,
+ 234, 45, 159, 213, 12, 51, 211, 46, 79, 211, 57, 234, 45, 159, 51, 223,
+ 178, 79, 211, 57, 213, 12, 234, 45, 159, 51, 211, 46, 79, 211, 57, 213,
+ 12, 234, 45, 159, 219, 180, 247, 218, 213, 12, 234, 36, 159, 230, 204,
+ 247, 218, 213, 12, 234, 36, 159, 208, 232, 247, 218, 213, 12, 234, 36,
+ 159, 200, 221, 247, 218, 213, 12, 234, 36, 159, 213, 12, 213, 18, 200,
+ 244, 211, 146, 236, 164, 213, 12, 239, 34, 250, 220, 213, 18, 200, 243,
+ 213, 12, 213, 18, 200, 244, 79, 211, 57, 234, 45, 159, 236, 164, 213, 12,
+ 239, 34, 250, 220, 213, 18, 200, 244, 211, 57, 234, 44, 81, 234, 120,
+ 216, 82, 228, 241, 234, 120, 133, 50, 237, 39, 234, 120, 144, 50, 237,
+ 39, 234, 120, 234, 132, 79, 4, 179, 228, 241, 106, 234, 132, 79, 4, 81,
+ 249, 88, 250, 183, 234, 95, 79, 228, 241, 106, 2, 234, 132, 79, 4, 81,
+ 249, 88, 250, 183, 234, 95, 79, 228, 241, 106, 234, 132, 79, 4, 75, 58,
+ 234, 132, 79, 4, 211, 6, 2, 234, 132, 79, 4, 211, 6, 234, 132, 79, 4,
+ 196, 103, 234, 132, 79, 4, 105, 228, 241, 201, 15, 239, 32, 4, 179, 228,
+ 241, 106, 239, 32, 4, 81, 249, 88, 250, 183, 234, 95, 79, 228, 241, 106,
+ 2, 239, 32, 4, 81, 249, 88, 250, 183, 234, 95, 79, 228, 241, 106, 239,
+ 32, 4, 211, 6, 2, 239, 32, 4, 211, 6, 191, 167, 213, 10, 249, 131, 216,
+ 189, 237, 34, 56, 234, 135, 57, 228, 172, 133, 250, 235, 144, 250, 235,
+ 208, 194, 209, 248, 193, 135, 219, 112, 45, 247, 30, 50, 247, 30, 45,
+ 232, 193, 50, 232, 193, 248, 77, 50, 238, 219, 248, 77, 45, 238, 219,
+ 198, 54, 50, 238, 219, 198, 54, 45, 238, 219, 207, 18, 213, 12, 56, 51,
+ 218, 232, 251, 16, 205, 43, 205, 52, 199, 107, 207, 96, 209, 25, 223,
+ 144, 195, 56, 201, 190, 209, 108, 79, 223, 109, 56, 153, 213, 12, 56,
+ 193, 145, 228, 174, 198, 54, 45, 239, 1, 198, 54, 50, 239, 1, 248, 77,
+ 45, 239, 1, 248, 77, 50, 239, 1, 198, 54, 132, 223, 113, 248, 77, 132,
+ 223, 113, 232, 93, 202, 65, 133, 250, 236, 248, 210, 105, 228, 241, 249,
+ 76, 211, 59, 221, 222, 234, 32, 119, 199, 34, 183, 192, 236, 223, 163,
+ 42, 207, 93, 248, 62, 221, 220, 219, 219, 251, 116, 248, 53, 206, 203,
+ 251, 116, 248, 53, 234, 32, 119, 199, 34, 219, 224, 248, 221, 206, 188,
+ 238, 138, 251, 175, 250, 244, 200, 74, 198, 39, 206, 41, 236, 252, 211,
+ 47, 239, 48, 199, 181, 202, 81, 238, 246, 238, 245, 251, 59, 232, 75, 16,
+ 228, 67, 251, 59, 232, 75, 16, 201, 181, 208, 30, 251, 59, 232, 75, 16,
+ 208, 31, 234, 44, 251, 59, 232, 75, 16, 208, 31, 236, 207, 251, 59, 232,
+ 75, 16, 208, 31, 237, 32, 251, 59, 232, 75, 16, 208, 31, 222, 188, 251,
+ 59, 232, 75, 16, 208, 31, 243, 10, 251, 59, 232, 75, 16, 243, 11, 201,
+ 71, 251, 59, 232, 75, 16, 243, 11, 222, 188, 251, 59, 232, 75, 16, 202,
+ 98, 164, 251, 59, 232, 75, 16, 249, 142, 164, 251, 59, 232, 75, 16, 208,
+ 31, 202, 97, 251, 59, 232, 75, 16, 208, 31, 249, 141, 251, 59, 232, 75,
+ 16, 208, 31, 219, 179, 251, 59, 232, 75, 16, 208, 31, 230, 203, 251, 59,
+ 232, 75, 16, 118, 195, 176, 251, 59, 232, 75, 16, 96, 195, 176, 251, 59,
+ 232, 75, 16, 208, 31, 118, 57, 251, 59, 232, 75, 16, 208, 31, 96, 57,
+ 251, 59, 232, 75, 16, 243, 11, 249, 141, 251, 59, 232, 75, 16, 144, 199,
+ 229, 196, 103, 251, 59, 232, 75, 16, 237, 107, 201, 71, 251, 59, 232, 75,
+ 16, 208, 31, 144, 247, 96, 251, 59, 232, 75, 16, 208, 31, 237, 106, 251,
+ 59, 232, 75, 16, 144, 199, 229, 222, 188, 251, 59, 232, 75, 16, 196, 66,
+ 195, 176, 251, 59, 232, 75, 16, 208, 31, 196, 66, 57, 251, 59, 232, 75,
+ 16, 133, 199, 229, 211, 6, 251, 59, 232, 75, 16, 237, 119, 201, 71, 251,
+ 59, 232, 75, 16, 208, 31, 133, 247, 96, 251, 59, 232, 75, 16, 208, 31,
+ 237, 118, 251, 59, 232, 75, 16, 133, 199, 229, 222, 188, 251, 59, 232,
+ 75, 16, 235, 119, 195, 176, 251, 59, 232, 75, 16, 208, 31, 235, 119, 57,
+ 251, 59, 232, 75, 16, 207, 251, 196, 103, 251, 59, 232, 75, 16, 237, 107,
+ 196, 103, 251, 59, 232, 75, 16, 237, 33, 196, 103, 251, 59, 232, 75, 16,
+ 222, 189, 196, 103, 251, 59, 232, 75, 16, 243, 11, 196, 103, 251, 59,
+ 232, 75, 16, 133, 203, 53, 222, 188, 251, 59, 232, 75, 16, 207, 251, 208,
+ 30, 251, 59, 232, 75, 16, 243, 11, 201, 102, 251, 59, 232, 75, 16, 208,
+ 31, 242, 83, 251, 59, 232, 75, 16, 133, 199, 229, 237, 42, 251, 59, 232,
+ 75, 16, 237, 119, 237, 42, 251, 59, 232, 75, 16, 201, 103, 237, 42, 251,
+ 59, 232, 75, 16, 222, 189, 237, 42, 251, 59, 232, 75, 16, 243, 11, 237,
+ 42, 251, 59, 232, 75, 16, 144, 203, 53, 201, 71, 251, 59, 232, 75, 16,
+ 45, 203, 53, 201, 71, 251, 59, 232, 75, 16, 198, 153, 237, 42, 251, 59,
+ 232, 75, 16, 230, 204, 237, 42, 251, 59, 232, 75, 16, 242, 75, 164, 251,
+ 59, 232, 75, 16, 237, 119, 198, 152, 251, 59, 232, 75, 16, 191, 20, 251,
+ 59, 232, 75, 16, 201, 72, 198, 152, 251, 59, 232, 75, 16, 204, 26, 196,
+ 103, 251, 59, 232, 75, 16, 208, 31, 213, 12, 234, 44, 251, 59, 232, 75,
+ 16, 208, 31, 208, 12, 251, 59, 232, 75, 16, 144, 247, 97, 198, 152, 251,
+ 59, 232, 75, 16, 133, 247, 97, 198, 152, 251, 59, 232, 75, 16, 223, 83,
+ 251, 59, 232, 75, 16, 207, 3, 251, 59, 232, 75, 16, 211, 110, 251, 59,
+ 232, 75, 16, 251, 161, 196, 103, 251, 59, 232, 75, 16, 234, 48, 196, 103,
+ 251, 59, 232, 75, 16, 223, 84, 196, 103, 251, 59, 232, 75, 16, 211, 111,
+ 196, 103, 251, 59, 232, 75, 16, 251, 160, 213, 12, 243, 126, 77, 50, 251,
+ 116, 4, 235, 119, 191, 21, 57, 203, 21, 211, 77, 248, 62, 248, 236, 113,
+ 81, 219, 113, 4, 82, 236, 140, 223, 119, 113, 239, 27, 196, 101, 113,
+ 236, 225, 196, 101, 113, 234, 107, 113, 239, 63, 113, 63, 51, 4, 247, 22,
+ 81, 219, 112, 234, 78, 113, 251, 152, 221, 223, 113, 229, 202, 113, 47,
+ 228, 241, 249, 88, 4, 213, 9, 47, 197, 242, 235, 123, 248, 22, 243, 11,
+ 4, 213, 15, 57, 196, 99, 113, 215, 216, 113, 228, 84, 113, 211, 75, 230,
+ 115, 113, 211, 75, 220, 141, 113, 210, 93, 113, 210, 92, 113, 236, 234,
+ 238, 169, 16, 232, 146, 109, 202, 29, 113, 251, 59, 232, 75, 16, 208, 30,
+ 237, 138, 204, 11, 221, 223, 113, 208, 217, 210, 204, 214, 73, 210, 204,
+ 208, 212, 205, 77, 113, 242, 238, 205, 77, 113, 45, 210, 114, 116, 102,
+ 45, 210, 114, 233, 203, 45, 210, 114, 110, 102, 50, 210, 114, 116, 102,
+ 50, 210, 114, 233, 203, 50, 210, 114, 110, 102, 45, 51, 248, 54, 116,
+ 239, 1, 45, 51, 248, 54, 233, 203, 45, 51, 248, 54, 110, 239, 1, 50, 51,
+ 248, 54, 116, 239, 1, 50, 51, 248, 54, 233, 203, 50, 51, 248, 54, 110,
+ 239, 1, 45, 238, 171, 248, 54, 116, 102, 45, 238, 171, 248, 54, 82, 209,
+ 175, 45, 238, 171, 248, 54, 110, 102, 238, 171, 248, 54, 233, 203, 50,
+ 238, 171, 248, 54, 116, 102, 50, 238, 171, 248, 54, 82, 209, 175, 50,
+ 238, 171, 248, 54, 110, 102, 223, 114, 233, 203, 228, 241, 219, 113, 233,
+ 203, 116, 45, 211, 57, 110, 50, 238, 171, 248, 54, 205, 53, 116, 50, 211,
+ 57, 110, 45, 238, 171, 248, 54, 205, 53, 200, 202, 198, 53, 200, 202,
+ 248, 76, 198, 54, 51, 248, 53, 248, 77, 51, 248, 53, 248, 77, 51, 248,
+ 54, 139, 198, 54, 51, 248, 53, 48, 16, 248, 76, 45, 81, 111, 219, 112,
+ 50, 81, 111, 219, 112, 228, 241, 205, 97, 219, 111, 228, 241, 205, 97,
+ 219, 110, 228, 241, 205, 97, 219, 109, 228, 241, 205, 97, 219, 108, 237,
+ 97, 16, 156, 81, 23, 198, 54, 183, 237, 97, 16, 156, 81, 23, 248, 77,
+ 183, 237, 97, 16, 156, 81, 4, 243, 10, 237, 97, 16, 156, 144, 23, 228,
+ 241, 4, 243, 10, 237, 97, 16, 156, 133, 23, 228, 241, 4, 243, 10, 237,
+ 97, 16, 156, 81, 4, 197, 241, 237, 97, 16, 156, 144, 23, 228, 241, 4,
+ 197, 241, 237, 97, 16, 156, 133, 23, 228, 241, 4, 197, 241, 237, 97, 16,
+ 156, 81, 23, 193, 138, 237, 97, 16, 156, 144, 23, 228, 241, 4, 193, 138,
+ 237, 97, 16, 156, 133, 23, 228, 241, 4, 193, 138, 237, 97, 16, 156, 144,
+ 23, 228, 240, 237, 97, 16, 156, 133, 23, 228, 240, 237, 97, 16, 156, 81,
+ 23, 198, 54, 219, 224, 237, 97, 16, 156, 81, 23, 248, 77, 219, 224, 51,
+ 232, 159, 207, 23, 113, 234, 149, 113, 81, 219, 113, 233, 203, 216, 159,
+ 248, 36, 216, 159, 179, 139, 203, 39, 216, 159, 203, 40, 139, 219, 19,
+ 216, 159, 179, 139, 105, 203, 25, 216, 159, 105, 203, 26, 139, 219, 19,
+ 216, 159, 105, 203, 26, 222, 197, 216, 159, 197, 221, 216, 159, 199, 65,
+ 216, 159, 210, 22, 234, 208, 230, 188, 232, 69, 198, 54, 210, 113, 248,
+ 77, 210, 113, 198, 54, 238, 171, 248, 53, 248, 77, 238, 171, 248, 53,
+ 198, 54, 198, 42, 203, 103, 248, 53, 248, 77, 198, 42, 203, 103, 248, 53,
+ 63, 198, 5, 248, 221, 206, 189, 4, 243, 10, 201, 51, 232, 204, 252, 64,
+ 238, 168, 234, 134, 223, 99, 237, 138, 233, 207, 113, 62, 206, 203, 55,
+ 197, 241, 62, 219, 219, 55, 197, 241, 62, 196, 76, 55, 197, 241, 62, 235,
+ 122, 55, 197, 241, 62, 206, 203, 55, 197, 242, 4, 81, 164, 62, 219, 219,
+ 55, 197, 242, 4, 81, 164, 62, 206, 203, 197, 242, 4, 55, 81, 164, 251,
+ 201, 242, 222, 201, 58, 198, 145, 242, 222, 228, 175, 4, 232, 184, 205,
+ 140, 62, 216, 213, 219, 219, 197, 241, 62, 216, 213, 206, 203, 197, 241,
+ 62, 216, 213, 196, 76, 197, 241, 62, 216, 213, 235, 122, 197, 241, 55,
+ 81, 164, 62, 51, 40, 201, 63, 62, 243, 11, 40, 207, 97, 208, 255, 113,
+ 208, 255, 211, 103, 113, 208, 255, 211, 105, 113, 208, 255, 202, 93, 113,
+ 211, 168, 233, 194, 113, 16, 40, 212, 138, 16, 40, 201, 98, 79, 229, 232,
+ 16, 40, 201, 98, 79, 199, 53, 16, 40, 234, 95, 79, 199, 53, 16, 40, 234,
+ 95, 79, 198, 11, 16, 40, 234, 81, 16, 40, 252, 51, 16, 40, 248, 235, 16,
+ 40, 249, 140, 16, 40, 228, 241, 199, 230, 16, 40, 219, 113, 233, 50, 16,
+ 40, 81, 199, 230, 16, 40, 232, 146, 233, 50, 16, 40, 247, 88, 207, 22,
+ 16, 40, 203, 77, 211, 14, 16, 40, 203, 77, 223, 162, 16, 40, 237, 210,
+ 219, 103, 234, 14, 16, 40, 237, 75, 239, 22, 107, 16, 40, 237, 75, 239,
+ 22, 109, 16, 40, 237, 75, 239, 22, 138, 16, 40, 237, 75, 239, 22, 134,
+ 16, 40, 214, 106, 252, 51, 16, 40, 200, 69, 223, 228, 16, 40, 234, 95,
+ 79, 198, 12, 248, 129, 16, 40, 247, 126, 16, 40, 234, 95, 79, 216, 212,
+ 16, 40, 200, 226, 16, 40, 234, 14, 16, 40, 233, 7, 204, 10, 16, 40, 230,
+ 187, 204, 10, 16, 40, 207, 98, 204, 10, 16, 40, 196, 91, 204, 10, 16, 40,
+ 201, 247, 16, 40, 237, 116, 248, 133, 113, 211, 77, 248, 62, 16, 40, 214,
+ 76, 16, 40, 237, 117, 232, 146, 109, 16, 40, 200, 227, 232, 146, 109,
+ 211, 161, 102, 211, 161, 246, 252, 211, 161, 232, 149, 211, 161, 223, 93,
+ 232, 149, 211, 161, 248, 232, 248, 5, 211, 161, 248, 70, 198, 178, 211,
+ 161, 248, 48, 249, 93, 228, 15, 211, 161, 251, 139, 79, 243, 125, 211,
+ 161, 237, 215, 211, 161, 238, 157, 252, 55, 212, 136, 211, 161, 55, 249,
+ 141, 47, 17, 107, 47, 17, 109, 47, 17, 138, 47, 17, 134, 47, 17, 149, 47,
+ 17, 169, 47, 17, 175, 47, 17, 171, 47, 17, 178, 47, 31, 199, 95, 47, 31,
+ 234, 127, 47, 31, 197, 37, 47, 31, 198, 251, 47, 31, 232, 122, 47, 31,
+ 233, 19, 47, 31, 202, 130, 47, 31, 203, 244, 47, 31, 234, 161, 47, 31,
+ 213, 171, 47, 31, 197, 32, 127, 17, 107, 127, 17, 109, 127, 17, 138, 127,
+ 17, 134, 127, 17, 149, 127, 17, 169, 127, 17, 175, 127, 17, 171, 127, 17,
+ 178, 127, 31, 199, 95, 127, 31, 234, 127, 127, 31, 197, 37, 127, 31, 198,
+ 251, 127, 31, 232, 122, 127, 31, 233, 19, 127, 31, 202, 130, 127, 31,
+ 203, 244, 127, 31, 234, 161, 127, 31, 213, 171, 127, 31, 197, 32, 17, 91,
+ 232, 80, 201, 63, 17, 105, 232, 80, 201, 63, 17, 115, 232, 80, 201, 63,
+ 17, 232, 128, 232, 80, 201, 63, 17, 232, 226, 232, 80, 201, 63, 17, 202,
+ 136, 232, 80, 201, 63, 17, 203, 247, 232, 80, 201, 63, 17, 234, 164, 232,
+ 80, 201, 63, 17, 213, 175, 232, 80, 201, 63, 31, 199, 96, 232, 80, 201,
+ 63, 31, 234, 128, 232, 80, 201, 63, 31, 197, 38, 232, 80, 201, 63, 31,
+ 198, 252, 232, 80, 201, 63, 31, 232, 123, 232, 80, 201, 63, 31, 233, 20,
+ 232, 80, 201, 63, 31, 202, 131, 232, 80, 201, 63, 31, 203, 245, 232, 80,
+ 201, 63, 31, 234, 162, 232, 80, 201, 63, 31, 213, 172, 232, 80, 201, 63,
+ 31, 197, 33, 232, 80, 201, 63, 127, 8, 2, 1, 65, 127, 8, 2, 1, 250, 120,
+ 127, 8, 2, 1, 247, 193, 127, 8, 2, 1, 238, 127, 127, 8, 2, 1, 71, 127, 8,
+ 2, 1, 233, 175, 127, 8, 2, 1, 232, 51, 127, 8, 2, 1, 230, 116, 127, 8, 2,
+ 1, 68, 127, 8, 2, 1, 223, 35, 127, 8, 2, 1, 222, 152, 127, 8, 2, 1, 172,
+ 127, 8, 2, 1, 218, 168, 127, 8, 2, 1, 215, 61, 127, 8, 2, 1, 74, 127, 8,
+ 2, 1, 210, 236, 127, 8, 2, 1, 208, 104, 127, 8, 2, 1, 146, 127, 8, 2, 1,
+ 206, 8, 127, 8, 2, 1, 200, 43, 127, 8, 2, 1, 66, 127, 8, 2, 1, 196, 12,
+ 127, 8, 2, 1, 193, 224, 127, 8, 2, 1, 192, 235, 127, 8, 2, 1, 192, 159,
+ 127, 8, 2, 1, 191, 166, 47, 8, 6, 1, 65, 47, 8, 6, 1, 250, 120, 47, 8, 6,
+ 1, 247, 193, 47, 8, 6, 1, 238, 127, 47, 8, 6, 1, 71, 47, 8, 6, 1, 233,
+ 175, 47, 8, 6, 1, 232, 51, 47, 8, 6, 1, 230, 116, 47, 8, 6, 1, 68, 47, 8,
+ 6, 1, 223, 35, 47, 8, 6, 1, 222, 152, 47, 8, 6, 1, 172, 47, 8, 6, 1, 218,
+ 168, 47, 8, 6, 1, 215, 61, 47, 8, 6, 1, 74, 47, 8, 6, 1, 210, 236, 47, 8,
+ 6, 1, 208, 104, 47, 8, 6, 1, 146, 47, 8, 6, 1, 206, 8, 47, 8, 6, 1, 200,
+ 43, 47, 8, 6, 1, 66, 47, 8, 6, 1, 196, 12, 47, 8, 6, 1, 193, 224, 47, 8,
+ 6, 1, 192, 235, 47, 8, 6, 1, 192, 159, 47, 8, 6, 1, 191, 166, 47, 8, 2,
+ 1, 65, 47, 8, 2, 1, 250, 120, 47, 8, 2, 1, 247, 193, 47, 8, 2, 1, 238,
+ 127, 47, 8, 2, 1, 71, 47, 8, 2, 1, 233, 175, 47, 8, 2, 1, 232, 51, 47, 8,
+ 2, 1, 230, 116, 47, 8, 2, 1, 68, 47, 8, 2, 1, 223, 35, 47, 8, 2, 1, 222,
+ 152, 47, 8, 2, 1, 172, 47, 8, 2, 1, 218, 168, 47, 8, 2, 1, 215, 61, 47,
+ 8, 2, 1, 74, 47, 8, 2, 1, 210, 236, 47, 8, 2, 1, 208, 104, 47, 8, 2, 1,
+ 146, 47, 8, 2, 1, 206, 8, 47, 8, 2, 1, 200, 43, 47, 8, 2, 1, 66, 47, 8,
+ 2, 1, 196, 12, 47, 8, 2, 1, 193, 224, 47, 8, 2, 1, 192, 235, 47, 8, 2, 1,
+ 192, 159, 47, 8, 2, 1, 191, 166, 47, 17, 191, 77, 214, 106, 47, 31, 234,
+ 127, 214, 106, 47, 31, 197, 37, 214, 106, 47, 31, 198, 251, 214, 106, 47,
+ 31, 232, 122, 214, 106, 47, 31, 233, 19, 214, 106, 47, 31, 202, 130, 214,
+ 106, 47, 31, 203, 244, 214, 106, 47, 31, 234, 161, 214, 106, 47, 31, 213,
+ 171, 214, 106, 47, 31, 197, 32, 55, 47, 17, 107, 55, 47, 17, 109, 55, 47,
+ 17, 138, 55, 47, 17, 134, 55, 47, 17, 149, 55, 47, 17, 169, 55, 47, 17,
+ 175, 55, 47, 17, 171, 55, 47, 17, 178, 55, 47, 31, 199, 95, 214, 106, 47,
+ 17, 191, 77, 111, 122, 156, 228, 240, 111, 122, 88, 228, 240, 111, 122,
+ 156, 195, 135, 111, 122, 88, 195, 135, 111, 122, 156, 197, 225, 237, 216,
+ 228, 240, 111, 122, 88, 197, 225, 237, 216, 228, 240, 111, 122, 156, 197,
+ 225, 237, 216, 195, 135, 111, 122, 88, 197, 225, 237, 216, 195, 135, 111,
+ 122, 156, 208, 26, 237, 216, 228, 240, 111, 122, 88, 208, 26, 237, 216,
+ 228, 240, 111, 122, 156, 208, 26, 237, 216, 195, 135, 111, 122, 88, 208,
+ 26, 237, 216, 195, 135, 111, 122, 156, 144, 23, 183, 111, 122, 144, 156,
+ 23, 50, 229, 217, 111, 122, 144, 88, 23, 50, 219, 132, 111, 122, 88, 144,
+ 23, 183, 111, 122, 156, 144, 23, 219, 224, 111, 122, 144, 156, 23, 45,
+ 229, 217, 111, 122, 144, 88, 23, 45, 219, 132, 111, 122, 88, 144, 23,
+ 219, 224, 111, 122, 156, 133, 23, 183, 111, 122, 133, 156, 23, 50, 229,
+ 217, 111, 122, 133, 88, 23, 50, 219, 132, 111, 122, 88, 133, 23, 183,
+ 111, 122, 156, 133, 23, 219, 224, 111, 122, 133, 156, 23, 45, 229, 217,
+ 111, 122, 133, 88, 23, 45, 219, 132, 111, 122, 88, 133, 23, 219, 224,
+ 111, 122, 156, 81, 23, 183, 111, 122, 81, 156, 23, 50, 229, 217, 111,
+ 122, 133, 88, 23, 50, 144, 219, 132, 111, 122, 144, 88, 23, 50, 133, 219,
+ 132, 111, 122, 81, 88, 23, 50, 219, 132, 111, 122, 144, 156, 23, 50, 133,
+ 229, 217, 111, 122, 133, 156, 23, 50, 144, 229, 217, 111, 122, 88, 81,
+ 23, 183, 111, 122, 156, 81, 23, 219, 224, 111, 122, 81, 156, 23, 45, 229,
+ 217, 111, 122, 133, 88, 23, 45, 144, 219, 132, 111, 122, 144, 88, 23, 45,
+ 133, 219, 132, 111, 122, 81, 88, 23, 45, 219, 132, 111, 122, 144, 156,
+ 23, 45, 133, 229, 217, 111, 122, 133, 156, 23, 45, 144, 229, 217, 111,
+ 122, 88, 81, 23, 219, 224, 111, 122, 156, 144, 23, 228, 240, 111, 122,
+ 45, 88, 23, 50, 144, 219, 132, 111, 122, 50, 88, 23, 45, 144, 219, 132,
+ 111, 122, 144, 156, 23, 228, 241, 229, 217, 111, 122, 144, 88, 23, 228,
+ 241, 219, 132, 111, 122, 50, 156, 23, 45, 144, 229, 217, 111, 122, 45,
+ 156, 23, 50, 144, 229, 217, 111, 122, 88, 144, 23, 228, 240, 111, 122,
+ 156, 133, 23, 228, 240, 111, 122, 45, 88, 23, 50, 133, 219, 132, 111,
+ 122, 50, 88, 23, 45, 133, 219, 132, 111, 122, 133, 156, 23, 228, 241,
+ 229, 217, 111, 122, 133, 88, 23, 228, 241, 219, 132, 111, 122, 50, 156,
+ 23, 45, 133, 229, 217, 111, 122, 45, 156, 23, 50, 133, 229, 217, 111,
+ 122, 88, 133, 23, 228, 240, 111, 122, 156, 81, 23, 228, 240, 111, 122,
+ 45, 88, 23, 50, 81, 219, 132, 111, 122, 50, 88, 23, 45, 81, 219, 132,
+ 111, 122, 81, 156, 23, 228, 241, 229, 217, 111, 122, 133, 88, 23, 144,
+ 228, 241, 219, 132, 111, 122, 144, 88, 23, 133, 228, 241, 219, 132, 111,
+ 122, 81, 88, 23, 228, 241, 219, 132, 111, 122, 45, 133, 88, 23, 50, 144,
+ 219, 132, 111, 122, 50, 133, 88, 23, 45, 144, 219, 132, 111, 122, 45,
+ 144, 88, 23, 50, 133, 219, 132, 111, 122, 50, 144, 88, 23, 45, 133, 219,
+ 132, 111, 122, 144, 156, 23, 133, 228, 241, 229, 217, 111, 122, 133, 156,
+ 23, 144, 228, 241, 229, 217, 111, 122, 50, 156, 23, 45, 81, 229, 217,
+ 111, 122, 45, 156, 23, 50, 81, 229, 217, 111, 122, 88, 81, 23, 228, 240,
+ 111, 122, 156, 55, 237, 216, 228, 240, 111, 122, 88, 55, 237, 216, 228,
+ 240, 111, 122, 156, 55, 237, 216, 195, 135, 111, 122, 88, 55, 237, 216,
+ 195, 135, 111, 122, 55, 228, 240, 111, 122, 55, 195, 135, 111, 122, 144,
+ 202, 170, 23, 50, 235, 133, 111, 122, 144, 55, 23, 50, 202, 169, 111,
+ 122, 55, 144, 23, 183, 111, 122, 144, 202, 170, 23, 45, 235, 133, 111,
+ 122, 144, 55, 23, 45, 202, 169, 111, 122, 55, 144, 23, 219, 224, 111,
+ 122, 133, 202, 170, 23, 50, 235, 133, 111, 122, 133, 55, 23, 50, 202,
+ 169, 111, 122, 55, 133, 23, 183, 111, 122, 133, 202, 170, 23, 45, 235,
+ 133, 111, 122, 133, 55, 23, 45, 202, 169, 111, 122, 55, 133, 23, 219,
+ 224, 111, 122, 81, 202, 170, 23, 50, 235, 133, 111, 122, 81, 55, 23, 50,
+ 202, 169, 111, 122, 55, 81, 23, 183, 111, 122, 81, 202, 170, 23, 45, 235,
+ 133, 111, 122, 81, 55, 23, 45, 202, 169, 111, 122, 55, 81, 23, 219, 224,
+ 111, 122, 144, 202, 170, 23, 228, 241, 235, 133, 111, 122, 144, 55, 23,
+ 228, 241, 202, 169, 111, 122, 55, 144, 23, 228, 240, 111, 122, 133, 202,
+ 170, 23, 228, 241, 235, 133, 111, 122, 133, 55, 23, 228, 241, 202, 169,
+ 111, 122, 55, 133, 23, 228, 240, 111, 122, 81, 202, 170, 23, 228, 241,
+ 235, 133, 111, 122, 81, 55, 23, 228, 241, 202, 169, 111, 122, 55, 81, 23,
+ 228, 240, 111, 122, 156, 251, 17, 144, 23, 183, 111, 122, 156, 251, 17,
+ 144, 23, 219, 224, 111, 122, 156, 251, 17, 133, 23, 219, 224, 111, 122,
+ 156, 251, 17, 133, 23, 183, 111, 122, 156, 237, 39, 116, 50, 119, 110,
+ 219, 224, 111, 122, 156, 237, 39, 116, 45, 119, 110, 183, 111, 122, 156,
+ 237, 39, 238, 217, 111, 122, 156, 219, 224, 111, 122, 156, 196, 77, 111,
+ 122, 156, 183, 111, 122, 156, 235, 123, 111, 122, 88, 219, 224, 111, 122,
+ 88, 196, 77, 111, 122, 88, 183, 111, 122, 88, 235, 123, 111, 122, 156,
+ 45, 23, 88, 183, 111, 122, 156, 133, 23, 88, 235, 123, 111, 122, 88, 45,
+ 23, 156, 183, 111, 122, 88, 133, 23, 156, 235, 123, 116, 132, 248, 129,
+ 110, 91, 234, 160, 248, 129, 110, 91, 208, 23, 248, 129, 110, 115, 234,
+ 158, 248, 129, 110, 132, 248, 129, 110, 232, 226, 234, 158, 248, 129,
+ 110, 115, 208, 21, 248, 129, 110, 203, 247, 234, 158, 248, 129, 232, 80,
+ 248, 129, 45, 203, 247, 234, 158, 248, 129, 45, 115, 208, 21, 248, 129,
+ 45, 232, 226, 234, 158, 248, 129, 45, 132, 248, 129, 45, 115, 234, 158,
+ 248, 129, 45, 91, 208, 23, 248, 129, 45, 91, 234, 160, 248, 129, 50, 132,
+ 248, 129, 156, 203, 153, 216, 213, 203, 153, 237, 221, 203, 153, 116, 91,
+ 234, 160, 248, 129, 50, 91, 234, 160, 248, 129, 208, 28, 110, 219, 224,
+ 208, 28, 110, 183, 208, 28, 116, 219, 224, 208, 28, 116, 45, 23, 110, 45,
+ 23, 110, 183, 208, 28, 116, 45, 23, 110, 183, 208, 28, 116, 45, 23, 116,
+ 50, 23, 110, 219, 224, 208, 28, 116, 45, 23, 116, 50, 23, 110, 183, 208,
+ 28, 116, 183, 208, 28, 116, 50, 23, 110, 219, 224, 208, 28, 116, 50, 23,
+ 110, 45, 23, 110, 183, 62, 201, 190, 63, 201, 190, 63, 51, 4, 206, 113,
+ 239, 0, 63, 51, 239, 33, 62, 2, 201, 190, 51, 4, 228, 241, 233, 5, 51, 4,
+ 81, 233, 5, 51, 4, 211, 38, 238, 211, 233, 5, 51, 4, 116, 45, 119, 110,
+ 50, 233, 5, 51, 4, 116, 50, 119, 110, 45, 233, 5, 51, 4, 237, 39, 238,
+ 211, 233, 5, 62, 2, 201, 190, 63, 2, 201, 190, 62, 207, 92, 63, 207, 92,
+ 62, 81, 207, 92, 63, 81, 207, 92, 62, 210, 117, 63, 210, 117, 62, 196,
+ 76, 197, 241, 63, 196, 76, 197, 241, 62, 196, 76, 2, 197, 241, 63, 196,
+ 76, 2, 197, 241, 62, 206, 203, 197, 241, 63, 206, 203, 197, 241, 62, 206,
+ 203, 2, 197, 241, 63, 206, 203, 2, 197, 241, 62, 206, 203, 209, 59, 63,
+ 206, 203, 209, 59, 62, 235, 122, 197, 241, 63, 235, 122, 197, 241, 62,
+ 235, 122, 2, 197, 241, 63, 235, 122, 2, 197, 241, 62, 219, 219, 197, 241,
+ 63, 219, 219, 197, 241, 62, 219, 219, 2, 197, 241, 63, 219, 219, 2, 197,
+ 241, 62, 219, 219, 209, 59, 63, 219, 219, 209, 59, 62, 237, 32, 63, 237,
+ 32, 63, 237, 33, 239, 33, 62, 2, 237, 32, 232, 235, 218, 232, 63, 243,
+ 10, 235, 138, 243, 10, 243, 11, 4, 81, 233, 5, 247, 244, 62, 243, 10,
+ 243, 11, 4, 45, 132, 248, 139, 243, 11, 4, 50, 132, 248, 139, 243, 11, 4,
+ 110, 132, 248, 139, 243, 11, 4, 116, 132, 248, 139, 243, 11, 4, 116, 50,
+ 208, 28, 248, 139, 243, 11, 4, 251, 175, 247, 218, 116, 45, 208, 28, 248,
+ 139, 45, 132, 62, 243, 10, 50, 132, 62, 243, 10, 223, 95, 247, 248, 223,
+ 95, 63, 243, 10, 116, 132, 223, 95, 63, 243, 10, 110, 132, 223, 95, 63,
+ 243, 10, 116, 45, 208, 28, 243, 4, 251, 16, 116, 50, 208, 28, 243, 4,
+ 251, 16, 110, 50, 208, 28, 243, 4, 251, 16, 110, 45, 208, 28, 243, 4,
+ 251, 16, 116, 132, 243, 10, 110, 132, 243, 10, 62, 110, 50, 197, 241, 62,
+ 110, 45, 197, 241, 62, 116, 45, 197, 241, 62, 116, 50, 197, 241, 63, 247,
+ 248, 51, 4, 45, 132, 248, 139, 51, 4, 50, 132, 248, 139, 51, 4, 116, 45,
+ 237, 39, 132, 248, 139, 51, 4, 110, 50, 237, 39, 132, 248, 139, 63, 51,
+ 4, 81, 248, 154, 219, 112, 63, 196, 76, 197, 242, 4, 236, 140, 196, 76,
+ 197, 242, 4, 45, 132, 248, 139, 196, 76, 197, 242, 4, 50, 132, 248, 139,
+ 220, 13, 243, 10, 63, 51, 4, 116, 45, 208, 27, 63, 51, 4, 110, 45, 208,
+ 27, 63, 51, 4, 110, 50, 208, 27, 63, 51, 4, 116, 50, 208, 27, 63, 243,
+ 11, 4, 116, 45, 208, 27, 63, 243, 11, 4, 110, 45, 208, 27, 63, 243, 11,
+ 4, 110, 50, 208, 27, 63, 243, 11, 4, 116, 50, 208, 27, 116, 45, 197, 241,
+ 116, 50, 197, 241, 110, 45, 197, 241, 63, 216, 213, 201, 190, 62, 216,
+ 213, 201, 190, 63, 216, 213, 2, 201, 190, 62, 216, 213, 2, 201, 190, 110,
+ 50, 197, 241, 62, 200, 199, 4, 207, 119, 242, 210, 196, 117, 202, 48,
+ 242, 77, 62, 201, 102, 63, 201, 102, 219, 129, 198, 208, 200, 198, 250,
+ 213, 213, 35, 237, 86, 213, 35, 239, 42, 211, 62, 62, 199, 106, 63, 199,
+ 106, 249, 107, 248, 62, 249, 107, 111, 4, 243, 125, 249, 107, 111, 4,
+ 192, 235, 205, 154, 196, 118, 4, 207, 150, 235, 96, 228, 181, 248, 207,
+ 63, 203, 49, 209, 175, 62, 203, 49, 209, 175, 203, 140, 207, 18, 206,
+ 122, 232, 190, 229, 224, 247, 248, 62, 45, 209, 58, 223, 148, 62, 50,
+ 209, 58, 223, 148, 63, 45, 209, 58, 223, 148, 63, 133, 209, 58, 223, 148,
+ 63, 50, 209, 58, 223, 148, 63, 144, 209, 58, 223, 148, 202, 104, 23, 238,
+ 215, 247, 71, 56, 207, 164, 56, 248, 162, 56, 247, 151, 251, 99, 211, 39,
+ 238, 217, 243, 96, 207, 3, 238, 218, 79, 218, 255, 238, 218, 79, 222,
+ 254, 201, 103, 23, 238, 227, 233, 74, 113, 252, 34, 203, 143, 230, 62,
+ 23, 202, 213, 210, 61, 113, 192, 22, 192, 106, 197, 231, 40, 229, 219,
+ 197, 231, 40, 220, 43, 197, 231, 40, 232, 243, 197, 231, 40, 198, 209,
+ 197, 231, 40, 193, 66, 197, 231, 40, 193, 143, 197, 231, 40, 215, 184,
+ 197, 231, 40, 234, 207, 193, 94, 79, 237, 60, 63, 232, 92, 233, 103, 63,
+ 202, 64, 233, 103, 62, 202, 64, 233, 103, 63, 200, 199, 4, 207, 119, 232,
+ 238, 208, 23, 215, 205, 220, 6, 208, 23, 215, 205, 216, 180, 233, 42, 56,
+ 234, 207, 217, 97, 56, 222, 167, 205, 115, 196, 57, 214, 94, 209, 77,
+ 251, 2, 199, 164, 231, 152, 247, 124, 219, 186, 195, 38, 219, 143, 205,
+ 80, 205, 183, 247, 106, 251, 34, 209, 120, 63, 243, 105, 221, 138, 63,
+ 243, 105, 208, 14, 63, 243, 105, 206, 131, 63, 243, 105, 248, 152, 63,
+ 243, 105, 221, 76, 63, 243, 105, 210, 74, 62, 243, 105, 221, 138, 62,
+ 243, 105, 208, 14, 62, 243, 105, 206, 131, 62, 243, 105, 248, 152, 62,
+ 243, 105, 221, 76, 62, 243, 105, 210, 74, 62, 201, 245, 200, 211, 63,
+ 229, 224, 200, 211, 63, 237, 33, 200, 211, 62, 242, 207, 200, 211, 63,
+ 201, 245, 200, 211, 62, 229, 224, 200, 211, 62, 237, 33, 200, 211, 63,
+ 242, 207, 200, 211, 228, 181, 201, 195, 208, 23, 213, 6, 234, 160, 213,
+ 6, 249, 13, 234, 160, 213, 1, 249, 13, 202, 129, 213, 1, 215, 97, 232,
+ 207, 56, 215, 97, 214, 206, 56, 215, 97, 203, 127, 56, 193, 105, 200, 63,
+ 238, 217, 234, 204, 200, 63, 238, 217, 196, 87, 207, 88, 113, 207, 88,
+ 16, 40, 196, 254, 209, 98, 207, 88, 16, 40, 196, 252, 209, 98, 207, 88,
+ 16, 40, 196, 251, 209, 98, 207, 88, 16, 40, 196, 249, 209, 98, 207, 88,
+ 16, 40, 196, 247, 209, 98, 207, 88, 16, 40, 196, 245, 209, 98, 207, 88,
+ 16, 40, 196, 243, 209, 98, 207, 88, 16, 40, 231, 149, 217, 28, 62, 196,
+ 87, 207, 88, 113, 207, 89, 210, 136, 113, 210, 104, 210, 136, 113, 210,
+ 3, 210, 136, 56, 193, 92, 113, 237, 25, 233, 102, 237, 25, 233, 101, 237,
+ 25, 233, 100, 237, 25, 233, 99, 237, 25, 233, 98, 237, 25, 233, 97, 63,
+ 243, 11, 4, 75, 183, 63, 243, 11, 4, 105, 236, 138, 62, 243, 11, 4, 63,
+ 75, 183, 62, 243, 11, 4, 105, 63, 236, 138, 215, 221, 40, 192, 106, 215,
+ 221, 40, 192, 21, 237, 6, 40, 230, 205, 192, 106, 237, 6, 40, 219, 178,
+ 192, 21, 237, 6, 40, 219, 178, 192, 106, 237, 6, 40, 230, 205, 192, 21,
+ 63, 232, 217, 62, 232, 217, 230, 62, 23, 209, 180, 251, 127, 238, 214,
+ 200, 130, 201, 112, 79, 252, 8, 205, 98, 251, 191, 232, 186, 231, 162,
+ 201, 112, 79, 229, 191, 250, 172, 113, 232, 202, 211, 10, 63, 201, 102,
+ 115, 219, 107, 239, 19, 183, 115, 219, 107, 239, 19, 219, 224, 193, 155,
+ 56, 137, 195, 12, 56, 235, 128, 233, 42, 56, 235, 128, 217, 97, 56, 223,
+ 105, 233, 42, 23, 217, 97, 56, 217, 97, 23, 233, 42, 56, 217, 97, 4, 201,
+ 28, 56, 217, 97, 4, 201, 28, 23, 217, 97, 23, 233, 42, 56, 81, 217, 97,
+ 4, 201, 28, 56, 228, 241, 217, 97, 4, 201, 28, 56, 216, 213, 63, 243, 10,
+ 216, 213, 62, 243, 10, 216, 213, 2, 63, 243, 10, 217, 48, 113, 236, 198,
+ 113, 196, 84, 210, 103, 113, 242, 89, 232, 74, 196, 53, 214, 83, 247, 7,
+ 210, 185, 222, 173, 195, 80, 243, 75, 62, 215, 206, 219, 126, 203, 176,
+ 204, 22, 208, 4, 203, 255, 202, 36, 249, 111, 249, 73, 112, 221, 222, 63,
+ 235, 108, 217, 90, 63, 235, 108, 221, 138, 62, 235, 108, 217, 90, 62,
+ 235, 108, 221, 138, 202, 49, 193, 51, 202, 52, 200, 199, 248, 242, 242,
+ 210, 207, 149, 62, 202, 48, 198, 210, 242, 211, 23, 207, 149, 153, 63,
+ 203, 49, 209, 175, 153, 62, 203, 49, 209, 175, 63, 237, 33, 223, 163,
+ 201, 190, 238, 210, 220, 21, 236, 229, 247, 102, 211, 65, 209, 180, 247,
+ 103, 202, 85, 229, 201, 4, 63, 238, 217, 47, 238, 210, 220, 21, 246, 253,
+ 213, 44, 234, 72, 251, 157, 211, 96, 45, 193, 129, 198, 19, 62, 197, 10,
+ 45, 193, 129, 198, 19, 63, 197, 10, 45, 193, 129, 198, 19, 62, 45, 220,
+ 22, 216, 179, 63, 45, 220, 22, 216, 179, 235, 103, 202, 76, 56, 88, 63,
+ 235, 122, 197, 241, 45, 242, 219, 234, 72, 112, 205, 154, 233, 83, 237,
+ 39, 223, 163, 63, 243, 11, 223, 163, 62, 201, 190, 62, 197, 203, 207, 29,
+ 45, 234, 71, 207, 29, 45, 234, 70, 250, 187, 16, 40, 196, 57, 88, 243,
+ 11, 4, 201, 28, 23, 105, 185, 58, 210, 23, 206, 205, 223, 107, 210, 23,
+ 219, 221, 223, 107, 210, 23, 223, 93, 210, 23, 62, 238, 218, 211, 105,
+ 203, 78, 203, 66, 203, 12, 243, 40, 247, 80, 229, 118, 202, 137, 231,
+ 163, 193, 51, 228, 153, 231, 163, 4, 230, 30, 217, 72, 16, 40, 219, 131,
+ 215, 184, 196, 118, 211, 105, 230, 188, 232, 129, 232, 218, 223, 163,
+ 229, 5, 233, 32, 205, 178, 51, 232, 128, 239, 0, 202, 108, 228, 27, 202,
+ 112, 209, 251, 4, 249, 111, 199, 87, 223, 19, 249, 93, 113, 229, 229,
+ 230, 207, 113, 232, 83, 208, 153, 238, 182, 211, 105, 62, 201, 190, 63,
+ 232, 218, 4, 228, 241, 82, 62, 201, 29, 62, 205, 188, 205, 84, 116, 248,
+ 134, 205, 84, 62, 205, 84, 110, 248, 134, 205, 84, 63, 205, 84, 63, 88,
+ 243, 126, 77, 199, 107, 219, 40, 56, 199, 182, 235, 102, 251, 223, 234,
+ 67, 207, 147, 232, 231, 207, 147, 230, 53, 195, 67, 230, 53, 193, 3, 230,
+ 53, 110, 50, 210, 33, 210, 33, 116, 50, 210, 33, 63, 213, 208, 62, 213,
+ 208, 243, 126, 77, 88, 243, 126, 77, 215, 127, 192, 235, 88, 215, 127,
+ 192, 235, 249, 107, 192, 235, 88, 249, 107, 192, 235, 211, 10, 35, 238,
+ 217, 88, 35, 238, 217, 211, 77, 247, 22, 238, 217, 88, 211, 77, 247, 22,
+ 238, 217, 8, 238, 217, 203, 151, 63, 8, 238, 217, 211, 10, 8, 238, 217,
+ 217, 93, 238, 217, 201, 103, 79, 237, 208, 232, 128, 199, 127, 250, 193,
+ 232, 128, 249, 108, 250, 193, 88, 232, 128, 249, 108, 250, 193, 232, 128,
+ 242, 205, 250, 193, 62, 232, 128, 209, 60, 201, 102, 63, 232, 128, 209,
+ 60, 201, 102, 201, 240, 201, 38, 211, 10, 63, 201, 102, 47, 63, 201, 102,
+ 211, 77, 247, 22, 62, 201, 102, 62, 247, 22, 63, 201, 102, 211, 10, 62,
+ 201, 102, 88, 211, 10, 62, 201, 102, 209, 130, 201, 102, 203, 151, 63,
+ 201, 102, 88, 250, 193, 211, 77, 247, 22, 250, 193, 234, 164, 201, 206,
+ 250, 193, 234, 164, 209, 60, 62, 201, 102, 234, 164, 209, 60, 209, 130,
+ 201, 102, 202, 136, 209, 60, 62, 201, 102, 234, 164, 209, 60, 207, 90,
+ 62, 201, 102, 88, 234, 164, 209, 60, 207, 90, 62, 201, 102, 197, 38, 209,
+ 60, 62, 201, 102, 202, 131, 209, 60, 250, 193, 199, 127, 250, 193, 211,
+ 77, 247, 22, 199, 127, 250, 193, 88, 199, 127, 250, 193, 202, 136, 209,
+ 239, 62, 23, 63, 232, 189, 62, 232, 189, 63, 232, 189, 234, 164, 209,
+ 239, 211, 10, 62, 232, 189, 47, 211, 77, 247, 22, 234, 164, 209, 60, 201,
+ 102, 88, 199, 127, 209, 130, 250, 193, 202, 50, 198, 172, 197, 234, 202,
+ 50, 88, 243, 101, 202, 50, 201, 242, 88, 201, 242, 249, 108, 250, 193,
+ 234, 164, 199, 127, 208, 189, 250, 193, 88, 234, 164, 199, 127, 208, 189,
+ 250, 193, 238, 218, 77, 203, 151, 63, 243, 10, 214, 106, 112, 238, 218,
+ 77, 110, 50, 235, 98, 63, 201, 190, 116, 50, 235, 98, 63, 201, 190, 110,
+ 50, 203, 151, 63, 201, 190, 116, 50, 203, 151, 63, 201, 190, 62, 208, 13,
+ 87, 211, 42, 63, 208, 13, 87, 211, 42, 63, 233, 216, 87, 211, 42, 62,
+ 237, 33, 216, 35, 63, 192, 235, 88, 233, 216, 87, 113, 156, 81, 164, 216,
+ 213, 81, 164, 88, 81, 164, 88, 202, 170, 153, 242, 75, 207, 252, 87, 211,
+ 42, 88, 202, 170, 242, 75, 207, 252, 87, 211, 42, 88, 55, 153, 242, 75,
+ 207, 252, 87, 211, 42, 88, 55, 242, 75, 207, 252, 87, 211, 42, 88, 130,
+ 202, 170, 242, 75, 207, 252, 87, 211, 42, 88, 130, 55, 242, 75, 207, 252,
+ 87, 211, 42, 238, 163, 201, 81, 210, 128, 3, 211, 42, 88, 233, 216, 87,
+ 211, 42, 88, 229, 224, 233, 216, 87, 211, 42, 88, 62, 229, 223, 206, 122,
+ 88, 62, 229, 224, 247, 248, 232, 190, 229, 223, 206, 122, 232, 190, 229,
+ 224, 247, 248, 216, 213, 45, 210, 114, 211, 42, 216, 213, 50, 210, 114,
+ 211, 42, 216, 213, 232, 203, 45, 210, 114, 211, 42, 216, 213, 232, 203,
+ 50, 210, 114, 211, 42, 216, 213, 219, 219, 251, 116, 248, 54, 211, 42,
+ 216, 213, 206, 203, 251, 116, 248, 54, 211, 42, 88, 219, 219, 251, 116,
+ 207, 252, 87, 211, 42, 88, 206, 203, 251, 116, 207, 252, 87, 211, 42, 88,
+ 219, 219, 251, 116, 248, 54, 211, 42, 88, 206, 203, 251, 116, 248, 54,
+ 211, 42, 156, 45, 198, 42, 203, 103, 248, 54, 211, 42, 156, 50, 198, 42,
+ 203, 103, 248, 54, 211, 42, 216, 213, 45, 238, 171, 248, 54, 211, 42,
+ 216, 213, 50, 238, 171, 248, 54, 211, 42, 236, 241, 214, 106, 47, 17,
+ 107, 236, 241, 214, 106, 47, 17, 109, 236, 241, 214, 106, 47, 17, 138,
+ 236, 241, 214, 106, 47, 17, 134, 236, 241, 214, 106, 47, 17, 149, 236,
+ 241, 214, 106, 47, 17, 169, 236, 241, 214, 106, 47, 17, 175, 236, 241,
+ 214, 106, 47, 17, 171, 236, 241, 214, 106, 47, 17, 178, 236, 241, 214,
+ 106, 47, 31, 199, 95, 236, 241, 47, 49, 17, 107, 236, 241, 47, 49, 17,
+ 109, 236, 241, 47, 49, 17, 138, 236, 241, 47, 49, 17, 134, 236, 241, 47,
+ 49, 17, 149, 236, 241, 47, 49, 17, 169, 236, 241, 47, 49, 17, 175, 236,
+ 241, 47, 49, 17, 171, 236, 241, 47, 49, 17, 178, 236, 241, 47, 49, 31,
+ 199, 95, 236, 241, 214, 106, 47, 49, 17, 107, 236, 241, 214, 106, 47, 49,
+ 17, 109, 236, 241, 214, 106, 47, 49, 17, 138, 236, 241, 214, 106, 47, 49,
+ 17, 134, 236, 241, 214, 106, 47, 49, 17, 149, 236, 241, 214, 106, 47, 49,
+ 17, 169, 236, 241, 214, 106, 47, 49, 17, 175, 236, 241, 214, 106, 47, 49,
+ 17, 171, 236, 241, 214, 106, 47, 49, 17, 178, 236, 241, 214, 106, 47, 49,
+ 31, 199, 95, 88, 193, 77, 96, 57, 88, 108, 56, 88, 216, 35, 56, 88, 236,
+ 200, 56, 88, 202, 2, 234, 204, 57, 88, 96, 57, 88, 186, 234, 204, 57,
+ 235, 113, 209, 62, 96, 57, 88, 206, 114, 96, 57, 197, 240, 96, 57, 88,
+ 197, 240, 96, 57, 237, 214, 197, 240, 96, 57, 88, 237, 214, 197, 240, 96,
+ 57, 62, 96, 57, 198, 225, 198, 52, 96, 250, 235, 198, 225, 248, 75, 96,
+ 250, 235, 62, 96, 250, 235, 88, 62, 238, 163, 235, 119, 23, 96, 57, 88,
+ 62, 238, 163, 196, 66, 23, 96, 57, 201, 187, 62, 96, 57, 88, 239, 56, 62,
+ 96, 57, 206, 202, 63, 96, 57, 219, 218, 63, 96, 57, 249, 145, 203, 151,
+ 63, 96, 57, 232, 95, 203, 151, 63, 96, 57, 88, 110, 206, 201, 63, 96, 57,
+ 88, 116, 206, 201, 63, 96, 57, 213, 8, 110, 206, 201, 63, 96, 57, 238,
+ 171, 219, 4, 213, 8, 116, 206, 201, 63, 96, 57, 47, 88, 63, 96, 57, 193,
+ 88, 96, 57, 248, 138, 202, 2, 234, 204, 57, 248, 138, 96, 57, 248, 138,
+ 186, 234, 204, 57, 88, 248, 138, 202, 2, 234, 204, 57, 88, 248, 138, 96,
+ 57, 88, 248, 138, 186, 234, 204, 57, 199, 129, 96, 57, 88, 199, 128, 96,
+ 57, 193, 115, 96, 57, 88, 193, 115, 96, 57, 211, 71, 96, 57, 55, 238,
+ 171, 219, 4, 115, 236, 251, 251, 115, 63, 197, 242, 239, 33, 2, 63, 197,
+ 241, 209, 254, 211, 77, 200, 228, 211, 77, 200, 180, 45, 206, 7, 249,
+ 131, 237, 112, 50, 206, 7, 249, 131, 237, 112, 211, 57, 4, 75, 223, 117,
+ 207, 19, 202, 24, 208, 230, 200, 228, 200, 181, 208, 230, 202, 23, 81,
+ 249, 88, 4, 228, 241, 106, 13, 206, 180, 237, 38, 179, 236, 199, 13, 233,
+ 83, 237, 38, 112, 219, 29, 251, 125, 112, 219, 29, 211, 56, 63, 237, 33,
+ 4, 247, 20, 236, 140, 23, 4, 236, 140, 234, 132, 79, 211, 69, 196, 65,
+ 110, 50, 239, 2, 4, 236, 140, 116, 45, 239, 2, 4, 236, 140, 45, 211, 12,
+ 222, 199, 50, 211, 12, 222, 199, 232, 80, 211, 12, 222, 199, 220, 13,
+ 133, 199, 228, 220, 13, 144, 199, 228, 45, 23, 50, 55, 197, 57, 45, 23,
+ 50, 199, 228, 45, 215, 131, 179, 50, 199, 228, 179, 45, 199, 228, 133,
+ 199, 229, 4, 243, 11, 58, 218, 233, 236, 206, 247, 205, 228, 241, 206,
+ 52, 63, 239, 55, 237, 32, 63, 239, 55, 237, 33, 4, 118, 198, 182, 63,
+ 239, 55, 237, 33, 4, 96, 198, 182, 63, 51, 4, 118, 198, 182, 63, 51, 4,
+ 96, 198, 182, 13, 45, 63, 51, 248, 53, 13, 50, 63, 51, 248, 53, 13, 45,
+ 251, 116, 248, 53, 13, 50, 251, 116, 248, 53, 13, 45, 55, 251, 116, 248,
+ 53, 13, 50, 55, 251, 116, 248, 53, 13, 45, 63, 198, 42, 203, 103, 248,
+ 53, 13, 50, 63, 198, 42, 203, 103, 248, 53, 13, 45, 232, 203, 210, 113,
+ 13, 50, 232, 203, 210, 113, 196, 66, 208, 26, 57, 235, 119, 208, 26, 57,
+ 251, 85, 231, 202, 243, 11, 57, 242, 221, 231, 202, 243, 11, 57, 50, 64,
+ 4, 47, 209, 81, 179, 118, 57, 179, 96, 57, 179, 45, 50, 57, 179, 118, 55,
+ 57, 179, 96, 55, 57, 179, 45, 50, 55, 57, 179, 118, 64, 232, 98, 164,
+ 179, 96, 64, 232, 98, 164, 179, 118, 55, 64, 232, 98, 164, 179, 96, 55,
+ 64, 232, 98, 164, 179, 96, 201, 183, 57, 69, 70, 248, 132, 69, 70, 236,
+ 137, 69, 70, 236, 9, 69, 70, 236, 136, 69, 70, 235, 201, 69, 70, 236, 72,
+ 69, 70, 236, 8, 69, 70, 236, 135, 69, 70, 235, 169, 69, 70, 236, 40, 69,
+ 70, 235, 232, 69, 70, 236, 103, 69, 70, 235, 200, 69, 70, 236, 71, 69,
+ 70, 236, 7, 69, 70, 236, 134, 69, 70, 235, 153, 69, 70, 236, 24, 69, 70,
+ 235, 216, 69, 70, 236, 87, 69, 70, 235, 184, 69, 70, 236, 55, 69, 70,
+ 235, 247, 69, 70, 236, 118, 69, 70, 235, 168, 69, 70, 236, 39, 69, 70,
+ 235, 231, 69, 70, 236, 102, 69, 70, 235, 199, 69, 70, 236, 70, 69, 70,
+ 236, 6, 69, 70, 236, 133, 69, 70, 235, 145, 69, 70, 236, 16, 69, 70, 235,
+ 208, 69, 70, 236, 79, 69, 70, 235, 176, 69, 70, 236, 47, 69, 70, 235,
+ 239, 69, 70, 236, 110, 69, 70, 235, 160, 69, 70, 236, 31, 69, 70, 235,
+ 223, 69, 70, 236, 94, 69, 70, 235, 191, 69, 70, 236, 62, 69, 70, 235,
+ 254, 69, 70, 236, 125, 69, 70, 235, 152, 69, 70, 236, 23, 69, 70, 235,
+ 215, 69, 70, 236, 86, 69, 70, 235, 183, 69, 70, 236, 54, 69, 70, 235,
+ 246, 69, 70, 236, 117, 69, 70, 235, 167, 69, 70, 236, 38, 69, 70, 235,
+ 230, 69, 70, 236, 101, 69, 70, 235, 198, 69, 70, 236, 69, 69, 70, 236, 5,
+ 69, 70, 236, 132, 69, 70, 235, 141, 69, 70, 236, 12, 69, 70, 235, 204,
+ 69, 70, 236, 75, 69, 70, 235, 172, 69, 70, 236, 43, 69, 70, 235, 235, 69,
+ 70, 236, 106, 69, 70, 235, 156, 69, 70, 236, 27, 69, 70, 235, 219, 69,
+ 70, 236, 90, 69, 70, 235, 187, 69, 70, 236, 58, 69, 70, 235, 250, 69, 70,
+ 236, 121, 69, 70, 235, 148, 69, 70, 236, 19, 69, 70, 235, 211, 69, 70,
+ 236, 82, 69, 70, 235, 179, 69, 70, 236, 50, 69, 70, 235, 242, 69, 70,
+ 236, 113, 69, 70, 235, 163, 69, 70, 236, 34, 69, 70, 235, 226, 69, 70,
+ 236, 97, 69, 70, 235, 194, 69, 70, 236, 65, 69, 70, 236, 1, 69, 70, 236,
+ 128, 69, 70, 235, 144, 69, 70, 236, 15, 69, 70, 235, 207, 69, 70, 236,
+ 78, 69, 70, 235, 175, 69, 70, 236, 46, 69, 70, 235, 238, 69, 70, 236,
+ 109, 69, 70, 235, 159, 69, 70, 236, 30, 69, 70, 235, 222, 69, 70, 236,
+ 93, 69, 70, 235, 190, 69, 70, 236, 61, 69, 70, 235, 253, 69, 70, 236,
+ 124, 69, 70, 235, 151, 69, 70, 236, 22, 69, 70, 235, 214, 69, 70, 236,
+ 85, 69, 70, 235, 182, 69, 70, 236, 53, 69, 70, 235, 245, 69, 70, 236,
+ 116, 69, 70, 235, 166, 69, 70, 236, 37, 69, 70, 235, 229, 69, 70, 236,
+ 100, 69, 70, 235, 197, 69, 70, 236, 68, 69, 70, 236, 4, 69, 70, 236, 131,
+ 69, 70, 235, 139, 69, 70, 236, 10, 69, 70, 235, 202, 69, 70, 236, 73, 69,
+ 70, 235, 170, 69, 70, 236, 41, 69, 70, 235, 233, 69, 70, 236, 104, 69,
+ 70, 235, 154, 69, 70, 236, 25, 69, 70, 235, 217, 69, 70, 236, 88, 69, 70,
+ 235, 185, 69, 70, 236, 56, 69, 70, 235, 248, 69, 70, 236, 119, 69, 70,
+ 235, 146, 69, 70, 236, 17, 69, 70, 235, 209, 69, 70, 236, 80, 69, 70,
+ 235, 177, 69, 70, 236, 48, 69, 70, 235, 240, 69, 70, 236, 111, 69, 70,
+ 235, 161, 69, 70, 236, 32, 69, 70, 235, 224, 69, 70, 236, 95, 69, 70,
+ 235, 192, 69, 70, 236, 63, 69, 70, 235, 255, 69, 70, 236, 126, 69, 70,
+ 235, 142, 69, 70, 236, 13, 69, 70, 235, 205, 69, 70, 236, 76, 69, 70,
+ 235, 173, 69, 70, 236, 44, 69, 70, 235, 236, 69, 70, 236, 107, 69, 70,
+ 235, 157, 69, 70, 236, 28, 69, 70, 235, 220, 69, 70, 236, 91, 69, 70,
+ 235, 188, 69, 70, 236, 59, 69, 70, 235, 251, 69, 70, 236, 122, 69, 70,
+ 235, 149, 69, 70, 236, 20, 69, 70, 235, 212, 69, 70, 236, 83, 69, 70,
+ 235, 180, 69, 70, 236, 51, 69, 70, 235, 243, 69, 70, 236, 114, 69, 70,
+ 235, 164, 69, 70, 236, 35, 69, 70, 235, 227, 69, 70, 236, 98, 69, 70,
+ 235, 195, 69, 70, 236, 66, 69, 70, 236, 2, 69, 70, 236, 129, 69, 70, 235,
+ 140, 69, 70, 236, 11, 69, 70, 235, 203, 69, 70, 236, 74, 69, 70, 235,
+ 171, 69, 70, 236, 42, 69, 70, 235, 234, 69, 70, 236, 105, 69, 70, 235,
+ 155, 69, 70, 236, 26, 69, 70, 235, 218, 69, 70, 236, 89, 69, 70, 235,
+ 186, 69, 70, 236, 57, 69, 70, 235, 249, 69, 70, 236, 120, 69, 70, 235,
+ 147, 69, 70, 236, 18, 69, 70, 235, 210, 69, 70, 236, 81, 69, 70, 235,
+ 178, 69, 70, 236, 49, 69, 70, 235, 241, 69, 70, 236, 112, 69, 70, 235,
+ 162, 69, 70, 236, 33, 69, 70, 235, 225, 69, 70, 236, 96, 69, 70, 235,
+ 193, 69, 70, 236, 64, 69, 70, 236, 0, 69, 70, 236, 127, 69, 70, 235, 143,
+ 69, 70, 236, 14, 69, 70, 235, 206, 69, 70, 236, 77, 69, 70, 235, 174, 69,
+ 70, 236, 45, 69, 70, 235, 237, 69, 70, 236, 108, 69, 70, 235, 158, 69,
+ 70, 236, 29, 69, 70, 235, 221, 69, 70, 236, 92, 69, 70, 235, 189, 69, 70,
+ 236, 60, 69, 70, 235, 252, 69, 70, 236, 123, 69, 70, 235, 150, 69, 70,
+ 236, 21, 69, 70, 235, 213, 69, 70, 236, 84, 69, 70, 235, 181, 69, 70,
+ 236, 52, 69, 70, 235, 244, 69, 70, 236, 115, 69, 70, 235, 165, 69, 70,
+ 236, 36, 69, 70, 235, 228, 69, 70, 236, 99, 69, 70, 235, 196, 69, 70,
+ 236, 67, 69, 70, 236, 3, 69, 70, 236, 130, 96, 197, 13, 64, 4, 81, 106,
+ 96, 197, 13, 64, 4, 55, 81, 106, 118, 55, 64, 4, 81, 106, 96, 55, 64, 4,
+ 81, 106, 45, 50, 55, 64, 4, 81, 106, 96, 197, 13, 64, 232, 98, 164, 118,
+ 55, 64, 232, 98, 164, 96, 55, 64, 232, 98, 164, 235, 119, 64, 4, 228,
+ 241, 106, 196, 66, 64, 4, 228, 241, 106, 196, 66, 197, 225, 57, 235, 119,
+ 197, 225, 57, 118, 55, 237, 216, 57, 96, 55, 237, 216, 57, 118, 197, 225,
+ 237, 216, 57, 96, 197, 225, 237, 216, 57, 96, 197, 13, 197, 225, 237,
+ 216, 57, 96, 64, 4, 235, 138, 201, 80, 196, 66, 64, 119, 164, 235, 119,
+ 64, 119, 164, 96, 64, 4, 199, 216, 4, 81, 106, 96, 64, 4, 199, 216, 4,
+ 55, 81, 106, 96, 197, 13, 64, 4, 199, 215, 96, 197, 13, 64, 4, 199, 216,
+ 4, 81, 106, 96, 197, 13, 64, 4, 199, 216, 4, 55, 81, 106, 118, 250, 237,
+ 96, 250, 237, 118, 55, 250, 237, 96, 55, 250, 237, 118, 64, 119, 62, 237,
+ 32, 96, 64, 119, 62, 237, 32, 118, 64, 232, 98, 249, 88, 119, 62, 237,
+ 32, 96, 64, 232, 98, 249, 88, 119, 62, 237, 32, 186, 193, 105, 23, 202,
+ 2, 234, 204, 57, 186, 234, 204, 23, 202, 2, 193, 105, 57, 186, 193, 105,
+ 64, 4, 102, 186, 234, 204, 64, 4, 102, 202, 2, 234, 204, 64, 4, 102, 202,
+ 2, 193, 105, 64, 4, 102, 186, 193, 105, 64, 23, 186, 234, 204, 57, 186,
+ 234, 204, 64, 23, 202, 2, 234, 204, 57, 202, 2, 234, 204, 64, 23, 202, 2,
+ 193, 105, 57, 202, 2, 193, 105, 64, 23, 186, 193, 105, 57, 206, 180, 237,
+ 39, 238, 210, 233, 83, 237, 38, 233, 83, 237, 39, 238, 210, 206, 180,
+ 237, 38, 202, 2, 234, 204, 64, 238, 210, 186, 234, 204, 57, 186, 234,
+ 204, 64, 238, 210, 202, 2, 234, 204, 57, 233, 83, 237, 39, 238, 210, 186,
+ 234, 204, 57, 206, 180, 237, 39, 238, 210, 202, 2, 234, 204, 57, 186,
+ 234, 204, 64, 238, 210, 186, 193, 105, 57, 186, 193, 105, 64, 238, 210,
+ 186, 234, 204, 57, 193, 139, 64, 209, 58, 236, 231, 183, 64, 209, 58, 96,
+ 199, 25, 238, 161, 196, 65, 64, 209, 58, 96, 199, 25, 238, 161, 235, 118,
+ 64, 209, 58, 235, 119, 199, 25, 238, 161, 219, 214, 64, 209, 58, 235,
+ 119, 199, 25, 238, 161, 206, 197, 206, 200, 251, 17, 242, 221, 57, 219,
+ 217, 251, 17, 251, 85, 57, 198, 54, 251, 17, 251, 85, 57, 248, 77, 251,
+ 17, 251, 85, 57, 198, 54, 251, 17, 242, 221, 64, 4, 216, 34, 198, 54,
+ 251, 17, 251, 85, 64, 4, 209, 81, 110, 50, 204, 27, 242, 221, 57, 110,
+ 45, 204, 27, 251, 85, 57, 251, 85, 242, 219, 243, 11, 57, 242, 221, 242,
+ 219, 243, 11, 57, 96, 64, 93, 203, 40, 118, 57, 118, 64, 93, 203, 40, 96,
+ 57, 203, 40, 96, 64, 93, 118, 57, 96, 64, 4, 108, 60, 118, 64, 4, 108,
+ 60, 96, 64, 198, 216, 192, 235, 45, 50, 64, 198, 216, 2, 243, 10, 196,
+ 66, 197, 13, 64, 232, 98, 2, 243, 10, 45, 181, 133, 50, 181, 144, 230,
+ 12, 45, 181, 144, 50, 181, 133, 230, 12, 133, 181, 50, 144, 181, 45, 230,
+ 12, 133, 181, 45, 144, 181, 50, 230, 12, 45, 181, 133, 50, 181, 133, 230,
+ 12, 133, 181, 50, 144, 181, 50, 230, 12, 45, 181, 144, 50, 181, 144, 230,
+ 12, 133, 181, 45, 144, 181, 45, 230, 12, 118, 230, 13, 4, 181, 133, 119,
+ 164, 96, 230, 13, 4, 181, 133, 119, 164, 196, 66, 230, 13, 4, 181, 50,
+ 119, 164, 235, 119, 230, 13, 4, 181, 50, 119, 164, 118, 230, 13, 4, 181,
+ 144, 119, 164, 96, 230, 13, 4, 181, 144, 119, 164, 196, 66, 230, 13, 4,
+ 181, 45, 119, 164, 235, 119, 230, 13, 4, 181, 45, 119, 164, 118, 230, 13,
+ 4, 181, 133, 232, 98, 164, 96, 230, 13, 4, 181, 133, 232, 98, 164, 196,
+ 66, 230, 13, 4, 181, 50, 232, 98, 164, 235, 119, 230, 13, 4, 181, 50,
+ 232, 98, 164, 118, 230, 13, 4, 181, 144, 232, 98, 164, 96, 230, 13, 4,
+ 181, 144, 232, 98, 164, 196, 66, 230, 13, 4, 181, 45, 232, 98, 164, 235,
+ 119, 230, 13, 4, 181, 45, 232, 98, 164, 118, 230, 13, 4, 181, 133, 93,
+ 118, 230, 13, 4, 181, 235, 123, 196, 66, 230, 13, 4, 181, 45, 248, 216,
+ 196, 66, 230, 13, 4, 181, 183, 96, 230, 13, 4, 181, 133, 93, 96, 230, 13,
+ 4, 181, 235, 123, 235, 119, 230, 13, 4, 181, 45, 248, 216, 235, 119, 230,
+ 13, 4, 181, 183, 118, 230, 13, 4, 181, 133, 93, 96, 230, 13, 4, 181, 196,
+ 77, 118, 230, 13, 4, 181, 144, 93, 96, 230, 13, 4, 181, 235, 123, 96,
+ 230, 13, 4, 181, 133, 93, 118, 230, 13, 4, 181, 196, 77, 96, 230, 13, 4,
+ 181, 144, 93, 118, 230, 13, 4, 181, 235, 123, 118, 230, 13, 4, 181, 133,
+ 93, 179, 237, 215, 118, 230, 13, 4, 181, 144, 248, 233, 179, 237, 215,
+ 96, 230, 13, 4, 181, 133, 93, 179, 237, 215, 96, 230, 13, 4, 181, 144,
+ 248, 233, 179, 237, 215, 196, 66, 230, 13, 4, 181, 45, 248, 216, 235,
+ 119, 230, 13, 4, 181, 183, 235, 119, 230, 13, 4, 181, 45, 248, 216, 196,
+ 66, 230, 13, 4, 181, 183, 50, 55, 64, 4, 206, 113, 229, 235, 234, 43, 3,
+ 93, 96, 57, 198, 153, 211, 67, 93, 96, 57, 118, 64, 93, 198, 153, 211,
+ 66, 96, 64, 93, 198, 153, 211, 66, 96, 64, 93, 251, 165, 234, 45, 159,
+ 219, 180, 93, 118, 57, 118, 64, 198, 216, 219, 179, 230, 204, 93, 96, 57,
+ 200, 229, 93, 96, 57, 118, 64, 198, 216, 200, 228, 200, 181, 93, 118, 57,
+ 45, 232, 237, 199, 215, 50, 232, 237, 199, 215, 133, 232, 237, 199, 215,
+ 144, 232, 237, 199, 215, 197, 225, 81, 249, 88, 237, 112, 191, 167, 213,
+ 10, 201, 201, 191, 167, 213, 10, 196, 255, 242, 83, 45, 63, 238, 171,
+ 248, 53, 50, 63, 238, 171, 248, 53, 45, 63, 210, 113, 50, 63, 210, 113,
+ 191, 167, 213, 10, 45, 223, 178, 248, 53, 191, 167, 213, 10, 50, 223,
+ 178, 248, 53, 191, 167, 213, 10, 45, 248, 166, 248, 53, 191, 167, 213,
+ 10, 50, 248, 166, 248, 53, 45, 51, 248, 54, 4, 196, 103, 50, 51, 248, 54,
+ 4, 196, 103, 45, 51, 248, 54, 4, 198, 183, 223, 163, 198, 54, 239, 1, 50,
+ 51, 248, 54, 4, 198, 183, 223, 163, 248, 77, 239, 1, 45, 51, 248, 54, 4,
+ 198, 183, 223, 163, 248, 77, 239, 1, 50, 51, 248, 54, 4, 198, 183, 223,
+ 163, 198, 54, 239, 1, 45, 251, 116, 248, 54, 4, 236, 140, 50, 251, 116,
+ 248, 54, 4, 236, 140, 45, 251, 17, 219, 180, 248, 53, 50, 251, 17, 230,
+ 204, 248, 53, 55, 45, 251, 17, 230, 204, 248, 53, 55, 50, 251, 17, 219,
+ 180, 248, 53, 45, 62, 198, 42, 203, 103, 248, 53, 50, 62, 198, 42, 203,
+ 103, 248, 53, 235, 138, 233, 39, 81, 191, 21, 219, 112, 216, 226, 251,
+ 116, 211, 69, 219, 224, 50, 251, 116, 195, 168, 4, 201, 190, 216, 226,
+ 50, 251, 116, 4, 236, 140, 251, 116, 4, 206, 9, 223, 117, 252, 47, 251,
+ 115, 201, 225, 251, 116, 211, 69, 219, 224, 201, 225, 251, 116, 211, 69,
+ 196, 77, 153, 251, 115, 207, 18, 251, 115, 251, 116, 4, 196, 103, 207,
+ 18, 251, 116, 4, 196, 103, 211, 172, 251, 116, 211, 69, 196, 77, 211,
+ 172, 251, 116, 211, 69, 235, 123, 216, 226, 251, 116, 4, 211, 77, 250,
+ 251, 234, 91, 223, 163, 64, 209, 58, 133, 23, 183, 216, 226, 251, 116, 4,
+ 211, 77, 250, 251, 234, 91, 223, 163, 64, 209, 58, 133, 23, 219, 224,
+ 216, 226, 251, 116, 4, 211, 77, 250, 251, 234, 91, 223, 163, 64, 209, 58,
+ 144, 23, 183, 216, 226, 251, 116, 4, 211, 77, 250, 251, 234, 91, 223,
+ 163, 64, 209, 58, 144, 23, 219, 224, 216, 226, 251, 116, 4, 211, 77, 250,
+ 251, 234, 91, 223, 163, 64, 209, 58, 50, 23, 196, 77, 216, 226, 251, 116,
+ 4, 211, 77, 250, 251, 234, 91, 223, 163, 64, 209, 58, 45, 23, 196, 77,
+ 216, 226, 251, 116, 4, 211, 77, 250, 251, 234, 91, 223, 163, 64, 209, 58,
+ 50, 23, 235, 123, 216, 226, 251, 116, 4, 211, 77, 250, 251, 234, 91, 223,
+ 163, 64, 209, 58, 45, 23, 235, 123, 207, 18, 234, 105, 203, 252, 234,
+ 105, 203, 253, 4, 211, 6, 234, 105, 203, 253, 4, 2, 243, 11, 58, 234,
+ 105, 203, 253, 4, 50, 64, 58, 234, 105, 203, 253, 4, 45, 64, 58, 243, 11,
+ 4, 228, 241, 164, 47, 81, 164, 47, 210, 118, 47, 207, 19, 202, 23, 47,
+ 209, 254, 243, 11, 236, 206, 247, 205, 228, 241, 249, 88, 23, 198, 54,
+ 132, 236, 206, 247, 205, 81, 164, 243, 11, 4, 200, 183, 192, 235, 47,
+ 251, 83, 236, 200, 56, 133, 64, 198, 216, 243, 10, 47, 63, 247, 248, 47,
+ 247, 248, 47, 219, 179, 47, 230, 203, 243, 11, 4, 2, 243, 11, 119, 199,
+ 34, 183, 243, 11, 4, 105, 228, 241, 201, 16, 119, 199, 34, 183, 112, 206,
+ 180, 237, 39, 202, 97, 112, 233, 83, 237, 39, 202, 97, 112, 250, 193,
+ 112, 2, 243, 10, 112, 201, 190, 105, 222, 198, 201, 188, 197, 242, 4, 75,
+ 58, 197, 242, 4, 196, 103, 206, 9, 223, 163, 197, 241, 197, 242, 4, 204,
+ 4, 250, 183, 248, 76, 50, 197, 242, 93, 45, 197, 241, 45, 197, 242, 248,
+ 216, 81, 164, 81, 249, 88, 248, 216, 50, 197, 241, 248, 64, 4, 45, 132,
+ 248, 139, 248, 64, 4, 50, 132, 248, 139, 62, 248, 63, 25, 4, 45, 132,
+ 248, 139, 25, 4, 50, 132, 248, 139, 63, 228, 174, 62, 228, 174, 45, 193,
+ 72, 233, 39, 50, 193, 72, 233, 39, 45, 55, 193, 72, 233, 39, 50, 55, 193,
+ 72, 233, 39, 223, 155, 223, 139, 198, 179, 139, 223, 139, 223, 140, 214,
+ 108, 4, 81, 164, 235, 132, 215, 131, 51, 4, 239, 25, 211, 11, 223, 152,
+ 250, 219, 202, 254, 208, 200, 234, 43, 3, 23, 202, 99, 210, 118, 234, 43,
+ 3, 23, 202, 99, 210, 119, 4, 198, 153, 58, 228, 17, 119, 23, 202, 99,
+ 210, 118, 231, 14, 201, 101, 199, 22, 235, 122, 197, 242, 4, 45, 132,
+ 248, 139, 235, 122, 197, 242, 4, 50, 132, 248, 139, 62, 237, 33, 4, 144,
+ 57, 62, 218, 232, 63, 243, 11, 4, 144, 57, 62, 243, 11, 4, 144, 57, 234,
+ 25, 63, 201, 190, 234, 25, 62, 201, 190, 234, 25, 63, 237, 32, 234, 25,
+ 62, 237, 32, 234, 25, 63, 243, 10, 234, 25, 62, 243, 10, 206, 51, 207,
+ 19, 202, 24, 211, 66, 202, 24, 4, 211, 6, 207, 19, 202, 24, 4, 228, 241,
+ 106, 248, 175, 202, 23, 248, 175, 207, 19, 202, 23, 55, 209, 81, 197,
+ 225, 209, 81, 219, 219, 238, 163, 251, 116, 248, 53, 206, 203, 238, 163,
+ 251, 116, 248, 53, 198, 137, 216, 32, 215, 60, 47, 75, 211, 66, 215, 60,
+ 47, 108, 211, 66, 215, 60, 47, 25, 211, 66, 215, 60, 196, 93, 211, 67, 4,
+ 236, 140, 215, 60, 196, 93, 211, 67, 4, 209, 81, 215, 60, 51, 223, 100,
+ 211, 66, 215, 60, 51, 196, 93, 211, 66, 105, 219, 29, 23, 211, 66, 105,
+ 219, 29, 211, 57, 211, 66, 215, 60, 25, 211, 66, 215, 236, 105, 200, 204,
+ 200, 202, 4, 223, 113, 208, 26, 223, 114, 211, 66, 232, 246, 210, 107,
+ 223, 113, 223, 114, 4, 55, 106, 223, 114, 250, 143, 4, 202, 97, 243, 3,
+ 232, 76, 251, 85, 223, 111, 219, 113, 223, 112, 4, 207, 91, 210, 86, 250,
+ 245, 209, 52, 219, 113, 223, 112, 4, 204, 27, 210, 86, 250, 245, 209, 52,
+ 219, 113, 223, 112, 213, 12, 223, 157, 199, 34, 209, 52, 223, 114, 250,
+ 245, 42, 209, 62, 211, 66, 208, 19, 223, 114, 211, 66, 223, 114, 4, 118,
+ 64, 4, 102, 223, 114, 4, 25, 56, 223, 114, 4, 223, 99, 223, 114, 4, 196,
+ 92, 223, 114, 4, 211, 6, 223, 114, 4, 196, 103, 222, 199, 220, 13, 45,
+ 197, 242, 211, 66, 191, 167, 213, 10, 205, 92, 239, 62, 191, 167, 213,
+ 10, 205, 92, 209, 126, 191, 167, 213, 10, 205, 92, 208, 195, 108, 3, 4,
+ 2, 243, 11, 58, 108, 3, 4, 243, 2, 252, 61, 58, 108, 3, 4, 198, 153, 58,
+ 108, 3, 4, 75, 60, 108, 3, 4, 198, 153, 60, 108, 3, 4, 200, 230, 109,
+ 108, 3, 4, 62, 197, 241, 216, 35, 3, 4, 242, 75, 58, 216, 35, 3, 4, 75,
+ 60, 216, 35, 3, 4, 233, 83, 236, 138, 216, 35, 3, 4, 206, 180, 236, 138,
+ 108, 3, 223, 163, 45, 132, 243, 10, 108, 3, 223, 163, 50, 132, 243, 10,
+ 195, 152, 211, 57, 238, 218, 208, 200, 215, 127, 3, 4, 75, 58, 215, 127,
+ 3, 4, 196, 103, 204, 24, 208, 201, 4, 248, 77, 242, 218, 202, 68, 208,
+ 200, 215, 127, 3, 223, 163, 45, 132, 243, 10, 215, 127, 3, 223, 163, 50,
+ 132, 243, 10, 47, 215, 127, 3, 4, 243, 2, 252, 60, 215, 127, 3, 223, 163,
+ 55, 243, 10, 47, 236, 200, 56, 108, 3, 223, 163, 197, 241, 216, 35, 3,
+ 223, 163, 197, 241, 215, 127, 3, 223, 163, 197, 241, 223, 108, 208, 200,
+ 206, 198, 223, 108, 208, 200, 191, 167, 213, 10, 207, 64, 239, 62, 251,
+ 147, 211, 57, 239, 9, 223, 100, 4, 236, 140, 196, 93, 4, 216, 35, 56,
+ 196, 93, 4, 211, 6, 223, 100, 4, 211, 6, 223, 100, 4, 219, 29, 251, 125,
+ 196, 93, 4, 219, 29, 211, 56, 196, 93, 93, 223, 99, 223, 100, 93, 196,
+ 92, 196, 93, 93, 249, 88, 93, 223, 99, 223, 100, 93, 249, 88, 93, 196,
+ 92, 196, 93, 248, 216, 23, 222, 198, 4, 196, 92, 223, 100, 248, 216, 23,
+ 222, 198, 4, 223, 99, 242, 219, 196, 93, 4, 204, 3, 242, 219, 223, 100,
+ 4, 204, 3, 55, 51, 223, 99, 55, 51, 196, 92, 242, 219, 196, 93, 4, 204,
+ 4, 23, 202, 68, 208, 200, 219, 29, 23, 4, 75, 58, 219, 29, 211, 57, 4,
+ 75, 58, 55, 219, 29, 251, 125, 55, 219, 29, 211, 56, 105, 223, 101, 219,
+ 29, 251, 125, 105, 223, 101, 219, 29, 211, 56, 202, 80, 220, 13, 211, 56,
+ 202, 80, 220, 13, 251, 125, 219, 29, 211, 57, 211, 1, 219, 29, 251, 125,
+ 219, 29, 23, 4, 82, 201, 80, 219, 29, 211, 57, 4, 82, 201, 80, 219, 29,
+ 23, 4, 228, 241, 237, 215, 219, 29, 211, 57, 4, 228, 241, 237, 215, 219,
+ 29, 23, 4, 55, 211, 6, 219, 29, 23, 4, 196, 103, 219, 29, 23, 4, 55, 196,
+ 103, 2, 195, 149, 4, 196, 103, 219, 29, 211, 57, 4, 55, 211, 6, 219, 29,
+ 211, 57, 4, 55, 196, 103, 191, 167, 213, 10, 236, 152, 251, 75, 191, 167,
+ 213, 10, 207, 137, 251, 75, 234, 43, 3, 4, 75, 60, 228, 17, 4, 75, 58,
+ 197, 225, 228, 241, 249, 88, 4, 55, 81, 106, 197, 225, 228, 241, 249, 88,
+ 4, 197, 225, 81, 106, 198, 153, 211, 67, 4, 75, 58, 198, 153, 211, 67, 4,
+ 206, 180, 236, 138, 202, 180, 216, 35, 202, 179, 239, 49, 4, 75, 58, 234,
+ 43, 4, 250, 193, 251, 165, 234, 45, 119, 4, 243, 2, 252, 60, 251, 40,
+ 234, 45, 211, 57, 234, 45, 159, 234, 43, 3, 93, 108, 56, 108, 3, 93, 234,
+ 43, 56, 234, 43, 3, 93, 198, 153, 211, 66, 55, 242, 84, 234, 44, 105,
+ 239, 41, 234, 43, 202, 194, 115, 239, 41, 234, 43, 202, 194, 234, 43, 3,
+ 4, 105, 185, 93, 23, 105, 185, 60, 234, 36, 4, 232, 128, 185, 58, 219,
+ 180, 4, 243, 11, 223, 117, 230, 204, 4, 243, 11, 223, 117, 219, 180, 4,
+ 208, 13, 87, 58, 230, 204, 4, 208, 13, 87, 58, 219, 180, 211, 57, 202,
+ 99, 234, 45, 159, 230, 204, 211, 57, 202, 99, 234, 45, 159, 219, 180,
+ 211, 57, 202, 99, 234, 45, 119, 4, 75, 223, 117, 230, 204, 211, 57, 202,
+ 99, 234, 45, 119, 4, 75, 223, 117, 219, 180, 211, 57, 202, 99, 234, 45,
+ 119, 4, 75, 58, 230, 204, 211, 57, 202, 99, 234, 45, 119, 4, 75, 58, 219,
+ 180, 211, 57, 202, 99, 234, 45, 119, 4, 75, 93, 183, 230, 204, 211, 57,
+ 202, 99, 234, 45, 119, 4, 75, 93, 219, 224, 219, 180, 211, 57, 251, 41,
+ 230, 204, 211, 57, 251, 41, 219, 180, 23, 202, 168, 213, 12, 234, 45,
+ 159, 230, 204, 23, 202, 168, 213, 12, 234, 45, 159, 219, 180, 23, 213,
+ 12, 251, 41, 230, 204, 23, 213, 12, 251, 41, 219, 180, 93, 235, 131, 234,
+ 45, 93, 230, 203, 230, 204, 93, 235, 131, 234, 45, 93, 219, 179, 219,
+ 180, 93, 202, 180, 211, 57, 234, 44, 230, 204, 93, 202, 180, 211, 57,
+ 234, 44, 219, 180, 93, 202, 180, 93, 230, 203, 230, 204, 93, 202, 180,
+ 93, 219, 179, 219, 180, 93, 230, 204, 93, 235, 131, 234, 44, 230, 204,
+ 93, 219, 180, 93, 235, 131, 234, 44, 219, 180, 93, 202, 99, 234, 45, 93,
+ 230, 204, 93, 202, 99, 234, 44, 230, 204, 93, 202, 99, 234, 45, 93, 219,
+ 180, 93, 202, 99, 234, 44, 202, 99, 234, 45, 119, 211, 57, 219, 179, 202,
+ 99, 234, 45, 119, 211, 57, 230, 203, 202, 99, 234, 45, 119, 211, 57, 219,
+ 180, 4, 75, 223, 117, 202, 99, 234, 45, 119, 211, 57, 230, 204, 4, 75,
+ 223, 117, 235, 131, 234, 45, 119, 211, 57, 219, 179, 235, 131, 234, 45,
+ 119, 211, 57, 230, 203, 235, 131, 202, 99, 234, 45, 119, 211, 57, 219,
+ 179, 235, 131, 202, 99, 234, 45, 119, 211, 57, 230, 203, 202, 180, 211,
+ 57, 219, 179, 202, 180, 211, 57, 230, 203, 202, 180, 93, 219, 180, 93,
+ 234, 43, 56, 202, 180, 93, 230, 204, 93, 234, 43, 56, 55, 214, 88, 219,
+ 179, 55, 214, 88, 230, 203, 55, 214, 88, 219, 180, 4, 196, 103, 230, 204,
+ 211, 1, 219, 179, 230, 204, 248, 216, 219, 179, 219, 180, 242, 219, 247,
+ 205, 238, 164, 230, 204, 242, 219, 247, 205, 238, 164, 219, 180, 242,
+ 219, 247, 205, 238, 165, 93, 202, 99, 234, 44, 230, 204, 242, 219, 247,
+ 205, 238, 165, 93, 202, 99, 234, 44, 202, 69, 199, 38, 220, 11, 199, 38,
+ 202, 69, 199, 39, 211, 57, 234, 45, 159, 220, 11, 199, 39, 211, 57, 234,
+ 45, 159, 234, 43, 3, 4, 247, 241, 58, 208, 232, 93, 202, 168, 234, 43,
+ 56, 200, 221, 93, 202, 168, 234, 43, 56, 208, 232, 93, 202, 168, 213, 12,
+ 234, 45, 159, 200, 221, 93, 202, 168, 213, 12, 234, 45, 159, 208, 232,
+ 93, 234, 43, 56, 200, 221, 93, 234, 43, 56, 208, 232, 93, 213, 12, 234,
+ 45, 159, 200, 221, 93, 213, 12, 234, 45, 159, 208, 232, 93, 251, 165,
+ 234, 45, 159, 200, 221, 93, 251, 165, 234, 45, 159, 208, 232, 93, 213,
+ 12, 251, 165, 234, 45, 159, 200, 221, 93, 213, 12, 251, 165, 234, 45,
+ 159, 55, 208, 231, 55, 200, 220, 200, 229, 4, 236, 140, 200, 181, 4, 236,
+ 140, 200, 229, 4, 108, 3, 60, 200, 181, 4, 108, 3, 60, 200, 229, 4, 215,
+ 127, 3, 60, 200, 181, 4, 215, 127, 3, 60, 200, 229, 79, 211, 57, 234, 45,
+ 119, 4, 75, 58, 200, 181, 79, 211, 57, 234, 45, 119, 4, 75, 58, 200, 229,
+ 79, 93, 234, 43, 56, 200, 181, 79, 93, 234, 43, 56, 200, 229, 79, 93,
+ 198, 153, 211, 66, 200, 181, 79, 93, 198, 153, 211, 66, 200, 229, 79, 93,
+ 251, 165, 234, 45, 159, 200, 181, 79, 93, 251, 165, 234, 45, 159, 200,
+ 229, 79, 93, 213, 12, 234, 45, 159, 200, 181, 79, 93, 213, 12, 234, 45,
+ 159, 51, 45, 211, 77, 111, 211, 66, 51, 50, 211, 77, 111, 211, 66, 242,
+ 219, 200, 228, 242, 219, 200, 180, 242, 219, 200, 229, 211, 57, 234, 45,
+ 159, 242, 219, 200, 181, 211, 57, 234, 45, 159, 200, 229, 93, 200, 180,
+ 200, 181, 93, 200, 228, 200, 229, 93, 200, 228, 200, 181, 93, 200, 180,
+ 200, 181, 248, 216, 200, 228, 200, 181, 248, 216, 23, 222, 198, 247, 205,
+ 237, 216, 4, 200, 228, 234, 132, 79, 211, 69, 235, 118, 209, 116, 4, 199,
+ 122, 198, 53, 198, 7, 223, 99, 232, 147, 213, 27, 203, 40, 45, 199, 228,
+ 203, 40, 144, 199, 228, 203, 40, 133, 199, 228, 209, 255, 4, 206, 8, 81,
+ 249, 88, 197, 225, 50, 197, 57, 55, 81, 249, 88, 45, 197, 57, 81, 249,
+ 88, 55, 45, 197, 57, 55, 81, 249, 88, 55, 45, 197, 57, 179, 237, 216,
+ 232, 98, 45, 216, 191, 79, 55, 195, 135, 203, 40, 144, 199, 229, 4, 211,
+ 6, 203, 40, 133, 199, 229, 4, 196, 103, 203, 40, 133, 199, 229, 93, 203,
+ 40, 144, 199, 228, 55, 144, 199, 228, 55, 133, 199, 228, 55, 201, 28,
+ 213, 12, 56, 207, 18, 55, 201, 28, 213, 12, 56, 236, 164, 213, 12, 236,
+ 208, 4, 207, 18, 214, 107, 202, 97, 81, 219, 113, 4, 243, 11, 58, 81,
+ 219, 113, 4, 243, 11, 60, 144, 199, 229, 4, 243, 11, 60, 210, 119, 4,
+ 228, 241, 106, 210, 119, 4, 198, 153, 211, 66, 197, 225, 81, 249, 88,
+ 248, 168, 207, 65, 197, 225, 81, 249, 88, 4, 228, 241, 106, 197, 225,
+ 242, 84, 211, 66, 197, 225, 214, 88, 219, 179, 197, 225, 214, 88, 230,
+ 203, 235, 131, 202, 99, 219, 180, 211, 57, 234, 45, 159, 235, 131, 202,
+ 99, 230, 204, 211, 57, 234, 45, 159, 197, 225, 202, 24, 248, 168, 207,
+ 65, 220, 13, 197, 225, 81, 249, 88, 211, 66, 55, 202, 24, 211, 66, 63,
+ 81, 164, 215, 60, 63, 81, 164, 186, 234, 204, 63, 57, 186, 193, 105, 63,
+ 57, 202, 2, 234, 204, 63, 57, 202, 2, 193, 105, 63, 57, 45, 50, 63, 57,
+ 118, 62, 57, 196, 66, 62, 57, 235, 119, 62, 57, 186, 234, 204, 62, 57,
+ 186, 193, 105, 62, 57, 202, 2, 234, 204, 62, 57, 202, 2, 193, 105, 62,
+ 57, 45, 50, 62, 57, 133, 144, 62, 57, 96, 64, 4, 198, 136, 235, 118, 96,
+ 64, 4, 198, 136, 196, 65, 118, 64, 4, 198, 136, 235, 118, 118, 64, 4,
+ 198, 136, 196, 65, 51, 4, 198, 54, 132, 248, 139, 51, 4, 248, 77, 132,
+ 248, 139, 51, 4, 116, 50, 237, 39, 132, 248, 139, 51, 4, 110, 45, 237,
+ 39, 132, 248, 139, 237, 33, 4, 45, 132, 248, 139, 237, 33, 4, 50, 132,
+ 248, 139, 237, 33, 4, 198, 54, 132, 248, 139, 237, 33, 4, 248, 77, 132,
+ 248, 139, 235, 138, 201, 190, 62, 220, 13, 201, 190, 63, 220, 13, 201,
+ 190, 62, 195, 83, 2, 201, 190, 63, 195, 83, 2, 201, 190, 62, 210, 24, 63,
+ 210, 24, 63, 229, 182, 62, 229, 182, 228, 241, 62, 229, 182, 62, 220, 13,
+ 243, 10, 62, 216, 213, 237, 32, 63, 216, 213, 237, 32, 62, 216, 213, 218,
+ 232, 63, 216, 213, 218, 232, 62, 2, 237, 32, 62, 2, 218, 232, 63, 2, 218,
+ 232, 62, 228, 241, 234, 121, 63, 228, 241, 234, 121, 62, 81, 234, 121,
+ 63, 81, 234, 121, 45, 64, 4, 2, 243, 10, 115, 118, 250, 231, 45, 64, 4,
+ 47, 209, 81, 179, 118, 201, 183, 57, 118, 197, 13, 64, 4, 81, 106, 118,
+ 197, 13, 64, 4, 55, 81, 106, 118, 197, 13, 64, 232, 98, 164, 118, 197,
+ 13, 197, 225, 237, 216, 57, 118, 64, 4, 235, 138, 201, 80, 118, 64, 4,
+ 199, 216, 4, 81, 106, 118, 64, 4, 199, 216, 4, 55, 81, 106, 118, 197, 13,
+ 64, 4, 199, 215, 118, 197, 13, 64, 4, 199, 216, 4, 81, 106, 118, 197, 13,
+ 64, 4, 199, 216, 4, 55, 81, 106, 118, 64, 198, 216, 192, 235, 193, 139,
+ 64, 209, 58, 236, 231, 219, 224, 234, 43, 3, 93, 118, 57, 207, 19, 198,
+ 153, 211, 67, 93, 118, 57, 118, 64, 93, 207, 19, 251, 165, 234, 45, 159,
+ 96, 64, 198, 216, 230, 203, 96, 64, 198, 216, 200, 180, 118, 208, 26, 57,
+ 96, 208, 26, 57, 207, 19, 198, 153, 211, 67, 93, 96, 57, 96, 64, 93, 207,
+ 19, 251, 165, 234, 45, 159, 198, 153, 211, 67, 93, 118, 57, 118, 64, 93,
+ 251, 165, 234, 45, 159, 118, 64, 93, 207, 19, 198, 153, 211, 66, 96, 64,
+ 93, 207, 19, 198, 153, 211, 66, 235, 119, 197, 240, 191, 21, 57, 203, 40,
+ 202, 99, 186, 57, 203, 40, 249, 143, 202, 2, 57, 63, 216, 213, 201, 102,
+ 62, 2, 201, 102, 63, 2, 201, 102, 62, 206, 203, 210, 24, 63, 206, 203,
+ 210, 24, 88, 220, 13, 243, 10, 88, 211, 8, 4, 211, 8, 223, 117, 88, 243,
+ 11, 4, 243, 11, 223, 117, 88, 243, 10, 88, 47, 205, 154, 202, 99, 186,
+ 64, 4, 228, 250, 229, 235, 249, 143, 202, 2, 64, 4, 228, 250, 199, 215,
+ 202, 99, 186, 64, 4, 228, 241, 199, 215, 249, 143, 202, 2, 64, 4, 228,
+ 241, 199, 215, 248, 224, 64, 209, 58, 235, 119, 199, 25, 186, 234, 203,
+ 203, 40, 248, 224, 64, 209, 58, 235, 119, 199, 25, 186, 234, 203, 118,
+ 197, 240, 57, 196, 66, 197, 240, 57, 96, 197, 240, 57, 235, 119, 197,
+ 240, 57, 45, 50, 197, 240, 57, 133, 144, 197, 240, 57, 186, 193, 105,
+ 197, 240, 57, 186, 234, 204, 197, 240, 57, 202, 2, 234, 204, 197, 240,
+ 57, 202, 2, 193, 105, 197, 240, 57, 118, 197, 240, 237, 214, 57, 196, 66,
+ 197, 240, 237, 214, 57, 96, 197, 240, 237, 214, 57, 235, 119, 197, 240,
+ 237, 214, 57, 242, 221, 197, 240, 211, 77, 243, 11, 57, 251, 85, 197,
+ 240, 211, 77, 243, 11, 57, 118, 197, 240, 64, 119, 164, 196, 66, 197,
+ 240, 64, 119, 164, 96, 197, 240, 64, 119, 164, 235, 119, 197, 240, 64,
+ 119, 164, 186, 193, 105, 197, 240, 64, 119, 164, 186, 234, 204, 197, 240,
+ 64, 119, 164, 202, 2, 234, 204, 197, 240, 64, 119, 164, 202, 2, 193, 105,
+ 197, 240, 64, 119, 164, 118, 197, 240, 64, 4, 55, 228, 241, 106, 196, 66,
+ 197, 240, 64, 4, 55, 228, 241, 106, 96, 197, 240, 64, 4, 55, 228, 241,
+ 106, 235, 119, 197, 240, 64, 4, 55, 228, 241, 106, 228, 241, 199, 237,
+ 221, 222, 81, 199, 237, 221, 222, 118, 197, 240, 64, 139, 96, 197, 240,
+ 57, 196, 66, 197, 240, 64, 118, 79, 235, 119, 197, 240, 57, 96, 197, 240,
+ 64, 139, 118, 197, 240, 57, 235, 119, 197, 240, 64, 118, 79, 196, 66,
+ 197, 240, 57, 118, 197, 240, 210, 196, 250, 231, 196, 66, 197, 240, 210,
+ 196, 250, 231, 96, 197, 240, 210, 196, 250, 231, 235, 119, 197, 240, 210,
+ 196, 250, 231, 118, 62, 47, 63, 57, 196, 66, 62, 47, 63, 57, 96, 62, 47,
+ 63, 57, 235, 119, 62, 47, 63, 57, 251, 85, 197, 240, 50, 196, 221, 57,
+ 251, 85, 197, 240, 248, 77, 196, 221, 57, 251, 85, 197, 240, 45, 196,
+ 221, 57, 251, 85, 197, 240, 198, 54, 196, 221, 57, 207, 23, 219, 224,
+ 207, 23, 183, 214, 77, 219, 224, 214, 77, 183, 232, 128, 239, 2, 250,
+ 232, 243, 6, 251, 84, 96, 62, 57, 16, 40, 196, 255, 42, 234, 133, 198,
+ 225, 198, 52, 118, 234, 37, 250, 235, 198, 225, 206, 204, 196, 66, 234,
+ 37, 250, 235, 198, 225, 198, 52, 96, 234, 37, 250, 235, 198, 225, 219,
+ 220, 235, 119, 234, 37, 250, 235, 62, 118, 234, 37, 250, 235, 62, 196,
+ 66, 234, 37, 250, 235, 62, 96, 234, 37, 250, 235, 62, 235, 119, 234, 37,
+ 250, 235, 235, 119, 197, 240, 64, 4, 179, 198, 136, 219, 214, 235, 119,
+ 197, 240, 64, 4, 179, 198, 136, 206, 197, 196, 66, 197, 240, 64, 4, 179,
+ 198, 136, 219, 214, 196, 66, 197, 240, 64, 4, 179, 198, 136, 206, 197,
+ 118, 197, 240, 64, 4, 179, 198, 136, 196, 65, 96, 197, 240, 64, 4, 179,
+ 198, 136, 196, 65, 118, 197, 240, 64, 4, 179, 198, 136, 235, 118, 96,
+ 197, 240, 64, 4, 179, 198, 136, 235, 118, 62, 238, 163, 235, 119, 23,
+ 118, 57, 62, 238, 163, 235, 119, 23, 96, 57, 62, 238, 163, 196, 66, 23,
+ 118, 57, 62, 238, 163, 196, 66, 23, 96, 57, 62, 238, 163, 118, 23, 196,
+ 66, 57, 62, 238, 163, 96, 23, 196, 66, 57, 62, 238, 163, 118, 23, 235,
+ 119, 57, 62, 238, 163, 96, 23, 235, 119, 57, 206, 248, 64, 144, 219, 224,
+ 206, 248, 64, 144, 183, 206, 248, 64, 133, 219, 224, 206, 248, 64, 133,
+ 183, 206, 248, 64, 45, 196, 77, 206, 248, 64, 50, 196, 77, 206, 248, 64,
+ 45, 235, 123, 206, 248, 64, 50, 235, 123, 196, 66, 63, 64, 232, 98, 249,
+ 88, 4, 228, 241, 164, 133, 250, 236, 223, 163, 42, 207, 93, 248, 62, 211,
+ 1, 63, 201, 188, 211, 1, 63, 23, 62, 201, 188, 211, 1, 62, 201, 188, 249,
+ 107, 111, 4, 156, 192, 235, 47, 192, 235, 47, 28, 192, 235, 62, 51, 247,
+ 19, 62, 237, 33, 247, 19, 153, 62, 210, 24, 228, 241, 62, 211, 160, 62,
+ 211, 160, 62, 216, 213, 196, 76, 197, 242, 247, 19, 62, 216, 213, 235,
+ 122, 197, 242, 247, 19, 62, 216, 213, 219, 219, 197, 242, 247, 19, 62,
+ 216, 213, 206, 203, 197, 242, 247, 19, 214, 95, 232, 146, 109, 198, 54,
+ 132, 62, 243, 10, 248, 77, 132, 62, 243, 10, 156, 232, 128, 209, 60, 62,
+ 238, 159, 206, 122, 156, 232, 128, 209, 60, 62, 238, 159, 63, 232, 128,
+ 209, 60, 238, 159, 206, 122, 63, 232, 128, 209, 60, 238, 159, 51, 209,
+ 25, 223, 144, 196, 107, 56, 230, 187, 77, 209, 78, 232, 146, 109, 209,
+ 78, 232, 146, 138, 209, 78, 232, 146, 134, 209, 78, 232, 146, 149, 198,
+ 9, 208, 185, 250, 189, 228, 91, 209, 196, 214, 91, 63, 215, 206, 204, 33,
+ 62, 237, 33, 211, 105, 238, 217, 197, 202, 156, 215, 206, 250, 227, 238,
+ 179, 230, 88, 191, 75, 221, 2, 251, 53, 252, 32, 193, 247, 209, 26, 45,
+ 132, 62, 201, 102, 50, 132, 62, 201, 102, 201, 103, 4, 45, 132, 248, 139,
+ 201, 103, 4, 50, 132, 248, 139, 118, 197, 13, 64, 4, 197, 242, 250, 233,
+ 196, 66, 197, 13, 64, 4, 197, 242, 250, 233, 96, 197, 13, 64, 4, 197,
+ 242, 250, 233, 235, 119, 197, 13, 64, 4, 197, 242, 250, 233, 234, 27,
+ 232, 146, 107, 234, 27, 232, 146, 109, 205, 51, 206, 31, 250, 188, 16,
+ 195, 52, 206, 31, 250, 188, 16, 212, 254, 206, 31, 250, 188, 16, 208, 1,
+ 206, 31, 250, 188, 16, 248, 163, 206, 31, 250, 188, 16, 204, 16, 206, 31,
+ 250, 188, 16, 198, 0, 234, 43, 3, 4, 223, 140, 60, 196, 89, 113, 204, 12,
+ 113, 235, 128, 113, 210, 96, 113, 207, 18, 50, 251, 115, 229, 203, 210,
+ 78, 113, 135, 6, 1, 250, 122, 135, 6, 1, 247, 252, 135, 6, 1, 195, 151,
+ 135, 6, 1, 231, 18, 135, 6, 1, 236, 169, 135, 6, 1, 192, 49, 135, 6, 1,
+ 191, 55, 135, 6, 1, 235, 30, 135, 6, 1, 191, 82, 135, 6, 1, 223, 39, 135,
+ 6, 1, 89, 223, 39, 135, 6, 1, 68, 135, 6, 1, 236, 190, 135, 6, 1, 222,
+ 94, 135, 6, 1, 219, 75, 135, 6, 1, 215, 66, 135, 6, 1, 214, 210, 135, 6,
+ 1, 211, 89, 135, 6, 1, 209, 55, 135, 6, 1, 206, 179, 135, 6, 1, 202, 77,
+ 135, 6, 1, 197, 44, 135, 6, 1, 196, 124, 135, 6, 1, 232, 101, 135, 6, 1,
+ 229, 188, 135, 6, 1, 211, 20, 135, 6, 1, 210, 63, 135, 6, 1, 203, 8, 135,
+ 6, 1, 197, 146, 135, 6, 1, 243, 54, 135, 6, 1, 203, 165, 135, 6, 1, 192,
+ 58, 135, 6, 1, 192, 60, 135, 6, 1, 192, 93, 135, 6, 1, 201, 220, 140,
+ 135, 6, 1, 191, 225, 135, 6, 1, 2, 191, 190, 135, 6, 1, 2, 191, 191, 4,
+ 199, 215, 135, 6, 1, 192, 12, 135, 6, 1, 223, 82, 2, 191, 190, 135, 6, 1,
+ 248, 175, 191, 190, 135, 6, 1, 223, 82, 248, 175, 191, 190, 135, 6, 1,
+ 232, 228, 135, 6, 1, 223, 37, 135, 6, 1, 203, 7, 135, 6, 1, 197, 215, 65,
+ 135, 6, 1, 220, 1, 215, 66, 135, 6, 1, 247, 73, 243, 54, 135, 2, 1, 250,
+ 122, 135, 2, 1, 247, 252, 135, 2, 1, 195, 151, 135, 2, 1, 231, 18, 135,
+ 2, 1, 236, 169, 135, 2, 1, 192, 49, 135, 2, 1, 191, 55, 135, 2, 1, 235,
+ 30, 135, 2, 1, 191, 82, 135, 2, 1, 223, 39, 135, 2, 1, 89, 223, 39, 135,
+ 2, 1, 68, 135, 2, 1, 236, 190, 135, 2, 1, 222, 94, 135, 2, 1, 219, 75,
+ 135, 2, 1, 215, 66, 135, 2, 1, 214, 210, 135, 2, 1, 211, 89, 135, 2, 1,
+ 209, 55, 135, 2, 1, 206, 179, 135, 2, 1, 202, 77, 135, 2, 1, 197, 44,
+ 135, 2, 1, 196, 124, 135, 2, 1, 232, 101, 135, 2, 1, 229, 188, 135, 2, 1,
+ 211, 20, 135, 2, 1, 210, 63, 135, 2, 1, 203, 8, 135, 2, 1, 197, 146, 135,
+ 2, 1, 243, 54, 135, 2, 1, 203, 165, 135, 2, 1, 192, 58, 135, 2, 1, 192,
+ 60, 135, 2, 1, 192, 93, 135, 2, 1, 201, 220, 140, 135, 2, 1, 191, 225,
+ 135, 2, 1, 2, 191, 190, 135, 2, 1, 2, 191, 191, 4, 199, 215, 135, 2, 1,
+ 192, 12, 135, 2, 1, 223, 82, 2, 191, 190, 135, 2, 1, 248, 175, 191, 190,
+ 135, 2, 1, 223, 82, 248, 175, 191, 190, 135, 2, 1, 232, 228, 135, 2, 1,
+ 223, 37, 135, 2, 1, 203, 7, 135, 2, 1, 197, 215, 65, 135, 2, 1, 220, 1,
+ 215, 66, 135, 2, 1, 247, 73, 243, 54, 8, 6, 1, 220, 143, 4, 55, 164, 8,
+ 2, 1, 220, 143, 4, 55, 164, 8, 6, 1, 220, 143, 4, 82, 198, 152, 8, 6, 1,
+ 210, 237, 4, 106, 8, 6, 1, 207, 222, 4, 199, 215, 8, 2, 1, 42, 4, 106, 8,
+ 2, 1, 200, 44, 4, 237, 39, 106, 8, 6, 1, 230, 117, 4, 237, 87, 8, 2, 1,
+ 230, 117, 4, 237, 87, 8, 6, 1, 222, 153, 4, 237, 87, 8, 2, 1, 222, 153,
+ 4, 237, 87, 8, 6, 1, 191, 167, 4, 237, 87, 8, 2, 1, 191, 167, 4, 237, 87,
+ 8, 6, 1, 251, 160, 8, 6, 1, 218, 169, 4, 102, 8, 6, 1, 153, 65, 8, 6, 1,
+ 153, 251, 160, 8, 2, 1, 196, 13, 4, 50, 102, 8, 6, 1, 193, 225, 4, 102,
+ 8, 2, 1, 193, 225, 4, 102, 8, 2, 1, 196, 13, 4, 238, 175, 8, 6, 1, 132,
+ 230, 116, 8, 2, 1, 132, 230, 116, 8, 2, 1, 199, 213, 209, 211, 8, 2, 1,
+ 235, 15, 4, 213, 9, 8, 2, 1, 153, 207, 222, 4, 199, 215, 8, 2, 1, 187, 4,
+ 130, 206, 189, 223, 117, 8, 1, 2, 6, 153, 71, 8, 200, 230, 2, 1, 223, 35,
+ 52, 1, 6, 196, 12, 8, 6, 1, 206, 9, 4, 200, 146, 199, 215, 8, 6, 1, 191,
+ 167, 4, 200, 146, 199, 215, 94, 6, 1, 251, 186, 94, 2, 1, 251, 186, 94,
+ 6, 1, 195, 66, 94, 2, 1, 195, 66, 94, 6, 1, 231, 211, 94, 2, 1, 231, 211,
+ 94, 6, 1, 237, 255, 94, 2, 1, 237, 255, 94, 6, 1, 234, 165, 94, 2, 1,
+ 234, 165, 94, 6, 1, 202, 7, 94, 2, 1, 202, 7, 94, 6, 1, 191, 95, 94, 2,
+ 1, 191, 95, 94, 6, 1, 230, 6, 94, 2, 1, 230, 6, 94, 6, 1, 199, 13, 94, 2,
+ 1, 199, 13, 94, 6, 1, 228, 32, 94, 2, 1, 228, 32, 94, 6, 1, 222, 77, 94,
+ 2, 1, 222, 77, 94, 6, 1, 219, 252, 94, 2, 1, 219, 252, 94, 6, 1, 216,
+ 100, 94, 2, 1, 216, 100, 94, 6, 1, 213, 219, 94, 2, 1, 213, 219, 94, 6,
+ 1, 220, 248, 94, 2, 1, 220, 248, 94, 6, 1, 74, 94, 2, 1, 74, 94, 6, 1,
+ 209, 185, 94, 2, 1, 209, 185, 94, 6, 1, 206, 162, 94, 2, 1, 206, 162, 94,
+ 6, 1, 202, 183, 94, 2, 1, 202, 183, 94, 6, 1, 199, 166, 94, 2, 1, 199,
+ 166, 94, 6, 1, 196, 168, 94, 2, 1, 196, 168, 94, 6, 1, 233, 23, 94, 2, 1,
+ 233, 23, 94, 6, 1, 221, 190, 94, 2, 1, 221, 190, 94, 6, 1, 208, 176, 94,
+ 2, 1, 208, 176, 94, 6, 1, 211, 81, 94, 2, 1, 211, 81, 94, 6, 1, 237, 37,
+ 251, 192, 94, 2, 1, 237, 37, 251, 192, 94, 6, 1, 39, 94, 251, 230, 94, 2,
+ 1, 39, 94, 251, 230, 94, 6, 1, 238, 198, 234, 165, 94, 2, 1, 238, 198,
+ 234, 165, 94, 6, 1, 237, 37, 222, 77, 94, 2, 1, 237, 37, 222, 77, 94, 6,
+ 1, 237, 37, 213, 219, 94, 2, 1, 237, 37, 213, 219, 94, 6, 1, 238, 198,
+ 213, 219, 94, 2, 1, 238, 198, 213, 219, 94, 6, 1, 39, 94, 211, 81, 94, 2,
+ 1, 39, 94, 211, 81, 94, 6, 1, 205, 145, 94, 2, 1, 205, 145, 94, 6, 1,
+ 238, 214, 203, 105, 94, 2, 1, 238, 214, 203, 105, 94, 6, 1, 39, 94, 203,
+ 105, 94, 2, 1, 39, 94, 203, 105, 94, 6, 1, 39, 94, 234, 12, 94, 2, 1, 39,
+ 94, 234, 12, 94, 6, 1, 251, 212, 221, 195, 94, 2, 1, 251, 212, 221, 195,
+ 94, 6, 1, 237, 37, 228, 242, 94, 2, 1, 237, 37, 228, 242, 94, 6, 1, 39,
+ 94, 228, 242, 94, 2, 1, 39, 94, 228, 242, 94, 6, 1, 39, 94, 140, 94, 2,
+ 1, 39, 94, 140, 94, 6, 1, 220, 142, 140, 94, 2, 1, 220, 142, 140, 94, 6,
+ 1, 39, 94, 229, 209, 94, 2, 1, 39, 94, 229, 209, 94, 6, 1, 39, 94, 230,
+ 9, 94, 2, 1, 39, 94, 230, 9, 94, 6, 1, 39, 94, 231, 206, 94, 2, 1, 39,
+ 94, 231, 206, 94, 6, 1, 39, 94, 236, 193, 94, 2, 1, 39, 94, 236, 193, 94,
+ 6, 1, 39, 94, 203, 71, 94, 2, 1, 39, 94, 203, 71, 94, 6, 1, 39, 212, 145,
+ 203, 71, 94, 2, 1, 39, 212, 145, 203, 71, 94, 6, 1, 39, 212, 145, 214,
+ 16, 94, 2, 1, 39, 212, 145, 214, 16, 94, 6, 1, 39, 212, 145, 212, 81, 94,
+ 2, 1, 39, 212, 145, 212, 81, 94, 6, 1, 39, 212, 145, 193, 140, 94, 2, 1,
+ 39, 212, 145, 193, 140, 94, 16, 222, 102, 94, 16, 216, 101, 206, 162, 94,
+ 16, 209, 186, 206, 162, 94, 16, 201, 89, 94, 16, 199, 167, 206, 162, 94,
+ 16, 221, 191, 206, 162, 94, 16, 203, 72, 202, 183, 94, 6, 1, 238, 198,
+ 203, 105, 94, 2, 1, 238, 198, 203, 105, 94, 6, 1, 238, 198, 231, 206, 94,
+ 2, 1, 238, 198, 231, 206, 94, 33, 213, 220, 58, 94, 33, 201, 213, 250,
+ 201, 94, 33, 201, 213, 219, 188, 94, 6, 1, 248, 103, 221, 195, 94, 2, 1,
+ 248, 103, 221, 195, 94, 39, 212, 145, 232, 80, 201, 63, 94, 39, 212, 145,
+ 236, 234, 208, 13, 77, 94, 39, 212, 145, 223, 142, 208, 13, 77, 94, 39,
+ 212, 145, 195, 137, 236, 205, 94, 232, 118, 91, 230, 70, 94, 232, 80,
+ 201, 63, 94, 215, 200, 236, 205, 101, 2, 1, 251, 132, 101, 2, 1, 249,
+ 101, 101, 2, 1, 231, 210, 101, 2, 1, 236, 150, 101, 2, 1, 234, 103, 101,
+ 2, 1, 195, 49, 101, 2, 1, 191, 80, 101, 2, 1, 199, 193, 101, 2, 1, 223,
+ 162, 101, 2, 1, 222, 87, 101, 2, 1, 220, 7, 101, 2, 1, 217, 90, 101, 2,
+ 1, 214, 216, 101, 2, 1, 211, 104, 101, 2, 1, 210, 131, 101, 2, 1, 191,
+ 67, 101, 2, 1, 207, 163, 101, 2, 1, 205, 142, 101, 2, 1, 199, 179, 101,
+ 2, 1, 196, 113, 101, 2, 1, 209, 220, 101, 2, 1, 221, 200, 101, 2, 1, 231,
+ 82, 101, 2, 1, 208, 81, 101, 2, 1, 203, 69, 101, 2, 1, 243, 81, 101, 2,
+ 1, 247, 128, 101, 2, 1, 222, 234, 101, 2, 1, 243, 18, 101, 2, 1, 246,
+ 241, 101, 2, 1, 192, 218, 101, 2, 1, 222, 249, 101, 2, 1, 230, 87, 101,
+ 2, 1, 229, 245, 101, 2, 1, 229, 145, 101, 2, 1, 193, 125, 101, 2, 1, 230,
+ 19, 101, 2, 1, 229, 11, 101, 2, 1, 192, 14, 101, 2, 1, 252, 14, 198, 175,
+ 1, 170, 198, 175, 1, 192, 136, 198, 175, 1, 192, 135, 198, 175, 1, 192,
+ 125, 198, 175, 1, 192, 123, 198, 175, 1, 248, 218, 252, 62, 192, 118,
+ 198, 175, 1, 192, 118, 198, 175, 1, 192, 133, 198, 175, 1, 192, 130, 198,
+ 175, 1, 192, 132, 198, 175, 1, 192, 131, 198, 175, 1, 192, 40, 198, 175,
+ 1, 192, 127, 198, 175, 1, 192, 116, 198, 175, 1, 197, 86, 192, 116, 198,
+ 175, 1, 192, 113, 198, 175, 1, 192, 121, 198, 175, 1, 248, 218, 252, 62,
+ 192, 121, 198, 175, 1, 197, 86, 192, 121, 198, 175, 1, 192, 120, 198,
+ 175, 1, 192, 140, 198, 175, 1, 192, 114, 198, 175, 1, 197, 86, 192, 114,
+ 198, 175, 1, 192, 103, 198, 175, 1, 197, 86, 192, 103, 198, 175, 1, 192,
+ 33, 198, 175, 1, 192, 82, 198, 175, 1, 251, 243, 192, 82, 198, 175, 1,
+ 197, 86, 192, 82, 198, 175, 1, 192, 112, 198, 175, 1, 192, 111, 198, 175,
+ 1, 192, 108, 198, 175, 1, 197, 86, 192, 122, 198, 175, 1, 197, 86, 192,
+ 106, 198, 175, 1, 192, 104, 198, 175, 1, 191, 225, 198, 175, 1, 192, 101,
+ 198, 175, 1, 192, 99, 198, 175, 1, 192, 124, 198, 175, 1, 197, 86, 192,
+ 124, 198, 175, 1, 250, 127, 192, 124, 198, 175, 1, 192, 98, 198, 175, 1,
+ 192, 96, 198, 175, 1, 192, 97, 198, 175, 1, 192, 95, 198, 175, 1, 192,
+ 94, 198, 175, 1, 192, 134, 198, 175, 1, 192, 92, 198, 175, 1, 192, 90,
+ 198, 175, 1, 192, 89, 198, 175, 1, 192, 86, 198, 175, 1, 192, 83, 198,
+ 175, 1, 199, 157, 192, 83, 198, 175, 1, 192, 81, 198, 175, 1, 192, 80,
+ 198, 175, 1, 192, 12, 198, 175, 52, 1, 220, 115, 77, 198, 175, 204, 11,
+ 77, 198, 175, 120, 222, 196, 36, 5, 219, 42, 36, 5, 216, 5, 36, 5, 206,
+ 154, 36, 5, 202, 38, 36, 5, 203, 55, 36, 5, 248, 110, 36, 5, 198, 91, 36,
+ 5, 242, 98, 36, 5, 213, 36, 36, 5, 212, 64, 36, 5, 231, 11, 211, 182, 36,
+ 5, 191, 6, 36, 5, 236, 172, 36, 5, 237, 160, 36, 5, 222, 200, 36, 5, 198,
+ 240, 36, 5, 243, 67, 36, 5, 209, 198, 36, 5, 209, 72, 36, 5, 231, 97, 36,
+ 5, 231, 93, 36, 5, 231, 94, 36, 5, 231, 95, 36, 5, 201, 175, 36, 5, 201,
+ 129, 36, 5, 201, 142, 36, 5, 201, 174, 36, 5, 201, 147, 36, 5, 201, 148,
+ 36, 5, 201, 134, 36, 5, 247, 65, 36, 5, 247, 44, 36, 5, 247, 46, 36, 5,
+ 247, 64, 36, 5, 247, 62, 36, 5, 247, 63, 36, 5, 247, 45, 36, 5, 190, 224,
+ 36, 5, 190, 202, 36, 5, 190, 215, 36, 5, 190, 223, 36, 5, 190, 218, 36,
+ 5, 190, 219, 36, 5, 190, 207, 36, 5, 247, 60, 36, 5, 247, 47, 36, 5, 247,
+ 49, 36, 5, 247, 59, 36, 5, 247, 57, 36, 5, 247, 58, 36, 5, 247, 48, 36,
+ 5, 207, 234, 36, 5, 207, 224, 36, 5, 207, 230, 36, 5, 207, 233, 36, 5,
+ 207, 231, 36, 5, 207, 232, 36, 5, 207, 229, 36, 5, 220, 153, 36, 5, 220,
+ 145, 36, 5, 220, 148, 36, 5, 220, 152, 36, 5, 220, 149, 36, 5, 220, 150,
+ 36, 5, 220, 146, 36, 5, 192, 175, 36, 5, 192, 162, 36, 5, 192, 170, 36,
+ 5, 192, 174, 36, 5, 192, 172, 36, 5, 192, 173, 36, 5, 192, 169, 36, 5,
+ 230, 128, 36, 5, 230, 118, 36, 5, 230, 121, 36, 5, 230, 127, 36, 5, 230,
+ 123, 36, 5, 230, 124, 36, 5, 230, 120, 33, 38, 1, 249, 17, 33, 38, 1,
+ 195, 153, 33, 38, 1, 231, 77, 33, 38, 1, 237, 146, 33, 38, 1, 191, 62,
+ 33, 38, 1, 191, 87, 33, 38, 1, 155, 33, 38, 1, 234, 140, 33, 38, 1, 234,
+ 114, 33, 38, 1, 234, 103, 33, 38, 1, 74, 33, 38, 1, 210, 63, 33, 38, 1,
+ 234, 34, 33, 38, 1, 234, 22, 33, 38, 1, 199, 145, 33, 38, 1, 140, 33, 38,
+ 1, 197, 161, 33, 38, 1, 243, 127, 33, 38, 1, 203, 165, 33, 38, 1, 203,
+ 116, 33, 38, 1, 232, 228, 33, 38, 1, 234, 18, 33, 38, 1, 65, 33, 38, 1,
+ 223, 226, 33, 38, 1, 236, 191, 33, 38, 1, 215, 219, 196, 128, 33, 38, 1,
+ 192, 95, 33, 38, 1, 191, 225, 33, 38, 1, 223, 81, 65, 33, 38, 1, 219, 83,
+ 191, 190, 33, 38, 1, 248, 175, 191, 190, 33, 38, 1, 223, 81, 248, 175,
+ 191, 190, 50, 251, 116, 200, 225, 217, 51, 50, 251, 116, 235, 138, 200,
+ 225, 217, 51, 45, 200, 225, 248, 53, 50, 200, 225, 248, 53, 45, 235, 138,
+ 200, 225, 248, 53, 50, 235, 138, 200, 225, 248, 53, 207, 147, 223, 104,
+ 217, 51, 207, 147, 235, 138, 223, 104, 217, 51, 235, 138, 198, 8, 217,
+ 51, 45, 198, 8, 248, 53, 50, 198, 8, 248, 53, 207, 147, 201, 190, 45,
+ 207, 147, 211, 106, 248, 53, 50, 207, 147, 211, 106, 248, 53, 234, 189,
+ 238, 254, 210, 126, 232, 148, 210, 126, 207, 18, 232, 148, 210, 126, 228,
+ 85, 235, 138, 211, 177, 235, 119, 251, 126, 196, 66, 251, 126, 235, 138,
+ 206, 203, 251, 115, 55, 211, 172, 228, 88, 223, 93, 223, 102, 210, 183,
+ 248, 47, 228, 89, 4, 237, 42, 198, 153, 4, 206, 189, 58, 45, 130, 210,
+ 116, 248, 53, 50, 130, 210, 116, 248, 53, 198, 153, 4, 75, 58, 198, 153,
+ 4, 75, 60, 45, 81, 249, 88, 4, 208, 7, 50, 81, 249, 88, 4, 208, 7, 198,
+ 54, 45, 132, 248, 53, 198, 54, 50, 132, 248, 53, 248, 77, 45, 132, 248,
+ 53, 248, 77, 50, 132, 248, 53, 45, 202, 206, 126, 248, 53, 50, 202, 206,
+ 126, 248, 53, 45, 55, 210, 113, 50, 55, 210, 113, 105, 185, 139, 91, 75,
+ 208, 151, 91, 75, 139, 105, 185, 208, 151, 112, 232, 128, 75, 208, 151,
+ 232, 226, 75, 77, 207, 18, 208, 13, 77, 81, 198, 152, 206, 189, 209, 61,
+ 193, 23, 204, 11, 82, 236, 140, 153, 242, 74, 207, 147, 236, 140, 207,
+ 147, 242, 74, 153, 204, 25, 238, 15, 4, 45, 230, 173, 238, 15, 4, 50,
+ 230, 173, 153, 238, 14, 198, 54, 132, 205, 54, 56, 197, 14, 237, 215,
+ 198, 223, 237, 215, 201, 79, 232, 80, 201, 63, 81, 202, 136, 236, 138,
+ 193, 72, 81, 219, 112, 247, 109, 55, 228, 88, 207, 18, 242, 74, 55, 218,
+ 237, 207, 252, 77, 237, 216, 4, 45, 196, 69, 55, 200, 164, 77, 223, 93,
+ 130, 222, 35, 223, 93, 130, 222, 36, 4, 222, 36, 58, 130, 222, 35, 130,
+ 222, 36, 4, 236, 140, 55, 201, 114, 242, 74, 235, 138, 202, 23, 197, 225,
+ 238, 14, 216, 214, 242, 74, 210, 125, 77, 208, 150, 234, 129, 77, 238,
+ 255, 195, 137, 236, 205, 238, 218, 210, 82, 4, 50, 238, 216, 238, 218,
+ 210, 82, 4, 45, 238, 216, 198, 128, 3, 6, 233, 255, 216, 214, 233, 216,
+ 77, 216, 214, 208, 13, 77, 45, 51, 248, 54, 4, 106, 50, 51, 248, 54, 4,
+ 106, 45, 51, 248, 54, 4, 55, 106, 50, 51, 248, 54, 4, 55, 106, 198, 54,
+ 132, 45, 210, 113, 198, 54, 132, 50, 210, 113, 248, 77, 132, 45, 210,
+ 113, 248, 77, 132, 50, 210, 113, 211, 172, 228, 88, 12, 48, 207, 48, 12,
+ 48, 242, 230, 12, 48, 205, 57, 107, 12, 48, 205, 57, 109, 12, 48, 205,
+ 57, 138, 12, 48, 209, 250, 12, 48, 248, 62, 12, 48, 199, 233, 12, 48,
+ 221, 79, 107, 12, 48, 221, 79, 109, 12, 48, 236, 202, 12, 48, 205, 61,
+ 12, 48, 2, 107, 12, 48, 2, 109, 12, 48, 220, 30, 107, 12, 48, 220, 30,
+ 109, 12, 48, 220, 30, 138, 12, 48, 220, 30, 134, 12, 48, 202, 58, 12, 48,
+ 198, 227, 12, 48, 202, 55, 107, 12, 48, 202, 55, 109, 12, 48, 229, 224,
+ 107, 12, 48, 229, 224, 109, 12, 48, 230, 53, 12, 48, 207, 136, 12, 48,
+ 243, 64, 12, 48, 200, 198, 12, 48, 215, 205, 12, 48, 237, 143, 12, 48,
+ 215, 193, 12, 48, 242, 249, 12, 48, 193, 144, 107, 12, 48, 193, 144, 109,
+ 12, 48, 232, 243, 12, 48, 210, 76, 107, 12, 48, 210, 76, 109, 12, 48,
+ 202, 178, 132, 197, 255, 197, 177, 12, 48, 238, 239, 12, 48, 236, 162,
+ 12, 48, 223, 27, 12, 48, 248, 102, 79, 242, 213, 12, 48, 233, 193, 12,
+ 48, 201, 215, 107, 12, 48, 201, 215, 109, 12, 48, 249, 103, 12, 48, 202,
+ 185, 12, 48, 247, 190, 202, 185, 12, 48, 214, 86, 107, 12, 48, 214, 86,
+ 109, 12, 48, 214, 86, 138, 12, 48, 214, 86, 134, 12, 48, 216, 172, 12,
+ 48, 203, 107, 12, 48, 207, 142, 12, 48, 233, 223, 12, 48, 211, 119, 12,
+ 48, 248, 18, 107, 12, 48, 248, 18, 109, 12, 48, 216, 224, 12, 48, 215,
+ 199, 12, 48, 230, 214, 107, 12, 48, 230, 214, 109, 12, 48, 230, 214, 138,
+ 12, 48, 198, 173, 12, 48, 242, 212, 12, 48, 193, 105, 107, 12, 48, 193,
+ 105, 109, 12, 48, 247, 190, 205, 50, 12, 48, 202, 178, 228, 187, 12, 48,
+ 228, 187, 12, 48, 247, 190, 201, 229, 12, 48, 247, 190, 203, 102, 12, 48,
+ 232, 159, 12, 48, 247, 190, 247, 85, 12, 48, 202, 178, 193, 169, 12, 48,
+ 193, 170, 107, 12, 48, 193, 170, 109, 12, 48, 242, 252, 12, 48, 247, 190,
+ 230, 250, 12, 48, 179, 107, 12, 48, 179, 109, 12, 48, 247, 190, 219, 19,
+ 12, 48, 247, 190, 231, 191, 12, 48, 215, 188, 107, 12, 48, 215, 188, 109,
+ 12, 48, 207, 149, 12, 48, 248, 114, 12, 48, 247, 190, 199, 185, 219, 230,
+ 12, 48, 247, 190, 219, 233, 12, 48, 247, 190, 193, 66, 12, 48, 247, 190,
+ 232, 179, 12, 48, 234, 201, 107, 12, 48, 234, 201, 109, 12, 48, 234, 201,
+ 138, 12, 48, 247, 190, 234, 200, 12, 48, 229, 235, 12, 48, 247, 190, 228,
+ 183, 12, 48, 248, 98, 12, 48, 231, 61, 12, 48, 247, 190, 232, 236, 12,
+ 48, 247, 190, 248, 160, 12, 48, 247, 190, 205, 158, 12, 48, 202, 178,
+ 193, 95, 12, 48, 202, 178, 192, 72, 12, 48, 247, 190, 232, 99, 12, 48,
+ 223, 34, 233, 228, 12, 48, 247, 190, 233, 228, 12, 48, 223, 34, 198, 56,
+ 12, 48, 247, 190, 198, 56, 12, 48, 223, 34, 235, 111, 12, 48, 247, 190,
+ 235, 111, 12, 48, 197, 55, 12, 48, 223, 34, 197, 55, 12, 48, 247, 190,
+ 197, 55, 83, 48, 107, 83, 48, 219, 112, 83, 48, 236, 140, 83, 48, 202,
+ 97, 83, 48, 205, 56, 83, 48, 102, 83, 48, 109, 83, 48, 219, 141, 83, 48,
+ 217, 90, 83, 48, 219, 209, 83, 48, 234, 77, 83, 48, 171, 83, 48, 144,
+ 248, 62, 83, 48, 238, 242, 83, 48, 228, 26, 83, 48, 199, 233, 83, 48,
+ 211, 77, 248, 62, 83, 48, 221, 78, 83, 48, 208, 254, 83, 48, 193, 12, 83,
+ 48, 201, 203, 83, 48, 50, 211, 77, 248, 62, 83, 48, 229, 146, 234, 98,
+ 83, 48, 199, 95, 83, 48, 236, 202, 83, 48, 205, 61, 83, 48, 242, 230, 83,
+ 48, 208, 204, 83, 48, 251, 252, 83, 48, 215, 179, 83, 48, 234, 98, 83,
+ 48, 234, 207, 83, 48, 205, 91, 83, 48, 231, 3, 83, 48, 231, 4, 202, 74,
+ 83, 48, 233, 227, 83, 48, 248, 174, 83, 48, 193, 35, 83, 48, 243, 86, 83,
+ 48, 206, 133, 83, 48, 223, 158, 83, 48, 202, 70, 83, 48, 220, 29, 83, 48,
+ 238, 252, 83, 48, 201, 194, 83, 48, 215, 184, 83, 48, 206, 176, 83, 48,
+ 193, 20, 83, 48, 211, 95, 83, 48, 197, 63, 83, 48, 235, 91, 83, 48, 203,
+ 40, 198, 227, 83, 48, 235, 138, 242, 230, 83, 48, 179, 201, 34, 83, 48,
+ 105, 230, 28, 83, 48, 203, 46, 83, 48, 248, 69, 83, 48, 202, 54, 83, 48,
+ 248, 25, 83, 48, 201, 78, 83, 48, 229, 223, 83, 48, 230, 71, 83, 48, 236,
+ 144, 83, 48, 230, 53, 83, 48, 248, 47, 83, 48, 207, 136, 83, 48, 205, 74,
+ 83, 48, 236, 236, 83, 48, 250, 132, 83, 48, 201, 190, 83, 48, 213, 11,
+ 83, 48, 200, 198, 83, 48, 205, 103, 83, 48, 215, 205, 83, 48, 197, 254,
+ 83, 48, 220, 111, 83, 48, 201, 63, 83, 48, 237, 143, 83, 48, 193, 120,
+ 83, 48, 236, 175, 213, 11, 83, 48, 242, 70, 83, 48, 232, 72, 83, 48, 242,
+ 243, 83, 48, 201, 84, 83, 48, 193, 143, 83, 48, 232, 243, 83, 48, 242,
+ 239, 83, 48, 233, 66, 83, 48, 55, 192, 235, 83, 48, 132, 197, 255, 197,
+ 177, 83, 48, 202, 88, 83, 48, 233, 78, 83, 48, 238, 239, 83, 48, 236,
+ 162, 83, 48, 208, 199, 83, 48, 223, 27, 83, 48, 216, 196, 83, 48, 198,
+ 151, 83, 48, 200, 141, 83, 48, 219, 135, 83, 48, 196, 43, 83, 48, 233,
+ 21, 83, 48, 248, 102, 79, 242, 213, 83, 48, 202, 212, 83, 48, 235, 138,
+ 199, 87, 83, 48, 193, 89, 83, 48, 202, 107, 83, 48, 236, 222, 83, 48,
+ 233, 193, 83, 48, 201, 232, 83, 48, 57, 83, 48, 201, 65, 83, 48, 201,
+ 214, 83, 48, 198, 25, 83, 48, 230, 223, 83, 48, 247, 70, 83, 48, 201,
+ 107, 83, 48, 249, 103, 83, 48, 206, 245, 83, 48, 202, 185, 83, 48, 223,
+ 18, 83, 48, 214, 85, 83, 48, 203, 107, 83, 48, 233, 54, 83, 48, 211, 119,
+ 83, 48, 251, 125, 83, 48, 209, 89, 83, 48, 234, 211, 83, 48, 248, 17, 83,
+ 48, 216, 224, 83, 48, 216, 37, 83, 48, 204, 32, 83, 48, 250, 239, 83, 48,
+ 215, 199, 83, 48, 198, 61, 83, 48, 211, 64, 83, 48, 248, 106, 83, 48,
+ 201, 59, 83, 48, 242, 82, 83, 48, 230, 213, 83, 48, 198, 173, 83, 48,
+ 223, 121, 83, 48, 248, 120, 83, 48, 193, 170, 234, 98, 83, 48, 242, 212,
+ 83, 48, 193, 104, 83, 48, 205, 50, 83, 48, 228, 187, 83, 48, 201, 229,
+ 83, 48, 195, 180, 83, 48, 249, 12, 83, 48, 209, 147, 83, 48, 249, 133,
+ 83, 48, 203, 102, 83, 48, 207, 86, 83, 48, 206, 45, 83, 48, 232, 159, 83,
+ 48, 248, 104, 83, 48, 247, 85, 83, 48, 248, 144, 83, 48, 215, 201, 83,
+ 48, 193, 169, 83, 48, 242, 252, 83, 48, 193, 62, 83, 48, 236, 214, 83,
+ 48, 195, 50, 83, 48, 230, 250, 83, 48, 219, 19, 83, 48, 231, 191, 83, 48,
+ 215, 187, 83, 48, 202, 96, 83, 48, 203, 40, 199, 214, 248, 160, 83, 48,
+ 207, 149, 83, 48, 248, 114, 83, 48, 193, 2, 83, 48, 233, 103, 83, 48,
+ 219, 230, 83, 48, 199, 185, 219, 230, 83, 48, 219, 226, 83, 48, 202, 4,
+ 83, 48, 219, 233, 83, 48, 193, 66, 83, 48, 232, 179, 83, 48, 234, 200,
+ 83, 48, 229, 235, 83, 48, 232, 116, 83, 48, 228, 183, 83, 48, 248, 98,
+ 83, 48, 199, 199, 83, 48, 230, 78, 83, 48, 233, 14, 83, 48, 205, 194,
+ 193, 62, 83, 48, 247, 72, 83, 48, 231, 61, 83, 48, 232, 236, 83, 48, 248,
+ 160, 83, 48, 205, 158, 83, 48, 237, 128, 83, 48, 193, 95, 83, 48, 229,
+ 199, 83, 48, 192, 72, 83, 48, 216, 49, 83, 48, 248, 139, 83, 48, 234,
+ 110, 83, 48, 232, 99, 83, 48, 197, 222, 83, 48, 235, 94, 83, 48, 207,
+ 130, 83, 48, 213, 13, 83, 48, 233, 228, 83, 48, 198, 56, 83, 48, 235,
+ 111, 83, 48, 197, 55, 83, 48, 232, 182, 154, 237, 85, 246, 240, 45, 119,
+ 183, 154, 237, 85, 246, 240, 93, 119, 60, 154, 237, 85, 246, 240, 45,
+ 119, 82, 23, 183, 154, 237, 85, 246, 240, 93, 119, 82, 23, 60, 154, 237,
+ 85, 246, 240, 232, 80, 200, 168, 154, 237, 85, 246, 240, 200, 169, 232,
+ 98, 58, 154, 237, 85, 246, 240, 200, 169, 232, 98, 60, 154, 237, 85, 246,
+ 240, 200, 169, 232, 98, 219, 224, 154, 237, 85, 246, 240, 200, 169, 232,
+ 98, 116, 219, 224, 154, 237, 85, 246, 240, 200, 169, 232, 98, 116, 183,
+ 154, 237, 85, 246, 240, 200, 169, 232, 98, 110, 219, 224, 154, 237, 85,
+ 246, 240, 211, 3, 154, 201, 247, 154, 242, 74, 154, 232, 80, 201, 63,
+ 236, 211, 77, 223, 19, 223, 141, 201, 106, 113, 154, 223, 51, 77, 154,
+ 242, 215, 77, 154, 31, 191, 77, 45, 251, 116, 248, 53, 50, 251, 116, 248,
+ 53, 45, 55, 251, 116, 248, 53, 50, 55, 251, 116, 248, 53, 45, 239, 2,
+ 248, 53, 50, 239, 2, 248, 53, 45, 63, 239, 2, 248, 53, 50, 63, 239, 2,
+ 248, 53, 45, 62, 219, 187, 248, 53, 50, 62, 219, 187, 248, 53, 209, 18,
+ 77, 231, 130, 77, 45, 198, 42, 203, 103, 248, 53, 50, 198, 42, 203, 103,
+ 248, 53, 45, 63, 219, 187, 248, 53, 50, 63, 219, 187, 248, 53, 45, 63,
+ 198, 42, 203, 103, 248, 53, 50, 63, 198, 42, 203, 103, 248, 53, 45, 63,
+ 51, 248, 53, 50, 63, 51, 248, 53, 193, 139, 237, 215, 207, 18, 55, 208,
+ 216, 207, 252, 77, 55, 208, 216, 207, 252, 77, 130, 55, 208, 216, 207,
+ 252, 77, 209, 18, 87, 233, 103, 230, 25, 212, 134, 107, 230, 25, 212,
+ 134, 109, 230, 25, 212, 134, 138, 230, 25, 212, 134, 134, 230, 25, 212,
+ 134, 149, 230, 25, 212, 134, 169, 230, 25, 212, 134, 175, 230, 25, 212,
+ 134, 171, 230, 25, 212, 134, 178, 154, 219, 168, 163, 77, 154, 206, 180,
+ 163, 77, 154, 237, 95, 163, 77, 154, 234, 76, 163, 77, 30, 202, 170, 75,
+ 163, 77, 30, 55, 75, 163, 77, 193, 135, 237, 215, 81, 222, 86, 207, 49,
+ 77, 81, 222, 86, 207, 49, 4, 195, 20, 202, 5, 77, 81, 222, 86, 207, 49,
+ 87, 116, 230, 70, 81, 222, 86, 207, 49, 4, 195, 20, 202, 5, 87, 116, 230,
+ 70, 81, 222, 86, 207, 49, 87, 110, 230, 70, 47, 209, 18, 77, 154, 199,
+ 109, 219, 113, 233, 51, 204, 11, 113, 230, 25, 212, 134, 199, 95, 230,
+ 25, 212, 134, 197, 32, 230, 25, 212, 134, 198, 249, 81, 154, 223, 51, 77,
+ 217, 31, 77, 210, 107, 251, 153, 77, 154, 67, 223, 144, 154, 132, 233, 6,
+ 201, 247, 229, 120, 1, 2, 65, 229, 120, 1, 65, 229, 120, 1, 2, 68, 229,
+ 120, 1, 68, 229, 120, 1, 2, 66, 229, 120, 1, 66, 229, 120, 1, 2, 71, 229,
+ 120, 1, 71, 229, 120, 1, 2, 74, 229, 120, 1, 74, 229, 120, 1, 155, 229,
+ 120, 1, 231, 240, 229, 120, 1, 221, 166, 229, 120, 1, 231, 53, 229, 120,
+ 1, 220, 232, 229, 120, 1, 230, 179, 229, 120, 1, 222, 22, 229, 120, 1,
+ 231, 165, 229, 120, 1, 221, 67, 229, 120, 1, 231, 3, 229, 120, 1, 188,
+ 229, 120, 1, 191, 123, 229, 120, 1, 202, 222, 229, 120, 1, 191, 30, 229,
+ 120, 1, 201, 4, 229, 120, 1, 190, 251, 229, 120, 1, 205, 68, 229, 120, 1,
+ 191, 87, 229, 120, 1, 202, 46, 229, 120, 1, 191, 7, 229, 120, 1, 190,
+ 190, 229, 120, 1, 238, 32, 229, 120, 1, 198, 193, 229, 120, 1, 237, 44,
+ 229, 120, 1, 2, 197, 94, 229, 120, 1, 197, 94, 229, 120, 1, 235, 89, 229,
+ 120, 1, 199, 145, 229, 120, 1, 237, 146, 229, 120, 1, 159, 229, 120, 1,
+ 236, 174, 229, 120, 1, 180, 229, 120, 1, 213, 219, 229, 120, 1, 212, 178,
+ 229, 120, 1, 214, 121, 229, 120, 1, 213, 43, 229, 120, 1, 140, 229, 120,
+ 1, 249, 153, 229, 120, 1, 168, 229, 120, 1, 229, 158, 229, 120, 1, 248,
+ 188, 229, 120, 1, 209, 185, 229, 120, 1, 228, 159, 229, 120, 1, 248, 10,
+ 229, 120, 1, 208, 165, 229, 120, 1, 229, 245, 229, 120, 1, 249, 17, 229,
+ 120, 1, 210, 63, 229, 120, 1, 229, 23, 229, 120, 1, 248, 111, 229, 120,
+ 1, 209, 73, 229, 120, 1, 174, 229, 120, 1, 216, 100, 229, 120, 1, 215,
+ 155, 229, 120, 1, 216, 232, 229, 120, 1, 216, 12, 229, 120, 1, 2, 170,
+ 229, 120, 1, 170, 229, 120, 1, 2, 191, 225, 229, 120, 1, 191, 225, 229,
+ 120, 1, 2, 192, 12, 229, 120, 1, 192, 12, 229, 120, 1, 165, 229, 120, 1,
+ 207, 1, 229, 120, 1, 206, 68, 229, 120, 1, 207, 113, 229, 120, 1, 206,
+ 162, 229, 120, 1, 2, 193, 190, 229, 120, 1, 193, 190, 229, 120, 1, 193,
+ 86, 229, 120, 1, 193, 125, 229, 120, 1, 193, 48, 229, 120, 1, 215, 61,
+ 229, 120, 1, 193, 249, 229, 120, 1, 2, 155, 229, 120, 1, 2, 222, 22, 33,
+ 222, 48, 195, 20, 202, 5, 77, 33, 222, 48, 204, 30, 202, 5, 77, 222, 48,
+ 195, 20, 202, 5, 77, 222, 48, 204, 30, 202, 5, 77, 229, 120, 223, 51, 77,
+ 229, 120, 195, 20, 223, 51, 77, 229, 120, 237, 3, 191, 242, 222, 48, 55,
+ 228, 88, 72, 1, 2, 65, 72, 1, 65, 72, 1, 2, 68, 72, 1, 68, 72, 1, 2, 66,
+ 72, 1, 66, 72, 1, 2, 71, 72, 1, 71, 72, 1, 2, 74, 72, 1, 74, 72, 1, 155,
+ 72, 1, 231, 240, 72, 1, 221, 166, 72, 1, 231, 53, 72, 1, 220, 232, 72, 1,
+ 230, 179, 72, 1, 222, 22, 72, 1, 231, 165, 72, 1, 221, 67, 72, 1, 231, 3,
+ 72, 1, 188, 72, 1, 191, 123, 72, 1, 202, 222, 72, 1, 191, 30, 72, 1, 201,
+ 4, 72, 1, 190, 251, 72, 1, 205, 68, 72, 1, 191, 87, 72, 1, 202, 46, 72,
+ 1, 191, 7, 72, 1, 190, 190, 72, 1, 238, 32, 72, 1, 198, 193, 72, 1, 237,
+ 44, 72, 1, 2, 197, 94, 72, 1, 197, 94, 72, 1, 235, 89, 72, 1, 199, 145,
+ 72, 1, 237, 146, 72, 1, 159, 72, 1, 236, 174, 72, 1, 180, 72, 1, 213,
+ 219, 72, 1, 212, 178, 72, 1, 214, 121, 72, 1, 213, 43, 72, 1, 140, 72, 1,
+ 249, 153, 72, 1, 168, 72, 1, 229, 158, 72, 1, 248, 188, 72, 1, 209, 185,
+ 72, 1, 228, 159, 72, 1, 248, 10, 72, 1, 208, 165, 72, 1, 229, 245, 72, 1,
+ 249, 17, 72, 1, 210, 63, 72, 1, 229, 23, 72, 1, 248, 111, 72, 1, 209, 73,
+ 72, 1, 174, 72, 1, 216, 100, 72, 1, 215, 155, 72, 1, 216, 232, 72, 1,
+ 216, 12, 72, 1, 2, 170, 72, 1, 170, 72, 1, 2, 191, 225, 72, 1, 191, 225,
+ 72, 1, 2, 192, 12, 72, 1, 192, 12, 72, 1, 165, 72, 1, 207, 1, 72, 1, 206,
+ 68, 72, 1, 207, 113, 72, 1, 206, 162, 72, 1, 2, 193, 190, 72, 1, 193,
+ 190, 72, 1, 193, 86, 72, 1, 193, 125, 72, 1, 193, 48, 72, 1, 215, 61, 72,
+ 1, 193, 249, 72, 1, 2, 155, 72, 1, 2, 222, 22, 72, 1, 195, 188, 72, 1,
+ 195, 69, 72, 1, 195, 153, 72, 1, 195, 24, 72, 82, 236, 140, 222, 48, 208,
+ 191, 202, 5, 77, 72, 223, 51, 77, 72, 195, 20, 223, 51, 77, 72, 237, 3,
+ 221, 27, 248, 88, 1, 250, 120, 248, 88, 1, 210, 236, 248, 88, 1, 218,
+ 168, 248, 88, 1, 233, 175, 248, 88, 1, 238, 127, 248, 88, 1, 200, 43,
+ 248, 88, 1, 215, 61, 248, 88, 1, 172, 248, 88, 1, 232, 51, 248, 88, 1,
+ 222, 152, 248, 88, 1, 230, 116, 248, 88, 1, 223, 35, 248, 88, 1, 208,
+ 104, 248, 88, 1, 192, 235, 248, 88, 1, 191, 72, 248, 88, 1, 247, 3, 248,
+ 88, 1, 203, 167, 248, 88, 1, 146, 248, 88, 1, 191, 166, 248, 88, 1, 247,
+ 193, 248, 88, 1, 206, 8, 248, 88, 1, 65, 248, 88, 1, 74, 248, 88, 1, 71,
+ 248, 88, 1, 234, 173, 248, 88, 1, 251, 236, 248, 88, 1, 234, 166, 248,
+ 88, 1, 250, 163, 248, 88, 1, 211, 19, 248, 88, 1, 251, 132, 248, 88, 1,
+ 234, 103, 248, 88, 1, 251, 122, 248, 88, 1, 234, 88, 248, 88, 1, 234, 34,
+ 248, 88, 1, 68, 248, 88, 1, 66, 248, 88, 1, 223, 49, 248, 88, 1, 196, 12,
+ 248, 88, 1, 214, 70, 248, 88, 1, 231, 7, 248, 88, 1, 223, 200, 248, 88,
+ 1, 187, 4, 75, 58, 248, 88, 1, 213, 80, 30, 1, 221, 113, 30, 1, 201, 167,
+ 30, 1, 221, 106, 30, 1, 213, 204, 30, 1, 213, 202, 30, 1, 213, 201, 30,
+ 1, 198, 168, 30, 1, 201, 156, 30, 1, 206, 239, 30, 1, 206, 234, 30, 1,
+ 206, 231, 30, 1, 206, 224, 30, 1, 206, 219, 30, 1, 206, 214, 30, 1, 206,
+ 225, 30, 1, 206, 237, 30, 1, 216, 77, 30, 1, 209, 169, 30, 1, 201, 164,
+ 30, 1, 209, 158, 30, 1, 202, 160, 30, 1, 201, 161, 30, 1, 223, 222, 30,
+ 1, 243, 24, 30, 1, 201, 171, 30, 1, 243, 91, 30, 1, 221, 188, 30, 1, 199,
+ 7, 30, 1, 209, 209, 30, 1, 229, 142, 30, 1, 65, 30, 1, 252, 25, 30, 1,
+ 170, 30, 1, 192, 129, 30, 1, 234, 65, 30, 1, 71, 30, 1, 192, 67, 30, 1,
+ 192, 80, 30, 1, 74, 30, 1, 193, 190, 30, 1, 193, 176, 30, 1, 211, 151,
+ 30, 1, 192, 12, 30, 1, 66, 30, 1, 193, 107, 30, 1, 193, 125, 30, 1, 193,
+ 86, 30, 1, 191, 225, 30, 1, 233, 242, 30, 1, 192, 33, 30, 1, 68, 30, 233,
+ 3, 30, 1, 201, 165, 30, 1, 213, 194, 30, 1, 213, 196, 30, 1, 213, 199,
+ 30, 1, 206, 232, 30, 1, 206, 213, 30, 1, 206, 221, 30, 1, 206, 226, 30,
+ 1, 206, 211, 30, 1, 216, 70, 30, 1, 216, 67, 30, 1, 216, 71, 30, 1, 222,
+ 71, 30, 1, 209, 164, 30, 1, 209, 150, 30, 1, 209, 156, 30, 1, 209, 153,
+ 30, 1, 209, 167, 30, 1, 209, 151, 30, 1, 222, 69, 30, 1, 222, 67, 30, 1,
+ 202, 153, 30, 1, 202, 151, 30, 1, 202, 143, 30, 1, 202, 148, 30, 1, 202,
+ 158, 30, 1, 210, 149, 30, 1, 201, 168, 30, 1, 192, 57, 30, 1, 192, 51,
+ 30, 1, 192, 52, 30, 1, 222, 70, 30, 1, 201, 169, 30, 1, 192, 63, 30, 1,
+ 192, 0, 30, 1, 191, 255, 30, 1, 192, 2, 30, 1, 191, 212, 30, 1, 191, 213,
+ 30, 1, 191, 216, 30, 1, 251, 25, 30, 1, 251, 19, 154, 251, 96, 219, 101,
+ 77, 154, 251, 96, 207, 19, 77, 154, 251, 96, 91, 77, 154, 251, 96, 105,
+ 77, 154, 251, 96, 115, 77, 154, 251, 96, 232, 128, 77, 154, 251, 96, 198,
+ 54, 77, 154, 251, 96, 82, 77, 154, 251, 96, 248, 77, 77, 154, 251, 96,
+ 232, 238, 77, 154, 251, 96, 205, 57, 77, 154, 251, 96, 199, 1, 77, 154,
+ 251, 96, 232, 121, 77, 154, 251, 96, 229, 220, 77, 154, 251, 96, 234,
+ 208, 77, 154, 251, 96, 217, 91, 77, 248, 88, 1, 248, 10, 248, 88, 1, 191,
+ 30, 248, 88, 1, 222, 244, 248, 88, 1, 230, 179, 248, 88, 1, 234, 188,
+ 248, 88, 1, 234, 85, 248, 88, 1, 211, 87, 248, 88, 1, 211, 91, 248, 88,
+ 1, 223, 77, 248, 88, 1, 251, 98, 248, 88, 1, 223, 128, 248, 88, 1, 196,
+ 83, 248, 88, 1, 223, 180, 248, 88, 1, 214, 48, 248, 88, 1, 251, 229, 248,
+ 88, 1, 250, 158, 248, 88, 1, 251, 149, 248, 88, 1, 211, 113, 248, 88, 1,
+ 211, 94, 248, 88, 1, 223, 125, 248, 88, 53, 1, 210, 236, 248, 88, 53, 1,
+ 200, 43, 248, 88, 53, 1, 222, 152, 248, 88, 53, 1, 230, 116, 248, 88, 1,
+ 231, 92, 248, 88, 1, 219, 160, 248, 88, 1, 190, 231, 248, 88, 53, 1, 232,
+ 51, 248, 88, 1, 230, 136, 248, 88, 1, 220, 180, 248, 88, 1, 211, 151,
+ 248, 88, 1, 251, 245, 12, 201, 28, 200, 43, 12, 201, 28, 193, 98, 12,
+ 201, 28, 192, 209, 12, 201, 28, 247, 206, 12, 201, 28, 200, 151, 12, 201,
+ 28, 228, 78, 12, 201, 28, 228, 82, 12, 201, 28, 228, 169, 12, 201, 28,
+ 228, 79, 12, 201, 28, 200, 46, 12, 201, 28, 228, 81, 12, 201, 28, 228,
+ 77, 12, 201, 28, 228, 167, 12, 201, 28, 228, 80, 12, 201, 28, 228, 76,
+ 12, 201, 28, 215, 61, 12, 201, 28, 230, 116, 12, 201, 28, 206, 8, 12,
+ 201, 28, 210, 236, 12, 201, 28, 201, 250, 12, 201, 28, 238, 127, 12, 201,
+ 28, 228, 83, 12, 201, 28, 229, 178, 12, 201, 28, 200, 55, 12, 201, 28,
+ 200, 128, 12, 201, 28, 201, 118, 12, 201, 28, 203, 173, 12, 201, 28, 210,
+ 67, 12, 201, 28, 208, 106, 12, 201, 28, 198, 99, 12, 201, 28, 200, 45,
+ 12, 201, 28, 200, 140, 12, 201, 28, 228, 94, 12, 201, 28, 228, 75, 12,
+ 201, 28, 209, 230, 12, 201, 28, 208, 104, 72, 1, 2, 220, 232, 72, 1, 2,
+ 202, 222, 72, 1, 2, 201, 4, 72, 1, 2, 159, 72, 1, 2, 212, 178, 72, 1, 2,
+ 140, 72, 1, 2, 229, 158, 72, 1, 2, 228, 159, 72, 1, 2, 229, 245, 72, 1,
+ 2, 229, 23, 72, 1, 2, 215, 155, 72, 1, 2, 165, 72, 1, 2, 207, 1, 72, 1,
+ 2, 206, 68, 72, 1, 2, 207, 113, 72, 1, 2, 206, 162, 127, 30, 221, 113,
+ 127, 30, 213, 204, 127, 30, 198, 168, 127, 30, 206, 239, 127, 30, 216,
+ 77, 127, 30, 209, 169, 127, 30, 202, 160, 127, 30, 223, 222, 127, 30,
+ 243, 24, 127, 30, 243, 91, 127, 30, 221, 188, 127, 30, 199, 7, 127, 30,
+ 209, 209, 127, 30, 229, 142, 127, 30, 221, 114, 65, 127, 30, 213, 205,
+ 65, 127, 30, 198, 169, 65, 127, 30, 206, 240, 65, 127, 30, 216, 78, 65,
+ 127, 30, 209, 170, 65, 127, 30, 202, 161, 65, 127, 30, 223, 223, 65, 127,
+ 30, 243, 25, 65, 127, 30, 243, 92, 65, 127, 30, 221, 189, 65, 127, 30,
+ 199, 8, 65, 127, 30, 209, 210, 65, 127, 30, 229, 143, 65, 127, 30, 243,
+ 25, 66, 127, 221, 32, 246, 240, 211, 129, 127, 221, 32, 246, 240, 187,
+ 228, 159, 127, 228, 14, 107, 127, 228, 14, 109, 127, 228, 14, 138, 127,
+ 228, 14, 134, 127, 228, 14, 149, 127, 228, 14, 169, 127, 228, 14, 175,
+ 127, 228, 14, 171, 127, 228, 14, 178, 127, 228, 14, 199, 95, 127, 228,
+ 14, 215, 205, 127, 228, 14, 232, 243, 127, 228, 14, 193, 143, 127, 228,
+ 14, 193, 28, 127, 228, 14, 216, 165, 127, 228, 14, 234, 207, 127, 228,
+ 14, 200, 198, 127, 228, 14, 201, 66, 127, 228, 14, 229, 255, 127, 228,
+ 14, 202, 35, 127, 228, 14, 214, 227, 127, 228, 14, 201, 231, 127, 228,
+ 14, 232, 254, 127, 228, 14, 239, 50, 127, 228, 14, 220, 114, 127, 228,
+ 14, 207, 42, 127, 228, 14, 247, 138, 127, 228, 14, 201, 10, 127, 228, 14,
+ 200, 178, 127, 228, 14, 234, 75, 127, 228, 14, 207, 32, 127, 228, 14,
+ 251, 168, 127, 228, 14, 233, 31, 127, 228, 14, 207, 30, 127, 228, 14,
+ 204, 32, 127, 228, 14, 207, 108, 47, 228, 14, 208, 12, 47, 228, 14, 221,
+ 140, 47, 228, 14, 205, 89, 47, 228, 14, 221, 27, 47, 31, 199, 96, 211,
+ 105, 62, 201, 190, 47, 31, 197, 33, 211, 105, 62, 201, 190, 47, 31, 198,
+ 250, 211, 105, 62, 201, 190, 47, 31, 232, 136, 211, 105, 62, 201, 190,
+ 47, 31, 233, 16, 211, 105, 62, 201, 190, 47, 31, 202, 121, 211, 105, 62,
+ 201, 190, 47, 31, 203, 242, 211, 105, 62, 201, 190, 47, 31, 234, 154,
+ 211, 105, 62, 201, 190, 210, 103, 56, 47, 31, 197, 33, 107, 47, 31, 197,
+ 33, 109, 47, 31, 197, 33, 138, 47, 31, 197, 33, 134, 47, 31, 197, 33,
+ 149, 47, 31, 197, 33, 169, 47, 31, 197, 33, 175, 47, 31, 197, 33, 171,
+ 47, 31, 197, 33, 178, 47, 31, 198, 249, 47, 31, 198, 250, 107, 47, 31,
+ 198, 250, 109, 47, 31, 198, 250, 138, 47, 31, 198, 250, 134, 47, 31, 198,
+ 250, 149, 47, 30, 221, 113, 47, 30, 213, 204, 47, 30, 198, 168, 47, 30,
+ 206, 239, 47, 30, 216, 77, 47, 30, 209, 169, 47, 30, 202, 160, 47, 30,
+ 223, 222, 47, 30, 243, 24, 47, 30, 243, 91, 47, 30, 221, 188, 47, 30,
+ 199, 7, 47, 30, 209, 209, 47, 30, 229, 142, 47, 30, 221, 114, 65, 47, 30,
+ 213, 205, 65, 47, 30, 198, 169, 65, 47, 30, 206, 240, 65, 47, 30, 216,
+ 78, 65, 47, 30, 209, 170, 65, 47, 30, 202, 161, 65, 47, 30, 223, 223, 65,
+ 47, 30, 243, 25, 65, 47, 30, 243, 92, 65, 47, 30, 221, 189, 65, 47, 30,
+ 199, 8, 65, 47, 30, 209, 210, 65, 47, 30, 229, 143, 65, 47, 221, 32, 246,
+ 240, 246, 247, 47, 221, 32, 246, 240, 222, 178, 47, 30, 223, 223, 66,
+ 221, 32, 201, 106, 113, 47, 228, 14, 107, 47, 228, 14, 109, 47, 228, 14,
+ 138, 47, 228, 14, 134, 47, 228, 14, 149, 47, 228, 14, 169, 47, 228, 14,
+ 175, 47, 228, 14, 171, 47, 228, 14, 178, 47, 228, 14, 199, 95, 47, 228,
+ 14, 215, 205, 47, 228, 14, 232, 243, 47, 228, 14, 193, 143, 47, 228, 14,
+ 193, 28, 47, 228, 14, 216, 165, 47, 228, 14, 234, 207, 47, 228, 14, 200,
+ 198, 47, 228, 14, 201, 66, 47, 228, 14, 229, 255, 47, 228, 14, 202, 35,
+ 47, 228, 14, 214, 227, 47, 228, 14, 201, 231, 47, 228, 14, 232, 254, 47,
+ 228, 14, 239, 50, 47, 228, 14, 220, 114, 47, 228, 14, 205, 55, 47, 228,
+ 14, 217, 96, 47, 228, 14, 233, 41, 47, 228, 14, 200, 210, 47, 228, 14,
+ 233, 220, 47, 228, 14, 208, 211, 47, 228, 14, 250, 167, 47, 228, 14, 223,
+ 52, 47, 228, 14, 207, 30, 47, 228, 14, 239, 8, 47, 228, 14, 238, 251, 47,
+ 228, 14, 229, 135, 47, 228, 14, 247, 21, 47, 228, 14, 218, 241, 47, 228,
+ 14, 219, 224, 47, 228, 14, 183, 47, 228, 14, 216, 215, 47, 228, 14, 207,
+ 60, 47, 228, 14, 201, 10, 47, 228, 14, 200, 178, 47, 228, 14, 234, 75,
+ 47, 228, 14, 207, 32, 47, 228, 14, 251, 168, 47, 228, 14, 213, 190, 47,
+ 31, 198, 250, 169, 47, 31, 198, 250, 175, 47, 31, 198, 250, 171, 47, 31,
+ 198, 250, 178, 47, 31, 232, 135, 47, 31, 232, 136, 107, 47, 31, 232, 136,
+ 109, 47, 31, 232, 136, 138, 47, 31, 232, 136, 134, 47, 31, 232, 136, 149,
+ 47, 31, 232, 136, 169, 47, 31, 232, 136, 175, 47, 31, 232, 136, 171, 47,
+ 31, 232, 136, 178, 47, 31, 233, 15, 154, 199, 109, 16, 40, 223, 21, 154,
+ 199, 109, 16, 40, 233, 53, 154, 199, 109, 16, 40, 217, 58, 154, 199, 109,
+ 16, 40, 251, 39, 154, 199, 109, 16, 40, 217, 21, 154, 199, 109, 16, 40,
+ 222, 175, 154, 199, 109, 16, 40, 222, 176, 154, 199, 109, 16, 40, 250,
+ 159, 154, 199, 109, 16, 40, 204, 9, 154, 199, 109, 16, 40, 211, 157, 154,
+ 199, 109, 16, 40, 212, 255, 154, 199, 109, 16, 40, 237, 140, 51, 229,
+ 178, 51, 234, 30, 51, 233, 230, 219, 118, 219, 145, 56, 47, 72, 65, 47,
+ 72, 68, 47, 72, 66, 47, 72, 71, 47, 72, 74, 47, 72, 155, 47, 72, 221,
+ 166, 47, 72, 220, 232, 47, 72, 222, 22, 47, 72, 221, 67, 47, 72, 188, 47,
+ 72, 202, 222, 47, 72, 201, 4, 47, 72, 205, 68, 47, 72, 202, 46, 47, 72,
+ 190, 190, 47, 72, 198, 193, 47, 72, 197, 94, 47, 72, 199, 145, 47, 72,
+ 159, 47, 72, 180, 47, 72, 213, 219, 47, 72, 212, 178, 47, 72, 214, 121,
+ 47, 72, 213, 43, 47, 72, 140, 47, 72, 229, 158, 47, 72, 228, 159, 47, 72,
+ 229, 245, 47, 72, 229, 23, 47, 72, 174, 47, 72, 216, 100, 47, 72, 215,
+ 155, 47, 72, 216, 232, 47, 72, 216, 12, 47, 72, 170, 47, 72, 191, 225,
+ 47, 72, 192, 12, 47, 72, 165, 47, 72, 207, 1, 47, 72, 206, 68, 47, 72,
+ 207, 113, 47, 72, 206, 162, 47, 72, 193, 190, 47, 72, 193, 86, 47, 72,
+ 193, 125, 47, 72, 193, 48, 51, 234, 33, 214, 228, 207, 68, 51, 251, 64,
+ 51, 250, 221, 51, 251, 92, 51, 252, 163, 51, 223, 130, 51, 223, 97, 51,
+ 196, 80, 51, 234, 2, 51, 234, 185, 51, 211, 90, 51, 211, 83, 51, 222,
+ 100, 51, 222, 63, 51, 222, 58, 51, 231, 195, 51, 231, 205, 51, 231, 41,
+ 51, 231, 35, 51, 220, 144, 51, 231, 26, 51, 221, 131, 51, 221, 130, 51,
+ 221, 129, 51, 221, 128, 51, 230, 146, 51, 230, 145, 51, 220, 193, 51,
+ 220, 196, 51, 222, 9, 51, 221, 29, 51, 221, 38, 51, 205, 180, 51, 205,
+ 133, 51, 202, 141, 51, 204, 15, 51, 204, 14, 51, 238, 28, 51, 237, 81,
+ 51, 236, 141, 51, 198, 81, 51, 214, 221, 51, 213, 0, 51, 230, 75, 51,
+ 210, 214, 51, 210, 213, 51, 249, 150, 51, 209, 181, 51, 209, 143, 51,
+ 209, 144, 51, 248, 156, 51, 228, 154, 51, 228, 148, 51, 247, 221, 51,
+ 228, 132, 51, 229, 206, 51, 209, 241, 51, 210, 29, 51, 229, 187, 51, 210,
+ 25, 51, 210, 43, 51, 248, 252, 51, 209, 57, 51, 248, 84, 51, 228, 255,
+ 51, 209, 38, 51, 228, 246, 51, 228, 248, 51, 217, 110, 51, 217, 106, 51,
+ 217, 115, 51, 217, 44, 51, 217, 76, 51, 216, 56, 51, 216, 29, 51, 216,
+ 28, 51, 216, 203, 51, 216, 200, 51, 216, 204, 51, 192, 139, 51, 192, 137,
+ 51, 191, 210, 51, 206, 178, 51, 206, 182, 51, 206, 35, 51, 206, 28, 51,
+ 207, 57, 51, 207, 54, 51, 193, 141, 154, 199, 109, 16, 40, 228, 177, 191,
+ 77, 154, 199, 109, 16, 40, 228, 177, 107, 154, 199, 109, 16, 40, 228,
+ 177, 109, 154, 199, 109, 16, 40, 228, 177, 138, 154, 199, 109, 16, 40,
+ 228, 177, 134, 154, 199, 109, 16, 40, 228, 177, 149, 154, 199, 109, 16,
+ 40, 228, 177, 169, 154, 199, 109, 16, 40, 228, 177, 175, 154, 199, 109,
+ 16, 40, 228, 177, 171, 154, 199, 109, 16, 40, 228, 177, 178, 154, 199,
+ 109, 16, 40, 228, 177, 199, 95, 154, 199, 109, 16, 40, 228, 177, 234,
+ 127, 154, 199, 109, 16, 40, 228, 177, 197, 37, 154, 199, 109, 16, 40,
+ 228, 177, 198, 251, 154, 199, 109, 16, 40, 228, 177, 232, 122, 154, 199,
+ 109, 16, 40, 228, 177, 233, 19, 154, 199, 109, 16, 40, 228, 177, 202,
+ 130, 154, 199, 109, 16, 40, 228, 177, 203, 244, 154, 199, 109, 16, 40,
+ 228, 177, 234, 161, 154, 199, 109, 16, 40, 228, 177, 213, 171, 154, 199,
+ 109, 16, 40, 228, 177, 197, 32, 154, 199, 109, 16, 40, 228, 177, 197, 25,
+ 154, 199, 109, 16, 40, 228, 177, 197, 20, 154, 199, 109, 16, 40, 228,
+ 177, 197, 22, 154, 199, 109, 16, 40, 228, 177, 197, 27, 51, 228, 168, 51,
+ 238, 32, 51, 250, 163, 51, 164, 51, 211, 9, 51, 210, 68, 51, 236, 177,
+ 51, 236, 178, 201, 189, 51, 236, 178, 238, 189, 51, 223, 49, 51, 234, 33,
+ 214, 228, 229, 207, 51, 234, 33, 214, 228, 200, 66, 51, 234, 33, 214,
+ 228, 199, 212, 51, 234, 33, 214, 228, 216, 199, 51, 238, 253, 51, 210,
+ 221, 251, 135, 51, 180, 51, 215, 156, 65, 51, 174, 51, 155, 51, 222, 25,
+ 51, 217, 16, 51, 231, 183, 51, 247, 144, 51, 222, 24, 51, 209, 231, 51,
+ 214, 72, 51, 215, 156, 233, 175, 51, 215, 156, 232, 51, 51, 216, 141, 51,
+ 221, 217, 51, 228, 83, 51, 221, 168, 51, 216, 102, 51, 231, 55, 51, 198,
+ 195, 51, 215, 156, 172, 51, 216, 20, 51, 236, 187, 51, 221, 95, 51, 232,
+ 177, 51, 213, 81, 51, 215, 156, 218, 168, 51, 216, 17, 51, 242, 199, 51,
+ 221, 81, 51, 216, 18, 201, 189, 51, 242, 200, 201, 189, 51, 218, 169,
+ 201, 189, 51, 221, 82, 201, 189, 51, 216, 18, 238, 189, 51, 242, 200,
+ 238, 189, 51, 218, 169, 238, 189, 51, 221, 82, 238, 189, 51, 218, 169,
+ 139, 206, 8, 51, 218, 169, 139, 206, 9, 201, 189, 51, 168, 51, 221, 21,
+ 51, 215, 166, 51, 230, 229, 51, 207, 168, 51, 207, 169, 139, 206, 8, 51,
+ 207, 169, 139, 206, 9, 201, 189, 51, 208, 178, 51, 212, 219, 51, 215,
+ 156, 206, 8, 51, 215, 158, 51, 208, 124, 51, 212, 112, 51, 215, 156, 196,
+ 12, 51, 215, 87, 51, 220, 182, 51, 215, 88, 216, 203, 51, 208, 123, 51,
+ 212, 111, 51, 215, 156, 193, 224, 51, 215, 81, 51, 220, 180, 51, 215, 82,
+ 216, 203, 51, 222, 153, 211, 134, 51, 218, 169, 211, 134, 51, 251, 149,
+ 51, 248, 57, 51, 247, 66, 51, 247, 43, 51, 247, 194, 139, 221, 217, 51,
+ 242, 99, 51, 237, 200, 51, 230, 129, 51, 140, 51, 228, 169, 51, 223, 162,
+ 51, 221, 102, 51, 221, 82, 247, 110, 51, 220, 234, 51, 219, 46, 51, 219,
+ 45, 51, 219, 30, 51, 218, 184, 51, 217, 17, 202, 70, 51, 216, 55, 51,
+ 215, 233, 51, 209, 229, 51, 209, 76, 51, 208, 249, 51, 208, 247, 51, 201,
+ 180, 51, 200, 158, 51, 193, 127, 51, 196, 13, 139, 218, 168, 51, 42, 139,
+ 218, 168, 154, 199, 109, 16, 40, 237, 204, 107, 154, 199, 109, 16, 40,
+ 237, 204, 109, 154, 199, 109, 16, 40, 237, 204, 138, 154, 199, 109, 16,
+ 40, 237, 204, 134, 154, 199, 109, 16, 40, 237, 204, 149, 154, 199, 109,
+ 16, 40, 237, 204, 169, 154, 199, 109, 16, 40, 237, 204, 175, 154, 199,
+ 109, 16, 40, 237, 204, 171, 154, 199, 109, 16, 40, 237, 204, 178, 154,
+ 199, 109, 16, 40, 237, 204, 199, 95, 154, 199, 109, 16, 40, 237, 204,
+ 234, 127, 154, 199, 109, 16, 40, 237, 204, 197, 37, 154, 199, 109, 16,
+ 40, 237, 204, 198, 251, 154, 199, 109, 16, 40, 237, 204, 232, 122, 154,
+ 199, 109, 16, 40, 237, 204, 233, 19, 154, 199, 109, 16, 40, 237, 204,
+ 202, 130, 154, 199, 109, 16, 40, 237, 204, 203, 244, 154, 199, 109, 16,
+ 40, 237, 204, 234, 161, 154, 199, 109, 16, 40, 237, 204, 213, 171, 154,
+ 199, 109, 16, 40, 237, 204, 197, 32, 154, 199, 109, 16, 40, 237, 204,
+ 197, 25, 154, 199, 109, 16, 40, 237, 204, 197, 20, 154, 199, 109, 16, 40,
+ 237, 204, 197, 22, 154, 199, 109, 16, 40, 237, 204, 197, 27, 154, 199,
+ 109, 16, 40, 237, 204, 197, 28, 154, 199, 109, 16, 40, 237, 204, 197, 23,
+ 154, 199, 109, 16, 40, 237, 204, 197, 24, 154, 199, 109, 16, 40, 237,
+ 204, 197, 31, 154, 199, 109, 16, 40, 237, 204, 197, 26, 154, 199, 109,
+ 16, 40, 237, 204, 198, 249, 154, 199, 109, 16, 40, 237, 204, 198, 247,
+ 51, 231, 222, 229, 181, 40, 199, 34, 238, 231, 229, 219, 229, 181, 40,
+ 199, 34, 207, 100, 234, 207, 229, 181, 40, 237, 14, 250, 183, 199, 34,
+ 248, 247, 229, 181, 40, 191, 238, 232, 168, 229, 181, 40, 193, 171, 229,
+ 181, 40, 239, 53, 229, 181, 40, 199, 34, 250, 246, 229, 181, 40, 229, 6,
+ 198, 87, 229, 181, 40, 2, 199, 194, 229, 181, 40, 198, 1, 229, 181, 40,
+ 210, 60, 229, 181, 40, 201, 104, 229, 181, 40, 233, 43, 229, 181, 40,
+ 230, 206, 209, 21, 229, 181, 40, 215, 254, 229, 181, 40, 234, 74, 229,
+ 181, 40, 232, 169, 229, 181, 40, 193, 21, 211, 105, 199, 34, 237, 141,
+ 229, 181, 40, 251, 43, 229, 181, 40, 239, 31, 229, 181, 40, 248, 145,
+ 198, 215, 229, 181, 40, 230, 227, 229, 181, 40, 201, 208, 251, 63, 229,
+ 181, 40, 207, 22, 229, 181, 40, 223, 124, 229, 181, 40, 230, 206, 199,
+ 194, 229, 181, 40, 215, 180, 239, 0, 229, 181, 40, 230, 206, 208, 224,
+ 229, 181, 40, 199, 34, 252, 65, 193, 143, 229, 181, 40, 199, 34, 242,
+ 227, 232, 243, 229, 181, 40, 223, 138, 229, 181, 40, 235, 64, 229, 181,
+ 40, 207, 25, 229, 181, 40, 230, 206, 208, 254, 229, 181, 40, 208, 197,
+ 229, 181, 40, 237, 220, 79, 199, 34, 219, 132, 229, 181, 40, 199, 34,
+ 233, 81, 229, 181, 40, 211, 62, 229, 181, 40, 211, 167, 229, 181, 40,
+ 237, 111, 229, 181, 40, 237, 133, 229, 181, 40, 223, 153, 229, 181, 40,
+ 248, 41, 229, 181, 40, 242, 76, 119, 216, 206, 229, 181, 40, 231, 190,
+ 198, 87, 229, 181, 40, 208, 135, 196, 67, 229, 181, 40, 211, 61, 229,
+ 181, 40, 199, 34, 193, 109, 229, 181, 40, 207, 13, 229, 181, 40, 199, 34,
+ 247, 72, 229, 181, 40, 199, 34, 250, 242, 198, 209, 229, 181, 40, 199,
+ 34, 222, 10, 201, 70, 215, 184, 229, 181, 40, 237, 76, 229, 181, 40, 199,
+ 34, 217, 47, 217, 111, 229, 181, 40, 252, 66, 229, 181, 40, 199, 34, 193,
+ 161, 229, 181, 40, 199, 34, 231, 145, 193, 66, 229, 181, 40, 199, 34,
+ 222, 184, 220, 43, 229, 181, 40, 236, 219, 229, 181, 40, 219, 119, 229,
+ 181, 40, 223, 127, 197, 176, 229, 181, 40, 2, 208, 224, 229, 181, 40,
+ 251, 254, 242, 66, 229, 181, 40, 248, 250, 242, 66, 11, 5, 223, 53, 11,
+ 5, 223, 45, 11, 5, 68, 11, 5, 223, 80, 11, 5, 223, 224, 11, 5, 223, 207,
+ 11, 5, 223, 226, 11, 5, 223, 225, 11, 5, 250, 182, 11, 5, 250, 133, 11,
+ 5, 65, 11, 5, 251, 65, 11, 5, 196, 78, 11, 5, 196, 82, 11, 5, 196, 79,
+ 11, 5, 211, 30, 11, 5, 210, 247, 11, 5, 74, 11, 5, 211, 78, 11, 5, 233,
+ 221, 11, 5, 71, 11, 5, 193, 0, 11, 5, 248, 148, 11, 5, 248, 143, 11, 5,
+ 248, 188, 11, 5, 248, 161, 11, 5, 248, 177, 11, 5, 248, 176, 11, 5, 248,
+ 179, 11, 5, 248, 178, 11, 5, 249, 64, 11, 5, 249, 56, 11, 5, 249, 153,
+ 11, 5, 249, 89, 11, 5, 247, 234, 11, 5, 247, 238, 11, 5, 247, 235, 11, 5,
+ 248, 81, 11, 5, 248, 62, 11, 5, 248, 111, 11, 5, 248, 89, 11, 5, 248,
+ 206, 11, 5, 249, 17, 11, 5, 248, 219, 11, 5, 247, 217, 11, 5, 247, 211,
+ 11, 5, 248, 10, 11, 5, 247, 232, 11, 5, 247, 225, 11, 5, 247, 230, 11, 5,
+ 247, 199, 11, 5, 247, 197, 11, 5, 247, 204, 11, 5, 247, 202, 11, 5, 247,
+ 200, 11, 5, 247, 201, 11, 5, 209, 117, 11, 5, 209, 113, 11, 5, 209, 185,
+ 11, 5, 209, 129, 11, 5, 209, 149, 11, 5, 209, 176, 11, 5, 209, 172, 11,
+ 5, 210, 89, 11, 5, 210, 73, 11, 5, 168, 11, 5, 210, 137, 11, 5, 208, 145,
+ 11, 5, 208, 147, 11, 5, 208, 146, 11, 5, 209, 14, 11, 5, 208, 252, 11, 5,
+ 209, 73, 11, 5, 209, 33, 11, 5, 208, 131, 11, 5, 208, 126, 11, 5, 208,
+ 165, 11, 5, 208, 144, 11, 5, 208, 136, 11, 5, 208, 142, 11, 5, 208, 108,
+ 11, 5, 208, 107, 11, 5, 208, 112, 11, 5, 208, 111, 11, 5, 208, 109, 11,
+ 5, 208, 110, 11, 5, 249, 38, 11, 5, 249, 37, 11, 5, 249, 44, 11, 5, 249,
+ 39, 11, 5, 249, 41, 11, 5, 249, 40, 11, 5, 249, 43, 11, 5, 249, 42, 11,
+ 5, 249, 50, 11, 5, 249, 49, 11, 5, 249, 53, 11, 5, 249, 51, 11, 5, 249,
+ 29, 11, 5, 249, 31, 11, 5, 249, 30, 11, 5, 249, 34, 11, 5, 249, 33, 11,
+ 5, 249, 36, 11, 5, 249, 35, 11, 5, 249, 45, 11, 5, 249, 48, 11, 5, 249,
+ 46, 11, 5, 249, 25, 11, 5, 249, 24, 11, 5, 249, 32, 11, 5, 249, 28, 11,
+ 5, 249, 26, 11, 5, 249, 27, 11, 5, 249, 21, 11, 5, 249, 20, 11, 5, 249,
+ 23, 11, 5, 249, 22, 11, 5, 214, 185, 11, 5, 214, 184, 11, 5, 214, 190,
+ 11, 5, 214, 186, 11, 5, 214, 187, 11, 5, 214, 189, 11, 5, 214, 188, 11,
+ 5, 214, 193, 11, 5, 214, 192, 11, 5, 214, 195, 11, 5, 214, 194, 11, 5,
+ 214, 181, 11, 5, 214, 180, 11, 5, 214, 183, 11, 5, 214, 182, 11, 5, 214,
+ 174, 11, 5, 214, 173, 11, 5, 214, 178, 11, 5, 214, 177, 11, 5, 214, 175,
+ 11, 5, 214, 176, 11, 5, 214, 168, 11, 5, 214, 167, 11, 5, 214, 172, 11,
+ 5, 214, 171, 11, 5, 214, 169, 11, 5, 214, 170, 11, 5, 229, 67, 11, 5,
+ 229, 66, 11, 5, 229, 72, 11, 5, 229, 68, 11, 5, 229, 69, 11, 5, 229, 71,
+ 11, 5, 229, 70, 11, 5, 229, 75, 11, 5, 229, 74, 11, 5, 229, 77, 11, 5,
+ 229, 76, 11, 5, 229, 58, 11, 5, 229, 60, 11, 5, 229, 59, 11, 5, 229, 63,
+ 11, 5, 229, 62, 11, 5, 229, 65, 11, 5, 229, 64, 11, 5, 229, 54, 11, 5,
+ 229, 53, 11, 5, 229, 61, 11, 5, 229, 57, 11, 5, 229, 55, 11, 5, 229, 56,
+ 11, 5, 229, 48, 11, 5, 229, 52, 11, 5, 229, 51, 11, 5, 229, 49, 11, 5,
+ 229, 50, 11, 5, 216, 23, 11, 5, 216, 22, 11, 5, 216, 100, 11, 5, 216, 31,
+ 11, 5, 216, 63, 11, 5, 216, 81, 11, 5, 216, 79, 11, 5, 217, 30, 11, 5,
+ 217, 24, 11, 5, 174, 11, 5, 217, 71, 11, 5, 215, 115, 11, 5, 215, 114,
+ 11, 5, 215, 118, 11, 5, 215, 116, 11, 5, 215, 195, 11, 5, 215, 168, 11,
+ 5, 216, 12, 11, 5, 215, 202, 11, 5, 216, 152, 11, 5, 216, 232, 11, 5,
+ 215, 95, 11, 5, 215, 89, 11, 5, 215, 155, 11, 5, 215, 111, 11, 5, 215,
+ 104, 11, 5, 215, 109, 11, 5, 215, 65, 11, 5, 215, 64, 11, 5, 215, 70, 11,
+ 5, 215, 67, 11, 5, 232, 229, 11, 5, 232, 222, 11, 5, 233, 23, 11, 5, 232,
+ 245, 11, 5, 233, 72, 11, 5, 233, 63, 11, 5, 233, 109, 11, 5, 233, 77, 11,
+ 5, 232, 119, 11, 5, 232, 175, 11, 5, 232, 154, 11, 5, 232, 68, 11, 5,
+ 232, 67, 11, 5, 232, 86, 11, 5, 232, 73, 11, 5, 232, 71, 11, 5, 232, 72,
+ 11, 5, 232, 54, 11, 5, 232, 53, 11, 5, 232, 57, 11, 5, 232, 55, 11, 5,
+ 195, 32, 11, 5, 195, 26, 11, 5, 195, 69, 11, 5, 195, 41, 11, 5, 195, 58,
+ 11, 5, 195, 53, 11, 5, 195, 61, 11, 5, 195, 60, 11, 5, 195, 162, 11, 5,
+ 195, 157, 11, 5, 195, 188, 11, 5, 195, 175, 11, 5, 195, 4, 11, 5, 195, 0,
+ 11, 5, 195, 24, 11, 5, 195, 6, 11, 5, 195, 73, 11, 5, 195, 141, 11, 5,
+ 193, 242, 11, 5, 193, 240, 11, 5, 193, 249, 11, 5, 193, 245, 11, 5, 193,
+ 243, 11, 5, 193, 244, 11, 5, 193, 229, 11, 5, 193, 228, 11, 5, 193, 235,
+ 11, 5, 193, 234, 11, 5, 193, 232, 11, 5, 193, 233, 11, 5, 236, 212, 11,
+ 5, 236, 197, 11, 5, 237, 44, 11, 5, 236, 240, 11, 5, 237, 19, 11, 5, 237,
+ 24, 11, 5, 237, 23, 11, 5, 237, 211, 11, 5, 237, 205, 11, 5, 238, 32, 11,
+ 5, 237, 231, 11, 5, 235, 69, 11, 5, 235, 70, 11, 5, 236, 140, 11, 5, 235,
+ 117, 11, 5, 236, 174, 11, 5, 236, 143, 11, 5, 237, 74, 11, 5, 237, 146,
+ 11, 5, 237, 96, 11, 5, 235, 60, 11, 5, 235, 58, 11, 5, 235, 89, 11, 5,
+ 235, 68, 11, 5, 235, 63, 11, 5, 235, 66, 11, 5, 198, 125, 11, 5, 198,
+ 117, 11, 5, 198, 193, 11, 5, 198, 135, 11, 5, 198, 176, 11, 5, 198, 178,
+ 11, 5, 198, 177, 11, 5, 199, 171, 11, 5, 199, 156, 11, 5, 190, 190, 11,
+ 5, 199, 183, 11, 5, 197, 69, 11, 5, 197, 68, 11, 5, 197, 71, 11, 5, 197,
+ 70, 11, 5, 198, 40, 11, 5, 198, 29, 11, 5, 159, 11, 5, 198, 53, 11, 5,
+ 199, 55, 11, 5, 199, 145, 11, 5, 199, 82, 11, 5, 197, 52, 11, 5, 197, 47,
+ 11, 5, 197, 94, 11, 5, 197, 67, 11, 5, 197, 53, 11, 5, 197, 64, 11, 5,
+ 237, 163, 11, 5, 237, 162, 11, 5, 237, 168, 11, 5, 237, 164, 11, 5, 237,
+ 165, 11, 5, 237, 167, 11, 5, 237, 166, 11, 5, 237, 184, 11, 5, 237, 183,
+ 11, 5, 237, 191, 11, 5, 237, 185, 11, 5, 237, 153, 11, 5, 237, 155, 11,
+ 5, 237, 154, 11, 5, 237, 158, 11, 5, 237, 157, 11, 5, 237, 161, 11, 5,
+ 237, 159, 11, 5, 237, 176, 11, 5, 237, 179, 11, 5, 237, 177, 11, 5, 237,
+ 149, 11, 5, 237, 148, 11, 5, 237, 156, 11, 5, 237, 152, 11, 5, 237, 150,
+ 11, 5, 237, 151, 11, 5, 214, 140, 11, 5, 214, 139, 11, 5, 214, 147, 11,
+ 5, 214, 142, 11, 5, 214, 143, 11, 5, 214, 144, 11, 5, 214, 156, 11, 5,
+ 214, 155, 11, 5, 214, 162, 11, 5, 214, 157, 11, 5, 214, 132, 11, 5, 214,
+ 131, 11, 5, 214, 138, 11, 5, 214, 133, 11, 5, 214, 148, 11, 5, 214, 154,
+ 11, 5, 214, 152, 11, 5, 214, 124, 11, 5, 214, 123, 11, 5, 214, 129, 11,
+ 5, 214, 127, 11, 5, 214, 125, 11, 5, 214, 126, 11, 5, 229, 33, 11, 5,
+ 229, 32, 11, 5, 229, 39, 11, 5, 229, 34, 11, 5, 229, 36, 11, 5, 229, 35,
+ 11, 5, 229, 38, 11, 5, 229, 37, 11, 5, 229, 45, 11, 5, 229, 43, 11, 5,
+ 229, 47, 11, 5, 229, 46, 11, 5, 229, 26, 11, 5, 229, 27, 11, 5, 229, 30,
+ 11, 5, 229, 29, 11, 5, 229, 31, 11, 5, 229, 40, 11, 5, 229, 42, 11, 5,
+ 229, 41, 11, 5, 229, 25, 11, 5, 213, 162, 11, 5, 213, 160, 11, 5, 213,
+ 219, 11, 5, 213, 165, 11, 5, 213, 193, 11, 5, 213, 207, 11, 5, 213, 206,
+ 11, 5, 214, 200, 11, 5, 180, 11, 5, 214, 218, 11, 5, 212, 122, 11, 5,
+ 212, 124, 11, 5, 212, 123, 11, 5, 213, 11, 11, 5, 212, 251, 11, 5, 213,
+ 43, 11, 5, 213, 22, 11, 5, 214, 74, 11, 5, 214, 121, 11, 5, 214, 97, 11,
+ 5, 212, 117, 11, 5, 212, 113, 11, 5, 212, 178, 11, 5, 212, 121, 11, 5,
+ 212, 119, 11, 5, 212, 120, 11, 5, 229, 98, 11, 5, 229, 97, 11, 5, 229,
+ 103, 11, 5, 229, 99, 11, 5, 229, 100, 11, 5, 229, 102, 11, 5, 229, 101,
+ 11, 5, 229, 109, 11, 5, 229, 107, 11, 5, 229, 111, 11, 5, 229, 110, 11,
+ 5, 229, 90, 11, 5, 229, 92, 11, 5, 229, 91, 11, 5, 229, 94, 11, 5, 229,
+ 96, 11, 5, 229, 95, 11, 5, 229, 104, 11, 5, 229, 106, 11, 5, 229, 105,
+ 11, 5, 229, 86, 11, 5, 229, 85, 11, 5, 229, 93, 11, 5, 229, 89, 11, 5,
+ 229, 87, 11, 5, 229, 88, 11, 5, 229, 80, 11, 5, 229, 79, 11, 5, 229, 84,
+ 11, 5, 229, 83, 11, 5, 229, 81, 11, 5, 229, 82, 11, 5, 219, 87, 11, 5,
+ 219, 79, 11, 5, 219, 146, 11, 5, 219, 98, 11, 5, 219, 137, 11, 5, 219,
+ 136, 11, 5, 219, 140, 11, 5, 219, 138, 11, 5, 220, 5, 11, 5, 219, 249,
+ 11, 5, 173, 11, 5, 220, 16, 11, 5, 218, 201, 11, 5, 218, 200, 11, 5, 218,
+ 203, 11, 5, 218, 202, 11, 5, 218, 249, 11, 5, 218, 234, 11, 5, 219, 43,
+ 11, 5, 219, 1, 11, 5, 219, 164, 11, 5, 219, 238, 11, 5, 219, 184, 11, 5,
+ 218, 195, 11, 5, 218, 193, 11, 5, 218, 225, 11, 5, 218, 199, 11, 5, 218,
+ 197, 11, 5, 218, 198, 11, 5, 218, 173, 11, 5, 218, 172, 11, 5, 218, 183,
+ 11, 5, 218, 176, 11, 5, 218, 174, 11, 5, 218, 175, 11, 5, 231, 22, 11, 5,
+ 231, 21, 11, 5, 231, 53, 11, 5, 231, 34, 11, 5, 231, 45, 11, 5, 231, 44,
+ 11, 5, 231, 47, 11, 5, 231, 46, 11, 5, 231, 192, 11, 5, 231, 187, 11, 5,
+ 231, 240, 11, 5, 231, 203, 11, 5, 230, 152, 11, 5, 230, 151, 11, 5, 230,
+ 154, 11, 5, 230, 153, 11, 5, 230, 232, 11, 5, 230, 230, 11, 5, 231, 3,
+ 11, 5, 230, 242, 11, 5, 231, 131, 11, 5, 231, 129, 11, 5, 231, 165, 11,
+ 5, 231, 142, 11, 5, 230, 140, 11, 5, 230, 139, 11, 5, 230, 179, 11, 5,
+ 230, 150, 11, 5, 230, 141, 11, 5, 230, 149, 11, 5, 221, 120, 11, 5, 221,
+ 115, 11, 5, 221, 166, 11, 5, 221, 134, 11, 5, 221, 147, 11, 5, 221, 151,
+ 11, 5, 221, 149, 11, 5, 222, 49, 11, 5, 222, 30, 11, 5, 155, 11, 5, 222,
+ 78, 11, 5, 220, 202, 11, 5, 220, 207, 11, 5, 220, 204, 11, 5, 221, 28,
+ 11, 5, 221, 23, 11, 5, 221, 67, 11, 5, 221, 36, 11, 5, 221, 241, 11, 5,
+ 221, 224, 11, 5, 222, 22, 11, 5, 221, 245, 11, 5, 220, 188, 11, 5, 220,
+ 184, 11, 5, 220, 232, 11, 5, 220, 201, 11, 5, 220, 192, 11, 5, 220, 197,
+ 11, 5, 231, 113, 11, 5, 231, 112, 11, 5, 231, 117, 11, 5, 231, 114, 11,
+ 5, 231, 116, 11, 5, 231, 115, 11, 5, 231, 124, 11, 5, 231, 123, 11, 5,
+ 231, 127, 11, 5, 231, 125, 11, 5, 231, 104, 11, 5, 231, 103, 11, 5, 231,
+ 106, 11, 5, 231, 105, 11, 5, 231, 109, 11, 5, 231, 108, 11, 5, 231, 111,
+ 11, 5, 231, 110, 11, 5, 231, 119, 11, 5, 231, 118, 11, 5, 231, 122, 11,
+ 5, 231, 120, 11, 5, 231, 99, 11, 5, 231, 98, 11, 5, 231, 107, 11, 5, 231,
+ 102, 11, 5, 231, 100, 11, 5, 231, 101, 11, 5, 216, 119, 11, 5, 216, 120,
+ 11, 5, 216, 138, 11, 5, 216, 137, 11, 5, 216, 140, 11, 5, 216, 139, 11,
+ 5, 216, 110, 11, 5, 216, 112, 11, 5, 216, 111, 11, 5, 216, 115, 11, 5,
+ 216, 114, 11, 5, 216, 117, 11, 5, 216, 116, 11, 5, 216, 121, 11, 5, 216,
+ 123, 11, 5, 216, 122, 11, 5, 216, 106, 11, 5, 216, 105, 11, 5, 216, 113,
+ 11, 5, 216, 109, 11, 5, 216, 107, 11, 5, 216, 108, 11, 5, 228, 104, 11,
+ 5, 228, 103, 11, 5, 228, 110, 11, 5, 228, 105, 11, 5, 228, 107, 11, 5,
+ 228, 106, 11, 5, 228, 109, 11, 5, 228, 108, 11, 5, 228, 115, 11, 5, 228,
+ 114, 11, 5, 228, 117, 11, 5, 228, 116, 11, 5, 228, 96, 11, 5, 228, 95,
+ 11, 5, 228, 98, 11, 5, 228, 97, 11, 5, 228, 100, 11, 5, 228, 99, 11, 5,
+ 228, 102, 11, 5, 228, 101, 11, 5, 228, 111, 11, 5, 228, 113, 11, 5, 228,
+ 112, 11, 5, 214, 13, 11, 5, 214, 15, 11, 5, 214, 14, 11, 5, 214, 58, 11,
+ 5, 214, 56, 11, 5, 214, 68, 11, 5, 214, 61, 11, 5, 213, 230, 11, 5, 213,
+ 229, 11, 5, 213, 231, 11, 5, 213, 241, 11, 5, 213, 238, 11, 5, 213, 249,
+ 11, 5, 213, 243, 11, 5, 214, 49, 11, 5, 214, 55, 11, 5, 214, 51, 11, 5,
+ 229, 117, 11, 5, 229, 136, 11, 5, 229, 145, 11, 5, 230, 9, 11, 5, 229,
+ 253, 11, 5, 140, 11, 5, 230, 21, 11, 5, 228, 134, 11, 5, 228, 133, 11, 5,
+ 228, 136, 11, 5, 228, 135, 11, 5, 228, 180, 11, 5, 228, 171, 11, 5, 229,
+ 23, 11, 5, 228, 244, 11, 5, 229, 183, 11, 5, 229, 245, 11, 5, 229, 195,
+ 11, 5, 193, 146, 11, 5, 193, 131, 11, 5, 193, 190, 11, 5, 193, 158, 11,
+ 5, 192, 245, 11, 5, 192, 247, 11, 5, 192, 246, 11, 5, 193, 13, 11, 5,
+ 193, 48, 11, 5, 193, 24, 11, 5, 193, 99, 11, 5, 193, 125, 11, 5, 193,
+ 106, 11, 5, 191, 15, 11, 5, 191, 14, 11, 5, 191, 30, 11, 5, 191, 18, 11,
+ 5, 191, 23, 11, 5, 191, 25, 11, 5, 191, 24, 11, 5, 191, 96, 11, 5, 191,
+ 93, 11, 5, 191, 123, 11, 5, 191, 104, 11, 5, 190, 244, 11, 5, 190, 246,
+ 11, 5, 190, 245, 11, 5, 191, 2, 11, 5, 191, 1, 11, 5, 191, 7, 11, 5, 191,
+ 3, 11, 5, 191, 73, 11, 5, 191, 87, 11, 5, 191, 79, 11, 5, 190, 240, 11,
+ 5, 190, 239, 11, 5, 190, 251, 11, 5, 190, 243, 11, 5, 190, 241, 11, 5,
+ 190, 242, 11, 5, 190, 226, 11, 5, 190, 225, 11, 5, 190, 231, 11, 5, 190,
+ 229, 11, 5, 190, 227, 11, 5, 190, 228, 11, 5, 242, 255, 11, 5, 242, 248,
+ 11, 5, 243, 29, 11, 5, 243, 12, 11, 5, 243, 26, 11, 5, 243, 20, 11, 5,
+ 243, 28, 11, 5, 243, 27, 11, 5, 247, 78, 11, 5, 247, 69, 11, 5, 247, 160,
+ 11, 5, 247, 111, 11, 5, 238, 183, 11, 5, 238, 185, 11, 5, 238, 184, 11,
+ 5, 238, 249, 11, 5, 238, 237, 11, 5, 242, 99, 11, 5, 239, 13, 11, 5, 247,
+ 5, 11, 5, 247, 42, 11, 5, 247, 11, 11, 5, 238, 154, 11, 5, 238, 152, 11,
+ 5, 238, 195, 11, 5, 238, 181, 11, 5, 238, 160, 11, 5, 238, 176, 11, 5,
+ 238, 130, 11, 5, 238, 129, 11, 5, 238, 143, 11, 5, 238, 137, 11, 5, 238,
+ 131, 11, 5, 238, 133, 11, 5, 190, 209, 11, 5, 190, 208, 11, 5, 190, 215,
+ 11, 5, 190, 210, 11, 5, 190, 212, 11, 5, 190, 211, 11, 5, 190, 214, 11,
+ 5, 190, 213, 11, 5, 190, 221, 11, 5, 190, 220, 11, 5, 190, 224, 11, 5,
+ 190, 222, 11, 5, 190, 205, 11, 5, 190, 207, 11, 5, 190, 206, 11, 5, 190,
+ 216, 11, 5, 190, 219, 11, 5, 190, 217, 11, 5, 190, 198, 11, 5, 190, 202,
+ 11, 5, 190, 201, 11, 5, 190, 199, 11, 5, 190, 200, 11, 5, 190, 192, 11,
+ 5, 190, 191, 11, 5, 190, 197, 11, 5, 190, 195, 11, 5, 190, 193, 11, 5,
+ 190, 194, 11, 5, 212, 33, 11, 5, 212, 32, 11, 5, 212, 38, 11, 5, 212, 34,
+ 11, 5, 212, 35, 11, 5, 212, 37, 11, 5, 212, 36, 11, 5, 212, 43, 11, 5,
+ 212, 42, 11, 5, 212, 46, 11, 5, 212, 45, 11, 5, 212, 26, 11, 5, 212, 27,
+ 11, 5, 212, 30, 11, 5, 212, 31, 11, 5, 212, 39, 11, 5, 212, 41, 11, 5,
+ 212, 21, 11, 5, 212, 29, 11, 5, 212, 25, 11, 5, 212, 22, 11, 5, 212, 23,
+ 11, 5, 212, 16, 11, 5, 212, 15, 11, 5, 212, 20, 11, 5, 212, 19, 11, 5,
+ 212, 17, 11, 5, 212, 18, 11, 5, 202, 138, 11, 5, 169, 11, 5, 202, 222,
+ 11, 5, 202, 142, 11, 5, 202, 202, 11, 5, 202, 205, 11, 5, 202, 203, 11,
+ 5, 205, 122, 11, 5, 205, 106, 11, 5, 188, 11, 5, 205, 130, 11, 5, 200,
+ 188, 11, 5, 200, 190, 11, 5, 200, 189, 11, 5, 202, 8, 11, 5, 201, 253,
+ 11, 5, 202, 46, 11, 5, 202, 14, 11, 5, 203, 238, 11, 5, 205, 68, 11, 5,
+ 204, 13, 11, 5, 200, 163, 11, 5, 200, 159, 11, 5, 201, 4, 11, 5, 200,
+ 187, 11, 5, 200, 167, 11, 5, 200, 175, 11, 5, 200, 57, 11, 5, 200, 56,
+ 11, 5, 200, 127, 11, 5, 200, 65, 11, 5, 200, 59, 11, 5, 200, 64, 11, 5,
+ 201, 136, 11, 5, 201, 135, 11, 5, 201, 142, 11, 5, 201, 137, 11, 5, 201,
+ 139, 11, 5, 201, 141, 11, 5, 201, 140, 11, 5, 201, 151, 11, 5, 201, 149,
+ 11, 5, 201, 175, 11, 5, 201, 152, 11, 5, 201, 131, 11, 5, 201, 130, 11,
+ 5, 201, 134, 11, 5, 201, 132, 11, 5, 201, 145, 11, 5, 201, 148, 11, 5,
+ 201, 146, 11, 5, 201, 127, 11, 5, 201, 125, 11, 5, 201, 129, 11, 5, 201,
+ 128, 11, 5, 201, 120, 11, 5, 201, 119, 11, 5, 201, 124, 11, 5, 201, 123,
+ 11, 5, 201, 121, 11, 5, 201, 122, 11, 5, 191, 66, 11, 5, 191, 65, 11, 5,
+ 191, 71, 11, 5, 191, 68, 11, 5, 191, 45, 11, 5, 191, 47, 11, 5, 191, 46,
+ 11, 5, 191, 50, 11, 5, 191, 49, 11, 5, 191, 54, 11, 5, 191, 51, 11, 5,
+ 191, 59, 11, 5, 191, 58, 11, 5, 191, 62, 11, 5, 191, 60, 11, 5, 191, 41,
+ 11, 5, 191, 40, 11, 5, 191, 48, 11, 5, 191, 44, 11, 5, 191, 42, 11, 5,
+ 191, 43, 11, 5, 191, 33, 11, 5, 191, 32, 11, 5, 191, 37, 11, 5, 191, 36,
+ 11, 5, 191, 34, 11, 5, 191, 35, 11, 5, 243, 133, 11, 5, 243, 129, 11, 5,
+ 247, 1, 11, 5, 246, 243, 11, 5, 243, 44, 11, 5, 243, 43, 11, 5, 243, 46,
+ 11, 5, 243, 45, 11, 5, 243, 59, 11, 5, 243, 58, 11, 5, 243, 68, 11, 5,
+ 243, 63, 11, 5, 243, 102, 11, 5, 243, 99, 11, 5, 243, 127, 11, 5, 243,
+ 110, 11, 5, 243, 38, 11, 5, 243, 48, 11, 5, 243, 42, 11, 5, 243, 39, 11,
+ 5, 243, 41, 11, 5, 243, 31, 11, 5, 243, 30, 11, 5, 243, 35, 11, 5, 243,
+ 34, 11, 5, 243, 32, 11, 5, 243, 33, 11, 5, 206, 105, 11, 5, 206, 109, 11,
+ 5, 206, 87, 11, 5, 206, 88, 11, 5, 206, 92, 11, 5, 206, 91, 11, 5, 206,
+ 95, 11, 5, 206, 93, 11, 5, 206, 99, 11, 5, 206, 98, 11, 5, 206, 104, 11,
+ 5, 206, 100, 11, 5, 206, 83, 11, 5, 206, 81, 11, 5, 206, 89, 11, 5, 206,
+ 86, 11, 5, 206, 84, 11, 5, 206, 85, 11, 5, 206, 76, 11, 5, 206, 75, 11,
+ 5, 206, 80, 11, 5, 206, 79, 11, 5, 206, 77, 11, 5, 206, 78, 11, 5, 212,
+ 242, 11, 5, 212, 241, 11, 5, 212, 244, 11, 5, 212, 243, 11, 5, 212, 233,
+ 11, 5, 212, 235, 11, 5, 212, 234, 11, 5, 212, 237, 11, 5, 212, 236, 11,
+ 5, 212, 240, 11, 5, 212, 239, 11, 5, 212, 227, 11, 5, 212, 226, 11, 5,
+ 212, 232, 11, 5, 212, 230, 11, 5, 212, 228, 11, 5, 212, 229, 11, 5, 212,
+ 221, 11, 5, 212, 220, 11, 5, 212, 225, 11, 5, 212, 224, 11, 5, 212, 222,
+ 11, 5, 212, 223, 11, 5, 203, 123, 11, 5, 203, 118, 11, 5, 203, 165, 11,
+ 5, 203, 136, 11, 5, 202, 249, 11, 5, 202, 251, 11, 5, 202, 250, 11, 5,
+ 203, 24, 11, 5, 203, 19, 11, 5, 203, 56, 11, 5, 203, 44, 11, 5, 203, 91,
+ 11, 5, 203, 84, 11, 5, 203, 113, 11, 5, 203, 100, 11, 5, 202, 245, 11, 5,
+ 202, 242, 11, 5, 203, 5, 11, 5, 202, 248, 11, 5, 202, 246, 11, 5, 202,
+ 247, 11, 5, 202, 225, 11, 5, 202, 224, 11, 5, 202, 231, 11, 5, 202, 228,
+ 11, 5, 202, 226, 11, 5, 202, 227, 11, 5, 207, 130, 11, 5, 207, 123, 11,
+ 5, 165, 11, 5, 207, 136, 11, 5, 206, 38, 11, 5, 206, 40, 11, 5, 206, 39,
+ 11, 5, 206, 123, 11, 5, 206, 111, 11, 5, 206, 162, 11, 5, 206, 127, 11,
+ 5, 207, 11, 11, 5, 207, 113, 11, 5, 207, 53, 11, 5, 206, 30, 11, 5, 206,
+ 27, 11, 5, 206, 68, 11, 5, 206, 37, 11, 5, 206, 33, 11, 5, 206, 34, 11,
+ 5, 206, 12, 11, 5, 206, 11, 11, 5, 206, 17, 11, 5, 206, 15, 11, 5, 206,
+ 13, 11, 5, 206, 14, 11, 5, 222, 232, 11, 5, 222, 231, 11, 5, 222, 244,
+ 11, 5, 222, 233, 11, 5, 222, 240, 11, 5, 222, 239, 11, 5, 222, 242, 11,
+ 5, 222, 241, 11, 5, 222, 170, 11, 5, 222, 169, 11, 5, 222, 172, 11, 5,
+ 222, 171, 11, 5, 222, 188, 11, 5, 222, 186, 11, 5, 222, 201, 11, 5, 222,
+ 190, 11, 5, 222, 163, 11, 5, 222, 161, 11, 5, 222, 182, 11, 5, 222, 168,
+ 11, 5, 222, 165, 11, 5, 222, 166, 11, 5, 222, 155, 11, 5, 222, 154, 11,
+ 5, 222, 159, 11, 5, 222, 158, 11, 5, 222, 156, 11, 5, 222, 157, 11, 5,
+ 208, 49, 11, 5, 208, 47, 11, 5, 208, 57, 11, 5, 208, 50, 11, 5, 208, 54,
+ 11, 5, 208, 53, 11, 5, 208, 56, 11, 5, 208, 55, 11, 5, 207, 253, 11, 5,
+ 207, 250, 11, 5, 207, 255, 11, 5, 207, 254, 11, 5, 208, 36, 11, 5, 208,
+ 35, 11, 5, 208, 45, 11, 5, 208, 39, 11, 5, 207, 245, 11, 5, 207, 241, 11,
+ 5, 208, 33, 11, 5, 207, 249, 11, 5, 207, 247, 11, 5, 207, 248, 11, 5,
+ 207, 225, 11, 5, 207, 223, 11, 5, 207, 235, 11, 5, 207, 228, 11, 5, 207,
+ 226, 11, 5, 207, 227, 11, 5, 222, 221, 11, 5, 222, 220, 11, 5, 222, 227,
+ 11, 5, 222, 222, 11, 5, 222, 224, 11, 5, 222, 223, 11, 5, 222, 226, 11,
+ 5, 222, 225, 11, 5, 222, 212, 11, 5, 222, 214, 11, 5, 222, 213, 11, 5,
+ 222, 217, 11, 5, 222, 216, 11, 5, 222, 219, 11, 5, 222, 218, 11, 5, 222,
+ 208, 11, 5, 222, 207, 11, 5, 222, 215, 11, 5, 222, 211, 11, 5, 222, 209,
+ 11, 5, 222, 210, 11, 5, 222, 204, 11, 5, 222, 203, 11, 5, 222, 206, 11,
+ 5, 222, 205, 11, 5, 213, 134, 11, 5, 213, 133, 11, 5, 213, 141, 11, 5,
+ 213, 135, 11, 5, 213, 137, 11, 5, 213, 136, 11, 5, 213, 140, 11, 5, 213,
+ 138, 11, 5, 213, 123, 11, 5, 213, 124, 11, 5, 213, 129, 11, 5, 213, 128,
+ 11, 5, 213, 132, 11, 5, 213, 130, 11, 5, 213, 118, 11, 5, 213, 127, 11,
+ 5, 213, 122, 11, 5, 213, 119, 11, 5, 213, 120, 11, 5, 213, 113, 11, 5,
+ 213, 112, 11, 5, 213, 117, 11, 5, 213, 116, 11, 5, 213, 114, 11, 5, 213,
+ 115, 11, 5, 212, 68, 11, 5, 212, 67, 11, 5, 212, 81, 11, 5, 212, 72, 11,
+ 5, 212, 77, 11, 5, 212, 76, 11, 5, 212, 79, 11, 5, 212, 78, 11, 5, 212,
+ 53, 11, 5, 212, 55, 11, 5, 212, 54, 11, 5, 212, 60, 11, 5, 212, 59, 11,
+ 5, 212, 65, 11, 5, 212, 61, 11, 5, 212, 51, 11, 5, 212, 49, 11, 5, 212,
+ 58, 11, 5, 212, 52, 11, 5, 192, 198, 11, 5, 192, 197, 11, 5, 192, 207,
+ 11, 5, 192, 200, 11, 5, 192, 202, 11, 5, 192, 201, 11, 5, 192, 204, 11,
+ 5, 192, 203, 11, 5, 192, 186, 11, 5, 192, 187, 11, 5, 192, 191, 11, 5,
+ 192, 190, 11, 5, 192, 196, 11, 5, 192, 194, 11, 5, 192, 163, 11, 5, 192,
+ 161, 11, 5, 192, 176, 11, 5, 192, 166, 11, 5, 192, 164, 11, 5, 192, 165,
+ 11, 5, 192, 18, 11, 5, 192, 16, 11, 5, 192, 33, 11, 5, 192, 19, 11, 5,
+ 192, 27, 11, 5, 192, 26, 11, 5, 192, 30, 11, 5, 192, 28, 11, 5, 191, 198,
+ 11, 5, 191, 197, 11, 5, 191, 201, 11, 5, 191, 199, 11, 5, 191, 240, 11,
+ 5, 191, 235, 11, 5, 192, 12, 11, 5, 191, 245, 11, 5, 191, 189, 11, 5,
+ 191, 185, 11, 5, 191, 225, 11, 5, 191, 196, 11, 5, 191, 192, 11, 5, 191,
+ 193, 11, 5, 191, 169, 11, 5, 191, 168, 11, 5, 191, 176, 11, 5, 191, 172,
+ 11, 5, 191, 170, 11, 5, 191, 171, 11, 48, 208, 36, 11, 48, 219, 146, 11,
+ 48, 221, 120, 11, 48, 212, 72, 11, 48, 238, 137, 11, 48, 201, 142, 11,
+ 48, 231, 110, 11, 48, 231, 142, 11, 48, 216, 100, 11, 48, 228, 104, 11,
+ 48, 218, 175, 11, 48, 249, 25, 11, 48, 215, 202, 11, 48, 192, 12, 11, 48,
+ 208, 131, 11, 48, 228, 98, 11, 48, 199, 171, 11, 48, 231, 240, 11, 48,
+ 190, 243, 11, 48, 238, 130, 11, 48, 237, 151, 11, 48, 247, 230, 11, 48,
+ 231, 106, 11, 48, 212, 61, 11, 48, 197, 94, 11, 48, 211, 78, 11, 48, 222,
+ 208, 11, 48, 191, 2, 11, 48, 208, 108, 11, 48, 229, 65, 11, 48, 192, 18,
+ 11, 48, 193, 244, 11, 48, 202, 231, 11, 48, 195, 141, 11, 48, 191, 123,
+ 11, 48, 222, 201, 11, 48, 212, 25, 11, 48, 222, 206, 11, 48, 230, 232,
+ 11, 48, 222, 226, 11, 48, 193, 48, 11, 48, 235, 89, 11, 48, 202, 247, 11,
+ 48, 219, 140, 11, 48, 238, 143, 11, 48, 238, 184, 11, 48, 243, 12, 11,
+ 48, 228, 101, 11, 48, 203, 123, 11, 48, 190, 242, 11, 48, 203, 44, 11,
+ 48, 243, 127, 11, 48, 190, 212, 11, 48, 214, 189, 11, 48, 222, 22, 219,
+ 88, 1, 249, 153, 219, 88, 1, 168, 219, 88, 1, 209, 228, 219, 88, 1, 238,
+ 32, 219, 88, 1, 190, 190, 219, 88, 1, 199, 49, 219, 88, 1, 231, 240, 219,
+ 88, 1, 155, 219, 88, 1, 221, 215, 219, 88, 1, 223, 32, 219, 88, 1, 247,
+ 160, 219, 88, 1, 247, 1, 219, 88, 1, 235, 35, 219, 88, 1, 197, 168, 219,
+ 88, 1, 197, 157, 219, 88, 1, 174, 219, 88, 1, 180, 219, 88, 1, 173, 219,
+ 88, 1, 188, 219, 88, 1, 191, 71, 219, 88, 1, 191, 123, 219, 88, 1, 214,
+ 68, 219, 88, 1, 140, 219, 88, 1, 192, 220, 219, 88, 1, 229, 177, 219, 88,
+ 1, 233, 109, 219, 88, 1, 193, 190, 219, 88, 1, 203, 165, 219, 88, 1, 170,
+ 219, 88, 1, 231, 91, 219, 88, 1, 65, 219, 88, 1, 252, 25, 219, 88, 1, 71,
+ 219, 88, 1, 233, 242, 219, 88, 1, 68, 219, 88, 1, 74, 219, 88, 1, 66,
+ 219, 88, 1, 196, 152, 219, 88, 1, 196, 141, 219, 88, 1, 211, 151, 219,
+ 88, 1, 163, 215, 69, 198, 193, 219, 88, 1, 163, 215, 7, 209, 73, 219, 88,
+ 1, 163, 215, 69, 238, 142, 219, 88, 1, 163, 215, 69, 248, 111, 219, 88,
+ 1, 163, 215, 69, 180, 219, 88, 1, 163, 215, 69, 222, 253, 219, 88, 208,
+ 152, 242, 74, 219, 88, 208, 152, 232, 80, 201, 63, 59, 5, 234, 188, 59,
+ 5, 234, 184, 59, 5, 229, 215, 59, 5, 193, 114, 59, 5, 193, 113, 59, 5,
+ 210, 49, 59, 5, 248, 195, 59, 5, 249, 1, 59, 5, 217, 3, 59, 5, 221, 16,
+ 59, 5, 216, 132, 59, 5, 231, 178, 59, 5, 233, 52, 59, 5, 195, 148, 59, 5,
+ 199, 121, 59, 5, 199, 31, 59, 5, 237, 58, 59, 5, 237, 55, 59, 5, 219,
+ 228, 59, 5, 207, 84, 59, 5, 237, 131, 59, 5, 214, 153, 59, 5, 205, 50,
+ 59, 5, 203, 111, 59, 5, 191, 84, 59, 5, 191, 61, 59, 5, 247, 34, 59, 5,
+ 223, 8, 59, 5, 213, 148, 59, 5, 192, 77, 59, 5, 222, 13, 59, 5, 214, 41,
+ 59, 5, 231, 157, 59, 5, 216, 211, 59, 5, 214, 110, 59, 5, 212, 89, 59, 5,
+ 68, 59, 5, 223, 162, 59, 5, 229, 158, 59, 5, 229, 128, 59, 5, 193, 86,
+ 59, 5, 193, 68, 59, 5, 209, 185, 59, 5, 248, 193, 59, 5, 248, 188, 59, 5,
+ 216, 252, 59, 5, 221, 13, 59, 5, 216, 129, 59, 5, 231, 174, 59, 5, 233,
+ 23, 59, 5, 195, 69, 59, 5, 198, 193, 59, 5, 199, 11, 59, 5, 237, 50, 59,
+ 5, 237, 54, 59, 5, 219, 146, 59, 5, 207, 1, 59, 5, 237, 44, 59, 5, 214,
+ 147, 59, 5, 202, 222, 59, 5, 203, 81, 59, 5, 191, 30, 59, 5, 191, 57, 59,
+ 5, 243, 29, 59, 5, 222, 244, 59, 5, 213, 141, 59, 5, 192, 33, 59, 5, 221,
+ 166, 59, 5, 214, 33, 59, 5, 231, 53, 59, 5, 216, 100, 59, 5, 213, 219,
+ 59, 5, 212, 81, 59, 5, 65, 59, 5, 251, 132, 59, 5, 214, 63, 59, 5, 140,
+ 59, 5, 230, 56, 59, 5, 193, 190, 59, 5, 193, 164, 59, 5, 168, 59, 5, 248,
+ 203, 59, 5, 249, 153, 59, 5, 217, 11, 59, 5, 221, 21, 59, 5, 221, 19, 59,
+ 5, 216, 136, 59, 5, 231, 182, 59, 5, 233, 109, 59, 5, 195, 188, 59, 5,
+ 190, 190, 59, 5, 199, 49, 59, 5, 237, 68, 59, 5, 237, 57, 59, 5, 173, 59,
+ 5, 165, 59, 5, 238, 32, 59, 5, 214, 162, 59, 5, 188, 59, 5, 203, 165, 59,
+ 5, 191, 123, 59, 5, 191, 71, 59, 5, 247, 160, 59, 5, 223, 32, 59, 5, 213,
+ 157, 59, 5, 170, 59, 5, 155, 59, 5, 222, 87, 59, 5, 214, 47, 59, 5, 231,
+ 240, 59, 5, 174, 59, 5, 180, 59, 5, 212, 101, 59, 5, 211, 87, 59, 5, 211,
+ 82, 59, 5, 228, 252, 59, 5, 193, 29, 59, 5, 193, 25, 59, 5, 209, 37, 59,
+ 5, 248, 191, 59, 5, 248, 97, 59, 5, 216, 247, 59, 5, 221, 11, 59, 5, 216,
+ 125, 59, 5, 231, 170, 59, 5, 232, 162, 59, 5, 195, 8, 59, 5, 198, 59, 59,
+ 5, 198, 235, 59, 5, 237, 47, 59, 5, 237, 52, 59, 5, 219, 8, 59, 5, 206,
+ 134, 59, 5, 236, 146, 59, 5, 214, 134, 59, 5, 202, 16, 59, 5, 203, 48,
+ 59, 5, 191, 4, 59, 5, 191, 52, 59, 5, 239, 18, 59, 5, 222, 191, 59, 5,
+ 213, 131, 59, 5, 191, 246, 59, 5, 221, 41, 59, 5, 214, 31, 59, 5, 230,
+ 245, 59, 5, 215, 211, 59, 5, 213, 26, 59, 5, 212, 62, 59, 5, 66, 59, 5,
+ 196, 113, 59, 5, 228, 159, 59, 5, 228, 142, 59, 5, 193, 0, 59, 5, 192,
+ 249, 59, 5, 208, 165, 59, 5, 248, 190, 59, 5, 248, 10, 59, 5, 216, 246,
+ 59, 5, 221, 9, 59, 5, 216, 124, 59, 5, 231, 169, 59, 5, 232, 86, 59, 5,
+ 193, 249, 59, 5, 197, 94, 59, 5, 198, 213, 59, 5, 237, 45, 59, 5, 237,
+ 51, 59, 5, 218, 225, 59, 5, 206, 68, 59, 5, 235, 89, 59, 5, 214, 129, 59,
+ 5, 201, 4, 59, 5, 203, 5, 59, 5, 190, 251, 59, 5, 191, 48, 59, 5, 238,
+ 195, 59, 5, 222, 182, 59, 5, 213, 127, 59, 5, 191, 225, 59, 5, 220, 232,
+ 59, 5, 214, 30, 59, 5, 230, 179, 59, 5, 215, 155, 59, 5, 212, 178, 59, 5,
+ 212, 58, 59, 5, 74, 59, 5, 211, 104, 59, 5, 213, 245, 59, 5, 229, 23, 59,
+ 5, 228, 255, 59, 5, 193, 48, 59, 5, 193, 30, 59, 5, 209, 73, 59, 5, 248,
+ 192, 59, 5, 248, 111, 59, 5, 216, 248, 59, 5, 221, 12, 59, 5, 216, 127,
+ 59, 5, 231, 172, 59, 5, 231, 171, 59, 5, 232, 175, 59, 5, 195, 24, 59, 5,
+ 159, 59, 5, 198, 241, 59, 5, 237, 48, 59, 5, 237, 53, 59, 5, 219, 43, 59,
+ 5, 206, 162, 59, 5, 236, 174, 59, 5, 214, 138, 59, 5, 202, 46, 59, 5,
+ 203, 56, 59, 5, 191, 7, 59, 5, 191, 54, 59, 5, 242, 99, 59, 5, 222, 201,
+ 59, 5, 213, 132, 59, 5, 192, 12, 59, 5, 221, 67, 59, 5, 214, 32, 59, 5,
+ 231, 3, 59, 5, 216, 12, 59, 5, 213, 43, 59, 5, 212, 65, 59, 5, 71, 59, 5,
+ 234, 103, 59, 5, 214, 52, 59, 5, 229, 245, 59, 5, 229, 198, 59, 5, 193,
+ 125, 59, 5, 193, 108, 59, 5, 210, 63, 59, 5, 248, 196, 59, 5, 249, 17,
+ 59, 5, 217, 4, 59, 5, 221, 17, 59, 5, 221, 15, 59, 5, 216, 133, 59, 5,
+ 231, 179, 59, 5, 231, 177, 59, 5, 233, 59, 59, 5, 195, 153, 59, 5, 199,
+ 145, 59, 5, 199, 33, 59, 5, 237, 59, 59, 5, 237, 56, 59, 5, 219, 238, 59,
+ 5, 207, 113, 59, 5, 237, 146, 59, 5, 214, 154, 59, 5, 205, 68, 59, 5,
+ 203, 113, 59, 5, 191, 87, 59, 5, 191, 62, 59, 5, 247, 42, 59, 5, 223, 10,
+ 59, 5, 213, 150, 59, 5, 192, 80, 59, 5, 222, 22, 59, 5, 214, 42, 59, 5,
+ 214, 38, 59, 5, 231, 165, 59, 5, 231, 151, 59, 5, 216, 232, 59, 5, 214,
+ 121, 59, 5, 212, 90, 59, 5, 214, 70, 59, 5, 219, 190, 59, 242, 74, 59,
+ 232, 80, 201, 63, 59, 208, 13, 77, 59, 5, 214, 137, 233, 109, 59, 5, 214,
+ 137, 155, 59, 5, 214, 137, 202, 16, 59, 16, 233, 48, 59, 16, 222, 11, 59,
+ 16, 198, 140, 59, 16, 213, 186, 59, 16, 249, 95, 59, 16, 233, 108, 59,
+ 16, 199, 245, 59, 16, 237, 236, 59, 16, 236, 145, 59, 16, 220, 208, 59,
+ 16, 198, 63, 59, 16, 236, 173, 59, 16, 222, 192, 59, 17, 191, 77, 59, 17,
+ 107, 59, 17, 109, 59, 17, 138, 59, 17, 134, 59, 17, 149, 59, 17, 169, 59,
+ 17, 175, 59, 17, 171, 59, 17, 178, 59, 5, 214, 137, 174, 59, 5, 214, 137,
+ 236, 174, 38, 6, 1, 191, 81, 38, 2, 1, 191, 81, 38, 6, 1, 235, 30, 38, 2,
+ 1, 235, 30, 38, 6, 1, 207, 18, 235, 32, 38, 2, 1, 207, 18, 235, 32, 38,
+ 6, 1, 223, 83, 38, 2, 1, 223, 83, 38, 6, 1, 236, 191, 38, 2, 1, 236, 191,
+ 38, 6, 1, 215, 219, 196, 128, 38, 2, 1, 215, 219, 196, 128, 38, 6, 1,
+ 248, 24, 211, 110, 38, 2, 1, 248, 24, 211, 110, 38, 6, 1, 214, 82, 192,
+ 62, 38, 2, 1, 214, 82, 192, 62, 38, 6, 1, 192, 59, 4, 249, 147, 192, 62,
+ 38, 2, 1, 192, 59, 4, 249, 147, 192, 62, 38, 6, 1, 223, 81, 192, 95, 38,
+ 2, 1, 223, 81, 192, 95, 38, 6, 1, 207, 18, 191, 225, 38, 2, 1, 207, 18,
+ 191, 225, 38, 6, 1, 223, 81, 65, 38, 2, 1, 223, 81, 65, 38, 6, 1, 242,
+ 219, 219, 83, 191, 190, 38, 2, 1, 242, 219, 219, 83, 191, 190, 38, 6, 1,
+ 248, 131, 191, 190, 38, 2, 1, 248, 131, 191, 190, 38, 6, 1, 223, 81, 242,
+ 219, 219, 83, 191, 190, 38, 2, 1, 223, 81, 242, 219, 219, 83, 191, 190,
+ 38, 6, 1, 192, 14, 38, 2, 1, 192, 14, 38, 6, 1, 207, 18, 197, 161, 38, 2,
+ 1, 207, 18, 197, 161, 38, 6, 1, 202, 32, 237, 146, 38, 2, 1, 202, 32,
+ 237, 146, 38, 6, 1, 202, 32, 234, 140, 38, 2, 1, 202, 32, 234, 140, 38,
+ 6, 1, 202, 32, 234, 114, 38, 2, 1, 202, 32, 234, 114, 38, 6, 1, 215, 223,
+ 74, 38, 2, 1, 215, 223, 74, 38, 6, 1, 248, 164, 74, 38, 2, 1, 248, 164,
+ 74, 38, 6, 1, 55, 215, 223, 74, 38, 2, 1, 55, 215, 223, 74, 38, 1, 215,
+ 130, 74, 33, 38, 193, 226, 33, 38, 199, 96, 216, 48, 56, 33, 38, 228,
+ 141, 216, 48, 56, 33, 38, 198, 230, 216, 48, 56, 202, 95, 250, 193, 33,
+ 38, 1, 196, 125, 223, 226, 33, 38, 1, 68, 33, 38, 1, 192, 33, 33, 38, 1,
+ 66, 33, 38, 1, 230, 17, 56, 33, 38, 1, 192, 58, 33, 38, 1, 202, 32, 56,
+ 33, 38, 1, 211, 110, 33, 38, 222, 35, 33, 38, 210, 70, 38, 222, 35, 38,
+ 210, 70, 38, 6, 1, 235, 45, 38, 2, 1, 235, 45, 38, 6, 1, 235, 21, 38, 2,
+ 1, 235, 21, 38, 6, 1, 191, 38, 38, 2, 1, 191, 38, 38, 6, 1, 247, 58, 38,
+ 2, 1, 247, 58, 38, 6, 1, 235, 17, 38, 2, 1, 235, 17, 38, 6, 1, 199, 146,
+ 4, 82, 102, 38, 2, 1, 199, 146, 4, 82, 102, 38, 6, 1, 197, 41, 38, 2, 1,
+ 197, 41, 38, 6, 1, 197, 136, 38, 2, 1, 197, 136, 38, 6, 1, 197, 141, 38,
+ 2, 1, 197, 141, 38, 6, 1, 199, 151, 38, 2, 1, 199, 151, 38, 6, 1, 228,
+ 122, 38, 2, 1, 228, 122, 38, 6, 1, 202, 237, 38, 2, 1, 202, 237, 38, 6,
+ 1, 55, 74, 38, 2, 1, 55, 74, 38, 6, 1, 238, 214, 74, 38, 2, 1, 238, 214,
+ 74, 52, 1, 38, 230, 17, 56, 52, 1, 38, 202, 32, 56, 33, 38, 1, 234, 181,
+ 33, 38, 1, 223, 81, 71, 26, 1, 65, 26, 1, 155, 26, 1, 66, 26, 1, 220,
+ 232, 26, 1, 234, 188, 26, 1, 207, 84, 26, 1, 199, 226, 26, 1, 74, 26, 1,
+ 212, 81, 26, 1, 68, 26, 1, 173, 26, 1, 168, 26, 1, 206, 195, 26, 1, 206,
+ 242, 26, 1, 219, 227, 26, 1, 216, 210, 26, 1, 199, 245, 26, 1, 214, 160,
+ 26, 1, 213, 155, 26, 1, 218, 168, 26, 1, 200, 160, 26, 1, 215, 155, 26,
+ 1, 203, 76, 26, 1, 202, 222, 26, 1, 203, 86, 26, 1, 203, 248, 26, 1, 220,
+ 149, 26, 1, 221, 241, 26, 1, 212, 146, 26, 1, 212, 178, 26, 1, 213, 126,
+ 26, 1, 191, 243, 26, 1, 203, 5, 26, 1, 191, 194, 26, 1, 170, 26, 1, 212,
+ 215, 26, 1, 221, 227, 26, 1, 209, 232, 26, 1, 213, 148, 26, 1, 212, 195,
+ 26, 1, 208, 156, 26, 1, 192, 253, 26, 1, 210, 49, 26, 1, 233, 52, 26, 1,
+ 206, 68, 26, 1, 218, 225, 26, 1, 216, 100, 26, 1, 213, 219, 26, 1, 207,
+ 20, 26, 1, 207, 163, 26, 1, 221, 251, 26, 1, 213, 252, 26, 1, 214, 47,
+ 26, 1, 214, 68, 26, 1, 203, 56, 26, 1, 208, 161, 26, 1, 232, 86, 26, 1,
+ 232, 167, 26, 1, 193, 190, 26, 1, 180, 26, 1, 219, 146, 26, 1, 209, 185,
+ 26, 1, 219, 0, 26, 1, 221, 67, 26, 1, 217, 1, 26, 1, 207, 55, 26, 1, 216,
+ 186, 26, 1, 174, 26, 1, 198, 193, 26, 1, 221, 166, 26, 1, 216, 12, 26, 1,
+ 217, 9, 26, 1, 199, 73, 26, 1, 221, 21, 26, 1, 199, 95, 26, 1, 212, 181,
+ 26, 1, 205, 150, 26, 1, 233, 105, 26, 1, 221, 24, 26, 1, 221, 57, 26, 33,
+ 87, 221, 34, 26, 33, 87, 197, 79, 26, 213, 154, 26, 232, 80, 201, 63, 26,
+ 242, 83, 26, 242, 74, 26, 204, 25, 26, 208, 13, 77, 52, 1, 243, 80, 163,
+ 192, 22, 209, 132, 52, 1, 243, 80, 163, 192, 107, 209, 132, 52, 1, 243,
+ 80, 163, 192, 22, 203, 137, 52, 1, 243, 80, 163, 192, 107, 203, 137, 52,
+ 1, 243, 80, 163, 192, 22, 208, 33, 52, 1, 243, 80, 163, 192, 107, 208,
+ 33, 52, 1, 243, 80, 163, 192, 22, 206, 68, 52, 1, 243, 80, 163, 192, 107,
+ 206, 68, 52, 1, 233, 200, 235, 138, 163, 164, 52, 1, 137, 235, 138, 163,
+ 164, 52, 1, 216, 87, 235, 138, 163, 164, 52, 1, 130, 235, 138, 163, 164,
+ 52, 1, 233, 199, 235, 138, 163, 164, 52, 1, 233, 200, 235, 138, 219, 216,
+ 163, 164, 52, 1, 137, 235, 138, 219, 216, 163, 164, 52, 1, 216, 87, 235,
+ 138, 219, 216, 163, 164, 52, 1, 130, 235, 138, 219, 216, 163, 164, 52, 1,
+ 233, 199, 235, 138, 219, 216, 163, 164, 52, 1, 233, 200, 219, 216, 163,
+ 164, 52, 1, 137, 219, 216, 163, 164, 52, 1, 216, 87, 219, 216, 163, 164,
+ 52, 1, 130, 219, 216, 163, 164, 52, 1, 233, 199, 219, 216, 163, 164, 52,
+ 1, 75, 81, 164, 52, 1, 75, 202, 97, 52, 1, 75, 228, 241, 164, 52, 1, 110,
+ 50, 239, 2, 251, 115, 52, 1, 207, 147, 133, 57, 52, 1, 207, 147, 144, 57,
+ 52, 1, 207, 147, 233, 216, 77, 52, 1, 207, 147, 223, 93, 233, 216, 77,
+ 52, 1, 130, 223, 93, 233, 216, 77, 52, 1, 201, 38, 23, 137, 198, 79, 52,
+ 1, 201, 38, 23, 130, 198, 79, 8, 6, 1, 234, 175, 251, 192, 8, 2, 1, 234,
+ 175, 251, 192, 8, 6, 1, 234, 175, 251, 230, 8, 2, 1, 234, 175, 251, 230,
+ 8, 6, 1, 229, 196, 8, 2, 1, 229, 196, 8, 6, 1, 196, 241, 8, 2, 1, 196,
+ 241, 8, 6, 1, 197, 248, 8, 2, 1, 197, 248, 8, 6, 1, 238, 192, 8, 2, 1,
+ 238, 192, 8, 6, 1, 238, 193, 4, 242, 74, 8, 2, 1, 238, 193, 4, 242, 74,
+ 8, 1, 2, 6, 233, 175, 8, 1, 2, 6, 206, 8, 8, 6, 1, 252, 206, 8, 2, 1,
+ 252, 206, 8, 6, 1, 251, 68, 8, 2, 1, 251, 68, 8, 6, 1, 250, 163, 8, 2, 1,
+ 250, 163, 8, 6, 1, 250, 146, 8, 2, 1, 250, 146, 8, 6, 1, 250, 147, 4,
+ 228, 241, 164, 8, 2, 1, 250, 147, 4, 228, 241, 164, 8, 6, 1, 250, 131, 8,
+ 2, 1, 250, 131, 8, 6, 1, 207, 18, 247, 194, 4, 236, 140, 8, 2, 1, 207,
+ 18, 247, 194, 4, 236, 140, 8, 6, 1, 222, 153, 4, 106, 8, 2, 1, 222, 153,
+ 4, 106, 8, 6, 1, 222, 153, 4, 237, 39, 106, 8, 2, 1, 222, 153, 4, 237,
+ 39, 106, 8, 6, 1, 222, 153, 4, 201, 28, 23, 237, 39, 106, 8, 2, 1, 222,
+ 153, 4, 201, 28, 23, 237, 39, 106, 8, 6, 1, 248, 22, 172, 8, 2, 1, 248,
+ 22, 172, 8, 6, 1, 220, 143, 4, 137, 106, 8, 2, 1, 220, 143, 4, 137, 106,
+ 8, 6, 1, 187, 4, 179, 201, 28, 210, 255, 8, 2, 1, 187, 4, 179, 201, 28,
+ 210, 255, 8, 6, 1, 187, 4, 219, 4, 8, 2, 1, 187, 4, 219, 4, 8, 6, 1, 211,
+ 87, 8, 2, 1, 211, 87, 8, 6, 1, 210, 237, 4, 201, 28, 198, 216, 237, 87,
+ 8, 2, 1, 210, 237, 4, 201, 28, 198, 216, 237, 87, 8, 6, 1, 210, 237, 4,
+ 232, 188, 8, 2, 1, 210, 237, 4, 232, 188, 8, 6, 1, 210, 237, 4, 201, 182,
+ 199, 215, 8, 2, 1, 210, 237, 4, 201, 182, 199, 215, 8, 6, 1, 208, 105, 4,
+ 201, 28, 198, 216, 237, 87, 8, 2, 1, 208, 105, 4, 201, 28, 198, 216, 237,
+ 87, 8, 6, 1, 208, 105, 4, 237, 39, 106, 8, 2, 1, 208, 105, 4, 237, 39,
+ 106, 8, 6, 1, 207, 222, 206, 116, 8, 2, 1, 207, 222, 206, 116, 8, 6, 1,
+ 206, 49, 206, 116, 8, 2, 1, 206, 49, 206, 116, 8, 6, 1, 196, 13, 4, 237,
+ 39, 106, 8, 2, 1, 196, 13, 4, 237, 39, 106, 8, 6, 1, 193, 235, 8, 2, 1,
+ 193, 235, 8, 6, 1, 195, 33, 191, 166, 8, 2, 1, 195, 33, 191, 166, 8, 6,
+ 1, 198, 234, 4, 106, 8, 2, 1, 198, 234, 4, 106, 8, 6, 1, 198, 234, 4,
+ 201, 28, 198, 216, 237, 87, 8, 2, 1, 198, 234, 4, 201, 28, 198, 216, 237,
+ 87, 8, 6, 1, 195, 142, 8, 2, 1, 195, 142, 8, 6, 1, 233, 255, 8, 2, 1,
+ 233, 255, 8, 6, 1, 223, 68, 8, 2, 1, 223, 68, 8, 6, 1, 239, 57, 8, 2, 1,
+ 239, 57, 52, 1, 196, 45, 8, 2, 1, 235, 77, 8, 2, 1, 218, 208, 8, 2, 1,
+ 215, 123, 8, 2, 1, 212, 137, 8, 2, 1, 206, 48, 8, 1, 2, 6, 206, 48, 8, 2,
+ 1, 197, 76, 8, 2, 1, 196, 120, 8, 6, 1, 223, 115, 238, 127, 8, 2, 1, 223,
+ 115, 238, 127, 8, 6, 1, 223, 115, 233, 175, 8, 2, 1, 223, 115, 233, 175,
+ 8, 6, 1, 223, 115, 232, 51, 8, 6, 1, 153, 223, 115, 232, 51, 8, 2, 1,
+ 153, 223, 115, 232, 51, 8, 6, 1, 153, 172, 8, 2, 1, 153, 172, 8, 6, 1,
+ 223, 115, 146, 8, 2, 1, 223, 115, 146, 8, 6, 1, 223, 115, 206, 8, 8, 2,
+ 1, 223, 115, 206, 8, 8, 6, 1, 223, 115, 200, 43, 8, 2, 1, 223, 115, 200,
+ 43, 52, 1, 130, 243, 2, 252, 60, 52, 1, 242, 83, 52, 1, 203, 40, 234, 43,
+ 56, 8, 6, 1, 205, 156, 8, 2, 1, 205, 156, 8, 6, 1, 153, 230, 116, 8, 2,
+ 1, 220, 143, 4, 207, 24, 228, 251, 23, 248, 231, 8, 1, 202, 163, 236,
+ 140, 8, 6, 1, 215, 62, 4, 237, 87, 8, 2, 1, 215, 62, 4, 237, 87, 8, 6, 1,
+ 247, 194, 4, 164, 8, 2, 1, 247, 194, 4, 164, 8, 2, 1, 247, 194, 4, 210,
+ 192, 102, 8, 2, 1, 230, 117, 4, 210, 192, 102, 8, 6, 1, 78, 4, 232, 188,
+ 8, 2, 1, 78, 4, 232, 188, 8, 6, 1, 233, 176, 4, 106, 8, 2, 1, 233, 176,
+ 4, 106, 8, 6, 1, 195, 15, 252, 25, 8, 2, 1, 195, 15, 252, 25, 8, 6, 1,
+ 195, 15, 211, 151, 8, 2, 1, 195, 15, 211, 151, 8, 6, 1, 195, 15, 196,
+ 152, 8, 2, 1, 195, 15, 196, 152, 8, 6, 1, 232, 52, 4, 211, 172, 106, 8,
+ 2, 1, 232, 52, 4, 211, 172, 106, 8, 6, 1, 222, 153, 4, 211, 172, 106, 8,
+ 2, 1, 222, 153, 4, 211, 172, 106, 8, 6, 1, 215, 62, 4, 211, 172, 106, 8,
+ 2, 1, 215, 62, 4, 211, 172, 106, 8, 6, 1, 207, 222, 4, 211, 172, 106, 8,
+ 2, 1, 207, 222, 4, 211, 172, 106, 8, 6, 1, 206, 9, 4, 211, 172, 106, 8,
+ 2, 1, 206, 9, 4, 211, 172, 106, 8, 6, 1, 230, 117, 4, 102, 8, 6, 1, 207,
+ 18, 211, 77, 71, 8, 6, 1, 27, 232, 51, 8, 6, 1, 220, 143, 4, 248, 231, 8,
+ 6, 1, 2, 6, 68, 8, 1, 2, 6, 208, 104, 8, 6, 1, 153, 222, 152, 8, 6, 1,
+ 153, 200, 43, 8, 6, 1, 223, 36, 4, 238, 212, 8, 6, 1, 243, 95, 8, 6, 1,
+ 248, 212, 8, 2, 1, 248, 212, 8, 6, 1, 211, 110, 8, 2, 1, 211, 110, 8, 6,
+ 1, 126, 4, 106, 8, 2, 1, 126, 4, 106, 8, 6, 1, 231, 11, 65, 8, 2, 1, 231,
+ 11, 65, 8, 6, 1, 231, 11, 68, 8, 2, 1, 231, 11, 68, 8, 6, 1, 231, 11, 66,
+ 8, 2, 1, 231, 11, 66, 8, 6, 1, 39, 209, 49, 74, 8, 2, 1, 39, 209, 49, 74,
+ 8, 6, 1, 251, 112, 193, 224, 8, 2, 1, 251, 112, 193, 224, 8, 6, 1, 247,
+ 194, 4, 210, 192, 102, 8, 6, 1, 206, 9, 4, 102, 8, 6, 1, 191, 167, 4,
+ 210, 192, 102, 8, 6, 1, 238, 128, 4, 203, 40, 201, 28, 210, 255, 8, 2, 1,
+ 238, 128, 4, 203, 40, 201, 28, 210, 255, 8, 6, 1, 206, 9, 4, 203, 40,
+ 201, 28, 210, 255, 8, 2, 1, 206, 9, 4, 203, 40, 201, 28, 210, 255, 8, 6,
+ 1, 242, 219, 223, 115, 232, 51, 8, 2, 1, 242, 219, 223, 115, 232, 51, 8,
+ 2, 1, 55, 198, 233, 8, 2, 1, 55, 192, 238, 8, 6, 1, 82, 205, 79, 206, 8,
+ 8, 2, 1, 82, 205, 79, 206, 8, 8, 6, 1, 202, 195, 206, 8, 8, 2, 1, 202,
+ 195, 206, 8, 52, 1, 6, 247, 193, 52, 1, 6, 233, 175, 52, 1, 6, 208, 104,
+ 8, 6, 1, 207, 18, 132, 230, 116, 8, 2, 1, 207, 18, 132, 230, 116, 8, 234,
+ 50, 1, 202, 206, 68, 52, 1, 6, 230, 117, 4, 106, 52, 1, 2, 34, 211, 151,
+ 8, 1, 2, 6, 153, 218, 168, 8, 234, 50, 1, 207, 18, 233, 175, 8, 234, 50,
+ 1, 207, 18, 210, 236, 8, 234, 50, 1, 223, 93, 218, 168, 8, 234, 50, 1,
+ 228, 74, 219, 10, 8, 234, 50, 1, 251, 14, 218, 168, 200, 124, 214, 238,
+ 1, 65, 200, 124, 214, 238, 1, 68, 200, 124, 214, 238, 3, 235, 54, 200,
+ 124, 214, 238, 1, 66, 200, 124, 214, 238, 1, 71, 200, 124, 214, 238, 1,
+ 74, 200, 124, 214, 238, 3, 230, 11, 200, 124, 214, 238, 1, 221, 67, 200,
+ 124, 214, 238, 1, 221, 183, 200, 124, 214, 238, 1, 231, 3, 200, 124, 214,
+ 238, 1, 231, 63, 200, 124, 214, 238, 3, 251, 71, 200, 124, 214, 238, 1,
+ 242, 99, 200, 124, 214, 238, 1, 243, 68, 200, 124, 214, 238, 1, 222, 201,
+ 200, 124, 214, 238, 1, 222, 246, 200, 124, 214, 238, 1, 197, 109, 200,
+ 124, 214, 238, 1, 197, 115, 200, 124, 214, 238, 1, 237, 161, 200, 124,
+ 214, 238, 1, 237, 170, 200, 124, 214, 238, 1, 159, 200, 124, 214, 238, 1,
+ 198, 241, 200, 124, 214, 238, 1, 236, 174, 200, 124, 214, 238, 1, 237,
+ 48, 200, 124, 214, 238, 1, 213, 43, 200, 124, 214, 238, 1, 209, 73, 200,
+ 124, 214, 238, 1, 209, 199, 200, 124, 214, 238, 1, 248, 111, 200, 124,
+ 214, 238, 1, 248, 192, 200, 124, 214, 238, 1, 216, 12, 200, 124, 214,
+ 238, 1, 206, 162, 200, 124, 214, 238, 1, 219, 43, 200, 124, 214, 238, 1,
+ 206, 95, 200, 124, 214, 238, 1, 202, 46, 200, 124, 214, 238, 1, 229, 23,
+ 200, 124, 214, 238, 18, 3, 65, 200, 124, 214, 238, 18, 3, 68, 200, 124,
+ 214, 238, 18, 3, 66, 200, 124, 214, 238, 18, 3, 71, 200, 124, 214, 238,
+ 18, 3, 211, 87, 200, 124, 214, 238, 209, 63, 217, 55, 200, 124, 214, 238,
+ 209, 63, 217, 54, 200, 124, 214, 238, 209, 63, 217, 53, 200, 124, 214,
+ 238, 209, 63, 217, 52, 200, 124, 214, 238, 3, 251, 157, 230, 11, 186,
+ 223, 146, 232, 118, 91, 208, 22, 186, 223, 146, 232, 118, 91, 230, 70,
+ 186, 223, 146, 232, 118, 115, 208, 20, 186, 223, 146, 232, 118, 91, 202,
+ 128, 186, 223, 146, 232, 118, 91, 234, 159, 186, 223, 146, 232, 118, 115,
+ 202, 125, 186, 223, 146, 208, 23, 77, 186, 223, 146, 209, 107, 77, 186,
+ 223, 146, 206, 36, 77, 186, 223, 146, 208, 25, 77, 209, 224, 1, 155, 209,
+ 224, 1, 221, 215, 209, 224, 1, 231, 240, 209, 224, 1, 214, 68, 209, 224,
+ 1, 247, 160, 209, 224, 1, 247, 1, 209, 224, 1, 223, 32, 209, 224, 1, 212,
+ 101, 209, 224, 1, 190, 190, 209, 224, 1, 199, 49, 209, 224, 1, 238, 32,
+ 209, 224, 1, 180, 209, 224, 1, 168, 209, 224, 1, 209, 228, 209, 224, 1,
+ 249, 153, 209, 224, 1, 174, 209, 224, 1, 197, 168, 209, 224, 1, 197, 157,
+ 209, 224, 1, 235, 35, 209, 224, 1, 193, 190, 209, 224, 1, 191, 71, 209,
+ 224, 1, 191, 123, 209, 224, 1, 2, 65, 209, 224, 1, 170, 209, 224, 1, 165,
+ 209, 224, 1, 173, 209, 224, 1, 203, 165, 209, 224, 1, 188, 209, 224, 1,
+ 140, 209, 224, 1, 65, 209, 224, 1, 68, 209, 224, 1, 66, 209, 224, 1, 71,
+ 209, 224, 1, 74, 209, 224, 1, 208, 96, 209, 224, 1, 192, 220, 209, 224,
+ 1, 233, 109, 209, 224, 1, 231, 127, 209, 224, 1, 234, 188, 209, 224, 200,
+ 239, 1, 193, 190, 209, 224, 200, 239, 1, 170, 209, 224, 1, 197, 132, 209,
+ 224, 1, 197, 120, 209, 224, 1, 237, 191, 209, 224, 1, 213, 79, 209, 224,
+ 1, 251, 157, 170, 209, 224, 1, 195, 19, 203, 165, 209, 224, 1, 195, 20,
+ 140, 209, 224, 1, 250, 200, 233, 109, 209, 224, 200, 239, 1, 165, 209,
+ 224, 200, 185, 1, 165, 209, 224, 1, 247, 119, 209, 224, 202, 170, 229,
+ 236, 77, 209, 224, 55, 229, 236, 77, 209, 224, 87, 203, 157, 209, 224,
+ 87, 55, 203, 157, 205, 111, 3, 251, 71, 205, 111, 3, 195, 35, 205, 111,
+ 1, 65, 205, 111, 1, 252, 206, 205, 111, 1, 68, 205, 111, 1, 223, 199,
+ 205, 111, 1, 66, 205, 111, 1, 196, 30, 205, 111, 1, 117, 146, 205, 111,
+ 1, 117, 206, 110, 205, 111, 1, 117, 172, 205, 111, 1, 117, 219, 74, 205,
+ 111, 1, 71, 205, 111, 1, 234, 188, 205, 111, 1, 251, 236, 205, 111, 1,
+ 74, 205, 111, 1, 211, 87, 205, 111, 1, 250, 163, 205, 111, 1, 155, 205,
+ 111, 1, 221, 215, 205, 111, 1, 231, 240, 205, 111, 1, 231, 91, 205, 111,
+ 1, 214, 68, 205, 111, 1, 247, 160, 205, 111, 1, 247, 1, 205, 111, 1, 223,
+ 32, 205, 111, 1, 222, 252, 205, 111, 1, 212, 101, 205, 111, 1, 197, 132,
+ 205, 111, 1, 197, 120, 205, 111, 1, 237, 191, 205, 111, 1, 237, 175, 205,
+ 111, 1, 213, 79, 205, 111, 1, 190, 190, 205, 111, 1, 199, 49, 205, 111,
+ 1, 238, 32, 205, 111, 1, 237, 68, 205, 111, 1, 180, 205, 111, 1, 168,
+ 205, 111, 1, 209, 228, 205, 111, 1, 249, 153, 205, 111, 1, 248, 203, 205,
+ 111, 1, 174, 205, 111, 1, 170, 205, 111, 1, 165, 205, 111, 1, 173, 205,
+ 111, 1, 195, 188, 205, 111, 1, 203, 165, 205, 111, 1, 201, 175, 205, 111,
+ 1, 188, 205, 111, 1, 140, 205, 111, 1, 219, 73, 205, 111, 120, 3, 230,
+ 89, 205, 111, 18, 3, 252, 206, 205, 111, 18, 3, 68, 205, 111, 18, 3, 223,
+ 199, 205, 111, 18, 3, 66, 205, 111, 18, 3, 196, 30, 205, 111, 18, 3, 117,
+ 146, 205, 111, 18, 3, 117, 206, 110, 205, 111, 18, 3, 117, 172, 205, 111,
+ 18, 3, 117, 219, 74, 205, 111, 18, 3, 71, 205, 111, 18, 3, 234, 188, 205,
+ 111, 18, 3, 251, 236, 205, 111, 18, 3, 74, 205, 111, 18, 3, 211, 87, 205,
+ 111, 18, 3, 250, 163, 205, 111, 3, 195, 40, 205, 111, 3, 247, 119, 205,
+ 111, 237, 238, 205, 111, 55, 237, 238, 205, 111, 17, 191, 77, 205, 111,
+ 17, 107, 205, 111, 17, 109, 205, 111, 17, 138, 205, 111, 17, 134, 205,
+ 111, 17, 149, 205, 111, 17, 169, 205, 111, 17, 175, 205, 111, 17, 171,
+ 205, 111, 17, 178, 33, 100, 17, 191, 77, 33, 100, 17, 107, 33, 100, 17,
+ 109, 33, 100, 17, 138, 33, 100, 17, 134, 33, 100, 17, 149, 33, 100, 17,
+ 169, 33, 100, 17, 175, 33, 100, 17, 171, 33, 100, 17, 178, 33, 100, 1,
+ 65, 33, 100, 1, 66, 33, 100, 1, 155, 33, 100, 1, 180, 33, 100, 1, 168,
+ 33, 100, 1, 165, 33, 100, 1, 195, 69, 33, 100, 3, 250, 145, 100, 3, 201,
+ 246, 247, 119, 100, 3, 247, 120, 195, 40, 100, 3, 55, 247, 120, 195, 40,
+ 100, 3, 247, 120, 109, 100, 3, 247, 120, 138, 100, 3, 247, 120, 250, 145,
+ 100, 3, 208, 134, 100, 231, 204, 233, 3, 100, 247, 96, 100, 229, 227,
+ 100, 3, 202, 210, 100, 223, 24, 211, 113, 100, 1, 250, 131, 100, 18, 3,
+ 250, 131, 222, 28, 219, 147, 17, 191, 77, 222, 28, 219, 147, 17, 107,
+ 222, 28, 219, 147, 17, 109, 222, 28, 219, 147, 17, 138, 222, 28, 219,
+ 147, 17, 134, 222, 28, 219, 147, 17, 149, 222, 28, 219, 147, 17, 169,
+ 222, 28, 219, 147, 17, 175, 222, 28, 219, 147, 17, 171, 222, 28, 219,
+ 147, 17, 178, 222, 28, 219, 147, 1, 155, 222, 28, 219, 147, 1, 221, 215,
+ 222, 28, 219, 147, 1, 231, 240, 222, 28, 219, 147, 1, 214, 68, 222, 28,
+ 219, 147, 1, 188, 222, 28, 219, 147, 1, 203, 165, 222, 28, 219, 147, 1,
+ 191, 123, 222, 28, 219, 147, 1, 212, 101, 222, 28, 219, 147, 1, 190, 190,
+ 222, 28, 219, 147, 1, 228, 164, 222, 28, 219, 147, 1, 180, 222, 28, 219,
+ 147, 1, 168, 222, 28, 219, 147, 1, 209, 228, 222, 28, 219, 147, 1, 174,
+ 222, 28, 219, 147, 1, 238, 32, 222, 28, 219, 147, 1, 249, 153, 222, 28,
+ 219, 147, 1, 165, 222, 28, 219, 147, 1, 170, 222, 28, 219, 147, 1, 173,
+ 222, 28, 219, 147, 1, 193, 190, 222, 28, 219, 147, 1, 199, 49, 222, 28,
+ 219, 147, 1, 140, 222, 28, 219, 147, 1, 195, 188, 222, 28, 219, 147, 1,
+ 247, 160, 222, 28, 219, 147, 1, 65, 222, 28, 219, 147, 1, 211, 151, 222,
+ 28, 219, 147, 1, 68, 222, 28, 219, 147, 1, 211, 87, 222, 28, 219, 147,
+ 18, 196, 152, 222, 28, 219, 147, 18, 71, 222, 28, 219, 147, 18, 66, 222,
+ 28, 219, 147, 18, 234, 188, 222, 28, 219, 147, 18, 74, 222, 28, 219, 147,
+ 163, 209, 90, 222, 28, 219, 147, 163, 247, 135, 222, 28, 219, 147, 163,
+ 247, 136, 209, 90, 222, 28, 219, 147, 3, 238, 147, 222, 28, 219, 147, 3,
+ 202, 230, 207, 67, 1, 155, 207, 67, 1, 231, 240, 207, 67, 1, 214, 68,
+ 207, 67, 1, 190, 190, 207, 67, 1, 238, 32, 207, 67, 1, 180, 207, 67, 1,
+ 168, 207, 67, 1, 249, 153, 207, 67, 1, 174, 207, 67, 1, 247, 160, 207,
+ 67, 1, 223, 32, 207, 67, 1, 212, 101, 207, 67, 1, 188, 207, 67, 1, 165,
+ 207, 67, 1, 173, 207, 67, 1, 170, 207, 67, 1, 193, 190, 207, 67, 1, 140,
+ 207, 67, 1, 217, 11, 207, 67, 1, 214, 47, 207, 67, 1, 214, 162, 207, 67,
+ 1, 212, 66, 207, 67, 1, 65, 207, 67, 18, 3, 68, 207, 67, 18, 3, 66, 207,
+ 67, 18, 3, 71, 207, 67, 18, 3, 251, 236, 207, 67, 18, 3, 74, 207, 67, 18,
+ 3, 250, 163, 207, 67, 18, 3, 233, 242, 207, 67, 18, 3, 234, 217, 207, 67,
+ 120, 3, 214, 70, 207, 67, 120, 3, 215, 61, 207, 67, 120, 3, 146, 207, 67,
+ 120, 3, 230, 116, 207, 67, 195, 40, 207, 67, 205, 54, 77, 30, 147, 198,
+ 164, 30, 147, 198, 163, 30, 147, 198, 161, 30, 147, 198, 166, 30, 147,
+ 206, 234, 30, 147, 206, 218, 30, 147, 206, 213, 30, 147, 206, 215, 30,
+ 147, 206, 231, 30, 147, 206, 224, 30, 147, 206, 217, 30, 147, 206, 236,
+ 30, 147, 206, 219, 30, 147, 206, 238, 30, 147, 206, 235, 30, 147, 216,
+ 73, 30, 147, 216, 64, 30, 147, 216, 67, 30, 147, 209, 154, 30, 147, 209,
+ 165, 30, 147, 209, 166, 30, 147, 201, 159, 30, 147, 223, 212, 30, 147,
+ 223, 219, 30, 147, 201, 170, 30, 147, 201, 157, 30, 147, 209, 208, 30,
+ 147, 229, 137, 30, 147, 201, 154, 223, 16, 3, 210, 143, 223, 16, 3, 247,
+ 39, 223, 16, 3, 219, 246, 223, 16, 3, 193, 71, 223, 16, 1, 65, 223, 16,
+ 1, 228, 74, 222, 32, 223, 16, 1, 68, 223, 16, 1, 223, 199, 223, 16, 1,
+ 66, 223, 16, 1, 210, 221, 247, 9, 223, 16, 1, 214, 69, 219, 203, 223, 16,
+ 1, 214, 69, 219, 204, 207, 131, 223, 16, 1, 71, 223, 16, 1, 251, 236,
+ 223, 16, 1, 74, 223, 16, 1, 155, 223, 16, 1, 222, 142, 205, 124, 223, 16,
+ 1, 222, 142, 215, 107, 223, 16, 1, 231, 240, 223, 16, 1, 231, 241, 215,
+ 107, 223, 16, 1, 214, 68, 223, 16, 1, 247, 160, 223, 16, 1, 247, 161,
+ 215, 107, 223, 16, 1, 223, 32, 223, 16, 1, 212, 102, 215, 107, 223, 16,
+ 1, 223, 33, 217, 116, 223, 16, 1, 212, 101, 223, 16, 1, 197, 132, 223,
+ 16, 1, 197, 133, 217, 116, 223, 16, 1, 237, 191, 223, 16, 1, 237, 192,
+ 217, 116, 223, 16, 1, 215, 7, 215, 107, 223, 16, 1, 190, 190, 223, 16, 1,
+ 199, 252, 215, 107, 223, 16, 1, 238, 32, 223, 16, 1, 238, 33, 217, 116,
+ 223, 16, 1, 180, 223, 16, 1, 168, 223, 16, 1, 210, 221, 215, 107, 223,
+ 16, 1, 249, 153, 223, 16, 1, 249, 154, 215, 107, 223, 16, 1, 174, 223,
+ 16, 1, 170, 223, 16, 1, 165, 223, 16, 1, 207, 186, 251, 246, 223, 16, 1,
+ 173, 223, 16, 1, 193, 190, 223, 16, 1, 205, 207, 215, 107, 223, 16, 1,
+ 205, 207, 217, 116, 223, 16, 1, 188, 223, 16, 1, 140, 223, 16, 3, 247,
+ 40, 199, 100, 223, 16, 18, 3, 199, 175, 223, 16, 18, 3, 198, 84, 223, 16,
+ 18, 3, 192, 250, 223, 16, 18, 3, 192, 251, 216, 198, 223, 16, 18, 3, 200,
+ 208, 223, 16, 18, 3, 200, 209, 216, 185, 223, 16, 18, 3, 199, 201, 223,
+ 16, 18, 3, 236, 230, 215, 106, 223, 16, 18, 3, 210, 16, 223, 16, 120, 3,
+ 221, 244, 223, 16, 120, 3, 210, 31, 223, 16, 120, 3, 247, 145, 223, 16,
+ 210, 157, 223, 16, 45, 207, 40, 223, 16, 50, 207, 40, 223, 16, 210, 209,
+ 251, 124, 223, 16, 210, 209, 217, 137, 223, 16, 210, 209, 218, 212, 223,
+ 16, 210, 209, 193, 64, 223, 16, 210, 209, 210, 158, 223, 16, 210, 209,
+ 219, 104, 223, 16, 210, 209, 218, 204, 223, 16, 210, 209, 252, 36, 223,
+ 16, 210, 209, 252, 37, 252, 36, 223, 16, 210, 209, 209, 119, 223, 16,
+ 153, 210, 209, 209, 119, 223, 16, 210, 153, 223, 16, 17, 191, 77, 223,
+ 16, 17, 107, 223, 16, 17, 109, 223, 16, 17, 138, 223, 16, 17, 134, 223,
+ 16, 17, 149, 223, 16, 17, 169, 223, 16, 17, 175, 223, 16, 17, 171, 223,
+ 16, 17, 178, 223, 16, 210, 209, 198, 127, 197, 73, 223, 16, 210, 209,
+ 223, 64, 80, 1, 203, 139, 231, 91, 80, 1, 203, 139, 247, 1, 80, 1, 203,
+ 139, 222, 252, 80, 1, 203, 139, 213, 79, 80, 1, 203, 139, 248, 203, 80,
+ 3, 203, 139, 205, 108, 80, 52, 1, 203, 139, 207, 85, 80, 1, 54, 220, 95,
+ 212, 101, 80, 1, 54, 220, 95, 233, 109, 80, 1, 54, 220, 95, 231, 240, 80,
+ 1, 54, 220, 95, 231, 91, 80, 1, 54, 220, 95, 223, 32, 80, 1, 54, 220, 95,
+ 222, 252, 80, 1, 54, 220, 95, 237, 191, 80, 1, 54, 220, 95, 237, 175, 80,
+ 1, 54, 220, 95, 213, 79, 80, 54, 220, 95, 17, 191, 77, 80, 54, 220, 95,
+ 17, 107, 80, 54, 220, 95, 17, 109, 80, 54, 220, 95, 17, 138, 80, 54, 220,
+ 95, 17, 134, 80, 54, 220, 95, 17, 149, 80, 54, 220, 95, 17, 169, 80, 54,
+ 220, 95, 17, 175, 80, 54, 220, 95, 17, 171, 80, 54, 220, 95, 17, 178, 80,
+ 1, 54, 220, 95, 219, 73, 80, 1, 54, 220, 95, 238, 32, 80, 1, 54, 220, 95,
+ 237, 68, 80, 1, 54, 220, 95, 249, 153, 80, 1, 54, 220, 95, 248, 203, 246,
+ 250, 1, 65, 246, 250, 1, 68, 246, 250, 1, 66, 246, 250, 1, 71, 246, 250,
+ 1, 251, 236, 246, 250, 1, 74, 246, 250, 1, 155, 246, 250, 1, 221, 215,
+ 246, 250, 1, 231, 240, 246, 250, 1, 231, 91, 246, 250, 1, 213, 233, 246,
+ 250, 1, 214, 68, 246, 250, 1, 247, 1, 246, 250, 1, 243, 98, 246, 250, 1,
+ 223, 32, 246, 250, 1, 222, 252, 246, 250, 1, 213, 221, 246, 250, 1, 213,
+ 224, 246, 250, 1, 213, 222, 246, 250, 1, 190, 190, 246, 250, 1, 199, 49,
+ 246, 250, 1, 238, 32, 246, 250, 1, 237, 68, 246, 250, 1, 212, 144, 246,
+ 250, 1, 180, 246, 250, 1, 237, 191, 246, 250, 1, 168, 246, 250, 1, 208,
+ 250, 246, 250, 1, 209, 228, 246, 250, 1, 249, 153, 246, 250, 1, 248, 203,
+ 246, 250, 1, 215, 143, 246, 250, 1, 174, 246, 250, 1, 249, 53, 246, 250,
+ 1, 170, 246, 250, 1, 165, 246, 250, 1, 173, 246, 250, 1, 195, 188, 246,
+ 250, 1, 201, 175, 246, 250, 1, 188, 246, 250, 1, 140, 246, 250, 18, 3,
+ 252, 206, 246, 250, 18, 3, 68, 246, 250, 18, 3, 223, 199, 246, 250, 18,
+ 3, 234, 166, 246, 250, 18, 3, 66, 246, 250, 18, 3, 211, 151, 246, 250,
+ 18, 3, 74, 246, 250, 18, 3, 251, 236, 246, 250, 18, 3, 250, 163, 246,
+ 250, 18, 3, 196, 152, 246, 250, 120, 3, 170, 246, 250, 120, 3, 165, 246,
+ 250, 120, 3, 173, 246, 250, 120, 3, 193, 190, 246, 250, 1, 53, 222, 152,
+ 246, 250, 1, 53, 232, 51, 246, 250, 1, 53, 214, 70, 246, 250, 120, 3, 53,
+ 214, 70, 246, 250, 1, 53, 247, 3, 246, 250, 1, 53, 200, 43, 246, 250, 1,
+ 53, 215, 61, 246, 250, 1, 53, 210, 236, 246, 250, 1, 53, 192, 159, 246,
+ 250, 1, 53, 146, 246, 250, 1, 53, 172, 246, 250, 1, 53, 201, 178, 246,
+ 250, 120, 3, 53, 218, 168, 246, 250, 120, 3, 53, 230, 116, 246, 250, 17,
+ 191, 77, 246, 250, 17, 107, 246, 250, 17, 109, 246, 250, 17, 138, 246,
+ 250, 17, 134, 246, 250, 17, 149, 246, 250, 17, 169, 246, 250, 17, 175,
+ 246, 250, 17, 171, 246, 250, 17, 178, 246, 250, 208, 152, 201, 217, 246,
+ 250, 208, 152, 237, 238, 246, 250, 208, 152, 55, 237, 238, 246, 250, 208,
+ 152, 197, 225, 237, 238, 80, 1, 221, 206, 231, 240, 80, 1, 221, 206, 247,
+ 160, 80, 1, 221, 206, 247, 1, 80, 1, 221, 206, 223, 32, 80, 1, 221, 206,
+ 222, 252, 80, 1, 221, 206, 212, 101, 80, 1, 221, 206, 197, 132, 80, 1,
+ 221, 206, 197, 120, 80, 1, 221, 206, 237, 191, 80, 1, 221, 206, 237, 175,
+ 80, 1, 221, 206, 237, 68, 80, 1, 221, 206, 180, 80, 1, 221, 206, 188, 80,
+ 1, 221, 206, 140, 80, 1, 221, 206, 229, 177, 80, 1, 221, 206, 233, 109,
+ 80, 52, 1, 221, 206, 207, 85, 80, 1, 221, 206, 192, 220, 80, 1, 221, 206,
+ 191, 123, 80, 1, 221, 206, 165, 80, 219, 28, 221, 206, 211, 179, 80, 219,
+ 28, 221, 206, 208, 46, 80, 219, 28, 221, 206, 229, 78, 80, 16, 251, 222,
+ 233, 215, 80, 16, 251, 222, 107, 80, 16, 251, 222, 109, 80, 1, 251, 222,
+ 165, 80, 3, 210, 139, 222, 62, 198, 79, 80, 3, 54, 220, 95, 198, 77, 80,
+ 3, 54, 220, 95, 198, 74, 80, 1, 202, 238, 210, 189, 247, 1, 80, 1, 202,
+ 238, 210, 189, 203, 165, 54, 195, 59, 1, 130, 221, 67, 54, 195, 59, 1,
+ 137, 221, 67, 54, 195, 59, 1, 130, 221, 183, 54, 195, 59, 1, 137, 221,
+ 183, 54, 195, 59, 1, 130, 221, 192, 54, 195, 59, 1, 137, 221, 192, 54,
+ 195, 59, 1, 130, 231, 3, 54, 195, 59, 1, 137, 231, 3, 54, 195, 59, 1,
+ 130, 213, 249, 54, 195, 59, 1, 137, 213, 249, 54, 195, 59, 1, 130, 242,
+ 99, 54, 195, 59, 1, 137, 242, 99, 54, 195, 59, 1, 130, 243, 68, 54, 195,
+ 59, 1, 137, 243, 68, 54, 195, 59, 1, 130, 202, 46, 54, 195, 59, 1, 137,
+ 202, 46, 54, 195, 59, 1, 130, 212, 65, 54, 195, 59, 1, 137, 212, 65, 54,
+ 195, 59, 1, 130, 236, 174, 54, 195, 59, 1, 137, 236, 174, 54, 195, 59, 1,
+ 130, 159, 54, 195, 59, 1, 137, 159, 54, 195, 59, 1, 130, 198, 241, 54,
+ 195, 59, 1, 137, 198, 241, 54, 195, 59, 1, 130, 213, 43, 54, 195, 59, 1,
+ 137, 213, 43, 54, 195, 59, 1, 130, 248, 111, 54, 195, 59, 1, 137, 248,
+ 111, 54, 195, 59, 1, 130, 209, 73, 54, 195, 59, 1, 137, 209, 73, 54, 195,
+ 59, 1, 130, 209, 199, 54, 195, 59, 1, 137, 209, 199, 54, 195, 59, 1, 130,
+ 232, 175, 54, 195, 59, 1, 137, 232, 175, 54, 195, 59, 1, 130, 216, 12,
+ 54, 195, 59, 1, 137, 216, 12, 54, 195, 59, 1, 130, 192, 12, 54, 195, 59,
+ 1, 137, 192, 12, 54, 195, 59, 1, 130, 206, 162, 54, 195, 59, 1, 137, 206,
+ 162, 54, 195, 59, 1, 130, 219, 43, 54, 195, 59, 1, 137, 219, 43, 54, 195,
+ 59, 1, 130, 195, 24, 54, 195, 59, 1, 137, 195, 24, 54, 195, 59, 1, 130,
+ 229, 23, 54, 195, 59, 1, 137, 229, 23, 54, 195, 59, 1, 130, 74, 54, 195,
+ 59, 1, 137, 74, 54, 195, 59, 217, 113, 222, 83, 54, 195, 59, 18, 252,
+ 206, 54, 195, 59, 18, 68, 54, 195, 59, 18, 196, 152, 54, 195, 59, 18, 66,
+ 54, 195, 59, 18, 71, 54, 195, 59, 18, 74, 54, 195, 59, 217, 113, 221,
+ 186, 54, 195, 59, 18, 228, 35, 54, 195, 59, 18, 196, 151, 54, 195, 59,
+ 18, 196, 168, 54, 195, 59, 18, 250, 161, 54, 195, 59, 18, 250, 131, 54,
+ 195, 59, 18, 251, 132, 54, 195, 59, 18, 251, 149, 54, 195, 59, 163, 217,
+ 113, 234, 147, 54, 195, 59, 163, 217, 113, 212, 143, 54, 195, 59, 163,
+ 217, 113, 198, 241, 54, 195, 59, 163, 217, 113, 202, 18, 54, 195, 59, 16,
+ 221, 44, 54, 195, 59, 16, 212, 143, 54, 195, 59, 16, 205, 152, 54, 195,
+ 59, 16, 229, 24, 229, 10, 54, 195, 59, 16, 221, 55, 221, 54, 216, 205,
+ 217, 18, 1, 71, 216, 205, 217, 18, 1, 74, 216, 205, 217, 18, 1, 247, 1,
+ 216, 205, 217, 18, 1, 212, 101, 216, 205, 217, 18, 1, 197, 132, 216, 205,
+ 217, 18, 1, 197, 120, 216, 205, 217, 18, 1, 237, 191, 216, 205, 217, 18,
+ 1, 237, 175, 216, 205, 217, 18, 1, 213, 79, 216, 205, 217, 18, 1, 203,
+ 165, 216, 205, 217, 18, 1, 201, 175, 216, 205, 217, 18, 18, 3, 223, 199,
+ 216, 205, 217, 18, 18, 3, 196, 30, 216, 205, 217, 18, 18, 3, 252, 170,
+ 216, 205, 217, 18, 18, 3, 250, 163, 216, 205, 217, 18, 18, 3, 252, 162,
+ 216, 205, 217, 18, 243, 116, 216, 205, 217, 18, 251, 242, 221, 173, 216,
+ 205, 217, 18, 251, 100, 216, 205, 217, 18, 5, 207, 46, 77, 216, 205, 217,
+ 18, 193, 23, 207, 46, 77, 216, 205, 217, 18, 18, 3, 195, 35, 216, 205,
+ 217, 18, 195, 40, 36, 5, 197, 113, 36, 5, 197, 116, 36, 5, 197, 119, 36,
+ 5, 197, 117, 36, 5, 197, 118, 36, 5, 197, 115, 36, 5, 237, 169, 36, 5,
+ 237, 171, 36, 5, 237, 174, 36, 5, 237, 172, 36, 5, 237, 173, 36, 5, 237,
+ 170, 36, 5, 235, 22, 36, 5, 235, 26, 36, 5, 235, 34, 36, 5, 235, 31, 36,
+ 5, 235, 32, 36, 5, 235, 23, 36, 5, 247, 56, 36, 5, 247, 50, 36, 5, 247,
+ 52, 36, 5, 247, 55, 36, 5, 247, 53, 36, 5, 247, 54, 36, 5, 247, 51, 36,
+ 5, 249, 53, 36, 5, 249, 32, 36, 5, 249, 44, 36, 5, 249, 52, 36, 5, 249,
+ 47, 36, 5, 249, 48, 36, 5, 249, 36, 8, 2, 1, 249, 82, 251, 160, 8, 2, 1,
+ 42, 207, 16, 8, 2, 1, 248, 135, 71, 8, 2, 1, 249, 82, 71, 8, 2, 1, 235,
+ 15, 4, 232, 188, 8, 2, 1, 219, 189, 233, 175, 8, 2, 1, 27, 232, 52, 4,
+ 238, 212, 8, 2, 1, 220, 143, 4, 223, 93, 219, 245, 206, 8, 8, 2, 1, 220,
+ 143, 4, 55, 82, 198, 152, 8, 2, 1, 220, 143, 4, 82, 206, 188, 8, 2, 1,
+ 218, 169, 4, 238, 212, 8, 2, 1, 215, 62, 4, 238, 212, 8, 2, 1, 234, 89,
+ 4, 238, 212, 8, 2, 1, 248, 135, 74, 8, 2, 1, 248, 135, 187, 4, 106, 8, 2,
+ 1, 211, 77, 187, 4, 106, 8, 2, 1, 223, 93, 211, 151, 8, 2, 1, 153, 211,
+ 152, 4, 106, 8, 2, 1, 153, 211, 152, 4, 228, 241, 106, 8, 2, 1, 153, 187,
+ 211, 72, 8, 2, 1, 153, 187, 211, 73, 4, 106, 8, 2, 1, 201, 68, 146, 8, 1,
+ 2, 6, 207, 222, 4, 50, 219, 212, 8, 2, 1, 207, 222, 193, 51, 230, 31, 8,
+ 2, 1, 55, 146, 8, 2, 1, 207, 222, 4, 238, 212, 8, 2, 1, 55, 207, 222, 4,
+ 238, 212, 8, 2, 1, 27, 146, 8, 2, 1, 27, 207, 222, 4, 206, 188, 8, 2, 1,
+ 249, 72, 234, 12, 8, 2, 1, 126, 4, 203, 40, 50, 219, 212, 8, 2, 1, 126,
+ 249, 88, 4, 203, 40, 50, 219, 212, 8, 2, 1, 196, 139, 8, 2, 1, 153, 196,
+ 139, 8, 2, 1, 126, 4, 45, 102, 8, 2, 1, 243, 95, 8, 2, 1, 243, 96, 4,
+ 130, 50, 206, 188, 8, 2, 1, 243, 96, 4, 130, 45, 204, 5, 8, 2, 1, 192,
+ 236, 4, 130, 50, 206, 188, 8, 2, 1, 192, 236, 4, 179, 45, 219, 212, 8, 2,
+ 1, 192, 236, 4, 179, 45, 219, 213, 23, 130, 50, 206, 188, 8, 2, 1, 192,
+ 236, 4, 179, 45, 219, 213, 4, 204, 5, 8, 2, 1, 192, 160, 4, 203, 40, 50,
+ 219, 212, 52, 248, 37, 4, 223, 93, 248, 36, 52, 1, 2, 229, 196, 52, 1, 2,
+ 220, 143, 4, 223, 93, 219, 245, 206, 8, 52, 1, 2, 220, 143, 4, 82, 198,
+ 152, 52, 1, 2, 126, 4, 45, 102, 8, 2, 1, 205, 174, 192, 95, 8, 2, 1, 223,
+ 81, 71, 8, 2, 1, 211, 77, 211, 151, 8, 2, 1, 196, 82, 8, 2, 1, 223, 93,
+ 251, 160, 35, 1, 2, 6, 211, 110, 8, 2, 1, 235, 37, 237, 3, 4, 207, 24,
+ 102, 8, 2, 1, 197, 170, 237, 3, 4, 207, 24, 102, 8, 2, 1, 153, 207, 222,
+ 4, 82, 198, 152, 52, 1, 2, 153, 193, 224, 52, 1, 45, 199, 228, 52, 1, 50,
+ 199, 228, 103, 2, 1, 65, 103, 2, 1, 71, 103, 2, 1, 68, 103, 2, 1, 74,
+ 103, 2, 1, 66, 103, 2, 1, 196, 12, 103, 2, 1, 231, 240, 103, 2, 1, 155,
+ 103, 2, 1, 231, 165, 103, 2, 1, 231, 53, 103, 2, 1, 231, 3, 103, 2, 1,
+ 230, 179, 103, 2, 1, 230, 138, 103, 2, 1, 140, 103, 2, 1, 229, 245, 103,
+ 2, 1, 229, 158, 103, 2, 1, 229, 23, 103, 2, 1, 228, 159, 103, 2, 1, 228,
+ 126, 103, 2, 1, 173, 103, 2, 1, 219, 238, 103, 2, 1, 219, 146, 103, 2, 1,
+ 219, 43, 103, 2, 1, 218, 225, 103, 2, 1, 218, 192, 103, 2, 1, 174, 103,
+ 2, 1, 216, 232, 103, 2, 1, 216, 100, 103, 2, 1, 216, 12, 103, 2, 1, 215,
+ 155, 103, 2, 1, 180, 103, 2, 1, 229, 47, 103, 2, 1, 214, 237, 103, 2, 1,
+ 214, 121, 103, 2, 1, 213, 219, 103, 2, 1, 213, 43, 103, 2, 1, 212, 178,
+ 103, 2, 1, 212, 112, 103, 2, 1, 208, 32, 103, 2, 1, 208, 16, 103, 2, 1,
+ 208, 9, 103, 2, 1, 207, 255, 103, 2, 1, 207, 244, 103, 2, 1, 207, 242,
+ 103, 2, 1, 188, 103, 2, 1, 206, 8, 103, 2, 1, 205, 68, 103, 2, 1, 202,
+ 222, 103, 2, 1, 202, 46, 103, 2, 1, 201, 4, 103, 2, 1, 200, 158, 103, 2,
+ 1, 238, 32, 103, 2, 1, 190, 190, 103, 2, 1, 237, 146, 103, 2, 1, 199,
+ 145, 103, 2, 1, 237, 44, 103, 2, 1, 198, 193, 103, 2, 1, 236, 174, 103,
+ 2, 1, 235, 89, 103, 2, 1, 235, 57, 103, 2, 1, 236, 186, 103, 2, 1, 198,
+ 115, 103, 2, 1, 198, 114, 103, 2, 1, 198, 103, 103, 2, 1, 198, 102, 103,
+ 2, 1, 198, 101, 103, 2, 1, 198, 100, 103, 2, 1, 197, 168, 103, 2, 1, 197,
+ 161, 103, 2, 1, 197, 146, 103, 2, 1, 197, 144, 103, 2, 1, 197, 140, 103,
+ 2, 1, 197, 139, 103, 2, 1, 193, 190, 103, 2, 1, 193, 125, 103, 2, 1, 193,
+ 86, 103, 2, 1, 193, 48, 103, 2, 1, 193, 0, 103, 2, 1, 192, 243, 103, 2,
+ 1, 170, 216, 205, 217, 18, 1, 221, 51, 216, 205, 217, 18, 1, 205, 152,
+ 216, 205, 217, 18, 1, 220, 96, 216, 205, 217, 18, 1, 216, 23, 216, 205,
+ 217, 18, 1, 168, 216, 205, 217, 18, 1, 180, 216, 205, 217, 18, 1, 243,
+ 87, 216, 205, 217, 18, 1, 198, 154, 216, 205, 217, 18, 1, 221, 176, 216,
+ 205, 217, 18, 1, 213, 239, 216, 205, 217, 18, 1, 198, 232, 216, 205, 217,
+ 18, 1, 193, 173, 216, 205, 217, 18, 1, 192, 106, 216, 205, 217, 18, 1,
+ 228, 147, 216, 205, 217, 18, 1, 196, 113, 216, 205, 217, 18, 1, 68, 216,
+ 205, 217, 18, 1, 209, 222, 216, 205, 217, 18, 1, 250, 175, 216, 205, 217,
+ 18, 1, 230, 251, 216, 205, 217, 18, 1, 222, 250, 216, 205, 217, 18, 1,
+ 207, 156, 216, 205, 217, 18, 1, 249, 153, 216, 205, 217, 18, 1, 222, 234,
+ 216, 205, 217, 18, 1, 237, 1, 216, 205, 217, 18, 1, 231, 60, 216, 205,
+ 217, 18, 1, 237, 46, 216, 205, 217, 18, 1, 248, 198, 216, 205, 217, 18,
+ 1, 221, 52, 219, 9, 216, 205, 217, 18, 1, 220, 97, 219, 9, 216, 205, 217,
+ 18, 1, 216, 24, 219, 9, 216, 205, 217, 18, 1, 210, 221, 219, 9, 216, 205,
+ 217, 18, 1, 215, 7, 219, 9, 216, 205, 217, 18, 1, 198, 155, 219, 9, 216,
+ 205, 217, 18, 1, 213, 240, 219, 9, 216, 205, 217, 18, 1, 228, 74, 219, 9,
+ 216, 205, 217, 18, 18, 3, 211, 102, 216, 205, 217, 18, 18, 3, 223, 160,
+ 216, 205, 217, 18, 18, 3, 251, 130, 216, 205, 217, 18, 18, 3, 192, 69,
+ 216, 205, 217, 18, 18, 3, 202, 6, 216, 205, 217, 18, 18, 3, 196, 110,
+ 216, 205, 217, 18, 18, 3, 243, 114, 216, 205, 217, 18, 18, 3, 212, 127,
+ 216, 205, 217, 18, 243, 115, 216, 205, 217, 18, 218, 209, 223, 42, 216,
+ 205, 217, 18, 251, 38, 223, 42, 216, 205, 217, 18, 17, 191, 77, 216, 205,
+ 217, 18, 17, 107, 216, 205, 217, 18, 17, 109, 216, 205, 217, 18, 17, 138,
+ 216, 205, 217, 18, 17, 134, 216, 205, 217, 18, 17, 149, 216, 205, 217,
+ 18, 17, 169, 216, 205, 217, 18, 17, 175, 216, 205, 217, 18, 17, 171, 216,
+ 205, 217, 18, 17, 178, 30, 222, 174, 212, 3, 30, 222, 174, 212, 8, 30,
+ 222, 174, 192, 5, 30, 222, 174, 192, 4, 30, 222, 174, 192, 3, 30, 222,
+ 174, 196, 218, 30, 222, 174, 196, 222, 30, 222, 174, 191, 219, 30, 222,
+ 174, 191, 215, 30, 222, 174, 233, 241, 30, 222, 174, 233, 239, 30, 222,
+ 174, 233, 240, 30, 222, 174, 233, 237, 30, 222, 174, 228, 60, 30, 222,
+ 174, 228, 59, 30, 222, 174, 228, 57, 30, 222, 174, 228, 58, 30, 222, 174,
+ 228, 63, 30, 222, 174, 228, 56, 30, 222, 174, 228, 55, 30, 222, 174, 228,
+ 65, 30, 222, 174, 251, 24, 30, 222, 174, 251, 23, 30, 125, 213, 197, 30,
+ 125, 213, 203, 30, 125, 201, 156, 30, 125, 201, 155, 30, 125, 198, 163,
+ 30, 125, 198, 161, 30, 125, 198, 160, 30, 125, 198, 166, 30, 125, 198,
+ 167, 30, 125, 198, 159, 30, 125, 206, 218, 30, 125, 206, 233, 30, 125,
+ 201, 162, 30, 125, 206, 230, 30, 125, 206, 220, 30, 125, 206, 222, 30,
+ 125, 206, 209, 30, 125, 206, 210, 30, 125, 222, 68, 30, 125, 216, 72, 30,
+ 125, 216, 66, 30, 125, 201, 166, 30, 125, 216, 69, 30, 125, 216, 75, 30,
+ 125, 209, 150, 30, 125, 209, 159, 30, 125, 209, 163, 30, 125, 201, 164,
+ 30, 125, 209, 153, 30, 125, 209, 167, 30, 125, 209, 168, 30, 125, 202,
+ 152, 30, 125, 202, 155, 30, 125, 201, 160, 30, 125, 201, 158, 30, 125,
+ 202, 150, 30, 125, 202, 158, 30, 125, 202, 159, 30, 125, 202, 144, 30,
+ 125, 202, 157, 30, 125, 210, 147, 30, 125, 210, 148, 30, 125, 192, 53,
+ 30, 125, 192, 56, 30, 125, 243, 22, 30, 125, 243, 21, 30, 125, 201, 171,
+ 30, 125, 209, 206, 30, 125, 209, 205, 12, 15, 225, 190, 12, 15, 225, 189,
+ 12, 15, 225, 188, 12, 15, 225, 187, 12, 15, 225, 186, 12, 15, 225, 185,
+ 12, 15, 225, 184, 12, 15, 225, 183, 12, 15, 225, 182, 12, 15, 225, 181,
+ 12, 15, 225, 180, 12, 15, 225, 179, 12, 15, 225, 178, 12, 15, 225, 177,
+ 12, 15, 225, 176, 12, 15, 225, 175, 12, 15, 225, 174, 12, 15, 225, 173,
+ 12, 15, 225, 172, 12, 15, 225, 171, 12, 15, 225, 170, 12, 15, 225, 169,
+ 12, 15, 225, 168, 12, 15, 225, 167, 12, 15, 225, 166, 12, 15, 225, 165,
+ 12, 15, 225, 164, 12, 15, 225, 163, 12, 15, 225, 162, 12, 15, 225, 161,
+ 12, 15, 225, 160, 12, 15, 225, 159, 12, 15, 225, 158, 12, 15, 225, 157,
+ 12, 15, 225, 156, 12, 15, 225, 155, 12, 15, 225, 154, 12, 15, 225, 153,
+ 12, 15, 225, 152, 12, 15, 225, 151, 12, 15, 225, 150, 12, 15, 225, 149,
+ 12, 15, 225, 148, 12, 15, 225, 147, 12, 15, 225, 146, 12, 15, 225, 145,
+ 12, 15, 225, 144, 12, 15, 225, 143, 12, 15, 225, 142, 12, 15, 225, 141,
+ 12, 15, 225, 140, 12, 15, 225, 139, 12, 15, 225, 138, 12, 15, 225, 137,
+ 12, 15, 225, 136, 12, 15, 225, 135, 12, 15, 225, 134, 12, 15, 225, 133,
+ 12, 15, 225, 132, 12, 15, 225, 131, 12, 15, 225, 130, 12, 15, 225, 129,
+ 12, 15, 225, 128, 12, 15, 225, 127, 12, 15, 225, 126, 12, 15, 225, 125,
+ 12, 15, 225, 124, 12, 15, 225, 123, 12, 15, 225, 122, 12, 15, 225, 121,
+ 12, 15, 225, 120, 12, 15, 225, 119, 12, 15, 225, 118, 12, 15, 225, 117,
+ 12, 15, 225, 116, 12, 15, 225, 115, 12, 15, 225, 114, 12, 15, 225, 113,
+ 12, 15, 225, 112, 12, 15, 225, 111, 12, 15, 225, 110, 12, 15, 225, 109,
+ 12, 15, 225, 108, 12, 15, 225, 107, 12, 15, 225, 106, 12, 15, 225, 105,
+ 12, 15, 225, 104, 12, 15, 225, 103, 12, 15, 225, 102, 12, 15, 225, 101,
+ 12, 15, 225, 100, 12, 15, 225, 99, 12, 15, 225, 98, 12, 15, 225, 97, 12,
+ 15, 225, 96, 12, 15, 225, 95, 12, 15, 225, 94, 12, 15, 225, 93, 12, 15,
+ 225, 92, 12, 15, 225, 91, 12, 15, 225, 90, 12, 15, 225, 89, 12, 15, 225,
+ 88, 12, 15, 225, 87, 12, 15, 225, 86, 12, 15, 225, 85, 12, 15, 225, 84,
+ 12, 15, 225, 83, 12, 15, 225, 82, 12, 15, 225, 81, 12, 15, 225, 80, 12,
+ 15, 225, 79, 12, 15, 225, 78, 12, 15, 225, 77, 12, 15, 225, 76, 12, 15,
+ 225, 75, 12, 15, 225, 74, 12, 15, 225, 73, 12, 15, 225, 72, 12, 15, 225,
+ 71, 12, 15, 225, 70, 12, 15, 225, 69, 12, 15, 225, 68, 12, 15, 225, 67,
+ 12, 15, 225, 66, 12, 15, 225, 65, 12, 15, 225, 64, 12, 15, 225, 63, 12,
+ 15, 225, 62, 12, 15, 225, 61, 12, 15, 225, 60, 12, 15, 225, 59, 12, 15,
+ 225, 58, 12, 15, 225, 57, 12, 15, 225, 56, 12, 15, 225, 55, 12, 15, 225,
+ 54, 12, 15, 225, 53, 12, 15, 225, 52, 12, 15, 225, 51, 12, 15, 225, 50,
+ 12, 15, 225, 49, 12, 15, 225, 48, 12, 15, 225, 47, 12, 15, 225, 46, 12,
+ 15, 225, 45, 12, 15, 225, 44, 12, 15, 225, 43, 12, 15, 225, 42, 12, 15,
+ 225, 41, 12, 15, 225, 40, 12, 15, 225, 39, 12, 15, 225, 38, 12, 15, 225,
+ 37, 12, 15, 225, 36, 12, 15, 225, 35, 12, 15, 225, 34, 12, 15, 225, 33,
+ 12, 15, 225, 32, 12, 15, 225, 31, 12, 15, 225, 30, 12, 15, 225, 29, 12,
+ 15, 225, 28, 12, 15, 225, 27, 12, 15, 225, 26, 12, 15, 225, 25, 12, 15,
+ 225, 24, 12, 15, 225, 23, 12, 15, 225, 22, 12, 15, 225, 21, 12, 15, 225,
+ 20, 12, 15, 225, 19, 12, 15, 225, 18, 12, 15, 225, 17, 12, 15, 225, 16,
+ 12, 15, 225, 15, 12, 15, 225, 14, 12, 15, 225, 13, 12, 15, 225, 12, 12,
+ 15, 225, 11, 12, 15, 225, 10, 12, 15, 225, 9, 12, 15, 225, 8, 12, 15,
+ 225, 7, 12, 15, 225, 6, 12, 15, 225, 5, 12, 15, 225, 4, 12, 15, 225, 3,
+ 12, 15, 225, 2, 12, 15, 225, 1, 12, 15, 225, 0, 12, 15, 224, 255, 12, 15,
+ 224, 254, 12, 15, 224, 253, 12, 15, 224, 252, 12, 15, 224, 251, 12, 15,
+ 224, 250, 12, 15, 224, 249, 12, 15, 224, 248, 12, 15, 224, 247, 12, 15,
+ 224, 246, 12, 15, 224, 245, 12, 15, 224, 244, 12, 15, 224, 243, 12, 15,
+ 224, 242, 12, 15, 224, 241, 12, 15, 224, 240, 12, 15, 224, 239, 12, 15,
+ 224, 238, 12, 15, 224, 237, 12, 15, 224, 236, 12, 15, 224, 235, 12, 15,
+ 224, 234, 12, 15, 224, 233, 12, 15, 224, 232, 12, 15, 224, 231, 12, 15,
+ 224, 230, 12, 15, 224, 229, 12, 15, 224, 228, 12, 15, 224, 227, 12, 15,
+ 224, 226, 12, 15, 224, 225, 12, 15, 224, 224, 12, 15, 224, 223, 12, 15,
+ 224, 222, 12, 15, 224, 221, 12, 15, 224, 220, 12, 15, 224, 219, 12, 15,
+ 224, 218, 12, 15, 224, 217, 12, 15, 224, 216, 12, 15, 224, 215, 12, 15,
+ 224, 214, 12, 15, 224, 213, 12, 15, 224, 212, 12, 15, 224, 211, 12, 15,
+ 224, 210, 12, 15, 224, 209, 12, 15, 224, 208, 12, 15, 224, 207, 12, 15,
+ 224, 206, 12, 15, 224, 205, 12, 15, 224, 204, 12, 15, 224, 203, 12, 15,
+ 224, 202, 12, 15, 224, 201, 12, 15, 224, 200, 12, 15, 224, 199, 12, 15,
+ 224, 198, 12, 15, 224, 197, 12, 15, 224, 196, 12, 15, 224, 195, 12, 15,
+ 224, 194, 12, 15, 224, 193, 12, 15, 224, 192, 12, 15, 224, 191, 12, 15,
+ 224, 190, 12, 15, 224, 189, 12, 15, 224, 188, 12, 15, 224, 187, 12, 15,
+ 224, 186, 12, 15, 224, 185, 12, 15, 224, 184, 12, 15, 224, 183, 12, 15,
+ 224, 182, 12, 15, 224, 181, 12, 15, 224, 180, 12, 15, 224, 179, 12, 15,
+ 224, 178, 12, 15, 224, 177, 12, 15, 224, 176, 12, 15, 224, 175, 12, 15,
+ 224, 174, 12, 15, 224, 173, 12, 15, 224, 172, 12, 15, 224, 171, 12, 15,
+ 224, 170, 12, 15, 224, 169, 12, 15, 224, 168, 12, 15, 224, 167, 12, 15,
+ 224, 166, 12, 15, 224, 165, 12, 15, 224, 164, 12, 15, 224, 163, 12, 15,
+ 224, 162, 12, 15, 224, 161, 12, 15, 224, 160, 12, 15, 224, 159, 12, 15,
+ 224, 158, 12, 15, 224, 157, 12, 15, 224, 156, 12, 15, 224, 155, 12, 15,
+ 224, 154, 12, 15, 224, 153, 12, 15, 224, 152, 12, 15, 224, 151, 12, 15,
+ 224, 150, 12, 15, 224, 149, 12, 15, 224, 148, 12, 15, 224, 147, 12, 15,
+ 224, 146, 12, 15, 224, 145, 12, 15, 224, 144, 12, 15, 224, 143, 12, 15,
+ 224, 142, 12, 15, 224, 141, 12, 15, 224, 140, 12, 15, 224, 139, 12, 15,
+ 224, 138, 12, 15, 224, 137, 12, 15, 224, 136, 12, 15, 224, 135, 12, 15,
+ 224, 134, 12, 15, 224, 133, 12, 15, 224, 132, 12, 15, 224, 131, 12, 15,
+ 224, 130, 12, 15, 224, 129, 12, 15, 224, 128, 12, 15, 224, 127, 12, 15,
+ 224, 126, 12, 15, 224, 125, 12, 15, 224, 124, 12, 15, 224, 123, 12, 15,
+ 224, 122, 12, 15, 224, 121, 12, 15, 224, 120, 12, 15, 224, 119, 12, 15,
+ 224, 118, 12, 15, 224, 117, 12, 15, 224, 116, 12, 15, 224, 115, 12, 15,
+ 224, 114, 12, 15, 224, 113, 12, 15, 224, 112, 12, 15, 224, 111, 12, 15,
+ 224, 110, 12, 15, 224, 109, 12, 15, 224, 108, 12, 15, 224, 107, 12, 15,
+ 224, 106, 12, 15, 224, 105, 12, 15, 224, 104, 12, 15, 224, 103, 12, 15,
+ 224, 102, 12, 15, 224, 101, 12, 15, 224, 100, 12, 15, 224, 99, 12, 15,
+ 224, 98, 12, 15, 224, 97, 12, 15, 224, 96, 12, 15, 224, 95, 12, 15, 224,
+ 94, 12, 15, 224, 93, 12, 15, 224, 92, 12, 15, 224, 91, 12, 15, 224, 90,
+ 12, 15, 224, 89, 12, 15, 224, 88, 12, 15, 224, 87, 12, 15, 224, 86, 12,
+ 15, 224, 85, 12, 15, 224, 84, 12, 15, 224, 83, 12, 15, 224, 82, 12, 15,
+ 224, 81, 12, 15, 224, 80, 12, 15, 224, 79, 12, 15, 224, 78, 12, 15, 224,
+ 77, 12, 15, 224, 76, 12, 15, 224, 75, 12, 15, 224, 74, 12, 15, 224, 73,
+ 12, 15, 224, 72, 12, 15, 224, 71, 12, 15, 224, 70, 12, 15, 224, 69, 12,
+ 15, 224, 68, 12, 15, 224, 67, 12, 15, 224, 66, 12, 15, 224, 65, 12, 15,
+ 224, 64, 12, 15, 224, 63, 12, 15, 224, 62, 12, 15, 224, 61, 12, 15, 224,
+ 60, 12, 15, 224, 59, 12, 15, 224, 58, 12, 15, 224, 57, 12, 15, 224, 56,
+ 12, 15, 224, 55, 12, 15, 224, 54, 12, 15, 224, 53, 12, 15, 224, 52, 12,
+ 15, 224, 51, 12, 15, 224, 50, 12, 15, 224, 49, 12, 15, 224, 48, 12, 15,
+ 224, 47, 12, 15, 224, 46, 12, 15, 224, 45, 12, 15, 224, 44, 12, 15, 224,
+ 43, 12, 15, 224, 42, 12, 15, 224, 41, 12, 15, 224, 40, 12, 15, 224, 39,
+ 12, 15, 224, 38, 12, 15, 224, 37, 12, 15, 224, 36, 12, 15, 224, 35, 12,
+ 15, 224, 34, 12, 15, 224, 33, 12, 15, 224, 32, 12, 15, 224, 31, 12, 15,
+ 224, 30, 12, 15, 224, 29, 12, 15, 224, 28, 12, 15, 224, 27, 12, 15, 224,
+ 26, 12, 15, 224, 25, 12, 15, 224, 24, 12, 15, 224, 23, 12, 15, 224, 22,
+ 12, 15, 224, 21, 12, 15, 224, 20, 12, 15, 224, 19, 12, 15, 224, 18, 12,
+ 15, 224, 17, 12, 15, 224, 16, 12, 15, 224, 15, 12, 15, 224, 14, 12, 15,
+ 224, 13, 12, 15, 224, 12, 12, 15, 224, 11, 12, 15, 224, 10, 12, 15, 224,
+ 9, 12, 15, 224, 8, 12, 15, 224, 7, 12, 15, 224, 6, 12, 15, 224, 5, 12,
+ 15, 224, 4, 12, 15, 224, 3, 12, 15, 224, 2, 12, 15, 224, 1, 12, 15, 224,
+ 0, 12, 15, 223, 255, 12, 15, 223, 254, 12, 15, 223, 253, 12, 15, 223,
+ 252, 12, 15, 223, 251, 12, 15, 223, 250, 12, 15, 223, 249, 12, 15, 223,
+ 248, 12, 15, 223, 247, 12, 15, 223, 246, 12, 15, 223, 245, 12, 15, 223,
+ 244, 12, 15, 223, 243, 12, 15, 223, 242, 12, 15, 223, 241, 12, 15, 223,
+ 240, 12, 15, 223, 239, 12, 15, 223, 238, 12, 15, 223, 237, 12, 15, 223,
+ 236, 12, 15, 223, 235, 12, 15, 223, 234, 12, 15, 223, 233, 12, 15, 223,
+ 232, 12, 15, 223, 231, 8, 2, 34, 233, 27, 8, 2, 34, 233, 23, 8, 2, 34,
+ 232, 220, 8, 2, 34, 233, 26, 8, 2, 34, 233, 25, 8, 2, 34, 179, 206, 9,
+ 200, 43, 8, 2, 34, 201, 118, 250, 249, 2, 34, 216, 187, 212, 253, 250,
+ 249, 2, 34, 216, 187, 234, 195, 250, 249, 2, 34, 216, 187, 223, 131, 250,
+ 249, 2, 34, 195, 75, 212, 253, 250, 249, 2, 34, 216, 187, 192, 212, 136,
+ 1, 191, 251, 4, 229, 119, 136, 209, 62, 222, 181, 195, 166, 136, 34, 192,
+ 31, 191, 251, 191, 251, 210, 88, 136, 1, 251, 152, 250, 126, 136, 1, 193,
+ 78, 251, 192, 136, 1, 193, 78, 237, 253, 136, 1, 193, 78, 229, 245, 136,
+ 1, 193, 78, 222, 106, 136, 1, 193, 78, 220, 27, 136, 1, 193, 78, 53, 216,
+ 193, 136, 1, 193, 78, 207, 38, 136, 1, 193, 78, 199, 162, 136, 1, 251,
+ 152, 108, 56, 136, 1, 203, 70, 4, 203, 70, 236, 140, 136, 1, 203, 70, 4,
+ 202, 175, 236, 140, 136, 1, 203, 70, 4, 238, 17, 23, 203, 70, 236, 140,
+ 136, 1, 203, 70, 4, 238, 17, 23, 202, 175, 236, 140, 136, 1, 131, 4, 210,
+ 88, 136, 1, 131, 4, 208, 84, 136, 1, 131, 4, 217, 70, 136, 1, 248, 215,
+ 4, 238, 16, 136, 1, 231, 39, 4, 238, 16, 136, 1, 237, 254, 4, 238, 16,
+ 136, 1, 229, 246, 4, 217, 70, 136, 1, 195, 159, 4, 238, 16, 136, 1, 191,
+ 92, 4, 238, 16, 136, 1, 199, 74, 4, 238, 16, 136, 1, 191, 251, 4, 238,
+ 16, 136, 1, 53, 222, 107, 4, 238, 16, 136, 1, 222, 107, 4, 238, 16, 136,
+ 1, 220, 28, 4, 238, 16, 136, 1, 216, 194, 4, 238, 16, 136, 1, 212, 131,
+ 4, 238, 16, 136, 1, 205, 149, 4, 238, 16, 136, 1, 53, 210, 64, 4, 238,
+ 16, 136, 1, 210, 64, 4, 238, 16, 136, 1, 197, 164, 4, 238, 16, 136, 1,
+ 208, 43, 4, 238, 16, 136, 1, 207, 39, 4, 238, 16, 136, 1, 203, 70, 4,
+ 238, 16, 136, 1, 199, 163, 4, 238, 16, 136, 1, 195, 159, 4, 229, 7, 136,
+ 1, 248, 215, 4, 207, 161, 136, 1, 222, 107, 4, 207, 161, 136, 1, 210, 64,
+ 4, 207, 161, 136, 34, 131, 220, 27, 9, 1, 131, 193, 151, 76, 20, 9, 1,
+ 131, 193, 151, 53, 20, 9, 1, 249, 0, 76, 20, 9, 1, 249, 0, 53, 20, 9, 1,
+ 249, 0, 89, 20, 9, 1, 249, 0, 216, 217, 20, 9, 1, 210, 42, 76, 20, 9, 1,
+ 210, 42, 53, 20, 9, 1, 210, 42, 89, 20, 9, 1, 210, 42, 216, 217, 20, 9,
+ 1, 248, 244, 76, 20, 9, 1, 248, 244, 53, 20, 9, 1, 248, 244, 89, 20, 9,
+ 1, 248, 244, 216, 217, 20, 9, 1, 197, 123, 76, 20, 9, 1, 197, 123, 53,
+ 20, 9, 1, 197, 123, 89, 20, 9, 1, 197, 123, 216, 217, 20, 9, 1, 199, 113,
+ 76, 20, 9, 1, 199, 113, 53, 20, 9, 1, 199, 113, 89, 20, 9, 1, 199, 113,
+ 216, 217, 20, 9, 1, 197, 125, 76, 20, 9, 1, 197, 125, 53, 20, 9, 1, 197,
+ 125, 89, 20, 9, 1, 197, 125, 216, 217, 20, 9, 1, 195, 147, 76, 20, 9, 1,
+ 195, 147, 53, 20, 9, 1, 195, 147, 89, 20, 9, 1, 195, 147, 216, 217, 20,
+ 9, 1, 210, 40, 76, 20, 9, 1, 210, 40, 53, 20, 9, 1, 210, 40, 89, 20, 9,
+ 1, 210, 40, 216, 217, 20, 9, 1, 235, 42, 76, 20, 9, 1, 235, 42, 53, 20,
+ 9, 1, 235, 42, 89, 20, 9, 1, 235, 42, 216, 217, 20, 9, 1, 212, 88, 76,
+ 20, 9, 1, 212, 88, 53, 20, 9, 1, 212, 88, 89, 20, 9, 1, 212, 88, 216,
+ 217, 20, 9, 1, 199, 150, 76, 20, 9, 1, 199, 150, 53, 20, 9, 1, 199, 150,
+ 89, 20, 9, 1, 199, 150, 216, 217, 20, 9, 1, 199, 148, 76, 20, 9, 1, 199,
+ 148, 53, 20, 9, 1, 199, 148, 89, 20, 9, 1, 199, 148, 216, 217, 20, 9, 1,
+ 237, 189, 76, 20, 9, 1, 237, 189, 53, 20, 9, 1, 238, 11, 76, 20, 9, 1,
+ 238, 11, 53, 20, 9, 1, 235, 79, 76, 20, 9, 1, 235, 79, 53, 20, 9, 1, 237,
+ 187, 76, 20, 9, 1, 237, 187, 53, 20, 9, 1, 223, 4, 76, 20, 9, 1, 223, 4,
+ 53, 20, 9, 1, 206, 102, 76, 20, 9, 1, 206, 102, 53, 20, 9, 1, 222, 5, 76,
+ 20, 9, 1, 222, 5, 53, 20, 9, 1, 222, 5, 89, 20, 9, 1, 222, 5, 216, 217,
+ 20, 9, 1, 231, 228, 76, 20, 9, 1, 231, 228, 53, 20, 9, 1, 231, 228, 89,
+ 20, 9, 1, 231, 228, 216, 217, 20, 9, 1, 230, 167, 76, 20, 9, 1, 230, 167,
+ 53, 20, 9, 1, 230, 167, 89, 20, 9, 1, 230, 167, 216, 217, 20, 9, 1, 213,
+ 248, 76, 20, 9, 1, 213, 248, 53, 20, 9, 1, 213, 248, 89, 20, 9, 1, 213,
+ 248, 216, 217, 20, 9, 1, 213, 25, 231, 58, 76, 20, 9, 1, 213, 25, 231,
+ 58, 53, 20, 9, 1, 206, 166, 76, 20, 9, 1, 206, 166, 53, 20, 9, 1, 206,
+ 166, 89, 20, 9, 1, 206, 166, 216, 217, 20, 9, 1, 229, 211, 4, 99, 93, 76,
+ 20, 9, 1, 229, 211, 4, 99, 93, 53, 20, 9, 1, 229, 211, 231, 1, 76, 20, 9,
+ 1, 229, 211, 231, 1, 53, 20, 9, 1, 229, 211, 231, 1, 89, 20, 9, 1, 229,
+ 211, 231, 1, 216, 217, 20, 9, 1, 229, 211, 236, 171, 76, 20, 9, 1, 229,
+ 211, 236, 171, 53, 20, 9, 1, 229, 211, 236, 171, 89, 20, 9, 1, 229, 211,
+ 236, 171, 216, 217, 20, 9, 1, 99, 249, 81, 76, 20, 9, 1, 99, 249, 81, 53,
+ 20, 9, 1, 99, 249, 81, 4, 230, 58, 93, 76, 20, 9, 1, 99, 249, 81, 4, 230,
+ 58, 93, 53, 20, 9, 16, 75, 58, 9, 16, 75, 60, 9, 16, 105, 185, 58, 9, 16,
+ 105, 185, 60, 9, 16, 115, 185, 58, 9, 16, 115, 185, 60, 9, 16, 115, 185,
+ 209, 58, 235, 119, 58, 9, 16, 115, 185, 209, 58, 235, 119, 60, 9, 16,
+ 232, 128, 185, 58, 9, 16, 232, 128, 185, 60, 9, 16, 55, 81, 249, 88, 60,
+ 9, 16, 105, 185, 195, 85, 58, 9, 16, 105, 185, 195, 85, 60, 9, 16, 206,
+ 188, 9, 16, 2, 199, 220, 58, 9, 16, 2, 199, 220, 60, 9, 16, 193, 151, 58,
+ 9, 1, 214, 71, 76, 20, 9, 1, 214, 71, 53, 20, 9, 1, 214, 71, 89, 20, 9,
+ 1, 214, 71, 216, 217, 20, 9, 1, 126, 76, 20, 9, 1, 126, 53, 20, 9, 1,
+ 211, 152, 76, 20, 9, 1, 211, 152, 53, 20, 9, 1, 191, 226, 76, 20, 9, 1,
+ 191, 226, 53, 20, 9, 1, 126, 4, 230, 58, 93, 76, 20, 9, 1, 195, 154, 76,
+ 20, 9, 1, 195, 154, 53, 20, 9, 1, 221, 132, 211, 152, 76, 20, 9, 1, 221,
+ 132, 211, 152, 53, 20, 9, 1, 221, 132, 191, 226, 76, 20, 9, 1, 221, 132,
+ 191, 226, 53, 20, 9, 1, 235, 15, 76, 20, 9, 1, 235, 15, 53, 20, 9, 1,
+ 235, 15, 89, 20, 9, 1, 235, 15, 216, 217, 20, 9, 1, 196, 137, 222, 26,
+ 221, 132, 131, 217, 100, 89, 20, 9, 1, 196, 137, 222, 26, 221, 132, 131,
+ 217, 100, 216, 217, 20, 9, 34, 99, 4, 230, 58, 93, 4, 131, 76, 20, 9, 34,
+ 99, 4, 230, 58, 93, 4, 131, 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 252,
+ 26, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4, 252, 26, 53, 20, 9, 34, 99, 4,
+ 230, 58, 93, 4, 193, 134, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4, 193, 134,
+ 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 126, 76, 20, 9, 34, 99, 4, 230, 58,
+ 93, 4, 126, 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 211, 152, 76, 20, 9,
+ 34, 99, 4, 230, 58, 93, 4, 211, 152, 53, 20, 9, 34, 99, 4, 230, 58, 93,
+ 4, 191, 226, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4, 191, 226, 53, 20, 9,
+ 34, 99, 4, 230, 58, 93, 4, 235, 15, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4,
+ 235, 15, 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 235, 15, 89, 20, 9, 34,
+ 196, 137, 221, 132, 99, 4, 230, 58, 93, 4, 131, 217, 100, 76, 20, 9, 34,
+ 196, 137, 221, 132, 99, 4, 230, 58, 93, 4, 131, 217, 100, 53, 20, 9, 34,
+ 196, 137, 221, 132, 99, 4, 230, 58, 93, 4, 131, 217, 100, 89, 20, 9, 1,
+ 233, 74, 99, 76, 20, 9, 1, 233, 74, 99, 53, 20, 9, 1, 233, 74, 99, 89,
+ 20, 9, 1, 233, 74, 99, 216, 217, 20, 9, 34, 99, 4, 230, 58, 93, 4, 223,
+ 7, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4, 182, 76, 20, 9, 34, 99, 4, 230,
+ 58, 93, 4, 92, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4, 131, 217, 100, 76,
+ 20, 9, 34, 99, 4, 230, 58, 93, 4, 99, 76, 20, 9, 34, 248, 246, 4, 223, 7,
+ 76, 20, 9, 34, 248, 246, 4, 182, 76, 20, 9, 34, 248, 246, 4, 221, 211,
+ 76, 20, 9, 34, 248, 246, 4, 92, 76, 20, 9, 34, 248, 246, 4, 131, 217,
+ 100, 76, 20, 9, 34, 248, 246, 4, 99, 76, 20, 9, 34, 199, 115, 4, 223, 7,
+ 76, 20, 9, 34, 199, 115, 4, 182, 76, 20, 9, 34, 199, 115, 4, 221, 211,
+ 76, 20, 9, 34, 199, 115, 4, 92, 76, 20, 9, 34, 199, 115, 4, 131, 217,
+ 100, 76, 20, 9, 34, 199, 115, 4, 99, 76, 20, 9, 34, 199, 30, 4, 223, 7,
+ 76, 20, 9, 34, 199, 30, 4, 92, 76, 20, 9, 34, 199, 30, 4, 131, 217, 100,
+ 76, 20, 9, 34, 199, 30, 4, 99, 76, 20, 9, 34, 223, 7, 4, 182, 76, 20, 9,
+ 34, 223, 7, 4, 92, 76, 20, 9, 34, 182, 4, 223, 7, 76, 20, 9, 34, 182, 4,
+ 92, 76, 20, 9, 34, 221, 211, 4, 223, 7, 76, 20, 9, 34, 221, 211, 4, 182,
+ 76, 20, 9, 34, 221, 211, 4, 92, 76, 20, 9, 34, 205, 47, 4, 223, 7, 76,
+ 20, 9, 34, 205, 47, 4, 182, 76, 20, 9, 34, 205, 47, 4, 221, 211, 76, 20,
+ 9, 34, 205, 47, 4, 92, 76, 20, 9, 34, 205, 193, 4, 182, 76, 20, 9, 34,
+ 205, 193, 4, 92, 76, 20, 9, 34, 238, 27, 4, 223, 7, 76, 20, 9, 34, 238,
+ 27, 4, 182, 76, 20, 9, 34, 238, 27, 4, 221, 211, 76, 20, 9, 34, 238, 27,
+ 4, 92, 76, 20, 9, 34, 199, 220, 4, 182, 76, 20, 9, 34, 199, 220, 4, 92,
+ 76, 20, 9, 34, 191, 117, 4, 92, 76, 20, 9, 34, 251, 231, 4, 223, 7, 76,
+ 20, 9, 34, 251, 231, 4, 92, 76, 20, 9, 34, 231, 87, 4, 223, 7, 76, 20, 9,
+ 34, 231, 87, 4, 92, 76, 20, 9, 34, 233, 47, 4, 223, 7, 76, 20, 9, 34,
+ 233, 47, 4, 182, 76, 20, 9, 34, 233, 47, 4, 221, 211, 76, 20, 9, 34, 233,
+ 47, 4, 92, 76, 20, 9, 34, 233, 47, 4, 131, 217, 100, 76, 20, 9, 34, 233,
+ 47, 4, 99, 76, 20, 9, 34, 208, 90, 4, 182, 76, 20, 9, 34, 208, 90, 4, 92,
+ 76, 20, 9, 34, 208, 90, 4, 131, 217, 100, 76, 20, 9, 34, 208, 90, 4, 99,
+ 76, 20, 9, 34, 222, 107, 4, 131, 76, 20, 9, 34, 222, 107, 4, 223, 7, 76,
+ 20, 9, 34, 222, 107, 4, 182, 76, 20, 9, 34, 222, 107, 4, 221, 211, 76,
+ 20, 9, 34, 222, 107, 4, 220, 36, 76, 20, 9, 34, 222, 107, 4, 92, 76, 20,
+ 9, 34, 222, 107, 4, 131, 217, 100, 76, 20, 9, 34, 222, 107, 4, 99, 76,
+ 20, 9, 34, 220, 36, 4, 223, 7, 76, 20, 9, 34, 220, 36, 4, 182, 76, 20, 9,
+ 34, 220, 36, 4, 221, 211, 76, 20, 9, 34, 220, 36, 4, 92, 76, 20, 9, 34,
+ 220, 36, 4, 131, 217, 100, 76, 20, 9, 34, 220, 36, 4, 99, 76, 20, 9, 34,
+ 92, 4, 223, 7, 76, 20, 9, 34, 92, 4, 182, 76, 20, 9, 34, 92, 4, 221, 211,
+ 76, 20, 9, 34, 92, 4, 92, 76, 20, 9, 34, 92, 4, 131, 217, 100, 76, 20, 9,
+ 34, 92, 4, 99, 76, 20, 9, 34, 213, 25, 4, 223, 7, 76, 20, 9, 34, 213, 25,
+ 4, 182, 76, 20, 9, 34, 213, 25, 4, 221, 211, 76, 20, 9, 34, 213, 25, 4,
+ 92, 76, 20, 9, 34, 213, 25, 4, 131, 217, 100, 76, 20, 9, 34, 213, 25, 4,
+ 99, 76, 20, 9, 34, 229, 211, 4, 223, 7, 76, 20, 9, 34, 229, 211, 4, 92,
+ 76, 20, 9, 34, 229, 211, 4, 131, 217, 100, 76, 20, 9, 34, 229, 211, 4,
+ 99, 76, 20, 9, 34, 99, 4, 223, 7, 76, 20, 9, 34, 99, 4, 182, 76, 20, 9,
+ 34, 99, 4, 221, 211, 76, 20, 9, 34, 99, 4, 92, 76, 20, 9, 34, 99, 4, 131,
+ 217, 100, 76, 20, 9, 34, 99, 4, 99, 76, 20, 9, 34, 199, 42, 4, 200, 182,
+ 131, 76, 20, 9, 34, 207, 72, 4, 200, 182, 131, 76, 20, 9, 34, 131, 217,
+ 100, 4, 200, 182, 131, 76, 20, 9, 34, 203, 156, 4, 237, 244, 76, 20, 9,
+ 34, 203, 156, 4, 222, 51, 76, 20, 9, 34, 203, 156, 4, 233, 71, 76, 20, 9,
+ 34, 203, 156, 4, 237, 246, 76, 20, 9, 34, 203, 156, 4, 222, 53, 76, 20,
+ 9, 34, 203, 156, 4, 200, 182, 131, 76, 20, 9, 34, 99, 4, 230, 58, 93, 4,
+ 207, 72, 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 191, 114, 53, 20, 9, 34,
+ 99, 4, 230, 58, 93, 4, 92, 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 213, 25,
+ 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 131, 217, 100, 53, 20, 9, 34, 99,
+ 4, 230, 58, 93, 4, 99, 53, 20, 9, 34, 248, 246, 4, 207, 72, 53, 20, 9,
+ 34, 248, 246, 4, 191, 114, 53, 20, 9, 34, 248, 246, 4, 92, 53, 20, 9, 34,
+ 248, 246, 4, 213, 25, 53, 20, 9, 34, 248, 246, 4, 131, 217, 100, 53, 20,
+ 9, 34, 248, 246, 4, 99, 53, 20, 9, 34, 199, 115, 4, 207, 72, 53, 20, 9,
+ 34, 199, 115, 4, 191, 114, 53, 20, 9, 34, 199, 115, 4, 92, 53, 20, 9, 34,
+ 199, 115, 4, 213, 25, 53, 20, 9, 34, 199, 115, 4, 131, 217, 100, 53, 20,
+ 9, 34, 199, 115, 4, 99, 53, 20, 9, 34, 199, 30, 4, 207, 72, 53, 20, 9,
+ 34, 199, 30, 4, 191, 114, 53, 20, 9, 34, 199, 30, 4, 92, 53, 20, 9, 34,
+ 199, 30, 4, 213, 25, 53, 20, 9, 34, 199, 30, 4, 131, 217, 100, 53, 20, 9,
+ 34, 199, 30, 4, 99, 53, 20, 9, 34, 233, 47, 4, 131, 217, 100, 53, 20, 9,
+ 34, 233, 47, 4, 99, 53, 20, 9, 34, 208, 90, 4, 131, 217, 100, 53, 20, 9,
+ 34, 208, 90, 4, 99, 53, 20, 9, 34, 222, 107, 4, 131, 53, 20, 9, 34, 222,
+ 107, 4, 220, 36, 53, 20, 9, 34, 222, 107, 4, 92, 53, 20, 9, 34, 222, 107,
+ 4, 131, 217, 100, 53, 20, 9, 34, 222, 107, 4, 99, 53, 20, 9, 34, 220, 36,
+ 4, 92, 53, 20, 9, 34, 220, 36, 4, 131, 217, 100, 53, 20, 9, 34, 220, 36,
+ 4, 99, 53, 20, 9, 34, 92, 4, 131, 53, 20, 9, 34, 92, 4, 92, 53, 20, 9,
+ 34, 213, 25, 4, 207, 72, 53, 20, 9, 34, 213, 25, 4, 191, 114, 53, 20, 9,
+ 34, 213, 25, 4, 92, 53, 20, 9, 34, 213, 25, 4, 213, 25, 53, 20, 9, 34,
+ 213, 25, 4, 131, 217, 100, 53, 20, 9, 34, 213, 25, 4, 99, 53, 20, 9, 34,
+ 131, 217, 100, 4, 200, 182, 131, 53, 20, 9, 34, 99, 4, 207, 72, 53, 20,
+ 9, 34, 99, 4, 191, 114, 53, 20, 9, 34, 99, 4, 92, 53, 20, 9, 34, 99, 4,
+ 213, 25, 53, 20, 9, 34, 99, 4, 131, 217, 100, 53, 20, 9, 34, 99, 4, 99,
+ 53, 20, 9, 34, 99, 4, 230, 58, 93, 4, 223, 7, 89, 20, 9, 34, 99, 4, 230,
+ 58, 93, 4, 182, 89, 20, 9, 34, 99, 4, 230, 58, 93, 4, 221, 211, 89, 20,
+ 9, 34, 99, 4, 230, 58, 93, 4, 92, 89, 20, 9, 34, 99, 4, 230, 58, 93, 4,
+ 229, 211, 89, 20, 9, 34, 248, 246, 4, 223, 7, 89, 20, 9, 34, 248, 246, 4,
+ 182, 89, 20, 9, 34, 248, 246, 4, 221, 211, 89, 20, 9, 34, 248, 246, 4,
+ 92, 89, 20, 9, 34, 248, 246, 4, 229, 211, 89, 20, 9, 34, 199, 115, 4,
+ 223, 7, 89, 20, 9, 34, 199, 115, 4, 182, 89, 20, 9, 34, 199, 115, 4, 221,
+ 211, 89, 20, 9, 34, 199, 115, 4, 92, 89, 20, 9, 34, 199, 115, 4, 229,
+ 211, 89, 20, 9, 34, 199, 30, 4, 92, 89, 20, 9, 34, 223, 7, 4, 182, 89,
+ 20, 9, 34, 223, 7, 4, 92, 89, 20, 9, 34, 182, 4, 223, 7, 89, 20, 9, 34,
+ 182, 4, 92, 89, 20, 9, 34, 221, 211, 4, 223, 7, 89, 20, 9, 34, 221, 211,
+ 4, 92, 89, 20, 9, 34, 205, 47, 4, 223, 7, 89, 20, 9, 34, 205, 47, 4, 182,
+ 89, 20, 9, 34, 205, 47, 4, 221, 211, 89, 20, 9, 34, 205, 47, 4, 92, 89,
+ 20, 9, 34, 205, 193, 4, 182, 89, 20, 9, 34, 205, 193, 4, 221, 211, 89,
+ 20, 9, 34, 205, 193, 4, 92, 89, 20, 9, 34, 238, 27, 4, 223, 7, 89, 20, 9,
+ 34, 238, 27, 4, 182, 89, 20, 9, 34, 238, 27, 4, 221, 211, 89, 20, 9, 34,
+ 238, 27, 4, 92, 89, 20, 9, 34, 199, 220, 4, 182, 89, 20, 9, 34, 191, 117,
+ 4, 92, 89, 20, 9, 34, 251, 231, 4, 223, 7, 89, 20, 9, 34, 251, 231, 4,
+ 92, 89, 20, 9, 34, 231, 87, 4, 223, 7, 89, 20, 9, 34, 231, 87, 4, 92, 89,
+ 20, 9, 34, 233, 47, 4, 223, 7, 89, 20, 9, 34, 233, 47, 4, 182, 89, 20, 9,
+ 34, 233, 47, 4, 221, 211, 89, 20, 9, 34, 233, 47, 4, 92, 89, 20, 9, 34,
+ 208, 90, 4, 182, 89, 20, 9, 34, 208, 90, 4, 92, 89, 20, 9, 34, 222, 107,
+ 4, 223, 7, 89, 20, 9, 34, 222, 107, 4, 182, 89, 20, 9, 34, 222, 107, 4,
+ 221, 211, 89, 20, 9, 34, 222, 107, 4, 220, 36, 89, 20, 9, 34, 222, 107,
+ 4, 92, 89, 20, 9, 34, 220, 36, 4, 223, 7, 89, 20, 9, 34, 220, 36, 4, 182,
+ 89, 20, 9, 34, 220, 36, 4, 221, 211, 89, 20, 9, 34, 220, 36, 4, 92, 89,
+ 20, 9, 34, 220, 36, 4, 229, 211, 89, 20, 9, 34, 92, 4, 223, 7, 89, 20, 9,
+ 34, 92, 4, 182, 89, 20, 9, 34, 92, 4, 221, 211, 89, 20, 9, 34, 92, 4, 92,
+ 89, 20, 9, 34, 213, 25, 4, 223, 7, 89, 20, 9, 34, 213, 25, 4, 182, 89,
+ 20, 9, 34, 213, 25, 4, 221, 211, 89, 20, 9, 34, 213, 25, 4, 92, 89, 20,
+ 9, 34, 213, 25, 4, 229, 211, 89, 20, 9, 34, 229, 211, 4, 223, 7, 89, 20,
+ 9, 34, 229, 211, 4, 92, 89, 20, 9, 34, 229, 211, 4, 200, 182, 131, 89,
+ 20, 9, 34, 99, 4, 223, 7, 89, 20, 9, 34, 99, 4, 182, 89, 20, 9, 34, 99,
+ 4, 221, 211, 89, 20, 9, 34, 99, 4, 92, 89, 20, 9, 34, 99, 4, 229, 211,
+ 89, 20, 9, 34, 99, 4, 230, 58, 93, 4, 92, 216, 217, 20, 9, 34, 99, 4,
+ 230, 58, 93, 4, 229, 211, 216, 217, 20, 9, 34, 248, 246, 4, 92, 216, 217,
+ 20, 9, 34, 248, 246, 4, 229, 211, 216, 217, 20, 9, 34, 199, 115, 4, 92,
+ 216, 217, 20, 9, 34, 199, 115, 4, 229, 211, 216, 217, 20, 9, 34, 199, 30,
+ 4, 92, 216, 217, 20, 9, 34, 199, 30, 4, 229, 211, 216, 217, 20, 9, 34,
+ 205, 47, 4, 92, 216, 217, 20, 9, 34, 205, 47, 4, 229, 211, 216, 217, 20,
+ 9, 34, 203, 110, 4, 92, 216, 217, 20, 9, 34, 203, 110, 4, 229, 211, 216,
+ 217, 20, 9, 34, 222, 107, 4, 220, 36, 216, 217, 20, 9, 34, 222, 107, 4,
+ 92, 216, 217, 20, 9, 34, 220, 36, 4, 92, 216, 217, 20, 9, 34, 213, 25, 4,
+ 92, 216, 217, 20, 9, 34, 213, 25, 4, 229, 211, 216, 217, 20, 9, 34, 99,
+ 4, 92, 216, 217, 20, 9, 34, 99, 4, 229, 211, 216, 217, 20, 9, 34, 203,
+ 156, 4, 233, 71, 216, 217, 20, 9, 34, 203, 156, 4, 237, 246, 216, 217,
+ 20, 9, 34, 203, 156, 4, 222, 53, 216, 217, 20, 9, 34, 199, 220, 4, 131,
+ 217, 100, 76, 20, 9, 34, 199, 220, 4, 99, 76, 20, 9, 34, 251, 231, 4,
+ 131, 217, 100, 76, 20, 9, 34, 251, 231, 4, 99, 76, 20, 9, 34, 231, 87, 4,
+ 131, 217, 100, 76, 20, 9, 34, 231, 87, 4, 99, 76, 20, 9, 34, 205, 47, 4,
+ 131, 217, 100, 76, 20, 9, 34, 205, 47, 4, 99, 76, 20, 9, 34, 203, 110, 4,
+ 131, 217, 100, 76, 20, 9, 34, 203, 110, 4, 99, 76, 20, 9, 34, 182, 4,
+ 131, 217, 100, 76, 20, 9, 34, 182, 4, 99, 76, 20, 9, 34, 223, 7, 4, 131,
+ 217, 100, 76, 20, 9, 34, 223, 7, 4, 99, 76, 20, 9, 34, 221, 211, 4, 131,
+ 217, 100, 76, 20, 9, 34, 221, 211, 4, 99, 76, 20, 9, 34, 205, 193, 4,
+ 131, 217, 100, 76, 20, 9, 34, 205, 193, 4, 99, 76, 20, 9, 34, 238, 27, 4,
+ 131, 217, 100, 76, 20, 9, 34, 238, 27, 4, 99, 76, 20, 9, 34, 203, 110, 4,
+ 223, 7, 76, 20, 9, 34, 203, 110, 4, 182, 76, 20, 9, 34, 203, 110, 4, 221,
+ 211, 76, 20, 9, 34, 203, 110, 4, 92, 76, 20, 9, 34, 203, 110, 4, 207, 72,
+ 76, 20, 9, 34, 205, 47, 4, 207, 72, 76, 20, 9, 34, 205, 193, 4, 207, 72,
+ 76, 20, 9, 34, 238, 27, 4, 207, 72, 76, 20, 9, 34, 199, 220, 4, 131, 217,
+ 100, 53, 20, 9, 34, 199, 220, 4, 99, 53, 20, 9, 34, 251, 231, 4, 131,
+ 217, 100, 53, 20, 9, 34, 251, 231, 4, 99, 53, 20, 9, 34, 231, 87, 4, 131,
+ 217, 100, 53, 20, 9, 34, 231, 87, 4, 99, 53, 20, 9, 34, 205, 47, 4, 131,
+ 217, 100, 53, 20, 9, 34, 205, 47, 4, 99, 53, 20, 9, 34, 203, 110, 4, 131,
+ 217, 100, 53, 20, 9, 34, 203, 110, 4, 99, 53, 20, 9, 34, 182, 4, 131,
+ 217, 100, 53, 20, 9, 34, 182, 4, 99, 53, 20, 9, 34, 223, 7, 4, 131, 217,
+ 100, 53, 20, 9, 34, 223, 7, 4, 99, 53, 20, 9, 34, 221, 211, 4, 131, 217,
+ 100, 53, 20, 9, 34, 221, 211, 4, 99, 53, 20, 9, 34, 205, 193, 4, 131,
+ 217, 100, 53, 20, 9, 34, 205, 193, 4, 99, 53, 20, 9, 34, 238, 27, 4, 131,
+ 217, 100, 53, 20, 9, 34, 238, 27, 4, 99, 53, 20, 9, 34, 203, 110, 4, 223,
+ 7, 53, 20, 9, 34, 203, 110, 4, 182, 53, 20, 9, 34, 203, 110, 4, 221, 211,
+ 53, 20, 9, 34, 203, 110, 4, 92, 53, 20, 9, 34, 203, 110, 4, 207, 72, 53,
+ 20, 9, 34, 205, 47, 4, 207, 72, 53, 20, 9, 34, 205, 193, 4, 207, 72, 53,
+ 20, 9, 34, 238, 27, 4, 207, 72, 53, 20, 9, 34, 203, 110, 4, 223, 7, 89,
+ 20, 9, 34, 203, 110, 4, 182, 89, 20, 9, 34, 203, 110, 4, 221, 211, 89,
+ 20, 9, 34, 203, 110, 4, 92, 89, 20, 9, 34, 205, 47, 4, 229, 211, 89, 20,
+ 9, 34, 203, 110, 4, 229, 211, 89, 20, 9, 34, 199, 220, 4, 92, 89, 20, 9,
+ 34, 205, 47, 4, 223, 7, 216, 217, 20, 9, 34, 205, 47, 4, 182, 216, 217,
+ 20, 9, 34, 205, 47, 4, 221, 211, 216, 217, 20, 9, 34, 203, 110, 4, 223,
+ 7, 216, 217, 20, 9, 34, 203, 110, 4, 182, 216, 217, 20, 9, 34, 203, 110,
+ 4, 221, 211, 216, 217, 20, 9, 34, 199, 220, 4, 92, 216, 217, 20, 9, 34,
+ 191, 117, 4, 92, 216, 217, 20, 9, 34, 131, 4, 233, 69, 53, 20, 9, 34,
+ 131, 4, 233, 69, 76, 20, 211, 40, 45, 210, 113, 211, 40, 50, 210, 113, 9,
+ 34, 207, 159, 251, 173, 9, 34, 207, 167, 251, 172, 251, 107, 9, 34, 207,
+ 167, 251, 172, 251, 106, 9, 34, 207, 167, 251, 172, 251, 104, 9, 34, 207,
+ 167, 251, 172, 251, 103, 9, 34, 207, 167, 251, 172, 251, 102, 9, 34, 205,
+ 162, 251, 197, 193, 184, 9, 34, 251, 197, 250, 217, 9, 34, 251, 196, 250,
+ 217, 9, 34, 251, 195, 250, 217, 9, 34, 251, 197, 250, 216, 193, 154, 9,
+ 34, 208, 17, 202, 140, 9, 34, 205, 160, 251, 197, 193, 180, 193, 183, 9,
+ 34, 251, 200, 250, 217, 9, 34, 199, 235, 193, 182, 9, 34, 207, 158, 251,
+ 173, 9, 34, 199, 115, 4, 223, 7, 4, 92, 89, 20, 9, 34, 199, 115, 4, 182,
+ 4, 223, 7, 53, 20, 9, 34, 199, 115, 4, 182, 4, 223, 7, 89, 20, 9, 34,
+ 199, 115, 4, 182, 4, 92, 89, 20, 9, 34, 199, 115, 4, 221, 211, 4, 92, 89,
+ 20, 9, 34, 199, 115, 4, 92, 4, 223, 7, 89, 20, 9, 34, 199, 115, 4, 92, 4,
+ 182, 89, 20, 9, 34, 199, 115, 4, 92, 4, 221, 211, 89, 20, 9, 34, 223, 7,
+ 4, 92, 4, 182, 53, 20, 9, 34, 223, 7, 4, 92, 4, 182, 89, 20, 9, 34, 182,
+ 4, 92, 4, 99, 53, 20, 9, 34, 182, 4, 92, 4, 131, 217, 100, 53, 20, 9, 34,
+ 205, 47, 4, 182, 4, 223, 7, 89, 20, 9, 34, 205, 47, 4, 223, 7, 4, 182,
+ 89, 20, 9, 34, 205, 47, 4, 223, 7, 4, 131, 217, 100, 53, 20, 9, 34, 205,
+ 47, 4, 92, 4, 182, 53, 20, 9, 34, 205, 47, 4, 92, 4, 182, 89, 20, 9, 34,
+ 205, 47, 4, 92, 4, 223, 7, 89, 20, 9, 34, 205, 47, 4, 92, 4, 92, 53, 20,
+ 9, 34, 205, 47, 4, 92, 4, 92, 89, 20, 9, 34, 205, 193, 4, 182, 4, 182,
+ 53, 20, 9, 34, 205, 193, 4, 182, 4, 182, 89, 20, 9, 34, 205, 193, 4, 92,
+ 4, 92, 53, 20, 9, 34, 203, 110, 4, 182, 4, 92, 53, 20, 9, 34, 203, 110,
+ 4, 182, 4, 92, 89, 20, 9, 34, 203, 110, 4, 223, 7, 4, 99, 53, 20, 9, 34,
+ 203, 110, 4, 92, 4, 221, 211, 53, 20, 9, 34, 203, 110, 4, 92, 4, 221,
+ 211, 89, 20, 9, 34, 203, 110, 4, 92, 4, 92, 53, 20, 9, 34, 203, 110, 4,
+ 92, 4, 92, 89, 20, 9, 34, 238, 27, 4, 182, 4, 131, 217, 100, 53, 20, 9,
+ 34, 238, 27, 4, 221, 211, 4, 92, 53, 20, 9, 34, 238, 27, 4, 221, 211, 4,
+ 92, 89, 20, 9, 34, 199, 220, 4, 92, 4, 182, 53, 20, 9, 34, 199, 220, 4,
+ 92, 4, 182, 89, 20, 9, 34, 199, 220, 4, 92, 4, 92, 89, 20, 9, 34, 199,
+ 220, 4, 92, 4, 99, 53, 20, 9, 34, 251, 231, 4, 223, 7, 4, 92, 53, 20, 9,
+ 34, 251, 231, 4, 92, 4, 92, 53, 20, 9, 34, 251, 231, 4, 92, 4, 92, 89,
+ 20, 9, 34, 251, 231, 4, 92, 4, 131, 217, 100, 53, 20, 9, 34, 231, 87, 4,
+ 92, 4, 92, 53, 20, 9, 34, 231, 87, 4, 92, 4, 99, 53, 20, 9, 34, 231, 87,
+ 4, 92, 4, 131, 217, 100, 53, 20, 9, 34, 233, 47, 4, 221, 211, 4, 92, 53,
+ 20, 9, 34, 233, 47, 4, 221, 211, 4, 92, 89, 20, 9, 34, 208, 90, 4, 92, 4,
+ 182, 53, 20, 9, 34, 208, 90, 4, 92, 4, 92, 53, 20, 9, 34, 220, 36, 4,
+ 182, 4, 92, 53, 20, 9, 34, 220, 36, 4, 182, 4, 99, 53, 20, 9, 34, 220,
+ 36, 4, 182, 4, 131, 217, 100, 53, 20, 9, 34, 220, 36, 4, 223, 7, 4, 223,
+ 7, 89, 20, 9, 34, 220, 36, 4, 223, 7, 4, 223, 7, 53, 20, 9, 34, 220, 36,
+ 4, 221, 211, 4, 92, 53, 20, 9, 34, 220, 36, 4, 221, 211, 4, 92, 89, 20,
+ 9, 34, 220, 36, 4, 92, 4, 182, 53, 20, 9, 34, 220, 36, 4, 92, 4, 182, 89,
+ 20, 9, 34, 92, 4, 182, 4, 223, 7, 89, 20, 9, 34, 92, 4, 182, 4, 92, 89,
+ 20, 9, 34, 92, 4, 182, 4, 99, 53, 20, 9, 34, 92, 4, 223, 7, 4, 182, 89,
+ 20, 9, 34, 92, 4, 223, 7, 4, 92, 89, 20, 9, 34, 92, 4, 221, 211, 4, 223,
+ 7, 89, 20, 9, 34, 92, 4, 221, 211, 4, 92, 89, 20, 9, 34, 92, 4, 223, 7,
+ 4, 221, 211, 89, 20, 9, 34, 229, 211, 4, 92, 4, 223, 7, 89, 20, 9, 34,
+ 229, 211, 4, 92, 4, 92, 89, 20, 9, 34, 213, 25, 4, 182, 4, 92, 89, 20, 9,
+ 34, 213, 25, 4, 182, 4, 131, 217, 100, 53, 20, 9, 34, 213, 25, 4, 223, 7,
+ 4, 92, 53, 20, 9, 34, 213, 25, 4, 223, 7, 4, 92, 89, 20, 9, 34, 213, 25,
+ 4, 223, 7, 4, 131, 217, 100, 53, 20, 9, 34, 213, 25, 4, 92, 4, 99, 53,
+ 20, 9, 34, 213, 25, 4, 92, 4, 131, 217, 100, 53, 20, 9, 34, 99, 4, 92, 4,
+ 92, 53, 20, 9, 34, 99, 4, 92, 4, 92, 89, 20, 9, 34, 248, 246, 4, 221,
+ 211, 4, 99, 53, 20, 9, 34, 199, 115, 4, 223, 7, 4, 99, 53, 20, 9, 34,
+ 199, 115, 4, 223, 7, 4, 131, 217, 100, 53, 20, 9, 34, 199, 115, 4, 221,
+ 211, 4, 99, 53, 20, 9, 34, 199, 115, 4, 221, 211, 4, 131, 217, 100, 53,
+ 20, 9, 34, 199, 115, 4, 92, 4, 99, 53, 20, 9, 34, 199, 115, 4, 92, 4,
+ 131, 217, 100, 53, 20, 9, 34, 223, 7, 4, 92, 4, 99, 53, 20, 9, 34, 223,
+ 7, 4, 182, 4, 131, 217, 100, 53, 20, 9, 34, 223, 7, 4, 92, 4, 131, 217,
+ 100, 53, 20, 9, 34, 205, 47, 4, 221, 211, 4, 131, 217, 100, 53, 20, 9,
+ 34, 205, 193, 4, 182, 4, 99, 53, 20, 9, 34, 203, 110, 4, 182, 4, 99, 53,
+ 20, 9, 34, 238, 27, 4, 182, 4, 99, 53, 20, 9, 34, 220, 36, 4, 223, 7, 4,
+ 99, 53, 20, 9, 34, 220, 36, 4, 92, 4, 99, 53, 20, 9, 34, 99, 4, 182, 4,
+ 99, 53, 20, 9, 34, 99, 4, 223, 7, 4, 99, 53, 20, 9, 34, 99, 4, 92, 4, 99,
+ 53, 20, 9, 34, 92, 4, 92, 4, 99, 53, 20, 9, 34, 208, 90, 4, 92, 4, 99,
+ 53, 20, 9, 34, 213, 25, 4, 182, 4, 99, 53, 20, 9, 34, 208, 90, 4, 92, 4,
+ 182, 89, 20, 9, 34, 220, 36, 4, 182, 4, 92, 89, 20, 9, 34, 251, 231, 4,
+ 92, 4, 99, 53, 20, 9, 34, 222, 107, 4, 92, 4, 99, 53, 20, 9, 34, 213, 25,
+ 4, 223, 7, 4, 182, 89, 20, 9, 34, 92, 4, 221, 211, 4, 99, 53, 20, 9, 34,
+ 220, 36, 4, 223, 7, 4, 92, 89, 20, 9, 34, 222, 107, 4, 92, 4, 92, 53, 20,
+ 9, 34, 220, 36, 4, 223, 7, 4, 92, 53, 20, 9, 34, 213, 25, 4, 223, 7, 4,
+ 182, 53, 20, 9, 34, 223, 7, 4, 182, 4, 99, 53, 20, 9, 34, 182, 4, 223, 7,
+ 4, 99, 53, 20, 9, 34, 92, 4, 223, 7, 4, 99, 53, 20, 9, 34, 233, 47, 4,
+ 92, 4, 99, 53, 20, 9, 34, 248, 246, 4, 182, 4, 99, 53, 20, 9, 34, 222,
+ 107, 4, 92, 4, 92, 89, 20, 9, 34, 251, 231, 4, 223, 7, 4, 92, 89, 20, 9,
+ 34, 205, 193, 4, 92, 4, 92, 89, 20, 9, 34, 205, 47, 4, 221, 211, 4, 99,
+ 53, 20, 9, 34, 213, 25, 4, 223, 7, 4, 99, 53, 20, 9, 34, 205, 166, 251,
+ 194, 9, 34, 205, 163, 196, 40, 250, 220, 221, 33, 201, 64, 3, 76, 20, 9,
+ 34, 208, 86, 196, 40, 250, 220, 221, 33, 201, 64, 3, 76, 20, 9, 34, 251,
+ 171, 76, 20, 9, 34, 251, 213, 76, 20, 9, 34, 215, 235, 76, 20, 9, 34,
+ 205, 164, 76, 20, 9, 34, 207, 132, 76, 20, 9, 34, 251, 199, 76, 20, 9,
+ 34, 193, 153, 76, 20, 9, 34, 205, 163, 76, 20, 9, 34, 205, 161, 251, 199,
+ 193, 152, 9, 34, 223, 22, 206, 249, 56, 9, 34, 248, 151, 251, 31, 251,
+ 32, 9, 34, 200, 242, 193, 191, 199, 244, 9, 34, 250, 121, 193, 191, 223,
+ 23, 67, 205, 33, 67, 204, 178, 67, 204, 110, 67, 204, 99, 67, 204, 88,
+ 67, 204, 77, 67, 204, 66, 67, 204, 55, 67, 204, 44, 67, 205, 32, 67, 205,
+ 21, 67, 205, 10, 67, 204, 255, 67, 204, 244, 67, 204, 233, 67, 204, 222,
+ 208, 221, 232, 146, 40, 81, 242, 74, 208, 221, 232, 146, 40, 81, 154,
+ 242, 74, 208, 221, 232, 146, 40, 81, 154, 232, 80, 201, 63, 208, 221,
+ 232, 146, 40, 81, 242, 83, 208, 221, 232, 146, 40, 81, 204, 25, 208, 221,
+ 232, 146, 40, 81, 233, 216, 77, 208, 221, 232, 146, 40, 81, 208, 13, 77,
+ 208, 221, 232, 146, 40, 81, 45, 63, 219, 187, 248, 53, 208, 221, 232,
+ 146, 40, 81, 50, 63, 219, 187, 248, 49, 208, 221, 232, 146, 40, 81, 228,
+ 241, 234, 120, 33, 34, 45, 230, 70, 33, 34, 50, 230, 70, 33, 55, 198,
+ 153, 45, 230, 70, 33, 55, 198, 153, 50, 230, 70, 33, 217, 147, 45, 230,
+ 70, 33, 217, 147, 50, 230, 70, 33, 239, 44, 217, 146, 33, 34, 45, 132,
+ 60, 33, 34, 50, 132, 60, 33, 198, 153, 45, 132, 60, 33, 198, 153, 50,
+ 132, 60, 33, 217, 147, 45, 132, 60, 33, 217, 147, 50, 132, 60, 33, 239,
+ 44, 217, 147, 60, 33, 38, 198, 123, 45, 230, 70, 33, 38, 198, 123, 50,
+ 230, 70, 208, 221, 232, 146, 40, 81, 105, 75, 219, 236, 208, 221, 232,
+ 146, 40, 81, 234, 115, 237, 215, 208, 221, 232, 146, 40, 81, 234, 104,
+ 237, 215, 208, 221, 232, 146, 40, 81, 130, 219, 112, 208, 221, 232, 146,
+ 40, 81, 193, 135, 130, 219, 112, 208, 221, 232, 146, 40, 81, 45, 210,
+ 113, 208, 221, 232, 146, 40, 81, 50, 210, 113, 208, 221, 232, 146, 40,
+ 81, 45, 238, 171, 248, 53, 208, 221, 232, 146, 40, 81, 50, 238, 171, 248,
+ 53, 208, 221, 232, 146, 40, 81, 45, 198, 42, 203, 103, 248, 53, 208, 221,
+ 232, 146, 40, 81, 50, 198, 42, 203, 103, 248, 53, 208, 221, 232, 146, 40,
+ 81, 45, 62, 219, 187, 248, 53, 208, 221, 232, 146, 40, 81, 50, 62, 219,
+ 187, 248, 53, 208, 221, 232, 146, 40, 81, 45, 55, 251, 116, 248, 53, 208,
+ 221, 232, 146, 40, 81, 50, 55, 251, 116, 248, 53, 208, 221, 232, 146, 40,
+ 81, 45, 251, 116, 248, 53, 208, 221, 232, 146, 40, 81, 50, 251, 116, 248,
+ 53, 208, 221, 232, 146, 40, 81, 45, 239, 2, 248, 53, 208, 221, 232, 146,
+ 40, 81, 50, 239, 2, 248, 53, 208, 221, 232, 146, 40, 81, 45, 63, 239, 2,
+ 248, 53, 208, 221, 232, 146, 40, 81, 50, 63, 239, 2, 248, 53, 204, 0,
+ 236, 140, 63, 204, 0, 236, 140, 208, 221, 232, 146, 40, 81, 45, 51, 248,
+ 53, 208, 221, 232, 146, 40, 81, 50, 51, 248, 53, 237, 214, 210, 254, 247,
+ 18, 210, 254, 193, 135, 210, 254, 55, 193, 135, 210, 254, 237, 214, 130,
+ 219, 112, 247, 18, 130, 219, 112, 193, 135, 130, 219, 112, 2, 242, 74, 2,
+ 154, 242, 74, 2, 232, 80, 201, 63, 2, 204, 25, 2, 242, 83, 2, 208, 13,
+ 77, 2, 233, 216, 77, 2, 234, 115, 237, 215, 2, 45, 210, 113, 2, 50, 210,
+ 113, 2, 45, 238, 171, 248, 53, 2, 50, 238, 171, 248, 53, 2, 45, 198, 42,
+ 203, 103, 248, 53, 2, 50, 198, 42, 203, 103, 248, 53, 2, 31, 56, 2, 251,
+ 137, 2, 250, 193, 2, 108, 56, 2, 228, 87, 2, 219, 180, 56, 2, 230, 204,
+ 56, 2, 234, 43, 56, 2, 207, 19, 202, 23, 2, 236, 155, 56, 2, 210, 13, 56,
+ 2, 242, 72, 250, 182, 9, 233, 69, 76, 20, 9, 199, 169, 4, 233, 69, 58, 9,
+ 237, 244, 76, 20, 9, 199, 216, 232, 117, 9, 222, 51, 76, 20, 9, 233, 71,
+ 76, 20, 9, 233, 71, 216, 217, 20, 9, 237, 246, 76, 20, 9, 237, 246, 216,
+ 217, 20, 9, 222, 53, 76, 20, 9, 222, 53, 216, 217, 20, 9, 203, 156, 76,
+ 20, 9, 203, 156, 216, 217, 20, 9, 200, 207, 76, 20, 9, 200, 207, 216,
+ 217, 20, 9, 1, 230, 58, 76, 20, 9, 1, 131, 4, 217, 142, 93, 76, 20, 9, 1,
+ 131, 4, 217, 142, 93, 53, 20, 9, 1, 131, 4, 230, 58, 93, 76, 20, 9, 1,
+ 131, 4, 230, 58, 93, 53, 20, 9, 1, 193, 134, 4, 230, 58, 93, 76, 20, 9,
+ 1, 193, 134, 4, 230, 58, 93, 53, 20, 9, 1, 131, 4, 230, 58, 248, 233, 76,
+ 20, 9, 1, 131, 4, 230, 58, 248, 233, 53, 20, 9, 1, 99, 4, 230, 58, 93,
+ 76, 20, 9, 1, 99, 4, 230, 58, 93, 53, 20, 9, 1, 99, 4, 230, 58, 93, 89,
+ 20, 9, 1, 99, 4, 230, 58, 93, 216, 217, 20, 9, 1, 131, 76, 20, 9, 1, 131,
+ 53, 20, 9, 1, 248, 246, 76, 20, 9, 1, 248, 246, 53, 20, 9, 1, 248, 246,
+ 89, 20, 9, 1, 248, 246, 216, 217, 20, 9, 1, 199, 115, 217, 63, 76, 20, 9,
+ 1, 199, 115, 217, 63, 53, 20, 9, 1, 199, 115, 76, 20, 9, 1, 199, 115, 53,
+ 20, 9, 1, 199, 115, 89, 20, 9, 1, 199, 115, 216, 217, 20, 9, 1, 199, 30,
+ 76, 20, 9, 1, 199, 30, 53, 20, 9, 1, 199, 30, 89, 20, 9, 1, 199, 30, 216,
+ 217, 20, 9, 1, 223, 7, 76, 20, 9, 1, 223, 7, 53, 20, 9, 1, 223, 7, 89,
+ 20, 9, 1, 223, 7, 216, 217, 20, 9, 1, 182, 76, 20, 9, 1, 182, 53, 20, 9,
+ 1, 182, 89, 20, 9, 1, 182, 216, 217, 20, 9, 1, 221, 211, 76, 20, 9, 1,
+ 221, 211, 53, 20, 9, 1, 221, 211, 89, 20, 9, 1, 221, 211, 216, 217, 20,
+ 9, 1, 238, 4, 76, 20, 9, 1, 238, 4, 53, 20, 9, 1, 199, 42, 76, 20, 9, 1,
+ 199, 42, 53, 20, 9, 1, 207, 72, 76, 20, 9, 1, 207, 72, 53, 20, 9, 1, 191,
+ 114, 76, 20, 9, 1, 191, 114, 53, 20, 9, 1, 205, 47, 76, 20, 9, 1, 205,
+ 47, 53, 20, 9, 1, 205, 47, 89, 20, 9, 1, 205, 47, 216, 217, 20, 9, 1,
+ 203, 110, 76, 20, 9, 1, 203, 110, 53, 20, 9, 1, 203, 110, 89, 20, 9, 1,
+ 203, 110, 216, 217, 20, 9, 1, 205, 193, 76, 20, 9, 1, 205, 193, 53, 20,
+ 9, 1, 205, 193, 89, 20, 9, 1, 205, 193, 216, 217, 20, 9, 1, 238, 27, 76,
+ 20, 9, 1, 238, 27, 53, 20, 9, 1, 238, 27, 89, 20, 9, 1, 238, 27, 216,
+ 217, 20, 9, 1, 199, 220, 76, 20, 9, 1, 199, 220, 53, 20, 9, 1, 199, 220,
+ 89, 20, 9, 1, 199, 220, 216, 217, 20, 9, 1, 191, 117, 76, 20, 9, 1, 191,
+ 117, 53, 20, 9, 1, 191, 117, 89, 20, 9, 1, 191, 117, 216, 217, 20, 9, 1,
+ 251, 231, 76, 20, 9, 1, 251, 231, 53, 20, 9, 1, 251, 231, 89, 20, 9, 1,
+ 251, 231, 216, 217, 20, 9, 1, 231, 87, 76, 20, 9, 1, 231, 87, 53, 20, 9,
+ 1, 231, 87, 89, 20, 9, 1, 231, 87, 216, 217, 20, 9, 1, 233, 47, 76, 20,
+ 9, 1, 233, 47, 53, 20, 9, 1, 233, 47, 89, 20, 9, 1, 233, 47, 216, 217,
+ 20, 9, 1, 208, 90, 76, 20, 9, 1, 208, 90, 53, 20, 9, 1, 208, 90, 89, 20,
+ 9, 1, 208, 90, 216, 217, 20, 9, 1, 222, 107, 76, 20, 9, 1, 222, 107, 53,
+ 20, 9, 1, 222, 107, 89, 20, 9, 1, 222, 107, 216, 217, 20, 9, 1, 220, 36,
+ 76, 20, 9, 1, 220, 36, 53, 20, 9, 1, 220, 36, 89, 20, 9, 1, 220, 36, 216,
+ 217, 20, 9, 1, 92, 76, 20, 9, 1, 92, 53, 20, 9, 1, 92, 89, 20, 9, 1, 92,
+ 216, 217, 20, 9, 1, 213, 25, 76, 20, 9, 1, 213, 25, 53, 20, 9, 1, 213,
+ 25, 89, 20, 9, 1, 213, 25, 216, 217, 20, 9, 1, 229, 211, 76, 20, 9, 1,
+ 229, 211, 53, 20, 9, 1, 229, 211, 89, 20, 9, 1, 229, 211, 216, 217, 20,
+ 9, 1, 193, 134, 76, 20, 9, 1, 193, 134, 53, 20, 9, 1, 131, 217, 100, 76,
+ 20, 9, 1, 131, 217, 100, 53, 20, 9, 1, 99, 76, 20, 9, 1, 99, 53, 20, 9,
+ 1, 99, 89, 20, 9, 1, 99, 216, 217, 20, 9, 34, 220, 36, 4, 131, 4, 217,
+ 142, 93, 76, 20, 9, 34, 220, 36, 4, 131, 4, 217, 142, 93, 53, 20, 9, 34,
+ 220, 36, 4, 131, 4, 230, 58, 93, 76, 20, 9, 34, 220, 36, 4, 131, 4, 230,
+ 58, 93, 53, 20, 9, 34, 220, 36, 4, 131, 4, 230, 58, 248, 233, 76, 20, 9,
+ 34, 220, 36, 4, 131, 4, 230, 58, 248, 233, 53, 20, 9, 34, 220, 36, 4,
+ 131, 76, 20, 9, 34, 220, 36, 4, 131, 53, 20, 191, 78, 193, 75, 213, 37,
+ 201, 247, 232, 78, 233, 216, 77, 232, 78, 207, 252, 77, 232, 78, 31, 56,
+ 232, 78, 236, 155, 56, 232, 78, 210, 13, 56, 232, 78, 251, 137, 232, 78,
+ 251, 49, 232, 78, 45, 210, 113, 232, 78, 50, 210, 113, 232, 78, 250, 193,
+ 232, 78, 108, 56, 232, 78, 242, 74, 232, 78, 228, 87, 232, 78, 232, 80,
+ 201, 63, 232, 78, 202, 23, 232, 78, 17, 191, 77, 232, 78, 17, 107, 232,
+ 78, 17, 109, 232, 78, 17, 138, 232, 78, 17, 134, 232, 78, 17, 149, 232,
+ 78, 17, 169, 232, 78, 17, 175, 232, 78, 17, 171, 232, 78, 17, 178, 232,
+ 78, 242, 83, 232, 78, 204, 25, 232, 78, 219, 180, 56, 232, 78, 234, 43,
+ 56, 232, 78, 230, 204, 56, 232, 78, 208, 13, 77, 232, 78, 242, 72, 250,
+ 182, 232, 78, 8, 6, 1, 65, 232, 78, 8, 6, 1, 250, 120, 232, 78, 8, 6, 1,
+ 247, 193, 232, 78, 8, 6, 1, 238, 127, 232, 78, 8, 6, 1, 71, 232, 78, 8,
+ 6, 1, 233, 175, 232, 78, 8, 6, 1, 232, 51, 232, 78, 8, 6, 1, 230, 116,
+ 232, 78, 8, 6, 1, 68, 232, 78, 8, 6, 1, 223, 35, 232, 78, 8, 6, 1, 222,
+ 152, 232, 78, 8, 6, 1, 172, 232, 78, 8, 6, 1, 218, 168, 232, 78, 8, 6, 1,
+ 215, 61, 232, 78, 8, 6, 1, 74, 232, 78, 8, 6, 1, 210, 236, 232, 78, 8, 6,
+ 1, 208, 104, 232, 78, 8, 6, 1, 146, 232, 78, 8, 6, 1, 206, 8, 232, 78, 8,
+ 6, 1, 200, 43, 232, 78, 8, 6, 1, 66, 232, 78, 8, 6, 1, 196, 12, 232, 78,
+ 8, 6, 1, 193, 224, 232, 78, 8, 6, 1, 192, 235, 232, 78, 8, 6, 1, 192,
+ 159, 232, 78, 8, 6, 1, 191, 166, 232, 78, 45, 51, 248, 53, 232, 78, 207,
+ 19, 202, 23, 232, 78, 50, 51, 248, 53, 232, 78, 243, 2, 252, 60, 232, 78,
+ 130, 219, 112, 232, 78, 230, 211, 252, 60, 232, 78, 8, 2, 1, 65, 232, 78,
+ 8, 2, 1, 250, 120, 232, 78, 8, 2, 1, 247, 193, 232, 78, 8, 2, 1, 238,
+ 127, 232, 78, 8, 2, 1, 71, 232, 78, 8, 2, 1, 233, 175, 232, 78, 8, 2, 1,
+ 232, 51, 232, 78, 8, 2, 1, 230, 116, 232, 78, 8, 2, 1, 68, 232, 78, 8, 2,
+ 1, 223, 35, 232, 78, 8, 2, 1, 222, 152, 232, 78, 8, 2, 1, 172, 232, 78,
+ 8, 2, 1, 218, 168, 232, 78, 8, 2, 1, 215, 61, 232, 78, 8, 2, 1, 74, 232,
+ 78, 8, 2, 1, 210, 236, 232, 78, 8, 2, 1, 208, 104, 232, 78, 8, 2, 1, 146,
+ 232, 78, 8, 2, 1, 206, 8, 232, 78, 8, 2, 1, 200, 43, 232, 78, 8, 2, 1,
+ 66, 232, 78, 8, 2, 1, 196, 12, 232, 78, 8, 2, 1, 193, 224, 232, 78, 8, 2,
+ 1, 192, 235, 232, 78, 8, 2, 1, 192, 159, 232, 78, 8, 2, 1, 191, 166, 232,
+ 78, 45, 238, 171, 248, 53, 232, 78, 81, 219, 112, 232, 78, 50, 238, 171,
+ 248, 53, 232, 78, 198, 152, 232, 78, 45, 63, 210, 113, 232, 78, 50, 63,
+ 210, 113, 150, 154, 232, 80, 201, 63, 150, 45, 239, 2, 248, 53, 150, 50,
+ 239, 2, 248, 53, 150, 154, 242, 74, 150, 72, 82, 236, 140, 150, 72, 1,
+ 193, 48, 150, 72, 1, 2, 65, 150, 72, 1, 2, 68, 150, 72, 1, 2, 66, 150,
+ 72, 1, 2, 71, 150, 72, 1, 2, 74, 150, 72, 1, 2, 170, 150, 72, 1, 2, 191,
+ 225, 150, 72, 1, 2, 192, 12, 150, 72, 1, 2, 197, 94, 150, 222, 48, 208,
+ 191, 202, 5, 77, 150, 72, 1, 65, 150, 72, 1, 68, 150, 72, 1, 66, 150, 72,
+ 1, 71, 150, 72, 1, 74, 150, 72, 1, 155, 150, 72, 1, 221, 166, 150, 72, 1,
+ 220, 232, 150, 72, 1, 222, 22, 150, 72, 1, 221, 67, 150, 72, 1, 188, 150,
+ 72, 1, 202, 222, 150, 72, 1, 201, 4, 150, 72, 1, 205, 68, 150, 72, 1,
+ 202, 46, 150, 72, 1, 190, 190, 150, 72, 1, 198, 193, 150, 72, 1, 197, 94,
+ 150, 72, 1, 199, 145, 150, 72, 1, 159, 150, 72, 1, 180, 150, 72, 1, 213,
+ 219, 150, 72, 1, 212, 178, 150, 72, 1, 214, 121, 150, 72, 1, 213, 43,
+ 150, 72, 1, 140, 150, 72, 1, 229, 158, 150, 72, 1, 228, 159, 150, 72, 1,
+ 229, 245, 150, 72, 1, 229, 23, 150, 72, 1, 174, 150, 72, 1, 216, 100,
+ 150, 72, 1, 215, 155, 150, 72, 1, 216, 232, 150, 72, 1, 216, 12, 150, 72,
+ 1, 170, 150, 72, 1, 191, 225, 150, 72, 1, 192, 12, 150, 72, 1, 165, 150,
+ 72, 1, 207, 1, 150, 72, 1, 206, 68, 150, 72, 1, 207, 113, 150, 72, 1,
+ 206, 162, 150, 72, 1, 193, 190, 150, 72, 1, 215, 61, 150, 72, 195, 20,
+ 202, 5, 77, 150, 72, 204, 30, 202, 5, 77, 150, 30, 233, 3, 150, 30, 1,
+ 221, 113, 150, 30, 1, 201, 167, 150, 30, 1, 221, 106, 150, 30, 1, 213,
+ 204, 150, 30, 1, 213, 202, 150, 30, 1, 213, 201, 150, 30, 1, 198, 168,
+ 150, 30, 1, 201, 156, 150, 30, 1, 206, 239, 150, 30, 1, 206, 234, 150,
+ 30, 1, 206, 231, 150, 30, 1, 206, 224, 150, 30, 1, 206, 219, 150, 30, 1,
+ 206, 214, 150, 30, 1, 206, 225, 150, 30, 1, 206, 237, 150, 30, 1, 216,
+ 77, 150, 30, 1, 209, 169, 150, 30, 1, 201, 164, 150, 30, 1, 209, 158,
+ 150, 30, 1, 202, 160, 150, 30, 1, 201, 161, 150, 30, 1, 223, 222, 150,
+ 30, 1, 243, 24, 150, 30, 1, 201, 171, 150, 30, 1, 243, 91, 150, 30, 1,
+ 221, 188, 150, 30, 1, 199, 7, 150, 30, 1, 209, 209, 150, 30, 1, 229, 142,
+ 150, 30, 1, 65, 150, 30, 1, 252, 25, 150, 30, 1, 170, 150, 30, 1, 192,
+ 129, 150, 30, 1, 234, 65, 150, 30, 1, 71, 150, 30, 1, 192, 67, 150, 30,
+ 1, 192, 80, 150, 30, 1, 74, 150, 30, 1, 193, 190, 150, 30, 1, 193, 176,
+ 150, 30, 1, 211, 151, 150, 30, 1, 192, 12, 150, 30, 1, 66, 150, 30, 1,
+ 193, 107, 150, 30, 1, 193, 125, 150, 30, 1, 193, 86, 150, 30, 1, 191,
+ 225, 150, 30, 1, 233, 242, 150, 30, 1, 192, 33, 150, 30, 1, 68, 232, 78,
+ 247, 24, 56, 232, 78, 209, 8, 56, 232, 78, 213, 12, 56, 232, 78, 217,
+ 146, 232, 78, 248, 22, 164, 232, 78, 192, 71, 56, 232, 78, 193, 31, 56,
+ 150, 232, 141, 156, 195, 135, 150, 118, 57, 150, 196, 66, 57, 150, 96,
+ 57, 150, 235, 119, 57, 150, 62, 201, 190, 150, 63, 243, 10, 223, 106,
+ 251, 96, 251, 127, 223, 106, 251, 96, 204, 10, 223, 106, 251, 96, 199,
+ 80, 211, 175, 207, 43, 246, 239, 207, 43, 246, 239, 32, 78, 5, 250, 104,
+ 65, 32, 78, 5, 250, 73, 71, 32, 78, 5, 250, 82, 68, 32, 78, 5, 250, 50,
+ 74, 32, 78, 5, 250, 100, 66, 32, 78, 5, 250, 119, 238, 32, 32, 78, 5,
+ 250, 66, 237, 146, 32, 78, 5, 250, 106, 237, 44, 32, 78, 5, 250, 96, 236,
+ 174, 32, 78, 5, 250, 60, 235, 89, 32, 78, 5, 250, 54, 223, 32, 32, 78, 5,
+ 250, 65, 223, 10, 32, 78, 5, 250, 75, 222, 201, 32, 78, 5, 250, 46, 222,
+ 182, 32, 78, 5, 250, 34, 155, 32, 78, 5, 250, 67, 222, 22, 32, 78, 5,
+ 250, 44, 221, 166, 32, 78, 5, 250, 41, 221, 67, 32, 78, 5, 250, 30, 220,
+ 232, 32, 78, 5, 250, 31, 174, 32, 78, 5, 250, 97, 216, 232, 32, 78, 5,
+ 250, 38, 216, 100, 32, 78, 5, 250, 95, 216, 12, 32, 78, 5, 250, 87, 215,
+ 155, 32, 78, 5, 250, 108, 180, 32, 78, 5, 250, 86, 214, 121, 32, 78, 5,
+ 250, 80, 213, 219, 32, 78, 5, 250, 59, 213, 43, 32, 78, 5, 250, 56, 212,
+ 178, 32, 78, 5, 250, 115, 168, 32, 78, 5, 250, 39, 210, 63, 32, 78, 5,
+ 250, 72, 209, 185, 32, 78, 5, 250, 99, 209, 73, 32, 78, 5, 250, 61, 208,
+ 165, 32, 78, 5, 250, 94, 208, 96, 32, 78, 5, 250, 33, 208, 75, 32, 78, 5,
+ 250, 89, 208, 57, 32, 78, 5, 250, 78, 208, 45, 32, 78, 5, 250, 51, 165,
+ 32, 78, 5, 250, 83, 207, 113, 32, 78, 5, 250, 58, 207, 1, 32, 78, 5, 250,
+ 117, 206, 162, 32, 78, 5, 250, 84, 206, 68, 32, 78, 5, 250, 79, 188, 32,
+ 78, 5, 250, 102, 205, 68, 32, 78, 5, 250, 70, 202, 222, 32, 78, 5, 250,
+ 98, 202, 46, 32, 78, 5, 250, 53, 201, 4, 32, 78, 5, 250, 52, 190, 190,
+ 32, 78, 5, 250, 113, 199, 145, 32, 78, 5, 250, 74, 198, 193, 32, 78, 5,
+ 250, 111, 159, 32, 78, 5, 250, 42, 197, 94, 32, 78, 5, 250, 57, 193, 190,
+ 32, 78, 5, 250, 36, 193, 125, 32, 78, 5, 250, 71, 193, 86, 32, 78, 5,
+ 250, 69, 193, 48, 32, 78, 5, 250, 93, 191, 123, 32, 78, 5, 250, 37, 191,
+ 87, 32, 78, 5, 250, 90, 191, 7, 32, 78, 5, 250, 85, 254, 215, 32, 78, 5,
+ 250, 68, 254, 103, 32, 78, 5, 250, 27, 250, 163, 32, 78, 5, 250, 40, 235,
+ 45, 32, 78, 5, 250, 23, 235, 44, 32, 78, 5, 250, 63, 212, 110, 32, 78, 5,
+ 250, 81, 208, 163, 32, 78, 5, 250, 49, 208, 167, 32, 78, 5, 250, 35, 207,
+ 180, 32, 78, 5, 250, 77, 207, 179, 32, 78, 5, 250, 43, 206, 155, 32, 78,
+ 5, 250, 45, 199, 246, 32, 78, 5, 250, 25, 197, 41, 32, 78, 5, 250, 22,
+ 109, 32, 78, 16, 250, 92, 32, 78, 16, 250, 91, 32, 78, 16, 250, 88, 32,
+ 78, 16, 250, 76, 32, 78, 16, 250, 64, 32, 78, 16, 250, 62, 32, 78, 16,
+ 250, 55, 32, 78, 16, 250, 48, 32, 78, 16, 250, 47, 32, 78, 16, 250, 32,
+ 32, 78, 16, 250, 29, 32, 78, 16, 250, 28, 32, 78, 16, 250, 26, 32, 78,
+ 16, 250, 24, 32, 78, 157, 250, 21, 217, 90, 32, 78, 157, 250, 20, 193,
+ 35, 32, 78, 157, 250, 19, 237, 128, 32, 78, 157, 250, 18, 234, 40, 32,
+ 78, 157, 250, 17, 217, 56, 32, 78, 157, 250, 16, 201, 110, 32, 78, 157,
+ 250, 15, 233, 223, 32, 78, 157, 250, 14, 207, 142, 32, 78, 157, 250, 13,
+ 203, 112, 32, 78, 157, 250, 12, 229, 237, 32, 78, 157, 250, 11, 201, 255,
+ 32, 78, 157, 250, 10, 248, 109, 32, 78, 157, 250, 9, 238, 239, 32, 78,
+ 157, 250, 8, 247, 250, 32, 78, 157, 250, 7, 193, 95, 32, 78, 157, 250, 6,
+ 249, 84, 32, 78, 157, 250, 5, 211, 115, 32, 78, 157, 250, 4, 201, 223,
+ 32, 78, 157, 250, 3, 238, 136, 32, 78, 215, 221, 250, 2, 222, 74, 32, 78,
+ 215, 221, 250, 1, 222, 85, 32, 78, 157, 250, 0, 211, 131, 32, 78, 157,
+ 249, 255, 193, 62, 32, 78, 157, 249, 254, 32, 78, 215, 221, 249, 253,
+ 251, 7, 32, 78, 215, 221, 249, 252, 216, 178, 32, 78, 157, 249, 251, 248,
+ 21, 32, 78, 157, 249, 250, 230, 250, 32, 78, 157, 249, 249, 32, 78, 157,
+ 249, 248, 193, 26, 32, 78, 157, 249, 247, 32, 78, 157, 249, 246, 32, 78,
+ 157, 249, 245, 228, 187, 32, 78, 157, 249, 244, 32, 78, 157, 249, 243,
+ 32, 78, 157, 249, 242, 32, 78, 215, 221, 249, 240, 197, 56, 32, 78, 157,
+ 249, 239, 32, 78, 157, 249, 238, 32, 78, 157, 249, 237, 242, 213, 32, 78,
+ 157, 249, 236, 32, 78, 157, 249, 235, 32, 78, 157, 249, 234, 231, 196,
+ 32, 78, 157, 249, 233, 250, 248, 32, 78, 157, 249, 232, 32, 78, 157, 249,
+ 231, 32, 78, 157, 249, 230, 32, 78, 157, 249, 229, 32, 78, 157, 249, 228,
+ 32, 78, 157, 249, 227, 32, 78, 157, 249, 226, 32, 78, 157, 249, 225, 32,
+ 78, 157, 249, 224, 32, 78, 157, 249, 223, 215, 213, 32, 78, 157, 249,
+ 222, 32, 78, 157, 249, 221, 197, 254, 32, 78, 157, 249, 220, 32, 78, 157,
+ 249, 219, 32, 78, 157, 249, 218, 32, 78, 157, 249, 217, 32, 78, 157, 249,
+ 216, 32, 78, 157, 249, 215, 32, 78, 157, 249, 214, 32, 78, 157, 249, 213,
+ 32, 78, 157, 249, 212, 32, 78, 157, 249, 211, 32, 78, 157, 249, 210, 32,
+ 78, 157, 249, 209, 229, 200, 32, 78, 157, 249, 188, 232, 155, 32, 78,
+ 157, 249, 185, 249, 59, 32, 78, 157, 249, 180, 201, 232, 32, 78, 157,
+ 249, 179, 57, 32, 78, 157, 249, 178, 32, 78, 157, 249, 177, 200, 131, 32,
+ 78, 157, 249, 176, 32, 78, 157, 249, 175, 32, 78, 157, 249, 174, 193, 90,
+ 243, 138, 32, 78, 157, 249, 173, 243, 138, 32, 78, 157, 249, 172, 243,
+ 139, 232, 113, 32, 78, 157, 249, 171, 193, 93, 32, 78, 157, 249, 170, 32,
+ 78, 157, 249, 169, 32, 78, 215, 221, 249, 168, 236, 235, 32, 78, 157,
+ 249, 167, 32, 78, 157, 249, 166, 32, 78, 157, 249, 164, 32, 78, 157, 249,
+ 163, 32, 78, 157, 249, 162, 32, 78, 157, 249, 161, 237, 218, 32, 78, 157,
+ 249, 160, 32, 78, 157, 249, 159, 32, 78, 157, 249, 158, 32, 78, 157, 249,
+ 157, 32, 78, 157, 249, 156, 32, 78, 157, 195, 82, 249, 241, 32, 78, 157,
+ 195, 82, 249, 208, 32, 78, 157, 195, 82, 249, 207, 32, 78, 157, 195, 82,
+ 249, 206, 32, 78, 157, 195, 82, 249, 205, 32, 78, 157, 195, 82, 249, 204,
+ 32, 78, 157, 195, 82, 249, 203, 32, 78, 157, 195, 82, 249, 202, 32, 78,
+ 157, 195, 82, 249, 201, 32, 78, 157, 195, 82, 249, 200, 32, 78, 157, 195,
+ 82, 249, 199, 32, 78, 157, 195, 82, 249, 198, 32, 78, 157, 195, 82, 249,
+ 197, 32, 78, 157, 195, 82, 249, 196, 32, 78, 157, 195, 82, 249, 195, 32,
+ 78, 157, 195, 82, 249, 194, 32, 78, 157, 195, 82, 249, 193, 32, 78, 157,
+ 195, 82, 249, 192, 32, 78, 157, 195, 82, 249, 191, 32, 78, 157, 195, 82,
+ 249, 190, 32, 78, 157, 195, 82, 249, 189, 32, 78, 157, 195, 82, 249, 187,
+ 32, 78, 157, 195, 82, 249, 186, 32, 78, 157, 195, 82, 249, 184, 32, 78,
+ 157, 195, 82, 249, 183, 32, 78, 157, 195, 82, 249, 182, 32, 78, 157, 195,
+ 82, 249, 181, 32, 78, 157, 195, 82, 249, 165, 32, 78, 157, 195, 82, 249,
+ 155, 252, 18, 193, 23, 204, 11, 219, 112, 252, 18, 193, 23, 204, 11, 236,
+ 140, 252, 18, 243, 126, 77, 252, 18, 31, 107, 252, 18, 31, 109, 252, 18,
+ 31, 138, 252, 18, 31, 134, 252, 18, 31, 149, 252, 18, 31, 169, 252, 18,
+ 31, 175, 252, 18, 31, 171, 252, 18, 31, 178, 252, 18, 31, 199, 95, 252,
+ 18, 31, 197, 32, 252, 18, 31, 198, 249, 252, 18, 31, 232, 135, 252, 18,
+ 31, 233, 15, 252, 18, 31, 202, 120, 252, 18, 31, 203, 241, 252, 18, 31,
+ 234, 153, 252, 18, 31, 213, 169, 252, 18, 31, 91, 228, 140, 252, 18, 31,
+ 105, 228, 140, 252, 18, 31, 115, 228, 140, 252, 18, 31, 232, 128, 228,
+ 140, 252, 18, 31, 232, 226, 228, 140, 252, 18, 31, 202, 136, 228, 140,
+ 252, 18, 31, 203, 247, 228, 140, 252, 18, 31, 234, 164, 228, 140, 252,
+ 18, 31, 213, 175, 228, 140, 252, 18, 31, 91, 189, 252, 18, 31, 105, 189,
+ 252, 18, 31, 115, 189, 252, 18, 31, 232, 128, 189, 252, 18, 31, 232, 226,
+ 189, 252, 18, 31, 202, 136, 189, 252, 18, 31, 203, 247, 189, 252, 18, 31,
+ 234, 164, 189, 252, 18, 31, 213, 175, 189, 252, 18, 31, 199, 96, 189,
+ 252, 18, 31, 197, 33, 189, 252, 18, 31, 198, 250, 189, 252, 18, 31, 232,
+ 136, 189, 252, 18, 31, 233, 16, 189, 252, 18, 31, 202, 121, 189, 252, 18,
+ 31, 203, 242, 189, 252, 18, 31, 234, 154, 189, 252, 18, 31, 213, 170,
+ 189, 252, 18, 193, 110, 249, 75, 196, 90, 252, 18, 193, 110, 232, 238,
+ 200, 224, 252, 18, 193, 110, 205, 57, 200, 224, 252, 18, 193, 110, 199,
+ 1, 200, 224, 252, 18, 193, 110, 232, 121, 200, 224, 252, 18, 235, 92,
+ 216, 228, 232, 238, 200, 224, 252, 18, 219, 93, 216, 228, 232, 238, 200,
+ 224, 252, 18, 216, 228, 205, 57, 200, 224, 252, 18, 216, 228, 199, 1,
+ 200, 224, 35, 252, 50, 250, 165, 91, 208, 22, 35, 252, 50, 250, 165, 91,
+ 230, 70, 35, 252, 50, 250, 165, 91, 235, 115, 35, 252, 50, 250, 165, 149,
+ 35, 252, 50, 250, 165, 233, 15, 35, 252, 50, 250, 165, 232, 226, 228,
+ 140, 35, 252, 50, 250, 165, 232, 226, 189, 35, 252, 50, 250, 165, 233,
+ 16, 189, 35, 252, 50, 250, 165, 232, 226, 199, 203, 35, 252, 50, 250,
+ 165, 199, 96, 199, 203, 35, 252, 50, 250, 165, 233, 16, 199, 203, 35,
+ 252, 50, 250, 165, 91, 228, 141, 199, 203, 35, 252, 50, 250, 165, 232,
+ 226, 228, 141, 199, 203, 35, 252, 50, 250, 165, 91, 198, 230, 199, 203,
+ 35, 252, 50, 250, 165, 232, 226, 198, 230, 199, 203, 35, 252, 50, 250,
+ 165, 232, 226, 201, 94, 35, 252, 50, 250, 165, 199, 96, 201, 94, 35, 252,
+ 50, 250, 165, 233, 16, 201, 94, 35, 252, 50, 250, 165, 91, 228, 141, 201,
+ 94, 35, 252, 50, 250, 165, 232, 226, 228, 141, 201, 94, 35, 252, 50, 250,
+ 165, 91, 198, 230, 201, 94, 35, 252, 50, 250, 165, 199, 96, 198, 230,
+ 201, 94, 35, 252, 50, 250, 165, 233, 16, 198, 230, 201, 94, 35, 252, 50,
+ 250, 165, 199, 96, 216, 15, 35, 252, 50, 229, 194, 91, 209, 92, 35, 252,
+ 50, 199, 17, 107, 35, 252, 50, 229, 190, 107, 35, 252, 50, 234, 51, 109,
+ 35, 252, 50, 199, 17, 109, 35, 252, 50, 238, 132, 105, 235, 114, 35, 252,
+ 50, 234, 51, 105, 235, 114, 35, 252, 50, 197, 216, 149, 35, 252, 50, 197,
+ 216, 199, 95, 35, 252, 50, 197, 216, 199, 96, 251, 157, 20, 35, 252, 50,
+ 229, 190, 199, 95, 35, 252, 50, 216, 167, 199, 95, 35, 252, 50, 199, 17,
+ 199, 95, 35, 252, 50, 199, 17, 198, 249, 35, 252, 50, 197, 216, 233, 15,
+ 35, 252, 50, 197, 216, 233, 16, 251, 157, 20, 35, 252, 50, 229, 190, 233,
+ 15, 35, 252, 50, 199, 17, 233, 15, 35, 252, 50, 199, 17, 91, 228, 140,
+ 35, 252, 50, 199, 17, 115, 228, 140, 35, 252, 50, 234, 51, 232, 226, 228,
+ 140, 35, 252, 50, 197, 216, 232, 226, 228, 140, 35, 252, 50, 199, 17,
+ 232, 226, 228, 140, 35, 252, 50, 247, 82, 232, 226, 228, 140, 35, 252,
+ 50, 214, 199, 232, 226, 228, 140, 35, 252, 50, 199, 17, 91, 189, 35, 252,
+ 50, 199, 17, 232, 226, 189, 35, 252, 50, 237, 109, 232, 226, 216, 15, 35,
+ 252, 50, 201, 47, 233, 16, 216, 15, 35, 91, 132, 56, 35, 91, 132, 3, 251,
+ 157, 20, 35, 105, 198, 254, 56, 35, 115, 208, 21, 56, 35, 192, 78, 56,
+ 35, 199, 204, 56, 35, 235, 116, 56, 35, 211, 170, 56, 35, 105, 211, 169,
+ 56, 35, 115, 211, 169, 56, 35, 232, 128, 211, 169, 56, 35, 232, 226, 211,
+ 169, 56, 35, 216, 161, 56, 35, 220, 151, 249, 75, 56, 35, 219, 85, 56,
+ 35, 211, 16, 56, 35, 192, 211, 56, 35, 250, 226, 56, 35, 250, 243, 56,
+ 35, 230, 220, 56, 35, 197, 171, 249, 75, 56, 35, 191, 78, 56, 35, 91,
+ 208, 23, 56, 35, 202, 162, 56, 35, 223, 143, 56, 213, 32, 56, 206, 136,
+ 203, 237, 56, 206, 136, 196, 106, 56, 206, 136, 204, 17, 56, 206, 136,
+ 203, 175, 56, 206, 136, 236, 250, 203, 175, 56, 206, 136, 202, 186, 56,
+ 206, 136, 237, 104, 56, 206, 136, 208, 5, 56, 206, 136, 203, 254, 56,
+ 206, 136, 235, 67, 56, 206, 136, 250, 220, 56, 206, 136, 247, 17, 56,
+ 250, 211, 113, 35, 16, 199, 167, 207, 3, 209, 223, 236, 227, 3, 210, 51,
+ 209, 223, 236, 227, 3, 209, 84, 229, 235, 209, 223, 236, 227, 3, 199,
+ 170, 229, 235, 209, 223, 236, 227, 3, 247, 105, 209, 223, 236, 227, 3,
+ 243, 86, 209, 223, 236, 227, 3, 193, 35, 209, 223, 236, 227, 3, 229, 200,
+ 209, 223, 236, 227, 3, 231, 188, 209, 223, 236, 227, 3, 198, 184, 209,
+ 223, 236, 227, 3, 57, 209, 223, 236, 227, 3, 248, 69, 209, 223, 236, 227,
+ 3, 203, 78, 209, 223, 236, 227, 3, 242, 206, 209, 223, 236, 227, 3, 217,
+ 89, 209, 223, 236, 227, 3, 217, 26, 209, 223, 236, 227, 3, 205, 108, 209,
+ 223, 236, 227, 3, 219, 141, 209, 223, 236, 227, 3, 248, 92, 209, 223,
+ 236, 227, 3, 247, 89, 209, 101, 209, 223, 236, 227, 3, 236, 156, 209,
+ 223, 236, 227, 3, 242, 80, 209, 223, 236, 227, 3, 202, 83, 209, 223, 236,
+ 227, 3, 242, 81, 209, 223, 236, 227, 3, 248, 254, 209, 223, 236, 227, 3,
+ 203, 65, 209, 223, 236, 227, 3, 228, 187, 209, 223, 236, 227, 3, 229,
+ 148, 209, 223, 236, 227, 3, 247, 245, 219, 212, 209, 223, 236, 227, 3,
+ 247, 78, 209, 223, 236, 227, 3, 207, 142, 209, 223, 236, 227, 3, 234,
+ 214, 209, 223, 236, 227, 3, 235, 124, 209, 223, 236, 227, 3, 197, 72,
+ 209, 223, 236, 227, 3, 249, 1, 209, 223, 236, 227, 3, 209, 102, 197, 254,
+ 209, 223, 236, 227, 3, 195, 47, 209, 223, 236, 227, 3, 210, 132, 209,
+ 223, 236, 227, 3, 206, 125, 209, 223, 236, 227, 3, 219, 125, 209, 223,
+ 236, 227, 3, 210, 248, 249, 146, 209, 223, 236, 227, 3, 232, 182, 209,
+ 223, 236, 227, 3, 230, 212, 209, 223, 236, 227, 3, 201, 50, 209, 223,
+ 236, 227, 3, 2, 250, 132, 209, 223, 236, 227, 3, 193, 135, 249, 97, 209,
+ 223, 236, 227, 3, 33, 211, 172, 106, 218, 181, 1, 65, 218, 181, 1, 71,
+ 218, 181, 1, 250, 120, 218, 181, 1, 248, 204, 218, 181, 1, 232, 51, 218,
+ 181, 1, 238, 127, 218, 181, 1, 68, 218, 181, 1, 193, 224, 218, 181, 1,
+ 191, 166, 218, 181, 1, 199, 51, 218, 181, 1, 223, 35, 218, 181, 1, 222,
+ 152, 218, 181, 1, 208, 104, 218, 181, 1, 172, 218, 181, 1, 218, 168, 218,
+ 181, 1, 215, 61, 218, 181, 1, 216, 17, 218, 181, 1, 213, 80, 218, 181, 1,
+ 66, 218, 181, 1, 210, 236, 218, 181, 1, 221, 102, 218, 181, 1, 146, 218,
+ 181, 1, 206, 8, 218, 181, 1, 200, 43, 218, 181, 1, 197, 135, 218, 181, 1,
+ 251, 132, 218, 181, 1, 234, 103, 218, 181, 1, 230, 116, 218, 181, 1, 192,
+ 235, 247, 95, 1, 65, 247, 95, 1, 210, 222, 247, 95, 1, 238, 127, 247, 95,
+ 1, 172, 247, 95, 1, 196, 28, 247, 95, 1, 146, 247, 95, 1, 219, 242, 247,
+ 95, 1, 254, 215, 247, 95, 1, 208, 104, 247, 95, 1, 250, 120, 247, 95, 1,
+ 218, 168, 247, 95, 1, 74, 247, 95, 1, 238, 34, 247, 95, 1, 200, 43, 247,
+ 95, 1, 203, 167, 247, 95, 1, 203, 166, 247, 95, 1, 206, 8, 247, 95, 1,
+ 247, 192, 247, 95, 1, 66, 247, 95, 1, 213, 80, 247, 95, 1, 192, 235, 247,
+ 95, 1, 215, 61, 247, 95, 1, 197, 134, 247, 95, 1, 210, 236, 247, 95, 1,
+ 201, 178, 247, 95, 1, 68, 247, 95, 1, 71, 247, 95, 1, 196, 25, 247, 95,
+ 1, 222, 152, 247, 95, 1, 222, 143, 247, 95, 1, 214, 164, 247, 95, 1, 196,
+ 30, 247, 95, 1, 232, 51, 247, 95, 1, 231, 242, 247, 95, 1, 201, 118, 247,
+ 95, 1, 201, 117, 247, 95, 1, 214, 70, 247, 95, 1, 223, 199, 247, 95, 1,
+ 247, 191, 247, 95, 1, 197, 135, 247, 95, 1, 196, 27, 247, 95, 1, 206,
+ 110, 247, 95, 1, 217, 16, 247, 95, 1, 217, 15, 247, 95, 1, 217, 14, 247,
+ 95, 1, 217, 13, 247, 95, 1, 219, 241, 247, 95, 1, 234, 218, 247, 95, 1,
+ 196, 26, 94, 234, 54, 198, 229, 77, 94, 234, 54, 17, 107, 94, 234, 54,
+ 17, 109, 94, 234, 54, 17, 138, 94, 234, 54, 17, 134, 94, 234, 54, 17,
+ 149, 94, 234, 54, 17, 169, 94, 234, 54, 17, 175, 94, 234, 54, 17, 171,
+ 94, 234, 54, 17, 178, 94, 234, 54, 31, 199, 95, 94, 234, 54, 31, 197, 32,
+ 94, 234, 54, 31, 198, 249, 94, 234, 54, 31, 232, 135, 94, 234, 54, 31,
+ 233, 15, 94, 234, 54, 31, 202, 120, 94, 234, 54, 31, 203, 241, 94, 234,
+ 54, 31, 234, 153, 94, 234, 54, 31, 213, 169, 94, 234, 54, 31, 91, 228,
+ 140, 94, 234, 54, 31, 105, 228, 140, 94, 234, 54, 31, 115, 228, 140, 94,
+ 234, 54, 31, 232, 128, 228, 140, 94, 234, 54, 31, 232, 226, 228, 140, 94,
+ 234, 54, 31, 202, 136, 228, 140, 94, 234, 54, 31, 203, 247, 228, 140, 94,
+ 234, 54, 31, 234, 164, 228, 140, 94, 234, 54, 31, 213, 175, 228, 140, 39,
+ 43, 1, 65, 39, 43, 1, 249, 17, 39, 43, 1, 222, 22, 39, 43, 1, 237, 146,
+ 39, 43, 1, 71, 39, 43, 1, 195, 153, 39, 43, 1, 191, 87, 39, 43, 1, 229,
+ 245, 39, 43, 1, 199, 33, 39, 43, 1, 68, 39, 43, 1, 155, 39, 43, 1, 234,
+ 140, 39, 43, 1, 234, 114, 39, 43, 1, 234, 103, 39, 43, 1, 234, 12, 39,
+ 43, 1, 74, 39, 43, 1, 210, 63, 39, 43, 1, 203, 113, 39, 43, 1, 220, 232,
+ 39, 43, 1, 234, 34, 39, 43, 1, 234, 22, 39, 43, 1, 199, 145, 39, 43, 1,
+ 66, 39, 43, 1, 234, 143, 39, 43, 1, 209, 214, 39, 43, 1, 221, 197, 39,
+ 43, 1, 234, 181, 39, 43, 1, 234, 24, 39, 43, 1, 243, 127, 39, 43, 1, 223,
+ 199, 39, 43, 1, 196, 30, 39, 43, 1, 234, 5, 39, 43, 212, 134, 107, 39,
+ 43, 212, 134, 149, 39, 43, 212, 134, 199, 95, 39, 43, 212, 134, 233, 15,
+ 39, 43, 1, 192, 80, 39, 43, 1, 213, 16, 197, 161, 39, 43, 1, 202, 0, 197,
+ 161, 230, 231, 1, 251, 239, 230, 231, 1, 249, 117, 230, 231, 1, 231, 50,
+ 230, 231, 1, 238, 13, 230, 231, 1, 251, 234, 230, 231, 1, 208, 87, 230,
+ 231, 1, 223, 48, 230, 231, 1, 230, 83, 230, 231, 1, 198, 243, 230, 231,
+ 1, 234, 151, 230, 231, 1, 220, 189, 230, 231, 1, 220, 100, 230, 231, 1,
+ 217, 80, 230, 231, 1, 214, 201, 230, 231, 1, 223, 1, 230, 231, 1, 196,
+ 48, 230, 231, 1, 210, 195, 230, 231, 1, 213, 169, 230, 231, 1, 207, 155,
+ 230, 231, 1, 205, 112, 230, 231, 1, 199, 111, 230, 231, 1, 193, 59, 230,
+ 231, 1, 233, 89, 230, 231, 1, 223, 203, 230, 231, 1, 228, 123, 230, 231,
+ 1, 211, 29, 230, 231, 1, 213, 175, 228, 140, 39, 210, 2, 1, 251, 132, 39,
+ 210, 2, 1, 247, 230, 39, 210, 2, 1, 231, 224, 39, 210, 2, 1, 236, 160,
+ 39, 210, 2, 1, 71, 39, 210, 2, 1, 191, 53, 39, 210, 2, 1, 235, 27, 39,
+ 210, 2, 1, 191, 95, 39, 210, 2, 1, 235, 25, 39, 210, 2, 1, 68, 39, 210,
+ 2, 1, 221, 50, 39, 210, 2, 1, 219, 208, 39, 210, 2, 1, 216, 184, 39, 210,
+ 2, 1, 214, 100, 39, 210, 2, 1, 195, 7, 39, 210, 2, 1, 210, 48, 39, 210,
+ 2, 1, 207, 70, 39, 210, 2, 1, 202, 193, 39, 210, 2, 1, 199, 217, 39, 210,
+ 2, 1, 66, 39, 210, 2, 1, 243, 106, 39, 210, 2, 1, 203, 47, 39, 210, 2, 1,
+ 203, 115, 39, 210, 2, 1, 191, 227, 39, 210, 2, 1, 192, 58, 39, 210, 2, 1,
+ 74, 39, 210, 2, 1, 211, 87, 39, 210, 2, 1, 234, 181, 39, 210, 2, 1, 140,
+ 39, 210, 2, 1, 197, 145, 39, 210, 2, 1, 195, 140, 39, 210, 2, 1, 192, 62,
+ 39, 210, 2, 1, 192, 60, 39, 210, 2, 1, 192, 95, 39, 210, 2, 1, 223, 226,
+ 39, 210, 2, 1, 191, 225, 39, 210, 2, 1, 170, 39, 210, 2, 1, 228, 35, 33,
+ 39, 210, 2, 1, 251, 132, 33, 39, 210, 2, 1, 236, 160, 33, 39, 210, 2, 1,
+ 191, 95, 33, 39, 210, 2, 1, 214, 100, 33, 39, 210, 2, 1, 202, 193, 196,
+ 142, 1, 251, 164, 196, 142, 1, 248, 212, 196, 142, 1, 231, 212, 196, 142,
+ 1, 221, 215, 196, 142, 1, 237, 106, 196, 142, 1, 229, 23, 196, 142, 1,
+ 193, 48, 196, 142, 1, 191, 76, 196, 142, 1, 228, 179, 196, 142, 1, 199,
+ 73, 196, 142, 1, 191, 250, 196, 142, 1, 222, 106, 196, 142, 1, 203, 69,
+ 196, 142, 1, 220, 31, 196, 142, 1, 216, 193, 196, 142, 1, 237, 64, 196,
+ 142, 1, 212, 130, 196, 142, 1, 190, 251, 196, 142, 1, 205, 147, 196, 142,
+ 1, 251, 230, 196, 142, 1, 208, 165, 196, 142, 1, 205, 191, 196, 142, 1,
+ 208, 38, 196, 142, 1, 207, 133, 196, 142, 1, 199, 37, 196, 142, 1, 231,
+ 86, 196, 142, 1, 159, 196, 142, 1, 68, 196, 142, 1, 66, 196, 142, 1, 201,
+ 129, 196, 142, 193, 23, 236, 205, 39, 209, 252, 3, 65, 39, 209, 252, 3,
+ 68, 39, 209, 252, 3, 66, 39, 209, 252, 3, 155, 39, 209, 252, 3, 220, 232,
+ 39, 209, 252, 3, 231, 240, 39, 209, 252, 3, 230, 179, 39, 209, 252, 3,
+ 192, 220, 39, 209, 252, 3, 247, 160, 39, 209, 252, 3, 223, 32, 39, 209,
+ 252, 3, 222, 244, 39, 209, 252, 3, 190, 190, 39, 209, 252, 3, 197, 94,
+ 39, 209, 252, 3, 238, 32, 39, 209, 252, 3, 237, 44, 39, 209, 252, 3, 235,
+ 89, 39, 209, 252, 3, 199, 49, 39, 209, 252, 3, 168, 39, 209, 252, 3, 249,
+ 153, 39, 209, 252, 3, 233, 109, 39, 209, 252, 3, 180, 39, 209, 252, 3,
+ 212, 178, 39, 209, 252, 3, 174, 39, 209, 252, 3, 216, 100, 39, 209, 252,
+ 3, 215, 155, 39, 209, 252, 3, 170, 39, 209, 252, 3, 195, 188, 39, 209,
+ 252, 3, 195, 69, 39, 209, 252, 3, 165, 39, 209, 252, 3, 206, 68, 39, 209,
+ 252, 3, 173, 39, 209, 252, 3, 188, 39, 209, 252, 3, 191, 123, 39, 209,
+ 252, 3, 203, 165, 39, 209, 252, 3, 201, 175, 39, 209, 252, 3, 140, 39,
+ 209, 252, 3, 250, 157, 39, 209, 252, 3, 250, 156, 39, 209, 252, 3, 250,
+ 155, 39, 209, 252, 3, 192, 189, 39, 209, 252, 3, 238, 9, 39, 209, 252, 3,
+ 238, 8, 39, 209, 252, 3, 249, 128, 39, 209, 252, 3, 247, 212, 39, 209,
+ 252, 193, 23, 236, 205, 39, 209, 252, 31, 107, 39, 209, 252, 31, 109, 39,
+ 209, 252, 31, 199, 95, 39, 209, 252, 31, 197, 32, 39, 209, 252, 31, 228,
+ 140, 237, 84, 6, 1, 179, 68, 237, 84, 6, 1, 179, 71, 237, 84, 6, 1, 179,
+ 65, 237, 84, 6, 1, 179, 251, 245, 237, 84, 6, 1, 179, 74, 237, 84, 6, 1,
+ 179, 211, 87, 237, 84, 6, 1, 203, 40, 68, 237, 84, 6, 1, 203, 40, 71,
+ 237, 84, 6, 1, 203, 40, 65, 237, 84, 6, 1, 203, 40, 251, 245, 237, 84, 6,
+ 1, 203, 40, 74, 237, 84, 6, 1, 203, 40, 211, 87, 237, 84, 6, 1, 250, 131,
+ 237, 84, 6, 1, 210, 250, 237, 84, 6, 1, 193, 0, 237, 84, 6, 1, 192, 77,
+ 237, 84, 6, 1, 230, 116, 237, 84, 6, 1, 210, 49, 237, 84, 6, 1, 249, 1,
+ 237, 84, 6, 1, 199, 121, 237, 84, 6, 1, 237, 131, 237, 84, 6, 1, 243,
+ 123, 237, 84, 6, 1, 223, 8, 237, 84, 6, 1, 222, 29, 237, 84, 6, 1, 231,
+ 186, 237, 84, 6, 1, 234, 181, 237, 84, 6, 1, 195, 148, 237, 84, 6, 1,
+ 233, 248, 237, 84, 6, 1, 199, 31, 237, 84, 6, 1, 234, 22, 237, 84, 6, 1,
+ 191, 84, 237, 84, 6, 1, 234, 12, 237, 84, 6, 1, 191, 61, 237, 84, 6, 1,
+ 234, 34, 237, 84, 6, 1, 234, 140, 237, 84, 6, 1, 234, 114, 237, 84, 6, 1,
+ 234, 103, 237, 84, 6, 1, 234, 88, 237, 84, 6, 1, 211, 133, 237, 84, 6, 1,
+ 233, 224, 237, 84, 2, 1, 179, 68, 237, 84, 2, 1, 179, 71, 237, 84, 2, 1,
+ 179, 65, 237, 84, 2, 1, 179, 251, 245, 237, 84, 2, 1, 179, 74, 237, 84,
+ 2, 1, 179, 211, 87, 237, 84, 2, 1, 203, 40, 68, 237, 84, 2, 1, 203, 40,
+ 71, 237, 84, 2, 1, 203, 40, 65, 237, 84, 2, 1, 203, 40, 251, 245, 237,
+ 84, 2, 1, 203, 40, 74, 237, 84, 2, 1, 203, 40, 211, 87, 237, 84, 2, 1,
+ 250, 131, 237, 84, 2, 1, 210, 250, 237, 84, 2, 1, 193, 0, 237, 84, 2, 1,
+ 192, 77, 237, 84, 2, 1, 230, 116, 237, 84, 2, 1, 210, 49, 237, 84, 2, 1,
+ 249, 1, 237, 84, 2, 1, 199, 121, 237, 84, 2, 1, 237, 131, 237, 84, 2, 1,
+ 243, 123, 237, 84, 2, 1, 223, 8, 237, 84, 2, 1, 222, 29, 237, 84, 2, 1,
+ 231, 186, 237, 84, 2, 1, 234, 181, 237, 84, 2, 1, 195, 148, 237, 84, 2,
+ 1, 233, 248, 237, 84, 2, 1, 199, 31, 237, 84, 2, 1, 234, 22, 237, 84, 2,
+ 1, 191, 84, 237, 84, 2, 1, 234, 12, 237, 84, 2, 1, 191, 61, 237, 84, 2,
+ 1, 234, 34, 237, 84, 2, 1, 234, 140, 237, 84, 2, 1, 234, 114, 237, 84, 2,
+ 1, 234, 103, 237, 84, 2, 1, 234, 88, 237, 84, 2, 1, 211, 133, 237, 84, 2,
+ 1, 233, 224, 203, 120, 1, 210, 45, 203, 120, 1, 198, 40, 203, 120, 1,
+ 221, 154, 203, 120, 1, 233, 52, 203, 120, 1, 199, 6, 203, 120, 1, 202,
+ 46, 203, 120, 1, 200, 172, 203, 120, 1, 243, 40, 203, 120, 1, 192, 79,
+ 203, 120, 1, 228, 137, 203, 120, 1, 248, 187, 203, 120, 1, 237, 145, 203,
+ 120, 1, 231, 226, 203, 120, 1, 195, 2, 203, 120, 1, 199, 12, 203, 120, 1,
+ 191, 4, 203, 120, 1, 216, 227, 203, 120, 1, 222, 180, 203, 120, 1, 193,
+ 39, 203, 120, 1, 230, 93, 203, 120, 1, 219, 25, 203, 120, 1, 216, 45,
+ 203, 120, 1, 223, 206, 203, 120, 1, 234, 179, 203, 120, 1, 250, 209, 203,
+ 120, 1, 252, 30, 203, 120, 1, 211, 104, 203, 120, 1, 193, 26, 203, 120,
+ 1, 211, 14, 203, 120, 1, 251, 245, 203, 120, 1, 206, 153, 203, 120, 1,
+ 212, 130, 203, 120, 1, 234, 200, 203, 120, 1, 251, 250, 203, 120, 1, 228,
+ 26, 203, 120, 1, 196, 77, 203, 120, 1, 211, 180, 203, 120, 1, 211, 79,
+ 203, 120, 1, 211, 131, 203, 120, 1, 250, 137, 203, 120, 1, 251, 9, 203,
+ 120, 1, 211, 56, 203, 120, 1, 251, 225, 203, 120, 1, 234, 26, 203, 120,
+ 1, 250, 240, 203, 120, 1, 234, 211, 203, 120, 1, 228, 34, 203, 120, 1,
+ 192, 41, 211, 33, 1, 251, 192, 211, 33, 1, 249, 153, 211, 33, 1, 190,
+ 190, 211, 33, 1, 223, 32, 211, 33, 1, 192, 220, 211, 33, 1, 221, 215,
+ 211, 33, 1, 237, 130, 211, 33, 1, 165, 211, 33, 1, 188, 211, 33, 1, 203,
+ 75, 211, 33, 1, 237, 68, 211, 33, 1, 247, 67, 211, 33, 1, 231, 240, 211,
+ 33, 1, 233, 109, 211, 33, 1, 208, 94, 211, 33, 1, 222, 123, 211, 33, 1,
+ 220, 121, 211, 33, 1, 216, 59, 211, 33, 1, 212, 114, 211, 33, 1, 193,
+ 133, 211, 33, 1, 140, 211, 33, 1, 170, 211, 33, 1, 65, 211, 33, 1, 71,
+ 211, 33, 1, 68, 211, 33, 1, 74, 211, 33, 1, 66, 211, 33, 1, 252, 206,
+ 211, 33, 1, 234, 188, 211, 33, 1, 211, 87, 211, 33, 17, 191, 77, 211, 33,
+ 17, 107, 211, 33, 17, 109, 211, 33, 17, 138, 211, 33, 17, 134, 211, 33,
+ 17, 149, 211, 33, 17, 169, 211, 33, 17, 175, 211, 33, 17, 171, 211, 33,
+ 17, 178, 211, 35, 6, 1, 65, 211, 35, 6, 1, 251, 236, 211, 35, 6, 1, 251,
+ 230, 211, 35, 6, 1, 251, 245, 211, 35, 6, 1, 248, 56, 211, 35, 6, 1, 247,
+ 1, 211, 35, 6, 1, 234, 172, 211, 35, 6, 1, 71, 211, 35, 6, 1, 234, 152,
+ 211, 35, 6, 1, 140, 211, 35, 6, 1, 228, 93, 211, 35, 6, 1, 68, 211, 35,
+ 6, 1, 155, 211, 35, 6, 1, 234, 171, 211, 35, 6, 1, 220, 153, 211, 35, 6,
+ 1, 173, 211, 35, 6, 1, 174, 211, 35, 6, 1, 180, 211, 35, 6, 1, 74, 211,
+ 35, 6, 1, 211, 130, 211, 35, 6, 1, 168, 211, 35, 6, 1, 234, 170, 211, 35,
+ 6, 1, 188, 211, 35, 6, 1, 203, 165, 211, 35, 6, 1, 190, 190, 211, 35, 6,
+ 1, 234, 169, 211, 35, 6, 1, 197, 168, 211, 35, 6, 1, 234, 168, 211, 35,
+ 6, 1, 197, 157, 211, 35, 6, 1, 237, 68, 211, 35, 6, 1, 66, 211, 35, 6, 1,
+ 193, 190, 211, 35, 6, 1, 221, 215, 211, 35, 6, 1, 231, 91, 211, 35, 6, 1,
+ 191, 123, 211, 35, 6, 1, 191, 71, 211, 35, 2, 1, 65, 211, 35, 2, 1, 251,
+ 236, 211, 35, 2, 1, 251, 230, 211, 35, 2, 1, 251, 245, 211, 35, 2, 1,
+ 248, 56, 211, 35, 2, 1, 247, 1, 211, 35, 2, 1, 234, 172, 211, 35, 2, 1,
+ 71, 211, 35, 2, 1, 234, 152, 211, 35, 2, 1, 140, 211, 35, 2, 1, 228, 93,
+ 211, 35, 2, 1, 68, 211, 35, 2, 1, 155, 211, 35, 2, 1, 234, 171, 211, 35,
+ 2, 1, 220, 153, 211, 35, 2, 1, 173, 211, 35, 2, 1, 174, 211, 35, 2, 1,
+ 180, 211, 35, 2, 1, 74, 211, 35, 2, 1, 211, 130, 211, 35, 2, 1, 168, 211,
+ 35, 2, 1, 234, 170, 211, 35, 2, 1, 188, 211, 35, 2, 1, 203, 165, 211, 35,
+ 2, 1, 190, 190, 211, 35, 2, 1, 234, 169, 211, 35, 2, 1, 197, 168, 211,
+ 35, 2, 1, 234, 168, 211, 35, 2, 1, 197, 157, 211, 35, 2, 1, 237, 68, 211,
+ 35, 2, 1, 66, 211, 35, 2, 1, 193, 190, 211, 35, 2, 1, 221, 215, 211, 35,
+ 2, 1, 231, 91, 211, 35, 2, 1, 191, 123, 211, 35, 2, 1, 191, 71, 234, 136,
+ 1, 65, 234, 136, 1, 249, 17, 234, 136, 1, 247, 42, 234, 136, 1, 243, 127,
+ 234, 136, 1, 237, 146, 234, 136, 1, 214, 154, 234, 136, 1, 237, 59, 234,
+ 136, 1, 234, 166, 234, 136, 1, 71, 234, 136, 1, 233, 59, 234, 136, 1,
+ 231, 165, 234, 136, 1, 231, 20, 234, 136, 1, 229, 245, 234, 136, 1, 68,
+ 234, 136, 1, 223, 10, 234, 136, 1, 222, 22, 234, 136, 1, 219, 238, 234,
+ 136, 1, 219, 68, 234, 136, 1, 216, 232, 234, 136, 1, 214, 121, 234, 136,
+ 1, 180, 234, 136, 1, 213, 150, 234, 136, 1, 74, 234, 136, 1, 210, 63,
+ 234, 136, 1, 208, 75, 234, 136, 1, 207, 113, 234, 136, 1, 206, 104, 234,
+ 136, 1, 205, 68, 234, 136, 1, 203, 113, 234, 136, 1, 199, 145, 234, 136,
+ 1, 199, 33, 234, 136, 1, 66, 234, 136, 1, 195, 153, 234, 136, 1, 192,
+ 214, 234, 136, 1, 192, 159, 234, 136, 1, 191, 87, 234, 136, 1, 191, 62,
+ 234, 136, 1, 231, 77, 234, 136, 1, 231, 83, 234, 136, 1, 221, 197, 247,
+ 75, 251, 193, 1, 251, 159, 247, 75, 251, 193, 1, 248, 214, 247, 75, 251,
+ 193, 1, 231, 40, 247, 75, 251, 193, 1, 237, 211, 247, 75, 251, 193, 1,
+ 234, 199, 247, 75, 251, 193, 1, 191, 98, 247, 75, 251, 193, 1, 233, 184,
+ 247, 75, 251, 193, 1, 191, 56, 247, 75, 251, 193, 1, 199, 174, 247, 75,
+ 251, 193, 1, 247, 1, 247, 75, 251, 193, 1, 191, 236, 247, 75, 251, 193,
+ 1, 191, 71, 247, 75, 251, 193, 1, 223, 76, 247, 75, 251, 193, 1, 203,
+ 165, 247, 75, 251, 193, 1, 220, 24, 247, 75, 251, 193, 1, 223, 89, 247,
+ 75, 251, 193, 1, 192, 210, 247, 75, 251, 193, 1, 235, 43, 247, 75, 251,
+ 193, 1, 247, 102, 247, 75, 251, 193, 1, 222, 245, 247, 75, 251, 193, 1,
+ 222, 65, 247, 75, 251, 193, 1, 218, 177, 247, 75, 251, 193, 1, 229, 179,
+ 247, 75, 251, 193, 1, 208, 76, 247, 75, 251, 193, 1, 251, 67, 247, 75,
+ 251, 193, 1, 243, 57, 247, 75, 251, 193, 1, 243, 95, 247, 75, 251, 193,
+ 1, 238, 140, 247, 75, 251, 193, 1, 217, 68, 247, 75, 251, 193, 1, 208,
+ 81, 247, 75, 251, 193, 1, 212, 252, 247, 75, 251, 193, 1, 235, 20, 247,
+ 75, 251, 193, 1, 203, 147, 247, 75, 251, 193, 1, 223, 11, 247, 75, 251,
+ 193, 1, 211, 104, 247, 75, 251, 193, 1, 197, 3, 247, 75, 251, 193, 1,
+ 233, 82, 247, 75, 251, 193, 1, 235, 33, 247, 75, 251, 193, 1, 243, 133,
+ 247, 75, 251, 193, 1, 210, 34, 247, 75, 251, 193, 1, 231, 67, 247, 75,
+ 251, 193, 1, 207, 130, 247, 75, 251, 193, 1, 203, 174, 247, 75, 251, 193,
+ 1, 195, 72, 247, 75, 251, 193, 1, 198, 118, 247, 75, 251, 193, 1, 203,
+ 18, 247, 75, 251, 193, 1, 223, 46, 247, 75, 251, 193, 1, 238, 141, 247,
+ 75, 251, 193, 1, 247, 67, 247, 75, 251, 193, 1, 192, 84, 247, 75, 251,
+ 193, 1, 209, 114, 247, 75, 251, 193, 1, 221, 117, 247, 75, 251, 193, 242,
+ 254, 77, 195, 29, 6, 1, 65, 195, 29, 6, 1, 249, 48, 195, 29, 6, 1, 249,
+ 17, 195, 29, 6, 1, 247, 42, 195, 29, 6, 1, 243, 127, 195, 29, 6, 1, 237,
+ 146, 195, 29, 6, 1, 237, 59, 195, 29, 6, 1, 234, 166, 195, 29, 6, 1, 71,
+ 195, 29, 6, 1, 233, 59, 195, 29, 6, 1, 231, 240, 195, 29, 6, 1, 140, 195,
+ 29, 6, 1, 229, 177, 195, 29, 6, 1, 68, 195, 29, 6, 1, 223, 196, 195, 29,
+ 6, 1, 223, 10, 195, 29, 6, 1, 155, 195, 29, 6, 1, 173, 195, 29, 6, 1,
+ 219, 73, 195, 29, 6, 1, 216, 232, 195, 29, 6, 1, 214, 121, 195, 29, 6, 1,
+ 213, 150, 195, 29, 6, 1, 74, 195, 29, 6, 1, 210, 63, 195, 29, 6, 1, 208,
+ 96, 195, 29, 6, 1, 207, 113, 195, 29, 6, 1, 205, 68, 195, 29, 6, 1, 203,
+ 113, 195, 29, 6, 1, 199, 145, 195, 29, 6, 1, 199, 33, 195, 29, 6, 1, 66,
+ 195, 29, 6, 1, 195, 153, 195, 29, 6, 1, 192, 214, 195, 29, 6, 1, 192,
+ 159, 195, 29, 6, 1, 191, 87, 195, 29, 2, 1, 65, 195, 29, 2, 1, 249, 48,
+ 195, 29, 2, 1, 249, 17, 195, 29, 2, 1, 247, 42, 195, 29, 2, 1, 243, 127,
+ 195, 29, 2, 1, 237, 146, 195, 29, 2, 1, 237, 59, 195, 29, 2, 1, 234, 166,
+ 195, 29, 2, 1, 71, 195, 29, 2, 1, 233, 59, 195, 29, 2, 1, 231, 240, 195,
+ 29, 2, 1, 140, 195, 29, 2, 1, 229, 177, 195, 29, 2, 1, 68, 195, 29, 2, 1,
+ 223, 196, 195, 29, 2, 1, 223, 10, 195, 29, 2, 1, 155, 195, 29, 2, 1, 173,
+ 195, 29, 2, 1, 219, 73, 195, 29, 2, 1, 216, 232, 195, 29, 2, 1, 214, 121,
+ 195, 29, 2, 1, 213, 150, 195, 29, 2, 1, 74, 195, 29, 2, 1, 210, 63, 195,
+ 29, 2, 1, 208, 96, 195, 29, 2, 1, 207, 113, 195, 29, 2, 1, 205, 68, 195,
+ 29, 2, 1, 203, 113, 195, 29, 2, 1, 199, 145, 195, 29, 2, 1, 199, 33, 195,
+ 29, 2, 1, 66, 195, 29, 2, 1, 195, 153, 195, 29, 2, 1, 192, 214, 195, 29,
+ 2, 1, 192, 159, 195, 29, 2, 1, 191, 87, 32, 42, 3, 252, 154, 32, 42, 3,
+ 252, 153, 32, 42, 3, 252, 152, 32, 42, 3, 252, 151, 32, 42, 3, 252, 150,
+ 32, 42, 3, 252, 149, 32, 42, 3, 252, 148, 32, 42, 3, 252, 147, 32, 42, 3,
+ 252, 146, 32, 42, 3, 252, 145, 32, 42, 3, 252, 144, 32, 42, 3, 252, 143,
+ 32, 42, 3, 252, 142, 32, 42, 3, 252, 141, 32, 42, 3, 252, 140, 32, 42, 3,
+ 252, 139, 32, 42, 3, 252, 138, 32, 42, 3, 252, 137, 32, 42, 3, 252, 136,
+ 32, 42, 3, 252, 135, 32, 42, 3, 252, 134, 32, 42, 3, 252, 133, 32, 42, 3,
+ 252, 132, 32, 42, 3, 252, 131, 32, 42, 3, 252, 130, 32, 42, 3, 252, 129,
+ 32, 42, 3, 252, 128, 32, 42, 3, 255, 164, 32, 42, 3, 252, 127, 32, 42, 3,
+ 252, 126, 32, 42, 3, 252, 125, 32, 42, 3, 252, 124, 32, 42, 3, 252, 123,
+ 32, 42, 3, 252, 122, 32, 42, 3, 252, 121, 32, 42, 3, 252, 120, 32, 42, 3,
+ 252, 119, 32, 42, 3, 252, 118, 32, 42, 3, 252, 117, 32, 42, 3, 252, 116,
+ 32, 42, 3, 252, 115, 32, 42, 3, 252, 114, 32, 42, 3, 252, 113, 32, 42, 3,
+ 252, 112, 32, 42, 3, 252, 111, 32, 42, 3, 252, 110, 32, 42, 3, 252, 109,
+ 32, 42, 3, 252, 108, 32, 42, 3, 252, 107, 32, 42, 3, 252, 106, 32, 42, 3,
+ 252, 105, 32, 42, 3, 252, 104, 32, 42, 3, 252, 103, 32, 42, 3, 252, 102,
+ 32, 42, 3, 252, 101, 32, 42, 3, 252, 100, 32, 42, 3, 252, 99, 32, 42, 3,
+ 252, 98, 32, 42, 3, 252, 97, 32, 42, 3, 252, 96, 32, 42, 3, 252, 95, 32,
+ 42, 3, 252, 94, 32, 42, 3, 252, 93, 32, 42, 3, 252, 92, 32, 42, 3, 252,
+ 91, 32, 42, 3, 252, 90, 32, 42, 3, 252, 89, 32, 42, 3, 252, 88, 32, 42,
+ 3, 252, 87, 32, 42, 3, 252, 86, 32, 42, 3, 252, 85, 32, 42, 3, 255, 77,
+ 32, 42, 3, 252, 84, 32, 42, 3, 252, 83, 32, 42, 3, 255, 42, 32, 42, 3,
+ 252, 82, 32, 42, 3, 252, 81, 32, 42, 3, 252, 80, 32, 42, 3, 252, 79, 32,
+ 42, 3, 255, 29, 32, 42, 3, 252, 78, 32, 42, 3, 252, 77, 32, 42, 3, 252,
+ 76, 32, 42, 3, 252, 75, 32, 42, 3, 252, 74, 32, 42, 3, 254, 101, 32, 42,
+ 3, 254, 100, 32, 42, 3, 254, 99, 32, 42, 3, 254, 98, 32, 42, 3, 254, 97,
+ 32, 42, 3, 254, 96, 32, 42, 3, 254, 95, 32, 42, 3, 254, 94, 32, 42, 3,
+ 254, 92, 32, 42, 3, 254, 91, 32, 42, 3, 254, 90, 32, 42, 3, 254, 89, 32,
+ 42, 3, 254, 88, 32, 42, 3, 254, 87, 32, 42, 3, 254, 85, 32, 42, 3, 254,
+ 84, 32, 42, 3, 254, 83, 32, 42, 3, 254, 82, 32, 42, 3, 254, 81, 32, 42,
+ 3, 254, 80, 32, 42, 3, 254, 79, 32, 42, 3, 254, 78, 32, 42, 3, 254, 77,
+ 32, 42, 3, 254, 76, 32, 42, 3, 254, 75, 32, 42, 3, 254, 74, 32, 42, 3,
+ 254, 73, 32, 42, 3, 254, 72, 32, 42, 3, 254, 71, 32, 42, 3, 254, 70, 32,
+ 42, 3, 254, 69, 32, 42, 3, 254, 68, 32, 42, 3, 254, 67, 32, 42, 3, 254,
+ 65, 32, 42, 3, 254, 64, 32, 42, 3, 254, 63, 32, 42, 3, 254, 59, 32, 42,
+ 3, 254, 58, 32, 42, 3, 254, 57, 32, 42, 3, 254, 56, 32, 42, 3, 254, 52,
+ 32, 42, 3, 254, 51, 32, 42, 3, 254, 50, 32, 42, 3, 254, 49, 32, 42, 3,
+ 254, 48, 32, 42, 3, 254, 47, 32, 42, 3, 254, 46, 32, 42, 3, 254, 45, 32,
+ 42, 3, 254, 44, 32, 42, 3, 254, 43, 32, 42, 3, 254, 42, 32, 42, 3, 254,
+ 41, 32, 42, 3, 254, 40, 32, 42, 3, 254, 39, 32, 42, 3, 254, 38, 32, 42,
+ 3, 254, 37, 32, 42, 3, 254, 36, 32, 42, 3, 254, 35, 32, 42, 3, 254, 34,
+ 32, 42, 3, 254, 33, 32, 42, 3, 254, 32, 32, 42, 3, 254, 31, 32, 42, 3,
+ 254, 30, 32, 42, 3, 254, 28, 32, 42, 3, 254, 27, 32, 42, 3, 254, 26, 32,
+ 42, 3, 254, 25, 32, 42, 3, 254, 24, 32, 42, 3, 254, 22, 32, 42, 3, 254,
+ 21, 32, 42, 3, 254, 20, 32, 42, 3, 254, 19, 32, 42, 3, 254, 17, 32, 42,
+ 3, 254, 16, 32, 42, 3, 254, 15, 32, 42, 3, 253, 237, 32, 42, 3, 253, 235,
+ 32, 42, 3, 253, 233, 32, 42, 3, 253, 231, 32, 42, 3, 253, 229, 32, 42, 3,
+ 253, 227, 32, 42, 3, 253, 225, 32, 42, 3, 253, 223, 32, 42, 3, 253, 221,
+ 32, 42, 3, 253, 219, 32, 42, 3, 253, 217, 32, 42, 3, 253, 214, 32, 42, 3,
+ 253, 212, 32, 42, 3, 253, 210, 32, 42, 3, 253, 208, 32, 42, 3, 253, 206,
+ 32, 42, 3, 253, 204, 32, 42, 3, 253, 202, 32, 42, 3, 253, 200, 32, 42, 3,
+ 253, 118, 32, 42, 3, 253, 117, 32, 42, 3, 253, 116, 32, 42, 3, 253, 115,
+ 32, 42, 3, 253, 114, 32, 42, 3, 253, 113, 32, 42, 3, 253, 111, 32, 42, 3,
+ 253, 110, 32, 42, 3, 253, 109, 32, 42, 3, 253, 108, 32, 42, 3, 253, 107,
+ 32, 42, 3, 253, 106, 32, 42, 3, 253, 104, 32, 42, 3, 253, 103, 32, 42, 3,
+ 253, 99, 32, 42, 3, 253, 98, 32, 42, 3, 253, 96, 32, 42, 3, 253, 95, 32,
+ 42, 3, 253, 94, 32, 42, 3, 253, 93, 32, 42, 3, 253, 92, 32, 42, 3, 253,
+ 91, 32, 42, 3, 253, 90, 32, 42, 3, 253, 89, 32, 42, 3, 253, 88, 32, 42,
+ 3, 253, 87, 32, 42, 3, 253, 86, 32, 42, 3, 253, 85, 32, 42, 3, 253, 84,
+ 32, 42, 3, 253, 83, 32, 42, 3, 253, 82, 32, 42, 3, 253, 81, 32, 42, 3,
+ 253, 80, 32, 42, 3, 253, 79, 32, 42, 3, 253, 78, 32, 42, 3, 253, 77, 32,
+ 42, 3, 253, 76, 32, 42, 3, 253, 75, 32, 42, 3, 253, 74, 32, 42, 3, 253,
+ 73, 32, 42, 3, 253, 72, 32, 42, 3, 253, 71, 32, 42, 3, 253, 70, 32, 42,
+ 3, 253, 69, 32, 42, 3, 253, 68, 32, 42, 3, 253, 67, 32, 42, 3, 253, 66,
+ 32, 42, 3, 253, 65, 32, 42, 3, 253, 64, 32, 42, 3, 253, 63, 32, 42, 3,
+ 253, 62, 32, 42, 3, 253, 61, 32, 42, 3, 253, 60, 32, 42, 3, 253, 59, 32,
+ 42, 3, 253, 58, 32, 42, 3, 253, 57, 32, 42, 3, 253, 56, 32, 42, 3, 253,
+ 55, 32, 42, 3, 253, 54, 32, 42, 3, 253, 53, 32, 42, 3, 253, 52, 32, 42,
+ 3, 253, 51, 32, 42, 3, 253, 50, 32, 42, 3, 253, 49, 32, 42, 3, 253, 48,
+ 32, 42, 3, 253, 47, 32, 42, 3, 253, 46, 32, 42, 3, 253, 45, 32, 42, 3,
+ 253, 44, 32, 42, 3, 253, 43, 32, 42, 3, 253, 42, 32, 42, 3, 253, 41, 32,
+ 42, 3, 253, 40, 32, 42, 3, 253, 39, 32, 42, 3, 253, 38, 32, 42, 3, 253,
+ 37, 32, 42, 3, 253, 36, 32, 42, 3, 253, 35, 32, 42, 3, 253, 34, 32, 42,
+ 3, 253, 33, 32, 42, 3, 253, 32, 32, 42, 3, 253, 31, 32, 42, 3, 253, 30,
+ 32, 42, 3, 253, 29, 32, 42, 3, 253, 28, 32, 42, 3, 253, 27, 32, 42, 3,
+ 253, 26, 32, 42, 3, 253, 25, 32, 42, 3, 253, 24, 32, 42, 3, 253, 23, 32,
+ 42, 3, 253, 22, 32, 42, 3, 253, 21, 32, 42, 3, 253, 20, 32, 42, 3, 253,
+ 19, 32, 42, 3, 253, 18, 32, 42, 3, 253, 17, 32, 42, 3, 253, 16, 32, 42,
+ 3, 253, 15, 32, 42, 3, 253, 14, 32, 42, 3, 253, 13, 32, 42, 3, 253, 12,
+ 32, 42, 3, 253, 11, 32, 42, 3, 253, 10, 32, 42, 3, 253, 9, 32, 42, 3,
+ 253, 8, 32, 42, 3, 253, 7, 32, 42, 3, 253, 6, 32, 42, 3, 253, 5, 32, 42,
+ 3, 253, 4, 32, 42, 3, 253, 3, 32, 42, 3, 253, 2, 32, 42, 3, 253, 1, 32,
+ 42, 3, 253, 0, 32, 42, 3, 252, 255, 32, 42, 3, 252, 254, 32, 42, 3, 252,
+ 253, 32, 42, 3, 252, 252, 32, 42, 3, 252, 251, 32, 42, 3, 252, 250, 32,
+ 42, 3, 252, 249, 32, 42, 3, 252, 248, 32, 42, 3, 252, 247, 32, 42, 3,
+ 252, 246, 32, 42, 3, 252, 245, 32, 42, 3, 252, 244, 32, 42, 3, 252, 243,
+ 32, 42, 3, 252, 242, 32, 42, 3, 252, 241, 32, 42, 3, 252, 240, 32, 42, 3,
+ 252, 239, 32, 42, 3, 252, 238, 32, 42, 3, 252, 237, 32, 42, 3, 252, 236,
+ 65, 32, 42, 3, 252, 235, 250, 120, 32, 42, 3, 252, 234, 238, 127, 32, 42,
+ 3, 252, 233, 71, 32, 42, 3, 252, 232, 233, 175, 32, 42, 3, 252, 231, 230,
+ 116, 32, 42, 3, 252, 230, 223, 35, 32, 42, 3, 252, 229, 222, 152, 32, 42,
+ 3, 252, 228, 172, 32, 42, 3, 252, 227, 220, 130, 32, 42, 3, 252, 226,
+ 220, 129, 32, 42, 3, 252, 225, 220, 128, 32, 42, 3, 252, 224, 220, 127,
+ 32, 42, 3, 252, 223, 193, 224, 32, 42, 3, 252, 222, 192, 235, 32, 42, 3,
+ 252, 221, 192, 159, 32, 42, 3, 252, 220, 211, 110, 32, 42, 3, 252, 219,
+ 252, 69, 32, 42, 3, 252, 218, 249, 54, 32, 42, 3, 252, 217, 237, 193, 32,
+ 42, 3, 252, 216, 233, 183, 32, 42, 3, 252, 215, 223, 10, 32, 42, 3, 252,
+ 214, 32, 42, 3, 252, 213, 32, 42, 3, 252, 212, 32, 42, 3, 252, 211, 32,
+ 42, 3, 252, 210, 32, 42, 3, 252, 209, 32, 42, 3, 252, 208, 32, 42, 3,
+ 252, 207, 52, 1, 2, 6, 252, 206, 52, 1, 200, 182, 197, 238, 242, 83, 52,
+ 1, 200, 182, 132, 197, 238, 242, 83, 52, 1, 2, 252, 25, 52, 1, 2, 6, 250,
+ 120, 52, 1, 2, 78, 4, 102, 52, 1, 2, 235, 37, 237, 2, 52, 1, 2, 235, 37,
+ 237, 3, 4, 207, 24, 102, 52, 1, 2, 235, 37, 237, 3, 4, 238, 175, 52, 1,
+ 2, 237, 70, 237, 2, 52, 1, 2, 238, 128, 4, 199, 215, 52, 1, 2, 238, 128,
+ 4, 102, 52, 1, 2, 238, 128, 4, 228, 251, 23, 199, 215, 52, 1, 2, 207, 18,
+ 71, 52, 1, 2, 242, 219, 207, 18, 211, 77, 71, 52, 1, 2, 233, 37, 237, 2,
+ 52, 1, 2, 207, 140, 228, 187, 52, 1, 2, 6, 232, 51, 52, 1, 2, 232, 52, 4,
+ 102, 52, 1, 2, 6, 232, 52, 4, 102, 52, 1, 2, 230, 117, 4, 106, 52, 1, 2,
+ 6, 230, 116, 52, 1, 2, 229, 197, 4, 102, 52, 1, 2, 236, 139, 223, 36, 4,
+ 201, 28, 23, 102, 52, 1, 2, 218, 227, 237, 2, 52, 1, 2, 218, 170, 237, 2,
+ 52, 1, 2, 220, 143, 4, 248, 231, 52, 1, 2, 6, 220, 143, 4, 248, 231, 52,
+ 1, 2, 220, 143, 4, 207, 24, 228, 251, 23, 248, 231, 52, 1, 2, 219, 162,
+ 52, 1, 2, 219, 163, 4, 207, 24, 102, 52, 1, 2, 153, 192, 159, 52, 1, 2,
+ 153, 192, 160, 4, 248, 231, 52, 1, 2, 187, 4, 106, 52, 1, 2, 6, 211, 151,
+ 52, 1, 2, 242, 219, 211, 110, 52, 1, 2, 208, 104, 52, 1, 2, 153, 207,
+ 222, 4, 179, 219, 212, 52, 1, 2, 153, 207, 222, 4, 179, 219, 213, 23,
+ 207, 24, 102, 52, 1, 2, 207, 222, 4, 199, 215, 52, 1, 2, 207, 222, 4,
+ 232, 233, 52, 1, 2, 6, 146, 52, 1, 2, 199, 152, 237, 3, 4, 238, 175, 52,
+ 1, 2, 197, 170, 237, 2, 52, 1, 2, 197, 170, 237, 3, 4, 207, 24, 102, 52,
+ 1, 2, 199, 79, 237, 2, 52, 1, 2, 200, 44, 4, 207, 24, 102, 52, 1, 2, 196,
+ 13, 4, 50, 102, 52, 1, 2, 6, 192, 159, 52, 1, 231, 11, 201, 64, 4, 106,
+ 52, 1, 207, 18, 231, 11, 201, 64, 4, 106, 52, 1, 248, 172, 242, 231, 52,
+ 1, 237, 98, 242, 231, 52, 1, 220, 3, 242, 231, 52, 1, 251, 150, 242, 231,
+ 52, 1, 207, 24, 242, 232, 4, 207, 24, 102, 52, 1, 2, 206, 9, 4, 238, 175,
+ 238, 135, 5, 65, 238, 135, 5, 71, 238, 135, 5, 68, 238, 135, 5, 74, 238,
+ 135, 5, 66, 238, 135, 5, 223, 32, 238, 135, 5, 222, 201, 238, 135, 5,
+ 155, 238, 135, 5, 222, 22, 238, 135, 5, 221, 166, 238, 135, 5, 221, 67,
+ 238, 135, 5, 220, 232, 238, 135, 5, 173, 238, 135, 5, 219, 238, 238, 135,
+ 5, 219, 146, 238, 135, 5, 219, 43, 238, 135, 5, 218, 225, 238, 135, 5,
+ 174, 238, 135, 5, 216, 232, 238, 135, 5, 216, 100, 238, 135, 5, 216, 12,
+ 238, 135, 5, 215, 155, 238, 135, 5, 180, 238, 135, 5, 214, 121, 238, 135,
+ 5, 213, 219, 238, 135, 5, 213, 43, 238, 135, 5, 212, 178, 238, 135, 5,
+ 168, 238, 135, 5, 210, 63, 238, 135, 5, 209, 185, 238, 135, 5, 209, 73,
+ 238, 135, 5, 208, 165, 238, 135, 5, 165, 238, 135, 5, 207, 113, 238, 135,
+ 5, 207, 1, 238, 135, 5, 206, 162, 238, 135, 5, 206, 68, 238, 135, 5, 188,
+ 238, 135, 5, 205, 68, 238, 135, 5, 202, 222, 238, 135, 5, 202, 46, 238,
+ 135, 5, 201, 4, 238, 135, 5, 190, 190, 238, 135, 5, 199, 145, 238, 135,
+ 5, 198, 193, 238, 135, 5, 159, 238, 135, 5, 197, 94, 238, 135, 5, 193,
+ 190, 238, 135, 5, 193, 125, 238, 135, 5, 193, 86, 238, 135, 5, 193, 48,
+ 238, 135, 5, 192, 220, 238, 135, 5, 192, 214, 238, 135, 5, 191, 123, 238,
+ 135, 5, 191, 7, 223, 164, 251, 18, 1, 251, 190, 223, 164, 251, 18, 1,
+ 248, 211, 223, 164, 251, 18, 1, 231, 38, 223, 164, 251, 18, 1, 237, 252,
+ 223, 164, 251, 18, 1, 229, 245, 223, 164, 251, 18, 1, 193, 133, 223, 164,
+ 251, 18, 1, 191, 91, 223, 164, 251, 18, 1, 229, 184, 223, 164, 251, 18,
+ 1, 199, 69, 223, 164, 251, 18, 1, 191, 249, 223, 164, 251, 18, 1, 222,
+ 75, 223, 164, 251, 18, 1, 220, 26, 223, 164, 251, 18, 1, 216, 193, 223,
+ 164, 251, 18, 1, 212, 130, 223, 164, 251, 18, 1, 205, 148, 223, 164, 251,
+ 18, 1, 250, 126, 223, 164, 251, 18, 1, 210, 63, 223, 164, 251, 18, 1,
+ 205, 189, 223, 164, 251, 18, 1, 208, 37, 223, 164, 251, 18, 1, 207, 38,
+ 223, 164, 251, 18, 1, 203, 69, 223, 164, 251, 18, 1, 199, 159, 223, 164,
+ 251, 18, 205, 54, 56, 223, 164, 251, 18, 31, 107, 223, 164, 251, 18, 31,
+ 109, 223, 164, 251, 18, 31, 138, 223, 164, 251, 18, 31, 199, 95, 223,
+ 164, 251, 18, 31, 197, 32, 223, 164, 251, 18, 31, 91, 228, 140, 223, 164,
+ 251, 18, 31, 91, 189, 223, 164, 251, 18, 31, 199, 96, 189, 210, 180, 1,
+ 251, 190, 210, 180, 1, 248, 211, 210, 180, 1, 231, 38, 210, 180, 1, 237,
+ 252, 210, 180, 1, 229, 245, 210, 180, 1, 193, 133, 210, 180, 1, 191, 91,
+ 210, 180, 1, 229, 184, 210, 180, 1, 199, 69, 210, 180, 1, 191, 249, 210,
+ 180, 1, 222, 75, 210, 180, 1, 220, 26, 210, 180, 1, 216, 193, 210, 180,
+ 1, 53, 212, 130, 210, 180, 1, 212, 130, 210, 180, 1, 205, 148, 210, 180,
+ 1, 250, 126, 210, 180, 1, 210, 63, 210, 180, 1, 205, 189, 210, 180, 1,
+ 208, 37, 210, 180, 1, 207, 38, 210, 180, 1, 203, 69, 210, 180, 1, 199,
+ 159, 210, 180, 219, 219, 232, 201, 210, 180, 206, 203, 232, 201, 210,
+ 180, 31, 107, 210, 180, 31, 109, 210, 180, 31, 138, 210, 180, 31, 134,
+ 210, 180, 31, 149, 210, 180, 31, 199, 95, 210, 180, 31, 197, 32, 214,
+ 246, 1, 53, 251, 190, 214, 246, 1, 251, 190, 214, 246, 1, 53, 248, 211,
+ 214, 246, 1, 248, 211, 214, 246, 1, 231, 38, 214, 246, 1, 237, 252, 214,
+ 246, 1, 53, 229, 245, 214, 246, 1, 229, 245, 214, 246, 1, 193, 133, 214,
+ 246, 1, 191, 91, 214, 246, 1, 229, 184, 214, 246, 1, 199, 69, 214, 246,
+ 1, 53, 191, 249, 214, 246, 1, 191, 249, 214, 246, 1, 53, 222, 75, 214,
+ 246, 1, 222, 75, 214, 246, 1, 53, 220, 26, 214, 246, 1, 220, 26, 214,
+ 246, 1, 53, 216, 193, 214, 246, 1, 216, 193, 214, 246, 1, 53, 212, 130,
+ 214, 246, 1, 212, 130, 214, 246, 1, 205, 148, 214, 246, 1, 250, 126, 214,
+ 246, 1, 210, 63, 214, 246, 1, 205, 189, 214, 246, 1, 208, 37, 214, 246,
+ 1, 207, 38, 214, 246, 1, 53, 203, 69, 214, 246, 1, 203, 69, 214, 246, 1,
+ 199, 159, 214, 246, 31, 107, 214, 246, 31, 109, 214, 246, 31, 138, 214,
+ 246, 31, 134, 214, 246, 238, 202, 31, 134, 214, 246, 31, 149, 214, 246,
+ 31, 199, 95, 214, 246, 31, 197, 32, 214, 246, 31, 91, 228, 140, 230, 4,
+ 1, 251, 190, 230, 4, 1, 248, 211, 230, 4, 1, 231, 38, 230, 4, 1, 237,
+ 251, 230, 4, 1, 229, 245, 230, 4, 1, 193, 133, 230, 4, 1, 191, 89, 230,
+ 4, 1, 229, 184, 230, 4, 1, 199, 69, 230, 4, 1, 191, 249, 230, 4, 1, 222,
+ 75, 230, 4, 1, 220, 26, 230, 4, 1, 216, 193, 230, 4, 1, 212, 130, 230, 4,
+ 1, 205, 148, 230, 4, 1, 250, 124, 230, 4, 1, 210, 63, 230, 4, 1, 205,
+ 189, 230, 4, 1, 208, 37, 230, 4, 1, 203, 69, 230, 4, 1, 199, 159, 230, 4,
+ 31, 107, 230, 4, 31, 149, 230, 4, 31, 199, 95, 230, 4, 31, 197, 32, 230,
+ 4, 31, 91, 228, 140, 209, 197, 1, 251, 187, 209, 197, 1, 248, 214, 209,
+ 197, 1, 231, 213, 209, 197, 1, 237, 108, 209, 197, 1, 229, 245, 209, 197,
+ 1, 193, 140, 209, 197, 1, 191, 115, 209, 197, 1, 229, 186, 209, 197, 1,
+ 199, 73, 209, 197, 1, 191, 250, 209, 197, 1, 222, 106, 209, 197, 1, 220,
+ 32, 209, 197, 1, 216, 193, 209, 197, 1, 212, 130, 209, 197, 1, 204, 19,
+ 209, 197, 1, 251, 230, 209, 197, 1, 210, 63, 209, 197, 1, 205, 191, 209,
+ 197, 1, 208, 42, 209, 197, 1, 206, 124, 209, 197, 1, 203, 69, 209, 197,
+ 1, 199, 166, 209, 197, 31, 107, 209, 197, 31, 199, 95, 209, 197, 31, 197,
+ 32, 209, 197, 31, 91, 228, 140, 209, 197, 31, 109, 209, 197, 31, 138,
+ 209, 197, 193, 23, 204, 10, 218, 180, 1, 65, 218, 180, 1, 250, 120, 218,
+ 180, 1, 232, 51, 218, 180, 1, 238, 127, 218, 180, 1, 71, 218, 180, 1,
+ 196, 12, 218, 180, 1, 68, 218, 180, 1, 192, 159, 218, 180, 1, 222, 152,
+ 218, 180, 1, 172, 218, 180, 1, 218, 168, 218, 180, 1, 215, 61, 218, 180,
+ 1, 74, 218, 180, 1, 146, 218, 180, 1, 201, 178, 218, 180, 1, 200, 43,
+ 218, 180, 1, 66, 218, 180, 1, 233, 175, 218, 180, 1, 208, 104, 218, 180,
+ 1, 206, 8, 218, 180, 1, 197, 135, 218, 180, 1, 251, 132, 218, 180, 1,
+ 234, 103, 218, 180, 1, 218, 183, 218, 180, 1, 213, 80, 218, 180, 1, 247,
+ 193, 218, 180, 197, 238, 77, 152, 229, 144, 1, 65, 152, 229, 144, 1, 71,
+ 152, 229, 144, 1, 68, 152, 229, 144, 1, 74, 152, 229, 144, 1, 170, 152,
+ 229, 144, 1, 193, 190, 152, 229, 144, 1, 249, 153, 152, 229, 144, 1, 249,
+ 152, 152, 229, 144, 1, 168, 152, 229, 144, 1, 174, 152, 229, 144, 1, 180,
+ 152, 229, 144, 1, 215, 5, 152, 229, 144, 1, 214, 121, 152, 229, 144, 1,
+ 214, 119, 152, 229, 144, 1, 165, 152, 229, 144, 1, 207, 184, 152, 229,
+ 144, 1, 173, 152, 229, 144, 1, 221, 215, 152, 229, 144, 1, 229, 177, 152,
+ 229, 144, 1, 188, 152, 229, 144, 1, 205, 205, 152, 229, 144, 1, 205, 68,
+ 152, 229, 144, 1, 155, 152, 229, 144, 1, 208, 96, 152, 229, 144, 1, 190,
+ 190, 152, 229, 144, 1, 199, 250, 152, 229, 144, 1, 199, 145, 152, 229,
+ 144, 1, 199, 143, 152, 229, 144, 1, 159, 152, 229, 144, 1, 238, 32, 152,
+ 229, 144, 16, 195, 63, 152, 229, 144, 16, 195, 62, 152, 238, 166, 1, 65,
+ 152, 238, 166, 1, 71, 152, 238, 166, 1, 68, 152, 238, 166, 1, 74, 152,
+ 238, 166, 1, 170, 152, 238, 166, 1, 193, 190, 152, 238, 166, 1, 249, 153,
+ 152, 238, 166, 1, 168, 152, 238, 166, 1, 174, 152, 238, 166, 1, 180, 152,
+ 238, 166, 1, 214, 121, 152, 238, 166, 1, 165, 152, 238, 166, 1, 173, 152,
+ 238, 166, 1, 221, 215, 152, 238, 166, 1, 229, 177, 152, 238, 166, 1, 188,
+ 152, 238, 166, 1, 251, 14, 188, 152, 238, 166, 1, 205, 68, 152, 238, 166,
+ 1, 155, 152, 238, 166, 1, 208, 96, 152, 238, 166, 1, 190, 190, 152, 238,
+ 166, 1, 199, 145, 152, 238, 166, 1, 159, 152, 238, 166, 1, 238, 32, 152,
+ 238, 166, 232, 118, 234, 128, 197, 39, 152, 238, 166, 232, 118, 91, 230,
+ 70, 152, 238, 166, 219, 28, 206, 168, 152, 238, 166, 219, 28, 223, 169,
+ 152, 238, 166, 31, 107, 152, 238, 166, 31, 109, 152, 238, 166, 31, 138,
+ 152, 238, 166, 31, 134, 152, 238, 166, 31, 149, 152, 238, 166, 31, 169,
+ 152, 238, 166, 31, 175, 152, 238, 166, 31, 171, 152, 238, 166, 31, 178,
+ 152, 238, 166, 31, 199, 95, 152, 238, 166, 31, 197, 32, 152, 238, 166,
+ 31, 198, 249, 152, 238, 166, 31, 232, 135, 152, 238, 166, 31, 233, 15,
+ 152, 238, 166, 31, 202, 120, 152, 238, 166, 31, 203, 241, 152, 238, 166,
+ 31, 91, 228, 140, 152, 238, 166, 31, 105, 228, 140, 152, 238, 166, 31,
+ 115, 228, 140, 152, 238, 166, 31, 232, 128, 228, 140, 152, 238, 166, 31,
+ 232, 226, 228, 140, 152, 238, 166, 31, 202, 136, 228, 140, 152, 238, 166,
+ 31, 203, 247, 228, 140, 152, 238, 166, 31, 234, 164, 228, 140, 152, 238,
+ 166, 31, 213, 175, 228, 140, 152, 238, 166, 31, 91, 189, 152, 238, 166,
+ 31, 105, 189, 152, 238, 166, 31, 115, 189, 152, 238, 166, 31, 232, 128,
+ 189, 152, 238, 166, 31, 232, 226, 189, 152, 238, 166, 31, 202, 136, 189,
+ 152, 238, 166, 31, 203, 247, 189, 152, 238, 166, 31, 234, 164, 189, 152,
+ 238, 166, 31, 213, 175, 189, 152, 238, 166, 31, 199, 96, 189, 152, 238,
+ 166, 31, 197, 33, 189, 152, 238, 166, 31, 198, 250, 189, 152, 238, 166,
+ 31, 232, 136, 189, 152, 238, 166, 31, 233, 16, 189, 152, 238, 166, 31,
+ 202, 121, 189, 152, 238, 166, 31, 203, 242, 189, 152, 238, 166, 31, 234,
+ 154, 189, 152, 238, 166, 31, 213, 170, 189, 152, 238, 166, 31, 91, 228,
+ 141, 189, 152, 238, 166, 31, 105, 228, 141, 189, 152, 238, 166, 31, 115,
+ 228, 141, 189, 152, 238, 166, 31, 232, 128, 228, 141, 189, 152, 238, 166,
+ 31, 232, 226, 228, 141, 189, 152, 238, 166, 31, 202, 136, 228, 141, 189,
+ 152, 238, 166, 31, 203, 247, 228, 141, 189, 152, 238, 166, 31, 234, 164,
+ 228, 141, 189, 152, 238, 166, 31, 213, 175, 228, 141, 189, 152, 238, 166,
+ 232, 118, 91, 197, 40, 152, 238, 166, 232, 118, 105, 197, 39, 152, 238,
+ 166, 232, 118, 115, 197, 39, 152, 238, 166, 232, 118, 232, 128, 197, 39,
+ 152, 238, 166, 232, 118, 232, 226, 197, 39, 152, 238, 166, 232, 118, 202,
+ 136, 197, 39, 152, 238, 166, 232, 118, 203, 247, 197, 39, 152, 238, 166,
+ 232, 118, 234, 164, 197, 39, 152, 238, 166, 232, 118, 213, 175, 197, 39,
+ 152, 238, 166, 232, 118, 199, 96, 197, 39, 221, 199, 1, 65, 221, 199, 18,
+ 3, 68, 221, 199, 18, 3, 66, 221, 199, 18, 3, 117, 146, 221, 199, 18, 3,
+ 71, 221, 199, 18, 3, 74, 221, 199, 18, 219, 198, 77, 221, 199, 3, 55,
+ 206, 189, 60, 221, 199, 3, 251, 71, 221, 199, 3, 195, 35, 221, 199, 1,
+ 155, 221, 199, 1, 221, 215, 221, 199, 1, 231, 240, 221, 199, 1, 231, 91,
+ 221, 199, 1, 247, 160, 221, 199, 1, 247, 1, 221, 199, 1, 223, 32, 221,
+ 199, 1, 212, 101, 221, 199, 1, 197, 132, 221, 199, 1, 197, 120, 221, 199,
+ 1, 237, 191, 221, 199, 1, 237, 175, 221, 199, 1, 213, 79, 221, 199, 1,
+ 190, 190, 221, 199, 1, 199, 49, 221, 199, 1, 238, 32, 221, 199, 1, 237,
+ 68, 221, 199, 1, 180, 221, 199, 1, 168, 221, 199, 1, 209, 228, 221, 199,
+ 1, 249, 153, 221, 199, 1, 248, 203, 221, 199, 1, 174, 221, 199, 1, 170,
+ 221, 199, 1, 165, 221, 199, 1, 173, 221, 199, 1, 195, 188, 221, 199, 1,
+ 203, 165, 221, 199, 1, 201, 175, 221, 199, 1, 188, 221, 199, 1, 191, 123,
+ 221, 199, 1, 140, 221, 199, 1, 221, 101, 221, 199, 1, 197, 100, 221, 199,
+ 1, 197, 101, 221, 199, 1, 195, 70, 221, 199, 3, 249, 88, 58, 221, 199, 3,
+ 247, 74, 221, 199, 3, 75, 60, 221, 199, 195, 40, 221, 199, 17, 107, 221,
+ 199, 17, 109, 221, 199, 17, 138, 221, 199, 17, 134, 221, 199, 31, 199,
+ 95, 221, 199, 31, 197, 32, 221, 199, 31, 91, 228, 140, 221, 199, 31, 91,
+ 189, 221, 199, 232, 118, 91, 230, 70, 221, 199, 208, 152, 236, 140, 221,
+ 199, 208, 152, 2, 243, 10, 221, 199, 208, 152, 243, 10, 221, 199, 208,
+ 152, 238, 228, 164, 221, 199, 208, 152, 217, 83, 221, 199, 208, 152, 218,
+ 246, 221, 199, 208, 152, 237, 238, 221, 199, 208, 152, 55, 237, 238, 221,
+ 199, 208, 152, 219, 106, 39, 202, 2, 251, 29, 1, 229, 245, 39, 202, 2,
+ 251, 29, 1, 220, 26, 39, 202, 2, 251, 29, 1, 229, 184, 39, 202, 2, 251,
+ 29, 1, 216, 193, 39, 202, 2, 251, 29, 1, 208, 37, 39, 202, 2, 251, 29, 1,
+ 193, 133, 39, 202, 2, 251, 29, 1, 203, 69, 39, 202, 2, 251, 29, 1, 207,
+ 38, 39, 202, 2, 251, 29, 1, 248, 211, 39, 202, 2, 251, 29, 1, 199, 159,
+ 39, 202, 2, 251, 29, 1, 205, 122, 39, 202, 2, 251, 29, 1, 222, 75, 39,
+ 202, 2, 251, 29, 1, 212, 130, 39, 202, 2, 251, 29, 1, 221, 194, 39, 202,
+ 2, 251, 29, 1, 205, 189, 39, 202, 2, 251, 29, 1, 205, 148, 39, 202, 2,
+ 251, 29, 1, 233, 59, 39, 202, 2, 251, 29, 1, 251, 192, 39, 202, 2, 251,
+ 29, 1, 250, 124, 39, 202, 2, 251, 29, 1, 237, 65, 39, 202, 2, 251, 29, 1,
+ 231, 38, 39, 202, 2, 251, 29, 1, 237, 252, 39, 202, 2, 251, 29, 1, 231,
+ 79, 39, 202, 2, 251, 29, 1, 199, 69, 39, 202, 2, 251, 29, 1, 191, 89, 39,
+ 202, 2, 251, 29, 1, 237, 62, 39, 202, 2, 251, 29, 1, 191, 249, 39, 202,
+ 2, 251, 29, 1, 199, 35, 39, 202, 2, 251, 29, 1, 199, 14, 39, 202, 2, 251,
+ 29, 31, 107, 39, 202, 2, 251, 29, 31, 233, 15, 39, 202, 2, 251, 29, 167,
+ 223, 144, 39, 186, 251, 29, 1, 229, 210, 39, 186, 251, 29, 1, 220, 35,
+ 39, 186, 251, 29, 1, 230, 81, 39, 186, 251, 29, 1, 216, 208, 39, 186,
+ 251, 29, 1, 208, 89, 39, 186, 251, 29, 1, 193, 133, 39, 186, 251, 29, 1,
+ 234, 20, 39, 186, 251, 29, 1, 207, 71, 39, 186, 251, 29, 1, 248, 245, 39,
+ 186, 251, 29, 1, 199, 114, 39, 186, 251, 29, 1, 234, 21, 39, 186, 251,
+ 29, 1, 222, 106, 39, 186, 251, 29, 1, 213, 24, 39, 186, 251, 29, 1, 221,
+ 210, 39, 186, 251, 29, 1, 205, 192, 39, 186, 251, 29, 1, 234, 19, 39,
+ 186, 251, 29, 1, 233, 46, 39, 186, 251, 29, 1, 251, 192, 39, 186, 251,
+ 29, 1, 251, 230, 39, 186, 251, 29, 1, 238, 26, 39, 186, 251, 29, 1, 231,
+ 156, 39, 186, 251, 29, 1, 238, 3, 39, 186, 251, 29, 1, 231, 86, 39, 186,
+ 251, 29, 1, 199, 219, 39, 186, 251, 29, 1, 191, 113, 39, 186, 251, 29, 1,
+ 199, 41, 39, 186, 251, 29, 1, 192, 75, 39, 186, 251, 29, 1, 199, 29, 39,
+ 186, 251, 29, 1, 191, 116, 39, 186, 251, 29, 31, 107, 39, 186, 251, 29,
+ 31, 199, 95, 39, 186, 251, 29, 31, 197, 32, 217, 81, 1, 251, 190, 217,
+ 81, 1, 248, 211, 217, 81, 1, 248, 194, 217, 81, 1, 231, 38, 217, 81, 1,
+ 231, 64, 217, 81, 1, 237, 252, 217, 81, 1, 229, 245, 217, 81, 1, 193,
+ 133, 217, 81, 3, 196, 158, 217, 81, 1, 191, 91, 217, 81, 1, 191, 64, 217,
+ 81, 1, 223, 12, 217, 81, 1, 222, 248, 217, 81, 1, 229, 184, 217, 81, 1,
+ 199, 69, 217, 81, 1, 191, 249, 217, 81, 1, 222, 75, 217, 81, 1, 192, 217,
+ 217, 81, 1, 221, 201, 217, 81, 1, 220, 26, 217, 81, 1, 237, 61, 217, 81,
+ 1, 199, 40, 217, 81, 1, 216, 193, 217, 81, 1, 212, 130, 217, 81, 1, 205,
+ 148, 217, 81, 1, 250, 126, 217, 81, 1, 252, 158, 217, 81, 1, 210, 63,
+ 217, 81, 1, 233, 59, 217, 81, 1, 205, 189, 217, 81, 1, 208, 37, 217, 81,
+ 1, 192, 193, 217, 81, 1, 208, 64, 217, 81, 1, 207, 38, 217, 81, 1, 203,
+ 69, 217, 81, 1, 201, 143, 217, 81, 1, 199, 159, 217, 81, 252, 68, 87, 58,
+ 217, 81, 252, 68, 87, 60, 217, 81, 31, 107, 217, 81, 31, 149, 217, 81,
+ 31, 199, 95, 217, 81, 31, 197, 32, 217, 81, 31, 91, 228, 140, 217, 81,
+ 208, 152, 201, 102, 217, 81, 208, 152, 232, 201, 217, 81, 208, 152, 55,
+ 75, 193, 53, 236, 140, 217, 81, 208, 152, 75, 193, 53, 236, 140, 217, 81,
+ 208, 152, 236, 140, 217, 81, 208, 152, 105, 236, 138, 217, 81, 208, 152,
+ 219, 113, 233, 3, 250, 142, 1, 65, 250, 142, 1, 252, 206, 250, 142, 1,
+ 251, 68, 250, 142, 1, 252, 164, 250, 142, 1, 251, 132, 250, 142, 1, 252,
+ 166, 250, 142, 1, 252, 25, 250, 142, 1, 252, 21, 250, 142, 1, 71, 250,
+ 142, 1, 234, 188, 250, 142, 1, 74, 250, 142, 1, 211, 87, 250, 142, 1, 68,
+ 250, 142, 1, 223, 199, 250, 142, 1, 66, 250, 142, 1, 196, 30, 250, 142,
+ 1, 222, 22, 250, 142, 1, 192, 214, 250, 142, 1, 192, 173, 250, 142, 1,
+ 192, 184, 250, 142, 1, 231, 165, 250, 142, 1, 231, 122, 250, 142, 1, 231,
+ 77, 250, 142, 1, 247, 42, 250, 142, 1, 223, 10, 250, 142, 1, 199, 145,
+ 250, 142, 1, 199, 33, 250, 142, 1, 237, 146, 250, 142, 1, 237, 59, 250,
+ 142, 1, 197, 127, 250, 142, 1, 210, 63, 250, 142, 1, 233, 59, 250, 142,
+ 1, 249, 17, 250, 142, 1, 248, 196, 250, 142, 1, 214, 55, 250, 142, 1,
+ 213, 226, 250, 142, 1, 213, 227, 250, 142, 1, 214, 121, 250, 142, 1, 212,
+ 90, 250, 142, 1, 213, 74, 250, 142, 1, 216, 232, 250, 142, 1, 229, 73,
+ 250, 142, 1, 191, 173, 250, 142, 1, 192, 80, 250, 142, 1, 195, 153, 250,
+ 142, 1, 207, 113, 250, 142, 1, 219, 238, 250, 142, 1, 205, 68, 250, 142,
+ 1, 191, 87, 250, 142, 1, 203, 113, 250, 142, 1, 191, 62, 250, 142, 1,
+ 202, 229, 250, 142, 1, 201, 144, 250, 142, 1, 229, 245, 250, 142, 252,
+ 68, 77, 198, 138, 105, 185, 139, 91, 75, 208, 151, 2, 105, 185, 139, 91,
+ 75, 208, 151, 220, 13, 105, 185, 139, 91, 75, 208, 151, 220, 13, 91, 75,
+ 139, 105, 185, 208, 151, 220, 13, 105, 206, 185, 139, 91, 206, 189, 208,
+ 151, 220, 13, 91, 206, 189, 139, 105, 206, 185, 208, 151, 223, 122, 210,
+ 106, 1, 251, 190, 223, 122, 210, 106, 1, 248, 211, 223, 122, 210, 106, 1,
+ 231, 38, 223, 122, 210, 106, 1, 237, 252, 223, 122, 210, 106, 1, 229,
+ 245, 223, 122, 210, 106, 1, 193, 133, 223, 122, 210, 106, 1, 191, 91,
+ 223, 122, 210, 106, 1, 229, 184, 223, 122, 210, 106, 1, 199, 69, 223,
+ 122, 210, 106, 1, 191, 249, 223, 122, 210, 106, 1, 222, 75, 223, 122,
+ 210, 106, 1, 220, 26, 223, 122, 210, 106, 1, 216, 193, 223, 122, 210,
+ 106, 1, 212, 130, 223, 122, 210, 106, 1, 205, 148, 223, 122, 210, 106, 1,
+ 250, 126, 223, 122, 210, 106, 1, 210, 63, 223, 122, 210, 106, 1, 205,
+ 189, 223, 122, 210, 106, 1, 208, 37, 223, 122, 210, 106, 1, 207, 38, 223,
+ 122, 210, 106, 1, 203, 69, 223, 122, 210, 106, 1, 199, 159, 223, 122,
+ 210, 106, 31, 107, 223, 122, 210, 106, 31, 109, 223, 122, 210, 106, 31,
+ 138, 223, 122, 210, 106, 31, 134, 223, 122, 210, 106, 31, 199, 95, 223,
+ 122, 210, 106, 31, 197, 32, 223, 122, 210, 106, 31, 91, 228, 140, 223,
+ 122, 210, 106, 31, 91, 189, 223, 122, 210, 199, 1, 251, 190, 223, 122,
+ 210, 199, 1, 248, 211, 223, 122, 210, 199, 1, 231, 38, 223, 122, 210,
+ 199, 1, 237, 252, 223, 122, 210, 199, 1, 229, 245, 223, 122, 210, 199, 1,
+ 193, 132, 223, 122, 210, 199, 1, 191, 91, 223, 122, 210, 199, 1, 229,
+ 184, 223, 122, 210, 199, 1, 199, 69, 223, 122, 210, 199, 1, 191, 249,
+ 223, 122, 210, 199, 1, 222, 75, 223, 122, 210, 199, 1, 220, 26, 223, 122,
+ 210, 199, 1, 216, 192, 223, 122, 210, 199, 1, 212, 130, 223, 122, 210,
+ 199, 1, 205, 148, 223, 122, 210, 199, 1, 210, 63, 223, 122, 210, 199, 1,
+ 205, 189, 223, 122, 210, 199, 1, 203, 69, 223, 122, 210, 199, 1, 199,
+ 159, 223, 122, 210, 199, 31, 107, 223, 122, 210, 199, 31, 109, 223, 122,
+ 210, 199, 31, 138, 223, 122, 210, 199, 31, 134, 223, 122, 210, 199, 31,
+ 199, 95, 223, 122, 210, 199, 31, 197, 32, 223, 122, 210, 199, 31, 91,
+ 228, 140, 223, 122, 210, 199, 31, 91, 189, 208, 177, 210, 199, 1, 251,
+ 190, 208, 177, 210, 199, 1, 248, 211, 208, 177, 210, 199, 1, 231, 38,
+ 208, 177, 210, 199, 1, 237, 252, 208, 177, 210, 199, 1, 229, 245, 208,
+ 177, 210, 199, 1, 193, 132, 208, 177, 210, 199, 1, 191, 91, 208, 177,
+ 210, 199, 1, 229, 184, 208, 177, 210, 199, 1, 191, 249, 208, 177, 210,
+ 199, 1, 222, 75, 208, 177, 210, 199, 1, 220, 26, 208, 177, 210, 199, 1,
+ 216, 192, 208, 177, 210, 199, 1, 212, 130, 208, 177, 210, 199, 1, 205,
+ 148, 208, 177, 210, 199, 1, 210, 63, 208, 177, 210, 199, 1, 205, 189,
+ 208, 177, 210, 199, 1, 203, 69, 208, 177, 210, 199, 1, 199, 159, 208,
+ 177, 210, 199, 205, 54, 77, 208, 177, 210, 199, 153, 205, 54, 77, 208,
+ 177, 210, 199, 232, 128, 185, 4, 238, 217, 208, 177, 210, 199, 232, 128,
+ 185, 4, 236, 140, 208, 177, 210, 199, 31, 107, 208, 177, 210, 199, 31,
+ 109, 208, 177, 210, 199, 31, 138, 208, 177, 210, 199, 31, 134, 208, 177,
+ 210, 199, 31, 199, 95, 208, 177, 210, 199, 31, 197, 32, 208, 177, 210,
+ 199, 31, 91, 228, 140, 39, 197, 61, 1, 211, 44, 65, 39, 197, 61, 1, 192,
+ 68, 65, 39, 197, 61, 1, 192, 68, 252, 25, 39, 197, 61, 1, 211, 44, 68,
+ 39, 197, 61, 1, 192, 68, 68, 39, 197, 61, 1, 192, 68, 71, 39, 197, 61, 1,
+ 211, 44, 74, 39, 197, 61, 1, 211, 44, 211, 151, 39, 197, 61, 1, 192, 68,
+ 211, 151, 39, 197, 61, 1, 211, 44, 252, 155, 39, 197, 61, 1, 192, 68,
+ 252, 155, 39, 197, 61, 1, 211, 44, 252, 24, 39, 197, 61, 1, 192, 68, 252,
+ 24, 39, 197, 61, 1, 211, 44, 251, 253, 39, 197, 61, 1, 192, 68, 251, 253,
+ 39, 197, 61, 1, 211, 44, 252, 19, 39, 197, 61, 1, 192, 68, 252, 19, 39,
+ 197, 61, 1, 211, 44, 252, 42, 39, 197, 61, 1, 192, 68, 252, 42, 39, 197,
+ 61, 1, 211, 44, 252, 23, 39, 197, 61, 1, 211, 44, 233, 182, 39, 197, 61,
+ 1, 192, 68, 233, 182, 39, 197, 61, 1, 211, 44, 250, 131, 39, 197, 61, 1,
+ 192, 68, 250, 131, 39, 197, 61, 1, 211, 44, 252, 6, 39, 197, 61, 1, 192,
+ 68, 252, 6, 39, 197, 61, 1, 211, 44, 252, 17, 39, 197, 61, 1, 192, 68,
+ 252, 17, 39, 197, 61, 1, 211, 44, 211, 149, 39, 197, 61, 1, 192, 68, 211,
+ 149, 39, 197, 61, 1, 211, 44, 251, 207, 39, 197, 61, 1, 192, 68, 251,
+ 207, 39, 197, 61, 1, 211, 44, 252, 16, 39, 197, 61, 1, 211, 44, 234, 118,
+ 39, 197, 61, 1, 211, 44, 234, 114, 39, 197, 61, 1, 211, 44, 251, 132, 39,
+ 197, 61, 1, 211, 44, 252, 14, 39, 197, 61, 1, 192, 68, 252, 14, 39, 197,
+ 61, 1, 211, 44, 234, 80, 39, 197, 61, 1, 192, 68, 234, 80, 39, 197, 61,
+ 1, 211, 44, 234, 100, 39, 197, 61, 1, 192, 68, 234, 100, 39, 197, 61, 1,
+ 211, 44, 234, 66, 39, 197, 61, 1, 192, 68, 234, 66, 39, 197, 61, 1, 192,
+ 68, 251, 122, 39, 197, 61, 1, 211, 44, 234, 88, 39, 197, 61, 1, 192, 68,
+ 252, 13, 39, 197, 61, 1, 211, 44, 234, 56, 39, 197, 61, 1, 211, 44, 211,
+ 78, 39, 197, 61, 1, 211, 44, 228, 28, 39, 197, 61, 1, 211, 44, 234, 197,
+ 39, 197, 61, 1, 192, 68, 234, 197, 39, 197, 61, 1, 211, 44, 251, 37, 39,
+ 197, 61, 1, 192, 68, 251, 37, 39, 197, 61, 1, 211, 44, 223, 79, 39, 197,
+ 61, 1, 192, 68, 223, 79, 39, 197, 61, 1, 211, 44, 211, 58, 39, 197, 61,
+ 1, 192, 68, 211, 58, 39, 197, 61, 1, 211, 44, 251, 33, 39, 197, 61, 1,
+ 192, 68, 251, 33, 39, 197, 61, 1, 211, 44, 252, 12, 39, 197, 61, 1, 211,
+ 44, 250, 219, 39, 197, 61, 1, 211, 44, 252, 10, 39, 197, 61, 1, 211, 44,
+ 250, 209, 39, 197, 61, 1, 192, 68, 250, 209, 39, 197, 61, 1, 211, 44,
+ 234, 12, 39, 197, 61, 1, 192, 68, 234, 12, 39, 197, 61, 1, 211, 44, 250,
+ 182, 39, 197, 61, 1, 192, 68, 250, 182, 39, 197, 61, 1, 211, 44, 252, 7,
+ 39, 197, 61, 1, 192, 68, 252, 7, 39, 197, 61, 1, 211, 44, 211, 30, 39,
+ 197, 61, 1, 211, 44, 249, 71, 39, 177, 6, 1, 65, 39, 177, 6, 1, 252, 206,
+ 39, 177, 6, 1, 234, 199, 39, 177, 6, 1, 251, 144, 39, 177, 6, 1, 234,
+ 197, 39, 177, 6, 1, 234, 100, 39, 177, 6, 1, 234, 193, 39, 177, 6, 1,
+ 234, 192, 39, 177, 6, 1, 251, 125, 39, 177, 6, 1, 71, 39, 177, 6, 1, 242,
+ 220, 71, 39, 177, 6, 1, 234, 188, 39, 177, 6, 1, 234, 181, 39, 177, 6, 1,
+ 234, 180, 39, 177, 6, 1, 234, 176, 39, 177, 6, 1, 234, 173, 39, 177, 6,
+ 1, 68, 39, 177, 6, 1, 223, 199, 39, 177, 6, 1, 234, 150, 39, 177, 6, 1,
+ 234, 147, 39, 177, 6, 1, 251, 216, 39, 177, 6, 1, 196, 86, 39, 177, 6, 1,
+ 234, 140, 39, 177, 6, 1, 234, 117, 39, 177, 6, 1, 234, 114, 39, 177, 6,
+ 1, 234, 103, 39, 177, 6, 1, 234, 66, 39, 177, 6, 1, 74, 39, 177, 6, 1,
+ 211, 87, 39, 177, 6, 1, 213, 182, 211, 151, 39, 177, 6, 1, 206, 58, 211,
+ 151, 39, 177, 6, 1, 211, 150, 39, 177, 6, 1, 234, 56, 39, 177, 6, 1, 234,
+ 108, 39, 177, 6, 1, 234, 34, 39, 177, 6, 1, 203, 40, 234, 34, 39, 177, 6,
+ 1, 234, 22, 39, 177, 6, 1, 234, 1, 39, 177, 6, 1, 233, 255, 39, 177, 6,
+ 1, 234, 80, 39, 177, 6, 1, 233, 243, 39, 177, 6, 1, 234, 195, 39, 177, 6,
+ 1, 66, 39, 177, 6, 1, 196, 30, 39, 177, 6, 1, 213, 182, 196, 152, 39,
+ 177, 6, 1, 206, 58, 196, 152, 39, 177, 6, 1, 233, 230, 39, 177, 6, 1,
+ 233, 182, 39, 177, 6, 1, 233, 177, 39, 177, 6, 1, 234, 79, 56, 39, 177,
+ 6, 1, 196, 45, 39, 177, 2, 1, 65, 39, 177, 2, 1, 252, 206, 39, 177, 2, 1,
+ 234, 199, 39, 177, 2, 1, 251, 144, 39, 177, 2, 1, 234, 197, 39, 177, 2,
+ 1, 234, 100, 39, 177, 2, 1, 234, 193, 39, 177, 2, 1, 234, 192, 39, 177,
+ 2, 1, 251, 125, 39, 177, 2, 1, 71, 39, 177, 2, 1, 242, 220, 71, 39, 177,
+ 2, 1, 234, 188, 39, 177, 2, 1, 234, 181, 39, 177, 2, 1, 234, 180, 39,
+ 177, 2, 1, 234, 176, 39, 177, 2, 1, 234, 173, 39, 177, 2, 1, 68, 39, 177,
+ 2, 1, 223, 199, 39, 177, 2, 1, 234, 150, 39, 177, 2, 1, 234, 147, 39,
+ 177, 2, 1, 251, 216, 39, 177, 2, 1, 196, 86, 39, 177, 2, 1, 234, 140, 39,
+ 177, 2, 1, 234, 117, 39, 177, 2, 1, 234, 114, 39, 177, 2, 1, 234, 103,
+ 39, 177, 2, 1, 234, 66, 39, 177, 2, 1, 74, 39, 177, 2, 1, 211, 87, 39,
+ 177, 2, 1, 213, 182, 211, 151, 39, 177, 2, 1, 206, 58, 211, 151, 39, 177,
+ 2, 1, 211, 150, 39, 177, 2, 1, 234, 56, 39, 177, 2, 1, 234, 108, 39, 177,
+ 2, 1, 234, 34, 39, 177, 2, 1, 203, 40, 234, 34, 39, 177, 2, 1, 234, 22,
+ 39, 177, 2, 1, 234, 1, 39, 177, 2, 1, 233, 255, 39, 177, 2, 1, 234, 80,
+ 39, 177, 2, 1, 233, 243, 39, 177, 2, 1, 234, 195, 39, 177, 2, 1, 66, 39,
+ 177, 2, 1, 196, 30, 39, 177, 2, 1, 213, 182, 196, 152, 39, 177, 2, 1,
+ 206, 58, 196, 152, 39, 177, 2, 1, 233, 230, 39, 177, 2, 1, 233, 182, 39,
+ 177, 2, 1, 233, 177, 39, 177, 2, 1, 234, 79, 56, 39, 177, 2, 1, 196, 45,
+ 39, 177, 31, 107, 39, 177, 31, 149, 39, 177, 31, 199, 95, 39, 177, 31,
+ 233, 15, 39, 177, 31, 91, 228, 140, 39, 177, 31, 91, 189, 230, 24, 206,
+ 142, 1, 65, 230, 24, 206, 142, 1, 249, 153, 230, 24, 206, 142, 1, 168,
+ 230, 24, 206, 142, 1, 190, 190, 230, 24, 206, 142, 1, 197, 132, 230, 24,
+ 206, 142, 1, 223, 32, 230, 24, 206, 142, 1, 247, 160, 230, 24, 206, 142,
+ 1, 140, 230, 24, 206, 142, 1, 221, 215, 230, 24, 206, 142, 1, 233, 109,
+ 230, 24, 206, 142, 1, 238, 32, 230, 24, 206, 142, 1, 237, 191, 230, 24,
+ 206, 142, 1, 165, 230, 24, 206, 142, 1, 206, 109, 230, 24, 206, 142, 1,
+ 191, 123, 230, 24, 206, 142, 1, 188, 230, 24, 206, 142, 1, 203, 165, 230,
+ 24, 206, 142, 1, 155, 230, 24, 206, 142, 1, 231, 240, 230, 24, 206, 142,
+ 1, 173, 230, 24, 206, 142, 1, 174, 230, 24, 206, 142, 1, 180, 230, 24,
+ 206, 142, 1, 193, 190, 230, 24, 206, 142, 1, 221, 137, 193, 190, 230, 24,
+ 206, 142, 1, 170, 230, 24, 206, 142, 1, 221, 137, 170, 230, 24, 206, 142,
+ 1, 214, 68, 230, 24, 206, 142, 1, 212, 101, 230, 24, 206, 142, 1, 195,
+ 188, 230, 24, 206, 142, 18, 65, 230, 24, 206, 142, 18, 68, 230, 24, 206,
+ 142, 18, 66, 230, 24, 206, 142, 18, 71, 230, 24, 206, 142, 18, 74, 230,
+ 24, 206, 142, 87, 205, 173, 230, 24, 206, 142, 87, 215, 7, 221, 178, 230,
+ 24, 206, 142, 3, 230, 18, 230, 24, 206, 142, 3, 199, 218, 230, 24, 206,
+ 142, 3, 199, 192, 230, 24, 206, 142, 3, 199, 172, 230, 24, 206, 142, 17,
+ 191, 77, 230, 24, 206, 142, 17, 107, 230, 24, 206, 142, 17, 109, 230, 24,
+ 206, 142, 17, 138, 230, 24, 206, 142, 17, 134, 230, 24, 206, 142, 17,
+ 149, 230, 24, 206, 142, 17, 169, 230, 24, 206, 142, 17, 175, 230, 24,
+ 206, 142, 17, 171, 230, 24, 206, 142, 17, 178, 206, 46, 17, 107, 206, 46,
+ 17, 109, 206, 46, 17, 138, 206, 46, 17, 134, 206, 46, 17, 149, 206, 46,
+ 17, 169, 206, 46, 17, 175, 206, 46, 17, 171, 206, 46, 17, 178, 206, 46,
+ 31, 199, 95, 206, 46, 31, 197, 32, 206, 46, 31, 198, 249, 206, 46, 31,
+ 232, 135, 206, 46, 31, 233, 15, 206, 46, 31, 202, 120, 206, 46, 31, 203,
+ 241, 206, 46, 31, 234, 153, 206, 46, 31, 213, 169, 206, 46, 31, 91, 228,
+ 140, 206, 46, 31, 105, 228, 140, 206, 46, 31, 115, 228, 140, 206, 46, 31,
+ 232, 128, 228, 140, 206, 46, 31, 232, 226, 228, 140, 206, 46, 31, 202,
+ 136, 228, 140, 206, 46, 31, 203, 247, 228, 140, 206, 46, 31, 234, 164,
+ 228, 140, 206, 46, 31, 213, 175, 228, 140, 206, 46, 232, 118, 91, 230,
+ 70, 206, 46, 232, 118, 91, 208, 22, 206, 46, 232, 118, 91, 199, 0, 206,
+ 46, 232, 118, 105, 198, 253, 192, 39, 1, 234, 124, 192, 39, 1, 249, 17,
+ 192, 39, 1, 210, 63, 192, 39, 1, 209, 214, 192, 39, 1, 199, 33, 192, 39,
+ 1, 205, 68, 192, 39, 1, 243, 16, 192, 39, 1, 243, 83, 192, 39, 1, 243,
+ 97, 192, 39, 1, 229, 177, 192, 39, 1, 192, 220, 192, 39, 1, 238, 3, 192,
+ 39, 1, 191, 108, 192, 39, 1, 165, 192, 39, 1, 207, 6, 192, 39, 1, 191,
+ 123, 192, 39, 1, 223, 32, 192, 39, 1, 202, 174, 192, 39, 1, 203, 69, 192,
+ 39, 1, 205, 192, 192, 39, 1, 238, 26, 192, 39, 1, 190, 190, 192, 39, 1,
+ 191, 87, 192, 39, 1, 233, 184, 192, 39, 1, 192, 208, 192, 39, 1, 233,
+ 109, 192, 39, 1, 195, 188, 192, 39, 1, 195, 189, 251, 157, 20, 192, 39,
+ 1, 208, 89, 192, 39, 1, 222, 106, 192, 39, 1, 221, 212, 192, 39, 1, 231,
+ 227, 192, 39, 1, 220, 35, 192, 39, 1, 216, 46, 192, 39, 1, 212, 130, 192,
+ 39, 1, 196, 120, 192, 39, 1, 193, 133, 192, 39, 1, 210, 250, 192, 39, 1,
+ 233, 224, 192, 39, 1, 229, 252, 192, 39, 1, 191, 240, 192, 39, 1, 233,
+ 255, 192, 39, 33, 230, 58, 77, 192, 39, 33, 217, 142, 77, 192, 39, 228,
+ 86, 77, 192, 39, 1, 220, 36, 4, 75, 58, 192, 39, 1, 191, 241, 4, 243, 2,
+ 58, 9, 2, 130, 193, 23, 205, 171, 9, 2, 130, 193, 23, 208, 79, 9, 2, 130,
+ 193, 23, 217, 141, 39, 202, 28, 1, 251, 190, 39, 202, 28, 1, 53, 251,
+ 190, 39, 202, 28, 1, 248, 211, 39, 202, 28, 1, 53, 248, 211, 39, 202, 28,
+ 1, 231, 38, 39, 202, 28, 1, 229, 245, 39, 202, 28, 1, 53, 229, 245, 39,
+ 202, 28, 1, 193, 133, 39, 202, 28, 1, 191, 91, 39, 202, 28, 1, 229, 184,
+ 39, 202, 28, 1, 191, 249, 39, 202, 28, 1, 222, 75, 39, 202, 28, 1, 220,
+ 26, 39, 202, 28, 1, 216, 193, 39, 202, 28, 1, 212, 130, 39, 202, 28, 1,
+ 53, 212, 130, 39, 202, 28, 1, 53, 212, 131, 4, 81, 199, 215, 39, 202, 28,
+ 1, 205, 148, 39, 202, 28, 1, 250, 126, 39, 202, 28, 1, 251, 157, 250,
+ 126, 39, 202, 28, 1, 210, 63, 39, 202, 28, 1, 205, 189, 39, 202, 28, 1,
+ 53, 205, 189, 39, 202, 28, 1, 53, 205, 190, 4, 81, 199, 215, 39, 202, 28,
+ 1, 207, 36, 39, 202, 28, 1, 203, 69, 39, 202, 28, 1, 199, 159, 39, 202,
+ 28, 1, 53, 199, 159, 39, 202, 28, 1, 53, 199, 160, 4, 81, 199, 215, 39,
+ 202, 28, 31, 107, 39, 202, 28, 31, 109, 39, 202, 28, 31, 138, 39, 202,
+ 28, 31, 134, 39, 202, 28, 31, 149, 39, 202, 28, 31, 199, 95, 39, 202, 28,
+ 31, 197, 32, 39, 202, 28, 31, 198, 249, 39, 202, 28, 31, 91, 228, 140,
+ 39, 202, 28, 232, 118, 91, 230, 70, 39, 202, 28, 34, 250, 125, 202, 28,
+ 1, 251, 190, 202, 28, 1, 248, 211, 202, 28, 1, 231, 38, 202, 28, 1, 229,
+ 245, 202, 28, 1, 193, 133, 202, 28, 1, 191, 91, 202, 28, 1, 229, 184,
+ 202, 28, 1, 191, 249, 202, 28, 1, 222, 75, 202, 28, 1, 220, 26, 202, 28,
+ 1, 216, 193, 202, 28, 1, 212, 130, 202, 28, 1, 205, 148, 202, 28, 1, 250,
+ 126, 202, 28, 1, 210, 63, 202, 28, 1, 205, 189, 202, 28, 1, 207, 37, 202,
+ 28, 1, 203, 69, 202, 28, 1, 199, 159, 202, 28, 1, 233, 30, 202, 28, 1,
+ 219, 182, 202, 28, 223, 149, 203, 69, 202, 28, 33, 75, 60, 202, 28, 33,
+ 105, 185, 60, 202, 28, 33, 75, 58, 202, 28, 33, 105, 185, 58, 202, 28,
+ 33, 238, 165, 58, 202, 28, 33, 238, 165, 60, 202, 28, 33, 228, 251, 58,
+ 202, 28, 33, 228, 251, 60, 202, 28, 33, 179, 228, 251, 60, 202, 28, 33,
+ 207, 39, 60, 202, 28, 33, 201, 28, 60, 202, 28, 31, 107, 202, 28, 31,
+ 199, 95, 202, 28, 31, 197, 32, 202, 28, 31, 91, 228, 140, 202, 28, 208,
+ 152, 105, 81, 249, 76, 202, 28, 208, 152, 105, 81, 249, 77, 4, 236, 138,
+ 202, 28, 208, 152, 243, 11, 4, 236, 140, 202, 28, 208, 152, 105, 243, 8,
+ 4, 236, 138, 202, 28, 208, 152, 132, 243, 11, 4, 236, 140, 39, 196, 19,
+ 1, 251, 190, 39, 196, 19, 1, 248, 211, 39, 196, 19, 1, 231, 37, 39, 196,
+ 19, 1, 193, 133, 39, 196, 19, 1, 191, 91, 39, 196, 19, 1, 53, 229, 184,
+ 39, 196, 19, 1, 191, 249, 39, 196, 19, 1, 222, 75, 39, 196, 19, 1, 220,
+ 26, 39, 196, 19, 1, 216, 193, 39, 196, 19, 1, 212, 130, 39, 196, 19, 1,
+ 205, 148, 39, 196, 19, 1, 210, 63, 39, 196, 19, 1, 205, 189, 39, 196, 19,
+ 1, 207, 38, 39, 196, 19, 1, 203, 69, 39, 196, 19, 1, 199, 159, 39, 196,
+ 19, 1, 219, 182, 39, 196, 19, 33, 75, 58, 39, 196, 19, 33, 75, 60, 39,
+ 196, 19, 33, 105, 185, 58, 39, 196, 19, 33, 105, 185, 60, 39, 196, 19,
+ 208, 152, 164, 39, 196, 19, 208, 152, 105, 249, 76, 39, 196, 19, 208,
+ 152, 105, 236, 138, 39, 196, 19, 208, 152, 232, 128, 236, 138, 243, 61,
+ 1, 251, 190, 243, 61, 1, 2, 251, 190, 243, 61, 1, 248, 211, 243, 61, 1,
+ 231, 38, 243, 61, 1, 237, 252, 243, 61, 1, 229, 245, 243, 61, 1, 193,
+ 133, 243, 61, 1, 238, 174, 193, 133, 243, 61, 1, 191, 91, 243, 61, 1,
+ 229, 184, 243, 61, 1, 191, 249, 243, 61, 1, 222, 75, 243, 61, 1, 220, 26,
+ 243, 61, 1, 216, 193, 243, 61, 1, 212, 130, 243, 61, 1, 205, 148, 243,
+ 61, 1, 250, 126, 243, 61, 1, 210, 63, 243, 61, 1, 207, 38, 243, 61, 1,
+ 203, 69, 243, 61, 1, 199, 159, 243, 61, 31, 107, 243, 61, 31, 109, 243,
+ 61, 31, 138, 243, 61, 31, 134, 243, 61, 31, 199, 95, 243, 61, 31, 197,
+ 32, 243, 61, 31, 91, 228, 140, 234, 116, 1, 251, 190, 234, 116, 1, 248,
+ 211, 234, 116, 1, 231, 38, 234, 116, 1, 237, 252, 234, 116, 1, 229, 245,
+ 234, 116, 1, 193, 133, 234, 116, 1, 191, 91, 234, 116, 1, 229, 184, 234,
+ 116, 1, 199, 69, 234, 116, 1, 191, 249, 234, 116, 1, 222, 75, 234, 116,
+ 1, 220, 26, 234, 116, 1, 216, 193, 234, 116, 1, 212, 130, 234, 116, 1,
+ 205, 148, 234, 116, 1, 250, 126, 234, 116, 1, 210, 63, 234, 116, 1, 205,
+ 189, 234, 116, 1, 208, 37, 234, 116, 1, 207, 38, 234, 116, 1, 203, 69,
+ 234, 116, 1, 199, 159, 234, 116, 34, 191, 90, 162, 3, 247, 119, 162, 3,
+ 251, 71, 162, 3, 195, 35, 162, 3, 222, 237, 162, 3, 196, 75, 162, 1, 65,
+ 162, 1, 252, 206, 162, 1, 68, 162, 1, 223, 199, 162, 1, 66, 162, 1, 196,
+ 30, 162, 1, 117, 146, 162, 1, 117, 206, 110, 162, 1, 117, 172, 162, 1,
+ 117, 219, 74, 162, 1, 71, 162, 1, 251, 236, 162, 1, 74, 162, 1, 250, 163,
+ 162, 1, 155, 162, 1, 221, 215, 162, 1, 231, 240, 162, 1, 231, 91, 162, 1,
+ 214, 68, 162, 1, 247, 160, 162, 1, 247, 1, 162, 1, 223, 32, 162, 1, 222,
+ 252, 162, 1, 212, 101, 162, 1, 197, 132, 162, 1, 197, 120, 162, 1, 237,
+ 191, 162, 1, 237, 175, 162, 1, 213, 79, 162, 1, 190, 190, 162, 1, 199,
+ 49, 162, 1, 238, 32, 162, 1, 237, 68, 162, 1, 180, 162, 1, 168, 162, 1,
+ 209, 228, 162, 1, 249, 153, 162, 1, 248, 203, 162, 1, 174, 162, 1, 170,
+ 162, 1, 165, 162, 1, 173, 162, 1, 195, 188, 162, 1, 203, 165, 162, 1,
+ 201, 175, 162, 1, 188, 162, 1, 140, 162, 1, 219, 73, 162, 1, 39, 44, 219,
+ 62, 162, 1, 39, 44, 206, 109, 162, 1, 39, 44, 213, 61, 162, 18, 3, 252,
+ 206, 162, 18, 3, 248, 197, 252, 206, 162, 18, 3, 68, 162, 18, 3, 223,
+ 199, 162, 18, 3, 66, 162, 18, 3, 196, 30, 162, 18, 3, 117, 146, 162, 18,
+ 3, 117, 206, 110, 162, 18, 3, 117, 172, 162, 18, 3, 117, 219, 74, 162,
+ 18, 3, 71, 162, 18, 3, 251, 236, 162, 18, 3, 74, 162, 18, 3, 250, 163,
+ 162, 195, 40, 162, 237, 238, 162, 55, 237, 238, 162, 208, 152, 236, 140,
+ 162, 208, 152, 55, 236, 140, 162, 208, 152, 219, 112, 162, 208, 152, 238,
+ 228, 164, 162, 208, 152, 218, 246, 162, 31, 107, 162, 31, 109, 162, 31,
+ 138, 162, 31, 134, 162, 31, 149, 162, 31, 169, 162, 31, 175, 162, 31,
+ 171, 162, 31, 178, 162, 31, 199, 95, 162, 31, 197, 32, 162, 31, 198, 249,
+ 162, 31, 232, 135, 162, 31, 233, 15, 162, 31, 202, 120, 162, 31, 203,
+ 241, 162, 31, 234, 153, 162, 31, 213, 169, 162, 31, 91, 228, 140, 162,
+ 31, 91, 189, 162, 17, 191, 77, 162, 17, 107, 162, 17, 109, 162, 17, 138,
+ 162, 17, 134, 162, 17, 149, 162, 17, 169, 162, 17, 175, 162, 17, 171,
+ 162, 17, 178, 162, 3, 39, 44, 195, 40, 162, 1, 39, 44, 203, 40, 71, 162,
+ 1, 39, 44, 203, 40, 74, 162, 18, 3, 39, 44, 203, 40, 71, 162, 18, 3, 39,
+ 44, 203, 40, 74, 162, 1, 39, 44, 219, 73, 162, 31, 222, 196, 222, 99, 3,
+ 247, 119, 222, 99, 3, 251, 71, 222, 99, 3, 195, 35, 222, 99, 1, 65, 222,
+ 99, 1, 252, 206, 222, 99, 1, 68, 222, 99, 1, 223, 199, 222, 99, 1, 66,
+ 222, 99, 1, 196, 30, 222, 99, 1, 71, 222, 99, 1, 251, 236, 222, 99, 1,
+ 74, 222, 99, 1, 250, 163, 222, 99, 1, 155, 222, 99, 1, 221, 215, 222, 99,
+ 1, 231, 240, 222, 99, 1, 231, 91, 222, 99, 1, 214, 68, 222, 99, 1, 247,
+ 160, 222, 99, 1, 247, 1, 222, 99, 1, 223, 32, 222, 99, 1, 222, 252, 222,
+ 99, 1, 212, 101, 222, 99, 1, 197, 132, 222, 99, 1, 197, 120, 222, 99, 1,
+ 237, 191, 222, 99, 1, 237, 180, 222, 99, 1, 237, 175, 222, 99, 1, 207, 6,
+ 222, 99, 1, 213, 79, 222, 99, 1, 190, 190, 222, 99, 1, 199, 49, 222, 99,
+ 1, 238, 32, 222, 99, 1, 237, 68, 222, 99, 1, 180, 222, 99, 1, 168, 222,
+ 99, 1, 209, 228, 222, 99, 1, 249, 153, 222, 99, 1, 248, 203, 222, 99, 1,
+ 174, 222, 99, 1, 170, 222, 99, 1, 165, 222, 99, 1, 173, 222, 99, 1, 195,
+ 188, 222, 99, 1, 203, 165, 222, 99, 1, 201, 175, 222, 99, 1, 188, 222,
+ 99, 1, 140, 222, 99, 18, 3, 252, 206, 222, 99, 18, 3, 68, 222, 99, 18, 3,
+ 223, 199, 222, 99, 18, 3, 66, 222, 99, 18, 3, 196, 30, 222, 99, 18, 3,
+ 71, 222, 99, 18, 3, 251, 236, 222, 99, 18, 3, 74, 222, 99, 18, 3, 250,
+ 163, 222, 99, 3, 195, 40, 222, 99, 3, 212, 141, 222, 99, 252, 68, 56,
+ 222, 99, 234, 69, 56, 222, 99, 31, 56, 222, 99, 205, 54, 77, 222, 99, 55,
+ 205, 54, 77, 222, 99, 237, 238, 222, 99, 55, 237, 238, 222, 99, 18, 3,
+ 117, 146, 222, 99, 31, 3, 58, 202, 12, 202, 20, 1, 205, 182, 202, 12,
+ 202, 20, 1, 199, 219, 202, 12, 202, 20, 1, 249, 123, 202, 12, 202, 20, 1,
+ 247, 149, 202, 12, 202, 20, 1, 238, 12, 202, 12, 202, 20, 1, 231, 225,
+ 202, 12, 202, 20, 1, 217, 120, 202, 12, 202, 20, 1, 214, 65, 202, 12,
+ 202, 20, 1, 220, 99, 202, 12, 202, 20, 1, 214, 237, 202, 12, 202, 20, 1,
+ 195, 184, 202, 12, 202, 20, 1, 210, 200, 202, 12, 202, 20, 1, 192, 121,
+ 202, 12, 202, 20, 1, 207, 160, 202, 12, 202, 20, 1, 230, 81, 202, 12,
+ 202, 20, 1, 222, 104, 202, 12, 202, 20, 1, 223, 26, 202, 12, 202, 20, 1,
+ 212, 98, 202, 12, 202, 20, 1, 251, 245, 202, 12, 202, 20, 1, 234, 186,
+ 202, 12, 202, 20, 1, 223, 200, 202, 12, 202, 20, 1, 196, 141, 202, 12,
+ 202, 20, 1, 211, 136, 202, 12, 202, 20, 1, 234, 173, 202, 12, 202, 20, 1,
+ 217, 136, 202, 12, 202, 20, 17, 191, 77, 202, 12, 202, 20, 17, 107, 202,
+ 12, 202, 20, 17, 109, 202, 12, 202, 20, 17, 138, 202, 12, 202, 20, 17,
+ 134, 202, 12, 202, 20, 17, 149, 202, 12, 202, 20, 17, 169, 202, 12, 202,
+ 20, 17, 175, 202, 12, 202, 20, 17, 171, 202, 12, 202, 20, 17, 178, 246,
+ 251, 3, 247, 119, 246, 251, 3, 251, 71, 246, 251, 3, 195, 35, 246, 251,
+ 1, 252, 206, 246, 251, 1, 68, 246, 251, 1, 66, 246, 251, 1, 71, 246, 251,
+ 1, 222, 127, 246, 251, 1, 221, 214, 246, 251, 1, 231, 237, 246, 251, 1,
+ 231, 90, 246, 251, 1, 214, 67, 246, 251, 1, 247, 159, 246, 251, 1, 247,
+ 0, 246, 251, 1, 223, 31, 246, 251, 1, 222, 251, 246, 251, 1, 212, 100,
+ 246, 251, 1, 197, 131, 246, 251, 1, 197, 119, 246, 251, 1, 237, 190, 246,
+ 251, 1, 237, 174, 246, 251, 1, 213, 78, 246, 251, 1, 199, 245, 246, 251,
+ 1, 199, 48, 246, 251, 1, 238, 31, 246, 251, 1, 237, 67, 246, 251, 1, 214,
+ 250, 246, 251, 1, 210, 220, 246, 251, 1, 209, 227, 246, 251, 1, 249, 151,
+ 246, 251, 1, 248, 202, 246, 251, 1, 217, 151, 246, 251, 1, 191, 174, 246,
+ 251, 1, 192, 140, 246, 251, 1, 207, 178, 246, 251, 1, 220, 125, 246, 251,
+ 1, 193, 181, 246, 251, 1, 205, 197, 246, 251, 1, 230, 91, 246, 251, 18,
+ 3, 65, 246, 251, 18, 3, 68, 246, 251, 18, 3, 223, 199, 246, 251, 18, 3,
+ 66, 246, 251, 18, 3, 196, 30, 246, 251, 18, 3, 71, 246, 251, 18, 3, 251,
+ 236, 246, 251, 18, 3, 74, 246, 251, 18, 3, 250, 163, 246, 251, 18, 3,
+ 211, 133, 246, 251, 187, 77, 246, 251, 250, 164, 77, 246, 251, 195, 40,
+ 246, 251, 217, 149, 246, 251, 17, 191, 77, 246, 251, 17, 107, 246, 251,
+ 17, 109, 246, 251, 17, 138, 246, 251, 17, 134, 246, 251, 17, 149, 246,
+ 251, 17, 169, 246, 251, 17, 175, 246, 251, 17, 171, 246, 251, 17, 178,
+ 246, 251, 205, 54, 77, 246, 251, 237, 238, 246, 251, 55, 237, 238, 246,
+ 251, 208, 13, 77, 246, 251, 1, 219, 158, 246, 251, 18, 3, 252, 206, 246,
+ 251, 18, 3, 234, 166, 246, 251, 1, 195, 187, 217, 118, 1, 65, 217, 118,
+ 1, 68, 217, 118, 1, 66, 217, 118, 1, 71, 217, 118, 1, 74, 217, 118, 1,
+ 155, 217, 118, 1, 221, 215, 217, 118, 1, 231, 240, 217, 118, 1, 231, 91,
+ 217, 118, 1, 247, 160, 217, 118, 1, 247, 1, 217, 118, 1, 223, 32, 217,
+ 118, 1, 222, 252, 217, 118, 1, 212, 101, 217, 118, 1, 197, 132, 217, 118,
+ 1, 197, 120, 217, 118, 1, 237, 191, 217, 118, 1, 237, 175, 217, 118, 1,
+ 213, 79, 217, 118, 1, 190, 190, 217, 118, 1, 199, 49, 217, 118, 1, 238,
+ 32, 217, 118, 1, 237, 68, 217, 118, 1, 180, 217, 118, 1, 168, 217, 118,
+ 1, 209, 228, 217, 118, 1, 249, 153, 217, 118, 1, 248, 203, 217, 118, 1,
+ 174, 217, 118, 1, 165, 217, 118, 1, 173, 217, 118, 1, 195, 188, 217, 118,
+ 1, 188, 217, 118, 1, 140, 217, 118, 1, 206, 109, 217, 118, 3, 212, 141,
+ 217, 118, 252, 68, 56, 217, 118, 205, 54, 77, 217, 118, 34, 203, 15, 203,
+ 129, 3, 247, 119, 203, 129, 3, 251, 71, 203, 129, 3, 195, 35, 203, 129,
+ 1, 65, 203, 129, 1, 252, 206, 203, 129, 1, 68, 203, 129, 1, 223, 199,
+ 203, 129, 1, 66, 203, 129, 1, 196, 30, 203, 129, 1, 117, 146, 203, 129,
+ 1, 117, 206, 110, 203, 129, 1, 117, 172, 203, 129, 1, 117, 219, 74, 203,
+ 129, 1, 71, 203, 129, 1, 251, 236, 203, 129, 1, 74, 203, 129, 1, 250,
+ 163, 203, 129, 1, 155, 203, 129, 1, 221, 215, 203, 129, 1, 231, 240, 203,
+ 129, 1, 231, 91, 203, 129, 1, 214, 68, 203, 129, 1, 247, 160, 203, 129,
+ 1, 247, 1, 203, 129, 1, 223, 32, 203, 129, 1, 222, 252, 203, 129, 1, 212,
+ 101, 203, 129, 1, 197, 132, 203, 129, 1, 197, 120, 203, 129, 1, 237, 191,
+ 203, 129, 1, 237, 175, 203, 129, 1, 213, 79, 203, 129, 1, 190, 190, 203,
+ 129, 1, 199, 49, 203, 129, 1, 238, 32, 203, 129, 1, 237, 68, 203, 129, 1,
+ 180, 203, 129, 1, 168, 203, 129, 1, 209, 228, 203, 129, 1, 249, 153, 203,
+ 129, 1, 248, 203, 203, 129, 1, 174, 203, 129, 1, 170, 203, 129, 1, 165,
+ 203, 129, 1, 173, 203, 129, 1, 219, 73, 203, 129, 1, 195, 188, 203, 129,
+ 1, 203, 165, 203, 129, 1, 201, 175, 203, 129, 1, 188, 203, 129, 1, 140,
+ 203, 129, 18, 3, 252, 206, 203, 129, 18, 3, 68, 203, 129, 18, 3, 223,
+ 199, 203, 129, 18, 3, 66, 203, 129, 18, 3, 196, 30, 203, 129, 18, 3, 117,
+ 146, 203, 129, 18, 3, 117, 206, 110, 203, 129, 18, 3, 117, 172, 203, 129,
+ 18, 3, 117, 219, 74, 203, 129, 18, 3, 71, 203, 129, 18, 3, 251, 236, 203,
+ 129, 18, 3, 74, 203, 129, 18, 3, 250, 163, 203, 129, 3, 195, 40, 203,
+ 129, 3, 250, 145, 203, 129, 3, 222, 237, 203, 129, 3, 196, 75, 203, 129,
+ 211, 113, 203, 129, 237, 238, 203, 129, 55, 237, 238, 203, 129, 252, 68,
+ 56, 203, 129, 204, 10, 203, 129, 205, 138, 77, 203, 129, 3, 212, 141,
+ 203, 129, 18, 52, 77, 203, 129, 233, 201, 203, 40, 18, 77, 203, 129, 200,
+ 162, 77, 203, 129, 18, 3, 208, 207, 71, 203, 129, 3, 223, 93, 247, 119,
+ 203, 129, 17, 191, 77, 203, 129, 17, 107, 203, 129, 17, 109, 203, 129,
+ 17, 138, 203, 129, 17, 134, 203, 129, 17, 149, 203, 129, 17, 169, 203,
+ 129, 17, 175, 203, 129, 17, 171, 203, 129, 17, 178, 203, 129, 234, 146,
+ 203, 129, 3, 202, 210, 203, 129, 229, 227, 203, 129, 239, 29, 56, 203,
+ 129, 205, 54, 217, 55, 203, 129, 205, 54, 217, 54, 166, 251, 14, 17, 107,
+ 166, 251, 14, 17, 109, 166, 251, 14, 17, 138, 166, 251, 14, 17, 134, 166,
+ 251, 14, 17, 149, 166, 251, 14, 17, 169, 166, 251, 14, 17, 175, 166, 251,
+ 14, 17, 171, 166, 251, 14, 17, 178, 166, 251, 14, 31, 199, 95, 166, 251,
+ 14, 31, 197, 32, 166, 251, 14, 31, 198, 249, 166, 251, 14, 31, 232, 135,
+ 166, 251, 14, 31, 233, 15, 166, 251, 14, 31, 202, 120, 166, 251, 14, 31,
+ 203, 241, 166, 251, 14, 31, 234, 153, 166, 251, 14, 31, 213, 169, 166,
+ 251, 14, 31, 91, 228, 140, 166, 251, 14, 31, 91, 189, 221, 182, 1, 65,
+ 221, 182, 1, 252, 206, 221, 182, 1, 68, 221, 182, 1, 66, 221, 182, 1, 71,
+ 221, 182, 1, 251, 236, 221, 182, 1, 74, 221, 182, 1, 250, 163, 221, 182,
+ 1, 155, 221, 182, 1, 221, 215, 221, 182, 1, 231, 240, 221, 182, 1, 231,
+ 127, 221, 182, 1, 231, 91, 221, 182, 1, 214, 68, 221, 182, 1, 247, 160,
+ 221, 182, 1, 247, 1, 221, 182, 1, 223, 32, 221, 182, 1, 222, 230, 221,
+ 182, 1, 212, 101, 221, 182, 1, 197, 132, 221, 182, 1, 197, 120, 221, 182,
+ 1, 237, 191, 221, 182, 1, 237, 175, 221, 182, 1, 213, 79, 221, 182, 1,
+ 190, 190, 221, 182, 1, 199, 49, 221, 182, 1, 238, 32, 221, 182, 1, 237,
+ 181, 221, 182, 1, 237, 68, 221, 182, 1, 180, 221, 182, 1, 168, 221, 182,
+ 1, 209, 228, 221, 182, 1, 249, 153, 221, 182, 1, 249, 53, 221, 182, 1,
+ 248, 203, 221, 182, 1, 174, 221, 182, 1, 170, 221, 182, 1, 165, 221, 182,
+ 1, 173, 221, 182, 1, 195, 188, 221, 182, 1, 188, 221, 182, 1, 140, 221,
+ 182, 1, 219, 73, 221, 182, 18, 3, 252, 206, 221, 182, 18, 3, 68, 221,
+ 182, 18, 3, 223, 199, 221, 182, 18, 3, 66, 221, 182, 18, 3, 71, 221, 182,
+ 18, 3, 251, 236, 221, 182, 18, 3, 74, 221, 182, 18, 3, 250, 163, 221,
+ 182, 3, 251, 71, 221, 182, 3, 195, 40, 221, 182, 3, 212, 141, 221, 182,
+ 3, 203, 155, 221, 182, 237, 238, 221, 182, 55, 237, 238, 221, 182, 193,
+ 23, 204, 10, 221, 182, 205, 54, 77, 221, 182, 55, 205, 54, 77, 221, 182,
+ 252, 68, 56, 221, 182, 3, 200, 206, 221, 182, 1, 208, 96, 221, 182, 1,
+ 203, 40, 68, 221, 182, 18, 3, 117, 146, 215, 133, 1, 65, 215, 133, 1, 68,
+ 215, 133, 1, 66, 215, 133, 1, 71, 215, 133, 1, 155, 215, 133, 1, 221,
+ 215, 215, 133, 1, 231, 240, 215, 133, 1, 231, 91, 215, 133, 1, 247, 160,
+ 215, 133, 1, 247, 1, 215, 133, 1, 223, 32, 215, 133, 1, 222, 230, 215,
+ 133, 1, 212, 101, 215, 133, 1, 197, 132, 215, 133, 1, 197, 120, 215, 133,
+ 1, 237, 191, 215, 133, 1, 237, 181, 215, 133, 1, 237, 175, 215, 133, 1,
+ 213, 79, 215, 133, 1, 190, 190, 215, 133, 1, 199, 49, 215, 133, 1, 238,
+ 32, 215, 133, 1, 237, 68, 215, 133, 1, 180, 215, 133, 1, 168, 215, 133,
+ 1, 209, 228, 215, 133, 1, 249, 153, 215, 133, 1, 248, 203, 215, 133, 1,
+ 174, 215, 133, 1, 170, 215, 133, 1, 165, 215, 133, 1, 173, 215, 133, 1,
+ 195, 188, 215, 133, 1, 188, 215, 133, 1, 140, 215, 133, 1, 206, 109, 215,
+ 133, 1, 207, 6, 215, 133, 205, 54, 77, 221, 172, 1, 65, 221, 172, 1, 252,
+ 206, 221, 172, 1, 68, 221, 172, 1, 223, 199, 221, 172, 1, 66, 221, 172,
+ 1, 196, 30, 221, 172, 1, 71, 221, 172, 1, 251, 236, 221, 172, 1, 74, 221,
+ 172, 1, 250, 163, 221, 172, 1, 155, 221, 172, 1, 221, 215, 221, 172, 1,
+ 231, 240, 221, 172, 1, 231, 127, 221, 172, 1, 231, 91, 221, 172, 1, 214,
+ 68, 221, 172, 1, 247, 160, 221, 172, 1, 247, 1, 221, 172, 1, 223, 32,
+ 221, 172, 1, 222, 230, 221, 172, 1, 222, 252, 221, 172, 1, 212, 101, 221,
+ 172, 1, 197, 132, 221, 172, 1, 197, 120, 221, 172, 1, 237, 191, 221, 172,
+ 1, 237, 181, 221, 172, 1, 206, 109, 221, 172, 1, 237, 175, 221, 172, 1,
+ 213, 79, 221, 172, 1, 190, 190, 221, 172, 1, 199, 49, 221, 172, 1, 238,
+ 32, 221, 172, 1, 237, 68, 221, 172, 1, 180, 221, 172, 1, 168, 221, 172,
+ 1, 209, 228, 221, 172, 1, 249, 153, 221, 172, 1, 249, 53, 221, 172, 1,
+ 248, 203, 221, 172, 1, 174, 221, 172, 1, 170, 221, 172, 1, 165, 221, 172,
+ 1, 173, 221, 172, 1, 195, 188, 221, 172, 1, 203, 165, 221, 172, 1, 188,
+ 221, 172, 1, 140, 221, 172, 3, 251, 71, 221, 172, 18, 3, 252, 206, 221,
+ 172, 18, 3, 68, 221, 172, 18, 3, 223, 199, 221, 172, 18, 3, 66, 221, 172,
+ 18, 3, 196, 30, 221, 172, 18, 3, 71, 221, 172, 18, 3, 251, 236, 221, 172,
+ 18, 3, 74, 221, 172, 18, 3, 250, 163, 221, 172, 3, 212, 141, 221, 172, 3,
+ 195, 40, 221, 172, 17, 191, 77, 221, 172, 17, 107, 221, 172, 17, 109,
+ 221, 172, 17, 138, 221, 172, 17, 134, 221, 172, 17, 149, 221, 172, 17,
+ 169, 221, 172, 17, 175, 221, 172, 17, 171, 221, 172, 17, 178, 230, 219,
+ 3, 33, 251, 72, 58, 230, 219, 3, 247, 119, 230, 219, 3, 251, 71, 230,
+ 219, 3, 195, 35, 230, 219, 1, 65, 230, 219, 1, 252, 206, 230, 219, 1, 68,
+ 230, 219, 1, 223, 199, 230, 219, 1, 66, 230, 219, 1, 196, 30, 230, 219,
+ 1, 117, 146, 230, 219, 1, 117, 172, 230, 219, 1, 234, 188, 230, 219, 1,
+ 251, 236, 230, 219, 1, 211, 87, 230, 219, 1, 250, 163, 230, 219, 1, 155,
+ 230, 219, 1, 221, 215, 230, 219, 1, 231, 240, 230, 219, 1, 231, 91, 230,
+ 219, 1, 214, 68, 230, 219, 1, 247, 160, 230, 219, 1, 247, 1, 230, 219, 1,
+ 223, 32, 230, 219, 1, 222, 252, 230, 219, 1, 212, 101, 230, 219, 1, 197,
+ 132, 230, 219, 1, 197, 120, 230, 219, 1, 237, 191, 230, 219, 1, 237, 175,
+ 230, 219, 1, 213, 79, 230, 219, 1, 190, 190, 230, 219, 1, 199, 49, 230,
+ 219, 1, 238, 32, 230, 219, 1, 237, 68, 230, 219, 1, 180, 230, 219, 1,
+ 168, 230, 219, 1, 209, 228, 230, 219, 1, 249, 153, 230, 219, 1, 248, 203,
+ 230, 219, 1, 174, 230, 219, 1, 170, 230, 219, 1, 165, 230, 219, 1, 173,
+ 230, 219, 1, 219, 73, 230, 219, 1, 195, 188, 230, 219, 1, 203, 165, 230,
+ 219, 1, 201, 175, 230, 219, 1, 188, 230, 219, 1, 140, 33, 248, 165, 60,
+ 230, 219, 3, 212, 141, 230, 219, 3, 250, 145, 230, 219, 18, 3, 252, 206,
+ 230, 219, 18, 3, 68, 230, 219, 18, 3, 223, 199, 230, 219, 18, 3, 66, 230,
+ 219, 18, 3, 196, 30, 230, 219, 18, 3, 117, 146, 230, 219, 18, 3, 117,
+ 206, 110, 230, 219, 18, 3, 234, 188, 230, 219, 18, 3, 251, 236, 230, 219,
+ 18, 3, 211, 87, 230, 219, 18, 3, 250, 163, 230, 219, 3, 195, 40, 230,
+ 219, 211, 113, 230, 219, 250, 164, 219, 198, 77, 230, 219, 3, 209, 79,
+ 230, 219, 1, 195, 150, 251, 71, 230, 219, 1, 195, 150, 55, 251, 71, 230,
+ 219, 1, 117, 206, 110, 230, 219, 1, 117, 219, 74, 230, 219, 18, 3, 117,
+ 172, 230, 219, 18, 3, 117, 219, 74, 33, 230, 219, 17, 191, 77, 33, 230,
+ 219, 17, 107, 33, 230, 219, 17, 109, 33, 230, 219, 17, 138, 33, 230, 219,
+ 17, 134, 33, 230, 219, 17, 149, 33, 230, 219, 17, 169, 33, 230, 219, 1,
+ 65, 33, 230, 219, 1, 155, 33, 230, 219, 1, 180, 33, 230, 219, 1, 195, 69,
+ 33, 230, 219, 1, 168, 214, 78, 1, 65, 214, 78, 1, 252, 206, 214, 78, 1,
+ 68, 214, 78, 1, 223, 199, 214, 78, 1, 66, 214, 78, 1, 196, 30, 214, 78,
+ 1, 117, 146, 214, 78, 1, 117, 206, 110, 214, 78, 1, 117, 172, 214, 78, 1,
+ 117, 219, 74, 214, 78, 1, 71, 214, 78, 1, 251, 236, 214, 78, 1, 74, 214,
+ 78, 1, 250, 163, 214, 78, 1, 155, 214, 78, 1, 221, 215, 214, 78, 1, 231,
+ 240, 214, 78, 1, 231, 91, 214, 78, 1, 214, 68, 214, 78, 1, 214, 17, 214,
+ 78, 1, 247, 160, 214, 78, 1, 247, 1, 214, 78, 1, 223, 32, 214, 78, 1,
+ 222, 252, 214, 78, 1, 212, 101, 214, 78, 1, 212, 83, 214, 78, 1, 197,
+ 132, 214, 78, 1, 197, 120, 214, 78, 1, 237, 191, 214, 78, 1, 237, 175,
+ 214, 78, 1, 213, 79, 214, 78, 1, 190, 190, 214, 78, 1, 199, 49, 214, 78,
+ 1, 238, 32, 214, 78, 1, 237, 68, 214, 78, 1, 180, 214, 78, 1, 213, 224,
+ 214, 78, 1, 168, 214, 78, 1, 209, 228, 214, 78, 1, 249, 153, 214, 78, 1,
+ 248, 203, 214, 78, 1, 174, 214, 78, 1, 216, 103, 214, 78, 1, 170, 214,
+ 78, 1, 165, 214, 78, 1, 207, 6, 214, 78, 1, 173, 214, 78, 1, 219, 159,
+ 214, 78, 1, 193, 190, 214, 78, 1, 203, 165, 214, 78, 1, 201, 175, 214,
+ 78, 1, 188, 214, 78, 1, 140, 214, 78, 18, 3, 252, 206, 214, 78, 18, 3,
+ 68, 214, 78, 18, 3, 223, 199, 214, 78, 18, 3, 66, 214, 78, 18, 3, 196,
+ 30, 214, 78, 18, 3, 117, 146, 214, 78, 18, 3, 117, 206, 110, 214, 78, 18,
+ 3, 117, 172, 214, 78, 18, 3, 117, 219, 74, 214, 78, 18, 3, 71, 214, 78,
+ 18, 3, 251, 236, 214, 78, 18, 3, 74, 214, 78, 18, 3, 250, 163, 214, 78,
+ 3, 195, 40, 214, 78, 3, 247, 119, 214, 78, 3, 251, 71, 214, 78, 3, 195,
+ 35, 214, 78, 3, 212, 141, 214, 78, 3, 250, 145, 214, 78, 3, 53, 251, 71,
+ 214, 78, 211, 113, 214, 78, 202, 209, 214, 78, 237, 238, 214, 78, 55,
+ 237, 238, 214, 78, 242, 74, 214, 78, 231, 204, 233, 3, 214, 78, 252, 68,
+ 56, 214, 78, 17, 191, 77, 214, 78, 17, 107, 214, 78, 17, 109, 214, 78,
+ 17, 138, 214, 78, 17, 134, 214, 78, 17, 149, 214, 78, 17, 169, 214, 78,
+ 17, 175, 214, 78, 17, 171, 214, 78, 17, 178, 214, 78, 55, 242, 74, 214,
+ 78, 209, 107, 77, 214, 78, 223, 119, 56, 214, 78, 205, 138, 77, 214, 78,
+ 1, 195, 150, 251, 71, 214, 78, 3, 222, 237, 214, 78, 3, 196, 75, 198,
+ 129, 251, 100, 198, 129, 1, 65, 198, 129, 1, 252, 206, 198, 129, 1, 68,
+ 198, 129, 1, 223, 199, 198, 129, 1, 66, 198, 129, 1, 196, 30, 198, 129,
+ 1, 117, 146, 198, 129, 1, 117, 206, 110, 198, 129, 1, 117, 172, 198, 129,
+ 1, 117, 219, 74, 198, 129, 1, 71, 198, 129, 1, 251, 236, 198, 129, 1, 74,
+ 198, 129, 1, 250, 163, 198, 129, 1, 155, 198, 129, 1, 221, 215, 198, 129,
+ 1, 231, 240, 198, 129, 1, 231, 91, 198, 129, 1, 214, 68, 198, 129, 1,
+ 247, 160, 198, 129, 1, 247, 1, 198, 129, 1, 223, 32, 198, 129, 1, 222,
+ 252, 198, 129, 1, 212, 101, 198, 129, 1, 197, 132, 198, 129, 1, 197, 120,
+ 198, 129, 1, 237, 191, 198, 129, 1, 237, 175, 198, 129, 1, 213, 79, 198,
+ 129, 1, 190, 190, 198, 129, 1, 199, 49, 198, 129, 1, 238, 32, 198, 129,
+ 1, 237, 68, 198, 129, 1, 180, 198, 129, 1, 168, 198, 129, 1, 209, 228,
+ 198, 129, 1, 249, 153, 198, 129, 1, 248, 203, 198, 129, 1, 174, 198, 129,
+ 1, 170, 198, 129, 1, 165, 198, 129, 1, 173, 198, 129, 1, 195, 188, 198,
+ 129, 1, 203, 165, 198, 129, 1, 201, 175, 198, 129, 1, 188, 198, 129, 1,
+ 140, 198, 129, 18, 3, 252, 206, 198, 129, 18, 3, 68, 198, 129, 18, 3,
+ 223, 199, 198, 129, 18, 3, 66, 198, 129, 18, 3, 196, 30, 198, 129, 18, 3,
+ 117, 146, 198, 129, 18, 3, 117, 206, 110, 198, 129, 18, 3, 117, 172, 198,
+ 129, 18, 3, 117, 219, 74, 198, 129, 18, 3, 71, 198, 129, 18, 3, 203, 40,
+ 71, 198, 129, 18, 3, 251, 236, 198, 129, 18, 3, 74, 198, 129, 18, 3, 203,
+ 40, 74, 198, 129, 18, 3, 250, 163, 198, 129, 3, 247, 119, 198, 129, 3,
+ 251, 71, 198, 129, 3, 195, 35, 198, 129, 3, 195, 40, 198, 129, 3, 212,
+ 141, 198, 129, 3, 250, 145, 198, 129, 230, 137, 198, 129, 252, 68, 56,
+ 198, 129, 211, 113, 198, 129, 17, 191, 77, 198, 129, 17, 107, 198, 129,
+ 17, 109, 198, 129, 17, 138, 198, 129, 17, 134, 198, 129, 17, 149, 198,
+ 129, 17, 169, 198, 129, 17, 175, 198, 129, 17, 171, 198, 129, 17, 178,
+ 202, 211, 1, 65, 202, 211, 1, 252, 206, 202, 211, 1, 68, 202, 211, 1,
+ 223, 199, 202, 211, 1, 66, 202, 211, 1, 196, 30, 202, 211, 1, 117, 146,
+ 202, 211, 1, 117, 206, 110, 202, 211, 1, 117, 172, 202, 211, 1, 117, 219,
+ 74, 202, 211, 1, 71, 202, 211, 1, 251, 236, 202, 211, 1, 74, 202, 211, 1,
+ 250, 163, 202, 211, 1, 155, 202, 211, 1, 221, 215, 202, 211, 1, 231, 240,
+ 202, 211, 1, 231, 91, 202, 211, 1, 214, 68, 202, 211, 1, 247, 160, 202,
+ 211, 1, 247, 1, 202, 211, 1, 223, 32, 202, 211, 1, 222, 252, 202, 211, 1,
+ 212, 101, 202, 211, 1, 197, 132, 202, 211, 1, 197, 120, 202, 211, 1, 237,
+ 191, 202, 211, 1, 237, 175, 202, 211, 1, 213, 79, 202, 211, 1, 190, 190,
+ 202, 211, 1, 199, 49, 202, 211, 1, 238, 32, 202, 211, 1, 237, 68, 202,
+ 211, 1, 180, 202, 211, 1, 168, 202, 211, 1, 209, 228, 202, 211, 1, 249,
+ 153, 202, 211, 1, 248, 203, 202, 211, 1, 174, 202, 211, 1, 170, 202, 211,
+ 1, 165, 202, 211, 1, 173, 202, 211, 1, 195, 188, 202, 211, 1, 203, 165,
+ 202, 211, 1, 201, 175, 202, 211, 1, 188, 202, 211, 1, 140, 202, 211, 18,
+ 3, 252, 206, 202, 211, 18, 3, 68, 202, 211, 18, 3, 223, 199, 202, 211,
+ 18, 3, 66, 202, 211, 18, 3, 196, 30, 202, 211, 18, 3, 117, 146, 202, 211,
+ 18, 3, 117, 206, 110, 202, 211, 18, 3, 71, 202, 211, 18, 3, 251, 236,
+ 202, 211, 18, 3, 74, 202, 211, 18, 3, 250, 163, 202, 211, 3, 247, 119,
+ 202, 211, 3, 251, 71, 202, 211, 3, 195, 35, 202, 211, 3, 195, 40, 202,
+ 211, 3, 212, 141, 202, 211, 3, 202, 210, 202, 211, 237, 238, 202, 211,
+ 55, 237, 238, 202, 211, 204, 11, 236, 140, 202, 211, 204, 11, 164, 202,
+ 211, 207, 46, 217, 55, 202, 211, 207, 46, 217, 54, 202, 211, 207, 46,
+ 217, 53, 202, 211, 234, 95, 79, 199, 54, 77, 202, 211, 205, 54, 87, 4,
+ 197, 236, 23, 196, 221, 211, 41, 202, 211, 205, 54, 87, 4, 197, 236, 23,
+ 235, 138, 238, 226, 202, 211, 205, 54, 87, 4, 207, 120, 23, 235, 138,
+ 238, 226, 202, 211, 205, 54, 87, 4, 207, 120, 23, 235, 138, 55, 238, 226,
+ 202, 211, 205, 54, 87, 4, 207, 120, 23, 235, 138, 197, 225, 238, 226,
+ 202, 211, 205, 54, 87, 55, 206, 188, 202, 211, 205, 54, 87, 55, 206, 189,
+ 4, 207, 119, 202, 211, 205, 54, 87, 4, 55, 238, 226, 202, 211, 205, 54,
+ 87, 4, 197, 225, 238, 226, 202, 211, 205, 54, 87, 4, 208, 26, 238, 226,
+ 202, 211, 205, 54, 87, 4, 204, 8, 238, 226, 202, 211, 205, 54, 87, 4,
+ 243, 8, 23, 207, 119, 202, 211, 205, 54, 87, 4, 243, 8, 23, 105, 234, 97,
+ 202, 211, 205, 54, 87, 4, 243, 8, 23, 232, 128, 234, 97, 202, 211, 1,
+ 198, 226, 251, 157, 68, 202, 211, 1, 197, 15, 251, 157, 68, 202, 211, 1,
+ 197, 15, 251, 157, 223, 199, 202, 211, 1, 251, 157, 66, 202, 211, 18, 3,
+ 251, 157, 66, 202, 211, 18, 3, 251, 157, 196, 30, 215, 253, 1, 65, 215,
+ 253, 1, 252, 206, 215, 253, 1, 68, 215, 253, 1, 223, 199, 215, 253, 1,
+ 66, 215, 253, 1, 196, 30, 215, 253, 1, 117, 146, 215, 253, 1, 117, 206,
+ 110, 215, 253, 1, 117, 172, 215, 253, 1, 117, 219, 74, 215, 253, 1, 71,
+ 215, 253, 1, 251, 236, 215, 253, 1, 74, 215, 253, 1, 250, 163, 215, 253,
+ 1, 155, 215, 253, 1, 221, 215, 215, 253, 1, 231, 240, 215, 253, 1, 231,
+ 91, 215, 253, 1, 214, 68, 215, 253, 1, 247, 160, 215, 253, 1, 247, 1,
+ 215, 253, 1, 223, 32, 215, 253, 1, 222, 252, 215, 253, 1, 212, 101, 215,
+ 253, 1, 197, 132, 215, 253, 1, 197, 120, 215, 253, 1, 237, 191, 215, 253,
+ 1, 237, 175, 215, 253, 1, 213, 79, 215, 253, 1, 190, 190, 215, 253, 1,
+ 199, 49, 215, 253, 1, 238, 32, 215, 253, 1, 237, 68, 215, 253, 1, 180,
+ 215, 253, 1, 168, 215, 253, 1, 209, 228, 215, 253, 1, 249, 153, 215, 253,
+ 1, 248, 203, 215, 253, 1, 174, 215, 253, 1, 170, 215, 253, 1, 165, 215,
+ 253, 1, 173, 215, 253, 1, 195, 188, 215, 253, 1, 203, 165, 215, 253, 1,
+ 201, 175, 215, 253, 1, 188, 215, 253, 1, 140, 215, 253, 1, 219, 73, 215,
+ 253, 18, 3, 252, 206, 215, 253, 18, 3, 68, 215, 253, 18, 3, 223, 199,
+ 215, 253, 18, 3, 66, 215, 253, 18, 3, 196, 30, 215, 253, 18, 3, 117, 146,
+ 215, 253, 18, 3, 117, 206, 110, 215, 253, 18, 3, 117, 172, 215, 253, 18,
+ 3, 117, 219, 74, 215, 253, 18, 3, 71, 215, 253, 18, 3, 251, 236, 215,
+ 253, 18, 3, 74, 215, 253, 18, 3, 250, 163, 215, 253, 3, 251, 71, 215,
+ 253, 3, 195, 35, 215, 253, 3, 195, 40, 215, 253, 3, 251, 11, 215, 253,
+ 237, 238, 215, 253, 55, 237, 238, 215, 253, 252, 68, 56, 215, 253, 3,
+ 228, 127, 215, 253, 17, 191, 77, 215, 253, 17, 107, 215, 253, 17, 109,
+ 215, 253, 17, 138, 215, 253, 17, 134, 215, 253, 17, 149, 215, 253, 17,
+ 169, 215, 253, 17, 175, 215, 253, 17, 171, 215, 253, 17, 178, 104, 248,
+ 159, 4, 211, 42, 104, 206, 122, 248, 158, 104, 55, 248, 159, 4, 211, 42,
+ 104, 197, 225, 248, 159, 4, 211, 42, 104, 248, 159, 4, 55, 211, 42, 104,
+ 206, 122, 248, 159, 4, 211, 42, 104, 206, 122, 248, 159, 4, 55, 211, 42,
+ 104, 223, 93, 248, 158, 104, 223, 93, 248, 159, 4, 55, 211, 42, 104, 200,
+ 134, 248, 158, 104, 200, 134, 248, 159, 4, 211, 42, 104, 200, 134, 248,
+ 159, 4, 55, 211, 42, 104, 153, 200, 134, 248, 159, 4, 55, 211, 42, 199,
+ 205, 1, 65, 199, 205, 1, 252, 206, 199, 205, 1, 68, 199, 205, 1, 223,
+ 199, 199, 205, 1, 66, 199, 205, 1, 196, 30, 199, 205, 1, 71, 199, 205, 1,
+ 251, 236, 199, 205, 1, 74, 199, 205, 1, 250, 163, 199, 205, 1, 155, 199,
+ 205, 1, 221, 215, 199, 205, 1, 231, 240, 199, 205, 1, 231, 91, 199, 205,
+ 1, 214, 68, 199, 205, 1, 247, 160, 199, 205, 1, 247, 1, 199, 205, 1, 223,
+ 32, 199, 205, 1, 222, 252, 199, 205, 1, 212, 101, 199, 205, 1, 197, 132,
+ 199, 205, 1, 197, 120, 199, 205, 1, 237, 191, 199, 205, 1, 237, 175, 199,
+ 205, 1, 213, 79, 199, 205, 1, 190, 190, 199, 205, 1, 199, 49, 199, 205,
+ 1, 238, 32, 199, 205, 1, 237, 68, 199, 205, 1, 180, 199, 205, 1, 168,
+ 199, 205, 1, 209, 228, 199, 205, 1, 249, 153, 199, 205, 1, 248, 203, 199,
+ 205, 1, 174, 199, 205, 1, 170, 199, 205, 1, 165, 199, 205, 1, 173, 199,
+ 205, 1, 195, 188, 199, 205, 1, 203, 165, 199, 205, 1, 188, 199, 205, 1,
+ 140, 199, 205, 1, 206, 109, 199, 205, 3, 251, 71, 199, 205, 3, 195, 35,
+ 199, 205, 18, 3, 252, 206, 199, 205, 18, 3, 68, 199, 205, 18, 3, 223,
+ 199, 199, 205, 18, 3, 66, 199, 205, 18, 3, 196, 30, 199, 205, 18, 3, 71,
+ 199, 205, 18, 3, 251, 236, 199, 205, 18, 3, 74, 199, 205, 18, 3, 250,
+ 163, 199, 205, 3, 195, 40, 199, 205, 3, 212, 141, 199, 205, 1, 251, 14,
+ 221, 215, 199, 205, 252, 68, 56, 199, 205, 17, 191, 77, 199, 205, 17,
+ 107, 199, 205, 17, 109, 199, 205, 17, 138, 199, 205, 17, 134, 199, 205,
+ 17, 149, 199, 205, 17, 169, 199, 205, 17, 175, 199, 205, 17, 171, 199,
+ 205, 17, 178, 251, 240, 1, 155, 251, 240, 1, 221, 215, 251, 240, 1, 214,
+ 68, 251, 240, 1, 180, 251, 240, 1, 190, 190, 251, 240, 1, 251, 157, 190,
+ 190, 251, 240, 1, 168, 251, 240, 1, 209, 228, 251, 240, 1, 249, 153, 251,
+ 240, 1, 174, 251, 240, 1, 223, 32, 251, 240, 1, 247, 1, 251, 240, 1, 199,
+ 49, 251, 240, 1, 165, 251, 240, 1, 173, 251, 240, 1, 188, 251, 240, 1,
+ 212, 101, 251, 240, 1, 140, 251, 240, 1, 65, 251, 240, 1, 238, 32, 251,
+ 240, 1, 237, 68, 251, 240, 1, 231, 240, 251, 240, 1, 251, 157, 231, 240,
+ 251, 240, 1, 231, 91, 251, 240, 1, 248, 203, 251, 240, 1, 222, 252, 251,
+ 240, 1, 251, 157, 249, 153, 251, 240, 120, 3, 216, 217, 173, 251, 240,
+ 120, 3, 216, 217, 165, 251, 240, 120, 3, 216, 217, 219, 133, 165, 251,
+ 240, 18, 3, 65, 251, 240, 18, 3, 252, 206, 251, 240, 18, 3, 68, 251, 240,
+ 18, 3, 223, 199, 251, 240, 18, 3, 66, 251, 240, 18, 3, 196, 30, 251, 240,
+ 18, 3, 71, 251, 240, 18, 3, 250, 140, 251, 240, 18, 3, 74, 251, 240, 18,
+ 3, 251, 236, 251, 240, 18, 3, 251, 149, 251, 240, 3, 221, 143, 251, 240,
+ 17, 191, 77, 251, 240, 17, 107, 251, 240, 17, 109, 251, 240, 17, 138,
+ 251, 240, 17, 134, 251, 240, 17, 149, 251, 240, 17, 169, 251, 240, 17,
+ 175, 251, 240, 17, 171, 251, 240, 17, 178, 251, 240, 31, 199, 95, 251,
+ 240, 31, 197, 32, 251, 240, 3, 2, 205, 53, 251, 240, 3, 205, 53, 251,
+ 240, 3, 206, 53, 251, 240, 16, 195, 69, 251, 240, 1, 247, 160, 251, 240,
+ 1, 197, 132, 251, 240, 1, 197, 120, 251, 240, 1, 237, 191, 251, 240, 1,
+ 237, 175, 251, 240, 1, 213, 79, 251, 240, 1, 219, 73, 236, 161, 1, 65,
+ 236, 161, 1, 252, 206, 236, 161, 1, 68, 236, 161, 1, 223, 199, 236, 161,
+ 1, 66, 236, 161, 1, 196, 30, 236, 161, 1, 71, 236, 161, 1, 251, 236, 236,
+ 161, 1, 74, 236, 161, 1, 250, 163, 236, 161, 1, 155, 236, 161, 1, 221,
+ 215, 236, 161, 1, 231, 240, 236, 161, 1, 231, 91, 236, 161, 1, 214, 68,
+ 236, 161, 1, 247, 160, 236, 161, 1, 247, 1, 236, 161, 1, 223, 32, 236,
+ 161, 1, 222, 252, 236, 161, 1, 212, 101, 236, 161, 1, 197, 132, 236, 161,
+ 1, 197, 120, 236, 161, 1, 237, 191, 236, 161, 1, 237, 175, 236, 161, 1,
+ 213, 79, 236, 161, 1, 190, 190, 236, 161, 1, 199, 49, 236, 161, 1, 238,
+ 32, 236, 161, 1, 237, 68, 236, 161, 1, 180, 236, 161, 1, 168, 236, 161,
+ 1, 209, 228, 236, 161, 1, 249, 153, 236, 161, 1, 248, 203, 236, 161, 1,
+ 174, 236, 161, 1, 170, 236, 161, 1, 165, 236, 161, 1, 173, 236, 161, 1,
+ 195, 188, 236, 161, 1, 203, 165, 236, 161, 1, 201, 175, 236, 161, 1, 188,
+ 236, 161, 1, 140, 236, 161, 1, 206, 109, 236, 161, 18, 3, 252, 206, 236,
+ 161, 18, 3, 68, 236, 161, 18, 3, 223, 199, 236, 161, 18, 3, 66, 236, 161,
+ 18, 3, 196, 30, 236, 161, 18, 3, 117, 146, 236, 161, 18, 3, 117, 206,
+ 110, 236, 161, 18, 3, 71, 236, 161, 18, 3, 251, 236, 236, 161, 18, 3, 74,
+ 236, 161, 18, 3, 250, 163, 236, 161, 3, 251, 71, 236, 161, 3, 195, 35,
+ 236, 161, 3, 195, 40, 236, 161, 3, 212, 141, 236, 161, 252, 68, 56, 193,
+ 156, 242, 253, 6, 1, 214, 67, 193, 156, 242, 253, 6, 1, 65, 193, 156,
+ 242, 253, 6, 1, 193, 86, 193, 156, 242, 253, 6, 1, 191, 225, 193, 156,
+ 242, 253, 6, 1, 170, 193, 156, 242, 253, 6, 1, 192, 12, 193, 156, 242,
+ 253, 6, 1, 223, 199, 193, 156, 242, 253, 6, 1, 196, 30, 193, 156, 242,
+ 253, 6, 1, 71, 193, 156, 242, 253, 6, 1, 74, 193, 156, 242, 253, 6, 1,
+ 251, 122, 193, 156, 242, 253, 6, 1, 231, 240, 193, 156, 242, 253, 6, 1,
+ 221, 67, 193, 156, 242, 253, 6, 1, 234, 66, 193, 156, 242, 253, 6, 1,
+ 191, 204, 193, 156, 242, 253, 6, 1, 196, 160, 193, 156, 242, 253, 6, 1,
+ 234, 85, 193, 156, 242, 253, 6, 1, 211, 154, 193, 156, 242, 253, 6, 1,
+ 197, 127, 193, 156, 242, 253, 6, 1, 212, 127, 193, 156, 242, 253, 6, 1,
+ 238, 32, 193, 156, 242, 253, 6, 1, 250, 182, 193, 156, 242, 253, 6, 1,
+ 251, 149, 193, 156, 242, 253, 6, 1, 248, 10, 193, 156, 242, 253, 6, 1,
+ 208, 165, 193, 156, 242, 253, 6, 1, 229, 115, 193, 156, 242, 253, 6, 1,
+ 229, 3, 193, 156, 242, 253, 6, 1, 228, 185, 193, 156, 242, 253, 6, 1,
+ 230, 19, 193, 156, 242, 253, 6, 1, 201, 126, 193, 156, 242, 253, 6, 1,
+ 202, 193, 193, 156, 242, 253, 6, 1, 195, 25, 193, 156, 242, 253, 2, 1,
+ 214, 67, 193, 156, 242, 253, 2, 1, 65, 193, 156, 242, 253, 2, 1, 193, 86,
+ 193, 156, 242, 253, 2, 1, 191, 225, 193, 156, 242, 253, 2, 1, 170, 193,
+ 156, 242, 253, 2, 1, 192, 12, 193, 156, 242, 253, 2, 1, 223, 199, 193,
+ 156, 242, 253, 2, 1, 196, 30, 193, 156, 242, 253, 2, 1, 71, 193, 156,
+ 242, 253, 2, 1, 74, 193, 156, 242, 253, 2, 1, 251, 122, 193, 156, 242,
+ 253, 2, 1, 231, 240, 193, 156, 242, 253, 2, 1, 221, 67, 193, 156, 242,
+ 253, 2, 1, 234, 66, 193, 156, 242, 253, 2, 1, 191, 204, 193, 156, 242,
+ 253, 2, 1, 196, 160, 193, 156, 242, 253, 2, 1, 234, 85, 193, 156, 242,
+ 253, 2, 1, 211, 154, 193, 156, 242, 253, 2, 1, 197, 127, 193, 156, 242,
+ 253, 2, 1, 212, 127, 193, 156, 242, 253, 2, 1, 238, 32, 193, 156, 242,
+ 253, 2, 1, 250, 182, 193, 156, 242, 253, 2, 1, 251, 149, 193, 156, 242,
+ 253, 2, 1, 248, 10, 193, 156, 242, 253, 2, 1, 208, 165, 193, 156, 242,
+ 253, 2, 1, 229, 115, 193, 156, 242, 253, 2, 1, 229, 3, 193, 156, 242,
+ 253, 2, 1, 228, 185, 193, 156, 242, 253, 2, 1, 230, 19, 193, 156, 242,
+ 253, 2, 1, 201, 126, 193, 156, 242, 253, 2, 1, 202, 193, 193, 156, 242,
+ 253, 2, 1, 195, 25, 193, 156, 242, 253, 17, 191, 77, 193, 156, 242, 253,
+ 17, 107, 193, 156, 242, 253, 17, 109, 193, 156, 242, 253, 17, 138, 193,
+ 156, 242, 253, 17, 134, 193, 156, 242, 253, 17, 149, 193, 156, 242, 253,
+ 17, 169, 193, 156, 242, 253, 17, 175, 193, 156, 242, 253, 17, 171, 193,
+ 156, 242, 253, 17, 178, 193, 156, 242, 253, 31, 199, 95, 193, 156, 242,
+ 253, 31, 197, 32, 193, 156, 242, 253, 31, 198, 249, 193, 156, 242, 253,
+ 31, 232, 135, 193, 156, 242, 253, 31, 233, 15, 193, 156, 242, 253, 31,
+ 202, 120, 193, 156, 242, 253, 31, 203, 241, 193, 156, 242, 253, 31, 234,
+ 153, 193, 156, 242, 253, 31, 213, 169, 193, 156, 242, 253, 211, 113, 236,
+ 209, 251, 209, 1, 65, 236, 209, 251, 209, 1, 252, 206, 236, 209, 251,
+ 209, 1, 68, 236, 209, 251, 209, 1, 223, 199, 236, 209, 251, 209, 1, 66,
+ 236, 209, 251, 209, 1, 196, 30, 236, 209, 251, 209, 1, 71, 236, 209, 251,
+ 209, 1, 74, 236, 209, 251, 209, 1, 155, 236, 209, 251, 209, 1, 221, 215,
+ 236, 209, 251, 209, 1, 231, 240, 236, 209, 251, 209, 1, 231, 91, 236,
+ 209, 251, 209, 1, 214, 68, 236, 209, 251, 209, 1, 247, 160, 236, 209,
+ 251, 209, 1, 247, 1, 236, 209, 251, 209, 1, 223, 32, 236, 209, 251, 209,
+ 1, 212, 101, 236, 209, 251, 209, 1, 197, 132, 236, 209, 251, 209, 1, 237,
+ 191, 236, 209, 251, 209, 1, 237, 175, 236, 209, 251, 209, 1, 213, 79,
+ 236, 209, 251, 209, 1, 190, 190, 236, 209, 251, 209, 1, 199, 49, 236,
+ 209, 251, 209, 1, 238, 32, 236, 209, 251, 209, 1, 237, 68, 236, 209, 251,
+ 209, 1, 180, 236, 209, 251, 209, 1, 168, 236, 209, 251, 209, 1, 209, 228,
+ 236, 209, 251, 209, 1, 249, 153, 236, 209, 251, 209, 1, 248, 203, 236,
+ 209, 251, 209, 1, 174, 236, 209, 251, 209, 1, 170, 236, 209, 251, 209, 1,
+ 191, 175, 236, 209, 251, 209, 1, 165, 236, 209, 251, 209, 1, 173, 236,
+ 209, 251, 209, 1, 195, 188, 236, 209, 251, 209, 1, 203, 165, 236, 209,
+ 251, 209, 1, 201, 175, 236, 209, 251, 209, 1, 188, 236, 209, 251, 209, 1,
+ 140, 236, 209, 251, 209, 1, 219, 73, 236, 209, 251, 209, 1, 191, 123,
+ 236, 209, 251, 209, 18, 3, 252, 206, 236, 209, 251, 209, 18, 3, 68, 236,
+ 209, 251, 209, 18, 3, 223, 199, 236, 209, 251, 209, 18, 3, 66, 236, 209,
+ 251, 209, 18, 3, 196, 30, 236, 209, 251, 209, 18, 3, 71, 236, 209, 251,
+ 209, 18, 3, 251, 236, 236, 209, 251, 209, 18, 3, 74, 236, 209, 251, 209,
+ 3, 251, 71, 236, 209, 251, 209, 3, 247, 119, 236, 209, 251, 209, 3, 230,
+ 72, 236, 209, 251, 209, 195, 40, 236, 209, 251, 209, 208, 227, 214, 214,
+ 56, 236, 209, 251, 209, 216, 217, 170, 236, 209, 251, 209, 89, 165, 236,
+ 209, 251, 209, 216, 217, 165, 236, 209, 251, 209, 3, 212, 141, 236, 209,
+ 251, 209, 55, 237, 238, 236, 209, 251, 209, 231, 204, 233, 3, 236, 209,
+ 251, 209, 234, 95, 79, 199, 54, 77, 236, 209, 251, 209, 17, 191, 77, 236,
+ 209, 251, 209, 17, 107, 236, 209, 251, 209, 17, 109, 236, 209, 251, 209,
+ 17, 138, 236, 209, 251, 209, 17, 134, 236, 209, 251, 209, 17, 149, 236,
+ 209, 251, 209, 17, 169, 236, 209, 251, 209, 17, 175, 236, 209, 251, 209,
+ 17, 171, 236, 209, 251, 209, 17, 178, 214, 223, 1, 65, 214, 223, 1, 252,
+ 206, 214, 223, 1, 68, 214, 223, 1, 223, 199, 214, 223, 1, 66, 214, 223,
+ 1, 196, 30, 214, 223, 1, 117, 146, 214, 223, 1, 117, 206, 110, 214, 223,
+ 1, 71, 214, 223, 1, 251, 236, 214, 223, 1, 74, 214, 223, 1, 250, 163,
+ 214, 223, 1, 155, 214, 223, 1, 221, 215, 214, 223, 1, 231, 240, 214, 223,
+ 1, 231, 91, 214, 223, 1, 214, 68, 214, 223, 1, 247, 160, 214, 223, 1,
+ 247, 1, 214, 223, 1, 223, 32, 214, 223, 1, 222, 252, 214, 223, 1, 212,
+ 101, 214, 223, 1, 197, 132, 214, 223, 1, 197, 120, 214, 223, 1, 237, 191,
+ 214, 223, 1, 237, 175, 214, 223, 1, 213, 79, 214, 223, 1, 190, 190, 214,
+ 223, 1, 199, 49, 214, 223, 1, 238, 32, 214, 223, 1, 237, 68, 214, 223, 1,
+ 180, 214, 223, 1, 168, 214, 223, 1, 209, 228, 214, 223, 1, 249, 153, 214,
+ 223, 1, 248, 203, 214, 223, 1, 174, 214, 223, 1, 170, 214, 223, 1, 165,
+ 214, 223, 1, 173, 214, 223, 1, 195, 188, 214, 223, 1, 203, 165, 214, 223,
+ 1, 201, 175, 214, 223, 1, 188, 214, 223, 1, 140, 214, 223, 1, 219, 73,
+ 214, 223, 1, 206, 109, 214, 223, 18, 3, 252, 206, 214, 223, 18, 3, 68,
+ 214, 223, 18, 3, 223, 199, 214, 223, 18, 3, 66, 214, 223, 18, 3, 196, 30,
+ 214, 223, 18, 3, 117, 146, 214, 223, 18, 3, 117, 206, 110, 214, 223, 18,
+ 3, 71, 214, 223, 18, 3, 251, 236, 214, 223, 18, 3, 74, 214, 223, 18, 3,
+ 250, 163, 214, 223, 3, 251, 71, 214, 223, 3, 195, 35, 214, 223, 3, 195,
+ 40, 214, 223, 3, 250, 145, 214, 223, 3, 202, 210, 214, 223, 229, 227,
+ 214, 223, 18, 3, 208, 207, 71, 191, 106, 51, 1, 65, 191, 106, 51, 18, 3,
+ 68, 191, 106, 51, 18, 3, 196, 152, 191, 106, 51, 18, 3, 66, 191, 106, 51,
+ 18, 3, 71, 191, 106, 51, 18, 3, 211, 151, 191, 106, 51, 18, 3, 74, 191,
+ 106, 51, 18, 3, 251, 236, 191, 106, 51, 18, 3, 250, 163, 191, 106, 51,
+ 18, 3, 207, 18, 68, 191, 106, 51, 18, 219, 198, 77, 191, 106, 51, 1, 155,
+ 191, 106, 51, 1, 221, 215, 191, 106, 51, 1, 231, 240, 191, 106, 51, 1,
+ 231, 91, 191, 106, 51, 1, 214, 68, 191, 106, 51, 1, 247, 160, 191, 106,
+ 51, 1, 247, 1, 191, 106, 51, 1, 223, 32, 191, 106, 51, 1, 212, 101, 191,
+ 106, 51, 1, 197, 132, 191, 106, 51, 1, 197, 120, 191, 106, 51, 1, 237,
+ 191, 191, 106, 51, 1, 237, 175, 191, 106, 51, 1, 213, 79, 191, 106, 51,
+ 1, 190, 190, 191, 106, 51, 1, 199, 49, 191, 106, 51, 1, 238, 32, 191,
+ 106, 51, 1, 237, 68, 191, 106, 51, 1, 180, 191, 106, 51, 1, 168, 191,
+ 106, 51, 1, 209, 228, 191, 106, 51, 1, 249, 153, 191, 106, 51, 1, 248,
+ 203, 191, 106, 51, 1, 174, 191, 106, 51, 1, 197, 168, 191, 106, 51, 1,
+ 197, 157, 191, 106, 51, 1, 235, 35, 191, 106, 51, 1, 235, 29, 191, 106,
+ 51, 1, 191, 71, 191, 106, 51, 1, 191, 123, 191, 106, 51, 1, 255, 214,
+ 191, 106, 51, 1, 170, 191, 106, 51, 1, 165, 191, 106, 51, 1, 173, 191,
+ 106, 51, 1, 195, 188, 191, 106, 51, 1, 203, 165, 191, 106, 51, 1, 201,
+ 175, 191, 106, 51, 1, 188, 191, 106, 51, 1, 140, 191, 106, 51, 1, 220,
+ 246, 191, 106, 51, 53, 120, 77, 191, 106, 51, 3, 195, 40, 191, 106, 51,
+ 3, 247, 119, 191, 106, 51, 3, 247, 120, 4, 211, 42, 191, 106, 51, 3, 247,
+ 122, 4, 211, 42, 191, 106, 51, 3, 251, 71, 191, 106, 51, 3, 195, 35, 191,
+ 106, 51, 242, 201, 1, 165, 191, 106, 51, 242, 202, 1, 170, 191, 106, 51,
+ 242, 202, 1, 165, 191, 106, 51, 242, 202, 1, 173, 191, 106, 51, 242, 202,
+ 1, 195, 188, 191, 106, 51, 89, 229, 236, 77, 191, 106, 51, 242, 215, 229,
+ 236, 77, 191, 106, 51, 87, 197, 152, 191, 106, 51, 87, 203, 157, 191,
+ 106, 51, 87, 55, 203, 157, 191, 106, 51, 87, 179, 197, 152, 191, 106, 51,
+ 89, 235, 130, 229, 236, 77, 191, 106, 51, 242, 215, 235, 130, 229, 236,
+ 77, 191, 106, 51, 200, 238, 201, 251, 1, 65, 201, 251, 18, 3, 68, 201,
+ 251, 18, 3, 196, 152, 201, 251, 18, 3, 66, 201, 251, 18, 3, 71, 201, 251,
+ 18, 3, 74, 201, 251, 18, 3, 211, 151, 201, 251, 18, 3, 251, 236, 201,
+ 251, 18, 3, 250, 163, 201, 251, 18, 3, 117, 146, 201, 251, 18, 3, 117,
+ 172, 201, 251, 18, 219, 198, 77, 201, 251, 1, 155, 201, 251, 1, 221, 215,
+ 201, 251, 1, 231, 240, 201, 251, 1, 231, 91, 201, 251, 1, 214, 68, 201,
+ 251, 1, 247, 160, 201, 251, 1, 247, 1, 201, 251, 1, 223, 32, 201, 251, 1,
+ 222, 252, 201, 251, 1, 212, 101, 201, 251, 1, 197, 132, 201, 251, 1, 197,
+ 120, 201, 251, 1, 237, 191, 201, 251, 1, 237, 175, 201, 251, 1, 213, 79,
+ 201, 251, 1, 190, 190, 201, 251, 1, 199, 49, 201, 251, 1, 238, 32, 201,
+ 251, 1, 237, 68, 201, 251, 1, 180, 201, 251, 1, 168, 201, 251, 1, 209,
+ 228, 201, 251, 1, 249, 153, 201, 251, 1, 248, 203, 201, 251, 1, 174, 201,
+ 251, 1, 197, 168, 201, 251, 1, 197, 157, 201, 251, 1, 235, 35, 201, 251,
+ 1, 191, 71, 201, 251, 1, 191, 123, 201, 251, 1, 255, 214, 201, 251, 1,
+ 170, 201, 251, 1, 165, 201, 251, 1, 173, 201, 251, 1, 195, 188, 201, 251,
+ 1, 203, 165, 201, 251, 1, 201, 175, 201, 251, 1, 188, 201, 251, 1, 140,
+ 201, 251, 1, 220, 246, 201, 251, 3, 222, 237, 201, 251, 3, 196, 75, 201,
+ 251, 242, 201, 1, 165, 201, 251, 242, 201, 1, 173, 201, 251, 242, 201, 1,
+ 203, 165, 201, 251, 242, 201, 1, 188, 201, 251, 53, 120, 3, 232, 51, 201,
+ 251, 53, 120, 3, 222, 152, 201, 251, 53, 120, 3, 214, 70, 201, 251, 53,
+ 120, 3, 238, 127, 201, 251, 53, 120, 3, 215, 61, 201, 251, 53, 120, 3,
+ 250, 120, 201, 251, 53, 120, 3, 218, 168, 201, 251, 53, 120, 3, 146, 201,
+ 251, 53, 120, 3, 172, 201, 251, 53, 120, 3, 203, 167, 201, 251, 53, 120,
+ 3, 206, 8, 201, 251, 53, 120, 3, 255, 214, 201, 251, 3, 251, 71, 201,
+ 251, 3, 195, 35, 201, 251, 231, 153, 77, 201, 251, 200, 238, 201, 251,
+ 87, 197, 152, 201, 251, 87, 203, 157, 201, 251, 87, 55, 203, 157, 201,
+ 251, 87, 209, 79, 201, 251, 229, 236, 87, 4, 215, 206, 23, 200, 199, 23,
+ 197, 225, 232, 210, 201, 251, 229, 236, 87, 4, 215, 206, 23, 200, 199,
+ 23, 232, 210, 201, 251, 229, 236, 87, 4, 215, 206, 23, 200, 198, 201,
+ 251, 199, 81, 217, 55, 201, 251, 199, 81, 217, 54, 21, 22, 214, 207, 229,
+ 158, 21, 22, 214, 207, 229, 130, 21, 22, 214, 207, 229, 23, 21, 22, 214,
+ 207, 228, 252, 21, 22, 214, 207, 140, 21, 22, 214, 207, 230, 91, 21, 22,
+ 214, 207, 203, 15, 21, 22, 214, 207, 203, 14, 21, 22, 214, 207, 203, 11,
+ 21, 22, 214, 207, 203, 10, 21, 22, 214, 207, 203, 17, 21, 22, 214, 207,
+ 203, 16, 21, 22, 201, 237, 21, 22, 201, 224, 21, 22, 201, 207, 21, 22,
+ 201, 249, 210, 81, 243, 15, 230, 3, 1, 168, 210, 81, 243, 15, 230, 3, 1,
+ 155, 210, 81, 243, 15, 230, 3, 1, 173, 210, 81, 243, 15, 230, 3, 1, 174,
+ 210, 81, 243, 15, 230, 3, 1, 238, 32, 210, 81, 243, 15, 230, 3, 1, 191,
+ 123, 210, 81, 243, 15, 230, 3, 1, 195, 188, 210, 81, 243, 15, 230, 3, 1,
+ 214, 68, 210, 81, 243, 15, 230, 3, 1, 140, 210, 81, 243, 15, 230, 3, 1,
+ 231, 240, 210, 81, 243, 15, 230, 3, 1, 221, 215, 210, 81, 243, 15, 230,
+ 3, 1, 188, 210, 81, 243, 15, 230, 3, 1, 249, 153, 210, 81, 243, 15, 230,
+ 3, 1, 247, 160, 210, 81, 243, 15, 230, 3, 1, 190, 190, 210, 81, 243, 15,
+ 230, 3, 1, 199, 49, 210, 81, 243, 15, 230, 3, 1, 180, 210, 81, 243, 15,
+ 230, 3, 1, 209, 228, 210, 81, 243, 15, 230, 3, 1, 165, 210, 81, 243, 15,
+ 230, 3, 1, 233, 109, 210, 81, 243, 15, 230, 3, 1, 247, 1, 210, 81, 243,
+ 15, 230, 3, 1, 65, 210, 81, 243, 15, 230, 3, 1, 71, 210, 81, 243, 15,
+ 230, 3, 1, 68, 210, 81, 243, 15, 230, 3, 1, 74, 210, 81, 243, 15, 230, 3,
+ 1, 66, 210, 81, 243, 15, 230, 3, 1, 196, 168, 210, 81, 243, 15, 230, 3,
+ 1, 228, 35, 210, 81, 243, 15, 230, 3, 1, 53, 210, 236, 210, 81, 243, 15,
+ 230, 3, 1, 53, 222, 152, 210, 81, 243, 15, 230, 3, 1, 53, 200, 43, 210,
+ 81, 243, 15, 230, 3, 1, 53, 218, 168, 210, 81, 243, 15, 230, 3, 1, 53,
+ 215, 61, 210, 81, 243, 15, 230, 3, 1, 53, 172, 210, 81, 243, 15, 230, 3,
+ 1, 53, 193, 224, 210, 81, 243, 15, 230, 3, 1, 53, 214, 70, 210, 81, 243,
+ 15, 230, 3, 1, 53, 192, 159, 210, 81, 243, 15, 230, 3, 206, 180, 163,
+ 219, 19, 210, 81, 243, 15, 230, 3, 206, 180, 198, 79, 210, 81, 243, 15,
+ 230, 3, 205, 138, 231, 11, 201, 63, 210, 81, 243, 15, 230, 3, 206, 180,
+ 163, 179, 232, 255, 210, 81, 243, 15, 230, 3, 206, 180, 163, 232, 255,
+ 210, 81, 243, 15, 230, 3, 205, 138, 231, 11, 201, 64, 232, 255, 210, 81,
+ 243, 15, 230, 3, 205, 138, 163, 219, 19, 210, 81, 243, 15, 230, 3, 205,
+ 138, 198, 79, 210, 81, 243, 15, 230, 3, 205, 138, 163, 179, 232, 255,
+ 210, 81, 243, 15, 230, 3, 205, 138, 163, 232, 255, 210, 81, 243, 15, 230,
+ 3, 216, 85, 198, 79, 210, 81, 243, 15, 230, 3, 231, 11, 201, 64, 195,
+ 167, 210, 81, 243, 15, 230, 3, 216, 85, 163, 179, 232, 255, 210, 81, 243,
+ 15, 230, 3, 216, 85, 163, 232, 255, 210, 81, 243, 15, 230, 3, 218, 239,
+ 163, 219, 19, 210, 81, 243, 15, 230, 3, 218, 239, 198, 79, 210, 81, 243,
+ 15, 230, 3, 231, 11, 201, 63, 210, 81, 243, 15, 230, 3, 218, 239, 163,
+ 179, 232, 255, 210, 81, 243, 15, 230, 3, 218, 239, 163, 232, 255, 210,
+ 81, 243, 15, 230, 3, 231, 11, 201, 64, 232, 255, 100, 229, 236, 77, 100,
+ 229, 236, 87, 4, 229, 227, 100, 3, 248, 199, 100, 3, 248, 200, 4, 102,
+ 100, 3, 233, 205, 248, 199, 100, 3, 233, 205, 248, 200, 4, 102, 100, 3,
+ 193, 102, 232, 225, 248, 199, 100, 3, 193, 102, 213, 174, 248, 199, 100,
+ 3, 207, 18, 213, 174, 248, 199, 100, 3, 216, 43, 248, 201, 1, 65, 248,
+ 201, 1, 252, 206, 248, 201, 1, 68, 248, 201, 1, 223, 199, 248, 201, 1,
+ 66, 248, 201, 1, 196, 30, 248, 201, 1, 117, 146, 248, 201, 1, 117, 206,
+ 110, 248, 201, 1, 117, 172, 248, 201, 1, 71, 248, 201, 1, 251, 236, 248,
+ 201, 1, 74, 248, 201, 1, 250, 163, 248, 201, 1, 155, 248, 201, 1, 221,
+ 215, 248, 201, 1, 231, 240, 248, 201, 1, 231, 91, 248, 201, 1, 214, 68,
+ 248, 201, 1, 247, 160, 248, 201, 1, 247, 1, 248, 201, 1, 223, 32, 248,
+ 201, 1, 222, 252, 248, 201, 1, 212, 101, 248, 201, 1, 197, 132, 248, 201,
+ 1, 197, 120, 248, 201, 1, 237, 191, 248, 201, 1, 237, 175, 248, 201, 1,
+ 213, 79, 248, 201, 1, 190, 190, 248, 201, 1, 199, 49, 248, 201, 1, 238,
+ 32, 248, 201, 1, 237, 68, 248, 201, 1, 180, 248, 201, 1, 168, 248, 201,
+ 1, 209, 228, 248, 201, 1, 249, 153, 248, 201, 1, 248, 203, 248, 201, 1,
+ 174, 248, 201, 1, 170, 248, 201, 1, 165, 248, 201, 1, 173, 248, 201, 1,
+ 195, 188, 248, 201, 1, 203, 165, 248, 201, 1, 201, 175, 248, 201, 1, 188,
+ 248, 201, 1, 140, 248, 201, 18, 3, 252, 206, 248, 201, 18, 3, 68, 248,
+ 201, 18, 3, 223, 199, 248, 201, 18, 3, 66, 248, 201, 18, 3, 196, 30, 248,
+ 201, 18, 3, 117, 146, 248, 201, 18, 3, 117, 206, 110, 248, 201, 18, 3,
+ 117, 172, 248, 201, 18, 3, 71, 248, 201, 18, 3, 251, 236, 248, 201, 18,
+ 3, 74, 248, 201, 18, 3, 250, 163, 248, 201, 3, 247, 119, 248, 201, 3,
+ 251, 71, 248, 201, 3, 195, 35, 248, 201, 3, 195, 40, 248, 201, 3, 250,
+ 145, 248, 201, 237, 238, 248, 201, 55, 237, 238, 248, 201, 193, 23, 204,
+ 10, 248, 201, 231, 204, 233, 2, 248, 201, 231, 204, 233, 1, 248, 201, 17,
+ 191, 77, 248, 201, 17, 107, 248, 201, 17, 109, 248, 201, 17, 138, 248,
+ 201, 17, 134, 248, 201, 17, 149, 248, 201, 17, 169, 248, 201, 17, 175,
+ 248, 201, 17, 171, 248, 201, 17, 178, 248, 201, 31, 107, 248, 201, 31,
+ 109, 248, 201, 31, 138, 248, 201, 31, 134, 248, 201, 31, 149, 248, 201,
+ 31, 169, 248, 201, 31, 175, 248, 201, 31, 171, 248, 201, 31, 178, 248,
+ 201, 31, 199, 95, 248, 201, 31, 197, 32, 248, 201, 31, 198, 249, 248,
+ 201, 31, 232, 135, 248, 201, 31, 233, 15, 248, 201, 31, 202, 120, 248,
+ 201, 31, 203, 241, 248, 201, 31, 234, 153, 248, 201, 31, 213, 169, 248,
+ 201, 228, 139, 196, 91, 77, 217, 57, 229, 236, 77, 217, 57, 87, 203, 157,
+ 217, 57, 1, 155, 217, 57, 1, 221, 215, 217, 57, 1, 231, 240, 217, 57, 1,
+ 214, 68, 217, 57, 1, 247, 160, 217, 57, 1, 247, 1, 217, 57, 1, 223, 32,
+ 217, 57, 1, 212, 101, 217, 57, 1, 190, 190, 217, 57, 1, 199, 49, 217, 57,
+ 1, 238, 32, 217, 57, 1, 180, 217, 57, 1, 168, 217, 57, 1, 209, 228, 217,
+ 57, 1, 249, 153, 217, 57, 1, 174, 217, 57, 1, 197, 168, 217, 57, 1, 197,
+ 157, 217, 57, 1, 235, 35, 217, 57, 1, 193, 190, 217, 57, 1, 191, 71, 217,
+ 57, 1, 191, 123, 217, 57, 1, 255, 214, 217, 57, 1, 170, 217, 57, 1, 165,
+ 217, 57, 1, 173, 217, 57, 1, 203, 165, 217, 57, 1, 188, 217, 57, 1, 140,
+ 217, 57, 1, 65, 217, 57, 200, 239, 1, 155, 217, 57, 200, 239, 1, 221,
+ 215, 217, 57, 200, 239, 1, 231, 240, 217, 57, 200, 239, 1, 214, 68, 217,
+ 57, 200, 239, 1, 247, 160, 217, 57, 200, 239, 1, 247, 1, 217, 57, 200,
+ 239, 1, 223, 32, 217, 57, 200, 239, 1, 212, 101, 217, 57, 200, 239, 1,
+ 190, 190, 217, 57, 200, 239, 1, 199, 49, 217, 57, 200, 239, 1, 238, 32,
+ 217, 57, 200, 239, 1, 180, 217, 57, 200, 239, 1, 168, 217, 57, 200, 239,
+ 1, 209, 228, 217, 57, 200, 239, 1, 249, 153, 217, 57, 200, 239, 1, 174,
+ 217, 57, 200, 239, 1, 197, 168, 217, 57, 200, 239, 1, 197, 157, 217, 57,
+ 200, 239, 1, 235, 35, 217, 57, 200, 239, 1, 193, 190, 217, 57, 200, 239,
+ 1, 191, 71, 217, 57, 200, 239, 1, 191, 123, 217, 57, 200, 239, 1, 170,
+ 217, 57, 200, 239, 1, 165, 217, 57, 200, 239, 1, 173, 217, 57, 200, 239,
+ 1, 203, 165, 217, 57, 200, 239, 1, 188, 217, 57, 200, 239, 1, 140, 217,
+ 57, 200, 239, 1, 65, 217, 57, 18, 3, 252, 206, 217, 57, 18, 3, 68, 217,
+ 57, 18, 3, 66, 217, 57, 18, 3, 71, 217, 57, 18, 3, 74, 217, 57, 3, 251,
+ 71, 217, 57, 3, 247, 119, 217, 41, 129, 1, 65, 217, 41, 129, 1, 252, 206,
+ 217, 41, 129, 1, 68, 217, 41, 129, 1, 223, 199, 217, 41, 129, 1, 66, 217,
+ 41, 129, 1, 196, 30, 217, 41, 129, 1, 71, 217, 41, 129, 1, 251, 236, 217,
+ 41, 129, 1, 74, 217, 41, 129, 1, 250, 163, 217, 41, 129, 1, 155, 217, 41,
+ 129, 1, 221, 215, 217, 41, 129, 1, 231, 240, 217, 41, 129, 1, 231, 91,
+ 217, 41, 129, 1, 214, 68, 217, 41, 129, 1, 247, 160, 217, 41, 129, 1,
+ 247, 1, 217, 41, 129, 1, 223, 32, 217, 41, 129, 1, 222, 252, 217, 41,
+ 129, 1, 212, 101, 217, 41, 129, 1, 197, 132, 217, 41, 129, 1, 197, 120,
+ 217, 41, 129, 1, 237, 191, 217, 41, 129, 1, 237, 175, 217, 41, 129, 1,
+ 213, 79, 217, 41, 129, 1, 190, 190, 217, 41, 129, 1, 199, 49, 217, 41,
+ 129, 1, 238, 32, 217, 41, 129, 1, 237, 68, 217, 41, 129, 1, 180, 217, 41,
+ 129, 1, 168, 217, 41, 129, 1, 209, 228, 217, 41, 129, 1, 249, 153, 217,
+ 41, 129, 1, 248, 203, 217, 41, 129, 1, 174, 217, 41, 129, 1, 170, 217,
+ 41, 129, 1, 165, 217, 41, 129, 1, 173, 217, 41, 129, 1, 195, 188, 217,
+ 41, 129, 1, 203, 165, 217, 41, 129, 1, 201, 175, 217, 41, 129, 1, 188,
+ 217, 41, 129, 1, 140, 217, 41, 129, 1, 219, 73, 217, 41, 129, 1, 220,
+ 246, 217, 41, 129, 1, 222, 202, 217, 41, 129, 1, 198, 26, 217, 41, 129,
+ 18, 3, 252, 206, 217, 41, 129, 18, 3, 68, 217, 41, 129, 18, 3, 223, 199,
+ 217, 41, 129, 18, 3, 66, 217, 41, 129, 18, 3, 196, 30, 217, 41, 129, 18,
+ 3, 117, 146, 217, 41, 129, 18, 3, 71, 217, 41, 129, 18, 3, 251, 236, 217,
+ 41, 129, 18, 3, 74, 217, 41, 129, 18, 3, 250, 163, 217, 41, 129, 3, 251,
+ 71, 217, 41, 129, 3, 195, 35, 217, 41, 129, 3, 212, 141, 217, 41, 129, 3,
+ 247, 121, 217, 41, 129, 3, 230, 72, 217, 41, 129, 195, 40, 217, 41, 129,
+ 207, 44, 217, 41, 129, 207, 181, 217, 41, 129, 17, 191, 77, 217, 41, 129,
+ 17, 107, 217, 41, 129, 17, 109, 217, 41, 129, 17, 138, 217, 41, 129, 17,
+ 134, 217, 41, 129, 17, 149, 217, 41, 129, 17, 169, 217, 41, 129, 17, 175,
+ 217, 41, 129, 17, 171, 217, 41, 129, 17, 178, 230, 157, 129, 1, 65, 230,
+ 157, 129, 1, 252, 206, 230, 157, 129, 1, 68, 230, 157, 129, 1, 223, 199,
+ 230, 157, 129, 1, 66, 230, 157, 129, 1, 196, 30, 230, 157, 129, 1, 234,
+ 188, 230, 157, 129, 1, 251, 236, 230, 157, 129, 1, 211, 87, 230, 157,
+ 129, 1, 250, 163, 230, 157, 129, 1, 170, 230, 157, 129, 1, 195, 188, 230,
+ 157, 129, 1, 249, 153, 230, 157, 129, 1, 248, 203, 230, 157, 129, 1, 174,
+ 230, 157, 129, 1, 155, 230, 157, 129, 1, 221, 215, 230, 157, 129, 1, 190,
+ 190, 230, 157, 129, 1, 199, 49, 230, 157, 129, 1, 173, 230, 157, 129, 1,
+ 231, 240, 230, 157, 129, 1, 231, 91, 230, 157, 129, 1, 238, 32, 230, 157,
+ 129, 1, 237, 68, 230, 157, 129, 1, 180, 230, 157, 129, 1, 247, 160, 230,
+ 157, 129, 1, 247, 1, 230, 157, 129, 1, 197, 132, 230, 157, 129, 1, 197,
+ 120, 230, 157, 129, 1, 219, 73, 230, 157, 129, 1, 223, 32, 230, 157, 129,
+ 1, 222, 252, 230, 157, 129, 1, 237, 191, 230, 157, 129, 1, 237, 175, 230,
+ 157, 129, 1, 214, 68, 230, 157, 129, 1, 168, 230, 157, 129, 1, 209, 228,
+ 230, 157, 129, 1, 140, 230, 157, 129, 1, 165, 230, 157, 129, 1, 188, 230,
+ 157, 129, 18, 3, 252, 206, 230, 157, 129, 18, 3, 68, 230, 157, 129, 18,
+ 3, 223, 199, 230, 157, 129, 18, 3, 66, 230, 157, 129, 18, 3, 196, 30,
+ 230, 157, 129, 18, 3, 234, 188, 230, 157, 129, 18, 3, 251, 236, 230, 157,
+ 129, 18, 3, 211, 87, 230, 157, 129, 18, 3, 250, 163, 230, 157, 129, 3,
+ 251, 71, 230, 157, 129, 3, 195, 35, 230, 157, 129, 195, 40, 230, 157,
+ 129, 211, 113, 230, 157, 129, 17, 191, 77, 230, 157, 129, 17, 107, 230,
+ 157, 129, 17, 109, 230, 157, 129, 17, 138, 230, 157, 129, 17, 134, 230,
+ 157, 129, 17, 149, 230, 157, 129, 17, 169, 230, 157, 129, 17, 175, 230,
+ 157, 129, 17, 171, 230, 157, 129, 17, 178, 217, 102, 1, 155, 217, 102, 1,
+ 231, 240, 217, 102, 1, 214, 68, 217, 102, 1, 168, 217, 102, 1, 249, 153,
+ 217, 102, 1, 174, 217, 102, 1, 190, 190, 217, 102, 1, 238, 32, 217, 102,
+ 1, 180, 217, 102, 1, 247, 160, 217, 102, 1, 223, 32, 217, 102, 1, 212,
+ 101, 217, 102, 1, 170, 217, 102, 1, 165, 217, 102, 1, 173, 217, 102, 1,
+ 195, 188, 217, 102, 1, 188, 217, 102, 1, 65, 217, 102, 251, 118, 217,
+ 102, 18, 3, 68, 217, 102, 18, 3, 66, 217, 102, 18, 3, 71, 217, 102, 18,
+ 3, 74, 217, 102, 210, 94, 217, 102, 234, 95, 79, 205, 53, 222, 33, 3,
+ 247, 119, 222, 33, 3, 251, 71, 222, 33, 3, 207, 44, 222, 33, 3, 195, 35,
+ 222, 33, 1, 65, 222, 33, 1, 252, 206, 222, 33, 1, 68, 222, 33, 1, 223,
+ 199, 222, 33, 1, 66, 222, 33, 1, 196, 30, 222, 33, 1, 117, 146, 222, 33,
+ 1, 117, 206, 110, 222, 33, 1, 117, 172, 222, 33, 1, 117, 219, 74, 222,
+ 33, 1, 71, 222, 33, 1, 251, 236, 222, 33, 1, 74, 222, 33, 1, 155, 222,
+ 33, 1, 221, 215, 222, 33, 1, 231, 240, 222, 33, 1, 231, 91, 222, 33, 1,
+ 214, 68, 222, 33, 1, 247, 160, 222, 33, 1, 247, 1, 222, 33, 1, 223, 32,
+ 222, 33, 1, 222, 252, 222, 33, 1, 212, 101, 222, 33, 1, 197, 132, 222,
+ 33, 1, 197, 120, 222, 33, 1, 237, 191, 222, 33, 1, 237, 175, 222, 33, 1,
+ 213, 79, 222, 33, 1, 190, 190, 222, 33, 1, 199, 49, 222, 33, 1, 238, 32,
+ 222, 33, 1, 237, 68, 222, 33, 1, 180, 222, 33, 1, 168, 222, 33, 1, 209,
+ 228, 222, 33, 1, 249, 153, 222, 33, 1, 248, 203, 222, 33, 1, 174, 222,
+ 33, 1, 170, 222, 33, 1, 165, 222, 33, 1, 173, 222, 33, 1, 193, 190, 222,
+ 33, 1, 203, 165, 222, 33, 1, 201, 175, 222, 33, 1, 188, 222, 33, 1, 140,
+ 222, 33, 1, 222, 202, 222, 33, 18, 3, 252, 206, 222, 33, 18, 3, 251, 157,
+ 252, 206, 222, 33, 18, 3, 68, 222, 33, 18, 3, 223, 199, 222, 33, 18, 3,
+ 66, 222, 33, 18, 3, 196, 30, 222, 33, 18, 3, 117, 146, 222, 33, 18, 3,
+ 71, 222, 33, 18, 3, 251, 236, 222, 33, 18, 3, 233, 242, 222, 33, 3, 221,
+ 143, 222, 33, 239, 45, 222, 33, 237, 238, 222, 33, 55, 237, 238, 222, 33,
+ 208, 152, 205, 54, 217, 51, 222, 33, 208, 152, 251, 157, 205, 54, 217,
+ 51, 222, 33, 208, 152, 232, 186, 222, 33, 208, 152, 201, 248, 233, 3,
+ 222, 33, 208, 152, 236, 140, 222, 33, 208, 152, 55, 236, 140, 222, 33,
+ 208, 152, 197, 225, 236, 140, 222, 33, 208, 152, 243, 10, 222, 33, 208,
+ 152, 233, 4, 243, 10, 222, 33, 208, 152, 201, 217, 222, 33, 208, 152,
+ 242, 215, 201, 217, 222, 33, 17, 191, 77, 222, 33, 17, 107, 222, 33, 17,
+ 109, 222, 33, 17, 138, 222, 33, 17, 134, 222, 33, 17, 149, 222, 33, 17,
+ 169, 222, 33, 17, 175, 222, 33, 17, 171, 222, 33, 17, 178, 219, 88, 1,
+ 192, 35, 44, 232, 118, 91, 198, 222, 44, 232, 118, 91, 211, 100, 44, 232,
+ 118, 91, 234, 156, 44, 232, 118, 91, 202, 118, 44, 232, 118, 91, 232,
+ 139, 44, 232, 118, 91, 198, 245, 44, 232, 118, 115, 234, 155, 44, 232,
+ 118, 115, 202, 117, 44, 232, 118, 91, 197, 35, 44, 232, 118, 91, 202,
+ 127, 44, 232, 118, 91, 202, 126, 44, 232, 118, 91, 199, 86, 44, 232, 118,
+ 91, 234, 159, 44, 232, 118, 115, 197, 34, 44, 232, 118, 115, 202, 125,
+ 44, 232, 118, 91, 233, 18, 44, 232, 118, 91, 208, 22, 44, 232, 118, 91,
+ 230, 69, 44, 232, 118, 91, 230, 68, 44, 232, 118, 115, 208, 20, 44, 232,
+ 118, 235, 121, 233, 93, 221, 144, 44, 3, 214, 104, 44, 3, 247, 6, 44, 3,
+ 252, 157, 44, 3, 196, 15, 44, 3, 215, 90, 44, 3, 220, 194, 44, 3, 210,
+ 85, 44, 3, 215, 135, 44, 3, 222, 124, 44, 3, 210, 164, 44, 3, 209, 39,
+ 44, 3, 195, 173, 44, 3, 210, 215, 44, 3, 220, 183, 44, 3, 195, 143, 44,
+ 193, 101, 238, 187, 56, 44, 235, 92, 238, 187, 56, 44, 220, 23, 56, 44,
+ 205, 159, 210, 167, 56, 44, 198, 21, 238, 230, 56, 44, 198, 21, 31, 56,
+ 44, 238, 169, 56, 44, 23, 211, 155, 56, 44, 201, 227, 56, 44, 198, 39,
+ 56, 44, 223, 163, 209, 22, 56, 44, 201, 96, 232, 98, 56, 44, 3, 215, 94,
+ 44, 3, 195, 181, 44, 208, 152, 234, 95, 79, 199, 53, 10, 3, 65, 10, 3,
+ 42, 25, 65, 10, 3, 42, 25, 249, 135, 10, 3, 42, 25, 231, 209, 199, 84,
+ 10, 3, 42, 25, 140, 10, 3, 42, 25, 223, 201, 10, 3, 42, 25, 220, 103,
+ 230, 155, 10, 3, 42, 25, 215, 101, 10, 3, 42, 25, 205, 185, 10, 3, 254,
+ 215, 10, 3, 252, 155, 10, 3, 252, 156, 25, 250, 207, 10, 3, 252, 156, 25,
+ 235, 74, 230, 155, 10, 3, 252, 156, 25, 231, 222, 10, 3, 252, 156, 25,
+ 231, 209, 199, 84, 10, 3, 252, 156, 25, 140, 10, 3, 252, 156, 25, 223,
+ 202, 230, 155, 10, 3, 252, 156, 25, 223, 172, 10, 3, 252, 156, 25, 220,
+ 104, 10, 3, 252, 156, 25, 203, 97, 10, 3, 252, 156, 25, 126, 108, 126,
+ 108, 66, 10, 3, 252, 156, 230, 155, 10, 3, 252, 72, 10, 3, 252, 73, 25,
+ 249, 114, 10, 3, 252, 73, 25, 231, 209, 199, 84, 10, 3, 252, 73, 25, 216,
+ 233, 108, 234, 103, 10, 3, 252, 73, 25, 203, 163, 10, 3, 252, 73, 25,
+ 199, 209, 10, 3, 252, 42, 10, 3, 251, 216, 10, 3, 251, 217, 25, 234, 28,
+ 10, 3, 251, 217, 25, 203, 59, 108, 231, 23, 10, 3, 251, 207, 10, 3, 251,
+ 208, 25, 251, 207, 10, 3, 251, 208, 25, 236, 253, 10, 3, 251, 208, 25,
+ 231, 23, 10, 3, 251, 208, 25, 140, 10, 3, 251, 208, 25, 222, 111, 10, 3,
+ 251, 208, 25, 221, 166, 10, 3, 251, 208, 25, 203, 113, 10, 3, 251, 208,
+ 25, 196, 38, 10, 3, 251, 203, 10, 3, 251, 190, 10, 3, 251, 145, 10, 3,
+ 251, 146, 25, 203, 113, 10, 3, 251, 132, 10, 3, 251, 133, 139, 251, 132,
+ 10, 3, 251, 133, 115, 198, 144, 10, 3, 251, 133, 108, 214, 241, 211, 63,
+ 251, 133, 108, 214, 240, 10, 3, 251, 133, 108, 214, 241, 201, 189, 10, 3,
+ 251, 91, 10, 3, 251, 60, 10, 3, 251, 26, 10, 3, 251, 27, 25, 220, 197,
+ 10, 3, 250, 254, 10, 3, 250, 215, 10, 3, 250, 209, 10, 3, 250, 210, 191,
+ 26, 199, 84, 10, 3, 250, 210, 222, 116, 199, 84, 10, 3, 250, 210, 139,
+ 250, 210, 197, 83, 139, 197, 83, 197, 83, 139, 197, 83, 210, 137, 10, 3,
+ 250, 210, 139, 250, 210, 139, 250, 209, 10, 3, 250, 210, 139, 250, 210,
+ 139, 250, 210, 238, 210, 250, 210, 139, 250, 210, 139, 250, 209, 10, 3,
+ 250, 207, 10, 3, 250, 203, 10, 3, 249, 153, 10, 3, 249, 135, 10, 3, 249,
+ 129, 10, 3, 249, 121, 10, 3, 249, 115, 10, 3, 249, 116, 139, 249, 115,
+ 10, 3, 249, 114, 10, 3, 164, 10, 3, 249, 87, 10, 3, 248, 188, 10, 3, 248,
+ 189, 25, 65, 10, 3, 248, 189, 25, 231, 200, 10, 3, 248, 189, 25, 223,
+ 202, 230, 155, 10, 3, 248, 10, 10, 3, 248, 11, 139, 248, 11, 252, 155,
+ 10, 3, 248, 11, 139, 248, 11, 196, 113, 10, 3, 248, 11, 238, 210, 248,
+ 10, 10, 3, 247, 242, 10, 3, 247, 243, 139, 247, 242, 10, 3, 247, 230, 10,
+ 3, 247, 229, 10, 3, 238, 32, 10, 3, 238, 22, 10, 3, 238, 23, 221, 125,
+ 25, 42, 108, 217, 39, 10, 3, 238, 23, 221, 125, 25, 251, 145, 10, 3, 238,
+ 23, 221, 125, 25, 249, 114, 10, 3, 238, 23, 221, 125, 25, 248, 188, 10,
+ 3, 238, 23, 221, 125, 25, 231, 240, 10, 3, 238, 23, 221, 125, 25, 231,
+ 241, 108, 217, 39, 10, 3, 238, 23, 221, 125, 25, 231, 53, 10, 3, 238, 23,
+ 221, 125, 25, 231, 32, 10, 3, 238, 23, 221, 125, 25, 230, 168, 10, 3,
+ 238, 23, 221, 125, 25, 140, 10, 3, 238, 23, 221, 125, 25, 223, 77, 10, 3,
+ 238, 23, 221, 125, 25, 223, 78, 108, 218, 225, 10, 3, 238, 23, 221, 125,
+ 25, 222, 96, 10, 3, 238, 23, 221, 125, 25, 173, 10, 3, 238, 23, 221, 125,
+ 25, 218, 225, 10, 3, 238, 23, 221, 125, 25, 218, 226, 108, 217, 38, 10,
+ 3, 238, 23, 221, 125, 25, 218, 208, 10, 3, 238, 23, 221, 125, 25, 214,
+ 121, 10, 3, 238, 23, 221, 125, 25, 210, 138, 108, 210, 137, 10, 3, 238,
+ 23, 221, 125, 25, 202, 222, 10, 3, 238, 23, 221, 125, 25, 199, 209, 10,
+ 3, 238, 23, 221, 125, 25, 196, 170, 108, 231, 32, 10, 3, 238, 23, 221,
+ 125, 25, 196, 38, 10, 3, 237, 250, 10, 3, 237, 225, 10, 3, 237, 224, 10,
+ 3, 237, 223, 10, 3, 237, 44, 10, 3, 237, 26, 10, 3, 236, 255, 10, 3, 237,
+ 0, 25, 203, 113, 10, 3, 236, 253, 10, 3, 236, 243, 10, 3, 236, 244, 222,
+ 55, 126, 230, 156, 236, 222, 10, 3, 236, 222, 10, 3, 235, 89, 10, 3, 235,
+ 90, 139, 235, 89, 10, 3, 235, 90, 230, 155, 10, 3, 235, 90, 203, 94, 10,
+ 3, 235, 87, 10, 3, 235, 88, 25, 234, 9, 10, 3, 235, 86, 10, 3, 235, 82,
+ 10, 3, 235, 81, 10, 3, 235, 80, 10, 3, 235, 75, 10, 3, 235, 73, 10, 3,
+ 235, 74, 230, 155, 10, 3, 235, 74, 230, 156, 230, 155, 10, 3, 235, 72,
+ 10, 3, 235, 65, 10, 3, 71, 10, 3, 235, 15, 25, 210, 137, 10, 3, 235, 15,
+ 139, 235, 15, 212, 131, 139, 212, 130, 10, 3, 234, 218, 10, 3, 234, 219,
+ 25, 42, 108, 230, 105, 108, 238, 32, 10, 3, 234, 219, 25, 231, 200, 10,
+ 3, 234, 219, 25, 216, 100, 10, 3, 234, 219, 25, 205, 169, 10, 3, 234,
+ 219, 25, 203, 113, 10, 3, 234, 219, 25, 66, 10, 3, 234, 190, 10, 3, 234,
+ 177, 10, 3, 234, 140, 10, 3, 234, 103, 10, 3, 234, 104, 25, 231, 208, 10,
+ 3, 234, 104, 25, 231, 209, 199, 84, 10, 3, 234, 104, 25, 216, 232, 10, 3,
+ 234, 104, 238, 210, 234, 103, 10, 3, 234, 104, 211, 63, 234, 103, 10, 3,
+ 234, 104, 201, 189, 10, 3, 234, 31, 10, 3, 234, 28, 10, 3, 234, 9, 10, 3,
+ 233, 180, 10, 3, 233, 181, 25, 65, 10, 3, 233, 181, 25, 42, 108, 220, 37,
+ 10, 3, 233, 181, 25, 42, 108, 220, 38, 25, 220, 37, 10, 3, 233, 181, 25,
+ 251, 132, 10, 3, 233, 181, 25, 249, 135, 10, 3, 233, 181, 25, 235, 74,
+ 230, 155, 10, 3, 233, 181, 25, 235, 74, 230, 156, 230, 155, 10, 3, 233,
+ 181, 25, 140, 10, 3, 233, 181, 25, 230, 105, 230, 155, 10, 3, 233, 181,
+ 25, 223, 202, 230, 155, 10, 3, 233, 181, 25, 222, 54, 10, 3, 233, 181,
+ 25, 222, 55, 201, 189, 10, 3, 233, 181, 25, 220, 223, 10, 3, 233, 181,
+ 25, 173, 10, 3, 233, 181, 25, 220, 38, 25, 220, 37, 10, 3, 233, 181, 25,
+ 219, 146, 10, 3, 233, 181, 25, 218, 225, 10, 3, 233, 181, 25, 196, 169,
+ 10, 3, 233, 181, 25, 196, 158, 10, 3, 231, 240, 10, 3, 231, 241, 230,
+ 155, 10, 3, 231, 238, 10, 3, 231, 239, 25, 42, 108, 238, 33, 108, 140,
+ 10, 3, 231, 239, 25, 42, 108, 140, 10, 3, 231, 239, 25, 42, 108, 223,
+ 201, 10, 3, 231, 239, 25, 252, 73, 199, 85, 108, 199, 236, 10, 3, 231,
+ 239, 25, 251, 132, 10, 3, 231, 239, 25, 250, 209, 10, 3, 231, 239, 25,
+ 250, 208, 108, 231, 222, 10, 3, 231, 239, 25, 249, 135, 10, 3, 231, 239,
+ 25, 249, 88, 108, 165, 10, 3, 231, 239, 25, 247, 230, 10, 3, 231, 239,
+ 25, 247, 231, 108, 165, 10, 3, 231, 239, 25, 238, 32, 10, 3, 231, 239,
+ 25, 237, 44, 10, 3, 231, 239, 25, 237, 0, 25, 203, 113, 10, 3, 231, 239,
+ 25, 235, 87, 10, 3, 231, 239, 25, 234, 140, 10, 3, 231, 239, 25, 234,
+ 141, 108, 173, 10, 3, 231, 239, 25, 234, 103, 10, 3, 231, 239, 25, 234,
+ 104, 25, 231, 209, 199, 84, 10, 3, 231, 239, 25, 231, 209, 199, 84, 10,
+ 3, 231, 239, 25, 231, 200, 10, 3, 231, 239, 25, 231, 53, 10, 3, 231, 239,
+ 25, 231, 51, 10, 3, 231, 239, 25, 231, 52, 108, 65, 10, 3, 231, 239, 25,
+ 231, 33, 108, 201, 4, 10, 3, 231, 239, 25, 230, 105, 108, 218, 226, 108,
+ 234, 9, 10, 3, 231, 239, 25, 230, 73, 10, 3, 231, 239, 25, 230, 74, 108,
+ 173, 10, 3, 231, 239, 25, 229, 159, 108, 219, 146, 10, 3, 231, 239, 25,
+ 228, 151, 10, 3, 231, 239, 25, 223, 202, 230, 155, 10, 3, 231, 239, 25,
+ 223, 63, 108, 228, 160, 108, 250, 209, 10, 3, 231, 239, 25, 222, 96, 10,
+ 3, 231, 239, 25, 222, 54, 10, 3, 231, 239, 25, 221, 152, 10, 3, 231, 239,
+ 25, 221, 153, 108, 220, 37, 10, 3, 231, 239, 25, 220, 224, 108, 251, 132,
+ 10, 3, 231, 239, 25, 173, 10, 3, 231, 239, 25, 216, 233, 108, 234, 103,
+ 10, 3, 231, 239, 25, 216, 100, 10, 3, 231, 239, 25, 212, 130, 10, 3, 231,
+ 239, 25, 212, 131, 139, 212, 130, 10, 3, 231, 239, 25, 168, 10, 3, 231,
+ 239, 25, 205, 169, 10, 3, 231, 239, 25, 205, 127, 10, 3, 231, 239, 25,
+ 203, 113, 10, 3, 231, 239, 25, 203, 114, 108, 197, 64, 10, 3, 231, 239,
+ 25, 203, 79, 10, 3, 231, 239, 25, 200, 204, 10, 3, 231, 239, 25, 199,
+ 209, 10, 3, 231, 239, 25, 66, 10, 3, 231, 239, 25, 196, 158, 10, 3, 231,
+ 239, 25, 196, 159, 108, 235, 89, 10, 3, 231, 239, 139, 231, 238, 10, 3,
+ 231, 233, 10, 3, 231, 234, 238, 210, 231, 233, 10, 3, 231, 231, 10, 3,
+ 231, 232, 139, 231, 232, 231, 201, 139, 231, 200, 10, 3, 231, 222, 10, 3,
+ 231, 223, 231, 232, 139, 231, 232, 231, 201, 139, 231, 200, 10, 3, 231,
+ 221, 10, 3, 231, 219, 10, 3, 231, 210, 10, 3, 231, 208, 10, 3, 231, 209,
+ 199, 84, 10, 3, 231, 209, 139, 231, 208, 10, 3, 231, 209, 238, 210, 231,
+ 208, 10, 3, 231, 200, 10, 3, 231, 199, 10, 3, 231, 193, 10, 3, 231, 134,
+ 10, 3, 231, 135, 25, 220, 197, 10, 3, 231, 53, 10, 3, 231, 54, 25, 71,
+ 10, 3, 231, 54, 25, 66, 10, 3, 231, 54, 238, 210, 231, 53, 10, 3, 231,
+ 51, 10, 3, 231, 52, 139, 231, 51, 10, 3, 231, 52, 238, 210, 231, 51, 10,
+ 3, 231, 48, 10, 3, 231, 32, 10, 3, 231, 33, 230, 155, 10, 3, 231, 30, 10,
+ 3, 231, 31, 25, 42, 108, 223, 201, 10, 3, 231, 31, 25, 231, 209, 199, 84,
+ 10, 3, 231, 31, 25, 223, 201, 10, 3, 231, 31, 25, 218, 226, 108, 223,
+ 201, 10, 3, 231, 31, 25, 168, 10, 3, 231, 25, 10, 3, 231, 23, 10, 3, 231,
+ 24, 238, 210, 231, 23, 10, 3, 231, 24, 25, 249, 135, 10, 3, 231, 24, 25,
+ 199, 209, 10, 3, 231, 24, 199, 84, 10, 3, 230, 179, 10, 3, 230, 180, 238,
+ 210, 230, 179, 10, 3, 230, 177, 10, 3, 230, 178, 25, 222, 96, 10, 3, 230,
+ 178, 25, 222, 97, 25, 223, 202, 230, 155, 10, 3, 230, 178, 25, 212, 130,
+ 10, 3, 230, 178, 25, 205, 170, 108, 197, 82, 10, 3, 230, 178, 230, 155,
+ 10, 3, 230, 168, 10, 3, 230, 169, 25, 42, 108, 220, 197, 10, 3, 230, 169,
+ 25, 220, 197, 10, 3, 230, 169, 139, 230, 169, 218, 216, 10, 3, 230, 160,
+ 10, 3, 230, 158, 10, 3, 230, 159, 25, 203, 113, 10, 3, 230, 149, 10, 3,
+ 230, 148, 10, 3, 230, 143, 10, 3, 230, 142, 10, 3, 140, 10, 3, 230, 105,
+ 199, 84, 10, 3, 230, 105, 230, 155, 10, 3, 230, 73, 10, 3, 229, 158, 10,
+ 3, 229, 159, 25, 250, 209, 10, 3, 229, 159, 25, 250, 207, 10, 3, 229,
+ 159, 25, 249, 135, 10, 3, 229, 159, 25, 236, 222, 10, 3, 229, 159, 25,
+ 231, 231, 10, 3, 229, 159, 25, 221, 141, 10, 3, 229, 159, 25, 212, 130,
+ 10, 3, 229, 159, 25, 203, 113, 10, 3, 229, 159, 25, 66, 10, 3, 228, 159,
+ 10, 3, 228, 151, 10, 3, 228, 152, 25, 251, 132, 10, 3, 228, 152, 25, 230,
+ 73, 10, 3, 228, 152, 25, 222, 54, 10, 3, 228, 152, 25, 219, 89, 10, 3,
+ 228, 152, 25, 196, 158, 10, 3, 228, 146, 10, 3, 68, 10, 3, 228, 74, 65,
+ 10, 3, 228, 30, 10, 3, 223, 229, 10, 3, 223, 230, 139, 223, 230, 247,
+ 230, 10, 3, 223, 230, 139, 223, 230, 201, 189, 10, 3, 223, 204, 10, 3,
+ 223, 201, 10, 3, 223, 202, 237, 26, 10, 3, 223, 202, 207, 1, 10, 3, 223,
+ 202, 139, 223, 202, 203, 63, 139, 203, 63, 196, 159, 139, 196, 158, 10,
+ 3, 223, 202, 230, 155, 10, 3, 223, 191, 10, 3, 223, 192, 25, 231, 209,
+ 199, 84, 10, 3, 223, 190, 10, 3, 223, 180, 10, 3, 223, 181, 25, 199, 209,
+ 10, 3, 223, 181, 238, 210, 223, 180, 10, 3, 223, 181, 211, 63, 223, 180,
+ 10, 3, 223, 181, 201, 189, 10, 3, 223, 172, 10, 3, 223, 162, 10, 3, 223,
+ 77, 10, 3, 223, 62, 10, 3, 155, 10, 3, 222, 142, 25, 65, 10, 3, 222, 142,
+ 25, 252, 42, 10, 3, 222, 142, 25, 252, 43, 108, 220, 223, 10, 3, 222,
+ 142, 25, 250, 207, 10, 3, 222, 142, 25, 249, 135, 10, 3, 222, 142, 25,
+ 249, 114, 10, 3, 222, 142, 25, 164, 10, 3, 222, 142, 25, 248, 188, 10, 3,
+ 222, 142, 25, 234, 28, 10, 3, 222, 142, 25, 234, 9, 10, 3, 222, 142, 25,
+ 231, 240, 10, 3, 222, 142, 25, 231, 222, 10, 3, 222, 142, 25, 231, 209,
+ 199, 84, 10, 3, 222, 142, 25, 231, 200, 10, 3, 222, 142, 25, 231, 201,
+ 108, 203, 164, 108, 65, 10, 3, 222, 142, 25, 231, 53, 10, 3, 222, 142,
+ 25, 231, 32, 10, 3, 222, 142, 25, 231, 24, 108, 205, 127, 10, 3, 222,
+ 142, 25, 231, 24, 238, 210, 231, 23, 10, 3, 222, 142, 25, 230, 179, 10,
+ 3, 222, 142, 25, 230, 148, 10, 3, 222, 142, 25, 223, 201, 10, 3, 222,
+ 142, 25, 223, 180, 10, 3, 222, 142, 25, 222, 96, 10, 3, 222, 142, 25,
+ 221, 166, 10, 3, 222, 142, 25, 221, 152, 10, 3, 222, 142, 25, 219, 146,
+ 10, 3, 222, 142, 25, 218, 225, 10, 3, 222, 142, 25, 216, 232, 10, 3, 222,
+ 142, 25, 216, 233, 108, 235, 89, 10, 3, 222, 142, 25, 216, 233, 108, 231,
+ 53, 10, 3, 222, 142, 25, 216, 233, 108, 199, 145, 10, 3, 222, 142, 25,
+ 216, 100, 10, 3, 222, 142, 25, 216, 101, 108, 212, 125, 10, 3, 222, 142,
+ 25, 214, 121, 10, 3, 222, 142, 25, 212, 130, 10, 3, 222, 142, 25, 209,
+ 185, 10, 3, 222, 142, 25, 206, 68, 10, 3, 222, 142, 25, 188, 10, 3, 222,
+ 142, 25, 205, 127, 10, 3, 222, 142, 25, 203, 165, 10, 3, 222, 142, 25,
+ 203, 113, 10, 3, 222, 142, 25, 203, 79, 10, 3, 222, 142, 25, 203, 5, 10,
+ 3, 222, 142, 25, 202, 201, 10, 3, 222, 142, 25, 200, 213, 10, 3, 222,
+ 142, 25, 199, 179, 10, 3, 222, 142, 25, 66, 10, 3, 222, 142, 25, 196,
+ 169, 10, 3, 222, 142, 25, 196, 158, 10, 3, 222, 142, 25, 196, 116, 25,
+ 168, 10, 3, 222, 142, 25, 196, 38, 10, 3, 222, 142, 25, 191, 30, 10, 3,
+ 222, 128, 10, 3, 222, 129, 238, 210, 222, 128, 10, 3, 222, 117, 10, 3,
+ 222, 113, 10, 3, 222, 111, 10, 3, 222, 110, 10, 3, 222, 108, 10, 3, 222,
+ 109, 139, 222, 108, 10, 3, 222, 96, 10, 3, 222, 97, 25, 223, 202, 230,
+ 155, 10, 3, 222, 91, 10, 3, 222, 92, 25, 249, 135, 10, 3, 222, 92, 238,
+ 210, 222, 91, 10, 3, 222, 89, 10, 3, 222, 88, 10, 3, 222, 54, 10, 3, 222,
+ 55, 220, 105, 25, 126, 139, 220, 105, 25, 66, 10, 3, 222, 55, 139, 222,
+ 55, 220, 105, 25, 126, 139, 220, 105, 25, 66, 10, 3, 221, 242, 10, 3,
+ 221, 166, 10, 3, 221, 167, 25, 249, 135, 10, 3, 221, 167, 25, 66, 10, 3,
+ 221, 167, 25, 196, 158, 10, 3, 221, 152, 10, 3, 221, 141, 10, 3, 221,
+ 127, 10, 3, 221, 126, 10, 3, 221, 124, 10, 3, 221, 125, 139, 221, 124,
+ 10, 3, 220, 232, 10, 3, 220, 233, 139, 229, 159, 25, 250, 208, 220, 233,
+ 139, 229, 159, 25, 250, 207, 10, 3, 220, 223, 10, 3, 220, 221, 10, 3,
+ 220, 222, 195, 168, 20, 10, 3, 220, 220, 10, 3, 220, 211, 10, 3, 220,
+ 212, 230, 155, 10, 3, 220, 210, 10, 3, 220, 197, 10, 3, 220, 198, 211,
+ 63, 220, 197, 10, 3, 220, 190, 10, 3, 220, 167, 10, 3, 173, 10, 3, 220,
+ 104, 10, 3, 220, 105, 25, 65, 10, 3, 220, 105, 25, 42, 108, 238, 33, 108,
+ 140, 10, 3, 220, 105, 25, 42, 108, 231, 200, 10, 3, 220, 105, 25, 42,
+ 108, 220, 37, 10, 3, 220, 105, 25, 251, 207, 10, 3, 220, 105, 25, 251,
+ 132, 10, 3, 220, 105, 25, 250, 210, 191, 26, 199, 84, 10, 3, 220, 105,
+ 25, 249, 135, 10, 3, 220, 105, 25, 248, 188, 10, 3, 220, 105, 25, 237,
+ 225, 10, 3, 220, 105, 25, 234, 103, 10, 3, 220, 105, 25, 231, 240, 10, 3,
+ 220, 105, 25, 231, 200, 10, 3, 220, 105, 25, 230, 168, 10, 3, 220, 105,
+ 25, 230, 169, 108, 230, 168, 10, 3, 220, 105, 25, 140, 10, 3, 220, 105,
+ 25, 230, 73, 10, 3, 220, 105, 25, 229, 159, 25, 212, 130, 10, 3, 220,
+ 105, 25, 223, 202, 230, 155, 10, 3, 220, 105, 25, 223, 180, 10, 3, 220,
+ 105, 25, 223, 181, 108, 140, 10, 3, 220, 105, 25, 223, 181, 108, 218,
+ 225, 10, 3, 220, 105, 25, 221, 166, 10, 3, 220, 105, 25, 221, 141, 10, 3,
+ 220, 105, 25, 220, 223, 10, 3, 220, 105, 25, 220, 211, 10, 3, 220, 105,
+ 25, 220, 212, 108, 229, 159, 108, 65, 10, 3, 220, 105, 25, 220, 104, 10,
+ 3, 220, 105, 25, 219, 89, 10, 3, 220, 105, 25, 218, 225, 10, 3, 220, 105,
+ 25, 218, 210, 10, 3, 220, 105, 25, 216, 232, 10, 3, 220, 105, 25, 216,
+ 233, 108, 234, 103, 10, 3, 220, 105, 25, 215, 101, 10, 3, 220, 105, 25,
+ 214, 121, 10, 3, 220, 105, 25, 203, 114, 108, 200, 204, 10, 3, 220, 105,
+ 25, 203, 59, 108, 231, 24, 108, 234, 28, 10, 3, 220, 105, 25, 203, 59,
+ 108, 231, 24, 199, 84, 10, 3, 220, 105, 25, 203, 3, 10, 3, 220, 105, 25,
+ 203, 4, 108, 203, 3, 10, 3, 220, 105, 25, 200, 204, 10, 3, 220, 105, 25,
+ 199, 223, 10, 3, 220, 105, 25, 199, 209, 10, 3, 220, 105, 25, 199, 146,
+ 108, 42, 108, 201, 5, 108, 180, 10, 3, 220, 105, 25, 66, 10, 3, 220, 105,
+ 25, 126, 108, 65, 10, 3, 220, 105, 25, 126, 108, 126, 108, 66, 10, 3,
+ 220, 105, 25, 196, 170, 108, 250, 209, 10, 3, 220, 105, 25, 196, 158, 10,
+ 3, 220, 105, 25, 196, 38, 10, 3, 220, 105, 201, 189, 10, 3, 220, 102, 10,
+ 3, 220, 103, 25, 203, 113, 10, 3, 220, 103, 25, 203, 114, 108, 200, 204,
+ 10, 3, 220, 103, 230, 155, 10, 3, 220, 103, 230, 156, 139, 220, 103, 230,
+ 156, 203, 113, 10, 3, 220, 98, 10, 3, 220, 37, 10, 3, 220, 38, 25, 220,
+ 37, 10, 3, 220, 35, 10, 3, 220, 36, 25, 220, 197, 10, 3, 220, 36, 25,
+ 220, 198, 108, 206, 68, 10, 3, 219, 146, 10, 3, 219, 127, 10, 3, 219,
+ 115, 10, 3, 219, 89, 10, 3, 218, 225, 10, 3, 218, 226, 25, 249, 135, 10,
+ 3, 218, 223, 10, 3, 218, 224, 25, 251, 207, 10, 3, 218, 224, 25, 249,
+ 135, 10, 3, 218, 224, 25, 234, 9, 10, 3, 218, 224, 25, 234, 10, 199, 84,
+ 10, 3, 218, 224, 25, 231, 209, 199, 84, 10, 3, 218, 224, 25, 229, 159,
+ 25, 249, 135, 10, 3, 218, 224, 25, 223, 180, 10, 3, 218, 224, 25, 222,
+ 113, 10, 3, 218, 224, 25, 222, 111, 10, 3, 218, 224, 25, 222, 112, 108,
+ 250, 209, 10, 3, 218, 224, 25, 221, 166, 10, 3, 218, 224, 25, 220, 126,
+ 108, 250, 209, 10, 3, 218, 224, 25, 220, 104, 10, 3, 218, 224, 25, 216,
+ 233, 108, 234, 103, 10, 3, 218, 224, 25, 214, 121, 10, 3, 218, 224, 25,
+ 212, 178, 10, 3, 218, 224, 25, 202, 223, 108, 250, 209, 10, 3, 218, 224,
+ 25, 202, 192, 108, 248, 10, 10, 3, 218, 224, 25, 197, 82, 10, 3, 218,
+ 224, 199, 84, 10, 3, 218, 224, 238, 210, 218, 223, 10, 3, 218, 224, 211,
+ 63, 218, 223, 10, 3, 218, 224, 201, 189, 10, 3, 218, 224, 203, 94, 10, 3,
+ 218, 222, 10, 3, 218, 216, 10, 3, 218, 217, 139, 218, 216, 10, 3, 218,
+ 217, 211, 63, 218, 216, 10, 3, 218, 217, 203, 94, 10, 3, 218, 213, 10, 3,
+ 218, 210, 10, 3, 218, 208, 10, 3, 218, 209, 139, 218, 208, 10, 3, 218,
+ 209, 139, 218, 209, 231, 201, 139, 231, 200, 10, 3, 174, 10, 3, 217, 160,
+ 25, 199, 209, 10, 3, 217, 160, 230, 155, 10, 3, 217, 152, 10, 3, 217,
+ 120, 10, 3, 217, 65, 10, 3, 217, 39, 10, 3, 217, 38, 10, 3, 216, 232, 10,
+ 3, 216, 173, 10, 3, 216, 100, 10, 3, 216, 44, 10, 3, 215, 155, 10, 3,
+ 215, 156, 139, 215, 155, 10, 3, 215, 140, 10, 3, 215, 141, 230, 155, 10,
+ 3, 215, 119, 10, 3, 215, 105, 10, 3, 215, 101, 10, 3, 215, 102, 25, 65,
+ 10, 3, 215, 102, 25, 220, 197, 10, 3, 215, 102, 25, 191, 123, 10, 3, 215,
+ 102, 139, 215, 101, 10, 3, 215, 102, 139, 215, 102, 25, 42, 108, 180, 10,
+ 3, 215, 102, 238, 210, 215, 101, 10, 3, 215, 99, 10, 3, 215, 100, 25, 65,
+ 10, 3, 215, 100, 25, 42, 108, 237, 44, 10, 3, 215, 100, 25, 237, 44, 10,
+ 3, 215, 100, 230, 155, 10, 3, 180, 10, 3, 214, 253, 10, 3, 214, 240, 10,
+ 3, 214, 241, 223, 92, 10, 3, 214, 241, 25, 203, 6, 199, 84, 10, 3, 214,
+ 241, 211, 63, 214, 240, 10, 3, 214, 239, 10, 3, 214, 231, 212, 116, 10,
+ 3, 214, 230, 10, 3, 214, 229, 10, 3, 214, 121, 10, 3, 214, 122, 25, 65,
+ 10, 3, 214, 122, 25, 196, 158, 10, 3, 214, 122, 203, 94, 10, 3, 213, 219,
+ 10, 3, 213, 220, 25, 71, 10, 3, 213, 210, 10, 3, 213, 180, 10, 3, 213,
+ 181, 25, 231, 209, 199, 84, 10, 3, 213, 181, 25, 231, 201, 108, 231, 209,
+ 199, 84, 10, 3, 213, 176, 10, 3, 213, 177, 25, 251, 132, 10, 3, 213, 177,
+ 25, 250, 209, 10, 3, 213, 177, 25, 250, 210, 108, 250, 209, 10, 3, 213,
+ 177, 25, 230, 168, 10, 3, 213, 177, 25, 216, 233, 108, 231, 209, 199, 84,
+ 10, 3, 213, 177, 25, 214, 121, 10, 3, 213, 177, 25, 212, 130, 10, 3, 213,
+ 177, 25, 203, 113, 10, 3, 213, 177, 25, 203, 114, 108, 42, 251, 132, 10,
+ 3, 213, 177, 25, 203, 114, 108, 250, 209, 10, 3, 213, 177, 25, 203, 114,
+ 108, 250, 210, 108, 250, 209, 10, 3, 213, 177, 25, 196, 170, 108, 250,
+ 209, 10, 3, 213, 177, 25, 196, 38, 10, 3, 213, 163, 10, 3, 212, 178, 10,
+ 3, 212, 147, 10, 3, 212, 130, 10, 3, 212, 131, 220, 103, 25, 231, 200,
+ 10, 3, 212, 131, 220, 103, 25, 217, 39, 10, 3, 212, 131, 220, 103, 25,
+ 205, 169, 10, 3, 212, 131, 220, 103, 25, 205, 170, 139, 212, 131, 220,
+ 103, 25, 205, 169, 10, 3, 212, 131, 220, 103, 25, 196, 38, 10, 3, 212,
+ 131, 199, 84, 10, 3, 212, 131, 139, 212, 130, 10, 3, 212, 131, 238, 210,
+ 212, 130, 10, 3, 212, 131, 238, 210, 212, 131, 220, 103, 139, 220, 102,
+ 10, 3, 212, 125, 10, 3, 212, 126, 252, 73, 25, 250, 203, 10, 3, 212, 126,
+ 252, 73, 25, 248, 188, 10, 3, 212, 126, 252, 73, 25, 235, 82, 10, 3, 212,
+ 126, 252, 73, 25, 230, 168, 10, 3, 212, 126, 252, 73, 25, 223, 202, 230,
+ 155, 10, 3, 212, 126, 252, 73, 25, 222, 111, 10, 3, 212, 126, 252, 73,
+ 25, 173, 10, 3, 212, 126, 252, 73, 25, 214, 121, 10, 3, 212, 126, 252,
+ 73, 25, 202, 189, 10, 3, 212, 126, 252, 73, 25, 196, 169, 10, 3, 212,
+ 126, 221, 125, 25, 248, 188, 10, 3, 212, 126, 221, 125, 25, 248, 189, 66,
+ 10, 3, 168, 10, 3, 210, 210, 10, 3, 210, 166, 10, 3, 210, 137, 10, 3,
+ 209, 243, 10, 3, 209, 185, 10, 3, 209, 186, 25, 65, 10, 3, 209, 186, 25,
+ 252, 155, 10, 3, 209, 186, 25, 248, 188, 10, 3, 209, 186, 25, 248, 10,
+ 10, 3, 209, 186, 25, 71, 10, 3, 209, 186, 25, 68, 10, 3, 209, 186, 25,
+ 228, 30, 10, 3, 209, 186, 25, 66, 10, 3, 209, 186, 25, 196, 169, 10, 3,
+ 209, 186, 238, 210, 209, 185, 10, 3, 209, 121, 10, 3, 209, 122, 25, 222,
+ 91, 10, 3, 209, 122, 25, 196, 158, 10, 3, 209, 122, 25, 191, 123, 10, 3,
+ 209, 122, 211, 63, 209, 121, 10, 3, 165, 10, 3, 207, 176, 10, 3, 207, 1,
+ 10, 3, 206, 68, 10, 3, 188, 10, 3, 205, 186, 212, 116, 10, 3, 205, 185,
+ 10, 3, 205, 186, 25, 65, 10, 3, 205, 186, 25, 235, 89, 10, 3, 205, 186,
+ 25, 235, 87, 10, 3, 205, 186, 25, 140, 10, 3, 205, 186, 25, 222, 96, 10,
+ 3, 205, 186, 25, 220, 197, 10, 3, 205, 186, 25, 218, 208, 10, 3, 205,
+ 186, 25, 216, 100, 10, 3, 205, 186, 25, 212, 130, 10, 3, 205, 186, 25,
+ 205, 169, 10, 3, 205, 186, 25, 203, 79, 10, 3, 205, 186, 25, 199, 236,
+ 10, 3, 205, 186, 25, 196, 169, 10, 3, 205, 186, 25, 196, 164, 10, 3, 205,
+ 186, 25, 196, 120, 10, 3, 205, 186, 25, 196, 62, 10, 3, 205, 186, 25,
+ 196, 38, 10, 3, 205, 186, 139, 205, 185, 10, 3, 205, 186, 230, 155, 10,
+ 3, 205, 169, 10, 3, 205, 170, 220, 105, 25, 250, 207, 10, 3, 205, 136,
+ 10, 3, 205, 127, 10, 3, 203, 165, 10, 3, 203, 163, 10, 3, 203, 164, 25,
+ 65, 10, 3, 203, 164, 25, 249, 135, 10, 3, 203, 164, 25, 231, 23, 10, 3,
+ 203, 164, 25, 214, 121, 10, 3, 203, 164, 25, 203, 3, 10, 3, 203, 164, 25,
+ 197, 64, 10, 3, 203, 164, 25, 66, 10, 3, 203, 164, 25, 126, 108, 65, 10,
+ 3, 203, 161, 10, 3, 203, 159, 10, 3, 203, 131, 10, 3, 203, 113, 10, 3,
+ 203, 114, 228, 159, 10, 3, 203, 114, 139, 203, 114, 231, 232, 139, 231,
+ 232, 231, 201, 139, 231, 200, 10, 3, 203, 114, 139, 203, 114, 199, 237,
+ 139, 199, 237, 231, 201, 139, 231, 200, 10, 3, 203, 106, 10, 3, 203, 101,
+ 10, 3, 203, 97, 10, 3, 203, 96, 10, 3, 203, 93, 10, 3, 203, 79, 10, 3,
+ 203, 80, 25, 65, 10, 3, 203, 80, 25, 223, 180, 10, 3, 203, 73, 10, 3,
+ 203, 74, 25, 65, 10, 3, 203, 74, 25, 249, 115, 10, 3, 203, 74, 25, 247,
+ 242, 10, 3, 203, 74, 25, 236, 243, 10, 3, 203, 74, 25, 231, 200, 10, 3,
+ 203, 74, 25, 223, 201, 10, 3, 203, 74, 25, 223, 202, 230, 155, 10, 3,
+ 203, 74, 25, 220, 190, 10, 3, 203, 74, 25, 218, 210, 10, 3, 203, 74, 25,
+ 215, 140, 10, 3, 203, 74, 25, 205, 169, 10, 3, 203, 67, 10, 3, 203, 62,
+ 10, 3, 203, 63, 199, 84, 10, 3, 203, 63, 139, 203, 63, 247, 231, 139,
+ 247, 230, 10, 3, 203, 58, 10, 3, 203, 5, 10, 3, 203, 6, 139, 223, 93,
+ 203, 5, 10, 3, 203, 3, 10, 3, 203, 1, 10, 3, 202, 222, 10, 3, 202, 223,
+ 230, 155, 10, 3, 202, 201, 10, 3, 202, 199, 10, 3, 202, 200, 139, 202,
+ 200, 203, 3, 10, 3, 202, 191, 10, 3, 202, 189, 10, 3, 201, 4, 10, 3, 201,
+ 5, 139, 201, 4, 10, 3, 200, 216, 10, 3, 200, 215, 10, 3, 200, 213, 10, 3,
+ 200, 204, 10, 3, 200, 203, 10, 3, 200, 175, 10, 3, 200, 174, 10, 3, 190,
+ 190, 10, 3, 199, 252, 250, 193, 10, 3, 199, 252, 25, 229, 158, 10, 3,
+ 199, 252, 25, 216, 100, 10, 3, 199, 252, 230, 155, 10, 3, 199, 236, 10,
+ 3, 199, 237, 139, 199, 237, 213, 220, 139, 213, 220, 236, 223, 139, 236,
+ 222, 10, 3, 199, 237, 201, 189, 10, 3, 199, 223, 10, 3, 199, 224, 25,
+ 248, 188, 10, 3, 199, 224, 25, 230, 168, 10, 3, 199, 224, 25, 203, 113,
+ 10, 3, 199, 224, 25, 203, 5, 10, 3, 199, 224, 25, 197, 82, 10, 3, 199,
+ 224, 25, 196, 158, 10, 3, 199, 209, 10, 3, 199, 179, 10, 3, 199, 145, 10,
+ 3, 199, 146, 230, 155, 10, 3, 198, 193, 10, 3, 198, 194, 199, 84, 10, 3,
+ 198, 154, 10, 3, 198, 131, 10, 3, 198, 132, 25, 199, 209, 10, 3, 198,
+ 132, 139, 198, 131, 10, 3, 198, 132, 139, 198, 132, 231, 232, 139, 231,
+ 232, 231, 201, 139, 231, 200, 10, 3, 197, 94, 10, 3, 197, 82, 10, 3, 197,
+ 80, 10, 3, 197, 76, 10, 3, 197, 64, 10, 3, 197, 65, 139, 197, 65, 191,
+ 124, 139, 191, 123, 10, 3, 66, 10, 3, 126, 230, 168, 10, 3, 126, 126, 66,
+ 10, 3, 126, 139, 126, 210, 221, 139, 210, 221, 231, 201, 139, 231, 200,
+ 10, 3, 126, 139, 126, 200, 176, 139, 200, 175, 10, 3, 126, 139, 126, 126,
+ 207, 18, 139, 126, 207, 17, 10, 3, 196, 169, 10, 3, 196, 164, 10, 3, 196,
+ 158, 10, 3, 196, 159, 220, 190, 10, 3, 196, 159, 25, 249, 135, 10, 3,
+ 196, 159, 25, 216, 100, 10, 3, 196, 159, 25, 126, 108, 126, 108, 66, 10,
+ 3, 196, 159, 25, 126, 108, 126, 108, 126, 230, 155, 10, 3, 196, 159, 230,
+ 155, 10, 3, 196, 159, 203, 94, 10, 3, 196, 159, 203, 95, 25, 249, 135,
+ 10, 3, 196, 153, 10, 3, 196, 120, 10, 3, 196, 121, 25, 220, 104, 10, 3,
+ 196, 121, 25, 216, 233, 108, 238, 32, 10, 3, 196, 121, 25, 203, 163, 10,
+ 3, 196, 121, 25, 66, 10, 3, 196, 119, 10, 3, 196, 115, 10, 3, 196, 116,
+ 25, 222, 54, 10, 3, 196, 116, 25, 168, 10, 3, 196, 113, 10, 3, 196, 114,
+ 230, 155, 10, 3, 196, 62, 10, 3, 196, 63, 238, 210, 196, 62, 10, 3, 196,
+ 63, 203, 94, 10, 3, 196, 60, 10, 3, 196, 61, 25, 42, 108, 140, 10, 3,
+ 196, 61, 25, 42, 108, 180, 10, 3, 196, 61, 25, 251, 207, 10, 3, 196, 61,
+ 25, 140, 10, 3, 196, 61, 25, 212, 130, 10, 3, 196, 61, 25, 196, 169, 10,
+ 3, 196, 61, 25, 196, 170, 108, 250, 209, 10, 3, 196, 61, 25, 196, 170,
+ 108, 248, 188, 10, 3, 196, 59, 10, 3, 196, 56, 10, 3, 196, 55, 10, 3,
+ 196, 51, 10, 3, 196, 52, 25, 65, 10, 3, 196, 52, 25, 250, 203, 10, 3,
+ 196, 52, 25, 164, 10, 3, 196, 52, 25, 235, 75, 10, 3, 196, 52, 25, 231,
+ 240, 10, 3, 196, 52, 25, 231, 222, 10, 3, 196, 52, 25, 231, 209, 199, 84,
+ 10, 3, 196, 52, 25, 231, 200, 10, 3, 196, 52, 25, 230, 179, 10, 3, 196,
+ 52, 25, 140, 10, 3, 196, 52, 25, 223, 201, 10, 3, 196, 52, 25, 223, 180,
+ 10, 3, 196, 52, 25, 223, 62, 10, 3, 196, 52, 25, 221, 166, 10, 3, 196,
+ 52, 25, 218, 208, 10, 3, 196, 52, 25, 216, 44, 10, 3, 196, 52, 25, 168,
+ 10, 3, 196, 52, 25, 203, 113, 10, 3, 196, 52, 25, 202, 199, 10, 3, 196,
+ 52, 25, 197, 94, 10, 3, 196, 52, 25, 126, 108, 230, 168, 10, 3, 196, 52,
+ 25, 196, 158, 10, 3, 196, 52, 25, 196, 49, 10, 3, 196, 49, 10, 3, 196,
+ 50, 25, 66, 10, 3, 196, 38, 10, 3, 196, 39, 25, 65, 10, 3, 196, 39, 25,
+ 220, 232, 10, 3, 196, 39, 25, 220, 197, 10, 3, 196, 39, 25, 199, 209, 10,
+ 3, 196, 34, 10, 3, 196, 37, 10, 3, 196, 35, 10, 3, 196, 31, 10, 3, 196,
+ 16, 10, 3, 196, 17, 25, 222, 54, 10, 3, 196, 14, 10, 3, 191, 123, 10, 3,
+ 191, 124, 199, 84, 10, 3, 191, 124, 112, 25, 220, 197, 10, 3, 191, 118,
+ 10, 3, 191, 107, 10, 3, 191, 86, 10, 3, 191, 30, 10, 3, 191, 31, 139,
+ 191, 30, 10, 3, 191, 29, 10, 3, 191, 27, 10, 3, 191, 28, 222, 116, 199,
+ 84, 10, 3, 191, 22, 10, 3, 191, 13, 10, 3, 190, 251, 10, 3, 190, 249, 10,
+ 3, 190, 250, 25, 65, 10, 3, 190, 248, 10, 3, 190, 247, 10, 3, 222, 79,
+ 234, 137, 10, 3, 252, 156, 25, 212, 130, 10, 3, 252, 73, 25, 65, 10, 3,
+ 251, 146, 25, 220, 213, 10, 3, 238, 23, 221, 125, 25, 196, 170, 108, 217,
+ 39, 10, 3, 238, 21, 10, 3, 236, 223, 108, 203, 5, 10, 3, 235, 88, 25,
+ 203, 113, 10, 3, 233, 181, 25, 230, 168, 10, 3, 233, 181, 25, 203, 113,
+ 10, 3, 231, 239, 25, 251, 133, 108, 222, 97, 108, 65, 10, 3, 231, 239,
+ 25, 250, 207, 10, 3, 231, 164, 10, 3, 231, 42, 10, 3, 228, 131, 10, 3,
+ 222, 142, 25, 251, 91, 10, 3, 222, 142, 25, 250, 206, 10, 3, 222, 142,
+ 25, 231, 23, 10, 3, 222, 142, 25, 230, 168, 10, 3, 222, 142, 25, 229,
+ 159, 25, 250, 207, 10, 3, 222, 142, 25, 218, 208, 10, 3, 222, 142, 25,
+ 168, 10, 3, 222, 142, 25, 202, 253, 10, 3, 222, 142, 25, 197, 94, 10, 3,
+ 222, 142, 25, 196, 60, 10, 3, 220, 105, 25, 231, 53, 10, 3, 218, 224,
+ 203, 95, 25, 249, 135, 10, 3, 218, 224, 25, 234, 10, 108, 220, 37, 10, 3,
+ 218, 224, 25, 203, 5, 10, 3, 216, 172, 10, 3, 215, 100, 25, 191, 123, 10,
+ 3, 214, 252, 10, 3, 213, 179, 10, 3, 213, 178, 10, 3, 213, 177, 25, 249,
+ 115, 10, 3, 213, 177, 25, 231, 53, 10, 3, 212, 148, 206, 122, 213, 170,
+ 237, 124, 10, 3, 209, 244, 250, 193, 10, 3, 209, 125, 10, 3, 205, 186,
+ 25, 223, 202, 230, 155, 10, 3, 198, 185, 10, 3, 196, 121, 25, 216, 232,
+ 10, 3, 126, 66, 10, 167, 3, 105, 250, 209, 10, 167, 3, 115, 250, 209, 10,
+ 167, 3, 232, 128, 250, 209, 10, 167, 3, 232, 226, 250, 209, 10, 167, 3,
+ 202, 136, 250, 209, 10, 167, 3, 203, 247, 250, 209, 10, 167, 3, 234, 164,
+ 250, 209, 10, 167, 3, 213, 175, 250, 209, 10, 167, 3, 115, 236, 222, 10,
+ 167, 3, 232, 128, 236, 222, 10, 167, 3, 232, 226, 236, 222, 10, 167, 3,
+ 202, 136, 236, 222, 10, 167, 3, 203, 247, 236, 222, 10, 167, 3, 234, 164,
+ 236, 222, 10, 167, 3, 213, 175, 236, 222, 10, 167, 3, 232, 128, 66, 10,
+ 167, 3, 232, 226, 66, 10, 167, 3, 202, 136, 66, 10, 167, 3, 203, 247, 66,
+ 10, 167, 3, 234, 164, 66, 10, 167, 3, 213, 175, 66, 10, 167, 3, 91, 231,
+ 136, 10, 167, 3, 105, 231, 136, 10, 167, 3, 115, 231, 136, 10, 167, 3,
+ 232, 128, 231, 136, 10, 167, 3, 232, 226, 231, 136, 10, 167, 3, 202, 136,
+ 231, 136, 10, 167, 3, 203, 247, 231, 136, 10, 167, 3, 234, 164, 231, 136,
+ 10, 167, 3, 213, 175, 231, 136, 10, 167, 3, 91, 231, 133, 10, 167, 3,
+ 105, 231, 133, 10, 167, 3, 115, 231, 133, 10, 167, 3, 232, 128, 231, 133,
+ 10, 167, 3, 232, 226, 231, 133, 10, 167, 3, 105, 203, 131, 10, 167, 3,
+ 115, 203, 131, 10, 167, 3, 115, 203, 132, 195, 168, 20, 10, 167, 3, 232,
+ 128, 203, 131, 10, 167, 3, 232, 226, 203, 131, 10, 167, 3, 202, 136, 203,
+ 131, 10, 167, 3, 203, 247, 203, 131, 10, 167, 3, 234, 164, 203, 131, 10,
+ 167, 3, 213, 175, 203, 131, 10, 167, 3, 91, 203, 124, 10, 167, 3, 105,
+ 203, 124, 10, 167, 3, 115, 203, 124, 10, 167, 3, 115, 203, 125, 195, 168,
+ 20, 10, 167, 3, 232, 128, 203, 124, 10, 167, 3, 232, 226, 203, 124, 10,
+ 167, 3, 203, 132, 25, 231, 223, 108, 236, 222, 10, 167, 3, 203, 132, 25,
+ 231, 223, 108, 216, 44, 10, 167, 3, 91, 247, 226, 10, 167, 3, 105, 247,
+ 226, 10, 167, 3, 115, 247, 226, 10, 167, 3, 115, 247, 227, 195, 168, 20,
+ 10, 167, 3, 232, 128, 247, 226, 10, 167, 3, 232, 226, 247, 226, 10, 167,
+ 3, 115, 195, 168, 232, 146, 234, 11, 10, 167, 3, 115, 195, 168, 232, 146,
+ 234, 8, 10, 167, 3, 232, 128, 195, 168, 232, 146, 219, 116, 10, 167, 3,
+ 232, 128, 195, 168, 232, 146, 219, 114, 10, 167, 3, 232, 128, 195, 168,
+ 232, 146, 219, 117, 65, 10, 167, 3, 232, 128, 195, 168, 232, 146, 219,
+ 117, 250, 120, 10, 167, 3, 202, 136, 195, 168, 232, 146, 250, 205, 10,
+ 167, 3, 203, 247, 195, 168, 232, 146, 223, 171, 10, 167, 3, 203, 247,
+ 195, 168, 232, 146, 223, 173, 65, 10, 167, 3, 203, 247, 195, 168, 232,
+ 146, 223, 173, 250, 120, 10, 167, 3, 234, 164, 195, 168, 232, 146, 196,
+ 33, 10, 167, 3, 234, 164, 195, 168, 232, 146, 196, 32, 10, 167, 3, 213,
+ 175, 195, 168, 232, 146, 223, 188, 10, 167, 3, 213, 175, 195, 168, 232,
+ 146, 223, 187, 10, 167, 3, 213, 175, 195, 168, 232, 146, 223, 186, 10,
+ 167, 3, 213, 175, 195, 168, 232, 146, 223, 189, 65, 10, 167, 3, 105, 250,
+ 210, 199, 84, 10, 167, 3, 115, 250, 210, 199, 84, 10, 167, 3, 232, 128,
+ 250, 210, 199, 84, 10, 167, 3, 232, 226, 250, 210, 199, 84, 10, 167, 3,
+ 202, 136, 250, 210, 199, 84, 10, 167, 3, 91, 249, 99, 10, 167, 3, 105,
+ 249, 99, 10, 167, 3, 115, 249, 99, 10, 167, 3, 232, 128, 249, 99, 10,
+ 167, 3, 232, 128, 249, 100, 195, 168, 20, 10, 167, 3, 232, 226, 249, 99,
+ 10, 167, 3, 232, 226, 249, 100, 195, 168, 20, 10, 167, 3, 213, 188, 10,
+ 167, 3, 213, 189, 10, 167, 3, 91, 234, 7, 10, 167, 3, 105, 234, 7, 10,
+ 167, 3, 91, 199, 1, 236, 222, 10, 167, 3, 105, 198, 254, 236, 222, 10,
+ 167, 3, 232, 226, 202, 123, 236, 222, 10, 167, 3, 91, 199, 1, 195, 168,
+ 232, 146, 65, 10, 167, 3, 105, 198, 254, 195, 168, 232, 146, 65, 10, 167,
+ 3, 91, 234, 160, 250, 209, 10, 167, 3, 91, 208, 23, 250, 209, 10, 167, 3,
+ 39, 250, 196, 91, 202, 124, 10, 167, 3, 39, 250, 196, 91, 208, 22, 10,
+ 167, 3, 91, 208, 23, 230, 149, 10, 167, 3, 91, 132, 230, 149, 10, 167, 3,
+ 234, 138, 91, 199, 0, 10, 167, 3, 234, 138, 105, 198, 253, 10, 167, 3,
+ 234, 138, 232, 135, 10, 167, 3, 234, 138, 233, 15, 10, 167, 3, 232, 128,
+ 126, 195, 168, 20, 10, 167, 3, 232, 226, 126, 195, 168, 20, 10, 167, 3,
+ 202, 136, 126, 195, 168, 20, 10, 167, 3, 203, 247, 126, 195, 168, 20, 10,
+ 167, 3, 234, 164, 126, 195, 168, 20, 10, 167, 3, 213, 175, 126, 195, 168,
+ 20, 10, 208, 152, 3, 39, 250, 196, 193, 23, 236, 205, 10, 208, 152, 3,
+ 81, 242, 83, 10, 208, 152, 3, 237, 39, 242, 83, 10, 208, 152, 3, 237, 39,
+ 197, 237, 10, 208, 152, 3, 237, 39, 208, 29, 10, 3, 252, 156, 25, 212,
+ 131, 199, 84, 10, 3, 252, 156, 25, 203, 3, 10, 3, 252, 43, 25, 234, 9,
+ 10, 3, 249, 136, 25, 236, 223, 199, 84, 10, 3, 249, 122, 25, 252, 72, 10,
+ 3, 249, 122, 25, 213, 219, 10, 3, 249, 122, 25, 191, 123, 10, 3, 248, 11,
+ 139, 248, 11, 25, 214, 253, 10, 3, 238, 33, 25, 199, 209, 10, 3, 238, 23,
+ 25, 220, 197, 10, 3, 237, 0, 25, 223, 201, 10, 3, 237, 0, 25, 126, 126,
+ 66, 10, 3, 236, 254, 25, 196, 158, 10, 3, 235, 83, 25, 251, 91, 10, 3,
+ 235, 83, 25, 250, 209, 10, 3, 235, 83, 25, 250, 210, 250, 183, 219, 224,
+ 10, 3, 235, 83, 25, 236, 243, 10, 3, 235, 83, 25, 235, 75, 10, 3, 235,
+ 83, 25, 234, 28, 10, 3, 235, 83, 25, 231, 240, 10, 3, 235, 83, 25, 231,
+ 53, 10, 3, 235, 83, 25, 231, 33, 230, 155, 10, 3, 235, 83, 25, 231, 23,
+ 10, 3, 235, 83, 25, 140, 10, 3, 235, 83, 25, 229, 158, 10, 3, 235, 83,
+ 25, 223, 202, 230, 155, 10, 3, 235, 83, 25, 222, 54, 10, 3, 235, 83, 25,
+ 220, 197, 10, 3, 235, 83, 25, 220, 190, 10, 3, 235, 83, 25, 220, 191,
+ 108, 222, 54, 10, 3, 235, 83, 25, 220, 92, 10, 3, 235, 83, 25, 220, 35,
+ 10, 3, 235, 83, 25, 220, 36, 25, 220, 197, 10, 3, 235, 83, 25, 218, 214,
+ 108, 231, 23, 10, 3, 235, 83, 25, 217, 39, 10, 3, 235, 83, 25, 216, 173,
+ 10, 3, 235, 83, 25, 216, 100, 10, 3, 235, 83, 25, 213, 219, 10, 3, 235,
+ 83, 25, 209, 185, 10, 3, 235, 83, 25, 203, 113, 10, 3, 235, 83, 25, 202,
+ 223, 230, 155, 10, 3, 234, 219, 25, 220, 197, 10, 3, 234, 219, 25, 210,
+ 137, 10, 3, 234, 29, 192, 235, 10, 3, 234, 10, 238, 210, 234, 9, 10, 3,
+ 233, 181, 203, 95, 25, 250, 209, 10, 3, 233, 181, 203, 95, 25, 229, 158,
+ 10, 3, 233, 181, 203, 95, 25, 223, 202, 230, 155, 10, 3, 233, 181, 203,
+ 95, 25, 173, 10, 3, 233, 181, 203, 95, 25, 220, 37, 10, 3, 233, 181, 203,
+ 95, 25, 216, 232, 10, 3, 233, 181, 203, 95, 25, 216, 173, 10, 3, 233,
+ 181, 203, 95, 25, 201, 4, 10, 3, 233, 181, 25, 201, 4, 10, 3, 231, 239,
+ 25, 249, 121, 10, 3, 231, 239, 25, 237, 0, 230, 155, 10, 3, 231, 239, 25,
+ 235, 83, 25, 223, 202, 230, 155, 10, 3, 231, 239, 25, 235, 83, 25, 222,
+ 54, 10, 3, 231, 239, 25, 234, 31, 10, 3, 231, 239, 25, 231, 240, 10, 3,
+ 231, 239, 25, 231, 201, 108, 237, 44, 10, 3, 231, 239, 25, 231, 201, 108,
+ 214, 121, 10, 3, 231, 239, 25, 230, 105, 108, 65, 10, 3, 231, 239, 25,
+ 220, 191, 108, 222, 54, 10, 3, 231, 239, 25, 220, 35, 10, 3, 231, 239,
+ 25, 220, 36, 25, 220, 197, 10, 3, 231, 239, 25, 218, 213, 10, 3, 231,
+ 239, 25, 215, 101, 10, 3, 231, 239, 25, 214, 121, 10, 3, 231, 239, 25,
+ 214, 122, 108, 234, 218, 10, 3, 231, 239, 25, 214, 122, 108, 231, 53, 10,
+ 3, 231, 239, 25, 203, 73, 10, 3, 231, 239, 25, 191, 13, 10, 3, 231, 234,
+ 206, 122, 213, 170, 237, 124, 10, 3, 231, 135, 25, 66, 10, 3, 231, 24,
+ 25, 231, 24, 238, 210, 231, 23, 10, 3, 230, 178, 25, 223, 202, 230, 155,
+ 10, 3, 230, 169, 108, 231, 24, 25, 199, 209, 10, 3, 230, 105, 199, 85,
+ 230, 155, 10, 3, 229, 159, 25, 250, 210, 139, 229, 159, 25, 250, 209, 10,
+ 3, 222, 142, 25, 248, 10, 10, 3, 222, 142, 25, 155, 10, 3, 222, 142, 25,
+ 126, 126, 66, 10, 3, 222, 142, 25, 196, 62, 10, 3, 220, 105, 25, 190,
+ 252, 139, 190, 251, 10, 3, 220, 93, 10, 3, 220, 91, 10, 3, 220, 90, 10,
+ 3, 220, 89, 10, 3, 220, 88, 10, 3, 220, 87, 10, 3, 220, 86, 10, 3, 220,
+ 85, 139, 220, 85, 230, 155, 10, 3, 220, 84, 10, 3, 220, 83, 139, 220, 82,
+ 10, 3, 220, 81, 10, 3, 220, 80, 10, 3, 220, 79, 10, 3, 220, 78, 10, 3,
+ 220, 77, 10, 3, 220, 76, 10, 3, 220, 75, 10, 3, 220, 74, 10, 3, 220, 73,
+ 10, 3, 220, 72, 10, 3, 220, 71, 10, 3, 220, 70, 10, 3, 220, 69, 10, 3,
+ 220, 68, 10, 3, 220, 67, 10, 3, 220, 66, 10, 3, 220, 65, 10, 3, 220, 64,
+ 10, 3, 220, 62, 10, 3, 220, 63, 25, 230, 179, 10, 3, 220, 63, 25, 223,
+ 201, 10, 3, 220, 63, 25, 210, 138, 108, 218, 222, 10, 3, 220, 63, 25,
+ 210, 138, 108, 210, 138, 108, 218, 222, 10, 3, 220, 63, 25, 196, 170,
+ 108, 249, 153, 10, 3, 220, 61, 10, 3, 220, 60, 10, 3, 220, 59, 10, 3,
+ 220, 58, 10, 3, 220, 57, 10, 3, 220, 56, 10, 3, 220, 55, 10, 3, 220, 54,
+ 10, 3, 220, 53, 10, 3, 220, 52, 10, 3, 220, 50, 10, 3, 220, 51, 25, 250,
+ 209, 10, 3, 220, 51, 25, 249, 135, 10, 3, 220, 51, 25, 235, 74, 230, 156,
+ 230, 155, 10, 3, 220, 51, 25, 220, 223, 10, 3, 220, 51, 25, 173, 10, 3,
+ 220, 51, 25, 199, 179, 10, 3, 220, 51, 25, 199, 145, 10, 3, 220, 51, 25,
+ 196, 169, 10, 3, 220, 51, 25, 196, 158, 10, 3, 220, 51, 25, 196, 49, 10,
+ 3, 220, 49, 10, 3, 220, 47, 10, 3, 220, 48, 25, 235, 87, 10, 3, 220, 48,
+ 25, 231, 240, 10, 3, 220, 48, 25, 223, 201, 10, 3, 220, 48, 25, 223, 202,
+ 230, 155, 10, 3, 220, 48, 25, 213, 219, 10, 3, 220, 48, 25, 210, 138,
+ 108, 210, 138, 108, 218, 222, 10, 3, 220, 48, 25, 203, 98, 108, 221, 166,
+ 10, 3, 220, 48, 25, 196, 158, 10, 3, 220, 48, 25, 196, 49, 10, 3, 220,
+ 45, 10, 3, 220, 44, 10, 3, 218, 224, 230, 156, 25, 250, 209, 10, 3, 218,
+ 224, 25, 236, 222, 10, 3, 218, 224, 25, 230, 73, 10, 3, 218, 224, 25,
+ 210, 137, 10, 3, 218, 224, 25, 210, 138, 108, 210, 138, 108, 218, 222,
+ 10, 3, 218, 224, 25, 199, 209, 10, 3, 216, 101, 108, 191, 122, 10, 3,
+ 215, 102, 139, 215, 102, 25, 231, 240, 10, 3, 215, 102, 139, 215, 102,
+ 25, 222, 96, 10, 3, 213, 177, 25, 237, 0, 230, 155, 10, 3, 213, 177, 25,
+ 231, 23, 10, 3, 213, 177, 25, 230, 160, 10, 3, 213, 177, 25, 229, 158,
+ 10, 3, 213, 177, 25, 221, 242, 10, 3, 213, 177, 25, 220, 88, 10, 3, 213,
+ 177, 25, 217, 39, 10, 3, 213, 177, 25, 210, 138, 108, 210, 137, 10, 3,
+ 213, 177, 25, 66, 10, 3, 213, 177, 25, 126, 108, 66, 10, 3, 213, 177, 25,
+ 196, 49, 10, 3, 205, 186, 230, 156, 25, 140, 10, 3, 205, 186, 25, 234,
+ 103, 10, 3, 205, 186, 25, 203, 114, 250, 183, 219, 224, 10, 3, 205, 186,
+ 25, 199, 209, 10, 3, 203, 162, 199, 84, 10, 3, 203, 114, 139, 203, 113,
+ 10, 3, 203, 114, 108, 228, 151, 10, 3, 203, 114, 108, 214, 229, 10, 3,
+ 203, 114, 108, 205, 127, 10, 3, 203, 4, 108, 235, 83, 25, 213, 219, 10,
+ 3, 203, 4, 108, 234, 219, 25, 251, 132, 10, 3, 202, 223, 25, 199, 209,
+ 10, 3, 199, 210, 108, 205, 185, 10, 3, 197, 77, 25, 231, 209, 199, 84,
+ 10, 3, 197, 77, 25, 115, 236, 222, 10, 3, 196, 61, 223, 92, 10, 3, 196,
+ 61, 25, 196, 158, 10, 3, 196, 52, 25, 237, 224, 10, 3, 196, 52, 25, 220,
+ 46, 10, 3, 196, 52, 25, 218, 222, 10, 3, 191, 122, 10, 3, 190, 252, 139,
+ 190, 252, 108, 205, 127, 10, 3, 190, 250, 25, 115, 236, 223, 199, 84,
+ 238, 134, 3, 242, 198, 238, 134, 3, 242, 197, 238, 134, 3, 242, 196, 238,
+ 134, 3, 242, 195, 238, 134, 3, 242, 194, 238, 134, 3, 242, 193, 238, 134,
+ 3, 242, 192, 238, 134, 3, 242, 191, 238, 134, 3, 242, 190, 238, 134, 3,
+ 242, 189, 238, 134, 3, 242, 188, 238, 134, 3, 242, 187, 238, 134, 3, 242,
+ 186, 238, 134, 3, 242, 185, 238, 134, 3, 242, 184, 238, 134, 3, 242, 183,
+ 238, 134, 3, 242, 182, 238, 134, 3, 242, 181, 238, 134, 3, 242, 180, 238,
+ 134, 3, 242, 179, 238, 134, 3, 242, 178, 238, 134, 3, 242, 177, 238, 134,
+ 3, 242, 176, 238, 134, 3, 242, 175, 238, 134, 3, 242, 174, 238, 134, 3,
+ 242, 173, 238, 134, 3, 242, 172, 238, 134, 3, 242, 171, 238, 134, 3, 242,
+ 170, 238, 134, 3, 242, 169, 238, 134, 3, 242, 168, 238, 134, 3, 242, 167,
+ 238, 134, 3, 242, 166, 238, 134, 3, 242, 165, 238, 134, 3, 242, 164, 238,
+ 134, 3, 242, 163, 238, 134, 3, 242, 162, 238, 134, 3, 242, 161, 238, 134,
+ 3, 242, 160, 238, 134, 3, 242, 159, 238, 134, 3, 242, 158, 238, 134, 3,
+ 242, 157, 238, 134, 3, 242, 156, 238, 134, 3, 242, 155, 238, 134, 3, 242,
+ 154, 238, 134, 3, 242, 153, 238, 134, 3, 242, 152, 238, 134, 3, 242, 151,
+ 238, 134, 3, 242, 150, 238, 134, 3, 242, 149, 238, 134, 3, 242, 148, 238,
+ 134, 3, 242, 147, 238, 134, 3, 242, 146, 238, 134, 3, 242, 145, 238, 134,
+ 3, 242, 144, 238, 134, 3, 242, 143, 238, 134, 3, 242, 142, 238, 134, 3,
+ 242, 141, 238, 134, 3, 242, 140, 238, 134, 3, 242, 139, 238, 134, 3, 242,
+ 138, 238, 134, 3, 242, 137, 238, 134, 3, 242, 136, 238, 134, 3, 242, 135,
+ 238, 134, 3, 242, 134, 238, 134, 3, 242, 133, 238, 134, 3, 242, 132, 238,
+ 134, 3, 242, 131, 238, 134, 3, 242, 130, 238, 134, 3, 242, 129, 238, 134,
+ 3, 242, 128, 238, 134, 3, 242, 127, 238, 134, 3, 242, 126, 238, 134, 3,
+ 242, 125, 238, 134, 3, 242, 124, 238, 134, 3, 242, 123, 238, 134, 3, 242,
+ 122, 238, 134, 3, 242, 121, 238, 134, 3, 242, 120, 238, 134, 3, 242, 119,
+ 238, 134, 3, 242, 118, 238, 134, 3, 242, 117, 238, 134, 3, 242, 116, 238,
+ 134, 3, 242, 115, 238, 134, 3, 242, 114, 238, 134, 3, 242, 113, 238, 134,
+ 3, 242, 112, 238, 134, 3, 242, 111, 238, 134, 3, 242, 110, 238, 134, 3,
+ 242, 109, 238, 134, 3, 242, 108, 238, 134, 3, 242, 107, 238, 134, 3, 242,
+ 106, 238, 134, 3, 242, 105, 238, 134, 3, 242, 104, 238, 134, 3, 242, 103,
+ 238, 134, 3, 242, 102, 238, 134, 3, 242, 101, 238, 134, 3, 242, 100, 14,
+ 7, 255, 199, 14, 7, 255, 198, 14, 7, 255, 197, 14, 7, 255, 196, 14, 7,
+ 255, 195, 14, 7, 255, 194, 14, 7, 255, 193, 14, 7, 255, 192, 14, 7, 255,
+ 191, 14, 7, 255, 190, 14, 7, 255, 189, 14, 7, 255, 188, 14, 7, 255, 187,
+ 14, 7, 255, 185, 14, 7, 255, 184, 14, 7, 255, 183, 14, 7, 255, 182, 14,
+ 7, 255, 181, 14, 7, 255, 180, 14, 7, 255, 179, 14, 7, 255, 178, 14, 7,
+ 255, 177, 14, 7, 255, 176, 14, 7, 255, 175, 14, 7, 255, 174, 14, 7, 255,
+ 173, 14, 7, 255, 172, 14, 7, 255, 171, 14, 7, 255, 170, 14, 7, 255, 169,
+ 14, 7, 255, 168, 14, 7, 255, 166, 14, 7, 255, 165, 14, 7, 255, 163, 14,
+ 7, 255, 162, 14, 7, 255, 161, 14, 7, 255, 160, 14, 7, 255, 159, 14, 7,
+ 255, 158, 14, 7, 255, 157, 14, 7, 255, 156, 14, 7, 255, 155, 14, 7, 255,
+ 154, 14, 7, 255, 153, 14, 7, 255, 152, 14, 7, 255, 150, 14, 7, 255, 149,
+ 14, 7, 255, 148, 14, 7, 255, 146, 14, 7, 255, 145, 14, 7, 255, 144, 14,
+ 7, 255, 143, 14, 7, 255, 142, 14, 7, 255, 141, 14, 7, 255, 140, 14, 7,
+ 255, 139, 14, 7, 255, 136, 14, 7, 255, 135, 14, 7, 255, 134, 14, 7, 255,
+ 133, 14, 7, 255, 132, 14, 7, 255, 131, 14, 7, 255, 130, 14, 7, 255, 129,
+ 14, 7, 255, 128, 14, 7, 255, 127, 14, 7, 255, 126, 14, 7, 255, 125, 14,
+ 7, 255, 124, 14, 7, 255, 123, 14, 7, 255, 122, 14, 7, 255, 121, 14, 7,
+ 255, 120, 14, 7, 255, 119, 14, 7, 255, 118, 14, 7, 255, 117, 14, 7, 255,
+ 113, 14, 7, 255, 112, 14, 7, 255, 111, 14, 7, 255, 110, 14, 7, 250, 118,
+ 14, 7, 250, 116, 14, 7, 250, 114, 14, 7, 250, 112, 14, 7, 250, 110, 14,
+ 7, 250, 109, 14, 7, 250, 107, 14, 7, 250, 105, 14, 7, 250, 103, 14, 7,
+ 250, 101, 14, 7, 247, 189, 14, 7, 247, 188, 14, 7, 247, 187, 14, 7, 247,
+ 186, 14, 7, 247, 185, 14, 7, 247, 184, 14, 7, 247, 183, 14, 7, 247, 182,
+ 14, 7, 247, 181, 14, 7, 247, 180, 14, 7, 247, 179, 14, 7, 247, 178, 14,
+ 7, 247, 177, 14, 7, 247, 176, 14, 7, 247, 175, 14, 7, 247, 174, 14, 7,
+ 247, 173, 14, 7, 247, 172, 14, 7, 247, 171, 14, 7, 247, 170, 14, 7, 247,
+ 169, 14, 7, 247, 168, 14, 7, 247, 167, 14, 7, 247, 166, 14, 7, 247, 165,
+ 14, 7, 247, 164, 14, 7, 247, 163, 14, 7, 247, 162, 14, 7, 238, 126, 14,
+ 7, 238, 125, 14, 7, 238, 124, 14, 7, 238, 123, 14, 7, 238, 122, 14, 7,
+ 238, 121, 14, 7, 238, 120, 14, 7, 238, 119, 14, 7, 238, 118, 14, 7, 238,
+ 117, 14, 7, 238, 116, 14, 7, 238, 115, 14, 7, 238, 114, 14, 7, 238, 113,
+ 14, 7, 238, 112, 14, 7, 238, 111, 14, 7, 238, 110, 14, 7, 238, 109, 14,
+ 7, 238, 108, 14, 7, 238, 107, 14, 7, 238, 106, 14, 7, 238, 105, 14, 7,
+ 238, 104, 14, 7, 238, 103, 14, 7, 238, 102, 14, 7, 238, 101, 14, 7, 238,
+ 100, 14, 7, 238, 99, 14, 7, 238, 98, 14, 7, 238, 97, 14, 7, 238, 96, 14,
+ 7, 238, 95, 14, 7, 238, 94, 14, 7, 238, 93, 14, 7, 238, 92, 14, 7, 238,
+ 91, 14, 7, 238, 90, 14, 7, 238, 89, 14, 7, 238, 88, 14, 7, 238, 87, 14,
+ 7, 238, 86, 14, 7, 238, 85, 14, 7, 238, 84, 14, 7, 238, 83, 14, 7, 238,
+ 82, 14, 7, 238, 81, 14, 7, 238, 80, 14, 7, 238, 79, 14, 7, 238, 78, 14,
+ 7, 238, 77, 14, 7, 238, 76, 14, 7, 238, 75, 14, 7, 238, 74, 14, 7, 238,
+ 73, 14, 7, 238, 72, 14, 7, 238, 71, 14, 7, 238, 70, 14, 7, 238, 69, 14,
+ 7, 238, 68, 14, 7, 238, 67, 14, 7, 238, 66, 14, 7, 238, 65, 14, 7, 238,
+ 64, 14, 7, 238, 63, 14, 7, 238, 62, 14, 7, 238, 61, 14, 7, 238, 60, 14,
+ 7, 238, 59, 14, 7, 238, 58, 14, 7, 238, 57, 14, 7, 238, 56, 14, 7, 238,
+ 55, 14, 7, 238, 54, 14, 7, 238, 53, 14, 7, 238, 52, 14, 7, 238, 51, 14,
+ 7, 238, 50, 14, 7, 238, 49, 14, 7, 238, 48, 14, 7, 238, 47, 14, 7, 238,
+ 46, 14, 7, 238, 45, 14, 7, 238, 44, 14, 7, 238, 43, 14, 7, 238, 42, 14,
+ 7, 238, 41, 14, 7, 238, 40, 14, 7, 238, 39, 14, 7, 238, 38, 14, 7, 238,
+ 37, 14, 7, 238, 36, 14, 7, 238, 35, 14, 7, 235, 7, 14, 7, 235, 6, 14, 7,
+ 235, 5, 14, 7, 235, 4, 14, 7, 235, 3, 14, 7, 235, 2, 14, 7, 235, 1, 14,
+ 7, 235, 0, 14, 7, 234, 255, 14, 7, 234, 254, 14, 7, 234, 253, 14, 7, 234,
+ 252, 14, 7, 234, 251, 14, 7, 234, 250, 14, 7, 234, 249, 14, 7, 234, 248,
+ 14, 7, 234, 247, 14, 7, 234, 246, 14, 7, 234, 245, 14, 7, 234, 244, 14,
+ 7, 234, 243, 14, 7, 234, 242, 14, 7, 234, 241, 14, 7, 234, 240, 14, 7,
+ 234, 239, 14, 7, 234, 238, 14, 7, 234, 237, 14, 7, 234, 236, 14, 7, 234,
+ 235, 14, 7, 234, 234, 14, 7, 234, 233, 14, 7, 234, 232, 14, 7, 234, 231,
+ 14, 7, 234, 230, 14, 7, 234, 229, 14, 7, 234, 228, 14, 7, 234, 227, 14,
+ 7, 234, 226, 14, 7, 234, 225, 14, 7, 234, 224, 14, 7, 234, 223, 14, 7,
+ 234, 222, 14, 7, 234, 221, 14, 7, 234, 220, 14, 7, 233, 174, 14, 7, 233,
+ 173, 14, 7, 233, 172, 14, 7, 233, 171, 14, 7, 233, 170, 14, 7, 233, 169,
+ 14, 7, 233, 168, 14, 7, 233, 167, 14, 7, 233, 166, 14, 7, 233, 165, 14,
+ 7, 233, 164, 14, 7, 233, 163, 14, 7, 233, 162, 14, 7, 233, 161, 14, 7,
+ 233, 160, 14, 7, 233, 159, 14, 7, 233, 158, 14, 7, 233, 157, 14, 7, 233,
+ 156, 14, 7, 233, 155, 14, 7, 233, 154, 14, 7, 233, 153, 14, 7, 233, 152,
+ 14, 7, 233, 151, 14, 7, 233, 150, 14, 7, 233, 149, 14, 7, 233, 148, 14,
+ 7, 233, 147, 14, 7, 233, 146, 14, 7, 233, 145, 14, 7, 233, 144, 14, 7,
+ 233, 143, 14, 7, 233, 142, 14, 7, 233, 141, 14, 7, 233, 140, 14, 7, 233,
+ 139, 14, 7, 233, 138, 14, 7, 233, 137, 14, 7, 233, 136, 14, 7, 233, 135,
+ 14, 7, 233, 134, 14, 7, 233, 133, 14, 7, 233, 132, 14, 7, 233, 131, 14,
+ 7, 233, 130, 14, 7, 233, 129, 14, 7, 233, 128, 14, 7, 233, 127, 14, 7,
+ 233, 126, 14, 7, 233, 125, 14, 7, 233, 124, 14, 7, 233, 123, 14, 7, 233,
+ 122, 14, 7, 233, 121, 14, 7, 233, 120, 14, 7, 233, 119, 14, 7, 233, 118,
+ 14, 7, 233, 117, 14, 7, 233, 116, 14, 7, 233, 115, 14, 7, 233, 114, 14,
+ 7, 233, 113, 14, 7, 233, 112, 14, 7, 233, 111, 14, 7, 233, 110, 14, 7,
+ 232, 50, 14, 7, 232, 49, 14, 7, 232, 48, 14, 7, 232, 47, 14, 7, 232, 46,
+ 14, 7, 232, 45, 14, 7, 232, 44, 14, 7, 232, 43, 14, 7, 232, 42, 14, 7,
+ 232, 41, 14, 7, 232, 40, 14, 7, 232, 39, 14, 7, 232, 38, 14, 7, 232, 37,
+ 14, 7, 232, 36, 14, 7, 232, 35, 14, 7, 232, 34, 14, 7, 232, 33, 14, 7,
+ 232, 32, 14, 7, 232, 31, 14, 7, 232, 30, 14, 7, 232, 29, 14, 7, 232, 28,
+ 14, 7, 232, 27, 14, 7, 232, 26, 14, 7, 232, 25, 14, 7, 232, 24, 14, 7,
+ 232, 23, 14, 7, 232, 22, 14, 7, 232, 21, 14, 7, 232, 20, 14, 7, 232, 19,
+ 14, 7, 232, 18, 14, 7, 232, 17, 14, 7, 232, 16, 14, 7, 232, 15, 14, 7,
+ 232, 14, 14, 7, 232, 13, 14, 7, 232, 12, 14, 7, 232, 11, 14, 7, 232, 10,
+ 14, 7, 232, 9, 14, 7, 232, 8, 14, 7, 232, 7, 14, 7, 232, 6, 14, 7, 232,
+ 5, 14, 7, 232, 4, 14, 7, 232, 3, 14, 7, 232, 2, 14, 7, 232, 1, 14, 7,
+ 232, 0, 14, 7, 231, 255, 14, 7, 231, 254, 14, 7, 231, 253, 14, 7, 231,
+ 252, 14, 7, 231, 251, 14, 7, 231, 250, 14, 7, 231, 249, 14, 7, 231, 248,
+ 14, 7, 231, 247, 14, 7, 231, 246, 14, 7, 231, 245, 14, 7, 231, 244, 14,
+ 7, 231, 243, 14, 7, 230, 114, 14, 7, 230, 113, 14, 7, 230, 112, 14, 7,
+ 230, 111, 14, 7, 230, 110, 14, 7, 230, 109, 14, 7, 230, 108, 14, 7, 230,
+ 107, 14, 7, 230, 106, 14, 7, 228, 54, 14, 7, 228, 53, 14, 7, 228, 52, 14,
+ 7, 228, 51, 14, 7, 228, 50, 14, 7, 228, 49, 14, 7, 228, 48, 14, 7, 228,
+ 47, 14, 7, 228, 46, 14, 7, 228, 45, 14, 7, 228, 44, 14, 7, 228, 43, 14,
+ 7, 228, 42, 14, 7, 228, 41, 14, 7, 228, 40, 14, 7, 228, 39, 14, 7, 228,
+ 38, 14, 7, 228, 37, 14, 7, 228, 36, 14, 7, 222, 151, 14, 7, 222, 150, 14,
+ 7, 222, 149, 14, 7, 222, 148, 14, 7, 222, 147, 14, 7, 222, 146, 14, 7,
+ 222, 145, 14, 7, 222, 144, 14, 7, 220, 140, 14, 7, 220, 139, 14, 7, 220,
+ 138, 14, 7, 220, 137, 14, 7, 220, 136, 14, 7, 220, 135, 14, 7, 220, 134,
+ 14, 7, 220, 133, 14, 7, 220, 132, 14, 7, 220, 131, 14, 7, 218, 166, 14,
+ 7, 218, 165, 14, 7, 218, 164, 14, 7, 218, 162, 14, 7, 218, 160, 14, 7,
+ 218, 159, 14, 7, 218, 157, 14, 7, 218, 155, 14, 7, 218, 153, 14, 7, 218,
+ 151, 14, 7, 218, 149, 14, 7, 218, 147, 14, 7, 218, 145, 14, 7, 218, 144,
+ 14, 7, 218, 142, 14, 7, 218, 140, 14, 7, 218, 139, 14, 7, 218, 138, 14,
+ 7, 218, 137, 14, 7, 218, 136, 14, 7, 218, 135, 14, 7, 218, 134, 14, 7,
+ 218, 133, 14, 7, 218, 132, 14, 7, 218, 130, 14, 7, 218, 128, 14, 7, 218,
+ 126, 14, 7, 218, 125, 14, 7, 218, 123, 14, 7, 218, 122, 14, 7, 218, 120,
+ 14, 7, 218, 119, 14, 7, 218, 117, 14, 7, 218, 115, 14, 7, 218, 113, 14,
+ 7, 218, 111, 14, 7, 218, 109, 14, 7, 218, 108, 14, 7, 218, 106, 14, 7,
+ 218, 104, 14, 7, 218, 103, 14, 7, 218, 101, 14, 7, 218, 99, 14, 7, 218,
+ 97, 14, 7, 218, 95, 14, 7, 218, 94, 14, 7, 218, 92, 14, 7, 218, 90, 14,
+ 7, 218, 88, 14, 7, 218, 87, 14, 7, 218, 85, 14, 7, 218, 83, 14, 7, 218,
+ 82, 14, 7, 218, 81, 14, 7, 218, 79, 14, 7, 218, 77, 14, 7, 218, 75, 14,
+ 7, 218, 73, 14, 7, 218, 71, 14, 7, 218, 69, 14, 7, 218, 67, 14, 7, 218,
+ 66, 14, 7, 218, 64, 14, 7, 218, 62, 14, 7, 218, 60, 14, 7, 218, 58, 14,
+ 7, 215, 56, 14, 7, 215, 55, 14, 7, 215, 54, 14, 7, 215, 53, 14, 7, 215,
+ 52, 14, 7, 215, 51, 14, 7, 215, 50, 14, 7, 215, 49, 14, 7, 215, 48, 14,
+ 7, 215, 47, 14, 7, 215, 46, 14, 7, 215, 45, 14, 7, 215, 44, 14, 7, 215,
+ 43, 14, 7, 215, 42, 14, 7, 215, 41, 14, 7, 215, 40, 14, 7, 215, 39, 14,
+ 7, 215, 38, 14, 7, 215, 37, 14, 7, 215, 36, 14, 7, 215, 35, 14, 7, 215,
+ 34, 14, 7, 215, 33, 14, 7, 215, 32, 14, 7, 215, 31, 14, 7, 215, 30, 14,
+ 7, 215, 29, 14, 7, 215, 28, 14, 7, 215, 27, 14, 7, 215, 26, 14, 7, 215,
+ 25, 14, 7, 215, 24, 14, 7, 215, 23, 14, 7, 215, 22, 14, 7, 215, 21, 14,
+ 7, 215, 20, 14, 7, 215, 19, 14, 7, 215, 18, 14, 7, 215, 17, 14, 7, 215,
+ 16, 14, 7, 215, 15, 14, 7, 215, 14, 14, 7, 215, 13, 14, 7, 215, 12, 14,
+ 7, 215, 11, 14, 7, 215, 10, 14, 7, 215, 9, 14, 7, 215, 8, 14, 7, 213,
+ 104, 14, 7, 213, 103, 14, 7, 213, 102, 14, 7, 213, 101, 14, 7, 213, 100,
+ 14, 7, 213, 99, 14, 7, 213, 98, 14, 7, 213, 97, 14, 7, 213, 96, 14, 7,
+ 213, 95, 14, 7, 213, 94, 14, 7, 213, 93, 14, 7, 213, 92, 14, 7, 213, 91,
+ 14, 7, 213, 90, 14, 7, 213, 89, 14, 7, 213, 88, 14, 7, 213, 87, 14, 7,
+ 213, 86, 14, 7, 213, 85, 14, 7, 213, 84, 14, 7, 213, 83, 14, 7, 212, 174,
+ 14, 7, 212, 173, 14, 7, 212, 172, 14, 7, 212, 171, 14, 7, 212, 170, 14,
+ 7, 212, 169, 14, 7, 212, 168, 14, 7, 212, 167, 14, 7, 212, 166, 14, 7,
+ 212, 165, 14, 7, 212, 164, 14, 7, 212, 163, 14, 7, 212, 162, 14, 7, 212,
+ 161, 14, 7, 212, 160, 14, 7, 212, 159, 14, 7, 212, 158, 14, 7, 212, 157,
+ 14, 7, 212, 156, 14, 7, 212, 155, 14, 7, 212, 154, 14, 7, 212, 153, 14,
+ 7, 212, 152, 14, 7, 212, 151, 14, 7, 212, 150, 14, 7, 212, 149, 14, 7,
+ 212, 2, 14, 7, 212, 1, 14, 7, 212, 0, 14, 7, 211, 255, 14, 7, 211, 254,
+ 14, 7, 211, 253, 14, 7, 211, 252, 14, 7, 211, 251, 14, 7, 211, 250, 14,
+ 7, 211, 249, 14, 7, 211, 248, 14, 7, 211, 247, 14, 7, 211, 246, 14, 7,
+ 211, 245, 14, 7, 211, 244, 14, 7, 211, 243, 14, 7, 211, 242, 14, 7, 211,
+ 241, 14, 7, 211, 240, 14, 7, 211, 239, 14, 7, 211, 238, 14, 7, 211, 237,
+ 14, 7, 211, 236, 14, 7, 211, 235, 14, 7, 211, 234, 14, 7, 211, 233, 14,
+ 7, 211, 232, 14, 7, 211, 231, 14, 7, 211, 230, 14, 7, 211, 229, 14, 7,
+ 211, 228, 14, 7, 211, 227, 14, 7, 211, 226, 14, 7, 211, 225, 14, 7, 211,
+ 224, 14, 7, 211, 223, 14, 7, 211, 222, 14, 7, 211, 221, 14, 7, 211, 220,
+ 14, 7, 211, 219, 14, 7, 211, 218, 14, 7, 211, 217, 14, 7, 211, 216, 14,
+ 7, 211, 215, 14, 7, 211, 214, 14, 7, 211, 213, 14, 7, 211, 212, 14, 7,
+ 211, 211, 14, 7, 211, 210, 14, 7, 211, 209, 14, 7, 211, 208, 14, 7, 211,
+ 207, 14, 7, 211, 206, 14, 7, 211, 205, 14, 7, 211, 204, 14, 7, 211, 203,
+ 14, 7, 211, 202, 14, 7, 211, 201, 14, 7, 211, 200, 14, 7, 211, 199, 14,
+ 7, 211, 198, 14, 7, 211, 197, 14, 7, 211, 196, 14, 7, 211, 195, 14, 7,
+ 211, 194, 14, 7, 211, 193, 14, 7, 211, 192, 14, 7, 211, 191, 14, 7, 211,
+ 190, 14, 7, 211, 189, 14, 7, 211, 188, 14, 7, 211, 187, 14, 7, 211, 186,
+ 14, 7, 211, 185, 14, 7, 211, 184, 14, 7, 210, 235, 14, 7, 210, 234, 14,
+ 7, 210, 233, 14, 7, 210, 232, 14, 7, 210, 231, 14, 7, 210, 230, 14, 7,
+ 210, 229, 14, 7, 210, 228, 14, 7, 210, 227, 14, 7, 210, 226, 14, 7, 210,
+ 225, 14, 7, 210, 224, 14, 7, 210, 223, 14, 7, 208, 103, 14, 7, 208, 102,
+ 14, 7, 208, 101, 14, 7, 208, 100, 14, 7, 208, 99, 14, 7, 208, 98, 14, 7,
+ 208, 97, 14, 7, 207, 220, 14, 7, 207, 219, 14, 7, 207, 218, 14, 7, 207,
+ 217, 14, 7, 207, 216, 14, 7, 207, 215, 14, 7, 207, 214, 14, 7, 207, 213,
+ 14, 7, 207, 212, 14, 7, 207, 211, 14, 7, 207, 210, 14, 7, 207, 209, 14,
+ 7, 207, 208, 14, 7, 207, 207, 14, 7, 207, 206, 14, 7, 207, 205, 14, 7,
+ 207, 204, 14, 7, 207, 203, 14, 7, 207, 202, 14, 7, 207, 201, 14, 7, 207,
+ 200, 14, 7, 207, 199, 14, 7, 207, 198, 14, 7, 207, 197, 14, 7, 207, 196,
+ 14, 7, 207, 195, 14, 7, 207, 194, 14, 7, 207, 193, 14, 7, 207, 192, 14,
+ 7, 207, 191, 14, 7, 207, 190, 14, 7, 207, 189, 14, 7, 207, 188, 14, 7,
+ 207, 187, 14, 7, 206, 5, 14, 7, 206, 4, 14, 7, 206, 3, 14, 7, 206, 2, 14,
+ 7, 206, 1, 14, 7, 206, 0, 14, 7, 205, 255, 14, 7, 205, 254, 14, 7, 205,
+ 253, 14, 7, 205, 252, 14, 7, 205, 251, 14, 7, 205, 250, 14, 7, 205, 249,
+ 14, 7, 205, 248, 14, 7, 205, 247, 14, 7, 205, 246, 14, 7, 205, 245, 14,
+ 7, 205, 244, 14, 7, 205, 243, 14, 7, 205, 242, 14, 7, 205, 241, 14, 7,
+ 205, 240, 14, 7, 205, 239, 14, 7, 205, 238, 14, 7, 205, 237, 14, 7, 205,
+ 236, 14, 7, 205, 235, 14, 7, 205, 234, 14, 7, 205, 233, 14, 7, 205, 232,
+ 14, 7, 205, 231, 14, 7, 205, 230, 14, 7, 205, 229, 14, 7, 205, 228, 14,
+ 7, 205, 227, 14, 7, 205, 226, 14, 7, 205, 225, 14, 7, 205, 224, 14, 7,
+ 205, 223, 14, 7, 205, 222, 14, 7, 205, 221, 14, 7, 205, 220, 14, 7, 205,
+ 219, 14, 7, 205, 218, 14, 7, 205, 217, 14, 7, 205, 216, 14, 7, 205, 215,
+ 14, 7, 205, 214, 14, 7, 205, 213, 14, 7, 205, 212, 14, 7, 205, 211, 14,
+ 7, 205, 210, 14, 7, 205, 209, 14, 7, 205, 208, 14, 7, 200, 40, 14, 7,
+ 200, 39, 14, 7, 200, 38, 14, 7, 200, 37, 14, 7, 200, 36, 14, 7, 200, 35,
+ 14, 7, 200, 34, 14, 7, 200, 33, 14, 7, 200, 32, 14, 7, 200, 31, 14, 7,
+ 200, 30, 14, 7, 200, 29, 14, 7, 200, 28, 14, 7, 200, 27, 14, 7, 200, 26,
+ 14, 7, 200, 25, 14, 7, 200, 24, 14, 7, 200, 23, 14, 7, 200, 22, 14, 7,
+ 200, 21, 14, 7, 200, 20, 14, 7, 200, 19, 14, 7, 200, 18, 14, 7, 200, 17,
+ 14, 7, 200, 16, 14, 7, 200, 15, 14, 7, 200, 14, 14, 7, 200, 13, 14, 7,
+ 200, 12, 14, 7, 200, 11, 14, 7, 200, 10, 14, 7, 200, 9, 14, 7, 200, 8,
+ 14, 7, 200, 7, 14, 7, 200, 6, 14, 7, 200, 5, 14, 7, 200, 4, 14, 7, 200,
+ 3, 14, 7, 200, 2, 14, 7, 200, 1, 14, 7, 200, 0, 14, 7, 199, 255, 14, 7,
+ 199, 254, 14, 7, 199, 253, 14, 7, 196, 217, 14, 7, 196, 216, 14, 7, 196,
+ 215, 14, 7, 196, 214, 14, 7, 196, 213, 14, 7, 196, 212, 14, 7, 196, 211,
+ 14, 7, 196, 210, 14, 7, 196, 209, 14, 7, 196, 208, 14, 7, 196, 207, 14,
+ 7, 196, 206, 14, 7, 196, 205, 14, 7, 196, 204, 14, 7, 196, 203, 14, 7,
+ 196, 202, 14, 7, 196, 201, 14, 7, 196, 200, 14, 7, 196, 199, 14, 7, 196,
+ 198, 14, 7, 196, 197, 14, 7, 196, 196, 14, 7, 196, 195, 14, 7, 196, 194,
+ 14, 7, 196, 193, 14, 7, 196, 192, 14, 7, 196, 191, 14, 7, 196, 190, 14,
+ 7, 196, 189, 14, 7, 196, 188, 14, 7, 196, 187, 14, 7, 196, 186, 14, 7,
+ 196, 185, 14, 7, 196, 184, 14, 7, 196, 183, 14, 7, 196, 182, 14, 7, 196,
+ 181, 14, 7, 196, 180, 14, 7, 196, 179, 14, 7, 196, 178, 14, 7, 196, 177,
+ 14, 7, 196, 176, 14, 7, 196, 175, 14, 7, 196, 174, 14, 7, 196, 173, 14,
+ 7, 196, 172, 14, 7, 196, 171, 14, 7, 196, 11, 14, 7, 196, 10, 14, 7, 196,
+ 9, 14, 7, 196, 8, 14, 7, 196, 7, 14, 7, 196, 6, 14, 7, 196, 5, 14, 7,
+ 196, 4, 14, 7, 196, 3, 14, 7, 196, 2, 14, 7, 196, 1, 14, 7, 196, 0, 14,
+ 7, 195, 255, 14, 7, 195, 254, 14, 7, 195, 253, 14, 7, 195, 252, 14, 7,
+ 195, 251, 14, 7, 195, 250, 14, 7, 195, 249, 14, 7, 195, 248, 14, 7, 195,
+ 247, 14, 7, 195, 246, 14, 7, 195, 245, 14, 7, 195, 244, 14, 7, 195, 243,
+ 14, 7, 195, 242, 14, 7, 195, 240, 14, 7, 195, 239, 14, 7, 195, 238, 14,
+ 7, 195, 237, 14, 7, 195, 236, 14, 7, 195, 235, 14, 7, 195, 234, 14, 7,
+ 195, 233, 14, 7, 195, 232, 14, 7, 195, 231, 14, 7, 195, 230, 14, 7, 195,
+ 229, 14, 7, 195, 228, 14, 7, 195, 227, 14, 7, 195, 226, 14, 7, 195, 225,
+ 14, 7, 195, 224, 14, 7, 195, 223, 14, 7, 195, 222, 14, 7, 195, 221, 14,
+ 7, 195, 220, 14, 7, 195, 219, 14, 7, 195, 218, 14, 7, 195, 217, 14, 7,
+ 195, 216, 14, 7, 195, 215, 14, 7, 195, 214, 14, 7, 195, 213, 14, 7, 195,
+ 212, 14, 7, 195, 211, 14, 7, 195, 210, 14, 7, 195, 209, 14, 7, 195, 208,
+ 14, 7, 195, 207, 14, 7, 195, 206, 14, 7, 195, 205, 14, 7, 195, 204, 14,
+ 7, 195, 203, 14, 7, 195, 202, 14, 7, 195, 201, 14, 7, 195, 200, 14, 7,
+ 195, 199, 14, 7, 195, 198, 14, 7, 195, 197, 14, 7, 195, 196, 14, 7, 195,
+ 195, 14, 7, 195, 194, 14, 7, 195, 193, 14, 7, 195, 192, 14, 7, 195, 191,
+ 14, 7, 195, 190, 14, 7, 193, 223, 14, 7, 193, 222, 14, 7, 193, 221, 14,
+ 7, 193, 220, 14, 7, 193, 219, 14, 7, 193, 218, 14, 7, 193, 217, 14, 7,
+ 193, 216, 14, 7, 193, 215, 14, 7, 193, 214, 14, 7, 193, 213, 14, 7, 193,
+ 212, 14, 7, 193, 211, 14, 7, 193, 210, 14, 7, 193, 209, 14, 7, 193, 208,
+ 14, 7, 193, 207, 14, 7, 193, 206, 14, 7, 193, 205, 14, 7, 193, 204, 14,
+ 7, 193, 203, 14, 7, 193, 202, 14, 7, 193, 201, 14, 7, 193, 200, 14, 7,
+ 193, 199, 14, 7, 193, 198, 14, 7, 193, 197, 14, 7, 193, 196, 14, 7, 193,
+ 195, 14, 7, 193, 194, 14, 7, 193, 193, 14, 7, 193, 192, 14, 7, 192, 232,
+ 14, 7, 192, 231, 14, 7, 192, 230, 14, 7, 192, 229, 14, 7, 192, 228, 14,
+ 7, 192, 227, 14, 7, 192, 226, 14, 7, 192, 225, 14, 7, 192, 224, 14, 7,
+ 192, 223, 14, 7, 192, 222, 14, 7, 192, 221, 14, 7, 192, 157, 14, 7, 192,
+ 156, 14, 7, 192, 155, 14, 7, 192, 154, 14, 7, 192, 153, 14, 7, 192, 152,
+ 14, 7, 192, 151, 14, 7, 192, 150, 14, 7, 192, 149, 14, 7, 191, 165, 14,
+ 7, 191, 164, 14, 7, 191, 163, 14, 7, 191, 162, 14, 7, 191, 161, 14, 7,
+ 191, 160, 14, 7, 191, 159, 14, 7, 191, 158, 14, 7, 191, 157, 14, 7, 191,
+ 156, 14, 7, 191, 155, 14, 7, 191, 154, 14, 7, 191, 153, 14, 7, 191, 152,
+ 14, 7, 191, 151, 14, 7, 191, 150, 14, 7, 191, 149, 14, 7, 191, 148, 14,
+ 7, 191, 147, 14, 7, 191, 146, 14, 7, 191, 145, 14, 7, 191, 144, 14, 7,
+ 191, 143, 14, 7, 191, 142, 14, 7, 191, 141, 14, 7, 191, 140, 14, 7, 191,
+ 139, 14, 7, 191, 138, 14, 7, 191, 137, 14, 7, 191, 136, 14, 7, 191, 135,
+ 14, 7, 191, 134, 14, 7, 191, 133, 14, 7, 191, 132, 14, 7, 191, 131, 14,
+ 7, 191, 130, 14, 7, 191, 129, 14, 7, 191, 128, 14, 7, 191, 127, 14, 7,
+ 191, 126, 14, 7, 191, 125, 14, 7, 252, 205, 14, 7, 252, 204, 14, 7, 252,
+ 203, 14, 7, 252, 202, 14, 7, 252, 201, 14, 7, 252, 200, 14, 7, 252, 199,
+ 14, 7, 252, 198, 14, 7, 252, 197, 14, 7, 252, 196, 14, 7, 252, 195, 14,
+ 7, 252, 194, 14, 7, 252, 193, 14, 7, 252, 192, 14, 7, 252, 191, 14, 7,
+ 252, 190, 14, 7, 252, 189, 14, 7, 252, 188, 14, 7, 252, 187, 14, 7, 252,
+ 186, 14, 7, 252, 185, 14, 7, 252, 184, 14, 7, 252, 183, 14, 7, 252, 182,
+ 14, 7, 252, 181, 14, 7, 252, 180, 14, 7, 252, 179, 14, 7, 252, 178, 14,
+ 7, 252, 177, 14, 7, 252, 176, 14, 7, 252, 175, 14, 7, 252, 174, 14, 7,
+ 252, 173, 14, 7, 252, 172, 14, 7, 195, 241, 14, 7, 81, 222, 196, 14, 7,
+ 228, 241, 222, 196, 14, 7, 223, 120, 250, 183, 198, 54, 201, 97, 14, 7,
+ 223, 120, 250, 183, 248, 77, 201, 97, 14, 7, 223, 120, 250, 183, 198, 54,
+ 234, 94, 14, 7, 223, 120, 250, 183, 248, 77, 234, 94, 14, 7, 211, 0, 216,
+ 84, 14, 7, 248, 249, 205, 43, 14, 7, 234, 95, 205, 43, 14, 7, 223, 120,
+ 250, 183, 216, 84, 14, 7, 223, 120, 250, 183, 198, 53, 14, 7, 223, 120,
+ 250, 183, 248, 76, 14, 7, 248, 249, 234, 98, 14, 7, 234, 95, 234, 98, 14,
+ 7, 248, 249, 193, 166, 234, 98, 14, 7, 234, 95, 193, 166, 234, 98, 14, 7,
+ 216, 27, 228, 189, 14, 7, 232, 80, 248, 132, 14, 7, 132, 248, 132, 14, 7,
+ 218, 251, 56, 14, 7, 132, 218, 251, 56, 14, 7, 199, 200, 218, 251, 56,
+ 14, 7, 193, 78, 218, 251, 56, 14, 7, 52, 237, 249, 250, 183, 198, 54,
+ 201, 97, 14, 7, 52, 237, 249, 250, 183, 248, 77, 201, 97, 14, 7, 52, 237,
+ 249, 250, 183, 201, 97, 14, 7, 52, 237, 249, 250, 183, 198, 54, 234, 94,
+ 14, 7, 52, 237, 249, 250, 183, 198, 53, 14, 7, 52, 237, 249, 250, 183,
+ 248, 77, 201, 98, 23, 198, 54, 234, 94, 14, 7, 52, 237, 249, 250, 183,
+ 201, 98, 23, 198, 53, 14, 7, 52, 237, 249, 250, 183, 248, 77, 234, 94,
+ 14, 7, 52, 237, 249, 250, 183, 198, 54, 201, 98, 23, 248, 77, 234, 94,
+ 14, 7, 52, 237, 249, 250, 183, 248, 76, 14, 7, 52, 237, 249, 250, 183,
+ 201, 98, 23, 248, 76, 14, 7, 52, 237, 249, 250, 183, 234, 94, 14, 7, 52,
+ 237, 249, 250, 183, 198, 54, 23, 234, 94, 14, 7, 52, 237, 249, 250, 183,
+ 248, 77, 23, 234, 94, 14, 7, 52, 237, 248, 29, 7, 255, 199, 29, 7, 255,
+ 198, 29, 7, 255, 197, 29, 7, 255, 196, 29, 7, 255, 195, 29, 7, 255, 193,
+ 29, 7, 255, 190, 29, 7, 255, 189, 29, 7, 255, 188, 29, 7, 255, 187, 29,
+ 7, 255, 186, 29, 7, 255, 185, 29, 7, 255, 184, 29, 7, 255, 183, 29, 7,
+ 255, 182, 29, 7, 255, 180, 29, 7, 255, 179, 29, 7, 255, 178, 29, 7, 255,
+ 176, 29, 7, 255, 175, 29, 7, 255, 174, 29, 7, 255, 173, 29, 7, 255, 172,
+ 29, 7, 255, 171, 29, 7, 255, 170, 29, 7, 255, 169, 29, 7, 255, 168, 29,
+ 7, 255, 167, 29, 7, 255, 166, 29, 7, 255, 165, 29, 7, 255, 163, 29, 7,
+ 255, 162, 29, 7, 255, 161, 29, 7, 255, 160, 29, 7, 255, 158, 29, 7, 255,
+ 157, 29, 7, 255, 156, 29, 7, 255, 155, 29, 7, 255, 154, 29, 7, 255, 153,
+ 29, 7, 255, 152, 29, 7, 255, 151, 29, 7, 255, 150, 29, 7, 255, 148, 29,
+ 7, 255, 147, 29, 7, 255, 146, 29, 7, 255, 144, 29, 7, 255, 142, 29, 7,
+ 255, 141, 29, 7, 255, 140, 29, 7, 255, 139, 29, 7, 255, 138, 29, 7, 255,
+ 137, 29, 7, 255, 136, 29, 7, 255, 135, 29, 7, 255, 134, 29, 7, 255, 133,
+ 29, 7, 255, 132, 29, 7, 255, 131, 29, 7, 255, 130, 29, 7, 255, 129, 29,
+ 7, 255, 128, 29, 7, 255, 127, 29, 7, 255, 126, 29, 7, 255, 125, 29, 7,
+ 255, 124, 29, 7, 255, 123, 29, 7, 255, 122, 29, 7, 255, 121, 29, 7, 255,
+ 120, 29, 7, 255, 119, 29, 7, 255, 118, 29, 7, 255, 117, 29, 7, 255, 116,
+ 29, 7, 255, 115, 29, 7, 255, 114, 29, 7, 255, 113, 29, 7, 255, 112, 29,
+ 7, 255, 111, 29, 7, 255, 110, 29, 7, 255, 109, 29, 7, 255, 108, 29, 7,
+ 255, 107, 29, 7, 255, 106, 29, 7, 255, 105, 29, 7, 255, 104, 29, 7, 255,
+ 103, 29, 7, 255, 102, 29, 7, 255, 101, 29, 7, 255, 100, 29, 7, 255, 99,
+ 29, 7, 255, 98, 29, 7, 255, 97, 29, 7, 255, 96, 29, 7, 255, 95, 29, 7,
+ 255, 94, 29, 7, 255, 93, 29, 7, 255, 92, 29, 7, 255, 91, 29, 7, 255, 90,
+ 29, 7, 255, 89, 29, 7, 255, 88, 29, 7, 255, 87, 29, 7, 255, 86, 29, 7,
+ 255, 85, 29, 7, 255, 84, 29, 7, 255, 83, 29, 7, 255, 82, 29, 7, 255, 81,
+ 29, 7, 255, 80, 29, 7, 255, 79, 29, 7, 255, 78, 29, 7, 255, 76, 29, 7,
+ 255, 75, 29, 7, 255, 74, 29, 7, 255, 73, 29, 7, 255, 72, 29, 7, 255, 71,
+ 29, 7, 255, 70, 29, 7, 255, 69, 29, 7, 255, 68, 29, 7, 255, 67, 29, 7,
+ 255, 66, 29, 7, 255, 65, 29, 7, 255, 64, 29, 7, 255, 63, 29, 7, 255, 62,
+ 29, 7, 255, 61, 29, 7, 255, 60, 29, 7, 255, 59, 29, 7, 255, 58, 29, 7,
+ 255, 57, 29, 7, 255, 56, 29, 7, 255, 55, 29, 7, 255, 54, 29, 7, 255, 53,
+ 29, 7, 255, 52, 29, 7, 255, 51, 29, 7, 255, 50, 29, 7, 255, 49, 29, 7,
+ 255, 48, 29, 7, 255, 47, 29, 7, 255, 46, 29, 7, 255, 45, 29, 7, 255, 44,
+ 29, 7, 255, 43, 29, 7, 255, 41, 29, 7, 255, 40, 29, 7, 255, 39, 29, 7,
+ 255, 38, 29, 7, 255, 37, 29, 7, 255, 36, 29, 7, 255, 35, 29, 7, 255, 34,
+ 29, 7, 255, 33, 29, 7, 255, 32, 29, 7, 255, 31, 29, 7, 255, 30, 29, 7,
+ 255, 28, 29, 7, 255, 27, 29, 7, 255, 26, 29, 7, 255, 25, 29, 7, 255, 24,
+ 29, 7, 255, 23, 29, 7, 255, 22, 29, 7, 255, 21, 29, 7, 255, 20, 29, 7,
+ 255, 19, 29, 7, 255, 18, 29, 7, 255, 17, 29, 7, 255, 16, 29, 7, 255, 15,
+ 29, 7, 255, 14, 29, 7, 255, 13, 29, 7, 255, 12, 29, 7, 255, 11, 29, 7,
+ 255, 10, 29, 7, 255, 9, 29, 7, 255, 8, 29, 7, 255, 7, 29, 7, 255, 6, 29,
+ 7, 255, 5, 29, 7, 255, 4, 29, 7, 255, 3, 29, 7, 255, 2, 29, 7, 255, 1,
+ 29, 7, 255, 0, 29, 7, 254, 255, 29, 7, 254, 254, 29, 7, 254, 253, 29, 7,
+ 254, 252, 29, 7, 254, 251, 29, 7, 254, 250, 29, 7, 254, 249, 29, 7, 254,
+ 248, 29, 7, 254, 247, 29, 7, 254, 246, 29, 7, 254, 245, 29, 7, 254, 244,
+ 29, 7, 254, 243, 29, 7, 254, 242, 29, 7, 254, 241, 29, 7, 254, 240, 29,
+ 7, 254, 239, 29, 7, 254, 238, 29, 7, 254, 237, 29, 7, 254, 236, 29, 7,
+ 254, 235, 29, 7, 254, 234, 29, 7, 254, 233, 29, 7, 254, 232, 29, 7, 254,
+ 231, 29, 7, 254, 230, 29, 7, 254, 229, 29, 7, 254, 228, 29, 7, 254, 227,
+ 29, 7, 254, 226, 29, 7, 254, 225, 29, 7, 254, 224, 29, 7, 254, 223, 29,
+ 7, 254, 222, 29, 7, 254, 221, 29, 7, 254, 220, 29, 7, 254, 219, 29, 7,
+ 254, 218, 29, 7, 254, 217, 29, 7, 254, 216, 29, 7, 254, 214, 29, 7, 254,
+ 213, 29, 7, 254, 212, 29, 7, 254, 211, 29, 7, 254, 210, 29, 7, 254, 209,
+ 29, 7, 254, 208, 29, 7, 254, 207, 29, 7, 254, 206, 29, 7, 254, 205, 29,
+ 7, 254, 204, 29, 7, 254, 203, 29, 7, 254, 202, 29, 7, 254, 201, 29, 7,
+ 254, 200, 29, 7, 254, 199, 29, 7, 254, 198, 29, 7, 254, 197, 29, 7, 254,
+ 196, 29, 7, 254, 195, 29, 7, 254, 194, 29, 7, 254, 193, 29, 7, 254, 192,
+ 29, 7, 254, 191, 29, 7, 254, 190, 29, 7, 254, 189, 29, 7, 254, 188, 29,
+ 7, 254, 187, 29, 7, 254, 186, 29, 7, 254, 185, 29, 7, 254, 184, 29, 7,
+ 254, 183, 29, 7, 254, 182, 29, 7, 254, 181, 29, 7, 254, 180, 29, 7, 254,
+ 179, 29, 7, 254, 178, 29, 7, 254, 177, 29, 7, 254, 176, 29, 7, 254, 175,
+ 29, 7, 254, 174, 29, 7, 254, 173, 29, 7, 254, 172, 29, 7, 254, 171, 29,
+ 7, 254, 170, 29, 7, 254, 169, 29, 7, 254, 168, 29, 7, 254, 167, 29, 7,
+ 254, 166, 29, 7, 254, 165, 29, 7, 254, 164, 29, 7, 254, 163, 29, 7, 254,
+ 162, 29, 7, 254, 161, 29, 7, 254, 160, 29, 7, 254, 159, 29, 7, 254, 158,
+ 29, 7, 254, 157, 29, 7, 254, 156, 29, 7, 254, 155, 29, 7, 254, 154, 29,
+ 7, 254, 153, 29, 7, 254, 152, 29, 7, 254, 151, 29, 7, 254, 150, 29, 7,
+ 254, 149, 29, 7, 254, 148, 29, 7, 254, 147, 29, 7, 254, 146, 29, 7, 254,
+ 145, 29, 7, 254, 144, 29, 7, 254, 143, 29, 7, 254, 142, 29, 7, 254, 141,
+ 29, 7, 254, 140, 29, 7, 254, 139, 29, 7, 254, 138, 29, 7, 254, 137, 29,
+ 7, 254, 136, 29, 7, 254, 135, 29, 7, 254, 134, 29, 7, 254, 133, 29, 7,
+ 254, 132, 29, 7, 254, 131, 29, 7, 254, 130, 29, 7, 254, 129, 29, 7, 254,
+ 128, 29, 7, 254, 127, 29, 7, 254, 126, 29, 7, 254, 125, 29, 7, 254, 124,
+ 29, 7, 254, 123, 29, 7, 254, 122, 29, 7, 254, 121, 29, 7, 254, 120, 29,
+ 7, 254, 119, 29, 7, 254, 118, 29, 7, 254, 117, 29, 7, 254, 116, 29, 7,
+ 254, 115, 29, 7, 254, 114, 29, 7, 254, 113, 29, 7, 254, 112, 29, 7, 254,
+ 111, 29, 7, 254, 110, 29, 7, 254, 109, 29, 7, 254, 108, 29, 7, 254, 107,
+ 29, 7, 254, 106, 29, 7, 254, 105, 29, 7, 254, 104, 29, 7, 254, 102, 29,
+ 7, 254, 101, 29, 7, 254, 100, 29, 7, 254, 99, 29, 7, 254, 98, 29, 7, 254,
+ 97, 29, 7, 254, 96, 29, 7, 254, 95, 29, 7, 254, 94, 29, 7, 254, 93, 29,
+ 7, 254, 92, 29, 7, 254, 89, 29, 7, 254, 88, 29, 7, 254, 87, 29, 7, 254,
+ 86, 29, 7, 254, 82, 29, 7, 254, 81, 29, 7, 254, 80, 29, 7, 254, 79, 29,
+ 7, 254, 78, 29, 7, 254, 77, 29, 7, 254, 76, 29, 7, 254, 75, 29, 7, 254,
+ 74, 29, 7, 254, 73, 29, 7, 254, 72, 29, 7, 254, 71, 29, 7, 254, 70, 29,
+ 7, 254, 69, 29, 7, 254, 68, 29, 7, 254, 67, 29, 7, 254, 66, 29, 7, 254,
+ 65, 29, 7, 254, 64, 29, 7, 254, 62, 29, 7, 254, 61, 29, 7, 254, 60, 29,
+ 7, 254, 59, 29, 7, 254, 58, 29, 7, 254, 57, 29, 7, 254, 56, 29, 7, 254,
+ 55, 29, 7, 254, 54, 29, 7, 254, 53, 29, 7, 254, 52, 29, 7, 254, 51, 29,
+ 7, 254, 50, 29, 7, 254, 49, 29, 7, 254, 48, 29, 7, 254, 47, 29, 7, 254,
+ 46, 29, 7, 254, 45, 29, 7, 254, 44, 29, 7, 254, 43, 29, 7, 254, 42, 29,
+ 7, 254, 41, 29, 7, 254, 40, 29, 7, 254, 39, 29, 7, 254, 38, 29, 7, 254,
+ 37, 29, 7, 254, 36, 29, 7, 254, 35, 29, 7, 254, 34, 29, 7, 254, 33, 29,
+ 7, 254, 32, 29, 7, 254, 31, 29, 7, 254, 30, 29, 7, 254, 29, 29, 7, 254,
+ 28, 29, 7, 254, 27, 29, 7, 254, 26, 29, 7, 254, 25, 29, 7, 254, 24, 29,
+ 7, 254, 23, 29, 7, 254, 22, 29, 7, 254, 21, 29, 7, 254, 20, 29, 7, 254,
+ 19, 29, 7, 254, 18, 29, 7, 254, 17, 29, 7, 254, 16, 29, 7, 254, 15, 29,
+ 7, 254, 14, 29, 7, 254, 13, 29, 7, 254, 12, 29, 7, 254, 11, 29, 7, 254,
+ 10, 29, 7, 254, 9, 29, 7, 254, 8, 29, 7, 254, 7, 29, 7, 254, 6, 29, 7,
+ 254, 5, 29, 7, 254, 4, 29, 7, 254, 3, 29, 7, 254, 2, 29, 7, 254, 1, 207,
+ 186, 211, 57, 207, 1, 29, 7, 254, 0, 29, 7, 253, 255, 29, 7, 253, 254,
+ 29, 7, 253, 253, 29, 7, 253, 252, 29, 7, 253, 251, 29, 7, 253, 250, 29,
+ 7, 253, 249, 29, 7, 253, 248, 29, 7, 253, 247, 29, 7, 253, 246, 29, 7,
+ 253, 245, 171, 29, 7, 253, 244, 29, 7, 253, 243, 29, 7, 253, 242, 29, 7,
+ 253, 241, 29, 7, 253, 240, 29, 7, 253, 239, 29, 7, 253, 238, 29, 7, 253,
+ 236, 29, 7, 253, 234, 29, 7, 253, 232, 29, 7, 253, 230, 29, 7, 253, 228,
+ 29, 7, 253, 226, 29, 7, 253, 224, 29, 7, 253, 222, 29, 7, 253, 220, 29,
+ 7, 253, 218, 248, 249, 219, 28, 77, 29, 7, 253, 216, 234, 95, 219, 28,
+ 77, 29, 7, 253, 215, 29, 7, 253, 213, 29, 7, 253, 211, 29, 7, 253, 209,
+ 29, 7, 253, 207, 29, 7, 253, 205, 29, 7, 253, 203, 29, 7, 253, 201, 29,
+ 7, 253, 199, 29, 7, 253, 198, 29, 7, 253, 197, 29, 7, 253, 196, 29, 7,
+ 253, 195, 29, 7, 253, 194, 29, 7, 253, 193, 29, 7, 253, 192, 29, 7, 253,
+ 191, 29, 7, 253, 190, 29, 7, 253, 189, 29, 7, 253, 188, 29, 7, 253, 187,
+ 29, 7, 253, 186, 29, 7, 253, 185, 29, 7, 253, 184, 29, 7, 253, 183, 29,
+ 7, 253, 182, 29, 7, 253, 181, 29, 7, 253, 180, 29, 7, 253, 179, 29, 7,
+ 253, 178, 29, 7, 253, 177, 29, 7, 253, 176, 29, 7, 253, 175, 29, 7, 253,
+ 174, 29, 7, 253, 173, 29, 7, 253, 172, 29, 7, 253, 171, 29, 7, 253, 170,
+ 29, 7, 253, 169, 29, 7, 253, 168, 29, 7, 253, 167, 29, 7, 253, 166, 29,
+ 7, 253, 165, 29, 7, 253, 164, 29, 7, 253, 163, 29, 7, 253, 162, 29, 7,
+ 253, 161, 29, 7, 253, 160, 29, 7, 253, 159, 29, 7, 253, 158, 29, 7, 253,
+ 157, 29, 7, 253, 156, 29, 7, 253, 155, 29, 7, 253, 154, 29, 7, 253, 153,
+ 29, 7, 253, 152, 29, 7, 253, 151, 29, 7, 253, 150, 29, 7, 253, 149, 29,
+ 7, 253, 148, 29, 7, 253, 147, 29, 7, 253, 146, 29, 7, 253, 145, 29, 7,
+ 253, 144, 29, 7, 253, 143, 29, 7, 253, 142, 29, 7, 253, 141, 29, 7, 253,
+ 140, 29, 7, 253, 139, 29, 7, 253, 138, 29, 7, 253, 137, 29, 7, 253, 136,
+ 29, 7, 253, 135, 29, 7, 253, 134, 29, 7, 253, 133, 29, 7, 253, 132, 29,
+ 7, 253, 131, 29, 7, 253, 130, 29, 7, 253, 129, 29, 7, 253, 128, 29, 7,
+ 253, 127, 29, 7, 253, 126, 29, 7, 253, 125, 29, 7, 253, 124, 29, 7, 253,
+ 123, 29, 7, 253, 122, 29, 7, 253, 121, 29, 7, 253, 120, 29, 7, 253, 119,
+ 29, 7, 253, 118, 29, 7, 253, 117, 29, 7, 253, 116, 29, 7, 253, 115, 29,
+ 7, 253, 114, 29, 7, 253, 113, 29, 7, 253, 112, 29, 7, 253, 111, 29, 7,
+ 253, 110, 29, 7, 253, 109, 29, 7, 253, 108, 29, 7, 253, 107, 29, 7, 253,
+ 106, 29, 7, 253, 105, 29, 7, 253, 104, 29, 7, 253, 103, 29, 7, 253, 102,
+ 29, 7, 253, 101, 29, 7, 253, 100, 29, 7, 253, 99, 29, 7, 253, 98, 29, 7,
+ 253, 97, 29, 7, 253, 96, 29, 7, 253, 95, 29, 7, 253, 94, 29, 7, 253, 93,
+ 29, 7, 253, 92, 29, 7, 253, 91, 29, 7, 253, 90, 29, 7, 253, 89, 26, 1,
+ 209, 218, 214, 1, 216, 142, 26, 1, 209, 218, 231, 173, 232, 166, 26, 1,
+ 209, 218, 209, 40, 216, 143, 209, 127, 26, 1, 209, 218, 209, 40, 216,
+ 143, 209, 128, 26, 1, 209, 218, 214, 251, 216, 142, 26, 1, 209, 218, 203,
+ 0, 26, 1, 209, 218, 198, 124, 216, 142, 26, 1, 209, 218, 212, 47, 216,
+ 142, 26, 1, 209, 218, 203, 68, 210, 221, 213, 141, 26, 1, 209, 218, 209,
+ 40, 210, 221, 213, 142, 209, 127, 26, 1, 209, 218, 209, 40, 210, 221,
+ 213, 142, 209, 128, 26, 1, 209, 218, 217, 131, 26, 1, 209, 218, 197, 95,
+ 217, 132, 26, 1, 209, 218, 214, 62, 26, 1, 209, 218, 217, 128, 26, 1,
+ 209, 218, 217, 77, 26, 1, 209, 218, 215, 86, 26, 1, 209, 218, 203, 249,
+ 26, 1, 209, 218, 212, 187, 26, 1, 209, 218, 221, 234, 26, 1, 209, 218,
+ 213, 108, 26, 1, 209, 218, 200, 160, 26, 1, 209, 218, 214, 0, 26, 1, 209,
+ 218, 220, 15, 26, 1, 209, 218, 219, 177, 220, 188, 26, 1, 209, 218, 212,
+ 197, 216, 150, 26, 1, 209, 218, 217, 135, 26, 1, 209, 218, 210, 98, 26,
+ 1, 209, 218, 231, 72, 26, 1, 209, 218, 210, 170, 26, 1, 209, 218, 215,
+ 232, 214, 35, 26, 1, 209, 218, 212, 28, 216, 153, 26, 1, 209, 218, 126,
+ 191, 195, 214, 244, 26, 1, 209, 218, 231, 73, 26, 1, 209, 218, 212, 197,
+ 212, 198, 26, 1, 209, 218, 202, 139, 26, 1, 209, 218, 216, 135, 26, 1,
+ 209, 218, 216, 156, 26, 1, 209, 218, 215, 207, 26, 1, 209, 218, 222, 105,
+ 26, 1, 209, 218, 210, 221, 219, 225, 26, 1, 209, 218, 214, 163, 219, 225,
+ 26, 1, 209, 218, 209, 240, 26, 1, 209, 218, 217, 129, 26, 1, 209, 218,
+ 213, 185, 26, 1, 209, 218, 208, 144, 26, 1, 209, 218, 197, 87, 26, 1,
+ 209, 218, 218, 221, 26, 1, 209, 218, 202, 17, 26, 1, 209, 218, 199, 58,
+ 26, 1, 209, 218, 217, 126, 26, 1, 209, 218, 221, 241, 26, 1, 209, 218,
+ 214, 159, 26, 1, 209, 218, 220, 203, 26, 1, 209, 218, 215, 208, 26, 1,
+ 209, 218, 202, 252, 26, 1, 209, 218, 219, 20, 26, 1, 209, 218, 232, 239,
+ 26, 1, 209, 218, 206, 137, 26, 1, 209, 218, 221, 10, 26, 1, 209, 218,
+ 202, 13, 26, 1, 209, 218, 217, 72, 209, 173, 26, 1, 209, 218, 203, 61,
+ 26, 1, 209, 218, 212, 196, 26, 1, 209, 218, 203, 42, 212, 208, 191, 203,
+ 26, 1, 209, 218, 212, 69, 215, 228, 26, 1, 209, 218, 210, 216, 26, 1,
+ 209, 218, 213, 110, 26, 1, 209, 218, 196, 85, 26, 1, 209, 218, 214, 38,
+ 26, 1, 209, 218, 217, 125, 26, 1, 209, 218, 213, 153, 26, 1, 209, 218,
+ 217, 6, 26, 1, 209, 218, 212, 84, 26, 1, 209, 218, 199, 62, 26, 1, 209,
+ 218, 202, 8, 26, 1, 209, 218, 210, 217, 26, 1, 209, 218, 212, 212, 26, 1,
+ 209, 218, 217, 133, 26, 1, 209, 218, 212, 81, 26, 1, 209, 218, 222, 66,
+ 26, 1, 209, 218, 212, 215, 26, 1, 209, 218, 195, 148, 26, 1, 209, 218,
+ 218, 225, 26, 1, 209, 218, 214, 102, 26, 1, 209, 218, 214, 217, 26, 1,
+ 209, 218, 217, 5, 26, 1, 209, 217, 212, 210, 26, 1, 209, 217, 197, 95,
+ 217, 130, 26, 1, 209, 217, 202, 204, 26, 1, 209, 217, 203, 253, 197, 94,
+ 26, 1, 209, 217, 219, 23, 212, 193, 26, 1, 209, 217, 217, 12, 217, 134,
+ 26, 1, 209, 217, 221, 150, 26, 1, 209, 217, 192, 43, 26, 1, 209, 217,
+ 217, 7, 26, 1, 209, 217, 222, 90, 26, 1, 209, 217, 210, 44, 26, 1, 209,
+ 217, 192, 126, 219, 225, 26, 1, 209, 217, 220, 36, 212, 208, 212, 95, 26,
+ 1, 209, 217, 212, 190, 203, 87, 26, 1, 209, 217, 214, 130, 213, 156, 26,
+ 1, 209, 217, 231, 70, 26, 1, 209, 217, 209, 117, 26, 1, 209, 217, 197,
+ 95, 212, 206, 26, 1, 209, 217, 203, 92, 213, 151, 26, 1, 209, 217, 203,
+ 88, 26, 1, 209, 217, 216, 143, 199, 61, 26, 1, 209, 217, 216, 250, 217,
+ 8, 26, 1, 209, 217, 212, 82, 212, 193, 26, 1, 209, 217, 221, 230, 26, 1,
+ 209, 217, 231, 71, 26, 1, 209, 217, 221, 226, 26, 1, 209, 217, 220, 120,
+ 26, 1, 209, 217, 210, 101, 26, 1, 209, 217, 195, 77, 26, 1, 209, 217,
+ 214, 2, 215, 84, 26, 1, 209, 217, 214, 37, 216, 246, 26, 1, 209, 217,
+ 192, 254, 26, 1, 209, 217, 205, 175, 26, 1, 209, 217, 199, 240, 26, 1,
+ 209, 217, 216, 155, 26, 1, 209, 217, 214, 21, 26, 1, 209, 217, 214, 22,
+ 220, 12, 26, 1, 209, 217, 216, 145, 26, 1, 209, 217, 200, 214, 26, 1,
+ 209, 217, 216, 254, 26, 1, 209, 217, 215, 212, 26, 1, 209, 217, 212, 99,
+ 26, 1, 209, 217, 208, 148, 26, 1, 209, 217, 216, 154, 214, 39, 26, 1,
+ 209, 217, 233, 28, 26, 1, 209, 217, 216, 241, 26, 1, 209, 217, 233, 52,
+ 26, 1, 209, 217, 221, 238, 26, 1, 209, 217, 217, 160, 213, 145, 26, 1,
+ 209, 217, 217, 160, 213, 121, 26, 1, 209, 217, 219, 176, 26, 1, 209, 217,
+ 214, 45, 26, 1, 209, 217, 212, 217, 26, 1, 209, 217, 174, 26, 1, 209,
+ 217, 221, 133, 26, 1, 209, 217, 213, 246, 26, 1, 209, 216, 214, 1, 217,
+ 132, 26, 1, 209, 216, 212, 46, 26, 1, 209, 216, 191, 203, 26, 1, 209,
+ 216, 193, 160, 26, 1, 209, 216, 214, 38, 26, 1, 209, 216, 214, 151, 26,
+ 1, 209, 216, 214, 8, 26, 1, 209, 216, 231, 80, 26, 1, 209, 216, 217, 2,
+ 26, 1, 209, 216, 231, 180, 26, 1, 209, 216, 212, 71, 216, 21, 216, 157,
+ 26, 1, 209, 216, 212, 184, 216, 249, 26, 1, 209, 216, 216, 255, 26, 1,
+ 209, 216, 209, 123, 26, 1, 209, 216, 214, 136, 26, 1, 209, 216, 217, 10,
+ 247, 156, 26, 1, 209, 216, 221, 228, 26, 1, 209, 216, 231, 81, 26, 1,
+ 209, 216, 221, 235, 26, 1, 209, 216, 191, 226, 215, 117, 26, 1, 209, 216,
+ 212, 40, 26, 1, 209, 216, 216, 243, 26, 1, 209, 216, 212, 216, 26, 1,
+ 209, 216, 216, 249, 26, 1, 209, 216, 192, 44, 26, 1, 209, 216, 221, 18,
+ 26, 1, 209, 216, 222, 127, 26, 1, 209, 216, 203, 248, 26, 1, 209, 216,
+ 214, 145, 26, 1, 209, 216, 199, 238, 26, 1, 209, 216, 213, 125, 26, 1,
+ 209, 216, 198, 124, 191, 207, 26, 1, 209, 216, 200, 247, 26, 1, 209, 216,
+ 214, 28, 212, 95, 26, 1, 209, 216, 195, 76, 26, 1, 209, 216, 214, 220,
+ 26, 1, 209, 216, 217, 160, 221, 237, 26, 1, 209, 216, 212, 198, 26, 1,
+ 209, 216, 214, 23, 26, 1, 209, 216, 220, 16, 26, 1, 209, 216, 216, 251,
+ 26, 1, 209, 216, 216, 134, 26, 1, 209, 216, 212, 192, 26, 1, 209, 216,
+ 199, 57, 26, 1, 209, 216, 214, 25, 26, 1, 209, 216, 232, 84, 26, 1, 209,
+ 216, 214, 150, 26, 1, 209, 216, 212, 218, 26, 1, 209, 216, 212, 214, 26,
+ 1, 209, 216, 247, 240, 26, 1, 209, 216, 195, 78, 26, 1, 209, 216, 217, 0,
+ 26, 1, 209, 216, 206, 68, 26, 1, 209, 216, 213, 155, 26, 1, 209, 216,
+ 220, 35, 26, 1, 209, 216, 198, 121, 26, 1, 209, 216, 212, 200, 213, 246,
+ 26, 1, 209, 216, 213, 147, 26, 1, 209, 216, 221, 241, 26, 1, 209, 216,
+ 214, 30, 26, 1, 209, 216, 217, 125, 26, 1, 209, 216, 216, 244, 26, 1,
+ 209, 216, 218, 225, 26, 1, 209, 216, 220, 188, 26, 1, 209, 216, 213, 153,
+ 26, 1, 209, 216, 213, 246, 26, 1, 209, 216, 192, 244, 26, 1, 209, 216,
+ 214, 26, 26, 1, 209, 216, 212, 203, 26, 1, 209, 216, 212, 194, 26, 1,
+ 209, 216, 220, 205, 213, 110, 26, 1, 209, 216, 212, 201, 26, 1, 209, 216,
+ 214, 158, 26, 1, 209, 216, 217, 160, 212, 206, 26, 1, 209, 216, 192, 140,
+ 26, 1, 209, 216, 214, 157, 26, 1, 209, 216, 202, 255, 26, 1, 209, 216,
+ 203, 251, 26, 1, 209, 216, 216, 252, 26, 1, 209, 216, 217, 132, 26, 1,
+ 209, 216, 217, 6, 26, 1, 209, 216, 221, 229, 26, 1, 209, 216, 216, 253,
+ 26, 1, 209, 216, 221, 233, 26, 1, 209, 216, 217, 10, 209, 179, 26, 1,
+ 209, 216, 191, 186, 26, 1, 209, 216, 213, 143, 26, 1, 209, 216, 216, 80,
+ 26, 1, 209, 216, 215, 149, 26, 1, 209, 216, 203, 64, 26, 1, 209, 216,
+ 221, 252, 219, 250, 26, 1, 209, 216, 221, 252, 233, 65, 26, 1, 209, 216,
+ 214, 60, 26, 1, 209, 216, 214, 217, 26, 1, 209, 216, 219, 94, 26, 1, 209,
+ 216, 209, 139, 26, 1, 209, 216, 210, 34, 26, 1, 209, 216, 199, 73, 26, 1,
+ 158, 216, 242, 26, 1, 158, 193, 158, 26, 1, 158, 213, 141, 26, 1, 158,
+ 216, 142, 26, 1, 158, 213, 139, 26, 1, 158, 219, 139, 26, 1, 158, 213,
+ 144, 26, 1, 158, 212, 213, 26, 1, 158, 214, 44, 26, 1, 158, 212, 95, 26,
+ 1, 158, 192, 255, 26, 1, 158, 213, 254, 26, 1, 158, 203, 111, 26, 1, 158,
+ 214, 9, 26, 1, 158, 221, 236, 26, 1, 158, 199, 59, 26, 1, 158, 203, 90,
+ 26, 1, 158, 213, 152, 26, 1, 158, 200, 214, 26, 1, 158, 221, 241, 26, 1,
+ 158, 192, 128, 26, 1, 158, 220, 206, 26, 1, 158, 205, 130, 26, 1, 158,
+ 216, 147, 26, 1, 158, 214, 149, 26, 1, 158, 217, 95, 26, 1, 158, 216,
+ 153, 26, 1, 158, 203, 250, 26, 1, 158, 192, 70, 26, 1, 158, 213, 146, 26,
+ 1, 158, 221, 232, 216, 245, 26, 1, 158, 214, 5, 26, 1, 158, 197, 94, 26,
+ 1, 158, 231, 90, 26, 1, 158, 213, 251, 26, 1, 158, 233, 29, 26, 1, 158,
+ 214, 153, 26, 1, 158, 216, 126, 26, 1, 158, 219, 170, 26, 1, 158, 214,
+ 135, 26, 1, 158, 215, 227, 26, 1, 158, 216, 130, 26, 1, 158, 208, 127,
+ 26, 1, 158, 216, 128, 26, 1, 158, 216, 144, 26, 1, 158, 218, 208, 26, 1,
+ 158, 212, 205, 26, 1, 158, 217, 9, 26, 1, 158, 220, 177, 26, 1, 158, 212,
+ 84, 26, 1, 158, 199, 62, 26, 1, 158, 202, 8, 26, 1, 158, 191, 186, 26, 1,
+ 158, 221, 233, 26, 1, 158, 207, 162, 26, 1, 158, 199, 120, 26, 1, 158,
+ 214, 6, 26, 1, 158, 216, 149, 26, 1, 158, 212, 204, 26, 1, 158, 221, 231,
+ 26, 1, 158, 209, 129, 26, 1, 158, 209, 233, 26, 1, 158, 212, 57, 26, 1,
+ 158, 219, 176, 26, 1, 158, 214, 45, 26, 1, 158, 216, 146, 26, 1, 158,
+ 214, 18, 26, 1, 158, 191, 200, 26, 1, 158, 210, 137, 26, 1, 158, 191,
+ 199, 26, 1, 158, 214, 158, 26, 1, 158, 212, 193, 26, 1, 158, 200, 249,
+ 26, 1, 158, 220, 210, 26, 1, 158, 214, 34, 26, 1, 158, 214, 3, 26, 1,
+ 158, 197, 69, 26, 1, 158, 216, 157, 26, 1, 158, 220, 199, 26, 1, 158,
+ 212, 202, 26, 1, 158, 199, 60, 26, 1, 158, 217, 127, 26, 1, 158, 214, 43,
+ 26, 1, 158, 219, 169, 26, 1, 158, 214, 24, 26, 1, 158, 212, 207, 26, 1,
+ 158, 213, 125, 26, 1, 158, 231, 74, 26, 1, 158, 220, 232, 26, 1, 158,
+ 207, 56, 211, 119, 26, 1, 158, 199, 226, 26, 1, 158, 198, 50, 26, 1, 158,
+ 212, 81, 26, 1, 158, 206, 195, 26, 1, 158, 219, 227, 26, 1, 158, 216,
+ 210, 26, 1, 158, 218, 168, 26, 1, 158, 200, 160, 26, 1, 158, 215, 155,
+ 26, 1, 158, 203, 76, 26, 1, 158, 203, 86, 26, 1, 158, 220, 149, 26, 1,
+ 158, 212, 178, 26, 1, 158, 203, 5, 26, 1, 158, 212, 195, 26, 1, 158, 210,
+ 49, 26, 1, 158, 213, 219, 26, 1, 158, 203, 41, 26, 1, 158, 208, 143, 26,
+ 1, 158, 215, 84, 26, 1, 158, 219, 0, 26, 1, 158, 207, 56, 215, 144, 26,
+ 1, 158, 198, 193, 26, 1, 158, 212, 181, 26, 1, 158, 217, 10, 175, 26, 1,
+ 158, 205, 128, 26, 1, 158, 233, 108, 26, 1, 114, 214, 157, 26, 1, 114,
+ 198, 57, 26, 1, 114, 216, 255, 26, 1, 114, 220, 16, 26, 1, 114, 195, 10,
+ 26, 1, 114, 219, 6, 26, 1, 114, 210, 220, 26, 1, 114, 202, 21, 26, 1,
+ 114, 207, 134, 26, 1, 114, 212, 209, 26, 1, 114, 214, 128, 26, 1, 114,
+ 208, 161, 26, 1, 114, 199, 197, 26, 1, 114, 214, 11, 26, 1, 114, 221, 14,
+ 26, 1, 114, 192, 247, 26, 1, 114, 205, 50, 26, 1, 114, 214, 35, 26, 1,
+ 114, 210, 217, 26, 1, 114, 198, 59, 26, 1, 114, 220, 204, 26, 1, 114,
+ 219, 22, 26, 1, 114, 212, 212, 26, 1, 114, 213, 243, 26, 1, 114, 217,
+ 133, 26, 1, 114, 214, 4, 26, 1, 114, 213, 242, 26, 1, 114, 212, 211, 26,
+ 1, 114, 206, 192, 26, 1, 114, 213, 143, 26, 1, 114, 210, 46, 26, 1, 114,
+ 205, 197, 26, 1, 114, 214, 19, 26, 1, 114, 216, 136, 26, 1, 114, 231, 68,
+ 26, 1, 114, 214, 7, 26, 1, 114, 213, 154, 26, 1, 114, 217, 71, 26, 1,
+ 114, 219, 2, 26, 1, 114, 214, 40, 26, 1, 114, 214, 141, 26, 1, 114, 199,
+ 225, 212, 193, 26, 1, 114, 203, 252, 26, 1, 114, 208, 154, 26, 1, 114,
+ 214, 161, 202, 30, 26, 1, 114, 214, 27, 212, 95, 26, 1, 114, 192, 29, 26,
+ 1, 114, 231, 69, 26, 1, 114, 197, 88, 26, 1, 114, 192, 47, 26, 1, 114,
+ 209, 73, 26, 1, 114, 197, 75, 26, 1, 114, 221, 239, 26, 1, 114, 200, 248,
+ 26, 1, 114, 199, 61, 26, 1, 114, 195, 79, 26, 1, 114, 193, 100, 26, 1,
+ 114, 220, 123, 26, 1, 114, 208, 165, 26, 1, 114, 199, 239, 26, 1, 114,
+ 231, 89, 26, 1, 114, 214, 50, 26, 1, 114, 203, 89, 26, 1, 114, 216, 131,
+ 26, 1, 114, 217, 3, 26, 1, 114, 212, 44, 26, 1, 114, 213, 106, 26, 1,
+ 114, 231, 176, 26, 1, 114, 197, 76, 26, 1, 114, 220, 215, 26, 1, 114,
+ 192, 104, 26, 1, 114, 212, 82, 242, 237, 26, 1, 114, 192, 18, 26, 1, 114,
+ 216, 148, 26, 1, 114, 214, 146, 26, 1, 114, 209, 174, 26, 1, 114, 191,
+ 206, 26, 1, 114, 219, 171, 26, 1, 114, 232, 84, 26, 1, 114, 231, 175, 26,
+ 1, 114, 213, 253, 26, 1, 114, 221, 241, 26, 1, 114, 217, 136, 26, 1, 114,
+ 214, 10, 26, 1, 114, 231, 75, 26, 1, 114, 233, 109, 26, 1, 114, 212, 182,
+ 26, 1, 114, 209, 234, 26, 1, 114, 192, 45, 26, 1, 114, 214, 36, 26, 1,
+ 114, 212, 82, 248, 209, 26, 1, 114, 212, 24, 26, 1, 114, 209, 35, 26, 1,
+ 114, 216, 80, 26, 1, 114, 232, 82, 26, 1, 114, 214, 244, 26, 1, 114, 215,
+ 149, 26, 1, 114, 231, 74, 26, 1, 114, 232, 87, 68, 26, 1, 114, 215, 85,
+ 26, 1, 114, 208, 160, 26, 1, 114, 213, 255, 26, 1, 114, 220, 188, 26, 1,
+ 114, 209, 171, 26, 1, 114, 212, 196, 26, 1, 114, 192, 46, 26, 1, 114,
+ 214, 20, 26, 1, 114, 210, 221, 210, 19, 26, 1, 114, 232, 87, 247, 138,
+ 26, 1, 114, 232, 167, 26, 1, 114, 213, 148, 26, 1, 114, 65, 26, 1, 114,
+ 198, 50, 26, 1, 114, 74, 26, 1, 114, 68, 26, 1, 114, 220, 14, 26, 1, 114,
+ 210, 221, 209, 82, 26, 1, 114, 199, 245, 26, 1, 114, 199, 180, 26, 1,
+ 114, 214, 161, 215, 71, 228, 172, 26, 1, 114, 203, 64, 26, 1, 114, 192,
+ 42, 26, 1, 114, 213, 236, 26, 1, 114, 191, 211, 26, 1, 114, 191, 244,
+ 200, 136, 26, 1, 114, 191, 244, 238, 242, 26, 1, 114, 191, 194, 26, 1,
+ 114, 191, 202, 26, 1, 114, 221, 227, 26, 1, 114, 209, 232, 26, 1, 114,
+ 213, 149, 234, 49, 26, 1, 114, 208, 156, 26, 1, 114, 192, 253, 26, 1,
+ 114, 233, 52, 26, 1, 114, 195, 148, 26, 1, 114, 218, 225, 26, 1, 114,
+ 216, 100, 26, 1, 114, 207, 20, 26, 1, 114, 207, 163, 26, 1, 114, 213,
+ 235, 26, 1, 114, 214, 68, 26, 1, 114, 203, 56, 26, 1, 114, 203, 41, 26,
+ 1, 114, 232, 87, 207, 59, 26, 1, 114, 180, 26, 1, 114, 209, 185, 26, 1,
+ 114, 219, 0, 26, 1, 114, 221, 67, 26, 1, 114, 216, 186, 26, 1, 114, 174,
+ 26, 1, 114, 217, 68, 26, 1, 114, 199, 63, 26, 1, 114, 221, 166, 26, 1,
+ 114, 215, 231, 26, 1, 114, 199, 95, 26, 1, 114, 233, 76, 26, 1, 114, 231,
+ 62, 26, 1, 209, 215, 155, 26, 1, 209, 215, 66, 26, 1, 209, 215, 220, 232,
+ 26, 1, 209, 215, 234, 188, 26, 1, 209, 215, 207, 84, 26, 1, 209, 215,
+ 199, 226, 26, 1, 209, 215, 212, 81, 26, 1, 209, 215, 173, 26, 1, 209,
+ 215, 206, 195, 26, 1, 209, 215, 206, 242, 26, 1, 209, 215, 216, 210, 26,
+ 1, 209, 215, 199, 245, 26, 1, 209, 215, 214, 160, 26, 1, 209, 215, 213,
+ 155, 26, 1, 209, 215, 218, 168, 26, 1, 209, 215, 200, 160, 26, 1, 209,
+ 215, 203, 76, 26, 1, 209, 215, 202, 222, 26, 1, 209, 215, 203, 248, 26,
+ 1, 209, 215, 220, 149, 26, 1, 209, 215, 221, 241, 26, 1, 209, 215, 212,
+ 146, 26, 1, 209, 215, 212, 178, 26, 1, 209, 215, 213, 126, 26, 1, 209,
+ 215, 191, 243, 26, 1, 209, 215, 203, 5, 26, 1, 209, 215, 170, 26, 1, 209,
+ 215, 212, 215, 26, 1, 209, 215, 209, 232, 26, 1, 209, 215, 212, 195, 26,
+ 1, 209, 215, 192, 253, 26, 1, 209, 215, 210, 49, 26, 1, 209, 215, 206,
+ 68, 26, 1, 209, 215, 213, 219, 26, 1, 209, 215, 207, 20, 26, 1, 209, 215,
+ 221, 251, 26, 1, 209, 215, 213, 252, 26, 1, 209, 215, 214, 47, 26, 1,
+ 209, 215, 203, 56, 26, 1, 209, 215, 208, 161, 26, 1, 209, 215, 232, 167,
+ 26, 1, 209, 215, 193, 190, 26, 1, 209, 215, 219, 146, 26, 1, 209, 215,
+ 219, 0, 26, 1, 209, 215, 221, 67, 26, 1, 209, 215, 217, 1, 26, 1, 209,
+ 215, 207, 55, 26, 1, 209, 215, 174, 26, 1, 209, 215, 216, 12, 26, 1, 209,
+ 215, 217, 9, 26, 1, 209, 215, 199, 73, 26, 1, 209, 215, 221, 21, 26, 1,
+ 209, 215, 205, 150, 26, 1, 209, 215, 193, 248, 215, 159, 1, 190, 190,
+ 215, 159, 1, 214, 16, 215, 159, 1, 192, 12, 215, 159, 1, 216, 46, 215,
+ 159, 1, 249, 153, 215, 159, 1, 238, 32, 215, 159, 1, 65, 215, 159, 1,
+ 209, 211, 215, 159, 1, 221, 209, 215, 159, 1, 230, 22, 215, 159, 1, 238,
+ 7, 215, 159, 1, 243, 48, 215, 159, 1, 222, 15, 215, 159, 1, 211, 120,
+ 215, 159, 1, 217, 133, 215, 159, 1, 213, 179, 215, 159, 1, 168, 215, 159,
+ 1, 211, 87, 215, 159, 1, 74, 215, 159, 1, 206, 162, 215, 159, 1, 203, 81,
+ 215, 159, 1, 199, 32, 215, 159, 1, 234, 217, 215, 159, 1, 193, 190, 215,
+ 159, 1, 71, 215, 159, 1, 221, 67, 215, 159, 1, 220, 24, 215, 159, 1, 173,
+ 215, 159, 1, 230, 80, 215, 159, 1, 207, 1, 215, 159, 1, 199, 110, 215,
+ 159, 17, 191, 77, 215, 159, 17, 107, 215, 159, 17, 109, 215, 159, 17,
+ 138, 215, 159, 17, 134, 215, 159, 17, 149, 215, 159, 17, 169, 215, 159,
+ 17, 175, 215, 159, 17, 171, 215, 159, 17, 178, 215, 159, 237, 238, 215,
+ 159, 55, 237, 238, 199, 186, 1, 210, 238, 199, 186, 1, 211, 166, 199,
+ 186, 1, 211, 58, 199, 186, 1, 210, 247, 199, 186, 1, 250, 123, 199, 186,
+ 1, 252, 63, 199, 186, 1, 251, 37, 199, 186, 1, 250, 133, 199, 186, 1,
+ 193, 227, 199, 186, 1, 195, 155, 199, 186, 1, 194, 255, 199, 186, 1, 193,
+ 236, 199, 186, 1, 233, 182, 199, 186, 1, 234, 197, 199, 186, 1, 234, 46,
+ 199, 186, 1, 233, 221, 199, 186, 1, 223, 41, 199, 186, 1, 228, 28, 199,
+ 186, 1, 223, 79, 199, 186, 1, 223, 45, 199, 186, 1, 196, 18, 199, 186, 1,
+ 196, 160, 199, 186, 1, 196, 64, 199, 186, 1, 196, 22, 199, 186, 1, 250,
+ 134, 199, 186, 1, 250, 138, 199, 186, 1, 250, 136, 199, 186, 1, 250, 135,
+ 199, 186, 1, 196, 129, 199, 186, 1, 196, 138, 199, 186, 1, 196, 135, 199,
+ 186, 1, 196, 130, 199, 186, 1, 53, 214, 70, 199, 186, 1, 179, 196, 145,
+ 199, 186, 1, 203, 40, 196, 143, 199, 186, 1, 203, 40, 250, 135, 199, 186,
+ 1, 196, 150, 199, 186, 1, 196, 143, 199, 186, 1, 196, 146, 199, 186, 1,
+ 196, 145, 199, 186, 1, 196, 131, 199, 186, 1, 196, 134, 199, 186, 1, 196,
+ 133, 199, 186, 1, 196, 132, 199, 186, 1, 215, 63, 199, 186, 1, 216, 238,
+ 199, 186, 1, 215, 165, 199, 186, 1, 215, 72, 199, 186, 1, 155, 199, 186,
+ 1, 221, 215, 199, 186, 1, 231, 240, 199, 186, 1, 214, 68, 199, 186, 1,
+ 188, 199, 186, 1, 170, 199, 186, 1, 193, 190, 199, 186, 1, 168, 199, 186,
+ 1, 212, 101, 199, 186, 1, 209, 228, 199, 186, 1, 249, 153, 199, 186, 1,
+ 174, 199, 186, 1, 180, 199, 186, 1, 140, 199, 186, 1, 173, 199, 186, 1,
+ 228, 164, 199, 186, 1, 190, 190, 199, 186, 1, 238, 32, 199, 186, 1, 165,
+ 199, 186, 1, 213, 224, 199, 186, 1, 203, 165, 199, 186, 1, 247, 160, 199,
+ 186, 1, 197, 168, 199, 186, 1, 231, 91, 199, 186, 1, 228, 161, 199, 186,
+ 1, 199, 49, 199, 186, 1, 192, 220, 199, 186, 1, 233, 109, 199, 186, 1,
+ 237, 68, 199, 186, 1, 247, 1, 199, 186, 1, 191, 123, 199, 186, 17, 191,
+ 77, 199, 186, 17, 107, 199, 186, 17, 109, 199, 186, 17, 138, 199, 186,
+ 17, 134, 199, 186, 17, 149, 199, 186, 17, 169, 199, 186, 17, 175, 199,
+ 186, 17, 171, 199, 186, 17, 178, 249, 67, 195, 185, 1, 234, 84, 249, 67,
+ 195, 185, 1, 155, 249, 67, 195, 185, 1, 205, 68, 249, 67, 195, 185, 1,
+ 233, 109, 249, 67, 195, 185, 1, 217, 4, 249, 67, 195, 185, 1, 192, 30,
+ 249, 67, 195, 185, 1, 231, 225, 249, 67, 195, 185, 1, 237, 49, 249, 67,
+ 195, 185, 1, 221, 20, 249, 67, 195, 185, 1, 222, 201, 249, 67, 195, 185,
+ 1, 228, 124, 249, 67, 195, 185, 1, 193, 190, 249, 67, 195, 185, 1, 191,
+ 7, 249, 67, 195, 185, 1, 231, 169, 249, 67, 195, 185, 1, 236, 174, 249,
+ 67, 195, 185, 1, 247, 42, 249, 67, 195, 185, 1, 196, 23, 249, 67, 195,
+ 185, 1, 159, 249, 67, 195, 185, 1, 249, 153, 249, 67, 195, 185, 1, 193,
+ 249, 249, 67, 195, 185, 1, 192, 74, 249, 67, 195, 185, 1, 168, 249, 67,
+ 195, 185, 1, 193, 177, 249, 67, 195, 185, 1, 65, 249, 67, 195, 185, 1,
+ 74, 249, 67, 195, 185, 1, 211, 87, 249, 67, 195, 185, 1, 66, 249, 67,
+ 195, 185, 1, 234, 188, 249, 67, 195, 185, 1, 71, 249, 67, 195, 185, 1,
+ 68, 249, 67, 195, 185, 33, 137, 198, 79, 249, 67, 195, 185, 33, 130, 198,
+ 79, 249, 67, 195, 185, 33, 216, 87, 198, 79, 249, 67, 195, 185, 33, 218,
+ 238, 198, 79, 249, 67, 195, 185, 33, 229, 133, 198, 79, 249, 67, 195,
+ 185, 232, 80, 201, 63, 145, 90, 18, 222, 12, 145, 90, 18, 222, 8, 145,
+ 90, 18, 221, 155, 145, 90, 18, 221, 118, 145, 90, 18, 222, 41, 145, 90,
+ 18, 222, 38, 145, 90, 18, 220, 216, 145, 90, 18, 220, 185, 145, 90, 18,
+ 222, 14, 145, 90, 18, 221, 225, 145, 90, 18, 222, 101, 145, 90, 18, 222,
+ 98, 145, 90, 18, 221, 40, 145, 90, 18, 221, 37, 145, 90, 18, 222, 34,
+ 145, 90, 18, 222, 31, 145, 90, 18, 220, 218, 145, 90, 18, 220, 217, 145,
+ 90, 18, 221, 60, 145, 90, 18, 221, 25, 145, 90, 18, 221, 157, 145, 90,
+ 18, 221, 156, 145, 90, 18, 222, 117, 145, 90, 18, 222, 37, 145, 90, 18,
+ 220, 175, 145, 90, 18, 220, 166, 145, 90, 18, 222, 126, 145, 90, 18, 222,
+ 118, 145, 90, 120, 195, 160, 145, 90, 120, 212, 185, 145, 90, 120, 220,
+ 0, 145, 90, 120, 230, 2, 145, 90, 120, 213, 82, 145, 90, 120, 207, 125,
+ 145, 90, 120, 213, 109, 145, 90, 120, 208, 69, 145, 90, 120, 192, 91,
+ 145, 90, 120, 229, 108, 145, 90, 120, 217, 25, 145, 90, 120, 243, 131,
+ 145, 90, 120, 214, 165, 145, 90, 120, 229, 44, 145, 90, 120, 209, 91,
+ 145, 90, 120, 212, 191, 145, 90, 120, 214, 205, 145, 90, 120, 250, 163,
+ 145, 90, 120, 192, 216, 145, 90, 120, 247, 76, 145, 90, 87, 243, 17, 197,
+ 85, 145, 90, 87, 243, 17, 202, 46, 145, 90, 87, 243, 17, 221, 243, 145,
+ 90, 87, 243, 17, 221, 198, 145, 90, 87, 243, 17, 200, 246, 145, 90, 87,
+ 243, 17, 229, 2, 145, 90, 87, 243, 17, 199, 165, 145, 90, 3, 195, 5, 198,
+ 238, 145, 90, 3, 195, 5, 197, 156, 247, 33, 145, 90, 3, 243, 17, 243,
+ 120, 145, 90, 3, 195, 5, 199, 10, 145, 90, 3, 195, 5, 233, 49, 145, 90,
+ 3, 192, 171, 212, 179, 145, 90, 3, 192, 171, 207, 3, 145, 90, 3, 192,
+ 171, 198, 32, 145, 90, 3, 192, 171, 233, 90, 145, 90, 3, 195, 5, 205, 44,
+ 145, 90, 3, 216, 209, 200, 250, 145, 90, 3, 195, 5, 212, 231, 145, 90, 3,
+ 228, 31, 192, 111, 145, 90, 3, 192, 215, 145, 90, 3, 243, 17, 197, 143,
+ 206, 144, 145, 90, 17, 191, 77, 145, 90, 17, 107, 145, 90, 17, 109, 145,
+ 90, 17, 138, 145, 90, 17, 134, 145, 90, 17, 149, 145, 90, 17, 169, 145,
+ 90, 17, 175, 145, 90, 17, 171, 145, 90, 17, 178, 145, 90, 31, 199, 90,
+ 145, 90, 31, 228, 138, 145, 90, 31, 199, 96, 198, 228, 145, 90, 31, 216,
+ 47, 145, 90, 31, 228, 141, 216, 47, 145, 90, 31, 199, 96, 248, 169, 145,
+ 90, 31, 197, 227, 145, 90, 3, 195, 5, 218, 220, 145, 90, 3, 192, 168,
+ 145, 90, 3, 229, 103, 145, 90, 3, 198, 255, 229, 103, 145, 90, 3, 190,
+ 236, 199, 43, 145, 90, 3, 229, 28, 145, 90, 3, 212, 245, 145, 90, 3, 192,
+ 206, 145, 90, 3, 212, 183, 145, 90, 3, 250, 146, 145, 90, 3, 197, 7, 247,
+ 32, 145, 90, 3, 216, 209, 197, 159, 145, 90, 3, 199, 166, 145, 90, 3,
+ 218, 253, 145, 90, 3, 215, 103, 145, 90, 3, 243, 17, 230, 76, 218, 196,
+ 212, 189, 212, 188, 145, 90, 3, 243, 17, 238, 194, 197, 150, 145, 90, 3,
+ 243, 17, 197, 5, 145, 90, 3, 243, 17, 197, 6, 243, 36, 145, 90, 3, 243,
+ 17, 208, 159, 237, 206, 145, 90, 3, 243, 17, 212, 238, 198, 41, 145, 90,
+ 242, 244, 3, 197, 154, 145, 90, 242, 244, 3, 192, 76, 145, 90, 242, 244,
+ 3, 219, 90, 145, 90, 242, 244, 3, 219, 254, 145, 90, 242, 244, 3, 192,
+ 167, 145, 90, 242, 244, 3, 221, 41, 145, 90, 242, 244, 3, 229, 254, 145,
+ 90, 242, 244, 3, 215, 147, 145, 90, 242, 244, 3, 198, 239, 145, 90, 242,
+ 244, 3, 197, 165, 145, 90, 242, 244, 3, 209, 225, 145, 90, 242, 244, 3,
+ 221, 213, 145, 90, 242, 244, 3, 230, 64, 145, 90, 242, 244, 3, 195, 182,
+ 145, 90, 242, 244, 3, 233, 86, 145, 90, 242, 244, 3, 192, 118, 145, 90,
+ 242, 244, 3, 197, 137, 145, 90, 242, 244, 3, 220, 170, 145, 90, 242, 244,
+ 3, 193, 237, 216, 218, 6, 1, 218, 168, 216, 218, 6, 1, 206, 8, 216, 218,
+ 6, 1, 196, 12, 216, 218, 6, 1, 193, 224, 216, 218, 6, 1, 250, 176, 216,
+ 218, 6, 1, 191, 166, 216, 218, 6, 1, 221, 22, 216, 218, 6, 1, 210, 236,
+ 216, 218, 6, 1, 200, 43, 216, 218, 6, 1, 232, 51, 216, 218, 6, 1, 233,
+ 175, 216, 218, 6, 1, 68, 216, 218, 6, 1, 222, 152, 216, 218, 6, 1, 65,
+ 216, 218, 6, 1, 223, 35, 216, 218, 6, 1, 71, 216, 218, 6, 1, 250, 120,
+ 216, 218, 6, 1, 247, 193, 216, 218, 6, 1, 66, 216, 218, 6, 1, 191, 225,
+ 216, 218, 6, 1, 172, 216, 218, 6, 1, 208, 104, 216, 218, 6, 1, 228, 169,
+ 216, 218, 6, 1, 212, 103, 216, 218, 6, 1, 192, 235, 216, 218, 6, 1, 238,
+ 127, 216, 218, 6, 1, 211, 151, 216, 218, 6, 1, 215, 61, 216, 218, 6, 1,
+ 146, 216, 218, 6, 1, 74, 216, 218, 6, 1, 251, 236, 216, 218, 6, 1, 192,
+ 159, 216, 218, 2, 1, 218, 168, 216, 218, 2, 1, 206, 8, 216, 218, 2, 1,
+ 196, 12, 216, 218, 2, 1, 193, 224, 216, 218, 2, 1, 250, 176, 216, 218, 2,
+ 1, 191, 166, 216, 218, 2, 1, 221, 22, 216, 218, 2, 1, 210, 236, 216, 218,
+ 2, 1, 200, 43, 216, 218, 2, 1, 232, 51, 216, 218, 2, 1, 233, 175, 216,
+ 218, 2, 1, 68, 216, 218, 2, 1, 222, 152, 216, 218, 2, 1, 65, 216, 218, 2,
+ 1, 223, 35, 216, 218, 2, 1, 71, 216, 218, 2, 1, 250, 120, 216, 218, 2, 1,
+ 247, 193, 216, 218, 2, 1, 66, 216, 218, 2, 1, 191, 225, 216, 218, 2, 1,
+ 172, 216, 218, 2, 1, 208, 104, 216, 218, 2, 1, 228, 169, 216, 218, 2, 1,
+ 212, 103, 216, 218, 2, 1, 192, 235, 216, 218, 2, 1, 238, 127, 216, 218,
+ 2, 1, 211, 151, 216, 218, 2, 1, 215, 61, 216, 218, 2, 1, 146, 216, 218,
+ 2, 1, 74, 216, 218, 2, 1, 251, 236, 216, 218, 2, 1, 192, 159, 216, 218,
+ 17, 191, 77, 216, 218, 17, 107, 216, 218, 17, 109, 216, 218, 17, 138,
+ 216, 218, 17, 134, 216, 218, 17, 149, 216, 218, 17, 169, 216, 218, 17,
+ 175, 216, 218, 17, 171, 216, 218, 17, 178, 216, 218, 31, 199, 95, 216,
+ 218, 31, 234, 127, 216, 218, 31, 197, 37, 216, 218, 31, 198, 251, 216,
+ 218, 31, 232, 122, 216, 218, 31, 233, 19, 216, 218, 31, 202, 130, 216,
+ 218, 31, 203, 244, 216, 218, 31, 234, 161, 216, 218, 31, 213, 171, 216,
+ 218, 17, 91, 251, 157, 20, 216, 218, 17, 105, 251, 157, 20, 216, 218, 17,
+ 115, 251, 157, 20, 216, 218, 242, 74, 216, 218, 232, 80, 201, 63, 216,
+ 218, 16, 251, 221, 216, 218, 233, 216, 211, 136, 121, 1, 168, 121, 1,
+ 249, 153, 121, 1, 11, 168, 121, 1, 209, 110, 121, 1, 174, 121, 1, 216,
+ 103, 121, 1, 251, 14, 174, 121, 1, 233, 109, 121, 1, 195, 188, 121, 1,
+ 195, 71, 121, 1, 190, 190, 121, 1, 238, 32, 121, 1, 11, 197, 132, 121, 1,
+ 11, 190, 190, 121, 1, 197, 132, 121, 1, 237, 191, 121, 1, 180, 121, 1,
+ 213, 224, 121, 1, 11, 213, 79, 121, 1, 251, 14, 180, 121, 1, 213, 79,
+ 121, 1, 213, 65, 121, 1, 173, 121, 1, 218, 182, 121, 1, 219, 159, 121, 1,
+ 219, 148, 121, 1, 198, 112, 121, 1, 236, 183, 121, 1, 198, 104, 121, 1,
+ 236, 182, 121, 1, 155, 121, 1, 231, 240, 121, 1, 11, 155, 121, 1, 208,
+ 96, 121, 1, 208, 72, 121, 1, 214, 68, 121, 1, 214, 17, 121, 1, 251, 14,
+ 214, 68, 121, 1, 140, 121, 1, 192, 220, 121, 1, 231, 91, 121, 1, 231, 66,
+ 121, 1, 197, 142, 121, 1, 235, 18, 121, 1, 212, 101, 121, 1, 212, 83,
+ 121, 1, 197, 157, 121, 1, 235, 29, 121, 1, 11, 197, 157, 121, 1, 11, 235,
+ 29, 121, 1, 207, 82, 197, 157, 121, 1, 203, 165, 121, 1, 201, 175, 121,
+ 1, 191, 71, 121, 1, 190, 253, 121, 1, 197, 168, 121, 1, 235, 35, 121, 1,
+ 11, 197, 168, 121, 1, 188, 121, 1, 191, 123, 121, 1, 190, 254, 121, 1,
+ 190, 224, 121, 1, 190, 204, 121, 1, 251, 14, 190, 224, 121, 1, 190, 196,
+ 121, 1, 190, 203, 121, 1, 193, 190, 121, 1, 251, 245, 121, 1, 229, 177,
+ 121, 1, 248, 32, 121, 1, 200, 125, 121, 1, 235, 19, 121, 1, 199, 145,
+ 121, 1, 197, 161, 121, 1, 206, 71, 121, 3, 120, 52, 164, 121, 1, 214,
+ 212, 121, 3, 250, 199, 121, 3, 207, 82, 195, 18, 121, 3, 207, 82, 250,
+ 199, 121, 18, 3, 65, 121, 18, 3, 252, 206, 121, 18, 3, 251, 241, 121, 18,
+ 3, 251, 132, 121, 18, 3, 251, 122, 121, 18, 3, 74, 121, 18, 3, 211, 87,
+ 121, 18, 3, 193, 48, 121, 18, 3, 193, 224, 121, 18, 3, 71, 121, 18, 3,
+ 234, 103, 121, 18, 3, 234, 88, 121, 18, 3, 211, 147, 121, 18, 3, 68, 121,
+ 18, 3, 228, 35, 121, 18, 3, 228, 34, 121, 18, 3, 228, 33, 121, 18, 3,
+ 223, 88, 121, 18, 3, 223, 226, 121, 18, 3, 223, 199, 121, 18, 3, 223, 49,
+ 121, 18, 3, 223, 136, 121, 18, 3, 66, 121, 18, 3, 196, 168, 121, 18, 3,
+ 196, 167, 121, 18, 3, 196, 166, 121, 18, 3, 196, 30, 121, 18, 3, 196,
+ 148, 121, 18, 3, 196, 97, 121, 18, 3, 192, 159, 121, 18, 3, 192, 33, 121,
+ 18, 3, 252, 25, 121, 18, 3, 252, 21, 121, 18, 3, 234, 26, 121, 18, 3,
+ 206, 113, 234, 26, 121, 18, 3, 234, 34, 121, 18, 3, 206, 113, 234, 34,
+ 121, 18, 3, 251, 236, 121, 18, 3, 234, 166, 121, 18, 3, 250, 163, 121,
+ 18, 3, 211, 19, 121, 18, 3, 215, 61, 121, 18, 3, 214, 70, 121, 18, 3,
+ 196, 81, 121, 18, 3, 191, 205, 121, 18, 3, 211, 141, 121, 18, 3, 211,
+ 148, 121, 18, 3, 193, 239, 121, 18, 3, 223, 204, 121, 18, 3, 234, 217,
+ 121, 18, 3, 223, 86, 121, 18, 3, 196, 139, 121, 163, 183, 121, 163, 198,
+ 54, 183, 121, 163, 58, 121, 163, 60, 121, 1, 198, 77, 121, 1, 198, 76,
+ 121, 1, 198, 75, 121, 1, 198, 74, 121, 1, 198, 73, 121, 1, 198, 72, 121,
+ 1, 198, 71, 121, 1, 207, 82, 198, 78, 121, 1, 207, 82, 198, 77, 121, 1,
+ 207, 82, 198, 75, 121, 1, 207, 82, 198, 74, 121, 1, 207, 82, 198, 73,
+ 121, 1, 207, 82, 198, 71, 19, 223, 51, 77, 46, 223, 51, 77, 39, 243, 80,
+ 228, 251, 77, 39, 243, 80, 223, 51, 77, 41, 2, 27, 233, 3, 195, 57, 251,
+ 157, 207, 107, 87, 247, 160, 195, 57, 251, 157, 207, 107, 87, 213, 223,
+ 19, 242, 63, 19, 242, 62, 19, 242, 61, 19, 242, 60, 19, 242, 59, 19, 242,
+ 58, 19, 242, 57, 19, 242, 56, 19, 242, 55, 19, 242, 54, 19, 242, 53, 19,
+ 242, 52, 19, 242, 51, 19, 242, 50, 19, 242, 49, 19, 242, 48, 19, 242, 47,
+ 19, 242, 46, 19, 242, 45, 19, 242, 44, 19, 242, 43, 19, 242, 42, 19, 242,
+ 41, 19, 242, 40, 19, 242, 39, 19, 242, 38, 19, 242, 37, 19, 242, 36, 19,
+ 242, 35, 19, 242, 34, 19, 242, 33, 19, 242, 32, 19, 242, 31, 19, 242, 30,
+ 19, 242, 29, 19, 242, 28, 19, 242, 27, 19, 242, 26, 19, 242, 25, 19, 242,
+ 24, 19, 242, 23, 19, 242, 22, 19, 242, 21, 19, 242, 20, 19, 242, 19, 19,
+ 242, 18, 19, 242, 17, 19, 242, 16, 19, 242, 15, 19, 242, 14, 19, 242, 13,
+ 19, 242, 12, 19, 242, 11, 19, 242, 10, 19, 242, 9, 19, 242, 8, 19, 242,
+ 7, 19, 242, 6, 19, 242, 5, 19, 242, 4, 19, 242, 3, 19, 242, 2, 19, 242,
+ 1, 19, 242, 0, 19, 241, 255, 19, 241, 254, 19, 241, 253, 19, 241, 252,
+ 19, 241, 251, 19, 241, 250, 19, 241, 249, 19, 241, 248, 19, 241, 247, 19,
+ 241, 246, 19, 241, 245, 19, 241, 244, 19, 241, 243, 19, 241, 242, 19,
+ 241, 241, 19, 241, 240, 19, 241, 239, 19, 241, 238, 19, 241, 237, 19,
+ 241, 236, 19, 241, 235, 19, 241, 234, 19, 241, 233, 19, 241, 232, 19,
+ 241, 231, 19, 241, 230, 19, 241, 229, 19, 241, 228, 19, 241, 227, 19,
+ 241, 226, 19, 241, 225, 19, 241, 224, 19, 241, 223, 19, 241, 222, 19,
+ 241, 221, 19, 241, 220, 19, 241, 219, 19, 241, 218, 19, 241, 217, 19,
+ 241, 216, 19, 241, 215, 19, 241, 214, 19, 241, 213, 19, 241, 212, 19,
+ 241, 211, 19, 241, 210, 19, 241, 209, 19, 241, 208, 19, 241, 207, 19,
+ 241, 206, 19, 241, 205, 19, 241, 204, 19, 241, 203, 19, 241, 202, 19,
+ 241, 201, 19, 241, 200, 19, 241, 199, 19, 241, 198, 19, 241, 197, 19,
+ 241, 196, 19, 241, 195, 19, 241, 194, 19, 241, 193, 19, 241, 192, 19,
+ 241, 191, 19, 241, 190, 19, 241, 189, 19, 241, 188, 19, 241, 187, 19,
+ 241, 186, 19, 241, 185, 19, 241, 184, 19, 241, 183, 19, 241, 182, 19,
+ 241, 181, 19, 241, 180, 19, 241, 179, 19, 241, 178, 19, 241, 177, 19,
+ 241, 176, 19, 241, 175, 19, 241, 174, 19, 241, 173, 19, 241, 172, 19,
+ 241, 171, 19, 241, 170, 19, 241, 169, 19, 241, 168, 19, 241, 167, 19,
+ 241, 166, 19, 241, 165, 19, 241, 164, 19, 241, 163, 19, 241, 162, 19,
+ 241, 161, 19, 241, 160, 19, 241, 159, 19, 241, 158, 19, 241, 157, 19,
+ 241, 156, 19, 241, 155, 19, 241, 154, 19, 241, 153, 19, 241, 152, 19,
+ 241, 151, 19, 241, 150, 19, 241, 149, 19, 241, 148, 19, 241, 147, 19,
+ 241, 146, 19, 241, 145, 19, 241, 144, 19, 241, 143, 19, 241, 142, 19,
+ 241, 141, 19, 241, 140, 19, 241, 139, 19, 241, 138, 19, 241, 137, 19,
+ 241, 136, 19, 241, 135, 19, 241, 134, 19, 241, 133, 19, 241, 132, 19,
+ 241, 131, 19, 241, 130, 19, 241, 129, 19, 241, 128, 19, 241, 127, 19,
+ 241, 126, 19, 241, 125, 19, 241, 124, 19, 241, 123, 19, 241, 122, 19,
+ 241, 121, 19, 241, 120, 19, 241, 119, 19, 241, 118, 19, 241, 117, 19,
+ 241, 116, 19, 241, 115, 19, 241, 114, 19, 241, 113, 19, 241, 112, 19,
+ 241, 111, 19, 241, 110, 19, 241, 109, 19, 241, 108, 19, 241, 107, 19,
+ 241, 106, 19, 241, 105, 19, 241, 104, 19, 241, 103, 19, 241, 102, 19,
+ 241, 101, 19, 241, 100, 19, 241, 99, 19, 241, 98, 19, 241, 97, 19, 241,
+ 96, 19, 241, 95, 19, 241, 94, 19, 241, 93, 19, 241, 92, 19, 241, 91, 19,
+ 241, 90, 19, 241, 89, 19, 241, 88, 19, 241, 87, 19, 241, 86, 19, 241, 85,
+ 19, 241, 84, 19, 241, 83, 19, 241, 82, 19, 241, 81, 19, 241, 80, 19, 241,
+ 79, 19, 241, 78, 19, 241, 77, 19, 241, 76, 19, 241, 75, 19, 241, 74, 19,
+ 241, 73, 19, 241, 72, 19, 241, 71, 19, 241, 70, 19, 241, 69, 19, 241, 68,
+ 19, 241, 67, 19, 241, 66, 19, 241, 65, 19, 241, 64, 19, 241, 63, 19, 241,
+ 62, 19, 241, 61, 19, 241, 60, 19, 241, 59, 19, 241, 58, 19, 241, 57, 19,
+ 241, 56, 19, 241, 55, 19, 241, 54, 19, 241, 53, 19, 241, 52, 19, 241, 51,
+ 19, 241, 50, 19, 241, 49, 19, 241, 48, 19, 241, 47, 19, 241, 46, 19, 241,
+ 45, 19, 241, 44, 19, 241, 43, 19, 241, 42, 19, 241, 41, 19, 241, 40, 19,
+ 241, 39, 19, 241, 38, 19, 241, 37, 19, 241, 36, 19, 241, 35, 19, 241, 34,
+ 19, 241, 33, 19, 241, 32, 19, 241, 31, 19, 241, 30, 19, 241, 29, 19, 241,
+ 28, 19, 241, 27, 19, 241, 26, 19, 241, 25, 19, 241, 24, 19, 241, 23, 19,
+ 241, 22, 19, 241, 21, 19, 241, 20, 19, 241, 19, 19, 241, 18, 19, 241, 17,
+ 19, 241, 16, 19, 241, 15, 19, 241, 14, 19, 241, 13, 19, 241, 12, 19, 241,
+ 11, 19, 241, 10, 19, 241, 9, 19, 241, 8, 19, 241, 7, 19, 241, 6, 19, 241,
+ 5, 19, 241, 4, 19, 241, 3, 19, 241, 2, 19, 241, 1, 19, 241, 0, 19, 240,
+ 255, 19, 240, 254, 19, 240, 253, 19, 240, 252, 19, 240, 251, 19, 240,
+ 250, 19, 240, 249, 19, 240, 248, 19, 240, 247, 19, 240, 246, 19, 240,
+ 245, 19, 240, 244, 19, 240, 243, 19, 240, 242, 19, 240, 241, 19, 240,
+ 240, 19, 240, 239, 19, 240, 238, 19, 240, 237, 19, 240, 236, 19, 240,
+ 235, 19, 240, 234, 19, 240, 233, 19, 240, 232, 19, 240, 231, 19, 240,
+ 230, 19, 240, 229, 19, 240, 228, 19, 240, 227, 19, 240, 226, 19, 240,
+ 225, 19, 240, 224, 19, 240, 223, 19, 240, 222, 19, 240, 221, 19, 240,
+ 220, 19, 240, 219, 19, 240, 218, 19, 240, 217, 19, 240, 216, 19, 240,
+ 215, 19, 240, 214, 19, 240, 213, 19, 240, 212, 19, 240, 211, 19, 240,
+ 210, 19, 240, 209, 19, 240, 208, 19, 240, 207, 19, 240, 206, 19, 240,
+ 205, 19, 240, 204, 19, 240, 203, 19, 240, 202, 19, 240, 201, 19, 240,
+ 200, 19, 240, 199, 19, 240, 198, 19, 240, 197, 19, 240, 196, 19, 240,
+ 195, 19, 240, 194, 19, 240, 193, 19, 240, 192, 19, 240, 191, 19, 240,
+ 190, 19, 240, 189, 19, 240, 188, 19, 240, 187, 19, 240, 186, 19, 240,
+ 185, 19, 240, 184, 19, 240, 183, 19, 240, 182, 19, 240, 181, 19, 240,
+ 180, 19, 240, 179, 19, 240, 178, 19, 240, 177, 19, 240, 176, 19, 240,
+ 175, 19, 240, 174, 19, 240, 173, 19, 240, 172, 19, 240, 171, 19, 240,
+ 170, 19, 240, 169, 19, 240, 168, 19, 240, 167, 19, 240, 166, 19, 240,
+ 165, 19, 240, 164, 19, 240, 163, 19, 240, 162, 19, 240, 161, 19, 240,
+ 160, 19, 240, 159, 19, 240, 158, 19, 240, 157, 19, 240, 156, 19, 240,
+ 155, 19, 240, 154, 19, 240, 153, 19, 240, 152, 19, 240, 151, 19, 240,
+ 150, 19, 240, 149, 19, 240, 148, 19, 240, 147, 19, 240, 146, 19, 240,
+ 145, 19, 240, 144, 19, 240, 143, 19, 240, 142, 19, 240, 141, 19, 240,
+ 140, 19, 240, 139, 19, 240, 138, 19, 240, 137, 19, 240, 136, 19, 240,
+ 135, 19, 240, 134, 19, 240, 133, 19, 240, 132, 19, 240, 131, 19, 240,
+ 130, 19, 240, 129, 19, 240, 128, 19, 240, 127, 19, 240, 126, 19, 240,
+ 125, 19, 240, 124, 19, 240, 123, 19, 240, 122, 19, 240, 121, 19, 240,
+ 120, 19, 240, 119, 19, 240, 118, 19, 240, 117, 19, 240, 116, 19, 240,
+ 115, 19, 240, 114, 19, 240, 113, 19, 240, 112, 19, 240, 111, 19, 240,
+ 110, 19, 240, 109, 19, 240, 108, 19, 240, 107, 19, 240, 106, 19, 240,
+ 105, 19, 240, 104, 19, 240, 103, 19, 240, 102, 19, 240, 101, 19, 240,
+ 100, 19, 240, 99, 19, 240, 98, 19, 240, 97, 19, 240, 96, 19, 240, 95, 19,
+ 240, 94, 19, 240, 93, 19, 240, 92, 19, 240, 91, 19, 240, 90, 19, 240, 89,
+ 19, 240, 88, 19, 240, 87, 19, 240, 86, 19, 240, 85, 19, 240, 84, 19, 240,
+ 83, 19, 240, 82, 19, 240, 81, 19, 240, 80, 19, 240, 79, 19, 240, 78, 19,
+ 240, 77, 19, 240, 76, 19, 240, 75, 19, 240, 74, 19, 240, 73, 19, 240, 72,
+ 19, 240, 71, 19, 240, 70, 19, 240, 69, 19, 240, 68, 19, 240, 67, 19, 240,
+ 66, 19, 240, 65, 19, 240, 64, 19, 240, 63, 19, 240, 62, 19, 240, 61, 19,
+ 240, 60, 19, 240, 59, 19, 240, 58, 19, 240, 57, 19, 240, 56, 19, 240, 55,
+ 19, 240, 54, 19, 240, 53, 19, 240, 52, 19, 240, 51, 19, 240, 50, 19, 240,
+ 49, 19, 240, 48, 19, 240, 47, 19, 240, 46, 19, 240, 45, 19, 240, 44, 19,
+ 240, 43, 19, 240, 42, 19, 240, 41, 19, 240, 40, 19, 240, 39, 19, 240, 38,
+ 19, 240, 37, 19, 240, 36, 19, 240, 35, 19, 240, 34, 19, 240, 33, 19, 240,
+ 32, 19, 240, 31, 19, 240, 30, 19, 240, 29, 19, 240, 28, 19, 240, 27, 19,
+ 240, 26, 19, 240, 25, 19, 240, 24, 19, 240, 23, 19, 240, 22, 19, 240, 21,
+ 19, 240, 20, 19, 240, 19, 19, 240, 18, 19, 240, 17, 19, 240, 16, 19, 240,
+ 15, 19, 240, 14, 19, 240, 13, 19, 240, 12, 19, 240, 11, 19, 240, 10, 19,
+ 240, 9, 19, 240, 8, 19, 240, 7, 19, 240, 6, 19, 240, 5, 19, 240, 4, 19,
+ 240, 3, 19, 240, 2, 19, 240, 1, 19, 240, 0, 19, 239, 255, 19, 239, 254,
+ 19, 239, 253, 19, 239, 252, 19, 239, 251, 19, 239, 250, 19, 239, 249, 19,
+ 239, 248, 19, 239, 247, 19, 239, 246, 19, 239, 245, 19, 239, 244, 19,
+ 239, 243, 19, 239, 242, 19, 239, 241, 19, 239, 240, 19, 239, 239, 19,
+ 239, 238, 19, 239, 237, 19, 239, 236, 19, 239, 235, 19, 239, 234, 19,
+ 239, 233, 19, 239, 232, 19, 239, 231, 19, 239, 230, 19, 239, 229, 19,
+ 239, 228, 19, 239, 227, 19, 239, 226, 19, 239, 225, 19, 239, 224, 19,
+ 239, 223, 19, 239, 222, 19, 239, 221, 19, 239, 220, 19, 239, 219, 19,
+ 239, 218, 19, 239, 217, 19, 239, 216, 19, 239, 215, 19, 239, 214, 19,
+ 239, 213, 19, 239, 212, 19, 239, 211, 19, 239, 210, 19, 239, 209, 19,
+ 239, 208, 19, 239, 207, 19, 239, 206, 19, 239, 205, 19, 239, 204, 19,
+ 239, 203, 19, 239, 202, 19, 239, 201, 19, 239, 200, 19, 239, 199, 19,
+ 239, 198, 19, 239, 197, 19, 239, 196, 19, 239, 195, 19, 239, 194, 19,
+ 239, 193, 19, 239, 192, 19, 239, 191, 19, 239, 190, 19, 239, 189, 19,
+ 239, 188, 19, 239, 187, 19, 239, 186, 19, 239, 185, 19, 239, 184, 19,
+ 239, 183, 19, 239, 182, 19, 239, 181, 19, 239, 180, 19, 239, 179, 19,
+ 239, 178, 19, 239, 177, 19, 239, 176, 19, 239, 175, 19, 239, 174, 19,
+ 239, 173, 19, 239, 172, 19, 239, 171, 19, 239, 170, 19, 239, 169, 19,
+ 239, 168, 19, 239, 167, 19, 239, 166, 19, 239, 165, 19, 239, 164, 19,
+ 239, 163, 19, 239, 162, 19, 239, 161, 19, 239, 160, 19, 239, 159, 19,
+ 239, 158, 19, 239, 157, 19, 239, 156, 19, 239, 155, 19, 239, 154, 19,
+ 239, 153, 19, 239, 152, 19, 239, 151, 19, 239, 150, 19, 239, 149, 19,
+ 239, 148, 19, 239, 147, 19, 239, 146, 19, 239, 145, 19, 239, 144, 19,
+ 239, 143, 19, 239, 142, 19, 239, 141, 19, 239, 140, 19, 239, 139, 19,
+ 239, 138, 19, 239, 137, 19, 239, 136, 19, 239, 135, 19, 239, 134, 19,
+ 239, 133, 19, 239, 132, 19, 239, 131, 19, 239, 130, 19, 239, 129, 19,
+ 239, 128, 19, 239, 127, 19, 239, 126, 19, 239, 125, 19, 239, 124, 19,
+ 239, 123, 19, 239, 122, 19, 239, 121, 19, 239, 120, 19, 239, 119, 19,
+ 239, 118, 19, 239, 117, 19, 239, 116, 19, 239, 115, 19, 239, 114, 19,
+ 239, 113, 19, 239, 112, 19, 239, 111, 19, 239, 110, 19, 239, 109, 19,
+ 239, 108, 19, 239, 107, 19, 239, 106, 19, 239, 105, 19, 239, 104, 19,
+ 239, 103, 19, 239, 102, 19, 239, 101, 19, 239, 100, 19, 239, 99, 19, 239,
+ 98, 19, 239, 97, 19, 239, 96, 19, 239, 95, 19, 239, 94, 19, 239, 93, 19,
+ 239, 92, 19, 239, 91, 19, 239, 90, 19, 239, 89, 19, 239, 88, 19, 239, 87,
+ 19, 239, 86, 19, 239, 85, 19, 239, 84, 19, 239, 83, 19, 239, 82, 19, 239,
+ 81, 19, 239, 80, 19, 239, 79, 19, 239, 78, 19, 239, 77, 19, 239, 76, 19,
+ 239, 75, 19, 239, 74, 19, 239, 73, 19, 239, 72, 19, 239, 71, 19, 239, 70,
+ 19, 239, 69, 19, 239, 68, 19, 239, 67, 19, 239, 66, 19, 239, 65, 19, 239,
+ 64, 41, 2, 27, 246, 238, 41, 2, 27, 246, 237, 41, 2, 27, 246, 236, 41, 2,
+ 27, 246, 235, 41, 2, 27, 246, 234, 41, 2, 27, 246, 233, 41, 2, 27, 246,
+ 232, 41, 2, 27, 246, 231, 41, 2, 27, 246, 230, 41, 2, 27, 246, 229, 41,
+ 2, 27, 246, 228, 41, 2, 27, 246, 227, 41, 2, 27, 246, 226, 41, 2, 27,
+ 246, 225, 41, 2, 27, 246, 224, 41, 2, 27, 246, 223, 41, 2, 27, 246, 222,
+ 41, 2, 27, 246, 221, 41, 2, 27, 246, 220, 41, 2, 27, 246, 219, 41, 2, 27,
+ 246, 218, 41, 2, 27, 246, 217, 41, 2, 27, 246, 216, 41, 2, 27, 246, 215,
+ 41, 2, 27, 246, 214, 41, 2, 27, 246, 213, 41, 2, 27, 246, 212, 41, 2, 27,
+ 246, 211, 41, 2, 27, 246, 210, 41, 2, 27, 246, 209, 41, 2, 27, 246, 208,
+ 41, 2, 27, 246, 207, 41, 2, 27, 246, 206, 41, 2, 27, 246, 205, 41, 2, 27,
+ 246, 204, 41, 2, 27, 246, 203, 41, 2, 27, 246, 202, 41, 2, 27, 246, 201,
+ 41, 2, 27, 246, 200, 41, 2, 27, 246, 199, 41, 2, 27, 246, 198, 41, 2, 27,
+ 246, 197, 41, 2, 27, 246, 196, 41, 2, 27, 246, 195, 41, 2, 27, 246, 194,
+ 41, 2, 27, 246, 193, 41, 2, 27, 246, 192, 41, 2, 27, 246, 191, 41, 2, 27,
+ 246, 190, 41, 2, 27, 246, 189, 41, 2, 27, 246, 188, 41, 2, 27, 246, 187,
+ 41, 2, 27, 246, 186, 41, 2, 27, 246, 185, 41, 2, 27, 246, 184, 41, 2, 27,
+ 246, 183, 41, 2, 27, 246, 182, 41, 2, 27, 246, 181, 41, 2, 27, 246, 180,
+ 41, 2, 27, 246, 179, 41, 2, 27, 246, 178, 41, 2, 27, 246, 177, 41, 2, 27,
+ 246, 176, 41, 2, 27, 246, 175, 41, 2, 27, 246, 174, 41, 2, 27, 246, 173,
+ 41, 2, 27, 246, 172, 41, 2, 27, 246, 171, 41, 2, 27, 246, 170, 41, 2, 27,
+ 246, 169, 41, 2, 27, 246, 168, 41, 2, 27, 246, 167, 41, 2, 27, 246, 166,
+ 41, 2, 27, 246, 165, 41, 2, 27, 246, 164, 41, 2, 27, 246, 163, 41, 2, 27,
+ 246, 162, 41, 2, 27, 246, 161, 41, 2, 27, 246, 160, 41, 2, 27, 246, 159,
+ 41, 2, 27, 246, 158, 41, 2, 27, 246, 157, 41, 2, 27, 246, 156, 41, 2, 27,
+ 246, 155, 41, 2, 27, 246, 154, 41, 2, 27, 246, 153, 41, 2, 27, 246, 152,
+ 41, 2, 27, 246, 151, 41, 2, 27, 246, 150, 41, 2, 27, 246, 149, 41, 2, 27,
+ 246, 148, 41, 2, 27, 246, 147, 41, 2, 27, 246, 146, 41, 2, 27, 246, 145,
+ 41, 2, 27, 246, 144, 41, 2, 27, 246, 143, 41, 2, 27, 246, 142, 41, 2, 27,
+ 246, 141, 41, 2, 27, 246, 140, 41, 2, 27, 246, 139, 41, 2, 27, 246, 138,
+ 41, 2, 27, 246, 137, 41, 2, 27, 246, 136, 41, 2, 27, 246, 135, 41, 2, 27,
+ 246, 134, 41, 2, 27, 246, 133, 41, 2, 27, 246, 132, 41, 2, 27, 246, 131,
+ 41, 2, 27, 246, 130, 41, 2, 27, 246, 129, 41, 2, 27, 246, 128, 41, 2, 27,
+ 246, 127, 41, 2, 27, 246, 126, 41, 2, 27, 246, 125, 41, 2, 27, 246, 124,
+ 41, 2, 27, 246, 123, 41, 2, 27, 246, 122, 41, 2, 27, 246, 121, 41, 2, 27,
+ 246, 120, 41, 2, 27, 246, 119, 41, 2, 27, 246, 118, 41, 2, 27, 246, 117,
+ 41, 2, 27, 246, 116, 41, 2, 27, 246, 115, 41, 2, 27, 246, 114, 41, 2, 27,
+ 246, 113, 41, 2, 27, 246, 112, 41, 2, 27, 246, 111, 41, 2, 27, 246, 110,
+ 41, 2, 27, 246, 109, 41, 2, 27, 246, 108, 41, 2, 27, 246, 107, 41, 2, 27,
+ 246, 106, 41, 2, 27, 246, 105, 41, 2, 27, 246, 104, 41, 2, 27, 246, 103,
+ 41, 2, 27, 246, 102, 41, 2, 27, 246, 101, 41, 2, 27, 246, 100, 41, 2, 27,
+ 246, 99, 41, 2, 27, 246, 98, 41, 2, 27, 246, 97, 41, 2, 27, 246, 96, 41,
+ 2, 27, 246, 95, 41, 2, 27, 246, 94, 41, 2, 27, 246, 93, 41, 2, 27, 246,
+ 92, 41, 2, 27, 246, 91, 41, 2, 27, 246, 90, 41, 2, 27, 246, 89, 41, 2,
+ 27, 246, 88, 41, 2, 27, 246, 87, 41, 2, 27, 246, 86, 41, 2, 27, 246, 85,
+ 41, 2, 27, 246, 84, 41, 2, 27, 246, 83, 41, 2, 27, 246, 82, 41, 2, 27,
+ 246, 81, 41, 2, 27, 246, 80, 41, 2, 27, 246, 79, 41, 2, 27, 246, 78, 41,
+ 2, 27, 246, 77, 41, 2, 27, 246, 76, 41, 2, 27, 246, 75, 41, 2, 27, 246,
+ 74, 41, 2, 27, 246, 73, 41, 2, 27, 246, 72, 41, 2, 27, 246, 71, 41, 2,
+ 27, 246, 70, 41, 2, 27, 246, 69, 41, 2, 27, 246, 68, 41, 2, 27, 246, 67,
+ 41, 2, 27, 246, 66, 41, 2, 27, 246, 65, 41, 2, 27, 246, 64, 41, 2, 27,
+ 246, 63, 41, 2, 27, 246, 62, 41, 2, 27, 246, 61, 41, 2, 27, 246, 60, 41,
+ 2, 27, 246, 59, 41, 2, 27, 246, 58, 41, 2, 27, 246, 57, 41, 2, 27, 246,
+ 56, 41, 2, 27, 246, 55, 41, 2, 27, 246, 54, 41, 2, 27, 246, 53, 41, 2,
+ 27, 246, 52, 41, 2, 27, 246, 51, 41, 2, 27, 246, 50, 41, 2, 27, 246, 49,
+ 41, 2, 27, 246, 48, 41, 2, 27, 246, 47, 41, 2, 27, 246, 46, 41, 2, 27,
+ 246, 45, 41, 2, 27, 246, 44, 41, 2, 27, 246, 43, 41, 2, 27, 246, 42, 41,
+ 2, 27, 246, 41, 41, 2, 27, 246, 40, 41, 2, 27, 246, 39, 41, 2, 27, 246,
+ 38, 41, 2, 27, 246, 37, 41, 2, 27, 246, 36, 41, 2, 27, 246, 35, 41, 2,
+ 27, 246, 34, 41, 2, 27, 246, 33, 41, 2, 27, 246, 32, 41, 2, 27, 246, 31,
+ 41, 2, 27, 246, 30, 41, 2, 27, 246, 29, 41, 2, 27, 246, 28, 41, 2, 27,
+ 246, 27, 41, 2, 27, 246, 26, 41, 2, 27, 246, 25, 41, 2, 27, 246, 24, 41,
+ 2, 27, 246, 23, 41, 2, 27, 246, 22, 41, 2, 27, 246, 21, 41, 2, 27, 246,
+ 20, 41, 2, 27, 246, 19, 41, 2, 27, 246, 18, 41, 2, 27, 246, 17, 41, 2,
+ 27, 246, 16, 41, 2, 27, 246, 15, 41, 2, 27, 246, 14, 41, 2, 27, 246, 13,
+ 41, 2, 27, 246, 12, 41, 2, 27, 246, 11, 41, 2, 27, 246, 10, 41, 2, 27,
+ 246, 9, 41, 2, 27, 246, 8, 41, 2, 27, 246, 7, 41, 2, 27, 246, 6, 41, 2,
+ 27, 246, 5, 41, 2, 27, 246, 4, 41, 2, 27, 246, 3, 41, 2, 27, 246, 2, 41,
+ 2, 27, 246, 1, 41, 2, 27, 246, 0, 41, 2, 27, 245, 255, 41, 2, 27, 245,
+ 254, 41, 2, 27, 245, 253, 41, 2, 27, 245, 252, 41, 2, 27, 245, 251, 41,
+ 2, 27, 245, 250, 41, 2, 27, 245, 249, 41, 2, 27, 245, 248, 41, 2, 27,
+ 245, 247, 41, 2, 27, 245, 246, 41, 2, 27, 245, 245, 41, 2, 27, 245, 244,
+ 41, 2, 27, 245, 243, 41, 2, 27, 245, 242, 41, 2, 27, 245, 241, 41, 2, 27,
+ 245, 240, 41, 2, 27, 245, 239, 41, 2, 27, 245, 238, 41, 2, 27, 245, 237,
+ 41, 2, 27, 245, 236, 41, 2, 27, 245, 235, 41, 2, 27, 245, 234, 41, 2, 27,
+ 245, 233, 41, 2, 27, 245, 232, 41, 2, 27, 245, 231, 41, 2, 27, 245, 230,
+ 41, 2, 27, 245, 229, 41, 2, 27, 245, 228, 41, 2, 27, 245, 227, 41, 2, 27,
+ 245, 226, 41, 2, 27, 245, 225, 41, 2, 27, 245, 224, 41, 2, 27, 245, 223,
+ 41, 2, 27, 245, 222, 41, 2, 27, 245, 221, 41, 2, 27, 245, 220, 41, 2, 27,
+ 245, 219, 41, 2, 27, 245, 218, 41, 2, 27, 245, 217, 41, 2, 27, 245, 216,
+ 41, 2, 27, 245, 215, 41, 2, 27, 245, 214, 41, 2, 27, 245, 213, 41, 2, 27,
+ 245, 212, 41, 2, 27, 245, 211, 41, 2, 27, 245, 210, 41, 2, 27, 245, 209,
+ 41, 2, 27, 245, 208, 41, 2, 27, 245, 207, 41, 2, 27, 245, 206, 41, 2, 27,
+ 245, 205, 41, 2, 27, 245, 204, 41, 2, 27, 245, 203, 41, 2, 27, 245, 202,
+ 41, 2, 27, 245, 201, 41, 2, 27, 245, 200, 41, 2, 27, 245, 199, 41, 2, 27,
+ 245, 198, 41, 2, 27, 245, 197, 41, 2, 27, 245, 196, 41, 2, 27, 245, 195,
+ 41, 2, 27, 245, 194, 41, 2, 27, 245, 193, 41, 2, 27, 245, 192, 41, 2, 27,
+ 245, 191, 41, 2, 27, 245, 190, 41, 2, 27, 245, 189, 41, 2, 27, 245, 188,
+ 41, 2, 27, 245, 187, 41, 2, 27, 245, 186, 41, 2, 27, 245, 185, 41, 2, 27,
+ 245, 184, 41, 2, 27, 245, 183, 41, 2, 27, 245, 182, 41, 2, 27, 245, 181,
+ 41, 2, 27, 245, 180, 41, 2, 27, 245, 179, 41, 2, 27, 245, 178, 41, 2, 27,
+ 245, 177, 41, 2, 27, 245, 176, 41, 2, 27, 245, 175, 41, 2, 27, 245, 174,
+ 41, 2, 27, 245, 173, 41, 2, 27, 245, 172, 41, 2, 27, 245, 171, 41, 2, 27,
+ 245, 170, 41, 2, 27, 245, 169, 41, 2, 27, 245, 168, 41, 2, 27, 245, 167,
+ 41, 2, 27, 245, 166, 41, 2, 27, 245, 165, 41, 2, 27, 245, 164, 41, 2, 27,
+ 245, 163, 41, 2, 27, 245, 162, 41, 2, 27, 245, 161, 41, 2, 27, 245, 160,
+ 41, 2, 27, 245, 159, 41, 2, 27, 245, 158, 41, 2, 27, 245, 157, 41, 2, 27,
+ 245, 156, 41, 2, 27, 245, 155, 41, 2, 27, 245, 154, 41, 2, 27, 245, 153,
+ 41, 2, 27, 245, 152, 41, 2, 27, 245, 151, 41, 2, 27, 245, 150, 41, 2, 27,
+ 245, 149, 41, 2, 27, 245, 148, 41, 2, 27, 245, 147, 41, 2, 27, 245, 146,
+ 41, 2, 27, 245, 145, 41, 2, 27, 245, 144, 41, 2, 27, 245, 143, 41, 2, 27,
+ 245, 142, 41, 2, 27, 245, 141, 41, 2, 27, 245, 140, 41, 2, 27, 245, 139,
+ 41, 2, 27, 245, 138, 41, 2, 27, 245, 137, 41, 2, 27, 245, 136, 41, 2, 27,
+ 245, 135, 41, 2, 27, 245, 134, 41, 2, 27, 245, 133, 41, 2, 27, 245, 132,
+ 41, 2, 27, 245, 131, 41, 2, 27, 245, 130, 41, 2, 27, 245, 129, 41, 2, 27,
+ 245, 128, 41, 2, 27, 245, 127, 41, 2, 27, 245, 126, 41, 2, 27, 245, 125,
+ 41, 2, 27, 245, 124, 41, 2, 27, 245, 123, 41, 2, 27, 245, 122, 41, 2, 27,
+ 245, 121, 41, 2, 27, 245, 120, 41, 2, 27, 245, 119, 41, 2, 27, 245, 118,
+ 41, 2, 27, 245, 117, 41, 2, 27, 245, 116, 41, 2, 27, 245, 115, 41, 2, 27,
+ 245, 114, 41, 2, 27, 245, 113, 41, 2, 27, 245, 112, 41, 2, 27, 245, 111,
+ 41, 2, 27, 245, 110, 41, 2, 27, 245, 109, 41, 2, 27, 245, 108, 41, 2, 27,
+ 245, 107, 41, 2, 27, 245, 106, 41, 2, 27, 245, 105, 41, 2, 27, 245, 104,
+ 41, 2, 27, 245, 103, 41, 2, 27, 245, 102, 41, 2, 27, 245, 101, 41, 2, 27,
+ 245, 100, 41, 2, 27, 245, 99, 41, 2, 27, 245, 98, 41, 2, 27, 245, 97, 41,
+ 2, 27, 245, 96, 41, 2, 27, 245, 95, 41, 2, 27, 245, 94, 41, 2, 27, 245,
+ 93, 41, 2, 27, 245, 92, 41, 2, 27, 245, 91, 41, 2, 27, 245, 90, 41, 2,
+ 27, 245, 89, 41, 2, 27, 245, 88, 41, 2, 27, 245, 87, 41, 2, 27, 245, 86,
+ 41, 2, 27, 245, 85, 41, 2, 27, 245, 84, 41, 2, 27, 245, 83, 41, 2, 27,
+ 245, 82, 41, 2, 27, 245, 81, 41, 2, 27, 245, 80, 41, 2, 27, 245, 79, 41,
+ 2, 27, 245, 78, 41, 2, 27, 245, 77, 41, 2, 27, 245, 76, 41, 2, 27, 245,
+ 75, 41, 2, 27, 245, 74, 41, 2, 27, 245, 73, 41, 2, 27, 245, 72, 41, 2,
+ 27, 245, 71, 41, 2, 27, 245, 70, 41, 2, 27, 245, 69, 41, 2, 27, 245, 68,
+ 41, 2, 27, 245, 67, 41, 2, 27, 245, 66, 41, 2, 27, 245, 65, 41, 2, 27,
+ 245, 64, 41, 2, 27, 245, 63, 41, 2, 27, 245, 62, 41, 2, 27, 245, 61, 41,
+ 2, 27, 245, 60, 41, 2, 27, 245, 59, 41, 2, 27, 245, 58, 41, 2, 27, 245,
+ 57, 41, 2, 27, 245, 56, 41, 2, 27, 245, 55, 41, 2, 27, 245, 54, 41, 2,
+ 27, 245, 53, 41, 2, 27, 245, 52, 41, 2, 27, 245, 51, 41, 2, 27, 245, 50,
+ 41, 2, 27, 245, 49, 41, 2, 27, 245, 48, 41, 2, 27, 245, 47, 41, 2, 27,
+ 245, 46, 41, 2, 27, 245, 45, 41, 2, 27, 245, 44, 41, 2, 27, 245, 43, 41,
+ 2, 27, 245, 42, 41, 2, 27, 245, 41, 41, 2, 27, 245, 40, 41, 2, 27, 245,
+ 39, 41, 2, 27, 245, 38, 41, 2, 27, 245, 37, 41, 2, 27, 245, 36, 41, 2,
+ 27, 245, 35, 41, 2, 27, 245, 34, 41, 2, 27, 245, 33, 41, 2, 27, 245, 32,
+ 41, 2, 27, 245, 31, 41, 2, 27, 245, 30, 41, 2, 27, 245, 29, 41, 2, 27,
+ 245, 28, 41, 2, 27, 245, 27, 41, 2, 27, 245, 26, 41, 2, 27, 245, 25, 72,
+ 1, 216, 36, 198, 77, 72, 1, 216, 36, 198, 76, 72, 1, 216, 36, 198, 75,
+ 72, 1, 216, 36, 198, 74, 72, 1, 216, 36, 198, 72, 72, 1, 216, 36, 198,
+ 71, 72, 1, 216, 36, 214, 211, 198, 78, 72, 1, 216, 36, 214, 211, 198, 77,
+ 72, 1, 216, 36, 214, 211, 198, 76, 72, 1, 216, 36, 214, 211, 198, 75, 72,
+ 1, 216, 36, 214, 211, 198, 74, 72, 1, 216, 36, 214, 211, 198, 72, 72, 1,
+ 216, 36, 214, 211, 198, 71, 72, 1, 251, 14, 71, 229, 120, 1, 251, 14,
+ 192, 80, 61, 1, 255, 206, 61, 1, 255, 205, 61, 1, 255, 204, 61, 1, 255,
+ 200, 61, 1, 228, 73, 61, 1, 228, 72, 61, 1, 228, 71, 61, 1, 228, 70, 61,
+ 1, 196, 231, 61, 1, 196, 230, 61, 1, 196, 229, 61, 1, 196, 228, 61, 1,
+ 196, 227, 61, 1, 235, 13, 61, 1, 235, 12, 61, 1, 235, 11, 61, 1, 235, 10,
+ 61, 1, 235, 9, 61, 1, 212, 14, 61, 1, 212, 13, 61, 1, 212, 12, 61, 1,
+ 222, 141, 61, 1, 222, 138, 61, 1, 222, 137, 61, 1, 222, 136, 61, 1, 222,
+ 135, 61, 1, 222, 134, 61, 1, 222, 133, 61, 1, 222, 132, 61, 1, 222, 131,
+ 61, 1, 222, 140, 61, 1, 222, 139, 61, 1, 222, 130, 61, 1, 221, 165, 61,
+ 1, 221, 164, 61, 1, 221, 163, 61, 1, 221, 162, 61, 1, 221, 161, 61, 1,
+ 221, 160, 61, 1, 221, 159, 61, 1, 221, 158, 61, 1, 220, 231, 61, 1, 220,
+ 230, 61, 1, 220, 229, 61, 1, 220, 228, 61, 1, 220, 227, 61, 1, 220, 226,
+ 61, 1, 220, 225, 61, 1, 222, 21, 61, 1, 222, 20, 61, 1, 222, 19, 61, 1,
+ 222, 18, 61, 1, 222, 17, 61, 1, 222, 16, 61, 1, 221, 66, 61, 1, 221, 65,
+ 61, 1, 221, 64, 61, 1, 221, 63, 61, 1, 205, 206, 61, 1, 205, 205, 61, 1,
+ 205, 204, 61, 1, 205, 203, 61, 1, 205, 202, 61, 1, 205, 201, 61, 1, 205,
+ 200, 61, 1, 205, 199, 61, 1, 202, 221, 61, 1, 202, 220, 61, 1, 202, 219,
+ 61, 1, 202, 218, 61, 1, 202, 217, 61, 1, 202, 216, 61, 1, 201, 3, 61, 1,
+ 201, 2, 61, 1, 201, 1, 61, 1, 201, 0, 61, 1, 200, 255, 61, 1, 200, 254,
+ 61, 1, 200, 253, 61, 1, 200, 252, 61, 1, 205, 67, 61, 1, 205, 66, 61, 1,
+ 205, 65, 61, 1, 205, 64, 61, 1, 205, 63, 61, 1, 202, 45, 61, 1, 202, 44,
+ 61, 1, 202, 43, 61, 1, 202, 42, 61, 1, 202, 41, 61, 1, 202, 40, 61, 1,
+ 202, 39, 61, 1, 199, 251, 61, 1, 199, 250, 61, 1, 199, 249, 61, 1, 199,
+ 248, 61, 1, 198, 192, 61, 1, 198, 191, 61, 1, 198, 190, 61, 1, 198, 189,
+ 61, 1, 198, 188, 61, 1, 198, 187, 61, 1, 198, 186, 61, 1, 197, 93, 61, 1,
+ 197, 92, 61, 1, 197, 91, 61, 1, 197, 90, 61, 1, 197, 89, 61, 1, 199, 144,
+ 61, 1, 199, 143, 61, 1, 199, 142, 61, 1, 199, 141, 61, 1, 199, 140, 61,
+ 1, 199, 139, 61, 1, 199, 138, 61, 1, 199, 137, 61, 1, 199, 136, 61, 1,
+ 198, 98, 61, 1, 198, 97, 61, 1, 198, 96, 61, 1, 198, 95, 61, 1, 198, 94,
+ 61, 1, 198, 93, 61, 1, 198, 92, 61, 1, 215, 6, 61, 1, 215, 5, 61, 1, 215,
+ 4, 61, 1, 215, 3, 61, 1, 215, 2, 61, 1, 215, 1, 61, 1, 215, 0, 61, 1,
+ 214, 255, 61, 1, 214, 254, 61, 1, 213, 218, 61, 1, 213, 217, 61, 1, 213,
+ 216, 61, 1, 213, 215, 61, 1, 213, 214, 61, 1, 213, 213, 61, 1, 213, 212,
+ 61, 1, 213, 211, 61, 1, 212, 177, 61, 1, 212, 176, 61, 1, 212, 175, 61,
+ 1, 214, 120, 61, 1, 214, 119, 61, 1, 214, 118, 61, 1, 214, 117, 61, 1,
+ 214, 116, 61, 1, 214, 115, 61, 1, 214, 114, 61, 1, 213, 42, 61, 1, 213,
+ 41, 61, 1, 213, 40, 61, 1, 213, 39, 61, 1, 213, 38, 61, 1, 230, 104, 61,
+ 1, 230, 101, 61, 1, 230, 100, 61, 1, 230, 99, 61, 1, 230, 98, 61, 1, 230,
+ 97, 61, 1, 230, 96, 61, 1, 230, 95, 61, 1, 230, 94, 61, 1, 230, 103, 61,
+ 1, 230, 102, 61, 1, 229, 157, 61, 1, 229, 156, 61, 1, 229, 155, 61, 1,
+ 229, 154, 61, 1, 229, 153, 61, 1, 229, 152, 61, 1, 229, 151, 61, 1, 228,
+ 158, 61, 1, 228, 157, 61, 1, 228, 156, 61, 1, 229, 244, 61, 1, 229, 243,
+ 61, 1, 229, 242, 61, 1, 229, 241, 61, 1, 229, 240, 61, 1, 229, 239, 61,
+ 1, 229, 238, 61, 1, 229, 22, 61, 1, 229, 21, 61, 1, 229, 20, 61, 1, 229,
+ 19, 61, 1, 229, 18, 61, 1, 229, 17, 61, 1, 229, 16, 61, 1, 229, 15, 61,
+ 1, 217, 159, 61, 1, 217, 158, 61, 1, 217, 157, 61, 1, 217, 156, 61, 1,
+ 217, 155, 61, 1, 217, 154, 61, 1, 217, 153, 61, 1, 216, 99, 61, 1, 216,
+ 98, 61, 1, 216, 97, 61, 1, 216, 96, 61, 1, 216, 95, 61, 1, 216, 94, 61,
+ 1, 216, 93, 61, 1, 215, 154, 61, 1, 215, 153, 61, 1, 215, 152, 61, 1,
+ 215, 151, 61, 1, 216, 231, 61, 1, 216, 230, 61, 1, 216, 229, 61, 1, 216,
+ 11, 61, 1, 216, 10, 61, 1, 216, 9, 61, 1, 216, 8, 61, 1, 216, 7, 61, 1,
+ 216, 6, 61, 1, 192, 148, 61, 1, 192, 147, 61, 1, 192, 146, 61, 1, 192,
+ 145, 61, 1, 192, 144, 61, 1, 192, 141, 61, 1, 191, 224, 61, 1, 191, 223,
+ 61, 1, 191, 222, 61, 1, 191, 221, 61, 1, 192, 11, 61, 1, 192, 10, 61, 1,
+ 192, 9, 61, 1, 192, 8, 61, 1, 192, 7, 61, 1, 192, 6, 61, 1, 207, 185, 61,
+ 1, 207, 184, 61, 1, 207, 183, 61, 1, 207, 182, 61, 1, 207, 0, 61, 1, 206,
+ 255, 61, 1, 206, 254, 61, 1, 206, 253, 61, 1, 206, 252, 61, 1, 206, 251,
+ 61, 1, 206, 250, 61, 1, 206, 67, 61, 1, 206, 66, 61, 1, 206, 65, 61, 1,
+ 206, 64, 61, 1, 206, 63, 61, 1, 206, 62, 61, 1, 207, 112, 61, 1, 207,
+ 111, 61, 1, 207, 110, 61, 1, 207, 109, 61, 1, 206, 161, 61, 1, 206, 160,
+ 61, 1, 206, 159, 61, 1, 206, 158, 61, 1, 206, 157, 61, 1, 206, 156, 61,
+ 1, 193, 189, 61, 1, 193, 188, 61, 1, 193, 187, 61, 1, 193, 186, 61, 1,
+ 193, 185, 61, 1, 193, 85, 61, 1, 193, 84, 61, 1, 193, 83, 61, 1, 193, 82,
+ 61, 1, 193, 81, 61, 1, 193, 124, 61, 1, 193, 123, 61, 1, 193, 122, 61, 1,
+ 193, 121, 61, 1, 193, 47, 61, 1, 193, 46, 61, 1, 193, 45, 61, 1, 193, 44,
+ 61, 1, 193, 43, 61, 1, 193, 42, 61, 1, 193, 41, 61, 1, 215, 58, 61, 1,
+ 215, 57, 229, 120, 1, 251, 14, 193, 0, 72, 1, 251, 14, 192, 33, 72, 1,
+ 251, 14, 192, 80, 72, 1, 251, 14, 193, 0, 229, 120, 1, 2, 221, 67, 229,
+ 120, 1, 2, 193, 86, 229, 120, 1, 2, 193, 125, 229, 120, 1, 2, 193, 48,
+ 72, 1, 2, 221, 67, 72, 1, 2, 193, 86, 72, 1, 2, 193, 125, 72, 1, 2, 193,
+ 48, 72, 1, 2, 215, 61, 46, 245, 24, 46, 245, 23, 46, 245, 22, 46, 245,
+ 21, 46, 245, 20, 46, 245, 19, 46, 245, 18, 46, 245, 17, 46, 245, 16, 46,
+ 245, 15, 46, 245, 14, 46, 245, 13, 46, 245, 12, 46, 245, 11, 46, 245, 10,
+ 46, 245, 9, 46, 245, 8, 46, 245, 7, 46, 245, 6, 46, 245, 5, 46, 245, 4,
+ 46, 245, 3, 46, 245, 2, 46, 245, 1, 46, 245, 0, 46, 244, 255, 46, 244,
+ 254, 46, 244, 253, 46, 244, 252, 46, 244, 251, 46, 244, 250, 46, 244,
+ 249, 46, 244, 248, 46, 244, 247, 46, 244, 246, 46, 244, 245, 46, 244,
+ 244, 46, 244, 243, 46, 244, 242, 46, 244, 241, 46, 244, 240, 46, 244,
+ 239, 46, 244, 238, 46, 244, 237, 46, 244, 236, 46, 244, 235, 46, 244,
+ 234, 46, 244, 233, 46, 244, 232, 46, 244, 231, 46, 244, 230, 46, 244,
+ 229, 46, 244, 228, 46, 244, 227, 46, 244, 226, 46, 244, 225, 46, 244,
+ 224, 46, 244, 223, 46, 244, 222, 46, 244, 221, 46, 244, 220, 46, 244,
+ 219, 46, 244, 218, 46, 244, 217, 46, 244, 216, 46, 244, 215, 46, 244,
+ 214, 46, 244, 213, 46, 244, 212, 46, 244, 211, 46, 244, 210, 46, 244,
+ 209, 46, 244, 208, 46, 244, 207, 46, 244, 206, 46, 244, 205, 46, 244,
+ 204, 46, 244, 203, 46, 244, 202, 46, 244, 201, 46, 244, 200, 46, 244,
+ 199, 46, 244, 198, 46, 244, 197, 46, 244, 196, 46, 244, 195, 46, 244,
+ 194, 46, 244, 193, 46, 244, 192, 46, 244, 191, 46, 244, 190, 46, 244,
+ 189, 46, 244, 188, 46, 244, 187, 46, 244, 186, 46, 244, 185, 46, 244,
+ 184, 46, 244, 183, 46, 244, 182, 46, 244, 181, 46, 244, 180, 46, 244,
+ 179, 46, 244, 178, 46, 244, 177, 46, 244, 176, 46, 244, 175, 46, 244,
+ 174, 46, 244, 173, 46, 244, 172, 46, 244, 171, 46, 244, 170, 46, 244,
+ 169, 46, 244, 168, 46, 244, 167, 46, 244, 166, 46, 244, 165, 46, 244,
+ 164, 46, 244, 163, 46, 244, 162, 46, 244, 161, 46, 244, 160, 46, 244,
+ 159, 46, 244, 158, 46, 244, 157, 46, 244, 156, 46, 244, 155, 46, 244,
+ 154, 46, 244, 153, 46, 244, 152, 46, 244, 151, 46, 244, 150, 46, 244,
+ 149, 46, 244, 148, 46, 244, 147, 46, 244, 146, 46, 244, 145, 46, 244,
+ 144, 46, 244, 143, 46, 244, 142, 46, 244, 141, 46, 244, 140, 46, 244,
+ 139, 46, 244, 138, 46, 244, 137, 46, 244, 136, 46, 244, 135, 46, 244,
+ 134, 46, 244, 133, 46, 244, 132, 46, 244, 131, 46, 244, 130, 46, 244,
+ 129, 46, 244, 128, 46, 244, 127, 46, 244, 126, 46, 244, 125, 46, 244,
+ 124, 46, 244, 123, 46, 244, 122, 46, 244, 121, 46, 244, 120, 46, 244,
+ 119, 46, 244, 118, 46, 244, 117, 46, 244, 116, 46, 244, 115, 46, 244,
+ 114, 46, 244, 113, 46, 244, 112, 46, 244, 111, 46, 244, 110, 46, 244,
+ 109, 46, 244, 108, 46, 244, 107, 46, 244, 106, 46, 244, 105, 46, 244,
+ 104, 46, 244, 103, 46, 244, 102, 46, 244, 101, 46, 244, 100, 46, 244, 99,
+ 46, 244, 98, 46, 244, 97, 46, 244, 96, 46, 244, 95, 46, 244, 94, 46, 244,
+ 93, 46, 244, 92, 46, 244, 91, 46, 244, 90, 46, 244, 89, 46, 244, 88, 46,
+ 244, 87, 46, 244, 86, 46, 244, 85, 46, 244, 84, 46, 244, 83, 46, 244, 82,
+ 46, 244, 81, 46, 244, 80, 46, 244, 79, 46, 244, 78, 46, 244, 77, 46, 244,
+ 76, 46, 244, 75, 46, 244, 74, 46, 244, 73, 46, 244, 72, 46, 244, 71, 46,
+ 244, 70, 46, 244, 69, 46, 244, 68, 46, 244, 67, 46, 244, 66, 46, 244, 65,
+ 46, 244, 64, 46, 244, 63, 46, 244, 62, 46, 244, 61, 46, 244, 60, 46, 244,
+ 59, 46, 244, 58, 46, 244, 57, 46, 244, 56, 46, 244, 55, 46, 244, 54, 46,
+ 244, 53, 46, 244, 52, 46, 244, 51, 46, 244, 50, 46, 244, 49, 46, 244, 48,
+ 46, 244, 47, 46, 244, 46, 46, 244, 45, 46, 244, 44, 46, 244, 43, 46, 244,
+ 42, 46, 244, 41, 46, 244, 40, 46, 244, 39, 46, 244, 38, 46, 244, 37, 46,
+ 244, 36, 46, 244, 35, 46, 244, 34, 46, 244, 33, 46, 244, 32, 46, 244, 31,
+ 46, 244, 30, 46, 244, 29, 46, 244, 28, 46, 244, 27, 46, 244, 26, 46, 244,
+ 25, 46, 244, 24, 46, 244, 23, 46, 244, 22, 46, 244, 21, 46, 244, 20, 46,
+ 244, 19, 46, 244, 18, 46, 244, 17, 46, 244, 16, 46, 244, 15, 46, 244, 14,
+ 46, 244, 13, 46, 244, 12, 46, 244, 11, 46, 244, 10, 46, 244, 9, 46, 244,
+ 8, 46, 244, 7, 46, 244, 6, 46, 244, 5, 46, 244, 4, 46, 244, 3, 46, 244,
+ 2, 46, 244, 1, 46, 244, 0, 46, 243, 255, 46, 243, 254, 46, 243, 253, 46,
+ 243, 252, 46, 243, 251, 46, 243, 250, 46, 243, 249, 46, 243, 248, 46,
+ 243, 247, 46, 243, 246, 46, 243, 245, 46, 243, 244, 46, 243, 243, 46,
+ 243, 242, 46, 243, 241, 46, 243, 240, 46, 243, 239, 46, 243, 238, 46,
+ 243, 237, 46, 243, 236, 46, 243, 235, 46, 243, 234, 46, 243, 233, 46,
+ 243, 232, 46, 243, 231, 46, 243, 230, 46, 243, 229, 46, 243, 228, 46,
+ 243, 227, 46, 243, 226, 46, 243, 225, 46, 243, 224, 46, 243, 223, 46,
+ 243, 222, 46, 243, 221, 46, 243, 220, 46, 243, 219, 46, 243, 218, 46,
+ 243, 217, 46, 243, 216, 46, 243, 215, 46, 243, 214, 46, 243, 213, 46,
+ 243, 212, 46, 243, 211, 46, 243, 210, 46, 243, 209, 46, 243, 208, 46,
+ 243, 207, 46, 243, 206, 46, 243, 205, 46, 243, 204, 46, 243, 203, 46,
+ 243, 202, 46, 243, 201, 46, 243, 200, 46, 243, 199, 46, 243, 198, 46,
+ 243, 197, 46, 243, 196, 46, 243, 195, 46, 243, 194, 46, 243, 193, 46,
+ 243, 192, 46, 243, 191, 46, 243, 190, 46, 243, 189, 46, 243, 188, 46,
+ 243, 187, 46, 243, 186, 46, 243, 185, 46, 243, 184, 46, 243, 183, 46,
+ 243, 182, 46, 243, 181, 46, 243, 180, 46, 243, 179, 46, 243, 178, 46,
+ 243, 177, 46, 243, 176, 46, 243, 175, 46, 243, 174, 46, 243, 173, 46,
+ 243, 172, 46, 243, 171, 46, 243, 170, 46, 243, 169, 46, 243, 168, 46,
+ 243, 167, 46, 243, 166, 46, 243, 165, 46, 243, 164, 46, 243, 163, 46,
+ 243, 162, 46, 243, 161, 46, 243, 160, 46, 243, 159, 46, 243, 158, 46,
+ 243, 157, 46, 243, 156, 46, 243, 155, 46, 243, 154, 46, 243, 153, 46,
+ 243, 152, 46, 243, 151, 46, 243, 150, 46, 243, 149, 46, 243, 148, 46,
+ 243, 147, 46, 243, 146, 46, 243, 145, 46, 243, 144, 46, 243, 143, 46,
+ 243, 142, 46, 243, 141, 124, 1, 230, 116, 124, 1, 192, 235, 124, 1, 210,
+ 236, 124, 1, 200, 43, 124, 1, 233, 175, 124, 1, 222, 152, 124, 1, 172,
+ 124, 1, 250, 120, 124, 1, 238, 127, 124, 1, 196, 12, 124, 1, 232, 51,
+ 124, 1, 146, 124, 1, 210, 237, 215, 61, 124, 1, 238, 128, 206, 8, 124, 1,
+ 233, 176, 215, 61, 124, 1, 222, 153, 218, 168, 124, 1, 207, 222, 206, 8,
+ 124, 1, 199, 51, 124, 1, 202, 82, 237, 69, 124, 1, 237, 69, 124, 1, 221,
+ 102, 124, 1, 202, 82, 223, 35, 124, 1, 229, 112, 124, 1, 219, 160, 124,
+ 1, 207, 7, 124, 1, 218, 168, 124, 1, 215, 61, 124, 1, 223, 35, 124, 1,
+ 206, 8, 124, 1, 218, 169, 215, 61, 124, 1, 215, 62, 218, 168, 124, 1,
+ 223, 36, 218, 168, 124, 1, 206, 9, 223, 35, 124, 1, 218, 169, 4, 236,
+ 140, 124, 1, 215, 62, 4, 236, 140, 124, 1, 223, 36, 4, 236, 140, 124, 1,
+ 223, 36, 4, 185, 223, 118, 23, 58, 124, 1, 206, 9, 4, 236, 140, 124, 1,
+ 206, 9, 4, 75, 60, 124, 1, 218, 169, 206, 8, 124, 1, 215, 62, 206, 8,
+ 124, 1, 223, 36, 206, 8, 124, 1, 206, 9, 206, 8, 124, 1, 218, 169, 215,
+ 62, 206, 8, 124, 1, 215, 62, 218, 169, 206, 8, 124, 1, 223, 36, 218, 169,
+ 206, 8, 124, 1, 206, 9, 223, 36, 206, 8, 124, 1, 223, 36, 206, 9, 4, 236,
+ 140, 124, 1, 223, 36, 215, 61, 124, 1, 223, 36, 215, 62, 206, 8, 124, 1,
+ 206, 9, 200, 43, 124, 1, 206, 9, 200, 44, 146, 124, 1, 206, 9, 210, 236,
+ 124, 1, 206, 9, 210, 237, 146, 124, 1, 200, 44, 206, 8, 124, 1, 200, 44,
+ 207, 222, 206, 8, 124, 1, 193, 224, 124, 1, 193, 97, 124, 1, 193, 225,
+ 146, 124, 1, 206, 9, 215, 61, 124, 1, 206, 9, 218, 168, 124, 1, 222, 153,
+ 207, 222, 206, 8, 124, 1, 232, 52, 207, 222, 206, 8, 124, 1, 206, 9, 222,
+ 152, 124, 1, 206, 9, 222, 153, 146, 124, 1, 65, 124, 1, 202, 82, 210,
+ 250, 124, 1, 211, 182, 124, 1, 74, 124, 1, 251, 66, 124, 1, 68, 124, 1,
+ 71, 124, 1, 223, 226, 124, 1, 203, 40, 68, 124, 1, 196, 139, 124, 1, 234,
+ 188, 124, 1, 202, 82, 234, 173, 124, 1, 206, 135, 68, 124, 1, 202, 82,
+ 234, 188, 124, 1, 179, 68, 124, 1, 192, 80, 124, 1, 66, 124, 1, 233, 242,
+ 124, 1, 192, 182, 124, 1, 126, 215, 61, 124, 1, 179, 66, 124, 1, 206,
+ 135, 66, 124, 1, 196, 141, 124, 1, 202, 82, 66, 124, 1, 211, 84, 124, 1,
+ 210, 250, 124, 1, 211, 19, 124, 1, 193, 190, 124, 1, 193, 48, 124, 1,
+ 193, 86, 124, 1, 193, 112, 124, 1, 193, 14, 124, 1, 214, 214, 66, 124, 1,
+ 214, 214, 74, 124, 1, 214, 214, 68, 124, 1, 214, 214, 65, 124, 1, 210, 0,
+ 251, 132, 124, 1, 210, 0, 251, 149, 124, 1, 202, 82, 234, 103, 124, 1,
+ 202, 82, 251, 132, 124, 1, 202, 82, 211, 104, 124, 1, 117, 218, 168, 124,
+ 252, 4, 45, 228, 241, 205, 58, 124, 252, 4, 216, 87, 228, 241, 205, 58,
+ 124, 252, 4, 50, 228, 241, 205, 58, 124, 252, 4, 130, 81, 205, 58, 124,
+ 252, 4, 216, 87, 81, 205, 58, 124, 252, 4, 137, 81, 205, 58, 124, 252, 4,
+ 250, 170, 205, 58, 124, 252, 4, 250, 170, 219, 215, 205, 58, 124, 252, 4,
+ 250, 170, 199, 188, 124, 252, 4, 250, 170, 199, 215, 124, 252, 4, 250,
+ 170, 235, 15, 102, 124, 252, 4, 250, 170, 228, 74, 102, 124, 252, 4, 250,
+ 170, 199, 189, 102, 124, 252, 4, 137, 252, 46, 124, 252, 4, 137, 198,
+ 172, 252, 46, 124, 252, 4, 137, 230, 210, 124, 252, 4, 137, 179, 230,
+ 210, 124, 252, 4, 137, 236, 140, 124, 252, 4, 137, 243, 10, 124, 252, 4,
+ 137, 219, 112, 124, 252, 4, 137, 193, 138, 124, 252, 4, 137, 195, 135,
+ 124, 252, 4, 130, 252, 46, 124, 252, 4, 130, 198, 172, 252, 46, 124, 252,
+ 4, 130, 230, 210, 124, 252, 4, 130, 179, 230, 210, 124, 252, 4, 130, 236,
+ 140, 124, 252, 4, 130, 243, 10, 124, 252, 4, 130, 219, 112, 124, 252, 4,
+ 130, 193, 138, 124, 252, 4, 130, 195, 135, 124, 252, 4, 130, 57, 124, 3,
+ 187, 4, 238, 217, 124, 199, 9, 1, 205, 34, 124, 55, 77, 124, 208, 152,
+ 243, 78, 232, 80, 201, 63, 203, 27, 232, 145, 1, 211, 2, 203, 27, 232,
+ 145, 239, 28, 211, 2, 203, 27, 232, 145, 144, 201, 78, 203, 27, 232, 145,
+ 133, 201, 78, 97, 33, 87, 230, 240, 213, 159, 206, 9, 220, 251, 211, 105,
+ 219, 224, 97, 33, 87, 213, 159, 206, 9, 220, 251, 211, 105, 219, 224, 97,
+ 33, 87, 197, 162, 211, 105, 219, 224, 97, 33, 87, 230, 240, 213, 159,
+ 211, 105, 219, 224, 97, 33, 87, 213, 159, 211, 105, 219, 224, 97, 33, 87,
+ 201, 179, 211, 105, 219, 224, 97, 33, 87, 217, 94, 209, 3, 211, 105, 219,
+ 224, 97, 33, 87, 209, 3, 211, 105, 219, 224, 97, 33, 87, 193, 231, 211,
+ 105, 219, 224, 97, 33, 87, 217, 94, 209, 3, 206, 9, 221, 181, 211, 105,
+ 219, 224, 97, 33, 87, 209, 3, 206, 9, 221, 181, 211, 105, 219, 224, 97,
+ 33, 87, 193, 231, 206, 9, 221, 181, 211, 105, 219, 224, 97, 33, 87, 230,
+ 240, 213, 159, 206, 9, 220, 251, 211, 105, 183, 97, 33, 87, 213, 159,
+ 206, 9, 220, 251, 211, 105, 183, 97, 33, 87, 197, 162, 211, 105, 183, 97,
+ 33, 87, 230, 240, 213, 159, 211, 105, 183, 97, 33, 87, 213, 159, 211,
+ 105, 183, 97, 33, 87, 201, 179, 211, 105, 183, 97, 33, 87, 217, 94, 209,
+ 3, 211, 105, 183, 97, 33, 87, 209, 3, 211, 105, 183, 97, 33, 87, 193,
+ 231, 211, 105, 183, 97, 33, 87, 217, 94, 209, 3, 206, 9, 221, 181, 211,
+ 105, 183, 97, 33, 87, 209, 3, 206, 9, 221, 181, 211, 105, 183, 97, 33,
+ 87, 193, 231, 206, 9, 221, 181, 211, 105, 183, 97, 33, 87, 197, 162, 206,
+ 9, 220, 250, 97, 33, 87, 217, 94, 209, 3, 206, 9, 220, 250, 97, 33, 87,
+ 201, 49, 217, 94, 209, 2, 97, 33, 87, 209, 3, 206, 9, 220, 250, 97, 33,
+ 87, 209, 3, 201, 48, 97, 33, 87, 193, 231, 206, 9, 220, 250, 97, 33, 87,
+ 217, 94, 209, 3, 201, 48, 97, 33, 87, 230, 240, 193, 230, 97, 33, 87,
+ 191, 83, 97, 33, 87, 211, 104, 97, 33, 87, 207, 124, 97, 33, 87, 198,
+ 157, 97, 33, 87, 248, 83, 97, 33, 87, 196, 156, 97, 33, 87, 209, 65, 97,
+ 33, 87, 219, 21, 97, 33, 87, 220, 200, 97, 33, 87, 222, 115, 97, 33, 87,
+ 191, 74, 97, 33, 87, 202, 105, 97, 33, 87, 207, 117, 97, 33, 87, 220,
+ 253, 211, 105, 219, 224, 97, 33, 198, 80, 207, 137, 87, 215, 162, 97, 33,
+ 198, 80, 207, 137, 87, 200, 153, 97, 33, 198, 80, 207, 137, 87, 197, 246,
+ 97, 33, 87, 191, 120, 97, 33, 87, 237, 105, 191, 120, 97, 33, 87, 211,
+ 25, 97, 33, 87, 209, 67, 97, 33, 87, 209, 68, 4, 81, 106, 97, 33, 87,
+ 243, 134, 97, 33, 87, 243, 135, 209, 45, 97, 33, 87, 211, 174, 97, 33,
+ 87, 202, 10, 212, 249, 97, 33, 87, 198, 89, 97, 33, 87, 235, 48, 97, 33,
+ 250, 169, 81, 211, 109, 97, 33, 87, 238, 163, 211, 109, 97, 33, 87, 220,
+ 252, 97, 33, 110, 198, 80, 207, 137, 223, 144, 97, 208, 203, 52, 219,
+ 167, 97, 208, 203, 52, 219, 166, 97, 208, 203, 52, 236, 233, 232, 195,
+ 97, 208, 203, 52, 220, 252, 97, 208, 203, 52, 206, 144, 97, 161, 221, 0,
+ 97, 161, 221, 1, 198, 156, 97, 161, 210, 122, 97, 161, 235, 56, 196, 13,
+ 243, 113, 97, 161, 221, 90, 97, 161, 191, 105, 97, 161, 201, 61, 97, 161,
+ 201, 62, 206, 9, 211, 163, 97, 161, 210, 10, 97, 161, 210, 11, 214, 96,
+ 97, 161, 201, 62, 4, 202, 10, 212, 249, 97, 161, 243, 112, 97, 161, 210,
+ 186, 97, 161, 191, 103, 97, 161, 230, 248, 248, 82, 97, 161, 230, 248,
+ 198, 156, 97, 161, 230, 248, 215, 160, 97, 161, 230, 248, 200, 152, 97,
+ 161, 230, 248, 197, 245, 97, 161, 194, 253, 208, 183, 97, 161, 194, 253,
+ 215, 163, 97, 161, 194, 253, 200, 154, 97, 161, 194, 253, 197, 247, 97,
+ 161, 194, 253, 221, 85, 208, 183, 97, 161, 194, 253, 221, 85, 215, 163,
+ 97, 161, 194, 253, 221, 85, 200, 154, 97, 161, 194, 253, 221, 85, 197,
+ 247, 97, 161, 55, 191, 103, 97, 161, 207, 18, 243, 112, 97, 161, 237, 91,
+ 97, 161, 221, 207, 97, 161, 243, 134, 97, 161, 209, 67, 97, 161, 202,
+ 113, 215, 163, 97, 161, 202, 113, 200, 154, 97, 161, 202, 113, 197, 247,
+ 97, 161, 202, 113, 198, 157, 97, 161, 237, 105, 221, 90, 97, 161, 202,
+ 113, 221, 85, 200, 154, 97, 161, 202, 113, 221, 89, 97, 161, 202, 113,
+ 221, 85, 198, 157, 97, 161, 202, 113, 235, 53, 208, 183, 97, 161, 202,
+ 113, 235, 53, 200, 154, 97, 161, 202, 113, 235, 53, 214, 96, 97, 161,
+ 202, 113, 235, 53, 221, 84, 97, 161, 202, 72, 97, 161, 202, 73, 206, 9,
+ 191, 101, 97, 161, 202, 73, 191, 110, 97, 161, 202, 73, 206, 9, 220, 250,
+ 97, 161, 220, 252, 97, 161, 206, 144, 97, 161, 232, 228, 97, 161, 221,
+ 59, 97, 161, 191, 8, 97, 161, 201, 90, 97, 161, 201, 91, 206, 9, 191,
+ 101, 97, 161, 201, 91, 206, 9, 220, 250, 97, 161, 201, 91, 206, 9, 191,
+ 102, 228, 74, 220, 250, 97, 161, 201, 91, 206, 9, 220, 251, 228, 74, 191,
+ 101, 97, 161, 201, 91, 191, 111, 97, 161, 201, 91, 191, 112, 206, 9, 191,
+ 101, 97, 161, 201, 91, 206, 9, 206, 143, 97, 161, 201, 91, 206, 9, 235,
+ 47, 191, 100, 97, 161, 201, 91, 206, 9, 191, 102, 228, 74, 209, 66, 97,
+ 161, 209, 47, 97, 161, 201, 91, 214, 96, 97, 161, 201, 40, 208, 183, 97,
+ 161, 201, 40, 215, 161, 97, 161, 201, 40, 220, 249, 97, 161, 201, 40,
+ 209, 43, 97, 161, 201, 40, 209, 5, 97, 161, 201, 40, 214, 96, 97, 161,
+ 201, 40, 221, 87, 97, 161, 201, 40, 221, 89, 97, 161, 201, 40, 198, 158,
+ 208, 130, 97, 161, 201, 40, 235, 52, 97, 161, 201, 40, 235, 51, 97, 161,
+ 201, 40, 235, 49, 97, 161, 201, 40, 235, 53, 221, 84, 97, 161, 201, 40,
+ 235, 50, 221, 84, 97, 161, 201, 40, 230, 195, 4, 202, 170, 191, 103, 97,
+ 161, 201, 40, 230, 191, 4, 202, 170, 191, 103, 97, 161, 201, 40, 230,
+ 194, 97, 161, 201, 40, 230, 190, 97, 161, 201, 40, 230, 191, 4, 55, 191,
+ 103, 97, 161, 201, 40, 230, 192, 97, 161, 201, 40, 230, 193, 209, 5, 97,
+ 161, 216, 221, 97, 161, 216, 222, 209, 4, 97, 161, 216, 222, 221, 83, 97,
+ 161, 216, 222, 221, 86, 97, 161, 216, 222, 221, 88, 97, 161, 201, 40,
+ 197, 174, 97, 161, 201, 40, 197, 173, 97, 161, 201, 40, 197, 172, 97,
+ 161, 211, 31, 97, 161, 211, 32, 200, 154, 97, 161, 211, 32, 197, 247, 97,
+ 161, 211, 32, 220, 255, 200, 154, 97, 161, 211, 32, 221, 85, 200, 154,
+ 97, 161, 211, 32, 221, 85, 214, 96, 97, 161, 201, 40, 220, 254, 97, 161,
+ 201, 40, 220, 255, 209, 5, 97, 161, 201, 40, 220, 255, 230, 195, 4, 202,
+ 170, 191, 103, 97, 161, 201, 40, 220, 255, 230, 191, 4, 202, 170, 191,
+ 103, 97, 161, 201, 40, 220, 255, 230, 194, 97, 161, 201, 40, 220, 255,
+ 230, 190, 97, 161, 201, 40, 220, 255, 230, 191, 4, 55, 191, 103, 97, 161,
+ 201, 40, 220, 255, 230, 192, 97, 161, 201, 40, 220, 255, 230, 193, 209,
+ 5, 97, 161, 201, 40, 220, 255, 197, 175, 97, 161, 220, 214, 97, 161, 211,
+ 173, 97, 161, 235, 84, 97, 161, 214, 103, 97, 161, 210, 79, 73, 37, 16,
+ 208, 169, 73, 37, 16, 237, 217, 73, 37, 16, 210, 4, 73, 37, 16, 210, 246,
+ 234, 144, 73, 37, 16, 210, 246, 236, 238, 73, 37, 16, 195, 172, 234, 144,
+ 73, 37, 16, 195, 172, 236, 238, 73, 37, 16, 222, 44, 73, 37, 16, 200, 60,
+ 73, 37, 16, 210, 120, 73, 37, 16, 191, 231, 73, 37, 16, 191, 232, 236,
+ 238, 73, 37, 16, 221, 3, 73, 37, 16, 251, 61, 234, 144, 73, 37, 16, 233,
+ 210, 234, 144, 73, 37, 16, 199, 108, 73, 37, 16, 221, 247, 73, 37, 16,
+ 251, 50, 73, 37, 16, 251, 51, 236, 238, 73, 37, 16, 200, 67, 73, 37, 16,
+ 198, 244, 73, 37, 16, 211, 116, 251, 12, 73, 37, 16, 230, 238, 251, 12,
+ 73, 37, 16, 208, 168, 73, 37, 16, 246, 248, 73, 37, 16, 195, 161, 73, 37,
+ 16, 223, 58, 251, 12, 73, 37, 16, 221, 249, 251, 12, 73, 37, 16, 221,
+ 248, 251, 12, 73, 37, 16, 205, 105, 73, 37, 16, 210, 110, 73, 37, 16,
+ 201, 88, 251, 54, 73, 37, 16, 210, 245, 251, 12, 73, 37, 16, 195, 171,
+ 251, 12, 73, 37, 16, 251, 55, 251, 12, 73, 37, 16, 251, 48, 73, 37, 16,
+ 221, 92, 73, 37, 16, 207, 14, 73, 37, 16, 209, 183, 251, 12, 73, 37, 16,
+ 198, 142, 73, 37, 16, 251, 128, 73, 37, 16, 205, 37, 73, 37, 16, 200, 71,
+ 251, 12, 73, 37, 16, 200, 71, 216, 166, 201, 86, 73, 37, 16, 210, 240,
+ 251, 12, 73, 37, 16, 199, 27, 73, 37, 16, 219, 202, 73, 37, 16, 235, 38,
+ 73, 37, 16, 197, 243, 73, 37, 16, 199, 76, 73, 37, 16, 221, 6, 73, 37,
+ 16, 251, 61, 233, 210, 214, 98, 73, 37, 16, 232, 88, 251, 12, 73, 37, 16,
+ 223, 175, 73, 37, 16, 197, 210, 251, 12, 73, 37, 16, 222, 47, 197, 209,
+ 73, 37, 16, 210, 36, 73, 37, 16, 208, 173, 73, 37, 16, 221, 42, 73, 37,
+ 16, 243, 60, 251, 12, 73, 37, 16, 207, 135, 73, 37, 16, 210, 124, 251,
+ 12, 73, 37, 16, 210, 121, 251, 12, 73, 37, 16, 228, 24, 73, 37, 16, 214,
+ 225, 73, 37, 16, 209, 238, 73, 37, 16, 221, 43, 251, 167, 73, 37, 16,
+ 197, 210, 251, 167, 73, 37, 16, 201, 55, 73, 37, 16, 230, 189, 73, 37,
+ 16, 223, 58, 214, 98, 73, 37, 16, 211, 116, 214, 98, 73, 37, 16, 210,
+ 246, 214, 98, 73, 37, 16, 209, 237, 73, 37, 16, 221, 26, 73, 37, 16, 209,
+ 236, 73, 37, 16, 221, 5, 73, 37, 16, 210, 37, 214, 98, 73, 37, 16, 221,
+ 248, 214, 99, 251, 93, 73, 37, 16, 221, 249, 214, 99, 251, 93, 73, 37,
+ 16, 191, 229, 73, 37, 16, 251, 51, 214, 98, 73, 37, 16, 251, 52, 200, 68,
+ 214, 98, 73, 37, 16, 191, 230, 73, 37, 16, 221, 4, 73, 37, 16, 234, 139,
+ 73, 37, 16, 246, 249, 73, 37, 16, 216, 57, 223, 57, 73, 37, 16, 195, 172,
+ 214, 98, 73, 37, 16, 209, 183, 214, 98, 73, 37, 16, 208, 174, 214, 98,
+ 73, 37, 16, 211, 112, 73, 37, 16, 251, 80, 73, 37, 16, 218, 179, 73, 37,
+ 16, 210, 121, 214, 98, 73, 37, 16, 210, 124, 214, 98, 73, 37, 16, 233,
+ 249, 210, 123, 73, 37, 16, 220, 147, 73, 37, 16, 251, 81, 73, 37, 16,
+ 197, 210, 214, 98, 73, 37, 16, 234, 142, 73, 37, 16, 200, 71, 214, 98,
+ 73, 37, 16, 200, 61, 73, 37, 16, 243, 60, 214, 98, 73, 37, 16, 234, 53,
+ 73, 37, 16, 205, 38, 214, 98, 73, 37, 16, 192, 199, 221, 92, 73, 37, 16,
+ 197, 207, 73, 37, 16, 208, 175, 73, 37, 16, 197, 211, 73, 37, 16, 197,
+ 208, 73, 37, 16, 208, 172, 73, 37, 16, 197, 206, 73, 37, 16, 208, 171,
+ 73, 37, 16, 230, 237, 73, 37, 16, 251, 4, 73, 37, 16, 233, 249, 251, 4,
+ 73, 37, 16, 210, 240, 214, 98, 73, 37, 16, 199, 26, 234, 6, 73, 37, 16,
+ 199, 26, 233, 209, 73, 37, 16, 199, 28, 251, 56, 73, 37, 16, 199, 20,
+ 222, 103, 251, 47, 73, 37, 16, 222, 46, 73, 37, 16, 234, 90, 73, 37, 16,
+ 192, 38, 222, 43, 73, 37, 16, 192, 38, 251, 93, 73, 37, 16, 201, 87, 73,
+ 37, 16, 221, 93, 251, 93, 73, 37, 16, 236, 239, 251, 12, 73, 37, 16, 221,
+ 7, 251, 12, 73, 37, 16, 221, 7, 251, 167, 73, 37, 16, 221, 7, 214, 98,
+ 73, 37, 16, 251, 55, 214, 98, 73, 37, 16, 251, 57, 73, 37, 16, 236, 238,
+ 73, 37, 16, 197, 223, 73, 37, 16, 199, 66, 73, 37, 16, 221, 30, 73, 37,
+ 16, 219, 207, 234, 83, 243, 50, 73, 37, 16, 219, 207, 235, 39, 243, 51,
+ 73, 37, 16, 219, 207, 197, 226, 243, 51, 73, 37, 16, 219, 207, 199, 78,
+ 243, 51, 73, 37, 16, 219, 207, 223, 170, 243, 50, 73, 37, 16, 230, 238,
+ 214, 99, 251, 93, 73, 37, 16, 230, 238, 210, 111, 251, 0, 73, 37, 16,
+ 230, 238, 210, 111, 237, 73, 73, 37, 16, 237, 7, 73, 37, 16, 237, 8, 210,
+ 111, 251, 1, 222, 43, 73, 37, 16, 237, 8, 210, 111, 251, 1, 251, 93, 73,
+ 37, 16, 237, 8, 210, 111, 237, 73, 73, 37, 16, 197, 232, 73, 37, 16, 251,
+ 5, 73, 37, 16, 223, 177, 73, 37, 16, 237, 30, 73, 37, 16, 251, 247, 209,
+ 51, 251, 6, 73, 37, 16, 251, 247, 251, 3, 73, 37, 16, 251, 247, 251, 6,
+ 73, 37, 16, 251, 247, 216, 160, 73, 37, 16, 251, 247, 216, 171, 73, 37,
+ 16, 251, 247, 230, 239, 73, 37, 16, 251, 247, 230, 236, 73, 37, 16, 251,
+ 247, 209, 51, 230, 239, 73, 37, 16, 217, 45, 208, 181, 228, 22, 73, 37,
+ 16, 217, 45, 251, 169, 208, 181, 228, 22, 73, 37, 16, 217, 45, 237, 72,
+ 228, 22, 73, 37, 16, 217, 45, 251, 169, 237, 72, 228, 22, 73, 37, 16,
+ 217, 45, 197, 218, 228, 22, 73, 37, 16, 217, 45, 197, 233, 73, 37, 16,
+ 217, 45, 199, 71, 228, 22, 73, 37, 16, 217, 45, 199, 71, 219, 211, 228,
+ 22, 73, 37, 16, 217, 45, 219, 211, 228, 22, 73, 37, 16, 217, 45, 209,
+ 105, 228, 22, 73, 37, 16, 223, 66, 199, 101, 228, 23, 73, 37, 16, 251,
+ 52, 199, 101, 228, 23, 73, 37, 16, 233, 79, 199, 68, 73, 37, 16, 233, 79,
+ 215, 222, 73, 37, 16, 233, 79, 237, 13, 73, 37, 16, 217, 45, 195, 165,
+ 228, 22, 73, 37, 16, 217, 45, 208, 180, 228, 22, 73, 37, 16, 217, 45,
+ 209, 105, 199, 71, 228, 22, 73, 37, 16, 230, 233, 215, 62, 251, 56, 73,
+ 37, 16, 230, 233, 215, 62, 236, 237, 73, 37, 16, 234, 101, 222, 103, 232,
+ 88, 195, 3, 73, 37, 16, 223, 176, 73, 37, 16, 223, 174, 73, 37, 16, 232,
+ 88, 251, 13, 237, 71, 228, 21, 73, 37, 16, 232, 88, 237, 28, 168, 73, 37,
+ 16, 232, 88, 237, 28, 214, 225, 73, 37, 16, 232, 88, 214, 219, 228, 22,
+ 73, 37, 16, 232, 88, 237, 28, 237, 44, 73, 37, 16, 232, 88, 202, 106,
+ 237, 27, 237, 44, 73, 37, 16, 232, 88, 237, 28, 222, 22, 73, 37, 16, 232,
+ 88, 237, 28, 191, 7, 73, 37, 16, 232, 88, 237, 28, 213, 220, 222, 43, 73,
+ 37, 16, 232, 88, 237, 28, 213, 220, 251, 93, 73, 37, 16, 232, 88, 217,
+ 98, 243, 52, 237, 13, 73, 37, 16, 232, 88, 217, 98, 243, 52, 215, 222,
+ 73, 37, 16, 233, 24, 202, 106, 243, 52, 195, 164, 73, 37, 16, 232, 88,
+ 202, 106, 243, 52, 200, 72, 73, 37, 16, 232, 88, 214, 101, 73, 37, 16,
+ 243, 53, 190, 230, 73, 37, 16, 243, 53, 221, 91, 73, 37, 16, 243, 53,
+ 201, 238, 73, 37, 16, 232, 88, 228, 74, 192, 37, 199, 72, 73, 37, 16,
+ 232, 88, 234, 102, 251, 82, 73, 37, 16, 192, 37, 197, 219, 73, 37, 16,
+ 237, 21, 197, 219, 73, 37, 16, 237, 21, 199, 72, 73, 37, 16, 237, 21,
+ 251, 58, 235, 39, 236, 166, 73, 37, 16, 237, 21, 215, 220, 199, 77, 236,
+ 166, 73, 37, 16, 237, 21, 237, 4, 233, 222, 236, 166, 73, 37, 16, 237,
+ 21, 197, 230, 211, 122, 236, 166, 73, 37, 16, 192, 37, 251, 58, 235, 39,
+ 236, 166, 73, 37, 16, 192, 37, 215, 220, 199, 77, 236, 166, 73, 37, 16,
+ 192, 37, 237, 4, 233, 222, 236, 166, 73, 37, 16, 192, 37, 197, 230, 211,
+ 122, 236, 166, 73, 37, 16, 231, 147, 237, 20, 73, 37, 16, 231, 147, 192,
+ 36, 73, 37, 16, 237, 29, 251, 58, 216, 58, 73, 37, 16, 237, 29, 251, 58,
+ 216, 202, 73, 37, 16, 237, 29, 236, 238, 73, 37, 16, 237, 29, 199, 18,
+ 73, 37, 16, 202, 181, 199, 18, 73, 37, 16, 202, 181, 199, 19, 236, 221,
+ 73, 37, 16, 202, 181, 199, 19, 197, 220, 73, 37, 16, 202, 181, 199, 19,
+ 199, 64, 73, 37, 16, 202, 181, 250, 228, 73, 37, 16, 202, 181, 250, 229,
+ 236, 221, 73, 37, 16, 202, 181, 250, 229, 197, 220, 73, 37, 16, 202, 181,
+ 250, 229, 199, 64, 73, 37, 16, 237, 5, 231, 128, 73, 37, 16, 237, 12,
+ 211, 19, 73, 37, 16, 201, 73, 73, 37, 16, 250, 253, 168, 73, 37, 16, 250,
+ 253, 195, 3, 73, 37, 16, 250, 253, 231, 240, 73, 37, 16, 250, 253, 237,
+ 44, 73, 37, 16, 250, 253, 222, 22, 73, 37, 16, 250, 253, 191, 7, 73, 37,
+ 16, 250, 253, 213, 219, 73, 37, 16, 221, 248, 214, 99, 216, 170, 73, 37,
+ 16, 221, 249, 214, 99, 216, 170, 73, 37, 16, 221, 248, 214, 99, 222, 43,
+ 73, 37, 16, 221, 249, 214, 99, 222, 43, 73, 37, 16, 221, 93, 222, 43, 73,
+ 37, 16, 230, 238, 214, 99, 222, 43, 37, 16, 202, 170, 249, 83, 37, 16,
+ 55, 249, 83, 37, 16, 53, 249, 83, 37, 16, 207, 19, 53, 249, 83, 37, 16,
+ 237, 214, 249, 83, 37, 16, 203, 40, 249, 83, 37, 16, 45, 207, 49, 56, 37,
+ 16, 50, 207, 49, 56, 37, 16, 207, 49, 236, 138, 37, 16, 238, 4, 205, 41,
+ 37, 16, 238, 33, 247, 108, 37, 16, 205, 41, 37, 16, 242, 92, 37, 16, 207,
+ 47, 233, 11, 37, 16, 207, 47, 233, 10, 37, 16, 207, 47, 233, 9, 37, 16,
+ 233, 34, 37, 16, 233, 35, 60, 37, 16, 248, 39, 77, 37, 16, 247, 150, 37,
+ 16, 248, 55, 37, 16, 248, 53, 37, 16, 211, 99, 201, 111, 37, 16, 197, 12,
+ 201, 111, 37, 16, 198, 220, 201, 111, 37, 16, 232, 127, 201, 111, 37, 16,
+ 232, 224, 201, 111, 37, 16, 202, 135, 201, 111, 37, 16, 202, 133, 232,
+ 105, 37, 16, 232, 125, 232, 105, 37, 16, 232, 52, 242, 235, 37, 16, 232,
+ 52, 242, 236, 211, 23, 251, 158, 37, 16, 232, 52, 242, 236, 211, 23, 249,
+ 66, 37, 16, 247, 194, 242, 235, 37, 16, 233, 176, 242, 235, 37, 16, 233,
+ 176, 242, 236, 211, 23, 251, 158, 37, 16, 233, 176, 242, 236, 211, 23,
+ 249, 66, 37, 16, 235, 95, 242, 234, 37, 16, 235, 95, 242, 233, 37, 16,
+ 215, 129, 216, 228, 207, 30, 37, 16, 55, 203, 126, 37, 16, 55, 232, 206,
+ 37, 16, 232, 207, 196, 77, 37, 16, 232, 207, 235, 123, 37, 16, 214, 206,
+ 196, 77, 37, 16, 214, 206, 235, 123, 37, 16, 203, 127, 196, 77, 37, 16,
+ 203, 127, 235, 123, 37, 16, 208, 23, 163, 203, 126, 37, 16, 208, 23, 163,
+ 232, 206, 37, 16, 242, 71, 198, 146, 37, 16, 238, 155, 198, 146, 37, 16,
+ 211, 23, 251, 158, 37, 16, 211, 23, 249, 66, 37, 16, 208, 3, 251, 158,
+ 37, 16, 208, 3, 249, 66, 37, 16, 215, 132, 207, 30, 37, 16, 193, 87, 207,
+ 30, 37, 16, 132, 207, 30, 37, 16, 208, 23, 207, 30, 37, 16, 234, 160,
+ 207, 30, 37, 16, 202, 129, 207, 30, 37, 16, 198, 246, 207, 30, 37, 16,
+ 202, 119, 207, 30, 37, 16, 91, 228, 141, 197, 30, 207, 30, 37, 16, 192,
+ 236, 213, 2, 37, 16, 108, 213, 2, 37, 16, 243, 11, 192, 236, 213, 2, 37,
+ 16, 51, 213, 3, 193, 89, 37, 16, 51, 213, 3, 248, 139, 37, 16, 197, 242,
+ 213, 3, 133, 193, 89, 37, 16, 197, 242, 213, 3, 133, 248, 139, 37, 16,
+ 197, 242, 213, 3, 45, 193, 89, 37, 16, 197, 242, 213, 3, 45, 248, 139,
+ 37, 16, 197, 242, 213, 3, 50, 193, 89, 37, 16, 197, 242, 213, 3, 50, 248,
+ 139, 37, 16, 197, 242, 213, 3, 144, 193, 89, 37, 16, 197, 242, 213, 3,
+ 144, 248, 139, 37, 16, 197, 242, 213, 3, 133, 50, 193, 89, 37, 16, 197,
+ 242, 213, 3, 133, 50, 248, 139, 37, 16, 215, 206, 213, 3, 193, 89, 37,
+ 16, 215, 206, 213, 3, 248, 139, 37, 16, 197, 239, 213, 3, 144, 193, 89,
+ 37, 16, 197, 239, 213, 3, 144, 248, 139, 37, 16, 210, 114, 213, 2, 37,
+ 16, 195, 17, 213, 2, 37, 16, 213, 3, 248, 139, 37, 16, 212, 139, 213, 2,
+ 37, 16, 242, 203, 213, 3, 193, 89, 37, 16, 242, 203, 213, 3, 248, 139,
+ 37, 16, 248, 36, 37, 16, 193, 87, 213, 6, 37, 16, 132, 213, 6, 37, 16,
+ 208, 23, 213, 6, 37, 16, 234, 160, 213, 6, 37, 16, 202, 129, 213, 6, 37,
+ 16, 198, 246, 213, 6, 37, 16, 202, 119, 213, 6, 37, 16, 91, 228, 141,
+ 197, 30, 213, 6, 37, 16, 33, 201, 80, 37, 16, 33, 201, 197, 201, 80, 37,
+ 16, 33, 197, 253, 37, 16, 33, 197, 252, 37, 16, 33, 197, 251, 37, 16,
+ 232, 250, 197, 253, 37, 16, 232, 250, 197, 252, 37, 16, 232, 250, 197,
+ 251, 37, 16, 33, 250, 160, 236, 140, 37, 16, 33, 232, 216, 37, 16, 33,
+ 232, 215, 37, 16, 33, 232, 214, 37, 16, 33, 232, 213, 37, 16, 33, 232,
+ 212, 37, 16, 248, 249, 249, 14, 37, 16, 234, 95, 249, 14, 37, 16, 248,
+ 249, 198, 178, 37, 16, 234, 95, 198, 178, 37, 16, 248, 249, 202, 71, 37,
+ 16, 234, 95, 202, 71, 37, 16, 248, 249, 209, 192, 37, 16, 234, 95, 209,
+ 192, 37, 16, 33, 252, 60, 37, 16, 33, 201, 115, 37, 16, 33, 199, 83, 37,
+ 16, 33, 201, 116, 37, 16, 33, 217, 60, 37, 16, 33, 217, 59, 37, 16, 33,
+ 252, 59, 37, 16, 33, 218, 243, 37, 16, 250, 241, 196, 77, 37, 16, 250,
+ 241, 235, 123, 37, 16, 33, 236, 158, 37, 16, 33, 206, 184, 37, 16, 33,
+ 232, 195, 37, 16, 33, 202, 67, 37, 16, 33, 248, 227, 37, 16, 33, 55, 198,
+ 61, 37, 16, 33, 197, 225, 198, 61, 37, 16, 206, 190, 37, 16, 200, 241,
+ 37, 16, 191, 166, 37, 16, 209, 184, 37, 16, 216, 151, 37, 16, 232, 140,
+ 37, 16, 238, 229, 37, 16, 237, 132, 37, 16, 230, 228, 213, 7, 202, 97,
+ 37, 16, 230, 228, 213, 7, 213, 44, 202, 97, 37, 16, 198, 27, 37, 16, 197,
+ 58, 37, 16, 223, 93, 197, 58, 37, 16, 197, 59, 202, 97, 37, 16, 197, 59,
+ 196, 77, 37, 16, 211, 43, 201, 27, 37, 16, 211, 43, 201, 24, 37, 16, 211,
+ 43, 201, 23, 37, 16, 211, 43, 201, 22, 37, 16, 211, 43, 201, 21, 37, 16,
+ 211, 43, 201, 20, 37, 16, 211, 43, 201, 19, 37, 16, 211, 43, 201, 18, 37,
+ 16, 211, 43, 201, 17, 37, 16, 211, 43, 201, 26, 37, 16, 211, 43, 201, 25,
+ 37, 16, 230, 0, 37, 16, 214, 113, 37, 16, 234, 95, 79, 201, 69, 37, 16,
+ 237, 125, 202, 97, 37, 16, 33, 144, 248, 69, 37, 16, 33, 133, 248, 69,
+ 37, 16, 33, 230, 14, 37, 16, 33, 202, 57, 209, 111, 37, 16, 210, 54, 77,
+ 37, 16, 210, 54, 133, 77, 37, 16, 132, 210, 54, 77, 37, 16, 231, 13, 196,
+ 77, 37, 16, 231, 13, 235, 123, 37, 16, 4, 232, 249, 37, 16, 237, 241, 37,
+ 16, 237, 242, 251, 174, 37, 16, 217, 23, 37, 16, 219, 10, 37, 16, 248,
+ 33, 37, 16, 204, 29, 193, 89, 37, 16, 204, 29, 248, 139, 37, 16, 216, 39,
+ 37, 16, 216, 40, 248, 139, 37, 16, 204, 23, 193, 89, 37, 16, 204, 23,
+ 248, 139, 37, 16, 232, 70, 193, 89, 37, 16, 232, 70, 248, 139, 37, 16,
+ 219, 11, 210, 9, 207, 30, 37, 16, 219, 11, 223, 167, 207, 30, 37, 16,
+ 248, 34, 207, 30, 37, 16, 204, 29, 207, 30, 37, 16, 216, 40, 207, 30, 37,
+ 16, 204, 23, 207, 30, 37, 16, 199, 97, 210, 7, 238, 186, 208, 192, 210,
+ 8, 37, 16, 199, 97, 210, 7, 238, 186, 208, 192, 223, 166, 37, 16, 199,
+ 97, 210, 7, 238, 186, 208, 192, 210, 9, 236, 248, 37, 16, 199, 97, 223,
+ 165, 238, 186, 208, 192, 210, 8, 37, 16, 199, 97, 223, 165, 238, 186,
+ 208, 192, 223, 166, 37, 16, 199, 97, 223, 165, 238, 186, 208, 192, 223,
+ 167, 236, 248, 37, 16, 199, 97, 223, 165, 238, 186, 208, 192, 223, 167,
+ 236, 247, 37, 16, 199, 97, 223, 165, 238, 186, 208, 192, 223, 167, 236,
+ 246, 37, 16, 238, 220, 37, 16, 230, 199, 247, 194, 242, 235, 37, 16, 230,
+ 199, 233, 176, 242, 235, 37, 16, 51, 250, 120, 37, 16, 195, 39, 37, 16,
+ 209, 69, 37, 16, 242, 224, 37, 16, 205, 95, 37, 16, 242, 229, 37, 16,
+ 198, 47, 37, 16, 209, 28, 37, 16, 209, 29, 232, 198, 37, 16, 205, 96,
+ 232, 198, 37, 16, 198, 48, 207, 27, 37, 16, 209, 246, 200, 231, 37, 16,
+ 221, 148, 247, 194, 242, 235, 37, 16, 221, 148, 234, 95, 79, 209, 175,
+ 37, 16, 221, 148, 53, 213, 6, 37, 16, 221, 148, 207, 99, 77, 37, 16, 221,
+ 148, 193, 87, 213, 6, 37, 16, 221, 148, 132, 213, 6, 37, 16, 221, 148,
+ 208, 23, 213, 7, 201, 81, 235, 123, 37, 16, 221, 148, 208, 23, 213, 7,
+ 201, 81, 196, 77, 37, 16, 221, 148, 234, 160, 213, 7, 201, 81, 235, 123,
+ 37, 16, 221, 148, 234, 160, 213, 7, 201, 81, 196, 77, 37, 16, 221, 148,
+ 232, 207, 56, 37, 16, 202, 11, 37, 16, 221, 31, 35, 195, 23, 213, 10,
+ 200, 123, 35, 195, 23, 213, 10, 200, 112, 35, 195, 23, 213, 10, 200, 102,
+ 35, 195, 23, 213, 10, 200, 95, 35, 195, 23, 213, 10, 200, 87, 35, 195,
+ 23, 213, 10, 200, 81, 35, 195, 23, 213, 10, 200, 80, 35, 195, 23, 213,
+ 10, 200, 79, 35, 195, 23, 213, 10, 200, 78, 35, 195, 23, 213, 10, 200,
+ 122, 35, 195, 23, 213, 10, 200, 121, 35, 195, 23, 213, 10, 200, 120, 35,
+ 195, 23, 213, 10, 200, 119, 35, 195, 23, 213, 10, 200, 118, 35, 195, 23,
+ 213, 10, 200, 117, 35, 195, 23, 213, 10, 200, 116, 35, 195, 23, 213, 10,
+ 200, 115, 35, 195, 23, 213, 10, 200, 114, 35, 195, 23, 213, 10, 200, 113,
+ 35, 195, 23, 213, 10, 200, 111, 35, 195, 23, 213, 10, 200, 110, 35, 195,
+ 23, 213, 10, 200, 109, 35, 195, 23, 213, 10, 200, 108, 35, 195, 23, 213,
+ 10, 200, 107, 35, 195, 23, 213, 10, 200, 86, 35, 195, 23, 213, 10, 200,
+ 85, 35, 195, 23, 213, 10, 200, 84, 35, 195, 23, 213, 10, 200, 83, 35,
+ 195, 23, 213, 10, 200, 82, 35, 223, 116, 213, 10, 200, 123, 35, 223, 116,
+ 213, 10, 200, 112, 35, 223, 116, 213, 10, 200, 95, 35, 223, 116, 213, 10,
+ 200, 87, 35, 223, 116, 213, 10, 200, 80, 35, 223, 116, 213, 10, 200, 79,
+ 35, 223, 116, 213, 10, 200, 121, 35, 223, 116, 213, 10, 200, 120, 35,
+ 223, 116, 213, 10, 200, 119, 35, 223, 116, 213, 10, 200, 118, 35, 223,
+ 116, 213, 10, 200, 115, 35, 223, 116, 213, 10, 200, 114, 35, 223, 116,
+ 213, 10, 200, 113, 35, 223, 116, 213, 10, 200, 108, 35, 223, 116, 213,
+ 10, 200, 107, 35, 223, 116, 213, 10, 200, 106, 35, 223, 116, 213, 10,
+ 200, 105, 35, 223, 116, 213, 10, 200, 104, 35, 223, 116, 213, 10, 200,
+ 103, 35, 223, 116, 213, 10, 200, 101, 35, 223, 116, 213, 10, 200, 100,
+ 35, 223, 116, 213, 10, 200, 99, 35, 223, 116, 213, 10, 200, 98, 35, 223,
+ 116, 213, 10, 200, 97, 35, 223, 116, 213, 10, 200, 96, 35, 223, 116, 213,
+ 10, 200, 94, 35, 223, 116, 213, 10, 200, 93, 35, 223, 116, 213, 10, 200,
+ 92, 35, 223, 116, 213, 10, 200, 91, 35, 223, 116, 213, 10, 200, 90, 35,
+ 223, 116, 213, 10, 200, 89, 35, 223, 116, 213, 10, 200, 88, 35, 223, 116,
+ 213, 10, 200, 86, 35, 223, 116, 213, 10, 200, 85, 35, 223, 116, 213, 10,
+ 200, 84, 35, 223, 116, 213, 10, 200, 83, 35, 223, 116, 213, 10, 200, 82,
+ 33, 35, 37, 197, 221, 33, 35, 37, 199, 65, 33, 35, 37, 210, 22, 35, 37,
+ 219, 206, 222, 93, 212, 134, 191, 77, 222, 93, 212, 134, 107, 222, 93,
+ 212, 134, 109, 222, 93, 212, 134, 138, 222, 93, 212, 134, 134, 222, 93,
+ 212, 134, 149, 222, 93, 212, 134, 169, 222, 93, 212, 134, 175, 222, 93,
+ 212, 134, 171, 222, 93, 212, 134, 178, 222, 93, 212, 134, 199, 95, 222,
+ 93, 212, 134, 234, 127, 222, 93, 212, 134, 197, 37, 222, 93, 212, 134,
+ 198, 251, 222, 93, 212, 134, 232, 122, 222, 93, 212, 134, 233, 19, 222,
+ 93, 212, 134, 202, 130, 222, 93, 212, 134, 203, 244, 222, 93, 212, 134,
+ 234, 161, 222, 93, 212, 134, 213, 171, 217, 20, 212, 134, 191, 77, 217,
+ 20, 212, 134, 107, 217, 20, 212, 134, 109, 217, 20, 212, 134, 138, 217,
+ 20, 212, 134, 134, 217, 20, 212, 134, 149, 217, 20, 212, 134, 169, 217,
+ 20, 212, 134, 175, 217, 20, 212, 134, 171, 217, 20, 212, 134, 178, 217,
+ 20, 212, 134, 199, 95, 217, 20, 212, 134, 234, 127, 217, 20, 212, 134,
+ 197, 37, 217, 20, 212, 134, 198, 251, 217, 20, 212, 134, 232, 122, 217,
+ 20, 212, 134, 233, 19, 217, 20, 212, 134, 202, 130, 217, 20, 212, 134,
+ 203, 244, 217, 20, 212, 134, 234, 161, 217, 20, 212, 134, 213, 171, 215,
+ 221, 40, 234, 207, 237, 6, 40, 229, 218, 234, 207, 237, 6, 40, 228, 145,
+ 234, 207, 237, 6, 40, 234, 206, 229, 219, 237, 6, 40, 234, 206, 228, 144,
+ 237, 6, 40, 234, 207, 199, 67, 40, 247, 21, 199, 67, 40, 232, 80, 243,
+ 10, 199, 67, 40, 216, 30, 199, 67, 40, 249, 78, 199, 67, 40, 222, 10,
+ 202, 70, 199, 67, 40, 239, 23, 199, 67, 40, 250, 212, 199, 67, 40, 211,
+ 62, 199, 67, 40, 248, 45, 211, 14, 199, 67, 40, 237, 127, 211, 57, 236,
+ 213, 199, 67, 40, 236, 210, 199, 67, 40, 191, 237, 199, 67, 40, 223, 153,
+ 199, 67, 40, 210, 32, 199, 67, 40, 207, 108, 199, 67, 40, 239, 35, 199,
+ 67, 40, 229, 6, 249, 146, 199, 67, 40, 193, 171, 199, 67, 40, 232, 169,
+ 199, 67, 40, 252, 28, 199, 67, 40, 207, 62, 199, 67, 40, 207, 34, 199,
+ 67, 40, 234, 205, 199, 67, 40, 222, 185, 199, 67, 40, 239, 30, 199, 67,
+ 40, 234, 93, 199, 67, 40, 235, 59, 199, 67, 40, 246, 244, 199, 67, 40,
+ 237, 137, 199, 67, 40, 28, 207, 33, 199, 67, 40, 210, 211, 199, 67, 40,
+ 219, 210, 199, 67, 40, 242, 217, 199, 67, 40, 221, 136, 199, 67, 40, 231,
+ 189, 199, 67, 40, 201, 39, 199, 67, 40, 208, 140, 199, 67, 40, 232, 79,
+ 199, 67, 40, 207, 35, 199, 67, 40, 219, 251, 211, 57, 216, 2, 199, 67,
+ 40, 207, 31, 199, 67, 40, 230, 252, 119, 216, 206, 199, 67, 40, 234, 96,
+ 199, 67, 40, 201, 56, 199, 67, 40, 230, 202, 199, 67, 40, 234, 86, 199,
+ 67, 40, 210, 83, 199, 67, 40, 206, 177, 199, 67, 40, 232, 196, 199, 67,
+ 40, 195, 163, 211, 57, 193, 147, 199, 67, 40, 239, 40, 199, 67, 40, 216,
+ 227, 199, 67, 40, 233, 250, 199, 67, 40, 196, 88, 199, 67, 40, 236, 249,
+ 199, 67, 40, 242, 219, 215, 179, 199, 67, 40, 230, 171, 199, 67, 40, 231,
+ 190, 223, 162, 199, 67, 40, 217, 32, 199, 67, 40, 252, 54, 199, 67, 40,
+ 234, 112, 199, 67, 40, 235, 127, 199, 67, 40, 193, 145, 199, 67, 40, 202,
+ 165, 199, 67, 40, 223, 126, 199, 67, 40, 237, 93, 199, 67, 40, 237, 219,
+ 199, 67, 40, 236, 245, 199, 67, 40, 233, 213, 199, 67, 40, 203, 240, 199,
+ 67, 40, 201, 60, 199, 67, 40, 230, 16, 199, 67, 40, 242, 66, 199, 67, 40,
+ 242, 214, 199, 67, 40, 233, 88, 199, 67, 40, 251, 248, 199, 67, 40, 242,
+ 65, 199, 67, 40, 211, 105, 199, 34, 195, 138, 199, 67, 40, 237, 15, 199,
+ 67, 40, 220, 113, 199, 67, 40, 232, 131, 238, 244, 206, 145, 196, 91, 17,
+ 107, 238, 244, 206, 145, 196, 91, 17, 109, 238, 244, 206, 145, 196, 91,
+ 17, 138, 238, 244, 206, 145, 196, 91, 17, 134, 238, 244, 206, 145, 196,
+ 91, 17, 149, 238, 244, 206, 145, 196, 91, 17, 169, 238, 244, 206, 145,
+ 196, 91, 17, 175, 238, 244, 206, 145, 196, 91, 17, 171, 238, 244, 206,
+ 145, 196, 91, 17, 178, 238, 244, 206, 145, 199, 91, 17, 107, 238, 244,
+ 206, 145, 199, 91, 17, 109, 238, 244, 206, 145, 199, 91, 17, 138, 238,
+ 244, 206, 145, 199, 91, 17, 134, 238, 244, 206, 145, 199, 91, 17, 149,
+ 238, 244, 206, 145, 199, 91, 17, 169, 238, 244, 206, 145, 199, 91, 17,
+ 175, 238, 244, 206, 145, 199, 91, 17, 171, 238, 244, 206, 145, 199, 91,
+ 17, 178, 154, 199, 198, 87, 107, 154, 199, 198, 87, 109, 154, 199, 198,
+ 87, 138, 154, 199, 198, 87, 134, 154, 199, 198, 87, 149, 199, 198, 87,
+ 107, 199, 198, 87, 149, 13, 28, 6, 65, 13, 28, 6, 250, 120, 13, 28, 6,
+ 247, 193, 13, 28, 6, 238, 127, 13, 28, 6, 71, 13, 28, 6, 233, 175, 13,
+ 28, 6, 232, 51, 13, 28, 6, 230, 116, 13, 28, 6, 68, 13, 28, 6, 223, 35,
+ 13, 28, 6, 222, 152, 13, 28, 6, 172, 13, 28, 6, 218, 168, 13, 28, 6, 215,
+ 61, 13, 28, 6, 74, 13, 28, 6, 210, 236, 13, 28, 6, 208, 104, 13, 28, 6,
+ 146, 13, 28, 6, 206, 8, 13, 28, 6, 200, 43, 13, 28, 6, 66, 13, 28, 6,
+ 196, 12, 13, 28, 6, 193, 224, 13, 28, 6, 192, 235, 13, 28, 6, 192, 159,
+ 13, 28, 6, 191, 166, 13, 28, 2, 65, 13, 28, 2, 250, 120, 13, 28, 2, 247,
+ 193, 13, 28, 2, 238, 127, 13, 28, 2, 71, 13, 28, 2, 233, 175, 13, 28, 2,
+ 232, 51, 13, 28, 2, 230, 116, 13, 28, 2, 68, 13, 28, 2, 223, 35, 13, 28,
+ 2, 222, 152, 13, 28, 2, 172, 13, 28, 2, 218, 168, 13, 28, 2, 215, 61, 13,
+ 28, 2, 74, 13, 28, 2, 210, 236, 13, 28, 2, 208, 104, 13, 28, 2, 146, 13,
+ 28, 2, 206, 8, 13, 28, 2, 200, 43, 13, 28, 2, 66, 13, 28, 2, 196, 12, 13,
+ 28, 2, 193, 224, 13, 28, 2, 192, 235, 13, 28, 2, 192, 159, 13, 28, 2,
+ 191, 166, 13, 43, 6, 65, 13, 43, 6, 250, 120, 13, 43, 6, 247, 193, 13,
+ 43, 6, 238, 127, 13, 43, 6, 71, 13, 43, 6, 233, 175, 13, 43, 6, 232, 51,
+ 13, 43, 6, 230, 116, 13, 43, 6, 68, 13, 43, 6, 223, 35, 13, 43, 6, 222,
+ 152, 13, 43, 6, 172, 13, 43, 6, 218, 168, 13, 43, 6, 215, 61, 13, 43, 6,
+ 74, 13, 43, 6, 210, 236, 13, 43, 6, 208, 104, 13, 43, 6, 146, 13, 43, 6,
+ 206, 8, 13, 43, 6, 200, 43, 13, 43, 6, 66, 13, 43, 6, 196, 12, 13, 43, 6,
+ 193, 224, 13, 43, 6, 192, 235, 13, 43, 6, 192, 159, 13, 43, 6, 191, 166,
+ 13, 43, 2, 65, 13, 43, 2, 250, 120, 13, 43, 2, 247, 193, 13, 43, 2, 238,
+ 127, 13, 43, 2, 71, 13, 43, 2, 233, 175, 13, 43, 2, 232, 51, 13, 43, 2,
+ 68, 13, 43, 2, 223, 35, 13, 43, 2, 222, 152, 13, 43, 2, 172, 13, 43, 2,
+ 218, 168, 13, 43, 2, 215, 61, 13, 43, 2, 74, 13, 43, 2, 210, 236, 13, 43,
+ 2, 208, 104, 13, 43, 2, 146, 13, 43, 2, 206, 8, 13, 43, 2, 200, 43, 13,
+ 43, 2, 66, 13, 43, 2, 196, 12, 13, 43, 2, 193, 224, 13, 43, 2, 192, 235,
+ 13, 43, 2, 192, 159, 13, 43, 2, 191, 166, 13, 28, 43, 6, 65, 13, 28, 43,
+ 6, 250, 120, 13, 28, 43, 6, 247, 193, 13, 28, 43, 6, 238, 127, 13, 28,
+ 43, 6, 71, 13, 28, 43, 6, 233, 175, 13, 28, 43, 6, 232, 51, 13, 28, 43,
+ 6, 230, 116, 13, 28, 43, 6, 68, 13, 28, 43, 6, 223, 35, 13, 28, 43, 6,
+ 222, 152, 13, 28, 43, 6, 172, 13, 28, 43, 6, 218, 168, 13, 28, 43, 6,
+ 215, 61, 13, 28, 43, 6, 74, 13, 28, 43, 6, 210, 236, 13, 28, 43, 6, 208,
+ 104, 13, 28, 43, 6, 146, 13, 28, 43, 6, 206, 8, 13, 28, 43, 6, 200, 43,
+ 13, 28, 43, 6, 66, 13, 28, 43, 6, 196, 12, 13, 28, 43, 6, 193, 224, 13,
+ 28, 43, 6, 192, 235, 13, 28, 43, 6, 192, 159, 13, 28, 43, 6, 191, 166,
+ 13, 28, 43, 2, 65, 13, 28, 43, 2, 250, 120, 13, 28, 43, 2, 247, 193, 13,
+ 28, 43, 2, 238, 127, 13, 28, 43, 2, 71, 13, 28, 43, 2, 233, 175, 13, 28,
+ 43, 2, 232, 51, 13, 28, 43, 2, 230, 116, 13, 28, 43, 2, 68, 13, 28, 43,
+ 2, 223, 35, 13, 28, 43, 2, 222, 152, 13, 28, 43, 2, 172, 13, 28, 43, 2,
+ 218, 168, 13, 28, 43, 2, 215, 61, 13, 28, 43, 2, 74, 13, 28, 43, 2, 210,
+ 236, 13, 28, 43, 2, 208, 104, 13, 28, 43, 2, 146, 13, 28, 43, 2, 206, 8,
+ 13, 28, 43, 2, 200, 43, 13, 28, 43, 2, 66, 13, 28, 43, 2, 196, 12, 13,
+ 28, 43, 2, 193, 224, 13, 28, 43, 2, 192, 235, 13, 28, 43, 2, 192, 159,
+ 13, 28, 43, 2, 191, 166, 13, 27, 6, 65, 13, 27, 6, 247, 193, 13, 27, 6,
+ 238, 127, 13, 27, 6, 232, 51, 13, 27, 6, 223, 35, 13, 27, 6, 222, 152,
+ 13, 27, 6, 215, 61, 13, 27, 6, 74, 13, 27, 6, 210, 236, 13, 27, 6, 208,
+ 104, 13, 27, 6, 206, 8, 13, 27, 6, 200, 43, 13, 27, 6, 66, 13, 27, 6,
+ 196, 12, 13, 27, 6, 193, 224, 13, 27, 6, 192, 235, 13, 27, 6, 192, 159,
+ 13, 27, 6, 191, 166, 13, 27, 2, 65, 13, 27, 2, 250, 120, 13, 27, 2, 247,
+ 193, 13, 27, 2, 238, 127, 13, 27, 2, 233, 175, 13, 27, 2, 230, 116, 13,
+ 27, 2, 68, 13, 27, 2, 223, 35, 13, 27, 2, 222, 152, 13, 27, 2, 172, 13,
+ 27, 2, 218, 168, 13, 27, 2, 215, 61, 13, 27, 2, 210, 236, 13, 27, 2, 208,
+ 104, 13, 27, 2, 146, 13, 27, 2, 206, 8, 13, 27, 2, 200, 43, 13, 27, 2,
+ 66, 13, 27, 2, 196, 12, 13, 27, 2, 193, 224, 13, 27, 2, 192, 235, 13, 27,
+ 2, 192, 159, 13, 27, 2, 191, 166, 13, 28, 27, 6, 65, 13, 28, 27, 6, 250,
+ 120, 13, 28, 27, 6, 247, 193, 13, 28, 27, 6, 238, 127, 13, 28, 27, 6, 71,
+ 13, 28, 27, 6, 233, 175, 13, 28, 27, 6, 232, 51, 13, 28, 27, 6, 230, 116,
+ 13, 28, 27, 6, 68, 13, 28, 27, 6, 223, 35, 13, 28, 27, 6, 222, 152, 13,
+ 28, 27, 6, 172, 13, 28, 27, 6, 218, 168, 13, 28, 27, 6, 215, 61, 13, 28,
+ 27, 6, 74, 13, 28, 27, 6, 210, 236, 13, 28, 27, 6, 208, 104, 13, 28, 27,
+ 6, 146, 13, 28, 27, 6, 206, 8, 13, 28, 27, 6, 200, 43, 13, 28, 27, 6, 66,
+ 13, 28, 27, 6, 196, 12, 13, 28, 27, 6, 193, 224, 13, 28, 27, 6, 192, 235,
+ 13, 28, 27, 6, 192, 159, 13, 28, 27, 6, 191, 166, 13, 28, 27, 2, 65, 13,
+ 28, 27, 2, 250, 120, 13, 28, 27, 2, 247, 193, 13, 28, 27, 2, 238, 127,
+ 13, 28, 27, 2, 71, 13, 28, 27, 2, 233, 175, 13, 28, 27, 2, 232, 51, 13,
+ 28, 27, 2, 230, 116, 13, 28, 27, 2, 68, 13, 28, 27, 2, 223, 35, 13, 28,
+ 27, 2, 222, 152, 13, 28, 27, 2, 172, 13, 28, 27, 2, 218, 168, 13, 28, 27,
+ 2, 215, 61, 13, 28, 27, 2, 74, 13, 28, 27, 2, 210, 236, 13, 28, 27, 2,
+ 208, 104, 13, 28, 27, 2, 146, 13, 28, 27, 2, 206, 8, 13, 28, 27, 2, 200,
+ 43, 13, 28, 27, 2, 66, 13, 28, 27, 2, 196, 12, 13, 28, 27, 2, 193, 224,
+ 13, 28, 27, 2, 192, 235, 13, 28, 27, 2, 192, 159, 13, 28, 27, 2, 191,
+ 166, 13, 232, 115, 6, 65, 13, 232, 115, 6, 250, 120, 13, 232, 115, 6,
+ 238, 127, 13, 232, 115, 6, 71, 13, 232, 115, 6, 233, 175, 13, 232, 115,
+ 6, 232, 51, 13, 232, 115, 6, 223, 35, 13, 232, 115, 6, 222, 152, 13, 232,
+ 115, 6, 172, 13, 232, 115, 6, 218, 168, 13, 232, 115, 6, 215, 61, 13,
+ 232, 115, 6, 74, 13, 232, 115, 6, 210, 236, 13, 232, 115, 6, 208, 104,
+ 13, 232, 115, 6, 206, 8, 13, 232, 115, 6, 200, 43, 13, 232, 115, 6, 66,
+ 13, 232, 115, 6, 196, 12, 13, 232, 115, 6, 193, 224, 13, 232, 115, 6,
+ 192, 235, 13, 232, 115, 6, 192, 159, 13, 232, 115, 2, 65, 13, 232, 115,
+ 2, 250, 120, 13, 232, 115, 2, 247, 193, 13, 232, 115, 2, 238, 127, 13,
+ 232, 115, 2, 71, 13, 232, 115, 2, 233, 175, 13, 232, 115, 2, 232, 51, 13,
+ 232, 115, 2, 230, 116, 13, 232, 115, 2, 68, 13, 232, 115, 2, 223, 35, 13,
+ 232, 115, 2, 222, 152, 13, 232, 115, 2, 172, 13, 232, 115, 2, 218, 168,
+ 13, 232, 115, 2, 215, 61, 13, 232, 115, 2, 74, 13, 232, 115, 2, 210, 236,
+ 13, 232, 115, 2, 208, 104, 13, 232, 115, 2, 146, 13, 232, 115, 2, 206, 8,
+ 13, 232, 115, 2, 200, 43, 13, 232, 115, 2, 66, 13, 232, 115, 2, 196, 12,
+ 13, 232, 115, 2, 193, 224, 13, 232, 115, 2, 192, 235, 13, 232, 115, 2,
+ 192, 159, 13, 232, 115, 2, 191, 166, 13, 235, 129, 6, 65, 13, 235, 129,
+ 6, 250, 120, 13, 235, 129, 6, 238, 127, 13, 235, 129, 6, 71, 13, 235,
+ 129, 6, 233, 175, 13, 235, 129, 6, 232, 51, 13, 235, 129, 6, 68, 13, 235,
+ 129, 6, 223, 35, 13, 235, 129, 6, 222, 152, 13, 235, 129, 6, 172, 13,
+ 235, 129, 6, 218, 168, 13, 235, 129, 6, 74, 13, 235, 129, 6, 206, 8, 13,
+ 235, 129, 6, 200, 43, 13, 235, 129, 6, 66, 13, 235, 129, 6, 196, 12, 13,
+ 235, 129, 6, 193, 224, 13, 235, 129, 6, 192, 235, 13, 235, 129, 6, 192,
+ 159, 13, 235, 129, 2, 65, 13, 235, 129, 2, 250, 120, 13, 235, 129, 2,
+ 247, 193, 13, 235, 129, 2, 238, 127, 13, 235, 129, 2, 71, 13, 235, 129,
+ 2, 233, 175, 13, 235, 129, 2, 232, 51, 13, 235, 129, 2, 230, 116, 13,
+ 235, 129, 2, 68, 13, 235, 129, 2, 223, 35, 13, 235, 129, 2, 222, 152, 13,
+ 235, 129, 2, 172, 13, 235, 129, 2, 218, 168, 13, 235, 129, 2, 215, 61,
+ 13, 235, 129, 2, 74, 13, 235, 129, 2, 210, 236, 13, 235, 129, 2, 208,
+ 104, 13, 235, 129, 2, 146, 13, 235, 129, 2, 206, 8, 13, 235, 129, 2, 200,
+ 43, 13, 235, 129, 2, 66, 13, 235, 129, 2, 196, 12, 13, 235, 129, 2, 193,
+ 224, 13, 235, 129, 2, 192, 235, 13, 235, 129, 2, 192, 159, 13, 235, 129,
+ 2, 191, 166, 13, 28, 232, 115, 6, 65, 13, 28, 232, 115, 6, 250, 120, 13,
+ 28, 232, 115, 6, 247, 193, 13, 28, 232, 115, 6, 238, 127, 13, 28, 232,
+ 115, 6, 71, 13, 28, 232, 115, 6, 233, 175, 13, 28, 232, 115, 6, 232, 51,
+ 13, 28, 232, 115, 6, 230, 116, 13, 28, 232, 115, 6, 68, 13, 28, 232, 115,
+ 6, 223, 35, 13, 28, 232, 115, 6, 222, 152, 13, 28, 232, 115, 6, 172, 13,
+ 28, 232, 115, 6, 218, 168, 13, 28, 232, 115, 6, 215, 61, 13, 28, 232,
+ 115, 6, 74, 13, 28, 232, 115, 6, 210, 236, 13, 28, 232, 115, 6, 208, 104,
+ 13, 28, 232, 115, 6, 146, 13, 28, 232, 115, 6, 206, 8, 13, 28, 232, 115,
+ 6, 200, 43, 13, 28, 232, 115, 6, 66, 13, 28, 232, 115, 6, 196, 12, 13,
+ 28, 232, 115, 6, 193, 224, 13, 28, 232, 115, 6, 192, 235, 13, 28, 232,
+ 115, 6, 192, 159, 13, 28, 232, 115, 6, 191, 166, 13, 28, 232, 115, 2, 65,
+ 13, 28, 232, 115, 2, 250, 120, 13, 28, 232, 115, 2, 247, 193, 13, 28,
+ 232, 115, 2, 238, 127, 13, 28, 232, 115, 2, 71, 13, 28, 232, 115, 2, 233,
+ 175, 13, 28, 232, 115, 2, 232, 51, 13, 28, 232, 115, 2, 230, 116, 13, 28,
+ 232, 115, 2, 68, 13, 28, 232, 115, 2, 223, 35, 13, 28, 232, 115, 2, 222,
+ 152, 13, 28, 232, 115, 2, 172, 13, 28, 232, 115, 2, 218, 168, 13, 28,
+ 232, 115, 2, 215, 61, 13, 28, 232, 115, 2, 74, 13, 28, 232, 115, 2, 210,
+ 236, 13, 28, 232, 115, 2, 208, 104, 13, 28, 232, 115, 2, 146, 13, 28,
+ 232, 115, 2, 206, 8, 13, 28, 232, 115, 2, 200, 43, 13, 28, 232, 115, 2,
+ 66, 13, 28, 232, 115, 2, 196, 12, 13, 28, 232, 115, 2, 193, 224, 13, 28,
+ 232, 115, 2, 192, 235, 13, 28, 232, 115, 2, 192, 159, 13, 28, 232, 115,
+ 2, 191, 166, 13, 49, 6, 65, 13, 49, 6, 250, 120, 13, 49, 6, 247, 193, 13,
+ 49, 6, 238, 127, 13, 49, 6, 71, 13, 49, 6, 233, 175, 13, 49, 6, 232, 51,
+ 13, 49, 6, 230, 116, 13, 49, 6, 68, 13, 49, 6, 223, 35, 13, 49, 6, 222,
+ 152, 13, 49, 6, 172, 13, 49, 6, 218, 168, 13, 49, 6, 215, 61, 13, 49, 6,
+ 74, 13, 49, 6, 210, 236, 13, 49, 6, 208, 104, 13, 49, 6, 146, 13, 49, 6,
+ 206, 8, 13, 49, 6, 200, 43, 13, 49, 6, 66, 13, 49, 6, 196, 12, 13, 49, 6,
+ 193, 224, 13, 49, 6, 192, 235, 13, 49, 6, 192, 159, 13, 49, 6, 191, 166,
+ 13, 49, 2, 65, 13, 49, 2, 250, 120, 13, 49, 2, 247, 193, 13, 49, 2, 238,
+ 127, 13, 49, 2, 71, 13, 49, 2, 233, 175, 13, 49, 2, 232, 51, 13, 49, 2,
+ 230, 116, 13, 49, 2, 68, 13, 49, 2, 223, 35, 13, 49, 2, 222, 152, 13, 49,
+ 2, 172, 13, 49, 2, 218, 168, 13, 49, 2, 215, 61, 13, 49, 2, 74, 13, 49,
+ 2, 210, 236, 13, 49, 2, 208, 104, 13, 49, 2, 146, 13, 49, 2, 206, 8, 13,
+ 49, 2, 200, 43, 13, 49, 2, 66, 13, 49, 2, 196, 12, 13, 49, 2, 193, 224,
+ 13, 49, 2, 192, 235, 13, 49, 2, 192, 159, 13, 49, 2, 191, 166, 13, 49,
+ 28, 6, 65, 13, 49, 28, 6, 250, 120, 13, 49, 28, 6, 247, 193, 13, 49, 28,
+ 6, 238, 127, 13, 49, 28, 6, 71, 13, 49, 28, 6, 233, 175, 13, 49, 28, 6,
+ 232, 51, 13, 49, 28, 6, 230, 116, 13, 49, 28, 6, 68, 13, 49, 28, 6, 223,
+ 35, 13, 49, 28, 6, 222, 152, 13, 49, 28, 6, 172, 13, 49, 28, 6, 218, 168,
+ 13, 49, 28, 6, 215, 61, 13, 49, 28, 6, 74, 13, 49, 28, 6, 210, 236, 13,
+ 49, 28, 6, 208, 104, 13, 49, 28, 6, 146, 13, 49, 28, 6, 206, 8, 13, 49,
+ 28, 6, 200, 43, 13, 49, 28, 6, 66, 13, 49, 28, 6, 196, 12, 13, 49, 28, 6,
+ 193, 224, 13, 49, 28, 6, 192, 235, 13, 49, 28, 6, 192, 159, 13, 49, 28,
+ 6, 191, 166, 13, 49, 28, 2, 65, 13, 49, 28, 2, 250, 120, 13, 49, 28, 2,
+ 247, 193, 13, 49, 28, 2, 238, 127, 13, 49, 28, 2, 71, 13, 49, 28, 2, 233,
+ 175, 13, 49, 28, 2, 232, 51, 13, 49, 28, 2, 230, 116, 13, 49, 28, 2, 68,
+ 13, 49, 28, 2, 223, 35, 13, 49, 28, 2, 222, 152, 13, 49, 28, 2, 172, 13,
+ 49, 28, 2, 218, 168, 13, 49, 28, 2, 215, 61, 13, 49, 28, 2, 74, 13, 49,
+ 28, 2, 210, 236, 13, 49, 28, 2, 208, 104, 13, 49, 28, 2, 146, 13, 49, 28,
+ 2, 206, 8, 13, 49, 28, 2, 200, 43, 13, 49, 28, 2, 66, 13, 49, 28, 2, 196,
+ 12, 13, 49, 28, 2, 193, 224, 13, 49, 28, 2, 192, 235, 13, 49, 28, 2, 192,
+ 159, 13, 49, 28, 2, 191, 166, 13, 49, 43, 6, 65, 13, 49, 43, 6, 250, 120,
+ 13, 49, 43, 6, 247, 193, 13, 49, 43, 6, 238, 127, 13, 49, 43, 6, 71, 13,
+ 49, 43, 6, 233, 175, 13, 49, 43, 6, 232, 51, 13, 49, 43, 6, 230, 116, 13,
+ 49, 43, 6, 68, 13, 49, 43, 6, 223, 35, 13, 49, 43, 6, 222, 152, 13, 49,
+ 43, 6, 172, 13, 49, 43, 6, 218, 168, 13, 49, 43, 6, 215, 61, 13, 49, 43,
+ 6, 74, 13, 49, 43, 6, 210, 236, 13, 49, 43, 6, 208, 104, 13, 49, 43, 6,
+ 146, 13, 49, 43, 6, 206, 8, 13, 49, 43, 6, 200, 43, 13, 49, 43, 6, 66,
+ 13, 49, 43, 6, 196, 12, 13, 49, 43, 6, 193, 224, 13, 49, 43, 6, 192, 235,
+ 13, 49, 43, 6, 192, 159, 13, 49, 43, 6, 191, 166, 13, 49, 43, 2, 65, 13,
+ 49, 43, 2, 250, 120, 13, 49, 43, 2, 247, 193, 13, 49, 43, 2, 238, 127,
+ 13, 49, 43, 2, 71, 13, 49, 43, 2, 233, 175, 13, 49, 43, 2, 232, 51, 13,
+ 49, 43, 2, 230, 116, 13, 49, 43, 2, 68, 13, 49, 43, 2, 223, 35, 13, 49,
+ 43, 2, 222, 152, 13, 49, 43, 2, 172, 13, 49, 43, 2, 218, 168, 13, 49, 43,
+ 2, 215, 61, 13, 49, 43, 2, 74, 13, 49, 43, 2, 210, 236, 13, 49, 43, 2,
+ 208, 104, 13, 49, 43, 2, 146, 13, 49, 43, 2, 206, 8, 13, 49, 43, 2, 200,
+ 43, 13, 49, 43, 2, 66, 13, 49, 43, 2, 196, 12, 13, 49, 43, 2, 193, 224,
+ 13, 49, 43, 2, 192, 235, 13, 49, 43, 2, 192, 159, 13, 49, 43, 2, 191,
+ 166, 13, 49, 28, 43, 6, 65, 13, 49, 28, 43, 6, 250, 120, 13, 49, 28, 43,
+ 6, 247, 193, 13, 49, 28, 43, 6, 238, 127, 13, 49, 28, 43, 6, 71, 13, 49,
+ 28, 43, 6, 233, 175, 13, 49, 28, 43, 6, 232, 51, 13, 49, 28, 43, 6, 230,
+ 116, 13, 49, 28, 43, 6, 68, 13, 49, 28, 43, 6, 223, 35, 13, 49, 28, 43,
+ 6, 222, 152, 13, 49, 28, 43, 6, 172, 13, 49, 28, 43, 6, 218, 168, 13, 49,
+ 28, 43, 6, 215, 61, 13, 49, 28, 43, 6, 74, 13, 49, 28, 43, 6, 210, 236,
+ 13, 49, 28, 43, 6, 208, 104, 13, 49, 28, 43, 6, 146, 13, 49, 28, 43, 6,
+ 206, 8, 13, 49, 28, 43, 6, 200, 43, 13, 49, 28, 43, 6, 66, 13, 49, 28,
+ 43, 6, 196, 12, 13, 49, 28, 43, 6, 193, 224, 13, 49, 28, 43, 6, 192, 235,
+ 13, 49, 28, 43, 6, 192, 159, 13, 49, 28, 43, 6, 191, 166, 13, 49, 28, 43,
+ 2, 65, 13, 49, 28, 43, 2, 250, 120, 13, 49, 28, 43, 2, 247, 193, 13, 49,
+ 28, 43, 2, 238, 127, 13, 49, 28, 43, 2, 71, 13, 49, 28, 43, 2, 233, 175,
+ 13, 49, 28, 43, 2, 232, 51, 13, 49, 28, 43, 2, 230, 116, 13, 49, 28, 43,
+ 2, 68, 13, 49, 28, 43, 2, 223, 35, 13, 49, 28, 43, 2, 222, 152, 13, 49,
+ 28, 43, 2, 172, 13, 49, 28, 43, 2, 218, 168, 13, 49, 28, 43, 2, 215, 61,
+ 13, 49, 28, 43, 2, 74, 13, 49, 28, 43, 2, 210, 236, 13, 49, 28, 43, 2,
+ 208, 104, 13, 49, 28, 43, 2, 146, 13, 49, 28, 43, 2, 206, 8, 13, 49, 28,
+ 43, 2, 200, 43, 13, 49, 28, 43, 2, 66, 13, 49, 28, 43, 2, 196, 12, 13,
+ 49, 28, 43, 2, 193, 224, 13, 49, 28, 43, 2, 192, 235, 13, 49, 28, 43, 2,
+ 192, 159, 13, 49, 28, 43, 2, 191, 166, 13, 215, 217, 6, 65, 13, 215, 217,
+ 6, 250, 120, 13, 215, 217, 6, 247, 193, 13, 215, 217, 6, 238, 127, 13,
+ 215, 217, 6, 71, 13, 215, 217, 6, 233, 175, 13, 215, 217, 6, 232, 51, 13,
+ 215, 217, 6, 230, 116, 13, 215, 217, 6, 68, 13, 215, 217, 6, 223, 35, 13,
+ 215, 217, 6, 222, 152, 13, 215, 217, 6, 172, 13, 215, 217, 6, 218, 168,
+ 13, 215, 217, 6, 215, 61, 13, 215, 217, 6, 74, 13, 215, 217, 6, 210, 236,
+ 13, 215, 217, 6, 208, 104, 13, 215, 217, 6, 146, 13, 215, 217, 6, 206, 8,
+ 13, 215, 217, 6, 200, 43, 13, 215, 217, 6, 66, 13, 215, 217, 6, 196, 12,
+ 13, 215, 217, 6, 193, 224, 13, 215, 217, 6, 192, 235, 13, 215, 217, 6,
+ 192, 159, 13, 215, 217, 6, 191, 166, 13, 215, 217, 2, 65, 13, 215, 217,
+ 2, 250, 120, 13, 215, 217, 2, 247, 193, 13, 215, 217, 2, 238, 127, 13,
+ 215, 217, 2, 71, 13, 215, 217, 2, 233, 175, 13, 215, 217, 2, 232, 51, 13,
+ 215, 217, 2, 230, 116, 13, 215, 217, 2, 68, 13, 215, 217, 2, 223, 35, 13,
+ 215, 217, 2, 222, 152, 13, 215, 217, 2, 172, 13, 215, 217, 2, 218, 168,
+ 13, 215, 217, 2, 215, 61, 13, 215, 217, 2, 74, 13, 215, 217, 2, 210, 236,
+ 13, 215, 217, 2, 208, 104, 13, 215, 217, 2, 146, 13, 215, 217, 2, 206, 8,
+ 13, 215, 217, 2, 200, 43, 13, 215, 217, 2, 66, 13, 215, 217, 2, 196, 12,
+ 13, 215, 217, 2, 193, 224, 13, 215, 217, 2, 192, 235, 13, 215, 217, 2,
+ 192, 159, 13, 215, 217, 2, 191, 166, 13, 43, 2, 236, 139, 68, 13, 43, 2,
+ 236, 139, 223, 35, 13, 28, 6, 251, 160, 13, 28, 6, 248, 212, 13, 28, 6,
+ 231, 211, 13, 28, 6, 237, 106, 13, 28, 6, 234, 47, 13, 28, 6, 191, 76,
+ 13, 28, 6, 233, 253, 13, 28, 6, 199, 15, 13, 28, 6, 223, 83, 13, 28, 6,
+ 222, 72, 13, 28, 6, 220, 31, 13, 28, 6, 215, 155, 13, 28, 6, 212, 178,
+ 13, 28, 6, 192, 207, 13, 28, 6, 211, 107, 13, 28, 6, 209, 185, 13, 28, 6,
+ 207, 3, 13, 28, 6, 199, 16, 113, 13, 28, 6, 202, 196, 13, 28, 6, 199,
+ 166, 13, 28, 6, 196, 70, 13, 28, 6, 209, 211, 13, 28, 6, 243, 95, 13, 28,
+ 6, 208, 176, 13, 28, 6, 211, 110, 13, 28, 214, 245, 13, 28, 2, 251, 160,
+ 13, 28, 2, 248, 212, 13, 28, 2, 231, 211, 13, 28, 2, 237, 106, 13, 28, 2,
+ 234, 47, 13, 28, 2, 191, 76, 13, 28, 2, 233, 253, 13, 28, 2, 199, 15, 13,
+ 28, 2, 223, 83, 13, 28, 2, 222, 72, 13, 28, 2, 220, 31, 13, 28, 2, 215,
+ 155, 13, 28, 2, 212, 178, 13, 28, 2, 192, 207, 13, 28, 2, 211, 107, 13,
+ 28, 2, 209, 185, 13, 28, 2, 207, 3, 13, 28, 2, 53, 202, 196, 13, 28, 2,
+ 202, 196, 13, 28, 2, 199, 166, 13, 28, 2, 196, 70, 13, 28, 2, 209, 211,
+ 13, 28, 2, 243, 95, 13, 28, 2, 208, 176, 13, 28, 2, 211, 110, 13, 28,
+ 210, 105, 237, 16, 13, 28, 234, 48, 113, 13, 28, 199, 16, 113, 13, 28,
+ 222, 73, 113, 13, 28, 209, 212, 113, 13, 28, 207, 4, 113, 13, 28, 209,
+ 186, 113, 13, 43, 6, 251, 160, 13, 43, 6, 248, 212, 13, 43, 6, 231, 211,
+ 13, 43, 6, 237, 106, 13, 43, 6, 234, 47, 13, 43, 6, 191, 76, 13, 43, 6,
+ 233, 253, 13, 43, 6, 199, 15, 13, 43, 6, 223, 83, 13, 43, 6, 222, 72, 13,
+ 43, 6, 220, 31, 13, 43, 6, 215, 155, 13, 43, 6, 212, 178, 13, 43, 6, 192,
+ 207, 13, 43, 6, 211, 107, 13, 43, 6, 209, 185, 13, 43, 6, 207, 3, 13, 43,
+ 6, 199, 16, 113, 13, 43, 6, 202, 196, 13, 43, 6, 199, 166, 13, 43, 6,
+ 196, 70, 13, 43, 6, 209, 211, 13, 43, 6, 243, 95, 13, 43, 6, 208, 176,
+ 13, 43, 6, 211, 110, 13, 43, 214, 245, 13, 43, 2, 251, 160, 13, 43, 2,
+ 248, 212, 13, 43, 2, 231, 211, 13, 43, 2, 237, 106, 13, 43, 2, 234, 47,
+ 13, 43, 2, 191, 76, 13, 43, 2, 233, 253, 13, 43, 2, 199, 15, 13, 43, 2,
+ 223, 83, 13, 43, 2, 222, 72, 13, 43, 2, 220, 31, 13, 43, 2, 215, 155, 13,
+ 43, 2, 212, 178, 13, 43, 2, 192, 207, 13, 43, 2, 211, 107, 13, 43, 2,
+ 209, 185, 13, 43, 2, 207, 3, 13, 43, 2, 53, 202, 196, 13, 43, 2, 202,
+ 196, 13, 43, 2, 199, 166, 13, 43, 2, 196, 70, 13, 43, 2, 209, 211, 13,
+ 43, 2, 243, 95, 13, 43, 2, 208, 176, 13, 43, 2, 211, 110, 13, 43, 210,
+ 105, 237, 16, 13, 43, 234, 48, 113, 13, 43, 199, 16, 113, 13, 43, 222,
+ 73, 113, 13, 43, 209, 212, 113, 13, 43, 207, 4, 113, 13, 43, 209, 186,
+ 113, 13, 28, 43, 6, 251, 160, 13, 28, 43, 6, 248, 212, 13, 28, 43, 6,
+ 231, 211, 13, 28, 43, 6, 237, 106, 13, 28, 43, 6, 234, 47, 13, 28, 43, 6,
+ 191, 76, 13, 28, 43, 6, 233, 253, 13, 28, 43, 6, 199, 15, 13, 28, 43, 6,
+ 223, 83, 13, 28, 43, 6, 222, 72, 13, 28, 43, 6, 220, 31, 13, 28, 43, 6,
+ 215, 155, 13, 28, 43, 6, 212, 178, 13, 28, 43, 6, 192, 207, 13, 28, 43,
+ 6, 211, 107, 13, 28, 43, 6, 209, 185, 13, 28, 43, 6, 207, 3, 13, 28, 43,
+ 6, 199, 16, 113, 13, 28, 43, 6, 202, 196, 13, 28, 43, 6, 199, 166, 13,
+ 28, 43, 6, 196, 70, 13, 28, 43, 6, 209, 211, 13, 28, 43, 6, 243, 95, 13,
+ 28, 43, 6, 208, 176, 13, 28, 43, 6, 211, 110, 13, 28, 43, 214, 245, 13,
+ 28, 43, 2, 251, 160, 13, 28, 43, 2, 248, 212, 13, 28, 43, 2, 231, 211,
+ 13, 28, 43, 2, 237, 106, 13, 28, 43, 2, 234, 47, 13, 28, 43, 2, 191, 76,
+ 13, 28, 43, 2, 233, 253, 13, 28, 43, 2, 199, 15, 13, 28, 43, 2, 223, 83,
+ 13, 28, 43, 2, 222, 72, 13, 28, 43, 2, 220, 31, 13, 28, 43, 2, 215, 155,
+ 13, 28, 43, 2, 212, 178, 13, 28, 43, 2, 192, 207, 13, 28, 43, 2, 211,
+ 107, 13, 28, 43, 2, 209, 185, 13, 28, 43, 2, 207, 3, 13, 28, 43, 2, 53,
+ 202, 196, 13, 28, 43, 2, 202, 196, 13, 28, 43, 2, 199, 166, 13, 28, 43,
+ 2, 196, 70, 13, 28, 43, 2, 209, 211, 13, 28, 43, 2, 243, 95, 13, 28, 43,
+ 2, 208, 176, 13, 28, 43, 2, 211, 110, 13, 28, 43, 210, 105, 237, 16, 13,
+ 28, 43, 234, 48, 113, 13, 28, 43, 199, 16, 113, 13, 28, 43, 222, 73, 113,
+ 13, 28, 43, 209, 212, 113, 13, 28, 43, 207, 4, 113, 13, 28, 43, 209, 186,
+ 113, 13, 49, 28, 6, 251, 160, 13, 49, 28, 6, 248, 212, 13, 49, 28, 6,
+ 231, 211, 13, 49, 28, 6, 237, 106, 13, 49, 28, 6, 234, 47, 13, 49, 28, 6,
+ 191, 76, 13, 49, 28, 6, 233, 253, 13, 49, 28, 6, 199, 15, 13, 49, 28, 6,
+ 223, 83, 13, 49, 28, 6, 222, 72, 13, 49, 28, 6, 220, 31, 13, 49, 28, 6,
+ 215, 155, 13, 49, 28, 6, 212, 178, 13, 49, 28, 6, 192, 207, 13, 49, 28,
+ 6, 211, 107, 13, 49, 28, 6, 209, 185, 13, 49, 28, 6, 207, 3, 13, 49, 28,
+ 6, 199, 16, 113, 13, 49, 28, 6, 202, 196, 13, 49, 28, 6, 199, 166, 13,
+ 49, 28, 6, 196, 70, 13, 49, 28, 6, 209, 211, 13, 49, 28, 6, 243, 95, 13,
+ 49, 28, 6, 208, 176, 13, 49, 28, 6, 211, 110, 13, 49, 28, 214, 245, 13,
+ 49, 28, 2, 251, 160, 13, 49, 28, 2, 248, 212, 13, 49, 28, 2, 231, 211,
+ 13, 49, 28, 2, 237, 106, 13, 49, 28, 2, 234, 47, 13, 49, 28, 2, 191, 76,
+ 13, 49, 28, 2, 233, 253, 13, 49, 28, 2, 199, 15, 13, 49, 28, 2, 223, 83,
+ 13, 49, 28, 2, 222, 72, 13, 49, 28, 2, 220, 31, 13, 49, 28, 2, 215, 155,
+ 13, 49, 28, 2, 212, 178, 13, 49, 28, 2, 192, 207, 13, 49, 28, 2, 211,
+ 107, 13, 49, 28, 2, 209, 185, 13, 49, 28, 2, 207, 3, 13, 49, 28, 2, 53,
+ 202, 196, 13, 49, 28, 2, 202, 196, 13, 49, 28, 2, 199, 166, 13, 49, 28,
+ 2, 196, 70, 13, 49, 28, 2, 209, 211, 13, 49, 28, 2, 243, 95, 13, 49, 28,
+ 2, 208, 176, 13, 49, 28, 2, 211, 110, 13, 49, 28, 210, 105, 237, 16, 13,
+ 49, 28, 234, 48, 113, 13, 49, 28, 199, 16, 113, 13, 49, 28, 222, 73, 113,
+ 13, 49, 28, 209, 212, 113, 13, 49, 28, 207, 4, 113, 13, 49, 28, 209, 186,
+ 113, 13, 49, 28, 43, 6, 251, 160, 13, 49, 28, 43, 6, 248, 212, 13, 49,
+ 28, 43, 6, 231, 211, 13, 49, 28, 43, 6, 237, 106, 13, 49, 28, 43, 6, 234,
+ 47, 13, 49, 28, 43, 6, 191, 76, 13, 49, 28, 43, 6, 233, 253, 13, 49, 28,
+ 43, 6, 199, 15, 13, 49, 28, 43, 6, 223, 83, 13, 49, 28, 43, 6, 222, 72,
+ 13, 49, 28, 43, 6, 220, 31, 13, 49, 28, 43, 6, 215, 155, 13, 49, 28, 43,
+ 6, 212, 178, 13, 49, 28, 43, 6, 192, 207, 13, 49, 28, 43, 6, 211, 107,
+ 13, 49, 28, 43, 6, 209, 185, 13, 49, 28, 43, 6, 207, 3, 13, 49, 28, 43,
+ 6, 199, 16, 113, 13, 49, 28, 43, 6, 202, 196, 13, 49, 28, 43, 6, 199,
+ 166, 13, 49, 28, 43, 6, 196, 70, 13, 49, 28, 43, 6, 209, 211, 13, 49, 28,
+ 43, 6, 243, 95, 13, 49, 28, 43, 6, 208, 176, 13, 49, 28, 43, 6, 211, 110,
+ 13, 49, 28, 43, 214, 245, 13, 49, 28, 43, 2, 251, 160, 13, 49, 28, 43, 2,
+ 248, 212, 13, 49, 28, 43, 2, 231, 211, 13, 49, 28, 43, 2, 237, 106, 13,
+ 49, 28, 43, 2, 234, 47, 13, 49, 28, 43, 2, 191, 76, 13, 49, 28, 43, 2,
+ 233, 253, 13, 49, 28, 43, 2, 199, 15, 13, 49, 28, 43, 2, 223, 83, 13, 49,
+ 28, 43, 2, 222, 72, 13, 49, 28, 43, 2, 220, 31, 13, 49, 28, 43, 2, 215,
+ 155, 13, 49, 28, 43, 2, 212, 178, 13, 49, 28, 43, 2, 192, 207, 13, 49,
+ 28, 43, 2, 211, 107, 13, 49, 28, 43, 2, 209, 185, 13, 49, 28, 43, 2, 207,
+ 3, 13, 49, 28, 43, 2, 53, 202, 196, 13, 49, 28, 43, 2, 202, 196, 13, 49,
+ 28, 43, 2, 199, 166, 13, 49, 28, 43, 2, 196, 70, 13, 49, 28, 43, 2, 209,
+ 211, 13, 49, 28, 43, 2, 243, 95, 13, 49, 28, 43, 2, 208, 176, 13, 49, 28,
+ 43, 2, 211, 110, 13, 49, 28, 43, 210, 105, 237, 16, 13, 49, 28, 43, 234,
+ 48, 113, 13, 49, 28, 43, 199, 16, 113, 13, 49, 28, 43, 222, 73, 113, 13,
+ 49, 28, 43, 209, 212, 113, 13, 49, 28, 43, 207, 4, 113, 13, 49, 28, 43,
+ 209, 186, 113, 13, 28, 6, 237, 10, 13, 28, 2, 237, 10, 13, 28, 17, 191,
+ 77, 13, 28, 17, 107, 13, 28, 17, 109, 13, 28, 17, 138, 13, 28, 17, 134,
+ 13, 28, 17, 149, 13, 28, 17, 169, 13, 28, 17, 175, 13, 28, 17, 171, 13,
+ 28, 17, 178, 13, 235, 129, 17, 191, 77, 13, 235, 129, 17, 107, 13, 235,
+ 129, 17, 109, 13, 235, 129, 17, 138, 13, 235, 129, 17, 134, 13, 235, 129,
+ 17, 149, 13, 235, 129, 17, 169, 13, 235, 129, 17, 175, 13, 235, 129, 17,
+ 171, 13, 235, 129, 17, 178, 13, 49, 17, 191, 77, 13, 49, 17, 107, 13, 49,
+ 17, 109, 13, 49, 17, 138, 13, 49, 17, 134, 13, 49, 17, 149, 13, 49, 17,
+ 169, 13, 49, 17, 175, 13, 49, 17, 171, 13, 49, 17, 178, 13, 49, 28, 17,
+ 191, 77, 13, 49, 28, 17, 107, 13, 49, 28, 17, 109, 13, 49, 28, 17, 138,
+ 13, 49, 28, 17, 134, 13, 49, 28, 17, 149, 13, 49, 28, 17, 169, 13, 49,
+ 28, 17, 175, 13, 49, 28, 17, 171, 13, 49, 28, 17, 178, 13, 215, 217, 17,
+ 191, 77, 13, 215, 217, 17, 107, 13, 215, 217, 17, 109, 13, 215, 217, 17,
+ 138, 13, 215, 217, 17, 134, 13, 215, 217, 17, 149, 13, 215, 217, 17, 169,
+ 13, 215, 217, 17, 175, 13, 215, 217, 17, 171, 13, 215, 217, 17, 178, 24,
+ 151, 223, 148, 24, 230, 50, 223, 148, 24, 230, 46, 223, 148, 24, 230, 35,
+ 223, 148, 24, 230, 39, 223, 148, 24, 230, 52, 223, 148, 24, 151, 141,
+ 248, 223, 24, 230, 50, 141, 248, 223, 24, 151, 176, 196, 105, 141, 248,
+ 223, 24, 151, 141, 207, 147, 221, 70, 24, 151, 141, 238, 177, 24, 151,
+ 141, 229, 124, 24, 151, 141, 229, 125, 218, 241, 24, 230, 50, 141, 229,
+ 126, 24, 151, 141, 216, 84, 24, 230, 50, 141, 216, 84, 24, 151, 141, 82,
+ 248, 223, 24, 151, 141, 82, 207, 147, 221, 69, 24, 151, 141, 82, 229,
+ 124, 24, 151, 141, 133, 82, 229, 124, 24, 151, 141, 229, 125, 82, 196,
+ 77, 24, 151, 141, 82, 239, 46, 24, 151, 141, 82, 239, 47, 141, 248, 223,
+ 24, 151, 141, 82, 239, 47, 82, 248, 223, 24, 151, 141, 82, 239, 47, 238,
+ 177, 24, 151, 141, 82, 239, 47, 229, 124, 24, 151, 141, 82, 238, 213, 24,
+ 230, 50, 141, 82, 238, 213, 24, 151, 82, 248, 224, 139, 223, 148, 24,
+ 151, 141, 248, 224, 139, 216, 84, 24, 151, 141, 82, 198, 212, 24, 230,
+ 50, 141, 82, 198, 212, 24, 151, 141, 82, 201, 53, 176, 248, 223, 24, 151,
+ 141, 82, 248, 224, 176, 201, 52, 24, 151, 141, 82, 176, 248, 223, 24,
+ 151, 141, 82, 229, 125, 201, 199, 176, 202, 207, 24, 151, 141, 133, 82,
+ 229, 125, 176, 202, 207, 24, 151, 141, 133, 82, 229, 125, 176, 239, 46,
+ 24, 151, 141, 229, 125, 82, 133, 176, 202, 207, 24, 151, 141, 82, 133,
+ 201, 199, 176, 232, 132, 24, 151, 141, 82, 176, 238, 177, 24, 151, 141,
+ 82, 176, 243, 9, 24, 151, 141, 82, 176, 228, 249, 24, 151, 141, 82, 176,
+ 229, 124, 24, 151, 176, 248, 210, 141, 82, 201, 52, 24, 151, 141, 82,
+ 239, 47, 176, 202, 207, 24, 151, 141, 82, 239, 47, 176, 202, 208, 239,
+ 46, 24, 151, 141, 82, 239, 47, 176, 202, 208, 248, 223, 24, 151, 82, 176,
+ 228, 250, 141, 196, 77, 24, 151, 141, 176, 228, 250, 82, 196, 77, 24,
+ 151, 141, 82, 239, 47, 229, 125, 176, 202, 207, 24, 151, 141, 82, 238,
+ 214, 176, 202, 207, 24, 151, 141, 82, 239, 47, 176, 232, 132, 24, 151,
+ 141, 82, 239, 47, 238, 178, 176, 232, 132, 24, 151, 82, 176, 238, 178,
+ 141, 196, 77, 24, 151, 141, 176, 238, 178, 82, 196, 77, 24, 151, 82, 176,
+ 47, 141, 196, 77, 24, 151, 82, 176, 47, 141, 229, 124, 24, 151, 141, 176,
+ 251, 114, 211, 15, 82, 196, 77, 24, 151, 141, 176, 251, 114, 223, 163,
+ 82, 196, 77, 24, 151, 141, 176, 47, 82, 196, 77, 24, 151, 141, 82, 176,
+ 239, 47, 229, 124, 24, 151, 141, 82, 176, 251, 114, 211, 14, 24, 151,
+ 141, 82, 176, 251, 113, 24, 151, 82, 176, 251, 114, 211, 15, 141, 196,
+ 77, 24, 151, 82, 176, 251, 114, 211, 15, 141, 238, 213, 24, 151, 82, 176,
+ 251, 114, 141, 196, 77, 24, 151, 141, 176, 228, 250, 82, 229, 124, 24,
+ 230, 41, 232, 128, 232, 247, 24, 230, 41, 232, 128, 232, 248, 248, 223,
+ 24, 230, 41, 232, 128, 232, 248, 229, 124, 24, 230, 41, 232, 128, 232,
+ 248, 239, 46, 24, 230, 41, 232, 128, 232, 248, 239, 47, 201, 209, 24,
+ 230, 48, 232, 128, 232, 248, 239, 46, 24, 151, 232, 128, 232, 248, 239,
+ 47, 248, 223, 24, 230, 39, 232, 128, 232, 248, 239, 46, 24, 230, 41, 232,
+ 226, 232, 248, 201, 198, 24, 230, 41, 229, 213, 232, 226, 232, 248, 201,
+ 198, 24, 230, 41, 232, 226, 232, 248, 201, 199, 232, 128, 248, 223, 24,
+ 230, 41, 229, 213, 232, 226, 232, 248, 201, 199, 232, 128, 248, 223, 24,
+ 230, 41, 232, 226, 232, 248, 201, 199, 248, 223, 24, 230, 41, 229, 213,
+ 232, 226, 232, 248, 201, 199, 248, 223, 24, 230, 41, 232, 226, 232, 248,
+ 201, 199, 176, 232, 132, 24, 230, 46, 232, 226, 232, 248, 201, 198, 24,
+ 230, 46, 232, 226, 232, 248, 201, 199, 211, 76, 24, 230, 39, 232, 226,
+ 232, 248, 201, 199, 211, 76, 24, 230, 35, 232, 226, 232, 248, 201, 198,
+ 24, 230, 41, 232, 226, 232, 248, 201, 199, 229, 124, 24, 230, 41, 232,
+ 226, 232, 248, 201, 199, 229, 125, 176, 202, 207, 24, 230, 41, 232, 226,
+ 232, 248, 201, 199, 229, 125, 213, 44, 198, 212, 24, 230, 40, 24, 230,
+ 41, 248, 210, 210, 183, 233, 95, 24, 230, 41, 229, 212, 24, 230, 41, 176,
+ 202, 207, 24, 230, 41, 229, 213, 176, 202, 207, 24, 230, 41, 176, 248,
+ 223, 24, 230, 41, 176, 232, 132, 24, 230, 41, 201, 210, 141, 176, 202,
+ 207, 24, 230, 41, 201, 210, 247, 21, 24, 230, 41, 201, 210, 247, 22, 176,
+ 202, 207, 24, 230, 41, 201, 210, 247, 22, 176, 202, 208, 248, 223, 24,
+ 230, 41, 201, 210, 219, 82, 24, 230, 47, 24, 230, 48, 176, 202, 207, 24,
+ 230, 48, 213, 44, 198, 212, 24, 230, 48, 176, 232, 132, 24, 230, 37, 238,
+ 173, 24, 230, 36, 24, 230, 46, 211, 76, 24, 230, 45, 24, 230, 46, 211,
+ 77, 176, 202, 207, 24, 230, 46, 176, 202, 207, 24, 230, 46, 211, 77, 213,
+ 44, 198, 212, 24, 230, 46, 213, 44, 198, 212, 24, 230, 46, 211, 77, 176,
+ 232, 132, 24, 230, 46, 176, 232, 132, 24, 230, 44, 211, 76, 24, 230, 43,
+ 24, 230, 49, 24, 230, 34, 24, 230, 35, 176, 202, 207, 24, 230, 35, 213,
+ 44, 198, 212, 24, 230, 35, 176, 232, 132, 24, 230, 39, 211, 76, 24, 230,
+ 39, 211, 77, 176, 232, 132, 24, 230, 38, 24, 230, 39, 202, 70, 24, 230,
+ 39, 211, 77, 176, 202, 207, 24, 230, 39, 176, 202, 207, 24, 230, 39, 211,
+ 77, 213, 44, 198, 212, 24, 230, 39, 213, 44, 198, 212, 24, 230, 39, 176,
+ 202, 208, 198, 35, 223, 148, 24, 230, 39, 176, 248, 210, 82, 206, 188,
+ 24, 230, 51, 24, 151, 141, 82, 206, 188, 24, 230, 50, 141, 82, 206, 188,
+ 24, 230, 39, 141, 82, 206, 188, 24, 230, 52, 141, 82, 206, 188, 24, 230,
+ 39, 219, 82, 24, 151, 141, 82, 206, 189, 248, 223, 24, 151, 141, 82, 206,
+ 189, 239, 46, 24, 230, 39, 141, 82, 206, 189, 239, 46, 24, 151, 219, 83,
+ 235, 123, 24, 151, 219, 83, 144, 206, 183, 201, 52, 24, 151, 219, 83,
+ 144, 206, 183, 238, 162, 24, 151, 219, 83, 144, 211, 26, 243, 9, 24, 151,
+ 219, 83, 196, 77, 24, 151, 176, 196, 105, 219, 83, 196, 77, 24, 230, 50,
+ 219, 83, 196, 77, 24, 230, 35, 219, 83, 196, 77, 24, 230, 52, 219, 83,
+ 196, 77, 24, 151, 219, 83, 207, 147, 221, 70, 24, 151, 219, 83, 248, 223,
+ 24, 151, 219, 83, 198, 36, 198, 212, 24, 151, 219, 83, 198, 212, 24, 230,
+ 39, 219, 83, 198, 212, 24, 151, 219, 83, 141, 198, 212, 24, 230, 39, 219,
+ 83, 141, 198, 212, 24, 230, 52, 219, 83, 141, 176, 141, 176, 211, 14, 24,
+ 230, 52, 219, 83, 141, 176, 141, 198, 212, 24, 151, 219, 83, 223, 148,
+ 24, 230, 50, 219, 83, 223, 148, 24, 230, 39, 219, 83, 223, 148, 24, 230,
+ 52, 219, 83, 223, 148, 24, 151, 141, 82, 219, 82, 24, 230, 50, 141, 82,
+ 219, 82, 24, 230, 39, 141, 82, 219, 82, 24, 230, 39, 206, 188, 24, 230,
+ 52, 141, 82, 219, 82, 24, 151, 141, 82, 238, 218, 219, 82, 24, 230, 50,
+ 141, 82, 238, 218, 219, 82, 24, 151, 206, 189, 235, 123, 24, 230, 39,
+ 206, 189, 144, 141, 176, 228, 251, 216, 84, 24, 230, 52, 206, 189, 144,
+ 82, 176, 141, 238, 217, 24, 151, 206, 189, 196, 77, 24, 151, 206, 189,
+ 207, 147, 221, 70, 24, 151, 206, 189, 219, 82, 24, 230, 50, 206, 189,
+ 219, 82, 24, 230, 35, 206, 189, 219, 82, 24, 230, 52, 206, 189, 219, 82,
+ 24, 151, 206, 189, 216, 84, 24, 151, 206, 189, 82, 239, 46, 24, 151, 206,
+ 189, 82, 207, 147, 221, 69, 24, 151, 206, 189, 223, 148, 24, 151, 206,
+ 189, 198, 212, 24, 230, 37, 206, 189, 198, 212, 24, 151, 141, 206, 189,
+ 219, 82, 24, 230, 50, 141, 206, 189, 219, 82, 24, 230, 44, 141, 206, 189,
+ 219, 83, 211, 104, 24, 230, 37, 141, 206, 189, 219, 83, 211, 14, 24, 230,
+ 37, 141, 206, 189, 219, 83, 223, 162, 24, 230, 37, 141, 206, 189, 219,
+ 83, 196, 104, 24, 230, 46, 141, 206, 189, 219, 82, 24, 230, 39, 141, 206,
+ 189, 219, 82, 24, 230, 52, 141, 206, 189, 219, 83, 211, 14, 24, 230, 52,
+ 141, 206, 189, 219, 82, 24, 151, 82, 235, 123, 24, 230, 39, 216, 84, 24,
+ 151, 82, 196, 77, 24, 230, 50, 82, 196, 77, 24, 151, 82, 207, 147, 221,
+ 70, 24, 151, 82, 133, 176, 202, 207, 24, 230, 37, 82, 198, 212, 24, 151,
+ 82, 176, 219, 82, 24, 151, 82, 219, 82, 24, 151, 82, 206, 189, 219, 82,
+ 24, 230, 50, 82, 206, 189, 219, 82, 24, 230, 44, 82, 206, 189, 219, 83,
+ 211, 104, 24, 230, 46, 82, 206, 189, 219, 82, 24, 230, 39, 82, 206, 189,
+ 219, 82, 24, 230, 52, 82, 206, 189, 219, 83, 211, 14, 24, 230, 52, 82,
+ 206, 189, 219, 83, 223, 162, 24, 230, 52, 82, 206, 189, 219, 82, 24, 230,
+ 50, 82, 206, 189, 219, 83, 248, 223, 24, 230, 48, 82, 206, 189, 219, 83,
+ 239, 46, 24, 230, 48, 82, 206, 189, 219, 83, 239, 47, 202, 207, 24, 230,
+ 37, 82, 206, 189, 219, 83, 239, 47, 211, 14, 24, 230, 37, 82, 206, 189,
+ 219, 83, 239, 47, 223, 162, 24, 230, 37, 82, 206, 189, 219, 83, 239, 46,
+ 24, 230, 39, 141, 229, 124, 24, 151, 141, 176, 202, 207, 24, 230, 39,
+ 141, 176, 202, 207, 24, 151, 141, 176, 202, 208, 176, 237, 38, 24, 151,
+ 141, 176, 202, 208, 176, 239, 46, 24, 151, 141, 176, 202, 208, 176, 248,
+ 223, 24, 151, 141, 176, 202, 208, 141, 248, 223, 24, 151, 141, 176, 202,
+ 208, 248, 80, 248, 223, 24, 151, 141, 176, 202, 208, 141, 229, 126, 24,
+ 151, 141, 176, 232, 133, 141, 201, 52, 24, 151, 141, 176, 232, 133, 141,
+ 248, 223, 24, 151, 141, 176, 102, 24, 151, 141, 176, 238, 173, 24, 151,
+ 141, 176, 238, 165, 176, 223, 117, 24, 230, 48, 141, 176, 238, 165, 176,
+ 223, 117, 24, 151, 141, 176, 238, 165, 176, 196, 104, 24, 151, 141, 176,
+ 243, 10, 24, 230, 46, 141, 198, 212, 24, 230, 46, 141, 176, 211, 76, 24,
+ 230, 39, 141, 176, 211, 76, 24, 230, 39, 141, 176, 220, 12, 24, 230, 39,
+ 141, 198, 212, 24, 230, 39, 141, 176, 202, 70, 24, 230, 52, 141, 176,
+ 211, 14, 24, 230, 52, 141, 176, 223, 162, 24, 230, 52, 141, 198, 212, 24,
+ 151, 198, 212, 24, 151, 176, 229, 212, 24, 151, 176, 202, 208, 237, 38,
+ 24, 151, 176, 202, 208, 239, 46, 24, 151, 176, 202, 208, 248, 223, 24,
+ 151, 176, 232, 132, 24, 151, 176, 248, 210, 141, 216, 84, 24, 151, 176,
+ 248, 210, 82, 206, 188, 24, 151, 176, 248, 210, 206, 189, 219, 82, 24,
+ 151, 176, 196, 105, 105, 232, 247, 24, 151, 176, 139, 105, 232, 247, 24,
+ 151, 176, 196, 105, 115, 232, 247, 24, 151, 176, 196, 105, 232, 128, 232,
+ 247, 24, 151, 176, 139, 232, 128, 207, 147, 221, 69, 24, 230, 42, 24,
+ 151, 229, 212, 24, 198, 37, 202, 169, 24, 198, 37, 215, 128, 24, 198, 37,
+ 248, 209, 24, 230, 215, 202, 169, 24, 230, 215, 215, 128, 24, 230, 215,
+ 248, 209, 24, 201, 33, 202, 169, 24, 201, 33, 215, 128, 24, 201, 33, 248,
+ 209, 24, 248, 18, 202, 169, 24, 248, 18, 215, 128, 24, 248, 18, 248, 209,
+ 24, 206, 60, 202, 169, 24, 206, 60, 215, 128, 24, 206, 60, 248, 209, 24,
+ 200, 171, 200, 76, 24, 200, 171, 248, 209, 24, 201, 186, 220, 13, 202,
+ 169, 24, 201, 186, 2, 202, 169, 24, 201, 186, 220, 13, 215, 128, 24, 201,
+ 186, 2, 215, 128, 24, 201, 186, 204, 6, 24, 232, 197, 220, 13, 202, 169,
+ 24, 232, 197, 2, 202, 169, 24, 232, 197, 220, 13, 215, 128, 24, 232, 197,
+ 2, 215, 128, 24, 232, 197, 204, 6, 24, 201, 186, 232, 197, 251, 154, 24,
+ 215, 172, 133, 144, 220, 12, 24, 215, 172, 133, 144, 202, 70, 24, 215,
+ 172, 133, 204, 6, 24, 215, 172, 144, 204, 6, 24, 215, 172, 133, 144, 251,
+ 155, 220, 12, 24, 215, 172, 133, 144, 251, 155, 202, 70, 24, 215, 172,
+ 202, 208, 119, 202, 208, 205, 84, 24, 215, 171, 232, 253, 239, 35, 24,
+ 215, 173, 232, 253, 239, 35, 24, 215, 171, 202, 170, 201, 53, 202, 70,
+ 24, 215, 171, 202, 170, 201, 53, 216, 212, 24, 215, 171, 202, 170, 201,
+ 53, 220, 12, 24, 215, 171, 202, 170, 201, 53, 220, 10, 24, 215, 171, 202,
+ 170, 193, 4, 232, 200, 24, 215, 171, 55, 201, 52, 24, 215, 171, 55, 193,
+ 4, 232, 200, 24, 215, 171, 55, 251, 154, 24, 215, 171, 55, 251, 155, 193,
+ 4, 232, 200, 24, 215, 171, 238, 217, 24, 215, 171, 197, 225, 201, 53,
+ 215, 175, 24, 215, 171, 197, 225, 193, 4, 232, 200, 24, 215, 171, 197,
+ 225, 251, 154, 24, 215, 171, 197, 225, 251, 155, 193, 4, 232, 200, 24,
+ 215, 171, 248, 228, 202, 70, 24, 215, 171, 248, 228, 216, 212, 24, 215,
+ 171, 248, 228, 220, 12, 24, 215, 171, 239, 2, 202, 70, 24, 215, 171, 239,
+ 2, 216, 212, 24, 215, 171, 239, 2, 220, 12, 24, 215, 171, 239, 2, 206,
+ 120, 24, 215, 171, 243, 126, 202, 70, 24, 215, 171, 243, 126, 216, 212,
+ 24, 215, 171, 243, 126, 220, 12, 24, 215, 171, 111, 202, 70, 24, 215,
+ 171, 111, 216, 212, 24, 215, 171, 111, 220, 12, 24, 215, 171, 191, 21,
+ 202, 70, 24, 215, 171, 191, 21, 216, 212, 24, 215, 171, 191, 21, 220, 12,
+ 24, 215, 171, 210, 57, 202, 70, 24, 215, 171, 210, 57, 216, 212, 24, 215,
+ 171, 210, 57, 220, 12, 24, 198, 3, 206, 118, 202, 169, 24, 198, 3, 206,
+ 118, 235, 133, 24, 198, 3, 206, 118, 251, 154, 24, 198, 3, 206, 119, 202,
+ 169, 24, 198, 3, 206, 119, 235, 133, 24, 198, 3, 206, 119, 251, 154, 24,
+ 198, 3, 203, 144, 24, 198, 3, 250, 251, 201, 218, 202, 169, 24, 198, 3,
+ 250, 251, 201, 218, 235, 133, 24, 198, 3, 250, 251, 201, 218, 197, 224,
+ 24, 215, 174, 250, 139, 202, 70, 24, 215, 174, 250, 139, 216, 212, 24,
+ 215, 174, 250, 139, 220, 12, 24, 215, 174, 250, 139, 220, 10, 24, 215,
+ 174, 198, 31, 202, 70, 24, 215, 174, 198, 31, 216, 212, 24, 215, 174,
+ 198, 31, 220, 12, 24, 215, 174, 198, 31, 220, 10, 24, 215, 174, 248, 210,
+ 250, 139, 202, 70, 24, 215, 174, 248, 210, 250, 139, 216, 212, 24, 215,
+ 174, 248, 210, 250, 139, 220, 12, 24, 215, 174, 248, 210, 250, 139, 220,
+ 10, 24, 215, 174, 248, 210, 198, 31, 202, 70, 24, 215, 174, 248, 210,
+ 198, 31, 216, 212, 24, 215, 174, 248, 210, 198, 31, 220, 12, 24, 215,
+ 174, 248, 210, 198, 31, 220, 10, 24, 215, 173, 202, 170, 201, 53, 202,
+ 70, 24, 215, 173, 202, 170, 201, 53, 216, 212, 24, 215, 173, 202, 170,
+ 201, 53, 220, 12, 24, 215, 173, 202, 170, 201, 53, 220, 10, 24, 215, 173,
+ 202, 170, 193, 4, 232, 200, 24, 215, 173, 55, 201, 52, 24, 215, 173, 55,
+ 193, 4, 232, 200, 24, 215, 173, 55, 251, 154, 24, 215, 173, 55, 251, 155,
+ 193, 4, 232, 200, 24, 215, 173, 238, 217, 24, 215, 173, 197, 225, 201,
+ 53, 215, 175, 24, 215, 173, 197, 225, 193, 4, 232, 200, 24, 215, 173,
+ 197, 225, 251, 155, 215, 175, 24, 215, 173, 197, 225, 251, 155, 193, 4,
+ 232, 200, 24, 215, 173, 248, 227, 24, 215, 173, 239, 2, 202, 70, 24, 215,
+ 173, 239, 2, 216, 212, 24, 215, 173, 239, 2, 220, 12, 24, 215, 173, 243,
+ 125, 24, 215, 173, 111, 202, 70, 24, 215, 173, 111, 216, 212, 24, 215,
+ 173, 111, 220, 12, 24, 215, 173, 191, 21, 202, 70, 24, 215, 173, 191, 21,
+ 216, 212, 24, 215, 173, 191, 21, 220, 12, 24, 215, 173, 210, 57, 202, 70,
+ 24, 215, 173, 210, 57, 216, 212, 24, 215, 173, 210, 57, 220, 12, 24, 198,
+ 4, 206, 119, 202, 169, 24, 198, 4, 206, 119, 235, 133, 24, 198, 4, 206,
+ 119, 251, 154, 24, 198, 4, 206, 118, 202, 169, 24, 198, 4, 206, 118, 235,
+ 133, 24, 198, 4, 206, 118, 251, 154, 24, 198, 4, 203, 144, 24, 215, 171,
+ 238, 165, 208, 23, 202, 70, 24, 215, 171, 238, 165, 208, 23, 216, 212,
+ 24, 215, 171, 238, 165, 208, 23, 220, 12, 24, 215, 171, 238, 165, 208,
+ 23, 220, 10, 24, 215, 171, 238, 165, 230, 67, 202, 70, 24, 215, 171, 238,
+ 165, 230, 67, 216, 212, 24, 215, 171, 238, 165, 230, 67, 220, 12, 24,
+ 215, 171, 238, 165, 230, 67, 220, 10, 24, 215, 171, 238, 165, 198, 218,
+ 243, 11, 202, 70, 24, 215, 171, 238, 165, 198, 218, 243, 11, 216, 212,
+ 24, 215, 171, 228, 143, 202, 70, 24, 215, 171, 228, 143, 216, 212, 24,
+ 215, 171, 228, 143, 220, 12, 24, 215, 171, 219, 5, 202, 70, 24, 215, 171,
+ 219, 5, 216, 212, 24, 215, 171, 219, 5, 220, 12, 24, 215, 171, 219, 5, 2,
+ 235, 133, 24, 215, 171, 193, 139, 238, 165, 55, 202, 70, 24, 215, 171,
+ 193, 139, 238, 165, 55, 216, 212, 24, 215, 171, 193, 139, 238, 165, 55,
+ 220, 12, 24, 215, 171, 193, 139, 238, 165, 197, 225, 202, 70, 24, 215,
+ 171, 193, 139, 238, 165, 197, 225, 216, 212, 24, 215, 171, 193, 139, 238,
+ 165, 197, 225, 220, 12, 24, 215, 171, 238, 165, 199, 25, 201, 52, 24,
+ 215, 171, 238, 163, 238, 218, 202, 70, 24, 215, 171, 238, 163, 238, 218,
+ 216, 212, 24, 206, 118, 202, 169, 24, 206, 118, 235, 133, 24, 206, 118,
+ 251, 156, 24, 215, 171, 203, 144, 24, 215, 171, 238, 165, 229, 116, 232,
+ 97, 193, 167, 24, 215, 171, 228, 143, 229, 116, 232, 97, 193, 167, 24,
+ 215, 171, 219, 5, 229, 116, 232, 97, 193, 167, 24, 215, 171, 193, 139,
+ 229, 116, 232, 97, 193, 167, 24, 206, 118, 202, 170, 229, 116, 232, 97,
+ 193, 167, 24, 206, 118, 55, 229, 116, 232, 97, 193, 167, 24, 206, 118,
+ 251, 155, 229, 116, 232, 97, 193, 167, 24, 215, 171, 238, 165, 229, 116,
+ 243, 104, 24, 215, 171, 228, 143, 229, 116, 243, 104, 24, 215, 171, 219,
+ 5, 229, 116, 243, 104, 24, 215, 171, 193, 139, 229, 116, 243, 104, 24,
+ 206, 118, 202, 170, 229, 116, 243, 104, 24, 206, 118, 55, 229, 116, 243,
+ 104, 24, 206, 118, 251, 155, 229, 116, 243, 104, 24, 215, 171, 193, 139,
+ 237, 39, 210, 86, 202, 70, 24, 215, 171, 193, 139, 237, 39, 210, 86, 216,
+ 212, 24, 215, 171, 193, 139, 237, 39, 210, 86, 220, 12, 24, 215, 173,
+ 238, 165, 229, 116, 247, 31, 202, 70, 24, 215, 173, 238, 165, 229, 116,
+ 247, 31, 220, 12, 24, 215, 173, 228, 143, 229, 116, 247, 31, 2, 235, 133,
+ 24, 215, 173, 228, 143, 229, 116, 247, 31, 220, 13, 235, 133, 24, 215,
+ 173, 228, 143, 229, 116, 247, 31, 2, 197, 224, 24, 215, 173, 228, 143,
+ 229, 116, 247, 31, 220, 13, 197, 224, 24, 215, 173, 219, 5, 229, 116,
+ 247, 31, 2, 202, 169, 24, 215, 173, 219, 5, 229, 116, 247, 31, 220, 13,
+ 202, 169, 24, 215, 173, 219, 5, 229, 116, 247, 31, 2, 235, 133, 24, 215,
+ 173, 219, 5, 229, 116, 247, 31, 220, 13, 235, 133, 24, 215, 173, 193,
+ 139, 229, 116, 247, 31, 202, 70, 24, 215, 173, 193, 139, 229, 116, 247,
+ 31, 220, 12, 24, 206, 119, 202, 170, 229, 116, 247, 30, 24, 206, 119, 55,
+ 229, 116, 247, 30, 24, 206, 119, 251, 155, 229, 116, 247, 30, 24, 215,
+ 173, 238, 165, 229, 116, 232, 194, 202, 70, 24, 215, 173, 238, 165, 229,
+ 116, 232, 194, 220, 12, 24, 215, 173, 228, 143, 229, 116, 232, 194, 2,
+ 235, 133, 24, 215, 173, 228, 143, 229, 116, 232, 194, 220, 13, 235, 133,
+ 24, 215, 173, 228, 143, 229, 116, 232, 194, 197, 225, 2, 197, 224, 24,
+ 215, 173, 228, 143, 229, 116, 232, 194, 197, 225, 220, 13, 197, 224, 24,
+ 215, 173, 219, 5, 229, 116, 232, 194, 2, 202, 169, 24, 215, 173, 219, 5,
+ 229, 116, 232, 194, 220, 13, 202, 169, 24, 215, 173, 219, 5, 229, 116,
+ 232, 194, 2, 235, 133, 24, 215, 173, 219, 5, 229, 116, 232, 194, 220, 13,
+ 235, 133, 24, 215, 173, 193, 139, 229, 116, 232, 194, 202, 70, 24, 215,
+ 173, 193, 139, 229, 116, 232, 194, 220, 12, 24, 206, 119, 202, 170, 229,
+ 116, 232, 193, 24, 206, 119, 55, 229, 116, 232, 193, 24, 206, 119, 251,
+ 155, 229, 116, 232, 193, 24, 215, 173, 238, 165, 202, 70, 24, 215, 173,
+ 238, 165, 216, 212, 24, 215, 173, 238, 165, 220, 12, 24, 215, 173, 238,
+ 165, 220, 10, 24, 215, 173, 238, 165, 242, 78, 24, 215, 173, 228, 143,
+ 202, 70, 24, 215, 173, 219, 5, 202, 70, 24, 215, 173, 193, 139, 202, 58,
+ 24, 215, 173, 193, 139, 202, 70, 24, 215, 173, 193, 139, 220, 12, 24,
+ 206, 119, 202, 169, 24, 206, 119, 235, 133, 24, 206, 119, 251, 154, 24,
+ 215, 173, 203, 145, 210, 118, 24, 215, 171, 250, 251, 243, 11, 2, 202,
+ 169, 24, 215, 171, 250, 251, 243, 11, 216, 213, 202, 169, 24, 215, 171,
+ 250, 251, 243, 11, 2, 235, 133, 24, 215, 171, 250, 251, 243, 11, 216,
+ 213, 235, 133, 24, 215, 173, 250, 251, 243, 11, 229, 116, 193, 168, 2,
+ 202, 169, 24, 215, 173, 250, 251, 243, 11, 229, 116, 193, 168, 216, 213,
+ 202, 169, 24, 215, 173, 250, 251, 243, 11, 229, 116, 193, 168, 220, 13,
+ 202, 169, 24, 215, 173, 250, 251, 243, 11, 229, 116, 193, 168, 2, 235,
+ 133, 24, 215, 173, 250, 251, 243, 11, 229, 116, 193, 168, 216, 213, 235,
+ 133, 24, 215, 173, 250, 251, 243, 11, 229, 116, 193, 168, 220, 13, 235,
+ 133, 24, 215, 171, 193, 4, 243, 11, 232, 97, 202, 169, 24, 215, 171, 193,
+ 4, 243, 11, 232, 97, 235, 133, 24, 215, 173, 193, 4, 243, 11, 229, 116,
+ 193, 168, 202, 169, 24, 215, 173, 193, 4, 243, 11, 229, 116, 193, 168,
+ 235, 133, 24, 215, 171, 232, 253, 243, 8, 202, 169, 24, 215, 171, 232,
+ 253, 243, 8, 235, 133, 24, 215, 173, 232, 253, 243, 8, 229, 116, 193,
+ 168, 202, 169, 24, 215, 173, 232, 253, 243, 8, 229, 116, 193, 168, 235,
+ 133, 24, 235, 40, 250, 236, 202, 70, 24, 235, 40, 250, 236, 220, 12, 24,
+ 235, 40, 233, 73, 24, 235, 40, 202, 75, 24, 235, 40, 199, 88, 24, 235,
+ 40, 207, 63, 24, 235, 40, 202, 176, 24, 235, 40, 202, 177, 251, 154, 24,
+ 235, 40, 233, 225, 211, 27, 198, 146, 24, 235, 40, 230, 226, 24, 229,
+ 235, 24, 229, 236, 206, 193, 24, 229, 236, 215, 171, 201, 52, 24, 229,
+ 236, 215, 171, 198, 149, 24, 229, 236, 215, 173, 201, 52, 24, 229, 236,
+ 215, 171, 238, 164, 24, 229, 236, 215, 173, 238, 164, 24, 229, 236, 215,
+ 176, 243, 10, 24, 233, 104, 236, 233, 209, 25, 213, 14, 232, 133, 198,
+ 147, 24, 233, 104, 236, 233, 209, 25, 213, 14, 133, 211, 57, 235, 123,
+ 24, 233, 104, 236, 233, 209, 25, 213, 14, 133, 211, 57, 144, 198, 147,
+ 24, 233, 191, 201, 53, 196, 77, 24, 233, 191, 201, 53, 214, 81, 24, 233,
+ 191, 201, 53, 235, 123, 24, 235, 107, 233, 191, 214, 82, 235, 123, 24,
+ 235, 107, 233, 191, 144, 214, 81, 24, 235, 107, 233, 191, 133, 214, 81,
+ 24, 235, 107, 233, 191, 214, 82, 196, 77, 24, 232, 151, 214, 81, 24, 232,
+ 151, 239, 35, 24, 232, 151, 193, 7, 24, 233, 186, 211, 76, 24, 233, 186,
+ 201, 185, 24, 233, 186, 242, 218, 24, 233, 194, 248, 130, 202, 169, 24,
+ 233, 194, 248, 130, 215, 128, 24, 233, 186, 132, 211, 76, 24, 233, 186,
+ 193, 78, 211, 76, 24, 233, 186, 132, 242, 218, 24, 233, 186, 193, 76,
+ 215, 175, 24, 233, 194, 193, 58, 24, 233, 187, 196, 77, 24, 233, 187,
+ 235, 123, 24, 233, 187, 232, 180, 24, 233, 189, 201, 52, 24, 233, 189,
+ 201, 53, 235, 133, 24, 233, 189, 201, 53, 251, 154, 24, 233, 190, 201,
+ 52, 24, 233, 190, 201, 53, 235, 133, 24, 233, 190, 201, 53, 251, 154, 24,
+ 233, 189, 238, 162, 24, 233, 190, 238, 162, 24, 233, 189, 243, 5, 24,
+ 243, 121, 208, 155, 24, 243, 121, 214, 81, 24, 243, 121, 200, 218, 24,
+ 199, 89, 243, 121, 229, 135, 24, 199, 89, 243, 121, 216, 84, 24, 199, 89,
+ 243, 121, 218, 241, 24, 234, 209, 24, 213, 14, 214, 81, 24, 213, 14, 239,
+ 35, 24, 213, 14, 193, 5, 24, 213, 14, 193, 73, 24, 251, 226, 248, 116,
+ 211, 14, 24, 251, 226, 200, 217, 223, 162, 24, 251, 226, 248, 118, 2,
+ 206, 117, 24, 251, 226, 200, 219, 2, 206, 117, 24, 248, 39, 223, 134, 24,
+ 248, 39, 233, 214, 24, 215, 180, 242, 219, 214, 81, 24, 215, 180, 242,
+ 219, 232, 132, 24, 215, 180, 242, 219, 239, 35, 24, 215, 180, 202, 65,
+ 24, 215, 180, 202, 66, 193, 7, 24, 215, 180, 202, 66, 211, 76, 24, 215,
+ 180, 232, 93, 24, 215, 180, 232, 94, 193, 7, 24, 215, 180, 232, 94, 211,
+ 76, 24, 215, 180, 211, 77, 243, 10, 24, 215, 180, 211, 77, 232, 132, 24,
+ 215, 180, 211, 77, 193, 7, 24, 215, 180, 211, 77, 211, 7, 24, 215, 180,
+ 211, 77, 211, 8, 193, 7, 24, 215, 180, 211, 77, 211, 8, 192, 88, 24, 215,
+ 180, 211, 77, 207, 92, 24, 215, 180, 211, 77, 207, 93, 193, 7, 24, 215,
+ 180, 211, 77, 207, 93, 192, 88, 24, 215, 180, 221, 122, 24, 215, 180,
+ 221, 123, 232, 132, 24, 215, 180, 221, 123, 193, 7, 24, 215, 180, 199,
+ 88, 24, 215, 180, 199, 89, 232, 132, 24, 215, 180, 199, 89, 200, 218, 24,
+ 219, 97, 208, 219, 198, 87, 24, 219, 99, 110, 139, 196, 74, 24, 219, 99,
+ 116, 139, 218, 236, 24, 215, 180, 239, 0, 24, 215, 180, 193, 6, 202, 169,
+ 24, 215, 180, 193, 6, 235, 133, 24, 198, 62, 201, 74, 211, 15, 233, 75,
+ 24, 198, 62, 219, 142, 219, 96, 24, 198, 62, 198, 136, 248, 210, 219, 96,
+ 24, 198, 62, 198, 136, 198, 35, 223, 118, 215, 179, 24, 198, 62, 223,
+ 118, 215, 180, 207, 63, 24, 198, 62, 215, 170, 251, 251, 243, 122, 24,
+ 198, 62, 247, 22, 201, 74, 211, 14, 24, 198, 62, 247, 22, 223, 118, 215,
+ 179, 24, 199, 117, 24, 199, 118, 215, 175, 24, 199, 118, 211, 105, 198,
+ 61, 24, 199, 118, 211, 105, 198, 62, 215, 175, 24, 199, 118, 211, 105,
+ 219, 96, 24, 199, 118, 211, 105, 219, 97, 215, 175, 24, 199, 118, 248,
+ 146, 219, 96, 24, 215, 171, 223, 14, 24, 215, 173, 223, 14, 24, 214, 112,
+ 24, 230, 78, 24, 233, 217, 24, 203, 22, 229, 123, 201, 219, 24, 203, 22,
+ 229, 123, 209, 23, 24, 193, 165, 203, 22, 229, 123, 215, 178, 24, 232,
+ 192, 203, 22, 229, 123, 215, 178, 24, 203, 22, 198, 148, 232, 98, 193,
+ 172, 24, 198, 43, 201, 53, 201, 37, 24, 198, 43, 238, 163, 248, 227, 24,
+ 198, 44, 197, 16, 24, 116, 248, 105, 198, 148, 232, 98, 229, 123, 222,
+ 195, 24, 219, 124, 242, 79, 24, 219, 124, 219, 197, 24, 219, 124, 219,
+ 196, 24, 219, 124, 219, 195, 24, 219, 124, 219, 194, 24, 219, 124, 219,
+ 193, 24, 219, 124, 219, 192, 24, 219, 124, 219, 191, 24, 232, 252, 24,
+ 219, 37, 201, 247, 24, 219, 38, 201, 247, 24, 219, 40, 229, 208, 24, 219,
+ 40, 193, 74, 24, 219, 40, 237, 92, 24, 219, 40, 229, 236, 214, 112, 24,
+ 219, 40, 198, 45, 24, 219, 40, 219, 123, 237, 9, 24, 242, 74, 24, 232,
+ 80, 201, 63, 24, 204, 25, 24, 242, 83, 24, 210, 113, 24, 233, 6, 215,
+ 244, 24, 233, 6, 215, 243, 24, 233, 6, 215, 242, 24, 233, 6, 215, 241,
+ 24, 233, 6, 215, 240, 24, 206, 121, 215, 244, 24, 206, 121, 215, 243, 24,
+ 206, 121, 215, 242, 24, 206, 121, 215, 241, 24, 206, 121, 215, 240, 24,
+ 206, 121, 215, 239, 24, 206, 121, 215, 238, 24, 206, 121, 215, 237, 24,
+ 206, 121, 215, 251, 24, 206, 121, 215, 250, 24, 206, 121, 215, 249, 24,
+ 206, 121, 215, 248, 24, 206, 121, 215, 247, 24, 206, 121, 215, 246, 24,
+ 206, 121, 215, 245, 8, 2, 1, 233, 37, 237, 3, 4, 197, 228, 8, 2, 1, 207,
+ 18, 27, 232, 51, 8, 1, 2, 6, 153, 232, 51, 8, 2, 1, 207, 18, 222, 152, 8,
+ 1, 2, 6, 220, 143, 4, 248, 231, 8, 2, 1, 219, 163, 4, 207, 24, 102, 8, 2,
+ 1, 153, 192, 160, 4, 248, 231, 8, 2, 1, 207, 18, 234, 88, 8, 2, 1, 153,
+ 207, 222, 4, 179, 219, 213, 23, 207, 24, 102, 8, 2, 1, 200, 44, 4, 228,
+ 251, 23, 207, 24, 102, 8, 1, 207, 24, 242, 232, 4, 207, 24, 102, 8, 2, 1,
+ 234, 13, 4, 55, 164, 8, 2, 1, 234, 13, 4, 55, 249, 88, 23, 238, 175, 8,
+ 2, 1, 153, 200, 44, 4, 238, 175, 8, 1, 223, 93, 231, 11, 201, 64, 4, 238,
+ 175, 8, 1, 201, 36, 247, 194, 4, 238, 175, 8, 1, 2, 6, 153, 222, 152, 8,
+ 2, 1, 220, 143, 4, 232, 233, 8, 2, 1, 237, 70, 237, 3, 4, 210, 192, 102,
+ 8, 2, 1, 220, 143, 4, 248, 232, 23, 210, 192, 102, 8, 2, 1, 234, 89, 4,
+ 210, 192, 102, 8, 2, 1, 153, 207, 222, 4, 210, 192, 102, 8, 2, 1, 207,
+ 222, 4, 232, 234, 23, 210, 192, 102, 8, 2, 1, 199, 79, 237, 3, 4, 210,
+ 192, 102, 8, 2, 1, 233, 179, 4, 210, 192, 102, 8, 2, 1, 237, 70, 237, 3,
+ 4, 207, 24, 102, 8, 2, 1, 228, 74, 4, 201, 28, 23, 207, 24, 102, 8, 2, 1,
+ 187, 4, 207, 24, 102, 8, 2, 1, 199, 79, 237, 3, 4, 207, 24, 102, 8, 2, 1,
+ 247, 194, 4, 207, 24, 102, 8, 2, 1, 206, 9, 4, 238, 175, 8, 2, 1, 238,
+ 128, 4, 216, 86, 45, 102, 8, 2, 1, 220, 143, 4, 216, 86, 45, 102, 8, 2,
+ 1, 215, 62, 4, 216, 86, 45, 102, 8, 2, 1, 207, 222, 4, 216, 86, 45, 102,
+ 8, 2, 1, 206, 9, 4, 216, 86, 45, 102, 8, 2, 1, 200, 44, 4, 216, 86, 45,
+ 102, 33, 135, 1, 250, 122, 33, 135, 1, 247, 252, 33, 135, 1, 195, 151,
+ 33, 135, 1, 231, 18, 33, 135, 1, 236, 169, 33, 135, 1, 192, 49, 33, 135,
+ 1, 191, 55, 33, 135, 1, 191, 82, 33, 135, 1, 223, 39, 33, 135, 1, 89,
+ 223, 39, 33, 135, 1, 68, 33, 135, 1, 236, 190, 33, 135, 1, 222, 94, 33,
+ 135, 1, 219, 75, 33, 135, 1, 215, 66, 33, 135, 1, 214, 210, 33, 135, 1,
+ 211, 89, 33, 135, 1, 209, 55, 33, 135, 1, 206, 179, 33, 135, 1, 202, 77,
+ 33, 135, 1, 197, 44, 33, 135, 1, 196, 124, 33, 135, 1, 232, 101, 33, 135,
+ 1, 229, 188, 33, 135, 1, 203, 8, 33, 135, 1, 197, 146, 33, 135, 1, 243,
+ 54, 33, 135, 1, 203, 165, 33, 135, 1, 192, 58, 33, 135, 1, 192, 60, 33,
+ 135, 1, 192, 93, 33, 135, 1, 191, 225, 33, 135, 1, 2, 191, 190, 33, 135,
+ 1, 192, 12, 33, 135, 1, 223, 82, 2, 191, 190, 33, 135, 1, 248, 175, 191,
+ 190, 33, 135, 1, 223, 82, 248, 175, 191, 190, 33, 135, 1, 232, 228, 52,
+ 1, 38, 2, 65, 52, 1, 38, 2, 249, 17, 52, 1, 38, 2, 195, 153, 52, 1, 38,
+ 2, 231, 77, 52, 1, 38, 2, 237, 146, 52, 1, 38, 2, 223, 226, 52, 1, 38, 2,
+ 191, 62, 52, 1, 38, 2, 191, 87, 52, 1, 38, 2, 68, 52, 1, 38, 2, 155, 52,
+ 1, 38, 2, 234, 140, 52, 1, 38, 2, 234, 114, 52, 1, 38, 2, 74, 52, 1, 38,
+ 2, 210, 63, 52, 1, 38, 2, 234, 34, 52, 1, 38, 2, 234, 22, 52, 1, 38, 2,
+ 199, 145, 52, 1, 38, 2, 66, 52, 1, 38, 2, 234, 181, 52, 1, 38, 2, 140,
+ 52, 1, 38, 2, 197, 161, 52, 1, 38, 2, 243, 127, 52, 1, 38, 2, 203, 165,
+ 52, 1, 38, 2, 192, 58, 52, 1, 38, 2, 71, 52, 1, 38, 2, 191, 225, 52, 1,
+ 38, 2, 235, 17, 52, 1, 38, 2, 205, 86, 52, 1, 38, 2, 247, 203, 68, 52, 1,
+ 38, 2, 223, 10, 52, 1, 38, 2, 249, 82, 74, 52, 1, 38, 2, 201, 53, 66, 52,
+ 1, 38, 2, 210, 179, 38, 200, 230, 2, 1, 65, 38, 200, 230, 2, 1, 249, 17,
+ 38, 200, 230, 2, 1, 195, 153, 38, 200, 230, 2, 1, 231, 77, 38, 200, 230,
+ 2, 1, 237, 146, 38, 200, 230, 2, 1, 223, 226, 38, 200, 230, 2, 1, 191,
+ 62, 38, 200, 230, 2, 1, 191, 87, 38, 200, 230, 2, 1, 68, 38, 200, 230, 2,
+ 1, 155, 38, 200, 230, 2, 1, 234, 140, 38, 200, 230, 2, 1, 74, 38, 200,
+ 230, 2, 1, 210, 63, 38, 200, 230, 2, 1, 234, 22, 38, 200, 230, 2, 1, 66,
+ 38, 200, 230, 2, 1, 234, 181, 38, 200, 230, 2, 1, 140, 38, 200, 230, 2,
+ 1, 197, 161, 38, 200, 230, 2, 1, 243, 127, 38, 200, 230, 2, 1, 203, 165,
+ 38, 200, 230, 2, 1, 230, 17, 56, 38, 200, 230, 2, 1, 192, 58, 38, 200,
+ 230, 2, 1, 231, 78, 4, 196, 69, 38, 200, 230, 2, 1, 247, 203, 68, 38,
+ 200, 230, 2, 1, 235, 32, 38, 200, 230, 2, 1, 235, 28, 52, 1, 38, 2, 234,
+ 23, 4, 237, 87, 52, 1, 38, 2, 192, 59, 4, 249, 147, 192, 62, 52, 1, 38,
+ 2, 201, 53, 126, 4, 106, 33, 38, 2, 1, 247, 203, 68, 212, 80, 208, 162,
+ 90, 1, 174, 212, 80, 208, 162, 90, 1, 197, 168, 212, 80, 208, 162, 90, 1,
+ 212, 199, 212, 80, 208, 162, 90, 1, 190, 190, 212, 80, 208, 162, 90, 1,
+ 140, 212, 80, 208, 162, 90, 1, 180, 212, 80, 208, 162, 90, 1, 192, 220,
+ 212, 80, 208, 162, 90, 1, 213, 111, 212, 80, 208, 162, 90, 1, 247, 160,
+ 212, 80, 208, 162, 90, 1, 173, 212, 80, 208, 162, 90, 1, 188, 212, 80,
+ 208, 162, 90, 1, 191, 123, 212, 80, 208, 162, 90, 1, 214, 166, 212, 80,
+ 208, 162, 90, 1, 212, 186, 212, 80, 208, 162, 90, 1, 155, 212, 80, 208,
+ 162, 90, 1, 238, 32, 212, 80, 208, 162, 90, 1, 212, 101, 212, 80, 208,
+ 162, 90, 1, 212, 244, 212, 80, 208, 162, 90, 1, 195, 188, 212, 80, 208,
+ 162, 90, 1, 212, 180, 212, 80, 208, 162, 90, 1, 197, 8, 212, 80, 208,
+ 162, 90, 1, 233, 109, 212, 80, 208, 162, 90, 1, 165, 212, 80, 208, 162,
+ 90, 1, 208, 96, 212, 80, 208, 162, 90, 1, 170, 212, 80, 208, 162, 90, 1,
+ 212, 246, 212, 80, 208, 162, 90, 1, 168, 212, 80, 208, 162, 90, 1, 192,
+ 175, 212, 80, 208, 162, 90, 1, 212, 248, 212, 80, 208, 162, 90, 1, 236,
+ 186, 212, 80, 208, 162, 90, 1, 212, 247, 212, 80, 208, 162, 90, 1, 230,
+ 81, 212, 80, 208, 162, 90, 1, 216, 19, 212, 80, 208, 162, 90, 1, 209,
+ 110, 212, 80, 208, 162, 90, 1, 231, 240, 212, 80, 208, 162, 90, 1, 206,
+ 109, 212, 80, 208, 162, 90, 1, 65, 212, 80, 208, 162, 90, 1, 252, 206,
+ 212, 80, 208, 162, 90, 1, 68, 212, 80, 208, 162, 90, 1, 66, 212, 80, 208,
+ 162, 90, 1, 74, 212, 80, 208, 162, 90, 1, 211, 87, 212, 80, 208, 162, 90,
+ 1, 71, 212, 80, 208, 162, 90, 1, 234, 188, 212, 80, 208, 162, 90, 1, 193,
+ 224, 212, 80, 208, 162, 90, 198, 70, 212, 80, 208, 162, 90, 198, 66, 212,
+ 80, 208, 162, 90, 198, 67, 212, 80, 208, 162, 90, 198, 64, 212, 80, 208,
+ 162, 90, 198, 65, 212, 80, 208, 162, 90, 198, 68, 212, 80, 208, 162, 90,
+ 198, 69, 212, 80, 208, 162, 90, 3, 40, 209, 250, 212, 80, 208, 162, 90,
+ 3, 40, 199, 3, 212, 80, 208, 162, 90, 3, 40, 219, 39, 212, 80, 208, 162,
+ 90, 3, 40, 251, 101, 212, 80, 208, 162, 90, 3, 40, 223, 94, 212, 80, 208,
+ 162, 90, 3, 192, 183, 192, 182, 212, 80, 208, 162, 90, 5, 219, 190, 212,
+ 80, 208, 162, 90, 17, 191, 77, 212, 80, 208, 162, 90, 17, 107, 212, 80,
+ 208, 162, 90, 17, 109, 212, 80, 208, 162, 90, 17, 138, 212, 80, 208, 162,
+ 90, 17, 134, 212, 80, 208, 162, 90, 17, 149, 212, 80, 208, 162, 90, 17,
+ 169, 212, 80, 208, 162, 90, 17, 175, 212, 80, 208, 162, 90, 17, 171, 212,
+ 80, 208, 162, 90, 17, 178, 212, 80, 208, 162, 90, 219, 28, 212, 96, 212,
+ 80, 208, 162, 90, 47, 247, 160, 198, 38, 1, 168, 198, 38, 1, 249, 153,
+ 198, 38, 1, 190, 190, 198, 38, 1, 238, 32, 198, 38, 1, 155, 198, 38, 1,
+ 231, 240, 198, 38, 1, 174, 198, 38, 1, 180, 198, 38, 1, 214, 68, 198, 38,
+ 1, 188, 198, 38, 1, 247, 1, 198, 38, 1, 170, 198, 38, 1, 193, 190, 198,
+ 38, 1, 223, 32, 198, 38, 1, 140, 198, 38, 1, 165, 198, 38, 1, 173, 198,
+ 38, 1, 68, 198, 38, 1, 248, 38, 68, 198, 38, 1, 223, 49, 198, 38, 1, 248,
+ 38, 223, 49, 198, 38, 1, 66, 198, 38, 1, 71, 198, 38, 1, 248, 38, 71,
+ 198, 38, 1, 234, 65, 198, 38, 1, 248, 38, 234, 65, 198, 38, 1, 74, 198,
+ 38, 1, 252, 25, 198, 38, 1, 248, 38, 252, 25, 198, 38, 1, 65, 198, 38, 3,
+ 206, 180, 198, 79, 193, 163, 1, 252, 206, 193, 163, 1, 65, 193, 163, 1,
+ 249, 153, 193, 163, 1, 247, 160, 193, 163, 1, 238, 32, 193, 163, 1, 231,
+ 240, 193, 163, 1, 170, 193, 163, 1, 209, 228, 193, 163, 1, 173, 193, 163,
+ 1, 180, 193, 163, 1, 168, 193, 163, 1, 190, 190, 193, 163, 1, 199, 49,
+ 193, 163, 1, 233, 109, 193, 163, 1, 188, 193, 163, 1, 203, 165, 193, 163,
+ 1, 223, 32, 193, 163, 1, 191, 123, 193, 163, 1, 193, 190, 193, 163, 1,
+ 195, 188, 193, 163, 1, 155, 193, 163, 1, 74, 193, 163, 1, 250, 163, 193,
+ 163, 1, 165, 193, 163, 1, 174, 193, 163, 1, 221, 215, 193, 163, 1, 140,
+ 193, 163, 1, 71, 193, 163, 1, 68, 193, 163, 1, 214, 68, 193, 163, 1, 66,
+ 193, 163, 1, 219, 66, 193, 163, 1, 197, 168, 193, 163, 1, 198, 26, 193,
+ 163, 1, 211, 94, 193, 163, 1, 252, 165, 193, 163, 1, 251, 122, 193, 163,
+ 1, 223, 136, 193, 163, 1, 211, 104, 193, 163, 1, 234, 103, 193, 163, 1,
+ 252, 166, 193, 163, 1, 212, 101, 193, 163, 1, 196, 147, 193, 163, 1, 192,
+ 24, 193, 163, 163, 197, 67, 193, 163, 163, 197, 66, 193, 163, 163, 221,
+ 54, 193, 163, 163, 221, 53, 193, 163, 17, 191, 77, 193, 163, 17, 107,
+ 193, 163, 17, 109, 193, 163, 17, 138, 193, 163, 17, 134, 193, 163, 17,
+ 149, 193, 163, 17, 169, 193, 163, 17, 175, 193, 163, 17, 171, 193, 163,
+ 17, 178, 193, 163, 213, 232, 56, 214, 243, 215, 120, 1, 74, 214, 243,
+ 215, 120, 1, 211, 78, 214, 243, 215, 120, 1, 211, 120, 214, 243, 215,
+ 120, 1, 210, 242, 214, 243, 215, 120, 1, 211, 94, 214, 243, 215, 120, 1,
+ 65, 214, 243, 215, 120, 1, 251, 218, 214, 243, 215, 120, 1, 252, 155,
+ 214, 243, 215, 120, 1, 251, 69, 214, 243, 215, 120, 1, 251, 245, 214,
+ 243, 215, 120, 1, 68, 214, 243, 215, 120, 1, 223, 68, 214, 243, 215, 120,
+ 1, 228, 18, 214, 243, 215, 120, 1, 223, 53, 214, 243, 215, 120, 1, 223,
+ 200, 214, 243, 215, 120, 1, 66, 214, 243, 215, 120, 1, 196, 160, 214,
+ 243, 215, 120, 1, 196, 158, 214, 243, 215, 120, 1, 196, 128, 214, 243,
+ 215, 120, 1, 196, 62, 214, 243, 215, 120, 1, 71, 214, 243, 215, 120, 1,
+ 234, 85, 214, 243, 215, 120, 1, 234, 180, 214, 243, 215, 120, 1, 234,
+ 114, 214, 243, 215, 120, 1, 234, 103, 214, 243, 215, 120, 1, 233, 245,
+ 214, 243, 215, 120, 1, 234, 122, 214, 243, 215, 120, 3, 211, 127, 214,
+ 243, 215, 120, 3, 215, 138, 214, 243, 215, 120, 3, 198, 28, 214, 243,
+ 215, 120, 3, 223, 193, 214, 243, 215, 120, 3, 200, 161, 214, 243, 215,
+ 120, 17, 191, 77, 214, 243, 215, 120, 17, 107, 214, 243, 215, 120, 17,
+ 109, 214, 243, 215, 120, 17, 138, 214, 243, 215, 120, 17, 134, 214, 243,
+ 215, 120, 17, 149, 214, 243, 215, 120, 17, 169, 214, 243, 215, 120, 17,
+ 175, 214, 243, 215, 120, 17, 171, 214, 243, 215, 120, 17, 178, 36, 5,
+ 229, 166, 36, 5, 229, 160, 36, 5, 229, 162, 36, 5, 229, 165, 36, 5, 229,
+ 163, 36, 5, 229, 164, 36, 5, 229, 161, 36, 5, 230, 147, 229, 170, 36, 5,
+ 229, 167, 36, 5, 229, 168, 36, 5, 229, 169, 36, 5, 230, 147, 215, 76, 36,
+ 5, 230, 147, 215, 77, 36, 5, 230, 147, 207, 236, 36, 5, 230, 147, 207,
+ 237, 36, 5, 230, 147, 207, 238, 36, 5, 230, 147, 247, 207, 36, 5, 230,
+ 147, 247, 208, 36, 5, 230, 147, 220, 172, 36, 5, 230, 147, 220, 173, 36,
+ 5, 230, 147, 220, 174, 36, 5, 230, 147, 230, 131, 36, 5, 230, 147, 230,
+ 132, 36, 5, 230, 147, 230, 133, 36, 5, 230, 147, 232, 58, 36, 5, 230,
+ 147, 232, 59, 36, 5, 230, 147, 208, 118, 36, 5, 230, 147, 208, 119, 85,
+ 84, 5, 218, 167, 221, 166, 85, 84, 5, 218, 163, 155, 85, 84, 5, 218, 161,
+ 220, 232, 85, 84, 5, 218, 37, 222, 13, 85, 84, 5, 218, 7, 222, 22, 85,
+ 84, 5, 218, 26, 221, 41, 85, 84, 5, 218, 54, 221, 67, 85, 84, 5, 217,
+ 179, 220, 219, 85, 84, 5, 218, 158, 193, 86, 85, 84, 5, 218, 156, 193,
+ 190, 85, 84, 5, 218, 154, 193, 0, 85, 84, 5, 217, 232, 193, 114, 85, 84,
+ 5, 217, 240, 193, 125, 85, 84, 5, 217, 244, 193, 29, 85, 84, 5, 218, 57,
+ 193, 48, 85, 84, 5, 217, 164, 192, 252, 85, 84, 5, 217, 215, 193, 112,
+ 85, 84, 5, 218, 41, 192, 240, 85, 84, 5, 218, 53, 192, 242, 85, 84, 5,
+ 217, 219, 192, 241, 85, 84, 5, 218, 152, 216, 44, 85, 84, 5, 218, 150,
+ 217, 90, 85, 84, 5, 218, 148, 215, 122, 85, 84, 5, 218, 43, 216, 186, 85,
+ 84, 5, 218, 8, 215, 231, 85, 84, 5, 217, 204, 215, 148, 85, 84, 5, 217,
+ 169, 215, 142, 85, 84, 5, 218, 146, 248, 188, 85, 84, 5, 218, 143, 249,
+ 153, 85, 84, 5, 218, 141, 248, 10, 85, 84, 5, 217, 208, 249, 1, 85, 84,
+ 5, 218, 5, 249, 17, 85, 84, 5, 217, 255, 248, 97, 85, 84, 5, 217, 220,
+ 248, 111, 85, 84, 5, 218, 131, 68, 85, 84, 5, 218, 129, 65, 85, 84, 5,
+ 218, 127, 66, 85, 84, 5, 217, 195, 234, 188, 85, 84, 5, 218, 2, 71, 85,
+ 84, 5, 217, 193, 211, 87, 85, 84, 5, 217, 211, 74, 85, 84, 5, 217, 221,
+ 234, 166, 85, 84, 5, 217, 227, 223, 162, 85, 84, 5, 217, 223, 223, 162,
+ 85, 84, 5, 217, 163, 251, 132, 85, 84, 5, 217, 180, 234, 103, 85, 84, 5,
+ 218, 116, 202, 222, 85, 84, 5, 218, 114, 188, 85, 84, 5, 218, 112, 201,
+ 4, 85, 84, 5, 217, 196, 205, 50, 85, 84, 5, 217, 242, 205, 68, 85, 84, 5,
+ 217, 222, 202, 16, 85, 84, 5, 218, 23, 202, 46, 85, 84, 5, 217, 162, 202,
+ 215, 85, 84, 5, 218, 102, 219, 146, 85, 84, 5, 218, 100, 173, 85, 84, 5,
+ 218, 98, 218, 225, 85, 84, 5, 218, 18, 219, 228, 85, 84, 5, 218, 29, 219,
+ 238, 85, 84, 5, 218, 48, 219, 8, 85, 84, 5, 217, 205, 219, 43, 85, 84, 5,
+ 217, 248, 179, 219, 238, 85, 84, 5, 218, 124, 237, 44, 85, 84, 5, 218,
+ 121, 238, 32, 85, 84, 5, 218, 118, 235, 89, 85, 84, 5, 218, 13, 237, 131,
+ 85, 84, 5, 217, 178, 236, 146, 85, 84, 5, 217, 177, 236, 174, 85, 84, 5,
+ 218, 110, 198, 193, 85, 84, 5, 218, 107, 190, 190, 85, 84, 5, 218, 105,
+ 197, 94, 85, 84, 5, 218, 11, 199, 121, 85, 84, 5, 218, 47, 199, 145, 85,
+ 84, 5, 217, 254, 198, 59, 85, 84, 5, 218, 33, 159, 85, 84, 5, 218, 96,
+ 222, 244, 85, 84, 5, 218, 93, 223, 32, 85, 84, 5, 218, 91, 222, 182, 85,
+ 84, 5, 217, 201, 223, 8, 85, 84, 5, 217, 245, 223, 10, 85, 84, 5, 217,
+ 198, 222, 191, 85, 84, 5, 218, 39, 222, 201, 85, 84, 5, 217, 183, 179,
+ 222, 201, 85, 84, 5, 218, 89, 192, 33, 85, 84, 5, 218, 86, 170, 85, 84,
+ 5, 218, 84, 191, 225, 85, 84, 5, 217, 249, 192, 77, 85, 84, 5, 218, 22,
+ 192, 80, 85, 84, 5, 217, 217, 191, 246, 85, 84, 5, 217, 237, 192, 12, 85,
+ 84, 5, 218, 80, 233, 23, 85, 84, 5, 218, 78, 233, 109, 85, 84, 5, 218,
+ 76, 232, 86, 85, 84, 5, 218, 24, 233, 52, 85, 84, 5, 218, 27, 233, 59,
+ 85, 84, 5, 217, 225, 232, 162, 85, 84, 5, 218, 14, 232, 175, 85, 84, 5,
+ 217, 161, 232, 85, 85, 84, 5, 218, 1, 233, 80, 85, 84, 5, 218, 74, 213,
+ 179, 85, 84, 5, 218, 72, 214, 226, 85, 84, 5, 218, 70, 212, 130, 85, 84,
+ 5, 217, 241, 214, 102, 85, 84, 5, 217, 189, 213, 31, 85, 84, 5, 217, 182,
+ 229, 158, 85, 84, 5, 218, 65, 140, 85, 84, 5, 217, 172, 228, 159, 85, 84,
+ 5, 218, 68, 229, 215, 85, 84, 5, 218, 6, 229, 245, 85, 84, 5, 218, 63,
+ 228, 252, 85, 84, 5, 217, 218, 229, 23, 85, 84, 5, 218, 19, 229, 214, 85,
+ 84, 5, 217, 230, 228, 245, 85, 84, 5, 218, 49, 229, 128, 85, 84, 5, 217,
+ 228, 230, 56, 85, 84, 5, 218, 15, 228, 142, 85, 84, 5, 218, 50, 229, 198,
+ 85, 84, 5, 217, 165, 228, 255, 85, 84, 5, 218, 56, 228, 155, 85, 84, 5,
+ 218, 12, 214, 33, 85, 84, 5, 218, 61, 214, 47, 85, 84, 5, 218, 20, 214,
+ 30, 85, 84, 5, 217, 243, 214, 41, 85, 84, 5, 217, 212, 214, 42, 85, 84,
+ 5, 217, 202, 214, 31, 85, 84, 5, 217, 238, 214, 32, 85, 84, 5, 217, 199,
+ 214, 46, 85, 84, 5, 217, 231, 214, 29, 85, 84, 5, 218, 16, 179, 214, 42,
+ 85, 84, 5, 217, 252, 179, 214, 31, 85, 84, 5, 217, 175, 179, 214, 32, 85,
+ 84, 5, 217, 203, 231, 53, 85, 84, 5, 217, 247, 231, 240, 85, 84, 5, 217,
+ 190, 230, 179, 85, 84, 5, 217, 168, 231, 157, 85, 84, 5, 217, 192, 230,
+ 165, 85, 84, 5, 217, 191, 230, 175, 85, 84, 5, 217, 174, 214, 52, 85, 84,
+ 5, 218, 45, 213, 245, 85, 84, 5, 217, 181, 213, 234, 85, 84, 5, 218, 34,
+ 209, 185, 85, 84, 5, 218, 3, 168, 85, 84, 5, 218, 52, 208, 165, 85, 84,
+ 5, 218, 21, 210, 49, 85, 84, 5, 218, 51, 210, 63, 85, 84, 5, 218, 0, 209,
+ 37, 85, 84, 5, 218, 36, 209, 73, 85, 84, 5, 217, 213, 216, 252, 85, 84,
+ 5, 218, 40, 217, 11, 85, 84, 5, 217, 236, 216, 246, 85, 84, 5, 218, 55,
+ 217, 3, 85, 84, 5, 217, 170, 217, 3, 85, 84, 5, 218, 30, 217, 4, 85, 84,
+ 5, 217, 186, 216, 247, 85, 84, 5, 217, 184, 216, 248, 85, 84, 5, 217,
+ 171, 216, 240, 85, 84, 5, 217, 197, 179, 217, 4, 85, 84, 5, 217, 253,
+ 179, 216, 247, 85, 84, 5, 217, 216, 179, 216, 248, 85, 84, 5, 217, 226,
+ 221, 13, 85, 84, 5, 218, 10, 221, 21, 85, 84, 5, 218, 28, 221, 9, 85, 84,
+ 5, 218, 59, 221, 16, 85, 84, 5, 217, 250, 221, 17, 85, 84, 5, 217, 246,
+ 221, 11, 85, 84, 5, 217, 200, 221, 12, 85, 84, 5, 217, 234, 231, 174, 85,
+ 84, 5, 218, 46, 231, 182, 85, 84, 5, 217, 210, 231, 169, 85, 84, 5, 218,
+ 9, 231, 178, 85, 84, 5, 217, 251, 231, 179, 85, 84, 5, 218, 31, 231, 170,
+ 85, 84, 5, 218, 32, 231, 172, 85, 84, 5, 217, 187, 165, 85, 84, 5, 217,
+ 235, 214, 147, 85, 84, 5, 217, 229, 214, 162, 85, 84, 5, 217, 233, 214,
+ 129, 85, 84, 5, 217, 167, 214, 153, 85, 84, 5, 217, 239, 214, 154, 85,
+ 84, 5, 218, 35, 214, 134, 85, 84, 5, 218, 38, 214, 138, 85, 84, 5, 217,
+ 206, 213, 157, 85, 84, 5, 217, 166, 213, 127, 85, 84, 5, 217, 209, 213,
+ 148, 85, 84, 5, 217, 224, 213, 131, 85, 84, 5, 217, 176, 195, 69, 85, 84,
+ 5, 217, 173, 195, 188, 85, 84, 5, 217, 207, 193, 249, 85, 84, 5, 217,
+ 185, 195, 148, 85, 84, 5, 218, 17, 195, 153, 85, 84, 5, 217, 214, 195, 8,
+ 85, 84, 5, 218, 25, 195, 24, 85, 84, 5, 217, 194, 212, 74, 85, 84, 5,
+ 218, 44, 212, 94, 85, 84, 5, 217, 188, 212, 56, 85, 84, 5, 218, 4, 212,
+ 86, 85, 84, 5, 218, 42, 212, 63, 85, 84, 17, 107, 85, 84, 17, 109, 85,
+ 84, 17, 138, 85, 84, 17, 134, 85, 84, 17, 149, 85, 84, 17, 169, 85, 84,
+ 17, 175, 85, 84, 17, 171, 85, 84, 17, 178, 85, 84, 33, 31, 199, 119, 85,
+ 84, 33, 31, 199, 90, 85, 84, 33, 31, 228, 138, 85, 84, 33, 31, 198, 228,
+ 85, 84, 33, 31, 199, 96, 198, 228, 85, 84, 33, 31, 228, 141, 198, 228,
+ 85, 84, 33, 31, 216, 47, 252, 33, 6, 1, 251, 180, 252, 33, 6, 1, 238, 29,
+ 252, 33, 6, 1, 220, 123, 252, 33, 6, 1, 216, 60, 252, 33, 6, 1, 249, 153,
+ 252, 33, 6, 1, 202, 164, 252, 33, 6, 1, 210, 63, 252, 33, 6, 1, 248, 196,
+ 252, 33, 6, 1, 165, 252, 33, 6, 1, 71, 252, 33, 6, 1, 233, 109, 252, 33,
+ 6, 1, 68, 252, 33, 6, 1, 74, 252, 33, 6, 1, 237, 68, 252, 33, 6, 1, 192,
+ 34, 252, 33, 6, 1, 193, 133, 252, 33, 6, 1, 212, 130, 252, 33, 6, 1, 222,
+ 106, 252, 33, 6, 1, 170, 252, 33, 6, 1, 66, 252, 33, 6, 1, 222, 235, 252,
+ 33, 6, 1, 243, 95, 252, 33, 6, 1, 140, 252, 33, 6, 1, 208, 94, 252, 33,
+ 6, 1, 231, 240, 252, 33, 6, 1, 212, 101, 252, 33, 6, 1, 197, 94, 252, 33,
+ 6, 1, 213, 224, 252, 33, 6, 1, 195, 188, 252, 33, 6, 1, 221, 215, 252,
+ 33, 6, 1, 231, 179, 252, 33, 6, 1, 191, 108, 252, 33, 6, 1, 221, 12, 252,
+ 33, 6, 1, 203, 165, 252, 33, 2, 1, 251, 180, 252, 33, 2, 1, 238, 29, 252,
+ 33, 2, 1, 220, 123, 252, 33, 2, 1, 216, 60, 252, 33, 2, 1, 249, 153, 252,
+ 33, 2, 1, 202, 164, 252, 33, 2, 1, 210, 63, 252, 33, 2, 1, 248, 196, 252,
+ 33, 2, 1, 165, 252, 33, 2, 1, 71, 252, 33, 2, 1, 233, 109, 252, 33, 2, 1,
+ 68, 252, 33, 2, 1, 74, 252, 33, 2, 1, 237, 68, 252, 33, 2, 1, 192, 34,
+ 252, 33, 2, 1, 193, 133, 252, 33, 2, 1, 212, 130, 252, 33, 2, 1, 222,
+ 106, 252, 33, 2, 1, 170, 252, 33, 2, 1, 66, 252, 33, 2, 1, 222, 235, 252,
+ 33, 2, 1, 243, 95, 252, 33, 2, 1, 140, 252, 33, 2, 1, 208, 94, 252, 33,
+ 2, 1, 231, 240, 252, 33, 2, 1, 212, 101, 252, 33, 2, 1, 197, 94, 252, 33,
+ 2, 1, 213, 224, 252, 33, 2, 1, 195, 188, 252, 33, 2, 1, 221, 215, 252,
+ 33, 2, 1, 231, 179, 252, 33, 2, 1, 191, 108, 252, 33, 2, 1, 221, 12, 252,
+ 33, 2, 1, 203, 165, 252, 33, 251, 181, 219, 190, 252, 33, 18, 219, 190,
+ 252, 33, 231, 153, 77, 252, 33, 230, 57, 252, 33, 120, 215, 252, 252, 33,
+ 231, 154, 120, 215, 252, 252, 33, 212, 141, 252, 33, 214, 213, 77, 252,
+ 33, 17, 191, 77, 252, 33, 17, 107, 252, 33, 17, 109, 252, 33, 17, 138,
+ 252, 33, 17, 134, 252, 33, 17, 149, 252, 33, 17, 169, 252, 33, 17, 175,
+ 252, 33, 17, 171, 252, 33, 17, 178, 252, 33, 89, 233, 216, 77, 252, 33,
+ 89, 208, 13, 77, 223, 146, 143, 31, 107, 223, 146, 143, 31, 109, 223,
+ 146, 143, 31, 138, 223, 146, 143, 31, 134, 223, 146, 143, 31, 149, 223,
+ 146, 143, 31, 169, 223, 146, 143, 31, 175, 223, 146, 143, 31, 171, 223,
+ 146, 143, 31, 178, 223, 146, 143, 31, 199, 95, 223, 146, 143, 31, 197,
+ 32, 223, 146, 143, 31, 198, 249, 223, 146, 143, 31, 232, 135, 223, 146,
+ 143, 31, 233, 15, 223, 146, 143, 31, 202, 120, 223, 146, 143, 31, 203,
+ 241, 223, 146, 143, 31, 234, 153, 223, 146, 143, 31, 213, 169, 223, 146,
+ 143, 31, 91, 228, 140, 223, 146, 143, 31, 105, 228, 140, 223, 146, 143,
+ 31, 115, 228, 140, 223, 146, 143, 31, 232, 128, 228, 140, 223, 146, 143,
+ 31, 232, 226, 228, 140, 223, 146, 143, 31, 202, 136, 228, 140, 223, 146,
+ 143, 31, 203, 247, 228, 140, 223, 146, 143, 31, 234, 164, 228, 140, 223,
+ 146, 143, 31, 213, 175, 228, 140, 223, 146, 143, 31, 91, 189, 223, 146,
+ 143, 31, 105, 189, 223, 146, 143, 31, 115, 189, 223, 146, 143, 31, 232,
+ 128, 189, 223, 146, 143, 31, 232, 226, 189, 223, 146, 143, 31, 202, 136,
+ 189, 223, 146, 143, 31, 203, 247, 189, 223, 146, 143, 31, 234, 164, 189,
+ 223, 146, 143, 31, 213, 175, 189, 223, 146, 143, 31, 199, 96, 189, 223,
+ 146, 143, 31, 197, 33, 189, 223, 146, 143, 31, 198, 250, 189, 223, 146,
+ 143, 31, 232, 136, 189, 223, 146, 143, 31, 233, 16, 189, 223, 146, 143,
+ 31, 202, 121, 189, 223, 146, 143, 31, 203, 242, 189, 223, 146, 143, 31,
+ 234, 154, 189, 223, 146, 143, 31, 213, 170, 189, 223, 146, 143, 31, 220,
+ 41, 223, 146, 143, 31, 220, 40, 223, 146, 143, 220, 42, 77, 223, 146,
+ 143, 31, 222, 60, 223, 146, 143, 31, 222, 59, 223, 146, 143, 31, 208,
+ 227, 107, 223, 146, 143, 31, 208, 227, 109, 223, 146, 143, 31, 208, 227,
+ 138, 223, 146, 143, 31, 208, 227, 134, 223, 146, 143, 31, 208, 227, 149,
+ 223, 146, 143, 31, 208, 227, 169, 223, 146, 143, 31, 208, 227, 175, 223,
+ 146, 143, 31, 208, 227, 171, 223, 146, 143, 31, 208, 227, 178, 223, 146,
+ 143, 209, 106, 223, 146, 143, 232, 118, 91, 208, 22, 223, 146, 143, 232,
+ 118, 91, 230, 70, 223, 146, 143, 232, 118, 115, 208, 20, 223, 146, 143,
+ 206, 36, 77, 223, 146, 143, 31, 251, 157, 107, 223, 146, 143, 31, 251,
+ 157, 109, 223, 146, 143, 31, 251, 157, 199, 96, 189, 223, 146, 143, 251,
+ 157, 220, 42, 77, 211, 21, 143, 31, 107, 211, 21, 143, 31, 109, 211, 21,
+ 143, 31, 138, 211, 21, 143, 31, 134, 211, 21, 143, 31, 149, 211, 21, 143,
+ 31, 169, 211, 21, 143, 31, 175, 211, 21, 143, 31, 171, 211, 21, 143, 31,
+ 178, 211, 21, 143, 31, 199, 95, 211, 21, 143, 31, 197, 32, 211, 21, 143,
+ 31, 198, 249, 211, 21, 143, 31, 232, 135, 211, 21, 143, 31, 233, 15, 211,
+ 21, 143, 31, 202, 120, 211, 21, 143, 31, 203, 241, 211, 21, 143, 31, 234,
+ 153, 211, 21, 143, 31, 213, 169, 211, 21, 143, 31, 91, 228, 140, 211, 21,
+ 143, 31, 105, 228, 140, 211, 21, 143, 31, 115, 228, 140, 211, 21, 143,
+ 31, 232, 128, 228, 140, 211, 21, 143, 31, 232, 226, 228, 140, 211, 21,
+ 143, 31, 202, 136, 228, 140, 211, 21, 143, 31, 203, 247, 228, 140, 211,
+ 21, 143, 31, 234, 164, 228, 140, 211, 21, 143, 31, 213, 175, 228, 140,
+ 211, 21, 143, 31, 91, 189, 211, 21, 143, 31, 105, 189, 211, 21, 143, 31,
+ 115, 189, 211, 21, 143, 31, 232, 128, 189, 211, 21, 143, 31, 232, 226,
+ 189, 211, 21, 143, 31, 202, 136, 189, 211, 21, 143, 31, 203, 247, 189,
+ 211, 21, 143, 31, 234, 164, 189, 211, 21, 143, 31, 213, 175, 189, 211,
+ 21, 143, 31, 199, 96, 189, 211, 21, 143, 31, 197, 33, 189, 211, 21, 143,
+ 31, 198, 250, 189, 211, 21, 143, 31, 232, 136, 189, 211, 21, 143, 31,
+ 233, 16, 189, 211, 21, 143, 31, 202, 121, 189, 211, 21, 143, 31, 203,
+ 242, 189, 211, 21, 143, 31, 234, 154, 189, 211, 21, 143, 31, 213, 170,
+ 189, 211, 21, 143, 217, 49, 211, 21, 143, 251, 157, 31, 109, 211, 21,
+ 143, 251, 157, 31, 138, 211, 21, 143, 251, 157, 31, 134, 211, 21, 143,
+ 251, 157, 31, 149, 211, 21, 143, 251, 157, 31, 169, 211, 21, 143, 251,
+ 157, 31, 175, 211, 21, 143, 251, 157, 31, 171, 211, 21, 143, 251, 157,
+ 31, 178, 211, 21, 143, 251, 157, 31, 199, 95, 211, 21, 143, 251, 157, 31,
+ 232, 128, 228, 140, 211, 21, 143, 251, 157, 31, 202, 136, 228, 140, 211,
+ 21, 143, 251, 157, 31, 105, 189, 211, 21, 143, 251, 157, 31, 199, 96,
+ 189, 211, 21, 143, 232, 118, 91, 230, 70, 211, 21, 143, 232, 118, 91,
+ 202, 124, 9, 13, 251, 192, 9, 13, 248, 245, 9, 13, 223, 6, 9, 13, 238, 3,
+ 9, 13, 193, 133, 9, 13, 191, 113, 9, 13, 230, 81, 9, 13, 199, 219, 9, 13,
+ 192, 75, 9, 13, 222, 106, 9, 13, 220, 35, 9, 13, 216, 208, 9, 13, 213,
+ 24, 9, 13, 205, 46, 9, 13, 251, 230, 9, 13, 233, 46, 9, 13, 205, 192, 9,
+ 13, 208, 89, 9, 13, 207, 71, 9, 13, 203, 109, 9, 13, 199, 114, 9, 13,
+ 199, 29, 9, 13, 221, 210, 9, 13, 199, 41, 9, 13, 238, 26, 9, 13, 191,
+ 116, 9, 13, 231, 86, 9, 13, 236, 139, 248, 245, 9, 13, 236, 139, 213, 24,
+ 9, 13, 236, 139, 233, 46, 9, 13, 236, 139, 208, 89, 9, 13, 89, 248, 245,
+ 9, 13, 89, 223, 6, 9, 13, 89, 229, 210, 9, 13, 89, 230, 81, 9, 13, 89,
+ 192, 75, 9, 13, 89, 222, 106, 9, 13, 89, 220, 35, 9, 13, 89, 216, 208, 9,
+ 13, 89, 213, 24, 9, 13, 89, 205, 46, 9, 13, 89, 251, 230, 9, 13, 89, 233,
+ 46, 9, 13, 89, 205, 192, 9, 13, 89, 208, 89, 9, 13, 89, 203, 109, 9, 13,
+ 89, 199, 114, 9, 13, 89, 199, 29, 9, 13, 89, 221, 210, 9, 13, 89, 238,
+ 26, 9, 13, 89, 231, 86, 9, 13, 199, 214, 223, 6, 9, 13, 199, 214, 230,
+ 81, 9, 13, 199, 214, 192, 75, 9, 13, 199, 214, 220, 35, 9, 13, 199, 214,
+ 213, 24, 9, 13, 199, 214, 205, 46, 9, 13, 199, 214, 251, 230, 9, 13, 199,
+ 214, 205, 192, 9, 13, 199, 214, 208, 89, 9, 13, 199, 214, 203, 109, 9,
+ 13, 199, 214, 221, 210, 9, 13, 199, 214, 238, 26, 9, 13, 199, 214, 231,
+ 86, 9, 13, 199, 214, 236, 139, 213, 24, 9, 13, 199, 214, 236, 139, 208,
+ 89, 9, 13, 201, 36, 248, 245, 9, 13, 201, 36, 223, 6, 9, 13, 201, 36,
+ 229, 210, 9, 13, 201, 36, 230, 81, 9, 13, 201, 36, 199, 219, 9, 13, 201,
+ 36, 192, 75, 9, 13, 201, 36, 222, 106, 9, 13, 201, 36, 216, 208, 9, 13,
+ 201, 36, 213, 24, 9, 13, 201, 36, 205, 46, 9, 13, 201, 36, 251, 230, 9,
+ 13, 201, 36, 233, 46, 9, 13, 201, 36, 205, 192, 9, 13, 201, 36, 208, 89,
+ 9, 13, 201, 36, 203, 109, 9, 13, 201, 36, 199, 114, 9, 13, 201, 36, 199,
+ 29, 9, 13, 201, 36, 221, 210, 9, 13, 201, 36, 238, 26, 9, 13, 201, 36,
+ 191, 116, 9, 13, 201, 36, 231, 86, 9, 13, 201, 36, 236, 139, 248, 245, 9,
+ 13, 201, 36, 236, 139, 233, 46, 9, 13, 219, 3, 251, 192, 9, 13, 219, 3,
+ 248, 245, 9, 13, 219, 3, 223, 6, 9, 13, 219, 3, 238, 3, 9, 13, 219, 3,
+ 229, 210, 9, 13, 219, 3, 193, 133, 9, 13, 219, 3, 191, 113, 9, 13, 219,
+ 3, 230, 81, 9, 13, 219, 3, 199, 219, 9, 13, 219, 3, 192, 75, 9, 13, 219,
+ 3, 220, 35, 9, 13, 219, 3, 216, 208, 9, 13, 219, 3, 213, 24, 9, 13, 219,
+ 3, 205, 46, 9, 13, 219, 3, 251, 230, 9, 13, 219, 3, 233, 46, 9, 13, 219,
+ 3, 205, 192, 9, 13, 219, 3, 208, 89, 9, 13, 219, 3, 207, 71, 9, 13, 219,
+ 3, 203, 109, 9, 13, 219, 3, 199, 114, 9, 13, 219, 3, 199, 29, 9, 13, 219,
+ 3, 221, 210, 9, 13, 219, 3, 199, 41, 9, 13, 219, 3, 238, 26, 9, 13, 219,
+ 3, 191, 116, 9, 13, 219, 3, 231, 86, 9, 13, 235, 129, 248, 245, 9, 13,
+ 235, 129, 223, 6, 9, 13, 235, 129, 238, 3, 9, 13, 235, 129, 193, 133, 9,
+ 13, 235, 129, 191, 113, 9, 13, 235, 129, 230, 81, 9, 13, 235, 129, 199,
+ 219, 9, 13, 235, 129, 192, 75, 9, 13, 235, 129, 220, 35, 9, 13, 235, 129,
+ 216, 208, 9, 13, 235, 129, 213, 24, 9, 13, 235, 129, 205, 46, 9, 13, 235,
+ 129, 251, 230, 9, 13, 235, 129, 233, 46, 9, 13, 235, 129, 205, 192, 9,
+ 13, 235, 129, 208, 89, 9, 13, 235, 129, 207, 71, 9, 13, 235, 129, 203,
+ 109, 9, 13, 235, 129, 199, 114, 9, 13, 235, 129, 199, 29, 9, 13, 235,
+ 129, 221, 210, 9, 13, 235, 129, 199, 41, 9, 13, 235, 129, 238, 26, 9, 13,
+ 235, 129, 191, 116, 9, 13, 235, 129, 231, 86, 9, 13, 211, 67, 92, 4, 182,
+ 4, 199, 168, 9, 13, 211, 67, 182, 4, 238, 3, 217, 114, 123, 234, 204,
+ 193, 66, 217, 114, 123, 202, 2, 193, 66, 217, 114, 123, 193, 105, 193,
+ 66, 217, 114, 123, 186, 193, 66, 217, 114, 123, 207, 87, 235, 111, 217,
+ 114, 123, 230, 201, 235, 111, 217, 114, 123, 63, 235, 111, 217, 114, 123,
+ 91, 79, 243, 140, 217, 114, 123, 105, 79, 243, 140, 217, 114, 123, 115,
+ 79, 243, 140, 217, 114, 123, 232, 128, 79, 243, 140, 217, 114, 123, 232,
+ 226, 79, 243, 140, 217, 114, 123, 202, 136, 79, 243, 140, 217, 114, 123,
+ 203, 247, 79, 243, 140, 217, 114, 123, 234, 164, 79, 243, 140, 217, 114,
+ 123, 213, 175, 79, 243, 140, 217, 114, 123, 91, 79, 249, 102, 217, 114,
+ 123, 105, 79, 249, 102, 217, 114, 123, 115, 79, 249, 102, 217, 114, 123,
+ 232, 128, 79, 249, 102, 217, 114, 123, 232, 226, 79, 249, 102, 217, 114,
+ 123, 202, 136, 79, 249, 102, 217, 114, 123, 203, 247, 79, 249, 102, 217,
+ 114, 123, 234, 164, 79, 249, 102, 217, 114, 123, 213, 175, 79, 249, 102,
+ 217, 114, 123, 91, 79, 243, 7, 217, 114, 123, 105, 79, 243, 7, 217, 114,
+ 123, 115, 79, 243, 7, 217, 114, 123, 232, 128, 79, 243, 7, 217, 114, 123,
+ 232, 226, 79, 243, 7, 217, 114, 123, 202, 136, 79, 243, 7, 217, 114, 123,
+ 203, 247, 79, 243, 7, 217, 114, 123, 234, 164, 79, 243, 7, 217, 114, 123,
+ 213, 175, 79, 243, 7, 217, 114, 123, 209, 85, 217, 114, 123, 211, 53,
+ 217, 114, 123, 249, 103, 217, 114, 123, 243, 49, 217, 114, 123, 201, 196,
+ 217, 114, 123, 200, 200, 217, 114, 123, 250, 149, 217, 114, 123, 193, 56,
+ 217, 114, 123, 222, 194, 217, 114, 123, 249, 146, 236, 151, 123, 228,
+ 241, 249, 146, 236, 151, 123, 228, 239, 236, 151, 123, 228, 238, 236,
+ 151, 123, 228, 237, 236, 151, 123, 228, 236, 236, 151, 123, 228, 235,
+ 236, 151, 123, 228, 234, 236, 151, 123, 228, 233, 236, 151, 123, 228,
+ 232, 236, 151, 123, 228, 231, 236, 151, 123, 228, 230, 236, 151, 123,
+ 228, 229, 236, 151, 123, 228, 228, 236, 151, 123, 228, 227, 236, 151,
+ 123, 228, 226, 236, 151, 123, 228, 225, 236, 151, 123, 228, 224, 236,
+ 151, 123, 228, 223, 236, 151, 123, 228, 222, 236, 151, 123, 228, 221,
+ 236, 151, 123, 228, 220, 236, 151, 123, 228, 219, 236, 151, 123, 228,
+ 218, 236, 151, 123, 228, 217, 236, 151, 123, 228, 216, 236, 151, 123,
+ 228, 215, 236, 151, 123, 228, 214, 236, 151, 123, 228, 213, 236, 151,
+ 123, 228, 212, 236, 151, 123, 228, 211, 236, 151, 123, 228, 210, 236,
+ 151, 123, 228, 209, 236, 151, 123, 228, 208, 236, 151, 123, 228, 207,
+ 236, 151, 123, 228, 206, 236, 151, 123, 228, 205, 236, 151, 123, 228,
+ 204, 236, 151, 123, 228, 203, 236, 151, 123, 228, 202, 236, 151, 123,
+ 228, 201, 236, 151, 123, 228, 200, 236, 151, 123, 228, 199, 236, 151,
+ 123, 228, 198, 236, 151, 123, 228, 197, 236, 151, 123, 228, 196, 236,
+ 151, 123, 228, 195, 236, 151, 123, 228, 194, 236, 151, 123, 228, 193,
+ 236, 151, 123, 228, 192, 236, 151, 123, 228, 191, 236, 151, 123, 81, 249,
+ 146, 236, 151, 123, 195, 134, 236, 151, 123, 195, 133, 236, 151, 123,
+ 195, 132, 236, 151, 123, 195, 131, 236, 151, 123, 195, 130, 236, 151,
+ 123, 195, 129, 236, 151, 123, 195, 128, 236, 151, 123, 195, 127, 236,
+ 151, 123, 195, 126, 236, 151, 123, 195, 125, 236, 151, 123, 195, 124,
+ 236, 151, 123, 195, 123, 236, 151, 123, 195, 122, 236, 151, 123, 195,
+ 121, 236, 151, 123, 195, 120, 236, 151, 123, 195, 119, 236, 151, 123,
+ 195, 118, 236, 151, 123, 195, 117, 236, 151, 123, 195, 116, 236, 151,
+ 123, 195, 115, 236, 151, 123, 195, 114, 236, 151, 123, 195, 113, 236,
+ 151, 123, 195, 112, 236, 151, 123, 195, 111, 236, 151, 123, 195, 110,
+ 236, 151, 123, 195, 109, 236, 151, 123, 195, 108, 236, 151, 123, 195,
+ 107, 236, 151, 123, 195, 106, 236, 151, 123, 195, 105, 236, 151, 123,
+ 195, 104, 236, 151, 123, 195, 103, 236, 151, 123, 195, 102, 236, 151,
+ 123, 195, 101, 236, 151, 123, 195, 100, 236, 151, 123, 195, 99, 236, 151,
+ 123, 195, 98, 236, 151, 123, 195, 97, 236, 151, 123, 195, 96, 236, 151,
+ 123, 195, 95, 236, 151, 123, 195, 94, 236, 151, 123, 195, 93, 236, 151,
+ 123, 195, 92, 236, 151, 123, 195, 91, 236, 151, 123, 195, 90, 236, 151,
+ 123, 195, 89, 236, 151, 123, 195, 88, 236, 151, 123, 195, 87, 236, 151,
+ 123, 195, 86, 209, 95, 247, 101, 249, 146, 209, 95, 247, 101, 252, 53,
+ 79, 201, 244, 209, 95, 247, 101, 105, 79, 201, 244, 209, 95, 247, 101,
+ 115, 79, 201, 244, 209, 95, 247, 101, 232, 128, 79, 201, 244, 209, 95,
+ 247, 101, 232, 226, 79, 201, 244, 209, 95, 247, 101, 202, 136, 79, 201,
+ 244, 209, 95, 247, 101, 203, 247, 79, 201, 244, 209, 95, 247, 101, 234,
+ 164, 79, 201, 244, 209, 95, 247, 101, 213, 175, 79, 201, 244, 209, 95,
+ 247, 101, 199, 96, 79, 201, 244, 209, 95, 247, 101, 223, 30, 79, 201,
+ 244, 209, 95, 247, 101, 221, 77, 79, 201, 244, 209, 95, 247, 101, 208,
+ 15, 79, 201, 244, 209, 95, 247, 101, 221, 139, 79, 201, 244, 209, 95,
+ 247, 101, 252, 53, 79, 229, 221, 209, 95, 247, 101, 105, 79, 229, 221,
+ 209, 95, 247, 101, 115, 79, 229, 221, 209, 95, 247, 101, 232, 128, 79,
+ 229, 221, 209, 95, 247, 101, 232, 226, 79, 229, 221, 209, 95, 247, 101,
+ 202, 136, 79, 229, 221, 209, 95, 247, 101, 203, 247, 79, 229, 221, 209,
+ 95, 247, 101, 234, 164, 79, 229, 221, 209, 95, 247, 101, 213, 175, 79,
+ 229, 221, 209, 95, 247, 101, 199, 96, 79, 229, 221, 209, 95, 247, 101,
+ 223, 30, 79, 229, 221, 209, 95, 247, 101, 221, 77, 79, 229, 221, 209, 95,
+ 247, 101, 208, 15, 79, 229, 221, 209, 95, 247, 101, 221, 139, 79, 229,
+ 221, 209, 95, 247, 101, 207, 87, 222, 194, 209, 95, 247, 101, 252, 53,
+ 79, 237, 31, 209, 95, 247, 101, 105, 79, 237, 31, 209, 95, 247, 101, 115,
+ 79, 237, 31, 209, 95, 247, 101, 232, 128, 79, 237, 31, 209, 95, 247, 101,
+ 232, 226, 79, 237, 31, 209, 95, 247, 101, 202, 136, 79, 237, 31, 209, 95,
+ 247, 101, 203, 247, 79, 237, 31, 209, 95, 247, 101, 234, 164, 79, 237,
+ 31, 209, 95, 247, 101, 213, 175, 79, 237, 31, 209, 95, 247, 101, 199, 96,
+ 79, 237, 31, 209, 95, 247, 101, 223, 30, 79, 237, 31, 209, 95, 247, 101,
+ 221, 77, 79, 237, 31, 209, 95, 247, 101, 208, 15, 79, 237, 31, 209, 95,
+ 247, 101, 221, 139, 79, 237, 31, 209, 95, 247, 101, 62, 222, 194, 209,
+ 95, 247, 101, 252, 53, 79, 242, 204, 209, 95, 247, 101, 105, 79, 242,
+ 204, 209, 95, 247, 101, 115, 79, 242, 204, 209, 95, 247, 101, 232, 128,
+ 79, 242, 204, 209, 95, 247, 101, 232, 226, 79, 242, 204, 209, 95, 247,
+ 101, 202, 136, 79, 242, 204, 209, 95, 247, 101, 203, 247, 79, 242, 204,
+ 209, 95, 247, 101, 234, 164, 79, 242, 204, 209, 95, 247, 101, 213, 175,
+ 79, 242, 204, 209, 95, 247, 101, 199, 96, 79, 242, 204, 209, 95, 247,
+ 101, 223, 30, 79, 242, 204, 209, 95, 247, 101, 221, 77, 79, 242, 204,
+ 209, 95, 247, 101, 208, 15, 79, 242, 204, 209, 95, 247, 101, 221, 139,
+ 79, 242, 204, 209, 95, 247, 101, 63, 222, 194, 209, 95, 247, 101, 232,
+ 160, 209, 95, 247, 101, 197, 200, 209, 95, 247, 101, 197, 189, 209, 95,
+ 247, 101, 197, 186, 209, 95, 247, 101, 197, 185, 209, 95, 247, 101, 197,
+ 184, 209, 95, 247, 101, 197, 183, 209, 95, 247, 101, 197, 182, 209, 95,
+ 247, 101, 197, 181, 209, 95, 247, 101, 197, 180, 209, 95, 247, 101, 197,
+ 199, 209, 95, 247, 101, 197, 198, 209, 95, 247, 101, 197, 197, 209, 95,
+ 247, 101, 197, 196, 209, 95, 247, 101, 197, 195, 209, 95, 247, 101, 197,
+ 194, 209, 95, 247, 101, 197, 193, 209, 95, 247, 101, 197, 192, 209, 95,
+ 247, 101, 197, 191, 209, 95, 247, 101, 197, 190, 209, 95, 247, 101, 197,
+ 188, 209, 95, 247, 101, 197, 187, 17, 191, 78, 232, 80, 201, 63, 17, 191,
+ 78, 242, 74, 17, 91, 242, 74, 17, 105, 242, 74, 17, 115, 242, 74, 17,
+ 232, 128, 242, 74, 17, 232, 226, 242, 74, 17, 202, 136, 242, 74, 17, 203,
+ 247, 242, 74, 17, 234, 164, 242, 74, 17, 213, 175, 242, 74, 236, 241, 47,
+ 49, 17, 191, 77, 236, 241, 214, 106, 47, 49, 17, 191, 77, 47, 191, 78, 4,
+ 202, 97, 47, 251, 85, 57, 47, 236, 155, 3, 4, 211, 4, 249, 141, 127, 8,
+ 6, 1, 65, 127, 8, 6, 1, 250, 120, 127, 8, 6, 1, 247, 193, 127, 8, 6, 1,
+ 238, 127, 127, 8, 6, 1, 71, 127, 8, 6, 1, 233, 175, 127, 8, 6, 1, 232,
+ 51, 127, 8, 6, 1, 230, 116, 127, 8, 6, 1, 68, 127, 8, 6, 1, 223, 35, 127,
+ 8, 6, 1, 222, 152, 127, 8, 6, 1, 172, 127, 8, 6, 1, 218, 168, 127, 8, 6,
+ 1, 215, 61, 127, 8, 6, 1, 74, 127, 8, 6, 1, 210, 236, 127, 8, 6, 1, 208,
+ 104, 127, 8, 6, 1, 146, 127, 8, 6, 1, 206, 8, 127, 8, 6, 1, 200, 43, 127,
+ 8, 6, 1, 66, 127, 8, 6, 1, 196, 12, 127, 8, 6, 1, 193, 224, 127, 8, 6, 1,
+ 192, 235, 127, 8, 6, 1, 192, 159, 127, 8, 6, 1, 191, 166, 198, 42, 203,
+ 103, 248, 52, 8, 6, 1, 206, 8, 47, 43, 8, 6, 1, 247, 193, 47, 43, 8, 6,
+ 1, 146, 47, 247, 43, 47, 192, 237, 239, 7, 113, 112, 8, 6, 1, 65, 112, 8,
+ 6, 1, 250, 120, 112, 8, 6, 1, 247, 193, 112, 8, 6, 1, 238, 127, 112, 8,
+ 6, 1, 71, 112, 8, 6, 1, 233, 175, 112, 8, 6, 1, 232, 51, 112, 8, 6, 1,
+ 230, 116, 112, 8, 6, 1, 68, 112, 8, 6, 1, 223, 35, 112, 8, 6, 1, 222,
+ 152, 112, 8, 6, 1, 172, 112, 8, 6, 1, 218, 168, 112, 8, 6, 1, 215, 61,
+ 112, 8, 6, 1, 74, 112, 8, 6, 1, 210, 236, 112, 8, 6, 1, 208, 104, 112, 8,
+ 6, 1, 146, 112, 8, 6, 1, 206, 8, 112, 8, 6, 1, 200, 43, 112, 8, 6, 1, 66,
+ 112, 8, 6, 1, 196, 12, 112, 8, 6, 1, 193, 224, 112, 8, 6, 1, 192, 235,
+ 112, 8, 6, 1, 192, 159, 112, 8, 6, 1, 191, 166, 112, 228, 126, 112, 215,
+ 87, 112, 205, 70, 112, 201, 178, 112, 208, 248, 112, 193, 126, 214, 106,
+ 47, 8, 6, 1, 65, 214, 106, 47, 8, 6, 1, 250, 120, 214, 106, 47, 8, 6, 1,
+ 247, 193, 214, 106, 47, 8, 6, 1, 238, 127, 214, 106, 47, 8, 6, 1, 71,
+ 214, 106, 47, 8, 6, 1, 233, 175, 214, 106, 47, 8, 6, 1, 232, 51, 214,
+ 106, 47, 8, 6, 1, 230, 116, 214, 106, 47, 8, 6, 1, 68, 214, 106, 47, 8,
+ 6, 1, 223, 35, 214, 106, 47, 8, 6, 1, 222, 152, 214, 106, 47, 8, 6, 1,
+ 172, 214, 106, 47, 8, 6, 1, 218, 168, 214, 106, 47, 8, 6, 1, 215, 61,
+ 214, 106, 47, 8, 6, 1, 74, 214, 106, 47, 8, 6, 1, 210, 236, 214, 106, 47,
+ 8, 6, 1, 208, 104, 214, 106, 47, 8, 6, 1, 146, 214, 106, 47, 8, 6, 1,
+ 206, 8, 214, 106, 47, 8, 6, 1, 200, 43, 214, 106, 47, 8, 6, 1, 66, 214,
+ 106, 47, 8, 6, 1, 196, 12, 214, 106, 47, 8, 6, 1, 193, 224, 214, 106, 47,
+ 8, 6, 1, 192, 235, 214, 106, 47, 8, 6, 1, 192, 159, 214, 106, 47, 8, 6,
+ 1, 191, 166, 207, 147, 216, 239, 56, 207, 147, 216, 235, 56, 207, 147,
+ 215, 164, 56, 47, 247, 66, 47, 247, 194, 4, 211, 4, 249, 141, 47, 228,
+ 145, 233, 12, 214, 106, 112, 8, 6, 1, 65, 214, 106, 112, 8, 6, 1, 250,
+ 120, 214, 106, 112, 8, 6, 1, 247, 193, 214, 106, 112, 8, 6, 1, 238, 127,
+ 214, 106, 112, 8, 6, 1, 71, 214, 106, 112, 8, 6, 1, 233, 175, 214, 106,
+ 112, 8, 6, 1, 232, 51, 214, 106, 112, 8, 6, 1, 230, 116, 214, 106, 112,
+ 8, 6, 1, 68, 214, 106, 112, 8, 6, 1, 223, 35, 214, 106, 112, 8, 6, 1,
+ 222, 152, 214, 106, 112, 8, 6, 1, 172, 214, 106, 112, 8, 6, 1, 218, 168,
+ 214, 106, 112, 8, 6, 1, 215, 61, 214, 106, 112, 8, 6, 1, 74, 214, 106,
+ 112, 8, 6, 1, 210, 236, 214, 106, 112, 8, 6, 1, 208, 104, 214, 106, 112,
+ 8, 6, 1, 146, 214, 106, 112, 8, 6, 1, 206, 8, 214, 106, 112, 8, 6, 1,
+ 200, 43, 214, 106, 112, 8, 6, 1, 66, 214, 106, 112, 8, 6, 1, 196, 12,
+ 214, 106, 112, 8, 6, 1, 193, 224, 214, 106, 112, 8, 6, 1, 192, 235, 214,
+ 106, 112, 8, 6, 1, 192, 159, 214, 106, 112, 8, 6, 1, 191, 166, 238, 214,
+ 214, 106, 112, 8, 6, 1, 210, 236, 214, 106, 112, 228, 28, 214, 106, 112,
+ 168, 214, 106, 112, 188, 214, 106, 112, 252, 155, 214, 106, 112, 193,
+ 126, 51, 236, 194, 112, 242, 247, 112, 239, 14, 112, 232, 108, 112, 228,
+ 19, 112, 214, 79, 112, 214, 70, 112, 211, 125, 112, 202, 9, 112, 133, 4,
+ 233, 216, 77, 112, 194, 252, 112, 115, 238, 127, 112, 205, 57, 205, 76,
+ 112, 105, 222, 152, 112, 232, 128, 222, 152, 112, 234, 164, 222, 152,
+ 112, 232, 226, 209, 62, 107, 112, 203, 247, 209, 62, 107, 112, 197, 21,
+ 209, 62, 109, 112, 202, 121, 210, 236, 112, 91, 228, 141, 197, 33, 210,
+ 236, 112, 8, 2, 1, 238, 127, 112, 229, 248, 112, 229, 247, 112, 229, 150,
+ 112, 218, 252, 112, 202, 241, 112, 196, 140, 112, 195, 21, 217, 36, 193,
+ 21, 113, 207, 79, 223, 145, 16, 1, 65, 207, 79, 223, 145, 16, 1, 250,
+ 120, 207, 79, 223, 145, 16, 1, 247, 193, 207, 79, 223, 145, 16, 1, 238,
+ 127, 207, 79, 223, 145, 16, 1, 71, 207, 79, 223, 145, 16, 1, 233, 175,
+ 207, 79, 223, 145, 16, 1, 232, 51, 207, 79, 223, 145, 16, 1, 230, 116,
+ 207, 79, 223, 145, 16, 1, 68, 207, 79, 223, 145, 16, 1, 223, 35, 207, 79,
+ 223, 145, 16, 1, 222, 152, 207, 79, 223, 145, 16, 1, 172, 207, 79, 223,
+ 145, 16, 1, 218, 168, 207, 79, 223, 145, 16, 1, 215, 61, 207, 79, 223,
+ 145, 16, 1, 74, 207, 79, 223, 145, 16, 1, 210, 236, 207, 79, 223, 145,
+ 16, 1, 208, 104, 207, 79, 223, 145, 16, 1, 146, 207, 79, 223, 145, 16, 1,
+ 206, 8, 207, 79, 223, 145, 16, 1, 200, 43, 207, 79, 223, 145, 16, 1, 66,
+ 207, 79, 223, 145, 16, 1, 196, 12, 207, 79, 223, 145, 16, 1, 193, 224,
+ 207, 79, 223, 145, 16, 1, 192, 235, 207, 79, 223, 145, 16, 1, 192, 159,
+ 207, 79, 223, 145, 16, 1, 191, 166, 51, 229, 120, 229, 9, 112, 72, 221,
+ 49, 112, 72, 188, 112, 12, 196, 95, 225, 217, 112, 12, 196, 95, 225, 221,
+ 112, 12, 196, 95, 225, 229, 112, 72, 237, 146, 112, 12, 196, 95, 225,
+ 236, 112, 12, 196, 95, 225, 223, 112, 12, 196, 95, 225, 195, 112, 12,
+ 196, 95, 225, 222, 112, 12, 196, 95, 225, 235, 112, 12, 196, 95, 225,
+ 209, 112, 12, 196, 95, 225, 202, 112, 12, 196, 95, 225, 211, 112, 12,
+ 196, 95, 225, 232, 112, 12, 196, 95, 225, 218, 112, 12, 196, 95, 225,
+ 234, 112, 12, 196, 95, 225, 210, 112, 12, 196, 95, 225, 233, 112, 12,
+ 196, 95, 225, 196, 112, 12, 196, 95, 225, 201, 112, 12, 196, 95, 225,
+ 194, 112, 12, 196, 95, 225, 224, 112, 12, 196, 95, 225, 226, 112, 12,
+ 196, 95, 225, 204, 112, 12, 196, 95, 225, 215, 112, 12, 196, 95, 225,
+ 213, 112, 12, 196, 95, 225, 239, 112, 12, 196, 95, 225, 238, 112, 12,
+ 196, 95, 225, 192, 112, 12, 196, 95, 225, 219, 112, 12, 196, 95, 225,
+ 237, 112, 12, 196, 95, 225, 228, 112, 12, 196, 95, 225, 214, 112, 12,
+ 196, 95, 225, 193, 112, 12, 196, 95, 225, 216, 112, 12, 196, 95, 225,
+ 198, 112, 12, 196, 95, 225, 197, 112, 12, 196, 95, 225, 227, 112, 12,
+ 196, 95, 225, 205, 112, 12, 196, 95, 225, 207, 112, 12, 196, 95, 225,
+ 208, 112, 12, 196, 95, 225, 200, 112, 12, 196, 95, 225, 231, 112, 12,
+ 196, 95, 225, 225, 112, 12, 196, 95, 225, 191, 198, 42, 203, 103, 248,
+ 52, 12, 196, 95, 225, 206, 198, 42, 203, 103, 248, 52, 12, 196, 95, 225,
+ 238, 198, 42, 203, 103, 248, 52, 12, 196, 95, 225, 236, 198, 42, 203,
+ 103, 248, 52, 12, 196, 95, 225, 220, 198, 42, 203, 103, 248, 52, 12, 196,
+ 95, 225, 203, 198, 42, 203, 103, 248, 52, 12, 196, 95, 225, 216, 198, 42,
+ 203, 103, 248, 52, 12, 196, 95, 225, 199, 198, 42, 203, 103, 248, 52, 12,
+ 196, 95, 225, 230, 198, 42, 203, 103, 248, 52, 12, 196, 95, 225, 212, 47,
+ 228, 14, 252, 27, 47, 228, 14, 252, 58, 206, 113, 16, 40, 232, 86, 206,
+ 113, 16, 40, 218, 225, 206, 113, 16, 40, 203, 23, 206, 113, 16, 40, 192,
+ 207, 206, 113, 16, 40, 203, 2, 206, 113, 16, 40, 247, 148, 238, 139, 232,
+ 173, 242, 219, 196, 117, 213, 191, 4, 201, 99, 200, 193, 139, 215, 183,
+ 200, 192, 242, 251, 250, 183, 235, 61, 200, 191, 139, 247, 253, 207, 148,
+ 248, 29, 250, 183, 213, 190, 193, 144, 193, 138, 195, 14, 216, 52, 193,
+ 128, 234, 208, 231, 12, 233, 232, 234, 208, 231, 12, 251, 140, 234, 208,
+ 231, 12, 250, 202, 231, 12, 4, 216, 177, 214, 80, 215, 206, 113, 193,
+ 130, 238, 228, 215, 206, 113, 232, 238, 208, 23, 215, 206, 113, 193, 130,
+ 231, 49, 215, 206, 113, 232, 80, 215, 206, 113, 193, 159, 231, 49, 215,
+ 206, 113, 220, 6, 208, 23, 215, 206, 113, 193, 159, 238, 228, 215, 206,
+ 113, 238, 228, 215, 205, 214, 80, 215, 206, 4, 233, 103, 232, 238, 208,
+ 23, 215, 206, 4, 233, 103, 220, 6, 208, 23, 215, 206, 4, 233, 103, 232,
+ 80, 215, 206, 4, 233, 103, 200, 199, 4, 233, 103, 231, 8, 201, 102, 203,
+ 45, 201, 102, 199, 21, 62, 235, 97, 63, 200, 198, 63, 200, 199, 4, 2,
+ 242, 210, 63, 200, 199, 248, 242, 242, 210, 63, 200, 199, 248, 242, 242,
+ 211, 4, 207, 149, 242, 211, 4, 207, 149, 242, 211, 4, 202, 52, 242, 211,
+ 4, 219, 129, 242, 211, 4, 198, 46, 232, 174, 193, 67, 248, 116, 233, 103,
+ 228, 181, 236, 162, 199, 227, 247, 228, 243, 103, 205, 48, 233, 226, 197,
+ 254, 237, 139, 197, 254, 210, 183, 197, 254, 247, 153, 228, 181, 210, 15,
+ 197, 78, 243, 107, 248, 119, 206, 126, 229, 149, 200, 196, 248, 119, 234,
+ 212, 79, 217, 103, 234, 212, 79, 206, 245, 229, 193, 232, 128, 219, 234,
+ 242, 209, 217, 69, 219, 233, 233, 84, 219, 233, 219, 234, 232, 181, 223,
+ 163, 193, 66, 215, 98, 198, 83, 250, 162, 230, 218, 216, 196, 193, 142,
+ 199, 187, 219, 201, 249, 98, 209, 133, 207, 87, 251, 46, 230, 201, 251,
+ 46, 210, 55, 210, 59, 243, 108, 201, 42, 230, 63, 202, 89, 79, 209, 112,
+ 216, 225, 211, 105, 248, 98, 209, 9, 219, 212, 206, 246, 238, 234, 206,
+ 246, 249, 111, 239, 17, 206, 245, 238, 167, 23, 206, 245, 201, 83, 248,
+ 66, 201, 243, 248, 43, 232, 106, 232, 102, 206, 152, 200, 142, 209, 12,
+ 237, 235, 211, 153, 200, 165, 232, 103, 203, 13, 232, 237, 247, 147, 4,
+ 200, 134, 237, 80, 202, 32, 228, 27, 238, 232, 203, 121, 228, 26, 228,
+ 27, 238, 232, 235, 126, 239, 16, 243, 66, 164, 247, 118, 219, 24, 238,
+ 158, 228, 254, 209, 14, 203, 29, 248, 222, 248, 62, 209, 15, 79, 232,
+ 161, 239, 15, 232, 150, 23, 221, 78, 199, 133, 193, 51, 230, 31, 205,
+ 176, 248, 79, 23, 238, 181, 193, 63, 231, 16, 242, 94, 231, 16, 197, 204,
+ 235, 104, 248, 253, 215, 140, 242, 226, 248, 253, 215, 139, 249, 149,
+ 248, 78, 232, 150, 23, 221, 79, 4, 209, 97, 248, 79, 4, 209, 30, 239, 3,
+ 209, 32, 206, 247, 193, 11, 208, 222, 248, 157, 247, 146, 223, 29, 243,
+ 56, 197, 254, 233, 67, 243, 55, 232, 240, 232, 241, 201, 241, 249, 109,
+ 210, 102, 209, 31, 239, 54, 249, 111, 199, 191, 197, 254, 238, 214, 232,
+ 211, 209, 134, 237, 136, 223, 19, 236, 154, 247, 90, 201, 41, 193, 67,
+ 243, 82, 215, 206, 195, 54, 247, 8, 205, 90, 205, 120, 230, 225, 247,
+ 111, 229, 224, 4, 198, 136, 211, 105, 199, 34, 219, 224, 248, 72, 79,
+ 232, 185, 216, 54, 216, 219, 207, 58, 206, 247, 37, 221, 221, 4, 223, 28,
+ 201, 11, 216, 89, 219, 168, 202, 86, 239, 22, 221, 72, 249, 13, 250, 213,
+ 37, 213, 1, 249, 13, 237, 86, 37, 213, 1, 233, 0, 232, 112, 252, 31, 198,
+ 180, 247, 91, 228, 183, 233, 33, 193, 93, 206, 139, 242, 97, 232, 232,
+ 209, 53, 23, 232, 236, 216, 89, 215, 169, 247, 132, 243, 14, 229, 231,
+ 250, 224, 210, 188, 198, 54, 230, 9, 243, 0, 199, 87, 198, 181, 242, 242,
+ 248, 107, 210, 6, 250, 222, 195, 65, 231, 214, 236, 234, 229, 117, 202,
+ 79, 217, 148, 248, 170, 231, 215, 237, 24, 248, 65, 232, 187, 209, 95,
+ 247, 99, 37, 213, 6, 215, 129, 37, 213, 1, 205, 104, 230, 162, 37, 221,
+ 220, 197, 179, 195, 42, 37, 205, 82, 206, 42, 203, 60, 4, 205, 123, 199,
+ 92, 207, 170, 23, 249, 111, 202, 109, 23, 202, 109, 248, 91, 249, 68, 23,
+ 228, 247, 243, 109, 232, 217, 202, 51, 206, 43, 200, 170, 201, 202, 216,
+ 219, 197, 205, 228, 184, 207, 171, 251, 141, 232, 158, 206, 56, 232, 158,
+ 200, 137, 193, 110, 219, 134, 230, 249, 207, 172, 215, 191, 207, 172,
+ 247, 102, 238, 225, 249, 65, 23, 249, 111, 195, 13, 233, 22, 229, 12,
+ 201, 75, 23, 249, 111, 228, 27, 229, 12, 201, 75, 23, 208, 157, 199, 234,
+ 199, 92, 210, 207, 23, 249, 111, 202, 53, 247, 107, 215, 184, 247, 130,
+ 249, 16, 4, 196, 117, 247, 255, 239, 36, 228, 173, 247, 253, 242, 250,
+ 237, 90, 228, 173, 247, 254, 242, 240, 247, 254, 237, 82, 237, 83, 223,
+ 60, 214, 208, 210, 109, 201, 113, 228, 173, 247, 254, 228, 173, 4, 231,
+ 198, 211, 144, 247, 254, 223, 19, 209, 20, 211, 143, 233, 231, 209, 20,
+ 211, 143, 228, 182, 249, 92, 250, 151, 199, 102, 217, 148, 228, 178, 218,
+ 242, 228, 178, 239, 20, 201, 57, 205, 89, 237, 94, 201, 57, 233, 92, 223,
+ 40, 220, 18, 223, 19, 247, 80, 233, 231, 247, 80, 63, 210, 28, 62, 210,
+ 28, 193, 136, 63, 232, 217, 193, 136, 62, 232, 217, 206, 125, 62, 206,
+ 125, 220, 117, 249, 132, 207, 170, 23, 202, 244, 248, 70, 23, 57, 251,
+ 136, 234, 109, 52, 232, 227, 196, 253, 234, 109, 52, 232, 227, 196, 250,
+ 234, 109, 52, 232, 227, 196, 248, 234, 109, 52, 232, 227, 196, 246, 234,
+ 109, 52, 232, 227, 196, 244, 207, 130, 215, 181, 210, 247, 193, 144, 248,
+ 3, 238, 239, 198, 173, 219, 185, 207, 174, 247, 78, 235, 111, 238, 223,
+ 193, 96, 202, 60, 202, 58, 228, 183, 207, 142, 230, 255, 203, 107, 215,
+ 225, 206, 129, 243, 93, 236, 162, 209, 147, 248, 109, 234, 131, 211, 156,
+ 201, 218, 203, 102, 248, 2, 251, 89, 228, 253, 220, 108, 248, 251, 232,
+ 236, 197, 204, 232, 236, 248, 117, 197, 55, 230, 7, 243, 94, 249, 149,
+ 243, 94, 232, 96, 249, 149, 243, 94, 248, 160, 210, 30, 221, 61, 209, 36,
+ 235, 101, 247, 134, 249, 137, 247, 134, 236, 153, 215, 182, 233, 103,
+ 238, 240, 233, 103, 198, 174, 233, 103, 207, 175, 233, 103, 247, 79, 233,
+ 103, 235, 112, 233, 103, 201, 200, 193, 96, 228, 184, 233, 103, 215, 226,
+ 233, 103, 236, 163, 233, 103, 209, 148, 233, 103, 232, 100, 233, 103,
+ 230, 59, 233, 103, 193, 38, 233, 103, 249, 10, 233, 103, 210, 162, 233,
+ 103, 209, 148, 213, 13, 210, 76, 208, 208, 243, 77, 233, 185, 233, 193,
+ 234, 211, 213, 13, 215, 179, 198, 61, 63, 133, 209, 58, 249, 144, 223,
+ 148, 63, 144, 209, 58, 249, 144, 223, 148, 63, 45, 209, 58, 249, 144,
+ 223, 148, 63, 50, 209, 58, 249, 144, 223, 148, 232, 230, 230, 54, 56,
+ 193, 136, 230, 54, 56, 211, 126, 230, 54, 56, 198, 211, 133, 56, 198,
+ 211, 144, 56, 242, 241, 230, 29, 56, 211, 77, 230, 29, 56, 238, 208, 193,
+ 34, 230, 9, 233, 188, 214, 111, 200, 41, 223, 9, 235, 106, 221, 142, 248,
+ 173, 193, 34, 242, 212, 208, 137, 230, 33, 209, 10, 217, 78, 203, 52,
+ 250, 178, 203, 52, 229, 134, 203, 52, 193, 34, 205, 139, 193, 34, 248,
+ 90, 232, 156, 247, 220, 223, 163, 202, 187, 247, 219, 223, 163, 202, 187,
+ 248, 60, 231, 28, 217, 90, 193, 35, 233, 81, 217, 91, 23, 193, 36, 229,
+ 6, 230, 28, 105, 216, 187, 229, 6, 230, 28, 105, 193, 33, 229, 6, 230,
+ 28, 209, 50, 211, 142, 193, 36, 4, 247, 239, 234, 209, 248, 30, 4, 195,
+ 144, 209, 251, 4, 248, 121, 230, 78, 217, 91, 4, 230, 176, 209, 186, 217,
+ 73, 217, 91, 4, 197, 63, 211, 118, 217, 90, 211, 118, 193, 35, 249, 148,
+ 239, 37, 193, 19, 208, 213, 223, 19, 211, 137, 223, 19, 230, 254, 231,
+ 61, 249, 149, 251, 120, 233, 198, 251, 182, 251, 183, 215, 215, 223, 168,
+ 202, 103, 223, 137, 237, 79, 209, 250, 230, 170, 237, 240, 219, 95, 214,
+ 235, 209, 48, 233, 104, 217, 33, 230, 77, 249, 86, 209, 52, 200, 62, 209,
+ 140, 221, 123, 77, 218, 242, 219, 175, 206, 188, 231, 155, 201, 65, 221,
+ 122, 248, 71, 238, 243, 4, 229, 223, 193, 117, 249, 6, 229, 223, 248, 22,
+ 229, 223, 105, 229, 221, 201, 239, 229, 223, 230, 186, 229, 223, 229,
+ 224, 4, 57, 248, 115, 229, 223, 230, 201, 229, 223, 192, 73, 229, 223,
+ 208, 138, 229, 223, 229, 224, 4, 206, 247, 207, 12, 229, 221, 229, 224,
+ 237, 136, 237, 33, 203, 135, 4, 42, 75, 223, 117, 234, 135, 156, 247,
+ 251, 251, 119, 113, 248, 99, 202, 92, 113, 242, 85, 113, 201, 212, 200,
+ 144, 113, 235, 97, 237, 216, 113, 209, 141, 79, 209, 37, 232, 199, 248,
+ 185, 236, 195, 113, 201, 230, 249, 109, 198, 231, 249, 109, 63, 232, 186,
+ 228, 141, 209, 56, 113, 215, 230, 249, 130, 238, 170, 233, 218, 88, 236,
+ 155, 56, 238, 230, 247, 100, 249, 91, 4, 192, 71, 56, 249, 91, 4, 236,
+ 155, 56, 249, 91, 4, 233, 234, 56, 249, 91, 4, 209, 8, 56, 215, 230, 4,
+ 193, 60, 243, 137, 4, 196, 66, 197, 250, 23, 192, 71, 56, 205, 60, 209,
+ 249, 239, 59, 248, 28, 216, 41, 232, 191, 236, 220, 211, 60, 236, 226,
+ 235, 55, 233, 7, 232, 171, 211, 77, 233, 7, 232, 171, 210, 205, 4, 238,
+ 175, 210, 205, 233, 96, 196, 77, 247, 140, 199, 130, 247, 140, 247, 101,
+ 223, 148, 243, 137, 4, 196, 66, 197, 249, 243, 137, 4, 235, 119, 197,
+ 249, 249, 88, 243, 136, 242, 225, 208, 133, 206, 115, 208, 133, 210, 134,
+ 201, 53, 206, 50, 197, 238, 206, 50, 248, 95, 199, 232, 219, 229, 213, 4,
+ 213, 5, 4, 237, 135, 238, 242, 242, 219, 248, 96, 211, 77, 248, 96, 230,
+ 201, 248, 96, 248, 115, 248, 96, 211, 55, 248, 96, 248, 93, 214, 228,
+ 249, 134, 205, 73, 216, 188, 199, 107, 207, 101, 210, 203, 233, 64, 217,
+ 148, 205, 119, 251, 86, 208, 158, 252, 39, 218, 244, 243, 119, 216, 201,
+ 211, 13, 198, 2, 223, 159, 198, 2, 210, 212, 235, 8, 113, 223, 156, 234,
+ 67, 234, 68, 4, 235, 119, 64, 58, 242, 219, 217, 109, 4, 218, 235, 232,
+ 217, 242, 219, 217, 109, 4, 207, 147, 232, 217, 211, 77, 217, 109, 4,
+ 207, 147, 232, 217, 211, 77, 217, 109, 4, 218, 235, 232, 217, 209, 17,
+ 209, 18, 228, 187, 214, 75, 216, 4, 209, 194, 216, 4, 209, 195, 4, 96,
+ 64, 250, 183, 219, 224, 195, 68, 216, 3, 216, 4, 209, 195, 211, 145, 213,
+ 44, 216, 4, 209, 193, 251, 87, 4, 249, 76, 247, 132, 247, 133, 4, 232,
+ 208, 195, 65, 247, 132, 199, 104, 207, 165, 195, 64, 233, 0, 208, 193,
+ 209, 27, 201, 77, 208, 236, 249, 15, 197, 17, 96, 250, 231, 242, 221, 96,
+ 23, 118, 211, 77, 243, 11, 250, 231, 242, 221, 96, 23, 118, 211, 77, 243,
+ 11, 250, 232, 4, 47, 91, 210, 255, 242, 221, 235, 119, 23, 196, 66, 211,
+ 77, 243, 11, 250, 231, 251, 85, 235, 119, 23, 196, 66, 211, 77, 243, 11,
+ 250, 231, 130, 248, 26, 113, 137, 248, 26, 113, 201, 235, 4, 247, 125,
+ 106, 201, 234, 201, 235, 4, 91, 202, 5, 193, 138, 201, 235, 4, 115, 202,
+ 5, 193, 137, 249, 58, 234, 135, 209, 87, 219, 219, 217, 121, 231, 16,
+ 206, 203, 217, 121, 231, 16, 219, 35, 4, 223, 129, 210, 34, 242, 219,
+ 219, 35, 4, 221, 222, 221, 222, 219, 34, 211, 77, 219, 34, 248, 235, 248,
+ 236, 4, 247, 125, 106, 248, 94, 219, 103, 113, 207, 166, 247, 213, 249,
+ 147, 4, 118, 64, 58, 234, 95, 4, 118, 64, 58, 211, 105, 4, 233, 216, 87,
+ 4, 45, 50, 64, 58, 202, 15, 4, 96, 64, 58, 198, 54, 4, 196, 66, 64, 58,
+ 213, 44, 91, 196, 105, 234, 162, 113, 221, 219, 199, 95, 223, 123, 16,
+ 40, 8, 6, 219, 174, 223, 123, 16, 40, 8, 2, 219, 174, 223, 123, 16, 40,
+ 212, 135, 223, 123, 16, 40, 200, 76, 223, 123, 16, 40, 8, 219, 174, 232,
+ 243, 234, 135, 198, 49, 193, 9, 230, 61, 212, 118, 23, 248, 101, 229, 13,
+ 209, 118, 216, 88, 199, 105, 238, 197, 249, 111, 202, 136, 209, 60, 201,
+ 103, 4, 82, 236, 140, 223, 19, 16, 40, 248, 248, 197, 236, 234, 111, 62,
+ 51, 247, 213, 63, 51, 247, 213, 220, 13, 207, 87, 243, 10, 220, 13, 248,
+ 115, 243, 10, 220, 13, 211, 55, 237, 32, 220, 13, 248, 115, 237, 32, 2,
+ 211, 55, 237, 32, 2, 248, 115, 237, 32, 196, 76, 207, 87, 197, 241, 235,
+ 122, 207, 87, 197, 241, 196, 76, 2, 207, 87, 197, 241, 235, 122, 2, 207,
+ 87, 197, 241, 110, 50, 203, 151, 63, 243, 10, 116, 50, 203, 151, 63, 243,
+ 10, 47, 238, 218, 209, 41, 238, 218, 209, 42, 4, 230, 67, 60, 238, 218,
+ 209, 41, 213, 8, 45, 204, 28, 4, 115, 236, 138, 213, 8, 50, 204, 28, 4,
+ 115, 236, 138, 16, 40, 217, 50, 246, 242, 63, 8, 238, 217, 88, 8, 238,
+ 217, 247, 26, 238, 217, 211, 114, 113, 235, 125, 79, 210, 60, 222, 125,
+ 215, 197, 200, 70, 216, 183, 4, 213, 175, 248, 46, 248, 67, 79, 228, 90,
+ 242, 223, 233, 104, 91, 211, 162, 242, 223, 233, 104, 105, 211, 162, 242,
+ 223, 233, 104, 115, 211, 162, 242, 223, 233, 104, 232, 128, 211, 162,
+ 242, 223, 233, 104, 232, 226, 211, 162, 242, 223, 233, 104, 202, 136,
+ 211, 162, 242, 223, 233, 104, 203, 247, 211, 162, 242, 223, 233, 104,
+ 234, 164, 211, 162, 242, 223, 233, 104, 213, 175, 211, 162, 242, 223,
+ 233, 104, 199, 96, 211, 162, 242, 223, 233, 104, 234, 128, 211, 162, 242,
+ 223, 233, 104, 197, 38, 211, 162, 242, 223, 233, 104, 211, 97, 242, 223,
+ 233, 104, 197, 11, 242, 223, 233, 104, 198, 217, 242, 223, 233, 104, 232,
+ 124, 242, 223, 233, 104, 232, 223, 242, 223, 233, 104, 202, 132, 242,
+ 223, 233, 104, 203, 246, 242, 223, 233, 104, 234, 163, 242, 223, 233,
+ 104, 213, 173, 242, 223, 233, 104, 199, 94, 242, 223, 233, 104, 234, 126,
+ 242, 223, 233, 104, 197, 36, 50, 201, 234, 50, 201, 235, 4, 91, 202, 5,
+ 193, 138, 50, 201, 235, 4, 115, 202, 5, 193, 137, 247, 246, 247, 247, 4,
+ 202, 5, 193, 137, 206, 186, 248, 235, 248, 96, 247, 123, 217, 75, 242,
+ 222, 62, 202, 104, 23, 238, 215, 213, 44, 209, 124, 229, 5, 217, 91, 223,
+ 163, 247, 222, 200, 212, 219, 165, 202, 90, 211, 57, 201, 191, 237, 221,
+ 200, 194, 201, 221, 201, 222, 193, 118, 222, 183, 217, 91, 237, 239, 45,
+ 230, 54, 199, 107, 207, 101, 199, 107, 207, 102, 4, 210, 204, 50, 230,
+ 54, 199, 107, 207, 101, 63, 198, 34, 199, 106, 62, 198, 34, 199, 106,
+ 199, 107, 211, 105, 198, 54, 79, 216, 0, 242, 245, 216, 4, 209, 194, 249,
+ 147, 79, 234, 67, 201, 109, 234, 67, 234, 68, 4, 219, 129, 232, 178, 234,
+ 67, 210, 35, 139, 201, 109, 234, 67, 219, 102, 210, 133, 62, 208, 133,
+ 110, 45, 210, 33, 110, 45, 249, 105, 210, 34, 110, 45, 232, 130, 210, 34,
+ 110, 45, 210, 197, 110, 45, 238, 233, 45, 193, 3, 230, 53, 153, 211, 126,
+ 230, 54, 56, 207, 147, 230, 54, 4, 232, 248, 201, 211, 207, 18, 207, 147,
+ 230, 54, 4, 232, 248, 201, 211, 207, 18, 198, 211, 133, 56, 207, 18, 198,
+ 211, 144, 56, 207, 18, 195, 67, 230, 53, 207, 18, 230, 54, 4, 82, 232,
+ 253, 233, 204, 207, 147, 230, 54, 4, 210, 107, 248, 210, 82, 23, 206,
+ 189, 232, 247, 63, 144, 209, 58, 45, 230, 54, 223, 148, 202, 206, 63, 45,
+ 209, 58, 223, 148, 202, 206, 63, 50, 209, 58, 223, 148, 202, 206, 62, 45,
+ 209, 58, 223, 148, 202, 206, 62, 50, 209, 58, 223, 148, 62, 45, 209, 58,
+ 249, 144, 223, 148, 62, 50, 209, 58, 249, 144, 223, 148, 202, 206, 63,
+ 133, 209, 58, 223, 148, 202, 206, 63, 144, 209, 58, 223, 148, 202, 206,
+ 62, 133, 209, 58, 223, 148, 202, 206, 62, 144, 209, 58, 223, 148, 62,
+ 133, 209, 58, 249, 144, 223, 148, 62, 144, 209, 58, 249, 144, 223, 148,
+ 62, 229, 223, 237, 78, 239, 59, 221, 221, 23, 215, 181, 115, 214, 84,
+ 239, 58, 208, 209, 209, 71, 247, 142, 62, 230, 17, 203, 103, 232, 191,
+ 236, 220, 63, 230, 17, 203, 103, 232, 191, 236, 220, 202, 32, 203, 103,
+ 232, 191, 236, 220, 199, 182, 247, 84, 193, 55, 221, 220, 91, 247, 214,
+ 215, 181, 105, 247, 214, 215, 181, 115, 247, 214, 215, 181, 198, 24, 39,
+ 209, 249, 239, 59, 230, 17, 236, 220, 205, 76, 208, 210, 228, 20, 233,
+ 64, 228, 20, 211, 60, 236, 227, 228, 20, 236, 168, 4, 199, 53, 236, 168,
+ 4, 199, 54, 23, 209, 177, 236, 168, 4, 209, 177, 232, 114, 4, 209, 177,
+ 232, 114, 4, 198, 150, 232, 114, 4, 251, 133, 192, 235, 62, 232, 171,
+ 232, 171, 211, 77, 232, 171, 247, 101, 141, 236, 204, 247, 101, 233, 7,
+ 248, 62, 233, 7, 247, 155, 234, 105, 213, 6, 234, 105, 213, 7, 210, 204,
+ 234, 105, 213, 7, 210, 210, 213, 6, 213, 7, 210, 204, 213, 7, 210, 210,
+ 234, 105, 236, 167, 234, 105, 210, 204, 234, 105, 210, 202, 236, 167,
+ 210, 204, 210, 202, 193, 148, 201, 218, 213, 7, 210, 210, 201, 218, 247,
+ 141, 210, 210, 237, 78, 193, 65, 216, 38, 217, 22, 211, 2, 242, 221, 50,
+ 23, 45, 204, 28, 250, 231, 247, 125, 192, 235, 223, 154, 232, 163, 202,
+ 116, 113, 237, 134, 232, 163, 202, 116, 113, 239, 60, 39, 221, 222, 206,
+ 140, 214, 75, 210, 205, 4, 47, 199, 53, 201, 67, 243, 136, 238, 15, 221,
+ 78, 219, 96, 201, 233, 229, 236, 223, 163, 202, 187, 115, 207, 120, 58,
+ 115, 207, 120, 60, 115, 207, 120, 219, 224, 115, 207, 120, 183, 45, 201,
+ 230, 248, 8, 50, 201, 230, 248, 8, 105, 201, 230, 248, 7, 115, 201, 230,
+ 248, 7, 45, 198, 231, 248, 8, 50, 198, 231, 248, 8, 45, 251, 119, 248, 8,
+ 50, 251, 119, 248, 8, 215, 210, 248, 8, 219, 130, 215, 210, 248, 8, 219,
+ 130, 215, 209, 249, 107, 111, 4, 249, 106, 249, 107, 27, 192, 235, 249,
+ 107, 111, 4, 27, 192, 235, 249, 107, 28, 27, 192, 235, 249, 107, 111, 4,
+ 28, 27, 192, 235, 156, 243, 126, 77, 249, 107, 111, 4, 28, 243, 125, 193,
+ 18, 217, 71, 215, 186, 232, 81, 198, 85, 198, 30, 201, 92, 79, 219, 144,
+ 202, 188, 79, 223, 20, 215, 167, 230, 196, 233, 103, 230, 196, 233, 104,
+ 4, 202, 64, 233, 185, 233, 104, 4, 199, 126, 79, 222, 185, 202, 64, 233,
+ 104, 4, 211, 77, 215, 179, 202, 64, 233, 104, 4, 211, 77, 215, 180, 23,
+ 202, 64, 233, 185, 202, 64, 233, 104, 4, 211, 77, 215, 180, 23, 242, 87,
+ 200, 143, 202, 64, 233, 104, 4, 211, 77, 215, 180, 23, 198, 171, 233,
+ 185, 202, 64, 233, 104, 4, 230, 66, 202, 64, 233, 104, 4, 228, 186, 193,
+ 57, 233, 103, 202, 64, 233, 104, 4, 202, 64, 233, 185, 233, 104, 205,
+ 109, 237, 114, 232, 161, 207, 61, 233, 103, 202, 64, 233, 104, 4, 229,
+ 222, 233, 185, 202, 64, 233, 104, 4, 200, 194, 202, 63, 233, 103, 214,
+ 82, 233, 103, 233, 206, 233, 103, 196, 111, 233, 103, 233, 104, 4, 242,
+ 87, 200, 143, 210, 26, 233, 103, 239, 51, 233, 103, 239, 52, 233, 103,
+ 221, 121, 233, 103, 233, 104, 198, 214, 42, 221, 122, 221, 121, 233, 104,
+ 4, 202, 64, 233, 185, 221, 121, 233, 104, 4, 242, 219, 233, 185, 233,
+ 104, 4, 201, 12, 198, 61, 233, 104, 4, 201, 12, 198, 62, 23, 193, 57,
+ 233, 193, 233, 104, 4, 201, 12, 198, 62, 23, 198, 171, 233, 185, 236,
+ 228, 233, 103, 193, 16, 233, 103, 251, 111, 233, 103, 209, 6, 233, 103,
+ 238, 199, 233, 103, 209, 253, 233, 103, 233, 104, 4, 219, 7, 79, 197,
+ 217, 236, 228, 247, 218, 207, 61, 233, 103, 232, 92, 233, 104, 4, 211,
+ 77, 215, 179, 251, 109, 233, 103, 233, 57, 233, 103, 193, 119, 233, 103,
+ 202, 91, 233, 103, 198, 130, 233, 103, 230, 197, 233, 103, 218, 245, 238,
+ 199, 233, 103, 233, 104, 4, 211, 77, 215, 179, 228, 130, 233, 103, 233,
+ 104, 4, 211, 77, 215, 180, 23, 242, 87, 200, 143, 233, 104, 205, 78, 223,
+ 163, 233, 58, 250, 190, 233, 103, 232, 183, 233, 103, 202, 92, 233, 103,
+ 236, 195, 233, 103, 233, 104, 193, 51, 215, 179, 233, 104, 4, 216, 216,
+ 217, 35, 230, 196, 247, 79, 233, 104, 4, 202, 64, 233, 185, 247, 79, 233,
+ 104, 4, 199, 126, 79, 222, 185, 202, 64, 247, 79, 233, 104, 4, 211, 77,
+ 215, 179, 202, 64, 247, 79, 233, 104, 4, 229, 222, 233, 185, 247, 79,
+ 233, 104, 4, 193, 1, 202, 65, 221, 121, 247, 79, 233, 104, 4, 242, 219,
+ 233, 185, 209, 6, 247, 79, 233, 103, 238, 199, 247, 79, 233, 103, 193,
+ 119, 247, 79, 233, 103, 202, 84, 232, 92, 233, 103, 202, 84, 202, 64,
+ 233, 103, 196, 72, 233, 103, 233, 104, 4, 206, 138, 233, 185, 233, 104,
+ 4, 213, 44, 230, 244, 231, 132, 233, 104, 4, 211, 126, 231, 132, 209,
+ 251, 248, 68, 237, 129, 205, 49, 215, 225, 229, 226, 215, 225, 201, 236,
+ 215, 225, 230, 20, 209, 251, 207, 145, 91, 230, 53, 209, 251, 207, 145,
+ 248, 80, 230, 29, 223, 163, 247, 28, 209, 251, 232, 91, 209, 251, 4, 209,
+ 6, 233, 103, 209, 251, 4, 232, 172, 230, 28, 186, 193, 105, 209, 58, 219,
+ 233, 202, 2, 193, 105, 209, 58, 219, 233, 186, 234, 204, 209, 58, 219,
+ 233, 202, 2, 234, 204, 209, 58, 219, 233, 153, 186, 193, 105, 209, 58,
+ 219, 233, 153, 202, 2, 193, 105, 209, 58, 219, 233, 153, 186, 234, 204,
+ 209, 58, 219, 233, 153, 202, 2, 234, 204, 209, 58, 219, 233, 186, 193,
+ 105, 209, 58, 195, 48, 219, 233, 202, 2, 193, 105, 209, 58, 195, 48, 219,
+ 233, 186, 234, 204, 209, 58, 195, 48, 219, 233, 202, 2, 234, 204, 209,
+ 58, 195, 48, 219, 233, 88, 186, 193, 105, 209, 58, 195, 48, 219, 233, 88,
+ 202, 2, 193, 105, 209, 58, 195, 48, 219, 233, 88, 186, 234, 204, 209, 58,
+ 195, 48, 219, 233, 88, 202, 2, 234, 204, 209, 58, 195, 48, 219, 233, 186,
+ 193, 105, 209, 58, 248, 4, 202, 2, 193, 105, 209, 58, 248, 4, 186, 234,
+ 204, 209, 58, 248, 4, 202, 2, 234, 204, 209, 58, 248, 4, 88, 186, 193,
+ 105, 209, 58, 248, 4, 88, 202, 2, 193, 105, 209, 58, 248, 4, 88, 186,
+ 234, 204, 209, 58, 248, 4, 88, 202, 2, 234, 204, 209, 58, 248, 4, 229, 4,
+ 208, 6, 51, 211, 42, 229, 4, 208, 6, 51, 211, 43, 223, 163, 62, 201, 190,
+ 202, 25, 208, 6, 51, 211, 42, 202, 25, 208, 6, 51, 211, 43, 223, 163, 62,
+ 201, 190, 118, 206, 146, 196, 66, 206, 146, 96, 206, 146, 235, 119, 206,
+ 146, 27, 34, 234, 0, 211, 42, 88, 27, 34, 234, 0, 211, 42, 34, 211, 77,
+ 234, 0, 211, 42, 88, 34, 211, 77, 234, 0, 211, 42, 88, 251, 138, 211, 42,
+ 200, 146, 251, 138, 211, 42, 49, 88, 55, 153, 242, 75, 207, 252, 87, 211,
+ 42, 49, 88, 55, 242, 75, 207, 252, 87, 211, 42, 49, 88, 130, 55, 242, 75,
+ 207, 252, 87, 211, 42, 88, 223, 103, 211, 42, 49, 223, 103, 211, 42, 88,
+ 49, 223, 103, 211, 42, 195, 83, 88, 202, 23, 195, 83, 88, 207, 19, 202,
+ 23, 243, 124, 248, 107, 207, 19, 243, 124, 248, 107, 206, 146, 229, 205,
+ 201, 85, 219, 32, 207, 152, 247, 102, 229, 131, 198, 16, 229, 131, 198,
+ 17, 4, 247, 249, 213, 13, 198, 16, 216, 158, 156, 207, 153, 201, 93, 198,
+ 14, 198, 15, 247, 102, 247, 223, 211, 101, 247, 223, 197, 212, 247, 224,
+ 201, 63, 216, 42, 251, 142, 232, 244, 234, 87, 209, 50, 247, 102, 211,
+ 101, 209, 50, 247, 102, 199, 155, 211, 101, 199, 155, 250, 150, 211, 101,
+ 250, 150, 207, 94, 195, 145, 237, 110, 197, 203, 250, 225, 218, 254, 198,
+ 23, 215, 218, 215, 185, 207, 151, 200, 164, 207, 151, 215, 185, 247, 154,
+ 252, 11, 198, 13, 203, 65, 206, 112, 201, 228, 228, 241, 198, 20, 219,
+ 132, 81, 198, 20, 219, 132, 239, 37, 56, 209, 50, 247, 86, 207, 12, 219,
+ 132, 197, 238, 232, 218, 211, 105, 209, 19, 236, 144, 213, 44, 234, 73,
+ 56, 202, 62, 113, 213, 44, 202, 62, 113, 208, 132, 219, 84, 223, 163,
+ 223, 50, 209, 108, 113, 236, 175, 213, 12, 219, 84, 113, 209, 13, 193,
+ 144, 113, 213, 28, 193, 144, 113, 248, 184, 213, 44, 248, 183, 248, 182,
+ 215, 185, 248, 182, 210, 51, 213, 44, 210, 50, 243, 85, 238, 209, 216,
+ 182, 113, 193, 32, 113, 207, 28, 249, 149, 113, 198, 86, 193, 144, 242,
+ 216, 203, 20, 249, 61, 249, 59, 210, 91, 239, 21, 238, 156, 249, 126,
+ 242, 246, 45, 218, 215, 197, 242, 4, 206, 113, 239, 0, 208, 196, 56, 47,
+ 223, 137, 202, 3, 248, 59, 113, 231, 27, 113, 238, 248, 23, 220, 25, 202,
+ 92, 252, 57, 203, 43, 249, 125, 248, 234, 248, 235, 249, 2, 209, 108, 79,
+ 193, 15, 211, 159, 56, 203, 43, 197, 213, 201, 8, 210, 201, 229, 127,
+ 199, 98, 228, 129, 234, 130, 193, 54, 209, 96, 202, 87, 193, 93, 206,
+ 189, 247, 233, 230, 62, 23, 193, 9, 203, 78, 211, 132, 235, 94, 215, 189,
+ 207, 152, 198, 25, 215, 192, 248, 106, 196, 76, 216, 54, 251, 223, 196,
+ 76, 251, 223, 196, 76, 2, 251, 223, 2, 251, 223, 213, 17, 251, 223, 251,
+ 224, 237, 93, 251, 224, 250, 238, 205, 118, 211, 101, 232, 244, 234, 87,
+ 237, 22, 219, 32, 210, 95, 203, 65, 205, 83, 215, 192, 205, 83, 247, 113,
+ 202, 94, 232, 178, 205, 113, 202, 111, 250, 152, 206, 243, 209, 178, 197,
+ 203, 206, 139, 202, 112, 160, 16, 40, 208, 2, 160, 16, 40, 251, 225, 160,
+ 16, 40, 232, 243, 160, 16, 40, 234, 207, 160, 16, 40, 193, 143, 160, 16,
+ 40, 251, 35, 160, 16, 40, 251, 36, 207, 81, 160, 16, 40, 251, 36, 207,
+ 80, 160, 16, 40, 251, 36, 195, 31, 160, 16, 40, 251, 36, 195, 30, 160,
+ 16, 40, 195, 45, 160, 16, 40, 195, 44, 160, 16, 40, 195, 43, 160, 16, 40,
+ 200, 205, 160, 16, 40, 209, 203, 200, 205, 160, 16, 40, 62, 200, 205,
+ 160, 16, 40, 216, 181, 200, 236, 160, 16, 40, 216, 181, 200, 235, 160,
+ 16, 40, 216, 181, 200, 234, 160, 16, 40, 243, 13, 160, 16, 40, 205, 158,
+ 160, 16, 40, 213, 161, 160, 16, 40, 195, 28, 160, 16, 40, 195, 27, 160,
+ 16, 40, 206, 148, 205, 158, 160, 16, 40, 206, 148, 205, 157, 160, 16, 40,
+ 230, 250, 160, 16, 40, 202, 184, 160, 16, 40, 223, 74, 211, 49, 160, 16,
+ 40, 223, 74, 211, 48, 160, 16, 40, 238, 222, 79, 223, 73, 160, 16, 40,
+ 207, 77, 79, 223, 73, 160, 16, 40, 239, 12, 211, 49, 160, 16, 40, 223,
+ 72, 211, 49, 160, 16, 40, 200, 237, 79, 239, 11, 160, 16, 40, 238, 222,
+ 79, 239, 11, 160, 16, 40, 238, 222, 79, 239, 10, 160, 16, 40, 239, 12,
+ 251, 79, 160, 16, 40, 205, 159, 79, 239, 12, 251, 79, 160, 16, 40, 200,
+ 237, 79, 205, 159, 79, 239, 11, 160, 16, 40, 195, 139, 160, 16, 40, 198,
+ 143, 211, 49, 160, 16, 40, 219, 237, 211, 49, 160, 16, 40, 251, 78, 211,
+ 49, 160, 16, 40, 200, 237, 79, 251, 77, 160, 16, 40, 205, 159, 79, 251,
+ 77, 160, 16, 40, 200, 237, 79, 205, 159, 79, 251, 77, 160, 16, 40, 195,
+ 46, 79, 251, 77, 160, 16, 40, 207, 77, 79, 251, 77, 160, 16, 40, 207, 77,
+ 79, 251, 76, 160, 16, 40, 207, 76, 160, 16, 40, 207, 75, 160, 16, 40,
+ 207, 74, 160, 16, 40, 207, 73, 160, 16, 40, 251, 177, 160, 16, 40, 251,
+ 176, 160, 16, 40, 217, 61, 160, 16, 40, 205, 168, 160, 16, 40, 250, 230,
+ 160, 16, 40, 207, 105, 160, 16, 40, 207, 104, 160, 16, 40, 250, 154, 160,
+ 16, 40, 248, 150, 211, 49, 160, 16, 40, 199, 177, 160, 16, 40, 199, 176,
+ 160, 16, 40, 208, 8, 219, 121, 160, 16, 40, 248, 87, 160, 16, 40, 248,
+ 86, 160, 16, 40, 248, 85, 160, 16, 40, 251, 151, 160, 16, 40, 211, 131,
+ 160, 16, 40, 201, 214, 160, 16, 40, 198, 141, 160, 16, 40, 230, 158, 160,
+ 16, 40, 193, 131, 160, 16, 40, 209, 1, 160, 16, 40, 247, 137, 160, 16,
+ 40, 197, 50, 160, 16, 40, 247, 104, 215, 198, 160, 16, 40, 205, 93, 79,
+ 222, 187, 160, 16, 40, 247, 151, 160, 16, 40, 197, 235, 160, 16, 40, 201,
+ 100, 197, 235, 160, 16, 40, 219, 31, 160, 16, 40, 202, 37, 160, 16, 40,
+ 196, 54, 160, 16, 40, 228, 184, 235, 71, 160, 16, 40, 250, 204, 160, 16,
+ 40, 209, 15, 250, 204, 160, 16, 40, 248, 31, 160, 16, 40, 209, 0, 248,
+ 31, 160, 16, 40, 251, 148, 160, 16, 40, 201, 46, 200, 186, 201, 45, 160,
+ 16, 40, 201, 46, 200, 186, 201, 44, 160, 16, 40, 200, 233, 160, 16, 40,
+ 208, 229, 160, 16, 40, 236, 215, 160, 16, 40, 236, 217, 160, 16, 40, 236,
+ 216, 160, 16, 40, 208, 141, 160, 16, 40, 208, 129, 160, 16, 40, 238, 207,
+ 160, 16, 40, 238, 206, 160, 16, 40, 238, 205, 160, 16, 40, 238, 204, 160,
+ 16, 40, 238, 203, 160, 16, 40, 251, 191, 160, 16, 40, 249, 62, 79, 217,
+ 42, 160, 16, 40, 249, 62, 79, 195, 174, 160, 16, 40, 207, 26, 160, 16,
+ 40, 228, 176, 160, 16, 40, 213, 190, 160, 16, 40, 237, 203, 160, 16, 40,
+ 215, 213, 160, 16, 40, 132, 235, 109, 160, 16, 40, 132, 211, 17, 218,
+ 250, 79, 232, 137, 211, 164, 218, 207, 234, 194, 230, 1, 217, 101, 230,
+ 246, 208, 24, 211, 52, 62, 219, 219, 223, 56, 50, 197, 241, 62, 196, 76,
+ 223, 56, 50, 197, 241, 62, 206, 203, 223, 56, 50, 197, 241, 62, 235, 122,
+ 223, 56, 50, 197, 241, 62, 202, 84, 2, 243, 10, 216, 213, 28, 63, 243,
+ 10, 28, 63, 243, 10, 88, 63, 243, 10, 195, 83, 88, 63, 243, 10, 233, 197,
+ 88, 63, 243, 10, 63, 243, 11, 239, 33, 62, 2, 243, 10, 206, 115, 199,
+ 178, 62, 198, 138, 201, 190, 62, 202, 84, 2, 201, 190, 156, 63, 201, 190,
+ 216, 213, 63, 201, 190, 28, 63, 201, 190, 88, 63, 201, 190, 195, 83, 88,
+ 63, 201, 190, 233, 197, 88, 63, 201, 190, 63, 51, 239, 33, 62, 195, 83,
+ 2, 201, 190, 63, 51, 239, 33, 62, 216, 213, 201, 190, 51, 199, 178, 62,
+ 198, 138, 237, 32, 62, 195, 83, 2, 237, 32, 62, 216, 213, 2, 237, 32, 63,
+ 237, 33, 239, 33, 62, 195, 83, 2, 237, 32, 63, 237, 33, 239, 33, 62, 216,
+ 213, 237, 32, 237, 33, 199, 178, 62, 198, 138, 218, 232, 62, 195, 83, 2,
+ 218, 232, 62, 216, 213, 2, 218, 232, 63, 218, 233, 239, 33, 62, 2, 218,
+ 232, 199, 4, 35, 238, 217, 156, 35, 238, 217, 216, 213, 35, 238, 217, 28,
+ 35, 238, 217, 195, 83, 28, 35, 238, 217, 195, 83, 88, 35, 238, 217, 233,
+ 197, 88, 35, 238, 217, 199, 4, 205, 154, 156, 205, 154, 216, 213, 205,
+ 154, 28, 205, 154, 88, 205, 154, 195, 83, 88, 205, 154, 233, 197, 88,
+ 205, 154, 156, 232, 226, 201, 206, 250, 193, 216, 213, 232, 226, 201,
+ 206, 250, 193, 28, 232, 226, 201, 206, 250, 193, 88, 232, 226, 201, 206,
+ 250, 193, 195, 83, 88, 232, 226, 201, 206, 250, 193, 233, 197, 88, 232,
+ 226, 201, 206, 250, 193, 156, 202, 136, 201, 206, 250, 193, 216, 213,
+ 202, 136, 201, 206, 250, 193, 28, 202, 136, 201, 206, 250, 193, 88, 202,
+ 136, 201, 206, 250, 193, 195, 83, 88, 202, 136, 201, 206, 250, 193, 233,
+ 197, 88, 202, 136, 201, 206, 250, 193, 156, 234, 164, 201, 206, 250, 193,
+ 216, 213, 234, 164, 201, 206, 250, 193, 28, 234, 164, 201, 206, 250, 193,
+ 88, 234, 164, 201, 206, 250, 193, 195, 83, 88, 234, 164, 201, 206, 250,
+ 193, 156, 115, 209, 60, 62, 201, 102, 216, 213, 115, 209, 60, 62, 201,
+ 102, 115, 209, 60, 62, 201, 102, 216, 213, 115, 209, 60, 209, 130, 201,
+ 102, 156, 232, 128, 209, 60, 62, 201, 102, 216, 213, 232, 128, 209, 60,
+ 62, 201, 102, 232, 128, 209, 60, 62, 201, 102, 216, 213, 232, 128, 209,
+ 60, 209, 130, 201, 102, 207, 19, 156, 232, 128, 209, 60, 209, 130, 201,
+ 102, 156, 232, 226, 209, 60, 62, 201, 102, 88, 232, 226, 209, 60, 62,
+ 201, 102, 216, 213, 202, 136, 209, 60, 62, 201, 102, 88, 202, 136, 209,
+ 60, 62, 201, 102, 202, 136, 209, 60, 209, 130, 201, 102, 216, 213, 234,
+ 164, 209, 60, 62, 201, 102, 88, 234, 164, 209, 60, 62, 201, 102, 195, 83,
+ 88, 234, 164, 209, 60, 62, 201, 102, 88, 234, 164, 209, 60, 209, 130,
+ 201, 102, 156, 197, 38, 209, 60, 62, 201, 102, 88, 197, 38, 209, 60, 62,
+ 201, 102, 88, 197, 38, 209, 60, 209, 130, 201, 102, 47, 197, 241, 214,
+ 106, 47, 197, 241, 47, 201, 190, 214, 106, 47, 201, 190, 213, 175, 209,
+ 60, 63, 201, 102, 220, 13, 211, 55, 243, 10, 220, 13, 192, 73, 243, 10,
+ 220, 13, 230, 201, 243, 10, 220, 13, 208, 138, 243, 10, 220, 13, 248, 19,
+ 243, 10, 220, 13, 207, 87, 201, 190, 220, 13, 248, 115, 201, 190, 220,
+ 13, 211, 55, 201, 190, 220, 13, 192, 73, 201, 190, 220, 13, 230, 201,
+ 201, 190, 220, 13, 208, 138, 201, 190, 220, 13, 248, 19, 201, 190, 88,
+ 234, 43, 56, 118, 64, 4, 2, 197, 242, 250, 235, 196, 66, 64, 4, 2, 197,
+ 242, 250, 235, 96, 64, 4, 2, 197, 242, 250, 235, 235, 119, 64, 4, 2, 197,
+ 242, 250, 235, 118, 64, 4, 216, 213, 197, 242, 250, 235, 196, 66, 64, 4,
+ 216, 213, 197, 242, 250, 235, 96, 64, 4, 216, 213, 197, 242, 250, 235,
+ 235, 119, 64, 4, 216, 213, 197, 242, 250, 235, 118, 64, 4, 220, 13, 197,
+ 242, 250, 235, 196, 66, 64, 4, 220, 13, 197, 242, 250, 235, 96, 64, 4,
+ 220, 13, 197, 242, 250, 235, 235, 119, 64, 4, 220, 13, 197, 242, 250,
+ 235, 118, 64, 4, 2, 234, 37, 250, 235, 196, 66, 64, 4, 2, 234, 37, 250,
+ 235, 96, 64, 4, 2, 234, 37, 250, 235, 235, 119, 64, 4, 2, 234, 37, 250,
+ 235, 118, 64, 4, 234, 37, 250, 235, 196, 66, 64, 4, 234, 37, 250, 235,
+ 96, 64, 4, 234, 37, 250, 235, 235, 119, 64, 4, 234, 37, 250, 235, 88,
+ 118, 64, 4, 234, 37, 250, 235, 88, 196, 66, 64, 4, 234, 37, 250, 235, 88,
+ 96, 64, 4, 234, 37, 250, 235, 88, 235, 119, 64, 4, 234, 37, 250, 235, 88,
+ 118, 64, 4, 220, 13, 234, 37, 250, 235, 88, 196, 66, 64, 4, 220, 13, 234,
+ 37, 250, 235, 88, 96, 64, 4, 220, 13, 234, 37, 250, 235, 88, 235, 119,
+ 64, 4, 220, 13, 234, 37, 250, 235, 118, 197, 240, 64, 4, 214, 215, 203,
+ 149, 196, 66, 197, 240, 64, 4, 214, 215, 203, 149, 96, 197, 240, 64, 4,
+ 214, 215, 203, 149, 235, 119, 197, 240, 64, 4, 214, 215, 203, 149, 118,
+ 197, 240, 64, 4, 216, 213, 203, 149, 196, 66, 197, 240, 64, 4, 216, 213,
+ 203, 149, 96, 197, 240, 64, 4, 216, 213, 203, 149, 235, 119, 197, 240,
+ 64, 4, 216, 213, 203, 149, 118, 197, 240, 64, 4, 28, 203, 149, 196, 66,
+ 197, 240, 64, 4, 28, 203, 149, 96, 197, 240, 64, 4, 28, 203, 149, 235,
+ 119, 197, 240, 64, 4, 28, 203, 149, 118, 197, 240, 64, 4, 88, 203, 149,
+ 196, 66, 197, 240, 64, 4, 88, 203, 149, 96, 197, 240, 64, 4, 88, 203,
+ 149, 235, 119, 197, 240, 64, 4, 88, 203, 149, 118, 197, 240, 64, 4, 195,
+ 83, 88, 203, 149, 196, 66, 197, 240, 64, 4, 195, 83, 88, 203, 149, 96,
+ 197, 240, 64, 4, 195, 83, 88, 203, 149, 235, 119, 197, 240, 64, 4, 195,
+ 83, 88, 203, 149, 118, 232, 251, 57, 196, 66, 232, 251, 57, 96, 232, 251,
+ 57, 235, 119, 232, 251, 57, 118, 112, 57, 196, 66, 112, 57, 96, 112, 57,
+ 235, 119, 112, 57, 118, 239, 61, 57, 196, 66, 239, 61, 57, 96, 239, 61,
+ 57, 235, 119, 239, 61, 57, 118, 88, 239, 61, 57, 196, 66, 88, 239, 61,
+ 57, 96, 88, 239, 61, 57, 235, 119, 88, 239, 61, 57, 118, 88, 57, 196, 66,
+ 88, 57, 96, 88, 57, 235, 119, 88, 57, 118, 49, 57, 196, 66, 49, 57, 96,
+ 49, 57, 235, 119, 49, 57, 186, 193, 105, 49, 57, 186, 234, 204, 49, 57,
+ 202, 2, 234, 204, 49, 57, 202, 2, 193, 105, 49, 57, 45, 50, 49, 57, 133,
+ 144, 49, 57, 193, 77, 118, 156, 181, 57, 193, 77, 196, 66, 156, 181, 57,
+ 193, 77, 96, 156, 181, 57, 193, 77, 235, 119, 156, 181, 57, 193, 77, 186,
+ 193, 105, 156, 181, 57, 193, 77, 186, 234, 204, 156, 181, 57, 193, 77,
+ 202, 2, 234, 204, 156, 181, 57, 193, 77, 202, 2, 193, 105, 156, 181, 57,
+ 193, 77, 118, 181, 57, 193, 77, 196, 66, 181, 57, 193, 77, 96, 181, 57,
+ 193, 77, 235, 119, 181, 57, 193, 77, 186, 193, 105, 181, 57, 193, 77,
+ 186, 234, 204, 181, 57, 193, 77, 202, 2, 234, 204, 181, 57, 193, 77, 202,
+ 2, 193, 105, 181, 57, 193, 77, 118, 216, 213, 181, 57, 193, 77, 196, 66,
+ 216, 213, 181, 57, 193, 77, 96, 216, 213, 181, 57, 193, 77, 235, 119,
+ 216, 213, 181, 57, 193, 77, 186, 193, 105, 216, 213, 181, 57, 193, 77,
+ 186, 234, 204, 216, 213, 181, 57, 193, 77, 202, 2, 234, 204, 216, 213,
+ 181, 57, 193, 77, 202, 2, 193, 105, 216, 213, 181, 57, 193, 77, 118, 88,
+ 181, 57, 193, 77, 196, 66, 88, 181, 57, 193, 77, 96, 88, 181, 57, 193,
+ 77, 235, 119, 88, 181, 57, 193, 77, 186, 193, 105, 88, 181, 57, 193, 77,
+ 186, 234, 204, 88, 181, 57, 193, 77, 202, 2, 234, 204, 88, 181, 57, 193,
+ 77, 202, 2, 193, 105, 88, 181, 57, 193, 77, 118, 195, 83, 88, 181, 57,
+ 193, 77, 196, 66, 195, 83, 88, 181, 57, 193, 77, 96, 195, 83, 88, 181,
+ 57, 193, 77, 235, 119, 195, 83, 88, 181, 57, 193, 77, 186, 193, 105, 195,
+ 83, 88, 181, 57, 193, 77, 186, 234, 204, 195, 83, 88, 181, 57, 193, 77,
+ 202, 2, 234, 204, 195, 83, 88, 181, 57, 193, 77, 202, 2, 193, 105, 195,
+ 83, 88, 181, 57, 118, 197, 242, 250, 235, 196, 66, 197, 242, 250, 235,
+ 96, 197, 242, 250, 235, 235, 119, 197, 242, 250, 235, 118, 63, 64, 193,
+ 53, 197, 242, 250, 235, 196, 66, 63, 64, 193, 53, 197, 242, 250, 235, 96,
+ 63, 64, 193, 53, 197, 242, 250, 235, 235, 119, 63, 64, 193, 53, 197, 242,
+ 250, 235, 118, 64, 4, 213, 8, 199, 215, 196, 66, 64, 4, 213, 8, 199, 215,
+ 96, 64, 4, 213, 8, 199, 215, 235, 119, 64, 4, 213, 8, 199, 215, 88, 64,
+ 203, 150, 193, 75, 107, 88, 64, 203, 150, 193, 75, 105, 198, 253, 88, 64,
+ 203, 150, 193, 75, 91, 230, 70, 88, 64, 203, 150, 193, 75, 91, 199, 0,
+ 118, 248, 74, 63, 57, 96, 248, 77, 203, 152, 63, 57, 118, 198, 54, 203,
+ 152, 63, 57, 96, 198, 54, 203, 152, 63, 57, 118, 219, 218, 63, 57, 96,
+ 206, 202, 63, 57, 118, 206, 202, 63, 57, 96, 219, 218, 63, 57, 118, 249,
+ 145, 203, 151, 63, 57, 96, 249, 145, 203, 151, 63, 57, 118, 232, 95, 203,
+ 151, 63, 57, 96, 232, 95, 203, 151, 63, 57, 63, 64, 203, 150, 193, 75,
+ 107, 63, 64, 203, 150, 193, 75, 105, 198, 253, 64, 209, 58, 196, 66, 199,
+ 25, 186, 193, 104, 64, 209, 58, 96, 199, 25, 238, 161, 202, 2, 193, 104,
+ 47, 238, 218, 232, 143, 4, 232, 128, 236, 138, 47, 238, 218, 232, 143, 4,
+ 105, 236, 138, 47, 238, 218, 232, 142, 45, 132, 243, 11, 4, 232, 128,
+ 236, 138, 45, 132, 243, 11, 4, 115, 236, 138, 45, 132, 243, 11, 4, 105,
+ 236, 138, 45, 132, 243, 11, 4, 236, 140, 45, 132, 243, 10, 235, 120, 233,
+ 96, 102, 235, 120, 233, 96, 213, 8, 102, 235, 120, 233, 96, 228, 251, 4,
+ 236, 140, 235, 120, 233, 96, 213, 8, 228, 251, 4, 236, 140, 209, 136,
+ 232, 247, 63, 229, 223, 248, 19, 229, 223, 209, 135, 230, 53, 191, 17,
+ 233, 103, 215, 229, 233, 103, 233, 104, 4, 199, 21, 214, 92, 233, 103,
+ 199, 2, 233, 103, 233, 104, 4, 229, 234, 206, 150, 233, 103, 228, 150,
+ 233, 103, 3, 79, 199, 34, 228, 186, 247, 139, 216, 233, 230, 53, 207,
+ 147, 249, 147, 79, 230, 53, 219, 223, 232, 231, 206, 207, 232, 231, 230,
+ 27, 230, 54, 4, 141, 23, 82, 232, 248, 238, 213, 228, 74, 218, 242, 191,
+ 239, 230, 54, 56, 233, 104, 4, 238, 238, 230, 9, 242, 208, 233, 103, 214,
+ 202, 233, 103, 206, 138, 211, 105, 199, 34, 232, 194, 219, 255, 235, 100,
+ 233, 103, 218, 178, 233, 103, 233, 104, 210, 182, 202, 56, 233, 103, 233,
+ 104, 4, 91, 233, 192, 207, 146, 230, 196, 233, 104, 4, 201, 103, 233,
+ 185, 230, 196, 233, 104, 4, 91, 220, 13, 23, 91, 2, 233, 193, 233, 104,
+ 4, 232, 253, 238, 241, 242, 219, 219, 96, 204, 2, 233, 104, 4, 200, 77,
+ 238, 241, 215, 179, 202, 64, 233, 104, 4, 202, 64, 233, 186, 23, 230, 54,
+ 238, 241, 215, 179, 233, 104, 4, 211, 77, 215, 180, 195, 9, 203, 54, 233,
+ 104, 4, 233, 208, 229, 235, 208, 226, 193, 35, 248, 40, 210, 181, 133,
+ 198, 87, 204, 31, 208, 214, 217, 91, 223, 163, 197, 46, 215, 194, 243,
+ 55, 203, 9, 209, 251, 236, 159, 247, 83, 222, 177, 233, 38, 215, 255,
+ 210, 21, 193, 8, 193, 144, 209, 44, 230, 32, 236, 201, 217, 35, 193, 69,
+ 232, 186, 235, 95, 4, 235, 93, 242, 226, 231, 15, 197, 74, 231, 16, 201,
+ 203, 231, 1, 214, 85, 206, 208, 232, 238, 209, 108, 216, 219, 205, 57,
+ 209, 108, 216, 219, 199, 1, 209, 108, 216, 219, 248, 61, 231, 10, 217,
+ 46, 250, 223, 196, 94, 238, 172, 201, 65, 220, 110, 201, 75, 23, 249,
+ 111, 202, 31, 232, 178, 236, 226, 238, 221, 250, 141, 238, 188, 249, 138,
+ 209, 12, 247, 87, 249, 124, 248, 43, 230, 201, 205, 165, 203, 142, 210,
+ 167, 79, 232, 161, 201, 9, 232, 205, 234, 179, 231, 17, 79, 216, 53, 210,
+ 56, 221, 116, 210, 163, 235, 76, 232, 138, 239, 16, 199, 207, 248, 62,
+ 243, 62, 248, 67, 4, 201, 203, 238, 182, 4, 201, 43, 242, 93, 248, 23,
+ 209, 176, 208, 218, 238, 155, 79, 216, 224, 205, 137, 247, 115, 232, 161,
+ 219, 232, 230, 200, 217, 82, 215, 206, 247, 146, 249, 127, 202, 64, 233,
+ 104, 4, 202, 64, 233, 186, 23, 115, 229, 221, 192, 87, 233, 103, 202, 64,
+ 233, 104, 4, 199, 131, 233, 104, 4, 210, 102, 228, 188, 23, 210, 102,
+ 230, 9, 233, 104, 4, 196, 98, 233, 186, 23, 193, 135, 215, 179, 211, 5,
+ 233, 103, 232, 107, 233, 103, 213, 168, 236, 224, 233, 103, 233, 104,
+ 229, 6, 249, 147, 199, 125, 233, 104, 4, 209, 93, 233, 185, 205, 125,
+ 220, 119, 242, 96, 230, 253, 229, 129, 248, 91, 232, 207, 203, 52, 238,
+ 235, 219, 100, 233, 103, 205, 81, 197, 62, 196, 96, 233, 103, 234, 214,
+ 235, 85, 249, 64, 203, 128, 210, 249, 232, 120, 233, 103, 247, 215, 237,
+ 128, 230, 235, 219, 78, 207, 5, 203, 13, 201, 184, 231, 29, 233, 103,
+ 191, 85, 233, 103, 229, 216, 205, 110, 200, 42, 238, 224, 222, 82, 219,
+ 70, 210, 58, 229, 121, 210, 108, 207, 173, 219, 41, 215, 196, 216, 90,
+ 249, 133, 200, 148, 217, 92, 236, 165, 202, 78, 211, 22, 211, 54, 202,
+ 102, 232, 209, 210, 239, 249, 4, 248, 149, 205, 61, 230, 163, 236, 162,
+ 208, 202, 247, 117, 234, 109, 242, 64, 207, 87, 230, 78, 234, 109, 242,
+ 64, 238, 171, 230, 78, 234, 109, 242, 64, 249, 113, 234, 109, 242, 64,
+ 63, 230, 78, 248, 98, 219, 212, 232, 159, 198, 56, 200, 184, 200, 179,
+ 205, 188, 195, 81, 234, 212, 4, 229, 225, 251, 235, 215, 190, 193, 91,
+ 217, 74, 193, 91, 216, 223, 250, 250, 216, 223, 219, 212, 243, 118, 193,
+ 116, 238, 180, 205, 159, 203, 146, 248, 208, 248, 62, 231, 197, 211, 93,
+ 233, 85, 193, 174, 247, 216, 217, 29, 235, 104, 228, 27, 238, 190, 248,
+ 9, 199, 134, 197, 214, 201, 105, 209, 250, 221, 80, 209, 250, 237, 144,
+ 209, 250, 233, 104, 4, 215, 224, 252, 29, 243, 86, 211, 118, 252, 29,
+ 249, 8, 209, 250, 209, 251, 4, 229, 230, 209, 251, 223, 163, 201, 82,
+ 206, 130, 209, 251, 242, 228, 209, 251, 223, 163, 218, 247, 209, 24, 217,
+ 124, 233, 87, 195, 177, 216, 174, 234, 125, 231, 148, 191, 5, 248, 50,
+ 211, 55, 229, 223, 248, 171, 247, 111, 205, 94, 231, 9, 242, 96, 202, 34,
+ 207, 87, 231, 43, 234, 67, 232, 242, 222, 238, 208, 125, 209, 175, 199,
+ 75, 197, 84, 209, 235, 236, 222, 236, 176, 55, 229, 204, 242, 69, 252,
+ 71, 232, 244, 233, 202, 198, 58, 248, 31, 217, 122, 218, 215, 218, 248,
+ 248, 78, 201, 204, 79, 198, 227, 249, 112, 79, 192, 100, 205, 188, 209,
+ 139, 199, 124, 249, 9, 248, 20, 249, 69, 206, 141, 79, 210, 135, 249, 88,
+ 79, 202, 37, 201, 205, 207, 103, 214, 196, 251, 134, 214, 82, 243, 105,
+ 221, 138, 214, 82, 243, 105, 208, 14, 214, 82, 243, 105, 206, 131, 214,
+ 82, 243, 105, 248, 152, 214, 82, 243, 105, 221, 76, 214, 82, 243, 105,
+ 210, 74, 63, 243, 105, 221, 77, 206, 122, 232, 134, 237, 124, 62, 243,
+ 105, 221, 77, 206, 122, 232, 134, 237, 124, 214, 82, 243, 105, 221, 77,
+ 206, 122, 232, 134, 237, 124, 63, 243, 105, 221, 139, 206, 122, 213, 170,
+ 237, 124, 63, 243, 105, 208, 15, 206, 122, 213, 170, 237, 124, 63, 243,
+ 105, 206, 132, 206, 122, 213, 170, 237, 124, 63, 243, 105, 248, 153, 206,
+ 122, 213, 170, 237, 124, 63, 243, 105, 221, 77, 206, 122, 213, 170, 237,
+ 124, 63, 243, 105, 210, 75, 206, 122, 213, 170, 237, 124, 62, 243, 105,
+ 221, 139, 206, 122, 213, 170, 237, 124, 62, 243, 105, 208, 15, 206, 122,
+ 213, 170, 237, 124, 62, 243, 105, 206, 132, 206, 122, 213, 170, 237, 124,
+ 62, 243, 105, 248, 153, 206, 122, 213, 170, 237, 124, 62, 243, 105, 221,
+ 77, 206, 122, 213, 170, 237, 124, 62, 243, 105, 210, 75, 206, 122, 213,
+ 170, 237, 124, 214, 82, 243, 105, 221, 139, 206, 122, 213, 170, 237, 124,
+ 214, 82, 243, 105, 208, 15, 206, 122, 213, 170, 237, 124, 214, 82, 243,
+ 105, 206, 132, 206, 122, 213, 170, 237, 124, 214, 82, 243, 105, 248, 153,
+ 206, 122, 213, 170, 237, 124, 214, 82, 243, 105, 221, 77, 206, 122, 213,
+ 170, 237, 124, 214, 82, 243, 105, 210, 75, 206, 122, 213, 170, 237, 124,
+ 63, 243, 105, 221, 77, 206, 122, 91, 228, 141, 198, 248, 237, 124, 62,
+ 243, 105, 221, 77, 206, 122, 91, 228, 141, 198, 248, 237, 124, 214, 82,
+ 243, 105, 221, 77, 206, 122, 91, 228, 141, 198, 248, 237, 124, 63, 243,
+ 105, 153, 221, 138, 63, 243, 105, 153, 208, 14, 63, 243, 105, 153, 206,
+ 131, 63, 243, 105, 153, 248, 152, 63, 243, 105, 153, 221, 76, 63, 243,
+ 105, 153, 210, 74, 62, 243, 105, 153, 221, 138, 62, 243, 105, 153, 208,
+ 14, 62, 243, 105, 153, 206, 131, 62, 243, 105, 153, 248, 152, 62, 243,
+ 105, 153, 221, 76, 62, 243, 105, 153, 210, 74, 214, 82, 243, 105, 153,
+ 221, 138, 214, 82, 243, 105, 153, 208, 14, 214, 82, 243, 105, 153, 206,
+ 131, 214, 82, 243, 105, 153, 248, 152, 214, 82, 243, 105, 153, 221, 76,
+ 214, 82, 243, 105, 153, 210, 74, 63, 243, 105, 221, 77, 206, 122, 105,
+ 228, 141, 197, 29, 237, 124, 62, 243, 105, 221, 77, 206, 122, 105, 228,
+ 141, 197, 29, 237, 124, 214, 82, 243, 105, 221, 77, 206, 122, 105, 228,
+ 141, 197, 29, 237, 124, 63, 243, 105, 221, 139, 206, 122, 105, 228, 141,
+ 203, 242, 237, 124, 63, 243, 105, 208, 15, 206, 122, 105, 228, 141, 203,
+ 242, 237, 124, 63, 243, 105, 206, 132, 206, 122, 105, 228, 141, 203, 242,
+ 237, 124, 63, 243, 105, 248, 153, 206, 122, 105, 228, 141, 203, 242, 237,
+ 124, 63, 243, 105, 221, 77, 206, 122, 105, 228, 141, 203, 242, 237, 124,
+ 63, 243, 105, 210, 75, 206, 122, 105, 228, 141, 203, 242, 237, 124, 62,
+ 243, 105, 221, 139, 206, 122, 105, 228, 141, 203, 242, 237, 124, 62, 243,
+ 105, 208, 15, 206, 122, 105, 228, 141, 203, 242, 237, 124, 62, 243, 105,
+ 206, 132, 206, 122, 105, 228, 141, 203, 242, 237, 124, 62, 243, 105, 248,
+ 153, 206, 122, 105, 228, 141, 203, 242, 237, 124, 62, 243, 105, 221, 77,
+ 206, 122, 105, 228, 141, 203, 242, 237, 124, 62, 243, 105, 210, 75, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 214, 82, 243, 105, 221, 139, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 214, 82, 243, 105, 208, 15, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 214, 82, 243, 105, 206, 132, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 214, 82, 243, 105, 248, 153, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 214, 82, 243, 105, 221, 77, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 214, 82, 243, 105, 210, 75, 206,
+ 122, 105, 228, 141, 203, 242, 237, 124, 63, 243, 105, 221, 77, 206, 122,
+ 115, 228, 141, 233, 20, 237, 124, 62, 243, 105, 221, 77, 206, 122, 115,
+ 228, 141, 233, 20, 237, 124, 214, 82, 243, 105, 221, 77, 206, 122, 115,
+ 228, 141, 233, 20, 237, 124, 63, 243, 105, 234, 38, 62, 243, 105, 234,
+ 38, 214, 82, 243, 105, 234, 38, 63, 243, 105, 234, 39, 206, 122, 213,
+ 170, 237, 124, 62, 243, 105, 234, 39, 206, 122, 213, 170, 237, 124, 214,
+ 82, 243, 105, 234, 39, 206, 122, 213, 170, 237, 124, 63, 243, 105, 221,
+ 74, 63, 243, 105, 221, 73, 63, 243, 105, 221, 75, 62, 243, 105, 221, 74,
+ 62, 243, 105, 221, 73, 62, 243, 105, 221, 75, 192, 205, 207, 87, 231,
+ 150, 192, 205, 207, 87, 217, 84, 192, 205, 207, 87, 234, 131, 192, 205,
+ 207, 87, 228, 183, 192, 205, 207, 87, 243, 138, 192, 205, 207, 87, 247,
+ 114, 192, 205, 207, 87, 202, 26, 192, 205, 62, 231, 150, 192, 205, 62,
+ 217, 84, 192, 205, 62, 234, 131, 192, 205, 62, 228, 183, 192, 205, 62,
+ 243, 138, 192, 205, 62, 247, 114, 192, 205, 62, 202, 26, 249, 110, 203,
+ 51, 211, 98, 200, 135, 248, 27, 203, 25, 198, 237, 205, 139, 156, 248,
+ 115, 229, 223, 230, 198, 229, 223, 209, 131, 229, 223, 235, 99, 79, 248,
+ 120, 252, 35, 249, 96, 201, 76, 192, 234, 238, 201, 191, 253, 221, 119,
+ 210, 129, 248, 92, 217, 123, 193, 162, 209, 137, 214, 87, 236, 154, 217,
+ 64, 232, 182, 206, 187, 209, 100, 246, 252, 207, 118, 250, 132, 236, 196,
+ 220, 25, 249, 94, 216, 54, 229, 200, 252, 56, 179, 235, 94, 242, 88, 247,
+ 89, 205, 108, 205, 75, 220, 109, 102, 216, 26, 193, 65, 209, 83, 203,
+ 239, 214, 109, 221, 71, 248, 6, 215, 182, 198, 6, 198, 55, 229, 228, 209,
+ 109, 206, 147, 216, 27, 249, 111, 228, 16, 247, 100, 130, 249, 58, 230,
+ 60, 232, 170, 230, 54, 233, 80, 230, 79, 209, 180, 221, 203, 232, 179,
+ 193, 17, 248, 251, 242, 95, 209, 11, 209, 99, 193, 28, 233, 54, 218, 246,
+ 239, 4, 234, 105, 214, 89, 214, 90, 4, 234, 178, 228, 92, 223, 2, 193,
+ 61, 230, 243, 251, 129, 229, 223, 218, 205, 210, 20, 228, 149, 208, 226,
+ 217, 90, 208, 226, 209, 250, 209, 251, 4, 238, 208, 215, 204, 236, 147,
+ 248, 113, 248, 236, 210, 15, 211, 115, 232, 205, 199, 196, 232, 165, 199,
+ 132, 209, 7, 219, 92, 249, 11, 223, 18, 231, 36, 206, 128, 210, 62, 209,
+ 70, 216, 195, 233, 103, 205, 153, 233, 103, 233, 104, 4, 211, 77, 233,
+ 186, 23, 230, 54, 139, 215, 179, 233, 104, 4, 210, 47, 233, 193, 233,
+ 104, 4, 237, 39, 215, 179, 235, 138, 219, 113, 233, 103, 248, 145, 219,
+ 98, 248, 7, 203, 145, 233, 103, 230, 54, 4, 141, 232, 253, 23, 176, 238,
+ 213, 96, 230, 53, 118, 230, 53, 210, 183, 144, 230, 53, 210, 183, 133,
+ 230, 53, 141, 209, 58, 250, 183, 199, 34, 195, 55, 229, 224, 230, 28,
+ 118, 208, 135, 230, 53, 96, 208, 135, 230, 53, 184, 203, 236, 184, 203,
+ 206, 184, 203, 235, 184, 203, 191, 184, 203, 220, 184, 203, 205, 184,
+ 203, 234, 184, 203, 183, 184, 203, 213, 184, 203, 197, 184, 203, 227,
+ 184, 203, 190, 184, 203, 219, 184, 203, 204, 184, 203, 233, 184, 203,
+ 179, 184, 203, 209, 184, 203, 194, 184, 203, 223, 184, 203, 186, 184,
+ 203, 200, 184, 203, 230, 184, 203, 182, 184, 203, 212, 184, 203, 196,
+ 184, 203, 226, 184, 203, 189, 184, 203, 218, 184, 203, 203, 184, 203,
+ 232, 184, 203, 177, 184, 203, 207, 184, 203, 192, 184, 203, 221, 184,
+ 203, 184, 184, 203, 214, 184, 203, 198, 184, 203, 228, 184, 203, 180,
+ 184, 203, 210, 184, 203, 224, 184, 203, 187, 184, 203, 216, 184, 203,
+ 201, 184, 203, 231, 184, 203, 178, 184, 203, 208, 184, 203, 193, 184,
+ 203, 222, 184, 203, 185, 184, 203, 215, 184, 203, 199, 184, 203, 229,
+ 184, 203, 181, 184, 203, 211, 184, 203, 195, 184, 203, 225, 184, 203,
+ 188, 184, 203, 217, 184, 203, 202, 110, 45, 184, 237, 39, 110, 82, 45,
+ 119, 110, 247, 21, 110, 45, 184, 237, 39, 110, 82, 45, 119, 110, 183,
+ 110, 45, 184, 237, 39, 116, 82, 45, 119, 110, 247, 21, 110, 45, 184, 237,
+ 39, 116, 82, 45, 119, 110, 183, 110, 45, 184, 237, 39, 116, 45, 119, 110,
+ 247, 21, 110, 50, 184, 237, 39, 116, 82, 45, 119, 116, 247, 21, 110, 50,
+ 184, 237, 39, 116, 82, 45, 119, 116, 183, 110, 50, 184, 237, 39, 110, 82,
+ 45, 119, 116, 247, 21, 110, 50, 184, 237, 39, 110, 82, 45, 119, 116, 183,
+ 110, 50, 184, 237, 39, 110, 45, 119, 116, 247, 21, 110, 50, 184, 237, 39,
+ 110, 82, 45, 119, 116, 82, 183, 110, 50, 184, 237, 39, 110, 247, 22, 119,
+ 110, 82, 183, 110, 50, 184, 237, 39, 110, 45, 119, 110, 82, 183, 110, 50,
+ 184, 237, 39, 110, 247, 22, 119, 116, 82, 183, 110, 50, 184, 237, 39,
+ 110, 45, 119, 116, 82, 183, 110, 50, 184, 237, 39, 110, 247, 22, 119,
+ 116, 183, 110, 45, 184, 237, 39, 116, 247, 22, 119, 116, 82, 183, 110,
+ 45, 184, 237, 39, 116, 45, 119, 116, 82, 183, 110, 45, 184, 237, 39, 116,
+ 247, 22, 119, 110, 82, 183, 110, 45, 184, 237, 39, 116, 45, 119, 110, 82,
+ 183, 110, 45, 184, 237, 39, 116, 247, 22, 119, 110, 183, 110, 45, 184,
+ 237, 39, 116, 82, 45, 119, 110, 82, 183, 116, 50, 184, 237, 39, 110, 82,
+ 45, 119, 110, 247, 21, 116, 50, 184, 237, 39, 110, 82, 45, 119, 110, 183,
+ 116, 50, 184, 237, 39, 116, 82, 45, 119, 110, 247, 21, 116, 50, 184, 237,
+ 39, 116, 82, 45, 119, 110, 183, 116, 50, 184, 237, 39, 116, 45, 119, 110,
+ 247, 21, 116, 45, 184, 237, 39, 116, 82, 45, 119, 116, 247, 21, 116, 45,
+ 184, 237, 39, 116, 82, 45, 119, 116, 183, 116, 45, 184, 237, 39, 110, 82,
+ 45, 119, 116, 247, 21, 116, 45, 184, 237, 39, 110, 82, 45, 119, 116, 183,
+ 116, 45, 184, 237, 39, 110, 45, 119, 116, 247, 21, 116, 45, 184, 237, 39,
+ 110, 82, 45, 119, 116, 82, 183, 116, 45, 184, 237, 39, 110, 247, 22, 119,
+ 110, 82, 183, 116, 45, 184, 237, 39, 110, 45, 119, 110, 82, 183, 116, 45,
+ 184, 237, 39, 110, 247, 22, 119, 116, 82, 183, 116, 45, 184, 237, 39,
+ 110, 45, 119, 116, 82, 183, 116, 45, 184, 237, 39, 110, 247, 22, 119,
+ 116, 183, 116, 50, 184, 237, 39, 116, 247, 22, 119, 116, 82, 183, 116,
+ 50, 184, 237, 39, 116, 45, 119, 116, 82, 183, 116, 50, 184, 237, 39, 116,
+ 247, 22, 119, 110, 82, 183, 116, 50, 184, 237, 39, 116, 45, 119, 110, 82,
+ 183, 116, 50, 184, 237, 39, 116, 247, 22, 119, 110, 183, 116, 50, 184,
+ 237, 39, 116, 82, 45, 119, 110, 82, 183, 116, 23, 50, 23, 110, 197, 238,
+ 115, 208, 21, 248, 129, 45, 23, 110, 23, 50, 197, 238, 115, 208, 21, 248,
+ 129, 116, 23, 45, 23, 110, 197, 238, 115, 208, 21, 248, 129, 45, 23, 116,
+ 23, 50, 197, 238, 115, 208, 21, 248, 129, 45, 197, 238, 91, 208, 23, 248,
+ 129, 116, 197, 238, 91, 208, 23, 248, 129, 50, 197, 238, 91, 208, 23,
+ 248, 129, 110, 197, 238, 91, 208, 23, 248, 129, 81, 91, 234, 160, 248,
+ 127, 81, 91, 234, 160, 248, 126, 81, 91, 234, 160, 248, 125, 81, 91, 234,
+ 160, 248, 124, 81, 91, 234, 160, 248, 123, 81, 91, 234, 160, 248, 122,
+ 228, 241, 91, 234, 160, 248, 127, 228, 241, 91, 234, 160, 248, 126, 228,
+ 241, 91, 234, 160, 248, 125, 228, 241, 91, 234, 160, 248, 124, 228, 241,
+ 91, 234, 160, 248, 123, 228, 241, 91, 234, 160, 248, 122, 45, 23, 110,
+ 91, 234, 160, 248, 129, 45, 23, 116, 91, 234, 160, 248, 129, 50, 23, 116,
+ 91, 234, 160, 248, 129, 50, 23, 110, 91, 234, 160, 248, 129, 116, 23,
+ 110, 91, 234, 160, 248, 129, 228, 241, 91, 234, 160, 248, 128, 116, 91,
+ 208, 23, 248, 129, 116, 115, 234, 158, 248, 129, 116, 232, 226, 234, 158,
+ 248, 129, 116, 115, 208, 21, 248, 129, 116, 203, 247, 234, 158, 248, 129,
+ 50, 91, 208, 23, 248, 129, 50, 115, 234, 158, 248, 129, 50, 232, 226,
+ 234, 158, 248, 129, 50, 115, 208, 21, 248, 129, 50, 203, 247, 234, 158,
+ 248, 129, 45, 132, 216, 213, 203, 153, 50, 132, 216, 213, 203, 153, 116,
+ 132, 216, 213, 203, 153, 110, 132, 216, 213, 203, 153, 223, 95, 216, 213,
+ 203, 153, 116, 132, 184, 23, 110, 132, 223, 95, 216, 213, 203, 153, 116,
+ 132, 223, 95, 216, 213, 203, 154, 23, 110, 132, 248, 129, 45, 132, 223,
+ 95, 216, 213, 203, 154, 23, 50, 132, 248, 129, 243, 124, 248, 108, 233,
+ 5, 223, 95, 243, 124, 248, 108, 233, 5, 88, 228, 241, 233, 5, 116, 45,
+ 119, 110, 50, 233, 5, 116, 50, 119, 110, 45, 233, 5, 116, 23, 110, 197,
+ 238, 132, 248, 129, 45, 23, 50, 197, 238, 132, 248, 129, 116, 45, 197,
+ 238, 216, 213, 203, 153, 116, 50, 197, 238, 216, 213, 203, 153, 110, 50,
+ 197, 238, 216, 213, 203, 153, 110, 45, 197, 238, 216, 213, 203, 153, 111,
+ 122, 156, 237, 39, 116, 247, 22, 119, 82, 219, 224, 111, 122, 156, 237,
+ 39, 116, 247, 22, 119, 82, 183, 111, 122, 156, 237, 39, 82, 45, 119, 110,
+ 247, 21, 111, 122, 156, 237, 39, 82, 50, 119, 110, 247, 21, 111, 122,
+ 156, 237, 39, 116, 247, 22, 119, 82, 45, 119, 110, 247, 21, 111, 122,
+ 156, 237, 39, 116, 247, 22, 119, 82, 50, 119, 110, 247, 21, 111, 122,
+ 156, 237, 39, 82, 45, 119, 110, 247, 22, 119, 82, 183, 111, 122, 156,
+ 237, 39, 82, 45, 119, 116, 247, 22, 119, 82, 183, 111, 122, 156, 237, 39,
+ 116, 247, 22, 119, 82, 45, 23, 82, 50, 119, 110, 247, 21, 111, 122, 156,
+ 237, 39, 116, 247, 22, 119, 82, 50, 23, 82, 45, 119, 110, 247, 21, 111,
+ 122, 156, 237, 39, 116, 247, 22, 119, 82, 50, 119, 110, 247, 22, 119, 82,
+ 219, 224, 111, 122, 156, 237, 39, 116, 247, 22, 119, 82, 45, 119, 110,
+ 247, 22, 119, 82, 183, 111, 122, 156, 237, 39, 82, 45, 119, 116, 247, 22,
+ 119, 82, 50, 119, 110, 247, 21, 111, 122, 156, 237, 39, 82, 50, 119, 116,
+ 247, 22, 119, 82, 45, 119, 110, 247, 21, 111, 122, 156, 237, 39, 237, 32,
+ 111, 122, 156, 228, 241, 4, 81, 106, 250, 234, 209, 59, 223, 95, 243,
+ 126, 77, 45, 132, 206, 42, 217, 90, 50, 132, 206, 42, 217, 90, 223, 95,
+ 235, 119, 64, 4, 198, 136, 219, 214, 118, 64, 23, 116, 23, 110, 91, 234,
+ 160, 248, 129, 96, 64, 23, 116, 23, 110, 91, 234, 160, 248, 129, 235,
+ 119, 64, 23, 50, 91, 234, 160, 248, 129, 196, 66, 64, 23, 50, 91, 234,
+ 160, 248, 129, 45, 132, 232, 171, 50, 132, 232, 171, 195, 16, 35, 238,
+ 217, 50, 211, 77, 112, 236, 140, 214, 106, 237, 39, 238, 217, 214, 106,
+ 237, 39, 82, 50, 119, 110, 247, 21, 214, 106, 237, 39, 237, 32, 63, 88,
+ 205, 155, 4, 206, 113, 239, 0, 45, 199, 1, 63, 50, 209, 58, 223, 148, 82,
+ 199, 1, 63, 50, 209, 58, 223, 148, 50, 199, 1, 63, 50, 209, 58, 223, 148,
+ 214, 106, 112, 208, 13, 77, 201, 75, 233, 12, 201, 75, 233, 13, 4, 250,
+ 247, 207, 146, 201, 75, 233, 13, 219, 231, 219, 224, 201, 75, 233, 13,
+ 219, 231, 183, 201, 75, 233, 13, 4, 235, 106, 63, 196, 76, 243, 100, 205,
+ 42, 17, 191, 77, 205, 42, 17, 107, 205, 42, 17, 109, 205, 42, 17, 138,
+ 205, 42, 17, 134, 205, 42, 17, 149, 205, 42, 17, 169, 205, 42, 17, 175,
+ 205, 42, 17, 171, 205, 42, 17, 178, 12, 15, 228, 13, 12, 15, 228, 12, 12,
+ 15, 228, 11, 12, 15, 228, 10, 12, 15, 228, 9, 12, 15, 228, 8, 12, 15,
+ 228, 7, 12, 15, 228, 6, 12, 15, 228, 5, 12, 15, 228, 4, 12, 15, 228, 3,
+ 12, 15, 228, 2, 12, 15, 228, 1, 12, 15, 228, 0, 12, 15, 227, 255, 12, 15,
+ 227, 254, 12, 15, 227, 253, 12, 15, 227, 252, 12, 15, 227, 251, 12, 15,
+ 227, 250, 12, 15, 227, 249, 12, 15, 227, 248, 12, 15, 227, 247, 12, 15,
+ 227, 246, 12, 15, 227, 245, 12, 15, 227, 244, 12, 15, 227, 243, 12, 15,
+ 227, 242, 12, 15, 227, 241, 12, 15, 227, 240, 12, 15, 227, 239, 12, 15,
+ 227, 238, 12, 15, 227, 237, 12, 15, 227, 236, 12, 15, 227, 235, 12, 15,
+ 227, 234, 12, 15, 227, 233, 12, 15, 227, 232, 12, 15, 227, 231, 12, 15,
+ 227, 230, 12, 15, 227, 229, 12, 15, 227, 228, 12, 15, 227, 227, 12, 15,
+ 227, 226, 12, 15, 227, 225, 12, 15, 227, 224, 12, 15, 227, 223, 12, 15,
+ 227, 222, 12, 15, 227, 221, 12, 15, 227, 220, 12, 15, 227, 219, 12, 15,
+ 227, 218, 12, 15, 227, 217, 12, 15, 227, 216, 12, 15, 227, 215, 12, 15,
+ 227, 214, 12, 15, 227, 213, 12, 15, 227, 212, 12, 15, 227, 211, 12, 15,
+ 227, 210, 12, 15, 227, 209, 12, 15, 227, 208, 12, 15, 227, 207, 12, 15,
+ 227, 206, 12, 15, 227, 205, 12, 15, 227, 204, 12, 15, 227, 203, 12, 15,
+ 227, 202, 12, 15, 227, 201, 12, 15, 227, 200, 12, 15, 227, 199, 12, 15,
+ 227, 198, 12, 15, 227, 197, 12, 15, 227, 196, 12, 15, 227, 195, 12, 15,
+ 227, 194, 12, 15, 227, 193, 12, 15, 227, 192, 12, 15, 227, 191, 12, 15,
+ 227, 190, 12, 15, 227, 189, 12, 15, 227, 188, 12, 15, 227, 187, 12, 15,
+ 227, 186, 12, 15, 227, 185, 12, 15, 227, 184, 12, 15, 227, 183, 12, 15,
+ 227, 182, 12, 15, 227, 181, 12, 15, 227, 180, 12, 15, 227, 179, 12, 15,
+ 227, 178, 12, 15, 227, 177, 12, 15, 227, 176, 12, 15, 227, 175, 12, 15,
+ 227, 174, 12, 15, 227, 173, 12, 15, 227, 172, 12, 15, 227, 171, 12, 15,
+ 227, 170, 12, 15, 227, 169, 12, 15, 227, 168, 12, 15, 227, 167, 12, 15,
+ 227, 166, 12, 15, 227, 165, 12, 15, 227, 164, 12, 15, 227, 163, 12, 15,
+ 227, 162, 12, 15, 227, 161, 12, 15, 227, 160, 12, 15, 227, 159, 12, 15,
+ 227, 158, 12, 15, 227, 157, 12, 15, 227, 156, 12, 15, 227, 155, 12, 15,
+ 227, 154, 12, 15, 227, 153, 12, 15, 227, 152, 12, 15, 227, 151, 12, 15,
+ 227, 150, 12, 15, 227, 149, 12, 15, 227, 148, 12, 15, 227, 147, 12, 15,
+ 227, 146, 12, 15, 227, 145, 12, 15, 227, 144, 12, 15, 227, 143, 12, 15,
+ 227, 142, 12, 15, 227, 141, 12, 15, 227, 140, 12, 15, 227, 139, 12, 15,
+ 227, 138, 12, 15, 227, 137, 12, 15, 227, 136, 12, 15, 227, 135, 12, 15,
+ 227, 134, 12, 15, 227, 133, 12, 15, 227, 132, 12, 15, 227, 131, 12, 15,
+ 227, 130, 12, 15, 227, 129, 12, 15, 227, 128, 12, 15, 227, 127, 12, 15,
+ 227, 126, 12, 15, 227, 125, 12, 15, 227, 124, 12, 15, 227, 123, 12, 15,
+ 227, 122, 12, 15, 227, 121, 12, 15, 227, 120, 12, 15, 227, 119, 12, 15,
+ 227, 118, 12, 15, 227, 117, 12, 15, 227, 116, 12, 15, 227, 115, 12, 15,
+ 227, 114, 12, 15, 227, 113, 12, 15, 227, 112, 12, 15, 227, 111, 12, 15,
+ 227, 110, 12, 15, 227, 109, 12, 15, 227, 108, 12, 15, 227, 107, 12, 15,
+ 227, 106, 12, 15, 227, 105, 12, 15, 227, 104, 12, 15, 227, 103, 12, 15,
+ 227, 102, 12, 15, 227, 101, 12, 15, 227, 100, 12, 15, 227, 99, 12, 15,
+ 227, 98, 12, 15, 227, 97, 12, 15, 227, 96, 12, 15, 227, 95, 12, 15, 227,
+ 94, 12, 15, 227, 93, 12, 15, 227, 92, 12, 15, 227, 91, 12, 15, 227, 90,
+ 12, 15, 227, 89, 12, 15, 227, 88, 12, 15, 227, 87, 12, 15, 227, 86, 12,
+ 15, 227, 85, 12, 15, 227, 84, 12, 15, 227, 83, 12, 15, 227, 82, 12, 15,
+ 227, 81, 12, 15, 227, 80, 12, 15, 227, 79, 12, 15, 227, 78, 12, 15, 227,
+ 77, 12, 15, 227, 76, 12, 15, 227, 75, 12, 15, 227, 74, 12, 15, 227, 73,
+ 12, 15, 227, 72, 12, 15, 227, 71, 12, 15, 227, 70, 12, 15, 227, 69, 12,
+ 15, 227, 68, 12, 15, 227, 67, 12, 15, 227, 66, 12, 15, 227, 65, 12, 15,
+ 227, 64, 12, 15, 227, 63, 12, 15, 227, 62, 12, 15, 227, 61, 12, 15, 227,
+ 60, 12, 15, 227, 59, 12, 15, 227, 58, 12, 15, 227, 57, 12, 15, 227, 56,
+ 12, 15, 227, 55, 12, 15, 227, 54, 12, 15, 227, 53, 12, 15, 227, 52, 12,
+ 15, 227, 51, 12, 15, 227, 50, 12, 15, 227, 49, 12, 15, 227, 48, 12, 15,
+ 227, 47, 12, 15, 227, 46, 12, 15, 227, 45, 12, 15, 227, 44, 12, 15, 227,
+ 43, 12, 15, 227, 42, 12, 15, 227, 41, 12, 15, 227, 40, 12, 15, 227, 39,
+ 12, 15, 227, 38, 12, 15, 227, 37, 12, 15, 227, 36, 12, 15, 227, 35, 12,
+ 15, 227, 34, 12, 15, 227, 33, 12, 15, 227, 32, 12, 15, 227, 31, 12, 15,
+ 227, 30, 12, 15, 227, 29, 12, 15, 227, 28, 12, 15, 227, 27, 12, 15, 227,
+ 26, 12, 15, 227, 25, 12, 15, 227, 24, 12, 15, 227, 23, 12, 15, 227, 22,
+ 12, 15, 227, 21, 12, 15, 227, 20, 12, 15, 227, 19, 12, 15, 227, 18, 12,
+ 15, 227, 17, 12, 15, 227, 16, 12, 15, 227, 15, 12, 15, 227, 14, 12, 15,
+ 227, 13, 12, 15, 227, 12, 12, 15, 227, 11, 12, 15, 227, 10, 12, 15, 227,
+ 9, 12, 15, 227, 8, 12, 15, 227, 7, 12, 15, 227, 6, 12, 15, 227, 5, 12,
+ 15, 227, 4, 12, 15, 227, 3, 12, 15, 227, 2, 12, 15, 227, 1, 12, 15, 227,
+ 0, 12, 15, 226, 255, 12, 15, 226, 254, 12, 15, 226, 253, 12, 15, 226,
+ 252, 12, 15, 226, 251, 12, 15, 226, 250, 12, 15, 226, 249, 12, 15, 226,
+ 248, 12, 15, 226, 247, 12, 15, 226, 246, 12, 15, 226, 245, 12, 15, 226,
+ 244, 12, 15, 226, 243, 12, 15, 226, 242, 12, 15, 226, 241, 12, 15, 226,
+ 240, 12, 15, 226, 239, 12, 15, 226, 238, 12, 15, 226, 237, 12, 15, 226,
+ 236, 12, 15, 226, 235, 12, 15, 226, 234, 12, 15, 226, 233, 12, 15, 226,
+ 232, 12, 15, 226, 231, 12, 15, 226, 230, 12, 15, 226, 229, 12, 15, 226,
+ 228, 12, 15, 226, 227, 12, 15, 226, 226, 12, 15, 226, 225, 12, 15, 226,
+ 224, 12, 15, 226, 223, 12, 15, 226, 222, 12, 15, 226, 221, 12, 15, 226,
+ 220, 12, 15, 226, 219, 12, 15, 226, 218, 12, 15, 226, 217, 12, 15, 226,
+ 216, 12, 15, 226, 215, 12, 15, 226, 214, 12, 15, 226, 213, 12, 15, 226,
+ 212, 12, 15, 226, 211, 12, 15, 226, 210, 12, 15, 226, 209, 12, 15, 226,
+ 208, 12, 15, 226, 207, 12, 15, 226, 206, 12, 15, 226, 205, 12, 15, 226,
+ 204, 12, 15, 226, 203, 12, 15, 226, 202, 12, 15, 226, 201, 12, 15, 226,
+ 200, 12, 15, 226, 199, 12, 15, 226, 198, 12, 15, 226, 197, 12, 15, 226,
+ 196, 12, 15, 226, 195, 12, 15, 226, 194, 12, 15, 226, 193, 12, 15, 226,
+ 192, 12, 15, 226, 191, 12, 15, 226, 190, 12, 15, 226, 189, 12, 15, 226,
+ 188, 12, 15, 226, 187, 12, 15, 226, 186, 12, 15, 226, 185, 12, 15, 226,
+ 184, 12, 15, 226, 183, 12, 15, 226, 182, 12, 15, 226, 181, 12, 15, 226,
+ 180, 12, 15, 226, 179, 12, 15, 226, 178, 12, 15, 226, 177, 12, 15, 226,
+ 176, 12, 15, 226, 175, 12, 15, 226, 174, 12, 15, 226, 173, 12, 15, 226,
+ 172, 12, 15, 226, 171, 12, 15, 226, 170, 12, 15, 226, 169, 12, 15, 226,
+ 168, 12, 15, 226, 167, 12, 15, 226, 166, 12, 15, 226, 165, 12, 15, 226,
+ 164, 12, 15, 226, 163, 12, 15, 226, 162, 12, 15, 226, 161, 12, 15, 226,
+ 160, 12, 15, 226, 159, 12, 15, 226, 158, 12, 15, 226, 157, 12, 15, 226,
+ 156, 12, 15, 226, 155, 12, 15, 226, 154, 12, 15, 226, 153, 12, 15, 226,
+ 152, 12, 15, 226, 151, 12, 15, 226, 150, 12, 15, 226, 149, 12, 15, 226,
+ 148, 12, 15, 226, 147, 12, 15, 226, 146, 12, 15, 226, 145, 12, 15, 226,
+ 144, 12, 15, 226, 143, 12, 15, 226, 142, 12, 15, 226, 141, 12, 15, 226,
+ 140, 12, 15, 226, 139, 12, 15, 226, 138, 12, 15, 226, 137, 12, 15, 226,
+ 136, 12, 15, 226, 135, 12, 15, 226, 134, 12, 15, 226, 133, 12, 15, 226,
+ 132, 12, 15, 226, 131, 12, 15, 226, 130, 12, 15, 226, 129, 12, 15, 226,
+ 128, 12, 15, 226, 127, 12, 15, 226, 126, 12, 15, 226, 125, 12, 15, 226,
+ 124, 12, 15, 226, 123, 12, 15, 226, 122, 12, 15, 226, 121, 12, 15, 226,
+ 120, 12, 15, 226, 119, 12, 15, 226, 118, 12, 15, 226, 117, 12, 15, 226,
+ 116, 12, 15, 226, 115, 12, 15, 226, 114, 12, 15, 226, 113, 12, 15, 226,
+ 112, 12, 15, 226, 111, 12, 15, 226, 110, 12, 15, 226, 109, 12, 15, 226,
+ 108, 12, 15, 226, 107, 12, 15, 226, 106, 12, 15, 226, 105, 12, 15, 226,
+ 104, 12, 15, 226, 103, 12, 15, 226, 102, 12, 15, 226, 101, 12, 15, 226,
+ 100, 12, 15, 226, 99, 12, 15, 226, 98, 12, 15, 226, 97, 12, 15, 226, 96,
+ 12, 15, 226, 95, 12, 15, 226, 94, 12, 15, 226, 93, 12, 15, 226, 92, 12,
+ 15, 226, 91, 12, 15, 226, 90, 12, 15, 226, 89, 12, 15, 226, 88, 12, 15,
+ 226, 87, 12, 15, 226, 86, 12, 15, 226, 85, 12, 15, 226, 84, 12, 15, 226,
+ 83, 12, 15, 226, 82, 12, 15, 226, 81, 12, 15, 226, 80, 12, 15, 226, 79,
+ 12, 15, 226, 78, 12, 15, 226, 77, 12, 15, 226, 76, 12, 15, 226, 75, 12,
+ 15, 226, 74, 12, 15, 226, 73, 12, 15, 226, 72, 12, 15, 226, 71, 12, 15,
+ 226, 70, 12, 15, 226, 69, 12, 15, 226, 68, 12, 15, 226, 67, 12, 15, 226,
+ 66, 12, 15, 226, 65, 12, 15, 226, 64, 12, 15, 226, 63, 12, 15, 226, 62,
+ 12, 15, 226, 61, 12, 15, 226, 60, 12, 15, 226, 59, 12, 15, 226, 58, 12,
+ 15, 226, 57, 12, 15, 226, 56, 12, 15, 226, 55, 12, 15, 226, 54, 12, 15,
+ 226, 53, 12, 15, 226, 52, 12, 15, 226, 51, 12, 15, 226, 50, 12, 15, 226,
+ 49, 12, 15, 226, 48, 12, 15, 226, 47, 12, 15, 226, 46, 12, 15, 226, 45,
+ 12, 15, 226, 44, 12, 15, 226, 43, 12, 15, 226, 42, 12, 15, 226, 41, 12,
+ 15, 226, 40, 12, 15, 226, 39, 12, 15, 226, 38, 12, 15, 226, 37, 12, 15,
+ 226, 36, 12, 15, 226, 35, 12, 15, 226, 34, 12, 15, 226, 33, 12, 15, 226,
+ 32, 12, 15, 226, 31, 12, 15, 226, 30, 12, 15, 226, 29, 12, 15, 226, 28,
+ 12, 15, 226, 27, 12, 15, 226, 26, 12, 15, 226, 25, 12, 15, 226, 24, 12,
+ 15, 226, 23, 12, 15, 226, 22, 12, 15, 226, 21, 12, 15, 226, 20, 12, 15,
+ 226, 19, 12, 15, 226, 18, 12, 15, 226, 17, 12, 15, 226, 16, 12, 15, 226,
+ 15, 12, 15, 226, 14, 12, 15, 226, 13, 12, 15, 226, 12, 12, 15, 226, 11,
+ 12, 15, 226, 10, 12, 15, 226, 9, 12, 15, 226, 8, 12, 15, 226, 7, 12, 15,
+ 226, 6, 12, 15, 226, 5, 12, 15, 226, 4, 12, 15, 226, 3, 12, 15, 226, 2,
+ 12, 15, 226, 1, 12, 15, 226, 0, 12, 15, 225, 255, 12, 15, 225, 254, 12,
+ 15, 225, 253, 12, 15, 225, 252, 12, 15, 225, 251, 12, 15, 225, 250, 12,
+ 15, 225, 249, 12, 15, 225, 248, 12, 15, 225, 247, 12, 15, 225, 246, 12,
+ 15, 225, 245, 12, 15, 225, 244, 12, 15, 225, 243, 12, 15, 225, 242, 12,
+ 15, 225, 241, 12, 15, 225, 240, 220, 20, 199, 223, 199, 224, 201, 247,
+ 199, 224, 233, 216, 77, 199, 224, 207, 252, 77, 199, 224, 31, 56, 199,
+ 224, 236, 155, 56, 199, 224, 210, 13, 56, 199, 224, 251, 137, 199, 224,
+ 251, 49, 199, 224, 45, 210, 113, 199, 224, 50, 210, 113, 199, 224, 250,
+ 193, 199, 224, 108, 56, 199, 224, 242, 74, 199, 224, 228, 87, 199, 224,
+ 232, 80, 201, 63, 199, 224, 202, 23, 199, 224, 17, 191, 77, 199, 224, 17,
+ 107, 199, 224, 17, 109, 199, 224, 17, 138, 199, 224, 17, 134, 199, 224,
+ 17, 149, 199, 224, 17, 169, 199, 224, 17, 175, 199, 224, 17, 171, 199,
+ 224, 17, 178, 199, 224, 242, 83, 199, 224, 204, 25, 199, 224, 219, 180,
+ 56, 199, 224, 234, 43, 56, 199, 224, 230, 204, 56, 199, 224, 208, 13, 77,
+ 199, 224, 242, 72, 250, 182, 199, 224, 8, 6, 1, 65, 199, 224, 8, 6, 1,
+ 250, 120, 199, 224, 8, 6, 1, 247, 193, 199, 224, 8, 6, 1, 238, 127, 199,
+ 224, 8, 6, 1, 71, 199, 224, 8, 6, 1, 233, 175, 199, 224, 8, 6, 1, 232,
+ 51, 199, 224, 8, 6, 1, 230, 116, 199, 224, 8, 6, 1, 68, 199, 224, 8, 6,
+ 1, 223, 35, 199, 224, 8, 6, 1, 222, 152, 199, 224, 8, 6, 1, 172, 199,
+ 224, 8, 6, 1, 218, 168, 199, 224, 8, 6, 1, 215, 61, 199, 224, 8, 6, 1,
+ 74, 199, 224, 8, 6, 1, 210, 236, 199, 224, 8, 6, 1, 208, 104, 199, 224,
+ 8, 6, 1, 146, 199, 224, 8, 6, 1, 206, 8, 199, 224, 8, 6, 1, 200, 43, 199,
+ 224, 8, 6, 1, 66, 199, 224, 8, 6, 1, 196, 12, 199, 224, 8, 6, 1, 193,
+ 224, 199, 224, 8, 6, 1, 192, 235, 199, 224, 8, 6, 1, 192, 159, 199, 224,
+ 8, 6, 1, 191, 166, 199, 224, 45, 51, 248, 53, 199, 224, 207, 19, 202, 23,
+ 199, 224, 50, 51, 248, 53, 199, 224, 243, 2, 252, 60, 199, 224, 130, 219,
+ 112, 199, 224, 230, 211, 252, 60, 199, 224, 8, 2, 1, 65, 199, 224, 8, 2,
+ 1, 250, 120, 199, 224, 8, 2, 1, 247, 193, 199, 224, 8, 2, 1, 238, 127,
+ 199, 224, 8, 2, 1, 71, 199, 224, 8, 2, 1, 233, 175, 199, 224, 8, 2, 1,
+ 232, 51, 199, 224, 8, 2, 1, 230, 116, 199, 224, 8, 2, 1, 68, 199, 224, 8,
+ 2, 1, 223, 35, 199, 224, 8, 2, 1, 222, 152, 199, 224, 8, 2, 1, 172, 199,
+ 224, 8, 2, 1, 218, 168, 199, 224, 8, 2, 1, 215, 61, 199, 224, 8, 2, 1,
+ 74, 199, 224, 8, 2, 1, 210, 236, 199, 224, 8, 2, 1, 208, 104, 199, 224,
+ 8, 2, 1, 146, 199, 224, 8, 2, 1, 206, 8, 199, 224, 8, 2, 1, 200, 43, 199,
+ 224, 8, 2, 1, 66, 199, 224, 8, 2, 1, 196, 12, 199, 224, 8, 2, 1, 193,
+ 224, 199, 224, 8, 2, 1, 192, 235, 199, 224, 8, 2, 1, 192, 159, 199, 224,
+ 8, 2, 1, 191, 166, 199, 224, 45, 238, 171, 248, 53, 199, 224, 81, 219,
+ 112, 199, 224, 50, 238, 171, 248, 53, 199, 224, 198, 152, 247, 127, 199,
+ 223, 67, 204, 211, 67, 204, 200, 67, 204, 189, 67, 204, 177, 67, 204,
+ 166, 67, 204, 155, 67, 204, 144, 67, 204, 133, 67, 204, 122, 67, 204,
+ 114, 67, 204, 113, 67, 204, 112, 67, 204, 111, 67, 204, 109, 67, 204,
+ 108, 67, 204, 107, 67, 204, 106, 67, 204, 105, 67, 204, 104, 67, 204,
+ 103, 67, 204, 102, 67, 204, 101, 67, 204, 100, 67, 204, 98, 67, 204, 97,
+ 67, 204, 96, 67, 204, 95, 67, 204, 94, 67, 204, 93, 67, 204, 92, 67, 204,
+ 91, 67, 204, 90, 67, 204, 89, 67, 204, 87, 67, 204, 86, 67, 204, 85, 67,
+ 204, 84, 67, 204, 83, 67, 204, 82, 67, 204, 81, 67, 204, 80, 67, 204, 79,
+ 67, 204, 78, 67, 204, 76, 67, 204, 75, 67, 204, 74, 67, 204, 73, 67, 204,
+ 72, 67, 204, 71, 67, 204, 70, 67, 204, 69, 67, 204, 68, 67, 204, 67, 67,
+ 204, 65, 67, 204, 64, 67, 204, 63, 67, 204, 62, 67, 204, 61, 67, 204, 60,
+ 67, 204, 59, 67, 204, 58, 67, 204, 57, 67, 204, 56, 67, 204, 54, 67, 204,
+ 53, 67, 204, 52, 67, 204, 51, 67, 204, 50, 67, 204, 49, 67, 204, 48, 67,
+ 204, 47, 67, 204, 46, 67, 204, 45, 67, 204, 43, 67, 204, 42, 67, 204, 41,
+ 67, 204, 40, 67, 204, 39, 67, 204, 38, 67, 204, 37, 67, 204, 36, 67, 204,
+ 35, 67, 204, 34, 67, 205, 31, 67, 205, 30, 67, 205, 29, 67, 205, 28, 67,
+ 205, 27, 67, 205, 26, 67, 205, 25, 67, 205, 24, 67, 205, 23, 67, 205, 22,
+ 67, 205, 20, 67, 205, 19, 67, 205, 18, 67, 205, 17, 67, 205, 16, 67, 205,
+ 15, 67, 205, 14, 67, 205, 13, 67, 205, 12, 67, 205, 11, 67, 205, 9, 67,
+ 205, 8, 67, 205, 7, 67, 205, 6, 67, 205, 5, 67, 205, 4, 67, 205, 3, 67,
+ 205, 2, 67, 205, 1, 67, 205, 0, 67, 204, 254, 67, 204, 253, 67, 204, 252,
+ 67, 204, 251, 67, 204, 250, 67, 204, 249, 67, 204, 248, 67, 204, 247, 67,
+ 204, 246, 67, 204, 245, 67, 204, 243, 67, 204, 242, 67, 204, 241, 67,
+ 204, 240, 67, 204, 239, 67, 204, 238, 67, 204, 237, 67, 204, 236, 67,
+ 204, 235, 67, 204, 234, 67, 204, 232, 67, 204, 231, 67, 204, 230, 67,
+ 204, 229, 67, 204, 228, 67, 204, 227, 67, 204, 226, 67, 204, 225, 67,
+ 204, 224, 67, 204, 223, 67, 204, 221, 67, 204, 220, 67, 204, 219, 67,
+ 204, 218, 67, 204, 217, 67, 204, 216, 67, 204, 215, 67, 204, 214, 67,
+ 204, 213, 67, 204, 212, 67, 204, 210, 67, 204, 209, 67, 204, 208, 67,
+ 204, 207, 67, 204, 206, 67, 204, 205, 67, 204, 204, 67, 204, 203, 67,
+ 204, 202, 67, 204, 201, 67, 204, 199, 67, 204, 198, 67, 204, 197, 67,
+ 204, 196, 67, 204, 195, 67, 204, 194, 67, 204, 193, 67, 204, 192, 67,
+ 204, 191, 67, 204, 190, 67, 204, 188, 67, 204, 187, 67, 204, 186, 67,
+ 204, 185, 67, 204, 184, 67, 204, 183, 67, 204, 182, 67, 204, 181, 67,
+ 204, 180, 67, 204, 179, 67, 204, 176, 67, 204, 175, 67, 204, 174, 67,
+ 204, 173, 67, 204, 172, 67, 204, 171, 67, 204, 170, 67, 204, 169, 67,
+ 204, 168, 67, 204, 167, 67, 204, 165, 67, 204, 164, 67, 204, 163, 67,
+ 204, 162, 67, 204, 161, 67, 204, 160, 67, 204, 159, 67, 204, 158, 67,
+ 204, 157, 67, 204, 156, 67, 204, 154, 67, 204, 153, 67, 204, 152, 67,
+ 204, 151, 67, 204, 150, 67, 204, 149, 67, 204, 148, 67, 204, 147, 67,
+ 204, 146, 67, 204, 145, 67, 204, 143, 67, 204, 142, 67, 204, 141, 67,
+ 204, 140, 67, 204, 139, 67, 204, 138, 67, 204, 137, 67, 204, 136, 67,
+ 204, 135, 67, 204, 134, 67, 204, 132, 67, 204, 131, 67, 204, 130, 67,
+ 204, 129, 67, 204, 128, 67, 204, 127, 67, 204, 126, 67, 204, 125, 67,
+ 204, 124, 67, 204, 123, 67, 204, 121, 67, 204, 120, 67, 204, 119, 67,
+ 204, 118, 67, 204, 117, 67, 204, 116, 67, 204, 115, 212, 138, 212, 140,
+ 201, 98, 79, 229, 232, 202, 27, 201, 98, 79, 199, 53, 201, 6, 234, 95,
+ 79, 199, 53, 233, 244, 234, 95, 79, 198, 11, 234, 57, 234, 81, 234, 82,
+ 252, 51, 252, 52, 251, 189, 248, 238, 249, 140, 248, 16, 246, 240, 199,
+ 230, 228, 241, 199, 230, 228, 165, 199, 236, 219, 113, 233, 50, 214, 80,
+ 219, 112, 234, 95, 79, 219, 112, 219, 161, 213, 105, 234, 60, 219, 113,
+ 199, 230, 81, 199, 230, 193, 251, 232, 146, 233, 50, 233, 27, 247, 88,
+ 207, 22, 238, 236, 203, 77, 211, 14, 219, 33, 107, 202, 46, 203, 77, 223,
+ 162, 219, 33, 191, 77, 202, 222, 237, 210, 219, 103, 234, 14, 236, 185,
+ 237, 75, 239, 22, 107, 237, 199, 237, 75, 239, 22, 109, 237, 198, 237,
+ 75, 239, 22, 138, 237, 197, 237, 75, 239, 22, 134, 237, 196, 214, 106,
+ 252, 51, 214, 233, 200, 69, 223, 228, 200, 73, 234, 95, 79, 198, 12, 248,
+ 129, 233, 252, 247, 126, 247, 128, 234, 95, 79, 216, 212, 234, 58, 234,
+ 114, 200, 226, 200, 245, 234, 14, 234, 15, 223, 137, 204, 11, 134, 233,
+ 7, 204, 10, 232, 90, 223, 137, 204, 11, 138, 230, 187, 204, 10, 230, 184,
+ 223, 137, 204, 11, 109, 207, 98, 204, 10, 206, 74, 223, 137, 204, 11,
+ 107, 196, 91, 204, 10, 196, 45, 201, 250, 237, 116, 237, 118, 210, 208,
+ 246, 239, 210, 210, 137, 211, 158, 208, 220, 228, 244, 248, 42, 210, 1,
+ 229, 192, 248, 58, 213, 44, 248, 42, 229, 192, 214, 191, 223, 148, 223,
+ 150, 214, 73, 219, 112, 214, 104, 201, 98, 79, 205, 36, 251, 8, 201, 175,
+ 234, 95, 79, 205, 36, 251, 8, 234, 17, 246, 240, 199, 231, 203, 252, 228,
+ 241, 199, 231, 203, 252, 228, 162, 246, 240, 199, 231, 4, 222, 164, 228,
+ 241, 199, 231, 4, 222, 164, 228, 163, 219, 113, 199, 231, 203, 252, 81,
+ 199, 231, 203, 252, 193, 250, 210, 105, 219, 113, 232, 132, 210, 105,
+ 219, 113, 235, 123, 209, 94, 210, 105, 219, 113, 249, 139, 210, 105, 219,
+ 113, 196, 77, 209, 88, 207, 19, 219, 113, 233, 50, 207, 19, 223, 148,
+ 207, 1, 202, 170, 203, 77, 109, 202, 167, 201, 177, 202, 170, 203, 77,
+ 138, 202, 166, 201, 176, 237, 75, 239, 22, 201, 30, 237, 194, 208, 205,
+ 196, 44, 107, 208, 205, 196, 42, 208, 164, 208, 205, 196, 44, 109, 208,
+ 205, 196, 41, 208, 163, 203, 253, 198, 10, 201, 95, 201, 13, 247, 127,
+ 246, 239, 247, 61, 216, 169, 193, 171, 215, 81, 201, 98, 79, 230, 172,
+ 251, 8, 201, 98, 79, 208, 182, 251, 8, 201, 249, 234, 95, 79, 230, 172,
+ 251, 8, 234, 95, 79, 208, 182, 251, 8, 234, 55, 201, 98, 79, 201, 30,
+ 202, 9, 202, 170, 230, 216, 246, 240, 223, 96, 203, 170, 202, 170, 246,
+ 240, 223, 96, 205, 85, 239, 22, 204, 7, 223, 96, 238, 196, 201, 31, 199,
+ 80, 201, 118, 211, 68, 200, 58, 242, 73, 211, 34, 208, 206, 216, 168,
+ 209, 76, 251, 45, 208, 198, 242, 73, 251, 62, 214, 179, 202, 231, 8, 6,
+ 1, 231, 91, 8, 2, 1, 231, 91, 247, 4, 9, 2, 137, 34, 131, 4, 99, 249, 80,
+ 251, 166, 200, 63, 200, 232, 242, 84, 202, 110, 219, 224, 222, 81, 1,
+ 219, 62, 220, 17, 1, 232, 176, 232, 166, 220, 17, 1, 232, 176, 233, 62,
+ 220, 17, 1, 206, 162, 220, 17, 1, 219, 43, 86, 87, 248, 141, 203, 50,
+ 231, 54, 216, 118, 207, 9, 30, 125, 192, 54, 30, 125, 192, 50, 30, 125,
+ 201, 153, 30, 125, 192, 55, 232, 66, 232, 65, 232, 64, 215, 83, 232, 63,
+ 200, 197, 1, 251, 14, 68, 190, 232, 190, 233, 190, 235, 218, 229, 206,
+ 170, 218, 231, 206, 172, 210, 66, 218, 228, 206, 169, 213, 75, 216, 16,
+ 193, 50, 218, 230, 206, 171, 232, 89, 210, 65, 193, 111, 234, 119, 232,
+ 76, 216, 92, 211, 105, 196, 46, 113, 216, 92, 237, 216, 113, 118, 197,
+ 240, 64, 4, 55, 81, 106, 96, 197, 240, 64, 4, 55, 81, 106, 11, 5, 223,
+ 51, 77, 80, 1, 221, 206, 219, 73, 194, 251, 194, 140, 194, 72, 194, 61,
+ 194, 50, 194, 39, 194, 28, 194, 17, 194, 6, 194, 250, 194, 239, 194, 228,
+ 194, 217, 194, 206, 194, 195, 194, 184, 208, 221, 232, 146, 40, 81, 50,
+ 63, 219, 187, 248, 53, 247, 198, 211, 51, 77, 248, 100, 190, 234, 10, 3,
+ 212, 148, 199, 84, 10, 3, 212, 148, 139, 212, 148, 247, 231, 139, 247,
+ 230, 216, 218, 6, 1, 230, 116, 216, 218, 6, 1, 214, 70, 216, 218, 2, 1,
+ 230, 116, 216, 218, 2, 1, 214, 70, 61, 1, 235, 14, 73, 37, 16, 232, 88,
+ 202, 106, 243, 52, 195, 164, 194, 173, 194, 162, 194, 151, 194, 139, 194,
+ 128, 194, 117, 194, 106, 194, 95, 194, 84, 194, 76, 194, 75, 194, 74,
+ 194, 73, 194, 71, 194, 70, 194, 69, 194, 68, 194, 67, 194, 66, 194, 65,
+ 194, 64, 194, 63, 194, 62, 194, 60, 194, 59, 194, 58, 194, 57, 194, 56,
+ 194, 55, 194, 54, 194, 53, 194, 52, 194, 51, 194, 49, 194, 48, 194, 47,
+ 194, 46, 194, 45, 194, 44, 194, 43, 194, 42, 194, 41, 194, 40, 194, 38,
+ 194, 37, 194, 36, 194, 35, 194, 34, 194, 33, 194, 32, 194, 31, 194, 30,
+ 194, 29, 194, 27, 194, 26, 194, 25, 194, 24, 194, 23, 194, 22, 194, 21,
+ 194, 20, 194, 19, 194, 18, 194, 16, 194, 15, 194, 14, 194, 13, 194, 12,
+ 194, 11, 194, 10, 194, 9, 194, 8, 194, 7, 194, 5, 194, 4, 194, 3, 194, 2,
+ 194, 1, 194, 0, 193, 255, 193, 254, 193, 253, 193, 252, 194, 249, 194,
+ 248, 194, 247, 194, 246, 194, 245, 194, 244, 194, 243, 194, 242, 194,
+ 241, 194, 240, 194, 238, 194, 237, 194, 236, 194, 235, 194, 234, 194,
+ 233, 194, 232, 194, 231, 194, 230, 194, 229, 194, 227, 194, 226, 194,
+ 225, 194, 224, 194, 223, 194, 222, 194, 221, 194, 220, 194, 219, 194,
+ 218, 194, 216, 194, 215, 194, 214, 194, 213, 194, 212, 194, 211, 194,
+ 210, 194, 209, 194, 208, 194, 207, 194, 205, 194, 204, 194, 203, 194,
+ 202, 194, 201, 194, 200, 194, 199, 194, 198, 194, 197, 194, 196, 194,
+ 194, 194, 193, 194, 192, 194, 191, 194, 190, 194, 189, 194, 188, 194,
+ 187, 194, 186, 194, 185, 194, 183, 194, 182, 194, 181, 194, 180, 194,
+ 179, 194, 178, 194, 177, 194, 176, 194, 175, 194, 174, 194, 172, 194,
+ 171, 194, 170, 194, 169, 194, 168, 194, 167, 194, 166, 194, 165, 194,
+ 164, 194, 163, 194, 161, 194, 160, 194, 159, 194, 158, 194, 157, 194,
+ 156, 194, 155, 194, 154, 194, 153, 194, 152, 194, 150, 194, 149, 194,
+ 148, 194, 147, 194, 146, 194, 145, 194, 144, 194, 143, 194, 142, 194,
+ 141, 194, 138, 194, 137, 194, 136, 194, 135, 194, 134, 194, 133, 194,
+ 132, 194, 131, 194, 130, 194, 129, 194, 127, 194, 126, 194, 125, 194,
+ 124, 194, 123, 194, 122, 194, 121, 194, 120, 194, 119, 194, 118, 194,
+ 116, 194, 115, 194, 114, 194, 113, 194, 112, 194, 111, 194, 110, 194,
+ 109, 194, 108, 194, 107, 194, 105, 194, 104, 194, 103, 194, 102, 194,
+ 101, 194, 100, 194, 99, 194, 98, 194, 97, 194, 96, 194, 94, 194, 93, 194,
+ 92, 194, 91, 194, 90, 194, 89, 194, 88, 194, 87, 194, 86, 194, 85, 194,
+ 83, 194, 82, 194, 81, 194, 80, 194, 79, 194, 78, 194, 77, 221, 219, 31,
+ 56, 221, 219, 250, 193, 221, 219, 17, 191, 77, 221, 219, 17, 107, 221,
+ 219, 17, 109, 221, 219, 17, 138, 221, 219, 17, 134, 221, 219, 17, 149,
+ 221, 219, 17, 169, 221, 219, 17, 175, 221, 219, 17, 171, 221, 219, 17,
+ 178, 8, 6, 1, 42, 4, 217, 147, 23, 230, 210, 8, 2, 1, 42, 4, 217, 147,
+ 23, 230, 210, 8, 6, 1, 228, 74, 4, 217, 147, 23, 230, 210, 8, 2, 1, 228,
+ 74, 4, 217, 147, 23, 230, 210, 8, 6, 1, 126, 4, 217, 147, 23, 230, 210,
+ 8, 2, 1, 126, 4, 217, 147, 23, 230, 210, 8, 6, 1, 235, 15, 4, 81, 219,
+ 113, 60, 8, 2, 1, 235, 15, 4, 81, 219, 113, 60, 8, 6, 1, 235, 15, 4, 81,
+ 219, 113, 248, 233, 23, 230, 210, 8, 2, 1, 235, 15, 4, 81, 219, 113, 248,
+ 233, 23, 230, 210, 8, 6, 1, 235, 15, 4, 81, 219, 113, 248, 233, 23, 252,
+ 46, 8, 2, 1, 235, 15, 4, 81, 219, 113, 248, 233, 23, 252, 46, 8, 6, 1,
+ 187, 4, 81, 219, 113, 60, 8, 2, 1, 187, 4, 81, 219, 113, 60, 8, 6, 1,
+ 187, 4, 81, 219, 113, 248, 233, 23, 230, 210, 8, 2, 1, 187, 4, 81, 219,
+ 113, 248, 233, 23, 230, 210, 8, 6, 1, 187, 4, 81, 219, 113, 248, 233, 23,
+ 252, 46, 8, 2, 1, 187, 4, 81, 219, 113, 248, 233, 23, 252, 46, 8, 6, 1,
+ 206, 9, 4, 81, 219, 113, 60, 8, 2, 1, 206, 9, 4, 81, 219, 113, 60, 8, 6,
+ 1, 235, 15, 4, 243, 2, 23, 217, 146, 8, 2, 1, 235, 15, 4, 243, 2, 23,
+ 217, 146, 8, 6, 1, 235, 15, 4, 243, 2, 23, 247, 92, 8, 2, 1, 235, 15, 4,
+ 243, 2, 23, 247, 92, 8, 2, 1, 228, 74, 4, 75, 93, 23, 252, 46, 8, 2, 1,
+ 214, 71, 4, 198, 153, 58, 8, 6, 1, 42, 4, 211, 139, 23, 252, 46, 8, 2, 1,
+ 42, 4, 211, 139, 23, 252, 46, 8, 6, 1, 42, 4, 211, 139, 23, 198, 152, 8,
+ 2, 1, 42, 4, 211, 139, 23, 198, 152, 8, 6, 1, 235, 15, 4, 211, 139, 23,
+ 252, 46, 8, 2, 1, 235, 15, 4, 211, 139, 23, 252, 46, 8, 6, 1, 235, 15, 4,
+ 211, 139, 23, 198, 152, 8, 2, 1, 235, 15, 4, 211, 139, 23, 198, 152, 8,
+ 6, 1, 235, 15, 4, 75, 93, 23, 252, 46, 8, 2, 1, 235, 15, 4, 75, 93, 23,
+ 252, 46, 8, 6, 1, 235, 15, 4, 75, 93, 23, 198, 152, 8, 2, 1, 235, 15, 4,
+ 75, 93, 23, 198, 152, 8, 2, 1, 228, 74, 4, 75, 93, 23, 230, 210, 8, 2, 1,
+ 228, 74, 4, 75, 93, 23, 198, 152, 8, 6, 1, 228, 74, 4, 211, 139, 23, 252,
+ 46, 8, 2, 1, 228, 74, 4, 211, 139, 23, 75, 93, 23, 252, 46, 8, 6, 1, 228,
+ 74, 4, 211, 139, 23, 198, 152, 8, 2, 1, 228, 74, 4, 211, 139, 23, 75, 93,
+ 23, 198, 152, 8, 6, 1, 223, 36, 4, 198, 152, 8, 2, 1, 223, 36, 4, 75, 93,
+ 23, 198, 152, 8, 6, 1, 220, 143, 4, 198, 152, 8, 2, 1, 220, 143, 4, 198,
+ 152, 8, 6, 1, 218, 169, 4, 198, 152, 8, 2, 1, 218, 169, 4, 198, 152, 8,
+ 6, 1, 207, 222, 4, 198, 152, 8, 2, 1, 207, 222, 4, 198, 152, 8, 6, 1,
+ 126, 4, 211, 139, 23, 252, 46, 8, 2, 1, 126, 4, 211, 139, 23, 252, 46, 8,
+ 6, 1, 126, 4, 211, 139, 23, 198, 152, 8, 2, 1, 126, 4, 211, 139, 23, 198,
+ 152, 8, 6, 1, 126, 4, 217, 147, 23, 252, 46, 8, 2, 1, 126, 4, 217, 147,
+ 23, 252, 46, 8, 6, 1, 126, 4, 217, 147, 23, 198, 152, 8, 2, 1, 126, 4,
+ 217, 147, 23, 198, 152, 8, 2, 1, 252, 26, 4, 230, 210, 8, 2, 1, 211, 77,
+ 187, 4, 230, 210, 8, 2, 1, 211, 77, 187, 4, 252, 46, 8, 2, 1, 153, 196,
+ 13, 4, 230, 210, 8, 2, 1, 153, 196, 13, 4, 252, 46, 8, 2, 1, 205, 87, 4,
+ 230, 210, 8, 2, 1, 205, 87, 4, 252, 46, 8, 2, 1, 228, 250, 205, 87, 4,
+ 230, 210, 8, 2, 1, 228, 250, 205, 87, 4, 252, 46, 9, 204, 7, 99, 4, 230,
+ 58, 93, 4, 251, 192, 9, 204, 7, 99, 4, 230, 58, 93, 4, 193, 133, 9, 204,
+ 7, 99, 4, 230, 58, 93, 4, 131, 217, 99, 9, 204, 7, 99, 4, 230, 58, 93, 4,
+ 211, 151, 9, 204, 7, 99, 4, 230, 58, 93, 4, 66, 9, 204, 7, 99, 4, 230,
+ 58, 93, 4, 191, 225, 9, 204, 7, 99, 4, 230, 58, 93, 4, 71, 9, 204, 7, 99,
+ 4, 230, 58, 93, 4, 252, 25, 9, 204, 7, 213, 25, 4, 222, 4, 100, 204, 7,
+ 40, 1, 208, 96, 100, 204, 7, 40, 1, 221, 193, 100, 204, 7, 40, 1, 231,
+ 66, 100, 204, 7, 40, 1, 191, 123, 100, 204, 7, 40, 1, 237, 180, 100, 204,
+ 7, 40, 1, 207, 6, 100, 204, 7, 40, 1, 233, 109, 100, 204, 7, 40, 1, 191,
+ 175, 248, 225, 204, 7, 40, 1, 206, 109, 248, 225, 204, 7, 40, 1, 207, 6,
+ 248, 225, 204, 7, 40, 1, 191, 175, 230, 144, 204, 7, 40, 1, 219, 73, 230,
+ 144, 204, 7, 40, 1, 203, 165, 230, 144, 204, 7, 40, 1, 221, 193, 230,
+ 144, 204, 7, 40, 1, 231, 66, 230, 144, 204, 7, 40, 1, 191, 123, 230, 144,
+ 204, 7, 40, 1, 233, 109, 211, 45, 204, 7, 40, 1, 206, 109, 211, 45, 204,
+ 7, 40, 1, 207, 6, 248, 225, 1, 221, 187, 44, 120, 222, 152, 44, 120, 214,
+ 70, 44, 120, 247, 193, 44, 120, 212, 103, 44, 120, 197, 135, 44, 120,
+ 213, 80, 44, 120, 200, 43, 44, 120, 215, 61, 44, 120, 210, 236, 44, 120,
+ 218, 168, 44, 120, 192, 159, 44, 120, 146, 44, 120, 172, 44, 120, 196,
+ 12, 44, 120, 219, 63, 44, 120, 219, 74, 44, 120, 206, 110, 44, 120, 213,
+ 62, 44, 120, 223, 35, 44, 120, 203, 167, 44, 120, 201, 178, 44, 120, 206,
+ 8, 44, 120, 230, 116, 44, 120, 220, 247, 44, 5, 222, 127, 44, 5, 221,
+ 166, 44, 5, 221, 145, 44, 5, 220, 232, 44, 5, 220, 187, 44, 5, 222, 22,
+ 44, 5, 222, 13, 44, 5, 222, 102, 44, 5, 221, 67, 44, 5, 221, 41, 44, 5,
+ 222, 42, 44, 5, 214, 67, 44, 5, 214, 16, 44, 5, 214, 12, 44, 5, 213, 237,
+ 44, 5, 213, 228, 44, 5, 214, 55, 44, 5, 214, 53, 44, 5, 214, 64, 44, 5,
+ 213, 249, 44, 5, 213, 244, 44, 5, 214, 57, 44, 5, 247, 159, 44, 5, 243,
+ 29, 44, 5, 243, 19, 44, 5, 238, 195, 44, 5, 238, 153, 44, 5, 247, 42, 44,
+ 5, 247, 34, 44, 5, 247, 148, 44, 5, 242, 99, 44, 5, 239, 18, 44, 5, 247,
+ 76, 44, 5, 212, 100, 44, 5, 212, 81, 44, 5, 212, 75, 44, 5, 212, 58, 44,
+ 5, 212, 50, 44, 5, 212, 90, 44, 5, 212, 89, 44, 5, 212, 97, 44, 5, 212,
+ 65, 44, 5, 212, 62, 44, 5, 212, 93, 44, 5, 197, 131, 44, 5, 197, 111, 44,
+ 5, 197, 110, 44, 5, 197, 99, 44, 5, 197, 96, 44, 5, 197, 127, 44, 5, 197,
+ 126, 44, 5, 197, 130, 44, 5, 197, 109, 44, 5, 197, 108, 44, 5, 197, 129,
+ 44, 5, 213, 78, 44, 5, 213, 64, 44, 5, 213, 63, 44, 5, 213, 47, 44, 5,
+ 213, 46, 44, 5, 213, 74, 44, 5, 213, 73, 44, 5, 213, 77, 44, 5, 213, 49,
+ 44, 5, 213, 48, 44, 5, 213, 76, 44, 5, 199, 245, 44, 5, 198, 193, 44, 5,
+ 198, 170, 44, 5, 197, 94, 44, 5, 197, 49, 44, 5, 199, 145, 44, 5, 199,
+ 121, 44, 5, 199, 217, 44, 5, 159, 44, 5, 198, 59, 44, 5, 199, 166, 44, 5,
+ 214, 250, 44, 5, 213, 219, 44, 5, 213, 186, 44, 5, 212, 178, 44, 5, 212,
+ 115, 44, 5, 214, 121, 44, 5, 214, 110, 44, 5, 214, 236, 44, 5, 213, 43,
+ 44, 5, 213, 26, 44, 5, 214, 205, 44, 5, 210, 220, 44, 5, 209, 185, 44, 5,
+ 209, 145, 44, 5, 208, 165, 44, 5, 208, 128, 44, 5, 210, 63, 44, 5, 210,
+ 49, 44, 5, 210, 198, 44, 5, 209, 73, 44, 5, 209, 37, 44, 5, 210, 80, 44,
+ 5, 217, 151, 44, 5, 216, 100, 44, 5, 216, 61, 44, 5, 215, 155, 44, 5,
+ 215, 93, 44, 5, 216, 232, 44, 5, 216, 211, 44, 5, 217, 112, 44, 5, 216,
+ 12, 44, 5, 215, 211, 44, 5, 217, 25, 44, 5, 192, 140, 44, 5, 192, 33, 44,
+ 5, 192, 23, 44, 5, 191, 225, 44, 5, 191, 188, 44, 5, 192, 80, 44, 5, 192,
+ 77, 44, 5, 192, 119, 44, 5, 192, 12, 44, 5, 191, 246, 44, 5, 192, 91, 44,
+ 5, 207, 178, 44, 5, 207, 1, 44, 5, 206, 195, 44, 5, 206, 68, 44, 5, 206,
+ 29, 44, 5, 207, 113, 44, 5, 207, 84, 44, 5, 207, 156, 44, 5, 206, 162,
+ 44, 5, 206, 134, 44, 5, 207, 125, 44, 5, 220, 125, 44, 5, 219, 146, 44,
+ 5, 219, 128, 44, 5, 218, 225, 44, 5, 218, 194, 44, 5, 219, 238, 44, 5,
+ 219, 228, 44, 5, 220, 96, 44, 5, 219, 43, 44, 5, 219, 8, 44, 5, 220, 0,
+ 44, 5, 195, 187, 44, 5, 195, 69, 44, 5, 195, 51, 44, 5, 193, 249, 44, 5,
+ 193, 241, 44, 5, 195, 153, 44, 5, 195, 148, 44, 5, 195, 183, 44, 5, 195,
+ 24, 44, 5, 195, 8, 44, 5, 195, 160, 44, 5, 219, 61, 44, 5, 219, 56, 44,
+ 5, 219, 55, 44, 5, 219, 52, 44, 5, 219, 51, 44, 5, 219, 58, 44, 5, 219,
+ 57, 44, 5, 219, 60, 44, 5, 219, 54, 44, 5, 219, 53, 44, 5, 219, 59, 44,
+ 5, 219, 72, 44, 5, 219, 65, 44, 5, 219, 64, 44, 5, 219, 48, 44, 5, 219,
+ 47, 44, 5, 219, 68, 44, 5, 219, 67, 44, 5, 219, 71, 44, 5, 219, 50, 44,
+ 5, 219, 49, 44, 5, 219, 69, 44, 5, 206, 108, 44, 5, 206, 97, 44, 5, 206,
+ 96, 44, 5, 206, 89, 44, 5, 206, 82, 44, 5, 206, 104, 44, 5, 206, 103, 44,
+ 5, 206, 107, 44, 5, 206, 95, 44, 5, 206, 94, 44, 5, 206, 106, 44, 5, 213,
+ 60, 44, 5, 213, 55, 44, 5, 213, 54, 44, 5, 213, 51, 44, 5, 213, 50, 44,
+ 5, 213, 57, 44, 5, 213, 56, 44, 5, 213, 59, 44, 5, 213, 53, 44, 5, 213,
+ 52, 44, 5, 213, 58, 44, 5, 223, 31, 44, 5, 222, 244, 44, 5, 222, 236, 44,
+ 5, 222, 182, 44, 5, 222, 162, 44, 5, 223, 10, 44, 5, 223, 8, 44, 5, 223,
+ 25, 44, 5, 222, 201, 44, 5, 222, 191, 44, 5, 223, 17, 44, 5, 203, 160,
+ 44, 5, 203, 81, 44, 5, 203, 76, 44, 5, 203, 5, 44, 5, 202, 243, 44, 5,
+ 203, 113, 44, 5, 203, 111, 44, 5, 203, 148, 44, 5, 203, 56, 44, 5, 203,
+ 48, 44, 5, 203, 122, 44, 5, 201, 174, 44, 5, 201, 142, 44, 5, 201, 138,
+ 44, 5, 201, 129, 44, 5, 201, 126, 44, 5, 201, 148, 44, 5, 201, 147, 44,
+ 5, 201, 173, 44, 5, 201, 134, 44, 5, 201, 133, 44, 5, 201, 150, 44, 5,
+ 205, 197, 44, 5, 202, 222, 44, 5, 202, 193, 44, 5, 201, 4, 44, 5, 200,
+ 160, 44, 5, 205, 68, 44, 5, 205, 50, 44, 5, 205, 181, 44, 5, 202, 46, 44,
+ 5, 202, 16, 44, 5, 205, 114, 44, 5, 230, 91, 44, 5, 229, 158, 44, 5, 229,
+ 130, 44, 5, 228, 159, 44, 5, 228, 128, 44, 5, 229, 245, 44, 5, 229, 215,
+ 44, 5, 230, 80, 44, 5, 229, 23, 44, 5, 228, 252, 44, 5, 230, 2, 44, 5,
+ 220, 246, 44, 5, 220, 245, 44, 5, 220, 240, 44, 5, 220, 239, 44, 5, 220,
+ 236, 44, 5, 220, 235, 44, 5, 220, 242, 44, 5, 220, 241, 44, 5, 220, 244,
+ 44, 5, 220, 238, 44, 5, 220, 237, 44, 5, 220, 243, 44, 5, 203, 14, 166,
+ 120, 3, 192, 105, 166, 120, 3, 207, 144, 166, 120, 3, 207, 50, 101, 1,
+ 196, 224, 95, 120, 3, 242, 91, 155, 95, 120, 3, 242, 91, 221, 215, 95,
+ 120, 3, 242, 91, 221, 67, 95, 120, 3, 242, 91, 221, 183, 95, 120, 3, 242,
+ 91, 213, 249, 95, 120, 3, 242, 91, 247, 160, 95, 120, 3, 242, 91, 247, 1,
+ 95, 120, 3, 242, 91, 242, 99, 95, 120, 3, 242, 91, 243, 68, 95, 120, 3,
+ 242, 91, 212, 65, 95, 120, 3, 242, 91, 238, 32, 95, 120, 3, 242, 91, 197,
+ 120, 95, 120, 3, 242, 91, 236, 174, 95, 120, 3, 242, 91, 197, 115, 95,
+ 120, 3, 242, 91, 180, 95, 120, 3, 242, 91, 190, 190, 95, 120, 3, 242, 91,
+ 199, 49, 95, 120, 3, 242, 91, 159, 95, 120, 3, 242, 91, 198, 241, 95,
+ 120, 3, 242, 91, 213, 43, 95, 120, 3, 242, 91, 249, 153, 95, 120, 3, 242,
+ 91, 209, 228, 95, 120, 3, 242, 91, 209, 73, 95, 120, 3, 242, 91, 209,
+ 199, 95, 120, 3, 242, 91, 216, 12, 95, 120, 3, 242, 91, 192, 12, 95, 120,
+ 3, 242, 91, 206, 162, 95, 120, 3, 242, 91, 219, 43, 95, 120, 3, 242, 91,
+ 195, 24, 95, 120, 3, 242, 91, 203, 165, 95, 120, 3, 242, 91, 201, 175,
+ 95, 120, 3, 242, 91, 188, 95, 120, 3, 242, 91, 140, 95, 120, 3, 242, 91,
+ 173, 95, 18, 3, 242, 91, 208, 96, 95, 223, 149, 18, 3, 242, 91, 208, 33,
+ 95, 223, 149, 18, 3, 242, 91, 206, 17, 95, 223, 149, 18, 3, 242, 91, 206,
+ 10, 95, 223, 149, 18, 3, 242, 91, 208, 75, 95, 18, 3, 211, 113, 95, 18,
+ 3, 252, 167, 229, 120, 1, 248, 181, 214, 68, 229, 120, 1, 248, 181, 214,
+ 16, 229, 120, 1, 248, 181, 213, 237, 229, 120, 1, 248, 181, 214, 55, 229,
+ 120, 1, 248, 181, 213, 249, 72, 1, 248, 181, 214, 68, 72, 1, 248, 181,
+ 214, 16, 72, 1, 248, 181, 213, 237, 72, 1, 248, 181, 214, 55, 72, 1, 248,
+ 181, 213, 249, 72, 1, 251, 228, 247, 42, 72, 1, 251, 228, 197, 94, 72, 1,
+ 251, 228, 159, 72, 1, 251, 228, 210, 236, 52, 1, 233, 200, 233, 199, 239,
+ 26, 163, 164, 52, 1, 233, 199, 233, 200, 239, 26, 163, 164,
+};
+
+static const unsigned short phrasebook_offset1[] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
+ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 105, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
+ 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 130, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 131, 132, 133,
+ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
+ 148, 104, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
+ 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 104, 171, 172, 173,
+ 174, 175, 176, 177, 178, 179, 180, 181, 104, 182, 183, 104, 184, 185,
+ 186, 187, 104, 188, 189, 190, 191, 192, 193, 194, 104, 195, 196, 197,
+ 198, 104, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
+ 211, 212, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 213, 214, 215, 216, 217, 218,
+ 219, 220, 221, 222, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 223, 224, 225, 226, 227, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 228, 229, 230, 231, 232,
+ 233, 234, 235, 104, 104, 104, 104, 236, 237, 238, 239, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 250, 251,
+ 252, 253, 254, 255, 256, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 257, 258, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 259, 260, 261, 262, 263, 264, 265, 266, 267,
+ 104, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280,
+ 281, 104, 104, 104, 104, 104, 104, 104, 104, 282, 104, 283, 284, 285,
+ 104, 104, 286, 104, 104, 104, 287, 104, 104, 104, 104, 104, 288, 289,
+ 290, 291, 104, 104, 104, 104, 104, 292, 293, 294, 104, 295, 296, 104,
+ 104, 297, 298, 299, 300, 301, 104, 302, 303, 304, 305, 306, 307, 308,
+ 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 320, 321, 322,
+ 323, 324, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 325, 104, 326, 327, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 328, 329, 330,
+ 331, 332, 333, 334, 335, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+};
+
+static const unsigned int phrasebook_offset2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 6, 9, 11, 14, 17, 19, 21, 24, 27, 29, 31,
+ 33, 35, 39, 41, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 69, 72,
+ 75, 78, 82, 86, 91, 96, 101, 105, 110, 115, 120, 124, 129, 134, 138, 143,
+ 148, 152, 157, 162, 166, 171, 176, 180, 185, 190, 195, 200, 205, 209,
+ 213, 217, 221, 224, 228, 232, 237, 242, 247, 251, 256, 261, 266, 270,
+ 275, 280, 284, 289, 294, 298, 303, 308, 312, 317, 322, 326, 331, 336,
+ 341, 346, 351, 356, 359, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 366, 370, 375,
+ 378, 381, 384, 387, 390, 393, 395, 398, 404, 412, 415, 419, 422, 424,
+ 427, 430, 433, 436, 440, 443, 446, 449, 451, 454, 460, 468, 475, 482,
+ 489, 494, 501, 508, 515, 522, 529, 537, 542, 550, 558, 566, 574, 582,
+ 590, 598, 606, 614, 619, 627, 634, 641, 648, 655, 662, 665, 671, 678,
+ 685, 692, 699, 707, 712, 719, 726, 733, 740, 747, 754, 762, 767, 775,
+ 783, 791, 799, 807, 815, 823, 831, 839, 844, 852, 859, 866, 873, 880,
+ 887, 890, 896, 903, 910, 917, 924, 932, 937, 945, 952, 959, 966, 973,
+ 980, 987, 995, 1003, 1011, 1019, 1027, 1035, 1043, 1051, 1059, 1067,
+ 1074, 1081, 1089, 1097, 1105, 1113, 1121, 1129, 1137, 1145, 1153, 1161,
+ 1169, 1177, 1185, 1193, 1201, 1209, 1217, 1225, 1233, 1241, 1248, 1255,
+ 1263, 1271, 1279, 1287, 1295, 1303, 1311, 1319, 1327, 1333, 1338, 1343,
+ 1351, 1359, 1367, 1375, 1380, 1388, 1396, 1404, 1412, 1420, 1428, 1437,
+ 1446, 1453, 1460, 1468, 1476, 1484, 1492, 1500, 1508, 1519, 1524, 1529,
+ 1536, 1543, 1550, 1557, 1565, 1573, 1578, 1583, 1591, 1599, 1607, 1615,
+ 1623, 1631, 1639, 1647, 1655, 1663, 1671, 1679, 1687, 1695, 1703, 1711,
+ 1719, 1727, 1734, 1741, 1748, 1755, 1762, 1769, 1776, 1783, 1791, 1799,
+ 1807, 1815, 1822, 1829, 1837, 1845, 1853, 1861, 1869, 1877, 1885, 1893,
+ 1901, 1909, 1917, 1923, 1929, 1935, 1942, 1949, 1954, 1959, 1965, 1972,
+ 1979, 1986, 1993, 2001, 2009, 2015, 2021, 2026, 2032, 2039, 2046, 2053,
+ 2058, 2063, 2068, 2075, 2082, 2089, 2096, 2103, 2109, 2117, 2127, 2135,
+ 2142, 2149, 2154, 2159, 2166, 2173, 2177, 2182, 2187, 2192, 2200, 2209,
+ 2216, 2223, 2232, 2239, 2246, 2251, 2258, 2265, 2272, 2279, 2286, 2291,
+ 2298, 2305, 2313, 2318, 2323, 2328, 2338, 2342, 2348, 2354, 2360, 2366,
+ 2374, 2387, 2395, 2400, 2410, 2415, 2420, 2430, 2435, 2442, 2449, 2457,
+ 2465, 2472, 2479, 2486, 2493, 2503, 2513, 2523, 2533, 2543, 2553, 2563,
+ 2573, 2578, 2588, 2598, 2608, 2618, 2626, 2634, 2641, 2648, 2656, 2664,
+ 2672, 2680, 2687, 2694, 2704, 2714, 2722, 2730, 2738, 2743, 2753, 2758,
+ 2766, 2774, 2779, 2784, 2792, 2800, 2811, 2822, 2830, 2838, 2848, 2858,
+ 2866, 2874, 2883, 2892, 2901, 2910, 2920, 2930, 2939, 2948, 2958, 2968,
+ 2976, 2984, 2993, 3002, 3011, 3020, 3030, 3040, 3048, 3056, 3065, 3074,
+ 3083, 3092, 3101, 3110, 3115, 3120, 3128, 3136, 3146, 3154, 3159, 3164,
+ 3171, 3178, 3185, 3192, 3200, 3208, 3218, 3228, 3238, 3248, 3255, 3262,
+ 3272, 3282, 3290, 3298, 3306, 3314, 3322, 3329, 3336, 3343, 3349, 3356,
+ 3363, 3370, 3379, 3389, 3399, 3406, 3413, 3419, 3424, 3430, 3437, 3444,
+ 3451, 3458, 3469, 3479, 3486, 3493, 3500, 3507, 3512, 3517, 3523, 3529,
+ 3535, 3543, 3551, 3558, 3564, 3569, 3576, 3582, 3590, 3601, 3611, 3620,
+ 3627, 3633, 3639, 3644, 3651, 3657, 3664, 3671, 3678, 3683, 3688, 3697,
+ 3705, 3714, 3719, 3725, 3735, 3742, 3750, 3759, 3765, 3771, 3777, 3784,
+ 3789, 3794, 3804, 3812, 3821, 3829, 3837, 3847, 3852, 3859, 3866, 3871,
+ 3883, 3892, 3900, 3906, 3915, 3920, 3925, 3932, 3938, 3944, 3950, 3956,
+ 3965, 3973, 3978, 3986, 3992, 4000, 4008, 4014, 4020, 4026, 4034, 4042,
+ 4048, 4056, 4062, 4067, 4074, 4082, 4092, 4099, 4106, 4116, 4123, 4130,
+ 4140, 4147, 4154, 4161, 4167, 4173, 4182, 4194, 4199, 4206, 4211, 4215,
+ 4220, 4228, 4235, 4240, 4245, 4249, 4254, 4259, 4263, 4269, 4275, 4281,
+ 4287, 4295, 4300, 4305, 4310, 4315, 4321, 4323, 4328, 4332, 4338, 4344,
+ 4350, 4355, 4362, 4369, 4375, 4382, 4390, 4398, 4403, 4408, 4412, 4417,
+ 4419, 4421, 4424, 4426, 4429, 4434, 4439, 4445, 4450, 4454, 4459, 4464,
+ 4473, 4479, 4484, 4490, 4495, 4501, 4509, 4517, 4521, 4525, 4530, 4536,
+ 4542, 4548, 4554, 4559, 4566, 4574, 4582, 4587, 4593, 4600, 4607, 4614,
+ 4621, 4625, 4631, 4636, 4641, 4646, 4651, 4654, 4657, 4660, 4663, 4666,
+ 4669, 4673, 4677, 4683, 4686, 4691, 4697, 4703, 4706, 4711, 4716, 4720,
+ 4726, 4731, 4737, 4743, 4748, 4753, 4758, 4761, 4767, 4772, 4777, 4781,
+ 4786, 4792, 4798, 4801, 4805, 4809, 4813, 4816, 4819, 4824, 4828, 4835,
+ 4839, 4845, 4849, 4855, 4859, 4863, 4867, 4872, 4877, 4884, 4890, 4897,
+ 4903, 4909, 4915, 4918, 4922, 4926, 4930, 4934, 4939, 4944, 4948, 4952,
+ 4958, 4962, 4966, 4971, 4977, 4982, 4988, 4992, 4999, 5004, 5009, 5014,
+ 5019, 5025, 5028, 5032, 5037, 5042, 5051, 5057, 5061, 5065, 5070, 5074,
+ 5079, 5083, 5087, 5092, 5096, 5102, 5107, 5112, 5117, 5122, 5127, 5132,
+ 5138, 5144, 5150, 5156, 5161, 5167, 5173, 5179, 5184, 5189, 5196, 5203,
+ 5207, 5212, 5219, 0, 0, 5226, 5229, 5238, 5247, 5258, 5262, 0, 0, 0, 0,
+ 5267, 5270, 5275, 5283, 5288, 5296, 5304, 0, 5312, 0, 5320, 5328, 5336,
+ 5347, 5352, 5357, 5362, 5367, 5372, 5377, 5382, 5387, 5392, 5397, 5402,
+ 5407, 5412, 5417, 5422, 5427, 0, 5432, 5437, 5442, 5447, 5452, 5457,
+ 5462, 5467, 5475, 5483, 5491, 5499, 5507, 5515, 5526, 5531, 5536, 5541,
+ 5546, 5551, 5556, 5561, 5566, 5571, 5576, 5581, 5586, 5591, 5596, 5601,
+ 5606, 5611, 5617, 5622, 5627, 5632, 5637, 5642, 5647, 5652, 5660, 5668,
+ 5676, 5684, 5692, 5697, 5701, 5705, 5712, 5722, 5732, 5736, 5740, 5744,
+ 5750, 5757, 5761, 5766, 5770, 5775, 5779, 5784, 5788, 5793, 5798, 5803,
+ 5808, 5813, 5818, 5823, 5828, 5833, 5838, 5843, 5848, 5853, 5858, 5863,
+ 5867, 5871, 5877, 5881, 5886, 5892, 5900, 5905, 5910, 5917, 5922, 5927,
+ 5934, 5943, 5952, 5963, 5971, 5976, 5981, 5986, 5993, 5998, 6004, 6009,
+ 6014, 6019, 6024, 6029, 6034, 6042, 6048, 6053, 6057, 6062, 6067, 6072,
+ 6077, 6082, 6087, 6092, 6096, 6102, 6106, 6111, 6116, 6121, 6125, 6130,
+ 6135, 6140, 6145, 6149, 6154, 6158, 6163, 6168, 6173, 6178, 6184, 6189,
+ 6195, 6199, 6204, 6208, 6212, 6217, 6222, 6227, 6232, 6237, 6242, 6247,
+ 6251, 6257, 6261, 6266, 6271, 6276, 6280, 6285, 6290, 6295, 6300, 6304,
+ 6309, 6313, 6318, 6323, 6328, 6333, 6339, 6344, 6350, 6354, 6359, 6363,
+ 6371, 6376, 6381, 6386, 6393, 6398, 6404, 6409, 6414, 6419, 6424, 6429,
+ 6434, 6442, 6448, 6453, 6458, 6463, 6468, 6473, 6479, 6485, 6492, 6499,
+ 6508, 6517, 6524, 6531, 6540, 6549, 6554, 6559, 6564, 6569, 6574, 6579,
+ 6584, 6589, 6600, 6611, 6616, 6621, 6628, 6635, 6643, 6651, 6656, 6661,
+ 6666, 6671, 6675, 6679, 6683, 6689, 6695, 6699, 6706, 6711, 6721, 6731,
+ 6737, 6743, 6751, 6759, 6767, 6775, 6782, 6789, 6797, 6805, 6813, 6821,
+ 6829, 6837, 6845, 6853, 6861, 6869, 6876, 6883, 6889, 6895, 6903, 6911,
+ 6918, 6925, 6933, 6941, 6947, 6953, 6961, 6969, 6977, 6985, 6991, 6997,
+ 7005, 7013, 7021, 7029, 7036, 7043, 7051, 7059, 7067, 7075, 7080, 7085,
+ 7092, 7099, 7109, 7119, 7123, 7131, 7139, 7146, 7153, 7161, 7169, 7176,
+ 7183, 7191, 7199, 7206, 7213, 7221, 7229, 7234, 7241, 7248, 7255, 7262,
+ 7268, 7274, 7282, 7290, 7295, 7300, 7308, 7316, 7324, 7332, 7340, 7348,
+ 7355, 7362, 7370, 7378, 7386, 7394, 7401, 7408, 7414, 7420, 7429, 7438,
+ 7446, 7454, 7461, 7468, 7475, 7482, 7490, 7498, 7506, 7514, 7522, 7530,
+ 7538, 7546, 7556, 7566, 7573, 7580, 7587, 7594, 7601, 7608, 7615, 7622,
+ 7629, 7636, 7643, 7650, 7657, 7664, 7671, 7678, 7685, 7692, 7699, 7706,
+ 7713, 7720, 7727, 7734, 7739, 7744, 7749, 7754, 7759, 7764, 7769, 7774,
+ 7779, 7784, 7790, 7796, 7804, 7812, 7820, 7828, 7836, 7844, 7852, 7860,
+ 7868, 7876, 7881, 7886, 7891, 7896, 7904, 0, 7912, 7918, 7924, 7930,
+ 7936, 7942, 7948, 7954, 7960, 7965, 7971, 7977, 7983, 7989, 7995, 8001,
+ 8007, 8013, 8019, 8025, 8031, 8037, 8043, 8049, 8055, 8061, 8067, 8073,
+ 8078, 8084, 8090, 8096, 8102, 8108, 8114, 8120, 8126, 8132, 0, 0, 8138,
+ 8146, 8150, 8155, 8160, 8164, 8169, 8174, 8181, 8187, 8193, 8199, 8205,
+ 8211, 8217, 8223, 8229, 8234, 8240, 8246, 8252, 8258, 8264, 8270, 8276,
+ 8282, 8288, 8294, 8300, 8306, 8312, 8318, 8324, 8330, 8336, 8342, 8347,
+ 8353, 8359, 8365, 8371, 8377, 8383, 8389, 8395, 8401, 8407, 8415, 8422,
+ 8428, 0, 0, 8432, 8439, 8446, 0, 8451, 8456, 8461, 8466, 8473, 8480,
+ 8485, 8490, 8495, 8500, 8505, 8510, 8515, 8522, 8527, 8534, 8541, 8546,
+ 8553, 8558, 8563, 8568, 8575, 8580, 8585, 8592, 8601, 8606, 8611, 8616,
+ 8621, 8627, 8632, 8639, 8646, 8653, 8658, 8663, 8668, 8673, 8678, 8683,
+ 8693, 8698, 8707, 8712, 8717, 8722, 8727, 8734, 8741, 8748, 8753, 8758,
+ 8765, 0, 0, 0, 0, 0, 0, 0, 0, 8772, 8776, 8780, 8784, 8788, 8792, 8796,
+ 8800, 8804, 8808, 8812, 8817, 8821, 8825, 8830, 8834, 8839, 8843, 8847,
+ 8851, 8856, 8860, 8865, 8869, 8873, 8877, 8881, 0, 0, 0, 0, 8885, 8890,
+ 8897, 8905, 8912, 8917, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8922, 8925,
+ 8929, 8934, 8938, 8942, 8946, 8952, 8958, 8961, 8968, 8977, 8980, 8983,
+ 8988, 8994, 8998, 9006, 9012, 9018, 9026, 9030, 9035, 9046, 9051, 9055,
+ 9059, 9063, 9066, 9069, 9076, 9083, 9087, 9093, 9097, 9104, 9111, 9119,
+ 9126, 9133, 9137, 9141, 9147, 9151, 9155, 9159, 9163, 9167, 9171, 9175,
+ 9179, 9183, 9187, 9191, 9195, 9199, 9203, 9207, 9211, 9215, 9223, 9231,
+ 9241, 9250, 9259, 9262, 9266, 9270, 9274, 9278, 9282, 9286, 9290, 9294,
+ 9299, 9303, 9306, 9309, 9312, 9315, 9318, 9321, 9324, 9327, 9331, 9335,
+ 9339, 9344, 9349, 9355, 9358, 9365, 9374, 9379, 9384, 9391, 9397, 9402,
+ 9406, 9410, 9414, 9418, 9422, 9426, 9430, 9434, 9438, 9442, 9447, 9452,
+ 9459, 9465, 9471, 9477, 9482, 9491, 9500, 9505, 9512, 9519, 9526, 9533,
+ 9537, 9541, 9545, 9552, 9562, 9566, 9570, 9574, 9581, 9589, 9593, 9597,
+ 9604, 9608, 9612, 9616, 9623, 9630, 9642, 9646, 9650, 9654, 9664, 9673,
+ 9677, 9685, 9692, 9699, 9708, 9719, 9727, 9731, 9740, 9751, 9759, 9772,
+ 9780, 9788, 9796, 9804, 9810, 9819, 9826, 9830, 9838, 9842, 9849, 9857,
+ 9861, 9867, 9874, 9881, 9885, 9893, 9897, 9904, 9908, 9916, 9920, 9928,
+ 9936, 9943, 9951, 9959, 9966, 9972, 9976, 9983, 9991, 9997, 10004, 10011,
+ 10017, 10027, 10035, 10042, 10048, 10052, 10055, 10059, 10065, 10073,
+ 10077, 10083, 10089, 10096, 10103, 10106, 10113, 10118, 10127, 10132,
+ 10136, 10149, 10162, 10168, 10175, 10180, 10186, 10191, 10197, 10207,
+ 10214, 10223, 10233, 10239, 10244, 10249, 10253, 10257, 10262, 10267,
+ 10273, 10281, 10289, 10300, 10305, 10314, 10323, 10330, 10336, 10342,
+ 10348, 10354, 10360, 10366, 10372, 10378, 10384, 10391, 10398, 10405,
+ 10411, 10419, 10428, 10435, 10443, 10451, 10457, 10463, 10469, 10477,
+ 10484, 10494, 10503, 10507, 10513, 10519, 0, 10525, 10530, 10535, 10542,
+ 10547, 10552, 10559, 10564, 10573, 10578, 10583, 10588, 10593, 10598,
+ 10605, 10610, 10617, 10622, 10627, 10632, 10637, 10642, 10648, 10652,
+ 10657, 10664, 10669, 10674, 10679, 10684, 10689, 10696, 10703, 10710,
+ 10715, 10720, 10726, 10731, 10736, 10742, 10747, 10752, 10760, 10768,
+ 10773, 10778, 10784, 10789, 10794, 10798, 10804, 10808, 10812, 10818,
+ 10824, 10829, 10834, 10841, 10848, 10852, 0, 0, 10856, 10863, 10870,
+ 10877, 10887, 10899, 10911, 10928, 10940, 10951, 10959, 10966, 10977,
+ 10992, 11003, 11009, 11018, 11026, 11038, 11048, 11056, 11068, 11075,
+ 11083, 11095, 11101, 11107, 11115, 11123, 11131, 11137, 11147, 11155,
+ 11165, 11175, 11188, 11202, 11216, 11226, 11237, 11248, 11261, 11274,
+ 11288, 11300, 11312, 11325, 11338, 11350, 11363, 11372, 11380, 11385,
+ 11390, 11395, 11400, 11405, 11410, 11415, 11420, 11425, 11430, 11435,
+ 11440, 11445, 11450, 11455, 11460, 11465, 11470, 11475, 11480, 11485,
+ 11490, 11495, 11500, 11505, 11510, 11515, 11520, 11525, 11530, 11535,
+ 11540, 11544, 11549, 11554, 11559, 11564, 11569, 11573, 11577, 11581,
+ 11585, 11589, 11593, 11597, 11601, 11605, 11609, 11613, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 11618, 11623, 11627, 11631, 11635, 11639, 11643,
+ 11647, 11651, 11655, 11659, 11663, 11668, 11672, 11676, 11680, 11685,
+ 11689, 11694, 11699, 11704, 11708, 11713, 11718, 11723, 11728, 11732,
+ 11737, 11741, 11746, 11751, 11755, 11759, 11766, 11770, 11775, 11779,
+ 11783, 11788, 11792, 11799, 11806, 11813, 11819, 11827, 11835, 11844,
+ 11852, 11859, 11866, 11874, 11880, 11886, 11892, 11898, 11905, 11910,
+ 11914, 11919, 0, 0, 11923, 11927, 11932, 11937, 11942, 11947, 11952,
+ 11957, 11962, 11967, 11972, 11977, 11982, 11987, 11992, 11997, 12002,
+ 12007, 12012, 12017, 12022, 12027, 12032, 12037, 12042, 12047, 12052,
+ 12057, 12062, 12067, 12075, 12082, 12088, 12093, 12101, 12108, 12114,
+ 12121, 12127, 12132, 12139, 12146, 12152, 12157, 12162, 12168, 12173,
+ 12178, 12184, 0, 0, 12189, 12195, 12201, 12207, 12213, 12219, 12225,
+ 12230, 12238, 12244, 12250, 12256, 12262, 12268, 12276, 0, 12282, 12287,
+ 12292, 12297, 12302, 12307, 12312, 12317, 12322, 12327, 12332, 12337,
+ 12342, 12347, 12352, 12357, 12362, 12367, 12372, 12377, 12382, 12387,
+ 12392, 12397, 12402, 12407, 12412, 12417, 0, 0, 12422, 0, 12426, 12432,
+ 12438, 12444, 12450, 12456, 12462, 12468, 12473, 12479, 12485, 0, 0, 0,
+ 0, 0, 12491, 12499, 12510, 12517, 12524, 12532, 12543, 12553, 12564,
+ 12575, 12585, 12591, 12605, 12616, 12630, 12645, 12657, 12672, 12681,
+ 12690, 12698, 12706, 12713, 12719, 12726, 12733, 12743, 12753, 12760,
+ 12768, 12778, 0, 12782, 12787, 0, 0, 0, 0, 0, 0, 12792, 12799, 12806,
+ 12813, 12820, 12825, 12831, 12836, 12843, 12852, 12860, 12868, 12876,
+ 12888, 12895, 12902, 12909, 12921, 12932, 12939, 12947, 12953, 12958,
+ 12966, 12974, 12982, 12988, 12998, 13006, 13013, 13026, 13034, 13042,
+ 13051, 13060, 13073, 13079, 13085, 13091, 13099, 13107, 13115, 13123,
+ 13131, 13139, 13149, 13157, 13165, 13176, 13180, 13186, 13193, 13203,
+ 13210, 13215, 13222, 13229, 13233, 13239, 13250, 13255, 13262, 13267,
+ 13272, 13277, 13285, 13293, 13300, 13307, 13314, 13321, 13328, 13335,
+ 13342, 13348, 13356, 13361, 13366, 13371, 13376, 13381, 13386, 13391,
+ 13396, 13401, 13406, 13411, 13416, 13421, 13426, 13431, 13436, 13441,
+ 13447, 13453, 13459, 13464, 13469, 13474, 13479, 13485, 13494, 13502,
+ 13508, 13516, 13522, 13526, 13530, 13534, 13539, 13542, 13546, 13549,
+ 13553, 13556, 13560, 13564, 13568, 13573, 13578, 13581, 13585, 13590,
+ 13595, 13598, 13602, 13605, 13609, 13613, 13617, 13621, 13625, 13629,
+ 13633, 13637, 13641, 13645, 13649, 13653, 13657, 13661, 13665, 13669,
+ 13673, 13677, 13680, 13684, 13687, 13691, 13695, 13699, 13702, 13705,
+ 13708, 13712, 13715, 13719, 13723, 13727, 13731, 13735, 13738, 13741,
+ 13746, 13751, 13755, 13759, 13764, 13768, 13773, 13777, 13782, 13787,
+ 13793, 13799, 13805, 13809, 13814, 13820, 13826, 13830, 13835, 13839,
+ 13845, 13850, 13853, 13859, 13865, 13870, 13875, 13882, 13887, 13892,
+ 13896, 13900, 13904, 13908, 13912, 13916, 13920, 13924, 13929, 13934,
+ 13939, 13945, 13948, 13952, 13956, 13959, 13962, 13965, 13968, 13971,
+ 13974, 13977, 13980, 13983, 13987, 13994, 13999, 14003, 14007, 14011,
+ 14015, 14019, 14025, 14029, 14033, 14037, 14041, 14047, 14051, 14055,
+ 14059, 14064, 14069, 0, 14074, 14078, 14083, 14087, 14092, 14096, 14101,
+ 14106, 0, 0, 14111, 14115, 0, 0, 14120, 14124, 14129, 14133, 14138,
+ 14143, 14148, 14153, 14158, 14163, 14168, 14173, 14178, 14183, 14188,
+ 14193, 14198, 14203, 14208, 14213, 14218, 14223, 0, 14227, 14231, 14236,
+ 14241, 14246, 14250, 14254, 0, 14258, 0, 0, 0, 14262, 14267, 14272,
+ 14276, 0, 0, 14280, 14285, 14290, 14296, 14301, 14307, 14312, 14318,
+ 14324, 0, 0, 14331, 14336, 0, 0, 14342, 14347, 14353, 14358, 0, 0, 0, 0,
+ 0, 0, 0, 0, 14365, 0, 0, 0, 0, 14372, 14377, 0, 14382, 14387, 14393,
+ 14399, 14405, 0, 0, 14412, 14417, 14421, 14425, 14429, 14433, 14437,
+ 14441, 14445, 14449, 14453, 14462, 14471, 14476, 14481, 14488, 14495,
+ 14502, 14509, 14524, 14532, 14536, 14541, 14548, 14553, 0, 0, 14558,
+ 14565, 14570, 0, 14575, 14579, 14584, 14588, 14593, 14597, 0, 0, 0, 0,
+ 14602, 14607, 0, 0, 14612, 14617, 14622, 14626, 14631, 14636, 14641,
+ 14646, 14651, 14656, 14661, 14666, 14671, 14676, 14681, 14686, 14691,
+ 14696, 14701, 14706, 14711, 14716, 0, 14720, 14724, 14729, 14734, 14739,
+ 14743, 14747, 0, 14751, 14755, 0, 14760, 14765, 0, 14770, 14774, 0, 0,
+ 14778, 0, 14783, 14789, 14794, 14800, 14805, 0, 0, 0, 0, 14811, 14817, 0,
+ 0, 14823, 14829, 14835, 0, 0, 0, 14840, 0, 0, 0, 0, 0, 0, 0, 14845,
+ 14850, 14855, 14860, 0, 14865, 0, 0, 0, 0, 0, 0, 0, 14870, 14875, 14879,
+ 14883, 14887, 14891, 14895, 14899, 14903, 14907, 14911, 14915, 14919,
+ 14923, 14927, 14933, 14938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14943, 14948,
+ 14953, 0, 14958, 14962, 14967, 14971, 14976, 14980, 14985, 14990, 14995,
+ 0, 15001, 15005, 15010, 0, 15016, 15020, 15025, 15029, 15034, 15039,
+ 15044, 15049, 15054, 15059, 15064, 15069, 15074, 15079, 15084, 15089,
+ 15094, 15099, 15104, 15109, 15114, 15119, 0, 15123, 15127, 15132, 15137,
+ 15142, 15146, 15150, 0, 15154, 15158, 0, 15163, 15168, 15173, 15178,
+ 15182, 0, 0, 15186, 15191, 15196, 15202, 15207, 15213, 15218, 15224,
+ 15230, 15237, 0, 15244, 15249, 15255, 0, 15262, 15267, 15273, 0, 0,
+ 15278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15282, 15288, 15294,
+ 15300, 0, 0, 15307, 15312, 15316, 15320, 15324, 15328, 15332, 15336,
+ 15340, 15344, 15348, 15353, 0, 0, 0, 0, 0, 0, 0, 15358, 15363, 15368,
+ 15373, 15378, 15386, 15394, 0, 15402, 15407, 15412, 0, 15417, 15421,
+ 15426, 15430, 15435, 15439, 15444, 15449, 0, 0, 15454, 15458, 0, 0,
+ 15463, 15467, 15472, 15476, 15481, 15486, 15491, 15496, 15501, 15506,
+ 15511, 15516, 15521, 15526, 15531, 15536, 15541, 15546, 15551, 15556,
+ 15561, 15566, 0, 15570, 15574, 15579, 15584, 15589, 15593, 15597, 0,
+ 15601, 15605, 0, 15610, 15615, 15620, 15625, 15629, 0, 0, 15633, 15638,
+ 15643, 15649, 15654, 15660, 15665, 15671, 15677, 0, 0, 15684, 15689, 0,
+ 0, 15695, 15700, 15706, 0, 0, 0, 0, 0, 0, 0, 15711, 15716, 15723, 0, 0,
+ 0, 0, 15730, 15735, 0, 15740, 15745, 15751, 15757, 15763, 0, 0, 15770,
+ 15775, 15779, 15783, 15787, 15791, 15795, 15799, 15803, 15807, 15811,
+ 15815, 15820, 15827, 15834, 15841, 15848, 15855, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 15862, 15866, 0, 15870, 15873, 15877, 15880, 15884, 15887, 0, 0, 0,
+ 15891, 15894, 15898, 0, 15902, 15905, 15909, 15913, 0, 0, 0, 15916,
+ 15920, 0, 15924, 0, 15928, 15932, 0, 0, 0, 15936, 15940, 0, 0, 0, 15944,
+ 15947, 15951, 0, 0, 0, 15954, 15957, 15960, 15963, 15967, 15970, 15974,
+ 15978, 15982, 15986, 15990, 15993, 0, 0, 0, 0, 15996, 16001, 16005,
+ 16010, 16014, 0, 0, 0, 16019, 16023, 16028, 0, 16033, 16037, 16042,
+ 16047, 0, 0, 16051, 0, 0, 0, 0, 0, 0, 16054, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 16060, 16064, 16067, 16070, 16073, 16076, 16079, 16082,
+ 16085, 16088, 16091, 16095, 16100, 16104, 16108, 16112, 16116, 16120,
+ 16124, 16129, 16133, 0, 0, 0, 0, 0, 16136, 16143, 16148, 16153, 16158,
+ 16165, 16169, 16174, 16178, 16183, 16187, 16192, 16197, 0, 16202, 16206,
+ 16211, 0, 16216, 16220, 16225, 16230, 16234, 16239, 16244, 16249, 16254,
+ 16259, 16264, 16269, 16274, 16279, 16284, 16289, 16294, 16299, 16304,
+ 16309, 16314, 16319, 16324, 0, 16328, 16332, 16337, 16342, 16347, 16351,
+ 16355, 16359, 16364, 16368, 16373, 16378, 16383, 16388, 16393, 16397, 0,
+ 0, 16401, 16406, 16411, 16417, 16422, 16428, 16433, 16439, 16445, 0,
+ 16452, 16457, 16463, 0, 16469, 16474, 16480, 16486, 0, 0, 0, 0, 0, 0, 0,
+ 16491, 16496, 0, 16503, 16508, 16513, 0, 0, 16518, 0, 0, 16525, 16531,
+ 16537, 16543, 0, 0, 16550, 16555, 16559, 16563, 16567, 16571, 16575,
+ 16579, 16583, 16587, 0, 0, 0, 0, 0, 0, 0, 16591, 16596, 16610, 16623,
+ 16636, 16649, 16662, 16675, 16688, 16693, 16700, 16705, 16710, 16715,
+ 16720, 16724, 16729, 16733, 16738, 16742, 16747, 16752, 0, 16757, 16761,
+ 16766, 0, 16771, 16775, 16780, 16785, 16789, 16794, 16799, 16804, 16809,
+ 16814, 16819, 16824, 16829, 16834, 16839, 16844, 16849, 16854, 16859,
+ 16864, 16869, 16874, 16879, 0, 16883, 16887, 16892, 16897, 16902, 16906,
+ 16910, 16914, 16919, 16923, 0, 16928, 16933, 16938, 16943, 16947, 0, 0,
+ 16951, 16956, 16961, 16967, 16972, 16978, 16983, 16989, 16995, 0, 17002,
+ 17007, 17013, 0, 17019, 17024, 17030, 17036, 0, 0, 0, 0, 0, 0, 0, 17041,
+ 17046, 0, 0, 0, 0, 0, 0, 17053, 17060, 0, 17065, 17071, 17077, 17083, 0,
+ 0, 17090, 17095, 17099, 17103, 17107, 17111, 17115, 17119, 17123, 17127,
+ 0, 17131, 17136, 17141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17149, 17155,
+ 17159, 17163, 17167, 17173, 17176, 17180, 17183, 17187, 17190, 17194,
+ 17198, 0, 17202, 17205, 17209, 0, 17213, 17216, 17220, 17224, 17227,
+ 17231, 17235, 17239, 17243, 17247, 17251, 17255, 17259, 17263, 17267,
+ 17271, 17275, 17279, 17283, 17287, 17291, 17295, 17299, 17302, 17306,
+ 17309, 17313, 17317, 17321, 17324, 17327, 17330, 17334, 17337, 17341,
+ 17345, 17349, 17353, 17357, 17360, 17363, 17367, 17374, 17380, 17384,
+ 17389, 17393, 17398, 17402, 17407, 17412, 0, 17418, 17422, 17427, 0,
+ 17432, 17436, 17441, 17446, 17450, 17455, 0, 0, 0, 0, 17459, 17465,
+ 17471, 17477, 17483, 17489, 17495, 17501, 17507, 17513, 17519, 17525,
+ 17531, 17536, 17541, 17546, 0, 0, 17552, 17556, 17559, 17562, 17565,
+ 17568, 17571, 17574, 17577, 17580, 17583, 17587, 17592, 17596, 17602,
+ 17608, 17614, 17620, 17626, 17632, 17636, 17642, 17648, 17654, 17659,
+ 17665, 0, 17671, 17675, 17679, 0, 17683, 17687, 17691, 17695, 17699,
+ 17703, 17707, 17711, 17715, 17719, 17723, 17727, 17731, 17735, 17739,
+ 17743, 17747, 17751, 0, 0, 0, 17755, 17761, 17767, 17773, 17779, 17785,
+ 17791, 17797, 17803, 17809, 17815, 17821, 17829, 17835, 17841, 17847,
+ 17853, 17859, 17865, 17871, 17877, 17883, 17889, 17895, 0, 17901, 17907,
+ 17913, 17919, 17925, 17931, 17935, 17941, 17945, 0, 17949, 0, 0, 17955,
+ 17959, 17965, 17971, 17977, 17981, 17987, 0, 0, 0, 17991, 0, 0, 0, 0,
+ 17995, 18000, 18007, 18014, 18021, 18028, 0, 18035, 0, 18042, 18047,
+ 18052, 18059, 18066, 18075, 18086, 18095, 0, 0, 0, 0, 0, 0, 18100, 18106,
+ 18111, 18116, 18121, 18126, 18131, 18136, 18141, 18146, 0, 0, 18151,
+ 18158, 18165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18170, 18178, 18186,
+ 18194, 18202, 18210, 18218, 18226, 18234, 18242, 18250, 18258, 18266,
+ 18274, 18282, 18289, 18297, 18305, 18313, 18321, 18329, 18336, 18344,
+ 18352, 18360, 18368, 18376, 18384, 18392, 18400, 18408, 18416, 18424,
+ 18431, 18439, 18447, 18453, 18461, 18467, 18475, 18483, 18491, 18499,
+ 18507, 18515, 18522, 18530, 18536, 18543, 18551, 18559, 18567, 18574,
+ 18582, 18590, 18598, 18605, 18613, 0, 0, 0, 0, 18619, 18626, 18633,
+ 18641, 18648, 18658, 18668, 18674, 18680, 18686, 18694, 18702, 18710,
+ 18718, 18724, 18730, 18736, 18742, 18747, 18751, 18755, 18759, 18763,
+ 18767, 18771, 18775, 18779, 18783, 18789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 18795, 18800, 0, 18807, 0, 18814, 18821, 18826, 18831, 18838, 0,
+ 18845, 18852, 18857, 18864, 18871, 18878, 18885, 18892, 18899, 18904,
+ 18908, 18915, 18922, 18929, 18934, 18939, 18944, 18951, 18958, 18965,
+ 18972, 18979, 18984, 18989, 0, 18996, 0, 19003, 19008, 19015, 19022,
+ 19029, 19036, 19043, 19047, 19054, 19058, 19063, 19071, 19077, 19083,
+ 19088, 19094, 19100, 19106, 19111, 19117, 19124, 19132, 19139, 0, 0,
+ 19146, 19151, 19157, 19162, 19168, 0, 19174, 0, 19179, 19186, 19193,
+ 19200, 19207, 19212, 19216, 0, 19220, 19225, 19229, 19233, 19237, 19241,
+ 19245, 19249, 19253, 19257, 0, 0, 19261, 19267, 19273, 19280, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 19287, 19291, 19302, 19317, 19332, 19342, 19353, 19366,
+ 19377, 19383, 19391, 19401, 19407, 19415, 19419, 19425, 19431, 19439,
+ 19449, 19457, 19470, 19476, 19484, 19492, 19504, 19511, 19519, 19527,
+ 19535, 19543, 19551, 19559, 19569, 19573, 19576, 19579, 19582, 19585,
+ 19588, 19591, 19594, 19597, 19600, 19604, 19608, 19612, 19616, 19620,
+ 19624, 19628, 19632, 19636, 19641, 19647, 19657, 19671, 19681, 19687,
+ 19693, 19701, 19709, 19717, 19725, 19731, 19737, 19740, 19744, 19748,
+ 19752, 19756, 19760, 19764, 0, 19768, 19772, 19776, 19780, 19784, 19788,
+ 19792, 19796, 19800, 19804, 19808, 19811, 19814, 19818, 19822, 19826,
+ 19829, 19833, 19837, 19841, 19845, 19849, 19853, 19857, 19861, 19864,
+ 19867, 19870, 19874, 19878, 19881, 19884, 19887, 19891, 19896, 19900, 0,
+ 0, 0, 0, 19904, 19909, 19913, 19918, 19922, 19927, 19932, 19938, 19943,
+ 19949, 19953, 19958, 19962, 19967, 19977, 19983, 19989, 19996, 20006,
+ 20012, 20016, 20020, 20026, 20032, 20040, 20046, 20054, 20062, 20070,
+ 20080, 20088, 20098, 20103, 20109, 20115, 20121, 20127, 20133, 20139, 0,
+ 20145, 20151, 20157, 20163, 20169, 20175, 20181, 20187, 20193, 20199,
+ 20205, 20210, 20215, 20221, 20227, 20233, 20238, 20244, 20250, 20256,
+ 20262, 20268, 20274, 20280, 20286, 20291, 20296, 20301, 20307, 20313,
+ 20318, 20323, 20328, 20334, 20342, 20349, 0, 20356, 20363, 20376, 20383,
+ 20390, 20398, 20406, 20412, 20418, 20424, 20434, 20439, 20445, 20455,
+ 20465, 0, 20475, 20485, 20493, 20505, 20517, 20523, 20537, 20552, 20557,
+ 20562, 20570, 20578, 20586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20594,
+ 20597, 20601, 20605, 20609, 20613, 20617, 20621, 20625, 20629, 20633,
+ 20637, 20641, 20645, 20649, 20653, 20657, 20661, 20665, 20669, 20673,
+ 20676, 20679, 20683, 20687, 20691, 20694, 20697, 20700, 20703, 20707,
+ 20710, 20713, 20717, 20720, 20725, 20728, 20732, 20735, 20739, 20742,
+ 20747, 20750, 20754, 20761, 20766, 20770, 20775, 20779, 20784, 20788,
+ 20793, 20800, 20806, 20812, 20816, 20820, 20824, 20828, 20832, 20838,
+ 20844, 20851, 20857, 20862, 20866, 20869, 20872, 20875, 20878, 20881,
+ 20884, 20887, 20890, 20893, 20899, 20903, 20907, 20911, 20915, 20919,
+ 20923, 20927, 20931, 20936, 20940, 20945, 20950, 20956, 20961, 20967,
+ 20973, 20979, 20985, 20991, 20999, 21007, 21015, 21023, 21032, 21041,
+ 21052, 21062, 21072, 21083, 21094, 21104, 21114, 21124, 21134, 21144,
+ 21154, 21164, 21174, 21182, 21189, 21195, 21202, 21207, 21213, 21219,
+ 21225, 21231, 21237, 21243, 21248, 21254, 21260, 21266, 21272, 21277,
+ 21286, 21293, 21299, 21307, 21315, 21321, 21327, 21333, 21339, 21347,
+ 21355, 21365, 21373, 21381, 21387, 21392, 21397, 21402, 21407, 21412,
+ 21417, 21422, 21427, 21432, 21438, 21444, 21450, 21457, 21462, 21468,
+ 21473, 21478, 21483, 21488, 21493, 21498, 21503, 21508, 21513, 21518,
+ 21523, 21528, 21533, 21538, 21543, 21548, 21553, 21558, 21563, 21568,
+ 21573, 21578, 21583, 21588, 21593, 21598, 21603, 21608, 21613, 21618,
+ 21623, 21628, 21633, 21638, 21643, 21648, 21653, 0, 21658, 0, 0, 0, 0, 0,
+ 21663, 0, 0, 21668, 21672, 21676, 21680, 21684, 21688, 21692, 21696,
+ 21700, 21704, 21708, 21712, 21716, 21720, 21724, 21728, 21732, 21736,
+ 21740, 21744, 21748, 21752, 21756, 21760, 21764, 21768, 21772, 21776,
+ 21780, 21784, 21788, 21792, 21796, 21800, 21804, 21808, 21812, 21816,
+ 21820, 21824, 21828, 21832, 21837, 21841, 21846, 21851, 21855, 21860,
+ 21865, 21869, 21873, 21877, 21881, 21885, 21889, 21893, 21897, 21901,
+ 21905, 21909, 21913, 21917, 21921, 21925, 21929, 21933, 21937, 21941,
+ 21945, 21949, 21953, 21957, 21961, 21965, 21969, 21973, 21977, 21981,
+ 21985, 21989, 21993, 21997, 22001, 22005, 22009, 22013, 22017, 22021,
+ 22025, 22029, 22033, 22037, 22041, 22045, 22049, 22053, 22057, 22061,
+ 22065, 22069, 22073, 22077, 22081, 22085, 22089, 22093, 22097, 22101,
+ 22105, 22109, 22113, 22117, 22121, 22125, 22129, 22133, 22137, 22141,
+ 22145, 22149, 22153, 22157, 22161, 22165, 22169, 22173, 22177, 22181,
+ 22185, 22189, 22193, 22197, 22201, 22205, 22209, 22213, 22217, 22221,
+ 22225, 22229, 22233, 22237, 22241, 22245, 22249, 22254, 22258, 22263,
+ 22267, 22272, 22277, 22281, 22286, 22291, 22295, 22300, 22305, 22310,
+ 22315, 22319, 22324, 22329, 22334, 22339, 22344, 22349, 22353, 22358,
+ 22363, 22368, 22373, 22378, 22383, 22388, 22393, 22398, 22403, 22408,
+ 22413, 22418, 22423, 22428, 22433, 22438, 22443, 22448, 22453, 22458,
+ 22463, 22468, 22473, 22478, 22483, 22488, 22493, 22498, 22503, 22508,
+ 22513, 22518, 22523, 22528, 22533, 22538, 22543, 22548, 22553, 22558,
+ 22563, 22568, 22573, 22578, 22583, 22588, 22593, 22598, 22603, 22607,
+ 22611, 22615, 22619, 22623, 22627, 22631, 22635, 22639, 22643, 22647,
+ 22651, 22655, 22659, 22663, 22667, 22671, 22675, 22679, 22683, 22687,
+ 22691, 22695, 22699, 22703, 22707, 22711, 22715, 22719, 22723, 22727,
+ 22731, 22735, 22739, 22743, 22747, 22751, 22755, 22759, 22763, 22767,
+ 22771, 22775, 22779, 22783, 22787, 22791, 22795, 22799, 22803, 22807,
+ 22811, 22815, 22819, 22823, 22827, 22831, 22835, 22839, 22843, 22847,
+ 22851, 22855, 22859, 22863, 22867, 22871, 22875, 22879, 22883, 22887,
+ 22891, 22895, 22899, 22903, 22907, 22911, 22915, 22919, 22923, 22927,
+ 22931, 22935, 22939, 22943, 22947, 22951, 22955, 22958, 22962, 22966,
+ 22970, 22974, 22978, 22982, 22986, 22989, 22993, 22997, 23001, 23005,
+ 23009, 23013, 23017, 23021, 23025, 23029, 23033, 23037, 23041, 23045,
+ 23049, 23052, 23056, 23060, 23064, 23068, 23072, 23076, 23080, 23084,
+ 23088, 23092, 23096, 23100, 23104, 23108, 23112, 23115, 23119, 23123,
+ 23127, 23131, 23135, 23139, 23143, 23146, 23150, 23154, 23158, 23162,
+ 23166, 23170, 23174, 23178, 23182, 23186, 23190, 23194, 23198, 23202,
+ 23206, 23210, 23214, 23218, 23222, 23226, 23230, 23234, 23238, 0, 23242,
+ 23246, 23250, 23254, 0, 0, 23258, 23262, 23266, 23270, 23274, 23278,
+ 23282, 0, 23286, 0, 23290, 23294, 23298, 23302, 0, 0, 23306, 23310,
+ 23314, 23318, 23322, 23326, 23330, 23334, 23338, 23342, 23346, 23350,
+ 23354, 23358, 23362, 23366, 23370, 23374, 23378, 23382, 23386, 23390,
+ 23394, 23397, 23401, 23405, 23409, 23413, 23417, 23421, 23425, 23429,
+ 23433, 23437, 23441, 23445, 23449, 23453, 23457, 23461, 23465, 0, 23469,
+ 23473, 23477, 23481, 0, 0, 23485, 23488, 23492, 23496, 23500, 23504,
+ 23508, 23512, 23516, 23520, 23524, 23528, 23532, 23536, 23540, 23544,
+ 23548, 23553, 23558, 23563, 23569, 23575, 23580, 23585, 23591, 23594,
+ 23598, 23602, 23606, 23610, 23614, 23618, 23622, 0, 23626, 23630, 23634,
+ 23638, 0, 0, 23642, 23646, 23650, 23654, 23658, 23662, 23666, 0, 23670,
+ 0, 23674, 23678, 23682, 23686, 0, 0, 23690, 23694, 23698, 23702, 23706,
+ 23710, 23714, 23718, 23722, 23727, 23732, 23737, 23743, 23749, 23754, 0,
+ 23759, 23763, 23767, 23771, 23775, 23779, 23783, 23787, 23791, 23795,
+ 23799, 23803, 23807, 23811, 23815, 23819, 23823, 23826, 23830, 23834,
+ 23838, 23842, 23846, 23850, 23854, 23858, 23862, 23866, 23870, 23874,
+ 23878, 23882, 23886, 23890, 23894, 23898, 23902, 23906, 23910, 23914,
+ 23918, 23922, 23926, 23930, 23934, 23938, 23942, 23946, 23950, 23954,
+ 23958, 23962, 23966, 23970, 23974, 23978, 23982, 0, 23986, 23990, 23994,
+ 23998, 0, 0, 24002, 24006, 24010, 24014, 24018, 24022, 24026, 24030,
+ 24034, 24038, 24042, 24046, 24050, 24054, 24058, 24062, 24066, 24070,
+ 24074, 24078, 24082, 24086, 24090, 24094, 24098, 24102, 24106, 24110,
+ 24114, 24118, 24122, 24126, 24130, 24134, 24138, 24142, 24146, 24150,
+ 24154, 24158, 24162, 24166, 24170, 24174, 24178, 24182, 24186, 24190,
+ 24194, 24198, 24202, 24206, 24210, 24214, 24218, 24222, 24226, 24229,
+ 24233, 24237, 24241, 24245, 24249, 24253, 24257, 24261, 24265, 0, 0,
+ 24269, 24278, 24284, 24289, 24293, 24296, 24301, 24304, 24307, 24310,
+ 24315, 24319, 24324, 24327, 24330, 24333, 24336, 24339, 24342, 24345,
+ 24348, 24351, 24355, 24359, 24363, 24367, 24371, 24375, 24379, 24383,
+ 24387, 24391, 0, 0, 0, 24396, 24402, 24406, 24410, 24414, 24420, 24424,
+ 24428, 24432, 24438, 24442, 24446, 24450, 24456, 24460, 24464, 24468,
+ 24474, 24480, 24486, 24494, 24500, 24506, 24512, 24518, 24524, 0, 0, 0,
+ 0, 0, 0, 24530, 24533, 24536, 24539, 24542, 24545, 24549, 24553, 24556,
+ 24560, 24564, 24568, 24572, 24576, 24579, 24583, 24587, 24591, 24595,
+ 24599, 24602, 24606, 24610, 24614, 24618, 24622, 24625, 24629, 24633,
+ 24637, 24641, 24644, 24648, 24652, 24656, 24660, 24664, 24668, 24672,
+ 24676, 24680, 24684, 24688, 24692, 24696, 24699, 24703, 24707, 24711,
+ 24715, 24719, 24723, 24727, 24731, 24735, 24739, 24743, 24747, 24751,
+ 24755, 24759, 24763, 24767, 24771, 24775, 24779, 24783, 24787, 24791,
+ 24795, 24799, 24803, 24807, 24811, 24815, 24819, 24823, 24827, 24831,
+ 24835, 24838, 24842, 24846, 24850, 24854, 24858, 0, 0, 24862, 24867,
+ 24872, 24877, 24882, 24887, 0, 0, 24892, 24896, 24899, 24903, 24906,
+ 24910, 24913, 24917, 24923, 24928, 24932, 24935, 24939, 24943, 24949,
+ 24953, 24959, 24963, 24969, 24973, 24979, 24983, 24989, 24995, 24999,
+ 25005, 25009, 25015, 25021, 25025, 25031, 25037, 25042, 25047, 25055,
+ 25063, 25070, 25075, 25081, 25090, 25096, 25104, 25109, 25115, 25119,
+ 25123, 25127, 25131, 25135, 25139, 25143, 25147, 25151, 25155, 25161,
+ 25166, 25171, 25174, 25178, 25182, 25188, 25192, 25198, 25202, 25208,
+ 25212, 25218, 25222, 25228, 25232, 25238, 25242, 25248, 25254, 25258,
+ 25264, 25269, 25273, 25277, 25281, 25285, 25288, 25292, 25298, 25303,
+ 25308, 25312, 25316, 25320, 25326, 25330, 25336, 25340, 25346, 25349,
+ 25354, 25358, 25364, 25368, 25374, 25378, 25384, 25390, 25394, 25398,
+ 25402, 25406, 25410, 25414, 25418, 25422, 25426, 25430, 25434, 25440,
+ 25443, 25447, 25451, 25457, 25461, 25467, 25471, 25477, 25481, 25487,
+ 25491, 25497, 25501, 25507, 25511, 25517, 25523, 25527, 25531, 25537,
+ 25543, 25549, 25555, 25559, 25563, 25567, 25571, 25575, 25579, 25585,
+ 25589, 25593, 25597, 25603, 25607, 25613, 25617, 25623, 25627, 25633,
+ 25637, 25643, 25647, 25653, 25657, 25663, 25669, 25673, 25679, 25683,
+ 25687, 25691, 25695, 25699, 25703, 25709, 25712, 25716, 25720, 25726,
+ 25730, 25736, 25740, 25746, 25750, 25756, 25760, 25766, 25770, 25776,
+ 25780, 25786, 25792, 25796, 25802, 25806, 25812, 25818, 25822, 25826,
+ 25830, 25834, 25838, 25842, 25848, 25851, 25855, 25859, 25865, 25869,
+ 25875, 25879, 25885, 25891, 25895, 25900, 25904, 25908, 25912, 25916,
+ 25920, 25924, 25928, 25934, 25937, 25941, 25945, 25951, 25955, 25961,
+ 25965, 25971, 25975, 25981, 25985, 25991, 25995, 26001, 26005, 26011,
+ 26014, 26019, 26024, 26028, 26032, 26036, 26040, 26044, 26048, 26054,
+ 26057, 26061, 26065, 26071, 26075, 26081, 26085, 26091, 26095, 26101,
+ 26105, 26111, 26115, 26121, 26125, 26131, 26137, 26141, 26147, 26151,
+ 26157, 26163, 26169, 26175, 26181, 26187, 26193, 26199, 26203, 26207,
+ 26211, 26215, 26219, 26223, 26227, 26231, 26237, 26241, 26247, 26251,
+ 26257, 26261, 26267, 26271, 26277, 26281, 26287, 26291, 26297, 26301,
+ 26305, 26309, 26313, 26317, 26321, 26325, 26331, 26334, 26338, 26342,
+ 26348, 26352, 26358, 26362, 26368, 26372, 26378, 26382, 26388, 26392,
+ 26398, 26402, 26408, 26414, 26418, 26424, 26430, 26436, 26440, 26446,
+ 26452, 26456, 26460, 26464, 26468, 26472, 26478, 26481, 26485, 26490,
+ 26494, 26500, 26503, 26508, 26513, 26517, 26521, 26525, 26529, 26533,
+ 26537, 26541, 26545, 26549, 26555, 26559, 26563, 26569, 26573, 26579,
+ 26583, 26589, 26593, 26597, 26601, 26605, 26609, 26615, 26619, 26623,
+ 26627, 26631, 26635, 26639, 26643, 26647, 26651, 26655, 26661, 26667,
+ 26673, 26679, 26685, 26690, 26696, 26702, 26708, 26712, 26716, 26720,
+ 26724, 26728, 26732, 26736, 26740, 26744, 26748, 26752, 26756, 26760,
+ 26766, 26772, 26778, 26783, 26787, 26791, 26795, 26799, 26803, 26807,
+ 26811, 26815, 26819, 26825, 26831, 26837, 26843, 26849, 26855, 26861,
+ 26867, 26873, 26877, 26881, 26885, 26889, 26893, 26897, 26901, 26907,
+ 26913, 26919, 26925, 26931, 26937, 26943, 26949, 26955, 26960, 26965,
+ 26970, 26975, 26981, 26987, 26993, 26999, 27005, 27011, 27017, 27022,
+ 27028, 27034, 27040, 27045, 27051, 27057, 27063, 27068, 27073, 27078,
+ 27083, 27088, 27093, 27098, 27103, 27108, 27113, 27118, 27123, 27127,
+ 27132, 27137, 27142, 27147, 27152, 27157, 27162, 27167, 27172, 27177,
+ 27182, 27187, 27192, 27197, 27202, 27207, 27212, 27217, 27222, 27227,
+ 27232, 27237, 27242, 27247, 27252, 27257, 27262, 27267, 27272, 27276,
+ 27281, 27286, 27291, 27296, 27301, 27306, 27311, 27316, 27321, 27326,
+ 27331, 27336, 27341, 27346, 27351, 27356, 27361, 27366, 27371, 27376,
+ 27381, 27386, 27391, 27396, 27401, 27405, 27410, 27415, 27420, 27425,
+ 27430, 27434, 27439, 27444, 27449, 27454, 27459, 27463, 27468, 27474,
+ 27479, 27484, 27489, 27494, 27500, 27505, 27510, 27515, 27520, 27525,
+ 27530, 27535, 27540, 27545, 27550, 27555, 27560, 27564, 27569, 27574,
+ 27579, 27584, 27589, 27594, 27599, 27604, 27609, 27614, 27619, 27624,
+ 27629, 27634, 27639, 27644, 27649, 27654, 27659, 27664, 27669, 27674,
+ 27679, 27684, 27689, 27694, 27699, 27704, 27709, 27714, 27719, 27725,
+ 27730, 27735, 27740, 27745, 27750, 27755, 27760, 27765, 27770, 27775,
+ 27780, 27784, 27789, 27794, 27799, 27804, 27809, 27814, 27819, 27824,
+ 27829, 27834, 27839, 27844, 27849, 27854, 27859, 27864, 27869, 27874,
+ 27879, 27884, 27889, 27894, 27899, 27904, 27909, 27914, 27920, 27924,
+ 27928, 27932, 27936, 27940, 27944, 27948, 27952, 27958, 27964, 27970,
+ 27976, 27982, 27988, 27994, 28001, 28007, 28012, 28017, 28022, 28027,
+ 28032, 28037, 28042, 28047, 28052, 28057, 28062, 28067, 28072, 28077,
+ 28082, 28087, 28092, 28097, 28102, 28107, 28112, 28117, 28122, 28127,
+ 28132, 28137, 28142, 28147, 0, 0, 0, 28154, 28165, 28170, 28178, 28183,
+ 28188, 28193, 28202, 28207, 28213, 28219, 28225, 28230, 28236, 28242,
+ 28246, 28251, 28256, 28266, 28271, 28276, 28283, 28288, 28293, 28302,
+ 28307, 28316, 28323, 28330, 28337, 28344, 28355, 28362, 28367, 28377,
+ 28381, 28388, 28393, 28400, 28406, 28413, 28422, 28429, 28436, 28445,
+ 28452, 28457, 28462, 28473, 28480, 28485, 28496, 28503, 28508, 28513,
+ 28521, 28530, 28537, 28544, 28554, 28559, 28564, 28569, 28578, 28586,
+ 28591, 28596, 28601, 28606, 28611, 28616, 28621, 28626, 28631, 28636,
+ 28641, 28647, 28653, 28659, 28664, 28669, 28674, 28679, 28684, 28689,
+ 28698, 28707, 28716, 28725, 0, 0, 0, 0, 0, 0, 0, 28734, 28738, 28742,
+ 28746, 28750, 28755, 28760, 28765, 28770, 28774, 28778, 28783, 28787,
+ 28791, 28795, 28799, 28804, 28808, 28812, 28817, 28822, 28827, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 28832, 28838, 28842, 28846, 28850, 28854, 28859, 28864,
+ 28869, 28874, 28878, 28882, 28887, 28891, 28895, 28899, 28903, 28908,
+ 28912, 28916, 28921, 28926, 28931, 28937, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 28942, 28946, 28950, 28954, 28958, 28963, 28968, 28973, 28978, 28982,
+ 28986, 28991, 28995, 28999, 29003, 29007, 29012, 29016, 29020, 29025, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29030, 29034, 29038, 29042, 29046,
+ 29051, 29056, 29061, 29066, 29070, 29074, 29079, 29083, 0, 29087, 29091,
+ 29096, 0, 29100, 29105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29110, 29113,
+ 29117, 29121, 29125, 29129, 29133, 29137, 29141, 29145, 29149, 29153,
+ 29157, 29161, 29165, 29169, 29173, 29177, 29180, 29184, 29188, 29192,
+ 29196, 29200, 29204, 29208, 29212, 29216, 29220, 29224, 29228, 29232,
+ 29235, 29238, 29241, 29245, 29251, 29257, 29263, 29269, 29275, 29281,
+ 29287, 29293, 29299, 29305, 29311, 29317, 29323, 29329, 29338, 29347,
+ 29353, 29359, 29365, 29370, 29374, 29379, 29384, 29389, 29393, 29398,
+ 29403, 29408, 29412, 29417, 29421, 29426, 29431, 29436, 29441, 29445,
+ 29449, 29453, 29457, 29461, 29465, 29469, 29473, 29477, 29481, 29487,
+ 29491, 29495, 29499, 29503, 29507, 29515, 29521, 29525, 29531, 29535,
+ 29541, 29545, 0, 0, 29549, 29553, 29556, 29559, 29562, 29565, 29568,
+ 29571, 29574, 29577, 0, 0, 0, 0, 0, 0, 29580, 29588, 29596, 29604, 29612,
+ 29620, 29628, 29636, 29644, 29652, 0, 0, 0, 0, 0, 0, 29660, 29663, 29666,
+ 29669, 29674, 29677, 29682, 29689, 29697, 29702, 29709, 29712, 29719,
+ 29726, 29733, 29737, 29744, 29748, 29751, 29754, 29757, 29760, 29763,
+ 29766, 29769, 29772, 0, 0, 0, 0, 0, 0, 29775, 29778, 29781, 29784, 29787,
+ 29790, 29794, 29798, 29802, 29805, 29809, 29813, 29816, 29820, 29824,
+ 29827, 29830, 29833, 29837, 29841, 29845, 29849, 29853, 29856, 29859,
+ 29863, 29867, 29870, 29874, 29878, 29882, 29886, 29890, 29894, 29898,
+ 29902, 29909, 29914, 29919, 29924, 29929, 29935, 29941, 29947, 29953,
+ 29958, 29964, 29970, 29975, 29981, 29987, 29993, 29999, 30005, 30010,
+ 30016, 30021, 30027, 30033, 30039, 30045, 30051, 30056, 30061, 30067,
+ 30073, 30078, 30084, 30089, 30095, 30100, 30105, 30111, 30117, 30123,
+ 30129, 30135, 30141, 30147, 30153, 30159, 30165, 30171, 30177, 30182,
+ 30187, 30192, 30198, 30204, 0, 0, 0, 0, 0, 0, 0, 30212, 30221, 30230,
+ 30238, 30246, 30256, 30264, 30273, 30280, 30287, 30294, 30302, 30310,
+ 30318, 30326, 30334, 30342, 30350, 30358, 30365, 30373, 30381, 30389,
+ 30397, 30405, 30415, 30425, 30435, 30445, 30455, 30465, 30475, 30485,
+ 30495, 30505, 30515, 30525, 30535, 30545, 30553, 30561, 30571, 30579, 0,
+ 0, 0, 0, 0, 30589, 30593, 30597, 30601, 30605, 30609, 30613, 30617,
+ 30621, 30625, 30629, 30633, 30637, 30641, 30645, 30649, 30653, 30657,
+ 30661, 30665, 30669, 30673, 30677, 30681, 30687, 30691, 30697, 30701,
+ 30707, 30711, 30717, 30721, 30725, 30729, 30733, 30737, 30741, 30747,
+ 30753, 30759, 30765, 30771, 30777, 30783, 30789, 30795, 30801, 30807,
+ 30814, 30820, 30826, 30832, 30836, 30840, 30844, 30848, 30852, 30856,
+ 30860, 30866, 30872, 30878, 30883, 30890, 30895, 30900, 30906, 30911,
+ 30918, 30925, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30932, 30938, 30942, 30947,
+ 30952, 30957, 30962, 30967, 30972, 30977, 30982, 30987, 30992, 30997,
+ 31002, 31007, 31011, 31015, 31020, 31025, 31030, 31034, 31038, 31042,
+ 31046, 31051, 31056, 31061, 31065, 31069, 31074, 0, 31079, 31084, 31089,
+ 31094, 31100, 31106, 31112, 31118, 31123, 31128, 31134, 31140, 0, 0, 0,
+ 0, 31147, 31152, 31158, 31164, 31170, 31175, 31180, 31185, 31190, 31195,
+ 31200, 31205, 0, 0, 0, 0, 31210, 0, 0, 0, 31215, 31220, 31225, 31230,
+ 31234, 31238, 31242, 31246, 31250, 31254, 31258, 31262, 31266, 31271,
+ 31277, 31283, 31289, 31294, 31299, 31305, 31311, 31316, 31321, 31327,
+ 31332, 31338, 31344, 31349, 31355, 31361, 31367, 31372, 31377, 31382,
+ 31388, 31394, 31399, 31405, 31410, 31416, 31421, 31427, 0, 0, 31433,
+ 31439, 31445, 31451, 31457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31463,
+ 31472, 31481, 31489, 31498, 31507, 31515, 31524, 31533, 31542, 31550,
+ 31558, 31567, 31575, 31583, 31592, 31601, 31609, 31618, 31627, 31635,
+ 31643, 31652, 31660, 31668, 31677, 31685, 31694, 31703, 31711, 31720,
+ 31729, 31737, 31745, 31754, 31763, 31771, 31780, 31789, 31798, 31807,
+ 31816, 31825, 31834, 0, 0, 0, 0, 31843, 31853, 31862, 31871, 31879,
+ 31888, 31896, 31905, 31913, 31922, 31931, 31940, 31949, 31958, 31967,
+ 31976, 31985, 31994, 32003, 32012, 32021, 32030, 32039, 32048, 32057,
+ 32065, 0, 0, 0, 0, 0, 0, 32073, 32081, 32088, 32095, 32102, 32109, 32116,
+ 32123, 32130, 32137, 32144, 0, 0, 0, 32152, 32160, 32168, 32172, 32178,
+ 32184, 32190, 32196, 32202, 32208, 32214, 32220, 32226, 32232, 32238,
+ 32244, 32250, 32256, 32262, 32266, 32272, 32278, 32284, 32290, 32296,
+ 32302, 32308, 32314, 32320, 32326, 32332, 32338, 32344, 32350, 32356,
+ 32360, 32365, 32370, 32375, 32379, 32384, 32388, 32393, 32398, 32403,
+ 32407, 32412, 32417, 32422, 32427, 32432, 32436, 32440, 32444, 32449,
+ 32453, 32457, 32461, 32466, 32471, 32476, 32481, 0, 0, 32487, 32491,
+ 32498, 32503, 32509, 32515, 32520, 32526, 32532, 32537, 32543, 32549,
+ 32555, 32560, 32566, 32571, 32576, 32582, 32587, 32593, 32598, 32604,
+ 32610, 32616, 32622, 32626, 32631, 32636, 32642, 32648, 32653, 32659,
+ 32665, 32669, 32674, 32679, 32683, 32688, 32692, 32697, 32702, 32708,
+ 32714, 32719, 32724, 32729, 32733, 32738, 32742, 32747, 32751, 32756,
+ 32761, 32766, 32771, 32777, 32784, 32791, 32801, 32810, 32817, 32823,
+ 32834, 32839, 32845, 0, 32850, 32855, 32860, 32868, 32874, 32882, 32887,
+ 32893, 32899, 32905, 32910, 32916, 32921, 32928, 32934, 32939, 32945,
+ 32951, 32957, 32964, 32971, 32978, 32983, 32988, 32995, 33002, 33009,
+ 33016, 33023, 0, 0, 33030, 33037, 33044, 33050, 33056, 33062, 33068,
+ 33074, 33080, 33086, 33092, 0, 0, 0, 0, 0, 0, 33098, 33104, 33109, 33114,
+ 33119, 33124, 33129, 33134, 33139, 33144, 0, 0, 0, 0, 0, 0, 33149, 33154,
+ 33159, 33164, 33169, 33174, 33179, 33188, 33195, 33200, 33205, 33210,
+ 33215, 33220, 0, 0, 33225, 33232, 33235, 33238, 33242, 33247, 33251,
+ 33257, 33262, 33268, 33275, 33283, 33287, 33292, 33296, 33301, 33308,
+ 33316, 33323, 33329, 33337, 33344, 33349, 33353, 33360, 33364, 33369,
+ 33374, 33381, 33389, 33396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33404, 33410, 33416, 33420, 33424, 33428,
+ 33432, 33438, 33442, 33448, 33452, 33458, 33464, 33472, 33478, 33486,
+ 33490, 33494, 33498, 33504, 33507, 33513, 33517, 33523, 33527, 33531,
+ 33537, 33541, 33547, 33551, 33557, 33565, 33573, 33581, 33587, 33591,
+ 33597, 33601, 33607, 33610, 33613, 33619, 33623, 33629, 33632, 33635,
+ 33638, 33641, 33645, 33651, 33657, 33660, 33663, 33667, 33672, 33677,
+ 33684, 33689, 33696, 33703, 33712, 33719, 33728, 33733, 33740, 33747,
+ 33756, 33761, 33768, 33773, 33779, 33785, 33791, 33797, 33803, 33809,
+ 33815, 0, 0, 0, 33821, 33825, 33828, 33831, 33834, 33837, 33840, 33843,
+ 33846, 33849, 33852, 33855, 33858, 33861, 33866, 33871, 33876, 33879,
+ 33884, 33889, 33894, 33899, 33906, 33911, 33916, 33921, 33926, 33933,
+ 33939, 33945, 33951, 33957, 33963, 33972, 33981, 33987, 33993, 34002,
+ 34011, 34020, 34029, 34038, 34047, 34056, 34065, 34074, 34079, 0, 34084,
+ 34089, 34094, 34099, 34103, 34107, 34111, 34116, 34120, 34124, 34129,
+ 34133, 34138, 34143, 34148, 34153, 34158, 34163, 34168, 34173, 34178,
+ 34182, 34186, 34191, 34196, 34201, 34205, 34209, 34213, 34217, 34222,
+ 34226, 34231, 34235, 34241, 34247, 34253, 34259, 34265, 34271, 34277,
+ 34283, 34289, 34294, 34299, 34306, 34314, 34319, 34324, 34329, 34333,
+ 34337, 34341, 34345, 34349, 34353, 34357, 34361, 34365, 34369, 34374,
+ 34379, 34384, 34390, 34396, 34400, 34406, 34410, 34416, 34422, 34427,
+ 34434, 34438, 34444, 34448, 34454, 34459, 34466, 34473, 34478, 34485,
+ 34490, 34495, 34499, 34505, 34509, 34515, 34522, 34529, 34533, 34539,
+ 34545, 34549, 34555, 34560, 34564, 34570, 34575, 34580, 34585, 34590,
+ 34594, 34598, 34603, 34608, 34615, 34621, 34626, 34633, 34638, 34645,
+ 34650, 34659, 34665, 34671, 34675, 0, 0, 0, 0, 0, 0, 0, 0, 34679, 34688,
+ 34695, 34702, 34709, 34713, 34718, 34723, 34728, 34733, 34738, 34743,
+ 34748, 34753, 34758, 34763, 34768, 34773, 34777, 34781, 34786, 34791,
+ 34796, 34801, 34806, 34811, 34815, 34820, 34825, 34830, 34835, 34839,
+ 34843, 34847, 34851, 34856, 34861, 34865, 34870, 34875, 34879, 34885,
+ 34891, 34897, 34902, 34907, 34913, 34918, 34924, 34929, 34935, 34941,
+ 34946, 34952, 34958, 34963, 34969, 34975, 34981, 34986, 0, 0, 0, 34991,
+ 34997, 35007, 35013, 35021, 35027, 35032, 35036, 35040, 35044, 35048,
+ 35052, 35056, 35060, 35064, 0, 0, 0, 35068, 35073, 35078, 35083, 35090,
+ 35096, 35102, 35108, 35114, 35120, 35126, 35132, 35138, 35144, 35150,
+ 35157, 35164, 35171, 35178, 35185, 35192, 35199, 35206, 35213, 35220,
+ 35227, 35234, 35241, 35248, 35255, 35262, 35269, 35276, 35283, 35290,
+ 35297, 35304, 35311, 35318, 35325, 35332, 35339, 35346, 35353, 35361,
+ 35369, 35377, 35383, 35389, 35395, 35403, 35412, 35419, 35426, 35432,
+ 35439, 35446, 35453, 35461, 35468, 0, 0, 0, 0, 0, 0, 0, 35475, 35482,
+ 35489, 35496, 35503, 35510, 35517, 35524, 35531, 35538, 35545, 35552,
+ 35559, 35566, 35573, 35580, 35587, 35594, 35601, 35608, 35615, 35622,
+ 35629, 35636, 35643, 35650, 35657, 35664, 35671, 35678, 35685, 35692,
+ 35699, 35706, 35713, 35720, 35727, 35734, 35741, 35748, 35755, 35762,
+ 35770, 0, 0, 35777, 35784, 35792, 35800, 35808, 35816, 35824, 35832,
+ 35842, 35852, 35862, 0, 0, 0, 0, 0, 0, 0, 0, 35872, 35877, 35882, 35887,
+ 35892, 35901, 35912, 35921, 35932, 35938, 35951, 35957, 35964, 35971,
+ 35976, 35982, 35988, 35999, 36008, 36015, 36022, 36031, 36038, 36047,
+ 36057, 36067, 36074, 36081, 36088, 36098, 36103, 36111, 36117, 36125,
+ 36134, 36139, 36146, 36152, 36157, 36162, 36167, 36173, 36180, 0, 0, 0,
+ 0, 0, 36188, 36193, 36199, 36205, 36213, 36219, 36225, 36231, 36236,
+ 36243, 36248, 36254, 36260, 36268, 36274, 36282, 36287, 36294, 36300,
+ 36308, 36316, 36322, 36328, 36335, 36342, 36348, 36355, 36361, 36367,
+ 36372, 36378, 36386, 36394, 36400, 36406, 36412, 36418, 36426, 36430,
+ 36436, 36442, 36448, 36454, 36460, 36466, 36470, 36475, 36480, 36487,
+ 36492, 36496, 36502, 36507, 36512, 36516, 36521, 36526, 36530, 36535,
+ 36540, 36547, 36551, 36556, 36561, 36565, 36570, 36574, 36579, 36583,
+ 36588, 36593, 36599, 36604, 36609, 36613, 36618, 36624, 36631, 36636,
+ 36641, 36646, 36651, 36656, 36660, 36666, 36673, 36680, 36685, 36690,
+ 36694, 36700, 36706, 36711, 36716, 36721, 36727, 36732, 36738, 36743,
+ 36749, 36755, 36761, 36768, 36775, 36782, 36789, 36796, 36803, 36808,
+ 36816, 36825, 36834, 36843, 36852, 36861, 36870, 36882, 36891, 36900,
+ 36909, 36915, 36920, 36927, 36935, 36943, 36950, 36957, 36964, 36971,
+ 36979, 36988, 36997, 37006, 37015, 37024, 37033, 37042, 37051, 37060,
+ 37069, 37078, 37087, 37096, 37105, 37113, 37122, 37133, 37142, 37153,
+ 37166, 37175, 37184, 37194, 37203, 37211, 37220, 37226, 37231, 37239,
+ 37244, 37252, 37257, 37266, 37272, 37278, 37285, 37290, 37295, 37303,
+ 37311, 37320, 37329, 37334, 37341, 37351, 37359, 37368, 37374, 37380,
+ 37385, 37392, 37397, 37406, 37411, 37416, 37421, 37428, 37434, 37439,
+ 37448, 37456, 37461, 37466, 37473, 37480, 37484, 37488, 37491, 37494,
+ 37497, 37500, 37503, 37506, 37513, 37516, 37519, 37524, 37528, 37532,
+ 37536, 37540, 37544, 37554, 37560, 37566, 37572, 37580, 37588, 37594,
+ 37600, 37607, 37613, 37618, 37624, 37631, 37637, 37644, 37650, 37658,
+ 37664, 37671, 37677, 37683, 37689, 37695, 37701, 37707, 37718, 37728,
+ 37734, 37740, 37750, 37756, 37764, 37772, 37780, 37785, 37790, 37796,
+ 37801, 37809, 37815, 37819, 37826, 37833, 37838, 37847, 37855, 37863,
+ 37870, 37877, 37884, 37891, 37899, 37907, 37918, 37929, 37937, 37945,
+ 37953, 37961, 37970, 37979, 37987, 37995, 38004, 38013, 38024, 38035,
+ 38046, 38057, 38066, 38075, 38084, 38093, 38104, 38115, 38123, 38131,
+ 38139, 38147, 38155, 38163, 38171, 38179, 38187, 38195, 38203, 38211,
+ 38220, 38229, 38238, 38247, 38258, 38269, 38277, 38285, 38293, 38301,
+ 38310, 38319, 38327, 38335, 38347, 38359, 38368, 38377, 38386, 38395,
+ 38403, 38411, 38419, 38427, 38435, 38443, 38451, 38459, 38467, 38475,
+ 38484, 38493, 38502, 38511, 38521, 38531, 38541, 38551, 38561, 38571,
+ 38581, 38591, 38599, 38607, 38615, 38623, 38631, 38639, 38647, 38655,
+ 38667, 38679, 38688, 38697, 38705, 38713, 38721, 38729, 38740, 38751,
+ 38762, 38773, 38785, 38797, 38805, 38813, 38821, 38829, 38838, 38847,
+ 38856, 38865, 38873, 38881, 38889, 38897, 38905, 38913, 38923, 38933,
+ 38943, 38953, 38961, 38969, 38977, 38985, 38993, 39001, 39009, 39017,
+ 39025, 39033, 39041, 39049, 39057, 39065, 39073, 39081, 39089, 39097,
+ 39105, 39113, 39121, 39129, 39137, 39145, 39154, 39163, 39172, 39180,
+ 39189, 39198, 39207, 39216, 39226, 39235, 39242, 39247, 39254, 39261,
+ 39269, 39277, 39287, 39297, 39307, 39317, 39328, 39339, 39349, 39359,
+ 39369, 39379, 39389, 39399, 39409, 39419, 39430, 39441, 39451, 39461,
+ 39471, 39481, 39489, 39497, 39506, 39515, 39523, 39531, 39542, 39553,
+ 39564, 39575, 39587, 39599, 39610, 39621, 39632, 39643, 39652, 39661,
+ 39669, 39677, 39684, 39691, 39699, 39707, 39717, 39727, 39737, 39747,
+ 39758, 39769, 39779, 39789, 39799, 39809, 39819, 39829, 39839, 39849,
+ 39860, 39871, 39881, 39891, 39901, 39911, 39918, 39925, 39933, 39941,
+ 39951, 39961, 39971, 39981, 39992, 40003, 40013, 40023, 40033, 40043,
+ 40051, 40059, 40067, 40075, 40084, 40093, 40101, 40109, 40116, 40123,
+ 40130, 40137, 40145, 40153, 40161, 40169, 40180, 40191, 40202, 40213,
+ 40224, 40235, 40243, 40251, 40262, 40273, 40284, 40295, 40306, 40317,
+ 40325, 40333, 40344, 40355, 40366, 0, 0, 40377, 40385, 40393, 40404,
+ 40415, 40426, 0, 0, 40437, 40445, 40453, 40464, 40475, 40486, 40497,
+ 40508, 40519, 40527, 40535, 40546, 40557, 40568, 40579, 40590, 40601,
+ 40609, 40617, 40628, 40639, 40650, 40661, 40672, 40683, 40691, 40699,
+ 40710, 40721, 40732, 40743, 40754, 40765, 40773, 40781, 40792, 40803,
+ 40814, 0, 0, 40825, 40833, 40841, 40852, 40863, 40874, 0, 0, 40885,
+ 40893, 40901, 40912, 40923, 40934, 40945, 40956, 0, 40967, 0, 40975, 0,
+ 40986, 0, 40997, 41008, 41016, 41024, 41035, 41046, 41057, 41068, 41079,
+ 41090, 41098, 41106, 41117, 41128, 41139, 41150, 41161, 41172, 41180,
+ 41188, 41196, 41204, 41212, 41220, 41228, 41236, 41244, 41252, 41260,
+ 41268, 41276, 0, 0, 41284, 41295, 41306, 41320, 41334, 41348, 41362,
+ 41376, 41390, 41401, 41412, 41426, 41440, 41454, 41468, 41482, 41496,
+ 41507, 41518, 41532, 41546, 41560, 41574, 41588, 41602, 41613, 41624,
+ 41638, 41652, 41666, 41680, 41694, 41708, 41719, 41730, 41744, 41758,
+ 41772, 41786, 41800, 41814, 41825, 41836, 41850, 41864, 41878, 41892,
+ 41906, 41920, 41928, 41936, 41947, 41955, 0, 41966, 41974, 41985, 41993,
+ 42001, 42009, 42017, 42025, 42028, 42031, 42034, 42037, 42043, 42054,
+ 42062, 0, 42073, 42081, 42092, 42100, 42108, 42116, 42124, 42132, 42138,
+ 42144, 42150, 42158, 42166, 42177, 0, 0, 42188, 42196, 42207, 42215,
+ 42223, 42231, 0, 42239, 42245, 42251, 42257, 42265, 42273, 42284, 42295,
+ 42303, 42311, 42319, 42330, 42338, 42346, 42354, 42362, 42370, 42376,
+ 42382, 0, 0, 42385, 42396, 42404, 0, 42415, 42423, 42434, 42442, 42450,
+ 42458, 42466, 42474, 42477, 0, 42480, 42484, 42488, 42492, 42496, 42500,
+ 42504, 42508, 42512, 42516, 42520, 42524, 42530, 42536, 42542, 42545,
+ 42548, 42550, 42554, 42558, 42562, 42566, 42569, 42573, 42577, 42583,
+ 42589, 42596, 42603, 42608, 42613, 42619, 42625, 42627, 42630, 42632,
+ 42636, 42640, 42644, 42648, 42652, 42656, 42660, 42664, 42668, 42674,
+ 42678, 42682, 42688, 42693, 42700, 42702, 42705, 42709, 42713, 42718,
+ 42724, 42726, 42735, 42744, 42747, 42751, 42753, 42755, 42757, 42761,
+ 42767, 42769, 42773, 42777, 42784, 42791, 42795, 42800, 42805, 42810,
+ 42815, 42819, 42823, 42826, 42830, 42834, 42841, 42846, 42850, 42854,
+ 42859, 42863, 42867, 42872, 42877, 42881, 42885, 42889, 42891, 42896,
+ 42901, 42905, 42909, 42913, 42917, 0, 42921, 42925, 42929, 42935, 42941,
+ 42947, 42953, 42960, 42967, 42972, 42977, 42981, 0, 0, 42987, 42990,
+ 42993, 42996, 42999, 43002, 43005, 43009, 43013, 43018, 43023, 43028,
+ 43035, 43039, 43042, 43045, 43048, 43051, 43054, 43057, 43060, 43063,
+ 43066, 43070, 43074, 43079, 43084, 0, 43089, 43095, 43101, 43107, 43114,
+ 43121, 43128, 43135, 43141, 43148, 43155, 43162, 43169, 0, 0, 0, 43176,
+ 43179, 43182, 43185, 43190, 43193, 43196, 43199, 43202, 43205, 43208,
+ 43213, 43216, 43219, 43222, 43225, 43228, 43233, 43236, 43239, 43242,
+ 43245, 43248, 43253, 43256, 43259, 43264, 43269, 43273, 43276, 43279,
+ 43282, 43285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43288, 43293,
+ 43298, 43305, 43313, 43318, 43323, 43327, 43331, 43336, 43343, 43350,
+ 43354, 43359, 43364, 43369, 43374, 43381, 43386, 43391, 43396, 43405,
+ 43412, 43419, 43423, 43428, 43434, 43439, 43446, 43454, 43462, 43466,
+ 43470, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43474, 43478, 43485,
+ 43490, 43494, 43499, 43503, 43507, 43511, 43513, 43517, 43521, 43525,
+ 43530, 43535, 43539, 43547, 43550, 43554, 43557, 43560, 43566, 43571,
+ 43574, 43580, 43584, 43589, 43594, 43597, 43601, 43605, 43609, 43611,
+ 43614, 43617, 43621, 43623, 43628, 43631, 43634, 43639, 43644, 43650,
+ 43653, 43656, 43660, 43665, 43668, 43671, 43674, 43678, 43682, 43686,
+ 43689, 43691, 43694, 43697, 43700, 43704, 43709, 43712, 43717, 43722,
+ 43727, 43732, 43738, 43743, 43747, 43752, 43757, 43763, 43769, 43774,
+ 43779, 43785, 43789, 43792, 43795, 43797, 43801, 43807, 43814, 43821,
+ 43828, 43835, 43842, 43849, 43856, 43863, 43871, 43878, 43886, 43893,
+ 43900, 43908, 43916, 43921, 43926, 43931, 43936, 43941, 43946, 43951,
+ 43956, 43961, 43966, 43972, 43978, 43984, 43990, 43997, 44005, 44011,
+ 44017, 44023, 44029, 44035, 44041, 44047, 44053, 44059, 44065, 44072,
+ 44079, 44086, 44093, 44101, 44110, 44117, 44128, 44135, 44142, 44151,
+ 44158, 44167, 44176, 44183, 44191, 44199, 44202, 0, 0, 0, 0, 44205,
+ 44207, 44210, 44212, 44215, 44218, 44221, 44225, 44229, 44234, 44239,
+ 44243, 44247, 44251, 44255, 44260, 44266, 44271, 44277, 44282, 44287,
+ 44292, 44298, 44303, 44309, 44315, 44319, 44323, 44328, 44333, 44338,
+ 44343, 44348, 44356, 44364, 44372, 44380, 44387, 44395, 44402, 44409,
+ 44416, 44426, 44433, 44440, 44447, 44454, 44462, 44470, 44477, 44484,
+ 44492, 44500, 44505, 44513, 44518, 44523, 44529, 44534, 44540, 44547,
+ 44554, 44559, 44565, 44570, 44573, 44577, 44580, 44584, 44588, 44592,
+ 44597, 44602, 44608, 44614, 44618, 44622, 44626, 44630, 44636, 44642,
+ 44646, 44651, 44655, 44660, 44664, 44668, 44671, 44675, 44678, 44682,
+ 44689, 44697, 44709, 44720, 44725, 44734, 44741, 44748, 44756, 44760,
+ 44766, 44774, 44778, 44783, 44788, 44794, 44800, 44806, 44813, 44817,
+ 44821, 44826, 44829, 44831, 44835, 44839, 44847, 44851, 44853, 44855,
+ 44859, 44867, 44872, 44878, 44888, 44895, 44900, 44904, 44908, 44912,
+ 44915, 44918, 44921, 44925, 44929, 44933, 44937, 44941, 44944, 44948,
+ 44952, 44955, 44957, 44960, 44962, 44966, 44970, 44972, 44978, 44981,
+ 44986, 44990, 44994, 44996, 44998, 45000, 45003, 45007, 45011, 45015,
+ 45019, 45023, 45029, 45035, 45037, 45039, 45041, 45043, 45046, 45048,
+ 45052, 45054, 45058, 45062, 45068, 45072, 45076, 45080, 45084, 45089,
+ 45096, 45101, 45112, 45123, 45128, 45135, 45144, 45148, 45153, 45156,
+ 45161, 45165, 45171, 45176, 45189, 45199, 45203, 45207, 45214, 45219,
+ 45222, 45224, 45227, 45231, 45236, 45243, 45247, 45252, 45257, 45260,
+ 45265, 45270, 45277, 45284, 45290, 45296, 45305, 45314, 45318, 45322,
+ 45324, 45329, 45333, 45337, 45346, 45355, 45362, 45369, 45378, 45387,
+ 45393, 45399, 45407, 45415, 45417, 45419, 45426, 45433, 45440, 45447,
+ 45453, 45459, 45463, 45467, 45474, 45481, 45489, 45497, 45508, 45519,
+ 45528, 45537, 45539, 45543, 45547, 45552, 45557, 45566, 45575, 45578,
+ 45581, 45584, 45587, 45590, 45595, 45599, 45604, 45609, 45612, 45615,
+ 45618, 45621, 45624, 45628, 45631, 45634, 45637, 45640, 45642, 45644,
+ 45646, 45648, 45656, 45664, 45670, 45674, 45680, 45690, 45696, 45702,
+ 45708, 45716, 45726, 45739, 45743, 45747, 45749, 45755, 45757, 45759,
+ 45761, 45763, 45769, 45772, 45778, 45784, 45788, 45792, 45796, 45799,
+ 45803, 45807, 45809, 45818, 45827, 45832, 45837, 45843, 45849, 45855,
+ 45858, 45861, 45864, 45867, 45869, 45875, 45880, 45885, 45891, 45897,
+ 45906, 45915, 45922, 45929, 45936, 45943, 45953, 45963, 45974, 45985,
+ 45996, 46007, 46016, 46025, 46034, 46043, 46051, 46063, 46075, 46091,
+ 46094, 46100, 46106, 46112, 46120, 46135, 46151, 46157, 46163, 46170,
+ 46176, 46185, 46192, 46206, 46221, 46226, 46232, 46240, 46243, 46246,
+ 46248, 46251, 46254, 46256, 46258, 46262, 46265, 46268, 46271, 46274,
+ 46279, 46284, 46289, 46294, 46299, 46302, 46304, 46306, 46308, 46312,
+ 46316, 46320, 46326, 46330, 46332, 46334, 46339, 46344, 46349, 46354,
+ 46359, 46364, 46366, 46368, 46378, 46382, 46388, 46397, 46399, 46405,
+ 46411, 46418, 46422, 46424, 46428, 46430, 46434, 46438, 46442, 46444,
+ 46446, 46448, 46455, 46464, 46473, 46482, 46491, 46500, 46509, 46518,
+ 46527, 46535, 46543, 46552, 46561, 46570, 46579, 46587, 46595, 46604,
+ 46613, 46622, 46632, 46641, 46651, 46660, 46670, 46679, 46689, 46699,
+ 46708, 46718, 46727, 46737, 46746, 46756, 46765, 46774, 46783, 46792,
+ 46801, 46811, 46820, 46829, 46838, 46848, 46857, 46866, 46875, 46884,
+ 46894, 46904, 46913, 46922, 46930, 46939, 46946, 46955, 46964, 46975,
+ 46984, 46994, 47004, 47011, 47018, 47025, 47034, 47043, 47052, 47061,
+ 47068, 47073, 47082, 47088, 47091, 47098, 47101, 47106, 47111, 47114,
+ 47117, 47125, 47128, 47133, 47136, 47144, 47149, 47157, 47160, 47163,
+ 47166, 47171, 47176, 47179, 47182, 47190, 47193, 47200, 47207, 47211,
+ 47215, 47220, 47225, 47230, 47235, 47240, 47245, 47250, 47255, 47262,
+ 47268, 47275, 47282, 47288, 47295, 47302, 47310, 47317, 47323, 47330,
+ 47338, 47345, 47349, 47355, 47367, 47379, 47383, 47387, 47392, 47397,
+ 47408, 47412, 47417, 47422, 47428, 47434, 47440, 47446, 47455, 47464,
+ 47472, 47483, 47494, 47502, 47513, 47524, 47532, 47543, 47554, 47562,
+ 47570, 47580, 47590, 47593, 47596, 47599, 47604, 47608, 47614, 47621,
+ 47628, 47636, 47643, 47647, 47651, 47655, 47659, 47661, 47665, 47669,
+ 47675, 47681, 47689, 47697, 47700, 47707, 47709, 47711, 47715, 47719,
+ 47724, 47730, 47736, 47742, 47748, 47757, 47766, 47775, 47779, 47781,
+ 47785, 47792, 47799, 47806, 47813, 47820, 47823, 47828, 47834, 47837,
+ 47842, 47847, 47852, 47857, 47861, 47868, 47875, 47882, 47889, 47893,
+ 47897, 47901, 47905, 47911, 47917, 47922, 47928, 47934, 47940, 47946,
+ 47954, 47961, 47968, 47975, 47982, 47988, 47994, 48003, 48007, 48014,
+ 48018, 48022, 48028, 48034, 48040, 48046, 48050, 48054, 48057, 48061,
+ 48065, 48072, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 48079, 48082, 48086, 48090, 48096, 48102, 48108, 48116,
+ 48123, 48127, 48135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 48140, 48143, 48146, 48149, 48152, 48155, 48158, 48161,
+ 48164, 48167, 48171, 48175, 48179, 48183, 48187, 48191, 48195, 48199,
+ 48203, 48207, 48211, 48214, 48217, 48220, 48223, 48226, 48229, 48232,
+ 48235, 48238, 48242, 48246, 48250, 48254, 48258, 48262, 48266, 48270,
+ 48274, 48278, 48282, 48288, 48294, 48300, 48307, 48314, 48321, 48328,
+ 48335, 48342, 48349, 48356, 48363, 48370, 48377, 48384, 48391, 48398,
+ 48405, 48412, 48419, 48424, 48430, 48436, 48442, 48447, 48453, 48459,
+ 48465, 48470, 48476, 48482, 48487, 48493, 48499, 48504, 48510, 48516,
+ 48521, 48527, 48533, 48538, 48544, 48550, 48556, 48562, 48568, 48573,
+ 48579, 48585, 48591, 48596, 48602, 48608, 48614, 48619, 48625, 48631,
+ 48636, 48642, 48648, 48653, 48659, 48665, 48670, 48676, 48682, 48687,
+ 48693, 48699, 48705, 48711, 48717, 48722, 48728, 48734, 48740, 48745,
+ 48751, 48757, 48763, 48768, 48774, 48780, 48785, 48791, 48797, 48802,
+ 48808, 48814, 48819, 48825, 48831, 48836, 48842, 48848, 48854, 48860,
+ 48866, 48870, 48876, 48882, 48888, 48894, 48900, 48906, 48912, 48918,
+ 48924, 48930, 48934, 48938, 48942, 48946, 48950, 48954, 48958, 48962,
+ 48966, 48971, 48977, 48982, 48987, 48992, 48997, 49006, 49015, 49024,
+ 49033, 49042, 49051, 49060, 49069, 49075, 49083, 49091, 49097, 49104,
+ 49112, 49120, 49127, 49133, 49141, 49149, 49155, 49162, 49170, 49178,
+ 49185, 49191, 49199, 49208, 49217, 49225, 49234, 49243, 49249, 49256,
+ 49264, 49273, 49282, 49290, 49299, 49308, 49315, 49322, 49331, 49340,
+ 49349, 49358, 49367, 49376, 49383, 49390, 49399, 49408, 49417, 49426,
+ 49435, 49444, 49451, 49458, 49467, 49476, 49485, 49495, 49505, 49514,
+ 49524, 49534, 49544, 49554, 49564, 49574, 49583, 49592, 49599, 49607,
+ 49615, 49623, 49631, 49636, 49641, 49650, 49658, 49664, 49673, 49681,
+ 49688, 49697, 49705, 49711, 49720, 49728, 49735, 49744, 49752, 49758,
+ 49767, 49775, 49782, 49792, 49801, 49808, 49818, 49827, 49834, 49844,
+ 49853, 49860, 49868, 49877, 49886, 49894, 49905, 49915, 49922, 49927,
+ 49932, 49936, 49941, 49946, 49951, 49955, 49960, 49967, 49975, 49982,
+ 49990, 49994, 50000, 50006, 50012, 50016, 50023, 50029, 50036, 50040,
+ 50047, 50053, 50060, 50064, 50070, 50076, 50082, 50086, 50089, 50093,
+ 50097, 50103, 50109, 50114, 50118, 50123, 50133, 50140, 50151, 50161,
+ 50165, 50173, 50183, 50186, 50189, 50196, 50204, 50210, 50215, 50223,
+ 50232, 50241, 50249, 50253, 50257, 50260, 50263, 50267, 50271, 50274,
+ 50277, 50282, 50287, 50293, 50299, 50304, 50309, 50315, 50321, 50326,
+ 50331, 50336, 50341, 50347, 50353, 50358, 50363, 50369, 50375, 50380,
+ 50385, 50388, 50391, 50400, 50402, 50404, 50407, 50411, 50417, 50419,
+ 50422, 50429, 50436, 50443, 50450, 50459, 50472, 50477, 50482, 50486,
+ 50491, 50498, 50505, 50513, 50521, 50529, 50537, 50541, 50545, 50550,
+ 50555, 50560, 50565, 50568, 50574, 50580, 50589, 50598, 50606, 50614,
+ 50623, 50632, 50636, 50643, 50650, 50657, 50664, 50672, 50680, 50688,
+ 50696, 50700, 50704, 50708, 50713, 50718, 50724, 50730, 50734, 50740,
+ 50742, 50744, 50746, 50748, 50751, 50754, 50756, 50758, 50760, 50764,
+ 50768, 50770, 50772, 50775, 50778, 50782, 50788, 50794, 50796, 50803,
+ 50807, 50812, 50817, 50819, 50829, 50835, 50841, 50847, 50853, 50859,
+ 50865, 50870, 50873, 50876, 50879, 50881, 50883, 50887, 50891, 50896,
+ 50901, 50906, 50909, 50913, 50918, 50921, 50925, 50930, 50935, 50940,
+ 50945, 50950, 50955, 50960, 50965, 50970, 50975, 50980, 50985, 50991,
+ 50997, 51003, 51005, 51008, 51010, 51013, 51015, 51017, 51019, 51021,
+ 51023, 51025, 51027, 51029, 51031, 51033, 51035, 51037, 51039, 51041,
+ 51043, 51045, 51047, 51052, 51057, 51062, 51067, 51072, 51077, 51082,
+ 51087, 51092, 51097, 51102, 51107, 51112, 51117, 51122, 51127, 51132,
+ 51137, 51142, 51147, 51151, 51155, 51159, 51165, 51171, 51176, 51181,
+ 51186, 51192, 51198, 51203, 51211, 51219, 51227, 51235, 51243, 51251,
+ 51259, 51267, 51273, 51278, 51283, 51288, 51291, 51295, 51299, 51303,
+ 51307, 51311, 51315, 51321, 51328, 51335, 51343, 51348, 51353, 51360,
+ 51367, 51374, 51381, 51384, 51387, 51392, 51394, 51398, 51403, 51405,
+ 51407, 51409, 51411, 51416, 51419, 51421, 51426, 51432, 51439, 51442,
+ 51446, 51451, 51456, 51464, 51470, 51476, 51488, 51495, 51503, 51508,
+ 51513, 51519, 51522, 51525, 51530, 51532, 51536, 51538, 51540, 51542,
+ 51544, 51546, 51548, 51553, 51555, 51557, 51559, 51561, 51565, 51567,
+ 51570, 51575, 51580, 51585, 51590, 51596, 51602, 51604, 51607, 51614,
+ 51620, 51626, 51633, 51637, 51641, 51643, 51645, 51649, 51655, 51660,
+ 51662, 51666, 51675, 51683, 51691, 51697, 51703, 51708, 51714, 51719,
+ 51722, 51736, 51739, 51744, 51749, 51755, 51765, 51767, 51773, 51779,
+ 51783, 51790, 51794, 51796, 51798, 51802, 51808, 51813, 51819, 51821,
+ 51827, 51829, 51835, 51837, 51839, 51844, 51846, 51850, 51855, 51857,
+ 51862, 51867, 51871, 51878, 51888, 51893, 51898, 51901, 51906, 51909,
+ 51914, 51919, 51923, 51925, 51927, 51931, 51935, 51939, 51943, 51947,
+ 51949, 51953, 51956, 51959, 51962, 51966, 51970, 51975, 51979, 51984,
+ 51989, 51993, 51999, 52006, 52009, 52015, 52020, 52024, 52029, 52035,
+ 52041, 52048, 52054, 52061, 52068, 52070, 52077, 52081, 52088, 52094,
+ 52099, 52105, 52109, 52114, 52117, 52123, 52129, 52136, 52144, 52151,
+ 52160, 52170, 52177, 52183, 52187, 52195, 52200, 52209, 52212, 52215,
+ 52224, 52235, 52242, 52244, 52250, 52255, 52257, 52260, 52264, 52272,
+ 52281, 52284, 52289, 52295, 52302, 52309, 52316, 52323, 52329, 52335,
+ 52341, 52349, 52354, 52357, 52361, 52364, 52375, 52385, 52395, 52404,
+ 52415, 52425, 52434, 52440, 52448, 52452, 52460, 52464, 52472, 52479,
+ 52486, 52495, 52504, 52514, 52524, 52534, 52544, 52553, 52562, 52572,
+ 52582, 52591, 52600, 52607, 52614, 52621, 52628, 52635, 52642, 52649,
+ 52656, 52663, 52671, 52677, 52683, 52689, 52695, 52701, 52707, 52713,
+ 52719, 52725, 52732, 52740, 52748, 52756, 52764, 52772, 52780, 52788,
+ 52796, 52804, 52813, 52818, 52821, 52825, 52829, 52835, 52838, 52843,
+ 52849, 52854, 52858, 52863, 52869, 52876, 52879, 52886, 52893, 52897,
+ 52906, 52915, 52920, 52926, 52931, 52936, 52943, 52950, 52957, 52964,
+ 52972, 52976, 52984, 52989, 52993, 53000, 53004, 53010, 53018, 53023,
+ 53030, 53034, 53039, 53043, 53048, 53052, 53057, 53062, 53071, 53073,
+ 53077, 53081, 53088, 53095, 53101, 53109, 53115, 53122, 53127, 53130,
+ 53135, 53140, 53145, 53153, 53157, 53164, 53171, 53178, 53183, 53188,
+ 53194, 53199, 53204, 53210, 53215, 53218, 53222, 53226, 53233, 53243,
+ 53248, 53257, 53266, 53272, 53278, 53284, 53290, 53296, 53302, 53309,
+ 53316, 53325, 53334, 53340, 53346, 53351, 53356, 53363, 53370, 53376,
+ 53379, 53382, 53386, 53390, 53394, 53399, 53405, 53411, 53418, 53425,
+ 53430, 53434, 53438, 53442, 53446, 53450, 53454, 53458, 53462, 53466,
+ 53470, 53474, 53478, 53482, 53486, 53490, 53494, 53498, 53502, 53506,
+ 53510, 53514, 53518, 53522, 53526, 53530, 53534, 53538, 53542, 53546,
+ 53550, 53554, 53558, 53562, 53566, 53570, 53574, 53578, 53582, 53586,
+ 53590, 53594, 53598, 53602, 53606, 53610, 53614, 53618, 53622, 53626,
+ 53630, 53634, 53638, 53642, 53646, 53650, 53654, 53658, 53662, 53666,
+ 53670, 53674, 53678, 53682, 53686, 53690, 53694, 53698, 53702, 53706,
+ 53710, 53714, 53718, 53722, 53726, 53730, 53734, 53738, 53742, 53746,
+ 53750, 53754, 53758, 53762, 53766, 53770, 53774, 53778, 53782, 53786,
+ 53790, 53794, 53798, 53802, 53806, 53810, 53814, 53818, 53822, 53826,
+ 53830, 53834, 53838, 53842, 53846, 53850, 53854, 53858, 53862, 53866,
+ 53870, 53874, 53878, 53882, 53886, 53890, 53894, 53898, 53902, 53906,
+ 53910, 53914, 53918, 53922, 53926, 53930, 53934, 53938, 53942, 53946,
+ 53950, 53954, 53958, 53962, 53966, 53970, 53974, 53978, 53982, 53986,
+ 53990, 53994, 53998, 54002, 54006, 54010, 54014, 54018, 54022, 54026,
+ 54030, 54034, 54038, 54042, 54046, 54050, 54054, 54058, 54062, 54066,
+ 54070, 54074, 54078, 54082, 54086, 54090, 54094, 54098, 54102, 54106,
+ 54110, 54114, 54118, 54122, 54126, 54130, 54134, 54138, 54142, 54146,
+ 54150, 54154, 54158, 54162, 54166, 54170, 54174, 54178, 54182, 54186,
+ 54190, 54194, 54198, 54202, 54206, 54210, 54214, 54218, 54222, 54226,
+ 54230, 54234, 54238, 54242, 54246, 54250, 54254, 54258, 54262, 54266,
+ 54270, 54274, 54278, 54282, 54286, 54290, 54294, 54298, 54302, 54306,
+ 54310, 54314, 54318, 54322, 54326, 54330, 54334, 54338, 54342, 54346,
+ 54350, 54354, 54358, 54362, 54366, 54370, 54374, 54378, 54382, 54386,
+ 54390, 54394, 54398, 54402, 54406, 54410, 54414, 54418, 54422, 54426,
+ 54430, 54434, 54438, 54442, 54446, 54450, 54454, 54461, 54469, 54475,
+ 54481, 54488, 54495, 54501, 54507, 54514, 54521, 54526, 54531, 54536,
+ 54541, 54547, 54553, 54561, 54568, 54573, 54578, 54586, 54595, 54602,
+ 54612, 54623, 54626, 54629, 54633, 54637, 54643, 54649, 54659, 54669,
+ 54678, 54687, 54693, 54699, 54706, 54713, 54722, 54732, 54743, 54753,
+ 54763, 54773, 54784, 54795, 54805, 54816, 54826, 54836, 54844, 54854,
+ 54864, 54875, 54886, 54893, 54900, 54907, 54914, 54924, 54934, 54941,
+ 54948, 54955, 54962, 54969, 54976, 54983, 54988, 54993, 54999, 55007,
+ 55017, 55025, 55033, 55041, 55049, 55057, 55065, 55073, 55081, 55089,
+ 55097, 55106, 55115, 55123, 55131, 55140, 55149, 55158, 55167, 55177,
+ 55187, 55196, 55205, 55215, 55225, 55239, 55255, 55269, 55285, 55299,
+ 55313, 55327, 55341, 55351, 55362, 55372, 55383, 55399, 55415, 55423,
+ 55429, 55436, 55443, 55450, 55458, 55463, 55469, 55474, 55479, 55485,
+ 55490, 55495, 55500, 55505, 55510, 55517, 55523, 55531, 55537, 55543,
+ 55547, 55551, 55560, 55569, 55578, 55587, 55594, 55601, 55614, 55627,
+ 55640, 55653, 55661, 55669, 55676, 55683, 55691, 55699, 55707, 55715,
+ 55719, 55724, 55732, 55740, 55748, 55755, 55759, 55767, 55775, 55778,
+ 55782, 55787, 55794, 55802, 55810, 55829, 55849, 55868, 55888, 55908,
+ 55928, 55948, 55968, 55974, 55981, 55990, 55998, 56006, 56012, 56015,
+ 56018, 56023, 56026, 56046, 56053, 56059, 56065, 56069, 56072, 56075,
+ 56078, 56088, 56100, 56107, 56114, 56117, 56121, 56124, 56129, 56134,
+ 56139, 56145, 56154, 56161, 56168, 56176, 56183, 56190, 56193, 56199,
+ 56205, 56208, 56211, 56216, 56221, 56227, 56233, 56237, 56242, 56249,
+ 56253, 56259, 56263, 56267, 56275, 56287, 56295, 56299, 56301, 56310,
+ 56319, 56325, 56328, 56334, 56340, 56345, 56350, 56355, 56360, 56365,
+ 56370, 56372, 56378, 56383, 56391, 56395, 56401, 56404, 56408, 56416,
+ 56424, 56426, 56428, 56434, 56440, 56446, 56455, 56464, 56471, 56478,
+ 56484, 56491, 56496, 56501, 56506, 56512, 56518, 56523, 56530, 56534,
+ 56538, 56551, 56564, 56576, 56585, 56591, 56598, 56603, 56608, 56613,
+ 56618, 56623, 56625, 56632, 56640, 56648, 56656, 56663, 56671, 56677,
+ 56682, 56688, 56694, 56700, 56707, 56713, 56721, 56729, 56737, 56745,
+ 56753, 56759, 56765, 56774, 56778, 56787, 56796, 56805, 56813, 56817,
+ 56823, 56830, 56837, 56841, 56847, 56855, 56861, 56866, 56872, 56877,
+ 56882, 56889, 56896, 56901, 56906, 56914, 56922, 56932, 56942, 56949,
+ 56956, 56960, 56964, 56976, 56982, 56989, 56994, 56999, 57006, 57013,
+ 57019, 57025, 57035, 57042, 57050, 57058, 57067, 57074, 57080, 57087,
+ 57093, 57101, 57109, 57117, 57125, 57131, 57136, 57146, 57157, 57164,
+ 57173, 57179, 57184, 57189, 57199, 57208, 57214, 57220, 57228, 57233,
+ 57240, 57247, 57258, 57265, 57272, 57279, 57286, 57293, 57302, 57311,
+ 57324, 57337, 57349, 57361, 57374, 57388, 57394, 57400, 57410, 57420,
+ 57427, 57434, 57444, 57454, 57463, 57472, 57480, 57488, 57498, 57508,
+ 57523, 57538, 57547, 57556, 57569, 57582, 57591, 57600, 57611, 57622,
+ 57628, 57634, 57643, 57652, 57657, 57662, 57670, 57676, 57682, 57690,
+ 57698, 57711, 57724, 57728, 57732, 57741, 57750, 57757, 57765, 57773,
+ 57783, 57793, 57799, 57805, 57813, 57821, 57829, 57837, 57847, 57857,
+ 57860, 57863, 57868, 57873, 57879, 57885, 57892, 57899, 57910, 57921,
+ 57928, 57935, 57943, 57951, 57960, 57969, 57978, 57987, 57994, 58001,
+ 58005, 58009, 58018, 58027, 58032, 58037, 58042, 58047, 58053, 58067,
+ 58074, 58081, 58085, 58087, 58089, 58094, 58099, 58104, 58109, 58117,
+ 58124, 58131, 58139, 58151, 58159, 58167, 58178, 58182, 58186, 58192,
+ 58200, 58213, 58220, 58227, 58234, 58240, 58247, 58256, 58265, 58271,
+ 58277, 58283, 58294, 58305, 58313, 58322, 58327, 58330, 58335, 58340,
+ 58345, 58351, 58357, 58361, 58364, 58368, 58372, 58377, 58382, 58388,
+ 58394, 58398, 58402, 58409, 58416, 58423, 58430, 58437, 58444, 58453,
+ 58462, 58469, 58476, 58484, 58492, 58496, 58501, 58506, 58512, 58518,
+ 58521, 58524, 58527, 58530, 58535, 58540, 58545, 58550, 58555, 58560,
+ 58564, 58568, 58572, 58577, 58582, 58586, 58590, 58596, 58600, 58606,
+ 58611, 58618, 58626, 58633, 58641, 58648, 58656, 58665, 58672, 58682,
+ 58693, 58699, 58708, 58714, 58723, 58733, 58739, 58745, 58749, 58753,
+ 58762, 58772, 58779, 58787, 58796, 58805, 58812, 58818, 58825, 58830,
+ 58834, 58838, 58843, 58848, 58853, 58861, 58869, 58872, 58876, 58885,
+ 58895, 58904, 58914, 58926, 58940, 58944, 58949, 58953, 58958, 58963,
+ 58968, 58974, 58980, 58987, 58994, 59000, 59007, 59013, 59020, 59029,
+ 59038, 59044, 59051, 59057, 0, 0, 59064, 59072, 59080, 59089, 59098,
+ 59107, 59117, 59126, 59136, 59142, 59147, 59156, 59168, 59177, 59189,
+ 59196, 59204, 59211, 59219, 59224, 59230, 59235, 59241, 59249, 59258,
+ 59266, 59275, 59279, 59282, 59286, 59289, 59299, 0, 59302, 59309, 59318,
+ 59328, 59337, 59347, 59353, 59360, 59366, 59373, 59384, 59395, 59406,
+ 59417, 59427, 59437, 59447, 59457, 59465, 59473, 59481, 59489, 59497,
+ 59505, 59513, 59521, 59527, 59532, 59538, 59543, 59549, 59555, 59561,
+ 59567, 59579, 59589, 59594, 59601, 59606, 59613, 59616, 59620, 59624,
+ 59629, 59633, 59638, 59641, 59650, 59659, 59668, 59677, 59682, 59688,
+ 59694, 59702, 59712, 59719, 59728, 59733, 59736, 59739, 59744, 59749,
+ 59754, 59759, 59761, 59763, 59765, 59767, 59769, 59771, 59776, 59783,
+ 59790, 59792, 59794, 59796, 59798, 59800, 59802, 59804, 59806, 59811,
+ 59816, 59823, 59830, 59839, 59849, 59858, 59868, 59873, 59878, 59880,
+ 59887, 59894, 59901, 59908, 59915, 59922, 59929, 59932, 59935, 59938,
+ 59941, 59946, 59951, 59956, 59961, 59966, 59971, 59976, 59981, 59986,
+ 59991, 59996, 60001, 60007, 60011, 60016, 60021, 60026, 60031, 60036,
+ 60041, 60046, 60051, 60056, 60061, 60066, 60071, 60076, 60081, 60086,
+ 60091, 60096, 60101, 60106, 60111, 60116, 60121, 60127, 60132, 60138,
+ 60147, 60152, 60160, 60167, 60176, 60181, 60186, 60191, 60197, 60204,
+ 60211, 60216, 60221, 60226, 60231, 60236, 60241, 60246, 60251, 60256,
+ 60261, 60267, 60271, 60276, 60281, 60286, 60291, 60296, 60301, 60306,
+ 60311, 60316, 60321, 60326, 60331, 60336, 60341, 60346, 60351, 60356,
+ 60361, 60366, 60371, 60376, 60381, 60387, 60392, 60398, 60407, 60412,
+ 60420, 60427, 60436, 60441, 60446, 60451, 60457, 60464, 60471, 60479,
+ 60487, 60496, 60503, 60511, 60517, 60526, 60534, 60542, 60550, 60558,
+ 60566, 60574, 60579, 60586, 60591, 60597, 60605, 60612, 60619, 60627,
+ 60633, 60639, 60646, 60654, 60663, 60673, 60679, 60686, 60691, 60701,
+ 60711, 60716, 60721, 60726, 60731, 60736, 60741, 60746, 60751, 60756,
+ 60761, 60766, 60771, 60776, 60781, 60786, 60791, 60796, 60801, 60806,
+ 60811, 60816, 60821, 60826, 60831, 60836, 60841, 60846, 60851, 60856,
+ 60861, 60865, 60869, 60874, 60879, 60884, 60889, 60894, 60899, 60904,
+ 60909, 60914, 60919, 60924, 60929, 60934, 60939, 60944, 60949, 60954,
+ 60959, 60966, 60973, 60980, 60987, 60994, 61001, 61008, 61015, 61022,
+ 61029, 61036, 61043, 61050, 61057, 61062, 61067, 61074, 61081, 61088,
+ 61095, 61102, 61109, 61116, 61123, 61130, 61137, 61144, 61151, 61157,
+ 61163, 61169, 61175, 61182, 61189, 61196, 61203, 61210, 61217, 61224,
+ 61231, 61238, 61245, 61253, 61261, 61269, 61277, 61285, 61293, 61301,
+ 61309, 61313, 61319, 61325, 61329, 61335, 61341, 61347, 61354, 61361,
+ 61368, 61375, 61380, 61386, 61392, 61399, 0, 0, 0, 0, 0, 61406, 61414,
+ 61423, 61432, 61440, 61446, 61451, 61456, 61461, 61466, 61471, 61476,
+ 61481, 61486, 61491, 61496, 61501, 61506, 61511, 61516, 61521, 61526,
+ 61531, 61536, 61541, 61546, 61551, 61556, 61561, 61566, 61571, 61576,
+ 61581, 61586, 61591, 61596, 61601, 61606, 61611, 61616, 61621, 61626,
+ 61631, 61636, 61641, 0, 61646, 0, 0, 0, 0, 0, 61651, 0, 0, 61656, 61660,
+ 61665, 61670, 61675, 61680, 61689, 61694, 61699, 61704, 61709, 61714,
+ 61719, 61724, 61729, 61736, 61741, 61746, 61755, 61762, 61767, 61772,
+ 61777, 61784, 61789, 61796, 61801, 61806, 61813, 61820, 61825, 61830,
+ 61835, 61842, 61849, 61854, 61859, 61864, 61869, 61874, 61881, 61888,
+ 61893, 61898, 61903, 61908, 61913, 61918, 61923, 61928, 61933, 61938,
+ 61943, 61950, 61955, 61960, 0, 0, 0, 0, 0, 0, 0, 61965, 61972, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61977, 61982, 61986, 61990, 61994,
+ 61998, 62002, 62006, 62010, 62014, 62018, 62022, 62028, 62032, 62036,
+ 62040, 62044, 62048, 62052, 62056, 62060, 62064, 62068, 62072, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 62076, 62080, 62084, 62088, 62092, 62096, 62100, 0,
+ 62104, 62108, 62112, 62116, 62120, 62124, 62128, 0, 62132, 62136, 62140,
+ 62144, 62148, 62152, 62156, 0, 62160, 62164, 62168, 62172, 62176, 62180,
+ 62184, 0, 62188, 62192, 62196, 62200, 62204, 62208, 62212, 0, 62216,
+ 62220, 62224, 62228, 62232, 62236, 62240, 0, 62244, 62248, 62252, 62256,
+ 62260, 62264, 62268, 0, 62272, 62276, 62280, 62284, 62288, 62292, 62296,
+ 0, 62300, 62305, 62310, 62315, 62320, 62325, 62330, 62334, 62339, 62344,
+ 62349, 62353, 62358, 62363, 62368, 62373, 62377, 62382, 62387, 62392,
+ 62397, 62402, 62407, 62411, 62416, 62421, 62428, 62433, 62438, 62444,
+ 62451, 62458, 62467, 62474, 62483, 62488, 62493, 62500, 62507, 62513,
+ 62521, 62527, 62532, 62537, 62541, 62548, 62555, 62559, 62561, 62565,
+ 62571, 62573, 62577, 62581, 62585, 62591, 62596, 62600, 62604, 62609,
+ 62615, 62621, 62627, 62632, 62637, 62644, 62651, 62657, 62663, 62669,
+ 62675, 62681, 62687, 62691, 62695, 62702, 62709, 62715, 62719, 62724,
+ 62727, 62731, 62738, 62741, 62745, 62749, 62752, 62758, 62764, 62767,
+ 62773, 62777, 62781, 62787, 62792, 62797, 62799, 62802, 62806, 62812,
+ 62818, 62822, 62827, 62836, 62839, 62845, 62850, 62854, 62858, 62862,
+ 62865, 62870, 62876, 62884, 62892, 62898, 62903, 62908, 62914, 62920,
+ 62927, 62934, 62940, 62946, 62952, 62958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 62962, 62966, 62970, 62975, 62980, 62985, 62989, 62993, 62997, 63002,
+ 63007, 63011, 63015, 63019, 63023, 63028, 63033, 63038, 63043, 63047,
+ 63051, 63056, 63061, 63066, 63071, 63075, 0, 63079, 63083, 63087, 63091,
+ 63095, 63099, 63103, 63108, 63113, 63117, 63122, 63127, 63136, 63140,
+ 63144, 63148, 63155, 63159, 63164, 63169, 63173, 63177, 63183, 63188,
+ 63193, 63198, 63203, 63207, 63211, 63215, 63219, 63223, 63228, 63233,
+ 63237, 63241, 63246, 63251, 63256, 63260, 63264, 63269, 63274, 63280,
+ 63286, 63290, 63296, 63302, 63306, 63312, 63318, 63323, 63328, 63332,
+ 63338, 63342, 63346, 63352, 63358, 63363, 63368, 63372, 63376, 63384,
+ 63390, 63396, 63402, 63407, 63412, 63417, 63423, 63427, 63433, 63437,
+ 63441, 63447, 63453, 63459, 63465, 63471, 63477, 63483, 63489, 63495,
+ 63501, 63507, 63513, 63517, 63523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 63529, 63532, 63536, 63540, 63544, 63548, 63551, 63554, 63558, 63562,
+ 63566, 63570, 63573, 63578, 63582, 63586, 63590, 63596, 63600, 63604,
+ 63608, 63612, 63619, 63625, 63629, 63633, 63637, 63641, 63645, 63649,
+ 63653, 63657, 63661, 63665, 63669, 63675, 63679, 63683, 63687, 63691,
+ 63695, 63699, 63703, 63707, 63711, 63715, 63719, 63723, 63727, 63731,
+ 63735, 63739, 63745, 63751, 63756, 63761, 63765, 63769, 63773, 63777,
+ 63781, 63785, 63789, 63793, 63797, 63801, 63805, 63809, 63813, 63817,
+ 63821, 63825, 63829, 63833, 63837, 63841, 63845, 63849, 63853, 63857,
+ 63863, 63867, 63871, 63875, 63879, 63883, 63887, 63891, 63895, 63900,
+ 63907, 63911, 63915, 63919, 63923, 63927, 63931, 63935, 63939, 63943,
+ 63947, 63951, 63955, 63962, 63966, 63972, 63976, 63980, 63984, 63988,
+ 63992, 63995, 63999, 64003, 64007, 64011, 64015, 64019, 64023, 64027,
+ 64031, 64035, 64039, 64043, 64047, 64051, 64055, 64059, 64063, 64067,
+ 64071, 64075, 64079, 64083, 64087, 64091, 64095, 64099, 64103, 64107,
+ 64111, 64115, 64119, 64123, 64129, 64133, 64137, 64141, 64145, 64149,
+ 64153, 64157, 64161, 64165, 64169, 64173, 64177, 64181, 64185, 64189,
+ 64193, 64197, 64201, 64205, 64209, 64213, 64217, 64221, 64225, 64229,
+ 64233, 64237, 64245, 64249, 64253, 64257, 64261, 64265, 64271, 64275,
+ 64279, 64283, 64287, 64291, 64295, 64299, 64303, 64307, 64311, 64315,
+ 64319, 64323, 64329, 64333, 64337, 64341, 64345, 64349, 64353, 64357,
+ 64361, 64365, 64369, 64373, 64377, 64381, 64385, 64389, 64393, 64397,
+ 64401, 64405, 64409, 64413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64417, 64425, 64433, 64443, 64453,
+ 64462, 64472, 64482, 64493, 64505, 64516, 64528, 0, 0, 0, 0, 64535,
+ 64538, 64541, 64546, 64549, 64556, 64560, 64564, 64568, 64573, 64578,
+ 64584, 64590, 64595, 64600, 64606, 64612, 64618, 64624, 64627, 64630,
+ 64637, 64644, 64650, 64656, 64664, 64672, 64677, 64682, 64686, 64694,
+ 64700, 64707, 64712, 64717, 64722, 64727, 64732, 64737, 64742, 64747,
+ 64752, 64757, 64762, 64767, 64772, 64777, 64783, 64788, 64792, 64798,
+ 64809, 64818, 64832, 64841, 64845, 64855, 64861, 64867, 64873, 64878,
+ 64881, 64886, 64890, 0, 64896, 64901, 64905, 64910, 64914, 64919, 64923,
+ 64928, 64932, 64937, 64941, 64945, 64950, 64955, 64960, 64965, 64970,
+ 64975, 64980, 64985, 64990, 64994, 64999, 65004, 65009, 65014, 65019,
+ 65024, 65029, 65034, 65039, 65044, 65049, 65054, 65059, 65065, 65070,
+ 65075, 65080, 65085, 65089, 65094, 65098, 65103, 65108, 65113, 65118,
+ 65122, 65127, 65131, 65136, 65141, 65146, 65151, 65156, 65161, 65166,
+ 65171, 65176, 65181, 65186, 65191, 65195, 65200, 65205, 65210, 65215,
+ 65220, 65224, 65230, 65235, 65241, 65246, 65250, 65255, 65260, 65265,
+ 65270, 65276, 65281, 65286, 65291, 65296, 65301, 65306, 65311, 0, 0,
+ 65317, 65325, 65333, 65340, 65347, 65352, 65359, 65365, 65370, 65374,
+ 65377, 65381, 65384, 65388, 65391, 65395, 65398, 65402, 65405, 65408,
+ 65412, 65416, 65420, 65424, 65428, 65432, 65436, 65440, 65444, 65447,
+ 65451, 65455, 65459, 65463, 65467, 65471, 65475, 65479, 65483, 65487,
+ 65491, 65495, 65499, 65504, 65508, 65512, 65516, 65520, 65523, 65527,
+ 65530, 65534, 65538, 65542, 65546, 65549, 65553, 65556, 65560, 65564,
+ 65568, 65572, 65576, 65580, 65584, 65588, 65592, 65596, 65600, 65604,
+ 65607, 65611, 65615, 65619, 65623, 65627, 65630, 65635, 65639, 65644,
+ 65648, 65651, 65655, 65659, 65663, 65667, 65672, 65676, 65680, 65684,
+ 65688, 65692, 65696, 65700, 65705, 65709, 65713, 65717, 65721, 65725,
+ 65732, 65736, 65742, 0, 0, 0, 0, 0, 65747, 65752, 65757, 65762, 65767,
+ 65772, 65777, 65782, 65786, 65791, 65796, 65801, 65806, 65811, 65816,
+ 65821, 65826, 65831, 65835, 65840, 65845, 65850, 65854, 65858, 65862,
+ 65867, 65872, 65877, 65882, 65887, 65892, 65897, 65902, 65907, 65912,
+ 65916, 65920, 65925, 65930, 65935, 65940, 65945, 65952, 0, 65957, 65961,
+ 65965, 65969, 65973, 65977, 65981, 65985, 65989, 65993, 65997, 66001,
+ 66005, 66009, 66013, 66017, 66021, 66025, 66029, 66033, 66037, 66041,
+ 66045, 66049, 66053, 66057, 66061, 66065, 66069, 66073, 66077, 66080,
+ 66084, 66087, 66091, 66095, 66098, 66102, 66106, 66109, 66113, 66117,
+ 66121, 66125, 66128, 66132, 66136, 66140, 66144, 66148, 66152, 66155,
+ 66158, 66162, 66166, 66170, 66174, 66178, 66182, 66186, 66190, 66194,
+ 66198, 66202, 66206, 66210, 66214, 66218, 66222, 66226, 66230, 66234,
+ 66238, 66242, 66246, 66250, 66254, 66258, 66262, 66266, 66270, 66274,
+ 66278, 66282, 66286, 66290, 66294, 66298, 66302, 66306, 66310, 66314,
+ 66318, 66322, 0, 66326, 66332, 66338, 66343, 66348, 66353, 66359, 66365,
+ 66370, 66376, 66382, 66388, 66394, 66400, 66406, 66412, 66418, 66423,
+ 66428, 66433, 66438, 66443, 66448, 66453, 66458, 66463, 66468, 66473,
+ 66478, 66483, 66488, 66493, 66498, 66503, 66508, 66513, 66518, 66524,
+ 66530, 66536, 66542, 66547, 66552, 66557, 66563, 66568, 66573, 66578,
+ 66583, 66588, 66593, 66598, 66603, 66608, 66613, 66618, 66623, 66628,
+ 66633, 66638, 66643, 66648, 66653, 66658, 66663, 66668, 66673, 66678,
+ 66683, 66688, 66693, 66698, 66703, 66708, 66713, 66718, 66723, 66728,
+ 66733, 66738, 66743, 66748, 66753, 66758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 66763, 66768, 66773, 66778, 66782, 66787, 66791, 66796, 66801,
+ 66806, 66811, 66816, 66820, 66825, 66830, 66835, 66840, 66844, 66848,
+ 66852, 66856, 66860, 66864, 66868, 66872, 66876, 66880, 66884, 66888,
+ 66892, 66896, 66901, 66906, 66911, 66916, 66921, 66926, 66931, 66936,
+ 66941, 66946, 66951, 66956, 66961, 66966, 66971, 66978, 0, 66986, 66990,
+ 66994, 66998, 67002, 67006, 67010, 67014, 67018, 67022, 67027, 67032,
+ 67037, 67042, 67047, 67052, 67057, 67062, 67067, 67072, 67077, 67082,
+ 67087, 67092, 67097, 67102, 67107, 67112, 67117, 67122, 67127, 67132,
+ 67137, 67142, 67147, 67152, 67157, 67162, 67167, 67172, 67177, 67186,
+ 67195, 67204, 67213, 67222, 67231, 67240, 67249, 67252, 67257, 67262,
+ 67267, 67272, 67277, 67282, 67287, 67292, 67297, 67301, 67306, 67311,
+ 67316, 67321, 67326, 67330, 67334, 67338, 67342, 67346, 67350, 67354,
+ 67358, 67362, 67366, 67370, 67374, 67378, 67382, 67387, 67392, 67397,
+ 67402, 67407, 67412, 67417, 67422, 67427, 67432, 67437, 67442, 67447,
+ 67452, 67459, 67466, 67471, 67476, 67480, 67484, 67488, 67492, 67496,
+ 67500, 67504, 67508, 67512, 67517, 67522, 67527, 67532, 67537, 67542,
+ 67547, 67552, 67557, 67562, 67567, 67572, 67577, 67582, 67587, 67592,
+ 67597, 67602, 67607, 67612, 67617, 67622, 67627, 67632, 67637, 67642,
+ 67647, 67652, 67657, 67662, 67667, 67671, 67676, 67681, 67686, 67691,
+ 67696, 67701, 67706, 67711, 67716, 67721, 67726, 67731, 67735, 67740,
+ 67745, 67750, 67755, 67760, 67765, 67770, 67775, 67780, 67784, 67791,
+ 67798, 67805, 67812, 67819, 67826, 67833, 67840, 67847, 67854, 67861,
+ 67868, 67871, 67874, 67877, 67882, 67885, 67888, 67891, 67894, 67897,
+ 67900, 67904, 67908, 67912, 67916, 67919, 67923, 67927, 67931, 67935,
+ 67939, 67943, 67947, 67951, 67954, 67957, 67961, 67965, 67969, 67973,
+ 67976, 67980, 67984, 67988, 67992, 67995, 67999, 68003, 68007, 68011,
+ 68014, 68018, 68022, 68025, 68029, 68033, 68037, 68041, 68045, 68049,
+ 68053, 68057, 68064, 68067, 68070, 68073, 68076, 68079, 68082, 68085,
+ 68088, 68091, 68094, 68097, 68100, 68103, 68106, 68109, 68112, 68115,
+ 68118, 68121, 68124, 68127, 68130, 68133, 68136, 68139, 68142, 68145,
+ 68148, 68151, 68154, 68157, 68160, 68163, 68166, 68169, 68172, 68175,
+ 68178, 68181, 68184, 68187, 68190, 68193, 68196, 68199, 68202, 68205,
+ 68208, 68211, 68214, 68217, 68220, 68223, 68226, 68229, 68232, 68235,
+ 68238, 68241, 68244, 68247, 68250, 68253, 68256, 68259, 68262, 68265,
+ 68268, 68271, 68274, 68277, 68280, 68283, 68286, 68289, 68292, 68295,
+ 68298, 68301, 68304, 68307, 68310, 68313, 68316, 68319, 68322, 68325,
+ 68328, 68337, 68345, 68353, 68361, 68369, 68377, 68385, 68393, 68401,
+ 68409, 68418, 68427, 68436, 68445, 68454, 68463, 68472, 68481, 68490,
+ 68499, 68508, 68517, 68526, 68535, 68544, 68547, 68550, 68553, 68555,
+ 68558, 68561, 68564, 68569, 68574, 68577, 68584, 68591, 68598, 68605,
+ 68608, 68613, 68615, 68619, 68621, 68623, 68626, 68629, 68632, 68635,
+ 68638, 68641, 68644, 68649, 68654, 68657, 68660, 68663, 68666, 68669,
+ 68672, 68675, 68679, 68682, 68685, 68688, 68691, 68694, 68699, 68702,
+ 68705, 68708, 68713, 68718, 68723, 68728, 68733, 68738, 68743, 68748,
+ 68754, 68762, 68764, 68767, 68770, 68773, 68776, 68782, 68790, 68793,
+ 68796, 68801, 68804, 68807, 68810, 68815, 68818, 68821, 68826, 68829,
+ 68832, 68837, 68840, 68843, 68848, 68853, 68858, 68861, 68864, 68867,
+ 68870, 68876, 68879, 68882, 68885, 68887, 68890, 68893, 68896, 68901,
+ 68904, 68907, 68910, 68913, 68916, 68921, 68924, 68927, 68930, 68933,
+ 68936, 68939, 68942, 68945, 68948, 68954, 68959, 68967, 68975, 68983,
+ 68991, 68999, 69007, 69015, 69023, 69031, 69040, 69049, 69058, 69067,
+ 69076, 69085, 69094, 69103, 69112, 69121, 69130, 69139, 69148, 69157,
+ 69166, 69175, 69184, 69193, 69202, 69211, 69220, 69229, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69232, 69241,
+ 69250, 69261, 69268, 69273, 69278, 69285, 69292, 69298, 69303, 69308,
+ 69313, 69318, 69325, 69330, 69335, 69340, 69351, 69356, 69361, 69368,
+ 69373, 69380, 69385, 69390, 69397, 69404, 69411, 69420, 69429, 69434,
+ 69439, 69444, 69451, 69456, 69466, 69473, 69478, 69483, 69488, 69493,
+ 69498, 69503, 69511, 69518, 69525, 69530, 69537, 69542, 69549, 69558,
+ 69569, 69574, 69583, 69588, 69595, 69604, 69613, 69618, 69623, 69630,
+ 69636, 69643, 69650, 69654, 69658, 69661, 69665, 69669, 69673, 69677,
+ 69681, 69685, 69689, 69692, 69696, 69700, 69704, 69708, 69712, 69716,
+ 69719, 69723, 69727, 69730, 69734, 69738, 69742, 69746, 69750, 69754,
+ 69758, 69762, 69766, 69770, 69774, 69778, 69782, 69786, 69790, 69794,
+ 69798, 69802, 69806, 69810, 69814, 69818, 69822, 69826, 69830, 69834,
+ 69838, 69842, 69846, 69850, 69854, 69858, 69862, 69866, 69870, 69874,
+ 69878, 69882, 69886, 69890, 69894, 69898, 69902, 69906, 69909, 69913,
+ 69917, 69921, 69925, 69929, 69933, 69937, 69941, 69945, 69949, 69953,
+ 69957, 69961, 69965, 69969, 69973, 69977, 69981, 69985, 69989, 69993,
+ 69997, 70001, 70005, 70009, 70013, 70017, 70021, 70025, 70029, 70033,
+ 70037, 70041, 70045, 70049, 70053, 70057, 70061, 70065, 70069, 70073,
+ 70077, 70081, 70085, 70089, 70093, 70097, 70101, 70105, 70109, 70113,
+ 70117, 70121, 70125, 70129, 70133, 70137, 70141, 70145, 70149, 70153,
+ 70157, 70161, 70165, 70169, 70173, 70177, 70181, 70185, 70189, 70193,
+ 70197, 70201, 70205, 70209, 70213, 70217, 70221, 70225, 70229, 70233,
+ 70237, 70241, 70245, 70249, 70253, 70257, 70261, 70265, 70269, 70273,
+ 70277, 70281, 70285, 70289, 70293, 70297, 70301, 70305, 70309, 70313,
+ 70317, 70321, 70325, 70329, 70333, 70337, 70341, 70345, 70349, 70353,
+ 70357, 70361, 70365, 70369, 70373, 70377, 70380, 70384, 70388, 70392,
+ 70396, 70400, 70404, 70408, 70412, 70416, 70420, 70424, 70428, 70432,
+ 70436, 70440, 70444, 70448, 70452, 70456, 70460, 70464, 70468, 70472,
+ 70476, 70480, 70484, 70488, 70492, 70496, 70500, 70504, 70508, 70512,
+ 70516, 70520, 70524, 70528, 70532, 70536, 70540, 70544, 70548, 70552,
+ 70556, 70560, 70564, 70568, 70572, 70576, 70580, 70584, 70588, 70592,
+ 70596, 70600, 70604, 70608, 70612, 70616, 70620, 70624, 70628, 70632,
+ 70636, 70640, 70644, 70648, 70652, 70656, 70660, 70664, 70668, 70672,
+ 70676, 70680, 70684, 70688, 70692, 70696, 70700, 70704, 70708, 70712,
+ 70716, 70720, 70724, 70728, 70732, 70736, 70740, 70744, 70748, 70752,
+ 70756, 70760, 70764, 70768, 70772, 70776, 70780, 70784, 70788, 70792,
+ 70796, 70800, 70804, 70808, 70812, 70816, 70820, 70824, 70828, 70832,
+ 70836, 70840, 70843, 70847, 70851, 70855, 70859, 70863, 70867, 70871,
+ 70875, 70879, 70883, 70887, 70891, 70895, 70899, 70903, 70907, 70911,
+ 70915, 70919, 70923, 70927, 70931, 70935, 70939, 70943, 70947, 70951,
+ 70955, 70959, 70963, 70967, 70971, 70975, 70979, 70983, 70987, 70991,
+ 70995, 70999, 71003, 71007, 71011, 71015, 71019, 71023, 71027, 71031,
+ 71035, 71039, 71043, 71047, 71051, 71055, 71059, 71063, 71067, 71071,
+ 71075, 71079, 71083, 71087, 71091, 71095, 71099, 71103, 71107, 71111,
+ 71115, 71119, 71123, 71127, 71131, 71135, 71139, 71143, 71147, 71151,
+ 71155, 71159, 71163, 71167, 71171, 71175, 71179, 71183, 71187, 71191,
+ 71195, 71199, 71202, 71206, 71210, 71214, 71218, 71222, 71226, 71230,
+ 71234, 71238, 71242, 71246, 71250, 71254, 71258, 71262, 71266, 71270,
+ 71274, 71278, 71282, 71286, 71290, 71294, 71298, 71302, 71306, 71310,
+ 71314, 71318, 71322, 71326, 71330, 71334, 71338, 71342, 71346, 71350,
+ 71354, 71358, 71362, 71366, 71370, 71374, 71378, 71382, 71386, 71390,
+ 71394, 71398, 71402, 71406, 71410, 71414, 71418, 71422, 71426, 71430,
+ 71434, 71438, 71441, 71445, 71449, 71453, 71457, 71461, 71465, 71469,
+ 71473, 71477, 71481, 71485, 71489, 71493, 71497, 71501, 71505, 71509,
+ 71513, 71517, 71521, 71525, 71529, 71533, 71537, 71541, 71545, 71549,
+ 71553, 71557, 71561, 71565, 71569, 71573, 71577, 71581, 71585, 71589,
+ 71593, 71597, 71601, 71605, 71609, 71613, 71617, 71621, 71625, 71629,
+ 71633, 71637, 71641, 71645, 71649, 71653, 71657, 71661, 71665, 71669,
+ 71673, 71677, 71681, 71685, 71689, 71693, 71696, 71700, 71704, 71708,
+ 71712, 71716, 71720, 71724, 71728, 71732, 71736, 71740, 71744, 71748,
+ 71752, 71756, 71760, 71764, 71768, 71772, 71776, 71780, 71784, 71788,
+ 71792, 71796, 71800, 71804, 71808, 71812, 71816, 71820, 71824, 71828,
+ 71832, 71836, 71840, 71844, 71848, 71852, 71856, 71860, 71864, 71868,
+ 71872, 71876, 71880, 71884, 71888, 71892, 71896, 71900, 71904, 71908,
+ 71912, 71916, 71920, 71924, 71928, 71932, 71936, 71940, 71944, 71948,
+ 71952, 71956, 71960, 71964, 71968, 71972, 71976, 71980, 71984, 71988,
+ 71992, 71996, 72000, 72004, 72008, 72012, 72016, 72020, 72024, 72028,
+ 72032, 72036, 72040, 72044, 72048, 72052, 72056, 72060, 72064, 72068,
+ 72072, 72076, 72080, 72084, 72088, 72092, 72096, 72100, 72104, 72108,
+ 72112, 72116, 72120, 72124, 72128, 72132, 72136, 72140, 72144, 72148,
+ 72151, 72155, 72159, 72163, 72167, 72171, 72175, 72179, 72183, 72187,
+ 72191, 72195, 72199, 72203, 72207, 72211, 72215, 72219, 72223, 72227,
+ 72231, 72235, 72239, 72243, 72247, 72251, 72255, 72259, 72263, 72267,
+ 72271, 72275, 72279, 72283, 72287, 72291, 72295, 72299, 72303, 72307,
+ 72311, 72315, 72319, 72323, 72327, 72331, 72335, 72339, 72343, 72347,
+ 72351, 72355, 72359, 72363, 72367, 72371, 72375, 72379, 72383, 72387,
+ 72391, 72395, 72399, 72403, 72407, 72411, 72415, 72419, 72423, 72427,
+ 72431, 72435, 72439, 72443, 72447, 72451, 72455, 72459, 72463, 72467,
+ 72471, 72475, 72479, 72483, 72487, 72491, 72495, 72499, 72503, 72507,
+ 72511, 72515, 72519, 72523, 72527, 72531, 72535, 72539, 72543, 72547,
+ 72551, 72555, 72559, 72563, 72567, 72571, 72575, 72579, 72583, 72587,
+ 72591, 72595, 72599, 72603, 72607, 72611, 72615, 72619, 72623, 72627,
+ 72631, 72635, 72639, 72643, 72647, 72651, 72655, 72659, 72663, 72667,
+ 72671, 72675, 72679, 72683, 72687, 72691, 72695, 72699, 72703, 72707,
+ 72711, 72715, 72719, 72723, 72727, 72731, 72735, 72739, 72743, 72747,
+ 72751, 72754, 72758, 72762, 72766, 72770, 72774, 72778, 72782, 72785,
+ 72789, 72793, 72797, 72801, 72805, 72809, 72813, 72817, 72821, 72825,
+ 72829, 72833, 72837, 72841, 72845, 72849, 72853, 72857, 72861, 72865,
+ 72869, 72873, 72877, 72881, 72885, 72889, 72893, 72897, 72901, 72905,
+ 72909, 72913, 72917, 72921, 72925, 72929, 72933, 72937, 72941, 72945,
+ 72949, 72953, 72957, 72961, 72965, 72969, 72973, 72977, 72981, 72985,
+ 72989, 72993, 72997, 73001, 73005, 73009, 73013, 73017, 73021, 73025,
+ 73029, 73033, 73037, 73041, 73045, 73049, 73053, 73057, 73061, 73065,
+ 73069, 73073, 73077, 73081, 73085, 73089, 73093, 73097, 73101, 73105,
+ 73109, 73113, 73117, 73121, 73125, 73129, 73133, 73137, 73141, 73145,
+ 73149, 73153, 73157, 73161, 73165, 73169, 73173, 73177, 73181, 73185,
+ 73189, 73193, 73197, 73201, 73205, 73209, 73213, 73217, 73221, 73225,
+ 73229, 73233, 73237, 73241, 73245, 73249, 73253, 73257, 73261, 73265,
+ 73269, 73273, 73277, 73281, 73285, 73289, 73293, 73297, 73301, 73305,
+ 73309, 73313, 73317, 73321, 73325, 73329, 73333, 73337, 73341, 73345,
+ 73349, 73353, 73357, 73361, 73365, 73369, 73373, 73377, 73381, 73385,
+ 73389, 73393, 73397, 73401, 73405, 73409, 73413, 73417, 73421, 73425,
+ 73429, 73433, 73437, 73441, 73445, 73449, 73453, 73457, 73461, 73465,
+ 73469, 73473, 73477, 73481, 73485, 73489, 73493, 73497, 73501, 73505,
+ 73509, 73512, 73516, 73520, 73524, 73528, 73532, 73536, 73540, 73544,
+ 73548, 73552, 73556, 73560, 73564, 73568, 73572, 73576, 73580, 73584,
+ 73588, 73592, 73596, 73600, 73604, 73608, 73612, 73616, 73620, 73624,
+ 73628, 73632, 73636, 73640, 73644, 73648, 73652, 73656, 73660, 73664,
+ 73668, 73672, 73676, 73680, 73684, 73688, 73692, 73696, 73700, 73704,
+ 73708, 73712, 73716, 73720, 73724, 73728, 73732, 73736, 73740, 73744,
+ 73748, 73752, 73756, 73760, 73764, 73768, 73772, 73776, 73780, 73784,
+ 73788, 73792, 73796, 73800, 73804, 73808, 73812, 73816, 73820, 73824,
+ 73828, 73832, 73836, 73840, 73844, 73848, 73852, 73856, 73860, 73864,
+ 73868, 73872, 73876, 73880, 73884, 73888, 73892, 73896, 73900, 73904,
+ 73908, 73912, 73916, 73920, 73924, 73928, 73932, 73936, 73940, 73944,
+ 73948, 73952, 73956, 73960, 73964, 73968, 73972, 73976, 73980, 73984,
+ 73988, 73992, 73996, 74000, 74004, 74008, 74012, 74016, 74020, 74024,
+ 74028, 74032, 74036, 74040, 74044, 74048, 74052, 74056, 74060, 74064,
+ 74068, 74072, 74076, 74080, 74084, 74088, 74092, 74096, 74100, 74104,
+ 74108, 74112, 74116, 74120, 74124, 74128, 74132, 74136, 74140, 74144,
+ 74148, 74152, 74156, 74160, 74164, 74168, 74172, 74176, 74180, 74184,
+ 74188, 74192, 74196, 74200, 74204, 74208, 74212, 74216, 74220, 74224,
+ 74228, 74232, 74236, 74240, 74244, 74248, 74252, 74256, 74260, 74264,
+ 74268, 74272, 74276, 74280, 74284, 74288, 74292, 0, 0, 0, 74296, 74300,
+ 74304, 74308, 74312, 74316, 74320, 74324, 74328, 74332, 74336, 74340,
+ 74344, 74348, 74352, 74356, 74360, 74364, 74368, 74372, 74376, 74380,
+ 74384, 74388, 74392, 74396, 74400, 74404, 74408, 74412, 74416, 74420,
+ 74424, 74428, 74432, 74436, 74440, 74444, 74448, 74452, 74456, 74460,
+ 74464, 74468, 74472, 74476, 74480, 74484, 74488, 74492, 74496, 74500,
+ 74504, 74508, 74512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74516, 74521, 74525,
+ 74530, 74535, 74540, 74545, 74550, 74554, 74559, 74564, 74569, 74574,
+ 74579, 74584, 74589, 74593, 74597, 74601, 74605, 74610, 74615, 74620,
+ 74624, 74629, 74634, 74639, 74644, 74649, 74653, 74658, 74662, 74667,
+ 74671, 74676, 74680, 74684, 74688, 74693, 74698, 74703, 74711, 74719,
+ 74727, 74735, 74742, 74750, 74756, 74764, 74768, 74772, 74776, 74780,
+ 74784, 74788, 74792, 74796, 74800, 74804, 74808, 74812, 74816, 74820,
+ 74824, 74828, 74832, 74836, 74840, 74844, 74848, 74852, 74856, 74860,
+ 74864, 74868, 74872, 74876, 74880, 74884, 74888, 74892, 74896, 74900,
+ 74904, 74908, 74911, 74915, 74919, 74923, 74927, 74931, 74935, 74939,
+ 74943, 74947, 74951, 74955, 74959, 74963, 74967, 74971, 74975, 74979,
+ 74983, 74987, 74991, 74995, 74999, 75003, 75007, 75011, 75015, 75019,
+ 75023, 75027, 75031, 75035, 75039, 75043, 75047, 75051, 75055, 75058,
+ 75062, 75066, 75069, 75073, 75077, 75081, 75084, 75088, 75092, 75096,
+ 75100, 75104, 75108, 75112, 75116, 75120, 75124, 75128, 75132, 75136,
+ 75139, 75142, 75146, 75150, 75153, 75157, 75161, 75165, 75169, 75173,
+ 75177, 75180, 75183, 75187, 75191, 75195, 75198, 75201, 75205, 75209,
+ 75213, 75217, 75221, 75225, 75229, 75233, 75237, 75241, 75245, 75249,
+ 75253, 75257, 75261, 75265, 75269, 75273, 75277, 75281, 75285, 75289,
+ 75293, 75297, 75301, 75305, 75309, 75313, 75317, 75321, 75325, 75329,
+ 75333, 75337, 75341, 75345, 75349, 75352, 75356, 75360, 75364, 75368,
+ 75372, 75376, 75380, 75384, 75388, 75392, 75396, 75400, 75404, 75408,
+ 75412, 75416, 75420, 75424, 75428, 75432, 75436, 75440, 75444, 75448,
+ 75452, 75456, 75460, 75464, 75468, 75472, 75476, 75480, 75484, 75488,
+ 75492, 75496, 75499, 75503, 75507, 75511, 75515, 75519, 75523, 75527,
+ 75531, 75535, 75539, 75543, 75547, 75551, 75555, 75559, 75563, 75566,
+ 75570, 75574, 75578, 75582, 75586, 75590, 75594, 75598, 75602, 75606,
+ 75610, 75614, 75618, 75622, 75626, 75630, 75634, 75638, 75642, 75646,
+ 75650, 75653, 75657, 75661, 75665, 75669, 75673, 75677, 75681, 75685,
+ 75689, 75693, 75697, 75701, 75705, 75709, 75713, 75717, 75721, 75725,
+ 75729, 75733, 75737, 75741, 75745, 75749, 75753, 75757, 75761, 75765,
+ 75769, 75773, 75777, 75781, 75785, 75789, 75793, 75797, 75801, 75805,
+ 75809, 75813, 75817, 75821, 75825, 75828, 75833, 75837, 75843, 75848,
+ 75854, 75858, 75862, 75866, 75870, 75874, 75878, 75882, 75886, 75890,
+ 75894, 75898, 75902, 75906, 75910, 75913, 75916, 75919, 75922, 75925,
+ 75928, 75931, 75934, 75937, 75942, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 75948, 75953, 75958, 75963, 75968, 75975, 75982,
+ 75987, 75992, 75997, 76002, 76009, 76016, 76023, 76030, 76037, 76044,
+ 76054, 76064, 76071, 76078, 76085, 76092, 76098, 76104, 76113, 76122,
+ 76129, 76136, 76147, 76158, 76163, 76168, 76175, 76182, 76189, 76196,
+ 76203, 76210, 76217, 76224, 76230, 76236, 76242, 76248, 76255, 76262,
+ 76267, 76271, 76278, 76285, 76292, 76296, 76303, 76307, 76312, 76316,
+ 76322, 76327, 76333, 76338, 76342, 76346, 76349, 76352, 76357, 76362,
+ 76367, 76372, 76377, 76382, 76387, 76392, 76397, 76402, 76410, 76418,
+ 76423, 76428, 76433, 76438, 76443, 76448, 76453, 76458, 76463, 76468,
+ 76473, 76478, 76483, 76488, 76494, 76500, 76506, 76512, 76517, 76523,
+ 76526, 76529, 76532, 76536, 76540, 76544, 76548, 76551, 76555, 76558,
+ 76561, 76564, 76568, 76572, 76576, 76580, 76584, 76588, 76592, 76596,
+ 76600, 76604, 76608, 76612, 76616, 76620, 76624, 76628, 76632, 76636,
+ 76640, 76644, 76648, 76652, 76655, 76659, 76663, 76667, 76671, 76675,
+ 76679, 76683, 76687, 76691, 76695, 76699, 76703, 76707, 76711, 76715,
+ 76719, 76723, 76727, 76731, 76735, 76739, 76743, 76747, 76751, 76754,
+ 76758, 76762, 76766, 76770, 76774, 76778, 76782, 76785, 76789, 76793,
+ 76797, 76801, 76805, 76809, 76813, 76817, 76821, 76825, 76829, 76833,
+ 76838, 76843, 76846, 76851, 76854, 76857, 76860, 0, 0, 0, 0, 0, 0, 0, 0,
+ 76864, 76873, 76882, 76891, 76900, 76909, 76918, 76927, 76936, 76944,
+ 76951, 76959, 76966, 76974, 76984, 76993, 77003, 77012, 77022, 77030,
+ 77037, 77045, 77052, 77060, 77065, 77070, 77076, 77084, 77090, 77096,
+ 77103, 77112, 77120, 77128, 77136, 77143, 77150, 77157, 77164, 77169,
+ 77174, 77179, 77184, 77189, 77194, 77199, 77204, 77212, 77220, 77226,
+ 77232, 77237, 77242, 77247, 77252, 77257, 77262, 77267, 77272, 77281,
+ 77290, 77295, 77300, 77310, 77320, 77327, 77334, 77343, 77352, 77364,
+ 77376, 77382, 77388, 77396, 77404, 77414, 77424, 77431, 77438, 77443,
+ 77448, 77460, 77472, 77480, 77488, 77498, 77508, 77520, 77532, 77541,
+ 77550, 77557, 77564, 77571, 77578, 77587, 77596, 77601, 77606, 77613,
+ 77620, 77627, 77634, 77646, 77658, 77663, 77668, 77673, 77678, 77683,
+ 77688, 77693, 77698, 77702, 77707, 77712, 77717, 77722, 77727, 77733,
+ 77738, 77743, 77750, 77757, 77764, 77771, 77778, 77786, 77794, 77799,
+ 77804, 77810, 77816, 77823, 77830, 77837, 77844, 77851, 77855, 77862,
+ 77867, 77872, 77878, 77891, 77897, 77905, 77913, 77920, 77927, 77936,
+ 77945, 77952, 77959, 77966, 77973, 77980, 77987, 77994, 78001, 78008,
+ 78015, 78024, 78033, 78042, 78051, 78060, 78069, 78078, 78087, 78096,
+ 78105, 78112, 78120, 78126, 78134, 78140, 78146, 78152, 78158, 78166,
+ 78171, 78176, 78181, 78186, 78191, 78197, 78203, 78209, 78215, 78221,
+ 78227, 78233, 78239, 78246, 78253, 78260, 78267, 78276, 78283, 78292,
+ 78304, 78316, 78328, 0, 0, 0, 0, 0, 78340, 78349, 0, 78358, 0, 78364,
+ 78370, 78378, 78386, 78393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 78400, 78405, 78410, 78415, 78423, 78431,
+ 78438, 78445, 78451, 78458, 78466, 78474, 78482, 78490, 78498, 78504,
+ 78510, 78517, 78523, 78529, 78535, 78542, 78549, 78556, 78563, 78570,
+ 78577, 78584, 78591, 78598, 78605, 78612, 78619, 78626, 78633, 78639,
+ 78646, 78653, 78660, 78667, 78674, 78681, 78688, 78695, 78702, 78709,
+ 78716, 78723, 78730, 78737, 78744, 78751, 78758, 78765, 78773, 78781,
+ 78789, 78797, 78805, 0, 0, 0, 78814, 78822, 78830, 78838, 78846, 78854,
+ 78862, 78868, 78874, 78880, 0, 0, 0, 0, 0, 0, 78886, 78890, 78895, 78900,
+ 78905, 78910, 78915, 78920, 78925, 78930, 78935, 78940, 78944, 78948,
+ 78953, 78958, 78962, 78967, 78972, 78977, 78982, 78987, 78992, 78997,
+ 79001, 79005, 79009, 79014, 79018, 79022, 79026, 79030, 79034, 79038,
+ 79042, 79047, 79052, 79057, 79062, 79067, 79074, 79080, 79085, 79090,
+ 79095, 79100, 79106, 79113, 79119, 79126, 79132, 79138, 79143, 79150,
+ 79156, 79161, 0, 0, 0, 0, 0, 0, 0, 0, 79167, 79172, 79177, 79181, 79186,
+ 79190, 79195, 79199, 79204, 79209, 79215, 79220, 79226, 79230, 79235,
+ 79240, 79244, 79249, 79254, 79258, 79263, 79268, 79273, 79278, 79283,
+ 79288, 79293, 79298, 79303, 79308, 79313, 79318, 79323, 79328, 79333,
+ 79338, 79343, 79348, 79352, 79356, 79361, 79366, 79371, 79375, 79379,
+ 79383, 79387, 79392, 79397, 79402, 79406, 79410, 79415, 79421, 79427,
+ 79432, 79438, 79443, 79449, 79455, 79462, 79468, 79475, 79480, 79486,
+ 79492, 79497, 79503, 79509, 79514, 0, 0, 0, 0, 0, 0, 0, 0, 79519, 79523,
+ 79528, 79533, 79537, 79541, 79545, 79549, 79553, 79557, 79561, 79565, 0,
+ 0, 0, 0, 0, 0, 79569, 79574, 79578, 79582, 79586, 79590, 79594, 79598,
+ 79602, 79606, 79610, 79614, 79618, 79622, 79626, 79630, 79634, 79639,
+ 79644, 79650, 79656, 79663, 79668, 79673, 79679, 79683, 79688, 79691,
+ 79694, 79698, 79703, 79707, 79712, 79719, 79725, 79731, 79737, 79743,
+ 79749, 79755, 79761, 79767, 79773, 79779, 79786, 79793, 79800, 79806,
+ 79813, 79820, 79827, 79834, 79841, 79847, 79853, 79860, 79866, 79873,
+ 79880, 79886, 79892, 79898, 79905, 79912, 79918, 79925, 79932, 79938,
+ 79945, 79951, 79958, 79965, 79971, 79977, 79984, 79990, 79997, 80004,
+ 80013, 80020, 80027, 80031, 80036, 80041, 80046, 80051, 80055, 80059,
+ 80064, 80068, 80073, 80078, 80083, 80087, 80091, 80095, 80099, 80104,
+ 80108, 80113, 80118, 80123, 80128, 80132, 80137, 80142, 80147, 80153,
+ 80158, 80164, 80170, 80176, 80182, 80188, 80193, 80199, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 80203, 80208, 80212, 80216, 80220, 80224, 80228, 80232,
+ 80236, 80240, 80244, 80248, 80252, 80256, 80260, 80264, 80268, 80272,
+ 80276, 80280, 80284, 80288, 80292, 80296, 80300, 80304, 80308, 80312,
+ 80316, 80320, 0, 0, 0, 80324, 80329, 80334, 80339, 80344, 80348, 80355,
+ 80359, 80364, 80368, 80375, 80382, 80391, 80395, 80400, 80404, 80408,
+ 80415, 80422, 80427, 80434, 80439, 80444, 80451, 80456, 80463, 80470,
+ 80475, 80480, 80487, 80492, 80499, 80506, 80511, 80518, 80523, 80530,
+ 80534, 80538, 80545, 80550, 80557, 80561, 80565, 80569, 80576, 80580,
+ 80585, 80592, 80599, 80603, 80607, 80614, 80620, 80626, 80632, 80640,
+ 80646, 80654, 80660, 80668, 80674, 80680, 80686, 80692, 80696, 80701,
+ 80706, 80712, 80718, 80724, 80730, 80736, 80742, 80748, 80754, 80762,
+ 80768, 0, 80775, 80779, 80784, 80788, 80792, 80796, 80800, 80804, 80808,
+ 80812, 80816, 0, 0, 0, 0, 80820, 80828, 80834, 80840, 80846, 80852,
+ 80858, 80864, 80870, 80877, 80884, 80891, 80898, 80905, 80912, 80919,
+ 80926, 80933, 80940, 80947, 80953, 80959, 80965, 80971, 80977, 80983,
+ 80989, 80995, 81001, 81008, 81015, 81022, 81029, 0, 81036, 81040, 81044,
+ 81048, 81052, 81057, 81061, 81065, 81070, 81075, 81080, 81085, 81090,
+ 81095, 81100, 81105, 81110, 81115, 81120, 81125, 81130, 81135, 81140,
+ 81145, 81150, 81154, 81159, 81163, 81168, 81173, 81178, 81183, 81188,
+ 81192, 81197, 81201, 81205, 81209, 81214, 81219, 81223, 81227, 81233,
+ 81238, 81244, 81250, 81255, 81261, 81266, 81272, 81278, 81284, 81289,
+ 81294, 81299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81305, 81311, 81317, 81323,
+ 81330, 81336, 81342, 81348, 81354, 81360, 81365, 81370, 81376, 81383, 0,
+ 0, 81390, 81395, 81399, 81403, 81407, 81411, 81415, 81419, 81423, 81427,
+ 0, 0, 81431, 81437, 81443, 81450, 81458, 81464, 81470, 81476, 81482,
+ 81488, 81494, 81500, 81506, 81512, 81518, 81524, 81529, 81534, 81539,
+ 81545, 81551, 81558, 81564, 81570, 81575, 81582, 81589, 81596, 81602,
+ 81607, 81612, 81617, 81625, 81632, 81639, 81647, 81655, 81662, 81669,
+ 81676, 81683, 81690, 81697, 81704, 81711, 81718, 81725, 81732, 81739,
+ 81746, 81753, 81760, 81767, 81774, 81781, 81788, 81795, 81801, 81807,
+ 81814, 81821, 81828, 81835, 81842, 81849, 81856, 81863, 81870, 81877,
+ 81884, 81891, 81898, 81905, 81912, 81919, 81926, 81933, 81940, 81947,
+ 81954, 81961, 81968, 81975, 81981, 81987, 81994, 82000, 82005, 82011,
+ 82016, 82021, 82026, 82033, 82039, 82045, 82051, 82057, 82063, 82069,
+ 82075, 82083, 82091, 82099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 82107, 82113, 82119, 82125, 82133, 82141,
+ 82147, 82153, 82160, 82167, 82174, 82181, 82188, 82195, 82202, 82209,
+ 82216, 82224, 82232, 82240, 82248, 82256, 82262, 82270, 82276, 82284,
+ 82293, 82301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82307, 82311, 82315, 82319,
+ 82323, 82327, 0, 0, 82331, 82335, 82339, 82343, 82347, 82351, 0, 0,
+ 82355, 82359, 82363, 82367, 82371, 82375, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 82379, 82383, 82387, 82391, 82395, 82399, 82403, 0, 82407, 82411, 82415,
+ 82419, 82423, 82427, 82431, 0, 82435, 82442, 82448, 82454, 82460, 82468,
+ 82475, 82484, 82496, 82506, 82515, 82523, 82531, 82539, 82545, 82553,
+ 82561, 82568, 82576, 82586, 82593, 82602, 82608, 82618, 82627, 82632,
+ 82640, 82649, 82654, 82663, 82670, 82680, 82692, 82697, 82703, 82710,
+ 82715, 82725, 82735, 82745, 82755, 82770, 82783, 82794, 82802, 82807,
+ 82819, 82828, 82835, 82842, 82848, 82855, 82860, 82867, 82873, 82884,
+ 82895, 82905, 82911, 82916, 0, 0, 0, 0, 82921, 82925, 82929, 82933,
+ 82937, 82941, 82946, 82951, 82955, 82960, 82965, 82970, 82975, 82980,
+ 82984, 82989, 82994, 82999, 83004, 83009, 83013, 83018, 83023, 83028,
+ 83033, 83038, 83042, 83047, 83052, 83057, 83062, 83066, 83071, 83076,
+ 83081, 83086, 83091, 83096, 83101, 83106, 83111, 83116, 83121, 83126,
+ 83131, 83135, 83140, 83145, 83150, 83155, 83160, 83165, 83170, 83175,
+ 83180, 83185, 83190, 83195, 83200, 83205, 83210, 83215, 83220, 83225,
+ 83230, 83235, 83240, 83245, 83250, 83255, 83260, 83265, 83270, 83275,
+ 83280, 83285, 83290, 83295, 83300, 83305, 83309, 83316, 83323, 83330,
+ 83337, 83343, 83349, 83356, 83363, 83370, 83377, 83384, 83391, 83398,
+ 83405, 83412, 83418, 83425, 83432, 83439, 83446, 83453, 83460, 83467,
+ 83474, 83481, 83488, 83495, 83504, 83513, 83522, 83531, 83540, 83549,
+ 83558, 83567, 83575, 83583, 83591, 83599, 83607, 83615, 83623, 83631,
+ 83637, 83645, 0, 0, 83653, 83660, 83666, 83672, 83678, 83684, 83690,
+ 83696, 83702, 83708, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83714, 83719, 83724, 83729, 83734,
+ 83739, 83744, 83749, 83754, 83759, 83764, 83769, 83774, 83779, 83784,
+ 83789, 83794, 83799, 83804, 83809, 83814, 83819, 83824, 0, 0, 0, 0,
+ 83829, 83833, 83837, 83841, 83845, 83849, 83853, 83857, 83861, 83865,
+ 83869, 83873, 83877, 83881, 83885, 83889, 83893, 83897, 83901, 83905,
+ 83909, 83913, 83917, 83921, 83925, 83929, 83933, 83937, 83941, 83945,
+ 83949, 83953, 83957, 83961, 83965, 83969, 83973, 83977, 83981, 83985,
+ 83989, 83993, 83997, 84001, 84005, 84009, 84013, 84017, 84021, 0, 0, 0,
+ 0, 84025, 84029, 84033, 84037, 84041, 84045, 84049, 84053, 84057, 84061,
+ 84065, 84069, 84073, 84077, 84081, 84085, 84089, 84093, 84097, 84101,
+ 84105, 84109, 84113, 84117, 84121, 84125, 84129, 84133, 84137, 84141,
+ 84145, 84149, 84153, 84157, 84161, 84165, 84169, 84173, 84177, 84181,
+ 84185, 84189, 84193, 84197, 84201, 84205, 84209, 84213, 84217, 84221,
+ 84225, 84229, 84233, 84237, 84241, 84245, 84249, 84253, 84257, 84261,
+ 84265, 84269, 84273, 84277, 84281, 84285, 84289, 84293, 84297, 84301,
+ 84305, 84309, 84313, 84317, 84321, 84325, 84329, 84333, 84337, 84341,
+ 84345, 84349, 84353, 84357, 84361, 84365, 84369, 84373, 84377, 84381,
+ 84385, 84389, 84393, 84397, 84401, 84405, 84409, 84413, 84417, 84421,
+ 84425, 84429, 84433, 84437, 84441, 84445, 84449, 84453, 84457, 84461,
+ 84465, 84469, 84473, 84477, 84481, 84485, 84489, 84493, 84497, 84501,
+ 84505, 84509, 84513, 84517, 84521, 84525, 84529, 84533, 84537, 84541,
+ 84545, 84549, 84553, 84557, 84561, 84565, 84569, 84573, 84577, 84581,
+ 84585, 84589, 84593, 84597, 84601, 84605, 84609, 84613, 84617, 84621,
+ 84625, 84629, 84633, 84637, 84641, 84645, 84649, 84653, 84657, 84661,
+ 84665, 84669, 84673, 84677, 84681, 84685, 84689, 84693, 84697, 84701,
+ 84705, 84709, 84713, 84717, 84721, 84725, 84729, 84733, 84737, 84741,
+ 84745, 84749, 84753, 84757, 84761, 84765, 84769, 84773, 84777, 84781,
+ 84785, 84789, 84793, 84797, 84801, 84805, 84809, 84813, 84817, 84821,
+ 84825, 84829, 84833, 84837, 84841, 84845, 84849, 84853, 84857, 84861,
+ 84865, 84869, 84873, 84877, 84881, 84885, 84889, 84893, 84897, 84901,
+ 84905, 84909, 84913, 84917, 84921, 84925, 84929, 84933, 84937, 84941,
+ 84945, 84949, 84953, 84957, 84961, 84965, 84969, 84973, 84977, 84981,
+ 84985, 84989, 84993, 84997, 85001, 85005, 85009, 85013, 85017, 85021,
+ 85025, 85029, 85033, 85037, 85041, 85045, 85049, 85053, 85057, 85061,
+ 85065, 85069, 85073, 85077, 85081, 85085, 85089, 85093, 85097, 85101,
+ 85105, 85109, 85113, 85117, 85121, 85125, 85129, 85133, 85137, 85141,
+ 85145, 85149, 85153, 85157, 85161, 85165, 85169, 85173, 85177, 85181,
+ 85185, 85189, 85193, 85197, 85201, 85205, 85209, 85213, 85217, 85221,
+ 85225, 85229, 85233, 85237, 85241, 85245, 85249, 85253, 85257, 85261,
+ 85265, 85269, 85273, 85277, 85281, 85285, 85289, 85293, 85297, 85301,
+ 85305, 85309, 85313, 85317, 85321, 85325, 85329, 85333, 85337, 85341,
+ 85345, 85349, 85353, 85357, 85361, 85365, 85369, 85373, 85377, 85381,
+ 85385, 85389, 85393, 85397, 85401, 85405, 85409, 85413, 85417, 85421,
+ 85425, 85429, 85433, 85437, 85441, 85445, 85449, 85453, 85457, 85461,
+ 85465, 85469, 85473, 85477, 85481, 85485, 0, 0, 85489, 85493, 85497,
+ 85501, 85505, 85509, 85513, 85517, 85521, 85525, 85529, 85533, 85537,
+ 85541, 85545, 85549, 85553, 85557, 85561, 85565, 85569, 85573, 85577,
+ 85581, 85585, 85589, 85593, 85597, 85601, 85605, 85609, 85613, 85617,
+ 85621, 85625, 85629, 85633, 85637, 85641, 85645, 85649, 85653, 85657,
+ 85661, 85665, 85669, 85673, 85677, 85681, 85685, 85689, 85693, 85697,
+ 85701, 85705, 85709, 85713, 85717, 85721, 85725, 85729, 85733, 85737,
+ 85741, 85745, 85749, 85753, 85757, 85761, 85765, 85769, 85773, 85777,
+ 85781, 85785, 85789, 85793, 85797, 85801, 85805, 85809, 85813, 85817,
+ 85821, 85825, 85829, 85833, 85837, 85841, 85845, 85849, 85853, 85857,
+ 85861, 85865, 85869, 85873, 85877, 85881, 85885, 85889, 85893, 85897,
+ 85901, 85905, 85909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85913,
+ 85918, 85923, 85928, 85933, 85938, 85946, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 85951, 85959, 85967, 85975, 85983, 0, 0, 0, 0, 0, 85991, 85998,
+ 86005, 86015, 86021, 86027, 86033, 86039, 86045, 86051, 86058, 86064,
+ 86070, 86076, 86085, 86094, 86106, 86118, 86124, 86130, 86136, 86143,
+ 86150, 86157, 86164, 86171, 0, 86178, 86185, 86192, 86200, 86207, 0,
+ 86214, 0, 86221, 86228, 0, 86235, 86243, 0, 86250, 86257, 86264, 86271,
+ 86278, 86285, 86292, 86299, 86306, 86313, 86318, 86325, 86332, 86338,
+ 86344, 86350, 86357, 86363, 86369, 86375, 86382, 86388, 86394, 86400,
+ 86407, 86413, 86419, 86425, 86432, 86438, 86444, 86450, 86457, 86463,
+ 86469, 86475, 86482, 86488, 86494, 86500, 86507, 86513, 86519, 86525,
+ 86532, 86538, 86544, 86550, 86557, 86563, 86569, 86575, 86582, 86588,
+ 86594, 86600, 86607, 86613, 86619, 86625, 86632, 86638, 86644, 86650,
+ 86656, 86662, 86668, 86674, 86680, 86686, 86692, 86698, 86704, 86710,
+ 86716, 86722, 86729, 86735, 86741, 86747, 86754, 86760, 86766, 86772,
+ 86779, 86785, 86791, 86797, 86804, 86812, 86820, 86826, 86832, 86838,
+ 86845, 86854, 86863, 86871, 86879, 86887, 86896, 86904, 86912, 86920,
+ 86929, 86936, 86943, 86954, 86965, 86969, 86973, 86978, 86983, 86988,
+ 86993, 87002, 87011, 87017, 87023, 87030, 87037, 87044, 87048, 87054,
+ 87060, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87065, 87071,
+ 87077, 87083, 87090, 87095, 87100, 87106, 87112, 87118, 87124, 87133,
+ 87139, 87145, 87153, 87161, 87169, 87177, 87183, 87189, 87195, 87202,
+ 87215, 87229, 87240, 87251, 87263, 87275, 87287, 87299, 87310, 87321,
+ 87333, 87345, 87357, 87369, 87381, 87393, 87405, 87422, 87439, 87456,
+ 87463, 87470, 87477, 87485, 87497, 87508, 87519, 87532, 87543, 87552,
+ 87560, 87569, 87577, 87587, 87595, 87604, 87612, 87621, 87629, 87639,
+ 87647, 87656, 87664, 87674, 87682, 87690, 87698, 87706, 87713, 87722,
+ 87730, 87738, 87747, 87755, 87764, 87772, 87780, 87788, 87797, 87805,
+ 87814, 87822, 87830, 87838, 87846, 87855, 87863, 87872, 87880, 87889,
+ 87897, 87906, 87914, 87924, 87932, 87940, 87948, 87958, 87966, 87974,
+ 87983, 87991, 88000, 88009, 88017, 88027, 88035, 88044, 88052, 88061,
+ 88069, 88079, 88087, 88095, 88102, 88110, 88117, 88126, 88133, 88142,
+ 88150, 88159, 88167, 88177, 88185, 88194, 88202, 88212, 88220, 88228,
+ 88235, 88243, 88250, 88259, 88266, 88276, 88286, 88297, 88306, 88315,
+ 88324, 88333, 88342, 88352, 88364, 88376, 88387, 88399, 88412, 88423,
+ 88432, 88441, 88449, 88458, 88468, 88476, 88485, 88494, 88502, 88511,
+ 88521, 88529, 88538, 88547, 88555, 88564, 88574, 88582, 88592, 88600,
+ 88610, 88618, 88626, 88635, 88643, 88653, 88661, 88669, 88679, 88687,
+ 88694, 88701, 88710, 88719, 88727, 88736, 88746, 88754, 88765, 88773,
+ 88781, 88788, 88796, 88805, 88812, 88824, 88835, 88847, 88858, 88870,
+ 88879, 88887, 88896, 88904, 88913, 88922, 88930, 88939, 88947, 88956,
+ 88964, 88972, 88980, 88988, 88995, 89004, 89012, 89021, 89029, 89038,
+ 89046, 89054, 89063, 89071, 89080, 89088, 89097, 89105, 89113, 89121,
+ 89130, 89138, 89147, 89155, 89164, 89172, 89181, 89189, 89197, 89205,
+ 89214, 89222, 89231, 89240, 89248, 89257, 89265, 89274, 89282, 89291,
+ 89299, 89306, 89314, 89321, 89330, 89338, 89347, 89355, 89364, 89373,
+ 89381, 89391, 89399, 89406, 89414, 89421, 89429, 89441, 89454, 89463,
+ 89473, 89482, 89492, 89501, 89511, 89520, 89530, 89539, 89549, 89559,
+ 89568, 89577, 89586, 89596, 89604, 89613, 89623, 89633, 89643, 89653,
+ 89661, 89671, 89679, 89689, 89697, 89707, 89715, 89725, 89733, 89742,
+ 89749, 89759, 89767, 89777, 89785, 89795, 89803, 89813, 89821, 89830,
+ 89838, 89847, 89855, 89864, 89873, 89882, 89891, 89901, 89909, 89919,
+ 89927, 89937, 89945, 89955, 89963, 89973, 89981, 89990, 89997, 90007,
+ 90015, 90025, 90033, 90043, 90051, 90061, 90069, 90078, 90086, 90095,
+ 90103, 90112, 90121, 90130, 90139, 90148, 90156, 90165, 90173, 90182,
+ 90191, 90199, 90209, 90218, 90228, 90238, 90247, 90257, 90266, 90275,
+ 90283, 90291, 90296, 90301, 90307, 90315, 90323, 90331, 90339, 90347,
+ 90355, 90361, 90367, 90373, 90381, 90387, 90397, 90403, 90409, 90415,
+ 90426, 90437, 90448, 90458, 90469, 90480, 90490, 90501, 90511, 90521,
+ 90530, 90541, 90552, 90563, 90576, 90586, 90596, 90607, 90617, 90627,
+ 90637, 90647, 90657, 90667, 90677, 90688, 90699, 90710, 90720, 90730,
+ 90742, 90753, 90764, 90774, 90784, 90794, 90804, 90815, 90825, 90835,
+ 90847, 90857, 90867, 90879, 90890, 90901, 90911, 90921, 90931, 90941,
+ 90953, 90965, 90977, 90988, 90999, 91009, 91019, 91029, 91038, 91047,
+ 91057, 91067, 91078, 0, 0, 91088, 91099, 91110, 91120, 91130, 91142,
+ 91153, 91164, 91177, 91187, 91199, 91208, 91217, 91228, 91239, 91252,
+ 91263, 91276, 91286, 91298, 91308, 91320, 91332, 91345, 91355, 91365,
+ 91375, 91386, 91396, 91405, 91415, 91424, 91433, 91443, 91453, 91463,
+ 91473, 91483, 91493, 91504, 91514, 91525, 91535, 91546, 91557, 91567,
+ 91577, 91587, 91597, 91607, 91617, 91628, 91638, 91649, 0, 0, 0, 0, 0, 0,
+ 0, 91660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91666, 91681, 91696, 91702, 91708,
+ 91714, 91720, 91726, 91732, 91738, 91744, 91752, 91756, 91759, 91767,
+ 91775, 91783, 91786, 91789, 91792, 91795, 91798, 91801, 91804, 91807,
+ 91810, 91813, 91816, 91819, 91822, 91825, 91828, 91831, 91839, 91848,
+ 91859, 91867, 91875, 91884, 91893, 91905, 91917, 0, 0, 0, 0, 0, 0, 91927,
+ 91932, 91937, 91944, 91951, 91957, 91963, 91968, 91973, 91978, 91984,
+ 91990, 91996, 92002, 92008, 92015, 92022, 92032, 92042, 92052, 92061,
+ 92072, 92081, 92090, 92101, 92112, 92125, 92138, 92150, 92162, 92174,
+ 92186, 92197, 92208, 92219, 92230, 92242, 92254, 92258, 92263, 92273,
+ 92283, 92287, 92291, 92295, 92300, 92305, 92310, 92315, 92318, 92322, 0,
+ 92327, 92330, 92333, 92337, 92341, 92346, 92350, 92354, 92360, 92366,
+ 92374, 92382, 92385, 92388, 92391, 92394, 92397, 92401, 92405, 0, 92409,
+ 92414, 92418, 92422, 0, 0, 0, 0, 92427, 92432, 92439, 92444, 92449, 0,
+ 92454, 92459, 92465, 92470, 92476, 92481, 92487, 92492, 92498, 92503,
+ 92509, 92515, 92524, 92533, 92542, 92551, 92561, 92571, 92581, 92591,
+ 92600, 92609, 92618, 92628, 92633, 92638, 92644, 92650, 92656, 92663,
+ 92671, 92679, 92685, 92691, 92697, 92704, 92710, 92716, 92722, 92729,
+ 92735, 92741, 92747, 92754, 92759, 92764, 92769, 92775, 92781, 92787,
+ 92793, 92800, 92806, 92812, 92818, 92824, 92830, 92836, 92842, 92848,
+ 92854, 92860, 92866, 92873, 92879, 92885, 92891, 92898, 92904, 92910,
+ 92916, 92923, 92929, 92935, 92941, 92948, 92954, 92960, 92966, 92973,
+ 92979, 92985, 92991, 92998, 93004, 93010, 93016, 93023, 93029, 93035,
+ 93041, 93048, 93054, 93060, 93066, 93073, 93079, 93085, 93091, 93098,
+ 93104, 93110, 93116, 93123, 93129, 93135, 93141, 93148, 93153, 93158,
+ 93163, 93169, 93175, 93181, 93187, 93194, 93200, 93206, 93212, 93219,
+ 93225, 93231, 93238, 93245, 93250, 93255, 93260, 93266, 93278, 93290,
+ 93302, 93314, 93327, 93340, 93348, 0, 0, 93356, 0, 93364, 93369, 93374,
+ 93378, 93383, 93388, 93392, 93396, 93401, 93406, 93410, 93414, 93418,
+ 93422, 93428, 93432, 93437, 93441, 93445, 93449, 93453, 93457, 93461,
+ 93465, 93469, 93473, 93477, 93481, 93486, 93491, 93496, 93501, 93507,
+ 93513, 93520, 93527, 93534, 93540, 93547, 93554, 93561, 93567, 93574,
+ 93581, 93587, 93594, 93601, 93607, 93614, 93621, 93627, 93634, 93641,
+ 93647, 93654, 93661, 93668, 93675, 93682, 93688, 93694, 93700, 93706,
+ 93711, 93717, 93723, 93730, 93737, 93744, 93750, 93757, 93764, 93771,
+ 93777, 93784, 93791, 93797, 93804, 93811, 93817, 93824, 93831, 93837,
+ 93844, 93851, 93857, 93864, 93871, 93878, 93885, 93892, 93899, 93904,
+ 93911, 93915, 93921, 93927, 93933, 93939, 93945, 93949, 93954, 93959,
+ 93964, 93969, 93974, 93979, 93984, 93989, 93995, 94001, 94007, 94015,
+ 94019, 94023, 94027, 94031, 94035, 94039, 94044, 94049, 94054, 94059,
+ 94063, 94068, 94073, 94078, 94083, 94088, 94093, 94098, 94103, 94107,
+ 94111, 94116, 94121, 94126, 94131, 94135, 94140, 94145, 94150, 94155,
+ 94159, 94164, 94169, 94174, 94179, 94183, 94188, 94193, 94197, 94202,
+ 94207, 94212, 94217, 94222, 94227, 94234, 94241, 94245, 94250, 94255,
+ 94260, 94265, 94270, 94275, 94280, 94285, 94290, 94295, 94300, 94305,
+ 94310, 94315, 94320, 94325, 94330, 94335, 94340, 94345, 94350, 94355,
+ 94360, 94365, 94370, 94375, 94380, 94385, 94390, 0, 0, 0, 94395, 94399,
+ 94404, 94408, 94413, 94418, 0, 0, 94422, 94427, 94432, 94436, 94441,
+ 94446, 0, 0, 94451, 94456, 94460, 94465, 94470, 94475, 0, 0, 94480,
+ 94485, 94490, 0, 0, 0, 94494, 94499, 94504, 94509, 94513, 94518, 94523,
+ 0, 94528, 94534, 94537, 94541, 94544, 94548, 94552, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 94556, 94562, 94568, 94574, 94580, 0, 0, 94584, 94590, 94596,
+ 94602, 94608, 94614, 94621, 94628, 94635, 94642, 94649, 94656, 0, 94663,
+ 94670, 94677, 94683, 94690, 94697, 94704, 94711, 94717, 94724, 94731,
+ 94738, 94745, 94751, 94758, 94765, 94772, 94779, 94785, 94792, 94799,
+ 94806, 94813, 94820, 94827, 94834, 0, 94841, 94847, 94854, 94861, 94868,
+ 94875, 94881, 94888, 94895, 94902, 94909, 94916, 94923, 94930, 94936,
+ 94943, 94950, 94957, 94964, 0, 94971, 94978, 0, 94985, 94992, 94999,
+ 95006, 95013, 95020, 95027, 95034, 95041, 95048, 95055, 95062, 95069,
+ 95076, 95083, 0, 0, 95089, 95094, 95099, 95104, 95109, 95114, 95119,
+ 95124, 95129, 95134, 95139, 95144, 95149, 95154, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 95159, 95166, 95173, 95180, 95187, 95194, 95201, 95208, 95215,
+ 95222, 95229, 95236, 95243, 95250, 95257, 95264, 95271, 95278, 95285,
+ 95292, 95300, 95308, 95315, 95322, 95327, 95335, 95343, 95350, 95357,
+ 95362, 95369, 95374, 95379, 95386, 95391, 95396, 95401, 95409, 95414,
+ 95419, 95426, 95431, 95436, 95443, 95450, 95455, 95460, 95465, 95470,
+ 95475, 95480, 95485, 95490, 95495, 95502, 95507, 95514, 95519, 95524,
+ 95529, 95534, 95539, 95544, 95549, 95554, 95559, 95564, 95569, 95576,
+ 95583, 95590, 95597, 95603, 95608, 95615, 95620, 95625, 95634, 95641,
+ 95650, 95657, 95662, 95667, 95675, 95680, 95685, 95690, 95695, 95700,
+ 95707, 95712, 95717, 95722, 95727, 95732, 95739, 95746, 95753, 95760,
+ 95767, 95774, 95781, 95788, 95795, 95802, 95809, 95816, 95823, 95830,
+ 95837, 95844, 95851, 95858, 95865, 95872, 95879, 95886, 95893, 95900,
+ 95907, 95914, 95921, 95928, 0, 0, 0, 0, 0, 95935, 95943, 95951, 0, 0, 0,
+ 0, 95956, 95960, 95964, 95968, 95972, 95976, 95980, 95984, 95988, 95992,
+ 95997, 96002, 96007, 96012, 96017, 96022, 96027, 96032, 96037, 96043,
+ 96049, 96055, 96062, 96069, 96076, 96083, 96090, 96097, 96102, 96107,
+ 96112, 96118, 96124, 96130, 96136, 96142, 96148, 96154, 96160, 96166,
+ 96172, 96178, 96184, 96190, 96196, 0, 0, 0, 96202, 96210, 96218, 96226,
+ 96234, 96242, 96252, 96262, 96270, 96278, 96286, 96294, 96302, 96308,
+ 96315, 96324, 96332, 96340, 96349, 96358, 96367, 96377, 96388, 96398,
+ 96409, 96418, 96427, 96436, 96446, 96457, 96467, 96478, 96489, 96498,
+ 96506, 96512, 96518, 96524, 96530, 96538, 96546, 96552, 96559, 96569,
+ 96576, 96583, 96590, 96597, 96604, 96614, 96621, 96628, 96636, 96644,
+ 96653, 96662, 96671, 96680, 96689, 96696, 96704, 96713, 96722, 96726,
+ 96733, 96738, 96743, 96747, 96751, 96755, 96759, 96764, 96769, 96775,
+ 96781, 96785, 96791, 96795, 96799, 96803, 96807, 96811, 96815, 96821,
+ 96825, 96830, 96834, 96838, 0, 96841, 96846, 96851, 96856, 96861, 96868,
+ 96873, 96878, 96883, 96888, 96893, 96898, 96903, 0, 0, 0, 96906, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96912, 96919,
+ 96928, 96937, 96944, 96951, 96958, 96965, 96972, 96979, 96985, 96992,
+ 96999, 97006, 97013, 97020, 97027, 97034, 97041, 97050, 97057, 97064,
+ 97071, 97078, 97085, 97092, 97099, 97106, 97115, 97122, 97129, 97136,
+ 97143, 97150, 97157, 97166, 97173, 97180, 97187, 97194, 97203, 97210,
+ 97217, 97224, 97232, 97241, 0, 0, 97250, 97254, 97258, 97263, 97268,
+ 97273, 97278, 97282, 97287, 97292, 97297, 97302, 97307, 97312, 97316,
+ 97321, 97326, 97331, 97336, 97340, 97345, 97350, 97354, 97359, 97364,
+ 97369, 97374, 97379, 97384, 0, 0, 0, 97389, 97393, 97398, 97403, 97407,
+ 97412, 97416, 97421, 97426, 97431, 97436, 97441, 97445, 97450, 97455,
+ 97460, 97465, 97470, 97475, 97479, 97484, 97489, 97494, 97499, 97504,
+ 97509, 97513, 97517, 97522, 97527, 97532, 97537, 97542, 97547, 97552,
+ 97557, 97562, 97567, 97572, 97577, 97582, 97587, 97592, 97597, 97602,
+ 97607, 97612, 97617, 97622, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 97627, 97633, 97638, 97643, 97648, 97653, 97658, 97663, 97668, 97673,
+ 97678, 97684, 97690, 97696, 97702, 97708, 97714, 97720, 97726, 97732,
+ 97739, 97746, 97753, 97761, 97769, 97777, 97785, 97793, 0, 0, 0, 0,
+ 97801, 97805, 97810, 97815, 97820, 97824, 97829, 97834, 97839, 97844,
+ 97848, 97852, 97857, 97862, 97867, 97872, 97876, 97881, 97886, 97891,
+ 97896, 97901, 97906, 97910, 97915, 97920, 97925, 97930, 97935, 97940,
+ 97945, 97950, 97955, 97960, 97965, 97971, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 97977, 97982, 97989, 97996, 98001, 98006, 98011, 98016, 98021, 98026,
+ 98031, 98036, 98041, 98046, 98051, 98056, 98061, 98066, 98071, 98076,
+ 98081, 98086, 98091, 98096, 98101, 98106, 98111, 98116, 98121, 98126, 0,
+ 0, 0, 0, 0, 98133, 98139, 98145, 98151, 98157, 98162, 98168, 98174,
+ 98180, 98186, 98191, 98197, 98203, 98209, 98215, 98221, 98227, 98233,
+ 98239, 98245, 98250, 98256, 98262, 98268, 98274, 98280, 98285, 98291,
+ 98297, 98302, 98308, 98314, 98320, 98326, 98332, 98338, 98344, 98349,
+ 98355, 98362, 98369, 98376, 98383, 0, 0, 0, 0, 0, 98390, 98395, 98400,
+ 98405, 98410, 98415, 98420, 98425, 98430, 98435, 98440, 98445, 98450,
+ 98455, 98460, 98465, 98470, 98475, 98480, 98485, 98490, 98495, 98500,
+ 98505, 98510, 98515, 98520, 98524, 98528, 98532, 0, 98537, 98543, 98548,
+ 98553, 98558, 98563, 98569, 98575, 98581, 98587, 98593, 98599, 98605,
+ 98611, 98617, 98623, 98629, 98635, 98641, 98646, 98652, 98658, 98663,
+ 98669, 98674, 98680, 98686, 98691, 98697, 98703, 98708, 98714, 98719,
+ 98724, 98730, 98736, 98742, 0, 0, 0, 0, 98747, 98753, 98759, 98765,
+ 98771, 98777, 98783, 98789, 98795, 98802, 98807, 98812, 98818, 98824, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98830, 98836, 98842,
+ 98848, 98855, 98861, 98868, 98875, 98882, 98889, 98897, 98904, 98912,
+ 98918, 98924, 98930, 98936, 98942, 98948, 98954, 98960, 98966, 98972,
+ 98978, 98984, 98990, 98996, 99002, 99008, 99014, 99020, 99026, 99032,
+ 99038, 99044, 99050, 99056, 99062, 99068, 99074, 99080, 99086, 99092,
+ 99098, 99105, 99111, 99118, 99125, 99132, 99139, 99147, 99154, 99162,
+ 99168, 99174, 99180, 99186, 99192, 99198, 99204, 99210, 99216, 99222,
+ 99228, 99234, 99240, 99246, 99252, 99258, 99264, 99270, 99276, 99282,
+ 99288, 99294, 99300, 99306, 99312, 99318, 99324, 99330, 99335, 99340,
+ 99345, 99350, 99355, 99360, 99365, 99370, 99375, 99380, 99385, 99390,
+ 99395, 99400, 99405, 99410, 99415, 99420, 99425, 99430, 99435, 99440,
+ 99445, 99450, 99455, 99460, 99465, 99470, 99475, 99480, 99485, 99490,
+ 99495, 99500, 99505, 99510, 99515, 99520, 99525, 99530, 99535, 99540,
+ 99545, 99550, 99555, 99560, 99565, 99570, 99575, 99580, 99585, 99590,
+ 99595, 99600, 99605, 99609, 99613, 99618, 99623, 99628, 99633, 99638,
+ 99643, 99648, 99653, 99658, 99663, 99668, 99672, 99676, 99680, 99684,
+ 99688, 99692, 99696, 99701, 99706, 0, 0, 99711, 99716, 99720, 99724,
+ 99728, 99732, 99736, 99740, 99744, 99748, 0, 0, 0, 0, 0, 0, 99752, 99757,
+ 99763, 99769, 99775, 99781, 99787, 99793, 99798, 99804, 99809, 99815,
+ 99820, 99825, 99831, 99837, 99842, 99847, 99852, 99857, 99863, 99868,
+ 99874, 99879, 99885, 99891, 99897, 99903, 99909, 99915, 99921, 99926,
+ 99932, 99938, 99944, 99950, 0, 0, 0, 0, 99956, 99961, 99967, 99973,
+ 99979, 99985, 99991, 99997, 100002, 100008, 100013, 100019, 100024,
+ 100029, 100035, 100041, 100046, 100051, 100056, 100061, 100067, 100072,
+ 100078, 100083, 100089, 100095, 100101, 100107, 100113, 100119, 100125,
+ 100130, 100136, 100142, 100148, 100154, 0, 0, 0, 0, 100160, 100164,
+ 100169, 100174, 100179, 100184, 100189, 100194, 100199, 100203, 100208,
+ 100213, 100218, 100223, 100227, 100232, 100237, 100242, 100247, 100252,
+ 100257, 100261, 100266, 100270, 100275, 100280, 100285, 100290, 100295,
+ 100300, 100305, 100310, 100314, 100319, 100324, 100329, 100334, 100339,
+ 100344, 100349, 0, 0, 0, 0, 0, 0, 0, 0, 100354, 100361, 100368, 100375,
+ 100382, 100389, 100396, 100403, 100410, 100417, 100424, 100431, 100438,
+ 100445, 100452, 100459, 100466, 100473, 100480, 100487, 100494, 100501,
+ 100508, 100515, 100522, 100529, 100536, 100543, 100550, 100557, 100564,
+ 100571, 100578, 100585, 100592, 100599, 100606, 100613, 100620, 100627,
+ 100634, 100641, 100648, 100655, 100662, 100669, 100676, 100683, 100690,
+ 100697, 100704, 100711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100718, 100725,
+ 100730, 100736, 100742, 100748, 100754, 100760, 100766, 100772, 100777,
+ 100783, 0, 100789, 100794, 100800, 100805, 100811, 100817, 100822,
+ 100827, 100833, 100839, 100845, 100851, 100856, 100862, 100868, 0,
+ 100874, 100880, 100886, 100892, 100898, 100903, 100909, 0, 100915,
+ 100921, 0, 100927, 100932, 100938, 100944, 100950, 100956, 100962,
+ 100968, 100974, 100979, 100985, 0, 100991, 100996, 101002, 101007,
+ 101013, 101019, 101024, 101029, 101035, 101041, 101047, 101053, 101058,
+ 101064, 101070, 0, 101076, 101082, 101088, 101094, 101100, 101105,
+ 101111, 0, 101117, 101123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 101129, 101134, 101139, 101144, 101149, 101154, 101159,
+ 101164, 101169, 101174, 101179, 101184, 101189, 101194, 101199, 101204,
+ 101209, 101214, 101219, 101224, 101229, 101234, 101239, 101244, 101249,
+ 101254, 101259, 101264, 101269, 101274, 101279, 101284, 101289, 101294,
+ 101299, 101304, 101309, 101314, 101319, 101324, 101329, 101334, 101339,
+ 101344, 101349, 101354, 101359, 101364, 101369, 101374, 101379, 101384,
+ 101389, 101394, 101399, 101404, 101409, 101414, 101419, 101424, 101429,
+ 101434, 101439, 101444, 101449, 101454, 101459, 101464, 101469, 101474,
+ 101479, 101484, 101489, 101494, 101499, 101504, 101509, 101514, 101519,
+ 101524, 101529, 101534, 101539, 101544, 101549, 101554, 101559, 101564,
+ 101569, 101574, 101579, 101584, 101589, 101594, 101599, 101604, 101609,
+ 101614, 101619, 101624, 101629, 101634, 101639, 101644, 101649, 101654,
+ 101659, 101664, 101669, 101674, 101679, 101684, 101689, 101694, 101699,
+ 101704, 101709, 101714, 101719, 101724, 101729, 101734, 101739, 101744,
+ 101749, 101754, 101759, 101764, 101769, 101774, 101779, 101784, 101789,
+ 101794, 101799, 101804, 101809, 101814, 101819, 101824, 101829, 101834,
+ 101839, 101844, 101849, 101854, 101859, 101864, 101869, 101874, 101879,
+ 101884, 101889, 101894, 101899, 101904, 101909, 101914, 101919, 101924,
+ 101929, 101934, 101939, 101944, 101949, 101954, 101959, 101964, 101969,
+ 101974, 101979, 101984, 101989, 101994, 101999, 102004, 102009, 102014,
+ 102019, 102024, 102029, 102034, 102039, 102044, 102049, 102054, 102059,
+ 102064, 102069, 102074, 102079, 102084, 102089, 102094, 102099, 102104,
+ 102109, 102114, 102119, 102124, 102129, 102134, 102139, 102144, 102149,
+ 102154, 102159, 102164, 102169, 102174, 102179, 102184, 102189, 102194,
+ 102199, 102204, 102209, 102214, 102219, 102224, 102229, 102234, 102239,
+ 102244, 102249, 102254, 102259, 102264, 102269, 102274, 102279, 102284,
+ 102289, 102294, 102299, 102304, 102309, 102314, 102319, 102324, 102329,
+ 102334, 102339, 102344, 102349, 102354, 102359, 102364, 102369, 102374,
+ 102379, 102384, 102389, 102394, 102399, 102404, 102409, 102414, 102419,
+ 102424, 102429, 102434, 102439, 102444, 102449, 102454, 102459, 102464,
+ 102469, 102474, 102479, 102484, 102489, 102494, 102499, 102504, 102509,
+ 102514, 102519, 102524, 102529, 102534, 102539, 102544, 102549, 102554,
+ 102559, 102564, 102569, 102574, 102579, 102584, 102589, 102594, 102599,
+ 102604, 102609, 102614, 102619, 102624, 102629, 102634, 102639, 102644,
+ 102649, 102654, 102659, 102664, 102669, 102674, 102679, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 102684, 102690, 102697, 102704, 102710, 102717, 102724, 102731,
+ 102738, 102744, 102751, 102758, 102765, 102772, 102779, 102786, 102793,
+ 102800, 102807, 102814, 102821, 102828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 102835, 102840, 102845, 102850, 102855, 102860, 102865, 102870, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102875,
+ 102881, 102889, 102898, 102903, 102909, 0, 102915, 102922, 102933,
+ 102943, 102950, 102958, 102965, 102976, 102982, 102992, 102999, 103006,
+ 103012, 103019, 103027, 103034, 103040, 103047, 103059, 103066, 103073,
+ 103081, 103090, 103103, 103108, 103117, 103123, 103132, 103138, 103144,
+ 103151, 103156, 103166, 103180, 103188, 103196, 103201, 103211, 103218,
+ 103229, 103236, 103245, 0, 103253, 103259, 103267, 103277, 103283,
+ 103289, 103295, 103301, 103311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 103319, 103323, 103327, 103331, 103335, 103339, 0,
+ 0, 103344, 0, 103349, 103353, 103358, 103363, 103368, 103373, 103377,
+ 103382, 103387, 103392, 103397, 103401, 103406, 103411, 103416, 103421,
+ 103425, 103430, 103435, 103440, 103445, 103449, 103454, 103459, 103464,
+ 103469, 103473, 103478, 103483, 103488, 103493, 103497, 103502, 103507,
+ 103512, 103517, 103522, 103527, 103532, 103536, 103541, 103546, 103551,
+ 103556, 0, 103561, 103566, 0, 0, 0, 103571, 0, 0, 103576, 103581, 103588,
+ 103595, 103602, 103609, 103616, 103623, 103630, 103637, 103644, 103651,
+ 103658, 103665, 103672, 103679, 103686, 103693, 103700, 103707, 103714,
+ 103721, 103728, 0, 103735, 103742, 103748, 103754, 103760, 103767,
+ 103774, 103782, 103789, 103797, 103802, 103807, 103812, 103817, 103822,
+ 103827, 103832, 103837, 103842, 103847, 103852, 103857, 103862, 103868,
+ 103873, 103878, 103883, 103888, 103893, 103898, 103903, 103908, 103913,
+ 103919, 103925, 103929, 103933, 103937, 103941, 103945, 103950, 103955,
+ 103961, 103966, 103972, 103977, 103982, 103987, 103993, 103998, 104003,
+ 104008, 104013, 104018, 104024, 104029, 104035, 104040, 104046, 104051,
+ 104057, 104062, 104068, 104073, 104078, 104083, 104088, 104093, 104098,
+ 104103, 104109, 104114, 0, 0, 0, 0, 0, 0, 0, 0, 104119, 104123, 104127,
+ 104131, 104135, 104141, 104145, 104150, 104155, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104161, 104166, 104171,
+ 104176, 104181, 104186, 104191, 104196, 104201, 104206, 104211, 104216,
+ 104221, 104226, 104231, 104236, 104241, 104246, 104251, 0, 104256,
+ 104261, 0, 0, 0, 0, 0, 104266, 104270, 104274, 104279, 104284, 104290,
+ 104295, 104300, 104305, 104310, 104315, 104320, 104325, 104330, 104335,
+ 104340, 104345, 104350, 104355, 104360, 104365, 104370, 104375, 104380,
+ 104385, 104390, 104395, 104400, 104404, 104409, 104414, 104420, 104424,
+ 0, 0, 0, 104428, 104434, 104438, 104443, 104448, 104453, 104457, 104462,
+ 104466, 104471, 104476, 104480, 104485, 104490, 104494, 104498, 104503,
+ 104508, 104512, 104517, 104522, 104527, 104532, 104537, 104542, 104547,
+ 104552, 0, 0, 0, 0, 0, 104557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 104562, 104567, 104572, 104577, 104582, 104587, 104593, 104599,
+ 104605, 104610, 104615, 104620, 104626, 104632, 104638, 104643, 104649,
+ 104654, 104660, 104666, 104671, 104677, 104683, 104688, 104694, 104700,
+ 104706, 104712, 104718, 104723, 104729, 104735, 104741, 104746, 104751,
+ 104756, 104761, 104766, 104772, 104778, 104783, 104788, 104793, 104799,
+ 104804, 104809, 104815, 104821, 104826, 104833, 104839, 104844, 104850,
+ 104856, 104862, 104867, 0, 0, 0, 0, 104873, 104882, 104890, 104897,
+ 104904, 104909, 104914, 104919, 104924, 104929, 104934, 104939, 104944,
+ 104949, 104955, 104961, 104967, 104973, 104979, 104985, 0, 0, 104991,
+ 104998, 105005, 105012, 105020, 105028, 105036, 105044, 105052, 105060,
+ 105066, 105072, 105078, 105085, 105092, 105099, 105106, 105113, 105120,
+ 105127, 105134, 105141, 105148, 105155, 105162, 105169, 105176, 105183,
+ 105191, 105199, 105207, 105216, 105225, 105234, 105243, 105252, 105261,
+ 105269, 105277, 105285, 105294, 105303, 105312, 105321, 105330, 105339,
+ 105348, 105352, 105357, 105362, 0, 105368, 105373, 0, 0, 0, 0, 0, 105378,
+ 105384, 105391, 105396, 105401, 105405, 105410, 105415, 0, 105420,
+ 105425, 105430, 0, 105435, 105440, 105445, 105450, 105455, 105460,
+ 105465, 105470, 105475, 105480, 105485, 105489, 105493, 105498, 105503,
+ 105508, 105512, 105516, 105520, 105524, 105529, 105534, 105539, 105543,
+ 105548, 105552, 105557, 105562, 105567, 0, 0, 105572, 105578, 105583, 0,
+ 0, 0, 0, 105588, 105592, 105596, 105600, 105604, 105608, 105613, 105618,
+ 105624, 105629, 0, 0, 0, 0, 0, 0, 0, 105636, 105642, 105649, 105655,
+ 105662, 105668, 105674, 105680, 105687, 0, 0, 0, 0, 0, 0, 0, 105693,
+ 105701, 105709, 105717, 105725, 105733, 105741, 105749, 105757, 105765,
+ 105773, 105781, 105789, 105797, 105805, 105813, 105821, 105829, 105837,
+ 105845, 105853, 105861, 105869, 105877, 105885, 105893, 105901, 105909,
+ 105917, 105925, 105932, 105940, 105948, 105955, 105962, 105969, 105976,
+ 105983, 105990, 105997, 106004, 106011, 106018, 106025, 106032, 106039,
+ 106046, 106053, 106060, 106067, 106074, 106081, 106088, 106095, 106102,
+ 106109, 106116, 106123, 106130, 106137, 106144, 106151, 106157, 106164,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 106171, 106176, 106181, 106186, 106191, 106196,
+ 106201, 106206, 106211, 106216, 106221, 106226, 106231, 106236, 106241,
+ 106246, 106251, 106256, 106261, 106266, 106271, 106276, 106281, 106286,
+ 106291, 106296, 106301, 106306, 106311, 106316, 106321, 106326, 106331,
+ 106336, 106341, 106346, 106351, 106356, 106362, 0, 0, 0, 0, 106368,
+ 106372, 106376, 106381, 106386, 106392, 106398, 106404, 106414, 106423,
+ 106429, 106436, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106444, 106448, 106453,
+ 106458, 106463, 106468, 106473, 106478, 106483, 106487, 106492, 106496,
+ 106501, 106505, 106510, 106514, 106519, 106524, 106529, 106534, 106539,
+ 106544, 106549, 106554, 106559, 106564, 106569, 106574, 106579, 106584,
+ 106589, 106594, 106599, 106604, 106609, 106614, 106619, 106624, 106629,
+ 106634, 106639, 106644, 106649, 106654, 106659, 106664, 106669, 106674,
+ 106679, 106684, 106689, 106694, 106699, 106704, 0, 0, 0, 106709, 106714,
+ 106723, 106731, 106740, 106749, 106760, 106771, 106778, 106785, 106792,
+ 106799, 106806, 106813, 106820, 106827, 106834, 106841, 106848, 106855,
+ 106862, 106869, 106876, 106883, 106890, 106897, 106904, 106911, 106918,
+ 0, 0, 106925, 106931, 106937, 106943, 106949, 106956, 106963, 106971,
+ 106978, 106985, 106992, 106999, 107006, 107013, 107020, 107027, 107034,
+ 107041, 107048, 107055, 107062, 107069, 107076, 107083, 107090, 107097,
+ 107104, 0, 0, 0, 0, 0, 107111, 107117, 107123, 107129, 107135, 107142,
+ 107149, 107157, 107164, 107171, 107178, 107185, 107192, 107199, 107206,
+ 107213, 107220, 107227, 107234, 107241, 107248, 107255, 107262, 107269,
+ 107276, 107283, 0, 0, 0, 0, 0, 0, 0, 107290, 107297, 107305, 107315, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107325, 107331, 107337, 107343, 107349,
+ 107356, 107363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107371, 107378, 107385, 107393,
+ 107400, 107407, 107414, 107421, 107429, 107437, 107445, 107453, 107461,
+ 107469, 107477, 107485, 107493, 107501, 107509, 107517, 107525, 107533,
+ 107541, 107549, 107557, 107565, 107573, 107581, 107589, 107597, 107605,
+ 107613, 107621, 107629, 107637, 107645, 107653, 107661, 107669, 107677,
+ 107685, 107693, 107701, 107709, 107717, 107725, 107733, 107741, 107749,
+ 107757, 107765, 107773, 107781, 107789, 107797, 107805, 107813, 107821,
+ 107829, 107837, 107845, 107853, 107861, 107869, 107877, 107885, 107893,
+ 107901, 107909, 107917, 107925, 107933, 107941, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 107949, 107954, 107960, 107966, 107972, 107978, 107984, 107990, 107996,
+ 108002, 108007, 108014, 108020, 108026, 108032, 108038, 108044, 108049,
+ 108055, 108061, 108067, 108073, 108079, 108085, 108091, 108097, 108103,
+ 108109, 108114, 108120, 108128, 108136, 108142, 108148, 108154, 108160,
+ 108168, 108174, 108180, 108186, 108192, 108198, 108204, 108209, 108215,
+ 108223, 108231, 108237, 108243, 108249, 108256, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 108262, 108267, 108273, 108279, 108285, 108291, 108297,
+ 108303, 108309, 108315, 108320, 108327, 108333, 108339, 108345, 108351,
+ 108357, 108362, 108368, 108374, 108380, 108386, 108392, 108398, 108404,
+ 108410, 108416, 108422, 108427, 108433, 108441, 108449, 108455, 108461,
+ 108467, 108473, 108481, 108487, 108493, 108499, 108505, 108511, 108517,
+ 108522, 108528, 108536, 108544, 108550, 108556, 108562, 108569, 0, 0, 0,
+ 0, 0, 0, 0, 108575, 108579, 108583, 108588, 108593, 108599, 108604,
+ 108610, 108617, 108623, 108630, 108637, 108644, 108651, 108657, 108664,
+ 108671, 108678, 108685, 108691, 108698, 108705, 108711, 108718, 108724,
+ 108731, 108737, 108743, 108749, 108756, 108765, 108771, 108779, 108786,
+ 108793, 108800, 108806, 108812, 108818, 108824, 108830, 108837, 108846,
+ 108853, 108860, 108867, 0, 0, 0, 0, 0, 0, 0, 0, 108874, 108881, 108887,
+ 108893, 108899, 108905, 108911, 108917, 108923, 108929, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108935, 108939, 108943,
+ 108947, 108951, 108955, 108959, 108963, 108967, 108971, 108976, 108981,
+ 108986, 108991, 108996, 109001, 109006, 109011, 109016, 109022, 109028,
+ 109034, 109041, 109048, 109055, 109062, 109069, 109076, 109083, 109090,
+ 109097, 0, 109104, 109109, 109114, 109119, 109124, 109129, 109134,
+ 109139, 109144, 109149, 109154, 109159, 109164, 109169, 109173, 109178,
+ 109183, 109188, 109193, 109198, 109203, 109208, 109213, 109218, 109223,
+ 109228, 109233, 109238, 109246, 109251, 109256, 109261, 109266, 109271,
+ 109276, 109281, 109286, 109291, 109296, 109301, 109306, 109311, 0,
+ 109316, 109322, 109328, 0, 0, 109333, 109341, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109350, 109357,
+ 109364, 109371, 109377, 109384, 109390, 109397, 109403, 109409, 109416,
+ 109422, 109428, 109434, 109440, 109446, 109452, 109458, 109464, 109471,
+ 109482, 109488, 109494, 109502, 109508, 109514, 109521, 109532, 109538,
+ 109544, 109550, 109557, 109568, 109573, 109578, 109583, 109588, 109593,
+ 109599, 109605, 109611, 109618, 109626, 0, 0, 0, 0, 0, 0, 0, 0, 109632,
+ 109637, 109642, 109647, 109652, 109657, 109662, 109667, 109672, 109677,
+ 109682, 109687, 109692, 109697, 109702, 109707, 109712, 109717, 109722,
+ 109727, 109732, 109737, 109743, 109748, 109754, 109759, 109765, 109771,
+ 109777, 109783, 109789, 109796, 109802, 109808, 109812, 109817, 109822,
+ 109828, 109836, 109847, 109856, 109866, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109876, 109882, 109888, 109894, 109900,
+ 109906, 109913, 109919, 109925, 109931, 109937, 109943, 109949, 109955,
+ 109961, 109967, 109973, 109979, 109985, 109991, 109997, 110004, 110011,
+ 110017, 110025, 110033, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110042,
+ 110047, 110053, 110058, 110063, 110068, 110073, 110078, 110085, 110090,
+ 110095, 110100, 110105, 110110, 110115, 110120, 110125, 110130, 110135,
+ 110140, 110145, 110150, 110154, 110158, 110162, 110166, 110171, 110176,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110182,
+ 110187, 110192, 110197, 110202, 110207, 110212, 110217, 110222, 110227,
+ 110232, 110237, 110242, 110247, 110252, 110257, 110262, 110267, 110272,
+ 110277, 110282, 110287, 110292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110297,
+ 110301, 110305, 110309, 110313, 110317, 110320, 110324, 110327, 110331,
+ 110334, 110338, 110342, 110347, 110351, 110356, 110359, 110363, 110366,
+ 110370, 110373, 110377, 110381, 110385, 110389, 110393, 110397, 110401,
+ 110405, 110409, 110413, 110417, 110421, 110425, 110429, 110433, 110437,
+ 110441, 110445, 110448, 110451, 110455, 110459, 110463, 110466, 110469,
+ 110472, 110475, 110479, 110483, 110487, 110490, 110493, 110497, 110503,
+ 110509, 110515, 110520, 110527, 110531, 110536, 110540, 110545, 110550,
+ 110556, 110561, 110567, 110571, 110576, 110580, 110585, 110588, 110591,
+ 110595, 110600, 110606, 110611, 110617, 0, 0, 0, 0, 110622, 110625,
+ 110628, 110631, 110634, 110637, 110640, 110643, 110646, 110649, 110653,
+ 110657, 110661, 110665, 110669, 110673, 110677, 110681, 110685, 110690,
+ 110694, 110698, 110701, 110704, 110707, 110710, 110713, 110716, 110719,
+ 110722, 110725, 110731, 110738, 110745, 110753, 110761, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 110767, 110771, 110776, 110781, 110786, 110790, 110795, 110799,
+ 110804, 110808, 110813, 110817, 110822, 110826, 110831, 110835, 110840,
+ 110845, 110850, 110855, 110860, 110865, 110870, 110875, 110880, 110885,
+ 110890, 110895, 110900, 110905, 110910, 110915, 110920, 110925, 110930,
+ 110935, 110939, 110943, 110948, 110953, 110958, 110962, 110966, 110970,
+ 110974, 110979, 110984, 110989, 110993, 110997, 111003, 111008, 111014,
+ 111019, 111025, 111030, 111036, 111041, 111047, 111052, 111057, 111062,
+ 111067, 111071, 111076, 111082, 111086, 111091, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 111097, 0, 0, 111102, 111109, 111116, 111123, 111130, 111137,
+ 111144, 111151, 111158, 111165, 111172, 111179, 111186, 111193, 111200,
+ 111207, 111214, 111221, 111228, 111235, 111242, 111249, 111256, 111263,
+ 111270, 0, 0, 0, 0, 0, 0, 0, 111277, 111284, 111290, 111296, 111302,
+ 111308, 111314, 111320, 111326, 111332, 0, 0, 0, 0, 0, 0, 111338, 111343,
+ 111348, 111353, 111358, 111362, 111366, 111370, 111375, 111380, 111385,
+ 111390, 111395, 111400, 111405, 111410, 111415, 111420, 111425, 111430,
+ 111435, 111440, 111445, 111450, 111455, 111460, 111465, 111470, 111475,
+ 111480, 111485, 111490, 111495, 111500, 111505, 111510, 111515, 111520,
+ 111525, 111530, 111535, 111540, 111546, 111551, 111557, 111562, 111568,
+ 111573, 111579, 111585, 111589, 111594, 111598, 0, 111602, 111607,
+ 111611, 111615, 111619, 111623, 111627, 111631, 111635, 111639, 111643,
+ 111648, 111652, 111657, 111662, 111667, 111673, 111679, 0, 0, 0, 0, 0, 0,
+ 0, 0, 111684, 111688, 111692, 111696, 111700, 111704, 111708, 111713,
+ 111718, 111723, 111728, 111733, 111738, 111743, 111748, 111753, 111758,
+ 111763, 111768, 111773, 111778, 111783, 111788, 111793, 111797, 111801,
+ 111806, 111811, 111816, 111820, 111824, 111828, 111833, 111837, 111841,
+ 111846, 111851, 111856, 111861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111866,
+ 111871, 111876, 111881, 111885, 111890, 111894, 111899, 111903, 111908,
+ 111913, 111919, 111924, 111930, 111934, 111939, 111943, 111948, 111952,
+ 111957, 111962, 111967, 111972, 111977, 111982, 111987, 111992, 111997,
+ 112002, 112007, 112012, 112017, 112022, 112027, 112032, 112037, 112042,
+ 112046, 112050, 112055, 112060, 112065, 112069, 112073, 112077, 112081,
+ 112086, 112091, 112096, 112101, 112105, 112109, 112115, 112120, 112126,
+ 112131, 112137, 112143, 112150, 112156, 112163, 112168, 112174, 112179,
+ 112185, 112190, 112195, 112200, 112205, 112209, 112213, 112218, 112223,
+ 112227, 112232, 112237, 112242, 112250, 112255, 112262, 112269, 112274,
+ 112278, 112282, 112286, 112290, 112294, 112298, 112302, 112306, 112310,
+ 112314, 112319, 112323, 112328, 112334, 0, 112340, 112345, 112350,
+ 112355, 112360, 112365, 112370, 112375, 112380, 112385, 112391, 112397,
+ 112403, 112409, 112415, 112421, 112427, 112433, 112439, 112446, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 112452, 112456, 112461, 112465, 112469, 112473,
+ 112478, 112482, 112487, 112491, 112496, 112501, 112506, 112511, 112516,
+ 112521, 112526, 112531, 0, 112536, 112541, 112546, 112551, 112556,
+ 112561, 112566, 112571, 112576, 112581, 112586, 112591, 112595, 112599,
+ 112604, 112609, 112614, 112619, 112623, 112627, 112631, 112635, 112640,
+ 112644, 112648, 112653, 112659, 112664, 112670, 112675, 112680, 112686,
+ 112691, 112697, 112702, 112707, 112712, 112717, 112721, 112726, 112732,
+ 112737, 112743, 112748, 112753, 112758, 112764, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 112770, 112774, 112778, 112782, 112786, 112790, 112795,
+ 0, 112800, 0, 112805, 112810, 112815, 112820, 0, 112825, 112830, 112835,
+ 112840, 112845, 112850, 112855, 112860, 112865, 112870, 112875, 112880,
+ 112884, 112888, 112893, 0, 112898, 112903, 112907, 112911, 112915,
+ 112919, 112924, 112928, 112932, 112937, 112942, 0, 0, 0, 0, 0, 0, 112947,
+ 112951, 112956, 112960, 112965, 112969, 112974, 112978, 112983, 112987,
+ 112992, 112996, 113001, 113006, 113011, 113016, 113021, 113026, 113031,
+ 113036, 113041, 113046, 113051, 113056, 113061, 113066, 113071, 113076,
+ 113081, 113086, 113091, 113096, 113101, 113106, 113110, 113114, 113119,
+ 113124, 113129, 113134, 113138, 113142, 113146, 113150, 113155, 113160,
+ 113164, 113168, 113173, 113179, 113184, 113190, 113195, 113201, 113206,
+ 113212, 113217, 113223, 113228, 0, 0, 0, 0, 0, 113233, 113238, 113242,
+ 113246, 113250, 113254, 113258, 113262, 113266, 113270, 0, 0, 0, 0, 0, 0,
+ 113274, 113281, 113286, 113291, 0, 113296, 113300, 113305, 113309,
+ 113314, 113318, 113323, 113328, 0, 0, 113333, 113338, 0, 0, 113343,
+ 113348, 113353, 113357, 113362, 113367, 113372, 113377, 113382, 113387,
+ 113392, 113397, 113402, 113407, 113412, 113417, 113422, 113427, 113432,
+ 113437, 113442, 113447, 0, 113451, 113455, 113460, 113465, 113470,
+ 113474, 113478, 0, 113482, 113486, 0, 113491, 113496, 113501, 113506,
+ 113510, 0, 113514, 113518, 113523, 113528, 113534, 113539, 113545,
+ 113550, 113556, 113562, 0, 0, 113569, 113575, 0, 0, 113581, 113587,
+ 113593, 0, 0, 113598, 0, 0, 0, 0, 0, 0, 113602, 0, 0, 0, 0, 0, 113609,
+ 113614, 113621, 113629, 113635, 113641, 113647, 0, 0, 113654, 113660,
+ 113665, 113670, 113675, 113680, 113685, 0, 0, 0, 113690, 113695, 113700,
+ 113705, 113711, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113716, 113720, 113725,
+ 113729, 113734, 113738, 113743, 113748, 113754, 113759, 113765, 113769,
+ 113774, 113778, 113783, 113787, 113792, 113797, 113802, 113807, 113812,
+ 113817, 113822, 113827, 113832, 113837, 113842, 113847, 113852, 113857,
+ 113862, 113867, 113872, 113877, 113882, 113887, 113891, 113896, 113900,
+ 113905, 113910, 113915, 113919, 113924, 113928, 113932, 113937, 113941,
+ 113946, 113951, 113956, 113961, 113965, 113969, 113975, 113980, 113986,
+ 113991, 113997, 114003, 114010, 114016, 114023, 114028, 114034, 114039,
+ 114045, 114050, 114055, 114060, 114065, 114070, 114075, 114081, 114085,
+ 114089, 114093, 114098, 114102, 114108, 114113, 114118, 114122, 114126,
+ 114130, 114134, 114138, 114142, 114146, 114150, 114154, 114159, 0,
+ 114164, 114169, 114174, 114181, 114186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114191, 114195,
+ 114199, 114204, 114208, 114213, 114217, 114222, 114227, 114233, 114238,
+ 114244, 114248, 114253, 114257, 114262, 114266, 114271, 114276, 114281,
+ 114286, 114291, 114296, 114301, 114306, 114311, 114316, 114321, 114326,
+ 114331, 114336, 114341, 114346, 114351, 114356, 114360, 114364, 114369,
+ 114374, 114379, 114383, 114387, 114391, 114395, 114400, 114405, 114410,
+ 114414, 114418, 114424, 114429, 114435, 114440, 114446, 114452, 114459,
+ 114465, 114472, 114477, 114484, 114490, 114495, 114502, 114508, 114513,
+ 114518, 114523, 114528, 114533, 114538, 114542, 114547, 0, 0, 0, 0, 0, 0,
+ 0, 0, 114551, 114556, 114560, 114564, 114568, 114572, 114576, 114580,
+ 114584, 114588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114592, 114596,
+ 114601, 114605, 114610, 114614, 114619, 114624, 114630, 114635, 114641,
+ 114645, 114650, 114654, 114659, 114663, 114668, 114673, 114678, 114683,
+ 114688, 114693, 114698, 114703, 114708, 114713, 114718, 114723, 114728,
+ 114733, 114738, 114743, 114748, 114753, 114757, 114761, 114766, 114771,
+ 114776, 114780, 114784, 114788, 114792, 114797, 114802, 114807, 114811,
+ 114815, 114821, 114826, 114832, 114837, 114843, 114849, 0, 0, 114856,
+ 114861, 114867, 114872, 114878, 114883, 114888, 114893, 114898, 114903,
+ 114908, 114912, 114917, 114923, 114928, 114934, 114940, 114946, 114954,
+ 114967, 114980, 114993, 115007, 115022, 115030, 115041, 115050, 115060,
+ 115070, 115080, 115091, 115103, 115116, 115124, 115132, 115141, 115147,
+ 115154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115162, 115166, 115171, 115175,
+ 115180, 115184, 115189, 115194, 115200, 115205, 115211, 115215, 115220,
+ 115224, 115229, 115233, 115238, 115243, 115248, 115253, 115258, 115263,
+ 115268, 115273, 115278, 115283, 115288, 115293, 115298, 115303, 115308,
+ 115313, 115318, 115323, 115327, 115331, 115336, 115341, 115346, 115350,
+ 115354, 115358, 115362, 115367, 115372, 115377, 115381, 115385, 115390,
+ 115396, 115401, 115407, 115412, 115418, 115424, 115431, 115437, 115444,
+ 115449, 115455, 115460, 115466, 115471, 115476, 115481, 115486, 115490,
+ 115495, 115500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115505, 115510, 115514,
+ 115518, 115522, 115526, 115530, 115534, 115538, 115542, 0, 0, 0, 0, 0, 0,
+ 115546, 115552, 115557, 115564, 115572, 115579, 115587, 115596, 115601,
+ 115610, 115615, 115623, 115632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 115642, 115646, 115651, 115655, 115660, 115664, 115669,
+ 115673, 115678, 115682, 115687, 115691, 115696, 115701, 115706, 115711,
+ 115716, 115721, 115726, 115731, 115736, 115741, 115746, 115751, 115756,
+ 115761, 115766, 115771, 115776, 115781, 115785, 115789, 115794, 115799,
+ 115804, 115808, 115812, 115816, 115820, 115825, 115830, 115834, 115838,
+ 115843, 115848, 115853, 115859, 115864, 115870, 115875, 115881, 115886,
+ 115892, 115897, 115903, 115908, 115913, 115920, 0, 0, 0, 0, 0, 0, 115925,
+ 115930, 115934, 115938, 115942, 115946, 115950, 115954, 115958, 115962,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 115966, 115970, 115975, 115980, 115984, 115989, 115996,
+ 116000, 116005, 116010, 116014, 116019, 116024, 116029, 116033, 116037,
+ 116041, 116046, 116050, 116054, 116059, 116064, 116069, 116076, 116081,
+ 116086, 116091, 0, 0, 116098, 116105, 116112, 116121, 116126, 116132,
+ 116137, 116143, 116148, 116154, 116159, 116165, 116170, 116176, 116182,
+ 0, 0, 0, 0, 116187, 116192, 116196, 116200, 116204, 116208, 116212,
+ 116216, 116220, 116224, 116228, 116233, 116238, 116244, 116249, 116254,
+ 116259, 116264, 116269, 116274, 116279, 116284, 116289, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 116294, 116298, 116303, 116307, 116312, 116316, 116321, 116325,
+ 116330, 116334, 116339, 116343, 116348, 116353, 116358, 116363, 116368,
+ 116373, 116378, 116383, 116388, 116393, 116398, 116403, 116408, 116413,
+ 116418, 116423, 116428, 116433, 116437, 116441, 116446, 116451, 116456,
+ 116460, 116464, 116468, 116472, 116477, 116482, 116487, 116491, 116495,
+ 116500, 116506, 116511, 116517, 116522, 116528, 116534, 116541, 116546,
+ 116552, 116557, 116563, 116568, 116573, 116578, 116583, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116588,
+ 116596, 116603, 116611, 116619, 116626, 116634, 116642, 116650, 116657,
+ 116664, 116672, 116680, 116688, 116696, 116704, 116712, 116720, 116728,
+ 116736, 116744, 116752, 116760, 116768, 116776, 116784, 116792, 116800,
+ 116808, 116816, 116824, 116832, 116840, 116848, 116855, 116863, 116871,
+ 116878, 116886, 116894, 116902, 116909, 116916, 116924, 116932, 116940,
+ 116948, 116956, 116964, 116972, 116980, 116988, 116996, 117004, 117012,
+ 117020, 117028, 117036, 117044, 117052, 117060, 117068, 117076, 117084,
+ 117092, 117099, 117105, 117111, 117117, 117123, 117129, 117135, 117141,
+ 117147, 117153, 117160, 117167, 117174, 117181, 117188, 117195, 117202,
+ 117209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117216, 117222, 117228,
+ 117235, 117241, 117248, 117254, 117261, 0, 0, 117267, 0, 0, 117273,
+ 117279, 117286, 117293, 117300, 117307, 117314, 117321, 0, 117328,
+ 117335, 0, 117342, 117349, 117356, 117363, 117370, 117377, 117384,
+ 117391, 117397, 117403, 117410, 117417, 117424, 117430, 117436, 117443,
+ 117449, 117455, 117462, 117469, 117476, 117482, 117488, 117495, 117502,
+ 117510, 117517, 117525, 117532, 117540, 0, 117547, 117555, 0, 0, 117562,
+ 117569, 117576, 117583, 117589, 117598, 117605, 117611, 117618, 117625,
+ 117632, 117640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117650, 117657, 117663,
+ 117669, 117675, 117681, 117687, 117693, 117699, 117705, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117711, 117715, 117720,
+ 117724, 117729, 117733, 117738, 117743, 0, 0, 117749, 117753, 117758,
+ 117762, 117767, 117771, 117776, 117781, 117786, 117791, 117796, 117801,
+ 117806, 117811, 117816, 117821, 117826, 117831, 117836, 117841, 117846,
+ 117851, 117856, 117861, 117865, 117869, 117874, 117879, 117884, 117888,
+ 117892, 117896, 117900, 117905, 117910, 117915, 117919, 117923, 117928,
+ 117933, 117939, 117944, 117950, 117955, 117961, 117967, 0, 0, 117974,
+ 117979, 117985, 117990, 117996, 118001, 118006, 118011, 118016, 118021,
+ 118025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 118032, 118037, 118043, 118050, 118056, 118062, 118069,
+ 118075, 118082, 118089, 118097, 118104, 118109, 118115, 118121, 118127,
+ 118133, 118139, 118145, 118151, 118157, 118163, 118169, 118175, 118181,
+ 118187, 118193, 118199, 118205, 118211, 118216, 118221, 118227, 118233,
+ 118239, 118244, 118250, 118256, 118262, 118268, 118274, 118280, 118286,
+ 118291, 118296, 118301, 118307, 118313, 118319, 118324, 118329, 118335,
+ 118341, 118347, 118353, 118362, 118371, 118377, 118383, 118390, 118397,
+ 118404, 118411, 118419, 118426, 118434, 118440, 118446, 118453, 118460,
+ 118469, 118479, 0, 0, 0, 0, 0, 0, 0, 0, 118484, 118488, 118493, 118499,
+ 118504, 118509, 118514, 118520, 118526, 118532, 118538, 118544, 118550,
+ 118554, 118559, 118564, 118569, 118574, 118579, 118584, 118589, 118594,
+ 118599, 118604, 118609, 118614, 118619, 118624, 118629, 118634, 118639,
+ 118644, 118648, 118652, 118657, 118662, 118667, 118671, 118676, 118681,
+ 118686, 118691, 118696, 118701, 118705, 118709, 118713, 118718, 118723,
+ 118728, 118732, 118736, 118741, 118746, 118751, 118757, 118763, 118770,
+ 118776, 118783, 118790, 118797, 118804, 118811, 118818, 118825, 118831,
+ 118837, 118844, 118851, 118858, 118863, 118868, 118873, 118877, 118882,
+ 118887, 118893, 118898, 118914, 118928, 118939, 118945, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 118951, 118957, 118963, 118969, 118975, 118980,
+ 118986, 118992, 118998, 119004, 119010, 119016, 119022, 119026, 119030,
+ 119034, 119038, 119046, 119054, 119062, 119070, 119079, 119088, 119097,
+ 119106, 119114, 119123, 119132, 119140, 119149, 119158, 119167, 119176,
+ 119184, 119193, 119201, 119210, 119219, 119227, 119235, 119243, 119251,
+ 119259, 119268, 119277, 119287, 119297, 119307, 119317, 119327, 119336,
+ 119346, 119356, 119366, 119377, 119387, 119399, 119411, 119422, 119436,
+ 119447, 119457, 119469, 119480, 119490, 119502, 119514, 119525, 119536,
+ 119546, 119556, 119568, 119579, 0, 0, 0, 0, 0, 0, 0, 119591, 119595,
+ 119602, 119606, 119612, 119618, 119626, 119634, 119642, 119650, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119654, 119658,
+ 119663, 119667, 119672, 119676, 119681, 119686, 119692, 0, 119697,
+ 119701, 119706, 119710, 119715, 119719, 119724, 119729, 119734, 119739,
+ 119744, 119749, 119754, 119759, 119764, 119769, 119774, 119779, 119784,
+ 119789, 119794, 119799, 119804, 119809, 119813, 119817, 119822, 119827,
+ 119832, 119836, 119840, 119844, 119848, 119853, 119858, 119863, 119867,
+ 119871, 119877, 119882, 119888, 119893, 119899, 119905, 119912, 0,
+ 119918, 119923, 119929, 119934, 119940, 119945, 119950, 119955, 119960,
+ 119965, 119969, 119974, 119980, 119986, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 119992, 119997, 120001, 120005, 120009, 120013, 120017, 120021, 120025,
+ 120029, 120033, 120037, 120041, 120045, 120049, 120053, 120057, 120061,
+ 120065, 120069, 120074, 120079, 120084, 120089, 120094, 120099, 120104,
+ 120109, 120114, 0, 0, 0, 120121, 120126, 120131, 120135, 120140, 120145,
+ 120150, 120155, 120160, 120165, 120170, 120175, 120180, 120185, 120189,
+ 120193, 120198, 120203, 120207, 120212, 120217, 120222, 120227, 120232,
+ 120237, 120242, 120246, 120250, 120254, 120259, 120263, 120267, 0, 0,
+ 120271, 120277, 120284, 120291, 120298, 120305, 120312, 120319, 120326,
+ 120333, 120340, 120347, 120353, 120359, 120366, 120373, 120379, 120386,
+ 120393, 120400, 120407, 120414, 0, 120421, 120427, 120433, 120439,
+ 120446, 120452, 120458, 120464, 120470, 120475, 120480, 120485, 120490,
+ 120495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 120500, 120505, 120511, 120516, 120522, 120527, 120533, 0,
+ 120538, 120544, 0, 120549, 120555, 120560, 120566, 120572, 120578,
+ 120584, 120590, 120596, 120602, 120608, 120614, 120620, 120626, 120632,
+ 120638, 120644, 120650, 120656, 120662, 120668, 120673, 120678, 120684,
+ 120690, 120696, 120701, 120706, 120711, 120716, 120722, 120728, 120734,
+ 120739, 120744, 120750, 120756, 120762, 120768, 120775, 120781, 120788,
+ 120794, 120801, 0, 0, 0, 120808, 0, 120814, 120821, 0, 120827, 120834,
+ 120840, 120846, 120852, 120858, 120864, 120869, 120874, 0, 0, 0, 0, 0, 0,
+ 0, 0, 120879, 120885, 120890, 120895, 120900, 120905, 120910, 120915,
+ 120920, 120925, 0, 0, 0, 0, 0, 0, 120930, 120935, 120941, 120946, 120952,
+ 120957, 0, 120963, 120969, 0, 120975, 120981, 120987, 120992, 120998,
+ 121004, 121010, 121015, 121020, 121026, 121032, 121038, 121043, 121049,
+ 121055, 121061, 121067, 121072, 121078, 121084, 121090, 121096, 121102,
+ 121108, 121114, 121120, 121126, 121132, 121137, 121143, 121148, 121153,
+ 121158, 121165, 121171, 121178, 121184, 0, 121191, 121198, 0, 121205,
+ 121212, 121219, 121225, 121231, 121236, 0, 0, 0, 0, 0, 0, 0, 121241,
+ 121247, 121252, 121257, 121262, 121267, 121272, 121277, 121282, 121287,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121292, 121296, 121301, 121306,
+ 121310, 121315, 121319, 121324, 121329, 121333, 121338, 121343, 121348,
+ 121352, 121356, 121360, 121365, 121369, 121373, 121377, 121382, 121387,
+ 121392, 121397, 121401, 0, 0, 0, 0, 0, 0, 0, 121408, 121413, 121418,
+ 121423, 121428, 121432, 121437, 121441, 121446, 121450, 121455, 121460,
+ 121466, 121471, 121477, 121481, 121486, 0, 121490, 121494, 121499,
+ 121504, 121509, 121514, 121519, 121524, 121529, 121534, 121539, 121544,
+ 121549, 121554, 121559, 121564, 121569, 121574, 121579, 121584, 121588,
+ 121592, 121597, 121602, 121607, 121611, 121615, 121619, 121623, 121628,
+ 121633, 121638, 121642, 121646, 121651, 121657, 121665, 121670, 121676,
+ 121681, 121687, 0, 0, 0, 121693, 121698, 121704, 121710, 121715, 121719,
+ 121723, 121728, 121736, 121746, 121752, 121760, 121766, 121773, 121781,
+ 121787, 121795, 121801, 121809, 121814, 121818, 121822, 121826, 121830,
+ 121834, 121838, 121842, 121846, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 121850, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121855, 121861,
+ 121867, 121873, 121879, 121885, 121891, 121897, 121903, 121909, 121915,
+ 121921, 121927, 121933, 121939, 121945, 121951, 121957, 121963, 121969,
+ 121975, 121984, 121988, 121992, 121996, 122000, 122004, 122008, 122012,
+ 122016, 122020, 122024, 122028, 122032, 122036, 122040, 122044, 122050,
+ 122056, 122060, 122066, 122072, 122077, 122081, 122086, 122090, 122094,
+ 122100, 122106, 122110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122114,
+ 122122, 122125, 122130, 122136, 122144, 122149, 122155, 122163, 122169,
+ 122175, 122179, 122183, 122190, 122199, 122206, 122215, 122221, 122230,
+ 122237, 122244, 122251, 122261, 122267, 122271, 122278, 122287, 122297,
+ 122304, 122311, 122315, 122319, 122326, 122336, 122340, 122347, 122354,
+ 122361, 122367, 122374, 122381, 122388, 122395, 122399, 122403, 122407,
+ 122414, 122418, 122425, 122432, 122446, 122455, 122459, 122463, 122467,
+ 122474, 122478, 122482, 122486, 122494, 122502, 122521, 122531, 122551,
+ 122555, 122559, 122563, 122567, 122571, 122575, 122579, 122586, 122590,
+ 122593, 122597, 122601, 122607, 122614, 122623, 122627, 122636, 122645,
+ 122653, 122657, 122664, 122668, 122672, 122676, 122680, 122691, 122700,
+ 122709, 122718, 122727, 122739, 122748, 122757, 122766, 122774, 122783,
+ 122795, 122804, 122812, 122821, 122833, 122842, 122851, 122863, 122872,
+ 122881, 122893, 122902, 122906, 122910, 122914, 122918, 122922, 122926,
+ 122930, 122937, 122941, 122945, 122956, 122960, 122964, 122971, 122977,
+ 122983, 122987, 122994, 122998, 123002, 123006, 123010, 123014, 123018,
+ 123024, 123032, 123036, 123040, 123043, 123050, 123062, 123066, 123078,
+ 123085, 123092, 123099, 123106, 123112, 123116, 123120, 123124, 123128,
+ 123135, 123144, 123151, 123159, 123167, 123173, 123177, 123181, 123185,
+ 123189, 123195, 123204, 123216, 123223, 123230, 123239, 123250, 123256,
+ 123265, 123274, 123281, 123290, 123297, 123303, 123313, 123320, 123327,
+ 123334, 123341, 123345, 123351, 123355, 123366, 123374, 123383, 123395,
+ 123402, 123409, 123419, 123426, 123435, 123442, 123451, 123458, 123465,
+ 123475, 123482, 123489, 123498, 123505, 123517, 123526, 123533, 123540,
+ 123547, 123556, 123566, 123579, 123586, 123595, 123605, 123612, 123621,
+ 123634, 123641, 123648, 123655, 123665, 123675, 123681, 123691, 123698,
+ 123705, 123715, 123721, 123728, 123735, 123742, 123752, 123759, 123766,
+ 123773, 123779, 123786, 123796, 123803, 123807, 123815, 123819, 123831,
+ 123835, 123849, 123853, 123857, 123861, 123865, 123871, 123878, 123886,
+ 123890, 123894, 123898, 123902, 123909, 123913, 123919, 123925, 123933,
+ 123937, 123944, 123952, 123956, 123960, 123966, 123970, 123979, 123988,
+ 123995, 124005, 124011, 124015, 124019, 124027, 124034, 124041, 124047,
+ 124051, 124059, 124063, 124070, 124082, 124089, 124099, 124105, 124109,
+ 124118, 124125, 124134, 124138, 124142, 124149, 124153, 124157, 124161,
+ 124165, 124168, 124174, 124180, 124184, 124188, 124195, 124202, 124209,
+ 124216, 124223, 124230, 124237, 124244, 124250, 124254, 124258, 124265,
+ 124272, 124279, 124286, 124293, 124297, 124300, 124305, 124309, 124313,
+ 124322, 124331, 124335, 124339, 124345, 124351, 124368, 124374, 124378,
+ 124387, 124391, 124395, 124402, 124410, 124418, 124424, 124428, 124432,
+ 124436, 124440, 124443, 124449, 124456, 124466, 124473, 124480, 124487,
+ 124493, 124500, 124507, 124514, 124521, 124528, 124537, 124544, 124556,
+ 124563, 124570, 124580, 124591, 124598, 124605, 124612, 124619, 124626,
+ 124633, 124640, 124647, 124654, 124661, 124671, 124681, 124691, 124698,
+ 124708, 124715, 124722, 124729, 124736, 124742, 124749, 124756, 124763,
+ 124770, 124777, 124784, 124791, 124798, 124804, 124811, 124818, 124827,
+ 124834, 124841, 124845, 124853, 124857, 124861, 124865, 124869, 124873,
+ 124880, 124884, 124893, 124897, 124904, 124912, 124916, 124920, 124924,
+ 124937, 124953, 124957, 124961, 124968, 124974, 124981, 124985, 124989,
+ 124993, 124997, 125001, 125008, 125012, 125030, 125034, 125038, 125045,
+ 125049, 125053, 125059, 125063, 125067, 125075, 125079, 125083, 125086,
+ 125090, 125096, 125107, 125116, 125125, 125132, 125139, 125150, 125157,
+ 125164, 125171, 125178, 125185, 125192, 125199, 125209, 125215, 125222,
+ 125232, 125241, 125248, 125257, 125267, 125274, 125281, 125288, 125295,
+ 125307, 125314, 125321, 125328, 125335, 125342, 125352, 125359, 125366,
+ 125376, 125389, 125401, 125408, 125418, 125425, 125432, 125439, 125453,
+ 125459, 125467, 125477, 125487, 125494, 125501, 125507, 125511, 125518,
+ 125528, 125534, 125547, 125551, 125555, 125562, 125566, 125573, 125583,
+ 125587, 125591, 125595, 125599, 125603, 125610, 125614, 125621, 125628,
+ 125635, 125644, 125653, 125663, 125670, 125677, 125684, 125694, 125701,
+ 125711, 125718, 125728, 125735, 125742, 125752, 125762, 125769, 125775,
+ 125783, 125791, 125797, 125803, 125807, 125811, 125818, 125826, 125832,
+ 125836, 125840, 125844, 125851, 125863, 125866, 125873, 125879, 125883,
+ 125887, 125891, 125895, 125899, 125903, 125907, 125911, 125915, 125919,
+ 125926, 125930, 125936, 125940, 125944, 125948, 125954, 125961, 125968,
+ 125975, 125986, 125994, 125998, 126004, 126013, 126020, 126026, 126029,
+ 126033, 126037, 126043, 126052, 126060, 126064, 126070, 126074, 126078,
+ 126082, 126088, 126095, 126101, 126105, 126111, 126115, 126119, 126128,
+ 126140, 126144, 126151, 126158, 126168, 126175, 126187, 126194, 126201,
+ 126208, 126219, 126229, 126242, 126252, 126259, 126263, 126267, 126271,
+ 126275, 126284, 126293, 126302, 126319, 126328, 126334, 126341, 126349,
+ 126362, 126366, 126375, 126384, 126393, 126402, 126413, 126422, 126430,
+ 126439, 126448, 126457, 126466, 126476, 126479, 126483, 126487, 126491,
+ 126495, 126499, 126505, 126512, 126519, 126526, 126532, 126538, 126545,
+ 126551, 126558, 126566, 126570, 126577, 126584, 126591, 126599, 126602,
+ 126606, 126610, 126614, 126617, 126623, 126627, 126633, 126640, 126647,
+ 126653, 126660, 126667, 126674, 126681, 126688, 126695, 126702, 126709,
+ 126716, 126723, 126730, 126737, 126744, 126751, 126757, 126761, 126770,
+ 126774, 126778, 126782, 126786, 126792, 126799, 126806, 126813, 126820,
+ 126827, 126833, 126841, 126845, 126849, 126853, 126857, 126863, 126880,
+ 126897, 126901, 126905, 126909, 126913, 126917, 126921, 126927, 126934,
+ 126938, 126944, 126951, 126958, 126965, 126972, 126979, 126988, 126995,
+ 127002, 127009, 127016, 127020, 127024, 127030, 127042, 127046, 127050,
+ 127059, 127063, 127067, 127071, 127077, 127081, 127085, 127094, 127098,
+ 127102, 127106, 127113, 127117, 127121, 127125, 127129, 127133, 127137,
+ 127141, 127145, 127151, 127158, 127165, 127171, 127175, 127192, 127198,
+ 127202, 127209, 127216, 127223, 127230, 127237, 127244, 127248, 127252,
+ 127256, 127262, 127266, 127272, 127276, 127280, 127287, 127294, 127311,
+ 127315, 127319, 127323, 127327, 127331, 127343, 127346, 127351, 127356,
+ 127371, 127381, 127393, 127397, 127401, 127405, 127411, 127418, 127425,
+ 127435, 127447, 127453, 127459, 127468, 127472, 127476, 127483, 127493,
+ 127500, 127506, 127510, 127514, 127521, 127527, 127531, 127537, 127541,
+ 127549, 127555, 127559, 127567, 127575, 127582, 127588, 127595, 127602,
+ 127612, 127622, 127626, 127630, 127634, 127638, 127644, 127651, 127657,
+ 127664, 127671, 127678, 127687, 127694, 127701, 127707, 127714, 127721,
+ 127728, 127735, 127742, 127749, 127755, 127762, 127769, 127776, 127785,
+ 127792, 127799, 127803, 127809, 127813, 127819, 127826, 127833, 127840,
+ 127844, 127848, 127852, 127856, 127860, 127867, 127871, 127875, 127881,
+ 127889, 127893, 127897, 127901, 127905, 127912, 127916, 127920, 127928,
+ 127932, 127936, 127940, 127944, 127950, 127954, 127958, 127964, 127971,
+ 127977, 127984, 127996, 128000, 128007, 128014, 128021, 128028, 128040,
+ 128047, 128051, 128055, 128059, 128066, 128073, 128080, 128087, 128097,
+ 128104, 128110, 128117, 128124, 128131, 128138, 128147, 128157, 128164,
+ 128168, 128175, 128179, 128183, 128187, 128194, 128201, 128211, 128217,
+ 128221, 128230, 128234, 128241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128245, 128251, 128257,
+ 128264, 128271, 128278, 128285, 128292, 128299, 128305, 128312, 128319,
+ 128326, 128333, 128340, 128347, 128353, 128359, 128365, 128371, 128377,
+ 128383, 128389, 128395, 128401, 128408, 128415, 128422, 128429, 128436,
+ 128443, 128449, 128455, 128461, 128468, 128475, 128481, 128487, 128496,
+ 128503, 128510, 128517, 128524, 128531, 128538, 128544, 128550, 128556,
+ 128565, 128572, 128579, 128590, 128601, 128607, 128613, 128619, 128628,
+ 128635, 128642, 128652, 128662, 128673, 128684, 128696, 128709, 128720,
+ 128731, 128743, 128756, 128767, 128778, 128789, 128800, 128811, 128823,
+ 128831, 128839, 128848, 128857, 128866, 128872, 128878, 128884, 128891,
+ 128901, 128908, 128918, 128923, 128928, 128934, 128940, 128948, 128956,
+ 128965, 128976, 128987, 128995, 129003, 129012, 129021, 129029, 129036,
+ 129044, 129052, 129059, 129066, 129075, 129084, 129093, 129102, 129111,
+ 0, 129120, 129131, 129138, 129146, 129154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 129162, 129171, 129178, 129185, 129194, 129201, 129208, 129215,
+ 129225, 129232, 129239, 129246, 129254, 129261, 129268, 129275, 129286,
+ 129293, 129300, 129307, 129314, 129321, 129330, 129337, 129343, 129350,
+ 129359, 129366, 129373, 129380, 129390, 129397, 129404, 129414, 129424,
+ 129431, 129438, 129445, 129452, 129459, 129466, 129475, 129482, 129489,
+ 129495, 129503, 129512, 129521, 129532, 129540, 129549, 129558, 129567,
+ 129576, 129583, 129590, 129599, 129611, 129621, 129628, 129635, 129645,
+ 129655, 129664, 129674, 129681, 129691, 129698, 129705, 129712, 129722,
+ 129732, 129739, 129746, 129756, 129762, 129773, 129782, 129792, 129800,
+ 129813, 129820, 129826, 129834, 129841, 129851, 129855, 129859, 129863,
+ 129867, 129871, 129875, 129879, 129888, 129892, 129899, 129903, 129907,
+ 129911, 129915, 129919, 129923, 129927, 129931, 129935, 129939, 129943,
+ 129947, 129951, 129955, 129959, 129963, 129967, 129971, 129975, 129982,
+ 129989, 129999, 130012, 130022, 130026, 130030, 130034, 130038, 130042,
+ 130046, 130050, 130054, 130058, 130062, 130066, 130073, 130080, 130091,
+ 130098, 130104, 130111, 130118, 130125, 130132, 130139, 130143, 130147,
+ 130154, 130161, 130168, 130177, 130184, 130197, 130207, 130214, 130221,
+ 130225, 130229, 130238, 130245, 130252, 130259, 130272, 130279, 130286,
+ 130296, 130306, 130315, 130322, 130329, 130336, 130343, 130350, 130357,
+ 130367, 130373, 130381, 130388, 130396, 130403, 130414, 130421, 130427,
+ 130434, 130441, 130448, 130455, 130465, 130475, 130482, 130489, 130498,
+ 130506, 130512, 130519, 130526, 130533, 130540, 130544, 130554, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 130564, 130569, 130574, 130579, 130584, 130589, 130594, 130599,
+ 130604, 130609, 130614, 130619, 130624, 130629, 130634, 130639, 130644,
+ 130649, 130654, 130659, 130664, 130669, 130674, 130679, 130684, 130689,
+ 130694, 130699, 130704, 130709, 130714, 130719, 130724, 130729, 130734,
+ 130739, 130744, 130749, 130754, 130759, 130764, 130769, 130774, 130779,
+ 130784, 130789, 130794, 130799, 130804, 130809, 130814, 130819, 130824,
+ 130829, 130834, 130839, 130844, 130849, 130854, 130859, 130864, 130869,
+ 130874, 130879, 130884, 130889, 130894, 130899, 130904, 130909, 130914,
+ 130919, 130924, 130929, 130934, 130939, 130944, 130949, 130954, 130959,
+ 130964, 130969, 130974, 130979, 130984, 130989, 130994, 130999, 131004,
+ 131009, 131014, 131019, 131024, 131029, 131034, 131039, 131044, 131049,
+ 131054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131059, 131063, 131067,
+ 131071, 131075, 131079, 131083, 131087, 131091, 131095, 131099, 131103,
+ 131107, 131111, 131115, 131119, 131123, 131127, 131131, 131135, 131139,
+ 131143, 131147, 131151, 131155, 131159, 131163, 131167, 131171, 131175,
+ 131179, 131183, 131187, 131191, 131195, 131199, 131203, 131207, 131211,
+ 131215, 131219, 131223, 131227, 131231, 131235, 131239, 131243, 131247,
+ 131251, 131255, 131259, 131263, 131267, 131271, 131275, 131279, 131283,
+ 131287, 131291, 131295, 131299, 131303, 131307, 131311, 131315, 131319,
+ 131323, 131327, 131331, 131335, 131339, 131343, 131347, 131351, 131355,
+ 131359, 131363, 131367, 131371, 131375, 131379, 131383, 131387, 131391,
+ 131395, 131399, 131403, 131407, 131411, 131415, 131419, 131423, 131427,
+ 131431, 131435, 131439, 131443, 131447, 131451, 131455, 131459, 131463,
+ 131467, 131471, 131475, 131479, 131483, 131487, 131491, 131495, 131499,
+ 131503, 131507, 131511, 131515, 131519, 131523, 131527, 131531, 131535,
+ 131539, 131543, 131547, 131551, 131555, 131559, 131563, 131567, 131571,
+ 131575, 131579, 131583, 131587, 131591, 131595, 131599, 131603, 131607,
+ 131611, 131615, 131619, 131623, 131627, 131631, 131635, 131639, 131643,
+ 131647, 131651, 131655, 131659, 131663, 131667, 131671, 131675, 131679,
+ 131683, 131687, 131691, 131695, 131699, 131703, 131707, 131711, 131715,
+ 131719, 131723, 131727, 131731, 131735, 131739, 131743, 131747, 131751,
+ 131755, 131759, 131763, 131767, 131771, 131775, 131779, 131783, 131787,
+ 131791, 131795, 131799, 131803, 131807, 131811, 131815, 131819, 131823,
+ 131827, 131831, 131835, 131839, 131843, 131847, 131851, 131855, 131859,
+ 131863, 131867, 131871, 131875, 131879, 131883, 131887, 131891, 131895,
+ 131899, 131903, 131907, 131911, 131915, 131919, 131923, 131927, 131931,
+ 131935, 131939, 131943, 131947, 131951, 131955, 131959, 131963, 131967,
+ 131971, 131975, 131979, 131983, 131987, 131991, 131995, 131999, 132003,
+ 132007, 132011, 132015, 132019, 132023, 132027, 132031, 132035, 132039,
+ 132043, 132047, 132051, 132055, 132059, 132063, 132067, 132071, 132075,
+ 132079, 132083, 132087, 132091, 132095, 132099, 132103, 132107, 132111,
+ 132115, 132119, 132123, 132127, 132131, 132135, 132139, 132143, 132147,
+ 132151, 132155, 132159, 132163, 132167, 132171, 132175, 132179, 132183,
+ 132187, 132191, 132195, 132199, 132203, 132207, 132211, 132215, 132219,
+ 132223, 132227, 132231, 132235, 132239, 132243, 132247, 132251, 132255,
+ 132259, 132263, 132267, 132271, 132275, 132279, 132283, 132287, 132291,
+ 132295, 132299, 132303, 132307, 132311, 132315, 132319, 132323, 132327,
+ 132331, 132335, 132339, 132343, 132347, 132351, 132355, 132359, 132363,
+ 132367, 132371, 132375, 132379, 132383, 132387, 132391, 132395, 132399,
+ 132403, 132407, 132411, 132415, 132419, 132423, 132427, 132431, 132435,
+ 132439, 132443, 132447, 132451, 132455, 132459, 132463, 132467, 132471,
+ 132475, 132479, 132483, 132487, 132491, 132495, 132499, 132503, 132507,
+ 132511, 132515, 132519, 132523, 132527, 132531, 132535, 132539, 132543,
+ 132547, 132551, 132555, 132559, 132563, 132567, 132571, 132575, 132579,
+ 132583, 132587, 132591, 132595, 132599, 132603, 132607, 132611, 132615,
+ 132619, 132623, 132627, 132631, 132635, 132639, 132643, 132647, 132651,
+ 132655, 132659, 132663, 132667, 132671, 132675, 132679, 132683, 132687,
+ 132691, 132695, 132699, 132703, 132707, 132711, 132715, 132719, 132723,
+ 132727, 132731, 132735, 132739, 132743, 132747, 132751, 132755, 132759,
+ 132763, 132767, 132771, 132775, 132779, 132783, 132787, 132791, 132795,
+ 132799, 132803, 132807, 132811, 132815, 132819, 132823, 132827, 132831,
+ 132835, 132839, 132843, 132847, 132851, 132855, 132859, 132863, 132867,
+ 132871, 132875, 132879, 132883, 132887, 132891, 132895, 132899, 132903,
+ 132907, 132911, 132915, 132919, 132923, 132927, 132931, 132935, 132939,
+ 132943, 132947, 132951, 132955, 132959, 132963, 132967, 132971, 132975,
+ 132979, 132983, 132987, 132991, 132995, 132999, 133003, 133007, 133011,
+ 133015, 133019, 133023, 133027, 133031, 133035, 133039, 133043, 133047,
+ 133051, 133055, 133059, 133063, 133067, 133071, 133075, 133079, 133083,
+ 133087, 133091, 133095, 133099, 133103, 133107, 133111, 133115, 133119,
+ 133123, 133127, 133131, 133135, 133139, 133143, 133147, 133151, 133155,
+ 133159, 133163, 133167, 133171, 133175, 133179, 133183, 133187, 133191,
+ 133195, 133199, 133203, 133207, 133211, 133215, 133219, 133223, 133227,
+ 133231, 133235, 133239, 133243, 133247, 133251, 133255, 133259, 133263,
+ 133267, 133271, 133275, 133279, 133283, 133287, 133291, 133295, 133299,
+ 133303, 133307, 133311, 133315, 133319, 133323, 133327, 133331, 133335,
+ 133339, 133343, 133347, 133351, 133355, 133359, 133363, 133367, 133371,
+ 133375, 133379, 133383, 133387, 133391, 133395, 133399, 133403, 133407,
+ 133411, 133415, 133419, 133423, 133427, 133431, 133435, 133439, 133443,
+ 133447, 133451, 133455, 133459, 133463, 133467, 133471, 133475, 133479,
+ 133483, 133487, 133491, 133495, 133499, 133503, 133507, 133511, 133515,
+ 133519, 133523, 133527, 133531, 133535, 133539, 133543, 133547, 133551,
+ 133555, 133559, 133563, 133567, 133571, 133575, 133579, 133583, 133587,
+ 133591, 133595, 133599, 133603, 133607, 133611, 133615, 133619, 133623,
+ 133627, 133631, 133635, 133639, 133643, 133647, 133651, 133655, 133659,
+ 133663, 133667, 133671, 133675, 133679, 133683, 133687, 133691, 133695,
+ 133699, 133703, 133707, 133711, 133715, 133719, 133723, 133727, 133731,
+ 133735, 133739, 133743, 133747, 133751, 133755, 133759, 133763, 133767,
+ 133771, 133775, 133779, 133783, 133787, 133791, 133795, 133799, 133803,
+ 133807, 133811, 133815, 133819, 133823, 133827, 133831, 133835, 133839,
+ 133843, 133847, 133851, 133855, 133859, 133863, 133867, 133871, 133875,
+ 133879, 133883, 133887, 133891, 133895, 133899, 133903, 133907, 133911,
+ 133915, 133919, 133923, 133927, 133931, 133935, 133939, 133943, 133947,
+ 133951, 133955, 133959, 133963, 133967, 133971, 133975, 133979, 133983,
+ 133987, 133991, 133995, 133999, 134003, 134007, 134011, 134015, 134019,
+ 134023, 134027, 134031, 134035, 134039, 134043, 134047, 134051, 134055,
+ 134059, 134063, 134067, 134071, 134075, 134079, 134083, 134087, 134091,
+ 134095, 134099, 134103, 134107, 134111, 134115, 134119, 134123, 134127,
+ 134131, 134135, 134139, 134143, 134147, 134151, 134155, 134159, 134163,
+ 134167, 134171, 134175, 134179, 134183, 134187, 134191, 134195, 134199,
+ 134203, 134207, 134211, 134215, 134219, 134223, 134227, 134231, 134235,
+ 134239, 134243, 134247, 134251, 134255, 134259, 134263, 134267, 134271,
+ 134275, 134279, 134283, 134287, 134291, 134295, 134299, 134303, 134307,
+ 134311, 134315, 134319, 134323, 134327, 134331, 134335, 134339, 134343,
+ 134347, 134351, 134355, 134359, 134363, 134367, 134371, 134375, 134379,
+ 134383, 134387, 134391, 134395, 134399, 134403, 134407, 134411, 134415,
+ 134419, 134423, 134427, 134431, 134435, 134439, 134443, 134447, 134451,
+ 134455, 134459, 134463, 134467, 134471, 134475, 134479, 134483, 134487,
+ 134491, 134495, 134499, 134503, 134507, 134511, 134515, 134519, 134523,
+ 134527, 134531, 134535, 134539, 134543, 134547, 134551, 134555, 134559,
+ 134563, 134567, 134571, 134575, 134579, 134583, 134587, 134591, 134595,
+ 134599, 134603, 134607, 134611, 134615, 134619, 134623, 134627, 134631,
+ 134635, 134639, 134643, 134647, 134651, 134655, 134659, 134663, 134667,
+ 134671, 134675, 134679, 134683, 134687, 134691, 134695, 134699, 134703,
+ 134707, 134711, 134715, 134719, 134723, 134727, 134731, 134735, 134739,
+ 134743, 134747, 134751, 134755, 134759, 134763, 134767, 134771, 134775,
+ 134779, 134783, 134787, 134791, 134795, 134799, 134803, 134807, 134811,
+ 134815, 134819, 134823, 134827, 134831, 134835, 134839, 134843, 134847,
+ 134851, 134855, 134859, 134863, 134867, 134871, 134875, 134879, 134883,
+ 134887, 134891, 134895, 134899, 134903, 134907, 134911, 134915, 134919,
+ 134923, 134927, 134931, 134935, 134939, 134943, 134947, 134951, 134955,
+ 134959, 134963, 134967, 134971, 134975, 134979, 134983, 134987, 134991,
+ 134995, 134999, 135003, 135007, 135011, 135015, 135019, 135023, 135027,
+ 135031, 135035, 135039, 135043, 135047, 135051, 135055, 135059, 135063,
+ 135067, 135071, 135075, 135079, 135083, 135087, 135091, 135095, 135099,
+ 135103, 135107, 135111, 135115, 135119, 135123, 135127, 135131, 135135,
+ 135139, 135143, 135147, 135151, 135155, 135159, 135163, 135167, 135171,
+ 135175, 135179, 135183, 135187, 135191, 135195, 135199, 135203, 135207,
+ 135211, 135215, 135219, 135223, 135227, 135231, 135235, 135239, 135243,
+ 135247, 135251, 135255, 135259, 135263, 135267, 135271, 135275, 135279,
+ 135283, 135287, 135291, 135295, 135299, 135303, 135307, 135311, 135315,
+ 135319, 135323, 135327, 135331, 135335, 135339, 135343, 135347, 135352,
+ 135358, 135368, 135378, 135388, 135398, 135404, 135410, 135416, 135424,
+ 135432, 135440, 135446, 135452, 135460, 135468, 135474, 135480, 135485,
+ 135490, 135496, 135503, 135510, 135521, 135532, 135541, 135552, 135561,
+ 135577, 135589, 135600, 135616, 135625, 135637, 135646, 135658, 135670,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 135675, 135679,
+ 135683, 135687, 135691, 135695, 135699, 135703, 135707, 135711, 135715,
+ 135719, 135723, 135727, 135731, 135735, 135739, 135743, 135747, 135751,
+ 135755, 135759, 135763, 135767, 135771, 135775, 135779, 135783, 135787,
+ 135791, 135795, 135799, 135803, 135807, 135811, 135815, 135819, 135823,
+ 135827, 135831, 135835, 135839, 135843, 135847, 135851, 135855, 135859,
+ 135863, 135867, 135871, 135875, 135879, 135883, 135887, 135891, 135895,
+ 135899, 135903, 135907, 135911, 135915, 135919, 135923, 135927, 135931,
+ 135935, 135939, 135943, 135947, 135951, 135955, 135959, 135963, 135967,
+ 135971, 135975, 135979, 135983, 135987, 135991, 135995, 135999, 136003,
+ 136007, 136011, 136015, 136019, 136023, 136027, 136031, 136035, 136039,
+ 136043, 136047, 136051, 136055, 136059, 136063, 136067, 136071, 136075,
+ 136079, 136083, 136087, 136091, 136095, 136099, 136103, 136107, 136111,
+ 136115, 136119, 136123, 136127, 136131, 136135, 136139, 136143, 136147,
+ 136151, 136155, 136159, 136163, 136167, 136171, 136175, 136179, 136183,
+ 136187, 136191, 136195, 136199, 136203, 136207, 136211, 136215, 136219,
+ 136223, 136227, 136231, 136235, 136239, 136243, 136247, 136251, 136255,
+ 136259, 136263, 136267, 136271, 136275, 136279, 136283, 136287, 136291,
+ 136295, 136299, 136303, 136307, 136311, 136315, 136319, 136323, 136327,
+ 136331, 136335, 136339, 136343, 136347, 136351, 136355, 136359, 136363,
+ 136367, 136371, 136375, 136379, 136383, 136387, 136391, 136395, 136399,
+ 136403, 136407, 136411, 136415, 136419, 136423, 136427, 136431, 136435,
+ 136439, 136443, 136447, 136451, 136455, 136459, 136463, 136467, 136471,
+ 136475, 136479, 136483, 136487, 136491, 136495, 136499, 136503, 136507,
+ 136511, 136515, 136519, 136523, 136527, 136531, 136535, 136539, 136543,
+ 136547, 136551, 136555, 136559, 136563, 136567, 136571, 136575, 136579,
+ 136583, 136587, 136591, 136595, 136599, 136603, 136607, 136611, 136615,
+ 136619, 136623, 136627, 136631, 136635, 136639, 136643, 136647, 136651,
+ 136655, 136659, 136663, 136667, 136671, 136675, 136679, 136683, 136687,
+ 136691, 136695, 136699, 136703, 136707, 136711, 136715, 136719, 136723,
+ 136727, 136731, 136735, 136739, 136743, 136747, 136751, 136755, 136759,
+ 136763, 136767, 136771, 136775, 136779, 136783, 136787, 136791, 136795,
+ 136799, 136803, 136807, 136811, 136815, 136819, 136823, 136827, 136831,
+ 136835, 136839, 136843, 136847, 136851, 136855, 136859, 136863, 136867,
+ 136871, 136875, 136879, 136883, 136887, 136891, 136895, 136899, 136903,
+ 136907, 136911, 136915, 136919, 136923, 136927, 136931, 136935, 136939,
+ 136943, 136947, 136951, 136955, 136959, 136963, 136967, 136971, 136975,
+ 136979, 136983, 136987, 136991, 136995, 136999, 137003, 137007, 137011,
+ 137015, 137019, 137023, 137027, 137031, 137035, 137039, 137043, 137047,
+ 137051, 137055, 137059, 137063, 137067, 137071, 137075, 137079, 137083,
+ 137087, 137091, 137095, 137099, 137103, 137107, 137111, 137115, 137119,
+ 137123, 137127, 137131, 137135, 137139, 137143, 137147, 137151, 137155,
+ 137159, 137163, 137167, 137171, 137175, 137179, 137183, 137187, 137191,
+ 137195, 137199, 137203, 137207, 137211, 137215, 137219, 137223, 137227,
+ 137231, 137235, 137239, 137243, 137247, 137251, 137255, 137259, 137263,
+ 137267, 137271, 137275, 137279, 137283, 137287, 137291, 137295, 137299,
+ 137303, 137307, 137311, 137315, 137319, 137323, 137327, 137331, 137335,
+ 137339, 137343, 137347, 137351, 137355, 137359, 137363, 137367, 137371,
+ 137375, 137379, 137383, 137387, 137391, 137395, 137399, 137403, 137407,
+ 137417, 137421, 137425, 137429, 137433, 137437, 137441, 137445, 137449,
+ 137453, 137457, 137461, 137466, 137470, 137474, 137478, 137482, 137486,
+ 137490, 137494, 137498, 137502, 137506, 137510, 137514, 137518, 137522,
+ 137526, 137530, 137539, 137548, 137552, 137556, 137560, 137564, 137568,
+ 137572, 137576, 137580, 137584, 137588, 137592, 137596, 137600, 137604,
+ 137608, 137612, 137616, 137620, 137624, 137628, 137632, 137636, 137640,
+ 137644, 137648, 137652, 137656, 137660, 137664, 137668, 137672, 137676,
+ 137680, 137684, 137688, 137692, 137696, 137700, 137704, 137708, 137712,
+ 137716, 137720, 137724, 137728, 137732, 137736, 137740, 137744, 137748,
+ 137752, 137756, 137760, 137764, 137768, 137772, 137776, 137780, 137784,
+ 137788, 137792, 137796, 137800, 137804, 137808, 137812, 137816, 137820,
+ 137824, 137828, 137832, 137836, 137840, 137844, 137848, 137852, 137856,
+ 137860, 137864, 137868, 137872, 137876, 137880, 137884, 137888, 137892,
+ 137896, 137900, 137904, 137908, 137912, 137916, 137920, 137924, 137928,
+ 137932, 137936, 137940, 137944, 137948, 137952, 137956, 137960, 137964,
+ 137968, 137972, 137976, 137980, 137984, 137988, 137992, 137996, 138000,
+ 138004, 138008, 138012, 138016, 138020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138024,
+ 138032, 138040, 138050, 138060, 138068, 138074, 138082, 138090, 138100,
+ 138112, 138124, 138130, 138138, 138144, 138150, 138156, 138162, 138168,
+ 138174, 138180, 138186, 138192, 138198, 138204, 138212, 138220, 138226,
+ 138232, 138238, 138244, 138252, 138260, 138269, 138275, 138283, 138289,
+ 138295, 138301, 138307, 138313, 138321, 138329, 138335, 138341, 138347,
+ 138353, 138359, 138365, 138371, 138377, 138383, 138389, 138395, 138401,
+ 138407, 138413, 138419, 138425, 138431, 138437, 138443, 138451, 138457,
+ 138463, 138473, 138481, 138487, 138493, 138499, 138505, 138511, 138517,
+ 138523, 138529, 138535, 138541, 138547, 138553, 138559, 138565, 138571,
+ 138577, 138583, 138589, 138595, 138601, 138607, 138613, 138621, 138627,
+ 138635, 138643, 138651, 138657, 138663, 138669, 138675, 138681, 138689,
+ 138699, 138707, 138715, 138721, 138727, 138735, 138743, 138749, 138757,
+ 138765, 138773, 138779, 138785, 138791, 138797, 138803, 138809, 138817,
+ 138825, 138831, 138837, 138843, 138849, 138855, 138863, 138869, 138875,
+ 138881, 138887, 138893, 138899, 138907, 138913, 138919, 138925, 138931,
+ 138939, 138947, 138953, 138959, 138965, 138970, 138976, 138982, 138990,
+ 138996, 139002, 139008, 139014, 139020, 139026, 139032, 139038, 139044,
+ 139054, 139062, 139068, 139074, 139080, 139088, 139094, 139100, 139106,
+ 139114, 139120, 139126, 139132, 139138, 139144, 139150, 139156, 139162,
+ 139168, 139174, 139180, 139188, 139194, 139202, 139208, 139214, 139222,
+ 139228, 139234, 139240, 139246, 139252, 139258, 139264, 139270, 139276,
+ 139282, 139288, 139294, 139300, 139306, 139312, 139318, 139324, 139330,
+ 139336, 139344, 139350, 139356, 139362, 139368, 139374, 139380, 139386,
+ 139392, 139398, 139404, 139410, 139416, 139422, 139430, 139436, 139442,
+ 139450, 139456, 139462, 139468, 139474, 139480, 139486, 139492, 139498,
+ 139504, 139510, 139518, 139524, 139530, 139536, 139542, 139548, 139556,
+ 139564, 139570, 139576, 139582, 139588, 139594, 139600, 139605, 139610,
+ 139615, 139620, 139625, 139630, 139635, 139640, 139645, 139650, 139655,
+ 139660, 139665, 139670, 139675, 139680, 139685, 139690, 139695, 139700,
+ 139705, 139710, 139715, 139720, 139725, 139730, 139735, 139740, 139745,
+ 139750, 139757, 139762, 139767, 139772, 139777, 139782, 139787, 139792,
+ 139797, 139802, 139807, 139812, 139817, 139822, 139827, 139832, 139837,
+ 139842, 139847, 139852, 139857, 139862, 139867, 139872, 139877, 139882,
+ 139887, 139892, 139897, 139902, 139907, 139912, 139917, 139922, 139927,
+ 139932, 139937, 139942, 139947, 139952, 139957, 139962, 139967, 139972,
+ 139977, 139982, 139987, 139992, 139997, 140002, 140007, 140012, 140017,
+ 140022, 140027, 140032, 140037, 140042, 140047, 140054, 140059, 140064,
+ 140069, 140074, 140079, 140084, 140089, 140094, 140099, 140104, 140109,
+ 140114, 140119, 140124, 140129, 140134, 140139, 140144, 140149, 140154,
+ 140159, 140166, 140171, 140176, 140182, 140187, 140192, 140197, 140202,
+ 140207, 140212, 140217, 140222, 140227, 140232, 140237, 140242, 140247,
+ 140252, 140257, 140262, 140267, 140272, 140277, 140282, 140287, 140292,
+ 140297, 140302, 140307, 140312, 140317, 140322, 140327, 140332, 140337,
+ 140342, 140347, 140352, 140357, 140362, 140367, 140372, 140377, 140382,
+ 140387, 140392, 140397, 140404, 140409, 140414, 140421, 140428, 140433,
+ 140438, 140443, 140448, 140453, 140458, 140463, 140468, 140473, 140478,
+ 140483, 140488, 140493, 140498, 140503, 140508, 140513, 140518, 140523,
+ 140528, 140533, 140538, 140543, 140548, 140553, 140560, 140565, 140570,
+ 140575, 140580, 140585, 140590, 140595, 140600, 140605, 140610, 140615,
+ 140620, 140625, 140630, 140635, 140640, 140645, 140650, 140657, 140662,
+ 140667, 140672, 140677, 140682, 140687, 140692, 140698, 140703, 140708,
+ 140713, 140718, 140723, 140728, 140733, 140738, 140745, 140752, 140757,
+ 140762, 140766, 140771, 140775, 140779, 140784, 140791, 140796, 140801,
+ 140810, 140815, 140820, 140825, 140830, 140837, 140844, 140849, 140854,
+ 140859, 140864, 140871, 140876, 140881, 140886, 140891, 140896, 140901,
+ 140906, 140911, 140916, 140921, 140926, 140931, 140938, 140942, 140947,
+ 140952, 140957, 140962, 140966, 140971, 140976, 140981, 140986, 140991,
+ 140996, 141001, 141006, 141011, 141017, 141023, 141029, 141035, 141041,
+ 141046, 141052, 141058, 141064, 141070, 141076, 141082, 141088, 141094,
+ 141100, 141106, 141112, 141118, 141124, 141130, 141136, 141142, 141148,
+ 141154, 141159, 141165, 141171, 141177, 141183, 141189, 141195, 141201,
+ 141207, 141213, 141219, 141225, 141231, 141237, 141243, 141249, 141255,
+ 141261, 141267, 141273, 141279, 141284, 141290, 141296, 141302, 141308,
+ 141314, 0, 0, 0, 0, 0, 0, 0, 141320, 141325, 141330, 141335, 141340,
+ 141345, 141350, 141354, 141359, 141364, 141369, 141374, 141379, 141384,
+ 141389, 141394, 141399, 141403, 141408, 141412, 141417, 141422, 141427,
+ 141432, 141437, 141441, 141446, 141451, 141455, 141460, 141465, 0,
+ 141470, 141475, 141479, 141483, 141487, 141491, 141495, 141499, 141503,
+ 141507, 0, 0, 0, 0, 141511, 141515, 141520, 141525, 141530, 141535,
+ 141540, 141545, 141550, 141555, 141560, 141565, 141570, 141575, 141580,
+ 141585, 141590, 141595, 141600, 141605, 141610, 141615, 141620, 141625,
+ 141630, 141635, 141640, 141645, 141650, 141655, 141660, 141665, 141670,
+ 141675, 141680, 141686, 141692, 141699, 141706, 141711, 141716, 141721,
+ 141726, 141731, 141736, 141741, 141746, 141751, 141756, 141761, 141766,
+ 141770, 141775, 141780, 141785, 141789, 141793, 141798, 141802, 141807,
+ 141812, 141817, 141821, 141825, 141829, 141833, 141838, 141843, 141848,
+ 141852, 141857, 141862, 141867, 141872, 141877, 141882, 141887, 141892,
+ 141897, 141902, 141907, 0, 141912, 141917, 141921, 141925, 141929,
+ 141933, 141937, 141941, 141945, 141949, 0, 0, 0, 0, 0, 0, 141953, 141960,
+ 141966, 141973, 141980, 141987, 141994, 142001, 142008, 142015, 142022,
+ 142029, 142036, 142043, 142050, 142057, 142064, 142071, 142077, 142084,
+ 142091, 142098, 142104, 142111, 142117, 142123, 142130, 142136, 142143,
+ 142149, 0, 0, 142155, 142163, 142171, 142180, 142189, 142198, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 142206, 142211, 142216, 142221, 142226, 142231, 142236,
+ 142241, 142246, 142251, 142256, 142261, 142266, 142271, 142276, 142281,
+ 142286, 142291, 142296, 142301, 142306, 142311, 142316, 142321, 142326,
+ 142331, 142336, 142341, 142346, 142351, 142356, 142361, 142366, 142371,
+ 142376, 142381, 142386, 142391, 142396, 142401, 142406, 142411, 142416,
+ 142421, 142426, 142431, 142436, 142441, 142446, 142453, 142460, 142467,
+ 142474, 142481, 142488, 142495, 142502, 142511, 142518, 142525, 142532,
+ 142539, 142546, 142553, 142560, 142567, 142574, 142581, 142588, 142593,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142602, 142607, 142611, 142615, 142619,
+ 142623, 142627, 142631, 142635, 142639, 0, 142643, 142648, 142653,
+ 142660, 142665, 142672, 142679, 0, 142684, 142691, 142696, 142701,
+ 142708, 142715, 142720, 142725, 142730, 142735, 142740, 142747, 142754,
+ 142759, 142764, 142769, 142782, 142791, 142798, 142807, 142816, 0, 0, 0,
+ 0, 0, 142825, 142832, 142839, 142846, 142853, 142860, 142867, 142874,
+ 142881, 142888, 142895, 142902, 142909, 142916, 142923, 142930, 142937,
+ 142944, 142951, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142958, 142964, 142970, 142976,
+ 142982, 142988, 142994, 143000, 143006, 143012, 143018, 143024, 143029,
+ 143035, 143040, 143046, 143051, 143057, 143063, 143068, 143074, 143079,
+ 143085, 143091, 143097, 143103, 143109, 143115, 143121, 143126, 143131,
+ 143137, 143143, 143149, 143155, 143161, 143167, 143173, 143179, 143185,
+ 143191, 143197, 143203, 143209, 143214, 143220, 143225, 143231, 143236,
+ 143242, 143248, 143253, 143259, 143264, 143270, 143276, 143282, 143288,
+ 143294, 143300, 143306, 143311, 143316, 143322, 143328, 143333, 143337,
+ 143341, 143345, 143349, 143353, 143357, 143361, 143365, 143369, 143374,
+ 143379, 143384, 143389, 143394, 143399, 143404, 143409, 143414, 143419,
+ 143426, 143433, 143440, 143444, 143450, 143455, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143461,
+ 143464, 143468, 143472, 143476, 143479, 143483, 143488, 143492, 143496,
+ 143500, 143504, 143508, 143513, 143518, 143522, 143526, 143529, 143533,
+ 143538, 143543, 143547, 143551, 143554, 143558, 143562, 143566, 143570,
+ 143574, 143578, 143582, 143585, 143589, 143593, 143597, 143601, 143605,
+ 143609, 143615, 143618, 143622, 143626, 143630, 143634, 143638, 143642,
+ 143646, 143650, 143654, 143659, 143664, 143670, 143674, 143678, 143682,
+ 143686, 143690, 143694, 143699, 143702, 143706, 143710, 143714, 143718,
+ 143724, 143728, 143732, 143736, 143740, 143744, 143748, 143752, 143756,
+ 143760, 143764, 0, 0, 0, 0, 143768, 143773, 143777, 143781, 143787,
+ 143793, 143797, 143802, 143807, 143812, 143817, 143821, 143826, 143831,
+ 143836, 143840, 143845, 143850, 143855, 143859, 143864, 143869, 143874,
+ 143879, 143884, 143889, 143894, 143899, 143903, 143908, 143913, 143918,
+ 143923, 143928, 143933, 143938, 143943, 143948, 143953, 143958, 143965,
+ 143970, 143977, 143982, 143987, 143992, 143997, 144002, 144007, 144012,
+ 144017, 144022, 144027, 144032, 144037, 144042, 144047, 0, 0, 0, 0, 0, 0,
+ 0, 144052, 144055, 144060, 144063, 144066, 144070, 144074, 144078,
+ 144082, 144086, 144090, 144094, 144100, 144106, 144112, 144118, 144124,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144130, 144134, 144138,
+ 144144, 144150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144155, 144164, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144173, 144176, 144179, 144182, 144185,
+ 144188, 144191, 144194, 144197, 144200, 144203, 144206, 144209, 144212,
+ 144215, 144218, 144221, 144224, 144227, 144230, 144233, 144236, 144239,
+ 144242, 144245, 144248, 144251, 144254, 144257, 144260, 144263, 144266,
+ 144269, 144272, 144275, 144278, 144281, 144284, 144287, 144290, 144293,
+ 144296, 144299, 144302, 144305, 144308, 144311, 144314, 144317, 144320,
+ 144323, 144326, 144329, 144332, 144335, 144338, 144341, 144344, 144347,
+ 144350, 144353, 144356, 144359, 144362, 144365, 144368, 144371, 144374,
+ 144377, 144380, 144383, 144386, 144389, 144392, 144395, 144398, 144401,
+ 144404, 144407, 144410, 144413, 144416, 144419, 144422, 144425, 144428,
+ 144431, 144434, 144437, 144440, 144443, 144446, 144449, 144452, 144455,
+ 144458, 144461, 144464, 144467, 144470, 144473, 144476, 144479, 144482,
+ 144485, 144488, 144491, 144494, 144497, 144500, 144503, 144506, 144509,
+ 144512, 144515, 144518, 144521, 144524, 144527, 144530, 144533, 144536,
+ 144539, 144542, 144545, 144548, 144551, 144554, 144557, 144560, 144563,
+ 144566, 144569, 144572, 144575, 144578, 144581, 144584, 144587, 144590,
+ 144593, 144596, 144599, 144602, 144605, 144608, 144611, 144614, 144617,
+ 144620, 144623, 144626, 144629, 144632, 144635, 144638, 144641, 144644,
+ 144647, 144650, 144653, 144656, 144659, 144662, 144665, 144668, 144671,
+ 144674, 144677, 144680, 144683, 144686, 144689, 144692, 144695, 144698,
+ 144701, 144704, 144707, 144710, 144713, 144716, 144719, 144722, 144725,
+ 144728, 144731, 144734, 144737, 144740, 144743, 144746, 144749, 144752,
+ 144755, 144758, 144761, 144764, 144767, 144770, 144773, 144776, 144779,
+ 144782, 144785, 144788, 144791, 144794, 144797, 144800, 144803, 144806,
+ 144809, 144812, 144815, 144818, 144821, 144824, 144827, 144830, 144833,
+ 144836, 144839, 144842, 144845, 144848, 144851, 144854, 144857, 144860,
+ 144863, 144866, 144869, 144872, 144875, 144878, 144881, 144884, 144887,
+ 144890, 144893, 144896, 144899, 144902, 144905, 144908, 144911, 144914,
+ 144917, 144920, 144923, 144926, 144929, 144932, 144935, 144938, 144941,
+ 144944, 144947, 144950, 144953, 144956, 144959, 144962, 144965, 144968,
+ 144971, 144974, 144977, 144980, 144983, 144986, 144989, 144992, 144995,
+ 144998, 145001, 145004, 145007, 145010, 145013, 145016, 145019, 145022,
+ 145025, 145028, 145031, 145034, 145037, 145040, 145043, 145046, 145049,
+ 145052, 145055, 145058, 145061, 145064, 145067, 145070, 145073, 145076,
+ 145079, 145082, 145085, 145088, 145091, 145094, 145097, 145100, 145103,
+ 145106, 145109, 145112, 145115, 145118, 145121, 145124, 145127, 145130,
+ 145133, 145136, 145139, 145142, 145145, 145148, 145151, 145154, 145157,
+ 145160, 145163, 145166, 145169, 145172, 145175, 145178, 145181, 145184,
+ 145187, 145190, 145193, 145196, 145199, 145202, 145205, 145208, 145211,
+ 145214, 145217, 145220, 145223, 145226, 145229, 145232, 145235, 145238,
+ 145241, 145244, 145247, 145250, 145253, 145256, 145259, 145262, 145265,
+ 145268, 145271, 145274, 145277, 145280, 145283, 145286, 145289, 145292,
+ 145295, 145298, 145301, 145304, 145307, 145310, 145313, 145316, 145319,
+ 145322, 145325, 145328, 145331, 145334, 145337, 145340, 145343, 145346,
+ 145349, 145352, 145355, 145358, 145361, 145364, 145367, 145370, 145373,
+ 145376, 145379, 145382, 145385, 145388, 145391, 145394, 145397, 145400,
+ 145403, 145406, 145409, 145412, 145415, 145418, 145421, 145424, 145427,
+ 145430, 145433, 145436, 145439, 145442, 145445, 145448, 145451, 145454,
+ 145457, 145460, 145463, 145466, 145469, 145472, 145475, 145478, 145481,
+ 145484, 145487, 145490, 145493, 145496, 145499, 145502, 145505, 145508,
+ 145511, 145514, 145517, 145520, 145523, 145526, 145529, 145532, 145535,
+ 145538, 145541, 145544, 145547, 145550, 145553, 145556, 145559, 145562,
+ 145565, 145568, 145571, 145574, 145577, 145580, 145583, 145586, 145589,
+ 145592, 145595, 145598, 145601, 145604, 145607, 145610, 145613, 145616,
+ 145619, 145622, 145625, 145628, 145631, 145634, 145637, 145640, 145643,
+ 145646, 145649, 145652, 145655, 145658, 145661, 145664, 145667, 145670,
+ 145673, 145676, 145679, 145682, 145685, 145688, 145691, 145694, 145697,
+ 145700, 145703, 145706, 145709, 145712, 145715, 145718, 145721, 145724,
+ 145727, 145730, 145733, 145736, 145739, 145742, 145745, 145748, 145751,
+ 145754, 145757, 145760, 145763, 145766, 145769, 145772, 145775, 145778,
+ 145781, 145784, 145787, 145790, 145793, 145796, 145799, 145802, 145805,
+ 145808, 145811, 145814, 145817, 145820, 145823, 145826, 145829, 145832,
+ 145835, 145838, 145841, 145844, 145847, 145850, 145853, 145856, 145859,
+ 145862, 145865, 145868, 145871, 145874, 145877, 145880, 145883, 145886,
+ 145889, 145892, 145895, 145898, 145901, 145904, 145907, 145910, 145913,
+ 145916, 145919, 145922, 145925, 145928, 145931, 145934, 145937, 145940,
+ 145943, 145946, 145949, 145952, 145955, 145958, 145961, 145964, 145967,
+ 145970, 145973, 145976, 145979, 145982, 145985, 145988, 145991, 145994,
+ 145997, 146000, 146003, 146006, 146009, 146012, 146015, 146018, 146021,
+ 146024, 146027, 146030, 146033, 146036, 146039, 146042, 146045, 146048,
+ 146051, 146054, 146057, 146060, 146063, 146066, 146069, 146072, 146075,
+ 146078, 146081, 146084, 146087, 146090, 146093, 146096, 146099, 146102,
+ 146105, 146108, 146111, 146114, 146117, 146120, 146123, 146126, 146129,
+ 146132, 146135, 146138, 146141, 146144, 146147, 146150, 146153, 146156,
+ 146159, 146162, 146165, 146168, 146171, 146174, 146177, 146180, 146183,
+ 146186, 146189, 146192, 146195, 146198, 146201, 146204, 146207, 146210,
+ 146213, 146216, 146219, 146222, 146225, 146228, 146231, 146234, 146237,
+ 146240, 146243, 146246, 146249, 146252, 146255, 146258, 146261, 146264,
+ 146267, 146270, 146273, 146276, 146279, 146282, 146285, 146288, 146291,
+ 146294, 146297, 146300, 146303, 146306, 146309, 146312, 146315, 146318,
+ 146321, 146324, 146327, 146330, 146333, 146336, 146339, 146342, 146345,
+ 146348, 146351, 146354, 146357, 146360, 146363, 146366, 146369, 146372,
+ 146375, 146378, 146381, 146384, 146387, 146390, 146393, 146396, 146399,
+ 146402, 146405, 146408, 146411, 146414, 146417, 146420, 146423, 146426,
+ 146429, 146432, 146435, 146438, 146441, 146444, 146447, 146450, 146453,
+ 146456, 146459, 146462, 146465, 146468, 146471, 146474, 146477, 146482,
+ 146487, 146492, 146497, 146502, 146507, 146512, 146517, 146522, 146527,
+ 146532, 146537, 146542, 146547, 146552, 146557, 146562, 146567, 146572,
+ 146577, 146582, 146587, 146592, 146597, 146602, 146607, 146612, 146617,
+ 146622, 146627, 146632, 146637, 146642, 146647, 146652, 146657, 146662,
+ 146667, 146672, 146677, 146682, 146687, 146692, 146697, 146702, 146707,
+ 146712, 146717, 146722, 146727, 146732, 146737, 146742, 146747, 146752,
+ 146757, 146762, 146767, 146772, 146777, 146782, 146787, 146792, 146797,
+ 146802, 146807, 146812, 146817, 146822, 146827, 146832, 146837, 146842,
+ 146847, 146852, 146857, 146862, 146867, 146872, 146877, 146882, 146887,
+ 146892, 146897, 146902, 146907, 146912, 146917, 146922, 146927, 146932,
+ 146937, 146942, 146947, 146952, 146957, 146962, 146967, 146972, 146977,
+ 146982, 146987, 146992, 146997, 147002, 147007, 147012, 147017, 147022,
+ 147027, 147032, 147037, 147042, 147047, 147052, 147057, 147062, 147067,
+ 147072, 147077, 147082, 147087, 147092, 147097, 147102, 147107, 147112,
+ 147117, 147122, 147127, 147132, 147137, 147142, 147147, 147152, 147157,
+ 147162, 147167, 147172, 147177, 147182, 147187, 147192, 147197, 147202,
+ 147207, 147212, 147217, 147222, 147227, 147232, 147237, 147242, 147247,
+ 147252, 147257, 147262, 147267, 147272, 147277, 147282, 147287, 147292,
+ 147297, 147302, 147307, 147312, 147317, 147322, 147327, 147332, 147337,
+ 147342, 147347, 147352, 147357, 147362, 147367, 147372, 147377, 147382,
+ 147387, 147392, 147397, 147402, 147407, 147412, 147417, 147422, 147427,
+ 147432, 147437, 147442, 147447, 147452, 147457, 147462, 147467, 147472,
+ 147477, 147482, 147487, 147492, 147497, 147502, 147507, 147512, 147517,
+ 147522, 147527, 147532, 147537, 147542, 147547, 147552, 147557, 147562,
+ 147567, 147572, 147577, 147582, 147587, 147592, 147597, 147602, 147607,
+ 147612, 147617, 147622, 147627, 147632, 147637, 147642, 147647, 147652,
+ 147657, 147662, 147667, 147672, 147677, 147682, 147687, 147692, 147697,
+ 147702, 147707, 147712, 147717, 147722, 147727, 147732, 147737, 147742,
+ 147747, 147752, 147757, 147762, 147767, 147772, 147777, 147782, 147787,
+ 147792, 147797, 147802, 147807, 147812, 147817, 147822, 147827, 147832,
+ 147837, 147842, 147847, 147852, 147857, 147862, 147867, 147872, 147877,
+ 147882, 147887, 147892, 147897, 147902, 147907, 147912, 147917, 147922,
+ 147927, 147932, 147937, 147942, 147947, 147952, 147957, 147962, 147967,
+ 147972, 147977, 147982, 147987, 147992, 147997, 148002, 148007, 148012,
+ 148017, 148022, 148027, 148032, 148037, 148042, 148047, 148052, 148057,
+ 148062, 148067, 148072, 148077, 148082, 148087, 148092, 148097, 148102,
+ 148107, 148112, 148117, 148122, 148127, 148132, 148137, 148142, 148147,
+ 148152, 148157, 148162, 148167, 148172, 148177, 148182, 148187, 148192,
+ 148197, 148202, 148207, 148212, 148217, 148222, 148227, 148232, 148237,
+ 148242, 148247, 148252, 148257, 148262, 148267, 148272, 148277, 148282,
+ 148287, 148292, 148297, 148302, 148307, 148312, 148317, 148322, 148327,
+ 148332, 148337, 148342, 148347, 148352, 148357, 148362, 148367, 148372,
+ 148377, 148382, 148387, 148392, 148397, 148402, 148407, 148412, 148417,
+ 148422, 148427, 148432, 148437, 148442, 148447, 148452, 148457, 148462,
+ 148467, 148472, 148477, 148482, 148487, 148492, 148497, 148502, 148507,
+ 148512, 148517, 148522, 148527, 148532, 148537, 148542, 148547, 148552,
+ 148557, 148562, 148567, 148572, 148577, 148582, 148587, 148592, 148597,
+ 148602, 148607, 148612, 148617, 148622, 148627, 148632, 148637, 148642,
+ 148647, 148652, 148657, 148662, 148667, 148672, 148677, 148682, 148687,
+ 148692, 148697, 148702, 148707, 148712, 148717, 148722, 148727, 148732,
+ 148737, 148742, 148747, 148752, 148757, 148762, 148767, 148772, 148777,
+ 148782, 148787, 148792, 148797, 148802, 148807, 148812, 148817, 148822,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148827, 148833, 148839, 148845, 0, 148851,
+ 148857, 148863, 148871, 148879, 148887, 148895, 0, 148903, 148911, 0,
+ 148919, 148924, 148931, 148935, 148939, 148943, 148947, 148951, 148955,
+ 148959, 148963, 148967, 148971, 148975, 148979, 148983, 148987, 148991,
+ 148995, 148999, 149003, 149007, 149011, 149015, 149019, 149023, 149027,
+ 149031, 149035, 149039, 149043, 149047, 149051, 149055, 149059, 149063,
+ 149067, 149071, 149075, 149079, 149083, 149087, 149091, 149095, 149099,
+ 149103, 149107, 149111, 149115, 149119, 149123, 149127, 149131, 149135,
+ 149139, 149143, 149147, 149151, 149155, 149159, 149163, 149167, 149171,
+ 149175, 149179, 149183, 149187, 149191, 149195, 149199, 149203, 149207,
+ 149211, 149215, 149219, 149223, 149227, 149231, 149235, 149239, 149243,
+ 149247, 149251, 149255, 149259, 149263, 149267, 149271, 149275, 149279,
+ 149283, 149287, 149291, 149295, 149299, 149303, 149307, 149311, 149315,
+ 149319, 149323, 149327, 149331, 149335, 149339, 149343, 149347, 149351,
+ 149355, 149359, 149363, 149367, 149371, 149375, 149379, 149383, 149387,
+ 149391, 149395, 149399, 149403, 149407, 149411, 149415, 149419, 149423,
+ 149427, 149431, 149435, 149439, 149443, 149447, 149451, 149455, 149459,
+ 149463, 149467, 149471, 149475, 149479, 149483, 149487, 149491, 149495,
+ 149499, 149503, 149507, 149511, 149515, 149519, 149523, 149527, 149531,
+ 149535, 149539, 149543, 149547, 149551, 149555, 149559, 149563, 149567,
+ 149571, 149575, 149579, 149583, 149587, 149591, 149595, 149599, 149603,
+ 149607, 149611, 149615, 149619, 149623, 149627, 149631, 149635, 149639,
+ 149643, 149647, 149651, 149655, 149659, 149663, 149667, 149671, 149675,
+ 149679, 149683, 149687, 149691, 149695, 149699, 149703, 149707, 149711,
+ 149715, 149719, 149723, 149727, 149731, 149735, 149739, 149743, 149747,
+ 149751, 149755, 149759, 149763, 149767, 149771, 149775, 149779, 149783,
+ 149787, 149791, 149795, 149799, 149803, 149807, 149811, 149815, 149819,
+ 149823, 149827, 149831, 149835, 149839, 149843, 149847, 149851, 149855,
+ 149859, 149863, 149867, 149871, 149875, 149879, 149883, 149887, 149891,
+ 149895, 149899, 149903, 149907, 149911, 149915, 149919, 149923, 149927,
+ 149931, 149935, 149939, 149943, 149947, 149951, 149955, 149959, 149963,
+ 149967, 149971, 149975, 149979, 149983, 149987, 149991, 149995, 149999,
+ 150003, 150007, 150011, 150015, 150019, 150023, 150027, 150031, 150035,
+ 150039, 150043, 150047, 150051, 150055, 150059, 150063, 150067, 150071,
+ 150078, 150084, 150090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 150096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 150102, 150108, 150114, 0, 0, 150120, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 150125, 150130, 150135, 150140, 0, 0, 0, 0, 0,
+ 0, 0, 0, 150145, 150148, 150151, 150154, 150157, 150160, 150163, 150166,
+ 150169, 150172, 150175, 150178, 150181, 150184, 150187, 150190, 150193,
+ 150196, 150199, 150202, 150205, 150208, 150211, 150214, 150217, 150220,
+ 150223, 150226, 150229, 150232, 150235, 150238, 150241, 150244, 150247,
+ 150250, 150253, 150256, 150259, 150262, 150265, 150268, 150271, 150274,
+ 150277, 150280, 150283, 150286, 150289, 150292, 150295, 150298, 150301,
+ 150304, 150307, 150310, 150313, 150316, 150319, 150322, 150325, 150328,
+ 150331, 150334, 150337, 150340, 150343, 150346, 150349, 150352, 150355,
+ 150358, 150361, 150364, 150367, 150370, 150373, 150376, 150379, 150382,
+ 150385, 150388, 150391, 150394, 150397, 150400, 150403, 150406, 150409,
+ 150412, 150415, 150418, 150421, 150424, 150427, 150430, 150433, 150436,
+ 150439, 150442, 150445, 150448, 150451, 150454, 150457, 150460, 150463,
+ 150466, 150469, 150472, 150475, 150478, 150481, 150484, 150487, 150490,
+ 150493, 150496, 150499, 150502, 150505, 150508, 150511, 150514, 150517,
+ 150520, 150523, 150526, 150529, 150532, 150535, 150538, 150541, 150544,
+ 150547, 150550, 150553, 150556, 150559, 150562, 150565, 150568, 150571,
+ 150574, 150577, 150580, 150583, 150586, 150589, 150592, 150595, 150598,
+ 150601, 150604, 150607, 150610, 150613, 150616, 150619, 150622, 150625,
+ 150628, 150631, 150634, 150637, 150640, 150643, 150646, 150649, 150652,
+ 150655, 150658, 150661, 150664, 150667, 150670, 150673, 150676, 150679,
+ 150682, 150685, 150688, 150691, 150694, 150697, 150700, 150703, 150706,
+ 150709, 150712, 150715, 150718, 150721, 150724, 150727, 150730, 150733,
+ 150736, 150739, 150742, 150745, 150748, 150751, 150754, 150757, 150760,
+ 150763, 150766, 150769, 150772, 150775, 150778, 150781, 150784, 150787,
+ 150790, 150793, 150796, 150799, 150802, 150805, 150808, 150811, 150814,
+ 150817, 150820, 150823, 150826, 150829, 150832, 150835, 150838, 150841,
+ 150844, 150847, 150850, 150853, 150856, 150859, 150862, 150865, 150868,
+ 150871, 150874, 150877, 150880, 150883, 150886, 150889, 150892, 150895,
+ 150898, 150901, 150904, 150907, 150910, 150913, 150916, 150919, 150922,
+ 150925, 150928, 150931, 150934, 150937, 150940, 150943, 150946, 150949,
+ 150952, 150955, 150958, 150961, 150964, 150967, 150970, 150973, 150976,
+ 150979, 150982, 150985, 150988, 150991, 150994, 150997, 151000, 151003,
+ 151006, 151009, 151012, 151015, 151018, 151021, 151024, 151027, 151030,
+ 151033, 151036, 151039, 151042, 151045, 151048, 151051, 151054, 151057,
+ 151060, 151063, 151066, 151069, 151072, 151075, 151078, 151081, 151084,
+ 151087, 151090, 151093, 151096, 151099, 151102, 151105, 151108, 151111,
+ 151114, 151117, 151120, 151123, 151126, 151129, 151132, 151135, 151138,
+ 151141, 151144, 151147, 151150, 151153, 151156, 151159, 151162, 151165,
+ 151168, 151171, 151174, 151177, 151180, 151183, 151186, 151189, 151192,
+ 151195, 151198, 151201, 151204, 151207, 151210, 151213, 151216, 151219,
+ 151222, 151225, 151228, 151231, 151234, 151237, 151240, 151243, 151246,
+ 151249, 151252, 151255, 151258, 151261, 151264, 151267, 151270, 151273,
+ 151276, 151279, 151282, 151285, 151288, 151291, 151294, 151297, 151300,
+ 151303, 151306, 151309, 151312, 151315, 151318, 151321, 151324, 151327,
+ 151330, 0, 0, 0, 0, 151333, 151337, 151341, 151345, 151349, 151353,
+ 151357, 151360, 151364, 151368, 151372, 151376, 151379, 151385, 151391,
+ 151397, 151403, 151409, 151413, 151419, 151423, 151427, 151433, 151437,
+ 151441, 151445, 151449, 151453, 151457, 151461, 151467, 151473, 151479,
+ 151485, 151492, 151499, 151506, 151516, 151523, 151530, 151536, 151542,
+ 151548, 151554, 151562, 151570, 151578, 151586, 151595, 151601, 151609,
+ 151615, 151622, 151628, 151635, 151641, 151649, 151653, 151657, 151662,
+ 151668, 151674, 151682, 151690, 151696, 151703, 151706, 151712, 151716,
+ 151719, 151723, 151726, 151729, 151733, 151738, 151742, 151746, 151752,
+ 151757, 151763, 151767, 151771, 151774, 151778, 151782, 151787, 151791,
+ 151796, 151800, 151805, 151809, 151813, 151817, 151821, 151825, 151829,
+ 151833, 151837, 151842, 151847, 151852, 151857, 151863, 151869, 151875,
+ 151881, 151887, 0, 0, 0, 0, 0, 151892, 151900, 151909, 151917, 151924,
+ 151932, 151939, 151946, 151955, 151962, 151969, 151977, 151985, 0, 0, 0,
+ 151993, 151999, 152007, 152013, 152020, 152026, 152032, 152038, 152044,
+ 0, 0, 0, 0, 0, 0, 0, 152050, 152056, 152064, 152070, 152077, 152083,
+ 152089, 152095, 152101, 152107, 0, 0, 152112, 152118, 152124, 152127,
+ 152136, 152143, 152151, 152158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 152165, 152180, 152193, 152202, 152213, 152222, 152231,
+ 152242, 152251, 152260, 152275, 152288, 152301, 152315, 152327, 152335,
+ 152345, 152353, 152361, 152371, 152379, 152387, 152401, 152413, 152425,
+ 152434, 152445, 152454, 152463, 152470, 152479, 152488, 152495, 152500,
+ 152505, 152510, 152515, 152520, 152525, 152530, 152535, 152540, 152545,
+ 152550, 152555, 152560, 0, 0, 152569, 152578, 152587, 152596, 152601,
+ 152608, 152613, 152618, 152626, 152631, 152638, 152643, 152650, 152655,
+ 152660, 152667, 152674, 152679, 152688, 152694, 152700, 152708, 152714,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 152720, 152724, 152730, 152734, 152742,
+ 152746, 152750, 152754, 152762, 152766, 152772, 152781, 152785, 152789,
+ 152793, 152799, 152805, 152811, 152817, 152823, 152829, 152835, 152841,
+ 152847, 152855, 152863, 152871, 152879, 152884, 152890, 152894, 152898,
+ 152902, 152906, 152912, 152918, 152924, 152930, 152936, 152944, 152950,
+ 152958, 152966, 152974, 152982, 152990, 152994, 153002, 153008, 153016,
+ 153020, 153024, 153028, 153032, 153036, 153040, 153048, 153056, 153068,
+ 153080, 153086, 153096, 153104, 153114, 153126, 153130, 153136, 153142,
+ 153148, 153154, 153160, 153166, 153172, 153178, 153184, 153192, 153198,
+ 153204, 153210, 153218, 153226, 153237, 153248, 153254, 153260, 153270,
+ 153276, 153284, 153288, 153294, 153300, 153306, 153312, 153318, 153324,
+ 153330, 153334, 153340, 153346, 153354, 153362, 153370, 153376, 153384,
+ 153397, 153410, 153418, 153426, 153438, 153446, 153456, 153464, 153468,
+ 153472, 153476, 153480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 153484,
+ 153489, 153494, 153499, 153506, 153513, 153520, 153527, 153532, 153537,
+ 153542, 153547, 153554, 153559, 153566, 153573, 153578, 153583, 153588,
+ 153595, 153600, 153605, 153612, 153619, 153624, 153629, 153634, 153641,
+ 153648, 153655, 153660, 153665, 153672, 153679, 153686, 153693, 153698,
+ 153703, 153708, 153715, 153720, 153725, 153730, 153737, 153746, 153753,
+ 153758, 153763, 153768, 153773, 153778, 153783, 153792, 153799, 153804,
+ 153811, 153818, 153823, 153828, 153833, 153840, 153845, 153852, 153859,
+ 153864, 153869, 153874, 153881, 153888, 153893, 153898, 153905, 153912,
+ 153919, 153924, 153929, 153934, 153939, 153946, 153955, 153964, 153969,
+ 153976, 153985, 153990, 153995, 154000, 154005, 154012, 154019, 154026,
+ 154033, 154038, 154043, 154048, 154055, 154062, 154069, 154074, 154079,
+ 154086, 154091, 154098, 154103, 154110, 154115, 154122, 154129, 154134,
+ 154139, 154144, 154149, 154154, 154159, 154164, 154169, 154174, 154181,
+ 154188, 154195, 154202, 154209, 154218, 154223, 154228, 154235, 154242,
+ 154247, 154254, 154261, 154268, 154275, 154282, 154289, 154294, 154299,
+ 154304, 154309, 154314, 154323, 154332, 154341, 154350, 154359, 154368,
+ 154377, 154386, 154391, 154402, 154413, 154422, 154427, 154432, 154437,
+ 154442, 154451, 154458, 154465, 154472, 154479, 154486, 154493, 154502,
+ 154511, 154522, 154531, 154542, 154551, 154558, 154567, 154578, 154587,
+ 154596, 154605, 154614, 154621, 154628, 154635, 154644, 154653, 154664,
+ 154673, 154682, 154693, 154698, 154703, 154714, 154722, 154731, 154740,
+ 154749, 154760, 154769, 154778, 154789, 154800, 154811, 154822, 154833,
+ 154844, 154851, 154858, 154865, 154872, 154883, 154892, 154899, 154906,
+ 154913, 154924, 154935, 154946, 154957, 154968, 154979, 154990, 155001,
+ 155008, 155015, 155024, 155033, 155040, 155047, 155054, 155063, 155072,
+ 155081, 155088, 155097, 155106, 155115, 155122, 155129, 155134, 155140,
+ 155147, 155154, 155161, 155168, 155175, 155182, 155191, 155200, 155209,
+ 155218, 155225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 155234, 155240, 155245,
+ 155250, 155257, 155263, 155269, 155275, 155281, 155287, 155293, 155299,
+ 155303, 155307, 155313, 155319, 155325, 155329, 155334, 155339, 155343,
+ 155347, 155351, 155357, 155363, 155369, 155375, 155381, 155387, 155393,
+ 155399, 155405, 155415, 155425, 155431, 155437, 155447, 155457, 155463,
+ 0, 0, 155469, 155477, 155482, 155487, 155493, 155499, 155505, 155511,
+ 155517, 155523, 155530, 155537, 155543, 155549, 155555, 155561, 155567,
+ 155573, 155579, 155585, 155590, 155596, 155602, 155608, 155614, 155620,
+ 155629, 155635, 155640, 155648, 155655, 155662, 155671, 155680, 155689,
+ 155698, 155707, 155716, 155725, 155734, 155744, 155754, 155762, 155770,
+ 155779, 155788, 155794, 155800, 155806, 155812, 155820, 155828, 155832,
+ 155838, 155843, 155849, 155855, 155861, 155867, 155873, 155882, 155887,
+ 155894, 155899, 155904, 155909, 155915, 155921, 155927, 155934, 155939,
+ 155944, 155949, 155954, 155959, 155965, 155971, 155977, 155983, 155989,
+ 155995, 156001, 156007, 156012, 156017, 156022, 156027, 156032, 156037,
+ 156042, 156047, 156053, 156059, 156064, 156069, 156074, 156079, 156084,
+ 156090, 156097, 156101, 156105, 156109, 156113, 156117, 156121, 156125,
+ 156129, 156137, 156147, 156151, 156155, 156161, 156167, 156173, 156179,
+ 156185, 156191, 156197, 156203, 156209, 156215, 156221, 156227, 156233,
+ 156239, 156243, 156247, 156254, 156260, 156266, 156272, 156277, 156284,
+ 156289, 156295, 156301, 156307, 156313, 156318, 156322, 156328, 156332,
+ 156336, 156340, 156346, 156352, 156356, 156362, 156368, 156374, 156380,
+ 156386, 156394, 156402, 156408, 156414, 156420, 156426, 156438, 156450,
+ 156464, 156476, 156488, 156502, 156516, 156530, 156534, 156542, 156550,
+ 156555, 156559, 156563, 156567, 156571, 156575, 156579, 156583, 156589,
+ 156595, 156601, 156607, 156615, 156624, 156631, 156638, 156646, 156653,
+ 156665, 156677, 156689, 156701, 156708, 156712, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156716, 156723, 156730, 156737,
+ 156744, 156751, 156758, 156765, 156772, 156779, 156786, 156793, 156800,
+ 156807, 156814, 156821, 156828, 156835, 156842, 156849, 156856, 156863,
+ 156870, 156877, 156884, 156891, 156898, 156905, 156912, 156919, 156926,
+ 156933, 156940, 156947, 156954, 156961, 156968, 156975, 156982, 156989,
+ 156996, 157003, 157010, 157017, 157024, 157031, 157038, 157045, 157052,
+ 157059, 157066, 157073, 157080, 157087, 157094, 157101, 157108, 157115,
+ 157122, 157129, 157136, 157143, 157150, 157157, 157164, 157171, 157178,
+ 157183, 157188, 157193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157197, 157203, 157208, 157213, 157218,
+ 157223, 157228, 157233, 157238, 157243, 157248, 157254, 157260, 157266,
+ 157272, 157278, 157284, 157290, 157296, 157302, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 157308, 157314, 157319, 157324, 157329, 157334, 157339,
+ 157344, 157349, 157354, 157359, 157365, 157371, 157377, 157383, 157389,
+ 157395, 157401, 157407, 157413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 157419, 157424, 157431, 157438, 157445, 157452, 157457, 157462, 157469,
+ 157474, 157479, 157486, 157491, 157496, 157501, 157508, 157517, 157522,
+ 157527, 157532, 157537, 157542, 157547, 157554, 157559, 157564, 157569,
+ 157574, 157579, 157584, 157589, 157594, 157599, 157604, 157609, 157614,
+ 157620, 157625, 157630, 157635, 157640, 157645, 157650, 157655, 157660,
+ 157665, 157674, 157679, 157687, 157692, 157697, 157702, 157707, 157712,
+ 157717, 157722, 157731, 157736, 157741, 157746, 157751, 157756, 157763,
+ 157768, 157775, 157780, 157785, 157790, 157795, 157800, 157805, 157810,
+ 157815, 157820, 157825, 157830, 157835, 157840, 157845, 157850, 157855,
+ 157860, 157865, 157870, 157879, 157884, 157889, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 157894, 157902, 157910, 157918, 157926, 157934, 157942, 157950,
+ 157958, 157966, 157974, 157982, 157990, 157998, 158006, 158014, 158022,
+ 158030, 158038, 158043, 158048, 158053, 158058, 158063, 158067, 0, 0, 0,
+ 0, 0, 0, 0, 158071, 158075, 158080, 158085, 158090, 158094, 158099,
+ 158104, 158109, 158113, 158118, 158123, 158127, 158132, 158137, 158141,
+ 158146, 158151, 158155, 158160, 158165, 158169, 158174, 158179, 158184,
+ 158189, 158194, 158198, 158203, 158208, 158213, 158217, 158222, 158227,
+ 158232, 158236, 158241, 158246, 158250, 158255, 158260, 158264, 158269,
+ 158274, 158278, 158283, 158288, 158292, 158297, 158302, 158307, 158312,
+ 158317, 158321, 158326, 158331, 158336, 158340, 158345, 158350, 158355,
+ 158359, 158364, 158369, 158373, 158378, 158383, 158387, 158392, 158397,
+ 158401, 158406, 158411, 158415, 158420, 158425, 158430, 158435, 158440,
+ 158444, 158449, 158454, 158459, 158463, 158468, 0, 158473, 158477,
+ 158482, 158487, 158491, 158496, 158501, 158505, 158510, 158515, 158519,
+ 158524, 158529, 158533, 158538, 158543, 158548, 158553, 158558, 158563,
+ 158569, 158575, 158581, 158586, 158592, 158598, 158604, 158609, 158615,
+ 158621, 158626, 158632, 158638, 158643, 158649, 158655, 158660, 158666,
+ 158672, 158677, 158683, 158689, 158695, 158701, 158707, 158712, 158718,
+ 158724, 158730, 158735, 158741, 158747, 158753, 158758, 158764, 158770,
+ 158775, 158781, 158787, 158792, 158798, 158804, 158809, 158815, 158821,
+ 158826, 158832, 158838, 158844, 158850, 158856, 0, 158860, 158865, 0, 0,
+ 158870, 0, 0, 158875, 158880, 0, 0, 158885, 158890, 158894, 158899, 0,
+ 158904, 158909, 158914, 158918, 158923, 158928, 158933, 158938, 158943,
+ 158947, 158952, 158957, 0, 158962, 0, 158967, 158972, 158976, 158981,
+ 158986, 158990, 158995, 0, 159000, 159005, 159010, 159014, 159019,
+ 159024, 159028, 159033, 159038, 159043, 159048, 159053, 159058, 159064,
+ 159070, 159076, 159081, 159087, 159093, 159099, 159104, 159110, 159116,
+ 159121, 159127, 159133, 159138, 159144, 159150, 159155, 159161, 159167,
+ 159172, 159178, 159184, 159190, 159196, 159202, 159207, 159213, 159219,
+ 159225, 159230, 159236, 159242, 159248, 159253, 159259, 159265, 159270,
+ 159276, 159282, 159287, 159293, 159299, 159304, 159310, 159316, 159321,
+ 159327, 159333, 159339, 159345, 159351, 159356, 0, 159362, 159368,
+ 159373, 159379, 0, 0, 159385, 159391, 159397, 159402, 159408, 159414,
+ 159419, 159425, 0, 159431, 159437, 159443, 159448, 159454, 159460,
+ 159466, 0, 159472, 159477, 159483, 159489, 159495, 159500, 159506,
+ 159512, 159518, 159523, 159529, 159535, 159540, 159546, 159552, 159557,
+ 159563, 159569, 159574, 159580, 159586, 159591, 159597, 159603, 159609,
+ 159615, 159621, 159626, 0, 159632, 159638, 159643, 159649, 0, 159655,
+ 159660, 159666, 159672, 159677, 0, 159683, 0, 0, 0, 159688, 159694,
+ 159700, 159705, 159711, 159717, 159723, 0, 159729, 159734, 159740,
+ 159746, 159752, 159757, 159763, 159769, 159775, 159780, 159786, 159792,
+ 159797, 159803, 159809, 159814, 159820, 159826, 159831, 159837, 159843,
+ 159848, 159854, 159860, 159866, 159872, 159878, 159884, 159891, 159898,
+ 159905, 159911, 159918, 159925, 159932, 159938, 159945, 159952, 159958,
+ 159965, 159972, 159978, 159985, 159992, 159998, 160005, 160012, 160018,
+ 160025, 160032, 160039, 160046, 160053, 160059, 160066, 160073, 160080,
+ 160086, 160093, 160100, 160107, 160113, 160120, 160127, 160133, 160140,
+ 160147, 160153, 160160, 160167, 160173, 160180, 160187, 160193, 160200,
+ 160207, 160214, 160221, 160228, 160232, 160237, 160242, 160247, 160251,
+ 160256, 160261, 160266, 160270, 160275, 160280, 160284, 160289, 160294,
+ 160298, 160303, 160308, 160312, 160317, 160322, 160326, 160331, 160336,
+ 160341, 160346, 160351, 160355, 160360, 160365, 160370, 160374, 160379,
+ 160384, 160389, 160393, 160398, 160403, 160407, 160412, 160417, 160421,
+ 160426, 160431, 160435, 160440, 160445, 160449, 160454, 160459, 160464,
+ 160469, 160474, 160479, 160485, 160491, 160497, 160502, 160508, 160514,
+ 160520, 160525, 160531, 160537, 160542, 160548, 160554, 160559, 160565,
+ 160571, 160576, 160582, 160588, 160593, 160599, 160605, 160611, 160617,
+ 160623, 160628, 160634, 160640, 160646, 160651, 160657, 160663, 160669,
+ 160674, 160680, 160686, 160691, 160697, 160703, 160708, 160714, 160720,
+ 160725, 160731, 160737, 160742, 160748, 160754, 160760, 160766, 160772,
+ 160777, 160783, 160789, 160795, 160800, 160806, 160812, 160818, 160823,
+ 160829, 160835, 160840, 160846, 160852, 160857, 160863, 160869, 160874,
+ 160880, 160886, 160891, 160897, 160903, 160909, 160915, 160921, 160926,
+ 160932, 160938, 160944, 160949, 160955, 160961, 160967, 160972, 160978,
+ 160984, 160989, 160995, 161001, 161006, 161012, 161018, 161023, 161029,
+ 161035, 161040, 161046, 161052, 161058, 161064, 161070, 161076, 161083,
+ 161090, 161097, 161103, 161110, 161117, 161124, 161130, 161137, 161144,
+ 161150, 161157, 161164, 161170, 161177, 161184, 161190, 161197, 161204,
+ 161210, 161217, 161224, 161231, 161238, 161245, 161251, 161258, 161265,
+ 161272, 161278, 161285, 161292, 161299, 161305, 161312, 161319, 161325,
+ 161332, 161339, 161345, 161352, 161359, 161365, 161372, 161379, 161385,
+ 161392, 161399, 161406, 161413, 161420, 161425, 161431, 161437, 161443,
+ 161448, 161454, 161460, 161466, 161471, 161477, 161483, 161488, 161494,
+ 161500, 161505, 161511, 161517, 161522, 161528, 161534, 161539, 161545,
+ 161551, 161557, 161563, 161569, 161574, 161580, 161586, 161592, 161597,
+ 161603, 161609, 161615, 161620, 161626, 161632, 161637, 161643, 161649,
+ 161654, 161660, 161666, 161671, 161677, 161683, 161688, 161694, 161700,
+ 161706, 161712, 161718, 161724, 0, 0, 161731, 161736, 161741, 161746,
+ 161751, 161756, 161761, 161766, 161771, 161776, 161781, 161786, 161791,
+ 161796, 161801, 161806, 161811, 161816, 161822, 161827, 161832, 161837,
+ 161842, 161847, 161852, 161857, 161861, 161866, 161871, 161876, 161881,
+ 161886, 161891, 161896, 161901, 161906, 161911, 161916, 161921, 161926,
+ 161931, 161936, 161941, 161946, 161952, 161957, 161962, 161967, 161972,
+ 161977, 161982, 161987, 161993, 161998, 162003, 162008, 162013, 162018,
+ 162023, 162028, 162033, 162038, 162043, 162048, 162053, 162058, 162063,
+ 162068, 162073, 162078, 162083, 162088, 162093, 162098, 162103, 162108,
+ 162114, 162119, 162124, 162129, 162134, 162139, 162144, 162149, 162153,
+ 162158, 162163, 162168, 162173, 162178, 162183, 162188, 162193, 162198,
+ 162203, 162208, 162213, 162218, 162223, 162228, 162233, 162238, 162244,
+ 162249, 162254, 162259, 162264, 162269, 162274, 162279, 162285, 162290,
+ 162295, 162300, 162305, 162310, 162315, 162321, 162327, 162333, 162339,
+ 162345, 162351, 162357, 162363, 162369, 162375, 162381, 162387, 162393,
+ 162399, 162405, 162411, 162417, 162424, 162430, 162436, 162442, 162448,
+ 162454, 162460, 162466, 162471, 162477, 162483, 162489, 162495, 162501,
+ 162507, 162513, 162519, 162525, 162531, 162537, 162543, 162549, 162555,
+ 162561, 162567, 162573, 162580, 162586, 162592, 162598, 162604, 162610,
+ 162616, 162622, 162629, 162635, 162641, 162647, 162653, 162659, 162665,
+ 162671, 162677, 162683, 162689, 162695, 162701, 162707, 162713, 162719,
+ 162725, 162731, 162737, 162743, 162749, 162755, 162761, 162767, 162774,
+ 162780, 162786, 162792, 162798, 162804, 162810, 162816, 162821, 162827,
+ 162833, 162839, 162845, 162851, 162857, 162863, 162869, 162875, 162881,
+ 162887, 162893, 162899, 162905, 162911, 162917, 162923, 162930, 162936,
+ 162942, 162948, 162954, 162960, 162966, 162972, 162979, 162985, 162991,
+ 162997, 163003, 163009, 163015, 163022, 163029, 163036, 163043, 163050,
+ 163057, 163064, 163071, 163078, 163085, 163092, 163099, 163106, 163113,
+ 163120, 163127, 163134, 163142, 163149, 163156, 163163, 163170, 163177,
+ 163184, 163191, 163197, 163204, 163211, 163218, 163225, 163232, 163239,
+ 163246, 163253, 163260, 163267, 163274, 163281, 163288, 163295, 163302,
+ 163309, 163316, 163324, 163331, 163338, 163345, 163352, 163359, 163366,
+ 163373, 163381, 163388, 163395, 163402, 163409, 163416, 163423, 163428,
+ 0, 0, 163433, 163438, 163442, 163446, 163450, 163454, 163458, 163462,
+ 163466, 163470, 163474, 163480, 163485, 163490, 163495, 163500, 163505,
+ 163510, 163515, 163520, 163525, 163530, 163534, 163538, 163542, 163546,
+ 163550, 163554, 163558, 163562, 163566, 163572, 163577, 163582, 163587,
+ 163592, 163597, 163602, 163607, 163612, 163617, 163623, 163628, 163633,
+ 163638, 163643, 163648, 163653, 163658, 163663, 163668, 163672, 163677,
+ 163682, 163687, 163692, 163697, 163702, 163708, 163716, 163723, 163728,
+ 163733, 163740, 163746, 163751, 163757, 163763, 163771, 163777, 163784,
+ 163792, 163798, 163807, 163816, 163824, 163832, 163838, 163845, 163853,
+ 163861, 163867, 163874, 163883, 163892, 163899, 163910, 163920, 163930,
+ 163940, 163950, 163957, 163964, 163971, 163978, 163987, 163996, 164007,
+ 164018, 164027, 164036, 164047, 164056, 164065, 164076, 164085, 164094,
+ 164102, 164110, 164121, 164132, 164140, 164149, 164158, 164165, 164176,
+ 164187, 164196, 164205, 164212, 164221, 164230, 164239, 164250, 164259,
+ 164269, 164278, 164287, 164298, 164311, 164326, 164337, 164350, 164362,
+ 164371, 164382, 164393, 164402, 164413, 164427, 164442, 164445, 164454,
+ 164459, 164465, 164473, 164479, 164485, 164494, 164501, 164511, 164523,
+ 164530, 164533, 164539, 164546, 164552, 164557, 164560, 164565, 164568,
+ 164576, 164582, 164591, 164598, 164606, 164612, 164617, 164620, 164623,
+ 164626, 164632, 164639, 164645, 164650, 164658, 164661, 164666, 164674,
+ 164680, 164689, 164696, 164706, 164715, 164718, 164724, 164731, 164738,
+ 164745, 164750, 164758, 164766, 164775, 164781, 164790, 164799, 164808,
+ 164814, 164823, 164830, 164837, 164844, 164852, 164858, 164866, 164872,
+ 164879, 164886, 164894, 164905, 164915, 164921, 164928, 164935, 164942,
+ 164948, 164955, 164962, 164967, 164974, 164982, 164991, 164997, 165009,
+ 165020, 165026, 165034, 165040, 165047, 165054, 165061, 165067, 165074,
+ 165083, 165089, 165095, 165102, 165109, 165117, 165127, 165137, 165147,
+ 165157, 165165, 165173, 165183, 165191, 165196, 165201, 165206, 165212,
+ 165219, 165226, 165232, 165238, 165243, 165250, 165258, 165268, 165276,
+ 165284, 165294, 165304, 165312, 165322, 165332, 165344, 165356, 165368,
+ 165378, 165384, 165390, 165397, 165406, 165415, 165424, 165433, 165443,
+ 165452, 165461, 165470, 165475, 165481, 165490, 165500, 165509, 165515,
+ 165521, 165528, 165535, 165542, 165548, 165555, 165562, 165569, 165575,
+ 165579, 165584, 165591, 165598, 165605, 165610, 165618, 165626, 165635,
+ 165643, 165650, 165658, 165667, 165677, 165680, 165684, 165689, 165694,
+ 165699, 165704, 165709, 165714, 165719, 165724, 165729, 165734, 165739,
+ 165744, 165749, 165754, 165759, 165764, 165769, 165776, 165782, 165789,
+ 165795, 165800, 165807, 165813, 165820, 165826, 165831, 165838, 165845,
+ 165852, 165858, 165864, 165873, 165882, 165892, 165899, 165906, 165915,
+ 165924, 165933, 165942, 165951, 165957, 165965, 165971, 165981, 165986,
+ 165995, 166004, 166011, 166022, 166029, 166036, 166043, 166050, 166057,
+ 166064, 166071, 166078, 166085, 166092, 166098, 166104, 166110, 166117,
+ 166124, 166131, 166138, 166145, 166152, 166159, 166166, 166173, 166180,
+ 166187, 166194, 166199, 166208, 166217, 166226, 166233, 166240, 166247,
+ 166254, 166261, 166268, 166275, 166282, 166291, 166300, 166309, 166318,
+ 166327, 166336, 166345, 166354, 166363, 166372, 166381, 166390, 166399,
+ 166405, 166413, 166419, 166429, 166434, 166443, 166452, 166461, 166472,
+ 166477, 166484, 166491, 166498, 166503, 166509, 166515, 166521, 166528,
+ 166535, 166542, 166549, 166556, 166563, 166570, 166577, 166584, 166591,
+ 166598, 166605, 166610, 166619, 166628, 166637, 166646, 166655, 166664,
+ 166673, 166682, 166693, 166704, 166711, 166718, 166725, 166732, 166739,
+ 166746, 166754, 166764, 166774, 166784, 166795, 166806, 166817, 166826,
+ 166835, 166844, 166849, 166854, 166859, 166864, 166875, 166886, 166897,
+ 166908, 166919, 166929, 166940, 166949, 166958, 166967, 166976, 166985,
+ 166993, 167002, 167013, 167024, 167035, 167046, 167057, 167069, 167082,
+ 167094, 167107, 167119, 167132, 167144, 167157, 167168, 167179, 167188,
+ 167196, 167205, 167216, 167227, 167239, 167252, 167266, 167281, 167293,
+ 167306, 167318, 167331, 167342, 167353, 167362, 167370, 167379, 167386,
+ 167393, 167400, 167407, 167414, 167421, 167428, 167435, 167442, 167449,
+ 167454, 167459, 167464, 167471, 167481, 167492, 167502, 167513, 167527,
+ 167542, 167557, 167571, 167586, 167601, 167612, 167623, 167636, 167649,
+ 167658, 167667, 167680, 167693, 167700, 167707, 167712, 167717, 167722,
+ 167727, 167732, 167739, 167748, 167753, 167756, 167761, 167768, 167775,
+ 167782, 167789, 167796, 167803, 167816, 167830, 167845, 167852, 167859,
+ 167866, 167875, 167883, 167891, 167900, 167905, 167910, 167915, 167920,
+ 167925, 167930, 167937, 167944, 167950, 167957, 167963, 167970, 167975,
+ 167980, 167985, 167990, 167995, 168002, 168009, 168014, 168021, 168028,
+ 168033, 168038, 168043, 168048, 168053, 168058, 168065, 168072, 168079,
+ 168082, 168087, 168092, 168097, 168102, 168109, 168116, 168124, 168132,
+ 168137, 168142, 168149, 168156, 168163, 168168, 168175, 168182, 168187,
+ 168194, 168201, 168208, 168215, 168222, 168229, 168238, 168247, 168254,
+ 168263, 168272, 168277, 168284, 168291, 168296, 168303, 168310, 168317,
+ 168324, 168331, 168336, 168343, 168350, 168359, 168366, 168375, 168386,
+ 168395, 168404, 168413, 168422, 168425, 168430, 168437, 168446, 168453,
+ 168462, 168469, 168474, 168479, 168482, 168485, 168488, 168495, 168502,
+ 168511, 168520, 168529, 168536, 168543, 168548, 168560, 168565, 168570,
+ 168575, 168580, 168585, 168590, 168595, 168600, 168603, 168608, 168613,
+ 168618, 168623, 168628, 168635, 168640, 168647, 168650, 168655, 168658,
+ 168661, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168664, 168669,
+ 168674, 168679, 168684, 0, 168689, 168694, 168699, 168704, 168709,
+ 168714, 168719, 168724, 168729, 168734, 168739, 168744, 168749, 168754,
+ 168759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168764, 168774, 168782, 168789, 168796,
+ 168805, 168814, 168823, 168830, 168844, 168856, 168866, 168874, 168886,
+ 168895, 168906, 168915, 168922, 168930, 168941, 168953, 168962, 168972,
+ 168984, 168995, 169004, 169015, 169027, 169035, 169046, 169055, 0, 0, 0,
+ 0, 0, 0, 169063, 169073, 169083, 169093, 169103, 169113, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 169123, 169128, 169133, 169138, 169143, 169148,
+ 169153, 0, 169158, 169163, 169168, 169174, 169178, 169183, 169188,
+ 169193, 169198, 169203, 169208, 169213, 169218, 169223, 169228, 169233,
+ 169238, 0, 0, 169243, 169248, 169253, 169258, 169263, 169268, 169273, 0,
+ 169278, 169283, 0, 169289, 169294, 169302, 169309, 169318, 0, 0, 0, 0, 0,
+ 169323, 169328, 169334, 169340, 169346, 169352, 169358, 169364, 169370,
+ 169375, 169380, 169386, 169392, 169397, 169403, 169409, 169415, 169421,
+ 169426, 169432, 169437, 169443, 169449, 169455, 169461, 169466, 169472,
+ 169478, 169484, 169491, 169497, 169504, 169511, 169517, 169523, 169530,
+ 169537, 169544, 169551, 169558, 169565, 169572, 169578, 169584, 169591,
+ 169597, 169604, 169611, 169617, 169624, 169630, 169637, 169644, 169651,
+ 169659, 169666, 169676, 169684, 169691, 169698, 169707, 169718, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 169727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 169734, 169741, 169749, 169757, 169765, 169772, 169779, 169787, 169795,
+ 169803, 169810, 169817, 169825, 169833, 169841, 169848, 169856, 169864,
+ 169872, 169880, 169888, 169896, 169904, 169911, 169919, 169926, 169934,
+ 169941, 169949, 169957, 169965, 169973, 169981, 169989, 169997, 170005,
+ 170013, 170020, 170028, 170035, 170042, 170049, 170057, 170064, 170072,
+ 0, 0, 0, 170080, 170087, 170094, 170101, 170108, 170115, 170122, 170129,
+ 170138, 170147, 170156, 170165, 170174, 170184, 0, 0, 170192, 170200,
+ 170207, 170214, 170221, 170228, 170235, 170242, 170249, 170256, 0, 0, 0,
+ 0, 170263, 170272, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170280,
+ 170284, 170289, 170294, 170299, 170303, 170308, 170312, 170316, 170321,
+ 170325, 170330, 170334, 170339, 170344, 170348, 170352, 170356, 170360,
+ 170366, 170371, 170378, 170382, 170386, 170392, 170397, 170404, 170408,
+ 170413, 170420, 170424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 170431, 170436, 170440, 170445, 170450, 170455, 170460, 170464,
+ 170469, 170473, 170477, 170481, 170486, 170491, 170496, 170500, 170505,
+ 170510, 170515, 170520, 170525, 170529, 170533, 170538, 170542, 170546,
+ 170551, 170555, 170559, 170563, 170568, 170572, 170577, 170582, 170587,
+ 170592, 170597, 170602, 170607, 170612, 170617, 170622, 170627, 170632,
+ 170637, 170642, 170647, 170652, 170657, 170662, 170666, 170670, 170674,
+ 170678, 170682, 170686, 170690, 170694, 0, 0, 0, 0, 0, 170698, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 170703, 170709, 170716, 170723, 170730, 170737, 170743,
+ 170750, 170757, 170764, 170771, 170777, 170784, 170791, 170798, 170805,
+ 170811, 170818, 170825, 170832, 170839, 170845, 170852, 170859, 170866,
+ 170873, 170880, 170887, 170894, 170901, 170908, 170915, 170922, 170929,
+ 170935, 170941, 170947, 170953, 170959, 170965, 170971, 170977, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 170983, 170987, 170991, 170995, 170999, 171003, 171007, 0,
+ 171011, 171017, 171021, 171025, 0, 171029, 171035, 0, 171041, 171047,
+ 171053, 171059, 171065, 171071, 171077, 171083, 171089, 171095, 171101,
+ 171107, 171113, 171119, 171125, 0, 171131, 171138, 171144, 171151,
+ 171158, 171165, 171172, 171179, 171186, 171193, 171200, 171207, 171214,
+ 171221, 171228, 171235, 171242, 171249, 171256, 171263, 171270, 171277,
+ 171284, 171291, 171298, 171305, 171312, 171319, 171326, 171333, 171340,
+ 171347, 171354, 171361, 171368, 171374, 171380, 171386, 171393, 171399,
+ 171406, 171412, 171419, 171426, 171433, 171440, 171447, 171454, 171460,
+ 171467, 171474, 171481, 171488, 171495, 171502, 171509, 171515, 171522,
+ 171529, 171536, 171543, 171550, 171558, 171565, 171572, 171579, 171586,
+ 171593, 171600, 171607, 171614, 171621, 171628, 171635, 171642, 171648,
+ 171655, 171662, 171669, 171676, 171683, 171690, 171697, 171705, 171712,
+ 171718, 171725, 171732, 171739, 171746, 171753, 171760, 171767, 171774,
+ 171781, 171788, 171795, 171802, 171809, 171816, 171823, 171830, 171837,
+ 171844, 171851, 171858, 171864, 171871, 171878, 171885, 171892, 171899,
+ 171906, 171913, 171920, 171927, 171934, 171941, 171948, 171955, 171962,
+ 171969, 171976, 171983, 171990, 171997, 172004, 172011, 172018, 172026,
+ 172034, 172042, 172049, 172056, 172063, 172070, 172077, 172084, 172091,
+ 172098, 172105, 172112, 172118, 172125, 172132, 172139, 172146, 172153,
+ 172160, 172167, 172174, 172181, 172188, 172195, 172202, 172209, 172216,
+ 172224, 172232, 172240, 172247, 172254, 172261, 172268, 172275, 172282,
+ 172289, 172296, 172303, 172310, 172317, 172324, 172331, 172338, 172344,
+ 172351, 172358, 172365, 172372, 172379, 172386, 172393, 172400, 172407,
+ 172414, 172421, 172428, 172435, 172442, 172449, 172456, 172463, 172470,
+ 172477, 172484, 172491, 172498, 0, 0, 172505, 172509, 172513, 172517,
+ 172521, 172525, 172529, 172533, 172537, 172541, 172547, 172553, 172559,
+ 172565, 172573, 172581, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 172587, 172593, 172599, 172605, 172611, 172617, 172623, 172629,
+ 172635, 172640, 172645, 172651, 172656, 172661, 172667, 172673, 172679,
+ 172685, 172691, 172696, 172701, 172707, 172713, 172718, 172724, 172730,
+ 172736, 172742, 172748, 172754, 172760, 172766, 172772, 172778, 172784,
+ 172790, 172796, 172802, 172808, 172814, 172820, 172826, 172832, 172837,
+ 172842, 172848, 172853, 172858, 172864, 172870, 172876, 172882, 172888,
+ 172893, 172898, 172904, 172910, 172915, 172921, 172927, 172933, 172939,
+ 172945, 172951, 172957, 172963, 172969, 172975, 172981, 172987, 172992,
+ 172997, 173001, 173006, 173013, 173017, 0, 0, 0, 0, 173022, 173027,
+ 173031, 173035, 173039, 173043, 173047, 173051, 173055, 173059, 0, 0, 0,
+ 0, 173063, 173069, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 173075, 173080, 173085, 173090, 173095, 173100,
+ 173105, 173110, 173115, 173120, 173126, 173132, 173138, 173144, 173150,
+ 173156, 173162, 173168, 173174, 173181, 173188, 173195, 173203, 173211,
+ 173219, 173227, 173235, 173243, 173249, 173255, 173261, 173268, 173275,
+ 173282, 173289, 173296, 173303, 173310, 173317, 173324, 173331, 173338,
+ 173345, 173352, 173359, 173366, 173372, 173378, 173384, 173390, 173396,
+ 173403, 173410, 173417, 173424, 173431, 173438, 173445, 173452, 173459,
+ 173464, 173472, 173480, 173488, 173494, 173501, 173508, 173517, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 173525, 173530, 173535, 173540, 173545, 173550, 173555, 173560,
+ 173565, 173570, 173576, 173582, 173588, 173594, 173600, 173606, 173612,
+ 173618, 173624, 173631, 173638, 173645, 173653, 173661, 173669, 173677,
+ 173685, 173693, 173699, 173705, 173711, 173718, 173725, 173732, 173739,
+ 173746, 173753, 173760, 173767, 173774, 173781, 173788, 173795, 173802,
+ 173809, 173816, 173821, 173828, 173835, 173842, 173849, 173856, 173863,
+ 173870, 173877, 173885, 173895, 173905, 173913, 173922, 173930, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173938, 173942, 173946,
+ 173950, 0, 173954, 173958, 173962, 173966, 173970, 173974, 173978,
+ 173982, 173986, 173990, 173994, 173998, 174002, 174006, 174010, 174014,
+ 174018, 174022, 174026, 174030, 174034, 174038, 174042, 174046, 174052,
+ 174058, 174064, 0, 174070, 174075, 0, 174080, 0, 0, 174085, 0, 174090,
+ 174095, 174100, 174105, 174110, 174115, 174120, 174125, 174130, 174135,
+ 0, 174140, 174145, 174150, 174155, 0, 174160, 0, 174165, 0, 0, 0, 0, 0,
+ 0, 174170, 0, 0, 0, 0, 174176, 0, 174182, 0, 174188, 0, 174194, 174200,
+ 174206, 0, 174212, 174218, 0, 174224, 0, 0, 174230, 0, 174236, 0, 174242,
+ 0, 174248, 0, 174256, 0, 174264, 174270, 0, 174276, 0, 0, 174282, 174288,
+ 174294, 174300, 0, 174306, 174312, 174318, 174324, 174330, 174336,
+ 174342, 0, 174348, 174354, 174360, 174366, 0, 174372, 174378, 174384,
+ 174390, 0, 174398, 0, 174406, 174412, 174418, 174424, 174430, 174436,
+ 174442, 174448, 174454, 174460, 0, 174466, 174472, 174478, 174484,
+ 174490, 174496, 174502, 174508, 174514, 174520, 174526, 174532, 174538,
+ 174544, 174550, 174556, 174562, 0, 0, 0, 0, 0, 174568, 174574, 174580, 0,
+ 174586, 174592, 174598, 174604, 174610, 0, 174616, 174622, 174628,
+ 174634, 174640, 174646, 174652, 174658, 174664, 174670, 174676, 174682,
+ 174688, 174694, 174700, 174706, 174712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174718, 174728, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 174736, 174743, 174750, 174757,
+ 174763, 174770, 174777, 174783, 174790, 174797, 174804, 174812, 174820,
+ 174828, 174836, 174844, 174852, 174859, 174866, 174873, 174881, 174889,
+ 174897, 174905, 174913, 174921, 174928, 174935, 174942, 174950, 174958,
+ 174966, 174974, 174982, 174990, 174995, 175000, 175005, 175010, 175015,
+ 175020, 175025, 175030, 175035, 0, 0, 0, 0, 175040, 175047, 175052,
+ 175057, 175062, 175067, 175072, 175077, 175082, 175087, 175092, 175097,
+ 175102, 175107, 175112, 175117, 175122, 175127, 175132, 175137, 175142,
+ 175147, 175152, 175157, 175162, 175167, 175172, 175177, 175182, 175187,
+ 175192, 175197, 175202, 175207, 175212, 175217, 175222, 175227, 175232,
+ 175237, 175242, 175247, 175252, 175257, 175262, 175267, 175272, 175277,
+ 175282, 175287, 175292, 175298, 175303, 175308, 175313, 175318, 175323,
+ 175328, 175333, 175338, 175343, 175348, 175353, 175358, 175363, 175368,
+ 175373, 175378, 175383, 175388, 175393, 175398, 175403, 175408, 175413,
+ 175418, 175423, 175428, 175433, 175438, 175443, 175448, 175453, 175458,
+ 175463, 175468, 175473, 175478, 175483, 175488, 175493, 175498, 175503,
+ 175508, 175513, 175518, 175523, 175528, 175533, 175538, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 175543, 175549, 175558, 175566, 175574, 175583, 175592,
+ 175601, 175610, 175619, 175628, 175637, 175646, 175655, 175664, 0, 0,
+ 175673, 175682, 175690, 175698, 175707, 175716, 175725, 175734, 175743,
+ 175752, 175761, 175770, 175779, 175788, 175797, 0, 175805, 175814,
+ 175822, 175830, 175839, 175848, 175857, 175866, 175875, 175884, 175893,
+ 175902, 175911, 175920, 175929, 0, 175936, 175945, 175953, 175961,
+ 175970, 175979, 175988, 175997, 176006, 176015, 176024, 176033, 176042,
+ 176051, 176060, 176067, 176073, 176079, 176085, 176091, 176097, 176103,
+ 176109, 176115, 176121, 176127, 176133, 176139, 176145, 176151, 176157,
+ 176163, 176169, 176175, 176181, 176187, 176193, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 176199, 176206, 176211, 176215, 176219, 176223, 176228, 176233,
+ 176238, 176243, 176248, 176253, 176260, 176269, 176275, 176279, 176288,
+ 176293, 176299, 176305, 176311, 176316, 176322, 176328, 176334, 176339,
+ 176345, 176351, 176356, 176362, 176368, 176373, 176379, 176385, 176390,
+ 176396, 176402, 176407, 176413, 176419, 176425, 176431, 176437, 176448,
+ 176455, 176461, 176464, 176467, 176470, 176475, 176481, 176487, 176493,
+ 176498, 176504, 176510, 176516, 176521, 176527, 176533, 176538, 176544,
+ 176550, 176555, 176561, 176567, 176572, 176578, 176584, 176589, 176595,
+ 176601, 176607, 176613, 176619, 176622, 176625, 176628, 176631, 176634,
+ 176637, 176644, 176652, 176660, 176668, 176675, 176683, 176691, 176699,
+ 176706, 176714, 176722, 176729, 176737, 176745, 176752, 176760, 176768,
+ 176775, 176783, 176791, 176798, 176806, 176814, 176822, 176830, 176838,
+ 176843, 176848, 176853, 176856, 176864, 176869, 176876, 176884, 176892,
+ 176900, 176907, 176915, 176923, 176931, 176938, 176946, 176954, 176961,
+ 176969, 176977, 176984, 176992, 177000, 177007, 177015, 177023, 177030,
+ 177038, 177046, 177054, 177062, 177070, 177080, 177085, 177089, 177093,
+ 177098, 177103, 177106, 177109, 177112, 177115, 177118, 177121, 177124,
+ 177127, 177130, 177136, 177139, 177143, 177148, 177152, 177157, 177162,
+ 177168, 177174, 177180, 177185, 177193, 177199, 177202, 177205, 177208,
+ 177211, 177214, 177217, 177220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177225, 177232,
+ 177240, 177248, 177256, 177263, 177271, 177279, 177287, 177294, 177302,
+ 177310, 177317, 177325, 177333, 177340, 177348, 177356, 177363, 177371,
+ 177379, 177386, 177394, 177402, 177410, 177418, 177426, 177431, 177435,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177438, 177444, 177450, 177456,
+ 177460, 177466, 177472, 177478, 177484, 177490, 177496, 177502, 177508,
+ 177514, 177520, 177526, 177532, 177538, 177544, 177550, 177556, 177562,
+ 177568, 177574, 177580, 177586, 177592, 177598, 177604, 177610, 177616,
+ 177622, 177628, 177634, 177640, 177646, 177652, 177658, 177664, 177670,
+ 177676, 177682, 177688, 177694, 0, 0, 0, 0, 177700, 177711, 177722,
+ 177733, 177744, 177755, 177766, 177777, 177788, 0, 0, 0, 0, 0, 0, 0,
+ 177799, 177804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177809, 177815,
+ 177821, 177827, 177833, 177839, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177845, 177847, 177849, 177853,
+ 177858, 177863, 177865, 177871, 177876, 177878, 177884, 177888, 177890,
+ 177894, 177900, 177906, 177912, 177917, 177922, 177929, 177936, 177943,
+ 177948, 177955, 177962, 177969, 177973, 177980, 177989, 177998, 178005,
+ 178010, 178014, 178018, 178020, 178023, 178026, 178033, 178040, 178050,
+ 178055, 178060, 178065, 178070, 178072, 178078, 178082, 178084, 178086,
+ 178088, 178090, 178094, 178098, 178102, 178104, 178108, 178110, 178114,
+ 178116, 178118, 178120, 178122, 178127, 178132, 178134, 178140, 178144,
+ 178148, 178156, 178158, 178160, 178162, 178164, 178166, 178168, 178170,
+ 178172, 178174, 178176, 178180, 178184, 178186, 178188, 178190, 178192,
+ 178194, 178199, 178205, 178209, 178213, 178217, 178221, 178226, 178230,
+ 178232, 178234, 178238, 178244, 178246, 178248, 178250, 178254, 178263,
+ 178269, 178273, 178277, 178279, 178281, 178284, 178286, 178288, 178290,
+ 178294, 178296, 178300, 178305, 178307, 178312, 178318, 178325, 178329,
+ 178333, 178337, 178341, 178347, 178351, 178359, 178366, 178368, 178370,
+ 178374, 178378, 178380, 178384, 178388, 178390, 178394, 178396, 178400,
+ 178404, 178408, 178412, 178416, 178420, 178424, 178428, 178434, 178438,
+ 178442, 178453, 178458, 178462, 178466, 178472, 178476, 178480, 178484,
+ 178491, 178498, 178502, 178506, 178510, 178514, 178518, 178525, 178527,
+ 178531, 178533, 178535, 178539, 178543, 178547, 178549, 178553, 178557,
+ 178561, 178565, 178569, 178571, 178575, 178577, 178583, 178586, 178591,
+ 178593, 178595, 178598, 178600, 178602, 178605, 178612, 178619, 178626,
+ 178631, 178635, 178637, 178639, 178641, 178645, 178647, 178651, 178655,
+ 178659, 178661, 178665, 178667, 178671, 178675, 178682, 178684, 178693,
+ 178702, 178711, 178717, 178719, 178724, 178728, 178732, 178734, 178740,
+ 178744, 178746, 178750, 178754, 178756, 178760, 178765, 178769, 178775,
+ 178781, 178783, 178785, 178791, 178793, 178797, 178801, 178803, 178807,
+ 178809, 178813, 178817, 178821, 178824, 178827, 178832, 178837, 178839,
+ 178842, 178844, 178851, 178855, 178857, 178864, 178871, 178878, 178885,
+ 178892, 178894, 178896, 178898, 178902, 178904, 178906, 178908, 178910,
+ 178912, 178914, 178916, 178918, 178920, 178922, 178924, 178926, 178928,
+ 178930, 178932, 178934, 178936, 178938, 178940, 178942, 178944, 178946,
+ 178950, 178952, 178954, 178956, 178960, 178962, 178966, 178968, 178970,
+ 178974, 178978, 178984, 178986, 178988, 178990, 178992, 178996, 179000,
+ 179002, 179006, 179010, 179014, 179018, 179022, 179026, 179030, 179034,
+ 179038, 179042, 179046, 179050, 179054, 179058, 179062, 179066, 179070,
+ 179074, 179076, 179078, 179080, 179082, 179084, 179086, 179088, 179096,
+ 179104, 179112, 179120, 179125, 179130, 179135, 179139, 179143, 179148,
+ 179153, 179155, 179159, 179161, 179163, 179165, 179167, 179169, 179171,
+ 179173, 179177, 179179, 179181, 179183, 179187, 179191, 179195, 179199,
+ 179203, 179205, 179211, 179217, 179219, 179221, 179223, 179225, 179227,
+ 179236, 179243, 179250, 179254, 179261, 179266, 179273, 179282, 179287,
+ 179291, 179295, 179297, 179301, 179303, 179307, 179311, 179313, 179317,
+ 179321, 179325, 179327, 179329, 179335, 179337, 179339, 179341, 179345,
+ 179349, 179351, 179355, 179357, 179359, 179362, 179366, 179368, 179372,
+ 179374, 179376, 179381, 179383, 179387, 179391, 179394, 179398, 179402,
+ 179406, 179410, 179414, 179418, 179422, 179427, 179431, 179435, 179444,
+ 179449, 179452, 179454, 179457, 179460, 179465, 179467, 179470, 179475,
+ 179479, 179482, 179486, 179490, 179493, 179498, 179502, 179506, 179510,
+ 179514, 179520, 179526, 179532, 179538, 179543, 179554, 179556, 179560,
+ 179562, 179564, 179568, 179572, 179574, 179578, 179584, 179589, 179595,
+ 179597, 179601, 179605, 179612, 179619, 179623, 179625, 179627, 179631,
+ 179633, 179637, 179641, 179645, 179647, 179649, 179656, 179660, 179664,
+ 179668, 179672, 179676, 179678, 179682, 179684, 179686, 179690, 179692,
+ 179696, 179700, 179706, 179710, 179714, 179718, 179720, 179723, 179727,
+ 179734, 179743, 179752, 179761, 179770, 179772, 179776, 179778, 179782,
+ 179793, 179797, 179803, 179809, 179814, 179816, 179821, 179825, 179827,
+ 179829, 179831, 179835, 179839, 179843, 179848, 179859, 179875, 179888,
+ 179901, 179905, 179909, 179915, 179917, 179925, 179933, 179935, 179939,
+ 179945, 179951, 179958, 179965, 179967, 179969, 179973, 179975, 179981,
+ 179983, 179986, 179990, 179996, 180002, 180013, 180019, 180026, 180034,
+ 180038, 180046, 180054, 180060, 180066, 180073, 180075, 180079, 180081,
+ 180083, 180088, 180090, 180092, 180094, 180096, 180100, 180110, 180116,
+ 180120, 180124, 180128, 180134, 180140, 180146, 180152, 180157, 180162,
+ 180168, 180174, 180181, 180188, 180195, 180202, 180207, 180215, 180219,
+ 180228, 180237, 180243, 180247, 180251, 180255, 180258, 180263, 180265,
+ 180267, 180269, 180276, 180281, 180288, 180295, 180302, 180310, 180318,
+ 180326, 180334, 180342, 180350, 180358, 180366, 180374, 180380, 180386,
+ 180392, 180398, 180404, 180410, 180416, 180422, 180428, 180434, 180440,
+ 180446, 180449, 180458, 180467, 180469, 180476, 180480, 180482, 180484,
+ 180488, 180494, 180498, 180500, 180510, 180516, 180520, 180522, 180526,
+ 180528, 180532, 180539, 180546, 180553, 180558, 180563, 180572, 180578,
+ 180583, 180587, 180592, 180596, 180603, 180607, 180610, 180614, 180620,
+ 180626, 180630, 180634, 180639, 180645, 180654, 180665, 180671, 180677,
+ 180683, 180693, 180708, 180717, 180725, 180733, 180741, 180749, 180757,
+ 180765, 180773, 180781, 180789, 180797, 180805, 180813, 180816, 180820,
+ 180825, 180830, 180832, 180836, 180845, 180854, 180862, 180866, 180870,
+ 180875, 180880, 180885, 180887, 180892, 180896, 180898, 180902, 180906,
+ 180912, 180917, 180925, 180930, 180935, 180940, 180947, 180950, 180952,
+ 180956, 180961, 180967, 180971, 180975, 180981, 180987, 180989, 180993,
+ 180997, 181001, 181005, 181009, 181011, 181013, 181015, 181017, 181023,
+ 181029, 181033, 181035, 181037, 181039, 181048, 181052, 181059, 181066,
+ 181068, 181071, 181075, 181081, 181085, 181089, 181091, 181099, 181103,
+ 181107, 181112, 181116, 181121, 181126, 181131, 181136, 181141, 181146,
+ 181151, 181156, 181160, 181166, 181170, 181176, 181181, 181188, 181194,
+ 181202, 181206, 181213, 181217, 181221, 181225, 181230, 181235, 181237,
+ 181241, 181250, 181258, 181267, 181281, 181295, 181309, 181316, 181323,
+ 181327, 181336, 181344, 181348, 181357, 181364, 181368, 181372, 181376,
+ 181380, 181387, 181391, 181395, 181399, 181403, 181410, 181419, 181428,
+ 181435, 181447, 181459, 181463, 181467, 181471, 181475, 181479, 181483,
+ 181491, 181499, 181508, 181512, 181516, 181520, 181524, 181528, 181532,
+ 181538, 181545, 181549, 181561, 181569, 181573, 181577, 181581, 181585,
+ 181591, 181598, 181609, 181619, 181630, 181641, 181650, 181661, 181667,
+ 181673, 181679, 181685, 181691, 181695, 181702, 181711, 181718, 181724,
+ 181728, 181732, 181736, 181745, 181757, 181761, 181768, 181775, 181782,
+ 181790, 181797, 181805, 181813, 181822, 181830, 181839, 181848, 181858,
+ 181867, 181877, 181887, 181898, 181908, 181919, 181926, 181934, 181941,
+ 181949, 181957, 181966, 181974, 181983, 181990, 182002, 182009, 182021,
+ 182024, 182028, 182031, 182035, 182041, 182048, 182055, 182063, 182068,
+ 182074, 182085, 182095, 182106, 182111, 182116, 182122, 182127, 182134,
+ 182138, 182144, 182146, 182148, 182152, 182156, 182160, 182169, 182171,
+ 182173, 182176, 182178, 182180, 182184, 182186, 182190, 182192, 182196,
+ 182198, 182200, 182204, 182208, 182214, 182216, 182220, 182222, 182226,
+ 182230, 182234, 182238, 182240, 182242, 182246, 182250, 182254, 182258,
+ 182260, 182262, 182264, 182270, 182275, 182278, 182286, 182294, 182296,
+ 182301, 182304, 182309, 182320, 182327, 182332, 182337, 182339, 182343,
+ 182345, 182349, 182351, 182355, 182359, 182362, 182365, 182367, 182370,
+ 182372, 182376, 182378, 182380, 182382, 182386, 182388, 182392, 182395,
+ 182402, 182405, 182410, 182413, 182416, 182421, 182425, 182429, 182433,
+ 182435, 182440, 182443, 182447, 182449, 182451, 182455, 182457, 0, 0, 0,
+ 0, 182459, 182461, 182465, 182467, 182471, 182476, 182478, 182482,
+ 182484, 182488, 182492, 182498, 182502, 182507, 182510, 182514, 182518,
+ 0, 0, 0, 182522, 182524, 182530, 182534, 182538, 182540, 182544, 182546,
+ 182548, 182552, 182554, 182558, 182562, 0, 0, 0, 182566, 182571, 182576,
+ 182581, 182586, 182591, 182596, 182603, 182610, 182617, 182624, 182629,
+ 182634, 182639, 182644, 182651, 182657, 182664, 182671, 182678, 182683,
+ 182688, 182693, 182698, 182703, 182710, 182717, 182722, 182727, 182734,
+ 182741, 182749, 182757, 182764, 182771, 182779, 182787, 182795, 182802,
+ 182812, 182823, 182828, 182835, 182842, 182849, 182857, 182865, 182876,
+ 182884, 182892, 182900, 182905, 182910, 182915, 182920, 182925, 182930,
+ 182935, 182940, 182945, 182950, 182955, 182960, 182967, 182972, 182977,
+ 182984, 182989, 182994, 182999, 183004, 183009, 183014, 183019, 183024,
+ 183029, 183034, 183039, 183044, 183051, 183059, 183064, 183069, 183076,
+ 183081, 183086, 183091, 183098, 183103, 183110, 183115, 183122, 183127,
+ 183136, 183145, 183150, 183155, 183160, 183165, 183170, 183175, 183180,
+ 183185, 183190, 183195, 183200, 183205, 183210, 183218, 183226, 183231,
+ 183236, 183241, 183246, 183251, 183257, 183263, 183268, 183270, 0, 0, 0,
+ 0, 183274, 183276, 183278, 183280, 183282, 183284, 183292, 183300,
+ 183308, 183316, 183322, 183328, 183332, 183336, 183342, 183348, 183357,
+ 183361, 183366, 183372, 183376, 183381, 183385, 183389, 183395, 183401,
+ 183411, 183420, 183423, 183428, 183434, 183440, 183451, 183461, 183465,
+ 183470, 183476, 183482, 183491, 183496, 183500, 183505, 183509, 183515,
+ 183521, 183527, 183531, 183534, 183538, 183541, 183544, 183549, 183554,
+ 183561, 183569, 183576, 183583, 183592, 183601, 183608, 183616, 183623,
+ 183630, 183639, 183648, 183655, 183663, 183670, 183677, 183686, 183693,
+ 183701, 183707, 183716, 183724, 183733, 183740, 183750, 183761, 183769,
+ 183777, 183786, 183794, 183802, 183811, 183819, 183829, 183838, 183846,
+ 183854, 183863, 183866, 183871, 183874, 183879, 0, 0, 0, 0, 0, 0, 183886,
+ 183892, 183898, 183904, 183910, 183916, 183922, 183928, 183934, 183940,
+ 183946, 183952, 0, 0, 0, 0, 183958, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 183962, 183970, 183979, 183987, 183996, 184005, 184015, 184024,
+ 184034, 184043, 184053, 184062, 0, 0, 0, 0, 184072, 184080, 184089,
+ 184097, 184106, 184113, 184121, 184128, 184136, 184144, 184153, 184161,
+ 184170, 184180, 184191, 184201, 184212, 184221, 184231, 184240, 184250,
+ 184259, 184269, 184278, 184288, 184296, 184305, 184313, 184322, 184330,
+ 184339, 184347, 184356, 184366, 184377, 184387, 184398, 184402, 184407,
+ 184411, 184416, 184419, 184423, 184426, 184430, 184434, 184439, 184443,
+ 184448, 184453, 184459, 184464, 184470, 184473, 184477, 184480, 0, 0, 0,
+ 0, 0, 0, 0, 0, 184484, 184487, 184491, 184494, 184498, 184503, 184508,
+ 184514, 184520, 184524, 0, 0, 0, 0, 0, 0, 184528, 184534, 184541, 184547,
+ 184554, 184562, 184570, 184579, 184588, 184593, 184599, 184604, 184610,
+ 184617, 184624, 184632, 184640, 184647, 184655, 184662, 184670, 184679,
+ 184688, 184698, 184708, 184714, 184721, 184727, 184734, 184742, 184750,
+ 184759, 184768, 184776, 184785, 184793, 184802, 184812, 184822, 184833,
+ 0, 0, 0, 0, 0, 0, 0, 0, 184844, 184849, 184855, 184860, 184866, 184875,
+ 184885, 184894, 184904, 184911, 184919, 184926, 184934, 184941, 184950,
+ 184959, 184968, 184973, 184980, 184987, 184994, 184999, 185004, 185009,
+ 185014, 185021, 185028, 185035, 185042, 185049, 0, 0, 185058, 185068, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 185080, 185090, 185099, 185104, 185113, 185121, 185129,
+ 185136, 185140, 185145, 185152, 185161, 185172, 185176, 185179, 185183,
+ 185187, 185191, 185195, 185200, 185204, 185208, 185213, 185217, 185221,
+ 185227, 185233, 185240, 185244, 185248, 185250, 185260, 185269, 185276,
+ 185280, 185284, 185294, 185298, 185302, 185306, 185310, 185318, 185327,
+ 185340, 185351, 185362, 185378, 185387, 185396, 185400, 185402, 185407,
+ 185409, 185411, 185417, 185421, 185423, 185429, 185431, 185433, 185437,
+ 185439, 185443, 185445, 185449, 185453, 185458, 185462, 185466, 185468,
+ 185472, 185474, 185480, 185486, 185492, 185496, 185502, 185506, 185513,
+ 185515, 185519, 185521, 185523, 185525, 185527, 185529, 185531, 185535,
+ 185539, 185546, 185550, 185552, 185557, 185559, 185561, 185563, 185565,
+ 185569, 185573, 185575, 185580, 185585, 185587, 185589, 185591, 185593,
+ 185598, 185600, 185604, 185608, 185610, 185614, 185616, 185629, 185633,
+ 185640, 185652, 185664, 185668, 185672, 185674, 185678, 185686, 185693,
+ 185695, 185699, 185701, 185705, 185709, 185711, 185715, 185717, 185719,
+ 185723, 185725, 185727, 185729, 185731, 185733, 185737, 185739, 185741,
+ 185743, 185745, 185747, 185749, 185751, 185755, 185759, 185761, 185763,
+ 185765, 185767, 185769, 185771, 185773, 185775, 185777, 185779, 185781,
+ 185783, 185785, 185787, 185789, 185791, 185793, 185795, 185797, 185799,
+ 185801, 185803, 185805, 185807, 185809, 185811, 185815, 185819, 185827,
+ 185835, 185841, 185848, 185850, 185852, 185854, 185856, 185858, 185860,
+ 185864, 185871, 185875, 185879, 185883, 185887, 185891, 185893, 185897,
+ 185901, 185903, 185905, 185907, 185909, 185911, 185915, 185919, 185923,
+ 185925, 185929, 185933, 185937, 185942, 185944, 185946, 185950, 185954,
+ 185959, 185967, 185971, 185979, 185981, 185983, 185985, 185987, 185989,
+ 185991, 185993, 185995, 185999, 186003, 186005, 186007, 186009, 186011,
+ 186017, 186019, 186025, 186029, 186033, 186038, 186040, 186042, 186046,
+ 186048, 186050, 186052, 186054, 186058, 186063, 186068, 186072, 186076,
+ 186078, 186080, 186085, 186090, 186092, 186094, 186098, 186104, 186110,
+ 186116, 186122, 186128, 186134, 186145, 186156, 186168, 186179, 186190,
+ 186201, 186212, 186223, 186234, 186245, 186256, 186267, 186278, 186289,
+ 186300, 186312, 186324, 186336, 186348, 186360, 186372, 186386, 186400,
+ 186415, 186421, 186427, 186433, 186439, 186445, 186451, 186457, 186463,
+ 186469, 186475, 186481, 186487, 186494, 186501, 186508, 186515, 186522,
+ 186529, 186543, 186557, 186572, 186586, 186600, 186614, 186628, 186642,
+ 186656, 186670, 186684, 186698, 186712, 186726, 186740, 186755, 186770,
+ 186785, 186800, 186815, 186830, 186844, 186858, 186873, 186878, 186883,
+ 186889, 186900, 186911, 186923, 186928, 186933, 186938, 186943, 186948,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186953, 186959, 186965, 186971,
+ 186977, 186983, 186989, 186995, 187000, 187005, 187010, 187015, 187020,
+ 187025, 0, 0, 187030, 187034, 187038, 187040, 187042, 187046, 187051,
+ 187055, 187059, 187064, 187068, 187070, 187072, 0, 0, 0, 187074, 187076,
+ 187078, 187080, 187082, 187086, 187088, 187092, 187094, 0, 0, 0, 0, 0, 0,
+ 0, 187096, 187100, 187102, 187104, 187106, 187110, 187112, 187116,
+ 187118, 187121, 187123, 187127, 187129, 187131, 187132, 187134, 187136,
+ 187138, 187142, 187144, 187146, 187150, 187152, 187154, 187156, 187158,
+ 187162, 187166, 187169, 187171, 187177, 187181, 187183, 187185, 187187,
+ 187189, 187191, 187195, 187197, 187199, 187201, 187203, 187207, 187212,
+ 187214, 187216, 0, 187218, 187220, 187224, 187226, 187230, 187234,
+ 187238, 0, 0, 0, 0, 0, 0, 0, 0, 187243, 187245, 187247, 187249, 187253,
+ 187255, 187257, 187259, 187261, 187263, 187267, 187269, 187271, 187275,
+ 0, 0, 0, 0, 187279, 187283, 187287, 187300, 187307, 187314, 187320,
+ 187324, 187326, 0, 0, 0, 0, 0, 0, 0, 187330, 187340, 187343, 187346,
+ 187351, 187356, 187365, 187369, 187374, 0, 0, 0, 0, 0, 0, 0, 187379,
+ 187382, 187385, 187388, 187391, 187394, 187397, 187400, 187403, 187406,
+ 187409, 187412, 187415, 187418, 187421, 187424, 187427, 187430, 187433,
+ 187436, 187439, 187442, 187445, 187448, 187451, 187454, 187457, 187460,
+ 187463, 187466, 187469, 187472, 187475, 187478, 187481, 187484, 187487,
+ 187490, 187493, 187496, 187499, 187502, 187505, 187508, 187511, 187514,
+ 187517, 187520, 187523, 187526, 187529, 187532, 187535, 187538, 187541,
+ 187544, 187547, 187550, 187553, 187556, 187559, 187571, 187582, 187594,
+ 187605, 187616, 187628, 187639, 187651, 187662, 187673, 187685, 187697,
+ 187708, 187720, 187731, 187742, 187754, 187765, 187777, 187788, 187799,
+ 187811, 187823, 187834, 187846, 187857, 187868, 187880, 187891, 187903,
+ 187914, 187925, 187937, 187949, 187960, 187972, 187983, 187994, 188006,
+ 188017, 188029, 188040, 188051, 188063, 188075, 188087, 188099, 188111,
+ 188119, 188127, 188135, 188143, 188149, 188155, 188161, 188167, 188173,
+ 188179, 188186, 188193, 188200, 188207, 188214, 188221, 188229, 188237,
+ 188245, 188253, 188261, 188268, 188274, 188280, 188287, 188293, 188300,
+ 188306, 188312, 188319, 188325, 188332, 188338, 188344, 188350, 188356,
+ 188362, 188374, 0, 188387, 188400, 188406, 188414, 188419, 188426,
+ 188433, 188441, 188449, 188457, 188465, 188473, 188481, 188493, 188504,
+ 188515, 188526, 188541, 188556, 188570, 188584, 188602, 188620, 188639,
+ 188657, 188675, 188693, 188700, 188708, 188712, 188717, 188723, 188729,
+ 188739, 188750, 188761, 188771, 188781, 188785, 188789, 188794, 188800,
+ 188806, 188816, 188822, 188831, 188840, 188849, 188858, 188864, 188868,
+ 188877, 188885, 188892, 188899, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 188904, 188909, 188913, 188917, 188921, 188925, 188929, 188933, 188937,
+ 188941, 0, 0, 0, 0, 0, 0, 188945, 188949, 188953, 188957, 188961, 188965,
+ 188969, 188973, 188977, 188981, 188985, 188989, 188993, 188997, 189001,
+ 189005, 189009, 189013, 189017, 189021, 189025, 189029, 189033, 189037,
+ 189041, 189045, 189049, 189053, 189057, 189061, 189065, 189069, 189073,
+ 189077, 189081, 189085, 189089, 189093, 189097, 189101, 189105, 189109,
+ 189113, 189117, 189121, 189125, 189129, 189133, 189137, 189141, 189145,
+ 189149, 189153, 189157, 189161, 189165, 189169, 189173, 189177, 189181,
+ 189185, 189189, 189193, 189197, 189201, 189205, 189209, 189213, 189217,
+ 189221, 189225, 189229, 189233, 189237, 189241, 189245, 189249, 189253,
+ 189257, 189261, 189265, 189269, 189273, 189277, 189281, 189285, 189289,
+ 189293, 189297, 189301, 189305, 189309, 189313, 189317, 189321, 189325,
+ 189329, 189333, 189337, 189341, 189345, 189349, 189353, 189357, 189361,
+ 189365, 189369, 189373, 189377, 189381, 189385, 189389, 189393, 189397,
+ 189401, 189405, 189409, 189413, 189417, 189421, 189425, 189429, 189433,
+ 189437, 189441, 189445, 189449, 189453, 189457, 189461, 189465, 189469,
+ 189473, 189477, 189481, 189485, 189489, 189493, 189497, 189501, 189505,
+ 189509, 189513, 189517, 189521, 189525, 189529, 189533, 189537, 189541,
+ 189545, 189549, 189553, 189557, 189561, 189565, 189569, 189573, 189577,
+ 189581, 189585, 189589, 189593, 189597, 189601, 189605, 189609, 189613,
+ 189617, 189621, 189625, 189629, 189633, 189637, 189641, 189645, 189649,
+ 189653, 189657, 189661, 189665, 189669, 189673, 189677, 189681, 189685,
+ 189689, 189693, 189697, 189701, 189705, 189709, 189713, 189717, 189721,
+ 189725, 189729, 189733, 189737, 189741, 189745, 189749, 189753, 189757,
+ 189761, 189765, 189769, 189773, 189777, 189781, 189785, 189789, 189793,
+ 189797, 189801, 189805, 189809, 189813, 189817, 189821, 189825, 189829,
+ 189833, 189837, 189841, 189845, 189849, 189853, 189857, 189861, 189865,
+ 189869, 189873, 189877, 189881, 189885, 189889, 189893, 189897, 189901,
+ 189905, 189909, 189913, 189917, 189921, 189925, 189929, 189933, 189937,
+ 189941, 189945, 189949, 189953, 189957, 189961, 189965, 189969, 189973,
+ 189977, 189981, 189985, 189989, 189993, 189997, 190001, 190005, 190009,
+ 190013, 190017, 190021, 190025, 190029, 190033, 190037, 190041, 190045,
+ 190049, 190053, 190057, 190061, 190065, 190069, 190073, 190077, 190081,
+ 190085, 190089, 190093, 190097, 190101, 190105, 190109, 190113, 190117,
+ 190121, 190125, 190129, 190133, 190137, 190141, 190145, 190149, 190153,
+ 190157, 190161, 190165, 190169, 190173, 190177, 190181, 190185, 190189,
+ 190193, 190197, 190201, 190205, 190209, 190213, 190217, 190221, 190225,
+ 190229, 190233, 190237, 190241, 190245, 190249, 190253, 190257, 190261,
+ 190265, 190269, 190273, 190277, 190281, 190285, 190289, 190293, 190297,
+ 190301, 190305, 190309, 190313, 190317, 190321, 190325, 190329, 190333,
+ 190337, 190341, 190345, 190349, 190353, 190357, 190361, 190365, 190369,
+ 190373, 190377, 190381, 190385, 190389, 190393, 190397, 190401, 190405,
+ 190409, 190413, 190417, 190421, 190425, 190429, 190433, 190437, 190441,
+ 190445, 190449, 190453, 190457, 190461, 190465, 190469, 190473, 190477,
+ 190481, 190485, 190489, 190493, 190497, 190501, 190505, 190509, 190513,
+ 190517, 190521, 190525, 190529, 190533, 190537, 190541, 190545, 190549,
+ 190553, 190557, 190561, 190565, 190569, 190573, 190577, 190581, 190585,
+ 190589, 190593, 190597, 190601, 190605, 190609, 190613, 190617, 190621,
+ 190625, 190629, 190633, 190637, 190641, 190645, 190649, 190653, 190657,
+ 190661, 190665, 190669, 190673, 190677, 190681, 190685, 190689, 190693,
+ 190697, 190701, 190705, 190709, 190713, 190717, 190721, 190725, 190729,
+ 190733, 190737, 190741, 190745, 190749, 190753, 190757, 190761, 190765,
+ 190769, 190773, 190777, 190781, 190785, 190789, 190793, 190797, 190801,
+ 190805, 190809, 190813, 190817, 190821, 190825, 190829, 190833, 190837,
+ 190841, 190845, 190849, 190853, 190857, 190861, 190865, 190869, 190873,
+ 190877, 190881, 190885, 190889, 190893, 190897, 190901, 190905, 190909,
+ 190913, 190917, 190921, 190925, 190929, 190933, 190937, 190941, 190945,
+ 190949, 190953, 190957, 190961, 190965, 190969, 190973, 190977, 190981,
+ 190985, 190989, 190993, 190997, 191001, 191005, 191009, 191013, 191017,
+ 191021, 191025, 191029, 191033, 191037, 191041, 191045, 191049, 191053,
+ 191057, 191061, 191065, 191069, 191073, 191077, 191081, 191085, 191089,
+ 191093, 191097, 191101, 191105, 191109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191113, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 191117, 191121, 191126, 191131, 191135, 191140, 191145, 191149, 191153,
+ 191158, 191163, 191167, 191171, 191175, 191179, 191185, 191189, 191194,
+ 191198, 191202, 191206, 191210, 191214, 191218, 191222, 191226, 191230,
+ 191234, 191238, 191243, 191248, 191253, 191258, 191264, 191270, 191277,
+ 191284, 191291, 191297, 191304, 191311, 191318, 191324, 191331, 191338,
+ 191344, 191351, 191358, 191364, 191371, 191378, 191384, 191391, 191398,
+ 191404, 191411, 191418, 191425, 191432, 191439, 191445, 191451, 191457,
+ 191463, 191468, 191474, 191480, 191487, 191494, 191501, 191507, 191514,
+ 191521, 191528, 191534, 191541, 191548, 191554, 191561, 191568, 191574,
+ 191581, 191588, 191594, 191601, 191608, 191614, 191621, 191628, 191635,
+ 191642, 191649, 191656, 191661, 191668, 191672, 191676, 191679, 191682,
+ 191685, 191688, 191691, 191694, 191697, 191700, 191703, 191706, 191709,
+ 191712, 191715, 191718, 191721, 191724, 191727, 191730, 191733, 191736,
+ 191739, 191742, 191745, 191748, 191751, 191754, 191757, 191760, 191763,
+ 191766, 191769, 191772, 191775, 191778, 191781, 191784, 191787, 191790,
+ 191793, 191796, 191799, 191802, 191805, 191808, 191811, 191814, 191817,
+ 191820, 191823, 191826, 191829, 191832, 191835, 191838, 191841, 191844,
+ 191847, 191850, 191853, 191856, 191859, 191862, 191865, 191868, 191871,
+ 191874, 191877, 191880, 191883, 191886, 191889, 191892, 191895, 191898,
+ 191901, 191904, 191907, 191910, 191913, 191916, 191919, 191922, 191925,
+ 191928, 191931, 191934, 191937, 191940, 191943, 191946, 191949, 191952,
+ 191955, 191958, 191961, 191964, 191967, 191970, 191973, 191976, 191979,
+ 191982, 191985, 191988, 191991, 191994, 191997, 192000, 192003, 192006,
+ 192009, 192012, 192015, 192018, 192021, 192024, 192027, 192030, 192033,
+ 192036, 192039, 192042, 192045, 192048, 192051, 192054, 192057, 192060,
+ 192063, 192066, 192069, 192072, 192075, 192078, 192081, 192084, 192087,
+ 192090, 192093, 192096, 192099, 192102, 192105, 192108, 192111, 192114,
+ 192117, 192120, 192123, 192126, 192129, 192132, 192135, 192138, 192141,
+ 192144, 192147, 192150, 192153, 192156, 192159, 192162, 192165, 192168,
+ 192171, 192174, 192177, 192180, 192183, 192186, 192189, 192192, 192195,
+ 192198, 192201, 192204, 192207, 192210, 192213, 192216, 192219, 192222,
+ 192225, 192228, 192231, 192234, 192237, 192240, 192243, 192246, 192249,
+ 192252, 192255, 192258, 192261, 192264, 192267, 192270, 192273, 192276,
+ 192279, 192282, 192285, 192288, 192291, 192294, 192297, 192300, 192303,
+ 192306, 192309, 192312, 192315, 192318, 192321, 192324, 192327, 192330,
+ 192333, 192336, 192339, 192342, 192345, 192348, 192351, 192354, 192357,
+ 192360, 192363, 192366, 192369, 192372, 192375, 192378, 192381, 192384,
+ 192387, 192390, 192393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 192396, 192398, 192400, 192405, 192407, 192412, 192414, 192419, 192421,
+ 192426, 192428, 192430, 192432, 192434, 192436, 192438, 192440, 192442,
+ 192444, 192448, 192452, 192454, 192456, 192460, 192464, 192469, 192471,
+ 192473, 192475, 192479, 192482, 192484, 192488, 192490, 192494, 192496,
+ 192500, 192503, 192505, 192509, 192513, 192515, 192521, 192523, 192528,
+ 192530, 192535, 192537, 192542, 192544, 192549, 192551, 192555, 192557,
+ 192561, 192563, 192570, 192572, 192574, 192576, 192581, 192583, 192585,
+ 192587, 192589, 192591, 192593, 192598, 192602, 192604, 192609, 192613,
+ 192615, 192620, 192624, 192626, 192631, 192635, 192637, 192639, 192641,
+ 192643, 192647, 192649, 192654, 192656, 192662, 192664, 192670, 192672,
+ 192674, 192676, 192680, 192682, 192689, 192691, 192698, 192700, 192706,
+ 192712, 192714, 192721, 192728, 192730, 192736, 192741, 192743, 192749,
+ 192755, 192757, 192763, 192769, 192771, 192777, 192781, 192783, 192788,
+ 192790, 192792, 192797, 192799, 192801, 192807, 192809, 192814, 192818,
+ 192820, 192825, 192829, 192831, 192837, 192839, 192843, 192845, 192849,
+ 192851, 192858, 192865, 192867, 192874, 192881, 192883, 192888, 192890,
+ 192898, 192900, 192906, 192908, 192914, 192916, 192920, 192922, 192928,
+ 192930, 192934, 192936, 192942, 192944, 192946, 192948, 192953, 192958,
+ 192960, 192969, 192971, 192981, 192986, 192993, 193000, 193005, 193010,
+ 193022, 193026, 193030, 193034, 193038, 193040, 193042, 193044, 193046,
+ 193048, 193054, 193056, 193058, 193060, 193062, 193064, 193066, 193068,
+ 193070, 193072, 193074, 193076, 193078, 193080, 193082, 193084, 193086,
+ 193088, 193094, 193101, 193106, 193114, 193122, 193127, 193133, 193135,
+ 193137, 193139, 193141, 193143, 193145, 193147, 193149, 193151, 193153,
+ 193155, 193157, 193159, 193161, 193163, 193165, 193177, 193182, 193184,
+ 193186, 193192, 193204, 193210, 193216, 193222, 193228, 193232, 193243,
+ 193245, 193247, 193249, 193251, 193253, 193255, 193257, 193259, 193261,
+ 193263, 193265, 193267, 193269, 193271, 193273, 193275, 193277, 193279,
+ 193281, 193283, 193285, 193287, 193289, 193291, 193293, 193295, 193297,
+ 193299, 193301, 193303, 193305, 193307, 193309, 193311, 193313, 193315,
+ 193317, 193319, 193321, 193323, 193325, 193327, 193329, 193331, 193333,
+ 193335, 193337, 193339, 193341, 193343, 193345, 193347, 193349, 193351,
+ 193353, 193355, 193357, 193359, 193361, 193363, 193365, 193367, 193369,
+ 193371, 193373, 193375, 193377, 193379, 193381, 193383, 193385, 193387,
+ 193389, 193391, 193393, 193395, 193397, 193399, 193401, 193403, 193405,
+ 193407, 193409, 193411, 193413, 193415, 193417, 193419, 193421, 193423,
+ 193425, 193427, 193429, 193431, 193433, 193435, 193437, 193439, 193441,
+ 193443, 193445, 193447, 193449, 193451, 193453, 193455, 193457, 193459,
+ 193461, 193463, 193465, 193467, 193469, 193471, 193473, 193475, 193477,
+ 193479, 193481, 193483, 193485, 193487, 193489, 193491, 193493, 193495,
+ 193497, 193499, 193501, 193503, 193505, 193507, 193509, 193511, 193513,
+ 193515, 193517, 193519, 193521, 193523, 193525, 193527, 193529, 193531,
+ 193533, 193535, 193537, 193539, 193541, 193543, 193545, 193547, 193549,
+ 193551, 193553, 193555, 193557, 193559, 193561, 193563, 193565, 193567,
+ 193569, 193571, 193573, 193575, 193577, 193579, 193581, 193583, 193585,
+ 193587, 193589, 193591, 193593, 193595, 193597, 193599, 193601, 193603,
+ 193605, 193607, 193609, 193611, 193613, 193615, 193617, 193619, 193621,
+ 193623, 193625, 193627, 193629, 193631, 193633, 193635, 193637, 193639,
+ 193641, 193643, 193645, 193647, 193649, 193651, 193653, 193655, 193657,
+ 193659, 193661, 193663, 193665, 193667, 193669, 193671, 193673, 193675,
+ 193677, 193679, 193681, 193683, 193685, 193687, 193689, 193691, 193693,
+ 193695, 193697, 193699, 193701, 193703, 193705, 193707, 193709, 193711,
+ 193713, 193715, 193717, 193719, 193721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 193723, 193727, 193731, 193736, 193740, 193744, 193748,
+ 193752, 193756, 193760, 193764, 193768, 193772, 193782, 193792, 193803,
+ 193814, 193824, 193834, 193844, 193854, 193868, 193882, 193896, 193910,
+ 193919, 193928, 193941, 193954, 193967, 193980, 193990, 194000, 194011,
+ 194022, 194033, 194044, 194055, 194064, 194074, 194084, 194094, 194104,
+ 194115, 194126, 194137, 194148, 194159, 194170, 194181, 194192, 194203,
+ 194214, 194225, 194239, 194250, 194264, 194272, 194283, 194291, 194299,
+ 194307, 194315, 194323, 194331, 194341, 194351, 194361, 194371, 194381,
+ 194391, 194401, 194411, 194419, 194428, 194437, 194446, 194455, 194463,
+ 194471, 194481, 194491, 194502, 194513, 194525, 194536, 194546, 194557,
+ 194567, 194578, 194586, 194593, 194600, 194607, 194614, 194621, 194628,
+ 194635, 194642, 194650, 194658, 194666, 194674, 194682, 194690, 194698,
+ 194706, 194714, 194722, 194730, 194735, 194739, 194743, 194747, 194751,
+ 194755, 194759, 194763, 194767, 194771, 194775, 194779, 194782, 194785,
+ 194789, 194793, 194797, 194801, 194805, 194809, 194813, 194817, 194821,
+ 194825, 194829, 194833, 194837, 194841, 194845, 194849, 194853, 194857,
+ 194861, 194865, 194869, 194873, 194877, 194881, 194885, 194889, 194893,
+ 194897, 194901, 194905, 194909, 194913, 194917, 194921, 194925, 194929,
+ 194933, 194937, 194941, 194945, 194949, 194953, 194957, 194961, 194965,
+ 194969, 194973, 194977, 194981, 194985, 194989, 194993, 194997, 195001,
+ 195005, 195009, 195013, 195017, 195021, 195025, 195029, 195033, 195037,
+ 195041, 195045, 195049, 195053, 195057, 195061, 195065, 195069, 195073,
+ 195077, 195081, 195085, 195089, 195093, 195097, 195101, 195105, 195109,
+ 195113, 195117, 195121, 195125, 195128, 195132, 195136, 195140, 195144,
+ 195148, 195152, 195156, 195160, 195164, 195168, 195172, 195176, 195180,
+ 195184, 195188, 195192, 195196, 195200, 195204, 195208, 195212, 195216,
+ 195220, 195224, 195228, 195232, 195236, 195240, 195244, 195248, 195252,
+ 195256, 195260, 195264, 195268, 195272, 195276, 195280, 195284, 195288,
+ 195292, 195296, 195300, 195304, 195308, 195312, 195316, 195320, 195324,
+ 195328, 195332, 195336, 195340, 195344, 195348, 195352, 195356, 195360,
+ 195364, 195368, 195372, 195376, 195380, 195384, 195388, 195392, 195396,
+ 195400, 195404, 195408, 195412, 195416, 195420, 195424, 195428, 195432,
+ 195436, 195440, 195444, 195448, 195452, 195456, 195460, 195464, 195468,
+ 195472, 195476, 195480, 195484, 195488, 195492, 195496, 195500, 195504,
+ 195508, 195512, 195516, 195520, 195524, 195528, 195532, 195536, 195540,
+ 195544, 195548, 195552, 195556, 195560, 195564, 195568, 195572, 195576,
+ 195580, 195584, 195588, 195592, 195596, 195600, 195604, 195608, 195612,
+ 195616, 195620, 195624, 195628, 195632, 195636, 195640, 195644, 195648,
+ 195652, 195656, 195660, 195664, 195668, 195672, 195676, 195680, 195684,
+ 195688, 195692, 195696, 195700, 195704, 195708, 195712, 195716, 195720,
+ 195724, 195728, 195732, 195736, 195740, 195744, 195748, 195752, 195756,
+ 195760, 195764, 195768, 195772, 195776, 195780, 195784, 195788, 195792,
+ 195796, 195800, 195804, 195808, 195812, 195816, 195820, 195824, 195828,
+ 195832, 195836, 195840, 195844, 195848, 195852, 195856, 195860, 195864,
+ 195868, 195872, 195876, 195880, 195884, 195888, 195892, 195897, 195902,
+ 195907, 195911, 195917, 195924, 195931, 195938, 195945, 195952, 195959,
+ 195966, 195973, 195980, 195987, 195994, 196001, 196008, 196014, 196021,
+ 196028, 196034, 196041, 196048, 196055, 196062, 196069, 196076, 196083,
+ 196090, 196097, 196104, 196111, 196118, 196125, 196131, 196137, 196143,
+ 196150, 196159, 196168, 196177, 196186, 196191, 196196, 196203, 196210,
+ 196217, 196224, 196231, 196237, 196243, 196249, 196255, 196261, 196267,
+ 196273, 196278, 196284, 196294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+/* name->code dictionary */
+static const unsigned int code_hash[] = {
+ 74224, 4851, 0, 0, 0, 0, 7929, 0, 0, 0, 0, 127931, 0, 42833, 983091,
+ 12064, 110752, 129548, 194597, 69850, 65842, 0, 0, 0, 78159, 68476,
+ 72392, 1373, 0, 0, 5816, 0, 0, 4231, 0, 0, 4233, 4234, 4232, 68885,
+ 70351, 0, 7404, 72393, 0, 0, 0, 0, 0, 41601, 8874, 0, 0, 0, 128498, 0, 0,
+ 41603, 9784, 0, 9188, 41600, 0, 0, 0, 0, 3535, 0, 0, 0, 66797, 0, 74491,
+ 0, 3404, 100419, 0, 72411, 1759, 100417, 0, 100418, 69972, 11240, 121038,
+ 100416, 127764, 0, 0, 0, 0, 0, 69970, 0, 0, 9834, 43249, 2234, 983891, 0,
+ 0, 0, 0, 92417, 0, 74398, 12035, 0, 983074, 43548, 0, 0, 0, 0, 0, 64318,
+ 917549, 0, 3390, 74483, 43265, 0, 983884, 0, 0, 0, 3400, 0, 0, 11647, 0,
+ 0, 0, 0, 2121, 128741, 4043, 8712, 0, 983814, 0, 121172, 0, 129456, 0, 0,
+ 93042, 0, 0, 983875, 0, 0, 0, 11851, 0, 3181, 66002, 0, 69601, 0, 66021,
+ 0, 194588, 5457, 5440, 0, 93981, 65282, 2843, 5355, 0, 129333, 69971,
+ 5194, 11657, 128353, 0, 0, 0, 0, 0, 120766, 100525, 0, 0, 74350, 0,
+ 10682, 110820, 10602, 800, 70044, 118883, 0, 0, 64930, 118940, 67853,
+ 72001, 0, 762, 120485, 0, 0, 0, 10906, 1353, 6960, 0, 0, 5828, 8724, 0,
+ 0, 118548, 0, 0, 7080, 0, 128806, 122979, 0, 72388, 0, 11859, 0, 0,
+ 68878, 0, 0, 0, 7240, 0, 556, 0, 118544, 0, 0, 0, 72397, 0, 0, 0, 0, 0,
+ 0, 0, 0, 72986, 0, 0, 43931, 0, 11093, 0, 0, 122960, 7341, 66801, 68527,
+ 0, 1874, 0, 0, 129314, 0, 0, 0, 0, 0, 0, 7688, 0, 0, 9036, 0, 0, 66389,
+ 0, 121347, 0, 0, 10100, 0, 2725, 0, 0, 43981, 42128, 0, 0, 68146, 0, 0,
+ 0, 0, 71349, 7859, 1945, 0, 0, 0, 65918, 7188, 9992, 0, 7389, 127008,
+ 71341, 0, 0, 0, 528, 129681, 44017, 11429, 71347, 0, 0, 120864, 0, 0, 0,
+ 11530, 73102, 6188, 0, 0, 68208, 1823, 0, 0, 92928, 0, 64843, 7233,
+ 92929, 0, 0, 6639, 0, 0, 123149, 0, 1176, 0, 0, 8276, 128667, 0, 0,
+ 68892, 42931, 0, 0, 0, 0, 0, 0, 0, 5388, 0, 0, 0, 11310, 0, 123607, 0,
+ 68888, 4199, 119264, 0, 119020, 0, 0, 9560, 0, 0, 43869, 0, 0, 0, 83172,
+ 0, 0, 0, 83173, 101559, 128875, 0, 0, 74327, 0, 0, 0, 0, 0, 123623,
+ 68886, 0, 0, 0, 8408, 64704, 0, 0, 0, 0, 118711, 67999, 0, 0, 0, 0,
+ 43049, 0, 43050, 73028, 0, 0, 0, 0, 0, 127396, 0, 69847, 9322, 0, 0,
+ 129321, 68192, 120507, 983634, 0, 0, 0, 6199, 67249, 0, 0, 0, 0, 11329,
+ 66285, 0, 983086, 0, 0, 0, 0, 41335, 118866, 43401, 0, 41334, 0, 0, 0,
+ 983484, 71997, 983483, 128114, 0, 42627, 0, 32, 6187, 0, 123619, 983480,
+ 3665, 121083, 42871, 983119, 41336, 0, 0, 983476, 0, 0, 0, 4412, 0, 0, 0,
+ 0, 119533, 0, 4181, 0, 0, 127589, 0, 0, 71453, 6181, 74755, 917895, 0, 0,
+ 0, 73557, 121107, 0, 0, 10073, 0, 100738, 127186, 0, 42844, 7498, 1098,
+ 92565, 119530, 0, 0, 10207, 0, 983233, 0, 983555, 0, 9234, 0, 6182, 0,
+ 92552, 0, 0, 0, 0, 5471, 9461, 6697, 0, 5473, 0, 0, 0, 0, 0, 0, 70073, 0,
+ 0, 7767, 8304, 41339, 0, 983494, 69450, 0, 0, 983492, 43855, 41337, 0, 0,
+ 0, 129706, 0, 0, 0, 72396, 0, 0, 0, 42633, 0, 0, 0, 0, 0, 0, 0, 70005,
+ 129506, 0, 0, 0, 129580, 69817, 128299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1437,
+ 41617, 0, 0, 0, 128853, 0, 0, 0, 0, 0, 128529, 12113, 0, 42772, 0, 0,
+ 7693, 10749, 67485, 65210, 5773, 978, 128134, 0, 41619, 10239, 0, 0, 0,
+ 74328, 0, 9748, 0, 0, 0, 0, 0, 0, 0, 70681, 0, 72811, 0, 67464, 0, 92776,
+ 0, 0, 2379, 11325, 0, 0, 67854, 0, 78547, 42209, 0, 120392, 2369, 0,
+ 984003, 984004, 0, 0, 73936, 7008, 69415, 122919, 0, 43841, 2367, 127827,
+ 983888, 0, 2375, 8060, 6194, 0, 0, 119084, 0, 0, 0, 0, 6961, 0, 0, 0,
+ 68426, 0, 42862, 0, 0, 6192, 127900, 42771, 0, 0, 11435, 128445, 118797,
+ 120800, 0, 12892, 0, 128621, 67149, 0, 0, 0, 0, 120707, 0, 0, 19954, 0,
+ 121164, 8983, 0, 0, 0, 0, 0, 6198, 121344, 0, 196, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 983512, 41323, 0, 0, 92289, 0, 0, 0, 983508, 41321,
+ 12907, 3048, 7752, 41320, 0, 0, 12819, 111247, 72127, 0, 0, 0, 0, 0,
+ 72971, 0, 0, 0, 0, 78650, 78649, 0, 41326, 0, 11806, 43167, 0, 1245, 0,
+ 66463, 0, 0, 0, 0, 0, 194619, 0, 194618, 0, 0, 194620, 0, 70403, 325,
+ 12874, 128454, 74178, 0, 0, 119110, 0, 0, 0, 0, 0, 0, 983563, 92175, 0,
+ 125016, 0, 121049, 0, 0, 0, 0, 0, 0, 110844, 11776, 0, 19908, 0, 0, 0,
+ 8753, 69278, 0, 0, 9511, 43493, 0, 93032, 6205, 0, 0, 0, 0, 0, 78928, 0,
+ 0, 120269, 0, 41607, 0, 0, 120617, 0, 0, 0, 7005, 41609, 9580, 0, 401, 0,
+ 43779, 0, 127962, 0, 65486, 0, 12857, 0, 11983, 0, 0, 0, 121371, 0,
+ 194971, 74258, 983647, 0, 0, 0, 0, 0, 8295, 6200, 0, 127864, 0, 0, 71435,
+ 0, 92523, 0, 128631, 0, 0, 125197, 0, 100426, 0, 127556, 0, 0, 0, 64775,
+ 0, 68862, 120590, 0, 0, 129959, 8074, 8199, 126641, 1907, 127269, 4432,
+ 127271, 10808, 120668, 127272, 127259, 3888, 127261, 72724, 127263,
+ 127262, 127265, 123169, 121195, 127250, 66879, 127252, 100422, 66023,
+ 67363, 7663, 0, 0, 0, 0, 66321, 0, 12814, 127248, 127169, 0, 0, 194603,
+ 7641, 92694, 0, 0, 0, 0, 74320, 120818, 120268, 0, 128475, 0, 110627, 0,
+ 9622, 128972, 120264, 0, 0, 0, 0, 68319, 0, 0, 71484, 118613, 0, 0,
+ 69906, 0, 0, 947, 0, 194586, 129059, 10969, 119935, 7613, 119937, 119936,
+ 4795, 119930, 119933, 7376, 0, 0, 0, 72343, 69373, 0, 0, 0, 119919, 7216,
+ 119921, 7217, 119915, 7218, 119917, 7219, 119927, 119926, 119929, 119928,
+ 7213, 119922, 7214, 7215, 128622, 0, 8880, 7685, 128849, 0, 0, 119618,
+ 119853, 8187, 119913, 12815, 7236, 7915, 71906, 0, 121284, 0, 0, 0, 0, 0,
+ 0, 0, 122969, 0, 0, 0, 0, 0, 10468, 0, 0, 0, 0, 0, 0, 0, 0, 917909, 0,
+ 110633, 1616, 3795, 67732, 11529, 0, 126225, 0, 0, 1138, 194577, 12677,
+ 0, 0, 3239, 0, 0, 194809, 194583, 0, 42164, 0, 11778, 67473, 43259,
+ 118543, 119073, 122975, 0, 0, 67094, 129638, 0, 78421, 128123, 78418, 0,
+ 0, 0, 0, 43959, 43960, 0, 72257, 0, 9359, 78416, 0, 0, 0, 6662, 0, 0,
+ 3863, 0, 41329, 55266, 0, 127822, 41328, 75026, 194569, 129516, 0, 0,
+ 2178, 119595, 569, 0, 0, 0, 119085, 110669, 0, 0, 11610, 11368, 0,
+ 194570, 41331, 1006, 127747, 120883, 1550, 8201, 0, 194811, 5499, 43956,
+ 77908, 77910, 77906, 43957, 77904, 77905, 128410, 0, 0, 129581, 100447,
+ 43955, 77913, 122989, 0, 5511, 0, 983721, 0, 69241, 8255, 5512, 128560,
+ 119560, 127858, 64313, 127928, 5906, 1119, 128180, 67088, 983367, 0,
+ 113798, 0, 66423, 0, 0, 0, 67089, 0, 0, 0, 0, 128177, 983728, 0, 0, 0,
+ 5821, 6186, 129960, 128034, 19961, 0, 983719, 0, 65138, 302, 41113,
+ 41115, 0, 6637, 5907, 128789, 0, 43642, 0, 128625, 0, 70345, 5513, 6666,
+ 100567, 78442, 5510, 0, 0, 0, 983725, 78437, 0, 0, 0, 110838, 0, 0, 0,
+ 92710, 0, 0, 0, 0, 0, 74497, 92395, 120511, 6929, 69412, 0, 110835,
+ 64442, 0, 0, 74496, 0, 6674, 43397, 0, 1476, 0, 0, 72276, 3233, 0, 0,
+ 10164, 118555, 0, 3530, 67243, 0, 111219, 6656, 0, 0, 74647, 8512, 72275,
+ 74261, 8967, 0, 0, 0, 72277, 7986, 73782, 120556, 9006, 983562, 72273, 0,
+ 7853, 0, 983360, 0, 0, 0, 0, 983971, 0, 0, 0, 0, 0, 0, 0, 0, 127971,
+ 67983, 13296, 517, 0, 0, 0, 41528, 19923, 65454, 73518, 0, 0, 10531,
+ 7784, 41526, 71727, 0, 8057, 1126, 73895, 0, 0, 130040, 119186, 4251,
+ 8235, 43142, 0, 489, 71733, 4250, 71731, 110721, 43151, 94177, 71725, 0,
+ 121238, 0, 0, 0, 110726, 0, 8711, 6183, 110722, 110723, 0, 0, 7623, 0, 0,
+ 9235, 12760, 74176, 0, 0, 0, 0, 3743, 11514, 11078, 74582, 0, 0, 126597,
+ 0, 0, 0, 0, 983907, 267, 3393, 127504, 2364, 0, 69233, 6958, 0, 6201, 0,
+ 42360, 0, 10652, 41612, 917802, 3402, 917801, 3398, 0, 0, 0, 3391, 70683,
+ 0, 92541, 128017, 126087, 126590, 0, 12767, 0, 983380, 64261, 0, 127537,
+ 70852, 70347, 0, 6673, 0, 0, 129346, 12438, 0, 0, 0, 71128, 0, 9053,
+ 43954, 74523, 0, 0, 0, 6195, 0, 6660, 0, 917760, 917793, 0, 12629, 0, 0,
+ 0, 0, 0, 127940, 0, 0, 0, 65448, 0, 0, 121084, 129688, 43949, 0, 78099,
+ 0, 983385, 0, 0, 0, 5741, 1131, 0, 0, 74862, 0, 43952, 42533, 119598,
+ 78107, 0, 0, 43950, 121297, 118990, 7691, 43951, 578, 0, 0, 0, 42514,
+ 74547, 74196, 120608, 74561, 0, 983976, 0, 0, 0, 0, 0, 0, 0, 0, 7241, 0,
+ 93846, 119167, 0, 12811, 78082, 3946, 0, 10998, 66807, 673, 0, 0, 0, 0,
+ 119301, 0, 68890, 0, 0, 78085, 10267, 0, 74560, 78083, 0, 8729, 0, 0, 0,
+ 0, 0, 0, 0, 119296, 0, 0, 0, 2181, 983463, 731, 0, 71904, 128316, 0,
+ 73539, 0, 1175, 0, 68167, 0, 0, 10793, 0, 67644, 7723, 983458, 0, 0, 0,
+ 0, 5273, 0, 5269, 0, 69607, 2404, 5267, 124967, 124913, 0, 5277, 0, 0,
+ 6189, 65469, 1314, 0, 0, 118873, 8785, 0, 0, 127527, 68414, 43535, 9204,
+ 0, 3879, 0, 71696, 6197, 9497, 0, 7567, 64484, 78128, 41390, 41379,
+ 41882, 67647, 67279, 70085, 0, 121413, 41388, 64446, 41392, 64288, 41387,
+ 0, 8706, 10675, 0, 700, 0, 5775, 0, 7088, 74756, 7499, 0, 78120, 78111,
+ 67251, 126557, 0, 0, 128945, 10311, 78115, 6665, 11115, 0, 7618, 10821,
+ 11455, 0, 64632, 64447, 0, 0, 78093, 78091, 0, 0, 65033, 0, 6668, 0, 0,
+ 0, 656, 69686, 65037, 0, 0, 127024, 0, 0, 0, 0, 73014, 0, 0, 917774,
+ 9702, 0, 92273, 66580, 118895, 66683, 43640, 3417, 0, 6832, 0, 917768, 0,
+ 917767, 118583, 4935, 11906, 0, 0, 67296, 92896, 3651, 0, 67294, 70848,
+ 0, 67292, 0, 12983, 0, 55272, 0, 0, 1439, 0, 74897, 0, 0, 0, 78373, 0,
+ 42087, 3063, 0, 0, 7838, 0, 129282, 0, 0, 67968, 0, 128582, 9078, 92446,
+ 0, 0, 0, 0, 0, 0, 119586, 0, 7750, 128422, 68237, 6190, 0, 0, 0, 72340,
+ 9857, 7014, 9856, 0, 92620, 120547, 0, 8481, 0, 6202, 0, 10920, 67970, 0,
+ 0, 983297, 0, 7843, 65818, 66824, 0, 73481, 0, 0, 0, 0, 0, 6657, 207, 0,
+ 69728, 74819, 0, 0, 0, 0, 0, 0, 0, 0, 41368, 43974, 488, 0, 0, 71339,
+ 10157, 118700, 43034, 11982, 0, 0, 0, 0, 0, 41372, 6669, 8504, 72103, 0,
+ 41367, 129328, 119272, 0, 11726, 8261, 129793, 304, 129799, 129795,
+ 129822, 129807, 113683, 983239, 238, 74522, 0, 0, 19905, 120577, 122968,
+ 129200, 41044, 67640, 67302, 64814, 9912, 65939, 983470, 0, 0, 0, 917925,
+ 0, 0, 309, 6622, 0, 10858, 0, 67636, 0, 72749, 0, 0, 0, 67637, 123138,
+ 9712, 68680, 43970, 0, 65165, 93047, 983831, 0, 0, 0, 0, 0, 6191, 12944,
+ 0, 0, 67634, 43763, 0, 0, 67635, 9370, 41381, 0, 0, 123148, 118817, 0,
+ 3222, 121439, 0, 0, 66663, 0, 0, 0, 0, 0, 65732, 121144, 0, 983219, 0, 0,
+ 67309, 72192, 41383, 64568, 0, 0, 0, 0, 984009, 66725, 0, 0, 0, 0, 73766,
+ 67306, 3632, 128246, 0, 8376, 3648, 0, 74844, 67639, 3636, 0, 3650, 8837,
+ 0, 0, 0, 43250, 41562, 0, 0, 68839, 3640, 127190, 0, 11781, 0, 0, 0, 0,
+ 129659, 0, 126649, 0, 42080, 2529, 0, 78004, 0, 42083, 0, 0, 120531,
+ 67619, 0, 0, 9634, 0, 0, 0, 0, 0, 0, 0, 68841, 0, 92545, 68874, 127399,
+ 0, 0, 41987, 119667, 67623, 983779, 0, 925, 127156, 0, 41985, 64441,
+ 9586, 120988, 41984, 9217, 128372, 0, 0, 9186, 67620, 4016, 983834, 0,
+ 381, 983700, 0, 42077, 0, 128777, 67622, 42078, 0, 10810, 0, 4585, 19943,
+ 5860, 67633, 0, 0, 812, 0, 0, 0, 92518, 0, 0, 0, 0, 67629, 0, 10692, 0,
+ 67630, 0, 924, 0, 67631, 42616, 0, 0, 0, 67317, 67632, 0, 12771, 12736,
+ 12753, 0, 983753, 67626, 67722, 0, 0, 0, 0, 12751, 74906, 8542, 0, 0,
+ 3626, 66706, 0, 0, 3883, 64388, 0, 0, 0, 0, 0, 0, 126268, 67624, 0,
+ 10932, 0, 65585, 64338, 806, 0, 41884, 110845, 1318, 128828, 0, 0, 0,
+ 983808, 3465, 2405, 983395, 0, 12756, 65259, 69381, 983812, 12752, 5833,
+ 1432, 110843, 41883, 110841, 9799, 0, 41886, 0, 0, 2062, 0, 0, 0, 0,
+ 129376, 0, 124969, 983392, 0, 120971, 0, 118832, 0, 983286, 0, 68005,
+ 10622, 0, 0, 0, 6566, 71195, 0, 73780, 0, 68865, 0, 0, 0, 8284, 0, 0, 0,
+ 0, 0, 43023, 0, 983290, 6642, 3977, 72743, 64729, 836, 983386, 92947, 0,
+ 0, 0, 0, 0, 0, 125239, 917923, 0, 0, 0, 0, 0, 0, 1374, 65149, 119014,
+ 67720, 0, 2273, 0, 0, 0, 11234, 0, 0, 9630, 12597, 0, 0, 0, 6661, 0,
+ 113751, 120551, 125015, 0, 0, 72151, 0, 73674, 7718, 113755, 0, 69570, 0,
+ 0, 983777, 0, 0, 0, 127841, 6365, 1887, 983414, 0, 8080, 113681, 0, 0, 0,
+ 129855, 1544, 0, 0, 64677, 0, 0, 0, 0, 73561, 0, 0, 12812, 7342, 0,
+ 73784, 66947, 7904, 0, 0, 120910, 0, 0, 0, 0, 9724, 0, 983804, 9524, 0,
+ 0, 0, 0, 0, 129344, 0, 471, 0, 0, 128302, 72450, 0, 0, 983769, 0, 0,
+ 6918, 118685, 0, 5156, 0, 128683, 10232, 10615, 10213, 0, 0, 42528, 0, 0,
+ 0, 0, 65311, 74935, 0, 13306, 10533, 7870, 0, 7625, 0, 120544, 0, 0,
+ 128816, 126098, 118870, 0, 92819, 0, 0, 92341, 0, 12978, 128533, 0, 0,
+ 43836, 42675, 0, 12845, 0, 19942, 0, 0, 0, 0, 0, 120000, 120008, 120001,
+ 0, 194894, 983746, 0, 0, 0, 7186, 73107, 0, 70093, 445, 119028, 0, 0, 0,
+ 73047, 0, 0, 128442, 0, 0, 0, 3902, 68913, 129916, 0, 0, 1560, 43958, 0,
+ 4584, 0, 67862, 0, 10866, 92905, 1118, 92209, 74888, 0, 1081, 7436,
+ 11147, 7252, 0, 121188, 0, 0, 0, 41386, 5162, 129823, 1330, 0, 121270, 0,
+ 12047, 7675, 0, 0, 1848, 74528, 983148, 64708, 0, 0, 194880, 0, 0, 0,
+ 983772, 12715, 128349, 0, 101402, 0, 66672, 73710, 66685, 0, 0, 92464, 0,
+ 68884, 0, 72835, 123546, 70800, 70101, 120725, 0, 194893, 9214, 43494, 0,
+ 0, 120841, 0, 0, 6313, 65513, 119355, 0, 0, 0, 2345, 72975, 0, 0, 129937,
+ 0, 3117, 0, 71882, 0, 73100, 0, 0, 0, 0, 78415, 983236, 100907, 0, 13248,
+ 0, 120241, 129416, 128415, 0, 94193, 12382, 71120, 0, 0, 0, 0, 1471, 0,
+ 113747, 0, 12378, 0, 69664, 0, 12374, 121357, 0, 0, 0, 0, 0, 0, 12376, 0,
+ 0, 0, 12380, 10557, 0, 12520, 11122, 2024, 127180, 0, 0, 74588, 0, 0,
+ 70120, 3853, 0, 0, 0, 983763, 0, 0, 12090, 0, 12474, 92579, 9503, 0, 0,
+ 73505, 68318, 0, 110834, 0, 0, 0, 12470, 0, 74189, 2742, 12476, 66370,
+ 10946, 0, 12472, 0, 0, 0, 0, 8213, 43824, 7771, 6161, 983280, 68010, 0,
+ 0, 0, 68235, 0, 0, 0, 120985, 0, 0, 0, 129814, 73791, 129830, 68871, 0,
+ 0, 0, 0, 0, 73704, 12015, 128561, 8275, 0, 43459, 120927, 127555, 0, 0,
+ 0, 68881, 71215, 983642, 118841, 0, 12516, 4444, 0, 119017, 120506,
+ 10892, 118828, 0, 6473, 0, 0, 71735, 3591, 0, 0, 0, 0, 72345, 0, 0, 0,
+ 127547, 0, 0, 0, 0, 128253, 0, 0, 0, 0, 94060, 687, 0, 0, 983404, 0, 0,
+ 43882, 0, 128526, 285, 0, 0, 0, 4459, 0, 0, 74917, 0, 0, 126255, 0,
+ 119248, 0, 9743, 0, 0, 126535, 0, 0, 73104, 0, 69659, 0, 0, 3081, 74577,
+ 42921, 0, 0, 0, 0, 0, 0, 0, 9125, 119023, 0, 120820, 0, 65221, 0, 0,
+ 64852, 0, 0, 0, 0, 66578, 5001, 41879, 0, 0, 5003, 884, 0, 0, 4943, 5150,
+ 73889, 74182, 0, 41876, 0, 78915, 42448, 42299, 72804, 0, 0, 0, 0, 8491,
+ 0, 0, 983635, 4530, 42409, 7126, 119526, 66200, 0, 118559, 19929, 0, 0,
+ 0, 4242, 0, 0, 0, 0, 66034, 65941, 124929, 64522, 10740, 8958, 128257,
+ 9754, 119102, 983251, 74222, 983249, 983248, 119064, 983246, 983245, 0,
+ 0, 0, 74518, 66026, 4306, 41468, 68432, 0, 0, 66667, 0, 0, 983499, 42200,
+ 0, 0, 0, 120236, 6948, 0, 8524, 0, 0, 12385, 0, 74926, 0, 1386, 73996, 0,
+ 0, 0, 121184, 12392, 0, 8064, 0, 0, 78216, 119004, 2080, 710, 128491,
+ 12390, 1666, 42091, 0, 12383, 92968, 42092, 68418, 0, 128106, 0, 0,
+ 42096, 0, 3362, 12377, 127878, 0, 0, 0, 0, 1244, 4401, 73786, 12683,
+ 10662, 0, 8112, 129837, 119021, 121017, 12379, 73108, 120534, 0, 42208,
+ 0, 12381, 0, 0, 0, 4327, 0, 0, 128350, 0, 78232, 0, 584, 12933, 0, 12373,
+ 73105, 13000, 0, 2935, 129113, 12665, 0, 43081, 73098, 120505, 12427, 0,
+ 983625, 78227, 0, 0, 0, 0, 128760, 74551, 0, 0, 12426, 0, 73497, 0,
+ 12428, 0, 0, 0, 0, 0, 12429, 6727, 0, 0, 0, 3387, 0, 0, 0, 0, 0, 0,
+ 73517, 0, 3536, 120589, 9752, 92397, 6162, 0, 0, 10113, 0, 0, 0, 12422,
+ 0, 439, 3072, 0, 42207, 74549, 120830, 0, 0, 0, 0, 8308, 0, 70807, 0, 0,
+ 0, 13218, 0, 0, 8082, 12424, 0, 6819, 3539, 93838, 0, 0, 74539, 0, 68181,
+ 0, 72964, 0, 72969, 12420, 11371, 0, 4600, 0, 127810, 0, 0, 0, 72962,
+ 128552, 6704, 4591, 72966, 0, 0, 0, 72960, 120623, 561, 12159, 78223, 0,
+ 78224, 0, 71068, 11932, 7172, 42687, 8368, 0, 0, 93068, 0, 0, 75010, 0,
+ 0, 0, 0, 42463, 0, 2924, 67183, 0, 129947, 0, 128958, 0, 0, 42330, 73079,
+ 3969, 0, 129973, 7169, 1992, 9652, 0, 0, 42086, 0, 100865, 0, 0, 0, 0, 0,
+ 327, 0, 0, 0, 0, 73509, 12433, 0, 0, 118570, 12431, 0, 12434, 983439, 0,
+ 73544, 0, 7712, 12432, 0, 69377, 129147, 100867, 0, 8212, 0, 128014, 0,
+ 119066, 7333, 0, 0, 0, 67407, 70006, 128461, 0, 12436, 0, 43160, 0,
+ 74896, 92757, 71360, 42350, 0, 0, 0, 100566, 0, 11348, 0, 0, 9194,
+ 983185, 0, 55250, 0, 100569, 0, 0, 0, 0, 0, 64746, 66012, 100565, 3444,
+ 75029, 64651, 0, 41503, 0, 0, 0, 0, 0, 0, 0, 120876, 0, 0, 129408, 65309,
+ 12416, 0, 0, 0, 0, 93024, 12418, 74111, 121046, 0, 0, 0, 119361, 0, 4596,
+ 66339, 12417, 66001, 0, 126491, 12414, 8287, 0, 69499, 0, 1143, 0, 0,
+ 12415, 0, 0, 983247, 0, 9021, 120783, 0, 11724, 0, 0, 0, 194794, 0, 0,
+ 8027, 194796, 74257, 127375, 11400, 74197, 194799, 66833, 194798, 0, 0,
+ 983252, 0, 0, 1324, 0, 0, 0, 194878, 7715, 0, 0, 194777, 194780, 0, 0, 0,
+ 194787, 0, 0, 0, 0, 0, 66289, 127109, 3889, 129561, 194800, 0, 0, 0, 0,
+ 121226, 12999, 0, 120902, 0, 0, 0, 0, 0, 64802, 42210, 4597, 983134, 0,
+ 0, 12371, 67164, 0, 67163, 10805, 0, 0, 0, 0, 118662, 12367, 0, 0, 92557,
+ 12363, 0, 0, 128611, 983645, 0, 0, 8005, 12365, 0, 0, 3756, 12369, 10649,
+ 0, 70095, 0, 0, 0, 42923, 0, 0, 0, 0, 0, 0, 66659, 0, 0, 0, 0, 5268,
+ 4954, 0, 0, 5266, 126980, 5272, 92294, 0, 42230, 983980, 0, 9128, 0, 0,
+ 0, 0, 6928, 9803, 42282, 9110, 1505, 0, 0, 5276, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8722, 120805, 0, 0, 66695, 0, 0, 4383, 8900, 0, 0, 74930, 64297, 0, 0,
+ 0, 0, 3419, 42229, 0, 0, 8911, 0, 42353, 0, 0, 0, 0, 0, 0, 0, 100629,
+ 41576, 42215, 122888, 0, 0, 8578, 68178, 7573, 41575, 74789, 92310, 0,
+ 73863, 0, 2670, 0, 0, 11723, 0, 0, 0, 0, 0, 43414, 0, 0, 65675, 0, 67179,
+ 67168, 12413, 129746, 67177, 0, 0, 0, 0, 12302, 0, 5250, 12407, 12245,
+ 4404, 9189, 12401, 42007, 0, 42005, 65806, 43997, 122922, 42002, 12404,
+ 0, 74928, 4940, 12410, 0, 128761, 0, 64567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 11956, 0, 0, 122882, 0, 6631, 128923, 120704, 74583, 42218, 0, 0, 70094,
+ 0, 0, 0, 71058, 0, 0, 0, 127341, 0, 0, 0, 0, 0, 43370, 0, 5016, 121052,
+ 0, 0, 9491, 0, 0, 0, 0, 64922, 0, 0, 0, 0, 92198, 0, 118622, 0, 74619, 0,
+ 0, 70422, 983688, 10565, 0, 12177, 0, 0, 0, 0, 0, 12395, 127874, 12878,
+ 92630, 12396, 0, 0, 92537, 0, 43113, 0, 0, 0, 9781, 0, 4927, 0, 0, 0, 0,
+ 12397, 129089, 128910, 0, 12394, 0, 0, 0, 0, 0, 72789, 10781, 1546, 0,
+ 5010, 0, 10507, 127891, 128291, 0, 0, 0, 0, 7267, 0, 0, 0, 0, 2819, 0, 0,
+ 71063, 0, 7266, 128553, 7264, 7265, 0, 1363, 0, 119581, 65080, 0, 0, 0,
+ 0, 43336, 67004, 0, 126263, 73776, 0, 43339, 0, 9836, 0, 0, 0, 43335,
+ 41276, 0, 73795, 43337, 817, 11211, 2241, 128841, 41274, 11340, 42408,
+ 42447, 74932, 0, 0, 12386, 0, 0, 0, 12389, 128398, 0, 41996, 41686, 0,
+ 8269, 1147, 43849, 120896, 1987, 128540, 43195, 42001, 41990, 41999,
+ 12391, 0, 0, 4939, 12384, 0, 0, 43243, 0, 0, 70746, 0, 0, 0, 0, 0, 8247,
+ 0, 0, 7545, 0, 43643, 121445, 0, 10036, 0, 119813, 10178, 119816, 0,
+ 119815, 11762, 119818, 0, 92282, 120597, 0, 0, 119819, 0, 0, 7719, 0,
+ 2486, 0, 119808, 1507, 0, 129185, 70301, 9687, 119825, 0, 119811, 66196,
+ 0, 5262, 0, 74642, 12681, 0, 0, 12406, 12219, 0, 127528, 42810, 110991,
+ 0, 983692, 128144, 121027, 126096, 120753, 12403, 2500, 118672, 0, 12409,
+ 0, 0, 0, 74113, 2343, 12412, 19946, 74112, 125042, 13112, 0, 120603,
+ 67866, 110634, 0, 66369, 5861, 110632, 11999, 12400, 0, 0, 12645, 0,
+ 11320, 68410, 6748, 65040, 0, 64184, 12974, 66927, 67613, 120645, 0, 0,
+ 0, 0, 0, 1928, 0, 67649, 0, 0, 67609, 11235, 0, 0, 67610, 8241, 0, 0,
+ 4206, 0, 0, 0, 128298, 110980, 0, 67238, 0, 0, 0, 1422, 8357, 0, 7187, 0,
+ 120641, 0, 0, 0, 0, 125022, 111064, 92539, 10120, 12405, 0, 72997, 0,
+ 13278, 0, 6366, 0, 7945, 0, 4402, 0, 12402, 129372, 0, 74754, 12408, 0,
+ 44007, 0, 0, 0, 12411, 0, 120824, 128306, 121092, 0, 1575, 0, 0, 0,
+ 73003, 119622, 0, 0, 12399, 0, 6833, 0, 0, 0, 71878, 9692, 0, 0, 100615,
+ 6750, 66855, 0, 0, 0, 0, 43527, 0, 727, 0, 0, 0, 0, 6726, 127387, 0,
+ 12370, 44023, 0, 126592, 2280, 0, 12372, 120642, 0, 0, 0, 0, 12366,
+ 10963, 6066, 1329, 0, 3052, 72987, 0, 66029, 0, 10803, 0, 983648, 0,
+ 92473, 0, 0, 0, 0, 1499, 0, 0, 42740, 0, 0, 0, 0, 12056, 126484, 0, 3660,
+ 69404, 42192, 74253, 0, 42223, 67617, 125254, 0, 0, 0, 0, 9941, 0, 0,
+ 1933, 0, 0, 0, 0, 73866, 0, 0, 2487, 67614, 7361, 1804, 0, 67615, 0, 0,
+ 12220, 67616, 0, 0, 0, 68200, 6675, 0, 0, 67592, 126582, 0, 64771, 0,
+ 9132, 0, 111004, 510, 0, 0, 0, 4561, 7711, 92769, 92944, 111007, 0,
+ 41569, 121282, 0, 8167, 66885, 123197, 0, 0, 69992, 66403, 6967, 0, 0, 0,
+ 0, 333, 0, 0, 10566, 66409, 0, 121373, 0, 72965, 110999, 66388, 6678, 0,
+ 0, 12621, 0, 128775, 10227, 4764, 0, 9981, 0, 70278, 11589, 0, 0, 42202,
+ 12754, 0, 0, 69576, 0, 67594, 2048, 0, 4050, 67595, 0, 0, 43221, 11184,
+ 72709, 0, 0, 64175, 0, 72746, 0, 0, 129966, 65461, 9798, 0, 71210, 0,
+ 69841, 0, 952, 128235, 125107, 0, 70296, 6449, 72102, 0, 0, 43098, 64171,
+ 8142, 64160, 0, 0, 0, 0, 0, 0, 0, 0, 67597, 6676, 3930, 42615, 73124,
+ 69991, 67598, 0, 0, 0, 65591, 41581, 128056, 1453, 0, 0, 0, 8500, 42222,
+ 0, 119270, 72992, 69996, 0, 0, 64676, 0, 0, 67606, 66385, 0, 42217,
+ 13102, 0, 67607, 6672, 0, 0, 0, 0, 67608, 0, 9001, 0, 11274, 67601, 0,
+ 64210, 6664, 0, 42056, 67602, 0, 0, 0, 0, 1469, 67603, 65381, 69921,
+ 4988, 42372, 0, 9598, 904, 352, 42225, 0, 8061, 10673, 0, 0, 128276,
+ 67600, 67477, 0, 127293, 8575, 127295, 127296, 127289, 127290, 127291,
+ 127292, 127285, 127286, 127287, 118877, 127281, 127282, 9460, 823, 11587,
+ 0, 0, 0, 127305, 12387, 0, 0, 127301, 126979, 42783, 69998, 64208,
+ 127298, 127299, 66031, 0, 11606, 64784, 0, 69973, 0, 124149, 0, 5152,
+ 11048, 0, 120121, 67605, 0, 69604, 0, 70276, 194847, 0, 127052, 42587,
+ 42214, 41394, 0, 4763, 0, 118935, 0, 5260, 0, 94038, 326, 120131, 74119,
+ 0, 10771, 42198, 194920, 194835, 194925, 41398, 127079, 41393, 127077,
+ 127076, 453, 41396, 0, 13159, 11227, 9572, 0, 0, 194576, 128835, 127081,
+ 0, 126617, 43144, 0, 72972, 194887, 0, 0, 0, 0, 0, 64061, 0, 0, 64056,
+ 70310, 0, 0, 0, 66971, 0, 111084, 64301, 72998, 10464, 0, 128393, 72847,
+ 0, 11528, 64024, 128072, 679, 0, 0, 5850, 758, 7536, 0, 0, 43712, 0,
+ 64006, 983589, 64005, 70298, 0, 126487, 0, 0, 0, 0, 0, 72999, 0, 64027,
+ 64029, 0, 0, 64000, 0, 194874, 0, 42201, 12421, 194875, 0, 1852, 0, 0,
+ 73744, 0, 64041, 129127, 0, 0, 0, 92322, 12423, 12854, 0, 3496, 0,
+ 110966, 0, 194823, 0, 0, 6158, 8327, 74553, 0, 12419, 0, 11570, 2169, 0,
+ 123618, 0, 7844, 983820, 194909, 0, 1682, 93039, 194911, 42756, 6765,
+ 128178, 0, 0, 0, 11412, 6768, 0, 194830, 71316, 0, 0, 0, 11577, 0,
+ 194829, 1833, 11576, 74334, 0, 0, 42854, 69438, 0, 70307, 0, 194856,
+ 8085, 0, 194850, 0, 72996, 128778, 1949, 11614, 7847, 120489, 120997,
+ 64483, 0, 0, 0, 122639, 0, 0, 0, 126651, 42864, 0, 64667, 74624, 0, 0,
+ 43261, 11484, 127535, 67840, 0, 0, 128965, 0, 72974, 0, 72456, 8995,
+ 3455, 0, 0, 9879, 0, 0, 4158, 128050, 0, 0, 110929, 0, 0, 0, 332, 118808,
+ 0, 0, 2407, 0, 42199, 92386, 110865, 0, 77921, 55217, 123161, 125199,
+ 70043, 0, 0, 0, 121093, 1834, 0, 0, 71315, 0, 65249, 0, 8662, 0, 0,
+ 123153, 0, 11539, 10784, 0, 67674, 0, 92233, 0, 0, 118858, 0, 0, 0, 0, 0,
+ 0, 12499, 6280, 0, 0, 0, 0, 0, 0, 43851, 6279, 12508, 0, 12502, 9161, 0,
+ 1620, 0, 3601, 0, 0, 67246, 609, 11555, 0, 12496, 0, 74181, 120492,
+ 12505, 0, 194902, 0, 43567, 239, 0, 127085, 0, 0, 42671, 0, 0, 83095,
+ 43565, 127082, 983955, 12696, 127753, 0, 94062, 12929, 0, 712, 0, 4197,
+ 0, 42818, 0, 70306, 0, 0, 983824, 0, 43562, 0, 119506, 68076, 0, 111074,
+ 64628, 0, 0, 0, 0, 7494, 0, 4924, 0, 0, 0, 0, 72368, 0, 127087, 69987,
+ 64796, 0, 0, 12033, 119492, 0, 72370, 0, 0, 0, 0, 70299, 0, 0, 68324,
+ 72420, 0, 0, 0, 0, 70309, 127000, 0, 0, 0, 72418, 72963, 0, 5699, 0,
+ 983898, 9488, 74410, 119112, 70477, 11170, 0, 0, 72312, 0, 5265, 0, 0, 0,
+ 0, 12464, 0, 43264, 72977, 0, 43345, 120853, 0, 120592, 6807, 0, 9829,
+ 69997, 0, 0, 43346, 11393, 795, 0, 72412, 12462, 72416, 72415, 0, 0,
+ 64362, 0, 0, 120811, 0, 12468, 8607, 1008, 0, 120670, 0, 0, 67855,
+ 125018, 72372, 6758, 0, 0, 1820, 41112, 0, 11202, 129451, 0, 13223, 0,
+ 64595, 0, 0, 0, 983649, 12616, 0, 127088, 0, 74467, 0, 0, 0, 0, 0, 0,
+ 67233, 119060, 0, 83448, 19920, 69897, 0, 129057, 0, 1130, 0, 0, 0,
+ 11823, 0, 0, 118896, 0, 0, 13280, 0, 10747, 118925, 0, 43509, 0, 0, 8959,
+ 0, 6747, 0, 0, 8568, 0, 120870, 0, 120803, 83060, 42670, 0, 11621, 12460,
+ 0, 0, 0, 0, 111188, 0, 66570, 72989, 121305, 126476, 120582, 0, 0, 0,
+ 111191, 70308, 11594, 0, 68333, 69427, 10491, 0, 0, 0, 0, 0, 127506, 0,
+ 194910, 4923, 65086, 8981, 0, 42133, 0, 72244, 0, 70294, 0, 0, 12485, 0,
+ 8642, 0, 42766, 0, 2210, 11109, 0, 0, 0, 0, 0, 7398, 0, 0, 0, 8041, 1461,
+ 0, 119133, 0, 6749, 0, 0, 0, 71705, 0, 0, 68071, 0, 67668, 0, 0, 9193, 0,
+ 0, 0, 0, 73810, 0, 0, 64305, 0, 0, 623, 781, 670, 10660, 5769, 613, 7543,
+ 0, 477, 92633, 92521, 0, 592, 0, 12459, 0, 0, 0, 12465, 119578, 654,
+ 11345, 653, 652, 111250, 647, 0, 633, 120744, 0, 111262, 12480, 74354, 0,
+ 39, 12487, 0, 0, 74803, 12482, 0, 12489, 0, 128962, 5550, 129175, 0, 0,
+ 0, 0, 1813, 0, 41311, 111205, 0, 11229, 0, 70496, 1675, 69840, 129435, 0,
+ 119078, 10070, 10595, 111207, 119077, 111206, 121162, 0, 0, 0, 11222, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 71716, 917841, 0, 0, 270, 0, 0, 0, 0, 0,
+ 120561, 0, 69741, 0, 0, 68251, 0, 71721, 364, 9595, 0, 0, 0, 707, 110603,
+ 0, 9282, 0, 224, 0, 68670, 9332, 65581, 68677, 0, 68644, 0, 11764, 68634,
+ 0, 10732, 68640, 850, 0, 0, 71123, 0, 68619, 44008, 68627, 0, 0, 0, 0,
+ 66969, 0, 0, 0, 12507, 0, 0, 128311, 0, 120529, 4375, 0, 0, 0, 12198, 0,
+ 67339, 0, 0, 72994, 74293, 128434, 0, 0, 64546, 0, 71208, 0, 0, 78916,
+ 42334, 42502, 0, 120887, 72961, 0, 917838, 5767, 0, 0, 71710, 8353, 0, 0,
+ 0, 121233, 0, 0, 0, 0, 119920, 0, 0, 121186, 0, 0, 0, 72719, 64604, 0,
+ 6096, 122632, 10063, 0, 0, 119630, 3485, 12987, 0, 127522, 0, 0, 0, 0, 0,
+ 0, 0, 0, 127173, 0, 0, 68249, 0, 0, 118923, 0, 64574, 128794, 0, 1640,
+ 12495, 66691, 0, 3138, 12504, 11171, 1922, 0, 12498, 128733, 0, 69939, 0,
+ 65543, 0, 0, 0, 66643, 0, 120734, 0, 4228, 0, 10303, 128884, 0, 0, 10335,
+ 3520, 0, 12490, 0, 0, 0, 12493, 121452, 64636, 1002, 12491, 0, 0, 92615,
+ 2096, 0, 0, 0, 0, 11611, 66228, 0, 11241, 66224, 66221, 66226, 66229,
+ 66219, 66231, 66216, 0, 66236, 66211, 66218, 0, 66240, 78041, 66233,
+ 66217, 0, 7909, 66234, 11605, 0, 0, 66208, 0, 0, 128282, 73875, 0, 12898,
+ 12494, 120939, 12492, 0, 128774, 0, 74153, 0, 127391, 127489, 4882,
+ 13040, 0, 120762, 4885, 194732, 0, 13042, 4880, 128834, 2429, 118674,
+ 8647, 0, 0, 0, 0, 0, 0, 68896, 0, 119101, 66693, 0, 1870, 78040, 470,
+ 68893, 78035, 78036, 983577, 78034, 110607, 110608, 0, 12511, 74453,
+ 12514, 0, 128609, 7239, 7001, 11974, 121214, 0, 0, 7378, 12512, 11615,
+ 13041, 0, 0, 128057, 13038, 0, 0, 71717, 70195, 120836, 12510, 127070,
+ 13039, 75019, 12513, 71969, 12471, 110761, 0, 121385, 70193, 0, 0, 0,
+ 71714, 0, 12477, 0, 12473, 7666, 67362, 237, 6281, 0, 0, 0, 0, 1312, 0,
+ 0, 12469, 0, 0, 64335, 12475, 0, 69382, 0, 11524, 10367, 10431, 74368,
+ 13017, 3388, 129547, 69573, 0, 0, 128725, 4932, 0, 0, 13015, 0, 0, 65451,
+ 8185, 0, 0, 2189, 129362, 74375, 10129, 0, 7948, 9236, 0, 0, 69512,
+ 92726, 43473, 6289, 10484, 0, 0, 0, 12082, 12521, 3147, 110643, 110644,
+ 12524, 110642, 2310, 0, 0, 0, 0, 13013, 0, 8596, 983871, 10804, 70497, 0,
+ 0, 13014, 12444, 0, 43088, 13016, 0, 0, 0, 0, 12331, 0, 0, 8744, 726,
+ 121090, 983868, 4155, 0, 0, 0, 71690, 12522, 73128, 0, 0, 127805, 0,
+ 110647, 0, 0, 983872, 12525, 0, 12523, 2152, 11969, 120596, 403, 0,
+ 11021, 0, 0, 11030, 8610, 92567, 0, 0, 63998, 0, 0, 0, 0, 0, 0, 0, 12506,
+ 0, 11146, 71477, 12500, 0, 12509, 0, 0, 0, 0, 6608, 0, 0, 0, 0, 69288,
+ 77995, 0, 3608, 0, 0, 1107, 0, 129658, 0, 0, 0, 0, 983956, 43217, 66571,
+ 13222, 118963, 0, 126514, 10463, 11553, 0, 63995, 9043, 128634, 71722, 0,
+ 0, 127751, 92974, 12529, 8042, 0, 2344, 12528, 0, 0, 0, 69719, 120956, 0,
+ 0, 66512, 0, 12530, 0, 0, 68917, 12658, 0, 71683, 0, 983241, 0, 127526,
+ 469, 0, 4363, 3313, 0, 0, 2023, 0, 72251, 78225, 65706, 10051, 78219,
+ 78220, 0, 9920, 12215, 0, 4931, 1951, 12497, 119363, 0, 0, 119336, 0, 0,
+ 0, 0, 0, 1491, 128578, 129169, 0, 0, 0, 0, 78898, 94086, 41993, 0, 67379,
+ 0, 0, 0, 0, 9738, 41995, 1075, 0, 12535, 41992, 0, 2187, 0, 0, 128117, 0,
+ 9940, 0, 7692, 0, 9727, 41131, 330, 8566, 0, 41133, 41117, 128482, 12532,
+ 78550, 78546, 43177, 0, 43235, 0, 917542, 78229, 78231, 13031, 12910,
+ 67710, 78555, 13028, 78553, 12537, 0, 0, 71692, 12536, 2350, 13029,
+ 78233, 0, 0, 13030, 0, 4527, 71250, 12538, 0, 0, 0, 0, 0, 0, 0, 12484,
+ 4032, 71459, 194728, 0, 64344, 0, 66700, 66000, 8412, 0, 43466, 1296,
+ 2325, 0, 121020, 10149, 74118, 0, 0, 12481, 121280, 12488, 0, 0, 0,
+ 67972, 0, 2354, 42619, 0, 73027, 6295, 901, 0, 0, 0, 0, 0, 128653, 11927,
+ 66584, 78559, 78560, 78557, 78558, 0, 74649, 0, 126241, 67220, 194726,
+ 78568, 67226, 78565, 70190, 78563, 78564, 2352, 67219, 78569, 71945,
+ 11289, 1407, 67973, 0, 13026, 6762, 10399, 70192, 13023, 78578, 9777,
+ 67208, 1871, 0, 0, 0, 13024, 71936, 0, 9325, 6818, 6283, 11738, 0, 0,
+ 71938, 11741, 0, 0, 9216, 8263, 11279, 0, 983856, 0, 13021, 71922, 3136,
+ 0, 983859, 0, 13022, 129143, 9956, 0, 0, 0, 42580, 0, 0, 0, 13020, 10024,
+ 0, 94013, 0, 0, 0, 43001, 8029, 0, 0, 0, 3335, 127924, 9209, 13048,
+ 73126, 0, 0, 0, 3333, 119100, 0, 0, 3342, 78582, 78583, 73056, 78581,
+ 4156, 0, 0, 0, 78591, 1611, 73058, 13018, 78586, 78588, 78584, 3337,
+ 4537, 78593, 11736, 0, 0, 0, 4214, 73790, 0, 0, 13046, 194844, 425,
+ 74763, 42066, 78595, 0, 2392, 13047, 0, 0, 12425, 13049, 0, 92243, 0,
+ 72715, 73944, 13050, 0, 0, 0, 0, 983506, 0, 0, 8929, 6849, 0, 0, 0,
+ 983990, 0, 13045, 0, 0, 7751, 0, 9726, 0, 3997, 0, 8768, 13044, 0, 0,
+ 4024, 0, 0, 2419, 9757, 69736, 0, 0, 0, 129500, 0, 0, 0, 72735, 0, 0, 0,
+ 0, 0, 11911, 124990, 0, 2346, 194691, 69931, 0, 9646, 3773, 43557, 68154,
+ 42536, 0, 70108, 13043, 92686, 92494, 0, 208, 0, 43766, 0, 0, 0, 10699,
+ 0, 0, 7825, 7110, 111275, 0, 111274, 41109, 2398, 111271, 0, 0, 0, 0, 0,
+ 0, 72723, 8294, 42912, 129343, 0, 0, 4876, 111316, 0, 111326, 111282, 0,
+ 0, 0, 73950, 13053, 9944, 0, 2811, 13051, 111313, 3143, 111246, 66374,
+ 110759, 0, 0, 13052, 0, 0, 63972, 119071, 7025, 0, 0, 100464, 74161,
+ 4154, 9863, 129686, 0, 0, 63970, 1564, 0, 0, 0, 0, 0, 9942, 0, 0, 111227,
+ 0, 128471, 0, 63957, 0, 1626, 0, 63983, 2161, 111232, 0, 0, 121275,
+ 111292, 6254, 4910, 69453, 0, 64753, 100458, 111303, 111204, 127404,
+ 111297, 3229, 111306, 42774, 0, 0, 111218, 111286, 2331, 0, 7085, 6137,
+ 0, 70411, 0, 126070, 0, 128438, 0, 0, 65043, 0, 127588, 70412, 128921,
+ 64721, 0, 0, 0, 0, 0, 983789, 0, 0, 5311, 0, 965, 0, 11993, 78055, 11278,
+ 128787, 0, 0, 0, 121076, 120705, 0, 6294, 3144, 0, 0, 65019, 0, 0, 0, 0,
+ 118721, 63966, 2330, 535, 3148, 12375, 110774, 0, 10556, 2475, 12388,
+ 4889, 0, 67863, 120404, 0, 72750, 2342, 0, 0, 0, 4894, 0, 4890, 0, 0, 0,
+ 4893, 128426, 6571, 118581, 4888, 4157, 78048, 78049, 78046, 11263, 0,
+ 78045, 64895, 121437, 0, 0, 0, 0, 0, 119041, 2332, 78063, 78060, 78061,
+ 64932, 78059, 65125, 121098, 0, 0, 129991, 73941, 78066, 12203, 78064,
+ 78065, 8913, 120390, 4875, 73678, 120396, 120389, 71854, 0, 120394,
+ 120386, 120395, 13104, 78076, 78077, 120393, 78075, 0, 3134, 83096,
+ 65696, 72432, 0, 0, 0, 8334, 0, 83207, 3449, 0, 0, 83215, 0, 0, 0, 83204,
+ 0, 0, 0, 69707, 0, 0, 10734, 0, 83198, 83108, 7804, 121401, 83166, 8457,
+ 83212, 0, 11367, 0, 78054, 0, 72762, 0, 64285, 0, 5464, 0, 83100, 2361,
+ 7971, 78072, 78073, 78070, 78071, 0, 8086, 0, 6707, 0, 2312, 40977, 0,
+ 40962, 0, 0, 74962, 40980, 0, 0, 0, 40970, 92895, 110823, 0, 42438,
+ 72752, 6288, 0, 127946, 5653, 42400, 10891, 73946, 5658, 70401, 0, 0, 0,
+ 0, 71060, 0, 0, 42326, 100482, 92191, 92685, 42478, 2327, 0, 12959,
+ 42287, 92883, 0, 83081, 917550, 0, 0, 2867, 128562, 66312, 698, 0, 0, 0,
+ 70017, 0, 8000, 12641, 83140, 0, 0, 129064, 0, 72979, 83133, 0, 83134, 0,
+ 0, 111011, 92960, 74356, 0, 74562, 0, 72745, 0, 0, 120568, 0, 0, 0, 0, 0,
+ 8703, 5462, 83195, 0, 10101, 0, 70049, 0, 0, 128793, 0, 0, 66254, 120821,
+ 0, 1565, 123621, 0, 119194, 0, 42651, 0, 0, 917847, 83227, 83218, 0,
+ 75011, 0, 129724, 0, 64399, 0, 12899, 74564, 0, 42206, 0, 72718, 71715,
+ 83149, 983794, 83146, 12192, 917826, 0, 0, 0, 0, 68056, 0, 67426, 128687,
+ 0, 0, 0, 0, 0, 0, 67431, 71718, 74357, 0, 121176, 43596, 6090, 0, 7812,
+ 10534, 0, 0, 0, 0, 129763, 0, 0, 0, 0, 0, 0, 43306, 0, 0, 0, 7930, 0,
+ 2292, 0, 0, 72737, 0, 6130, 0, 0, 0, 0, 0, 70463, 968, 0, 0, 0, 43304, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 11838, 0, 0, 0, 42682, 0, 0, 0, 41227, 0,
+ 71475, 0, 64848, 0, 78574, 0, 113792, 0, 0, 129133, 0, 66015, 74614, 959,
+ 8885, 0, 0, 0, 9469, 9632, 128211, 74761, 64323, 100478, 0, 2266, 78575,
+ 310, 0, 0, 68403, 100480, 72738, 125279, 0, 0, 6497, 127320, 0, 0, 19958,
+ 0, 128691, 74953, 0, 118998, 67332, 374, 0, 41933, 120975, 0, 0, 41934,
+ 7465, 0, 128168, 70666, 11151, 6101, 0, 41936, 100476, 4879, 0, 65446, 0,
+ 0, 983695, 0, 5374, 0, 128059, 127390, 0, 126618, 983575, 129146, 0, 0,
+ 1929, 0, 12142, 0, 0, 0, 121472, 0, 12982, 0, 5378, 0, 128679, 0, 0,
+ 127869, 0, 127343, 0, 0, 0, 78832, 74481, 0, 43262, 100511, 2421, 0,
+ 2324, 828, 3611, 121055, 0, 64314, 0, 0, 0, 0, 0, 0, 7999, 0, 11217,
+ 983266, 10634, 10942, 0, 2348, 0, 0, 0, 0, 118587, 9982, 64324, 41240, 0,
+ 100470, 78462, 1810, 0, 92566, 71299, 0, 0, 917848, 0, 0, 100515, 0, 0,
+ 0, 43912, 128385, 0, 0, 0, 917850, 0, 7485, 0, 129382, 74576, 44019,
+ 128171, 917851, 3967, 129335, 0, 0, 0, 0, 119096, 0, 0, 8699, 723, 83084,
+ 966, 0, 0, 0, 128428, 78778, 2320, 0, 65740, 4968, 0, 0, 8075, 55276,
+ 123589, 8047, 983787, 78827, 12634, 0, 78781, 71322, 0, 12174, 42610, 0,
+ 0, 0, 1584, 0, 6045, 0, 0, 65218, 11559, 0, 0, 0, 124991, 0, 2257, 64418,
+ 0, 0, 0, 0, 0, 0, 67821, 0, 13092, 0, 128365, 0, 0, 0, 0, 0, 11414, 0,
+ 2531, 13034, 0, 0, 0, 13036, 0, 70866, 70198, 10394, 129979, 13037, 0,
+ 129956, 0, 0, 100496, 120640, 41129, 0, 42850, 13035, 0, 0, 5466, 0, 0,
+ 0, 129439, 4535, 0, 4271, 0, 0, 6769, 0, 0, 67350, 6767, 0, 66273, 0,
+ 6755, 73827, 9046, 67355, 0, 0, 0, 0, 0, 0, 0, 0, 92221, 83235, 2563,
+ 13033, 247, 83229, 0, 12338, 0, 83231, 11270, 0, 0, 0, 0, 70107, 0, 0, 0,
+ 0, 3752, 83243, 68895, 66973, 68897, 0, 0, 0, 0, 5009, 0, 0, 0, 0,
+ 119521, 78823, 78824, 70353, 68399, 3877, 0, 78825, 10145, 43566, 0, 0,
+ 10236, 0, 43782, 0, 127329, 0, 69652, 2247, 120612, 128058, 0, 43200,
+ 43777, 71253, 983644, 69558, 0, 71866, 43203, 0, 68894, 0, 127326, 0,
+ 43778, 119538, 0, 0, 43781, 11303, 65547, 0, 7031, 0, 0, 67343, 83237,
+ 83267, 0, 67341, 120522, 8535, 0, 0, 0, 66032, 0, 0, 120786, 42233, 0,
+ 9946, 7667, 0, 11822, 0, 43189, 120673, 100507, 2979, 1579, 0, 0, 0, 0,
+ 0, 12635, 71337, 0, 94055, 0, 1285, 64882, 0, 0, 83113, 12640, 83112,
+ 7401, 92869, 12625, 0, 71296, 72744, 0, 74286, 55260, 3396, 12642, 0,
+ 110719, 0, 12630, 0, 0, 10153, 0, 6166, 120516, 0, 110680, 0, 0, 119499,
+ 9285, 913, 42259, 83017, 0, 2142, 127889, 0, 94012, 7878, 0, 72733, 0, 0,
+ 0, 0, 92868, 0, 0, 0, 0, 128918, 5263, 74782, 0, 41939, 43702, 0, 917856,
+ 0, 10139, 980, 43698, 0, 2208, 0, 43701, 0, 125132, 0, 100528, 0, 10085,
+ 0, 0, 119989, 100529, 0, 71699, 0, 8072, 0, 43700, 0, 7304, 7783, 66894,
+ 12398, 0, 0, 0, 0, 0, 0, 120565, 0, 2217, 0, 94015, 6367, 0, 66688, 0, 0,
+ 0, 0, 0, 92199, 7808, 1829, 0, 41937, 0, 43272, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 92467, 6627, 0, 6258, 10683, 0, 0, 0, 5649, 0, 0, 0, 1643, 127898,
+ 0, 127846, 67244, 0, 42452, 0, 0, 0, 0, 64291, 0, 0, 0, 6576, 74773, 0,
+ 0, 66309, 0, 9886, 55225, 11292, 0, 72867, 55227, 0, 12632, 0, 194817, 0,
+ 7680, 0, 92745, 120714, 12639, 3380, 8123, 0, 12638, 42262, 4501, 0, 0,
+ 0, 0, 125131, 1494, 983147, 0, 0, 0, 0, 10494, 0, 65872, 0, 0, 0, 0, 0,
+ 0, 983587, 0, 0, 0, 0, 0, 0, 0, 71077, 0, 127335, 121128, 0, 5570, 1881,
+ 7210, 0, 1012, 66630, 0, 128982, 7208, 66442, 5569, 113723, 42339, 92655,
+ 0, 0, 0, 0, 92378, 65602, 0, 92375, 64727, 9160, 0, 0, 0, 124928, 10503,
+ 0, 3423, 3870, 8483, 10162, 0, 4319, 0, 0, 0, 0, 0, 983117, 0, 69562, 0,
+ 0, 0, 0, 0, 0, 5571, 7630, 9740, 9121, 5568, 0, 0, 42085, 0, 0, 65056, 0,
+ 589, 0, 0, 0, 10233, 66252, 66251, 78734, 66253, 0, 0, 42645, 0, 128424,
+ 8583, 0, 0, 0, 129932, 0, 0, 0, 0, 0, 12204, 92436, 120453, 0, 0, 0,
+ 983262, 0, 0, 70311, 0, 0, 128012, 41063, 0, 10664, 0, 983660, 0, 4551,
+ 129090, 74759, 0, 983270, 0, 0, 72806, 0, 0, 12517, 7806, 0, 12034, 0,
+ 6355, 12519, 41004, 0, 0, 93849, 0, 71707, 0, 121231, 7332, 129075,
+ 12111, 3927, 0, 12515, 1474, 68768, 0, 6923, 69509, 0, 127802, 0, 43990,
+ 74639, 126229, 121007, 0, 92706, 0, 0, 0, 0, 0, 9645, 0, 121026, 5853, 0,
+ 10363, 120729, 12956, 0, 0, 0, 0, 127888, 0, 0, 0, 0, 0, 10514, 65517, 0,
+ 0, 71101, 0, 0, 0, 43570, 2969, 43420, 129944, 0, 0, 92366, 70809, 0, 0,
+ 0, 0, 0, 118714, 12125, 41124, 0, 1164, 128817, 0, 120466, 0, 0, 65014,
+ 66009, 74451, 125075, 983129, 7469, 0, 0, 0, 69988, 120671, 83171, 41123,
+ 11176, 0, 0, 41126, 9991, 41128, 0, 0, 110949, 0, 0, 42877, 7994, 0,
+ 6104, 983612, 0, 129869, 0, 0, 0, 0, 74438, 128272, 121409, 41981, 0,
+ 69296, 42904, 0, 0, 74435, 126640, 0, 0, 0, 127968, 92442, 12703, 9661,
+ 67360, 67359, 7455, 70732, 11473, 119217, 128512, 0, 92323, 0, 0, 129632,
+ 67358, 0, 0, 0, 0, 174, 121131, 883, 4161, 128033, 42603, 0, 0, 72256, 0,
+ 0, 128356, 0, 0, 0, 0, 3846, 8070, 6150, 128109, 4370, 118617, 0, 0,
+ 74587, 0, 0, 0, 0, 4986, 12189, 917553, 67648, 120499, 0, 4257, 71695,
+ 123620, 6220, 0, 65561, 0, 0, 0, 0, 122652, 0, 0, 0, 69684, 0, 0, 128452,
+ 120873, 0, 0, 74922, 0, 71897, 0, 0, 67368, 67367, 8871, 67366, 0, 0, 0,
+ 0, 0, 67361, 0, 0, 67365, 67364, 3427, 4240, 67376, 67375, 67374, 67373,
+ 0, 0, 0, 67377, 0, 71689, 0, 0, 67372, 67371, 67370, 67369, 0, 0, 0,
+ 124962, 0, 0, 0, 0, 65898, 0, 65312, 0, 0, 0, 0, 4010, 121208, 41106, 0,
+ 0, 0, 41105, 0, 64803, 83456, 0, 0, 0, 0, 0, 0, 0, 11008, 0, 0, 71351,
+ 41110, 71681, 64892, 9113, 1954, 41108, 0, 42878, 0, 67405, 0, 0, 0, 0,
+ 0, 119539, 69435, 73463, 0, 4586, 129342, 0, 0, 0, 0, 0, 125233, 92307,
+ 0, 0, 0, 67382, 0, 9500, 0, 4957, 0, 2422, 2212, 0, 67381, 67380, 11045,
+ 67378, 0, 0, 3890, 12168, 121328, 0, 0, 0, 41947, 0, 120828, 74946,
+ 917901, 0, 1571, 66461, 41949, 42805, 8270, 943, 41946, 0, 2073, 0,
+ 41980, 0, 0, 0, 0, 4429, 6272, 0, 1460, 6954, 128572, 41120, 0, 65733, 0,
+ 41119, 0, 127006, 0, 0, 0, 129168, 12895, 0, 0, 0, 69440, 0, 1985, 6296,
+ 0, 0, 0, 0, 0, 41122, 0, 2457, 0, 0, 0, 0, 0, 0, 8840, 8035, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 8681, 0, 121505, 128747, 0, 0, 70102, 0, 124976, 9605,
+ 0, 13220, 0, 67354, 11312, 0, 9246, 67349, 0, 0, 0, 0, 10012, 12123, 0,
+ 0, 0, 0, 983846, 0, 0, 0, 67817, 0, 1272, 0, 0, 0, 983578, 0, 1467,
+ 119501, 917806, 0, 0, 0, 70312, 73537, 124955, 0, 70400, 0, 0, 72817, 0,
+ 19935, 0, 92162, 0, 0, 0, 128406, 5275, 0, 0, 44006, 129082, 0, 3789,
+ 128205, 0, 0, 0, 11474, 0, 0, 0, 129050, 0, 92194, 129503, 9537, 4496, 0,
+ 120443, 2605, 4500, 0, 55224, 8600, 0, 0, 41646, 11667, 69569, 0, 0,
+ 917905, 4499, 41649, 0, 0, 0, 69254, 0, 0, 0, 65804, 0, 70034, 41866, 0,
+ 0, 0, 11174, 0, 0, 0, 9559, 128773, 41940, 8299, 41945, 0, 41941, 5455,
+ 7190, 0, 0, 917810, 65266, 0, 41943, 10762, 0, 41931, 0, 0, 8106, 4128,
+ 0, 0, 4494, 0, 0, 72405, 0, 119567, 42068, 917808, 0, 11004, 12794,
+ 65072, 5271, 7317, 0, 0, 0, 0, 0, 0, 92281, 0, 0, 0, 0, 71880, 3868,
+ 71881, 983573, 128431, 7703, 0, 64390, 0, 7406, 120358, 93850, 0, 3985,
+ 66425, 0, 66615, 10177, 0, 41853, 71873, 12809, 0, 12193, 0, 10879,
+ 122945, 0, 9055, 0, 3851, 8132, 0, 0, 119263, 917908, 0, 0, 0, 0, 122940,
+ 42657, 122952, 7643, 0, 0, 122936, 43568, 0, 11949, 7650, 43569, 64951,
+ 7647, 7649, 0, 7646, 0, 0, 9651, 125005, 3891, 0, 0, 2337, 77831, 77832,
+ 67860, 129288, 0, 0, 43561, 67706, 119669, 0, 1860, 0, 68835, 5812,
+ 12784, 0, 0, 0, 0, 69260, 7727, 0, 69292, 69818, 66444, 128665, 42719, 0,
+ 1569, 0, 12534, 12124, 7690, 194871, 12533, 0, 68383, 67997, 0, 6969, 0,
+ 0, 0, 67974, 63895, 128650, 0, 0, 0, 42144, 0, 0, 0, 0, 92211, 119043, 0,
+ 0, 917545, 0, 0, 12791, 0, 0, 0, 4447, 71065, 12793, 0, 0, 43385, 0, 0,
+ 12790, 120256, 0, 983840, 12792, 120254, 0, 0, 12789, 128489, 12317,
+ 74934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127840, 41652, 2974, 78689, 11476,
+ 0, 0, 0, 0, 43871, 0, 10894, 119176, 74557, 65686, 0, 0, 3724, 67335,
+ 67334, 67333, 67338, 67337, 0, 67336, 0, 65306, 0, 128421, 0, 8646,
+ 129593, 77829, 0, 0, 74852, 0, 0, 0, 0, 0, 220, 120252, 43551, 0, 10044,
+ 0, 0, 983847, 68659, 110825, 5707, 71362, 0, 0, 0, 0, 0, 0, 10297, 0,
+ 41308, 67331, 0, 0, 0, 0, 2467, 0, 6003, 0, 0, 8040, 0, 0, 4182, 0,
+ 11135, 120501, 0, 0, 2510, 0, 10208, 0, 78302, 70829, 0, 0, 6837, 0, 0,
+ 67348, 0, 0, 0, 0, 1559, 67342, 11104, 67340, 67347, 67346, 67345, 67344,
+ 0, 0, 67357, 67356, 0, 0, 0, 0, 67352, 67351, 5516, 2845, 7717, 8036,
+ 65161, 67353, 5514, 12045, 6278, 0, 5515, 0, 0, 0, 0, 0, 65194, 100387,
+ 5517, 70116, 92774, 0, 67884, 0, 67890, 42094, 67880, 67881, 67882,
+ 67883, 0, 0, 67879, 120411, 1902, 67887, 67888, 12976, 126546, 12483,
+ 12368, 41769, 42726, 41765, 69557, 12787, 67874, 7556, 67878, 74351,
+ 67897, 989, 42677, 67889, 0, 6060, 0, 4326, 11000, 64601, 68478, 0, 0,
+ 6917, 0, 120837, 0, 0, 0, 6148, 8605, 74205, 0, 0, 0, 42715, 0, 101047,
+ 0, 68663, 0, 41796, 1269, 42703, 64754, 101049, 101042, 5144, 12221,
+ 42716, 71048, 5133, 4331, 0, 128675, 0, 5279, 121362, 71046, 0, 0, 42701,
+ 0, 0, 0, 121470, 0, 0, 0, 983311, 0, 72455, 121259, 42666, 12207, 1067,
+ 255, 12131, 0, 0, 0, 0, 0, 0, 0, 70728, 43460, 0, 42723, 125216, 0,
+ 70427, 0, 12797, 0, 0, 983722, 0, 67977, 12799, 0, 92504, 9746, 5135, 0,
+ 12796, 0, 0, 0, 5139, 346, 74303, 121134, 12795, 125109, 5168, 0, 43845,
+ 983727, 0, 8253, 8817, 1136, 983735, 43563, 127774, 129542, 0, 0, 0, 0,
+ 0, 0, 983619, 0, 0, 4041, 0, 2357, 43240, 12786, 0, 0, 0, 44004, 7142, 0,
+ 67984, 0, 0, 0, 0, 12785, 0, 0, 7770, 10712, 64853, 42679, 118916, 42375,
+ 0, 983124, 94074, 12119, 0, 11059, 10791, 111092, 450, 0, 0, 0, 0, 5450,
+ 64691, 0, 0, 44009, 0, 0, 111097, 94085, 1839, 94004, 0, 10927, 1701, 0,
+ 129610, 41749, 41761, 5453, 8361, 66045, 41758, 5444, 41763, 0, 0, 0,
+ 66349, 983138, 121274, 0, 0, 8801, 0, 4340, 0, 0, 0, 0, 70001, 41824, 0,
+ 0, 0, 0, 42700, 0, 127980, 0, 0, 0, 0, 0, 0, 4493, 4336, 129171, 2314,
+ 983061, 41808, 0, 0, 0, 64638, 0, 65937, 4489, 71331, 0, 0, 5358, 42717,
+ 0, 71236, 0, 0, 0, 127042, 41813, 2712, 0, 127044, 1410, 0, 0, 0, 0, 0,
+ 0, 0, 0, 128587, 0, 0, 0, 4892, 0, 0, 0, 0, 122966, 5777, 0, 759, 0,
+ 2079, 65248, 12788, 0, 64552, 0, 41803, 68043, 0, 0, 0, 0, 128785, 0,
+ 68492, 67991, 75071, 2340, 0, 120638, 0, 983902, 0, 0, 917865, 64749, 0,
+ 2321, 3587, 0, 67236, 9953, 9952, 0, 0, 42714, 9951, 0, 0, 127902, 74150,
+ 0, 0, 74757, 127554, 0, 983826, 2395, 0, 9976, 0, 125128, 0, 0, 0, 42809,
+ 42807, 0, 66290, 70854, 4150, 64424, 8318, 41790, 67976, 65559, 2360,
+ 41794, 0, 0, 120987, 0, 0, 2418, 0, 2411, 0, 41783, 0, 41786, 65108, 0,
+ 0, 41772, 42813, 2317, 0, 118980, 0, 0, 0, 0, 0, 0, 78682, 7753, 2351,
+ 6655, 64489, 0, 0, 0, 4443, 41697, 230, 65793, 0, 65943, 42803, 0, 0,
+ 5441, 0, 0, 127053, 0, 855, 0, 6109, 101021, 0, 119116, 69989, 0, 0,
+ 72146, 0, 101023, 0, 72148, 124918, 19915, 41892, 0, 0, 128901, 41887, 0,
+ 67980, 9735, 0, 0, 120591, 13082, 101026, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0,
+ 64504, 0, 69489, 120514, 0, 92962, 0, 42724, 69977, 0, 0, 0, 0, 67994, 0,
+ 0, 983823, 3565, 0, 0, 127553, 43035, 69898, 0, 0, 0, 0, 4891, 0, 0,
+ 4602, 0, 121065, 0, 0, 121157, 0, 43978, 8988, 0, 0, 0, 0, 0, 119184,
+ 121436, 73902, 69740, 0, 0, 72976, 0, 0, 8771, 0, 0, 0, 119209, 74974,
+ 71737, 0, 0, 67987, 0, 0, 0, 67989, 0, 10065, 8207, 0, 983588, 0, 0, 662,
+ 0, 41927, 0, 0, 0, 0, 0, 0, 0, 41929, 0, 0, 0, 41926, 69994, 0, 0, 0,
+ 126230, 68013, 1433, 64648, 6475, 0, 120983, 0, 73876, 0, 0, 0, 67992,
+ 78052, 0, 3978, 0, 0, 0, 0, 120761, 12281, 0, 0, 13241, 0, 0, 0, 0,
+ 11765, 42577, 0, 0, 2641, 7192, 0, 0, 118809, 101015, 0, 101016, 128948,
+ 101013, 6479, 64294, 118683, 0, 0, 0, 64334, 0, 0, 0, 92266, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9478, 127339, 124964, 0, 202, 0, 0, 1242, 0, 121170, 0,
+ 63940, 0, 0, 0, 63939, 11990, 92430, 67982, 0, 65440, 70068, 0, 0, 64829,
+ 0, 0, 0, 0, 0, 2858, 0, 63989, 0, 69239, 0, 121152, 0, 77841, 0, 70078,
+ 92574, 129519, 0, 0, 0, 128974, 0, 12922, 92498, 0, 66424, 71124, 0, 0,
+ 0, 2856, 0, 47, 0, 126986, 65858, 0, 0, 0, 0, 119161, 8417, 65903, 0, 0,
+ 0, 4033, 128164, 0, 0, 0, 129961, 64600, 1903, 12320, 0, 120894, 0, 0,
+ 8915, 0, 945, 0, 0, 0, 0, 111068, 0, 74828, 0, 69560, 9531, 0, 8505, 0,
+ 119238, 0, 0, 65538, 0, 0, 0, 0, 0, 0, 63935, 0, 0, 0, 0, 0, 64787,
+ 111060, 0, 0, 110828, 0, 2230, 0, 0, 71886, 9843, 0, 92419, 111062,
+ 67488, 92715, 0, 1320, 0, 1673, 0, 92383, 129902, 9338, 128355, 0, 0, 0,
+ 0, 11997, 0, 0, 0, 0, 0, 0, 43308, 0, 0, 0, 0, 0, 0, 0, 63920, 0, 0, 0,
+ 0, 0, 0, 3514, 78723, 0, 7492, 0, 0, 0, 7514, 0, 63924, 0, 7502, 7587, 0,
+ 0, 0, 118689, 43881, 7610, 0, 0, 118710, 692, 43588, 0, 0, 75056, 9688,
+ 0, 9535, 0, 0, 0, 64530, 0, 125251, 194861, 0, 72209, 7453, 0, 8013,
+ 66396, 0, 0, 8895, 5356, 0, 5458, 0, 2866, 0, 127860, 71732, 71724, 6700,
+ 0, 111081, 120583, 0, 110614, 0, 9641, 63830, 65294, 0, 0, 67969, 0,
+ 7441, 0, 63826, 0, 0, 0, 0, 2844, 983972, 0, 63824, 12139, 67971, 0, 0,
+ 3358, 65295, 0, 3104, 0, 0, 0, 0, 65772, 0, 0, 0, 0, 2862, 11326, 0, 0,
+ 94001, 3268, 66591, 0, 6552, 42367, 7035, 120558, 0, 0, 1814, 195092,
+ 10240, 195093, 0, 0, 0, 0, 0, 66960, 0, 0, 2837, 4341, 0, 0, 129982,
+ 125064, 195094, 0, 0, 66964, 0, 72721, 863, 66936, 0, 0, 43323, 66928, 0,
+ 0, 68054, 0, 3654, 66951, 0, 66942, 0, 0, 7653, 0, 0, 66587, 0, 0, 92401,
+ 0, 0, 12927, 0, 0, 129697, 13056, 0, 0, 3056, 0, 0, 195101, 0, 0, 74506,
+ 73770, 0, 0, 0, 0, 0, 0, 0, 0, 72233, 0, 5811, 0, 0, 0, 66817, 983855, 0,
+ 0, 128636, 129311, 0, 128041, 0, 67739, 120965, 0, 0, 67507, 0, 68375, 0,
+ 0, 70300, 0, 0, 0, 983698, 111078, 0, 11991, 128079, 0, 92943, 1502,
+ 74117, 127988, 0, 129478, 121253, 0, 67661, 0, 0, 125084, 68667, 0,
+ 74057, 68639, 0, 42898, 120742, 0, 74388, 74838, 120822, 0, 0, 0, 0,
+ 69452, 43214, 5893, 0, 0, 92496, 0, 0, 119907, 119900, 0, 0, 0, 0, 41950,
+ 0, 0, 68610, 0, 68626, 894, 0, 0, 12306, 73846, 0, 0, 0, 8636, 0, 121028,
+ 42503, 0, 92942, 0, 121468, 119241, 0, 126569, 5096, 5095, 2863, 127505,
+ 0, 10454, 42530, 5094, 0, 0, 13156, 0, 111035, 5093, 111024, 983419, 0,
+ 5092, 10708, 11327, 0, 5091, 0, 0, 9153, 4104, 78599, 78601, 2929, 42712,
+ 75067, 12272, 9832, 0, 0, 111105, 0, 0, 0, 0, 0, 0, 13106, 0, 0, 129111,
+ 0, 0, 0, 0, 9074, 111111, 0, 111110, 0, 8113, 11168, 92563, 1786, 111109,
+ 0, 111108, 0, 74423, 0, 586, 74414, 64359, 1267, 0, 127531, 0, 65731, 0,
+ 0, 0, 92932, 0, 0, 0, 0, 0, 0, 1228, 0, 42846, 0, 0, 70343, 1714, 74406,
+ 0, 0, 0, 127389, 66225, 0, 0, 42660, 0, 0, 3804, 0, 0, 129859, 0, 2826,
+ 0, 0, 0, 128396, 0, 0, 0, 0, 0, 0, 12206, 5839, 0, 68524, 74065, 73521,
+ 0, 0, 126240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67241, 917821, 7030, 0,
+ 10479, 64959, 2852, 0, 121225, 0, 0, 128586, 0, 6963, 0, 0, 0, 74786, 0,
+ 0, 0, 0, 121281, 0, 0, 0, 0, 113815, 121360, 0, 9994, 118680, 2864,
+ 64719, 1148, 0, 41677, 0, 0, 2765, 0, 128181, 0, 0, 0, 92516, 74777, 0,
+ 0, 65206, 0, 0, 0, 0, 69391, 0, 0, 983770, 0, 41839, 129616, 983773, 0,
+ 0, 6931, 0, 0, 7177, 125137, 0, 0, 0, 93020, 0, 10722, 0, 0, 128186,
+ 121050, 0, 0, 127207, 0, 750, 0, 129453, 63912, 0, 0, 7032, 0, 0, 4314,
+ 128600, 0, 128409, 730, 0, 127866, 0, 0, 41380, 0, 0, 0, 69697, 8240,
+ 92939, 0, 41378, 0, 6938, 70026, 0, 0, 66246, 0, 0, 0, 0, 0, 0, 983094,
+ 0, 92754, 41470, 64805, 0, 0, 0, 0, 0, 0, 0, 0, 92938, 68370, 0, 0,
+ 73831, 0, 0, 0, 2872, 0, 0, 0, 0, 604, 41097, 0, 0, 0, 0, 0, 127488, 0,
+ 2836, 0, 0, 9707, 0, 43202, 0, 0, 69374, 0, 0, 120916, 2832, 92702, 9670,
+ 12937, 0, 0, 0, 0, 2822, 0, 0, 92519, 0, 73752, 0, 0, 0, 1331, 92603, 0,
+ 11856, 73510, 129432, 5090, 5089, 0, 3200, 0, 0, 0, 5088, 0, 0, 9477, 0,
+ 0, 5087, 92325, 0, 96, 5086, 0, 0, 0, 5085, 64286, 0, 0, 43820, 0,
+ 129710, 0, 0, 119042, 0, 129660, 0, 0, 0, 0, 0, 127241, 120891, 7601, 0,
+ 591, 0, 118953, 0, 0, 0, 0, 0, 10939, 7246, 6933, 67142, 67141, 0, 74600,
+ 120695, 0, 67138, 65574, 0, 78058, 67140, 73851, 74598, 67139, 128094, 0,
+ 6372, 0, 73514, 7963, 6371, 0, 0, 125040, 0, 0, 0, 0, 0, 0, 0, 8258,
+ 123591, 0, 0, 65148, 118919, 42, 0, 0, 0, 0, 0, 0, 0, 0, 67135, 67134,
+ 67133, 0, 0, 0, 0, 67136, 67130, 74597, 11550, 0, 67132, 65868, 0, 12826,
+ 127872, 124116, 126235, 9737, 92448, 0, 0, 0, 8878, 0, 0, 0, 0, 0, 72220,
+ 9086, 0, 100952, 0, 7437, 7454, 0, 0, 0, 0, 9042, 0, 0, 0, 0, 3805, 0,
+ 67128, 44001, 67126, 0, 44022, 19949, 12200, 43522, 983045, 43525, 0, 0,
+ 0, 64422, 67125, 67124, 7602, 0, 0, 43521, 0, 0, 43711, 43523, 41447,
+ 8424, 68483, 8704, 2397, 0, 0, 0, 0, 0, 10916, 0, 129290, 93998, 0, 0, 0,
+ 127800, 67686, 9961, 123203, 0, 68842, 10792, 8889, 121402, 6951, 0,
+ 68827, 917835, 74342, 0, 0, 0, 68816, 129152, 0, 42909, 66597, 70092, 0,
+ 0, 10481, 4559, 0, 1956, 43138, 0, 0, 43490, 43148, 0, 0, 0, 43140, 0, 0,
+ 0, 0, 69268, 8533, 0, 0, 0, 0, 0, 4357, 0, 70289, 983157, 0, 42911, 0, 0,
+ 0, 10941, 0, 6962, 0, 0, 113808, 0, 11014, 0, 8942, 12000, 0, 0, 73515,
+ 0, 0, 0, 42650, 0, 75016, 63975, 0, 66210, 0, 0, 129150, 0, 11193, 0, 0,
+ 0, 0, 0, 0, 0, 43476, 0, 11024, 74811, 72787, 10563, 92954, 0, 0, 2462,
+ 92955, 0, 0, 66213, 6957, 0, 120559, 0, 0, 0, 74594, 983424, 92347, 0,
+ 110702, 110708, 110707, 127119, 3109, 127117, 119909, 0, 121434, 0, 0,
+ 4042, 0, 0, 0, 127123, 127122, 127121, 0, 127999, 0, 3503, 74444, 68300,
+ 6694, 127997, 0, 0, 74306, 0, 983757, 7736, 0, 0, 0, 10521, 0, 42173,
+ 9705, 0, 129719, 6955, 71467, 0, 6149, 3887, 19956, 1411, 2824, 0, 0, 0,
+ 1403, 0, 1347, 66282, 127996, 0, 0, 0, 0, 8640, 0, 1178, 1654, 0, 0,
+ 129529, 43314, 0, 0, 0, 0, 2873, 67461, 0, 0, 67085, 10861, 0, 0, 70377,
+ 0, 67082, 11159, 41391, 67084, 0, 376, 6987, 983182, 119904, 0, 8823, 0,
+ 12943, 65185, 100988, 42099, 0, 0, 100990, 0, 8301, 0, 0, 1684, 0, 0, 0,
+ 120620, 0, 0, 0, 42121, 0, 66781, 78067, 42115, 0, 127998, 0, 67080,
+ 1493, 42111, 67077, 4097, 0, 983767, 0, 65808, 41642, 0, 118568, 67076,
+ 41636, 67074, 65095, 110660, 72254, 121240, 41629, 12154, 75073, 0,
+ 128179, 74084, 64380, 0, 0, 0, 0, 0, 71193, 65371, 7078, 121218, 0, 0,
+ 74592, 0, 0, 43275, 0, 41434, 6062, 0, 0, 19916, 0, 6950, 9606, 9842, 0,
+ 65744, 0, 0, 128659, 0, 41615, 10105, 0, 0, 41632, 7493, 0, 0, 41622, 0,
+ 0, 0, 0, 7632, 983217, 983216, 9805, 5990, 900, 0, 122955, 0, 120869,
+ 3612, 0, 64376, 0, 5389, 129469, 73495, 0, 2839, 9621, 582, 0, 0, 3749,
+ 0, 7569, 0, 0, 92865, 6956, 4403, 0, 0, 3299, 0, 0, 119127, 65676, 0,
+ 74372, 0, 983497, 7598, 69819, 42469, 42242, 1918, 9542, 480, 7716, 0, 0,
+ 0, 0, 0, 69918, 0, 8328, 0, 118894, 0, 0, 0, 0, 11132, 983502, 66743,
+ 74185, 100531, 2854, 66747, 0, 65755, 0, 67120, 67119, 65835, 67117,
+ 66736, 67123, 67122, 67121, 9881, 100481, 65757, 100538, 100459, 67116,
+ 8648, 128377, 6741, 43047, 0, 13180, 0, 100487, 66754, 73507, 73487, 0,
+ 0, 41752, 0, 8641, 100490, 125185, 73477, 100462, 100541, 6942, 69501,
+ 1024, 42849, 41751, 0, 8941, 101034, 11121, 0, 9023, 40973, 121476, 9928,
+ 67109, 66865, 0, 67114, 67113, 67112, 67111, 0, 41206, 120724, 9049,
+ 67108, 43166, 0, 41200, 128201, 125142, 126537, 0, 0, 41188, 119553, 0,
+ 101007, 917548, 74585, 78626, 0, 0, 11466, 0, 120797, 0, 125067, 2261, 0,
+ 2860, 0, 0, 70828, 127925, 92357, 67106, 12065, 42872, 0, 43875, 67103,
+ 43856, 0, 67102, 67105, 7531, 40981, 2413, 100522, 67404, 100521, 0,
+ 67101, 41196, 100523, 0, 129723, 73512, 43117, 100495, 0, 0, 0, 0, 69876,
+ 0, 7173, 496, 0, 4313, 64607, 0, 0, 983202, 2065, 42793, 2842, 0, 83152,
+ 13132, 798, 0, 12801, 67098, 10686, 118528, 128143, 0, 8054, 9174, 67087,
+ 67086, 67097, 67096, 41611, 67095, 74504, 78854, 42512, 0, 78857, 42089,
+ 74613, 78856, 0, 101029, 100468, 42079, 100467, 0, 66961, 100474, 0, 0,
+ 0, 68338, 69958, 0, 0, 0, 0, 0, 78859, 42093, 128951, 100504, 0, 0, 0,
+ 4580, 0, 0, 0, 92167, 0, 3021, 42004, 0, 0, 42317, 41998, 0, 6946, 77920,
+ 0, 123610, 0, 0, 0, 121442, 42690, 9880, 0, 0, 64589, 0, 0, 127880,
+ 68035, 0, 11360, 0, 0, 72242, 0, 0, 0, 0, 0, 64941, 0, 0, 0, 6856, 65671,
+ 11244, 73706, 6959, 41994, 42907, 0, 0, 122902, 8617, 41982, 8860, 0, 0,
+ 121256, 0, 0, 9597, 0, 43172, 0, 10117, 0, 92297, 65865, 73549, 0,
+ 128077, 0, 126065, 0, 187, 0, 65669, 0, 4963, 0, 0, 0, 8964, 0, 7775, 0,
+ 41948, 0, 0, 101010, 41942, 65449, 3160, 65922, 13226, 42665, 0, 42663,
+ 128210, 41766, 983503, 78848, 78849, 41760, 1189, 905, 110620, 42658,
+ 78851, 67859, 9629, 6742, 0, 43625, 12952, 7888, 0, 3980, 0, 42656, 0,
+ 42055, 0, 0, 0, 64540, 0, 7867, 69218, 6236, 0, 73490, 10505, 0, 12851,
+ 118948, 0, 5474, 128843, 3103, 0, 41753, 41733, 78051, 983477, 78844,
+ 78845, 41739, 78843, 70744, 10931, 41756, 43347, 68098, 122909, 41746,
+ 119147, 92591, 41259, 66954, 69930, 2691, 121338, 11231, 41244, 0, 69800,
+ 66364, 41262, 67503, 0, 0, 41251, 0, 0, 11805, 0, 0, 68331, 94045, 0, 0,
+ 0, 74633, 41266, 126642, 0, 0, 0, 65741, 41737, 2275, 2666, 121232,
+ 41738, 4967, 419, 13126, 0, 0, 42822, 0, 6434, 74913, 0, 0, 6432, 0,
+ 69932, 128862, 769, 41742, 69927, 74805, 6433, 0, 547, 1943, 6439, 0,
+ 4994, 487, 0, 0, 3754, 0, 0, 0, 0, 74780, 0, 0, 1595, 92777, 74431, 0, 0,
+ 74860, 43267, 0, 0, 129083, 12185, 69406, 0, 73479, 100984, 0, 42856, 0,
+ 0, 983765, 128319, 75057, 0, 0, 0, 65612, 0, 669, 0, 0, 0, 0, 0, 70445,
+ 100404, 69929, 0, 0, 460, 121513, 0, 0, 0, 120747, 0, 121519, 121518, 0,
+ 0, 121515, 71491, 65187, 9044, 78497, 11760, 78494, 7577, 78491, 41912,
+ 100412, 0, 100411, 0, 0, 100394, 78501, 0, 2933, 78500, 0, 66441, 100392,
+ 100397, 100391, 1549, 0, 100415, 0, 41755, 6206, 8670, 120587, 0, 69935,
+ 0, 0, 69768, 73492, 0, 66958, 0, 0, 10552, 64342, 41922, 0, 917858, 0,
+ 917857, 2717, 0, 0, 0, 73664, 41908, 100722, 41916, 0, 0, 0, 92506,
+ 100723, 66664, 69803, 0, 100725, 0, 0, 43373, 0, 0, 8468, 100729, 121173,
+ 128297, 119210, 118952, 0, 0, 0, 100686, 0, 0, 0, 128703, 100670, 457,
+ 78502, 78503, 123180, 43006, 0, 8802, 113777, 0, 0, 0, 0, 126632, 0,
+ 41757, 0, 100657, 44000, 0, 0, 43534, 0, 0, 11961, 121316, 0, 0, 0,
+ 128736, 0, 0, 9499, 73522, 128330, 0, 0, 92260, 68184, 0, 0, 7256, 66993,
+ 983180, 0, 42161, 0, 119126, 128022, 65880, 0, 10802, 64861, 0, 0, 0, 0,
+ 0, 0, 73109, 0, 955, 0, 0, 5350, 64339, 0, 100705, 10875, 0, 5477, 73121,
+ 0, 0, 0, 67693, 69790, 0, 0, 3874, 0, 983741, 0, 0, 83272, 100674,
+ 127397, 0, 100989, 0, 41038, 67502, 9207, 42239, 0, 0, 0, 0, 74432, 0, 0,
+ 1455, 129680, 0, 11753, 119233, 0, 118594, 127854, 100716, 69801, 0, 0,
+ 43520, 0, 119556, 0, 0, 0, 0, 100733, 10788, 6088, 0, 129587, 190,
+ 983346, 12593, 100737, 129308, 64408, 0, 4417, 128615, 74359, 41744, 0,
+ 0, 100435, 6965, 0, 0, 13201, 100430, 69896, 78868, 74382, 11841, 7918,
+ 92721, 0, 0, 0, 1728, 0, 0, 0, 983350, 92679, 0, 0, 92711, 0, 0, 119536,
+ 73491, 66679, 8382, 0, 0, 100381, 0, 917889, 42254, 68371, 100383, 0, 0,
+ 0, 9923, 0, 0, 11763, 100386, 120688, 0, 78187, 0, 0, 0, 0, 8333, 0, 0,
+ 0, 917805, 74464, 0, 92320, 74080, 0, 69911, 11910, 0, 74141, 8963, 0, 0,
+ 0, 121396, 0, 41747, 0, 0, 8968, 0, 0, 129110, 110590, 0, 8836, 12315, 0,
+ 8300, 0, 0, 0, 8856, 0, 0, 69891, 0, 66965, 120405, 120402, 120403,
+ 120400, 120401, 12853, 43269, 7263, 120244, 6536, 120238, 120239, 65516,
+ 12321, 120391, 120388, 55287, 2237, 120246, 9588, 120248, 120382, 120383,
+ 120380, 120381, 0, 0, 3561, 0, 0, 10613, 0, 110583, 0, 0, 0, 128689,
+ 5006, 64328, 68219, 917894, 0, 8825, 122972, 0, 0, 0, 128616, 0, 119177,
+ 0, 0, 128641, 120225, 71366, 120227, 120228, 438, 4510, 41707, 8721,
+ 120233, 120234, 120235, 12840, 120229, 10845, 120231, 8096, 0, 120935, 0,
+ 0, 65589, 8733, 0, 0, 0, 0, 0, 0, 93984, 11262, 73747, 128522, 917902,
+ 64591, 42405, 0, 0, 1632, 127982, 128326, 0, 0, 121327, 121477, 42444, 0,
+ 0, 215, 41258, 128494, 64494, 1953, 10185, 0, 1256, 3910, 41260, 917903,
+ 0, 0, 41257, 0, 8675, 10700, 0, 124951, 0, 9333, 0, 121471, 0, 0, 0, 0,
+ 0, 499, 0, 70729, 42915, 0, 101000, 0, 100999, 0, 0, 73111, 128893,
+ 122897, 0, 125006, 0, 11118, 0, 128009, 0, 0, 118633, 9180, 0, 0, 0,
+ 100986, 43438, 118588, 0, 0, 0, 0, 120669, 64782, 0, 0, 73969, 565,
+ 42484, 118913, 201, 0, 42292, 69610, 0, 0, 119625, 43518, 0, 0, 1022,
+ 113788, 3880, 74247, 0, 0, 0, 0, 0, 0, 0, 0, 72272, 100997, 0, 0, 66937,
+ 74255, 0, 0, 92598, 0, 9903, 118993, 0, 68226, 0, 0, 0, 127788, 100955,
+ 83280, 7892, 0, 10777, 0, 0, 65562, 0, 101002, 0, 8039, 3363, 101009, 0,
+ 0, 66940, 12596, 70812, 0, 0, 0, 0, 42944, 92425, 74992, 64541, 0, 0,
+ 10520, 12802, 0, 12998, 0, 83270, 42861, 83273, 11415, 0, 7541, 125068,
+ 65878, 822, 0, 0, 5774, 194746, 43252, 0, 92619, 7672, 129281, 0, 0,
+ 7463, 0, 0, 0, 0, 0, 0, 121411, 0, 0, 0, 66938, 0, 475, 0, 120586, 7329,
+ 0, 0, 195088, 66291, 10645, 0, 6543, 100966, 0, 0, 119065, 0, 0, 0,
+ 983237, 195095, 0, 8923, 1645, 0, 0, 0, 3196, 72404, 0, 0, 43595, 0, 0,
+ 0, 0, 0, 195076, 0, 0, 5258, 4328, 0, 0, 0, 405, 11454, 0, 0, 0, 0,
+ 75052, 41245, 0, 195078, 4523, 11369, 0, 0, 0, 195079, 0, 0, 983510, 0,
+ 100961, 10480, 74610, 0, 0, 0, 12610, 0, 41247, 0, 7609, 118837, 0, 0,
+ 92253, 0, 984, 0, 92621, 0, 0, 129885, 73982, 0, 0, 0, 43369, 0, 0, 0,
+ 983507, 6634, 0, 71952, 0, 66930, 74214, 0, 67709, 0, 0, 0, 71114, 9552,
+ 0, 0, 0, 12997, 0, 0, 0, 0, 129109, 12883, 10994, 10529, 55283, 0, 74618,
+ 0, 67736, 10661, 19951, 9614, 2428, 0, 121023, 92837, 126224, 66933,
+ 71127, 0, 124996, 119162, 1952, 92181, 8455, 100958, 118654, 93033,
+ 119566, 100960, 0, 12183, 100951, 0, 64929, 0, 0, 0, 128290, 42509,
+ 73087, 3922, 9187, 983626, 0, 0, 119057, 0, 3353, 9358, 0, 0, 66680, 0,
+ 73975, 12879, 0, 9795, 68380, 0, 0, 119488, 0, 0, 41027, 0, 66931, 0,
+ 983631, 0, 70378, 0, 11751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129356, 0, 0,
+ 0, 0, 41029, 0, 126513, 0, 0, 0, 11294, 0, 66665, 0, 0, 127750, 0, 0,
+ 70105, 0, 983643, 0, 67843, 0, 0, 121167, 983895, 0, 8088, 129412, 0, 0,
+ 0, 983992, 6926, 72423, 0, 129569, 42369, 4350, 0, 65145, 9041, 43559, 0,
+ 0, 0, 41263, 0, 0, 0, 65825, 9577, 68199, 0, 0, 983122, 0, 6793, 0,
+ 70409, 0, 0, 0, 0, 64669, 0, 0, 0, 11200, 72725, 2995, 0, 0, 0, 7868,
+ 72720, 72020, 11386, 1009, 70405, 66871, 2333, 0, 0, 0, 0, 0, 70407,
+ 128121, 0, 0, 0, 0, 983657, 66949, 0, 74968, 0, 0, 110601, 0, 0, 41261,
+ 0, 0, 0, 0, 118989, 6736, 917883, 124132, 43010, 66952, 0, 69635, 73011,
+ 983716, 0, 0, 7293, 0, 0, 0, 0, 111332, 0, 128245, 69928, 127071, 0,
+ 127072, 64445, 111336, 6635, 0, 0, 72707, 74936, 0, 0, 917876, 0, 93025,
+ 66948, 0, 111329, 0, 129887, 128045, 65219, 11925, 0, 92434, 0, 0, 9845,
+ 101317, 7546, 0, 0, 11230, 4985, 13288, 672, 8098, 0, 0, 0, 128126,
+ 42655, 0, 0, 1577, 11772, 78327, 0, 66673, 0, 65911, 118705, 0, 0,
+ 101303, 92180, 0, 0, 120566, 125140, 127177, 0, 0, 119593, 1539, 0,
+ 74969, 42731, 0, 74970, 71066, 0, 3051, 0, 73783, 0, 0, 0, 0, 78777, 0,
+ 983161, 0, 0, 101310, 0, 0, 0, 0, 0, 0, 3505, 8707, 0, 6725, 128013, 0,
+ 92314, 0, 66391, 5479, 0, 6686, 0, 0, 983318, 42754, 0, 0, 0, 0, 0, 0,
+ 128523, 0, 0, 4433, 41156, 0, 74971, 1443, 9339, 0, 92871, 10926, 0,
+ 43511, 0, 0, 983324, 0, 126086, 72236, 10021, 0, 101329, 0, 65914, 0,
+ 66749, 0, 6721, 217, 12466, 0, 0, 10443, 0, 68654, 0, 0, 0, 78334, 0,
+ 41250, 0, 129532, 128375, 0, 0, 69232, 0, 41252, 66682, 0, 119637, 41249,
+ 1366, 0, 0, 101326, 0, 0, 4397, 101324, 0, 66946, 9545, 101323, 0, 0, 0,
+ 3511, 0, 92190, 0, 0, 126244, 760, 0, 12088, 0, 0, 42256, 0, 0, 417, 0,
+ 111347, 41565, 74965, 0, 111355, 0, 0, 0, 2284, 0, 0, 11311, 0, 0, 0, 0,
+ 0, 0, 42273, 0, 69430, 121041, 0, 126643, 0, 65910, 0, 10246, 0, 68224,
+ 12169, 128858, 4552, 0, 0, 0, 1375, 66705, 128412, 0, 3329, 0, 42811,
+ 74251, 74192, 120794, 7840, 0, 0, 65374, 0, 0, 71072, 0, 4396, 0, 126608,
+ 0, 10331, 125224, 0, 11543, 0, 8944, 0, 0, 0, 0, 0, 19965, 43025, 10299,
+ 128436, 68845, 0, 69724, 67412, 92952, 0, 43811, 0, 128924, 0, 11062,
+ 128748, 0, 0, 0, 69276, 2901, 7865, 66945, 78354, 0, 78347, 0, 126123, 0,
+ 66363, 0, 0, 0, 74967, 7414, 0, 0, 92691, 0, 128507, 885, 64772, 65180,
+ 0, 71267, 852, 0, 0, 0, 78614, 121174, 129092, 67809, 9609, 12156, 0,
+ 122930, 43586, 11035, 10411, 0, 13268, 6710, 0, 0, 0, 43853, 77949, 4315,
+ 0, 111104, 0, 43639, 43343, 0, 0, 0, 73074, 0, 65812, 43431, 0, 0, 0, 0,
+ 0, 129890, 0, 0, 0, 0, 994, 125222, 127104, 127103, 73966, 66890, 0,
+ 65291, 70753, 0, 0, 0, 0, 66873, 4186, 92531, 127106, 127105, 6718, 7330,
+ 4406, 122946, 8480, 7319, 64373, 128699, 4413, 0, 0, 3198, 0, 0, 92469,
+ 111126, 0, 128591, 128681, 0, 0, 0, 101321, 73023, 742, 0, 2893, 78738,
+ 0, 0, 0, 2553, 42294, 6756, 0, 73020, 8363, 0, 2993, 128381, 3916, 4301,
+ 0, 1141, 42407, 0, 0, 7572, 973, 0, 125077, 0, 2415, 0, 0, 9640, 42333,
+ 0, 0, 129546, 42486, 43381, 65390, 0, 69434, 1202, 0, 0, 0, 0, 68484, 0,
+ 0, 64542, 3260, 0, 65388, 43502, 69904, 0, 6738, 0, 0, 74193, 0, 0, 0,
+ 74641, 6312, 0, 74556, 12446, 0, 0, 128076, 8229, 1235, 0, 11472, 83064,
+ 0, 0, 101366, 0, 0, 1740, 12872, 0, 985, 0, 0, 0, 12068, 983658, 0,
+ 101363, 0, 0, 0, 13133, 65071, 110780, 12655, 12134, 0, 92934, 0, 66915,
+ 120349, 119572, 0, 93030, 41572, 0, 0, 0, 41573, 0, 3931, 0, 74143, 2251,
+ 127034, 0, 0, 0, 0, 83067, 0, 129303, 0, 0, 0, 0, 0, 0, 83068, 0, 72740,
+ 128637, 72717, 92935, 120291, 0, 1780, 6936, 0, 0, 819, 0, 9694, 125228,
+ 0, 0, 0, 0, 8343, 8342, 8345, 8344, 8346, 8338, 7523, 6922, 8348, 8347,
+ 7525, 3346, 8339, 125004, 72705, 69462, 268, 0, 0, 5754, 94019, 0,
+ 110684, 8336, 0, 0, 0, 8337, 8341, 0, 11388, 7522, 0, 0, 0, 11090, 6953,
+ 125240, 0, 74973, 120708, 0, 0, 0, 0, 0, 110782, 0, 9038, 7887, 0, 0,
+ 42534, 64347, 0, 0, 67660, 120341, 0, 122933, 0, 120878, 0, 0, 73999, 0,
+ 64580, 0, 0, 64643, 0, 0, 74975, 0, 92227, 129052, 0, 83071, 83072,
+ 83073, 119154, 0, 119153, 0, 0, 5349, 72440, 2160, 917554, 7411, 0,
+ 983224, 0, 0, 0, 42736, 70747, 5756, 983229, 92946, 0, 42764, 0, 0,
+ 119529, 5752, 120600, 0, 0, 0, 0, 0, 78893, 0, 0, 0, 125242, 0, 0,
+ 120331, 122957, 0, 0, 67501, 0, 10080, 83056, 12647, 0, 0, 69252, 66882,
+ 0, 0, 0, 0, 0, 72005, 72845, 0, 0, 0, 0, 0, 74213, 0, 0, 0, 0, 0, 6302,
+ 0, 0, 0, 0, 1417, 983226, 0, 9452, 0, 74393, 0, 0, 110850, 0, 65391,
+ 63789, 69251, 78659, 78660, 41264, 78658, 6426, 42398, 9179, 78654,
+ 64906, 41255, 42036, 0, 41269, 0, 41267, 42436, 67759, 42323, 42034, 0,
+ 0, 42475, 42033, 0, 0, 68916, 43948, 0, 78673, 78674, 1659, 919, 42784,
+ 1671, 0, 6069, 9219, 0, 1661, 71489, 0, 92690, 10140, 9713, 78400,
+ 119143, 125236, 0, 2306, 0, 0, 6068, 10612, 0, 0, 121314, 92561, 41462,
+ 0, 0, 0, 0, 0, 0, 0, 128204, 10635, 0, 983225, 0, 0, 0, 983235, 92251, 0,
+ 121029, 983227, 0, 8100, 0, 78669, 78670, 13301, 78667, 9667, 78665, 0,
+ 0, 11003, 9904, 0, 0, 0, 0, 0, 0, 78680, 78681, 78677, 78678, 0, 10313,
+ 0, 0, 64320, 10265, 78686, 129404, 78684, 78685, 8945, 78683, 70750, 41,
+ 0, 0, 0, 0, 8655, 0, 0, 71333, 0, 0, 0, 0, 2585, 0, 65254, 3126, 0,
+ 74136, 10957, 0, 11160, 0, 0, 0, 0, 0, 11408, 0, 7443, 0, 0, 6997, 68004,
+ 0, 0, 8739, 11075, 0, 65216, 0, 69795, 2593, 0, 0, 0, 0, 125062, 0, 0, 0,
+ 4411, 0, 72837, 0, 43442, 78799, 0, 0, 0, 66351, 0, 0, 13061, 0, 78687,
+ 78688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119925, 0, 983637, 0, 0, 0,
+ 71494, 83399, 127541, 83398, 8022, 78808, 0, 73794, 0, 0, 83414, 119916,
+ 0, 0, 0, 0, 0, 0, 63799, 78427, 12063, 78425, 78424, 0, 0, 0, 75025, 0,
+ 297, 0, 0, 68326, 0, 78429, 78428, 7077, 2497, 128651, 0, 983112, 0, 0,
+ 0, 4292, 0, 74815, 10512, 0, 74814, 119931, 0, 72841, 2503, 65070, 1762,
+ 69794, 2495, 0, 71230, 94069, 77984, 0, 12654, 0, 1899, 0, 2507, 0, 8726,
+ 0, 65594, 0, 71272, 8892, 0, 0, 0, 0, 0, 420, 0, 0, 125130, 10797, 74637,
+ 0, 0, 0, 0, 63796, 0, 66581, 0, 119205, 0, 0, 194840, 0, 120788, 92817,
+ 0, 92956, 0, 0, 0, 0, 119230, 0, 0, 83496, 7399, 0, 66434, 42779, 0,
+ 92220, 42197, 92543, 5380, 0, 0, 1155, 11365, 43126, 0, 77971, 65684, 0,
+ 5601, 0, 42765, 78258, 0, 7987, 72843, 0, 69799, 6857, 0, 78735, 119165,
+ 0, 0, 4473, 0, 72426, 0, 65347, 65346, 65345, 0, 127384, 0, 69802, 0,
+ 73868, 0, 64826, 0, 0, 0, 0, 6218, 78422, 69676, 4555, 0, 83459, 70071,
+ 128670, 65190, 0, 0, 65244, 0, 0, 42519, 74472, 0, 0, 83466, 0, 0, 0,
+ 83468, 92581, 0, 0, 65370, 65369, 65368, 65367, 65366, 65365, 41086,
+ 65363, 65362, 65361, 65360, 43410, 11323, 65357, 65356, 65355, 5345,
+ 65353, 65352, 65351, 761, 65349, 19959, 69718, 0, 0, 0, 0, 64647, 0, 0,
+ 4699, 126077, 0, 129940, 0, 0, 0, 68074, 0, 0, 0, 128347, 0, 72829, 0,
+ 69773, 121438, 0, 0, 0, 73980, 78255, 78254, 83453, 43157, 0, 0, 0, 7946,
+ 12541, 0, 74615, 69780, 0, 0, 0, 0, 9005, 1225, 0, 0, 0, 0, 68011, 8847,
+ 0, 0, 0, 8329, 74590, 43878, 0, 0, 0, 3127, 2595, 71040, 69766, 129188,
+ 0, 41089, 0, 0, 70292, 983613, 12112, 0, 74200, 0, 8764, 0, 0, 0, 67273,
+ 67272, 67271, 71044, 0, 0, 0, 71042, 67266, 67265, 0, 67270, 67269,
+ 67268, 67267, 67282, 67281, 67280, 3572, 10023, 4959, 0, 0, 67275, 9729,
+ 125110, 0, 67278, 67277, 0, 67276, 0, 7996, 9907, 0, 13304, 83392, 0,
+ 72830, 0, 11095, 11100, 0, 83358, 83387, 10142, 0, 0, 0, 0, 68022, 0,
+ 83363, 128292, 19955, 0, 83366, 69807, 125246, 70124, 0, 72230, 83373,
+ 83385, 0, 0, 0, 0, 68020, 0, 2239, 261, 8406, 7791, 0, 7362, 0, 10696, 0,
+ 0, 9838, 118920, 0, 83477, 0, 0, 0, 6437, 68830, 83476, 0, 0, 74177, 0,
+ 0, 67288, 67287, 0, 67286, 0, 83470, 0, 67289, 67283, 83471, 70002, 0, 0,
+ 0, 67285, 11499, 67297, 7816, 67295, 55247, 68015, 10929, 67298, 122640,
+ 68017, 9642, 10912, 0, 67293, 11387, 67291, 67290, 70792, 0, 67715, 0, 0,
+ 68099, 13287, 74430, 10836, 0, 75053, 69775, 0, 128746, 7450, 0, 0,
+ 119648, 9697, 3606, 0, 0, 0, 0, 125029, 0, 0, 121262, 0, 128873, 1389,
+ 128871, 0, 0, 0, 12941, 0, 83438, 121062, 0, 12301, 83440, 0, 41102,
+ 66604, 72025, 0, 0, 0, 66600, 523, 92642, 71100, 74436, 0, 0, 0, 8608,
+ 83435, 72828, 128704, 0, 127402, 11307, 66707, 67301, 67300, 67299, 0,
+ 67304, 67303, 0, 0, 0, 0, 122654, 5908, 0, 0, 6744, 67310, 1699, 67308,
+ 67307, 67314, 67313, 6306, 67311, 983209, 72150, 69862, 3766, 2389,
+ 67305, 74569, 6611, 65700, 0, 0, 0, 42386, 0, 0, 2599, 917972, 119131,
+ 119049, 65717, 0, 0, 119654, 0, 0, 73538, 74203, 3760, 1718, 68160, 0,
+ 3776, 7335, 0, 0, 67324, 69861, 0, 69792, 0, 0, 3778, 0, 9462, 7824, 0,
+ 78896, 3768, 68142, 765, 72822, 3764, 0, 0, 113822, 129667, 12947, 0, 0,
+ 0, 118806, 73753, 0, 0, 0, 6829, 5225, 66901, 0, 0, 0, 0, 67319, 67318,
+ 3162, 67316, 67323, 67322, 67321, 67320, 0, 5353, 128190, 74179, 67315,
+ 0, 1010, 6851, 0, 67326, 67325, 127870, 6952, 67329, 67328, 67327, 2590,
+ 120036, 65552, 120034, 120039, 7183, 120037, 120038, 120027, 120028,
+ 118536, 120026, 120031, 970, 120029, 74611, 120019, 120020, 120017,
+ 67330, 120023, 120024, 120021, 10961, 113693, 11148, 67486, 0, 0, 128448,
+ 0, 113703, 64378, 0, 0, 0, 68821, 119649, 11358, 71172, 69797, 0, 11065,
+ 126464, 0, 68864, 0, 5694, 120839, 66784, 0, 4325, 3047, 0, 43652,
+ 120962, 93029, 69764, 0, 0, 0, 0, 5431, 6652, 0, 67753, 71460, 0, 0, 0,
+ 1129, 65016, 0, 65900, 1986, 7846, 0, 8661, 75058, 0, 0, 3845, 0, 0, 0,
+ 74400, 1456, 7530, 121382, 118631, 0, 0, 0, 120016, 0, 0, 0, 917863,
+ 127772, 119966, 0, 11002, 7026, 8145, 68216, 0, 12138, 71464, 0, 0, 0,
+ 12323, 130033, 917869, 0, 0, 0, 92316, 68494, 0, 0, 129384, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 42205, 0, 236, 0, 78867, 0, 0, 113784, 0, 0, 984001, 0,
+ 0, 119985, 8097, 0, 0, 68012, 72820, 11194, 0, 72824, 0, 127974, 0, 0,
+ 110602, 129948, 10416, 68070, 3872, 127508, 0, 0, 0, 0, 2838, 917867, 0,
+ 917866, 119589, 0, 0, 0, 0, 11096, 83019, 10553, 83421, 0, 0, 0, 0, 0, 0,
+ 73742, 6436, 10096, 0, 0, 0, 113687, 0, 4463, 68018, 0, 78074, 0, 983591,
+ 7184, 0, 0, 0, 0, 0, 0, 93825, 12818, 12032, 0, 0, 0, 0, 10357, 121418,
+ 8170, 0, 8556, 0, 9659, 0, 0, 0, 9556, 0, 4503, 92700, 9647, 64004,
+ 78185, 0, 0, 64002, 78889, 0, 0, 118910, 0, 6438, 0, 9109, 78884, 72382,
+ 64599, 0, 68009, 0, 0, 2447, 129863, 72381, 0, 126545, 0, 119002, 0, 0,
+ 0, 19937, 0, 1322, 0, 119204, 254, 72373, 0, 69392, 42425, 0, 0, 65204,
+ 42312, 0, 118578, 0, 42826, 129731, 42464, 120567, 0, 67155, 74796,
+ 64400, 64693, 126212, 77861, 0, 0, 67154, 0, 0, 0, 68008, 11785, 0,
+ 119142, 41978, 0, 0, 43244, 10536, 0, 9901, 7103, 0, 7102, 71428, 120748,
+ 3140, 0, 0, 68007, 0, 67258, 10909, 0, 1428, 0, 67254, 67253, 7699,
+ 12393, 67257, 0, 67256, 67255, 0, 0, 69389, 0, 0, 0, 0, 0, 67153, 0, 0,
+ 127383, 69376, 64554, 0, 3878, 0, 42352, 1752, 0, 129702, 42506, 0,
+ 10199, 0, 983468, 125231, 0, 0, 0, 720, 0, 0, 0, 68831, 0, 1464, 128339,
+ 0, 7974, 0, 125017, 68082, 0, 0, 0, 0, 74787, 0, 78864, 92258, 0, 0,
+ 78863, 0, 1302, 66288, 0, 0, 0, 67152, 0, 983611, 983618, 0, 0, 3995, 0,
+ 65608, 3714, 0, 0, 67262, 67261, 67260, 67259, 43251, 67264, 67263, 0,
+ 120557, 92346, 8672, 68006, 11964, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 92610, 0, 468, 0, 0, 0, 983475, 0, 0, 128544, 129397, 65907, 983164, 0,
+ 0, 0, 0, 0, 983473, 41743, 0, 0, 0, 74880, 0, 121001, 820, 41741, 0,
+ 120667, 0, 64684, 126992, 128604, 126082, 69934, 65177, 6226, 353, 43645,
+ 0, 119612, 120738, 67700, 0, 0, 0, 0, 42457, 120276, 0, 120277, 1884,
+ 129637, 42418, 113678, 41157, 0, 42305, 120279, 0, 0, 41151, 0, 71430, 0,
+ 42344, 0, 194864, 0, 42497, 0, 194870, 72754, 69933, 73703, 0, 42521,
+ 8539, 128606, 0, 123609, 69957, 4788, 0, 68023, 0, 0, 983053, 0, 0, 0, 0,
+ 41590, 118717, 113754, 0, 0, 118901, 68637, 41136, 64351, 0, 128453,
+ 41154, 113731, 127038, 4038, 41143, 68232, 64859, 0, 129910, 0, 5435,
+ 129911, 6734, 41343, 127035, 0, 0, 41359, 66761, 0, 119835, 41349, 0,
+ 129915, 10374, 10310, 0, 0, 10254, 119836, 10278, 10262, 69858, 41363, 0,
+ 0, 0, 119840, 0, 41356, 10314, 10282, 0, 10378, 0, 40976, 10266, 0,
+ 119848, 40975, 123547, 129554, 0, 40978, 119851, 92945, 0, 0, 0, 119098,
+ 119083, 0, 71437, 119854, 69936, 0, 0, 3525, 6824, 0, 0, 119858, 128451,
+ 0, 72239, 113738, 0, 71424, 0, 0, 0, 0, 0, 10727, 7212, 129071, 71957, 0,
+ 0, 0, 67156, 808, 7207, 42387, 0, 0, 0, 0, 0, 0, 0, 0, 9225, 121149, 0,
+ 9145, 128060, 41018, 67841, 983159, 42300, 0, 3084, 983156, 125014,
+ 41025, 6037, 0, 194885, 0, 10290, 0, 3083, 10322, 111017, 129030, 0,
+ 41036, 0, 0, 43321, 65606, 0, 41032, 42388, 0, 64700, 0, 1445, 40961, 0,
+ 0, 0, 40960, 0, 67727, 0, 2223, 64952, 10402, 0, 0, 0, 10603, 0, 118577,
+ 71438, 0, 0, 0, 128469, 0, 0, 0, 0, 0, 0, 42585, 65032, 10704, 65030,
+ 4787, 0, 917556, 0, 127015, 0, 128118, 0, 0, 9525, 0, 0, 68773, 0, 0, 0,
+ 0, 40966, 0, 0, 3998, 0, 0, 65919, 71433, 11792, 2690, 0, 42836, 127150,
+ 41954, 194921, 194923, 6737, 0, 64933, 126260, 3487, 194873, 71427,
+ 72758, 65426, 72756, 66757, 0, 0, 41976, 9720, 74964, 11179, 41970, 0,
+ 12116, 65024, 0, 127912, 9048, 65028, 65027, 65026, 65025, 64757, 0,
+ 41488, 0, 8527, 0, 126480, 0, 41480, 41053, 3266, 0, 194876, 12093,
+ 41466, 122881, 78642, 1519, 983925, 3638, 65887, 65429, 0, 0, 0, 0, 8633,
+ 0, 0, 0, 125118, 0, 70375, 0, 0, 6368, 128124, 0, 70369, 8078, 0, 0,
+ 70373, 72876, 0, 7002, 121003, 41430, 0, 41051, 41484, 0, 0, 41050, 8872,
+ 0, 13099, 71445, 70371, 0, 6435, 72154, 11362, 0, 0, 0, 0, 41420, 0,
+ 3625, 74915, 41409, 71441, 0, 0, 0, 9672, 0, 0, 43317, 0, 0, 0, 41424,
+ 917598, 0, 0, 0, 0, 41417, 1261, 0, 0, 12102, 119662, 41401, 0, 127538,
+ 129518, 0, 124943, 72765, 3275, 92472, 0, 0, 0, 118686, 0, 128946, 0, 0,
+ 125129, 983141, 10598, 0, 128633, 6711, 0, 2920, 0, 0, 0, 0, 19928, 0, 0,
+ 3917, 0, 113756, 0, 0, 66588, 128078, 0, 0, 113721, 113758, 983081, 0, 0,
+ 41184, 0, 232, 0, 0, 74170, 0, 0, 0, 0, 9094, 0, 0, 92585, 0, 1064, 0, 0,
+ 10115, 0, 0, 0, 7862, 0, 13224, 0, 0, 66650, 0, 0, 72877, 1878, 0, 71434,
+ 2911, 0, 41178, 5427, 0, 0, 0, 12617, 41174, 0, 67148, 67147, 0, 42413,
+ 41167, 2406, 0, 0, 0, 0, 0, 9618, 128668, 0, 0, 0, 0, 41436, 9337,
+ 126067, 0, 41456, 0, 119086, 11333, 0, 6703, 0, 125071, 1613, 0, 0, 0,
+ 983192, 0, 0, 74500, 41460, 78197, 0, 0, 194899, 67144, 65841, 0, 121109,
+ 74064, 111146, 111144, 120375, 0, 111122, 0, 111121, 64687, 111120,
+ 42592, 3871, 0, 128305, 9111, 111163, 0, 111156, 120366, 121462, 11150,
+ 111154, 71488, 111179, 0, 111168, 0, 120362, 41587, 70391, 0, 74322,
+ 110589, 194908, 111166, 111133, 0, 71443, 194842, 0, 111151, 0, 0, 7928,
+ 111127, 111140, 41595, 0, 0, 65801, 110587, 110586, 110585, 110584,
+ 73712, 0, 41598, 3993, 121269, 1545, 40971, 121286, 72874, 0, 0, 0,
+ 120767, 65286, 0, 0, 0, 0, 2201, 0, 0, 5402, 0, 0, 74462, 73457, 0, 0,
+ 78194, 64326, 40969, 0, 128110, 983703, 40968, 0, 121139, 0, 128891, 0,
+ 0, 128513, 8020, 0, 41012, 0, 0, 65805, 41006, 0, 0, 74605, 0, 118942,
+ 43432, 0, 0, 92900, 0, 0, 68671, 120687, 0, 92958, 0, 0, 68332, 0, 40992,
+ 0, 0, 0, 0, 0, 42235, 0, 1741, 42370, 0, 0, 0, 11413, 126583, 0, 0,
+ 128769, 6470, 0, 74517, 0, 0, 120651, 40984, 0, 42742, 0, 12916, 6284, 0,
+ 41663, 0, 0, 68313, 72840, 70164, 41648, 0, 0, 2299, 41666, 0, 0, 2056,
+ 41656, 0, 0, 71917, 42219, 0, 0, 78112, 41676, 0, 0, 0, 41670, 0, 92590,
+ 2796, 0, 0, 9902, 0, 67988, 64785, 82995, 128822, 42631, 983040, 71890,
+ 0, 74164, 41238, 10049, 11405, 0, 64368, 0, 120925, 0, 397, 12299, 42139,
+ 0, 9590, 0, 0, 43661, 43819, 0, 6651, 3544, 0, 0, 9620, 0, 0, 0, 92229,
+ 1333, 7104, 0, 6425, 0, 0, 123561, 0, 0, 129725, 11976, 8554, 13055, 0,
+ 110733, 0, 110731, 41218, 0, 0, 128673, 1883, 0, 0, 70443, 41225, 70788,
+ 42419, 983707, 129450, 0, 127896, 0, 65809, 11837, 0, 129104, 7141, 0, 0,
+ 0, 0, 0, 42363, 0, 0, 0, 0, 69949, 119157, 64732, 0, 0, 126983, 0, 0,
+ 983697, 7140, 42051, 0, 4164, 118799, 0, 120569, 42049, 42042, 0, 0, 0,
+ 120637, 69938, 0, 42047, 0, 0, 8470, 11807, 128935, 0, 0, 194825, 74300,
+ 126267, 0, 120517, 68128, 0, 0, 0, 8736, 0, 42643, 72753, 129925, 0, 0,
+ 71432, 0, 93023, 110730, 72869, 110728, 0, 0, 0, 0, 68445, 0, 0, 2106, 0,
+ 11273, 120986, 43004, 0, 82988, 0, 961, 64307, 0, 0, 129752, 67711,
+ 110615, 0, 1696, 0, 9762, 12105, 0, 110622, 110623, 3264, 110621, 110618,
+ 43003, 110616, 110617, 0, 120359, 0, 128660, 0, 2322, 0, 70831, 11449,
+ 128187, 42868, 0, 0, 0, 0, 113746, 983238, 0, 129583, 66398, 0, 0, 0, 0,
+ 0, 69494, 119224, 0, 0, 64421, 0, 113739, 0, 65823, 0, 11182, 0, 0, 0,
+ 7766, 55268, 0, 4598, 0, 65839, 0, 0, 3315, 10851, 0, 6179, 92602, 6180,
+ 129524, 11952, 0, 78648, 78651, 78646, 78647, 78644, 78645, 3801, 78643,
+ 6176, 120580, 0, 0, 6177, 0, 78652, 78653, 6178, 0, 0, 0, 0, 2214, 8754,
+ 0, 0, 2137, 0, 0, 0, 0, 66889, 0, 0, 0, 8974, 2308, 0, 74579, 0, 2318,
+ 122920, 0, 8198, 0, 0, 0, 74307, 0, 119524, 0, 0, 6970, 0, 0, 0, 41159,
+ 0, 120363, 6385, 0, 128403, 0, 0, 126258, 0, 72785, 42053, 2075, 42057,
+ 0, 42052, 0, 0, 67651, 0, 9665, 0, 0, 13181, 0, 0, 69379, 0, 0, 0, 0,
+ 73010, 0, 0, 0, 41145, 0, 0, 0, 41148, 0, 7594, 113686, 75033, 119090,
+ 10869, 43458, 41146, 0, 0, 121456, 917630, 0, 0, 0, 0, 0, 65184, 11780,
+ 0, 42796, 0, 69742, 0, 65146, 66803, 0, 0, 0, 7358, 78241, 0, 7988,
+ 101371, 101370, 3271, 101372, 0, 69281, 0, 0, 0, 101369, 13070, 113736,
+ 42044, 101365, 1095, 101367, 3599, 101361, 101364, 101157, 129087, 66390,
+ 101360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42043, 43232, 67656, 121014, 42046,
+ 64355, 4036, 123601, 0, 0, 983062, 0, 11954, 0, 41191, 12986, 0, 194854,
+ 65441, 0, 72202, 0, 129338, 0, 101353, 101352, 12834, 0, 101349, 101348,
+ 101351, 72858, 101345, 101344, 41190, 101346, 129693, 4575, 41193, 0,
+ 429, 119174, 124931, 194859, 0, 65792, 128754, 78509, 0, 128866, 0, 0, 0,
+ 66786, 0, 194862, 10590, 0, 0, 0, 0, 0, 0, 6247, 10214, 65126, 68253, 0,
+ 0, 0, 983699, 1617, 8050, 0, 0, 0, 101358, 101357, 0, 101359, 101354, 0,
+ 101356, 6352, 0, 0, 0, 0, 0, 0, 0, 0, 92335, 0, 0, 42926, 0, 0, 0, 8689,
+ 78750, 70067, 42896, 74147, 3559, 101327, 0, 74526, 65850, 12327, 72763,
+ 101325, 0, 0, 72761, 0, 78903, 0, 0, 0, 0, 70079, 72751, 0, 12153,
+ 101340, 101343, 101342, 71940, 0, 101339, 101338, 0, 0, 681, 129406, 703,
+ 101335, 3272, 101337, 101332, 70077, 101334, 101333, 70514, 78902, 92532,
+ 71436, 42238, 124930, 3276, 0, 101311, 65928, 0, 0, 101307, 101306,
+ 101309, 101308, 78813, 78814, 3262, 78811, 42711, 101305, 0, 0, 101302,
+ 92746, 9995, 1655, 70131, 78818, 78815, 12479, 0, 0, 101296, 70513,
+ 42797, 0, 0, 128371, 43112, 101318, 43488, 101320, 101315, 101314, 42684,
+ 101316, 0, 0, 101313, 101312, 128308, 0, 0, 0, 0, 0, 0, 11031, 0, 0, 0,
+ 70386, 10348, 10412, 0, 0, 74329, 0, 0, 122647, 101285, 101284, 101287,
+ 101286, 8810, 101280, 686, 101282, 0, 0, 0, 0, 110709, 0, 0, 12040, 0, 0,
+ 65118, 110704, 0, 118891, 110599, 0, 110598, 0, 120543, 983679, 0, 65455,
+ 74413, 94097, 0, 119129, 0, 0, 0, 78776, 0, 64467, 10300, 10161, 10396,
+ 0, 0, 0, 0, 78773, 101294, 101293, 0, 1458, 101290, 0, 72429, 65120,
+ 11479, 0, 0, 6350, 101289, 101288, 71473, 1061, 69787, 9115, 43111, 0, 0,
+ 0, 0, 983979, 0, 120907, 1045, 0, 73913, 983564, 0, 0, 0, 0, 0, 0, 8486,
+ 0, 0, 0, 4362, 0, 0, 93054, 1025, 0, 0, 0, 0, 0, 92328, 128206, 0, 1774,
+ 0, 122913, 0, 0, 0, 11207, 0, 0, 3988, 0, 0, 983048, 0, 0, 8564, 983977,
+ 0, 0, 0, 0, 0, 0, 66513, 6256, 0, 579, 55218, 0, 0, 0, 127337, 0, 11814,
+ 0, 4488, 128716, 127336, 0, 10444, 118846, 78238, 0, 0, 127331, 4487,
+ 127849, 42832, 1032, 0, 43450, 0, 70155, 0, 614, 0, 127325, 0, 0, 128466,
+ 0, 127321, 0, 127322, 0, 0, 0, 1050, 7549, 127319, 0, 9314, 0, 0, 0, 0,
+ 0, 70434, 127314, 12527, 66504, 0, 0, 0, 0, 64333, 127312, 128547, 92594,
+ 0, 0, 0, 129316, 0, 124960, 10360, 6746, 0, 0, 0, 0, 13085, 9233, 0, 0,
+ 0, 0, 983474, 0, 92766, 0, 121114, 983944, 74212, 42819, 10910, 118627,
+ 68044, 9896, 0, 0, 120915, 0, 0, 7970, 0, 0, 0, 0, 113699, 9849, 0,
+ 122910, 0, 0, 10487, 69714, 0, 10103, 0, 4769, 0, 129967, 0, 2283, 0, 0,
+ 74785, 0, 0, 0, 110595, 110596, 0, 110594, 64565, 4773, 0, 0, 0, 4770, 0,
+ 0, 0, 65457, 69441, 0, 0, 127338, 983593, 4774, 0, 68497, 2259, 0, 0,
+ 10215, 0, 0, 0, 0, 0, 74776, 92160, 4768, 0, 0, 4099, 0, 110699, 110700,
+ 110697, 2225, 0, 0, 0, 41183, 125217, 11255, 42814, 880, 0, 0, 0, 0, 0,
+ 67756, 65246, 0, 0, 129463, 7095, 0, 0, 0, 0, 0, 0, 2427, 0, 7093, 0,
+ 11585, 0, 9962, 0, 12223, 0, 78211, 1434, 42939, 0, 11573, 0, 0, 0,
+ 121257, 0, 0, 0, 0, 74437, 0, 113711, 917596, 0, 8740, 0, 3782, 64331, 0,
+ 65167, 1014, 0, 0, 0, 10835, 129987, 0, 0, 0, 0, 0, 118824, 7302, 0,
+ 67707, 0, 1150, 10547, 0, 0, 68427, 0, 0, 0, 0, 118788, 0, 0, 0, 42257,
+ 8010, 0, 0, 0, 9643, 0, 0, 12864, 0, 0, 0, 0, 0, 0, 0, 0, 1426, 68217, 0,
+ 68447, 129971, 0, 0, 0, 73701, 0, 0, 0, 65383, 0, 0, 0, 0, 0, 0, 43196,
+ 43194, 92549, 10744, 0, 990, 93772, 0, 0, 0, 0, 0, 66470, 0, 0, 0, 3945,
+ 0, 0, 0, 130039, 0, 127546, 127746, 1020, 73763, 92257, 118669, 0, 64748,
+ 0, 0, 10205, 0, 0, 10016, 0, 74051, 0, 43242, 125096, 2667, 0, 125037, 0,
+ 9911, 0, 0, 10097, 0, 0, 0, 118836, 0, 0, 0, 0, 68889, 10159, 113759, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 983343, 92291, 0, 127973, 72882, 0, 1041, 127182,
+ 6354, 0, 65364, 0, 0, 0, 72884, 0, 128477, 0, 65906, 127819, 72883, 0,
+ 128470, 5375, 72881, 0, 8215, 0, 10074, 0, 0, 0, 69899, 0, 0, 121426,
+ 41382, 0, 0, 5173, 65348, 527, 0, 0, 0, 128250, 0, 0, 0, 0, 0, 0, 42695,
+ 0, 42250, 0, 11187, 113695, 0, 1568, 66806, 0, 0, 113705, 0, 0, 129487,
+ 0, 0, 128839, 9069, 6144, 0, 0, 0, 0, 66783, 0, 74027, 118934, 66787,
+ 74580, 0, 110790, 6364, 0, 66794, 43508, 0, 92612, 0, 0, 0, 0, 128405,
+ 66449, 0, 0, 0, 0, 70714, 0, 70716, 0, 1044, 42411, 0, 0, 0, 0, 43239, 0,
+ 0, 0, 118572, 42450, 0, 0, 68479, 119237, 0, 0, 0, 0, 0, 69956, 11537, 0,
+ 121206, 0, 0, 0, 0, 1057, 566, 0, 0, 10907, 42274, 43464, 0, 118698, 0,
+ 78472, 71207, 42636, 0, 123603, 0, 0, 121171, 64659, 0, 127749, 0, 6357,
+ 6362, 0, 0, 2216, 9090, 0, 0, 0, 0, 68227, 0, 0, 0, 0, 1053, 12830, 0, 0,
+ 0, 1052, 1051, 459, 1060, 0, 66479, 0, 0, 0, 128061, 42490, 689, 6508,
+ 4163, 42298, 8639, 983338, 4246, 0, 43514, 42362, 0, 42337, 64596, 0, 0,
+ 0, 0, 0, 6359, 0, 43471, 0, 0, 0, 127274, 0, 6358, 6361, 1926, 6356, 0,
+ 7898, 0, 10935, 0, 127972, 121285, 0, 43685, 0, 0, 42910, 0, 8693, 0, 0,
+ 44010, 0, 120991, 121454, 0, 0, 0, 0, 129514, 0, 0, 0, 0, 73947, 0,
+ 129361, 92412, 0, 66477, 0, 0, 0, 43854, 71913, 0, 0, 0, 0, 72227, 65899,
+ 92275, 0, 0, 0, 68887, 0, 71057, 0, 0, 0, 0, 119183, 2923, 10853, 0, 0,
+ 0, 0, 72864, 0, 72773, 72772, 0, 120801, 65251, 122624, 68228, 0, 128548,
+ 0, 0, 5370, 70465, 2931, 73848, 0, 10188, 0, 118848, 0, 983942, 0, 0,
+ 120584, 72212, 0, 10844, 121016, 128195, 92424, 0, 0, 0, 286, 0, 1062, 0,
+ 0, 124127, 7395, 0, 1070, 128993, 0, 6095, 0, 0, 0, 127796, 126465,
+ 64497, 0, 0, 0, 0, 70054, 8189, 78272, 0, 0, 0, 0, 0, 113783, 42102,
+ 78276, 0, 0, 42101, 0, 78402, 67427, 33, 67425, 67424, 10824, 67430,
+ 67429, 67428, 427, 64723, 0, 0, 0, 0, 1031, 0, 0, 42104, 0, 0, 2328, 0,
+ 1071, 42899, 128486, 0, 7673, 0, 0, 1047, 194837, 0, 42908, 0, 0, 10651,
+ 0, 0, 0, 72433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13216, 0, 69716, 0,
+ 0, 0, 0, 0, 92411, 69654, 0, 0, 129904, 2761, 129909, 0, 0, 0, 0, 8643,
+ 0, 0, 94021, 2757, 11067, 0, 74498, 8910, 10689, 0, 0, 0, 71173, 0, 9196,
+ 71214, 0, 0, 0, 0, 118911, 0, 0, 0, 0, 0, 0, 0, 0, 68130, 119616, 0, 0,
+ 42477, 67482, 0, 4495, 0, 0, 0, 0, 70080, 10992, 0, 0, 0, 0, 9318, 0,
+ 6002, 0, 73808, 0, 92601, 42249, 7639, 43995, 0, 0, 5454, 0, 0, 0, 0, 0,
+ 0, 0, 121189, 0, 119173, 0, 9704, 120686, 0, 78436, 78435, 11204, 0, 0,
+ 1731, 0, 92937, 0, 67990, 0, 0, 0, 126576, 127018, 71951, 55265, 0, 0, 0,
+ 0, 127257, 73826, 0, 3840, 0, 41432, 0, 0, 68430, 0, 43253, 128284, 0,
+ 3371, 92936, 0, 0, 1479, 69282, 0, 1109, 77997, 0, 129154, 0, 92782, 0,
+ 0, 8868, 399, 67978, 74842, 0, 0, 194839, 73498, 551, 0, 10156, 0, 92572,
+ 0, 2544, 65074, 0, 0, 0, 0, 0, 0, 0, 128713, 0, 0, 74268, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 68045, 0, 0, 0, 3447, 0, 0, 121414, 2549, 110818, 0, 0,
+ 43564, 8946, 0, 74411, 66864, 0, 70480, 7980, 0, 113698, 0, 119653,
+ 66489, 0, 64695, 128063, 0, 0, 0, 0, 0, 0, 43452, 0, 92993, 0, 10919, 0,
+ 67810, 0, 0, 0, 0, 6450, 10055, 0, 0, 0, 0, 42720, 0, 9626, 0, 128055,
+ 74447, 0, 125127, 92573, 0, 0, 0, 119075, 0, 0, 66486, 0, 0, 0, 0, 0, 0,
+ 75028, 983883, 74839, 0, 0, 0, 0, 0, 55286, 0, 1055, 917628, 0, 0, 0,
+ 70516, 12146, 118623, 73956, 66488, 0, 0, 0, 0, 0, 0, 42518, 0, 0, 0,
+ 7407, 74978, 0, 0, 0, 0, 0, 0, 0, 10231, 0, 66626, 0, 0, 92951, 0, 65927,
+ 0, 0, 69696, 0, 92389, 0, 0, 0, 68095, 92950, 0, 10555, 0, 0, 9091,
+ 10798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43222, 0, 74982, 0, 0, 120952, 0, 0,
+ 2992, 7826, 74321, 110879, 125103, 74981, 92628, 0, 129903, 128289,
+ 128203, 4361, 129597, 1306, 78770, 1497, 983628, 0, 0, 0, 8248, 0,
+ 127253, 7973, 128706, 0, 0, 73122, 983949, 0, 0, 2963, 120653, 0, 128554,
+ 0, 0, 64258, 0, 0, 69677, 74983, 65103, 0, 125008, 42625, 0, 72022, 0, 0,
+ 64905, 0, 9512, 0, 119076, 6443, 983267, 0, 9135, 0, 0, 123202, 0, 0,
+ 983882, 93788, 0, 0, 0, 93767, 64256, 0, 11669, 0, 0, 4524, 0, 129182,
+ 128390, 0, 74266, 0, 0, 0, 70119, 78410, 69809, 121031, 55219, 69815,
+ 93765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2986, 0, 93763, 3437, 0, 6203,
+ 4247, 0, 11920, 8274, 68240, 129694, 1657, 0, 121276, 122951, 0, 2954,
+ 43506, 42837, 0, 0, 71179, 0, 0, 0, 66476, 68450, 0, 0, 0, 43362, 983135,
+ 129596, 11705, 0, 0, 0, 127354, 0, 11710, 0, 0, 0, 119507, 74429, 0, 0,
+ 1058, 129555, 0, 0, 5484, 1144, 0, 0, 0, 0, 0, 118972, 0, 65322, 0, 6441,
+ 0, 0, 2547, 66484, 43634, 0, 5871, 0, 0, 0, 0, 0, 0, 71204, 0, 0, 1865,
+ 0, 0, 69950, 0, 93021, 73713, 0, 71199, 65826, 2069, 0, 119092, 43999,
+ 2997, 0, 126588, 0, 65319, 0, 12316, 0, 0, 123630, 8776, 0, 0, 66294,
+ 13130, 0, 71191, 126625, 0, 10030, 11709, 12364, 983853, 0, 11704, 0,
+ 118641, 68672, 0, 0, 0, 0, 11706, 9710, 0, 82985, 0, 413, 65623, 0, 0,
+ 93980, 74446, 0, 1042, 0, 128378, 12171, 119240, 0, 69384, 4984, 0, 708,
+ 11391, 0, 0, 0, 983930, 1308, 0, 3673, 810, 0, 120933, 118567, 0, 0,
+ 1917, 3000, 0, 0, 0, 65628, 66387, 74470, 0, 0, 0, 10027, 0, 0, 0, 0,
+ 128831, 983168, 2980, 755, 0, 0, 65622, 0, 121012, 7277, 121022, 0, 0, 0,
+ 0, 8730, 0, 0, 0, 7274, 119250, 0, 7275, 0, 935, 0, 0, 377, 42325,
+ 121103, 0, 101133, 101132, 101135, 101134, 0, 74911, 2417, 101130, 0,
+ 19912, 0, 0, 101128, 101127, 0, 101129, 101124, 7248, 101126, 101125,
+ 1781, 5496, 3627, 62, 1649, 0, 964, 0, 0, 0, 0, 92897, 0, 0, 127364, 0,
+ 43689, 127911, 66287, 78812, 64389, 66575, 0, 73041, 0, 129687, 0, 7677,
+ 2991, 3293, 0, 0, 0, 72201, 0, 11341, 127049, 0, 65625, 9714, 11692, 0,
+ 0, 120850, 6478, 10195, 43673, 65237, 6241, 0, 0, 0, 6238, 0, 129889, 0,
+ 4409, 0, 0, 67170, 0, 0, 0, 94047, 6237, 5461, 66851, 9176, 92882,
+ 121341, 65231, 0, 0, 121182, 110581, 0, 44018, 0, 64765, 0, 0, 0, 5685,
+ 0, 2461, 0, 7091, 0, 0, 0, 68163, 0, 73030, 0, 0, 73928, 0, 0, 0, 0, 0,
+ 0, 110582, 0, 0, 68506, 0, 0, 0, 0, 0, 2542, 0, 0, 0, 128176, 5776, 0, 0,
+ 0, 0, 0, 11987, 0, 0, 75036, 68744, 0, 0, 10039, 42828, 0, 0, 0, 0, 0,
+ 10721, 67664, 43433, 0, 0, 41875, 0, 41870, 266, 129066, 0, 41873, 71271,
+ 0, 0, 0, 0, 0, 0, 41871, 66186, 3734, 7734, 43683, 8750, 110600, 66011,
+ 92899, 0, 127937, 0, 0, 10572, 0, 42906, 0, 64349, 7287, 0, 0, 0, 0,
+ 11167, 69220, 0, 43429, 0, 1697, 0, 0, 68633, 7286, 0, 128738, 10031,
+ 78754, 0, 68645, 8620, 0, 42162, 0, 0, 7285, 0, 119577, 0, 66842, 43677,
+ 41583, 0, 65799, 129332, 0, 0, 0, 0, 110806, 0, 3609, 0, 129448, 119074,
+ 125116, 126254, 128108, 73948, 0, 0, 0, 0, 129189, 42732, 92699, 74984,
+ 68620, 11691, 74985, 0, 0, 0, 0, 0, 6348, 243, 74075, 0, 0, 92309,
+ 123585, 0, 0, 10648, 8538, 43687, 0, 118723, 0, 70515, 0, 118954, 92886,
+ 13307, 129573, 92891, 0, 120770, 983850, 0, 0, 0, 0, 214, 0, 0, 0, 65893,
+ 0, 120488, 128386, 0, 92893, 0, 2603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 43, 0, 0, 1016, 0, 0, 0, 3885, 92, 65456, 64608, 0, 0, 0, 70656, 113742,
+ 0, 0, 0, 128128, 983857, 0, 0, 6791, 983861, 127960, 0, 0, 0, 118976, 0,
+ 7328, 92358, 0, 7995, 8759, 43421, 0, 68029, 92860, 0, 125272, 0, 3197,
+ 0, 0, 0, 983151, 0, 11595, 0, 0, 43435, 0, 0, 0, 0, 0, 70660, 0, 741,
+ 83291, 5494, 0, 70668, 1990, 11107, 4498, 0, 0, 70658, 0, 0, 2960, 73779,
+ 0, 8969, 101256, 43424, 0, 101257, 2950, 101251, 101254, 101253, 370, 0,
+ 101250, 101249, 0, 0, 0, 122967, 0, 0, 0, 122900, 0, 0, 983256, 0, 2964,
+ 43663, 0, 6344, 0, 0, 10144, 0, 8252, 729, 66016, 78446, 0, 0, 0, 78740,
+ 43669, 9032, 0, 0, 0, 0, 0, 0, 0, 0, 74612, 3761, 101261, 101260, 101263,
+ 101262, 0, 0, 3850, 101258, 0, 128389, 0, 0, 0, 0, 8611, 0, 0, 0, 43691,
+ 125032, 0, 41802, 120540, 0, 0, 0, 0, 0, 3848, 101230, 113800, 127536,
+ 101227, 101226, 101229, 101228, 663, 0, 0, 0, 0, 0, 0, 0, 0, 13221, 0, 0,
+ 101244, 101243, 101246, 101245, 0, 65579, 12980, 68046, 12143, 101069,
+ 128067, 0, 43441, 41804, 101241, 101240, 101235, 101234, 101237, 101236,
+ 66329, 0, 72324, 101232, 0, 125038, 0, 129383, 101214, 101213, 0, 101215,
+ 101210, 0, 101212, 101211, 0, 1097, 129033, 0, 101209, 101208, 93828, 0,
+ 101205, 101204, 101207, 101206, 101201, 101200, 101203, 101202, 0, 13110,
+ 0, 983886, 68229, 1000, 0, 0, 101222, 1209, 101224, 101223, 92354, 1073,
+ 6321, 77878, 92818, 0, 68213, 0, 12167, 0, 0, 0, 0, 73673, 121500, 0,
+ 121501, 0, 6587, 0, 0, 0, 9231, 0, 2959, 101191, 0, 101193, 101188,
+ 101187, 101190, 101189, 101184, 0, 101186, 42941, 0, 0, 68434, 0, 70742,
+ 0, 0, 12290, 0, 0, 110801, 0, 77873, 8205, 110803, 5131, 118542, 0, 0, 0,
+ 0, 0, 1944, 78453, 0, 0, 119990, 119991, 12701, 78492, 11308, 119995, 0,
+ 113702, 66836, 119999, 74263, 92382, 120002, 120003, 7075, 101196,
+ 101199, 101198, 41817, 73934, 42275, 101194, 120012, 120013, 120014,
+ 42943, 6041, 0, 41899, 0, 8002, 0, 41902, 0, 0, 64332, 0, 7813, 119117,
+ 0, 41900, 120633, 101167, 7281, 78455, 7279, 12041, 93027, 101165, 12673,
+ 0, 129123, 9660, 0, 72984, 101161, 0, 0, 0, 92901, 2970, 0, 101180,
+ 101179, 77870, 101181, 0, 0, 101178, 0, 0, 0, 0, 0, 3486, 101174, 69498,
+ 101176, 101171, 101170, 101173, 101172, 0, 69920, 101169, 66834, 0,
+ 984006, 0, 68312, 101150, 65673, 1019, 78495, 4148, 0, 12289, 101147,
+ 4316, 0, 13119, 983932, 101145, 101144, 0, 0, 101141, 101140, 43434,
+ 41865, 101137, 9163, 8659, 9072, 5867, 13302, 7622, 7120, 0, 0, 0, 0,
+ 7400, 5416, 101160, 101159, 10817, 101153, 101156, 101155, 0, 68162,
+ 41855, 41867, 0, 983228, 0, 11536, 71988, 0, 7115, 0, 0, 5498, 7337,
+ 41536, 0, 0, 92587, 7221, 8997, 0, 0, 0, 71949, 0, 0, 127814, 0, 0, 0, 0,
+ 0, 295, 0, 0, 0, 0, 121292, 0, 43454, 63903, 63902, 63901, 122644, 3971,
+ 0, 0, 2952, 0, 11038, 10901, 63900, 63899, 63898, 5198, 667, 43273,
+ 63887, 63886, 128458, 78521, 66830, 0, 92714, 4159, 0, 0, 63885, 63884,
+ 63883, 63882, 63880, 8555, 63878, 63877, 93057, 0, 0, 63881, 10746, 0,
+ 118983, 0, 63876, 63875, 63874, 63873, 7432, 1913, 41913, 43686, 0,
+ 128971, 0, 983894, 0, 446, 41911, 0, 63851, 63850, 41910, 0, 63846, 2972,
+ 63844, 7262, 0, 63849, 63848, 63847, 72990, 6570, 0, 7259, 63842, 4178,
+ 63840, 121321, 41521, 63894, 63893, 63892, 0, 0, 1105, 4180, 0, 7418, 0,
+ 129714, 63891, 63890, 63889, 63888, 0, 0, 0, 0, 1678, 0, 66909, 0, 0, 0,
+ 0, 11192, 128360, 128404, 9159, 70089, 63861, 63860, 63859, 63858, 63865,
+ 1615, 63863, 63862, 0, 0, 0, 0, 63857, 63856, 71902, 0, 1077, 0, 65099,
+ 0, 0, 0, 0, 0, 0, 42773, 121331, 0, 0, 119220, 120912, 129564, 0, 1112,
+ 119122, 8686, 120654, 0, 65081, 0, 0, 0, 11077, 0, 7260, 0, 5327, 0,
+ 63870, 63869, 3847, 63867, 0, 2903, 0, 3001, 66762, 0, 43746, 0, 63866,
+ 0, 0, 0, 0, 0, 127785, 68420, 2990, 0, 128254, 66957, 0, 0, 0, 1117,
+ 118987, 12212, 129003, 129151, 63836, 63835, 63834, 0, 0, 63839, 63838,
+ 63837, 0, 125095, 63833, 6042, 66360, 0, 74808, 0, 63821, 63820, 63819,
+ 63818, 0, 0, 9047, 63822, 128328, 6091, 0, 10691, 0, 74344, 8226, 0,
+ 63812, 63811, 63810, 63809, 2289, 63815, 63814, 63813, 6047, 0, 0, 780,
+ 63808, 77925, 77922, 65147, 63931, 63930, 2076, 1093, 9882, 63934, 2082,
+ 63932, 75050, 63929, 63928, 63927, 77934, 9806, 65566, 77933, 63922,
+ 63921, 2086, 0, 63926, 2984, 5968, 63923, 0, 0, 129458, 11137, 13169,
+ 5290, 2089, 0, 63827, 1088, 63825, 7268, 1084, 1085, 63829, 1083, 10131,
+ 7283, 0, 0, 0, 1092, 0, 7273, 983277, 44016, 43627, 0, 0, 0, 11809, 0, 0,
+ 0, 2965, 7258, 8808, 0, 1089, 7278, 63937, 63936, 43405, 11106, 940,
+ 5787, 10099, 63938, 101269, 63897, 101271, 2994, 101265, 101264, 101267,
+ 101266, 77939, 77940, 77937, 77938, 74343, 93043, 72704, 660, 10127, 666,
+ 0, 5532, 43667, 5533, 77941, 0, 0, 0, 979, 0, 0, 72706, 92652, 9108, 0,
+ 72716, 129403, 63951, 71685, 0, 0, 128782, 63946, 1707, 983843, 128612,
+ 63950, 63949, 63948, 63947, 63945, 6038, 63943, 63942, 101274, 0, 101276,
+ 101275, 0, 0, 0, 0, 0, 0, 73884, 0, 1690, 63919, 63918, 63917, 70865,
+ 43659, 0, 983848, 0, 2054, 0, 78515, 63916, 9184, 63914, 69737, 63911,
+ 63910, 63909, 63908, 0, 0, 63913, 6044, 0, 64838, 9061, 5534, 10672,
+ 11653, 124932, 5531, 101501, 101500, 101503, 101502, 0, 0, 11957, 101498,
+ 68668, 124922, 0, 0, 10474, 43426, 0, 42354, 101492, 101491, 101494,
+ 101493, 101488, 8413, 66841, 101489, 7269, 7272, 0, 0, 101471, 101470,
+ 78460, 0, 101467, 101466, 101469, 101468, 0, 0, 0, 66840, 0, 101465,
+ 128441, 0, 101462, 101461, 92187, 7270, 101458, 101457, 6628, 1076,
+ 128700, 0, 101456, 0, 0, 0, 0, 12807, 43413, 63906, 4548, 63904, 71187,
+ 70393, 41729, 44005, 1307, 0, 101473, 101472, 0, 0, 128268, 0, 8180, 0,
+ 127778, 0, 0, 5413, 43681, 123205, 3493, 0, 0, 0, 92544, 73937, 10517, 0,
+ 4518, 10990, 101447, 5167, 4481, 3771, 101443, 2710, 0, 66277, 0, 0,
+ 43073, 118579, 0, 0, 0, 121071, 0, 119659, 1628, 0, 0, 0, 65262, 66809,
+ 10783, 11172, 0, 0, 70840, 113679, 0, 119029, 0, 0, 41530, 66843, 4457,
+ 0, 0, 0, 0, 0, 41529, 0, 121210, 6031, 65807, 70814, 0, 101455, 71984,
+ 69705, 101452, 101451, 11926, 6033, 9656, 0, 0, 0, 68869, 0, 128930, 0,
+ 128100, 0, 42612, 43655, 0, 0, 0, 66468, 0, 0, 68623, 101423, 0, 0,
+ 101420, 101419, 101422, 101421, 0, 1151, 101418, 73709, 127544, 0, 71106,
+ 118722, 0, 0, 0, 0, 101437, 101436, 11527, 101438, 0, 0, 11538, 101434,
+ 0, 11020, 0, 66467, 101432, 8087, 71700, 101433, 9894, 101427, 73485,
+ 70824, 101424, 0, 78513, 8053, 0, 0, 0, 0, 101407, 101406, 0, 63845,
+ 101403, 78912, 78602, 101404, 13084, 42966, 8741, 0, 0, 101401, 0, 64605,
+ 83051, 101397, 473, 43415, 101394, 101393, 101396, 1087, 124966, 71275,
+ 101392, 0, 66439, 43218, 0, 0, 7237, 101414, 101417, 101416, 71996,
+ 101410, 92261, 101412, 121036, 4384, 74220, 101408, 2058, 917561, 0,
+ 129462, 0, 0, 0, 3857, 0, 0, 0, 64630, 0, 0, 74168, 127113, 125088, 4421,
+ 0, 0, 101381, 66400, 101383, 68431, 101377, 101376, 101379, 83053, 0, 0,
+ 69640, 127861, 0, 437, 73483, 0, 0, 0, 65236, 13290, 119180, 4997, 64306,
+ 0, 0, 4999, 0, 0, 0, 4711, 120769, 0, 2739, 0, 92915, 74834, 0, 127175,
+ 0, 0, 0, 0, 0, 1779, 6600, 6601, 0, 5325, 101390, 101389, 13058, 101391,
+ 101386, 0, 92186, 101387, 71845, 10575, 43399, 0, 101385, 101384, 1104,
+ 0, 0, 10655, 0, 0, 69497, 0, 1082, 110878, 0, 67401, 0, 0, 0, 0, 6783, 0,
+ 0, 42867, 69655, 44021, 6458, 0, 0, 0, 0, 0, 0, 1273, 43407, 0, 0, 0, 0,
+ 1313, 6322, 41720, 128627, 66433, 0, 0, 0, 11216, 0, 0, 0, 43437, 93833,
+ 0, 0, 0, 5122, 0, 72728, 129520, 70161, 0, 0, 0, 0, 0, 8303, 0, 128926,
+ 0, 10003, 0, 0, 0, 1686, 0, 0, 42834, 3664, 0, 126088, 121346, 0, 0,
+ 4324, 126, 0, 0, 0, 0, 0, 65166, 0, 0, 0, 0, 43817, 0, 43822, 0, 0,
+ 65600, 13002, 0, 0, 0, 1103, 0, 119575, 129452, 0, 13078, 0, 8116, 0,
+ 2050, 0, 0, 1102, 0, 6555, 0, 0, 74003, 74794, 0, 0, 42591, 127278, 0,
+ 1111, 0, 75047, 4707, 0, 0, 0, 0, 43468, 4522, 8645, 0, 74857, 0, 11352,
+ 0, 92787, 0, 2293, 0, 0, 0, 128265, 71709, 0, 121194, 0, 93827, 0, 0, 0,
+ 128488, 0, 160, 2677, 0, 0, 120141, 0, 983646, 70790, 0, 42770, 0, 71986,
+ 0, 43821, 113769, 0, 0, 43816, 0, 0, 1079, 3867, 64817, 0, 118549, 0, 0,
+ 64768, 0, 0, 4005, 983213, 0, 10991, 0, 92957, 917578, 92850, 917580,
+ 917575, 128314, 917577, 917576, 917571, 78534, 917573, 917572, 0, 0,
+ 128359, 73458, 0, 3339, 11448, 1106, 917591, 917590, 129192, 3340,
+ 917587, 917586, 917589, 917588, 917583, 10605, 1309, 74996, 120743,
+ 92650, 0, 0, 9485, 0, 129781, 0, 0, 0, 125002, 92533, 128487, 0, 129285,
+ 4338, 11238, 0, 66825, 0, 0, 0, 0, 122939, 0, 74128, 0, 0, 73680, 0,
+ 129438, 9553, 1590, 63777, 63776, 128677, 63782, 63781, 63780, 63779,
+ 1583, 101525, 101528, 101527, 101522, 101521, 101524, 101523, 41522, 0,
+ 92168, 983803, 66759, 0, 983580, 0, 0, 0, 0, 11394, 0, 983071, 0, 66823,
+ 1334, 0, 4479, 0, 0, 120663, 0, 122883, 10497, 0, 0, 983796, 66828, 0, 0,
+ 0, 6809, 63786, 0, 0, 63791, 63790, 1145, 63788, 101535, 63785, 63784,
+ 63783, 10192, 65267, 101533, 101532, 8928, 0, 0, 0, 0, 0, 74216, 66805,
+ 0, 0, 63759, 63758, 3523, 1074, 0, 121340, 74077, 92832, 0, 0, 63757,
+ 43145, 63755, 63754, 63752, 1349, 63750, 63749, 0, 0, 0, 63753, 63802,
+ 41084, 72784, 0, 41930, 63805, 63804, 11140, 63801, 41082, 43843, 42787,
+ 101514, 0, 101516, 101515, 63793, 63792, 0, 128241, 10201, 12238, 63795,
+ 42358, 92394, 43862, 101511, 101510, 41932, 66826, 101507, 101506, 92809,
+ 121136, 0, 7950, 63772, 63771, 63770, 0, 63767, 63766, 2793, 63764, 0,
+ 128501, 63769, 9530, 0, 92398, 0, 128642, 63763, 63762, 4595, 63760, 792,
+ 92808, 0, 0, 8742, 0, 0, 0, 63744, 0, 0, 120815, 63748, 63747, 63746,
+ 63745, 5055, 0, 0, 1090, 0, 125268, 11665, 92830, 4558, 78919, 72211, 0,
+ 0, 0, 11513, 983978, 6157, 63775, 63774, 63773, 0, 12170, 9067, 92843, 0,
+ 10872, 129643, 43891, 43893, 43892, 129747, 43933, 0, 128231, 0, 0, 0, 0,
+ 0, 11063, 0, 43888, 0, 0, 128368, 43889, 0, 73807, 983105, 7386, 0, 0,
+ 70295, 0, 0, 0, 71201, 128460, 0, 0, 0, 0, 69915, 2918, 66820, 65300, 0,
+ 124898, 64726, 2790, 0, 3793, 42065, 127829, 0, 124901, 0, 0, 0, 0, 0,
+ 92712, 0, 12923, 5270, 2166, 0, 0, 65813, 0, 128499, 0, 75012, 0, 10888,
+ 0, 93997, 94180, 3330, 129417, 0, 0, 0, 0, 0, 8220, 0, 0, 101581, 72457,
+ 1627, 101582, 0, 0, 5371, 101578, 0, 1826, 118794, 0, 0, 70023, 0, 0, 0,
+ 71108, 0, 0, 124907, 0, 92207, 68125, 74898, 71353, 0, 72006, 71098,
+ 70029, 0, 43116, 10190, 70019, 64346, 0, 101585, 66818, 101587, 70031, 0,
+ 12666, 120413, 120420, 120414, 101567, 120428, 0, 101564, 101563, 65509,
+ 101565, 7449, 0, 101562, 0, 7438, 0, 0, 9054, 971, 101558, 92803, 101560,
+ 65195, 64767, 101557, 101556, 0, 0, 101553, 101552, 0, 0, 0, 64303,
+ 101576, 2303, 0, 101577, 101572, 101571, 65833, 101573, 7271, 0, 101570,
+ 92802, 0, 12229, 0, 0, 43411, 73751, 126577, 64813, 0, 0, 10476, 0, 0,
+ 3932, 64958, 0, 0, 73989, 0, 0, 101542, 101541, 101544, 101543, 101538,
+ 101537, 101540, 101539, 92645, 65474, 4796, 118892, 129357, 65479, 0,
+ 42895, 11858, 65500, 983600, 9899, 92608, 2162, 404, 65484, 120639, 0,
+ 5788, 127852, 0, 65491, 1831, 66020, 0, 984012, 92588, 0, 1343, 120784,
+ 0, 0, 12018, 0, 0, 0, 0, 0, 4422, 4708, 3799, 101550, 119357, 0, 101547,
+ 101546, 101549, 101548, 983095, 0, 1364, 0, 8038, 101545, 0, 12868,
+ 129560, 70425, 55223, 0, 64414, 110689, 122978, 0, 0, 0, 0, 0, 118802,
+ 118644, 42855, 118856, 42866, 73525, 0, 0, 0, 66438, 0, 983996, 119356,
+ 92853, 119354, 0, 123556, 0, 73013, 67685, 128062, 119350, 0, 11864,
+ 10404, 10340, 119352, 1556, 5274, 0, 127821, 10017, 9733, 0, 69488, 0,
+ 41373, 0, 0, 0, 0, 0, 349, 4863, 41371, 0, 0, 0, 0, 72295, 4398, 8543,
+ 65618, 128018, 129784, 0, 0, 0, 12441, 0, 119348, 119347, 4318, 10452, 0,
+ 8032, 0, 119349, 119344, 0, 127844, 121156, 0, 110729, 119345, 8597, 0,
+ 110727, 9864, 0, 92796, 0, 92799, 0, 0, 0, 7722, 0, 0, 92797, 0, 0,
+ 66590, 0, 0, 129850, 0, 0, 0, 4965, 0, 917536, 0, 123196, 0, 0, 0, 10436,
+ 119342, 43147, 119340, 10356, 10420, 982, 2756, 0, 983997, 0, 0, 11162,
+ 119338, 0, 92914, 0, 65110, 0, 0, 983800, 78543, 0, 118793, 0, 128112,
+ 119179, 64476, 1694, 8216, 0, 0, 78539, 0, 65620, 0, 78537, 0, 0, 42158,
+ 65621, 69955, 120324, 120327, 120326, 120321, 120320, 120323, 120322,
+ 12314, 65616, 55221, 43825, 983553, 119337, 68060, 119335, 0, 71874,
+ 123628, 128537, 119332, 73089, 0, 41347, 0, 0, 8842, 0, 0, 4379, 127393,
+ 12692, 0, 0, 66353, 71875, 0, 0, 92907, 0, 0, 71877, 120303, 65619, 9872,
+ 0, 0, 1846, 120309, 120308, 119256, 71192, 120305, 120304, 120307, 6442,
+ 120317, 120316, 5379, 120318, 110717, 120312, 120315, 71876, 0, 65934,
+ 66497, 0, 66986, 0, 0, 0, 0, 0, 0, 0, 0, 72002, 0, 6151, 12110, 0,
+ 129761, 0, 66959, 0, 0, 0, 0, 68335, 129655, 0, 0, 0, 0, 0, 66041, 9676,
+ 10202, 0, 0, 0, 64575, 78929, 11965, 0, 124936, 0, 0, 0, 0, 0, 9698,
+ 66293, 0, 119651, 0, 0, 41921, 0, 0, 0, 119258, 0, 0, 0, 0, 0, 8012,
+ 12355, 12353, 0, 0, 74107, 0, 0, 41925, 0, 41920, 65444, 0, 0, 41923,
+ 12694, 0, 10112, 1294, 0, 120091, 0, 120092, 0, 0, 128474, 121400, 0, 0,
+ 0, 8718, 0, 10284, 10268, 10380, 10316, 92593, 0, 71850, 0, 0, 92889, 0,
+ 0, 0, 0, 9342, 12829, 0, 0, 101239, 127978, 0, 0, 69428, 0, 73767, 72347,
+ 0, 7956, 598, 0, 72329, 93837, 0, 0, 128860, 0, 120041, 0, 0, 101242, 0,
+ 0, 847, 0, 9529, 0, 0, 0, 101247, 120035, 0, 0, 0, 67411, 0, 0, 119497,
+ 120040, 0, 128580, 0, 9624, 0, 0, 0, 65463, 1554, 0, 0, 0, 0, 71879, 0,
+ 0, 0, 121161, 19963, 123566, 0, 72326, 92933, 71887, 10324, 10292, 65546,
+ 0, 68141, 8372, 0, 0, 83018, 120022, 10175, 10388, 42799, 0, 983181,
+ 10568, 0, 127400, 0, 0, 0, 983762, 0, 4366, 0, 983805, 0, 0, 42608, 0,
+ 9884, 0, 0, 0, 0, 129180, 0, 128964, 0, 0, 1609, 0, 92773, 73448, 0,
+ 11661, 0, 5818, 0, 0, 0, 9540, 0, 2554, 5158, 0, 2213, 0, 0, 78522,
+ 43079, 0, 0, 8264, 11175, 64553, 120863, 42155, 0, 0, 0, 0, 0, 69552,
+ 8676, 0, 129927, 0, 451, 0, 0, 0, 0, 0, 0, 123167, 43609, 0, 0, 1440, 0,
+ 0, 0, 127061, 11005, 0, 66656, 127063, 0, 129936, 0, 127065, 43393, 0,
+ 120643, 0, 0, 0, 0, 120798, 0, 0, 0, 0, 0, 0, 70435, 64356, 0, 0, 0, 383,
+ 7154, 127815, 43495, 128809, 121448, 0, 0, 0, 11286, 0, 0, 0, 0, 0, 0, 0,
+ 42644, 73555, 129797, 129801, 8292, 0, 4980, 113726, 92674, 70130, 0, 0,
+ 0, 0, 74912, 0, 10631, 83330, 100488, 68042, 0, 0, 7900, 101252, 0,
+ 78779, 4198, 128555, 0, 0, 0, 123159, 0, 0, 12931, 0, 0, 0, 2088, 0,
+ 72164, 129284, 0, 0, 69265, 0, 0, 0, 69694, 92838, 129794, 8593, 0, 0, 0,
+ 0, 0, 0, 11798, 0, 100483, 0, 0, 0, 64211, 128865, 120494, 0, 0, 0,
+ 121228, 68901, 128788, 0, 0, 65162, 0, 0, 0, 0, 0, 128130, 0, 92264,
+ 127153, 0, 128818, 0, 0, 61, 0, 74373, 92182, 119554, 92862, 0, 12089, 0,
+ 65834, 83281, 119671, 128701, 0, 0, 42566, 42743, 0, 69824, 0, 92653, 0,
+ 0, 42621, 0, 64833, 0, 0, 0, 43266, 0, 0, 0, 74843, 0, 0, 119103, 64417,
+ 0, 0, 64737, 0, 0, 8930, 0, 0, 66900, 10056, 1800, 0, 0, 0, 129337,
+ 121175, 7743, 0, 0, 119528, 92640, 92453, 9034, 6039, 129139, 10075, 0,
+ 0, 0, 10748, 0, 0, 0, 0, 0, 92984, 0, 0, 128183, 129421, 0, 43064,
+ 127558, 0, 7539, 0, 0, 0, 0, 0, 0, 0, 92898, 42567, 0, 0, 73886, 0,
+ 129988, 12326, 0, 92848, 0, 0, 11355, 0, 0, 0, 0, 69437, 128222, 129803,
+ 129811, 119537, 72327, 43005, 65342, 118902, 0, 0, 8644, 0, 0, 11186,
+ 74296, 41909, 0, 128682, 2791, 127472, 1891, 0, 0, 41907, 66647, 0, 0,
+ 41906, 0, 129672, 10773, 70206, 0, 0, 0, 6412, 2061, 8520, 13146, 0,
+ 92836, 83275, 65902, 2882, 0, 126232, 65852, 0, 92795, 0, 123627, 0, 0,
+ 92794, 0, 0, 128098, 0, 0, 0, 70871, 0, 92792, 0, 120087, 0, 0, 92793,
+ 93971, 0, 3844, 6842, 0, 0, 6612, 0, 0, 0, 0, 0, 783, 0, 0, 0, 983064,
+ 68032, 119225, 0, 0, 68378, 4556, 67839, 68480, 78663, 120069, 120074,
+ 67657, 10510, 4382, 74218, 42194, 0, 92806, 9177, 8902, 93958, 9839,
+ 92804, 120700, 92807, 0, 63999, 41904, 41917, 9788, 120973, 92805, 1862,
+ 0, 0, 0, 41915, 0, 41919, 63994, 41914, 7981, 0, 0, 0, 0, 0, 0, 0,
+ 120834, 0, 0, 0, 6784, 78788, 0, 0, 0, 0, 127534, 127484, 127476, 983874,
+ 0, 983960, 64289, 65289, 0, 129539, 129575, 64509, 0, 0, 126505, 11051,
+ 0, 66635, 55259, 65885, 0, 128310, 0, 0, 0, 0, 7500, 4506, 0, 0, 0, 0, 0,
+ 126609, 4040, 128680, 6167, 0, 42945, 0, 0, 0, 0, 7830, 43036, 0, 0,
+ 63990, 19947, 63988, 63987, 0, 63993, 10440, 9611, 2244, 71883, 0, 65260,
+ 63986, 11446, 63984, 92641, 3435, 119652, 0, 119108, 0, 128632, 0, 0,
+ 12748, 0, 0, 92705, 0, 78790, 0, 0, 63956, 42458, 63954, 63953, 63960,
+ 63959, 63958, 11596, 0, 11469, 69267, 42306, 2723, 0, 0, 70027, 0, 0, 0,
+ 128093, 2880, 0, 0, 0, 0, 128506, 3498, 4378, 0, 129825, 0, 65551,
+ 118928, 0, 43387, 0, 64415, 128898, 0, 0, 0, 0, 8161, 393, 12013, 0,
+ 92216, 126479, 63965, 63964, 63963, 42345, 0, 2174, 63967, 42498, 0,
+ 2927, 0, 63961, 0, 0, 983946, 0, 69699, 0, 42340, 0, 0, 0, 10730, 0,
+ 69688, 0, 64187, 118535, 0, 12437, 9813, 0, 42453, 1604, 9565, 0, 69701,
+ 69235, 42414, 110724, 129196, 0, 42301, 11372, 0, 917973, 0, 0, 63980,
+ 63979, 63978, 0, 128207, 12017, 63982, 63981, 73687, 0, 63977, 63976,
+ 72794, 0, 0, 0, 63971, 4347, 4416, 63968, 11009, 63974, 63973, 402,
+ 69390, 13147, 0, 0, 64646, 13228, 0, 0, 3515, 74252, 65261, 0, 0, 6259,
+ 0, 0, 0, 0, 0, 0, 74813, 74425, 0, 126998, 126114, 0, 0, 0, 129933,
+ 983717, 0, 0, 74301, 0, 122633, 0, 0, 74060, 69508, 0, 66235, 5145, 0, 0,
+ 128394, 0, 73120, 0, 7402, 0, 0, 0, 7952, 7832, 43382, 66616, 0, 983950,
+ 120852, 0, 127875, 64866, 0, 0, 0, 78784, 74248, 0, 0, 983197, 0, 0, 0,
+ 78656, 42390, 0, 0, 983940, 0, 0, 0, 92839, 9508, 0, 9544, 11520, 0,
+ 110898, 3377, 0, 129562, 0, 0, 0, 0, 66989, 66280, 0, 127198, 0, 0, 0,
+ 1955, 119565, 0, 0, 3076, 0, 42168, 73049, 66304, 0, 0, 8917, 42403, 301,
+ 0, 111175, 0, 0, 0, 0, 0, 0, 67819, 92987, 0, 0, 0, 983206, 0, 69403,
+ 3182, 0, 0, 0, 0, 0, 42169, 123162, 74244, 0, 42329, 0, 66326, 6841, 0,
+ 128913, 0, 1219, 3934, 71276, 11483, 74510, 101122, 121110, 42442, 65470,
+ 69565, 0, 64622, 7759, 42482, 485, 0, 0, 42290, 0, 0, 42280, 0, 0, 11655,
+ 64379, 127913, 42431, 10126, 42318, 0, 119631, 74397, 42470, 0, 68315, 0,
+ 110829, 74041, 0, 0, 0, 5411, 0, 0, 0, 64205, 0, 64206, 42393, 64478,
+ 1310, 125007, 0, 12052, 10643, 55271, 72727, 0, 121045, 0, 0, 118852, 0,
+ 0, 0, 0, 113826, 0, 0, 64385, 0, 0, 0, 0, 0, 0, 93848, 92560, 2713, 0,
+ 9650, 0, 0, 120602, 1406, 983650, 78174, 92659, 0, 68223, 0, 0, 0, 0,
+ 43475, 0, 65287, 1508, 127938, 8779, 10569, 75034, 0, 0, 0, 0, 0, 0, 0,
+ 70786, 0, 0, 128344, 9185, 0, 42932, 43403, 0, 0, 0, 0, 0, 0, 0, 0,
+ 12955, 0, 2888, 0, 0, 0, 0, 0, 0, 0, 2878, 0, 0, 0, 0, 0, 0, 129028,
+ 13203, 129722, 10429, 10365, 0, 0, 127165, 7503, 0, 113676, 68381,
+ 119658, 0, 8986, 0, 10632, 11934, 11452, 1332, 0, 0, 0, 0, 73741, 1791,
+ 8850, 9288, 0, 2892, 0, 43394, 555, 0, 0, 0, 0, 64172, 118899, 0, 0, 0,
+ 0, 8854, 0, 5858, 73101, 10582, 0, 0, 1361, 0, 0, 7905, 0, 65256, 0,
+ 41210, 0, 0, 71884, 0, 0, 0, 6828, 0, 92302, 0, 1342, 68440, 0, 64161,
+ 10903, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64381, 0, 0, 0, 42245, 126467,
+ 41972, 0, 0, 0, 9127, 0, 66619, 126489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11620,
+ 0, 1149, 68316, 0, 0, 0, 0, 0, 92492, 0, 118784, 0, 0, 0, 12838, 0,
+ 118819, 0, 0, 0, 0, 41087, 0, 0, 0, 0, 12036, 0, 124143, 0, 0, 0, 64428,
+ 12227, 0, 0, 0, 0, 125248, 120964, 0, 0, 0, 0, 0, 69566, 0, 0, 0, 0, 0,
+ 1743, 0, 0, 0, 65186, 122626, 0, 0, 0, 0, 64439, 0, 68062, 0, 111259,
+ 111258, 43866, 0, 111263, 3395, 9362, 111260, 0, 111257, 111256, 111255,
+ 0, 0, 41091, 3426, 1344, 111249, 111248, 126215, 4735, 11111, 6119,
+ 111251, 42699, 0, 0, 74818, 1423, 0, 0, 0, 0, 12039, 10559, 0, 0, 0,
+ 9472, 67734, 11929, 0, 0, 0, 0, 128826, 0, 11579, 0, 0, 128364, 0, 92185,
+ 0, 0, 1004, 92584, 0, 0, 0, 129755, 0, 2556, 0, 0, 72790, 0, 0, 9686, 0,
+ 0, 0, 70109, 111102, 0, 10718, 13154, 111100, 9139, 0, 0, 0, 0, 0, 0, 0,
+ 0, 92831, 92810, 41708, 12860, 41703, 0, 42090, 5403, 10352, 73917,
+ 129144, 111096, 111088, 5140, 3753, 118785, 41704, 0, 43078, 127789,
+ 2207, 129360, 0, 983207, 92362, 0, 0, 2410, 92525, 0, 0, 0, 0, 0, 0, 0,
+ 0, 119253, 0, 126601, 0, 2066, 74199, 0, 43463, 10659, 119623, 68863, 0,
+ 1336, 0, 0, 69463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126639, 0, 272, 0, 0, 0, 0,
+ 983965, 128133, 0, 0, 124940, 0, 1190, 42146, 1335, 42177, 43867, 0, 0,
+ 10448, 0, 125041, 0, 0, 2099, 5120, 2409, 7799, 0, 74424, 0, 126581,
+ 4731, 0, 111199, 111198, 111197, 111196, 11689, 0, 74977, 9913, 129430,
+ 0, 0, 0, 111195, 111194, 11694, 0, 11690, 111189, 92842, 111187, 11693,
+ 111193, 111192, 43097, 11688, 0, 78797, 194, 111186, 111185, 111184, 0,
+ 0, 0, 11226, 4519, 70337, 10898, 43072, 70205, 0, 0, 0, 73094, 10695, 0,
+ 7540, 0, 110984, 41859, 6067, 92790, 110982, 0, 110981, 13311, 92788,
+ 41857, 92791, 8359, 121224, 12689, 0, 983132, 64577, 92789, 111203,
+ 68183, 111209, 111208, 6064, 110988, 0, 110979, 74142, 0, 111201, 111200,
+ 6051, 123613, 0, 0, 983374, 0, 983651, 0, 0, 0, 110864, 10537, 110862,
+ 1276, 0, 6549, 6052, 0, 0, 0, 0, 118687, 0, 0, 0, 0, 1960, 0, 71232,
+ 66297, 0, 129313, 0, 0, 1345, 111213, 111212, 111211, 8956, 43083, 0,
+ 111215, 64682, 0, 6430, 69563, 111210, 119814, 0, 0, 0, 119817, 0, 492,
+ 43087, 0, 0, 0, 0, 0, 2582, 0, 0, 7444, 72863, 0, 2297, 111243, 73837, 0,
+ 0, 65096, 197, 74183, 0, 69571, 111241, 111240, 129760, 66515, 43550,
+ 119829, 111229, 111228, 93764, 111226, 0, 0, 111231, 111230, 71686, 1799,
+ 0, 42148, 74336, 0, 0, 65340, 111220, 110974, 2262, 111217, 111224,
+ 74931, 111222, 10896, 0, 0, 0, 0, 6338, 111003, 110997, 110994, 111006,
+ 111002, 111005, 0, 111279, 111278, 111277, 72133, 0, 111273, 111272,
+ 110961, 3171, 6623, 4961, 0, 886, 55216, 8654, 110965, 111270, 74390,
+ 64603, 111267, 129283, 68122, 0, 43084, 0, 0, 0, 0, 69693, 8994, 10944,
+ 65938, 111239, 111238, 111237, 111236, 66279, 92890, 42510, 0, 0, 6804,
+ 0, 1947, 0, 0, 0, 42759, 0, 1705, 122631, 0, 0, 0, 0, 72722, 74036, 0, 0,
+ 66720, 111281, 111280, 0, 4909, 111285, 111284, 111283, 4904, 0, 43503,
+ 1365, 9253, 42757, 0, 7462, 0, 11860, 0, 0, 119587, 0, 917579, 92526, 0,
+ 125035, 0, 111311, 111310, 0, 0, 0, 0, 93977, 0, 0, 0, 0, 3629, 0, 13005,
+ 0, 3628, 0, 111295, 0, 0, 0, 0, 111290, 64809, 2928, 4905, 111083, 851,
+ 55233, 111291, 111059, 43086, 9114, 43870, 42583, 9315, 4822, 4906,
+ 121097, 2847, 111028, 10330, 0, 1251, 7777, 41852, 125059, 111327,
+ 111032, 111325, 12646, 0, 10259, 0, 65821, 75046, 6018, 0, 111324,
+ 111323, 111322, 68372, 111319, 111318, 71893, 2558, 0, 64584, 111321,
+ 111320, 0, 0, 0, 0, 78911, 111308, 111307, 69500, 73987, 74599, 71895,
+ 93012, 0, 128715, 0, 12867, 111296, 0, 0, 11044, 111300, 111299, 8904,
+ 11824, 65857, 0, 128674, 129027, 4387, 0, 0, 124920, 0, 0, 0, 0, 11842,
+ 0, 0, 0, 5136, 1968, 983041, 126627, 1337, 0, 0, 0, 0, 66506, 0, 0, 0, 0,
+ 42314, 121384, 0, 0, 6120, 0, 65670, 67457, 0, 43082, 6016, 0, 42284,
+ 71894, 4276, 111314, 3619, 41638, 69691, 0, 42322, 8853, 111043, 0, 490,
+ 0, 13231, 68384, 72310, 65350, 0, 0, 0, 68245, 42435, 6154, 0, 65354, 0,
+ 0, 42397, 334, 72732, 42416, 65359, 65273, 74634, 128227, 4442, 10364, 0,
+ 778, 41626, 42455, 7989, 0, 3227, 69907, 111053, 0, 2915, 11502, 983214,
+ 41702, 10309, 0, 0, 0, 0, 0, 0, 0, 127268, 127258, 127267, 65215, 64410,
+ 127260, 71175, 0, 0, 0, 0, 0, 0, 41700, 110651, 69266, 126488, 0, 0,
+ 42495, 0, 0, 0, 10460, 43364, 0, 1356, 3728, 42713, 0, 0, 42342, 10914,
+ 0, 42489, 64310, 66896, 41861, 42297, 0, 0, 41860, 64862, 0, 0, 5289,
+ 42336, 128658, 0, 92529, 42410, 71129, 120624, 0, 2649, 74493, 0, 126635,
+ 0, 3382, 42449, 9081, 1658, 11936, 93019, 113814, 11269, 0, 0, 43100,
+ 69888, 65508, 0, 0, 121451, 0, 0, 0, 129780, 69272, 4732, 128283, 0, 0,
+ 0, 121113, 2236, 126551, 0, 6048, 0, 0, 73965, 0, 0, 0, 0, 10151, 9681,
+ 4475, 0, 41142, 2100, 0, 0, 6035, 0, 123599, 10296, 0, 0, 0, 0, 0, 0, 0,
+ 983312, 68488, 10392, 10328, 0, 43462, 0, 0, 0, 8979, 0, 0, 983309, 0, 0,
+ 0, 10977, 0, 10344, 0, 65299, 10408, 0, 0, 121187, 66505, 0, 0, 0, 0, 0,
+ 122648, 43074, 73799, 0, 0, 122944, 0, 3446, 0, 129891, 128692, 0, 0,
+ 119582, 4474, 0, 43093, 6282, 0, 0, 127372, 0, 0, 0, 129881, 0, 0, 0, 0,
+ 66910, 67811, 92277, 0, 64948, 0, 74347, 0, 0, 0, 983981, 8194, 0,
+ 121165, 11010, 0, 8893, 0, 983988, 0, 0, 0, 983322, 7925, 0, 0, 113825,
+ 0, 1352, 11069, 7707, 0, 126486, 0, 0, 0, 0, 65605, 6040, 0, 10071, 0,
+ 128156, 43750, 0, 8899, 69873, 0, 0, 983316, 128208, 7820, 69615, 0, 0,
+ 7746, 1492, 0, 0, 0, 66866, 0, 11788, 65913, 0, 0, 43095, 0, 0, 92265,
+ 2999, 0, 120720, 0, 371, 120759, 6023, 0, 0, 11708, 0, 0, 6323, 0, 0, 0,
+ 8938, 6043, 65866, 0, 78910, 0, 72419, 0, 129480, 2589, 74332, 1689,
+ 7802, 0, 0, 0, 0, 66704, 0, 129992, 0, 0, 128127, 6049, 0, 4027, 0, 0,
+ 111334, 111333, 1503, 111331, 0, 111337, 11951, 111335, 2387, 0, 0, 8289,
+ 111330, 7326, 66514, 65514, 0, 64865, 0, 9668, 0, 0, 0, 0, 93060, 6036,
+ 92768, 4026, 74089, 127091, 0, 0, 75044, 110821, 0, 110819, 0, 0, 0, 0,
+ 6021, 0, 128288, 0, 43155, 0, 110822, 124152, 111343, 42691, 111341,
+ 111340, 2246, 166, 0, 0, 0, 10623, 408, 0, 111339, 13298, 0, 7426, 43694,
+ 0, 0, 8811, 0, 0, 129753, 0, 0, 74134, 983054, 0, 127811, 0, 0, 0, 6645,
+ 646, 128813, 0, 42129, 0, 120880, 0, 8697, 0, 120936, 122953, 0, 0, 0,
+ 5809, 1950, 0, 92432, 68339, 0, 42136, 0, 0, 0, 0, 0, 0, 111354, 983984,
+ 0, 0, 111349, 111348, 43330, 111346, 111353, 111352, 41567, 111350, 0, 0,
+ 0, 0, 111345, 111344, 8285, 0, 4509, 0, 128361, 0, 77774, 129851, 0, 0,
+ 41727, 0, 0, 0, 0, 0, 71188, 0, 74512, 7027, 3886, 0, 74023, 92888, 0, 0,
+ 126092, 94058, 119855, 0, 121455, 11707, 119852, 0, 7939, 10342, 92460,
+ 72747, 121408, 917569, 0, 71198, 94077, 119847, 0, 0, 7201, 0, 123554,
+ 120866, 983987, 1540, 0, 0, 124923, 0, 119856, 41718, 71177, 0, 0,
+ 128001, 118699, 0, 119040, 0, 9619, 120840, 0, 0, 0, 0, 3560, 0, 6070,
+ 129000, 0, 2922, 6082, 70147, 65009, 983973, 0, 0, 0, 0, 0, 0, 3607,
+ 65863, 0, 92487, 42153, 121042, 0, 983862, 2032, 0, 0, 0, 0, 129985, 0,
+ 43085, 6057, 0, 0, 0, 0, 0, 0, 0, 0, 638, 6083, 126976, 0, 0, 2305, 0, 0,
+ 118658, 6056, 10878, 0, 0, 6085, 119351, 0, 3915, 0, 0, 0, 0, 0, 0, 4028,
+ 1787, 0, 43096, 0, 0, 1768, 0, 0, 0, 128125, 0, 0, 583, 129137, 0, 0,
+ 66004, 0, 0, 0, 92859, 0, 55267, 120810, 128995, 43075, 65049, 0, 74531,
+ 0, 93009, 70694, 0, 0, 129375, 9869, 128815, 1771, 0, 0, 0, 0, 0, 0,
+ 119115, 113708, 0, 0, 74101, 0, 0, 0, 0, 83367, 0, 0, 0, 12539, 123631,
+ 0, 0, 129846, 73862, 69842, 9897, 0, 100561, 0, 124142, 0, 0, 0, 8931, 0,
+ 1415, 8866, 74552, 0, 128312, 0, 983566, 43106, 127275, 71089, 1580,
+ 92278, 68424, 0, 0, 7658, 3440, 78215, 1562, 0, 0, 129031, 0, 0, 0, 0, 0,
+ 0, 6028, 68900, 42892, 0, 111016, 0, 0, 0, 0, 0, 128269, 0, 66776, 42946,
+ 127276, 92849, 0, 72448, 120510, 11599, 0, 11602, 11591, 11574, 11581,
+ 11597, 11598, 6253, 11571, 11584, 70273, 11569, 122937, 8906, 0, 5755,
+ 2636, 0, 10815, 11619, 129094, 0, 7815, 11616, 11617, 70064, 11618,
+ 11604, 7869, 11612, 0, 42152, 0, 122941, 0, 92586, 126247, 0, 92173, 0,
+ 0, 6616, 0, 0, 120875, 391, 0, 0, 0, 42296, 11588, 0, 0, 0, 68397, 0, 0,
+ 42335, 983189, 0, 0, 7538, 94040, 0, 42491, 0, 0, 128088, 4576, 0, 0,
+ 43809, 4277, 0, 3563, 0, 42338, 368, 0, 0, 42412, 0, 78209, 119144, 0,
+ 43814, 983616, 1849, 0, 9921, 42451, 4253, 0, 0, 118688, 42404, 64657,
+ 73919, 3618, 78338, 0, 0, 0, 0, 0, 929, 6827, 42035, 0, 0, 0, 67847, 0,
+ 0, 0, 0, 0, 0, 0, 0, 4578, 64513, 0, 0, 0, 71049, 68090, 127086, 43305,
+ 0, 73462, 118530, 0, 42048, 10166, 0, 127095, 113810, 983128, 0, 983991,
+ 0, 0, 42483, 0, 0, 0, 42291, 0, 71047, 0, 6641, 525, 66404, 0, 8763,
+ 125091, 0, 0, 0, 0, 0, 42504, 42581, 74280, 6915, 42310, 0, 8559, 0,
+ 983994, 125100, 0, 0, 11666, 8679, 0, 1576, 42423, 0, 0, 73840, 983092,
+ 11374, 0, 10889, 129076, 0, 42462, 0, 77982, 0, 2718, 42424, 0, 0,
+ 127166, 0, 1179, 0, 0, 0, 363, 11015, 72229, 0, 43857, 0, 66692, 0, 0, 0,
+ 11041, 72018, 0, 0, 0, 0, 125184, 0, 92520, 0, 9492, 66709, 9212, 12833,
+ 0, 0, 1297, 122932, 0, 0, 0, 0, 0, 12924, 0, 0, 10090, 125249, 0, 42505,
+ 0, 42507, 0, 42311, 92940, 120919, 68401, 10759, 0, 0, 120924, 42351,
+ 42919, 9398, 66292, 0, 9422, 122942, 122943, 0, 0, 0, 129440, 92575,
+ 1603, 0, 0, 0, 0, 0, 69703, 11250, 0, 0, 10546, 0, 0, 11600, 0, 2797,
+ 73821, 42427, 306, 714, 3058, 120154, 0, 0, 0, 42395, 0, 11607, 0, 11198,
+ 127512, 0, 72232, 129067, 0, 42433, 0, 7603, 74063, 0, 42141, 0, 0, 0,
+ 129085, 8244, 362, 125069, 0, 8037, 0, 0, 0, 69510, 41606, 66696, 77912,
+ 0, 2093, 0, 120676, 122929, 41604, 0, 0, 0, 0, 10523, 1446, 42320, 0,
+ 120247, 64773, 42472, 0, 0, 1722, 5581, 0, 64496, 0, 0, 64914, 0, 42620,
+ 128603, 124988, 0, 0, 10549, 130035, 71190, 0, 0, 0, 0, 0, 71712, 0, 0,
+ 0, 0, 0, 0, 0, 7684, 66338, 0, 1174, 0, 0, 983621, 0, 0, 0, 42277, 0,
+ 42456, 65667, 0, 0, 0, 0, 42417, 0, 0, 120812, 42304, 0, 0, 0, 74443,
+ 127894, 0, 8313, 0, 0, 1316, 66690, 0, 0, 0, 0, 0, 0, 66844, 983715, 0,
+ 0, 0, 65200, 3383, 0, 0, 70063, 122947, 0, 0, 42420, 119185, 0, 0,
+ 983917, 0, 121079, 72369, 0, 42343, 124980, 42706, 1751, 42496, 65742,
+ 13166, 0, 0, 0, 0, 0, 42683, 12697, 0, 0, 0, 125047, 0, 42346, 0, 0,
+ 3757, 0, 0, 121075, 65869, 0, 9247, 74976, 3193, 0, 0, 42459, 7596, 7921,
+ 0, 74095, 0, 42499, 11590, 66006, 0, 42307, 0, 43953, 118591, 0, 1023,
+ 474, 0, 0, 0, 0, 42487, 0, 0, 0, 42295, 0, 121474, 72237, 0, 9835, 0,
+ 127782, 0, 12275, 0, 0, 8595, 0, 0, 0, 0, 0, 10118, 0, 129156, 0, 0, 0,
+ 0, 0, 0, 699, 0, 120923, 11601, 0, 92941, 0, 7581, 0, 92530, 0, 0, 0,
+ 7765, 65583, 0, 0, 64597, 43444, 0, 92197, 0, 64279, 7036, 5823, 1937, 0,
+ 917854, 65415, 13308, 65417, 0, 65217, 0, 0, 11017, 0, 0, 7294, 0, 0, 0,
+ 0, 42466, 65416, 68858, 0, 71350, 65413, 92381, 126498, 12964, 42240,
+ 1941, 0, 0, 1713, 118679, 0, 0, 11407, 42441, 128262, 6297, 0, 0, 0,
+ 42481, 0, 0, 7179, 42289, 0, 120921, 969, 0, 0, 0, 6165, 0, 0, 0, 0,
+ 42402, 0, 0, 0, 129511, 0, 72234, 0, 0, 64876, 92635, 6046, 0, 6208,
+ 128870, 129309, 73749, 0, 0, 42422, 0, 0, 128155, 73775, 338, 0, 121369,
+ 0, 42328, 10767, 0, 8115, 0, 0, 0, 0, 92687, 0, 0, 0, 0, 73029, 0, 0, 0,
+ 71687, 4486, 128082, 2171, 0, 10925, 0, 0, 0, 0, 42309, 10257, 0, 10273,
+ 7668, 10305, 42461, 74882, 42349, 8832, 0, 0, 10644, 0, 129531, 42278, 0,
+ 0, 69874, 0, 129949, 42429, 0, 42316, 11223, 0, 0, 42468, 0, 0, 0, 65402,
+ 0, 0, 72235, 0, 0, 41963, 120990, 0, 0, 125013, 6823, 42391, 1588, 65400,
+ 0, 0, 0, 65398, 787, 0, 0, 0, 0, 2078, 127239, 65399, 0, 0, 0, 65401, 0,
+ 121196, 0, 113816, 644, 0, 71335, 0, 3659, 0, 0, 0, 13107, 92669, 0,
+ 10502, 74457, 0, 11221, 41554, 0, 0, 0, 41557, 11209, 0, 11070, 119221,
+ 0, 0, 73858, 41555, 9514, 0, 66771, 64641, 92447, 0, 7520, 73888, 77955,
+ 0, 0, 0, 0, 0, 64527, 0, 118707, 12723, 0, 68776, 0, 0, 0, 78835, 4055,
+ 78826, 77960, 65212, 0, 127353, 12319, 0, 0, 983218, 7964, 65427, 0,
+ 65424, 72217, 120966, 0, 65425, 74890, 128251, 0, 0, 0, 3448, 10827, 0,
+ 9866, 74527, 0, 0, 8625, 69783, 92304, 10477, 0, 0, 0, 65423, 0, 0, 0, 0,
+ 6152, 0, 0, 6629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11046, 11490, 0, 4485,
+ 71126, 0, 0, 0, 0, 0, 5869, 118533, 119633, 0, 7040, 3588, 0, 12825, 0,
+ 0, 128569, 0, 0, 0, 0, 0, 126637, 0, 0, 128449, 64499, 65245, 127367,
+ 1171, 127368, 69717, 127365, 1805, 8772, 0, 127363, 9930, 65247, 0, 0,
+ 2338, 127362, 92695, 0, 0, 0, 69219, 0, 120104, 0, 120103, 72221, 120102,
+ 129924, 118814, 8734, 4212, 0, 0, 66701, 0, 65862, 0, 120095, 42903, 0,
+ 0, 0, 126117, 426, 0, 120098, 8251, 0, 65436, 0, 2120, 43302, 1224, 0,
+ 65576, 0, 66876, 1764, 6074, 0, 12858, 0, 0, 65439, 6378, 74566, 128885,
+ 41960, 0, 41644, 0, 2129, 0, 9222, 0, 0, 4259, 9092, 0, 41961, 0, 0,
+ 66357, 42331, 64935, 0, 0, 1293, 0, 2132, 0, 983569, 0, 2454, 0, 3613,
+ 128837, 71117, 0, 0, 69681, 10978, 10840, 0, 10668, 72826, 127197, 9118,
+ 120164, 0, 0, 0, 1157, 64903, 8638, 0, 101295, 0, 0, 0, 0, 67466, 128981,
+ 10086, 0, 11128, 0, 0, 65430, 74013, 6079, 0, 10764, 127910, 64435,
+ 128051, 1339, 118643, 65428, 1317, 8822, 0, 0, 0, 127143, 0, 0, 0, 43110,
+ 0, 10428, 129848, 0, 0, 5742, 43076, 4692, 0, 0, 4007, 5004, 128781, 0,
+ 751, 6595, 6596, 0, 66373, 0, 0, 64908, 0, 6593, 72349, 12004, 119192,
+ 74097, 43108, 0, 0, 119333, 92188, 6598, 0, 6599, 0, 93031, 74194, 0,
+ 121483, 66674, 6597, 0, 73921, 0, 64745, 2281, 0, 0, 128996, 43790, 0,
+ 2430, 41678, 71492, 0, 43785, 113716, 0, 121263, 0, 0, 1921, 0, 19927,
+ 70390, 65406, 0, 43786, 4284, 128346, 72210, 43789, 12841, 9229, 0,
+ 42285, 0, 0, 0, 0, 3521, 0, 118690, 8325, 0, 65403, 0, 1854, 0, 0, 0, 0,
+ 0, 0, 0, 0, 4344, 0, 65433, 6076, 0, 0, 74764, 12074, 0, 0, 129148, 0,
+ 12934, 119555, 65432, 128877, 0, 6071, 65434, 0, 65435, 4053, 128623, 0,
+ 0, 0, 917934, 69823, 127463, 0, 121403, 127473, 8421, 73836, 0, 43705,
+ 502, 0, 65431, 0, 0, 0, 1303, 316, 7364, 0, 2136, 0, 120796, 64365,
+ 43480, 92639, 4860, 0, 127877, 0, 129728, 9583, 0, 5546, 0, 118565, 0, 0,
+ 0, 5544, 127475, 0, 70352, 5543, 128917, 72821, 12137, 5548, 0, 0, 10007,
+ 0, 127523, 6077, 0, 65452, 0, 119341, 11214, 65952, 0, 72226, 0, 0, 1319,
+ 74210, 65410, 67399, 92606, 0, 0, 118660, 0, 66716, 83513, 4691, 128619,
+ 9345, 621, 92872, 0, 122889, 65411, 0, 74575, 121246, 65408, 73899, 0,
+ 9474, 2812, 119118, 65412, 3786, 65409, 8894, 83246, 119611, 7923, 3716,
+ 92798, 0, 0, 0, 7012, 124122, 128439, 9566, 0, 94176, 0, 65012, 126242,
+ 545, 9575, 0, 10050, 12718, 0, 8859, 6820, 124915, 129941, 120740, 0, 0,
+ 9119, 2787, 0, 984000, 8507, 2012, 7985, 0, 0, 0, 0, 194634, 0, 410, 0,
+ 0, 120789, 120609, 0, 120378, 120379, 0, 0, 120374, 72742, 120376,
+ 120377, 120370, 120371, 120372, 120373, 3860, 120367, 72205, 74031,
+ 111131, 73685, 11748, 120365, 7941, 111134, 8749, 111132, 12698, 111129,
+ 361, 110793, 845, 67509, 0, 0, 4562, 72241, 2926, 0, 4569, 0, 110797,
+ 43487, 0, 0, 0, 74287, 122885, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6291, 0, 0, 0,
+ 9734, 0, 0, 0, 0, 127754, 7359, 83523, 43863, 0, 111150, 8769, 111148,
+ 111147, 111145, 4859, 111143, 111142, 0, 0, 0, 0, 12172, 111136, 0,
+ 127899, 111141, 64764, 4210, 111138, 0, 804, 0, 83520, 0, 70344, 0, 0,
+ 67202, 10091, 67200, 119257, 67206, 67205, 67204, 67203, 72302, 0, 0, 0,
+ 128959, 0, 1425, 92259, 119229, 11049, 0, 71480, 42649, 8482, 0, 0,
+ 66715, 67209, 11940, 67207, 664, 0, 0, 0, 70200, 127525, 0, 70194, 93061,
+ 111155, 68474, 111153, 6032, 67218, 67217, 7430, 194670, 70191, 0, 0, 0,
+ 0, 0, 41161, 0, 9765, 10993, 41162, 0, 70189, 1169, 111181, 0, 1905,
+ 6034, 41164, 64744, 43236, 0, 128800, 73110, 0, 0, 788, 0, 0, 111167,
+ 111128, 1663, 128976, 42901, 127237, 67211, 67210, 0, 0, 67215, 67214,
+ 67213, 67212, 111160, 111159, 111158, 111157, 0, 69492, 0, 111161, 43612,
+ 0, 0, 0, 10855, 67223, 9355, 67221, 65198, 120355, 0, 221, 0, 0, 0,
+ 121141, 7191, 118930, 72208, 125212, 0, 0, 0, 0, 67228, 67227, 43333,
+ 67225, 0, 0, 0, 67229, 0, 7245, 0, 74405, 69922, 72219, 111178, 3873,
+ 8367, 111174, 111173, 111172, 43649, 0, 111177, 111176, 0, 11164, 0,
+ 74403, 111171, 111170, 111169, 7682, 74404, 1462, 10235, 0, 0, 0, 0, 0,
+ 111130, 0, 0, 74402, 0, 92299, 0, 0, 74052, 0, 126127, 120549, 0, 64295,
+ 0, 0, 0, 0, 0, 120662, 0, 0, 67231, 67230, 10755, 55257, 11155, 128568,
+ 983137, 9470, 0, 127540, 0, 69680, 64384, 0, 128607, 0, 0, 0, 122987,
+ 73764, 8204, 0, 0, 0, 0, 0, 8728, 0, 10904, 73446, 19936, 7833, 0, 0, 0,
+ 0, 92546, 0, 0, 0, 8537, 0, 0, 0, 121244, 0, 0, 2254, 128193, 0, 0, 0, 0,
+ 3062, 0, 0, 0, 0, 0, 41160, 41147, 41158, 0, 120777, 0, 41155, 111116,
+ 111115, 111114, 0, 121332, 111119, 111118, 111117, 129878, 0, 129091, 0,
+ 0, 0, 64594, 2456, 66867, 0, 0, 0, 0, 3721, 0, 0, 1230, 2678, 0, 3597,
+ 917795, 0, 0, 92215, 0, 67737, 8352, 0, 0, 0, 64515, 121378, 0, 129128,
+ 67846, 0, 129767, 92466, 0, 0, 71338, 0, 8660, 0, 0, 0, 0, 0, 4483, 0, 0,
+ 0, 6080, 0, 0, 1746, 1315, 0, 70201, 0, 13140, 74508, 0, 0, 4480, 0,
+ 111113, 111112, 0, 67979, 0, 6360, 10897, 111106, 605, 68302, 110737,
+ 69875, 110735, 110736, 66681, 0, 0, 0, 0, 0, 0, 0, 10877, 118868, 64885,
+ 0, 0, 0, 0, 0, 0, 345, 0, 0, 64606, 9917, 0, 0, 92196, 0, 1776, 8422,
+ 43992, 0, 0, 0, 126543, 43328, 0, 0, 1295, 0, 42869, 0, 0, 0, 0, 128772,
+ 65123, 125210, 11293, 11288, 0, 0, 65666, 0, 92369, 65420, 0, 0, 4252, 0,
+ 0, 0, 706, 72800, 0, 0, 129931, 65419, 92177, 0, 8419, 65421, 0, 66702,
+ 0, 12670, 118608, 0, 0, 0, 72825, 65422, 83008, 0, 0, 0, 0, 0, 124153,
+ 9736, 4184, 65418, 0, 0, 74035, 0, 129955, 0, 0, 0, 0, 129447, 0, 7962,
+ 12211, 9837, 83505, 0, 0, 5719, 0, 129720, 119068, 73777, 1857, 0, 9927,
+ 0, 983959, 0, 10037, 0, 73695, 78322, 78319, 7818, 0, 0, 127769, 0, 0, 0,
+ 65077, 0, 78325, 78326, 78323, 43327, 43989, 0, 65828, 0, 0, 83499, 0,
+ 68390, 0, 110687, 78336, 78339, 9543, 78335, 78332, 78333, 0, 127964, 0,
+ 129552, 983914, 0, 69448, 0, 71429, 0, 0, 0, 11914, 69431, 0, 0, 0, 9949,
+ 0, 0, 119215, 0, 12073, 73519, 0, 0, 0, 101218, 2260, 0, 0, 0, 0, 0, 0,
+ 1939, 0, 0, 0, 69903, 0, 0, 0, 0, 6643, 92477, 128485, 0, 78330, 78331,
+ 78328, 78329, 0, 92551, 0, 0, 0, 0, 124124, 72417, 0, 0, 0, 0, 78341,
+ 78342, 120944, 78340, 129513, 127529, 92350, 3784, 78350, 0, 78348,
+ 78349, 78345, 43324, 78343, 78344, 2231, 0, 0, 0, 42467, 0, 0, 42894,
+ 78363, 13281, 78360, 78361, 78356, 78358, 78353, 64899, 0, 41149, 0,
+ 43162, 68096, 41150, 0, 10571, 67162, 67161, 67160, 67159, 6947, 41152,
+ 887, 9249, 6565, 64806, 74366, 0, 67158, 67157, 0, 10831, 67175, 67174,
+ 120232, 65827, 43325, 67178, 10168, 67176, 0, 0, 9190, 128497, 9666,
+ 41997, 0, 0, 0, 0, 0, 0, 129411, 0, 78508, 0, 78351, 78352, 0, 75063,
+ 72839, 983749, 0, 126604, 0, 0, 0, 983422, 0, 2270, 0, 129957, 0, 78365,
+ 0, 67189, 72818, 0, 0, 0, 0, 0, 0, 0, 72833, 101119, 78366, 78367, 0, 0,
+ 0, 0, 10137, 6121, 10995, 0, 71050, 8119, 0, 71052, 0, 0, 0, 0, 0, 0, 0,
+ 1394, 0, 0, 128960, 0, 67184, 2998, 67182, 67181, 67188, 67187, 67186,
+ 67185, 0, 101185, 0, 0, 67180, 42003, 0, 0, 67193, 67192, 67191, 67190,
+ 67197, 67196, 67195, 67194, 0, 72770, 43315, 71051, 0, 1593, 0, 125120,
+ 619, 4635, 0, 72875, 0, 128859, 118657, 0, 0, 0, 67199, 67198, 0, 42790,
+ 42006, 0, 0, 0, 128998, 10757, 9347, 127767, 0, 0, 74227, 78904, 0,
+ 74116, 128423, 121073, 120860, 0, 92427, 0, 0, 0, 0, 64590, 0, 4371, 0,
+ 0, 92478, 0, 0, 73977, 0, 0, 127847, 0, 120862, 0, 64550, 73745, 70451,
+ 0, 121013, 0, 0, 0, 129286, 0, 0, 0, 0, 9131, 118648, 125214, 983223, 0,
+ 0, 64260, 0, 12606, 0, 0, 0, 0, 562, 983614, 0, 129648, 66455, 127533,
+ 3219, 0, 0, 0, 1037, 0, 64491, 0, 78579, 78572, 78580, 4568, 549, 0, 0,
+ 0, 0, 0, 128095, 70851, 2205, 0, 0, 0, 0, 129716, 0, 10825, 8079, 118962,
+ 0, 0, 0, 128855, 0, 13071, 0, 0, 41049, 42840, 43614, 129341, 74881,
+ 74596, 127191, 5212, 0, 66402, 119191, 0, 9747, 0, 0, 129778, 984008,
+ 41047, 1668, 0, 0, 0, 1187, 0, 74416, 0, 0, 0, 0, 3240, 128518, 9213, 0,
+ 0, 0, 127174, 69822, 0, 0, 0, 0, 1623, 0, 0, 0, 0, 0, 0, 11272, 0, 73914,
+ 65048, 1909, 42172, 0, 0, 10736, 11580, 72228, 7615, 0, 0, 4237, 66576,
+ 0, 65815, 68083, 0, 0, 0, 3489, 0, 0, 0, 0, 0, 0, 127146, 3796, 6800, 0,
+ 65582, 0, 129521, 0, 0, 68036, 0, 0, 64857, 121213, 126493, 0, 66308, 0,
+ 0, 64634, 127817, 0, 0, 0, 0, 3246, 0, 43972, 128643, 0, 0, 0, 0, 120751,
+ 0, 0, 0, 0, 1496, 42827, 0, 942, 2378, 119213, 0, 0, 0, 0, 9510, 1232,
+ 8139, 0, 0, 0, 11409, 0, 6382, 0, 66319, 121237, 0, 0, 0, 127887, 2374,
+ 0, 8475, 120844, 66313, 0, 0, 64879, 119298, 0, 0, 70869, 0, 0, 129025,
+ 0, 7705, 11942, 0, 0, 3309, 0, 119302, 0, 83345, 983866, 0, 0, 1280,
+ 6998, 128104, 0, 0, 0, 129945, 0, 0, 0, 0, 0, 0, 0, 74239, 983073, 0, 0,
+ 0, 6078, 121354, 0, 1475, 0, 9938, 6084, 0, 983995, 0, 118571, 0, 3256,
+ 0, 43973, 0, 0, 0, 8727, 0, 0, 0, 110831, 110832, 10562, 110830, 0, 0, 0,
+ 3248, 0, 0, 9015, 0, 0, 3635, 64337, 0, 0, 43852, 7195, 0, 2007, 64431,
+ 0, 0, 0, 0, 0, 0, 0, 65613, 77909, 0, 0, 0, 0, 119218, 7984, 11670,
+ 74434, 127770, 4176, 69248, 2034, 69442, 11154, 65891, 0, 0, 318, 2038,
+ 0, 0, 0, 3649, 13149, 42145, 42798, 3634, 0, 0, 128483, 122928, 124113,
+ 0, 11402, 120954, 94032, 74238, 0, 43313, 0, 0, 7938, 0, 1761, 0, 65379,
+ 68386, 128185, 1159, 71183, 0, 0, 0, 66687, 120851, 0, 41680, 0, 0, 0,
+ 1514, 11668, 67891, 9313, 0, 128490, 67877, 0, 41681, 0, 0, 12848, 69982,
+ 67873, 0, 74278, 0, 0, 12649, 0, 0, 1194, 3242, 9761, 9555, 8598, 0,
+ 120524, 0, 1551, 65447, 129414, 126211, 0, 0, 0, 67875, 0, 3495, 66648,
+ 125079, 0, 73024, 983232, 0, 126130, 10641, 0, 0, 0, 77845, 0, 0, 0, 0,
+ 0, 11131, 0, 0, 0, 0, 0, 42685, 72017, 193, 0, 0, 0, 42667, 0, 0, 92318,
+ 71958, 0, 1362, 9558, 0, 0, 0, 7351, 73789, 0, 0, 4426, 0, 0, 0, 0, 7276,
+ 42163, 5220, 0, 0, 67822, 0, 0, 0, 0, 41692, 0, 72283, 0, 0, 3223, 65492,
+ 0, 0, 4549, 983706, 0, 0, 101162, 10807, 0, 0, 0, 42182, 8688, 12866, 0,
+ 3294, 0, 0, 128101, 0, 64514, 0, 43329, 129989, 0, 0, 0, 119061, 0,
+ 43422, 0, 0, 128618, 0, 42729, 0, 3215, 120982, 68880, 917564, 0, 0, 0,
+ 65682, 0, 0, 65924, 0, 73506, 0, 1501, 0, 118807, 0, 0, 9607, 0, 65794,
+ 72243, 983046, 10989, 0, 74399, 0, 0, 7152, 0, 0, 129530, 7483, 125083,
+ 0, 8104, 70128, 7474, 0, 5189, 0, 0, 0, 8141, 0, 42537, 69612, 0, 0, 0,
+ 0, 0, 127307, 42934, 0, 0, 0, 0, 0, 0, 64517, 0, 0, 1650, 0, 0, 128502,
+ 7901, 3238, 0, 65556, 0, 0, 65158, 43416, 74959, 0, 7527, 0, 43319, 0, 0,
+ 45, 0, 0, 0, 0, 0, 7347, 0, 0, 0, 13129, 0, 9084, 0, 8737, 0, 0, 0,
+ 66808, 9639, 7912, 2620, 129653, 3564, 0, 0, 0, 0, 75049, 0, 2853, 0, 0,
+ 0, 0, 0, 2850, 8084, 0, 0, 71446, 92284, 43122, 0, 0, 0, 126503, 72214,
+ 0, 74767, 0, 7331, 110646, 0, 8245, 0, 3158, 92396, 3983, 0, 923, 0,
+ 69397, 292, 0, 126548, 0, 3221, 1763, 0, 0, 0, 0, 7253, 194636, 68391,
+ 75002, 0, 3637, 12996, 0, 70461, 0, 0, 3228, 0, 0, 0, 0, 0, 0, 120833,
+ 118939, 0, 7696, 78589, 0, 0, 0, 43316, 4177, 0, 9089, 0, 128805, 72116,
+ 64500, 68133, 0, 0, 1856, 100572, 0, 6379, 0, 118999, 0, 3208, 0, 0, 0,
+ 0, 0, 0, 129402, 0, 0, 0, 2033, 0, 0, 0, 55254, 7740, 0, 0, 0, 128197, 0,
+ 93988, 0, 67612, 0, 0, 41689, 129380, 0, 0, 6646, 0, 0, 0, 983964, 0, 0,
+ 4573, 0, 0, 0, 0, 0, 92961, 0, 118620, 41688, 0, 0, 0, 8314, 0, 0, 0, 0,
+ 0, 66721, 0, 0, 121033, 0, 128226, 0, 0, 0, 13164, 0, 66237, 983982, 0,
+ 0, 0, 3257, 0, 0, 1845, 0, 0, 0, 0, 128783, 0, 0, 0, 0, 3499, 8609, 0,
+ 7145, 0, 0, 0, 0, 74829, 984007, 983296, 0, 0, 0, 7591, 0, 0, 0, 73778,
+ 70132, 128167, 0, 0, 0, 0, 119261, 0, 0, 118561, 13083, 0, 0, 0, 0,
+ 66177, 983274, 5429, 0, 0, 68168, 66181, 0, 0, 983258, 0, 0, 5433, 67659,
+ 0, 42776, 1547, 66176, 92428, 0, 5425, 4977, 9999, 0, 5423, 64560,
+ 125094, 0, 0, 0, 74122, 0, 0, 0, 128003, 4418, 66199, 0, 92300, 0, 0, 0,
+ 11863, 124995, 0, 11908, 0, 9360, 125101, 983204, 0, 66187, 12837,
+ 983293, 0, 11112, 0, 92321, 43318, 0, 0, 0, 0, 126518, 120604, 0, 983291,
+ 0, 129595, 0, 983801, 0, 9958, 0, 125108, 0, 0, 0, 2433, 128602, 0, 3352,
+ 0, 0, 0, 0, 0, 0, 305, 567, 67662, 0, 69979, 65242, 0, 41695, 0, 0, 0,
+ 7837, 92873, 129002, 5337, 917622, 7325, 43312, 917619, 68742, 917617,
+ 74086, 68777, 917614, 917613, 10973, 917611, 1372, 128768, 917608,
+ 917607, 1254, 917605, 917604, 93967, 917602, 65228, 113753, 129367,
+ 67723, 8068, 0, 0, 983970, 0, 3245, 64393, 119069, 118681, 0, 0, 0, 0, 0,
+ 0, 983284, 0, 119563, 129935, 78865, 0, 126638, 0, 0, 43322, 0, 0, 0, 0,
+ 92698, 3226, 67695, 0, 0, 983958, 10200, 0, 128779, 101143, 0, 65610, 0,
+ 0, 0, 3585, 250, 101142, 43320, 0, 0, 0, 0, 1152, 129849, 1688, 0, 0, 0,
+ 0, 0, 121040, 128340, 0, 0, 0, 2107, 0, 129048, 0, 0, 0, 43868, 129832,
+ 129817, 0, 128239, 0, 0, 127777, 0, 6927, 42267, 42261, 11464, 3365, 0,
+ 0, 0, 0, 0, 41869, 0, 0, 0, 43326, 0, 11519, 0, 5530, 5210, 0, 983989, 0,
+ 5208, 0, 128842, 0, 2424, 7976, 0, 0, 3244, 5529, 0, 73894, 128852, 5432,
+ 0, 5527, 0, 78484, 0, 5528, 0, 0, 120281, 0, 0, 43545, 120282, 0, 0,
+ 73686, 42565, 0, 0, 3206, 120278, 73985, 0, 101149, 0, 0, 211, 3216,
+ 83407, 0, 120998, 3220, 68750, 0, 118586, 8951, 5214, 0, 8118, 0, 10768,
+ 8735, 0, 5852, 124952, 0, 0, 67513, 0, 0, 2623, 127859, 0, 0, 127388,
+ 4698, 66509, 0, 0, 4701, 0, 120289, 74225, 120284, 8267, 0, 1421, 66426,
+ 0, 0, 2625, 92724, 0, 74309, 0, 0, 0, 7850, 120296, 69639, 127032, 0, 0,
+ 43384, 12660, 110663, 0, 0, 110706, 110661, 0, 92380, 0, 0, 69649, 0,
+ 713, 41073, 0, 3990, 0, 0, 0, 5017, 128313, 120352, 0, 0, 1030, 0,
+ 983121, 9513, 0, 0, 0, 4668, 0, 120350, 0, 6339, 0, 0, 0, 64650, 0, 0,
+ 74766, 983869, 8908, 0, 0, 0, 0, 10752, 13003, 68769, 0, 41307, 8732,
+ 120336, 0, 41310, 0, 4696, 0, 983953, 0, 120334, 3641, 5419, 124119, 0,
+ 0, 0, 120344, 128129, 0, 7320, 65230, 11808, 0, 93970, 936, 13289, 0,
+ 69892, 65774, 0, 65243, 0, 19953, 0, 126469, 121375, 127256, 12913,
+ 70722, 68759, 0, 0, 70203, 0, 4113, 0, 2372, 1819, 0, 128053, 12152, 0,
+ 682, 7655, 120330, 129921, 0, 10593, 1703, 0, 0, 8033, 69953, 0, 9810, 0,
+ 0, 127949, 0, 119159, 10109, 0, 73898, 0, 71730, 126704, 0, 0, 917620,
+ 1965, 917621, 0, 0, 73887, 0, 0, 0, 6314, 0, 8501, 0, 0, 0, 41317, 0,
+ 5417, 983582, 0, 0, 9353, 68148, 41315, 0, 11161, 0, 41314, 194892, 0,
+ 126562, 119236, 634, 0, 0, 0, 69779, 4355, 12016, 0, 9654, 12856, 6924,
+ 7660, 0, 0, 0, 0, 0, 42692, 0, 74604, 0, 0, 0, 680, 6274, 0, 1181, 0,
+ 3174, 67248, 0, 0, 0, 0, 113776, 10650, 917603, 92295, 70672, 118965, 0,
+ 64644, 126981, 0, 0, 0, 0, 983961, 0, 65302, 40989, 68239, 68230, 68234,
+ 0, 0, 124989, 0, 40987, 4667, 0, 983963, 8828, 0, 0, 0, 4746, 0, 129840,
+ 2269, 4749, 0, 100598, 65192, 4744, 7345, 0, 242, 100595, 0, 8217, 0,
+ 68919, 0, 2245, 0, 0, 66790, 10850, 0, 0, 0, 983391, 0, 129853, 64680, 0,
+ 0, 120562, 0, 127324, 0, 100551, 128721, 0, 7316, 0, 983610, 100552,
+ 74157, 1646, 0, 0, 73995, 120857, 73500, 0, 7350, 0, 0, 0, 9099, 4107,
+ 3441, 0, 2975, 194701, 0, 983966, 55220, 10084, 73943, 120845, 118649, 0,
+ 0, 3399, 0, 0, 11909, 0, 0, 7687, 0, 6789, 0, 0, 72739, 71367, 0, 0,
+ 92589, 9151, 1137, 0, 749, 7505, 125076, 5385, 0, 69387, 0, 0, 41298, 0,
+ 69461, 0, 0, 0, 0, 0, 0, 128455, 0, 519, 0, 64547, 5766, 0, 0, 0, 8848,
+ 0, 41297, 0, 0, 0, 41300, 74468, 65160, 0, 129839, 127511, 0, 0, 6558, 0,
+ 0, 128686, 92775, 0, 71450, 41302, 127927, 0, 0, 128646, 68762, 11729,
+ 8719, 9060, 0, 128796, 0, 0, 118573, 129682, 0, 11734, 93011, 11730,
+ 73450, 9593, 5757, 2403, 0, 55275, 0, 11728, 65894, 0, 0, 0, 68741, 0, 0,
+ 0, 43489, 4282, 983864, 0, 83497, 70328, 128103, 70324, 0, 69490, 127509,
+ 0, 8456, 0, 0, 74783, 0, 78250, 0, 70320, 120722, 9792, 0, 70326, 0, 0,
+ 83500, 70322, 10019, 71701, 123617, 6568, 4365, 129399, 0, 3647, 0,
+ 41134, 128341, 0, 125043, 41135, 0, 0, 0, 129938, 0, 123616, 0, 41137,
+ 41139, 0, 6545, 0, 125139, 7597, 10528, 75054, 0, 3732, 73910, 0, 0, 0,
+ 7312, 983639, 9062, 93840, 11853, 0, 0, 128324, 41538, 0, 0, 118702, 0,
+ 194706, 41531, 1263, 3720, 0, 68028, 0, 41524, 64692, 119635, 0, 41534,
+ 0, 92193, 0, 41168, 0, 67398, 127347, 3524, 0, 8831, 127349, 127357, 0,
+ 127360, 127352, 129816, 0, 0, 0, 0, 0, 5845, 0, 0, 0, 71909, 8200, 0,
+ 68460, 0, 43283, 5551, 0, 0, 0, 6340, 983552, 100602, 0, 0, 0, 0, 0,
+ 5422, 0, 0, 0, 2471, 0, 0, 2749, 0, 73774, 10913, 72122, 0, 8666, 675,
+ 74093, 0, 194986, 0, 69262, 0, 0, 0, 10928, 0, 41153, 0, 0, 0, 3738, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42347, 12092, 9615, 7234, 74047,
+ 129782, 0, 0, 123639, 0, 0, 2934, 0, 0, 0, 0, 74507, 0, 74461, 0, 0,
+ 74290, 0, 64562, 129975, 64473, 0, 0, 73728, 0, 11212, 0, 12128, 6534, 0,
+ 0, 1901, 0, 0, 0, 0, 0, 127520, 0, 0, 0, 0, 69940, 65459, 68293, 92290,
+ 128808, 3770, 0, 0, 0, 64579, 128511, 0, 0, 983337, 983345, 0, 0, 0,
+ 5941, 0, 0, 65079, 0, 0, 0, 73961, 983339, 0, 0, 0, 0, 0, 0, 10638, 0, 0,
+ 0, 71486, 0, 0, 983354, 0, 43840, 129495, 0, 5233, 983351, 64792, 71233,
+ 0, 983329, 0, 73553, 9847, 0, 1685, 595, 0, 73971, 1292, 8940, 0, 11088,
+ 0, 10004, 0, 0, 6541, 0, 0, 0, 5603, 9014, 5606, 0, 538, 128705, 5602,
+ 8467, 74391, 6547, 0, 0, 0, 0, 8458, 129534, 8495, 0, 0, 917552, 10981,
+ 78314, 125057, 2465, 0, 0, 0, 9730, 9280, 0, 0, 74155, 72766, 113690, 0,
+ 504, 0, 120715, 0, 983606, 0, 0, 0, 123141, 125024, 0, 0, 732, 3737, 0,
+ 1548, 0, 0, 1832, 5604, 0, 41141, 0, 5607, 72854, 2176, 3745, 0, 0,
+ 128137, 0, 0, 3869, 11937, 5725, 0, 66566, 7416, 5728, 0, 0, 0, 11918,
+ 66567, 5724, 118829, 5727, 0, 0, 0, 5723, 118585, 128116, 71999, 0, 0, 0,
+ 42532, 0, 12303, 0, 11423, 0, 983116, 68303, 74074, 0, 128267, 6559,
+ 64557, 71348, 0, 66763, 43019, 0, 10238, 0, 0, 43377, 0, 71346, 124937,
+ 9783, 42704, 0, 71719, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41144, 129465, 0,
+ 0, 0, 72793, 92176, 0, 70682, 0, 8820, 0, 0, 0, 11515, 526, 0, 0, 0, 0,
+ 0, 0, 8635, 0, 0, 8288, 11815, 0, 0, 0, 1543, 3713, 0, 0, 0, 68041,
+ 127816, 0, 0, 64357, 0, 42082, 0, 0, 8987, 42081, 0, 0, 0, 0, 0, 0, 6553,
+ 0, 0, 11253, 0, 0, 5475, 0, 0, 0, 119334, 12990, 1160, 42084, 0, 123152,
+ 0, 0, 360, 0, 0, 128274, 5863, 3137, 0, 983320, 0, 0, 10959, 3146, 0,
+ 127374, 0, 68341, 13076, 3135, 983303, 0, 0, 3142, 0, 94068, 10819,
+ 128479, 0, 74635, 12877, 119867, 73967, 0, 70808, 0, 0, 0, 0, 6163,
+ 129745, 113728, 0, 0, 0, 8603, 0, 0, 3306, 0, 43392, 0, 917565, 5751, 0,
+ 0, 0, 0, 0, 7403, 0, 118933, 0, 122628, 64783, 92658, 0, 0, 129592, 0, 0,
+ 65569, 7021, 0, 0, 119864, 0, 0, 6540, 6974, 0, 0, 0, 0, 0, 0, 0, 983655,
+ 0, 43585, 0, 6551, 983993, 0, 0, 0, 0, 0, 72216, 8977, 602, 120814, 0, 0,
+ 0, 72119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983624, 74812, 0, 0, 0, 9475, 0,
+ 65105, 0, 118556, 0, 43592, 7831, 66751, 0, 0, 73915, 0, 43593, 0, 43591,
+ 43061, 0, 0, 43589, 43584, 0, 13113, 0, 0, 43590, 8766, 9087, 0, 0,
+ 41574, 78337, 0, 42900, 6376, 0, 0, 0, 0, 9854, 0, 0, 0, 0, 0, 0, 0,
+ 2909, 110928, 0, 0, 6529, 110930, 75004, 3751, 0, 0, 0, 1798, 0, 0, 1354,
+ 0, 13152, 6557, 12430, 0, 94098, 0, 0, 0, 68123, 128097, 0, 0, 0, 71264,
+ 123559, 11082, 0, 65677, 8682, 42054, 92595, 42045, 9804, 0, 0, 3595, 0,
+ 0, 119498, 0, 42399, 0, 0, 0, 65541, 0, 7324, 0, 0, 0, 8797, 77895, 0,
+ 64888, 7167, 2356, 95, 110810, 0, 0, 42286, 0, 0, 69999, 0, 120877, 0, 0,
+ 42324, 129359, 0, 0, 43492, 0, 43406, 0, 0, 0, 0, 0, 43400, 0, 0, 71720,
+ 0, 66435, 0, 0, 3201, 514, 74502, 0, 43396, 0, 64493, 0, 43404, 11218, 0,
+ 0, 43398, 0, 0, 41341, 129485, 6564, 1463, 41342, 0, 5293, 0, 0, 3733, 0,
+ 0, 41344, 0, 0, 0, 0, 41346, 0, 69747, 0, 0, 0, 0, 0, 0, 0, 983764, 0, 0,
+ 0, 65272, 0, 0, 1270, 1132, 0, 0, 0, 66655, 0, 0, 74314, 64761, 0,
+ 110853, 8510, 0, 129600, 0, 0, 0, 0, 0, 0, 69692, 0, 0, 42383, 69690, 0,
+ 69700, 13141, 0, 92465, 0, 0, 0, 41566, 0, 0, 129334, 127171, 0, 0, 0, 0,
+ 0, 0, 0, 6308, 0, 0, 2611, 0, 66881, 0, 65063, 0, 0, 0, 0, 4484, 8747,
+ 110597, 128369, 0, 0, 0, 0, 0, 0, 12902, 0, 0, 7299, 0, 0, 12107, 7100,
+ 10905, 65010, 0, 125135, 66018, 9284, 0, 0, 0, 0, 0, 0, 0, 12010, 0,
+ 126093, 120949, 121032, 0, 0, 0, 0, 0, 0, 0, 0, 6618, 3562, 66365, 0,
+ 42234, 12648, 128039, 0, 0, 0, 41309, 9764, 41316, 0, 0, 13230, 41299, 0,
+ 0, 68365, 0, 0, 0, 0, 0, 0, 4153, 0, 0, 128047, 0, 0, 42889, 0, 129322,
+ 41578, 0, 41577, 0, 68092, 0, 6533, 0, 41570, 0, 72414, 0, 41580, 74628,
+ 0, 12901, 0, 0, 0, 0, 71461, 41360, 0, 0, 4743, 0, 0, 0, 0, 68398,
+ 110781, 5890, 110779, 111103, 3739, 8695, 92514, 0, 3964, 8984, 111095,
+ 68288, 0, 0, 70000, 111090, 111089, 67504, 3956, 82952, 111093, 6563,
+ 111091, 41305, 0, 0, 12067, 41312, 0, 0, 0, 129708, 0, 8175, 0, 3600, 0,
+ 934, 0, 0, 173, 129844, 0, 110784, 110785, 1750, 110783, 41358, 68368,
+ 1807, 0, 92298, 0, 5889, 0, 0, 0, 67127, 129472, 0, 121395, 6982, 1721,
+ 0, 7891, 0, 42160, 67129, 4512, 983790, 69460, 0, 0, 0, 122636, 0,
+ 120716, 0, 0, 0, 0, 0, 119140, 3975, 72253, 74087, 0, 12672, 0, 129821,
+ 0, 0, 129836, 0, 121100, 0, 0, 41095, 3962, 68242, 2932, 41101, 3954,
+ 6457, 4513, 0, 0, 0, 0, 1468, 0, 0, 55237, 128230, 0, 127244, 55238,
+ 41080, 0, 0, 4320, 74104, 0, 0, 83315, 0, 77918, 118563, 128384, 8256, 0,
+ 72413, 0, 8879, 0, 0, 8770, 0, 0, 92214, 0, 0, 128786, 4283, 129689, 0,
+ 68361, 0, 74826, 0, 0, 0, 0, 127954, 65106, 42761, 121516, 4581, 8411, 0,
+ 0, 72259, 0, 93037, 0, 0, 0, 92452, 4392, 0, 10786, 69661, 0, 8184, 0, 0,
+ 7396, 0, 0, 69788, 0, 43512, 7965, 111039, 111038, 111037, 111036, 41350,
+ 0, 0, 0, 2294, 64501, 68034, 0, 68405, 111034, 0, 0, 111030, 111029,
+ 71105, 111027, 0, 111033, 92200, 111031, 0, 6764, 0, 0, 111026, 111025,
+ 72454, 65203, 128010, 0, 0, 0, 3210, 0, 129978, 0, 0, 82958, 127970,
+ 82957, 0, 68875, 10043, 71979, 1186, 41571, 0, 5209, 9464, 82960, 66657,
+ 5207, 65062, 5213, 0, 0, 41348, 41568, 128803, 3253, 111045, 111044,
+ 74067, 111042, 111049, 5596, 111047, 111046, 0, 64887, 0, 5217, 111041,
+ 72252, 0, 0, 0, 0, 2635, 92760, 0, 0, 0, 92742, 0, 113672, 0, 0, 0, 2258,
+ 67081, 0, 67083, 0, 0, 0, 5784, 0, 0, 0, 0, 4011, 0, 0, 0, 0, 4254, 0,
+ 111054, 5600, 111052, 111051, 10447, 5598, 1207, 111055, 0, 3501, 42582,
+ 0, 111050, 0, 1124, 5597, 983501, 78908, 9321, 129464, 75040, 983498, 0,
+ 1719, 68356, 68354, 9671, 1125, 2721, 0, 129876, 983504, 7631, 5488,
+ 111082, 0, 0, 5491, 111086, 8937, 0, 3236, 74187, 5490, 0, 5489, 8522,
+ 68358, 111069, 6300, 111067, 111066, 0, 0, 111071, 111070, 0, 9875, 7593,
+ 111065, 0, 0, 43182, 0, 68379, 3311, 111058, 111057, 3746, 11016, 65752,
+ 111061, 0, 43423, 68775, 0, 111056, 72225, 0, 0, 127120, 0, 2232, 0, 0,
+ 0, 0, 0, 126555, 0, 0, 8656, 0, 128358, 0, 0, 983490, 983491, 917563,
+ 983489, 983486, 983487, 0, 0, 0, 129669, 0, 111183, 128043, 983495, 1036,
+ 983493, 111075, 1723, 111073, 111072, 111079, 41579, 111077, 111076,
+ 10705, 0, 983485, 74486, 71693, 740, 983481, 983482, 129645, 0, 0, 74846,
+ 92255, 0, 0, 0, 0, 0, 10438, 74487, 73798, 13285, 0, 0, 0, 5690, 0,
+ 93992, 0, 0, 13095, 0, 127857, 121419, 7321, 121203, 13254, 70176, 75070,
+ 0, 0, 0, 0, 127845, 3247, 317, 0, 0, 0, 0, 917543, 0, 10173, 0, 0, 0, 0,
+ 0, 5223, 0, 0, 119564, 5226, 0, 94044, 5880, 94065, 7758, 0, 0, 5224,
+ 5487, 94041, 5692, 41725, 983467, 0, 5695, 41711, 0, 43171, 0, 94049,
+ 5691, 983472, 866, 1488, 983471, 983457, 65665, 94036, 983456, 74797, 0,
+ 0, 11039, 983465, 11145, 71211, 983464, 983461, 983462, 983459, 983460,
+ 42492, 43402, 125208, 3302, 0, 72842, 43153, 0, 0, 120885, 121300, 0,
+ 7856, 8690, 0, 73076, 110880, 0, 0, 73091, 0, 69925, 120635, 65153, 0, 0,
+ 0, 0, 0, 0, 4540, 0, 0, 0, 0, 11844, 121209, 8863, 0, 75061, 71978, 6389,
+ 0, 42371, 83205, 8790, 120911, 0, 111125, 71168, 8869, 0, 0, 42060, 0,
+ 9648, 111123, 71170, 10270, 10286, 10318, 10382, 43529, 0, 0, 0, 0, 0,
+ 70110, 43835, 119520, 70111, 119360, 118815, 127084, 127083, 8767, 0,
+ 128437, 41281, 0, 5201, 0, 6215, 67072, 6214, 13101, 0, 0, 65268, 67073,
+ 0, 0, 127976, 72995, 127073, 10511, 42075, 0, 73475, 129509, 0, 67115,
+ 127069, 111293, 127068, 0, 127067, 0, 74845, 0, 42071, 43156, 0, 0, 0, 0,
+ 7954, 0, 0, 0, 8485, 4671, 0, 69513, 4740, 0, 0, 42618, 78294, 3064,
+ 6212, 0, 0, 0, 9554, 0, 83044, 0, 126598, 0, 78291, 6159, 6213, 12885, 0,
+ 129086, 64720, 0, 983926, 0, 0, 0, 11430, 0, 7518, 9317, 0, 3729, 10406,
+ 0, 119259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73825, 0, 0, 129599, 8786, 10390,
+ 0, 0, 917601, 93034, 0, 7924, 0, 43307, 0, 0, 0, 0, 0, 0, 118843, 9623,
+ 435, 0, 0, 12893, 8093, 9079, 0, 0, 0, 0, 0, 64430, 0, 10294, 10326, 0,
+ 0, 0, 0, 0, 0, 3623, 125188, 83378, 0, 43197, 0, 111149, 0, 78296, 0, 0,
+ 0, 7914, 0, 69749, 0, 2624, 0, 0, 0, 120859, 67110, 11058, 0, 67107, 0,
+ 0, 0, 0, 120793, 0, 0, 6717, 10619, 0, 0, 0, 11832, 128664, 0, 0, 0,
+ 70202, 0, 0, 0, 3232, 73824, 74581, 0, 0, 0, 41889, 0, 0, 1161, 41895,
+ 74103, 9701, 0, 0, 129385, 73819, 120588, 5012, 0, 41362, 0, 68507, 0, 0,
+ 0, 0, 0, 41364, 0, 0, 41352, 41361, 0, 41366, 0, 70129, 129065, 917, 0,
+ 119934, 119923, 92421, 119912, 0, 119924, 64841, 118582, 71482, 0, 0, 0,
+ 125136, 128583, 0, 7022, 0, 4739, 0, 5802, 9816, 8615, 0, 0, 491, 65837,
+ 0, 0, 128644, 0, 8426, 11092, 9891, 0, 0, 0, 41881, 118823, 3736, 7394,
+ 42648, 0, 68448, 9095, 7741, 12684, 41885, 0, 0, 0, 0, 5815, 0, 0, 0,
+ 127392, 0, 0, 41878, 0, 0, 0, 0, 0, 0, 0, 0, 119503, 0, 120804, 0, 0,
+ 2267, 0, 78289, 78359, 78288, 0, 0, 78318, 65920, 0, 194819, 7057, 9408,
+ 9409, 9410, 9411, 9412, 9413, 9414, 9415, 9416, 9417, 9418, 9419, 9420,
+ 9421, 5897, 9423, 917933, 127107, 0, 127108, 917937, 127963, 8955, 9399,
+ 9400, 9401, 9402, 9403, 9404, 9405, 9406, 9407, 0, 128626, 42669, 73832,
+ 78261, 67683, 2631, 119308, 78259, 0, 78260, 3996, 0, 119307, 0, 0, 0, 0,
+ 0, 0, 64825, 917916, 917913, 917914, 917919, 5899, 917917, 129990, 12085,
+ 0, 574, 69734, 77825, 73828, 9473, 77824, 118918, 73900, 41735, 42211, 0,
+ 4190, 77834, 77835, 77830, 77833, 3616, 77828, 77837, 77838, 7708, 77836,
+ 2228, 113765, 0, 0, 4191, 42968, 77844, 73800, 77842, 77843, 77839,
+ 77840, 0, 78311, 83375, 0, 0, 10415, 74102, 0, 5896, 0, 10351, 67151, 0,
+ 73829, 0, 127159, 0, 73998, 41355, 42883, 70736, 71212, 8021, 0, 119150,
+ 983732, 41357, 8011, 42885, 42887, 41354, 0, 0, 10026, 5472, 120554,
+ 1191, 101217, 5470, 128784, 5476, 101216, 0, 0, 0, 42874, 78281, 42876,
+ 6304, 78283, 0, 2675, 120690, 0, 0, 128954, 0, 0, 5478, 5904, 0, 0, 0,
+ 7291, 77848, 43761, 13067, 0, 0, 119271, 120360, 69731, 77856, 77857,
+ 77854, 77855, 77852, 77853, 77850, 10750, 43714, 77858, 0, 0, 0, 12887,
+ 120364, 127745, 77866, 77867, 77864, 77865, 9929, 5199, 77859, 1120, 0,
+ 0, 0, 9486, 7554, 0, 77868, 72832, 0, 0, 5894, 70069, 0, 0, 92511, 70358,
+ 1323, 13162, 120937, 0, 0, 0, 77881, 66022, 0, 72857, 0, 0, 0, 0, 0,
+ 1142, 0, 8271, 0, 0, 126645, 12903, 43622, 4002, 0, 10442, 10676, 120368,
+ 0, 120369, 0, 0, 0, 0, 66642, 1277, 0, 7871, 0, 0, 78853, 0, 119015, 0,
+ 0, 11784, 0, 78012, 4700, 0, 78858, 0, 78855, 0, 0, 92400, 77879, 19932,
+ 77876, 77877, 74804, 77874, 77869, 77871, 0, 71487, 43118, 0, 0, 6774,
+ 6773, 0, 194684, 10346, 10410, 78860, 118974, 0, 101197, 6108, 0, 110612,
+ 0, 0, 5901, 121309, 74166, 124973, 0, 0, 0, 69407, 0, 70357, 0, 0, 74217,
+ 0, 64698, 4192, 9289, 0, 0, 128847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11603, 0,
+ 0, 101166, 82976, 0, 0, 67812, 0, 101163, 0, 42572, 0, 128300, 119146,
+ 1963, 11622, 0, 43237, 82981, 7550, 67100, 5903, 82984, 78009, 129750,
+ 9662, 0, 128391, 0, 0, 0, 0, 11013, 0, 0, 0, 128433, 67090, 0, 0, 0, 0,
+ 0, 11568, 983704, 43367, 0, 0, 7852, 119496, 0, 0, 0, 0, 194676, 0,
+ 194675, 0, 0, 416, 129668, 0, 73834, 0, 68921, 10984, 0, 0, 101175,
+ 129838, 101182, 0, 127013, 92423, 0, 983261, 121199, 0, 0, 12540, 0,
+ 983220, 0, 0, 11445, 101168, 2112, 0, 0, 0, 1021, 0, 9507, 10210, 78005,
+ 8023, 93963, 78006, 78001, 43181, 78003, 9532, 119094, 0, 0, 0, 0, 0,
+ 1885, 43268, 129802, 129798, 120542, 121153, 392, 7894, 4391, 129810,
+ 8221, 119597, 77999, 77998, 0, 0, 0, 92967, 0, 3558, 0, 3913, 70429,
+ 121376, 0, 0, 1265, 0, 6309, 0, 12969, 0, 101151, 0, 101146, 0, 101139,
+ 0, 41864, 0, 0, 74294, 0, 167, 0, 917584, 0, 93983, 72354, 68477, 0, 0,
+ 917594, 0, 2493, 129827, 0, 129804, 0, 917570, 917593, 0, 0, 406, 917592,
+ 0, 0, 0, 0, 0, 0, 0, 127161, 0, 128597, 0, 0, 0, 3421, 10561, 0, 8365,
+ 917581, 0, 127569, 120787, 128669, 0, 0, 0, 0, 7834, 0, 0, 101154, 10298,
+ 6624, 4908, 0, 1639, 120842, 0, 0, 6327, 6724, 0, 0, 0, 69910, 4817, 0,
+ 0, 0, 68059, 0, 11022, 0, 0, 0, 118888, 0, 0, 7548, 64794, 0, 12291,
+ 983166, 0, 0, 0, 0, 0, 0, 1134, 1838, 0, 2057, 0, 0, 0, 0, 0, 0, 5206, 0,
+ 0, 42523, 0, 0, 0, 0, 65550, 8570, 4816, 0, 127926, 0, 4821, 0, 0, 0,
+ 4818, 125257, 119974, 119977, 0, 0, 119970, 119973, 0, 119983, 119982,
+ 67470, 119984, 119979, 119978, 0, 119980, 119670, 129297, 0, 11284,
+ 119987, 70097, 65155, 119988, 0, 9363, 0, 0, 0, 5900, 93990, 7889, 2722,
+ 128770, 0, 0, 0, 0, 2282, 0, 0, 0, 68093, 0, 0, 0, 0, 0, 70150, 118628,
+ 0, 0, 0, 129651, 70146, 983079, 119967, 71330, 70148, 0, 0, 94006, 70144,
+ 119964, 110677, 110678, 110675, 110676, 0, 110674, 4226, 0, 123165, 5732,
+ 71327, 0, 0, 65119, 0, 0, 92971, 64770, 0, 0, 6093, 0, 0, 1395, 0, 0, 0,
+ 121179, 786, 0, 43174, 64340, 0, 125269, 0, 983662, 125138, 10132, 0, 0,
+ 0, 0, 0, 93956, 0, 68444, 0, 92437, 123143, 0, 0, 92656, 0, 0, 0, 1399,
+ 121463, 0, 121465, 121464, 120808, 241, 121469, 4907, 0, 0, 0, 0, 0, 0,
+ 0, 0, 127904, 0, 0, 42780, 0, 0, 0, 4217, 0, 0, 0, 0, 72158, 0, 0, 43099,
+ 3965, 0, 0, 0, 13300, 0, 0, 43057, 0, 0, 0, 0, 0, 65372, 0, 6410, 126073,
+ 125252, 70468, 0, 0, 0, 119558, 0, 0, 0, 0, 0, 0, 43188, 2626, 7762, 0,
+ 0, 0, 127183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67726, 0, 126993, 1542, 0, 0,
+ 92550, 0, 0, 74311, 0, 0, 10181, 2150, 0, 0, 0, 0, 124921, 68053, 6029,
+ 72852, 0, 0, 0, 0, 8993, 0, 0, 0, 93968, 606, 118664, 0, 0, 0, 4311, 0,
+ 6027, 126615, 4322, 0, 65207, 0, 2184, 983920, 0, 0, 2735, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 70806, 0, 73547, 0, 92783, 92844, 0, 65817, 55288,
+ 127934, 66564, 8530, 0, 7709, 0, 121202, 66560, 128528, 917595, 12876,
+ 66561, 0, 121430, 983957, 7789, 5855, 809, 0, 0, 72853, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 64386, 0, 74909, 64845, 120607, 66416, 83360, 6532, 0, 0,
+ 0, 0, 128224, 0, 0, 0, 0, 43091, 92287, 0, 0, 129312, 0, 0, 0, 11361, 0,
+ 0, 8153, 128105, 0, 10741, 0, 0, 0, 0, 0, 64706, 917922, 0, 69505, 78870,
+ 9466, 78866, 9824, 0, 0, 0, 120977, 915, 0, 0, 43865, 0, 0, 0, 67131,
+ 70096, 67137, 0, 129614, 73648, 6730, 78862, 68161, 0, 78861, 126542, 0,
+ 0, 94010, 118655, 0, 0, 66043, 0, 0, 43107, 0, 0, 92343, 0, 73879, 0, 0,
+ 0, 6103, 0, 0, 92470, 0, 12889, 0, 127137, 0, 0, 0, 0, 0, 0, 119262,
+ 83028, 0, 0, 0, 69279, 0, 0, 0, 13118, 7700, 917537, 9690, 0, 0, 68080,
+ 512, 0, 72792, 0, 0, 77892, 632, 77890, 77891, 42529, 0, 0, 0, 0, 0, 0,
+ 0, 128273, 0, 0, 7379, 64581, 5386, 0, 0, 10633, 72316, 64488, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 124956, 71307, 0, 0, 0, 0, 0, 92370, 0, 0, 0, 0, 0,
+ 71314, 1801, 0, 0, 120867, 0, 0, 77888, 2085, 702, 77887, 77884, 77885,
+ 13074, 77883, 66299, 0, 0, 12106, 78905, 0, 1755, 0, 77897, 77898, 1163,
+ 3102, 77893, 77894, 0, 0, 0, 0, 69227, 0, 77901, 77902, 77899, 77900,
+ 65171, 0, 0, 0, 70157, 0, 0, 0, 64846, 2908, 0, 11177, 64902, 64950, 0,
+ 128740, 66906, 124959, 70499, 0, 0, 0, 64352, 0, 125031, 1007, 0, 9199,
+ 0, 127371, 118992, 41890, 0, 2730, 119072, 0, 5428, 0, 73771, 129993, 0,
+ 0, 0, 71458, 0, 0, 0, 68089, 0, 44012, 0, 71456, 0, 9158, 66878, 69905,
+ 92440, 0, 101272, 0, 484, 0, 0, 0, 194742, 0, 0, 0, 0, 572, 7041, 2736,
+ 0, 0, 93962, 0, 68628, 0, 128727, 5438, 5222, 5381, 43114, 0, 5193, 5125,
+ 5456, 5509, 0, 120664, 113700, 0, 0, 0, 3430, 0, 42905, 0, 74929, 6050,
+ 0, 0, 129197, 0, 0, 10908, 0, 0, 127809, 64617, 0, 0, 3957, 0, 0, 0, 674,
+ 0, 0, 2946, 5354, 5251, 5328, 5307, 3759, 72318, 8364, 5123, 0, 5281,
+ 5469, 5121, 0, 0, 0, 5130, 0, 129608, 0, 0, 0, 1221, 2733, 0, 0, 0,
+ 72321, 127245, 0, 0, 0, 101277, 0, 5939, 0, 0, 0, 71867, 68400, 128216,
+ 10321, 10289, 0, 10385, 123164, 0, 0, 0, 0, 118943, 0, 11411, 0, 5938, 0,
+ 120865, 0, 0, 10401, 10337, 0, 0, 0, 0, 0, 0, 0, 71942, 0, 0, 12165, 0,
+ 0, 9885, 0, 8077, 0, 127908, 0, 0, 0, 0, 129138, 4220, 10725, 10433, 0,
+ 68395, 4987, 64519, 0, 0, 0, 123626, 120356, 0, 11733, 0, 120792, 0,
+ 127233, 0, 0, 0, 92345, 68254, 983661, 77991, 0, 2724, 0, 0, 12313,
+ 110619, 515, 119947, 119944, 119945, 119942, 119943, 119940, 119941,
+ 119938, 8606, 4046, 4589, 4521, 0, 9141, 0, 0, 2741, 0, 0, 1370, 0, 0, 0,
+ 0, 0, 0, 66880, 0, 66003, 0, 64440, 0, 129943, 69458, 0, 11593, 68669,
+ 68666, 68660, 0, 0, 2744, 72285, 68638, 0, 814, 0, 119962, 119963,
+ 119960, 119961, 101106, 43029, 119956, 11623, 119954, 11955, 119952,
+ 119953, 41986, 119951, 0, 120497, 4847, 110975, 0, 0, 0, 0, 1581, 64920,
+ 93830, 12954, 963, 110973, 110972, 110971, 110969, 5278, 110967, 68621,
+ 92222, 983454, 68625, 983452, 68617, 110960, 0, 101459, 101487, 110964,
+ 110963, 110962, 0, 0, 101464, 101483, 101463, 983443, 983440, 92648,
+ 127379, 0, 65137, 6483, 65392, 0, 4213, 129649, 41303, 0, 0, 0, 41306,
+ 129751, 2698, 0, 0, 0, 68396, 0, 41304, 824, 0, 78011, 72315, 78894,
+ 74827, 78892, 64804, 9820, 119820, 110985, 110976, 0, 6739, 0, 5481,
+ 3490, 110978, 110977, 71706, 69947, 67702, 9124, 12688, 119833, 101496,
+ 0, 101495, 119821, 119824, 67480, 42575, 101474, 101478, 119827, 101481,
+ 101476, 71087, 68658, 119946, 8025, 68630, 101490, 68675, 92445, 71097,
+ 69613, 0, 0, 0, 0, 983435, 2745, 11797, 110990, 983431, 9202, 983429,
+ 983430, 0, 0, 0, 10525, 5436, 74584, 110987, 110986, 121506, 43080,
+ 121508, 121507, 983420, 6246, 119958, 10921, 9723, 6777, 6776, 6775, 0,
+ 0, 70287, 92384, 0, 8669, 0, 0, 65093, 0, 78881, 2716, 0, 0, 11252,
+ 101475, 68369, 0, 11060, 12985, 2711, 78872, 78027, 78026, 7992, 0, 0,
+ 42938, 78033, 78032, 78877, 70724, 78029, 78028, 78031, 78030, 64535,
+ 110998, 10130, 110996, 0, 0, 111001, 111000, 127914, 983417, 78014, 5713,
+ 110995, 7570, 110993, 110992, 0, 11190, 129700, 9026, 0, 74864, 7547,
+ 78891, 0, 10008, 10222, 0, 129543, 9744, 0, 68809, 983413, 119656,
+ 983411, 94070, 983409, 983410, 983407, 9045, 78888, 4225, 78886, 78887,
+ 68757, 78885, 78882, 78883, 983402, 983403, 8405, 983401, 10423, 10359,
+ 983396, 983397, 0, 129149, 4215, 9789, 0, 4321, 12309, 983405, 41313, 0,
+ 5368, 66886, 0, 0, 5366, 0, 5372, 101482, 67512, 0, 7720, 7390, 2696, 0,
+ 0, 8268, 0, 1790, 0, 0, 118977, 0, 0, 0, 5376, 1835, 72313, 78704,
+ 128089, 0, 0, 68655, 1180, 0, 0, 0, 0, 119274, 0, 0, 9122, 118584, 11928,
+ 0, 65283, 0, 101449, 5971, 101448, 43500, 1268, 65097, 983222, 0, 101445,
+ 0, 1427, 128440, 0, 5970, 3431, 72299, 101439, 101435, 983389, 983390,
+ 983387, 2738, 125066, 10455, 0, 74026, 0, 4222, 6240, 0, 119013, 983394,
+ 68377, 6248, 983378, 67815, 983376, 917907, 92582, 0, 101453, 125215, 0,
+ 2728, 65549, 64563, 101428, 101425, 101429, 128145, 0, 10713, 7166,
+ 119559, 2622, 101450, 0, 0, 0, 8954, 0, 94008, 2632, 42617, 10108, 1011,
+ 42852, 12080, 2709, 0, 5716, 0, 0, 0, 0, 127100, 69378, 0, 9515, 127098,
+ 66465, 6451, 0, 127097, 8918, 983556, 0, 0, 19950, 0, 0, 0, 44003, 0,
+ 64735, 0, 0, 0, 0, 983500, 74022, 0, 128795, 68643, 67410, 0, 5721, 0, 0,
+ 0, 121074, 11267, 983369, 66464, 5720, 983368, 0, 4219, 5718, 8696, 5717,
+ 122651, 983375, 983897, 983373, 541, 983371, 983372, 119948, 119089,
+ 68389, 983357, 119949, 56, 4216, 10577, 0, 0, 77849, 69620, 983362,
+ 983363, 66899, 983361, 0, 0, 67628, 0, 0, 7086, 0, 67998, 67621, 0, 2734,
+ 69616, 0, 67627, 118937, 0, 67625, 0, 0, 0, 42593, 0, 128217, 0, 0,
+ 119939, 0, 68180, 0, 0, 71104, 7442, 43665, 359, 41253, 68392, 6239,
+ 120599, 41256, 0, 67740, 111023, 111022, 111021, 9346, 69660, 41254, 0,
+ 43291, 78002, 0, 67491, 124993, 93841, 0, 0, 0, 4368, 983505, 0, 68137,
+ 0, 0, 41024, 0, 0, 121359, 121420, 0, 0, 0, 4223, 0, 8574, 83502, 0, 0,
+ 0, 118576, 0, 92718, 983636, 70432, 128323, 68382, 0, 0, 0, 0, 0, 4144,
+ 0, 83193, 6245, 0, 2732, 92644, 0, 0, 64558, 83501, 0, 0, 0, 128005, 0,
+ 0, 129652, 983149, 3097, 0, 0, 77996, 0, 0, 10863, 111020, 111019,
+ 111018, 0, 111015, 111014, 111013, 111012, 118964, 0, 10216, 64293, 0, 0,
+ 69393, 128331, 12325, 111010, 8717, 111008, 101413, 0, 101380, 0, 8700,
+ 0, 101382, 68363, 10426, 0, 71091, 10362, 0, 1715, 101378, 0, 64918,
+ 101409, 43278, 42635, 0, 0, 65275, 0, 0, 101319, 0, 69746, 1607, 466,
+ 118949, 0, 0, 127918, 6243, 983901, 1350, 74195, 64420, 1993, 5362,
+ 10666, 2708, 92471, 0, 13143, 234, 3199, 0, 41268, 6334, 2173, 0, 0,
+ 73750, 0, 73762, 10458, 0, 8576, 127136, 0, 2704, 64953, 0, 64832, 8322,
+ 0, 3132, 0, 2694, 0, 0, 2439, 65104, 69804, 0, 303, 74625, 92622, 0,
+ 2437, 0, 9817, 4844, 0, 0, 0, 0, 0, 121120, 43292, 0, 2441, 0, 0, 0, 0,
+ 0, 2451, 2714, 0, 0, 43379, 127984, 74541, 753, 5849, 0, 43089, 0, 0,
+ 119534, 72380, 0, 0, 0, 2726, 3107, 0, 0, 64937, 0, 78841, 1408, 0, 4607,
+ 101299, 181, 0, 67728, 9539, 0, 0, 65201, 121121, 92973, 64185, 4142,
+ 64183, 0, 0, 0, 9706, 64178, 64177, 64176, 0, 64182, 64181, 64180, 64179,
+ 11401, 125124, 0, 1822, 0, 128581, 68055, 3865, 122918, 0, 10500, 129602,
+ 119024, 0, 110732, 9830, 0, 0, 0, 65131, 0, 0, 0, 0, 74608, 7038, 0,
+ 9599, 8748, 0, 0, 9557, 0, 0, 0, 11494, 0, 0, 10865, 0, 43279, 64186,
+ 68521, 0, 64191, 64190, 8898, 64188, 129153, 41030, 78836, 0, 0, 78820,
+ 126100, 0, 78805, 78806, 78801, 78802, 6745, 78800, 0, 0, 0, 110866, 0,
+ 0, 73679, 67838, 41039, 78809, 128162, 0, 129893, 0, 110869, 127045,
+ 110867, 110868, 127039, 4400, 0, 64207, 10275, 8925, 10371, 10307, 64202,
+ 4248, 0, 72802, 4541, 6299, 64204, 64203, 64201, 64200, 64199, 64198,
+ 126471, 0, 0, 0, 64193, 64192, 0, 9943, 64197, 64196, 64195, 64194,
+ 13282, 42652, 64174, 64173, 83495, 846, 72337, 9965, 74495, 72330, 83493,
+ 83494, 2543, 12163, 64170, 83490, 64167, 64166, 64165, 64164, 72333, 0,
+ 64169, 64168, 64949, 0, 10251, 10247, 64163, 64162, 2295, 43299, 43301,
+ 129363, 0, 70791, 0, 0, 550, 9910, 0, 0, 66579, 0, 0, 0, 9504, 0, 0,
+ 10373, 0, 0, 10261, 10253, 7821, 10277, 0, 74823, 1552, 0, 0, 129389, 0,
+ 121435, 19910, 0, 0, 118849, 121150, 0, 43985, 68051, 0, 69890, 121329,
+ 78355, 983776, 0, 66405, 2431, 3744, 66852, 1809, 0, 0, 0, 73759, 1264,
+ 0, 78676, 11697, 121278, 9785, 64716, 0, 0, 0, 0, 121307, 0, 0, 42609,
+ 128388, 0, 66912, 127016, 0, 983904, 74229, 118590, 6487, 93798, 70743,
+ 0, 0, 0, 83484, 83485, 83486, 83487, 83480, 8355, 7854, 83483, 954,
+ 64927, 0, 41045, 0, 41438, 0, 0, 10711, 0, 0, 0, 0, 64774, 13309, 10947,
+ 66727, 101426, 0, 0, 66795, 0, 0, 0, 0, 0, 0, 0, 120634, 69228, 0, 0, 0,
+ 0, 101430, 0, 3060, 83478, 9986, 0, 83473, 83474, 11698, 77880, 83469,
+ 9916, 11701, 83472, 42586, 0, 8320, 0, 119095, 0, 0, 1477, 43289, 0,
+ 74358, 10884, 69446, 9908, 0, 0, 0, 3414, 74304, 0, 0, 0, 0, 2110, 0,
+ 68306, 0, 74532, 0, 129865, 0, 0, 7164, 0, 0, 0, 11950, 5392, 42248,
+ 65129, 68656, 5397, 129579, 0, 68136, 0, 0, 5395, 72870, 5393, 354,
+ 68615, 0, 0, 0, 0, 0, 126236, 0, 0, 626, 0, 5895, 0, 0, 5780, 0, 66407,
+ 10220, 0, 71121, 43297, 0, 0, 11468, 64436, 0, 0, 0, 73818, 3918, 0,
+ 3797, 72786, 122961, 0, 4140, 0, 71254, 0, 9030, 813, 0, 68131, 4146,
+ 119957, 5360, 0, 129498, 0, 0, 6249, 0, 0, 0, 0, 0, 73092, 0, 4911, 988,
+ 0, 73125, 0, 42948, 0, 0, 0, 0, 74972, 0, 0, 0, 9825, 0, 0, 12803,
+ 126977, 11032, 67654, 6244, 0, 0, 68662, 0, 129351, 0, 72131, 4169, 0, 0,
+ 0, 129986, 121410, 120657, 0, 0, 68657, 128943, 78496, 0, 0, 5898, 74540,
+ 0, 41856, 93056, 194926, 118538, 127373, 83424, 83425, 83426, 73736,
+ 83420, 68870, 6448, 6835, 0, 4831, 83418, 83419, 67731, 0, 0, 0, 0, 0, 0,
+ 0, 78499, 0, 0, 0, 43288, 122931, 0, 0, 0, 0, 43418, 0, 0, 0, 7876,
+ 68132, 917872, 0, 917870, 43378, 0, 0, 120890, 5892, 43605, 0, 0, 0,
+ 129058, 0, 0, 6251, 83409, 83410, 83411, 83412, 126512, 0, 71092, 83408,
+ 10114, 0, 0, 5387, 0, 0, 0, 0, 65553, 78346, 1747, 917849, 65109, 69240,
+ 917852, 126509, 0, 0, 0, 0, 125065, 0, 9850, 0, 367, 1472, 917859, 6687,
+ 0, 0, 5905, 12339, 8919, 73953, 65680, 0, 2204, 78664, 0, 9134, 118589,
+ 78666, 43011, 0, 126626, 0, 0, 0, 43013, 10614, 0, 0, 83413, 66646,
+ 83415, 83416, 0, 73881, 43012, 121127, 83293, 54, 43009, 73885, 0, 6211,
+ 0, 0, 83295, 68119, 43008, 10758, 0, 0, 0, 0, 0, 70018, 0, 0, 0, 0,
+ 12765, 0, 0, 0, 0, 126580, 0, 0, 43657, 0, 0, 0, 983737, 0, 83405,
+ 917843, 0, 0, 83401, 83402, 83403, 83404, 83397, 11363, 12057, 83400,
+ 1567, 0, 0, 83396, 0, 8957, 4139, 0, 0, 129336, 0, 0, 12740, 0, 92195,
+ 12761, 127793, 12759, 0, 72304, 67169, 83467, 44002, 0, 83462, 83463,
+ 83464, 12755, 12762, 41022, 67690, 64217, 476, 0, 983734, 0, 64212,
+ 41020, 1382, 64209, 64216, 64215, 64214, 64213, 0, 0, 0, 67584, 8720,
+ 3908, 0, 0, 0, 0, 101529, 129576, 0, 0, 3849, 92324, 94026, 9778, 917906,
+ 5891, 917912, 55, 917910, 917911, 0, 0, 7935, 67586, 0, 1114, 92599,
+ 67585, 78675, 0, 83447, 83449, 0, 0, 0, 64717, 0, 0, 0, 66884, 6292,
+ 65303, 0, 6452, 917886, 917887, 66249, 917885, 917890, 917891, 917888,
+ 719, 101446, 0, 917892, 0, 0, 0, 94083, 10868, 121333, 2349, 5902,
+ 917896, 6335, 101350, 917899, 917900, 0, 64369, 0, 0, 0, 69245, 0,
+ 126564, 0, 0, 128565, 0, 0, 0, 0, 0, 6454, 1229, 83457, 83458, 83450,
+ 83451, 83452, 65100, 120508, 8224, 917873, 917874, 917879, 917880,
+ 917877, 917878, 128929, 0, 917881, 917882, 5365, 67836, 8901, 0, 0,
+ 129951, 0, 69257, 5925, 83436, 64330, 128400, 83431, 83432, 83433, 83434,
+ 83427, 83428, 83429, 83430, 64928, 10543, 0, 0, 83446, 414, 0, 0, 83442,
+ 6456, 71490, 83445, 11905, 83439, 66284, 83441, 0, 68337, 0, 83437,
+ 43832, 983140, 9751, 0, 128085, 11770, 0, 0, 69600, 65061, 0, 0, 0, 0, 0,
+ 0, 121087, 0, 0, 69924, 0, 0, 0, 69913, 0, 121387, 101513, 101504,
+ 101512, 42038, 387, 0, 12737, 0, 0, 43368, 0, 0, 0, 0, 129713, 129449,
+ 121295, 0, 69400, 127309, 0, 375, 0, 0, 0, 983905, 0, 0, 119202, 119203,
+ 124117, 43120, 0, 0, 119196, 119197, 0, 4529, 119200, 119201, 119198,
+ 119199, 0, 0, 69698, 13150, 64492, 0, 0, 0, 0, 0, 42891, 66327, 74298, 0,
+ 0, 0, 2587, 42193, 0, 6455, 0, 4241, 0, 0, 0, 0, 0, 0, 0, 118821, 0, 0,
+ 0, 125030, 0, 128684, 129390, 6988, 5373, 0, 0, 119232, 10015, 0, 0, 0,
+ 68642, 0, 120855, 42040, 128827, 5779, 129841, 42037, 83282, 0, 0, 93040,
+ 83283, 101116, 0, 101117, 6983, 0, 0, 101115, 0, 0, 0, 127323, 101111, 0,
+ 119588, 0, 92495, 74558, 0, 68138, 70163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 11144, 73484, 2551, 73482, 6453, 0, 6235, 0, 0, 129081, 72886, 44020,
+ 11826, 0, 7780, 5369, 118958, 0, 0, 5367, 66870, 0, 0, 5377, 0, 68143,
+ 128624, 78245, 5218, 0, 127333, 0, 0, 129717, 0, 0, 1300, 0, 127334,
+ 64505, 0, 0, 119624, 1465, 0, 127316, 0, 0, 0, 101109, 0, 113694, 10729,
+ 0, 0, 8839, 119243, 0, 7785, 126530, 0, 0, 0, 0, 118638, 0, 0, 0, 3897,
+ 0, 92331, 74417, 113704, 0, 68127, 71425, 70688, 0, 0, 0, 0, 69287, 3542,
+ 0, 120685, 7951, 68152, 118857, 0, 92972, 0, 0, 127311, 73683, 0, 65150,
+ 68031, 0, 0, 0, 0, 9985, 0, 127328, 0, 0, 0, 0, 10830, 0, 615, 64490,
+ 7574, 0, 0, 0, 12909, 73698, 64559, 127332, 73951, 0, 67996, 2020, 0, 0,
+ 0, 120701, 0, 983640, 0, 0, 0, 92991, 0, 0, 9070, 0, 68411, 11281, 42829,
+ 0, 1033, 0, 78918, 0, 118610, 0, 65226, 0, 0, 0, 0, 0, 3450, 0, 7397, 0,
+ 0, 42778, 10000, 41088, 449, 0, 0, 68458, 113725, 0, 0, 10738, 69634, 0,
+ 0, 41085, 0, 0, 0, 12764, 0, 93058, 3596, 7322, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2092, 0, 0, 0, 121350, 10820, 0, 0, 126567, 1853, 0, 0, 93014, 0, 12770,
+ 0, 0, 124997, 0, 0, 0, 0, 0, 129053, 4828, 1258, 0, 2006, 0, 0, 74285,
+ 127987, 0, 120683, 122880, 983900, 983903, 8846, 128255, 0, 128091, 2650,
+ 9182, 1961, 121399, 11525, 0, 1959, 0, 55228, 11774, 41016, 0, 0, 128054,
+ 41017, 13109, 0, 10519, 66331, 3454, 19930, 0, 41019, 92894, 0, 0, 78362,
+ 41021, 101566, 0, 0, 0, 0, 65531, 0, 0, 0, 0, 0, 0, 8865, 6402, 113827,
+ 77923, 0, 101536, 0, 7733, 0, 4998, 68493, 0, 78930, 0, 4268, 101368, 0,
+ 0, 101555, 101579, 10881, 0, 0, 0, 0, 2014, 0, 71901, 0, 0, 195057, 0, 0,
+ 78357, 65281, 0, 0, 0, 0, 0, 2015, 0, 0, 71840, 66318, 74824, 101575, 0,
+ 101574, 101569, 0, 70061, 8094, 10135, 101551, 0, 794, 0, 0, 66335, 0,
+ 121303, 4343, 0, 4833, 0, 0, 0, 0, 189, 12611, 0, 72215, 0, 4838, 126214,
+ 4834, 65078, 2183, 126104, 4837, 118853, 0, 121230, 4832, 128271, 0,
+ 101584, 127838, 0, 0, 0, 0, 0, 118697, 0, 3976, 118995, 128937, 0, 0, 0,
+ 0, 0, 119010, 0, 121015, 0, 0, 0, 0, 2871, 0, 0, 999, 0, 68177, 0, 0,
+ 2017, 0, 67824, 0, 0, 0, 0, 0, 0, 4775, 12555, 12571, 12550, 12583,
+ 12560, 2019, 12556, 12584, 12586, 0, 12562, 12561, 12566, 12569, 12554,
+ 0, 83344, 0, 68882, 0, 12567, 1402, 0, 0, 83348, 125072, 83347, 0, 83346,
+ 0, 0, 0, 0, 64391, 0, 83341, 69602, 0, 1999, 0, 128141, 0, 0, 0, 0, 0, 0,
+ 0, 68873, 0, 0, 66913, 2377, 101090, 0, 12572, 11318, 12557, 12559, 9192,
+ 12549, 12568, 2373, 9446, 9447, 9448, 9449, 0, 9480, 481, 0, 9438, 9439,
+ 9440, 9441, 9442, 9443, 9444, 9445, 9430, 9431, 9432, 9433, 9434, 9435,
+ 9436, 9437, 983097, 0, 9424, 9425, 9426, 9427, 9428, 7481, 0, 2362, 9655,
+ 0, 2004, 0, 9782, 0, 0, 0, 0, 0, 0, 0, 1108, 0, 92461, 0, 128764, 0,
+ 64781, 0, 0, 0, 121126, 0, 1392, 0, 0, 917557, 0, 8065, 42994, 128739, 0,
+ 0, 0, 121068, 92418, 0, 0, 0, 43280, 0, 70718, 1812, 0, 73046, 0, 0, 0,
+ 0, 0, 6054, 10697, 3169, 0, 0, 70720, 11487, 70712, 0, 0, 0, 194716, 0,
+ 0, 41863, 0, 0, 2304, 0, 92326, 0, 42951, 0, 0, 64760, 11766, 0, 0, 0, 0,
+ 69236, 119171, 0, 8773, 10733, 36, 0, 0, 0, 0, 0, 11074, 0, 64910,
+ 983131, 2009, 0, 0, 128036, 68114, 128906, 0, 0, 0, 983998, 12852, 3031,
+ 0, 0, 129088, 0, 66414, 0, 0, 119950, 42613, 65933, 366, 0, 9892, 0,
+ 11754, 101107, 83329, 65301, 44013, 83058, 67245, 10102, 0, 7739, 41026,
+ 0, 0, 0, 0, 0, 0, 0, 0, 78386, 129475, 71868, 113811, 13081, 10923,
+ 129330, 0, 68145, 0, 65861, 74083, 0, 0, 128392, 83063, 83065, 0, 70706,
+ 0, 0, 0, 70168, 66586, 4183, 64967, 66250, 0, 92547, 0, 0, 113685, 0,
+ 3792, 2011, 0, 0, 77748, 83332, 77749, 120595, 0, 68489, 41023, 77747, 0,
+ 11659, 7922, 12614, 2005, 8523, 129880, 0, 7513, 1863, 129436, 83337,
+ 128969, 0, 120274, 120033, 0, 8144, 0, 73031, 77767, 127524, 120270,
+ 42241, 8783, 77764, 77765, 77766, 77760, 77761, 77762, 77763, 0, 10680,
+ 0, 43293, 68771, 0, 119164, 83320, 72003, 10187, 77742, 77743, 0, 77737,
+ 77738, 77739, 0, 10968, 43296, 119044, 0, 0, 101400, 0, 1005, 43826,
+ 120030, 0, 2870, 0, 101399, 0, 0, 983798, 0, 235, 1384, 77758, 74887,
+ 70494, 77754, 77755, 9796, 69895, 77750, 77751, 77752, 13186, 120407,
+ 120250, 0, 0, 0, 42527, 12911, 43427, 1383, 983581, 0, 0, 0, 6156, 68117,
+ 0, 7993, 4288, 0, 0, 13238, 13244, 0, 0, 120426, 13234, 120427, 0,
+ 118904, 0, 11364, 0, 1380, 65617, 120253, 120261, 13196, 13197, 120311,
+ 120419, 9495, 0, 0, 120418, 0, 73976, 128160, 0, 6941, 0, 13205, 13211,
+ 5801, 0, 74271, 120319, 0, 120302, 7670, 0, 68075, 983583, 0, 19957,
+ 72314, 2021, 93811, 43877, 0, 0, 0, 0, 3875, 120431, 64341, 0, 9814,
+ 43457, 13066, 3314, 7787, 0, 0, 0, 0, 0, 0, 64531, 129860, 0, 0, 0, 0, 0,
+ 127138, 0, 0, 9742, 0, 0, 10800, 77718, 8404, 0, 92592, 77714, 7089,
+ 77716, 78545, 0, 77712, 77713, 0, 0, 4772, 5771, 101405, 0, 9841, 8843,
+ 0, 0, 0, 129862, 120816, 0, 123137, 0, 77735, 0, 0, 0, 77731, 8849,
+ 77733, 77734, 65112, 1796, 77729, 77730, 69665, 8164, 41301, 3502, 0,
+ 122884, 128387, 0, 983835, 5825, 0, 0, 0, 0, 121322, 10983, 10354, 10418,
+ 0, 2022, 0, 1409, 100789, 0, 0, 0, 0, 1390, 0, 0, 10471, 65904, 5846,
+ 126472, 0, 0, 0, 0, 0, 0, 66035, 77725, 0, 77726, 77720, 77721, 67458,
+ 3168, 67733, 0, 0, 2370, 0, 126243, 0, 195049, 0, 0, 1836, 0, 121207,
+ 119137, 118959, 125232, 0, 0, 0, 2390, 3944, 0, 0, 0, 0, 69908, 125011,
+ 0, 0, 123200, 0, 0, 8975, 64739, 0, 0, 0, 0, 64409, 0, 0, 0, 0, 128564,
+ 0, 0, 0, 0, 6204, 0, 0, 0, 10911, 64954, 119003, 74809, 118903, 4267, 0,
+ 0, 0, 0, 0, 0, 72023, 0, 0, 119504, 92887, 0, 0, 0, 0, 121125, 0, 128337,
+ 5842, 0, 41439, 0, 0, 0, 9328, 0, 120980, 120917, 0, 0, 2285, 0, 0, 0, 0,
+ 118634, 64555, 0, 0, 72162, 9541, 0, 0, 0, 41441, 0, 0, 0, 41040, 2459,
+ 0, 0, 41041, 0, 0, 0, 0, 0, 10450, 0, 41043, 0, 0, 43125, 0, 0, 0, 0, 0,
+ 121008, 68436, 128040, 0, 120649, 0, 0, 4312, 43927, 0, 0, 11923, 42227,
+ 0, 5763, 0, 4827, 74559, 42228, 64406, 0, 0, 129703, 433, 119620, 0,
+ 2499, 67167, 67166, 0, 11973, 0, 4293, 42271, 42224, 0, 0, 66322, 42226,
+ 0, 0, 0, 74180, 0, 55277, 0, 0, 0, 119317, 0, 74632, 0, 0, 71103, 0, 0,
+ 0, 585, 2383, 0, 43263, 0, 4290, 64842, 0, 68920, 0, 8511, 0, 0, 0,
+ 119048, 2380, 126119, 0, 71704, 2376, 0, 0, 0, 5197, 127046, 127047,
+ 127048, 2366, 127050, 127051, 73442, 0, 0, 0, 93835, 0, 93818, 0, 0,
+ 74188, 113813, 0, 0, 0, 983838, 0, 0, 0, 0, 1847, 0, 72771, 0, 42384, 0,
+ 4227, 74158, 0, 92501, 0, 0, 42365, 0, 128902, 0, 92821, 0, 0, 0, 0, 0,
+ 0, 0, 0, 122934, 128563, 0, 983509, 127560, 2754, 0, 0, 128900, 0,
+ 127867, 119638, 0, 1711, 12984, 92365, 77776, 6255, 77770, 77771, 77772,
+ 77773, 0, 42063, 74184, 0, 0, 0, 0, 0, 77785, 77786, 41035, 43274, 77781,
+ 11256, 77783, 77784, 520, 77778, 41037, 77780, 0, 0, 41034, 0, 983829,
+ 64815, 0, 0, 321, 41028, 0, 0, 0, 0, 0, 0, 0, 74191, 0, 0, 72767, 1861,
+ 118938, 129666, 0, 0, 100770, 0, 0, 128530, 3859, 0, 41660, 0, 70793, 0,
+ 983756, 75014, 0, 127514, 41658, 0, 0, 0, 0, 0, 4414, 77769, 0, 42632, 0,
+ 0, 0, 0, 0, 1405, 0, 43220, 43341, 0, 0, 0, 0, 0, 983733, 11199, 0, 3513,
+ 0, 70341, 43342, 0, 65529, 0, 0, 0, 6485, 1397, 0, 0, 92678, 118566,
+ 124137, 0, 82961, 0, 82962, 0, 74270, 43287, 983731, 0, 0, 983738, 0,
+ 71914, 4317, 10490, 0, 0, 194867, 74463, 128952, 464, 41624, 0, 0, 0,
+ 1346, 128240, 69271, 64724, 128566, 423, 0, 0, 113748, 0, 128161, 0, 0,
+ 120563, 64960, 0, 0, 0, 0, 9584, 77795, 77796, 78927, 0, 9718, 77792,
+ 42642, 77794, 64750, 77789, 77790, 0, 0, 128333, 0, 3204, 64666, 0,
+ 43530, 2752, 0, 0, 119594, 0, 0, 0, 0, 92371, 0, 41983, 0, 7010, 0, 0,
+ 41495, 92379, 5877, 42252, 93070, 8009, 3305, 0, 0, 0, 0, 92293, 0, 0, 0,
+ 100836, 0, 65915, 1400, 75018, 10685, 75017, 2103, 122908, 0, 43276, 0,
+ 11169, 0, 6481, 0, 0, 0, 100837, 72249, 100838, 74198, 0, 9116, 0, 0, 0,
+ 0, 0, 0, 8129, 92994, 0, 124992, 0, 11658, 0, 0, 3452, 41031, 0, 1385, 0,
+ 100754, 0, 43340, 11123, 41033, 6493, 12758, 0, 0, 11426, 0, 1681,
+ 100755, 1204, 11960, 69902, 0, 69457, 0, 119322, 129483, 7415, 43338, 0,
+ 0, 67717, 64915, 0, 100759, 72021, 41497, 65044, 0, 19960, 65358, 983601,
+ 0, 0, 0, 73670, 0, 1789, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64728, 0, 0, 0,
+ 6506, 64312, 0, 2368, 0, 0, 0, 0, 3439, 1825, 1192, 0, 73739, 10639, 0,
+ 7790, 5430, 0, 0, 2848, 92981, 0, 0, 7607, 0, 0, 0, 120658, 0, 0, 8883,
+ 0, 728, 0, 0, 0, 0, 92931, 0, 121372, 128348, 0, 68078, 8091, 11447, 0,
+ 0, 126261, 983729, 0, 70003, 0, 0, 74419, 12335, 0, 0, 3443, 0, 0, 0,
+ 127145, 0, 0, 0, 0, 11843, 0, 9205, 8624, 128543, 92930, 43295, 0, 65445,
+ 0, 6277, 41672, 0, 10010, 70186, 983052, 0, 835, 71340, 0, 0, 0, 0, 0,
+ 5426, 4258, 0, 64891, 5424, 0, 8283, 0, 5434, 0, 0, 0, 0, 0, 11947, 0,
+ 1404, 0, 11432, 0, 3464, 6486, 4819, 0, 0, 570, 8095, 0, 0, 1498, 0, 0,
+ 0, 431, 67820, 0, 120574, 128096, 0, 0, 13096, 0, 0, 43408, 0, 128538,
+ 8835, 77875, 0, 0, 122973, 0, 0, 0, 0, 0, 3477, 227, 10488, 0, 382,
+ 11418, 0, 5878, 0, 0, 0, 0, 6484, 92355, 66039, 0, 0, 0, 78717, 0, 92662,
+ 119665, 0, 0, 43290, 0, 0, 0, 0, 8782, 0, 0, 4323, 128649, 0, 120903,
+ 12094, 67499, 0, 0, 0, 92953, 3856, 120970, 124138, 5872, 6495, 72306, 0,
+ 0, 0, 67173, 67172, 67171, 3953, 0, 0, 93063, 11994, 4339, 0, 92654, 0,
+ 0, 0, 0, 128804, 0, 5228, 0, 9766, 0, 92741, 0, 0, 0, 0, 68860, 0, 1162,
+ 0, 2671, 0, 73666, 92632, 92631, 72117, 0, 73811, 0, 194895, 0, 68085, 0,
+ 74331, 11424, 0, 10466, 121239, 0, 194890, 0, 4820, 0, 0, 0, 194891, 0,
+ 119212, 4896, 0, 4897, 42821, 64611, 0, 4438, 0, 0, 1753, 11331, 6147, 0,
+ 43282, 8833, 0, 0, 6504, 0, 0, 0, 118670, 0, 1413, 0, 0, 64353, 12141,
+ 121138, 0, 0, 43163, 0, 72880, 64789, 127094, 838, 127092, 120697,
+ 127090, 5014, 0, 256, 0, 0, 42443, 42739, 0, 7542, 0, 70389, 0, 6489,
+ 10048, 74326, 0, 66573, 0, 125271, 78712, 11761, 126078, 129603, 41094,
+ 0, 0, 0, 0, 92689, 8453, 0, 0, 120942, 128184, 0, 11816, 0, 0, 2930,
+ 93845, 0, 41098, 92771, 41093, 0, 0, 6498, 41096, 0, 0, 1238, 200, 0,
+ 1660, 74476, 0, 0, 74362, 0, 0, 72301, 9224, 0, 0, 0, 0, 0, 0, 0, 0,
+ 72729, 43284, 0, 72110, 67459, 13183, 0, 0, 0, 1669, 10776, 0, 0, 0, 0,
+ 0, 1732, 4030, 0, 3963, 0, 0, 0, 6491, 0, 0, 914, 121394, 0, 0, 0, 78713,
+ 0, 92441, 74367, 42960, 0, 0, 0, 0, 0, 0, 0, 65537, 0, 0, 43430, 5301, 0,
+ 92618, 0, 43285, 0, 0, 125186, 0, 0, 5876, 0, 69555, 0, 0, 110713, 0, 0,
+ 0, 0, 0, 0, 11114, 74536, 0, 0, 0, 0, 983130, 0, 0, 0, 0, 10915, 983069,
+ 12007, 0, 0, 0, 0, 67655, 92604, 0, 8629, 0, 43168, 41872, 0, 0, 0,
+ 42488, 0, 0, 0, 0, 0, 64730, 70041, 0, 122895, 0, 0, 0, 92306, 11416,
+ 4280, 128516, 8765, 73451, 0, 1393, 0, 11157, 74386, 0, 0, 0, 0, 6683, 0,
+ 93832, 12144, 0, 74513, 13019, 74994, 0, 0, 0, 983272, 0, 6488, 357, 0,
+ 41100, 0, 41104, 0, 41099, 0, 71320, 0, 0, 0, 4434, 0, 0, 0, 74231,
+ 83107, 0, 194914, 0, 0, 72286, 68305, 0, 41759, 12757, 0, 0, 72769, 9790,
+ 7674, 0, 121095, 68209, 0, 41764, 0, 0, 72322, 2268, 0, 129845, 983608,
+ 12743, 0, 6480, 0, 41779, 0, 66601, 0, 74490, 10986, 66602, 0, 64807, 0,
+ 0, 41767, 119629, 0, 0, 0, 3955, 64571, 194918, 127089, 0, 70187, 69975,
+ 9770, 12305, 12230, 0, 73551, 0, 0, 74752, 0, 0, 123168, 128263, 74449,
+ 0, 65948, 69611, 0, 0, 71131, 129505, 78573, 0, 0, 11116, 0, 5747, 0,
+ 110667, 9802, 41092, 120731, 0, 0, 0, 0, 0, 120733, 41090, 0, 0, 0,
+ 11271, 57, 0, 0, 983244, 0, 71268, 121290, 43137, 0, 0, 110672, 126221,
+ 0, 0, 0, 0, 0, 277, 74385, 0, 0, 0, 72155, 0, 13025, 8757, 0, 0, 1574, 0,
+ 126124, 100800, 0, 5749, 129923, 0, 42824, 0, 1039, 9801, 0, 5745, 0,
+ 41858, 0, 0, 120655, 0, 41862, 0, 0, 78822, 436, 4771, 118635, 42501, 0,
+ 10573, 0, 77931, 118560, 917986, 9644, 0, 0, 0, 0, 69837, 0, 0, 0, 0,
+ 67409, 0, 0, 0, 125204, 11939, 0, 0, 0, 0, 0, 0, 0, 3504, 0, 0, 92854,
+ 126209, 0, 10226, 65558, 0, 3594, 0, 0, 40, 0, 0, 0, 0, 0, 74312, 72138,
+ 74337, 0, 69577, 0, 0, 0, 70476, 0, 121143, 72317, 0, 0, 4304, 0, 0,
+ 78707, 0, 0, 0, 78597, 1348, 78596, 0, 0, 0, 70406, 92392, 0, 7599, 0, 0,
+ 13269, 0, 129729, 0, 100804, 0, 74494, 6097, 7568, 43980, 4982, 78592, 0,
+ 0, 0, 0, 13270, 0, 128090, 13138, 0, 9484, 0, 0, 71364, 0, 0, 0, 9487, 0,
+ 92913, 0, 71911, 78668, 73963, 6193, 0, 0, 0, 194848, 7228, 10011,
+ 194849, 194852, 194851, 11654, 194853, 126218, 194855, 0, 194857, 3604,
+ 0, 0, 0, 0, 0, 94110, 43740, 94109, 194860, 194863, 66750, 121021, 0,
+ 94111, 6995, 74173, 5437, 74174, 0, 8702, 7339, 129981, 0, 199, 194843,
+ 194846, 194845, 0, 126069, 0, 67818, 0, 7560, 0, 0, 0, 0, 6472, 65814, 0,
+ 128983, 70845, 0, 0, 9191, 0, 0, 0, 0, 124904, 10196, 0, 72452, 6585, 0,
+ 120750, 0, 0, 71872, 129129, 0, 0, 78590, 72308, 11382, 129499, 0,
+ 983670, 0, 194833, 194832, 2165, 129540, 94020, 194836, 42727, 194838,
+ 128252, 78585, 43874, 119610, 0, 0, 43248, 0, 194816, 0, 194818, 128845,
+ 194820, 127879, 5297, 194821, 13284, 6112, 93964, 93010, 73927, 42947, 0,
+ 65746, 0, 0, 194827, 194826, 4342, 42839, 194831, 1677, 0, 72135, 0, 0,
+ 0, 11011, 66399, 0, 0, 0, 10160, 0, 0, 0, 0, 2052, 4308, 92174, 43000,
+ 118659, 543, 64916, 122964, 0, 0, 119170, 0, 118922, 2064, 0, 43158, 0,
+ 0, 69984, 0, 0, 129187, 0, 0, 0, 0, 41631, 92728, 0, 0, 6228, 0, 0, 0, 0,
+ 0, 0, 506, 0, 0, 65735, 2055, 43255, 121407, 0, 0, 0, 0, 0, 0, 194666,
+ 2063, 0, 0, 0, 0, 72136, 0, 74333, 194912, 11827, 74308, 194913, 194916,
+ 194915, 64564, 194917, 67986, 194919, 0, 11037, 0, 121102, 0, 0, 10560,
+ 0, 120756, 194922, 113737, 194924, 194927, 120495, 1931, 0, 0, 0, 128228,
+ 0, 12643, 8751, 123629, 0, 12294, 0, 78834, 9138, 78831, 78833, 12631,
+ 78829, 11080, 78821, 0, 0, 1239, 0, 121067, 0, 12636, 0, 0, 0, 0, 0, 0,
+ 8998, 0, 0, 9152, 0, 0, 0, 67589, 0, 64290, 0, 92393, 12615, 0, 129141,
+ 6914, 93013, 0, 119569, 0, 65188, 0, 67611, 4337, 0, 194897, 194896,
+ 78516, 194898, 7681, 194900, 194903, 67596, 194905, 194904, 2477, 93974,
+ 0, 0, 0, 67604, 70705, 0, 194882, 194881, 194884, 194883, 194886, 128914,
+ 194888, 67599, 0, 194889, 0, 0, 0, 0, 3357, 0, 78852, 4207, 1288, 78842,
+ 78839, 78840, 78837, 78838, 66354, 194872, 0, 128432, 0, 67618, 92664, 0,
+ 42788, 0, 64612, 129897, 10774, 194877, 0, 194879, 129125, 0, 0, 997,
+ 194901, 0, 92577, 0, 11440, 11379, 42000, 13139, 0, 0, 74030, 72293,
+ 73796, 0, 0, 0, 0, 2818, 0, 0, 73793, 0, 4172, 93028, 126523, 124981, 0,
+ 129896, 0, 0, 129522, 69706, 0, 6834, 0, 0, 194865, 126982, 121211,
+ 194866, 194869, 194868, 766, 1257, 0, 0, 0, 3265, 66617, 3274, 0, 0,
+ 94042, 0, 8373, 41989, 69507, 73460, 3418, 3263, 0, 0, 0, 3270, 64539,
+ 11489, 0, 118945, 126220, 0, 127795, 0, 94031, 0, 0, 0, 0, 0, 70512,
+ 983983, 186, 0, 119156, 5770, 13179, 0, 12612, 12949, 64856, 12800, 0, 0,
+ 983152, 11507, 0, 0, 118929, 0, 0, 72141, 0, 73459, 0, 0, 0, 73461, 9254,
+ 66877, 194907, 0, 92338, 5624, 126253, 0, 0, 0, 120472, 120464, 0, 0,
+ 122915, 120462, 0, 1872, 66508, 120467, 41079, 0, 5502, 119330, 41078,
+ 194906, 0, 0, 4511, 68449, 0, 0, 0, 0, 43245, 41083, 68861, 0, 0, 9003,
+ 119959, 0, 5305, 9653, 41081, 43146, 9546, 0, 0, 120478, 0, 65205, 71713,
+ 64063, 120459, 0, 0, 0, 64058, 43101, 43102, 0, 64062, 1028, 64060,
+ 64059, 0, 10567, 110816, 110817, 92857, 110815, 0, 2902, 64043, 64042,
+ 43749, 10756, 64047, 64046, 64045, 64044, 0, 10076, 64040, 64039, 0,
+ 1034, 0, 0, 64034, 64033, 64032, 42735, 64038, 64037, 64036, 64035, 4291,
+ 67497, 64015, 64014, 83393, 83394, 83395, 983784, 0, 43090, 83391, 3476,
+ 64013, 64012, 64011, 64010, 64008, 64007, 2003, 7706, 0, 0, 119050,
+ 64009, 204, 0, 0, 4430, 8239, 64003, 10626, 64001, 64057, 13079, 64055,
+ 64054, 0, 0, 43246, 9343, 64049, 64048, 0, 1133, 64053, 64052, 64051,
+ 64050, 0, 0, 0, 66415, 12329, 0, 0, 129698, 1942, 0, 0, 0, 128249, 0,
+ 68291, 10760, 64023, 64022, 64021, 64020, 43670, 77924, 64025, 41412,
+ 78243, 78244, 0, 0, 64019, 64018, 64017, 64016, 0, 0, 78251, 78252,
+ 78248, 78249, 77914, 78247, 0, 917560, 77919, 6788, 13094, 0, 7532,
+ 41414, 0, 3179, 70745, 64769, 0, 0, 71967, 0, 10751, 0, 0, 0, 0, 0, 0, 0,
+ 2008, 64031, 64030, 294, 41874, 83383, 83384, 64844, 83376, 129063,
+ 83379, 83380, 64028, 11396, 64026, 83374, 0, 0, 118795, 71739, 43247, 0,
+ 70153, 70846, 0, 0, 0, 0, 0, 0, 0, 7801, 83359, 83361, 128931, 0, 3297,
+ 83356, 83357, 1135, 83350, 83351, 73696, 1995, 7927, 71738, 110742, 2552,
+ 83372, 60, 0, 8649, 83368, 83369, 83370, 83371, 10541, 83365, 78679,
+ 43833, 0, 0, 2013, 83362, 0, 110636, 0, 0, 12832, 110638, 8081, 8362,
+ 120188, 0, 9137, 0, 0, 0, 0, 3466, 0, 0, 1996, 0, 3453, 3412, 0, 2002,
+ 2000, 120176, 0, 0, 0, 0, 1998, 0, 1842, 7037, 0, 9628, 68446, 0, 9826,
+ 64502, 1767, 3413, 0, 0, 0, 0, 0, 0, 13108, 44024, 120204, 0, 92693, 0,
+ 0, 0, 70291, 12650, 983210, 0, 68061, 0, 3592, 0, 0, 0, 0, 983975, 0,
+ 66417, 128792, 10742, 0, 0, 1994, 9281, 3296, 64475, 1997, 1895, 128936,
+ 43024, 0, 0, 123184, 72391, 0, 8999, 0, 983633, 0, 66480, 0, 0, 0,
+ 983083, 0, 596, 0, 0, 120216, 8651, 120217, 0, 0, 12995, 0, 0, 70740, 0,
+ 42930, 119955, 64810, 917834, 6825, 0, 917839, 120208, 64275, 120889,
+ 128069, 120210, 6384, 917840, 126477, 0, 67698, 0, 0, 0, 120496, 0,
+ 43412, 0, 0, 0, 0, 0, 120172, 0, 120763, 0, 0, 0, 128343, 1457, 0, 0,
+ 6381, 2815, 0, 65240, 129664, 0, 0, 119522, 70487, 0, 0, 0, 0, 0, 120572,
+ 0, 0, 0, 0, 0, 125253, 0, 0, 0, 11862, 0, 0, 0, 3055, 9852, 0, 65288, 0,
+ 11398, 0, 0, 93016, 123550, 0, 603, 128557, 0, 0, 0, 129366, 3350, 0, 0,
+ 917828, 917827, 68428, 917825, 73045, 917831, 917830, 917829, 0, 1919, 0,
+ 110767, 83296, 83297, 83298, 66446, 64141, 8562, 64139, 64138, 64136,
+ 64135, 64134, 64133, 11297, 0, 0, 11966, 64128, 66286, 0, 123541, 64132,
+ 10867, 64130, 64129, 0, 43374, 9779, 2764, 0, 0, 9471, 0, 0, 0, 0, 66010,
+ 0, 8857, 128771, 121423, 0, 69223, 0, 194660, 983876, 0, 0, 43984, 0, 0,
+ 0, 0, 0, 0, 10717, 64570, 5630, 0, 64143, 64142, 83300, 67758, 83302, 0,
+ 77930, 0, 0, 0, 11631, 64146, 64145, 64144, 2384, 72801, 127380, 0, 0, 0,
+ 0, 118547, 0, 0, 0, 0, 122916, 8933, 1601, 917803, 858, 118637, 64109,
+ 64108, 8090, 0, 72387, 917811, 587, 0, 82971, 0, 0, 0, 78214, 2750, 0,
+ 9983, 64158, 64157, 83288, 83289, 83290, 2167, 83284, 83285, 83286,
+ 83287, 64156, 64155, 64154, 69495, 64151, 64150, 12679, 10053, 10421, 0,
+ 64153, 64152, 0, 0, 4839, 0, 0, 4435, 119016, 0, 64126, 64125, 64124,
+ 64123, 129287, 0, 67478, 7007, 0, 65443, 0, 0, 64122, 0, 0, 93834, 64117,
+ 64116, 6287, 64114, 64121, 64120, 64119, 64118, 110659, 127842, 1177,
+ 65601, 12322, 64106, 92169, 110654, 64102, 64101, 64100, 64099, 0, 10453,
+ 64104, 64103, 7997, 0, 92534, 0, 8705, 64097, 64096, 9571, 0, 110652,
+ 127398, 12132, 0, 0, 0, 110624, 73841, 83339, 83340, 9056, 0, 129970, 0,
+ 6155, 64068, 64067, 64066, 64065, 64072, 64071, 63, 64069, 127382, 0,
+ 93822, 7257, 64064, 0, 0, 0, 0, 0, 0, 78748, 0, 0, 0, 120519, 0, 66242,
+ 66232, 4333, 9855, 64112, 0, 0, 118531, 0, 0, 0, 0, 66222, 0, 0, 0, 0,
+ 69816, 0, 118796, 0, 8708, 0, 64077, 64076, 8996, 4992, 4471, 83343,
+ 64079, 64078, 92179, 0, 0, 123540, 64615, 0, 0, 12075, 42041, 0, 0, 0, 0,
+ 127557, 3123, 0, 983754, 0, 0, 0, 83328, 0, 9223, 0, 83321, 83322, 73797,
+ 83327, 1116, 0, 83319, 7136, 73550, 0, 0, 0, 75031, 0, 0, 0, 64092,
+ 43675, 10104, 83338, 83331, 64095, 64094, 8111, 66247, 0, 64089, 64088,
+ 0, 70106, 42236, 11434, 64083, 64082, 43216, 7737, 64087, 64086, 64085,
+ 64084, 0, 0, 0, 4118, 1797, 83312, 0, 0, 46, 83308, 83309, 298, 83303,
+ 72402, 83305, 83306, 0, 0, 0, 128905, 11495, 0, 67490, 0, 127377, 194828,
+ 127370, 0, 0, 0, 66239, 74945, 64403, 0, 0, 83314, 0, 0, 65758, 43536, 0,
+ 8544, 0, 0, 0, 0, 194824, 0, 0, 0, 0, 0, 3639, 11242, 194822, 0, 0, 0, 0,
+ 0, 0, 68409, 0, 0, 0, 101121, 0, 0, 0, 128654, 8789, 126248, 0, 0,
+ 128325, 0, 0, 0, 0, 65058, 0, 78234, 68064, 0, 66227, 71694, 5573,
+ 118936, 0, 44, 0, 66244, 118907, 0, 66238, 12844, 0, 1622, 129190, 1900,
+ 0, 11458, 0, 0, 6581, 5576, 128303, 0, 126122, 0, 113680, 8947, 0,
+ 113812, 0, 69744, 0, 7908, 0, 917998, 6579, 0, 0, 0, 0, 2138, 6583, 7761,
+ 0, 0, 0, 66802, 5058, 0, 0, 0, 5057, 125256, 0, 74538, 5054, 0, 0, 0, 0,
+ 0, 0, 658, 3497, 128509, 0, 5061, 5060, 4235, 0, 0, 0, 127757, 4236,
+ 4727, 0, 0, 0, 128791, 0, 7488, 128693, 7476, 0, 125259, 120646, 0, 0, 0,
+ 66209, 0, 0, 0, 78931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128903, 0, 9341,
+ 119596, 0, 0, 0, 64668, 0, 8125, 0, 6743, 119175, 0, 129441, 83406, 0,
+ 127966, 119235, 74092, 0, 0, 43660, 71125, 0, 127901, 0, 0, 0, 264, 0,
+ 74954, 0, 0, 0, 0, 0, 6019, 0, 0, 129121, 0, 0, 0, 8800, 0, 66376, 0,
+ 120948, 0, 100744, 0, 0, 92333, 725, 68014, 110579, 110578, 72099, 0, 0,
+ 0, 0, 74899, 0, 0, 0, 110804, 0, 72142, 5074, 5073, 0, 0, 128726, 0,
+ 70723, 5072, 128576, 13098, 72403, 0, 11040, 0, 0, 0, 4929, 0, 0, 0, 0,
+ 0, 0, 0, 0, 67754, 4934, 0, 0, 9758, 0, 0, 70181, 42584, 0, 4329, 0,
+ 4979, 8663, 74521, 0, 983042, 74418, 983653, 0, 5071, 0, 3642, 0, 5070,
+ 10042, 0, 3987, 5068, 120209, 8909, 0, 0, 69917, 0, 73981, 983142, 70749,
+ 4531, 120212, 9105, 0, 4921, 121059, 4926, 65544, 113786, 69621, 0, 0, 0,
+ 83269, 0, 120790, 4922, 0, 992, 119568, 4925, 0, 0, 9526, 4920, 128617,
+ 948, 0, 0, 4930, 0, 0, 0, 4933, 0, 0, 0, 4928, 0, 0, 0, 0, 128379, 722,
+ 118696, 127483, 127482, 127485, 82997, 127487, 1509, 0, 5468, 66214,
+ 127474, 127477, 1672, 127479, 10864, 127481, 72132, 127467, 72159,
+ 127469, 127468, 127471, 127470, 68336, 82999, 120115, 1679, 120116, 0,
+ 120113, 127462, 127465, 127464, 127110, 120119, 120112, 0, 120109, 6968,
+ 5761, 342, 8553, 0, 8143, 127115, 127114, 2253, 624, 127111, 4057, 0,
+ 5078, 0, 0, 0, 5076, 0, 0, 0, 120097, 685, 9025, 1524, 8003, 0, 5539,
+ 113727, 113795, 118673, 7138, 120552, 0, 0, 0, 113724, 0, 8058, 9732, 0,
+ 5080, 0, 5036, 5035, 0, 42604, 72118, 0, 0, 275, 13291, 69995, 0, 0,
+ 983927, 5033, 0, 0, 4836, 70184, 73792, 0, 0, 0, 120681, 43704, 0, 2274,
+ 119000, 124983, 0, 8858, 6409, 0, 119585, 0, 0, 0, 0, 0, 68442, 0, 3432,
+ 10218, 0, 6094, 11232, 0, 0, 0, 0, 1676, 129157, 0, 0, 5030, 0, 118810,
+ 0, 73869, 0, 0, 69944, 6787, 0, 0, 0, 983595, 10544, 12919, 69425, 92218,
+ 0, 0, 0, 129172, 118715, 67703, 0, 0, 0, 0, 0, 72290, 0, 0, 0, 0, 7018,
+ 66241, 0, 0, 0, 0, 0, 74056, 0, 11833, 0, 67975, 65232, 40964, 251,
+ 12686, 7895, 4395, 43538, 0, 0, 0, 78042, 0, 0, 40967, 5879, 0, 0, 0, 0,
+ 0, 65540, 128590, 625, 0, 120194, 1113, 120195, 13103, 3630, 67224, 8179,
+ 74264, 67886, 9316, 10980, 2489, 120958, 8150, 1359, 121353, 70464,
+ 127330, 127327, 5042, 5041, 42769, 12084, 11196, 42961, 92279, 72398,
+ 120535, 127317, 127318, 127315, 12283, 127313, 11453, 70207, 8795, 66245,
+ 0, 5919, 0, 5037, 118864, 0, 0, 67724, 0, 66893, 74006, 129535, 8431, 0,
+ 0, 0, 0, 12620, 6826, 73773, 70169, 5040, 0, 0, 0, 0, 0, 5039, 0, 0, 0,
+ 5038, 0, 0, 0, 0, 0, 65908, 0, 0, 0, 0, 0, 65157, 0, 0, 70182, 0, 73909,
+ 4835, 0, 0, 0, 4309, 7127, 0, 0, 0, 1301, 0, 0, 12222, 0, 73813, 711,
+ 92439, 7133, 0, 0, 0, 0, 0, 0, 0, 7661, 72263, 129541, 0, 0, 70453, 7627,
+ 0, 5031, 92340, 42738, 65784, 0, 65782, 3758, 0, 65781, 67865, 0, 2440,
+ 65780, 70795, 8449, 121393, 121479, 0, 2118, 0, 12121, 0, 0, 129510,
+ 2128, 2130, 2131, 2126, 2133, 0, 121250, 2114, 2116, 2455, 0, 2122, 2123,
+ 2124, 2125, 983806, 8714, 0, 2113, 0, 2115, 0, 127907, 43713, 5052,
+ 66220, 66653, 65777, 65778, 65775, 5051, 65773, 1429, 42647, 5050, 65769,
+ 388, 70685, 735, 0, 129899, 128035, 0, 12726, 0, 0, 0, 0, 0, 5109, 5053,
+ 0, 120854, 0, 0, 0, 2470, 0, 0, 1925, 71251, 0, 10971, 113770, 5048,
+ 5047, 0, 0, 194946, 92313, 129972, 0, 0, 8089, 128468, 639, 0, 68179, 0,
+ 70180, 0, 4599, 0, 0, 0, 0, 983817, 648, 194948, 65819, 0, 0, 0, 129968,
+ 94017, 0, 11777, 9750, 983123, 0, 0, 92367, 70175, 5046, 66255, 0, 0,
+ 65253, 0, 5045, 0, 1916, 74069, 5044, 92348, 0, 0, 5043, 0, 0, 0, 74004,
+ 9669, 12341, 0, 8402, 0, 0, 70174, 0, 3586, 64508, 92456, 0, 0, 119606,
+ 0, 42628, 10069, 0, 0, 0, 0, 123, 120703, 0, 121326, 0, 10719, 129409,
+ 120444, 10829, 120593, 0, 12130, 0, 0, 0, 0, 3925, 0, 0, 75065, 71112,
+ 92372, 71110, 71111, 0, 120441, 120452, 983179, 0, 0, 0, 0, 0, 0, 0, 0,
+ 69879, 8509, 120449, 0, 0, 0, 120448, 0, 118889, 194858, 0, 0, 0, 66445,
+ 0, 71109, 0, 0, 72425, 0, 12136, 0, 983629, 0, 0, 0, 0, 19922, 41768,
+ 74002, 0, 0, 0, 0, 2458, 0, 0, 0, 41074, 4266, 64834, 0, 41077, 0, 9050,
+ 0, 0, 73693, 0, 0, 41075, 2476, 0, 0, 0, 69761, 0, 0, 74202, 78745, 0,
+ 121324, 70152, 66033, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83106, 0, 0, 0, 43693,
+ 78753, 0, 12194, 66215, 71987, 121273, 67216, 121499, 0, 121118, 0,
+ 78756, 0, 0, 55256, 0, 0, 0, 0, 43876, 0, 0, 0, 12948, 195003, 195002,
+ 195005, 195004, 195007, 195006, 0, 128320, 4287, 70183, 4902, 74020, 0,
+ 917961, 0, 1816, 0, 0, 168, 0, 4898, 64298, 0, 78450, 4901, 1821, 0,
+ 43294, 3653, 120899, 791, 9162, 6977, 121183, 0, 70160, 0, 73731, 8354,
+ 0, 0, 0, 7557, 0, 0, 8234, 194992, 78456, 194994, 194993, 194996, 101519,
+ 65925, 194997, 195000, 194999, 0, 66996, 0, 64397, 0, 0, 0, 71310,
+ 194977, 194976, 2448, 194978, 194981, 194980, 2452, 194982, 194985,
+ 194984, 78694, 72292, 7845, 0, 78692, 4408, 4122, 6772, 194988, 8723,
+ 72147, 194989, 73472, 11857, 119304, 119303, 2438, 119297, 119300,
+ 119299, 41953, 0, 42135, 373, 119172, 2119, 11457, 129618, 41955, 0, 0,
+ 0, 41952, 0, 0, 2127, 0, 128496, 5202, 0, 78765, 42823, 11291, 0, 0,
+ 12963, 0, 0, 4125, 41958, 12133, 0, 125099, 1271, 129427, 0, 66024, 0,
+ 3864, 127825, 0, 0, 0, 0, 4166, 0, 0, 129917, 7459, 0, 119914, 5384, 0,
+ 0, 70154, 5759, 0, 0, 0, 0, 66744, 0, 120571, 0, 75066, 5552, 0, 0,
+ 127192, 5553, 0, 0, 0, 12906, 0, 0, 110787, 110792, 110788, 5554, 0,
+ 12344, 110786, 101508, 0, 0, 0, 0, 8517, 101509, 0, 0, 66017, 5555,
+ 92317, 0, 983672, 0, 0, 0, 9143, 0, 195067, 67995, 195069, 127162,
+ 195071, 195070, 4577, 64624, 0, 0, 125105, 983680, 4269, 983674, 983671,
+ 983669, 0, 950, 0, 983673, 983683, 983668, 0, 983675, 0, 119121, 0, 5098,
+ 0, 0, 119099, 5097, 0, 9848, 0, 10293, 983664, 72798, 0, 0, 70303,
+ 983684, 5102, 5101, 128370, 0, 8138, 4517, 1932, 5100, 195060, 65022,
+ 1247, 10034, 195064, 5099, 0, 1441, 0, 4724, 650, 0, 73954, 983271,
+ 129348, 195040, 195043, 9031, 195045, 195044, 195047, 8545, 66356,
+ 195048, 0, 9154, 127243, 0, 0, 2676, 2277, 0, 73812, 195051, 8599,
+ 195053, 917918, 195055, 65462, 0, 92524, 195033, 71903, 0, 0, 41199, 0,
+ 11399, 195035, 195034, 195037, 195036, 195039, 195038, 5108, 5107, 0,
+ 66019, 0, 0, 5541, 0, 0, 12613, 5284, 0, 0, 118537, 4275, 74865, 854,
+ 68147, 74381, 120918, 0, 5103, 124986, 64348, 0, 0, 5221, 69811, 0,
+ 71493, 121163, 0, 0, 11438, 0, 0, 70158, 0, 0, 5106, 195024, 110749,
+ 65154, 69813, 195028, 5105, 195030, 69720, 195032, 5104, 983780, 0, 3176,
+ 127342, 70149, 932, 0, 6567, 195009, 195008, 195011, 195010, 70145,
+ 43850, 195015, 195014, 195017, 195016, 0, 0, 0, 69511, 10670, 0, 13273,
+ 0, 195020, 121370, 8803, 195021, 72431, 8151, 67145, 72436, 0, 12553, 0,
+ 0, 0, 0, 13065, 12570, 0, 0, 0, 983199, 124985, 0, 0, 66466, 0, 0,
+ 194595, 0, 194596, 11351, 43256, 0, 0, 0, 0, 41754, 0, 0, 2720, 194975,
+ 68462, 8232, 120758, 0, 0, 0, 0, 122959, 0, 0, 93067, 10834, 0, 0,
+ 119266, 0, 0, 125025, 67679, 0, 75064, 7781, 0, 0, 126076, 0, 12077, 0,
+ 64586, 127164, 42396, 0, 3475, 0, 2479, 0, 0, 0, 120728, 0, 42434,
+ 129709, 194963, 194962, 110611, 67894, 42473, 194966, 110609, 1843,
+ 42283, 0, 0, 0, 0, 0, 194970, 0, 42321, 7284, 194974, 194973, 194950,
+ 194949, 194952, 194951, 0, 194953, 123614, 128645, 0, 0, 0, 0, 74952,
+ 194954, 194957, 194956, 66367, 194958, 41069, 67689, 9988, 0, 41068, 0,
+ 4295, 0, 0, 41951, 67835, 0, 785, 8236, 128647, 9027, 0, 194943, 0,
+ 122986, 0, 0, 0, 0, 41071, 41059, 0, 92458, 129442, 0, 0, 0, 123612,
+ 2067, 4310, 0, 123611, 5180, 123605, 0, 73872, 0, 69880, 5184, 42385,
+ 194947, 983774, 128531, 0, 0, 119149, 73503, 121334, 0, 983781, 0, 0,
+ 5178, 194929, 120548, 194931, 5188, 194933, 194932, 72245, 194934, 1166,
+ 64429, 42639, 0, 0, 0, 0, 128071, 2442, 10703, 194940, 194939, 194635,
+ 42439, 0, 0, 0, 73933, 983242, 42401, 0, 0, 0, 42288, 0, 0, 0, 13145, 0,
+ 2468, 0, 42327, 0, 0, 0, 42479, 128698, 0, 0, 92580, 0, 74939, 120678, 0,
+ 73733, 0, 0, 2715, 0, 71257, 0, 74114, 0, 0, 0, 0, 0, 66325, 69603, 0,
+ 9240, 0, 0, 129142, 0, 0, 0, 9815, 0, 11246, 0, 73912, 42733, 0, 0, 2480,
+ 0, 0, 0, 6494, 5537, 0, 0, 0, 0, 1211, 0, 121379, 0, 0, 12318, 0, 113796,
+ 0, 0, 0, 0, 0, 64642, 0, 0, 0, 0, 64864, 0, 0, 0, 121212, 0, 0, 3589,
+ 92719, 4035, 6492, 92236, 4265, 6843, 0, 74186, 41778, 113764, 119216,
+ 2488, 0, 4582, 0, 71426, 41777, 12926, 72708, 7528, 10550, 113761, 0, 0,
+ 11439, 0, 0, 64878, 0, 0, 0, 0, 2286, 0, 0, 126646, 127909, 5909, 400,
+ 126500, 0, 0, 0, 0, 0, 64827, 0, 74948, 390, 0, 71301, 0, 3473, 0, 0,
+ 66742, 0, 55285, 0, 0, 0, 92206, 194964, 0, 8004, 0, 6763, 0, 0, 7006, 0,
+ 0, 6757, 73707, 126648, 0, 6766, 0, 0, 0, 6146, 0, 771, 0, 0, 41318, 0,
+ 42272, 0, 120211, 69559, 0, 953, 12917, 72287, 12300, 64837, 11491,
+ 68612, 0, 0, 71321, 7490, 11389, 7489, 3379, 0, 7487, 42996, 7486, 7484,
+ 7482, 6753, 7480, 7479, 7478, 7477, 6501, 7475, 42995, 7473, 7472, 2474,
+ 7470, 7468, 124977, 0, 0, 0, 0, 71871, 11834, 128376, 0, 6017, 0, 128763,
+ 0, 0, 0, 119365, 73949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2472, 69945,
+ 120699, 121133, 2139, 4256, 120776, 74380, 0, 73847, 73844, 0, 0, 101375,
+ 0, 101374, 0, 0, 101347, 7083, 0, 8066, 7678, 0, 121124, 101341, 101373,
+ 101336, 0, 101331, 0, 101304, 0, 101301, 0, 0, 0, 8330, 0, 101298,
+ 101322, 101297, 0, 0, 19934, 0, 1770, 67091, 0, 128671, 129617, 110605,
+ 101355, 73843, 110604, 0, 101362, 67092, 0, 71334, 0, 0, 0, 0, 0, 8162,
+ 0, 5996, 129644, 4903, 0, 0, 43063, 0, 5172, 0, 7139, 0, 127385, 0,
+ 118667, 0, 0, 4334, 6324, 41975, 12186, 10674, 12308, 0, 0, 0, 72807,
+ 41977, 68002, 0, 126630, 2018, 121388, 41979, 68003, 0, 68000, 0, 0,
+ 126984, 68001, 9334, 118609, 71440, 0, 7975, 0, 0, 0, 66621, 4884, 70367,
+ 983759, 0, 121010, 0, 0, 0, 0, 127799, 0, 0, 0, 463, 0, 194584, 69617,
+ 6509, 5460, 0, 0, 0, 0, 42279, 0, 0, 0, 0, 0, 0, 0, 125027, 0, 121119, 0,
+ 0, 0, 5663, 0, 0, 0, 0, 2482, 66202, 0, 0, 42247, 65174, 73925, 0,
+ 100940, 0, 0, 126573, 0, 0, 2460, 0, 11944, 0, 0, 64679, 120835, 127310,
+ 0, 0, 0, 5870, 0, 0, 0, 100931, 539, 100933, 100932, 100935, 9064,
+ 100937, 100936, 100939, 100938, 0, 0, 0, 0, 0, 0, 41295, 100941, 2478,
+ 100943, 4162, 100945, 4260, 12953, 100950, 100949, 129800, 0, 0, 0, 0, 0,
+ 0, 0, 5000, 0, 0, 0, 69672, 71439, 0, 74017, 0, 0, 6709, 0, 0, 983739, 0,
+ 0, 100922, 100921, 10301, 10333, 10397, 100925, 100928, 100927, 0, 0, 0,
+ 127830, 0, 4014, 12842, 0, 67413, 0, 0, 3893, 0, 0, 12210, 0, 42147, 0,
+ 983622, 74465, 0, 0, 0, 0, 0, 0, 0, 0, 110805, 8231, 0, 69946, 41968,
+ 100929, 41973, 12935, 41969, 0, 2453, 0, 0, 78807, 122893, 0, 10349,
+ 10413, 122956, 41962, 3202, 119097, 0, 8316, 129174, 0, 7314, 0, 0, 0, 0,
+ 1840, 0, 0, 0, 4883, 100908, 4723, 70099, 100909, 0, 0, 0, 0, 11089, 240,
+ 19906, 0, 0, 0, 43600, 121004, 13134, 93065, 0, 65931, 110649, 110650,
+ 42634, 110648, 0, 121005, 11463, 0, 0, 129861, 10445, 0, 92969, 0, 2614,
+ 0, 129954, 1729, 0, 0, 100911, 0, 43334, 100912, 100915, 100914, 66201,
+ 100916, 69662, 100896, 100899, 100898, 4121, 100900, 70272, 82954, 63879,
+ 0, 70872, 0, 0, 4039, 643, 7726, 120082, 0, 120068, 58, 0, 0, 0, 63872,
+ 0, 0, 100891, 0, 10625, 100892, 100895, 100894, 1416, 120073, 917761,
+ 67393, 0, 0, 0, 6996, 4264, 0, 100902, 66179, 66768, 100903, 13114,
+ 72311, 67510, 3094, 0, 0, 127074, 4437, 0, 0, 0, 55280, 42174, 0, 42430,
+ 129796, 72246, 42355, 0, 0, 0, 0, 121251, 127401, 0, 0, 0, 0, 0, 0,
+ 100882, 100881, 74037, 100883, 0, 127099, 0, 0, 0, 0, 0, 69646, 65035,
+ 65034, 11480, 6116, 65039, 65038, 41180, 65036, 194565, 0, 12101, 5822,
+ 0, 0, 0, 0, 11663, 127873, 63854, 119657, 63853, 0, 63852, 65810, 4289,
+ 100885, 63896, 100887, 100890, 43621, 0, 0, 0, 129613, 194560, 7461,
+ 73901, 0, 331, 0, 0, 0, 128029, 0, 0, 0, 74629, 0, 0, 0, 41964, 0, 63843,
+ 2084, 41965, 0, 100864, 100863, 100866, 63841, 78549, 41220, 13032,
+ 100869, 8383, 0, 78548, 126102, 0, 0, 1351, 983865, 8698, 100874, 100877,
+ 1930, 100879, 78554, 74360, 100880, 69859, 78551, 0, 0, 129433, 3657, 0,
+ 65202, 6000, 119206, 41901, 0, 0, 41740, 0, 41283, 73543, 119267, 0, 0,
+ 100871, 9695, 100873, 7562, 100853, 5170, 100855, 100854, 676, 100856,
+ 100859, 100858, 9978, 100860, 0, 0, 64934, 0, 0, 0, 113714, 113706,
+ 41829, 65886, 5159, 0, 41832, 704, 43077, 0, 120532, 0, 68496, 65065,
+ 41830, 0, 917799, 917798, 917797, 917796, 0, 67864, 113696, 917800,
+ 12336, 4135, 69805, 341, 2727, 4129, 100862, 100861, 0, 64503, 7913, 0,
+ 0, 4131, 63868, 0, 63871, 4133, 63864, 210, 0, 0, 0, 4137, 78505, 78506,
+ 0, 78504, 78830, 0, 0, 43873, 0, 0, 0, 0, 11988, 78510, 195, 68321,
+ 41501, 0, 42031, 0, 13135, 0, 0, 0, 41499, 0, 0, 9680, 41498, 917794,
+ 42025, 78567, 78556, 0, 0, 0, 0, 0, 0, 101074, 120502, 92597, 0, 0,
+ 917784, 7864, 129001, 129704, 917788, 121106, 917786, 917785, 5753,
+ 67816, 72371, 2219, 0, 0, 0, 0, 0, 0, 121277, 0, 917777, 917776, 917775,
+ 69644, 917781, 917780, 917779, 917778, 8668, 0, 121383, 917782, 5999, 0,
+ 0, 129195, 128243, 43653, 1726, 1015, 0, 127247, 0, 0, 64919, 0, 0, 0,
+ 128478, 0, 69791, 927, 0, 0, 42010, 0, 42021, 0, 0, 1299, 12240, 64537,
+ 0, 0, 0, 0, 0, 0, 69454, 0, 0, 0, 122903, 19914, 12179, 0, 2296, 0, 0,
+ 63832, 917773, 0, 63816, 2594, 63823, 63817, 11178, 0, 0, 0, 11265,
+ 68295, 0, 0, 0, 10554, 3972, 0, 121198, 0, 917766, 10816, 917764, 119608,
+ 74374, 917769, 11210, 93069, 8586, 3882, 8532, 120183, 1573, 128648, 0,
+ 69916, 0, 101051, 67719, 0, 0, 0, 0, 0, 0, 0, 128821, 119169, 0, 0, 6626,
+ 42763, 130034, 118884, 128613, 0, 83128, 0, 0, 0, 0, 0, 983561, 0, 0, 0,
+ 9171, 0, 0, 71305, 983919, 121146, 0, 101095, 128881, 119604, 126596, 0,
+ 0, 0, 128214, 42368, 0, 983106, 2271, 41487, 12118, 74124, 68651, 110836,
+ 110833, 3009, 41476, 41489, 69825, 3007, 1448, 3018, 0, 41491, 8521,
+ 5083, 5082, 0, 0, 8519, 0, 3014, 5081, 73926, 0, 128549, 0, 69951, 5079,
+ 129963, 2557, 128086, 65532, 11828, 0, 71297, 11105, 0, 0, 0, 8518,
+ 10779, 0, 71303, 0, 0, 42170, 110769, 0, 629, 1924, 0, 12037, 0, 5987,
+ 8462, 127744, 0, 63933, 69735, 110770, 128295, 63941, 67981, 5077, 0,
+ 10880, 64849, 5075, 0, 128152, 65075, 0, 11007, 983736, 0, 0, 0, 66684,
+ 72331, 3434, 72338, 1904, 0, 0, 72730, 0, 10499, 4507, 9578, 63925, 0,
+ 7979, 0, 9831, 66689, 0, 461, 194834, 0, 4504, 0, 0, 6325, 0, 43021, 0,
+ 0, 55236, 0, 0, 5177, 41324, 12055, 63831, 0, 41327, 12591, 0, 4114, 409,
+ 0, 0, 8948, 41325, 0, 721, 10182, 0, 71311, 0, 0, 94052, 74963, 83503,
+ 5998, 0, 0, 74825, 0, 12587, 0, 78571, 74889, 71328, 128955, 0, 74121,
+ 78570, 73499, 0, 0, 5995, 0, 42568, 0, 0, 63944, 73860, 126586, 0, 4167,
+ 0, 43175, 0, 74120, 0, 65076, 938, 73857, 73854, 11737, 9721, 0, 0, 0,
+ 11742, 0, 0, 11493, 12334, 128762, 0, 66623, 0, 9173, 0, 11978, 0, 12734,
+ 113750, 113741, 0, 6759, 0, 0, 0, 126222, 0, 70388, 129093, 13027, 42777,
+ 7683, 1167, 0, 4983, 0, 861, 0, 0, 68297, 0, 43757, 92978, 129298,
+ 122630, 127804, 0, 73546, 70815, 9616, 0, 0, 12816, 43759, 0, 12710,
+ 68674, 12721, 4101, 66185, 0, 5992, 7616, 0, 0, 12577, 0, 0, 853, 42693,
+ 0, 121088, 0, 0, 917915, 0, 42835, 0, 0, 0, 0, 0, 12712, 7105, 127807,
+ 65060, 66875, 9900, 0, 0, 0, 121482, 119265, 0, 64778, 12585, 0, 0, 0, 0,
+ 0, 0, 77826, 0, 4900, 125245, 0, 0, 0, 4119, 74768, 8971, 0, 0, 0, 78594,
+ 41132, 9245, 73060, 0, 4138, 194841, 0, 0, 0, 77827, 0, 13054, 0, 0,
+ 128416, 110760, 0, 0, 3948, 128878, 0, 0, 0, 1680, 0, 11861, 0, 0,
+ 120032, 0, 0, 0, 0, 74833, 74190, 5993, 42709, 0, 12706, 77846, 1893, 0,
+ 63915, 0, 0, 110744, 129826, 0, 63997, 120018, 63996, 3077, 0, 0, 1512,
+ 0, 12589, 41479, 0, 0, 0, 0, 11831, 120727, 122949, 41481, 0, 118912, 0,
+ 3090, 0, 3086, 1664, 1850, 0, 3079, 0, 0, 94080, 127140, 0, 0, 74401, 0,
+ 917555, 0, 0, 0, 0, 0, 11526, 63985, 5864, 0, 63992, 0, 63991, 0, 5480,
+ 7858, 0, 4116, 78149, 0, 0, 0, 63907, 0, 0, 126131, 63905, 119601, 0,
+ 983191, 0, 119666, 0, 0, 7534, 507, 91, 2042, 120775, 118596, 0, 66028,
+ 118811, 41844, 70680, 774, 0, 0, 0, 5994, 0, 12733, 0, 0, 0, 72297, 0, 0,
+ 0, 0, 6026, 0, 0, 0, 162, 0, 125247, 78151, 78152, 983590, 92709, 0,
+ 68304, 0, 0, 0, 66658, 0, 0, 0, 0, 121511, 2226, 121512, 129349, 10492,
+ 0, 121510, 0, 43119, 0, 0, 0, 66192, 0, 0, 4899, 12729, 0, 0, 0, 0, 4103,
+ 0, 129842, 77851, 69429, 129046, 0, 12859, 70087, 0, 101580, 0, 0, 0, 0,
+ 0, 0, 65264, 5146, 0, 194694, 71684, 0, 0, 983652, 983863, 78924, 71688,
+ 78463, 5147, 125019, 0, 74524, 71682, 128435, 0, 194692, 5991, 3445, 0,
+ 4976, 66193, 0, 0, 0, 0, 128309, 128594, 129819, 69579, 0, 63855, 0,
+ 10138, 0, 0, 8897, 0, 75027, 0, 120931, 77862, 65836, 0, 0, 77860, 0, 0,
+ 1123, 4124, 41553, 77903, 0, 71680, 121386, 398, 0, 129035, 41551, 0, 0,
+ 0, 41550, 9970, 0, 93062, 42392, 1305, 78901, 0, 129292, 0, 7346, 41464,
+ 0, 0, 0, 41465, 983567, 8528, 9149, 0, 63955, 165, 3024, 11852, 119163,
+ 0, 9093, 0, 9147, 0, 0, 110989, 9148, 0, 4096, 53, 8296, 0, 71352, 0,
+ 9594, 0, 0, 63952, 0, 10997, 0, 0, 5805, 0, 0, 129777, 42176, 71455,
+ 74601, 129604, 10591, 0, 92852, 0, 0, 0, 0, 0, 0, 92475, 0, 0, 42379, 0,
+ 0, 9220, 0, 121425, 0, 0, 4132, 0, 0, 11239, 0, 0, 74837, 0, 66408, 0,
+ 8055, 0, 0, 0, 63962, 74042, 8924, 43123, 5988, 0, 63969, 0, 42718, 8788,
+ 1357, 77872, 65743, 0, 8774, 0, 0, 0, 0, 92748, 120598, 128234, 9564, 0,
+ 0, 119124, 0, 121241, 110983, 92975, 3121, 0, 0, 0, 70081, 0, 0, 0, 0, 0,
+ 64851, 0, 0, 73085, 119532, 0, 0, 0, 0, 1198, 69293, 66708, 64619, 0,
+ 64663, 93991, 0, 0, 2101, 1398, 0, 92554, 0, 0, 92684, 11406, 101588,
+ 12127, 66998, 840, 0, 0, 7101, 120938, 0, 0, 12880, 0, 43104, 0, 0, 0,
+ 2117, 0, 0, 0, 0, 123023, 0, 0, 7769, 129867, 92413, 0, 0, 100695, 0,
+ 40986, 83117, 0, 0, 4127, 0, 0, 129034, 0, 0, 0, 70738, 0, 129466, 0, 0,
+ 0, 0, 119081, 0, 10581, 0, 4533, 0, 128941, 6490, 0, 12038, 0, 0, 68225,
+ 0, 0, 69704, 0, 1948, 119007, 129607, 101586, 0, 0, 0, 120802, 0, 9494,
+ 0, 0, 0, 4843, 0, 74772, 4098, 0, 0, 0, 3436, 0, 127279, 12817, 0,
+ 126607, 118678, 0, 0, 0, 74433, 0, 0, 71962, 0, 121296, 65916, 0, 0,
+ 121458, 0, 129107, 93815, 0, 73743, 0, 0, 983133, 67676, 0, 0, 74627,
+ 128928, 0, 127892, 0, 71326, 67222, 0, 75013, 92435, 0, 128500, 0, 0,
+ 9613, 43425, 4526, 121415, 0, 64520, 71336, 0, 0, 55278, 10228, 64957, 0,
+ 0, 3807, 2081, 66640, 0, 0, 0, 0, 119269, 0, 128688, 0, 128142, 1451, 0,
+ 0, 4134, 0, 74847, 0, 74793, 0, 78913, 74295, 9960, 1201, 0, 12846,
+ 121271, 0, 11919, 64962, 0, 43739, 0, 66358, 0, 0, 0, 43679, 72284,
+ 72289, 0, 129523, 1253, 983870, 65766, 500, 65764, 65765, 65762, 65763,
+ 65760, 65761, 70334, 983867, 9821, 11702, 110630, 110631, 110628, 110629,
+ 128481, 0, 7533, 66717, 92500, 92305, 0, 0, 69277, 127758, 71332, 0, 0,
+ 0, 0, 11188, 0, 4112, 0, 0, 12890, 0, 0, 9915, 0, 68423, 0, 0, 2876, 0,
+ 0, 0, 0, 7382, 92415, 0, 128132, 0, 0, 0, 0, 69561, 127915, 0, 7003, 0,
+ 0, 7704, 0, 0, 0, 4123, 0, 0, 9977, 0, 0, 65759, 0, 0, 128266, 9808, 0,
+ 92611, 4126, 0, 9521, 9589, 64755, 0, 0, 0, 69948, 0, 92368, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 93814, 0, 0, 92234, 0, 10693, 0, 0, 65897, 4058, 0, 0,
+ 64660, 0, 0, 0, 983730, 1139, 43298, 0, 65929, 8970, 0, 9934, 0, 11023,
+ 128020, 42522, 0, 0, 0, 78899, 3057, 128113, 7349, 69959, 128722, 68065,
+ 110813, 0, 92826, 67201, 0, 0, 0, 9528, 0, 0, 0, 9102, 627, 92827, 6273,
+ 129496, 0, 0, 983212, 92966, 43300, 0, 983740, 11696, 92825, 1018, 65554,
+ 0, 74338, 0, 7645, 0, 128321, 0, 0, 0, 0, 73814, 11544, 12563, 10728, 0,
+ 0, 127340, 43311, 64966, 92841, 0, 0, 118946, 0, 0, 74779, 0, 185, 65085,
+ 74533, 0, 0, 7535, 0, 42525, 0, 9749, 41701, 6131, 0, 4117, 129062,
+ 126988, 0, 92429, 65693, 0, 73445, 0, 69695, 0, 0, 0, 0, 0, 0, 0, 1184,
+ 0, 815, 0, 0, 0, 0, 0, 71325, 0, 0, 64683, 983816, 0, 127959, 0, 0, 0, 0,
+ 0, 0, 0, 68166, 0, 0, 0, 0, 66799, 0, 128912, 0, 5142, 0, 69643, 0, 0,
+ 68367, 93975, 0, 0, 0, 123209, 124133, 0, 0, 74855, 121330, 0, 0, 0, 0,
+ 10940, 66030, 0, 70385, 73494, 0, 2652, 120527, 0, 129946, 0, 126508, 0,
+ 0, 0, 0, 0, 0, 1828, 0, 128357, 0, 8531, 0, 74799, 12324, 72434, 65238,
+ 68374, 0, 65573, 0, 68308, 68679, 12904, 43445, 0, 0, 0, 11247, 0, 0,
+ 41426, 0, 0, 0, 0, 0, 67250, 69451, 83354, 11869, 0, 0, 0, 0, 0, 0, 637,
+ 0, 0, 0, 121178, 0, 0, 74474, 71306, 0, 7298, 128256, 0, 0, 0, 0, 8210,
+ 0, 0, 0, 2046, 0, 0, 0, 70333, 0, 1506, 69926, 0, 83353, 0, 12651, 0, 0,
+ 11867, 12058, 120626, 72111, 7803, 0, 0, 65592, 118844, 0, 0, 355, 9719,
+ 0, 118961, 0, 121077, 127246, 0, 42178, 0, 69760, 42571, 0, 0, 0, 0, 0,
+ 0, 127176, 3178, 0, 0, 92704, 83381, 9080, 120943, 67697, 0, 121342,
+ 129875, 0, 71485, 0, 917837, 0, 0, 78157, 0, 0, 0, 0, 0, 71313, 0, 70710,
+ 128212, 0, 72238, 67858, 0, 0, 0, 0, 0, 0, 0, 10770, 118994, 0, 465, 0,
+ 983656, 74348, 0, 0, 0, 0, 0, 0, 0, 10930, 0, 0, 0, 119091, 69388,
+ 122637, 129918, 0, 0, 0, 0, 0, 10092, 0, 0, 0, 0, 119019, 1766, 11282,
+ 11996, 66644, 4547, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120906, 4345, 0, 0,
+ 128947, 0, 0, 0, 0, 0, 5382, 0, 0, 118552, 0, 0, 5406, 43127, 120007, 0,
+ 3590, 129874, 0, 0, 0, 42016, 0, 0, 121002, 0, 7742, 0, 66562, 71323, 0,
+ 0, 5310, 0, 123625, 0, 43594, 0, 128260, 66723, 0, 73816, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1326, 128723, 0, 0, 74519, 0, 0, 0, 0, 71308, 0, 5410, 5783,
+ 0, 8403, 5400, 120526, 0, 128863, 0, 0, 0, 64412, 0, 0, 5587, 42865,
+ 71858, 0, 0, 129854, 0, 113785, 0, 120755, 0, 69738, 0, 74867, 10461,
+ 12103, 0, 0, 70701, 0, 0, 0, 0, 0, 94009, 0, 2760, 0, 8816, 41515, 0,
+ 11802, 0, 7585, 910, 0, 0, 0, 3658, 83386, 120525, 0, 7617, 0, 12888, 0,
+ 0, 64631, 0, 41514, 11097, 5703, 0, 41517, 41504, 41519, 0, 70104, 0,
+ 65864, 0, 120533, 0, 121037, 0, 0, 43553, 120774, 0, 0, 0, 0, 0, 1578, 0,
+ 43449, 0, 0, 8225, 121191, 94024, 72799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 110655, 0, 110656, 121247, 72213, 0, 110658, 0, 74997, 0, 3195, 10999,
+ 983570, 7897, 0, 1203, 74396, 0, 64544, 0, 0, 0, 2877, 0, 0, 0, 121112,
+ 0, 0, 128977, 119607, 0, 0, 0, 0, 983623, 0, 0, 0, 0, 0, 0, 0, 0, 983078,
+ 0, 0, 0, 9939, 0, 0, 0, 0, 0, 0, 0, 10714, 0, 0, 0, 0, 0, 67738, 0,
+ 74038, 0, 42897, 0, 0, 0, 0, 0, 0, 7730, 0, 0, 0, 11163, 0, 0, 0, 113701,
+ 4966, 128802, 70674, 129468, 123207, 3841, 0, 0, 983231, 77886, 0, 4972,
+ 0, 64699, 0, 0, 0, 0, 0, 12705, 10203, 9608, 0, 0, 11962, 121397, 0,
+ 1196, 67684, 0, 777, 0, 0, 65271, 0, 0, 0, 0, 64824, 983195, 0, 9454,
+ 63778, 8658, 0, 0, 2705, 0, 64894, 0, 0, 11986, 92636, 0, 8280, 0, 2701,
+ 0, 0, 0, 0, 0, 9809, 0, 0, 0, 0, 0, 63761, 1748, 0, 65719, 121078, 0, 0,
+ 0, 55244, 3061, 0, 63765, 63787, 0, 41520, 0, 7694, 0, 8896, 63768,
+ 55282, 0, 127781, 0, 0, 63807, 1591, 0, 6386, 118554, 0, 0, 0, 983200, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68289, 0, 0, 7624, 67487, 10996, 92247, 10609, 0,
+ 127181, 10987, 0, 70370, 3894, 0, 0, 0, 0, 493, 0, 0, 1717, 12228, 479,
+ 917941, 129347, 129473, 917935, 917939, 917924, 917932, 92303, 64315,
+ 92170, 0, 83522, 6233, 42681, 83525, 83518, 83519, 64911, 83521, 0, 0,
+ 83516, 83517, 129843, 8378, 11632, 0, 0, 7323, 0, 120771, 0, 0, 0, 0,
+ 120904, 83526, 0, 128710, 92672, 0, 0, 0, 0, 0, 0, 0, 63806, 63800, 0, 0,
+ 0, 63798, 63803, 244, 11542, 0, 0, 73761, 0, 12669, 120310, 0, 0, 0, 0,
+ 120680, 71908, 0, 0, 8612, 0, 0, 0, 0, 0, 64662, 125056, 1360, 248, 0,
+ 63797, 0, 63794, 0, 7292, 983685, 63756, 42786, 74957, 0, 12663, 0, 0, 0,
+ 0, 0, 0, 0, 4579, 0, 0, 0, 0, 0, 0, 71130, 65545, 9602, 8623, 0, 128052,
+ 0, 0, 0, 0, 0, 0, 0, 659, 6098, 0, 12234, 83511, 83512, 8311, 83514,
+ 7669, 83508, 83509, 83510, 0, 0, 0, 0, 983951, 0, 0, 2323, 0, 2319,
+ 77917, 120900, 77916, 2311, 83077, 4415, 1586, 68050, 0, 128724, 83020,
+ 2309, 83022, 8173, 83013, 83014, 83015, 83016, 0, 83010, 69275, 83012,
+ 9397, 0, 9395, 9396, 9393, 9394, 9391, 9392, 9389, 6209, 9387, 9388,
+ 9385, 9386, 9383, 9384, 0, 0, 0, 0, 0, 11259, 0, 0, 0, 2313, 0, 119661,
+ 0, 0, 0, 0, 10570, 65776, 110968, 0, 83006, 83007, 11998, 83009, 83002,
+ 83003, 83004, 66406, 0, 128780, 83000, 11818, 9381, 9382, 9379, 9380,
+ 9377, 9378, 9375, 9376, 1683, 9374, 0, 9372, 0, 0, 0, 0, 127801, 0,
+ 42029, 11079, 0, 43451, 42032, 0, 0, 118666, 0, 5005, 0, 0, 42030, 5007,
+ 78828, 126210, 0, 4951, 110776, 0, 110775, 0, 43309, 121222, 92172, 0,
+ 92334, 0, 9548, 0, 119138, 71896, 0, 0, 0, 0, 0, 0, 65691, 65580, 64361,
+ 10496, 0, 0, 0, 917975, 0, 0, 41046, 0, 0, 0, 13177, 0, 64703, 0, 43499,
+ 3389, 10589, 0, 11208, 120719, 78395, 73964, 78393, 78392, 78391, 11314,
+ 8281, 113732, 113667, 113745, 9076, 8862, 69743, 41052, 78397, 64766,
+ 69821, 0, 0, 0, 82992, 82994, 10671, 82998, 82987, 82989, 82990, 6303,
+ 113664, 498, 64471, 82986, 129901, 0, 9349, 0, 0, 119343, 8031, 2249, 0,
+ 128999, 3231, 0, 6422, 0, 0, 119339, 2537, 78405, 41429, 78403, 78401,
+ 78399, 0, 0, 41433, 4719, 41431, 0, 78411, 5211, 41428, 78407, 82983,
+ 1772, 0, 0, 82979, 66850, 64812, 82982, 82975, 68767, 82977, 82978, 0, 0,
+ 0, 0, 41064, 70368, 9663, 66838, 129381, 12304, 125113, 0, 41062, 66847,
+ 0, 0, 41061, 70454, 0, 127187, 83049, 83050, 41509, 83054, 83045, 83046,
+ 83047, 83048, 0, 43184, 41507, 1958, 0, 66816, 41506, 0, 0, 0, 120717, 0,
+ 0, 0, 74349, 72113, 8008, 0, 0, 0, 65083, 6839, 0, 126517, 73803, 127055,
+ 127056, 3508, 127058, 127059, 78038, 0, 120932, 0, 6411, 128115, 0, 0,
+ 128832, 100930, 0, 0, 0, 0, 0, 129776, 128546, 0, 0, 120914, 0, 0, 0, 0,
+ 917822, 128810, 983676, 65599, 0, 9966, 12607, 4948, 128070, 0, 128149,
+ 0, 0, 6207, 0, 6117, 73916, 0, 0, 0, 0, 68244, 41511, 0, 129489, 127304,
+ 0, 121289, 0, 118618, 83031, 83032, 0, 41556, 0, 0, 0, 128571, 73504, 0,
+ 0, 118645, 41510, 7953, 0, 0, 41513, 0, 0, 0, 83038, 83039, 83040, 83041,
+ 83034, 83035, 848, 9868, 983150, 6424, 118625, 83033, 0, 0, 0, 0, 118539,
+ 0, 893, 64576, 13299, 0, 0, 71998, 71447, 0, 0, 0, 0, 8903, 0, 0, 0,
+ 8099, 0, 0, 0, 0, 0, 0, 0, 0, 113713, 0, 0, 0, 0, 0, 83027, 41483, 83029,
+ 83030, 83023, 83024, 69436, 64836, 194756, 41485, 194758, 194757, 194760,
+ 41482, 42737, 64588, 0, 127787, 0, 10014, 0, 0, 194763, 194762, 68785,
+ 194764, 194767, 194766, 0, 0, 0, 11377, 122634, 0, 983811, 0, 0, 0, 9776,
+ 0, 93824, 5215, 194750, 13227, 8758, 194751, 128744, 0, 0, 5363, 12957,
+ 0, 0, 129051, 129526, 6421, 0, 0, 121304, 0, 0, 0, 0, 92625, 119070,
+ 67895, 983962, 0, 68608, 6482, 0, 0, 11945, 0, 0, 8838, 0, 4025, 10709,
+ 0, 2108, 0, 73929, 0, 0, 10617, 194737, 128031, 194739, 194738, 68614,
+ 194740, 68611, 9924, 129952, 194744, 0, 0, 0, 3277, 0, 4947, 41055, 0,
+ 194722, 129930, 194724, 194723, 64626, 194725, 42266, 194727, 8371,
+ 194729, 127028, 12806, 41492, 0, 0, 73930, 194731, 124140, 41054, 1078,
+ 194735, 194734, 41057, 0, 0, 0, 0, 0, 92210, 73009, 0, 41496, 0, 9165,
+ 1572, 0, 129712, 0, 128635, 9215, 9330, 129809, 10032, 41745, 43183,
+ 6401, 5831, 0, 0, 0, 8056, 0, 65681, 92377, 0, 0, 0, 121048, 0, 118887,
+ 6408, 0, 0, 5661, 82972, 82973, 3603, 0, 82967, 3548, 82969, 82970, 0,
+ 82964, 82965, 9918, 118787, 11321, 0, 0, 0, 128992, 0, 0, 0, 0, 0, 0,
+ 41558, 41471, 0, 8158, 41561, 41472, 0, 0, 194672, 43762, 77927, 6701,
+ 41559, 1896, 66256, 66248, 194680, 5665, 0, 194681, 0, 0, 0, 74352, 0,
+ 5664, 127895, 194682, 12310, 5662, 194687, 194686, 73924, 1121, 82953,
+ 82955, 0, 74378, 0, 0, 74966, 0, 71892, 0, 69413, 194667, 8627, 194669,
+ 10110, 194671, 42024, 6420, 42028, 0, 10509, 2795, 73923, 0, 69231, 0,
+ 6275, 93957, 917927, 124972, 194655, 127786, 6423, 129733, 0, 0, 68526,
+ 12823, 0, 0, 42026, 42017, 0, 7524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12691,
+ 68072, 42722, 69877, 82956, 78655, 78661, 82959, 78662, 41265, 41065,
+ 1795, 917809, 118791, 10587, 0, 917807, 0, 194640, 0, 12946, 194641,
+ 71921, 194643, 9169, 70372, 194648, 194647, 68202, 194649, 73990, 65111,
+ 0, 748, 41067, 6234, 194651, 9990, 72795, 194652, 194629, 194628, 194631,
+ 194630, 67896, 194632, 917812, 3593, 82948, 82949, 82950, 82951, 82944,
+ 69729, 82946, 82947, 194638, 194637, 0, 581, 0, 42929, 7944, 0, 0, 0, 0,
+ 0, 0, 72143, 0, 10119, 6415, 42893, 0, 69702, 0, 0, 11375, 0, 0, 0, 412,
+ 92765, 42928, 42880, 43587, 0, 0, 0, 0, 0, 0, 122638, 0, 0, 0, 65854,
+ 92508, 65811, 75024, 194624, 194627, 9344, 8826, 92916, 0, 125090, 74781,
+ 0, 0, 129582, 0, 0, 0, 127783, 0, 0, 0, 0, 10133, 92755, 0, 0, 0, 0,
+ 78414, 78413, 118950, 74011, 0, 0, 121080, 0, 1908, 127378, 4918, 0, 0,
+ 70709, 67825, 6250, 0, 10811, 78412, 11339, 4914, 0, 0, 118971, 4917,
+ 70686, 0, 0, 4912, 69722, 73845, 0, 0, 129527, 0, 0, 0, 118986, 0, 0,
+ 74317, 0, 8319, 194714, 194717, 10960, 72196, 8305, 12573, 983620, 72193,
+ 0, 13202, 0, 12582, 0, 72198, 69856, 0, 0, 78598, 0, 72195, 0, 65802,
+ 74822, 7698, 12708, 74045, 0, 0, 70460, 4913, 127990, 0, 123539, 0, 0,
+ 12728, 129980, 128895, 0, 101281, 0, 130038, 0, 101283, 0, 12588, 8821,
+ 6153, 194705, 78900, 194707, 194710, 194709, 194712, 194711, 118854,
+ 194713, 651, 0, 0, 0, 0, 0, 78468, 78469, 69433, 78467, 69614, 74905,
+ 194695, 78461, 194697, 194696, 0, 4716, 43277, 0, 2185, 78475, 128592,
+ 120928, 194700, 55264, 194702, 12732, 0, 12707, 0, 0, 0, 0, 121417, 8479,
+ 4151, 0, 0, 0, 0, 0, 0, 0, 0, 113799, 0, 74050, 0, 0, 0, 0, 0, 129467,
+ 12278, 0, 129507, 0, 2700, 12576, 7842, 0, 67471, 0, 2699, 0, 0, 2985, 0,
+ 126475, 0, 129873, 119314, 0, 119312, 9827, 101292, 119311, 101291,
+ 119309, 119306, 11481, 118718, 119305, 0, 35, 78481, 78482, 66694, 78480,
+ 78477, 78478, 0, 0, 64257, 0, 0, 0, 78485, 78486, 78483, 4272, 0, 0,
+ 40965, 0, 12704, 78487, 983568, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5244, 4189,
+ 94108, 0, 127948, 4188, 1879, 0, 0, 0, 43743, 71974, 8873, 2279, 0, 0, 0,
+ 12574, 12735, 92749, 92753, 983921, 0, 0, 75001, 0, 0, 0, 12578, 12720,
+ 128628, 101088, 0, 12346, 128596, 101089, 0, 0, 7251, 0, 0, 118850,
+ 73025, 0, 0, 0, 0, 0, 12564, 66457, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101131,
+ 0, 41564, 10976, 0, 121223, 0, 0, 10054, 9197, 120618, 0, 9012, 65737,
+ 74420, 0, 13215, 12730, 0, 0, 0, 0, 816, 0, 101123, 122664, 83191, 0, 0,
+ 92752, 101120, 4715, 94107, 94106, 71075, 0, 0, 0, 67729, 0, 307, 0,
+ 9585, 0, 0, 0, 101255, 0, 125267, 0, 70727, 65567, 101238, 75006, 101231,
+ 983909, 0, 12236, 41419, 101259, 194621, 101248, 75003, 194622, 73675,
+ 120957, 41421, 75005, 4462, 118569, 126599, 983911, 821, 0, 2498, 5800,
+ 100834, 100833, 1760, 67483, 4469, 64377, 100840, 100839, 0, 757, 1185,
+ 118558, 100841, 0, 10628, 100842, 68849, 100844, 43971, 100846, 100849,
+ 64763, 0, 7713, 0, 0, 0, 4380, 194608, 128073, 194610, 194609, 194612,
+ 862, 65626, 194613, 65627, 65629, 5137, 194617, 0, 0, 0, 65069, 7566,
+ 64688, 67143, 118592, 100823, 100822, 100825, 4748, 92228, 100826,
+ 100829, 42260, 129494, 64107, 0, 0, 0, 0, 128189, 0, 194604, 13137, 8775,
+ 127945, 123633, 194607, 0, 8410, 4454, 194585, 0, 92542, 4449, 92330,
+ 127064, 75022, 92761, 70664, 194589, 339, 194591, 194590, 0, 70662, 0,
+ 100830, 41543, 0, 0, 0, 41542, 127066, 8916, 6705, 0, 129296, 0, 0, 0, 0,
+ 0, 41548, 6729, 119329, 0, 7348, 0, 0, 7537, 0, 11819, 0, 0, 123624,
+ 71269, 0, 7344, 100808, 129073, 9780, 0, 11117, 74993, 0, 194578, 10483,
+ 194580, 194579, 194582, 194581, 68781, 125114, 100820, 100819, 0, 4211,
+ 1259, 7517, 0, 0, 194561, 70827, 194563, 194562, 641, 5219, 94034,
+ 194566, 11064, 194568, 0, 129820, 0, 0, 0, 0, 100812, 100811, 100814,
+ 100813, 100816, 100815, 100818, 100817, 100798, 100797, 41410, 100799,
+ 64262, 0, 41407, 75000, 0, 0, 93812, 0, 0, 72803, 74999, 78897, 0, 0,
+ 67675, 0, 0, 0, 0, 43647, 0, 0, 100792, 100791, 100794, 100793, 100796,
+ 100795, 983276, 74630, 11933, 0, 0, 41903, 67892, 11001, 100801, 42255,
+ 100803, 100802, 100805, 41905, 100807, 100806, 10775, 9793, 0, 0, 74452,
+ 0, 983063, 42535, 0, 64529, 41408, 42853, 0, 0, 42674, 118915, 0, 0,
+ 983807, 0, 70838, 0, 0, 0, 64506, 0, 66738, 4747, 100783, 69844, 100785,
+ 5832, 0, 0, 5141, 42600, 124147, 0, 0, 0, 0, 0, 93790, 0, 7657, 0, 71132,
+ 74137, 0, 128362, 73682, 73681, 859, 0, 0, 0, 6059, 126985, 55235, 0, 0,
+ 0, 0, 0, 100787, 11488, 72838, 100788, 0, 100790, 10558, 0, 124144,
+ 118646, 126090, 71069, 0, 0, 1788, 0, 0, 0, 0, 119571, 92822, 9028, 0,
+ 69234, 73665, 0, 9905, 73556, 41242, 70086, 0, 74109, 100765, 100764,
+ 100767, 100766, 70830, 83184, 70082, 3940, 0, 43754, 0, 128188, 8665, 0,
+ 0, 0, 1653, 100775, 42406, 100777, 100780, 70825, 120523, 0, 8815, 0,
+ 65046, 0, 42445, 0, 11180, 119318, 119315, 68454, 42485, 0, 0, 8211,
+ 42293, 983602, 0, 0, 0, 0, 65385, 100771, 42332, 100773, 78431, 78432,
+ 78423, 78430, 78420, 10022, 65387, 78419, 65384, 0, 0, 0, 65386, 0,
+ 11248, 0, 43198, 64751, 0, 0, 0, 0, 0, 0, 101102, 7363, 0, 0, 119323,
+ 119324, 100752, 100751, 0, 119320, 0, 983632, 0, 8237, 0, 0, 0, 0, 0, 0,
+ 9914, 0, 100763, 100762, 120009, 6351, 119993, 92740, 68766, 0, 120010,
+ 41243, 0, 74108, 11467, 120165, 119998, 4358, 0, 6353, 0, 0, 0, 93045,
+ 1710, 0, 0, 92237, 0, 49, 73871, 120005, 78671, 0, 78672, 9741, 78443,
+ 78444, 78441, 43443, 78439, 78440, 69244, 78438, 3470, 0, 0, 92814, 0, 0,
+ 78445, 0, 1072, 78457, 78452, 78454, 74230, 78451, 78447, 78449, 1080, 0,
+ 74100, 0, 1101, 68404, 78458, 78459, 71082, 0, 1086, 1869, 0, 0, 0,
+ 65458, 0, 0, 41988, 0, 1091, 0, 7977, 0, 66992, 0, 0, 0, 92758, 0, 0, 0,
+ 0, 0, 71255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64582, 0, 0, 70794, 0, 120989,
+ 128495, 74106, 0, 66883, 0, 0, 0, 0, 0, 0, 0, 92553, 43752, 110592, 0,
+ 71249, 120886, 0, 0, 0, 0, 6063, 100857, 101221, 917995, 6053, 74096, 0,
+ 0, 74169, 13100, 0, 917999, 0, 71081, 0, 70387, 6055, 7800, 4279, 8490,
+ 120114, 120111, 64786, 8602, 120110, 83389, 92204, 0, 0, 74961, 0,
+ 120117, 120118, 120099, 120100, 65087, 64402, 3674, 120096, 0, 120094,
+ 120107, 118624, 120105, 10107, 42159, 42870, 120101, 69632, 0, 0, 43281,
+ 127078, 0, 74098, 0, 0, 126497, 74099, 129056, 0, 0, 0, 121123, 5847,
+ 125258, 0, 0, 0, 0, 0, 66592, 64469, 71698, 19966, 0, 42561, 0, 129170,
+ 66854, 8120, 75042, 0, 0, 0, 0, 0, 0, 126068, 8369, 0, 0, 122912, 3369,
+ 0, 121094, 0, 0, 69238, 10495, 121365, 0, 557, 9457, 0, 0, 121054, 73880,
+ 127220, 0, 74937, 74094, 0, 0, 119001, 92171, 127219, 128175, 127939,
+ 120424, 0, 127214, 2109, 67893, 127211, 69656, 127217, 10604, 127215, 0,
+ 0, 0, 129727, 126561, 0, 0, 0, 0, 1618, 0, 0, 83175, 10430, 0, 0, 13063,
+ 917585, 0, 92982, 113666, 0, 78390, 83489, 12060, 0, 113669, 0, 6329, 0,
+ 0, 0, 74395, 2707, 8309, 0, 127054, 78398, 0, 2697, 0, 78396, 127057,
+ 2695, 0, 0, 68334, 0, 0, 0, 72325, 2693, 74091, 0, 0, 2703, 113729,
+ 70283, 41918, 983169, 127542, 8687, 127543, 12178, 43361, 92540, 64075,
+ 110705, 5248, 110703, 120538, 6427, 0, 0, 0, 0, 110710, 0, 74990, 74989,
+ 70703, 127031, 0, 9873, 0, 0, 0, 64762, 2053, 0, 6591, 9340, 0, 1589, 0,
+ 296, 67712, 128315, 12766, 118931, 74370, 120417, 2414, 128068, 43829,
+ 111202, 74836, 0, 12579, 0, 12575, 6416, 5656, 0, 13262, 65590, 5299,
+ 983702, 0, 5449, 1252, 0, 78404, 69748, 74369, 65373, 5295, 0, 121066,
+ 1223, 1642, 78408, 0, 12158, 5303, 0, 120546, 41413, 3212, 127025, 3211,
+ 74810, 41425, 127029, 0, 74450, 9728, 0, 10924, 74778, 6636, 73552,
+ 129884, 0, 0, 129882, 9519, 0, 0, 129106, 101110, 68780, 0, 0, 0, 119182,
+ 0, 12104, 77942, 77951, 9004, 0, 74249, 10230, 0, 0, 0, 77947, 0, 69679,
+ 121475, 9890, 125049, 12971, 0, 92556, 0, 67903, 70051, 983924, 0, 0,
+ 9635, 12600, 0, 0, 0, 118900, 6469, 0, 101113, 65304, 4679, 101114,
+ 64300, 64867, 6531, 101118, 101099, 101098, 92813, 101100, 42916, 0, 0,
+ 0, 0, 0, 0, 4445, 72296, 0, 11533, 0, 3416, 124112, 0, 0, 0, 78566, 0, 0,
+ 101091, 92815, 101093, 5447, 72140, 70752, 101097, 101096, 0, 0, 0,
+ 64448, 0, 43920, 70677, 0, 6232, 101101, 101104, 101103, 43608, 101105,
+ 101108, 6538, 4335, 0, 3941, 74986, 11061, 0, 74988, 74987, 0, 12155,
+ 128278, 0, 0, 0, 0, 74578, 0, 65832, 0, 129459, 70789, 0, 125050, 0, 0,
+ 350, 10951, 101081, 509, 101083, 101086, 101085, 0, 0, 0, 917540, 0,
+ 100905, 110970, 12162, 64741, 0, 9354, 0, 70802, 100901, 2496, 11516,
+ 944, 128238, 0, 0, 1438, 0, 0, 120185, 70785, 1220, 917952, 93844, 0, 0,
+ 5008, 42630, 70787, 101087, 2229, 68206, 564, 0, 312, 0, 0, 0, 70797,
+ 8877, 269, 0, 128065, 9617, 0, 0, 100910, 0, 0, 10862, 0, 0, 41416, 0,
+ 4173, 0, 0, 0, 1906, 983854, 41418, 74073, 101068, 101067, 41415, 69622,
+ 9582, 0, 64287, 0, 0, 11428, 1730, 0, 0, 19918, 10469, 101076, 101079,
+ 68088, 0, 101080, 72342, 0, 129692, 0, 6129, 0, 0, 0, 0, 7874, 0, 0,
+ 11206, 13136, 118529, 129305, 0, 64374, 74925, 0, 73892, 0, 101073,
+ 101072, 101075, 74960, 9228, 101054, 101057, 101056, 5240, 9811, 0,
+ 101060, 129718, 0, 0, 74079, 65873, 0, 0, 0, 9501, 0, 68081, 72808,
+ 65465, 64654, 7467, 0, 0, 83460, 10040, 0, 3096, 0, 101053, 101052,
+ 68820, 83461, 0, 0, 0, 0, 0, 0, 83377, 0, 68801, 0, 101062, 101061,
+ 101064, 101063, 0, 8637, 70741, 0, 77983, 77969, 11471, 43554, 0, 77968,
+ 0, 0, 0, 2426, 12042, 0, 0, 0, 3961, 12115, 129633, 0, 77972, 64561, 0,
+ 4981, 74644, 129558, 0, 0, 42686, 77976, 128776, 64686, 0, 77958, 7589,
+ 0, 0, 3237, 0, 68215, 0, 8541, 127157, 71067, 120174, 0, 0, 0, 0, 0,
+ 43555, 0, 0, 10060, 111261, 100917, 0, 0, 0, 64877, 0, 0, 8614, 65220,
+ 41493, 0, 0, 0, 43780, 0, 0, 70689, 0, 0, 0, 0, 0, 0, 4012, 10395, 0, 0,
+ 111253, 126511, 111254, 125051, 695, 739, 696, 7611, 0, 42755, 68421,
+ 9227, 7506, 7510, 67493, 691, 738, 7511, 7512, 7515, 7501, 688, 41847,
+ 690, 2548, 737, 974, 43386, 0, 0, 0, 0, 0, 0, 65860, 0, 7051, 69777,
+ 4682, 0, 983096, 6406, 4685, 0, 0, 10347, 4680, 6341, 0, 0, 92607, 74325,
+ 0, 123555, 0, 0, 0, 0, 0, 0, 43505, 92468, 11718, 42373, 11714, 0, 0,
+ 129567, 11717, 0, 10594, 129732, 11712, 122962, 0, 10967, 0, 0, 0, 66632,
+ 118647, 0, 0, 0, 1735, 0, 11134, 2363, 983136, 0, 0, 70695, 128032, 0,
+ 7491, 7495, 7580, 7496, 7497, 7584, 121478, 127853, 0, 0, 70025, 0, 8498,
+ 0, 8949, 3065, 0, 0, 0, 0, 0, 0, 11713, 0, 64939, 0, 6418, 4543, 0, 0, 0,
+ 74800, 0, 0, 0, 0, 0, 0, 0, 12282, 3165, 0, 0, 64556, 0, 9238, 0, 68063,
+ 0, 0, 0, 65438, 0, 128525, 0, 119268, 0, 0, 12900, 67489, 10950, 0, 0, 0,
+ 41400, 126636, 119664, 0, 42232, 0, 1744, 0, 41402, 0, 0, 0, 41399, 0,
+ 125028, 0, 0, 12690, 0, 0, 43672, 0, 0, 0, 100870, 11315, 0, 278, 121204,
+ 41405, 129345, 0, 10077, 129650, 70667, 0, 0, 0, 68210, 0, 0, 11189,
+ 70657, 0, 0, 0, 7934, 0, 93829, 120940, 0, 0, 122971, 0, 0, 0, 6413,
+ 6550, 0, 1940, 2809, 43637, 70045, 0, 0, 10678, 0, 0, 0, 129701, 78804,
+ 6403, 6556, 78803, 0, 0, 123557, 0, 0, 0, 123553, 0, 3742, 74408, 3959,
+ 0, 0, 917969, 123565, 0, 128024, 0, 123558, 127956, 0, 0, 0, 6855, 4676,
+ 983049, 9210, 0, 78143, 983922, 0, 78168, 983100, 11540, 43546, 6692, 0,
+ 0, 0, 0, 9083, 0, 0, 78144, 128515, 0, 9677, 0, 70867, 74175, 0, 74070,
+ 0, 0, 365, 0, 43027, 0, 0, 128236, 0, 119574, 70284, 13151, 0, 0, 127935,
+ 127950, 544, 13249, 119018, 0, 120846, 0, 0, 73671, 65339, 73000, 2211,
+ 0, 0, 0, 0, 0, 0, 0, 0, 128037, 0, 0, 0, 0, 0, 0, 0, 127188, 92977,
+ 69708, 9638, 0, 100878, 0, 0, 0, 74545, 128820, 128819, 75062, 128963, 0,
+ 0, 0, 11264, 43994, 0, 0, 0, 1311, 0, 0, 0, 0, 13068, 0, 0, 78164, 78155,
+ 0, 949, 0, 0, 0, 78176, 69709, 78177, 63828, 0, 0, 118629, 70282, 0, 0,
+ 0, 64822, 0, 6530, 983275, 0, 70493, 0, 129325, 0, 0, 4431, 118839,
+ 127490, 983760, 73667, 127986, 0, 10336, 10400, 0, 0, 92959, 0, 0, 0,
+ 42270, 128880, 6428, 0, 0, 0, 0, 43455, 0, 43526, 100888, 12835, 129501,
+ 9493, 0, 0, 11793, 0, 127897, 74394, 0, 10653, 0, 0, 0, 0, 6560, 7016,
+ 74274, 983627, 43556, 3929, 123615, 6614, 2768, 0, 65609, 0, 11811,
+ 129696, 0, 118615, 127513, 0, 6554, 0, 6305, 66283, 4675, 118826, 78552,
+ 0, 0, 74361, 0, 0, 68108, 0, 0, 92232, 0, 93022, 7392, 8230, 9365,
+ 983742, 0, 0, 0, 0, 42925, 0, 0, 122965, 0, 229, 43834, 119884, 0, 43552,
+ 119881, 119880, 119883, 119882, 119877, 119876, 119879, 119878, 119873,
+ 119872, 119875, 119874, 0, 0, 0, 0, 0, 66352, 0, 0, 0, 128663, 0, 12239,
+ 0, 0, 10432, 12097, 0, 194815, 1233, 78179, 0, 127200, 0, 66395, 0, 0,
+ 129504, 0, 0, 92342, 0, 2388, 92555, 119868, 119871, 119870, 119865, 895,
+ 92668, 119866, 64889, 7143, 119863, 119862, 0, 0, 69983, 0, 74376, 3053,
+ 2168, 0, 2047, 0, 0, 0, 121279, 67985, 194801, 92600, 194803, 194802,
+ 194805, 194804, 194807, 194806, 129134, 194808, 0, 0, 0, 10473, 129331,
+ 0, 194810, 129806, 194812, 129813, 194814, 194813, 123195, 43528, 69673,
+ 194791, 0, 194793, 1912, 120779, 10306, 10370, 0, 0, 8867, 10250, 10258,
+ 10274, 1635, 120152, 0, 0, 0, 129379, 0, 0, 9919, 120148, 559, 128157,
+ 41825, 127975, 92989, 0, 74016, 194781, 6542, 41957, 7318, 124126, 0,
+ 41956, 65749, 65750, 65751, 121323, 64487, 0, 0, 10223, 42062, 100640,
+ 101195, 125044, 3668, 65754, 43560, 12226, 0, 93973, 194784, 41959,
+ 194786, 194785, 194788, 43618, 65747, 10937, 2962, 0, 2953, 10062, 65745,
+ 71457, 8921, 66013, 129370, 0, 194769, 194768, 43409, 194770, 2949,
+ 194772, 194775, 194774, 2958, 194776, 74868, 2300, 2951, 120061, 0,
+ 120043, 194778, 0, 120051, 194779, 120056, 120065, 70798, 120048, 0,
+ 120062, 120055, 71989, 100668, 0, 0, 71985, 0, 71992, 70796, 127818, 0,
+ 0, 64890, 0, 43630, 11336, 799, 0, 10276, 10308, 10372, 917541, 0, 0,
+ 10252, 10260, 68220, 55284, 125225, 0, 10384, 0, 0, 0, 64523, 129744, 0,
+ 65736, 0, 0, 0, 0, 0, 0, 0, 124912, 43549, 65738, 42150, 65739, 0, 78195,
+ 10288, 10320, 0, 10596, 129829, 67673, 65045, 121283, 78198, 2049, 10098,
+ 0, 122904, 127943, 10264, 10280, 10312, 10376, 7013, 0, 69504, 0, 0,
+ 66375, 0, 4862, 0, 6537, 0, 128335, 3914, 92178, 93976, 9065, 64816, 0,
+ 72218, 73026, 0, 0, 72139, 4694, 11420, 4690, 0, 0, 983211, 4693, 0, 0,
+ 0, 4688, 0, 0, 128892, 0, 8238, 3110, 0, 983939, 0, 6528, 0, 0, 0, 218,
+ 0, 1520, 129577, 70039, 0, 983594, 0, 120167, 78167, 10088, 6548, 100786,
+ 0, 0, 0, 8888, 0, 124954, 0, 0, 126593, 68876, 0, 0, 0, 0, 0, 0, 0, 4689,
+ 43541, 77954, 120157, 0, 120156, 78810, 120163, 0, 0, 0, 0, 78121, 0, 0,
+ 11450, 0, 71900, 92613, 0, 121317, 74622, 128720, 9244, 0, 0, 127763, 0,
+ 0, 0, 0, 0, 0, 71084, 0, 0, 0, 0, 10513, 0, 0, 0, 52, 119178, 0, 0,
+ 93961, 0, 0, 4812, 0, 0, 0, 0, 0, 0, 128425, 0, 6850, 0, 77959, 10170,
+ 120450, 6544, 0, 0, 69782, 121517, 0, 0, 65258, 10369, 0, 1585, 74014,
+ 10249, 422, 1500, 2036, 986, 0, 64394, 69502, 5599, 917981, 2494, 0, 0,
+ 74021, 983896, 78203, 127808, 0, 72871, 65102, 8961, 74305, 10243, 10245,
+ 128170, 0, 0, 0, 0, 0, 2508, 129591, 120440, 0, 120439, 0, 0, 0, 0, 0, 0,
+ 64533, 983187, 0, 0, 74008, 0, 0, 43375, 0, 2504, 0, 121313, 0, 983941,
+ 6943, 0, 5859, 100677, 0, 0, 72873, 983945, 0, 0, 983923, 92390, 2753,
+ 1936, 2153, 67701, 2751, 12662, 2763, 8953, 0, 10731, 0, 7052, 0, 0, 0,
+ 0, 119899, 0, 66675, 0, 119897, 0, 71053, 0, 119903, 0, 67829, 7899,
+ 119901, 71119, 43798, 7072, 119902, 122898, 11260, 0, 71059, 0, 0, 212,
+ 0, 12350, 0, 0, 0, 0, 0, 128402, 2759, 0, 0, 93064, 0, 0, 0, 1291, 0,
+ 195065, 121318, 119911, 0, 119910, 0, 12062, 0, 121216, 0, 129124,
+ 121044, 120611, 8246, 128874, 0, 0, 0, 0, 0, 73962, 0, 0, 43524, 0,
+ 64426, 0, 0, 0, 0, 65664, 6693, 0, 0, 8674, 0, 128812, 0, 11846, 70690,
+ 121461, 69395, 4811, 0, 5986, 0, 3046, 74480, 5985, 0, 0, 0, 0, 12187,
+ 83148, 71041, 5984, 0, 93817, 4393, 126264, 120206, 917599, 0, 0, 0,
+ 93806, 93805, 0, 3491, 0, 67146, 0, 93819, 0, 72428, 0, 0, 0, 124968,
+ 41284, 126228, 0, 0, 41287, 0, 100689, 0, 0, 92189, 0, 0, 219, 120874, 0,
+ 0, 0, 68485, 119672, 43241, 0, 7147, 73554, 0, 0, 0, 0, 0, 64610, 11804,
+ 0, 7149, 64808, 0, 0, 0, 92301, 73690, 0, 5253, 0, 0, 0, 0, 129045,
+ 983596, 11098, 68433, 0, 120484, 111009, 0, 0, 0, 0, 0, 70801, 100779, 0,
+ 128198, 9604, 0, 130036, 0, 0, 118941, 64392, 0, 118684, 0, 0, 41974,
+ 126262, 0, 0, 0, 129818, 0, 129833, 0, 0, 0, 0, 0, 983243, 5308, 0, 290,
+ 0, 125278, 128382, 2792, 0, 0, 120521, 0, 126237, 0, 126099, 0, 0, 0, 0,
+ 128503, 0, 0, 72816, 0, 0, 0, 92671, 0, 195061, 42646, 7606, 2591, 73896,
+ 0, 43513, 64482, 0, 0, 65270, 0, 0, 983701, 9112, 0, 113763, 9490, 0, 0,
+ 0, 0, 0, 9071, 0, 0, 0, 0, 74607, 0, 2535, 65504, 43602, 0, 0, 71256,
+ 2248, 0, 123147, 11845, 11006, 92315, 7807, 8073, 0, 10629, 0, 74088, 0,
+ 10823, 0, 113762, 8762, 0, 69689, 123536, 43969, 65047, 10737, 3463,
+ 67467, 129585, 66645, 0, 4815, 0, 0, 12345, 983761, 0, 5195, 129808, 0,
+ 66639, 0, 0, 66941, 0, 92759, 92385, 1262, 0, 6561, 19939, 0, 0, 100772,
+ 123160, 69269, 0, 100774, 0, 0, 0, 0, 0, 0, 67511, 0, 0, 0, 0, 0, 0,
+ 5702, 3655, 0, 8430, 0, 68807, 0, 0, 121137, 0, 0, 5254, 0, 0, 124917, 0,
+ 119107, 5129, 0, 70816, 0, 92280, 5614, 0, 0, 11720, 0, 11721, 70804,
+ 4798, 0, 120541, 66038, 4793, 67851, 7352, 0, 0, 0, 0, 917600, 0, 300, 0,
+ 0, 128575, 92660, 0, 0, 2562, 70156, 120856, 0, 0, 92738, 0, 0, 127820,
+ 71093, 0, 127969, 128221, 0, 3424, 93843, 0, 0, 7074, 70873, 128519, 0,
+ 0, 10832, 0, 0, 69852, 72430, 0, 0, 0, 0, 0, 176, 0, 0, 0, 0, 0, 1215, 0,
+ 5744, 0, 66440, 0, 0, 0, 42881, 0, 8980, 118988, 67861, 8844, 7433, 0, 0,
+ 4278, 124925, 0, 0, 70821, 9312, 4348, 0, 128401, 65946, 0, 7087, 5255,
+ 0, 661, 0, 0, 0, 0, 0, 0, 0, 121009, 73694, 0, 123154, 0, 73688, 0,
+ 127179, 3621, 83325, 66666, 72968, 0, 6562, 12928, 0, 73991, 0, 0, 11383,
+ 0, 0, 65588, 120739, 0, 0, 0, 0, 0, 0, 0, 0, 11436, 2070, 64, 110824, 0,
+ 10291, 10323, 10387, 0, 0, 0, 42008, 9708, 42710, 0, 42011, 0, 92164, 0,
+ 0, 1702, 1240, 128383, 6286, 9689, 111080, 0, 0, 0, 1765, 0, 0, 92373, 0,
+ 0, 0, 8401, 72991, 42014, 0, 67237, 0, 0, 0, 0, 0, 0, 0, 70819, 0, 0, 0,
+ 0, 12667, 0, 0, 10147, 0, 127568, 126483, 72812, 0, 0, 0, 0, 123139,
+ 128968, 0, 64947, 0, 0, 0, 0, 10435, 11462, 0, 7084, 0, 0, 0, 0, 0,
+ 126084, 0, 66662, 0, 0, 0, 0, 125134, 0, 0, 77990, 263, 983747, 41288,
+ 127953, 0, 78387, 74340, 70313, 129140, 0, 0, 0, 42022, 71265, 0, 0, 0,
+ 0, 0, 0, 42020, 123146, 0, 6992, 42019, 0, 41290, 0, 12295, 126233,
+ 71304, 0, 120984, 71300, 120631, 5954, 64931, 69385, 100699, 198, 68453,
+ 78129, 0, 121351, 0, 70818, 13165, 7107, 0, 42804, 678, 72850, 118960, 0,
+ 72985, 42806, 42808, 0, 0, 2097, 0, 120560, 70823, 0, 0, 3892, 68632, 0,
+ 6712, 917959, 0, 0, 0, 0, 123158, 69954, 0, 497, 12100, 5953, 92667,
+ 7796, 0, 43254, 0, 0, 11072, 5952, 1281, 43747, 0, 69380, 10677, 0, 0, 0,
+ 1859, 0, 72856, 3425, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65199, 1738, 0,
+ 122911, 0, 0, 0, 11101, 0, 0, 0, 0, 127002, 69651, 4436, 194683, 73984,
+ 6860, 70305, 64872, 128296, 0, 0, 0, 121377, 0, 6862, 0, 6861, 983109, 0,
+ 119109, 0, 70826, 319, 0, 43479, 73001, 0, 0, 12849, 0, 7640, 71083,
+ 9673, 0, 0, 0, 92670, 0, 92665, 113717, 41422, 0, 100708, 74941, 3772, 0,
+ 120660, 5011, 0, 0, 126587, 111315, 0, 0, 6677, 111312, 0, 41427, 64419,
+ 129445, 92262, 0, 70799, 0, 0, 0, 6106, 0, 41271, 6760, 983758, 4534,
+ 41270, 128876, 0, 0, 119561, 0, 0, 3671, 8976, 123177, 0, 41275, 0,
+ 128084, 55261, 0, 42013, 0, 568, 0, 41273, 0, 0, 6728, 0, 9715, 0, 0,
+ 121058, 74820, 0, 92268, 0, 194564, 11191, 43688, 128023, 0, 0, 0,
+ 126266, 0, 0, 0, 11958, 11165, 0, 125087, 0, 0, 66336, 127944, 0, 0, 0,
+ 0, 42858, 11789, 72878, 5557, 0, 69444, 7300, 0, 9467, 5558, 64486,
+ 43844, 0, 0, 6706, 10146, 0, 127185, 64566, 0, 0, 0, 0, 0, 0, 0, 4546, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 64528, 123136, 6307, 128966, 0, 7544, 0, 43469,
+ 111317, 0, 10152, 0, 65091, 0, 129047, 0, 0, 66652, 0, 0, 0, 0, 64823,
+ 5559, 0, 70711, 6702, 5556, 0, 0, 0, 0, 0, 11166, 0, 0, 5506, 0, 1911,
+ 73021, 0, 12598, 8845, 66698, 0, 73012, 123145, 73496, 2098, 0, 0, 0,
+ 66622, 194678, 0, 0, 0, 9898, 0, 0, 7552, 0, 0, 0, 7223, 65723, 0, 0, 0,
+ 7024, 65728, 127155, 1210, 0, 65175, 10184, 65726, 43654, 0, 0, 0, 38,
+ 65729, 66669, 0, 917948, 0, 0, 0, 0, 119837, 0, 74233, 73018, 119843,
+ 42860, 111301, 92576, 65721, 65722, 0, 0, 0, 0, 68843, 0, 68850, 0,
+ 92388, 92267, 128536, 65577, 42967, 0, 127518, 11650, 5013, 92663, 68810,
+ 92568, 118914, 6613, 74371, 0, 0, 122985, 0, 64714, 71479, 0, 983797,
+ 12120, 0, 0, 43124, 0, 0, 78037, 69263, 0, 126219, 0, 0, 1837, 125086, 0,
+ 0, 0, 127210, 4952, 65718, 64405, 5504, 65720, 65714, 65715, 65716,
+ 10403, 127005, 0, 41449, 0, 74028, 72019, 0, 119234, 1127, 455, 0, 0,
+ 72860, 3483, 0, 1989, 0, 69678, 9104, 0, 65375, 0, 0, 0, 1864, 0, 72810,
+ 8107, 2540, 0, 0, 11257, 128807, 119576, 0, 120999, 0, 73501, 8604, 0, 0,
+ 0, 0, 128270, 0, 0, 3115, 0, 10106, 120498, 118842, 101136, 0, 9631, 0,
+ 0, 0, 0, 0, 0, 0, 258, 129079, 0, 0, 0, 92292, 0, 70699, 0, 11478, 0,
+ 129640, 11522, 0, 8549, 0, 128430, 0, 0, 0, 0, 0, 0, 123140, 0, 0, 0,
+ 9221, 12590, 73048, 0, 0, 0, 67741, 111294, 12619, 0, 10154, 111266,
+ 74439, 2039, 0, 7446, 0, 111276, 10974, 458, 72831, 0, 0, 0, 11916, 0, 0,
+ 69671, 0, 121057, 12288, 0, 111288, 0, 111289, 983177, 0, 128199, 13080,
+ 0, 67828, 6610, 6030, 8059, 7508, 123170, 0, 0, 0, 0, 41278, 129393,
+ 118691, 128192, 41277, 64658, 984002, 101278, 6625, 983160, 19904, 0, 0,
+ 0, 0, 0, 0, 833, 0, 6369, 0, 0, 42664, 0, 0, 0, 0, 129765, 0, 6913, 933,
+ 1341, 68828, 6720, 0, 0, 983604, 0, 0, 7405, 128025, 0, 0, 0, 0, 0, 0, 0,
+ 70704, 0, 0, 0, 0, 9716, 0, 0, 0, 70719, 0, 0, 0, 0, 72862, 70687, 0,
+ 93987, 0, 0, 0, 70721, 9573, 0, 0, 111245, 83225, 83226, 6949, 126482,
+ 74061, 83222, 83223, 83224, 0, 19962, 83219, 83220, 0, 111233, 0, 42830,
+ 0, 111234, 74236, 66276, 0, 546, 72861, 0, 70661, 0, 472, 11083, 10319,
+ 10383, 917971, 0, 83202, 83203, 3602, 83206, 41182, 83199, 83200, 69796,
+ 3790, 0, 10271, 10287, 684, 0, 0, 0, 83214, 4592, 83216, 83217, 83210,
+ 11963, 43620, 83213, 0, 0, 83208, 83209, 0, 92623, 128559, 3415, 0,
+ 121267, 0, 0, 123151, 43447, 0, 92212, 0, 418, 0, 0, 10295, 10327, 10391,
+ 0, 83189, 83190, 83192, 83194, 83185, 83186, 83187, 83188, 120879, 0,
+ 41446, 70700, 118652, 0, 120809, 10599, 66892, 0, 0, 0, 0, 0, 129184,
+ 11437, 0, 0, 0, 0, 0, 0, 12624, 0, 41185, 72865, 69439, 8159, 0, 11686,
+ 71478, 65224, 0, 4655, 0, 0, 92183, 0, 10343, 10407, 0, 0, 0, 111221, 0,
+ 0, 0, 94057, 68201, 129574, 0, 983572, 72156, 42792, 5743, 10424, 0, 0,
+ 0, 0, 0, 8875, 111225, 0, 917991, 13117, 12847, 4651, 118917, 0, 962, 0,
+ 0, 2242, 42564, 0, 1582, 0, 5508, 0, 0, 0, 10801, 123602, 118798, 73705,
+ 0, 66911, 10439, 66891, 0, 0, 7860, 0, 906, 917985, 0, 6405, 64722, 0,
+ 83266, 64694, 83268, 917990, 1153, 83263, 64788, 83265, 0, 12626, 83260,
+ 83261, 9964, 0, 0, 4642, 66574, 127886, 0, 0, 0, 0, 0, 9008, 100847, 0,
+ 0, 0, 83248, 917976, 917993, 123173, 42842, 83244, 83245, 83247, 83239,
+ 83240, 83241, 83242, 0, 11335, 92661, 83238, 3920, 0, 0, 0, 83255, 83256,
+ 41967, 83258, 83251, 83252, 83253, 8920, 0, 0, 83249, 83250, 0, 0, 43919,
+ 0, 0, 0, 0, 128021, 0, 68113, 65196, 0, 0, 128472, 0, 10111, 64875, 0,
+ 83491, 43998, 83232, 83233, 83234, 70691, 83228, 42149, 83230, 68508, 0,
+ 0, 0, 0, 0, 0, 0, 4110, 66005, 74034, 0, 0, 0, 66703, 0, 0, 983158, 6025,
+ 69242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70733, 0, 983043, 0, 73513, 0, 68817,
+ 0, 0, 0, 0, 0, 0, 43286, 0, 68765, 0, 0, 0, 0, 129871, 65144, 0, 0,
+ 83236, 65840, 0, 0, 10081, 0, 0, 983912, 0, 0, 0, 127394, 65882, 0,
+ 128758, 0, 0, 3605, 10985, 0, 0, 128872, 93972, 1745, 0, 73835, 0, 0, 0,
+ 0, 0, 0, 8806, 7023, 0, 0, 0, 70702, 70304, 0, 0, 0, 0, 0, 0, 0, 0, 348,
+ 10089, 0, 9017, 0, 0, 0, 0, 0, 0, 0, 67465, 0, 42515, 0, 0, 0, 0, 5391,
+ 983240, 110576, 0, 0, 5561, 0, 9429, 0, 67150, 7933, 5562, 0, 0, 0, 0,
+ 78039, 0, 0, 0, 0, 3979, 71248, 0, 0, 0, 68847, 0, 0, 118847, 65847,
+ 68836, 68838, 0, 10585, 0, 92676, 7334, 0, 0, 0, 831, 0, 0, 10716, 0,
+ 121325, 0, 12218, 0, 6939, 70697, 65042, 0, 0, 916, 0, 0, 11968, 0,
+ 122641, 5563, 0, 0, 128830, 5560, 41212, 41774, 0, 4497, 0, 0, 0, 9039,
+ 70678, 41776, 0, 8716, 3567, 119252, 0, 0, 74260, 0, 93954, 0, 0, 100827,
+ 0, 128879, 70072, 68355, 68357, 0, 0, 8634, 0, 0, 4209, 120702, 68832,
+ 65879, 68825, 68819, 68822, 0, 5679, 68813, 68815, 68811, 68812, 64697,
+ 5678, 11821, 68802, 93969, 0, 0, 0, 0, 70114, 0, 0, 0, 0, 0, 0, 0, 0,
+ 7782, 0, 0, 0, 0, 129977, 65711, 65712, 1216, 0, 69409, 5792, 0, 0, 0, 0,
+ 0, 12244, 0, 5683, 0, 120895, 121336, 43448, 70670, 0, 0, 5682, 10242,
+ 75043, 74520, 5680, 917568, 10001, 0, 0, 1449, 10241, 0, 70708, 0, 0,
+ 83180, 83182, 83183, 8584, 83176, 5567, 83178, 83179, 0, 5564, 42886,
+ 42884, 42882, 5565, 119022, 120881, 0, 65708, 65709, 5566, 0, 65704,
+ 65705, 11904, 42875, 0, 42873, 5942, 0, 0, 10361, 10425, 65697, 65698,
+ 65699, 0, 66598, 0, 64664, 10647, 78702, 78703, 78690, 78700, 0, 65701,
+ 1934, 0, 0, 0, 78710, 0, 78706, 78709, 6087, 78705, 78716, 78719, 78711,
+ 8043, 8950, 65694, 64485, 0, 10457, 0, 78724, 78725, 78722, 72332, 78720,
+ 78721, 0, 65515, 0, 10035, 13069, 0, 0, 127773, 0, 0, 0, 125207, 0, 0,
+ 1667, 0, 0, 42428, 110950, 0, 0, 41750, 0, 0, 93999, 0, 8101, 3610,
+ 113670, 41748, 110948, 0, 78394, 119208, 0, 0, 113691, 64549, 68359, 0,
+ 0, 65692, 92701, 0, 917960, 12896, 10456, 68298, 0, 0, 0, 0, 917962, 0,
+ 0, 113665, 70502, 0, 65687, 0, 0, 74009, 0, 113673, 8536, 70671, 0,
+ 78726, 0, 724, 0, 113675, 78749, 9975, 78746, 78747, 78744, 4175, 78741,
+ 78743, 78751, 939, 0, 128799, 983120, 0, 0, 0, 78763, 78764, 78760,
+ 78761, 78758, 78759, 78755, 8425, 0, 0, 0, 8188, 0, 0, 0, 0, 0, 6370, 0,
+ 7827, 68441, 75008, 0, 917943, 0, 118863, 0, 0, 0, 0, 121243, 73988, 0,
+ 113668, 0, 11012, 0, 43764, 178, 12972, 74620, 113671, 0, 113735, 0,
+ 66764, 0, 0, 65690, 72339, 0, 0, 917950, 9252, 0, 4652, 74259, 0, 917947,
+ 0, 0, 0, 10806, 0, 0, 70016, 0, 6723, 0, 0, 6993, 0, 0, 12855, 0, 0,
+ 11390, 0, 0, 0, 92503, 0, 0, 983162, 125270, 92627, 8278, 0, 4034, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 12750, 9350, 66037, 0, 0, 73700, 12747, 0, 0,
+ 128064, 8922, 74640, 0, 0, 43150, 0, 983090, 983088, 66779, 66777, 10813,
+ 2592, 43139, 0, 0, 118612, 0, 0, 71891, 0, 0, 0, 0, 0, 0, 71697, 0,
+ 128825, 1596, 0, 0, 0, 0, 6838, 66572, 0, 126574, 120627, 8092, 12805,
+ 41928, 0, 78406, 78409, 0, 0, 0, 9931, 0, 0, 0, 0, 0, 983778, 6107, 0, 0,
+ 0, 0, 128745, 0, 335, 127003, 64689, 0, 0, 5765, 0, 0, 119227, 6092,
+ 118851, 0, 8876, 83465, 74947, 83455, 129186, 83454, 70713, 0, 0, 126606,
+ 70121, 41602, 0, 92308, 74831, 0, 11783, 68482, 0, 0, 0, 0, 0, 0, 843, 0,
+ 71099, 0, 0, 41935, 0, 0, 0, 0, 1371, 0, 43818, 43159, 8069, 9579, 41938,
+ 41608, 0, 92444, 6242, 0, 0, 128595, 128244, 0, 92499, 8805, 1742,
+ 113722, 0, 8202, 72399, 0, 983198, 0, 0, 73882, 100809, 0, 43467, 123636,
+ 55290, 0, 1712, 5932, 0, 41762, 71982, 0, 11967, 1775, 0, 75009, 0,
+ 11868, 120387, 9458, 0, 126614, 0, 0, 43176, 101032, 101031, 42782,
+ 101033, 101036, 101035, 101038, 101037, 101040, 101039, 0, 0, 0, 0,
+ 101041, 5794, 92274, 2662, 101045, 101044, 8254, 101046, 10975, 101048,
+ 120625, 101050, 917977, 4108, 8478, 917982, 194790, 0, 92263, 917980,
+ 7507, 0, 43149, 0, 65031, 7961, 1636, 0, 65029, 0, 129665, 70188, 9674,
+ 0, 99, 98, 97, 101022, 92203, 4049, 101027, 43880, 7090, 101028, 0,
+ 101030, 66589, 0, 65310, 66593, 66599, 129805, 0, 0, 7447, 66594, 0, 0,
+ 0, 73920, 66595, 66596, 42570, 5593, 0, 0, 0, 0, 6061, 64854, 119, 118,
+ 117, 116, 0, 122, 121, 120, 111, 110, 109, 108, 115, 114, 113, 112, 103,
+ 102, 101, 100, 107, 106, 105, 104, 128504, 73974, 534, 0, 67713, 1536,
+ 73973, 73970, 0, 129671, 0, 6020, 12716, 0, 12744, 65143, 0, 13266,
+ 127813, 0, 0, 0, 127116, 0, 1212, 65560, 0, 8134, 42935, 12129, 73870, 0,
+ 1866, 0, 122948, 0, 0, 65073, 12059, 66585, 121391, 0, 0, 0, 5935, 1250,
+ 0, 8174, 9787, 6733, 9859, 9858, 9861, 9860, 101012, 1882, 1892, 6731,
+ 10882, 10795, 101018, 73911, 101020, 101019, 41169, 8939, 0, 120713,
+ 41170, 1454, 0, 65130, 69732, 0, 0, 129611, 41172, 7855, 0, 71472, 0, 0,
+ 0, 71691, 65901, 0, 0, 645, 100992, 100991, 100994, 100993, 100996,
+ 100995, 100998, 65587, 0, 10688, 0, 0, 7729, 0, 101001, 120518, 101003,
+ 66722, 101005, 101004, 68415, 101006, 4538, 101008, 43141, 0, 0, 73699,
+ 0, 0, 0, 71918, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71454, 0, 2381, 983752, 0, 0,
+ 69857, 100981, 0, 100983, 100982, 100985, 10856, 100987, 55255, 41478,
+ 8582, 10064, 0, 0, 0, 0, 64896, 0, 74609, 0, 128048, 10082, 11575, 0, 0,
+ 0, 917505, 0, 6145, 75020, 0, 92433, 71916, 83279, 43186, 0, 0, 83274,
+ 83276, 83277, 83278, 10191, 83271, 69633, 72353, 0, 0, 0, 0, 120090,
+ 120089, 7931, 8558, 917946, 0, 0, 0, 119145, 120081, 120084, 120083,
+ 120086, 71449, 120088, 7366, 7019, 75021, 0, 917951, 120078, 120077,
+ 120080, 8657, 100967, 8594, 100969, 100968, 0, 100970, 120072, 120071, 0,
+ 0, 43154, 0, 0, 11332, 0, 7728, 100978, 100977, 100980, 100979, 7851, 0,
+ 8375, 128662, 0, 0, 126095, 9085, 0, 0, 9327, 6160, 0, 0, 0, 0, 70698,
+ 74012, 0, 0, 4439, 121151, 100972, 100971, 100974, 100973, 100976,
+ 100975, 100956, 42524, 71220, 100957, 10826, 100959, 11296, 0, 0, 0,
+ 7504, 43161, 127868, 0, 64670, 0, 78056, 0, 11295, 0, 78053, 0, 0, 0,
+ 10902, 0, 0, 122650, 78068, 10472, 100954, 100953, 120215, 78062, 2371,
+ 78069, 118893, 259, 0, 0, 2402, 12157, 6440, 0, 100963, 100962, 100965,
+ 100964, 65380, 9103, 2278, 0, 0, 7301, 0, 10219, 0, 0, 0, 67718, 43178,
+ 0, 120214, 119362, 917974, 8613, 0, 126121, 917978, 917979, 121449,
+ 12005, 7353, 0, 1890, 129130, 0, 0, 0, 42815, 7991, 0, 10578, 0, 0, 0, 0,
+ 0, 0, 0, 111190, 120601, 42668, 9348, 0, 6164, 0, 0, 0, 7676, 0, 0, 0, 0,
+ 128732, 129422, 83443, 71096, 83444, 9175, 0, 78047, 9088, 73689, 0,
+ 1396, 0, 0, 11461, 71088, 127835, 92252, 0, 71090, 121185, 69872, 0, 0,
+ 0, 0, 74043, 119632, 0, 0, 0, 5928, 4525, 10658, 0, 1266, 10180, 64472,
+ 0, 12622, 0, 0, 0, 0, 127139, 13310, 773, 19933, 0, 0, 0, 0, 92205, 0, 0,
+ 0, 0, 5862, 7823, 0, 0, 0, 3250, 43991, 69687, 66649, 0, 0, 0, 0, 0,
+ 64673, 917963, 917964, 0, 0, 917967, 917968, 917965, 917966, 127791,
+ 75041, 3471, 917970, 64573, 882, 0, 119584, 0, 120772, 0, 0, 0, 92696, 0,
+ 0, 72988, 0, 3225, 0, 73729, 0, 0, 43173, 11752, 4381, 0, 0, 917945,
+ 11756, 11757, 917944, 917949, 42654, 127848, 118663, 0, 0, 5160, 1387, 0,
+ 917953, 0, 128933, 917956, 917957, 917954, 917955, 118595, 121082,
+ 917958, 10789, 68314, 0, 126521, 11143, 0, 0, 70669, 128904, 42179, 0,
+ 5931, 11744, 11215, 70676, 119245, 0, 0, 0, 77915, 10217, 64635, 128661,
+ 83292, 0, 0, 0, 0, 0, 41296, 11747, 41291, 0, 0, 0, 41294, 41282, 5923,
+ 120610, 0, 0, 0, 0, 66800, 5786, 68252, 42539, 119869, 119860, 0, 41474,
+ 0, 0, 0, 5934, 74572, 66583, 119231, 0, 94072, 64481, 0, 0, 0, 0, 67240,
+ 0, 0, 123201, 0, 5819, 0, 0, 0, 0, 0, 129387, 0, 0, 0, 67993, 1237,
+ 194749, 0, 0, 983557, 0, 0, 0, 0, 0, 0, 0, 69789, 11266, 69845, 0, 10506,
+ 194747, 0, 0, 0, 0, 43185, 194748, 100533, 100532, 100535, 10769, 100537,
+ 100536, 100539, 9753, 121035, 100540, 0, 0, 121433, 0, 100542, 6072,
+ 100544, 100543, 100546, 100545, 100548, 100547, 100550, 100549, 0,
+ 113744, 0, 0, 7222, 10283, 10315, 10379, 4996, 0, 129294, 66517, 0,
+ 10087, 127833, 74938, 0, 0, 83492, 7565, 42890, 0, 73520, 43180, 77928,
+ 74891, 77929, 43982, 100526, 622, 77926, 100527, 100530, 1602, 0, 0, 0,
+ 129559, 12160, 0, 10212, 77936, 194605, 12071, 43143, 77935, 917983,
+ 917984, 917989, 77932, 917987, 917988, 10255, 10263, 10279, 4194, 10375,
+ 93035, 0, 0, 12644, 127516, 917994, 75007, 110791, 67408, 110789, 11501,
+ 41177, 0, 0, 71912, 0, 0, 8715, 0, 41179, 0, 0, 0, 41176, 0, 41181, 0,
+ 8452, 121006, 13161, 0, 70503, 5921, 0, 2597, 0, 5922, 72128, 0, 74242,
+ 128374, 0, 0, 0, 0, 0, 0, 0, 127906, 0, 64944, 0, 0, 0, 0, 5924, 5920,
+ 129508, 6921, 78081, 74007, 78078, 8418, 11681, 43169, 10176, 0, 0, 0,
+ 78087, 10772, 65276, 5937, 1914, 78084, 11682, 0, 0, 0, 11685, 0, 100513,
+ 7772, 11680, 100514, 100517, 100516, 100519, 7417, 718, 100520, 70083,
+ 100500, 120718, 3235, 0, 43164, 0, 8018, 0, 0, 128708, 6937, 67672,
+ 128508, 0, 10067, 120849, 0, 0, 0, 118693, 0, 100491, 0, 100493, 100492,
+ 13116, 100494, 100497, 9945, 100499, 100498, 0, 0, 0, 0, 2059, 0, 100502,
+ 100501, 1431, 100503, 66565, 100505, 100508, 12804, 100510, 100509,
+ 78090, 3307, 78088, 78089, 0, 4544, 71228, 0, 0, 0, 78097, 11110, 66810,
+ 12882, 64511, 78094, 78100, 78102, 71226, 10141, 0, 78280, 65298, 4476,
+ 78109, 94005, 71216, 8907, 78105, 78106, 78103, 78104, 120898, 0, 10665,
+ 64616, 128944, 0, 127545, 69605, 83159, 83160, 4554, 0, 83155, 83156,
+ 83157, 83158, 0, 125123, 0, 72258, 129831, 0, 129815, 0, 43179, 0, 0, 0,
+ 717, 10754, 83168, 83169, 83162, 83163, 83164, 83165, 78282, 0, 0, 83161,
+ 68848, 10611, 72859, 126978, 71474, 129426, 127871, 0, 0, 0, 12820,
+ 110882, 0, 7009, 70103, 0, 0, 67848, 41173, 4574, 0, 0, 128338, 575,
+ 78110, 43456, 8563, 100469, 0, 0, 65565, 123598, 5936, 7290, 78117,
+ 78118, 74919, 308, 78113, 78114, 83151, 78123, 83153, 83154, 0, 0, 0, 0,
+ 67496, 5926, 68250, 78130, 78126, 78127, 78124, 78125, 42513, 0, 129026,
+ 0, 11651, 13093, 78135, 0, 100471, 0, 100473, 100472, 100475, 74048,
+ 100477, 71995, 100457, 100456, 43703, 13097, 0, 100460, 13283, 0, 0,
+ 125073, 3488, 5933, 10033, 983947, 0, 65570, 0, 12297, 0, 0, 0, 128517,
+ 42538, 0, 129293, 0, 100451, 0, 100453, 100452, 100455, 100454, 121221,
+ 0, 0, 7638, 0, 129193, 0, 43109, 7637, 0, 11213, 100461, 83355, 100463,
+ 100466, 100465, 0, 0, 7636, 0, 0, 0, 128848, 983087, 291, 0, 0, 2027,
+ 78141, 78142, 78136, 78137, 83481, 4640, 64713, 10224, 120429, 11183,
+ 83482, 120430, 0, 0, 0, 127148, 83479, 0, 0, 83488, 0, 0, 0, 0, 68837,
+ 5778, 0, 0, 0, 12680, 119130, 0, 67242, 93041, 0, 0, 0, 11552, 0, 127855,
+ 0, 70091, 0, 10172, 65453, 120408, 66014, 120410, 0, 4641, 11556, 64819,
+ 78269, 120416, 72341, 41469, 41467, 120412, 120415, 4646, 120425, 865,
+ 78275, 78274, 78273, 4645, 78271, 78270, 0, 983173, 7338, 0, 68840, 0,
+ 12565, 0, 0, 0, 195089, 119655, 195091, 195090, 2913, 13120, 128956,
+ 69493, 195097, 195096, 128019, 0, 71462, 0, 7916, 10485, 195098, 0,
+ 195100, 195099, 0, 67705, 128351, 195077, 195080, 129636, 129549, 195081,
+ 0, 0, 0, 10229, 10687, 826, 128081, 195082, 195085, 195084, 195087,
+ 195086, 0, 1808, 7848, 0, 0, 0, 0, 0, 0, 128897, 69255, 42942, 67704, 0,
+ 0, 0, 0, 42940, 0, 9144, 0, 0, 92992, 9840, 0, 0, 0, 0, 0, 0, 74448,
+ 83475, 0, 10962, 66904, 113718, 983188, 0, 0, 74537, 195072, 1792,
+ 195074, 195073, 78266, 195075, 0, 0, 12066, 0, 385, 4152, 0, 0, 0, 67397,
+ 0, 0, 0, 0, 43258, 0, 0, 13157, 0, 0, 3570, 0, 0, 0, 67252, 0, 71218,
+ 126631, 7879, 68247, 128579, 78914, 0, 70196, 0, 0, 8463, 7810, 917862,
+ 7839, 983878, 127768, 917860, 9691, 0, 129323, 0, 120385, 0, 917844, 0,
+ 10066, 0, 2175, 0, 0, 0, 8016, 0, 983072, 64831, 0, 126103, 0, 73493,
+ 1634, 68115, 94192, 11056, 0, 0, 0, 41165, 11328, 12450, 0, 41166, 0,
+ 12456, 0, 171, 67508, 12452, 917544, 12458, 12531, 0, 917853, 0, 74162,
+ 0, 0, 9969, 0, 12454, 74160, 42132, 110755, 78878, 110753, 3230, 73711,
+ 0, 0, 8932, 4399, 5810, 64534, 8415, 0, 110756, 110757, 74159, 0, 0, 960,
+ 74156, 6981, 92374, 12938, 9201, 0, 118713, 74904, 0, 72866, 92270, 0, 0,
+ 0, 129792, 5851, 73833, 5824, 0, 5844, 110848, 110849, 110846, 110847,
+ 4663, 0, 0, 0, 0, 0, 74085, 0, 0, 0, 0, 0, 92339, 0, 0, 5782, 67495, 0,
+ 0, 43796, 129639, 0, 195083, 125223, 128004, 0, 43861, 0, 0, 0, 92976, 0,
+ 0, 0, 4659, 0, 128894, 0, 0, 129386, 0, 11129, 2238, 329, 0, 92707,
+ 121416, 0, 0, 0, 69943, 67692, 42167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 69618, 43671, 0, 64701, 0, 0, 0, 93055, 1172, 125089, 6786, 43601, 0,
+ 74126, 0, 0, 0, 0, 0, 118695, 0, 0, 118804, 0, 66741, 5347, 125026,
+ 983663, 0, 0, 10588, 0, 0, 0, 0, 5343, 0, 0, 0, 5341, 0, 0, 74916, 5351,
+ 0, 0, 917884, 0, 92692, 0, 121148, 128916, 0, 0, 66785, 126256, 6638, 0,
+ 0, 271, 0, 917904, 0, 0, 12653, 67588, 0, 0, 0, 0, 128838, 11912, 128301,
+ 983665, 0, 11800, 0, 0, 11103, 0, 7340, 0, 110695, 0, 0, 70170, 0, 2423,
+ 0, 0, 0, 128136, 42705, 0, 0, 0, 11854, 0, 0, 0, 0, 4916, 0, 380, 10958,
+ 66563, 127790, 78284, 67587, 0, 12918, 0, 917897, 0, 917898, 917893,
+ 10684, 0, 125063, 92906, 0, 0, 8182, 0, 0, 129434, 0, 0, 0, 6859, 0,
+ 6630, 100405, 0, 123191, 0, 0, 0, 65876, 5535, 129892, 0, 0, 92609, 0,
+ 983348, 6477, 43795, 92217, 129571, 72163, 69496, 43848, 0, 0, 74256,
+ 2665, 11304, 43751, 0, 4970, 74353, 0, 8934, 0, 93996, 4492, 92908,
+ 65011, 0, 0, 92909, 1188, 7254, 1100, 0, 0, 0, 2912, 11749, 92643, 0, 0,
+ 65057, 0, 12343, 0, 78879, 0, 78880, 0, 0, 0, 70355, 0, 0, 11803, 0, 0,
+ 41450, 0, 100897, 0, 41451, 0, 0, 8273, 0, 3451, 0, 972, 41453, 68164,
+ 78876, 0, 92408, 73945, 43504, 2288, 78873, 9538, 78874, 128685, 0,
+ 129095, 0, 0, 0, 0, 11019, 0, 0, 121205, 0, 73007, 71365, 92716, 5927, 0,
+ 0, 0, 0, 128484, 0, 6073, 0, 0, 0, 6075, 93995, 282, 126510, 0, 74078,
+ 121459, 2206, 0, 0, 66791, 0, 3474, 0, 0, 0, 6081, 0, 127843, 74076, 0,
+ 0, 0, 128908, 0, 0, 0, 12623, 120273, 9120, 120275, 4665, 12628, 4670,
+ 120271, 120272, 0, 0, 121480, 958, 0, 0, 0, 4666, 0, 4915, 0, 4669, 0, 0,
+ 0, 4664, 0, 120550, 0, 0, 0, 0, 94023, 0, 917875, 8664, 11664, 0, 129327,
+ 11224, 0, 0, 1063, 119088, 120251, 9772, 7255, 8886, 0, 127932, 120257,
+ 120258, 120259, 120260, 42661, 71345, 120255, 119125, 120265, 120266,
+ 120267, 42721, 92407, 120262, 120263, 66788, 1017, 0, 118580, 505, 1447,
+ 0, 0, 70340, 66793, 65115, 42789, 128443, 0, 0, 123634, 0, 119195, 0, 0,
+ 11745, 7919, 0, 1641, 0, 0, 8966, 0, 0, 8743, 71870, 0, 67813, 0, 0, 0,
+ 123206, 0, 0, 128505, 10169, 71324, 0, 10068, 0, 120457, 120456, 120455,
+ 120454, 257, 43170, 13153, 0, 0, 0, 0, 0, 0, 6496, 19917, 5930, 128354,
+ 11033, 0, 0, 5622, 120436, 8477, 8474, 120433, 120432, 0, 0, 0, 41435,
+ 4352, 0, 2435, 0, 5621, 0, 4201, 8450, 4203, 4202, 4205, 4204, 120447,
+ 120446, 120445, 66792, 41440, 120442, 8473, 6373, 8469, 120438, 0, 4564,
+ 125206, 0, 0, 0, 8374, 73669, 0, 0, 66796, 0, 0, 0, 0, 0, 69297, 129762,
+ 5626, 43507, 11771, 0, 0, 0, 42614, 0, 5625, 0, 0, 0, 5623, 0, 0, 42623,
+ 64277, 69942, 0, 0, 120752, 0, 5817, 5629, 0, 7551, 10325, 5632, 69674,
+ 0, 0, 124946, 125194, 5628, 129766, 5631, 0, 0, 2400, 5627, 0, 0, 118786,
+ 74792, 0, 0, 0, 203, 129084, 74365, 0, 0, 0, 0, 83382, 83422, 0, 0, 554,
+ 0, 0, 0, 12182, 0, 64569, 110840, 73891, 0, 0, 0, 7689, 69798, 9323,
+ 10269, 10285, 10317, 175, 0, 0, 0, 0, 0, 1243, 42154, 0, 92387, 0, 0,
+ 43651, 0, 125021, 0, 9075, 118597, 0, 64777, 128570, 0, 0, 0, 0, 65255,
+ 0, 121142, 4490, 0, 6649, 120698, 12181, 0, 11977, 7249, 8366, 0, 7756,
+ 12342, 0, 51, 41516, 69432, 0, 9568, 71318, 456, 0, 10437, 1168, 9251,
+ 9082, 0, 0, 42781, 3866, 0, 41512, 0, 0, 68121, 41494, 0, 4660, 0, 10405,
+ 0, 0, 0, 0, 0, 73918, 119627, 110686, 41454, 12605, 0, 126611, 41455,
+ 917996, 983605, 0, 8214, 0, 100413, 129320, 41457, 983077, 0, 1969,
+ 127771, 0, 69554, 7413, 0, 69426, 10341, 43864, 78079, 5854, 0, 0, 0,
+ 129684, 72819, 0, 0, 73548, 0, 0, 8429, 0, 72328, 0, 6429, 0, 0, 0, 0,
+ 110688, 83417, 0, 917864, 120813, 83423, 1662, 125000, 0, 0, 917871,
+ 917868, 0, 0, 66, 65, 68, 67, 70, 69, 72, 71, 74, 73, 76, 75, 78, 77, 80,
+ 79, 82, 81, 84, 83, 86, 85, 88, 87, 90, 89, 0, 0, 7385, 70508, 1704,
+ 12993, 0, 0, 0, 0, 0, 0, 0, 0, 11353, 72207, 0, 0, 0, 0, 118831, 0, 0, 0,
+ 0, 0, 118719, 83364, 0, 0, 1289, 0, 0, 119583, 0, 65507, 0, 0, 0, 128042,
+ 0, 74409, 0, 0, 0, 0, 64793, 0, 0, 100843, 5675, 119239, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 6972, 70735, 0, 121108, 126217, 0, 0, 0, 0, 0, 110640,
+ 67687, 0, 0, 119634, 0, 43977, 111252, 129105, 0, 7412, 64671, 0, 1412,
+ 4594, 1391, 0, 8067, 12478, 110639, 78375, 110637, 10281, 110635, 0, 0,
+ 7960, 43271, 0, 12518, 69846, 0, 3566, 0, 0, 69864, 0, 0, 68021, 0, 0, 0,
+ 8223, 0, 4261, 121460, 68918, 0, 0, 121294, 113712, 0, 128046, 43419,
+ 72748, 92866, 10574, 0, 67691, 0, 0, 73785, 0, 78875, 128541, 0, 127366,
+ 0, 0, 0, 0, 6695, 65113, 324, 0, 128373, 40985, 0, 0, 0, 0, 0, 72307,
+ 43474, 0, 121190, 0, 0, 3420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110871, 9574,
+ 120684, 110870, 110814, 5204, 74774, 0, 11835, 0, 0, 983186, 0, 0, 0, 0,
+ 0, 0, 11750, 68898, 127004, 0, 0, 0, 0, 8130, 0, 0, 0, 121268, 0, 129443,
+ 0, 68455, 42863, 73839, 0, 0, 0, 92288, 0, 0, 0, 612, 110875, 110876,
+ 72231, 10538, 0, 1674, 0, 0, 0, 12280, 0, 540, 74550, 0, 66422, 8432, 0,
+ 11073, 0, 64316, 129894, 0, 7388, 0, 0, 0, 0, 126107, 0, 3359, 0, 0,
+ 67284, 0, 0, 65482, 129589, 0, 64742, 129304, 0, 124141, 74273, 0, 19941,
+ 0, 0, 0, 0, 9481, 65555, 0, 66628, 129126, 1195, 64898, 0, 0, 0, 2010, 0,
+ 0, 0, 0, 0, 0, 4360, 127009, 9739, 0, 72885, 0, 0, 0, 126265, 72200, 0,
+ 0, 120025, 72199, 0, 0, 65734, 0, 0, 129690, 13075, 0, 94063, 0, 43532,
+ 10837, 2492, 74516, 983075, 120882, 0, 0, 11813, 9649, 0, 119617, 5128,
+ 7377, 0, 65604, 0, 0, 6771, 1648, 7819, 0, 0, 0, 125192, 128131, 12709,
+ 6986, 0, 0, 0, 0, 0, 12581, 0, 5175, 0, 73806, 0, 128420, 0, 0, 77950, 0,
+ 0, 607, 0, 0, 128846, 119605, 67475, 129528, 65477, 0, 121130, 0, 8265,
+ 0, 0, 0, 5840, 42838, 0, 0, 68366, 0, 119255, 0, 0, 0, 127929, 0, 2550,
+ 121011, 6779, 70059, 0, 0, 0, 0, 0, 0, 5619, 65822, 0, 0, 0, 129392,
+ 5616, 11486, 0, 0, 0, 0, 5615, 0, 121319, 42380, 127958, 0, 66451, 74407,
+ 0, 11347, 0, 1026, 5620, 0, 0, 11350, 5617, 0, 0, 64639, 0, 0, 0, 1338,
+ 0, 0, 0, 4603, 0, 70715, 92484, 0, 9002, 0, 3974, 78213, 0, 0, 0, 0, 0,
+ 0, 75038, 66040, 70455, 0, 0, 0, 72982, 0, 0, 0, 0, 0, 118661, 0, 0,
+ 119105, 0, 0, 0, 0, 0, 128883, 0, 66897, 0, 0, 0, 42594, 0, 0, 0, 0,
+ 6714, 10083, 0, 121019, 0, 69976, 0, 0, 9073, 0, 64302, 0, 128286, 9725,
+ 0, 0, 121288, 73769, 121306, 0, 9570, 0, 11500, 2689, 917626, 0, 983813,
+ 66740, 0, 0, 0, 917623, 13286, 5500, 42598, 42596, 503, 0, 0, 917618, 0,
+ 0, 0, 0, 917615, 1652, 772, 6688, 8310, 0, 0, 72124, 0, 10194, 43542, 0,
+ 125054, 0, 6468, 68110, 0, 917606, 11767, 0, 0, 5836, 12358, 0, 0, 65624,
+ 12180, 0, 127994, 0, 43699, 0, 0, 72114, 43706, 0, 12362, 12435, 12360,
+ 0, 9020, 0, 12356, 8616, 0, 42924, 2227, 0, 0, 7315, 12354, 83097, 83098,
+ 83099, 2358, 83092, 83093, 83094, 0, 0, 83089, 83090, 0, 11759, 71723, 0,
+ 72834, 83109, 41423, 0, 83103, 83104, 83105, 42237, 110653, 70717, 72260,
+ 83102, 0, 67856, 0, 128534, 110657, 129354, 129194, 0, 64395, 0, 73008,
+ 120897, 74816, 0, 0, 0, 83088, 0, 0, 94064, 83083, 83085, 83086, 83087,
+ 83079, 83080, 2041, 9178, 0, 64870, 0, 83076, 74924, 0, 0, 0, 0, 0,
+ 78739, 0, 0, 0, 0, 0, 0, 3726, 0, 0, 0, 0, 0, 121432, 129457, 0, 0, 0, 0,
+ 0, 74901, 0, 0, 0, 0, 0, 124944, 113781, 0, 7410, 2669, 903, 0, 0, 0,
+ 127232, 74603, 0, 128264, 0, 128411, 0, 0, 11732, 0, 72797, 41448, 41461,
+ 124934, 0, 917558, 0, 8819, 0, 0, 74606, 92847, 121412, 74835, 0, 9168,
+ 65786, 0, 73691, 0, 67665, 0, 11758, 68425, 0, 0, 0, 128044, 0, 19924,
+ 67312, 0, 128755, 64551, 0, 8516, 0, 0, 7561, 983999, 74018, 0, 0, 0, 0,
+ 83074, 83075, 0, 11233, 83062, 83066, 3787, 83070, 83055, 41458, 83059,
+ 41463, 65308, 41459, 8683, 775, 0, 65584, 69923, 0, 110798, 110799,
+ 110796, 43440, 0, 0, 0, 3656, 0, 0, 0, 67694, 1599, 83138, 83139, 8514,
+ 8513, 83036, 83135, 83136, 110794, 110795, 83131, 83132, 0, 0, 0, 11684,
+ 10542, 9937, 83150, 0, 75037, 83145, 65730, 83147, 0, 8427, 83142, 55246,
+ 0, 0, 11497, 0, 0, 0, 119222, 0, 983598, 0, 10621, 0, 0, 129295, 119111,
+ 120745, 0, 0, 0, 11648, 83126, 83127, 42118, 83129, 83122, 65512, 83124,
+ 83125, 0, 0, 0, 83121, 74530, 128456, 0, 0, 0, 65724, 0, 0, 0, 65727, 0,
+ 0, 64963, 73830, 66042, 0, 0, 7875, 0, 0, 0, 129476, 0, 0, 536, 0, 0, 0,
+ 0, 65173, 129122, 0, 70331, 0, 0, 118598, 0, 129419, 0, 0, 0, 1687, 0, 0,
+ 0, 0, 0, 0, 10526, 0, 8323, 0, 83301, 11731, 73530, 0, 65460, 12242, 0,
+ 0, 10843, 11554, 0, 0, 8266, 0, 121101, 0, 0, 0, 0, 67667, 118694,
+ 119155, 0, 0, 119636, 67857, 0, 0, 0, 11755, 66305, 0, 0, 10917, 93979,
+ 113688, 0, 2040, 92596, 0, 0, 0, 0, 1227, 83119, 83120, 0, 0, 83115,
+ 74427, 11149, 4978, 83111, 1984, 11830, 83114, 128934, 74548, 118545,
+ 9373, 0, 0, 0, 0, 0, 0, 0, 0, 9237, 9390, 0, 0, 0, 0, 0, 1830, 0, 0, 0,
+ 0, 0, 128577, 983839, 68086, 0, 0, 0, 983059, 0, 983145, 0, 0, 0, 72197,
+ 55291, 11683, 0, 983659, 0, 11451, 0, 72714, 3731, 2359, 0, 67844, 0,
+ 121503, 548, 121502, 983250, 121405, 983253, 0, 66272, 0, 64678, 0, 9547,
+ 0, 0, 1614, 0, 0, 66307, 128092, 1358, 120871, 428, 0, 1466, 0, 10982, 0,
+ 0, 0, 407, 0, 0, 0, 0, 0, 0, 5804, 73464, 0, 0, 0, 70167, 9057, 42446, 0,
+ 125097, 0, 0, 8250, 10952, 8048, 0, 129155, 0, 118955, 0, 0, 118593,
+ 4407, 74648, 0, 0, 0, 8448, 92491, 0, 0, 12675, 12659, 0, 0, 983285,
+ 68077, 55273, 10766, 12012, 2386, 0, 9170, 0, 9123, 128194, 0, 0, 0, 0,
+ 129942, 0, 0, 0, 0, 0, 0, 8709, 0, 72383, 0, 0, 0, 0, 0, 0, 0, 128342, 0,
+ 577, 128610, 0, 0, 124999, 68087, 74840, 126474, 127036, 0, 0, 0, 1414,
+ 124963, 9683, 43486, 92231, 0, 2536, 0, 66330, 0, 0, 0, 0, 0, 0, 0,
+ 66317, 0, 66315, 66316, 0, 0, 0, 0, 0, 0, 0, 0, 66323, 66324, 0, 0, 3106,
+ 65917, 0, 2182, 0, 891, 0, 0, 42624, 0, 0, 8824, 65089, 128734, 10936, 0,
+ 0, 0, 0, 92688, 0, 0, 0, 0, 12745, 0, 0, 41285, 3547, 0, 0, 129877, 0,
+ 118701, 6089, 0, 68490, 120578, 4170, 1029, 127761, 0, 0, 42374, 917625,
+ 744, 917624, 0, 0, 0, 93046, 0, 3551, 0, 0, 4623, 0, 0, 12340, 0, 65136,
+ 0, 0, 0, 0, 0, 0, 0, 72291, 0, 0, 120778, 0, 11972, 0, 78757, 0, 122886,
+ 177, 122894, 0, 0, 0, 0, 55243, 0, 0, 0, 70172, 120249, 120242, 128027,
+ 120243, 0, 0, 0, 120237, 120245, 94079, 0, 0, 9136, 120240, 120614,
+ 41280, 0, 0, 0, 0, 74149, 128327, 0, 0, 66361, 12601, 72194, 64360,
+ 65163, 125241, 0, 0, 0, 0, 0, 5404, 43332, 3667, 7936, 12925, 0, 0, 0, 0,
+ 0, 10874, 65505, 0, 0, 0, 0, 128920, 983681, 0, 0, 0, 0, 0, 0, 0, 0,
+ 66677, 0, 0, 0, 70088, 74148, 0, 0, 72868, 120230, 120224, 74172, 0, 0,
+ 94096, 0, 128414, 120636, 0, 127519, 917609, 917616, 0, 128652, 0, 0,
+ 11441, 0, 3512, 0, 0, 43597, 0, 0, 72734, 68153, 41563, 0, 0, 129352,
+ 41544, 0, 0, 74927, 0, 129177, 0, 0, 0, 118908, 0, 78108, 67396, 73804,
+ 64711, 0, 0, 917610, 0, 0, 0, 11557, 127776, 0, 12079, 0, 0, 0, 0,
+ 128861, 0, 0, 0, 0, 0, 983201, 8103, 72303, 128174, 92486, 110698, 0,
+ 64587, 0, 0, 124961, 0, 0, 0, 126481, 0, 0, 0, 0, 0, 70348, 1450, 0,
+ 1340, 0, 0, 128970, 0, 0, 125117, 0, 0, 0, 0, 6539, 92948, 0, 128213,
+ 125060, 0, 0, 0, 3973, 0, 70504, 121193, 7982, 0, 0, 127194, 0, 0, 0,
+ 128408, 118968, 6417, 120619, 129748, 0, 0, 0, 129455, 4919, 65121,
+ 110872, 7755, 0, 0, 64548, 0, 1621, 0, 0, 0, 0, 0, 12188, 0, 0, 0, 0,
+ 5015, 0, 0, 42590, 70354, 1756, 0, 0, 0, 120694, 0, 0, 7555, 73874, 5408,
+ 2817, 1214, 69919, 0, 983126, 0, 0, 125055, 127195, 7957, 0, 0, 1056,
+ 74944, 0, 0, 0, 0, 7073, 74979, 0, 70853, 0, 110874, 0, 0, 2341, 126644,
+ 8484, 0, 0, 68322, 0, 8461, 67721, 42269, 0, 0, 43709, 43708, 9451, 7571,
+ 13073, 43847, 126647, 0, 983263, 0, 0, 0, 8781, 12894, 78134, 0, 78132,
+ 0, 0, 78184, 0, 11338, 120768, 0, 0, 0, 0, 0, 121367, 65021, 64795,
+ 74574, 0, 10047, 0, 0, 0, 0, 0, 0, 119181, 163, 576, 9895, 0, 0, 74591,
+ 0, 0, 66888, 0, 0, 0, 0, 0, 0, 7017, 128111, 0, 0, 129922, 0, 41591,
+ 11036, 65252, 120795, 129488, 0, 0, 0, 0, 0, 0, 8887, 0, 7295, 71203, 0,
+ 127221, 0, 0, 0, 0, 8755, 0, 0, 8147, 73127, 0, 0, 121348, 0, 129377, 0,
+ 74499, 0, 0, 0, 4619, 0, 6654, 123192, 0, 0, 0, 65689, 10128, 0, 129612,
+ 0, 0, 92651, 0, 2401, 0, 8792, 118546, 0, 74980, 0, 92246, 0, 0, 0,
+ 12886, 0, 66624, 0, 0, 74133, 65170, 0, 74135, 0, 0, 9984, 73867, 3010,
+ 0, 70349, 10698, 41475, 0, 119151, 0, 119152, 0, 0, 9100, 0, 0, 0, 78116,
+ 64780, 2001, 0, 55230, 0, 4052, 92856, 7626, 78080, 0, 0, 0, 41477, 0, 0,
+ 0, 43707, 74127, 0, 0, 0, 78086, 73758, 2335, 10663, 0, 0, 129872,
+ 119602, 0, 0, 70325, 0, 41443, 0, 0, 0, 9711, 1523, 0, 0, 41445, 0, 0,
+ 8567, 41442, 12821, 0, 0, 118978, 0, 65274, 0, 94082, 0, 127515, 0, 0,
+ 43446, 0, 0, 0, 0, 127985, 0, 10206, 127167, 6375, 2673, 0, 0, 0, 43219,
+ 129355, 0, 0, 0, 0, 129400, 11799, 101225, 68466, 0, 0, 0, 0, 0, 120736,
+ 0, 7203, 0, 0, 70361, 127213, 120615, 127216, 0, 0, 0, 0, 43121, 0,
+ 128366, 72161, 0, 129868, 0, 121260, 73781, 70365, 0, 68039, 70446,
+ 10057, 0, 0, 0, 101219, 120963, 101220, 2307, 0, 0, 0, 0, 73873, 0,
+ 94035, 0, 0, 67469, 0, 129983, 7327, 0, 0, 440, 0, 0, 68613, 75059, 0, 0,
+ 9957, 0, 0, 8046, 0, 119158, 0, 0, 68609, 0, 129405, 1521, 129460, 92256,
+ 65344, 0, 11850, 68737, 0, 0, 68914, 7303, 65770, 5243, 0, 5239, 65771,
+ 121429, 0, 5237, 0, 68756, 0, 5247, 0, 0, 0, 12873, 5764, 0, 0, 3008,
+ 118981, 128102, 0, 0, 55231, 41103, 0, 92756, 0, 0, 92717, 70074, 7872,
+ 74886, 917567, 8731, 65378, 118564, 0, 11316, 128163, 126600, 70360,
+ 3019, 9997, 0, 0, 9456, 129545, 0, 0, 101192, 0, 0, 92682, 4281, 0, 0, 0,
+ 118982, 0, 69993, 78096, 0, 78095, 0, 78098, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2134, 0, 10116, 9877, 70679, 0, 0, 92723, 8379, 0, 6778, 0, 0, 8243, 0,
+ 0, 0, 0, 128008, 0, 0, 0, 983630, 119668, 129962, 92722, 983098, 5637,
+ 125115, 0, 0, 120479, 0, 113730, 0, 0, 194990, 64432, 0, 70363, 121368,
+ 1156, 68052, 0, 0, 120482, 0, 68030, 0, 0, 0, 7634, 0, 0, 65536, 0, 0, 0,
+ 7702, 0, 78890, 0, 65779, 65783, 195066, 120961, 5700, 0, 0, 92161, 2339,
+ 92476, 5697, 0, 0, 0, 74923, 0, 5696, 92677, 0, 3862, 0, 0, 0, 983055, 0,
+ 0, 0, 0, 5701, 9722, 41490, 41370, 5698, 0, 0, 0, 42204, 55270, 8571, 0,
+ 0, 43859, 0, 78731, 0, 12184, 0, 0, 0, 0, 0, 5650, 0, 64712, 120474, 0,
+ 120458, 5647, 120473, 7387, 0, 92675, 11477, 5646, 0, 11018, 0, 0, 0, 0,
+ 0, 0, 69280, 128459, 126128, 5651, 0, 0, 0, 5648, 0, 120920, 0, 127517,
+ 3545, 0, 6984, 0, 0, 0, 69414, 126613, 0, 10123, 0, 69274, 0, 0, 65020,
+ 74885, 119166, 0, 0, 0, 0, 0, 1140, 78426, 0, 0, 0, 122665, 8128, 9889,
+ 0, 0, 1815, 0, 890, 0, 3267, 0, 0, 0, 983686, 4410, 125081, 10576, 8102,
+ 0, 580, 74232, 0, 0, 0, 0, 0, 19938, 0, 0, 0, 0, 3298, 6546, 0, 0, 0, 0,
+ 6134, 41246, 0, 0, 0, 917770, 0, 6264, 0, 0, 0, 0, 0, 0, 69445, 0, 0, 0,
+ 92697, 11915, 10377, 0, 10072, 0, 0, 2329, 0, 0, 0, 0, 0, 0, 0, 67498, 0,
+ 101164, 0, 11201, 92708, 74769, 0, 13263, 0, 0, 92404, 126066, 69491, 0,
+ 0, 64917, 0, 0, 494, 128026, 0, 65098, 0, 956, 125265, 129556, 0, 73740,
+ 0, 0, 0, 74281, 128638, 0, 0, 69217, 120930, 0, 0, 0, 0, 0, 9922, 0,
+ 126269, 100948, 0, 65229, 0, 118671, 0, 0, 0, 0, 3907, 118833, 64526,
+ 11829, 68197, 0, 0, 11475, 70329, 3020, 42264, 0, 0, 0, 7098, 0, 0,
+ 127967, 957, 42696, 0, 3016, 0, 0, 0, 0, 0, 121248, 92510, 3006, 4620, 0,
+ 0, 0, 0, 129369, 129425, 0, 0, 0, 126246, 8626, 0, 128824, 0, 65377, 0,
+ 983103, 42920, 1698, 0, 64477, 0, 0, 43813, 100432, 100431, 100434,
+ 100433, 100436, 70321, 100438, 100437, 100440, 100439, 0, 121024, 101177,
+ 70327, 100441, 55252, 100443, 100442, 100445, 100444, 66641, 100446,
+ 100449, 100448, 0, 100450, 113820, 74866, 64375, 0, 127850, 129477, 0, 0,
+ 0, 0, 983799, 0, 0, 120827, 0, 0, 123637, 0, 0, 0, 101183, 8110, 100421,
+ 0, 100423, 5830, 100425, 100424, 100427, 73540, 100429, 100428, 42389,
+ 78611, 121398, 0, 0, 0, 0, 0, 0, 0, 83342, 983954, 0, 127147, 119187,
+ 2135, 11836, 0, 0, 78869, 42313, 5579, 0, 70384, 983082, 94002, 0, 5578,
+ 11840, 73006, 42023, 69849, 5669, 92559, 0, 0, 68833, 917845, 128275,
+ 5583, 0, 0, 42426, 5580, 42276, 0, 892, 2220, 42465, 74313, 73440, 5795,
+ 194991, 68774, 65702, 68770, 0, 65695, 0, 65710, 128399, 0, 0, 68783, 0,
+ 0, 0, 1638, 10966, 0, 917547, 0, 118921, 0, 0, 0, 8172, 120760, 0, 0, 0,
+ 0, 0, 6374, 0, 0, 120972, 0, 0, 0, 0, 0, 0, 0, 72204, 64900, 7153, 65785,
+ 68826, 0, 3015, 68743, 68740, 68738, 68805, 6400, 68749, 68748, 68760,
+ 68758, 11276, 68754, 100420, 372, 101138, 68761, 118874, 0, 41585,
+ 128202, 0, 74228, 276, 129895, 74234, 0, 74226, 0, 9007, 0, 41588,
+ 125001, 119189, 10763, 0, 0, 983560, 126097, 68525, 6257, 73112, 100393,
+ 100396, 100395, 100398, 92409, 100400, 100399, 101148, 74848, 120006,
+ 983592, 100401, 66498, 100403, 100402, 64790, 73454, 100407, 100406,
+ 70356, 100408, 0, 100410, 66829, 70817, 5711, 41633, 12098, 65571, 9166,
+ 0, 5710, 0, 6790, 65213, 0, 0, 0, 69726, 0, 73817, 0, 0, 5715, 0, 70408,
+ 0, 5712, 100382, 41620, 100384, 3074, 5722, 100389, 100388, 73768, 0,
+ 118906, 0, 0, 0, 66419, 71972, 0, 0, 0, 0, 64839, 78607, 0, 129074, 0, 0,
+ 0, 0, 0, 0, 113682, 0, 11261, 0, 0, 0, 8701, 0, 11236, 0, 129490, 100390,
+ 0, 0, 0, 78293, 0, 0, 0, 64946, 0, 0, 0, 70336, 0, 0, 93986, 68814,
+ 42902, 0, 0, 0, 0, 92344, 0, 67845, 42641, 71444, 0, 0, 70366, 101152,
+ 100369, 100368, 5084, 100370, 101158, 118861, 0, 733, 74646, 0, 0, 0,
+ 125085, 0, 9218, 0, 100380, 100379, 71070, 0, 0, 0, 0, 70323, 0, 0, 5155,
+ 0, 0, 983775, 0, 0, 72351, 0, 0, 0, 122891, 0, 0, 0, 100372, 100371,
+ 100374, 100373, 100376, 100375, 100378, 100377, 4974, 100357, 100360,
+ 100359, 0, 0, 0, 12205, 0, 0, 64507, 0, 0, 0, 0, 0, 0, 12149, 13088,
+ 78290, 0, 12241, 0, 0, 0, 6932, 100352, 73676, 100354, 100353, 100356,
+ 351, 68764, 0, 0, 0, 0, 73443, 0, 0, 100361, 42377, 100363, 100362,
+ 100365, 100364, 100367, 9013, 4054, 0, 0, 71939, 0, 120782, 5585, 65881,
+ 0, 0, 118541, 0, 5584, 8358, 128975, 121177, 0, 0, 0, 41616, 0, 983815,
+ 2218, 0, 5589, 0, 2664, 41613, 5586, 118890, 0, 11356, 0, 0, 0, 78609, 0,
+ 0, 0, 0, 0, 129870, 0, 0, 8135, 129685, 0, 983810, 0, 0, 0, 5657, 0,
+ 12915, 121453, 0, 10179, 5654, 12939, 0, 120799, 0, 0, 5652, 10945,
+ 118626, 0, 0, 113710, 0, 73449, 68069, 0, 70332, 0, 5659, 0, 0, 66729,
+ 5655, 0, 0, 0, 68806, 0, 128225, 66310, 73444, 0, 0, 70362, 0, 11609, 0,
+ 126990, 92949, 10272, 10304, 10368, 74511, 594, 10244, 10248, 10256,
+ 983918, 122974, 0, 3467, 41010, 0, 3331, 946, 0, 1495, 13184, 74330,
+ 128242, 9562, 0, 123175, 0, 70036, 122976, 0, 0, 123176, 0, 0, 0, 5666,
+ 65227, 123174, 68419, 0, 11796, 123178, 0, 0, 10186, 123172, 7732,
+ 983755, 0, 0, 0, 5668, 83334, 0, 74645, 5670, 0, 0, 12741, 126619,
+ 123638, 5667, 19952, 120807, 113766, 12749, 0, 67757, 2263, 0, 0, 119260,
+ 129131, 9286, 83335, 128457, 83336, 70359, 0, 3571, 13247, 5874, 78279,
+ 73447, 68435, 78278, 78267, 78268, 0, 78265, 553, 113768, 0, 93053, 5829,
+ 0, 4587, 78285, 78299, 129699, 12746, 0, 70338, 0, 5633, 0, 94101, 94102,
+ 94099, 94100, 94105, 74856, 94103, 12742, 0, 983837, 0, 0, 0, 70330, 0,
+ 983830, 0, 0, 0, 12148, 0, 0, 0, 0, 0, 64938, 67234, 5634, 0, 0, 2146, 0,
+ 118880, 2425, 65182, 983832, 43636, 0, 83326, 328, 0, 68736, 0, 5636,
+ 123163, 5329, 0, 5638, 0, 7940, 0, 43223, 43760, 5635, 3373, 72424,
+ 78292, 74223, 73441, 68763, 78287, 9833, 0, 74208, 41635, 0, 77775,
+ 43040, 78297, 68778, 78295, 5639, 65603, 5660, 5640, 78303, 0, 78300, 0,
+ 68301, 0, 0, 78312, 0, 78310, 41625, 78308, 78309, 100731, 41780, 5642,
+ 100732, 100735, 100734, 4356, 100736, 100739, 12051, 70166, 100740, 5641,
+ 8259, 0, 0, 0, 119570, 0, 0, 121264, 983558, 0, 0, 0, 73890, 0, 0, 2800,
+ 11220, 5645, 64964, 8652, 83323, 0, 0, 121356, 5608, 128281, 119932,
+ 118562, 0, 0, 9000, 0, 83324, 92673, 129176, 0, 5613, 74267, 100721,
+ 100724, 5610, 100726, 92965, 100728, 5612, 100730, 10787, 0, 3615,
+ 123647, 5609, 78316, 78317, 78313, 78315, 5875, 5808, 0, 8186, 0, 74269,
+ 122977, 70004, 65874, 72422, 5807, 0, 66320, 5306, 12936, 0, 92970,
+ 127961, 0, 92583, 10211, 0, 0, 78871, 121063, 0, 129512, 0, 0, 0, 0, 0,
+ 74237, 0, 9133, 74262, 0, 92840, 0, 64779, 4672, 73529, 6185, 64776, 0,
+ 121266, 6499, 0, 0, 0, 92720, 0, 67494, 93791, 2534, 0, 93768, 93778,
+ 93762, 71849, 71869, 93781, 64583, 93761, 93780, 78922, 93787, 92443,
+ 128714, 71848, 93774, 66411, 93785, 71841, 93770, 93769, 0, 0, 0, 121168,
+ 68443, 69774, 931, 0, 125052, 6363, 2748, 0, 0, 0, 983603, 44011, 0, 0,
+ 100711, 119009, 100713, 100712, 100715, 65896, 100717, 78298, 100719,
+ 100718, 128836, 100720, 11649, 0, 0, 0, 0, 0, 42341, 65284, 0, 0, 12884,
+ 0, 7907, 127255, 0, 0, 0, 0, 68779, 0, 68786, 0, 100691, 0, 100693,
+ 100692, 42851, 100694, 100697, 100696, 92276, 78226, 66393, 100700, 0,
+ 93773, 93776, 93777, 100702, 78301, 100704, 100703, 42415, 78307, 4542,
+ 69909, 94022, 100709, 0, 0, 0, 0, 42454, 11565, 7949, 124939, 0, 0,
+ 42494, 3073, 0, 0, 42302, 0, 126553, 70810, 0, 72401, 0, 0, 0, 129319,
+ 4877, 100681, 100684, 100683, 10548, 100685, 100688, 100687, 100690,
+ 64798, 70805, 5346, 0, 126570, 124135, 4874, 124136, 0, 0, 0, 0, 65884,
+ 0, 0, 0, 11378, 0, 42785, 0, 3251, 11203, 0, 0, 0, 69568, 11052, 0, 5342,
+ 8317, 0, 0, 5340, 0, 122970, 128599, 0, 129538, 0, 128395, 0, 128510, 0,
+ 0, 9142, 0, 0, 0, 10938, 0, 0, 1182, 127381, 4829, 0, 0, 72438, 529, 0,
+ 0, 0, 10586, 10790, 10839, 121427, 41593, 100669, 0, 118532, 41594, 225,
+ 66418, 0, 0, 983969, 11376, 0, 41596, 0, 64975, 0, 0, 11084, 3194, 0,
+ 78306, 78305, 0, 0, 0, 11324, 0, 0, 8420, 127756, 128844, 0, 41338,
+ 129683, 11485, 0, 41322, 66605, 100671, 0, 100673, 100672, 100675, 5161,
+ 41330, 100676, 100679, 100678, 100659, 100658, 0, 100660, 0, 100485,
+ 12361, 0, 12359, 983559, 41369, 66412, 12191, 0, 0, 0, 0, 78221, 41376,
+ 0, 9870, 0, 41385, 65824, 100651, 11938, 100653, 100652, 100655, 100654,
+ 42678, 100656, 0, 64649, 0, 0, 0, 0, 0, 983967, 100662, 100661, 100664,
+ 66334, 100666, 70280, 832, 100667, 2240, 78473, 66007, 78471, 65703, 0,
+ 0, 0, 12357, 0, 41395, 0, 0, 0, 0, 0, 0, 983466, 0, 41114, 65466, 0,
+ 983844, 6024, 0, 9979, 0, 0, 0, 0, 0, 0, 0, 4285, 0, 0, 4230, 0, 7367, 0,
+ 92353, 7563, 42376, 0, 128532, 0, 0, 0, 0, 67500, 0, 78466, 0, 12208,
+ 128138, 0, 66311, 71309, 0, 41130, 78286, 0, 0, 70047, 0, 6022, 0, 0, 0,
+ 0, 0, 41125, 0, 66453, 0, 41107, 0, 41121, 5300, 129588, 0, 0, 128759,
+ 74801, 70855, 2074, 73456, 0, 0, 12453, 0, 0, 0, 0, 68159, 12457, 0, 0,
+ 66278, 0, 0, 0, 0, 0, 66637, 12455, 0, 128473, 0, 12449, 0, 71224, 0, 0,
+ 66908, 0, 10165, 0, 119249, 113715, 0, 128223, 0, 0, 0, 0, 4993, 0, 6168,
+ 74033, 4995, 0, 69459, 77756, 4639, 0, 72223, 0, 73478, 0, 0, 0, 73486,
+ 66991, 0, 0, 0, 0, 0, 0, 83310, 0, 0, 0, 0, 0, 0, 0, 0, 129594, 4953, 0,
+ 0, 0, 0, 83311, 0, 73453, 65688, 0, 10125, 3517, 0, 0, 0, 65094, 74791,
+ 78262, 10627, 66333, 78256, 78257, 83304, 78253, 0, 71317, 64923, 0,
+ 65208, 10608, 78263, 78264, 0, 0, 0, 65883, 0, 0, 74914, 0, 0, 6853, 0,
+ 0, 12912, 119012, 0, 128191, 0, 0, 129586, 0, 1290, 0, 0, 0, 0, 113719,
+ 71442, 0, 0, 8978, 0, 119135, 120979, 10527, 71079, 0, 0, 0, 0, 0, 0,
+ 5336, 0, 0, 6934, 0, 10780, 0, 0, 78767, 0, 0, 0, 347, 0, 0, 78775,
+ 64675, 41582, 78774, 78771, 68094, 74903, 78769, 69221, 69657, 0, 0,
+ 11153, 120981, 78526, 0, 0, 0, 0, 41584, 0, 69464, 0, 0, 0, 0, 43510,
+ 66661, 0, 66306, 78791, 66384, 0, 6609, 0, 0, 11319, 0, 66984, 0, 41730,
+ 0, 0, 127920, 0, 65172, 41728, 41721, 0, 0, 0, 41203, 0, 0, 41726, 0, 0,
+ 5758, 0, 0, 41140, 2028, 78092, 0, 0, 0, 92739, 983196, 41138, 0, 0, 0,
+ 125082, 1115, 127060, 9794, 127062, 67671, 92238, 12237, 78787, 66314,
+ 78785, 9290, 73668, 78783, 78780, 66985, 127144, 7926, 0, 0, 0, 64398,
+ 100924, 71274, 12311, 101268, 78796, 78798, 78794, 78795, 78792, 78793,
+ 0, 101270, 0, 73455, 0, 0, 0, 42142, 9968, 11583, 0, 7092, 129835, 9627,
+ 78536, 73677, 78535, 0, 0, 1248, 10148, 127755, 0, 0, 101273, 0, 66447,
+ 0, 0, 0, 0, 65305, 0, 4031, 42794, 119986, 0, 8154, 0, 0, 128028, 126259,
+ 129926, 125220, 73452, 0, 0, 0, 6696, 0, 119599, 0, 0, 0, 4364, 0, 0, 0,
+ 120976, 0, 120922, 0, 10124, 7526, 8601, 0, 68246, 0, 129318, 1418,
+ 10885, 0, 0, 0, 0, 0, 0, 4571, 0, 0, 0, 12078, 41597, 0, 10933, 0, 72129,
+ 67479, 0, 0, 41599, 0, 0, 0, 12950, 119190, 10498, 0, 66782, 4239, 0, 0,
+ 66511, 68066, 2637, 110685, 8460, 110683, 8476, 110681, 0, 110679, 0,
+ 127919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5412, 66243, 9935, 122892, 0,
+ 73864, 41734, 8206, 74081, 0, 3286, 120730, 0, 0, 41732, 0, 41736,
+ 983203, 41731, 0, 0, 70842, 0, 0, 0, 0, 129329, 0, 66853, 0, 0, 78742,
+ 72755, 11277, 65892, 0, 10620, 92272, 68165, 0, 0, 0, 73942, 67001,
+ 100479, 0, 119093, 3459, 0, 129398, 0, 0, 72130, 92512, 0, 66377, 69781,
+ 128718, 0, 111304, 3161, 69981, 0, 0, 0, 0, 0, 9016, 78153, 0, 0, 43641,
+ 0, 121018, 0, 101279, 0, 0, 0, 0, 0, 68342, 120950, 94043, 0, 12332,
+ 121310, 6086, 41722, 0, 120709, 0, 0, 111305, 118677, 0, 128307, 74288,
+ 0, 74546, 124123, 129178, 124125, 92224, 42460, 0, 0, 0, 0, 120941,
+ 42421, 0, 41723, 110606, 64358, 11460, 983511, 0, 64718, 120838, 66869,
+ 0, 42348, 0, 6752, 452, 42500, 0, 128258, 0, 42308, 0, 0, 0, 12932, 0,
+ 69968, 42950, 66827, 917582, 0, 0, 8302, 0, 66929, 0, 0, 7250, 13214,
+ 10041, 8105, 65568, 127780, 69969, 127759, 0, 0, 121467, 0, 121466,
+ 41384, 0, 69878, 0, 5538, 9987, 111298, 118932, 129307, 0, 552, 0, 7357,
+ 10785, 66995, 0, 4557, 0, 0, 10171, 68320, 0, 5540, 0, 0, 281, 0, 0,
+ 42622, 0, 5536, 0, 0, 1388, 0, 0, 10504, 0, 0, 11531, 74324, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3663, 0, 121081, 70335, 74859, 0, 5334, 0, 110738,
+ 72319, 0, 11305, 66997, 68456, 0, 66611, 0, 19907, 64363, 3478, 7583,
+ 7679, 74154, 0, 0, 1158, 0, 983890, 73748, 0, 0, 1915, 4846, 0, 120132,
+ 118984, 120134, 120129, 120128, 805, 120130, 64438, 120124, 8760, 120126,
+ 72137, 120120, 120123, 94003, 0, 0, 0, 0, 0, 12225, 0, 0, 0, 70173,
+ 75045, 0, 129515, 8083, 0, 0, 0, 111094, 92626, 0, 0, 0, 0, 0, 0, 110837,
+ 0, 67699, 560, 5643, 0, 0, 0, 0, 0, 0, 0, 120144, 0, 120661, 78304, 1597,
+ 120143, 120142, 206, 70126, 120139, 120138, 8168, 0, 73086, 0, 0, 0,
+ 118650, 125036, 0, 0, 3546, 42573, 66811, 67000, 0, 128397, 8400, 0, 0,
+ 0, 0, 0, 7903, 9287, 72791, 0, 0, 0, 0, 72134, 66603, 1695, 917861,
+ 124150, 0, 111101, 0, 0, 0, 0, 0, 0, 0, 111099, 0, 111098, 4754, 0,
+ 69222, 128229, 0, 0, 7354, 7408, 0, 0, 121181, 0, 0, 0, 12739, 0, 1278,
+ 4187, 0, 42119, 42120, 0, 121158, 0, 12467, 0, 68902, 0, 12463, 0, 0,
+ 118827, 0, 9664, 70834, 74475, 0, 0, 0, 0, 0, 3661, 0, 0, 9022, 127955,
+ 0, 101460, 126257, 0, 6118, 222, 126250, 3884, 0, 74151, 0, 6502, 0,
+ 11085, 121261, 0, 0, 0, 0, 0, 0, 0, 0, 12461, 0, 0, 0, 94059, 11254,
+ 10860, 64880, 0, 64685, 0, 0, 94087, 7776, 11219, 0, 0, 121339, 69730,
+ 801, 43165, 0, 78212, 0, 0, 13277, 0, 12951, 0, 9906, 5486, 2334, 128672,
+ 67680, 5483, 73732, 120884, 119128, 2256, 0, 127876, 2539, 0, 78507,
+ 5485, 69826, 42697, 0, 0, 113689, 4502, 68057, 253, 73672, 0, 0, 9203, 0,
+ 0, 0, 0, 0, 121242, 11127, 0, 0, 0, 13257, 0, 0, 0, 69645, 0, 0, 0,
+ 70431, 0, 5693, 64470, 0, 66610, 67678, 0, 983678, 0, 0, 0, 0, 0, 0, 0,
+ 94078, 0, 0, 66608, 3111, 0, 8804, 66607, 0, 0, 0, 66606, 0, 0, 0, 1436,
+ 0, 55226, 0, 111287, 7393, 41592, 0, 0, 1598, 78101, 0, 0, 65193, 4423,
+ 0, 113692, 10515, 41589, 0, 0, 0, 101485, 1430, 101486, 0, 120606, 0,
+ 66223, 7619, 3255, 128280, 74032, 11549, 10735, 93038, 100741, 6801,
+ 100743, 100746, 2148, 100748, 100747, 100750, 100749, 0, 121229, 101479,
+ 69243, 41724, 67716, 69669, 41690, 111269, 983666, 8380, 100355, 983849,
+ 0, 101480, 0, 0, 0, 0, 6333, 111264, 42315, 0, 129502, 111265, 0, 0,
+ 5339, 74323, 0, 13004, 0, 0, 0, 0, 0, 0, 5684, 0, 0, 0, 5689, 0, 0,
+ 68464, 12633, 12870, 0, 65183, 5688, 0, 0, 6310, 5686, 0, 0, 0, 120647,
+ 70046, 50, 94095, 9871, 0, 0, 121446, 0, 0, 0, 66905, 0, 4448, 0, 121406,
+ 113734, 72125, 1321, 0, 10640, 0, 0, 101497, 0, 0, 73542, 0, 0, 0, 0, 0,
+ 12501, 0, 0, 0, 0, 8812, 0, 69986, 8673, 0, 129024, 0, 0, 2105, 72101,
+ 72712, 0, 129929, 0, 0, 0, 4636, 55262, 77745, 4515, 2382, 0, 0, 7313,
+ 101477, 0, 0, 194626, 0, 0, 0, 0, 0, 0, 0, 10197, 194719, 0, 0, 0,
+ 194718, 0, 0, 0, 64189, 0, 1873, 0, 0, 0, 0, 0, 983682, 0, 0, 101499,
+ 72282, 126991, 71113, 0, 0, 129340, 9489, 0, 70843, 0, 0, 0, 0, 128030,
+ 13295, 43191, 0, 0, 1154, 0, 1205, 0, 0, 0, 12958, 0, 0, 0, 66968, 0,
+ 10592, 0, 495, 0, 41712, 7983, 0, 0, 0, 6347, 69465, 7654, 41710, 4196,
+ 0, 0, 41709, 73772, 70832, 0, 9465, 983783, 0, 0, 917612, 0, 72374,
+ 41714, 0, 0, 0, 6343, 72376, 0, 43996, 0, 8044, 66979, 0, 41789, 0,
+ 10809, 71953, 0, 0, 0, 8146, 11025, 0, 120513, 642, 0, 0, 0, 12875, 0, 0,
+ 13229, 71950, 41788, 0, 92835, 0, 41791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8428, 6569, 92851, 0, 0, 0, 10167, 0, 68248, 8049, 0, 0, 0, 0, 128882,
+ 4761, 0, 4766, 64623, 0, 121180, 194653, 118876, 0, 6912, 9232, 7033, 0,
+ 0, 41545, 0, 71970, 72160, 72107, 0, 0, 0, 3484, 0, 0, 0, 8503, 41539,
+ 41527, 0, 0, 983842, 0, 0, 66983, 41537, 0, 41541, 8282, 11817, 129965,
+ 128219, 0, 0, 126132, 0, 0, 70115, 66609, 111235, 65921, 0, 0, 194664, 0,
+ 129326, 77970, 42246, 75030, 120605, 0, 65926, 7744, 68859, 94056, 74277,
+ 126108, 0, 6966, 194633, 8136, 0, 0, 0, 0, 0, 4762, 0, 0, 0, 4765, 69443,
+ 983585, 66970, 4760, 0, 0, 10871, 43199, 194645, 0, 93955, 0, 0, 11546,
+ 0, 337, 0, 0, 0, 12279, 7768, 0, 128352, 0, 69812, 10143, 7883, 121444,
+ 7880, 64618, 13012, 5704, 13010, 0, 0, 119531, 0, 0, 0, 0, 66654, 0, 0,
+ 0, 13008, 0, 4385, 0, 13011, 0, 92569, 66972, 13009, 74771, 70159, 0, 0,
+ 41793, 64450, 74221, 120996, 41792, 111242, 94054, 126094, 0, 111244,
+ 5709, 120689, 71076, 0, 0, 0, 0, 0, 5708, 0, 0, 0, 5706, 66362, 5705,
+ 8791, 41797, 0, 10237, 66436, 0, 66974, 0, 0, 128083, 13170, 0, 127075,
+ 0, 0, 41377, 0, 0, 10058, 120735, 101431, 0, 0, 0, 0, 0, 0, 129641,
+ 119525, 0, 0, 72350, 0, 983584, 2144, 0, 120765, 0, 0, 1754, 92226,
+ 13246, 864, 0, 118926, 8972, 0, 7849, 0, 0, 13240, 0, 5192, 0, 0, 10948,
+ 0, 13199, 0, 1236, 13208, 13261, 13189, 13188, 93993, 0, 7440, 66976, 0,
+ 0, 1844, 125229, 0, 13178, 0, 0, 0, 125230, 0, 0, 13260, 4550, 121249,
+ 125227, 0, 71071, 0, 0, 68523, 0, 0, 11354, 94071, 0, 42795, 129317, 0,
+ 0, 0, 125237, 0, 13194, 13274, 0, 0, 129533, 65586, 68311, 0, 119193,
+ 4601, 194661, 101454, 194658, 0, 194659, 0, 121422, 128790, 194657,
+ 41717, 67402, 101444, 121129, 41716, 127376, 7910, 0, 0, 754, 41944, 0,
+ 8183, 120741, 2037, 101440, 0, 101441, 125, 0, 0, 0, 983125, 101442,
+ 41719, 0, 7990, 12637, 13258, 9536, 71056, 0, 4427, 0, 71200, 0, 12217,
+ 0, 41532, 129315, 0, 0, 0, 0, 111063, 83349, 0, 0, 120622, 0, 0, 0, 0,
+ 43632, 0, 0, 8140, 0, 6260, 0, 0, 66765, 129657, 0, 3898, 0, 0, 13200, 0,
+ 0, 66582, 0, 0, 0, 0, 1068, 71178, 13259, 12945, 0, 42203, 0, 3124,
+ 69411, 0, 4386, 12224, 6973, 129563, 0, 0, 119535, 0, 121312, 0, 12232,
+ 0, 0, 5681, 64578, 75023, 72016, 13209, 0, 0, 0, 0, 0, 11053, 0, 74902,
+ 128107, 128942, 7588, 0, 1693, 74942, 43204, 65831, 124120, 0, 0, 68803,
+ 111216, 111223, 0, 0, 65685, 9523, 2243, 0, 0, 0, 0, 0, 0, 0, 0, 13191,
+ 0, 3500, 3139, 100643, 3170, 100645, 100644, 66934, 100646, 13006, 64433,
+ 0, 100650, 941, 0, 0, 120967, 3727, 0, 0, 0, 72378, 0, 0, 118611, 94039,
+ 129299, 92455, 0, 0, 64444, 0, 0, 43603, 94075, 65397, 288, 0, 0, 0,
+ 10025, 73692, 0, 0, 68182, 0, 0, 0, 92438, 65395, 0, 0, 0, 65393, 83078,
+ 121111, 0, 122666, 0, 0, 0, 65394, 11548, 72305, 0, 65396, 0, 0, 13256,
+ 1282, 0, 0, 0, 111085, 0, 0, 0, 111087, 72115, 0, 0, 0, 0, 0, 3304, 0, 0,
+ 0, 126595, 72437, 68353, 0, 0, 42113, 0, 0, 0, 0, 0, 43094, 0, 0, 94037,
+ 68317, 9035, 0, 0, 0, 0, 0, 70822, 128467, 164, 68309, 94067, 94000,
+ 100631, 100634, 100633, 100636, 100635, 100638, 100637, 68808, 100639,
+ 110665, 73893, 11099, 110664, 13175, 13207, 0, 127552, 0, 74643, 5929, 0,
+ 0, 119502, 983654, 11306, 0, 119059, 3180, 125102, 0, 0, 0, 13062, 0,
+ 129551, 128707, 0, 0, 74428, 0, 128000, 0, 11251, 70204, 0, 10045, 0,
+ 13275, 0, 11057, 0, 13276, 125133, 41525, 983084, 128015, 11444, 0,
+ 129158, 0, 122642, 41523, 127765, 0, 0, 0, 0, 0, 0, 0, 3858, 0, 119573,
+ 0, 0, 0, 0, 0, 0, 101014, 369, 74908, 41784, 0, 120994, 0, 71180, 0, 0,
+ 13210, 41782, 0, 73536, 101388, 41781, 10486, 74058, 43002, 0, 0, 0, 0,
+ 0, 3741, 0, 0, 0, 118540, 41222, 0, 128317, 3982, 0, 4388, 126105, 746,
+ 0, 0, 0, 13131, 0, 0, 0, 0, 0, 10434, 8794, 122963, 0, 0, 0, 0, 0, 11700,
+ 4374, 129413, 0, 0, 0, 0, 0, 917597, 0, 69814, 0, 6735, 73979, 13174,
+ 73968, 13225, 0, 69808, 0, 0, 2365, 7841, 71476, 0, 120934, 66510,
+ 128099, 0, 0, 0, 41785, 41171, 0, 13173, 4372, 6854, 0, 0, 0, 128939, 0,
+ 0, 12965, 384, 0, 0, 12685, 41473, 0, 13242, 13236, 0, 0, 0, 41787, 0,
+ 70684, 0, 68486, 13272, 0, 13232, 13233, 65838, 0, 0, 11656, 0, 126110,
+ 119885, 12861, 0, 13271, 0, 92737, 1096, 0, 0, 0, 0, 0, 0, 2255, 5203, 0,
+ 92902, 0, 13243, 13237, 12719, 0, 0, 0, 64884, 78043, 43052, 0, 0, 0,
+ 12014, 0, 101415, 0, 0, 13195, 41452, 64961, 41535, 42969, 10459, 0,
+ 124949, 0, 0, 0, 41533, 66337, 0, 92184, 0, 126091, 0, 0, 73849, 0,
+ 43638, 0, 101398, 6261, 0, 129568, 0, 1957, 0, 0, 0, 13292, 13206, 0, 0,
+ 2925, 73809, 42576, 101395, 13212, 43238, 0, 13190, 13187, 0, 13198, 0,
+ 0, 5242, 0, 0, 128146, 0, 73535, 6770, 43331, 127539, 0, 0, 71074,
+ 126466, 73524, 41444, 0, 0, 64799, 5246, 119106, 13185, 9709, 0, 0,
+ 92751, 0, 5238, 0, 71085, 0, 5236, 40979, 0, 74201, 8286, 0, 3936, 92833,
+ 11699, 0, 127249, 13235, 69578, 41248, 127264, 13245, 13239, 0, 7969,
+ 127266, 74832, 127251, 0, 120509, 0, 983893, 734, 127270, 0, 127254,
+ 70297, 127273, 64921, 120969, 66631, 41771, 120490, 0, 983172, 41770,
+ 1670, 42560, 0, 121349, 129634, 0, 41163, 0, 11136, 0, 11506, 0, 42841,
+ 13267, 126109, 0, 41775, 0, 7130, 41773, 0, 0, 0, 0, 0, 0, 0, 42673,
+ 65572, 0, 65250, 13265, 13264, 64518, 66798, 6100, 0, 0, 6740, 71080,
+ 67814, 12967, 70028, 68101, 4583, 0, 0, 68097, 0, 0, 0, 0, 119211, 0, 0,
+ 42653, 83181, 68102, 0, 7814, 71045, 0, 73702, 0, 0, 0, 9756, 6985, 0, 0,
+ 74219, 0, 0, 129069, 124987, 5674, 0, 66421, 0, 5677, 5588, 0, 0, 0, 0,
+ 5673, 73488, 5676, 0, 94048, 0, 5672, 6476, 0, 128798, 110951, 42511,
+ 1727, 0, 0, 0, 0, 0, 0, 0, 3550, 736, 0, 4505, 5873, 74090, 5826, 55232,
+ 5813, 0, 120712, 5841, 5837, 55234, 0, 3105, 64370, 5838, 5796, 0,
+ 119592, 5793, 0, 5866, 5797, 41011, 5865, 0, 0, 71899, 0, 71235, 5806,
+ 73528, 0, 9037, 5671, 0, 0, 0, 0, 71266, 126616, 7296, 0, 0, 0, 0, 6980,
+ 0, 72108, 0, 0, 0, 0, 0, 64613, 983910, 0, 129969, 0, 78277, 7114, 0,
+ 72100, 43190, 93842, 128666, 72096, 42611, 42563, 0, 125080, 0, 6792,
+ 43201, 72098, 0, 128719, 0, 72106, 73534, 0, 5644, 0, 66627, 69727, 0, 0,
+ 0, 65116, 0, 0, 73526, 0, 66410, 94104, 41013, 0, 0, 0, 2869, 0, 41015,
+ 0, 2785, 120616, 0, 73907, 194689, 0, 0, 0, 194688, 4759, 0, 0, 43192,
+ 129913, 1170, 43365, 69810, 73908, 0, 902, 0, 0, 0, 0, 8122, 66420,
+ 129642, 0, 3861, 0, 11028, 0, 73820, 5714, 0, 0, 0, 807, 127001, 78474,
+ 0, 976, 113782, 0, 0, 0, 0, 0, 128657, 118801, 71043, 0, 127017, 0, 0,
+ 5582, 0, 0, 5798, 0, 0, 0, 128521, 0, 0, 68058, 120553, 983184, 0, 0,
+ 74933, 74283, 0, 0, 194698, 66044, 0, 0, 0, 0, 0, 10094, 0, 0, 10857,
+ 69225, 0, 0, 93, 0, 10954, 0, 0, 0, 8171, 0, 0, 82996, 0, 0, 0, 73527,
+ 92634, 0, 0, 5187, 120711, 71086, 118704, 0, 0, 0, 5232, 0, 41009, 0,
+ 41005, 0, 43205, 0, 0, 0, 194708, 0, 71054, 10028, 66478, 7076, 13182,
+ 100385, 0, 0, 0, 78782, 7972, 78786, 0, 0, 0, 78789, 11309, 3806, 71252,
+ 0, 0, 0, 78819, 0, 125218, 0, 127532, 0, 0, 0, 78817, 0, 64366, 65156,
+ 8814, 0, 0, 0, 0, 12836, 42725, 120079, 0, 0, 0, 0, 69258, 13255, 0, 0,
+ 7464, 0, 93831, 0, 0, 0, 0, 13213, 118557, 0, 64516, 0, 0, 0, 41007,
+ 983929, 0, 40995, 12209, 983933, 119136, 123635, 0, 0, 0, 0, 0, 69283,
+ 43558, 5522, 0, 71061, 0, 74105, 3633, 983931, 119364, 41234, 41231, 0,
+ 9771, 983936, 13251, 0, 0, 6262, 2784, 0, 71078, 8126, 66483, 0, 0, 441,
+ 0, 0, 0, 41002, 40999, 0, 129394, 7108, 0, 10890, 0, 74445, 8324, 0, 0,
+ 74817, 2813, 119056, 74853, 983690, 0, 0, 0, 1193, 10462, 65197, 13253,
+ 13252, 7829, 120992, 130032, 0, 0, 0, 77911, 0, 77907, 0, 10386, 0,
+ 41042, 0, 65944, 65683, 10338, 66469, 0, 0, 0, 0, 0, 41966, 0, 0, 0,
+ 68915, 0, 0, 911, 983889, 128932, 40963, 0, 65159, 0, 122950, 0, 5520, 0,
+ 0, 0, 0, 0, 0, 0, 42965, 0, 0, 0, 0, 0, 983892, 0, 0, 66839, 0, 0, 0,
+ 68647, 0, 5857, 68135, 92727, 119120, 983694, 13171, 0, 0, 0, 120338, 0,
+ 0, 0, 13250, 69663, 0, 92201, 66397, 0, 0, 0, 8761, 12942, 5748, 92713,
+ 92414, 0, 83174, 8796, 0, 0, 0, 43633, 0, 72805, 71073, 0, 0, 0, 0, 0,
+ 12843, 4520, 0, 0, 73004, 983691, 0, 0, 194935, 110754, 64345, 0, 983677,
+ 3457, 0, 0, 0, 110750, 110758, 110751, 0, 0, 10427, 0, 73859, 0, 9755,
+ 1110, 65239, 0, 0, 0, 0, 0, 0, 0, 194936, 0, 983821, 0, 70437, 3620, 0,
+ 0, 72855, 0, 0, 0, 74250, 0, 0, 11980, 0, 66482, 67823, 0, 128345,
+ 110768, 0, 0, 0, 0, 12891, 983786, 983667, 0, 2016, 0, 65668, 92311,
+ 67696, 10366, 70117, 9155, 120652, 9786, 65082, 0, 8579, 0, 0, 0, 0,
+ 4508, 64883, 0, 92522, 129847, 0, 64592, 74276, 67688, 0, 69270, 0,
+ 69456, 0, 113821, 0, 12147, 9024, 66378, 66472, 0, 0, 0, 0, 0, 71935, 0,
+ 0, 113697, 0, 0, 69285, 0, 74275, 0, 122896, 127941, 41214, 0, 67476, 0,
+ 0, 0, 7773, 0, 0, 9963, 68649, 0, 73734, 0, 0, 0, 0, 6594, 983771, 0, 0,
+ 3624, 70342, 0, 64655, 121481, 0, 0, 0, 0, 0, 65932, 0, 983809, 6803,
+ 120968, 7738, 0, 0, 120628, 129721, 66614, 122921, 0, 43810, 7029, 0,
+ 41292, 118898, 0, 43115, 9517, 11518, 0, 0, 0, 0, 64423, 0, 0, 0, 12503,
+ 9591, 4516, 0, 118845, 0, 0, 129479, 43650, 983193, 69250, 0, 0, 68079,
+ 0, 11397, 2884, 0, 0, 12678, 0, 0, 41014, 73730, 917539, 4270, 92254,
+ 127836, 68205, 6633, 118947, 0, 5230, 101055, 0, 0, 983234, 121392, 0,
+ 92985, 0, 0, 0, 0, 415, 0, 0, 0, 0, 5183, 1877, 0, 0, 0, 0, 0, 4472, 0,
+ 0, 0, 128285, 110682, 78230, 4756, 0, 7081, 0, 0, 0, 78606, 0, 42922,
+ 42103, 8628, 74861, 0, 0, 0, 43059, 10539, 0, 0, 0, 0, 0, 0, 0, 0, 64873,
+ 11992, 129444, 0, 0, 11801, 3622, 0, 0, 983215, 0, 0, 11521, 0, 1966,
+ 43628, 111048, 0, 0, 0, 0, 0, 0, 42098, 66671, 10694, 128520, 0, 0, 0, 0,
+ 42100, 0, 111040, 0, 42097, 0, 0, 0, 0, 11302, 118640, 129145, 43395,
+ 83259, 0, 0, 92351, 0, 0, 11299, 1561, 0, 92359, 92725, 69253, 0, 194733,
+ 0, 194730, 0, 127893, 11280, 0, 0, 983802, 0, 0, 72760, 0, 12486, 65018,
+ 66516, 5409, 0, 0, 194720, 5399, 9685, 0, 983713, 5401, 0, 0, 66832, 0,
+ 0, 5405, 0, 0, 0, 0, 0, 2235, 0, 11330, 983711, 64690, 3254, 0, 129974,
+ 0, 0, 43678, 0, 0, 983146, 0, 6388, 3355, 0, 9867, 0, 55258, 5611, 0,
+ 128527, 0, 0, 129181, 0, 78228, 0, 0, 119119, 0, 0, 194959, 0, 0, 1379,
+ 246, 0, 0, 64736, 0, 0, 0, 121227, 0, 0, 0, 0, 0, 0, 11855, 0, 0, 0,
+ 71961, 10656, 0, 65214, 119242, 0, 0, 13163, 0, 120831, 0, 0, 101484, 0,
+ 0, 0, 0, 0, 4755, 0, 122627, 11443, 0, 0, 0, 608, 600, 0, 8580, 128712,
+ 0, 43635, 0, 129695, 74485, 43808, 0, 0, 0, 13160, 0, 129418, 42268,
+ 128006, 70505, 9828, 0, 69261, 0, 0, 9351, 7778, 0, 0, 0, 6916, 1208, 0,
+ 0, 194754, 0, 0, 0, 0, 0, 83318, 83317, 0, 43539, 0, 72024, 0, 0, 0,
+ 9150, 66831, 0, 128322, 0, 66848, 0, 0, 12166, 128492, 194685, 0, 2546,
+ 0, 213, 0, 65611, 83316, 0, 0, 74310, 70836, 0, 65285, 5452, 0, 983938,
+ 92772, 0, 0, 0, 0, 65518, 129029, 12609, 194679, 125255, 123193, 0, 0, 0,
+ 74638, 194677, 125190, 4143, 110854, 110855, 65748, 4141, 9682, 110851,
+ 118790, 194674, 0, 0, 8725, 0, 66638, 0, 42263, 4145, 6380, 0, 66613, 0,
+ 119207, 0, 0, 9550, 100621, 0, 100623, 100622, 78050, 100624, 65753,
+ 100626, 65756, 72731, 0, 100630, 0, 0, 0, 0, 9657, 9019, 121154, 0, 0,
+ 5390, 0, 0, 194965, 72144, 69937, 69286, 6328, 0, 0, 0, 0, 0, 983047, 0,
+ 5235, 803, 69289, 0, 0, 127979, 43838, 0, 119562, 43544, 0, 0, 0, 0,
+ 194960, 70426, 9107, 5191, 119113, 0, 0, 0, 121099, 0, 0, 0, 0, 0,
+ 128150, 983067, 0, 7289, 74055, 0, 0, 0, 0, 0, 0, 0, 1784, 124947, 0, 0,
+ 0, 0, 64868, 0, 13158, 0, 7211, 0, 9371, 129378, 0, 0, 1625, 7664, 0, 0,
+ 0, 0, 0, 0, 69273, 0, 0, 0, 0, 4482, 118886, 0, 0, 0, 0, 0, 0, 0, 100612,
+ 66849, 100614, 100613, 100616, 444, 100618, 100617, 100620, 100619, 0,
+ 129401, 0, 11349, 40991, 0, 0, 129324, 0, 0, 1197, 0, 40993, 0, 0, 0,
+ 40990, 43765, 0, 3492, 0, 127942, 0, 0, 100592, 100591, 100594, 19948,
+ 100596, 3099, 92239, 100597, 100600, 100599, 0, 129042, 0, 0, 100601,
+ 194969, 100603, 8152, 100605, 100604, 100607, 100606, 100609, 12828, 0,
+ 75015, 0, 0, 129950, 0, 0, 75068, 127507, 0, 92680, 0, 0, 129928, 129920,
+ 0, 130037, 0, 118820, 0, 0, 0, 0, 0, 100581, 0, 100583, 100582, 100585,
+ 100584, 100587, 100586, 100589, 7576, 11995, 100590, 43260, 0, 0, 64830,
+ 0, 125046, 101526, 0, 43979, 8870, 0, 0, 42357, 0, 0, 12822, 0, 0, 0,
+ 118944, 0, 0, 42637, 0, 0, 70725, 0, 129934, 0, 71344, 0, 0, 72449,
+ 194745, 7170, 9596, 8277, 194743, 43629, 110610, 0, 0, 983571, 123545, 0,
+ 66699, 42952, 0, 0, 0, 43234, 66008, 12627, 0, 0, 0, 43619, 43303, 11300,
+ 0, 0, 8745, 0, 7558, 71342, 100570, 0, 0, 127881, 3461, 121258, 129471,
+ 69264, 0, 0, 0, 73877, 74335, 124982, 0, 0, 0, 64620, 74762, 12069,
+ 10838, 92548, 43616, 0, 10061, 0, 64840, 10508, 209, 0, 43193, 120581, 0,
+ 0, 128049, 0, 10899, 69855, 100571, 100574, 100573, 100576, 993, 100578,
+ 100577, 100580, 100579, 100560, 100559, 7232, 0, 0, 0, 0, 0, 0, 10489,
+ 42166, 0, 128588, 0, 0, 4224, 7671, 41518, 121311, 0, 0, 0, 0, 64820,
+ 92538, 12966, 100554, 100553, 100556, 100555, 100558, 100557, 4263, 8793,
+ 0, 0, 41502, 0, 983, 0, 100563, 100562, 13086, 4109, 4274, 841, 5888,
+ 100568, 68522, 0, 43481, 0, 120926, 0, 7209, 0, 41505, 0, 78698, 127012,
+ 0, 2147, 0, 0, 66629, 0, 0, 1255, 4149, 0, 0, 66633, 0, 129391, 92352, 0,
+ 65101, 0, 0, 0, 0, 5835, 128797, 66625, 10842, 0, 42123, 0, 0, 66634,
+ 1094, 66636, 0, 0, 0, 0, 0, 9972, 73865, 129289, 6114, 0, 0, 0, 0, 93960,
+ 0, 0, 0, 0, 12070, 0, 881, 7857, 0, 65164, 0, 0, 118703, 124151, 0,
+ 64404, 64321, 0, 125187, 0, 0, 11245, 129395, 69506, 71859, 128886, 0, 0,
+ 1287, 121509, 0, 0, 0, 125264, 74152, 120504, 64545, 0, 69668, 8985, 0,
+ 0, 0, 0, 0, 0, 3652, 0, 0, 0, 0, 0, 279, 0, 0, 0, 0, 1489, 125189, 0, 0,
+ 3899, 0, 42124, 43828, 42122, 0, 0, 0, 11985, 73755, 78600, 0, 0, 10988,
+ 0, 0, 42138, 78610, 0, 65768, 78608, 78604, 78605, 6285, 78603, 78612,
+ 78613, 74339, 65767, 8685, 0, 0, 0, 78622, 78623, 68475, 11470, 64538,
+ 78618, 78615, 78616, 0, 0, 0, 101534, 2527, 0, 128209, 2799, 0, 0, 0,
+ 9933, 0, 0, 767, 5524, 7028, 0, 101520, 0, 0, 0, 78633, 67481, 0, 94011,
+ 0, 6971, 0, 70731, 0, 0, 118979, 126075, 2434, 94018, 0, 120579, 0, 4631,
+ 0, 0, 6407, 0, 19931, 0, 0, 124905, 0, 3192, 0, 8414, 0, 0, 0, 124902, 0,
+ 9164, 66612, 93959, 8228, 124897, 0, 0, 0, 78624, 0, 0, 9993, 0, 0,
+ 129350, 78631, 78632, 78629, 78630, 78627, 78628, 78625, 2399, 0, 92399,
+ 71202, 41208, 0, 0, 8178, 2149, 3367, 0, 78640, 78641, 78636, 78638,
+ 78634, 6337, 0, 78909, 0, 0, 11068, 0, 9331, 0, 74798, 9181, 0, 0, 8017,
+ 0, 0, 0, 0, 0, 0, 0, 12126, 119494, 129306, 0, 0, 69650, 0, 0, 0, 43436,
+ 983744, 0, 0, 0, 0, 66845, 69249, 0, 0, 5398, 0, 127386, 93953, 0, 0, 0,
+ 0, 0, 9476, 68899, 0, 12763, 126603, 74788, 0, 42114, 11181, 92502, 0, 0,
+ 0, 3469, 42107, 42116, 0, 0, 119493, 0, 9853, 69648, 9040, 101518, 64665,
+ 119557, 0, 0, 0, 69638, 12602, 983068, 3852, 0, 67872, 12231, 11317, 0,
+ 119812, 0, 11410, 10964, 12274, 122890, 100524, 0, 119810, 9865, 195019,
+ 0, 0, 0, 0, 12276, 0, 124919, 0, 0, 119613, 0, 111214, 10467, 0, 2443,
+ 10918, 0, 0, 1001, 9241, 1927, 0, 0, 0, 127885, 195022, 0, 113752,
+ 119830, 65678, 0, 0, 8260, 0, 7519, 11505, 101505, 0, 518, 0, 119832, 0,
+ 13204, 0, 857, 121252, 0, 0, 92336, 83177, 0, 0, 0, 0, 0, 0, 92762, 0, 0,
+ 120613, 67247, 1629, 124926, 796, 0, 0, 74123, 72334, 127587, 72336,
+ 43388, 0, 43944, 72335, 478, 65151, 0, 128147, 0, 0, 0, 0, 0, 42933,
+ 1206, 71209, 43837, 0, 3843, 12011, 0, 3361, 0, 8121, 10715, 7578, 0, 0,
+ 0, 10530, 12348, 8653, 0, 73545, 0, 9551, 0, 0, 784, 0, 0, 0, 0, 0, 0,
+ 43937, 0, 0, 43938, 43935, 73765, 66230, 0, 0, 0, 43936, 0, 43932, 11102,
+ 0, 0, 42753, 67165, 0, 78324, 0, 0, 6975, 917928, 5415, 12176, 0, 0,
+ 3462, 43940, 42629, 78691, 128016, 43942, 0, 9759, 0, 0, 78320, 8114,
+ 78321, 78697, 78696, 78695, 8710, 118812, 118956, 0, 4051, 92657, 0,
+ 71206, 0, 0, 0, 128857, 0, 1619, 9703, 77986, 0, 42112, 0, 1875, 0,
+ 42109, 0, 0, 71189, 121160, 64907, 5396, 13144, 0, 0, 5575, 9675, 0,
+ 5940, 226, 0, 6336, 0, 0, 0, 5116, 64521, 0, 0, 0, 121390, 125048, 74138,
+ 0, 74139, 128447, 92249, 0, 0, 0, 0, 8935, 0, 0, 0, 0, 616, 78131, 65178,
+ 4684, 78701, 983899, 74631, 0, 0, 0, 74460, 42110, 0, 10870, 8557, 11054,
+ 68664, 0, 0, 0, 122629, 0, 0, 0, 0, 65597, 0, 7651, 6846, 0, 0, 68868, 0,
+ 0, 118966, 129302, 40997, 127218, 0, 0, 40998, 0, 74488, 71182, 9800, 0,
+ 0, 0, 41000, 0, 5114, 55263, 3386, 70730, 42574, 0, 5115, 5394, 0,
+ 128756, 5113, 0, 64855, 0, 4425, 0, 0, 0, 43967, 0, 0, 0, 5112, 12173,
+ 127037, 0, 0, 74998, 118668, 0, 0, 0, 0, 64874, 43964, 1587, 0, 0, 0, 0,
+ 1369, 917931, 9959, 0, 43963, 4560, 0, 0, 0, 0, 124896, 0, 43961, 42601,
+ 4514, 72149, 0, 0, 0, 65041, 10965, 120905, 0, 0, 12542, 0, 65341, 0,
+ 65829, 0, 0, 10475, 0, 0, 0, 0, 11795, 0, 0, 2164, 127102, 127101, 74956,
+ 7099, 11275, 67681, 127096, 0, 9336, 0, 42626, 43966, 7798, 64474, 64259,
+ 0, 5730, 119809, 43018, 983175, 93796, 0, 0, 0, 69401, 0, 0, 5127, 11285,
+ 0, 5495, 4273, 0, 74765, 10849, 6346, 5493, 6342, 68636, 74319, 5492, 0,
+ 0, 169, 5497, 125053, 0, 0, 68198, 0, 0, 128417, 0, 0, 12738, 0, 983076,
+ 5321, 0, 0, 0, 5323, 120732, 9773, 125209, 4683, 74318, 0, 68823, 0, 0,
+ 0, 0, 129553, 0, 123562, 0, 0, 834, 0, 1803, 0, 5733, 0, 0, 71312, 5731,
+ 1381, 2891, 128639, 0, 127212, 64525, 0, 2881, 92996, 93847, 9601, 2879,
+ 0, 0, 73129, 5729, 0, 0, 0, 64881, 127905, 9361, 0, 2887, 0, 3526, 6298,
+ 0, 121219, 0, 0, 0, 8572, 127863, 77896, 0, 71174, 0, 0, 71197, 0, 12096,
+ 0, 0, 0, 110745, 71176, 110746, 65279, 0, 121236, 5734, 0, 0, 0, 0, 0,
+ 41641, 12717, 0, 12552, 983615, 66713, 0, 0, 41643, 110747, 0, 8713,
+ 41640, 78657, 41645, 66712, 125196, 0, 66726, 66711, 0, 93994, 0, 3472,
+ 64863, 0, 121424, 0, 0, 0, 125203, 67837, 0, 0, 0, 0, 0, 0, 121440, 0, 0,
+ 129461, 119008, 92402, 65017, 0, 0, 66668, 0, 0, 0, 0, 0, 119822, 0, 0,
+ 124148, 0, 0, 0, 0, 0, 0, 0, 0, 121043, 66471, 12216, 0, 40988, 0, 0, 0,
+ 0, 0, 2396, 129078, 0, 0, 0, 64940, 0, 8321, 119823, 128165, 100409,
+ 83299, 996, 0, 0, 4249, 0, 83294, 92535, 8222, 0, 118875, 71213, 0, 0, 0,
+ 0, 8534, 72844, 40983, 0, 125195, 0, 12551, 73960, 125193, 74469, 12558,
+ 121039, 0, 10052, 40982, 129371, 0, 0, 0, 127403, 0, 917559, 0, 78364,
+ 1563, 0, 0, 19911, 0, 0, 0, 71363, 0, 7797, 78708, 10006, 0, 3308,
+ 119134, 74940, 0, 0, 78488, 0, 0, 0, 0, 0, 128462, 9200, 10046, 9612, 0,
+ 8218, 66496, 0, 43742, 78489, 0, 0, 0, 0, 67826, 0, 70056, 508, 128585,
+ 0, 126539, 0, 0, 0, 0, 0, 0, 0, 124950, 0, 194601, 0, 0, 0, 0, 6659, 0,
+ 0, 0, 0, 0, 0, 41634, 0, 41639, 71169, 11941, 0, 0, 0, 42180, 68505,
+ 43753, 3249, 41637, 93982, 12328, 501, 93985, 10601, 129783, 6503, 0,
+ 92192, 0, 71181, 0, 6505, 74010, 0, 13064, 126112, 121105, 6500, 5526, 0,
+ 128949, 0, 0, 92376, 0, 9678, 120832, 0, 41706, 0, 0, 0, 8936, 92964,
+ 119123, 4208, 0, 0, 0, 67742, 0, 74379, 128605, 0, 0, 92422, 983110, 0,
+ 66475, 0, 5027, 0, 0, 0, 5069, 0, 5028, 0, 0, 0, 5026, 0, 0, 6331, 0, 0,
+ 0, 0, 41076, 0, 74790, 0, 0, 0, 0, 5029, 0, 5317, 3598, 0, 41070, 92166,
+ 11185, 6663, 0, 6507, 0, 126079, 0, 1716, 983710, 0, 917824, 620, 41001,
+ 0, 917823, 43758, 0, 71116, 5024, 0, 41003, 0, 5025, 7297, 122988, 75039,
+ 69745, 119328, 65557, 0, 0, 983599, 0, 0, 0, 0, 43947, 43946, 0, 0,
+ 128363, 6105, 0, 119325, 983230, 0, 68203, 43945, 66491, 43939, 0, 68144,
+ 78718, 2301, 0, 0, 66490, 6979, 101561, 7721, 0, 0, 1592, 0, 0, 121096,
+ 41048, 129358, 829, 0, 92406, 0, 73541, 0, 41056, 0, 118665, 10953,
+ 41066, 0, 917813, 482, 101554, 0, 0, 43606, 71185, 0, 917926, 0, 72262,
+ 110863, 72421, 12050, 0, 5315, 917817, 0, 0, 42061, 917816, 0, 0, 68417,
+ 917815, 0, 0, 42059, 0, 0, 120723, 42058, 3960, 11043, 11337, 121358, 0,
+ 92824, 3958, 101568, 0, 917818, 0, 917819, 0, 0, 42064, 11959, 983714, 0,
+ 0, 0, 0, 73511, 64336, 10478, 92629, 70350, 118692, 0, 0, 42437, 1555, 0,
+ 8691, 129656, 2215, 41662, 119046, 0, 0, 0, 93952, 0, 66481, 41664, 0,
+ 42578, 0, 41661, 78715, 78714, 9356, 0, 129544, 0, 1286, 110701, 0, 0,
+ 983208, 128925, 42476, 0, 11156, 78895, 0, 0, 101583, 72123, 0, 10020,
+ 43359, 72827, 0, 120946, 41627, 0, 11979, 0, 41628, 533, 11931, 65225, 0,
+ 125122, 129994, 0, 68118, 0, 4377, 0, 0, 8587, 72097, 13193, 64350,
+ 68233, 0, 41924, 0, 7735, 0, 127585, 120843, 0, 65820, 0, 0, 43461, 7757,
+ 0, 0, 43787, 66493, 77943, 4168, 43904, 73952, 0, 0, 121072, 4440, 43902,
+ 77948, 66837, 77946, 43903, 77944, 77945, 0, 120909, 120826, 120226,
+ 66492, 43901, 64625, 0, 0, 0, 0, 10013, 64434, 0, 983113, 0, 11782,
+ 64382, 0, 0, 0, 0, 41630, 630, 120960, 0, 0, 70165, 1043, 93017, 0, 0, 0,
+ 124945, 313, 129590, 0, 0, 65593, 7445, 43906, 5750, 42258, 0, 55222,
+ 68222, 11268, 11225, 0, 8526, 0, 0, 43894, 66495, 69990, 0, 92990, 0,
+ 10707, 7863, 0, 0, 70692, 631, 77952, 77953, 66443, 71171, 83313, 0, 0,
+ 0, 13305, 77961, 43925, 43924, 77956, 77957, 66903, 66328, 42381, 77962,
+ 0, 0, 0, 0, 0, 0, 43899, 66821, 77967, 9157, 77965, 77966, 77963, 77964,
+ 0, 0, 180, 73904, 0, 0, 66494, 12674, 43896, 0, 0, 43890, 43897, 0,
+ 11535, 0, 66769, 5185, 7165, 5521, 10334, 5519, 71329, 10302, 12351,
+ 83333, 1027, 5181, 0, 5117, 2186, 5179, 73955, 6845, 991, 3332, 43676,
+ 41647, 0, 73883, 92571, 77979, 3405, 69572, 0, 5523, 43915, 66487, 92459,
+ 74943, 9549, 0, 125093, 43923, 0, 43682, 74884, 120537, 0, 43921, 0,
+ 71184, 0, 43922, 128709, 0, 10414, 9846, 0, 10350, 0, 43918, 77981,
+ 75075, 77978, 77980, 66485, 77977, 77973, 77974, 78057, 43909, 73983,
+ 12330, 0, 0, 0, 43910, 69291, 3407, 6293, 0, 68149, 43908, 129060, 0,
+ 10209, 0, 4195, 0, 9010, 983705, 75072, 6332, 0, 0, 65871, 0, 1736, 0,
+ 3901, 0, 0, 65890, 128801, 10446, 0, 693, 9130, 314, 78119, 64149, 0, 0,
+ 0, 11026, 0, 5332, 6940, 0, 0, 127007, 119831, 0, 273, 8165, 118551,
+ 83307, 0, 0, 12824, 43911, 4528, 5320, 6301, 43662, 6133, 0, 9463, 73738,
+ 127141, 10922, 121069, 0, 0, 0, 0, 0, 2569, 0, 2326, 0, 2565, 0, 66401,
+ 0, 0, 0, 0, 41848, 2567, 78620, 121145, 4044, 92646, 0, 12233, 0, 9509,
+ 0, 0, 127158, 7336, 0, 0, 0, 129598, 0, 67235, 0, 0, 0, 0, 2222, 66499,
+ 0, 127170, 0, 10895, 118682, 274, 983782, 1858, 0, 67849, 55251, 2172,
+ 3133, 0, 71857, 0, 9610, 0, 8197, 0, 0, 0, 41665, 5868, 0, 0, 72120, 0,
+ 19940, 43668, 41667, 0, 0, 1923, 0, 0, 0, 0, 0, 0, 0, 0, 6464, 92750,
+ 2996, 125221, 0, 68481, 41835, 4047, 41842, 0, 0, 129601, 0, 0, 0, 0,
+ 293, 0, 0, 64791, 41827, 0, 0, 10579, 8560, 0, 0, 118835, 4803, 73805,
+ 1739, 0, 3900, 128967, 73737, 0, 72451, 73957, 0, 66474, 41971, 0, 0, 0,
+ 0, 0, 11716, 66473, 0, 92647, 0, 78920, 0, 0, 0, 0, 0, 0, 0, 6632, 73861,
+ 0, 74770, 0, 0, 8914, 0, 0, 3183, 1435, 0, 0, 0, 0, 0, 0, 5746, 67392, 0,
+ 0, 0, 83506, 0, 7082, 71481, 12618, 5059, 983597, 83524, 43604, 0, 0, 0,
+ 0, 0, 0, 8227, 0, 1218, 0, 64416, 65848, 92884, 0, 0, 0, 126987, 0, 0, 0,
+ 0, 0, 0, 83515, 83507, 0, 0, 42672, 71194, 43224, 0, 0, 0, 0, 0, 0, 0,
+ 65905, 0, 42662, 0, 121159, 0, 129536, 0, 7794, 0, 42953, 6377, 0,
+ 126080, 3669, 3968, 0, 71319, 69658, 129550, 0, 66296, 118616, 0, 0, 0,
+ 124998, 6699, 126120, 0, 0, 66678, 0, 0, 0, 8409, 119527, 19967, 0, 0,
+ 9502, 0, 0, 6115, 0, 41654, 0, 0, 0, 41655, 113779, 43975, 72427, 128080,
+ 0, 0, 0, 41657, 10778, 0, 9533, 184, 1553, 128868, 69574, 0, 0, 0,
+ 129420, 0, 101589, 983576, 73697, 0, 92480, 0, 128938, 74292, 0, 5157,
+ 4020, 0, 128154, 43788, 64818, 0, 0, 0, 92979, 0, 0, 74377, 11029, 66651,
+ 0, 0, 125202, 0, 0, 7877, 121070, 101411, 0, 119828, 2810, 9955, 0,
+ 69375, 42817, 0, 65122, 11715, 0, 0, 0, 71270, 0, 0, 0, 0, 0, 70199, 0,
+ 0, 0, 0, 0, 0, 127862, 0, 0, 0, 78222, 127981, 0, 0, 0, 0, 0, 11290, 0,
+ 0, 0, 0, 8315, 0, 0, 0, 74595, 0, 0, 0, 42531, 0, 0, 0, 74589, 43993, 0,
+ 0, 0, 0, 43690, 0, 119139, 42730, 0, 0, 0, 64926, 0, 0, 43830, 65257, 0,
+ 42728, 0, 128697, 123150, 0, 43540, 0, 0, 12725, 72993, 78635, 127826,
+ 223, 0, 69675, 0, 0, 0, 0, 0, 0, 42605, 0, 0, 0, 0, 0, 0, 0, 0, 78621, 0,
+ 78619, 119062, 0, 0, 0, 42676, 129353, 64800, 78617, 83504, 68126, 1213,
+ 0, 0, 797, 0, 0, 83021, 83005, 64387, 4115, 0, 0, 0, 129857, 10679,
+ 83001, 121091, 0, 64276, 83498, 13168, 83011, 0, 10136, 0, 0, 65088, 0,
+ 4262, 129866, 0, 0, 10701, 0, 3101, 0, 123204, 0, 0, 11373, 0, 0, 12731,
+ 9117, 0, 0, 4539, 0, 0, 12727, 0, 0, 0, 43684, 74567, 68877, 983726,
+ 12724, 73940, 0, 0, 0, 0, 0, 7947, 12003, 0, 74593, 121140, 69653, 74807,
+ 42018, 0, 0, 0, 65888, 0, 0, 69683, 0, 120306, 0, 0, 12595, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 69848, 68307, 0, 4405, 0, 128336, 129032, 69216, 0,
+ 128011, 118656, 0, 6817, 67400, 120314, 0, 0, 998, 0, 13105, 120313,
+ 64327, 1558, 0, 1991, 7882, 0, 0, 0, 530, 0, 0, 0, 12002, 0, 68422, 0,
+ 10979, 0, 41823, 70696, 0, 0, 7896, 0, 66676, 0, 120325, 0, 0, 129407,
+ 94033, 0, 6311, 110725, 41698, 0, 12049, 78133, 0, 125020, 41705, 0, 0,
+ 121298, 0, 66822, 0, 65389, 0, 66027, 0, 0, 41699, 8340, 0, 69776, 0,
+ 78921, 0, 1988, 5407, 69978, 0, 65912, 93059, 0, 2336, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 126238, 0, 19913, 0, 113733, 0, 0, 74279, 0, 10956, 0, 41674,
+ 19964, 41679, 65084, 41675, 195031, 0, 0, 0, 0, 983089, 0, 10794, 128961,
+ 13217, 0, 0, 0, 5280, 0, 0, 12905, 41610, 11532, 0, 0, 768, 120545, 442,
+ 0, 0, 0, 64081, 41682, 0, 41693, 0, 77993, 77994, 0, 4804, 6994, 983115,
+ 0, 0, 41696, 467, 983934, 0, 0, 0, 0, 8678, 0, 69682, 64801, 0, 0, 0,
+ 2193, 64093, 12043, 0, 69666, 0, 2029, 65191, 119246, 42847, 0, 0, 0, 0,
+ 0, 0, 0, 70339, 126116, 0, 0, 8019, 73856, 0, 0, 0, 118709, 2355, 12150,
+ 65725, 77988, 77989, 68033, 77987, 0, 77985, 0, 0, 68388, 0, 74171, 0, 0,
+ 0, 11301, 78013, 78008, 78010, 9874, 78007, 983331, 71064, 3050, 0, 0, 0,
+ 78016, 78017, 71852, 78015, 0, 0, 0, 92242, 0, 69642, 0, 0, 43883, 0, 0,
+ 0, 78025, 0, 78023, 78024, 11847, 10545, 0, 10887, 0, 123179, 0, 0, 0,
+ 83352, 64942, 92363, 9996, 8508, 0, 0, 8195, 0, 42171, 0, 3722, 0, 63751,
+ 0, 0, 92637, 69670, 0, 41552, 69854, 0, 78639, 0, 0, 129374, 128978, 0,
+ 0, 0, 7920, 70285, 4021, 0, 0, 0, 119663, 0, 0, 78021, 78022, 78019,
+ 78020, 1802, 78018, 0, 74895, 41659, 41671, 1827, 0, 64396, 41668,
+ 128524, 41673, 0, 11422, 71846, 0, 11370, 0, 68412, 41345, 0, 0, 0, 0, 0,
+ 0, 65114, 0, 2104, 64858, 0, 0, 7553, 0, 41560, 11970, 0, 917920, 0,
+ 68495, 74131, 74130, 0, 0, 0, 611, 74129, 64871, 129958, 0, 0, 0, 74854,
+ 0, 70466, 0, 0, 0, 121147, 0, 68487, 41669, 7094, 917921, 0, 123144,
+ 74054, 0, 0, 0, 839, 0, 7695, 0, 0, 0, 92202, 0, 121053, 123157, 67885,
+ 0, 7206, 0, 6647, 43986, 129743, 0, 0, 122646, 0, 0, 127936, 43748,
+ 66746, 0, 12298, 110802, 984011, 110800, 64924, 0, 73931, 9468, 74245, 0,
+ 0, 74246, 0, 0, 118830, 0, 71851, 1279, 0, 6224, 0, 92405, 128601,
+ 129886, 128997, 0, 0, 0, 5032, 0, 0, 0, 0, 0, 5034, 0, 0, 72846, 42702,
+ 0, 0, 13294, 0, 64869, 0, 67808, 9129, 123632, 0, 0, 120819, 68387,
+ 120168, 120169, 120170, 120171, 5518, 4174, 120166, 66932, 120160,
+ 120161, 120162, 434, 41437, 66212, 120158, 120159, 0, 0, 118867, 0, 524,
+ 0, 74029, 0, 126559, 0, 0, 0, 10355, 10419, 74025, 77847, 0, 69725, 0,
+ 120656, 0, 67876, 0, 0, 0, 74145, 74039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 5445, 0, 93779, 71855, 7391, 8989, 0, 74068, 0, 0, 0, 0, 4962, 120409,
+ 8855, 0, 70820, 0, 0, 0, 0, 71847, 0, 120406, 0, 10451, 0, 67653, 120153,
+ 12443, 120155, 9947, 120149, 120150, 120151, 13128, 0, 120146, 120147, 0,
+ 0, 0, 0, 0, 129715, 74059, 74062, 6217, 74053, 43846, 0, 74049, 0, 0, 0,
+ 0, 0, 0, 0, 0, 42595, 0, 68112, 118860, 0, 0, 92497, 74949, 128953,
+ 126245, 0, 0, 0, 42997, 122984, 119251, 0, 0, 0, 0, 0, 6216, 0, 0, 9455,
+ 127027, 8124, 128851, 0, 6944, 0, 0, 0, 2828, 128550, 531, 42638, 0, 0,
+ 129888, 43428, 0, 3614, 2827, 9696, 0, 129711, 0, 4354, 0, 78562, 78561,
+ 0, 118553, 0, 42599, 42597, 0, 68829, 125012, 0, 127277, 0, 120421, 0,
+ 983165, 0, 0, 10121, 120422, 74950, 123142, 69715, 0, 0, 120423, 120630,
+ 12608, 125244, 0, 74144, 9700, 12580, 0, 128911, 0, 71864, 0, 74071, 0,
+ 0, 12713, 0, 70402, 0, 0, 0, 1734, 0, 0, 0, 119491, 118951, 231, 0,
+ 74167, 542, 0, 0, 0, 0, 128074, 0, 121343, 0, 4446, 10584, 74235, 0,
+ 4037, 0, 0, 0, 5687, 0, 0, 0, 0, 0, 0, 78434, 92816, 0, 113709, 74284, 0,
+ 0, 0, 126495, 0, 0, 0, 74482, 93978, 1709, 69721, 9909, 92286, 0, 0, 0,
+ 55229, 8667, 0, 0, 0, 0, 0, 0, 0, 0, 127586, 1226, 6930, 124146, 71736,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 41500, 0, 311, 74282, 6221, 92988, 0, 67682,
+ 0, 120528, 122901, 74272, 0, 0, 0, 0, 69667, 0, 124933, 74456, 74302,
+ 42589, 0, 0, 0, 0, 64847, 0, 66987, 0, 41508, 0, 323, 125211, 0, 42698,
+ 8131, 0, 4625, 0, 4630, 0, 0, 0, 74316, 78417, 2668, 92483, 0, 42640, 0,
+ 2519, 0, 92474, 92479, 0, 983085, 5049, 42659, 119011, 64705, 7754,
+ 10854, 8738, 74623, 0, 0, 0, 649, 0, 0, 73480, 0, 0, 1013, 70707, 68212,
+ 705, 0, 0, 127803, 1183, 126519, 9320, 0, 0, 8157, 0, 0, 0, 0, 0, 0, 0,
+ 11913, 0, 42848, 0, 64925, 0, 0, 70693, 0, 0, 2051, 0, 0, 0, 66988, 0, 0,
+ 0, 8466, 0, 4626, 8464, 8472, 68844, 4629, 8499, 0, 0, 4624, 194623, 0,
+ 94025, 0, 7805, 0, 94007, 6935, 0, 0, 0, 0, 0, 0, 0, 8492, 0, 8459, 0,
+ 8497, 8496, 0, 129864, 0, 0, 129834, 69553, 73476, 0, 65849, 0, 0, 0,
+ 12451, 3328, 8684, 0, 6102, 0, 5298, 110881, 5294, 0, 129615, 0, 0, 0, 0,
+ 43617, 0, 0, 0, 0, 0, 77863, 128695, 0, 0, 0, 0, 0, 5292, 0, 0, 42688,
+ 5302, 3970, 73516, 0, 1793, 0, 0, 0, 0, 0, 65263, 0, 0, 0, 0, 0, 0,
+ 13219, 9569, 69567, 74383, 0, 0, 72157, 0, 42949, 0, 0, 0, 5322, 0, 0,
+ 43631, 5324, 0, 128694, 41614, 65269, 6230, 0, 0, 0, 3360, 0, 11523,
+ 72726, 92488, 9926, 7197, 0, 68429, 126575, 41821, 1249, 0, 127951, 0,
+ 123641, 0, 0, 0, 74459, 41807, 0, 41815, 0, 0, 0, 119918, 0, 128248, 0,
+ 66835, 0, 0, 72145, 41800, 0, 0, 0, 41811, 74466, 93966, 6670, 77882, 0,
+ 0, 43092, 0, 0, 0, 0, 0, 128655, 0, 0, 0, 0, 74501, 74005, 0, 74387,
+ 69860, 315, 12813, 128556, 72409, 0, 72408, 0, 0, 73061, 0, 0, 1378, 0,
+ 0, 0, 72407, 3066, 0, 0, 72406, 0, 0, 0, 8787, 194615, 0, 41618, 0, 0, 0,
+ 194614, 64652, 194611, 42088, 125226, 0, 0, 0, 0, 7176, 43756, 0, 122649,
+ 74492, 0, 74534, 0, 0, 0, 127199, 0, 128630, 74525, 0, 194594, 12930,
+ 7168, 74514, 0, 74515, 0, 128919, 43962, 9527, 120659, 70123, 12977,
+ 69723, 0, 93783, 194598, 41236, 92235, 65168, 118838, 41237, 5848, 0,
+ 194600, 3670, 129905, 129906, 129907, 129908, 7890, 0, 11298, 0, 0, 6229,
+ 0, 0, 0, 194593, 128907, 0, 0, 194592, 4120, 65337, 65336, 0, 0, 0, 0,
+ 9366, 0, 0, 0, 65327, 65326, 65325, 65324, 65323, 42216, 65321, 65320,
+ 65335, 65334, 65333, 65332, 65331, 65330, 65329, 42689, 0, 43943, 118885,
+ 42073, 6785, 68491, 0, 42076, 7196, 65318, 2035, 65316, 4106, 65314,
+ 65313, 42074, 0, 41228, 0, 0, 41241, 93786, 41239, 43533, 0, 7189,
+ 194602, 0, 43941, 0, 42802, 0, 8487, 0, 0, 4615, 12695, 0, 0, 12175,
+ 100414, 0, 0, 7809, 0, 0, 0, 0, 6590, 69762, 0, 64738, 0, 0, 0, 0, 0, 0,
+ 2025, 0, 0, 0, 10637, 71860, 0, 1570, 43839, 2835, 83052, 10624, 43623,
+ 194587, 0, 78433, 0, 42812, 0, 2825, 0, 128287, 0, 2821, 0, 92327, 7365,
+ 83043, 0, 68296, 0, 2823, 0, 0, 0, 2831, 0, 0, 11465, 0, 0, 0, 0, 0,
+ 7181, 92855, 41332, 0, 12333, 0, 0, 0, 124914, 0, 9883, 127294, 73906,
+ 70751, 0, 71863, 0, 0, 0, 0, 0, 0, 43741, 0, 8166, 70739, 0, 0, 74535, 0,
+ 65297, 68294, 571, 0, 8752, 0, 5288, 118822, 1541, 0, 127284, 8864, 0,
+ 73559, 0, 0, 0, 113778, 12151, 0, 66874, 0, 1035, 0, 0, 7881, 701, 65936,
+ 128493, 0, 70462, 0, 11403, 0, 0, 82991, 0, 983143, 70472, 3994, 11421,
+ 121217, 127297, 127242, 127300, 70659, 127303, 0, 125205, 2855, 127828,
+ 0, 41621, 68214, 0, 0, 10654, 82945, 119226, 12164, 41623, 7906, 0,
+ 74297, 7182, 0, 83069, 0, 0, 0, 0, 121115, 0, 0, 747, 0, 92463, 12019,
+ 43136, 0, 110861, 0, 0, 8001, 0, 0, 69394, 0, 0, 0, 68373, 0, 0, 0,
+ 128279, 0, 71915, 0, 129742, 7282, 94066, 0, 0, 0, 0, 0, 5286, 83061, 0,
+ 3718, 0, 83057, 78933, 124906, 71905, 0, 128480, 0, 0, 0, 0, 9206, 82980,
+ 113824, 6802, 0, 41653, 0, 1241, 0, 0, 0, 0, 68124, 41651, 42937, 0,
+ 83042, 41650, 0, 83037, 0, 12914, 2814, 0, 119552, 120691, 0, 0, 71968,
+ 0, 0, 0, 917546, 71862, 0, 0, 0, 3494, 10189, 69784, 0, 0, 71861, 0, 0,
+ 65875, 0, 0, 127762, 0, 74215, 43065, 0, 0, 7200, 0, 3261, 0, 0, 0,
+ 65889, 71888, 71975, 0, 0, 0, 0, 0, 77793, 0, 0, 129424, 77791, 635, 0,
+ 0, 74753, 0, 92420, 73997, 0, 0, 43905, 0, 118834, 126125, 0, 6667, 0,
+ 983268, 0, 0, 125200, 0, 0, 0, 0, 83137, 0, 0, 0, 0, 0, 121104, 127856,
+ 125112, 71885, 0, 120125, 7866, 194573, 92770, 194574, 0, 120140, 126074,
+ 2849, 0, 0, 42157, 12960, 0, 11812, 0, 74509, 0, 69881, 0, 0, 0, 123156,
+ 7178, 0, 0, 0, 0, 129041, 11534, 1967, 0, 0, 71361, 7015, 120298, 72757,
+ 0, 12989, 0, 9368, 983638, 1624, 43270, 0, 0, 10818, 0, 83091, 0, 120908,
+ 0, 0, 0, 0, 0, 0, 6169, 12871, 0, 2798, 65176, 4958, 42752, 119025, 0, 0,
+ 0, 70346, 66448, 0, 113780, 68364, 0, 0, 0, 68360, 0, 73746, 120945,
+ 68352, 0, 73787, 83110, 2154, 7199, 64955, 0, 0, 0, 0, 71980, 66507, 0,
+ 69853, 0, 0, 0, 0, 0, 0, 0, 92517, 118882, 120301, 13297, 0, 129446,
+ 71963, 0, 0, 0, 6658, 8045, 0, 0, 983873, 92319, 83101, 0, 72126, 0, 0,
+ 0, 2416, 3310, 0, 0, 379, 0, 43755, 0, 0, 0, 68362, 1284, 0, 73756, 0, 0,
+ 83141, 70784, 71977, 0, 0, 0, 8515, 83144, 83143, 0, 0, 0, 8529, 93782,
+ 0, 7564, 0, 0, 0, 0, 73757, 73760, 42359, 0, 2031, 0, 7202, 129984,
+ 12676, 0, 0, 128418, 0, 7710, 1610, 73801, 0, 0, 118706, 983607, 43917,
+ 0, 9974, 228, 0, 10398, 0, 0, 0, 92241, 70062, 118927, 42999, 1725,
+ 65533, 8196, 9352, 0, 0, 66868, 0, 8502, 5762, 0, 0, 43898, 0, 0, 0, 0,
+ 43914, 0, 126507, 64598, 13001, 9326, 83082, 43916, 1557, 0, 983879,
+ 6330, 6805, 8631, 2545, 70052, 0, 0, 0, 42998, 70410, 0, 42762, 71941,
+ 42914, 126516, 262, 1637, 0, 83025, 129491, 83026, 128757, 0, 0, 0,
+ 128922, 0, 43658, 0, 0, 129183, 6419, 0, 0, 0, 0, 93989, 0, 128173, 7194,
+ 5291, 67395, 43666, 0, 0, 0, 0, 128293, 0, 12881, 123596, 0, 73842, 0,
+ 9011, 0, 0, 0, 70436, 179, 43644, 0, 0, 64747, 0, 118813, 0, 0, 121389,
+ 92649, 126629, 0, 73850, 2801, 119495, 42069, 119839, 119838, 119841,
+ 42072, 92736, 119842, 0, 0, 0, 8377, 0, 42070, 119313, 119834, 119310,
+ 4389, 43656, 1633, 119857, 118632, 119859, 11119, 119845, 119844, 9967,
+ 119846, 119849, 4612, 92867, 119850, 42913, 70456, 0, 71983, 10782,
+ 66898, 0, 119141, 0, 0, 0, 11541, 69636, 0, 0, 119614, 2731, 0, 0, 0,
+ 4102, 0, 73878, 0, 0, 0, 0, 0, 11283, 0, 0, 0, 0, 0, 43674, 0, 0, 126705,
+ 0, 0, 0, 0, 11142, 128304, 0, 12975, 0, 123208, 0, 0, 74072, 0, 55269, 0,
+ 0, 0, 78577, 78576, 0, 0, 82966, 82974, 70448, 0, 0, 82968, 0, 0, 0, 0,
+ 0, 113809, 0, 69399, 64909, 0, 11790, 74019, 0, 128066, 0, 8561, 94076,
+ 129481, 125045, 69259, 65674, 7230, 0, 0, 8778, 0, 0, 67725, 2071, 0,
+ 6459, 68325, 7628, 65092, 73903, 0, 11342, 129388, 0, 0, 93965, 94081, 0,
+ 11810, 70057, 10723, 967, 0, 71973, 73905, 0, 6387, 0, 12307, 43913,
+ 121089, 0, 127584, 0, 1886, 0, 43895, 870, 7648, 0, 7662, 7652, 876, 871,
+ 877, 7665, 878, 42015, 879, 43692, 4563, 0, 0, 0, 73072, 867, 9520, 872,
+ 7656, 868, 873, 7642, 7659, 869, 874, 7644, 0, 875, 790, 0, 0, 0, 0, 0,
+ 124899, 0, 0, 0, 0, 0, 68452, 0, 0, 42067, 0, 0, 0, 12292, 0, 0, 0,
+ 42012, 0, 0, 83388, 0, 0, 8494, 4611, 0, 72344, 0, 9679, 0, 0, 0, 0,
+ 93015, 0, 74364, 4628, 4245, 0, 0, 0, 1851, 0, 127189, 0, 0, 0, 118897,
+ 0, 64674, 124971, 983887, 8829, 983693, 128864, 0, 0, 0, 0, 8809, 983696,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 7427, 0, 4588, 43680, 72300, 74484, 0, 0, 0,
+ 0, 113787, 74363, 129043, 0, 793, 0, 11197, 0, 0, 0, 842, 0, 8208, 70833,
+ 0, 1647, 0, 70841, 0, 73508, 818, 0, 0, 0, 0, 0, 0, 120594, 0, 0, 70179,
+ 0, 13167, 66359, 0, 127172, 0, 4969, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2840, 0,
+ 0, 0, 66887, 65877, 9068, 0, 68194, 0, 0, 12991, 0, 2651, 68016, 983915,
+ 0, 983264, 70835, 0, 70844, 43648, 0, 0, 0, 0, 0, 0, 64372, 121064, 7458,
+ 655, 752, 7457, 7456, 7452, 3285, 74894, 11152, 73099, 0, 2391, 93766,
+ 92271, 671, 7435, 7434, 618, 668, 610, 42800, 7431, 7451, 42801, 640,
+ 42927, 7448, 7439, 628, 3905, 100742, 0, 0, 0, 67850, 0, 0, 0, 4605, 0,
+ 100745, 43372, 65945, 72710, 0, 119590, 0, 0, 70495, 987, 71229, 11572,
+ 0, 0, 10002, 9971, 70673, 0, 0, 0, 0, 0, 0, 11334, 0, 129493, 42364,
+ 11503, 0, 0, 0, 4627, 70090, 127784, 73473, 0, 74046, 68872, 92562, 0, 0,
+ 129900, 0, 129812, 0, 0, 42569, 64965, 0, 0, 10516, 129828, 12190, 0,
+ 42140, 0, 0, 0, 0, 9887, 0, 4000, 7429, 7428, 665, 7424, 0, 0, 7884, 0,
+ 0, 0, 0, 0, 2509, 0, 120573, 0, 0, 92449, 0, 10690, 0, 119114, 126226, 0,
+ 0, 73080, 4590, 0, 74440, 0, 0, 0, 1708, 0, 0, 983609, 0, 0, 69226,
+ 69974, 8813, 0, 1066, 0, 0, 71965, 127921, 70447, 0, 0, 0, 2202, 0, 7516,
+ 0, 0, 0, 8034, 0, 0, 3631, 110696, 0, 0, 8416, 110694, 71937, 0, 0,
+ 110692, 74621, 0, 70185, 0, 74850, 0, 0, 12099, 70475, 0, 6252, 0, 0, 0,
+ 0, 0, 0, 66368, 0, 64956, 7071, 129070, 70457, 128159, 118800, 0, 77757,
+ 0, 9357, 0, 1773, 0, 125092, 0, 68451, 7745, 9844, 0, 0, 94, 1880,
+ 120929, 0, 0, 0, 0, 0, 0, 0, 0, 11237, 0, 129173, 0, 0, 0, 1757, 6964,
+ 42480, 72823, 0, 120806, 0, 0, 7731, 0, 0, 127883, 0, 77777, 43988,
+ 70423, 74758, 0, 7592, 856, 74299, 0, 0, 0, 78138, 1459, 0, 0, 0, 0, 0,
+ 1504, 0, 0, 0, 0, 7529, 0, 0, 0, 0, 12594, 0, 0, 336, 0, 7509, 0, 0, 0,
+ 0, 127882, 0, 0, 0, 65859, 0, 983986, 43062, 124948, 0, 0, 0, 0, 12970,
+ 0, 0, 0, 0, 0, 0, 0, 119247, 0, 65068, 74291, 122938, 7069, 0, 0, 66977,
+ 11130, 2087, 0, 0, 0, 0, 126249, 0, 92747, 0, 92614, 2091, 0, 2090, 0, 0,
+ 7117, 2077, 72281, 0, 77889, 2083, 0, 71196, 0, 0, 71981, 0, 0, 0, 0,
+ 4165, 8746, 0, 0, 0, 0, 129572, 7066, 77779, 70415, 128135, 0, 0, 7786,
+ 127766, 2233, 0, 124965, 121122, 2302, 0, 0, 7056, 0, 0, 0, 0, 118639, 0,
+ 126506, 6920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 983099, 70438, 2613, 0, 0,
+ 110734, 0, 74571, 42760, 0, 0, 0, 0, 0, 0, 71843, 0, 0, 70506, 1246,
+ 74243, 0, 0, 41008, 0, 0, 0, 921, 70048, 0, 12702, 119500, 0, 1566, 8407,
+ 0, 64653, 0, 74617, 0, 0, 72711, 5313, 951, 0, 0, 0, 0, 77807, 4009,
+ 70277, 71844, 0, 83123, 0, 72250, 0, 119898, 113760, 0, 0, 0, 0, 70024,
+ 0, 0, 119892, 0, 0, 0, 119890, 2579, 119906, 3177, 11357, 69224, 0, 0,
+ 83130, 64734, 0, 9822, 110670, 70471, 110668, 66990, 110666, 66967, 0, 0,
+ 0, 9851, 983748, 110673, 9059, 110671, 77736, 0, 41687, 129054, 0, 71842,
+ 70178, 0, 66975, 1777, 67003, 10158, 69767, 122982, 42366, 70444, 0, 0,
+ 0, 70127, 71955, 5989, 110716, 74636, 126999, 0, 41685, 0, 0, 9769,
+ 41684, 0, 6225, 111328, 11740, 0, 118840, 0, 2600, 0, 70416, 0, 118720,
+ 3666, 70420, 127193, 71976, 0, 0, 74542, 69771, 0, 0, 0, 0, 0, 69765,
+ 77804, 252, 0, 69769, 0, 194616, 0, 69763, 0, 0, 0, 0, 0, 0, 0, 120947,
+ 0, 129410, 0, 118792, 0, 68323, 125219, 0, 119188, 0, 2177, 121335, 0, 0,
+ 0, 0, 0, 7764, 983745, 11094, 120825, 119490, 0, 92505, 8298, 0, 0, 0, 0,
+ 0, 64449, 0, 126650, 0, 0, 0, 70442, 0, 0, 0, 0, 7774, 10607, 0, 0, 0, 0,
+ 0, 120764, 0, 0, 77746, 0, 3458, 0, 70053, 0, 120995, 0, 2602, 0, 0, 0,
+ 74907, 0, 0, 0, 0, 172, 0, 4971, 70419, 1889, 7238, 0, 0, 0, 8257, 0, 0,
+ 78917, 129570, 0, 111342, 71948, 0, 43366, 43363, 9807, 0, 0, 0, 72247,
+ 64479, 0, 0, 0, 113707, 0, 10900, 121355, 0, 0, 12048, 0, 64292, 0, 0, 0,
+ 6099, 94084, 129486, 0, 0, 299, 0, 8525, 92356, 0, 0, 111338, 0, 92564,
+ 3075, 0, 94053, 0, 94050, 0, 0, 70440, 0, 123590, 0, 0, 0, 2581, 11395,
+ 0, 0, 0, 0, 128584, 0, 0, 129423, 101092, 118855, 0, 0, 0, 7204, 70065,
+ 2588, 2914, 7011, 55281, 0, 7466, 0, 2883, 42253, 83118, 0, 0, 0, 83116,
+ 0, 41230, 68299, 0, 43571, 0, 6219, 0, 9980, 41232, 92245, 0, 66036,
+ 41229, 118967, 0, 120666, 94016, 0, 12711, 0, 0, 74289, 68472, 42857,
+ 66950, 0, 0, 0, 127306, 119006, 0, 11380, 72348, 0, 0, 0, 0, 0, 0, 0,
+ 983579, 12722, 0, 922, 0, 0, 983127, 74958, 3218, 120471, 120470, 120469,
+ 120476, 120475, 8569, 11404, 70450, 120463, 3214, 120461, 120468, 74910,
+ 3207, 120465, 78729, 78728, 78727, 0, 120460, 7425, 3205, 0, 78737,
+ 78736, 71729, 43383, 78733, 78732, 2606, 78730, 73897, 0, 11496, 1173, 0,
+ 0, 129135, 0, 0, 0, 120737, 120953, 120872, 120629, 378, 2610, 0, 0, 0,
+ 0, 0, 37, 7068, 0, 120480, 70421, 3209, 120477, 0, 120483, 9768, 120481,
+ 0, 0, 0, 0, 0, 0, 65510, 0, 100625, 0, 0, 0, 100627, 0, 126633, 0, 7060,
+ 100628, 0, 127752, 0, 69284, 70428, 71463, 0, 7380, 0, 0, 100593, 126997,
+ 0, 124900, 0, 71465, 121030, 3243, 0, 0, 0, 7050, 0, 70050, 0, 0, 122983,
+ 71466, 8203, 71102, 68241, 0, 65211, 194599, 983406, 118636, 0, 779,
+ 125061, 64367, 100906, 69901, 8193, 55279, 0, 0, 0, 7065, 0, 4346, 0, 0,
+ 908, 0, 0, 8982, 0, 0, 0, 782, 0, 10883, 0, 0, 129396, 65542, 121302, 0,
+ 68650, 100575, 92244, 0, 0, 111351, 0, 4376, 0, 11787, 12961, 0, 0,
+ 42888, 0, 100610, 6231, 0, 65713, 100608, 1783, 0, 68238, 0, 0, 0,
+ 194945, 0, 0, 0, 68653, 0, 983051, 0, 764, 0, 0, 43531, 0, 9033, 0, 0,
+ 6223, 11042, 0, 0, 0, 0, 0, 917792, 0, 0, 0, 0, 0, 0, 120648, 0, 0, 0, 0,
+ 0, 0, 71971, 0, 1478, 78923, 11825, 2607, 0, 0, 0, 74543, 0, 0, 100588,
+ 6132, 0, 0, 0, 70058, 0, 0, 0, 43537, 6761, 10093, 4369, 0, 0, 73735,
+ 100564, 3947, 110778, 0, 0, 0, 0, 100942, 0, 0, 0, 0, 0, 0, 7686, 0, 0,
+ 0, 100934, 0, 100944, 66577, 41221, 0, 42281, 0, 74024, 12293, 0, 94014,
+ 11794, 0, 120893, 1737, 0, 0, 0, 7205, 0, 9335, 12850, 77810, 2272, 7055,
+ 0, 0, 0, 67751, 0, 124910, 6780, 65067, 0, 1327, 68393, 983574, 0, 41217,
+ 0, 10018, 0, 0, 0, 100611, 68176, 41219, 0, 4147, 983171, 41216, 983712,
+ 2616, 70197, 68461, 65234, 0, 0, 0, 0, 119660, 0, 0, 0, 0, 127930,
+ 119580, 70675, 64943, 2608, 1470, 0, 0, 6227, 0, 0, 74775, 0, 0, 72320,
+ 101024, 0, 73822, 67456, 0, 0, 0, 0, 10876, 92482, 0, 0, 5834, 0, 6222,
+ 0, 0, 12086, 0, 1600, 64309, 0, 0, 68883, 127957, 93836, 0, 8882, 0,
+ 129415, 2570, 0, 0, 194606, 0, 0, 1234, 0, 13115, 110743, 110740, 100923,
+ 5002, 110739, 41286, 100926, 127019, 0, 0, 0, 0, 0, 0, 0, 41289, 0, 0,
+ 75051, 41272, 0, 0, 0, 0, 0, 124978, 0, 41279, 0, 0, 0, 11081, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 9637, 7112, 77975, 128984, 0, 10886, 0, 8548, 983860,
+ 0, 0, 0, 8076, 43048, 8290, 8291, 43051, 92570, 0, 2596, 0, 0, 41293, 0,
+ 0, 2393, 7058, 66432, 0, 68673, 0, 0, 0, 0, 0, 128558, 0, 0, 0, 0, 0,
+ 64696, 0, 0, 121086, 74165, 0, 0, 0, 0, 0, 0, 7063, 983183, 64893, 73096,
+ 0, 68038, 113757, 709, 0, 0, 1876, 0, 0, 120868, 8137, 110662, 67752,
+ 70850, 100832, 245, 100831, 11456, 41233, 7070, 0, 94046, 6136, 100835,
+ 0, 100781, 41235, 73474, 0, 100782, 100642, 432, 0, 100784, 65437, 0,
+ 100647, 128909, 0, 100641, 100649, 0, 100648, 0, 43215, 0, 0, 0, 0, 9052,
+ 0, 0, 110826, 110827, 74784, 10580, 0, 100845, 0, 64640, 983176, 74455,
+ 0, 129670, 70035, 0, 12652, 12199, 127030, 0, 2566, 11971, 0, 0, 1065, 0,
+ 0, 0, 2576, 0, 66819, 0, 984005, 129852, 0, 0, 983050, 983845, 0, 2921,
+ 119104, 0, 5772, 12968, 70055, 0, 0, 0, 2580, 983841, 0, 0, 70032, 0, 0,
+ 0, 128148, 0, 0, 121308, 11346, 0, 12054, 100824, 92426, 101112, 0,
+ 13091, 0, 0, 100821, 100828, 0, 127026, 128334, 74821, 0, 66295, 68037,
+ 68047, 127865, 13090, 0, 67492, 0, 118985, 0, 0, 0, 0, 0, 127824, 0, 0,
+ 100776, 119319, 42356, 42432, 100778, 92823, 0, 0, 0, 78752, 70030,
+ 66914, 0, 0, 7061, 0, 3854, 0, 70020, 68413, 0, 42319, 0, 0, 7067, 0, 0,
+ 0, 0, 0, 0, 127797, 9029, 43543, 92820, 2353, 119316, 0, 100769, 0,
+ 100768, 983178, 0, 0, 43664, 0, 0, 0, 12277, 0, 78122, 11066, 65233, 0,
+ 41224, 0, 0, 3747, 10522, 0, 77722, 1691, 41226, 0, 77724, 0, 41223,
+ 121135, 121299, 697, 0, 121051, 4244, 0, 0, 0, 13121, 128573, 0, 0, 0, 0,
+ 0, 0, 129879, 0, 65816, 68111, 0, 127933, 0, 0, 0, 0, 0, 0, 66895, 74602,
+ 0, 7123, 70038, 5785, 9198, 0, 100810, 0, 7383, 64656, 0, 0, 0, 0, 0, 0,
+ 0, 0, 13122, 0, 191, 70060, 8585, 126610, 64411, 0, 0, 64850, 41072,
+ 118996, 0, 0, 0, 0, 78907, 127010, 100753, 0, 100756, 683, 396, 0,
+ 100758, 0, 100757, 43058, 100760, 343, 7129, 42680, 0, 0, 0, 0, 0,
+ 100761, 0, 74040, 0, 1724, 0, 119321, 0, 0, 2203, 0, 0, 0, 6592, 0,
+ 983044, 0, 0, 0, 0, 3730, 1778, 0, 0, 128854, 121254, 0, 9018, 0, 0, 0,
+ 0, 92763, 5547, 0, 0, 128950, 0, 0, 284, 8108, 0, 0, 74001, 0, 66460,
+ 7174, 92703, 126072, 0, 0, 4394, 127480, 0, 0, 0, 101082, 66459, 0, 7180,
+ 101084, 0, 92812, 68800, 42471, 0, 0, 67232, 64304, 42243, 101094, 2583,
+ 0, 77728, 0, 0, 0, 71702, 3855, 0, 0, 0, 0, 0, 0, 0, 92416, 7132, 0,
+ 92743, 0, 64756, 3798, 6578, 0, 0, 92481, 9774, 1275, 0, 119273, 983056,
+ 0, 120515, 7873, 77719, 129754, 0, 0, 77717, 0, 73994, 73992, 0, 0, 0,
+ 41851, 0, 41846, 126485, 92337, 7633, 41849, 68385, 70726, 3224, 0,
+ 69806, 0, 0, 0, 1510, 68129, 0, 0, 0, 0, 12109, 0, 0, 0, 0, 0, 78377,
+ 1910, 8671, 78374, 127118, 70290, 0, 0, 0, 2654, 7893, 0, 0, 0, 72394, 0,
+ 67394, 0, 118970, 70066, 78372, 78371, 78370, 78369, 78368, 0, 0, 0,
+ 1733, 0, 2568, 0, 0, 0, 0, 41486, 0, 127839, 7116, 0, 0, 0, 7185, 0, 0,
+ 0, 0, 0, 120575, 120829, 0, 0, 0, 0, 92489, 0, 0, 0, 70022, 7171, 0, 340,
+ 0, 0, 72980, 0, 128535, 0, 124979, 94073, 0, 0, 0, 11392, 92509, 0, 0, 0,
+ 0, 0, 0, 0, 100632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11948, 0, 6999, 617,
+ 983825, 0, 3675, 10600, 0, 0, 74616, 2617, 0, 0, 0, 128446, 0, 0, 8630,
+ 194771, 7288, 983828, 5545, 983818, 2586, 0, 0, 73123, 983851, 0, 0, 0,
+ 70847, 0, 0, 0, 0, 11195, 71708, 0, 7835, 70040, 0, 0, 92285, 0, 0,
+ 72973, 0, 0, 100852, 71118, 10029, 983167, 0, 0, 70033, 11359, 0, 0,
+ 194782, 0, 0, 118975, 0, 0, 3903, 100893, 983858, 0, 120555, 0, 93036,
+ 110645, 0, 983565, 0, 0, 194773, 0, 0, 0, 127238, 983822, 100919, 0,
+ 100918, 64752, 0, 983139, 100920, 118642, 43045, 100904, 0, 0, 0, 66394,
+ 7128, 0, 0, 0, 0, 0, 43044, 2604, 0, 100851, 43046, 121421, 69985, 11768,
+ 43043, 10470, 0, 7122, 194789, 4390, 454, 41397, 194792, 0, 78762, 0, 0,
+ 120576, 64572, 0, 68091, 2394, 2575, 113749, 0, 0, 74802, 100913, 129280,
+ 0, 0, 11989, 0, 0, 128856, 0, 0, 8249, 128172, 0, 0, 6640, 74806, 2598,
+ 513, 0, 6586, 127521, 129301, 120710, 65008, 0, 0, 92515, 0, 194795,
+ 66755, 0, 126585, 0, 43152, 78637, 0, 194797, 0, 69893, 6582, 0, 0,
+ 12839, 0, 78906, 983221, 0, 2444, 119489, 66620, 0, 0, 0, 0, 69894, 0, 0,
+ 0, 0, 4238, 11071, 9459, 68437, 78140, 78139, 0, 10079, 128985, 0, 0, 0,
+ 0, 11907, 43928, 0, 0, 0, 0, 92490, 43929, 0, 43926, 64498, 0, 9506,
+ 6978, 126234, 0, 0, 0, 0, 43934, 0, 1122, 65564, 0, 71055, 0, 0, 1920, 0,
+ 43930, 827, 0, 0, 0, 0, 6577, 1304, 64733, 0, 10606, 0, 0, 69503, 9329,
+ 92997, 9239, 74422, 0, 129373, 1222, 11076, 0, 69229, 43615, 8262, 72280,
+ 64627, 19909, 983554, 72279, 0, 287, 0, 233, 0, 0, 42816, 0, 0, 65140,
+ 128158, 8830, 0, 0, 10524, 41175, 125033, 72294, 0, 5296, 0, 127559, 0,
+ 0, 0, 127154, 74858, 6516, 6515, 6514, 6513, 6512, 0, 70870, 0, 0, 0,
+ 12122, 92462, 100868, 43976, 1785, 92507, 0, 0, 917771, 5138, 0, 0, 0,
+ 100884, 0, 0, 0, 123564, 0, 5134, 69980, 322, 4643, 5132, 0, 194942, 0,
+ 5143, 0, 72309, 119628, 0, 0, 72112, 0, 129964, 0, 0, 0, 0, 0, 0, 73097,
+ 0, 0, 0, 127923, 0, 0, 0, 0, 0, 3234, 0, 100886, 0, 100889, 118924, 0, 0,
+ 100875, 68231, 74489, 100872, 120746, 0, 100876, 0, 12714, 0, 64585,
+ 93775, 0, 0, 0, 129428, 0, 11027, 0, 10059, 0, 64524, 9767, 789, 1749, 0,
+ 66766, 984010, 320, 0, 0, 0, 3049, 0, 6471, 0, 74479, 9925, 127356,
+ 127355, 127358, 4960, 5549, 127359, 127346, 127345, 127348, 5418, 127350,
+ 3351, 120892, 127351, 10610, 5414, 93789, 0, 4286, 5421, 127344, 67867,
+ 0, 127794, 0, 6653, 122958, 0, 64510, 0, 41868, 0, 128823, 0, 0, 11613,
+ 70737, 12603, 7131, 11108, 4566, 0, 0, 0, 0, 0, 124938, 127369, 0, 0,
+ 5200, 0, 129484, 0, 9183, 127361, 74458, 73075, 395, 5482, 1376, 4349, 0,
+ 0, 5196, 0, 6113, 42009, 5205, 0, 120530, 0, 118973, 70467, 0, 0, 129691,
+ 0, 9126, 70498, 0, 0, 0, 0, 0, 3203, 192, 0, 3385, 120785, 128620, 5383,
+ 0, 0, 0, 5738, 69449, 3336, 0, 5361, 9633, 0, 0, 0, 0, 8581, 0, 1260,
+ 3149, 5359, 12962, 74955, 10441, 5357, 0, 0, 0, 5364, 0, 11431, 0, 9101,
+ 0, 0, 0, 0, 78378, 121155, 42917, 0, 129179, 0, 0, 0, 43360, 78385,
+ 78384, 78383, 78382, 78381, 78380, 78379, 9319, 7097, 0, 127748, 0, 0, 0,
+ 120632, 0, 71205, 0, 0, 0, 1720, 0, 0, 0, 8622, 0, 70430, 68772, 0, 0, 0,
+ 73084, 0, 0, 11921, 0, 11769, 68782, 0, 0, 0, 0, 194571, 41586, 0, 0, 0,
+ 3356, 194572, 64709, 194575, 0, 7134, 0, 78389, 0, 677, 0, 0, 0, 129474,
+ 68747, 0, 68751, 3349, 74125, 0, 8927, 0, 0, 0, 0, 0, 0, 0, 6806, 0,
+ 8384, 68755, 0, 0, 0, 0, 0, 124924, 0, 7113, 7586, 0, 10852, 0, 0, 4606,
+ 0, 0, 70084, 0, 0, 1046, 7124, 121192, 68753, 0, 5171, 65539, 0, 0, 0,
+ 42394, 0, 74849, 127823, 0, 5169, 11935, 0, 0, 3175, 0, 1537, 0, 5176,
+ 8905, 4136, 4871, 78388, 0, 0, 122661, 0, 1128, 0, 0, 0, 74066, 0, 73069,
+ 0, 0, 3662, 113767, 3378, 0, 71298, 0, 127995, 6320, 71302, 983163,
+ 10163, 0, 5165, 5126, 0, 66902, 41389, 0, 71368, 3374, 113740, 0, 7119,
+ 0, 0, 3507, 0, 7629, 6848, 19925, 0, 68463, 183, 127208, 127209, 70811,
+ 10636, 0, 128465, 2250, 0, 78772, 0, 0, 0, 78768, 6580, 4332, 123584, 0,
+ 10726, 66686, 127203, 127204, 127205, 127206, 0, 70813, 127201, 127202,
+ 0, 0, 5448, 41058, 5446, 0, 0, 71369, 5442, 7135, 0, 0, 5451, 0, 78470,
+ 0, 0, 0, 0, 11243, 10859, 65867, 10345, 10409, 123606, 0, 0, 129077,
+ 42181, 0, 0, 2060, 0, 7111, 0, 0, 0, 0, 72741, 0, 205, 93784, 72346,
+ 93771, 0, 9862, 6588, 43257, 0, 0, 0, 5505, 93760, 5503, 65376, 0, 7125,
+ 9819, 0, 0, 0, 5507, 12044, 194567, 0, 0, 0, 7109, 0, 0, 7911, 10329,
+ 10393, 8991, 125104, 69778, 11133, 129619, 8550, 0, 5592, 2919, 0, 0,
+ 5595, 0, 0, 4367, 0, 0, 5591, 41060, 5594, 0, 0, 13142, 5590, 0, 72274,
+ 118909, 75069, 123586, 9731, 71225, 64633, 0, 0, 71217, 121361, 71227, 0,
+ 0, 0, 0, 7137, 0, 0, 0, 10551, 10710, 0, 0, 0, 120570, 0, 92364, 9936,
+ 3348, 0, 0, 1444, 119058, 0, 74206, 983107, 0, 1442, 129080, 0, 120959,
+ 0, 0, 0, 0, 0, 0, 0, 3334, 73068, 118803, 0, 0, 71219, 69770, 1651, 0,
+ 8861, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43626, 0, 0, 3344, 0, 0, 12920, 0,
+ 0, 0, 71853, 3438, 128711, 0, 0, 0, 0, 129068, 0, 0, 65117, 0, 0, 0, 0,
+ 66366, 128915, 0, 69772, 0, 0, 0, 0, 4973, 8784, 0, 0, 0, 0, 0, 0, 0,
+ 125198, 983288, 0, 0, 66413, 0, 0, 0, 0, 122663, 9243, 2464, 0, 0, 3372,
+ 0, 0, 0, 70364, 7121, 0, 0, 0, 92163, 0, 0, 0, 0, 0, 0, 0, 3354, 0, 0,
+ 983104, 101233, 0, 3876, 0, 127983, 6858, 43696, 43380, 0, 74240, 0, 0,
+ 0, 983985, 75074, 6589, 0, 0, 120993, 0, 0, 69609, 0, 66962, 0, 10630,
+ 71960, 0, 121293, 0, 0, 121287, 917942, 121337, 121215, 0, 0, 0, 0, 0,
+ 917940, 3366, 0, 917938, 0, 0, 0, 71062, 0, 121197, 0, 6925, 71856, 0,
+ 917929, 66780, 66274, 0, 72768, 0, 917930, 129482, 11138, 0, 6754, 7118,
+ 0, 64672, 65296, 0, 118957, 0, 0, 12296, 68457, 121320, 0, 5282, 0,
+ 72278, 0, 0, 0, 0, 0, 0, 66355, 0, 0, 68073, 64343, 0, 92744, 195058,
+ 195029, 0, 0, 195056, 195027, 0, 0, 128814, 195025, 6584, 195026, 10657,
+ 0, 74544, 0, 1200, 12243, 92269, 195062, 0, 129300, 11545, 0, 120493,
+ 3343, 4424, 11047, 0, 69863, 3896, 0, 0, 2947, 0, 0, 42221, 0, 68139,
+ 13059, 7942, 0, 3381, 0, 0, 0, 0, 0, 0, 78235, 0, 0, 0, 7044, 65800,
+ 78236, 0, 7045, 7175, 7047, 127884, 11791, 0, 0, 3881, 0, 0, 127395, 0,
+ 0, 67075, 7106, 72000, 0, 0, 74211, 41897, 92513, 0, 73040, 66745, 0, 0,
+ 0, 0, 121245, 0, 64354, 73083, 8777, 0, 129108, 8884, 2385, 73067, 92450,
+ 0, 0, 0, 42027, 12114, 0, 0, 64936, 0, 0, 0, 0, 0, 126605, 0, 0, 0, 0,
+ 73064, 0, 0, 0, 0, 0, 0, 0, 73057, 0, 123587, 0, 0, 0, 0, 0, 70803, 0, 0,
+ 124953, 0, 0, 0, 7048, 11087, 123600, 92536, 7043, 9600, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 42050, 0, 55289, 0, 0, 657, 0, 195054, 4461, 92903, 0, 92904,
+ 126490, 0, 4468, 0, 0, 0, 4456, 73070, 10720, 123588, 0, 123544, 0, 0, 0,
+ 195046, 260, 7714, 74163, 2045, 0, 65064, 4466, 0, 0, 128087, 129768,
+ 41403, 0, 0, 0, 41406, 120692, 0, 0, 73939, 0, 0, 0, 41404, 1165, 0,
+ 4451, 13087, 0, 11258, 0, 73855, 0, 43014, 5439, 12061, 74586, 3375,
+ 128869, 0, 0, 0, 0, 0, 0, 0, 113823, 67078, 0, 67079, 0, 0, 0, 0, 68459,
+ 0, 0, 0, 0, 0, 0, 7280, 0, 0, 0, 4868, 8297, 0, 0, 42791, 0, 66737,
+ 66739, 0, 0, 5182, 0, 0, 72764, 0, 4465, 0, 12135, 0, 4464, 0, 0, 977,
+ 4458, 43827, 0, 0, 120888, 0, 344, 67463, 0, 0, 0, 0, 92240, 0, 64443,
+ 126995, 73078, 129525, 0, 0, 0, 43026, 7612, 119591, 64413, 0, 0, 0, 0,
+ 0, 0, 0, 0, 123622, 0, 119160, 10204, 127947, 73063, 0, 0, 127236, 0,
+ 68746, 0, 8852, 0, 0, 0, 0, 128427, 123597, 7932, 92858, 128463, 0, 0,
+ 72453, 0, 0, 0, 0, 74893, 9567, 0, 73095, 0, 8650, 0, 0, 0, 69900,
+ 118872, 0, 70868, 0, 6719, 0, 0, 0, 72836, 0, 0, 118991, 0, 123594,
+ 73815, 4420, 0, 10583, 7760, 0, 0, 128752, 71711, 0, 128407, 0, 0, 77809,
+ 9066, 0, 74795, 0, 0, 0, 0, 0, 0, 0, 42825, 41854, 5304, 0, 124942, 6919,
+ 8619, 0, 10038, 66454, 9592, 129049, 0, 0, 110771, 110777, 110772, 0, 0,
+ 0, 0, 0, 78498, 110773, 43624, 0, 7779, 0, 0, 9479, 78493, 0, 66956,
+ 2224, 0, 0, 0, 0, 0, 42378, 3368, 0, 66804, 7697, 69237, 0, 2030, 0,
+ 68236, 8370, 0, 66953, 0, 0, 983355, 127903, 983353, 983352, 5174, 42831,
+ 983349, 70439, 983347, 8881, 119047, 0, 70433, 0, 0, 0, 0, 0, 0, 9576, 0,
+ 3347, 4160, 5154, 0, 3794, 0, 0, 0, 0, 0, 127916, 73073, 8381, 4572,
+ 69564, 126101, 0, 0, 0, 0, 0, 0, 0, 92283, 0, 0, 5799, 983344, 70100,
+ 983342, 983341, 983340, 43031, 64425, 65128, 983336, 0, 73059, 0, 68616,
+ 0, 0, 0, 0, 119826, 0, 0, 123604, 0, 0, 283, 68665, 0, 532, 0, 0, 983827,
+ 0, 0, 3370, 73077, 119132, 5443, 71431, 0, 118630, 0, 0, 0, 2298, 0, 0,
+ 0, 983335, 983334, 983333, 983332, 7144, 983330, 119600, 983328, 983327,
+ 983326, 0, 78816, 128833, 0, 0, 0, 0, 0, 0, 0, 0, 73088, 0, 123592,
+ 983952, 0, 0, 0, 0, 5186, 7360, 127837, 0, 12108, 0, 65124, 0, 0, 0,
+ 6326, 43344, 0, 0, 42562, 0, 0, 0, 983325, 65495, 983323, 101066, 983321,
+ 101065, 983319, 65490, 983317, 125034, 0, 101070, 127178, 55245, 128927,
+ 1630, 128232, 65483, 0, 0, 0, 65476, 0, 0, 119214, 9283, 10183, 0, 0,
+ 65499, 0, 64593, 66758, 3376, 0, 0, 0, 101077, 43872, 12940, 0, 0, 78587,
+ 101078, 5957, 0, 8926, 983315, 983314, 983313, 10745, 10174, 983310,
+ 113793, 983308, 983307, 983306, 0, 123593, 5056, 0, 0, 0, 120773, 0,
+ 9812, 0, 4460, 127792, 73066, 0, 128038, 0, 123608, 0, 64278, 0, 0, 0,
+ 66760, 0, 0, 70122, 0, 0, 917627, 0, 73823, 101071, 127922, 2276, 0,
+ 42579, 0, 983305, 983304, 127831, 983302, 983301, 983300, 983299, 983298,
+ 74207, 121255, 10482, 12863, 73002, 2412, 0, 9522, 0, 983906, 120674,
+ 101059, 3384, 101058, 10702, 830, 0, 128166, 0, 8451, 0, 0, 121380,
+ 69739, 128957, 0, 0, 0, 0, 0, 0, 0, 4243, 92454, 73093, 0, 129705, 4441,
+ 0, 983295, 983294, 66618, 983292, 125141, 411, 983289, 68068, 983287,
+ 4056, 983913, 0, 92666, 0, 983916, 983968, 0, 0, 3364, 42265, 64437,
+ 129635, 118816, 0, 9684, 216, 0, 1401, 0, 0, 0, 122643, 0, 0, 0, 11126,
+ 5768, 3191, 0, 0, 0, 0, 0, 0, 65895, 0, 0, 3338, 73935, 983283, 983282,
+ 983281, 129605, 983279, 983278, 2794, 8807, 0, 0, 110720, 0, 8312, 0,
+ 110718, 11953, 11662, 0, 0, 0, 0, 9534, 66767, 129040, 0, 11113, 0, 0,
+ 73082, 0, 981, 0, 4330, 119244, 120536, 1824, 0, 0, 7034, 41683, 123166,
+ 0, 73754, 0, 0, 74478, 128259, 983273, 983260, 983259, 43831, 983257,
+ 66752, 983255, 983254, 0, 70288, 65343, 0, 0, 43225, 0, 0, 0, 0, 126129,
+ 0, 128608, 0, 0, 0, 120726, 0, 983852, 11746, 0, 5216, 0, 0, 0, 0, 3468,
+ 127149, 9230, 65942, 0, 0, 5803, 120677, 0, 0, 13124, 0, 0, 0, 42843, 0,
+ 0, 0, 66753, 11739, 128318, 0, 128444, 0, 0, 0, 12448, 0, 121441, 13057,
+ 73852, 124994, 0, 0, 0, 0, 0, 0, 126612, 0, 68903, 0, 129470, 0, 917992,
+ 0, 0, 0, 0, 0, 0, 0, 92457, 0, 0, 0, 0, 0, 0, 0, 0, 125078, 0, 0, 0,
+ 10970, 92208, 0, 0, 0, 19944, 0, 9009, 8551, 0, 0, 0, 7575, 67484, 0,
+ 128899, 0, 129609, 78847, 0, 78846, 73502, 0, 69256, 0, 0, 0, 0, 9775,
+ 100682, 129191, 119052, 68629, 194703, 0, 0, 78850, 92880, 0, 0, 0, 0, 0,
+ 0, 0, 71273, 6184, 41540, 3303, 66182, 11786, 66180, 66203, 3422, 0,
+ 68290, 43007, 4478, 66178, 0, 0, 126216, 0, 4477, 0, 69608, 66184, 66183,
+ 66204, 66194, 0, 66198, 41880, 66188, 66197, 78148, 66195, 66190, 66191,
+ 41111, 66189, 73788, 7788, 0, 0, 0, 0, 0, 2221, 78163, 6535, 78161,
+ 78162, 430, 78160, 78156, 78158, 0, 0, 4945, 0, 4950, 0, 78165, 0, 67118,
+ 0, 5964, 12908, 0, 0, 0, 74477, 83390, 0, 4949, 0, 443, 0, 4944, 5467,
+ 119603, 983265, 0, 9364, 0, 119148, 4946, 0, 3788, 126106, 983718, 0,
+ 120847, 129858, 74441, 0, 0, 12072, 92248, 0, 983708, 0, 128676, 12091,
+ 0, 0, 0, 4673, 0, 4678, 0, 0, 65059, 43860, 0, 0, 0, 128151, 1199, 0,
+ 8356, 0, 0, 4677, 0, 0, 0, 2192, 78173, 78175, 78171, 78172, 72255,
+ 78170, 78166, 4674, 128450, 194944, 0, 124970, 0, 119579, 0, 129919,
+ 1855, 0, 0, 127806, 0, 0, 68912, 72323, 0, 12988, 121000, 0, 0, 0, 4654,
+ 6840, 983432, 0, 73993, 0, 4649, 65209, 983908, 93839, 4648, 122635,
+ 121169, 983436, 126231, 983427, 66846, 7828, 4650, 983426, 72879, 0,
+ 4653, 7822, 0, 0, 43187, 0, 983586, 6821, 0, 0, 0, 0, 0, 0, 66756,
+ 983433, 0, 0, 0, 8547, 0, 42165, 0, 119228, 6836, 0, 0, 4662, 0, 0, 0,
+ 9146, 599, 4657, 0, 120754, 0, 4656, 0, 0, 7811, 40994, 0, 6414, 5967,
+ 4658, 3725, 0, 5814, 4661, 127760, 194961, 0, 0, 64904, 0, 10833, 0, 0,
+ 4867, 128717, 0, 11459, 3054, 0, 40996, 0, 7605, 4622, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 19926, 0, 0, 65307, 4617, 0, 0, 0, 4616, 10518, 0, 127160, 0,
+ 5958, 0, 983449, 4618, 0, 983442, 120675, 4621, 0, 983444, 522, 125213,
+ 11139, 65803, 194972, 0, 12201, 6135, 121060, 983425, 0, 983093, 0,
+ 983423, 983416, 983437, 4638, 983421, 0, 78242, 5965, 78240, 66569,
+ 68646, 0, 983455, 74392, 5335, 0, 0, 4633, 0, 119045, 983451, 4632, 0,
+ 5542, 5333, 0, 983428, 68648, 5331, 4634, 0, 92870, 5338, 4637, 0, 0,
+ 43477, 0, 42493, 0, 42361, 0, 0, 73853, 0, 0, 0, 74204, 11343, 0, 10358,
+ 10422, 4758, 0, 1608, 5252, 0, 0, 4753, 78239, 11344, 78237, 0, 5231,
+ 74384, 0, 0, 118676, 0, 0, 0, 0, 71991, 5229, 4757, 0, 0, 5227, 4752, 0,
+ 65235, 5234, 73044, 0, 0, 0, 0, 0, 0, 7460, 0, 917936, 0, 0, 74760,
+ 65189, 0, 92230, 0, 0, 5574, 128980, 0, 65139, 5577, 0, 0, 118871, 68641,
+ 8965, 7635, 0, 5316, 70021, 5314, 74555, 5572, 0, 5312, 0, 5525, 5330,
+ 5319, 68292, 0, 65066, 0, 0, 983496, 0, 0, 127851, 0, 74851, 0, 0, 64609,
+ 0, 0, 128593, 0, 129339, 0, 8632, 0, 0, 0, 195012, 5735, 195013, 1692,
+ 70151, 4610, 122653, 4305, 0, 4609, 43478, 4614, 77753, 118534, 5287,
+ 5309, 5285, 0, 5961, 4647, 5283, 10743, 0, 71889, 601, 4613, 77759, 0,
+ 9208, 4608, 74044, 71107, 5190, 0, 0, 92410, 43965, 2265, 0, 0, 0, 0, 0,
+ 0, 0, 129953, 0, 0, 5960, 0, 8992, 65293, 0, 1782, 0, 0, 0, 0, 0, 5501,
+ 0, 42508, 69759, 120749, 129120, 0, 195023, 77740, 43900, 77741, 0,
+ 68134, 111180, 74209, 0, 64740, 0, 0, 0, 983935, 3767, 5737, 0, 4865, 0,
+ 5740, 0, 5736, 7724, 0, 7193, 0, 0, 5739, 77744, 4866, 0, 0, 0, 4869,
+ 67093, 0, 0, 128514, 6650, 983488, 0, 983479, 78376, 4870, 0, 68661,
+ 6716, 983478, 2190, 69786, 68676, 0, 10122, 4864, 66568, 0, 0, 0, 9603,
+ 68652, 126213, 42734, 745, 0, 124131, 124130, 4777, 0, 77788, 68631,
+ 42775, 68196, 0, 124128, 124129, 0, 5966, 0, 4778, 127890, 0, 0, 4781,
+ 127196, 64407, 0, 74132, 8577, 71221, 0, 71223, 0, 4782, 0, 0, 120757,
+ 68618, 43472, 43056, 68622, 0, 92986, 4776, 0, 11492, 0, 0, 13176, 0, 0,
+ 0, 73558, 0, 0, 0, 4849, 8242, 9561, 73922, 0, 0, 0, 0, 5963, 0, 125201,
+ 0, 4850, 72121, 0, 590, 4853, 0, 4854, 0, 5164, 0, 1605, 5124, 0, 111165,
+ 0, 8471, 0, 111164, 12445, 3785, 0, 111162, 0, 0, 4848, 2530, 0, 2068,
+ 1964, 0, 0, 10796, 0, 0, 0, 0, 0, 4794, 0, 0, 0, 4797, 68040, 111152,
+ 43465, 4792, 0, 0, 0, 0, 0, 110842, 983102, 92963, 0, 0, 0, 4221, 92360,
+ 118869, 0, 0, 0, 70042, 0, 0, 0, 0, 10739, 65090, 0, 119327, 126541, 0,
+ 0, 119326, 0, 0, 4937, 43376, 0, 0, 10597, 983445, 11722, 9248, 129566,
+ 42879, 11725, 0, 0, 7579, 11141, 73958, 4941, 0, 917538, 9140, 4936,
+ 5261, 0, 0, 72298, 0, 4942, 0, 4938, 0, 0, 5259, 9369, 983434, 111182,
+ 5257, 78932, 6844, 4964, 5264, 0, 0, 0, 41411, 0, 121473, 73684, 128233,
+ 9482, 4873, 41991, 64707, 42526, 127989, 64480, 64725, 983447, 0, 0, 0,
+ 0, 0, 0, 73043, 0, 389, 10893, 7521, 0, 4872, 5463, 0, 3125, 111124, 0,
+ 4878, 5459, 4604, 0, 0, 5465, 0, 0, 0, 0, 9563, 0, 0, 128419, 125273,
+ 82963, 0, 0, 0, 67735, 0, 0, 0, 0, 0, 73560, 0, 129707, 0, 917833, 0,
+ 917836, 0, 0, 3082, 0, 0, 0, 0, 118621, 7079, 5856, 917842, 5163, 0, 0,
+ 1817, 66724, 0, 0, 10564, 7763, 13077, 124115, 0, 68140, 111137, 0,
+ 77782, 0, 111139, 123548, 77787, 121457, 0, 0, 0, 983190, 73081, 0, 0,
+ 983118, 124114, 0, 42156, 0, 0, 0, 983080, 0, 0, 0, 119254, 120693, 0,
+ 69386, 0, 118881, 0, 78189, 0, 78186, 78188, 129654, 0, 0, 0, 110877, 0,
+ 3108, 9745, 0, 0, 0, 118825, 92785, 0, 122954, 0, 0, 10972, 92786, 0,
+ 42768, 715, 983114, 121117, 9453, 5348, 10943, 0, 983170, 92784, 0, 0,
+ 983154, 0, 0, 11551, 128464, 0, 0, 9051, 0, 71728, 0, 120791, 119523, 0,
+ 6404, 66458, 68376, 11984, 9156, 65222, 74454, 78180, 0, 3128, 4789,
+ 5067, 5066, 0, 4784, 0, 8827, 1146, 5065, 78196, 78192, 78193, 78190,
+ 78191, 5064, 5326, 0, 9450, 5063, 120361, 78200, 78201, 5062, 69733,
+ 74146, 0, 0, 0, 0, 77992, 0, 3933, 77768, 0, 12337, 0, 125023, 0, 0, 0,
+ 194759, 0, 0, 82993, 42130, 0, 5151, 917832, 120357, 0, 73523, 0, 7620,
+ 3800, 0, 0, 0, 127952, 0, 0, 4786, 127991, 4185, 0, 128742, 0, 983194,
+ 73978, 0, 4593, 77715, 77727, 124909, 0, 110715, 10532, 77732, 110714,
+ 110711, 110712, 64759, 1325, 5166, 9888, 0, 5148, 0, 0, 78205, 78206,
+ 64140, 78204, 64131, 3119, 917814, 0, 983438, 917820, 12095, 0, 0, 636,
+ 128002, 0, 983469, 0, 78531, 7836, 42741, 64137, 0, 118969, 0, 92431, 0,
+ 0, 0, 0, 0, 8618, 0, 11865, 0, 0, 0, 3937, 12312, 128261, 0, 0, 0, 912,
+ 6349, 4536, 71964, 0, 126594, 0, 0, 0, 3935, 120665, 0, 0, 0, 0, 118859,
+ 0, 121116, 0, 0, 12046, 12599, 0, 0, 0, 0, 7227, 0, 0, 0, 983066, 0, 0,
+ 0, 113817, 2179, 78246, 0, 0, 0, 0, 0, 127405, 101531, 0, 101530, 43907,
+ 0, 0, 0, 0, 4644, 8818, 0, 0, 0, 0, 93066, 66452, 126081, 1644, 101043,
+ 9658, 43744, 11385, 65947, 983174, 43983, 0, 0, 0, 8962, 0, 0, 2466,
+ 42039, 67669, 0, 0, 42117, 100698, 0, 0, 0, 0, 43745, 5318, 0, 77723, 0,
+ 0, 0, 7054, 64147, 0, 917804, 68195, 6698, 0, 0, 0, 70849, 11981, 12202,
+ 0, 121364, 0, 7059, 11608, 975, 0, 65843, 170, 0, 67239, 42708, 0, 0,
+ 6058, 0, 0, 0, 70507, 0, 0, 9818, 0, 0, 42106, 0, 983065, 4738, 42105,
+ 7062, 0, 4737, 11779, 4742, 120564, 92391, 0, 41374, 41375, 983381, 6715,
+ 12700, 7049, 983379, 0, 0, 0, 4741, 42108, 983370, 64159, 4736, 64148, 0,
+ 849, 0, 128247, 983366, 0, 120913, 917997, 0, 983384, 9496, 66371,
+ 983408, 983382, 11322, 0, 93008, 3928, 983153, 0, 10706, 7198, 0, 4842,
+ 12053, 0, 0, 4841, 0, 4171, 12008, 68416, 3923, 1490, 0, 0, 983398,
+ 40972, 5245, 72288, 983400, 126578, 0, 4845, 8332, 40974, 0, 4840, 9077,
+ 2252, 2408, 72851, 4825, 0, 917574, 0, 0, 126251, 0, 0, 983358, 0,
+ 983359, 0, 4826, 42440, 0, 0, 1274, 0, 74315, 0, 120384, 118614, 121200,
+ 0, 0, 0, 4830, 983393, 129044, 0, 0, 119082, 0, 64105, 0, 0, 4824,
+ 120397, 0, 0, 1888, 64127, 7861, 125111, 78524, 41836, 110613, 10873,
+ 72439, 0, 64098, 12214, 124134, 41834, 0, 358, 128120, 41833, 11442, 0,
+ 0, 0, 0, 64115, 0, 0, 0, 120721, 119053, 0, 119055, 119054, 0, 0, 0, 0,
+ 4017, 12827, 5241, 0, 73042, 41118, 3924, 0, 11366, 0, 0, 0, 0, 41116,
+ 69455, 0, 0, 0, 0, 11917, 0, 74000, 4721, 123551, 983937, 0, 0, 0, 0, 0,
+ 0, 122907, 0, 128702, 4722, 6816, 124974, 0, 4725, 67099, 4726, 0,
+ 129856, 123171, 0, 123194, 0, 0, 0, 4015, 0, 8052, 78766, 123538, 0,
+ 128294, 0, 0, 4720, 73090, 125003, 0, 0, 1656, 41831, 0, 0, 41843, 92846,
+ 0, 1452, 13111, 0, 0, 0, 8552, 64113, 41845, 64073, 120354, 0, 0, 120066,
+ 120067, 7064, 64070, 9948, 0, 0, 0, 92828, 2420, 92811, 0, 0, 0, 120052,
+ 120053, 120050, 74920, 3938, 120057, 120054, 92829, 120060, 71920,
+ 120058, 120059, 120064, 72203, 7955, 64074, 4713, 128196, 983108, 0, 0,
+ 0, 65152, 10198, 120044, 120045, 120042, 6713, 4532, 120049, 120046,
+ 120047, 4717, 7046, 0, 66450, 4712, 75055, 0, 121085, 0, 8155, 4718,
+ 3942, 4714, 9625, 0, 6383, 0, 12006, 0, 0, 0, 0, 0, 65414, 0, 0, 129061,
+ 66437, 66025, 74115, 0, 0, 11228, 4809, 0, 68211, 72352, 0, 0, 983101,
+ 65405, 129912, 0, 0, 2163, 4545, 0, 917566, 0, 4813, 78699, 0, 0, 4808,
+ 0, 0, 65475, 0, 0, 4814, 72240, 4810, 0, 0, 68784, 10761, 67514, 3522, 0,
+ 78693, 65404, 0, 0, 0, 0, 0, 6691, 70125, 0, 126223, 0, 0, 0, 43858,
+ 129914, 0, 12992, 65407, 0, 0, 3919, 72379, 0, 92845, 0, 0, 0, 12235,
+ 110748, 0, 0, 64091, 68739, 64080, 0, 64090, 0, 0, 0, 0, 0, 8454, 0, 0,
+ 983877, 0, 0, 120398, 4780, 0, 0, 92764, 64621, 6732, 0, 0, 0, 0, 121363,
+ 0, 0, 120817, 6976, 0, 119005, 0, 93809, 0, 93808, 0, 12526, 120399,
+ 2315, 0, 1938, 0, 0, 0, 0, 0, 0, 0, 111135, 93794, 0, 0, 0, 93810, 0,
+ 2291, 0, 0, 0, 0, 129429, 0, 10799, 0, 0, 66372, 0, 4193, 0, 0, 983057,
+ 7998, 0, 0, 0, 0, 2316, 0, 0, 0, 0, 120106, 0, 0, 74140, 0, 0, 0, 0,
+ 3762, 93813, 120672, 93820, 0, 0, 0, 70098, 3780, 12808, 8163, 983155, 0,
+ 0, 3906, 12349, 0, 8326, 0, 65498, 3763, 0, 5618, 0, 3779, 0, 43613, 0,
+ 128007, 0, 0, 0, 0, 280, 0, 126252, 983453, 13072, 1894, 0, 0, 65478,
+ 43310, 7231, 0, 11773, 0, 0, 0, 101517, 122662, 0, 7559, 11652, 10009,
+ 110765, 110766, 110763, 110764, 4470, 110762, 0, 0, 983446, 0, 5249, 0,
+ 0, 8756, 0, 0, 41694, 120585, 92349, 0, 0, 0, 69685, 123549, 983450,
+ 113794, 0, 6808, 41319, 13125, 66332, 127977, 0, 2290, 0, 983418, 0, 0,
+ 3943, 0, 41205, 0, 0, 0, 0, 5352, 0, 0, 41207, 0, 7384, 69647, 41204,
+ 123552, 41209, 69637, 0, 43607, 0, 0, 5420, 0, 10134, 0, 0, 4018, 7150,
+ 0, 0, 0, 0, 0, 129606, 2561, 65023, 0, 7148, 12076, 0, 0, 129201, 0,
+ 6276, 1706, 0, 0, 7146, 0, 128277, 41819, 74991, 0, 10847, 41822, 72248,
+ 860, 0, 0, 0, 69641, 10753, 41820, 126118, 0, 71898, 0, 92617, 128567, 0,
+ 121514, 43016, 0, 0, 92225, 0, 0, 0, 0, 4022, 0, 0, 110807, 0, 41691, 0,
+ 75060, 11866, 0, 65292, 0, 110812, 0, 3911, 110811, 110808, 110809, 0,
+ 125191, 7000, 3904, 118997, 72261, 0, 0, 0, 13123, 10846, 0, 0, 0, 0, 0,
+ 74082, 0, 123542, 0, 0, 3777, 128329, 0, 9636, 71726, 0, 0, 9367, 593, 0,
+ 3999, 0, 41713, 0, 0, 67677, 0, 0, 0, 9763, 120280, 120283, 12347, 124,
+ 12981, 41127, 92527, 0, 0, 0, 0, 0, 43987, 0, 0, 1769, 41715, 2463, 2151,
+ 0, 0, 71222, 1538, 93044, 0, 0, 123543, 7795, 120300, 0, 92493, 10955, 0,
+ 0, 72375, 78208, 9498, 78207, 127033, 78210, 120288, 3939, 120290,
+ 120285, 8943, 120287, 120286, 120297, 4491, 120299, 42602, 120293,
+ 120292, 120295, 120294, 0, 0, 0, 0, 0, 0, 1511, 9324, 0, 0, 0, 0, 0,
+ 64536, 0, 0, 0, 124935, 6822, 12862, 0, 0, 42143, 41828, 0, 917629,
+ 70864, 118879, 0, 0, 0, 41826, 128413, 0, 0, 13279, 7917, 0, 0, 0, 0, 0,
+ 92800, 92332, 0, 0, 43515, 0, 0, 0, 4013, 0, 66980, 0, 72224, 125266, 0,
+ 68243, 2432, 92834, 0, 0, 0, 0, 69952, 0, 0, 0, 10949, 0, 0, 0, 0, 0, 0,
+ 0, 128574, 43233, 0, 42517, 0, 0, 0, 0, 0, 64468, 119359, 6474, 119358,
+ 43497, 12656, 128122, 119353, 0, 1665, 0, 0, 0, 64512, 0, 0, 5256, 0, 0,
+ 0, 2859, 123563, 0, 0, 0, 0, 92801, 128220, 0, 770, 0, 811, 0, 0, 917551,
+ 42244, 64427, 0, 72222, 0, 3895, 0, 74341, 12087, 0, 42859, 10193, 3116,
+ 7747, 0, 0, 43496, 0, 0, 0, 0, 41877, 0, 65382, 64614, 0, 64296, 0, 6345,
+ 0, 2663, 0, 121234, 0, 0, 10150, 0, 64308, 1522, 597, 0, 0, 41201, 64731,
+ 0, 0, 41198, 123537, 71483, 3092, 0, 0, 4783, 71448, 92213, 0, 0, 10812,
+ 0, 0, 0, 3078, 0, 0, 0, 0, 0, 71703, 394, 3088, 0, 0, 0, 3991, 0, 129072,
+ 0, 424, 67652, 72377, 0, 0, 0, 0, 0, 0, 42231, 2209, 128215, 72983, 0,
+ 41840, 129136, 5344, 1298, 0, 13155, 0, 128973, 41838, 0, 8488, 1003,
+ 41837, 0, 0, 0, 48, 0, 0, 8493, 0, 0, 0, 65487, 118550, 8465, 10332,
+ 13172, 0, 0, 10449, 126989, 127014, 69606, 69447, 3984, 129159, 0, 0, 0,
+ 0, 0, 0, 0, 0, 64758, 0, 100947, 0, 0, 9096, 0, 0, 9172, 128545, 0, 0,
+ 5955, 67666, 0, 0, 0, 0, 0, 74426, 3926, 71734, 0, 8798, 100946, 92165,
+ 0, 0, 120696, 0, 0, 0, 118805, 10353, 10417, 0, 123560, 0, 128629, 4019,
+ 0, 0, 0, 8219, 68402, 0, 0, 121301, 128218, 0, 0, 0, 0, 0, 0, 0, 110625,
+ 42474, 10642, 3909, 9950, 0, 128139, 69619, 68678, 92917, 0, 1049, 43517,
+ 65707, 11943, 41806, 0, 68635, 3921, 0, 11775, 121352, 69820, 1038,
+ 42303, 9823, 0, 2145, 4008, 68624, 0, 121025, 0, 0, 5153, 41805, 0, 0,
+ 763, 9211, 0, 0, 0, 0, 2188, 127142, 0, 0, 65179, 0, 8621, 0, 118878, 0,
+ 0, 0, 0, 182, 0, 0, 0, 0, 72978, 9058, 8489, 0, 66935, 5969, 65909,
+ 10848, 4570, 0, 128614, 4255, 0, 0, 41189, 4003, 69785, 68109, 13293,
+ 41192, 0, 0, 42251, 0, 0, 126085, 11287, 6128, 121315, 11034, 0, 68207,
+ 0, 65506, 42382, 0, 0, 66872, 9932, 43516, 0, 125098, 0, 41814, 0, 71234,
+ 64835, 12117, 127040, 127041, 10540, 127043, 9063, 78000, 0, 0, 0, 12897,
+ 0, 0, 0, 6065, 0, 0, 0, 8692, 41186, 41816, 0, 41818, 41187, 0, 42196, 0,
+ 110690, 110691, 126115, 0, 0, 125235, 4710, 0, 5956, 7621, 110641, 92624,
+ 4705, 716, 74918, 110693, 4704, 124916, 0, 127112, 161, 67468, 0, 0,
+ 4706, 0, 0, 0, 4709, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1700, 119223, 0, 0,
+ 128119, 4004, 0, 73071, 69383, 69914, 8506, 128237, 0, 126996, 2538, 937,
+ 0, 4734, 0, 0, 0, 0, 0, 4729, 0, 0, 0, 4728, 0, 72809, 120644, 0, 8109,
+ 43105, 11249, 4730, 447, 0, 1513, 4733, 0, 0, 0, 0, 0, 0, 0, 8565, 2469,
+ 0, 6690, 0, 0, 43439, 78218, 43103, 78217, 2674, 0, 11922, 0, 0, 3510, 0,
+ 129368, 0, 5605, 42095, 126572, 0, 9098, 120512, 0, 121272, 68891, 74570,
+ 0, 67708, 0, 119346, 0, 5959, 0, 0, 66275, 43371, 0, 0, 0, 0, 0, 12769,
+ 69793, 0, 1283, 0, 4779, 0, 3719, 4006, 0, 0, 71186, 68204, 124957, 0,
+ 119331, 43028, 65493, 0, 125058, 5962, 65485, 92616, 0, 43501, 5827, 0,
+ 120951, 0, 65494, 0, 129365, 0, 0, 43879, 0, 0, 0, 0, 983205, 65467, 0,
+ 0, 0, 0, 521, 0, 0, 983928, 0, 0, 483, 7096, 0, 0, 928, 0, 0, 0, 0,
+ 92983, 3989, 73972, 122980, 0, 0, 0, 12145, 0, 73932, 0, 0, 3769, 67460,
+ 0, 0, 0, 0, 0, 65290, 92223, 0, 65855, 0, 0, 0, 0, 128811, 0, 0, 0, 0, 0,
+ 0, 73838, 0, 0, 13007, 67506, 0, 0, 12661, 7608, 75032, 12213, 0, 0, 0,
+ 0, 12195, 4001, 3112, 67474, 0, 7590, 0, 0, 421, 0, 0, 0, 4130, 127775,
+ 7595, 42588, 7600, 0, 0, 0, 0, 65851, 42607, 0, 92403, 8680, 0, 42134, 0,
+ 0, 2846, 92605, 0, 0, 0, 0, 12979, 0, 0, 92558, 3740, 69843, 120437, 0,
+ 120451, 65923, 120435, 0, 120434, 0, 93800, 3118, 74265, 93795, 93816,
+ 93823, 93797, 8127, 92912, 93792, 7943, 93821, 93799, 10618, 2584, 93793,
+ 0, 0, 9998, 0, 0, 0, 66350, 0, 0, 0, 121374, 8279, 128169, 0, 4975,
+ 70075, 0, 118675, 1631, 0, 0, 0, 6290, 128994, 66386, 0, 64645, 0, 0, 0,
+ 0, 0, 9242, 93807, 93802, 93801, 983269, 93803, 3122, 93804, 7793, 0, 0,
+ 0, 0, 12604, 92885, 6615, 67650, 0, 3986, 44025, 0, 8912, 0, 7409, 0, 0,
+ 0, 0, 0, 0, 8540, 11498, 0, 0, 0, 0, 0, 13060, 120682, 0, 0, 0, 0, 0,
+ 121345, 0, 0, 7020, 120353, 3765, 92881, 0, 1606, 120348, 120351, 3093,
+ 110593, 0, 0, 0, 0, 0, 0, 92892, 120337, 69402, 120339, 4023, 120333,
+ 120332, 120335, 92250, 120345, 12810, 120347, 120346, 4455, 120340,
+ 120343, 120342, 66660, 0, 0, 0, 0, 113720, 13089, 74355, 120329, 120328,
+ 42758, 12196, 128429, 0, 0, 0, 0, 128867, 94179, 0, 3120, 9797, 0, 0,
+ 11086, 10389, 0, 101025, 4895, 128153, 124941, 4359, 0, 0, 3509, 70037,
+ 486, 0, 0, 0, 0, 0, 7004, 0, 0, 0, 0, 4855, 128200, 0, 0, 0, 0, 0, 0,
+ 10381, 70839, 0, 0, 0, 0, 125121, 70837, 125070, 129431, 983377, 983365,
+ 0, 983364, 0, 120063, 0, 0, 0, 75048, 0, 74900, 0, 0, 120978, 12161,
+ 983356, 0, 10339, 0, 77808, 0, 0, 917846, 77806, 0, 43032, 125010, 0,
+ 983383, 12671, 11384, 0, 0, 120901, 64797, 0, 5820, 0, 0, 0, 0, 0,
+ 120650, 42137, 9893, 8851, 12664, 0, 0, 13192, 0, 41799, 65530, 0, 0,
+ 43039, 3114, 0, 0, 0, 0, 0, 926, 77803, 72004, 77805, 77799, 77800,
+ 77801, 77802, 43037, 41798, 77797, 77798, 123214, 41801, 0, 0, 0, 4200,
+ 12699, 8331, 70118, 3091, 92980, 66298, 70293, 8360, 0, 78044, 0, 4229,
+ 64543, 126227, 65563, 0, 129310, 2861, 43793, 10095, 121428, 9195,
+ 121381, 121132, 0, 129578, 0, 0, 43041, 0, 43794, 0, 83167, 0, 43797,
+ 8209, 0, 129132, 12973, 0, 0, 0, 0, 0, 121235, 5760, 0, 743, 0, 0, 0,
+ 118712, 0, 0, 83170, 128589, 129537, 0, 119063, 0, 0, 0, 19919, 0, 64532,
+ 0, 43710, 0, 0, 9483, 71115, 0, 43697, 0, 0, 83211, 0, 0, 0, 7247, 0, 0,
+ 0, 0, 0, 113674, 0, 7471, 120823, 128743, 12682, 0, 0, 65679, 983144, 0,
+ 0, 83201, 1099, 74241, 0, 10501, 0, 0, 113743, 0, 64743, 128476, 67663,
+ 0, 0, 92219, 0, 83197, 64897, 9973, 1818, 0, 0, 8272, 127812, 0, 4218,
+ 3087, 0, 127234, 122935, 101300, 65181, 9954, 10465, 0, 0, 0, 9106, 0,
+ 67406, 0, 0, 0, 0, 43038, 0, 0, 265, 70208, 0, 0, 0, 0, 0, 69405, 0, 59,
+ 0, 0, 0, 0, 126239, 41810, 0, 126492, 0, 41809, 41888, 0, 41795, 0,
+ 42213, 0, 0, 43033, 511, 42963, 0, 13127, 0, 0, 0, 0, 111107, 100489,
+ 4467, 41812, 41215, 0, 41211, 917783, 4453, 69575, 0, 129883, 0, 983412,
+ 41213, 92864, 118716, 0, 0, 129730, 41841, 6617, 130041, 0, 92995, 462,
+ 0, 10493, 0, 55248, 0, 0, 74471, 6644, 0, 0, 0, 983388, 100484, 9581,
+ 67104, 3098, 0, 0, 983415, 125250, 0, 120621, 0, 0, 0, 129584, 101011, 0,
+ 118789, 74473, 3755, 64661, 7748, 7235, 3966, 0, 0, 127510, 0, 0, 0,
+ 5726, 66456, 42175, 100486, 0, 42212, 92681, 121443, 2851, 43017, 120108,
+ 121056, 4373, 0, 0, 9587, 0, 6671, 128840, 3100, 0, 917790, 0, 0, 0,
+ 917789, 70209, 8190, 12083, 917791, 0, 6689, 64629, 0, 0, 0, 4419,
+ 917787, 101017, 0, 69851, 0, 0, 8891, 3080, 0, 2347, 0, 0, 8990, 0,
+ 121201, 0, 92528, 249, 129008, 0, 69424, 0, 0, 0, 55253, 0, 0, 11173,
+ 995, 0, 121047, 119861, 0, 73708, 0, 0, 19945, 0, 558, 983399, 12273, 0,
+ 983881, 0, 69912, 120861, 129492, 67274, 94178, 0, 68019, 43030, 3129, 0,
+ 2102, 0, 0, 121450, 0, 7725, 0, 11120, 0, 126111, 69246, 0, 0, 0, 41894,
+ 0, 41898, 0, 41893, 74921, 128678, 3540, 11848, 0, 73005, 120848, 0, 0,
+ 126113, 73959, 0, 0, 128735, 120858, 0, 0, 9699, 128656, 41896, 0, 83196,
+ 69230, 74951, 0, 72736, 0, 0, 3095, 983689, 11946, 983885, 0, 0, 0, 0, 0,
+ 113677, 3672, 111309, 0, 0, 0, 128539, 8890, 93826, 0, 128182, 0, 0, 0,
+ 126568, 0, 0, 983617, 9516, 983441, 72109, 0, 42220, 0, 4450, 0, 11547,
+ 43417, 128542, 356, 0, 0, 0, 0, 64901, 0, 0, 0, 0, 0, 0, 111302, 65940,
+ 2541, 71231, 0, 123215, 126470, 3549, 0, 0, 0, 2743, 0, 0, 0, 9097,
+ 128896, 43015, 0, 0, 776, 2524, 0, 8573, 100665, 126494, 0, 0, 42694,
+ 71122, 8952, 10814, 118818, 0, 43646, 128598, 66944, 0, 0, 128380,
+ 100663, 0, 65853, 42707, 1897, 93071, 0, 0, 71907, 69410, 0, 125106, 0,
+ 0, 0, 68473, 66778, 43573, 92638, 0, 0, 0, 120955, 73986, 0, 0, 43022, 0,
+ 74841, 0, 67714, 0, 0, 0, 0, 0, 4553, 0, 0, 0, 0, 0, 19921, 0, 0, 983687,
+ 4567, 41891, 0, 983819, 55249, 194663, 0, 194662, 0, 194665, 43042,
+ 121291, 1377, 12869, 0, 0, 9250, 0, 0, 0, 129779, 125039, 194642, 0,
+ 74995, 0, 194644, 0, 0, 101328, 194668, 121166, 0, 70275, 1898, 69556, 0,
+ 0, 802, 0, 0, 0, 6648, 0, 2528, 0, 0, 194646, 194625, 101330, 68804, 844,
+ 0, 68824, 0, 68818, 194650, 0, 0, 0, 983743, 65464, 0, 0, 0, 0, 83221, 0,
+ 0, 100680, 42954, 0, 64371, 70665, 0, 194654, 0, 0, 0, 0, 0, 6196, 6945,
+ 0, 0, 0, 120491, 0, 68846, 6210, 0, 70274, 0, 0, 0, 68067, 68834, 194715,
+ 588, 9760, 129112, 0, 983723, 119505, 0, 127992, 0, 0, 118905, 0, 0,
+ 92485, 110839, 69396, 0, 3394, 70734, 194639, 0, 0, 0, 0, 0, 0, 194656,
+ 7817, 1841, 11055, 195001, 194979, 194983, 127011, 67403, 194987, 7701,
+ 194998, 0, 194995, 1946, 121404, 0, 0, 917631, 0, 0, 10934, 0, 70376, 0,
+ 0, 8071, 3538, 0, 2287, 65328, 0, 0, 7614, 0, 0, 0, 12009, 43968, 0,
+ 67852, 0, 0, 10841, 123640, 0, 0, 0, 0, 8960, 0, 0, 65317, 128829, 0, 0,
+ 70374, 0, 0, 0, 65315, 0, 0, 0, 0, 0, 119621, 0, 11849, 12447, 0, 0,
+ 110741, 0, 0, 0, 129976, 42767, 0, 0, 0, 43695, 120520, 11975, 194941,
+ 983448, 0, 2555, 0, 128640, 70070, 42936, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 66714, 0, 0, 70076, 65596, 121034, 66710, 67658, 0, 126994, 65338,
+ 7792, 0, 0, 67871, 119027, 0, 8233, 43572, 0, 0, 0, 3442, 110933, 2841,
+ 12543, 0, 1473, 42820, 64329, 127832, 917772, 126126, 7937, 0, 1048, 0,
+ 0, 983943, 0, 3406, 1054, 100701, 1040, 65450, 0, 92329, 1069, 917763,
+ 128367, 128940, 0, 917765, 0, 983724, 9693, 110873, 0, 0, 0, 983948,
+ 4353, 118653, 1059, 127530, 0, 0, 0, 127093, 118862, 120500, 10646,
+ 118708, 100710, 917762, 70424, 74830, 0, 0, 983720, 10221, 100706, 68255,
+ 0, 0, 74346, 119619, 100707, 64945, 12921, 0, 0, 0, 0, 0, 983795, 43020,
+ 0, 0, 74254, 0, 983785, 0, 0, 983792, 0, 71954, 0, 0, 0, 0, 122625, 0,
+ 120503, 70663, 0, 2755, 0, 0, 0, 4857, 0, 4428, 0, 0, 983791, 0, 0, 0,
+ 43842, 0, 122899, 0, 7978, 0, 70392, 127080, 11924, 43812, 0, 65015,
+ 67472, 563, 68340, 0, 12798, 0, 100727, 0, 0, 0, 74110, 0, 94051, 0, 694,
+ 0, 9876, 0, 119168, 0, 0, 0, 92361, 0, 0, 7229, 0, 0, 0, 0, 64811, 0,
+ 119087, 126478, 0, 7381, 0, 2525, 4852, 11586, 68465, 41605, 126089, 0,
+ 11582, 7151, 10155, 92578, 188, 0, 11592, 0, 74015, 0, 0, 4858, 122645,
+ 0, 0, 4861, 0, 2786, 121431, 4856, 8051, 0, 119609, 0, 113797, 71133, 0,
+ 78448, 0, 0, 67842, 68084, 0, 0, 0, 0, 0, 10234, 5843, 0, 71865, 66728,
+ 0, 3157, 0, 0, 75035, 72788, 983750, 0, 10822, 5149, 129517, 0, 65142,
+ 129454, 4565, 0, 0, 0, 12657, 0, 0, 386, 0, 8834, 120974, 0, 43574, 0, 0,
+ 0, 70113, 7220, 11839, 124984, 74883, 194752, 0, 65241, 74503, 8160, 0,
+ 194753, 0, 0, 0, 0, 0, 121265, 6847, 13303, 0, 0, 194755, 0, 118865, 0,
+ 194761, 0, 0, 74505, 0, 0, 0, 100518, 194721, 8780, 100512, 0, 68745,
+ 110626, 66697, 0, 2672, 3735, 983641, 0, 68752, 11205, 10724, 41202, 0,
+ 100714, 0, 0, 0, 0, 194765, 3842, 0, 78183, 12442, 78182, 9791, 78181, 0,
+ 42516, 67730, 64821, 195059, 78178, 0, 78464, 119219, 78465, 127466,
+ 194690, 195063, 0, 0, 0, 0, 78540, 78541, 78538, 1962, 78490, 78476,
+ 65930, 11660, 0, 2072, 0, 0, 78544, 194704, 78542, 10669, 110859, 110860,
+ 110857, 110858, 129749, 110856, 4105, 0, 194699, 0, 0, 0, 13148, 195068,
+ 78479, 9226, 0, 0, 10765, 127486, 71919, 6263, 195050, 0, 195041, 0, 0,
+ 0, 0, 0, 0, 92312, 7886, 0, 6682, 0, 6680, 195042, 126473, 195052, 6679,
+ 74412, 0, 72206, 74421, 66281, 0, 0, 127478, 0, 0, 92861, 6681, 0, 12693,
+ 0, 0, 0, 0, 0, 65442, 129055, 0, 9989, 74415, 194673, 0, 0, 983788, 0, 0,
+ 0, 0, 7042, 127240, 119026, 7968, 0, 983768, 194741, 194736, 983793, 0,
+ 69889, 74389, 128696, 0, 0, 128979, 5781, 0, 78199, 0, 124145, 11091, 0,
+ 2719, 0, 0, 0, 64495, 0, 0, 0, 65169, 42845, 0, 128551, 983766, 2200,
+ 72435, 0, 0, 0, 917855, 66670, 0, 983709, 0, 0, 0, 7902, 0, 65265, 0, 0,
+ 0, 0, 0, 0, 0, 12994, 0, 10828, 983974, 0, 4307, 3482, 0, 0, 72389, 0,
+ 64299, 74573, 41194, 7343, 0, 0, 41195, 0, 8169, 0, 8841, 66770, 516,
+ 72981, 41197, 119051, 34, 128850, 120186, 11504, 1612, 120187, 120182,
+ 120181, 120184, 12001, 120178, 120177, 120180, 120179, 71966, 120173,
+ 7749, 120175, 0, 1758, 0, 10667, 0, 120197, 0, 1935, 11517, 120193,
+ 120196, 78925, 120190, 120189, 120192, 120191, 1217, 64702, 128075, 825,
+ 0, 129824, 0, 0, 66748, 0, 11050, 0, 123187, 0, 0, 74554, 110577, 0,
+ 8677, 123188, 11313, 123185, 3403, 0, 123186, 64364, 92683, 0, 0, 0, 0,
+ 123189, 0, 0, 983880, 0, 69408, 41850, 0, 3433, 127965, 0, 1594, 65607,
+ 0, 66392, 0, 129291, 74565, 41353, 125119, 78926, 0, 0, 0, 918, 127280,
+ 41351, 0, 0, 12140, 0, 12668, 72395, 0, 128753, 0, 127302, 0, 127288,
+ 129497, 127235, 573, 0, 0, 11417, 0, 127283, 0, 0, 0, 72410, 0, 11482, 0,
+ 3981, 74345, 0, 0, 0, 0, 0, 0, 125238, 0, 0, 42195, 0, 123190, 129764,
+ 64602, 0, 0, 121366, 0, 121061, 128690, 0, 8423, 0, 448, 66907, 9717, 0,
+ 0, 0, 0, 0, 0, 0, 71910, 129898, 0, 0, 120679, 65013, 78169, 0, 72390, 0,
+ 0, 127917, 0, 74892, 0, 0, 127798, 0, 0, 66982, 0, 0, 0, 12197, 125074,
+ 0, 121447, 0, 0, 0, 0, 0, 0, 0, 74563, 64828, 11419, 0, 8592, 0, 0, 0,
+ 11381, 0, 0, 74529, 0, 0, 83254, 0, 72796, 0, 83257, 0, 0, 0, 129437,
+ 65672, 0, 0, 0, 0, 0, 0, 0, 0, 9505, 0, 0, 756, 0, 125243, 100358,
+ 110852, 7261, 0, 0, 0, 0, 0, 64401, 65830, 41365, 0, 0, 0, 127834, 0, 0,
+ 0, 0, 0, 74626, 123155, 11578, 0, 2170, 0, 0, 0, 0, 74568, 0, 113684,
+ 1794, 68310, 120218, 120219, 120220, 120221, 120222, 120223, 3617,
+ 120011, 64886, 94061, 78202, 120213, 66999, 10225, 983060, 0, 65223,
+ 983058, 0, 0, 4452, 127779, 0, 0, 66981, 0, 0, 0, 11425, 0, 0, 1231, 0,
+ 0, 0, 124121, 8192, 124118, 0, 0, 10616, 8694, 0, 68867, 128332, 123595,
+ 120200, 120201, 120202, 120203, 9878, 120205, 119626, 120207, 0, 8799,
+ 42131, 0, 127163, 0, 120198, 120199, 837, 120015, 72384, 0, 983836, 2180,
+ 11427, 0, 78154, 0, 70171, 0, 78150, 42606, 0, 119615, 78147, 64637,
+ 78146, 43060, 78145, 125009, 3392, 0, 194783, 119067, 119650, 65468,
+ 43498, 126083, 0, 0, 0, 194928, 194937, 194938, 64681, 194930, 83264,
+ 92451, 0, 194955, 83262, 983751, 8973, 0, 194967, 70177, 194968, 0, 4800,
+ 195018, 0, 0, 11820, 6852, 122981, 0, 4802, 4111, 111268, 0, 4805,
+ 127308, 68193, 7885, 121220, 0, 0, 0, 4767, 0, 0, 0, 0, 0, 125234,
+ 100366, 43453, 0, 41340, 0, 0, 10005, 65856, 41333, 0, 9518, 0, 0, 0,
+ 42520, 100850, 0, 0, 917562, 100506, 0, 0, 0, 0, 0, 0, 9167, 42151,
+ 124958, 0, 2026, 100848, 124139, 0, 100534, 12768, 0, 7582, 0, 0, 0, 0,
+ 129557, 0, 120539, 68879, 0, 43547, 119992, 8546, 126071, 78520, 7604,
+ 78518, 78519, 78514, 78517, 78511, 78512, 73802, 128140, 0, 6708, 10535,
+ 0, 68218, 55274, 68221, 92296, 0, 0, 0, 0, 0, 72385, 0, 0, 0, 73727, 0,
+ 120706, 74442, 66943, 0, 0, 4351, 0, 119887, 119888, 0, 119886, 119891,
+ 68866, 119889, 11433, 119895, 119896, 0, 119894, 65578, 194693, 0, 0,
+ 983070, 10681, 0, 0, 128737, 0, 983111, 0, 6722, 129364, 0, 119997,
+ 41546, 64860, 68394, 0, 41549, 118619, 72386, 0, 0, 0, 0, 64710, 41547,
+ 0, 0, 0, 78530, 78532, 78528, 78529, 71343, 78527, 78523, 78525, 3537,
+ 119908, 119905, 7155, 2264, 0, 78533, 67755, 0, 0, 0, 0, 0, 0, 0, 64715,
+ 0, 0, 537, 0, 4179, 0, 0, 0, 0, 0, 0, 0, 0, 12081, 0, 0, 4048, 7053, 0,
+ 0, 70459, 0, 124975, 0, 3059, 0, 0, 43491, 983833, 0, 0, 127993, 4100,
+ 920, 1811, 1355, 0, 0, 64383, 10078, 69398, 0, 118651, 0, 65870, 0,
+ 129565, 0, 72400, 42918, 0, 66789, 0, 12865, 0, 73938,
+};
+
+#define code_magic 47
+#define code_size 65536
+#define code_poly 65581
+
+static const unsigned int aliases_start = 0xf0000;
+static const unsigned int aliases_end = 0xf01d9;
+static const unsigned int name_aliases[] = {
+ 0x0000,
+ 0x0000,
+ 0x0001,
+ 0x0001,
+ 0x0002,
+ 0x0002,
+ 0x0003,
+ 0x0003,
+ 0x0004,
+ 0x0004,
+ 0x0005,
+ 0x0005,
+ 0x0006,
+ 0x0006,
+ 0x0007,
+ 0x0007,
+ 0x0008,
+ 0x0008,
+ 0x0009,
+ 0x0009,
+ 0x0009,
+ 0x0009,
+ 0x000A,
+ 0x000A,
+ 0x000A,
+ 0x000A,
+ 0x000A,
+ 0x000A,
+ 0x000B,
+ 0x000B,
+ 0x000B,
+ 0x000C,
+ 0x000C,
+ 0x000D,
+ 0x000D,
+ 0x000E,
+ 0x000E,
+ 0x000E,
+ 0x000F,
+ 0x000F,
+ 0x000F,
+ 0x0010,
+ 0x0010,
+ 0x0011,
+ 0x0011,
+ 0x0012,
+ 0x0012,
+ 0x0013,
+ 0x0013,
+ 0x0014,
+ 0x0014,
+ 0x0015,
+ 0x0015,
+ 0x0016,
+ 0x0016,
+ 0x0017,
+ 0x0017,
+ 0x0018,
+ 0x0018,
+ 0x0019,
+ 0x0019,
+ 0x0019,
+ 0x001A,
+ 0x001A,
+ 0x001B,
+ 0x001B,
+ 0x001C,
+ 0x001C,
+ 0x001C,
+ 0x001D,
+ 0x001D,
+ 0x001D,
+ 0x001E,
+ 0x001E,
+ 0x001E,
+ 0x001F,
+ 0x001F,
+ 0x001F,
+ 0x0020,
+ 0x007F,
+ 0x007F,
+ 0x0080,
+ 0x0080,
+ 0x0081,
+ 0x0081,
+ 0x0082,
+ 0x0082,
+ 0x0083,
+ 0x0083,
+ 0x0084,
+ 0x0084,
+ 0x0085,
+ 0x0085,
+ 0x0086,
+ 0x0086,
+ 0x0087,
+ 0x0087,
+ 0x0088,
+ 0x0088,
+ 0x0088,
+ 0x0089,
+ 0x0089,
+ 0x0089,
+ 0x008A,
+ 0x008A,
+ 0x008A,
+ 0x008B,
+ 0x008B,
+ 0x008B,
+ 0x008C,
+ 0x008C,
+ 0x008C,
+ 0x008D,
+ 0x008D,
+ 0x008D,
+ 0x008E,
+ 0x008E,
+ 0x008E,
+ 0x008F,
+ 0x008F,
+ 0x008F,
+ 0x0090,
+ 0x0090,
+ 0x0091,
+ 0x0091,
+ 0x0091,
+ 0x0092,
+ 0x0092,
+ 0x0092,
+ 0x0093,
+ 0x0093,
+ 0x0094,
+ 0x0094,
+ 0x0095,
+ 0x0095,
+ 0x0096,
+ 0x0096,
+ 0x0096,
+ 0x0097,
+ 0x0097,
+ 0x0097,
+ 0x0098,
+ 0x0098,
+ 0x0099,
+ 0x0099,
+ 0x009A,
+ 0x009A,
+ 0x009B,
+ 0x009B,
+ 0x009C,
+ 0x009C,
+ 0x009D,
+ 0x009D,
+ 0x009E,
+ 0x009E,
+ 0x009F,
+ 0x009F,
+ 0x00A0,
+ 0x00AD,
+ 0x01A2,
+ 0x01A3,
+ 0x034F,
+ 0x0616,
+ 0x061C,
+ 0x0709,
+ 0x0CDE,
+ 0x0E9D,
+ 0x0E9F,
+ 0x0EA3,
+ 0x0EA5,
+ 0x0FD0,
+ 0x11EC,
+ 0x11ED,
+ 0x11EE,
+ 0x11EF,
+ 0x180B,
+ 0x180C,
+ 0x180D,
+ 0x180E,
+ 0x180F,
+ 0x1BBD,
+ 0x200B,
+ 0x200C,
+ 0x200D,
+ 0x200E,
+ 0x200F,
+ 0x202A,
+ 0x202B,
+ 0x202C,
+ 0x202D,
+ 0x202E,
+ 0x202F,
+ 0x205F,
+ 0x2060,
+ 0x2066,
+ 0x2067,
+ 0x2068,
+ 0x2069,
+ 0x2118,
+ 0x2448,
+ 0x2449,
+ 0x2B7A,
+ 0x2B7C,
+ 0xA015,
+ 0xAA6E,
+ 0xFE00,
+ 0xFE01,
+ 0xFE02,
+ 0xFE03,
+ 0xFE04,
+ 0xFE05,
+ 0xFE06,
+ 0xFE07,
+ 0xFE08,
+ 0xFE09,
+ 0xFE0A,
+ 0xFE0B,
+ 0xFE0C,
+ 0xFE0D,
+ 0xFE0E,
+ 0xFE0F,
+ 0xFE18,
+ 0xFEFF,
+ 0xFEFF,
+ 0xFEFF,
+ 0x122D4,
+ 0x122D5,
+ 0x16E56,
+ 0x16E57,
+ 0x16E76,
+ 0x16E77,
+ 0x1B001,
+ 0x1D0C5,
+ 0xE0100,
+ 0xE0101,
+ 0xE0102,
+ 0xE0103,
+ 0xE0104,
+ 0xE0105,
+ 0xE0106,
+ 0xE0107,
+ 0xE0108,
+ 0xE0109,
+ 0xE010A,
+ 0xE010B,
+ 0xE010C,
+ 0xE010D,
+ 0xE010E,
+ 0xE010F,
+ 0xE0110,
+ 0xE0111,
+ 0xE0112,
+ 0xE0113,
+ 0xE0114,
+ 0xE0115,
+ 0xE0116,
+ 0xE0117,
+ 0xE0118,
+ 0xE0119,
+ 0xE011A,
+ 0xE011B,
+ 0xE011C,
+ 0xE011D,
+ 0xE011E,
+ 0xE011F,
+ 0xE0120,
+ 0xE0121,
+ 0xE0122,
+ 0xE0123,
+ 0xE0124,
+ 0xE0125,
+ 0xE0126,
+ 0xE0127,
+ 0xE0128,
+ 0xE0129,
+ 0xE012A,
+ 0xE012B,
+ 0xE012C,
+ 0xE012D,
+ 0xE012E,
+ 0xE012F,
+ 0xE0130,
+ 0xE0131,
+ 0xE0132,
+ 0xE0133,
+ 0xE0134,
+ 0xE0135,
+ 0xE0136,
+ 0xE0137,
+ 0xE0138,
+ 0xE0139,
+ 0xE013A,
+ 0xE013B,
+ 0xE013C,
+ 0xE013D,
+ 0xE013E,
+ 0xE013F,
+ 0xE0140,
+ 0xE0141,
+ 0xE0142,
+ 0xE0143,
+ 0xE0144,
+ 0xE0145,
+ 0xE0146,
+ 0xE0147,
+ 0xE0148,
+ 0xE0149,
+ 0xE014A,
+ 0xE014B,
+ 0xE014C,
+ 0xE014D,
+ 0xE014E,
+ 0xE014F,
+ 0xE0150,
+ 0xE0151,
+ 0xE0152,
+ 0xE0153,
+ 0xE0154,
+ 0xE0155,
+ 0xE0156,
+ 0xE0157,
+ 0xE0158,
+ 0xE0159,
+ 0xE015A,
+ 0xE015B,
+ 0xE015C,
+ 0xE015D,
+ 0xE015E,
+ 0xE015F,
+ 0xE0160,
+ 0xE0161,
+ 0xE0162,
+ 0xE0163,
+ 0xE0164,
+ 0xE0165,
+ 0xE0166,
+ 0xE0167,
+ 0xE0168,
+ 0xE0169,
+ 0xE016A,
+ 0xE016B,
+ 0xE016C,
+ 0xE016D,
+ 0xE016E,
+ 0xE016F,
+ 0xE0170,
+ 0xE0171,
+ 0xE0172,
+ 0xE0173,
+ 0xE0174,
+ 0xE0175,
+ 0xE0176,
+ 0xE0177,
+ 0xE0178,
+ 0xE0179,
+ 0xE017A,
+ 0xE017B,
+ 0xE017C,
+ 0xE017D,
+ 0xE017E,
+ 0xE017F,
+ 0xE0180,
+ 0xE0181,
+ 0xE0182,
+ 0xE0183,
+ 0xE0184,
+ 0xE0185,
+ 0xE0186,
+ 0xE0187,
+ 0xE0188,
+ 0xE0189,
+ 0xE018A,
+ 0xE018B,
+ 0xE018C,
+ 0xE018D,
+ 0xE018E,
+ 0xE018F,
+ 0xE0190,
+ 0xE0191,
+ 0xE0192,
+ 0xE0193,
+ 0xE0194,
+ 0xE0195,
+ 0xE0196,
+ 0xE0197,
+ 0xE0198,
+ 0xE0199,
+ 0xE019A,
+ 0xE019B,
+ 0xE019C,
+ 0xE019D,
+ 0xE019E,
+ 0xE019F,
+ 0xE01A0,
+ 0xE01A1,
+ 0xE01A2,
+ 0xE01A3,
+ 0xE01A4,
+ 0xE01A5,
+ 0xE01A6,
+ 0xE01A7,
+ 0xE01A8,
+ 0xE01A9,
+ 0xE01AA,
+ 0xE01AB,
+ 0xE01AC,
+ 0xE01AD,
+ 0xE01AE,
+ 0xE01AF,
+ 0xE01B0,
+ 0xE01B1,
+ 0xE01B2,
+ 0xE01B3,
+ 0xE01B4,
+ 0xE01B5,
+ 0xE01B6,
+ 0xE01B7,
+ 0xE01B8,
+ 0xE01B9,
+ 0xE01BA,
+ 0xE01BB,
+ 0xE01BC,
+ 0xE01BD,
+ 0xE01BE,
+ 0xE01BF,
+ 0xE01C0,
+ 0xE01C1,
+ 0xE01C2,
+ 0xE01C3,
+ 0xE01C4,
+ 0xE01C5,
+ 0xE01C6,
+ 0xE01C7,
+ 0xE01C8,
+ 0xE01C9,
+ 0xE01CA,
+ 0xE01CB,
+ 0xE01CC,
+ 0xE01CD,
+ 0xE01CE,
+ 0xE01CF,
+ 0xE01D0,
+ 0xE01D1,
+ 0xE01D2,
+ 0xE01D3,
+ 0xE01D4,
+ 0xE01D5,
+ 0xE01D6,
+ 0xE01D7,
+ 0xE01D8,
+ 0xE01D9,
+ 0xE01DA,
+ 0xE01DB,
+ 0xE01DC,
+ 0xE01DD,
+ 0xE01DE,
+ 0xE01DF,
+ 0xE01E0,
+ 0xE01E1,
+ 0xE01E2,
+ 0xE01E3,
+ 0xE01E4,
+ 0xE01E5,
+ 0xE01E6,
+ 0xE01E7,
+ 0xE01E8,
+ 0xE01E9,
+ 0xE01EA,
+ 0xE01EB,
+ 0xE01EC,
+ 0xE01ED,
+ 0xE01EE,
+ 0xE01EF,
+};
+
+typedef struct NamedSequence {
+ int seqlen;
+ Py_UCS2 seq[4];
+} named_sequence;
+
+static const unsigned int named_sequences_start = 0xf0200;
+static const unsigned int named_sequences_end = 0xf03cd;
+static const named_sequence named_sequences[] = {
+ {3, {0x0023, 0xFE0F, 0x20E3}},
+ {3, {0x002A, 0xFE0F, 0x20E3}},
+ {3, {0x0030, 0xFE0F, 0x20E3}},
+ {3, {0x0031, 0xFE0F, 0x20E3}},
+ {3, {0x0032, 0xFE0F, 0x20E3}},
+ {3, {0x0033, 0xFE0F, 0x20E3}},
+ {3, {0x0034, 0xFE0F, 0x20E3}},
+ {3, {0x0035, 0xFE0F, 0x20E3}},
+ {3, {0x0036, 0xFE0F, 0x20E3}},
+ {3, {0x0037, 0xFE0F, 0x20E3}},
+ {3, {0x0038, 0xFE0F, 0x20E3}},
+ {3, {0x0039, 0xFE0F, 0x20E3}},
+ {2, {0x0100, 0x0300}},
+ {2, {0x0101, 0x0300}},
+ {2, {0x012A, 0x0300}},
+ {2, {0x012B, 0x0300}},
+ {2, {0x016A, 0x0300}},
+ {2, {0x016B, 0x0300}},
+ {2, {0x0045, 0x0329}},
+ {2, {0x0065, 0x0329}},
+ {2, {0x00C8, 0x0329}},
+ {2, {0x00E8, 0x0329}},
+ {2, {0x00C9, 0x0329}},
+ {2, {0x00E9, 0x0329}},
+ {2, {0x004F, 0x0329}},
+ {2, {0x006F, 0x0329}},
+ {2, {0x00D2, 0x0329}},
+ {2, {0x00F2, 0x0329}},
+ {2, {0x00D3, 0x0329}},
+ {2, {0x00F3, 0x0329}},
+ {2, {0x0053, 0x0329}},
+ {2, {0x0073, 0x0329}},
+ {2, {0x00CA, 0x0304}},
+ {2, {0x00EA, 0x0304}},
+ {2, {0x00CA, 0x030C}},
+ {2, {0x00EA, 0x030C}},
+ {3, {0x0069, 0x0307, 0x0301}},
+ {3, {0x006E, 0x0360, 0x0067}},
+ {2, {0x0104, 0x0301}},
+ {2, {0x0105, 0x0301}},
+ {2, {0x0104, 0x0303}},
+ {2, {0x0105, 0x0303}},
+ {2, {0x0118, 0x0301}},
+ {2, {0x0119, 0x0301}},
+ {2, {0x0118, 0x0303}},
+ {2, {0x0119, 0x0303}},
+ {2, {0x0116, 0x0301}},
+ {2, {0x0117, 0x0301}},
+ {2, {0x0116, 0x0303}},
+ {2, {0x0117, 0x0303}},
+ {3, {0x0069, 0x0307, 0x0300}},
+ {3, {0x0069, 0x0307, 0x0303}},
+ {2, {0x012E, 0x0301}},
+ {3, {0x012F, 0x0307, 0x0301}},
+ {2, {0x012E, 0x0303}},
+ {3, {0x012F, 0x0307, 0x0303}},
+ {2, {0x004A, 0x0303}},
+ {3, {0x006A, 0x0307, 0x0303}},
+ {2, {0x004C, 0x0303}},
+ {2, {0x006C, 0x0303}},
+ {2, {0x004D, 0x0303}},
+ {2, {0x006D, 0x0303}},
+ {2, {0x0052, 0x0303}},
+ {2, {0x0072, 0x0303}},
+ {2, {0x0172, 0x0301}},
+ {2, {0x0173, 0x0301}},
+ {2, {0x0172, 0x0303}},
+ {2, {0x0173, 0x0303}},
+ {2, {0x016A, 0x0301}},
+ {2, {0x016B, 0x0301}},
+ {2, {0x016A, 0x0303}},
+ {2, {0x016B, 0x0303}},
+ {2, {0x00E6, 0x0300}},
+ {2, {0x0254, 0x0300}},
+ {2, {0x0254, 0x0301}},
+ {2, {0x028C, 0x0300}},
+ {2, {0x028C, 0x0301}},
+ {2, {0x0259, 0x0300}},
+ {2, {0x0259, 0x0301}},
+ {2, {0x025A, 0x0300}},
+ {2, {0x025A, 0x0301}},
+ {2, {0x0626, 0x0627}},
+ {2, {0x0626, 0x0648}},
+ {2, {0x0626, 0x0649}},
+ {2, {0x0626, 0x06C6}},
+ {2, {0x0626, 0x06C7}},
+ {2, {0x0626, 0x06C8}},
+ {2, {0x0626, 0x06D0}},
+ {2, {0x0626, 0x06D5}},
+ {2, {0x0646, 0x06A9}},
+ {2, {0x0915, 0x093C}},
+ {2, {0x0916, 0x093C}},
+ {2, {0x0917, 0x093C}},
+ {2, {0x091C, 0x093C}},
+ {2, {0x0921, 0x093C}},
+ {2, {0x0922, 0x093C}},
+ {2, {0x092B, 0x093C}},
+ {2, {0x092F, 0x093C}},
+ {2, {0x09A1, 0x09BC}},
+ {2, {0x09A2, 0x09BC}},
+ {2, {0x09AF, 0x09BC}},
+ {2, {0x0A32, 0x0A3C}},
+ {2, {0x0A38, 0x0A3C}},
+ {2, {0x0A16, 0x0A3C}},
+ {2, {0x0A17, 0x0A3C}},
+ {2, {0x0A1C, 0x0A3C}},
+ {2, {0x0A2B, 0x0A3C}},
+ {2, {0x0B21, 0x0B3C}},
+ {2, {0x0B22, 0x0B3C}},
+ {3, {0x0995, 0x09CD, 0x09B7}},
+ {2, {0x0B95, 0x0BCD}},
+ {2, {0x0B99, 0x0BCD}},
+ {2, {0x0B9A, 0x0BCD}},
+ {2, {0x0B9E, 0x0BCD}},
+ {2, {0x0B9F, 0x0BCD}},
+ {2, {0x0BA3, 0x0BCD}},
+ {2, {0x0BA4, 0x0BCD}},
+ {2, {0x0BA8, 0x0BCD}},
+ {2, {0x0BAA, 0x0BCD}},
+ {2, {0x0BAE, 0x0BCD}},
+ {2, {0x0BAF, 0x0BCD}},
+ {2, {0x0BB0, 0x0BCD}},
+ {2, {0x0BB2, 0x0BCD}},
+ {2, {0x0BB5, 0x0BCD}},
+ {2, {0x0BB4, 0x0BCD}},
+ {2, {0x0BB3, 0x0BCD}},
+ {2, {0x0BB1, 0x0BCD}},
+ {2, {0x0BA9, 0x0BCD}},
+ {2, {0x0B9C, 0x0BCD}},
+ {2, {0x0BB6, 0x0BCD}},
+ {2, {0x0BB7, 0x0BCD}},
+ {2, {0x0BB8, 0x0BCD}},
+ {2, {0x0BB9, 0x0BCD}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BCD}},
+ {2, {0x0B95, 0x0BBE}},
+ {2, {0x0B95, 0x0BBF}},
+ {2, {0x0B95, 0x0BC0}},
+ {2, {0x0B95, 0x0BC1}},
+ {2, {0x0B95, 0x0BC2}},
+ {2, {0x0B95, 0x0BC6}},
+ {2, {0x0B95, 0x0BC7}},
+ {2, {0x0B95, 0x0BC8}},
+ {2, {0x0B95, 0x0BCA}},
+ {2, {0x0B95, 0x0BCB}},
+ {2, {0x0B95, 0x0BCC}},
+ {2, {0x0B99, 0x0BBE}},
+ {2, {0x0B99, 0x0BBF}},
+ {2, {0x0B99, 0x0BC0}},
+ {2, {0x0B99, 0x0BC1}},
+ {2, {0x0B99, 0x0BC2}},
+ {2, {0x0B99, 0x0BC6}},
+ {2, {0x0B99, 0x0BC7}},
+ {2, {0x0B99, 0x0BC8}},
+ {2, {0x0B99, 0x0BCA}},
+ {2, {0x0B99, 0x0BCB}},
+ {2, {0x0B99, 0x0BCC}},
+ {2, {0x0B9A, 0x0BBE}},
+ {2, {0x0B9A, 0x0BBF}},
+ {2, {0x0B9A, 0x0BC0}},
+ {2, {0x0B9A, 0x0BC1}},
+ {2, {0x0B9A, 0x0BC2}},
+ {2, {0x0B9A, 0x0BC6}},
+ {2, {0x0B9A, 0x0BC7}},
+ {2, {0x0B9A, 0x0BC8}},
+ {2, {0x0B9A, 0x0BCA}},
+ {2, {0x0B9A, 0x0BCB}},
+ {2, {0x0B9A, 0x0BCC}},
+ {2, {0x0B9E, 0x0BBE}},
+ {2, {0x0B9E, 0x0BBF}},
+ {2, {0x0B9E, 0x0BC0}},
+ {2, {0x0B9E, 0x0BC1}},
+ {2, {0x0B9E, 0x0BC2}},
+ {2, {0x0B9E, 0x0BC6}},
+ {2, {0x0B9E, 0x0BC7}},
+ {2, {0x0B9E, 0x0BC8}},
+ {2, {0x0B9E, 0x0BCA}},
+ {2, {0x0B9E, 0x0BCB}},
+ {2, {0x0B9E, 0x0BCC}},
+ {2, {0x0B9F, 0x0BBE}},
+ {2, {0x0B9F, 0x0BBF}},
+ {2, {0x0B9F, 0x0BC0}},
+ {2, {0x0B9F, 0x0BC1}},
+ {2, {0x0B9F, 0x0BC2}},
+ {2, {0x0B9F, 0x0BC6}},
+ {2, {0x0B9F, 0x0BC7}},
+ {2, {0x0B9F, 0x0BC8}},
+ {2, {0x0B9F, 0x0BCA}},
+ {2, {0x0B9F, 0x0BCB}},
+ {2, {0x0B9F, 0x0BCC}},
+ {2, {0x0BA3, 0x0BBE}},
+ {2, {0x0BA3, 0x0BBF}},
+ {2, {0x0BA3, 0x0BC0}},
+ {2, {0x0BA3, 0x0BC1}},
+ {2, {0x0BA3, 0x0BC2}},
+ {2, {0x0BA3, 0x0BC6}},
+ {2, {0x0BA3, 0x0BC7}},
+ {2, {0x0BA3, 0x0BC8}},
+ {2, {0x0BA3, 0x0BCA}},
+ {2, {0x0BA3, 0x0BCB}},
+ {2, {0x0BA3, 0x0BCC}},
+ {2, {0x0BA4, 0x0BBE}},
+ {2, {0x0BA4, 0x0BBF}},
+ {2, {0x0BA4, 0x0BC0}},
+ {2, {0x0BA4, 0x0BC1}},
+ {2, {0x0BA4, 0x0BC2}},
+ {2, {0x0BA4, 0x0BC6}},
+ {2, {0x0BA4, 0x0BC7}},
+ {2, {0x0BA4, 0x0BC8}},
+ {2, {0x0BA4, 0x0BCA}},
+ {2, {0x0BA4, 0x0BCB}},
+ {2, {0x0BA4, 0x0BCC}},
+ {2, {0x0BA8, 0x0BBE}},
+ {2, {0x0BA8, 0x0BBF}},
+ {2, {0x0BA8, 0x0BC0}},
+ {2, {0x0BA8, 0x0BC1}},
+ {2, {0x0BA8, 0x0BC2}},
+ {2, {0x0BA8, 0x0BC6}},
+ {2, {0x0BA8, 0x0BC7}},
+ {2, {0x0BA8, 0x0BC8}},
+ {2, {0x0BA8, 0x0BCA}},
+ {2, {0x0BA8, 0x0BCB}},
+ {2, {0x0BA8, 0x0BCC}},
+ {2, {0x0BAA, 0x0BBE}},
+ {2, {0x0BAA, 0x0BBF}},
+ {2, {0x0BAA, 0x0BC0}},
+ {2, {0x0BAA, 0x0BC1}},
+ {2, {0x0BAA, 0x0BC2}},
+ {2, {0x0BAA, 0x0BC6}},
+ {2, {0x0BAA, 0x0BC7}},
+ {2, {0x0BAA, 0x0BC8}},
+ {2, {0x0BAA, 0x0BCA}},
+ {2, {0x0BAA, 0x0BCB}},
+ {2, {0x0BAA, 0x0BCC}},
+ {2, {0x0BAE, 0x0BBE}},
+ {2, {0x0BAE, 0x0BBF}},
+ {2, {0x0BAE, 0x0BC0}},
+ {2, {0x0BAE, 0x0BC1}},
+ {2, {0x0BAE, 0x0BC2}},
+ {2, {0x0BAE, 0x0BC6}},
+ {2, {0x0BAE, 0x0BC7}},
+ {2, {0x0BAE, 0x0BC8}},
+ {2, {0x0BAE, 0x0BCA}},
+ {2, {0x0BAE, 0x0BCB}},
+ {2, {0x0BAE, 0x0BCC}},
+ {2, {0x0BAF, 0x0BBE}},
+ {2, {0x0BAF, 0x0BBF}},
+ {2, {0x0BAF, 0x0BC0}},
+ {2, {0x0BAF, 0x0BC1}},
+ {2, {0x0BAF, 0x0BC2}},
+ {2, {0x0BAF, 0x0BC6}},
+ {2, {0x0BAF, 0x0BC7}},
+ {2, {0x0BAF, 0x0BC8}},
+ {2, {0x0BAF, 0x0BCA}},
+ {2, {0x0BAF, 0x0BCB}},
+ {2, {0x0BAF, 0x0BCC}},
+ {2, {0x0BB0, 0x0BBE}},
+ {2, {0x0BB0, 0x0BBF}},
+ {2, {0x0BB0, 0x0BC0}},
+ {2, {0x0BB0, 0x0BC1}},
+ {2, {0x0BB0, 0x0BC2}},
+ {2, {0x0BB0, 0x0BC6}},
+ {2, {0x0BB0, 0x0BC7}},
+ {2, {0x0BB0, 0x0BC8}},
+ {2, {0x0BB0, 0x0BCA}},
+ {2, {0x0BB0, 0x0BCB}},
+ {2, {0x0BB0, 0x0BCC}},
+ {2, {0x0BB2, 0x0BBE}},
+ {2, {0x0BB2, 0x0BBF}},
+ {2, {0x0BB2, 0x0BC0}},
+ {2, {0x0BB2, 0x0BC1}},
+ {2, {0x0BB2, 0x0BC2}},
+ {2, {0x0BB2, 0x0BC6}},
+ {2, {0x0BB2, 0x0BC7}},
+ {2, {0x0BB2, 0x0BC8}},
+ {2, {0x0BB2, 0x0BCA}},
+ {2, {0x0BB2, 0x0BCB}},
+ {2, {0x0BB2, 0x0BCC}},
+ {2, {0x0BB5, 0x0BBE}},
+ {2, {0x0BB5, 0x0BBF}},
+ {2, {0x0BB5, 0x0BC0}},
+ {2, {0x0BB5, 0x0BC1}},
+ {2, {0x0BB5, 0x0BC2}},
+ {2, {0x0BB5, 0x0BC6}},
+ {2, {0x0BB5, 0x0BC7}},
+ {2, {0x0BB5, 0x0BC8}},
+ {2, {0x0BB5, 0x0BCA}},
+ {2, {0x0BB5, 0x0BCB}},
+ {2, {0x0BB5, 0x0BCC}},
+ {2, {0x0BB4, 0x0BBE}},
+ {2, {0x0BB4, 0x0BBF}},
+ {2, {0x0BB4, 0x0BC0}},
+ {2, {0x0BB4, 0x0BC1}},
+ {2, {0x0BB4, 0x0BC2}},
+ {2, {0x0BB4, 0x0BC6}},
+ {2, {0x0BB4, 0x0BC7}},
+ {2, {0x0BB4, 0x0BC8}},
+ {2, {0x0BB4, 0x0BCA}},
+ {2, {0x0BB4, 0x0BCB}},
+ {2, {0x0BB4, 0x0BCC}},
+ {2, {0x0BB3, 0x0BBE}},
+ {2, {0x0BB3, 0x0BBF}},
+ {2, {0x0BB3, 0x0BC0}},
+ {2, {0x0BB3, 0x0BC1}},
+ {2, {0x0BB3, 0x0BC2}},
+ {2, {0x0BB3, 0x0BC6}},
+ {2, {0x0BB3, 0x0BC7}},
+ {2, {0x0BB3, 0x0BC8}},
+ {2, {0x0BB3, 0x0BCA}},
+ {2, {0x0BB3, 0x0BCB}},
+ {2, {0x0BB3, 0x0BCC}},
+ {2, {0x0BB1, 0x0BBE}},
+ {2, {0x0BB1, 0x0BBF}},
+ {2, {0x0BB1, 0x0BC0}},
+ {2, {0x0BB1, 0x0BC1}},
+ {2, {0x0BB1, 0x0BC2}},
+ {2, {0x0BB1, 0x0BC6}},
+ {2, {0x0BB1, 0x0BC7}},
+ {2, {0x0BB1, 0x0BC8}},
+ {2, {0x0BB1, 0x0BCA}},
+ {2, {0x0BB1, 0x0BCB}},
+ {2, {0x0BB1, 0x0BCC}},
+ {2, {0x0BA9, 0x0BBE}},
+ {2, {0x0BA9, 0x0BBF}},
+ {2, {0x0BA9, 0x0BC0}},
+ {2, {0x0BA9, 0x0BC1}},
+ {2, {0x0BA9, 0x0BC2}},
+ {2, {0x0BA9, 0x0BC6}},
+ {2, {0x0BA9, 0x0BC7}},
+ {2, {0x0BA9, 0x0BC8}},
+ {2, {0x0BA9, 0x0BCA}},
+ {2, {0x0BA9, 0x0BCB}},
+ {2, {0x0BA9, 0x0BCC}},
+ {2, {0x0B9C, 0x0BBE}},
+ {2, {0x0B9C, 0x0BBF}},
+ {2, {0x0B9C, 0x0BC0}},
+ {2, {0x0B9C, 0x0BC1}},
+ {2, {0x0B9C, 0x0BC2}},
+ {2, {0x0B9C, 0x0BC6}},
+ {2, {0x0B9C, 0x0BC7}},
+ {2, {0x0B9C, 0x0BC8}},
+ {2, {0x0B9C, 0x0BCA}},
+ {2, {0x0B9C, 0x0BCB}},
+ {2, {0x0B9C, 0x0BCC}},
+ {2, {0x0BB6, 0x0BBE}},
+ {2, {0x0BB6, 0x0BBF}},
+ {2, {0x0BB6, 0x0BC0}},
+ {2, {0x0BB6, 0x0BC1}},
+ {2, {0x0BB6, 0x0BC2}},
+ {2, {0x0BB6, 0x0BC6}},
+ {2, {0x0BB6, 0x0BC7}},
+ {2, {0x0BB6, 0x0BC8}},
+ {2, {0x0BB6, 0x0BCA}},
+ {2, {0x0BB6, 0x0BCB}},
+ {2, {0x0BB6, 0x0BCC}},
+ {2, {0x0BB7, 0x0BBE}},
+ {2, {0x0BB7, 0x0BBF}},
+ {2, {0x0BB7, 0x0BC0}},
+ {2, {0x0BB7, 0x0BC1}},
+ {2, {0x0BB7, 0x0BC2}},
+ {2, {0x0BB7, 0x0BC6}},
+ {2, {0x0BB7, 0x0BC7}},
+ {2, {0x0BB7, 0x0BC8}},
+ {2, {0x0BB7, 0x0BCA}},
+ {2, {0x0BB7, 0x0BCB}},
+ {2, {0x0BB7, 0x0BCC}},
+ {2, {0x0BB8, 0x0BBE}},
+ {2, {0x0BB8, 0x0BBF}},
+ {2, {0x0BB8, 0x0BC0}},
+ {2, {0x0BB8, 0x0BC1}},
+ {2, {0x0BB8, 0x0BC2}},
+ {2, {0x0BB8, 0x0BC6}},
+ {2, {0x0BB8, 0x0BC7}},
+ {2, {0x0BB8, 0x0BC8}},
+ {2, {0x0BB8, 0x0BCA}},
+ {2, {0x0BB8, 0x0BCB}},
+ {2, {0x0BB8, 0x0BCC}},
+ {2, {0x0BB9, 0x0BBE}},
+ {2, {0x0BB9, 0x0BBF}},
+ {2, {0x0BB9, 0x0BC0}},
+ {2, {0x0BB9, 0x0BC1}},
+ {2, {0x0BB9, 0x0BC2}},
+ {2, {0x0BB9, 0x0BC6}},
+ {2, {0x0BB9, 0x0BC7}},
+ {2, {0x0BB9, 0x0BC8}},
+ {2, {0x0BB9, 0x0BCA}},
+ {2, {0x0BB9, 0x0BCB}},
+ {2, {0x0BB9, 0x0BCC}},
+ {3, {0x0B95, 0x0BCD, 0x0BB7}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BBE}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BBF}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BC0}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BC1}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BC2}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BC6}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BC7}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BC8}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BCA}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BCB}},
+ {4, {0x0B95, 0x0BCD, 0x0BB7, 0x0BCC}},
+ {4, {0x0BB6, 0x0BCD, 0x0BB0, 0x0BC0}},
+ {3, {0x0DCA, 0x200D, 0x0DBA}},
+ {3, {0x0DCA, 0x200D, 0x0DBB}},
+ {3, {0x0DBB, 0x0DCA, 0x200D}},
+ {2, {0x10E3, 0x0302}},
+ {2, {0x17D2, 0x1780}},
+ {2, {0x17D2, 0x1781}},
+ {2, {0x17D2, 0x1782}},
+ {2, {0x17D2, 0x1783}},
+ {2, {0x17D2, 0x1784}},
+ {2, {0x17D2, 0x1785}},
+ {2, {0x17D2, 0x1786}},
+ {2, {0x17D2, 0x1787}},
+ {2, {0x17D2, 0x1788}},
+ {2, {0x17D2, 0x1789}},
+ {2, {0x17D2, 0x178A}},
+ {2, {0x17D2, 0x178B}},
+ {2, {0x17D2, 0x178C}},
+ {2, {0x17D2, 0x178D}},
+ {2, {0x17D2, 0x178E}},
+ {2, {0x17D2, 0x178F}},
+ {2, {0x17D2, 0x1790}},
+ {2, {0x17D2, 0x1791}},
+ {2, {0x17D2, 0x1792}},
+ {2, {0x17D2, 0x1793}},
+ {2, {0x17D2, 0x1794}},
+ {2, {0x17D2, 0x1795}},
+ {2, {0x17D2, 0x1796}},
+ {2, {0x17D2, 0x1797}},
+ {2, {0x17D2, 0x1798}},
+ {2, {0x17D2, 0x1799}},
+ {2, {0x17D2, 0x179A}},
+ {2, {0x17D2, 0x179B}},
+ {2, {0x17D2, 0x179C}},
+ {2, {0x17D2, 0x179D}},
+ {2, {0x17D2, 0x179E}},
+ {2, {0x17D2, 0x179F}},
+ {2, {0x17D2, 0x17A0}},
+ {2, {0x17D2, 0x17A1}},
+ {2, {0x17D2, 0x17A2}},
+ {2, {0x17D2, 0x17A7}},
+ {2, {0x17D2, 0x17AB}},
+ {2, {0x17D2, 0x17AC}},
+ {2, {0x17D2, 0x17AF}},
+ {2, {0x17BB, 0x17C6}},
+ {2, {0x17B6, 0x17C6}},
+ {2, {0x304B, 0x309A}},
+ {2, {0x304D, 0x309A}},
+ {2, {0x304F, 0x309A}},
+ {2, {0x3051, 0x309A}},
+ {2, {0x3053, 0x309A}},
+ {2, {0x30AB, 0x309A}},
+ {2, {0x30AD, 0x309A}},
+ {2, {0x30AF, 0x309A}},
+ {2, {0x30B1, 0x309A}},
+ {2, {0x30B3, 0x309A}},
+ {2, {0x30BB, 0x309A}},
+ {2, {0x30C4, 0x309A}},
+ {2, {0x30C8, 0x309A}},
+ {2, {0x31F7, 0x309A}},
+ {2, {0x02E5, 0x02E9}},
+ {2, {0x02E9, 0x02E5}},
+};
diff --git a/contrib/tools/python3/Modules/winreparse.h b/contrib/tools/python3/Modules/winreparse.h
new file mode 100644
index 00000000000..f06f701f999
--- /dev/null
+++ b/contrib/tools/python3/Modules/winreparse.h
@@ -0,0 +1,59 @@
+#ifndef Py_WINREPARSE_H
+#define Py_WINREPARSE_H
+
+#ifdef MS_WINDOWS
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The following structure was copied from
+ http://msdn.microsoft.com/en-us/library/ff552012.aspx as the required
+ include km\ntifs.h isn't present in the Windows SDK (at least as included
+ with Visual Studio Express). Use unique names to avoid conflicting with
+ the structure as defined by Min GW. */
+typedef struct {
+ ULONG ReparseTag;
+ USHORT ReparseDataLength;
+ USHORT Reserved;
+ union {
+ struct {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ ULONG Flags;
+ WCHAR PathBuffer[1];
+ } SymbolicLinkReparseBuffer;
+
+ struct {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ WCHAR PathBuffer[1];
+ } MountPointReparseBuffer;
+
+ struct {
+ UCHAR DataBuffer[1];
+ } GenericReparseBuffer;
+ };
+} _Py_REPARSE_DATA_BUFFER, *_Py_PREPARSE_DATA_BUFFER;
+
+#define _Py_REPARSE_DATA_BUFFER_HEADER_SIZE \
+ FIELD_OFFSET(_Py_REPARSE_DATA_BUFFER, GenericReparseBuffer)
+#define _Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
+
+// Defined in WinBase.h in 'recent' versions of Windows 10 SDK
+#ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
+#define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x2
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MS_WINDOWS */
+
+#endif /* !Py_WINREPARSE_H */
diff --git a/contrib/tools/python3/Modules/ya.make b/contrib/tools/python3/Modules/ya.make
new file mode 100644
index 00000000000..2e0a9717076
--- /dev/null
+++ b/contrib/tools/python3/Modules/ya.make
@@ -0,0 +1,188 @@
+# Generated by devtools/yamaker.
+
+LIBRARY()
+
+VERSION(3.12.2)
+
+ORIGINAL_SOURCE(https://github.com/python/cpython/archive/v3.12.2.tar.gz)
+
+LICENSE(Python-2.0)
+
+PEERDIR(
+ contrib/libs/expat
+ contrib/libs/libbz2
+ contrib/libs/libc_compat
+ contrib/libs/lzma
+ contrib/libs/openssl
+ contrib/libs/zlib
+ contrib/restricted/libffi
+ library/cpp/sanitizer/include
+)
+
+ADDINCL(
+ contrib/libs/expat
+ contrib/libs/libbz2
+ contrib/restricted/libffi/include
+ contrib/tools/python3/Include
+ contrib/tools/python3/Include/internal
+ contrib/tools/python3/Modules
+ contrib/tools/python3/Modules/_decimal/libmpdec
+ contrib/tools/python3/Modules/_hacl/include
+)
+
+NO_COMPILER_WARNINGS()
+
+NO_RUNTIME()
+
+CFLAGS(
+ -DPy_BUILD_CORE
+ -DPy_BUILD_CORE_BUILTIN
+)
+
+SRCS(
+ _abc.c
+ _asynciomodule.c
+ _bisectmodule.c
+ _blake2/blake2b_impl.c
+ _blake2/blake2module.c
+ _blake2/blake2s_impl.c
+ _bz2module.c
+ _codecsmodule.c
+ _collectionsmodule.c
+ _contextvarsmodule.c
+ _csv.c
+ _ctypes/_ctypes.c
+ _ctypes/callbacks.c
+ _ctypes/callproc.c
+ _ctypes/cfield.c
+ _ctypes/stgdict.c
+ _datetimemodule.c
+ _decimal/_decimal.c
+ _decimal/libmpdec/basearith.c
+ _decimal/libmpdec/constants.c
+ _decimal/libmpdec/context.c
+ _decimal/libmpdec/convolute.c
+ _decimal/libmpdec/crt.c
+ _decimal/libmpdec/difradix2.c
+ _decimal/libmpdec/fnt.c
+ _decimal/libmpdec/fourstep.c
+ _decimal/libmpdec/io.c
+ _decimal/libmpdec/mpalloc.c
+ _decimal/libmpdec/mpdecimal.c
+ _decimal/libmpdec/mpsignal.c
+ _decimal/libmpdec/numbertheory.c
+ _decimal/libmpdec/sixstep.c
+ _decimal/libmpdec/transpose.c
+ _elementtree.c
+ _functoolsmodule.c
+ _hacl/Hacl_Hash_MD5.c
+ _hacl/Hacl_Hash_SHA1.c
+ _hacl/Hacl_Hash_SHA2.c
+ _hacl/Hacl_Hash_SHA3.c
+ _hashopenssl.c
+ _heapqmodule.c
+ _io/_iomodule.c
+ _io/bufferedio.c
+ _io/bytesio.c
+ _io/fileio.c
+ _io/iobase.c
+ _io/stringio.c
+ _io/textio.c
+ _io/winconsoleio.c
+ _json.c
+ _localemodule.c
+ _lsprof.c
+ _lzmamodule.c
+ _multiprocessing/multiprocessing.c
+ _multiprocessing/posixshmem.c
+ _multiprocessing/semaphore.c
+ _opcode.c
+ _operator.c
+ _pickle.c
+ _queuemodule.c
+ _randommodule.c
+ _sre/sre.c
+ _ssl.c
+ _stat.c
+ _statisticsmodule.c
+ _struct.c
+ _threadmodule.c
+ _tracemalloc.c
+ _typingmodule.c
+ _weakref.c
+ _xxinterpchannelsmodule.c
+ _xxsubinterpretersmodule.c
+ _xxtestfuzz/_xxtestfuzz.c
+ _xxtestfuzz/fuzzer.c
+ _zoneinfo.c
+ arraymodule.c
+ atexitmodule.c
+ audioop.c
+ binascii.c
+ cjkcodecs/_codecs_cn.c
+ cjkcodecs/_codecs_hk.c
+ cjkcodecs/_codecs_iso2022.c
+ cjkcodecs/_codecs_jp.c
+ cjkcodecs/_codecs_kr.c
+ cjkcodecs/_codecs_tw.c
+ cjkcodecs/multibytecodec.c
+ cmathmodule.c
+ config.c
+ errnomodule.c
+ faulthandler.c
+ gcmodule.c
+ getbuildinfo.c
+ getpath.c
+ itertoolsmodule.c
+ main.c
+ mathmodule.c
+ md5module.c
+ mmapmodule.c
+ posixmodule.c
+ pyexpat.c
+ rotatingtree.c
+ selectmodule.c
+ sha1module.c
+ sha2module.c
+ sha3module.c
+ signalmodule.c
+ socketmodule.c
+ symtablemodule.c
+ timemodule.c
+ unicodedata.c
+ zlibmodule.c
+)
+
+IF (OS_WINDOWS)
+ SRCS(
+ _winapi.c
+ overlapped.c
+ )
+ELSE()
+ SRCS(
+ _cryptmodule.c
+ _posixsubprocess.c
+ fcntlmodule.c
+ grpmodule.c
+ pwdmodule.c
+ resource.c
+ syslogmodule.c
+ termios.c
+ )
+
+ IF (OS_DARWIN)
+ SRCS(
+ _scproxy.c
+ )
+ ELSEIF (OS_LINUX)
+ IF (NOT MUSL)
+ EXTRALIBS(crypt)
+ ENDIF()
+
+ SRCS(
+ spwdmodule.c
+ )
+ ENDIF()
+ENDIF()
+
+END()
diff --git a/contrib/tools/python3/Modules/zlibmodule.c b/contrib/tools/python3/Modules/zlibmodule.c
new file mode 100644
index 00000000000..f94c57e4c89
--- /dev/null
+++ b/contrib/tools/python3/Modules/zlibmodule.c
@@ -0,0 +1,2140 @@
+/* zlibmodule.c -- gzip-compatible data compression */
+/* See http://zlib.net/ */
+
+/* Windows users: read Python's PCbuild\readme.txt */
+
+#define PY_SSIZE_T_CLEAN
+
+#include "Python.h"
+#include "structmember.h" // PyMemberDef
+#include "zlib.h"
+#include "stdbool.h"
+
+#if defined(ZLIB_VERNUM) && ZLIB_VERNUM < 0x1221
+#error "At least zlib version 1.2.2.1 is required"
+#endif
+
+// Blocks output buffer wrappers
+#include "pycore_blocks_output_buffer.h"
+
+#if OUTPUT_BUFFER_MAX_BLOCK_SIZE > UINT32_MAX
+ #error "The maximum block size accepted by zlib is UINT32_MAX."
+#endif
+
+/* On success, return value >= 0
+ On failure, return -1 */
+static inline Py_ssize_t
+OutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, Py_ssize_t max_length,
+ Bytef **next_out, uint32_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ allocated = _BlocksOutputBuffer_InitAndGrow(
+ buffer, max_length, (void**) next_out);
+ *avail_out = (uint32_t) allocated;
+ return allocated;
+}
+
+/* On success, return value >= 0
+ On failure, return -1 */
+static inline Py_ssize_t
+OutputBuffer_Grow(_BlocksOutputBuffer *buffer,
+ Bytef **next_out, uint32_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ allocated = _BlocksOutputBuffer_Grow(
+ buffer, (void**) next_out, (Py_ssize_t) *avail_out);
+ *avail_out = (uint32_t) allocated;
+ return allocated;
+}
+
+static inline Py_ssize_t
+OutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, uint32_t avail_out)
+{
+ return _BlocksOutputBuffer_GetDataSize(buffer, (Py_ssize_t) avail_out);
+}
+
+static inline PyObject *
+OutputBuffer_Finish(_BlocksOutputBuffer *buffer, uint32_t avail_out)
+{
+ return _BlocksOutputBuffer_Finish(buffer, (Py_ssize_t) avail_out);
+}
+
+static inline void
+OutputBuffer_OnError(_BlocksOutputBuffer *buffer)
+{
+ _BlocksOutputBuffer_OnError(buffer);
+}
+
+/* The max buffer size accepted by zlib is UINT32_MAX, the initial buffer size
+ `init_size` may > it in 64-bit build. These wrapper functions maintain an
+ UINT32_MAX sliding window for the first block:
+ 1. OutputBuffer_WindowInitWithSize()
+ 2. OutputBuffer_WindowGrow()
+ 3. OutputBuffer_WindowFinish()
+ 4. OutputBuffer_WindowOnError()
+
+ ==== is the sliding window:
+ 1. ====------
+ ^ next_posi, left_bytes is 6
+ 2. ----====--
+ ^ next_posi, left_bytes is 2
+ 3. --------==
+ ^ next_posi, left_bytes is 0 */
+typedef struct {
+ Py_ssize_t left_bytes;
+ Bytef *next_posi;
+} _Uint32Window;
+
+/* Initialize the buffer with an initial buffer size.
+
+ On success, return value >= 0
+ On failure, return value < 0 */
+static inline Py_ssize_t
+OutputBuffer_WindowInitWithSize(_BlocksOutputBuffer *buffer, _Uint32Window *window,
+ Py_ssize_t init_size,
+ Bytef **next_out, uint32_t *avail_out)
+{
+ Py_ssize_t allocated = _BlocksOutputBuffer_InitWithSize(
+ buffer, init_size, (void**) next_out);
+
+ if (allocated >= 0) {
+ // the UINT32_MAX sliding window
+ Py_ssize_t window_size = Py_MIN((size_t)allocated, UINT32_MAX);
+ *avail_out = (uint32_t) window_size;
+
+ window->left_bytes = allocated - window_size;
+ window->next_posi = *next_out + window_size;
+ }
+ return allocated;
+}
+
+/* Grow the buffer.
+
+ On success, return value >= 0
+ On failure, return value < 0 */
+static inline Py_ssize_t
+OutputBuffer_WindowGrow(_BlocksOutputBuffer *buffer, _Uint32Window *window,
+ Bytef **next_out, uint32_t *avail_out)
+{
+ Py_ssize_t allocated;
+
+ /* ensure no gaps in the data.
+ if inlined, this check could be optimized away.*/
+ if (*avail_out != 0) {
+ PyErr_SetString(PyExc_SystemError,
+ "*avail_out != 0 in OutputBuffer_WindowGrow().");
+ return -1;
+ }
+
+ // slide the UINT32_MAX sliding window
+ if (window->left_bytes > 0) {
+ Py_ssize_t window_size = Py_MIN((size_t)window->left_bytes, UINT32_MAX);
+
+ *next_out = window->next_posi;
+ *avail_out = (uint32_t) window_size;
+
+ window->left_bytes -= window_size;
+ window->next_posi += window_size;
+
+ return window_size;
+ }
+ assert(window->left_bytes == 0);
+
+ // only the first block may > UINT32_MAX
+ allocated = _BlocksOutputBuffer_Grow(
+ buffer, (void**) next_out, (Py_ssize_t) *avail_out);
+ *avail_out = (uint32_t) allocated;
+ return allocated;
+}
+
+/* Finish the buffer.
+
+ On success, return a bytes object
+ On failure, return NULL */
+static inline PyObject *
+OutputBuffer_WindowFinish(_BlocksOutputBuffer *buffer, _Uint32Window *window,
+ uint32_t avail_out)
+{
+ Py_ssize_t real_avail_out = (Py_ssize_t) avail_out + window->left_bytes;
+ return _BlocksOutputBuffer_Finish(buffer, real_avail_out);
+}
+
+static inline void
+OutputBuffer_WindowOnError(_BlocksOutputBuffer *buffer, _Uint32Window *window)
+{
+ _BlocksOutputBuffer_OnError(buffer);
+}
+
+
+#define ENTER_ZLIB(obj) do { \
+ if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+ Py_BEGIN_ALLOW_THREADS \
+ PyThread_acquire_lock((obj)->lock, 1); \
+ Py_END_ALLOW_THREADS \
+ } } while (0)
+#define LEAVE_ZLIB(obj) PyThread_release_lock((obj)->lock);
+
+
+/* The following parameters are copied from zutil.h, version 0.95 */
+#define DEFLATED 8
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+
+/* Initial buffer size. */
+#define DEF_BUF_SIZE (16*1024)
+#define DEF_MAX_INITIAL_BUF_SIZE (16 * 1024 * 1024)
+
+static PyModuleDef zlibmodule;
+
+typedef struct {
+ PyTypeObject *Comptype;
+ PyTypeObject *Decomptype;
+ PyTypeObject *ZlibDecompressorType;
+ PyObject *ZlibError;
+} zlibstate;
+
+static inline zlibstate*
+get_zlib_state(PyObject *module)
+{
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (zlibstate *)state;
+}
+
+typedef struct
+{
+ PyObject_HEAD
+ z_stream zst;
+ PyObject *unused_data;
+ PyObject *unconsumed_tail;
+ char eof;
+ bool is_initialised;
+ PyObject *zdict;
+ PyThread_type_lock lock;
+} compobject;
+
+static void
+zlib_error(zlibstate *state, z_stream zst, int err, const char *msg)
+{
+ const char *zmsg = Z_NULL;
+ /* In case of a version mismatch, zst.msg won't be initialized.
+ Check for this case first, before looking at zst.msg. */
+ if (err == Z_VERSION_ERROR)
+ zmsg = "library version mismatch";
+ if (zmsg == Z_NULL)
+ zmsg = zst.msg;
+ if (zmsg == Z_NULL) {
+ switch (err) {
+ case Z_BUF_ERROR:
+ zmsg = "incomplete or truncated stream";
+ break;
+ case Z_STREAM_ERROR:
+ zmsg = "inconsistent stream state";
+ break;
+ case Z_DATA_ERROR:
+ zmsg = "invalid input data";
+ break;
+ }
+ }
+ if (zmsg == Z_NULL)
+ PyErr_Format(state->ZlibError, "Error %d %s", err, msg);
+ else
+ PyErr_Format(state->ZlibError, "Error %d %s: %.200s", err, msg, zmsg);
+}
+
+/*[clinic input]
+module zlib
+class zlib.Compress "compobject *" "&Comptype"
+class zlib.Decompress "compobject *" "&Decomptype"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=093935115c3e3158]*/
+
+static compobject *
+newcompobject(PyTypeObject *type)
+{
+ compobject *self;
+ self = PyObject_New(compobject, type);
+ if (self == NULL)
+ return NULL;
+ self->eof = 0;
+ self->is_initialised = 0;
+ self->zdict = NULL;
+ self->unused_data = PyBytes_FromStringAndSize("", 0);
+ if (self->unused_data == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->unconsumed_tail = PyBytes_FromStringAndSize("", 0);
+ if (self->unconsumed_tail == NULL) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
+ return self;
+}
+
+static void*
+PyZlib_Malloc(voidpf ctx, uInt items, uInt size)
+{
+ if (size != 0 && items > (size_t)PY_SSIZE_T_MAX / size)
+ return NULL;
+ /* PyMem_Malloc() cannot be used: the GIL is not held when
+ inflate() and deflate() are called */
+ return PyMem_RawMalloc((size_t)items * (size_t)size);
+}
+
+static void
+PyZlib_Free(voidpf ctx, void *ptr)
+{
+ PyMem_RawFree(ptr);
+}
+
+static void
+arrange_input_buffer(z_stream *zst, Py_ssize_t *remains)
+{
+ zst->avail_in = (uInt)Py_MIN((size_t)*remains, UINT_MAX);
+ *remains -= zst->avail_in;
+}
+
+/*[clinic input]
+zlib.compress
+
+ data: Py_buffer
+ Binary data to be compressed.
+ /
+ level: int(c_default="Z_DEFAULT_COMPRESSION") = Z_DEFAULT_COMPRESSION
+ Compression level, in 0-9 or -1.
+ wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+ The window buffer size and container format.
+
+Returns a bytes object containing compressed data.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_compress_impl(PyObject *module, Py_buffer *data, int level, int wbits)
+/*[clinic end generated code: output=46bd152fadd66df2 input=c4d06ee5782a7e3f]*/
+{
+ PyObject *return_value;
+ int flush;
+ z_stream zst;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+
+ zlibstate *state = get_zlib_state(module);
+
+ Byte *ibuf = data->buf;
+ Py_ssize_t ibuflen = data->len;
+
+ if (OutputBuffer_InitAndGrow(&buffer, -1, &zst.next_out, &zst.avail_out) < 0) {
+ goto error;
+ }
+
+ zst.opaque = NULL;
+ zst.zalloc = PyZlib_Malloc;
+ zst.zfree = PyZlib_Free;
+ zst.next_in = ibuf;
+ int err = deflateInit2(&zst, level, DEFLATED, wbits, DEF_MEM_LEVEL,
+ Z_DEFAULT_STRATEGY);
+
+ switch (err) {
+ case Z_OK:
+ break;
+ case Z_MEM_ERROR:
+ PyErr_SetString(PyExc_MemoryError,
+ "Out of memory while compressing data");
+ goto error;
+ case Z_STREAM_ERROR:
+ PyErr_SetString(state->ZlibError, "Bad compression level");
+ goto error;
+ default:
+ deflateEnd(&zst);
+ zlib_error(state, zst, err, "while compressing data");
+ goto error;
+ }
+
+ do {
+ arrange_input_buffer(&zst, &ibuflen);
+ flush = ibuflen == 0 ? Z_FINISH : Z_NO_FLUSH;
+
+ do {
+ if (zst.avail_out == 0) {
+ if (OutputBuffer_Grow(&buffer, &zst.next_out, &zst.avail_out) < 0) {
+ deflateEnd(&zst);
+ goto error;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ err = deflate(&zst, flush);
+ Py_END_ALLOW_THREADS
+
+ if (err == Z_STREAM_ERROR) {
+ deflateEnd(&zst);
+ zlib_error(state, zst, err, "while compressing data");
+ goto error;
+ }
+
+ } while (zst.avail_out == 0);
+ assert(zst.avail_in == 0);
+
+ } while (flush != Z_FINISH);
+ assert(err == Z_STREAM_END);
+
+ err = deflateEnd(&zst);
+ if (err == Z_OK) {
+ return_value = OutputBuffer_Finish(&buffer, zst.avail_out);
+ if (return_value == NULL) {
+ goto error;
+ }
+ return return_value;
+ }
+ else
+ zlib_error(state, zst, err, "while finishing compression");
+ error:
+ OutputBuffer_OnError(&buffer);
+ return NULL;
+}
+
+/*[clinic input]
+zlib.decompress
+
+ data: Py_buffer
+ Compressed data.
+ /
+ wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+ The window buffer size and container format.
+ bufsize: Py_ssize_t(c_default="DEF_BUF_SIZE") = DEF_BUF_SIZE
+ The initial output buffer size.
+
+Returns a bytes object containing the uncompressed data.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_decompress_impl(PyObject *module, Py_buffer *data, int wbits,
+ Py_ssize_t bufsize)
+/*[clinic end generated code: output=77c7e35111dc8c42 input=a9ac17beff1f893f]*/
+{
+ PyObject *return_value;
+ Byte *ibuf;
+ Py_ssize_t ibuflen;
+ int err, flush;
+ z_stream zst;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+ _Uint32Window window; // output buffer's UINT32_MAX sliding window
+
+ zlibstate *state = get_zlib_state(module);
+
+ if (bufsize < 0) {
+ PyErr_SetString(PyExc_ValueError, "bufsize must be non-negative");
+ return NULL;
+ } else if (bufsize == 0) {
+ bufsize = 1;
+ }
+
+ if (OutputBuffer_WindowInitWithSize(&buffer, &window, bufsize,
+ &zst.next_out, &zst.avail_out) < 0) {
+ goto error;
+ }
+
+ ibuf = data->buf;
+ ibuflen = data->len;
+
+ zst.opaque = NULL;
+ zst.zalloc = PyZlib_Malloc;
+ zst.zfree = PyZlib_Free;
+ zst.avail_in = 0;
+ zst.next_in = ibuf;
+ err = inflateInit2(&zst, wbits);
+
+ switch (err) {
+ case Z_OK:
+ break;
+ case Z_MEM_ERROR:
+ PyErr_SetString(PyExc_MemoryError,
+ "Out of memory while decompressing data");
+ goto error;
+ default:
+ inflateEnd(&zst);
+ zlib_error(state, zst, err, "while preparing to decompress data");
+ goto error;
+ }
+
+ do {
+ arrange_input_buffer(&zst, &ibuflen);
+ flush = ibuflen == 0 ? Z_FINISH : Z_NO_FLUSH;
+
+ do {
+ if (zst.avail_out == 0) {
+ if (OutputBuffer_WindowGrow(&buffer, &window,
+ &zst.next_out, &zst.avail_out) < 0) {
+ inflateEnd(&zst);
+ goto error;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ err = inflate(&zst, flush);
+ Py_END_ALLOW_THREADS
+
+ switch (err) {
+ case Z_OK: /* fall through */
+ case Z_BUF_ERROR: /* fall through */
+ case Z_STREAM_END:
+ break;
+ case Z_MEM_ERROR:
+ inflateEnd(&zst);
+ PyErr_SetString(PyExc_MemoryError,
+ "Out of memory while decompressing data");
+ goto error;
+ default:
+ inflateEnd(&zst);
+ zlib_error(state, zst, err, "while decompressing data");
+ goto error;
+ }
+
+ } while (zst.avail_out == 0);
+
+ } while (err != Z_STREAM_END && ibuflen != 0);
+
+
+ if (err != Z_STREAM_END) {
+ inflateEnd(&zst);
+ zlib_error(state, zst, err, "while decompressing data");
+ goto error;
+ }
+
+ err = inflateEnd(&zst);
+ if (err != Z_OK) {
+ zlib_error(state, zst, err, "while finishing decompression");
+ goto error;
+ }
+
+ return_value = OutputBuffer_WindowFinish(&buffer, &window, zst.avail_out);
+ if (return_value != NULL) {
+ return return_value;
+ }
+
+ error:
+ OutputBuffer_WindowOnError(&buffer, &window);
+ return NULL;
+}
+
+/*[clinic input]
+zlib.compressobj
+
+ level: int(c_default="Z_DEFAULT_COMPRESSION") = Z_DEFAULT_COMPRESSION
+ The compression level (an integer in the range 0-9 or -1; default is
+ currently equivalent to 6). Higher compression levels are slower,
+ but produce smaller results.
+ method: int(c_default="DEFLATED") = DEFLATED
+ The compression algorithm. If given, this must be DEFLATED.
+ wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+ +9 to +15: The base-two logarithm of the window size. Include a zlib
+ container.
+ -9 to -15: Generate a raw stream.
+ +25 to +31: Include a gzip container.
+ memLevel: int(c_default="DEF_MEM_LEVEL") = DEF_MEM_LEVEL
+ Controls the amount of memory used for internal compression state.
+ Valid values range from 1 to 9. Higher values result in higher memory
+ usage, faster compression, and smaller output.
+ strategy: int(c_default="Z_DEFAULT_STRATEGY") = Z_DEFAULT_STRATEGY
+ Used to tune the compression algorithm. Possible values are
+ Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.
+ zdict: Py_buffer = None
+ The predefined compression dictionary - a sequence of bytes
+ containing subsequences that are likely to occur in the input data.
+
+Return a compressor object.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_compressobj_impl(PyObject *module, int level, int method, int wbits,
+ int memLevel, int strategy, Py_buffer *zdict)
+/*[clinic end generated code: output=8b5bed9c8fc3814d input=2fa3d026f90ab8d5]*/
+{
+ zlibstate *state = get_zlib_state(module);
+ if (zdict->buf != NULL && (size_t)zdict->len > UINT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "zdict length does not fit in an unsigned int");
+ return NULL;
+ }
+
+ compobject *self = newcompobject(state->Comptype);
+ if (self == NULL)
+ goto error;
+ self->zst.opaque = NULL;
+ self->zst.zalloc = PyZlib_Malloc;
+ self->zst.zfree = PyZlib_Free;
+ self->zst.next_in = NULL;
+ self->zst.avail_in = 0;
+ int err = deflateInit2(&self->zst, level, method, wbits, memLevel, strategy);
+ switch (err) {
+ case Z_OK:
+ self->is_initialised = 1;
+ if (zdict->buf == NULL) {
+ goto success;
+ } else {
+ err = deflateSetDictionary(&self->zst,
+ zdict->buf, (unsigned int)zdict->len);
+ switch (err) {
+ case Z_OK:
+ goto success;
+ case Z_STREAM_ERROR:
+ PyErr_SetString(PyExc_ValueError, "Invalid dictionary");
+ goto error;
+ default:
+ PyErr_SetString(PyExc_ValueError, "deflateSetDictionary()");
+ goto error;
+ }
+ }
+ case Z_MEM_ERROR:
+ PyErr_SetString(PyExc_MemoryError,
+ "Can't allocate memory for compression object");
+ goto error;
+ case Z_STREAM_ERROR:
+ PyErr_SetString(PyExc_ValueError, "Invalid initialization option");
+ goto error;
+ default:
+ zlib_error(state, self->zst, err, "while creating compression object");
+ goto error;
+ }
+
+ error:
+ Py_CLEAR(self);
+ success:
+ return (PyObject *)self;
+}
+
+static int
+set_inflate_zdict(zlibstate *state, compobject *self)
+{
+ Py_buffer zdict_buf;
+ if (PyObject_GetBuffer(self->zdict, &zdict_buf, PyBUF_SIMPLE) == -1) {
+ return -1;
+ }
+ if ((size_t)zdict_buf.len > UINT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "zdict length does not fit in an unsigned int");
+ PyBuffer_Release(&zdict_buf);
+ return -1;
+ }
+ int err;
+ err = inflateSetDictionary(&self->zst,
+ zdict_buf.buf, (unsigned int)zdict_buf.len);
+ PyBuffer_Release(&zdict_buf);
+ if (err != Z_OK) {
+ zlib_error(state, self->zst, err, "while setting zdict");
+ return -1;
+ }
+ return 0;
+}
+
+/*[clinic input]
+zlib.decompressobj
+
+ wbits: int(c_default="MAX_WBITS") = MAX_WBITS
+ The window buffer size and container format.
+ zdict: object(c_default="NULL") = b''
+ The predefined compression dictionary. This must be the same
+ dictionary as used by the compressor that produced the input data.
+
+Return a decompressor object.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_decompressobj_impl(PyObject *module, int wbits, PyObject *zdict)
+/*[clinic end generated code: output=3069b99994f36906 input=d3832b8511fc977b]*/
+{
+ zlibstate *state = get_zlib_state(module);
+
+ if (zdict != NULL && !PyObject_CheckBuffer(zdict)) {
+ PyErr_SetString(PyExc_TypeError,
+ "zdict argument must support the buffer protocol");
+ return NULL;
+ }
+
+ compobject *self = newcompobject(state->Decomptype);
+ if (self == NULL)
+ return NULL;
+ self->zst.opaque = NULL;
+ self->zst.zalloc = PyZlib_Malloc;
+ self->zst.zfree = PyZlib_Free;
+ self->zst.next_in = NULL;
+ self->zst.avail_in = 0;
+ if (zdict != NULL) {
+ self->zdict = Py_NewRef(zdict);
+ }
+ int err = inflateInit2(&self->zst, wbits);
+ switch (err) {
+ case Z_OK:
+ self->is_initialised = 1;
+ if (self->zdict != NULL && wbits < 0) {
+ if (set_inflate_zdict(state, self) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+ return (PyObject *)self;
+ case Z_STREAM_ERROR:
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_ValueError, "Invalid initialization option");
+ return NULL;
+ case Z_MEM_ERROR:
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError,
+ "Can't allocate memory for decompression object");
+ return NULL;
+ default:
+ zlib_error(state, self->zst, err, "while creating decompression object");
+ Py_DECREF(self);
+ return NULL;
+ }
+}
+
+static void
+Dealloc(compobject *self)
+{
+ PyObject *type = (PyObject *)Py_TYPE(self);
+ PyThread_free_lock(self->lock);
+ Py_XDECREF(self->unused_data);
+ Py_XDECREF(self->unconsumed_tail);
+ Py_XDECREF(self->zdict);
+ PyObject_Free(self);
+ Py_DECREF(type);
+}
+
+static void
+Comp_dealloc(compobject *self)
+{
+ if (self->is_initialised)
+ deflateEnd(&self->zst);
+ Dealloc(self);
+}
+
+static void
+Decomp_dealloc(compobject *self)
+{
+ if (self->is_initialised)
+ inflateEnd(&self->zst);
+ Dealloc(self);
+}
+
+/*[clinic input]
+zlib.Compress.compress
+
+ cls: defining_class
+ data: Py_buffer
+ Binary data to be compressed.
+ /
+
+Returns a bytes object containing compressed data.
+
+After calling this function, some of the input data may still
+be stored in internal buffers for later processing.
+Call the flush() method to clear these buffers.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Compress_compress_impl(compobject *self, PyTypeObject *cls,
+ Py_buffer *data)
+/*[clinic end generated code: output=6731b3f0ff357ca6 input=04d00f65ab01d260]*/
+{
+ PyObject *return_value;
+ int err;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+ zlibstate *state = PyType_GetModuleState(cls);
+
+ ENTER_ZLIB(self);
+
+ self->zst.next_in = data->buf;
+ Py_ssize_t ibuflen = data->len;
+
+ if (OutputBuffer_InitAndGrow(&buffer, -1, &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto error;
+ }
+
+ do {
+ arrange_input_buffer(&self->zst, &ibuflen);
+
+ do {
+ if (self->zst.avail_out == 0) {
+ if (OutputBuffer_Grow(&buffer, &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto error;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ err = deflate(&self->zst, Z_NO_FLUSH);
+ Py_END_ALLOW_THREADS
+
+ if (err == Z_STREAM_ERROR) {
+ zlib_error(state, self->zst, err, "while compressing data");
+ goto error;
+ }
+
+ } while (self->zst.avail_out == 0);
+ assert(self->zst.avail_in == 0);
+
+ } while (ibuflen != 0);
+
+ return_value = OutputBuffer_Finish(&buffer, self->zst.avail_out);
+ if (return_value != NULL) {
+ goto success;
+ }
+
+ error:
+ OutputBuffer_OnError(&buffer);
+ return_value = NULL;
+ success:
+ LEAVE_ZLIB(self);
+ return return_value;
+}
+
+/* Helper for objdecompress() and flush(). Saves any unconsumed input data in
+ self->unused_data or self->unconsumed_tail, as appropriate. */
+static int
+save_unconsumed_input(compobject *self, Py_buffer *data, int err)
+{
+ if (err == Z_STREAM_END) {
+ /* The end of the compressed data has been reached. Store the leftover
+ input data in self->unused_data. */
+ if (self->zst.avail_in > 0) {
+ Py_ssize_t old_size = PyBytes_GET_SIZE(self->unused_data);
+ Py_ssize_t new_size, left_size;
+ PyObject *new_data;
+ left_size = (Byte *)data->buf + data->len - self->zst.next_in;
+ if (left_size > (PY_SSIZE_T_MAX - old_size)) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ new_size = old_size + left_size;
+ new_data = PyBytes_FromStringAndSize(NULL, new_size);
+ if (new_data == NULL)
+ return -1;
+ memcpy(PyBytes_AS_STRING(new_data),
+ PyBytes_AS_STRING(self->unused_data), old_size);
+ memcpy(PyBytes_AS_STRING(new_data) + old_size,
+ self->zst.next_in, left_size);
+ Py_SETREF(self->unused_data, new_data);
+ self->zst.avail_in = 0;
+ }
+ }
+
+ if (self->zst.avail_in > 0 || PyBytes_GET_SIZE(self->unconsumed_tail)) {
+ /* This code handles two distinct cases:
+ 1. Output limit was reached. Save leftover input in unconsumed_tail.
+ 2. All input data was consumed. Clear unconsumed_tail. */
+ Py_ssize_t left_size = (Byte *)data->buf + data->len - self->zst.next_in;
+ PyObject *new_data = PyBytes_FromStringAndSize(
+ (char *)self->zst.next_in, left_size);
+ if (new_data == NULL)
+ return -1;
+ Py_SETREF(self->unconsumed_tail, new_data);
+ }
+
+ return 0;
+}
+
+/*[clinic input]
+zlib.Decompress.decompress
+
+ cls: defining_class
+ data: Py_buffer
+ The binary data to decompress.
+ /
+ max_length: Py_ssize_t = 0
+ The maximum allowable length of the decompressed data.
+ Unconsumed input data will be stored in
+ the unconsumed_tail attribute.
+
+Return a bytes object containing the decompressed version of the data.
+
+After calling this function, some of the input data may still be stored in
+internal buffers for later processing.
+Call the flush() method to clear these buffers.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Decompress_decompress_impl(compobject *self, PyTypeObject *cls,
+ Py_buffer *data, Py_ssize_t max_length)
+/*[clinic end generated code: output=b024a93c2c922d57 input=bfb37b3864cfb606]*/
+{
+ int err = Z_OK;
+ Py_ssize_t ibuflen;
+ PyObject *return_value;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+
+ PyObject *module = PyType_GetModule(cls);
+ if (module == NULL)
+ return NULL;
+
+ zlibstate *state = get_zlib_state(module);
+ if (max_length < 0) {
+ PyErr_SetString(PyExc_ValueError, "max_length must be non-negative");
+ return NULL;
+ } else if (max_length == 0) {
+ max_length = -1;
+ }
+
+ ENTER_ZLIB(self);
+
+ self->zst.next_in = data->buf;
+ ibuflen = data->len;
+
+ if (OutputBuffer_InitAndGrow(&buffer, max_length, &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto abort;
+ }
+
+ do {
+ arrange_input_buffer(&self->zst, &ibuflen);
+
+ do {
+ if (self->zst.avail_out == 0) {
+ if (OutputBuffer_GetDataSize(&buffer, self->zst.avail_out) == max_length) {
+ goto save;
+ }
+ if (OutputBuffer_Grow(&buffer, &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto abort;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ err = inflate(&self->zst, Z_SYNC_FLUSH);
+ Py_END_ALLOW_THREADS
+
+ switch (err) {
+ case Z_OK: /* fall through */
+ case Z_BUF_ERROR: /* fall through */
+ case Z_STREAM_END:
+ break;
+ default:
+ if (err == Z_NEED_DICT && self->zdict != NULL) {
+ if (set_inflate_zdict(state, self) < 0) {
+ goto abort;
+ }
+ else
+ break;
+ }
+ goto save;
+ }
+
+ } while (self->zst.avail_out == 0 || err == Z_NEED_DICT);
+
+ } while (err != Z_STREAM_END && ibuflen != 0);
+
+ save:
+ if (save_unconsumed_input(self, data, err) < 0)
+ goto abort;
+
+ if (err == Z_STREAM_END) {
+ /* This is the logical place to call inflateEnd, but the old behaviour
+ of only calling it on flush() is preserved. */
+ self->eof = 1;
+ } else if (err != Z_OK && err != Z_BUF_ERROR) {
+ /* We will only get Z_BUF_ERROR if the output buffer was full
+ but there wasn't more output when we tried again, so it is
+ not an error condition.
+ */
+ zlib_error(state, self->zst, err, "while decompressing data");
+ goto abort;
+ }
+
+ return_value = OutputBuffer_Finish(&buffer, self->zst.avail_out);
+ if (return_value != NULL) {
+ goto success;
+ }
+
+ abort:
+ OutputBuffer_OnError(&buffer);
+ return_value = NULL;
+ success:
+ LEAVE_ZLIB(self);
+ return return_value;
+}
+
+/*[clinic input]
+zlib.Compress.flush
+
+ cls: defining_class
+ mode: int(c_default="Z_FINISH") = zlib.Z_FINISH
+ One of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH.
+ If mode == Z_FINISH, the compressor object can no longer be
+ used after calling the flush() method. Otherwise, more data
+ can still be compressed.
+ /
+
+Return a bytes object containing any remaining compressed data.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Compress_flush_impl(compobject *self, PyTypeObject *cls, int mode)
+/*[clinic end generated code: output=c7efd13efd62add2 input=286146e29442eb6c]*/
+{
+ int err;
+ PyObject *return_value;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+
+ zlibstate *state = PyType_GetModuleState(cls);
+ /* Flushing with Z_NO_FLUSH is a no-op, so there's no point in
+ doing any work at all; just return an empty string. */
+ if (mode == Z_NO_FLUSH) {
+ return PyBytes_FromStringAndSize(NULL, 0);
+ }
+
+ ENTER_ZLIB(self);
+
+ self->zst.avail_in = 0;
+
+ if (OutputBuffer_InitAndGrow(&buffer, -1, &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto error;
+ }
+
+ do {
+ if (self->zst.avail_out == 0) {
+ if (OutputBuffer_Grow(&buffer, &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto error;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ err = deflate(&self->zst, mode);
+ Py_END_ALLOW_THREADS
+
+ if (err == Z_STREAM_ERROR) {
+ zlib_error(state, self->zst, err, "while flushing");
+ goto error;
+ }
+ } while (self->zst.avail_out == 0);
+ assert(self->zst.avail_in == 0);
+
+ /* If mode is Z_FINISH, we also have to call deflateEnd() to free
+ various data structures. Note we should only get Z_STREAM_END when
+ mode is Z_FINISH, but checking both for safety*/
+ if (err == Z_STREAM_END && mode == Z_FINISH) {
+ err = deflateEnd(&self->zst);
+ if (err != Z_OK) {
+ zlib_error(state, self->zst, err, "while finishing compression");
+ goto error;
+ }
+ else
+ self->is_initialised = 0;
+
+ /* We will only get Z_BUF_ERROR if the output buffer was full
+ but there wasn't more output when we tried again, so it is
+ not an error condition.
+ */
+ } else if (err != Z_OK && err != Z_BUF_ERROR) {
+ zlib_error(state, self->zst, err, "while flushing");
+ goto error;
+ }
+
+ return_value = OutputBuffer_Finish(&buffer, self->zst.avail_out);
+ if (return_value != NULL) {
+ goto success;
+ }
+
+error:
+ OutputBuffer_OnError(&buffer);
+ return_value = NULL;
+success:
+ LEAVE_ZLIB(self);
+ return return_value;
+}
+
+#ifdef HAVE_ZLIB_COPY
+
+/*[clinic input]
+zlib.Compress.copy
+
+ cls: defining_class
+
+Return a copy of the compression object.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Compress_copy_impl(compobject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=c4d2cfb4b0d7350b input=235497e482d40986]*/
+{
+ zlibstate *state = PyType_GetModuleState(cls);
+
+ compobject *return_value = newcompobject(state->Comptype);
+ if (!return_value) return NULL;
+
+ /* Copy the zstream state
+ * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe
+ */
+ ENTER_ZLIB(self);
+ int err = deflateCopy(&return_value->zst, &self->zst);
+ switch (err) {
+ case Z_OK:
+ break;
+ case Z_STREAM_ERROR:
+ PyErr_SetString(PyExc_ValueError, "Inconsistent stream state");
+ goto error;
+ case Z_MEM_ERROR:
+ PyErr_SetString(PyExc_MemoryError,
+ "Can't allocate memory for compression object");
+ goto error;
+ default:
+ zlib_error(state, self->zst, err, "while copying compression object");
+ goto error;
+ }
+ Py_XSETREF(return_value->unused_data, Py_NewRef(self->unused_data));
+ Py_XSETREF(return_value->unconsumed_tail, Py_NewRef(self->unconsumed_tail));
+ Py_XSETREF(return_value->zdict, Py_XNewRef(self->zdict));
+ return_value->eof = self->eof;
+
+ /* Mark it as being initialized */
+ return_value->is_initialised = 1;
+
+ LEAVE_ZLIB(self);
+ return (PyObject *)return_value;
+
+error:
+ LEAVE_ZLIB(self);
+ Py_XDECREF(return_value);
+ return NULL;
+}
+
+/*[clinic input]
+zlib.Compress.__copy__
+
+ cls: defining_class
+
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Compress___copy___impl(compobject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=074613db332cb668 input=5c0188367ab0fe64]*/
+{
+ return zlib_Compress_copy_impl(self, cls);
+}
+
+/*[clinic input]
+zlib.Compress.__deepcopy__
+
+ cls: defining_class
+ memo: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Compress___deepcopy___impl(compobject *self, PyTypeObject *cls,
+ PyObject *memo)
+/*[clinic end generated code: output=24b3aed785f54033 input=c90347319a514430]*/
+{
+ return zlib_Compress_copy_impl(self, cls);
+}
+
+/*[clinic input]
+zlib.Decompress.copy
+
+ cls: defining_class
+
+Return a copy of the decompression object.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Decompress_copy_impl(compobject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=a7ddc016e1d0a781 input=20ef3aa208282ff2]*/
+{
+ zlibstate *state = PyType_GetModuleState(cls);
+
+ compobject *return_value = newcompobject(state->Decomptype);
+ if (!return_value) return NULL;
+
+ /* Copy the zstream state
+ * We use ENTER_ZLIB / LEAVE_ZLIB to make this thread-safe
+ */
+ ENTER_ZLIB(self);
+ int err = inflateCopy(&return_value->zst, &self->zst);
+ switch (err) {
+ case Z_OK:
+ break;
+ case Z_STREAM_ERROR:
+ PyErr_SetString(PyExc_ValueError, "Inconsistent stream state");
+ goto error;
+ case Z_MEM_ERROR:
+ PyErr_SetString(PyExc_MemoryError,
+ "Can't allocate memory for decompression object");
+ goto error;
+ default:
+ zlib_error(state, self->zst, err, "while copying decompression object");
+ goto error;
+ }
+
+ Py_XSETREF(return_value->unused_data, Py_NewRef(self->unused_data));
+ Py_XSETREF(return_value->unconsumed_tail, Py_NewRef(self->unconsumed_tail));
+ Py_XSETREF(return_value->zdict, Py_XNewRef(self->zdict));
+ return_value->eof = self->eof;
+
+ /* Mark it as being initialized */
+ return_value->is_initialised = 1;
+
+ LEAVE_ZLIB(self);
+ return (PyObject *)return_value;
+
+error:
+ LEAVE_ZLIB(self);
+ Py_XDECREF(return_value);
+ return NULL;
+}
+
+/*[clinic input]
+zlib.Decompress.__copy__
+
+ cls: defining_class
+
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Decompress___copy___impl(compobject *self, PyTypeObject *cls)
+/*[clinic end generated code: output=cf1e6473744f53fa input=cc3143067b622bdf]*/
+{
+ return zlib_Decompress_copy_impl(self, cls);
+}
+
+/*[clinic input]
+zlib.Decompress.__deepcopy__
+
+ cls: defining_class
+ memo: object
+ /
+
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Decompress___deepcopy___impl(compobject *self, PyTypeObject *cls,
+ PyObject *memo)
+/*[clinic end generated code: output=34f7b719a0c0d51b input=fc13b9c58622544e]*/
+{
+ return zlib_Decompress_copy_impl(self, cls);
+}
+
+#endif
+
+/*[clinic input]
+zlib.Decompress.flush
+
+ cls: defining_class
+ length: Py_ssize_t(c_default="DEF_BUF_SIZE") = zlib.DEF_BUF_SIZE
+ the initial size of the output buffer.
+ /
+
+Return a bytes object containing any remaining decompressed data.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_Decompress_flush_impl(compobject *self, PyTypeObject *cls,
+ Py_ssize_t length)
+/*[clinic end generated code: output=4532fc280bd0f8f2 input=42f1f4b75230e2cd]*/
+{
+ int err, flush;
+ Py_buffer data;
+ PyObject *return_value;
+ Py_ssize_t ibuflen;
+ _BlocksOutputBuffer buffer = {.list = NULL};
+ _Uint32Window window; // output buffer's UINT32_MAX sliding window
+
+ PyObject *module = PyType_GetModule(cls);
+ if (module == NULL) {
+ return NULL;
+ }
+
+ zlibstate *state = get_zlib_state(module);
+
+ if (length <= 0) {
+ PyErr_SetString(PyExc_ValueError, "length must be greater than zero");
+ return NULL;
+ }
+
+ ENTER_ZLIB(self);
+
+ if (PyObject_GetBuffer(self->unconsumed_tail, &data, PyBUF_SIMPLE) == -1) {
+ LEAVE_ZLIB(self);
+ return NULL;
+ }
+
+ self->zst.next_in = data.buf;
+ ibuflen = data.len;
+
+ if (OutputBuffer_WindowInitWithSize(&buffer, &window, length,
+ &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto abort;
+ }
+
+ do {
+ arrange_input_buffer(&self->zst, &ibuflen);
+ flush = ibuflen == 0 ? Z_FINISH : Z_NO_FLUSH;
+
+ do {
+ if (self->zst.avail_out == 0) {
+ if (OutputBuffer_WindowGrow(&buffer, &window,
+ &self->zst.next_out, &self->zst.avail_out) < 0) {
+ goto abort;
+ }
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ err = inflate(&self->zst, flush);
+ Py_END_ALLOW_THREADS
+
+ switch (err) {
+ case Z_OK: /* fall through */
+ case Z_BUF_ERROR: /* fall through */
+ case Z_STREAM_END:
+ break;
+ default:
+ goto save;
+ }
+
+ } while (self->zst.avail_out == 0 || err == Z_NEED_DICT);
+
+ } while (err != Z_STREAM_END && ibuflen != 0);
+
+ save:
+ if (save_unconsumed_input(self, &data, err) < 0) {
+ goto abort;
+ }
+
+ /* If at end of stream, clean up any memory allocated by zlib. */
+ if (err == Z_STREAM_END) {
+ self->eof = 1;
+ self->is_initialised = 0;
+ err = inflateEnd(&self->zst);
+ if (err != Z_OK) {
+ zlib_error(state, self->zst, err, "while finishing decompression");
+ goto abort;
+ }
+ }
+
+ return_value = OutputBuffer_WindowFinish(&buffer, &window, self->zst.avail_out);
+ if (return_value != NULL) {
+ goto success;
+ }
+
+ abort:
+ OutputBuffer_WindowOnError(&buffer, &window);
+ return_value = NULL;
+ success:
+ PyBuffer_Release(&data);
+ LEAVE_ZLIB(self);
+ return return_value;
+}
+
+
+typedef struct {
+ PyObject_HEAD
+ z_stream zst;
+ PyObject *zdict;
+ PyThread_type_lock lock;
+ PyObject *unused_data;
+ uint8_t *input_buffer;
+ Py_ssize_t input_buffer_size;
+ /* zst>avail_in is only 32 bit, so we store the true length
+ separately. Conversion and looping is encapsulated in
+ decompress_buf() */
+ Py_ssize_t avail_in_real;
+ bool is_initialised;
+ char eof; /* T_BOOL expects a char */
+ char needs_input;
+} ZlibDecompressor;
+
+/*[clinic input]
+class zlib.ZlibDecompressor "ZlibDecompressor *" "&ZlibDecompressorType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=0658178ab94645df]*/
+
+static void
+ZlibDecompressor_dealloc(ZlibDecompressor *self)
+{
+ PyObject *type = (PyObject *)Py_TYPE(self);
+ PyThread_free_lock(self->lock);
+ if (self->is_initialised) {
+ inflateEnd(&self->zst);
+ }
+ PyMem_Free(self->input_buffer);
+ Py_CLEAR(self->unused_data);
+ Py_CLEAR(self->zdict);
+ PyObject_Free(self);
+ Py_DECREF(type);
+}
+
+static int
+set_inflate_zdict_ZlibDecompressor(zlibstate *state, ZlibDecompressor *self)
+{
+ Py_buffer zdict_buf;
+ if (PyObject_GetBuffer(self->zdict, &zdict_buf, PyBUF_SIMPLE) == -1) {
+ return -1;
+ }
+ if ((size_t)zdict_buf.len > UINT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "zdict length does not fit in an unsigned int");
+ PyBuffer_Release(&zdict_buf);
+ return -1;
+ }
+ int err;
+ err = inflateSetDictionary(&self->zst,
+ zdict_buf.buf, (unsigned int)zdict_buf.len);
+ PyBuffer_Release(&zdict_buf);
+ if (err != Z_OK) {
+ zlib_error(state, self->zst, err, "while setting zdict");
+ return -1;
+ }
+ return 0;
+}
+
+static Py_ssize_t
+arrange_output_buffer_with_maximum(uint32_t *avail_out,
+ uint8_t **next_out,
+ PyObject **buffer,
+ Py_ssize_t length,
+ Py_ssize_t max_length)
+{
+ Py_ssize_t occupied;
+
+ if (*buffer == NULL) {
+ if (!(*buffer = PyBytes_FromStringAndSize(NULL, length)))
+ return -1;
+ occupied = 0;
+ }
+ else {
+ occupied = *next_out - (uint8_t *)PyBytes_AS_STRING(*buffer);
+
+ if (length == occupied) {
+ Py_ssize_t new_length;
+ assert(length <= max_length);
+ /* can not scale the buffer over max_length */
+ if (length == max_length)
+ return -2;
+ if (length <= (max_length >> 1))
+ new_length = length << 1;
+ else
+ new_length = max_length;
+ if (_PyBytes_Resize(buffer, new_length) < 0)
+ return -1;
+ length = new_length;
+ }
+ }
+
+ *avail_out = (uint32_t)Py_MIN((size_t)(length - occupied), UINT32_MAX);
+ *next_out = (uint8_t *)PyBytes_AS_STRING(*buffer) + occupied;
+
+ return length;
+}
+
+/* Decompress data of length self->avail_in_real in self->state.next_in. The
+ output buffer is allocated dynamically and returned. If the max_length is
+ of sufficiently low size, max_length is allocated immediately. At most
+ max_length bytes are returned, so some of the input may not be consumed.
+ self->state.next_in and self->avail_in_real are updated to reflect the
+ consumed input. */
+static PyObject*
+decompress_buf(ZlibDecompressor *self, Py_ssize_t max_length)
+{
+ /* data_size is strictly positive, but because we repeatedly have to
+ compare against max_length and PyBytes_GET_SIZE we declare it as
+ signed */
+ PyObject *return_value = NULL;
+ Py_ssize_t hard_limit;
+ Py_ssize_t obuflen;
+ zlibstate *state = PyType_GetModuleState(Py_TYPE(self));
+
+ int err = Z_OK;
+
+ /* When sys.maxsize is passed as default use DEF_BUF_SIZE as start buffer.
+ In this particular case the data may not necessarily be very big, so
+ it is better to grow dynamically.*/
+ if ((max_length < 0) || max_length == PY_SSIZE_T_MAX) {
+ hard_limit = PY_SSIZE_T_MAX;
+ obuflen = DEF_BUF_SIZE;
+ } else {
+ /* Assume that decompressor is used in file decompression with a fixed
+ block size of max_length. In that case we will reach max_length almost
+ always (except at the end of the file). So it makes sense to allocate
+ max_length. */
+ hard_limit = max_length;
+ obuflen = max_length;
+ if (obuflen > DEF_MAX_INITIAL_BUF_SIZE){
+ // Safeguard against memory overflow.
+ obuflen = DEF_MAX_INITIAL_BUF_SIZE;
+ }
+ }
+
+ do {
+ arrange_input_buffer(&(self->zst), &(self->avail_in_real));
+
+ do {
+ obuflen = arrange_output_buffer_with_maximum(&(self->zst.avail_out),
+ &(self->zst.next_out),
+ &return_value,
+ obuflen,
+ hard_limit);
+ if (obuflen == -1){
+ PyErr_SetString(PyExc_MemoryError,
+ "Insufficient memory for buffer allocation");
+ goto error;
+ }
+ else if (obuflen == -2) {
+ break;
+ }
+ Py_BEGIN_ALLOW_THREADS
+ err = inflate(&self->zst, Z_SYNC_FLUSH);
+ Py_END_ALLOW_THREADS
+ switch (err) {
+ case Z_OK: /* fall through */
+ case Z_BUF_ERROR: /* fall through */
+ case Z_STREAM_END:
+ break;
+ default:
+ if (err == Z_NEED_DICT) {
+ goto error;
+ }
+ else {
+ break;
+ }
+ }
+ } while (self->zst.avail_out == 0);
+ } while(err != Z_STREAM_END && self->avail_in_real != 0);
+
+ if (err == Z_STREAM_END) {
+ self->eof = 1;
+ self->is_initialised = 0;
+ /* Unlike the Decompress object we call inflateEnd here as there are no
+ backwards compatibility issues */
+ err = inflateEnd(&self->zst);
+ if (err != Z_OK) {
+ zlib_error(state, self->zst, err, "while finishing decompression");
+ goto error;
+ }
+ } else if (err != Z_OK && err != Z_BUF_ERROR) {
+ zlib_error(state, self->zst, err, "while decompressing data");
+ goto error;
+ }
+
+ self->avail_in_real += self->zst.avail_in;
+
+ if (_PyBytes_Resize(&return_value, self->zst.next_out -
+ (uint8_t *)PyBytes_AS_STRING(return_value)) != 0) {
+ goto error;
+ }
+
+ goto success;
+error:
+ Py_CLEAR(return_value);
+success:
+ return return_value;
+}
+
+
+static PyObject *
+decompress(ZlibDecompressor *self, uint8_t *data,
+ size_t len, Py_ssize_t max_length)
+{
+ bool input_buffer_in_use;
+ PyObject *result;
+
+ /* Prepend unconsumed input if necessary */
+ if (self->zst.next_in != NULL) {
+ size_t avail_now, avail_total;
+
+ /* Number of bytes we can append to input buffer */
+ avail_now = (self->input_buffer + self->input_buffer_size)
+ - (self->zst.next_in + self->avail_in_real);
+
+ /* Number of bytes we can append if we move existing
+ contents to beginning of buffer (overwriting
+ consumed input) */
+ avail_total = self->input_buffer_size - self->avail_in_real;
+
+ if (avail_total < len) {
+ size_t offset = self->zst.next_in - self->input_buffer;
+ uint8_t *tmp;
+ size_t new_size = self->input_buffer_size + len - avail_now;
+
+ /* Assign to temporary variable first, so we don't
+ lose address of allocated buffer if realloc fails */
+ tmp = PyMem_Realloc(self->input_buffer, new_size);
+ if (tmp == NULL) {
+ PyErr_SetNone(PyExc_MemoryError);
+ return NULL;
+ }
+ self->input_buffer = tmp;
+ self->input_buffer_size = new_size;
+
+ self->zst.next_in = self->input_buffer + offset;
+ }
+ else if (avail_now < len) {
+ memmove(self->input_buffer, self->zst.next_in,
+ self->avail_in_real);
+ self->zst.next_in = self->input_buffer;
+ }
+ memcpy((void*)(self->zst.next_in + self->avail_in_real), data, len);
+ self->avail_in_real += len;
+ input_buffer_in_use = 1;
+ }
+ else {
+ self->zst.next_in = data;
+ self->avail_in_real = len;
+ input_buffer_in_use = 0;
+ }
+
+ result = decompress_buf(self, max_length);
+ if(result == NULL) {
+ self->zst.next_in = NULL;
+ return NULL;
+ }
+
+ if (self->eof) {
+ self->needs_input = 0;
+
+ if (self->avail_in_real > 0) {
+ PyObject *unused_data = PyBytes_FromStringAndSize(
+ (char *)self->zst.next_in, self->avail_in_real);
+ if (unused_data == NULL) {
+ goto error;
+ }
+ Py_XSETREF(self->unused_data, unused_data);
+ }
+ }
+ else if (self->avail_in_real == 0) {
+ self->zst.next_in = NULL;
+ self->needs_input = 1;
+ }
+ else {
+ self->needs_input = 0;
+
+ /* If we did not use the input buffer, we now have
+ to copy the tail from the caller's buffer into the
+ input buffer */
+ if (!input_buffer_in_use) {
+
+ /* Discard buffer if it's too small
+ (resizing it may needlessly copy the current contents) */
+ if (self->input_buffer != NULL &&
+ self->input_buffer_size < self->avail_in_real) {
+ PyMem_Free(self->input_buffer);
+ self->input_buffer = NULL;
+ }
+
+ /* Allocate if necessary */
+ if (self->input_buffer == NULL) {
+ self->input_buffer = PyMem_Malloc(self->avail_in_real);
+ if (self->input_buffer == NULL) {
+ PyErr_SetNone(PyExc_MemoryError);
+ goto error;
+ }
+ self->input_buffer_size = self->avail_in_real;
+ }
+
+ /* Copy tail */
+ memcpy(self->input_buffer, self->zst.next_in, self->avail_in_real);
+ self->zst.next_in = self->input_buffer;
+ }
+ }
+ return result;
+
+error:
+ Py_XDECREF(result);
+ return NULL;
+}
+
+/*[clinic input]
+zlib.ZlibDecompressor.decompress
+
+ data: Py_buffer
+ max_length: Py_ssize_t=-1
+
+Decompress *data*, returning uncompressed data as bytes.
+
+If *max_length* is nonnegative, returns at most *max_length* bytes of
+decompressed data. If this limit is reached and further output can be
+produced, *self.needs_input* will be set to ``False``. In this case, the next
+call to *decompress()* may provide *data* as b'' to obtain more of the output.
+
+If all of the input data was decompressed and returned (either because this
+was less than *max_length* bytes, or because *max_length* was negative),
+*self.needs_input* will be set to True.
+
+Attempting to decompress data after the end of stream is reached raises an
+EOFError. Any data found after the end of the stream is ignored and saved in
+the unused_data attribute.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_ZlibDecompressor_decompress_impl(ZlibDecompressor *self,
+ Py_buffer *data, Py_ssize_t max_length)
+/*[clinic end generated code: output=990d32787b775f85 input=0b29d99715250b96]*/
+
+{
+ PyObject *result = NULL;
+
+ ENTER_ZLIB(self);
+ if (self->eof) {
+ PyErr_SetString(PyExc_EOFError, "End of stream already reached");
+ }
+ else {
+ result = decompress(self, data->buf, data->len, max_length);
+ }
+ LEAVE_ZLIB(self);
+ return result;
+}
+
+PyDoc_STRVAR(ZlibDecompressor__new____doc__,
+"_ZlibDecompressor(wbits=15, zdict=b\'\')\n"
+"--\n"
+"\n"
+"Create a decompressor object for decompressing data incrementally.\n"
+"\n"
+" wbits = 15\n"
+" zdict\n"
+" The predefined compression dictionary. This is a sequence of bytes\n"
+" (such as a bytes object) containing subsequences that are expected\n"
+" to occur frequently in the data that is to be compressed. Those\n"
+" subsequences that are expected to be most common should come at the\n"
+" end of the dictionary. This must be the same dictionary as used by the\n"
+" compressor that produced the input data.\n"
+"\n");
+
+static PyObject *
+ZlibDecompressor__new__(PyTypeObject *cls,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *keywords[] = {"wbits", "zdict", NULL};
+ static const char * const format = "|iO:_ZlibDecompressor";
+ int wbits = MAX_WBITS;
+ PyObject *zdict = NULL;
+ zlibstate *state = PyType_GetModuleState(cls);
+
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kwargs, format, keywords, &wbits, &zdict)) {
+ return NULL;
+ }
+ ZlibDecompressor *self = PyObject_New(ZlibDecompressor, cls);
+ self->eof = 0;
+ self->needs_input = 1;
+ self->avail_in_real = 0;
+ self->input_buffer = NULL;
+ self->input_buffer_size = 0;
+ self->zdict = Py_XNewRef(zdict);
+ self->zst.opaque = NULL;
+ self->zst.zalloc = PyZlib_Malloc;
+ self->zst.zfree = PyZlib_Free;
+ self->zst.next_in = NULL;
+ self->zst.avail_in = 0;
+ self->unused_data = PyBytes_FromStringAndSize(NULL, 0);
+ if (self->unused_data == NULL) {
+ Py_CLEAR(self);
+ return NULL;
+ }
+ self->lock = PyThread_allocate_lock();
+ if (self->lock == NULL) {
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ return NULL;
+ }
+ int err = inflateInit2(&(self->zst), wbits);
+ switch (err) {
+ case Z_OK:
+ self->is_initialised = 1;
+ if (self->zdict != NULL && wbits < 0) {
+ if (set_inflate_zdict_ZlibDecompressor(state, self) < 0) {
+ Py_DECREF(self);
+ return NULL;
+ }
+ }
+ return (PyObject *)self;
+ case Z_STREAM_ERROR:
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_ValueError, "Invalid initialization option");
+ return NULL;
+ case Z_MEM_ERROR:
+ Py_DECREF(self);
+ PyErr_SetString(PyExc_MemoryError,
+ "Can't allocate memory for decompression object");
+ return NULL;
+ default:
+ zlib_error(state, self->zst, err, "while creating decompression object");
+ Py_DECREF(self);
+ return NULL;
+ }
+}
+
+#include "clinic/zlibmodule.c.h"
+
+static PyMethodDef comp_methods[] =
+{
+ ZLIB_COMPRESS_COMPRESS_METHODDEF
+ ZLIB_COMPRESS_FLUSH_METHODDEF
+ ZLIB_COMPRESS_COPY_METHODDEF
+ ZLIB_COMPRESS___COPY___METHODDEF
+ ZLIB_COMPRESS___DEEPCOPY___METHODDEF
+ {NULL, NULL}
+};
+
+static PyMethodDef Decomp_methods[] =
+{
+ ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF
+ ZLIB_DECOMPRESS_FLUSH_METHODDEF
+ ZLIB_DECOMPRESS_COPY_METHODDEF
+ ZLIB_DECOMPRESS___COPY___METHODDEF
+ ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
+ {NULL, NULL}
+};
+
+static PyMethodDef ZlibDecompressor_methods[] = {
+ ZLIB_ZLIBDECOMPRESSOR_DECOMPRESS_METHODDEF
+ {NULL}
+};
+
+#define COMP_OFF(x) offsetof(compobject, x)
+static PyMemberDef Decomp_members[] = {
+ {"unused_data", T_OBJECT, COMP_OFF(unused_data), READONLY},
+ {"unconsumed_tail", T_OBJECT, COMP_OFF(unconsumed_tail), READONLY},
+ {"eof", T_BOOL, COMP_OFF(eof), READONLY},
+ {NULL},
+};
+
+PyDoc_STRVAR(ZlibDecompressor_eof__doc__,
+"True if the end-of-stream marker has been reached.");
+
+PyDoc_STRVAR(ZlibDecompressor_unused_data__doc__,
+"Data found after the end of the compressed stream.");
+
+PyDoc_STRVAR(ZlibDecompressor_needs_input_doc,
+"True if more input is needed before more decompressed data can be produced.");
+
+static PyMemberDef ZlibDecompressor_members[] = {
+ {"eof", T_BOOL, offsetof(ZlibDecompressor, eof),
+ READONLY, ZlibDecompressor_eof__doc__},
+ {"unused_data", T_OBJECT_EX, offsetof(ZlibDecompressor, unused_data),
+ READONLY, ZlibDecompressor_unused_data__doc__},
+ {"needs_input", T_BOOL, offsetof(ZlibDecompressor, needs_input), READONLY,
+ ZlibDecompressor_needs_input_doc},
+ {NULL},
+};
+
+
+/*[clinic input]
+zlib.adler32
+
+ data: Py_buffer
+ value: unsigned_int(bitwise=True) = 1
+ Starting value of the checksum.
+ /
+
+Compute an Adler-32 checksum of data.
+
+The returned checksum is an integer.
+[clinic start generated code]*/
+
+static PyObject *
+zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value)
+/*[clinic end generated code: output=422106f5ca8c92c0 input=6ff4557872160e88]*/
+{
+ /* Releasing the GIL for very small buffers is inefficient
+ and may lower performance */
+ if (data->len > 1024*5) {
+ unsigned char *buf = data->buf;
+ Py_ssize_t len = data->len;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* Avoid truncation of length for very large buffers. adler32() takes
+ length as an unsigned int, which may be narrower than Py_ssize_t. */
+ while ((size_t)len > UINT_MAX) {
+ value = adler32(value, buf, UINT_MAX);
+ buf += (size_t) UINT_MAX;
+ len -= (size_t) UINT_MAX;
+ }
+ value = adler32(value, buf, (unsigned int)len);
+ Py_END_ALLOW_THREADS
+ } else {
+ value = adler32(value, data->buf, (unsigned int)data->len);
+ }
+ return PyLong_FromUnsignedLong(value & 0xffffffffU);
+}
+
+/*[clinic input]
+zlib.crc32 -> unsigned_int
+
+ data: Py_buffer
+ value: unsigned_int(bitwise=True) = 0
+ Starting value of the checksum.
+ /
+
+Compute a CRC-32 checksum of data.
+
+The returned checksum is an integer.
+[clinic start generated code]*/
+
+static unsigned int
+zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value)
+/*[clinic end generated code: output=b217562e4fe6d6a6 input=1229cb2fb5ea948a]*/
+{
+ /* Releasing the GIL for very small buffers is inefficient
+ and may lower performance */
+ if (data->len > 1024*5) {
+ unsigned char *buf = data->buf;
+ Py_ssize_t len = data->len;
+
+ Py_BEGIN_ALLOW_THREADS
+ /* Avoid truncation of length for very large buffers. crc32() takes
+ length as an unsigned int, which may be narrower than Py_ssize_t.
+ We further limit size due to bugs in Apple's macOS zlib.
+ See https://github.com/python/cpython/issues/105967.
+ */
+#define ZLIB_CRC_CHUNK_SIZE 0x40000000
+#if ZLIB_CRC_CHUNK_SIZE > INT_MAX
+# error "unsupported less than 32-bit platform?"
+#endif
+ while ((size_t)len > ZLIB_CRC_CHUNK_SIZE) {
+ value = crc32(value, buf, ZLIB_CRC_CHUNK_SIZE);
+ buf += (size_t) ZLIB_CRC_CHUNK_SIZE;
+ len -= (size_t) ZLIB_CRC_CHUNK_SIZE;
+ }
+#undef ZLIB_CRC_CHUNK_SIZE
+ value = crc32(value, buf, (unsigned int)len);
+ Py_END_ALLOW_THREADS
+ } else {
+ value = crc32(value, data->buf, (unsigned int)data->len);
+ }
+ return value;
+}
+
+
+static PyMethodDef zlib_methods[] =
+{
+ ZLIB_ADLER32_METHODDEF
+ ZLIB_COMPRESS_METHODDEF
+ ZLIB_COMPRESSOBJ_METHODDEF
+ ZLIB_CRC32_METHODDEF
+ ZLIB_DECOMPRESS_METHODDEF
+ ZLIB_DECOMPRESSOBJ_METHODDEF
+ {NULL, NULL}
+};
+
+static PyType_Slot Comptype_slots[] = {
+ {Py_tp_dealloc, Comp_dealloc},
+ {Py_tp_methods, comp_methods},
+ {0, 0},
+};
+
+static PyType_Spec Comptype_spec = {
+ .name = "zlib.Compress",
+ .basicsize = sizeof(compobject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ .slots= Comptype_slots,
+};
+
+static PyType_Slot Decomptype_slots[] = {
+ {Py_tp_dealloc, Decomp_dealloc},
+ {Py_tp_methods, Decomp_methods},
+ {Py_tp_members, Decomp_members},
+ {0, 0},
+};
+
+static PyType_Spec Decomptype_spec = {
+ .name = "zlib.Decompress",
+ .basicsize = sizeof(compobject),
+ .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
+ .slots = Decomptype_slots,
+};
+
+static PyType_Slot ZlibDecompressor_type_slots[] = {
+ {Py_tp_dealloc, ZlibDecompressor_dealloc},
+ {Py_tp_members, ZlibDecompressor_members},
+ {Py_tp_new, ZlibDecompressor__new__},
+ {Py_tp_doc, (char *)ZlibDecompressor__new____doc__},
+ {Py_tp_methods, ZlibDecompressor_methods},
+ {0, 0},
+};
+
+static PyType_Spec ZlibDecompressor_type_spec = {
+ .name = "zlib._ZlibDecompressor",
+ .basicsize = sizeof(ZlibDecompressor),
+ // Calling PyType_GetModuleState() on a subclass is not safe.
+ // ZlibDecompressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
+ // which prevents to create a subclass.
+ // So calling PyType_GetModuleState() in this file is always safe.
+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE),
+ .slots = ZlibDecompressor_type_slots,
+};
+PyDoc_STRVAR(zlib_module_documentation,
+"The functions in this module allow compression and decompression using the\n"
+"zlib library, which is based on GNU zip.\n"
+"\n"
+"adler32(string[, start]) -- Compute an Adler-32 checksum.\n"
+"compress(data[, level]) -- Compress data, with compression level 0-9 or -1.\n"
+"compressobj([level[, ...]]) -- Return a compressor object.\n"
+"crc32(string[, start]) -- Compute a CRC-32 checksum.\n"
+"decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n"
+"decompressobj([wbits[, zdict]]) -- Return a decompressor object.\n"
+"\n"
+"'wbits' is window buffer size and container format.\n"
+"Compressor objects support compress() and flush() methods; decompressor\n"
+"objects support decompress() and flush().");
+
+static int
+zlib_clear(PyObject *mod)
+{
+ zlibstate *state = get_zlib_state(mod);
+ Py_CLEAR(state->Comptype);
+ Py_CLEAR(state->Decomptype);
+ Py_CLEAR(state->ZlibDecompressorType);
+ Py_CLEAR(state->ZlibError);
+ return 0;
+}
+
+static int
+zlib_traverse(PyObject *mod, visitproc visit, void *arg)
+{
+ zlibstate *state = get_zlib_state(mod);
+ Py_VISIT(state->Comptype);
+ Py_VISIT(state->Decomptype);
+ Py_VISIT(state->ZlibDecompressorType);
+ Py_VISIT(state->ZlibError);
+ return 0;
+}
+
+static void
+zlib_free(void *mod)
+{
+ zlib_clear((PyObject *)mod);
+}
+
+static int
+zlib_exec(PyObject *mod)
+{
+ zlibstate *state = get_zlib_state(mod);
+
+ state->Comptype = (PyTypeObject *)PyType_FromModuleAndSpec(
+ mod, &Comptype_spec, NULL);
+ if (state->Comptype == NULL) {
+ return -1;
+ }
+
+ state->Decomptype = (PyTypeObject *)PyType_FromModuleAndSpec(
+ mod, &Decomptype_spec, NULL);
+ if (state->Decomptype == NULL) {
+ return -1;
+ }
+
+ state->ZlibDecompressorType = (PyTypeObject *)PyType_FromModuleAndSpec(
+ mod, &ZlibDecompressor_type_spec, NULL);
+ if (state->ZlibDecompressorType == NULL) {
+ return -1;
+ }
+
+ state->ZlibError = PyErr_NewException("zlib.error", NULL, NULL);
+ if (state->ZlibError == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddObject(mod, "error", Py_NewRef(state->ZlibError)) < 0) {
+ Py_DECREF(state->ZlibError);
+ return -1;
+ }
+ if (PyModule_AddObject(mod, "_ZlibDecompressor",
+ Py_NewRef(state->ZlibDecompressorType)) < 0) {
+ Py_DECREF(state->ZlibDecompressorType);
+ return -1;
+ }
+
+#define ZLIB_ADD_INT_MACRO(c) \
+ do { \
+ if ((PyModule_AddIntConstant(mod, #c, c)) < 0) { \
+ return -1; \
+ } \
+ } while(0)
+
+ ZLIB_ADD_INT_MACRO(MAX_WBITS);
+ ZLIB_ADD_INT_MACRO(DEFLATED);
+ ZLIB_ADD_INT_MACRO(DEF_MEM_LEVEL);
+ ZLIB_ADD_INT_MACRO(DEF_BUF_SIZE);
+ // compression levels
+ ZLIB_ADD_INT_MACRO(Z_NO_COMPRESSION);
+ ZLIB_ADD_INT_MACRO(Z_BEST_SPEED);
+ ZLIB_ADD_INT_MACRO(Z_BEST_COMPRESSION);
+ ZLIB_ADD_INT_MACRO(Z_DEFAULT_COMPRESSION);
+ // compression strategies
+ ZLIB_ADD_INT_MACRO(Z_FILTERED);
+ ZLIB_ADD_INT_MACRO(Z_HUFFMAN_ONLY);
+#ifdef Z_RLE // 1.2.0.1
+ ZLIB_ADD_INT_MACRO(Z_RLE);
+#endif
+#ifdef Z_FIXED // 1.2.2.2
+ ZLIB_ADD_INT_MACRO(Z_FIXED);
+#endif
+ ZLIB_ADD_INT_MACRO(Z_DEFAULT_STRATEGY);
+ // allowed flush values
+ ZLIB_ADD_INT_MACRO(Z_NO_FLUSH);
+ ZLIB_ADD_INT_MACRO(Z_PARTIAL_FLUSH);
+ ZLIB_ADD_INT_MACRO(Z_SYNC_FLUSH);
+ ZLIB_ADD_INT_MACRO(Z_FULL_FLUSH);
+ ZLIB_ADD_INT_MACRO(Z_FINISH);
+#ifdef Z_BLOCK // 1.2.0.5 for inflate, 1.2.3.4 for deflate
+ ZLIB_ADD_INT_MACRO(Z_BLOCK);
+#endif
+#ifdef Z_TREES // 1.2.3.4, only for inflate
+ ZLIB_ADD_INT_MACRO(Z_TREES);
+#endif
+ PyObject *ver = PyUnicode_FromString(ZLIB_VERSION);
+ if (ver == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddObject(mod, "ZLIB_VERSION", ver) < 0) {
+ Py_DECREF(ver);
+ return -1;
+ }
+
+ ver = PyUnicode_FromString(zlibVersion());
+ if (ver == NULL) {
+ return -1;
+ }
+
+ if (PyModule_AddObject(mod, "ZLIB_RUNTIME_VERSION", ver) < 0) {
+ Py_DECREF(ver);
+ return -1;
+ }
+
+ if (PyModule_AddStringConstant(mod, "__version__", "1.0") < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static PyModuleDef_Slot zlib_slots[] = {
+ {Py_mod_exec, zlib_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {0, NULL}
+};
+
+static struct PyModuleDef zlibmodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "zlib",
+ .m_doc = zlib_module_documentation,
+ .m_size = sizeof(zlibstate),
+ .m_methods = zlib_methods,
+ .m_slots = zlib_slots,
+ .m_traverse = zlib_traverse,
+ .m_clear = zlib_clear,
+ .m_free = zlib_free,
+};
+
+PyMODINIT_FUNC
+PyInit_zlib(void)
+{
+ return PyModuleDef_Init(&zlibmodule);
+}